File: parameter.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 (79 lines) | stat: -rw-r--r-- 2,225 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
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79

/*
 Copyright (C) 2000, 2001, 2002, 2003 RiskMap srl
 Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009 StatPro Italia srl
 Copyright (C) 2016 Gouthaman Balaraman

 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_parameter_i
#define quantlib_parameter_i

%include types.i
%include optimizers.i

%{
using QuantLib::Parameter;
using QuantLib::ConstantParameter;
using QuantLib::NullParameter;
using QuantLib::PiecewiseConstantParameter;
%}

class Parameter {
    #if defined(SWIGCSHARP)
    %rename("parameters") params;
    #endif
  public:
    Parameter();
    const Array& params() const;
    void setParam(Size i, Real x);
    bool testParams(const Array& params) const; 
    Size size() const ;
    Real operator()(Time t) const;
    #ifndef SWIGR
    const Constraint& constraint() const;
    #endif
};

//! Standard constant parameter \f$ a(t) = a \f$
class ConstantParameter : public Parameter {
  public: 
    ConstantParameter(const Constraint& constraint);
    ConstantParameter(Real value, const Constraint& constraint);

};

//! %Parameter which is always zero \f$ a(t) = 0 \f$
class NullParameter : public Parameter {
  public:
    NullParameter();
};

//! Piecewise-constant parameter
/*! \f$ a(t) = a_i if t_{i-1} \geq t < t_i \f$.
    This kind of parameter is usually used to enhance the fitting of a
    model
*/
class PiecewiseConstantParameter : public Parameter {
  public:
     PiecewiseConstantParameter(const std::vector<Time>& times,
                                const Constraint& constraint=QuantLib::NoConstraint());
    
};



#endif