33 const ext::shared_ptr<FdmMesher>& mesher,
34 const ext::shared_ptr<GeneralizedBlackScholesProcess>& bsProcess,
37 Real illegalLocalVolOverwrite,
39 ext::shared_ptr<FdmQuantoHelper> quantoHelper)
40 :
mesher_(mesher),
rTS_(bsProcess->riskFreeRate().currentLink()),
41 qTS_(bsProcess->dividendYield().currentLink()),
42 volTS_(bsProcess->blackVolatility().currentLink()),
43 localVol_((localVol) ? bsProcess->localVolatility().currentLink() :
47 mapT_(direction, mesher),
strike_(strike),
48 illegalLocalVolOverwrite_(illegalLocalVolOverwrite),
direction_(direction),
49 quantoHelper_(
std::move(quantoHelper)) {}
57 for (
const auto& iter : *
mesher_->layout()) {
58 const Size i = iter.index();
88 Array(1, std::sqrt(
v)), t1, t2),
111 return Array(
r.size(), 0.0);
116 return Array(
r.size(), 0.0);
const Handle< BlackVolTermStructure > volTS_
1-D array used in linear algebra.
Size size() const override
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
FdmBlackScholesOp(const ext::shared_ptr< FdmMesher > &mesher, const ext::shared_ptr< GeneralizedBlackScholesProcess > &process, Real strike, bool localVol=false, Real illegalLocalVolOverwrite=-Null< Real >(), Size direction=0, ext::shared_ptr< FdmQuantoHelper > quantoHelper=ext::shared_ptr< FdmQuantoHelper >())
const TripleBandLinearOp dxxMap_
const ext::shared_ptr< FdmQuantoHelper > quantoHelper_
void setTime(Time t1, Time t2) override
Time is required.
Array apply_mixed(const Array &r) const override
const ext::shared_ptr< YieldTermStructure > qTS_
const FirstDerivativeOp dxMap_
const ext::shared_ptr< FdmMesher > mesher_
Array solve_splitting(Size direction, const Array &r, Real s) const override
const ext::shared_ptr< YieldTermStructure > rTS_
const ext::shared_ptr< BlackVolTermStructure > volTS_
Array apply(const Array &r) const override
const ext::shared_ptr< LocalVolTermStructure > localVol_
const Real illegalLocalVolOverwrite_
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)
TripleBandLinearOp mult(const Array &u) const
Array apply(const Array &r) const override
Black Scholes linear operator.
const ext::shared_ptr< YieldTermStructure > rTS_
memory layout of a fdm linear operator
const ext::shared_ptr< FdmMesher > mesher_
Real Time
continuous quantity with 1-year units
std::size_t Size
size of a container
functionals and combinators not included in the STL
Array Exp(const Array &v)
Array Sqrt(const Array &v)
Payoffs for various options.
ext::shared_ptr< YieldTermStructure > q
ext::shared_ptr< YieldTermStructure > r
ext::shared_ptr< BlackVolTermStructure > v
second derivative operator