Get the exact mass of a specified isotope for an atom.
@param atomicNumber atomic number
@param massNumber the mass number
@return the exact mass
337697
public double getExactMass(Integer atomicNumber, Integer massNumber) {
        if (atomicNumber == null || massNumber == null)
            return 0;
        for (IIsotope isotope : this.isotopes[atomicNumber]) {
            if (isotope.getMassNumber().equals(massNumber))
                return isotope.getExactMass();
        }
        return 0;
    }
672970
@Pure
	@Inline(value = "new $2($1.longValue())", imported = AtomicLong.class)
	public static AtomicLong toAtomicLong(AtomicDouble number) {
		return new AtomicLong(number.longValue());
	}
229638
public int[] getTopoEquivClassbyHuXu(IAtomContainer atomContainer) throws NoSuchAtomException {
        double nodeSequence[] = prepareNode(atomContainer);
        nodeMatrix = buildNodeMatrix(nodeSequence);
        bondMatrix = buildBondMatrix();
        weight = buildWeightMatrix(nodeMatrix, bondMatrix);
        return findTopoEquivClass(weight);
    }
1370701
@Override
    public DescriptorValue calculate(IAtomContainer atomContainer) {
        IAtomContainer cloneContainer = AtomContainerManipulator.removeHydrogens(atomContainer);
        double petitjeanNumber; //weinerPath
        int diameter = PathTools.getMolecularGraphDiameter(cloneContainer);
        int radius = PathTools.getMolecularGraphRadius(cloneContainer);

        if (diameter == 0)
            petitjeanNumber = 0;
        else
            petitjeanNumber = (diameter - radius) / (double) diameter;
        return new DescriptorValue(getSpecification(), getParameterNames(), getParameters(), new DoubleResult(
                petitjeanNumber), getDescriptorNames());
    }
1367916
@Override
    public DescriptorValue calculate(IBond bond, IAtomContainer atomContainer) {
        double value = 0;
        // FIXME: for now I'll cache a few modified atomic properties, and restore them at the end of this method
        String originalAtomtypeName1 = bond.getBegin().getAtomTypeName();
        Integer originalNeighborCount1 = bond.getBegin().getFormalNeighbourCount();
        IAtomType.Hybridization originalHybridization1 = bond.getBegin().getHybridization();
        Integer originalValency1 = bond.getBegin().getValency();
        String originalAtomtypeName2 = bond.getEnd().getAtomTypeName();
        Integer originalNeighborCount2 = bond.getEnd().getFormalNeighbourCount();
        IAtomType.Hybridization originalHybridization2 = bond.getEnd().getHybridization();
        Integer originalValency2 = bond.getEnd().getValency();
        Double originalBondOrderSum1 = bond.getBegin().getBondOrderSum();
        Order originalMaxBondOrder1 = bond.getBegin().getMaxBondOrder();
        Double originalBondOrderSum2 = bond.getEnd().getBondOrderSum();
        Order originalMaxBondOrder2 = bond.getEnd().getMaxBondOrder();

        if (!isCachedAtomContainer(atomContainer)) {
            try {
                AtomContainerManipulator.percieveAtomTypesAndConfigureAtoms(atomContainer);
                LonePairElectronChecker lpcheck = new LonePairElectronChecker();
                lpcheck.saturate(atomContainer);
            } catch (CDKException e) {
                return getDummyDescriptorValue(e);
            }

        }
        if (!bond.getOrder().equals(IBond.Order.SINGLE)) {
            try {
                value = IonizationPotentialTool.predictIP(atomContainer, bond);
            } catch (CDKException e) {
                return getDummyDescriptorValue(e);
            }
        }
        bond.getBegin().setAtomTypeName(originalAtomtypeName1);
        bond.getBegin().setHybridization(originalHybridization1);
        bond.getBegin().setValency(originalValency1);
        bond.getBegin().setFormalNeighbourCount(originalNeighborCount1);
        bond.getEnd().setAtomTypeName(originalAtomtypeName2);
        bond.getEnd().setHybridization(originalHybridization2);
        bond.getEnd().setValency(originalValency2);
        bond.getEnd().setFormalNeighbourCount(originalNeighborCount2);
        bond.getBegin().setMaxBondOrder(originalMaxBondOrder1);
        bond.getBegin().setBondOrderSum(originalBondOrderSum1);
        bond.getEnd().setMaxBondOrder(originalMaxBondOrder2);
        bond.getEnd().setBondOrderSum(originalBondOrderSum2);

        return new DescriptorValue(getSpecification(), getParameterNames(), getParameters(), new DoubleResult(value),
                DESCRIPTOR_NAMES);
    }
841110
@Pure
	@Inline(value = "$2.valueOf($1.intValue())", imported = Integer.class)
	public static Integer toInteger(AtomicDouble number) {
		return Integer.valueOf(number.intValue());
	}
1142090
@Override
    public DescriptorValue calculate(IAtomContainer atomContainer) {
        IAtomContainer container;
        try {
            container = (IAtomContainer) atomContainer.clone();
            container = AtomContainerManipulator.removeHydrogens(container);
        } catch (CloneNotSupportedException e) {
            DoubleArrayResult result = new DoubleArrayResult(5);
            for (int i = 0; i < 5; i++)
                result.add(Double.NaN);
            return new DescriptorValue(getSpecification(), getParameterNames(), getParameters(), result,
                    getDescriptorNames(), new CDKException("Error during cloner: " + e.getMessage(), e));
        }

        try {
            double[] w = listConvertion(container);
            int natom = container.getAtomCount();
            int[][] distancematrix = TopologicalMatrix.getMatrix(container);
            double[] masSum = new double[5];

            for (int k = 0; k < 5; k++) {
                for (int i = 0; i < natom; i++) {
                    for (int j = 0; j < natom; j++) {

                        if (distancematrix[i][j] == k) {
                            masSum[k] += w[i] * w[j];
                        } else
                            masSum[k] += 0.0;
                    }
                }
                if (k > 0) masSum[k] = masSum[k] / 2;

            }
            DoubleArrayResult result = new DoubleArrayResult(5);
            for (double aMasSum : masSum) {
                result.add(aMasSum);
            }

            return new DescriptorValue(getSpecification(), getParameterNames(), getParameters(), result,
                    getDescriptorNames());

        } catch (IOException | ClassNotFoundException ex) {
            DoubleArrayResult result = new DoubleArrayResult(5);
            for (int i = 0; i < 5; i++)
                result.add(Double.NaN);
            return new DescriptorValue(getSpecification(), getParameterNames(), getParameters(), result,
                    getDescriptorNames(), new CDKException("Error while calculating the ATS_mass descriptor: "
                            + ex.getMessage(), ex));
        }
    }
845631
@Pure
	@Inline(value = "$2.valueOf($1.longValue())", imported = Long.class)
	public static Long toLong(AtomicLong number) {
		return number.longValue();
	}
1000879
public IAtom configure(IAtom atom, IIsotope isotope) {
        atom.setMassNumber(isotope.getMassNumber());
        atom.setSymbol(isotope.getSymbol());
        atom.setExactMass(isotope.getExactMass());
        atom.setAtomicNumber(isotope.getAtomicNumber());
        atom.setNaturalAbundance(isotope.getNaturalAbundance());
        return atom;
    }
1363345
@Override
    public String getSymbol() {
        if (atomicNumber == null)
            return null;
        if (atomicNumber == 0)
            return "R";
        return Elements.ofNumber(atomicNumber).symbol();
    }
597660
IAtom toCDKAtom(Atom beamAtom, int hCount) {

        IAtom cdkAtom = newCDKAtom(beamAtom);

        cdkAtom.setImplicitHydrogenCount(hCount);
        cdkAtom.setFormalCharge(beamAtom.charge());

        if (beamAtom.isotope() >= 0) cdkAtom.setMassNumber(beamAtom.isotope());

        if (beamAtom.aromatic()) cdkAtom.setIsAromatic(true);

        if (beamAtom.atomClass() > 0) cdkAtom.setProperty(ATOM_ATOM_MAPPING, beamAtom.atomClass());

        return cdkAtom;
    }
1082349
@Pure
	@Inline(value = "new $2($1)", imported = AtomicLong.class)
	public static AtomicLong toAtomicLong(short number) {
		return new AtomicLong(number);
	}
717599
public IAtom[] getAtoms() {
        IAtom[] returnAtoms = new Atom[atomCount];
        System.arraycopy(this.atoms, 0, returnAtoms, 0, returnAtoms.length);
        return returnAtoms;
    }
1255957
def get_number_of_atoms(self):
        
        strc = self.get_output_structure()
        if not strc:
            return None
        return Property(scalars=[Scalar(value=len(strc))], units="/unit cell")
750614
protected void add(IIsotope isotope) {
        Integer atomicNum = isotope.getAtomicNumber();
        assert atomicNum != null;
        List<IIsotope> isotopesForElement = isotopes[atomicNum];
        if (isotopesForElement == null) {
            isotopesForElement = new ArrayList<>();
            isotopes[atomicNum] = isotopesForElement;
        }
        isotopesForElement.add(isotope);
    }
126867
public IAtom getPlacedHeavyAtomInAtomContainer(IAtom atomA, IAtom atomB, IAtomContainer ac) {
        List atoms = ac.getConnectedAtomsList(atomA);
        IAtom atom = null;
        for (int i = 0; i < atoms.size(); i++) {
            IAtom curAtom = (IAtom) atoms.get(i);
            if (curAtom.getFlag(CDKConstants.ISPLACED) && !curAtom.getSymbol().equals("H") && !Objects.equals(curAtom, atomB)) {
                return curAtom;
            }
        }
        return atom;
    }
147536
public static double getEAIDNumber(IAtomContainer atomContainer) throws NoSuchAtomException,
                                                                            BadMatrixFormatException, IndexOutOfBoundsException {
        GIMatrix matrix = new GIMatrix(getExtendedAdjacenyMatrix(atomContainer));

        GIMatrix tempMatrix = matrix;
        GIMatrix fixedMatrix = matrix;
        for (int i = 2; i < atomContainer.getAtomCount(); i++) {
            tempMatrix = tempMatrix.multiply(fixedMatrix);
            matrix = matrix.add(tempMatrix);
        }

        for (int i = 0; i < atomContainer.getAtomCount(); i++) {
            matrix.setValueAt(i, i, matrix.getValueAt(i, i) + 1);
        }
        double eaid = matrix.trace();

        logger.debug("final matrix - the sum of the powers of EA matrix: ");
        displayMatrix(matrix.getArrayValue());
        logger.debug("eaid number: " + eaid);

        return eaid;
    }