QuantLib: a free/open-source library for quantitative finance
Fully annotated sources - version 1.32
Loading...
Searching...
No Matches
lmmdriftcalculator.hpp
1/* -*- mode: c++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2
3/*
4 Copyright (C) 2006, 2007 Mark Joshi
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
24#ifndef quantlib_lmm_drift_calculator_hpp
25#define quantlib_lmm_drift_calculator_hpp
26
27#include <ql/math/matrix.hpp>
28#include <vector>
29
30namespace QuantLib {
31
32 class LMMCurveState;
33
35
41 public:
42 LMMDriftCalculator(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 LMMCurveState& cs,
49 std::vector<Real>& drifts) const;
50 void compute(const std::vector<Rate>& fwds,
51 std::vector<Real>& drifts) const;
52
55 void computePlain(const LMMCurveState& cs,
56 std::vector<Real>& drifts) const;
57 void computePlain(const std::vector<Rate>& fwds,
58 std::vector<Real>& drifts) const;
59
62 void computeReduced(const LMMCurveState& cs,
63 std::vector<Real>& drifts) const;
64 void computeReduced(const std::vector<Rate>& fwds,
65 std::vector<Real>& drifts) const;
66
67 private:
71 std::vector<Spread> displacements_;
72 std::vector<Real> oneOverTaus_;
74 // temporary variables to be added later
75 mutable std::vector<Real> tmp_;
76 mutable Matrix e_;
77 std::vector<Size> downs_, ups_;
78 };
79
80}
81
82#endif
Curve state for Libor market models
Drift computation for log-normal Libor market models.
std::vector< Spread > displacements_
void computePlain(const LMMCurveState &cs, std::vector< Real > &drifts) const
void compute(const LMMCurveState &cs, std::vector< Real > &drifts) const
Computes the drifts.
void computeReduced(const LMMCurveState &cs, std::vector< Real > &drifts) const
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