Skip to content

Commit

Permalink
return the correct list containing only the updated particles in Move…
Browse files Browse the repository at this point in the history
…dSingletonContainer

git-svn-id: https://svn.salilab.org/imp/trunk@12827 e91f8c7b-0e32-4433-a9ac-4502d39a4eab
  • Loading branch information
drussel@SALILAB.ORG authored and drussel@SALILAB.ORG committed Feb 24, 2012
1 parent c6e2879 commit a2bcbbb
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions modules/core/src/internal/MovedSingletonContainer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,9 @@ void MovedSingletonContainer::do_after_evaluate() {
}
reset_moved_=false;
reset_all_=false;
IMP_IF_CHECK(USAGE_AND_INTERNAL) {
validate();
}
}

void MovedSingletonContainer::do_before_evaluate()
Expand All @@ -67,6 +70,7 @@ void MovedSingletonContainer::do_before_evaluate()
first_call_=false;
} else {
ParticleIndexes mved= do_get_moved();
IMP_LOG(TERSE, "Adding to moved list: " << Showable(mved) << std::endl);
add_to_list(mved);
}
IMP_IF_CHECK(USAGE_AND_INTERNAL) {
Expand Down Expand Up @@ -118,7 +122,8 @@ void XYZRMovedSingletonContainer::validate() const {
//using IMP::core::operator<<;
// not sure why I need "Showable" all of a sudden, but I do
for (unsigned int i=0; i< moved_.size(); ++i) {
IMP_USAGE_CHECK(get_contains(get_model()->get_particle(moved_[i])),
Particle *p=get_singleton_container()->get_particle(moved_[i]);
IMP_USAGE_CHECK(get_contains(p),
"Particle in moved list but not in contents");
}
}
Expand All @@ -136,12 +141,14 @@ ParticleIndexes XYZRMovedSingletonContainer::do_initialize() {
IMP_OBJECT_LOG;
backup_.clear();
moved_.clear();
ParticleIndexes ret;
//backup_.resize(get_singleton_container()->get_number_of_particles());
IMP_FOREACH_SINGLETON_INDEX(get_singleton_container(),{
backup_.push_back(XYZR(get_model(), _1).get_sphere());
moved_.push_back(_2);
ret.push_back(_1);
});
return moved_;
return ret;
}

void XYZRMovedSingletonContainer::do_reset_moved() {
Expand Down

0 comments on commit a2bcbbb

Please sign in to comment.