mirror of
https://gitlab.com/libeigen/eigen.git
synced 2026-04-10 11:34:33 +08:00
Fix relative tolerance scaling by multiplying with RHS norm in BiCGSTAB
libeigen/eigen!2118
This commit is contained in:
committed by
Antonio Sánchez
parent
26c242ab58
commit
93ff388841
@@ -34,7 +34,6 @@ bool bicgstab(const MatrixType& mat, const Rhs& rhs, Dest& x, const Precondition
|
|||||||
typedef typename Dest::RealScalar RealScalar;
|
typedef typename Dest::RealScalar RealScalar;
|
||||||
typedef typename Dest::Scalar Scalar;
|
typedef typename Dest::Scalar Scalar;
|
||||||
typedef Matrix<Scalar, Dynamic, 1> VectorType;
|
typedef Matrix<Scalar, Dynamic, 1> VectorType;
|
||||||
RealScalar tol = tol_error;
|
|
||||||
Index maxIters = iters;
|
Index maxIters = iters;
|
||||||
|
|
||||||
Index n = mat.cols();
|
Index n = mat.cols();
|
||||||
@@ -48,6 +47,9 @@ bool bicgstab(const MatrixType& mat, const Rhs& rhs, Dest& x, const Precondition
|
|||||||
x.setZero();
|
x.setZero();
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
RealScalar tol = tol_error * rhs_norm;
|
||||||
|
|
||||||
Scalar rho(1);
|
Scalar rho(1);
|
||||||
Scalar alpha(0);
|
Scalar alpha(0);
|
||||||
Scalar w(1);
|
Scalar w(1);
|
||||||
|
|||||||
Reference in New Issue
Block a user