Chemical Data Processing Library C++ API - Version 1.2.0
Classes | Public Types | Public Member Functions | Static Public Attributes | List of all members
CDPL::Chem::HashCodeCalculator Class Reference

HashCodeCalculator. More...

#include <HashCodeCalculator.hpp>

Classes

class  DefAtomHashSeedFunctor
 The default functor for the generation of atom hash seeds. More...
 
class  DefBondHashSeedFunctor
 The default functor for the generation of bond hash seeds. More...
 

Public Types

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...
 

Public Member Functions

 HashCodeCalculator ()
 Constructs the HashCodeCalculator instance. More...
 
 HashCodeCalculator (const MolecularGraph &molgraph)
 Constructs the HashCodeCalculator instance and calculates the hash code of the molecular graph molgraph. More...
 
 HashCodeCalculator (const HashCodeCalculator &)=delete
 
HashCodeCalculatoroperator= (const HashCodeCalculator &)=delete
 
void setAtomHashSeedFunction (const AtomHashSeedFunction &func)
 Allows to specify a custom function for the generation of initial atom hash codes. More...
 
void setBondHashSeedFunction (const BondHashSeedFunction &func)
 Allows to specify a custom function for the generation of initial bond hash codes. More...
 
std::uint64_t calculate (const MolecularGraph &molgraph)
 Calculates the hash code of the molecular graph molgraph. More...
 
std::uint64_t getResult () const
 Returns the result of the last hash code calculation. More...
 

Static Public Attributes

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...
 

Detailed Description

HashCodeCalculator.

See also
[MHASH]

Member Typedef Documentation

◆ AtomHashSeedFunction

typedef std::function<std::uint64_t(const Atom&)> CDPL::Chem::HashCodeCalculator::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

typedef std::function<std::uint64_t(const Bond&)> CDPL::Chem::HashCodeCalculator::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]).

Constructor & Destructor Documentation

◆ HashCodeCalculator() [1/3]

CDPL::Chem::HashCodeCalculator::HashCodeCalculator ( )

Constructs the HashCodeCalculator instance.

◆ HashCodeCalculator() [2/3]

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
molgraphThe molecular graph for which the hash code has to be calculated.

◆ HashCodeCalculator() [3/3]

CDPL::Chem::HashCodeCalculator::HashCodeCalculator ( const HashCodeCalculator )
delete

Member Function Documentation

◆ operator=()

HashCodeCalculator& CDPL::Chem::HashCodeCalculator::operator= ( const HashCodeCalculator )
delete

◆ setAtomHashSeedFunction()

void CDPL::Chem::HashCodeCalculator::setAtomHashSeedFunction ( const AtomHashSeedFunction func)

Allows to specify a custom function for the generation of initial atom hash codes.

Parameters
funcA HashCodeCalculator::AtomHashSeedFunction instance that wraps the target function.
Note
By default, atom hash seeds are generated by HashCodeCalculator::DefAtomHashSeedFunctor.

◆ setBondHashSeedFunction()

void CDPL::Chem::HashCodeCalculator::setBondHashSeedFunction ( const BondHashSeedFunction func)

Allows to specify a custom function for the generation of initial bond hash codes.

Parameters
funcA HashCodeCalculator::BondHashSeedFunction instance that wraps the target function.
Note
By default, bond hash seeds are generated by HashCodeCalculator::DefBondHashSeedFunctor.

◆ calculate()

std::uint64_t CDPL::Chem::HashCodeCalculator::calculate ( const MolecularGraph molgraph)

Calculates the hash code of the molecular graph molgraph.

Parameters
molgraphThe 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.

Member Data Documentation

◆ DEF_ATOM_PROPERTY_FLAGS

constexpr unsigned int CDPL::Chem::HashCodeCalculator::DEF_ATOM_PROPERTY_FLAGS
staticconstexpr
Initial value:
=
constexpr unsigned int FORMAL_CHARGE
Specifies the formal charge of an atom.
Definition: Chem/AtomPropertyFlag.hpp:73
constexpr unsigned int H_COUNT
Specifies the hydrogen count of an atom.
Definition: Chem/AtomPropertyFlag.hpp:78
constexpr unsigned int AROMATICITY
Specifies the membership of an atom in aromatic rings.
Definition: Chem/AtomPropertyFlag.hpp:93
constexpr unsigned int ISOTOPE
Specifies the isotopic mass of an atom.
Definition: Chem/AtomPropertyFlag.hpp:68
constexpr unsigned int CIP_CONFIGURATION
Specifies the CIP-configuration of a chiral atom.
Definition: Chem/AtomPropertyFlag.hpp:58
constexpr unsigned int TYPE
Specifies the generic type or element of an atom.
Definition: Chem/AtomPropertyFlag.hpp:63

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:
=
constexpr unsigned int AROMATICITY
Specifies the membership of a bond in aromatic rings.
Definition: BondPropertyFlag.hpp:73
constexpr unsigned int ORDER
Specifies the order of a bond.
Definition: BondPropertyFlag.hpp:63
constexpr unsigned int CIP_CONFIGURATION
Specifies the CIP-configuration of a double bond.
Definition: BondPropertyFlag.hpp:58
constexpr unsigned int TOPOLOGY
Specifies the ring/chain topology of a bond.
Definition: BondPropertyFlag.hpp:68

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: