From 67286839384b3a9663d619020910c99ad23fd159 Mon Sep 17 00:00:00 2001 From: Chris Date: Wed, 16 Nov 2022 13:51:23 +0000 Subject: [PATCH] Small cleanup of IDRS.h --- unsupported/Eigen/src/IterativeSolvers/IDRS.h | 19 ++++++++----------- 1 file changed, 8 insertions(+), 11 deletions(-) diff --git a/unsupported/Eigen/src/IterativeSolvers/IDRS.h b/unsupported/Eigen/src/IterativeSolvers/IDRS.h index 2c7d7b046..d8f7a32dc 100644 --- a/unsupported/Eigen/src/IterativeSolvers/IDRS.h +++ b/unsupported/Eigen/src/IterativeSolvers/IDRS.h @@ -66,7 +66,6 @@ bool idrs(const MatrixType& A, const Rhs& b, Dest& x, const Preconditioner& prec const RealScalar tol = relres; const Index maxit = iter; - Index replacements = 0; bool trueres = false; FullPivLU lu_solver; @@ -88,15 +87,14 @@ bool idrs(const MatrixType& A, const Rhs& b, Dest& x, const Preconditioner& prec } // from http://homepage.tudelft.nl/1w5b5/IDRS/manual.pdf // A peak in the residual is considered dangerously high if‖ri‖/‖b‖> C(tol/epsilon). - // With epsilon the - // relative machine precision. The factor tol/epsilon corresponds to the size of a - // finite precision number that is so large that the absolute round-off error in - // this number, when propagated through the process, makes it impossible to - // achieve the required accuracy.The factor C accounts for the accumulation of - // round-off errors. This parameter has beenset to 10−3. - // mp is epsilon/C - // 10^3 * eps is very conservative, so normally no residual replacements will take place. - // It only happens if things go very wrong. Too many restarts may ruin the convergence. + // With epsilon the relative machine precision. The factor tol/epsilon corresponds + // to the size of a finite precision number that is so large that the absolute + // round-off error in this number, when propagated through the process, makes it + // impossible to achieve the required accuracy. The factor C accounts for the + // accumulation of round-off errors. This parameter has been set to 10^{-3}. + // mp is epsilon/C 10^3 * eps is very conservative, so normally no residual + // replacements will take place. It only happens if things go very wrong. Too many + // restarts may ruin the convergence. const RealScalar mp = RealScalar(1e3) * NumTraits::epsilon(); // Compute initial residual @@ -224,7 +222,6 @@ bool idrs(const MatrixType& A, const Rhs& b, Dest& x, const Preconditioner& prec if (trueres && normr < normb) { r = b - A * x; trueres = false; - replacements++; } // Smoothing: