QuantLib: a free/open-source library for quantitative finance
Fully annotated sources - version 1.32
Loading...
Searching...
No Matches
fdmhestonhullwhiteop.hpp
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 Ralph Schreyer
6 Copyright (C) 2008 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
26#ifndef quantlib_fdm_heston_hull_white_op_hpp
27#define quantlib_fdm_heston_hull_white_op_hpp
28
29#include <ql/processes/hestonprocess.hpp>
30#include <ql/processes/hullwhiteprocess.hpp>
31#include <ql/methods/finitedifferences/operators/fdmhullwhiteop.hpp>
32#include <ql/methods/finitedifferences/operators/firstderivativeop.hpp>
33#include <ql/methods/finitedifferences/operators/triplebandlinearop.hpp>
34#include <ql/methods/finitedifferences/operators/ninepointlinearop.hpp>
35#include <ql/methods/finitedifferences/operators/fdmlinearopcomposite.hpp>
36
37namespace QuantLib {
38
39 class HullWhite;
40
42 public:
43 FdmHestonHullWhiteEquityPart(const ext::shared_ptr<FdmMesher>& mesher,
44 ext::shared_ptr<HullWhite> hwModel,
45 ext::shared_ptr<YieldTermStructure> qTS);
46
47 void setTime(Time t1, Time t2);
48 const TripleBandLinearOp& getMap() const;
49
50 protected:
51 const Array x_;
56
57 const ext::shared_ptr<HullWhite> hwModel_;
58 const ext::shared_ptr<FdmMesher> mesher_;
59 const ext::shared_ptr<YieldTermStructure> qTS_;
60 };
61
63 public:
65 const ext::shared_ptr<FdmMesher>& mesher,
66 const ext::shared_ptr<HestonProcess>& hestonProcess,
67 const ext::shared_ptr<HullWhiteProcess>& hwProcess,
68 Real equityShortRateCorrelation);
69
70 Size size() const override;
71 void setTime(Time t1, Time t2) override;
72
73 Array apply(const Array& r) const override;
74 Array apply_mixed(const Array& r) const override;
75
76 Array apply_direction(Size direction, const Array& r) const override;
77 Array solve_splitting(Size direction, const Array& r, Real s) const override;
78 Array preconditioner(const Array& r, Real s) const override;
79
80 std::vector<SparseMatrix> toMatrixDecomp() const override;
81
82 private:
84 const ext::shared_ptr<HullWhite> hwModel_;
85
91 };
92}
93
94#endif
1-D array used in linear algebra.
Definition: array.hpp:52
const ext::shared_ptr< HullWhite > hwModel_
const TripleBandLinearOp & getMap() const
const ext::shared_ptr< YieldTermStructure > qTS_
const ext::shared_ptr< FdmMesher > mesher_
const ext::shared_ptr< HullWhite > hwModel_
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
void setTime(Time t1, Time t2) override
Time is required.
Array apply_mixed(const Array &r) const override
Array solve_splitting(Size direction, const Array &r, Real s) const override
FdmHestonHullWhiteEquityPart dxMap_
Array apply(const Array &r) const override
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