36 template<
class S,
class V,
class E>
38 const ConjugateGradientParameters &
parameters,
bool steepest =
false);
70 void print (
const std::string&
s =
"System")
const;
74 return A() ^ (
A() * x -
b());
89 x += alpha *
A().transpose() *
e;
void print(const Matrix &A, const string &s, ostream &stream)
System(const Matrix &A, const Vector &b)
void transposeMultiplyAdd(double alpha, const Vector &e, Vector &x) const
void multiplyInPlace(const Vector &x, Vector &e) const
V conjugateGradients(const S &Ab, V x, const ConjugateGradientParameters ¶meters, bool steepest)
Implementation of Conjugate Gradient solver for a linear system.
Vector operator^(const Vector &e) const
Array< double, 1, 3 > e(1./3., 0.5, 2.)
Vector gradient(const Vector &x) const
Iterative methods, template implementation.
static ConjugateGradientParameters parameters
Vector conjugateGradientDescent(const System &Ab, const Vector &x, const ConjugateGradientParameters ¶meters)
set noclip points set clip one set noclip two set bar set border lt lw set xdata set ydata set zdata set x2data set y2data set boxwidth set dummy x
Vector steepestDescent(const System &Ab, const Vector &x, const ConjugateGradientParameters ¶meters)
Vector operator*(const Vector &x) const