forked from lballabio/QuantLib-SWIG
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathql.i
219 lines (196 loc) · 5.38 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
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
/*
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
#if defined(SWIGRUBY)
%{
#ifdef accept
#undef accept
#endif
#ifdef close
#undef close
#endif
#ifdef times
#undef times
#endif
#ifdef Sleep
#undef Sleep
#endif
#ifdef bind
#undef bind
#endif
#ifdef ALLOC
#undef ALLOC
#endif
%}
#endif
%{
#include <ql/quantlib.hpp>
#if QL_HEX_VERSION < 0x011500f0
#error using an old version of QuantLib, please update
#endif
#ifdef BOOST_MSVC
#ifdef QL_ENABLE_THREAD_SAFE_OBSERVER_PATTERN
#define BOOST_LIB_NAME boost_thread
#include <boost/config/auto_link.hpp>
#undef BOOST_LIB_NAME
#define BOOST_LIB_NAME boost_system
#include <boost/config/auto_link.hpp>
#undef BOOST_LIB_NAME
#endif
#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 call 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 call 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 SWIGPYTHON
%{
#if PY_VERSION_HEX < 0x02010000
#error Python version 2.1.0 or later is required
#endif
%}
#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
%include common.i
%include vectors.i
%include basketoptions.i
%include blackformula.i
%include bonds.i
%include bondfunctions.i
%include calendars.i
%include calibrationhelpers.i
%include callability.i
%include capfloor.i
%include cashflows.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 fittedbondcurve.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 linearalgebra.i
%include marketelements.i
%include money.i
%include montecarlo.i
%include null.i
%include observer.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 statistics.i
%include stochasticprocess.i
%include swap.i
%include swaption.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 forward.i
// to be deprecated
%include old_volatility.i