1 /* -*- mode: c++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 
3 /*
4 Copyright (C) 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 
20 /*! \file forwardforwardmappings.hpp
21 \brief Utility functions for mapping between forward rates of varying tenor
22 */
23 
24 #ifndef quantlib_forward_forward_mappings_hpp
25 #define quantlib_forward_forward_mappings_hpp
26 
27 #include <ql/math/matrix.hpp>
28 
29 namespace QuantLib {
30 
31     class CurveState;
32     class LMMCurveState;
33 
34     namespace ForwardForwardMappings
35         {
36             /*! Returns the dg[i]/df[j] jacobian between
37             forward rates with tenor multipler and forward rates with tenor 1*/
38             Disposable<Matrix>
39                 ForwardForwardJacobian(const CurveState& cs,
40                                        Size multiplier,
41                                        Size offset);
42 
43             /*! Returns the Y matrix to switch base
44             forward rates with tenor multipler and forward rates with tenor 1*/
45 
46             Disposable<Matrix>
47                 YMatrix(const CurveState& cs,
48                 const std::vector<Spread>& shortDisplacements,
49                 const std::vector<Spread>& longDisplacements,
50                 Size Multiplier,
51                 Size offset
52                 );
53 
54             /*!
55             replaces curve state with curve state based on periodic subset of times
56 
57             */
58             LMMCurveState
59                 RestrictCurveState(const CurveState& cs,
60                                  Size multiplier,
61                                  Size offSet
62                                 );
63 
64         }
65 
66     }
67 
68 #endif
69