QuantLib: a free/open-source library for quantitative finance
Fully annotated sources - version 1.32
Loading...
Searching...
No Matches
fdmaffinemodelswapinnervalue.cpp
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
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
27namespace QuantLib {
28
29 template <>
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 <>
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}
1-D array used in linear algebra.
Definition: array.hpp:52
Array getState(const ext::shared_ptr< ModelType > &model, Time t, const FdmLinearOpIterator &iter) const
Real Time
continuous quantity with 1-year units
Definition: types.hpp:62
Definition: any.hpp:35