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.
◆ 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__()