GTSAM  4.0.2
C++ library for smoothing and mapping (SAM)
Public Types | Public Member Functions | Static Public Member Functions | Protected Attributes | List of all members
gtsam::HybridGaussianISAM Class Reference
Inheritance diagram for gtsam::HybridGaussianISAM:
Inheritance graph
[legend]
Collaboration diagram for gtsam::HybridGaussianISAM:
Collaboration graph
[legend]

Public Types

typedef ISAM< HybridBayesTreeBase
 
typedef HybridGaussianISAM This
 
typedef std::shared_ptr< Thisshared_ptr
 
typedef Base::BayesNetType BayesNetType
 
typedef Base::FactorGraphType FactorGraphType
 
typedef Base::Clique Clique
 
typedef Base::sharedClique sharedClique
 
typedef Base::Cliques Cliques
 
typedef Clique Node
 Synonym for Clique (TODO: remove)
 
typedef sharedClique sharedNode
 Synonym for sharedClique (TODO: remove)
 
typedef HybridBayesTreeClique ::ConditionalType ConditionalType
 
typedef std::shared_ptr< ConditionalType > sharedConditional
 
typedef std::shared_ptr< BayesNetType > sharedBayesNet
 
typedef HybridBayesTreeClique ::FactorType FactorType
 
typedef std::shared_ptr< FactorType > sharedFactor
 
typedef std::shared_ptr< FactorGraphType > sharedFactorGraph
 
typedef ConcurrentMap< Key, sharedCliqueNodes
 
typedef FastVector< sharedCliqueRoots
 

Public Member Functions

void update (const HybridGaussianFactorGraph &newFactors, const std::optional< size_t > &maxNrLeaves={}, const std::optional< Ordering > &ordering={}, const HybridBayesTree::Eliminate &function=HybridBayesTree::EliminationTraitsType::DefaultEliminate)
 Perform update step with new factors. More...
 
Standard Constructors
 HybridGaussianISAM ()
 
 HybridGaussianISAM (const HybridBayesTree &bayesTree)
 
Advanced Interface Interface
void update (const FactorGraphType &newFactors, const Eliminate &function=EliminationTraitsType::DefaultEliminate)
 
void updateInternal (const FactorGraphType &newFactors, Cliques *orphans, const Eliminate &function=EliminationTraitsType::DefaultEliminate)
 
Standard interface
bool equals (const This &other, double tol=1e-9) const
 
GaussianBayesTree choose (const DiscreteValues &assignment) const
 Get the Gaussian Bayes Tree which corresponds to a specific discrete value assignment. More...
 
HybridValues optimize () const
 Optimize the hybrid Bayes tree by computing the MPE for the current set of discrete variables and using it to compute the best continuous update delta. More...
 
VectorValues optimize (const DiscreteValues &assignment) const
 Recursively optimize the BayesTree to produce a vector solution. More...
 
void prune (const size_t maxNumberLeaves)
 Prune the underlying Bayes tree. More...
 
Standard Interface
size_t size () const
 
bool empty () const
 
const Nodesnodes () const
 
sharedClique operator[] (Key j) const
 
const Rootsroots () const
 
const sharedCliqueclique (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.
 

Static Public Member Functions

static Ordering GetOrdering (HybridGaussianFactorGraph &factors, const HybridGaussianFactorGraph &newFactors)
 Helper method to get an ordering given the existing factors and any new factors added. More...
 

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)
 

Member Typedef Documentation

◆ Nodes

Map from keys to Clique

◆ Roots

Root cliques

Constructor & Destructor Documentation

◆ HybridGaussianISAM() [1/2]

gtsam::HybridGaussianISAM::HybridGaussianISAM ( )

Create an empty Bayes Tree

◆ HybridGaussianISAM() [2/2]

gtsam::HybridGaussianISAM::HybridGaussianISAM ( const HybridBayesTree bayesTree)

Copy constructor

Member Function Documentation

◆ addClique()

void gtsam::BayesTree< HybridBayesTreeClique >::addClique ( const sharedClique clique,
const sharedClique parent_clique = sharedClique() 
)
inherited

add a clique (top down)

◆ addFactorsToGraph()

void gtsam::BayesTree< HybridBayesTreeClique >::addFactorsToGraph ( FactorGraph< FactorType > *  graph) const
inherited

Add all cliques in this BayesTree to the specified factor graph

◆ choose()

GaussianBayesTree gtsam::HybridBayesTree::choose ( const DiscreteValues assignment) const
inherited

Get the Gaussian Bayes Tree which corresponds to a specific discrete value assignment.

Parameters
assignmentThe discrete value assignment for the discrete keys.
Returns
GaussianBayesTree

◆ clear()

void gtsam::BayesTree< HybridBayesTreeClique >::clear ( )
inherited

Remove all nodes

◆ clique()

const sharedClique& gtsam::BayesTree< HybridBayesTreeClique >::clique ( Key  j) const
inlineinherited

alternate syntax for matlab: find the clique that contains the variable with Key j

◆ deleteCachedShortcuts()

void gtsam::BayesTree< HybridBayesTreeClique >::deleteCachedShortcuts ( )
inherited

Clear all shortcut caches - use before timing on marginal calculation to avoid residual cache data

◆ dot()

void gtsam::BayesTree< HybridBayesTreeClique >::dot ( std::ostream &  s,
sharedClique  clique,
const KeyFormatter keyFormatter,
int  parentnum = 0 
) const
protectedinherited

private helper method for saving the Tree to a text file in GraphViz format

◆ empty()

bool gtsam::BayesTree< HybridBayesTreeClique >::empty ( ) const
inlineinherited

Check if there are any cliques in the tree

◆ equals() [1/2]

bool gtsam::HybridBayesTree::equals ( const This other,
double  tol = 1e-9 
) const
inherited

Check equality

◆ equals() [2/2]

bool gtsam::BayesTree< HybridBayesTreeClique >::equals ( const This other,
double  tol = 1e-9 
) const
protectedinherited

check equality

◆ fillNodesIndex()

void gtsam::BayesTree< HybridBayesTreeClique >::fillNodesIndex ( const sharedClique subtree)
protectedinherited

Fill the nodes index for a subtree

◆ findParentClique()

Key gtsam::BayesTree< HybridBayesTreeClique >::findParentClique ( const CONTAINER &  parents) const
inherited

Find parent clique of a conditional. It will look at all parents and return the one with the lowest index in the ordering.

◆ getCliqueData() [1/2]

BayesTreeCliqueData gtsam::BayesTree< HybridBayesTreeClique >::getCliqueData ( ) const
inherited

Gather data on all cliques

◆ getCliqueData() [2/2]

void gtsam::BayesTree< HybridBayesTreeClique >::getCliqueData ( sharedClique  clique,
BayesTreeCliqueData stats 
) const
protectedinherited

Gather data on a single clique

◆ GetOrdering()

static Ordering gtsam::HybridGaussianISAM::GetOrdering ( HybridGaussianFactorGraph factors,
const HybridGaussianFactorGraph newFactors 
)
static

Helper method to get an ordering given the existing factors and any new factors added.

Parameters
factorsThe existing factors in the BayesTree.
newFactorsNew factors added during the update step.
Returns
Ordering

◆ insertRoot()

void gtsam::BayesTree< HybridBayesTreeClique >::insertRoot ( const sharedClique subtree)
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.

◆ joint()

BayesTree< HybridBayesTreeClique >::sharedFactorGraph gtsam::BayesTree< HybridBayesTreeClique >::joint ( Key  j1,
Key  j2,
const Eliminate &  function = EliminationTraitsType::DefaultEliminate 
) const
inherited

return joint on two variables Limitation: can only calculate joint if cliques are disjoint or one of them is root

◆ jointBayesNet()

BayesTree< HybridBayesTreeClique >::sharedBayesNet gtsam::BayesTree< HybridBayesTreeClique >::jointBayesNet ( Key  j1,
Key  j2,
const Eliminate &  function = EliminationTraitsType::DefaultEliminate 
) const
inherited

return joint on two variables as a BayesNet Limitation: can only calculate joint if cliques are disjoint or one of them is root

◆ marginalFactor()

BayesTree< HybridBayesTreeClique >::sharedConditional gtsam::BayesTree< HybridBayesTreeClique >::marginalFactor ( Key  j,
const Eliminate &  function = EliminationTraitsType::DefaultEliminate 
) const
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.

◆ nodes()

const Nodes& gtsam::BayesTree< HybridBayesTreeClique >::nodes ( ) const
inlineinherited

Return nodes. Each node is a clique of variables obtained after elimination.

◆ numCachedSeparatorMarginals()

size_t gtsam::BayesTree< HybridBayesTreeClique >::numCachedSeparatorMarginals ( ) const
inherited

Collect number of cliques with cached separator marginals

◆ operator[]()

sharedClique gtsam::BayesTree< HybridBayesTreeClique >::operator[] ( Key  j) const
inlineinherited

Access node by variable

◆ optimize() [1/2]

HybridValues gtsam::HybridBayesTree::optimize ( ) const
inherited

Optimize the hybrid Bayes tree by computing the MPE for the current set of discrete variables and using it to compute the best continuous update delta.

Returns
HybridValues

◆ optimize() [2/2]

VectorValues gtsam::HybridBayesTree::optimize ( const DiscreteValues assignment) const
inherited

Recursively optimize the BayesTree to produce a vector solution.

Parameters
assignmentThe discrete values assignment to select the Gaussian mixtures.
Returns
VectorValues

◆ print()

void gtsam::BayesTree< HybridBayesTreeClique >::print ( const std::string &  s = "",
const KeyFormatter keyFormatter = DefaultKeyFormatter 
) const
inherited

print

◆ prune()

void gtsam::HybridBayesTree::prune ( const size_t  maxNumberLeaves)
inherited

Prune the underlying Bayes tree.

Parameters
maxNumberLeavesThe max number of leaf nodes to keep.

◆ removeClique()

void gtsam::BayesTree< HybridBayesTreeClique >::removeClique ( sharedClique  clique)
protectedinherited

remove a clique: warning, can result in a forest

◆ removePath()

void gtsam::BayesTree< HybridBayesTreeClique >::removePath ( sharedClique  clique,
BayesNetType *  bn,
Cliques orphans 
)
inherited

Remove path from clique to root and return that path as factors plus a list of orphaned subtree roots. Used in removeTop below.

◆ removeSubtree()

BayesTree< HybridBayesTreeClique >::Cliques gtsam::BayesTree< HybridBayesTreeClique >::removeSubtree ( const sharedClique subtree)
inherited

Remove the requested subtree.

◆ removeTop()

void gtsam::BayesTree< HybridBayesTreeClique >::removeTop ( const KeyVector keys,
BayesNetType *  bn,
Cliques orphans 
)
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.

◆ roots()

const Roots& gtsam::BayesTree< HybridBayesTreeClique >::roots ( ) const
inlineinherited

return root cliques

◆ size()

size_t gtsam::BayesTree< HybridBayesTreeClique >::size ( ) const
inherited

number of cliques

◆ update() [1/2]

void gtsam::ISAM< HybridBayesTree >::update ( const FactorGraphType &  newFactors,
const Eliminate &  function = EliminationTraitsType::DefaultEliminate 
)
inherited

update the Bayes tree with a set of new factors, typically derived from measurements

Parameters
newFactorsis a factor graph that contains the new factors
functionan elimination routine

◆ update() [2/2]

void gtsam::HybridGaussianISAM::update ( const HybridGaussianFactorGraph newFactors,
const std::optional< size_t > &  maxNrLeaves = {},
const std::optional< Ordering > &  ordering = {},
const HybridBayesTree::Eliminate &  function = HybridBayesTree::EliminationTraitsType::DefaultEliminate 
)

Perform update step with new factors.

Parameters
newFactorsFactor graph of new factors to add and eliminate.
maxNrLeavesThe maximum number of leaves to keep after pruning.
orderingCustom elimination ordering.
functionElimination function.

◆ updateInternal()

void gtsam::ISAM< HybridBayesTree >::updateInternal ( const FactorGraphType &  newFactors,
Cliques orphans,
const Eliminate &  function = EliminationTraitsType::DefaultEliminate 
)
inherited

updateInternal provides access to list of orphans for drawing purposes

Member Data Documentation

◆ nodes_

Nodes gtsam::BayesTree< HybridBayesTreeClique >::nodes_
protectedinherited

Map from indices to Clique

◆ roots_

Roots gtsam::BayesTree< HybridBayesTreeClique >::roots_
protectedinherited

Root cliques


The documentation for this class was generated from the following file: