Go to the documentation of this file.
28 template<
class S,
class V,
class E>
61 std::cout <<
"iteration = " <<
k << std::endl;
64 std::cout <<
"dotg = " <<
gamma << std::endl;
93 double new_gamma =
dot(
g,
g);
96 std::cout <<
"iteration " <<
k <<
": alpha = " <<
alpha
97 <<
", dotg = " << new_gamma
114 Ab.multiplyInPlace(
d,
Ad);
123 template<
class S,
class V,
class E>
131 <<
", ||g0||^2 = " <<
state.gamma
132 <<
", threshold = " <<
state.threshold
137 std::cout <<
"||g0||^2 < threshold, exiting immediately !" << std::endl;
double epsilon_abs() const
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
const Parameters & parameters_
double threshold
gamma (squared L2 norm of g) and convergence threshold
size_t maxIterations() const
V d
gradient g and search direction d for CG
double takeOptimalStep(V &x)
gtsam
Author(s):
autogenerated on Thu Jun 13 2024 03:02:46