mirror of
https://gitlab.com/libeigen/eigen.git
synced 2025-08-14 04:35:57 +08:00
Small cleanup of IDRS.h
This commit is contained in:
parent
02805bd56c
commit
6728683938
@ -66,7 +66,6 @@ bool idrs(const MatrixType& A, const Rhs& b, Dest& x, const Preconditioner& prec
|
|||||||
const RealScalar tol = relres;
|
const RealScalar tol = relres;
|
||||||
const Index maxit = iter;
|
const Index maxit = iter;
|
||||||
|
|
||||||
Index replacements = 0;
|
|
||||||
bool trueres = false;
|
bool trueres = false;
|
||||||
|
|
||||||
FullPivLU<DenseMatrixType> lu_solver;
|
FullPivLU<DenseMatrixType> 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
|
// from http://homepage.tudelft.nl/1w5b5/IDRS/manual.pdf
|
||||||
// A peak in the residual is considered dangerously high if‖ri‖/‖b‖> C(tol/epsilon).
|
// A peak in the residual is considered dangerously high if‖ri‖/‖b‖> C(tol/epsilon).
|
||||||
// With epsilon the
|
// With epsilon the relative machine precision. The factor tol/epsilon corresponds
|
||||||
// relative machine precision. The factor tol/epsilon corresponds to the size of a
|
// to the size of a finite precision number that is so large that the absolute
|
||||||
// finite precision number that is so large that the absolute round-off error in
|
// round-off error in this number, when propagated through the process, makes it
|
||||||
// this number, when propagated through the process, makes it impossible to
|
// impossible to achieve the required accuracy. The factor C accounts for the
|
||||||
// achieve the required accuracy.The factor C accounts for the accumulation of
|
// accumulation of round-off errors. This parameter has been set to 10^{-3}.
|
||||||
// round-off errors. This parameter has beenset to 10−3.
|
// mp is epsilon/C 10^3 * eps is very conservative, so normally no residual
|
||||||
// mp is epsilon/C
|
// replacements will take place. It only happens if things go very wrong. Too many
|
||||||
// 10^3 * eps is very conservative, so normally no residual replacements will take place.
|
// restarts may ruin the convergence.
|
||||||
// It only happens if things go very wrong. Too many restarts may ruin the convergence.
|
|
||||||
const RealScalar mp = RealScalar(1e3) * NumTraits<Scalar>::epsilon();
|
const RealScalar mp = RealScalar(1e3) * NumTraits<Scalar>::epsilon();
|
||||||
|
|
||||||
// Compute initial residual
|
// Compute initial residual
|
||||||
@ -224,7 +222,6 @@ bool idrs(const MatrixType& A, const Rhs& b, Dest& x, const Preconditioner& prec
|
|||||||
if (trueres && normr < normb) {
|
if (trueres && normr < normb) {
|
||||||
r = b - A * x;
|
r = b - A * x;
|
||||||
trueres = false;
|
trueres = false;
|
||||||
replacements++;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Smoothing:
|
// Smoothing:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user