Go to the documentation of this file.
28 template<
class S,
class V,
class E>
63 std::cout <<
"iteration = " <<
k << std::endl;
66 std::cout <<
"dotg = " <<
gamma << std::endl;
95 double new_gamma =
dot(
g,
g);
98 std::cout <<
"iteration " <<
k <<
": alpha = " <<
alpha
99 <<
", dotg = " << new_gamma
116 Ab.multiplyInPlace(
d,
Ad);
125 template<
class S,
class V,
class E>
133 <<
", ||g0||^2 = " <<
state.gamma
134 <<
", threshold = " <<
state.threshold << std::endl;
138 std::cout <<
"||g0||^2 < threshold, exiting immediately !" << std::endl;
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
Verbosity verbosity() const
double beta(double a, double b)
CGState(const S &Ab, const V &x, const Parameters ¶meters, bool steep)
void print(const Matrix &A, const string &s, ostream &stream)
Implementation of Conjugate Gradient solver for a linear system.
V conjugateGradients(const S &Ab, V x, const ConjugateGradientParameters ¶meters, bool steepest)
static ConjugateGradientParameters parameters
double dot(const V1 &a, const V2 &b)
bool step(const S &Ab, V &x)
bool steepest
flag to indicate we are doing steepest descent
Iterative methods, implementation.
ConjugateGradientParameters Parameters
double epsilon_rel
threshold for relative error decrease
const Parameters & parameters_
size_t maxIterations
maximum number of cg iterations
double threshold
gamma (squared L2 norm of g) and convergence threshold
V d
gradient g and search direction d for CG
double takeOptimalStep(V &x)
size_t reset
number of iterations before reset
double epsilon_abs
threshold for absolute error decrease
gtsam
Author(s):
autogenerated on Sun Dec 22 2024 04:11:47