35 : A_(
std::move(A)), M_(
std::move(preConditioner)), maxIter_(maxIter), relTol_(relTol) {}
55 for (i=0; i < maxIter_ && error >=
relTol_; ++i) {
57 if (
rho == 0.0 || omega == 0.0)
62 p =
r +
beta * (p - omega *
v);
67 pTld = (!
M_ ? p :
M_(p));
81 x +=
alpha*pTld + omega*sTld;
Biconjugate gradient stabilized method.
1-D array used in linear algebra.
bool empty() const
whether the array is empty
BiCGStabResult solve(const Array &b, const Array &x0=Array()) const
ext::function< Array(const Array &)> MatrixMult
BiCGstab(MatrixMult A, Size maxIter, Real relTol, MatrixMult preConditioner=MatrixMult())
#define QL_REQUIRE(condition, message)
throw an error if the given pre-condition is not verified
ext::function< Real(Real)> b
std::size_t Size
size of a container
Real Norm2(const Array &v)
Real DotProduct(const Array &v1, const Array &v2)
ext::shared_ptr< YieldTermStructure > r
ext::shared_ptr< BlackVolTermStructure > v