34 : dt_(
Null<
Real>()), iterations_(ext::make_shared<
Size>(0U)), relTol_(relTol),
35 map_(
std::move(map)), bcSet_(bcSet), solverType_(solverType) {}
52 if (
map_->size() == 1) {
56 auto preconditioner = [&](
const Array& _a){
return map_->preconditioner(_a, -
theta*
dt_); };
73 (*iterations_) += result.
errors.size();
77 QL_FAIL(
"unknown/illegal solver type");
Biconjugate gradient stabilized method.
1-D array used in linear algebra.
BiCGStabResult solve(const Array &b, const Array &x0=Array()) const
void applyAfterSolving(array_type &a) const
void setTime(Time t) const
void applyBeforeSolving(operator_type &op, array_type &a) const
GMRESResult solve(const Array &b, const Array &x0=Array()) const
ext::shared_ptr< Size > iterations_
ImplicitEulerScheme(ext::shared_ptr< FdmLinearOpComposite > map, const bc_set &bcSet=bc_set(), Real relTol=1e-8, SolverType solverType=BiCGstab)
const SolverType solverType_
const BoundaryConditionSchemeHelper bcSet_
const ext::shared_ptr< FdmLinearOpComposite > map_
traits::array_type array_type
Array apply(const Array &r, Real theta) const
Size numberOfIterations() const
void step(array_type &a, Time t)
template class providing a null value for a given type.
#define QL_REQUIRE(condition, message)
throw an error if the given pre-condition is not verified
#define QL_FAIL(message)
throw an error (possibly with file and line information)
Maps function, bind and cref to either the boost or std implementation.
generalized minimal residual method
Real Time
continuous quantity with 1-year units
std::size_t Size
size of a container
ext::shared_ptr< YieldTermStructure > r