29 #ifndef CDPL_CHEM_HASHCODECALCULATOR_HPP
30 #define CDPL_CHEM_HASHCODECALCULATOR_HPP
74 static constexpr
unsigned int DEF_ATOM_PROPERTY_FLAGS =
83 static constexpr
unsigned int DEF_BOND_PROPERTY_FLAGS =
110 calculator(calculator), flags(flags) {}
124 std::uint64_t getAtomTypeHashSeed(
const Atom&)
const;
125 std::uint64_t getAtomIsotopeHashSeed(
const Atom&)
const;
126 std::uint64_t getAtomChargeHashSeed(
const Atom&)
const;
127 std::uint64_t getAtomHCountHashSeed(
const Atom&)
const;
128 std::uint64_t getAtomConfigHashSeed(
const Atom&)
const;
129 std::uint64_t getAtomAromaticityHashSeed(
const Atom&)
const;
169 std::uint64_t getBondTypeHashSeed(
const Bond&)
const;
170 std::uint64_t getBondConfigHashSeed(
const Bond&)
const;
171 std::uint64_t getBondTopologyHashSeed(
const Bond&)
const;
245 void calcAtomHashCodes();
246 void calcBondHashCodes();
247 void calcSHAHashCode();
249 typedef std::vector<std::uint64_t> UInt64Array;
250 typedef std::vector<std::size_t> IndexList;
255 UInt64Array atomHashCodes;
256 UInt64Array bondHashCodes;
257 UInt64Array tmpHashCodes1;
258 UInt64Array tmpHashCodes2;
259 UInt64Array shaInput;
260 std::uint8_t shaHashCode[20];
Definition of constants in namespace CDPL::Chem::BondPropertyFlag.
Definition of the preprocessor macro CDPL_CHEM_API.
#define CDPL_CHEM_API
Tells the compiler/linker which classes, functions and variables are part of the library API.
Definition of constants in namespace CDPL::Chem::AtomPropertyFlag.
Abstract base class representing a chemical atom and its bonded neighborhood.
Definition: Atom.hpp:57
Abstract base class representing a chemical bond between two Chem::Atom instances.
Definition: Bond.hpp:54
The default functor for the generation of atom hash seeds.
Definition: HashCodeCalculator.hpp:91
std::uint64_t operator()(const Atom &atom) const
Generates an initial hash code value (seed) for the specified atom.
DefAtomHashSeedFunctor(const HashCodeCalculator &calculator, unsigned int flags=DEF_ATOM_PROPERTY_FLAGS)
Constructs the atom hash seed functor object for the specified set of atomic properties.
Definition: HashCodeCalculator.hpp:109
The default functor for the generation of bond hash seeds.
Definition: HashCodeCalculator.hpp:139
DefBondHashSeedFunctor(unsigned int flags=DEF_BOND_PROPERTY_FLAGS)
Constructs the bond hash seed functor object for the specified set of bond properties.
Definition: HashCodeCalculator.hpp:154
std::uint64_t operator()(const Bond &bond) const
Generates an initial hash code value (seed) for the specified bond.
Computes a 64-bit hash code that identifies a molecular graph up to a configurable set of atom and bo...
Definition: HashCodeCalculator.hpp:67
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 ge...
Definition: HashCodeCalculator.hpp:184
void setBondHashSeedFunction(const BondHashSeedFunction &func)
Allows to specify a custom function for the generation of initial bond hash codes.
std::uint64_t calculate(const MolecularGraph &molgraph)
Calculates the hash code of the molecular graph molgraph.
void setAtomHashSeedFunction(const AtomHashSeedFunction &func)
Allows to specify a custom function for the generation of initial atom hash codes.
std::uint64_t getResult() const
Returns the result of the last hash code calculation.
HashCodeCalculator & operator=(const HashCodeCalculator &)=delete
HashCodeCalculator(const HashCodeCalculator &)=delete
HashCodeCalculator()
Constructs the HashCodeCalculator instance.
HashCodeCalculator(const MolecularGraph &molgraph)
Constructs the HashCodeCalculator instance and calculates the hash code of the molecular graph molgra...
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 ge...
Definition: HashCodeCalculator.hpp:194
Abstract base class for representations of a chemical structure as a graph of bonded atoms.
Definition: MolecularGraph.hpp:57
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
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
The namespace of the Chemical Data Processing Library.