Go to the documentation of this file.
30 : values_(solution), factorization_(factorization) {
31 gttic(MarginalsConstructor);
39 : values_(solution), factorization_(factorization) {
40 gttic(MarginalsConstructor);
47 : graph_(
graph), values_(solution), factorization_(factorization) {
48 gttic(MarginalsConstructor);
55 : graph_(
graph), values_(solution), factorization_(factorization) {
56 gttic(MarginalsConstructor);
62 : graph_(
graph), factorization_(factorization) {
63 gttic(MarginalsConstructor);
64 for (
const auto& keyValue: solution) {
73 : graph_(
graph), factorization_(factorization) {
74 gttic(MarginalsConstructor);
75 for (
const auto& keyValue: solution) {
121 throw std::runtime_error(
"Marginals::marginalFactor: Unknown factorization");
140 info.blockMatrix_.invertInPlace();
149 if(variables.size() == 1)
152 std::vector<size_t> dims;
153 dims.push_back(
info.rows());
160 if(variables.size() == 2) {
174 Matrix info = augmentedInfo.topLeftCorner(augmentedInfo.rows()-1, augmentedInfo.cols()-1);
178 std::sort(variablesSorted.begin(), variablesSorted.end());
181 std::vector<size_t> dims;
182 dims.reserve(variablesSorted.size());
183 for(
const auto&
key: variablesSorted) {
198 cout <<
s <<
"Joint marginal on keys ";
207 cout <<
". Use 'at' or 'operator()' to query matrix blocks." << endl;
JointMarginal jointMarginalInformation(const KeyVector &variables) const
void print(const std::string &s="", const KeyFormatter &formatter=DefaultKeyFormatter) const
Marginals()
Default constructor only for wrappers.
Factorization factorization_
virtual void print(const std::string &s="FactorGraph", const KeyFormatter &formatter=DefaultKeyFormatter) const
Print out graph to std::cout, with optional key formatter.
Matrix marginalInformation(Key variable) const
const KeyFormatter & formatter
Contains the HessianFactor class, a general quadratic factor.
sharedConditional marginalFactor(Key j, const Eliminate &function=EliminationTraitsType::DefaultEliminate) const
void print(const std::string &s="", const KeyFormatter &keyFormatter=DefaultKeyFormatter) const
void print(const std::string &str="Marginals: ", const KeyFormatter &keyFormatter=DefaultKeyFormatter) const
FastVector< Key > KeyVector
Define collection type once and for all - also used in wrappers.
Matrix marginalCovariance(Key variable) const
std::shared_ptr< BayesTreeType > eliminateMultifrontal(OptionalOrderingType orderingType={}, const Eliminate &function=EliminationTraitsType::DefaultEliminate, OptionalVariableIndex variableIndex={}) const
std::pair< std::shared_ptr< GaussianConditional >, std::shared_ptr< GaussianFactor > > EliminatePreferCholesky(const GaussianFactorGraph &factors, const Ordering &keys)
const ValueType at(Key j) const
std::function< std::string(Key)> KeyFormatter
Typedef for a function to format a key, i.e. to convert it to a string.
std::shared_ptr< This > shared_ptr
shared_ptr to this class
JointMarginal jointMarginalCovariance(const KeyVector &variables) const
GaussianFactor::shared_ptr marginalFactor(Key variable) const
VectorValues optimize() const
static enum @1096 ordering
const gtsam::Symbol key('X', 0)
GaussianFactorGraph graph_
OrderingType
Type of ordering to use.
Matrix augmentedHessian(const Ordering &ordering) const
void print(const std::string &str="", const KeyFormatter &keyFormatter=DefaultKeyFormatter) const
A class for computing marginals in a NonlinearFactorGraph.
void insert(Key j, const Value &val)
VectorValues optimize() const
GaussianBayesTree bayesTree_
sharedFactorGraph joint(Key j1, Key j2, const Eliminate &function=EliminationTraitsType::DefaultEliminate) const
NonlinearFactorGraph graph
std::uint64_t Key
Integer nonlinear key type.
std::shared_ptr< BayesTreeType > marginalMultifrontalBayesTree(const Ordering &variables, const Eliminate &function=EliminationTraitsType::DefaultEliminate, OptionalVariableIndex variableIndex={}) const
std::pair< GaussianConditional::shared_ptr, JacobianFactor::shared_ptr > EliminateQR(const GaussianFactorGraph &factors, const Ordering &keys)
gtsam
Author(s):
autogenerated on Sat Nov 16 2024 04:03:00