GTSAM  4.0.2
C++ library for smoothing and mapping (SAM)
Public Types | Public Member Functions | Public Attributes | Protected Attributes | List of all members
gtsam::SymbolicBayesTreeClique Class Reference

A clique in a SymbolicBayesTree. More...

#include <SymbolicBayesTree.h>

Inheritance diagram for gtsam::SymbolicBayesTreeClique:
Inheritance graph
[legend]
Collaboration diagram for gtsam::SymbolicBayesTreeClique:
Collaboration graph
[legend]

Public Types

typedef SymbolicBayesTreeClique This
 
typedef BayesTreeCliqueBase< SymbolicBayesTreeClique, SymbolicFactorGraphBase
 
typedef std::shared_ptr< Thisshared_ptr
 
typedef std::weak_ptr< Thisweak_ptr
 
typedef SymbolicFactorGraph FactorGraphType
 
typedef EliminationTraitsType::BayesNetType BayesNetType
 
typedef BayesNetType::ConditionalType ConditionalType
 
typedef std::shared_ptr< ConditionalTypesharedConditional
 
typedef FactorGraphType::FactorType FactorType
 
typedef FactorGraphType::Eliminate Eliminate
 

Public Member Functions

 SymbolicBayesTreeClique (const std::shared_ptr< SymbolicConditional > &conditional)
 
void setEliminationResult (const typename FactorGraphType::EliminationResult &eliminationResult)
 
Testable
bool equals (const SymbolicBayesTreeClique &other, double tol=1e-9) const
 
virtual void print (const std::string &s="", const KeyFormatter &keyFormatter=DefaultKeyFormatter) const
 
Standard Interface
const sharedConditional & conditional () const
 
bool isRoot () const
 
size_t treeSize () const
 
size_t numCachedSeparatorMarginals () const
 
derived_ptr parent () const
 
int problemSize () const
 

Public Attributes

sharedConditional conditional_
 
derived_weak_ptr parent_
 
FastVector< derived_ptr > children
 
int problemSize_
 
bool is_root
 

Protected Attributes

std::optional< FactorGraphTypecachedSeparatorMarginal_
 This stores the Cached separator marginal P(S)
 
std::mutex cachedSeparatorMarginalMutex_
 

Advanced Interface

BayesNetType shortcut (const derived_ptr &root, Eliminate function=EliminationTraitsType::DefaultEliminate) const
 
FactorGraphType separatorMarginal (Eliminate function=EliminationTraitsType::DefaultEliminate) const
 
FactorGraphType marginal2 (Eliminate function=EliminationTraitsType::DefaultEliminate) const
 
void deleteCachedShortcuts ()
 
const std::optional< FactorGraphType > & cachedSeparatorMarginal () const
 
KeyVector separator_setminus_B (const derived_ptr &B) const
 Calculate set \( S \setminus B \) for shortcut calculations.
 
KeyVector shortcut_indices (const derived_ptr &B, const FactorGraphType &p_Cp_B) const
 
void deleteCachedShortcutsNonRecursive ()
 

Detailed Description

A clique in a SymbolicBayesTree.

Member Function Documentation

◆ conditional()

const sharedConditional& gtsam::BayesTreeCliqueBase< SymbolicBayesTreeClique , SymbolicFactorGraph >::conditional ( ) const
inlineinherited

Access the conditional

◆ deleteCachedShortcuts()

void gtsam::BayesTreeCliqueBase< SymbolicBayesTreeClique , SymbolicFactorGraph >::deleteCachedShortcuts ( )
inherited

This deletes the cached shortcuts of all cliques (subtree) below this clique. This is performed when the bayes tree is modified.

◆ deleteCachedShortcutsNonRecursive()

void gtsam::BayesTreeCliqueBase< SymbolicBayesTreeClique , SymbolicFactorGraph >::deleteCachedShortcutsNonRecursive ( )
inlineprotectedinherited

Non-recursive delete cached shortcuts and marginals - internal only.

◆ equals()

bool gtsam::BayesTreeCliqueBase< SymbolicBayesTreeClique , SymbolicFactorGraph >::equals ( const SymbolicBayesTreeClique other,
double  tol = 1e-9 
) const
inherited

check equality

◆ isRoot()

bool gtsam::BayesTreeCliqueBase< SymbolicBayesTreeClique , SymbolicFactorGraph >::isRoot ( ) const
inlineinherited

is this the root of a Bayes tree ?

◆ marginal2()

BayesTreeCliqueBase< SymbolicBayesTreeClique , SymbolicFactorGraph >::FactorGraphType gtsam::BayesTreeCliqueBase< SymbolicBayesTreeClique , SymbolicFactorGraph >::marginal2 ( Eliminate  function = EliminationTraitsType::DefaultEliminate) const
inherited

return the marginal P(C) of the clique, using marginal caching

◆ numCachedSeparatorMarginals()

size_t gtsam::BayesTreeCliqueBase< SymbolicBayesTreeClique , SymbolicFactorGraph >::numCachedSeparatorMarginals ( ) const
inherited

Collect number of cliques with cached separator marginals

◆ parent()

derived_ptr gtsam::BayesTreeCliqueBase< SymbolicBayesTreeClique , SymbolicFactorGraph >::parent ( ) const
inlineinherited

return a shared_ptr to the parent clique

◆ print()

void gtsam::BayesTreeCliqueBase< SymbolicBayesTreeClique , SymbolicFactorGraph >::print ( const std::string &  s = "",
const KeyFormatter keyFormatter = DefaultKeyFormatter 
) const
virtualinherited

print this node

◆ problemSize()

int gtsam::BayesTreeCliqueBase< SymbolicBayesTreeClique , SymbolicFactorGraph >::problemSize ( ) const
inlineinherited

Problem size (used for parallel traversal)

◆ separatorMarginal()

BayesTreeCliqueBase< SymbolicBayesTreeClique , SymbolicFactorGraph >::FactorGraphType gtsam::BayesTreeCliqueBase< SymbolicBayesTreeClique , SymbolicFactorGraph >::separatorMarginal ( Eliminate  function = EliminationTraitsType::DefaultEliminate) const
inherited

return the marginal P(S) on the separator

◆ setEliminationResult()

void gtsam::BayesTreeCliqueBase< SymbolicBayesTreeClique , SymbolicFactorGraph >::setEliminationResult ( const typename FactorGraphType::EliminationResult eliminationResult)
inherited

Fill the elimination result produced during elimination. Here this just stores the conditional and ignores the remaining factor, but this is overridden in ISAM2Clique to also cache the remaining factor.

◆ shortcut()

BayesTreeCliqueBase< SymbolicBayesTreeClique , SymbolicFactorGraph >::BayesNetType gtsam::BayesTreeCliqueBase< SymbolicBayesTreeClique , SymbolicFactorGraph >::shortcut ( const derived_ptr &  root,
Eliminate  function = EliminationTraitsType::DefaultEliminate 
) const
inherited

return the conditional P(S|Root) on the separator given the root

◆ shortcut_indices()

KeyVector gtsam::BayesTreeCliqueBase< SymbolicBayesTreeClique , SymbolicFactorGraph >::shortcut_indices ( const derived_ptr &  B,
const FactorGraphType p_Cp_B 
) const
protectedinherited

Determine variable indices to keep in recursive separator shortcut calculation The factor graph p_Cp_B has keys from the parent clique Cp and from B. But we only keep the variables not in S union B.

◆ treeSize()

size_t gtsam::BayesTreeCliqueBase< SymbolicBayesTreeClique , SymbolicFactorGraph >::treeSize ( ) const
inherited

The size of subtree rooted at this clique, i.e., nr of Cliques

Member Data Documentation

◆ cachedSeparatorMarginalMutex_

std::mutex gtsam::BayesTreeCliqueBase< SymbolicBayesTreeClique , SymbolicFactorGraph >::cachedSeparatorMarginalMutex_
mutableprotectedinherited

This protects Cached seperator marginal P(S) from concurrent read/writes as many the functions which access it are const (hence the mutable) leading to the false impression that these const functions are thread-safe which is not true due to these mutable values. This is fixed by applying this mutex.


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