|
Chemical Data Processing Library C++ API - Version 1.0.0
|
Go to the documentation of this file.
29 #ifndef CDPL_CHEM_COMMONCONNECTEDSUBSTRUCTURESEARCH_HPP
30 #define CDPL_CHEM_COMMONCONNECTEDSUBSTRUCTURESEARCH_HPP
37 #include <boost/iterator/indirect_iterator.hpp>
63 typedef std::vector<AtomBondMapping*> ABMappingList;
69 typedef boost::indirect_iterator<ABMappingList::iterator, AtomBondMapping>
MappingIterator;
74 typedef boost::indirect_iterator<ABMappingList::const_iterator, const AtomBondMapping>
ConstMappingIterator;
282 void initMatchExpressions();
284 bool findEquivAtoms();
285 bool findEquivBonds();
288 bool mapAtoms(std::size_t);
289 bool mapAtoms(std::size_t, std::size_t);
291 bool nextTargetAtom(std::size_t, std::size_t&, std::size_t&)
const;
295 bool hasPostMappingMatchExprs()
const;
298 bool foundMappingUnique();
301 void clearMappings();
303 void freeAtomBondMappings();
304 void freeAtomBondMapping();
312 void initQueryAtomMask(std::size_t);
313 void initTargetAtomMask(std::size_t);
315 void initQueryBondMask(std::size_t);
316 void initTargetBondMask(std::size_t);
318 void setQueryAtomBit(std::size_t);
319 void setTargetAtomBit(std::size_t);
321 void resetQueryAtomBit(std::size_t);
322 void resetTargetAtomBit(std::size_t);
324 bool testTargetAtomBit(std::size_t)
const;
326 void setQueryBondBit(std::size_t);
327 void setTargetBondBit(std::size_t);
329 void resetBondMasks();
331 bool operator<(
const ABMappingMask&)
const;
332 bool operator>(
const ABMappingMask&)
const;
343 typedef std::vector<Util::BitSet> BitMatrix;
344 typedef std::vector<const Atom*> AtomMappingTable;
345 typedef std::vector<std::size_t> AtomIndexList;
346 typedef std::vector<std::size_t> BondMappingStack;
347 typedef std::deque<std::size_t> AtomQueue;
348 typedef std::set<ABMappingMask> UniqueMappingList;
349 typedef std::vector<const Atom*> AtomList;
350 typedef std::vector<const Bond*> BondList;
351 typedef std::vector<MatchExpression<Atom, MolecularGraph>::SharedPointer> AtomMatchExprTable;
352 typedef std::vector<MatchExpression<Bond, MolecularGraph>::SharedPointer> BondMatchExprTable;
357 BitMatrix atomEquivMatrix;
358 BitMatrix bondEquivMatrix;
359 AtomQueue termQueryAtoms;
360 AtomIndexList termTargetAtoms;
361 BondMappingStack bondMappingStack;
362 AtomMappingTable queryAtomMapping;
363 ABMappingMask mappingMask;
367 ABMappingList foundMappings;
368 UniqueMappingList uniqueMappings;
369 AtomMatchExprTable atomMatchExprTable;
370 BondMatchExprTable bondMatchExprTable;
371 MolGraphMatchExprPtr molGraphMatchExpr;
372 AtomList postMappingMatchAtoms;
373 BondList postMappingMatchBonds;
374 MappingCache mappingCache;
379 bool maxMappingsOnly;
380 std::size_t numQueryAtoms;
381 std::size_t numQueryBonds;
382 std::size_t numTargetAtoms;
383 std::size_t numTargetBonds;
384 std::size_t numMappedAtoms;
385 std::size_t currMaxSubstructureSize;
386 std::size_t maxBondStackSize;
387 std::size_t maxNumMappings;
388 std::size_t minSubstructureSize;
393 #endif // CDPL_CHEM_COMMONCONNECTEDSUBSTRUCTURESEARCH_HPP
const AtomBondMapping & getMapping(std::size_t idx) const
Returns a const reference to the stored atom/bond mapping object at index idx.
std::size_t getNumMappings() const
Returns the number of atom/bond mappings that were recorded in the last search for common substructur...
MappingIterator begin()
Returns a mutable iterator pointing to the beginning of the stored atom/bond mapping objects.
Definition of the class CDPL::Util::ObjectStack.
void setMaxNumMappings(std::size_t max_num_mappings)
Allows to specify a limit on the number of stored atom/bond mappings.
bool uniqueMappingsOnly() const
Tells whether duplicate atom/bond mappings are discarded.
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.
ConstMappingIterator end() const
Returns a constant iterator pointing to the end of the stored atom/bond mapping objects.
MappingIterator getMappingsBegin()
Returns a mutable iterator pointing to the beginning of the stored atom/bond mapping objects.
boost::indirect_iterator< ABMappingList::const_iterator, const AtomBondMapping > ConstMappingIterator
A constant random access iterator used to iterate over the stored atom/bond mapping objects.
Definition: CommonConnectedSubstructureSearch.hpp:74
bool findMaxMappings(const MolecularGraph &target)
Searches for all maximum-sized atom/bond mappings of connected query subgraphs to substructures of th...
AtomBondMapping & getMapping(std::size_t idx)
Returns a non-const reference to the stored atom/bond mapping object at index idx.
bool mappingExists(const MolecularGraph &target)
Searches for a common connected substructure between the query and the specified target molecular gra...
boost::dynamic_bitset BitSet
A dynamic bitset class.
Definition: BitSet.hpp:46
~CommonConnectedSubstructureSearch()
Destructor.
ConstMappingIterator getMappingsBegin() const
Returns a constant iterator pointing to the beginning of the stored atom/bond mapping objects.
std::size_t getMinSubstructureSize() const
Returns the minimum accepted common substructure size.
CommonConnectedSubstructureSearch.
Definition: CommonConnectedSubstructureSearch.hpp:61
MolecularGraph.
Definition: MolecularGraph.hpp:52
Definition of the type CDPL::Util::BitSet.
bool operator<(const Array< ValueType > &array1, const Array< ValueType > &array2)
Less than comparison operator.
void setQuery(const MolecularGraph &query)
Allows to specify a new query structure.
MappingIterator getMappingsEnd()
Returns a mutable iterator pointing to the end of the stored atom/bond mapping objects.
Definition of the class CDPL::Chem::AtomBondMapping.
CommonConnectedSubstructureSearch()
Constructs and initializes a CommonConnectedSubstructureSearch instance.
MappingIterator end()
Returns a mutable iterator pointing to the end of the stored atom/bond mapping objects.
A generic boolean expression interface for the implementation of query/target object equivalence test...
Definition: MatchExpression.hpp:75
ConstMappingIterator getMappingsEnd() const
Returns a constant iterator pointing to the end of the stored atom/bond mapping objects.
Definition of the class CDPL::Chem::MatchExpression.
The namespace of the Chemical Data Processing Library.
void setMinSubstructureSize(std::size_t min_size)
Allows to specify the minimum accepted common substructure size.
std::size_t getMaxNumMappings() const
Returns the specified limit on the number of stored atom/bond mappings.
A data structure for the common storage of related atom to atom and bond to bond mappings.
Definition: AtomBondMapping.hpp:55
void uniqueMappingsOnly(bool unique)
Allows to specify whether or not to store only unique atom/bond mappings.
boost::indirect_iterator< ABMappingList::iterator, AtomBondMapping > MappingIterator
A mutable random access iterator used to iterate over the stored atom/bond mapping objects.
Definition: CommonConnectedSubstructureSearch.hpp:69
bool findAllMappings(const MolecularGraph &target)
Searches for all possible atom/bond mappings of connected query subgraphs to substructures of the spe...
bool operator>(const Array< ValueType > &array1, const Array< ValueType > &array2)
Greater than comparison operator.
CommonConnectedSubstructureSearch(const MolecularGraph &query)
Constructs and initializes a CommonConnectedSubstructureSearch instance for the specified query struc...
ConstMappingIterator begin() const
Returns a constant iterator pointing to the beginning of the stored atom/bond mapping objects.