unsigned int getAtomIndex(const Molecule &mol, const Atom *atom) { AtomIterator ai_begin, ai_end, next; tie(ai_begin, ai_end) = boost::vertices(mol.getGraph()); for (next = ai_begin; next != ai_end; ++next) { Atom *a = mol.getGraph()[*next].get(); if (atom = a) return *next; } }