forked from lballabio/QuantLib-SWIG
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathql.i
192 lines (173 loc) · 5.04 KB
/
ql.i
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
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
/*
Copyright (C) 2000, 2001, 2002, 2003 RiskMap srl
Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008 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
<[email protected]>. The license is also available online at
<http://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.
*/
// Undefine symbols that are also used in quantlib
#if defined(SWIGPYTHON)
%{
#ifdef barrier
#undef barrier
#endif
%}
#endif
%{
#include <ql/quantlib.hpp>
#if QL_HEX_VERSION < 0x01290000
#error using an old version of QuantLib, please update
#endif
#if defined (SWIGJAVA) || defined (SWIGCSHARP)
#ifndef QL_ENABLE_THREAD_SAFE_OBSERVER_PATTERN
#ifdef BOOST_MSVC
#pragma message(\
"Quantlib has not been compiled with the thread-safe " \
"observer pattern being enabled. This can lead to spurious " \
"crashes or pure virtual function calls within the JVM or .NET " \
"ecosystem due to the async garbage collector. Please consider " \
"enabling QL_ENABLE_THREAD_SAFE_OBSERVER_PATTERN " \
"in ql/userconfig.hpp.")
#else
#warning \
Quantlib has not been compiled with the thread-safe \
observer pattern being enabled. This can lead to spurious \
crashes or pure virtual function calls within the JVM or .NET \
ecosystem due to the async garbage collector. Please consider \
passing --enable-thread-safe-observer-pattern when using the \
GNU autoconf configure script.
#endif
#endif
#endif
// add here SWIG version check
#if defined(_MSC_VER) // Microsoft Visual C++ 6.0
// disable Swig-dependent warnings
// 'identifier1' has C-linkage specified,
// but returns UDT 'identifier2' which is incompatible with C
#pragma warning(disable: 4190)
// 'int' : forcing value to bool 'true' or 'false' (performance warning)
#pragma warning(disable: 4800)
// debug info too long etc etc
#pragma warning(disable: 4786)
#endif
%}
#ifdef SWIGJAVA
%include "enumtypesafe.swg"
#endif
// common name mappings
#if defined(SWIGJAVA)
%rename(add) operator+;
%rename(add) __add__;
%rename(subtract) operator-;
%rename(subtract) __sub__;
%rename(multiply) operator*;
%rename(multiply) __mul__;
%rename(divide) operator/;
%rename(divide) __div__;
%rename(getValue) operator();
%rename(equals) __eq__;
%rename(unEquals) __ne__;
%rename(toString) __str__;
#elif defined(SWIGCSHARP)
%rename(Add) operator+;
%rename(Add) __add__;
%rename(Subtract) operator-;
%rename(Subtract) __sub__;
%rename(Multiply) operator*;
%rename(Multiply) __mul__;
%rename(Divide) operator/;
%rename(Divide) __div__;
#endif
%{
// we do not want to see the deprecated warnings here
QL_DEPRECATED_DISABLE_WARNING
%}
%include common.i
%include vectors.i
%include tuple.i
%include asianoptions.i
%include barrieroptions.i
%include basketoptions.i
%include blackformula.i
%include bonds.i
%include bondfunctions.i
%include calendars.i
%include calibratedmodel.i
%include calibrationhelpers.i
%include capfloor.i
%include cashflows.i
%include cliquetoptions.i
%include convertiblebonds.i
%include credit.i
%include creditdefaultswap.i
%include currencies.i
%include date.i
%include daycounters.i
%include defaultprobability.i
%include discountcurve.i
%include distributions.i
%include dividends.i
%include exchangerates.i
%include exercise.i
%include fdm.i
%include fittedbondcurve.i
%include forward.i
%include forwardcurve.i
%include fra.i
%include functions.i
%include futures.i
%include gaussian1dmodel.i
%include grid.i
%include indexes.i
%include inflation.i
%include instruments.i
%include integrals.i
%include interestrate.i
%include interpolation.i
%include lazyobject.i
%include linearalgebra.i
%include localvolatilities.i
%include lmm.i
%include lookbackoptions.i
%include marketelements.i
%include money.i
%include montecarlo.i
%include null.i
%include observer.i
%include ode.i
%include operators.i
%include optimizers.i
%include parameter.i
%include options.i
%include payoffs.i
%include piecewiseyieldcurve.i
%include randomnumbers.i
%include ratehelpers.i
%include rounding.i
%include sampledcurve.i
%include scheduler.i
%include settings.i
%include shortratemodels.i
%include slv.i
%include spreadoption.i
%include statistics.i
%include stochasticprocess.i
%include swap.i
%include swaption.i
%include swingoption.i
%include termstructures.i
%include timebasket.i
%include timeseries.i
%include tracing.i
%include types.i
%include volatilities.i
%include volatilitymodels.i
%include zerocurve.i
%include old_volatility.i