HashCodeCalculator.
More...
#include <HashCodeCalculator.hpp>
|
typedef std::function< std::uint64_t(const Atom &)> | AtomHashSeedFunction |
| Type of the generic functor class used to store user-defined functions or function objects for the generation of initial atom hash codes. More...
|
|
typedef std::function< std::uint64_t(const Bond &)> | BondHashSeedFunction |
| Type of the generic functor class used to store user-defined functions or function objects for the generation of initial bond hash codes. More...
|
|
|
static constexpr unsigned int | DEF_ATOM_PROPERTY_FLAGS |
| Specifies the default set of atomic properties considered in the generation of initial atom hash codes by HashCodeCalculator::DefAtomHashSeedFunction. More...
|
|
static constexpr unsigned int | DEF_BOND_PROPERTY_FLAGS |
| Specifies the default set of bond properties considered in the generation of initial bond hash codes by HashCodeCalculator::DefBondHashSeedFunction. More...
|
|
◆ AtomHashSeedFunction
Type of the generic functor class used to store user-defined functions or function objects for the generation of initial atom hash codes.
Functions or function objects for the generation of atom hash seeds are required to take the atom (as a const
reference to Chem::Atom) as argument and return the hash seed as an integer of type std::uint64_t
(see [FUNWRP]).
◆ BondHashSeedFunction
Type of the generic functor class used to store user-defined functions or function objects for the generation of initial bond hash codes.
Functions or function objects for the generation of bond hash seeds are required to take the bond (as a const
reference to Chem::Bond) as argument and return the hash seed as an integer of type std::uint64_t
(see [FUNWRP]).
◆ HashCodeCalculator() [1/2]
CDPL::Chem::HashCodeCalculator::HashCodeCalculator |
( |
| ) |
|
Constructs the HashCodeCalculator
instance.
◆ HashCodeCalculator() [2/2]
CDPL::Chem::HashCodeCalculator::HashCodeCalculator |
( |
const MolecularGraph & |
molgraph | ) |
|
Constructs the HashCodeCalculator
instance and calculates the hash code of the molecular graph molgraph.
The calculated hash code can be retrieved by a call to getResult().
- Parameters
-
molgraph | The molecular graph for which the hash code has to be calculated. |
◆ setAtomHashSeedFunction()
◆ setBondHashSeedFunction()
◆ includeGlobalStereoFeatures()
void CDPL::Chem::HashCodeCalculator::includeGlobalStereoFeatures |
( |
bool |
include | ) |
|
Allows to specify whether or not global stereochemical features shall have an influence on the calculated hash codes.
When global stereochemical features are considered, the hash code of a molecular graph will not only depend on basic atom and bond properties but also on additional stereochemical characteristics like the relative spatial arrangement of substituents. The mutual spatial arrangement of substituents may be the only feature that allows the differentiation of stereoisomers with a plane of symmetry. Diastereoisomers like cis-1,4-Cyclohexanediol and trans-1,4-Cyclohexanediol are typical examples for such corner cases.
- Parameters
-
include | If true , global stereochemical features will be considered and get ignored otherwise. |
- Note
- By default, global stereochemical features are included in the hash code calculation.
◆ globalStereoFeaturesIncluded()
bool CDPL::Chem::HashCodeCalculator::globalStereoFeaturesIncluded |
( |
| ) |
const |
Tells whether or not global stereochemical features influence the calculated hash codes.
- Returns
true
if global stereochemical features of a molecular graph are considered, and false
otherwise.
- See also
- includeGlobalStereoFeatures()
◆ calculate()
std::uint64_t CDPL::Chem::HashCodeCalculator::calculate |
( |
const MolecularGraph & |
molgraph | ) |
|
Calculates the hash code of the molecular graph molgraph.
- Parameters
-
molgraph | The molecular graph for which to calculate the hash code. |
- Returns
- The hash code of the molecular graph molgraph.
◆ getResult()
std::uint64_t CDPL::Chem::HashCodeCalculator::getResult |
( |
| ) |
const |
Returns the result of the last hash code calculation.
- Returns
- The result of the last hash code calculation, or zero if a calculation has not yet been performed.
◆ DEF_ATOM_PROPERTY_FLAGS
constexpr unsigned int CDPL::Chem::HashCodeCalculator::DEF_ATOM_PROPERTY_FLAGS |
|
staticconstexpr |
Initial value:
Specifies the default set of atomic properties considered in the generation of initial atom hash codes by HashCodeCalculator::DefAtomHashSeedFunction.
◆ DEF_BOND_PROPERTY_FLAGS
constexpr unsigned int CDPL::Chem::HashCodeCalculator::DEF_BOND_PROPERTY_FLAGS |
|
staticconstexpr |
Initial value:
Specifies the default set of bond properties considered in the generation of initial bond hash codes by HashCodeCalculator::DefBondHashSeedFunction.
The documentation for this class was generated from the following file: