pydae 0.56.4__py3-none-any.whl → 0.57__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- pydae/__init__.py +1 -1
- pydae/bmapu/bmapu_builder.py +681 -681
- pydae/bmapu/bmapu_builder_line_exp.py +564 -0
- pydae/bmapu/lines/lib_dtr.py +425 -0
- pydae/bmapu/lines/lines.py +237 -1
- pydae/bmapu/lines/temp.py +1823 -0
- pydae/bmapu/lines/temp_ini_cffi.c +1280 -0
- pydae/bmapu/lines/temp_run_cffi.c +1280 -0
- pydae/bmapu/lines/temp_trap_cffi.c +971 -0
- pydae/bmapu/lines/temp_xy_0.json +7 -0
- pydae/bmapu/lines/xy_0.json +7 -0
- pydae/bmapu/pvs/pv_string.py +647 -0
- pydae/build_cffi.py +1 -1
- pydae/build_v2.py +29 -18
- pydae/models/pendulum/api_test.http +106 -0
- pydae/models/pendulum/dae_api.py +107 -0
- pydae/models/pendulum/dashboard.py +211 -0
- pydae/models/pendulum/temp.py +1882 -0
- pydae/models/pendulum/temp_ini_cffi.c +1247 -0
- pydae/models/pendulum/temp_run_cffi.c +1247 -0
- pydae/models/pendulum/temp_trap_cffi.c +950 -0
- pydae/svg_tools/bmapu_tooltips.ipynb +119 -0
- pydae/svg_tools/svg_tools.py +11 -4
- pydae/temp.py +1 -1
- pydae/temp_ini_cffi.c +4 -0
- pydae/temp_run_cffi.c +4 -0
- pydae/temp_trap_cffi.c +4 -0
- pydae/templates/class_dae_template_api.py +1857 -0
- pydae/utils/dates.py +233 -0
- {pydae-0.56.4.dist-info → pydae-0.57.dist-info}/METADATA +4 -2
- {pydae-0.56.4.dist-info → pydae-0.57.dist-info}/RECORD +34 -15
- {pydae-0.56.4.dist-info → pydae-0.57.dist-info}/WHEEL +1 -1
- {pydae-0.56.4.dist-info → pydae-0.57.dist-info/licenses}/COPYING +0 -0
- {pydae-0.56.4.dist-info → pydae-0.57.dist-info/licenses}/LICENSE +0 -0
|
@@ -0,0 +1,950 @@
|
|
|
1
|
+
#define _CFFI_
|
|
2
|
+
|
|
3
|
+
/* We try to define Py_LIMITED_API before including Python.h.
|
|
4
|
+
|
|
5
|
+
Mess: we can only define it if Py_DEBUG, Py_TRACE_REFS and
|
|
6
|
+
Py_REF_DEBUG are not defined. This is a best-effort approximation:
|
|
7
|
+
we can learn about Py_DEBUG from pyconfig.h, but it is unclear if
|
|
8
|
+
the same works for the other two macros. Py_DEBUG implies them,
|
|
9
|
+
but not the other way around.
|
|
10
|
+
|
|
11
|
+
The implementation is messy (issue #350): on Windows, with _MSC_VER,
|
|
12
|
+
we have to define Py_LIMITED_API even before including pyconfig.h.
|
|
13
|
+
In that case, we guess what pyconfig.h will do to the macros above,
|
|
14
|
+
and check our guess after the #include.
|
|
15
|
+
|
|
16
|
+
Note that on Windows, with CPython 3.x, you need >= 3.5 and virtualenv
|
|
17
|
+
version >= 16.0.0. With older versions of either, you don't get a
|
|
18
|
+
copy of PYTHON3.DLL in the virtualenv. We can't check the version of
|
|
19
|
+
CPython *before* we even include pyconfig.h. ffi.set_source() puts
|
|
20
|
+
a ``#define _CFFI_NO_LIMITED_API'' at the start of this file if it is
|
|
21
|
+
running on Windows < 3.5, as an attempt at fixing it, but that's
|
|
22
|
+
arguably wrong because it may not be the target version of Python.
|
|
23
|
+
Still better than nothing I guess. As another workaround, you can
|
|
24
|
+
remove the definition of Py_LIMITED_API here.
|
|
25
|
+
|
|
26
|
+
See also 'py_limited_api' in cffi/setuptools_ext.py.
|
|
27
|
+
*/
|
|
28
|
+
#if !defined(_CFFI_USE_EMBEDDING) && !defined(Py_LIMITED_API)
|
|
29
|
+
# ifdef _MSC_VER
|
|
30
|
+
# if !defined(_DEBUG) && !defined(Py_DEBUG) && !defined(Py_TRACE_REFS) && !defined(Py_REF_DEBUG) && !defined(_CFFI_NO_LIMITED_API)
|
|
31
|
+
# define Py_LIMITED_API
|
|
32
|
+
# endif
|
|
33
|
+
# include <pyconfig.h>
|
|
34
|
+
/* sanity-check: Py_LIMITED_API will cause crashes if any of these
|
|
35
|
+
are also defined. Normally, the Python file PC/pyconfig.h does not
|
|
36
|
+
cause any of these to be defined, with the exception that _DEBUG
|
|
37
|
+
causes Py_DEBUG. Double-check that. */
|
|
38
|
+
# ifdef Py_LIMITED_API
|
|
39
|
+
# if defined(Py_DEBUG)
|
|
40
|
+
# error "pyconfig.h unexpectedly defines Py_DEBUG, but Py_LIMITED_API is set"
|
|
41
|
+
# endif
|
|
42
|
+
# if defined(Py_TRACE_REFS)
|
|
43
|
+
# error "pyconfig.h unexpectedly defines Py_TRACE_REFS, but Py_LIMITED_API is set"
|
|
44
|
+
# endif
|
|
45
|
+
# if defined(Py_REF_DEBUG)
|
|
46
|
+
# error "pyconfig.h unexpectedly defines Py_REF_DEBUG, but Py_LIMITED_API is set"
|
|
47
|
+
# endif
|
|
48
|
+
# endif
|
|
49
|
+
# else
|
|
50
|
+
# include <pyconfig.h>
|
|
51
|
+
# if !defined(Py_DEBUG) && !defined(Py_TRACE_REFS) && !defined(Py_REF_DEBUG) && !defined(_CFFI_NO_LIMITED_API)
|
|
52
|
+
# define Py_LIMITED_API
|
|
53
|
+
# endif
|
|
54
|
+
# endif
|
|
55
|
+
#endif
|
|
56
|
+
|
|
57
|
+
#include <Python.h>
|
|
58
|
+
#ifdef __cplusplus
|
|
59
|
+
extern "C" {
|
|
60
|
+
#endif
|
|
61
|
+
#include <stddef.h>
|
|
62
|
+
|
|
63
|
+
/* This part is from file 'cffi/parse_c_type.h'. It is copied at the
|
|
64
|
+
beginning of C sources generated by CFFI's ffi.set_source(). */
|
|
65
|
+
|
|
66
|
+
typedef void *_cffi_opcode_t;
|
|
67
|
+
|
|
68
|
+
#define _CFFI_OP(opcode, arg) (_cffi_opcode_t)(opcode | (((uintptr_t)(arg)) << 8))
|
|
69
|
+
#define _CFFI_GETOP(cffi_opcode) ((unsigned char)(uintptr_t)cffi_opcode)
|
|
70
|
+
#define _CFFI_GETARG(cffi_opcode) (((intptr_t)cffi_opcode) >> 8)
|
|
71
|
+
|
|
72
|
+
#define _CFFI_OP_PRIMITIVE 1
|
|
73
|
+
#define _CFFI_OP_POINTER 3
|
|
74
|
+
#define _CFFI_OP_ARRAY 5
|
|
75
|
+
#define _CFFI_OP_OPEN_ARRAY 7
|
|
76
|
+
#define _CFFI_OP_STRUCT_UNION 9
|
|
77
|
+
#define _CFFI_OP_ENUM 11
|
|
78
|
+
#define _CFFI_OP_FUNCTION 13
|
|
79
|
+
#define _CFFI_OP_FUNCTION_END 15
|
|
80
|
+
#define _CFFI_OP_NOOP 17
|
|
81
|
+
#define _CFFI_OP_BITFIELD 19
|
|
82
|
+
#define _CFFI_OP_TYPENAME 21
|
|
83
|
+
#define _CFFI_OP_CPYTHON_BLTN_V 23 // varargs
|
|
84
|
+
#define _CFFI_OP_CPYTHON_BLTN_N 25 // noargs
|
|
85
|
+
#define _CFFI_OP_CPYTHON_BLTN_O 27 // O (i.e. a single arg)
|
|
86
|
+
#define _CFFI_OP_CONSTANT 29
|
|
87
|
+
#define _CFFI_OP_CONSTANT_INT 31
|
|
88
|
+
#define _CFFI_OP_GLOBAL_VAR 33
|
|
89
|
+
#define _CFFI_OP_DLOPEN_FUNC 35
|
|
90
|
+
#define _CFFI_OP_DLOPEN_CONST 37
|
|
91
|
+
#define _CFFI_OP_GLOBAL_VAR_F 39
|
|
92
|
+
#define _CFFI_OP_EXTERN_PYTHON 41
|
|
93
|
+
|
|
94
|
+
#define _CFFI_PRIM_VOID 0
|
|
95
|
+
#define _CFFI_PRIM_BOOL 1
|
|
96
|
+
#define _CFFI_PRIM_CHAR 2
|
|
97
|
+
#define _CFFI_PRIM_SCHAR 3
|
|
98
|
+
#define _CFFI_PRIM_UCHAR 4
|
|
99
|
+
#define _CFFI_PRIM_SHORT 5
|
|
100
|
+
#define _CFFI_PRIM_USHORT 6
|
|
101
|
+
#define _CFFI_PRIM_INT 7
|
|
102
|
+
#define _CFFI_PRIM_UINT 8
|
|
103
|
+
#define _CFFI_PRIM_LONG 9
|
|
104
|
+
#define _CFFI_PRIM_ULONG 10
|
|
105
|
+
#define _CFFI_PRIM_LONGLONG 11
|
|
106
|
+
#define _CFFI_PRIM_ULONGLONG 12
|
|
107
|
+
#define _CFFI_PRIM_FLOAT 13
|
|
108
|
+
#define _CFFI_PRIM_DOUBLE 14
|
|
109
|
+
#define _CFFI_PRIM_LONGDOUBLE 15
|
|
110
|
+
|
|
111
|
+
#define _CFFI_PRIM_WCHAR 16
|
|
112
|
+
#define _CFFI_PRIM_INT8 17
|
|
113
|
+
#define _CFFI_PRIM_UINT8 18
|
|
114
|
+
#define _CFFI_PRIM_INT16 19
|
|
115
|
+
#define _CFFI_PRIM_UINT16 20
|
|
116
|
+
#define _CFFI_PRIM_INT32 21
|
|
117
|
+
#define _CFFI_PRIM_UINT32 22
|
|
118
|
+
#define _CFFI_PRIM_INT64 23
|
|
119
|
+
#define _CFFI_PRIM_UINT64 24
|
|
120
|
+
#define _CFFI_PRIM_INTPTR 25
|
|
121
|
+
#define _CFFI_PRIM_UINTPTR 26
|
|
122
|
+
#define _CFFI_PRIM_PTRDIFF 27
|
|
123
|
+
#define _CFFI_PRIM_SIZE 28
|
|
124
|
+
#define _CFFI_PRIM_SSIZE 29
|
|
125
|
+
#define _CFFI_PRIM_INT_LEAST8 30
|
|
126
|
+
#define _CFFI_PRIM_UINT_LEAST8 31
|
|
127
|
+
#define _CFFI_PRIM_INT_LEAST16 32
|
|
128
|
+
#define _CFFI_PRIM_UINT_LEAST16 33
|
|
129
|
+
#define _CFFI_PRIM_INT_LEAST32 34
|
|
130
|
+
#define _CFFI_PRIM_UINT_LEAST32 35
|
|
131
|
+
#define _CFFI_PRIM_INT_LEAST64 36
|
|
132
|
+
#define _CFFI_PRIM_UINT_LEAST64 37
|
|
133
|
+
#define _CFFI_PRIM_INT_FAST8 38
|
|
134
|
+
#define _CFFI_PRIM_UINT_FAST8 39
|
|
135
|
+
#define _CFFI_PRIM_INT_FAST16 40
|
|
136
|
+
#define _CFFI_PRIM_UINT_FAST16 41
|
|
137
|
+
#define _CFFI_PRIM_INT_FAST32 42
|
|
138
|
+
#define _CFFI_PRIM_UINT_FAST32 43
|
|
139
|
+
#define _CFFI_PRIM_INT_FAST64 44
|
|
140
|
+
#define _CFFI_PRIM_UINT_FAST64 45
|
|
141
|
+
#define _CFFI_PRIM_INTMAX 46
|
|
142
|
+
#define _CFFI_PRIM_UINTMAX 47
|
|
143
|
+
#define _CFFI_PRIM_FLOATCOMPLEX 48
|
|
144
|
+
#define _CFFI_PRIM_DOUBLECOMPLEX 49
|
|
145
|
+
#define _CFFI_PRIM_CHAR16 50
|
|
146
|
+
#define _CFFI_PRIM_CHAR32 51
|
|
147
|
+
|
|
148
|
+
#define _CFFI__NUM_PRIM 52
|
|
149
|
+
#define _CFFI__UNKNOWN_PRIM (-1)
|
|
150
|
+
#define _CFFI__UNKNOWN_FLOAT_PRIM (-2)
|
|
151
|
+
#define _CFFI__UNKNOWN_LONG_DOUBLE (-3)
|
|
152
|
+
|
|
153
|
+
#define _CFFI__IO_FILE_STRUCT (-1)
|
|
154
|
+
|
|
155
|
+
|
|
156
|
+
struct _cffi_global_s {
|
|
157
|
+
const char *name;
|
|
158
|
+
void *address;
|
|
159
|
+
_cffi_opcode_t type_op;
|
|
160
|
+
void *size_or_direct_fn; // OP_GLOBAL_VAR: size, or 0 if unknown
|
|
161
|
+
// OP_CPYTHON_BLTN_*: addr of direct function
|
|
162
|
+
};
|
|
163
|
+
|
|
164
|
+
struct _cffi_getconst_s {
|
|
165
|
+
unsigned long long value;
|
|
166
|
+
const struct _cffi_type_context_s *ctx;
|
|
167
|
+
int gindex;
|
|
168
|
+
};
|
|
169
|
+
|
|
170
|
+
struct _cffi_struct_union_s {
|
|
171
|
+
const char *name;
|
|
172
|
+
int type_index; // -> _cffi_types, on a OP_STRUCT_UNION
|
|
173
|
+
int flags; // _CFFI_F_* flags below
|
|
174
|
+
size_t size;
|
|
175
|
+
int alignment;
|
|
176
|
+
int first_field_index; // -> _cffi_fields array
|
|
177
|
+
int num_fields;
|
|
178
|
+
};
|
|
179
|
+
#define _CFFI_F_UNION 0x01 // is a union, not a struct
|
|
180
|
+
#define _CFFI_F_CHECK_FIELDS 0x02 // complain if fields are not in the
|
|
181
|
+
// "standard layout" or if some are missing
|
|
182
|
+
#define _CFFI_F_PACKED 0x04 // for CHECK_FIELDS, assume a packed struct
|
|
183
|
+
#define _CFFI_F_EXTERNAL 0x08 // in some other ffi.include()
|
|
184
|
+
#define _CFFI_F_OPAQUE 0x10 // opaque
|
|
185
|
+
|
|
186
|
+
struct _cffi_field_s {
|
|
187
|
+
const char *name;
|
|
188
|
+
size_t field_offset;
|
|
189
|
+
size_t field_size;
|
|
190
|
+
_cffi_opcode_t field_type_op;
|
|
191
|
+
};
|
|
192
|
+
|
|
193
|
+
struct _cffi_enum_s {
|
|
194
|
+
const char *name;
|
|
195
|
+
int type_index; // -> _cffi_types, on a OP_ENUM
|
|
196
|
+
int type_prim; // _CFFI_PRIM_xxx
|
|
197
|
+
const char *enumerators; // comma-delimited string
|
|
198
|
+
};
|
|
199
|
+
|
|
200
|
+
struct _cffi_typename_s {
|
|
201
|
+
const char *name;
|
|
202
|
+
int type_index; /* if opaque, points to a possibly artificial
|
|
203
|
+
OP_STRUCT which is itself opaque */
|
|
204
|
+
};
|
|
205
|
+
|
|
206
|
+
struct _cffi_type_context_s {
|
|
207
|
+
_cffi_opcode_t *types;
|
|
208
|
+
const struct _cffi_global_s *globals;
|
|
209
|
+
const struct _cffi_field_s *fields;
|
|
210
|
+
const struct _cffi_struct_union_s *struct_unions;
|
|
211
|
+
const struct _cffi_enum_s *enums;
|
|
212
|
+
const struct _cffi_typename_s *typenames;
|
|
213
|
+
int num_globals;
|
|
214
|
+
int num_struct_unions;
|
|
215
|
+
int num_enums;
|
|
216
|
+
int num_typenames;
|
|
217
|
+
const char *const *includes;
|
|
218
|
+
int num_types;
|
|
219
|
+
int flags; /* future extension */
|
|
220
|
+
};
|
|
221
|
+
|
|
222
|
+
struct _cffi_parse_info_s {
|
|
223
|
+
const struct _cffi_type_context_s *ctx;
|
|
224
|
+
_cffi_opcode_t *output;
|
|
225
|
+
unsigned int output_size;
|
|
226
|
+
size_t error_location;
|
|
227
|
+
const char *error_message;
|
|
228
|
+
};
|
|
229
|
+
|
|
230
|
+
struct _cffi_externpy_s {
|
|
231
|
+
const char *name;
|
|
232
|
+
size_t size_of_result;
|
|
233
|
+
void *reserved1, *reserved2;
|
|
234
|
+
};
|
|
235
|
+
|
|
236
|
+
#ifdef _CFFI_INTERNAL
|
|
237
|
+
static int parse_c_type(struct _cffi_parse_info_s *info, const char *input);
|
|
238
|
+
static int search_in_globals(const struct _cffi_type_context_s *ctx,
|
|
239
|
+
const char *search, size_t search_len);
|
|
240
|
+
static int search_in_struct_unions(const struct _cffi_type_context_s *ctx,
|
|
241
|
+
const char *search, size_t search_len);
|
|
242
|
+
#endif
|
|
243
|
+
|
|
244
|
+
/* this block of #ifs should be kept exactly identical between
|
|
245
|
+
c/_cffi_backend.c, cffi/vengine_cpy.py, cffi/vengine_gen.py
|
|
246
|
+
and cffi/_cffi_include.h */
|
|
247
|
+
#if defined(_MSC_VER)
|
|
248
|
+
# include <malloc.h> /* for alloca() */
|
|
249
|
+
# if _MSC_VER < 1600 /* MSVC < 2010 */
|
|
250
|
+
typedef __int8 int8_t;
|
|
251
|
+
typedef __int16 int16_t;
|
|
252
|
+
typedef __int32 int32_t;
|
|
253
|
+
typedef __int64 int64_t;
|
|
254
|
+
typedef unsigned __int8 uint8_t;
|
|
255
|
+
typedef unsigned __int16 uint16_t;
|
|
256
|
+
typedef unsigned __int32 uint32_t;
|
|
257
|
+
typedef unsigned __int64 uint64_t;
|
|
258
|
+
typedef __int8 int_least8_t;
|
|
259
|
+
typedef __int16 int_least16_t;
|
|
260
|
+
typedef __int32 int_least32_t;
|
|
261
|
+
typedef __int64 int_least64_t;
|
|
262
|
+
typedef unsigned __int8 uint_least8_t;
|
|
263
|
+
typedef unsigned __int16 uint_least16_t;
|
|
264
|
+
typedef unsigned __int32 uint_least32_t;
|
|
265
|
+
typedef unsigned __int64 uint_least64_t;
|
|
266
|
+
typedef __int8 int_fast8_t;
|
|
267
|
+
typedef __int16 int_fast16_t;
|
|
268
|
+
typedef __int32 int_fast32_t;
|
|
269
|
+
typedef __int64 int_fast64_t;
|
|
270
|
+
typedef unsigned __int8 uint_fast8_t;
|
|
271
|
+
typedef unsigned __int16 uint_fast16_t;
|
|
272
|
+
typedef unsigned __int32 uint_fast32_t;
|
|
273
|
+
typedef unsigned __int64 uint_fast64_t;
|
|
274
|
+
typedef __int64 intmax_t;
|
|
275
|
+
typedef unsigned __int64 uintmax_t;
|
|
276
|
+
# else
|
|
277
|
+
# include <stdint.h>
|
|
278
|
+
# endif
|
|
279
|
+
# if _MSC_VER < 1800 /* MSVC < 2013 */
|
|
280
|
+
# ifndef __cplusplus
|
|
281
|
+
typedef unsigned char _Bool;
|
|
282
|
+
# endif
|
|
283
|
+
# endif
|
|
284
|
+
# define _cffi_float_complex_t _Fcomplex /* include <complex.h> for it */
|
|
285
|
+
# define _cffi_double_complex_t _Dcomplex /* include <complex.h> for it */
|
|
286
|
+
#else
|
|
287
|
+
# include <stdint.h>
|
|
288
|
+
# if (defined (__SVR4) && defined (__sun)) || defined(_AIX) || defined(__hpux)
|
|
289
|
+
# include <alloca.h>
|
|
290
|
+
# endif
|
|
291
|
+
# define _cffi_float_complex_t float _Complex
|
|
292
|
+
# define _cffi_double_complex_t double _Complex
|
|
293
|
+
#endif
|
|
294
|
+
|
|
295
|
+
#ifdef __GNUC__
|
|
296
|
+
# define _CFFI_UNUSED_FN __attribute__((unused))
|
|
297
|
+
#else
|
|
298
|
+
# define _CFFI_UNUSED_FN /* nothing */
|
|
299
|
+
#endif
|
|
300
|
+
|
|
301
|
+
#ifdef __cplusplus
|
|
302
|
+
# ifndef _Bool
|
|
303
|
+
typedef bool _Bool; /* semi-hackish: C++ has no _Bool; bool is builtin */
|
|
304
|
+
# endif
|
|
305
|
+
#endif
|
|
306
|
+
|
|
307
|
+
/********** CPython-specific section **********/
|
|
308
|
+
#ifndef PYPY_VERSION
|
|
309
|
+
|
|
310
|
+
|
|
311
|
+
#if PY_MAJOR_VERSION >= 3
|
|
312
|
+
# define PyInt_FromLong PyLong_FromLong
|
|
313
|
+
#endif
|
|
314
|
+
|
|
315
|
+
#define _cffi_from_c_double PyFloat_FromDouble
|
|
316
|
+
#define _cffi_from_c_float PyFloat_FromDouble
|
|
317
|
+
#define _cffi_from_c_long PyInt_FromLong
|
|
318
|
+
#define _cffi_from_c_ulong PyLong_FromUnsignedLong
|
|
319
|
+
#define _cffi_from_c_longlong PyLong_FromLongLong
|
|
320
|
+
#define _cffi_from_c_ulonglong PyLong_FromUnsignedLongLong
|
|
321
|
+
#define _cffi_from_c__Bool PyBool_FromLong
|
|
322
|
+
|
|
323
|
+
#define _cffi_to_c_double PyFloat_AsDouble
|
|
324
|
+
#define _cffi_to_c_float PyFloat_AsDouble
|
|
325
|
+
|
|
326
|
+
#define _cffi_from_c_int(x, type) \
|
|
327
|
+
(((type)-1) > 0 ? /* unsigned */ \
|
|
328
|
+
(sizeof(type) < sizeof(long) ? \
|
|
329
|
+
PyInt_FromLong((long)x) : \
|
|
330
|
+
sizeof(type) == sizeof(long) ? \
|
|
331
|
+
PyLong_FromUnsignedLong((unsigned long)x) : \
|
|
332
|
+
PyLong_FromUnsignedLongLong((unsigned long long)x)) : \
|
|
333
|
+
(sizeof(type) <= sizeof(long) ? \
|
|
334
|
+
PyInt_FromLong((long)x) : \
|
|
335
|
+
PyLong_FromLongLong((long long)x)))
|
|
336
|
+
|
|
337
|
+
#define _cffi_to_c_int(o, type) \
|
|
338
|
+
((type)( \
|
|
339
|
+
sizeof(type) == 1 ? (((type)-1) > 0 ? (type)_cffi_to_c_u8(o) \
|
|
340
|
+
: (type)_cffi_to_c_i8(o)) : \
|
|
341
|
+
sizeof(type) == 2 ? (((type)-1) > 0 ? (type)_cffi_to_c_u16(o) \
|
|
342
|
+
: (type)_cffi_to_c_i16(o)) : \
|
|
343
|
+
sizeof(type) == 4 ? (((type)-1) > 0 ? (type)_cffi_to_c_u32(o) \
|
|
344
|
+
: (type)_cffi_to_c_i32(o)) : \
|
|
345
|
+
sizeof(type) == 8 ? (((type)-1) > 0 ? (type)_cffi_to_c_u64(o) \
|
|
346
|
+
: (type)_cffi_to_c_i64(o)) : \
|
|
347
|
+
(Py_FatalError("unsupported size for type " #type), (type)0)))
|
|
348
|
+
|
|
349
|
+
#define _cffi_to_c_i8 \
|
|
350
|
+
((int(*)(PyObject *))_cffi_exports[1])
|
|
351
|
+
#define _cffi_to_c_u8 \
|
|
352
|
+
((int(*)(PyObject *))_cffi_exports[2])
|
|
353
|
+
#define _cffi_to_c_i16 \
|
|
354
|
+
((int(*)(PyObject *))_cffi_exports[3])
|
|
355
|
+
#define _cffi_to_c_u16 \
|
|
356
|
+
((int(*)(PyObject *))_cffi_exports[4])
|
|
357
|
+
#define _cffi_to_c_i32 \
|
|
358
|
+
((int(*)(PyObject *))_cffi_exports[5])
|
|
359
|
+
#define _cffi_to_c_u32 \
|
|
360
|
+
((unsigned int(*)(PyObject *))_cffi_exports[6])
|
|
361
|
+
#define _cffi_to_c_i64 \
|
|
362
|
+
((long long(*)(PyObject *))_cffi_exports[7])
|
|
363
|
+
#define _cffi_to_c_u64 \
|
|
364
|
+
((unsigned long long(*)(PyObject *))_cffi_exports[8])
|
|
365
|
+
#define _cffi_to_c_char \
|
|
366
|
+
((int(*)(PyObject *))_cffi_exports[9])
|
|
367
|
+
#define _cffi_from_c_pointer \
|
|
368
|
+
((PyObject *(*)(char *, struct _cffi_ctypedescr *))_cffi_exports[10])
|
|
369
|
+
#define _cffi_to_c_pointer \
|
|
370
|
+
((char *(*)(PyObject *, struct _cffi_ctypedescr *))_cffi_exports[11])
|
|
371
|
+
#define _cffi_get_struct_layout \
|
|
372
|
+
not used any more
|
|
373
|
+
#define _cffi_restore_errno \
|
|
374
|
+
((void(*)(void))_cffi_exports[13])
|
|
375
|
+
#define _cffi_save_errno \
|
|
376
|
+
((void(*)(void))_cffi_exports[14])
|
|
377
|
+
#define _cffi_from_c_char \
|
|
378
|
+
((PyObject *(*)(char))_cffi_exports[15])
|
|
379
|
+
#define _cffi_from_c_deref \
|
|
380
|
+
((PyObject *(*)(char *, struct _cffi_ctypedescr *))_cffi_exports[16])
|
|
381
|
+
#define _cffi_to_c \
|
|
382
|
+
((int(*)(char *, struct _cffi_ctypedescr *, PyObject *))_cffi_exports[17])
|
|
383
|
+
#define _cffi_from_c_struct \
|
|
384
|
+
((PyObject *(*)(char *, struct _cffi_ctypedescr *))_cffi_exports[18])
|
|
385
|
+
#define _cffi_to_c_wchar_t \
|
|
386
|
+
((_cffi_wchar_t(*)(PyObject *))_cffi_exports[19])
|
|
387
|
+
#define _cffi_from_c_wchar_t \
|
|
388
|
+
((PyObject *(*)(_cffi_wchar_t))_cffi_exports[20])
|
|
389
|
+
#define _cffi_to_c_long_double \
|
|
390
|
+
((long double(*)(PyObject *))_cffi_exports[21])
|
|
391
|
+
#define _cffi_to_c__Bool \
|
|
392
|
+
((_Bool(*)(PyObject *))_cffi_exports[22])
|
|
393
|
+
#define _cffi_prepare_pointer_call_argument \
|
|
394
|
+
((Py_ssize_t(*)(struct _cffi_ctypedescr *, \
|
|
395
|
+
PyObject *, char **))_cffi_exports[23])
|
|
396
|
+
#define _cffi_convert_array_from_object \
|
|
397
|
+
((int(*)(char *, struct _cffi_ctypedescr *, PyObject *))_cffi_exports[24])
|
|
398
|
+
#define _CFFI_CPIDX 25
|
|
399
|
+
#define _cffi_call_python \
|
|
400
|
+
((void(*)(struct _cffi_externpy_s *, char *))_cffi_exports[_CFFI_CPIDX])
|
|
401
|
+
#define _cffi_to_c_wchar3216_t \
|
|
402
|
+
((int(*)(PyObject *))_cffi_exports[26])
|
|
403
|
+
#define _cffi_from_c_wchar3216_t \
|
|
404
|
+
((PyObject *(*)(int))_cffi_exports[27])
|
|
405
|
+
#define _CFFI_NUM_EXPORTS 28
|
|
406
|
+
|
|
407
|
+
struct _cffi_ctypedescr;
|
|
408
|
+
|
|
409
|
+
static void *_cffi_exports[_CFFI_NUM_EXPORTS];
|
|
410
|
+
|
|
411
|
+
#define _cffi_type(index) ( \
|
|
412
|
+
assert((((uintptr_t)_cffi_types[index]) & 1) == 0), \
|
|
413
|
+
(struct _cffi_ctypedescr *)_cffi_types[index])
|
|
414
|
+
|
|
415
|
+
static PyObject *_cffi_init(const char *module_name, Py_ssize_t version,
|
|
416
|
+
const struct _cffi_type_context_s *ctx)
|
|
417
|
+
{
|
|
418
|
+
PyObject *module, *o_arg, *new_module;
|
|
419
|
+
void *raw[] = {
|
|
420
|
+
(void *)module_name,
|
|
421
|
+
(void *)version,
|
|
422
|
+
(void *)_cffi_exports,
|
|
423
|
+
(void *)ctx,
|
|
424
|
+
};
|
|
425
|
+
|
|
426
|
+
module = PyImport_ImportModule("_cffi_backend");
|
|
427
|
+
if (module == NULL)
|
|
428
|
+
goto failure;
|
|
429
|
+
|
|
430
|
+
o_arg = PyLong_FromVoidPtr((void *)raw);
|
|
431
|
+
if (o_arg == NULL)
|
|
432
|
+
goto failure;
|
|
433
|
+
|
|
434
|
+
new_module = PyObject_CallMethod(
|
|
435
|
+
module, (char *)"_init_cffi_1_0_external_module", (char *)"O", o_arg);
|
|
436
|
+
|
|
437
|
+
Py_DECREF(o_arg);
|
|
438
|
+
Py_DECREF(module);
|
|
439
|
+
return new_module;
|
|
440
|
+
|
|
441
|
+
failure:
|
|
442
|
+
Py_XDECREF(module);
|
|
443
|
+
return NULL;
|
|
444
|
+
}
|
|
445
|
+
|
|
446
|
+
|
|
447
|
+
#ifdef HAVE_WCHAR_H
|
|
448
|
+
typedef wchar_t _cffi_wchar_t;
|
|
449
|
+
#else
|
|
450
|
+
typedef uint16_t _cffi_wchar_t; /* same random pick as _cffi_backend.c */
|
|
451
|
+
#endif
|
|
452
|
+
|
|
453
|
+
_CFFI_UNUSED_FN static uint16_t _cffi_to_c_char16_t(PyObject *o)
|
|
454
|
+
{
|
|
455
|
+
if (sizeof(_cffi_wchar_t) == 2)
|
|
456
|
+
return (uint16_t)_cffi_to_c_wchar_t(o);
|
|
457
|
+
else
|
|
458
|
+
return (uint16_t)_cffi_to_c_wchar3216_t(o);
|
|
459
|
+
}
|
|
460
|
+
|
|
461
|
+
_CFFI_UNUSED_FN static PyObject *_cffi_from_c_char16_t(uint16_t x)
|
|
462
|
+
{
|
|
463
|
+
if (sizeof(_cffi_wchar_t) == 2)
|
|
464
|
+
return _cffi_from_c_wchar_t((_cffi_wchar_t)x);
|
|
465
|
+
else
|
|
466
|
+
return _cffi_from_c_wchar3216_t((int)x);
|
|
467
|
+
}
|
|
468
|
+
|
|
469
|
+
_CFFI_UNUSED_FN static int _cffi_to_c_char32_t(PyObject *o)
|
|
470
|
+
{
|
|
471
|
+
if (sizeof(_cffi_wchar_t) == 4)
|
|
472
|
+
return (int)_cffi_to_c_wchar_t(o);
|
|
473
|
+
else
|
|
474
|
+
return (int)_cffi_to_c_wchar3216_t(o);
|
|
475
|
+
}
|
|
476
|
+
|
|
477
|
+
_CFFI_UNUSED_FN static PyObject *_cffi_from_c_char32_t(unsigned int x)
|
|
478
|
+
{
|
|
479
|
+
if (sizeof(_cffi_wchar_t) == 4)
|
|
480
|
+
return _cffi_from_c_wchar_t((_cffi_wchar_t)x);
|
|
481
|
+
else
|
|
482
|
+
return _cffi_from_c_wchar3216_t((int)x);
|
|
483
|
+
}
|
|
484
|
+
|
|
485
|
+
union _cffi_union_alignment_u {
|
|
486
|
+
unsigned char m_char;
|
|
487
|
+
unsigned short m_short;
|
|
488
|
+
unsigned int m_int;
|
|
489
|
+
unsigned long m_long;
|
|
490
|
+
unsigned long long m_longlong;
|
|
491
|
+
float m_float;
|
|
492
|
+
double m_double;
|
|
493
|
+
long double m_longdouble;
|
|
494
|
+
};
|
|
495
|
+
|
|
496
|
+
struct _cffi_freeme_s {
|
|
497
|
+
struct _cffi_freeme_s *next;
|
|
498
|
+
union _cffi_union_alignment_u alignment;
|
|
499
|
+
};
|
|
500
|
+
|
|
501
|
+
_CFFI_UNUSED_FN static int
|
|
502
|
+
_cffi_convert_array_argument(struct _cffi_ctypedescr *ctptr, PyObject *arg,
|
|
503
|
+
char **output_data, Py_ssize_t datasize,
|
|
504
|
+
struct _cffi_freeme_s **freeme)
|
|
505
|
+
{
|
|
506
|
+
char *p;
|
|
507
|
+
if (datasize < 0)
|
|
508
|
+
return -1;
|
|
509
|
+
|
|
510
|
+
p = *output_data;
|
|
511
|
+
if (p == NULL) {
|
|
512
|
+
struct _cffi_freeme_s *fp = (struct _cffi_freeme_s *)PyObject_Malloc(
|
|
513
|
+
offsetof(struct _cffi_freeme_s, alignment) + (size_t)datasize);
|
|
514
|
+
if (fp == NULL)
|
|
515
|
+
return -1;
|
|
516
|
+
fp->next = *freeme;
|
|
517
|
+
*freeme = fp;
|
|
518
|
+
p = *output_data = (char *)&fp->alignment;
|
|
519
|
+
}
|
|
520
|
+
memset((void *)p, 0, (size_t)datasize);
|
|
521
|
+
return _cffi_convert_array_from_object(p, ctptr, arg);
|
|
522
|
+
}
|
|
523
|
+
|
|
524
|
+
_CFFI_UNUSED_FN static void
|
|
525
|
+
_cffi_free_array_arguments(struct _cffi_freeme_s *freeme)
|
|
526
|
+
{
|
|
527
|
+
do {
|
|
528
|
+
void *p = (void *)freeme;
|
|
529
|
+
freeme = freeme->next;
|
|
530
|
+
PyObject_Free(p);
|
|
531
|
+
} while (freeme != NULL);
|
|
532
|
+
}
|
|
533
|
+
|
|
534
|
+
/********** end CPython-specific section **********/
|
|
535
|
+
#else
|
|
536
|
+
_CFFI_UNUSED_FN
|
|
537
|
+
static void (*_cffi_call_python_org)(struct _cffi_externpy_s *, char *);
|
|
538
|
+
# define _cffi_call_python _cffi_call_python_org
|
|
539
|
+
#endif
|
|
540
|
+
|
|
541
|
+
|
|
542
|
+
#define _cffi_array_len(array) (sizeof(array) / sizeof((array)[0]))
|
|
543
|
+
|
|
544
|
+
#define _cffi_prim_int(size, sign) \
|
|
545
|
+
((size) == 1 ? ((sign) ? _CFFI_PRIM_INT8 : _CFFI_PRIM_UINT8) : \
|
|
546
|
+
(size) == 2 ? ((sign) ? _CFFI_PRIM_INT16 : _CFFI_PRIM_UINT16) : \
|
|
547
|
+
(size) == 4 ? ((sign) ? _CFFI_PRIM_INT32 : _CFFI_PRIM_UINT32) : \
|
|
548
|
+
(size) == 8 ? ((sign) ? _CFFI_PRIM_INT64 : _CFFI_PRIM_UINT64) : \
|
|
549
|
+
_CFFI__UNKNOWN_PRIM)
|
|
550
|
+
|
|
551
|
+
#define _cffi_prim_float(size) \
|
|
552
|
+
((size) == sizeof(float) ? _CFFI_PRIM_FLOAT : \
|
|
553
|
+
(size) == sizeof(double) ? _CFFI_PRIM_DOUBLE : \
|
|
554
|
+
(size) == sizeof(long double) ? _CFFI__UNKNOWN_LONG_DOUBLE : \
|
|
555
|
+
_CFFI__UNKNOWN_FLOAT_PRIM)
|
|
556
|
+
|
|
557
|
+
#define _cffi_check_int(got, got_nonpos, expected) \
|
|
558
|
+
((got_nonpos) == (expected <= 0) && \
|
|
559
|
+
(got) == (unsigned long long)expected)
|
|
560
|
+
|
|
561
|
+
#ifdef MS_WIN32
|
|
562
|
+
# define _cffi_stdcall __stdcall
|
|
563
|
+
#else
|
|
564
|
+
# define _cffi_stdcall /* nothing */
|
|
565
|
+
#endif
|
|
566
|
+
|
|
567
|
+
#ifdef __cplusplus
|
|
568
|
+
}
|
|
569
|
+
#endif
|
|
570
|
+
|
|
571
|
+
/************************************************************/
|
|
572
|
+
|
|
573
|
+
void de_jac_trap_up_eval(double *data,double *x,double *y,double *u,double *p,double Dt){
|
|
574
|
+
|
|
575
|
+
data[2] = -0.5*Dt;
|
|
576
|
+
data[9] = -0.5*Dt;
|
|
577
|
+
data[14] = 0.5*Dt*p[3]/p[2] + 1;
|
|
578
|
+
data[21] = 0.5*Dt*p[3]/p[2] + 1;
|
|
579
|
+
|
|
580
|
+
}
|
|
581
|
+
|
|
582
|
+
void de_jac_trap_xy_eval(double *data,double *x,double *y,double *u,double *p,double Dt){
|
|
583
|
+
|
|
584
|
+
data[12] = 1.0*Dt*y[0]/p[2];
|
|
585
|
+
data[16] = 1.0*Dt*x[0]/p[2];
|
|
586
|
+
data[19] = 1.0*Dt*y[0]/p[2];
|
|
587
|
+
data[22] = 1.0*Dt*x[1]/p[2];
|
|
588
|
+
data[24] = 2*x[0];
|
|
589
|
+
data[25] = 2*x[1];
|
|
590
|
+
data[30] = -x[1]/(pow(x[0], 2) + pow(x[1], 2));
|
|
591
|
+
data[31] = x[0]/(pow(x[0], 2) + pow(x[1], 2));
|
|
592
|
+
|
|
593
|
+
}
|
|
594
|
+
|
|
595
|
+
void de_jac_trap_num_eval(double *data,double *x,double *y,double *u,double *p,double Dt){
|
|
596
|
+
|
|
597
|
+
data[0] = 1;
|
|
598
|
+
data[7] = 1;
|
|
599
|
+
data[28] = -9.9999999999999995e-7;
|
|
600
|
+
data[35] = -1;
|
|
601
|
+
|
|
602
|
+
}
|
|
603
|
+
|
|
604
|
+
|
|
605
|
+
|
|
606
|
+
/************************************************************/
|
|
607
|
+
|
|
608
|
+
static void *_cffi_types[] = {
|
|
609
|
+
/* 0 */ _CFFI_OP(_CFFI_OP_FUNCTION, 8), // void()(double *, double *, double *, double *, double *, double)
|
|
610
|
+
/* 1 */ _CFFI_OP(_CFFI_OP_POINTER, 6), // double *
|
|
611
|
+
/* 2 */ _CFFI_OP(_CFFI_OP_NOOP, 1),
|
|
612
|
+
/* 3 */ _CFFI_OP(_CFFI_OP_NOOP, 1),
|
|
613
|
+
/* 4 */ _CFFI_OP(_CFFI_OP_NOOP, 1),
|
|
614
|
+
/* 5 */ _CFFI_OP(_CFFI_OP_NOOP, 1),
|
|
615
|
+
/* 6 */ _CFFI_OP(_CFFI_OP_PRIMITIVE, 14), // double
|
|
616
|
+
/* 7 */ _CFFI_OP(_CFFI_OP_FUNCTION_END, 0),
|
|
617
|
+
/* 8 */ _CFFI_OP(_CFFI_OP_PRIMITIVE, 0), // void
|
|
618
|
+
};
|
|
619
|
+
|
|
620
|
+
static void _cffi_d_de_jac_trap_num_eval(double * x0, double * x1, double * x2, double * x3, double * x4, double x5)
|
|
621
|
+
{
|
|
622
|
+
de_jac_trap_num_eval(x0, x1, x2, x3, x4, x5);
|
|
623
|
+
}
|
|
624
|
+
#ifndef PYPY_VERSION
|
|
625
|
+
static PyObject *
|
|
626
|
+
_cffi_f_de_jac_trap_num_eval(PyObject *self, PyObject *args)
|
|
627
|
+
{
|
|
628
|
+
double * x0;
|
|
629
|
+
double * x1;
|
|
630
|
+
double * x2;
|
|
631
|
+
double * x3;
|
|
632
|
+
double * x4;
|
|
633
|
+
double x5;
|
|
634
|
+
Py_ssize_t datasize;
|
|
635
|
+
struct _cffi_freeme_s *large_args_free = NULL;
|
|
636
|
+
PyObject *arg0;
|
|
637
|
+
PyObject *arg1;
|
|
638
|
+
PyObject *arg2;
|
|
639
|
+
PyObject *arg3;
|
|
640
|
+
PyObject *arg4;
|
|
641
|
+
PyObject *arg5;
|
|
642
|
+
|
|
643
|
+
if (!PyArg_UnpackTuple(args, "de_jac_trap_num_eval", 6, 6, &arg0, &arg1, &arg2, &arg3, &arg4, &arg5))
|
|
644
|
+
return NULL;
|
|
645
|
+
|
|
646
|
+
datasize = _cffi_prepare_pointer_call_argument(
|
|
647
|
+
_cffi_type(1), arg0, (char **)&x0);
|
|
648
|
+
if (datasize != 0) {
|
|
649
|
+
x0 = ((size_t)datasize) <= 640 ? (double *)alloca((size_t)datasize) : NULL;
|
|
650
|
+
if (_cffi_convert_array_argument(_cffi_type(1), arg0, (char **)&x0,
|
|
651
|
+
datasize, &large_args_free) < 0)
|
|
652
|
+
return NULL;
|
|
653
|
+
}
|
|
654
|
+
|
|
655
|
+
datasize = _cffi_prepare_pointer_call_argument(
|
|
656
|
+
_cffi_type(1), arg1, (char **)&x1);
|
|
657
|
+
if (datasize != 0) {
|
|
658
|
+
x1 = ((size_t)datasize) <= 640 ? (double *)alloca((size_t)datasize) : NULL;
|
|
659
|
+
if (_cffi_convert_array_argument(_cffi_type(1), arg1, (char **)&x1,
|
|
660
|
+
datasize, &large_args_free) < 0)
|
|
661
|
+
return NULL;
|
|
662
|
+
}
|
|
663
|
+
|
|
664
|
+
datasize = _cffi_prepare_pointer_call_argument(
|
|
665
|
+
_cffi_type(1), arg2, (char **)&x2);
|
|
666
|
+
if (datasize != 0) {
|
|
667
|
+
x2 = ((size_t)datasize) <= 640 ? (double *)alloca((size_t)datasize) : NULL;
|
|
668
|
+
if (_cffi_convert_array_argument(_cffi_type(1), arg2, (char **)&x2,
|
|
669
|
+
datasize, &large_args_free) < 0)
|
|
670
|
+
return NULL;
|
|
671
|
+
}
|
|
672
|
+
|
|
673
|
+
datasize = _cffi_prepare_pointer_call_argument(
|
|
674
|
+
_cffi_type(1), arg3, (char **)&x3);
|
|
675
|
+
if (datasize != 0) {
|
|
676
|
+
x3 = ((size_t)datasize) <= 640 ? (double *)alloca((size_t)datasize) : NULL;
|
|
677
|
+
if (_cffi_convert_array_argument(_cffi_type(1), arg3, (char **)&x3,
|
|
678
|
+
datasize, &large_args_free) < 0)
|
|
679
|
+
return NULL;
|
|
680
|
+
}
|
|
681
|
+
|
|
682
|
+
datasize = _cffi_prepare_pointer_call_argument(
|
|
683
|
+
_cffi_type(1), arg4, (char **)&x4);
|
|
684
|
+
if (datasize != 0) {
|
|
685
|
+
x4 = ((size_t)datasize) <= 640 ? (double *)alloca((size_t)datasize) : NULL;
|
|
686
|
+
if (_cffi_convert_array_argument(_cffi_type(1), arg4, (char **)&x4,
|
|
687
|
+
datasize, &large_args_free) < 0)
|
|
688
|
+
return NULL;
|
|
689
|
+
}
|
|
690
|
+
|
|
691
|
+
x5 = (double)_cffi_to_c_double(arg5);
|
|
692
|
+
if (x5 == (double)-1 && PyErr_Occurred())
|
|
693
|
+
return NULL;
|
|
694
|
+
|
|
695
|
+
Py_BEGIN_ALLOW_THREADS
|
|
696
|
+
_cffi_restore_errno();
|
|
697
|
+
{ de_jac_trap_num_eval(x0, x1, x2, x3, x4, x5); }
|
|
698
|
+
_cffi_save_errno();
|
|
699
|
+
Py_END_ALLOW_THREADS
|
|
700
|
+
|
|
701
|
+
(void)self; /* unused */
|
|
702
|
+
if (large_args_free != NULL) _cffi_free_array_arguments(large_args_free);
|
|
703
|
+
Py_INCREF(Py_None);
|
|
704
|
+
return Py_None;
|
|
705
|
+
}
|
|
706
|
+
#else
|
|
707
|
+
# define _cffi_f_de_jac_trap_num_eval _cffi_d_de_jac_trap_num_eval
|
|
708
|
+
#endif
|
|
709
|
+
|
|
710
|
+
static void _cffi_d_de_jac_trap_up_eval(double * x0, double * x1, double * x2, double * x3, double * x4, double x5)
|
|
711
|
+
{
|
|
712
|
+
de_jac_trap_up_eval(x0, x1, x2, x3, x4, x5);
|
|
713
|
+
}
|
|
714
|
+
#ifndef PYPY_VERSION
|
|
715
|
+
static PyObject *
|
|
716
|
+
_cffi_f_de_jac_trap_up_eval(PyObject *self, PyObject *args)
|
|
717
|
+
{
|
|
718
|
+
double * x0;
|
|
719
|
+
double * x1;
|
|
720
|
+
double * x2;
|
|
721
|
+
double * x3;
|
|
722
|
+
double * x4;
|
|
723
|
+
double x5;
|
|
724
|
+
Py_ssize_t datasize;
|
|
725
|
+
struct _cffi_freeme_s *large_args_free = NULL;
|
|
726
|
+
PyObject *arg0;
|
|
727
|
+
PyObject *arg1;
|
|
728
|
+
PyObject *arg2;
|
|
729
|
+
PyObject *arg3;
|
|
730
|
+
PyObject *arg4;
|
|
731
|
+
PyObject *arg5;
|
|
732
|
+
|
|
733
|
+
if (!PyArg_UnpackTuple(args, "de_jac_trap_up_eval", 6, 6, &arg0, &arg1, &arg2, &arg3, &arg4, &arg5))
|
|
734
|
+
return NULL;
|
|
735
|
+
|
|
736
|
+
datasize = _cffi_prepare_pointer_call_argument(
|
|
737
|
+
_cffi_type(1), arg0, (char **)&x0);
|
|
738
|
+
if (datasize != 0) {
|
|
739
|
+
x0 = ((size_t)datasize) <= 640 ? (double *)alloca((size_t)datasize) : NULL;
|
|
740
|
+
if (_cffi_convert_array_argument(_cffi_type(1), arg0, (char **)&x0,
|
|
741
|
+
datasize, &large_args_free) < 0)
|
|
742
|
+
return NULL;
|
|
743
|
+
}
|
|
744
|
+
|
|
745
|
+
datasize = _cffi_prepare_pointer_call_argument(
|
|
746
|
+
_cffi_type(1), arg1, (char **)&x1);
|
|
747
|
+
if (datasize != 0) {
|
|
748
|
+
x1 = ((size_t)datasize) <= 640 ? (double *)alloca((size_t)datasize) : NULL;
|
|
749
|
+
if (_cffi_convert_array_argument(_cffi_type(1), arg1, (char **)&x1,
|
|
750
|
+
datasize, &large_args_free) < 0)
|
|
751
|
+
return NULL;
|
|
752
|
+
}
|
|
753
|
+
|
|
754
|
+
datasize = _cffi_prepare_pointer_call_argument(
|
|
755
|
+
_cffi_type(1), arg2, (char **)&x2);
|
|
756
|
+
if (datasize != 0) {
|
|
757
|
+
x2 = ((size_t)datasize) <= 640 ? (double *)alloca((size_t)datasize) : NULL;
|
|
758
|
+
if (_cffi_convert_array_argument(_cffi_type(1), arg2, (char **)&x2,
|
|
759
|
+
datasize, &large_args_free) < 0)
|
|
760
|
+
return NULL;
|
|
761
|
+
}
|
|
762
|
+
|
|
763
|
+
datasize = _cffi_prepare_pointer_call_argument(
|
|
764
|
+
_cffi_type(1), arg3, (char **)&x3);
|
|
765
|
+
if (datasize != 0) {
|
|
766
|
+
x3 = ((size_t)datasize) <= 640 ? (double *)alloca((size_t)datasize) : NULL;
|
|
767
|
+
if (_cffi_convert_array_argument(_cffi_type(1), arg3, (char **)&x3,
|
|
768
|
+
datasize, &large_args_free) < 0)
|
|
769
|
+
return NULL;
|
|
770
|
+
}
|
|
771
|
+
|
|
772
|
+
datasize = _cffi_prepare_pointer_call_argument(
|
|
773
|
+
_cffi_type(1), arg4, (char **)&x4);
|
|
774
|
+
if (datasize != 0) {
|
|
775
|
+
x4 = ((size_t)datasize) <= 640 ? (double *)alloca((size_t)datasize) : NULL;
|
|
776
|
+
if (_cffi_convert_array_argument(_cffi_type(1), arg4, (char **)&x4,
|
|
777
|
+
datasize, &large_args_free) < 0)
|
|
778
|
+
return NULL;
|
|
779
|
+
}
|
|
780
|
+
|
|
781
|
+
x5 = (double)_cffi_to_c_double(arg5);
|
|
782
|
+
if (x5 == (double)-1 && PyErr_Occurred())
|
|
783
|
+
return NULL;
|
|
784
|
+
|
|
785
|
+
Py_BEGIN_ALLOW_THREADS
|
|
786
|
+
_cffi_restore_errno();
|
|
787
|
+
{ de_jac_trap_up_eval(x0, x1, x2, x3, x4, x5); }
|
|
788
|
+
_cffi_save_errno();
|
|
789
|
+
Py_END_ALLOW_THREADS
|
|
790
|
+
|
|
791
|
+
(void)self; /* unused */
|
|
792
|
+
if (large_args_free != NULL) _cffi_free_array_arguments(large_args_free);
|
|
793
|
+
Py_INCREF(Py_None);
|
|
794
|
+
return Py_None;
|
|
795
|
+
}
|
|
796
|
+
#else
|
|
797
|
+
# define _cffi_f_de_jac_trap_up_eval _cffi_d_de_jac_trap_up_eval
|
|
798
|
+
#endif
|
|
799
|
+
|
|
800
|
+
static void _cffi_d_de_jac_trap_xy_eval(double * x0, double * x1, double * x2, double * x3, double * x4, double x5)
|
|
801
|
+
{
|
|
802
|
+
de_jac_trap_xy_eval(x0, x1, x2, x3, x4, x5);
|
|
803
|
+
}
|
|
804
|
+
#ifndef PYPY_VERSION
|
|
805
|
+
static PyObject *
|
|
806
|
+
_cffi_f_de_jac_trap_xy_eval(PyObject *self, PyObject *args)
|
|
807
|
+
{
|
|
808
|
+
double * x0;
|
|
809
|
+
double * x1;
|
|
810
|
+
double * x2;
|
|
811
|
+
double * x3;
|
|
812
|
+
double * x4;
|
|
813
|
+
double x5;
|
|
814
|
+
Py_ssize_t datasize;
|
|
815
|
+
struct _cffi_freeme_s *large_args_free = NULL;
|
|
816
|
+
PyObject *arg0;
|
|
817
|
+
PyObject *arg1;
|
|
818
|
+
PyObject *arg2;
|
|
819
|
+
PyObject *arg3;
|
|
820
|
+
PyObject *arg4;
|
|
821
|
+
PyObject *arg5;
|
|
822
|
+
|
|
823
|
+
if (!PyArg_UnpackTuple(args, "de_jac_trap_xy_eval", 6, 6, &arg0, &arg1, &arg2, &arg3, &arg4, &arg5))
|
|
824
|
+
return NULL;
|
|
825
|
+
|
|
826
|
+
datasize = _cffi_prepare_pointer_call_argument(
|
|
827
|
+
_cffi_type(1), arg0, (char **)&x0);
|
|
828
|
+
if (datasize != 0) {
|
|
829
|
+
x0 = ((size_t)datasize) <= 640 ? (double *)alloca((size_t)datasize) : NULL;
|
|
830
|
+
if (_cffi_convert_array_argument(_cffi_type(1), arg0, (char **)&x0,
|
|
831
|
+
datasize, &large_args_free) < 0)
|
|
832
|
+
return NULL;
|
|
833
|
+
}
|
|
834
|
+
|
|
835
|
+
datasize = _cffi_prepare_pointer_call_argument(
|
|
836
|
+
_cffi_type(1), arg1, (char **)&x1);
|
|
837
|
+
if (datasize != 0) {
|
|
838
|
+
x1 = ((size_t)datasize) <= 640 ? (double *)alloca((size_t)datasize) : NULL;
|
|
839
|
+
if (_cffi_convert_array_argument(_cffi_type(1), arg1, (char **)&x1,
|
|
840
|
+
datasize, &large_args_free) < 0)
|
|
841
|
+
return NULL;
|
|
842
|
+
}
|
|
843
|
+
|
|
844
|
+
datasize = _cffi_prepare_pointer_call_argument(
|
|
845
|
+
_cffi_type(1), arg2, (char **)&x2);
|
|
846
|
+
if (datasize != 0) {
|
|
847
|
+
x2 = ((size_t)datasize) <= 640 ? (double *)alloca((size_t)datasize) : NULL;
|
|
848
|
+
if (_cffi_convert_array_argument(_cffi_type(1), arg2, (char **)&x2,
|
|
849
|
+
datasize, &large_args_free) < 0)
|
|
850
|
+
return NULL;
|
|
851
|
+
}
|
|
852
|
+
|
|
853
|
+
datasize = _cffi_prepare_pointer_call_argument(
|
|
854
|
+
_cffi_type(1), arg3, (char **)&x3);
|
|
855
|
+
if (datasize != 0) {
|
|
856
|
+
x3 = ((size_t)datasize) <= 640 ? (double *)alloca((size_t)datasize) : NULL;
|
|
857
|
+
if (_cffi_convert_array_argument(_cffi_type(1), arg3, (char **)&x3,
|
|
858
|
+
datasize, &large_args_free) < 0)
|
|
859
|
+
return NULL;
|
|
860
|
+
}
|
|
861
|
+
|
|
862
|
+
datasize = _cffi_prepare_pointer_call_argument(
|
|
863
|
+
_cffi_type(1), arg4, (char **)&x4);
|
|
864
|
+
if (datasize != 0) {
|
|
865
|
+
x4 = ((size_t)datasize) <= 640 ? (double *)alloca((size_t)datasize) : NULL;
|
|
866
|
+
if (_cffi_convert_array_argument(_cffi_type(1), arg4, (char **)&x4,
|
|
867
|
+
datasize, &large_args_free) < 0)
|
|
868
|
+
return NULL;
|
|
869
|
+
}
|
|
870
|
+
|
|
871
|
+
x5 = (double)_cffi_to_c_double(arg5);
|
|
872
|
+
if (x5 == (double)-1 && PyErr_Occurred())
|
|
873
|
+
return NULL;
|
|
874
|
+
|
|
875
|
+
Py_BEGIN_ALLOW_THREADS
|
|
876
|
+
_cffi_restore_errno();
|
|
877
|
+
{ de_jac_trap_xy_eval(x0, x1, x2, x3, x4, x5); }
|
|
878
|
+
_cffi_save_errno();
|
|
879
|
+
Py_END_ALLOW_THREADS
|
|
880
|
+
|
|
881
|
+
(void)self; /* unused */
|
|
882
|
+
if (large_args_free != NULL) _cffi_free_array_arguments(large_args_free);
|
|
883
|
+
Py_INCREF(Py_None);
|
|
884
|
+
return Py_None;
|
|
885
|
+
}
|
|
886
|
+
#else
|
|
887
|
+
# define _cffi_f_de_jac_trap_xy_eval _cffi_d_de_jac_trap_xy_eval
|
|
888
|
+
#endif
|
|
889
|
+
|
|
890
|
+
static const struct _cffi_global_s _cffi_globals[] = {
|
|
891
|
+
{ "de_jac_trap_num_eval", (void *)_cffi_f_de_jac_trap_num_eval, _CFFI_OP(_CFFI_OP_CPYTHON_BLTN_V, 0), (void *)_cffi_d_de_jac_trap_num_eval },
|
|
892
|
+
{ "de_jac_trap_up_eval", (void *)_cffi_f_de_jac_trap_up_eval, _CFFI_OP(_CFFI_OP_CPYTHON_BLTN_V, 0), (void *)_cffi_d_de_jac_trap_up_eval },
|
|
893
|
+
{ "de_jac_trap_xy_eval", (void *)_cffi_f_de_jac_trap_xy_eval, _CFFI_OP(_CFFI_OP_CPYTHON_BLTN_V, 0), (void *)_cffi_d_de_jac_trap_xy_eval },
|
|
894
|
+
};
|
|
895
|
+
|
|
896
|
+
static const struct _cffi_type_context_s _cffi_type_context = {
|
|
897
|
+
_cffi_types,
|
|
898
|
+
_cffi_globals,
|
|
899
|
+
NULL, /* no fields */
|
|
900
|
+
NULL, /* no struct_unions */
|
|
901
|
+
NULL, /* no enums */
|
|
902
|
+
NULL, /* no typenames */
|
|
903
|
+
3, /* num_globals */
|
|
904
|
+
0, /* num_struct_unions */
|
|
905
|
+
0, /* num_enums */
|
|
906
|
+
0, /* num_typenames */
|
|
907
|
+
NULL, /* no includes */
|
|
908
|
+
9, /* num_types */
|
|
909
|
+
0, /* flags */
|
|
910
|
+
};
|
|
911
|
+
|
|
912
|
+
#ifdef __GNUC__
|
|
913
|
+
# pragma GCC visibility push(default) /* for -fvisibility= */
|
|
914
|
+
#endif
|
|
915
|
+
|
|
916
|
+
#ifdef PYPY_VERSION
|
|
917
|
+
PyMODINIT_FUNC
|
|
918
|
+
_cffi_pypyinit_temp_trap_cffi(const void *p[])
|
|
919
|
+
{
|
|
920
|
+
p[0] = (const void *)0x2601;
|
|
921
|
+
p[1] = &_cffi_type_context;
|
|
922
|
+
#if PY_MAJOR_VERSION >= 3
|
|
923
|
+
return NULL;
|
|
924
|
+
#endif
|
|
925
|
+
}
|
|
926
|
+
# ifdef _MSC_VER
|
|
927
|
+
PyMODINIT_FUNC
|
|
928
|
+
# if PY_MAJOR_VERSION >= 3
|
|
929
|
+
PyInit_temp_trap_cffi(void) { return NULL; }
|
|
930
|
+
# else
|
|
931
|
+
inittemp_trap_cffi(void) { }
|
|
932
|
+
# endif
|
|
933
|
+
# endif
|
|
934
|
+
#elif PY_MAJOR_VERSION >= 3
|
|
935
|
+
PyMODINIT_FUNC
|
|
936
|
+
PyInit_temp_trap_cffi(void)
|
|
937
|
+
{
|
|
938
|
+
return _cffi_init("temp_trap_cffi", 0x2601, &_cffi_type_context);
|
|
939
|
+
}
|
|
940
|
+
#else
|
|
941
|
+
PyMODINIT_FUNC
|
|
942
|
+
inittemp_trap_cffi(void)
|
|
943
|
+
{
|
|
944
|
+
_cffi_init("temp_trap_cffi", 0x2601, &_cffi_type_context);
|
|
945
|
+
}
|
|
946
|
+
#endif
|
|
947
|
+
|
|
948
|
+
#ifdef __GNUC__
|
|
949
|
+
# pragma GCC visibility pop
|
|
950
|
+
#endif
|