#include <BayesTree.h>
Public Types | |
typedef CLIQUE::BayesNetType | BayesNetType |
typedef CLIQUE | Clique |
The clique type, normally BayesTreeClique. More... | |
typedef FastList< sharedClique > | Cliques |
typedef CLIQUE::ConditionalType | ConditionalType |
typedef FactorGraphType::Eliminate | Eliminate |
typedef CLIQUE::EliminationTraitsType | EliminationTraitsType |
typedef CLIQUE::FactorGraphType | FactorGraphType |
typedef CLIQUE::FactorType | FactorType |
typedef Clique | Node |
Synonym for Clique (TODO: remove) More... | |
typedef ConcurrentMap< Key, sharedClique > | Nodes |
typedef FastVector< sharedClique > | Roots |
typedef boost::shared_ptr< BayesNetType > | sharedBayesNet |
typedef boost::shared_ptr< Clique > | sharedClique |
Shared pointer to a clique. More... | |
typedef boost::shared_ptr< ConditionalType > | sharedConditional |
typedef boost::shared_ptr< FactorType > | sharedFactor |
typedef boost::shared_ptr< FactorGraphType > | sharedFactorGraph |
typedef sharedClique | sharedNode |
Synonym for sharedClique (TODO: remove) More... | |
Public Member Functions | |
Standard Interface | |
size_t | size () const |
bool | empty () const |
const Nodes & | nodes () const |
const sharedNode | operator[] (Key j) const |
const Roots & | roots () const |
const sharedClique & | clique (Key j) const |
BayesTreeCliqueData | getCliqueData () const |
size_t | numCachedSeparatorMarginals () const |
sharedConditional | marginalFactor (Key j, const Eliminate &function=EliminationTraitsType::DefaultEliminate) const |
sharedFactorGraph | joint (Key j1, Key j2, const Eliminate &function=EliminationTraitsType::DefaultEliminate) const |
sharedBayesNet | jointBayesNet (Key j1, Key j2, const Eliminate &function=EliminationTraitsType::DefaultEliminate) const |
void | saveGraph (const std::string &s, const KeyFormatter &keyFormatter=DefaultKeyFormatter) const |
Protected Types | |
typedef boost::shared_ptr< This > | shared_ptr |
typedef BayesTree< CLIQUE > | This |
Protected Member Functions | |
This & | operator= (const This &other) |
Standard Constructors | |
BayesTree () | |
BayesTree (const This &other) | |
Protected Attributes | |
Nodes | nodes_ |
Roots | roots_ |
Testable | |
bool | equals (const This &other, double tol=1e-9) const |
void | print (const std::string &s="", const KeyFormatter &keyFormatter=DefaultKeyFormatter) const |
Advanced Interface | |
template<class BAYESRTEE , class GRAPH > | |
class | EliminatableClusterTree |
class | boost::serialization::access |
void | saveGraph (std::ostream &s, sharedClique clique, const KeyFormatter &keyFormatter, int parentnum=0) const |
void | getCliqueData (sharedClique clique, BayesTreeCliqueData *stats) const |
void | removeClique (sharedClique clique) |
void | fillNodesIndex (const sharedClique &subtree) |
template<class CONTAINER > | |
Key | findParentClique (const CONTAINER &parents) const |
void | clear () |
void | deleteCachedShortcuts () |
void | removePath (sharedClique clique, BayesNetType *bn, Cliques *orphans) |
void | removeTop (const KeyVector &keys, BayesNetType *bn, Cliques *orphans) |
Cliques | removeSubtree (const sharedClique &subtree) |
void | insertRoot (const sharedClique &subtree) |
void | addClique (const sharedClique &clique, const sharedClique &parent_clique=sharedClique()) |
void | addFactorsToGraph (FactorGraph< FactorType > *graph) const |
template<class ARCHIVE > | |
void | serialize (ARCHIVE &ar, const unsigned int) |
Definition at line 64 of file BayesTree.h.
typedef CLIQUE::BayesNetType gtsam::BayesTree< CLIQUE >::BayesNetType |
Definition at line 77 of file BayesTree.h.
typedef CLIQUE gtsam::BayesTree< CLIQUE >::Clique |
The clique type, normally BayesTreeClique.
Definition at line 71 of file BayesTree.h.
typedef FastList<sharedClique> gtsam::BayesTree< CLIQUE >::Cliques |
A convenience class for a list of shared cliques
Definition at line 87 of file BayesTree.h.
typedef CLIQUE::ConditionalType gtsam::BayesTree< CLIQUE >::ConditionalType |
Definition at line 75 of file BayesTree.h.
typedef FactorGraphType::Eliminate gtsam::BayesTree< CLIQUE >::Eliminate |
Definition at line 83 of file BayesTree.h.
typedef CLIQUE::EliminationTraitsType gtsam::BayesTree< CLIQUE >::EliminationTraitsType |
Definition at line 84 of file BayesTree.h.
typedef CLIQUE::FactorGraphType gtsam::BayesTree< CLIQUE >::FactorGraphType |
Definition at line 81 of file BayesTree.h.
typedef CLIQUE::FactorType gtsam::BayesTree< CLIQUE >::FactorType |
Definition at line 79 of file BayesTree.h.
typedef Clique gtsam::BayesTree< CLIQUE >::Node |
Synonym for Clique (TODO: remove)
Definition at line 73 of file BayesTree.h.
typedef ConcurrentMap<Key, sharedClique> gtsam::BayesTree< CLIQUE >::Nodes |
Map from keys to Clique
Definition at line 90 of file BayesTree.h.
typedef FastVector<sharedClique> gtsam::BayesTree< CLIQUE >::Roots |
Root cliques
Definition at line 93 of file BayesTree.h.
|
protected |
Definition at line 68 of file BayesTree.h.
typedef boost::shared_ptr<BayesNetType> gtsam::BayesTree< CLIQUE >::sharedBayesNet |
Definition at line 78 of file BayesTree.h.
typedef boost::shared_ptr<Clique> gtsam::BayesTree< CLIQUE >::sharedClique |
Shared pointer to a clique.
Definition at line 72 of file BayesTree.h.
typedef boost::shared_ptr<ConditionalType> gtsam::BayesTree< CLIQUE >::sharedConditional |
Definition at line 76 of file BayesTree.h.
typedef boost::shared_ptr<FactorType> gtsam::BayesTree< CLIQUE >::sharedFactor |
Definition at line 80 of file BayesTree.h.
typedef boost::shared_ptr<FactorGraphType> gtsam::BayesTree< CLIQUE >::sharedFactorGraph |
Definition at line 82 of file BayesTree.h.
typedef sharedClique gtsam::BayesTree< CLIQUE >::sharedNode |
Synonym for sharedClique (TODO: remove)
Definition at line 74 of file BayesTree.h.
|
protected |
Definition at line 67 of file BayesTree.h.
|
inlineprotected |
Create an empty Bayes Tree
Definition at line 107 of file BayesTree.h.
|
protected |
Copy constructor
Definition at line 161 of file BayesTree-inst.h.
void gtsam::BayesTree< CLIQUE >::addClique | ( | const sharedClique & | clique, |
const sharedClique & | parent_clique = sharedClique() |
||
) |
add a clique (top down)
Definition at line 125 of file BayesTree-inst.h.
void gtsam::BayesTree< CLIQUE >::addFactorsToGraph | ( | FactorGraph< FactorType > * | graph | ) | const |
Add all cliques in this BayesTree to the specified factor graph
Definition at line 151 of file BayesTree-inst.h.
void gtsam::BayesTree< CLIQUE >::clear | ( | void | ) |
Remove all nodes
Definition at line 391 of file BayesTree-inst.h.
|
inline |
alternate syntax for matlab: find the clique that contains the variable with Key j
Definition at line 150 of file BayesTree.h.
void gtsam::BayesTree< CLIQUE >::deleteCachedShortcuts | ( | ) |
Clear all shortcut caches - use before timing on marginal calculation to avoid residual cache data
Definition at line 399 of file BayesTree-inst.h.
|
inline |
Check if there are any cliques in the tree
Definition at line 136 of file BayesTree.h.
|
protected |
check equality
Definition at line 213 of file BayesTree-inst.h.
|
protected |
Fill the nodes index for a subtree
Definition at line 229 of file BayesTree-inst.h.
Key gtsam::BayesTree< CLIQUE >::findParentClique | ( | const CONTAINER & | parents | ) | const |
Find parent clique of a conditional. It will look at all parents and return the one with the lowest index in the ordering.
Definition at line 221 of file BayesTree-inst.h.
BayesTreeCliqueData gtsam::BayesTree< CLIQUE >::getCliqueData | ( | ) | const |
Gather data on all cliques
Definition at line 38 of file BayesTree-inst.h.
|
protected |
Gather data on a single clique
Definition at line 46 of file BayesTree-inst.h.
void gtsam::BayesTree< CLIQUE >::insertRoot | ( | const sharedClique & | subtree | ) |
Insert a new subtree with known parent clique. This function does not check that the specified parent is the correct parent. This function updates all of the internal data structures associated with adding a subtree, such as populating the nodes index.
Definition at line 243 of file BayesTree-inst.h.
BayesTree< CLIQUE >::sharedFactorGraph gtsam::BayesTree< CLIQUE >::joint | ( | Key | j1, |
Key | j2, | ||
const Eliminate & | function = EliminationTraitsType::DefaultEliminate |
||
) | const |
return joint on two variables Limitation: can only calculate joint if cliques are disjoint or one of them is root
Definition at line 276 of file BayesTree-inst.h.
BayesTree< CLIQUE >::sharedBayesNet gtsam::BayesTree< CLIQUE >::jointBayesNet | ( | Key | j1, |
Key | j2, | ||
const Eliminate & | function = EliminationTraitsType::DefaultEliminate |
||
) | const |
return joint on two variables as a BayesNet Limitation: can only calculate joint if cliques are disjoint or one of them is root
Definition at line 285 of file BayesTree-inst.h.
BayesTree< CLIQUE >::sharedConditional gtsam::BayesTree< CLIQUE >::marginalFactor | ( | Key | j, |
const Eliminate & | function = EliminationTraitsType::DefaultEliminate |
||
) | const |
Return marginal on any variable. Note that this actually returns a conditional, for which a solution may be directly obtained by calling .solve() on the returned object. Alternatively, it may be directly used as its factor base class. For example, for Gaussian systems, this returns a GaussianConditional, which inherits from JacobianFactor and GaussianFactor.
Definition at line 253 of file BayesTree-inst.h.
|
inline |
return nodes
Definition at line 141 of file BayesTree.h.
size_t gtsam::BayesTree< CLIQUE >::numCachedSeparatorMarginals | ( | ) | const |
Collect number of cliques with cached separator marginals
Definition at line 58 of file BayesTree-inst.h.
|
protected |
Assignment operator
Definition at line 182 of file BayesTree-inst.h.
|
inline |
Access node by variable
Definition at line 144 of file BayesTree.h.
void gtsam::BayesTree< CLIQUE >::print | ( | const std::string & | s = "" , |
const KeyFormatter & | keyFormatter = DefaultKeyFormatter |
||
) | const |
Definition at line 195 of file BayesTree-inst.h.
|
protected |
remove a clique: warning, can result in a forest
Definition at line 407 of file BayesTree-inst.h.
void gtsam::BayesTree< CLIQUE >::removePath | ( | sharedClique | clique, |
BayesNetType * | bn, | ||
Cliques * | orphans | ||
) |
Remove path from clique to root and return that path as factors plus a list of orphaned subtree roots. Used in removeTop below.
Definition at line 431 of file BayesTree-inst.h.
BayesTree< CLIQUE >::Cliques gtsam::BayesTree< CLIQUE >::removeSubtree | ( | const sharedClique & | subtree | ) |
Remove the requested subtree.
Definition at line 479 of file BayesTree-inst.h.
void gtsam::BayesTree< CLIQUE >::removeTop | ( | const KeyVector & | keys, |
BayesNetType * | bn, | ||
Cliques * | orphans | ||
) |
Given a list of indices, turn "contaminated" part of the tree back into a factor graph. Factors and orphans are added to the in/out arguments.
Definition at line 458 of file BayesTree-inst.h.
|
inline |
return root cliques
Definition at line 147 of file BayesTree.h.
void gtsam::BayesTree< CLIQUE >::saveGraph | ( | const std::string & | s, |
const KeyFormatter & | keyFormatter = DefaultKeyFormatter |
||
) | const |
Read only with side effectssaves the Tree to a text file in GraphViz format
Definition at line 67 of file BayesTree-inst.h.
|
protected |
private helper method for saving the Tree to a text file in GraphViz format
Definition at line 79 of file BayesTree-inst.h.
|
inlineprivate |
Definition at line 256 of file BayesTree.h.
size_t gtsam::BayesTree< CLIQUE >::size | ( | ) | const |
number of cliques
Definition at line 116 of file BayesTree-inst.h.
|
friend |
Serialization function
Definition at line 254 of file BayesTree.h.
|
friend |
Definition at line 250 of file BayesTree.h.
|
protected |
Map from indices to Clique
Definition at line 98 of file BayesTree.h.
|
protected |
Root cliques
Definition at line 101 of file BayesTree.h.