mirror of
https://gitlab.com/libeigen/eigen.git
synced 2024-12-21 07:19:46 +08:00
Improve BiCGSTAB : With exact preconditioner, the solution should be found in one iteration
This commit is contained in:
parent
48c4d48aec
commit
7e0dd17312
@ -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);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user