RDKit: RDKit::EnumerationStrategyBase Class Reference

| RDKit Open-source cheminformatics and machine learning.

Loading...
Searching...
No Matches
Public Member Functions | Static Public Attributes | Protected Member Functions | Protected Attributes | Friends | List of all members
RDKit::EnumerationStrategyBase Class Referenceabstract

`#include <EnumerationStrategyBase.h>`

Inheritance diagram for RDKit::EnumerationStrategyBase:

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

## Static Public Attributes
static const boost::uint64_t | EnumerationOverflow

## Protected Member Functions
void | internalInitialize (const EnumerationTypes::RGROUPS &rgroups)

## Protected Attributes
EnumerationTypes::RGROUPS | m_permutation
EnumerationTypes::RGROUPS | m_permutationSizes
boost::uint64_t | m_numPermutations {}

## Friends
class | boost::serialization::access

## Detailed Description

Base Class for enumeration strategies Usage: EnumerationStrategyBase must be initialized with both a reaction and the building block (molecule) vector to be sampled.

    //!  EnumerationStrategyBase &eb = ...
    //!   if(eb) { // can we get another entry
    //!    const std::vector<int> &v = eb.next();
    //!    v[0] // RGroup 0 position
    //!    v[1] // RGroup 1 position...
    //!   }
    //!

Definition at line 123 of file EnumerationStrategyBase.h.

## Constructor & Destructor Documentation

## ◆ EnumerationStrategyBase()

RDKit::EnumerationStrategyBase::EnumerationStrategyBase | ( |  | ) |
| inline

Definition at line 134 of file EnumerationStrategyBase.h.

References m_permutation, and m_permutationSizes.

Referenced by RDKit::CartesianProductStrategy::CartesianProductStrategy(), RDKit::CartesianProductStrategy::copy(), copy(), RDKit::EvenSamplePairsStrategy::copy(), RDKit::RandomSampleAllBBsStrategy::copy(), RDKit::RandomSampleStrategy::copy(), RDKit::EvenSamplePairsStrategy::EvenSamplePairsStrategy(), RDKit::EvenSamplePairsStrategy::EvenSamplePairsStrategy(), RDKit::RandomSampleAllBBsStrategy::RandomSampleAllBBsStrategy(), and RDKit::RandomSampleStrategy::RandomSampleStrategy().

## ◆ ~EnumerationStrategyBase()

virtual RDKit::EnumerationStrategyBase::~EnumerationStrategyBase | ( |  | ) |
| inlinevirtual

Definition at line 136 of file EnumerationStrategyBase.h.

## Member Function Documentation

## ◆ copy()

virtual EnumerationStrategyBase * RDKit::EnumerationStrategyBase::copy | ( |  | ) | const
| pure virtual

copy the enumeration strategy complete with current state

Implemented in RDKit::CartesianProductStrategy, RDKit::EvenSamplePairsStrategy, RDKit::RandomSampleAllBBsStrategy, and RDKit::RandomSampleStrategy.

References EnumerationStrategyBase().

## ◆ getNumPermutations()

boost::uint64_t RDKit::EnumerationStrategyBase::getNumPermutations | ( |  | ) | const
| inline

a result of EnumerationOverflow indicates that the number of permutations is not computable with the current rdlonglong size.

Definition at line 185 of file EnumerationStrategyBase.h.

References m_numPermutations.

## ◆ getPermutationIdx()

virtual boost::uint64_t RDKit::EnumerationStrategyBase::getPermutationIdx | ( |  | ) | const
| pure virtual

Returns how many permutations have been processed by this strategy.

Implemented in RDKit::CartesianProductStrategy, RDKit::EvenSamplePairsStrategy, RDKit::RandomSampleAllBBsStrategy, and RDKit::RandomSampleStrategy.

## ◆ getPosition()

const EnumerationTypes::RGROUPS & RDKit::EnumerationStrategyBase::getPosition | ( |  | ) | const
| inline

The current position in the enumeration.

Definition at line 180 of file EnumerationStrategyBase.h.

References m_permutation.

## ◆ initialize()

void RDKit::EnumerationStrategyBase::initialize | ( | const ChemicalReaction & | reaction,
|  | const EnumerationTypes::BBS & | building_blocks )
| inline

Initialize the enumerator based on the reaction and the supplied building blocks This is the standard API point. This calls the derived class's initializeStrategy method which must be implemented

Definition at line 145 of file EnumerationStrategyBase.h.

References RDKit::computeNumProducts(), RDKit::getSizesFromBBs(), initializeStrategy(), m_numPermutations, m_permutation, and m_permutationSizes.

## ◆ initializeStrategy()

virtual void RDKit::EnumerationStrategyBase::initializeStrategy | ( | const ChemicalReaction & | reaction,
|  | const EnumerationTypes::BBS & | building_blocks )
| pure virtual

Implemented in RDKit::CartesianProductStrategy, RDKit::EvenSamplePairsStrategy, RDKit::RandomSampleAllBBsStrategy, and RDKit::RandomSampleStrategy.

Referenced by initialize().

## ◆ internalInitialize()

void RDKit::EnumerationStrategyBase::internalInitialize | ( | const EnumerationTypes::RGROUPS & | rgroups | ) |
| inlineprotected

Initialize the internal data structures i.e. RGROUPS = {10,40,50};

Definition at line 202 of file EnumerationStrategyBase.h.

References RDKit::computeNumProducts(), m_numPermutations, m_permutation, and m_permutationSizes.

## ◆ next()

virtual const EnumerationTypes::RGROUPS & RDKit::EnumerationStrategyBase::next | ( |  | ) |
| pure virtual

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

Implemented in RDKit::CartesianProductStrategy, RDKit::EvenSamplePairsStrategy, RDKit::RandomSampleAllBBsStrategy, and RDKit::RandomSampleStrategy.

Referenced by skip().

## ◆ operator bool()

virtual RDKit::EnumerationStrategyBase::operator bool | ( |  | ) | const
| pure virtual

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

Implemented in RDKit::CartesianProductStrategy, RDKit::EvenSamplePairsStrategy, RDKit::RandomSampleAllBBsStrategy, and RDKit::RandomSampleStrategy.

## ◆ skip()

bool RDKit::EnumerationStrategyBase::skip | ( | boost::uint64_t | skipCount | ) |
| inline

Skip the specified number of permutations (useful for resetting state to a known position)

Definition at line 192 of file EnumerationStrategyBase.h.

References next().

## ◆ type()

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

Reimplemented in RDKit::CartesianProductStrategy, RDKit::EvenSamplePairsStrategy, RDKit::RandomSampleAllBBsStrategy, and RDKit::RandomSampleStrategy.

Definition at line 138 of file EnumerationStrategyBase.h.

## Friends And Related Symbol Documentation

## ◆ boost::serialization::access

friend class boost::serialization::access
| friend

Definition at line 210 of file EnumerationStrategyBase.h.

References m_numPermutations, m_permutation, and m_permutationSizes.

## Member Data Documentation

## ◆ EnumerationOverflow

const boost::uint64_t RDKit::EnumerationStrategyBase::EnumerationOverflow
| static

Initial value:
=
static_cast<boost::uint64_t>(-1)

Definition at line 132 of file EnumerationStrategyBase.h.

## ◆ m_numPermutations

boost::uint64_t RDKit::EnumerationStrategyBase::m_numPermutations {}
| protected

Definition at line 129 of file EnumerationStrategyBase.h.

Referenced by boost::serialization::access, getNumPermutations(), initialize(), and internalInitialize().

## ◆ m_permutation

EnumerationTypes::RGROUPS RDKit::EnumerationStrategyBase::m_permutation
| protected

Definition at line 125 of file EnumerationStrategyBase.h.

Referenced by boost::serialization::access, RDKit::EvenSamplePairsStrategy::boost::serialization::access, EnumerationStrategyBase(), getPosition(), initialize(), RDKit::RandomSampleAllBBsStrategy::initializeStrategy(), internalInitialize(), RDKit::CartesianProductStrategy::next(), RDKit::RandomSampleAllBBsStrategy::next(), RDKit::RandomSampleStrategy::next(), RDKit::RandomSampleAllBBsStrategy::RandomSampleAllBBsStrategy(), and RDKit::RandomSampleStrategy::RandomSampleStrategy().

## ◆ m_permutationSizes

EnumerationTypes::RGROUPS RDKit::EnumerationStrategyBase::m_permutationSizes
| protected

Definition at line 127 of file EnumerationStrategyBase.h.

Referenced by boost::serialization::access, RDKit::EvenSamplePairsStrategy::boost::serialization::access, EnumerationStrategyBase(), initialize(), RDKit::RandomSampleAllBBsStrategy::initializeStrategy(), RDKit::RandomSampleStrategy::initializeStrategy(), internalInitialize(), and RDKit::RandomSampleAllBBsStrategy::next().

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

- EnumerationStrategyBase.h