NewBond() (was: hydrogens and avogadro)

Since I’m not seeing my own mails I’m just sending a ne one instead of
replying.

When the vector _vbond is too small to add another bond in OBMol::AddBond,
this vector is resized to the current size + 100 (OBBondIncrement). This is
fine as long as you don’t call OBMol::NewBond(). NewBond() will push_back
the new bond to this _vbond vector resulting in a large gap between this
bond and the previous.

A simple fix would be to set “#define OBBondIncrement” to 1 or to make
NewBond() place the bond in the correct place.

Tim

Yes, we should really fix NewBond. The reason for the OBBondIncrement
is so that memory allocation is done in chunks, not at every call. I
think Chris put this in. I’ll patch up OB or you can.

(Sat, Feb 24, 2007 at 02:49:37AM +0100) Tim Vandermeersch tim.vandermeersch@gmail.com:

Since I’m not seeing my own mails I’m just sending a ne one instead of
replying.

When the vector _vbond is too small to add another bond in OBMol::AddBond,
this vector is resized to the current size + 100 (OBBondIncrement). This is
fine as long as you don’t call OBMol::NewBond(). NewBond() will push_back
the new bond to this _vbond vector resulting in a large gap between this
bond and the previous.

A simple fix would be to set “#define OBBondIncrement” to 1 or to make
NewBond() place the bond in the correct place.

Tim


Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net’s Techsay panel and you’ll get the chance to share your
opinions on IT & business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV


Avogadro-devel mailing list
Avogadro-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/avogadro-devel