GTSAM
4.0.2
C++ library for smoothing and mapping (SAM)
|
A Bayes tree representing a Discrete distribution. More...
#include <DiscreteBayesTree.h>
Public Types | |
typedef DiscreteBayesTree | This |
typedef std::shared_ptr< This > | shared_ptr |
typedef DiscreteBayesTreeClique | Clique |
The clique type, normally BayesTreeClique. | |
typedef std::shared_ptr< Clique > | sharedClique |
Shared pointer to a clique. | |
typedef Clique | Node |
Synonym for Clique (TODO: remove) | |
typedef sharedClique | sharedNode |
Synonym for sharedClique (TODO: remove) | |
typedef DiscreteBayesTreeClique ::ConditionalType | ConditionalType |
typedef std::shared_ptr< ConditionalType > | sharedConditional |
typedef DiscreteBayesTreeClique ::BayesNetType | BayesNetType |
typedef std::shared_ptr< BayesNetType > | sharedBayesNet |
typedef DiscreteBayesTreeClique ::FactorType | FactorType |
typedef std::shared_ptr< FactorType > | sharedFactor |
typedef DiscreteBayesTreeClique ::FactorGraphType | FactorGraphType |
typedef std::shared_ptr< FactorGraphType > | sharedFactorGraph |
typedef FactorGraphType::Eliminate | Eliminate |
typedef DiscreteBayesTreeClique ::EliminationTraitsType | EliminationTraitsType |
typedef FastList< sharedClique > | Cliques |
typedef ConcurrentMap< Key, sharedClique > | Nodes |
typedef FastVector< sharedClique > | Roots |
Public Member Functions | |
Standard interface | |
DiscreteBayesTree () | |
bool | equals (const This &other, double tol=1e-9) const |
double | evaluate (const DiscreteValues &values) const |
double | operator() (const DiscreteValues &values) const |
Wrapper support | |
std::string | markdown (const KeyFormatter &keyFormatter=DefaultKeyFormatter, const DiscreteFactor::Names &names={}) const |
Render as markdown tables. | |
std::string | html (const KeyFormatter &keyFormatter=DefaultKeyFormatter, const DiscreteFactor::Names &names={}) const |
Render as html tables. | |
Standard Interface | |
size_t | size () const |
bool | empty () const |
const Nodes & | nodes () const |
sharedClique | 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 |
Graph Display | |
void | dot (std::ostream &os, const KeyFormatter &keyFormatter=DefaultKeyFormatter) const |
Output to graphviz format, stream version. | |
std::string | dot (const KeyFormatter &keyFormatter=DefaultKeyFormatter) const |
Output to graphviz format string. | |
void | saveGraph (const std::string &filename, const KeyFormatter &keyFormatter=DefaultKeyFormatter) const |
output to file with graphviz format. | |
Protected Attributes | |
Nodes | nodes_ |
Roots | roots_ |
Testable | |
void | print (const std::string &s="", const KeyFormatter &keyFormatter=DefaultKeyFormatter) const |
bool | equals (const This &other, double tol=1e-9) const |
Advanced Interface | |
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 |
void | getCliqueData (sharedClique clique, BayesTreeCliqueData *stats) const |
void | dot (std::ostream &s, sharedClique clique, const KeyFormatter &keyFormatter, int parentnum=0) const |
void | removeClique (sharedClique clique) |
void | fillNodesIndex (const sharedClique &subtree) |
A Bayes tree representing a Discrete distribution.
|
inherited |
A convenience class for a list of shared cliques
|
inherited |
Map from keys to Clique
|
inherited |
Root cliques
|
inline |
Default constructor, creates an empty Bayes tree
|
inherited |
add a clique (top down)
|
inherited |
Add all cliques in this BayesTree to the specified factor graph
|
inherited |
Remove all nodes
|
inlineinherited |
alternate syntax for matlab: find the clique that contains the variable with Key j
|
inherited |
Clear all shortcut caches - use before timing on marginal calculation to avoid residual cache data
|
protectedinherited |
private helper method for saving the Tree to a text file in GraphViz format
|
inlineinherited |
Check if there are any cliques in the tree
bool gtsam::DiscreteBayesTree::equals | ( | const This & | other, |
double | tol = 1e-9 |
||
) | const |
Check equality
|
protectedinherited |
check equality
|
protectedinherited |
Fill the nodes index for a subtree
|
inherited |
Find parent clique of a conditional. It will look at all parents and return the one with the lowest index in the ordering.
|
inherited |
Gather data on all cliques
|
protectedinherited |
Gather data on a single clique
|
inherited |
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.
|
inherited |
return joint on two variables Limitation: can only calculate joint if cliques are disjoint or one of them is root
|
inherited |
return joint on two variables as a BayesNet Limitation: can only calculate joint if cliques are disjoint or one of them is root
|
inherited |
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.
|
inlineinherited |
Return nodes. Each node is a clique of variables obtained after elimination.
|
inherited |
Collect number of cliques with cached separator marginals
|
inlineinherited |
Access node by variable
|
inherited |
|
protectedinherited |
remove a clique: warning, can result in a forest
|
inherited |
Remove path from clique to root and return that path as factors plus a list of orphaned subtree roots. Used in removeTop below.
|
inherited |
Remove the requested subtree.
|
inherited |
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.
|
inlineinherited |
return root cliques
|
inherited |
number of cliques
|
protectedinherited |
Map from indices to Clique
|
protectedinherited |
Root cliques