gtsam  4.1.0
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 
28 namespace gtsam {
29 
30 // Forward declarations
31 class GaussianFactorGraph;
32 class GaussianBayesNet;
33 class SubgraphPreconditioner;
34 
35 struct 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 
76 class 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  virtual ~SubgraphSolver() {}
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
gtsam::GaussianFactorGraph
A Linear Factor Graph is a factor graph where all factors are Gaussian, i.e.
Definition: GaussianFactorGraph.h:68
gtsam::SubgraphSolver::~SubgraphSolver
virtual ~SubgraphSolver()
Destructor.
Definition: SubgraphSolver.h:114
gtsam::optimize
Point3 optimize(const NonlinearFactorGraph &graph, const Values &values, Key landmarkKey)
Optimize for triangulation.
Definition: triangulation.cpp:73
gtsam::Ordering
Definition: Ordering.h:34
gtsam::SubgraphSolver::SubgraphSolver
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.
gtsam::ConjugateGradientParameters
parameters for the conjugate gradient method
Definition: ConjugateGradientSolver.h:29
gtsam::SubgraphSolver::pc_
boost::shared_ptr< SubgraphPreconditioner > pc_
preconditioner object
Definition: SubgraphSolver.h:82
ConjugateGradientSolver.h
Implementation of Conjugate Gradient solver for a linear system.
gtsam::SubgraphBuilderParameters
Definition: SubgraphBuilder.h:95
gtsam::VectorValues
This class represents a collection of vector-valued variables associated each with a unique integer i...
Definition: VectorValues.h:74
gtsam
Global functions in a separate testing namespace.
Definition: chartTesting.h:28
gtsam::SubgraphSolver::SubgraphSolver
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.
gtsam::print
void print(const Matrix &A, const string &s, ostream &stream)
print without optional string, must specify cout yourself
Definition: Matrix.cpp:155
gtsam::SubgraphSolverParameters
Definition: SubgraphSolver.h:36
gtsam::IterativeSolver
Base class for Iterative Solvers like SubgraphSolver.
Definition: IterativeSolver.h:86
gtsam::KeyInfo
Handy data structure for iterative solvers.
Definition: IterativeSolver.h:126
SubgraphBuilder.h
gtsam::SubgraphSolver
This class implements the linear SPCG solver presented in Dellaert et al in IROS'10.
Definition: SubgraphSolver.h:76