35 class DiscreteFactorGraph;
36 class DiscreteConditional;
37 class DiscreteBayesNet;
38 class DiscreteEliminationTree;
39 class DiscreteBayesTree;
40 class DiscreteJunctionTree;
50 GTSAM_EXPORT std::pair<std::shared_ptr<DiscreteConditional>, DecisionTreeFactor::shared_ptr>
63 static std::pair<std::shared_ptr<ConditionalType>,
65 std::shared_ptr<FactorType> >
71 const FactorGraphType& graph,
72 std::optional<std::reference_wrapper<const VariableIndex>> variableIndex) {
101 template <
typename ITERATOR>
103 :
Base(firstFactor, lastFactor) {}
106 template <
class CONTAINER>
111 template <
class DERIVEDFACTOR>
117 bool equals(
const This& fg,
double tol = 1e-9)
const;
122 template <
typename... Args>
123 void add(Args&&... args) {
124 emplace_shared<DecisionTreeFactor>(std::forward<Args>(args)...);
144 const std::string& s =
"DiscreteFactorGraph",
145 const KeyFormatter& formatter = DefaultKeyFormatter)
const override;
230 std::pair<DiscreteConditional::shared_ptr, DecisionTreeFactor::shared_ptr>
DiscreteFactorGraph(ITERATOR firstFactor, ITERATOR lastFactor)
Definition: DiscreteFactorGraph.h:102
std::string markdown(const DiscreteValues &values, const KeyFormatter &keyFormatter=DefaultKeyFormatter, const DiscreteValues::Names &names={})
Free version of markdown.
DiscreteEliminationTree EliminationTreeType
Type of elimination tree.
Definition: DiscreteFactorGraph.h:60
Variable elimination algorithms for factor graphs.
A Bayes tree representing a Discrete distribution.
Definition: DiscreteBayesTree.h:68
Definition: Testable.h:152
Definition: DecisionTreeFactor.h:44
Definition: BayesTree.h:34
Variable ordering for the elimination algorithm.
DiscreteFactor FactorType
Type of factors in factor graph.
Definition: DiscreteFactorGraph.h:56
Definition: Ordering.h:37
DiscreteJunctionTree JunctionTreeType
Definition: DiscreteFactorGraph.h:62
void add(Args &&... args)
Definition: DiscreteFactorGraph.h:123
static Ordering Colamd(const FACTOR_GRAPH &graph)
Definition: Ordering.h:100
DiscreteBayesNet BayesNetType
Type of Bayes net from sequential elimination.
Definition: DiscreteFactorGraph.h:59
Definition: Testable.h:112
Definition: DiscreteJunctionTree.h:51
std::shared_ptr< This > shared_ptr
shared_ptr to This
Definition: DiscreteFactorGraph.h:91
GTSAM_EXPORT Point3 optimize(const NonlinearFactorGraph &graph, const Values &values, Key landmarkKey)
DiscreteFactorGraph FactorGraphType
Type of the factor graph (e.g. DiscreteFactorGraph)
Definition: DiscreteFactorGraph.h:57
static std::pair< std::shared_ptr< ConditionalType >, std::shared_ptr< FactorType > > DefaultEliminate(const FactorGraphType &factors, const Ordering &keys)
The default dense elimination function.
Definition: DiscreteFactorGraph.h:66
GTSAM_EXPORT void print(const Matrix &A, const std::string &s, std::ostream &stream)
static Ordering DefaultOrderingFunc(const FactorGraphType &graph, std::optional< std::reference_wrapper< const VariableIndex >> variableIndex)
The default ordering generation function.
Definition: DiscreteFactorGraph.h:70
DiscreteFactorGraph()
map from keys to values
Definition: DiscreteFactorGraph.h:98
Definition: DiscreteBayesNet.h:38
Definition: DiscreteValues.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
DiscreteFactorGraph(const FactorGraph< DERIVEDFACTOR > &graph)
Definition: DiscreteFactorGraph.h:112
DiscreteValues::Names Names
Translation table from values to strings.
Definition: DiscreteFactor.h:102
Definition: chartTesting.h:28
Definition: DiscreteLookupDAG.h:77
FastVector< Key > KeyVector
Define collection type once and for all - also used in wrappers.
Definition: Key.h:86
Definition: DiscreteFactor.h:38
Definition: BayesTreeCliqueBase.h:33
Definition: DiscreteFactorGraph.h:83
DiscreteConditional ConditionalType
Type of conditionals from elimination.
Definition: DiscreteFactorGraph.h:58
std::string html(const DiscreteValues &values, const KeyFormatter &keyFormatter=DefaultKeyFormatter, const DiscreteValues::Names &names={})
Free version of html.
GTSAM_EXPORT std::pair< std::shared_ptr< DiscreteConditional >, DecisionTreeFactor::shared_ptr > EliminateDiscrete(const DiscreteFactorGraph &factors, const Ordering &keys)
Main elimination function for DiscreteFactorGraph.
Elimination tree for discrete factors.
Definition: DiscreteEliminationTree.h:31
DiscreteFactorGraph(const CONTAINER &factors)
Definition: DiscreteFactorGraph.h:107
Definition: EliminateableFactorGraph.h:55
std::optional< Ordering::OrderingType > OptionalOrderingType
Typedef for an optional ordering type.
Definition: EliminateableFactorGraph.h:95
A thin wrapper around std::set that uses boost's fast_pool_allocator.
DiscreteBayesTree BayesTreeType
Type of Bayes tree.
Definition: DiscreteFactorGraph.h:61
DiscreteKeys is a set of keys that can be assembled using the & operator.
Definition: DiscreteKey.h:41
Definition: DiscreteConditional.h:37