20#include <ql/math/ode/adaptiverungekutta.hpp>
21#include <ql/methods/finitedifferences/schemes/methodoflinesscheme.hpp>
27 const Real relInitStepSize,
28 ext::shared_ptr<FdmLinearOpComposite> map,
30 : dt_(
Null<
Real>()), eps_(eps), relInitStepSize_(relInitStepSize), map_(
std::move(map)),
35 map_->setTime(t, t + 0.0001);
40 return std::vector<Real>(dxdt.
begin(), dxdt.
end());
44 QL_REQUIRE(t-
dt_ > -1e-8,
"a step towards negative time given");
46 const std::vector<Real> v =
48 [&](
Time _t,
const std::vector<Real>& _u){
return apply(_t, _u); },
49 std::vector<Real>(a.begin(), a.end()),
50 t, std::max(0.0, t-
dt_));
52 Array y(v.begin(), v.end());
1-D array used in linear algebra.
const_iterator end() const
const_iterator begin() const
void applyAfterSolving(array_type &a) const
void applyBeforeApplying(operator_type &op) const
const BoundaryConditionSchemeHelper bcSet_
const ext::shared_ptr< FdmLinearOpComposite > map_
MethodOfLinesScheme(Real eps, Real relInitStepSize, ext::shared_ptr< FdmLinearOpComposite > map, const bc_set &bcSet=bc_set())
traits::array_type array_type
void step(array_type &a, Time t)
const Real relInitStepSize_
std::vector< Real > apply(Time, const std::vector< Real > &) const
template class providing a null value for a given type.
Real Time
continuous quantity with 1-year units