public double[][] GetIsotopeDistribution(double massPrecision) { if (AtomType.Length == 0) { return(new[] { new double[] { 0 }, new double[] { 1 } }); } ChemElement element = ChemElements.Elements[AtomType[0]]; double[][] distrib = element.GetIsotopeDistribution(AtomCount[0]); for (int i = 1; i < AtomType.Length; i++) { element = ChemElements.Elements[AtomType[i]]; distrib = Convolute(distrib, element.GetIsotopeDistribution(AtomCount[i]), massPrecision, 1e-6); } return(distrib); }
public double[][] GetIsotopeDistributionAlteredDeuterium(double deltaDeuterium, double massPrecision) { if (AtomType.Length == 0) { return(new[] { new double[] { 0 }, new double[] { 1 } }); } ChemElement element = ChemElements.Elements[AtomType[0]]; double[][] distrib = element.IsHydrogen() ? element.GetIsotopeDistributionAlteredIsotopeContribution(AtomCount[0], 1, deltaDeuterium) : element.GetIsotopeDistribution(AtomCount[0]); for (int i = 1; i < AtomType.Length; i++) { element = ChemElements.Elements[AtomType[i]]; distrib = Convolute(distrib, element.GetIsotopeDistribution(AtomCount[i]), massPrecision, 1e-6); } return(distrib); }