Chemical Data Processing Library C++ API - Version 1.2.0
|
AutomorphismGroupSearch. More...
#include <AutomorphismGroupSearch.hpp>
Public Types | |
typedef std::shared_ptr< AutomorphismGroupSearch > | SharedPointer |
typedef SubstructureSearch::MappingIterator | MappingIterator |
A mutable random access iterator used to iterate over the stored atom/bond mapping objects. More... | |
typedef SubstructureSearch::ConstMappingIterator | ConstMappingIterator |
A constant random access iterator used to iterate over the stored atom/bond mapping objects. More... | |
typedef std::function< bool(const MolecularGraph &, const AtomBondMapping &)> | MappingCallbackFunction |
Public Member Functions | |
AutomorphismGroupSearch (unsigned int atom_flags=DEF_ATOM_PROPERTY_FLAGS, unsigned int bond_flags=DEF_BOND_PROPERTY_FLAGS) | |
Constructs and initializes a AutomorphismGroupSearch instance. More... | |
AutomorphismGroupSearch (const AutomorphismGroupSearch &)=delete | |
AutomorphismGroupSearch & | operator= (const AutomorphismGroupSearch &)=delete |
void | setAtomPropertyFlags (unsigned int flags) |
unsigned int | getAtomPropertyFlags () const |
void | setBondPropertyFlags (unsigned int flags) |
unsigned int | getBondPropertyFlags () const |
void | includeIdentityMapping (bool include) |
bool | identityMappingIncluded () const |
bool | findMappings (const MolecularGraph &molgraph) |
Searches for the possible atom/bond mappings in the automorphism group of the given molecular graph. More... | |
void | stopSearch () |
std::size_t | getNumMappings () const |
Returns the number of atom/bond mappings that were recorded in the last call to findMappings(). More... | |
AtomBondMapping & | getMapping (std::size_t idx) |
Returns a non-const reference to the stored atom/bond mapping object at index idx. More... | |
const AtomBondMapping & | getMapping (std::size_t idx) const |
Returns a const reference to the stored atom/bond mapping object at index idx. More... | |
MappingIterator | getMappingsBegin () |
Returns a mutable iterator pointing to the beginning of the stored atom/bond mapping objects. More... | |
ConstMappingIterator | getMappingsBegin () const |
Returns a constant iterator pointing to the beginning of the stored atom/bond mapping objects. More... | |
MappingIterator | getMappingsEnd () |
Returns a mutable iterator pointing to the end of the stored atom/bond mapping objects. More... | |
ConstMappingIterator | getMappingsEnd () const |
Returns a constant iterator pointing to the end of the stored atom/bond mapping objects. More... | |
MappingIterator | begin () |
Returns a mutable iterator pointing to the beginning of the stored atom/bond mapping objects. More... | |
ConstMappingIterator | begin () const |
Returns a constant iterator pointing to the beginning of the stored atom/bond mapping objects. More... | |
MappingIterator | end () |
Returns a mutable iterator pointing to the end of the stored atom/bond mapping objects. More... | |
ConstMappingIterator | end () const |
Returns a constant iterator pointing to the end of the stored atom/bond mapping objects. More... | |
void | setMaxNumMappings (std::size_t max_num_mappings) |
Allows to specify a limit on the number of stored atom/bond mappings. More... | |
std::size_t | getMaxNumMappings () const |
Returns the specified limit on the number of stored atom/bond mappings. More... | |
void | addAtomMappingConstraint (std::size_t atom1_idx, std::size_t atom2_idx) |
Adds a constraint on the allowed atom mappings. More... | |
void | clearAtomMappingConstraints () |
Clears all previously defined atom mapping constraints. More... | |
void | addBondMappingConstraint (std::size_t bond1_idx, std::size_t bond2_idx) |
Adds a constraint on the allowed bond mappings. More... | |
void | clearBondMappingConstraints () |
Clears all previously defined bond mapping constraints. More... | |
void | setFoundMappingCallback (const MappingCallbackFunction &func) |
const MappingCallbackFunction & | getFoundMappingCallback () const |
Static Public Attributes | |
static constexpr unsigned int | DEF_ATOM_PROPERTY_FLAGS |
Specifies the default set of atomic properties considered for atom matching. More... | |
static constexpr unsigned int | DEF_BOND_PROPERTY_FLAGS |
Specifies the default set of bond properties considered for bond matching. More... | |
typedef std::shared_ptr<AutomorphismGroupSearch> CDPL::Chem::AutomorphismGroupSearch::SharedPointer |
A mutable random access iterator used to iterate over the stored atom/bond mapping objects.
typedef SubstructureSearch::ConstMappingIterator CDPL::Chem::AutomorphismGroupSearch::ConstMappingIterator |
A constant random access iterator used to iterate over the stored atom/bond mapping objects.
typedef std::function<bool(const MolecularGraph&, const AtomBondMapping&)> CDPL::Chem::AutomorphismGroupSearch::MappingCallbackFunction |
CDPL::Chem::AutomorphismGroupSearch::AutomorphismGroupSearch | ( | unsigned int | atom_flags = DEF_ATOM_PROPERTY_FLAGS , |
unsigned int | bond_flags = DEF_BOND_PROPERTY_FLAGS |
||
) |
Constructs and initializes a AutomorphismGroupSearch
instance.
|
delete |
|
delete |
void CDPL::Chem::AutomorphismGroupSearch::setAtomPropertyFlags | ( | unsigned int | flags | ) |
unsigned int CDPL::Chem::AutomorphismGroupSearch::getAtomPropertyFlags | ( | ) | const |
void CDPL::Chem::AutomorphismGroupSearch::setBondPropertyFlags | ( | unsigned int | flags | ) |
unsigned int CDPL::Chem::AutomorphismGroupSearch::getBondPropertyFlags | ( | ) | const |
void CDPL::Chem::AutomorphismGroupSearch::includeIdentityMapping | ( | bool | include | ) |
bool CDPL::Chem::AutomorphismGroupSearch::identityMappingIncluded | ( | ) | const |
bool CDPL::Chem::AutomorphismGroupSearch::findMappings | ( | const MolecularGraph & | molgraph | ) |
Searches for the possible atom/bond mappings in the automorphism group of the given molecular graph.
The method will store all found mappings up to the maximum number of recorded mappings specified by setMaxNumMappings().
molgraph | The molecular graph that has to be searched for automorphisms. |
true
if any mappings of the specified molecular graph have been found, and false
otherwise. void CDPL::Chem::AutomorphismGroupSearch::stopSearch | ( | ) |
std::size_t CDPL::Chem::AutomorphismGroupSearch::getNumMappings | ( | ) | const |
Returns the number of atom/bond mappings that were recorded in the last call to findMappings().
AtomBondMapping& CDPL::Chem::AutomorphismGroupSearch::getMapping | ( | std::size_t | idx | ) |
Returns a non-const
reference to the stored atom/bond mapping object at index idx.
idx | The zero-based index of the atom/bond mapping object to return. |
const
reference to the atom/bond mapping object at index idx. Base::IndexError | if no mappings are available or idx is not in the range [0, getNumMappings() - 1]. |
const AtomBondMapping& CDPL::Chem::AutomorphismGroupSearch::getMapping | ( | std::size_t | idx | ) | const |
Returns a const
reference to the stored atom/bond mapping object at index idx.
idx | The zero-based index of the atom/bond mapping object to return. |
const
reference to the atom/bond mapping object at index idx. Base::IndexError | if no mappings are available or idx is not in the range [0, getNumMappings() - 1]. |
MappingIterator CDPL::Chem::AutomorphismGroupSearch::getMappingsBegin | ( | ) |
Returns a mutable iterator pointing to the beginning of the stored atom/bond mapping objects.
ConstMappingIterator CDPL::Chem::AutomorphismGroupSearch::getMappingsBegin | ( | ) | const |
Returns a constant iterator pointing to the beginning of the stored atom/bond mapping objects.
MappingIterator CDPL::Chem::AutomorphismGroupSearch::getMappingsEnd | ( | ) |
Returns a mutable iterator pointing to the end of the stored atom/bond mapping objects.
ConstMappingIterator CDPL::Chem::AutomorphismGroupSearch::getMappingsEnd | ( | ) | const |
Returns a constant iterator pointing to the end of the stored atom/bond mapping objects.
MappingIterator CDPL::Chem::AutomorphismGroupSearch::begin | ( | ) |
Returns a mutable iterator pointing to the beginning of the stored atom/bond mapping objects.
ConstMappingIterator CDPL::Chem::AutomorphismGroupSearch::begin | ( | ) | const |
Returns a constant iterator pointing to the beginning of the stored atom/bond mapping objects.
MappingIterator CDPL::Chem::AutomorphismGroupSearch::end | ( | ) |
Returns a mutable iterator pointing to the end of the stored atom/bond mapping objects.
ConstMappingIterator CDPL::Chem::AutomorphismGroupSearch::end | ( | ) | const |
Returns a constant iterator pointing to the end of the stored atom/bond mapping objects.
void CDPL::Chem::AutomorphismGroupSearch::setMaxNumMappings | ( | std::size_t | max_num_mappings | ) |
Allows to specify a limit on the number of stored atom/bond mappings.
In a call to findMappings() the automorphism search will terminate as soon as the specified maximum number of stored atom/bond mappings has been reached. A previously set limit on the number of mappings can be disabled by providing zero for the value of max_num_mappings.
max_num_mappings | The maximum number of atom/bond mappings to store. |
std::size_t CDPL::Chem::AutomorphismGroupSearch::getMaxNumMappings | ( | ) | const |
Returns the specified limit on the number of stored atom/bond mappings.
void CDPL::Chem::AutomorphismGroupSearch::addAtomMappingConstraint | ( | std::size_t | atom1_idx, |
std::size_t | atom2_idx | ||
) |
Adds a constraint on the allowed atom mappings.
By default, an atom can be mapped to any valid other atom. When this method gets called for a particular atom pair (specified by atom1_idx and atom2_idx), a future search will report only those solutions which feature the specified mapping of the two atoms. Multiple calls to addAtomMappingConstraint() for a particular atom enlarges the set of valid mapping solutions.
atom1_idx | The index of the first atom. |
atom2_idx | The index of the second atom. |
void CDPL::Chem::AutomorphismGroupSearch::clearAtomMappingConstraints | ( | ) |
Clears all previously defined atom mapping constraints.
void CDPL::Chem::AutomorphismGroupSearch::addBondMappingConstraint | ( | std::size_t | bond1_idx, |
std::size_t | bond2_idx | ||
) |
Adds a constraint on the allowed bond mappings.
By default, an bond can be mapped to any valid other bond. When this method gets called for a particular bond pair (specified by bond1_idx and bond2_idx), a future search will report only those solutions which feature the specified mapping of the two bonds. Multiple calls to addBondMappingConstraint() for a particular bond enlarges the set of valid mapping solutions.
bond1_idx | The index of the first bond. |
bond2_idx | The index of the second bond. |
void CDPL::Chem::AutomorphismGroupSearch::clearBondMappingConstraints | ( | ) |
Clears all previously defined bond mapping constraints.
void CDPL::Chem::AutomorphismGroupSearch::setFoundMappingCallback | ( | const MappingCallbackFunction & | func | ) |
const MappingCallbackFunction& CDPL::Chem::AutomorphismGroupSearch::getFoundMappingCallback | ( | ) | const |
|
staticconstexpr |
Specifies the default set of atomic properties considered for atom matching.
|
staticconstexpr |
Specifies the default set of bond properties considered for bond matching.