From edbebb14de25a61769da6c2b76e2eed18eae79d1 Mon Sep 17 00:00:00 2001 From: Desire NUENTSA Date: Fri, 10 Feb 2012 18:57:01 +0100 Subject: Split the computation of the ILUT into two steps --- Eigen/src/IterativeLinearSolvers/BiCGSTAB.h | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) (limited to 'Eigen/src/IterativeLinearSolvers/BiCGSTAB.h') diff --git a/Eigen/src/IterativeLinearSolvers/BiCGSTAB.h b/Eigen/src/IterativeLinearSolvers/BiCGSTAB.h index c0a9b120d..d813ea8f5 100644 --- a/Eigen/src/IterativeLinearSolvers/BiCGSTAB.h +++ b/Eigen/src/IterativeLinearSolvers/BiCGSTAB.h @@ -35,9 +35,10 @@ namespace internal { * approximation of Ax=b (regardless of b) * \param iters On input the max number of iteration, on output the number of performed iterations. * \param tol_error On input the tolerance error, on output an estimation of the relative error. + * \return false in the case of numerical issue, for example a break down of BiCGSTAB. */ template -void bicgstab(const MatrixType& mat, const Rhs& rhs, Dest& x, +bool bicgstab(const MatrixType& mat, const Rhs& rhs, Dest& x, const Preconditioner& precond, int& iters, typename Dest::RealScalar& tol_error) { @@ -46,7 +47,6 @@ void bicgstab(const MatrixType& mat, const Rhs& rhs, Dest& x, typedef typename Dest::RealScalar RealScalar; typedef typename Dest::Scalar Scalar; typedef Matrix VectorType; - RealScalar tol = tol_error; int maxIters = iters; @@ -70,10 +70,11 @@ void bicgstab(const MatrixType& mat, const Rhs& rhs, Dest& x, while ( r.squaredNorm()/r0_sqnorm > tol2 && i void _solveWithGuess(const Rhs& b, Dest& x) const { + bool ok; for(int j=0; j