gtsam
Loading...
Searching...
No Matches
gtsam::DiscreteMarginals Class Reference

Detailed Description

A class for computing marginals of variables in a DiscreteFactorGraph.

Public Member Functions

 DiscreteMarginals (const DiscreteFactorGraph &graph)
 Construct a marginals class.
DiscreteFactor::shared_ptr operator() (Key variable) const
 Compute the marginal of a single variable.
Vector marginalProbabilities (const DiscreteKey &key) const
 Compute the marginal of a single variable.
void print (const std::string &s="", const KeyFormatter formatter=DefaultKeyFormatter) const
 Print details.

Protected Attributes

DiscreteBayesTree::shared_ptr bayesTree_

Constructor & Destructor Documentation

◆ DiscreteMarginals()

gtsam::DiscreteMarginals::DiscreteMarginals ( const DiscreteFactorGraph & graph)

Construct a marginals class.

Parameters
graphThe factor graph defining the full joint distribution on all variables.

Member Function Documentation

◆ marginalProbabilities()

Vector gtsam::DiscreteMarginals::marginalProbabilities ( const DiscreteKey & key) const

Compute the marginal of a single variable.

Parameters
keyDiscreteKey of the Variable
Returns
Vector of marginal probabilities

The documentation for this class was generated from the following files: