QuantLib: a free/open-source library for quantitative finance
fully annotated source code - version 1.34
Loading...
Searching...
No Matches
fdmblackscholesop.hpp
Go to the documentation of this file.
1/* -*- mode: c++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2
3/*
4 Copyright (C) 2008 Andreas Gaida
5 Copyright (C) 2008, 2009 Ralph Schreyer
6 Copyright (C) 2008, 2009 Klaus Spanderen
7
8 This file is part of QuantLib, a free-software/open-source library
9 for financial quantitative analysts and developers - http://quantlib.org/
10
11 QuantLib is free software: you can redistribute it and/or modify it
12 under the terms of the QuantLib license. You should have received a
13 copy of the license along with this program; if not, please email
14 <quantlib-dev@lists.sf.net>. The license is also available online at
15 <http://quantlib.org/license.shtml>.
16
17 This program is distributed in the hope that it will be useful, but WITHOUT
18 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
19 FOR A PARTICULAR PURPOSE. See the license for more details.
20*/
21
22/*! \file fdmblackscholesop.hpp
23 \brief Black Scholes linear operator
24*/
25
26#ifndef quantlib_fdm_black_scholes_op_hpp
27#define quantlib_fdm_black_scholes_op_hpp
28
29#include <ql/payoff.hpp>
35
36namespace QuantLib {
37
39 public:
41 const ext::shared_ptr<FdmMesher>& mesher,
42 const ext::shared_ptr<GeneralizedBlackScholesProcess>& process,
43 Real strike,
44 bool localVol = false,
45 Real illegalLocalVolOverwrite = -Null<Real>(),
46 Size direction = 0,
47 ext::shared_ptr<FdmQuantoHelper> quantoHelper = ext::shared_ptr<FdmQuantoHelper>());
48
49 Size size() const override;
50 void setTime(Time t1, Time t2) override;
51
52 Array apply(const Array& r) const override;
53 Array apply_mixed(const Array& r) const override;
54 Array apply_direction(Size direction, const Array& r) const override;
55 Array solve_splitting(Size direction, const Array& r, Real s) const override;
56 Array preconditioner(const Array& r, Real s) const override;
57
58 std::vector<SparseMatrix> toMatrixDecomp() const override;
59
60 private:
61 const ext::shared_ptr<FdmMesher> mesher_;
62 const ext::shared_ptr<YieldTermStructure> rTS_, qTS_;
63 const ext::shared_ptr<BlackVolTermStructure> volTS_;
64 const ext::shared_ptr<LocalVolTermStructure> localVol_;
65 const Array x_;
72 const ext::shared_ptr<FdmQuantoHelper> quantoHelper_;
73 };
74}
75
76#endif
Black-Scholes processes.
1-D array used in linear algebra.
Definition: array.hpp:52
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 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_
template class providing a null value for a given type.
Definition: null.hpp:76
composite pattern for linear operators
helper class storing market data needed for the quanto adjustment.
first derivative linear operator
Real Time
continuous quantity with 1-year units
Definition: types.hpp:62
QL_REAL Real
real number
Definition: types.hpp:50
std::size_t Size
size of a container
Definition: types.hpp:58
Definition: any.hpp:35
Option payoff classes.
ext::shared_ptr< YieldTermStructure > r
general triple band linear operator