|
Chemical Data Processing Library C++ API - Version 1.1.1
|
Go to the documentation of this file.
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;
281 #endif // CDPL_CHEM_ELECTRONSYSTEM_HPP
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
Definition of the preprocessor macro CDPL_CHEM_API.
void setElectronContrib(const Atom &atom, std::size_t elec_contrib)
Changes the number of electrons that are contributed by the specified atom.
ConstAtomIterator getAtomsEnd() const
Returns a constant iterator pointing to the end of the stored const Chem::Atom objects.
#define CDPL_CHEM_API
Tells the compiler/linker which classes, functions and variables are part of the library API.
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.
std::size_t getNumAtoms() const
Returns the number of atoms contributing to the electron system.
AtomIterator removeAtom(const AtomIterator &it)
Removes the atom specified by the iterator it.
ConstAtomIterator getAtomsBegin() const
Returns a constant iterator pointing to the beginning of the stored const Chem::Atom objects.
A STL compatible random access iterator for container elements accessible by index.
Definition: IndexedElementIterator.hpp:125
bool removeAtom(const Atom &atom)
Removes the specified atom.
Atom.
Definition: Atom.hpp:52
void clear()
Removes all atoms.
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.
void orderAtoms(const AtomCompareFunction &func)
Orders the stored atoms according to criteria implemented by the provided atom comparison function.
Describes an electron system of a molecule in terms of involved atoms and their electron contribution...
Definition: ElectronSystem.hpp:55
std::size_t getElectronContrib(std::size_t idx) const
Returns the number of electrons contributed by the atom at the specified index.
A common interface for data-structures that support a random access to stored Chem::Atom instances.
Definition: AtomContainer.hpp:55
Definition of the class CDPL::Chem::AtomContainer.
void removeAtom(std::size_t idx)
Removes the atom at the specified index.
bool addAtoms(const ElectronSystem &elec_sys)
Adds the atoms and associated electron contributions in the electron system elec_sys to this system.
ElectronSystem()
Constructs an empty ElectronSystem instance.
std::size_t getElectronContrib(const Atom &atom) const
Returns the number of electrons contributed by the specified atom.
std::shared_ptr< ElectronSystem > SharedPointer
A reference-counted smart pointer [SHPTR] for dynamically allocated ElectronSystem instances.
Definition: ElectronSystem.hpp:63
std::size_t getNumElectrons() const
Returns the total number of electrons contributed by the involved atoms.
AtomIterator getAtomsBegin()
Returns a mutable iterator pointing to the beginning of the stored const Chem::Atom objects.
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
bool addAtom(const Chem::Atom &atom, std::size_t elec_contrib)
Extends the electron system by the specified atom and its electron contributions.
Atom & getAtom(std::size_t idx)
Returns a non-const reference to the atom at index idx.
The namespace of the Chemical Data Processing Library.
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.
A common interface for data-structures that support a random access to stored Chem::Bond instances.
Definition: BondContainer.hpp:54
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
std::size_t getAtomIndex(const Atom &atom) const
Returns the index of the specified atom.
bool containsAtom(const Atom &atom) const
Tells whether the specified atom is part of the electron system.
void swap(ElectronSystem &elec_sys)
Exchanges the state of this electron system with the state of the system elec_sys.
bool overlaps(const ElectronSystem &elec_sys) const
Checks if the electron system shares at least one atom with the system elec_sys.
AtomIterator getAtomsEnd()
Returns a mutable iterator pointing to the end of the stored const Chem::Atom objects.