![]() |
Chemical Data Processing Library C++ API - Version 1.4.0
|
Enumerates the resonance structures of a molecular graph by redistributing π-electrons across the resonance-active bonds. More...
#include <ResonanceStructureGenerator.hpp>
Classes | |
| class | StructureData |
| Holds the per-atom formal charges and per-bond bond-orders that define a single resonance structure. More... | |
Public Types | |
| typedef std::shared_ptr< ResonanceStructureGenerator > | SharedPointer |
A reference-counted smart pointer [SHPTR] for dynamically allocated ResonanceStructureGenerator instances. More... | |
| typedef boost::indirect_iterator< StructureDataList::const_iterator, const StructureData > | ConstStructureDataIterator |
| A constant iterator over the generated resonance-structure records. More... | |
Public Member Functions | |
| ResonanceStructureGenerator () | |
Constructs the ResonanceStructureGenerator instance. More... | |
| ResonanceStructureGenerator (const ResonanceStructureGenerator &gen) | |
Constructs a copy of the ResonanceStructureGenerator instance gen. More... | |
| virtual | ~ResonanceStructureGenerator () |
| Virtual destructor. More... | |
| ResonanceStructureGenerator & | operator= (const ResonanceStructureGenerator &gen) |
| Replaces the state of this generator by a copy of the state of gen. More... | |
| Util::BitSet & | getOctetRuleCheckAtomTypes () |
| Returns the bit mask of atom types subjected to the octet-rule check during minimization. More... | |
| const Util::BitSet & | getOctetRuleCheckAtomTypes () const |
| Returns the bit mask of atom types subjected to the octet-rule check during minimization. More... | |
| void | minimizeOctetRuleViolations (bool minimize) |
| Specifies whether resonance structures violating the octet rule shall be filtered out. More... | |
| bool | octetRuleViolationsMinimized () const |
| Tells whether octet-rule violations are minimized. More... | |
| void | minimizeSP1GeometryViolations (bool minimize) |
| Specifies whether resonance structures with sp-hybridization-geometry violations shall be filtered out. More... | |
| bool | sp1GeometryViolationsMinimized () const |
| Tells whether sp-hybridization-geometry violations are minimized. More... | |
| void | minimizeCarbonBond12Charges (bool minimize) |
| Specifies whether resonance structures with 1,2-charge separations on adjacent carbon atoms shall be filtered out. More... | |
| bool | carbonBond12ChargesMinimized () const |
| Tells whether 1,2-charge separations on adjacent carbon atoms are minimized. More... | |
| void | setChargeCountWindow (std::size_t win_size) |
| Sets the maximum allowed difference between the lowest and highest formal-charge count of accepted resonance structures. More... | |
| std::size_t | getChargeCountWindow () const |
| Returns the configured charge-count window size. More... | |
| void | setMaxNumGeneratedStructures (std::size_t max_num) |
| Sets the upper limit on the number of resonance structures generated per molecule. More... | |
| std::size_t | getMaxNumGeneratedStructures () const |
| Returns the upper limit on the number of resonance structures generated per molecule. More... | |
| void | generate (const MolecularGraph &molgraph) |
| Generates all unique resonance structures of the molecular graph molgraph. More... | |
| std::size_t | getNumStructures () const |
| Returns the number of generated resonance structures. More... | |
| const StructureData & | getStructureData (std::size_t idx) const |
| Returns the resonance-structure record at index idx. More... | |
| ConstStructureDataIterator | getStructureDataBegin () const |
| Returns a constant iterator pointing to the first generated resonance-structure record. More... | |
| ConstStructureDataIterator | getStructureDataEnd () const |
| Returns a constant iterator pointing one past the last generated resonance-structure record. More... | |
| ConstStructureDataIterator | begin () const |
| Returns a constant iterator pointing to the first generated record (range-based for support). More... | |
| ConstStructureDataIterator | end () const |
| Returns a constant iterator pointing one past the last generated record (range-based for support). More... | |
Enumerates the resonance structures of a molecular graph by redistributing π-electrons across the resonance-active bonds.
For each generated resonance structure the per-atom formal charges and per-bond bond-orders are reported as a Chem::ResonanceStructureGenerator::StructureData record. Optional post-processing minimizes octet-rule violations, sp-hybridization-geometry violations, and 1,2-charge separations on adjacent carbon atoms.
| typedef std::shared_ptr<ResonanceStructureGenerator> CDPL::Chem::ResonanceStructureGenerator::SharedPointer |
A reference-counted smart pointer [SHPTR] for dynamically allocated ResonanceStructureGenerator instances.
| typedef boost::indirect_iterator<StructureDataList::const_iterator, const StructureData> CDPL::Chem::ResonanceStructureGenerator::ConstStructureDataIterator |
A constant iterator over the generated resonance-structure records.
| CDPL::Chem::ResonanceStructureGenerator::ResonanceStructureGenerator | ( | ) |
Constructs the ResonanceStructureGenerator instance.
| CDPL::Chem::ResonanceStructureGenerator::ResonanceStructureGenerator | ( | const ResonanceStructureGenerator & | gen | ) |
Constructs a copy of the ResonanceStructureGenerator instance gen.
| gen | The ResonanceStructureGenerator to copy. |
|
inlinevirtual |
Virtual destructor.
| ResonanceStructureGenerator& CDPL::Chem::ResonanceStructureGenerator::operator= | ( | const ResonanceStructureGenerator & | gen | ) |
Replaces the state of this generator by a copy of the state of gen.
| gen | The source ResonanceStructureGenerator. |
| Util::BitSet& CDPL::Chem::ResonanceStructureGenerator::getOctetRuleCheckAtomTypes | ( | ) |
Returns the bit mask of atom types subjected to the octet-rule check during minimization.
| const Util::BitSet& CDPL::Chem::ResonanceStructureGenerator::getOctetRuleCheckAtomTypes | ( | ) | const |
Returns the bit mask of atom types subjected to the octet-rule check during minimization.
const reference to the bit mask (indexed by Chem::AtomType value). | void CDPL::Chem::ResonanceStructureGenerator::minimizeOctetRuleViolations | ( | bool | minimize | ) |
Specifies whether resonance structures violating the octet rule shall be filtered out.
| minimize | If true, structures with octet-rule violations on the configured atom types are minimized. |
| bool CDPL::Chem::ResonanceStructureGenerator::octetRuleViolationsMinimized | ( | ) | const |
Tells whether octet-rule violations are minimized.
true if octet-rule violations are minimized, and false otherwise. | void CDPL::Chem::ResonanceStructureGenerator::minimizeSP1GeometryViolations | ( | bool | minimize | ) |
Specifies whether resonance structures with sp-hybridization-geometry violations shall be filtered out.
| minimize | If true, sp-hybridization-geometry violations are minimized. |
| bool CDPL::Chem::ResonanceStructureGenerator::sp1GeometryViolationsMinimized | ( | ) | const |
Tells whether sp-hybridization-geometry violations are minimized.
true if sp-geometry violations are minimized, and false otherwise. | void CDPL::Chem::ResonanceStructureGenerator::minimizeCarbonBond12Charges | ( | bool | minimize | ) |
Specifies whether resonance structures with 1,2-charge separations on adjacent carbon atoms shall be filtered out.
| minimize | If true, 1,2-charged C−C resonance forms are minimized. |
| bool CDPL::Chem::ResonanceStructureGenerator::carbonBond12ChargesMinimized | ( | ) | const |
Tells whether 1,2-charge separations on adjacent carbon atoms are minimized.
true if 1,2-charged C−C resonance forms are minimized, and false otherwise. | void CDPL::Chem::ResonanceStructureGenerator::setChargeCountWindow | ( | std::size_t | win_size | ) |
Sets the maximum allowed difference between the lowest and highest formal-charge count of accepted resonance structures.
| win_size | The new charge-count window size. |
| std::size_t CDPL::Chem::ResonanceStructureGenerator::getChargeCountWindow | ( | ) | const |
Returns the configured charge-count window size.
| void CDPL::Chem::ResonanceStructureGenerator::setMaxNumGeneratedStructures | ( | std::size_t | max_num | ) |
Sets the upper limit on the number of resonance structures generated per molecule.
| max_num | The new output-structure limit. |
| std::size_t CDPL::Chem::ResonanceStructureGenerator::getMaxNumGeneratedStructures | ( | ) | const |
Returns the upper limit on the number of resonance structures generated per molecule.
| void CDPL::Chem::ResonanceStructureGenerator::generate | ( | const MolecularGraph & | molgraph | ) |
Generates all unique resonance structures of the molecular graph molgraph.
| molgraph | The molecular graph for which to generate the resonance structures. |
| std::size_t CDPL::Chem::ResonanceStructureGenerator::getNumStructures | ( | ) | const |
Returns the number of generated resonance structures.
| const StructureData& CDPL::Chem::ResonanceStructureGenerator::getStructureData | ( | std::size_t | idx | ) | const |
Returns the resonance-structure record at index idx.
| idx | The zero-based structure index. |
const reference to the resonance-structure record. | Base::IndexError | if the number of resonance structures is zero or idx is not in the range [0, getNumStructures() - 1]. |
| ConstStructureDataIterator CDPL::Chem::ResonanceStructureGenerator::getStructureDataBegin | ( | ) | const |
Returns a constant iterator pointing to the first generated resonance-structure record.
| ConstStructureDataIterator CDPL::Chem::ResonanceStructureGenerator::getStructureDataEnd | ( | ) | const |
Returns a constant iterator pointing one past the last generated resonance-structure record.
| ConstStructureDataIterator CDPL::Chem::ResonanceStructureGenerator::begin | ( | ) | const |
Returns a constant iterator pointing to the first generated record (range-based for support).
| ConstStructureDataIterator CDPL::Chem::ResonanceStructureGenerator::end | ( | ) | const |
Returns a constant iterator pointing one past the last generated record (range-based for support).