QuantLib: a free/open-source library for quantitative finance
Fully annotated sources - version 1.32
Loading...
Searching...
No Matches
smmdriftcalculator.hpp
1/* -*- mode: c++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2
3/*
4 Copyright (C) 2007 Ferdinando Ametrano
5 Copyright (C) 2007 Mark Joshi
6
7 This file is part of QuantLib, a free-software/open-source library
8 for financial quantitative analysts and developers - http://quantlib.org/
9
10 QuantLib is free software: you can redistribute it and/or modify it
11 under the terms of the QuantLib license. You should have received a
12 copy of the license along with this program; if not, please email
13 <quantlib-dev@lists.sf.net>. The license is also available online at
14 <http://quantlib.org/license.shtml>.
15
16 This program is distributed in the hope that it will be useful, but WITHOUT
17 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
18 FOR A PARTICULAR PURPOSE. See the license for more details.
19*/
20
25#ifndef quantlib_smm_drift_calculator_hpp
26#define quantlib_smm_drift_calculator_hpp
27
28#include <ql/math/matrix.hpp>
29#include <vector>
30
31namespace QuantLib {
32
33 class CoterminalSwapCurveState;
34
36
41 public:
42 SMMDriftCalculator(const Matrix& pseudo,
43 const std::vector<Spread>& displacements,
44 const std::vector<Time>& taus,
45 Size numeraire,
46 Size alive);
48 void compute(const CoterminalSwapCurveState& cs,
49 std::vector<Real>& drifts) const;
50 private:
53 std::vector<Spread> displacements_;
54 std::vector<Real> oneOverTaus_;
56 // temporary variables to be added later
57 mutable std::vector<Real> tmp_;
58 mutable Matrix wkaj_; // < W(k) | A(j)/P(n) >
59 mutable Matrix wkpj_; // < W(k) | P(j)/P(n) >
61 };
62
63}
64
65#endif
Curve state for coterminal-swap market models
Matrix used in linear algebra.
Definition: matrix.hpp:41
Drift computation for coterminal swap market models.
std::vector< Spread > displacements_
void compute(const CoterminalSwapCurveState &cs, std::vector< Real > &drifts) const
Computes the drifts.
std::size_t Size
size of a container
Definition: types.hpp:58
Definition: any.hpp:35