italgos.c: output number of CG steps
@@ -412,13 +412,15 @@ float conjgrad(unsigned int maxiter, float l2lambda, float epsilon,
float eps_squared = pow(epsilon, 2.);
+
+ unsigned int i = 0;
+
if (0. == rsold) {
debug_printf(DP_DEBUG3, "CG: early out\n");
goto cleanup;
}
-
- for (unsigned int i = 0; i < maxiter; i++) {
+ for (i = 0; i < maxiter; i++) {
iter_monitor(monitor, vops, x);
@@ -455,6 +457,7 @@ cleanup:
vops->del(Ap);
vops->del(p);
vops->del(r);
+ debug_printf(DP_DEBUG2, "\t cg: %3d\n", i);
return sqrtf(rsnew);
}
