Manages all stereopermutators that are part of a Molecule. More...
#include <StereopermutatorList.h>
Data Structures | |
struct | Impl |
class | iterator |
Public Types | |
Public types | |
using | AtomStereopermutatorIterator = iterator< AtomStereopermutator > |
using | AtomStereopermutatorConstIterator = iterator< const AtomStereopermutator > |
using | BondStereopermutatorIterator = iterator< BondStereopermutator > |
using | BondStereopermutatorConstIterator = iterator< const BondStereopermutator > |
Public Member Functions | |
Special member functions | |
StereopermutatorList () | |
StereopermutatorList (StereopermutatorList &&other) noexcept | |
StereopermutatorList & | operator= (StereopermutatorList &&other) noexcept |
StereopermutatorList (const StereopermutatorList &other) | |
StereopermutatorList & | operator= (const StereopermutatorList &other) |
~StereopermutatorList () | |
Modification | |
AtomStereopermutator & | at (AtomIndex index) |
Access atom stereopermutator at an atom. More... | |
BondStereopermutator & | at (const BondIndex &index) |
Access bond stereopermutator at a bond. More... | |
AtomStereopermutator & | add (AtomStereopermutator stereopermutator) |
Add a new AtomStereopermutator to the list. More... | |
BondStereopermutator & | add (BondStereopermutator stereopermutator) |
Add a new BondStereopermutator to the list. More... | |
void | applyPermutation (const std::vector< AtomIndex > &permutation) |
Apply an index mapping to the list of stereopermutators. More... | |
void | clear () |
Remove all stereopermutators. More... | |
void | clearBonds () |
Remove all stereopermutators on bonds. More... | |
boost::optional < AtomStereopermutator & > | option (AtomIndex index) |
Fetch a reference-option to an AtomStereopermutator. More... | |
boost::optional < BondStereopermutator & > | option (const BondIndex &edge) |
Fetch a reference-option to a BondStereopermutator. More... | |
void | propagateVertexRemoval (AtomIndex removedIndex) |
Communicates the removal of a vertex index to all stereopermutators in the list. More... | |
bool | remove (AtomIndex index) |
Removes the AtomStereopermutator on a specified index, if present. More... | |
bool | remove (const BondIndex &edge) |
Removes the BondStereopermutator on a specified edge, if present. More... | |
void | try_remove (AtomIndex index) |
Removes the AtomStereopermutator on a specified index, if present. More... | |
void | try_remove (const BondIndex &edge) |
Removes the BondStereopermutator on a specified edge, if present. More... | |
Information | |
const AtomStereopermutator & | at (AtomIndex index) const |
Access atom stereopermutator at an atom. More... | |
const BondStereopermutator & | at (const BondIndex &index) const |
Access bond stereopermutator at a bond. More... | |
bool | compare (const StereopermutatorList &other, AtomEnvironmentComponents componentBitmask) const |
Modular comparison with another StereopermutatorList using a bitmask. More... | |
bool | empty () const |
Returns true if there are no stereopermutators. More... | |
bool | hasZeroAssignmentStereopermutators () const |
Returns true if there are any stereopermutators with zero possible assignments. More... | |
bool | hasUnassignedStereopermutators () const |
Returns true if there are unassigned stereopermutators. More... | |
boost::optional< const AtomStereopermutator & > | option (AtomIndex index) const |
Fetch a const ref-option to an AtomStereopermutator, if present. More... | |
boost::optional< const BondStereopermutator & > | option (const BondIndex &edge) const |
Fetch a const ref-option to a BondStereopermutator, if present. More... | |
unsigned | A () const |
Returns the number of AtomStereopermutators. More... | |
unsigned | B () const |
Returns the number of BondStereopermutators. More... | |
unsigned | size () const |
Combined size of atom and bond-stereopermutator lists. More... | |
Ranges (not thread-safe) | |
IteratorRange < AtomStereopermutatorIterator > | atomStereopermutators () |
Returns an iterable object with modifiable atom stereopermutator references. More... | |
IteratorRange < AtomStereopermutatorConstIterator > | atomStereopermutators () const |
Returns an iterable object with unmodifiable atom stereopermutator references. More... | |
IteratorRange < BondStereopermutatorIterator > | bondStereopermutators () |
Returns an iterable object with modifiable bond stereopermutator references. More... | |
IteratorRange < BondStereopermutatorConstIterator > | bondStereopermutators () const |
Returns an iterable object with unmodifiable bond stereopermutator references. More... | |
Operators | |
bool | operator== (const StereopermutatorList &other) const |
Strict equality comparison. More... | |
bool | operator!= (const StereopermutatorList &other) const |
Inverts operator ==. | |
Private Attributes | |
std::unique_ptr< Impl > | impl_ |
Manages all stereopermutators that are part of a Molecule.
unsigned Scine::Molassembler::StereopermutatorList::A | ( | ) | const |
Returns the number of AtomStereopermutators.
Complexity \(\Theta(1)\)
AtomStereopermutator& Scine::Molassembler::StereopermutatorList::add | ( | AtomStereopermutator | stereopermutator | ) |
Add a new AtomStereopermutator to the list.
Complexity \(\Theta(1)\) amortized
BondStereopermutator& Scine::Molassembler::StereopermutatorList::add | ( | BondStereopermutator | stereopermutator | ) |
Add a new BondStereopermutator to the list.
Complexity \(\Theta(1)\) amortized
void Scine::Molassembler::StereopermutatorList::applyPermutation | ( | const std::vector< AtomIndex > & | permutation | ) |
Apply an index mapping to the list of stereopermutators.
Applies the permutation to its maps, transforming the keys (atom and bond indices) and all stereopermutators.
Complexity \(\Theta(A + B)\)
AtomStereopermutator& Scine::Molassembler::StereopermutatorList::at | ( | AtomIndex | index | ) |
Access atom stereopermutator at an atom.
std::out_of_range | If there is no atom stereopermutator on the passed atom |
Complexity \(\Theta(1)\)
BondStereopermutator& Scine::Molassembler::StereopermutatorList::at | ( | const BondIndex & | index | ) |
Access bond stereopermutator at a bond.
std::out_of_range | If there is no bond stereopermutator on the passed bond |
Complexity \(\Theta(1)\)
const AtomStereopermutator& Scine::Molassembler::StereopermutatorList::at | ( | AtomIndex | index | ) | const |
Access atom stereopermutator at an atom.
std::out_of_range | If there is no atom stereopermutator on the passed atom |
Complexity \(\Theta(1)\)
const BondStereopermutator& Scine::Molassembler::StereopermutatorList::at | ( | const BondIndex & | index | ) | const |
Access bond stereopermutator at a bond.
std::out_of_range | If there is no bond stereopermutator on the passed bond |
Complexity \(\Theta(1)\)
IteratorRange<AtomStereopermutatorIterator> Scine::Molassembler::StereopermutatorList::atomStereopermutators | ( | ) |
Returns an iterable object with modifiable atom stereopermutator references.
Complexity \(\Theta(1)\)
IteratorRange<AtomStereopermutatorConstIterator> Scine::Molassembler::StereopermutatorList::atomStereopermutators | ( | ) | const |
Returns an iterable object with unmodifiable atom stereopermutator references.
Complexity \(\Theta(1)\)
unsigned Scine::Molassembler::StereopermutatorList::B | ( | ) | const |
Returns the number of BondStereopermutators.
Complexity \(\Theta(1)\)
IteratorRange<BondStereopermutatorIterator> Scine::Molassembler::StereopermutatorList::bondStereopermutators | ( | ) |
Returns an iterable object with modifiable bond stereopermutator references.
Complexity \(\Theta(1)\)
IteratorRange<BondStereopermutatorConstIterator> Scine::Molassembler::StereopermutatorList::bondStereopermutators | ( | ) | const |
Returns an iterable object with unmodifiable bond stereopermutator references.
Complexity \(\Theta(1)\)
void Scine::Molassembler::StereopermutatorList::clear | ( | ) |
Remove all stereopermutators.
Complexity \(\Theta(1)\)
void Scine::Molassembler::StereopermutatorList::clearBonds | ( | ) |
Remove all stereopermutators on bonds.
Complexity \(\Theta(1)\)
bool Scine::Molassembler::StereopermutatorList::compare | ( | const StereopermutatorList & | other, |
AtomEnvironmentComponents | componentBitmask | ||
) | const |
Modular comparison with another StereopermutatorList using a bitmask.
Complexity \(O(A + B)\)
bool Scine::Molassembler::StereopermutatorList::empty | ( | ) | const |
Returns true if there are no stereopermutators.
Complexity \(\Theta(1)\)
bool Scine::Molassembler::StereopermutatorList::hasUnassignedStereopermutators | ( | ) | const |
Returns true if there are unassigned stereopermutators.
Complexity \(O(A + B)\)
bool Scine::Molassembler::StereopermutatorList::hasZeroAssignmentStereopermutators | ( | ) | const |
Returns true if there are any stereopermutators with zero possible assignments.
Complexity \(O(A + B)\)
bool Scine::Molassembler::StereopermutatorList::operator== | ( | const StereopermutatorList & | other | ) | const |
Strict equality comparison.
Complexity \(O(A + B)\)
boost::optional<AtomStereopermutator&> Scine::Molassembler::StereopermutatorList::option | ( | AtomIndex | index | ) |
Fetch a reference-option to an AtomStereopermutator.
Complexity \(\Theta(1)\)
boost::optional<BondStereopermutator&> Scine::Molassembler::StereopermutatorList::option | ( | const BondIndex & | edge | ) |
Fetch a reference-option to a BondStereopermutator.
Complexity \(\Theta(1)\)
boost::optional<const AtomStereopermutator&> Scine::Molassembler::StereopermutatorList::option | ( | AtomIndex | index | ) | const |
Fetch a const ref-option to an AtomStereopermutator, if present.
Complexity \(\Theta(1)\)
boost::optional<const BondStereopermutator&> Scine::Molassembler::StereopermutatorList::option | ( | const BondIndex & | edge | ) | const |
Fetch a const ref-option to a BondStereopermutator, if present.
Complexity \(\Theta(1)\)
void Scine::Molassembler::StereopermutatorList::propagateVertexRemoval | ( | AtomIndex | removedIndex | ) |
Communicates the removal of a vertex index to all stereopermutators in the list.
Removing a vertex invalidates some vertex descriptors, which are used liberally in the stereopermutator classes. This function ensures that vertex descriptors are valid throughout.
Complexity \(\Theta(A + B)\)
bool Scine::Molassembler::StereopermutatorList::remove | ( | AtomIndex | index | ) |
Removes the AtomStereopermutator on a specified index, if present.
Complexity \(\Theta(1)\)
bool Scine::Molassembler::StereopermutatorList::remove | ( | const BondIndex & | edge | ) |
Removes the BondStereopermutator on a specified edge, if present.
Complexity \(\Theta(1)\)
unsigned Scine::Molassembler::StereopermutatorList::size | ( | ) | const |
Combined size of atom and bond-stereopermutator lists.
Complexity \(\Theta(1)\)
void Scine::Molassembler::StereopermutatorList::try_remove | ( | AtomIndex | index | ) |
Removes the AtomStereopermutator on a specified index, if present.
Complexity \(\Theta(1)\)
void Scine::Molassembler::StereopermutatorList::try_remove | ( | const BondIndex & | edge | ) |
Removes the BondStereopermutator on a specified edge, if present.
Complexity \(\Theta(1)\)