be a bit more verbose

release/4.3a0
Frank Dellaert 2010-03-07 00:10:02 +00:00
parent 3e2924a5bf
commit 2f72d585c5
1 changed files with 6 additions and 4 deletions

View File

@ -115,14 +115,16 @@ namespace gtsam {
V conjugateGradients(const S& Ab, V x, bool verbose, double epsilon,
double epsilon_abs, size_t maxIterations, bool steepest = false) {
CGState<S, V, E> state(Ab, x, verbose, epsilon, epsilon_abs, maxIterations,
steepest);
if (state.gamma < state.threshold) return x;
CGState<S, V, E> state(Ab, x, verbose, epsilon, epsilon_abs, maxIterations,steepest);
if (verbose) cout << "CG: epsilon = " << epsilon << ", maxIterations = "
<< state.maxIterations << ", ||g0||^2 = " << state.gamma
<< ", threshold = " << state.threshold << endl;
if (state.gamma < state.threshold) {
if (verbose) cout << "||g0||^2 < threshold, exiting immediately !" << endl;
return x;
}
// loop maxIterations times
while (!state.step(Ab, x))
;