29 #ifndef CDPL_CHEM_SUBSTRUCTUREHISTOGRAMCALCULATOR_HPP
30 #define CDPL_CHEM_SUBSTRUCTUREHISTOGRAMCALCULATOR_HPP
61 typedef std::vector<Pattern> PatternList;
74 bool all_matches =
true,
bool unique_matches =
true);
99 bool all_matches =
true,
bool unique_matches =
true);
125 template <
typename T>
131 typedef std::function<void(std::size_t)> HistoUpdateFunction;
133 template <
typename T>
134 class HistoUpdateFunctor
138 HistoUpdateFunctor(
T& histo):
141 void operator()(std::size_t
id)
150 void doCalculate(
const MolecularGraph& molgraph,
const HistoUpdateFunction& func);
152 void init(
const MolecularGraph& molgraph);
154 void processPattern(
const Pattern& ptn,
const HistoUpdateFunction& func);
155 bool processMatch(
const AtomBondMapping& mapping,
const Pattern& ptn,
const HistoUpdateFunction& func);
157 typedef std::pair<Util::BitSet, Util::BitSet> AtomBondMask;
158 typedef std::map<std::size_t, AtomBondMask> PriorityToAtomBondMaskMap;
160 const MolecularGraph* molGraph;
161 PatternList patterns;
162 SubstructureSearch substructSearch;
163 PriorityToAtomBondMaskMap matchedSubstructMasks;
164 AtomBondMask testingAtomBondMask;
171 template <
typename T>
174 doCalculate(molgraph, HistoUpdateFunctor<T>(histo));
Definition of the type CDPL::Util::BitSet.
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 the class CDPL::Chem::MolecularGraph.
Definition of the class CDPL::Chem::SubstructureSearch.
MolecularGraph.
Definition: MolecularGraph.hpp:52
std::shared_ptr< MolecularGraph > SharedPointer
A reference-counted smart pointer [SHPTR] for dynamically allocated MolecularGraph instances.
Definition: MolecularGraph.hpp:58
Definition: SubstructureHistogramCalculator.hpp:70
Pattern(const MolecularGraph::SharedPointer &structure, std::size_t id, std::size_t priority=0, bool all_matches=true, bool unique_matches=true)
bool processUniqueMatchesOnly() const
const MolecularGraph::SharedPointer & getStructure() const
std::size_t getPriority() const
bool processAllMatches() const
std::size_t getID() const
SubstructureHistogramCalculator.
Definition: SubstructureHistogramCalculator.hpp:55
ConstPatternIterator begin() const
SubstructureHistogramCalculator & operator=(const SubstructureHistogramCalculator &gen)
void addPattern(const Pattern &ptn)
ConstPatternIterator end() const
ConstPatternIterator getPatternsEnd() const
PatternList::iterator PatternIterator
Definition: SubstructureHistogramCalculator.hpp:67
PatternIterator getPatternsBegin()
PatternIterator getPatternsEnd()
std::size_t getNumPatterns() const
void removePattern(std::size_t idx)
PatternList::const_iterator ConstPatternIterator
Definition: SubstructureHistogramCalculator.hpp:66
SubstructureHistogramCalculator()
SubstructureHistogramCalculator(const SubstructureHistogramCalculator &gen)
void addPattern(const MolecularGraph::SharedPointer &structure, std::size_t id, std::size_t priority=0, bool all_matches=true, bool unique_matches=true)
void calculate(const MolecularGraph &molgraph, T &histo)
Definition: SubstructureHistogramCalculator.hpp:172
const Pattern & getPattern(std::size_t idx) const
ConstPatternIterator getPatternsBegin() const
std::shared_ptr< SubstructureHistogramCalculator > SharedPointer
Definition: SubstructureHistogramCalculator.hpp:64
void removePattern(const PatternIterator &ptn_it)
constexpr unsigned int T
Specifies Hydrogen (Tritium).
Definition: AtomType.hpp:67
boost::dynamic_bitset BitSet
A dynamic bitset class.
Definition: BitSet.hpp:46
The namespace of the Chemical Data Processing Library.