[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [IMP-dev] get_interacting_particles

ok thanks !!!
On Aug 21, 2008, at 1:12 AM, Ben Webb wrote:

Keren Lasker wrote:
I am using the latest version, updated an hour ago.
The code is:
Particles r_particles;
  for(ParticlesList::iterator it1 =
      it1 != r.get_interacting_particles().end(); it1++){
    for(Particles::iterator it2 = it1->begin(); it2 != it1->end();
it2++) {

Since get_interacting_particles() returns a new vector, you're trying to
iterate from the start of one list to the end of an entirely different
one. Like Daniel says, same problem as last time. Your second code
snippet uses only one ParticlesList though (pl) so it should work fine -
assuming you actually initialize it to something useful somewhere.

"It is a capital mistake to theorize before one has data."
	- Sir Arthur Conan Doyle
IMP-dev mailing list