36 DiscreteBayesTree::shared_ptr bayesTree_;
44 bayesTree_ = graph.eliminateMultifrontal();
52 return marginalFactor;
65 Vector vResult(key.second);
66 for (
size_t state = 0; state < key.second ; ++ state) {
68 values[key.first] = state;
69 vResult(state) = (*marginalFactor)(values);
typedef and functions to augment Eigen's VectorXd
Discrete Bayes Tree, the result of eliminating a DiscreteJunctionTree.
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
std::pair< Key, size_t > DiscreteKey
Key type for discrete conditionals Includes name and cardinality.
Definition: DiscreteKey.h:34
std::uint64_t Key
Integer nonlinear key type.
Definition: types.h:69
An assignment from labels to value index (size_t).
Definition: Assignment.h:34
boost::shared_ptr< DiscreteFactor > shared_ptr
shared_ptr to this class
Definition: DiscreteFactor.h:40
A Discrete Factor Graph is a factor graph where all factors are Discrete, i.e.
Definition: DiscreteFactorGraph.h:66
A class for computing marginals of variables in a DiscreteFactorGraph.
Definition: DiscreteMarginals.h:32
Vector marginalProbabilities(const DiscreteKey &key) const
Compute the marginal of a single variable.
Definition: DiscreteMarginals.h:59
DiscreteMarginals(const DiscreteFactorGraph &graph)
Construct a marginals class.
Definition: DiscreteMarginals.h:43
DiscreteFactor::shared_ptr operator()(Key variable) const
Compute the marginal of a single variable.
Definition: DiscreteMarginals.h:48