Chemical Data Processing Library C++ API - Version 1.2.0
|
Describes an electron system of a molecule in terms of involved atoms and their electron contributions. More...
#include <ElectronSystem.hpp>
Public Types | |
typedef std::shared_ptr< ElectronSystem > | SharedPointer |
A reference-counted smart pointer [SHPTR] for dynamically allocated ElectronSystem instances. More... | |
typedef boost::indirect_iterator< AtomList::const_iterator, const Atom > | ConstAtomIterator |
A constant random access iterator used to iterate over the stored const Chem::Atom objects. More... | |
typedef boost::indirect_iterator< AtomList::iterator, Atom > | AtomIterator |
A mutable random access iterator used to iterate over the stored const Chem::Atom objects. More... | |
Public Types inherited from CDPL::Chem::AtomContainer | |
typedef Util::IndexedElementIterator< const Atom, ConstAtomAccessor > | ConstAtomIterator |
A constant random access iterator used to iterate over the stored const Chem::Atom objects. More... | |
typedef Util::IndexedElementIterator< Atom, AtomAccessor > | AtomIterator |
A mutable random access iterator used to iterate over the stored Chem::Atom objects. More... | |
Public Types inherited from CDPL::Chem::Entity3DContainer | |
typedef Util::IndexedElementIterator< const Entity3D, ConstEntityAccessor > | ConstEntityIterator |
A constant random access iterator used to iterate over the stored const Chem::Entity3D objects. More... | |
typedef Util::IndexedElementIterator< Entity3D, EntityAccessor > | EntityIterator |
A mutable random access iterator used to iterate over the stored Chem::Entity3D objects. More... | |
Public Member Functions | |
ElectronSystem () | |
Constructs an empty ElectronSystem instance. More... | |
std::size_t | getNumAtoms () const |
Returns the number of atoms contributing to the electron system. More... | |
bool | containsAtom (const Atom &atom) const |
Tells whether the specified atom is part of the electron system. More... | |
std::size_t | getAtomIndex (const Atom &atom) const |
Returns the index of the specified atom. More... | |
const Atom & | getAtom (std::size_t idx) const |
Returns a const reference to the atom at index idx. More... | |
Atom & | getAtom (std::size_t idx) |
Returns a non-const reference to the atom at index idx. More... | |
ConstAtomIterator | getAtomsBegin () const |
Returns a constant iterator pointing to the beginning of the stored const Chem::Atom objects. More... | |
AtomIterator | getAtomsBegin () |
Returns a mutable iterator pointing to the beginning of the stored const Chem::Atom objects. More... | |
ConstAtomIterator | getAtomsEnd () const |
Returns a constant iterator pointing to the end of the stored const Chem::Atom objects. More... | |
AtomIterator | getAtomsEnd () |
Returns a mutable iterator pointing to the end of the stored const Chem::Atom objects. More... | |
void | clear () |
Removes all atoms. More... | |
void | orderAtoms (const AtomCompareFunction &func) |
Orders the stored atoms according to criteria implemented by the provided atom comparison function. More... | |
bool | addAtom (const Chem::Atom &atom, std::size_t elec_contrib) |
Extends the electron system by the specified atom and its electron contributions. More... | |
bool | addAtoms (const ElectronSystem &elec_sys) |
Adds the atoms and associated electron contributions in the electron system elec_sys to this system. More... | |
void | removeAtom (std::size_t idx) |
Removes the atom at the specified index. More... | |
AtomIterator | removeAtom (const AtomIterator &it) |
Removes the atom specified by the iterator it. More... | |
bool | removeAtom (const Atom &atom) |
Removes the specified atom. More... | |
std::size_t | getNumElectrons () const |
Returns the total number of electrons contributed by the involved atoms. More... | |
std::size_t | getElectronContrib (const Atom &atom) const |
Returns the number of electrons contributed by the specified atom. More... | |
std::size_t | getElectronContrib (std::size_t idx) const |
Returns the number of electrons contributed by the atom at the specified index. More... | |
void | setElectronContrib (const Atom &atom, std::size_t elec_contrib) |
Changes the number of electrons that are contributed by the specified atom. More... | |
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. More... | |
void | merge (const ElectronSystem &elec_sys) |
Merges the atoms and associated electron contributions in the electron system elec_sys with this system. More... | |
bool | overlaps (const ElectronSystem &elec_sys) const |
Checks if the electron system shares at least one atom with the system elec_sys. More... | |
bool | contains (const ElectronSystem &elec_sys) const |
Checks if all atoms in the electron system elec_sys are also part of this electron system. More... | |
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. More... | |
void | swap (ElectronSystem &elec_sys) |
Exchanges the state of this electron system with the state of the system elec_sys. More... | |
Public Member Functions inherited from CDPL::Chem::AtomContainer | |
ConstAtomIterator | getAtomsBegin () const |
Returns a constant iterator pointing to the beginning of the stored const Chem::Atom objects. More... | |
ConstAtomIterator | getAtomsEnd () const |
Returns a constant iterator pointing to the end of the stored const Chem::Atom objects. More... | |
AtomIterator | getAtomsBegin () |
Returns a mutable iterator pointing to the beginning of the stored Chem::Atom objects. More... | |
AtomIterator | getAtomsEnd () |
Returns a mutable iterator pointing to the end of the stored Chem::Atom objects. More... | |
ConstAtomIterator | begin () const |
Returns a constant iterator pointing to the beginning of the stored const Chem::Atom objects. More... | |
ConstAtomIterator | end () const |
Returns a constant iterator pointing to the end of the stored const Chem::Atom objects. More... | |
AtomIterator | begin () |
Returns a mutable iterator pointing to the beginning of the stored Chem::Atom objects. More... | |
AtomIterator | end () |
Returns a mutable iterator pointing to the end of the stored Chem::Atom objects. More... | |
virtual std::size_t | getNumEntities () const |
Returns the number of stored Chem::Entity3D objects. More... | |
virtual const Entity3D & | getEntity (std::size_t idx) const |
Returns a const reference to the Chem::Entity3D instance at index idx. More... | |
virtual Entity3D & | getEntity (std::size_t idx) |
Returns a non-const reference to the entity at index idx. More... | |
const AtomContainer & | getAtoms () const |
Returns a const reference to itself. More... | |
AtomContainer & | getAtoms () |
Returns a reference to itself. More... | |
Public Member Functions inherited from CDPL::Chem::Entity3DContainer | |
ConstEntityIterator | getEntitiesBegin () const |
Returns a constant iterator pointing to the beginning of the stored const Chem::Entity3D objects. More... | |
ConstEntityIterator | getEntitiesEnd () const |
Returns a constant iterator pointing to the end of the stored const Chem::Entity3D objects. More... | |
EntityIterator | getEntitiesBegin () |
Returns a mutable iterator pointing to the beginning of the stored Chem::Entity3D objects. More... | |
EntityIterator | getEntitiesEnd () |
Returns a mutable iterator pointing to the end of the stored Chem::Entity3D objects. More... | |
ConstEntityIterator | begin () const |
Returns a constant iterator pointing to the beginning of the stored const Chem::Entity3D objects. More... | |
ConstEntityIterator | end () const |
Returns a constant iterator pointing to the end of the stored const Chem::Entity3D objects. More... | |
EntityIterator | begin () |
Returns a mutable iterator pointing to the beginning of the stored Chem::Entity3D objects. More... | |
EntityIterator | end () |
Returns a mutable iterator pointing to the end of the stored Chem::Entity3D objects. More... | |
const Entity3DContainer & | getEntities () const |
Returns a const reference to itself. More... | |
Entity3DContainer & | getEntities () |
Returns a reference to itself. More... | |
Additional Inherited Members | |
Protected Member Functions inherited from CDPL::Chem::AtomContainer | |
virtual | ~AtomContainer () |
Virtual destructor. More... | |
AtomContainer & | operator= (const AtomContainer &cntnr) |
Assignment operator. More... | |
Protected Member Functions inherited from CDPL::Chem::Entity3DContainer | |
virtual | ~Entity3DContainer () |
Virtual destructor. More... | |
Entity3DContainer & | operator= (const Entity3DContainer &cntnr) |
Assignment operator. More... | |
Describes an electron system of a molecule in terms of involved atoms and their electron contributions.
typedef std::shared_ptr<ElectronSystem> CDPL::Chem::ElectronSystem::SharedPointer |
A reference-counted smart pointer [SHPTR] for dynamically allocated ElectronSystem
instances.
typedef boost::indirect_iterator<AtomList::const_iterator, const Atom> CDPL::Chem::ElectronSystem::ConstAtomIterator |
A constant random access iterator used to iterate over the stored const
Chem::Atom objects.
typedef boost::indirect_iterator<AtomList::iterator, Atom> CDPL::Chem::ElectronSystem::AtomIterator |
A mutable random access iterator used to iterate over the stored const
Chem::Atom objects.
CDPL::Chem::ElectronSystem::ElectronSystem | ( | ) |
Constructs an empty ElectronSystem
instance.
|
virtual |
Returns the number of atoms contributing to the electron system.
Implements CDPL::Chem::AtomContainer.
Tells whether the specified atom is part of the electron system.
atom | The atom to look for. |
true
if atom is part of the electron system and false
, otherwise. Implements CDPL::Chem::AtomContainer.
|
virtual |
Returns the index of the specified atom.
atom | The atom for which to return the index. |
Base::ItemNotFound | if the specified atom is not part of this electron system. |
Implements CDPL::Chem::AtomContainer.
|
virtual |
Returns a const
reference to the atom at index idx.
idx | The zero-based index of the atom to return. |
const
reference to the atom at the specified index. Base::IndexError | if the number of atoms is zero or idx is not in the range [0, getNumAtoms() - 1]. |
Implements CDPL::Chem::AtomContainer.
|
virtual |
Returns a non-const
reference to the atom at index idx.
idx | The zero-based index of the atom to return. |
non-const
reference to the atom at the specified index. Base::IndexError | if the number of atoms is zero or idx is not in the range [0, getNumAtoms() - 1]. |
Implements CDPL::Chem::AtomContainer.
ConstAtomIterator CDPL::Chem::ElectronSystem::getAtomsBegin | ( | ) | const |
Returns a constant iterator pointing to the beginning of the stored const
Chem::Atom objects.
const
Chem::Atom objects. AtomIterator CDPL::Chem::ElectronSystem::getAtomsBegin | ( | ) |
Returns a mutable iterator pointing to the beginning of the stored const
Chem::Atom objects.
const
Chem::Atom objects. ConstAtomIterator CDPL::Chem::ElectronSystem::getAtomsEnd | ( | ) | const |
Returns a constant iterator pointing to the end of the stored const
Chem::Atom objects.
const
Chem::Atom objects. AtomIterator CDPL::Chem::ElectronSystem::getAtomsEnd | ( | ) |
Returns a mutable iterator pointing to the end of the stored const
Chem::Atom objects.
const
Chem::Atom objects. void CDPL::Chem::ElectronSystem::clear | ( | ) |
Removes all atoms.
|
virtual |
Orders the stored atoms according to criteria implemented by the provided atom comparison function.
func | The atom comparison function implementing the applied ordering criteria. |
Implements CDPL::Chem::AtomContainer.
bool CDPL::Chem::ElectronSystem::addAtom | ( | const Chem::Atom & | atom, |
std::size_t | elec_contrib | ||
) |
Extends the electron system by the specified atom and its electron contributions.
atom | The atom to add. |
elec_contrib | The number of electrons contributed by the added atom. |
true
if the atom was not already involved in this electron system and false
, otherwise. bool CDPL::Chem::ElectronSystem::addAtoms | ( | const ElectronSystem & | elec_sys | ) |
Adds the atoms and associated electron contributions in the electron system elec_sys to this system.
The method is equivalent to repeatedly calling addAtom() for each atom in elec_sys.
elec_sys | The electron system to add. |
true
if the electron system was extended by atoms from elec_sys and false
, otherwise. void CDPL::Chem::ElectronSystem::removeAtom | ( | std::size_t | idx | ) |
Removes the atom at the specified index.
idx | The zero-based index of the atom to remove. |
Base::IndexError | if the number of atoms is zero or idx is not in the range [0, getNumAtoms() - 1]. |
AtomIterator CDPL::Chem::ElectronSystem::removeAtom | ( | const AtomIterator & | it | ) |
Removes the atom specified by the iterator it.
it | An iterator that specifies the atom to remove. |
Base::RangeError | if the number of atoms is zero or it is not in the range [getAtomsBegin(), getAtomsEnd() - 1]. |
Removes the specified atom.
atom | The atom to remove. |
true
if the atom was part of the electron system and has been removed, and false
otherwise. std::size_t CDPL::Chem::ElectronSystem::getNumElectrons | ( | ) | const |
Returns the total number of electrons contributed by the involved atoms.
std::size_t CDPL::Chem::ElectronSystem::getElectronContrib | ( | const Atom & | atom | ) | const |
Returns the number of electrons contributed by the specified atom.
atom | The atom for which to return the contributed electron count. |
Base::ItemNotFound | if the specified atom is not part of the electron system. |
std::size_t CDPL::Chem::ElectronSystem::getElectronContrib | ( | std::size_t | idx | ) | const |
Returns the number of electrons contributed by the atom at the specified index.
idx | The index of the atom for which to return the contributed electron count. |
Base::IndexError | if the number of atoms is zero or idx is not in the range [0, getNumAtoms() - 1]. |
void CDPL::Chem::ElectronSystem::setElectronContrib | ( | const Atom & | atom, |
std::size_t | elec_contrib | ||
) |
Changes the number of electrons that are contributed by the specified atom.
atom | The atom for which to update the electron contribution. |
elec_contrib | The number of electrons contributed by the specified atom. |
Base::ItemNotFound | if the specified atom is not part of the electron system. |
void CDPL::Chem::ElectronSystem::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.
idx | The index of the atom for which to update the electron contribution. |
elec_contrib | The number of electrons contributed by the specified atom. |
Base::IndexError | if the number of atoms is zero or idx is not in the range [0, getNumAtoms() - 1]. |
void CDPL::Chem::ElectronSystem::merge | ( | const ElectronSystem & | elec_sys | ) |
Merges the atoms and associated electron contributions in the electron system elec_sys with this system.
For atoms that are present in both electron systems, the resulting electron contribution will be the sum of their contributions to the respective systems!
elec_sys | The electron system to merge. |
bool CDPL::Chem::ElectronSystem::overlaps | ( | const ElectronSystem & | elec_sys | ) | const |
Checks if the electron system shares at least one atom with the system elec_sys.
elec_sys | The electron system to check for atom set intersection. |
true
if at least one atom in elec_sys is also part of this electron system and false
, otherwise. bool CDPL::Chem::ElectronSystem::contains | ( | const ElectronSystem & | elec_sys | ) | const |
Checks if all atoms in the electron system elec_sys are also part of this electron system.
elec_sys | The electron system to check for atom set containment. |
true
if all atoms in elec_sys are also part of this electron system and false
, otherwise. bool CDPL::Chem::ElectronSystem::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.
elec_sys | The electron system to check. |
bonds | The set of available bonds. |
true
if the electron systems do not share any atoms but are linked by at least one bond and false
, otherwise. void CDPL::Chem::ElectronSystem::swap | ( | ElectronSystem & | elec_sys | ) |
Exchanges the state of this electron system with the state of the system elec_sys.
elec_sys | The other ElectronSystem instance. |