gtsam 4.2
gtsam
Loading...
Searching...
No Matches
gtsam::DiscreteBayesTreeClique Class Reference

Detailed Description

A clique in a DiscreteBayesTree.

Inheritance diagram for gtsam::DiscreteBayesTreeClique:

Public Member Functions

 DiscreteBayesTreeClique (const boost::shared_ptr< DiscreteConditional > &conditional)
void printSignature (const std::string &s="Clique: ", const KeyFormatter &formatter=DefaultKeyFormatter) const
 print index signature only
double evaluate (const DiscreteValues &values) const
double operator() (const DiscreteValues &values) const
Public Member Functions inherited from gtsam::BayesTreeCliqueBase< DiscreteBayesTreeClique, DiscreteFactorGraph >
void setEliminationResult (const typename FactorGraphType::EliminationResult &eliminationResult)
 Fill the elimination result produced during elimination.
bool equals (const DiscreteBayesTreeClique &other, double tol=1e-9) const
 check equality
virtual void print (const std::string &s="", const KeyFormatter &keyFormatter=DefaultKeyFormatter) const
 print this node
const sharedConditional & conditional () const
 Access the conditional.
bool isRoot () const
 Return true if this clique is the root of a Bayes tree.
size_t nrChildren () const
 Return the number of children.
const derived_ptr operator[] (size_t i) const
 Return the child at index i.
size_t treeSize () const
 The size of subtree rooted at this clique, i.e., nr of Cliques.
size_t numCachedSeparatorMarginals () const
 Collect number of cliques with cached separator marginals.
derived_ptr parent () const
 return a shared_ptr to the parent clique
int problemSize () const
 Problem size (used for parallel traversal).
BayesNetType shortcut (const derived_ptr &root, Eliminate function=EliminationTraitsType::DefaultEliminate) const
 return the conditional P(S|Root) on the separator given the root
FactorGraphType separatorMarginal (Eliminate function=EliminationTraitsType::DefaultEliminate) const
 return the marginal P(S) on the separator
FactorGraphType marginal2 (Eliminate function=EliminationTraitsType::DefaultEliminate) const
 return the marginal P(C) of the clique, using marginal caching
void deleteCachedShortcuts ()
 This deletes the cached shortcuts of all cliques (subtree) below this clique.
const boost::optional< FactorGraphType > & cachedSeparatorMarginal () const

Public Types

typedef DiscreteBayesTreeClique This
typedef BayesTreeCliqueBase< DiscreteBayesTreeClique, DiscreteFactorGraphBase
typedef boost::shared_ptr< This > shared_ptr
typedef boost::weak_ptr< This > weak_ptr
Public Types inherited from gtsam::BayesTreeCliqueBase< DiscreteBayesTreeClique, DiscreteFactorGraph >
typedef DiscreteFactorGraph FactorGraphType
typedef EliminationTraitsType::BayesNetType BayesNetType
typedef BayesNetType::ConditionalType ConditionalType
typedef boost::shared_ptr< ConditionalType > sharedConditional
typedef FactorGraphType::FactorType FactorType
typedef FactorGraphType::Eliminate Eliminate

Additional Inherited Members

Public Attributes inherited from gtsam::BayesTreeCliqueBase< DiscreteBayesTreeClique, DiscreteFactorGraph >
sharedConditional conditional_
derived_weak_ptr parent_
FastVector< derived_ptr > children
int problemSize_
bool is_root
Protected Member Functions inherited from gtsam::BayesTreeCliqueBase< DiscreteBayesTreeClique, DiscreteFactorGraph >
 BayesTreeCliqueBase ()
 Default constructor.
 BayesTreeCliqueBase (const sharedConditional &conditional)
 Construct from a conditional, leaving parent and child pointers uninitialized.
 BayesTreeCliqueBase (const BayesTreeCliqueBase &c)
 Shallow copy constructor.
BayesTreeCliqueBaseoperator= (const BayesTreeCliqueBase &c)
 Shallow copy assignment constructor.
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
 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.
void deleteCachedShortcutsNonRecursive ()
 Non-recursive delete cached shortcuts and marginals - internal only.
Protected Attributes inherited from gtsam::BayesTreeCliqueBase< DiscreteBayesTreeClique, DiscreteFactorGraph >
boost::optional< FactorGraphType > cachedSeparatorMarginal_
 This stores the Cached separator marginal P(S).
std::mutex cachedSeparatorMarginalMutex_
 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.

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