36 template<
class S,
class V,
class E>
38 const ConjugateGradientParameters ¶meters,
bool steepest =
false);
52 System(
const Matrix& A,
const Vector& b) :
57 const Matrix&
A()
const {
return A_; }
60 const Vector&
b()
const {
return b_; }
70 void print (
const std::string& s =
"System")
const;
74 return A() ^ (A() * x - b());
89 x += alpha * A().transpose() * e;
96 GTSAM_EXPORT Vector steepestDescent(
114 GTSAM_EXPORT Vector steepestDescent(
typedef and functions to augment Eigen's MatrixXd
Implementation of Conjugate Gradient solver for a linear system.
Iterative methods, template implementation.
Global functions in a separate testing namespace.
Definition: chartTesting.h:28
void print(const Matrix &A, const string &s, ostream &stream)
print without optional string, must specify cout yourself
Definition: Matrix.cpp:155
V conjugateGradients(const S &Ab, V x, const ConjugateGradientParameters ¶meters, bool steepest)
Method of conjugate gradients (CG) template "System" class S needs gradient(S,v), e=S*v,...
Definition: iterative-inl.h:125
Vector conjugateGradientDescent(const System &Ab, const Vector &x, const ConjugateGradientParameters ¶meters)
Method of conjugate gradients (CG), System version.
Definition: iterative.cpp:45
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
Helper class encapsulating the combined system |Ax-b_|^2 Needed to run Conjugate Gradients on matrice...
Definition: iterative.h:44
Vector operator*(const Vector &x) const
Apply operator A.
Definition: iterative.h:78
const Matrix & A() const
Access A matrix.
Definition: iterative.h:57
void multiplyInPlace(const Vector &x, Vector &e) const
Apply operator A in place.
Definition: iterative.h:83
const Vector & b() const
Access b vector.
Definition: iterative.h:60
Vector gradient(const Vector &x) const
gradient of objective function 0.5*|Ax-b_|^2 at x = A_'*(Ax-b_)
Definition: iterative.h:73
void transposeMultiplyAdd(double alpha, const Vector &e, Vector &x) const
x += alpha* A'*e
Definition: iterative.h:88
Vector operator^(const Vector &e) const
Apply operator A'*e.
Definition: iterative.h:63
parameters for iterative linear solvers
Definition: IterativeSolver.h:44
This class represents a collection of vector-valued variables associated each with a unique integer i...
Definition: VectorValues.h:74