File: forwardcurve.i

package info (click to toggle)
quantlib-swig 1.40-3
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 2,276 kB
  • sloc: python: 6,024; java: 1,552; cs: 774; makefile: 309; sh: 22
file content (61 lines) | stat: -rw-r--r-- 2,407 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61

/*
 Copyright (C) 2005, 2006 StatPro Italia srl

 This file is part of QuantLib, a free-software/open-source library
 for financial quantitative analysts and developers - http://quantlib.org/

 QuantLib is free software: you can redistribute it and/or modify it
 under the terms of the QuantLib license.  You should have received a
 copy of the license along with this program; if not, please email
 <quantlib-dev@lists.sf.net>. The license is also available online at
 <https://www.quantlib.org/license.shtml>.

 This program is distributed in the hope that it will be useful, but WITHOUT
 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
 FOR A PARTICULAR PURPOSE.  See the license for more details.
*/

#ifndef quantlib_forward_curve_i
#define quantlib_forward_curve_i

%include termstructures.i
%include interpolation.i

%{
using QuantLib::InterpolatedForwardCurve;
%}

%shared_ptr(InterpolatedForwardCurve<BackwardFlat>);
%shared_ptr(InterpolatedForwardCurve<ForwardFlat>);
%shared_ptr(InterpolatedForwardCurve<Linear>);
%shared_ptr(InterpolatedForwardCurve<Cubic>);
%shared_ptr(InterpolatedForwardCurve<SplineCubic>);
%shared_ptr(InterpolatedForwardCurve<ParabolicCubic>);
%shared_ptr(InterpolatedForwardCurve<MonotonicParabolicCubic>);


template <class Interpolator>
class InterpolatedForwardCurve : public YieldTermStructure {
  public:
    InterpolatedForwardCurve(const std::vector<Date>& dates,
                             const std::vector<Rate>& forwards,
                             const DayCounter& dayCounter,
                             const Calendar& calendar = Calendar(),
                             const Interpolator& i = Interpolator());
    const std::vector<Date>& dates() const;
    const std::vector<Rate>& forwards() const;
    #if !defined(SWIGR)
    std::vector<std::pair<Date,Rate> > nodes() const;
    #endif
};

%template(ForwardCurve) InterpolatedForwardCurve<BackwardFlat>;
%template(ForwardFlatForwardCurve) InterpolatedForwardCurve<ForwardFlat>;
%template(LinearForwardCurve) InterpolatedForwardCurve<Linear>;
%template(CubicForwardCurve) InterpolatedForwardCurve<Cubic>;
%template(NaturalCubicForwardCurve) InterpolatedForwardCurve<SplineCubic>;
%template(ParabolicCubicForwardCurve) InterpolatedForwardCurve<ParabolicCubic>;
%template(MonotonicParabolicCubicForwardCurve) InterpolatedForwardCurve<MonotonicParabolicCubic>;

#endif