made a fix to the GMRES solver so that it now correctly reports the error achieved in the solution process

This commit is contained in:
David Dement 2016-05-16 14:26:41 -04:00
parent 575bc44c3f
commit ccc7563ac5

View File

@ -157,7 +157,8 @@ bool gmres(const MatrixType & mat, const Rhs & rhs, Dest & x, const Precondition
// insert coefficients into upper matrix triangle
H.col(k-1).head(k) = v.head(k);
bool stop = (k==m || abs(w(k)) < tol * r0Norm || iters == maxIters);
tol_error = std::abs(w(k)) / r0Norm;
bool stop = (k==m || tol_error < tol || iters == maxIters);
if (stop || k == restart)
{