Added consistency check on removing cliques - that they exist in their parent's children list.
parent
812f441d79
commit
a7e2a494ed
|
@ -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_)
|
||||||
|
|
Loading…
Reference in New Issue