27 #include <boost/make_shared.hpp> 32 class DiscreteFactorGraph;
34 class DiscreteConditional;
35 class DiscreteBayesNet;
36 class DiscreteEliminationTree;
37 class DiscreteBayesTree;
38 class DiscreteJunctionTree;
41 GTSAM_EXPORT std::pair<boost::shared_ptr<DiscreteConditional>, DecisionTreeFactor::shared_ptr>
54 static std::pair<boost::shared_ptr<ConditionalType>, boost::shared_ptr<FactorType> >
77 typedef boost::shared_ptr<Values> sharedValues;
83 template<
typename ITERATOR>
87 template<
class CONTAINER>
91 template<
class DERIVEDFACTOR>
97 bool equals(
const This& fg,
double tol = 1e-9)
const;
101 template<
class SOURCE>
105 push_back(boost::make_shared<DecisionTreeFactor>(keys, table));
108 template<
class SOURCE>
113 push_back(boost::make_shared<DecisionTreeFactor>(keys, table));
117 template<
class SOURCE>
119 push_back(boost::make_shared<DecisionTreeFactor>(keys, table));
132 void print(
const std::string& s =
"DiscreteFactorGraph",
133 const KeyFormatter& formatter =DefaultKeyFormatter)
const;
139 DiscreteFactor::sharedValues
optimize()
const;
EliminateableFactorGraph< This > BaseEliminateable
Typedef to base elimination class.
Definition: DiscreteFactorGraph.h:71
DiscreteEliminationTree EliminationTreeType
Type of elimination tree.
Definition: DiscreteFactorGraph.h:51
DiscreteBayesNet BayesNetType
Type of Bayes net from sequential elimination.
Definition: DiscreteFactorGraph.h:50
A Discrete Factor Graph is a factor graph where all factors are Discrete, i.e.
Definition: DiscreteFactorGraph.h:65
DiscreteJunctionTree JunctionTreeType
Type of Junction tree.
Definition: DiscreteFactorGraph.h:53
Point3 optimize(const NonlinearFactorGraph &graph, const Values &values, Key landmarkKey)
Optimize for triangulation.
Definition: triangulation.cpp:73
void print(const Matrix &A, const string &s, ostream &stream)
print without optional string, must specify cout yourself
Definition: Matrix.cpp:141
std::pair< DiscreteConditional::shared_ptr, DecisionTreeFactor::shared_ptr > EliminateDiscrete(const DiscreteFactorGraph &factors, const Ordering &frontalKeys)
Main elimination function for DiscreteFactorGraph.
Definition: DiscreteFactorGraph.cpp:105
Discrete Conditional Density Derives from DecisionTreeFactor.
Definition: DiscreteConditional.h:33
EliminateableFactorGraph is a base class for factor graphs that contains elimination algorithms.
Definition: EliminateableFactorGraph.h:56
Template to create a binary predicate.
Definition: Testable.h:110
Definition: DiscreteJunctionTree.h:48
Variable ordering for the elimination algorithm.
Base class for discrete probabilistic factors The most general one is the derived DecisionTreeFactor.
Definition: DiscreteFactor.h:34
A helper that implements the traits interface for GTSAM types.
Definition: Testable.h:150
A thin wrapper around std::set that uses boost's fast_pool_allocator.
An assignment from labels to value index (size_t).
Definition: Assignment.h:34
FactorGraph< DiscreteFactor > Base
Typedef to base factor graph type.
Definition: DiscreteFactorGraph.h:70
DiscreteFactorGraph(ITERATOR firstFactor, ITERATOR lastFactor)
Construct from iterator over factors.
Definition: DiscreteFactorGraph.h:84
boost::function< std::string(Key)> KeyFormatter
Typedef for a function to format a key, i.e. to convert it to a string.
Definition: Key.h:33
KeyVector Indices
A map from keys to values.
Definition: DiscreteFactorGraph.h:75
A discrete probabilistic factor.
Definition: DecisionTreeFactor.h:38
void add(const DiscreteKeys &keys, SOURCE table)
add shared discreteFactor immediately from arguments
Definition: DiscreteFactorGraph.h:118
DiscreteFactorGraph(const CONTAINER &factors)
Construct from container of factors (shared_ptr or plain objects)
Definition: DiscreteFactorGraph.h:88
FastVector< Key > KeyVector
Define collection type once and for all - also used in wrappers.
Definition: Key.h:56
Definition: DiscreteEliminationTree.h:27
A manifold defines a space in which there is a notion of a linear tangent space that can be centered ...
Definition: concepts.h:30
std::pair< Key, size_t > DiscreteKey
Key type for discrete conditionals Includes name and cardinality.
Definition: DiscreteKey.h:34
A Bayes tree representing a Discrete density.
Definition: DiscreteBayesTree.h:49
A factor graph is a bipartite graph with factor nodes connected to variable nodes.
Definition: BayesTree.h:32
A Bayes net made from linear-Discrete densities.
Definition: DiscreteBayesNet.h:29
DiscreteFactor FactorType
Type of factors in factor graph.
Definition: DiscreteFactorGraph.h:47
DiscreteFactorGraph(const FactorGraph< DERIVEDFACTOR > &graph)
Implicit copy/downcast constructor to override explicit template container constructor.
Definition: DiscreteFactorGraph.h:92
DiscreteBayesTree BayesTreeType
Type of Bayes tree.
Definition: DiscreteFactorGraph.h:52
DiscreteFactorGraph()
Default constructor.
Definition: DiscreteFactorGraph.h:80
Variable elimination algorithms for factor graphs.
Global functions in a separate testing namespace.
Definition: chartTesting.h:28
DiscreteFactorGraph FactorGraphType
Type of the factor graph (e.g. DiscreteFactorGraph)
Definition: DiscreteFactorGraph.h:48
DiscreteConditional ConditionalType
Type of conditionals from elimination.
Definition: DiscreteFactorGraph.h:49
DiscreteFactorGraph This
Typedef to this class.
Definition: DiscreteFactorGraph.h:69
Definition: Ordering.h:34
Traits class for eliminateable factor graphs, specifies the types that result from elimination,...
Definition: BayesTreeCliqueBase.h:32
boost::shared_ptr< This > shared_ptr
shared_ptr to this class
Definition: DiscreteFactorGraph.h:72
static std::pair< boost::shared_ptr< ConditionalType >, boost::shared_ptr< FactorType > > DefaultEliminate(const FactorGraphType &factors, const Ordering &keys)
The default dense elimination function.
Definition: DiscreteFactorGraph.h:56
DiscreteKeys is a set of keys that can be assembled using the & operator.
Definition: DiscreteKey.h:37