19#include <unordered_map>
31typedef std::vector<ConjElectrons *>
CEVect;
33typedef std::vector<std::uint8_t>
ConjFP;
34typedef std::unordered_map<std::size_t, ConjElectrons *>
CEMap;
80 struct ResonanceProgress {
81 size_t d_totalStructs;
82 size_t d_diverseStructs;
84 size_t d_maxStructs{0};
85 std::vector<ResonanceProgress> d_progress;
130 unsigned int maxStructs = 1000);
137 unsigned int flags()
const {
return d_flags; }
164 return d_callback.get();
202 typedef struct CEPerm {
204 std::vector<unsigned int> v;
206 unsigned int d_nConjGrp;
207 unsigned int d_length;
208 unsigned int d_flags;
209 unsigned int d_maxStructs;
211 unsigned int d_numThreads;
216 std::vector<int> d_bondConjGrpIdx;
217 std::vector<int> d_atomConjGrpIdx;
218 std::vector<size_t> d_enumIdx;
219 std::unique_ptr<ResonanceMolSupplierCallback> d_callback;
223 void mainLoop(
unsigned int ti,
unsigned int nt);
224 void assignConjGrpIdx();
227 void prepEnumIdxVect();
228 void idxToCEPerm(
size_t idx, std::vector<unsigned int> &c)
const;
229 void setResonanceMolSupplierLength();
230 void buildCEMap(
CEMap &ceMap,
unsigned int conjGrpIdx);
231 void storeCEMap(
const CEMap &ceMap,
unsigned int conjGrpIdx);
232 void assignBondsFormalChargesHelper(
ROMol &mol,
233 std::vector<unsigned int> &c)
const;
234 ROMol *assignBondsFormalCharges(std::vector<unsigned int> &c)
const;
235 static bool cePermCompare(
const CEPerm *a,
const CEPerm *b);
The class for representing atoms.
class for representing a bond
ResonanceMolSupplierCallback()
size_t getMaxStructures() const
friend class ResonanceMolSupplier
size_t getNumDiverseStructures(unsigned int conjGrpIdx) const
virtual bool operator()()=0
virtual ~ResonanceMolSupplierCallback()
size_t getNumStructures(unsigned int conjGrpIdx) const
unsigned int getNumConjGrps() const
ResonanceMolSupplierCallback * getProgressCallback() const
ResonanceMolSupplier(ROMol &mol, unsigned int flags=0, unsigned int maxStructs=1000)
const ROMol & mol() const
void setProgressCallback(ResonanceMolSupplierCallback *callback)
ROMol * operator[](unsigned int idx)
int getAtomConjGrpIdx(unsigned int ai) const
void setNumThreads(int numThreads=1)
unsigned int flags() const
unsigned int getNumConjGrps() const
@ ALLOW_CHARGE_SEPARATION
@ ALLOW_INCOMPLETE_OCTETS
int getBondConjGrpIdx(unsigned int bi) const
void moveTo(unsigned int idx)
#define RDKIT_GRAPHMOL_EXPORT
std::vector< CEVect2 * > CEVect3
std::unordered_map< std::size_t, ConjElectrons * > CEMap
std::vector< std::uint8_t > ConjFP
std::vector< ConjElectrons * > CEVect
std::map< unsigned int, AtomElectrons * > ConjAtomMap
std::map< unsigned int, BondElectrons * > ConjBondMap