diff options
author | David Dement <ddement@gatech.edu> | 2016-05-16 14:26:41 -0400 |
---|---|---|
committer | David Dement <ddement@gatech.edu> | 2016-05-16 14:26:41 -0400 |
commit | ccc7563ac5a614dec4f868b940cf521b01c48a55 (patch) | |
tree | a200f88f7c1ec82dbde5ed215cd09f1abd3dce5a /unsupported/Eigen | |
parent | 575bc44c3f1bf1757f4148219fbdb5590346382a (diff) |
made a fix to the GMRES solver so that it now correctly reports the error achieved in the solution process
Diffstat (limited to 'unsupported/Eigen')
-rw-r--r-- | unsupported/Eigen/src/IterativeSolvers/GMRES.h | 3 |
1 files changed, 2 insertions, 1 deletions
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) { |