21#include <ql/methods/finitedifferences/meshers/fdmmesher.hpp>
22#include <ql/methods/finitedifferences/operators/fdmlinearoplayout.hpp>
23#include <ql/methods/finitedifferences/operators/secondderivativeop.hpp>
27FdmLgmOp::FdmLgmOp(
const ext::shared_ptr<FdmMesher>& mesher,
const ext::shared_ptr<StochasticProcess1D>& process)
28 : mesher_(mesher), process_(process), dxMap_(FirstDerivativeOp(0, mesher)), dxxMap_(SecondDerivativeOp(0, mesher)),
32 Real v =
process_->variance(t1, 0.0, t2 - t1) / (t2 - t1);
42 return mapT_.apply(r);
44 Array retVal(r.size(), 0.0);
50 Array retVal(r.size(), 0.0);
56 return mapT_.solve_splitting(r, dt, 1.0);
65#if !defined(QL_NO_UBLAS_SUPPORT)
67 std::vector<QuantLib::SparseMatrix> retVal(1,
mapT_.toMatrix());
Size size() const override
Array apply_direction(Size direction, const Array &r) const override
Array preconditioner(const Array &r, Real s) const override
TripleBandLinearOp dxxMap_
std::vector< QuantLib::SparseMatrix > toMatrixDecomp() const override
ext::shared_ptr< StochasticProcess1D > process_
void setTime(Time t1, Time t2) override
FdmLgmOp(const ext::shared_ptr< FdmMesher > &mesher, const ext::shared_ptr< StochasticProcess1D > &process)
Array apply_mixed(const Array &r) const override
Array solve_splitting(Size direction, const Array &r, Real s) const override
Array apply(const Array &r) const override
ext::shared_ptr< FdmMesher > mesher_
finite difference operator LGM model