QuantLib
: a free/open-source library for quantitative finance
fully annotated source code - version 1.34
Loading...
Searching...
No Matches
ql
methods
finitedifferences
utilities
fdmaffinemodelswapinnervalue.cpp
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) 2011 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
/*! \file FdmAffineModelswapinnervalue.cpp
21
*/
22
23
#include <
ql/models/shortrate/twofactormodels/g2.hpp
>
24
#include <
ql/models/shortrate/onefactormodels/hullwhite.hpp
>
25
#include <
ql/methods/finitedifferences/utilities/fdmaffinemodelswapinnervalue.hpp
>
26
27
namespace
QuantLib
{
28
29
template
<>
30
Array
FdmAffineModelSwapInnerValue<HullWhite>::getState
(
31
const
ext::shared_ptr<HullWhite>& model,
Time
t
,
32
const
FdmLinearOpIterator
& iter)
const
{
33
34
return
{ model->dynamics()->shortRate(
t
,
mesher_
->location(iter,
direction_
)) };
35
}
36
37
template
<>
38
Array
FdmAffineModelSwapInnerValue<G2>::getState
(
39
const
ext::shared_ptr<G2>&,
Time
,
40
const
FdmLinearOpIterator
& iter)
const
{
41
42
return
{
43
mesher_
->location(iter,
direction_
),
44
mesher_
->location(iter,
direction_
+1)
45
};
46
}
47
48
}
QuantLib::Array
1-D array used in linear algebra.
Definition:
array.hpp:52
QuantLib::FdmAffineModelSwapInnerValue::getState
Array getState(const ext::shared_ptr< ModelType > &model, Time t, const FdmLinearOpIterator &iter) const
QuantLib::FdmLinearOpIterator
Definition:
fdmlinearopiterator.hpp:36
t
const DefaultType & t
Definition:
defaultprobabilitykey.cpp:39
fdmaffinemodelswapinnervalue.hpp
mesher_
const ext::shared_ptr< FdmMesher > mesher_
Definition:
fdornsteinuhlenbeckvanillaengine.cpp:55
direction_
const Size direction_
Definition:
fdornsteinuhlenbeckvanillaengine.cpp:56
g2.hpp
Two-factor additive Gaussian Model G2++.
QuantLib::Time
Real Time
continuous quantity with 1-year units
Definition:
types.hpp:62
hullwhite.hpp
Hull & White (HW) model.
QuantLib
Definition:
any.hpp:35
Generated by
Doxygen
1.9.5