When erasing cached shortcut conditionals in the Bayes Tree, only erase the chains of shortcuts that exist instead of the whole tree.

release/4.3a0
Stephen Williams 2012-08-03 19:05:48 +00:00
parent b211c1070d
commit f39bad0d13
1 changed files with 13 additions and 6 deletions

View File

@ -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();
}
}
}