Public Types | Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
gtsam::Marginals Class Reference

#include <Marginals.h>

Public Types

enum  Factorization { CHOLESKY, QR }
 

Public Member Functions

JointMarginal jointMarginalCovariance (const KeyVector &variables) const
 
JointMarginal jointMarginalInformation (const KeyVector &variables) const
 
Matrix marginalCovariance (Key variable) const
 
GaussianFactor::shared_ptr marginalFactor (Key variable) const
 
Matrix marginalInformation (Key variable) const
 
 Marginals ()
 Default constructor only for wrappers. More...
 
 Marginals (const NonlinearFactorGraph &graph, const Values &solution, Factorization factorization=CHOLESKY)
 
 Marginals (const NonlinearFactorGraph &graph, const Values &solution, const Ordering &ordering, Factorization factorization=CHOLESKY)
 
 Marginals (const GaussianFactorGraph &graph, const Values &solution, Factorization factorization=CHOLESKY)
 
 Marginals (const GaussianFactorGraph &graph, const Values &solution, const Ordering &ordering, Factorization factorization=CHOLESKY)
 
 Marginals (const GaussianFactorGraph &graph, const VectorValues &solution, Factorization factorization=CHOLESKY)
 
 Marginals (const GaussianFactorGraph &graph, const VectorValues &solution, const Ordering &ordering, Factorization factorization=CHOLESKY)
 
 Marginals (const NonlinearFactorGraph &graph, const Values &solution, Factorization factorization, const Ordering &ordering)
 
 Marginals (const GaussianFactorGraph &graph, const Values &solution, Factorization factorization, const Ordering &ordering)
 
 Marginals (const GaussianFactorGraph &graph, const VectorValues &solution, Factorization factorization, const Ordering &ordering)
 
VectorValues optimize () const
 
void print (const std::string &str="Marginals: ", const KeyFormatter &keyFormatter=DefaultKeyFormatter) const
 

Protected Member Functions

void computeBayesTree ()
 
void computeBayesTree (const Ordering &ordering)
 

Protected Attributes

GaussianBayesTree bayesTree_
 
Factorization factorization_
 
GaussianFactorGraph graph_
 
Values values_
 

Detailed Description

A class for computing Gaussian marginals of variables in a NonlinearFactorGraph

Definition at line 32 of file Marginals.h.

Member Enumeration Documentation

The linear factorization mode - either CHOLESKY (faster and suitable for most problems) or QR (slower but more numerically stable for poorly-conditioned problems).

Enumerator
CHOLESKY 
QR 

Definition at line 37 of file Marginals.h.

Constructor & Destructor Documentation

gtsam::Marginals::Marginals ( )
inline

Default constructor only for wrappers.

Definition at line 52 of file Marginals.h.

gtsam::Marginals::Marginals ( const NonlinearFactorGraph graph,
const Values solution,
Factorization  factorization = CHOLESKY 
)

Construct a marginals class from a nonlinear factor graph.

Parameters
graphThe factor graph defining the full joint density on all variables.
solutionThe linearization point about which to compute Gaussian marginals (usually the MLE as obtained from a NonlinearOptimizer).
factorizationThe linear decomposition mode - either Marginals::CHOLESKY (faster and suitable for most problems) or Marginals::QR (slower but more numerically stable for poorly-conditioned problems).

Definition at line 29 of file Marginals.cpp.

gtsam::Marginals::Marginals ( const NonlinearFactorGraph graph,
const Values solution,
const Ordering ordering,
Factorization  factorization = CHOLESKY 
)

Construct a marginals class from a nonlinear factor graph.

Parameters
graphThe factor graph defining the full joint density on all variables.
solutionThe linearization point about which to compute Gaussian marginals (usually the MLE as obtained from a NonlinearOptimizer).
factorizationThe linear decomposition mode - either Marginals::CHOLESKY (faster and suitable for most problems) or Marginals::QR (slower but more numerically stable for poorly-conditioned problems).
orderingThe ordering for elimination.

Definition at line 37 of file Marginals.cpp.

gtsam::Marginals::Marginals ( const GaussianFactorGraph graph,
const Values solution,
Factorization  factorization = CHOLESKY 
)

Construct a marginals class from a linear factor graph.

Parameters
graphThe factor graph defining the full joint density on all variables.
solutionThe solution point to compute Gaussian marginals.
factorizationThe linear decomposition mode - either Marginals::CHOLESKY (faster and suitable for most problems) or Marginals::QR (slower but more numerically stable for poorly-conditioned problems).

Definition at line 46 of file Marginals.cpp.

gtsam::Marginals::Marginals ( const GaussianFactorGraph graph,
const Values solution,
const Ordering ordering,
Factorization  factorization = CHOLESKY 
)

Construct a marginals class from a linear factor graph.

Parameters
graphThe factor graph defining the full joint density on all variables.
solutionThe solution point to compute Gaussian marginals.
factorizationThe linear decomposition mode - either Marginals::CHOLESKY (faster and suitable for most problems) or Marginals::QR (slower but more numerically stable for poorly-conditioned problems).
orderingThe ordering for elimination.

Definition at line 53 of file Marginals.cpp.

gtsam::Marginals::Marginals ( const GaussianFactorGraph graph,
const VectorValues solution,
Factorization  factorization = CHOLESKY 
)

Construct a marginals class from a linear factor graph.

Parameters
graphThe factor graph defining the full joint density on all variables.
solutionThe solution point to compute Gaussian marginals.
factorizationThe linear decomposition mode - either Marginals::CHOLESKY (faster and suitable for most problems) or Marginals::QR (slower but more numerically stable for poorly-conditioned problems).
orderingAn optional variable ordering for elimination.

Definition at line 61 of file Marginals.cpp.

gtsam::Marginals::Marginals ( const GaussianFactorGraph graph,
const VectorValues solution,
const Ordering ordering,
Factorization  factorization = CHOLESKY 
)

Construct a marginals class from a linear factor graph.

Parameters
graphThe factor graph defining the full joint density on all variables.
solutionThe solution point to compute Gaussian marginals.
factorizationThe linear decomposition mode - either Marginals::CHOLESKY (faster and suitable for most problems) or Marginals::QR (slower but more numerically stable for poorly-conditioned problems).
orderingAn optional variable ordering for elimination.

Definition at line 71 of file Marginals.cpp.

gtsam::Marginals::Marginals ( const NonlinearFactorGraph graph,
const Values solution,
Factorization  factorization,
const Ordering ordering 
)
inline
Deprecated:
argument order changed due to removing boost::optional<Ordering>

Definition at line 135 of file Marginals.h.

gtsam::Marginals::Marginals ( const GaussianFactorGraph graph,
const Values solution,
Factorization  factorization,
const Ordering ordering 
)
inline
Deprecated:
argument order changed due to removing boost::optional<Ordering>

Definition at line 139 of file Marginals.h.

gtsam::Marginals::Marginals ( const GaussianFactorGraph graph,
const VectorValues solution,
Factorization  factorization,
const Ordering ordering 
)
inline
Deprecated:
argument order changed due to removing boost::optional<Ordering>

Definition at line 143 of file Marginals.h.

Member Function Documentation

void gtsam::Marginals::computeBayesTree ( )
protected

Compute the Bayes Tree as a helper function to the constructor

Definition at line 82 of file Marginals.cpp.

void gtsam::Marginals::computeBayesTree ( const Ordering ordering)
protected

Compute the Bayes Tree as a helper function to the constructor

Definition at line 91 of file Marginals.cpp.

JointMarginal gtsam::Marginals::jointMarginalCovariance ( const KeyVector variables) const

Compute the joint marginal covariance of several variables

Definition at line 134 of file Marginals.cpp.

JointMarginal gtsam::Marginals::jointMarginalInformation ( const KeyVector variables) const

Compute the joint marginal information of several variables

Definition at line 141 of file Marginals.cpp.

Matrix gtsam::Marginals::marginalCovariance ( Key  variable) const

Compute the marginal covariance of a single variable

Definition at line 129 of file Marginals.cpp.

GaussianFactor::shared_ptr gtsam::Marginals::marginalFactor ( Key  variable) const

Compute the marginal factor of a single variable

Definition at line 108 of file Marginals.cpp.

Matrix gtsam::Marginals::marginalInformation ( Key  variable) const

Compute the marginal information matrix of a single variable. Use LLt(const Matrix&) or RtR(const Matrix&) to obtain the square-root information matrix.

Definition at line 121 of file Marginals.cpp.

VectorValues gtsam::Marginals::optimize ( ) const

Optimize the bayes tree

Definition at line 188 of file Marginals.cpp.

void gtsam::Marginals::print ( const std::string &  str = "Marginals: ",
const KeyFormatter keyFormatter = DefaultKeyFormatter 
) const

print

Definition at line 100 of file Marginals.cpp.

Member Data Documentation

GaussianBayesTree gtsam::Marginals::bayesTree_
protected

Definition at line 47 of file Marginals.h.

Factorization gtsam::Marginals::factorization_
protected

Definition at line 46 of file Marginals.h.

GaussianFactorGraph gtsam::Marginals::graph_
protected

Definition at line 44 of file Marginals.h.

Values gtsam::Marginals::values_
protected

Definition at line 45 of file Marginals.h.


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


gtsam
Author(s):
autogenerated on Sat May 8 2021 02:58:18