From 93ff388841b11694bc16dfbd79bcf6136383a376 Mon Sep 17 00:00:00 2001 From: mehmet alper kuyumcu Date: Thu, 29 Jan 2026 16:59:38 +0000 Subject: [PATCH] Fix relative tolerance scaling by multiplying with RHS norm in BiCGSTAB libeigen/eigen!2118 --- Eigen/src/IterativeLinearSolvers/BiCGSTAB.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Eigen/src/IterativeLinearSolvers/BiCGSTAB.h b/Eigen/src/IterativeLinearSolvers/BiCGSTAB.h index 8fdeb849b..2d461fe07 100644 --- a/Eigen/src/IterativeLinearSolvers/BiCGSTAB.h +++ b/Eigen/src/IterativeLinearSolvers/BiCGSTAB.h @@ -34,7 +34,6 @@ bool bicgstab(const MatrixType& mat, const Rhs& rhs, Dest& x, const Precondition typedef typename Dest::RealScalar RealScalar; typedef typename Dest::Scalar Scalar; typedef Matrix VectorType; - RealScalar tol = tol_error; Index maxIters = iters; Index n = mat.cols(); @@ -48,6 +47,9 @@ bool bicgstab(const MatrixType& mat, const Rhs& rhs, Dest& x, const Precondition x.setZero(); return true; } + + RealScalar tol = tol_error * rhs_norm; + Scalar rho(1); Scalar alpha(0); Scalar w(1);