35 const ext::shared_ptr<FdmMesher>& mesher,
36 const ext::shared_ptr<G2>& model,
38 : direction1_(direction1),
39 direction2_(direction2),
40 x_(mesher->locations(direction1)),
41 y_(mesher->locations(direction2)),
45 *
Array(mesher->layout()->size(), 1.0)))),
48 .mult(0.5*model->eta()*model->eta()
49 *
Array(mesher->layout()->size(), 1.0)))),
51 .mult(
Array(mesher->layout()->size(),
52 model->
rho()*model->
sigma()*model->eta()))),
53 mapX_(direction1, mesher),
54 mapY_(direction2, mesher),
62 const ext::shared_ptr<TwoFactorModel::ShortRateDynamics> dynamics =
65 const Real phi = 0.5*( dynamics->shortRate(t1, 0.0, 0.0)
66 + dynamics->shortRate(t2, 0.0, 0.0));
89 return Array(
r.size(), 0.0);
101 return Array(
r.size(), 0.0);
1-D array used in linear algebra.
Size size() const override
const TripleBandLinearOp dxMap_
Array apply_direction(Size direction, const Array &r) const override
Array preconditioner(const Array &r, Real s) const override
std::vector< SparseMatrix > toMatrixDecomp() const override
const TripleBandLinearOp dyMap_
void setTime(Time t1, Time t2) override
Time is required.
Array apply_mixed(const Array &r) const override
FdmG2Op(const ext::shared_ptr< FdmMesher > &mesher, const ext::shared_ptr< G2 > &model, Size direction1, Size direction2)
Array solve_splitting(Size direction, const Array &r, Real s) const override
NinePointLinearOp corrMap_
Array apply(const Array &r) const override
const ext::shared_ptr< G2 > model_
SparseMatrix toMatrix() const override
Array apply(const Array &r) const override
SparseMatrix toMatrix() const override
Array solve_splitting(const Array &r, Real a, Real b=1.0) const
void axpyb(const Array &a, const TripleBandLinearOp &x, const TripleBandLinearOp &y, const Array &b)
Array apply(const Array &r) const override
ext::function< Real(Real)> b
memory layout of a fdm linear operator
first derivative linear operator
Two-factor additive Gaussian Model G2++.
Real Time
continuous quantity with 1-year units
std::size_t Size
size of a container
ext::shared_ptr< YieldTermStructure > r
second derivative operator
second order mixed derivative linear operator