Fix relative tolerance scaling by multiplying with RHS norm in BiCGSTAB

libeigen/eigen!2118
This commit is contained in:
mehmet alper kuyumcu
2026-01-29 16:59:38 +00:00
committed by Antonio Sánchez
parent 26c242ab58
commit 93ff388841

View File

@@ -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<Scalar, Dynamic, 1> 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);