23#include <gtsam/linear/Preconditioner.h>
25#include <gtsam/dllexport.h>
27#include <boost/shared_ptr.hpp>
34 class GaussianBayesNet;
35 class GaussianFactorGraph;
39 typedef boost::shared_ptr<SubgraphPreconditionerParameters> shared_ptr;
55 typedef boost::shared_ptr<SubgraphPreconditioner> shared_ptr;
56 typedef boost::shared_ptr<const GaussianBayesNet> sharedBayesNet;
57 typedef boost::shared_ptr<const GaussianFactorGraph> sharedFG;
58 typedef boost::shared_ptr<const VectorValues> sharedValues;
59 typedef boost::shared_ptr<const Errors> sharedErrors;
86 void print(
const std::string& s =
"SubgraphPreconditioner")
const;
89 const sharedFG&
Ab2()
const {
return Ab2_; }
92 const sharedBayesNet&
Rc1()
const {
return Rc1_; }
95 const sharedErrors
b2bar()
const {
return b2bar_; }
116 void transposeMultiplyAdd2(
double alpha, Errors::const_iterator begin,
117 Errors::const_iterator end, VectorValues& y)
const;
120 double error(
const VectorValues& y)
const;
123 VectorValues gradient(
const VectorValues& y)
const;
126 Errors
operator*(
const VectorValues& y)
const;
129 void multiplyInPlace(
const VectorValues& y, Errors& e)
const;
132 VectorValues
operator^(
const Errors& e)
const;
138 void transposeMultiplyAdd(
double alpha,
const Errors& e, VectorValues& y)
const;
144 void solve(
const Vector& y, Vector &x)
const override;
147 void transposeSolve(
const Vector& y, Vector& x)
const override;
151 const GaussianFactorGraph &gfg,
153 const std::map<Key,Vector> &lambda
Some support classes for iterative solvers.
Global functions in a separate testing namespace.
Definition: chartTesting.h:28
Vector operator^(const Matrix &A, const Vector &v)
overload ^ for trans(A)*v We transpose the vectors for speed.
Definition: Matrix.cpp:130
void print(const Matrix &A, const string &s, ostream &stream)
print without optional string, must specify cout yourself
Definition: Matrix.cpp:155
Point2 operator*(double s, const Point2 &p)
multiply with scalar
Definition: Point2.h:47
Handy data structure for iterative solvers.
Definition: IterativeSolver.h:126
Definition: Preconditioner.h:24
Definition: Preconditioner.h:64
Definition: SubgraphBuilder.h:96
Definition: SubgraphPreconditioner.h:38
Subgraph conditioner class, as explained in the RSS 2010 submission.
Definition: SubgraphPreconditioner.h:52
const sharedBayesNet & Rc1() const
Access Rc1.
Definition: SubgraphPreconditioner.h:92
const sharedErrors b2bar() const
Access b2bar.
Definition: SubgraphPreconditioner.h:95
const sharedFG & Ab2() const
Access Ab2.
Definition: SubgraphPreconditioner.h:89
This class represents a collection of vector-valued variables associated each with a unique integer i...
Definition: VectorValues.h:74
static VectorValues Zero(const VectorValues &other)
Create a VectorValues with the same structure as other, but filled with zeros.
Definition: VectorValues.cpp:78