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);