27#include <boost/make_shared.hpp>
32class DiscreteFactorGraph;
34class DiscreteConditional;
35class DiscreteBayesNet;
36class DiscreteEliminationTree;
37class DiscreteBayesTree;
38class DiscreteJunctionTree;
41GTSAM_EXPORT std::pair<boost::shared_ptr<DiscreteConditional>, DecisionTreeFactor::shared_ptr>
55 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>
100 bool equals(
const This& fg,
double tol = 1e-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",
137 const KeyFormatter& formatter = DefaultKeyFormatter)
const override;
143 DiscreteFactor::sharedValues
optimize()
const;
A thin wrapper around std::set that uses boost's fast_pool_allocator.
Variable ordering for the elimination algorithm.
Variable elimination algorithms for factor graphs.
Global functions in a separate testing namespace.
Definition: chartTesting.h:28
std::pair< DiscreteConditional::shared_ptr, DecisionTreeFactor::shared_ptr > EliminateDiscrete(const DiscreteFactorGraph &factors, const Ordering &frontalKeys)
Main elimination function for DiscreteFactorGraph.
Definition: DiscreteFactorGraph.cpp:105
FastVector< Key > KeyVector
Define collection type once and for all - also used in wrappers.
Definition: Key.h:86
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:155
std::pair< Key, size_t > DiscreteKey
Key type for discrete conditionals Includes name and cardinality.
Definition: DiscreteKey.h:34
std::function< std::string(Key)> KeyFormatter
Typedef for a function to format a key, i.e. to convert it to a string.
Definition: Key.h:35
A manifold defines a space in which there is a notion of a linear tangent space that can be centered ...
Definition: concepts.h:30
Template to create a binary predicate.
Definition: Testable.h:111
A helper that implements the traits interface for GTSAM types.
Definition: Testable.h:151
An assignment from labels to value index (size_t).
Definition: Assignment.h:34
A discrete probabilistic factor.
Definition: DecisionTreeFactor.h:38
A Bayes net made from linear-Discrete densities.
Definition: DiscreteBayesNet.h:31
A Bayes tree representing a Discrete density.
Definition: DiscreteBayesTree.h:67
Discrete Conditional Density Derives from DecisionTreeFactor.
Definition: DiscreteConditional.h:36
Definition: DiscreteEliminationTree.h:29
Base class for discrete probabilistic factors The most general one is the derived DecisionTreeFactor.
Definition: DiscreteFactor.h:34
DiscreteFactorGraph FactorGraphType
Type of the factor graph (e.g. DiscreteFactorGraph)
Definition: DiscreteFactorGraph.h:48
DiscreteJunctionTree JunctionTreeType
Type of Junction tree.
Definition: DiscreteFactorGraph.h:53
DiscreteFactor FactorType
Type of factors in factor graph.
Definition: DiscreteFactorGraph.h:47
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
DiscreteBayesTree BayesTreeType
Type of Bayes tree.
Definition: DiscreteFactorGraph.h:52
DiscreteBayesNet BayesNetType
Type of Bayes net from sequential elimination.
Definition: DiscreteFactorGraph.h:50
DiscreteConditional ConditionalType
Type of conditionals from elimination.
Definition: DiscreteFactorGraph.h:49
DiscreteEliminationTree EliminationTreeType
Type of elimination tree.
Definition: DiscreteFactorGraph.h:51
A Discrete Factor Graph is a factor graph where all factors are Discrete, i.e.
Definition: DiscreteFactorGraph.h:66
DiscreteFactorGraph(const CONTAINER &factors)
Construct from container of factors (shared_ptr or plain objects)
Definition: DiscreteFactorGraph.h:88
KeyVector Indices
A map from keys to values.
Definition: DiscreteFactorGraph.h:75
boost::shared_ptr< This > shared_ptr
shared_ptr to this class
Definition: DiscreteFactorGraph.h:72
DiscreteFactorGraph This
Typedef to this class.
Definition: DiscreteFactorGraph.h:69
FactorGraph< DiscreteFactor > Base
Typedef to base factor graph type.
Definition: DiscreteFactorGraph.h:70
void add(const DiscreteKeys &keys, SOURCE table)
add shared discreteFactor immediately from arguments
Definition: DiscreteFactorGraph.h:121
DiscreteFactorGraph()
Default constructor.
Definition: DiscreteFactorGraph.h:80
EliminateableFactorGraph< This > BaseEliminateable
Typedef to base elimination class.
Definition: DiscreteFactorGraph.h:71
DiscreteFactorGraph(const FactorGraph< DERIVEDFACTOR > &graph)
Implicit copy/downcast constructor to override explicit template container constructor.
Definition: DiscreteFactorGraph.h:92
DiscreteFactorGraph(ITERATOR firstFactor, ITERATOR lastFactor)
Construct from iterator over factors.
Definition: DiscreteFactorGraph.h:84
virtual ~DiscreteFactorGraph()
Destructor.
Definition: DiscreteFactorGraph.h:95
Definition: DiscreteJunctionTree.h:49
DiscreteKeys is a set of keys that can be assembled using the & operator.
Definition: DiscreteKey.h:37
A factor graph is a bipartite graph with factor nodes connected to variable nodes.
Definition: FactorGraph.h:93
Traits class for eliminateable factor graphs, specifies the types that result from elimination,...
Definition: EliminateableFactorGraph.h:36
EliminateableFactorGraph is a base class for factor graphs that contains elimination algorithms.
Definition: EliminateableFactorGraph.h:57
Definition: Ordering.h:34