27 #include <boost/make_shared.hpp> 32 class DiscreteFactorGraph;
34 class DiscreteConditional;
35 class DiscreteBayesNet;
36 class DiscreteEliminationTree;
37 class DiscreteBayesTree;
38 class DiscreteJunctionTree;
54 static std::pair<boost::shared_ptr<ConditionalType>, boost::shared_ptr<FactorType> >
83 template<
typename ITERATOR>
87 template<
class CONTAINER>
91 template<
class DERIVEDFACTOR>
100 bool equals(
const This& fg,
double tol = 1
e-9)
const;
104 template<
class SOURCE>
108 push_back(boost::make_shared<DecisionTreeFactor>(keys, table));
111 template<
class SOURCE>
116 push_back(boost::make_shared<DecisionTreeFactor>(keys, table));
120 template<
class SOURCE>
122 push_back(boost::make_shared<DecisionTreeFactor>(keys, table));
136 const std::string&
s =
"DiscreteFactorGraph",
void print(const Matrix &A, const string &s, ostream &stream)
DiscreteFactorGraph(ITERATOR firstFactor, ITERATOR lastFactor)
void add(const DiscreteKey &j, SOURCE table)
DiscreteEliminationTree EliminationTreeType
Type of elimination tree.
Variable elimination algorithms for factor graphs.
EliminateableFactorGraph< This > BaseEliminateable
Typedef to base elimination class.
static std::pair< boost::shared_ptr< ConditionalType >, boost::shared_ptr< FactorType > > DefaultEliminate(const FactorGraphType &factors, const Ordering &keys)
The default dense elimination function.
DiscreteFactor FactorType
Type of factors in factor graph.
GaussianFactorGraph factors(list_of(factor1)(factor2)(factor3))
DiscreteJunctionTree JunctionTreeType
NonlinearFactorGraph graph
boost::shared_ptr< This > shared_ptr
shared_ptr to this class
static const KeyFormatter DefaultKeyFormatter
virtual ~DiscreteFactorGraph()
Destructor.
const KeyFormatter & formatter
void add(const DiscreteKey &j1, const DiscreteKey &j2, SOURCE table)
DiscreteFactorGraph This
Typedef to this class.
DiscreteBayesNet BayesNetType
Type of Bayes net from sequential elimination.
FastVector< Key > KeyVector
Define collection type once and for all - also used in wrappers.
Point3 optimize(const NonlinearFactorGraph &graph, const Values &values, Key landmarkKey)
DiscreteFactorGraph FactorGraphType
Type of the factor graph (e.g. DiscreteFactorGraph)
std::pair< Key, size_t > DiscreteKey
std::function< std::string(Key)> KeyFormatter
Typedef for a function to format a key, i.e. to convert it to a string.
Array< double, 1, 3 > e(1./3., 0.5, 2.)
std::pair< DiscreteConditional::shared_ptr, DecisionTreeFactor::shared_ptr > EliminateDiscrete(const DiscreteFactorGraph &factors, const Ordering &frontalKeys)
DiscreteFactorGraph(const FactorGraph< DERIVEDFACTOR > &graph)
FactorGraph< DiscreteFactor > Base
Typedef to base factor graph type.
boost::shared_ptr< Values > sharedValues
DiscreteConditional ConditionalType
Type of conditionals from elimination.
void add(const DiscreteKeys &keys, SOURCE table)
boost::shared_ptr< DecisionTreeFactor > shared_ptr
DiscreteFactorGraph(const CONTAINER &factors)
A thin wrapper around std::set that uses boost's fast_pool_allocator.
boost::shared_ptr< Values > sharedValues
void product(const MatrixType &m)
DiscreteBayesTree BayesTreeType
Type of Bayes tree.
DiscreteKeys is a set of keys that can be assembled using the & operator.