RDKit::ResonanceMolSupplier Class Reference

`#include <Resonance.h>`

## Public Types

enum | ResonanceFlags { ALLOW_INCOMPLETE_OCTETS = (1 << 0), ALLOW_CHARGE_SEPARATION = (1 << 1), KEKULE_ALL = (1 << 2), UNCONSTRAINED_CATIONS = (1 << 3), UNCONSTRAINED_ANIONS = (1 << 4) }

## Public Member Functions

| ResonanceMolSupplier (ROMol &mol, unsigned int flags=0, unsigned int maxStructs=1000)
| ~ResonanceMolSupplier ()
const ROMol & | mol () const
unsigned int | flags () const
unsigned int | getNumConjGrps () const
int | getBondConjGrpIdx (unsigned int bi) const
int | getAtomConjGrpIdx (unsigned int ai) const
void | setNumThreads (int numThreads=1)
void | enumerate ()
bool | getIsEnumerated ()
unsigned int | length ()
void | reset ()
bool | atEnd ()
ROMol * | next ()
void | moveTo (unsigned int idx)
ROMol * | operator[] (unsigned int idx)

## Detailed Description

Definition at line 32 of file Resonance.h.

## Member Enumeration Documentation

## ResonanceFlags

enum RDKit::ResonanceMolSupplier::ResonanceFlags

Enumerator
ALLOW_INCOMPLETE_OCTETS | include resonance structures whose octets are less complete than the the most octet-complete structure
ALLOW_CHARGE_SEPARATION | include resonance structures featuring charge separation also when uncharged resonance structures exist
KEKULE_ALL | enumerate all possible degenerate Kekule resonance structures (the default is to include just one)
UNCONSTRAINED_CATIONS | if the UNCONSTRAINED_CATIONS flag is not set, positively charged atoms left and right of N with an incomplete octet are acceptable only if the conjugated group has a positive total formal charge
UNCONSTRAINED_ANIONS | if the UNCONSTRAINED_ANIONS flag is not set, negatively charged atoms left of N are acceptable only if the conjugated group has a negative total formal charge

Definition at line 34 of file Resonance.h.

## Constructor & Destructor Documentation

## ResonanceMolSupplier()

RDKit::ResonanceMolSupplier::ResonanceMolSupplier | ( | ROMol & | mol,
|  | unsigned int | flags = `0`,
|  | unsigned int | maxStructs = `1000`
| ) |  |

Parameters

  mol | - the starter molecule
  flags | - flags which influence criteria to generate resonance structures
  maxStructs | - maximum number of complete resonance structures generated
  numThreads | - the number of threads used to carry out the resonance structure enumeration (defaults to 1; 0 selects the number of concurrent threads supported by the hardware; negative values are added to the number of concurrent threads supported by the hardware)

Referenced by getIsEnumerated().

## ~ResonanceMolSupplier()

RDKit::ResonanceMolSupplier::~ResonanceMolSupplier | ( |  | ) |

## Member Function Documentation

## atEnd()

bool RDKit::ResonanceMolSupplier::atEnd | ( |  | ) |

Returns true if there are no more resonance structures left

Referenced by getIsEnumerated().

## enumerate()

void RDKit::ResonanceMolSupplier::enumerate | ( |  | ) |

Ask ResonanceMolSupplier to enumerate resonance structures (automatically done as soon as any attempt to access them is made)

Referenced by getNumConjGrps().

## flags()

unsigned int RDKit::ResonanceMolSupplier::flags | ( |  | ) | const

inline

Returns the flags the ResonanceMolSupplier was initialized with

Definition at line 76 of file Resonance.h.

## getAtomConjGrpIdx()

int RDKit::ResonanceMolSupplier::getAtomConjGrpIdx | ( | unsigned int | ai | ) | const

Given an atom index, it returns the index of the conjugated group the atom belongs to, or -1 if it is not conjugated

Referenced by getNumConjGrps().

## getBondConjGrpIdx()

int RDKit::ResonanceMolSupplier::getBondConjGrpIdx | ( | unsigned int | bi | ) | const

Given a bond index, it returns the index of the conjugated group the bond belongs to, or -1 if it is not conjugated

Referenced by getNumConjGrps().

## getIsEnumerated()

bool RDKit::ResonanceMolSupplier::getIsEnumerated | ( |  | ) |

inline

Returns true if resonance structure enumeration has already happened

Definition at line 98 of file Resonance.h.

References atEnd(), length(), mol(), moveTo(), next(), operator[](), reset(), and ResonanceMolSupplier().

## getNumConjGrps()

unsigned int RDKit::ResonanceMolSupplier::getNumConjGrps | ( |  | ) | const

inline

Returns the number of individual conjugated groups in the molecule

Definition at line 79 of file Resonance.h.

References enumerate(), getAtomConjGrpIdx(), getBondConjGrpIdx(), and setNumThreads().

## length()

unsigned int RDKit::ResonanceMolSupplier::length | ( |  | ) |

Returns the number of resonance structures in the ResonanceMolSupplier

Referenced by getIsEnumerated().

## mol()

const ROMol& RDKit::ResonanceMolSupplier::mol | ( |  | ) | const

inline

Returns a reference to the Kekulized form of the ROMol the ResonanceMolSupplier was initialized with

Definition at line 73 of file Resonance.h.

Referenced by getIsEnumerated().

## moveTo()

void RDKit::ResonanceMolSupplier::moveTo | ( | unsigned int | idx | ) |

Sets the ResonanceMolSupplier index to idx

Referenced by getIsEnumerated().

## next()

ROMol* RDKit::ResonanceMolSupplier::next | ( |  | ) |

Returns a pointer to the next resonance structure as a ROMol, or NULL if there are no more resonance structures left. The caller is responsible for freeing memory associated to the pointer

Referenced by getIsEnumerated().

## operator[]()

ROMol* RDKit::ResonanceMolSupplier::operator[] | ( | unsigned int | idx | ) |

Returns a pointer to the resonance structure with index idx as a ROMol. The index generates complete resonance structures by combining ConjElectrons objects for the respective conjugated groups in a breadth-first fashion, in order to return the most stable complete resonance structures first. The caller is responsible for freeing memory associated to the pointer

Referenced by getIsEnumerated().

## reset()

void RDKit::ResonanceMolSupplier::reset | ( |  | ) |

Resets the ResonanceMolSupplier index

Referenced by getIsEnumerated().

## setNumThreads()

void RDKit::ResonanceMolSupplier::setNumThreads | ( | int | numThreads = `1` | ) |

Sets the number of threads to be used to enumerate resonance structures (defaults to 1; 0 selects the number of concurrent threads supported by the hardware; negative values are added to the number of concurrent threads supported by the hardware)

Referenced by getNumConjGrps().

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

- Resonance.h