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

Detailed Description

A class for computing Gaussian marginals of variables in a NonlinearFactorGraph.

Public Member Functions

 Marginals ()
 Default constructor only for wrappers.
 Marginals (const NonlinearFactorGraph &graph, const Values &solution, Factorization factorization=CHOLESKY)
 Construct a marginals class from a nonlinear factor graph.
 Marginals (const NonlinearFactorGraph &graph, const Values &solution, const Ordering &ordering, Factorization factorization=CHOLESKY)
 Construct a marginals class from a nonlinear factor graph.
 Marginals (const GaussianFactorGraph &graph, const Values &solution, Factorization factorization=CHOLESKY)
 Construct a marginals class from a linear factor graph.
 Marginals (const GaussianFactorGraph &graph, const Values &solution, const Ordering &ordering, Factorization factorization=CHOLESKY)
 Construct a marginals class from a linear factor graph.
 Marginals (const GaussianFactorGraph &graph, const VectorValues &solution, Factorization factorization=CHOLESKY)
 Construct a marginals class from a linear factor graph.
 Marginals (const GaussianFactorGraph &graph, const VectorValues &solution, const Ordering &ordering, Factorization factorization=CHOLESKY)
 Construct a marginals class from a linear factor graph.
 Marginals (GaussianBayesTree &&bayesTree, const VectorValues &solution, Factorization factorization=CHOLESKY)
 Construct a marginals class from a precomputed Bayes tree.
void print (const std::string &str="Marginals: ", const KeyFormatter &keyFormatter=DefaultKeyFormatter) const
 print
GaussianFactor::shared_ptr marginalFactor (Key variable) const
 Compute the marginal factor of a single variable.
Matrix marginalInformation (Key variable) const
 Compute the marginal information matrix of a single variable.
Matrix marginalCovariance (Key variable) const
 Compute the marginal covariance of a single variable.
JointMarginal jointMarginalCovariance (const KeyVector &variables) const
 Compute joint marginal covariance with blocks in variables order.
JointMarginal jointMarginalInformation (const KeyVector &variables) const
 Compute joint marginal information with blocks in variables order.
void deleteCachedShortcuts ()
 Delete cached Bayes tree shortcuts created while computing marginals.
VectorValues optimize () const
 Optimize the bayes tree.

Public Types

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

Protected Member Functions

GaussianFactorGraph::Eliminate eliminationFunction () const
 Select the elimination rule that matches the requested marginal factorization.
void computeBayesTree ()
 Compute the Bayes Tree as a helper function to the constructor.
void computeBayesTree (const Ordering &ordering)
 Compute the Bayes Tree as a helper function to the constructor.

Protected Attributes

GaussianFactorGraph graph_
Values values_
Factorization factorization_
GaussianBayesTree bayesTree_

Constructor & Destructor Documentation

◆ Marginals() [1/7]

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: CHOLESKY|QR

◆ Marginals() [2/7]

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: CHOLESKY|QR
orderingThe ordering for elimination.

◆ Marginals() [3/7]

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: CHOLESKY|QR

◆ Marginals() [4/7]

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: CHOLESKY|QR
orderingThe ordering for elimination.

◆ Marginals() [5/7]

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: CHOLESKY|QR
orderingAn optional variable ordering for elimination.

◆ Marginals() [6/7]

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: CHOLESKY|QR
orderingAn optional variable ordering for elimination.

◆ Marginals() [7/7]

gtsam::Marginals::Marginals ( GaussianBayesTree && bayesTree,
const VectorValues & solution,
Factorization factorization = CHOLESKY )

Construct a marginals class from a precomputed Bayes tree.

Parameters
bayesTreeThe precomputed Gaussian Bayes tree representing the factorization of the linear system.
solutionThe solution point at which to compute Gaussian marginals.
factorizationThe linear decomposition mode: CHOLESKY|QR

The documentation for this class was generated from the following files:
  • /tmp/gtsam-4.3.0-doxygen.rsXPUS/source/gtsam/nonlinear/Marginals.h
  • /tmp/gtsam-4.3.0-doxygen.rsXPUS/source/gtsam/nonlinear/Marginals.cpp