gtsam 4.1.1
gtsam
SubgraphSolver.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
20#pragma once
21
24
25#include <map>
26#include <utility> // pair
27
28namespace gtsam {
29
30// Forward declarations
31class GaussianFactorGraph;
32class GaussianBayesNet;
33class SubgraphPreconditioner;
34
35struct GTSAM_EXPORT SubgraphSolverParameters
37 SubgraphBuilderParameters builderParams;
39 : builderParams(p) {}
40 void print() const { Base::print(); }
41 void print(std::ostream &os) const override {
42 Base::print(os);
43 }
44};
45
76class GTSAM_EXPORT SubgraphSolver : public IterativeSolver {
77 public:
79
80 protected:
81 Parameters parameters_;
82 boost::shared_ptr<SubgraphPreconditioner> pc_;
83
84 public:
87
93 SubgraphSolver(const GaussianFactorGraph &A, const Parameters &parameters,
94 const Ordering &ordering);
95
103 const boost::shared_ptr<GaussianFactorGraph> &Ab2,
104 const Parameters &parameters, const Ordering &ordering);
109 SubgraphSolver(const boost::shared_ptr<GaussianBayesNet> &Rc1,
110 const boost::shared_ptr<GaussianFactorGraph> &Ab2,
111 const Parameters &parameters);
112
114 ~SubgraphSolver() override {}
115
119
121 VectorValues optimize() const;
122
125 const KeyInfo &keyInfo,
126 const std::map<Key, Vector> &lambda,
127 const VectorValues &initial) override;
128
132
134 std::pair < boost::shared_ptr<GaussianFactorGraph>,
135 boost::shared_ptr<GaussianFactorGraph> > splitGraph(
136 const GaussianFactorGraph &gfg);
137
139};
140
141} // namespace gtsam
Implementation of Conjugate Gradient solver for a linear system.
Global functions in a separate testing namespace.
Definition: chartTesting.h:28
Point3 optimize(const NonlinearFactorGraph &graph, const Values &values, Key landmarkKey)
Optimize for triangulation.
Definition: triangulation.cpp:73
void print(const Matrix &A, const string &s, ostream &stream)
print without optional string, must specify cout yourself
Definition: Matrix.cpp:155
Definition: Ordering.h:34
parameters for the conjugate gradient method
Definition: ConjugateGradientSolver.h:29
A Linear Factor Graph is a factor graph where all factors are Gaussian, i.e.
Definition: GaussianFactorGraph.h:69
Base class for Iterative Solvers like SubgraphSolver.
Definition: IterativeSolver.h:86
Handy data structure for iterative solvers.
Definition: IterativeSolver.h:126
Definition: SubgraphBuilder.h:96
Definition: SubgraphSolver.h:36
This class implements the linear SPCG solver presented in Dellaert et al in IROS'10.
Definition: SubgraphSolver.h:76
~SubgraphSolver() override
Destructor.
Definition: SubgraphSolver.h:114
SubgraphSolver(const GaussianFactorGraph &Ab1, const boost::shared_ptr< GaussianFactorGraph > &Ab2, const Parameters &parameters, const Ordering &ordering)
The user specifies the subgraph part and the constraints part.
boost::shared_ptr< SubgraphPreconditioner > pc_
preconditioner object
Definition: SubgraphSolver.h:82
SubgraphSolver(const boost::shared_ptr< GaussianBayesNet > &Rc1, const boost::shared_ptr< GaussianFactorGraph > &Ab2, const Parameters &parameters)
The same as above, but we assume A1 was solved by caller.
This class represents a collection of vector-valued variables associated each with a unique integer i...
Definition: VectorValues.h:74