RDKit: RDKit::CartesianProductStrategy Class Reference

| RDKit Open-source cheminformatics and machine learning.

- Main Page
- Namespaces
- Classes
- Files

- Class List
- Class Hierarchy
- Class Members

Public Member Functions | List of all members
RDKit::CartesianProductStrategy Class Reference

This is a class for enumerating reagents using Cartesian Products of. More...

`#include <CartesianProduct.h>`

Inheritance diagram for RDKit::CartesianProductStrategy:

## Public Member Functions
| CartesianProductStrategy ()
virtual void | initializeStrategy (const ChemicalReaction &, const EnumerationTypes::BBS &)
virtual const char * | type () const
virtual const EnumerationTypes::RGROUPS & | next ()
| The current permutation {r1, r2, ...}. More...
virtual boost::uint64_t | getPermutationIdx () const
| Returns how many permutations have been processed by this strategy. More...
virtual | operator bool () const
EnumerationStrategyBase * | copy () const
| copy the enumeration strategy complete with current state More...
Public Member Functions inherited from RDKit::EnumerationStrategyBase
| EnumerationStrategyBase ()
virtual | ~EnumerationStrategyBase ()
void | initialize (const ChemicalReaction &reaction, const EnumerationTypes::BBS &building_blocks)
const EnumerationTypes::RGROUPS & | getPosition () const
| The current position in the enumeration. More...
boost::uint64_t | getNumPermutations () const
bool | skip (boost::uint64_t skipCount)

## Additional Inherited Members
Static Public Attributes inherited from RDKit::EnumerationStrategyBase
static const boost::uint64_t | EnumerationOverflow
Protected Member Functions inherited from RDKit::EnumerationStrategyBase
void | internalInitialize (const EnumerationTypes::RGROUPS &rgroups)
Protected Attributes inherited from RDKit::EnumerationStrategyBase
EnumerationTypes::RGROUPS | m_permutation
EnumerationTypes::RGROUPS | m_permutationSizes
boost::uint64_t | m_numPermutations

## Detailed Description

This is a class for enumerating reagents using Cartesian Products of.

CartesianProductStrategy produces a standard walk through all possible reagent combinations:

(0,0,0), (1,0,0), (2,0,0) ...

basic usage:

      std::vector<MOL_SPTR_VECT> bbs;
      bbs.push_back( bbs_for_reactants_1 );
      bbs.push_back( bbs_for_reactants_2 );

      RGRUOPS num_bbs;
      num_bbs.push_back(bbs[0].size());
      num_bbs.push_back(bbs[1].size());

      CartesianProductStrategy rgroups(num_bbs);
      for(size_t i=0; i<num_samples && rgroups; ++i) {
        MOL_SPTR_VECT rvect = getReactantsFromRGroups(bbs, rgroups.next());
        std::vector<MOL_SPTR_VECT> lprops = rxn.RunReactants(rvect);
        ...
      }

See EnumerationStrategyBase for more details and usage.

Definition at line 69 of file CartesianProduct.h.

## Constructor & Destructor Documentation

RDKit::CartesianProductStrategy::CartesianProductStrategy | ( |  | ) |
| inline

Definition at line 73 of file CartesianProduct.h.

References RDKit::EnumerationStrategyBase::initialize().

Referenced by copy().

## Member Function Documentation

EnumerationStrategyBase* RDKit::CartesianProductStrategy::copy | ( |  | ) | const
| inlinevirtual

copy the enumeration strategy complete with current state

Implements RDKit::EnumerationStrategyBase.

Definition at line 99 of file CartesianProduct.h.

References CartesianProductStrategy(), RDKit::EnumerationStrategyBase::EnumerationOverflow, RDKit::EnumerationStrategyBase::m_numPermutations, RDKit::EnumerationStrategyBase::m_permutation, RDKit::EnumerationStrategyBase::m_permutationSizes, and next().

virtual boost::uint64_t RDKit::CartesianProductStrategy::getPermutationIdx | ( |  | ) | const
| inlinevirtual

Returns how many permutations have been processed by this strategy.

Implements RDKit::EnumerationStrategyBase.

Definition at line 94 of file CartesianProduct.h.

virtual void RDKit::CartesianProductStrategy::initializeStrategy | ( | const ChemicalReaction & | ,
|  | const EnumerationTypes::BBS & |
| ) |  |
| inlinevirtual

Implements RDKit::EnumerationStrategyBase.

Definition at line 78 of file CartesianProduct.h.

virtual const EnumerationTypes::RGROUPS& RDKit::CartesianProductStrategy::next | ( |  | ) |
| inlinevirtual

The current permutation {r1, r2, ...}.

Implements RDKit::EnumerationStrategyBase.

Definition at line 85 of file CartesianProduct.h.

References RDKit::EnumerationStrategyBase::m_permutation.

Referenced by copy().

virtual RDKit::CartesianProductStrategy::operator bool | ( |  | ) | const
| inlinevirtual

returns true if there are more permutations left random enumerators may always return true...

Implements RDKit::EnumerationStrategyBase.

Definition at line 97 of file CartesianProduct.h.

virtual const char* RDKit::CartesianProductStrategy::type | ( |  | ) | const
| inlinevirtual

Reimplemented from RDKit::EnumerationStrategyBase.

Definition at line 82 of file CartesianProduct.h.

The documentation for this class was generated from the following file:

- CartesianProduct.h