C , 2012-06-07 11:04 -0700, Craig James rakstīja: > On Thu, Jun 7, 2012 at 8:29 AM, My Th <rei4...@gmail.com> wrote: > Now I got to the real culprits of this issue - previousState and > previousBondState. They are vectors of integers holding the state of > each atom and bond in molecule at the beginning of each iteration. > Putting them on heap allows to process 1bxr.pdb without increasing > stack > size limits. > > // Remember the current state so that we can backtrack if the > attempt fails > - vector<int> previousState = atomState; // Backup the > atom states > - vector<int> previousBondState = bondState; // ... and > the bond states > + // Keep previous states on heap to avoid stack overflows for > large molecules > + vector<int>* ppreviousState = new vector<int>(atomState); > // Backup the atom states > + vector<int>* ppreviousBondState = new vector<int>(bondState); > // ... and the bond states > > And deleting them just before expandKekulize() returns. > > This is probably helpful, but we should remember that it's a short-term > Band-Aid. The fundamental problem is still there, just waiting for an > even-larger molecule or a computer with less memory (as you mention > below). > > Aromaticity detection shouldn't be this hard. Most of the atoms in a > 50,000-atom molecule are probably not even in rings. And furthermore, > aromaticity detection only has to consider "ring groups" - groups of > rings that share at least one bond. Once you divide the molecule up > into ring groups, you almost never have to consider more than a few > dozen atoms at a time. If someone needs to deal with 50,000-atom > sheets of graphite, OpenBabel is probably not the right tool. > > Craig
If at least one of bond atoms is not part of a ring it already jumps to the next bond without saving the state, so it effectively looks only at "ring groups". I would argue that OB should be made the right tool even if one needs to deal with 50k atom graphite sheet :) Reinis ------------------------------------------------------------------------------ Live Security Virtual Conference Exclusive live event will cover all the ways today's security and threat landscape has changed and how IT managers can respond. Discussions will include endpoint security, mobile security and the latest in malware threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/ _______________________________________________ OpenBabel-Devel mailing list OpenBabel-Devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/openbabel-devel