QuantLib: a free/open-source library for quantitative finance
Fully annotated sources - version 1.32
Loading...
Searching...
No Matches
cmsmmdriftcalculator.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 François du Vignaud
6 Copyright (C) 2007 Mark Joshi
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
26#ifndef quantlib_cms_drift_calculator_hpp
27#define quantlib_cms_drift_calculator_hpp
28
29#include <ql/math/matrix.hpp>
30#include <vector>
31
32namespace QuantLib {
33
34 class CMSwapCurveState;
35
37
43 public:
44 CMSMMDriftCalculator(const Matrix& pseudo,
45 const std::vector<Spread>& displacements,
46 const std::vector<Time>& taus,
47 Size numeraire,
48 Size alive,
49 Size spanningFwds);
51 void compute(const CMSwapCurveState& cs,
52 std::vector<Real>& drifts) const;
53 private:
56 std::vector<Spread> displacements_;
57 std::vector<Real> oneOverTaus_;
59 // temporary variables to be added later
60 mutable std::vector<Real> tmp_;
61 mutable Matrix PjPnWk_; // < Wk, P_{j}/P_n> (k, j)
62 mutable Matrix wkaj_; // < Wk , Aj/Pn> (k, j)
63 mutable Matrix wkajN_; // < Wk , Aj/PN> (k, j)
64
65 std::vector<Size> downs_, ups_;
67 };
68
69}
70
71#endif
Drift computation for CMS market models.
void compute(const CMSwapCurveState &cs, std::vector< Real > &drifts) const
Computes the drifts.
Curve state for constant-maturity-swap market models
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