10 #ifndef _RESONANCE_H__ 11 #define _RESONANCE_H__ 16 #include <boost/unordered_map.hpp> 26 typedef std::map<unsigned int, BondElectrons *>
ConjBondMap;
28 typedef std::vector<ConjElectrons *>
CEVect;
30 typedef std::vector<boost::uint8_t>
ConjFP;
31 typedef boost::unordered_map<std::size_t, ConjElectrons *>
CEMap;
69 unsigned int maxStructs = 1000);
76 unsigned int flags()
const {
return d_flags; }
112 void moveTo(
unsigned int idx);
123 typedef struct CEPerm {
125 std::vector<unsigned int> v;
127 unsigned int d_nConjGrp;
128 unsigned int d_length;
129 unsigned int d_flags;
130 unsigned int d_maxStructs;
132 unsigned int d_numThreads;
135 void buildCEMap(CEMap &ceMap,
unsigned int conjGrpIdx);
137 std::vector<int> d_bondConjGrpIdx;
138 std::vector<int> d_atomConjGrpIdx;
139 std::vector<unsigned int> d_enumIdx;
143 void mainLoop(
unsigned int ti,
unsigned int nt);
144 void assignConjGrpIdx();
147 void prepEnumIdxVect();
148 void idxToCEPerm(
unsigned int idx, std::vector<unsigned int> &c)
const;
149 void setResonanceMolSupplierLength();
150 void storeCEMap(CEMap &ceMap,
unsigned int conjGrpIdx);
151 void enumerateNbArrangements(CEMap &ceMap, CEMap &ceMapTmp);
152 void pruneStructures(CEMap &ceMap);
153 void assignBondsFormalChargesHelper(
ROMol &
mol,
154 std::vector<unsigned int> &c)
const;
155 ROMol *assignBondsFormalCharges(std::vector<unsigned int> &c)
const;
156 static bool cePermCompare(
const CEPerm *a,
const CEPerm *b);
ResonanceMolSupplier(ROMol &mol, unsigned int flags=0, unsigned int maxStructs=1000)
void setNumThreads(int numThreads=1)
int getAtomConjGrpIdx(unsigned int ai) const
std::vector< boost::uint8_t > ConjFP
std::map< unsigned int, AtomElectrons * > ConjAtomMap
ROMol * operator[](unsigned int idx)
const ROMol & mol() const
void moveTo(unsigned int idx)
std::vector< CEVect2 * > CEVect3
boost::unordered_map< std::size_t, ConjElectrons * > CEMap
ROMol is a molecule class that is intended to have a fixed topology.
unsigned int flags() const
int getBondConjGrpIdx(unsigned int bi) const
std::vector< ConjElectrons * > CEVect
unsigned int getNumConjGrps() const
std::map< unsigned int, BondElectrons * > ConjBondMap