QuantLib: a free/open-source library for quantitative finance
Fully annotated sources - version 1.32
Loading...
Searching...
No Matches
lmmnormaldriftcalculator.hpp
1/* -*- mode: c++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2
3/*
4 Copyright (C) 2007 Giorgio Facchinetti
5 Copyright (C) 2007 Chiara Fornarola
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_lmm_normal_drift_calculator_hpp
26#define quantlib_lmm_normal_drift_calculator_hpp
27
28#include <ql/math/matrix.hpp>
29#include <ql/models/marketmodels/curvestates/lmmcurvestate.hpp>
30#include <vector>
31
32namespace QuantLib {
33
35
41 public:
42 LMMNormalDriftCalculator(const Matrix& pseudo,
43 const std::vector<Time>& taus,
44 Size numeraire,
45 Size alive);
47 void compute(const LMMCurveState& cs,
48 std::vector<Real>& drifts) const;
49 void compute(const std::vector<Rate>& fwds,
50 std::vector<Real>& drifts) const;
51
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
63 void computeReduced(const LMMCurveState& cs,
64 std::vector<Real>& drifts) const;
65 void computeReduced(const std::vector<Rate>& fwds,
66 std::vector<Real>& drifts) const;
67
68
69 private:
73 std::vector<Real> oneOverTaus_;
75 // temporary variables to be added later
76 mutable std::vector<Real> tmp_;
77 mutable Matrix e_;
78 std::vector<Size> downs_, ups_;
79 };
80
81}
82
83#endif
Curve state for Libor market models
Drift computation for normal Libor market models.
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