3 #define PY_SSIZE_T_CLEAN
6 #error Python headers needed to compile C extensions, please install development version of Python.
7 #elif PY_VERSION_HEX < 0x02060000 || (0x03000000 <= PY_VERSION_HEX && PY_VERSION_HEX < 0x03020000)
8 #error Cython requires Python 2.6+ or Python 3.2+.
10 #define CYTHON_ABI "0_25_2"
13 #define offsetof(type, member) ( (size_t) & ((type*)0) -> member )
15 #if !defined(WIN32) && !defined(MS_WINDOWS)
27 #define DL_IMPORT(t) t
30 #define DL_EXPORT(t) t
32 #ifndef HAVE_LONG_LONG
33 #if PY_VERSION_HEX >= 0x03030000 || (PY_MAJOR_VERSION == 2 && PY_VERSION_HEX >= 0x02070000)
34 #define HAVE_LONG_LONG
38 #define PY_LONG_LONG LONG_LONG
41 #define Py_HUGE_VAL HUGE_VAL
44 #define CYTHON_COMPILING_IN_PYPY 1
45 #define CYTHON_COMPILING_IN_PYSTON 0
46 #define CYTHON_COMPILING_IN_CPYTHON 0
47 #undef CYTHON_USE_TYPE_SLOTS
48 #define CYTHON_USE_TYPE_SLOTS 0
49 #undef CYTHON_USE_ASYNC_SLOTS
50 #define CYTHON_USE_ASYNC_SLOTS 0
51 #undef CYTHON_USE_PYLIST_INTERNALS
52 #define CYTHON_USE_PYLIST_INTERNALS 0
53 #undef CYTHON_USE_UNICODE_INTERNALS
54 #define CYTHON_USE_UNICODE_INTERNALS 0
55 #undef CYTHON_USE_UNICODE_WRITER
56 #define CYTHON_USE_UNICODE_WRITER 0
57 #undef CYTHON_USE_PYLONG_INTERNALS
58 #define CYTHON_USE_PYLONG_INTERNALS 0
59 #undef CYTHON_AVOID_BORROWED_REFS
60 #define CYTHON_AVOID_BORROWED_REFS 1
61 #undef CYTHON_ASSUME_SAFE_MACROS
62 #define CYTHON_ASSUME_SAFE_MACROS 0
63 #undef CYTHON_UNPACK_METHODS
64 #define CYTHON_UNPACK_METHODS 0
65 #undef CYTHON_FAST_THREAD_STATE
66 #define CYTHON_FAST_THREAD_STATE 0
67 #undef CYTHON_FAST_PYCALL
68 #define CYTHON_FAST_PYCALL 0
69 #elif defined(PYSTON_VERSION)
70 #define CYTHON_COMPILING_IN_PYPY 0
71 #define CYTHON_COMPILING_IN_PYSTON 1
72 #define CYTHON_COMPILING_IN_CPYTHON 0
73 #ifndef CYTHON_USE_TYPE_SLOTS
74 #define CYTHON_USE_TYPE_SLOTS 1
76 #undef CYTHON_USE_ASYNC_SLOTS
77 #define CYTHON_USE_ASYNC_SLOTS 0
78 #undef CYTHON_USE_PYLIST_INTERNALS
79 #define CYTHON_USE_PYLIST_INTERNALS 0
80 #ifndef CYTHON_USE_UNICODE_INTERNALS
81 #define CYTHON_USE_UNICODE_INTERNALS 1
83 #undef CYTHON_USE_UNICODE_WRITER
84 #define CYTHON_USE_UNICODE_WRITER 0
85 #undef CYTHON_USE_PYLONG_INTERNALS
86 #define CYTHON_USE_PYLONG_INTERNALS 0
87 #ifndef CYTHON_AVOID_BORROWED_REFS
88 #define CYTHON_AVOID_BORROWED_REFS 0
90 #ifndef CYTHON_ASSUME_SAFE_MACROS
91 #define CYTHON_ASSUME_SAFE_MACROS 1
93 #ifndef CYTHON_UNPACK_METHODS
94 #define CYTHON_UNPACK_METHODS 1
96 #undef CYTHON_FAST_THREAD_STATE
97 #define CYTHON_FAST_THREAD_STATE 0
98 #undef CYTHON_FAST_PYCALL
99 #define CYTHON_FAST_PYCALL 0
101 #define CYTHON_COMPILING_IN_PYPY 0
102 #define CYTHON_COMPILING_IN_PYSTON 0
103 #define CYTHON_COMPILING_IN_CPYTHON 1
104 #ifndef CYTHON_USE_TYPE_SLOTS
105 #define CYTHON_USE_TYPE_SLOTS 1
107 #if PY_MAJOR_VERSION < 3
108 #undef CYTHON_USE_ASYNC_SLOTS
109 #define CYTHON_USE_ASYNC_SLOTS 0
110 #elif !defined(CYTHON_USE_ASYNC_SLOTS)
111 #define CYTHON_USE_ASYNC_SLOTS 1
113 #if PY_VERSION_HEX < 0x02070000
114 #undef CYTHON_USE_PYLONG_INTERNALS
115 #define CYTHON_USE_PYLONG_INTERNALS 0
116 #elif !defined(CYTHON_USE_PYLONG_INTERNALS)
117 #define CYTHON_USE_PYLONG_INTERNALS 1
119 #ifndef CYTHON_USE_PYLIST_INTERNALS
120 #define CYTHON_USE_PYLIST_INTERNALS 1
122 #ifndef CYTHON_USE_UNICODE_INTERNALS
123 #define CYTHON_USE_UNICODE_INTERNALS 1
125 #if PY_VERSION_HEX < 0x030300F0
126 #undef CYTHON_USE_UNICODE_WRITER
127 #define CYTHON_USE_UNICODE_WRITER 0
128 #elif !defined(CYTHON_USE_UNICODE_WRITER)
129 #define CYTHON_USE_UNICODE_WRITER 1
131 #ifndef CYTHON_AVOID_BORROWED_REFS
132 #define CYTHON_AVOID_BORROWED_REFS 0
134 #ifndef CYTHON_ASSUME_SAFE_MACROS
135 #define CYTHON_ASSUME_SAFE_MACROS 1
137 #ifndef CYTHON_UNPACK_METHODS
138 #define CYTHON_UNPACK_METHODS 1
140 #ifndef CYTHON_FAST_THREAD_STATE
141 #define CYTHON_FAST_THREAD_STATE 1
143 #ifndef CYTHON_FAST_PYCALL
144 #define CYTHON_FAST_PYCALL 1
147 #if !defined(CYTHON_FAST_PYCCALL)
148 #define CYTHON_FAST_PYCCALL (CYTHON_FAST_PYCALL && PY_VERSION_HEX >= 0x030600B1)
150 #if CYTHON_USE_PYLONG_INTERNALS
151 #include "longintrepr.h"
156 #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x02070600 && !defined(Py_OptimizeFlag)
157 #define Py_OptimizeFlag 0
159 #define __PYX_BUILD_PY_SSIZE_T "n"
160 #define CYTHON_FORMAT_SSIZE_T "z"
161 #if PY_MAJOR_VERSION < 3
162 #define __Pyx_BUILTIN_MODULE_NAME "__builtin__"
163 #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\
164 PyCode_New(a+k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)
165 #define __Pyx_DefaultClassType PyClass_Type
167 #define __Pyx_BUILTIN_MODULE_NAME "builtins"
168 #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\
169 PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)
170 #define __Pyx_DefaultClassType PyType_Type
172 #ifndef Py_TPFLAGS_CHECKTYPES
173 #define Py_TPFLAGS_CHECKTYPES 0
175 #ifndef Py_TPFLAGS_HAVE_INDEX
176 #define Py_TPFLAGS_HAVE_INDEX 0
178 #ifndef Py_TPFLAGS_HAVE_NEWBUFFER
179 #define Py_TPFLAGS_HAVE_NEWBUFFER 0
181 #ifndef Py_TPFLAGS_HAVE_FINALIZE
182 #define Py_TPFLAGS_HAVE_FINALIZE 0
184 #ifndef METH_FASTCALL
185 #define METH_FASTCALL 0x80
186 typedef PyObject *(*__Pyx_PyCFunctionFast) (PyObject *
self, PyObject **args,
187 Py_ssize_t
nargs, PyObject *kwnames);
189 #define __Pyx_PyCFunctionFast _PyCFunctionFast
191 #if CYTHON_FAST_PYCCALL
192 #define __Pyx_PyFastCFunction_Check(func)\
193 ((PyCFunction_Check(func) && (METH_FASTCALL == (PyCFunction_GET_FLAGS(func) & ~(METH_CLASS | METH_STATIC | METH_COEXIST)))))
195 #define __Pyx_PyFastCFunction_Check(func) 0
197 #if PY_VERSION_HEX > 0x03030000 && defined(PyUnicode_KIND)
198 #define CYTHON_PEP393_ENABLED 1
199 #define __Pyx_PyUnicode_READY(op) (likely(PyUnicode_IS_READY(op)) ?\
200 0 : _PyUnicode_Ready((PyObject *)(op)))
201 #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_LENGTH(u)
202 #define __Pyx_PyUnicode_READ_CHAR(u, i) PyUnicode_READ_CHAR(u, i)
203 #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u) PyUnicode_MAX_CHAR_VALUE(u)
204 #define __Pyx_PyUnicode_KIND(u) PyUnicode_KIND(u)
205 #define __Pyx_PyUnicode_DATA(u) PyUnicode_DATA(u)
206 #define __Pyx_PyUnicode_READ(k, d, i) PyUnicode_READ(k, d, i)
207 #define __Pyx_PyUnicode_WRITE(k, d, i, ch) PyUnicode_WRITE(k, d, i, ch)
208 #define __Pyx_PyUnicode_IS_TRUE(u) (0 != (likely(PyUnicode_IS_READY(u)) ? PyUnicode_GET_LENGTH(u) : PyUnicode_GET_SIZE(u)))
210 #define CYTHON_PEP393_ENABLED 0
211 #define PyUnicode_1BYTE_KIND 1
212 #define PyUnicode_2BYTE_KIND 2
213 #define PyUnicode_4BYTE_KIND 4
214 #define __Pyx_PyUnicode_READY(op) (0)
215 #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_SIZE(u)
216 #define __Pyx_PyUnicode_READ_CHAR(u, i) ((Py_UCS4)(PyUnicode_AS_UNICODE(u)[i]))
217 #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u) ((sizeof(Py_UNICODE) == 2) ? 65535 : 1114111)
218 #define __Pyx_PyUnicode_KIND(u) (sizeof(Py_UNICODE))
219 #define __Pyx_PyUnicode_DATA(u) ((void*)PyUnicode_AS_UNICODE(u))
220 #define __Pyx_PyUnicode_READ(k, d, i) ((void)(k), (Py_UCS4)(((Py_UNICODE*)d)[i]))
221 #define __Pyx_PyUnicode_WRITE(k, d, i, ch) (((void)(k)), ((Py_UNICODE*)d)[i] = ch)
222 #define __Pyx_PyUnicode_IS_TRUE(u) (0 != PyUnicode_GET_SIZE(u))
224 #if CYTHON_COMPILING_IN_PYPY
225 #define __Pyx_PyUnicode_Concat(a, b) PyNumber_Add(a, b)
226 #define __Pyx_PyUnicode_ConcatSafe(a, b) PyNumber_Add(a, b)
228 #define __Pyx_PyUnicode_Concat(a, b) PyUnicode_Concat(a, b)
229 #define __Pyx_PyUnicode_ConcatSafe(a, b) ((unlikely((a) == Py_None) || unlikely((b) == Py_None)) ?\
230 PyNumber_Add(a, b) : __Pyx_PyUnicode_Concat(a, b))
232 #if CYTHON_COMPILING_IN_PYPY && !defined(PyUnicode_Contains)
233 #define PyUnicode_Contains(u, s) PySequence_Contains(u, s)
235 #if CYTHON_COMPILING_IN_PYPY && !defined(PyByteArray_Check)
236 #define PyByteArray_Check(obj) PyObject_TypeCheck(obj, &PyByteArray_Type)
238 #if CYTHON_COMPILING_IN_PYPY && !defined(PyObject_Format)
239 #define PyObject_Format(obj, fmt) PyObject_CallMethod(obj, "__format__", "O", fmt)
241 #if CYTHON_COMPILING_IN_PYPY && !defined(PyObject_Malloc)
242 #define PyObject_Malloc(s) PyMem_Malloc(s)
243 #define PyObject_Free(p) PyMem_Free(p)
244 #define PyObject_Realloc(p) PyMem_Realloc(p)
246 #if CYTHON_COMPILING_IN_PYSTON
247 #define __Pyx_PyCode_HasFreeVars(co) PyCode_HasFreeVars(co)
248 #define __Pyx_PyFrame_SetLineNumber(frame, lineno) PyFrame_SetLineNumber(frame, lineno)
250 #define __Pyx_PyCode_HasFreeVars(co) (PyCode_GetNumFree(co) > 0)
251 #define __Pyx_PyFrame_SetLineNumber(frame, lineno) (frame)->f_lineno = (lineno)
253 #define __Pyx_PyString_FormatSafe(a, b) ((unlikely((a) == Py_None)) ? PyNumber_Remainder(a, b) : __Pyx_PyString_Format(a, b))
254 #define __Pyx_PyUnicode_FormatSafe(a, b) ((unlikely((a) == Py_None)) ? PyNumber_Remainder(a, b) : PyUnicode_Format(a, b))
255 #if PY_MAJOR_VERSION >= 3
256 #define __Pyx_PyString_Format(a, b) PyUnicode_Format(a, b)
258 #define __Pyx_PyString_Format(a, b) PyString_Format(a, b)
260 #if PY_MAJOR_VERSION < 3 && !defined(PyObject_ASCII)
261 #define PyObject_ASCII(o) PyObject_Repr(o)
263 #if PY_MAJOR_VERSION >= 3
264 #define PyBaseString_Type PyUnicode_Type
265 #define PyStringObject PyUnicodeObject
266 #define PyString_Type PyUnicode_Type
267 #define PyString_Check PyUnicode_Check
268 #define PyString_CheckExact PyUnicode_CheckExact
270 #if PY_MAJOR_VERSION >= 3
271 #define __Pyx_PyBaseString_Check(obj) PyUnicode_Check(obj)
272 #define __Pyx_PyBaseString_CheckExact(obj) PyUnicode_CheckExact(obj)
274 #define __Pyx_PyBaseString_Check(obj) (PyString_Check(obj) || PyUnicode_Check(obj))
275 #define __Pyx_PyBaseString_CheckExact(obj) (PyString_CheckExact(obj) || PyUnicode_CheckExact(obj))
277 #ifndef PySet_CheckExact
278 #define PySet_CheckExact(obj) (Py_TYPE(obj) == &PySet_Type)
280 #define __Pyx_TypeCheck(obj, type) PyObject_TypeCheck(obj, (PyTypeObject *)type)
281 #define __Pyx_PyException_Check(obj) __Pyx_TypeCheck(obj, PyExc_Exception)
282 #if PY_MAJOR_VERSION >= 3
283 #define PyIntObject PyLongObject
284 #define PyInt_Type PyLong_Type
285 #define PyInt_Check(op) PyLong_Check(op)
286 #define PyInt_CheckExact(op) PyLong_CheckExact(op)
287 #define PyInt_FromString PyLong_FromString
288 #define PyInt_FromUnicode PyLong_FromUnicode
289 #define PyInt_FromLong PyLong_FromLong
290 #define PyInt_FromSize_t PyLong_FromSize_t
291 #define PyInt_FromSsize_t PyLong_FromSsize_t
292 #define PyInt_AsLong PyLong_AsLong
293 #define PyInt_AS_LONG PyLong_AS_LONG
294 #define PyInt_AsSsize_t PyLong_AsSsize_t
295 #define PyInt_AsUnsignedLongMask PyLong_AsUnsignedLongMask
296 #define PyInt_AsUnsignedLongLongMask PyLong_AsUnsignedLongLongMask
297 #define PyNumber_Int PyNumber_Long
299 #if PY_MAJOR_VERSION >= 3
300 #define PyBoolObject PyLongObject
302 #if PY_MAJOR_VERSION >= 3 && CYTHON_COMPILING_IN_PYPY
303 #ifndef PyUnicode_InternFromString
304 #define PyUnicode_InternFromString(s) PyUnicode_FromString(s)
307 #if PY_VERSION_HEX < 0x030200A4
308 typedef long Py_hash_t;
309 #define __Pyx_PyInt_FromHash_t PyInt_FromLong
310 #define __Pyx_PyInt_AsHash_t PyInt_AsLong
312 #define __Pyx_PyInt_FromHash_t PyInt_FromSsize_t
313 #define __Pyx_PyInt_AsHash_t PyInt_AsSsize_t
315 #if PY_MAJOR_VERSION >= 3
316 #define __Pyx_PyMethod_New(func, self, klass) ((self) ? PyMethod_New(func, self) : PyInstanceMethod_New(func))
318 #define __Pyx_PyMethod_New(func, self, klass) PyMethod_New(func, self, klass)
320 #if CYTHON_USE_ASYNC_SLOTS
321 #if PY_VERSION_HEX >= 0x030500B1
322 #define __Pyx_PyAsyncMethodsStruct PyAsyncMethods
323 #define __Pyx_PyType_AsAsync(obj) (Py_TYPE(obj)->tp_as_async)
329 } __Pyx_PyAsyncMethodsStruct;
330 #define __Pyx_PyType_AsAsync(obj) ((__Pyx_PyAsyncMethodsStruct*) (Py_TYPE(obj)->tp_reserved))
333 #define __Pyx_PyType_AsAsync(obj) NULL
335 #ifndef CYTHON_RESTRICT
336 #if defined(__GNUC__)
337 #define CYTHON_RESTRICT __restrict__
338 #elif defined(_MSC_VER) && _MSC_VER >= 1400
339 #define CYTHON_RESTRICT __restrict
340 #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
341 #define CYTHON_RESTRICT restrict
343 #define CYTHON_RESTRICT
346 #ifndef CYTHON_UNUSED
347 # if defined(__GNUC__)
348 # if !(defined(__cplusplus)) || (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4))
349 # define CYTHON_UNUSED __attribute__ ((__unused__))
351 # define CYTHON_UNUSED
353 # elif defined(__ICC) || (defined(__INTEL_COMPILER) && !defined(_MSC_VER))
354 # define CYTHON_UNUSED __attribute__ ((__unused__))
356 # define CYTHON_UNUSED
359 #ifndef CYTHON_MAYBE_UNUSED_VAR
360 # if defined(__cplusplus)
361 template<
class T>
void CYTHON_MAYBE_UNUSED_VAR(
const T& ) { }
363 # define CYTHON_MAYBE_UNUSED_VAR(x) (void)(x)
366 #ifndef CYTHON_NCP_UNUSED
367 # if CYTHON_COMPILING_IN_CPYTHON
368 # define CYTHON_NCP_UNUSED
370 # define CYTHON_NCP_UNUSED CYTHON_UNUSED
373 #define __Pyx_void_to_None(void_result) ((void)(void_result), Py_INCREF(Py_None), Py_None)
375 #ifndef CYTHON_INLINE
376 #if defined(__clang__)
377 #define CYTHON_INLINE __inline__ __attribute__ ((__unused__))
378 #elif defined(__GNUC__)
379 #define CYTHON_INLINE __inline__
380 #elif defined(_MSC_VER)
381 #define CYTHON_INLINE __inline
382 #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
383 #define CYTHON_INLINE inline
385 #define CYTHON_INLINE
389 #if defined(WIN32) || defined(MS_WINDOWS)
390 #define _USE_MATH_DEFINES
394 #define __PYX_NAN() ((float) NAN)
396 static CYTHON_INLINE
float __PYX_NAN() {
398 memset(&value, 0xFF,
sizeof(value));
402 #if defined(__CYGWIN__) && defined(_LDBL_EQ_DBL)
403 #define __Pyx_truncl trunc
405 #define __Pyx_truncl truncl
409 #define __PYX_ERR(f_index, lineno, Ln_error) \
411 __pyx_filename = __pyx_f[f_index]; __pyx_lineno = lineno; __pyx_clineno = __LINE__; goto Ln_error; \
414 #if PY_MAJOR_VERSION >= 3
415 #define __Pyx_PyNumber_Divide(x,y) PyNumber_TrueDivide(x,y)
416 #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceTrueDivide(x,y)
418 #define __Pyx_PyNumber_Divide(x,y) PyNumber_Divide(x,y)
419 #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceDivide(x,y)
422 #ifndef __PYX_EXTERN_C
424 #define __PYX_EXTERN_C extern "C"
426 #define __PYX_EXTERN_C extern
430 #define __PYX_HAVE__amns
431 #define __PYX_HAVE_API__amns
432 #include "amns_interface.h"
436 #include "numpy/arrayobject.h"
437 #include "numpy/ufuncobject.h"
442 #ifdef PYREX_WITHOUT_ASSERTIONS
443 #define CYTHON_WITHOUT_ASSERTIONS
446 typedef struct {PyObject **p;
const char *s;
const Py_ssize_t n;
const char* encoding;
447 const char is_unicode;
const char is_str;
const char intern; } __Pyx_StringTabEntry;
449 #define __PYX_DEFAULT_STRING_ENCODING_IS_ASCII 0
450 #define __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT 0
451 #define __PYX_DEFAULT_STRING_ENCODING ""
452 #define __Pyx_PyObject_FromString __Pyx_PyBytes_FromString
453 #define __Pyx_PyObject_FromStringAndSize __Pyx_PyBytes_FromStringAndSize
454 #define __Pyx_uchar_cast(c) ((unsigned char)c)
455 #define __Pyx_long_cast(x) ((long)x)
456 #define __Pyx_fits_Py_ssize_t(v, type, is_signed) (\
457 (sizeof(type) < sizeof(Py_ssize_t)) ||\
458 (sizeof(type) > sizeof(Py_ssize_t) &&\
459 likely(v < (type)PY_SSIZE_T_MAX ||\
460 v == (type)PY_SSIZE_T_MAX) &&\
461 (!is_signed || likely(v > (type)PY_SSIZE_T_MIN ||\
462 v == (type)PY_SSIZE_T_MIN))) ||\
463 (sizeof(type) == sizeof(Py_ssize_t) &&\
464 (is_signed || likely(v < (type)PY_SSIZE_T_MAX ||\
465 v == (type)PY_SSIZE_T_MAX))) )
466 #if defined (__cplusplus) && __cplusplus >= 201103L
468 #define __Pyx_sst_abs(value) std::abs(value)
469 #elif SIZEOF_INT >= SIZEOF_SIZE_T
470 #define __Pyx_sst_abs(value) abs(value)
471 #elif SIZEOF_LONG >= SIZEOF_SIZE_T
472 #define __Pyx_sst_abs(value) labs(value)
473 #elif defined (_MSC_VER) && defined (_M_X64)
474 #define __Pyx_sst_abs(value) _abs64(value)
475 #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
476 #define __Pyx_sst_abs(value) llabs(value)
477 #elif defined (__GNUC__)
478 #define __Pyx_sst_abs(value) __builtin_llabs(value)
480 #define __Pyx_sst_abs(value) ((value<0) ? -value : value)
482 static CYTHON_INLINE
char* __Pyx_PyObject_AsString(PyObject*);
483 static CYTHON_INLINE
char* __Pyx_PyObject_AsStringAndSize(PyObject*, Py_ssize_t* length);
484 #define __Pyx_PyByteArray_FromString(s) PyByteArray_FromStringAndSize((const char*)s, strlen((const char*)s))
485 #define __Pyx_PyByteArray_FromStringAndSize(s, l) PyByteArray_FromStringAndSize((const char*)s, l)
486 #define __Pyx_PyBytes_FromString PyBytes_FromString
487 #define __Pyx_PyBytes_FromStringAndSize PyBytes_FromStringAndSize
488 static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(
const char*);
489 #if PY_MAJOR_VERSION < 3
490 #define __Pyx_PyStr_FromString __Pyx_PyBytes_FromString
491 #define __Pyx_PyStr_FromStringAndSize __Pyx_PyBytes_FromStringAndSize
493 #define __Pyx_PyStr_FromString __Pyx_PyUnicode_FromString
494 #define __Pyx_PyStr_FromStringAndSize __Pyx_PyUnicode_FromStringAndSize
496 #define __Pyx_PyObject_AsSString(s) ((signed char*) __Pyx_PyObject_AsString(s))
497 #define __Pyx_PyObject_AsUString(s) ((unsigned char*) __Pyx_PyObject_AsString(s))
498 #define __Pyx_PyObject_FromCString(s) __Pyx_PyObject_FromString((const char*)s)
499 #define __Pyx_PyBytes_FromCString(s) __Pyx_PyBytes_FromString((const char*)s)
500 #define __Pyx_PyByteArray_FromCString(s) __Pyx_PyByteArray_FromString((const char*)s)
501 #define __Pyx_PyStr_FromCString(s) __Pyx_PyStr_FromString((const char*)s)
502 #define __Pyx_PyUnicode_FromCString(s) __Pyx_PyUnicode_FromString((const char*)s)
503 #if PY_MAJOR_VERSION < 3
504 static CYTHON_INLINE
size_t __Pyx_Py_UNICODE_strlen(
const Py_UNICODE *u)
506 const Py_UNICODE *u_end = u;
508 return (
size_t)(u_end - u - 1);
511 #define __Pyx_Py_UNICODE_strlen Py_UNICODE_strlen
513 #define __Pyx_PyUnicode_FromUnicode(u) PyUnicode_FromUnicode(u, __Pyx_Py_UNICODE_strlen(u))
514 #define __Pyx_PyUnicode_FromUnicodeAndLength PyUnicode_FromUnicode
515 #define __Pyx_PyUnicode_AsUnicode PyUnicode_AsUnicode
516 #define __Pyx_NewRef(obj) (Py_INCREF(obj), obj)
517 #define __Pyx_Owned_Py_None(b) __Pyx_NewRef(Py_None)
518 #define __Pyx_PyBool_FromLong(b) ((b) ? __Pyx_NewRef(Py_True) : __Pyx_NewRef(Py_False))
519 static CYTHON_INLINE
int __Pyx_PyObject_IsTrue(PyObject*);
520 static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x);
521 static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject*);
522 static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(
size_t);
523 #if CYTHON_ASSUME_SAFE_MACROS
524 #define __pyx_PyFloat_AsDouble(x) (PyFloat_CheckExact(x) ? PyFloat_AS_DOUBLE(x) : PyFloat_AsDouble(x))
526 #define __pyx_PyFloat_AsDouble(x) PyFloat_AsDouble(x)
528 #define __pyx_PyFloat_AsFloat(x) ((float) __pyx_PyFloat_AsDouble(x))
529 #if PY_MAJOR_VERSION >= 3
530 #define __Pyx_PyNumber_Int(x) (PyLong_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Long(x))
532 #define __Pyx_PyNumber_Int(x) (PyInt_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Int(x))
534 #define __Pyx_PyNumber_Float(x) (PyFloat_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Float(x))
535 #if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
536 static int __Pyx_sys_getdefaultencoding_not_ascii;
537 static int __Pyx_init_sys_getdefaultencoding_params(
void) {
539 PyObject* default_encoding = NULL;
540 PyObject* ascii_chars_u = NULL;
541 PyObject* ascii_chars_b = NULL;
542 const char* default_encoding_c;
543 sys = PyImport_ImportModule(
"sys");
545 default_encoding = PyObject_CallMethod(sys, (
char*)
"getdefaultencoding", NULL);
547 if (!default_encoding)
goto bad;
548 default_encoding_c = PyBytes_AsString(default_encoding);
549 if (!default_encoding_c)
goto bad;
550 if (strcmp(default_encoding_c,
"ascii") == 0) {
551 __Pyx_sys_getdefaultencoding_not_ascii = 0;
553 char ascii_chars[128];
555 for (c = 0; c < 128; c++) {
558 __Pyx_sys_getdefaultencoding_not_ascii = 1;
559 ascii_chars_u = PyUnicode_DecodeASCII(ascii_chars, 128, NULL);
560 if (!ascii_chars_u)
goto bad;
561 ascii_chars_b = PyUnicode_AsEncodedString(ascii_chars_u, default_encoding_c, NULL);
562 if (!ascii_chars_b || !PyBytes_Check(ascii_chars_b) || memcmp(ascii_chars, PyBytes_AS_STRING(ascii_chars_b), 128) != 0) {
565 "This module compiled with c_string_encoding=ascii, but default encoding '%.200s' is not a superset of ascii.",
569 Py_DECREF(ascii_chars_u);
570 Py_DECREF(ascii_chars_b);
572 Py_DECREF(default_encoding);
575 Py_XDECREF(default_encoding);
576 Py_XDECREF(ascii_chars_u);
577 Py_XDECREF(ascii_chars_b);
581 #if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT && PY_MAJOR_VERSION >= 3
582 #define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_DecodeUTF8(c_str, size, NULL)
584 #define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_Decode(c_str, size, __PYX_DEFAULT_STRING_ENCODING, NULL)
585 #if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT
586 static char* __PYX_DEFAULT_STRING_ENCODING;
587 static int __Pyx_init_sys_getdefaultencoding_params(
void) {
589 PyObject* default_encoding = NULL;
590 char* default_encoding_c;
591 sys = PyImport_ImportModule(
"sys");
593 default_encoding = PyObject_CallMethod(sys, (
char*) (
const char*)
"getdefaultencoding", NULL);
595 if (!default_encoding)
goto bad;
596 default_encoding_c = PyBytes_AsString(default_encoding);
597 if (!default_encoding_c)
goto bad;
598 __PYX_DEFAULT_STRING_ENCODING = (
char*) malloc(strlen(default_encoding_c));
599 if (!__PYX_DEFAULT_STRING_ENCODING)
goto bad;
600 strcpy(__PYX_DEFAULT_STRING_ENCODING, default_encoding_c);
601 Py_DECREF(default_encoding);
604 Py_XDECREF(default_encoding);
612 #if defined(__GNUC__) && (__GNUC__ > 2 || (__GNUC__ == 2 && (__GNUC_MINOR__ > 95)))
613 #define likely(x) __builtin_expect(!!(x), 1)
614 #define unlikely(x) __builtin_expect(!!(x), 0)
616 #define likely(x) (x)
617 #define unlikely(x) (x)
620 static PyObject *__pyx_m;
621 static PyObject *__pyx_d;
622 static PyObject *__pyx_b;
623 static PyObject *__pyx_empty_tuple;
624 static PyObject *__pyx_empty_bytes;
625 static PyObject *__pyx_empty_unicode;
626 static int __pyx_lineno;
627 static int __pyx_clineno = 0;
628 static const char * __pyx_cfilenm= __FILE__;
629 static const char *__pyx_filename;
632 #if !defined(CYTHON_CCOMPLEX)
633 #if defined(__cplusplus)
634 #define CYTHON_CCOMPLEX 1
635 #elif defined(_Complex_I)
636 #define CYTHON_CCOMPLEX 1
638 #define CYTHON_CCOMPLEX 0
648 #if CYTHON_CCOMPLEX && !defined(__cplusplus) && defined(__sun__) && defined(__GNUC__)
650 #define _Complex_I 1.0fj
654 static const char *__pyx_f[] = {
661 #define IS_UNSIGNED(type) (((type) -1) > 0)
662 struct __Pyx_StructField_;
663 #define __PYX_BUF_FLAGS_PACKED_STRUCT (1 << 0)
666 struct __Pyx_StructField_* fields;
674 typedef struct __Pyx_StructField_ {
675 __Pyx_TypeInfo* type;
680 __Pyx_StructField* field;
681 size_t parent_offset;
682 } __Pyx_BufFmt_StackElem;
684 __Pyx_StructField root;
685 __Pyx_BufFmt_StackElem* head;
687 size_t new_count, enc_count;
688 size_t struct_alignment;
694 } __Pyx_BufFmt_Context;
704 typedef npy_int8 __pyx_t_5numpy_int8_t;
713 typedef npy_int16 __pyx_t_5numpy_int16_t;
722 typedef npy_int32 __pyx_t_5numpy_int32_t;
731 typedef npy_int64 __pyx_t_5numpy_int64_t;
740 typedef npy_uint8 __pyx_t_5numpy_uint8_t;
749 typedef npy_uint16 __pyx_t_5numpy_uint16_t;
758 typedef npy_uint32 __pyx_t_5numpy_uint32_t;
767 typedef npy_uint64 __pyx_t_5numpy_uint64_t;
776 typedef npy_float32 __pyx_t_5numpy_float32_t;
785 typedef npy_float64 __pyx_t_5numpy_float64_t;
794 typedef npy_long __pyx_t_5numpy_int_t;
803 typedef npy_longlong __pyx_t_5numpy_long_t;
812 typedef npy_longlong __pyx_t_5numpy_longlong_t;
821 typedef npy_ulong __pyx_t_5numpy_uint_t;
830 typedef npy_ulonglong __pyx_t_5numpy_ulong_t;
839 typedef npy_ulonglong __pyx_t_5numpy_ulonglong_t;
848 typedef npy_intp __pyx_t_5numpy_intp_t;
857 typedef npy_uintp __pyx_t_5numpy_uintp_t;
866 typedef npy_double __pyx_t_5numpy_float_t;
875 typedef npy_double __pyx_t_5numpy_double_t;
884 typedef npy_longdouble __pyx_t_5numpy_longdouble_t;
888 typedef ::std::complex< float > __pyx_t_float_complex;
890 typedef float _Complex __pyx_t_float_complex;
893 typedef struct {
float real, imag; } __pyx_t_float_complex;
895 static CYTHON_INLINE __pyx_t_float_complex __pyx_t_float_complex_from_parts(
float,
float);
900 typedef ::std::complex< double > __pyx_t_double_complex;
902 typedef double _Complex __pyx_t_double_complex;
905 typedef struct {
double real, imag; } __pyx_t_double_complex;
907 static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(
double,
double);
911 struct __pyx_obj_4amns_Amns;
912 struct __pyx_obj_4amns_Table;
913 struct __pyx_obj_4amns_Reactants;
922 typedef npy_cfloat __pyx_t_5numpy_cfloat_t;
931 typedef npy_cdouble __pyx_t_5numpy_cdouble_t;
940 typedef npy_clongdouble __pyx_t_5numpy_clongdouble_t;
949 typedef npy_cdouble __pyx_t_5numpy_complex_t;
958 struct __pyx_obj_4amns_Amns {
960 struct __pyx_vtabstruct_4amns_Amns *__pyx_vtab;
972 struct __pyx_obj_4amns_Table {
974 struct __pyx_vtabstruct_4amns_Table *__pyx_vtab;
976 struct __pyx_obj_4amns_Amns *_parentAmns;
987 struct __pyx_obj_4amns_Reactants {
989 struct __pyx_vtabstruct_4amns_Reactants *__pyx_vtab;
991 PyObject *_reactants;
1004 struct __pyx_vtabstruct_4amns_Amns {
1005 void *(*handle)(
struct __pyx_obj_4amns_Amns *);
1008 static struct __pyx_vtabstruct_4amns_Amns *__pyx_vtabptr_4amns_Amns;
1019 struct __pyx_vtabstruct_4amns_Table {
1022 static struct __pyx_vtabstruct_4amns_Table *__pyx_vtabptr_4amns_Table;
1033 struct __pyx_vtabstruct_4amns_Reactants {
1034 void *(*handle)(
struct __pyx_obj_4amns_Reactants *);
1036 static struct __pyx_vtabstruct_4amns_Reactants *__pyx_vtabptr_4amns_Reactants;
1040 #ifndef CYTHON_REFNANNY
1041 #define CYTHON_REFNANNY 0
1045 void (*INCREF)(
void*, PyObject*, int);
1046 void (*DECREF)(
void*, PyObject*, int);
1047 void (*GOTREF)(
void*, PyObject*, int);
1048 void (*GIVEREF)(
void*, PyObject*, int);
1049 void* (*SetupContext)(
const char*, int,
const char*);
1050 void (*FinishContext)(
void**);
1051 } __Pyx_RefNannyAPIStruct;
1052 static __Pyx_RefNannyAPIStruct *__Pyx_RefNanny = NULL;
1053 static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(
const char *modname);
1054 #define __Pyx_RefNannyDeclarations void *__pyx_refnanny = NULL;
1056 #define __Pyx_RefNannySetupContext(name, acquire_gil)\
1058 PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();\
1059 __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__);\
1060 PyGILState_Release(__pyx_gilstate_save);\
1062 __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__);\
1065 #define __Pyx_RefNannySetupContext(name, acquire_gil)\
1066 __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__)
1068 #define __Pyx_RefNannyFinishContext()\
1069 __Pyx_RefNanny->FinishContext(&__pyx_refnanny)
1070 #define __Pyx_INCREF(r) __Pyx_RefNanny->INCREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
1071 #define __Pyx_DECREF(r) __Pyx_RefNanny->DECREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
1072 #define __Pyx_GOTREF(r) __Pyx_RefNanny->GOTREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
1073 #define __Pyx_GIVEREF(r) __Pyx_RefNanny->GIVEREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
1074 #define __Pyx_XINCREF(r) do { if((r) != NULL) {__Pyx_INCREF(r); }} while(0)
1075 #define __Pyx_XDECREF(r) do { if((r) != NULL) {__Pyx_DECREF(r); }} while(0)
1076 #define __Pyx_XGOTREF(r) do { if((r) != NULL) {__Pyx_GOTREF(r); }} while(0)
1077 #define __Pyx_XGIVEREF(r) do { if((r) != NULL) {__Pyx_GIVEREF(r);}} while(0)
1079 #define __Pyx_RefNannyDeclarations
1080 #define __Pyx_RefNannySetupContext(name, acquire_gil)
1081 #define __Pyx_RefNannyFinishContext()
1082 #define __Pyx_INCREF(r) Py_INCREF(r)
1083 #define __Pyx_DECREF(r) Py_DECREF(r)
1084 #define __Pyx_GOTREF(r)
1085 #define __Pyx_GIVEREF(r)
1086 #define __Pyx_XINCREF(r) Py_XINCREF(r)
1087 #define __Pyx_XDECREF(r) Py_XDECREF(r)
1088 #define __Pyx_XGOTREF(r)
1089 #define __Pyx_XGIVEREF(r)
1091 #define __Pyx_XDECREF_SET(r, v) do {\
1092 PyObject *tmp = (PyObject *) r;\
1093 r = v; __Pyx_XDECREF(tmp);\
1095 #define __Pyx_DECREF_SET(r, v) do {\
1096 PyObject *tmp = (PyObject *) r;\
1097 r = v; __Pyx_DECREF(tmp);\
1099 #define __Pyx_CLEAR(r) do { PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);} while(0)
1100 #define __Pyx_XCLEAR(r) do { if((r) != NULL) {PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);}} while(0)
1103 #if CYTHON_USE_TYPE_SLOTS
1104 static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name) {
1105 PyTypeObject* tp = Py_TYPE(obj);
1106 if (likely(tp->tp_getattro))
1107 return tp->tp_getattro(obj, attr_name);
1108 #if PY_MAJOR_VERSION < 3
1109 if (likely(tp->tp_getattr))
1110 return tp->tp_getattr(obj, PyString_AS_STRING(attr_name));
1112 return PyObject_GetAttr(obj, attr_name);
1115 #define __Pyx_PyObject_GetAttrStr(o,n) PyObject_GetAttr(o,n)
1119 static PyObject *__Pyx_GetBuiltinName(PyObject *
name);
1122 static void __Pyx_RaiseDoubleKeywordsError(
const char* func_name, PyObject* kw_name);
1125 static int __Pyx_ParseOptionalKeywords(PyObject *kwds, PyObject **argnames[],\
1126 PyObject *kwds2, PyObject *values[], Py_ssize_t num_pos_args,\
1127 const char* function_name);
1130 static void __Pyx_RaiseArgtupleInvalid(
const char* func_name,
int exact,
1131 Py_ssize_t num_min, Py_ssize_t num_max, Py_ssize_t num_found);
1134 #if CYTHON_COMPILING_IN_CPYTHON
1135 static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw);
1137 #define __Pyx_PyObject_Call(func, arg, kw) PyObject_Call(func, arg, kw)
1141 static CYTHON_INLINE PyObject *__Pyx_GetModuleGlobalName(PyObject *
name);
1144 #if CYTHON_FAST_PYCCALL
1145 static CYTHON_INLINE PyObject *__Pyx_PyCFunction_FastCall(PyObject *func, PyObject **args, Py_ssize_t
nargs);
1147 #define __Pyx_PyCFunction_FastCall(func, args, nargs) (assert(0), NULL)
1151 #if CYTHON_FAST_PYCALL
1152 #define __Pyx_PyFunction_FastCall(func, args, nargs)\
1153 __Pyx_PyFunction_FastCallDict((func), (args), (nargs), NULL)
1154 #if 1 || PY_VERSION_HEX < 0x030600B1
1155 static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args,
int nargs, PyObject *kwargs);
1157 #define __Pyx_PyFunction_FastCallDict(func, args, nargs, kwargs) _PyFunction_FastCallDict(func, args, nargs, kwargs)
1162 #if CYTHON_COMPILING_IN_CPYTHON
1163 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg);
1167 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg);
1170 #if CYTHON_FAST_THREAD_STATE
1171 #define __Pyx_PyThreadState_declare PyThreadState *__pyx_tstate;
1172 #define __Pyx_PyThreadState_assign __pyx_tstate = PyThreadState_GET();
1174 #define __Pyx_PyThreadState_declare
1175 #define __Pyx_PyThreadState_assign
1179 #if CYTHON_FAST_THREAD_STATE
1180 #define __Pyx_ErrRestoreWithState(type, value, tb) __Pyx_ErrRestoreInState(PyThreadState_GET(), type, value, tb)
1181 #define __Pyx_ErrFetchWithState(type, value, tb) __Pyx_ErrFetchInState(PyThreadState_GET(), type, value, tb)
1182 #define __Pyx_ErrRestore(type, value, tb) __Pyx_ErrRestoreInState(__pyx_tstate, type, value, tb)
1183 #define __Pyx_ErrFetch(type, value, tb) __Pyx_ErrFetchInState(__pyx_tstate, type, value, tb)
1184 static CYTHON_INLINE
void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb);
1185 static CYTHON_INLINE
void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb);
1187 #define __Pyx_ErrRestoreWithState(type, value, tb) PyErr_Restore(type, value, tb)
1188 #define __Pyx_ErrFetchWithState(type, value, tb) PyErr_Fetch(type, value, tb)
1189 #define __Pyx_ErrRestore(type, value, tb) PyErr_Restore(type, value, tb)
1190 #define __Pyx_ErrFetch(type, value, tb) PyErr_Fetch(type, value, tb)
1194 static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause);
1197 static void __Pyx_WriteUnraisable(
const char *
name,
int clineno,
1198 int lineno,
const char *filename,
1199 int full_traceback,
int nogil);
1202 static CYTHON_INLINE
int __Pyx_ArgTypeTest(PyObject *obj, PyTypeObject *type,
int none_allowed,
1203 const char *
name,
int exact);
1206 #if !CYTHON_COMPILING_IN_PYPY
1207 static PyObject* __Pyx_PyInt_AddObjC(PyObject *op1, PyObject *op2,
long intval,
int inplace);
1209 #define __Pyx_PyInt_AddObjC(op1, op2, intval, inplace)\
1210 (inplace ? PyNumber_InPlaceAdd(op1, op2) : PyNumber_Add(op1, op2))
1214 static CYTHON_INLINE
int __Pyx_GetBufferAndValidate(Py_buffer* buf, PyObject* obj,
1215 __Pyx_TypeInfo* dtype,
int flags,
int nd,
int cast, __Pyx_BufFmt_StackElem* stack);
1216 static CYTHON_INLINE
void __Pyx_SafeReleaseBuffer(Py_buffer* info);
1217 static const char* __Pyx_BufFmt_CheckString(__Pyx_BufFmt_Context* ctx,
const char* ts);
1218 static void __Pyx_BufFmt_Init(__Pyx_BufFmt_Context* ctx,
1219 __Pyx_BufFmt_StackElem* stack,
1220 __Pyx_TypeInfo* type);
1223 static CYTHON_INLINE
int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type);
1226 static void __Pyx_RaiseBufferFallbackError(
void);
1229 #if !CYTHON_COMPILING_IN_PYPY
1230 static PyObject* __Pyx_PyInt_EqObjC(PyObject *op1, PyObject *op2,
long intval,
int inplace);
1232 #define __Pyx_PyInt_EqObjC(op1, op2, intval, inplace)\
1233 PyObject_RichCompare(op1, op2, Py_EQ)
1237 static CYTHON_INLINE
int __Pyx_CheckKeywordStrings(PyObject *kwdict,
const char* function_name,
int kw_allowed);
1240 #if CYTHON_COMPILING_IN_CPYTHON
1241 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallNoArg(PyObject *func);
1243 #define __Pyx_PyObject_CallNoArg(func) __Pyx_PyObject_Call(func, __pyx_empty_tuple, NULL)
1247 #if CYTHON_USE_PYLIST_INTERNALS && CYTHON_ASSUME_SAFE_MACROS
1248 static CYTHON_INLINE
int __Pyx_PyList_Append(PyObject* list, PyObject* x) {
1249 PyListObject* L = (PyListObject*) list;
1250 Py_ssize_t
len = Py_SIZE(list);
1251 if (likely(L->allocated > len) & likely(len > (L->allocated >> 1))) {
1253 PyList_SET_ITEM(list, len, x);
1254 Py_SIZE(list) = len+1;
1257 return PyList_Append(list, x);
1260 #define __Pyx_PyList_Append(L,x) PyList_Append(L,x)
1264 static PyObject* __Pyx_PyObject_CallMethod1(PyObject* obj, PyObject* method_name, PyObject* arg);
1267 static CYTHON_INLINE
int __Pyx_PyObject_Append(PyObject* L, PyObject* x);
1270 #if PY_MAJOR_VERSION >= 3 && !CYTHON_COMPILING_IN_PYPY
1271 static PyObject *__Pyx_PyDict_GetItem(PyObject *d, PyObject* key) {
1273 value = PyDict_GetItemWithError(d, key);
1274 if (unlikely(!value)) {
1275 if (!PyErr_Occurred()) {
1276 PyObject* args = PyTuple_Pack(1, key);
1278 PyErr_SetObject(PyExc_KeyError, args);
1287 #define __Pyx_PyDict_GetItem(d, key) PyObject_GetItem(d, key)
1291 static CYTHON_INLINE
void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected);
1294 static CYTHON_INLINE
void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index);
1297 static CYTHON_INLINE
void __Pyx_RaiseNoneNotIterableError(
void);
1300 #if CYTHON_FAST_THREAD_STATE
1301 #define __Pyx_ExceptionSave(type, value, tb) __Pyx__ExceptionSave(__pyx_tstate, type, value, tb)
1302 static CYTHON_INLINE
void __Pyx__ExceptionSave(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb);
1303 #define __Pyx_ExceptionReset(type, value, tb) __Pyx__ExceptionReset(__pyx_tstate, type, value, tb)
1304 static CYTHON_INLINE
void __Pyx__ExceptionReset(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb);
1306 #define __Pyx_ExceptionSave(type, value, tb) PyErr_GetExcInfo(type, value, tb)
1307 #define __Pyx_ExceptionReset(type, value, tb) PyErr_SetExcInfo(type, value, tb)
1311 #if CYTHON_FAST_THREAD_STATE
1312 #define __Pyx_PyErr_ExceptionMatches(err) __Pyx_PyErr_ExceptionMatchesInState(__pyx_tstate, err)
1313 static CYTHON_INLINE
int __Pyx_PyErr_ExceptionMatchesInState(PyThreadState* tstate, PyObject* err);
1315 #define __Pyx_PyErr_ExceptionMatches(err) PyErr_ExceptionMatches(err)
1319 #if CYTHON_FAST_THREAD_STATE
1320 #define __Pyx_GetException(type, value, tb) __Pyx__GetException(__pyx_tstate, type, value, tb)
1321 static int __Pyx__GetException(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb);
1323 static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb);
1327 static int __Pyx_SetVtable(PyObject *dict,
void *vtable);
1330 static PyObject *__Pyx_Import(PyObject *
name, PyObject *from_list,
int level);
1333 static PyObject *__Pyx_CalculateMetaclass(PyTypeObject *metaclass, PyObject *bases);
1336 static PyObject *__Pyx_Py3MetaclassPrepare(PyObject *metaclass, PyObject *bases, PyObject *
name, PyObject *qualname,
1337 PyObject *mkw, PyObject *modname, PyObject *doc);
1338 static PyObject *__Pyx_Py3ClassCreate(PyObject *metaclass, PyObject *
name, PyObject *bases, PyObject *dict,
1339 PyObject *mkw,
int calculate_metaclass,
int allow_py2_metaclass);
1343 PyCodeObject* code_object;
1345 } __Pyx_CodeObjectCacheEntry;
1346 struct __Pyx_CodeObjectCache {
1349 __Pyx_CodeObjectCacheEntry* entries;
1351 static struct __Pyx_CodeObjectCache __pyx_code_cache = {0,0,NULL};
1352 static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries,
int count,
int code_line);
1353 static PyCodeObject *__pyx_find_code_object(
int code_line);
1354 static void __pyx_insert_code_object(
int code_line, PyCodeObject* code_object);
1357 static void __Pyx_AddTraceback(
const char *funcname,
int c_line,
1358 int py_line,
const char *filename);
1362 Py_ssize_t shape, strides, suboffsets;
1363 } __Pyx_Buf_DimInfo;
1369 __Pyx_Buffer *rcbuffer;
1371 __Pyx_Buf_DimInfo diminfo[8];
1372 } __Pyx_LocalBuf_ND;
1374 #if PY_MAJOR_VERSION < 3
1375 static int __Pyx_GetBuffer(PyObject *obj, Py_buffer *view,
int flags);
1376 static void __Pyx_ReleaseBuffer(Py_buffer *view);
1378 #define __Pyx_GetBuffer PyObject_GetBuffer
1379 #define __Pyx_ReleaseBuffer PyBuffer_Release
1384 static Py_ssize_t __Pyx_zeros[] = {0, 0, 0, 0, 0, 0, 0, 0};
1385 static Py_ssize_t __Pyx_minusones[] = {-1, -1, -1, -1, -1, -1, -1, -1};
1388 static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(
int value);
1392 static int __Pyx_Print(PyObject*, PyObject *,
int);
1393 #if CYTHON_COMPILING_IN_PYPY || PY_MAJOR_VERSION >= 3
1394 static PyObject* __pyx_print = 0;
1395 static PyObject* __pyx_print_kwargs = 0;
1402 #define __Pyx_CREAL(z) ((z).real())
1403 #define __Pyx_CIMAG(z) ((z).imag())
1405 #define __Pyx_CREAL(z) (__real__(z))
1406 #define __Pyx_CIMAG(z) (__imag__(z))
1409 #define __Pyx_CREAL(z) ((z).real)
1410 #define __Pyx_CIMAG(z) ((z).imag)
1412 #if defined(__cplusplus) && CYTHON_CCOMPLEX\
1413 && (defined(_WIN32) || defined(__clang__) || (defined(__GNUC__) && (__GNUC__ >= 5 || __GNUC__ == 4 && __GNUC_MINOR__ >= 4 )) || __cplusplus >= 201103)
1414 #define __Pyx_SET_CREAL(z,x) ((z).real(x))
1415 #define __Pyx_SET_CIMAG(z,y) ((z).imag(y))
1417 #define __Pyx_SET_CREAL(z,x) __Pyx_CREAL(z) = (x)
1418 #define __Pyx_SET_CIMAG(z,y) __Pyx_CIMAG(z) = (y)
1423 #define __Pyx_c_eq_float(a, b) ((a)==(b))
1424 #define __Pyx_c_sum_float(a, b) ((a)+(b))
1425 #define __Pyx_c_diff_float(a, b) ((a)-(b))
1426 #define __Pyx_c_prod_float(a, b) ((a)*(b))
1427 #define __Pyx_c_quot_float(a, b) ((a)/(b))
1428 #define __Pyx_c_neg_float(a) (-(a))
1430 #define __Pyx_c_is_zero_float(z) ((z)==(float)0)
1431 #define __Pyx_c_conj_float(z) (::std::conj(z))
1433 #define __Pyx_c_abs_float(z) (::std::abs(z))
1434 #define __Pyx_c_pow_float(a, b) (::std::pow(a, b))
1437 #define __Pyx_c_is_zero_float(z) ((z)==0)
1438 #define __Pyx_c_conj_float(z) (conjf(z))
1440 #define __Pyx_c_abs_float(z) (cabsf(z))
1441 #define __Pyx_c_pow_float(a, b) (cpowf(a, b))
1445 static CYTHON_INLINE
int __Pyx_c_eq_float(__pyx_t_float_complex, __pyx_t_float_complex);
1446 static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_sum_float(__pyx_t_float_complex, __pyx_t_float_complex);
1447 static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_diff_float(__pyx_t_float_complex, __pyx_t_float_complex);
1448 static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_prod_float(__pyx_t_float_complex, __pyx_t_float_complex);
1449 static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_quot_float(__pyx_t_float_complex, __pyx_t_float_complex);
1450 static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_neg_float(__pyx_t_float_complex);
1451 static CYTHON_INLINE
int __Pyx_c_is_zero_float(__pyx_t_float_complex);
1452 static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_conj_float(__pyx_t_float_complex);
1454 static CYTHON_INLINE
float __Pyx_c_abs_float(__pyx_t_float_complex);
1455 static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_pow_float(__pyx_t_float_complex, __pyx_t_float_complex);
1461 #define __Pyx_c_eq_double(a, b) ((a)==(b))
1462 #define __Pyx_c_sum_double(a, b) ((a)+(b))
1463 #define __Pyx_c_diff_double(a, b) ((a)-(b))
1464 #define __Pyx_c_prod_double(a, b) ((a)*(b))
1465 #define __Pyx_c_quot_double(a, b) ((a)/(b))
1466 #define __Pyx_c_neg_double(a) (-(a))
1468 #define __Pyx_c_is_zero_double(z) ((z)==(double)0)
1469 #define __Pyx_c_conj_double(z) (::std::conj(z))
1471 #define __Pyx_c_abs_double(z) (::std::abs(z))
1472 #define __Pyx_c_pow_double(a, b) (::std::pow(a, b))
1475 #define __Pyx_c_is_zero_double(z) ((z)==0)
1476 #define __Pyx_c_conj_double(z) (conj(z))
1478 #define __Pyx_c_abs_double(z) (cabs(z))
1479 #define __Pyx_c_pow_double(a, b) (cpow(a, b))
1483 static CYTHON_INLINE
int __Pyx_c_eq_double(__pyx_t_double_complex, __pyx_t_double_complex);
1484 static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_sum_double(__pyx_t_double_complex, __pyx_t_double_complex);
1485 static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_diff_double(__pyx_t_double_complex, __pyx_t_double_complex);
1486 static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_prod_double(__pyx_t_double_complex, __pyx_t_double_complex);
1487 static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_quot_double(__pyx_t_double_complex, __pyx_t_double_complex);
1488 static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_neg_double(__pyx_t_double_complex);
1489 static CYTHON_INLINE
int __Pyx_c_is_zero_double(__pyx_t_double_complex);
1490 static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_conj_double(__pyx_t_double_complex);
1492 static CYTHON_INLINE
double __Pyx_c_abs_double(__pyx_t_double_complex);
1493 static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_pow_double(__pyx_t_double_complex, __pyx_t_double_complex);
1498 static CYTHON_INLINE PyObject* __Pyx_PyInt_From_enum__NPY_TYPES(
enum NPY_TYPES value);
1501 static int __Pyx_PrintOne(PyObject* stream, PyObject *o);
1504 static CYTHON_INLINE
int __Pyx_PyInt_As_int(PyObject *);
1507 static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(
long value);
1510 static CYTHON_INLINE
long __Pyx_PyInt_As_long(PyObject *);
1513 static int __Pyx_check_binary_version(
void);
1516 #if !defined(__Pyx_PyIdentifier_FromString)
1517 #if PY_MAJOR_VERSION < 3
1518 #define __Pyx_PyIdentifier_FromString(s) PyString_FromString(s)
1520 #define __Pyx_PyIdentifier_FromString(s) PyUnicode_FromString(s)
1525 static PyObject *__Pyx_ImportModule(
const char *
name);
1528 static PyTypeObject *__Pyx_ImportType(
const char *module_name,
const char *class_name,
size_t size,
int strict);
1531 static int __Pyx_InitStrings(__Pyx_StringTabEntry *t);
1533 static void *__pyx_f_4amns_4Amns_handle(
struct __pyx_obj_4amns_Amns *__pyx_v_self);
1534 static amns_c_answer_type __pyx_f_4amns_4Amns_lquery(
struct __pyx_obj_4amns_Amns *__pyx_v_self, PyObject *__pyx_v_queryString);
1535 static amns_c_answer_type __pyx_f_4amns_5Table_lquery(
struct __pyx_obj_4amns_Table *__pyx_v_self, PyObject *__pyx_v_queryString);
1536 static void *__pyx_f_4amns_9Reactants_handle(
struct __pyx_obj_4amns_Reactants *__pyx_v_self);
1551 static PyTypeObject *__pyx_ptype_7cpython_4type_type = 0;
1564 static PyTypeObject *__pyx_ptype_5numpy_dtype = 0;
1565 static PyTypeObject *__pyx_ptype_5numpy_flatiter = 0;
1566 static PyTypeObject *__pyx_ptype_5numpy_broadcast = 0;
1567 static PyTypeObject *__pyx_ptype_5numpy_ndarray = 0;
1568 static PyTypeObject *__pyx_ptype_5numpy_ufunc = 0;
1569 static CYTHON_INLINE
char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *,
char *,
char *,
int *);
1572 static PyTypeObject *__pyx_ptype_4amns_Amns = 0;
1573 static PyTypeObject *__pyx_ptype_4amns_Table = 0;
1574 static PyTypeObject *__pyx_ptype_4amns_Reactants = 0;
1576 static __Pyx_TypeInfo __Pyx_TypeInfo_nn___pyx_t_5numpy_double_t = {
"double_t", NULL,
sizeof(__pyx_t_5numpy_double_t), { 0 }, 0,
'R', 0, 0 };
1577 #define __Pyx_MODULE_NAME "amns"
1578 int __pyx_module_is_main_amns = 0;
1581 static PyObject *__pyx_builtin_enumerate;
1582 static PyObject *__pyx_builtin_ValueError;
1583 static PyObject *__pyx_builtin_range;
1584 static PyObject *__pyx_builtin_RuntimeError;
1585 static PyObject *__pyx_builtin_ImportError;
1586 static PyObject *__pyx_builtin_TypeError;
1587 static PyObject *__pyx_builtin_KeyError;
1588 static const char __pyx_k_F[] =
"F";
1589 static const char __pyx_k_LR[] =
"LR";
1590 static const char __pyx_k_MI[] =
"MI";
1591 static const char __pyx_k_ZA[] =
"ZA";
1592 static const char __pyx_k_ZN[] =
"ZN";
1593 static const char __pyx_k__2[] =
")";
1594 static const char __pyx_k_lr[] =
"lr";
1595 static const char __pyx_k_mi[] =
"mi";
1596 static const char __pyx_k_np[] =
"np";
1597 static const char __pyx_k_p1[] =
"p1";
1598 static const char __pyx_k_p2[] =
"p2";
1599 static const char __pyx_k_p3[] =
"p3";
1600 static const char __pyx_k_za[] =
"za";
1601 static const char __pyx_k_zn[] =
"zn";
1602 static const char __pyx_k_doc[] =
"__doc__";
1603 static const char __pyx_k_end[] =
"end";
1604 static const char __pyx_k_set[] =
"set";
1605 static const char __pyx_k_amns[] =
"amns";
1606 static const char __pyx_k_file[] =
"file";
1607 static const char __pyx_k_main[] =
"__main__";
1608 static const char __pyx_k_ndim[] =
"ndim";
1609 static const char __pyx_k_test[] =
"__test__";
1610 static const char __pyx_k_user[] =
"user";
1611 static const char __pyx_k_numpy[] =
"numpy";
1612 static const char __pyx_k_order[] =
"order";
1613 static const char __pyx_k_print[] =
"print";
1614 static const char __pyx_k_range[] =
"range";
1615 static const char __pyx_k_setup[] =
"_setup";
1616 static const char __pyx_k_shape[] =
"shape";
1617 static const char __pyx_k_append[] =
"append";
1618 static const char __pyx_k_filled[] =
"filled";
1619 static const char __pyx_k_import[] =
"__import__";
1620 static const char __pyx_k_module[] =
"__module__";
1621 static const char __pyx_k_nowarn[] =
"nowarn";
1622 static const char __pyx_k_number[] =
"number";
1623 static const char __pyx_k_source[] =
"source";
1624 static const char __pyx_k_string[] =
"string";
1625 static const char __pyx_k_backend[] =
"backend";
1626 static const char __pyx_k_data_1d[] =
"_data_1d";
1627 static const char __pyx_k_data_2d[] =
"_data_2d";
1628 static const char __pyx_k_data_3d[] =
"_data_3d";
1629 static const char __pyx_k_prepare[] =
"__prepare__";
1630 static const char __pyx_k_version[] =
"version";
1631 static const char __pyx_k_KeyError[] =
"KeyError";
1632 static const char __pyx_k_qualname[] =
"__qualname__";
1633 static const char __pyx_k_TypeError[] =
"TypeError";
1634 static const char __pyx_k_enumerate[] =
"enumerate";
1635 static const char __pyx_k_metaclass[] =
"__metaclass__";
1636 static const char __pyx_k_reactants[] =
"reactants";
1637 static const char __pyx_k_ValueError[] =
"ValueError";
1638 static const char __pyx_k_empty_like[] =
"empty_like";
1639 static const char __pyx_k_interp_fun[] =
"interp_fun";
1640 static const char __pyx_k_parentAmns[] =
"parentAmns";
1641 static const char __pyx_k_pyx_vtable[] =
"__pyx_vtable__";
1642 static const char __pyx_k_ImportError[] =
"ImportError";
1643 static const char __pyx_k_result_unit[] =
"result_unit";
1644 static const char __pyx_k_state_label[] =
"state_label";
1645 static const char __pyx_k_RuntimeError[] =
"RuntimeError";
1646 static const char __pyx_k_result_label[] =
"result_label";
1647 static const char __pyx_k_version_user[] =
"version_user";
1648 static const char __pyx_k_AmnsException[] =
"AmnsException";
1649 static const char __pyx_k_int_specifier[] =
"int_specifier";
1650 static const char __pyx_k_reaction_type[] =
"reaction_type";
1651 static const char __pyx_k_reactionString[] =
"reactionString";
1652 static const char __pyx_k_real_specifier[] =
"real_specifier";
1653 static const char __pyx_k_version_number[] =
"version_number";
1654 static const char __pyx_k_version_string[] =
"version_string";
1655 static const char __pyx_k_no_of_reactants[] =
"no_of_reactants";
1656 static const char __pyx_k_version_backend[] =
"version_backend";
1657 static const char __pyx_k_isotope_resolved[] =
"isotope_resolved";
1658 static const char __pyx_k_invalidate_handle[] =
"_invalidate_handle";
1659 static const char __pyx_k_ndarray_is_not_C_contiguous[] =
"ndarray is not C contiguous";
1660 static const char __pyx_k_numpy_core_multiarray_failed_to[] =
"numpy.core.multiarray failed to import";
1661 static const char __pyx_k_unknown_dtype_code_in_numpy_pxd[] =
"unknown dtype code in numpy.pxd (%d)";
1662 static const char __pyx_k_Format_string_allocated_too_shor[] =
"Format string allocated too short, see comment in numpy.pxd";
1663 static const char __pyx_k_No_value_specified_for_struct_at[] =
"No value specified for struct attribute 'ZN'";
1664 static const char __pyx_k_Non_native_byte_order_not_suppor[] =
"Non-native byte order not supported";
1665 static const char __pyx_k_Number_of_parameters_does_not_ma[] =
"Number of parameters does not match table dimensions (ndim=";
1666 static const char __pyx_k_Shape_of_parameter_2_inconsisten[] =
"Shape of parameter 2 inconsistent to shape of parameter 1";
1667 static const char __pyx_k_Shape_of_parameter_3_inconsisten[] =
"Shape of parameter 3 inconsistent to shape of parameter 1";
1668 static const char __pyx_k_Unsupported_rank_of_input_argume[] =
"Unsupported rank of input arguments: %s";
1669 static const char __pyx_k_ndarray_is_not_Fortran_contiguou[] =
"ndarray is not Fortran contiguous";
1670 static const char __pyx_k_numpy_core_umath_failed_to_impor[] =
"numpy.core.umath failed to import";
1671 static const char __pyx_k_Format_string_allocated_too_shor_2[] =
"Format string allocated too short.";
1672 static const char __pyx_k_No_value_specified_for_struct_at_2[] =
"No value specified for struct attribute 'ZA'";
1673 static const char __pyx_k_No_value_specified_for_struct_at_3[] =
"No value specified for struct attribute 'MI'";
1674 static const char __pyx_k_No_value_specified_for_struct_at_4[] =
"No value specified for struct attribute 'LR'";
1675 static const char __pyx_k_No_value_specified_for_struct_at_5[] =
"No value specified for struct attribute 'real_specifier'";
1676 static const char __pyx_k_No_value_specified_for_struct_at_6[] =
"No value specified for struct attribute 'int_specifier'";
1677 static PyObject *__pyx_n_s_AmnsException;
1678 static PyObject *__pyx_n_s_F;
1679 static PyObject *__pyx_kp_u_Format_string_allocated_too_shor;
1680 static PyObject *__pyx_kp_u_Format_string_allocated_too_shor_2;
1681 static PyObject *__pyx_n_s_ImportError;
1682 static PyObject *__pyx_n_s_KeyError;
1683 static PyObject *__pyx_n_s_LR;
1684 static PyObject *__pyx_n_s_MI;
1685 static PyObject *__pyx_kp_s_No_value_specified_for_struct_at;
1686 static PyObject *__pyx_kp_s_No_value_specified_for_struct_at_2;
1687 static PyObject *__pyx_kp_s_No_value_specified_for_struct_at_3;
1688 static PyObject *__pyx_kp_s_No_value_specified_for_struct_at_4;
1689 static PyObject *__pyx_kp_s_No_value_specified_for_struct_at_5;
1690 static PyObject *__pyx_kp_s_No_value_specified_for_struct_at_6;
1691 static PyObject *__pyx_kp_u_Non_native_byte_order_not_suppor;
1692 static PyObject *__pyx_kp_s_Number_of_parameters_does_not_ma;
1693 static PyObject *__pyx_n_s_RuntimeError;
1694 static PyObject *__pyx_kp_s_Shape_of_parameter_2_inconsisten;
1695 static PyObject *__pyx_kp_s_Shape_of_parameter_3_inconsisten;
1696 static PyObject *__pyx_n_s_TypeError;
1697 static PyObject *__pyx_kp_s_Unsupported_rank_of_input_argume;
1698 static PyObject *__pyx_n_s_ValueError;
1699 static PyObject *__pyx_n_s_ZA;
1700 static PyObject *__pyx_n_s_ZN;
1701 static PyObject *__pyx_kp_s__2;
1702 static PyObject *__pyx_n_s_amns;
1703 static PyObject *__pyx_n_s_append;
1704 static PyObject *__pyx_n_s_backend;
1705 static PyObject *__pyx_n_s_data_1d;
1706 static PyObject *__pyx_n_s_data_2d;
1707 static PyObject *__pyx_n_s_data_3d;
1708 static PyObject *__pyx_n_s_doc;
1709 static PyObject *__pyx_n_s_empty_like;
1710 static PyObject *__pyx_n_s_end;
1711 static PyObject *__pyx_n_s_enumerate;
1712 static PyObject *__pyx_n_s_file;
1713 static PyObject *__pyx_n_s_filled;
1714 static PyObject *__pyx_n_s_import;
1715 static PyObject *__pyx_n_s_int_specifier;
1716 static PyObject *__pyx_n_s_interp_fun;
1717 static PyObject *__pyx_n_s_invalidate_handle;
1718 static PyObject *__pyx_n_s_isotope_resolved;
1719 static PyObject *__pyx_n_s_lr;
1720 static PyObject *__pyx_n_s_main;
1721 static PyObject *__pyx_n_s_metaclass;
1722 static PyObject *__pyx_n_s_mi;
1723 static PyObject *__pyx_n_s_module;
1724 static PyObject *__pyx_kp_u_ndarray_is_not_C_contiguous;
1725 static PyObject *__pyx_kp_u_ndarray_is_not_Fortran_contiguou;
1726 static PyObject *__pyx_n_s_ndim;
1727 static PyObject *__pyx_n_s_no_of_reactants;
1728 static PyObject *__pyx_n_s_nowarn;
1729 static PyObject *__pyx_n_s_np;
1730 static PyObject *__pyx_n_s_number;
1731 static PyObject *__pyx_n_s_numpy;
1732 static PyObject *__pyx_kp_s_numpy_core_multiarray_failed_to;
1733 static PyObject *__pyx_kp_s_numpy_core_umath_failed_to_impor;
1734 static PyObject *__pyx_n_s_order;
1735 static PyObject *__pyx_n_s_p1;
1736 static PyObject *__pyx_n_s_p2;
1737 static PyObject *__pyx_n_s_p3;
1738 static PyObject *__pyx_n_s_parentAmns;
1739 static PyObject *__pyx_n_s_prepare;
1740 static PyObject *__pyx_n_s_print;
1741 static PyObject *__pyx_n_s_pyx_vtable;
1742 static PyObject *__pyx_n_s_qualname;
1743 static PyObject *__pyx_n_s_range;
1744 static PyObject *__pyx_n_s_reactants;
1745 static PyObject *__pyx_n_s_reactionString;
1746 static PyObject *__pyx_n_s_reaction_type;
1747 static PyObject *__pyx_n_s_real_specifier;
1748 static PyObject *__pyx_n_s_result_label;
1749 static PyObject *__pyx_n_s_result_unit;
1750 static PyObject *__pyx_n_s_set;
1751 static PyObject *__pyx_n_s_setup;
1752 static PyObject *__pyx_n_s_shape;
1753 static PyObject *__pyx_n_s_source;
1754 static PyObject *__pyx_n_s_state_label;
1755 static PyObject *__pyx_n_s_string;
1756 static PyObject *__pyx_n_s_test;
1757 static PyObject *__pyx_kp_u_unknown_dtype_code_in_numpy_pxd;
1758 static PyObject *__pyx_n_s_user;
1759 static PyObject *__pyx_n_s_version;
1760 static PyObject *__pyx_n_s_version_backend;
1761 static PyObject *__pyx_n_s_version_number;
1762 static PyObject *__pyx_n_s_version_string;
1763 static PyObject *__pyx_n_s_version_user;
1764 static PyObject *__pyx_n_s_za;
1765 static PyObject *__pyx_n_s_zn;
1766 static int __pyx_pf_4amns_4Amns___init__(
struct __pyx_obj_4amns_Amns *__pyx_v_self, PyObject *__pyx_v_version_string, PyObject *__pyx_v_version_number, PyObject *__pyx_v_version_backend, PyObject *__pyx_v_version_user);
1767 static PyObject *__pyx_pf_4amns_4Amns_2_setup(
struct __pyx_obj_4amns_Amns *__pyx_v_self, PyObject *__pyx_v_version_string, PyObject *__pyx_v_version_number, PyObject *__pyx_v_version_backend, PyObject *__pyx_v_version_user);
1768 static PyObject *__pyx_pf_4amns_4Amns_4query(
struct __pyx_obj_4amns_Amns *__pyx_v_self, PyObject *__pyx_v_queryString);
1769 static PyObject *__pyx_pf_4amns_4Amns_7version___get__(
struct __pyx_obj_4amns_Amns *__pyx_v_self);
1770 static PyObject *__pyx_pf_4amns_4Amns_6set(
struct __pyx_obj_4amns_Amns *__pyx_v_self, PyObject *__pyx_v_setString);
1771 static PyObject *__pyx_pf_4amns_4Amns_8finalize(
struct __pyx_obj_4amns_Amns *__pyx_v_self);
1772 static PyObject *__pyx_pf_4amns_4Amns_10get_table(
struct __pyx_obj_4amns_Amns *__pyx_v_self, PyObject *__pyx_v_reactionString,
struct __pyx_obj_4amns_Reactants *__pyx_v_reactants, PyObject *__pyx_v_isotope_resolved);
1773 static int __pyx_pf_4amns_5Table___init__(
struct __pyx_obj_4amns_Table *__pyx_v_self, PyObject *__pyx_v_reactionString,
struct __pyx_obj_4amns_Reactants *__pyx_v_reactants,
struct __pyx_obj_4amns_Amns *__pyx_v_parentAmns, PyObject *__pyx_v_isotope_resolved);
1774 static PyObject *__pyx_pf_4amns_5Table_2query(
struct __pyx_obj_4amns_Table *__pyx_v_self, PyObject *__pyx_v_queryString);
1775 static PyObject *__pyx_pf_4amns_5Table_4set(
struct __pyx_obj_4amns_Table *__pyx_v_self, PyObject *__pyx_v_setString);
1776 static PyObject *__pyx_pf_4amns_5Table_6finalize(
struct __pyx_obj_4amns_Table *__pyx_v_self);
1777 static PyObject *__pyx_pf_4amns_5Table_15no_of_reactants___get__(
struct __pyx_obj_4amns_Table *__pyx_v_self);
1778 static PyObject *__pyx_pf_4amns_5Table_4ndim___get__(
struct __pyx_obj_4amns_Table *__pyx_v_self);
1779 static PyObject *__pyx_pf_4amns_5Table_6source___get__(
struct __pyx_obj_4amns_Table *__pyx_v_self);
1780 static PyObject *__pyx_pf_4amns_5Table_6filled___get__(
struct __pyx_obj_4amns_Table *__pyx_v_self);
1781 static PyObject *__pyx_pf_4amns_5Table_13reaction_type___get__(
struct __pyx_obj_4amns_Table *__pyx_v_self);
1782 static PyObject *__pyx_pf_4amns_5Table_9reactants___get__(
struct __pyx_obj_4amns_Table *__pyx_v_self);
1783 static PyObject *__pyx_pf_4amns_5Table_7version___get__(
struct __pyx_obj_4amns_Table *__pyx_v_self);
1784 static PyObject *__pyx_pf_4amns_5Table_11state_label___get__(
struct __pyx_obj_4amns_Table *__pyx_v_self);
1785 static PyObject *__pyx_pf_4amns_5Table_11result_unit___get__(
struct __pyx_obj_4amns_Table *__pyx_v_self);
1786 static PyObject *__pyx_pf_4amns_5Table_12result_label___get__(
struct __pyx_obj_4amns_Table *__pyx_v_self);
1787 static PyObject *__pyx_pf_4amns_5Table_10interp_fun___get__(
struct __pyx_obj_4amns_Table *__pyx_v_self);
1788 static PyObject *__pyx_pf_4amns_5Table_8data(
struct __pyx_obj_4amns_Table *__pyx_v_self, PyObject *__pyx_v_p1, PyObject *__pyx_v_p2, PyObject *__pyx_v_p3);
1789 static PyObject *__pyx_pf_4amns_5Table_10_data_1d(
struct __pyx_obj_4amns_Table *__pyx_v_self, PyArrayObject *__pyx_v_p1, PyArrayObject *__pyx_v_p2, PyArrayObject *__pyx_v_p3);
1790 static PyObject *__pyx_pf_4amns_5Table_12_data_2d(
struct __pyx_obj_4amns_Table *__pyx_v_self, PyArrayObject *__pyx_v_p1, PyArrayObject *__pyx_v_p2, PyArrayObject *__pyx_v_p3);
1791 static PyObject *__pyx_pf_4amns_5Table_14_data_3d(
struct __pyx_obj_4amns_Table *__pyx_v_self, PyArrayObject *__pyx_v_p1, PyArrayObject *__pyx_v_p2, PyArrayObject *__pyx_v_p3);
1792 static int __pyx_pf_4amns_9Reactants___cinit__(CYTHON_UNUSED
struct __pyx_obj_4amns_Reactants *__pyx_v_self);
1793 static int __pyx_pf_4amns_9Reactants_2__init__(
struct __pyx_obj_4amns_Reactants *__pyx_v_self);
1794 static PyObject *__pyx_pf_4amns_9Reactants_4_invalidate_handle(
struct __pyx_obj_4amns_Reactants *__pyx_v_self);
1795 static PyObject *__pyx_pf_4amns_9Reactants_6add(
struct __pyx_obj_4amns_Reactants *__pyx_v_self, PyObject *__pyx_v_zn, PyObject *__pyx_v_za, PyObject *__pyx_v_mi, PyObject *__pyx_v_lr, PyObject *__pyx_v_real_specifier, PyObject *__pyx_v_int_specifier);
1796 static Py_ssize_t __pyx_pf_4amns_9Reactants_8__len__(
struct __pyx_obj_4amns_Reactants *__pyx_v_self);
1797 static PyObject *__pyx_pf_4amns_9Reactants_10__str__(
struct __pyx_obj_4amns_Reactants *__pyx_v_self);
1798 static PyObject *__pyx_pf_4amns_9Reactants_12test(
struct __pyx_obj_4amns_Reactants *__pyx_v_self);
1799 static PyObject *__pyx_pf_4amns_9Reactants_14value(
struct __pyx_obj_4amns_Reactants *__pyx_v_self);
1800 static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, Py_buffer *__pyx_v_info,
int __pyx_v_flags);
1801 static void __pyx_pf_5numpy_7ndarray_2__releasebuffer__(PyArrayObject *__pyx_v_self, Py_buffer *__pyx_v_info);
1802 static PyObject *__pyx_tp_new_4amns_Amns(PyTypeObject *t, PyObject *a, PyObject *k);
1803 static PyObject *__pyx_tp_new_4amns_Table(PyTypeObject *t, PyObject *a, PyObject *k);
1804 static PyObject *__pyx_tp_new_4amns_Reactants(PyTypeObject *t, PyObject *a, PyObject *k);
1805 static PyObject *__pyx_int_0;
1806 static PyObject *__pyx_int_1;
1807 static PyObject *__pyx_int_2;
1808 static PyObject *__pyx_int_3;
1809 static PyObject *__pyx_tuple_;
1810 static PyObject *__pyx_tuple__3;
1811 static PyObject *__pyx_tuple__4;
1812 static PyObject *__pyx_tuple__5;
1813 static PyObject *__pyx_tuple__6;
1814 static PyObject *__pyx_tuple__7;
1815 static PyObject *__pyx_tuple__8;
1816 static PyObject *__pyx_tuple__9;
1817 static PyObject *__pyx_tuple__10;
1818 static PyObject *__pyx_tuple__11;
1819 static PyObject *__pyx_tuple__12;
1820 static PyObject *__pyx_tuple__13;
1821 static PyObject *__pyx_tuple__14;
1822 static PyObject *__pyx_tuple__15;
1823 static PyObject *__pyx_tuple__16;
1824 static PyObject *__pyx_tuple__17;
1825 static PyObject *__pyx_tuple__18;
1826 static PyObject *__pyx_tuple__19;
1837 static int __pyx_pw_4amns_4Amns_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
1838 static char __pyx_doc_4amns_4Amns___init__[] =
"Use to initialize the Amns class";
1839 #if CYTHON_COMPILING_IN_CPYTHON
1840 struct wrapperbase __pyx_wrapperbase_4amns_4Amns___init__;
1842 static int __pyx_pw_4amns_4Amns_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
1843 PyObject *__pyx_v_version_string = 0;
1844 PyObject *__pyx_v_version_number = 0;
1845 PyObject *__pyx_v_version_backend = 0;
1846 PyObject *__pyx_v_version_user = 0;
1848 __Pyx_RefNannyDeclarations
1849 __Pyx_RefNannySetupContext(
"__init__ (wrapper)", 0);
1851 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_version_string,&__pyx_n_s_version_number,&__pyx_n_s_version_backend,&__pyx_n_s_version_user,0};
1852 PyObject* values[4] = {0,0,0,0};
1853 values[0] = ((PyObject *)Py_None);
1854 values[1] = ((PyObject *)Py_None);
1855 values[2] = ((PyObject *)Py_None);
1856 values[3] = ((PyObject *)Py_None);
1857 if (unlikely(__pyx_kwds)) {
1859 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
1861 case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
1862 case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
1863 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
1864 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
1866 default:
goto __pyx_L5_argtuple_error;
1868 kw_args = PyDict_Size(__pyx_kwds);
1872 PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_version_string);
1873 if (value) { values[0] = value; kw_args--; }
1877 PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_version_number);
1878 if (value) { values[1] = value; kw_args--; }
1882 PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_version_backend);
1883 if (value) { values[2] = value; kw_args--; }
1887 PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_version_user);
1888 if (value) { values[3] = value; kw_args--; }
1891 if (unlikely(kw_args > 0)) {
1892 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args,
"__init__") < 0)) __PYX_ERR(0, 17, __pyx_L3_error)
1895 switch (PyTuple_GET_SIZE(__pyx_args)) {
1896 case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
1897 case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
1898 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
1899 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
1901 default:
goto __pyx_L5_argtuple_error;
1904 __pyx_v_version_string = values[0];
1905 __pyx_v_version_number = values[1];
1906 __pyx_v_version_backend = values[2];
1907 __pyx_v_version_user = values[3];
1909 goto __pyx_L4_argument_unpacking_done;
1910 __pyx_L5_argtuple_error:;
1911 __Pyx_RaiseArgtupleInvalid(
"__init__", 0, 0, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 17, __pyx_L3_error)
1913 __Pyx_AddTraceback("amns.Amns.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
1914 __Pyx_RefNannyFinishContext();
1916 __pyx_L4_argument_unpacking_done:;
1917 __pyx_r = __pyx_pf_4amns_4Amns___init__(((struct __pyx_obj_4amns_Amns *)__pyx_v_self), __pyx_v_version_string, __pyx_v_version_number, __pyx_v_version_backend, __pyx_v_version_user);
1920 __Pyx_RefNannyFinishContext();
1924 static
int __pyx_pf_4amns_4Amns___init__(struct __pyx_obj_4amns_Amns *__pyx_v_self, PyObject *__pyx_v_version_string, PyObject *__pyx_v_version_number, PyObject *__pyx_v_version_backend, PyObject *__pyx_v_version_user) {
1926 __Pyx_RefNannyDeclarations
1927 PyObject *__pyx_t_1 = NULL;
1928 PyObject *__pyx_t_2 = NULL;
1929 PyObject *__pyx_t_3 = NULL;
1930 __Pyx_RefNannySetupContext(
"__init__", 0);
1939 __pyx_v_self->_handle = NULL;
1948 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_setup);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 20, __pyx_L1_error)
1949 __Pyx_GOTREF(__pyx_t_1);
1950 __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 20, __pyx_L1_error)
1951 __Pyx_GOTREF(__pyx_t_2);
1952 if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_version_string, __pyx_v_version_string) < 0) __PYX_ERR(0, 20, __pyx_L1_error)
1953 if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_version_number, __pyx_v_version_number) < 0) __PYX_ERR(0, 20, __pyx_L1_error)
1954 if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_version_backend, __pyx_v_version_backend) < 0) __PYX_ERR(0, 20, __pyx_L1_error)
1955 if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_version_user, __pyx_v_version_user) < 0) __PYX_ERR(0, 20, __pyx_L1_error)
1956 __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_empty_tuple, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 20, __pyx_L1_error)
1957 __Pyx_GOTREF(__pyx_t_3);
1958 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
1959 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
1960 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
1974 __Pyx_XDECREF(__pyx_t_1);
1975 __Pyx_XDECREF(__pyx_t_2);
1976 __Pyx_XDECREF(__pyx_t_3);
1977 __Pyx_AddTraceback("amns.Amns.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
1980 __Pyx_RefNannyFinishContext();
1992 static
void *__pyx_f_4amns_4Amns_handle(struct __pyx_obj_4amns_Amns *__pyx_v_self) {
1994 __Pyx_RefNannyDeclarations
1995 __Pyx_RefNannySetupContext(
"handle", 0);
2004 __pyx_r = __pyx_v_self->_handle;
2017 __Pyx_RefNannyFinishContext();
2030 static PyObject *__pyx_pw_4amns_4Amns_3_setup(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
2031 static char __pyx_doc_4amns_4Amns_2_setup[] =
"Perform the actual call to the C interface to the original primary Fortran SETUP routine";
2032 static PyObject *__pyx_pw_4amns_4Amns_3_setup(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
2033 PyObject *__pyx_v_version_string = 0;
2034 PyObject *__pyx_v_version_number = 0;
2035 PyObject *__pyx_v_version_backend = 0;
2036 PyObject *__pyx_v_version_user = 0;
2037 PyObject *__pyx_r = 0;
2038 __Pyx_RefNannyDeclarations
2039 __Pyx_RefNannySetupContext(
"_setup (wrapper)", 0);
2041 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_version_string,&__pyx_n_s_version_number,&__pyx_n_s_version_backend,&__pyx_n_s_version_user,0};
2042 PyObject* values[4] = {0,0,0,0};
2043 values[0] = ((PyObject *)Py_None);
2044 values[1] = ((PyObject *)Py_None);
2045 values[2] = ((PyObject *)Py_None);
2046 values[3] = ((PyObject *)Py_None);
2047 if (unlikely(__pyx_kwds)) {
2049 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
2051 case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
2052 case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
2053 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
2054 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
2056 default:
goto __pyx_L5_argtuple_error;
2058 kw_args = PyDict_Size(__pyx_kwds);
2062 PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_version_string);
2063 if (value) { values[0] = value; kw_args--; }
2067 PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_version_number);
2068 if (value) { values[1] = value; kw_args--; }
2072 PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_version_backend);
2073 if (value) { values[2] = value; kw_args--; }
2077 PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_version_user);
2078 if (value) { values[3] = value; kw_args--; }
2081 if (unlikely(kw_args > 0)) {
2082 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args,
"_setup") < 0)) __PYX_ERR(0, 25, __pyx_L3_error)
2085 switch (PyTuple_GET_SIZE(__pyx_args)) {
2086 case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
2087 case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
2088 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
2089 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
2091 default:
goto __pyx_L5_argtuple_error;
2094 __pyx_v_version_string = values[0];
2095 __pyx_v_version_number = values[1];
2096 __pyx_v_version_backend = values[2];
2097 __pyx_v_version_user = values[3];
2099 goto __pyx_L4_argument_unpacking_done;
2100 __pyx_L5_argtuple_error:;
2101 __Pyx_RaiseArgtupleInvalid(
"_setup", 0, 0, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 25, __pyx_L3_error)
2103 __Pyx_AddTraceback("amns.Amns._setup", __pyx_clineno, __pyx_lineno, __pyx_filename);
2104 __Pyx_RefNannyFinishContext();
2106 __pyx_L4_argument_unpacking_done:;
2107 __pyx_r = __pyx_pf_4amns_4Amns_2_setup(((struct __pyx_obj_4amns_Amns *)__pyx_v_self), __pyx_v_version_string, __pyx_v_version_number, __pyx_v_version_backend, __pyx_v_version_user);
2110 __Pyx_RefNannyFinishContext();
2114 static PyObject *__pyx_pf_4amns_4Amns_2_setup(struct __pyx_obj_4amns_Amns *__pyx_v_self, PyObject *__pyx_v_version_string, PyObject *__pyx_v_version_number, PyObject *__pyx_v_version_backend, PyObject *__pyx_v_version_user) {
2117 PyObject *__pyx_r = NULL;
2118 __Pyx_RefNannyDeclarations
2119 PyObject *__pyx_t_1 = NULL;
2120 PyObject *__pyx_t_2 = NULL;
2121 PyObject *__pyx_t_3 = NULL;
2125 PyObject *__pyx_t_7 = NULL;
2126 PyObject *__pyx_t_8 = NULL;
2127 __Pyx_RefNannySetupContext(
"_setup", 0);
2145 __pyx_t_1 = PyObject_RichCompare(__pyx_v_version_string, Py_None, Py_EQ); __Pyx_XGOTREF(__pyx_t_1);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 30, __pyx_L1_error)
2146 __pyx_t_2 = PyObject_RichCompare(__pyx_v_version_number, Py_None, Py_EQ); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 30, __pyx_L1_error)
2147 __pyx_t_3 = PyNumber_And(__pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 30, __pyx_L1_error)
2148 __Pyx_GOTREF(__pyx_t_3);
2149 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
2150 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
2151 __pyx_t_2 = PyObject_RichCompare(__pyx_v_version_backend, Py_None, Py_EQ); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 30, __pyx_L1_error)
2152 __pyx_t_1 = PyNumber_And(__pyx_t_3, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 30, __pyx_L1_error)
2153 __Pyx_GOTREF(__pyx_t_1);
2154 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
2155 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
2156 __pyx_t_2 = PyObject_RichCompare(__pyx_v_version_user, Py_None, Py_EQ); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 30, __pyx_L1_error)
2157 __pyx_t_3 = PyNumber_And(__pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 30, __pyx_L1_error)
2158 __Pyx_GOTREF(__pyx_t_3);
2159 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
2160 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
2161 __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 30, __pyx_L1_error)
2162 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
2192 __pyx_t_3 = __pyx_convert__to_py_amns_c_version_type(__pyx_v_version);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 33, __pyx_L1_error)
2193 __Pyx_GOTREF(__pyx_t_3);
2194 if (__Pyx_PrintOne(0, __pyx_t_3) < 0) __PYX_ERR(0, 33, __pyx_L1_error)
2195 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
2204 __pyx_t_3 = PyObject_RichCompare(__pyx_v_version_string, Py_None, Py_NE); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 34, __pyx_L1_error)
2205 __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 34, __pyx_L1_error)
2206 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
2208 __pyx_t_5 = __Pyx_PyObject_AsString(__pyx_v_version_string);
if (unlikely((!__pyx_t_5) && PyErr_Occurred())) __PYX_ERR(0, 34, __pyx_L1_error)
2209 __pyx_v_version.
string = __pyx_t_5;
2219 __pyx_t_3 = PyObject_RichCompare(__pyx_v_version_number, Py_None, Py_NE); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 35, __pyx_L1_error)
2220 __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 35, __pyx_L1_error)
2221 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
2223 __pyx_t_6 = __Pyx_PyInt_As_int(__pyx_v_version_number);
if (unlikely((__pyx_t_6 == (
int)-1) && PyErr_Occurred())) __PYX_ERR(0, 35, __pyx_L1_error)
2224 __pyx_v_version.number = __pyx_t_6;
2234 __pyx_t_3 = PyObject_RichCompare(__pyx_v_version_backend, Py_None, Py_NE); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 36, __pyx_L1_error)
2235 __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 36, __pyx_L1_error)
2236 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
2238 __pyx_t_5 = __Pyx_PyObject_AsString(__pyx_v_version_backend);
if (unlikely((!__pyx_t_5) && PyErr_Occurred())) __PYX_ERR(0, 36, __pyx_L1_error)
2239 __pyx_v_version.backend = __pyx_t_5;
2249 __pyx_t_3 = PyObject_RichCompare(__pyx_v_version_user, Py_None, Py_NE); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 37, __pyx_L1_error)
2250 __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 37, __pyx_L1_error)
2251 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
2253 __pyx_t_5 = __Pyx_PyObject_AsString(__pyx_v_version_user);
if (unlikely((!__pyx_t_5) && PyErr_Occurred())) __PYX_ERR(0, 37, __pyx_L1_error)
2254 __pyx_v_version.user = __pyx_t_5;
2264 __pyx_t_3 = __pyx_convert__to_py_amns_c_version_type(__pyx_v_version); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 38, __pyx_L1_error)
2265 __Pyx_GOTREF(__pyx_t_3);
2266 if (__Pyx_PrintOne(0, __pyx_t_3) < 0) __PYX_ERR(0, 38, __pyx_L1_error)
2267 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
2287 __pyx_t_4 = (__pyx_v_error_status.
flag != 0);
2297 __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_AmnsException);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 41, __pyx_L1_error)
2298 __Pyx_GOTREF(__pyx_t_2);
2299 __pyx_t_1 = __Pyx_PyBytes_FromString(__pyx_v_error_status.
string); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 41, __pyx_L1_error)
2300 __Pyx_GOTREF(__pyx_t_1);
2302 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
2303 __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_2);
2304 if (likely(__pyx_t_7)) {
2305 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_2);
2306 __Pyx_INCREF(__pyx_t_7);
2307 __Pyx_INCREF(
function);
2308 __Pyx_DECREF_SET(__pyx_t_2,
function);
2312 __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_1);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 41, __pyx_L1_error)
2313 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
2314 __Pyx_GOTREF(__pyx_t_3);
2316 #if CYTHON_FAST_PYCALL
2317 if (PyFunction_Check(__pyx_t_2)) {
2318 PyObject *__pyx_temp[2] = {__pyx_t_7, __pyx_t_1};
2319 __pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-1, 1+1);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 41, __pyx_L1_error)
2320 __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
2321 __Pyx_GOTREF(__pyx_t_3);
2322 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
2325 #if CYTHON_FAST_PYCCALL
2326 if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) {
2327 PyObject *__pyx_temp[2] = {__pyx_t_7, __pyx_t_1};
2328 __pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-1, 1+1);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 41, __pyx_L1_error)
2329 __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
2330 __Pyx_GOTREF(__pyx_t_3);
2331 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
2335 __pyx_t_8 = PyTuple_New(1+1);
if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 41, __pyx_L1_error)
2336 __Pyx_GOTREF(__pyx_t_8);
2337 __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_7); __pyx_t_7 = NULL;
2338 __Pyx_GIVEREF(__pyx_t_1);
2339 PyTuple_SET_ITEM(__pyx_t_8, 0+1, __pyx_t_1);
2341 __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_8, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 41, __pyx_L1_error)
2342 __Pyx_GOTREF(__pyx_t_3);
2343 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
2346 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
2347 __Pyx_Raise(__pyx_t_3, 0, 0, 0);
2348 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
2349 __PYX_ERR(0, 41, __pyx_L1_error)
2369 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
2372 __Pyx_XDECREF(__pyx_t_1);
2373 __Pyx_XDECREF(__pyx_t_2);
2374 __Pyx_XDECREF(__pyx_t_3);
2375 __Pyx_XDECREF(__pyx_t_7);
2376 __Pyx_XDECREF(__pyx_t_8);
2377 __Pyx_AddTraceback("amns.Amns._setup", __pyx_clineno, __pyx_lineno, __pyx_filename);
2380 __Pyx_XGIVEREF(__pyx_r);
2381 __Pyx_RefNannyFinishContext();
2393 static
amns_c_answer_type __pyx_f_4amns_4Amns_lquery(struct __pyx_obj_4amns_Amns *__pyx_v_self, PyObject *__pyx_v_queryString) {
2398 __Pyx_RefNannyDeclarations
2401 PyObject *__pyx_t_3 = NULL;
2402 PyObject *__pyx_t_4 = NULL;
2403 PyObject *__pyx_t_5 = NULL;
2404 PyObject *__pyx_t_6 = NULL;
2405 PyObject *__pyx_t_7 = NULL;
2406 __Pyx_RefNannySetupContext(
"lquery", 0);
2415 __pyx_t_1 = __Pyx_PyObject_AsString(__pyx_v_queryString);
if (unlikely((!__pyx_t_1) && PyErr_Occurred())) __PYX_ERR(0, 47, __pyx_L1_error)
2416 __pyx_v_query.
string = __pyx_t_1;
2425 ITM_AMNS_CC_QUERY(__pyx_v_self->_handle, (&__pyx_v_query), (&__pyx_v_answer), (&__pyx_v_error_status));
2434 __pyx_t_2 = (__pyx_v_error_status.flag != 0);
2444 __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_AmnsException);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 50, __pyx_L1_error)
2445 __Pyx_GOTREF(__pyx_t_4);
2446 __pyx_t_5 = __Pyx_PyBytes_FromString(__pyx_v_error_status.
string); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 50, __pyx_L1_error)
2447 __Pyx_GOTREF(__pyx_t_5);
2449 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
2450 __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_4);
2451 if (likely(__pyx_t_6)) {
2452 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_4);
2453 __Pyx_INCREF(__pyx_t_6);
2454 __Pyx_INCREF(
function);
2455 __Pyx_DECREF_SET(__pyx_t_4,
function);
2459 __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_5);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 50, __pyx_L1_error)
2460 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
2461 __Pyx_GOTREF(__pyx_t_3);
2463 #if CYTHON_FAST_PYCALL
2464 if (PyFunction_Check(__pyx_t_4)) {
2465 PyObject *__pyx_temp[2] = {__pyx_t_6, __pyx_t_5};
2466 __pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-1, 1+1);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 50, __pyx_L1_error)
2467 __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
2468 __Pyx_GOTREF(__pyx_t_3);
2469 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
2472 #if CYTHON_FAST_PYCCALL
2473 if (__Pyx_PyFastCFunction_Check(__pyx_t_4)) {
2474 PyObject *__pyx_temp[2] = {__pyx_t_6, __pyx_t_5};
2475 __pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-1, 1+1);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 50, __pyx_L1_error)
2476 __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
2477 __Pyx_GOTREF(__pyx_t_3);
2478 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
2482 __pyx_t_7 = PyTuple_New(1+1);
if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 50, __pyx_L1_error)
2483 __Pyx_GOTREF(__pyx_t_7);
2484 __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_6); __pyx_t_6 = NULL;
2485 __Pyx_GIVEREF(__pyx_t_5);
2486 PyTuple_SET_ITEM(__pyx_t_7, 0+1, __pyx_t_5);
2488 __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_7, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 50, __pyx_L1_error)
2489 __Pyx_GOTREF(__pyx_t_3);
2490 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
2493 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
2494 __Pyx_Raise(__pyx_t_3, 0, 0, 0);
2495 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
2496 __PYX_ERR(0, 50, __pyx_L1_error)
2514 __pyx_r = __pyx_v_answer;
2527 __Pyx_XDECREF(__pyx_t_3);
2528 __Pyx_XDECREF(__pyx_t_4);
2529 __Pyx_XDECREF(__pyx_t_5);
2530 __Pyx_XDECREF(__pyx_t_6);
2531 __Pyx_XDECREF(__pyx_t_7);
2532 __Pyx_WriteUnraisable("amns.Amns.lquery", __pyx_clineno, __pyx_lineno, __pyx_filename, 0, 0);
2534 __Pyx_RefNannyFinishContext();
2547 static PyObject *__pyx_pw_4amns_4Amns_5query(PyObject *__pyx_v_self, PyObject *__pyx_v_queryString);
2548 static
char __pyx_doc_4amns_4Amns_4query[] = "Provide the interface to ITM_AMNS_QUERY";
2549 static PyObject *__pyx_pw_4amns_4Amns_5query(PyObject *__pyx_v_self, PyObject *__pyx_v_queryString) {
2550 PyObject *__pyx_r = 0;
2551 __Pyx_RefNannyDeclarations
2552 __Pyx_RefNannySetupContext(
"query (wrapper)", 0);
2553 __pyx_r = __pyx_pf_4amns_4Amns_4query(((
struct __pyx_obj_4amns_Amns *)__pyx_v_self), ((PyObject *)__pyx_v_queryString));
2556 __Pyx_RefNannyFinishContext();
2560 static PyObject *__pyx_pf_4amns_4Amns_4query(
struct __pyx_obj_4amns_Amns *__pyx_v_self, PyObject *__pyx_v_queryString) {
2564 PyObject *__pyx_r = NULL;
2565 __Pyx_RefNannyDeclarations
2568 PyObject *__pyx_t_3 = NULL;
2569 PyObject *__pyx_t_4 = NULL;
2570 PyObject *__pyx_t_5 = NULL;
2571 PyObject *__pyx_t_6 = NULL;
2572 PyObject *__pyx_t_7 = NULL;
2573 __Pyx_RefNannySetupContext(
"query", 0);
2582 __pyx_t_1 = __Pyx_PyObject_AsString(__pyx_v_queryString);
if (unlikely((!__pyx_t_1) && PyErr_Occurred())) __PYX_ERR(0, 58, __pyx_L1_error)
2583 __pyx_v_query.
string = __pyx_t_1;
2592 ITM_AMNS_CC_QUERY(__pyx_v_self->_handle, (&__pyx_v_query), (&__pyx_v_answer), (&__pyx_v_error_status));
2601 __pyx_t_2 = (__pyx_v_error_status.flag != 0);
2611 __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_AmnsException);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 61, __pyx_L1_error)
2612 __Pyx_GOTREF(__pyx_t_4);
2613 __pyx_t_5 = __Pyx_PyBytes_FromString(__pyx_v_error_status.
string); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 61, __pyx_L1_error)
2614 __Pyx_GOTREF(__pyx_t_5);
2616 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
2617 __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_4);
2618 if (likely(__pyx_t_6)) {
2619 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_4);
2620 __Pyx_INCREF(__pyx_t_6);
2621 __Pyx_INCREF(
function);
2622 __Pyx_DECREF_SET(__pyx_t_4,
function);
2626 __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_5);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 61, __pyx_L1_error)
2627 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
2628 __Pyx_GOTREF(__pyx_t_3);
2630 #if CYTHON_FAST_PYCALL
2631 if (PyFunction_Check(__pyx_t_4)) {
2632 PyObject *__pyx_temp[2] = {__pyx_t_6, __pyx_t_5};
2633 __pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-1, 1+1);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 61, __pyx_L1_error)
2634 __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
2635 __Pyx_GOTREF(__pyx_t_3);
2636 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
2639 #if CYTHON_FAST_PYCCALL
2640 if (__Pyx_PyFastCFunction_Check(__pyx_t_4)) {
2641 PyObject *__pyx_temp[2] = {__pyx_t_6, __pyx_t_5};
2642 __pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-1, 1+1);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 61, __pyx_L1_error)
2643 __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
2644 __Pyx_GOTREF(__pyx_t_3);
2645 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
2649 __pyx_t_7 = PyTuple_New(1+1);
if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 61, __pyx_L1_error)
2650 __Pyx_GOTREF(__pyx_t_7);
2651 __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_6); __pyx_t_6 = NULL;
2652 __Pyx_GIVEREF(__pyx_t_5);
2653 PyTuple_SET_ITEM(__pyx_t_7, 0+1, __pyx_t_5);
2655 __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_7, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 61, __pyx_L1_error)
2656 __Pyx_GOTREF(__pyx_t_3);
2657 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
2660 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
2661 __Pyx_Raise(__pyx_t_3, 0, 0, 0);
2662 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
2663 __PYX_ERR(0, 61, __pyx_L1_error)
2681 __Pyx_XDECREF(__pyx_r);
2682 __pyx_t_3 = __Pyx_PyBytes_FromString(__pyx_v_answer.
string); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 62, __pyx_L1_error)
2683 __Pyx_GOTREF(__pyx_t_3);
2684 __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_answer.number); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 62, __pyx_L1_error)
2685 __Pyx_GOTREF(__pyx_t_4);
2686 __pyx_t_7 = PyTuple_New(2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 62, __pyx_L1_error)
2687 __Pyx_GOTREF(__pyx_t_7);
2688 __Pyx_GIVEREF(__pyx_t_3);
2689 PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_3);
2690 __Pyx_GIVEREF(__pyx_t_4);
2691 PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_t_4);
2694 __pyx_r = __pyx_t_7;
2708 __Pyx_XDECREF(__pyx_t_3);
2709 __Pyx_XDECREF(__pyx_t_4);
2710 __Pyx_XDECREF(__pyx_t_5);
2711 __Pyx_XDECREF(__pyx_t_6);
2712 __Pyx_XDECREF(__pyx_t_7);
2713 __Pyx_AddTraceback("amns.Amns.
query", __pyx_clineno, __pyx_lineno, __pyx_filename);
2716 __Pyx_XGIVEREF(__pyx_r);
2717 __Pyx_RefNannyFinishContext();
2730 static PyObject *__pyx_pw_4amns_4Amns_7version_1__get__(PyObject *__pyx_v_self);
2731 static PyObject *__pyx_pw_4amns_4Amns_7version_1__get__(PyObject *__pyx_v_self) {
2732 PyObject *__pyx_r = 0;
2733 __Pyx_RefNannyDeclarations
2734 __Pyx_RefNannySetupContext(
"__get__ (wrapper)", 0);
2735 __pyx_r = __pyx_pf_4amns_4Amns_7version___get__(((
struct __pyx_obj_4amns_Amns *)__pyx_v_self));
2738 __Pyx_RefNannyFinishContext();
2742 static PyObject *__pyx_pf_4amns_4Amns_7version___get__(
struct __pyx_obj_4amns_Amns *__pyx_v_self) {
2744 PyObject *__pyx_r = NULL;
2745 __Pyx_RefNannyDeclarations
2746 PyObject *__pyx_t_1 = NULL;
2747 PyObject *__pyx_t_2 = NULL;
2748 PyObject *__pyx_t_3 = NULL;
2749 __Pyx_RefNannySetupContext(
"__get__", 0);
2758 __pyx_v_answer = ((
struct __pyx_vtabstruct_4amns_Amns *)__pyx_v_self->__pyx_vtab)->lquery(__pyx_v_self, __pyx_n_s_version);
2767 __Pyx_XDECREF(__pyx_r);
2768 __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_answer.
number);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 69, __pyx_L1_error)
2769 __Pyx_GOTREF(__pyx_t_1);
2770 __pyx_t_2 = __Pyx_PyBytes_FromString(__pyx_v_answer.
string); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 69, __pyx_L1_error)
2771 __Pyx_GOTREF(__pyx_t_2);
2772 __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 69, __pyx_L1_error)
2773 __Pyx_GOTREF(__pyx_t_3);
2774 __Pyx_GIVEREF(__pyx_t_1);
2775 PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1);
2776 __Pyx_GIVEREF(__pyx_t_2);
2777 PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_2);
2780 __pyx_r = __pyx_t_3;
2794 __Pyx_XDECREF(__pyx_t_1);
2795 __Pyx_XDECREF(__pyx_t_2);
2796 __Pyx_XDECREF(__pyx_t_3);
2797 __Pyx_AddTraceback("amns.Amns.
version.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
2800 __Pyx_XGIVEREF(__pyx_r);
2801 __Pyx_RefNannyFinishContext();
2814 static PyObject *__pyx_pw_4amns_4Amns_7set(PyObject *__pyx_v_self, PyObject *__pyx_v_setString);
2815 static
char __pyx_doc_4amns_4Amns_6set[] = "Provide the interface to ITM_AMNS_SET";
2816 static PyObject *__pyx_pw_4amns_4Amns_7set(PyObject *__pyx_v_self, PyObject *__pyx_v_setString) {
2817 PyObject *__pyx_r = 0;
2818 __Pyx_RefNannyDeclarations
2819 __Pyx_RefNannySetupContext(
"set (wrapper)", 0);
2820 __pyx_r = __pyx_pf_4amns_4Amns_6set(((
struct __pyx_obj_4amns_Amns *)__pyx_v_self), ((PyObject *)__pyx_v_setString));
2823 __Pyx_RefNannyFinishContext();
2827 static PyObject *__pyx_pf_4amns_4Amns_6set(
struct __pyx_obj_4amns_Amns *__pyx_v_self, PyObject *__pyx_v_setString) {
2830 PyObject *__pyx_r = NULL;
2831 __Pyx_RefNannyDeclarations
2834 PyObject *__pyx_t_3 = NULL;
2835 PyObject *__pyx_t_4 = NULL;
2836 PyObject *__pyx_t_5 = NULL;
2837 PyObject *__pyx_t_6 = NULL;
2838 PyObject *__pyx_t_7 = NULL;
2839 __Pyx_RefNannySetupContext(
"set", 0);
2848 __pyx_t_1 = __Pyx_PyObject_AsString(__pyx_v_setString);
if (unlikely((!__pyx_t_1) && PyErr_Occurred())) __PYX_ERR(0, 75, __pyx_L1_error)
2849 __pyx_v_set.
string = __pyx_t_1;
2858 ITM_AMNS_CC_SET(__pyx_v_self->_handle, (&__pyx_v_set), (&__pyx_v_error_status));
2867 __pyx_t_2 = (__pyx_v_error_status.flag != 0);
2877 __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_AmnsException);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 78, __pyx_L1_error)
2878 __Pyx_GOTREF(__pyx_t_4);
2879 __pyx_t_5 = __Pyx_PyBytes_FromString(__pyx_v_error_status.
string); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 78, __pyx_L1_error)
2880 __Pyx_GOTREF(__pyx_t_5);
2882 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
2883 __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_4);
2884 if (likely(__pyx_t_6)) {
2885 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_4);
2886 __Pyx_INCREF(__pyx_t_6);
2887 __Pyx_INCREF(
function);
2888 __Pyx_DECREF_SET(__pyx_t_4,
function);
2892 __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_5);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 78, __pyx_L1_error)
2893 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
2894 __Pyx_GOTREF(__pyx_t_3);
2896 #if CYTHON_FAST_PYCALL
2897 if (PyFunction_Check(__pyx_t_4)) {
2898 PyObject *__pyx_temp[2] = {__pyx_t_6, __pyx_t_5};
2899 __pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-1, 1+1);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 78, __pyx_L1_error)
2900 __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
2901 __Pyx_GOTREF(__pyx_t_3);
2902 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
2905 #if CYTHON_FAST_PYCCALL
2906 if (__Pyx_PyFastCFunction_Check(__pyx_t_4)) {
2907 PyObject *__pyx_temp[2] = {__pyx_t_6, __pyx_t_5};
2908 __pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-1, 1+1);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 78, __pyx_L1_error)
2909 __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
2910 __Pyx_GOTREF(__pyx_t_3);
2911 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
2915 __pyx_t_7 = PyTuple_New(1+1);
if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 78, __pyx_L1_error)
2916 __Pyx_GOTREF(__pyx_t_7);
2917 __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_6); __pyx_t_6 = NULL;
2918 __Pyx_GIVEREF(__pyx_t_5);
2919 PyTuple_SET_ITEM(__pyx_t_7, 0+1, __pyx_t_5);
2921 __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_7, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 78, __pyx_L1_error)
2922 __Pyx_GOTREF(__pyx_t_3);
2923 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
2926 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
2927 __Pyx_Raise(__pyx_t_3, 0, 0, 0);
2928 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
2929 __PYX_ERR(0, 78, __pyx_L1_error)
2949 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
2952 __Pyx_XDECREF(__pyx_t_3);
2953 __Pyx_XDECREF(__pyx_t_4);
2954 __Pyx_XDECREF(__pyx_t_5);
2955 __Pyx_XDECREF(__pyx_t_6);
2956 __Pyx_XDECREF(__pyx_t_7);
2957 __Pyx_AddTraceback("amns.Amns.set", __pyx_clineno, __pyx_lineno, __pyx_filename);
2960 __Pyx_XGIVEREF(__pyx_r);
2961 __Pyx_RefNannyFinishContext();
2974 static PyObject *__pyx_pw_4amns_4Amns_9finalize(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused);
2975 static
char __pyx_doc_4amns_4Amns_8finalize[] = "Provide the interface to ITM_AMNS_FINISH";
2976 static PyObject *__pyx_pw_4amns_4Amns_9finalize(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
2977 PyObject *__pyx_r = 0;
2978 __Pyx_RefNannyDeclarations
2979 __Pyx_RefNannySetupContext(
"finalize (wrapper)", 0);
2980 __pyx_r = __pyx_pf_4amns_4Amns_8finalize(((
struct __pyx_obj_4amns_Amns *)__pyx_v_self));
2983 __Pyx_RefNannyFinishContext();
2987 static PyObject *__pyx_pf_4amns_4Amns_8finalize(
struct __pyx_obj_4amns_Amns *__pyx_v_self) {
2989 PyObject *__pyx_r = NULL;
2990 __Pyx_RefNannyDeclarations
2992 PyObject *__pyx_t_2 = NULL;
2993 PyObject *__pyx_t_3 = NULL;
2994 PyObject *__pyx_t_4 = NULL;
2995 PyObject *__pyx_t_5 = NULL;
2996 PyObject *__pyx_t_6 = NULL;
2997 __Pyx_RefNannySetupContext(
"finalize", 0);
3015 __pyx_t_1 = (__pyx_v_error_status.
flag != 0);
3025 __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_AmnsException);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 85, __pyx_L1_error)
3026 __Pyx_GOTREF(__pyx_t_3);
3027 __pyx_t_4 = __Pyx_PyBytes_FromString(__pyx_v_error_status.
string); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 85, __pyx_L1_error)
3028 __Pyx_GOTREF(__pyx_t_4);
3030 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
3031 __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_3);
3032 if (likely(__pyx_t_5)) {
3033 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_3);
3034 __Pyx_INCREF(__pyx_t_5);
3035 __Pyx_INCREF(
function);
3036 __Pyx_DECREF_SET(__pyx_t_3,
function);
3040 __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 85, __pyx_L1_error)
3041 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
3042 __Pyx_GOTREF(__pyx_t_2);
3044 #if CYTHON_FAST_PYCALL
3045 if (PyFunction_Check(__pyx_t_3)) {
3046 PyObject *__pyx_temp[2] = {__pyx_t_5, __pyx_t_4};
3047 __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 85, __pyx_L1_error)
3048 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
3049 __Pyx_GOTREF(__pyx_t_2);
3050 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
3053 #if CYTHON_FAST_PYCCALL
3054 if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
3055 PyObject *__pyx_temp[2] = {__pyx_t_5, __pyx_t_4};
3056 __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 85, __pyx_L1_error)
3057 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
3058 __Pyx_GOTREF(__pyx_t_2);
3059 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
3063 __pyx_t_6 = PyTuple_New(1+1);
if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 85, __pyx_L1_error)
3064 __Pyx_GOTREF(__pyx_t_6);
3065 __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_5); __pyx_t_5 = NULL;
3066 __Pyx_GIVEREF(__pyx_t_4);
3067 PyTuple_SET_ITEM(__pyx_t_6, 0+1, __pyx_t_4);
3069 __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_6, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 85, __pyx_L1_error)
3070 __Pyx_GOTREF(__pyx_t_2);
3071 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
3074 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
3075 __Pyx_Raise(__pyx_t_2, 0, 0, 0);
3076 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
3077 __PYX_ERR(0, 85, __pyx_L1_error)
3097 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
3100 __Pyx_XDECREF(__pyx_t_2);
3101 __Pyx_XDECREF(__pyx_t_3);
3102 __Pyx_XDECREF(__pyx_t_4);
3103 __Pyx_XDECREF(__pyx_t_5);
3104 __Pyx_XDECREF(__pyx_t_6);
3105 __Pyx_AddTraceback("amns.Amns.finalize", __pyx_clineno, __pyx_lineno, __pyx_filename);
3108 __Pyx_XGIVEREF(__pyx_r);
3109 __Pyx_RefNannyFinishContext();
3122 static PyObject *__pyx_pw_4amns_4Amns_11get_table(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
3123 static
char __pyx_doc_4amns_4Amns_10get_table[] = "Provide the interface to the Table class used for tables";
3124 static PyObject *__pyx_pw_4amns_4Amns_11get_table(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
3125 PyObject *__pyx_v_reactionString = 0;
3126 struct __pyx_obj_4amns_Reactants *__pyx_v_reactants = 0;
3127 PyObject *__pyx_v_isotope_resolved = 0;
3128 PyObject *__pyx_r = 0;
3129 __Pyx_RefNannyDeclarations
3130 __Pyx_RefNannySetupContext(
"get_table (wrapper)", 0);
3132 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_reactionString,&__pyx_n_s_reactants,&__pyx_n_s_isotope_resolved,0};
3133 PyObject* values[3] = {0,0,0};
3134 values[2] = ((PyObject *)Py_None);
3135 if (unlikely(__pyx_kwds)) {
3137 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
3139 case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
3140 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
3141 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
3143 default:
goto __pyx_L5_argtuple_error;
3145 kw_args = PyDict_Size(__pyx_kwds);
3148 if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_reactionString)) != 0)) kw_args--;
3149 else goto __pyx_L5_argtuple_error;
3151 if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_reactants)) != 0)) kw_args--;
3153 __Pyx_RaiseArgtupleInvalid(
"get_table", 0, 2, 3, 1); __PYX_ERR(0, 87, __pyx_L3_error)
3157 PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_isotope_resolved);
3158 if (value) { values[2] = value; kw_args--; }
3161 if (unlikely(kw_args > 0)) {
3162 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args,
"get_table") < 0)) __PYX_ERR(0, 87, __pyx_L3_error)
3165 switch (PyTuple_GET_SIZE(__pyx_args)) {
3166 case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
3167 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
3168 values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
3170 default:
goto __pyx_L5_argtuple_error;
3173 __pyx_v_reactionString = values[0];
3174 __pyx_v_reactants = ((
struct __pyx_obj_4amns_Reactants *)values[1]);
3175 __pyx_v_isotope_resolved = values[2];
3177 goto __pyx_L4_argument_unpacking_done;
3178 __pyx_L5_argtuple_error:;
3179 __Pyx_RaiseArgtupleInvalid(
"get_table", 0, 2, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 87, __pyx_L3_error)
3181 __Pyx_AddTraceback("amns.Amns.get_table", __pyx_clineno, __pyx_lineno, __pyx_filename);
3182 __Pyx_RefNannyFinishContext();
3184 __pyx_L4_argument_unpacking_done:;
3185 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_reactants), __pyx_ptype_4amns_Reactants, 1, "
reactants", 0))) __PYX_ERR(0, 87, __pyx_L1_error)
3186 __pyx_r = __pyx_pf_4amns_4Amns_10get_table(((struct __pyx_obj_4amns_Amns *)__pyx_v_self), __pyx_v_reactionString, __pyx_v_reactants, __pyx_v_isotope_resolved);
3193 __Pyx_RefNannyFinishContext();
3197 static PyObject *__pyx_pf_4amns_4Amns_10get_table(struct __pyx_obj_4amns_Amns *__pyx_v_self, PyObject *__pyx_v_reactionString, struct __pyx_obj_4amns_Reactants *__pyx_v_reactants, PyObject *__pyx_v_isotope_resolved) {
3198 PyObject *__pyx_r = NULL;
3199 __Pyx_RefNannyDeclarations
3200 PyObject *__pyx_t_1 = NULL;
3201 PyObject *__pyx_t_2 = NULL;
3202 __Pyx_RefNannySetupContext(
"get_table", 0);
3211 __Pyx_XDECREF(__pyx_r);
3212 __pyx_t_1 = PyTuple_New(4);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 89, __pyx_L1_error)
3213 __Pyx_GOTREF(__pyx_t_1);
3214 __Pyx_INCREF(__pyx_v_reactionString);
3215 __Pyx_GIVEREF(__pyx_v_reactionString);
3216 PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_reactionString);
3217 __Pyx_INCREF(((PyObject *)__pyx_v_reactants));
3218 __Pyx_GIVEREF(((PyObject *)__pyx_v_reactants));
3219 PyTuple_SET_ITEM(__pyx_t_1, 1, ((PyObject *)__pyx_v_reactants));
3220 __Pyx_INCREF(((PyObject *)__pyx_v_self));
3221 __Pyx_GIVEREF(((PyObject *)__pyx_v_self));
3222 PyTuple_SET_ITEM(__pyx_t_1, 2, ((PyObject *)__pyx_v_self));
3223 __Pyx_INCREF(__pyx_v_isotope_resolved);
3224 __Pyx_GIVEREF(__pyx_v_isotope_resolved);
3225 PyTuple_SET_ITEM(__pyx_t_1, 3, __pyx_v_isotope_resolved);
3226 __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_4amns_Table), __pyx_t_1, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 89, __pyx_L1_error)
3227 __Pyx_GOTREF(__pyx_t_2);
3228 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
3229 __pyx_r = __pyx_t_2;
3243 __Pyx_XDECREF(__pyx_t_1);
3244 __Pyx_XDECREF(__pyx_t_2);
3245 __Pyx_AddTraceback("amns.Amns.get_table", __pyx_clineno, __pyx_lineno, __pyx_filename);
3248 __Pyx_XGIVEREF(__pyx_r);
3249 __Pyx_RefNannyFinishContext();
3262 static
int __pyx_pw_4amns_5Table_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
3263 static
char __pyx_doc_4amns_5Table___init__[] = "Create a new table";
3264 #if CYTHON_COMPILING_IN_CPYTHON
3265 struct wrapperbase __pyx_wrapperbase_4amns_5Table___init__;
3267 static int __pyx_pw_4amns_5Table_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
3268 PyObject *__pyx_v_reactionString = 0;
3269 struct __pyx_obj_4amns_Reactants *__pyx_v_reactants = 0;
3270 struct __pyx_obj_4amns_Amns *__pyx_v_parentAmns = 0;
3271 PyObject *__pyx_v_isotope_resolved = 0;
3273 __Pyx_RefNannyDeclarations
3274 __Pyx_RefNannySetupContext(
"__init__ (wrapper)", 0);
3276 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_reactionString,&__pyx_n_s_reactants,&__pyx_n_s_parentAmns,&__pyx_n_s_isotope_resolved,0};
3277 PyObject* values[4] = {0,0,0,0};
3278 values[3] = ((PyObject *)Py_None);
3279 if (unlikely(__pyx_kwds)) {
3281 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
3283 case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
3284 case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
3285 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
3286 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
3288 default:
goto __pyx_L5_argtuple_error;
3290 kw_args = PyDict_Size(__pyx_kwds);
3293 if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_reactionString)) != 0)) kw_args--;
3294 else goto __pyx_L5_argtuple_error;
3296 if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_reactants)) != 0)) kw_args--;
3298 __Pyx_RaiseArgtupleInvalid(
"__init__", 0, 3, 4, 1); __PYX_ERR(0, 98, __pyx_L3_error)
3301 if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_parentAmns)) != 0)) kw_args--;
3303 __Pyx_RaiseArgtupleInvalid(
"__init__", 0, 3, 4, 2); __PYX_ERR(0, 98, __pyx_L3_error)
3307 PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_isotope_resolved);
3308 if (value) { values[3] = value; kw_args--; }
3311 if (unlikely(kw_args > 0)) {
3312 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args,
"__init__") < 0)) __PYX_ERR(0, 98, __pyx_L3_error)
3315 switch (PyTuple_GET_SIZE(__pyx_args)) {
3316 case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
3317 case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
3318 values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
3319 values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
3321 default:
goto __pyx_L5_argtuple_error;
3324 __pyx_v_reactionString = values[0];
3325 __pyx_v_reactants = ((
struct __pyx_obj_4amns_Reactants *)values[1]);
3326 __pyx_v_parentAmns = ((
struct __pyx_obj_4amns_Amns *)values[2]);
3327 __pyx_v_isotope_resolved = values[3];
3329 goto __pyx_L4_argument_unpacking_done;
3330 __pyx_L5_argtuple_error:;
3331 __Pyx_RaiseArgtupleInvalid(
"__init__", 0, 3, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 98, __pyx_L3_error)
3333 __Pyx_AddTraceback("amns.Table.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
3334 __Pyx_RefNannyFinishContext();
3336 __pyx_L4_argument_unpacking_done:;
3337 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_reactants), __pyx_ptype_4amns_Reactants, 1, "reactants", 0))) __PYX_ERR(0, 98, __pyx_L1_error)
3338 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_parentAmns), __pyx_ptype_4amns_Amns, 1, "parentAmns", 0))) __PYX_ERR(0, 98, __pyx_L1_error)
3339 __pyx_r = __pyx_pf_4amns_5Table___init__(((struct __pyx_obj_4amns_Table *)__pyx_v_self), __pyx_v_reactionString, __pyx_v_reactants, __pyx_v_parentAmns, __pyx_v_isotope_resolved);
3346 __Pyx_RefNannyFinishContext();
3350 static
int __pyx_pf_4amns_5Table___init__(struct __pyx_obj_4amns_Table *__pyx_v_self, PyObject *__pyx_v_reactionString, struct __pyx_obj_4amns_Reactants *__pyx_v_reactants, struct __pyx_obj_4amns_Amns *__pyx_v_parentAmns, PyObject *__pyx_v_isotope_resolved) {
3354 __Pyx_RefNannyDeclarations
3358 PyObject *__pyx_t_4 = NULL;
3359 PyObject *__pyx_t_5 = NULL;
3360 PyObject *__pyx_t_6 = NULL;
3361 PyObject *__pyx_t_7 = NULL;
3362 PyObject *__pyx_t_8 = NULL;
3363 __Pyx_RefNannySetupContext(
"__init__", 0);
3381 __Pyx_INCREF(((PyObject *)__pyx_v_parentAmns));
3382 __Pyx_GIVEREF(((PyObject *)__pyx_v_parentAmns));
3383 __Pyx_GOTREF(__pyx_v_self->_parentAmns);
3384 __Pyx_DECREF(((PyObject *)__pyx_v_self->_parentAmns));
3385 __pyx_v_self->_parentAmns = __pyx_v_parentAmns;
3394 __pyx_t_1 = __Pyx_PyObject_AsString(__pyx_v_reactionString);
if (unlikely((!__pyx_t_1) && PyErr_Occurred())) __PYX_ERR(0, 104, __pyx_L1_error)
3395 __pyx_v_reaction.
string = __pyx_t_1;
3404 __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_isotope_resolved); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 105, __pyx_L1_error)
3406 __pyx_t_3 = __Pyx_PyInt_As_int(__pyx_v_isotope_resolved);
if (unlikely((__pyx_t_3 == (
int)-1) && PyErr_Occurred())) __PYX_ERR(0, 105, __pyx_L1_error)
3417 ITM_AMNS_CC_SETUP_TABLE(((struct __pyx_vtabstruct_4amns_Amns *)__pyx_v_self->_parentAmns->__pyx_vtab)->handle(__pyx_v_self->_parentAmns), (&__pyx_v_reaction), ((struct __pyx_vtabstruct_4amns_Reactants *)__pyx_v_reactants->__pyx_vtab)->handle(__pyx_v_reactants), (&__pyx_v_self->_handle), (&__pyx_v_error_status));
3426 __pyx_t_2 = (__pyx_v_error_status.flag != 0);
3436 __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_AmnsException);
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 111, __pyx_L1_error)
3437 __Pyx_GOTREF(__pyx_t_5);
3438 __pyx_t_6 = __Pyx_PyBytes_FromString(__pyx_v_error_status.
string); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 111, __pyx_L1_error)
3439 __Pyx_GOTREF(__pyx_t_6);
3441 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_5))) {
3442 __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_5);
3443 if (likely(__pyx_t_7)) {
3444 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_5);
3445 __Pyx_INCREF(__pyx_t_7);
3446 __Pyx_INCREF(
function);
3447 __Pyx_DECREF_SET(__pyx_t_5,
function);
3451 __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_6);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 111, __pyx_L1_error)
3452 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
3453 __Pyx_GOTREF(__pyx_t_4);
3455 #if CYTHON_FAST_PYCALL
3456 if (PyFunction_Check(__pyx_t_5)) {
3457 PyObject *__pyx_temp[2] = {__pyx_t_7, __pyx_t_6};
3458 __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_5, __pyx_temp+1-1, 1+1);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 111, __pyx_L1_error)
3459 __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
3460 __Pyx_GOTREF(__pyx_t_4);
3461 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
3464 #if CYTHON_FAST_PYCCALL
3465 if (__Pyx_PyFastCFunction_Check(__pyx_t_5)) {
3466 PyObject *__pyx_temp[2] = {__pyx_t_7, __pyx_t_6};
3467 __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_5, __pyx_temp+1-1, 1+1);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 111, __pyx_L1_error)
3468 __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
3469 __Pyx_GOTREF(__pyx_t_4);
3470 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
3474 __pyx_t_8 = PyTuple_New(1+1);
if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 111, __pyx_L1_error)
3475 __Pyx_GOTREF(__pyx_t_8);
3476 __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_7); __pyx_t_7 = NULL;
3477 __Pyx_GIVEREF(__pyx_t_6);
3478 PyTuple_SET_ITEM(__pyx_t_8, 0+1, __pyx_t_6);
3480 __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_8, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 111, __pyx_L1_error)
3481 __Pyx_GOTREF(__pyx_t_4);
3482 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
3485 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
3486 __Pyx_Raise(__pyx_t_4, 0, 0, 0);
3487 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
3488 __PYX_ERR(0, 111, __pyx_L1_error)
3506 __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_set); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 113, __pyx_L1_error)
3507 __Pyx_GOTREF(__pyx_t_4);
3508 __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_tuple_, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 113, __pyx_L1_error)
3509 __Pyx_GOTREF(__pyx_t_5);
3510 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
3511 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
3525 __Pyx_XDECREF(__pyx_t_4);
3526 __Pyx_XDECREF(__pyx_t_5);
3527 __Pyx_XDECREF(__pyx_t_6);
3528 __Pyx_XDECREF(__pyx_t_7);
3529 __Pyx_XDECREF(__pyx_t_8);
3530 __Pyx_AddTraceback("amns.Table.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
3533 __Pyx_RefNannyFinishContext();
3545 static
amns_c_answer_type __pyx_f_4amns_5Table_lquery(struct __pyx_obj_4amns_Table *__pyx_v_self, PyObject *__pyx_v_queryString) {
3550 __Pyx_RefNannyDeclarations
3553 PyObject *__pyx_t_3 = NULL;
3554 PyObject *__pyx_t_4 = NULL;
3555 PyObject *__pyx_t_5 = NULL;
3556 PyObject *__pyx_t_6 = NULL;
3557 PyObject *__pyx_t_7 = NULL;
3558 __Pyx_RefNannySetupContext(
"lquery", 0);
3567 __pyx_t_1 = __Pyx_PyObject_AsString(__pyx_v_queryString);
if (unlikely((!__pyx_t_1) && PyErr_Occurred())) __PYX_ERR(0, 120, __pyx_L1_error)
3568 __pyx_v_query.
string = __pyx_t_1;
3586 __pyx_t_2 = (__pyx_v_error_status.flag != 0);
3596 __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_AmnsException);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 123, __pyx_L1_error)
3597 __Pyx_GOTREF(__pyx_t_4);
3598 __pyx_t_5 = __Pyx_PyBytes_FromString(__pyx_v_error_status.
string); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 123, __pyx_L1_error)
3599 __Pyx_GOTREF(__pyx_t_5);
3601 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
3602 __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_4);
3603 if (likely(__pyx_t_6)) {
3604 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_4);
3605 __Pyx_INCREF(__pyx_t_6);
3606 __Pyx_INCREF(
function);
3607 __Pyx_DECREF_SET(__pyx_t_4,
function);
3611 __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_5);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 123, __pyx_L1_error)
3612 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
3613 __Pyx_GOTREF(__pyx_t_3);
3615 #if CYTHON_FAST_PYCALL
3616 if (PyFunction_Check(__pyx_t_4)) {
3617 PyObject *__pyx_temp[2] = {__pyx_t_6, __pyx_t_5};
3618 __pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-1, 1+1);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 123, __pyx_L1_error)
3619 __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
3620 __Pyx_GOTREF(__pyx_t_3);
3621 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
3624 #if CYTHON_FAST_PYCCALL
3625 if (__Pyx_PyFastCFunction_Check(__pyx_t_4)) {
3626 PyObject *__pyx_temp[2] = {__pyx_t_6, __pyx_t_5};
3627 __pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-1, 1+1);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 123, __pyx_L1_error)
3628 __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
3629 __Pyx_GOTREF(__pyx_t_3);
3630 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
3634 __pyx_t_7 = PyTuple_New(1+1);
if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 123, __pyx_L1_error)
3635 __Pyx_GOTREF(__pyx_t_7);
3636 __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_6); __pyx_t_6 = NULL;
3637 __Pyx_GIVEREF(__pyx_t_5);
3638 PyTuple_SET_ITEM(__pyx_t_7, 0+1, __pyx_t_5);
3640 __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_7, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 123, __pyx_L1_error)
3641 __Pyx_GOTREF(__pyx_t_3);
3642 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
3645 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
3646 __Pyx_Raise(__pyx_t_3, 0, 0, 0);
3647 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
3648 __PYX_ERR(0, 123, __pyx_L1_error)
3666 __pyx_r = __pyx_v_answer;
3679 __Pyx_XDECREF(__pyx_t_3);
3680 __Pyx_XDECREF(__pyx_t_4);
3681 __Pyx_XDECREF(__pyx_t_5);
3682 __Pyx_XDECREF(__pyx_t_6);
3683 __Pyx_XDECREF(__pyx_t_7);
3684 __Pyx_WriteUnraisable("amns.Table.lquery", __pyx_clineno, __pyx_lineno, __pyx_filename, 0, 0);
3686 __Pyx_RefNannyFinishContext();
3699 static PyObject *__pyx_pw_4amns_5Table_3query(PyObject *__pyx_v_self, PyObject *__pyx_v_queryString);
3700 static
char __pyx_doc_4amns_5Table_2query[] = "Provide the interface to ITM_AMNS_QUERY_TABLE";
3701 static PyObject *__pyx_pw_4amns_5Table_3query(PyObject *__pyx_v_self, PyObject *__pyx_v_queryString) {
3702 PyObject *__pyx_r = 0;
3703 __Pyx_RefNannyDeclarations
3704 __Pyx_RefNannySetupContext(
"query (wrapper)", 0);
3705 __pyx_r = __pyx_pf_4amns_5Table_2query(((
struct __pyx_obj_4amns_Table *)__pyx_v_self), ((PyObject *)__pyx_v_queryString));
3708 __Pyx_RefNannyFinishContext();
3712 static PyObject *__pyx_pf_4amns_5Table_2query(
struct __pyx_obj_4amns_Table *__pyx_v_self, PyObject *__pyx_v_queryString) {
3716 PyObject *__pyx_r = NULL;
3717 __Pyx_RefNannyDeclarations
3720 PyObject *__pyx_t_3 = NULL;
3721 PyObject *__pyx_t_4 = NULL;
3722 PyObject *__pyx_t_5 = NULL;
3723 PyObject *__pyx_t_6 = NULL;
3724 PyObject *__pyx_t_7 = NULL;
3725 __Pyx_RefNannySetupContext(
"query", 0);
3734 __pyx_t_1 = __Pyx_PyObject_AsString(__pyx_v_queryString);
if (unlikely((!__pyx_t_1) && PyErr_Occurred())) __PYX_ERR(0, 131, __pyx_L1_error)
3735 __pyx_v_query.
string = __pyx_t_1;
3753 __pyx_t_2 = (__pyx_v_error_status.flag != 0);
3763 __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_AmnsException);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 134, __pyx_L1_error)
3764 __Pyx_GOTREF(__pyx_t_4);
3765 __pyx_t_5 = __Pyx_PyBytes_FromString(__pyx_v_error_status.
string); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 134, __pyx_L1_error)
3766 __Pyx_GOTREF(__pyx_t_5);
3768 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
3769 __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_4);
3770 if (likely(__pyx_t_6)) {
3771 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_4);
3772 __Pyx_INCREF(__pyx_t_6);
3773 __Pyx_INCREF(
function);
3774 __Pyx_DECREF_SET(__pyx_t_4,
function);
3778 __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_5);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 134, __pyx_L1_error)
3779 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
3780 __Pyx_GOTREF(__pyx_t_3);
3782 #if CYTHON_FAST_PYCALL
3783 if (PyFunction_Check(__pyx_t_4)) {
3784 PyObject *__pyx_temp[2] = {__pyx_t_6, __pyx_t_5};
3785 __pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-1, 1+1);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 134, __pyx_L1_error)
3786 __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
3787 __Pyx_GOTREF(__pyx_t_3);
3788 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
3791 #if CYTHON_FAST_PYCCALL
3792 if (__Pyx_PyFastCFunction_Check(__pyx_t_4)) {
3793 PyObject *__pyx_temp[2] = {__pyx_t_6, __pyx_t_5};
3794 __pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-1, 1+1);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 134, __pyx_L1_error)
3795 __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
3796 __Pyx_GOTREF(__pyx_t_3);
3797 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
3801 __pyx_t_7 = PyTuple_New(1+1);
if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 134, __pyx_L1_error)
3802 __Pyx_GOTREF(__pyx_t_7);
3803 __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_6); __pyx_t_6 = NULL;
3804 __Pyx_GIVEREF(__pyx_t_5);
3805 PyTuple_SET_ITEM(__pyx_t_7, 0+1, __pyx_t_5);
3807 __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_7, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 134, __pyx_L1_error)
3808 __Pyx_GOTREF(__pyx_t_3);
3809 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
3812 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
3813 __Pyx_Raise(__pyx_t_3, 0, 0, 0);
3814 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
3815 __PYX_ERR(0, 134, __pyx_L1_error)
3833 __Pyx_XDECREF(__pyx_r);
3834 __pyx_t_3 = __Pyx_PyBytes_FromString(__pyx_v_answer.
string); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 135, __pyx_L1_error)
3835 __Pyx_GOTREF(__pyx_t_3);
3836 __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_answer.number); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 135, __pyx_L1_error)
3837 __Pyx_GOTREF(__pyx_t_4);
3838 __pyx_t_7 = PyTuple_New(2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 135, __pyx_L1_error)
3839 __Pyx_GOTREF(__pyx_t_7);
3840 __Pyx_GIVEREF(__pyx_t_3);
3841 PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_3);
3842 __Pyx_GIVEREF(__pyx_t_4);
3843 PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_t_4);
3846 __pyx_r = __pyx_t_7;
3860 __Pyx_XDECREF(__pyx_t_3);
3861 __Pyx_XDECREF(__pyx_t_4);
3862 __Pyx_XDECREF(__pyx_t_5);
3863 __Pyx_XDECREF(__pyx_t_6);
3864 __Pyx_XDECREF(__pyx_t_7);
3865 __Pyx_AddTraceback("amns.Table.query", __pyx_clineno, __pyx_lineno, __pyx_filename);
3868 __Pyx_XGIVEREF(__pyx_r);
3869 __Pyx_RefNannyFinishContext();
3882 static PyObject *__pyx_pw_4amns_5Table_5set(PyObject *__pyx_v_self, PyObject *__pyx_v_setString);
3883 static
char __pyx_doc_4amns_5Table_4set[] = "Provide the interface to ITM_AMNS_SET_TABLE";
3884 static PyObject *__pyx_pw_4amns_5Table_5set(PyObject *__pyx_v_self, PyObject *__pyx_v_setString) {
3885 PyObject *__pyx_r = 0;
3886 __Pyx_RefNannyDeclarations
3887 __Pyx_RefNannySetupContext(
"set (wrapper)", 0);
3888 __pyx_r = __pyx_pf_4amns_5Table_4set(((
struct __pyx_obj_4amns_Table *)__pyx_v_self), ((PyObject *)__pyx_v_setString));
3891 __Pyx_RefNannyFinishContext();
3895 static PyObject *__pyx_pf_4amns_5Table_4set(
struct __pyx_obj_4amns_Table *__pyx_v_self, PyObject *__pyx_v_setString) {
3898 PyObject *__pyx_r = NULL;
3899 __Pyx_RefNannyDeclarations
3902 PyObject *__pyx_t_3 = NULL;
3903 PyObject *__pyx_t_4 = NULL;
3904 PyObject *__pyx_t_5 = NULL;
3905 PyObject *__pyx_t_6 = NULL;
3906 PyObject *__pyx_t_7 = NULL;
3907 __Pyx_RefNannySetupContext(
"set", 0);
3916 __pyx_t_1 = __Pyx_PyObject_AsString(__pyx_v_setString);
if (unlikely((!__pyx_t_1) && PyErr_Occurred())) __PYX_ERR(0, 141, __pyx_L1_error)
3917 __pyx_v_set.
string = __pyx_t_1;
3935 __pyx_t_2 = (__pyx_v_error_status.flag != 0);
3945 __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_AmnsException);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 144, __pyx_L1_error)
3946 __Pyx_GOTREF(__pyx_t_4);
3947 __pyx_t_5 = __Pyx_PyBytes_FromString(__pyx_v_error_status.
string); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 144, __pyx_L1_error)
3948 __Pyx_GOTREF(__pyx_t_5);
3950 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
3951 __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_4);
3952 if (likely(__pyx_t_6)) {
3953 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_4);
3954 __Pyx_INCREF(__pyx_t_6);
3955 __Pyx_INCREF(
function);
3956 __Pyx_DECREF_SET(__pyx_t_4,
function);
3960 __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_5);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 144, __pyx_L1_error)
3961 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
3962 __Pyx_GOTREF(__pyx_t_3);
3964 #if CYTHON_FAST_PYCALL
3965 if (PyFunction_Check(__pyx_t_4)) {
3966 PyObject *__pyx_temp[2] = {__pyx_t_6, __pyx_t_5};
3967 __pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-1, 1+1);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 144, __pyx_L1_error)
3968 __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
3969 __Pyx_GOTREF(__pyx_t_3);
3970 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
3973 #if CYTHON_FAST_PYCCALL
3974 if (__Pyx_PyFastCFunction_Check(__pyx_t_4)) {
3975 PyObject *__pyx_temp[2] = {__pyx_t_6, __pyx_t_5};
3976 __pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-1, 1+1);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 144, __pyx_L1_error)
3977 __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
3978 __Pyx_GOTREF(__pyx_t_3);
3979 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
3983 __pyx_t_7 = PyTuple_New(1+1);
if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 144, __pyx_L1_error)
3984 __Pyx_GOTREF(__pyx_t_7);
3985 __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_6); __pyx_t_6 = NULL;
3986 __Pyx_GIVEREF(__pyx_t_5);
3987 PyTuple_SET_ITEM(__pyx_t_7, 0+1, __pyx_t_5);
3989 __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_7, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 144, __pyx_L1_error)
3990 __Pyx_GOTREF(__pyx_t_3);
3991 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
3994 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
3995 __Pyx_Raise(__pyx_t_3, 0, 0, 0);
3996 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
3997 __PYX_ERR(0, 144, __pyx_L1_error)
4017 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
4020 __Pyx_XDECREF(__pyx_t_3);
4021 __Pyx_XDECREF(__pyx_t_4);
4022 __Pyx_XDECREF(__pyx_t_5);
4023 __Pyx_XDECREF(__pyx_t_6);
4024 __Pyx_XDECREF(__pyx_t_7);
4025 __Pyx_AddTraceback("amns.Table.set", __pyx_clineno, __pyx_lineno, __pyx_filename);
4028 __Pyx_XGIVEREF(__pyx_r);
4029 __Pyx_RefNannyFinishContext();
4042 static PyObject *__pyx_pw_4amns_5Table_7finalize(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused);
4043 static
char __pyx_doc_4amns_5Table_6finalize[] = "Provide the interface to ITM_AMNS_FINISH_TABLE";
4044 static PyObject *__pyx_pw_4amns_5Table_7finalize(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
4045 PyObject *__pyx_r = 0;
4046 __Pyx_RefNannyDeclarations
4047 __Pyx_RefNannySetupContext(
"finalize (wrapper)", 0);
4048 __pyx_r = __pyx_pf_4amns_5Table_6finalize(((
struct __pyx_obj_4amns_Table *)__pyx_v_self));
4051 __Pyx_RefNannyFinishContext();
4055 static PyObject *__pyx_pf_4amns_5Table_6finalize(
struct __pyx_obj_4amns_Table *__pyx_v_self) {
4057 PyObject *__pyx_r = NULL;
4058 __Pyx_RefNannyDeclarations
4060 PyObject *__pyx_t_2 = NULL;
4061 PyObject *__pyx_t_3 = NULL;
4062 PyObject *__pyx_t_4 = NULL;
4063 PyObject *__pyx_t_5 = NULL;
4064 PyObject *__pyx_t_6 = NULL;
4065 __Pyx_RefNannySetupContext(
"finalize", 0);
4083 __pyx_t_1 = (__pyx_v_error_status.
flag != 0);
4093 __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_AmnsException);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 151, __pyx_L1_error)
4094 __Pyx_GOTREF(__pyx_t_3);
4095 __pyx_t_4 = __Pyx_PyBytes_FromString(__pyx_v_error_status.
string); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 151, __pyx_L1_error)
4096 __Pyx_GOTREF(__pyx_t_4);
4098 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
4099 __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_3);
4100 if (likely(__pyx_t_5)) {
4101 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_3);
4102 __Pyx_INCREF(__pyx_t_5);
4103 __Pyx_INCREF(
function);
4104 __Pyx_DECREF_SET(__pyx_t_3,
function);
4108 __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 151, __pyx_L1_error)
4109 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
4110 __Pyx_GOTREF(__pyx_t_2);
4112 #if CYTHON_FAST_PYCALL
4113 if (PyFunction_Check(__pyx_t_3)) {
4114 PyObject *__pyx_temp[2] = {__pyx_t_5, __pyx_t_4};
4115 __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 151, __pyx_L1_error)
4116 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
4117 __Pyx_GOTREF(__pyx_t_2);
4118 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
4121 #if CYTHON_FAST_PYCCALL
4122 if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
4123 PyObject *__pyx_temp[2] = {__pyx_t_5, __pyx_t_4};
4124 __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 151, __pyx_L1_error)
4125 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
4126 __Pyx_GOTREF(__pyx_t_2);
4127 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
4131 __pyx_t_6 = PyTuple_New(1+1);
if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 151, __pyx_L1_error)
4132 __Pyx_GOTREF(__pyx_t_6);
4133 __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_5); __pyx_t_5 = NULL;
4134 __Pyx_GIVEREF(__pyx_t_4);
4135 PyTuple_SET_ITEM(__pyx_t_6, 0+1, __pyx_t_4);
4137 __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_6, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 151, __pyx_L1_error)
4138 __Pyx_GOTREF(__pyx_t_2);
4139 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
4142 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
4143 __Pyx_Raise(__pyx_t_2, 0, 0, 0);
4144 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
4145 __PYX_ERR(0, 151, __pyx_L1_error)
4165 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
4168 __Pyx_XDECREF(__pyx_t_2);
4169 __Pyx_XDECREF(__pyx_t_3);
4170 __Pyx_XDECREF(__pyx_t_4);
4171 __Pyx_XDECREF(__pyx_t_5);
4172 __Pyx_XDECREF(__pyx_t_6);
4173 __Pyx_AddTraceback("amns.Table.finalize", __pyx_clineno, __pyx_lineno, __pyx_filename);
4176 __Pyx_XGIVEREF(__pyx_r);
4177 __Pyx_RefNannyFinishContext();
4190 static PyObject *__pyx_pw_4amns_5Table_15no_of_reactants_1__get__(PyObject *__pyx_v_self);
4191 static PyObject *__pyx_pw_4amns_5Table_15no_of_reactants_1__get__(PyObject *__pyx_v_self) {
4192 PyObject *__pyx_r = 0;
4193 __Pyx_RefNannyDeclarations
4194 __Pyx_RefNannySetupContext(
"__get__ (wrapper)", 0);
4195 __pyx_r = __pyx_pf_4amns_5Table_15no_of_reactants___get__(((
struct __pyx_obj_4amns_Table *)__pyx_v_self));
4198 __Pyx_RefNannyFinishContext();
4202 static PyObject *__pyx_pf_4amns_5Table_15no_of_reactants___get__(
struct __pyx_obj_4amns_Table *__pyx_v_self) {
4204 PyObject *__pyx_r = NULL;
4205 __Pyx_RefNannyDeclarations
4206 PyObject *__pyx_t_1 = NULL;
4207 __Pyx_RefNannySetupContext(
"__get__", 0);
4216 __pyx_v_answer = ((
struct __pyx_vtabstruct_4amns_Table *)__pyx_v_self->__pyx_vtab)->lquery(__pyx_v_self, __pyx_n_s_no_of_reactants);
4225 __Pyx_XDECREF(__pyx_r);
4226 __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_answer.
number);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 158, __pyx_L1_error)
4227 __Pyx_GOTREF(__pyx_t_1);
4228 __pyx_r = __pyx_t_1;
4242 __Pyx_XDECREF(__pyx_t_1);
4243 __Pyx_AddTraceback("amns.Table.no_of_reactants.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
4246 __Pyx_XGIVEREF(__pyx_r);
4247 __Pyx_RefNannyFinishContext();
4260 static PyObject *__pyx_pw_4amns_5Table_4ndim_1__get__(PyObject *__pyx_v_self);
4261 static PyObject *__pyx_pw_4amns_5Table_4ndim_1__get__(PyObject *__pyx_v_self) {
4262 PyObject *__pyx_r = 0;
4263 __Pyx_RefNannyDeclarations
4264 __Pyx_RefNannySetupContext(
"__get__ (wrapper)", 0);
4265 __pyx_r = __pyx_pf_4amns_5Table_4ndim___get__(((
struct __pyx_obj_4amns_Table *)__pyx_v_self));
4268 __Pyx_RefNannyFinishContext();
4272 static PyObject *__pyx_pf_4amns_5Table_4ndim___get__(
struct __pyx_obj_4amns_Table *__pyx_v_self) {
4274 PyObject *__pyx_r = NULL;
4275 __Pyx_RefNannyDeclarations
4276 PyObject *__pyx_t_1 = NULL;
4277 __Pyx_RefNannySetupContext(
"__get__", 0);
4286 __pyx_v_answer = ((
struct __pyx_vtabstruct_4amns_Table *)__pyx_v_self->__pyx_vtab)->lquery(__pyx_v_self, __pyx_n_s_ndim);
4295 __Pyx_XDECREF(__pyx_r);
4296 __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_answer.
number);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 165, __pyx_L1_error)
4297 __Pyx_GOTREF(__pyx_t_1);
4298 __pyx_r = __pyx_t_1;
4312 __Pyx_XDECREF(__pyx_t_1);
4313 __Pyx_AddTraceback("amns.Table.
ndim.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
4316 __Pyx_XGIVEREF(__pyx_r);
4317 __Pyx_RefNannyFinishContext();
4330 static PyObject *__pyx_pw_4amns_5Table_6source_1__get__(PyObject *__pyx_v_self);
4331 static PyObject *__pyx_pw_4amns_5Table_6source_1__get__(PyObject *__pyx_v_self) {
4332 PyObject *__pyx_r = 0;
4333 __Pyx_RefNannyDeclarations
4334 __Pyx_RefNannySetupContext(
"__get__ (wrapper)", 0);
4335 __pyx_r = __pyx_pf_4amns_5Table_6source___get__(((
struct __pyx_obj_4amns_Table *)__pyx_v_self));
4338 __Pyx_RefNannyFinishContext();
4342 static PyObject *__pyx_pf_4amns_5Table_6source___get__(
struct __pyx_obj_4amns_Table *__pyx_v_self) {
4344 PyObject *__pyx_r = NULL;
4345 __Pyx_RefNannyDeclarations
4346 PyObject *__pyx_t_1 = NULL;
4347 __Pyx_RefNannySetupContext(
"__get__", 0);
4356 __pyx_v_answer = ((
struct __pyx_vtabstruct_4amns_Table *)__pyx_v_self->__pyx_vtab)->lquery(__pyx_v_self, __pyx_n_s_source);
4365 __Pyx_XDECREF(__pyx_r);
4366 __pyx_t_1 = __Pyx_PyBytes_FromString(__pyx_v_answer.
string);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 172, __pyx_L1_error)
4367 __Pyx_GOTREF(__pyx_t_1);
4368 __pyx_r = __pyx_t_1;
4382 __Pyx_XDECREF(__pyx_t_1);
4383 __Pyx_AddTraceback("amns.Table.source.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
4386 __Pyx_XGIVEREF(__pyx_r);
4387 __Pyx_RefNannyFinishContext();
4400 static PyObject *__pyx_pw_4amns_5Table_6filled_1__get__(PyObject *__pyx_v_self);
4401 static PyObject *__pyx_pw_4amns_5Table_6filled_1__get__(PyObject *__pyx_v_self) {
4402 PyObject *__pyx_r = 0;
4403 __Pyx_RefNannyDeclarations
4404 __Pyx_RefNannySetupContext(
"__get__ (wrapper)", 0);
4405 __pyx_r = __pyx_pf_4amns_5Table_6filled___get__(((
struct __pyx_obj_4amns_Table *)__pyx_v_self));
4408 __Pyx_RefNannyFinishContext();
4412 static PyObject *__pyx_pf_4amns_5Table_6filled___get__(
struct __pyx_obj_4amns_Table *__pyx_v_self) {
4414 PyObject *__pyx_r = NULL;
4415 __Pyx_RefNannyDeclarations
4416 PyObject *__pyx_t_1 = NULL;
4417 __Pyx_RefNannySetupContext(
"__get__", 0);
4426 __pyx_v_answer = ((
struct __pyx_vtabstruct_4amns_Table *)__pyx_v_self->__pyx_vtab)->lquery(__pyx_v_self, __pyx_n_s_filled);
4435 __Pyx_XDECREF(__pyx_r);
4436 __pyx_t_1 = __Pyx_PyBytes_FromString(__pyx_v_answer.
string);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 179, __pyx_L1_error)
4437 __Pyx_GOTREF(__pyx_t_1);
4438 __pyx_r = __pyx_t_1;
4452 __Pyx_XDECREF(__pyx_t_1);
4453 __Pyx_AddTraceback("amns.Table.filled.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
4456 __Pyx_XGIVEREF(__pyx_r);
4457 __Pyx_RefNannyFinishContext();
4470 static PyObject *__pyx_pw_4amns_5Table_13reaction_type_1__get__(PyObject *__pyx_v_self);
4471 static PyObject *__pyx_pw_4amns_5Table_13reaction_type_1__get__(PyObject *__pyx_v_self) {
4472 PyObject *__pyx_r = 0;
4473 __Pyx_RefNannyDeclarations
4474 __Pyx_RefNannySetupContext(
"__get__ (wrapper)", 0);
4475 __pyx_r = __pyx_pf_4amns_5Table_13reaction_type___get__(((
struct __pyx_obj_4amns_Table *)__pyx_v_self));
4478 __Pyx_RefNannyFinishContext();
4482 static PyObject *__pyx_pf_4amns_5Table_13reaction_type___get__(
struct __pyx_obj_4amns_Table *__pyx_v_self) {
4484 PyObject *__pyx_r = NULL;
4485 __Pyx_RefNannyDeclarations
4486 PyObject *__pyx_t_1 = NULL;
4487 __Pyx_RefNannySetupContext(
"__get__", 0);
4496 __pyx_v_answer = ((
struct __pyx_vtabstruct_4amns_Table *)__pyx_v_self->__pyx_vtab)->lquery(__pyx_v_self, __pyx_n_s_reaction_type);
4505 __Pyx_XDECREF(__pyx_r);
4506 __pyx_t_1 = __Pyx_PyBytes_FromString(__pyx_v_answer.
string);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 186, __pyx_L1_error)
4507 __Pyx_GOTREF(__pyx_t_1);
4508 __pyx_r = __pyx_t_1;
4522 __Pyx_XDECREF(__pyx_t_1);
4523 __Pyx_AddTraceback("amns.Table.reaction_type.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
4526 __Pyx_XGIVEREF(__pyx_r);
4527 __Pyx_RefNannyFinishContext();
4540 static PyObject *__pyx_pw_4amns_5Table_9reactants_1__get__(PyObject *__pyx_v_self);
4541 static PyObject *__pyx_pw_4amns_5Table_9reactants_1__get__(PyObject *__pyx_v_self) {
4542 PyObject *__pyx_r = 0;
4543 __Pyx_RefNannyDeclarations
4544 __Pyx_RefNannySetupContext(
"__get__ (wrapper)", 0);
4545 __pyx_r = __pyx_pf_4amns_5Table_9reactants___get__(((
struct __pyx_obj_4amns_Table *)__pyx_v_self));
4548 __Pyx_RefNannyFinishContext();
4552 static PyObject *__pyx_pf_4amns_5Table_9reactants___get__(
struct __pyx_obj_4amns_Table *__pyx_v_self) {
4554 PyObject *__pyx_r = NULL;
4555 __Pyx_RefNannyDeclarations
4556 PyObject *__pyx_t_1 = NULL;
4557 __Pyx_RefNannySetupContext(
"__get__", 0);
4566 __pyx_v_answer = ((
struct __pyx_vtabstruct_4amns_Table *)__pyx_v_self->__pyx_vtab)->lquery(__pyx_v_self, __pyx_n_s_reactants);
4575 __Pyx_XDECREF(__pyx_r);
4576 __pyx_t_1 = __Pyx_PyBytes_FromString(__pyx_v_answer.
string);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 193, __pyx_L1_error)
4577 __Pyx_GOTREF(__pyx_t_1);
4578 __pyx_r = __pyx_t_1;
4592 __Pyx_XDECREF(__pyx_t_1);
4593 __Pyx_AddTraceback("amns.Table.reactants.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
4596 __Pyx_XGIVEREF(__pyx_r);
4597 __Pyx_RefNannyFinishContext();
4610 static PyObject *__pyx_pw_4amns_5Table_7version_1__get__(PyObject *__pyx_v_self);
4611 static PyObject *__pyx_pw_4amns_5Table_7version_1__get__(PyObject *__pyx_v_self) {
4612 PyObject *__pyx_r = 0;
4613 __Pyx_RefNannyDeclarations
4614 __Pyx_RefNannySetupContext(
"__get__ (wrapper)", 0);
4615 __pyx_r = __pyx_pf_4amns_5Table_7version___get__(((
struct __pyx_obj_4amns_Table *)__pyx_v_self));
4618 __Pyx_RefNannyFinishContext();
4622 static PyObject *__pyx_pf_4amns_5Table_7version___get__(
struct __pyx_obj_4amns_Table *__pyx_v_self) {
4624 PyObject *__pyx_r = NULL;
4625 __Pyx_RefNannyDeclarations
4626 PyObject *__pyx_t_1 = NULL;
4627 PyObject *__pyx_t_2 = NULL;
4628 PyObject *__pyx_t_3 = NULL;
4629 __Pyx_RefNannySetupContext(
"__get__", 0);
4638 __pyx_v_answer = ((
struct __pyx_vtabstruct_4amns_Table *)__pyx_v_self->__pyx_vtab)->lquery(__pyx_v_self, __pyx_n_s_version);
4647 __Pyx_XDECREF(__pyx_r);
4648 __pyx_t_1 = __Pyx_PyBytes_FromString(__pyx_v_answer.
string);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 200, __pyx_L1_error)
4649 __Pyx_GOTREF(__pyx_t_1);
4650 __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_answer.number); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 200, __pyx_L1_error)
4651 __Pyx_GOTREF(__pyx_t_2);
4652 __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 200, __pyx_L1_error)
4653 __Pyx_GOTREF(__pyx_t_3);
4654 __Pyx_GIVEREF(__pyx_t_1);
4655 PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1);
4656 __Pyx_GIVEREF(__pyx_t_2);
4657 PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_2);
4660 __pyx_r = __pyx_t_3;
4674 __Pyx_XDECREF(__pyx_t_1);
4675 __Pyx_XDECREF(__pyx_t_2);
4676 __Pyx_XDECREF(__pyx_t_3);
4677 __Pyx_AddTraceback("amns.Table.
version.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
4680 __Pyx_XGIVEREF(__pyx_r);
4681 __Pyx_RefNannyFinishContext();
4694 static PyObject *__pyx_pw_4amns_5Table_11state_label_1__get__(PyObject *__pyx_v_self);
4695 static PyObject *__pyx_pw_4amns_5Table_11state_label_1__get__(PyObject *__pyx_v_self) {
4696 PyObject *__pyx_r = 0;
4697 __Pyx_RefNannyDeclarations
4698 __Pyx_RefNannySetupContext(
"__get__ (wrapper)", 0);
4699 __pyx_r = __pyx_pf_4amns_5Table_11state_label___get__(((
struct __pyx_obj_4amns_Table *)__pyx_v_self));
4702 __Pyx_RefNannyFinishContext();
4706 static PyObject *__pyx_pf_4amns_5Table_11state_label___get__(
struct __pyx_obj_4amns_Table *__pyx_v_self) {
4708 PyObject *__pyx_r = NULL;
4709 __Pyx_RefNannyDeclarations
4710 PyObject *__pyx_t_1 = NULL;
4711 __Pyx_RefNannySetupContext(
"__get__", 0);
4720 __pyx_v_answer = ((
struct __pyx_vtabstruct_4amns_Table *)__pyx_v_self->__pyx_vtab)->lquery(__pyx_v_self, __pyx_n_s_state_label);
4729 __Pyx_XDECREF(__pyx_r);
4730 __pyx_t_1 = __Pyx_PyBytes_FromString(__pyx_v_answer.
string);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 207, __pyx_L1_error)
4731 __Pyx_GOTREF(__pyx_t_1);
4732 __pyx_r = __pyx_t_1;
4746 __Pyx_XDECREF(__pyx_t_1);
4747 __Pyx_AddTraceback("amns.Table.state_label.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
4750 __Pyx_XGIVEREF(__pyx_r);
4751 __Pyx_RefNannyFinishContext();
4764 static PyObject *__pyx_pw_4amns_5Table_11result_unit_1__get__(PyObject *__pyx_v_self);
4765 static PyObject *__pyx_pw_4amns_5Table_11result_unit_1__get__(PyObject *__pyx_v_self) {
4766 PyObject *__pyx_r = 0;
4767 __Pyx_RefNannyDeclarations
4768 __Pyx_RefNannySetupContext(
"__get__ (wrapper)", 0);
4769 __pyx_r = __pyx_pf_4amns_5Table_11result_unit___get__(((
struct __pyx_obj_4amns_Table *)__pyx_v_self));
4772 __Pyx_RefNannyFinishContext();
4776 static PyObject *__pyx_pf_4amns_5Table_11result_unit___get__(
struct __pyx_obj_4amns_Table *__pyx_v_self) {
4778 PyObject *__pyx_r = NULL;
4779 __Pyx_RefNannyDeclarations
4780 PyObject *__pyx_t_1 = NULL;
4781 __Pyx_RefNannySetupContext(
"__get__", 0);
4790 __pyx_v_answer = ((
struct __pyx_vtabstruct_4amns_Table *)__pyx_v_self->__pyx_vtab)->lquery(__pyx_v_self, __pyx_n_s_result_unit);
4799 __Pyx_XDECREF(__pyx_r);
4800 __pyx_t_1 = __Pyx_PyBytes_FromString(__pyx_v_answer.
string);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 214, __pyx_L1_error)
4801 __Pyx_GOTREF(__pyx_t_1);
4802 __pyx_r = __pyx_t_1;
4816 __Pyx_XDECREF(__pyx_t_1);
4817 __Pyx_AddTraceback("amns.Table.result_unit.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
4820 __Pyx_XGIVEREF(__pyx_r);
4821 __Pyx_RefNannyFinishContext();
4834 static PyObject *__pyx_pw_4amns_5Table_12result_label_1__get__(PyObject *__pyx_v_self);
4835 static PyObject *__pyx_pw_4amns_5Table_12result_label_1__get__(PyObject *__pyx_v_self) {
4836 PyObject *__pyx_r = 0;
4837 __Pyx_RefNannyDeclarations
4838 __Pyx_RefNannySetupContext(
"__get__ (wrapper)", 0);
4839 __pyx_r = __pyx_pf_4amns_5Table_12result_label___get__(((
struct __pyx_obj_4amns_Table *)__pyx_v_self));
4842 __Pyx_RefNannyFinishContext();
4846 static PyObject *__pyx_pf_4amns_5Table_12result_label___get__(
struct __pyx_obj_4amns_Table *__pyx_v_self) {
4848 PyObject *__pyx_r = NULL;
4849 __Pyx_RefNannyDeclarations
4850 PyObject *__pyx_t_1 = NULL;
4851 __Pyx_RefNannySetupContext(
"__get__", 0);
4860 __pyx_v_answer = ((
struct __pyx_vtabstruct_4amns_Table *)__pyx_v_self->__pyx_vtab)->lquery(__pyx_v_self, __pyx_n_s_result_label);
4869 __Pyx_XDECREF(__pyx_r);
4870 __pyx_t_1 = __Pyx_PyBytes_FromString(__pyx_v_answer.
string);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 221, __pyx_L1_error)
4871 __Pyx_GOTREF(__pyx_t_1);
4872 __pyx_r = __pyx_t_1;
4886 __Pyx_XDECREF(__pyx_t_1);
4887 __Pyx_AddTraceback("amns.Table.result_label.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
4890 __Pyx_XGIVEREF(__pyx_r);
4891 __Pyx_RefNannyFinishContext();
4904 static PyObject *__pyx_pw_4amns_5Table_10interp_fun_1__get__(PyObject *__pyx_v_self);
4905 static PyObject *__pyx_pw_4amns_5Table_10interp_fun_1__get__(PyObject *__pyx_v_self) {
4906 PyObject *__pyx_r = 0;
4907 __Pyx_RefNannyDeclarations
4908 __Pyx_RefNannySetupContext(
"__get__ (wrapper)", 0);
4909 __pyx_r = __pyx_pf_4amns_5Table_10interp_fun___get__(((
struct __pyx_obj_4amns_Table *)__pyx_v_self));
4912 __Pyx_RefNannyFinishContext();
4916 static PyObject *__pyx_pf_4amns_5Table_10interp_fun___get__(
struct __pyx_obj_4amns_Table *__pyx_v_self) {
4918 PyObject *__pyx_r = NULL;
4919 __Pyx_RefNannyDeclarations
4920 PyObject *__pyx_t_1 = NULL;
4921 __Pyx_RefNannySetupContext(
"__get__", 0);
4930 __pyx_v_answer = ((
struct __pyx_vtabstruct_4amns_Table *)__pyx_v_self->__pyx_vtab)->lquery(__pyx_v_self, __pyx_n_s_interp_fun);
4939 __Pyx_XDECREF(__pyx_r);
4940 __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_answer.
number);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 228, __pyx_L1_error)
4941 __Pyx_GOTREF(__pyx_t_1);
4942 __pyx_r = __pyx_t_1;
4956 __Pyx_XDECREF(__pyx_t_1);
4957 __Pyx_AddTraceback("amns.Table.interp_fun.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
4960 __Pyx_XGIVEREF(__pyx_r);
4961 __Pyx_RefNannyFinishContext();
4974 static PyObject *__pyx_pw_4amns_5Table_9data(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
4975 static
char __pyx_doc_4amns_5Table_8data[] = "Return the AMNS data based on the arguments";
4976 static PyObject *__pyx_pw_4amns_5Table_9data(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
4977 PyObject *__pyx_v_p1 = 0;
4978 PyObject *__pyx_v_p2 = 0;
4979 PyObject *__pyx_v_p3 = 0;
4980 PyObject *__pyx_r = 0;
4981 __Pyx_RefNannyDeclarations
4982 __Pyx_RefNannySetupContext(
"data (wrapper)", 0);
4984 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_p1,&__pyx_n_s_p2,&__pyx_n_s_p3,0};
4985 PyObject* values[3] = {0,0,0};
4986 values[1] = ((PyObject *)Py_None);
4987 values[2] = ((PyObject *)Py_None);
4988 if (unlikely(__pyx_kwds)) {
4990 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
4992 case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
4993 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
4994 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
4996 default:
goto __pyx_L5_argtuple_error;
4998 kw_args = PyDict_Size(__pyx_kwds);
5001 if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_p1)) != 0)) kw_args--;
5002 else goto __pyx_L5_argtuple_error;
5005 PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_p2);
5006 if (value) { values[1] = value; kw_args--; }
5010 PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_p3);
5011 if (value) { values[2] = value; kw_args--; }
5014 if (unlikely(kw_args > 0)) {
5015 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args,
"data") < 0)) __PYX_ERR(0, 230, __pyx_L3_error)
5018 switch (PyTuple_GET_SIZE(__pyx_args)) {
5019 case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
5020 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
5021 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
5023 default:
goto __pyx_L5_argtuple_error;
5026 __pyx_v_p1 = values[0];
5027 __pyx_v_p2 = values[1];
5028 __pyx_v_p3 = values[2];
5030 goto __pyx_L4_argument_unpacking_done;
5031 __pyx_L5_argtuple_error:;
5032 __Pyx_RaiseArgtupleInvalid(
"data", 0, 1, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 230, __pyx_L3_error)
5034 __Pyx_AddTraceback("amns.Table.data", __pyx_clineno, __pyx_lineno, __pyx_filename);
5035 __Pyx_RefNannyFinishContext();
5037 __pyx_L4_argument_unpacking_done:;
5038 __pyx_r = __pyx_pf_4amns_5Table_8data(((struct __pyx_obj_4amns_Table *)__pyx_v_self), __pyx_v_p1, __pyx_v_p2, __pyx_v_p3);
5041 __Pyx_RefNannyFinishContext();
5045 static PyObject *__pyx_pf_4amns_5Table_8data(struct __pyx_obj_4amns_Table *__pyx_v_self, PyObject *__pyx_v_p1, PyObject *__pyx_v_p2, PyObject *__pyx_v_p3) {
5046 PyObject *__pyx_v_nargs = NULL;
5047 PyObject *__pyx_v_refShape = NULL;
5048 PyObject *__pyx_v_res = NULL;
5049 PyObject *__pyx_r = NULL;
5050 __Pyx_RefNannyDeclarations
5053 PyObject *__pyx_t_3 = NULL;
5054 PyObject *__pyx_t_4 = NULL;
5055 PyObject *__pyx_t_5 = NULL;
5056 PyObject *__pyx_t_6 = NULL;
5057 PyObject *__pyx_t_7 = NULL;
5059 Py_ssize_t __pyx_t_9;
5061 __Pyx_RefNannySetupContext(
"data", 0);
5070 __Pyx_INCREF(__pyx_int_1);
5071 __pyx_v_nargs = __pyx_int_1;
5080 __pyx_t_1 = (__pyx_v_p2 != Py_None);
5081 __pyx_t_2 = (__pyx_t_1 != 0);
5083 __pyx_t_3 = __Pyx_PyInt_AddObjC(__pyx_v_nargs, __pyx_int_1, 1, 1);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 233, __pyx_L1_error)
5084 __Pyx_GOTREF(__pyx_t_3);
5085 __Pyx_DECREF_SET(__pyx_v_nargs, __pyx_t_3);
5096 __pyx_t_2 = (__pyx_v_p3 != Py_None);
5097 __pyx_t_1 = (__pyx_t_2 != 0);
5099 __pyx_t_3 = __Pyx_PyInt_AddObjC(__pyx_v_nargs, __pyx_int_1, 1, 1);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 234, __pyx_L1_error)
5100 __Pyx_GOTREF(__pyx_t_3);
5101 __Pyx_DECREF_SET(__pyx_v_nargs, __pyx_t_3);
5112 __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_ndim); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 235, __pyx_L1_error)
5113 __Pyx_GOTREF(__pyx_t_3);
5114 __pyx_t_4 = PyObject_RichCompare(__pyx_v_nargs, __pyx_t_3, Py_NE); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 235, __pyx_L1_error)
5115 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
5116 __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 235, __pyx_L1_error)
5117 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
5127 __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_AmnsException);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 236, __pyx_L1_error)
5128 __Pyx_GOTREF(__pyx_t_3);
5137 __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_ndim); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 237, __pyx_L1_error)
5138 __Pyx_GOTREF(__pyx_t_5);
5139 __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 237, __pyx_L1_error)
5140 __Pyx_GOTREF(__pyx_t_6);
5141 __Pyx_GIVEREF(__pyx_t_5);
5142 PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_5);
5144 __pyx_t_5 = __Pyx_PyObject_Call(((PyObject *)(&PyString_Type)), __pyx_t_6, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 237, __pyx_L1_error)
5145 __Pyx_GOTREF(__pyx_t_5);
5146 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
5147 __pyx_t_6 = PyNumber_Add(__pyx_kp_s_Number_of_parameters_does_not_ma, __pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 237, __pyx_L1_error)
5148 __Pyx_GOTREF(__pyx_t_6);
5149 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
5150 __pyx_t_5 = PyNumber_Add(__pyx_t_6, __pyx_kp_s__2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 237, __pyx_L1_error)
5151 __Pyx_GOTREF(__pyx_t_5);
5152 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
5154 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
5155 __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_3);
5156 if (likely(__pyx_t_6)) {
5157 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_3);
5158 __Pyx_INCREF(__pyx_t_6);
5159 __Pyx_INCREF(
function);
5160 __Pyx_DECREF_SET(__pyx_t_3,
function);
5164 __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_5);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 236, __pyx_L1_error)
5165 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
5166 __Pyx_GOTREF(__pyx_t_4);
5168 #if CYTHON_FAST_PYCALL
5169 if (PyFunction_Check(__pyx_t_3)) {
5170 PyObject *__pyx_temp[2] = {__pyx_t_6, __pyx_t_5};
5171 __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 236, __pyx_L1_error)
5172 __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
5173 __Pyx_GOTREF(__pyx_t_4);
5174 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
5177 #if CYTHON_FAST_PYCCALL
5178 if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
5179 PyObject *__pyx_temp[2] = {__pyx_t_6, __pyx_t_5};
5180 __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 236, __pyx_L1_error)
5181 __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
5182 __Pyx_GOTREF(__pyx_t_4);
5183 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
5187 __pyx_t_7 = PyTuple_New(1+1);
if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 236, __pyx_L1_error)
5188 __Pyx_GOTREF(__pyx_t_7);
5189 __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_6); __pyx_t_6 = NULL;
5190 __Pyx_GIVEREF(__pyx_t_5);
5191 PyTuple_SET_ITEM(__pyx_t_7, 0+1, __pyx_t_5);
5193 __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_7, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 236, __pyx_L1_error)
5194 __Pyx_GOTREF(__pyx_t_4);
5195 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
5198 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
5199 __Pyx_Raise(__pyx_t_4, 0, 0, 0);
5200 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
5201 __PYX_ERR(0, 236, __pyx_L1_error)
5219 __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_p1, __pyx_n_s_shape); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 239, __pyx_L1_error)
5220 __Pyx_GOTREF(__pyx_t_4);
5221 __pyx_v_refShape = __pyx_t_4;
5231 __pyx_t_2 = (__pyx_v_p2 != Py_None);
5232 __pyx_t_8 = (__pyx_t_2 != 0);
5235 __pyx_t_1 = __pyx_t_8;
5236 goto __pyx_L7_bool_binop_done;
5238 __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_p2, __pyx_n_s_shape);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 240, __pyx_L1_error)
5239 __Pyx_GOTREF(__pyx_t_4);
5240 __pyx_t_3 = PyObject_RichCompare(__pyx_t_4, __pyx_v_refShape, Py_NE); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 240, __pyx_L1_error)
5241 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
5242 __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_8 < 0)) __PYX_ERR(0, 240, __pyx_L1_error)
5243 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
5244 __pyx_t_1 = __pyx_t_8;
5245 __pyx_L7_bool_binop_done:;
5255 __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_AmnsException);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 241, __pyx_L1_error)
5256 __Pyx_GOTREF(__pyx_t_3);
5257 __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_tuple__3, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 241, __pyx_L1_error)
5258 __Pyx_GOTREF(__pyx_t_4);
5259 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
5260 __Pyx_Raise(__pyx_t_4, 0, 0, 0);
5261 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
5262 __PYX_ERR(0, 241, __pyx_L1_error)
5280 __pyx_t_8 = (__pyx_v_p3 != Py_None);
5281 __pyx_t_2 = (__pyx_t_8 != 0);
5284 __pyx_t_1 = __pyx_t_2;
5285 goto __pyx_L10_bool_binop_done;
5287 __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_p3, __pyx_n_s_shape);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 242, __pyx_L1_error)
5288 __Pyx_GOTREF(__pyx_t_4);
5289 __pyx_t_3 = PyObject_RichCompare(__pyx_t_4, __pyx_v_refShape, Py_NE); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 242, __pyx_L1_error)
5290 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
5291 __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 242, __pyx_L1_error)
5292 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
5293 __pyx_t_1 = __pyx_t_2;
5294 __pyx_L10_bool_binop_done:;
5304 __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_AmnsException);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 243, __pyx_L1_error)
5305 __Pyx_GOTREF(__pyx_t_3);
5306 __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_tuple__4, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 243, __pyx_L1_error)
5307 __Pyx_GOTREF(__pyx_t_4);
5308 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
5309 __Pyx_Raise(__pyx_t_4, 0, 0, 0);
5310 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
5311 __PYX_ERR(0, 243, __pyx_L1_error)
5329 __pyx_t_9 = PyObject_Length(__pyx_v_refShape); if (unlikely(__pyx_t_9 == -1)) __PYX_ERR(0, 245, __pyx_L1_error)
5330 __pyx_t_1 = ((__pyx_t_9 == 1) != 0);
5340 __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_data_1d);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 246, __pyx_L1_error)
5341 __Pyx_GOTREF(__pyx_t_3);
5344 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
5345 __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_3);
5346 if (likely(__pyx_t_7)) {
5347 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_3);
5348 __Pyx_INCREF(__pyx_t_7);
5349 __Pyx_INCREF(
function);
5350 __Pyx_DECREF_SET(__pyx_t_3,
function);
5354 #if CYTHON_FAST_PYCALL
5355 if (PyFunction_Check(__pyx_t_3)) {
5356 PyObject *__pyx_temp[4] = {__pyx_t_7, __pyx_v_p1, __pyx_v_p2, __pyx_v_p3};
5357 __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_10, 3+__pyx_t_10);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 246, __pyx_L1_error)
5358 __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
5359 __Pyx_GOTREF(__pyx_t_4);
5362 #if CYTHON_FAST_PYCCALL
5363 if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
5364 PyObject *__pyx_temp[4] = {__pyx_t_7, __pyx_v_p1, __pyx_v_p2, __pyx_v_p3};
5365 __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_10, 3+__pyx_t_10);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 246, __pyx_L1_error)
5366 __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
5367 __Pyx_GOTREF(__pyx_t_4);
5371 __pyx_t_5 = PyTuple_New(3+__pyx_t_10);
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 246, __pyx_L1_error)
5372 __Pyx_GOTREF(__pyx_t_5);
5374 __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_7); __pyx_t_7 = NULL;
5376 __Pyx_INCREF(__pyx_v_p1);
5377 __Pyx_GIVEREF(__pyx_v_p1);
5378 PyTuple_SET_ITEM(__pyx_t_5, 0+__pyx_t_10, __pyx_v_p1);
5379 __Pyx_INCREF(__pyx_v_p2);
5380 __Pyx_GIVEREF(__pyx_v_p2);
5381 PyTuple_SET_ITEM(__pyx_t_5, 1+__pyx_t_10, __pyx_v_p2);
5382 __Pyx_INCREF(__pyx_v_p3);
5383 __Pyx_GIVEREF(__pyx_v_p3);
5384 PyTuple_SET_ITEM(__pyx_t_5, 2+__pyx_t_10, __pyx_v_p3);
5385 __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_5, NULL);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 246, __pyx_L1_error)
5386 __Pyx_GOTREF(__pyx_t_4);
5387 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
5389 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
5390 __pyx_v_res = __pyx_t_4;
5410 __pyx_t_9 = PyObject_Length(__pyx_v_refShape); if (unlikely(__pyx_t_9 == -1)) __PYX_ERR(0, 247, __pyx_L1_error)
5411 __pyx_t_1 = ((__pyx_t_9 == 2) != 0);
5421 __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_data_2d);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 248, __pyx_L1_error)
5422 __Pyx_GOTREF(__pyx_t_3);
5425 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
5426 __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_3);
5427 if (likely(__pyx_t_5)) {
5428 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_3);
5429 __Pyx_INCREF(__pyx_t_5);
5430 __Pyx_INCREF(
function);
5431 __Pyx_DECREF_SET(__pyx_t_3,
function);
5435 #if CYTHON_FAST_PYCALL
5436 if (PyFunction_Check(__pyx_t_3)) {
5437 PyObject *__pyx_temp[4] = {__pyx_t_5, __pyx_v_p1, __pyx_v_p2, __pyx_v_p3};
5438 __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_10, 3+__pyx_t_10);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 248, __pyx_L1_error)
5439 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
5440 __Pyx_GOTREF(__pyx_t_4);
5443 #if CYTHON_FAST_PYCCALL
5444 if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
5445 PyObject *__pyx_temp[4] = {__pyx_t_5, __pyx_v_p1, __pyx_v_p2, __pyx_v_p3};
5446 __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_10, 3+__pyx_t_10);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 248, __pyx_L1_error)
5447 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
5448 __Pyx_GOTREF(__pyx_t_4);
5452 __pyx_t_7 = PyTuple_New(3+__pyx_t_10);
if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 248, __pyx_L1_error)
5453 __Pyx_GOTREF(__pyx_t_7);
5455 __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_5); __pyx_t_5 = NULL;
5457 __Pyx_INCREF(__pyx_v_p1);
5458 __Pyx_GIVEREF(__pyx_v_p1);
5459 PyTuple_SET_ITEM(__pyx_t_7, 0+__pyx_t_10, __pyx_v_p1);
5460 __Pyx_INCREF(__pyx_v_p2);
5461 __Pyx_GIVEREF(__pyx_v_p2);
5462 PyTuple_SET_ITEM(__pyx_t_7, 1+__pyx_t_10, __pyx_v_p2);
5463 __Pyx_INCREF(__pyx_v_p3);
5464 __Pyx_GIVEREF(__pyx_v_p3);
5465 PyTuple_SET_ITEM(__pyx_t_7, 2+__pyx_t_10, __pyx_v_p3);
5466 __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_7, NULL);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 248, __pyx_L1_error)
5467 __Pyx_GOTREF(__pyx_t_4);
5468 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
5470 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
5471 __pyx_v_res = __pyx_t_4;
5491 __pyx_t_9 = PyObject_Length(__pyx_v_refShape); if (unlikely(__pyx_t_9 == -1)) __PYX_ERR(0, 249, __pyx_L1_error)
5492 __pyx_t_1 = ((__pyx_t_9 == 3) != 0);
5502 __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_data_3d);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 250, __pyx_L1_error)
5503 __Pyx_GOTREF(__pyx_t_3);
5506 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
5507 __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_3);
5508 if (likely(__pyx_t_7)) {
5509 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_3);
5510 __Pyx_INCREF(__pyx_t_7);
5511 __Pyx_INCREF(
function);
5512 __Pyx_DECREF_SET(__pyx_t_3,
function);
5516 #if CYTHON_FAST_PYCALL
5517 if (PyFunction_Check(__pyx_t_3)) {
5518 PyObject *__pyx_temp[4] = {__pyx_t_7, __pyx_v_p1, __pyx_v_p2, __pyx_v_p3};
5519 __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_10, 3+__pyx_t_10);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 250, __pyx_L1_error)
5520 __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
5521 __Pyx_GOTREF(__pyx_t_4);
5524 #if CYTHON_FAST_PYCCALL
5525 if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
5526 PyObject *__pyx_temp[4] = {__pyx_t_7, __pyx_v_p1, __pyx_v_p2, __pyx_v_p3};
5527 __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_10, 3+__pyx_t_10);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 250, __pyx_L1_error)
5528 __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
5529 __Pyx_GOTREF(__pyx_t_4);
5533 __pyx_t_5 = PyTuple_New(3+__pyx_t_10);
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 250, __pyx_L1_error)
5534 __Pyx_GOTREF(__pyx_t_5);
5536 __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_7); __pyx_t_7 = NULL;
5538 __Pyx_INCREF(__pyx_v_p1);
5539 __Pyx_GIVEREF(__pyx_v_p1);
5540 PyTuple_SET_ITEM(__pyx_t_5, 0+__pyx_t_10, __pyx_v_p1);
5541 __Pyx_INCREF(__pyx_v_p2);
5542 __Pyx_GIVEREF(__pyx_v_p2);
5543 PyTuple_SET_ITEM(__pyx_t_5, 1+__pyx_t_10, __pyx_v_p2);
5544 __Pyx_INCREF(__pyx_v_p3);
5545 __Pyx_GIVEREF(__pyx_v_p3);
5546 PyTuple_SET_ITEM(__pyx_t_5, 2+__pyx_t_10, __pyx_v_p3);
5547 __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_5, NULL);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 250, __pyx_L1_error)
5548 __Pyx_GOTREF(__pyx_t_4);
5549 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
5551 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
5552 __pyx_v_res = __pyx_t_4;
5573 __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_AmnsException);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 252, __pyx_L1_error)
5574 __Pyx_GOTREF(__pyx_t_3);
5575 __pyx_t_9 = PyObject_Length(__pyx_v_refShape); if (unlikely(__pyx_t_9 == -1)) __PYX_ERR(0, 252, __pyx_L1_error)
5576 __pyx_t_5 = PyInt_FromSsize_t(__pyx_t_9); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 252, __pyx_L1_error)
5577 __Pyx_GOTREF(__pyx_t_5);
5578 __pyx_t_7 = PyTuple_New(1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 252, __pyx_L1_error)
5579 __Pyx_GOTREF(__pyx_t_7);
5580 __Pyx_GIVEREF(__pyx_t_5);
5581 PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_5);
5583 __pyx_t_5 = __Pyx_PyString_Format(__pyx_kp_s_Unsupported_rank_of_input_argume, __pyx_t_7); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 252, __pyx_L1_error)
5584 __Pyx_GOTREF(__pyx_t_5);
5585 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
5587 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
5588 __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_3);
5589 if (likely(__pyx_t_7)) {
5590 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_3);
5591 __Pyx_INCREF(__pyx_t_7);
5592 __Pyx_INCREF(
function);
5593 __Pyx_DECREF_SET(__pyx_t_3,
function);
5597 __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_5);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 252, __pyx_L1_error)
5598 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
5599 __Pyx_GOTREF(__pyx_t_4);
5601 #if CYTHON_FAST_PYCALL
5602 if (PyFunction_Check(__pyx_t_3)) {
5603 PyObject *__pyx_temp[2] = {__pyx_t_7, __pyx_t_5};
5604 __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 252, __pyx_L1_error)
5605 __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
5606 __Pyx_GOTREF(__pyx_t_4);
5607 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
5610 #if CYTHON_FAST_PYCCALL
5611 if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
5612 PyObject *__pyx_temp[2] = {__pyx_t_7, __pyx_t_5};
5613 __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 252, __pyx_L1_error)
5614 __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
5615 __Pyx_GOTREF(__pyx_t_4);
5616 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
5620 __pyx_t_6 = PyTuple_New(1+1);
if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 252, __pyx_L1_error)
5621 __Pyx_GOTREF(__pyx_t_6);
5622 __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_7); __pyx_t_7 = NULL;
5623 __Pyx_GIVEREF(__pyx_t_5);
5624 PyTuple_SET_ITEM(__pyx_t_6, 0+1, __pyx_t_5);
5626 __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_6, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 252, __pyx_L1_error)
5627 __Pyx_GOTREF(__pyx_t_4);
5628 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
5631 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
5632 __Pyx_Raise(__pyx_t_4, 0, 0, 0);
5633 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
5634 __PYX_ERR(0, 252, __pyx_L1_error)
5645 __Pyx_XDECREF(__pyx_r);
5646 __Pyx_INCREF(__pyx_v_res);
5647 __pyx_r = __pyx_v_res;
5660 __Pyx_XDECREF(__pyx_t_3);
5661 __Pyx_XDECREF(__pyx_t_4);
5662 __Pyx_XDECREF(__pyx_t_5);
5663 __Pyx_XDECREF(__pyx_t_6);
5664 __Pyx_XDECREF(__pyx_t_7);
5665 __Pyx_AddTraceback("amns.Table.data", __pyx_clineno, __pyx_lineno, __pyx_filename);
5668 __Pyx_XDECREF(__pyx_v_nargs);
5669 __Pyx_XDECREF(__pyx_v_refShape);
5670 __Pyx_XDECREF(__pyx_v_res);
5671 __Pyx_XGIVEREF(__pyx_r);
5672 __Pyx_RefNannyFinishContext();
5685 static PyObject *__pyx_pw_4amns_5Table_11_data_1d(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
5686 static PyObject *__pyx_pw_4amns_5Table_11_data_1d(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
5687 PyArrayObject *__pyx_v_p1 = 0;
5688 PyArrayObject *__pyx_v_p2 = 0;
5689 PyArrayObject *__pyx_v_p3 = 0;
5690 PyObject *__pyx_r = 0;
5691 __Pyx_RefNannyDeclarations
5692 __Pyx_RefNannySetupContext(
"_data_1d (wrapper)", 0);
5694 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_p1,&__pyx_n_s_p2,&__pyx_n_s_p3,0};
5695 PyObject* values[3] = {0,0,0};
5704 values[1] = (PyObject *)((PyArrayObject *)Py_None);
5713 values[2] = (PyObject *)((PyArrayObject *)Py_None);
5714 if (unlikely(__pyx_kwds)) {
5716 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
5718 case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
5719 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
5720 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
5722 default:
goto __pyx_L5_argtuple_error;
5724 kw_args = PyDict_Size(__pyx_kwds);
5727 if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_p1)) != 0)) kw_args--;
5728 else goto __pyx_L5_argtuple_error;
5731 PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_p2);
5732 if (value) { values[1] = value; kw_args--; }
5736 PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_p3);
5737 if (value) { values[2] = value; kw_args--; }
5740 if (unlikely(kw_args > 0)) {
5741 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args,
"_data_1d") < 0)) __PYX_ERR(0, 256, __pyx_L3_error)
5744 switch (PyTuple_GET_SIZE(__pyx_args)) {
5745 case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
5746 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
5747 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
5749 default:
goto __pyx_L5_argtuple_error;
5752 __pyx_v_p1 = ((PyArrayObject *)values[0]);
5753 __pyx_v_p2 = ((PyArrayObject *)values[1]);
5754 __pyx_v_p3 = ((PyArrayObject *)values[2]);
5756 goto __pyx_L4_argument_unpacking_done;
5757 __pyx_L5_argtuple_error:;
5758 __Pyx_RaiseArgtupleInvalid(
"_data_1d", 0, 1, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 256, __pyx_L3_error)
5760 __Pyx_AddTraceback("amns.Table._data_1d", __pyx_clineno, __pyx_lineno, __pyx_filename);
5761 __Pyx_RefNannyFinishContext();
5763 __pyx_L4_argument_unpacking_done:;
5764 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_p1), __pyx_ptype_5numpy_ndarray, 1, "
p1", 0))) __PYX_ERR(0, 256, __pyx_L1_error)
5765 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_p2), __pyx_ptype_5numpy_ndarray, 1, "
p2", 0))) __PYX_ERR(0, 257, __pyx_L1_error)
5766 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_p3), __pyx_ptype_5numpy_ndarray, 1, "
p3", 0))) __PYX_ERR(0, 258, __pyx_L1_error)
5767 __pyx_r = __pyx_pf_4amns_5Table_10_data_1d(((struct __pyx_obj_4amns_Table *)__pyx_v_self), __pyx_v_p1, __pyx_v_p2, __pyx_v_p3);
5782 __Pyx_RefNannyFinishContext();
5786 static PyObject *__pyx_pf_4amns_5Table_10_data_1d(struct __pyx_obj_4amns_Table *__pyx_v_self, PyArrayObject *__pyx_v_p1, PyArrayObject *__pyx_v_p2, PyArrayObject *__pyx_v_p3) {
5788 PyArrayObject *__pyx_v_res = 0;
5789 PyObject *__pyx_v_nargs = NULL;
5790 __Pyx_LocalBuf_ND __pyx_pybuffernd_p1;
5791 __Pyx_Buffer __pyx_pybuffer_p1;
5792 __Pyx_LocalBuf_ND __pyx_pybuffernd_p2;
5793 __Pyx_Buffer __pyx_pybuffer_p2;
5794 __Pyx_LocalBuf_ND __pyx_pybuffernd_p3;
5795 __Pyx_Buffer __pyx_pybuffer_p3;
5796 __Pyx_LocalBuf_ND __pyx_pybuffernd_res;
5797 __Pyx_Buffer __pyx_pybuffer_res;
5798 PyObject *__pyx_r = NULL;
5799 __Pyx_RefNannyDeclarations
5802 PyObject *__pyx_t_3 = NULL;
5803 PyObject *__pyx_t_4 = NULL;
5804 PyObject *__pyx_t_5 = NULL;
5805 PyObject *__pyx_t_6 = NULL;
5806 PyArrayObject *__pyx_t_7 = NULL;
5808 PyObject *__pyx_t_9 = NULL;
5809 PyObject *__pyx_t_10 = NULL;
5810 PyObject *__pyx_t_11 = NULL;
5811 PyObject *__pyx_t_12 = NULL;
5812 __Pyx_RefNannySetupContext(
"_data_1d", 0);
5813 __pyx_pybuffer_res.pybuffer.buf = NULL;
5814 __pyx_pybuffer_res.refcount = 0;
5815 __pyx_pybuffernd_res.data = NULL;
5816 __pyx_pybuffernd_res.rcbuffer = &__pyx_pybuffer_res;
5817 __pyx_pybuffer_p1.pybuffer.buf = NULL;
5818 __pyx_pybuffer_p1.refcount = 0;
5819 __pyx_pybuffernd_p1.data = NULL;
5820 __pyx_pybuffernd_p1.rcbuffer = &__pyx_pybuffer_p1;
5821 __pyx_pybuffer_p2.pybuffer.buf = NULL;
5822 __pyx_pybuffer_p2.refcount = 0;
5823 __pyx_pybuffernd_p2.data = NULL;
5824 __pyx_pybuffernd_p2.rcbuffer = &__pyx_pybuffer_p2;
5825 __pyx_pybuffer_p3.pybuffer.buf = NULL;
5826 __pyx_pybuffer_p3.refcount = 0;
5827 __pyx_pybuffernd_p3.data = NULL;
5828 __pyx_pybuffernd_p3.rcbuffer = &__pyx_pybuffer_p3;
5830 __Pyx_BufFmt_StackElem __pyx_stack[1];
5831 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_p1.rcbuffer->pybuffer, (PyObject*)__pyx_v_p1, &__Pyx_TypeInfo_nn___pyx_t_5numpy_double_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 256, __pyx_L1_error)
5833 __pyx_pybuffernd_p1.diminfo[0].strides = __pyx_pybuffernd_p1.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_p1.diminfo[0].shape = __pyx_pybuffernd_p1.rcbuffer->pybuffer.shape[0];
5835 __Pyx_BufFmt_StackElem __pyx_stack[1];
5836 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_p2.rcbuffer->pybuffer, (PyObject*)__pyx_v_p2, &__Pyx_TypeInfo_nn___pyx_t_5numpy_double_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 256, __pyx_L1_error)
5838 __pyx_pybuffernd_p2.diminfo[0].strides = __pyx_pybuffernd_p2.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_p2.diminfo[0].shape = __pyx_pybuffernd_p2.rcbuffer->pybuffer.shape[0];
5840 __Pyx_BufFmt_StackElem __pyx_stack[1];
5841 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_p3.rcbuffer->pybuffer, (PyObject*)__pyx_v_p3, &__Pyx_TypeInfo_nn___pyx_t_5numpy_double_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 256, __pyx_L1_error)
5843 __pyx_pybuffernd_p3.diminfo[0].strides = __pyx_pybuffernd_p3.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_p3.diminfo[0].shape = __pyx_pybuffernd_p3.rcbuffer->pybuffer.shape[0];
5852 __Pyx_INCREF(__pyx_int_1);
5853 __pyx_v_nargs = __pyx_int_1;
5862 __pyx_t_1 = (((PyObject *)__pyx_v_p2) != Py_None);
5863 __pyx_t_2 = (__pyx_t_1 != 0);
5865 __pyx_t_3 = __Pyx_PyInt_AddObjC(__pyx_v_nargs, __pyx_int_1, 1, 1);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 263, __pyx_L1_error)
5866 __Pyx_GOTREF(__pyx_t_3);
5867 __Pyx_DECREF_SET(__pyx_v_nargs, __pyx_t_3);
5878 __pyx_t_2 = (((PyObject *)__pyx_v_p3) != Py_None);
5879 __pyx_t_1 = (__pyx_t_2 != 0);
5881 __pyx_t_3 = __Pyx_PyInt_AddObjC(__pyx_v_nargs, __pyx_int_1, 1, 1);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 264, __pyx_L1_error)
5882 __Pyx_GOTREF(__pyx_t_3);
5883 __Pyx_DECREF_SET(__pyx_v_nargs, __pyx_t_3);
5894 __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 266, __pyx_L1_error)
5895 __Pyx_GOTREF(__pyx_t_3);
5896 __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_empty_like); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 266, __pyx_L1_error)
5897 __Pyx_GOTREF(__pyx_t_4);
5898 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
5899 __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 266, __pyx_L1_error)
5900 __Pyx_GOTREF(__pyx_t_3);
5901 __Pyx_INCREF(((PyObject *)__pyx_v_p1));
5902 __Pyx_GIVEREF(((PyObject *)__pyx_v_p1));
5903 PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_v_p1));
5904 __pyx_t_5 = PyDict_New(); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 266, __pyx_L1_error)
5905 __Pyx_GOTREF(__pyx_t_5);
5906 if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_order, __pyx_n_s_F) < 0) __PYX_ERR(0, 266, __pyx_L1_error)
5907 __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_3, __pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 266, __pyx_L1_error)
5908 __Pyx_GOTREF(__pyx_t_6);
5909 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
5910 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
5911 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
5912 if (!(likely(((__pyx_t_6) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_6, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 266, __pyx_L1_error)
5913 __pyx_t_7 = ((PyArrayObject *)__pyx_t_6);
5915 __Pyx_BufFmt_StackElem __pyx_stack[1];
5916 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_res.rcbuffer->pybuffer);
5917 __pyx_t_8 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_res.rcbuffer->pybuffer, (PyObject*)__pyx_t_7, &__Pyx_TypeInfo_nn___pyx_t_5numpy_double_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack);
5918 if (unlikely(__pyx_t_8 < 0)) {
5919 PyErr_Fetch(&__pyx_t_9, &__pyx_t_10, &__pyx_t_11);
5920 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_res.rcbuffer->pybuffer, (PyObject*)__pyx_v_res, &__Pyx_TypeInfo_nn___pyx_t_5numpy_double_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {
5921 Py_XDECREF(__pyx_t_9); Py_XDECREF(__pyx_t_10); Py_XDECREF(__pyx_t_11);
5922 __Pyx_RaiseBufferFallbackError();
5924 PyErr_Restore(__pyx_t_9, __pyx_t_10, __pyx_t_11);
5927 __pyx_pybuffernd_res.diminfo[0].strides = __pyx_pybuffernd_res.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_res.diminfo[0].shape = __pyx_pybuffernd_res.rcbuffer->pybuffer.shape[0];
5928 if (unlikely(__pyx_t_8 < 0)) __PYX_ERR(0, 266, __pyx_L1_error)
5931 __pyx_v_res = ((PyArrayObject *)__pyx_t_6);
5941 __pyx_t_6 = __Pyx_PyInt_EqObjC(__pyx_v_nargs, __pyx_int_1, 1, 0);
if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 268, __pyx_L1_error)
5942 __Pyx_GOTREF(__pyx_t_6);
5943 __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 268, __pyx_L1_error)
5944 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
5954 ITM_AMNS_CC_RX_1_A(__pyx_v_self->_handle, (__pyx_v_p1->dimensions[0]), ((
double *)__pyx_v_res->data), ((
double *)__pyx_v_p1->data), (&__pyx_v_error_status));
5973 __pyx_t_6 = __Pyx_PyInt_EqObjC(__pyx_v_nargs, __pyx_int_2, 2, 0);
if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 272, __pyx_L1_error)
5974 __Pyx_GOTREF(__pyx_t_6);
5975 __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 272, __pyx_L1_error)
5976 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
5986 ITM_AMNS_CC_RX_1_B(__pyx_v_self->_handle, (__pyx_v_p1->dimensions[0]), ((
double *)__pyx_v_res->data), ((
double *)__pyx_v_p1->data), ((
double *)__pyx_v_p2->data), (&__pyx_v_error_status));
6005 __pyx_t_6 = __Pyx_PyInt_EqObjC(__pyx_v_nargs, __pyx_int_3, 3, 0);
if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 277, __pyx_L1_error)
6006 __Pyx_GOTREF(__pyx_t_6);
6007 __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 277, __pyx_L1_error)
6008 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
6018 ITM_AMNS_CC_RX_1_C(__pyx_v_self->_handle, (__pyx_v_p1->dimensions[0]), ((
double *)__pyx_v_res->data), ((
double *)__pyx_v_p1->data), ((
double *)__pyx_v_p2->data), ((
double *)__pyx_v_p3->data), (&__pyx_v_error_status));
6037 __pyx_t_1 = (__pyx_v_error_status.
flag != 0);
6047 __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_AmnsException);
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 285, __pyx_L1_error)
6048 __Pyx_GOTREF(__pyx_t_5);
6049 __pyx_t_3 = __Pyx_PyBytes_FromString(__pyx_v_error_status.
string); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 285, __pyx_L1_error)
6050 __Pyx_GOTREF(__pyx_t_3);
6052 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_5))) {
6053 __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_5);
6054 if (likely(__pyx_t_4)) {
6055 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_5);
6056 __Pyx_INCREF(__pyx_t_4);
6057 __Pyx_INCREF(
function);
6058 __Pyx_DECREF_SET(__pyx_t_5,
function);
6062 __pyx_t_6 = __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_3);
if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 285, __pyx_L1_error)
6063 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
6064 __Pyx_GOTREF(__pyx_t_6);
6066 #if CYTHON_FAST_PYCALL
6067 if (PyFunction_Check(__pyx_t_5)) {
6068 PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_t_3};
6069 __pyx_t_6 = __Pyx_PyFunction_FastCall(__pyx_t_5, __pyx_temp+1-1, 1+1);
if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 285, __pyx_L1_error)
6070 __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
6071 __Pyx_GOTREF(__pyx_t_6);
6072 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
6075 #if CYTHON_FAST_PYCCALL
6076 if (__Pyx_PyFastCFunction_Check(__pyx_t_5)) {
6077 PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_t_3};
6078 __pyx_t_6 = __Pyx_PyCFunction_FastCall(__pyx_t_5, __pyx_temp+1-1, 1+1);
if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 285, __pyx_L1_error)
6079 __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
6080 __Pyx_GOTREF(__pyx_t_6);
6081 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
6085 __pyx_t_12 = PyTuple_New(1+1);
if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 285, __pyx_L1_error)
6086 __Pyx_GOTREF(__pyx_t_12);
6087 __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_12, 0, __pyx_t_4); __pyx_t_4 = NULL;
6088 __Pyx_GIVEREF(__pyx_t_3);
6089 PyTuple_SET_ITEM(__pyx_t_12, 0+1, __pyx_t_3);
6091 __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_12, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 285, __pyx_L1_error)
6092 __Pyx_GOTREF(__pyx_t_6);
6093 __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
6096 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
6097 __Pyx_Raise(__pyx_t_6, 0, 0, 0);
6098 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
6099 __PYX_ERR(0, 285, __pyx_L1_error)
6117 __Pyx_XDECREF(__pyx_r);
6118 __Pyx_INCREF(((PyObject *)__pyx_v_res));
6119 __pyx_r = ((PyObject *)__pyx_v_res);
6132 __Pyx_XDECREF(__pyx_t_3);
6133 __Pyx_XDECREF(__pyx_t_4);
6134 __Pyx_XDECREF(__pyx_t_5);
6135 __Pyx_XDECREF(__pyx_t_6);
6136 __Pyx_XDECREF(__pyx_t_12);
6137 { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
6138 __Pyx_PyThreadState_declare
6139 __Pyx_PyThreadState_assign
6140 __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
6141 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_p1.rcbuffer->pybuffer);
6142 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_p2.rcbuffer->pybuffer);
6143 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_p3.rcbuffer->pybuffer);
6144 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_res.rcbuffer->pybuffer);
6145 __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
6146 __Pyx_AddTraceback(
"amns.Table._data_1d", __pyx_clineno, __pyx_lineno, __pyx_filename);
6150 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_p1.rcbuffer->pybuffer);
6151 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_p2.rcbuffer->pybuffer);
6152 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_p3.rcbuffer->pybuffer);
6153 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_res.rcbuffer->pybuffer);
6155 __Pyx_XDECREF((PyObject *)__pyx_v_res);
6156 __Pyx_XDECREF(__pyx_v_nargs);
6157 __Pyx_XGIVEREF(__pyx_r);
6158 __Pyx_RefNannyFinishContext();
6171 static PyObject *__pyx_pw_4amns_5Table_13_data_2d(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
6172 static PyObject *__pyx_pw_4amns_5Table_13_data_2d(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
6173 PyArrayObject *__pyx_v_p1 = 0;
6174 PyArrayObject *__pyx_v_p2 = 0;
6175 PyArrayObject *__pyx_v_p3 = 0;
6176 PyObject *__pyx_r = 0;
6177 __Pyx_RefNannyDeclarations
6178 __Pyx_RefNannySetupContext(
"_data_2d (wrapper)", 0);
6180 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_p1,&__pyx_n_s_p2,&__pyx_n_s_p3,0};
6181 PyObject* values[3] = {0,0,0};
6190 values[1] = (PyObject *)((PyArrayObject *)Py_None);
6199 values[2] = (PyObject *)((PyArrayObject *)Py_None);
6200 if (unlikely(__pyx_kwds)) {
6202 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
6204 case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
6205 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
6206 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
6208 default:
goto __pyx_L5_argtuple_error;
6210 kw_args = PyDict_Size(__pyx_kwds);
6213 if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_p1)) != 0)) kw_args--;
6214 else goto __pyx_L5_argtuple_error;
6217 PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_p2);
6218 if (value) { values[1] = value; kw_args--; }
6222 PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_p3);
6223 if (value) { values[2] = value; kw_args--; }
6226 if (unlikely(kw_args > 0)) {
6227 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args,
"_data_2d") < 0)) __PYX_ERR(0, 288, __pyx_L3_error)
6230 switch (PyTuple_GET_SIZE(__pyx_args)) {
6231 case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
6232 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
6233 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
6235 default:
goto __pyx_L5_argtuple_error;
6238 __pyx_v_p1 = ((PyArrayObject *)values[0]);
6239 __pyx_v_p2 = ((PyArrayObject *)values[1]);
6240 __pyx_v_p3 = ((PyArrayObject *)values[2]);
6242 goto __pyx_L4_argument_unpacking_done;
6243 __pyx_L5_argtuple_error:;
6244 __Pyx_RaiseArgtupleInvalid(
"_data_2d", 0, 1, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 288, __pyx_L3_error)
6246 __Pyx_AddTraceback("amns.Table._data_2d", __pyx_clineno, __pyx_lineno, __pyx_filename);
6247 __Pyx_RefNannyFinishContext();
6249 __pyx_L4_argument_unpacking_done:;
6250 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_p1), __pyx_ptype_5numpy_ndarray, 1, "p1", 0))) __PYX_ERR(0, 288, __pyx_L1_error)
6251 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_p2), __pyx_ptype_5numpy_ndarray, 1, "p2", 0))) __PYX_ERR(0, 289, __pyx_L1_error)
6252 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_p3), __pyx_ptype_5numpy_ndarray, 1, "p3", 0))) __PYX_ERR(0, 290, __pyx_L1_error)
6253 __pyx_r = __pyx_pf_4amns_5Table_12_data_2d(((struct __pyx_obj_4amns_Table *)__pyx_v_self), __pyx_v_p1, __pyx_v_p2, __pyx_v_p3);
6268 __Pyx_RefNannyFinishContext();
6272 static PyObject *__pyx_pf_4amns_5Table_12_data_2d(struct __pyx_obj_4amns_Table *__pyx_v_self, PyArrayObject *__pyx_v_p1, PyArrayObject *__pyx_v_p2, PyArrayObject *__pyx_v_p3) {
6274 PyArrayObject *__pyx_v_res = 0;
6275 PyObject *__pyx_v_nargs = NULL;
6276 __Pyx_LocalBuf_ND __pyx_pybuffernd_p1;
6277 __Pyx_Buffer __pyx_pybuffer_p1;
6278 __Pyx_LocalBuf_ND __pyx_pybuffernd_p2;
6279 __Pyx_Buffer __pyx_pybuffer_p2;
6280 __Pyx_LocalBuf_ND __pyx_pybuffernd_p3;
6281 __Pyx_Buffer __pyx_pybuffer_p3;
6282 __Pyx_LocalBuf_ND __pyx_pybuffernd_res;
6283 __Pyx_Buffer __pyx_pybuffer_res;
6284 PyObject *__pyx_r = NULL;
6285 __Pyx_RefNannyDeclarations
6288 PyObject *__pyx_t_3 = NULL;
6289 PyObject *__pyx_t_4 = NULL;
6290 PyObject *__pyx_t_5 = NULL;
6291 PyObject *__pyx_t_6 = NULL;
6292 PyArrayObject *__pyx_t_7 = NULL;
6294 PyObject *__pyx_t_9 = NULL;
6295 PyObject *__pyx_t_10 = NULL;
6296 PyObject *__pyx_t_11 = NULL;
6297 PyObject *__pyx_t_12 = NULL;
6298 __Pyx_RefNannySetupContext(
"_data_2d", 0);
6299 __pyx_pybuffer_res.pybuffer.buf = NULL;
6300 __pyx_pybuffer_res.refcount = 0;
6301 __pyx_pybuffernd_res.data = NULL;
6302 __pyx_pybuffernd_res.rcbuffer = &__pyx_pybuffer_res;
6303 __pyx_pybuffer_p1.pybuffer.buf = NULL;
6304 __pyx_pybuffer_p1.refcount = 0;
6305 __pyx_pybuffernd_p1.data = NULL;
6306 __pyx_pybuffernd_p1.rcbuffer = &__pyx_pybuffer_p1;
6307 __pyx_pybuffer_p2.pybuffer.buf = NULL;
6308 __pyx_pybuffer_p2.refcount = 0;
6309 __pyx_pybuffernd_p2.data = NULL;
6310 __pyx_pybuffernd_p2.rcbuffer = &__pyx_pybuffer_p2;
6311 __pyx_pybuffer_p3.pybuffer.buf = NULL;
6312 __pyx_pybuffer_p3.refcount = 0;
6313 __pyx_pybuffernd_p3.data = NULL;
6314 __pyx_pybuffernd_p3.rcbuffer = &__pyx_pybuffer_p3;
6316 __Pyx_BufFmt_StackElem __pyx_stack[1];
6317 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_p1.rcbuffer->pybuffer, (PyObject*)__pyx_v_p1, &__Pyx_TypeInfo_nn___pyx_t_5numpy_double_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) __PYX_ERR(0, 288, __pyx_L1_error)
6319 __pyx_pybuffernd_p1.diminfo[0].strides = __pyx_pybuffernd_p1.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_p1.diminfo[0].shape = __pyx_pybuffernd_p1.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_p1.diminfo[1].strides = __pyx_pybuffernd_p1.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_p1.diminfo[1].shape = __pyx_pybuffernd_p1.rcbuffer->pybuffer.shape[1];
6321 __Pyx_BufFmt_StackElem __pyx_stack[1];
6322 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_p2.rcbuffer->pybuffer, (PyObject*)__pyx_v_p2, &__Pyx_TypeInfo_nn___pyx_t_5numpy_double_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) __PYX_ERR(0, 288, __pyx_L1_error)
6324 __pyx_pybuffernd_p2.diminfo[0].strides = __pyx_pybuffernd_p2.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_p2.diminfo[0].shape = __pyx_pybuffernd_p2.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_p2.diminfo[1].strides = __pyx_pybuffernd_p2.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_p2.diminfo[1].shape = __pyx_pybuffernd_p2.rcbuffer->pybuffer.shape[1];
6326 __Pyx_BufFmt_StackElem __pyx_stack[1];
6327 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_p3.rcbuffer->pybuffer, (PyObject*)__pyx_v_p3, &__Pyx_TypeInfo_nn___pyx_t_5numpy_double_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) __PYX_ERR(0, 288, __pyx_L1_error)
6329 __pyx_pybuffernd_p3.diminfo[0].strides = __pyx_pybuffernd_p3.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_p3.diminfo[0].shape = __pyx_pybuffernd_p3.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_p3.diminfo[1].strides = __pyx_pybuffernd_p3.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_p3.diminfo[1].shape = __pyx_pybuffernd_p3.rcbuffer->pybuffer.shape[1];
6338 __Pyx_INCREF(__pyx_int_1);
6339 __pyx_v_nargs = __pyx_int_1;
6348 __pyx_t_1 = (((PyObject *)__pyx_v_p2) != Py_None);
6349 __pyx_t_2 = (__pyx_t_1 != 0);
6351 __pyx_t_3 = __Pyx_PyInt_AddObjC(__pyx_v_nargs, __pyx_int_1, 1, 1);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 296, __pyx_L1_error)
6352 __Pyx_GOTREF(__pyx_t_3);
6353 __Pyx_DECREF_SET(__pyx_v_nargs, __pyx_t_3);
6364 __pyx_t_2 = (((PyObject *)__pyx_v_p3) != Py_None);
6365 __pyx_t_1 = (__pyx_t_2 != 0);
6367 __pyx_t_3 = __Pyx_PyInt_AddObjC(__pyx_v_nargs, __pyx_int_1, 1, 1);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 297, __pyx_L1_error)
6368 __Pyx_GOTREF(__pyx_t_3);
6369 __Pyx_DECREF_SET(__pyx_v_nargs, __pyx_t_3);
6380 __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 299, __pyx_L1_error)
6381 __Pyx_GOTREF(__pyx_t_3);
6382 __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_empty_like); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 299, __pyx_L1_error)
6383 __Pyx_GOTREF(__pyx_t_4);
6384 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
6385 __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 299, __pyx_L1_error)
6386 __Pyx_GOTREF(__pyx_t_3);
6387 __Pyx_INCREF(((PyObject *)__pyx_v_p1));
6388 __Pyx_GIVEREF(((PyObject *)__pyx_v_p1));
6389 PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_v_p1));
6390 __pyx_t_5 = PyDict_New(); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 299, __pyx_L1_error)
6391 __Pyx_GOTREF(__pyx_t_5);
6392 if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_order, __pyx_n_s_F) < 0) __PYX_ERR(0, 299, __pyx_L1_error)
6393 __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_3, __pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 299, __pyx_L1_error)
6394 __Pyx_GOTREF(__pyx_t_6);
6395 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
6396 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
6397 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
6398 if (!(likely(((__pyx_t_6) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_6, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 299, __pyx_L1_error)
6399 __pyx_t_7 = ((PyArrayObject *)__pyx_t_6);
6401 __Pyx_BufFmt_StackElem __pyx_stack[1];
6402 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_res.rcbuffer->pybuffer);
6403 __pyx_t_8 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_res.rcbuffer->pybuffer, (PyObject*)__pyx_t_7, &__Pyx_TypeInfo_nn___pyx_t_5numpy_double_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack);
6404 if (unlikely(__pyx_t_8 < 0)) {
6405 PyErr_Fetch(&__pyx_t_9, &__pyx_t_10, &__pyx_t_11);
6406 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_res.rcbuffer->pybuffer, (PyObject*)__pyx_v_res, &__Pyx_TypeInfo_nn___pyx_t_5numpy_double_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) {
6407 Py_XDECREF(__pyx_t_9); Py_XDECREF(__pyx_t_10); Py_XDECREF(__pyx_t_11);
6408 __Pyx_RaiseBufferFallbackError();
6410 PyErr_Restore(__pyx_t_9, __pyx_t_10, __pyx_t_11);
6413 __pyx_pybuffernd_res.diminfo[0].strides = __pyx_pybuffernd_res.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_res.diminfo[0].shape = __pyx_pybuffernd_res.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_res.diminfo[1].strides = __pyx_pybuffernd_res.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_res.diminfo[1].shape = __pyx_pybuffernd_res.rcbuffer->pybuffer.shape[1];
6414 if (unlikely(__pyx_t_8 < 0)) __PYX_ERR(0, 299, __pyx_L1_error)
6417 __pyx_v_res = ((PyArrayObject *)__pyx_t_6);
6427 __pyx_t_6 = __Pyx_PyInt_EqObjC(__pyx_v_nargs, __pyx_int_1, 1, 0);
if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 301, __pyx_L1_error)
6428 __Pyx_GOTREF(__pyx_t_6);
6429 __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 301, __pyx_L1_error)
6430 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
6440 ITM_AMNS_CC_RX_2_A(__pyx_v_self->_handle, (__pyx_v_p1->dimensions[0]), (__pyx_v_p1->dimensions[1]), ((
double *)__pyx_v_res->data), ((
double *)__pyx_v_p1->data), (&__pyx_v_error_status));
6459 __pyx_t_6 = __Pyx_PyInt_EqObjC(__pyx_v_nargs, __pyx_int_2, 2, 0);
if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 305, __pyx_L1_error)
6460 __Pyx_GOTREF(__pyx_t_6);
6461 __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 305, __pyx_L1_error)
6462 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
6472 ITM_AMNS_CC_RX_2_B(__pyx_v_self->_handle, (__pyx_v_p1->dimensions[0]), (__pyx_v_p1->dimensions[1]), ((
double *)__pyx_v_res->data), ((
double *)__pyx_v_p1->data), ((
double *)__pyx_v_p2->data), (&__pyx_v_error_status));
6491 __pyx_t_6 = __Pyx_PyInt_EqObjC(__pyx_v_nargs, __pyx_int_3, 3, 0);
if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 310, __pyx_L1_error)
6492 __Pyx_GOTREF(__pyx_t_6);
6493 __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 310, __pyx_L1_error)
6494 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
6504 ITM_AMNS_CC_RX_2_C(__pyx_v_self->_handle, (__pyx_v_p1->dimensions[0]), (__pyx_v_p1->dimensions[1]), ((
double *)__pyx_v_res->data), ((
double *)__pyx_v_p1->data), ((
double *)__pyx_v_p2->data), ((
double *)__pyx_v_p3->data), (&__pyx_v_error_status));
6523 __pyx_t_1 = (__pyx_v_error_status.
flag != 0);
6533 __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_AmnsException);
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 318, __pyx_L1_error)
6534 __Pyx_GOTREF(__pyx_t_5);
6535 __pyx_t_3 = __Pyx_PyBytes_FromString(__pyx_v_error_status.
string); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 318, __pyx_L1_error)
6536 __Pyx_GOTREF(__pyx_t_3);
6538 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_5))) {
6539 __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_5);
6540 if (likely(__pyx_t_4)) {
6541 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_5);
6542 __Pyx_INCREF(__pyx_t_4);
6543 __Pyx_INCREF(
function);
6544 __Pyx_DECREF_SET(__pyx_t_5,
function);
6548 __pyx_t_6 = __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_3);
if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 318, __pyx_L1_error)
6549 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
6550 __Pyx_GOTREF(__pyx_t_6);
6552 #if CYTHON_FAST_PYCALL
6553 if (PyFunction_Check(__pyx_t_5)) {
6554 PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_t_3};
6555 __pyx_t_6 = __Pyx_PyFunction_FastCall(__pyx_t_5, __pyx_temp+1-1, 1+1);
if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 318, __pyx_L1_error)
6556 __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
6557 __Pyx_GOTREF(__pyx_t_6);
6558 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
6561 #if CYTHON_FAST_PYCCALL
6562 if (__Pyx_PyFastCFunction_Check(__pyx_t_5)) {
6563 PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_t_3};
6564 __pyx_t_6 = __Pyx_PyCFunction_FastCall(__pyx_t_5, __pyx_temp+1-1, 1+1);
if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 318, __pyx_L1_error)
6565 __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
6566 __Pyx_GOTREF(__pyx_t_6);
6567 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
6571 __pyx_t_12 = PyTuple_New(1+1);
if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 318, __pyx_L1_error)
6572 __Pyx_GOTREF(__pyx_t_12);
6573 __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_12, 0, __pyx_t_4); __pyx_t_4 = NULL;
6574 __Pyx_GIVEREF(__pyx_t_3);
6575 PyTuple_SET_ITEM(__pyx_t_12, 0+1, __pyx_t_3);
6577 __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_12, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 318, __pyx_L1_error)
6578 __Pyx_GOTREF(__pyx_t_6);
6579 __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
6582 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
6583 __Pyx_Raise(__pyx_t_6, 0, 0, 0);
6584 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
6585 __PYX_ERR(0, 318, __pyx_L1_error)
6603 __Pyx_XDECREF(__pyx_r);
6604 __Pyx_INCREF(((PyObject *)__pyx_v_res));
6605 __pyx_r = ((PyObject *)__pyx_v_res);
6618 __Pyx_XDECREF(__pyx_t_3);
6619 __Pyx_XDECREF(__pyx_t_4);
6620 __Pyx_XDECREF(__pyx_t_5);
6621 __Pyx_XDECREF(__pyx_t_6);
6622 __Pyx_XDECREF(__pyx_t_12);
6623 { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
6624 __Pyx_PyThreadState_declare
6625 __Pyx_PyThreadState_assign
6626 __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
6627 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_p1.rcbuffer->pybuffer);
6628 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_p2.rcbuffer->pybuffer);
6629 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_p3.rcbuffer->pybuffer);
6630 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_res.rcbuffer->pybuffer);
6631 __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
6632 __Pyx_AddTraceback(
"amns.Table._data_2d", __pyx_clineno, __pyx_lineno, __pyx_filename);
6636 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_p1.rcbuffer->pybuffer);
6637 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_p2.rcbuffer->pybuffer);
6638 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_p3.rcbuffer->pybuffer);
6639 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_res.rcbuffer->pybuffer);
6641 __Pyx_XDECREF((PyObject *)__pyx_v_res);
6642 __Pyx_XDECREF(__pyx_v_nargs);
6643 __Pyx_XGIVEREF(__pyx_r);
6644 __Pyx_RefNannyFinishContext();
6657 static PyObject *__pyx_pw_4amns_5Table_15_data_3d(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
6658 static PyObject *__pyx_pw_4amns_5Table_15_data_3d(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
6659 PyArrayObject *__pyx_v_p1 = 0;
6660 PyArrayObject *__pyx_v_p2 = 0;
6661 PyArrayObject *__pyx_v_p3 = 0;
6662 PyObject *__pyx_r = 0;
6663 __Pyx_RefNannyDeclarations
6664 __Pyx_RefNannySetupContext(
"_data_3d (wrapper)", 0);
6666 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_p1,&__pyx_n_s_p2,&__pyx_n_s_p3,0};
6667 PyObject* values[3] = {0,0,0};
6676 values[1] = (PyObject *)((PyArrayObject *)Py_None);
6685 values[2] = (PyObject *)((PyArrayObject *)Py_None);
6686 if (unlikely(__pyx_kwds)) {
6688 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
6690 case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
6691 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
6692 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
6694 default:
goto __pyx_L5_argtuple_error;
6696 kw_args = PyDict_Size(__pyx_kwds);
6699 if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_p1)) != 0)) kw_args--;
6700 else goto __pyx_L5_argtuple_error;
6703 PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_p2);
6704 if (value) { values[1] = value; kw_args--; }
6708 PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_p3);
6709 if (value) { values[2] = value; kw_args--; }
6712 if (unlikely(kw_args > 0)) {
6713 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args,
"_data_3d") < 0)) __PYX_ERR(0, 321, __pyx_L3_error)
6716 switch (PyTuple_GET_SIZE(__pyx_args)) {
6717 case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
6718 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
6719 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
6721 default:
goto __pyx_L5_argtuple_error;
6724 __pyx_v_p1 = ((PyArrayObject *)values[0]);
6725 __pyx_v_p2 = ((PyArrayObject *)values[1]);
6726 __pyx_v_p3 = ((PyArrayObject *)values[2]);
6728 goto __pyx_L4_argument_unpacking_done;
6729 __pyx_L5_argtuple_error:;
6730 __Pyx_RaiseArgtupleInvalid(
"_data_3d", 0, 1, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 321, __pyx_L3_error)
6732 __Pyx_AddTraceback("amns.Table._data_3d", __pyx_clineno, __pyx_lineno, __pyx_filename);
6733 __Pyx_RefNannyFinishContext();
6735 __pyx_L4_argument_unpacking_done:;
6736 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_p1), __pyx_ptype_5numpy_ndarray, 1, "p1", 0))) __PYX_ERR(0, 321, __pyx_L1_error)
6737 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_p2), __pyx_ptype_5numpy_ndarray, 1, "p2", 0))) __PYX_ERR(0, 322, __pyx_L1_error)
6738 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_p3), __pyx_ptype_5numpy_ndarray, 1, "p3", 0))) __PYX_ERR(0, 323, __pyx_L1_error)
6739 __pyx_r = __pyx_pf_4amns_5Table_14_data_3d(((struct __pyx_obj_4amns_Table *)__pyx_v_self), __pyx_v_p1, __pyx_v_p2, __pyx_v_p3);
6754 __Pyx_RefNannyFinishContext();
6758 static PyObject *__pyx_pf_4amns_5Table_14_data_3d(struct __pyx_obj_4amns_Table *__pyx_v_self, PyArrayObject *__pyx_v_p1, PyArrayObject *__pyx_v_p2, PyArrayObject *__pyx_v_p3) {
6760 PyArrayObject *__pyx_v_res = 0;
6761 PyObject *__pyx_v_nargs = NULL;
6762 __Pyx_LocalBuf_ND __pyx_pybuffernd_p1;
6763 __Pyx_Buffer __pyx_pybuffer_p1;
6764 __Pyx_LocalBuf_ND __pyx_pybuffernd_p2;
6765 __Pyx_Buffer __pyx_pybuffer_p2;
6766 __Pyx_LocalBuf_ND __pyx_pybuffernd_p3;
6767 __Pyx_Buffer __pyx_pybuffer_p3;
6768 __Pyx_LocalBuf_ND __pyx_pybuffernd_res;
6769 __Pyx_Buffer __pyx_pybuffer_res;
6770 PyObject *__pyx_r = NULL;
6771 __Pyx_RefNannyDeclarations
6774 PyObject *__pyx_t_3 = NULL;
6775 PyObject *__pyx_t_4 = NULL;
6776 PyObject *__pyx_t_5 = NULL;
6777 PyObject *__pyx_t_6 = NULL;
6778 PyArrayObject *__pyx_t_7 = NULL;
6780 PyObject *__pyx_t_9 = NULL;
6781 PyObject *__pyx_t_10 = NULL;
6782 PyObject *__pyx_t_11 = NULL;
6783 PyObject *__pyx_t_12 = NULL;
6784 __Pyx_RefNannySetupContext(
"_data_3d", 0);
6785 __pyx_pybuffer_res.pybuffer.buf = NULL;
6786 __pyx_pybuffer_res.refcount = 0;
6787 __pyx_pybuffernd_res.data = NULL;
6788 __pyx_pybuffernd_res.rcbuffer = &__pyx_pybuffer_res;
6789 __pyx_pybuffer_p1.pybuffer.buf = NULL;
6790 __pyx_pybuffer_p1.refcount = 0;
6791 __pyx_pybuffernd_p1.data = NULL;
6792 __pyx_pybuffernd_p1.rcbuffer = &__pyx_pybuffer_p1;
6793 __pyx_pybuffer_p2.pybuffer.buf = NULL;
6794 __pyx_pybuffer_p2.refcount = 0;
6795 __pyx_pybuffernd_p2.data = NULL;
6796 __pyx_pybuffernd_p2.rcbuffer = &__pyx_pybuffer_p2;
6797 __pyx_pybuffer_p3.pybuffer.buf = NULL;
6798 __pyx_pybuffer_p3.refcount = 0;
6799 __pyx_pybuffernd_p3.data = NULL;
6800 __pyx_pybuffernd_p3.rcbuffer = &__pyx_pybuffer_p3;
6802 __Pyx_BufFmt_StackElem __pyx_stack[1];
6803 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_p1.rcbuffer->pybuffer, (PyObject*)__pyx_v_p1, &__Pyx_TypeInfo_nn___pyx_t_5numpy_double_t, PyBUF_FORMAT| PyBUF_STRIDES, 3, 0, __pyx_stack) == -1)) __PYX_ERR(0, 321, __pyx_L1_error)
6805 __pyx_pybuffernd_p1.diminfo[0].strides = __pyx_pybuffernd_p1.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_p1.diminfo[0].shape = __pyx_pybuffernd_p1.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_p1.diminfo[1].strides = __pyx_pybuffernd_p1.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_p1.diminfo[1].shape = __pyx_pybuffernd_p1.rcbuffer->pybuffer.shape[1]; __pyx_pybuffernd_p1.diminfo[2].strides = __pyx_pybuffernd_p1.rcbuffer->pybuffer.strides[2]; __pyx_pybuffernd_p1.diminfo[2].shape = __pyx_pybuffernd_p1.rcbuffer->pybuffer.shape[2];
6807 __Pyx_BufFmt_StackElem __pyx_stack[1];
6808 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_p2.rcbuffer->pybuffer, (PyObject*)__pyx_v_p2, &__Pyx_TypeInfo_nn___pyx_t_5numpy_double_t, PyBUF_FORMAT| PyBUF_STRIDES, 3, 0, __pyx_stack) == -1)) __PYX_ERR(0, 321, __pyx_L1_error)
6810 __pyx_pybuffernd_p2.diminfo[0].strides = __pyx_pybuffernd_p2.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_p2.diminfo[0].shape = __pyx_pybuffernd_p2.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_p2.diminfo[1].strides = __pyx_pybuffernd_p2.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_p2.diminfo[1].shape = __pyx_pybuffernd_p2.rcbuffer->pybuffer.shape[1]; __pyx_pybuffernd_p2.diminfo[2].strides = __pyx_pybuffernd_p2.rcbuffer->pybuffer.strides[2]; __pyx_pybuffernd_p2.diminfo[2].shape = __pyx_pybuffernd_p2.rcbuffer->pybuffer.shape[2];
6812 __Pyx_BufFmt_StackElem __pyx_stack[1];
6813 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_p3.rcbuffer->pybuffer, (PyObject*)__pyx_v_p3, &__Pyx_TypeInfo_nn___pyx_t_5numpy_double_t, PyBUF_FORMAT| PyBUF_STRIDES, 3, 0, __pyx_stack) == -1)) __PYX_ERR(0, 321, __pyx_L1_error)
6815 __pyx_pybuffernd_p3.diminfo[0].strides = __pyx_pybuffernd_p3.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_p3.diminfo[0].shape = __pyx_pybuffernd_p3.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_p3.diminfo[1].strides = __pyx_pybuffernd_p3.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_p3.diminfo[1].shape = __pyx_pybuffernd_p3.rcbuffer->pybuffer.shape[1]; __pyx_pybuffernd_p3.diminfo[2].strides = __pyx_pybuffernd_p3.rcbuffer->pybuffer.strides[2]; __pyx_pybuffernd_p3.diminfo[2].shape = __pyx_pybuffernd_p3.rcbuffer->pybuffer.shape[2];
6824 __Pyx_INCREF(__pyx_int_1);
6825 __pyx_v_nargs = __pyx_int_1;
6834 __pyx_t_1 = (((PyObject *)__pyx_v_p2) != Py_None);
6835 __pyx_t_2 = (__pyx_t_1 != 0);
6837 __pyx_t_3 = __Pyx_PyInt_AddObjC(__pyx_v_nargs, __pyx_int_1, 1, 1);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 328, __pyx_L1_error)
6838 __Pyx_GOTREF(__pyx_t_3);
6839 __Pyx_DECREF_SET(__pyx_v_nargs, __pyx_t_3);
6850 __pyx_t_2 = (((PyObject *)__pyx_v_p3) != Py_None);
6851 __pyx_t_1 = (__pyx_t_2 != 0);
6853 __pyx_t_3 = __Pyx_PyInt_AddObjC(__pyx_v_nargs, __pyx_int_1, 1, 1);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 329, __pyx_L1_error)
6854 __Pyx_GOTREF(__pyx_t_3);
6855 __Pyx_DECREF_SET(__pyx_v_nargs, __pyx_t_3);
6866 __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 331, __pyx_L1_error)
6867 __Pyx_GOTREF(__pyx_t_3);
6868 __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_empty_like); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 331, __pyx_L1_error)
6869 __Pyx_GOTREF(__pyx_t_4);
6870 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
6871 __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 331, __pyx_L1_error)
6872 __Pyx_GOTREF(__pyx_t_3);
6873 __Pyx_INCREF(((PyObject *)__pyx_v_p1));
6874 __Pyx_GIVEREF(((PyObject *)__pyx_v_p1));
6875 PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_v_p1));
6876 __pyx_t_5 = PyDict_New(); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 331, __pyx_L1_error)
6877 __Pyx_GOTREF(__pyx_t_5);
6878 if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_order, __pyx_n_s_F) < 0) __PYX_ERR(0, 331, __pyx_L1_error)
6879 __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_3, __pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 331, __pyx_L1_error)
6880 __Pyx_GOTREF(__pyx_t_6);
6881 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
6882 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
6883 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
6884 if (!(likely(((__pyx_t_6) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_6, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 331, __pyx_L1_error)
6885 __pyx_t_7 = ((PyArrayObject *)__pyx_t_6);
6887 __Pyx_BufFmt_StackElem __pyx_stack[1];
6888 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_res.rcbuffer->pybuffer);
6889 __pyx_t_8 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_res.rcbuffer->pybuffer, (PyObject*)__pyx_t_7, &__Pyx_TypeInfo_nn___pyx_t_5numpy_double_t, PyBUF_FORMAT| PyBUF_STRIDES, 3, 0, __pyx_stack);
6890 if (unlikely(__pyx_t_8 < 0)) {
6891 PyErr_Fetch(&__pyx_t_9, &__pyx_t_10, &__pyx_t_11);
6892 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_res.rcbuffer->pybuffer, (PyObject*)__pyx_v_res, &__Pyx_TypeInfo_nn___pyx_t_5numpy_double_t, PyBUF_FORMAT| PyBUF_STRIDES, 3, 0, __pyx_stack) == -1)) {
6893 Py_XDECREF(__pyx_t_9); Py_XDECREF(__pyx_t_10); Py_XDECREF(__pyx_t_11);
6894 __Pyx_RaiseBufferFallbackError();
6896 PyErr_Restore(__pyx_t_9, __pyx_t_10, __pyx_t_11);
6899 __pyx_pybuffernd_res.diminfo[0].strides = __pyx_pybuffernd_res.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_res.diminfo[0].shape = __pyx_pybuffernd_res.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_res.diminfo[1].strides = __pyx_pybuffernd_res.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_res.diminfo[1].shape = __pyx_pybuffernd_res.rcbuffer->pybuffer.shape[1]; __pyx_pybuffernd_res.diminfo[2].strides = __pyx_pybuffernd_res.rcbuffer->pybuffer.strides[2]; __pyx_pybuffernd_res.diminfo[2].shape = __pyx_pybuffernd_res.rcbuffer->pybuffer.shape[2];
6900 if (unlikely(__pyx_t_8 < 0)) __PYX_ERR(0, 331, __pyx_L1_error)
6903 __pyx_v_res = ((PyArrayObject *)__pyx_t_6);
6913 __pyx_t_6 = __Pyx_PyInt_EqObjC(__pyx_v_nargs, __pyx_int_1, 1, 0);
if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 333, __pyx_L1_error)
6914 __Pyx_GOTREF(__pyx_t_6);
6915 __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 333, __pyx_L1_error)
6916 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
6926 ITM_AMNS_CC_RX_3_A(__pyx_v_self->_handle, (__pyx_v_p1->dimensions[0]), (__pyx_v_p1->dimensions[1]), (__pyx_v_p1->dimensions[2]), ((
double *)__pyx_v_res->data), ((
double *)__pyx_v_p1->data), (&__pyx_v_error_status));
6945 __pyx_t_6 = __Pyx_PyInt_EqObjC(__pyx_v_nargs, __pyx_int_2, 2, 0);
if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 337, __pyx_L1_error)
6946 __Pyx_GOTREF(__pyx_t_6);
6947 __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 337, __pyx_L1_error)
6948 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
6958 ITM_AMNS_CC_RX_3_B(__pyx_v_self->_handle, (__pyx_v_p1->dimensions[0]), (__pyx_v_p1->dimensions[1]), (__pyx_v_p1->dimensions[2]), ((
double *)__pyx_v_res->data), ((
double *)__pyx_v_p1->data), ((
double *)__pyx_v_p2->data), (&__pyx_v_error_status));
6977 __pyx_t_6 = __Pyx_PyInt_EqObjC(__pyx_v_nargs, __pyx_int_3, 3, 0);
if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 342, __pyx_L1_error)
6978 __Pyx_GOTREF(__pyx_t_6);
6979 __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 342, __pyx_L1_error)
6980 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
6990 ITM_AMNS_CC_RX_3_C(__pyx_v_self->_handle, (__pyx_v_p1->dimensions[0]), (__pyx_v_p1->dimensions[1]), (__pyx_v_p1->dimensions[2]), ((
double *)__pyx_v_res->data), ((
double *)__pyx_v_p1->data), ((
double *)__pyx_v_p2->data), ((
double *)__pyx_v_p3->data), (&__pyx_v_error_status));
7009 __pyx_t_1 = (__pyx_v_error_status.
flag != 0);
7019 __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_AmnsException);
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 350, __pyx_L1_error)
7020 __Pyx_GOTREF(__pyx_t_5);
7021 __pyx_t_3 = __Pyx_PyBytes_FromString(__pyx_v_error_status.
string); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 350, __pyx_L1_error)
7022 __Pyx_GOTREF(__pyx_t_3);
7024 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_5))) {
7025 __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_5);
7026 if (likely(__pyx_t_4)) {
7027 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_5);
7028 __Pyx_INCREF(__pyx_t_4);
7029 __Pyx_INCREF(
function);
7030 __Pyx_DECREF_SET(__pyx_t_5,
function);
7034 __pyx_t_6 = __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_3);
if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 350, __pyx_L1_error)
7035 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
7036 __Pyx_GOTREF(__pyx_t_6);
7038 #if CYTHON_FAST_PYCALL
7039 if (PyFunction_Check(__pyx_t_5)) {
7040 PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_t_3};
7041 __pyx_t_6 = __Pyx_PyFunction_FastCall(__pyx_t_5, __pyx_temp+1-1, 1+1);
if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 350, __pyx_L1_error)
7042 __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
7043 __Pyx_GOTREF(__pyx_t_6);
7044 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
7047 #if CYTHON_FAST_PYCCALL
7048 if (__Pyx_PyFastCFunction_Check(__pyx_t_5)) {
7049 PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_t_3};
7050 __pyx_t_6 = __Pyx_PyCFunction_FastCall(__pyx_t_5, __pyx_temp+1-1, 1+1);
if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 350, __pyx_L1_error)
7051 __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
7052 __Pyx_GOTREF(__pyx_t_6);
7053 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
7057 __pyx_t_12 = PyTuple_New(1+1);
if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 350, __pyx_L1_error)
7058 __Pyx_GOTREF(__pyx_t_12);
7059 __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_12, 0, __pyx_t_4); __pyx_t_4 = NULL;
7060 __Pyx_GIVEREF(__pyx_t_3);
7061 PyTuple_SET_ITEM(__pyx_t_12, 0+1, __pyx_t_3);
7063 __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_12, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 350, __pyx_L1_error)
7064 __Pyx_GOTREF(__pyx_t_6);
7065 __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
7068 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
7069 __Pyx_Raise(__pyx_t_6, 0, 0, 0);
7070 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
7071 __PYX_ERR(0, 350, __pyx_L1_error)
7089 __Pyx_XDECREF(__pyx_r);
7090 __Pyx_INCREF(((PyObject *)__pyx_v_res));
7091 __pyx_r = ((PyObject *)__pyx_v_res);
7104 __Pyx_XDECREF(__pyx_t_3);
7105 __Pyx_XDECREF(__pyx_t_4);
7106 __Pyx_XDECREF(__pyx_t_5);
7107 __Pyx_XDECREF(__pyx_t_6);
7108 __Pyx_XDECREF(__pyx_t_12);
7109 { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
7110 __Pyx_PyThreadState_declare
7111 __Pyx_PyThreadState_assign
7112 __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
7113 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_p1.rcbuffer->pybuffer);
7114 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_p2.rcbuffer->pybuffer);
7115 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_p3.rcbuffer->pybuffer);
7116 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_res.rcbuffer->pybuffer);
7117 __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
7118 __Pyx_AddTraceback(
"amns.Table._data_3d", __pyx_clineno, __pyx_lineno, __pyx_filename);
7122 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_p1.rcbuffer->pybuffer);
7123 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_p2.rcbuffer->pybuffer);
7124 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_p3.rcbuffer->pybuffer);
7125 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_res.rcbuffer->pybuffer);
7127 __Pyx_XDECREF((PyObject *)__pyx_v_res);
7128 __Pyx_XDECREF(__pyx_v_nargs);
7129 __Pyx_XGIVEREF(__pyx_r);
7130 __Pyx_RefNannyFinishContext();
7143 static int __pyx_pw_4amns_9Reactants_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
7144 static int __pyx_pw_4amns_9Reactants_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
7146 __Pyx_RefNannyDeclarations
7147 __Pyx_RefNannySetupContext(
"__cinit__ (wrapper)", 0);
7148 if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) {
7149 __Pyx_RaiseArgtupleInvalid(
"__cinit__", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args));
return -1;}
7150 if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds,
"__cinit__", 0)))
return -1;
7151 __pyx_r = __pyx_pf_4amns_9Reactants___cinit__(((
struct __pyx_obj_4amns_Reactants *)__pyx_v_self));
7154 __Pyx_RefNannyFinishContext();
7158 static int __pyx_pf_4amns_9Reactants___cinit__(CYTHON_UNUSED
struct __pyx_obj_4amns_Reactants *__pyx_v_self) {
7160 __Pyx_RefNannyDeclarations
7161 __Pyx_RefNannySetupContext(
"__cinit__", 0);
7165 __Pyx_RefNannyFinishContext();
7178 static int __pyx_pw_4amns_9Reactants_3__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
7179 static int __pyx_pw_4amns_9Reactants_3__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
7181 __Pyx_RefNannyDeclarations
7182 __Pyx_RefNannySetupContext(
"__init__ (wrapper)", 0);
7183 if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) {
7184 __Pyx_RaiseArgtupleInvalid(
"__init__", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args));
return -1;}
7185 if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds,
"__init__", 0)))
return -1;
7186 __pyx_r = __pyx_pf_4amns_9Reactants_2__init__(((
struct __pyx_obj_4amns_Reactants *)__pyx_v_self));
7189 __Pyx_RefNannyFinishContext();
7193 static int __pyx_pf_4amns_9Reactants_2__init__(
struct __pyx_obj_4amns_Reactants *__pyx_v_self) {
7195 __Pyx_RefNannyDeclarations
7196 PyObject *__pyx_t_1 = NULL;
7197 __Pyx_RefNannySetupContext(
"__init__", 0);
7206 __pyx_v_self->_handle = NULL;
7215 __pyx_t_1 = PyList_New(0);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 364, __pyx_L1_error)
7216 __Pyx_GOTREF(__pyx_t_1);
7217 __Pyx_GIVEREF(__pyx_t_1);
7218 __Pyx_GOTREF(__pyx_v_self->_reactants);
7219 __Pyx_DECREF(__pyx_v_self->_reactants);
7220 __pyx_v_self->_reactants = __pyx_t_1;
7235 __Pyx_XDECREF(__pyx_t_1);
7236 __Pyx_AddTraceback("amns.Reactants.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
7239 __Pyx_RefNannyFinishContext();
7251 static
void *__pyx_f_4amns_9Reactants_handle(struct __pyx_obj_4amns_Reactants *__pyx_v_self) {
7253 PyObject *__pyx_v_i = NULL;
7255 __Pyx_RefNannyDeclarations
7257 PyObject *__pyx_t_2 = NULL;
7258 Py_ssize_t __pyx_t_3;
7259 PyObject *__pyx_t_4 = NULL;
7260 PyObject *(*__pyx_t_5)(PyObject *);
7261 PyObject *__pyx_t_6 = NULL;
7264 __Pyx_RefNannySetupContext(
"handle", 0);
7273 __pyx_t_1 = ((__pyx_v_self->_handle == NULL) != 0);
7283 __pyx_t_2 = __pyx_v_self->_reactants;
7284 __Pyx_INCREF(__pyx_t_2);
7285 __pyx_t_3 = PyObject_Length(__pyx_t_2);
if (unlikely(__pyx_t_3 == -1)) __PYX_ERR(0, 370, __pyx_L1_error)
7286 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
7296 __Pyx_INCREF(__pyx_int_0);
7297 __pyx_t_2 = __pyx_int_0;
7298 if (likely(PyList_CheckExact(__pyx_v_self->_reactants)) || PyTuple_CheckExact(__pyx_v_self->_reactants)) {
7299 __pyx_t_4 = __pyx_v_self->_reactants; __Pyx_INCREF(__pyx_t_4); __pyx_t_3 = 0;
7302 __pyx_t_3 = -1; __pyx_t_4 = PyObject_GetIter(__pyx_v_self->_reactants);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 371, __pyx_L1_error)
7303 __Pyx_GOTREF(__pyx_t_4);
7304 __pyx_t_5 = Py_TYPE(__pyx_t_4)->tp_iternext; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 371, __pyx_L1_error)
7307 if (likely(!__pyx_t_5)) {
7308 if (likely(PyList_CheckExact(__pyx_t_4))) {
7309 if (__pyx_t_3 >= PyList_GET_SIZE(__pyx_t_4))
break;
7310 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
7311 __pyx_t_6 = PyList_GET_ITEM(__pyx_t_4, __pyx_t_3); __Pyx_INCREF(__pyx_t_6); __pyx_t_3++;
if (unlikely(0 < 0)) __PYX_ERR(0, 371, __pyx_L1_error)
7313 __pyx_t_6 = PySequence_ITEM(__pyx_t_4, __pyx_t_3); __pyx_t_3++;
if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 371, __pyx_L1_error)
7314 __Pyx_GOTREF(__pyx_t_6);
7317 if (__pyx_t_3 >= PyTuple_GET_SIZE(__pyx_t_4))
break;
7318 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
7319 __pyx_t_6 = PyTuple_GET_ITEM(__pyx_t_4, __pyx_t_3); __Pyx_INCREF(__pyx_t_6); __pyx_t_3++;
if (unlikely(0 < 0)) __PYX_ERR(0, 371, __pyx_L1_error)
7321 __pyx_t_6 = PySequence_ITEM(__pyx_t_4, __pyx_t_3); __pyx_t_3++;
if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 371, __pyx_L1_error)
7322 __Pyx_GOTREF(__pyx_t_6);
7326 __pyx_t_6 = __pyx_t_5(__pyx_t_4);
7327 if (unlikely(!__pyx_t_6)) {
7328 PyObject* exc_type = PyErr_Occurred();
7330 if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
7331 else __PYX_ERR(0, 371, __pyx_L1_error)
7335 __Pyx_GOTREF(__pyx_t_6);
7337 __pyx_t_7 = __pyx_convert__from_py_amns_c_reactant_type(__pyx_t_6);
if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 371, __pyx_L1_error)
7338 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
7339 __pyx_v_reactant = __pyx_t_7;
7340 __Pyx_INCREF(__pyx_t_2);
7341 __Pyx_XDECREF_SET(__pyx_v_i, __pyx_t_2);
7342 __pyx_t_6 = __Pyx_PyInt_AddObjC(__pyx_t_2, __pyx_int_1, 1, 0); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 371, __pyx_L1_error)
7343 __Pyx_GOTREF(__pyx_t_6);
7344 __Pyx_DECREF(__pyx_t_2);
7345 __pyx_t_2 = __pyx_t_6;
7355 __pyx_t_6 = __Pyx_PyInt_AddObjC(__pyx_v_i, __pyx_int_1, 1, 0); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 372, __pyx_L1_error)
7356 __Pyx_GOTREF(__pyx_t_6);
7357 __pyx_t_8 = __Pyx_PyInt_As_int(__pyx_t_6); if (unlikely((__pyx_t_8 == (
int)-1) && PyErr_Occurred())) __PYX_ERR(0, 372, __pyx_L1_error)
7358 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
7369 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
7370 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
7388 __pyx_r = __pyx_v_self->_handle;
7401 __Pyx_XDECREF(__pyx_t_2);
7402 __Pyx_XDECREF(__pyx_t_4);
7403 __Pyx_XDECREF(__pyx_t_6);
7404 __Pyx_WriteUnraisable("amns.Reactants.handle", __pyx_clineno, __pyx_lineno, __pyx_filename, 0, 0);
7407 __Pyx_XDECREF(__pyx_v_i);
7408 __Pyx_RefNannyFinishContext();
7421 static PyObject *__pyx_pw_4amns_9Reactants_5_invalidate_handle(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused);
7422 static PyObject *__pyx_pw_4amns_9Reactants_5_invalidate_handle(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
7423 PyObject *__pyx_r = 0;
7424 __Pyx_RefNannyDeclarations
7425 __Pyx_RefNannySetupContext(
"_invalidate_handle (wrapper)", 0);
7426 __pyx_r = __pyx_pf_4amns_9Reactants_4_invalidate_handle(((
struct __pyx_obj_4amns_Reactants *)__pyx_v_self));
7429 __Pyx_RefNannyFinishContext();
7433 static PyObject *__pyx_pf_4amns_9Reactants_4_invalidate_handle(
struct __pyx_obj_4amns_Reactants *__pyx_v_self) {
7434 PyObject *__pyx_r = NULL;
7435 __Pyx_RefNannyDeclarations
7437 __Pyx_RefNannySetupContext(
"_invalidate_handle", 0);
7446 __pyx_t_1 = ((__pyx_v_self->_handle != NULL) != 0);
7465 __pyx_v_self->_handle = NULL;
7485 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
7486 __Pyx_XGIVEREF(__pyx_r);
7487 __Pyx_RefNannyFinishContext();
7500 static PyObject *__pyx_pw_4amns_9Reactants_7add(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
7501 static char __pyx_doc_4amns_9Reactants_6add[] =
"Add to the list of reactants/products";
7502 static PyObject *__pyx_pw_4amns_9Reactants_7add(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
7503 PyObject *__pyx_v_zn = 0;
7504 PyObject *__pyx_v_za = 0;
7505 PyObject *__pyx_v_mi = 0;
7506 PyObject *__pyx_v_lr = 0;
7507 PyObject *__pyx_v_real_specifier = 0;
7508 PyObject *__pyx_v_int_specifier = 0;
7509 PyObject *__pyx_r = 0;
7510 __Pyx_RefNannyDeclarations
7511 __Pyx_RefNannySetupContext(
"add (wrapper)", 0);
7513 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_zn,&__pyx_n_s_za,&__pyx_n_s_mi,&__pyx_n_s_lr,&__pyx_n_s_real_specifier,&__pyx_n_s_int_specifier,0};
7514 PyObject* values[6] = {0,0,0,0,0,0};
7515 values[3] = ((PyObject *)Py_None);
7516 values[4] = ((PyObject *)Py_None);
7517 values[5] = ((PyObject *)Py_None);
7518 if (unlikely(__pyx_kwds)) {
7520 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
7522 case 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
7523 case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
7524 case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
7525 case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
7526 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
7527 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
7529 default:
goto __pyx_L5_argtuple_error;
7531 kw_args = PyDict_Size(__pyx_kwds);
7534 if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_zn)) != 0)) kw_args--;
7535 else goto __pyx_L5_argtuple_error;
7537 if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_za)) != 0)) kw_args--;
7539 __Pyx_RaiseArgtupleInvalid(
"add", 0, 3, 6, 1); __PYX_ERR(0, 380, __pyx_L3_error)
7542 if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_mi)) != 0)) kw_args--;
7544 __Pyx_RaiseArgtupleInvalid(
"add", 0, 3, 6, 2); __PYX_ERR(0, 380, __pyx_L3_error)
7548 PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_lr);
7549 if (value) { values[3] = value; kw_args--; }
7553 PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_real_specifier);
7554 if (value) { values[4] = value; kw_args--; }
7558 PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_int_specifier);
7559 if (value) { values[5] = value; kw_args--; }
7562 if (unlikely(kw_args > 0)) {
7563 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args,
"add") < 0)) __PYX_ERR(0, 380, __pyx_L3_error)
7566 switch (PyTuple_GET_SIZE(__pyx_args)) {
7567 case 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
7568 case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
7569 case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
7570 case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
7571 values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
7572 values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
7574 default:
goto __pyx_L5_argtuple_error;
7577 __pyx_v_zn = values[0];
7578 __pyx_v_za = values[1];
7579 __pyx_v_mi = values[2];
7580 __pyx_v_lr = values[3];
7581 __pyx_v_real_specifier = values[4];
7582 __pyx_v_int_specifier = values[5];
7584 goto __pyx_L4_argument_unpacking_done;
7585 __pyx_L5_argtuple_error:;
7586 __Pyx_RaiseArgtupleInvalid(
"add", 0, 3, 6, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 380, __pyx_L3_error)
7588 __Pyx_AddTraceback("amns.Reactants.add", __pyx_clineno, __pyx_lineno, __pyx_filename);
7589 __Pyx_RefNannyFinishContext();
7591 __pyx_L4_argument_unpacking_done:;
7592 __pyx_r = __pyx_pf_4amns_9Reactants_6add(((struct __pyx_obj_4amns_Reactants *)__pyx_v_self), __pyx_v_zn, __pyx_v_za, __pyx_v_mi, __pyx_v_lr, __pyx_v_real_specifier, __pyx_v_int_specifier);
7595 __Pyx_RefNannyFinishContext();
7599 static PyObject *__pyx_pf_4amns_9Reactants_6add(struct __pyx_obj_4amns_Reactants *__pyx_v_self, PyObject *__pyx_v_zn, PyObject *__pyx_v_za, PyObject *__pyx_v_mi, PyObject *__pyx_v_lr, PyObject *__pyx_v_real_specifier, PyObject *__pyx_v_int_specifier) {
7601 PyObject *__pyx_r = NULL;
7602 __Pyx_RefNannyDeclarations
7603 PyObject *__pyx_t_1 = NULL;
7604 PyObject *__pyx_t_2 = NULL;
7605 PyObject *__pyx_t_3 = NULL;
7610 __Pyx_RefNannySetupContext(
"add", 0);
7628 __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_invalidate_handle);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 384, __pyx_L1_error)
7629 __Pyx_GOTREF(__pyx_t_2);
7631 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
7632 __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
7633 if (likely(__pyx_t_3)) {
7634 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_2);
7635 __Pyx_INCREF(__pyx_t_3);
7636 __Pyx_INCREF(
function);
7637 __Pyx_DECREF_SET(__pyx_t_2,
function);
7641 __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 384, __pyx_L1_error)
7642 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
7644 __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_2);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 384, __pyx_L1_error)
7646 __Pyx_GOTREF(__pyx_t_1);
7647 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
7648 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
7657 __pyx_t_4 = __pyx_PyFloat_AsDouble(__pyx_v_zn);
if (unlikely((__pyx_t_4 == (
double)-1) && PyErr_Occurred())) __PYX_ERR(0, 385, __pyx_L1_error)
7658 __pyx_v_r.ZN = __pyx_t_4;
7667 __pyx_t_4 = __pyx_PyFloat_AsDouble(__pyx_v_za); if (unlikely((__pyx_t_4 == (
double)-1) && PyErr_Occurred())) __PYX_ERR(0, 386, __pyx_L1_error)
7668 __pyx_v_r.
ZA = __pyx_t_4;
7677 __pyx_t_4 = __pyx_PyFloat_AsDouble(__pyx_v_mi); if (unlikely((__pyx_t_4 == (
double)-1) && PyErr_Occurred())) __PYX_ERR(0, 387, __pyx_L1_error)
7678 __pyx_v_r.MI = __pyx_t_4;
7687 __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_v_lr); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(0, 388, __pyx_L1_error)
7689 __pyx_t_6 = __Pyx_PyInt_As_int(__pyx_v_lr);
if (unlikely((__pyx_t_6 == (
int)-1) && PyErr_Occurred())) __PYX_ERR(0, 388, __pyx_L1_error)
7690 __pyx_v_r.LR = __pyx_t_6;
7700 __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_v_real_specifier); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(0, 389, __pyx_L1_error)
7702 __pyx_t_4 = __pyx_PyFloat_AsDouble(__pyx_v_real_specifier);
if (unlikely((__pyx_t_4 == (
double)-1) && PyErr_Occurred())) __PYX_ERR(0, 389, __pyx_L1_error)
7703 __pyx_v_r.real_specifier = __pyx_t_4;
7713 __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_v_int_specifier); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(0, 390, __pyx_L1_error)
7715 __pyx_t_6 = __Pyx_PyInt_As_int(__pyx_v_int_specifier);
if (unlikely((__pyx_t_6 == (
int)-1) && PyErr_Occurred())) __PYX_ERR(0, 390, __pyx_L1_error)
7716 __pyx_v_r.int_specifier = __pyx_t_6;
7726 __pyx_t_1 = __pyx_convert__to_py_amns_c_reactant_type(__pyx_v_r); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 391, __pyx_L1_error)
7727 __Pyx_GOTREF(__pyx_t_1);
7728 __pyx_t_7 = __Pyx_PyObject_Append(__pyx_v_self->_reactants, __pyx_t_1); if (unlikely(__pyx_t_7 == -1)) __PYX_ERR(0, 391, __pyx_L1_error)
7729 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
7740 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
7743 __Pyx_XDECREF(__pyx_t_1);
7744 __Pyx_XDECREF(__pyx_t_2);
7745 __Pyx_XDECREF(__pyx_t_3);
7746 __Pyx_AddTraceback("amns.Reactants.add", __pyx_clineno, __pyx_lineno, __pyx_filename);
7749 __Pyx_XGIVEREF(__pyx_r);
7750 __Pyx_RefNannyFinishContext();
7763 static Py_ssize_t __pyx_pw_4amns_9Reactants_9__len__(PyObject *__pyx_v_self);
7764 static
char __pyx_doc_4amns_9Reactants_8__len__[] = "Return the number of reactants/products";
7765 #if CYTHON_COMPILING_IN_CPYTHON
7766 struct wrapperbase __pyx_wrapperbase_4amns_9Reactants_8__len__;
7768 static Py_ssize_t __pyx_pw_4amns_9Reactants_9__len__(PyObject *__pyx_v_self) {
7770 __Pyx_RefNannyDeclarations
7771 __Pyx_RefNannySetupContext(
"__len__ (wrapper)", 0);
7772 __pyx_r = __pyx_pf_4amns_9Reactants_8__len__(((
struct __pyx_obj_4amns_Reactants *)__pyx_v_self));
7775 __Pyx_RefNannyFinishContext();
7779 static Py_ssize_t __pyx_pf_4amns_9Reactants_8__len__(
struct __pyx_obj_4amns_Reactants *__pyx_v_self) {
7781 __Pyx_RefNannyDeclarations
7782 PyObject *__pyx_t_1 = NULL;
7783 Py_ssize_t __pyx_t_2;
7784 __Pyx_RefNannySetupContext(
"__len__", 0);
7793 __pyx_t_1 = __pyx_v_self->_reactants;
7794 __Pyx_INCREF(__pyx_t_1);
7795 __pyx_t_2 = PyObject_Length(__pyx_t_1);
if (unlikely(__pyx_t_2 == -1)) __PYX_ERR(0, 395, __pyx_L1_error)
7796 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
7797 __pyx_r = __pyx_t_2;
7810 __Pyx_XDECREF(__pyx_t_1);
7811 __Pyx_AddTraceback("amns.Reactants.__len__", __pyx_clineno, __pyx_lineno, __pyx_filename);
7814 __Pyx_RefNannyFinishContext();
7827 static PyObject *__pyx_pw_4amns_9Reactants_11__str__(PyObject *__pyx_v_self);
7828 static
char __pyx_doc_4amns_9Reactants_10__str__[] = "Return a
string version of all the reactants/products";
7829 #if CYTHON_COMPILING_IN_CPYTHON
7830 struct wrapperbase __pyx_wrapperbase_4amns_9Reactants_10__str__;
7832 static PyObject *__pyx_pw_4amns_9Reactants_11__str__(PyObject *__pyx_v_self) {
7833 PyObject *__pyx_r = 0;
7834 __Pyx_RefNannyDeclarations
7835 __Pyx_RefNannySetupContext(
"__str__ (wrapper)", 0);
7836 __pyx_r = __pyx_pf_4amns_9Reactants_10__str__(((
struct __pyx_obj_4amns_Reactants *)__pyx_v_self));
7839 __Pyx_RefNannyFinishContext();
7843 static PyObject *__pyx_pf_4amns_9Reactants_10__str__(
struct __pyx_obj_4amns_Reactants *__pyx_v_self) {
7844 PyObject *__pyx_r = NULL;
7845 __Pyx_RefNannyDeclarations
7846 PyObject *__pyx_t_1 = NULL;
7847 PyObject *__pyx_t_2 = NULL;
7848 __Pyx_RefNannySetupContext(
"__str__", 0);
7857 __Pyx_XDECREF(__pyx_r);
7858 __pyx_t_1 = PyTuple_New(1);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 399, __pyx_L1_error)
7859 __Pyx_GOTREF(__pyx_t_1);
7860 __Pyx_INCREF(__pyx_v_self->_reactants);
7861 __Pyx_GIVEREF(__pyx_v_self->_reactants);
7862 PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_self->_reactants);
7863 __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)(&PyString_Type)), __pyx_t_1, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 399, __pyx_L1_error)
7864 __Pyx_GOTREF(__pyx_t_2);
7865 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
7866 __pyx_r = __pyx_t_2;
7880 __Pyx_XDECREF(__pyx_t_1);
7881 __Pyx_XDECREF(__pyx_t_2);
7882 __Pyx_AddTraceback("amns.Reactants.__str__", __pyx_clineno, __pyx_lineno, __pyx_filename);
7885 __Pyx_XGIVEREF(__pyx_r);
7886 __Pyx_RefNannyFinishContext();
7899 static PyObject *__pyx_pw_4amns_9Reactants_13test(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused);
7900 static PyObject *__pyx_pw_4amns_9Reactants_13test(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
7901 PyObject *__pyx_r = 0;
7902 __Pyx_RefNannyDeclarations
7903 __Pyx_RefNannySetupContext(
"test (wrapper)", 0);
7904 __pyx_r = __pyx_pf_4amns_9Reactants_12test(((
struct __pyx_obj_4amns_Reactants *)__pyx_v_self));
7907 __Pyx_RefNannyFinishContext();
7911 static PyObject *__pyx_pf_4amns_9Reactants_12test(
struct __pyx_obj_4amns_Reactants *__pyx_v_self) {
7912 CYTHON_UNUSED
void *__pyx_v_handle;
7913 PyObject *__pyx_r = NULL;
7914 __Pyx_RefNannyDeclarations
7915 __Pyx_RefNannySetupContext(
"test", 0);
7924 __pyx_v_handle = ((
struct __pyx_vtabstruct_4amns_Reactants *)__pyx_v_self->__pyx_vtab)->handle(__pyx_v_self);
7935 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
7936 __Pyx_XGIVEREF(__pyx_r);
7937 __Pyx_RefNannyFinishContext();
7950 static PyObject *__pyx_pw_4amns_9Reactants_15value(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused);
7951 static char __pyx_doc_4amns_9Reactants_14value[] =
"Return all of the reactants/products";
7952 static PyObject *__pyx_pw_4amns_9Reactants_15value(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
7953 PyObject *__pyx_r = 0;
7954 __Pyx_RefNannyDeclarations
7955 __Pyx_RefNannySetupContext(
"value (wrapper)", 0);
7956 __pyx_r = __pyx_pf_4amns_9Reactants_14value(((
struct __pyx_obj_4amns_Reactants *)__pyx_v_self));
7959 __Pyx_RefNannyFinishContext();
7963 static PyObject *__pyx_pf_4amns_9Reactants_14value(
struct __pyx_obj_4amns_Reactants *__pyx_v_self) {
7964 PyObject *__pyx_r = NULL;
7965 __Pyx_RefNannyDeclarations
7966 __Pyx_RefNannySetupContext(
"value", 0);
7975 __Pyx_XDECREF(__pyx_r);
7976 __Pyx_INCREF(__pyx_v_self->_reactants);
7977 __pyx_r = __pyx_v_self->_reactants;
7990 __Pyx_XGIVEREF(__pyx_r);
7991 __Pyx_RefNannyFinishContext();
8004 static CYTHON_UNUSED
int __pyx_pw_5numpy_7ndarray_1__getbuffer__(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info,
int __pyx_v_flags);
8005 static CYTHON_UNUSED
int __pyx_pw_5numpy_7ndarray_1__getbuffer__(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info,
int __pyx_v_flags) {
8007 __Pyx_RefNannyDeclarations
8008 __Pyx_RefNannySetupContext(
"__getbuffer__ (wrapper)", 0);
8009 __pyx_r = __pyx_pf_5numpy_7ndarray___getbuffer__(((PyArrayObject *)__pyx_v_self), ((Py_buffer *)__pyx_v_info), ((
int)__pyx_v_flags));
8012 __Pyx_RefNannyFinishContext();
8016 static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, Py_buffer *__pyx_v_info,
int __pyx_v_flags) {
8017 int __pyx_v_copy_shape;
8020 int __pyx_v_endian_detector;
8021 int __pyx_v_little_endian;
8024 PyArray_Descr *__pyx_v_descr = 0;
8026 int __pyx_v_hasfields;
8028 __Pyx_RefNannyDeclarations
8031 PyObject *__pyx_t_3 = NULL;
8034 PyObject *__pyx_t_6 = NULL;
8036 __Pyx_RefNannySetupContext(
"__getbuffer__", 0);
8037 if (__pyx_v_info != NULL) {
8038 __pyx_v_info->obj = Py_None; __Pyx_INCREF(Py_None);
8039 __Pyx_GIVEREF(__pyx_v_info->obj);
8049 __pyx_t_1 = ((__pyx_v_info == NULL) != 0);
8062 __pyx_v_endian_detector = 1;
8071 __pyx_v_little_endian = ((((
char *)(&__pyx_v_endian_detector))[0]) != 0);
8080 __pyx_v_ndim = PyArray_NDIM(__pyx_v_self);
8089 __pyx_t_1 = (((
sizeof(npy_intp)) != (
sizeof(Py_ssize_t))) != 0);
8099 __pyx_v_copy_shape = 1;
8119 __pyx_v_copy_shape = 0;
8130 __pyx_t_2 = (((__pyx_v_flags & PyBUF_C_CONTIGUOUS) == PyBUF_C_CONTIGUOUS) != 0);
8133 __pyx_t_1 = __pyx_t_2;
8134 goto __pyx_L6_bool_binop_done;
8144 __pyx_t_2 = ((!(PyArray_CHKFLAGS(__pyx_v_self, NPY_C_CONTIGUOUS) != 0)) != 0);
8145 __pyx_t_1 = __pyx_t_2;
8146 __pyx_L6_bool_binop_done:;
8164 __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__5, NULL);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 218, __pyx_L1_error)
8165 __Pyx_GOTREF(__pyx_t_3);
8166 __Pyx_Raise(__pyx_t_3, 0, 0, 0);
8167 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
8168 __PYX_ERR(1, 218, __pyx_L1_error)
8186 __pyx_t_2 = (((__pyx_v_flags & PyBUF_F_CONTIGUOUS) == PyBUF_F_CONTIGUOUS) != 0);
8189 __pyx_t_1 = __pyx_t_2;
8190 goto __pyx_L9_bool_binop_done;
8200 __pyx_t_2 = ((!(PyArray_CHKFLAGS(__pyx_v_self, NPY_F_CONTIGUOUS) != 0)) != 0);
8201 __pyx_t_1 = __pyx_t_2;
8202 __pyx_L9_bool_binop_done:;
8220 __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__6, NULL);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 222, __pyx_L1_error)
8221 __Pyx_GOTREF(__pyx_t_3);
8222 __Pyx_Raise(__pyx_t_3, 0, 0, 0);
8223 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
8224 __PYX_ERR(1, 222, __pyx_L1_error)
8242 __pyx_v_info->buf = PyArray_DATA(__pyx_v_self);
8251 __pyx_v_info->
ndim = __pyx_v_ndim;
8260 __pyx_t_1 = (__pyx_v_copy_shape != 0);
8270 __pyx_v_info->strides = ((Py_ssize_t *)malloc((((
sizeof(Py_ssize_t)) * ((
size_t)__pyx_v_ndim)) * 2)));
8279 __pyx_v_info->shape = (__pyx_v_info->strides + __pyx_v_ndim);
8288 __pyx_t_4 = __pyx_v_ndim;
8289 for (__pyx_t_5 = 0; __pyx_t_5 < __pyx_t_4; __pyx_t_5+=1) {
8290 __pyx_v_i = __pyx_t_5;
8299 (__pyx_v_info->strides[__pyx_v_i]) = (PyArray_STRIDES(__pyx_v_self)[__pyx_v_i]);
8308 (__pyx_v_info->shape[__pyx_v_i]) = (PyArray_DIMS(__pyx_v_self)[__pyx_v_i]);
8329 __pyx_v_info->strides = ((Py_ssize_t *)PyArray_STRIDES(__pyx_v_self));
8338 __pyx_v_info->shape = ((Py_ssize_t *)PyArray_DIMS(__pyx_v_self));
8349 __pyx_v_info->suboffsets = NULL;
8358 __pyx_v_info->itemsize = PyArray_ITEMSIZE(__pyx_v_self);
8367 __pyx_v_info->readonly = (!(PyArray_ISWRITEABLE(__pyx_v_self) != 0));
8385 __pyx_t_3 = ((PyObject *)__pyx_v_self->descr);
8386 __Pyx_INCREF(__pyx_t_3);
8387 __pyx_v_descr = ((PyArray_Descr *)__pyx_t_3);
8397 __pyx_v_hasfields = PyDataType_HASFIELDS(__pyx_v_descr);
8406 __pyx_t_2 = ((!(__pyx_v_hasfields != 0)) != 0);
8409 __pyx_t_1 = __pyx_t_2;
8410 goto __pyx_L15_bool_binop_done;
8412 __pyx_t_2 = ((!(__pyx_v_copy_shape != 0)) != 0);
8413 __pyx_t_1 = __pyx_t_2;
8414 __pyx_L15_bool_binop_done:;
8424 __Pyx_INCREF(Py_None);
8425 __Pyx_GIVEREF(Py_None);
8426 __Pyx_GOTREF(__pyx_v_info->obj);
8427 __Pyx_DECREF(__pyx_v_info->obj);
8428 __pyx_v_info->obj = Py_None;
8448 __Pyx_INCREF(((PyObject *)__pyx_v_self));
8449 __Pyx_GIVEREF(((PyObject *)__pyx_v_self));
8450 __Pyx_GOTREF(__pyx_v_info->obj);
8451 __Pyx_DECREF(__pyx_v_info->obj);
8452 __pyx_v_info->obj = ((PyObject *)__pyx_v_self);
8463 __pyx_t_1 = ((!(__pyx_v_hasfields != 0)) != 0);
8473 __pyx_t_4 = __pyx_v_descr->type_num;
8474 __pyx_v_t = __pyx_t_4;
8483 __pyx_t_2 = ((__pyx_v_descr->byteorder ==
'>') != 0);
8485 goto __pyx_L20_next_or;
8488 __pyx_t_2 = (__pyx_v_little_endian != 0);
8491 __pyx_t_1 = __pyx_t_2;
8492 goto __pyx_L19_bool_binop_done;
8503 __pyx_t_2 = ((__pyx_v_descr->byteorder ==
'<') != 0);
8506 __pyx_t_1 = __pyx_t_2;
8507 goto __pyx_L19_bool_binop_done;
8509 __pyx_t_2 = ((!(__pyx_v_little_endian != 0)) != 0);
8510 __pyx_t_1 = __pyx_t_2;
8511 __pyx_L19_bool_binop_done:;
8529 __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__7, NULL);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 259, __pyx_L1_error)
8530 __Pyx_GOTREF(__pyx_t_3);
8531 __Pyx_Raise(__pyx_t_3, 0, 0, 0);
8532 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
8533 __PYX_ERR(1, 259, __pyx_L1_error)
8551 switch (__pyx_v_t) {
8553 __pyx_v_f = ((
char *)
"b");
8564 __pyx_v_f = ((
char *)
"B");
8575 __pyx_v_f = ((
char *)
"h");
8586 __pyx_v_f = ((
char *)
"H");
8597 __pyx_v_f = ((
char *)
"i");
8608 __pyx_v_f = ((
char *)
"I");
8619 __pyx_v_f = ((
char *)
"l");
8630 __pyx_v_f = ((
char *)
"L");
8641 __pyx_v_f = ((
char *)
"q");
8652 __pyx_v_f = ((
char *)
"Q");
8663 __pyx_v_f = ((
char *)
"f");
8674 __pyx_v_f = ((
char *)
"d");
8684 case NPY_LONGDOUBLE:
8685 __pyx_v_f = ((
char *)
"g");
8696 __pyx_v_f = ((
char *)
"Zf");
8707 __pyx_v_f = ((
char *)
"Zd");
8717 case NPY_CLONGDOUBLE:
8718 __pyx_v_f = ((
char *)
"Zg");
8729 __pyx_v_f = ((
char *)
"O");
8740 __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_t);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 278, __pyx_L1_error)
8741 __Pyx_GOTREF(__pyx_t_3);
8742 __pyx_t_6 = PyUnicode_Format(__pyx_kp_u_unknown_dtype_code_in_numpy_pxd, __pyx_t_3); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 278, __pyx_L1_error)
8743 __Pyx_GOTREF(__pyx_t_6);
8744 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
8745 __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 278, __pyx_L1_error)
8746 __Pyx_GOTREF(__pyx_t_3);
8747 __Pyx_GIVEREF(__pyx_t_6);
8748 PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_6);
8750 __pyx_t_6 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_t_3, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 278, __pyx_L1_error)
8751 __Pyx_GOTREF(__pyx_t_6);
8752 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
8753 __Pyx_Raise(__pyx_t_6, 0, 0, 0);
8754 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
8755 __PYX_ERR(1, 278, __pyx_L1_error)
8766 __pyx_v_info->format = __pyx_v_f;
8795 __pyx_v_info->format = ((
char *)malloc(0xFF));
8804 (__pyx_v_info->format[0]) =
'^';
8822 __pyx_t_7 = __pyx_f_5numpy__util_dtypestring(__pyx_v_descr, (__pyx_v_info->format + 1), (__pyx_v_info->format + 0xFF), (&__pyx_v_offset));
if (unlikely(__pyx_t_7 == NULL)) __PYX_ERR(1, 285, __pyx_L1_error)
8823 __pyx_v_f = __pyx_t_7;
8832 (__pyx_v_f[0]) = '\x00';
8847 __Pyx_XDECREF(__pyx_t_3);
8848 __Pyx_XDECREF(__pyx_t_6);
8849 __Pyx_AddTraceback("numpy.ndarray.__getbuffer__", __pyx_clineno, __pyx_lineno, __pyx_filename);
8851 if (__pyx_v_info != NULL && __pyx_v_info->obj != NULL) {
8852 __Pyx_GOTREF(__pyx_v_info->obj);
8853 __Pyx_DECREF(__pyx_v_info->obj); __pyx_v_info->obj = NULL;
8857 if (__pyx_v_info != NULL && __pyx_v_info->obj == Py_None) {
8858 __Pyx_GOTREF(Py_None);
8859 __Pyx_DECREF(Py_None); __pyx_v_info->obj = NULL;
8862 __Pyx_XDECREF((PyObject *)__pyx_v_descr);
8863 __Pyx_RefNannyFinishContext();
8876 static CYTHON_UNUSED
void __pyx_pw_5numpy_7ndarray_3__releasebuffer__(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info);
8877 static CYTHON_UNUSED
void __pyx_pw_5numpy_7ndarray_3__releasebuffer__(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info) {
8878 __Pyx_RefNannyDeclarations
8879 __Pyx_RefNannySetupContext(
"__releasebuffer__ (wrapper)", 0);
8880 __pyx_pf_5numpy_7ndarray_2__releasebuffer__(((PyArrayObject *)__pyx_v_self), ((Py_buffer *)__pyx_v_info));
8883 __Pyx_RefNannyFinishContext();
8886 static void __pyx_pf_5numpy_7ndarray_2__releasebuffer__(PyArrayObject *__pyx_v_self, Py_buffer *__pyx_v_info) {
8887 __Pyx_RefNannyDeclarations
8889 __Pyx_RefNannySetupContext(
"__releasebuffer__", 0);
8898 __pyx_t_1 = (PyArray_HASFIELDS(__pyx_v_self) != 0);
8908 free(__pyx_v_info->format);
8926 __pyx_t_1 = (((
sizeof(npy_intp)) != (
sizeof(Py_ssize_t))) != 0);
8936 free(__pyx_v_info->strides);
8956 __Pyx_RefNannyFinishContext();
8967 static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew1(PyObject *__pyx_v_a) {
8968 PyObject *__pyx_r = NULL;
8969 __Pyx_RefNannyDeclarations
8970 PyObject *__pyx_t_1 = NULL;
8971 __Pyx_RefNannySetupContext(
"PyArray_MultiIterNew1", 0);
8980 __Pyx_XDECREF(__pyx_r);
8981 __pyx_t_1 = PyArray_MultiIterNew(1, ((
void *)__pyx_v_a));
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 771, __pyx_L1_error)
8982 __Pyx_GOTREF(__pyx_t_1);
8983 __pyx_r = __pyx_t_1;
8997 __Pyx_XDECREF(__pyx_t_1);
8998 __Pyx_AddTraceback("numpy.PyArray_MultiIterNew1", __pyx_clineno, __pyx_lineno, __pyx_filename);
9001 __Pyx_XGIVEREF(__pyx_r);
9002 __Pyx_RefNannyFinishContext();
9014 static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew2(PyObject *__pyx_v_a, PyObject *__pyx_v_b) {
9015 PyObject *__pyx_r = NULL;
9016 __Pyx_RefNannyDeclarations
9017 PyObject *__pyx_t_1 = NULL;
9018 __Pyx_RefNannySetupContext(
"PyArray_MultiIterNew2", 0);
9027 __Pyx_XDECREF(__pyx_r);
9028 __pyx_t_1 = PyArray_MultiIterNew(2, ((
void *)__pyx_v_a), ((
void *)__pyx_v_b));
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 774, __pyx_L1_error)
9029 __Pyx_GOTREF(__pyx_t_1);
9030 __pyx_r = __pyx_t_1;
9044 __Pyx_XDECREF(__pyx_t_1);
9045 __Pyx_AddTraceback("numpy.PyArray_MultiIterNew2", __pyx_clineno, __pyx_lineno, __pyx_filename);
9048 __Pyx_XGIVEREF(__pyx_r);
9049 __Pyx_RefNannyFinishContext();
9061 static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew3(PyObject *__pyx_v_a, PyObject *__pyx_v_b, PyObject *__pyx_v_c) {
9062 PyObject *__pyx_r = NULL;
9063 __Pyx_RefNannyDeclarations
9064 PyObject *__pyx_t_1 = NULL;
9065 __Pyx_RefNannySetupContext(
"PyArray_MultiIterNew3", 0);
9074 __Pyx_XDECREF(__pyx_r);
9075 __pyx_t_1 = PyArray_MultiIterNew(3, ((
void *)__pyx_v_a), ((
void *)__pyx_v_b), ((
void *)__pyx_v_c));
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 777, __pyx_L1_error)
9076 __Pyx_GOTREF(__pyx_t_1);
9077 __pyx_r = __pyx_t_1;
9091 __Pyx_XDECREF(__pyx_t_1);
9092 __Pyx_AddTraceback("numpy.PyArray_MultiIterNew3", __pyx_clineno, __pyx_lineno, __pyx_filename);
9095 __Pyx_XGIVEREF(__pyx_r);
9096 __Pyx_RefNannyFinishContext();
9108 static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew4(PyObject *__pyx_v_a, PyObject *__pyx_v_b, PyObject *__pyx_v_c, PyObject *__pyx_v_d) {
9109 PyObject *__pyx_r = NULL;
9110 __Pyx_RefNannyDeclarations
9111 PyObject *__pyx_t_1 = NULL;
9112 __Pyx_RefNannySetupContext(
"PyArray_MultiIterNew4", 0);
9121 __Pyx_XDECREF(__pyx_r);
9122 __pyx_t_1 = PyArray_MultiIterNew(4, ((
void *)__pyx_v_a), ((
void *)__pyx_v_b), ((
void *)__pyx_v_c), ((
void *)__pyx_v_d));
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 780, __pyx_L1_error)
9123 __Pyx_GOTREF(__pyx_t_1);
9124 __pyx_r = __pyx_t_1;
9138 __Pyx_XDECREF(__pyx_t_1);
9139 __Pyx_AddTraceback("numpy.PyArray_MultiIterNew4", __pyx_clineno, __pyx_lineno, __pyx_filename);
9142 __Pyx_XGIVEREF(__pyx_r);
9143 __Pyx_RefNannyFinishContext();
9155 static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew5(PyObject *__pyx_v_a, PyObject *__pyx_v_b, PyObject *__pyx_v_c, PyObject *__pyx_v_d, PyObject *__pyx_v_e) {
9156 PyObject *__pyx_r = NULL;
9157 __Pyx_RefNannyDeclarations
9158 PyObject *__pyx_t_1 = NULL;
9159 __Pyx_RefNannySetupContext(
"PyArray_MultiIterNew5", 0);
9168 __Pyx_XDECREF(__pyx_r);
9169 __pyx_t_1 = PyArray_MultiIterNew(5, ((
void *)__pyx_v_a), ((
void *)__pyx_v_b), ((
void *)__pyx_v_c), ((
void *)__pyx_v_d), ((
void *)__pyx_v_e));
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 783, __pyx_L1_error)
9170 __Pyx_GOTREF(__pyx_t_1);
9171 __pyx_r = __pyx_t_1;
9185 __Pyx_XDECREF(__pyx_t_1);
9186 __Pyx_AddTraceback("numpy.PyArray_MultiIterNew5", __pyx_clineno, __pyx_lineno, __pyx_filename);
9189 __Pyx_XGIVEREF(__pyx_r);
9190 __Pyx_RefNannyFinishContext();
9202 static CYTHON_INLINE
char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx_v_descr,
char *__pyx_v_f,
char *__pyx_v_end,
int *__pyx_v_offset) {
9203 PyArray_Descr *__pyx_v_child = 0;
9204 int __pyx_v_endian_detector;
9205 int __pyx_v_little_endian;
9206 PyObject *__pyx_v_fields = 0;
9207 PyObject *__pyx_v_childname = NULL;
9208 PyObject *__pyx_v_new_offset = NULL;
9209 PyObject *__pyx_v_t = NULL;
9211 __Pyx_RefNannyDeclarations
9212 PyObject *__pyx_t_1 = NULL;
9213 Py_ssize_t __pyx_t_2;
9214 PyObject *__pyx_t_3 = NULL;
9215 PyObject *__pyx_t_4 = NULL;
9221 __Pyx_RefNannySetupContext(
"_util_dtypestring", 0);
9230 __pyx_v_endian_detector = 1;
9239 __pyx_v_little_endian = ((((
char *)(&__pyx_v_endian_detector))[0]) != 0);
9248 if (unlikely(__pyx_v_descr->names == Py_None)) {
9249 PyErr_SetString(PyExc_TypeError,
"'NoneType' object is not iterable");
9250 __PYX_ERR(1, 794, __pyx_L1_error)
9252 __pyx_t_1 = __pyx_v_descr->names; __Pyx_INCREF(__pyx_t_1); __pyx_t_2 = 0;
9254 if (__pyx_t_2 >= PyTuple_GET_SIZE(__pyx_t_1))
break;
9255 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
9256 __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_3); __pyx_t_2++;
if (unlikely(0 < 0)) __PYX_ERR(1, 794, __pyx_L1_error)
9258 __pyx_t_3 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++;
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 794, __pyx_L1_error)
9259 __Pyx_GOTREF(__pyx_t_3);
9261 __Pyx_XDECREF_SET(__pyx_v_childname, __pyx_t_3);
9271 if (unlikely(__pyx_v_descr->fields == Py_None)) {
9272 PyErr_SetString(PyExc_TypeError,
"'NoneType' object is not subscriptable");
9273 __PYX_ERR(1, 795, __pyx_L1_error)
9275 __pyx_t_3 = __Pyx_PyDict_GetItem(__pyx_v_descr->fields, __pyx_v_childname);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 795, __pyx_L1_error)
9276 __Pyx_GOTREF(__pyx_t_3);
9277 if (!(likely(PyTuple_CheckExact(__pyx_t_3))||((__pyx_t_3) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_t_3)->tp_name), 0))) __PYX_ERR(1, 795, __pyx_L1_error)
9278 __Pyx_XDECREF_SET(__pyx_v_fields, ((PyObject*)__pyx_t_3));
9288 if (likely(__pyx_v_fields != Py_None)) {
9289 PyObject* sequence = __pyx_v_fields;
9290 #if !CYTHON_COMPILING_IN_PYPY
9291 Py_ssize_t size = Py_SIZE(sequence);
9293 Py_ssize_t size = PySequence_Size(sequence);
9295 if (unlikely(size != 2)) {
9296 if (size > 2) __Pyx_RaiseTooManyValuesError(2);
9297 else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
9298 __PYX_ERR(1, 796, __pyx_L1_error)
9300 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
9301 __pyx_t_3 = PyTuple_GET_ITEM(sequence, 0);
9302 __pyx_t_4 = PyTuple_GET_ITEM(sequence, 1);
9303 __Pyx_INCREF(__pyx_t_3);
9304 __Pyx_INCREF(__pyx_t_4);
9306 __pyx_t_3 = PySequence_ITEM(sequence, 0);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 796, __pyx_L1_error)
9307 __Pyx_GOTREF(__pyx_t_3);
9308 __pyx_t_4 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 796, __pyx_L1_error)
9309 __Pyx_GOTREF(__pyx_t_4);
9312 __Pyx_RaiseNoneNotIterableError(); __PYX_ERR(1, 796, __pyx_L1_error)
9314 if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_5numpy_dtype))))) __PYX_ERR(1, 796, __pyx_L1_error)
9315 __Pyx_XDECREF_SET(__pyx_v_child, ((PyArray_Descr *)__pyx_t_3));
9317 __Pyx_XDECREF_SET(__pyx_v_new_offset, __pyx_t_4);
9327 __pyx_t_4 = __Pyx_PyInt_From_int((__pyx_v_offset[0])); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 798, __pyx_L1_error)
9328 __Pyx_GOTREF(__pyx_t_4);
9329 __pyx_t_3 = PyNumber_Subtract(__pyx_v_new_offset, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 798, __pyx_L1_error)
9330 __Pyx_GOTREF(__pyx_t_3);
9331 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
9332 __pyx_t_5 = __Pyx_PyInt_As_int(__pyx_t_3); if (unlikely((__pyx_t_5 == (
int)-1) && PyErr_Occurred())) __PYX_ERR(1, 798, __pyx_L1_error)
9333 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
9334 __pyx_t_6 = ((((__pyx_v_end - __pyx_v_f) - ((
int)__pyx_t_5)) < 15) != 0);
9344 __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_RuntimeError, __pyx_tuple__8, NULL);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 799, __pyx_L1_error)
9345 __Pyx_GOTREF(__pyx_t_3);
9346 __Pyx_Raise(__pyx_t_3, 0, 0, 0);
9347 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
9348 __PYX_ERR(1, 799, __pyx_L1_error)
9366 __pyx_t_7 = ((__pyx_v_child->byteorder == '>') != 0);
9368 goto __pyx_L8_next_or;
9371 __pyx_t_7 = (__pyx_v_little_endian != 0);
9374 __pyx_t_6 = __pyx_t_7;
9375 goto __pyx_L7_bool_binop_done;
9386 __pyx_t_7 = ((__pyx_v_child->byteorder ==
'<') != 0);
9389 __pyx_t_6 = __pyx_t_7;
9390 goto __pyx_L7_bool_binop_done;
9392 __pyx_t_7 = ((!(__pyx_v_little_endian != 0)) != 0);
9393 __pyx_t_6 = __pyx_t_7;
9394 __pyx_L7_bool_binop_done:;
9412 __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__9, NULL);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 803, __pyx_L1_error)
9413 __Pyx_GOTREF(__pyx_t_3);
9414 __Pyx_Raise(__pyx_t_3, 0, 0, 0);
9415 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
9416 __PYX_ERR(1, 803, __pyx_L1_error)
9435 __pyx_t_3 = __Pyx_PyInt_From_int((__pyx_v_offset[0]));
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 813, __pyx_L1_error)
9436 __Pyx_GOTREF(__pyx_t_3);
9437 __pyx_t_4 = PyObject_RichCompare(__pyx_t_3, __pyx_v_new_offset, Py_LT); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 813, __pyx_L1_error)
9438 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
9439 __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 813, __pyx_L1_error)
9440 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
9441 if (!__pyx_t_6) break;
9450 (__pyx_v_f[0]) = 0x78;
9459 __pyx_v_f = (__pyx_v_f + 1);
9469 (__pyx_v_offset[__pyx_t_8]) = ((__pyx_v_offset[__pyx_t_8]) + 1);
9480 (__pyx_v_offset[__pyx_t_8]) = ((__pyx_v_offset[__pyx_t_8]) + __pyx_v_child->elsize);
9489 __pyx_t_6 = ((!(PyDataType_HASFIELDS(__pyx_v_child) != 0)) != 0);
9499 __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_child->type_num);
if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 821, __pyx_L1_error)
9500 __Pyx_GOTREF(__pyx_t_4);
9501 __Pyx_XDECREF_SET(__pyx_v_t, __pyx_t_4);
9511 __pyx_t_6 = (((__pyx_v_end - __pyx_v_f) < 5) != 0);
9521 __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_RuntimeError, __pyx_tuple__10, NULL);
if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 823, __pyx_L1_error)
9522 __Pyx_GOTREF(__pyx_t_4);
9523 __Pyx_Raise(__pyx_t_4, 0, 0, 0);
9524 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
9525 __PYX_ERR(1, 823, __pyx_L1_error)
9543 __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_BYTE); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 826, __pyx_L1_error)
9544 __Pyx_GOTREF(__pyx_t_4);
9545 __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 826, __pyx_L1_error)
9546 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
9547 __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 826, __pyx_L1_error)
9548 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
9550 (__pyx_v_f[0]) = 98;
9561 __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_UBYTE);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 827, __pyx_L1_error)
9562 __Pyx_GOTREF(__pyx_t_3);
9563 __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 827, __pyx_L1_error)
9564 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
9565 __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 827, __pyx_L1_error)
9566 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
9568 (__pyx_v_f[0]) = 66;
9579 __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_SHORT);
if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 828, __pyx_L1_error)
9580 __Pyx_GOTREF(__pyx_t_4);
9581 __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 828, __pyx_L1_error)
9582 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
9583 __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 828, __pyx_L1_error)
9584 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
9586 (__pyx_v_f[0]) = 0x68;
9597 __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_USHORT);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 829, __pyx_L1_error)
9598 __Pyx_GOTREF(__pyx_t_3);
9599 __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 829, __pyx_L1_error)
9600 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
9601 __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 829, __pyx_L1_error)
9602 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
9604 (__pyx_v_f[0]) = 72;
9615 __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_INT);
if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 830, __pyx_L1_error)
9616 __Pyx_GOTREF(__pyx_t_4);
9617 __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 830, __pyx_L1_error)
9618 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
9619 __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 830, __pyx_L1_error)
9620 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
9622 (__pyx_v_f[0]) = 0x69;
9633 __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_UINT);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 831, __pyx_L1_error)
9634 __Pyx_GOTREF(__pyx_t_3);
9635 __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 831, __pyx_L1_error)
9636 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
9637 __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 831, __pyx_L1_error)
9638 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
9640 (__pyx_v_f[0]) = 73;
9651 __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_LONG);
if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 832, __pyx_L1_error)
9652 __Pyx_GOTREF(__pyx_t_4);
9653 __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 832, __pyx_L1_error)
9654 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
9655 __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 832, __pyx_L1_error)
9656 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
9658 (__pyx_v_f[0]) = 0x6C;
9669 __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_ULONG);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 833, __pyx_L1_error)
9670 __Pyx_GOTREF(__pyx_t_3);
9671 __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 833, __pyx_L1_error)
9672 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
9673 __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 833, __pyx_L1_error)
9674 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
9676 (__pyx_v_f[0]) = 76;
9687 __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_LONGLONG);
if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 834, __pyx_L1_error)
9688 __Pyx_GOTREF(__pyx_t_4);
9689 __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 834, __pyx_L1_error)
9690 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
9691 __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 834, __pyx_L1_error)
9692 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
9694 (__pyx_v_f[0]) = 0x71;
9705 __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_ULONGLONG);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 835, __pyx_L1_error)
9706 __Pyx_GOTREF(__pyx_t_3);
9707 __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 835, __pyx_L1_error)
9708 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
9709 __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 835, __pyx_L1_error)
9710 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
9712 (__pyx_v_f[0]) = 81;
9723 __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_FLOAT);
if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 836, __pyx_L1_error)
9724 __Pyx_GOTREF(__pyx_t_4);
9725 __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 836, __pyx_L1_error)
9726 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
9727 __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 836, __pyx_L1_error)
9728 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
9730 (__pyx_v_f[0]) = 0x66;
9741 __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_DOUBLE);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 837, __pyx_L1_error)
9742 __Pyx_GOTREF(__pyx_t_3);
9743 __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 837, __pyx_L1_error)
9744 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
9745 __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 837, __pyx_L1_error)
9746 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
9748 (__pyx_v_f[0]) = 0x64;
9759 __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_LONGDOUBLE);
if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 838, __pyx_L1_error)
9760 __Pyx_GOTREF(__pyx_t_4);
9761 __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 838, __pyx_L1_error)
9762 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
9763 __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 838, __pyx_L1_error)
9764 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
9766 (__pyx_v_f[0]) = 0x67;
9777 __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_CFLOAT);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 839, __pyx_L1_error)
9778 __Pyx_GOTREF(__pyx_t_3);
9779 __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 839, __pyx_L1_error)
9780 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
9781 __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 839, __pyx_L1_error)
9782 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
9784 (__pyx_v_f[0]) = 90;
9785 (__pyx_v_f[1]) = 0x66;
9786 __pyx_v_f = (__pyx_v_f + 1);
9797 __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_CDOUBLE);
if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 840, __pyx_L1_error)
9798 __Pyx_GOTREF(__pyx_t_4);
9799 __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 840, __pyx_L1_error)
9800 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
9801 __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 840, __pyx_L1_error)
9802 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
9804 (__pyx_v_f[0]) = 90;
9805 (__pyx_v_f[1]) = 0x64;
9806 __pyx_v_f = (__pyx_v_f + 1);
9817 __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_CLONGDOUBLE);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 841, __pyx_L1_error)
9818 __Pyx_GOTREF(__pyx_t_3);
9819 __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 841, __pyx_L1_error)
9820 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
9821 __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 841, __pyx_L1_error)
9822 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
9824 (__pyx_v_f[0]) = 90;
9825 (__pyx_v_f[1]) = 0x67;
9826 __pyx_v_f = (__pyx_v_f + 1);
9837 __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_OBJECT);
if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 842, __pyx_L1_error)
9838 __Pyx_GOTREF(__pyx_t_4);
9839 __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 842, __pyx_L1_error)
9840 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
9841 __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 842, __pyx_L1_error)
9842 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
9844 (__pyx_v_f[0]) = 79;
9856 __pyx_t_3 = PyUnicode_Format(__pyx_kp_u_unknown_dtype_code_in_numpy_pxd, __pyx_v_t);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 844, __pyx_L1_error)
9857 __Pyx_GOTREF(__pyx_t_3);
9858 __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 844, __pyx_L1_error)
9859 __Pyx_GOTREF(__pyx_t_4);
9860 __Pyx_GIVEREF(__pyx_t_3);
9861 PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3);
9863 __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_t_4, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 844, __pyx_L1_error)
9864 __Pyx_GOTREF(__pyx_t_3);
9865 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
9866 __Pyx_Raise(__pyx_t_3, 0, 0, 0);
9867 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
9868 __PYX_ERR(1, 844, __pyx_L1_error)
9879 __pyx_v_f = (__pyx_v_f + 1);
9899 __pyx_t_9 = __pyx_f_5numpy__util_dtypestring(__pyx_v_child, __pyx_v_f, __pyx_v_end, __pyx_v_offset);
if (unlikely(__pyx_t_9 == NULL)) __PYX_ERR(1, 849, __pyx_L1_error)
9900 __pyx_v_f = __pyx_t_9;
9912 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
9921 __pyx_r = __pyx_v_f;
9934 __Pyx_XDECREF(__pyx_t_1);
9935 __Pyx_XDECREF(__pyx_t_3);
9936 __Pyx_XDECREF(__pyx_t_4);
9937 __Pyx_AddTraceback("numpy._util_dtypestring", __pyx_clineno, __pyx_lineno, __pyx_filename);
9940 __Pyx_XDECREF((PyObject *)__pyx_v_child);
9941 __Pyx_XDECREF(__pyx_v_fields);
9942 __Pyx_XDECREF(__pyx_v_childname);
9943 __Pyx_XDECREF(__pyx_v_new_offset);
9944 __Pyx_XDECREF(__pyx_v_t);
9945 __Pyx_RefNannyFinishContext();
9957 static CYTHON_INLINE
void __pyx_f_5numpy_set_array_base(PyArrayObject *__pyx_v_arr, PyObject *__pyx_v_base) {
9958 PyObject *__pyx_v_baseptr;
9959 __Pyx_RefNannyDeclarations
9962 __Pyx_RefNannySetupContext(
"set_array_base", 0);
9971 __pyx_t_1 = (__pyx_v_base == Py_None);
9972 __pyx_t_2 = (__pyx_t_1 != 0);
9982 __pyx_v_baseptr = NULL;
10002 Py_INCREF(__pyx_v_base);
10011 __pyx_v_baseptr = ((PyObject *)__pyx_v_base);
10022 Py_XDECREF(__pyx_v_arr->base);
10031 __pyx_v_arr->base = __pyx_v_baseptr;
10042 __Pyx_RefNannyFinishContext();
10053 static CYTHON_INLINE PyObject *__pyx_f_5numpy_get_array_base(PyArrayObject *__pyx_v_arr) {
10054 PyObject *__pyx_r = NULL;
10055 __Pyx_RefNannyDeclarations
10057 __Pyx_RefNannySetupContext(
"get_array_base", 0);
10066 __pyx_t_1 = ((__pyx_v_arr->base == NULL) != 0);
10076 __Pyx_XDECREF(__pyx_r);
10077 __Pyx_INCREF(Py_None);
10098 __Pyx_XDECREF(__pyx_r);
10099 __Pyx_INCREF(((PyObject *)__pyx_v_arr->base));
10100 __pyx_r = ((PyObject *)__pyx_v_arr->base);
10114 __Pyx_XGIVEREF(__pyx_r);
10115 __Pyx_RefNannyFinishContext();
10127 static CYTHON_INLINE
int __pyx_f_5numpy_import_array(
void) {
10129 __Pyx_RefNannyDeclarations
10130 PyObject *__pyx_t_1 = NULL;
10131 PyObject *__pyx_t_2 = NULL;
10132 PyObject *__pyx_t_3 = NULL;
10134 PyObject *__pyx_t_5 = NULL;
10135 PyObject *__pyx_t_6 = NULL;
10136 PyObject *__pyx_t_7 = NULL;
10137 PyObject *__pyx_t_8 = NULL;
10138 __Pyx_RefNannySetupContext(
"import_array", 0);
10148 __Pyx_PyThreadState_declare
10149 __Pyx_PyThreadState_assign
10150 __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
10151 __Pyx_XGOTREF(__pyx_t_1);
10152 __Pyx_XGOTREF(__pyx_t_2);
10153 __Pyx_XGOTREF(__pyx_t_3);
10163 __pyx_t_4 = _import_array();
if (unlikely(__pyx_t_4 == -1)) __PYX_ERR(1, 987, __pyx_L3_error)
10173 __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
10174 __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
10175 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
10176 goto __pyx_L10_try_end;
10178 __Pyx_PyThreadState_assign
10187 __pyx_t_4 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0])));
10189 __Pyx_AddTraceback(
"numpy.import_array", __pyx_clineno, __pyx_lineno, __pyx_filename);
10190 if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(1, 988, __pyx_L5_except_error)
10191 __Pyx_GOTREF(__pyx_t_5);
10192 __Pyx_GOTREF(__pyx_t_6);
10193 __Pyx_GOTREF(__pyx_t_7);
10202 __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_ImportError, __pyx_tuple__11, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 989, __pyx_L5_except_error)
10203 __Pyx_GOTREF(__pyx_t_8);
10204 __Pyx_Raise(__pyx_t_8, 0, 0, 0);
10205 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
10206 __PYX_ERR(1, 989, __pyx_L5_except_error)
10208 goto __pyx_L5_except_error;
10209 __pyx_L5_except_error:;
10218 __Pyx_PyThreadState_assign
10219 __Pyx_XGIVEREF(__pyx_t_1);
10220 __Pyx_XGIVEREF(__pyx_t_2);
10221 __Pyx_XGIVEREF(__pyx_t_3);
10222 __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
10223 goto __pyx_L1_error;
10224 __pyx_L10_try_end:;
10239 __Pyx_XDECREF(__pyx_t_5);
10240 __Pyx_XDECREF(__pyx_t_6);
10241 __Pyx_XDECREF(__pyx_t_7);
10242 __Pyx_XDECREF(__pyx_t_8);
10243 __Pyx_AddTraceback("numpy.import_array", __pyx_clineno, __pyx_lineno, __pyx_filename);
10246 __Pyx_RefNannyFinishContext();
10258 static CYTHON_INLINE
int __pyx_f_5numpy_import_umath(
void) {
10260 __Pyx_RefNannyDeclarations
10261 PyObject *__pyx_t_1 = NULL;
10262 PyObject *__pyx_t_2 = NULL;
10263 PyObject *__pyx_t_3 = NULL;
10265 PyObject *__pyx_t_5 = NULL;
10266 PyObject *__pyx_t_6 = NULL;
10267 PyObject *__pyx_t_7 = NULL;
10268 PyObject *__pyx_t_8 = NULL;
10269 __Pyx_RefNannySetupContext(
"import_umath", 0);
10279 __Pyx_PyThreadState_declare
10280 __Pyx_PyThreadState_assign
10281 __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
10282 __Pyx_XGOTREF(__pyx_t_1);
10283 __Pyx_XGOTREF(__pyx_t_2);
10284 __Pyx_XGOTREF(__pyx_t_3);
10294 __pyx_t_4 = _import_umath();
if (unlikely(__pyx_t_4 == -1)) __PYX_ERR(1, 993, __pyx_L3_error)
10304 __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
10305 __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
10306 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
10307 goto __pyx_L10_try_end;
10309 __Pyx_PyThreadState_assign
10318 __pyx_t_4 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0])));
10320 __Pyx_AddTraceback(
"numpy.import_umath", __pyx_clineno, __pyx_lineno, __pyx_filename);
10321 if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(1, 994, __pyx_L5_except_error)
10322 __Pyx_GOTREF(__pyx_t_5);
10323 __Pyx_GOTREF(__pyx_t_6);
10324 __Pyx_GOTREF(__pyx_t_7);
10333 __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_ImportError, __pyx_tuple__12, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 995, __pyx_L5_except_error)
10334 __Pyx_GOTREF(__pyx_t_8);
10335 __Pyx_Raise(__pyx_t_8, 0, 0, 0);
10336 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
10337 __PYX_ERR(1, 995, __pyx_L5_except_error)
10339 goto __pyx_L5_except_error;
10340 __pyx_L5_except_error:;
10349 __Pyx_PyThreadState_assign
10350 __Pyx_XGIVEREF(__pyx_t_1);
10351 __Pyx_XGIVEREF(__pyx_t_2);
10352 __Pyx_XGIVEREF(__pyx_t_3);
10353 __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
10354 goto __pyx_L1_error;
10355 __pyx_L10_try_end:;
10370 __Pyx_XDECREF(__pyx_t_5);
10371 __Pyx_XDECREF(__pyx_t_6);
10372 __Pyx_XDECREF(__pyx_t_7);
10373 __Pyx_XDECREF(__pyx_t_8);
10374 __Pyx_AddTraceback("numpy.import_umath", __pyx_clineno, __pyx_lineno, __pyx_filename);
10377 __Pyx_RefNannyFinishContext();
10389 static CYTHON_INLINE
int __pyx_f_5numpy_import_ufunc(
void) {
10391 __Pyx_RefNannyDeclarations
10392 PyObject *__pyx_t_1 = NULL;
10393 PyObject *__pyx_t_2 = NULL;
10394 PyObject *__pyx_t_3 = NULL;
10396 PyObject *__pyx_t_5 = NULL;
10397 PyObject *__pyx_t_6 = NULL;
10398 PyObject *__pyx_t_7 = NULL;
10399 PyObject *__pyx_t_8 = NULL;
10400 __Pyx_RefNannySetupContext(
"import_ufunc", 0);
10410 __Pyx_PyThreadState_declare
10411 __Pyx_PyThreadState_assign
10412 __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
10413 __Pyx_XGOTREF(__pyx_t_1);
10414 __Pyx_XGOTREF(__pyx_t_2);
10415 __Pyx_XGOTREF(__pyx_t_3);
10425 __pyx_t_4 = _import_umath();
if (unlikely(__pyx_t_4 == -1)) __PYX_ERR(1, 999, __pyx_L3_error)
10435 __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
10436 __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
10437 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
10438 goto __pyx_L10_try_end;
10440 __Pyx_PyThreadState_assign
10448 __pyx_t_4 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0])));
10450 __Pyx_AddTraceback(
"numpy.import_ufunc", __pyx_clineno, __pyx_lineno, __pyx_filename);
10451 if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(1, 1000, __pyx_L5_except_error)
10452 __Pyx_GOTREF(__pyx_t_5);
10453 __Pyx_GOTREF(__pyx_t_6);
10454 __Pyx_GOTREF(__pyx_t_7);
10461 __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_ImportError, __pyx_tuple__13, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 1001, __pyx_L5_except_error)
10462 __Pyx_GOTREF(__pyx_t_8);
10463 __Pyx_Raise(__pyx_t_8, 0, 0, 0);
10464 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
10465 __PYX_ERR(1, 1001, __pyx_L5_except_error)
10467 goto __pyx_L5_except_error;
10468 __pyx_L5_except_error:;
10477 __Pyx_PyThreadState_assign
10478 __Pyx_XGIVEREF(__pyx_t_1);
10479 __Pyx_XGIVEREF(__pyx_t_2);
10480 __Pyx_XGIVEREF(__pyx_t_3);
10481 __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
10482 goto __pyx_L1_error;
10483 __pyx_L10_try_end:;
10498 __Pyx_XDECREF(__pyx_t_5);
10499 __Pyx_XDECREF(__pyx_t_6);
10500 __Pyx_XDECREF(__pyx_t_7);
10501 __Pyx_XDECREF(__pyx_t_8);
10502 __Pyx_AddTraceback("numpy.import_ufunc", __pyx_clineno, __pyx_lineno, __pyx_filename);
10505 __Pyx_RefNannyFinishContext();
10517 static
amns_c_reactant_type __pyx_convert__from_py_amns_c_reactant_type(PyObject *__pyx_v_obj) {
10519 PyObject *__pyx_v_value = NULL;
10521 __Pyx_RefNannyDeclarations
10523 PyObject *__pyx_t_2 = NULL;
10524 PyObject *__pyx_t_3 = NULL;
10525 PyObject *__pyx_t_4 = NULL;
10526 PyObject *__pyx_t_5 = NULL;
10528 PyObject *__pyx_t_7 = NULL;
10529 PyObject *__pyx_t_8 = NULL;
10530 PyObject *__pyx_t_9 = NULL;
10532 __Pyx_RefNannySetupContext(
"__pyx_convert__from_py_amns_c_reactant_type", 0);
10541 __pyx_t_1 = ((!(PyMapping_Check(__pyx_v_obj) != 0)) != 0);
10551 __pyx_t_2 = PyErr_Format(__pyx_builtin_TypeError, ((
char const *)
"Expected %.16s, got %.200s"), ((
char *)
"a mapping"), Py_TYPE(__pyx_v_obj)->tp_name);
if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 14, __pyx_L1_error)
10552 __Pyx_GOTREF(__pyx_t_2);
10553 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
10572 __Pyx_PyThreadState_declare
10573 __Pyx_PyThreadState_assign
10574 __Pyx_ExceptionSave(&__pyx_t_3, &__pyx_t_4, &__pyx_t_5);
10575 __Pyx_XGOTREF(__pyx_t_3);
10576 __Pyx_XGOTREF(__pyx_t_4);
10577 __Pyx_XGOTREF(__pyx_t_5);
10587 __pyx_t_2 = PyObject_GetItem(__pyx_v_obj, __pyx_n_s_ZN);
if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 17, __pyx_L4_error)
10588 __Pyx_GOTREF(__pyx_t_2);
10589 __pyx_v_value = __pyx_t_2;
10600 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
10601 __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
10602 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
10603 goto __pyx_L11_try_end;
10605 __Pyx_PyThreadState_assign
10606 __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
10615 __pyx_t_6 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_KeyError);
10617 __Pyx_AddTraceback(
"FromPyStructUtility.__pyx_convert__from_py_amns_c_reactant_type", __pyx_clineno, __pyx_lineno, __pyx_filename);
10618 if (__Pyx_GetException(&__pyx_t_2, &__pyx_t_7, &__pyx_t_8) < 0) __PYX_ERR(2, 18, __pyx_L6_except_error)
10619 __Pyx_GOTREF(__pyx_t_2);
10620 __Pyx_GOTREF(__pyx_t_7);
10621 __Pyx_GOTREF(__pyx_t_8);
10630 __pyx_t_9 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__14, NULL); if (unlikely(!__pyx_t_9)) __PYX_ERR(2, 19, __pyx_L6_except_error)
10631 __Pyx_GOTREF(__pyx_t_9);
10632 __Pyx_Raise(__pyx_t_9, 0, 0, 0);
10633 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
10634 __PYX_ERR(2, 19, __pyx_L6_except_error)
10636 goto __pyx_L6_except_error;
10637 __pyx_L6_except_error:;
10646 __Pyx_PyThreadState_assign
10647 __Pyx_XGIVEREF(__pyx_t_3);
10648 __Pyx_XGIVEREF(__pyx_t_4);
10649 __Pyx_XGIVEREF(__pyx_t_5);
10650 __Pyx_ExceptionReset(__pyx_t_3, __pyx_t_4, __pyx_t_5);
10651 goto __pyx_L1_error;
10652 __pyx_L11_try_end:;
10662 __pyx_t_10 = __pyx_PyFloat_AsDouble(__pyx_v_value); if (unlikely((__pyx_t_10 == (
double)-1) && PyErr_Occurred())) __PYX_ERR(2, 20, __pyx_L1_error)
10663 __pyx_v_result.ZN = __pyx_t_10;
10673 __Pyx_PyThreadState_declare
10674 __Pyx_PyThreadState_assign
10675 __Pyx_ExceptionSave(&__pyx_t_5, &__pyx_t_4, &__pyx_t_3);
10676 __Pyx_XGOTREF(__pyx_t_5);
10677 __Pyx_XGOTREF(__pyx_t_4);
10678 __Pyx_XGOTREF(__pyx_t_3);
10688 __pyx_t_8 = PyObject_GetItem(__pyx_v_obj, __pyx_n_s_ZA);
if (unlikely(!__pyx_t_8)) __PYX_ERR(2, 22, __pyx_L14_error)
10689 __Pyx_GOTREF(__pyx_t_8);
10690 __Pyx_DECREF_SET(__pyx_v_value, __pyx_t_8);
10701 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
10702 __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
10703 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
10704 goto __pyx_L21_try_end;
10706 __Pyx_PyThreadState_assign
10707 __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
10708 __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
10709 __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
10710 __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
10719 __pyx_t_6 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_KeyError);
10721 __Pyx_AddTraceback(
"FromPyStructUtility.__pyx_convert__from_py_amns_c_reactant_type", __pyx_clineno, __pyx_lineno, __pyx_filename);
10722 if (__Pyx_GetException(&__pyx_t_8, &__pyx_t_7, &__pyx_t_2) < 0) __PYX_ERR(2, 23, __pyx_L16_except_error)
10723 __Pyx_GOTREF(__pyx_t_8);
10724 __Pyx_GOTREF(__pyx_t_7);
10725 __Pyx_GOTREF(__pyx_t_2);
10734 __pyx_t_9 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__15, NULL); if (unlikely(!__pyx_t_9)) __PYX_ERR(2, 24, __pyx_L16_except_error)
10735 __Pyx_GOTREF(__pyx_t_9);
10736 __Pyx_Raise(__pyx_t_9, 0, 0, 0);
10737 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
10738 __PYX_ERR(2, 24, __pyx_L16_except_error)
10740 goto __pyx_L16_except_error;
10741 __pyx_L16_except_error:;
10750 __Pyx_PyThreadState_assign
10751 __Pyx_XGIVEREF(__pyx_t_5);
10752 __Pyx_XGIVEREF(__pyx_t_4);
10753 __Pyx_XGIVEREF(__pyx_t_3);
10754 __Pyx_ExceptionReset(__pyx_t_5, __pyx_t_4, __pyx_t_3);
10755 goto __pyx_L1_error;
10756 __pyx_L21_try_end:;
10766 __pyx_t_10 = __pyx_PyFloat_AsDouble(__pyx_v_value); if (unlikely((__pyx_t_10 == (
double)-1) && PyErr_Occurred())) __PYX_ERR(2, 25, __pyx_L1_error)
10767 __pyx_v_result.
ZA = __pyx_t_10;
10777 __Pyx_PyThreadState_declare
10778 __Pyx_PyThreadState_assign
10779 __Pyx_ExceptionSave(&__pyx_t_3, &__pyx_t_4, &__pyx_t_5);
10780 __Pyx_XGOTREF(__pyx_t_3);
10781 __Pyx_XGOTREF(__pyx_t_4);
10782 __Pyx_XGOTREF(__pyx_t_5);
10792 __pyx_t_2 = PyObject_GetItem(__pyx_v_obj, __pyx_n_s_MI);
if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 27, __pyx_L24_error)
10793 __Pyx_GOTREF(__pyx_t_2);
10794 __Pyx_DECREF_SET(__pyx_v_value, __pyx_t_2);
10805 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
10806 __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
10807 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
10808 goto __pyx_L31_try_end;
10810 __Pyx_PyThreadState_assign
10811 __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
10812 __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
10813 __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
10814 __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
10823 __pyx_t_6 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_KeyError);
10825 __Pyx_AddTraceback(
"FromPyStructUtility.__pyx_convert__from_py_amns_c_reactant_type", __pyx_clineno, __pyx_lineno, __pyx_filename);
10826 if (__Pyx_GetException(&__pyx_t_2, &__pyx_t_7, &__pyx_t_8) < 0) __PYX_ERR(2, 28, __pyx_L26_except_error)
10827 __Pyx_GOTREF(__pyx_t_2);
10828 __Pyx_GOTREF(__pyx_t_7);
10829 __Pyx_GOTREF(__pyx_t_8);
10838 __pyx_t_9 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__16, NULL); if (unlikely(!__pyx_t_9)) __PYX_ERR(2, 29, __pyx_L26_except_error)
10839 __Pyx_GOTREF(__pyx_t_9);
10840 __Pyx_Raise(__pyx_t_9, 0, 0, 0);
10841 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
10842 __PYX_ERR(2, 29, __pyx_L26_except_error)
10844 goto __pyx_L26_except_error;
10845 __pyx_L26_except_error:;
10854 __Pyx_PyThreadState_assign
10855 __Pyx_XGIVEREF(__pyx_t_3);
10856 __Pyx_XGIVEREF(__pyx_t_4);
10857 __Pyx_XGIVEREF(__pyx_t_5);
10858 __Pyx_ExceptionReset(__pyx_t_3, __pyx_t_4, __pyx_t_5);
10859 goto __pyx_L1_error;
10860 __pyx_L31_try_end:;
10870 __pyx_t_10 = __pyx_PyFloat_AsDouble(__pyx_v_value); if (unlikely((__pyx_t_10 == (
double)-1) && PyErr_Occurred())) __PYX_ERR(2, 30, __pyx_L1_error)
10871 __pyx_v_result.MI = __pyx_t_10;
10881 __Pyx_PyThreadState_declare
10882 __Pyx_PyThreadState_assign
10883 __Pyx_ExceptionSave(&__pyx_t_5, &__pyx_t_4, &__pyx_t_3);
10884 __Pyx_XGOTREF(__pyx_t_5);
10885 __Pyx_XGOTREF(__pyx_t_4);
10886 __Pyx_XGOTREF(__pyx_t_3);
10896 __pyx_t_8 = PyObject_GetItem(__pyx_v_obj, __pyx_n_s_LR);
if (unlikely(!__pyx_t_8)) __PYX_ERR(2, 32, __pyx_L34_error)
10897 __Pyx_GOTREF(__pyx_t_8);
10898 __Pyx_DECREF_SET(__pyx_v_value, __pyx_t_8);
10909 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
10910 __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
10911 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
10912 goto __pyx_L41_try_end;
10914 __Pyx_PyThreadState_assign
10915 __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
10916 __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
10917 __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
10918 __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
10927 __pyx_t_6 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_KeyError);
10929 __Pyx_AddTraceback(
"FromPyStructUtility.__pyx_convert__from_py_amns_c_reactant_type", __pyx_clineno, __pyx_lineno, __pyx_filename);
10930 if (__Pyx_GetException(&__pyx_t_8, &__pyx_t_7, &__pyx_t_2) < 0) __PYX_ERR(2, 33, __pyx_L36_except_error)
10931 __Pyx_GOTREF(__pyx_t_8);
10932 __Pyx_GOTREF(__pyx_t_7);
10933 __Pyx_GOTREF(__pyx_t_2);
10942 __pyx_t_9 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__17, NULL); if (unlikely(!__pyx_t_9)) __PYX_ERR(2, 34, __pyx_L36_except_error)
10943 __Pyx_GOTREF(__pyx_t_9);
10944 __Pyx_Raise(__pyx_t_9, 0, 0, 0);
10945 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
10946 __PYX_ERR(2, 34, __pyx_L36_except_error)
10948 goto __pyx_L36_except_error;
10949 __pyx_L36_except_error:;
10958 __Pyx_PyThreadState_assign
10959 __Pyx_XGIVEREF(__pyx_t_5);
10960 __Pyx_XGIVEREF(__pyx_t_4);
10961 __Pyx_XGIVEREF(__pyx_t_3);
10962 __Pyx_ExceptionReset(__pyx_t_5, __pyx_t_4, __pyx_t_3);
10963 goto __pyx_L1_error;
10964 __pyx_L41_try_end:;
10974 __pyx_t_6 = __Pyx_PyInt_As_int(__pyx_v_value); if (unlikely((__pyx_t_6 == (
int)-1) && PyErr_Occurred())) __PYX_ERR(2, 35, __pyx_L1_error)
10975 __pyx_v_result.LR = __pyx_t_6;
10985 __Pyx_PyThreadState_declare
10986 __Pyx_PyThreadState_assign
10987 __Pyx_ExceptionSave(&__pyx_t_3, &__pyx_t_4, &__pyx_t_5);
10988 __Pyx_XGOTREF(__pyx_t_3);
10989 __Pyx_XGOTREF(__pyx_t_4);
10990 __Pyx_XGOTREF(__pyx_t_5);
11000 __pyx_t_2 = PyObject_GetItem(__pyx_v_obj, __pyx_n_s_real_specifier);
if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 37, __pyx_L44_error)
11001 __Pyx_GOTREF(__pyx_t_2);
11002 __Pyx_DECREF_SET(__pyx_v_value, __pyx_t_2);
11013 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
11014 __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
11015 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
11016 goto __pyx_L51_try_end;
11018 __Pyx_PyThreadState_assign
11019 __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
11020 __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
11021 __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
11022 __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
11031 __pyx_t_6 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_KeyError);
11033 __Pyx_AddTraceback(
"FromPyStructUtility.__pyx_convert__from_py_amns_c_reactant_type", __pyx_clineno, __pyx_lineno, __pyx_filename);
11034 if (__Pyx_GetException(&__pyx_t_2, &__pyx_t_7, &__pyx_t_8) < 0) __PYX_ERR(2, 38, __pyx_L46_except_error)
11035 __Pyx_GOTREF(__pyx_t_2);
11036 __Pyx_GOTREF(__pyx_t_7);
11037 __Pyx_GOTREF(__pyx_t_8);
11046 __pyx_t_9 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__18, NULL); if (unlikely(!__pyx_t_9)) __PYX_ERR(2, 39, __pyx_L46_except_error)
11047 __Pyx_GOTREF(__pyx_t_9);
11048 __Pyx_Raise(__pyx_t_9, 0, 0, 0);
11049 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
11050 __PYX_ERR(2, 39, __pyx_L46_except_error)
11052 goto __pyx_L46_except_error;
11053 __pyx_L46_except_error:;
11062 __Pyx_PyThreadState_assign
11063 __Pyx_XGIVEREF(__pyx_t_3);
11064 __Pyx_XGIVEREF(__pyx_t_4);
11065 __Pyx_XGIVEREF(__pyx_t_5);
11066 __Pyx_ExceptionReset(__pyx_t_3, __pyx_t_4, __pyx_t_5);
11067 goto __pyx_L1_error;
11068 __pyx_L51_try_end:;
11078 __pyx_t_10 = __pyx_PyFloat_AsDouble(__pyx_v_value); if (unlikely((__pyx_t_10 == (
double)-1) && PyErr_Occurred())) __PYX_ERR(2, 40, __pyx_L1_error)
11079 __pyx_v_result.real_specifier = __pyx_t_10;
11089 __Pyx_PyThreadState_declare
11090 __Pyx_PyThreadState_assign
11091 __Pyx_ExceptionSave(&__pyx_t_5, &__pyx_t_4, &__pyx_t_3);
11092 __Pyx_XGOTREF(__pyx_t_5);
11093 __Pyx_XGOTREF(__pyx_t_4);
11094 __Pyx_XGOTREF(__pyx_t_3);
11104 __pyx_t_8 = PyObject_GetItem(__pyx_v_obj, __pyx_n_s_int_specifier);
if (unlikely(!__pyx_t_8)) __PYX_ERR(2, 42, __pyx_L54_error)
11105 __Pyx_GOTREF(__pyx_t_8);
11106 __Pyx_DECREF_SET(__pyx_v_value, __pyx_t_8);
11117 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
11118 __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
11119 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
11120 goto __pyx_L61_try_end;
11122 __Pyx_PyThreadState_assign
11123 __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
11124 __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
11125 __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
11126 __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
11135 __pyx_t_6 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_KeyError);
11137 __Pyx_AddTraceback(
"FromPyStructUtility.__pyx_convert__from_py_amns_c_reactant_type", __pyx_clineno, __pyx_lineno, __pyx_filename);
11138 if (__Pyx_GetException(&__pyx_t_8, &__pyx_t_7, &__pyx_t_2) < 0) __PYX_ERR(2, 43, __pyx_L56_except_error)
11139 __Pyx_GOTREF(__pyx_t_8);
11140 __Pyx_GOTREF(__pyx_t_7);
11141 __Pyx_GOTREF(__pyx_t_2);
11150 __pyx_t_9 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__19, NULL); if (unlikely(!__pyx_t_9)) __PYX_ERR(2, 44, __pyx_L56_except_error)
11151 __Pyx_GOTREF(__pyx_t_9);
11152 __Pyx_Raise(__pyx_t_9, 0, 0, 0);
11153 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
11154 __PYX_ERR(2, 44, __pyx_L56_except_error)
11156 goto __pyx_L56_except_error;
11157 __pyx_L56_except_error:;
11166 __Pyx_PyThreadState_assign
11167 __Pyx_XGIVEREF(__pyx_t_5);
11168 __Pyx_XGIVEREF(__pyx_t_4);
11169 __Pyx_XGIVEREF(__pyx_t_3);
11170 __Pyx_ExceptionReset(__pyx_t_5, __pyx_t_4, __pyx_t_3);
11171 goto __pyx_L1_error;
11172 __pyx_L61_try_end:;
11182 __pyx_t_6 = __Pyx_PyInt_As_int(__pyx_v_value); if (unlikely((__pyx_t_6 == (
int)-1) && PyErr_Occurred())) __PYX_ERR(2, 45, __pyx_L1_error)
11183 __pyx_v_result.int_specifier = __pyx_t_6;
11192 __pyx_r = __pyx_v_result;
11205 __Pyx_XDECREF(__pyx_t_2);
11206 __Pyx_XDECREF(__pyx_t_7);
11207 __Pyx_XDECREF(__pyx_t_8);
11208 __Pyx_XDECREF(__pyx_t_9);
11209 __Pyx_AddTraceback("FromPyStructUtility.__pyx_convert__from_py_amns_c_reactant_type", __pyx_clineno, __pyx_lineno, __pyx_filename);
11211 __Pyx_XDECREF(__pyx_v_value);
11212 __Pyx_RefNannyFinishContext();
11215 static struct __pyx_vtabstruct_4amns_Amns __pyx_vtable_4amns_Amns;
11217 static PyObject *__pyx_tp_new_4amns_Amns(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
11218 struct __pyx_obj_4amns_Amns *p;
11220 if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) {
11221 o = (*t->tp_alloc)(t, 0);
11223 o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0);
11225 if (unlikely(!o))
return 0;
11226 p = ((
struct __pyx_obj_4amns_Amns *)o);
11227 p->__pyx_vtab = __pyx_vtabptr_4amns_Amns;
11231 static void __pyx_tp_dealloc_4amns_Amns(PyObject *o) {
11232 #if PY_VERSION_HEX >= 0x030400a1
11233 if (unlikely(Py_TYPE(o)->tp_finalize) && (!PyType_IS_GC(Py_TYPE(o)) || !_PyGC_FINALIZED(o))) {
11234 if (PyObject_CallFinalizerFromDealloc(o))
return;
11237 (*Py_TYPE(o)->tp_free)(o);
11240 static PyObject *__pyx_getprop_4amns_4Amns_version(PyObject *o, CYTHON_UNUSED
void *x) {
11241 return __pyx_pw_4amns_4Amns_7version_1__get__(o);
11244 static PyMethodDef __pyx_methods_4amns_Amns[] = {
11245 {
"_setup", (PyCFunction)__pyx_pw_4amns_4Amns_3_setup, METH_VARARGS|METH_KEYWORDS, __pyx_doc_4amns_4Amns_2_setup},
11246 {
"query", (PyCFunction)__pyx_pw_4amns_4Amns_5query, METH_O, __pyx_doc_4amns_4Amns_4query},
11247 {
"set", (PyCFunction)__pyx_pw_4amns_4Amns_7set, METH_O, __pyx_doc_4amns_4Amns_6set},
11248 {
"finalize", (PyCFunction)__pyx_pw_4amns_4Amns_9finalize, METH_NOARGS, __pyx_doc_4amns_4Amns_8finalize},
11249 {
"get_table", (PyCFunction)__pyx_pw_4amns_4Amns_11get_table, METH_VARARGS|METH_KEYWORDS, __pyx_doc_4amns_4Amns_10get_table},
11253 static struct PyGetSetDef __pyx_getsets_4amns_Amns[] = {
11254 {(
char *)
"version", __pyx_getprop_4amns_4Amns_version, 0, (
char *)
"Query for version of the AMNS data", 0},
11258 static PyTypeObject __pyx_type_4amns_Amns = {
11259 PyVarObject_HEAD_INIT(0, 0)
11261 sizeof(
struct __pyx_obj_4amns_Amns),
11263 __pyx_tp_dealloc_4amns_Amns,
11267 #if PY_MAJOR_VERSION < 3
11270 #if PY_MAJOR_VERSION >= 3
11283 Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE,
11291 __pyx_methods_4amns_Amns,
11293 __pyx_getsets_4amns_Amns,
11299 __pyx_pw_4amns_4Amns_1__init__,
11301 __pyx_tp_new_4amns_Amns,
11311 #if PY_VERSION_HEX >= 0x030400a1
11315 static struct __pyx_vtabstruct_4amns_Table __pyx_vtable_4amns_Table;
11317 static PyObject *__pyx_tp_new_4amns_Table(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
11318 struct __pyx_obj_4amns_Table *p;
11320 if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) {
11321 o = (*t->tp_alloc)(t, 0);
11323 o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0);
11325 if (unlikely(!o))
return 0;
11326 p = ((
struct __pyx_obj_4amns_Table *)o);
11327 p->__pyx_vtab = __pyx_vtabptr_4amns_Table;
11328 p->_parentAmns = ((
struct __pyx_obj_4amns_Amns *)Py_None); Py_INCREF(Py_None);
11332 static void __pyx_tp_dealloc_4amns_Table(PyObject *o) {
11333 struct __pyx_obj_4amns_Table *p = (
struct __pyx_obj_4amns_Table *)o;
11334 #if PY_VERSION_HEX >= 0x030400a1
11335 if (unlikely(Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) {
11336 if (PyObject_CallFinalizerFromDealloc(o))
return;
11339 PyObject_GC_UnTrack(o);
11340 Py_CLEAR(p->_parentAmns);
11341 (*Py_TYPE(o)->tp_free)(o);
11344 static int __pyx_tp_traverse_4amns_Table(PyObject *o, visitproc v,
void *a) {
11346 struct __pyx_obj_4amns_Table *p = (
struct __pyx_obj_4amns_Table *)o;
11347 if (p->_parentAmns) {
11348 e = (*v)(((PyObject*)p->_parentAmns), a);
if (e)
return e;
11353 static int __pyx_tp_clear_4amns_Table(PyObject *o) {
11355 struct __pyx_obj_4amns_Table *p = (
struct __pyx_obj_4amns_Table *)o;
11356 tmp = ((PyObject*)p->_parentAmns);
11357 p->_parentAmns = ((
struct __pyx_obj_4amns_Amns *)Py_None); Py_INCREF(Py_None);
11362 static PyObject *__pyx_getprop_4amns_5Table_no_of_reactants(PyObject *o, CYTHON_UNUSED
void *x) {
11363 return __pyx_pw_4amns_5Table_15no_of_reactants_1__get__(o);
11366 static PyObject *__pyx_getprop_4amns_5Table_ndim(PyObject *o, CYTHON_UNUSED
void *x) {
11367 return __pyx_pw_4amns_5Table_4ndim_1__get__(o);
11370 static PyObject *__pyx_getprop_4amns_5Table_source(PyObject *o, CYTHON_UNUSED
void *x) {
11371 return __pyx_pw_4amns_5Table_6source_1__get__(o);
11374 static PyObject *__pyx_getprop_4amns_5Table_filled(PyObject *o, CYTHON_UNUSED
void *x) {
11375 return __pyx_pw_4amns_5Table_6filled_1__get__(o);
11378 static PyObject *__pyx_getprop_4amns_5Table_reaction_type(PyObject *o, CYTHON_UNUSED
void *x) {
11379 return __pyx_pw_4amns_5Table_13reaction_type_1__get__(o);
11382 static PyObject *__pyx_getprop_4amns_5Table_reactants(PyObject *o, CYTHON_UNUSED
void *x) {
11383 return __pyx_pw_4amns_5Table_9reactants_1__get__(o);
11386 static PyObject *__pyx_getprop_4amns_5Table_version(PyObject *o, CYTHON_UNUSED
void *x) {
11387 return __pyx_pw_4amns_5Table_7version_1__get__(o);
11390 static PyObject *__pyx_getprop_4amns_5Table_state_label(PyObject *o, CYTHON_UNUSED
void *x) {
11391 return __pyx_pw_4amns_5Table_11state_label_1__get__(o);
11394 static PyObject *__pyx_getprop_4amns_5Table_result_unit(PyObject *o, CYTHON_UNUSED
void *x) {
11395 return __pyx_pw_4amns_5Table_11result_unit_1__get__(o);
11398 static PyObject *__pyx_getprop_4amns_5Table_result_label(PyObject *o, CYTHON_UNUSED
void *x) {
11399 return __pyx_pw_4amns_5Table_12result_label_1__get__(o);
11402 static PyObject *__pyx_getprop_4amns_5Table_interp_fun(PyObject *o, CYTHON_UNUSED
void *x) {
11403 return __pyx_pw_4amns_5Table_10interp_fun_1__get__(o);
11406 static PyMethodDef __pyx_methods_4amns_Table[] = {
11407 {
"query", (PyCFunction)__pyx_pw_4amns_5Table_3query, METH_O, __pyx_doc_4amns_5Table_2query},
11408 {
"set", (PyCFunction)__pyx_pw_4amns_5Table_5set, METH_O, __pyx_doc_4amns_5Table_4set},
11409 {
"finalize", (PyCFunction)__pyx_pw_4amns_5Table_7finalize, METH_NOARGS, __pyx_doc_4amns_5Table_6finalize},
11410 {
"data", (PyCFunction)__pyx_pw_4amns_5Table_9data, METH_VARARGS|METH_KEYWORDS, __pyx_doc_4amns_5Table_8data},
11411 {
"_data_1d", (PyCFunction)__pyx_pw_4amns_5Table_11_data_1d, METH_VARARGS|METH_KEYWORDS, 0},
11412 {
"_data_2d", (PyCFunction)__pyx_pw_4amns_5Table_13_data_2d, METH_VARARGS|METH_KEYWORDS, 0},
11413 {
"_data_3d", (PyCFunction)__pyx_pw_4amns_5Table_15_data_3d, METH_VARARGS|METH_KEYWORDS, 0},
11417 static struct PyGetSetDef __pyx_getsets_4amns_Table[] = {
11418 {(
char *)
"no_of_reactants", __pyx_getprop_4amns_5Table_no_of_reactants, 0, (
char *)
"Query for no_of_reactants associated with the AMNS table", 0},
11419 {(
char *)
"ndim", __pyx_getprop_4amns_5Table_ndim, 0, (
char *)
"Query for ndim associated with the AMNS table", 0},
11420 {(
char *)
"source", __pyx_getprop_4amns_5Table_source, 0, (
char *)
"Query for source associated with the AMNS table", 0},
11421 {(
char *)
"filled", __pyx_getprop_4amns_5Table_filled, 0, (
char *)
"Query for filled status associated with the AMNS table", 0},
11422 {(
char *)
"reaction_type", __pyx_getprop_4amns_5Table_reaction_type, 0, (
char *)
"Query for reaction_type associated with the AMNS table", 0},
11423 {(
char *)
"reactants", __pyx_getprop_4amns_5Table_reactants, 0, (
char *)
"Query for reactants associated with the AMNS table", 0},
11424 {(
char *)
"version", __pyx_getprop_4amns_5Table_version, 0, (
char *)
"Query for version associated with the AMNS table", 0},
11425 {(
char *)
"state_label", __pyx_getprop_4amns_5Table_state_label, 0, (
char *)
"Query for state_label associated with the AMNS table", 0},
11426 {(
char *)
"result_unit", __pyx_getprop_4amns_5Table_result_unit, 0, (
char *)
"Query for result_unit associated with the AMNS table", 0},
11427 {(
char *)
"result_label", __pyx_getprop_4amns_5Table_result_label, 0, (
char *)
"Query for result_label associated with the AMNS table", 0},
11428 {(
char *)
"interp_fun", __pyx_getprop_4amns_5Table_interp_fun, 0, (
char *)
"Query for interp_fun associated with the AMNS table", 0},
11432 static PyTypeObject __pyx_type_4amns_Table = {
11433 PyVarObject_HEAD_INIT(0, 0)
11435 sizeof(
struct __pyx_obj_4amns_Table),
11437 __pyx_tp_dealloc_4amns_Table,
11441 #if PY_MAJOR_VERSION < 3
11444 #if PY_MAJOR_VERSION >= 3
11457 Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC,
11459 __pyx_tp_traverse_4amns_Table,
11460 __pyx_tp_clear_4amns_Table,
11465 __pyx_methods_4amns_Table,
11467 __pyx_getsets_4amns_Table,
11473 __pyx_pw_4amns_5Table_1__init__,
11475 __pyx_tp_new_4amns_Table,
11485 #if PY_VERSION_HEX >= 0x030400a1
11489 static struct __pyx_vtabstruct_4amns_Reactants __pyx_vtable_4amns_Reactants;
11491 static PyObject *__pyx_tp_new_4amns_Reactants(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
11492 struct __pyx_obj_4amns_Reactants *p;
11494 if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) {
11495 o = (*t->tp_alloc)(t, 0);
11497 o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0);
11499 if (unlikely(!o))
return 0;
11500 p = ((
struct __pyx_obj_4amns_Reactants *)o);
11501 p->__pyx_vtab = __pyx_vtabptr_4amns_Reactants;
11502 p->_reactants = Py_None; Py_INCREF(Py_None);
11503 if (unlikely(__pyx_pw_4amns_9Reactants_1__cinit__(o, __pyx_empty_tuple, NULL) < 0))
goto bad;
11506 Py_DECREF(o); o = 0;
11510 static void __pyx_tp_dealloc_4amns_Reactants(PyObject *o) {
11511 struct __pyx_obj_4amns_Reactants *p = (
struct __pyx_obj_4amns_Reactants *)o;
11512 #if PY_VERSION_HEX >= 0x030400a1
11513 if (unlikely(Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) {
11514 if (PyObject_CallFinalizerFromDealloc(o))
return;
11517 PyObject_GC_UnTrack(o);
11518 Py_CLEAR(p->_reactants);
11519 (*Py_TYPE(o)->tp_free)(o);
11522 static int __pyx_tp_traverse_4amns_Reactants(PyObject *o, visitproc v,
void *a) {
11524 struct __pyx_obj_4amns_Reactants *p = (
struct __pyx_obj_4amns_Reactants *)o;
11525 if (p->_reactants) {
11526 e = (*v)(p->_reactants, a);
if (e)
return e;
11531 static int __pyx_tp_clear_4amns_Reactants(PyObject *o) {
11533 struct __pyx_obj_4amns_Reactants *p = (
struct __pyx_obj_4amns_Reactants *)o;
11534 tmp = ((PyObject*)p->_reactants);
11535 p->_reactants = Py_None; Py_INCREF(Py_None);
11540 static PyMethodDef __pyx_methods_4amns_Reactants[] = {
11541 {
"_invalidate_handle", (PyCFunction)__pyx_pw_4amns_9Reactants_5_invalidate_handle, METH_NOARGS, 0},
11542 {
"add", (PyCFunction)__pyx_pw_4amns_9Reactants_7add, METH_VARARGS|METH_KEYWORDS, __pyx_doc_4amns_9Reactants_6add},
11543 {
"test", (PyCFunction)__pyx_pw_4amns_9Reactants_13test, METH_NOARGS, 0},
11544 {
"value", (PyCFunction)__pyx_pw_4amns_9Reactants_15value, METH_NOARGS, __pyx_doc_4amns_9Reactants_14value},
11548 static PySequenceMethods __pyx_tp_as_sequence_Reactants = {
11549 __pyx_pw_4amns_9Reactants_9__len__,
11561 static PyMappingMethods __pyx_tp_as_mapping_Reactants = {
11562 __pyx_pw_4amns_9Reactants_9__len__,
11567 static PyTypeObject __pyx_type_4amns_Reactants = {
11568 PyVarObject_HEAD_INIT(0, 0)
11570 sizeof(
struct __pyx_obj_4amns_Reactants),
11572 __pyx_tp_dealloc_4amns_Reactants,
11576 #if PY_MAJOR_VERSION < 3
11579 #if PY_MAJOR_VERSION >= 3
11584 &__pyx_tp_as_sequence_Reactants,
11585 &__pyx_tp_as_mapping_Reactants,
11588 __pyx_pw_4amns_9Reactants_11__str__,
11592 Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC,
11594 __pyx_tp_traverse_4amns_Reactants,
11595 __pyx_tp_clear_4amns_Reactants,
11600 __pyx_methods_4amns_Reactants,
11608 __pyx_pw_4amns_9Reactants_3__init__,
11610 __pyx_tp_new_4amns_Reactants,
11620 #if PY_VERSION_HEX >= 0x030400a1
11625 static PyMethodDef __pyx_methods[] = {
11629 #if PY_MAJOR_VERSION >= 3
11630 static struct PyModuleDef __pyx_moduledef = {
11631 #if PY_VERSION_HEX < 0x03020000
11632 { PyObject_HEAD_INIT(NULL) NULL, 0, NULL },
11634 PyModuleDef_HEAD_INIT,
11647 static __Pyx_StringTabEntry __pyx_string_tab[] = {
11648 {&__pyx_n_s_AmnsException, __pyx_k_AmnsException,
sizeof(__pyx_k_AmnsException), 0, 0, 1, 1},
11649 {&__pyx_n_s_F, __pyx_k_F,
sizeof(__pyx_k_F), 0, 0, 1, 1},
11650 {&__pyx_kp_u_Format_string_allocated_too_shor, __pyx_k_Format_string_allocated_too_shor,
sizeof(__pyx_k_Format_string_allocated_too_shor), 0, 1, 0, 0},
11651 {&__pyx_kp_u_Format_string_allocated_too_shor_2, __pyx_k_Format_string_allocated_too_shor_2,
sizeof(__pyx_k_Format_string_allocated_too_shor_2), 0, 1, 0, 0},
11652 {&__pyx_n_s_ImportError, __pyx_k_ImportError,
sizeof(__pyx_k_ImportError), 0, 0, 1, 1},
11653 {&__pyx_n_s_KeyError, __pyx_k_KeyError,
sizeof(__pyx_k_KeyError), 0, 0, 1, 1},
11654 {&__pyx_n_s_LR, __pyx_k_LR,
sizeof(__pyx_k_LR), 0, 0, 1, 1},
11655 {&__pyx_n_s_MI, __pyx_k_MI,
sizeof(__pyx_k_MI), 0, 0, 1, 1},
11656 {&__pyx_kp_s_No_value_specified_for_struct_at, __pyx_k_No_value_specified_for_struct_at,
sizeof(__pyx_k_No_value_specified_for_struct_at), 0, 0, 1, 0},
11657 {&__pyx_kp_s_No_value_specified_for_struct_at_2, __pyx_k_No_value_specified_for_struct_at_2,
sizeof(__pyx_k_No_value_specified_for_struct_at_2), 0, 0, 1, 0},
11658 {&__pyx_kp_s_No_value_specified_for_struct_at_3, __pyx_k_No_value_specified_for_struct_at_3,
sizeof(__pyx_k_No_value_specified_for_struct_at_3), 0, 0, 1, 0},
11659 {&__pyx_kp_s_No_value_specified_for_struct_at_4, __pyx_k_No_value_specified_for_struct_at_4,
sizeof(__pyx_k_No_value_specified_for_struct_at_4), 0, 0, 1, 0},
11660 {&__pyx_kp_s_No_value_specified_for_struct_at_5, __pyx_k_No_value_specified_for_struct_at_5,
sizeof(__pyx_k_No_value_specified_for_struct_at_5), 0, 0, 1, 0},
11661 {&__pyx_kp_s_No_value_specified_for_struct_at_6, __pyx_k_No_value_specified_for_struct_at_6,
sizeof(__pyx_k_No_value_specified_for_struct_at_6), 0, 0, 1, 0},
11662 {&__pyx_kp_u_Non_native_byte_order_not_suppor, __pyx_k_Non_native_byte_order_not_suppor,
sizeof(__pyx_k_Non_native_byte_order_not_suppor), 0, 1, 0, 0},
11663 {&__pyx_kp_s_Number_of_parameters_does_not_ma, __pyx_k_Number_of_parameters_does_not_ma,
sizeof(__pyx_k_Number_of_parameters_does_not_ma), 0, 0, 1, 0},
11664 {&__pyx_n_s_RuntimeError, __pyx_k_RuntimeError,
sizeof(__pyx_k_RuntimeError), 0, 0, 1, 1},
11665 {&__pyx_kp_s_Shape_of_parameter_2_inconsisten, __pyx_k_Shape_of_parameter_2_inconsisten,
sizeof(__pyx_k_Shape_of_parameter_2_inconsisten), 0, 0, 1, 0},
11666 {&__pyx_kp_s_Shape_of_parameter_3_inconsisten, __pyx_k_Shape_of_parameter_3_inconsisten,
sizeof(__pyx_k_Shape_of_parameter_3_inconsisten), 0, 0, 1, 0},
11667 {&__pyx_n_s_TypeError, __pyx_k_TypeError,
sizeof(__pyx_k_TypeError), 0, 0, 1, 1},
11668 {&__pyx_kp_s_Unsupported_rank_of_input_argume, __pyx_k_Unsupported_rank_of_input_argume,
sizeof(__pyx_k_Unsupported_rank_of_input_argume), 0, 0, 1, 0},
11669 {&__pyx_n_s_ValueError, __pyx_k_ValueError,
sizeof(__pyx_k_ValueError), 0, 0, 1, 1},
11670 {&__pyx_n_s_ZA, __pyx_k_ZA,
sizeof(__pyx_k_ZA), 0, 0, 1, 1},
11671 {&__pyx_n_s_ZN, __pyx_k_ZN,
sizeof(__pyx_k_ZN), 0, 0, 1, 1},
11672 {&__pyx_kp_s__2, __pyx_k__2,
sizeof(__pyx_k__2), 0, 0, 1, 0},
11673 {&__pyx_n_s_amns, __pyx_k_amns,
sizeof(__pyx_k_amns), 0, 0, 1, 1},
11674 {&__pyx_n_s_append, __pyx_k_append,
sizeof(__pyx_k_append), 0, 0, 1, 1},
11675 {&__pyx_n_s_backend, __pyx_k_backend,
sizeof(__pyx_k_backend), 0, 0, 1, 1},
11676 {&__pyx_n_s_data_1d, __pyx_k_data_1d,
sizeof(__pyx_k_data_1d), 0, 0, 1, 1},
11677 {&__pyx_n_s_data_2d, __pyx_k_data_2d,
sizeof(__pyx_k_data_2d), 0, 0, 1, 1},
11678 {&__pyx_n_s_data_3d, __pyx_k_data_3d,
sizeof(__pyx_k_data_3d), 0, 0, 1, 1},
11679 {&__pyx_n_s_doc, __pyx_k_doc,
sizeof(__pyx_k_doc), 0, 0, 1, 1},
11680 {&__pyx_n_s_empty_like, __pyx_k_empty_like,
sizeof(__pyx_k_empty_like), 0, 0, 1, 1},
11681 {&__pyx_n_s_end, __pyx_k_end,
sizeof(__pyx_k_end), 0, 0, 1, 1},
11682 {&__pyx_n_s_enumerate, __pyx_k_enumerate,
sizeof(__pyx_k_enumerate), 0, 0, 1, 1},
11683 {&__pyx_n_s_file, __pyx_k_file,
sizeof(__pyx_k_file), 0, 0, 1, 1},
11684 {&__pyx_n_s_filled, __pyx_k_filled,
sizeof(__pyx_k_filled), 0, 0, 1, 1},
11685 {&__pyx_n_s_import, __pyx_k_import,
sizeof(__pyx_k_import), 0, 0, 1, 1},
11686 {&__pyx_n_s_int_specifier, __pyx_k_int_specifier,
sizeof(__pyx_k_int_specifier), 0, 0, 1, 1},
11687 {&__pyx_n_s_interp_fun, __pyx_k_interp_fun,
sizeof(__pyx_k_interp_fun), 0, 0, 1, 1},
11688 {&__pyx_n_s_invalidate_handle, __pyx_k_invalidate_handle,
sizeof(__pyx_k_invalidate_handle), 0, 0, 1, 1},
11689 {&__pyx_n_s_isotope_resolved, __pyx_k_isotope_resolved,
sizeof(__pyx_k_isotope_resolved), 0, 0, 1, 1},
11690 {&__pyx_n_s_lr, __pyx_k_lr,
sizeof(__pyx_k_lr), 0, 0, 1, 1},
11691 {&__pyx_n_s_main, __pyx_k_main,
sizeof(__pyx_k_main), 0, 0, 1, 1},
11692 {&__pyx_n_s_metaclass, __pyx_k_metaclass,
sizeof(__pyx_k_metaclass), 0, 0, 1, 1},
11693 {&__pyx_n_s_mi, __pyx_k_mi,
sizeof(__pyx_k_mi), 0, 0, 1, 1},
11694 {&__pyx_n_s_module, __pyx_k_module,
sizeof(__pyx_k_module), 0, 0, 1, 1},
11695 {&__pyx_kp_u_ndarray_is_not_C_contiguous, __pyx_k_ndarray_is_not_C_contiguous,
sizeof(__pyx_k_ndarray_is_not_C_contiguous), 0, 1, 0, 0},
11696 {&__pyx_kp_u_ndarray_is_not_Fortran_contiguou, __pyx_k_ndarray_is_not_Fortran_contiguou,
sizeof(__pyx_k_ndarray_is_not_Fortran_contiguou), 0, 1, 0, 0},
11697 {&__pyx_n_s_ndim, __pyx_k_ndim,
sizeof(__pyx_k_ndim), 0, 0, 1, 1},
11698 {&__pyx_n_s_no_of_reactants, __pyx_k_no_of_reactants,
sizeof(__pyx_k_no_of_reactants), 0, 0, 1, 1},
11699 {&__pyx_n_s_nowarn, __pyx_k_nowarn,
sizeof(__pyx_k_nowarn), 0, 0, 1, 1},
11700 {&__pyx_n_s_np, __pyx_k_np,
sizeof(__pyx_k_np), 0, 0, 1, 1},
11701 {&__pyx_n_s_number, __pyx_k_number,
sizeof(__pyx_k_number), 0, 0, 1, 1},
11702 {&__pyx_n_s_numpy, __pyx_k_numpy,
sizeof(__pyx_k_numpy), 0, 0, 1, 1},
11703 {&__pyx_kp_s_numpy_core_multiarray_failed_to, __pyx_k_numpy_core_multiarray_failed_to,
sizeof(__pyx_k_numpy_core_multiarray_failed_to), 0, 0, 1, 0},
11704 {&__pyx_kp_s_numpy_core_umath_failed_to_impor, __pyx_k_numpy_core_umath_failed_to_impor,
sizeof(__pyx_k_numpy_core_umath_failed_to_impor), 0, 0, 1, 0},
11705 {&__pyx_n_s_order, __pyx_k_order,
sizeof(__pyx_k_order), 0, 0, 1, 1},
11706 {&__pyx_n_s_p1, __pyx_k_p1,
sizeof(__pyx_k_p1), 0, 0, 1, 1},
11707 {&__pyx_n_s_p2, __pyx_k_p2,
sizeof(__pyx_k_p2), 0, 0, 1, 1},
11708 {&__pyx_n_s_p3, __pyx_k_p3,
sizeof(__pyx_k_p3), 0, 0, 1, 1},
11709 {&__pyx_n_s_parentAmns, __pyx_k_parentAmns,
sizeof(__pyx_k_parentAmns), 0, 0, 1, 1},
11710 {&__pyx_n_s_prepare, __pyx_k_prepare,
sizeof(__pyx_k_prepare), 0, 0, 1, 1},
11711 {&__pyx_n_s_print, __pyx_k_print,
sizeof(__pyx_k_print), 0, 0, 1, 1},
11712 {&__pyx_n_s_pyx_vtable, __pyx_k_pyx_vtable,
sizeof(__pyx_k_pyx_vtable), 0, 0, 1, 1},
11713 {&__pyx_n_s_qualname, __pyx_k_qualname,
sizeof(__pyx_k_qualname), 0, 0, 1, 1},
11714 {&__pyx_n_s_range, __pyx_k_range,
sizeof(__pyx_k_range), 0, 0, 1, 1},
11715 {&__pyx_n_s_reactants, __pyx_k_reactants,
sizeof(__pyx_k_reactants), 0, 0, 1, 1},
11716 {&__pyx_n_s_reactionString, __pyx_k_reactionString,
sizeof(__pyx_k_reactionString), 0, 0, 1, 1},
11717 {&__pyx_n_s_reaction_type, __pyx_k_reaction_type,
sizeof(__pyx_k_reaction_type), 0, 0, 1, 1},
11718 {&__pyx_n_s_real_specifier, __pyx_k_real_specifier,
sizeof(__pyx_k_real_specifier), 0, 0, 1, 1},
11719 {&__pyx_n_s_result_label, __pyx_k_result_label,
sizeof(__pyx_k_result_label), 0, 0, 1, 1},
11720 {&__pyx_n_s_result_unit, __pyx_k_result_unit,
sizeof(__pyx_k_result_unit), 0, 0, 1, 1},
11721 {&__pyx_n_s_set, __pyx_k_set,
sizeof(__pyx_k_set), 0, 0, 1, 1},
11722 {&__pyx_n_s_setup, __pyx_k_setup,
sizeof(__pyx_k_setup), 0, 0, 1, 1},
11723 {&__pyx_n_s_shape, __pyx_k_shape,
sizeof(__pyx_k_shape), 0, 0, 1, 1},
11724 {&__pyx_n_s_source, __pyx_k_source,
sizeof(__pyx_k_source), 0, 0, 1, 1},
11725 {&__pyx_n_s_state_label, __pyx_k_state_label,
sizeof(__pyx_k_state_label), 0, 0, 1, 1},
11726 {&__pyx_n_s_string, __pyx_k_string,
sizeof(__pyx_k_string), 0, 0, 1, 1},
11727 {&__pyx_n_s_test, __pyx_k_test,
sizeof(__pyx_k_test), 0, 0, 1, 1},
11728 {&__pyx_kp_u_unknown_dtype_code_in_numpy_pxd, __pyx_k_unknown_dtype_code_in_numpy_pxd,
sizeof(__pyx_k_unknown_dtype_code_in_numpy_pxd), 0, 1, 0, 0},
11729 {&__pyx_n_s_user, __pyx_k_user,
sizeof(__pyx_k_user), 0, 0, 1, 1},
11730 {&__pyx_n_s_version, __pyx_k_version,
sizeof(__pyx_k_version), 0, 0, 1, 1},
11731 {&__pyx_n_s_version_backend, __pyx_k_version_backend,
sizeof(__pyx_k_version_backend), 0, 0, 1, 1},
11732 {&__pyx_n_s_version_number, __pyx_k_version_number,
sizeof(__pyx_k_version_number), 0, 0, 1, 1},
11733 {&__pyx_n_s_version_string, __pyx_k_version_string,
sizeof(__pyx_k_version_string), 0, 0, 1, 1},
11734 {&__pyx_n_s_version_user, __pyx_k_version_user,
sizeof(__pyx_k_version_user), 0, 0, 1, 1},
11735 {&__pyx_n_s_za, __pyx_k_za,
sizeof(__pyx_k_za), 0, 0, 1, 1},
11736 {&__pyx_n_s_zn, __pyx_k_zn,
sizeof(__pyx_k_zn), 0, 0, 1, 1},
11737 {0, 0, 0, 0, 0, 0, 0}
11739 static int __Pyx_InitCachedBuiltins(
void) {
11740 __pyx_builtin_enumerate = __Pyx_GetBuiltinName(__pyx_n_s_enumerate);
if (!__pyx_builtin_enumerate) __PYX_ERR(0, 371, __pyx_L1_error)
11741 __pyx_builtin_ValueError = __Pyx_GetBuiltinName(__pyx_n_s_ValueError); if (!__pyx_builtin_ValueError) __PYX_ERR(1, 218, __pyx_L1_error)
11742 __pyx_builtin_range = __Pyx_GetBuiltinName(__pyx_n_s_range); if (!__pyx_builtin_range) __PYX_ERR(1, 231, __pyx_L1_error)
11743 __pyx_builtin_RuntimeError = __Pyx_GetBuiltinName(__pyx_n_s_RuntimeError); if (!__pyx_builtin_RuntimeError) __PYX_ERR(1, 799, __pyx_L1_error)
11744 __pyx_builtin_ImportError = __Pyx_GetBuiltinName(__pyx_n_s_ImportError); if (!__pyx_builtin_ImportError) __PYX_ERR(1, 989, __pyx_L1_error)
11745 __pyx_builtin_TypeError = __Pyx_GetBuiltinName(__pyx_n_s_TypeError); if (!__pyx_builtin_TypeError) __PYX_ERR(2, 14, __pyx_L1_error)
11746 __pyx_builtin_KeyError = __Pyx_GetBuiltinName(__pyx_n_s_KeyError); if (!__pyx_builtin_KeyError) __PYX_ERR(2, 18, __pyx_L1_error)
11752 static
int __Pyx_InitCachedConstants(
void) {
11753 __Pyx_RefNannyDeclarations
11754 __Pyx_RefNannySetupContext(
"__Pyx_InitCachedConstants", 0);
11763 __pyx_tuple_ = PyTuple_Pack(1, __pyx_n_s_nowarn);
if (unlikely(!__pyx_tuple_)) __PYX_ERR(0, 113, __pyx_L1_error)
11764 __Pyx_GOTREF(__pyx_tuple_);
11765 __Pyx_GIVEREF(__pyx_tuple_);
11774 __pyx_tuple__3 = PyTuple_Pack(1, __pyx_kp_s_Shape_of_parameter_2_inconsisten); if (unlikely(!__pyx_tuple__3)) __PYX_ERR(0, 241, __pyx_L1_error)
11775 __Pyx_GOTREF(__pyx_tuple__3);
11776 __Pyx_GIVEREF(__pyx_tuple__3);
11785 __pyx_tuple__4 = PyTuple_Pack(1, __pyx_kp_s_Shape_of_parameter_3_inconsisten); if (unlikely(!__pyx_tuple__4)) __PYX_ERR(0, 243, __pyx_L1_error)
11786 __Pyx_GOTREF(__pyx_tuple__4);
11787 __Pyx_GIVEREF(__pyx_tuple__4);
11796 __pyx_tuple__5 = PyTuple_Pack(1, __pyx_kp_u_ndarray_is_not_C_contiguous); if (unlikely(!__pyx_tuple__5)) __PYX_ERR(1, 218, __pyx_L1_error)
11797 __Pyx_GOTREF(__pyx_tuple__5);
11798 __Pyx_GIVEREF(__pyx_tuple__5);
11807 __pyx_tuple__6 = PyTuple_Pack(1, __pyx_kp_u_ndarray_is_not_Fortran_contiguou); if (unlikely(!__pyx_tuple__6)) __PYX_ERR(1, 222, __pyx_L1_error)
11808 __Pyx_GOTREF(__pyx_tuple__6);
11809 __Pyx_GIVEREF(__pyx_tuple__6);
11818 __pyx_tuple__7 = PyTuple_Pack(1, __pyx_kp_u_Non_native_byte_order_not_suppor); if (unlikely(!__pyx_tuple__7)) __PYX_ERR(1, 259, __pyx_L1_error)
11819 __Pyx_GOTREF(__pyx_tuple__7);
11820 __Pyx_GIVEREF(__pyx_tuple__7);
11829 __pyx_tuple__8 = PyTuple_Pack(1, __pyx_kp_u_Format_string_allocated_too_shor); if (unlikely(!__pyx_tuple__8)) __PYX_ERR(1, 799, __pyx_L1_error)
11830 __Pyx_GOTREF(__pyx_tuple__8);
11831 __Pyx_GIVEREF(__pyx_tuple__8);
11840 __pyx_tuple__9 = PyTuple_Pack(1, __pyx_kp_u_Non_native_byte_order_not_suppor); if (unlikely(!__pyx_tuple__9)) __PYX_ERR(1, 803, __pyx_L1_error)
11841 __Pyx_GOTREF(__pyx_tuple__9);
11842 __Pyx_GIVEREF(__pyx_tuple__9);
11851 __pyx_tuple__10 = PyTuple_Pack(1, __pyx_kp_u_Format_string_allocated_too_shor_2); if (unlikely(!__pyx_tuple__10)) __PYX_ERR(1, 823, __pyx_L1_error)
11852 __Pyx_GOTREF(__pyx_tuple__10);
11853 __Pyx_GIVEREF(__pyx_tuple__10);
11862 __pyx_tuple__11 = PyTuple_Pack(1, __pyx_kp_s_numpy_core_multiarray_failed_to); if (unlikely(!__pyx_tuple__11)) __PYX_ERR(1, 989, __pyx_L1_error)
11863 __Pyx_GOTREF(__pyx_tuple__11);
11864 __Pyx_GIVEREF(__pyx_tuple__11);
11873 __pyx_tuple__12 = PyTuple_Pack(1, __pyx_kp_s_numpy_core_umath_failed_to_impor); if (unlikely(!__pyx_tuple__12)) __PYX_ERR(1, 995, __pyx_L1_error)
11874 __Pyx_GOTREF(__pyx_tuple__12);
11875 __Pyx_GIVEREF(__pyx_tuple__12);
11882 __pyx_tuple__13 = PyTuple_Pack(1, __pyx_kp_s_numpy_core_umath_failed_to_impor); if (unlikely(!__pyx_tuple__13)) __PYX_ERR(1, 1001, __pyx_L1_error)
11883 __Pyx_GOTREF(__pyx_tuple__13);
11884 __Pyx_GIVEREF(__pyx_tuple__13);
11893 __pyx_tuple__14 = PyTuple_Pack(1, __pyx_kp_s_No_value_specified_for_struct_at); if (unlikely(!__pyx_tuple__14)) __PYX_ERR(2, 19, __pyx_L1_error)
11894 __Pyx_GOTREF(__pyx_tuple__14);
11895 __Pyx_GIVEREF(__pyx_tuple__14);
11904 __pyx_tuple__15 = PyTuple_Pack(1, __pyx_kp_s_No_value_specified_for_struct_at_2); if (unlikely(!__pyx_tuple__15)) __PYX_ERR(2, 24, __pyx_L1_error)
11905 __Pyx_GOTREF(__pyx_tuple__15);
11906 __Pyx_GIVEREF(__pyx_tuple__15);
11915 __pyx_tuple__16 = PyTuple_Pack(1, __pyx_kp_s_No_value_specified_for_struct_at_3); if (unlikely(!__pyx_tuple__16)) __PYX_ERR(2, 29, __pyx_L1_error)
11916 __Pyx_GOTREF(__pyx_tuple__16);
11917 __Pyx_GIVEREF(__pyx_tuple__16);
11926 __pyx_tuple__17 = PyTuple_Pack(1, __pyx_kp_s_No_value_specified_for_struct_at_4); if (unlikely(!__pyx_tuple__17)) __PYX_ERR(2, 34, __pyx_L1_error)
11927 __Pyx_GOTREF(__pyx_tuple__17);
11928 __Pyx_GIVEREF(__pyx_tuple__17);
11937 __pyx_tuple__18 = PyTuple_Pack(1, __pyx_kp_s_No_value_specified_for_struct_at_5); if (unlikely(!__pyx_tuple__18)) __PYX_ERR(2, 39, __pyx_L1_error)
11938 __Pyx_GOTREF(__pyx_tuple__18);
11939 __Pyx_GIVEREF(__pyx_tuple__18);
11948 __pyx_tuple__19 = PyTuple_Pack(1, __pyx_kp_s_No_value_specified_for_struct_at_6); if (unlikely(!__pyx_tuple__19)) __PYX_ERR(2, 44, __pyx_L1_error)
11949 __Pyx_GOTREF(__pyx_tuple__19);
11950 __Pyx_GIVEREF(__pyx_tuple__19);
11951 __Pyx_RefNannyFinishContext();
11954 __Pyx_RefNannyFinishContext();
11958 static
int __Pyx_InitGlobals(
void) {
11959 if (__Pyx_InitStrings(__pyx_string_tab) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
11960 __pyx_int_0 = PyInt_FromLong(0);
if (unlikely(!__pyx_int_0)) __PYX_ERR(0, 1, __pyx_L1_error)
11961 __pyx_int_1 = PyInt_FromLong(1); if (unlikely(!__pyx_int_1)) __PYX_ERR(0, 1, __pyx_L1_error)
11962 __pyx_int_2 = PyInt_FromLong(2); if (unlikely(!__pyx_int_2)) __PYX_ERR(0, 1, __pyx_L1_error)
11963 __pyx_int_3 = PyInt_FromLong(3); if (unlikely(!__pyx_int_3)) __PYX_ERR(0, 1, __pyx_L1_error)
11969 #if PY_MAJOR_VERSION < 3
11970 PyMODINIT_FUNC initamns(
void);
11971 PyMODINIT_FUNC initamns(
void)
11973 PyMODINIT_FUNC PyInit_amns(
void);
11974 PyMODINIT_FUNC PyInit_amns(
void)
11977 PyObject *__pyx_t_1 = NULL;
11978 PyObject *__pyx_t_2 = NULL;
11979 PyObject *__pyx_t_3 = NULL;
11980 PyObject *__pyx_t_4 = NULL;
11981 __Pyx_RefNannyDeclarations
11982 #if CYTHON_REFNANNY
11983 __Pyx_RefNanny = __Pyx_RefNannyImportAPI(
"refnanny");
11984 if (!__Pyx_RefNanny) {
11986 __Pyx_RefNanny = __Pyx_RefNannyImportAPI(
"Cython.Runtime.refnanny");
11987 if (!__Pyx_RefNanny)
11988 Py_FatalError(
"failed to import 'refnanny' module");
11991 __Pyx_RefNannySetupContext(
"PyMODINIT_FUNC PyInit_amns(void)", 0);
11992 if (__Pyx_check_binary_version() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
11993 __pyx_empty_tuple = PyTuple_New(0); if (unlikely(!__pyx_empty_tuple)) __PYX_ERR(0, 1, __pyx_L1_error)
11994 __pyx_empty_bytes = PyBytes_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_bytes)) __PYX_ERR(0, 1, __pyx_L1_error)
11995 __pyx_empty_unicode = PyUnicode_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_unicode)) __PYX_ERR(0, 1, __pyx_L1_error)
11996 #ifdef __Pyx_CyFunction_USED
11997 if (__pyx_CyFunction_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
11999 #ifdef __Pyx_FusedFunction_USED
12000 if (__pyx_FusedFunction_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
12002 #ifdef __Pyx_Coroutine_USED
12003 if (__pyx_Coroutine_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
12005 #ifdef __Pyx_Generator_USED
12006 if (__pyx_Generator_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
12008 #ifdef __Pyx_StopAsyncIteration_USED
12009 if (__pyx_StopAsyncIteration_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
12013 #if defined(__PYX_FORCE_INIT_THREADS) && __PYX_FORCE_INIT_THREADS
12015 PyEval_InitThreads();
12019 #if PY_MAJOR_VERSION < 3
12020 __pyx_m = Py_InitModule4(
"amns", __pyx_methods, 0, 0, PYTHON_API_VERSION); Py_XINCREF(__pyx_m);
12022 __pyx_m = PyModule_Create(&__pyx_moduledef);
12024 if (unlikely(!__pyx_m)) __PYX_ERR(0, 1, __pyx_L1_error)
12025 __pyx_d = PyModule_GetDict(__pyx_m); if (unlikely(!__pyx_d)) __PYX_ERR(0, 1, __pyx_L1_error)
12026 Py_INCREF(__pyx_d);
12027 __pyx_b = PyImport_AddModule(__Pyx_BUILTIN_MODULE_NAME); if (unlikely(!__pyx_b)) __PYX_ERR(0, 1, __pyx_L1_error)
12028 #if CYTHON_COMPILING_IN_PYPY
12029 Py_INCREF(__pyx_b);
12031 if (PyObject_SetAttrString(__pyx_m,
"__builtins__", __pyx_b) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
12033 if (__Pyx_InitGlobals() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
12034 #if PY_MAJOR_VERSION < 3 && (__PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT)
12035 if (__Pyx_init_sys_getdefaultencoding_params() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
12037 if (__pyx_module_is_main_amns) {
12038 if (PyObject_SetAttrString(__pyx_m,
"__name__", __pyx_n_s_main) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
12040 #if PY_MAJOR_VERSION >= 3
12042 PyObject *modules = PyImport_GetModuleDict();
if (unlikely(!modules)) __PYX_ERR(0, 1, __pyx_L1_error)
12043 if (!PyDict_GetItemString(modules, "amns")) {
12044 if (unlikely(PyDict_SetItemString(modules,
"amns", __pyx_m) < 0)) __PYX_ERR(0, 1, __pyx_L1_error)
12049 if (__Pyx_InitCachedBuiltins() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
12051 if (__Pyx_InitCachedConstants() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
12056 __pyx_vtabptr_4amns_Amns = &__pyx_vtable_4amns_Amns;
12057 __pyx_vtable_4amns_Amns.handle = (
void *(*)(struct __pyx_obj_4amns_Amns *))__pyx_f_4amns_4Amns_handle;
12058 __pyx_vtable_4amns_Amns.lquery = (
amns_c_answer_type (*)(struct __pyx_obj_4amns_Amns *, PyObject *))__pyx_f_4amns_4Amns_lquery;
12059 if (PyType_Ready(&__pyx_type_4amns_Amns) < 0) __PYX_ERR(0, 11, __pyx_L1_error)
12060 __pyx_type_4amns_Amns.tp_print = 0;
12061 #if CYTHON_COMPILING_IN_CPYTHON
12063 PyObject *wrapper = PyObject_GetAttrString((PyObject *)&__pyx_type_4amns_Amns,
"__init__");
if (unlikely(!wrapper)) __PYX_ERR(0, 11, __pyx_L1_error)
12064 if (Py_TYPE(wrapper) == &PyWrapperDescr_Type) {
12065 __pyx_wrapperbase_4amns_4Amns___init__ = *((PyWrapperDescrObject *)wrapper)->d_base;
12066 __pyx_wrapperbase_4amns_4Amns___init__.doc = __pyx_doc_4amns_4Amns___init__;
12067 ((PyWrapperDescrObject *)wrapper)->d_base = &__pyx_wrapperbase_4amns_4Amns___init__;
12071 if (__Pyx_SetVtable(__pyx_type_4amns_Amns.tp_dict, __pyx_vtabptr_4amns_Amns) < 0) __PYX_ERR(0, 11, __pyx_L1_error)
12072 if (PyObject_SetAttrString(__pyx_m,
"Amns", (PyObject *)&__pyx_type_4amns_Amns) < 0) __PYX_ERR(0, 11, __pyx_L1_error)
12073 __pyx_ptype_4amns_Amns = &__pyx_type_4amns_Amns;
12074 __pyx_vtabptr_4amns_Table = &__pyx_vtable_4amns_Table;
12075 __pyx_vtable_4amns_Table.lquery = (
amns_c_answer_type (*)(struct __pyx_obj_4amns_Table *, PyObject *))__pyx_f_4amns_5Table_lquery;
12076 if (PyType_Ready(&__pyx_type_4amns_Table) < 0) __PYX_ERR(0, 92, __pyx_L1_error)
12077 __pyx_type_4amns_Table.tp_print = 0;
12078 #if CYTHON_COMPILING_IN_CPYTHON
12080 PyObject *wrapper = PyObject_GetAttrString((PyObject *)&__pyx_type_4amns_Table,
"__init__");
if (unlikely(!wrapper)) __PYX_ERR(0, 92, __pyx_L1_error)
12081 if (Py_TYPE(wrapper) == &PyWrapperDescr_Type) {
12082 __pyx_wrapperbase_4amns_5Table___init__ = *((PyWrapperDescrObject *)wrapper)->d_base;
12083 __pyx_wrapperbase_4amns_5Table___init__.doc = __pyx_doc_4amns_5Table___init__;
12084 ((PyWrapperDescrObject *)wrapper)->d_base = &__pyx_wrapperbase_4amns_5Table___init__;
12088 if (__Pyx_SetVtable(__pyx_type_4amns_Table.tp_dict, __pyx_vtabptr_4amns_Table) < 0) __PYX_ERR(0, 92, __pyx_L1_error)
12089 if (PyObject_SetAttrString(__pyx_m,
"Table", (PyObject *)&__pyx_type_4amns_Table) < 0) __PYX_ERR(0, 92, __pyx_L1_error)
12090 __pyx_ptype_4amns_Table = &__pyx_type_4amns_Table;
12091 __pyx_vtabptr_4amns_Reactants = &__pyx_vtable_4amns_Reactants;
12092 __pyx_vtable_4amns_Reactants.handle = (
void *(*)(struct __pyx_obj_4amns_Reactants *))__pyx_f_4amns_9Reactants_handle;
12093 if (PyType_Ready(&__pyx_type_4amns_Reactants) < 0) __PYX_ERR(0, 354, __pyx_L1_error)
12094 __pyx_type_4amns_Reactants.tp_print = 0;
12095 #if CYTHON_COMPILING_IN_CPYTHON
12097 PyObject *wrapper = PyObject_GetAttrString((PyObject *)&__pyx_type_4amns_Reactants,
"__len__");
if (unlikely(!wrapper)) __PYX_ERR(0, 354, __pyx_L1_error)
12098 if (Py_TYPE(wrapper) == &PyWrapperDescr_Type) {
12099 __pyx_wrapperbase_4amns_9Reactants_8__len__ = *((PyWrapperDescrObject *)wrapper)->d_base;
12100 __pyx_wrapperbase_4amns_9Reactants_8__len__.doc = __pyx_doc_4amns_9Reactants_8__len__;
12101 ((PyWrapperDescrObject *)wrapper)->d_base = &__pyx_wrapperbase_4amns_9Reactants_8__len__;
12105 #if CYTHON_COMPILING_IN_CPYTHON
12107 PyObject *wrapper = PyObject_GetAttrString((PyObject *)&__pyx_type_4amns_Reactants,
"__str__");
if (unlikely(!wrapper)) __PYX_ERR(0, 354, __pyx_L1_error)
12108 if (Py_TYPE(wrapper) == &PyWrapperDescr_Type) {
12109 __pyx_wrapperbase_4amns_9Reactants_10__str__ = *((PyWrapperDescrObject *)wrapper)->d_base;
12110 __pyx_wrapperbase_4amns_9Reactants_10__str__.doc = __pyx_doc_4amns_9Reactants_10__str__;
12111 ((PyWrapperDescrObject *)wrapper)->d_base = &__pyx_wrapperbase_4amns_9Reactants_10__str__;
12115 if (__Pyx_SetVtable(__pyx_type_4amns_Reactants.tp_dict, __pyx_vtabptr_4amns_Reactants) < 0) __PYX_ERR(0, 354, __pyx_L1_error)
12116 if (PyObject_SetAttrString(__pyx_m,
"Reactants", (PyObject *)&__pyx_type_4amns_Reactants) < 0) __PYX_ERR(0, 354, __pyx_L1_error)
12117 __pyx_ptype_4amns_Reactants = &__pyx_type_4amns_Reactants;
12119 __pyx_ptype_7cpython_4type_type = __Pyx_ImportType(__Pyx_BUILTIN_MODULE_NAME, "type",
12120 #if CYTHON_COMPILING_IN_PYPY
12121 sizeof(PyTypeObject),
12123 sizeof(PyHeapTypeObject),
12125 0);
if (unlikely(!__pyx_ptype_7cpython_4type_type)) __PYX_ERR(3, 9, __pyx_L1_error)
12126 __pyx_ptype_5numpy_dtype = __Pyx_ImportType(
"numpy",
"dtype",
sizeof(PyArray_Descr), 0);
if (unlikely(!__pyx_ptype_5numpy_dtype)) __PYX_ERR(1, 155, __pyx_L1_error)
12127 __pyx_ptype_5numpy_flatiter = __Pyx_ImportType("numpy", "flatiter", sizeof(PyArrayIterObject), 0); if (unlikely(!__pyx_ptype_5numpy_flatiter)) __PYX_ERR(1, 168, __pyx_L1_error)
12128 __pyx_ptype_5numpy_broadcast = __Pyx_ImportType("numpy", "broadcast", sizeof(PyArrayMultiIterObject), 0); if (unlikely(!__pyx_ptype_5numpy_broadcast)) __PYX_ERR(1, 172, __pyx_L1_error)
12129 __pyx_ptype_5numpy_ndarray = __Pyx_ImportType("numpy", "ndarray", sizeof(PyArrayObject), 0); if (unlikely(!__pyx_ptype_5numpy_ndarray)) __PYX_ERR(1, 181, __pyx_L1_error)
12130 __pyx_ptype_5numpy_ufunc = __Pyx_ImportType("numpy", "ufunc", sizeof(PyUFuncObject), 0); if (unlikely(!__pyx_ptype_5numpy_ufunc)) __PYX_ERR(1, 861, __pyx_L1_error)
12134 #if defined(__Pyx_Generator_USED) || defined(__Pyx_Coroutine_USED)
12135 if (__Pyx_patch_abc() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
12145 __pyx_t_1 = __Pyx_Import(__pyx_n_s_numpy, 0, -1);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3, __pyx_L1_error)
12146 __Pyx_GOTREF(__pyx_t_1);
12147 if (PyDict_SetItem(__pyx_d, __pyx_n_s_np, __pyx_t_1) < 0) __PYX_ERR(0, 3, __pyx_L1_error)
12148 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
12156 __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 410, __pyx_L1_error)
12157 __Pyx_GOTREF(__pyx_t_1);
12158 __Pyx_INCREF(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0])));
12159 __Pyx_GIVEREF(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0])));
12160 PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0])));
12161 __pyx_t_2 = __Pyx_CalculateMetaclass(NULL, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 410, __pyx_L1_error)
12162 __Pyx_GOTREF(__pyx_t_2);
12163 __pyx_t_3 = __Pyx_Py3MetaclassPrepare(__pyx_t_2, __pyx_t_1, __pyx_n_s_AmnsException, __pyx_n_s_AmnsException, (PyObject *) NULL, __pyx_n_s_amns, (PyObject *) NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 410, __pyx_L1_error)
12164 __Pyx_GOTREF(__pyx_t_3);
12165 __pyx_t_4 = __Pyx_Py3ClassCreate(__pyx_t_2, __pyx_n_s_AmnsException, __pyx_t_1, __pyx_t_3, NULL, 0, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 410, __pyx_L1_error)
12166 __Pyx_GOTREF(__pyx_t_4);
12167 if (PyDict_SetItem(__pyx_d, __pyx_n_s_AmnsException, __pyx_t_4) < 0) __PYX_ERR(0, 410, __pyx_L1_error)
12168 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
12169 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
12170 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
12171 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
12178 __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1, __pyx_L1_error)
12179 __Pyx_GOTREF(__pyx_t_1);
12180 if (PyDict_SetItem(__pyx_d, __pyx_n_s_test, __pyx_t_1) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
12181 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
12195 __Pyx_XDECREF(__pyx_t_1);
12196 __Pyx_XDECREF(__pyx_t_2);
12197 __Pyx_XDECREF(__pyx_t_3);
12198 __Pyx_XDECREF(__pyx_t_4);
12201 __Pyx_AddTraceback(
"init amns", __pyx_clineno, __pyx_lineno, __pyx_filename);
12203 Py_DECREF(__pyx_m); __pyx_m = 0;
12204 }
else if (!PyErr_Occurred()) {
12205 PyErr_SetString(PyExc_ImportError,
"init amns");
12208 __Pyx_RefNannyFinishContext();
12209 #if PY_MAJOR_VERSION < 3
12218 #if CYTHON_REFNANNY
12219 static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(
const char *modname) {
12220 PyObject *m = NULL, *p = NULL;
12222 m = PyImport_ImportModule((
char *)modname);
12224 p = PyObject_GetAttrString(m, (
char *)
"RefNannyAPI");
12226 r = PyLong_AsVoidPtr(p);
12230 return (__Pyx_RefNannyAPIStruct *)r;
12235 static PyObject *__Pyx_GetBuiltinName(PyObject *
name) {
12236 PyObject* result = __Pyx_PyObject_GetAttrStr(__pyx_b, name);
12237 if (unlikely(!result)) {
12238 PyErr_Format(PyExc_NameError,
12239 #
if PY_MAJOR_VERSION >= 3
12240 "name '%U' is not defined", name);
12242 "name '%.200s' is not defined", PyString_AS_STRING(name));
12249 static void __Pyx_RaiseDoubleKeywordsError(
12250 const char* func_name,
12253 PyErr_Format(PyExc_TypeError,
12254 #
if PY_MAJOR_VERSION >= 3
12255 "%s() got multiple values for keyword argument '%U'", func_name, kw_name);
12257 "%s() got multiple values for keyword argument '%s'", func_name,
12258 PyString_AsString(kw_name));
12263 static int __Pyx_ParseOptionalKeywords(
12265 PyObject **argnames[],
12267 PyObject *values[],
12268 Py_ssize_t num_pos_args,
12269 const char* function_name)
12271 PyObject *key = 0, *value = 0;
12272 Py_ssize_t pos = 0;
12274 PyObject*** first_kw_arg = argnames + num_pos_args;
12275 while (PyDict_Next(kwds, &pos, &key, &value)) {
12276 name = first_kw_arg;
12277 while (*name && (**name != key)) name++;
12279 values[name-argnames] = value;
12282 name = first_kw_arg;
12283 #if PY_MAJOR_VERSION < 3
12284 if (likely(PyString_CheckExact(key)) || likely(PyString_Check(key))) {
12286 if ((CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**name) == PyString_GET_SIZE(key))
12287 && _PyString_Eq(**name, key)) {
12288 values[name-argnames] = value;
12293 if (*name)
continue;
12295 PyObject*** argname = argnames;
12296 while (argname != first_kw_arg) {
12297 if ((**argname == key) || (
12298 (CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**argname) == PyString_GET_SIZE(key))
12299 && _PyString_Eq(**argname, key))) {
12300 goto arg_passed_twice;
12307 if (likely(PyUnicode_Check(key))) {
12309 int cmp = (**name == key) ? 0 :
12310 #
if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3
12311 (PyUnicode_GET_SIZE(**name) != PyUnicode_GET_SIZE(key)) ? 1 :
12313 PyUnicode_Compare(**name, key);
12314 if (cmp < 0 && unlikely(PyErr_Occurred()))
goto bad;
12316 values[name-argnames] = value;
12321 if (*name)
continue;
12323 PyObject*** argname = argnames;
12324 while (argname != first_kw_arg) {
12325 int cmp = (**argname == key) ? 0 :
12326 #
if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3
12327 (PyUnicode_GET_SIZE(**argname) != PyUnicode_GET_SIZE(key)) ? 1 :
12329 PyUnicode_Compare(**argname, key);
12330 if (cmp < 0 && unlikely(PyErr_Occurred()))
goto bad;
12331 if (cmp == 0)
goto arg_passed_twice;
12336 goto invalid_keyword_type;
12338 if (unlikely(PyDict_SetItem(kwds2, key, value)))
goto bad;
12340 goto invalid_keyword;
12345 __Pyx_RaiseDoubleKeywordsError(function_name, key);
12347 invalid_keyword_type:
12348 PyErr_Format(PyExc_TypeError,
12349 "%.200s() keywords must be strings", function_name);
12352 PyErr_Format(PyExc_TypeError,
12353 #
if PY_MAJOR_VERSION < 3
12354 "%.200s() got an unexpected keyword argument '%.200s'",
12355 function_name, PyString_AsString(key));
12357 "%s() got an unexpected keyword argument '%U'",
12358 function_name, key);
12365 static void __Pyx_RaiseArgtupleInvalid(
12366 const char* func_name,
12368 Py_ssize_t num_min,
12369 Py_ssize_t num_max,
12370 Py_ssize_t num_found)
12372 Py_ssize_t num_expected;
12373 const char *more_or_less;
12374 if (num_found < num_min) {
12375 num_expected = num_min;
12376 more_or_less =
"at least";
12378 num_expected = num_max;
12379 more_or_less =
"at most";
12382 more_or_less =
"exactly";
12384 PyErr_Format(PyExc_TypeError,
12385 "%.200s() takes %.8s %" CYTHON_FORMAT_SSIZE_T
"d positional argument%.1s (%" CYTHON_FORMAT_SSIZE_T
"d given)",
12386 func_name, more_or_less, num_expected,
12387 (num_expected == 1) ?
"" :
"s", num_found);
12391 #if CYTHON_COMPILING_IN_CPYTHON
12392 static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw) {
12394 ternaryfunc call = func->ob_type->tp_call;
12395 if (unlikely(!call))
12396 return PyObject_Call(func, arg, kw);
12397 if (unlikely(Py_EnterRecursiveCall((
char*)
" while calling a Python object")))
12399 result = (*call)(func, arg, kw);
12400 Py_LeaveRecursiveCall();
12401 if (unlikely(!result) && unlikely(!PyErr_Occurred())) {
12404 "NULL result without error in PyObject_Call");
12411 static CYTHON_INLINE PyObject *__Pyx_GetModuleGlobalName(PyObject *name) {
12413 #if !CYTHON_AVOID_BORROWED_REFS
12414 result = PyDict_GetItem(__pyx_d, name);
12415 if (likely(result)) {
12419 result = PyObject_GetItem(__pyx_d, name);
12423 result = __Pyx_GetBuiltinName(name);
12429 #if CYTHON_FAST_PYCCALL
12430 static CYTHON_INLINE PyObject * __Pyx_PyCFunction_FastCall(PyObject *func_obj, PyObject **args, Py_ssize_t
nargs) {
12431 PyCFunctionObject *func = (PyCFunctionObject*)func_obj;
12432 PyCFunction meth = PyCFunction_GET_FUNCTION(func);
12433 PyObject *
self = PyCFunction_GET_SELF(func);
12434 assert(PyCFunction_Check(func));
12435 assert(METH_FASTCALL == (PyCFunction_GET_FLAGS(func) & ~(METH_CLASS | METH_STATIC | METH_COEXIST)));
12436 assert(nargs >= 0);
12437 assert(nargs == 0 || args != NULL);
12441 assert(!PyErr_Occurred());
12442 return (*((__Pyx_PyCFunctionFast)meth)) (
self, args,
nargs, NULL);
12444 #endif // CYTHON_FAST_PYCCALL
12447 #if CYTHON_FAST_PYCALL
12448 #include "frameobject.h"
12449 static PyObject* __Pyx_PyFunction_FastCallNoKw(PyCodeObject *co, PyObject **args, Py_ssize_t na,
12450 PyObject *globals) {
12452 PyThreadState *tstate = PyThreadState_GET();
12453 PyObject **fastlocals;
12456 assert(globals != NULL);
12461 assert(tstate != NULL);
12462 f = PyFrame_New(tstate, co, globals, NULL);
12466 fastlocals = f->f_localsplus;
12467 for (i = 0; i < na; i++) {
12469 fastlocals[
i] = *args++;
12471 result = PyEval_EvalFrameEx(f,0);
12472 ++tstate->recursion_depth;
12474 --tstate->recursion_depth;
12477 #if 1 || PY_VERSION_HEX < 0x030600B1
12478 static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args,
int nargs, PyObject *kwargs) {
12479 PyCodeObject *co = (PyCodeObject *)PyFunction_GET_CODE(func);
12480 PyObject *globals = PyFunction_GET_GLOBALS(func);
12481 PyObject *argdefs = PyFunction_GET_DEFAULTS(func);
12483 #if PY_MAJOR_VERSION >= 3
12486 PyObject *kwtuple, **k;
12491 assert(kwargs == NULL || PyDict_Check(kwargs));
12492 nk = kwargs ? PyDict_Size(kwargs) : 0;
12493 if (Py_EnterRecursiveCall((
char*)
" while calling a Python object")) {
12497 #
if PY_MAJOR_VERSION >= 3
12498 co->co_kwonlyargcount == 0 &&
12500 likely(kwargs == NULL || nk == 0) &&
12501 co->co_flags == (CO_OPTIMIZED | CO_NEWLOCALS | CO_NOFREE)) {
12502 if (argdefs == NULL && co->co_argcount == nargs) {
12503 result = __Pyx_PyFunction_FastCallNoKw(co, args, nargs, globals);
12506 else if (nargs == 0 && argdefs != NULL
12507 && co->co_argcount == Py_SIZE(argdefs)) {
12510 args = &PyTuple_GET_ITEM(argdefs, 0);
12511 result =__Pyx_PyFunction_FastCallNoKw(co, args, Py_SIZE(argdefs), globals);
12515 if (kwargs != NULL) {
12517 kwtuple = PyTuple_New(2 * nk);
12518 if (kwtuple == NULL) {
12522 k = &PyTuple_GET_ITEM(kwtuple, 0);
12524 while (PyDict_Next(kwargs, &pos, &k[i], &k[i+1])) {
12535 closure = PyFunction_GET_CLOSURE(func);
12536 #if PY_MAJOR_VERSION >= 3
12537 kwdefs = PyFunction_GET_KW_DEFAULTS(func);
12539 if (argdefs != NULL) {
12540 d = &PyTuple_GET_ITEM(argdefs, 0);
12541 nd = Py_SIZE(argdefs);
12547 #if PY_MAJOR_VERSION >= 3
12548 result = PyEval_EvalCodeEx((PyObject*)co, globals, (PyObject *)NULL,
12551 d, (
int)nd, kwdefs, closure);
12553 result = PyEval_EvalCodeEx(co, globals, (PyObject *)NULL,
12556 d, (
int)nd, closure);
12558 Py_XDECREF(kwtuple);
12560 Py_LeaveRecursiveCall();
12563 #endif // CPython < 3.6
12564 #endif // CYTHON_FAST_PYCALL
12567 #if CYTHON_COMPILING_IN_CPYTHON
12568 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg) {
12569 PyObject *
self, *result;
12571 cfunc = PyCFunction_GET_FUNCTION(func);
12572 self = PyCFunction_GET_SELF(func);
12573 if (unlikely(Py_EnterRecursiveCall((
char*)
" while calling a Python object")))
12575 result = cfunc(
self, arg);
12576 Py_LeaveRecursiveCall();
12577 if (unlikely(!result) && unlikely(!PyErr_Occurred())) {
12580 "NULL result without error in PyObject_Call");
12587 #if CYTHON_COMPILING_IN_CPYTHON
12588 static PyObject* __Pyx__PyObject_CallOneArg(PyObject *func, PyObject *arg) {
12590 PyObject *args = PyTuple_New(1);
12591 if (unlikely(!args))
return NULL;
12593 PyTuple_SET_ITEM(args, 0, arg);
12594 result = __Pyx_PyObject_Call(func, args, NULL);
12598 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg) {
12599 #if CYTHON_FAST_PYCALL
12600 if (PyFunction_Check(func)) {
12601 return __Pyx_PyFunction_FastCall(func, &arg, 1);
12604 #ifdef __Pyx_CyFunction_USED
12605 if (likely(PyCFunction_Check(func) || PyObject_TypeCheck(func, __pyx_CyFunctionType))) {
12607 if (likely(PyCFunction_Check(func))) {
12609 if (likely(PyCFunction_GET_FLAGS(func) & METH_O)) {
12610 return __Pyx_PyObject_CallMethO(func, arg);
12611 #if CYTHON_FAST_PYCCALL
12612 }
else if (PyCFunction_GET_FLAGS(func) & METH_FASTCALL) {
12613 return __Pyx_PyCFunction_FastCall(func, &arg, 1);
12617 return __Pyx__PyObject_CallOneArg(func, arg);
12620 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg) {
12622 PyObject *args = PyTuple_Pack(1, arg);
12623 if (unlikely(!args))
return NULL;
12624 result = __Pyx_PyObject_Call(func, args, NULL);
12631 #if CYTHON_FAST_THREAD_STATE
12632 static CYTHON_INLINE
void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb) {
12633 PyObject *tmp_type, *tmp_value, *tmp_tb;
12634 tmp_type = tstate->curexc_type;
12635 tmp_value = tstate->curexc_value;
12636 tmp_tb = tstate->curexc_traceback;
12637 tstate->curexc_type = type;
12638 tstate->curexc_value = value;
12639 tstate->curexc_traceback = tb;
12640 Py_XDECREF(tmp_type);
12641 Py_XDECREF(tmp_value);
12642 Py_XDECREF(tmp_tb);
12644 static CYTHON_INLINE
void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) {
12645 *type = tstate->curexc_type;
12646 *value = tstate->curexc_value;
12647 *tb = tstate->curexc_traceback;
12648 tstate->curexc_type = 0;
12649 tstate->curexc_value = 0;
12650 tstate->curexc_traceback = 0;
12655 #if PY_MAJOR_VERSION < 3
12656 static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb,
12657 CYTHON_UNUSED PyObject *cause) {
12658 __Pyx_PyThreadState_declare
12660 if (!value || value == Py_None)
12664 if (!tb || tb == Py_None)
12668 if (!PyTraceBack_Check(tb)) {
12669 PyErr_SetString(PyExc_TypeError,
12670 "raise: arg 3 must be a traceback or None");
12674 if (PyType_Check(type)) {
12675 #if CYTHON_COMPILING_IN_PYPY
12677 Py_INCREF(Py_None);
12681 PyErr_NormalizeException(&type, &value, &tb);
12684 PyErr_SetString(PyExc_TypeError,
12685 "instance exception may not have a separate value");
12689 type = (PyObject*) Py_TYPE(type);
12691 if (!PyType_IsSubtype((PyTypeObject *)type, (PyTypeObject *)PyExc_BaseException)) {
12692 PyErr_SetString(PyExc_TypeError,
12693 "raise: exception class must be a subclass of BaseException");
12697 __Pyx_PyThreadState_assign
12698 __Pyx_ErrRestore(type, value, tb);
12707 static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause) {
12708 PyObject* owned_instance = NULL;
12709 if (tb == Py_None) {
12711 }
else if (tb && !PyTraceBack_Check(tb)) {
12712 PyErr_SetString(PyExc_TypeError,
12713 "raise: arg 3 must be a traceback or None");
12716 if (value == Py_None)
12718 if (PyExceptionInstance_Check(type)) {
12720 PyErr_SetString(PyExc_TypeError,
12721 "instance exception may not have a separate value");
12725 type = (PyObject*) Py_TYPE(value);
12726 }
else if (PyExceptionClass_Check(type)) {
12727 PyObject *instance_class = NULL;
12728 if (value && PyExceptionInstance_Check(value)) {
12729 instance_class = (PyObject*) Py_TYPE(value);
12730 if (instance_class != type) {
12731 int is_subclass = PyObject_IsSubclass(instance_class, type);
12732 if (!is_subclass) {
12733 instance_class = NULL;
12734 }
else if (unlikely(is_subclass == -1)) {
12737 type = instance_class;
12741 if (!instance_class) {
12744 args = PyTuple_New(0);
12745 else if (PyTuple_Check(value)) {
12749 args = PyTuple_Pack(1, value);
12752 owned_instance = PyObject_Call(type, args, NULL);
12754 if (!owned_instance)
12756 value = owned_instance;
12757 if (!PyExceptionInstance_Check(value)) {
12758 PyErr_Format(PyExc_TypeError,
12759 "calling %R should have returned an instance of "
12760 "BaseException, not %R",
12761 type, Py_TYPE(value));
12766 PyErr_SetString(PyExc_TypeError,
12767 "raise: exception class must be a subclass of BaseException");
12770 #if PY_VERSION_HEX >= 0x03030000
12773 if (cause && cause != Py_None) {
12775 PyObject *fixed_cause;
12776 if (cause == Py_None) {
12777 fixed_cause = NULL;
12778 }
else if (PyExceptionClass_Check(cause)) {
12779 fixed_cause = PyObject_CallObject(cause, NULL);
12780 if (fixed_cause == NULL)
12782 }
else if (PyExceptionInstance_Check(cause)) {
12783 fixed_cause = cause;
12784 Py_INCREF(fixed_cause);
12786 PyErr_SetString(PyExc_TypeError,
12787 "exception causes must derive from "
12791 PyException_SetCause(value, fixed_cause);
12793 PyErr_SetObject(type, value);
12795 #if CYTHON_COMPILING_IN_PYPY
12796 PyObject *tmp_type, *tmp_value, *tmp_tb;
12797 PyErr_Fetch(&tmp_type, &tmp_value, &tmp_tb);
12799 PyErr_Restore(tmp_type, tmp_value, tb);
12800 Py_XDECREF(tmp_tb);
12802 PyThreadState *tstate = PyThreadState_GET();
12803 PyObject* tmp_tb = tstate->curexc_traceback;
12804 if (tb != tmp_tb) {
12806 tstate->curexc_traceback = tb;
12807 Py_XDECREF(tmp_tb);
12812 Py_XDECREF(owned_instance);
12818 static void __Pyx_WriteUnraisable(
const char *name, CYTHON_UNUSED
int clineno,
12819 CYTHON_UNUSED
int lineno, CYTHON_UNUSED
const char *filename,
12820 int full_traceback, CYTHON_UNUSED
int nogil) {
12821 PyObject *old_exc, *old_val, *old_tb;
12823 __Pyx_PyThreadState_declare
12825 PyGILState_STATE state;
12827 state = PyGILState_Ensure();
12829 else state = (PyGILState_STATE)-1;
12832 __Pyx_PyThreadState_assign
12833 __Pyx_ErrFetch(&old_exc, &old_val, &old_tb);
12834 if (full_traceback) {
12835 Py_XINCREF(old_exc);
12836 Py_XINCREF(old_val);
12837 Py_XINCREF(old_tb);
12838 __Pyx_ErrRestore(old_exc, old_val, old_tb);
12841 #if PY_MAJOR_VERSION < 3
12842 ctx = PyString_FromString(name);
12844 ctx = PyUnicode_FromString(name);
12846 __Pyx_ErrRestore(old_exc, old_val, old_tb);
12848 PyErr_WriteUnraisable(Py_None);
12850 PyErr_WriteUnraisable(ctx);
12855 PyGILState_Release(state);
12860 static void __Pyx_RaiseArgumentTypeInvalid(
const char* name, PyObject *obj, PyTypeObject *type) {
12861 PyErr_Format(PyExc_TypeError,
12862 "Argument '%.200s' has incorrect type (expected %.200s, got %.200s)",
12863 name, type->tp_name, Py_TYPE(obj)->tp_name);
12865 static CYTHON_INLINE
int __Pyx_ArgTypeTest(PyObject *obj, PyTypeObject *type,
int none_allowed,
12866 const char *name,
int exact)
12868 if (unlikely(!type)) {
12869 PyErr_SetString(PyExc_SystemError,
"Missing type object");
12872 if (none_allowed && obj == Py_None)
return 1;
12874 if (likely(Py_TYPE(obj) == type))
return 1;
12875 #if PY_MAJOR_VERSION == 2
12876 else if ((type == &PyBaseString_Type) && likely(__Pyx_PyBaseString_CheckExact(obj)))
return 1;
12880 if (likely(PyObject_TypeCheck(obj, type)))
return 1;
12882 __Pyx_RaiseArgumentTypeInvalid(name, obj, type);
12887 #if !CYTHON_COMPILING_IN_PYPY
12888 static PyObject* __Pyx_PyInt_AddObjC(PyObject *op1, PyObject *op2, CYTHON_UNUSED
long intval, CYTHON_UNUSED
int inplace) {
12889 #if PY_MAJOR_VERSION < 3
12890 if (likely(PyInt_CheckExact(op1))) {
12891 const long b = intval;
12893 long a = PyInt_AS_LONG(op1);
12894 x = (long)((
unsigned long)a + b);
12895 if (likely((x^a) >= 0 || (x^b) >= 0))
12896 return PyInt_FromLong(x);
12897 return PyLong_Type.tp_as_number->nb_add(op1, op2);
12900 #if CYTHON_USE_PYLONG_INTERNALS
12901 if (likely(PyLong_CheckExact(op1))) {
12902 const long b = intval;
12904 #ifdef HAVE_LONG_LONG
12905 const PY_LONG_LONG llb = intval;
12906 PY_LONG_LONG lla, llx;
12908 const digit* digits = ((PyLongObject*)op1)->ob_digit;
12909 const Py_ssize_t size = Py_SIZE(op1);
12910 if (likely(__Pyx_sst_abs(size) <= 1)) {
12911 a = likely(size) ? digits[0] : 0;
12912 if (size == -1) a = -a;
12916 if (8 *
sizeof(
long) - 1 > 2 * PyLong_SHIFT) {
12917 a = -(long) (((((
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0]));
12919 #ifdef HAVE_LONG_LONG
12920 }
else if (8 *
sizeof(PY_LONG_LONG) - 1 > 2 * PyLong_SHIFT) {
12921 lla = -(PY_LONG_LONG) (((((
unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (
unsigned PY_LONG_LONG)digits[0]));
12926 if (8 *
sizeof(
long) - 1 > 2 * PyLong_SHIFT) {
12927 a = (long) (((((
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0]));
12929 #ifdef HAVE_LONG_LONG
12930 }
else if (8 *
sizeof(PY_LONG_LONG) - 1 > 2 * PyLong_SHIFT) {
12931 lla = (PY_LONG_LONG) (((((
unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (
unsigned PY_LONG_LONG)digits[0]));
12936 if (8 *
sizeof(
long) - 1 > 3 * PyLong_SHIFT) {
12937 a = -(long) (((((((
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0]));
12939 #ifdef HAVE_LONG_LONG
12940 }
else if (8 *
sizeof(PY_LONG_LONG) - 1 > 3 * PyLong_SHIFT) {
12941 lla = -(PY_LONG_LONG) (((((((
unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (
unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (
unsigned PY_LONG_LONG)digits[0]));
12946 if (8 *
sizeof(
long) - 1 > 3 * PyLong_SHIFT) {
12947 a = (long) (((((((
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0]));
12949 #ifdef HAVE_LONG_LONG
12950 }
else if (8 *
sizeof(PY_LONG_LONG) - 1 > 3 * PyLong_SHIFT) {
12951 lla = (PY_LONG_LONG) (((((((
unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (
unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (
unsigned PY_LONG_LONG)digits[0]));
12956 if (8 *
sizeof(
long) - 1 > 4 * PyLong_SHIFT) {
12957 a = -(long) (((((((((
unsigned long)digits[3]) << PyLong_SHIFT) | (
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0]));
12959 #ifdef HAVE_LONG_LONG
12960 }
else if (8 *
sizeof(PY_LONG_LONG) - 1 > 4 * PyLong_SHIFT) {
12961 lla = -(PY_LONG_LONG) (((((((((
unsigned PY_LONG_LONG)digits[3]) << PyLong_SHIFT) | (
unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (
unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (
unsigned PY_LONG_LONG)digits[0]));
12966 if (8 *
sizeof(
long) - 1 > 4 * PyLong_SHIFT) {
12967 a = (long) (((((((((
unsigned long)digits[3]) << PyLong_SHIFT) | (
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0]));
12969 #ifdef HAVE_LONG_LONG
12970 }
else if (8 *
sizeof(PY_LONG_LONG) - 1 > 4 * PyLong_SHIFT) {
12971 lla = (PY_LONG_LONG) (((((((((
unsigned PY_LONG_LONG)digits[3]) << PyLong_SHIFT) | (
unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (
unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (
unsigned PY_LONG_LONG)digits[0]));
12975 default:
return PyLong_Type.tp_as_number->nb_add(op1, op2);
12979 return PyLong_FromLong(x);
12980 #ifdef HAVE_LONG_LONG
12983 return PyLong_FromLongLong(llx);
12989 if (PyFloat_CheckExact(op1)) {
12990 const long b = intval;
12991 double a = PyFloat_AS_DOUBLE(op1);
12993 PyFPE_START_PROTECT(
"add",
return NULL)
12994 result = ((double)a) + (double)b;
12995 PyFPE_END_PROTECT(result)
12996 return PyFloat_FromDouble(result);
12998 return (inplace ? PyNumber_InPlaceAdd : PyNumber_Add)(op1, op2);
13003 static CYTHON_INLINE
int __Pyx_IsLittleEndian(
void) {
13004 unsigned int n = 1;
13005 return *(
unsigned char*)(&n) != 0;
13007 static void __Pyx_BufFmt_Init(__Pyx_BufFmt_Context* ctx,
13008 __Pyx_BufFmt_StackElem* stack,
13009 __Pyx_TypeInfo* type) {
13010 stack[0].field = &ctx->root;
13011 stack[0].parent_offset = 0;
13012 ctx->root.type = type;
13013 ctx->root.name =
"buffer dtype";
13014 ctx->root.offset = 0;
13016 ctx->head->field = &ctx->root;
13017 ctx->fmt_offset = 0;
13018 ctx->head->parent_offset = 0;
13019 ctx->new_packmode =
'@';
13020 ctx->enc_packmode =
'@';
13021 ctx->new_count = 1;
13022 ctx->enc_count = 0;
13024 ctx->is_complex = 0;
13025 ctx->is_valid_array = 0;
13026 ctx->struct_alignment = 0;
13027 while (type->typegroup ==
'S') {
13029 ctx->head->field = type->fields;
13030 ctx->head->parent_offset = 0;
13031 type = type->fields->type;
13034 static int __Pyx_BufFmt_ParseNumber(
const char** ts) {
13036 const char* t = *ts;
13037 if (*t < '0' || *t >
'9') {
13040 count = *t++ -
'0';
13041 while (*t >=
'0' && *t <
'9') {
13043 count += *t++ -
'0';
13049 static int __Pyx_BufFmt_ExpectNumber(
const char **ts) {
13050 int number = __Pyx_BufFmt_ParseNumber(ts);
13052 PyErr_Format(PyExc_ValueError,\
13053 "Does not understand character buffer dtype format string ('%c')", **ts);
13056 static void __Pyx_BufFmt_RaiseUnexpectedChar(
char ch) {
13057 PyErr_Format(PyExc_ValueError,
13058 "Unexpected format string character: '%c'", ch);
13060 static const char* __Pyx_BufFmt_DescribeTypeChar(
char ch,
int is_complex) {
13062 case 'c':
return "'char'";
13063 case 'b':
return "'signed char'";
13064 case 'B':
return "'unsigned char'";
13065 case 'h':
return "'short'";
13066 case 'H':
return "'unsigned short'";
13067 case 'i':
return "'int'";
13068 case 'I':
return "'unsigned int'";
13069 case 'l':
return "'long'";
13070 case 'L':
return "'unsigned long'";
13071 case 'q':
return "'long long'";
13072 case 'Q':
return "'unsigned long long'";
13073 case 'f':
return (is_complex ?
"'complex float'" :
"'float'");
13074 case 'd':
return (is_complex ?
"'complex double'" :
"'double'");
13075 case 'g':
return (is_complex ?
"'complex long double'" :
"'long double'");
13076 case 'T':
return "a struct";
13077 case 'O':
return "Python object";
13078 case 'P':
return "a pointer";
13079 case 's':
case 'p':
return "a string";
13080 case 0:
return "end";
13081 default:
return "unparseable format string";
13084 static size_t __Pyx_BufFmt_TypeCharToStandardSize(
char ch,
int is_complex) {
13086 case '?':
case 'c':
case 'b':
case 'B':
case 's':
case 'p':
return 1;
13087 case 'h':
case 'H':
return 2;
13088 case 'i':
case 'I':
case 'l':
case 'L':
return 4;
13089 case 'q':
case 'Q':
return 8;
13090 case 'f':
return (is_complex ? 8 : 4);
13091 case 'd':
return (is_complex ? 16 : 8);
13093 PyErr_SetString(PyExc_ValueError,
"Python does not define a standard format string size for long double ('g')..");
13096 case 'O':
case 'P':
return sizeof(
void*);
13098 __Pyx_BufFmt_RaiseUnexpectedChar(ch);
13102 static size_t __Pyx_BufFmt_TypeCharToNativeSize(
char ch,
int is_complex) {
13104 case 'c':
case 'b':
case 'B':
case 's':
case 'p':
return 1;
13105 case 'h':
case 'H':
return sizeof(short);
13106 case 'i':
case 'I':
return sizeof(int);
13107 case 'l':
case 'L':
return sizeof(long);
13108 #ifdef HAVE_LONG_LONG
13109 case 'q':
case 'Q':
return sizeof(PY_LONG_LONG);
13111 case 'f':
return sizeof(float) * (is_complex ? 2 : 1);
13112 case 'd':
return sizeof(double) * (is_complex ? 2 : 1);
13113 case 'g':
return sizeof(
long double) * (is_complex ? 2 : 1);
13114 case 'O':
case 'P':
return sizeof(
void*);
13116 __Pyx_BufFmt_RaiseUnexpectedChar(ch);
13121 typedef struct {
char c;
short x; } __Pyx_st_short;
13122 typedef struct {
char c;
int x; } __Pyx_st_int;
13123 typedef struct {
char c;
long x; } __Pyx_st_long;
13124 typedef struct {
char c;
float x; } __Pyx_st_float;
13125 typedef struct {
char c;
double x; } __Pyx_st_double;
13126 typedef struct {
char c;
long double x; } __Pyx_st_longdouble;
13127 typedef struct {
char c;
void *x; } __Pyx_st_void_p;
13128 #ifdef HAVE_LONG_LONG
13129 typedef struct {
char c; PY_LONG_LONG x; } __Pyx_st_longlong;
13131 static size_t __Pyx_BufFmt_TypeCharToAlignment(
char ch, CYTHON_UNUSED
int is_complex) {
13133 case '?':
case 'c':
case 'b':
case 'B':
case 's':
case 'p':
return 1;
13134 case 'h':
case 'H':
return sizeof(__Pyx_st_short) -
sizeof(
short);
13135 case 'i':
case 'I':
return sizeof(__Pyx_st_int) -
sizeof(
int);
13136 case 'l':
case 'L':
return sizeof(__Pyx_st_long) -
sizeof(
long);
13137 #ifdef HAVE_LONG_LONG
13138 case 'q':
case 'Q':
return sizeof(__Pyx_st_longlong) -
sizeof(PY_LONG_LONG);
13140 case 'f':
return sizeof(__Pyx_st_float) -
sizeof(
float);
13141 case 'd':
return sizeof(__Pyx_st_double) -
sizeof(
double);
13142 case 'g':
return sizeof(__Pyx_st_longdouble) -
sizeof(
long double);
13143 case 'P':
case 'O':
return sizeof(__Pyx_st_void_p) -
sizeof(
void*);
13145 __Pyx_BufFmt_RaiseUnexpectedChar(ch);
13153 typedef struct {
short x;
char c; } __Pyx_pad_short;
13154 typedef struct {
int x;
char c; } __Pyx_pad_int;
13155 typedef struct {
long x;
char c; } __Pyx_pad_long;
13156 typedef struct {
float x;
char c; } __Pyx_pad_float;
13157 typedef struct {
double x;
char c; } __Pyx_pad_double;
13158 typedef struct {
long double x;
char c; } __Pyx_pad_longdouble;
13159 typedef struct {
void *x;
char c; } __Pyx_pad_void_p;
13160 #ifdef HAVE_LONG_LONG
13161 typedef struct { PY_LONG_LONG x;
char c; } __Pyx_pad_longlong;
13163 static size_t __Pyx_BufFmt_TypeCharToPadding(
char ch, CYTHON_UNUSED
int is_complex) {
13165 case '?':
case 'c':
case 'b':
case 'B':
case 's':
case 'p':
return 1;
13166 case 'h':
case 'H':
return sizeof(__Pyx_pad_short) -
sizeof(
short);
13167 case 'i':
case 'I':
return sizeof(__Pyx_pad_int) -
sizeof(
int);
13168 case 'l':
case 'L':
return sizeof(__Pyx_pad_long) -
sizeof(
long);
13169 #ifdef HAVE_LONG_LONG
13170 case 'q':
case 'Q':
return sizeof(__Pyx_pad_longlong) -
sizeof(PY_LONG_LONG);
13172 case 'f':
return sizeof(__Pyx_pad_float) -
sizeof(
float);
13173 case 'd':
return sizeof(__Pyx_pad_double) -
sizeof(
double);
13174 case 'g':
return sizeof(__Pyx_pad_longdouble) -
sizeof(
long double);
13175 case 'P':
case 'O':
return sizeof(__Pyx_pad_void_p) -
sizeof(
void*);
13177 __Pyx_BufFmt_RaiseUnexpectedChar(ch);
13181 static char __Pyx_BufFmt_TypeCharToGroup(
char ch,
int is_complex) {
13185 case 'b':
case 'h':
case 'i':
13186 case 'l':
case 'q':
case 's':
case 'p':
13188 case 'B':
case 'H':
case 'I':
case 'L':
case 'Q':
13190 case 'f':
case 'd':
case 'g':
13191 return (is_complex ?
'C' :
'R');
13197 __Pyx_BufFmt_RaiseUnexpectedChar(ch);
13202 static void __Pyx_BufFmt_RaiseExpected(__Pyx_BufFmt_Context* ctx) {
13203 if (ctx->head == NULL || ctx->head->field == &ctx->root) {
13204 const char* expected;
13206 if (ctx->head == NULL) {
13210 expected = ctx->head->field->type->name;
13213 PyErr_Format(PyExc_ValueError,
13214 "Buffer dtype mismatch, expected %s%s%s but got %s",
13215 quote, expected, quote,
13216 __Pyx_BufFmt_DescribeTypeChar(ctx->enc_type, ctx->is_complex));
13218 __Pyx_StructField* field = ctx->head->field;
13219 __Pyx_StructField* parent = (ctx->head - 1)->field;
13220 PyErr_Format(PyExc_ValueError,
13221 "Buffer dtype mismatch, expected '%s' but got %s in '%s.%s'",
13222 field->type->name, __Pyx_BufFmt_DescribeTypeChar(ctx->enc_type, ctx->is_complex),
13223 parent->type->name, field->name);
13226 static int __Pyx_BufFmt_ProcessTypeChunk(__Pyx_BufFmt_Context* ctx) {
13228 size_t size, offset, arraysize = 1;
13229 if (ctx->enc_type == 0)
return 0;
13230 if (ctx->head->field->type->arraysize[0]) {
13232 if (ctx->enc_type ==
's' || ctx->enc_type ==
'p') {
13233 ctx->is_valid_array = ctx->head->field->type->ndim == 1;
13235 if (ctx->enc_count != ctx->head->field->type->arraysize[0]) {
13236 PyErr_Format(PyExc_ValueError,
13237 "Expected a dimension of size %zu, got %zu",
13238 ctx->head->field->type->arraysize[0], ctx->enc_count);
13242 if (!ctx->is_valid_array) {
13243 PyErr_Format(PyExc_ValueError,
"Expected %d dimensions, got %d",
13244 ctx->head->field->type->ndim, ndim);
13247 for (i = 0; i < ctx->head->field->type->ndim; i++) {
13248 arraysize *= ctx->head->field->type->arraysize[
i];
13250 ctx->is_valid_array = 0;
13251 ctx->enc_count = 1;
13253 group = __Pyx_BufFmt_TypeCharToGroup(ctx->enc_type, ctx->is_complex);
13255 __Pyx_StructField* field = ctx->head->field;
13256 __Pyx_TypeInfo* type = field->type;
13257 if (ctx->enc_packmode ==
'@' || ctx->enc_packmode ==
'^') {
13258 size = __Pyx_BufFmt_TypeCharToNativeSize(ctx->enc_type, ctx->is_complex);
13260 size = __Pyx_BufFmt_TypeCharToStandardSize(ctx->enc_type, ctx->is_complex);
13262 if (ctx->enc_packmode ==
'@') {
13263 size_t align_at = __Pyx_BufFmt_TypeCharToAlignment(ctx->enc_type, ctx->is_complex);
13264 size_t align_mod_offset;
13265 if (align_at == 0)
return -1;
13266 align_mod_offset = ctx->fmt_offset % align_at;
13267 if (align_mod_offset > 0) ctx->fmt_offset += align_at - align_mod_offset;
13268 if (ctx->struct_alignment == 0)
13269 ctx->struct_alignment = __Pyx_BufFmt_TypeCharToPadding(ctx->enc_type,
13272 if (type->size != size || type->typegroup != group) {
13273 if (type->typegroup ==
'C' && type->fields != NULL) {
13274 size_t parent_offset = ctx->head->parent_offset + field->offset;
13276 ctx->head->field = type->fields;
13277 ctx->head->parent_offset = parent_offset;
13280 if ((type->typegroup ==
'H' || group ==
'H') && type->size == size) {
13282 __Pyx_BufFmt_RaiseExpected(ctx);
13286 offset = ctx->head->parent_offset + field->offset;
13287 if (ctx->fmt_offset != offset) {
13288 PyErr_Format(PyExc_ValueError,
13289 "Buffer dtype mismatch; next field is at offset %" CYTHON_FORMAT_SSIZE_T
"d but %" CYTHON_FORMAT_SSIZE_T
"d expected",
13290 (Py_ssize_t)ctx->fmt_offset, (Py_ssize_t)offset);
13293 ctx->fmt_offset += size;
13295 ctx->fmt_offset += (arraysize - 1) * size;
13298 if (field == &ctx->root) {
13300 if (ctx->enc_count != 0) {
13301 __Pyx_BufFmt_RaiseExpected(ctx);
13306 ctx->head->field = ++field;
13307 if (field->type == NULL) {
13309 field = ctx->head->field;
13311 }
else if (field->type->typegroup ==
'S') {
13312 size_t parent_offset = ctx->head->parent_offset + field->offset;
13313 if (field->type->fields->type == NULL)
continue;
13314 field = field->type->fields;
13316 ctx->head->field = field;
13317 ctx->head->parent_offset = parent_offset;
13323 }
while (ctx->enc_count);
13325 ctx->is_complex = 0;
13328 static CYTHON_INLINE PyObject *
13329 __pyx_buffmt_parse_array(__Pyx_BufFmt_Context* ctx,
const char** tsp)
13331 const char *ts = *tsp;
13333 int ndim = ctx->head->field->type->ndim;
13336 if (ctx->new_count != 1) {
13337 PyErr_SetString(PyExc_ValueError,
13338 "Cannot handle repeated arrays in format string");
13341 if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1)
return NULL;
13342 while (*ts && *ts !=
')') {
13344 case ' ':
case '\f':
case '\r':
case '\n':
case '\t':
case '\v':
continue;
13347 number = __Pyx_BufFmt_ExpectNumber(&ts);
13348 if (number == -1)
return NULL;
13349 if (i < ndim && (
size_t) number != ctx->head->field->type->arraysize[i])
13350 return PyErr_Format(PyExc_ValueError,
13351 "Expected a dimension of size %zu, got %d",
13352 ctx->head->field->type->arraysize[i], number);
13353 if (*ts !=
',' && *ts !=
')')
13354 return PyErr_Format(PyExc_ValueError,
13355 "Expected a comma in format string, got '%c'", *ts);
13356 if (*ts ==
',') ts++;
13360 return PyErr_Format(PyExc_ValueError,
"Expected %d dimension(s), got %d",
13361 ctx->head->field->type->ndim, i);
13363 PyErr_SetString(PyExc_ValueError,
13364 "Unexpected end of format string, expected ')'");
13367 ctx->is_valid_array = 1;
13368 ctx->new_count = 1;
13372 static const char* __Pyx_BufFmt_CheckString(__Pyx_BufFmt_Context* ctx,
const char* ts) {
13377 if (ctx->enc_type != 0 && ctx->head == NULL) {
13378 __Pyx_BufFmt_RaiseExpected(ctx);
13381 if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1)
return NULL;
13382 if (ctx->head != NULL) {
13383 __Pyx_BufFmt_RaiseExpected(ctx);
13393 if (!__Pyx_IsLittleEndian()) {
13394 PyErr_SetString(PyExc_ValueError,
"Little-endian buffer not supported on big-endian compiler");
13397 ctx->new_packmode =
'=';
13402 if (__Pyx_IsLittleEndian()) {
13403 PyErr_SetString(PyExc_ValueError,
"Big-endian buffer not supported on little-endian compiler");
13406 ctx->new_packmode =
'=';
13412 ctx->new_packmode = *ts++;
13416 const char* ts_after_sub;
13417 size_t i, struct_count = ctx->new_count;
13418 size_t struct_alignment = ctx->struct_alignment;
13419 ctx->new_count = 1;
13422 PyErr_SetString(PyExc_ValueError,
"Buffer acquisition: Expected '{' after 'T'");
13425 if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1)
return NULL;
13427 ctx->enc_count = 0;
13428 ctx->struct_alignment = 0;
13431 for (i = 0; i != struct_count; ++
i) {
13432 ts_after_sub = __Pyx_BufFmt_CheckString(ctx, ts);
13433 if (!ts_after_sub)
return NULL;
13436 if (struct_alignment) ctx->struct_alignment = struct_alignment;
13441 size_t alignment = ctx->struct_alignment;
13443 if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1)
return NULL;
13445 if (alignment && ctx->fmt_offset % alignment) {
13446 ctx->fmt_offset += alignment - (ctx->fmt_offset % alignment);
13451 if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1)
return NULL;
13452 ctx->fmt_offset += ctx->new_count;
13453 ctx->new_count = 1;
13454 ctx->enc_count = 0;
13456 ctx->enc_packmode = ctx->new_packmode;
13462 if (*ts !=
'f' && *ts !=
'd' && *ts !=
'g') {
13463 __Pyx_BufFmt_RaiseUnexpectedChar(
'Z');
13466 case 'c':
case 'b':
case 'B':
case 'h':
case 'H':
case 'i':
case 'I':
13467 case 'l':
case 'L':
case 'q':
case 'Q':
13468 case 'f':
case 'd':
case 'g':
13469 case 'O':
case 'p':
13470 if (ctx->enc_type == *ts && got_Z == ctx->is_complex &&
13471 ctx->enc_packmode == ctx->new_packmode) {
13472 ctx->enc_count += ctx->new_count;
13473 ctx->new_count = 1;
13479 if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1)
return NULL;
13480 ctx->enc_count = ctx->new_count;
13481 ctx->enc_packmode = ctx->new_packmode;
13482 ctx->enc_type = *ts;
13483 ctx->is_complex = got_Z;
13485 ctx->new_count = 1;
13490 while(*ts !=
':') ++ts;
13494 if (!__pyx_buffmt_parse_array(ctx, &ts))
return NULL;
13498 int number = __Pyx_BufFmt_ExpectNumber(&ts);
13499 if (number == -1)
return NULL;
13500 ctx->new_count = (size_t)number;
13505 static CYTHON_INLINE
void __Pyx_ZeroBuffer(Py_buffer* buf) {
13508 buf->strides = __Pyx_zeros;
13509 buf->shape = __Pyx_zeros;
13510 buf->suboffsets = __Pyx_minusones;
13512 static CYTHON_INLINE
int __Pyx_GetBufferAndValidate(
13513 Py_buffer* buf, PyObject* obj, __Pyx_TypeInfo* dtype,
int flags,
13514 int nd,
int cast, __Pyx_BufFmt_StackElem* stack)
13516 if (obj == Py_None || obj == NULL) {
13517 __Pyx_ZeroBuffer(buf);
13521 if (__Pyx_GetBuffer(obj, buf, flags) == -1)
goto fail;
13522 if (buf->ndim != nd) {
13523 PyErr_Format(PyExc_ValueError,
13524 "Buffer has wrong number of dimensions (expected %d, got %d)",
13529 __Pyx_BufFmt_Context ctx;
13530 __Pyx_BufFmt_Init(&ctx, stack, dtype);
13531 if (!__Pyx_BufFmt_CheckString(&ctx, buf->format))
goto fail;
13533 if ((
unsigned)buf->itemsize != dtype->size) {
13534 PyErr_Format(PyExc_ValueError,
13535 "Item size of buffer (%" CYTHON_FORMAT_SSIZE_T
"d byte%s) does not match size of '%s' (%" CYTHON_FORMAT_SSIZE_T
"d byte%s)",
13536 buf->itemsize, (buf->itemsize > 1) ?
"s" :
"",
13537 dtype->name, (Py_ssize_t)dtype->size, (dtype->size > 1) ?
"s" :
"");
13540 if (buf->suboffsets == NULL) buf->suboffsets = __Pyx_minusones;
13543 __Pyx_ZeroBuffer(buf);
13546 static CYTHON_INLINE
void __Pyx_SafeReleaseBuffer(Py_buffer* info) {
13547 if (info->buf == NULL)
return;
13548 if (info->suboffsets == __Pyx_minusones) info->suboffsets = NULL;
13549 __Pyx_ReleaseBuffer(info);
13553 static CYTHON_INLINE
int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type) {
13554 if (unlikely(!type)) {
13555 PyErr_SetString(PyExc_SystemError,
"Missing type object");
13558 if (likely(PyObject_TypeCheck(obj, type)))
13560 PyErr_Format(PyExc_TypeError,
"Cannot convert %.200s to %.200s",
13561 Py_TYPE(obj)->tp_name, type->tp_name);
13566 static void __Pyx_RaiseBufferFallbackError(
void) {
13567 PyErr_SetString(PyExc_ValueError,
13568 "Buffer acquisition failed on assignment; and then reacquiring the old buffer failed too!");
13572 #if !CYTHON_COMPILING_IN_PYPY
13573 static PyObject* __Pyx_PyInt_EqObjC(PyObject *op1, PyObject *op2, CYTHON_UNUSED
long intval, CYTHON_UNUSED
int inplace) {
13577 #if PY_MAJOR_VERSION < 3
13578 if (likely(PyInt_CheckExact(op1))) {
13579 const long b = intval;
13580 long a = PyInt_AS_LONG(op1);
13588 #if CYTHON_USE_PYLONG_INTERNALS
13589 if (likely(PyLong_CheckExact(op1))) {
13590 const long b = intval;
13592 const digit* digits = ((PyLongObject*)op1)->ob_digit;
13593 const Py_ssize_t size = Py_SIZE(op1);
13594 if (likely(__Pyx_sst_abs(size) <= 1)) {
13595 a = likely(size) ? digits[0] : 0;
13596 if (size == -1) a = -a;
13600 if (8 *
sizeof(
long) - 1 > 2 * PyLong_SHIFT) {
13601 a = -(long) (((((
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0]));
13605 if (8 *
sizeof(
long) - 1 > 2 * PyLong_SHIFT) {
13606 a = (long) (((((
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0]));
13610 if (8 *
sizeof(
long) - 1 > 3 * PyLong_SHIFT) {
13611 a = -(long) (((((((
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0]));
13615 if (8 *
sizeof(
long) - 1 > 3 * PyLong_SHIFT) {
13616 a = (long) (((((((
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0]));
13620 if (8 *
sizeof(
long) - 1 > 4 * PyLong_SHIFT) {
13621 a = -(long) (((((((((
unsigned long)digits[3]) << PyLong_SHIFT) | (
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0]));
13625 if (8 *
sizeof(
long) - 1 > 4 * PyLong_SHIFT) {
13626 a = (long) (((((((((
unsigned long)digits[3]) << PyLong_SHIFT) | (
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0]));
13629 #if PyLong_SHIFT < 30 && PyLong_SHIFT != 15
13630 default:
return PyLong_Type.tp_richcompare(op1, op2, Py_EQ);
13632 default: Py_RETURN_FALSE;
13643 if (PyFloat_CheckExact(op1)) {
13644 const long b = intval;
13645 double a = PyFloat_AS_DOUBLE(op1);
13646 if ((
double)a == (
double)b) {
13652 return PyObject_RichCompare(op1, op2, Py_EQ);
13657 static CYTHON_INLINE
int __Pyx_CheckKeywordStrings(
13659 const char* function_name,
13663 Py_ssize_t pos = 0;
13664 #if CYTHON_COMPILING_IN_PYPY
13665 if (!kw_allowed && PyDict_Next(kwdict, &pos, &key, 0))
13666 goto invalid_keyword;
13669 while (PyDict_Next(kwdict, &pos, &key, 0)) {
13670 #if PY_MAJOR_VERSION < 3
13671 if (unlikely(!PyString_CheckExact(key)) && unlikely(!PyString_Check(key)))
13673 if (unlikely(!PyUnicode_Check(key)))
13674 goto invalid_keyword_type;
13676 if ((!kw_allowed) && unlikely(key))
13677 goto invalid_keyword;
13679 invalid_keyword_type:
13680 PyErr_Format(PyExc_TypeError,
13681 "%.200s() keywords must be strings", function_name);
13685 PyErr_Format(PyExc_TypeError,
13686 #
if PY_MAJOR_VERSION < 3
13687 "%.200s() got an unexpected keyword argument '%.200s'",
13688 function_name, PyString_AsString(key));
13690 "%s() got an unexpected keyword argument '%U'",
13691 function_name, key);
13697 #if CYTHON_COMPILING_IN_CPYTHON
13698 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallNoArg(PyObject *func) {
13699 #if CYTHON_FAST_PYCALL
13700 if (PyFunction_Check(func)) {
13701 return __Pyx_PyFunction_FastCall(func, NULL, 0);
13704 #ifdef __Pyx_CyFunction_USED
13705 if (likely(PyCFunction_Check(func) || PyObject_TypeCheck(func, __pyx_CyFunctionType))) {
13707 if (likely(PyCFunction_Check(func))) {
13709 if (likely(PyCFunction_GET_FLAGS(func) & METH_NOARGS)) {
13710 return __Pyx_PyObject_CallMethO(func, NULL);
13713 return __Pyx_PyObject_Call(func, __pyx_empty_tuple, NULL);
13718 static PyObject* __Pyx_PyObject_CallMethod1(PyObject* obj, PyObject* method_name, PyObject* arg) {
13719 PyObject *method, *result = NULL;
13720 method = __Pyx_PyObject_GetAttrStr(obj, method_name);
13721 if (unlikely(!method))
goto done;
13722 #if CYTHON_UNPACK_METHODS
13723 if (likely(PyMethod_Check(method))) {
13724 PyObject *
self = PyMethod_GET_SELF(method);
13725 if (likely(
self)) {
13727 PyObject *
function = PyMethod_GET_FUNCTION(method);
13728 #if CYTHON_FAST_PYCALL
13729 if (PyFunction_Check(
function)) {
13730 PyObject *args[2] = {
self, arg};
13731 result = __Pyx_PyFunction_FastCall(
function, args, 2);
13735 #if CYTHON_FAST_PYCCALL
13736 if (__Pyx_PyFastCFunction_Check(
function)) {
13737 PyObject *args[2] = {
self, arg};
13738 result = __Pyx_PyCFunction_FastCall(
function, args, 2);
13742 args = PyTuple_New(2);
13743 if (unlikely(!args))
goto done;
13745 PyTuple_SET_ITEM(args, 0,
self);
13747 PyTuple_SET_ITEM(args, 1, arg);
13748 Py_INCREF(
function);
13749 Py_DECREF(method); method = NULL;
13750 result = __Pyx_PyObject_Call(
function, args, NULL);
13752 Py_DECREF(
function);
13757 result = __Pyx_PyObject_CallOneArg(method, arg);
13759 Py_XDECREF(method);
13764 static CYTHON_INLINE
int __Pyx_PyObject_Append(PyObject* L, PyObject* x) {
13765 if (likely(PyList_CheckExact(L))) {
13766 if (unlikely(__Pyx_PyList_Append(L, x) < 0))
return -1;
13768 PyObject* retval = __Pyx_PyObject_CallMethod1(L, __pyx_n_s_append, x);
13769 if (unlikely(!retval))
13777 static CYTHON_INLINE
void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected) {
13778 PyErr_Format(PyExc_ValueError,
13779 "too many values to unpack (expected %" CYTHON_FORMAT_SSIZE_T
"d)", expected);
13783 static CYTHON_INLINE
void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index) {
13784 PyErr_Format(PyExc_ValueError,
13785 "need more than %" CYTHON_FORMAT_SSIZE_T
"d value%.1s to unpack",
13786 index, (index == 1) ?
"" :
"s");
13790 static CYTHON_INLINE
void __Pyx_RaiseNoneNotIterableError(
void) {
13791 PyErr_SetString(PyExc_TypeError,
"'NoneType' object is not iterable");
13795 #if CYTHON_FAST_THREAD_STATE
13796 static CYTHON_INLINE
void __Pyx__ExceptionSave(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) {
13797 *type = tstate->exc_type;
13798 *value = tstate->exc_value;
13799 *tb = tstate->exc_traceback;
13801 Py_XINCREF(*value);
13804 static CYTHON_INLINE
void __Pyx__ExceptionReset(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb) {
13805 PyObject *tmp_type, *tmp_value, *tmp_tb;
13806 tmp_type = tstate->exc_type;
13807 tmp_value = tstate->exc_value;
13808 tmp_tb = tstate->exc_traceback;
13809 tstate->exc_type = type;
13810 tstate->exc_value = value;
13811 tstate->exc_traceback = tb;
13812 Py_XDECREF(tmp_type);
13813 Py_XDECREF(tmp_value);
13814 Py_XDECREF(tmp_tb);
13819 #if CYTHON_FAST_THREAD_STATE
13820 static CYTHON_INLINE
int __Pyx_PyErr_ExceptionMatchesInState(PyThreadState* tstate, PyObject* err) {
13821 PyObject *exc_type = tstate->curexc_type;
13822 if (exc_type == err)
return 1;
13823 if (unlikely(!exc_type))
return 0;
13824 return PyErr_GivenExceptionMatches(exc_type, err);
13829 #if CYTHON_FAST_THREAD_STATE
13830 static int __Pyx__GetException(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) {
13832 static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb) {
13834 PyObject *local_type, *local_value, *local_tb;
13835 #if CYTHON_FAST_THREAD_STATE
13836 PyObject *tmp_type, *tmp_value, *tmp_tb;
13837 local_type = tstate->curexc_type;
13838 local_value = tstate->curexc_value;
13839 local_tb = tstate->curexc_traceback;
13840 tstate->curexc_type = 0;
13841 tstate->curexc_value = 0;
13842 tstate->curexc_traceback = 0;
13844 PyErr_Fetch(&local_type, &local_value, &local_tb);
13846 PyErr_NormalizeException(&local_type, &local_value, &local_tb);
13847 #if CYTHON_FAST_THREAD_STATE
13848 if (unlikely(tstate->curexc_type))
13850 if (unlikely(PyErr_Occurred()))
13853 #if PY_MAJOR_VERSION >= 3
13855 if (unlikely(PyException_SetTraceback(local_value, local_tb) < 0))
13859 Py_XINCREF(local_tb);
13860 Py_XINCREF(local_type);
13861 Py_XINCREF(local_value);
13862 *type = local_type;
13863 *value = local_value;
13865 #if CYTHON_FAST_THREAD_STATE
13866 tmp_type = tstate->exc_type;
13867 tmp_value = tstate->exc_value;
13868 tmp_tb = tstate->exc_traceback;
13869 tstate->exc_type = local_type;
13870 tstate->exc_value = local_value;
13871 tstate->exc_traceback = local_tb;
13872 Py_XDECREF(tmp_type);
13873 Py_XDECREF(tmp_value);
13874 Py_XDECREF(tmp_tb);
13876 PyErr_SetExcInfo(local_type, local_value, local_tb);
13883 Py_XDECREF(local_type);
13884 Py_XDECREF(local_value);
13885 Py_XDECREF(local_tb);
13890 static int __Pyx_SetVtable(PyObject *dict,
void *vtable) {
13891 #if PY_VERSION_HEX >= 0x02070000
13892 PyObject *ob = PyCapsule_New(vtable, 0, 0);
13894 PyObject *ob = PyCObject_FromVoidPtr(vtable, 0);
13898 if (PyDict_SetItem(dict, __pyx_n_s_pyx_vtable, ob) < 0)
13908 static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list,
int level) {
13909 PyObject *empty_list = 0;
13910 PyObject *module = 0;
13911 PyObject *global_dict = 0;
13912 PyObject *empty_dict = 0;
13914 #if PY_VERSION_HEX < 0x03030000
13915 PyObject *py_import;
13916 py_import = __Pyx_PyObject_GetAttrStr(__pyx_b, __pyx_n_s_import);
13923 empty_list = PyList_New(0);
13928 global_dict = PyModule_GetDict(__pyx_m);
13931 empty_dict = PyDict_New();
13935 #if PY_MAJOR_VERSION >= 3
13937 if (strchr(__Pyx_MODULE_NAME,
'.')) {
13938 #if PY_VERSION_HEX < 0x03030000
13939 PyObject *py_level = PyInt_FromLong(1);
13942 module = PyObject_CallFunctionObjArgs(py_import,
13943 name, global_dict, empty_dict, list, py_level, NULL);
13944 Py_DECREF(py_level);
13946 module = PyImport_ImportModuleLevelObject(
13947 name, global_dict, empty_dict, list, 1);
13950 if (!PyErr_ExceptionMatches(PyExc_ImportError))
13959 #if PY_VERSION_HEX < 0x03030000
13960 PyObject *py_level = PyInt_FromLong(level);
13963 module = PyObject_CallFunctionObjArgs(py_import,
13964 name, global_dict, empty_dict, list, py_level, NULL);
13965 Py_DECREF(py_level);
13967 module = PyImport_ImportModuleLevelObject(
13968 name, global_dict, empty_dict, list, level);
13973 #if PY_VERSION_HEX < 0x03030000
13974 Py_XDECREF(py_import);
13976 Py_XDECREF(empty_list);
13977 Py_XDECREF(empty_dict);
13982 static PyObject *__Pyx_CalculateMetaclass(PyTypeObject *metaclass, PyObject *bases) {
13983 Py_ssize_t
i, nbases = PyTuple_GET_SIZE(bases);
13984 for (i=0; i < nbases; i++) {
13985 PyTypeObject *tmptype;
13986 PyObject *tmp = PyTuple_GET_ITEM(bases, i);
13987 tmptype = Py_TYPE(tmp);
13988 #if PY_MAJOR_VERSION < 3
13989 if (tmptype == &PyClass_Type)
13993 metaclass = tmptype;
13996 if (PyType_IsSubtype(metaclass, tmptype))
13998 if (PyType_IsSubtype(tmptype, metaclass)) {
13999 metaclass = tmptype;
14002 PyErr_SetString(PyExc_TypeError,
14003 "metaclass conflict: "
14004 "the metaclass of a derived class "
14005 "must be a (non-strict) subclass "
14006 "of the metaclasses of all its bases");
14010 #if PY_MAJOR_VERSION < 3
14011 metaclass = &PyClass_Type;
14013 metaclass = &PyType_Type;
14016 Py_INCREF((PyObject*) metaclass);
14017 return (PyObject*) metaclass;
14021 static PyObject *__Pyx_Py3MetaclassPrepare(PyObject *metaclass, PyObject *bases, PyObject *name,
14022 PyObject *qualname, PyObject *mkw, PyObject *modname, PyObject *doc) {
14025 PyObject *prep = __Pyx_PyObject_GetAttrStr(metaclass, __pyx_n_s_prepare);
14027 PyObject *pargs = PyTuple_Pack(2, name, bases);
14028 if (unlikely(!pargs)) {
14032 ns = PyObject_Call(prep, pargs, mkw);
14036 if (unlikely(!PyErr_ExceptionMatches(PyExc_AttributeError)))
14046 if (unlikely(PyObject_SetItem(ns, __pyx_n_s_module, modname) < 0))
goto bad;
14047 if (unlikely(PyObject_SetItem(ns, __pyx_n_s_qualname, qualname) < 0))
goto bad;
14048 if (unlikely(doc && PyObject_SetItem(ns, __pyx_n_s_doc, doc) < 0))
goto bad;
14054 static PyObject *__Pyx_Py3ClassCreate(PyObject *metaclass, PyObject *name, PyObject *bases,
14055 PyObject *dict, PyObject *mkw,
14056 int calculate_metaclass,
int allow_py2_metaclass) {
14057 PyObject *result, *margs;
14058 PyObject *owned_metaclass = NULL;
14059 if (allow_py2_metaclass) {
14060 owned_metaclass = PyObject_GetItem(dict, __pyx_n_s_metaclass);
14061 if (owned_metaclass) {
14062 metaclass = owned_metaclass;
14063 }
else if (likely(PyErr_ExceptionMatches(PyExc_KeyError))) {
14069 if (calculate_metaclass && (!metaclass || PyType_Check(metaclass))) {
14070 metaclass = __Pyx_CalculateMetaclass((PyTypeObject*) metaclass, bases);
14071 Py_XDECREF(owned_metaclass);
14072 if (unlikely(!metaclass))
14074 owned_metaclass = metaclass;
14076 margs = PyTuple_Pack(3, name, bases, dict);
14077 if (unlikely(!margs)) {
14080 result = PyObject_Call(metaclass, margs, mkw);
14083 Py_XDECREF(owned_metaclass);
14088 static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries,
int count,
int code_line) {
14089 int start = 0, mid = 0, end = count - 1;
14090 if (end >= 0 && code_line > entries[end].code_line) {
14093 while (start < end) {
14094 mid = start + (end - start) / 2;
14095 if (code_line < entries[mid].code_line) {
14097 }
else if (code_line > entries[mid].code_line) {
14103 if (code_line <= entries[mid].code_line) {
14109 static PyCodeObject *__pyx_find_code_object(
int code_line) {
14110 PyCodeObject* code_object;
14112 if (unlikely(!code_line) || unlikely(!__pyx_code_cache.entries)) {
14115 pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line);
14116 if (unlikely(pos >= __pyx_code_cache.count) || unlikely(__pyx_code_cache.entries[pos].code_line != code_line)) {
14119 code_object = __pyx_code_cache.entries[pos].code_object;
14120 Py_INCREF(code_object);
14121 return code_object;
14123 static void __pyx_insert_code_object(
int code_line, PyCodeObject* code_object) {
14125 __Pyx_CodeObjectCacheEntry* entries = __pyx_code_cache.entries;
14126 if (unlikely(!code_line)) {
14129 if (unlikely(!entries)) {
14130 entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Malloc(64*
sizeof(__Pyx_CodeObjectCacheEntry));
14131 if (likely(entries)) {
14132 __pyx_code_cache.entries = entries;
14133 __pyx_code_cache.max_count = 64;
14134 __pyx_code_cache.count = 1;
14135 entries[0].code_line = code_line;
14136 entries[0].code_object = code_object;
14137 Py_INCREF(code_object);
14141 pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line);
14142 if ((pos < __pyx_code_cache.count) && unlikely(__pyx_code_cache.entries[pos].code_line == code_line)) {
14143 PyCodeObject* tmp = entries[pos].code_object;
14144 entries[pos].code_object = code_object;
14148 if (__pyx_code_cache.count == __pyx_code_cache.max_count) {
14149 int new_max = __pyx_code_cache.max_count + 64;
14150 entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Realloc(
14151 __pyx_code_cache.entries, (
size_t)new_max*
sizeof(__Pyx_CodeObjectCacheEntry));
14152 if (unlikely(!entries)) {
14155 __pyx_code_cache.entries = entries;
14156 __pyx_code_cache.max_count = new_max;
14158 for (i=__pyx_code_cache.count; i>pos; i--) {
14159 entries[
i] = entries[i-1];
14161 entries[pos].code_line = code_line;
14162 entries[pos].code_object = code_object;
14163 __pyx_code_cache.count++;
14164 Py_INCREF(code_object);
14168 #include "compile.h"
14169 #include "frameobject.h"
14170 #include "traceback.h"
14171 static PyCodeObject* __Pyx_CreateCodeObjectForTraceback(
14172 const char *funcname,
int c_line,
14173 int py_line,
const char *filename) {
14174 PyCodeObject *py_code = 0;
14175 PyObject *py_srcfile = 0;
14176 PyObject *py_funcname = 0;
14177 #if PY_MAJOR_VERSION < 3
14178 py_srcfile = PyString_FromString(filename);
14180 py_srcfile = PyUnicode_FromString(filename);
14182 if (!py_srcfile)
goto bad;
14184 #if PY_MAJOR_VERSION < 3
14185 py_funcname = PyString_FromFormat(
"%s (%s:%d)", funcname, __pyx_cfilenm, c_line);
14187 py_funcname = PyUnicode_FromFormat(
"%s (%s:%d)", funcname, __pyx_cfilenm, c_line);
14191 #if PY_MAJOR_VERSION < 3
14192 py_funcname = PyString_FromString(funcname);
14194 py_funcname = PyUnicode_FromString(funcname);
14197 if (!py_funcname)
goto bad;
14198 py_code = __Pyx_PyCode_New(
14215 Py_DECREF(py_srcfile);
14216 Py_DECREF(py_funcname);
14219 Py_XDECREF(py_srcfile);
14220 Py_XDECREF(py_funcname);
14223 static void __Pyx_AddTraceback(
const char *funcname,
int c_line,
14224 int py_line,
const char *filename) {
14225 PyCodeObject *py_code = 0;
14226 PyFrameObject *py_frame = 0;
14227 py_code = __pyx_find_code_object(c_line ? c_line : py_line);
14229 py_code = __Pyx_CreateCodeObjectForTraceback(
14230 funcname, c_line, py_line, filename);
14231 if (!py_code)
goto bad;
14232 __pyx_insert_code_object(c_line ? c_line : py_line, py_code);
14234 py_frame = PyFrame_New(
14235 PyThreadState_GET(),
14240 if (!py_frame)
goto bad;
14241 __Pyx_PyFrame_SetLineNumber(py_frame, py_line);
14242 PyTraceBack_Here(py_frame);
14244 Py_XDECREF(py_code);
14245 Py_XDECREF(py_frame);
14248 #if PY_MAJOR_VERSION < 3
14249 static int __Pyx_GetBuffer(PyObject *obj, Py_buffer *view,
int flags) {
14250 if (PyObject_CheckBuffer(obj))
return PyObject_GetBuffer(obj, view, flags);
14251 if (PyObject_TypeCheck(obj, __pyx_ptype_5numpy_ndarray))
return __pyx_pw_5numpy_7ndarray_1__getbuffer__(obj, view, flags);
14252 PyErr_Format(PyExc_TypeError,
"'%.200s' does not have the buffer interface", Py_TYPE(obj)->tp_name);
14255 static void __Pyx_ReleaseBuffer(Py_buffer *view) {
14256 PyObject *obj = view->obj;
14258 if (PyObject_CheckBuffer(obj)) {
14259 PyBuffer_Release(view);
14262 if (PyObject_TypeCheck(obj, __pyx_ptype_5numpy_ndarray)) { __pyx_pw_5numpy_7ndarray_3__releasebuffer__(obj, view);
return; }
14270 static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(
int value) {
14271 const int neg_one = (int) -1, const_zero = (
int) 0;
14272 const int is_unsigned = neg_one > const_zero;
14274 if (
sizeof(
int) <
sizeof(long)) {
14275 return PyInt_FromLong((
long) value);
14276 }
else if (
sizeof(
int) <=
sizeof(
unsigned long)) {
14277 return PyLong_FromUnsignedLong((
unsigned long) value);
14278 #ifdef HAVE_LONG_LONG
14279 }
else if (
sizeof(
int) <=
sizeof(
unsigned PY_LONG_LONG)) {
14280 return PyLong_FromUnsignedLongLong((
unsigned PY_LONG_LONG) value);
14284 if (
sizeof(
int) <=
sizeof(
long)) {
14285 return PyInt_FromLong((
long) value);
14286 #ifdef HAVE_LONG_LONG
14287 }
else if (
sizeof(
int) <=
sizeof(PY_LONG_LONG)) {
14288 return PyLong_FromLongLong((PY_LONG_LONG) value);
14293 int one = 1;
int little = (int)*(
unsigned char *)&one;
14294 unsigned char *bytes = (
unsigned char *)&value;
14295 return _PyLong_FromByteArray(bytes,
sizeof(
int),
14296 little, !is_unsigned);
14303 res = PyDict_New();
if (unlikely(!res))
return NULL;
14304 member = __Pyx_PyObject_FromString(s.
string);
if (unlikely(!member))
goto bad;
14305 if (unlikely(PyDict_SetItem(res, __pyx_n_s_string, member) < 0))
goto bad;
14307 member = __Pyx_PyInt_From_int(s.
number);
if (unlikely(!member))
goto bad;
14308 if (unlikely(PyDict_SetItem(res, __pyx_n_s_number, member) < 0))
goto bad;
14310 member = __Pyx_PyObject_FromString(s.
backend);
if (unlikely(!member))
goto bad;
14311 if (unlikely(PyDict_SetItem(res, __pyx_n_s_backend, member) < 0))
goto bad;
14313 member = __Pyx_PyObject_FromString(s.
user);
if (unlikely(!member))
goto bad;
14314 if (unlikely(PyDict_SetItem(res, __pyx_n_s_user, member) < 0))
goto bad;
14318 Py_XDECREF(member);
14323 #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION < 3
14324 static PyObject *__Pyx_GetStdout(
void) {
14325 PyObject *f = PySys_GetObject((
char *)
"stdout");
14327 PyErr_SetString(PyExc_RuntimeError,
"lost sys.stdout");
14331 static int __Pyx_Print(PyObject* f, PyObject *arg_tuple,
int newline) {
14334 if (!(f = __Pyx_GetStdout()))
14338 for (i=0; i < PyTuple_GET_SIZE(arg_tuple); i++) {
14340 if (PyFile_SoftSpace(f, 1)) {
14341 if (PyFile_WriteString(
" ", f) < 0)
14344 v = PyTuple_GET_ITEM(arg_tuple, i);
14345 if (PyFile_WriteObject(v, f, Py_PRINT_RAW) < 0)
14347 if (PyString_Check(v)) {
14348 char *s = PyString_AsString(v);
14349 Py_ssize_t len = PyString_Size(v);
14351 switch (s[len-1]) {
14353 case '\f':
case '\r':
case '\n':
case '\t':
case '\v':
14354 PyFile_SoftSpace(f, 0);
14362 if (PyFile_WriteString(
"\n", f) < 0)
14364 PyFile_SoftSpace(f, 0);
14373 static int __Pyx_Print(PyObject* stream, PyObject *arg_tuple,
int newline) {
14374 PyObject* kwargs = 0;
14375 PyObject* result = 0;
14376 PyObject* end_string;
14377 if (unlikely(!__pyx_print)) {
14378 __pyx_print = PyObject_GetAttr(__pyx_b, __pyx_n_s_print);
14383 kwargs = PyDict_New();
14384 if (unlikely(!kwargs))
14386 if (unlikely(PyDict_SetItem(kwargs, __pyx_n_s_file, stream) < 0))
14389 end_string = PyUnicode_FromStringAndSize(
" ", 1);
14390 if (unlikely(!end_string))
14392 if (PyDict_SetItem(kwargs, __pyx_n_s_end, end_string) < 0) {
14393 Py_DECREF(end_string);
14396 Py_DECREF(end_string);
14398 }
else if (!newline) {
14399 if (unlikely(!__pyx_print_kwargs)) {
14400 __pyx_print_kwargs = PyDict_New();
14401 if (unlikely(!__pyx_print_kwargs))
14403 end_string = PyUnicode_FromStringAndSize(
" ", 1);
14404 if (unlikely(!end_string))
14406 if (PyDict_SetItem(__pyx_print_kwargs, __pyx_n_s_end, end_string) < 0) {
14407 Py_DECREF(end_string);
14410 Py_DECREF(end_string);
14412 kwargs = __pyx_print_kwargs;
14414 result = PyObject_Call(__pyx_print, arg_tuple, kwargs);
14415 if (unlikely(kwargs) && (kwargs != __pyx_print_kwargs))
14422 if (kwargs != __pyx_print_kwargs)
14423 Py_XDECREF(kwargs);
14429 #define __PYX_VERIFY_RETURN_INT(target_type, func_type, func_value)\
14430 __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 0)
14431 #define __PYX_VERIFY_RETURN_INT_EXC(target_type, func_type, func_value)\
14432 __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 1)
14433 #define __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, exc)\
14435 func_type value = func_value;\
14436 if (sizeof(target_type) < sizeof(func_type)) {\
14437 if (unlikely(value != (func_type) (target_type) value)) {\
14438 func_type zero = 0;\
14439 if (exc && unlikely(value == (func_type)-1 && PyErr_Occurred()))\
14440 return (target_type) -1;\
14441 if (is_unsigned && unlikely(value < zero))\
14442 goto raise_neg_overflow;\
14444 goto raise_overflow;\
14447 return (target_type) value;\
14453 res = PyDict_New();
if (unlikely(!res))
return NULL;
14454 member = PyFloat_FromDouble(s.
ZN);
if (unlikely(!member))
goto bad;
14455 if (unlikely(PyDict_SetItem(res, __pyx_n_s_ZN, member) < 0))
goto bad;
14457 member = PyFloat_FromDouble(s.
ZA);
if (unlikely(!member))
goto bad;
14458 if (unlikely(PyDict_SetItem(res, __pyx_n_s_ZA, member) < 0))
goto bad;
14460 member = PyFloat_FromDouble(s.
MI);
if (unlikely(!member))
goto bad;
14461 if (unlikely(PyDict_SetItem(res, __pyx_n_s_MI, member) < 0))
goto bad;
14463 member = __Pyx_PyInt_From_int(s.
LR);
if (unlikely(!member))
goto bad;
14464 if (unlikely(PyDict_SetItem(res, __pyx_n_s_LR, member) < 0))
goto bad;
14466 member = PyFloat_FromDouble(s.
real_specifier);
if (unlikely(!member))
goto bad;
14467 if (unlikely(PyDict_SetItem(res, __pyx_n_s_real_specifier, member) < 0))
goto bad;
14469 member = __Pyx_PyInt_From_int(s.
int_specifier);
if (unlikely(!member))
goto bad;
14470 if (unlikely(PyDict_SetItem(res, __pyx_n_s_int_specifier, member) < 0))
goto bad;
14474 Py_XDECREF(member);
14479 #if CYTHON_CCOMPLEX
14481 static CYTHON_INLINE __pyx_t_float_complex __pyx_t_float_complex_from_parts(
float x,
float y) {
14482 return ::std::complex< float >(x, y);
14485 static CYTHON_INLINE __pyx_t_float_complex __pyx_t_float_complex_from_parts(
float x,
float y) {
14486 return x + y*(__pyx_t_float_complex)_Complex_I;
14490 static CYTHON_INLINE __pyx_t_float_complex __pyx_t_float_complex_from_parts(
float x,
float y) {
14491 __pyx_t_float_complex z;
14499 #if CYTHON_CCOMPLEX
14501 static CYTHON_INLINE
int __Pyx_c_eq_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
14502 return (a.real == b.real) && (a.imag == b.imag);
14504 static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_sum_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
14505 __pyx_t_float_complex z;
14506 z.real = a.real + b.real;
14507 z.imag = a.imag + b.imag;
14510 static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_diff_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
14511 __pyx_t_float_complex z;
14512 z.real = a.real - b.real;
14513 z.imag = a.imag - b.imag;
14516 static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_prod_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
14517 __pyx_t_float_complex z;
14518 z.real = a.real * b.real - a.imag * b.imag;
14519 z.imag = a.real * b.imag + a.imag * b.real;
14523 static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_quot_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
14525 return __pyx_t_float_complex_from_parts(a.real / b.real, a.imag / b.real);
14526 }
else if (fabsf(b.real) >= fabsf(b.imag)) {
14527 if (b.real == 0 && b.imag == 0) {
14528 return __pyx_t_float_complex_from_parts(a.real / b.real, a.imag / b.imag);
14530 float r = b.imag / b.real;
14531 float s = 1.0 / (b.real + b.imag * r);
14532 return __pyx_t_float_complex_from_parts(
14533 (a.real + a.imag * r) * s, (a.imag - a.real * r) * s);
14536 float r = b.real / b.imag;
14537 float s = 1.0 / (b.imag + b.real * r);
14538 return __pyx_t_float_complex_from_parts(
14539 (a.real * r + a.imag) * s, (a.imag * r - a.real) * s);
14543 static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_quot_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
14545 return __pyx_t_float_complex_from_parts(a.real / b.real, a.imag / b.real);
14547 float denom = b.real * b.real + b.imag * b.imag;
14548 return __pyx_t_float_complex_from_parts(
14549 (a.real * b.real + a.imag * b.imag) / denom,
14550 (a.imag * b.real - a.real * b.imag) / denom);
14554 static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_neg_float(__pyx_t_float_complex a) {
14555 __pyx_t_float_complex z;
14560 static CYTHON_INLINE
int __Pyx_c_is_zero_float(__pyx_t_float_complex a) {
14561 return (a.real == 0) && (a.imag == 0);
14563 static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_conj_float(__pyx_t_float_complex a) {
14564 __pyx_t_float_complex z;
14570 static CYTHON_INLINE
float __Pyx_c_abs_float(__pyx_t_float_complex z) {
14571 #if !defined(HAVE_HYPOT) || defined(_MSC_VER)
14572 return sqrtf(z.real*z.real + z.imag*z.imag);
14574 return hypotf(z.real, z.imag);
14577 static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_pow_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
14578 __pyx_t_float_complex z;
14579 float r, lnr, theta, z_r, z_theta;
14580 if (b.imag == 0 && b.real == (
int)b.real) {
14582 float denom = a.real * a.real + a.imag * a.imag;
14583 a.real = a.real / denom;
14584 a.imag = -a.imag / denom;
14587 switch ((
int)b.real) {
14595 z = __Pyx_c_prod_float(a, a);
14596 return __Pyx_c_prod_float(a, a);
14598 z = __Pyx_c_prod_float(a, a);
14599 return __Pyx_c_prod_float(z, a);
14601 z = __Pyx_c_prod_float(a, a);
14602 return __Pyx_c_prod_float(z, z);
14608 }
else if (b.imag == 0) {
14609 z.real = powf(a.real, b.real);
14612 }
else if (a.real > 0) {
14617 theta = atan2f(0, -1);
14620 r = __Pyx_c_abs_float(a);
14621 theta = atan2f(a.imag, a.real);
14624 z_r = expf(lnr * b.real - theta * b.imag);
14625 z_theta = theta * b.real + lnr * b.imag;
14626 z.real = z_r * cosf(z_theta);
14627 z.imag = z_r * sinf(z_theta);
14634 #if CYTHON_CCOMPLEX
14636 static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(
double x,
double y) {
14637 return ::std::complex< double >(x, y);
14640 static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(
double x,
double y) {
14641 return x + y*(__pyx_t_double_complex)_Complex_I;
14645 static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(
double x,
double y) {
14646 __pyx_t_double_complex z;
14654 #if CYTHON_CCOMPLEX
14656 static CYTHON_INLINE
int __Pyx_c_eq_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
14657 return (a.real == b.real) && (a.imag == b.imag);
14659 static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_sum_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
14660 __pyx_t_double_complex z;
14661 z.real = a.real + b.real;
14662 z.imag = a.imag + b.imag;
14665 static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_diff_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
14666 __pyx_t_double_complex z;
14667 z.real = a.real - b.real;
14668 z.imag = a.imag - b.imag;
14671 static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_prod_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
14672 __pyx_t_double_complex z;
14673 z.real = a.real * b.real - a.imag * b.imag;
14674 z.imag = a.real * b.imag + a.imag * b.real;
14678 static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_quot_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
14680 return __pyx_t_double_complex_from_parts(a.real / b.real, a.imag / b.real);
14681 }
else if (fabs(b.real) >= fabs(b.imag)) {
14682 if (b.real == 0 && b.imag == 0) {
14683 return __pyx_t_double_complex_from_parts(a.real / b.real, a.imag / b.imag);
14685 double r = b.imag / b.real;
14686 double s = 1.0 / (b.real + b.imag * r);
14687 return __pyx_t_double_complex_from_parts(
14688 (a.real + a.imag * r) * s, (a.imag - a.real * r) * s);
14691 double r = b.real / b.imag;
14692 double s = 1.0 / (b.imag + b.real * r);
14693 return __pyx_t_double_complex_from_parts(
14694 (a.real * r + a.imag) * s, (a.imag * r - a.real) * s);
14698 static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_quot_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
14700 return __pyx_t_double_complex_from_parts(a.real / b.real, a.imag / b.real);
14702 double denom = b.real * b.real + b.imag * b.imag;
14703 return __pyx_t_double_complex_from_parts(
14704 (a.real * b.real + a.imag * b.imag) / denom,
14705 (a.imag * b.real - a.real * b.imag) / denom);
14709 static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_neg_double(__pyx_t_double_complex a) {
14710 __pyx_t_double_complex z;
14715 static CYTHON_INLINE
int __Pyx_c_is_zero_double(__pyx_t_double_complex a) {
14716 return (a.real == 0) && (a.imag == 0);
14718 static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_conj_double(__pyx_t_double_complex a) {
14719 __pyx_t_double_complex z;
14725 static CYTHON_INLINE
double __Pyx_c_abs_double(__pyx_t_double_complex z) {
14726 #if !defined(HAVE_HYPOT) || defined(_MSC_VER)
14727 return sqrt(z.real*z.real + z.imag*z.imag);
14729 return hypot(z.real, z.imag);
14732 static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_pow_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
14733 __pyx_t_double_complex z;
14734 double r, lnr, theta, z_r, z_theta;
14735 if (b.imag == 0 && b.real == (
int)b.real) {
14737 double denom = a.real * a.real + a.imag * a.imag;
14738 a.real = a.real / denom;
14739 a.imag = -a.imag / denom;
14742 switch ((
int)b.real) {
14750 z = __Pyx_c_prod_double(a, a);
14751 return __Pyx_c_prod_double(a, a);
14753 z = __Pyx_c_prod_double(a, a);
14754 return __Pyx_c_prod_double(z, a);
14756 z = __Pyx_c_prod_double(a, a);
14757 return __Pyx_c_prod_double(z, z);
14763 }
else if (b.imag == 0) {
14764 z.real = pow(a.real, b.real);
14767 }
else if (a.real > 0) {
14772 theta = atan2(0, -1);
14775 r = __Pyx_c_abs_double(a);
14776 theta = atan2(a.imag, a.real);
14779 z_r = exp(lnr * b.real - theta * b.imag);
14780 z_theta = theta * b.real + lnr * b.imag;
14781 z.real = z_r * cos(z_theta);
14782 z.imag = z_r * sin(z_theta);
14789 static CYTHON_INLINE PyObject* __Pyx_PyInt_From_enum__NPY_TYPES(
enum NPY_TYPES value) {
14790 const enum NPY_TYPES neg_one = (
enum NPY_TYPES) -1, const_zero = (
enum NPY_TYPES) 0;
14791 const int is_unsigned = neg_one > const_zero;
14793 if (
sizeof(
enum NPY_TYPES) <
sizeof(long)) {
14794 return PyInt_FromLong((
long) value);
14795 }
else if (
sizeof(
enum NPY_TYPES) <=
sizeof(
unsigned long)) {
14796 return PyLong_FromUnsignedLong((
unsigned long) value);
14797 #ifdef HAVE_LONG_LONG
14798 }
else if (
sizeof(
enum NPY_TYPES) <=
sizeof(
unsigned PY_LONG_LONG)) {
14799 return PyLong_FromUnsignedLongLong((
unsigned PY_LONG_LONG) value);
14803 if (
sizeof(
enum NPY_TYPES) <=
sizeof(
long)) {
14804 return PyInt_FromLong((
long) value);
14805 #ifdef HAVE_LONG_LONG
14806 }
else if (
sizeof(
enum NPY_TYPES) <=
sizeof(PY_LONG_LONG)) {
14807 return PyLong_FromLongLong((PY_LONG_LONG) value);
14812 int one = 1;
int little = (int)*(
unsigned char *)&one;
14813 unsigned char *bytes = (
unsigned char *)&value;
14814 return _PyLong_FromByteArray(bytes,
sizeof(
enum NPY_TYPES),
14815 little, !is_unsigned);
14820 #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION < 3
14821 static int __Pyx_PrintOne(PyObject* f, PyObject *o) {
14823 if (!(f = __Pyx_GetStdout()))
14827 if (PyFile_SoftSpace(f, 0)) {
14828 if (PyFile_WriteString(
" ", f) < 0)
14831 if (PyFile_WriteObject(o, f, Py_PRINT_RAW) < 0)
14833 if (PyFile_WriteString(
"\n", f) < 0)
14842 return __Pyx_Print(f, NULL, 0);
14845 static int __Pyx_PrintOne(PyObject* stream, PyObject *o) {
14847 PyObject* arg_tuple = PyTuple_Pack(1, o);
14848 if (unlikely(!arg_tuple))
14850 res = __Pyx_Print(stream, arg_tuple, 1);
14851 Py_DECREF(arg_tuple);
14857 static CYTHON_INLINE
int __Pyx_PyInt_As_int(PyObject *x) {
14858 const int neg_one = (int) -1, const_zero = (
int) 0;
14859 const int is_unsigned = neg_one > const_zero;
14860 #if PY_MAJOR_VERSION < 3
14861 if (likely(PyInt_Check(x))) {
14862 if (
sizeof(
int) <
sizeof(long)) {
14863 __PYX_VERIFY_RETURN_INT(
int,
long, PyInt_AS_LONG(x))
14865 long val = PyInt_AS_LONG(x);
14866 if (is_unsigned && unlikely(val < 0)) {
14867 goto raise_neg_overflow;
14873 if (likely(PyLong_Check(x))) {
14875 #if CYTHON_USE_PYLONG_INTERNALS
14876 const digit* digits = ((PyLongObject*)x)->ob_digit;
14877 switch (Py_SIZE(x)) {
14878 case 0:
return (
int) 0;
14879 case 1: __PYX_VERIFY_RETURN_INT(
int, digit, digits[0])
14881 if (8 * sizeof(
int) > 1 * PyLong_SHIFT) {
14882 if (8 *
sizeof(
unsigned long) > 2 * PyLong_SHIFT) {
14883 __PYX_VERIFY_RETURN_INT(
int,
unsigned long, (((((
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
14884 }
else if (8 *
sizeof(
int) >= 2 * PyLong_SHIFT) {
14885 return (
int) (((((int)digits[1]) << PyLong_SHIFT) | (
int)digits[0]));
14890 if (8 *
sizeof(
int) > 2 * PyLong_SHIFT) {
14891 if (8 *
sizeof(
unsigned long) > 3 * PyLong_SHIFT) {
14892 __PYX_VERIFY_RETURN_INT(
int,
unsigned long, (((((((
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
14893 }
else if (8 *
sizeof(
int) >= 3 * PyLong_SHIFT) {
14894 return (
int) (((((((int)digits[2]) << PyLong_SHIFT) | (
int)digits[1]) << PyLong_SHIFT) | (int)digits[0]));
14899 if (8 *
sizeof(
int) > 3 * PyLong_SHIFT) {
14900 if (8 *
sizeof(
unsigned long) > 4 * PyLong_SHIFT) {
14901 __PYX_VERIFY_RETURN_INT(
int,
unsigned long, (((((((((
unsigned long)digits[3]) << PyLong_SHIFT) | (
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
14902 }
else if (8 *
sizeof(
int) >= 4 * PyLong_SHIFT) {
14903 return (
int) (((((((((int)digits[3]) << PyLong_SHIFT) | (
int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (
int)digits[0]));
14909 #if CYTHON_COMPILING_IN_CPYTHON
14910 if (unlikely(Py_SIZE(x) < 0)) {
14911 goto raise_neg_overflow;
14915 int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
14916 if (unlikely(result < 0))
14918 if (unlikely(result == 1))
14919 goto raise_neg_overflow;
14922 if (
sizeof(
int) <=
sizeof(
unsigned long)) {
14923 __PYX_VERIFY_RETURN_INT_EXC(
int,
unsigned long, PyLong_AsUnsignedLong(x))
14924 #ifdef HAVE_LONG_LONG
14925 }
else if (
sizeof(
int) <=
sizeof(
unsigned PY_LONG_LONG)) {
14926 __PYX_VERIFY_RETURN_INT_EXC(
int,
unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
14930 #if CYTHON_USE_PYLONG_INTERNALS
14931 const digit* digits = ((PyLongObject*)x)->ob_digit;
14932 switch (Py_SIZE(x)) {
14933 case 0:
return (
int) 0;
14934 case -1: __PYX_VERIFY_RETURN_INT(
int, sdigit, (sdigit) (-(sdigit)digits[0]))
14935 case 1: __PYX_VERIFY_RETURN_INT(
int, digit, +digits[0])
14937 if (8 * sizeof(
int) - 1 > 1 * PyLong_SHIFT) {
14938 if (8 *
sizeof(
unsigned long) > 2 * PyLong_SHIFT) {
14939 __PYX_VERIFY_RETURN_INT(
int,
long, -(
long) (((((
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
14940 }
else if (8 *
sizeof(
int) - 1 > 2 * PyLong_SHIFT) {
14941 return (
int) (((int)-1)*(((((int)digits[1]) << PyLong_SHIFT) | (
int)digits[0])));
14946 if (8 *
sizeof(
int) > 1 * PyLong_SHIFT) {
14947 if (8 *
sizeof(
unsigned long) > 2 * PyLong_SHIFT) {
14948 __PYX_VERIFY_RETURN_INT(
int,
unsigned long, (((((
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
14949 }
else if (8 *
sizeof(
int) - 1 > 2 * PyLong_SHIFT) {
14950 return (
int) ((((((int)digits[1]) << PyLong_SHIFT) | (
int)digits[0])));
14955 if (8 *
sizeof(
int) - 1 > 2 * PyLong_SHIFT) {
14956 if (8 *
sizeof(
unsigned long) > 3 * PyLong_SHIFT) {
14957 __PYX_VERIFY_RETURN_INT(
int,
long, -(
long) (((((((
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
14958 }
else if (8 *
sizeof(
int) - 1 > 3 * PyLong_SHIFT) {
14959 return (
int) (((int)-1)*(((((((int)digits[2]) << PyLong_SHIFT) | (
int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
14964 if (8 *
sizeof(
int) > 2 * PyLong_SHIFT) {
14965 if (8 *
sizeof(
unsigned long) > 3 * PyLong_SHIFT) {
14966 __PYX_VERIFY_RETURN_INT(
int,
unsigned long, (((((((
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
14967 }
else if (8 *
sizeof(
int) - 1 > 3 * PyLong_SHIFT) {
14968 return (
int) ((((((((int)digits[2]) << PyLong_SHIFT) | (
int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
14973 if (8 *
sizeof(
int) - 1 > 3 * PyLong_SHIFT) {
14974 if (8 *
sizeof(
unsigned long) > 4 * PyLong_SHIFT) {
14975 __PYX_VERIFY_RETURN_INT(
int,
long, -(
long) (((((((((
unsigned long)digits[3]) << PyLong_SHIFT) | (
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
14976 }
else if (8 *
sizeof(
int) - 1 > 4 * PyLong_SHIFT) {
14977 return (
int) (((int)-1)*(((((((((int)digits[3]) << PyLong_SHIFT) | (
int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (
int)digits[0])));
14982 if (8 *
sizeof(
int) > 3 * PyLong_SHIFT) {
14983 if (8 *
sizeof(
unsigned long) > 4 * PyLong_SHIFT) {
14984 __PYX_VERIFY_RETURN_INT(
int,
unsigned long, (((((((((
unsigned long)digits[3]) << PyLong_SHIFT) | (
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
14985 }
else if (8 *
sizeof(
int) - 1 > 4 * PyLong_SHIFT) {
14986 return (
int) ((((((((((int)digits[3]) << PyLong_SHIFT) | (
int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (
int)digits[0])));
14992 if (
sizeof(
int) <=
sizeof(long)) {
14993 __PYX_VERIFY_RETURN_INT_EXC(
int,
long, PyLong_AsLong(x))
14994 #ifdef HAVE_LONG_LONG
14995 }
else if (
sizeof(
int) <=
sizeof(PY_LONG_LONG)) {
14996 __PYX_VERIFY_RETURN_INT_EXC(
int, PY_LONG_LONG, PyLong_AsLongLong(x))
15001 #if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray)
15002 PyErr_SetString(PyExc_RuntimeError,
15003 "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers");
15006 PyObject *v = __Pyx_PyNumber_IntOrLong(x);
15007 #if PY_MAJOR_VERSION < 3
15008 if (likely(v) && !PyLong_Check(v)) {
15010 v = PyNumber_Long(tmp);
15015 int one = 1;
int is_little = (int)*(
unsigned char *)&one;
15016 unsigned char *bytes = (
unsigned char *)&val;
15017 int ret = _PyLong_AsByteArray((PyLongObject *)v,
15018 bytes,
sizeof(val),
15019 is_little, !is_unsigned);
15029 PyObject *tmp = __Pyx_PyNumber_IntOrLong(x);
15030 if (!tmp)
return (
int) -1;
15031 val = __Pyx_PyInt_As_int(tmp);
15036 PyErr_SetString(PyExc_OverflowError,
15037 "value too large to convert to int");
15039 raise_neg_overflow:
15040 PyErr_SetString(PyExc_OverflowError,
15041 "can't convert negative value to int");
15046 static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(
long value) {
15047 const long neg_one = (long) -1, const_zero = (
long) 0;
15048 const int is_unsigned = neg_one > const_zero;
15050 if (
sizeof(
long) <
sizeof(long)) {
15051 return PyInt_FromLong((
long) value);
15052 }
else if (
sizeof(
long) <=
sizeof(
unsigned long)) {
15053 return PyLong_FromUnsignedLong((
unsigned long) value);
15054 #ifdef HAVE_LONG_LONG
15055 }
else if (
sizeof(
long) <=
sizeof(
unsigned PY_LONG_LONG)) {
15056 return PyLong_FromUnsignedLongLong((
unsigned PY_LONG_LONG) value);
15060 if (
sizeof(
long) <=
sizeof(
long)) {
15061 return PyInt_FromLong((
long) value);
15062 #ifdef HAVE_LONG_LONG
15063 }
else if (
sizeof(
long) <=
sizeof(PY_LONG_LONG)) {
15064 return PyLong_FromLongLong((PY_LONG_LONG) value);
15069 int one = 1;
int little = (int)*(
unsigned char *)&one;
15070 unsigned char *bytes = (
unsigned char *)&value;
15071 return _PyLong_FromByteArray(bytes,
sizeof(
long),
15072 little, !is_unsigned);
15077 static CYTHON_INLINE
long __Pyx_PyInt_As_long(PyObject *x) {
15078 const long neg_one = (long) -1, const_zero = (
long) 0;
15079 const int is_unsigned = neg_one > const_zero;
15080 #if PY_MAJOR_VERSION < 3
15081 if (likely(PyInt_Check(x))) {
15082 if (
sizeof(
long) <
sizeof(long)) {
15083 __PYX_VERIFY_RETURN_INT(
long,
long, PyInt_AS_LONG(x))
15085 long val = PyInt_AS_LONG(x);
15086 if (is_unsigned && unlikely(val < 0)) {
15087 goto raise_neg_overflow;
15093 if (likely(PyLong_Check(x))) {
15095 #if CYTHON_USE_PYLONG_INTERNALS
15096 const digit* digits = ((PyLongObject*)x)->ob_digit;
15097 switch (Py_SIZE(x)) {
15098 case 0:
return (
long) 0;
15099 case 1: __PYX_VERIFY_RETURN_INT(
long, digit, digits[0])
15101 if (8 * sizeof(
long) > 1 * PyLong_SHIFT) {
15102 if (8 *
sizeof(
unsigned long) > 2 * PyLong_SHIFT) {
15103 __PYX_VERIFY_RETURN_INT(
long,
unsigned long, (((((
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
15104 }
else if (8 *
sizeof(
long) >= 2 * PyLong_SHIFT) {
15105 return (
long) (((((long)digits[1]) << PyLong_SHIFT) | (
long)digits[0]));
15110 if (8 *
sizeof(
long) > 2 * PyLong_SHIFT) {
15111 if (8 *
sizeof(
unsigned long) > 3 * PyLong_SHIFT) {
15112 __PYX_VERIFY_RETURN_INT(
long,
unsigned long, (((((((
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
15113 }
else if (8 *
sizeof(
long) >= 3 * PyLong_SHIFT) {
15114 return (
long) (((((((long)digits[2]) << PyLong_SHIFT) | (
long)digits[1]) << PyLong_SHIFT) | (long)digits[0]));
15119 if (8 *
sizeof(
long) > 3 * PyLong_SHIFT) {
15120 if (8 *
sizeof(
unsigned long) > 4 * PyLong_SHIFT) {
15121 __PYX_VERIFY_RETURN_INT(
long,
unsigned long, (((((((((
unsigned long)digits[3]) << PyLong_SHIFT) | (
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
15122 }
else if (8 *
sizeof(
long) >= 4 * PyLong_SHIFT) {
15123 return (
long) (((((((((long)digits[3]) << PyLong_SHIFT) | (
long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (
long)digits[0]));
15129 #if CYTHON_COMPILING_IN_CPYTHON
15130 if (unlikely(Py_SIZE(x) < 0)) {
15131 goto raise_neg_overflow;
15135 int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
15136 if (unlikely(result < 0))
15138 if (unlikely(result == 1))
15139 goto raise_neg_overflow;
15142 if (
sizeof(
long) <=
sizeof(
unsigned long)) {
15143 __PYX_VERIFY_RETURN_INT_EXC(
long,
unsigned long, PyLong_AsUnsignedLong(x))
15144 #ifdef HAVE_LONG_LONG
15145 }
else if (
sizeof(
long) <=
sizeof(
unsigned PY_LONG_LONG)) {
15146 __PYX_VERIFY_RETURN_INT_EXC(
long,
unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
15150 #if CYTHON_USE_PYLONG_INTERNALS
15151 const digit* digits = ((PyLongObject*)x)->ob_digit;
15152 switch (Py_SIZE(x)) {
15153 case 0:
return (
long) 0;
15154 case -1: __PYX_VERIFY_RETURN_INT(
long, sdigit, (sdigit) (-(sdigit)digits[0]))
15155 case 1: __PYX_VERIFY_RETURN_INT(
long, digit, +digits[0])
15157 if (8 * sizeof(
long) - 1 > 1 * PyLong_SHIFT) {
15158 if (8 *
sizeof(
unsigned long) > 2 * PyLong_SHIFT) {
15159 __PYX_VERIFY_RETURN_INT(
long,
long, -(
long) (((((
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
15160 }
else if (8 *
sizeof(
long) - 1 > 2 * PyLong_SHIFT) {
15161 return (
long) (((long)-1)*(((((long)digits[1]) << PyLong_SHIFT) | (
long)digits[0])));
15166 if (8 *
sizeof(
long) > 1 * PyLong_SHIFT) {
15167 if (8 *
sizeof(
unsigned long) > 2 * PyLong_SHIFT) {
15168 __PYX_VERIFY_RETURN_INT(
long,
unsigned long, (((((
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
15169 }
else if (8 *
sizeof(
long) - 1 > 2 * PyLong_SHIFT) {
15170 return (
long) ((((((long)digits[1]) << PyLong_SHIFT) | (
long)digits[0])));
15175 if (8 *
sizeof(
long) - 1 > 2 * PyLong_SHIFT) {
15176 if (8 *
sizeof(
unsigned long) > 3 * PyLong_SHIFT) {
15177 __PYX_VERIFY_RETURN_INT(
long,
long, -(
long) (((((((
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
15178 }
else if (8 *
sizeof(
long) - 1 > 3 * PyLong_SHIFT) {
15179 return (
long) (((long)-1)*(((((((long)digits[2]) << PyLong_SHIFT) | (
long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
15184 if (8 *
sizeof(
long) > 2 * PyLong_SHIFT) {
15185 if (8 *
sizeof(
unsigned long) > 3 * PyLong_SHIFT) {
15186 __PYX_VERIFY_RETURN_INT(
long,
unsigned long, (((((((
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
15187 }
else if (8 *
sizeof(
long) - 1 > 3 * PyLong_SHIFT) {
15188 return (
long) ((((((((long)digits[2]) << PyLong_SHIFT) | (
long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
15193 if (8 *
sizeof(
long) - 1 > 3 * PyLong_SHIFT) {
15194 if (8 *
sizeof(
unsigned long) > 4 * PyLong_SHIFT) {
15195 __PYX_VERIFY_RETURN_INT(
long,
long, -(
long) (((((((((
unsigned long)digits[3]) << PyLong_SHIFT) | (
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
15196 }
else if (8 *
sizeof(
long) - 1 > 4 * PyLong_SHIFT) {
15197 return (
long) (((long)-1)*(((((((((long)digits[3]) << PyLong_SHIFT) | (
long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (
long)digits[0])));
15202 if (8 *
sizeof(
long) > 3 * PyLong_SHIFT) {
15203 if (8 *
sizeof(
unsigned long) > 4 * PyLong_SHIFT) {
15204 __PYX_VERIFY_RETURN_INT(
long,
unsigned long, (((((((((
unsigned long)digits[3]) << PyLong_SHIFT) | (
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
15205 }
else if (8 *
sizeof(
long) - 1 > 4 * PyLong_SHIFT) {
15206 return (
long) ((((((((((long)digits[3]) << PyLong_SHIFT) | (
long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (
long)digits[0])));
15212 if (
sizeof(
long) <=
sizeof(long)) {
15213 __PYX_VERIFY_RETURN_INT_EXC(
long,
long, PyLong_AsLong(x))
15214 #ifdef HAVE_LONG_LONG
15215 }
else if (
sizeof(
long) <=
sizeof(PY_LONG_LONG)) {
15216 __PYX_VERIFY_RETURN_INT_EXC(
long, PY_LONG_LONG, PyLong_AsLongLong(x))
15221 #if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray)
15222 PyErr_SetString(PyExc_RuntimeError,
15223 "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers");
15226 PyObject *v = __Pyx_PyNumber_IntOrLong(x);
15227 #if PY_MAJOR_VERSION < 3
15228 if (likely(v) && !PyLong_Check(v)) {
15230 v = PyNumber_Long(tmp);
15235 int one = 1;
int is_little = (int)*(
unsigned char *)&one;
15236 unsigned char *bytes = (
unsigned char *)&val;
15237 int ret = _PyLong_AsByteArray((PyLongObject *)v,
15238 bytes,
sizeof(val),
15239 is_little, !is_unsigned);
15249 PyObject *tmp = __Pyx_PyNumber_IntOrLong(x);
15250 if (!tmp)
return (
long) -1;
15251 val = __Pyx_PyInt_As_long(tmp);
15256 PyErr_SetString(PyExc_OverflowError,
15257 "value too large to convert to long");
15259 raise_neg_overflow:
15260 PyErr_SetString(PyExc_OverflowError,
15261 "can't convert negative value to long");
15266 static int __Pyx_check_binary_version(
void) {
15267 char ctversion[4], rtversion[4];
15268 PyOS_snprintf(ctversion, 4,
"%d.%d", PY_MAJOR_VERSION, PY_MINOR_VERSION);
15269 PyOS_snprintf(rtversion, 4,
"%s", Py_GetVersion());
15270 if (ctversion[0] != rtversion[0] || ctversion[2] != rtversion[2]) {
15272 PyOS_snprintf(message,
sizeof(message),
15273 "compiletime version %s of module '%.100s' "
15274 "does not match runtime version %s",
15275 ctversion, __Pyx_MODULE_NAME, rtversion);
15276 return PyErr_WarnEx(NULL, message, 1);
15282 #ifndef __PYX_HAVE_RT_ImportModule
15283 #define __PYX_HAVE_RT_ImportModule
15284 static PyObject *__Pyx_ImportModule(
const char *name) {
15285 PyObject *py_name = 0;
15286 PyObject *py_module = 0;
15287 py_name = __Pyx_PyIdentifier_FromString(name);
15290 py_module = PyImport_Import(py_name);
15291 Py_DECREF(py_name);
15294 Py_XDECREF(py_name);
15300 #ifndef __PYX_HAVE_RT_ImportType
15301 #define __PYX_HAVE_RT_ImportType
15302 static PyTypeObject *__Pyx_ImportType(
const char *module_name,
const char *class_name,
15303 size_t size,
int strict)
15305 PyObject *py_module = 0;
15306 PyObject *result = 0;
15307 PyObject *py_name = 0;
15309 Py_ssize_t basicsize;
15310 #ifdef Py_LIMITED_API
15311 PyObject *py_basicsize;
15313 py_module = __Pyx_ImportModule(module_name);
15316 py_name = __Pyx_PyIdentifier_FromString(class_name);
15319 result = PyObject_GetAttr(py_module, py_name);
15320 Py_DECREF(py_name);
15322 Py_DECREF(py_module);
15326 if (!PyType_Check(result)) {
15327 PyErr_Format(PyExc_TypeError,
15328 "%.200s.%.200s is not a type object",
15329 module_name, class_name);
15332 #ifndef Py_LIMITED_API
15333 basicsize = ((PyTypeObject *)result)->tp_basicsize;
15335 py_basicsize = PyObject_GetAttrString(result,
"__basicsize__");
15338 basicsize = PyLong_AsSsize_t(py_basicsize);
15339 Py_DECREF(py_basicsize);
15341 if (basicsize == (Py_ssize_t)-1 && PyErr_Occurred())
15344 if (!strict && (
size_t)basicsize > size) {
15345 PyOS_snprintf(warning,
sizeof(warning),
15346 "%s.%s size changed, may indicate binary incompatibility. Expected %zd, got %zd",
15347 module_name, class_name, basicsize, size);
15348 if (PyErr_WarnEx(NULL, warning, 0) < 0)
goto bad;
15350 else if ((
size_t)basicsize != size) {
15351 PyErr_Format(PyExc_ValueError,
15352 "%.200s.%.200s has the wrong size, try recompiling. Expected %zd, got %zd",
15353 module_name, class_name, basicsize, size);
15356 return (PyTypeObject *)result;
15358 Py_XDECREF(py_module);
15359 Py_XDECREF(result);
15365 static int __Pyx_InitStrings(__Pyx_StringTabEntry *t) {
15367 #if PY_MAJOR_VERSION < 3
15368 if (t->is_unicode) {
15369 *t->p = PyUnicode_DecodeUTF8(t->s, t->n - 1, NULL);
15370 }
else if (t->intern) {
15371 *t->p = PyString_InternFromString(t->s);
15373 *t->p = PyString_FromStringAndSize(t->s, t->n - 1);
15376 if (t->is_unicode | t->is_str) {
15378 *t->p = PyUnicode_InternFromString(t->s);
15379 }
else if (t->encoding) {
15380 *t->p = PyUnicode_Decode(t->s, t->n - 1, t->encoding, NULL);
15382 *t->p = PyUnicode_FromStringAndSize(t->s, t->n - 1);
15385 *t->p = PyBytes_FromStringAndSize(t->s, t->n - 1);
15395 static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(
const char* c_str) {
15396 return __Pyx_PyUnicode_FromStringAndSize(c_str, (Py_ssize_t)strlen(c_str));
15398 static CYTHON_INLINE
char* __Pyx_PyObject_AsString(PyObject* o) {
15400 return __Pyx_PyObject_AsStringAndSize(o, &ignore);
15402 static CYTHON_INLINE
char* __Pyx_PyObject_AsStringAndSize(PyObject* o, Py_ssize_t *length) {
15403 #if CYTHON_COMPILING_IN_CPYTHON && (__PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT)
15405 #
if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
15406 __Pyx_sys_getdefaultencoding_not_ascii &&
15408 PyUnicode_Check(o)) {
15409 #if PY_VERSION_HEX < 0x03030000
15411 PyObject* defenc = _PyUnicode_AsDefaultEncodedString(o, NULL);
15412 if (!defenc)
return NULL;
15413 defenc_c = PyBytes_AS_STRING(defenc);
15414 #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
15416 char* end = defenc_c + PyBytes_GET_SIZE(defenc);
15418 for (c = defenc_c; c < end; c++) {
15419 if ((
unsigned char) (*c) >= 128) {
15420 PyUnicode_AsASCIIString(o);
15426 *length = PyBytes_GET_SIZE(defenc);
15429 if (__Pyx_PyUnicode_READY(o) == -1)
return NULL;
15430 #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
15431 if (PyUnicode_IS_ASCII(o)) {
15432 *length = PyUnicode_GET_LENGTH(o);
15433 return PyUnicode_AsUTF8(o);
15435 PyUnicode_AsASCIIString(o);
15439 return PyUnicode_AsUTF8AndSize(o, length);
15444 #if (!CYTHON_COMPILING_IN_PYPY) || (defined(PyByteArray_AS_STRING) && defined(PyByteArray_GET_SIZE))
15445 if (PyByteArray_Check(o)) {
15446 *length = PyByteArray_GET_SIZE(o);
15447 return PyByteArray_AS_STRING(o);
15452 int r = PyBytes_AsStringAndSize(o, &result, length);
15453 if (unlikely(r < 0)) {
15460 static CYTHON_INLINE
int __Pyx_PyObject_IsTrue(PyObject* x) {
15461 int is_true = x == Py_True;
15462 if (is_true | (x == Py_False) | (x == Py_None))
return is_true;
15463 else return PyObject_IsTrue(x);
15465 static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x) {
15466 #if CYTHON_USE_TYPE_SLOTS
15467 PyNumberMethods *m;
15469 const char *name = NULL;
15470 PyObject *res = NULL;
15471 #if PY_MAJOR_VERSION < 3
15472 if (PyInt_Check(x) || PyLong_Check(x))
15474 if (PyLong_Check(x))
15476 return __Pyx_NewRef(x);
15477 #if CYTHON_USE_TYPE_SLOTS
15478 m = Py_TYPE(x)->tp_as_number;
15479 #if PY_MAJOR_VERSION < 3
15480 if (m && m->nb_int) {
15482 res = PyNumber_Int(x);
15484 else if (m && m->nb_long) {
15486 res = PyNumber_Long(x);
15489 if (m && m->nb_int) {
15491 res = PyNumber_Long(x);
15495 res = PyNumber_Int(x);
15498 #if PY_MAJOR_VERSION < 3
15499 if (!PyInt_Check(res) && !PyLong_Check(res)) {
15501 if (!PyLong_Check(res)) {
15503 PyErr_Format(PyExc_TypeError,
15504 "__%.4s__ returned non-%.4s (type %.200s)",
15505 name, name, Py_TYPE(res)->tp_name);
15510 else if (!PyErr_Occurred()) {
15511 PyErr_SetString(PyExc_TypeError,
15512 "an integer is required");
15516 static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject* b) {
15519 #if PY_MAJOR_VERSION < 3
15520 if (likely(PyInt_CheckExact(b))) {
15521 if (
sizeof(Py_ssize_t) >=
sizeof(
long))
15522 return PyInt_AS_LONG(b);
15524 return PyInt_AsSsize_t(x);
15527 if (likely(PyLong_CheckExact(b))) {
15528 #if CYTHON_USE_PYLONG_INTERNALS
15529 const digit* digits = ((PyLongObject*)b)->ob_digit;
15530 const Py_ssize_t size = Py_SIZE(b);
15531 if (likely(__Pyx_sst_abs(size) <= 1)) {
15532 ival = likely(size) ? digits[0] : 0;
15533 if (size == -1) ival = -ival;
15538 if (8 *
sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) {
15539 return (Py_ssize_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (
size_t)digits[0]));
15543 if (8 *
sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) {
15544 return -(Py_ssize_t) (((((
size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
15548 if (8 *
sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) {
15549 return (Py_ssize_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (
size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
15553 if (8 *
sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) {
15554 return -(Py_ssize_t) (((((((
size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (
size_t)digits[0]));
15558 if (8 *
sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) {
15559 return (Py_ssize_t) (((((((((size_t)digits[3]) << PyLong_SHIFT) | (
size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (
size_t)digits[0]));
15563 if (8 *
sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) {
15564 return -(Py_ssize_t) (((((((((
size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (
size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
15570 return PyLong_AsSsize_t(b);
15572 x = PyNumber_Index(b);
15574 ival = PyInt_AsSsize_t(x);
15578 static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(
size_t ival) {
15579 return PyInt_FromSize_t(ival);
char * string
string version of the answer to a query
void ITM_AMNS_CC_SET_TABLE(void *handle_rx_in, amns_c_set_type *set, amns_c_error_type *error_status)
void ITM_AMNS_CC_RX_1_B(void *handle_rx_in, int nx, double *out, double *arg1, double *arg2, amns_c_error_type *error_status)
amns_c_reaction_type get_default_amns_c_reaction_type(void)
prototype
void ITM_AMNS_CC_RX_3_B(void *handle_rx_in, int nx, int ny, int nz, double *out, double *arg1, double *arg2, amns_c_error_type *error_status)
void ITM_AMNS_CC_RX_3_C(void *handle_rx_in, int nx, int ny, int nz, double *out, double *arg1, double *arg2, double *arg3, amns_c_error_type *error_status)
int number
integer version of the answer to a query
Type for error returns from the AMNS interface ("C" version)
Type for querying parameters in the AMNS package ("C" version)
amns_c_version_type get_default_amns_c_version_type(void)
prototype
amns_c_reactant_type get_default_amns_c_reactant_type(void)
prototype
if error_status np ndarray[np.double_t, ndim=2] np ndarray[np.double_t, ndim=2] np ndarray[np.double_t, ndim=2] p3
if error_status np ndarray[np.double_t, ndim=2] p1
Type for answers from queries in the AMNS package ("C" version)
void ITM_AMNS_CC_FINISH_TABLE(void **handle_rx_inout, amns_c_error_type *error_status)
Type used for specifying reactions when using the AMNS interface ("C" version)
void ITM_AMNS_CC_FINISH_REACTANTS(void **reactants_handle_inout)
from libcpp cimport bool cdef from amns_interface ZA
double real_specifier
a place holder to specify an optional real further characterising a reactant/product ...
void ITM_AMNS_CC_RX_1_C(void *handle_rx_in, int nx, double *out, double *arg1, double *arg2, double *arg3, amns_c_error_type *error_status)
Type for setting parameters in the AMNS package ("C" version)
if error_status np ndarray[np.double_t, ndim=2] np ndarray[np.double_t, ndim=2] np ndarray[np.double_t, ndim=2] ndim
void ITM_AMNS_CC_QUERY_TABLE(void *handle_rx_in, amns_c_query_type *query, amns_c_answer_type *answer, amns_c_error_type *error_status)
void ITM_AMNS_CC_FINISH(void **handle_inout, amns_c_error_type *error_status)
Type for specifying the AMNS version ("C" version)
char * backend
specify the backend to be used to access the CPOs
if error_status answer number def version(self) if error_status &error_status if error_status Reactants isotope_resolved
char * string
ascii specification of the version
if error_status answer number def set(self, setString) if error_status &error_status if error_status answer number def state_label(self) elif nargs
char * user
specify the username of the data to be obtained (defaults to tghe person running the code) ...
int number
integer specification of the version number (primary specification at the moment) ...
void ITM_AMNS_CC_RX_2_C(void *handle_rx_in, int nx, int ny, double *out, double *arg1, double *arg2, double *arg3, amns_c_error_type *error_status)
void ITM_AMNS_CC_SETUP_REACTANTS(void **reactants_handle_out, char *string_in, int index_in, int n_reactants)
void ITM_AMNS_CC_SET_REACTANT(void *reactants_handle_in, int reactant_index, amns_c_reactant_type *reactant_in)
if error_status np ndarray[np.double_t, ndim=2] np ndarray[np.double_t, ndim=2] p2
void ITM_AMNS_CC_SET(void *handle_in, amns_c_set_type *set, amns_c_error_type *error_status)
void ITM_AMNS_CC_QUERY(void *handle_in, amns_c_query_type *query, amns_c_answer_type *answer, amns_c_error_type *error_status)
bool flag
True if an error occurred.
void ITM_AMNS_CC_RX_2_B(void *handle_rx_in, int nx, int ny, double *out, double *arg1, double *arg2, amns_c_error_type *error_status)
Type for indicating a single reactant or product when using the AMNS interface.
if error_status answer number def version(self) if error_status &error_status if error_status Reactants reactants
void ITM_AMNS_CC_RX_3_A(void *handle_rx_in, int nx, int ny, int nz, double *out, double *arg1, amns_c_error_type *error_status)
if error_status len(self._reactants))
void ITM_AMNS_CC_SETUP_TABLE(void *handle_in, amns_c_reaction_type *reaction_type, void *reactant_handle_in, void **handle_rx_out, amns_c_error_type *error_status)
int int_specifier
a place holder to specify an optional integer further characterising a reactant/product ...
int LR
reactant (LR=0) or product (LR=1)
void ITM_AMNS_CC_RX_1_A(void *handle_rx_in, int nx, double *out, double *arg1, amns_c_error_type *error_status)
void ITM_AMNS_CC_RX_2_A(void *handle_rx_in, int nx, int ny, double *out, double *arg1, amns_c_error_type *error_status)
void ITM_AMNS_CC_SETUP(void **handle_out, amns_c_error_type *error_status)
void ITM_AMNS_CC_SETUP_VERSION(void **handle_in, amns_c_version_type *version, amns_c_error_type *error_status)