37 DiscreteBayesTree::shared_ptr bayesTree_;
47 bayesTree_ = graph.eliminateMultifrontal();
55 return marginalFactor;
68 Vector vResult(key.second);
69 for (
size_t state = 0; state < key.second ; ++ state) {
71 values[key.first] = state;
72 vResult(state) = (*marginalFactor)(values);
typedef and functions to augment Eigen's VectorXd
Discrete Bayes Tree, the result of eliminating a DiscreteJunctionTree.
std::pair< DiscreteConditional::shared_ptr, DecisionTreeFactor::shared_ptr > EliminateDiscrete(const DiscreteFactorGraph &factors, const Ordering &frontalKeys)
Main elimination function for DiscreteFactorGraph.
Definition: DiscreteFactorGraph.cpp:200
std::pair< Key, size_t > DiscreteKey
Key type for discrete variables.
Definition: DiscreteKey.h:36
Global functions in a separate testing namespace.
Definition: chartTesting.h:28
std::uint64_t Key
Integer nonlinear key type.
Definition: types.h:100
boost::shared_ptr< DiscreteFactor > shared_ptr
shared_ptr to this class
Definition: DiscreteFactor.h:44
A Discrete Factor Graph is a factor graph where all factors are Discrete, i.e.
Definition: DiscreteFactorGraph.h:86
A class for computing marginals of variables in a DiscreteFactorGraph.
Definition: DiscreteMarginals.h:33
Vector marginalProbabilities(const DiscreteKey &key) const
Compute the marginal of a single variable.
Definition: DiscreteMarginals.h:62
DiscreteMarginals(const DiscreteFactorGraph &graph)
Construct a marginals class.
Definition: DiscreteMarginals.h:46
DiscreteFactor::shared_ptr operator()(Key variable) const
Compute the marginal of a single variable.
Definition: DiscreteMarginals.h:51
A map from keys to values.
Definition: DiscreteValues.h:34