Added function to manually clear shortcut caches in a bayes tree

release/4.3a0
Alex Cunningham 2012-09-10 20:07:59 +00:00
parent db22753767
commit 684af98249
2 changed files with 4 additions and 4 deletions

View File

@ -914,6 +914,7 @@ virtual class BayesTree {
size_t size();
CLIQUE* root() const;
void clear();
void deleteCachedShorcuts();
void insert(const CLIQUE* subtree);
};
@ -944,10 +945,6 @@ virtual class BayesTreeClique {
// FactorGraph<FactorType> marginal(derived_ptr root, Eliminate function) const;
// FactorGraph<FactorType> joint(derived_ptr C2, derived_ptr root, Eliminate function) const;
/**
* This deletes the cached shortcuts of all cliques (subtree) below this clique.
* This is performed when the bayes tree is modified.
*/
void deleteCachedShorcuts();
};

View File

@ -212,6 +212,9 @@ namespace gtsam {
/** Remove all nodes */
void clear();
/** Clear all shortcut caches - use before timing on marginal calculation to avoid residual cache data */
inline void deleteCachedShorcuts() { root_->deleteCachedShorcuts(); }
/**
* Remove path from clique to root and return that path as factors
* plus a list of orphaned subtree roots. Used in removeTop below.