gtsam
Loading...
Searching...
No Matches
gtsam::IndexedJunctionTree Class Reference

Detailed Description

A symbolic junction tree whose factors record the original factor indices from a corresponding (non-symbolic) factor graph.

This allows the junction tree structure to be cached and reused for repeated eliminations when the factor graph structure and ordering remain unchanged, avoiding the cost of rebuilding the symbolic structure.

The underlying implementation uses a SymbolicJunctionTree where each factor is an IndexedSymbolicFactor that stores the original factor index. During elimination, these indices are used to retrieve the actual numerical factors from the original factor graph.

Inheritance diagram for gtsam::IndexedJunctionTree:

Public Member Functions

template<typename GRAPH>
 IndexedJunctionTree (const GRAPH &graph, const Ordering &ordering, const std::unordered_set< Key > &fixedKeys={})
 Construct an IndexedJunctionTree from any factor graph, ordering, and optional set of fixed keys to filter out.
 SymbolicJunctionTree (const SymbolicEliminationTree &eliminationTree)
 Build the elimination tree of a factor graph using pre-computed column structure.
Public Member Functions inherited from gtsam::SymbolicJunctionTree
 SymbolicJunctionTree (const SymbolicEliminationTree &eliminationTree)
 Build the elimination tree of a factor graph using pre-computed column structure.
Public Member Functions inherited from gtsam::EliminatableClusterTree< BAYESTREE, GRAPH >
std::pair< std::shared_ptr< BayesTreeType >, std::shared_ptr< FactorGraphType > > eliminate (const Eliminate &function) const
 Eliminate the factors to a Bayes tree and remaining factor graph.
const FastVector< sharedFactor > & remainingFactors () const
 Return the remaining factors that are not pulled into elimination.
Public Member Functions inherited from gtsam::ClusterTree< GRAPH >
 ClusterTree ()
 Default constructor.
void print (const std::string &s="", const KeyFormatter &keyFormatter=DefaultKeyFormatter) const
 Print the cluster tree.
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
 Return the set of roots (one for a tree, multiple for a forest).
const Clusteroperator[] (size_t i) const

Additional Inherited Members

Public Types inherited from gtsam::SymbolicJunctionTree
typedef JunctionTree< SymbolicBayesTree, SymbolicFactorGraphBase
 Base class.
typedef SymbolicJunctionTree This
 This class.
typedef std::shared_ptr< Thisshared_ptr
 Shared pointer to this class.
Public Types inherited from gtsam::JunctionTree< SymbolicBayesTree, SymbolicFactorGraph >
typedef JunctionTree< SymbolicBayesTree, SymbolicFactorGraphThis
 This class.
typedef std::shared_ptr< Thisshared_ptr
 Shared pointer to this class.
typedef EliminatableClusterTree< SymbolicBayesTree, SymbolicFactorGraphBase
 Our base class.
Public Types inherited from gtsam::EliminatableClusterTree< BAYESTREE, GRAPH >
typedef BAYESTREE BayesTreeType
 The BayesTree type produced by elimination.
typedef GRAPH FactorGraphType
 The factor graph type.
typedef EliminatableClusterTree< BAYESTREE, GRAPH > This
 This class.
typedef std::shared_ptr< Thisshared_ptr
 Shared pointer to this class.
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.
Public Types inherited from gtsam::ClusterTree< GRAPH >
typedef GRAPH FactorGraphType
 The factor graph type.
typedef ClusterTree< GRAPH > This
 This class.
typedef std::shared_ptr< Thisshared_ptr
 Shared pointer to this class.
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
 JunctionTree (const EliminationTree< ETREE_BAYESNET, ETREE_GRAPH > &eliminationTree)
 Build the junction tree from an elimination tree.
Protected Member Functions inherited from gtsam::EliminatableClusterTree< BAYESTREE, GRAPH >
 EliminatableClusterTree (const This &other)
 Copy constructor - makes a deep copy of the tree structure, but only pointers to factors are copied, factors are not cloned.
Thisoperator= (const This &other)
 Assignment operator - makes a deep copy of the tree structure, but only pointers to factors are copied, factors are not cloned.
 EliminatableClusterTree ()
 Default constructor to be used in derived classes.
 ClusterTree (const This &other)
 Copy constructor - makes a deep copy of the tree structure, but only pointers to factors are copied, factors are not cloned.
Thisoperator= (const This &other)
 Assignment operator - makes a deep copy of the tree structure, but only pointers to factors are copied, factors are not cloned.
static This FromEliminationTree (const ETREE &eliminationTree)
 Build the junction tree from an elimination tree.
Protected Attributes inherited from gtsam::EliminatableClusterTree< BAYESTREE, GRAPH >
FastVector< sharedFactorremainingFactors_
Protected Attributes inherited from gtsam::ClusterTree< GRAPH >
FastVector< sharedNode > roots_
 concept check

Constructor & Destructor Documentation

◆ IndexedJunctionTree()

template<typename GRAPH>
gtsam::IndexedJunctionTree::IndexedJunctionTree ( const GRAPH & graph,
const Ordering & ordering,
const std::unordered_set< Key > & fixedKeys = {} )
inline

Construct an IndexedJunctionTree from any factor graph, ordering, and optional set of fixed keys to filter out.

Template Parameters
GRAPHFactor graph type (e.g. GaussianFactorGraph, NonlinearFactorGraph)
Parameters
graphThe input factor graph
orderingThe elimination ordering
fixedKeysKeys to filter out (e.g., from hard constraints)

Member Function Documentation

◆ SymbolicJunctionTree()

Build the elimination tree of a factor graph using pre-computed column structure.

Parameters
factorGraphThe factor graph for which to build the elimination tree
structureThe set of factors involving each variable. If this is not precomputed, you can call the Create(const FactorGraph<DERIVEDFACTOR>&) named constructor instead.
Returns
The elimination tree

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