29 #ifndef CDPL_CHEM_ELECTRONSYSTEM_HPP
30 #define CDPL_CHEM_ELECTRONSYSTEM_HPP
34 #include <unordered_map>
37 #include <boost/iterator/indirect_iterator.hpp>
57 typedef std::vector<Atom*> AtomList;
73 typedef boost::indirect_iterator<AtomList::iterator, Atom>
AtomIterator;
271 typedef std::pair<std::size_t, std::size_t> UIPair;
272 typedef std::unordered_map<const Atom*, UIPair> AtomIdxAndElecContribMap;
275 AtomIdxAndElecContribMap atomIndsAndElecContribs;
276 std::size_t numElectrons;
Definition of the class CDPL::Chem::AtomContainer.
Definition of the preprocessor macro CDPL_CHEM_API.
#define CDPL_CHEM_API
Tells the compiler/linker which classes, functions and variables are part of the library API.
A common interface for data-structures that support a random access to stored Chem::Atom instances.
Definition: AtomContainer.hpp:55
Atom.
Definition: Atom.hpp:52
A common interface for data-structures that support a random access to stored Chem::Bond instances.
Definition: BondContainer.hpp:54
Describes an electron system of a molecule in terms of involved atoms and their electron contribution...
Definition: ElectronSystem.hpp:55
Atom & getAtom(std::size_t idx)
Returns a non-const reference to the atom at index idx.
void clear()
Removes all atoms.
ConstAtomIterator getAtomsEnd() const
Returns a constant iterator pointing to the end of the stored const Chem::Atom objects.
std::size_t getNumElectrons() const
Returns the total number of electrons contributed by the involved atoms.
bool overlaps(const ElectronSystem &elec_sys) const
Checks if the electron system shares at least one atom with the system elec_sys.
bool addAtom(const Chem::Atom &atom, std::size_t elec_contrib)
Extends the electron system by the specified atom and its electron contributions.
bool connected(const ElectronSystem &elec_sys, const BondContainer &bonds) const
Checks if the atom sets of the electron systems do not intersect but are linked by at least one bond.
void swap(ElectronSystem &elec_sys)
Exchanges the state of this electron system with the state of the system elec_sys.
void removeAtom(std::size_t idx)
Removes the atom at the specified index.
void orderAtoms(const AtomCompareFunction &func)
Orders the stored atoms according to criteria implemented by the provided atom comparison function.
bool contains(const ElectronSystem &elec_sys) const
Checks if all atoms in the electron system elec_sys are also part of this electron system.
const Atom & getAtom(std::size_t idx) const
Returns a const reference to the atom at index idx.
AtomIterator getAtomsBegin()
Returns a mutable iterator pointing to the beginning of the stored const Chem::Atom objects.
ElectronSystem()
Constructs an empty ElectronSystem instance.
std::size_t getElectronContrib(std::size_t idx) const
Returns the number of electrons contributed by the atom at the specified index.
ConstAtomIterator getAtomsBegin() const
Returns a constant iterator pointing to the beginning of the stored const Chem::Atom objects.
std::size_t getAtomIndex(const Atom &atom) const
Returns the index of the specified atom.
std::size_t getElectronContrib(const Atom &atom) const
Returns the number of electrons contributed by the specified atom.
bool addAtoms(const ElectronSystem &elec_sys)
Adds the atoms and associated electron contributions in the electron system elec_sys to this system.
bool containsAtom(const Atom &atom) const
Tells whether the specified atom is part of the electron system.
boost::indirect_iterator< AtomList::iterator, Atom > AtomIterator
A mutable random access iterator used to iterate over the stored const Chem::Atom objects.
Definition: ElectronSystem.hpp:73
boost::indirect_iterator< AtomList::const_iterator, const Atom > ConstAtomIterator
A constant random access iterator used to iterate over the stored const Chem::Atom objects.
Definition: ElectronSystem.hpp:68
void merge(const ElectronSystem &elec_sys)
Merges the atoms and associated electron contributions in the electron system elec_sys with this syst...
void setElectronContrib(std::size_t idx, std::size_t elec_contrib)
Changes the number of electrons that are contributed by the atom at the specified index.
AtomIterator removeAtom(const AtomIterator &it)
Removes the atom specified by the iterator it.
std::shared_ptr< ElectronSystem > SharedPointer
A reference-counted smart pointer [SHPTR] for dynamically allocated ElectronSystem instances.
Definition: ElectronSystem.hpp:63
bool removeAtom(const Atom &atom)
Removes the specified atom.
std::size_t getNumAtoms() const
Returns the number of atoms contributing to the electron system.
void setElectronContrib(const Atom &atom, std::size_t elec_contrib)
Changes the number of electrons that are contributed by the specified atom.
AtomIterator getAtomsEnd()
Returns a mutable iterator pointing to the end of the stored const Chem::Atom objects.
A STL compatible random access iterator for container elements accessible by index.
Definition: IndexedElementIterator.hpp:125
std::function< bool(const Chem::Atom &, const Chem::Atom &)> AtomCompareFunction
A generic wrapper class used to store a user-defined atom compare function.
Definition: AtomCompareFunction.hpp:41
The namespace of the Chemical Data Processing Library.