GTSAM  4.0.2
C++ library for smoothing and mapping (SAM)
Public Types | Protected Attributes | List of all members
gtsam::JunctionTree< BAYESTREE, GRAPH > Class Template Reference

#include <JunctionTree.h>

Inheritance diagram for gtsam::JunctionTree< BAYESTREE, GRAPH >:
Inheritance graph
[legend]
Collaboration diagram for gtsam::JunctionTree< BAYESTREE, GRAPH >:
Collaboration graph
[legend]

Public Types

typedef JunctionTree< BAYESTREE, GRAPH > This
 This class.
 
typedef std::shared_ptr< Thisshared_ptr
 Shared pointer to this class.
 
typedef EliminatableClusterTree< BAYESTREE, GRAPH > Base
 Our base class.
 
typedef BAYESTREE BayesTreeType
 The BayesTree type produced by elimination.
 
typedef GRAPH FactorGraphType
 The factor graph type.
 
typedef BAYESTREE::ConditionalType ConditionalType
 The type of conditionals.
 
typedef std::shared_ptr< ConditionalTypesharedConditional
 Shared pointer to a conditional.
 
typedef GRAPH::Eliminate Eliminate
 Typedef for an eliminate subroutine.
 
typedef GRAPH::FactorType FactorType
 The type of factors.
 
typedef std::shared_ptr< FactorTypesharedFactor
 Shared pointer to a factor.
 
typedef std::shared_ptr< ClustersharedCluster
 Shared pointer to Cluster.
 
typedef Cluster Node
 
typedef sharedCluster sharedNode
 

Protected Attributes

FastVector< sharedFactorremainingFactors_
 
FastVector< sharedNode > roots_
 

Testable

void print (const std::string &s="", const KeyFormatter &keyFormatter=DefaultKeyFormatter) const
 

Advanced Interface

void addRoot (const std::shared_ptr< Cluster > &cluster)
 
void addChildrenAsRoots (const std::shared_ptr< Cluster > &cluster)
 
size_t nrRoots () const
 
const FastVector< sharedNode > & roots () const
 
const Clusteroperator[] (size_t i) const
 

Standard Interface

std::pair< std::shared_ptr< BayesTreeType >, std::shared_ptr< FactorGraphType > > eliminate (const Eliminate &function) const
 

Advanced Interface

const FastVector< sharedFactor > & remainingFactors () const
 

Standard Constructors

template<class ETREE >
static This FromEliminationTree (const ETREE &eliminationTree)
 
template<class ETREE_BAYESNET , class ETREE_GRAPH >
 JunctionTree (const EliminationTree< ETREE_BAYESNET, ETREE_GRAPH > &eliminationTree)
 

Detailed Description

template<class BAYESTREE, class GRAPH>
class gtsam::JunctionTree< BAYESTREE, GRAPH >

A JunctionTree is a cluster tree, a set of variable clusters with factors, arranged in a tree, with the additional property that it represents the clique tree associated with a Bayes Net.

In GTSAM a junction tree is an intermediate data structure in multifrontal variable elimination. Each node is a cluster of factors, along with a clique of variables that are eliminated all at once. In detail, every node k represents a clique (maximal fully connected subset) of an associated chordal graph, such as a chordal Bayes net resulting from elimination.

The difference with the BayesTree is that a JunctionTree stores factors, whereas a BayesTree stores conditionals, that are the product of eliminating the factors in the corresponding JunctionTree cliques.

The tree structure and elimination method are exactly analagous to the EliminationTree, except that in the JunctionTree, at each node multiple variables are eliminated at a time.

Constructor & Destructor Documentation

◆ JunctionTree()

template<class BAYESTREE , class GRAPH >
template<class ETREE_BAYESNET , class ETREE_GRAPH >
gtsam::JunctionTree< BAYESTREE, GRAPH >::JunctionTree ( const EliminationTree< ETREE_BAYESNET, ETREE_GRAPH > &  eliminationTree)
protected

Build the junction tree from an elimination tree.

Member Function Documentation

◆ eliminate()

template<class BAYESTREE , class GRAPH >
std::pair< std::shared_ptr< BAYESTREE >, std::shared_ptr< GRAPH > > gtsam::EliminatableClusterTree< BAYESTREE, GRAPH >::eliminate ( const Eliminate function) const
inherited

Eliminate the factors to a Bayes tree and remaining factor graph

Parameters
functionThe function to use to eliminate, see the namespace functions in GaussianFactorGraph.h
Returns
The Bayes tree and factor graph resulting from elimination

◆ FromEliminationTree()

template<class BAYESTREE, class GRAPH>
template<class ETREE >
static This gtsam::JunctionTree< BAYESTREE, GRAPH >::FromEliminationTree ( const ETREE &  eliminationTree)
inlinestaticprotected

Build the junction tree from an elimination tree.

◆ print()

template<class GRAPH >
void gtsam::ClusterTree< GRAPH >::print ( const std::string &  s = "",
const KeyFormatter keyFormatter = DefaultKeyFormatter 
) const
inherited

Print the cluster tree

◆ remainingFactors()

template<class BAYESTREE, class GRAPH>
const FastVector<sharedFactor>& gtsam::EliminatableClusterTree< BAYESTREE, GRAPH >::remainingFactors ( ) const
inlineinherited

Return the remaining factors that are not pulled into elimination

◆ roots()

template<class GRAPH>
const FastVector<sharedNode>& gtsam::ClusterTree< GRAPH >::roots ( ) const
inlineinherited

Return the set of roots (one for a tree, multiple for a forest)

Member Data Documentation

◆ roots_

template<class GRAPH>
FastVector<sharedNode> gtsam::ClusterTree< GRAPH >::roots_
protectedinherited

concept check


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