21 #include <boost/shared_ptr.hpp>
26 class EliminationTreeTester;
50 template<
class BAYESNET,
class GRAPH>
64 typedef typename GRAPH::Eliminate Eliminate;
74 sharedFactor eliminate(
const boost::shared_ptr<BayesNetType>& output,
77 void print(
const std::string& str,
const KeyFormatter& keyFormatter)
const;
129 std::pair<boost::shared_ptr<BayesNetType>, boost::shared_ptr<FactorGraphType> >
137 void print(
const std::string& name =
"EliminationTree: ",
138 const KeyFormatter& formatter = DefaultKeyFormatter)
const;
142 bool equals(
const This& other,
double tol = 1e-9)
const;
165 friend class ::EliminationTreeTester;
boost::shared_ptr< This > shared_ptr
Shared pointer to this class.
Definition: EliminationTree.h:55
bool equals(const This &other, double tol=1e-9) const
Test whether the tree is equal to another.
Definition: EliminationTree-inst.h:215
EliminationTree(const This &other)
Copy constructor - makes a deep copy of the tree structure, but only pointers to factors are copied...
Definition: EliminationTree.h:112
const FastVector< sharedNode > & roots() const
Return the set of roots (one for a tree, multiple for a forest)
Definition: EliminationTree.h:151
Definition: EliminationTree.h:66
void print(const std::string &name="EliminationTree: ", const KeyFormatter &formatter=DefaultKeyFormatter) const
Print the tree to cout.
Definition: EliminationTree-inst.h:208
void swap(This &other)
Swap the data of this tree with another one, this operation is very fast.
Definition: EliminationTree-inst.h:284
GRAPH::FactorType FactorType
The type of factors.
Definition: EliminationTree.h:59
Key key
key associated with root
Definition: EliminationTree.h:70
EliminationTree()
Protected default constructor.
Definition: EliminationTree.h:161
GTSAM_CONCEPT_TESTABLE_TYPE(FactorType)
concept check
const FastVector< sharedFactor > & remainingFactors() const
Return the remaining factors that are not pulled into elimination.
Definition: EliminationTree.h:154
Concept check for values that can be used in unit tests.
Factors factors
factors associated with root
Definition: EliminationTree.h:71
The VariableIndex class computes and stores the block column structure of a factor graph...
Definition: VariableIndex.h:42
size_t Key
Integer nonlinear key type.
Definition: types.h:59
GRAPH FactorGraphType
The factor graph type.
Definition: EliminationTree.h:58
BAYESNET BayesNetType
The BayesNet corresponding to FACTOR.
Definition: EliminationTree.h:61
Children children
sub-trees
Definition: EliminationTree.h:72
A Linear Factor Graph is a factor graph where all factors are Gaussian, i.e.
Definition: GaussianFactorGraph.h:65
BayesNetType::ConditionalType ConditionalType
The type of conditionals.
Definition: EliminationTree.h:62
std::pair< boost::shared_ptr< BayesNetType >, boost::shared_ptr< FactorGraphType > > eliminate(Eliminate function) const
Eliminate the factors to a Bayes net and remaining factor graph.
Definition: EliminationTree-inst.h:188
Definition: Ordering.h:30
An elimination tree is a data structure used intermediately during elimination.
Definition: EliminationTree.h:51
This & operator=(const This &other)
Assignment operator - makes a deep copy of the tree structure, but only pointers to factors are copie...
Definition: EliminationTree-inst.h:173
A conditional Gaussian functions as the node in a Bayes network It has a set of parents y...
Definition: GaussianConditional.h:36
boost::shared_ptr< Node > sharedNode
Shared pointer to Node.
Definition: EliminationTree.h:80
A thin wrapper around std::vector that uses boost's pool_allocator.
boost::function< std::string(Key)> KeyFormatter
Typedef for a function to format a key, i.e. to convert it to a string.
Definition: types.h:62
boost::shared_ptr< FactorType > sharedFactor
Shared pointer to a factor.
Definition: EliminationTree.h:60
EliminationTree< BAYESNET, GRAPH > This
This class.
Definition: EliminationTree.h:54
boost::shared_ptr< ConditionalType > sharedConditional
Shared pointer to a conditional.
Definition: EliminationTree.h:63
An abstract virtual base class for JacobianFactor and HessianFactor.
Definition: GaussianFactor.h:35