Added consistency check on removing cliques - that they exist in their parent's children list.

release/4.3a0
Richard Roberts 2013-03-05 05:47:24 +00:00
parent 812f441d79
commit a7e2a494ed
1 changed files with 6 additions and 2 deletions

View File

@ -253,8 +253,12 @@ namespace gtsam {
if (clique->isRoot()) if (clique->isRoot())
root_.reset(); root_.reset();
else // detach clique from parent else { // detach clique from parent
clique->parent_.lock()->children_.remove(clique); sharedClique parent = clique->parent_.lock();
std::list<typename CLIQUE::shared_ptr>::iterator child = std::find(parent->children().begin(), parent->children().end(), clique);
assert(child != parent->children().end());
parent->children().erase(child);
}
// orphan my children // orphan my children
BOOST_FOREACH(sharedClique child, clique->children_) BOOST_FOREACH(sharedClique child, clique->children_)