aboutsummaryrefslogtreecommitdiffhomepage
path: root/Eigen
diff options
context:
space:
mode:
authorGravatar Desire NUENTSA <desire.nuentsa_wakam@inria.fr>2012-09-19 18:32:02 +0200
committerGravatar Desire NUENTSA <desire.nuentsa_wakam@inria.fr>2012-09-19 18:32:02 +0200
commit7e0dd173120434e7c7cbb45b018e98d477baaa33 (patch)
treed67ac867ab3162e7439e28e9190fa73f8778c425 /Eigen
parent48c4d48aec7b8aac992aabe265e7153e8a36c0bd (diff)
Improve BiCGSTAB : With exact preconditioner, the solution should be found in one iteration
Diffstat (limited to 'Eigen')
-rw-r--r--Eigen/src/IterativeLinearSolvers/BiCGSTAB.h6
1 files changed, 4 insertions, 2 deletions
diff --git a/Eigen/src/IterativeLinearSolvers/BiCGSTAB.h b/Eigen/src/IterativeLinearSolvers/BiCGSTAB.h
index 126341be8..5a822e0ea 100644
--- a/Eigen/src/IterativeLinearSolvers/BiCGSTAB.h
+++ b/Eigen/src/IterativeLinearSolvers/BiCGSTAB.h
@@ -39,10 +39,11 @@ bool bicgstab(const MatrixType& mat, const Rhs& rhs, Dest& x,
int maxIters = iters;
int n = mat.cols();
+ x = precond.solve(x);
VectorType r = rhs - mat * x;
VectorType r0 = r;
- RealScalar r0_sqnorm = r0.squaredNorm();
+ RealScalar r0_sqnorm = rhs.squaredNorm();
Scalar rho = 1;
Scalar alpha = 1;
Scalar w = 1;
@@ -223,7 +224,8 @@ public:
template<typename Rhs,typename Dest>
void _solve(const Rhs& b, Dest& x) const
{
- x.setZero();
+// x.setZero();
+ x = b;
_solveWithGuess(b,x);
}