When erasing cached shortcut conditionals in the Bayes Tree, only erase the chains of shortcuts that exist instead of the whole tree.
parent
b211c1070d
commit
f39bad0d13
|
@ -268,12 +268,19 @@ namespace gtsam {
|
|||
/* ************************************************************************* */
|
||||
template<class DERIVED, class CONDITIONAL>
|
||||
void BayesTreeCliqueBase<DERIVED, CONDITIONAL>::deleteCachedShorcuts() {
|
||||
//Delete CachedShortcut for this clique
|
||||
this->resetCachedShortcut();
|
||||
// Recursive call over all child cliques
|
||||
|
||||
// When a shortcut is requested, all of the shortcuts between it and the
|
||||
// root are also generated. So, if this clique's cached shortcut is set,
|
||||
// recursively call over all child cliques. Otherwise, it is unnecessary.
|
||||
if(cachedShortcut_) {
|
||||
BOOST_FOREACH(derived_ptr& child, children_) {
|
||||
child->deleteCachedShorcuts();
|
||||
}
|
||||
|
||||
//Delete CachedShortcut for this clique
|
||||
this->resetCachedShortcut();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue