#include <BayesTreeMarginalizationHelper.h>
Classes | |
struct | CachedSearch |
Public Types | |
using | Clique = typename BayesTree::Clique |
using | sharedClique = typename BayesTree::sharedClique |
Static Public Member Functions | |
static std::unordered_set< Key > | gatherAdditionalKeysToReEliminate (const BayesTree &bayesTree, const KeyVector &marginalizableKeys) |
Static Protected Member Functions | |
static void | addCliqueToKeySet (const Clique *clique, std::unordered_set< Key > *additionalKeys) |
static std::unordered_set< const Clique * > | gatherAdditionalCliquesToReEliminate (const BayesTree &bayesTree, const KeyVector &marginalizableKeys) |
static void | gatherDependentCliques (const Clique *rootClique, const std::unordered_set< Key > &marginalizableKeys, std::unordered_set< const Clique * > *additionalCliques, CachedSearch *cache) |
static void | gatherDependentCliquesFromChildren (const std::vector< const Clique * > &dependentChildren, const std::unordered_set< Key > &marginalizableKeys, std::unordered_set< const Clique * > *additionalCliques, CachedSearch *cache) |
static std::unordered_set< const Clique * > | getCliquesContainingKeys (const BayesTree &bayesTree, const std::unordered_set< Key > &keysOfInterest) |
static bool | hasDependency (const Clique *clique, const std::unordered_set< Key > &keys) |
static bool | hasDependency (const Clique *clique, Key key) |
static bool | isWholeCliqueMarginalizable (const Clique *clique, const std::unordered_set< Key > &marginalizableKeys, CachedSearch *cache) |
static bool | isWholeSubtreeMarginalizable (const Clique *subtree, const std::unordered_set< Key > &marginalizableKeys, CachedSearch *cache) |
static bool | needsReelimination (const Clique *clique, const std::unordered_set< Key > &marginalizableKeys, CachedSearch *cache) |
This class provides helper functions for marginalizing variables from a Bayes Tree.
Definition at line 37 of file BayesTreeMarginalizationHelper.h.
using gtsam::BayesTreeMarginalizationHelper< BayesTree >::Clique = typename BayesTree::Clique |
Definition at line 40 of file BayesTreeMarginalizationHelper.h.
using gtsam::BayesTreeMarginalizationHelper< BayesTree >::sharedClique = typename BayesTree::sharedClique |
Definition at line 41 of file BayesTreeMarginalizationHelper.h.
|
inlinestaticprotected |
Add all frontal variables from a clique to a key set.
[in] | clique | Clique to add keys from |
[out] | additionalKeys | Pointer to the output key set |
Definition at line 313 of file BayesTreeMarginalizationHelper.h.
|
inlinestaticprotected |
This function identifies cliques that need to be re-eliminated before performing marginalization. See the docstring of gatherAdditionalKeysToReEliminate().
Definition at line 98 of file BayesTreeMarginalizationHelper.h.
|
inlinestatic |
This function identifies variables that need to be re-eliminated before performing marginalization.
Re-elimination is necessary for a clique containing marginalizable variables if:
In addition, for any descendant node depending on a marginalizable variable, if the subtree rooted at that descendant contains non-marginalizable variables (i.e., it lies on a path from one of the aforementioned cliques that require re-elimination to a node containing non-marginalizable variables at the leaf side), then it also needs to be re-eliminated.
[in] | bayesTree | The Bayes tree |
[in] | marginalizableKeys | Keys to be marginalized |
Definition at line 67 of file BayesTreeMarginalizationHelper.h.
|
inlinestaticprotected |
Gather all dependent nodes that lie on a path from the root clique to a clique containing a non-marginalizable variable at the leaf side.
[in] | rootClique | The root clique |
[in] | marginalizableKeys | Set of keys to be marginalized |
Definition at line 252 of file BayesTreeMarginalizationHelper.h.
|
inlinestaticprotected |
A helper function for the above gatherDependentCliques().
Definition at line 277 of file BayesTreeMarginalizationHelper.h.
|
inlinestaticprotected |
Gather the cliques containing any of the given keys.
[in] | bayesTree | The Bayes tree |
[in] | keysOfInterest | Set of keys of interest |
Definition at line 135 of file BayesTreeMarginalizationHelper.h.
|
inlinestaticprotected |
Check if the clique depends on any of the given keys.
Definition at line 343 of file BayesTreeMarginalizationHelper.h.
|
inlinestaticprotected |
Check if the clique depends on the given key.
[in] | clique | Clique to check |
[in] | key | Key to check for dependencies |
Definition at line 328 of file BayesTreeMarginalizationHelper.h.
|
inlinestaticprotected |
Check if all variables in the clique are marginalizable.
Note we use a cache map to avoid repeated searches.
Definition at line 158 of file BayesTreeMarginalizationHelper.h.
|
inlinestaticprotected |
Check if all variables in the subtree are marginalizable.
Note we use a cache map to avoid repeated searches.
Definition at line 183 of file BayesTreeMarginalizationHelper.h.
|
inlinestaticprotected |
Check if a clique contains variables that need reelimination due to elimination ordering conflicts.
[in] | clique | The clique to check |
[in] | marginalizableKeys | Set of keys to be marginalized |
Definition at line 215 of file BayesTreeMarginalizationHelper.h.