QuantLib: a free/open-source library for quantitative finance
fully annotated source code - version 1.38
Loading...
Searching...
No Matches
fdmwienerop.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) 2024 Klaus Spanderen
5
6 This file is part of QuantLib, a free-software/open-source library
7 for financial quantitative analysts and developers - http://quantlib.org/
8
9 QuantLib is free software: you can redistribute it and/or modify it
10 under the terms of the QuantLib license. You should have received a
11 copy of the license along with this program; if not, please email
12 <quantlib-dev@lists.sf.net>. The license is also available online at
13 <http://quantlib.org/license.shtml>.
14
15 This program is distributed in the hope that it will be useful, but WITHOUT
16 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
17 FOR A PARTICULAR PURPOSE. See the license for more details.
18*/
19
20
21/*! \file fdmwienerop.hpp
22*/
23
24#ifndef quantlib_fdm_wiener_op_hpp
25#define quantlib_fdm_wiener_op_hpp
26
28
29namespace QuantLib {
30
31 class FdmMesher;
32 class YieldTermStructure;
33 class TripleBandLinearOp;
34
36 public:
38 const ext::shared_ptr<FdmMesher>& mesher,
39 ext::shared_ptr<YieldTermStructure> rTS,
40 const Array& lambdas);
41
42 Size size() const override;
43 void setTime(Time t1, Time t2) override;
44 Array apply(const Array& x) const override;
45 Array apply_mixed(const Array& x) const override;
46
47 Array apply_direction(Size direction, const Array& x) const override;
48
49 Array solve_splitting(Size direction, const Array& x, Real s) const override;
50 Array preconditioner(const Array& r, Real s) const override;
51
52 std::vector<SparseMatrix> toMatrixDecomp() const override;
53
54 private:
55 const ext::shared_ptr<YieldTermStructure> rTS_;
56 std::vector<ext::shared_ptr<TripleBandLinearOp> > ops_;
57 Rate r_ = 0.0;
58 };
59}
60#endif
1-D array used in linear algebra.
Definition: array.hpp:52
Array solve_splitting(Size direction, const Array &x, Real s) const override
Definition: fdmwienerop.cpp:75
Size size() const override
Definition: fdmwienerop.cpp:50
Array preconditioner(const Array &r, Real s) const override
Definition: fdmwienerop.cpp:81
std::vector< SparseMatrix > toMatrixDecomp() const override
Definition: fdmwienerop.cpp:85
Array apply_mixed(const Array &x) const override
Definition: fdmwienerop.cpp:67
void setTime(Time t1, Time t2) override
Time is required.
Definition: fdmwienerop.cpp:54
std::vector< ext::shared_ptr< TripleBandLinearOp > > ops_
Definition: fdmwienerop.hpp:56
Array apply(const Array &x) const override
Definition: fdmwienerop.cpp:59
Array apply_direction(Size direction, const Array &x) const override
Definition: fdmwienerop.cpp:71
const ext::shared_ptr< YieldTermStructure > rTS_
Definition: fdmwienerop.hpp:55
composite pattern for linear operators
Real Time
continuous quantity with 1-year units
Definition: types.hpp:62
QL_REAL Real
real number
Definition: types.hpp:50
Real Rate
interest rates
Definition: types.hpp:70
std::size_t Size
size of a container
Definition: types.hpp:58
Definition: any.hpp:37
ext::shared_ptr< YieldTermStructure > r