mirror of
https://gitlab.com/libeigen/eigen.git
synced 2025-07-26 14:54:30 +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 maxIters = iters;
|
||||||
|
|
||||||
int n = mat.cols();
|
int n = mat.cols();
|
||||||
|
x = precond.solve(x);
|
||||||
VectorType r = rhs - mat * x;
|
VectorType r = rhs - mat * x;
|
||||||
VectorType r0 = r;
|
VectorType r0 = r;
|
||||||
|
|
||||||
RealScalar r0_sqnorm = r0.squaredNorm();
|
RealScalar r0_sqnorm = rhs.squaredNorm();
|
||||||
Scalar rho = 1;
|
Scalar rho = 1;
|
||||||
Scalar alpha = 1;
|
Scalar alpha = 1;
|
||||||
Scalar w = 1;
|
Scalar w = 1;
|
||||||
@ -223,7 +224,8 @@ public:
|
|||||||
template<typename Rhs,typename Dest>
|
template<typename Rhs,typename Dest>
|
||||||
void _solve(const Rhs& b, Dest& x) const
|
void _solve(const Rhs& b, Dest& x) const
|
||||||
{
|
{
|
||||||
x.setZero();
|
// x.setZero();
|
||||||
|
x = b;
|
||||||
_solveWithGuess(b,x);
|
_solveWithGuess(b,x);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user