gtsam
Loading...
Searching...
No Matches
DiscreteMarginals.h
Go to the documentation of this file.
1/* ----------------------------------------------------------------------------
2
3 * GTSAM Copyright 2010, Georgia Tech Research Corporation,
4 * Atlanta, Georgia 30332-0415
5 * All Rights Reserved
6 * Authors: Frank Dellaert, et al. (see THANKS for the full author list)
7
8 * See LICENSE for the license information
9
10 * -------------------------------------------------------------------------- */
11
21
22#pragma once
23
24#include <gtsam/base/Vector.h>
27
28namespace gtsam {
29
34class GTSAM_EXPORT DiscreteMarginals {
35 protected:
36 DiscreteBayesTree::shared_ptr bayesTree_;
37
38 public:
39 DiscreteMarginals() {}
40
45 DiscreteMarginals(const DiscreteFactorGraph& graph);
46
49
54 Vector marginalProbabilities(const DiscreteKey& key) const;
55
57 void print(const std::string& s = "",
58 const KeyFormatter formatter = DefaultKeyFormatter) const;
59};
60
61} /* namespace gtsam */
typedef and functions to augment Eigen's VectorXd
Discrete Bayes Tree, the result of eliminating a DiscreteJunctionTree.
std::pair< Key, size_t > DiscreteKey
Key type for discrete variables.
Definition DiscreteKey.h:38
Global functions in a separate testing namespace.
Definition chartTesting.h:28
KeyFormatter DefaultKeyFormatter
Assign default key formatter.
Definition Key.cpp:30
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
std::uint64_t Key
Integer nonlinear key type.
Definition types.h:43
std::shared_ptr< DiscreteFactor > shared_ptr
shared_ptr to this class
Definition DiscreteFactor.h:46
A Discrete Factor Graph is a factor graph where all factors are Discrete, i.e.
Definition DiscreteFactorGraph.h:100
Vector marginalProbabilities(const DiscreteKey &key) const
Compute the marginal of a single variable.
Definition DiscreteMarginals.cpp:40
DiscreteFactor::shared_ptr operator()(Key variable) const
Compute the marginal of a single variable.
Definition DiscreteMarginals.cpp:32
void print(const std::string &s="", const KeyFormatter formatter=DefaultKeyFormatter) const
Print details.
Definition DiscreteMarginals.cpp:55