Hi Geoff, I have submitted a pull request for #1742 that is the cleaned up version of #1740. It does not store the atom index anymore as you suggested.
Cheers, Mohammad > On Dec 30, 2017, at 3:24 PM, Geoffrey Hutchison <geoff.hutchi...@gmail.com> > wrote: > >> Below is one of our old emails about storing different partial charges. That >> is the reason I added the charges to OBMol rather than OBAtom. Maybe, I >> misunderstood your email. Here, I concluded that you recommend to add >> partial charges to OBMol as generic data. > > There are pro/con reasons for storing on the atom or the molecule. The big > problem I have with the patch, is that you're storing the charges really > inefficiently even if it's on the OBMol. > > Here was my suggestion: >> OBPartialChargeList - then have an std::map of std::vector<float> that >> stores named sets of partial charges. > > You're storing a set of atom indexes and floats. You don't need that - it's > inefficient, not only in the memory required but in searching. > > std::vector<float> mpaCharges; > mpaCharges.resize(mol.NumAtoms()); // you *know* there will be a charge for > each atom. > > Then instead of keeping an index, you just do something like this: > > mpaCharges[i] = charge; > > So the OBPartialCharges type would have an std::map keyed by the name of the > partial charges. > > -Geoff ------------------------------------------------------------------------------ Check out the vibrant tech community on one of the world's most engaging tech sites, Slashdot.org! http://sdm.link/slashdot _______________________________________________ OpenBabel-Devel mailing list OpenBabel-Devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/openbabel-devel