From ccc7563ac5a614dec4f868b940cf521b01c48a55 Mon Sep 17 00:00:00 2001 From: David Dement Date: Mon, 16 May 2016 14:26:41 -0400 Subject: made a fix to the GMRES solver so that it now correctly reports the error achieved in the solution process --- unsupported/Eigen/src/IterativeSolvers/GMRES.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'unsupported/Eigen') diff --git a/unsupported/Eigen/src/IterativeSolvers/GMRES.h b/unsupported/Eigen/src/IterativeSolvers/GMRES.h index fbe21fc7e..cb64c24c3 100644 --- a/unsupported/Eigen/src/IterativeSolvers/GMRES.h +++ b/unsupported/Eigen/src/IterativeSolvers/GMRES.h @@ -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) { -- cgit v1.2.3