QuantLib: a free/open-source library for quantitative finance
Fully annotated sources - version 1.32
Loading...
Searching...
No Matches
fwdperiodadapter.hpp
1/* -*- mode: c++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2
3/*
4 Copyright (C) 2006 Ferdinando Ametrano
5 Copyright (C) 2006 Mark Joshi
6 Copyright (C) 2007 StatPro Italia srl
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#ifndef quantlib_forward_period_adapter_hpp
23#define quantlib_forward_period_adapter_hpp
24
25#include <ql/models/marketmodels/marketmodel.hpp>
26#include <ql/models/marketmodels/evolutiondescription.hpp>
27
28namespace QuantLib {
29
30
32 public:
33 FwdPeriodAdapter(const ext::shared_ptr<MarketModel>& largeModel,
34 Size period,
35 Size offset,
36 std::vector<Spread> newDisplacements_);
38
39 const std::vector<Rate>& initialRates() const override;
40 const std::vector<Spread>& displacements() const override;
41 const EvolutionDescription& evolution() const override;
42 Size numberOfRates() const override;
43 Size numberOfFactors() const override;
44 Size numberOfSteps() const override;
45 const Matrix& pseudoRoot(Size i) const override;
47 private:
50 std::vector<Rate> initialRates_;
51 std::vector<Matrix> pseudoRoots_;
52 std::vector<Spread> displacements_;
53 };
54
55
56
57
58 // inline definitions
59
60 inline const std::vector<Rate>&
62 return initialRates_;
63 }
64
65 inline const std::vector<Spread>&
67 return displacements_;
68 }
69
70 inline const EvolutionDescription&
72 return evolution_;
73 }
74
76 return numberOfRates_;
77 }
78
80 return numberOfFactors_;
81 }
82
84 return numberOfSteps_;
85 }
86
87 inline const Matrix& FwdPeriodAdapter::pseudoRoot(Size i) const {
88 return pseudoRoots_[i];
89 }
90
91}
92
93#endif
Market-model evolution description.
const std::vector< Spread > & displacements() const override
std::vector< Spread > displacements_
const std::vector< Rate > & initialRates() const override
std::vector< Matrix > pseudoRoots_
const Matrix & pseudoRoot(Size i) const override
std::vector< Rate > initialRates_
const EvolutionDescription & evolution() const override
EvolutionDescription evolution_
Size numberOfFactors() const override
Size numberOfRates() const override
Size numberOfSteps() const override
base class for market models
Definition: marketmodel.hpp:39
Matrix used in linear algebra.
Definition: matrix.hpp:41
std::size_t Size
size of a container
Definition: types.hpp:58
Definition: any.hpp:35