HashCodeCalculator.
More...
|
int | DEF_ATOM_PROPERTY_FLAGS = 159 |
| Specifies the default set of atomic properties considered in the generation of initial atom hash codes by HashCodeCalculator.DefAtomHashSeedFunction.
|
|
int | DEF_BOND_PROPERTY_FLAGS = 15 |
| Specifies the default set of bond properties considered in the generation of initial bond hash codes by HashCodeCalculator.DefBondHashSeedFunction.
|
|
◆ __init__()
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. |
◆ getObjectID()
int CDPL.Chem.HashCodeCalculator.getObjectID |
( |
| ) |
|
Returns the numeric identifier (ID) of the wrapped C++ class instance.
Different Python HashCodeCalculator instances may reference the same underlying C++ class instance. The commonly used Python expression a is not b
thus cannot tell reliably whether the two HashCodeCalculator instances a and b reference different C++ objects. The numeric identifier returned by this method allows to correctly implement such an identity test via the simple expression a.getObjectID() != b.getObjectID()
.
- Returns
- The numeric ID of the internally referenced C++ class instance.
◆ setAtomHashSeedFunction()
Allows to specify a custom function for the generation of initial atom hash codes.
- Parameters
-
func | A HashCodeCalculator.AtomHashSeedFunction instance that wraps the target function. |
- Note
- By default, atom hash seeds are generated by HashCodeCalculator.DefAtomHashSeedFunctor.
◆ setBondHashSeedFunction()
Allows to specify a custom function for the generation of initial bond hash codes.
- Parameters
-
func | A HashCodeCalculator.BondHashSeedFunction instance that wraps the target function. |
- Note
- By default, bond hash seeds are generated by HashCodeCalculator.DefBondHashSeedFunctor.
◆ includeGlobalStereoFeatures()
None 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 |
( |
| ) |
|
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()
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()
int CDPL.Chem.HashCodeCalculator.getResult |
( |
| ) |
|
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.
◆ __call__()