3 #ifndef PY_SSIZE_T_CLEAN
4 #define PY_SSIZE_T_CLEAN
8 #error Python headers needed to compile C extensions, please install development version of Python.
9 #elif PY_VERSION_HEX < 0x02060000 || (0x03000000 <= PY_VERSION_HEX && PY_VERSION_HEX < 0x03030000)
10 #error Cython requires Python 2.6+ or Python 3.3+.
12 #define CYTHON_ABI "0_29_30"
13 #define CYTHON_HEX_VERSION 0x001D1EF0
14 #define CYTHON_FUTURE_DIVISION 0
17 #define offsetof(type, member) ( (size_t) & ((type*)0) -> member )
19 #if !defined(WIN32) && !defined(MS_WINDOWS)
31 #define DL_IMPORT(t) t
34 #define DL_EXPORT(t) t
37 #ifndef HAVE_LONG_LONG
38 #if PY_VERSION_HEX >= 0x02070000
39 #define HAVE_LONG_LONG
43 #define PY_LONG_LONG LONG_LONG
46 #define Py_HUGE_VAL HUGE_VAL
49 #define CYTHON_COMPILING_IN_PYPY 1
50 #define CYTHON_COMPILING_IN_PYSTON 0
51 #define CYTHON_COMPILING_IN_CPYTHON 0
52 #undef CYTHON_USE_TYPE_SLOTS
53 #define CYTHON_USE_TYPE_SLOTS 0
54 #undef CYTHON_USE_PYTYPE_LOOKUP
55 #define CYTHON_USE_PYTYPE_LOOKUP 0
56 #if PY_VERSION_HEX < 0x03050000
57 #undef CYTHON_USE_ASYNC_SLOTS
58 #define CYTHON_USE_ASYNC_SLOTS 0
59 #elif !defined(CYTHON_USE_ASYNC_SLOTS)
60 #define CYTHON_USE_ASYNC_SLOTS 1
62 #undef CYTHON_USE_PYLIST_INTERNALS
63 #define CYTHON_USE_PYLIST_INTERNALS 0
64 #undef CYTHON_USE_UNICODE_INTERNALS
65 #define CYTHON_USE_UNICODE_INTERNALS 0
66 #undef CYTHON_USE_UNICODE_WRITER
67 #define CYTHON_USE_UNICODE_WRITER 0
68 #undef CYTHON_USE_PYLONG_INTERNALS
69 #define CYTHON_USE_PYLONG_INTERNALS 0
70 #undef CYTHON_AVOID_BORROWED_REFS
71 #define CYTHON_AVOID_BORROWED_REFS 1
72 #undef CYTHON_ASSUME_SAFE_MACROS
73 #define CYTHON_ASSUME_SAFE_MACROS 0
74 #undef CYTHON_UNPACK_METHODS
75 #define CYTHON_UNPACK_METHODS 0
76 #undef CYTHON_FAST_THREAD_STATE
77 #define CYTHON_FAST_THREAD_STATE 0
78 #undef CYTHON_FAST_PYCALL
79 #define CYTHON_FAST_PYCALL 0
80 #undef CYTHON_PEP489_MULTI_PHASE_INIT
81 #define CYTHON_PEP489_MULTI_PHASE_INIT 0
82 #undef CYTHON_USE_TP_FINALIZE
83 #define CYTHON_USE_TP_FINALIZE 0
84 #undef CYTHON_USE_DICT_VERSIONS
85 #define CYTHON_USE_DICT_VERSIONS 0
86 #undef CYTHON_USE_EXC_INFO_STACK
87 #define CYTHON_USE_EXC_INFO_STACK 0
88 #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC
89 #define CYTHON_UPDATE_DESCRIPTOR_DOC (PYPY_VERSION_HEX >= 0x07030900)
91 #elif defined(PYSTON_VERSION)
92 #define CYTHON_COMPILING_IN_PYPY 0
93 #define CYTHON_COMPILING_IN_PYSTON 1
94 #define CYTHON_COMPILING_IN_CPYTHON 0
95 #ifndef CYTHON_USE_TYPE_SLOTS
96 #define CYTHON_USE_TYPE_SLOTS 1
98 #undef CYTHON_USE_PYTYPE_LOOKUP
99 #define CYTHON_USE_PYTYPE_LOOKUP 0
100 #undef CYTHON_USE_ASYNC_SLOTS
101 #define CYTHON_USE_ASYNC_SLOTS 0
102 #undef CYTHON_USE_PYLIST_INTERNALS
103 #define CYTHON_USE_PYLIST_INTERNALS 0
104 #ifndef CYTHON_USE_UNICODE_INTERNALS
105 #define CYTHON_USE_UNICODE_INTERNALS 1
107 #undef CYTHON_USE_UNICODE_WRITER
108 #define CYTHON_USE_UNICODE_WRITER 0
109 #undef CYTHON_USE_PYLONG_INTERNALS
110 #define CYTHON_USE_PYLONG_INTERNALS 0
111 #ifndef CYTHON_AVOID_BORROWED_REFS
112 #define CYTHON_AVOID_BORROWED_REFS 0
114 #ifndef CYTHON_ASSUME_SAFE_MACROS
115 #define CYTHON_ASSUME_SAFE_MACROS 1
117 #ifndef CYTHON_UNPACK_METHODS
118 #define CYTHON_UNPACK_METHODS 1
120 #undef CYTHON_FAST_THREAD_STATE
121 #define CYTHON_FAST_THREAD_STATE 0
122 #undef CYTHON_FAST_PYCALL
123 #define CYTHON_FAST_PYCALL 0
124 #undef CYTHON_PEP489_MULTI_PHASE_INIT
125 #define CYTHON_PEP489_MULTI_PHASE_INIT 0
126 #undef CYTHON_USE_TP_FINALIZE
127 #define CYTHON_USE_TP_FINALIZE 0
128 #undef CYTHON_USE_DICT_VERSIONS
129 #define CYTHON_USE_DICT_VERSIONS 0
130 #undef CYTHON_USE_EXC_INFO_STACK
131 #define CYTHON_USE_EXC_INFO_STACK 0
132 #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC
133 #define CYTHON_UPDATE_DESCRIPTOR_DOC 0
136 #define CYTHON_COMPILING_IN_PYPY 0
137 #define CYTHON_COMPILING_IN_PYSTON 0
138 #define CYTHON_COMPILING_IN_CPYTHON 1
139 #ifndef CYTHON_USE_TYPE_SLOTS
140 #define CYTHON_USE_TYPE_SLOTS 1
142 #if PY_VERSION_HEX < 0x02070000
143 #undef CYTHON_USE_PYTYPE_LOOKUP
144 #define CYTHON_USE_PYTYPE_LOOKUP 0
145 #elif !defined(CYTHON_USE_PYTYPE_LOOKUP)
146 #define CYTHON_USE_PYTYPE_LOOKUP 1
148 #if PY_MAJOR_VERSION < 3
149 #undef CYTHON_USE_ASYNC_SLOTS
150 #define CYTHON_USE_ASYNC_SLOTS 0
151 #elif !defined(CYTHON_USE_ASYNC_SLOTS)
152 #define CYTHON_USE_ASYNC_SLOTS 1
154 #if PY_VERSION_HEX < 0x02070000
155 #undef CYTHON_USE_PYLONG_INTERNALS
156 #define CYTHON_USE_PYLONG_INTERNALS 0
157 #elif !defined(CYTHON_USE_PYLONG_INTERNALS)
158 #define CYTHON_USE_PYLONG_INTERNALS 1
160 #ifndef CYTHON_USE_PYLIST_INTERNALS
161 #define CYTHON_USE_PYLIST_INTERNALS 1
163 #ifndef CYTHON_USE_UNICODE_INTERNALS
164 #define CYTHON_USE_UNICODE_INTERNALS 1
166 #if PY_VERSION_HEX < 0x030300F0 || PY_VERSION_HEX >= 0x030B00A2
167 #undef CYTHON_USE_UNICODE_WRITER
168 #define CYTHON_USE_UNICODE_WRITER 0
169 #elif !defined(CYTHON_USE_UNICODE_WRITER)
170 #define CYTHON_USE_UNICODE_WRITER 1
172 #ifndef CYTHON_AVOID_BORROWED_REFS
173 #define CYTHON_AVOID_BORROWED_REFS 0
175 #ifndef CYTHON_ASSUME_SAFE_MACROS
176 #define CYTHON_ASSUME_SAFE_MACROS 1
178 #ifndef CYTHON_UNPACK_METHODS
179 #define CYTHON_UNPACK_METHODS 1
181 #if PY_VERSION_HEX >= 0x030B00A4
182 #undef CYTHON_FAST_THREAD_STATE
183 #define CYTHON_FAST_THREAD_STATE 0
184 #elif !defined(CYTHON_FAST_THREAD_STATE)
185 #define CYTHON_FAST_THREAD_STATE 1
187 #ifndef CYTHON_FAST_PYCALL
188 #define CYTHON_FAST_PYCALL (PY_VERSION_HEX < 0x030A0000)
190 #ifndef CYTHON_PEP489_MULTI_PHASE_INIT
191 #define CYTHON_PEP489_MULTI_PHASE_INIT (PY_VERSION_HEX >= 0x03050000)
193 #ifndef CYTHON_USE_TP_FINALIZE
194 #define CYTHON_USE_TP_FINALIZE (PY_VERSION_HEX >= 0x030400a1)
196 #ifndef CYTHON_USE_DICT_VERSIONS
197 #define CYTHON_USE_DICT_VERSIONS (PY_VERSION_HEX >= 0x030600B1)
199 #if PY_VERSION_HEX >= 0x030B00A4
200 #undef CYTHON_USE_EXC_INFO_STACK
201 #define CYTHON_USE_EXC_INFO_STACK 0
202 #elif !defined(CYTHON_USE_EXC_INFO_STACK)
203 #define CYTHON_USE_EXC_INFO_STACK (PY_VERSION_HEX >= 0x030700A3)
205 #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC
206 #define CYTHON_UPDATE_DESCRIPTOR_DOC 1
209 #if !defined(CYTHON_FAST_PYCCALL)
210 #define CYTHON_FAST_PYCCALL (CYTHON_FAST_PYCALL && PY_VERSION_HEX >= 0x030600B1)
212 #if CYTHON_USE_PYLONG_INTERNALS
213 #if PY_MAJOR_VERSION < 3
214 #include "longintrepr.h"
220 enum { __pyx_check_sizeof_voidp = 1 / (int)(SIZEOF_VOID_P ==
sizeof(
void*)) };
223 #ifndef __has_attribute
224 #define __has_attribute(x) 0
226 #ifndef __has_cpp_attribute
227 #define __has_cpp_attribute(x) 0
229 #ifndef CYTHON_RESTRICT
230 #if defined(__GNUC__)
231 #define CYTHON_RESTRICT __restrict__
232 #elif defined(_MSC_VER) && _MSC_VER >= 1400
233 #define CYTHON_RESTRICT __restrict
234 #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
235 #define CYTHON_RESTRICT restrict
237 #define CYTHON_RESTRICT
240 #ifndef CYTHON_UNUSED
241 # if defined(__GNUC__)
242 # if !(defined(__cplusplus)) || (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4))
243 # define CYTHON_UNUSED __attribute__ ((__unused__))
245 # define CYTHON_UNUSED
247 # elif defined(__ICC) || (defined(__INTEL_COMPILER) && !defined(_MSC_VER))
248 # define CYTHON_UNUSED __attribute__ ((__unused__))
250 # define CYTHON_UNUSED
253 #ifndef CYTHON_MAYBE_UNUSED_VAR
254 # if defined(__cplusplus)
255 template<
class T>
void CYTHON_MAYBE_UNUSED_VAR(
const T& ) { }
257 # define CYTHON_MAYBE_UNUSED_VAR(x) (void)(x)
260 #ifndef CYTHON_NCP_UNUSED
261 # if CYTHON_COMPILING_IN_CPYTHON
262 # define CYTHON_NCP_UNUSED
264 # define CYTHON_NCP_UNUSED CYTHON_UNUSED
267 #define __Pyx_void_to_None(void_result) ((void)(void_result), Py_INCREF(Py_None), Py_None)
269 #ifndef _MSC_STDINT_H_
271 typedef unsigned char uint8_t;
272 typedef unsigned int uint32_t;
274 typedef unsigned __int8 uint8_t;
275 typedef unsigned __int32 uint32_t;
281 #ifndef CYTHON_FALLTHROUGH
282 #if defined(__cplusplus) && __cplusplus >= 201103L
283 #if __has_cpp_attribute(fallthrough)
284 #define CYTHON_FALLTHROUGH [[fallthrough]]
285 #elif __has_cpp_attribute(clang::fallthrough)
286 #define CYTHON_FALLTHROUGH [[clang::fallthrough]]
287 #elif __has_cpp_attribute(gnu::fallthrough)
288 #define CYTHON_FALLTHROUGH [[gnu::fallthrough]]
291 #ifndef CYTHON_FALLTHROUGH
292 #if __has_attribute(fallthrough)
293 #define CYTHON_FALLTHROUGH __attribute__((fallthrough))
295 #define CYTHON_FALLTHROUGH
298 #if defined(__clang__ ) && defined(__apple_build_version__)
299 #if __apple_build_version__ < 7000000
300 #undef CYTHON_FALLTHROUGH
301 #define CYTHON_FALLTHROUGH
307 #error "Cython files generated with the C++ option must be compiled with a C++ compiler."
309 #ifndef CYTHON_INLINE
310 #if defined(__clang__)
311 #define CYTHON_INLINE __inline__ __attribute__ ((__unused__))
313 #define CYTHON_INLINE inline
317 void __Pyx_call_destructor(
T& x) {
321 class __Pyx_FakeReference {
323 __Pyx_FakeReference() : ptr(NULL) { }
324 __Pyx_FakeReference(
const T& ref) : ptr(const_cast<
T*>(&ref)) { }
325 T *operator->() {
return ptr; }
326 T *operator&() {
return ptr; }
327 operator T&() {
return *ptr; }
328 template<
typename U>
bool operator ==(
U other) {
return *ptr == other; }
329 template<
typename U>
bool operator !=(
U other) {
return *ptr != other; }
334 #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x02070600 && !defined(Py_OptimizeFlag)
335 #define Py_OptimizeFlag 0
337 #define __PYX_BUILD_PY_SSIZE_T "n"
338 #define CYTHON_FORMAT_SSIZE_T "z"
339 #if PY_MAJOR_VERSION < 3
340 #define __Pyx_BUILTIN_MODULE_NAME "__builtin__"
341 #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\
342 PyCode_New(a+k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)
343 #define __Pyx_DefaultClassType PyClass_Type
345 #define __Pyx_BUILTIN_MODULE_NAME "builtins"
346 #define __Pyx_DefaultClassType PyType_Type
347 #if PY_VERSION_HEX >= 0x030B00A1
348 static CYTHON_INLINE PyCodeObject* __Pyx_PyCode_New(
int a,
int k,
int l,
int s,
int f,
349 PyObject *code, PyObject *
c, PyObject*
n, PyObject *
v,
350 PyObject *fv, PyObject *cell, PyObject* fn,
351 PyObject *name,
int fline, PyObject *lnos) {
352 PyObject *kwds=NULL, *argcount=NULL, *posonlyargcount=NULL, *kwonlyargcount=NULL;
353 PyObject *nlocals=NULL, *stacksize=NULL, *flags=NULL, *replace=NULL, *call_result=NULL, *empty=NULL;
354 const char *fn_cstr=NULL;
355 const char *name_cstr=NULL;
356 PyCodeObject* co=NULL;
357 PyObject *type, *value, *traceback;
358 PyErr_Fetch(&type, &value, &traceback);
359 if (!(kwds=PyDict_New()))
goto end;
360 if (!(argcount=PyLong_FromLong(a)))
goto end;
361 if (PyDict_SetItemString(kwds,
"co_argcount", argcount) != 0)
goto end;
362 if (!(posonlyargcount=PyLong_FromLong(0)))
goto end;
363 if (PyDict_SetItemString(kwds,
"co_posonlyargcount", posonlyargcount) != 0)
goto end;
364 if (!(kwonlyargcount=PyLong_FromLong(k)))
goto end;
365 if (PyDict_SetItemString(kwds,
"co_kwonlyargcount", kwonlyargcount) != 0)
goto end;
366 if (!(nlocals=PyLong_FromLong(l)))
goto end;
367 if (PyDict_SetItemString(kwds,
"co_nlocals", nlocals) != 0)
goto end;
368 if (!(stacksize=PyLong_FromLong(
s)))
goto end;
369 if (PyDict_SetItemString(kwds,
"co_stacksize", stacksize) != 0)
goto end;
370 if (!(flags=PyLong_FromLong(
f)))
goto end;
371 if (PyDict_SetItemString(kwds,
"co_flags", flags) != 0)
goto end;
372 if (PyDict_SetItemString(kwds,
"co_code", code) != 0)
goto end;
373 if (PyDict_SetItemString(kwds,
"co_consts",
c) != 0)
goto end;
374 if (PyDict_SetItemString(kwds,
"co_names",
n) != 0)
goto end;
375 if (PyDict_SetItemString(kwds,
"co_varnames",
v) != 0)
goto end;
376 if (PyDict_SetItemString(kwds,
"co_freevars", fv) != 0)
goto end;
377 if (PyDict_SetItemString(kwds,
"co_cellvars", cell) != 0)
goto end;
378 if (PyDict_SetItemString(kwds,
"co_linetable", lnos) != 0)
goto end;
379 if (!(fn_cstr=PyUnicode_AsUTF8AndSize(fn, NULL)))
goto end;
380 if (!(name_cstr=PyUnicode_AsUTF8AndSize(name, NULL)))
goto end;
381 if (!(co = PyCode_NewEmpty(fn_cstr, name_cstr, fline)))
goto end;
382 if (!(replace = PyObject_GetAttrString((PyObject*)co,
"replace")))
goto cleanup_code_too;
383 if (!(empty = PyTuple_New(0)))
goto cleanup_code_too;
384 if (!(call_result = PyObject_Call(replace, empty, kwds)))
goto cleanup_code_too;
385 Py_XDECREF((PyObject*)co);
386 co = (PyCodeObject*)call_result;
390 Py_XDECREF((PyObject*)co);
395 Py_XDECREF(argcount);
396 Py_XDECREF(posonlyargcount);
397 Py_XDECREF(kwonlyargcount);
399 Py_XDECREF(stacksize);
401 Py_XDECREF(call_result);
404 PyErr_Restore(type, value, traceback);
409 #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\
410 PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)
412 #define __Pyx_DefaultClassType PyType_Type
414 #ifndef Py_TPFLAGS_CHECKTYPES
415 #define Py_TPFLAGS_CHECKTYPES 0
417 #ifndef Py_TPFLAGS_HAVE_INDEX
418 #define Py_TPFLAGS_HAVE_INDEX 0
420 #ifndef Py_TPFLAGS_HAVE_NEWBUFFER
421 #define Py_TPFLAGS_HAVE_NEWBUFFER 0
423 #ifndef Py_TPFLAGS_HAVE_FINALIZE
424 #define Py_TPFLAGS_HAVE_FINALIZE 0
426 #ifndef METH_STACKLESS
427 #define METH_STACKLESS 0
429 #if PY_VERSION_HEX <= 0x030700A3 || !defined(METH_FASTCALL)
430 #ifndef METH_FASTCALL
431 #define METH_FASTCALL 0x80
433 typedef PyObject *(*__Pyx_PyCFunctionFast) (PyObject *
self, PyObject *
const *args, Py_ssize_t nargs);
434 typedef PyObject *(*__Pyx_PyCFunctionFastWithKeywords) (PyObject *
self, PyObject *
const *args,
435 Py_ssize_t nargs, PyObject *kwnames);
437 #define __Pyx_PyCFunctionFast _PyCFunctionFast
438 #define __Pyx_PyCFunctionFastWithKeywords _PyCFunctionFastWithKeywords
440 #if CYTHON_FAST_PYCCALL
441 #define __Pyx_PyFastCFunction_Check(func)\
442 ((PyCFunction_Check(func) && (METH_FASTCALL == (PyCFunction_GET_FLAGS(func) & ~(METH_CLASS | METH_STATIC | METH_COEXIST | METH_KEYWORDS | METH_STACKLESS)))))
444 #define __Pyx_PyFastCFunction_Check(func) 0
446 #if CYTHON_COMPILING_IN_PYPY && !defined(PyObject_Malloc)
447 #define PyObject_Malloc(s) PyMem_Malloc(s)
448 #define PyObject_Free(p) PyMem_Free(p)
449 #define PyObject_Realloc(p) PyMem_Realloc(p)
451 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030400A1
452 #define PyMem_RawMalloc(n) PyMem_Malloc(n)
453 #define PyMem_RawRealloc(p, n) PyMem_Realloc(p, n)
454 #define PyMem_RawFree(p) PyMem_Free(p)
456 #if CYTHON_COMPILING_IN_PYSTON
457 #define __Pyx_PyCode_HasFreeVars(co) PyCode_HasFreeVars(co)
458 #define __Pyx_PyFrame_SetLineNumber(frame, lineno) PyFrame_SetLineNumber(frame, lineno)
460 #define __Pyx_PyCode_HasFreeVars(co) (PyCode_GetNumFree(co) > 0)
461 #define __Pyx_PyFrame_SetLineNumber(frame, lineno) (frame)->f_lineno = (lineno)
463 #if !CYTHON_FAST_THREAD_STATE || PY_VERSION_HEX < 0x02070000
464 #define __Pyx_PyThreadState_Current PyThreadState_GET()
465 #elif PY_VERSION_HEX >= 0x03060000
466 #define __Pyx_PyThreadState_Current _PyThreadState_UncheckedGet()
467 #elif PY_VERSION_HEX >= 0x03000000
468 #define __Pyx_PyThreadState_Current PyThreadState_GET()
470 #define __Pyx_PyThreadState_Current _PyThreadState_Current
472 #if PY_VERSION_HEX < 0x030700A2 && !defined(PyThread_tss_create) && !defined(Py_tss_NEEDS_INIT)
473 #include "pythread.h"
474 #define Py_tss_NEEDS_INIT 0
475 typedef int Py_tss_t;
476 static CYTHON_INLINE
int PyThread_tss_create(Py_tss_t *key) {
477 *key = PyThread_create_key();
480 static CYTHON_INLINE Py_tss_t * PyThread_tss_alloc(
void) {
481 Py_tss_t *key = (Py_tss_t *)PyObject_Malloc(
sizeof(Py_tss_t));
482 *key = Py_tss_NEEDS_INIT;
485 static CYTHON_INLINE
void PyThread_tss_free(Py_tss_t *key) {
488 static CYTHON_INLINE
int PyThread_tss_is_created(Py_tss_t *key) {
489 return *key != Py_tss_NEEDS_INIT;
491 static CYTHON_INLINE
void PyThread_tss_delete(Py_tss_t *key) {
492 PyThread_delete_key(*key);
493 *key = Py_tss_NEEDS_INIT;
495 static CYTHON_INLINE
int PyThread_tss_set(Py_tss_t *key,
void *value) {
496 return PyThread_set_key_value(*key, value);
498 static CYTHON_INLINE
void * PyThread_tss_get(Py_tss_t *key) {
499 return PyThread_get_key_value(*key);
502 #if CYTHON_COMPILING_IN_CPYTHON || defined(_PyDict_NewPresized)
503 #define __Pyx_PyDict_NewPresized(n) ((n <= 8) ? PyDict_New() : _PyDict_NewPresized(n))
505 #define __Pyx_PyDict_NewPresized(n) PyDict_New()
507 #if PY_MAJOR_VERSION >= 3 || CYTHON_FUTURE_DIVISION
508 #define __Pyx_PyNumber_Divide(x,y) PyNumber_TrueDivide(x,y)
509 #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceTrueDivide(x,y)
511 #define __Pyx_PyNumber_Divide(x,y) PyNumber_Divide(x,y)
512 #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceDivide(x,y)
514 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030500A1 && CYTHON_USE_UNICODE_INTERNALS
515 #define __Pyx_PyDict_GetItemStr(dict, name) _PyDict_GetItem_KnownHash(dict, name, ((PyASCIIObject *) name)->hash)
517 #define __Pyx_PyDict_GetItemStr(dict, name) PyDict_GetItem(dict, name)
519 #if PY_VERSION_HEX > 0x03030000 && defined(PyUnicode_KIND)
520 #define CYTHON_PEP393_ENABLED 1
521 #if defined(PyUnicode_IS_READY)
522 #define __Pyx_PyUnicode_READY(op) (likely(PyUnicode_IS_READY(op)) ?\
523 0 : _PyUnicode_Ready((PyObject *)(op)))
525 #define __Pyx_PyUnicode_READY(op) (0)
527 #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_LENGTH(u)
528 #define __Pyx_PyUnicode_READ_CHAR(u, i) PyUnicode_READ_CHAR(u, i)
529 #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u) PyUnicode_MAX_CHAR_VALUE(u)
530 #define __Pyx_PyUnicode_KIND(u) PyUnicode_KIND(u)
531 #define __Pyx_PyUnicode_DATA(u) PyUnicode_DATA(u)
532 #define __Pyx_PyUnicode_READ(k, d, i) PyUnicode_READ(k, d, i)
533 #define __Pyx_PyUnicode_WRITE(k, d, i, ch) PyUnicode_WRITE(k, d, i, ch)
534 #if defined(PyUnicode_IS_READY) && defined(PyUnicode_GET_SIZE)
535 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x03090000
536 #define __Pyx_PyUnicode_IS_TRUE(u) (0 != (likely(PyUnicode_IS_READY(u)) ? PyUnicode_GET_LENGTH(u) : ((PyCompactUnicodeObject *)(u))->wstr_length))
538 #define __Pyx_PyUnicode_IS_TRUE(u) (0 != (likely(PyUnicode_IS_READY(u)) ? PyUnicode_GET_LENGTH(u) : PyUnicode_GET_SIZE(u)))
541 #define __Pyx_PyUnicode_IS_TRUE(u) (0 != PyUnicode_GET_LENGTH(u))
544 #define CYTHON_PEP393_ENABLED 0
545 #define PyUnicode_1BYTE_KIND 1
546 #define PyUnicode_2BYTE_KIND 2
547 #define PyUnicode_4BYTE_KIND 4
548 #define __Pyx_PyUnicode_READY(op) (0)
549 #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_SIZE(u)
550 #define __Pyx_PyUnicode_READ_CHAR(u, i) ((Py_UCS4)(PyUnicode_AS_UNICODE(u)[i]))
551 #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u) ((sizeof(Py_UNICODE) == 2) ? 65535 : 1114111)
552 #define __Pyx_PyUnicode_KIND(u) (sizeof(Py_UNICODE))
553 #define __Pyx_PyUnicode_DATA(u) ((void*)PyUnicode_AS_UNICODE(u))
554 #define __Pyx_PyUnicode_READ(k, d, i) ((void)(k), (Py_UCS4)(((Py_UNICODE*)d)[i]))
555 #define __Pyx_PyUnicode_WRITE(k, d, i, ch) (((void)(k)), ((Py_UNICODE*)d)[i] = ch)
556 #define __Pyx_PyUnicode_IS_TRUE(u) (0 != PyUnicode_GET_SIZE(u))
558 #if CYTHON_COMPILING_IN_PYPY
559 #define __Pyx_PyUnicode_Concat(a, b) PyNumber_Add(a, b)
560 #define __Pyx_PyUnicode_ConcatSafe(a, b) PyNumber_Add(a, b)
562 #define __Pyx_PyUnicode_Concat(a, b) PyUnicode_Concat(a, b)
563 #define __Pyx_PyUnicode_ConcatSafe(a, b) ((unlikely((a) == Py_None) || unlikely((b) == Py_None)) ?\
564 PyNumber_Add(a, b) : __Pyx_PyUnicode_Concat(a, b))
566 #if CYTHON_COMPILING_IN_PYPY && !defined(PyUnicode_Contains)
567 #define PyUnicode_Contains(u, s) PySequence_Contains(u, s)
569 #if CYTHON_COMPILING_IN_PYPY && !defined(PyByteArray_Check)
570 #define PyByteArray_Check(obj) PyObject_TypeCheck(obj, &PyByteArray_Type)
572 #if CYTHON_COMPILING_IN_PYPY && !defined(PyObject_Format)
573 #define PyObject_Format(obj, fmt) PyObject_CallMethod(obj, "__format__", "O", fmt)
575 #define __Pyx_PyString_FormatSafe(a, b) ((unlikely((a) == Py_None || (PyString_Check(b) && !PyString_CheckExact(b)))) ? PyNumber_Remainder(a, b) : __Pyx_PyString_Format(a, b))
576 #define __Pyx_PyUnicode_FormatSafe(a, b) ((unlikely((a) == Py_None || (PyUnicode_Check(b) && !PyUnicode_CheckExact(b)))) ? PyNumber_Remainder(a, b) : PyUnicode_Format(a, b))
577 #if PY_MAJOR_VERSION >= 3
578 #define __Pyx_PyString_Format(a, b) PyUnicode_Format(a, b)
580 #define __Pyx_PyString_Format(a, b) PyString_Format(a, b)
582 #if PY_MAJOR_VERSION < 3 && !defined(PyObject_ASCII)
583 #define PyObject_ASCII(o) PyObject_Repr(o)
585 #if PY_MAJOR_VERSION >= 3
586 #define PyBaseString_Type PyUnicode_Type
587 #define PyStringObject PyUnicodeObject
588 #define PyString_Type PyUnicode_Type
589 #define PyString_Check PyUnicode_Check
590 #define PyString_CheckExact PyUnicode_CheckExact
591 #ifndef PyObject_Unicode
592 #define PyObject_Unicode PyObject_Str
595 #if PY_MAJOR_VERSION >= 3
596 #define __Pyx_PyBaseString_Check(obj) PyUnicode_Check(obj)
597 #define __Pyx_PyBaseString_CheckExact(obj) PyUnicode_CheckExact(obj)
599 #define __Pyx_PyBaseString_Check(obj) (PyString_Check(obj) || PyUnicode_Check(obj))
600 #define __Pyx_PyBaseString_CheckExact(obj) (PyString_CheckExact(obj) || PyUnicode_CheckExact(obj))
602 #ifndef PySet_CheckExact
603 #define PySet_CheckExact(obj) (Py_TYPE(obj) == &PySet_Type)
605 #if PY_VERSION_HEX >= 0x030900A4
606 #define __Pyx_SET_REFCNT(obj, refcnt) Py_SET_REFCNT(obj, refcnt)
607 #define __Pyx_SET_SIZE(obj, size) Py_SET_SIZE(obj, size)
609 #define __Pyx_SET_REFCNT(obj, refcnt) Py_REFCNT(obj) = (refcnt)
610 #define __Pyx_SET_SIZE(obj, size) Py_SIZE(obj) = (size)
612 #if CYTHON_ASSUME_SAFE_MACROS
613 #define __Pyx_PySequence_SIZE(seq) Py_SIZE(seq)
615 #define __Pyx_PySequence_SIZE(seq) PySequence_Size(seq)
617 #if PY_MAJOR_VERSION >= 3
618 #define PyIntObject PyLongObject
619 #define PyInt_Type PyLong_Type
620 #define PyInt_Check(op) PyLong_Check(op)
621 #define PyInt_CheckExact(op) PyLong_CheckExact(op)
622 #define PyInt_FromString PyLong_FromString
623 #define PyInt_FromUnicode PyLong_FromUnicode
624 #define PyInt_FromLong PyLong_FromLong
625 #define PyInt_FromSize_t PyLong_FromSize_t
626 #define PyInt_FromSsize_t PyLong_FromSsize_t
627 #define PyInt_AsLong PyLong_AsLong
628 #define PyInt_AS_LONG PyLong_AS_LONG
629 #define PyInt_AsSsize_t PyLong_AsSsize_t
630 #define PyInt_AsUnsignedLongMask PyLong_AsUnsignedLongMask
631 #define PyInt_AsUnsignedLongLongMask PyLong_AsUnsignedLongLongMask
632 #define PyNumber_Int PyNumber_Long
634 #if PY_MAJOR_VERSION >= 3
635 #define PyBoolObject PyLongObject
637 #if PY_MAJOR_VERSION >= 3 && CYTHON_COMPILING_IN_PYPY
638 #ifndef PyUnicode_InternFromString
639 #define PyUnicode_InternFromString(s) PyUnicode_FromString(s)
642 #if PY_VERSION_HEX < 0x030200A4
643 typedef long Py_hash_t;
644 #define __Pyx_PyInt_FromHash_t PyInt_FromLong
645 #define __Pyx_PyInt_AsHash_t __Pyx_PyIndex_AsHash_t
647 #define __Pyx_PyInt_FromHash_t PyInt_FromSsize_t
648 #define __Pyx_PyInt_AsHash_t __Pyx_PyIndex_AsSsize_t
650 #if PY_MAJOR_VERSION >= 3
651 #define __Pyx_PyMethod_New(func, self, klass) ((self) ? ((void)(klass), PyMethod_New(func, self)) : __Pyx_NewRef(func))
653 #define __Pyx_PyMethod_New(func, self, klass) PyMethod_New(func, self, klass)
655 #if CYTHON_USE_ASYNC_SLOTS
656 #if PY_VERSION_HEX >= 0x030500B1
657 #define __Pyx_PyAsyncMethodsStruct PyAsyncMethods
658 #define __Pyx_PyType_AsAsync(obj) (Py_TYPE(obj)->tp_as_async)
660 #define __Pyx_PyType_AsAsync(obj) ((__Pyx_PyAsyncMethodsStruct*) (Py_TYPE(obj)->tp_reserved))
663 #define __Pyx_PyType_AsAsync(obj) NULL
665 #ifndef __Pyx_PyAsyncMethodsStruct
670 } __Pyx_PyAsyncMethodsStruct;
673 #if defined(_WIN32) || defined(WIN32) || defined(MS_WINDOWS)
674 #if !defined(_USE_MATH_DEFINES)
675 #define _USE_MATH_DEFINES
680 #define __PYX_NAN() ((float) NAN)
682 static CYTHON_INLINE
float __PYX_NAN() {
684 memset(&value, 0xFF,
sizeof(value));
688 #if defined(__CYGWIN__) && defined(_LDBL_EQ_DBL)
689 #define __Pyx_truncl trunc
691 #define __Pyx_truncl truncl
694 #define __PYX_MARK_ERR_POS(f_index, lineno) \
695 { __pyx_filename = __pyx_f[f_index]; (void)__pyx_filename; __pyx_lineno = lineno; (void)__pyx_lineno; __pyx_clineno = __LINE__; (void)__pyx_clineno; }
696 #define __PYX_ERR(f_index, lineno, Ln_error) \
697 { __PYX_MARK_ERR_POS(f_index, lineno) goto Ln_error; }
699 #ifndef __PYX_EXTERN_C
701 #define __PYX_EXTERN_C extern "C"
703 #define __PYX_EXTERN_C extern
707 #define __PYX_HAVE__equivalent_polynomials
708 #define __PYX_HAVE_API__equivalent_polynomials
713 #include "numpy/arrayobject.h"
714 #include "numpy/ndarrayobject.h"
715 #include "numpy/ndarraytypes.h"
716 #include "numpy/arrayscalars.h"
717 #include "numpy/ufuncobject.h"
721 #include "pythread.h"
728 #if defined(PYREX_WITHOUT_ASSERTIONS) && !defined(CYTHON_WITHOUT_ASSERTIONS)
729 #define CYTHON_WITHOUT_ASSERTIONS
732 typedef struct {PyObject **p;
const char *
s;
const Py_ssize_t
n;
const char* encoding;
733 const char is_unicode;
const char is_str;
const char intern; } __Pyx_StringTabEntry;
735 #define __PYX_DEFAULT_STRING_ENCODING_IS_ASCII 0
736 #define __PYX_DEFAULT_STRING_ENCODING_IS_UTF8 0
737 #define __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT (PY_MAJOR_VERSION >= 3 && __PYX_DEFAULT_STRING_ENCODING_IS_UTF8)
738 #define __PYX_DEFAULT_STRING_ENCODING ""
739 #define __Pyx_PyObject_FromString __Pyx_PyBytes_FromString
740 #define __Pyx_PyObject_FromStringAndSize __Pyx_PyBytes_FromStringAndSize
741 #define __Pyx_uchar_cast(c) ((unsigned char)c)
742 #define __Pyx_long_cast(x) ((long)x)
743 #define __Pyx_fits_Py_ssize_t(v, type, is_signed) (\
744 (sizeof(type) < sizeof(Py_ssize_t)) ||\
745 (sizeof(type) > sizeof(Py_ssize_t) &&\
746 likely(v < (type)PY_SSIZE_T_MAX ||\
747 v == (type)PY_SSIZE_T_MAX) &&\
748 (!is_signed || likely(v > (type)PY_SSIZE_T_MIN ||\
749 v == (type)PY_SSIZE_T_MIN))) ||\
750 (sizeof(type) == sizeof(Py_ssize_t) &&\
751 (is_signed || likely(v < (type)PY_SSIZE_T_MAX ||\
752 v == (type)PY_SSIZE_T_MAX))) )
753 static CYTHON_INLINE
int __Pyx_is_valid_index(Py_ssize_t i, Py_ssize_t limit) {
754 return (
size_t) i < (size_t) limit;
756 #if defined (__cplusplus) && __cplusplus >= 201103L
758 #define __Pyx_sst_abs(value) std::abs(value)
759 #elif SIZEOF_INT >= SIZEOF_SIZE_T
760 #define __Pyx_sst_abs(value) abs(value)
761 #elif SIZEOF_LONG >= SIZEOF_SIZE_T
762 #define __Pyx_sst_abs(value) labs(value)
763 #elif defined (_MSC_VER)
764 #define __Pyx_sst_abs(value) ((Py_ssize_t)_abs64(value))
765 #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
766 #define __Pyx_sst_abs(value) llabs(value)
767 #elif defined (__GNUC__)
768 #define __Pyx_sst_abs(value) __builtin_llabs(value)
770 #define __Pyx_sst_abs(value) ((value<0) ? -value : value)
772 static CYTHON_INLINE
const char* __Pyx_PyObject_AsString(PyObject*);
773 static CYTHON_INLINE
const char* __Pyx_PyObject_AsStringAndSize(PyObject*, Py_ssize_t* length);
774 #define __Pyx_PyByteArray_FromString(s) PyByteArray_FromStringAndSize((const char*)s, strlen((const char*)s))
775 #define __Pyx_PyByteArray_FromStringAndSize(s, l) PyByteArray_FromStringAndSize((const char*)s, l)
776 #define __Pyx_PyBytes_FromString PyBytes_FromString
777 #define __Pyx_PyBytes_FromStringAndSize PyBytes_FromStringAndSize
778 static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(
const char*);
779 #if PY_MAJOR_VERSION < 3
780 #define __Pyx_PyStr_FromString __Pyx_PyBytes_FromString
781 #define __Pyx_PyStr_FromStringAndSize __Pyx_PyBytes_FromStringAndSize
783 #define __Pyx_PyStr_FromString __Pyx_PyUnicode_FromString
784 #define __Pyx_PyStr_FromStringAndSize __Pyx_PyUnicode_FromStringAndSize
786 #define __Pyx_PyBytes_AsWritableString(s) ((char*) PyBytes_AS_STRING(s))
787 #define __Pyx_PyBytes_AsWritableSString(s) ((signed char*) PyBytes_AS_STRING(s))
788 #define __Pyx_PyBytes_AsWritableUString(s) ((unsigned char*) PyBytes_AS_STRING(s))
789 #define __Pyx_PyBytes_AsString(s) ((const char*) PyBytes_AS_STRING(s))
790 #define __Pyx_PyBytes_AsSString(s) ((const signed char*) PyBytes_AS_STRING(s))
791 #define __Pyx_PyBytes_AsUString(s) ((const unsigned char*) PyBytes_AS_STRING(s))
792 #define __Pyx_PyObject_AsWritableString(s) ((char*) __Pyx_PyObject_AsString(s))
793 #define __Pyx_PyObject_AsWritableSString(s) ((signed char*) __Pyx_PyObject_AsString(s))
794 #define __Pyx_PyObject_AsWritableUString(s) ((unsigned char*) __Pyx_PyObject_AsString(s))
795 #define __Pyx_PyObject_AsSString(s) ((const signed char*) __Pyx_PyObject_AsString(s))
796 #define __Pyx_PyObject_AsUString(s) ((const unsigned char*) __Pyx_PyObject_AsString(s))
797 #define __Pyx_PyObject_FromCString(s) __Pyx_PyObject_FromString((const char*)s)
798 #define __Pyx_PyBytes_FromCString(s) __Pyx_PyBytes_FromString((const char*)s)
799 #define __Pyx_PyByteArray_FromCString(s) __Pyx_PyByteArray_FromString((const char*)s)
800 #define __Pyx_PyStr_FromCString(s) __Pyx_PyStr_FromString((const char*)s)
801 #define __Pyx_PyUnicode_FromCString(s) __Pyx_PyUnicode_FromString((const char*)s)
802 static CYTHON_INLINE
size_t __Pyx_Py_UNICODE_strlen(
const Py_UNICODE *
u) {
803 const Py_UNICODE *u_end =
u;
805 return (
size_t)(u_end -
u - 1);
807 #define __Pyx_PyUnicode_FromUnicode(u) PyUnicode_FromUnicode(u, __Pyx_Py_UNICODE_strlen(u))
808 #define __Pyx_PyUnicode_FromUnicodeAndLength PyUnicode_FromUnicode
809 #define __Pyx_PyUnicode_AsUnicode PyUnicode_AsUnicode
810 #define __Pyx_NewRef(obj) (Py_INCREF(obj), obj)
811 #define __Pyx_Owned_Py_None(b) __Pyx_NewRef(Py_None)
812 static CYTHON_INLINE PyObject * __Pyx_PyBool_FromLong(
long b);
813 static CYTHON_INLINE
int __Pyx_PyObject_IsTrue(PyObject*);
814 static CYTHON_INLINE
int __Pyx_PyObject_IsTrueAndDecref(PyObject*);
815 static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x);
816 #define __Pyx_PySequence_Tuple(obj)\
817 (likely(PyTuple_CheckExact(obj)) ? __Pyx_NewRef(obj) : PySequence_Tuple(obj))
818 static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject*);
819 static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(
size_t);
820 static CYTHON_INLINE Py_hash_t __Pyx_PyIndex_AsHash_t(PyObject*);
821 #if CYTHON_ASSUME_SAFE_MACROS
822 #define __pyx_PyFloat_AsDouble(x) (PyFloat_CheckExact(x) ? PyFloat_AS_DOUBLE(x) : PyFloat_AsDouble(x))
824 #define __pyx_PyFloat_AsDouble(x) PyFloat_AsDouble(x)
826 #define __pyx_PyFloat_AsFloat(x) ((float) __pyx_PyFloat_AsDouble(x))
827 #if PY_MAJOR_VERSION >= 3
828 #define __Pyx_PyNumber_Int(x) (PyLong_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Long(x))
830 #define __Pyx_PyNumber_Int(x) (PyInt_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Int(x))
832 #define __Pyx_PyNumber_Float(x) (PyFloat_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Float(x))
833 #if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
834 static int __Pyx_sys_getdefaultencoding_not_ascii;
835 static int __Pyx_init_sys_getdefaultencoding_params(
void) {
837 PyObject* default_encoding = NULL;
838 PyObject* ascii_chars_u = NULL;
839 PyObject* ascii_chars_b = NULL;
840 const char* default_encoding_c;
841 sys = PyImport_ImportModule(
"sys");
843 default_encoding = PyObject_CallMethod(sys, (
char*)
"getdefaultencoding", NULL);
845 if (!default_encoding)
goto bad;
846 default_encoding_c = PyBytes_AsString(default_encoding);
847 if (!default_encoding_c)
goto bad;
848 if (strcmp(default_encoding_c,
"ascii") == 0) {
849 __Pyx_sys_getdefaultencoding_not_ascii = 0;
851 char ascii_chars[128];
853 for (
c = 0;
c < 128;
c++) {
856 __Pyx_sys_getdefaultencoding_not_ascii = 1;
857 ascii_chars_u = PyUnicode_DecodeASCII(ascii_chars, 128, NULL);
858 if (!ascii_chars_u)
goto bad;
859 ascii_chars_b = PyUnicode_AsEncodedString(ascii_chars_u, default_encoding_c, NULL);
860 if (!ascii_chars_b || !PyBytes_Check(ascii_chars_b) || memcmp(ascii_chars, PyBytes_AS_STRING(ascii_chars_b), 128) != 0) {
863 "This module compiled with c_string_encoding=ascii, but default encoding '%.200s' is not a superset of ascii.",
867 Py_DECREF(ascii_chars_u);
868 Py_DECREF(ascii_chars_b);
870 Py_DECREF(default_encoding);
873 Py_XDECREF(default_encoding);
874 Py_XDECREF(ascii_chars_u);
875 Py_XDECREF(ascii_chars_b);
879 #if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT && PY_MAJOR_VERSION >= 3
880 #define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_DecodeUTF8(c_str, size, NULL)
882 #define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_Decode(c_str, size, __PYX_DEFAULT_STRING_ENCODING, NULL)
883 #if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT
884 static char* __PYX_DEFAULT_STRING_ENCODING;
885 static int __Pyx_init_sys_getdefaultencoding_params(
void) {
887 PyObject* default_encoding = NULL;
888 char* default_encoding_c;
889 sys = PyImport_ImportModule(
"sys");
891 default_encoding = PyObject_CallMethod(sys, (
char*) (
const char*)
"getdefaultencoding", NULL);
893 if (!default_encoding)
goto bad;
894 default_encoding_c = PyBytes_AsString(default_encoding);
895 if (!default_encoding_c)
goto bad;
896 __PYX_DEFAULT_STRING_ENCODING = (
char*) malloc(strlen(default_encoding_c) + 1);
897 if (!__PYX_DEFAULT_STRING_ENCODING)
goto bad;
898 strcpy(__PYX_DEFAULT_STRING_ENCODING, default_encoding_c);
899 Py_DECREF(default_encoding);
902 Py_XDECREF(default_encoding);
910 #if defined(__GNUC__) && (__GNUC__ > 2 || (__GNUC__ == 2 && (__GNUC_MINOR__ > 95)))
911 #define likely(x) __builtin_expect(!!(x), 1)
912 #define unlikely(x) __builtin_expect(!!(x), 0)
914 #define likely(x) (x)
915 #define unlikely(x) (x)
917 static CYTHON_INLINE
void __Pyx_pretend_to_initialize(
void* ptr) { (void)ptr; }
919 static PyObject *__pyx_m = NULL;
920 static PyObject *__pyx_d;
921 static PyObject *__pyx_b;
922 static PyObject *__pyx_cython_runtime = NULL;
923 static PyObject *__pyx_empty_tuple;
924 static PyObject *__pyx_empty_bytes;
925 static PyObject *__pyx_empty_unicode;
926 static int __pyx_lineno;
927 static int __pyx_clineno = 0;
928 static const char * __pyx_cfilenm= __FILE__;
929 static const char *__pyx_filename;
932 #if !defined(CYTHON_CCOMPLEX)
933 #if defined(__cplusplus)
934 #define CYTHON_CCOMPLEX 1
935 #elif defined(_Complex_I)
936 #define CYTHON_CCOMPLEX 1
938 #define CYTHON_CCOMPLEX 0
948 #if CYTHON_CCOMPLEX && !defined(__cplusplus) && defined(__sun__) && defined(__GNUC__)
950 #define _Complex_I 1.0fj
954 static const char *__pyx_f[] = {
956 "proteus/equivalent_polynomials.pyx",
961 #ifndef __PYX_FORCE_INIT_THREADS
962 #define __PYX_FORCE_INIT_THREADS 0
966 #define __Pyx_PyGILState_Ensure PyGILState_Ensure
967 #define __Pyx_PyGILState_Release PyGILState_Release
968 #define __Pyx_FastGIL_Remember()
969 #define __Pyx_FastGIL_Forget()
970 #define __Pyx_FastGilFuncInit()
973 #define IS_UNSIGNED(type) (((type) -1) > 0)
974 struct __Pyx_StructField_;
975 #define __PYX_BUF_FLAGS_PACKED_STRUCT (1 << 0)
978 struct __Pyx_StructField_* fields;
986 typedef struct __Pyx_StructField_ {
987 __Pyx_TypeInfo* type;
992 __Pyx_StructField* field;
993 size_t parent_offset;
994 } __Pyx_BufFmt_StackElem;
996 __Pyx_StructField root;
997 __Pyx_BufFmt_StackElem* head;
999 size_t new_count, enc_count;
1000 size_t struct_alignment;
1005 char is_valid_array;
1006 } __Pyx_BufFmt_Context;
1009 #include <pythread.h>
1010 #ifndef CYTHON_ATOMICS
1011 #define CYTHON_ATOMICS 1
1013 #define __pyx_atomic_int_type int
1014 #if CYTHON_ATOMICS && __GNUC__ >= 4 && (__GNUC_MINOR__ > 1 ||\
1015 (__GNUC_MINOR__ == 1 && __GNUC_PATCHLEVEL >= 2)) &&\
1017 #define __pyx_atomic_incr_aligned(value, lock) __sync_fetch_and_add(value, 1)
1018 #define __pyx_atomic_decr_aligned(value, lock) __sync_fetch_and_sub(value, 1)
1019 #ifdef __PYX_DEBUG_ATOMICS
1020 #warning "Using GNU atomics"
1022 #elif CYTHON_ATOMICS && defined(_MSC_VER) && 0
1023 #include <Windows.h>
1024 #undef __pyx_atomic_int_type
1025 #define __pyx_atomic_int_type LONG
1026 #define __pyx_atomic_incr_aligned(value, lock) InterlockedIncrement(value)
1027 #define __pyx_atomic_decr_aligned(value, lock) InterlockedDecrement(value)
1028 #ifdef __PYX_DEBUG_ATOMICS
1029 #pragma message ("Using MSVC atomics")
1031 #elif CYTHON_ATOMICS && (defined(__ICC) || defined(__INTEL_COMPILER)) && 0
1032 #define __pyx_atomic_incr_aligned(value, lock) _InterlockedIncrement(value)
1033 #define __pyx_atomic_decr_aligned(value, lock) _InterlockedDecrement(value)
1034 #ifdef __PYX_DEBUG_ATOMICS
1035 #warning "Using Intel atomics"
1038 #undef CYTHON_ATOMICS
1039 #define CYTHON_ATOMICS 0
1040 #ifdef __PYX_DEBUG_ATOMICS
1041 #warning "Not using atomics"
1044 typedef volatile __pyx_atomic_int_type __pyx_atomic_int;
1046 #define __pyx_add_acquisition_count(memview)\
1047 __pyx_atomic_incr_aligned(__pyx_get_slice_count_pointer(memview), memview->lock)
1048 #define __pyx_sub_acquisition_count(memview)\
1049 __pyx_atomic_decr_aligned(__pyx_get_slice_count_pointer(memview), memview->lock)
1051 #define __pyx_add_acquisition_count(memview)\
1052 __pyx_add_acquisition_count_locked(__pyx_get_slice_count_pointer(memview), memview->lock)
1053 #define __pyx_sub_acquisition_count(memview)\
1054 __pyx_sub_acquisition_count_locked(__pyx_get_slice_count_pointer(memview), memview->lock)
1058 struct __pyx_memoryview_obj;
1060 struct __pyx_memoryview_obj *memview;
1062 Py_ssize_t shape[8];
1063 Py_ssize_t strides[8];
1064 Py_ssize_t suboffsets[8];
1065 } __Pyx_memviewslice;
1066 #define __Pyx_MemoryView_Len(m) (m.shape[0])
1076 typedef npy_int8 __pyx_t_5numpy_int8_t;
1085 typedef npy_int16 __pyx_t_5numpy_int16_t;
1094 typedef npy_int32 __pyx_t_5numpy_int32_t;
1103 typedef npy_int64 __pyx_t_5numpy_int64_t;
1112 typedef npy_uint8 __pyx_t_5numpy_uint8_t;
1121 typedef npy_uint16 __pyx_t_5numpy_uint16_t;
1130 typedef npy_uint32 __pyx_t_5numpy_uint32_t;
1139 typedef npy_uint64 __pyx_t_5numpy_uint64_t;
1148 typedef npy_float32 __pyx_t_5numpy_float32_t;
1157 typedef npy_float64 __pyx_t_5numpy_float64_t;
1166 typedef npy_long __pyx_t_5numpy_int_t;
1175 typedef npy_longlong __pyx_t_5numpy_long_t;
1184 typedef npy_longlong __pyx_t_5numpy_longlong_t;
1193 typedef npy_ulong __pyx_t_5numpy_uint_t;
1202 typedef npy_ulonglong __pyx_t_5numpy_ulong_t;
1211 typedef npy_ulonglong __pyx_t_5numpy_ulonglong_t;
1220 typedef npy_intp __pyx_t_5numpy_intp_t;
1229 typedef npy_uintp __pyx_t_5numpy_uintp_t;
1238 typedef npy_double __pyx_t_5numpy_float_t;
1247 typedef npy_double __pyx_t_5numpy_double_t;
1256 typedef npy_longdouble __pyx_t_5numpy_longdouble_t;
1260 typedef ::std::complex< float > __pyx_t_float_complex;
1262 typedef float _Complex __pyx_t_float_complex;
1265 typedef struct {
float real, imag; } __pyx_t_float_complex;
1267 static CYTHON_INLINE __pyx_t_float_complex __pyx_t_float_complex_from_parts(
float,
float);
1272 typedef ::std::complex< double > __pyx_t_double_complex;
1274 typedef double _Complex __pyx_t_double_complex;
1277 typedef struct {
double real, imag; } __pyx_t_double_complex;
1279 static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(
double,
double);
1283 struct __pyx_obj_22equivalent_polynomials_Simplex;
1284 struct __pyx_array_obj;
1285 struct __pyx_MemviewEnum_obj;
1286 struct __pyx_memoryview_obj;
1287 struct __pyx_memoryviewslice_obj;
1296 typedef npy_cfloat __pyx_t_5numpy_cfloat_t;
1305 typedef npy_cdouble __pyx_t_5numpy_cdouble_t;
1314 typedef npy_clongdouble __pyx_t_5numpy_clongdouble_t;
1323 typedef npy_cdouble __pyx_t_5numpy_complex_t;
1332 struct __pyx_obj_22equivalent_polynomials_Simplex {
1334 PyArrayObject *xiBuffer;
1342 PyArrayObject *_ImH;
1363 struct __pyx_array_obj {
1365 struct __pyx_vtabstruct_array *__pyx_vtab;
1371 Py_ssize_t *_strides;
1372 Py_ssize_t itemsize;
1375 void (*callback_free_data)(
void *);
1377 int dtype_is_object;
1388 struct __pyx_MemviewEnum_obj {
1401 struct __pyx_memoryview_obj {
1403 struct __pyx_vtabstruct_memoryview *__pyx_vtab;
1406 PyObject *_array_interface;
1407 PyThread_type_lock lock;
1408 __pyx_atomic_int acquisition_count[2];
1409 __pyx_atomic_int *acquisition_count_aligned_p;
1412 int dtype_is_object;
1413 __Pyx_TypeInfo *typeinfo;
1424 struct __pyx_memoryviewslice_obj {
1425 struct __pyx_memoryview_obj __pyx_base;
1426 __Pyx_memviewslice from_slice;
1427 PyObject *from_object;
1428 PyObject *(*to_object_func)(
char *);
1429 int (*to_dtype_func)(
char *, PyObject *);
1442 struct __pyx_vtabstruct_array {
1443 PyObject *(*get_memview)(
struct __pyx_array_obj *);
1445 static struct __pyx_vtabstruct_array *__pyx_vtabptr_array;
1456 struct __pyx_vtabstruct_memoryview {
1457 char *(*get_item_pointer)(
struct __pyx_memoryview_obj *, PyObject *);
1458 PyObject *(*is_slice)(
struct __pyx_memoryview_obj *, PyObject *);
1459 PyObject *(*setitem_slice_assignment)(
struct __pyx_memoryview_obj *, PyObject *, PyObject *);
1460 PyObject *(*setitem_slice_assign_scalar)(
struct __pyx_memoryview_obj *,
struct __pyx_memoryview_obj *, PyObject *);
1461 PyObject *(*setitem_indexed)(
struct __pyx_memoryview_obj *, PyObject *, PyObject *);
1462 PyObject *(*convert_item_to_object)(
struct __pyx_memoryview_obj *,
char *);
1463 PyObject *(*assign_item_from_object)(
struct __pyx_memoryview_obj *,
char *, PyObject *);
1465 static struct __pyx_vtabstruct_memoryview *__pyx_vtabptr_memoryview;
1476 struct __pyx_vtabstruct__memoryviewslice {
1477 struct __pyx_vtabstruct_memoryview __pyx_base;
1479 static struct __pyx_vtabstruct__memoryviewslice *__pyx_vtabptr__memoryviewslice;
1483 #ifndef CYTHON_REFNANNY
1484 #define CYTHON_REFNANNY 0
1488 void (*INCREF)(
void*, PyObject*, int);
1489 void (*DECREF)(
void*, PyObject*, int);
1490 void (*GOTREF)(
void*, PyObject*, int);
1491 void (*GIVEREF)(
void*, PyObject*, int);
1492 void* (*SetupContext)(
const char*, int,
const char*);
1493 void (*FinishContext)(
void**);
1494 } __Pyx_RefNannyAPIStruct;
1495 static __Pyx_RefNannyAPIStruct *__Pyx_RefNanny = NULL;
1496 static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(
const char *modname);
1497 #define __Pyx_RefNannyDeclarations void *__pyx_refnanny = NULL;
1499 #define __Pyx_RefNannySetupContext(name, acquire_gil)\
1501 PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();\
1502 __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__);\
1503 PyGILState_Release(__pyx_gilstate_save);\
1505 __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__);\
1508 #define __Pyx_RefNannySetupContext(name, acquire_gil)\
1509 __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__)
1511 #define __Pyx_RefNannyFinishContext()\
1512 __Pyx_RefNanny->FinishContext(&__pyx_refnanny)
1513 #define __Pyx_INCREF(r) __Pyx_RefNanny->INCREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
1514 #define __Pyx_DECREF(r) __Pyx_RefNanny->DECREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
1515 #define __Pyx_GOTREF(r) __Pyx_RefNanny->GOTREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
1516 #define __Pyx_GIVEREF(r) __Pyx_RefNanny->GIVEREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
1517 #define __Pyx_XINCREF(r) do { if((r) != NULL) {__Pyx_INCREF(r); }} while(0)
1518 #define __Pyx_XDECREF(r) do { if((r) != NULL) {__Pyx_DECREF(r); }} while(0)
1519 #define __Pyx_XGOTREF(r) do { if((r) != NULL) {__Pyx_GOTREF(r); }} while(0)
1520 #define __Pyx_XGIVEREF(r) do { if((r) != NULL) {__Pyx_GIVEREF(r);}} while(0)
1522 #define __Pyx_RefNannyDeclarations
1523 #define __Pyx_RefNannySetupContext(name, acquire_gil)
1524 #define __Pyx_RefNannyFinishContext()
1525 #define __Pyx_INCREF(r) Py_INCREF(r)
1526 #define __Pyx_DECREF(r) Py_DECREF(r)
1527 #define __Pyx_GOTREF(r)
1528 #define __Pyx_GIVEREF(r)
1529 #define __Pyx_XINCREF(r) Py_XINCREF(r)
1530 #define __Pyx_XDECREF(r) Py_XDECREF(r)
1531 #define __Pyx_XGOTREF(r)
1532 #define __Pyx_XGIVEREF(r)
1534 #define __Pyx_XDECREF_SET(r, v) do {\
1535 PyObject *tmp = (PyObject *) r;\
1536 r = v; __Pyx_XDECREF(tmp);\
1538 #define __Pyx_DECREF_SET(r, v) do {\
1539 PyObject *tmp = (PyObject *) r;\
1540 r = v; __Pyx_DECREF(tmp);\
1542 #define __Pyx_CLEAR(r) do { PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);} while(0)
1543 #define __Pyx_XCLEAR(r) do { if((r) != NULL) {PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);}} while(0)
1546 #if CYTHON_USE_TYPE_SLOTS
1547 static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name);
1549 #define __Pyx_PyObject_GetAttrStr(o,n) PyObject_GetAttr(o,n)
1553 static PyObject *__Pyx_GetBuiltinName(PyObject *name);
1556 static void __Pyx_RaiseArgtupleInvalid(
const char* func_name,
int exact,
1557 Py_ssize_t num_min, Py_ssize_t num_max, Py_ssize_t num_found);
1560 static void __Pyx_RaiseDoubleKeywordsError(
const char* func_name, PyObject* kw_name);
1563 static int __Pyx_ParseOptionalKeywords(PyObject *kwds, PyObject **argnames[],\
1564 PyObject *kwds2, PyObject *values[], Py_ssize_t num_pos_args,\
1565 const char* function_name);
1568 #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_TYPE_SLOTS
1569 #define __PYX_DICT_VERSION_INIT ((PY_UINT64_T) -1)
1570 #define __PYX_GET_DICT_VERSION(dict) (((PyDictObject*)(dict))->ma_version_tag)
1571 #define __PYX_UPDATE_DICT_CACHE(dict, value, cache_var, version_var)\
1572 (version_var) = __PYX_GET_DICT_VERSION(dict);\
1573 (cache_var) = (value);
1574 #define __PYX_PY_DICT_LOOKUP_IF_MODIFIED(VAR, DICT, LOOKUP) {\
1575 static PY_UINT64_T __pyx_dict_version = 0;\
1576 static PyObject *__pyx_dict_cached_value = NULL;\
1577 if (likely(__PYX_GET_DICT_VERSION(DICT) == __pyx_dict_version)) {\
1578 (VAR) = __pyx_dict_cached_value;\
1580 (VAR) = __pyx_dict_cached_value = (LOOKUP);\
1581 __pyx_dict_version = __PYX_GET_DICT_VERSION(DICT);\
1584 static CYTHON_INLINE PY_UINT64_T __Pyx_get_tp_dict_version(PyObject *obj);
1585 static CYTHON_INLINE PY_UINT64_T __Pyx_get_object_dict_version(PyObject *obj);
1586 static CYTHON_INLINE
int __Pyx_object_dict_version_matches(PyObject* obj, PY_UINT64_T tp_dict_version, PY_UINT64_T obj_dict_version);
1588 #define __PYX_GET_DICT_VERSION(dict) (0)
1589 #define __PYX_UPDATE_DICT_CACHE(dict, value, cache_var, version_var)
1590 #define __PYX_PY_DICT_LOOKUP_IF_MODIFIED(VAR, DICT, LOOKUP) (VAR) = (LOOKUP);
1594 #if CYTHON_USE_DICT_VERSIONS
1595 #define __Pyx_GetModuleGlobalName(var, name) {\
1596 static PY_UINT64_T __pyx_dict_version = 0;\
1597 static PyObject *__pyx_dict_cached_value = NULL;\
1598 (var) = (likely(__pyx_dict_version == __PYX_GET_DICT_VERSION(__pyx_d))) ?\
1599 (likely(__pyx_dict_cached_value) ? __Pyx_NewRef(__pyx_dict_cached_value) : __Pyx_GetBuiltinName(name)) :\
1600 __Pyx__GetModuleGlobalName(name, &__pyx_dict_version, &__pyx_dict_cached_value);\
1602 #define __Pyx_GetModuleGlobalNameUncached(var, name) {\
1603 PY_UINT64_T __pyx_dict_version;\
1604 PyObject *__pyx_dict_cached_value;\
1605 (var) = __Pyx__GetModuleGlobalName(name, &__pyx_dict_version, &__pyx_dict_cached_value);\
1607 static PyObject *__Pyx__GetModuleGlobalName(PyObject *name, PY_UINT64_T *dict_version, PyObject **dict_cached_value);
1609 #define __Pyx_GetModuleGlobalName(var, name) (var) = __Pyx__GetModuleGlobalName(name)
1610 #define __Pyx_GetModuleGlobalNameUncached(var, name) (var) = __Pyx__GetModuleGlobalName(name)
1611 static CYTHON_INLINE PyObject *__Pyx__GetModuleGlobalName(PyObject *name);
1615 #if CYTHON_COMPILING_IN_CPYTHON
1616 static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw);
1618 #define __Pyx_PyObject_Call(func, arg, kw) PyObject_Call(func, arg, kw)
1622 static CYTHON_INLINE
int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type);
1625 #define __Pyx_ArgTypeTest(obj, type, none_allowed, name, exact)\
1626 ((likely((Py_TYPE(obj) == type) | (none_allowed && (obj == Py_None)))) ? 1 :\
1627 __Pyx__ArgTypeTest(obj, type, name, exact))
1628 static int __Pyx__ArgTypeTest(PyObject *obj, PyTypeObject *type,
const char *name,
int exact);
1631 #define __Pyx_PyObject_DelSlice(obj, cstart, cstop, py_start, py_stop, py_slice, has_cstart, has_cstop, wraparound)\
1632 __Pyx_PyObject_SetSlice(obj, (PyObject*)NULL, cstart, cstop, py_start, py_stop, py_slice, has_cstart, has_cstop, wraparound)
1633 static CYTHON_INLINE
int __Pyx_PyObject_SetSlice(
1634 PyObject* obj, PyObject* value, Py_ssize_t cstart, Py_ssize_t cstop,
1635 PyObject** py_start, PyObject** py_stop, PyObject** py_slice,
1636 int has_cstart,
int has_cstop,
int wraparound);
1639 #if CYTHON_FAST_PYCCALL
1640 static CYTHON_INLINE PyObject *__Pyx_PyCFunction_FastCall(PyObject *func, PyObject **args, Py_ssize_t nargs);
1642 #define __Pyx_PyCFunction_FastCall(func, args, nargs) (assert(0), NULL)
1646 #if CYTHON_FAST_PYCALL
1647 #define __Pyx_PyFunction_FastCall(func, args, nargs)\
1648 __Pyx_PyFunction_FastCallDict((func), (args), (nargs), NULL)
1649 #if 1 || PY_VERSION_HEX < 0x030600B1
1650 static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args, Py_ssize_t nargs, PyObject *kwargs);
1652 #define __Pyx_PyFunction_FastCallDict(func, args, nargs, kwargs) _PyFunction_FastCallDict(func, args, nargs, kwargs)
1654 #define __Pyx_BUILD_ASSERT_EXPR(cond)\
1655 (sizeof(char [1 - 2*!(cond)]) - 1)
1656 #ifndef Py_MEMBER_SIZE
1657 #define Py_MEMBER_SIZE(type, member) sizeof(((type *)0)->member)
1659 #if CYTHON_FAST_PYCALL
1660 static size_t __pyx_pyframe_localsplus_offset = 0;
1661 #include "frameobject.h"
1662 #if PY_VERSION_HEX >= 0x030b00a6
1663 #ifndef Py_BUILD_CORE
1664 #define Py_BUILD_CORE 1
1666 #include "internal/pycore_frame.h"
1668 #define __Pxy_PyFrame_Initialize_Offsets()\
1669 ((void)__Pyx_BUILD_ASSERT_EXPR(sizeof(PyFrameObject) == offsetof(PyFrameObject, f_localsplus) + Py_MEMBER_SIZE(PyFrameObject, f_localsplus)),\
1670 (void)(__pyx_pyframe_localsplus_offset = ((size_t)PyFrame_Type.tp_basicsize) - Py_MEMBER_SIZE(PyFrameObject, f_localsplus)))
1671 #define __Pyx_PyFrame_GetLocalsplus(frame)\
1672 (assert(__pyx_pyframe_localsplus_offset), (PyObject **)(((char *)(frame)) + __pyx_pyframe_localsplus_offset))
1673 #endif // CYTHON_FAST_PYCALL
1677 static CYTHON_UNUSED PyObject* __Pyx_PyObject_Call2Args(PyObject*
function, PyObject* arg1, PyObject* arg2);
1680 #if CYTHON_COMPILING_IN_CPYTHON
1681 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg);
1685 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg);
1688 #define __Pyx_GetItemInt(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\
1689 (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\
1690 __Pyx_GetItemInt_Fast(o, (Py_ssize_t)i, is_list, wraparound, boundscheck) :\
1691 (is_list ? (PyErr_SetString(PyExc_IndexError, "list index out of range"), (PyObject*)NULL) :\
1692 __Pyx_GetItemInt_Generic(o, to_py_func(i))))
1693 #define __Pyx_GetItemInt_List(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\
1694 (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\
1695 __Pyx_GetItemInt_List_Fast(o, (Py_ssize_t)i, wraparound, boundscheck) :\
1696 (PyErr_SetString(PyExc_IndexError, "list index out of range"), (PyObject*)NULL))
1697 static CYTHON_INLINE PyObject *__Pyx_GetItemInt_List_Fast(PyObject *o, Py_ssize_t i,
1698 int wraparound,
int boundscheck);
1699 #define __Pyx_GetItemInt_Tuple(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\
1700 (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\
1701 __Pyx_GetItemInt_Tuple_Fast(o, (Py_ssize_t)i, wraparound, boundscheck) :\
1702 (PyErr_SetString(PyExc_IndexError, "tuple index out of range"), (PyObject*)NULL))
1703 static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize_t i,
1704 int wraparound,
int boundscheck);
1705 static PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j);
1706 static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i,
1707 int is_list,
int wraparound,
int boundscheck);
1710 #if CYTHON_FAST_THREAD_STATE
1711 #define __Pyx_PyThreadState_declare PyThreadState *__pyx_tstate;
1712 #define __Pyx_PyThreadState_assign __pyx_tstate = __Pyx_PyThreadState_Current;
1713 #define __Pyx_PyErr_Occurred() __pyx_tstate->curexc_type
1715 #define __Pyx_PyThreadState_declare
1716 #define __Pyx_PyThreadState_assign
1717 #define __Pyx_PyErr_Occurred() PyErr_Occurred()
1721 #if CYTHON_FAST_THREAD_STATE
1722 #define __Pyx_PyErr_Clear() __Pyx_ErrRestore(NULL, NULL, NULL)
1723 #define __Pyx_ErrRestoreWithState(type, value, tb) __Pyx_ErrRestoreInState(PyThreadState_GET(), type, value, tb)
1724 #define __Pyx_ErrFetchWithState(type, value, tb) __Pyx_ErrFetchInState(PyThreadState_GET(), type, value, tb)
1725 #define __Pyx_ErrRestore(type, value, tb) __Pyx_ErrRestoreInState(__pyx_tstate, type, value, tb)
1726 #define __Pyx_ErrFetch(type, value, tb) __Pyx_ErrFetchInState(__pyx_tstate, type, value, tb)
1727 static CYTHON_INLINE
void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb);
1728 static CYTHON_INLINE
void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb);
1729 #if CYTHON_COMPILING_IN_CPYTHON
1730 #define __Pyx_PyErr_SetNone(exc) (Py_INCREF(exc), __Pyx_ErrRestore((exc), NULL, NULL))
1732 #define __Pyx_PyErr_SetNone(exc) PyErr_SetNone(exc)
1735 #define __Pyx_PyErr_Clear() PyErr_Clear()
1736 #define __Pyx_PyErr_SetNone(exc) PyErr_SetNone(exc)
1737 #define __Pyx_ErrRestoreWithState(type, value, tb) PyErr_Restore(type, value, tb)
1738 #define __Pyx_ErrFetchWithState(type, value, tb) PyErr_Fetch(type, value, tb)
1739 #define __Pyx_ErrRestoreInState(tstate, type, value, tb) PyErr_Restore(type, value, tb)
1740 #define __Pyx_ErrFetchInState(tstate, type, value, tb) PyErr_Fetch(type, value, tb)
1741 #define __Pyx_ErrRestore(type, value, tb) PyErr_Restore(type, value, tb)
1742 #define __Pyx_ErrFetch(type, value, tb) PyErr_Fetch(type, value, tb)
1746 static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause);
1749 #if CYTHON_USE_EXC_INFO_STACK
1750 static _PyErr_StackItem * __Pyx_PyErr_GetTopmostException(PyThreadState *tstate);
1754 #if CYTHON_FAST_THREAD_STATE
1755 #define __Pyx_ExceptionSave(type, value, tb) __Pyx__ExceptionSave(__pyx_tstate, type, value, tb)
1756 static CYTHON_INLINE
void __Pyx__ExceptionSave(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb);
1757 #define __Pyx_ExceptionReset(type, value, tb) __Pyx__ExceptionReset(__pyx_tstate, type, value, tb)
1758 static CYTHON_INLINE
void __Pyx__ExceptionReset(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb);
1760 #define __Pyx_ExceptionSave(type, value, tb) PyErr_GetExcInfo(type, value, tb)
1761 #define __Pyx_ExceptionReset(type, value, tb) PyErr_SetExcInfo(type, value, tb)
1765 #if CYTHON_FAST_THREAD_STATE
1766 #define __Pyx_PyErr_ExceptionMatches(err) __Pyx_PyErr_ExceptionMatchesInState(__pyx_tstate, err)
1767 static CYTHON_INLINE
int __Pyx_PyErr_ExceptionMatchesInState(PyThreadState* tstate, PyObject* err);
1769 #define __Pyx_PyErr_ExceptionMatches(err) PyErr_ExceptionMatches(err)
1773 #if CYTHON_FAST_THREAD_STATE
1774 #define __Pyx_GetException(type, value, tb) __Pyx__GetException(__pyx_tstate, type, value, tb)
1775 static int __Pyx__GetException(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb);
1777 static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb);
1784 static CYTHON_INLINE
int __Pyx_PyBytes_Equals(PyObject* s1, PyObject* s2,
int equals);
1787 static CYTHON_INLINE
int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2,
int equals);
1790 #if PY_MAJOR_VERSION >= 3
1791 #define __Pyx_PyString_Equals __Pyx_PyUnicode_Equals
1793 #define __Pyx_PyString_Equals __Pyx_PyBytes_Equals
1797 static CYTHON_INLINE Py_ssize_t __Pyx_div_Py_ssize_t(Py_ssize_t, Py_ssize_t);
1800 #define UNARY_NEG_WOULD_OVERFLOW(x)\
1801 (((x) < 0) & ((unsigned long)(x) == 0-(unsigned long)(x)))
1803 static CYTHON_UNUSED
int __pyx_array_getbuffer(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info,
int __pyx_v_flags);
1804 static PyObject *__pyx_array_get_memview(
struct __pyx_array_obj *);
1806 static CYTHON_INLINE PyObject *__Pyx_GetAttr(PyObject *, PyObject *);
1809 #if CYTHON_USE_TYPE_SLOTS
1810 static CYTHON_INLINE PyObject *__Pyx_PyObject_GetItem(PyObject *obj, PyObject* key);
1812 #define __Pyx_PyObject_GetItem(obj, key) PyObject_GetItem(obj, key)
1816 static CYTHON_INLINE PyObject *__Pyx_PyUnicode_DecodeUTF16(
const char *
s, Py_ssize_t size,
const char *errors) {
1818 return PyUnicode_DecodeUTF16(
s, size, errors, &byteorder);
1820 static CYTHON_INLINE PyObject *__Pyx_PyUnicode_DecodeUTF16LE(
const char *
s, Py_ssize_t size,
const char *errors) {
1822 return PyUnicode_DecodeUTF16(
s, size, errors, &byteorder);
1824 static CYTHON_INLINE PyObject *__Pyx_PyUnicode_DecodeUTF16BE(
const char *
s, Py_ssize_t size,
const char *errors) {
1826 return PyUnicode_DecodeUTF16(
s, size, errors, &byteorder);
1830 static CYTHON_INLINE PyObject* __Pyx_decode_c_string(
1831 const char* cstring, Py_ssize_t start, Py_ssize_t stop,
1832 const char* encoding,
const char* errors,
1833 PyObject* (*decode_func)(
const char *
s, Py_ssize_t size,
const char *errors));
1836 static CYTHON_INLINE PyObject *__Pyx_GetAttr3(PyObject *, PyObject *, PyObject *);
1839 static CYTHON_INLINE
void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected);
1842 static CYTHON_INLINE
void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index);
1845 static CYTHON_INLINE
void __Pyx_RaiseNoneNotIterableError(
void);
1848 #if CYTHON_FAST_THREAD_STATE
1849 #define __Pyx_ExceptionSwap(type, value, tb) __Pyx__ExceptionSwap(__pyx_tstate, type, value, tb)
1850 static CYTHON_INLINE
void __Pyx__ExceptionSwap(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb);
1852 static CYTHON_INLINE
void __Pyx_ExceptionSwap(PyObject **type, PyObject **value, PyObject **tb);
1856 static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list,
int level);
1859 #if CYTHON_COMPILING_IN_CPYTHON
1860 #define __Pyx_TypeCheck(obj, type) __Pyx_IsSubtype(Py_TYPE(obj), (PyTypeObject *)type)
1861 static CYTHON_INLINE
int __Pyx_IsSubtype(PyTypeObject *a, PyTypeObject *b);
1862 static CYTHON_INLINE
int __Pyx_PyErr_GivenExceptionMatches(PyObject *err, PyObject *type);
1863 static CYTHON_INLINE
int __Pyx_PyErr_GivenExceptionMatches2(PyObject *err, PyObject *type1, PyObject *type2);
1865 #define __Pyx_TypeCheck(obj, type) PyObject_TypeCheck(obj, (PyTypeObject *)type)
1866 #define __Pyx_PyErr_GivenExceptionMatches(err, type) PyErr_GivenExceptionMatches(err, type)
1867 #define __Pyx_PyErr_GivenExceptionMatches2(err, type1, type2) (PyErr_GivenExceptionMatches(err, type1) || PyErr_GivenExceptionMatches(err, type2))
1869 #define __Pyx_PyException_Check(obj) __Pyx_TypeCheck(obj, PyExc_Exception)
1871 static CYTHON_UNUSED
int __pyx_memoryview_getbuffer(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info,
int __pyx_v_flags);
1873 #if CYTHON_USE_PYLIST_INTERNALS && CYTHON_ASSUME_SAFE_MACROS
1874 static CYTHON_INLINE
int __Pyx_ListComp_Append(PyObject* list, PyObject* x) {
1875 PyListObject*
L = (PyListObject*) list;
1876 Py_ssize_t len = Py_SIZE(list);
1877 if (likely(
L->allocated > len)) {
1879 PyList_SET_ITEM(list, len, x);
1880 __Pyx_SET_SIZE(list, len + 1);
1883 return PyList_Append(list, x);
1886 #define __Pyx_ListComp_Append(L,x) PyList_Append(L,x)
1890 #if !CYTHON_COMPILING_IN_PYPY
1891 static PyObject* __Pyx_PyInt_AddObjC(PyObject *op1, PyObject *op2,
long intval,
int inplace,
int zerodivision_check);
1893 #define __Pyx_PyInt_AddObjC(op1, op2, intval, inplace, zerodivision_check)\
1894 (inplace ? PyNumber_InPlaceAdd(op1, op2) : PyNumber_Add(op1, op2))
1898 static CYTHON_INLINE
int __Pyx_PyList_Extend(PyObject*
L, PyObject*
v) {
1899 #if CYTHON_COMPILING_IN_CPYTHON
1900 PyObject* none = _PyList_Extend((PyListObject*)
L,
v);
1901 if (unlikely(!none))
1906 return PyList_SetSlice(
L, PY_SSIZE_T_MAX, PY_SSIZE_T_MAX,
v);
1911 #if CYTHON_USE_PYLIST_INTERNALS && CYTHON_ASSUME_SAFE_MACROS
1912 static CYTHON_INLINE
int __Pyx_PyList_Append(PyObject* list, PyObject* x) {
1913 PyListObject*
L = (PyListObject*) list;
1914 Py_ssize_t len = Py_SIZE(list);
1915 if (likely(
L->allocated > len) & likely(len > (
L->allocated >> 1))) {
1917 PyList_SET_ITEM(list, len, x);
1918 __Pyx_SET_SIZE(list, len + 1);
1921 return PyList_Append(list, x);
1924 #define __Pyx_PyList_Append(L,x) PyList_Append(L,x)
1928 static CYTHON_INLINE
void __Pyx_RaiseUnboundLocalError(
const char *varname);
1931 static CYTHON_INLINE
long __Pyx_div_long(
long,
long);
1934 static CYTHON_INLINE
int __Pyx_PySequence_ContainsTF(PyObject* item, PyObject* seq,
int eq) {
1935 int result = PySequence_Contains(seq, item);
1936 return unlikely(result < 0) ? result : (result == (eq == Py_EQ));
1940 static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name);
1943 static CYTHON_INLINE
int __Pyx_HasAttr(PyObject *, PyObject *);
1946 #if PY_MAJOR_VERSION < 3
1947 #define __Pyx_PyString_Join __Pyx_PyBytes_Join
1948 #define __Pyx_PyBaseString_Join(s, v) (PyUnicode_CheckExact(s) ? PyUnicode_Join(s, v) : __Pyx_PyBytes_Join(s, v))
1950 #define __Pyx_PyString_Join PyUnicode_Join
1951 #define __Pyx_PyBaseString_Join PyUnicode_Join
1953 #if CYTHON_COMPILING_IN_CPYTHON
1954 #if PY_MAJOR_VERSION < 3
1955 #define __Pyx_PyBytes_Join _PyString_Join
1957 #define __Pyx_PyBytes_Join _PyBytes_Join
1960 static CYTHON_INLINE PyObject* __Pyx_PyBytes_Join(PyObject* sep, PyObject* values);
1964 #if PY_MAJOR_VERSION >= 3
1965 #define __Pyx_PyObject_Unicode(obj)\
1966 (likely(PyUnicode_CheckExact(obj)) ? __Pyx_NewRef(obj) : PyObject_Str(obj))
1968 #define __Pyx_PyObject_Unicode(obj)\
1969 (likely(PyUnicode_CheckExact(obj)) ? __Pyx_NewRef(obj) : PyObject_Unicode(obj))
1973 #if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000
1974 static CYTHON_INLINE PyObject* __Pyx_PyObject_GenericGetAttrNoDict(PyObject* obj, PyObject* attr_name);
1976 #define __Pyx_PyObject_GenericGetAttrNoDict PyObject_GenericGetAttr
1980 #if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000
1981 static PyObject* __Pyx_PyObject_GenericGetAttr(PyObject* obj, PyObject* attr_name);
1983 #define __Pyx_PyObject_GenericGetAttr PyObject_GenericGetAttr
1987 static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStrNoError(PyObject* obj, PyObject* attr_name);
1990 static int __Pyx_setup_reduce(PyObject* type_obj);
1993 static int __Pyx_SetVtable(PyObject *dict,
void *vtable);
1996 #ifndef __PYX_HAVE_RT_ImportType_proto
1997 #define __PYX_HAVE_RT_ImportType_proto
1998 enum __Pyx_ImportType_CheckSize {
1999 __Pyx_ImportType_CheckSize_Error = 0,
2000 __Pyx_ImportType_CheckSize_Warn = 1,
2001 __Pyx_ImportType_CheckSize_Ignore = 2
2003 static PyTypeObject *__Pyx_ImportType(PyObject* module,
const char *module_name,
const char *class_name,
size_t size,
enum __Pyx_ImportType_CheckSize check_size);
2007 #ifdef CYTHON_CLINE_IN_TRACEBACK
2008 #define __Pyx_CLineForTraceback(tstate, c_line) (((CYTHON_CLINE_IN_TRACEBACK)) ? c_line : 0)
2010 static int __Pyx_CLineForTraceback(PyThreadState *tstate,
int c_line);
2015 PyCodeObject* code_object;
2017 } __Pyx_CodeObjectCacheEntry;
2018 struct __Pyx_CodeObjectCache {
2021 __Pyx_CodeObjectCacheEntry* entries;
2023 static struct __Pyx_CodeObjectCache __pyx_code_cache = {0,0,NULL};
2024 static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries,
int count,
int code_line);
2025 static PyCodeObject *__pyx_find_code_object(
int code_line);
2026 static void __pyx_insert_code_object(
int code_line, PyCodeObject* code_object);
2029 static void __Pyx_AddTraceback(
const char *funcname,
int c_line,
2030 int py_line,
const char *filename);
2036 #if defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 6))
2037 #define __Pyx_HAS_GCC_DIAGNOSTIC
2041 static CYTHON_INLINE PyObject *__pyx_memview_get_double(
const char *itemp);
2042 static CYTHON_INLINE
int __pyx_memview_set_double(
const char *itemp, PyObject *obj);
2047 #define __Pyx_CREAL(z) ((z).real())
2048 #define __Pyx_CIMAG(z) ((z).imag())
2050 #define __Pyx_CREAL(z) (__real__(z))
2051 #define __Pyx_CIMAG(z) (__imag__(z))
2054 #define __Pyx_CREAL(z) ((z).real)
2055 #define __Pyx_CIMAG(z) ((z).imag)
2057 #if defined(__cplusplus) && CYTHON_CCOMPLEX\
2058 && (defined(_WIN32) || defined(__clang__) || (defined(__GNUC__) && (__GNUC__ >= 5 || __GNUC__ == 4 && __GNUC_MINOR__ >= 4 )) || __cplusplus >= 201103)
2059 #define __Pyx_SET_CREAL(z,x) ((z).real(x))
2060 #define __Pyx_SET_CIMAG(z,y) ((z).imag(y))
2062 #define __Pyx_SET_CREAL(z,x) __Pyx_CREAL(z) = (x)
2063 #define __Pyx_SET_CIMAG(z,y) __Pyx_CIMAG(z) = (y)
2068 #define __Pyx_c_eq_float(a, b) ((a)==(b))
2069 #define __Pyx_c_sum_float(a, b) ((a)+(b))
2070 #define __Pyx_c_diff_float(a, b) ((a)-(b))
2071 #define __Pyx_c_prod_float(a, b) ((a)*(b))
2072 #define __Pyx_c_quot_float(a, b) ((a)/(b))
2073 #define __Pyx_c_neg_float(a) (-(a))
2075 #define __Pyx_c_is_zero_float(z) ((z)==(float)0)
2076 #define __Pyx_c_conj_float(z) (::std::conj(z))
2078 #define __Pyx_c_abs_float(z) (::std::abs(z))
2079 #define __Pyx_c_pow_float(a, b) (::std::pow(a, b))
2082 #define __Pyx_c_is_zero_float(z) ((z)==0)
2083 #define __Pyx_c_conj_float(z) (conjf(z))
2085 #define __Pyx_c_abs_float(z) (cabsf(z))
2086 #define __Pyx_c_pow_float(a, b) (cpowf(a, b))
2090 static CYTHON_INLINE
int __Pyx_c_eq_float(__pyx_t_float_complex, __pyx_t_float_complex);
2091 static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_sum_float(__pyx_t_float_complex, __pyx_t_float_complex);
2092 static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_diff_float(__pyx_t_float_complex, __pyx_t_float_complex);
2093 static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_prod_float(__pyx_t_float_complex, __pyx_t_float_complex);
2094 static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_quot_float(__pyx_t_float_complex, __pyx_t_float_complex);
2095 static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_neg_float(__pyx_t_float_complex);
2096 static CYTHON_INLINE
int __Pyx_c_is_zero_float(__pyx_t_float_complex);
2097 static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_conj_float(__pyx_t_float_complex);
2099 static CYTHON_INLINE
float __Pyx_c_abs_float(__pyx_t_float_complex);
2100 static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_pow_float(__pyx_t_float_complex, __pyx_t_float_complex);
2106 #define __Pyx_c_eq_double(a, b) ((a)==(b))
2107 #define __Pyx_c_sum_double(a, b) ((a)+(b))
2108 #define __Pyx_c_diff_double(a, b) ((a)-(b))
2109 #define __Pyx_c_prod_double(a, b) ((a)*(b))
2110 #define __Pyx_c_quot_double(a, b) ((a)/(b))
2111 #define __Pyx_c_neg_double(a) (-(a))
2113 #define __Pyx_c_is_zero_double(z) ((z)==(double)0)
2114 #define __Pyx_c_conj_double(z) (::std::conj(z))
2116 #define __Pyx_c_abs_double(z) (::std::abs(z))
2117 #define __Pyx_c_pow_double(a, b) (::std::pow(a, b))
2120 #define __Pyx_c_is_zero_double(z) ((z)==0)
2121 #define __Pyx_c_conj_double(z) (conj(z))
2123 #define __Pyx_c_abs_double(z) (cabs(z))
2124 #define __Pyx_c_pow_double(a, b) (cpow(a, b))
2128 static CYTHON_INLINE
int __Pyx_c_eq_double(__pyx_t_double_complex, __pyx_t_double_complex);
2129 static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_sum_double(__pyx_t_double_complex, __pyx_t_double_complex);
2130 static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_diff_double(__pyx_t_double_complex, __pyx_t_double_complex);
2131 static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_prod_double(__pyx_t_double_complex, __pyx_t_double_complex);
2132 static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_quot_double(__pyx_t_double_complex, __pyx_t_double_complex);
2133 static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_neg_double(__pyx_t_double_complex);
2134 static CYTHON_INLINE
int __Pyx_c_is_zero_double(__pyx_t_double_complex);
2135 static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_conj_double(__pyx_t_double_complex);
2137 static CYTHON_INLINE
double __Pyx_c_abs_double(__pyx_t_double_complex);
2138 static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_pow_double(__pyx_t_double_complex, __pyx_t_double_complex);
2142 #if PY_MAJOR_VERSION < 3
2143 static int __Pyx_GetBuffer(PyObject *obj, Py_buffer *view,
int flags);
2144 static void __Pyx_ReleaseBuffer(Py_buffer *view);
2146 #define __Pyx_GetBuffer PyObject_GetBuffer
2147 #define __Pyx_ReleaseBuffer PyBuffer_Release
2153 Py_ssize_t shape, strides, suboffsets;
2154 } __Pyx_Buf_DimInfo;
2160 __Pyx_Buffer *rcbuffer;
2162 __Pyx_Buf_DimInfo diminfo[8];
2163 } __Pyx_LocalBuf_ND;
2166 static int __pyx_memviewslice_is_contig(
const __Pyx_memviewslice mvs,
char order,
int ndim);
2169 static int __pyx_slices_overlap(__Pyx_memviewslice *slice1,
2170 __Pyx_memviewslice *slice2,
2171 int ndim,
size_t itemsize);
2174 static CYTHON_INLINE PyObject *__pyx_capsule_create(
void *p,
const char *sig);
2177 static CYTHON_INLINE
int __Pyx_PyInt_As_int(PyObject *);
2180 static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(
int value);
2183 struct __pyx_typeinfo_string {
2186 static struct __pyx_typeinfo_string __Pyx_TypeInfoToFormat(__Pyx_TypeInfo *type);
2189 static __Pyx_memviewslice
2190 __pyx_memoryview_copy_new_contig(
const __Pyx_memviewslice *from_mvs,
2191 const char *mode,
int ndim,
2192 size_t sizeof_dtype,
int contig_flag,
2193 int dtype_is_object);
2196 #define __Pyx_BUF_MAX_NDIMS %(BUF_MAX_NDIMS)d
2197 #define __Pyx_MEMVIEW_DIRECT 1
2198 #define __Pyx_MEMVIEW_PTR 2
2199 #define __Pyx_MEMVIEW_FULL 4
2200 #define __Pyx_MEMVIEW_CONTIG 8
2201 #define __Pyx_MEMVIEW_STRIDED 16
2202 #define __Pyx_MEMVIEW_FOLLOW 32
2203 #define __Pyx_IS_C_CONTIG 1
2204 #define __Pyx_IS_F_CONTIG 2
2205 static int __Pyx_init_memviewslice(
2206 struct __pyx_memoryview_obj *memview,
2208 __Pyx_memviewslice *memviewslice,
2209 int memview_is_new_reference);
2210 static CYTHON_INLINE
int __pyx_add_acquisition_count_locked(
2211 __pyx_atomic_int *acquisition_count, PyThread_type_lock lock);
2212 static CYTHON_INLINE
int __pyx_sub_acquisition_count_locked(
2213 __pyx_atomic_int *acquisition_count, PyThread_type_lock lock);
2214 #define __pyx_get_slice_count_pointer(memview) (memview->acquisition_count_aligned_p)
2215 #define __pyx_get_slice_count(memview) (*__pyx_get_slice_count_pointer(memview))
2216 #define __PYX_INC_MEMVIEW(slice, have_gil) __Pyx_INC_MEMVIEW(slice, have_gil, __LINE__)
2217 #define __PYX_XDEC_MEMVIEW(slice, have_gil) __Pyx_XDEC_MEMVIEW(slice, have_gil, __LINE__)
2218 static CYTHON_INLINE
void __Pyx_INC_MEMVIEW(__Pyx_memviewslice *,
int,
int);
2219 static CYTHON_INLINE
void __Pyx_XDEC_MEMVIEW(__Pyx_memviewslice *,
int,
int);
2222 static CYTHON_INLINE
long __Pyx_PyInt_As_long(PyObject *);
2225 static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(
long value);
2228 static CYTHON_INLINE
char __Pyx_PyInt_As_char(PyObject *);
2231 static int __Pyx_check_binary_version(
void);
2234 static int __Pyx_InitStrings(__Pyx_StringTabEntry *t);
2236 static PyObject *__pyx_array_get_memview(
struct __pyx_array_obj *__pyx_v_self);
2237 static char *__pyx_memoryview_get_item_pointer(
struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index);
2238 static PyObject *__pyx_memoryview_is_slice(
struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_obj);
2239 static PyObject *__pyx_memoryview_setitem_slice_assignment(
struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_dst, PyObject *__pyx_v_src);
2240 static PyObject *__pyx_memoryview_setitem_slice_assign_scalar(
struct __pyx_memoryview_obj *__pyx_v_self,
struct __pyx_memoryview_obj *__pyx_v_dst, PyObject *__pyx_v_value);
2241 static PyObject *__pyx_memoryview_setitem_indexed(
struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index, PyObject *__pyx_v_value);
2242 static PyObject *__pyx_memoryview_convert_item_to_object(
struct __pyx_memoryview_obj *__pyx_v_self,
char *__pyx_v_itemp);
2243 static PyObject *__pyx_memoryview_assign_item_from_object(
struct __pyx_memoryview_obj *__pyx_v_self,
char *__pyx_v_itemp, PyObject *__pyx_v_value);
2244 static PyObject *__pyx_memoryviewslice_convert_item_to_object(
struct __pyx_memoryviewslice_obj *__pyx_v_self,
char *__pyx_v_itemp);
2245 static PyObject *__pyx_memoryviewslice_assign_item_from_object(
struct __pyx_memoryviewslice_obj *__pyx_v_self,
char *__pyx_v_itemp, PyObject *__pyx_v_value);
2258 static PyTypeObject *__pyx_ptype_7cpython_4type_type = 0;
2271 static PyTypeObject *__pyx_ptype_5numpy_dtype = 0;
2272 static PyTypeObject *__pyx_ptype_5numpy_flatiter = 0;
2273 static PyTypeObject *__pyx_ptype_5numpy_broadcast = 0;
2274 static PyTypeObject *__pyx_ptype_5numpy_ndarray = 0;
2275 static PyTypeObject *__pyx_ptype_5numpy_generic = 0;
2276 static PyTypeObject *__pyx_ptype_5numpy_number = 0;
2277 static PyTypeObject *__pyx_ptype_5numpy_integer = 0;
2278 static PyTypeObject *__pyx_ptype_5numpy_signedinteger = 0;
2279 static PyTypeObject *__pyx_ptype_5numpy_unsignedinteger = 0;
2280 static PyTypeObject *__pyx_ptype_5numpy_inexact = 0;
2281 static PyTypeObject *__pyx_ptype_5numpy_floating = 0;
2282 static PyTypeObject *__pyx_ptype_5numpy_complexfloating = 0;
2283 static PyTypeObject *__pyx_ptype_5numpy_flexible = 0;
2284 static PyTypeObject *__pyx_ptype_5numpy_character = 0;
2285 static PyTypeObject *__pyx_ptype_5numpy_ufunc = 0;
2288 static PyTypeObject *__pyx_ptype_22equivalent_polynomials_Simplex = 0;
2289 static PyTypeObject *__pyx_array_type = 0;
2290 static PyTypeObject *__pyx_MemviewEnum_type = 0;
2291 static PyTypeObject *__pyx_memoryview_type = 0;
2292 static PyTypeObject *__pyx_memoryviewslice_type = 0;
2293 static PyObject *
generic = 0;
2294 static PyObject *strided = 0;
2295 static PyObject *indirect = 0;
2296 static PyObject *contiguous = 0;
2297 static PyObject *indirect_contiguous = 0;
2298 static int __pyx_memoryview_thread_locks_used;
2299 static PyThread_type_lock __pyx_memoryview_thread_locks[8];
2300 static struct __pyx_array_obj *__pyx_array_new(PyObject *, Py_ssize_t,
char *,
char *,
char *);
2301 static void *__pyx_align_pointer(
void *,
size_t);
2302 static PyObject *__pyx_memoryview_new(PyObject *,
int,
int, __Pyx_TypeInfo *);
2303 static CYTHON_INLINE
int __pyx_memoryview_check(PyObject *);
2304 static PyObject *_unellipsify(PyObject *,
int);
2305 static PyObject *assert_direct_dimensions(Py_ssize_t *,
int);
2306 static struct __pyx_memoryview_obj *__pyx_memview_slice(
struct __pyx_memoryview_obj *, PyObject *);
2307 static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *, Py_ssize_t, Py_ssize_t, Py_ssize_t,
int,
int,
int *, Py_ssize_t, Py_ssize_t, Py_ssize_t,
int,
int,
int,
int);
2308 static char *__pyx_pybuffer_index(Py_buffer *,
char *, Py_ssize_t, Py_ssize_t);
2309 static int __pyx_memslice_transpose(__Pyx_memviewslice *);
2310 static PyObject *__pyx_memoryview_fromslice(__Pyx_memviewslice,
int, PyObject *(*)(
char *),
int (*)(
char *, PyObject *),
int);
2311 static __Pyx_memviewslice *__pyx_memoryview_get_slice_from_memoryview(
struct __pyx_memoryview_obj *, __Pyx_memviewslice *);
2312 static void __pyx_memoryview_slice_copy(
struct __pyx_memoryview_obj *, __Pyx_memviewslice *);
2313 static PyObject *__pyx_memoryview_copy_object(
struct __pyx_memoryview_obj *);
2314 static PyObject *__pyx_memoryview_copy_object_from_slice(
struct __pyx_memoryview_obj *, __Pyx_memviewslice *);
2315 static Py_ssize_t abs_py_ssize_t(Py_ssize_t);
2316 static char __pyx_get_best_slice_order(__Pyx_memviewslice *,
int);
2317 static void _copy_strided_to_strided(
char *, Py_ssize_t *,
char *, Py_ssize_t *, Py_ssize_t *, Py_ssize_t *,
int,
size_t);
2318 static void copy_strided_to_strided(__Pyx_memviewslice *, __Pyx_memviewslice *,
int,
size_t);
2319 static Py_ssize_t __pyx_memoryview_slice_get_size(__Pyx_memviewslice *,
int);
2320 static Py_ssize_t __pyx_fill_contig_strides_array(Py_ssize_t *, Py_ssize_t *, Py_ssize_t,
int,
char);
2321 static void *__pyx_memoryview_copy_data_to_temp(__Pyx_memviewslice *, __Pyx_memviewslice *,
char,
int);
2322 static int __pyx_memoryview_err_extents(
int, Py_ssize_t, Py_ssize_t);
2323 static int __pyx_memoryview_err_dim(PyObject *,
char *,
int);
2324 static int __pyx_memoryview_err(PyObject *,
char *);
2325 static int __pyx_memoryview_copy_contents(__Pyx_memviewslice, __Pyx_memviewslice,
int,
int,
int);
2326 static void __pyx_memoryview_broadcast_leading(__Pyx_memviewslice *,
int,
int);
2327 static void __pyx_memoryview_refcount_copying(__Pyx_memviewslice *,
int,
int,
int);
2328 static void __pyx_memoryview_refcount_objects_in_slice_with_gil(
char *, Py_ssize_t *, Py_ssize_t *,
int,
int);
2329 static void __pyx_memoryview_refcount_objects_in_slice(
char *, Py_ssize_t *, Py_ssize_t *,
int,
int);
2330 static void __pyx_memoryview_slice_assign_scalar(__Pyx_memviewslice *,
int,
size_t,
void *,
int);
2331 static void __pyx_memoryview__slice_assign_scalar(
char *, Py_ssize_t *, Py_ssize_t *,
int,
size_t,
void *);
2332 static PyObject *__pyx_unpickle_Enum__set_state(
struct __pyx_MemviewEnum_obj *, PyObject *);
2333 static PyObject *__pyx_format_from_typeinfo(__Pyx_TypeInfo *);
2334 static __Pyx_TypeInfo __Pyx_TypeInfo_double = {
"double", NULL,
sizeof(double), { 0 }, 0,
'R', 0, 0 };
2335 #define __Pyx_MODULE_NAME "equivalent_polynomials"
2336 extern int __pyx_module_is_main_equivalent_polynomials;
2337 int __pyx_module_is_main_equivalent_polynomials = 0;
2340 static PyObject *__pyx_builtin_TypeError;
2341 static PyObject *__pyx_builtin_ImportError;
2342 static PyObject *__pyx_builtin_ValueError;
2343 static PyObject *__pyx_builtin_MemoryError;
2344 static PyObject *__pyx_builtin_enumerate;
2345 static PyObject *__pyx_builtin_range;
2346 static PyObject *__pyx_builtin_Ellipsis;
2347 static PyObject *__pyx_builtin_id;
2348 static PyObject *__pyx_builtin_IndexError;
2349 static const char __pyx_k_O[] =
"O";
2350 static const char __pyx_k_T[] =
"T{";
2351 static const char __pyx_k_c[] =
"c";
2352 static const char __pyx_k_d[] =
"d";
2353 static const char __pyx_k_s[] =
"(%s)";
2354 static const char __pyx_k_id[] =
"id";
2355 static const char __pyx_k_nP[] =
"nP";
2356 static const char __pyx_k_nQ[] =
"nQ";
2357 static const char __pyx_k_np[] =
"np";
2358 static const char __pyx_k_xi[] =
"xi";
2359 static const char __pyx_k__35[] =
"^";
2360 static const char __pyx_k__36[] =
"";
2361 static const char __pyx_k__37[] =
":";
2362 static const char __pyx_k__38[] =
"}";
2363 static const char __pyx_k__39[] =
",";
2364 static const char __pyx_k_new[] =
"__new__";
2365 static const char __pyx_k_obj[] =
"obj";
2366 static const char __pyx_k_base[] =
"base";
2367 static const char __pyx_k_dict[] =
"__dict__";
2368 static const char __pyx_k_join[] =
"join";
2369 static const char __pyx_k_main[] =
"__main__";
2370 static const char __pyx_k_mode[] =
"mode";
2371 static const char __pyx_k_name[] =
"name";
2372 static const char __pyx_k_ndim[] =
"ndim";
2373 static const char __pyx_k_pack[] =
"pack";
2374 static const char __pyx_k_size[] =
"size";
2375 static const char __pyx_k_step[] =
"step";
2376 static const char __pyx_k_stop[] =
"stop";
2377 static const char __pyx_k_test[] =
"__test__";
2378 static const char __pyx_k_ASCII[] =
"ASCII";
2379 static const char __pyx_k_class[] =
"__class__";
2380 static const char __pyx_k_error[] =
"error";
2381 static const char __pyx_k_flags[] =
"flags";
2382 static const char __pyx_k_numpy[] =
"numpy";
2383 static const char __pyx_k_range[] =
"range";
2384 static const char __pyx_k_shape[] =
"shape";
2385 static const char __pyx_k_start[] =
"start";
2386 static const char __pyx_k_zeros[] =
"zeros";
2387 static const char __pyx_k_encode[] =
"encode";
2388 static const char __pyx_k_format[] =
"format";
2389 static const char __pyx_k_import[] =
"__import__";
2390 static const char __pyx_k_nSpace[] =
"nSpace";
2391 static const char __pyx_k_name_2[] =
"__name__";
2392 static const char __pyx_k_pickle[] =
"pickle";
2393 static const char __pyx_k_reduce[] =
"__reduce__";
2394 static const char __pyx_k_struct[] =
"struct";
2395 static const char __pyx_k_unpack[] =
"unpack";
2396 static const char __pyx_k_update[] =
"update";
2397 static const char __pyx_k_Simplex[] =
"Simplex";
2398 static const char __pyx_k_asarray[] =
"asarray";
2399 static const char __pyx_k_fortran[] =
"fortran";
2400 static const char __pyx_k_memview[] =
"memview";
2401 static const char __pyx_k_phi_dof[] =
"phi_dof";
2402 static const char __pyx_k_Ellipsis[] =
"Ellipsis";
2403 static const char __pyx_k_getstate[] =
"__getstate__";
2404 static const char __pyx_k_itemsize[] =
"itemsize";
2405 static const char __pyx_k_pyx_type[] =
"__pyx_type";
2406 static const char __pyx_k_setstate[] =
"__setstate__";
2407 static const char __pyx_k_TypeError[] =
"TypeError";
2408 static const char __pyx_k_enumerate[] =
"enumerate";
2409 static const char __pyx_k_phi_nodes[] =
"phi_nodes";
2410 static const char __pyx_k_pyx_state[] =
"__pyx_state";
2411 static const char __pyx_k_reduce_ex[] =
"__reduce_ex__";
2412 static const char __pyx_k_IndexError[] =
"IndexError";
2413 static const char __pyx_k_ValueError[] =
"ValueError";
2414 static const char __pyx_k_pyx_result[] =
"__pyx_result";
2415 static const char __pyx_k_pyx_vtable[] =
"__pyx_vtable__";
2416 static const char __pyx_k_ImportError[] =
"ImportError";
2417 static const char __pyx_k_MemoryError[] =
"MemoryError";
2418 static const char __pyx_k_PickleError[] =
"PickleError";
2419 static const char __pyx_k_pyx_checksum[] =
"__pyx_checksum";
2420 static const char __pyx_k_stringsource[] =
"stringsource";
2421 static const char __pyx_k_pyx_getbuffer[] =
"__pyx_getbuffer";
2422 static const char __pyx_k_reduce_cython[] =
"__reduce_cython__";
2423 static const char __pyx_k_View_MemoryView[] =
"View.MemoryView";
2424 static const char __pyx_k_allocate_buffer[] =
"allocate_buffer";
2425 static const char __pyx_k_dtype_is_object[] =
"dtype_is_object";
2426 static const char __pyx_k_pyx_PickleError[] =
"__pyx_PickleError";
2427 static const char __pyx_k_setstate_cython[] =
"__setstate_cython__";
2428 static const char __pyx_k_pyx_unpickle_Enum[] =
"__pyx_unpickle_Enum";
2429 static const char __pyx_k_cline_in_traceback[] =
"cline_in_traceback";
2430 static const char __pyx_k_strided_and_direct[] =
"<strided and direct>";
2431 static const char __pyx_k_strided_and_indirect[] =
"<strided and indirect>";
2432 static const char __pyx_k_contiguous_and_direct[] =
"<contiguous and direct>";
2433 static const char __pyx_k_MemoryView_of_r_object[] =
"<MemoryView of %r object>";
2434 static const char __pyx_k_MemoryView_of_r_at_0x_x[] =
"<MemoryView of %r at 0x%x>";
2435 static const char __pyx_k_contiguous_and_indirect[] =
"<contiguous and indirect>";
2436 static const char __pyx_k_Cannot_index_with_type_s[] =
"Cannot index with type '%s'";
2437 static const char __pyx_k_Invalid_shape_in_axis_d_d[] =
"Invalid shape in axis %d: %d.";
2438 static const char __pyx_k_itemsize_0_for_cython_array[] =
"itemsize <= 0 for cython.array";
2439 static const char __pyx_k_unable_to_allocate_array_data[] =
"unable to allocate array data.";
2440 static const char __pyx_k_strided_and_direct_or_indirect[] =
"<strided and direct or indirect>";
2441 static const char __pyx_k_numpy_core_multiarray_failed_to[] =
"numpy.core.multiarray failed to import";
2442 static const char __pyx_k_Buffer_view_does_not_expose_stri[] =
"Buffer view does not expose strides";
2443 static const char __pyx_k_Can_only_create_a_buffer_that_is[] =
"Can only create a buffer that is contiguous in memory.";
2444 static const char __pyx_k_Cannot_assign_to_read_only_memor[] =
"Cannot assign to read-only memoryview";
2445 static const char __pyx_k_Cannot_create_writable_memory_vi[] =
"Cannot create writable memory view from read-only memoryview";
2446 static const char __pyx_k_Empty_shape_tuple_for_cython_arr[] =
"Empty shape tuple for cython.array";
2447 static const char __pyx_k_Incompatible_checksums_0x_x_vs_0[] =
"Incompatible checksums (0x%x vs (0xb068931, 0x82a3537, 0x6ae9995) = (name))";
2448 static const char __pyx_k_Indirect_dimensions_not_supporte[] =
"Indirect dimensions not supported";
2449 static const char __pyx_k_Invalid_mode_expected_c_or_fortr[] =
"Invalid mode, expected 'c' or 'fortran', got %s";
2450 static const char __pyx_k_Out_of_bounds_on_buffer_access_a[] =
"Out of bounds on buffer access (axis %d)";
2451 static const char __pyx_k_Unable_to_convert_item_to_object[] =
"Unable to convert item to object";
2452 static const char __pyx_k_got_differing_extents_in_dimensi[] =
"got differing extents in dimension %d (got %d and %d)";
2453 static const char __pyx_k_no_default___reduce___due_to_non[] =
"no default __reduce__ due to non-trivial __cinit__";
2454 static const char __pyx_k_numpy_core_umath_failed_to_impor[] =
"numpy.core.umath failed to import";
2455 static const char __pyx_k_unable_to_allocate_shape_and_str[] =
"unable to allocate shape and strides.";
2456 static PyObject *__pyx_n_s_ASCII;
2457 static PyObject *__pyx_kp_s_Buffer_view_does_not_expose_stri;
2458 static PyObject *__pyx_kp_s_Can_only_create_a_buffer_that_is;
2459 static PyObject *__pyx_kp_s_Cannot_assign_to_read_only_memor;
2460 static PyObject *__pyx_kp_s_Cannot_create_writable_memory_vi;
2461 static PyObject *__pyx_kp_s_Cannot_index_with_type_s;
2462 static PyObject *__pyx_n_s_Ellipsis;
2463 static PyObject *__pyx_kp_s_Empty_shape_tuple_for_cython_arr;
2464 static PyObject *__pyx_n_s_ImportError;
2465 static PyObject *__pyx_kp_s_Incompatible_checksums_0x_x_vs_0;
2466 static PyObject *__pyx_n_s_IndexError;
2467 static PyObject *__pyx_kp_s_Indirect_dimensions_not_supporte;
2468 static PyObject *__pyx_kp_s_Invalid_mode_expected_c_or_fortr;
2469 static PyObject *__pyx_kp_s_Invalid_shape_in_axis_d_d;
2470 static PyObject *__pyx_n_s_MemoryError;
2471 static PyObject *__pyx_kp_s_MemoryView_of_r_at_0x_x;
2472 static PyObject *__pyx_kp_s_MemoryView_of_r_object;
2473 static PyObject *__pyx_n_b_O;
2474 static PyObject *__pyx_kp_s_Out_of_bounds_on_buffer_access_a;
2475 static PyObject *__pyx_n_s_PickleError;
2476 static PyObject *__pyx_n_s_Simplex;
2477 static PyObject *__pyx_kp_b_T;
2478 static PyObject *__pyx_n_s_TypeError;
2479 static PyObject *__pyx_kp_s_Unable_to_convert_item_to_object;
2480 static PyObject *__pyx_n_s_ValueError;
2481 static PyObject *__pyx_n_s_View_MemoryView;
2482 static PyObject *__pyx_kp_b__35;
2483 static PyObject *__pyx_kp_b__36;
2484 static PyObject *__pyx_kp_b__37;
2485 static PyObject *__pyx_kp_b__38;
2486 static PyObject *__pyx_kp_u__39;
2487 static PyObject *__pyx_n_s_allocate_buffer;
2488 static PyObject *__pyx_n_s_asarray;
2489 static PyObject *__pyx_n_s_base;
2490 static PyObject *__pyx_n_s_c;
2491 static PyObject *__pyx_n_u_c;
2492 static PyObject *__pyx_n_s_class;
2493 static PyObject *__pyx_n_s_cline_in_traceback;
2494 static PyObject *__pyx_kp_s_contiguous_and_direct;
2495 static PyObject *__pyx_kp_s_contiguous_and_indirect;
2496 static PyObject *__pyx_n_s_d;
2497 static PyObject *__pyx_n_s_dict;
2498 static PyObject *__pyx_n_s_dtype_is_object;
2499 static PyObject *__pyx_n_s_encode;
2500 static PyObject *__pyx_n_s_enumerate;
2501 static PyObject *__pyx_n_s_error;
2502 static PyObject *__pyx_n_s_flags;
2503 static PyObject *__pyx_n_s_format;
2504 static PyObject *__pyx_n_s_fortran;
2505 static PyObject *__pyx_n_u_fortran;
2506 static PyObject *__pyx_n_s_getstate;
2507 static PyObject *__pyx_kp_s_got_differing_extents_in_dimensi;
2508 static PyObject *__pyx_n_s_id;
2509 static PyObject *__pyx_n_s_import;
2510 static PyObject *__pyx_n_s_itemsize;
2511 static PyObject *__pyx_kp_s_itemsize_0_for_cython_array;
2512 static PyObject *__pyx_n_s_join;
2513 static PyObject *__pyx_n_s_main;
2514 static PyObject *__pyx_n_s_memview;
2515 static PyObject *__pyx_n_s_mode;
2516 static PyObject *__pyx_n_s_nP;
2517 static PyObject *__pyx_n_s_nQ;
2518 static PyObject *__pyx_n_s_nSpace;
2519 static PyObject *__pyx_n_s_name;
2520 static PyObject *__pyx_n_s_name_2;
2521 static PyObject *__pyx_n_s_ndim;
2522 static PyObject *__pyx_n_s_new;
2523 static PyObject *__pyx_kp_s_no_default___reduce___due_to_non;
2524 static PyObject *__pyx_n_s_np;
2525 static PyObject *__pyx_n_s_numpy;
2526 static PyObject *__pyx_kp_s_numpy_core_multiarray_failed_to;
2527 static PyObject *__pyx_kp_s_numpy_core_umath_failed_to_impor;
2528 static PyObject *__pyx_n_s_obj;
2529 static PyObject *__pyx_n_s_pack;
2530 static PyObject *__pyx_n_s_phi_dof;
2531 static PyObject *__pyx_n_s_phi_nodes;
2532 static PyObject *__pyx_n_s_pickle;
2533 static PyObject *__pyx_n_s_pyx_PickleError;
2534 static PyObject *__pyx_n_s_pyx_checksum;
2535 static PyObject *__pyx_n_s_pyx_getbuffer;
2536 static PyObject *__pyx_n_s_pyx_result;
2537 static PyObject *__pyx_n_s_pyx_state;
2538 static PyObject *__pyx_n_s_pyx_type;
2539 static PyObject *__pyx_n_s_pyx_unpickle_Enum;
2540 static PyObject *__pyx_n_s_pyx_vtable;
2541 static PyObject *__pyx_n_s_range;
2542 static PyObject *__pyx_n_s_reduce;
2543 static PyObject *__pyx_n_s_reduce_cython;
2544 static PyObject *__pyx_n_s_reduce_ex;
2545 static PyObject *__pyx_kp_u_s;
2546 static PyObject *__pyx_n_s_setstate;
2547 static PyObject *__pyx_n_s_setstate_cython;
2548 static PyObject *__pyx_n_s_shape;
2549 static PyObject *__pyx_n_s_size;
2550 static PyObject *__pyx_n_s_start;
2551 static PyObject *__pyx_n_s_step;
2552 static PyObject *__pyx_n_s_stop;
2553 static PyObject *__pyx_kp_s_strided_and_direct;
2554 static PyObject *__pyx_kp_s_strided_and_direct_or_indirect;
2555 static PyObject *__pyx_kp_s_strided_and_indirect;
2556 static PyObject *__pyx_kp_s_stringsource;
2557 static PyObject *__pyx_n_s_struct;
2558 static PyObject *__pyx_n_s_test;
2559 static PyObject *__pyx_kp_s_unable_to_allocate_array_data;
2560 static PyObject *__pyx_kp_s_unable_to_allocate_shape_and_str;
2561 static PyObject *__pyx_n_s_unpack;
2562 static PyObject *__pyx_n_s_update;
2563 static PyObject *__pyx_n_s_xi;
2564 static PyObject *__pyx_n_s_zeros;
2565 static int __pyx_pf_22equivalent_polynomials_7Simplex___cinit__(
struct __pyx_obj_22equivalent_polynomials_Simplex *__pyx_v_self, PyObject *__pyx_v_nSpace, PyObject *__pyx_v_nP, PyObject *__pyx_v_nQ);
2566 static PyObject *__pyx_pf_22equivalent_polynomials_7Simplex_2calculate(
struct __pyx_obj_22equivalent_polynomials_Simplex *__pyx_v_self, PyArrayObject *__pyx_v_phi_dof, PyArrayObject *__pyx_v_phi_nodes, PyArrayObject *__pyx_v_xi);
2567 static PyObject *__pyx_pf_22equivalent_polynomials_7Simplex_4set_quad(
struct __pyx_obj_22equivalent_polynomials_Simplex *__pyx_v_self,
int __pyx_v_q);
2568 static PyObject *__pyx_pf_22equivalent_polynomials_7Simplex_1H___get__(
struct __pyx_obj_22equivalent_polynomials_Simplex *__pyx_v_self);
2569 static PyObject *__pyx_pf_22equivalent_polynomials_7Simplex_3ImH___get__(
struct __pyx_obj_22equivalent_polynomials_Simplex *__pyx_v_self);
2570 static PyObject *__pyx_pf_22equivalent_polynomials_7Simplex_1D___get__(
struct __pyx_obj_22equivalent_polynomials_Simplex *__pyx_v_self);
2571 static PyObject *__pyx_pf_22equivalent_polynomials_7Simplex_6__reduce_cython__(CYTHON_UNUSED
struct __pyx_obj_22equivalent_polynomials_Simplex *__pyx_v_self);
2572 static PyObject *__pyx_pf_22equivalent_polynomials_7Simplex_8__setstate_cython__(CYTHON_UNUSED
struct __pyx_obj_22equivalent_polynomials_Simplex *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state);
2573 static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array___cinit__(
struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_shape, Py_ssize_t __pyx_v_itemsize, PyObject *__pyx_v_format, PyObject *__pyx_v_mode,
int __pyx_v_allocate_buffer);
2574 static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array_2__getbuffer__(
struct __pyx_array_obj *__pyx_v_self, Py_buffer *__pyx_v_info,
int __pyx_v_flags);
2575 static void __pyx_array___pyx_pf_15View_dot_MemoryView_5array_4__dealloc__(
struct __pyx_array_obj *__pyx_v_self);
2576 static PyObject *__pyx_pf_15View_dot_MemoryView_5array_7memview___get__(
struct __pyx_array_obj *__pyx_v_self);
2577 static Py_ssize_t __pyx_array___pyx_pf_15View_dot_MemoryView_5array_6__len__(
struct __pyx_array_obj *__pyx_v_self);
2578 static PyObject *__pyx_array___pyx_pf_15View_dot_MemoryView_5array_8__getattr__(
struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_attr);
2579 static PyObject *__pyx_array___pyx_pf_15View_dot_MemoryView_5array_10__getitem__(
struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_item);
2580 static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array_12__setitem__(
struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_item, PyObject *__pyx_v_value);
2581 static PyObject *__pyx_pf___pyx_array___reduce_cython__(CYTHON_UNUSED
struct __pyx_array_obj *__pyx_v_self);
2582 static PyObject *__pyx_pf___pyx_array_2__setstate_cython__(CYTHON_UNUSED
struct __pyx_array_obj *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state);
2583 static int __pyx_MemviewEnum___pyx_pf_15View_dot_MemoryView_4Enum___init__(
struct __pyx_MemviewEnum_obj *__pyx_v_self, PyObject *__pyx_v_name);
2584 static PyObject *__pyx_MemviewEnum___pyx_pf_15View_dot_MemoryView_4Enum_2__repr__(
struct __pyx_MemviewEnum_obj *__pyx_v_self);
2585 static PyObject *__pyx_pf___pyx_MemviewEnum___reduce_cython__(
struct __pyx_MemviewEnum_obj *__pyx_v_self);
2586 static PyObject *__pyx_pf___pyx_MemviewEnum_2__setstate_cython__(
struct __pyx_MemviewEnum_obj *__pyx_v_self, PyObject *__pyx_v___pyx_state);
2587 static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview___cinit__(
struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_obj,
int __pyx_v_flags,
int __pyx_v_dtype_is_object);
2588 static void __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_2__dealloc__(
struct __pyx_memoryview_obj *__pyx_v_self);
2589 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_4__getitem__(
struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index);
2590 static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_6__setitem__(
struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index, PyObject *__pyx_v_value);
2591 static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_8__getbuffer__(
struct __pyx_memoryview_obj *__pyx_v_self, Py_buffer *__pyx_v_info,
int __pyx_v_flags);
2592 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_1T___get__(
struct __pyx_memoryview_obj *__pyx_v_self);
2593 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_4base___get__(
struct __pyx_memoryview_obj *__pyx_v_self);
2594 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_5shape___get__(
struct __pyx_memoryview_obj *__pyx_v_self);
2595 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_7strides___get__(
struct __pyx_memoryview_obj *__pyx_v_self);
2596 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_10suboffsets___get__(
struct __pyx_memoryview_obj *__pyx_v_self);
2597 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_4ndim___get__(
struct __pyx_memoryview_obj *__pyx_v_self);
2598 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_8itemsize___get__(
struct __pyx_memoryview_obj *__pyx_v_self);
2599 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_6nbytes___get__(
struct __pyx_memoryview_obj *__pyx_v_self);
2600 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_4size___get__(
struct __pyx_memoryview_obj *__pyx_v_self);
2601 static Py_ssize_t __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_10__len__(
struct __pyx_memoryview_obj *__pyx_v_self);
2602 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_12__repr__(
struct __pyx_memoryview_obj *__pyx_v_self);
2603 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_14__str__(
struct __pyx_memoryview_obj *__pyx_v_self);
2604 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_16is_c_contig(
struct __pyx_memoryview_obj *__pyx_v_self);
2605 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_18is_f_contig(
struct __pyx_memoryview_obj *__pyx_v_self);
2606 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_20copy(
struct __pyx_memoryview_obj *__pyx_v_self);
2607 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_22copy_fortran(
struct __pyx_memoryview_obj *__pyx_v_self);
2608 static PyObject *__pyx_pf___pyx_memoryview___reduce_cython__(CYTHON_UNUSED
struct __pyx_memoryview_obj *__pyx_v_self);
2609 static PyObject *__pyx_pf___pyx_memoryview_2__setstate_cython__(CYTHON_UNUSED
struct __pyx_memoryview_obj *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state);
2610 static void __pyx_memoryviewslice___pyx_pf_15View_dot_MemoryView_16_memoryviewslice___dealloc__(
struct __pyx_memoryviewslice_obj *__pyx_v_self);
2611 static PyObject *__pyx_pf_15View_dot_MemoryView_16_memoryviewslice_4base___get__(
struct __pyx_memoryviewslice_obj *__pyx_v_self);
2612 static PyObject *__pyx_pf___pyx_memoryviewslice___reduce_cython__(CYTHON_UNUSED
struct __pyx_memoryviewslice_obj *__pyx_v_self);
2613 static PyObject *__pyx_pf___pyx_memoryviewslice_2__setstate_cython__(CYTHON_UNUSED
struct __pyx_memoryviewslice_obj *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state);
2614 static PyObject *__pyx_pf_15View_dot_MemoryView___pyx_unpickle_Enum(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v___pyx_type,
long __pyx_v___pyx_checksum, PyObject *__pyx_v___pyx_state);
2615 static PyObject *__pyx_tp_new_22equivalent_polynomials_Simplex(PyTypeObject *t, PyObject *a, PyObject *k);
2616 static PyObject *__pyx_tp_new_array(PyTypeObject *t, PyObject *a, PyObject *k);
2617 static PyObject *__pyx_tp_new_Enum(PyTypeObject *t, PyObject *a, PyObject *k);
2618 static PyObject *__pyx_tp_new_memoryview(PyTypeObject *t, PyObject *a, PyObject *k);
2619 static PyObject *__pyx_tp_new__memoryviewslice(PyTypeObject *t, PyObject *a, PyObject *k);
2620 static PyObject *__pyx_int_0;
2621 static PyObject *__pyx_int_1;
2622 static PyObject *__pyx_int_2;
2623 static PyObject *__pyx_int_3;
2624 static PyObject *__pyx_int_50;
2625 static PyObject *__pyx_int_112105877;
2626 static PyObject *__pyx_int_136983863;
2627 static PyObject *__pyx_int_184977713;
2628 static PyObject *__pyx_int_neg_1;
2629 static PyObject *__pyx_tuple_;
2630 static PyObject *__pyx_tuple__2;
2631 static PyObject *__pyx_tuple__3;
2632 static PyObject *__pyx_tuple__4;
2633 static PyObject *__pyx_tuple__5;
2634 static PyObject *__pyx_tuple__6;
2635 static PyObject *__pyx_tuple__7;
2636 static PyObject *__pyx_tuple__8;
2637 static PyObject *__pyx_tuple__9;
2638 static PyObject *__pyx_slice__30;
2639 static PyObject *__pyx_tuple__10;
2640 static PyObject *__pyx_tuple__11;
2641 static PyObject *__pyx_tuple__12;
2642 static PyObject *__pyx_tuple__13;
2643 static PyObject *__pyx_tuple__14;
2644 static PyObject *__pyx_tuple__15;
2645 static PyObject *__pyx_tuple__16;
2646 static PyObject *__pyx_tuple__17;
2647 static PyObject *__pyx_tuple__18;
2648 static PyObject *__pyx_tuple__19;
2649 static PyObject *__pyx_tuple__20;
2650 static PyObject *__pyx_tuple__21;
2651 static PyObject *__pyx_tuple__22;
2652 static PyObject *__pyx_tuple__23;
2653 static PyObject *__pyx_tuple__24;
2654 static PyObject *__pyx_tuple__25;
2655 static PyObject *__pyx_tuple__26;
2656 static PyObject *__pyx_tuple__27;
2657 static PyObject *__pyx_tuple__28;
2658 static PyObject *__pyx_tuple__29;
2659 static PyObject *__pyx_tuple__31;
2660 static PyObject *__pyx_tuple__32;
2661 static PyObject *__pyx_tuple__33;
2662 static PyObject *__pyx_tuple__34;
2663 static PyObject *__pyx_tuple__40;
2664 static PyObject *__pyx_tuple__41;
2665 static PyObject *__pyx_tuple__42;
2666 static PyObject *__pyx_tuple__43;
2667 static PyObject *__pyx_tuple__44;
2668 static PyObject *__pyx_tuple__45;
2669 static PyObject *__pyx_codeobj__46;
2681 static int __pyx_pw_22equivalent_polynomials_7Simplex_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
2682 static int __pyx_pw_22equivalent_polynomials_7Simplex_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
2683 PyObject *__pyx_v_nSpace = 0;
2684 PyObject *__pyx_v_nP = 0;
2685 PyObject *__pyx_v_nQ = 0;
2686 int __pyx_lineno = 0;
2687 const char *__pyx_filename = NULL;
2688 int __pyx_clineno = 0;
2690 __Pyx_RefNannyDeclarations
2691 __Pyx_RefNannySetupContext(
"__cinit__ (wrapper)", 0);
2693 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_nSpace,&__pyx_n_s_nP,&__pyx_n_s_nQ,0};
2694 PyObject* values[3] = {0,0,0};
2695 if (unlikely(__pyx_kwds)) {
2697 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
2699 case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
2701 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
2703 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
2706 default:
goto __pyx_L5_argtuple_error;
2708 kw_args = PyDict_Size(__pyx_kwds);
2711 if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_nSpace)) != 0)) kw_args--;
2712 else goto __pyx_L5_argtuple_error;
2715 if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_nP)) != 0)) kw_args--;
2717 __Pyx_RaiseArgtupleInvalid(
"__cinit__", 1, 3, 3, 1); __PYX_ERR(1, 43, __pyx_L3_error)
2721 if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_nQ)) != 0)) kw_args--;
2723 __Pyx_RaiseArgtupleInvalid(
"__cinit__", 1, 3, 3, 2); __PYX_ERR(1, 43, __pyx_L3_error)
2726 if (unlikely(kw_args > 0)) {
2727 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args,
"__cinit__") < 0)) __PYX_ERR(1, 43, __pyx_L3_error)
2729 }
else if (PyTuple_GET_SIZE(__pyx_args) != 3) {
2730 goto __pyx_L5_argtuple_error;
2732 values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
2733 values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
2734 values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
2736 __pyx_v_nSpace = values[0];
2737 __pyx_v_nP = values[1];
2738 __pyx_v_nQ = values[2];
2740 goto __pyx_L4_argument_unpacking_done;
2741 __pyx_L5_argtuple_error:;
2742 __Pyx_RaiseArgtupleInvalid(
"__cinit__", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(1, 43, __pyx_L3_error)
2744 __Pyx_AddTraceback(
"equivalent_polynomials.Simplex.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
2745 __Pyx_RefNannyFinishContext();
2747 __pyx_L4_argument_unpacking_done:;
2748 __pyx_r = __pyx_pf_22equivalent_polynomials_7Simplex___cinit__(((
struct __pyx_obj_22equivalent_polynomials_Simplex *)__pyx_v_self), __pyx_v_nSpace, __pyx_v_nP, __pyx_v_nQ);
2751 __Pyx_RefNannyFinishContext();
2755 static int __pyx_pf_22equivalent_polynomials_7Simplex___cinit__(
struct __pyx_obj_22equivalent_polynomials_Simplex *__pyx_v_self, PyObject *__pyx_v_nSpace, PyObject *__pyx_v_nP, PyObject *__pyx_v_nQ) {
2757 __Pyx_RefNannyDeclarations
2758 PyObject *__pyx_t_1 = NULL;
2759 PyObject *__pyx_t_2 = NULL;
2761 int __pyx_lineno = 0;
2762 const char *__pyx_filename = NULL;
2763 int __pyx_clineno = 0;
2764 __Pyx_RefNannySetupContext(
"__cinit__", 0);
2773 __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_np);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 44, __pyx_L1_error)
2774 __Pyx_GOTREF(__pyx_t_1);
2775 __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_zeros);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 44, __pyx_L1_error)
2776 __Pyx_GOTREF(__pyx_t_2);
2777 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
2778 __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_tuple__2, NULL);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 44, __pyx_L1_error)
2779 __Pyx_GOTREF(__pyx_t_1);
2780 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
2781 if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(1, 44, __pyx_L1_error)
2782 __Pyx_GIVEREF(__pyx_t_1);
2783 __Pyx_GOTREF(__pyx_v_self->xiBuffer);
2784 __Pyx_DECREF(((PyObject *)__pyx_v_self->xiBuffer));
2785 __pyx_v_self->xiBuffer = ((PyArrayObject *)__pyx_t_1);
2795 __pyx_t_3 = __Pyx_PyInt_As_int(__pyx_v_nSpace);
if (unlikely((__pyx_t_3 == (
int)-1) && PyErr_Occurred())) __PYX_ERR(1, 45, __pyx_L1_error)
2796 __pyx_v_self->nSpace = __pyx_t_3;
2805 __pyx_t_3 = __Pyx_PyInt_As_int(__pyx_v_nP);
if (unlikely((__pyx_t_3 == (
int)-1) && PyErr_Occurred())) __PYX_ERR(1, 46, __pyx_L1_error)
2806 __pyx_v_self->nP = __pyx_t_3;
2815 __pyx_t_3 = __Pyx_PyInt_As_int(__pyx_v_nQ);
if (unlikely((__pyx_t_3 == (
int)-1) && PyErr_Occurred())) __PYX_ERR(1, 47, __pyx_L1_error)
2816 __pyx_v_self->nQ = __pyx_t_3;
2825 __pyx_t_3 = __Pyx_PyInt_As_int(__pyx_v_nQ);
if (unlikely((__pyx_t_3 == (
int)-1) && PyErr_Occurred())) __PYX_ERR(1, 48, __pyx_L1_error)
2826 __pyx_v_self->nEBQ = __pyx_t_3;
2835 __pyx_v_self->q = 0;
2849 __Pyx_XDECREF(__pyx_t_1);
2850 __Pyx_XDECREF(__pyx_t_2);
2851 __Pyx_AddTraceback(
"equivalent_polynomials.Simplex.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
2854 __Pyx_RefNannyFinishContext();
2867 static PyObject *__pyx_pw_22equivalent_polynomials_7Simplex_3calculate(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
2868 static PyObject *__pyx_pw_22equivalent_polynomials_7Simplex_3calculate(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
2869 PyArrayObject *__pyx_v_phi_dof = 0;
2870 PyArrayObject *__pyx_v_phi_nodes = 0;
2871 PyArrayObject *__pyx_v_xi = 0;
2872 int __pyx_lineno = 0;
2873 const char *__pyx_filename = NULL;
2874 int __pyx_clineno = 0;
2875 PyObject *__pyx_r = 0;
2876 __Pyx_RefNannyDeclarations
2877 __Pyx_RefNannySetupContext(
"calculate (wrapper)", 0);
2879 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_phi_dof,&__pyx_n_s_phi_nodes,&__pyx_n_s_xi,0};
2880 PyObject* values[3] = {0,0,0};
2881 if (unlikely(__pyx_kwds)) {
2883 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
2885 case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
2887 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
2889 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
2892 default:
goto __pyx_L5_argtuple_error;
2894 kw_args = PyDict_Size(__pyx_kwds);
2897 if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_phi_dof)) != 0)) kw_args--;
2898 else goto __pyx_L5_argtuple_error;
2901 if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_phi_nodes)) != 0)) kw_args--;
2903 __Pyx_RaiseArgtupleInvalid(
"calculate", 1, 3, 3, 1); __PYX_ERR(1, 50, __pyx_L3_error)
2907 if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_xi)) != 0)) kw_args--;
2909 __Pyx_RaiseArgtupleInvalid(
"calculate", 1, 3, 3, 2); __PYX_ERR(1, 50, __pyx_L3_error)
2912 if (unlikely(kw_args > 0)) {
2913 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args,
"calculate") < 0)) __PYX_ERR(1, 50, __pyx_L3_error)
2915 }
else if (PyTuple_GET_SIZE(__pyx_args) != 3) {
2916 goto __pyx_L5_argtuple_error;
2918 values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
2919 values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
2920 values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
2922 __pyx_v_phi_dof = ((PyArrayObject *)values[0]);
2923 __pyx_v_phi_nodes = ((PyArrayObject *)values[1]);
2924 __pyx_v_xi = ((PyArrayObject *)values[2]);
2926 goto __pyx_L4_argument_unpacking_done;
2927 __pyx_L5_argtuple_error:;
2928 __Pyx_RaiseArgtupleInvalid(
"calculate", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(1, 50, __pyx_L3_error)
2930 __Pyx_AddTraceback(
"equivalent_polynomials.Simplex.calculate", __pyx_clineno, __pyx_lineno, __pyx_filename);
2931 __Pyx_RefNannyFinishContext();
2933 __pyx_L4_argument_unpacking_done:;
2934 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_phi_dof), __pyx_ptype_5numpy_ndarray, 1,
"phi_dof", 0))) __PYX_ERR(1, 50, __pyx_L1_error)
2935 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_phi_nodes), __pyx_ptype_5numpy_ndarray, 1,
"phi_nodes", 0))) __PYX_ERR(1, 50, __pyx_L1_error)
2936 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_xi), __pyx_ptype_5numpy_ndarray, 1,
"xi", 0))) __PYX_ERR(1, 50, __pyx_L1_error)
2937 __pyx_r = __pyx_pf_22equivalent_polynomials_7Simplex_2calculate(((
struct __pyx_obj_22equivalent_polynomials_Simplex *)__pyx_v_self), __pyx_v_phi_dof, __pyx_v_phi_nodes, __pyx_v_xi);
2944 __Pyx_RefNannyFinishContext();
2948 static PyObject *__pyx_pf_22equivalent_polynomials_7Simplex_2calculate(
struct __pyx_obj_22equivalent_polynomials_Simplex *__pyx_v_self, PyArrayObject *__pyx_v_phi_dof, PyArrayObject *__pyx_v_phi_nodes, PyArrayObject *__pyx_v_xi) {
2949 CYTHON_UNUSED
int __pyx_v_icase;
2950 PyObject *__pyx_r = NULL;
2951 __Pyx_RefNannyDeclarations
2952 PyObject *__pyx_t_1 = NULL;
2953 PyObject *__pyx_t_2 = NULL;
2954 PyObject *__pyx_t_3 = NULL;
2957 struct __pyx_array_obj *__pyx_t_6 = NULL;
2958 PyObject *__pyx_t_7 = NULL;
2960 int __pyx_lineno = 0;
2961 const char *__pyx_filename = NULL;
2962 int __pyx_clineno = 0;
2963 __Pyx_RefNannySetupContext(
"calculate", 0);
2972 if (__Pyx_PyObject_SetSlice(((PyObject *)__pyx_v_self->xiBuffer), ((PyObject *)__pyx_v_xi), 0, (__pyx_v_xi->dimensions[0]), NULL, NULL, NULL, 0, 1, 1) < 0) __PYX_ERR(1, 51, __pyx_L1_error)
2981 __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->nSpace);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 52, __pyx_L1_error)
2982 __Pyx_GOTREF(__pyx_t_1);
2983 __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_self->nP);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 52, __pyx_L1_error)
2984 __Pyx_GOTREF(__pyx_t_2);
2985 __pyx_t_3 = PyTuple_New(2);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 52, __pyx_L1_error)
2986 __Pyx_GOTREF(__pyx_t_3);
2987 __Pyx_GIVEREF(__pyx_t_1);
2988 PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1);
2989 __Pyx_GIVEREF(__pyx_t_2);
2990 PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_2);
2993 __pyx_t_2 = PyObject_RichCompare(__pyx_t_3, __pyx_tuple__3, Py_EQ); __Pyx_XGOTREF(__pyx_t_2);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 52, __pyx_L1_error)
2994 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
2995 __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_2);
if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(1, 52, __pyx_L1_error)
2996 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
3006 __pyx_v_icase = __pyx_v_self->s11.calculate(((
double *)__pyx_v_phi_dof->data), ((
double *)__pyx_v_phi_nodes->data), ((
double *)__pyx_v_self->xiBuffer->data), 0);
3015 __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_np);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 54, __pyx_L1_error)
3016 __Pyx_GOTREF(__pyx_t_3);
3017 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_asarray);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 54, __pyx_L1_error)
3018 __Pyx_GOTREF(__pyx_t_1);
3019 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
3020 __pyx_t_5 = __pyx_v_self->s11.get_H();
3022 PyErr_SetString(PyExc_ValueError,
"Cannot create cython.array from NULL pointer");
3023 __PYX_ERR(1, 54, __pyx_L1_error)
3025 __pyx_t_7 = __pyx_format_from_typeinfo(&__Pyx_TypeInfo_double);
if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 54, __pyx_L1_error)
3026 __Pyx_GOTREF(__pyx_t_7);
3027 __pyx_t_3 = Py_BuildValue((
char*)
"(" __PYX_BUILD_PY_SSIZE_T
")", ((Py_ssize_t)__pyx_v_self->nQ));
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 54, __pyx_L1_error)
3028 __Pyx_GOTREF(__pyx_t_3);
3029 __pyx_t_6 = __pyx_array_new(__pyx_t_3,
sizeof(
double), PyBytes_AS_STRING(__pyx_t_7), (
char *)
"c", (
char *) __pyx_t_5);
3030 if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 54, __pyx_L1_error)
3031 __Pyx_GOTREF(__pyx_t_6);
3032 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
3033 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
3035 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_1))) {
3036 __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_1);
3037 if (likely(__pyx_t_7)) {
3038 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_1);
3039 __Pyx_INCREF(__pyx_t_7);
3040 __Pyx_INCREF(
function);
3041 __Pyx_DECREF_SET(__pyx_t_1,
function);
3044 __pyx_t_2 = (__pyx_t_7) ? __Pyx_PyObject_Call2Args(__pyx_t_1, __pyx_t_7, ((PyObject *)__pyx_t_6)) : __Pyx_PyObject_CallOneArg(__pyx_t_1, ((PyObject *)__pyx_t_6));
3045 __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
3046 __Pyx_DECREF(((PyObject *)__pyx_t_6)); __pyx_t_6 = 0;
3047 if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 54, __pyx_L1_error)
3048 __Pyx_GOTREF(__pyx_t_2);
3049 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
3050 if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(1, 54, __pyx_L1_error)
3051 __Pyx_GIVEREF(__pyx_t_2);
3052 __Pyx_GOTREF(__pyx_v_self->_H);
3053 __Pyx_DECREF(((PyObject *)__pyx_v_self->_H));
3054 __pyx_v_self->_H = ((PyArrayObject *)__pyx_t_2);
3064 __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_np);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 55, __pyx_L1_error)
3065 __Pyx_GOTREF(__pyx_t_1);
3066 __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_asarray);
if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 55, __pyx_L1_error)
3067 __Pyx_GOTREF(__pyx_t_7);
3068 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
3069 __pyx_t_5 = __pyx_v_self->s11.get_ImH();
3071 PyErr_SetString(PyExc_ValueError,
"Cannot create cython.array from NULL pointer");
3072 __PYX_ERR(1, 55, __pyx_L1_error)
3074 __pyx_t_3 = __pyx_format_from_typeinfo(&__Pyx_TypeInfo_double);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 55, __pyx_L1_error)
3075 __Pyx_GOTREF(__pyx_t_3);
3076 __pyx_t_1 = Py_BuildValue((
char*)
"(" __PYX_BUILD_PY_SSIZE_T
")", ((Py_ssize_t)__pyx_v_self->nQ));
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 55, __pyx_L1_error)
3077 __Pyx_GOTREF(__pyx_t_1);
3078 __pyx_t_6 = __pyx_array_new(__pyx_t_1,
sizeof(
double), PyBytes_AS_STRING(__pyx_t_3), (
char *)
"c", (
char *) __pyx_t_5);
3079 if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 55, __pyx_L1_error)
3080 __Pyx_GOTREF(__pyx_t_6);
3081 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
3082 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
3084 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_7))) {
3085 __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_7);
3086 if (likely(__pyx_t_3)) {
3087 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_7);
3088 __Pyx_INCREF(__pyx_t_3);
3089 __Pyx_INCREF(
function);
3090 __Pyx_DECREF_SET(__pyx_t_7,
function);
3093 __pyx_t_2 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_7, __pyx_t_3, ((PyObject *)__pyx_t_6)) : __Pyx_PyObject_CallOneArg(__pyx_t_7, ((PyObject *)__pyx_t_6));
3094 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
3095 __Pyx_DECREF(((PyObject *)__pyx_t_6)); __pyx_t_6 = 0;
3096 if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 55, __pyx_L1_error)
3097 __Pyx_GOTREF(__pyx_t_2);
3098 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
3099 if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(1, 55, __pyx_L1_error)
3100 __Pyx_GIVEREF(__pyx_t_2);
3101 __Pyx_GOTREF(__pyx_v_self->_ImH);
3102 __Pyx_DECREF(((PyObject *)__pyx_v_self->_ImH));
3103 __pyx_v_self->_ImH = ((PyArrayObject *)__pyx_t_2);
3113 __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_np);
if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 56, __pyx_L1_error)
3114 __Pyx_GOTREF(__pyx_t_7);
3115 __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_asarray);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 56, __pyx_L1_error)
3116 __Pyx_GOTREF(__pyx_t_3);
3117 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
3118 __pyx_t_5 = __pyx_v_self->s11.get_D();
3120 PyErr_SetString(PyExc_ValueError,
"Cannot create cython.array from NULL pointer");
3121 __PYX_ERR(1, 56, __pyx_L1_error)
3123 __pyx_t_1 = __pyx_format_from_typeinfo(&__Pyx_TypeInfo_double);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 56, __pyx_L1_error)
3124 __Pyx_GOTREF(__pyx_t_1);
3125 __pyx_t_7 = Py_BuildValue((
char*)
"(" __PYX_BUILD_PY_SSIZE_T
")", ((Py_ssize_t)__pyx_v_self->nQ));
if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 56, __pyx_L1_error)
3126 __Pyx_GOTREF(__pyx_t_7);
3127 __pyx_t_6 = __pyx_array_new(__pyx_t_7,
sizeof(
double), PyBytes_AS_STRING(__pyx_t_1), (
char *)
"c", (
char *) __pyx_t_5);
3128 if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 56, __pyx_L1_error)
3129 __Pyx_GOTREF(__pyx_t_6);
3130 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
3131 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
3133 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
3134 __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_3);
3135 if (likely(__pyx_t_1)) {
3136 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_3);
3137 __Pyx_INCREF(__pyx_t_1);
3138 __Pyx_INCREF(
function);
3139 __Pyx_DECREF_SET(__pyx_t_3,
function);
3142 __pyx_t_2 = (__pyx_t_1) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_1, ((PyObject *)__pyx_t_6)) : __Pyx_PyObject_CallOneArg(__pyx_t_3, ((PyObject *)__pyx_t_6));
3143 __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
3144 __Pyx_DECREF(((PyObject *)__pyx_t_6)); __pyx_t_6 = 0;
3145 if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 56, __pyx_L1_error)
3146 __Pyx_GOTREF(__pyx_t_2);
3147 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
3148 if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(1, 56, __pyx_L1_error)
3149 __Pyx_GIVEREF(__pyx_t_2);
3150 __Pyx_GOTREF(__pyx_v_self->_D);
3151 __Pyx_DECREF(((PyObject *)__pyx_v_self->_D));
3152 __pyx_v_self->_D = ((PyArrayObject *)__pyx_t_2);
3162 __pyx_t_8 = __pyx_v_self->s11.inside_out;
3163 __pyx_v_self->inside_out = __pyx_t_8;
3182 __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_self->nSpace);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 58, __pyx_L1_error)
3183 __Pyx_GOTREF(__pyx_t_2);
3184 __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_self->nP);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 58, __pyx_L1_error)
3185 __Pyx_GOTREF(__pyx_t_3);
3186 __pyx_t_1 = PyTuple_New(2);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 58, __pyx_L1_error)
3187 __Pyx_GOTREF(__pyx_t_1);
3188 __Pyx_GIVEREF(__pyx_t_2);
3189 PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_2);
3190 __Pyx_GIVEREF(__pyx_t_3);
3191 PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_3);
3194 __pyx_t_3 = PyObject_RichCompare(__pyx_t_1, __pyx_tuple__4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 58, __pyx_L1_error)
3195 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
3196 __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_3);
if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(1, 58, __pyx_L1_error)
3197 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
3207 __pyx_v_icase = __pyx_v_self->s12.calculate(((
double *)__pyx_v_phi_dof->data), ((
double *)__pyx_v_phi_nodes->data), ((
double *)__pyx_v_self->xiBuffer->data), 0);
3216 __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_np);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 60, __pyx_L1_error)
3217 __Pyx_GOTREF(__pyx_t_1);
3218 __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_asarray);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 60, __pyx_L1_error)
3219 __Pyx_GOTREF(__pyx_t_2);
3220 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
3221 __pyx_t_5 = __pyx_v_self->s12.get_H();
3223 PyErr_SetString(PyExc_ValueError,
"Cannot create cython.array from NULL pointer");
3224 __PYX_ERR(1, 60, __pyx_L1_error)
3226 __pyx_t_7 = __pyx_format_from_typeinfo(&__Pyx_TypeInfo_double);
if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 60, __pyx_L1_error)
3227 __Pyx_GOTREF(__pyx_t_7);
3228 __pyx_t_1 = Py_BuildValue((
char*)
"(" __PYX_BUILD_PY_SSIZE_T
")", ((Py_ssize_t)__pyx_v_self->nQ));
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 60, __pyx_L1_error)
3229 __Pyx_GOTREF(__pyx_t_1);
3230 __pyx_t_6 = __pyx_array_new(__pyx_t_1,
sizeof(
double), PyBytes_AS_STRING(__pyx_t_7), (
char *)
"c", (
char *) __pyx_t_5);
3231 if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 60, __pyx_L1_error)
3232 __Pyx_GOTREF(__pyx_t_6);
3233 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
3234 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
3236 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
3237 __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_2);
3238 if (likely(__pyx_t_7)) {
3239 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_2);
3240 __Pyx_INCREF(__pyx_t_7);
3241 __Pyx_INCREF(
function);
3242 __Pyx_DECREF_SET(__pyx_t_2,
function);
3245 __pyx_t_3 = (__pyx_t_7) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_7, ((PyObject *)__pyx_t_6)) : __Pyx_PyObject_CallOneArg(__pyx_t_2, ((PyObject *)__pyx_t_6));
3246 __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
3247 __Pyx_DECREF(((PyObject *)__pyx_t_6)); __pyx_t_6 = 0;
3248 if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 60, __pyx_L1_error)
3249 __Pyx_GOTREF(__pyx_t_3);
3250 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
3251 if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(1, 60, __pyx_L1_error)
3252 __Pyx_GIVEREF(__pyx_t_3);
3253 __Pyx_GOTREF(__pyx_v_self->_H);
3254 __Pyx_DECREF(((PyObject *)__pyx_v_self->_H));
3255 __pyx_v_self->_H = ((PyArrayObject *)__pyx_t_3);
3265 __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_np);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 61, __pyx_L1_error)
3266 __Pyx_GOTREF(__pyx_t_2);
3267 __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_asarray);
if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 61, __pyx_L1_error)
3268 __Pyx_GOTREF(__pyx_t_7);
3269 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
3270 __pyx_t_5 = __pyx_v_self->s12.get_ImH();
3272 PyErr_SetString(PyExc_ValueError,
"Cannot create cython.array from NULL pointer");
3273 __PYX_ERR(1, 61, __pyx_L1_error)
3275 __pyx_t_1 = __pyx_format_from_typeinfo(&__Pyx_TypeInfo_double);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 61, __pyx_L1_error)
3276 __Pyx_GOTREF(__pyx_t_1);
3277 __pyx_t_2 = Py_BuildValue((
char*)
"(" __PYX_BUILD_PY_SSIZE_T
")", ((Py_ssize_t)__pyx_v_self->nQ));
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 61, __pyx_L1_error)
3278 __Pyx_GOTREF(__pyx_t_2);
3279 __pyx_t_6 = __pyx_array_new(__pyx_t_2,
sizeof(
double), PyBytes_AS_STRING(__pyx_t_1), (
char *)
"c", (
char *) __pyx_t_5);
3280 if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 61, __pyx_L1_error)
3281 __Pyx_GOTREF(__pyx_t_6);
3282 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
3283 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
3285 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_7))) {
3286 __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_7);
3287 if (likely(__pyx_t_1)) {
3288 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_7);
3289 __Pyx_INCREF(__pyx_t_1);
3290 __Pyx_INCREF(
function);
3291 __Pyx_DECREF_SET(__pyx_t_7,
function);
3294 __pyx_t_3 = (__pyx_t_1) ? __Pyx_PyObject_Call2Args(__pyx_t_7, __pyx_t_1, ((PyObject *)__pyx_t_6)) : __Pyx_PyObject_CallOneArg(__pyx_t_7, ((PyObject *)__pyx_t_6));
3295 __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
3296 __Pyx_DECREF(((PyObject *)__pyx_t_6)); __pyx_t_6 = 0;
3297 if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 61, __pyx_L1_error)
3298 __Pyx_GOTREF(__pyx_t_3);
3299 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
3300 if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(1, 61, __pyx_L1_error)
3301 __Pyx_GIVEREF(__pyx_t_3);
3302 __Pyx_GOTREF(__pyx_v_self->_ImH);
3303 __Pyx_DECREF(((PyObject *)__pyx_v_self->_ImH));
3304 __pyx_v_self->_ImH = ((PyArrayObject *)__pyx_t_3);
3314 __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_np);
if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 62, __pyx_L1_error)
3315 __Pyx_GOTREF(__pyx_t_7);
3316 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_asarray);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 62, __pyx_L1_error)
3317 __Pyx_GOTREF(__pyx_t_1);
3318 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
3319 __pyx_t_5 = __pyx_v_self->s12.get_D();
3321 PyErr_SetString(PyExc_ValueError,
"Cannot create cython.array from NULL pointer");
3322 __PYX_ERR(1, 62, __pyx_L1_error)
3324 __pyx_t_2 = __pyx_format_from_typeinfo(&__Pyx_TypeInfo_double);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 62, __pyx_L1_error)
3325 __Pyx_GOTREF(__pyx_t_2);
3326 __pyx_t_7 = Py_BuildValue((
char*)
"(" __PYX_BUILD_PY_SSIZE_T
")", ((Py_ssize_t)__pyx_v_self->nQ));
if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 62, __pyx_L1_error)
3327 __Pyx_GOTREF(__pyx_t_7);
3328 __pyx_t_6 = __pyx_array_new(__pyx_t_7,
sizeof(
double), PyBytes_AS_STRING(__pyx_t_2), (
char *)
"c", (
char *) __pyx_t_5);
3329 if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 62, __pyx_L1_error)
3330 __Pyx_GOTREF(__pyx_t_6);
3331 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
3332 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
3334 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_1))) {
3335 __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_1);
3336 if (likely(__pyx_t_2)) {
3337 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_1);
3338 __Pyx_INCREF(__pyx_t_2);
3339 __Pyx_INCREF(
function);
3340 __Pyx_DECREF_SET(__pyx_t_1,
function);
3343 __pyx_t_3 = (__pyx_t_2) ? __Pyx_PyObject_Call2Args(__pyx_t_1, __pyx_t_2, ((PyObject *)__pyx_t_6)) : __Pyx_PyObject_CallOneArg(__pyx_t_1, ((PyObject *)__pyx_t_6));
3344 __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
3345 __Pyx_DECREF(((PyObject *)__pyx_t_6)); __pyx_t_6 = 0;
3346 if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 62, __pyx_L1_error)
3347 __Pyx_GOTREF(__pyx_t_3);
3348 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
3349 if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(1, 62, __pyx_L1_error)
3350 __Pyx_GIVEREF(__pyx_t_3);
3351 __Pyx_GOTREF(__pyx_v_self->_D);
3352 __Pyx_DECREF(((PyObject *)__pyx_v_self->_D));
3353 __pyx_v_self->_D = ((PyArrayObject *)__pyx_t_3);
3363 __pyx_t_8 = __pyx_v_self->s12.inside_out;
3364 __pyx_v_self->inside_out = __pyx_t_8;
3383 __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_self->nSpace);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 64, __pyx_L1_error)
3384 __Pyx_GOTREF(__pyx_t_3);
3385 __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->nP);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 64, __pyx_L1_error)
3386 __Pyx_GOTREF(__pyx_t_1);
3387 __pyx_t_2 = PyTuple_New(2);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 64, __pyx_L1_error)
3388 __Pyx_GOTREF(__pyx_t_2);
3389 __Pyx_GIVEREF(__pyx_t_3);
3390 PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_3);
3391 __Pyx_GIVEREF(__pyx_t_1);
3392 PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_1);
3395 __pyx_t_1 = PyObject_RichCompare(__pyx_t_2, __pyx_tuple__5, Py_EQ); __Pyx_XGOTREF(__pyx_t_1);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 64, __pyx_L1_error)
3396 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
3397 __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_1);
if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(1, 64, __pyx_L1_error)
3398 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
3408 __pyx_v_icase = __pyx_v_self->s13.calculate(((
double *)__pyx_v_phi_dof->data), ((
double *)__pyx_v_phi_nodes->data), ((
double *)__pyx_v_self->xiBuffer->data), 0);
3417 __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_np);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 66, __pyx_L1_error)
3418 __Pyx_GOTREF(__pyx_t_2);
3419 __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_asarray);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 66, __pyx_L1_error)
3420 __Pyx_GOTREF(__pyx_t_3);
3421 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
3422 __pyx_t_5 = __pyx_v_self->s13.get_H();
3424 PyErr_SetString(PyExc_ValueError,
"Cannot create cython.array from NULL pointer");
3425 __PYX_ERR(1, 66, __pyx_L1_error)
3427 __pyx_t_7 = __pyx_format_from_typeinfo(&__Pyx_TypeInfo_double);
if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 66, __pyx_L1_error)
3428 __Pyx_GOTREF(__pyx_t_7);
3429 __pyx_t_2 = Py_BuildValue((
char*)
"(" __PYX_BUILD_PY_SSIZE_T
")", ((Py_ssize_t)__pyx_v_self->nQ));
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 66, __pyx_L1_error)
3430 __Pyx_GOTREF(__pyx_t_2);
3431 __pyx_t_6 = __pyx_array_new(__pyx_t_2,
sizeof(
double), PyBytes_AS_STRING(__pyx_t_7), (
char *)
"c", (
char *) __pyx_t_5);
3432 if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 66, __pyx_L1_error)
3433 __Pyx_GOTREF(__pyx_t_6);
3434 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
3435 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
3437 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
3438 __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_3);
3439 if (likely(__pyx_t_7)) {
3440 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_3);
3441 __Pyx_INCREF(__pyx_t_7);
3442 __Pyx_INCREF(
function);
3443 __Pyx_DECREF_SET(__pyx_t_3,
function);
3446 __pyx_t_1 = (__pyx_t_7) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_7, ((PyObject *)__pyx_t_6)) : __Pyx_PyObject_CallOneArg(__pyx_t_3, ((PyObject *)__pyx_t_6));
3447 __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
3448 __Pyx_DECREF(((PyObject *)__pyx_t_6)); __pyx_t_6 = 0;
3449 if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 66, __pyx_L1_error)
3450 __Pyx_GOTREF(__pyx_t_1);
3451 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
3452 if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(1, 66, __pyx_L1_error)
3453 __Pyx_GIVEREF(__pyx_t_1);
3454 __Pyx_GOTREF(__pyx_v_self->_H);
3455 __Pyx_DECREF(((PyObject *)__pyx_v_self->_H));
3456 __pyx_v_self->_H = ((PyArrayObject *)__pyx_t_1);
3466 __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_np);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 67, __pyx_L1_error)
3467 __Pyx_GOTREF(__pyx_t_3);
3468 __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_asarray);
if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 67, __pyx_L1_error)
3469 __Pyx_GOTREF(__pyx_t_7);
3470 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
3471 __pyx_t_5 = __pyx_v_self->s13.get_ImH();
3473 PyErr_SetString(PyExc_ValueError,
"Cannot create cython.array from NULL pointer");
3474 __PYX_ERR(1, 67, __pyx_L1_error)
3476 __pyx_t_2 = __pyx_format_from_typeinfo(&__Pyx_TypeInfo_double);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 67, __pyx_L1_error)
3477 __Pyx_GOTREF(__pyx_t_2);
3478 __pyx_t_3 = Py_BuildValue((
char*)
"(" __PYX_BUILD_PY_SSIZE_T
")", ((Py_ssize_t)__pyx_v_self->nQ));
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 67, __pyx_L1_error)
3479 __Pyx_GOTREF(__pyx_t_3);
3480 __pyx_t_6 = __pyx_array_new(__pyx_t_3,
sizeof(
double), PyBytes_AS_STRING(__pyx_t_2), (
char *)
"c", (
char *) __pyx_t_5);
3481 if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 67, __pyx_L1_error)
3482 __Pyx_GOTREF(__pyx_t_6);
3483 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
3484 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
3486 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_7))) {
3487 __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_7);
3488 if (likely(__pyx_t_2)) {
3489 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_7);
3490 __Pyx_INCREF(__pyx_t_2);
3491 __Pyx_INCREF(
function);
3492 __Pyx_DECREF_SET(__pyx_t_7,
function);
3495 __pyx_t_1 = (__pyx_t_2) ? __Pyx_PyObject_Call2Args(__pyx_t_7, __pyx_t_2, ((PyObject *)__pyx_t_6)) : __Pyx_PyObject_CallOneArg(__pyx_t_7, ((PyObject *)__pyx_t_6));
3496 __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
3497 __Pyx_DECREF(((PyObject *)__pyx_t_6)); __pyx_t_6 = 0;
3498 if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 67, __pyx_L1_error)
3499 __Pyx_GOTREF(__pyx_t_1);
3500 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
3501 if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(1, 67, __pyx_L1_error)
3502 __Pyx_GIVEREF(__pyx_t_1);
3503 __Pyx_GOTREF(__pyx_v_self->_ImH);
3504 __Pyx_DECREF(((PyObject *)__pyx_v_self->_ImH));
3505 __pyx_v_self->_ImH = ((PyArrayObject *)__pyx_t_1);
3515 __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_np);
if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 68, __pyx_L1_error)
3516 __Pyx_GOTREF(__pyx_t_7);
3517 __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_asarray);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 68, __pyx_L1_error)
3518 __Pyx_GOTREF(__pyx_t_2);
3519 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
3520 __pyx_t_5 = __pyx_v_self->s13.get_D();
3522 PyErr_SetString(PyExc_ValueError,
"Cannot create cython.array from NULL pointer");
3523 __PYX_ERR(1, 68, __pyx_L1_error)
3525 __pyx_t_3 = __pyx_format_from_typeinfo(&__Pyx_TypeInfo_double);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 68, __pyx_L1_error)
3526 __Pyx_GOTREF(__pyx_t_3);
3527 __pyx_t_7 = Py_BuildValue((
char*)
"(" __PYX_BUILD_PY_SSIZE_T
")", ((Py_ssize_t)__pyx_v_self->nQ));
if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 68, __pyx_L1_error)
3528 __Pyx_GOTREF(__pyx_t_7);
3529 __pyx_t_6 = __pyx_array_new(__pyx_t_7,
sizeof(
double), PyBytes_AS_STRING(__pyx_t_3), (
char *)
"c", (
char *) __pyx_t_5);
3530 if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 68, __pyx_L1_error)
3531 __Pyx_GOTREF(__pyx_t_6);
3532 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
3533 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
3535 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
3536 __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
3537 if (likely(__pyx_t_3)) {
3538 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_2);
3539 __Pyx_INCREF(__pyx_t_3);
3540 __Pyx_INCREF(
function);
3541 __Pyx_DECREF_SET(__pyx_t_2,
function);
3544 __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_3, ((PyObject *)__pyx_t_6)) : __Pyx_PyObject_CallOneArg(__pyx_t_2, ((PyObject *)__pyx_t_6));
3545 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
3546 __Pyx_DECREF(((PyObject *)__pyx_t_6)); __pyx_t_6 = 0;
3547 if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 68, __pyx_L1_error)
3548 __Pyx_GOTREF(__pyx_t_1);
3549 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
3550 if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(1, 68, __pyx_L1_error)
3551 __Pyx_GIVEREF(__pyx_t_1);
3552 __Pyx_GOTREF(__pyx_v_self->_D);
3553 __Pyx_DECREF(((PyObject *)__pyx_v_self->_D));
3554 __pyx_v_self->_D = ((PyArrayObject *)__pyx_t_1);
3564 __pyx_t_8 = __pyx_v_self->s13.inside_out;
3565 __pyx_v_self->inside_out = __pyx_t_8;
3584 __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->nSpace);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 70, __pyx_L1_error)
3585 __Pyx_GOTREF(__pyx_t_1);
3586 __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_self->nP);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 70, __pyx_L1_error)
3587 __Pyx_GOTREF(__pyx_t_2);
3588 __pyx_t_3 = PyTuple_New(2);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 70, __pyx_L1_error)
3589 __Pyx_GOTREF(__pyx_t_3);
3590 __Pyx_GIVEREF(__pyx_t_1);
3591 PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1);
3592 __Pyx_GIVEREF(__pyx_t_2);
3593 PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_2);
3596 __pyx_t_2 = PyObject_RichCompare(__pyx_t_3, __pyx_tuple__6, Py_EQ); __Pyx_XGOTREF(__pyx_t_2);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 70, __pyx_L1_error)
3597 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
3598 __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_2);
if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(1, 70, __pyx_L1_error)
3599 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
3609 __pyx_v_icase = __pyx_v_self->s21.calculate(((
double *)__pyx_v_phi_dof->data), ((
double *)__pyx_v_phi_nodes->data), ((
double *)__pyx_v_self->xiBuffer->data), 0);
3618 __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_np);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 72, __pyx_L1_error)
3619 __Pyx_GOTREF(__pyx_t_3);
3620 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_asarray);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 72, __pyx_L1_error)
3621 __Pyx_GOTREF(__pyx_t_1);
3622 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
3623 __pyx_t_5 = __pyx_v_self->s21.get_H();
3625 PyErr_SetString(PyExc_ValueError,
"Cannot create cython.array from NULL pointer");
3626 __PYX_ERR(1, 72, __pyx_L1_error)
3628 __pyx_t_7 = __pyx_format_from_typeinfo(&__Pyx_TypeInfo_double);
if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 72, __pyx_L1_error)
3629 __Pyx_GOTREF(__pyx_t_7);
3630 __pyx_t_3 = Py_BuildValue((
char*)
"(" __PYX_BUILD_PY_SSIZE_T
")", ((Py_ssize_t)__pyx_v_self->nQ));
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 72, __pyx_L1_error)
3631 __Pyx_GOTREF(__pyx_t_3);
3632 __pyx_t_6 = __pyx_array_new(__pyx_t_3,
sizeof(
double), PyBytes_AS_STRING(__pyx_t_7), (
char *)
"c", (
char *) __pyx_t_5);
3633 if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 72, __pyx_L1_error)
3634 __Pyx_GOTREF(__pyx_t_6);
3635 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
3636 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
3638 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_1))) {
3639 __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_1);
3640 if (likely(__pyx_t_7)) {
3641 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_1);
3642 __Pyx_INCREF(__pyx_t_7);
3643 __Pyx_INCREF(
function);
3644 __Pyx_DECREF_SET(__pyx_t_1,
function);
3647 __pyx_t_2 = (__pyx_t_7) ? __Pyx_PyObject_Call2Args(__pyx_t_1, __pyx_t_7, ((PyObject *)__pyx_t_6)) : __Pyx_PyObject_CallOneArg(__pyx_t_1, ((PyObject *)__pyx_t_6));
3648 __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
3649 __Pyx_DECREF(((PyObject *)__pyx_t_6)); __pyx_t_6 = 0;
3650 if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 72, __pyx_L1_error)
3651 __Pyx_GOTREF(__pyx_t_2);
3652 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
3653 if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(1, 72, __pyx_L1_error)
3654 __Pyx_GIVEREF(__pyx_t_2);
3655 __Pyx_GOTREF(__pyx_v_self->_H);
3656 __Pyx_DECREF(((PyObject *)__pyx_v_self->_H));
3657 __pyx_v_self->_H = ((PyArrayObject *)__pyx_t_2);
3667 __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_np);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 73, __pyx_L1_error)
3668 __Pyx_GOTREF(__pyx_t_1);
3669 __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_asarray);
if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 73, __pyx_L1_error)
3670 __Pyx_GOTREF(__pyx_t_7);
3671 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
3672 __pyx_t_5 = __pyx_v_self->s21.get_ImH();
3674 PyErr_SetString(PyExc_ValueError,
"Cannot create cython.array from NULL pointer");
3675 __PYX_ERR(1, 73, __pyx_L1_error)
3677 __pyx_t_3 = __pyx_format_from_typeinfo(&__Pyx_TypeInfo_double);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 73, __pyx_L1_error)
3678 __Pyx_GOTREF(__pyx_t_3);
3679 __pyx_t_1 = Py_BuildValue((
char*)
"(" __PYX_BUILD_PY_SSIZE_T
")", ((Py_ssize_t)__pyx_v_self->nQ));
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 73, __pyx_L1_error)
3680 __Pyx_GOTREF(__pyx_t_1);
3681 __pyx_t_6 = __pyx_array_new(__pyx_t_1,
sizeof(
double), PyBytes_AS_STRING(__pyx_t_3), (
char *)
"c", (
char *) __pyx_t_5);
3682 if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 73, __pyx_L1_error)
3683 __Pyx_GOTREF(__pyx_t_6);
3684 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
3685 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
3687 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_7))) {
3688 __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_7);
3689 if (likely(__pyx_t_3)) {
3690 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_7);
3691 __Pyx_INCREF(__pyx_t_3);
3692 __Pyx_INCREF(
function);
3693 __Pyx_DECREF_SET(__pyx_t_7,
function);
3696 __pyx_t_2 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_7, __pyx_t_3, ((PyObject *)__pyx_t_6)) : __Pyx_PyObject_CallOneArg(__pyx_t_7, ((PyObject *)__pyx_t_6));
3697 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
3698 __Pyx_DECREF(((PyObject *)__pyx_t_6)); __pyx_t_6 = 0;
3699 if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 73, __pyx_L1_error)
3700 __Pyx_GOTREF(__pyx_t_2);
3701 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
3702 if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(1, 73, __pyx_L1_error)
3703 __Pyx_GIVEREF(__pyx_t_2);
3704 __Pyx_GOTREF(__pyx_v_self->_ImH);
3705 __Pyx_DECREF(((PyObject *)__pyx_v_self->_ImH));
3706 __pyx_v_self->_ImH = ((PyArrayObject *)__pyx_t_2);
3716 __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_np);
if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 74, __pyx_L1_error)
3717 __Pyx_GOTREF(__pyx_t_7);
3718 __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_asarray);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 74, __pyx_L1_error)
3719 __Pyx_GOTREF(__pyx_t_3);
3720 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
3721 __pyx_t_5 = __pyx_v_self->s21.get_D();
3723 PyErr_SetString(PyExc_ValueError,
"Cannot create cython.array from NULL pointer");
3724 __PYX_ERR(1, 74, __pyx_L1_error)
3726 __pyx_t_1 = __pyx_format_from_typeinfo(&__Pyx_TypeInfo_double);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 74, __pyx_L1_error)
3727 __Pyx_GOTREF(__pyx_t_1);
3728 __pyx_t_7 = Py_BuildValue((
char*)
"(" __PYX_BUILD_PY_SSIZE_T
")", ((Py_ssize_t)__pyx_v_self->nQ));
if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 74, __pyx_L1_error)
3729 __Pyx_GOTREF(__pyx_t_7);
3730 __pyx_t_6 = __pyx_array_new(__pyx_t_7,
sizeof(
double), PyBytes_AS_STRING(__pyx_t_1), (
char *)
"c", (
char *) __pyx_t_5);
3731 if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 74, __pyx_L1_error)
3732 __Pyx_GOTREF(__pyx_t_6);
3733 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
3734 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
3736 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
3737 __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_3);
3738 if (likely(__pyx_t_1)) {
3739 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_3);
3740 __Pyx_INCREF(__pyx_t_1);
3741 __Pyx_INCREF(
function);
3742 __Pyx_DECREF_SET(__pyx_t_3,
function);
3745 __pyx_t_2 = (__pyx_t_1) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_1, ((PyObject *)__pyx_t_6)) : __Pyx_PyObject_CallOneArg(__pyx_t_3, ((PyObject *)__pyx_t_6));
3746 __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
3747 __Pyx_DECREF(((PyObject *)__pyx_t_6)); __pyx_t_6 = 0;
3748 if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 74, __pyx_L1_error)
3749 __Pyx_GOTREF(__pyx_t_2);
3750 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
3751 if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(1, 74, __pyx_L1_error)
3752 __Pyx_GIVEREF(__pyx_t_2);
3753 __Pyx_GOTREF(__pyx_v_self->_D);
3754 __Pyx_DECREF(((PyObject *)__pyx_v_self->_D));
3755 __pyx_v_self->_D = ((PyArrayObject *)__pyx_t_2);
3765 __pyx_t_8 = __pyx_v_self->s21.inside_out;
3766 __pyx_v_self->inside_out = __pyx_t_8;
3785 __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_self->nSpace);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 76, __pyx_L1_error)
3786 __Pyx_GOTREF(__pyx_t_2);
3787 __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_self->nP);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 76, __pyx_L1_error)
3788 __Pyx_GOTREF(__pyx_t_3);
3789 __pyx_t_1 = PyTuple_New(2);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 76, __pyx_L1_error)
3790 __Pyx_GOTREF(__pyx_t_1);
3791 __Pyx_GIVEREF(__pyx_t_2);
3792 PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_2);
3793 __Pyx_GIVEREF(__pyx_t_3);
3794 PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_3);
3797 __pyx_t_3 = PyObject_RichCompare(__pyx_t_1, __pyx_tuple__7, Py_EQ); __Pyx_XGOTREF(__pyx_t_3);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 76, __pyx_L1_error)
3798 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
3799 __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_3);
if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(1, 76, __pyx_L1_error)
3800 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
3810 __pyx_v_icase = __pyx_v_self->s22.calculate(((
double *)__pyx_v_phi_dof->data), ((
double *)__pyx_v_phi_nodes->data), ((
double *)__pyx_v_self->xiBuffer->data), 0);
3819 __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_np);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 78, __pyx_L1_error)
3820 __Pyx_GOTREF(__pyx_t_1);
3821 __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_asarray);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 78, __pyx_L1_error)
3822 __Pyx_GOTREF(__pyx_t_2);
3823 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
3824 __pyx_t_5 = __pyx_v_self->s22.get_H();
3826 PyErr_SetString(PyExc_ValueError,
"Cannot create cython.array from NULL pointer");
3827 __PYX_ERR(1, 78, __pyx_L1_error)
3829 __pyx_t_7 = __pyx_format_from_typeinfo(&__Pyx_TypeInfo_double);
if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 78, __pyx_L1_error)
3830 __Pyx_GOTREF(__pyx_t_7);
3831 __pyx_t_1 = Py_BuildValue((
char*)
"(" __PYX_BUILD_PY_SSIZE_T
")", ((Py_ssize_t)__pyx_v_self->nQ));
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 78, __pyx_L1_error)
3832 __Pyx_GOTREF(__pyx_t_1);
3833 __pyx_t_6 = __pyx_array_new(__pyx_t_1,
sizeof(
double), PyBytes_AS_STRING(__pyx_t_7), (
char *)
"c", (
char *) __pyx_t_5);
3834 if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 78, __pyx_L1_error)
3835 __Pyx_GOTREF(__pyx_t_6);
3836 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
3837 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
3839 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
3840 __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_2);
3841 if (likely(__pyx_t_7)) {
3842 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_2);
3843 __Pyx_INCREF(__pyx_t_7);
3844 __Pyx_INCREF(
function);
3845 __Pyx_DECREF_SET(__pyx_t_2,
function);
3848 __pyx_t_3 = (__pyx_t_7) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_7, ((PyObject *)__pyx_t_6)) : __Pyx_PyObject_CallOneArg(__pyx_t_2, ((PyObject *)__pyx_t_6));
3849 __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
3850 __Pyx_DECREF(((PyObject *)__pyx_t_6)); __pyx_t_6 = 0;
3851 if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 78, __pyx_L1_error)
3852 __Pyx_GOTREF(__pyx_t_3);
3853 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
3854 if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(1, 78, __pyx_L1_error)
3855 __Pyx_GIVEREF(__pyx_t_3);
3856 __Pyx_GOTREF(__pyx_v_self->_H);
3857 __Pyx_DECREF(((PyObject *)__pyx_v_self->_H));
3858 __pyx_v_self->_H = ((PyArrayObject *)__pyx_t_3);
3868 __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_np);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 79, __pyx_L1_error)
3869 __Pyx_GOTREF(__pyx_t_2);
3870 __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_asarray);
if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 79, __pyx_L1_error)
3871 __Pyx_GOTREF(__pyx_t_7);
3872 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
3873 __pyx_t_5 = __pyx_v_self->s22.get_ImH();
3875 PyErr_SetString(PyExc_ValueError,
"Cannot create cython.array from NULL pointer");
3876 __PYX_ERR(1, 79, __pyx_L1_error)
3878 __pyx_t_1 = __pyx_format_from_typeinfo(&__Pyx_TypeInfo_double);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 79, __pyx_L1_error)
3879 __Pyx_GOTREF(__pyx_t_1);
3880 __pyx_t_2 = Py_BuildValue((
char*)
"(" __PYX_BUILD_PY_SSIZE_T
")", ((Py_ssize_t)__pyx_v_self->nQ));
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 79, __pyx_L1_error)
3881 __Pyx_GOTREF(__pyx_t_2);
3882 __pyx_t_6 = __pyx_array_new(__pyx_t_2,
sizeof(
double), PyBytes_AS_STRING(__pyx_t_1), (
char *)
"c", (
char *) __pyx_t_5);
3883 if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 79, __pyx_L1_error)
3884 __Pyx_GOTREF(__pyx_t_6);
3885 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
3886 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
3888 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_7))) {
3889 __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_7);
3890 if (likely(__pyx_t_1)) {
3891 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_7);
3892 __Pyx_INCREF(__pyx_t_1);
3893 __Pyx_INCREF(
function);
3894 __Pyx_DECREF_SET(__pyx_t_7,
function);
3897 __pyx_t_3 = (__pyx_t_1) ? __Pyx_PyObject_Call2Args(__pyx_t_7, __pyx_t_1, ((PyObject *)__pyx_t_6)) : __Pyx_PyObject_CallOneArg(__pyx_t_7, ((PyObject *)__pyx_t_6));
3898 __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
3899 __Pyx_DECREF(((PyObject *)__pyx_t_6)); __pyx_t_6 = 0;
3900 if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 79, __pyx_L1_error)
3901 __Pyx_GOTREF(__pyx_t_3);
3902 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
3903 if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(1, 79, __pyx_L1_error)
3904 __Pyx_GIVEREF(__pyx_t_3);
3905 __Pyx_GOTREF(__pyx_v_self->_ImH);
3906 __Pyx_DECREF(((PyObject *)__pyx_v_self->_ImH));
3907 __pyx_v_self->_ImH = ((PyArrayObject *)__pyx_t_3);
3917 __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_np);
if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 80, __pyx_L1_error)
3918 __Pyx_GOTREF(__pyx_t_7);
3919 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_asarray);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 80, __pyx_L1_error)
3920 __Pyx_GOTREF(__pyx_t_1);
3921 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
3922 __pyx_t_5 = __pyx_v_self->s22.get_D();
3924 PyErr_SetString(PyExc_ValueError,
"Cannot create cython.array from NULL pointer");
3925 __PYX_ERR(1, 80, __pyx_L1_error)
3927 __pyx_t_2 = __pyx_format_from_typeinfo(&__Pyx_TypeInfo_double);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 80, __pyx_L1_error)
3928 __Pyx_GOTREF(__pyx_t_2);
3929 __pyx_t_7 = Py_BuildValue((
char*)
"(" __PYX_BUILD_PY_SSIZE_T
")", ((Py_ssize_t)__pyx_v_self->nQ));
if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 80, __pyx_L1_error)
3930 __Pyx_GOTREF(__pyx_t_7);
3931 __pyx_t_6 = __pyx_array_new(__pyx_t_7,
sizeof(
double), PyBytes_AS_STRING(__pyx_t_2), (
char *)
"c", (
char *) __pyx_t_5);
3932 if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 80, __pyx_L1_error)
3933 __Pyx_GOTREF(__pyx_t_6);
3934 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
3935 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
3937 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_1))) {
3938 __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_1);
3939 if (likely(__pyx_t_2)) {
3940 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_1);
3941 __Pyx_INCREF(__pyx_t_2);
3942 __Pyx_INCREF(
function);
3943 __Pyx_DECREF_SET(__pyx_t_1,
function);
3946 __pyx_t_3 = (__pyx_t_2) ? __Pyx_PyObject_Call2Args(__pyx_t_1, __pyx_t_2, ((PyObject *)__pyx_t_6)) : __Pyx_PyObject_CallOneArg(__pyx_t_1, ((PyObject *)__pyx_t_6));
3947 __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
3948 __Pyx_DECREF(((PyObject *)__pyx_t_6)); __pyx_t_6 = 0;
3949 if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 80, __pyx_L1_error)
3950 __Pyx_GOTREF(__pyx_t_3);
3951 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
3952 if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(1, 80, __pyx_L1_error)
3953 __Pyx_GIVEREF(__pyx_t_3);
3954 __Pyx_GOTREF(__pyx_v_self->_D);
3955 __Pyx_DECREF(((PyObject *)__pyx_v_self->_D));
3956 __pyx_v_self->_D = ((PyArrayObject *)__pyx_t_3);
3966 __pyx_t_8 = __pyx_v_self->s22.inside_out;
3967 __pyx_v_self->inside_out = __pyx_t_8;
3986 __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_self->nSpace);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 82, __pyx_L1_error)
3987 __Pyx_GOTREF(__pyx_t_3);
3988 __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->nP);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 82, __pyx_L1_error)
3989 __Pyx_GOTREF(__pyx_t_1);
3990 __pyx_t_2 = PyTuple_New(2);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 82, __pyx_L1_error)
3991 __Pyx_GOTREF(__pyx_t_2);
3992 __Pyx_GIVEREF(__pyx_t_3);
3993 PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_3);
3994 __Pyx_GIVEREF(__pyx_t_1);
3995 PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_1);
3998 __pyx_t_1 = PyObject_RichCompare(__pyx_t_2, __pyx_tuple__8, Py_EQ); __Pyx_XGOTREF(__pyx_t_1);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 82, __pyx_L1_error)
3999 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
4000 __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_1);
if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(1, 82, __pyx_L1_error)
4001 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
4011 __pyx_v_icase = __pyx_v_self->s23.calculate(((
double *)__pyx_v_phi_dof->data), ((
double *)__pyx_v_phi_nodes->data), ((
double *)__pyx_v_self->xiBuffer->data), 0);
4020 __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_np);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 84, __pyx_L1_error)
4021 __Pyx_GOTREF(__pyx_t_2);
4022 __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_asarray);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 84, __pyx_L1_error)
4023 __Pyx_GOTREF(__pyx_t_3);
4024 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
4025 __pyx_t_5 = __pyx_v_self->s23.get_H();
4027 PyErr_SetString(PyExc_ValueError,
"Cannot create cython.array from NULL pointer");
4028 __PYX_ERR(1, 84, __pyx_L1_error)
4030 __pyx_t_7 = __pyx_format_from_typeinfo(&__Pyx_TypeInfo_double);
if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 84, __pyx_L1_error)
4031 __Pyx_GOTREF(__pyx_t_7);
4032 __pyx_t_2 = Py_BuildValue((
char*)
"(" __PYX_BUILD_PY_SSIZE_T
")", ((Py_ssize_t)__pyx_v_self->nQ));
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 84, __pyx_L1_error)
4033 __Pyx_GOTREF(__pyx_t_2);
4034 __pyx_t_6 = __pyx_array_new(__pyx_t_2,
sizeof(
double), PyBytes_AS_STRING(__pyx_t_7), (
char *)
"c", (
char *) __pyx_t_5);
4035 if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 84, __pyx_L1_error)
4036 __Pyx_GOTREF(__pyx_t_6);
4037 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
4038 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
4040 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
4041 __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_3);
4042 if (likely(__pyx_t_7)) {
4043 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_3);
4044 __Pyx_INCREF(__pyx_t_7);
4045 __Pyx_INCREF(
function);
4046 __Pyx_DECREF_SET(__pyx_t_3,
function);
4049 __pyx_t_1 = (__pyx_t_7) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_7, ((PyObject *)__pyx_t_6)) : __Pyx_PyObject_CallOneArg(__pyx_t_3, ((PyObject *)__pyx_t_6));
4050 __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
4051 __Pyx_DECREF(((PyObject *)__pyx_t_6)); __pyx_t_6 = 0;
4052 if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 84, __pyx_L1_error)
4053 __Pyx_GOTREF(__pyx_t_1);
4054 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
4055 if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(1, 84, __pyx_L1_error)
4056 __Pyx_GIVEREF(__pyx_t_1);
4057 __Pyx_GOTREF(__pyx_v_self->_H);
4058 __Pyx_DECREF(((PyObject *)__pyx_v_self->_H));
4059 __pyx_v_self->_H = ((PyArrayObject *)__pyx_t_1);
4069 __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_np);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 85, __pyx_L1_error)
4070 __Pyx_GOTREF(__pyx_t_3);
4071 __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_asarray);
if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 85, __pyx_L1_error)
4072 __Pyx_GOTREF(__pyx_t_7);
4073 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
4074 __pyx_t_5 = __pyx_v_self->s23.get_ImH();
4076 PyErr_SetString(PyExc_ValueError,
"Cannot create cython.array from NULL pointer");
4077 __PYX_ERR(1, 85, __pyx_L1_error)
4079 __pyx_t_2 = __pyx_format_from_typeinfo(&__Pyx_TypeInfo_double);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 85, __pyx_L1_error)
4080 __Pyx_GOTREF(__pyx_t_2);
4081 __pyx_t_3 = Py_BuildValue((
char*)
"(" __PYX_BUILD_PY_SSIZE_T
")", ((Py_ssize_t)__pyx_v_self->nQ));
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 85, __pyx_L1_error)
4082 __Pyx_GOTREF(__pyx_t_3);
4083 __pyx_t_6 = __pyx_array_new(__pyx_t_3,
sizeof(
double), PyBytes_AS_STRING(__pyx_t_2), (
char *)
"c", (
char *) __pyx_t_5);
4084 if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 85, __pyx_L1_error)
4085 __Pyx_GOTREF(__pyx_t_6);
4086 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
4087 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
4089 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_7))) {
4090 __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_7);
4091 if (likely(__pyx_t_2)) {
4092 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_7);
4093 __Pyx_INCREF(__pyx_t_2);
4094 __Pyx_INCREF(
function);
4095 __Pyx_DECREF_SET(__pyx_t_7,
function);
4098 __pyx_t_1 = (__pyx_t_2) ? __Pyx_PyObject_Call2Args(__pyx_t_7, __pyx_t_2, ((PyObject *)__pyx_t_6)) : __Pyx_PyObject_CallOneArg(__pyx_t_7, ((PyObject *)__pyx_t_6));
4099 __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
4100 __Pyx_DECREF(((PyObject *)__pyx_t_6)); __pyx_t_6 = 0;
4101 if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 85, __pyx_L1_error)
4102 __Pyx_GOTREF(__pyx_t_1);
4103 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
4104 if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(1, 85, __pyx_L1_error)
4105 __Pyx_GIVEREF(__pyx_t_1);
4106 __Pyx_GOTREF(__pyx_v_self->_ImH);
4107 __Pyx_DECREF(((PyObject *)__pyx_v_self->_ImH));
4108 __pyx_v_self->_ImH = ((PyArrayObject *)__pyx_t_1);
4118 __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_np);
if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 86, __pyx_L1_error)
4119 __Pyx_GOTREF(__pyx_t_7);
4120 __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_asarray);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 86, __pyx_L1_error)
4121 __Pyx_GOTREF(__pyx_t_2);
4122 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
4123 __pyx_t_5 = __pyx_v_self->s23.get_D();
4125 PyErr_SetString(PyExc_ValueError,
"Cannot create cython.array from NULL pointer");
4126 __PYX_ERR(1, 86, __pyx_L1_error)
4128 __pyx_t_3 = __pyx_format_from_typeinfo(&__Pyx_TypeInfo_double);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 86, __pyx_L1_error)
4129 __Pyx_GOTREF(__pyx_t_3);
4130 __pyx_t_7 = Py_BuildValue((
char*)
"(" __PYX_BUILD_PY_SSIZE_T
")", ((Py_ssize_t)__pyx_v_self->nQ));
if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 86, __pyx_L1_error)
4131 __Pyx_GOTREF(__pyx_t_7);
4132 __pyx_t_6 = __pyx_array_new(__pyx_t_7,
sizeof(
double), PyBytes_AS_STRING(__pyx_t_3), (
char *)
"c", (
char *) __pyx_t_5);
4133 if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 86, __pyx_L1_error)
4134 __Pyx_GOTREF(__pyx_t_6);
4135 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
4136 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
4138 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
4139 __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
4140 if (likely(__pyx_t_3)) {
4141 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_2);
4142 __Pyx_INCREF(__pyx_t_3);
4143 __Pyx_INCREF(
function);
4144 __Pyx_DECREF_SET(__pyx_t_2,
function);
4147 __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_3, ((PyObject *)__pyx_t_6)) : __Pyx_PyObject_CallOneArg(__pyx_t_2, ((PyObject *)__pyx_t_6));
4148 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
4149 __Pyx_DECREF(((PyObject *)__pyx_t_6)); __pyx_t_6 = 0;
4150 if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 86, __pyx_L1_error)
4151 __Pyx_GOTREF(__pyx_t_1);
4152 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
4153 if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(1, 86, __pyx_L1_error)
4154 __Pyx_GIVEREF(__pyx_t_1);
4155 __Pyx_GOTREF(__pyx_v_self->_D);
4156 __Pyx_DECREF(((PyObject *)__pyx_v_self->_D));
4157 __pyx_v_self->_D = ((PyArrayObject *)__pyx_t_1);
4167 __pyx_t_8 = __pyx_v_self->s23.inside_out;
4168 __pyx_v_self->inside_out = __pyx_t_8;
4187 __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->nSpace);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 88, __pyx_L1_error)
4188 __Pyx_GOTREF(__pyx_t_1);
4189 __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_self->nP);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 88, __pyx_L1_error)
4190 __Pyx_GOTREF(__pyx_t_2);
4191 __pyx_t_3 = PyTuple_New(2);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 88, __pyx_L1_error)
4192 __Pyx_GOTREF(__pyx_t_3);
4193 __Pyx_GIVEREF(__pyx_t_1);
4194 PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1);
4195 __Pyx_GIVEREF(__pyx_t_2);
4196 PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_2);
4199 __pyx_t_2 = PyObject_RichCompare(__pyx_t_3, __pyx_tuple__9, Py_EQ); __Pyx_XGOTREF(__pyx_t_2);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 88, __pyx_L1_error)
4200 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
4201 __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_2);
if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(1, 88, __pyx_L1_error)
4202 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
4212 __pyx_v_icase = __pyx_v_self->s31.calculate(((
double *)__pyx_v_phi_dof->data), ((
double *)__pyx_v_phi_nodes->data), ((
double *)__pyx_v_self->xiBuffer->data), 0);
4221 __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_np);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 90, __pyx_L1_error)
4222 __Pyx_GOTREF(__pyx_t_3);
4223 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_asarray);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 90, __pyx_L1_error)
4224 __Pyx_GOTREF(__pyx_t_1);
4225 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
4226 __pyx_t_5 = __pyx_v_self->s31.get_H();
4228 PyErr_SetString(PyExc_ValueError,
"Cannot create cython.array from NULL pointer");
4229 __PYX_ERR(1, 90, __pyx_L1_error)
4231 __pyx_t_7 = __pyx_format_from_typeinfo(&__Pyx_TypeInfo_double);
if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 90, __pyx_L1_error)
4232 __Pyx_GOTREF(__pyx_t_7);
4233 __pyx_t_3 = Py_BuildValue((
char*)
"(" __PYX_BUILD_PY_SSIZE_T
")", ((Py_ssize_t)__pyx_v_self->nQ));
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 90, __pyx_L1_error)
4234 __Pyx_GOTREF(__pyx_t_3);
4235 __pyx_t_6 = __pyx_array_new(__pyx_t_3,
sizeof(
double), PyBytes_AS_STRING(__pyx_t_7), (
char *)
"c", (
char *) __pyx_t_5);
4236 if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 90, __pyx_L1_error)
4237 __Pyx_GOTREF(__pyx_t_6);
4238 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
4239 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
4241 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_1))) {
4242 __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_1);
4243 if (likely(__pyx_t_7)) {
4244 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_1);
4245 __Pyx_INCREF(__pyx_t_7);
4246 __Pyx_INCREF(
function);
4247 __Pyx_DECREF_SET(__pyx_t_1,
function);
4250 __pyx_t_2 = (__pyx_t_7) ? __Pyx_PyObject_Call2Args(__pyx_t_1, __pyx_t_7, ((PyObject *)__pyx_t_6)) : __Pyx_PyObject_CallOneArg(__pyx_t_1, ((PyObject *)__pyx_t_6));
4251 __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
4252 __Pyx_DECREF(((PyObject *)__pyx_t_6)); __pyx_t_6 = 0;
4253 if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 90, __pyx_L1_error)
4254 __Pyx_GOTREF(__pyx_t_2);
4255 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
4256 if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(1, 90, __pyx_L1_error)
4257 __Pyx_GIVEREF(__pyx_t_2);
4258 __Pyx_GOTREF(__pyx_v_self->_H);
4259 __Pyx_DECREF(((PyObject *)__pyx_v_self->_H));
4260 __pyx_v_self->_H = ((PyArrayObject *)__pyx_t_2);
4270 __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_np);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 91, __pyx_L1_error)
4271 __Pyx_GOTREF(__pyx_t_1);
4272 __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_asarray);
if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 91, __pyx_L1_error)
4273 __Pyx_GOTREF(__pyx_t_7);
4274 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
4275 __pyx_t_5 = __pyx_v_self->s31.get_ImH();
4277 PyErr_SetString(PyExc_ValueError,
"Cannot create cython.array from NULL pointer");
4278 __PYX_ERR(1, 91, __pyx_L1_error)
4280 __pyx_t_3 = __pyx_format_from_typeinfo(&__Pyx_TypeInfo_double);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 91, __pyx_L1_error)
4281 __Pyx_GOTREF(__pyx_t_3);
4282 __pyx_t_1 = Py_BuildValue((
char*)
"(" __PYX_BUILD_PY_SSIZE_T
")", ((Py_ssize_t)__pyx_v_self->nQ));
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 91, __pyx_L1_error)
4283 __Pyx_GOTREF(__pyx_t_1);
4284 __pyx_t_6 = __pyx_array_new(__pyx_t_1,
sizeof(
double), PyBytes_AS_STRING(__pyx_t_3), (
char *)
"c", (
char *) __pyx_t_5);
4285 if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 91, __pyx_L1_error)
4286 __Pyx_GOTREF(__pyx_t_6);
4287 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
4288 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
4290 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_7))) {
4291 __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_7);
4292 if (likely(__pyx_t_3)) {
4293 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_7);
4294 __Pyx_INCREF(__pyx_t_3);
4295 __Pyx_INCREF(
function);
4296 __Pyx_DECREF_SET(__pyx_t_7,
function);
4299 __pyx_t_2 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_7, __pyx_t_3, ((PyObject *)__pyx_t_6)) : __Pyx_PyObject_CallOneArg(__pyx_t_7, ((PyObject *)__pyx_t_6));
4300 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
4301 __Pyx_DECREF(((PyObject *)__pyx_t_6)); __pyx_t_6 = 0;
4302 if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 91, __pyx_L1_error)
4303 __Pyx_GOTREF(__pyx_t_2);
4304 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
4305 if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(1, 91, __pyx_L1_error)
4306 __Pyx_GIVEREF(__pyx_t_2);
4307 __Pyx_GOTREF(__pyx_v_self->_ImH);
4308 __Pyx_DECREF(((PyObject *)__pyx_v_self->_ImH));
4309 __pyx_v_self->_ImH = ((PyArrayObject *)__pyx_t_2);
4319 __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_np);
if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 92, __pyx_L1_error)
4320 __Pyx_GOTREF(__pyx_t_7);
4321 __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_asarray);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 92, __pyx_L1_error)
4322 __Pyx_GOTREF(__pyx_t_3);
4323 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
4324 __pyx_t_5 = __pyx_v_self->s31.get_D();
4326 PyErr_SetString(PyExc_ValueError,
"Cannot create cython.array from NULL pointer");
4327 __PYX_ERR(1, 92, __pyx_L1_error)
4329 __pyx_t_1 = __pyx_format_from_typeinfo(&__Pyx_TypeInfo_double);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 92, __pyx_L1_error)
4330 __Pyx_GOTREF(__pyx_t_1);
4331 __pyx_t_7 = Py_BuildValue((
char*)
"(" __PYX_BUILD_PY_SSIZE_T
")", ((Py_ssize_t)__pyx_v_self->nQ));
if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 92, __pyx_L1_error)
4332 __Pyx_GOTREF(__pyx_t_7);
4333 __pyx_t_6 = __pyx_array_new(__pyx_t_7,
sizeof(
double), PyBytes_AS_STRING(__pyx_t_1), (
char *)
"c", (
char *) __pyx_t_5);
4334 if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 92, __pyx_L1_error)
4335 __Pyx_GOTREF(__pyx_t_6);
4336 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
4337 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
4339 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
4340 __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_3);
4341 if (likely(__pyx_t_1)) {
4342 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_3);
4343 __Pyx_INCREF(__pyx_t_1);
4344 __Pyx_INCREF(
function);
4345 __Pyx_DECREF_SET(__pyx_t_3,
function);
4348 __pyx_t_2 = (__pyx_t_1) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_1, ((PyObject *)__pyx_t_6)) : __Pyx_PyObject_CallOneArg(__pyx_t_3, ((PyObject *)__pyx_t_6));
4349 __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
4350 __Pyx_DECREF(((PyObject *)__pyx_t_6)); __pyx_t_6 = 0;
4351 if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 92, __pyx_L1_error)
4352 __Pyx_GOTREF(__pyx_t_2);
4353 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
4354 if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(1, 92, __pyx_L1_error)
4355 __Pyx_GIVEREF(__pyx_t_2);
4356 __Pyx_GOTREF(__pyx_v_self->_D);
4357 __Pyx_DECREF(((PyObject *)__pyx_v_self->_D));
4358 __pyx_v_self->_D = ((PyArrayObject *)__pyx_t_2);
4368 __pyx_t_8 = __pyx_v_self->s31.inside_out;
4369 __pyx_v_self->inside_out = __pyx_t_8;
4388 __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_self->nSpace);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 94, __pyx_L1_error)
4389 __Pyx_GOTREF(__pyx_t_2);
4390 __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_self->nP);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 94, __pyx_L1_error)
4391 __Pyx_GOTREF(__pyx_t_3);
4392 __pyx_t_1 = PyTuple_New(2);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 94, __pyx_L1_error)
4393 __Pyx_GOTREF(__pyx_t_1);
4394 __Pyx_GIVEREF(__pyx_t_2);
4395 PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_2);
4396 __Pyx_GIVEREF(__pyx_t_3);
4397 PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_3);
4400 __pyx_t_3 = PyObject_RichCompare(__pyx_t_1, __pyx_tuple__10, Py_EQ); __Pyx_XGOTREF(__pyx_t_3);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 94, __pyx_L1_error)
4401 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
4402 __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_3);
if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(1, 94, __pyx_L1_error)
4403 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
4413 __pyx_v_icase = __pyx_v_self->s32.calculate(((
double *)__pyx_v_phi_dof->data), ((
double *)__pyx_v_phi_nodes->data), ((
double *)__pyx_v_self->xiBuffer->data), 0);
4422 __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_np);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 96, __pyx_L1_error)
4423 __Pyx_GOTREF(__pyx_t_1);
4424 __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_asarray);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 96, __pyx_L1_error)
4425 __Pyx_GOTREF(__pyx_t_2);
4426 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
4427 __pyx_t_5 = __pyx_v_self->s32.get_H();
4429 PyErr_SetString(PyExc_ValueError,
"Cannot create cython.array from NULL pointer");
4430 __PYX_ERR(1, 96, __pyx_L1_error)
4432 __pyx_t_7 = __pyx_format_from_typeinfo(&__Pyx_TypeInfo_double);
if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 96, __pyx_L1_error)
4433 __Pyx_GOTREF(__pyx_t_7);
4434 __pyx_t_1 = Py_BuildValue((
char*)
"(" __PYX_BUILD_PY_SSIZE_T
")", ((Py_ssize_t)__pyx_v_self->nQ));
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 96, __pyx_L1_error)
4435 __Pyx_GOTREF(__pyx_t_1);
4436 __pyx_t_6 = __pyx_array_new(__pyx_t_1,
sizeof(
double), PyBytes_AS_STRING(__pyx_t_7), (
char *)
"c", (
char *) __pyx_t_5);
4437 if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 96, __pyx_L1_error)
4438 __Pyx_GOTREF(__pyx_t_6);
4439 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
4440 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
4442 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
4443 __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_2);
4444 if (likely(__pyx_t_7)) {
4445 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_2);
4446 __Pyx_INCREF(__pyx_t_7);
4447 __Pyx_INCREF(
function);
4448 __Pyx_DECREF_SET(__pyx_t_2,
function);
4451 __pyx_t_3 = (__pyx_t_7) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_7, ((PyObject *)__pyx_t_6)) : __Pyx_PyObject_CallOneArg(__pyx_t_2, ((PyObject *)__pyx_t_6));
4452 __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
4453 __Pyx_DECREF(((PyObject *)__pyx_t_6)); __pyx_t_6 = 0;
4454 if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 96, __pyx_L1_error)
4455 __Pyx_GOTREF(__pyx_t_3);
4456 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
4457 if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(1, 96, __pyx_L1_error)
4458 __Pyx_GIVEREF(__pyx_t_3);
4459 __Pyx_GOTREF(__pyx_v_self->_H);
4460 __Pyx_DECREF(((PyObject *)__pyx_v_self->_H));
4461 __pyx_v_self->_H = ((PyArrayObject *)__pyx_t_3);
4471 __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_np);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 97, __pyx_L1_error)
4472 __Pyx_GOTREF(__pyx_t_2);
4473 __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_asarray);
if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 97, __pyx_L1_error)
4474 __Pyx_GOTREF(__pyx_t_7);
4475 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
4476 __pyx_t_5 = __pyx_v_self->s32.get_ImH();
4478 PyErr_SetString(PyExc_ValueError,
"Cannot create cython.array from NULL pointer");
4479 __PYX_ERR(1, 97, __pyx_L1_error)
4481 __pyx_t_1 = __pyx_format_from_typeinfo(&__Pyx_TypeInfo_double);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 97, __pyx_L1_error)
4482 __Pyx_GOTREF(__pyx_t_1);
4483 __pyx_t_2 = Py_BuildValue((
char*)
"(" __PYX_BUILD_PY_SSIZE_T
")", ((Py_ssize_t)__pyx_v_self->nQ));
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 97, __pyx_L1_error)
4484 __Pyx_GOTREF(__pyx_t_2);
4485 __pyx_t_6 = __pyx_array_new(__pyx_t_2,
sizeof(
double), PyBytes_AS_STRING(__pyx_t_1), (
char *)
"c", (
char *) __pyx_t_5);
4486 if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 97, __pyx_L1_error)
4487 __Pyx_GOTREF(__pyx_t_6);
4488 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
4489 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
4491 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_7))) {
4492 __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_7);
4493 if (likely(__pyx_t_1)) {
4494 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_7);
4495 __Pyx_INCREF(__pyx_t_1);
4496 __Pyx_INCREF(
function);
4497 __Pyx_DECREF_SET(__pyx_t_7,
function);
4500 __pyx_t_3 = (__pyx_t_1) ? __Pyx_PyObject_Call2Args(__pyx_t_7, __pyx_t_1, ((PyObject *)__pyx_t_6)) : __Pyx_PyObject_CallOneArg(__pyx_t_7, ((PyObject *)__pyx_t_6));
4501 __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
4502 __Pyx_DECREF(((PyObject *)__pyx_t_6)); __pyx_t_6 = 0;
4503 if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 97, __pyx_L1_error)
4504 __Pyx_GOTREF(__pyx_t_3);
4505 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
4506 if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(1, 97, __pyx_L1_error)
4507 __Pyx_GIVEREF(__pyx_t_3);
4508 __Pyx_GOTREF(__pyx_v_self->_ImH);
4509 __Pyx_DECREF(((PyObject *)__pyx_v_self->_ImH));
4510 __pyx_v_self->_ImH = ((PyArrayObject *)__pyx_t_3);
4520 __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_np);
if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 98, __pyx_L1_error)
4521 __Pyx_GOTREF(__pyx_t_7);
4522 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_asarray);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 98, __pyx_L1_error)
4523 __Pyx_GOTREF(__pyx_t_1);
4524 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
4525 __pyx_t_5 = __pyx_v_self->s32.get_D();
4527 PyErr_SetString(PyExc_ValueError,
"Cannot create cython.array from NULL pointer");
4528 __PYX_ERR(1, 98, __pyx_L1_error)
4530 __pyx_t_2 = __pyx_format_from_typeinfo(&__Pyx_TypeInfo_double);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 98, __pyx_L1_error)
4531 __Pyx_GOTREF(__pyx_t_2);
4532 __pyx_t_7 = Py_BuildValue((
char*)
"(" __PYX_BUILD_PY_SSIZE_T
")", ((Py_ssize_t)__pyx_v_self->nQ));
if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 98, __pyx_L1_error)
4533 __Pyx_GOTREF(__pyx_t_7);
4534 __pyx_t_6 = __pyx_array_new(__pyx_t_7,
sizeof(
double), PyBytes_AS_STRING(__pyx_t_2), (
char *)
"c", (
char *) __pyx_t_5);
4535 if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 98, __pyx_L1_error)
4536 __Pyx_GOTREF(__pyx_t_6);
4537 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
4538 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
4540 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_1))) {
4541 __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_1);
4542 if (likely(__pyx_t_2)) {
4543 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_1);
4544 __Pyx_INCREF(__pyx_t_2);
4545 __Pyx_INCREF(
function);
4546 __Pyx_DECREF_SET(__pyx_t_1,
function);
4549 __pyx_t_3 = (__pyx_t_2) ? __Pyx_PyObject_Call2Args(__pyx_t_1, __pyx_t_2, ((PyObject *)__pyx_t_6)) : __Pyx_PyObject_CallOneArg(__pyx_t_1, ((PyObject *)__pyx_t_6));
4550 __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
4551 __Pyx_DECREF(((PyObject *)__pyx_t_6)); __pyx_t_6 = 0;
4552 if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 98, __pyx_L1_error)
4553 __Pyx_GOTREF(__pyx_t_3);
4554 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
4555 if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(1, 98, __pyx_L1_error)
4556 __Pyx_GIVEREF(__pyx_t_3);
4557 __Pyx_GOTREF(__pyx_v_self->_D);
4558 __Pyx_DECREF(((PyObject *)__pyx_v_self->_D));
4559 __pyx_v_self->_D = ((PyArrayObject *)__pyx_t_3);
4569 __pyx_t_8 = __pyx_v_self->s32.inside_out;
4570 __pyx_v_self->inside_out = __pyx_t_8;
4589 __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_self->nSpace);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 100, __pyx_L1_error)
4590 __Pyx_GOTREF(__pyx_t_3);
4591 __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->nP);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 100, __pyx_L1_error)
4592 __Pyx_GOTREF(__pyx_t_1);
4593 __pyx_t_2 = PyTuple_New(2);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 100, __pyx_L1_error)
4594 __Pyx_GOTREF(__pyx_t_2);
4595 __Pyx_GIVEREF(__pyx_t_3);
4596 PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_3);
4597 __Pyx_GIVEREF(__pyx_t_1);
4598 PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_1);
4601 __pyx_t_1 = PyObject_RichCompare(__pyx_t_2, __pyx_tuple__11, Py_EQ); __Pyx_XGOTREF(__pyx_t_1);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 100, __pyx_L1_error)
4602 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
4603 __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_1);
if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(1, 100, __pyx_L1_error)
4604 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
4614 __pyx_v_icase = __pyx_v_self->s33.calculate(((
double *)__pyx_v_phi_dof->data), ((
double *)__pyx_v_phi_nodes->data), ((
double *)__pyx_v_self->xiBuffer->data), 0);
4623 __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_np);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 102, __pyx_L1_error)
4624 __Pyx_GOTREF(__pyx_t_2);
4625 __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_asarray);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 102, __pyx_L1_error)
4626 __Pyx_GOTREF(__pyx_t_3);
4627 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
4628 __pyx_t_5 = __pyx_v_self->s33.get_H();
4630 PyErr_SetString(PyExc_ValueError,
"Cannot create cython.array from NULL pointer");
4631 __PYX_ERR(1, 102, __pyx_L1_error)
4633 __pyx_t_7 = __pyx_format_from_typeinfo(&__Pyx_TypeInfo_double);
if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 102, __pyx_L1_error)
4634 __Pyx_GOTREF(__pyx_t_7);
4635 __pyx_t_2 = Py_BuildValue((
char*)
"(" __PYX_BUILD_PY_SSIZE_T
")", ((Py_ssize_t)__pyx_v_self->nQ));
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 102, __pyx_L1_error)
4636 __Pyx_GOTREF(__pyx_t_2);
4637 __pyx_t_6 = __pyx_array_new(__pyx_t_2,
sizeof(
double), PyBytes_AS_STRING(__pyx_t_7), (
char *)
"c", (
char *) __pyx_t_5);
4638 if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 102, __pyx_L1_error)
4639 __Pyx_GOTREF(__pyx_t_6);
4640 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
4641 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
4643 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
4644 __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_3);
4645 if (likely(__pyx_t_7)) {
4646 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_3);
4647 __Pyx_INCREF(__pyx_t_7);
4648 __Pyx_INCREF(
function);
4649 __Pyx_DECREF_SET(__pyx_t_3,
function);
4652 __pyx_t_1 = (__pyx_t_7) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_7, ((PyObject *)__pyx_t_6)) : __Pyx_PyObject_CallOneArg(__pyx_t_3, ((PyObject *)__pyx_t_6));
4653 __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
4654 __Pyx_DECREF(((PyObject *)__pyx_t_6)); __pyx_t_6 = 0;
4655 if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 102, __pyx_L1_error)
4656 __Pyx_GOTREF(__pyx_t_1);
4657 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
4658 if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(1, 102, __pyx_L1_error)
4659 __Pyx_GIVEREF(__pyx_t_1);
4660 __Pyx_GOTREF(__pyx_v_self->_H);
4661 __Pyx_DECREF(((PyObject *)__pyx_v_self->_H));
4662 __pyx_v_self->_H = ((PyArrayObject *)__pyx_t_1);
4672 __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_np);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 103, __pyx_L1_error)
4673 __Pyx_GOTREF(__pyx_t_3);
4674 __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_asarray);
if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 103, __pyx_L1_error)
4675 __Pyx_GOTREF(__pyx_t_7);
4676 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
4677 __pyx_t_5 = __pyx_v_self->s33.get_ImH();
4679 PyErr_SetString(PyExc_ValueError,
"Cannot create cython.array from NULL pointer");
4680 __PYX_ERR(1, 103, __pyx_L1_error)
4682 __pyx_t_2 = __pyx_format_from_typeinfo(&__Pyx_TypeInfo_double);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 103, __pyx_L1_error)
4683 __Pyx_GOTREF(__pyx_t_2);
4684 __pyx_t_3 = Py_BuildValue((
char*)
"(" __PYX_BUILD_PY_SSIZE_T
")", ((Py_ssize_t)__pyx_v_self->nQ));
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 103, __pyx_L1_error)
4685 __Pyx_GOTREF(__pyx_t_3);
4686 __pyx_t_6 = __pyx_array_new(__pyx_t_3,
sizeof(
double), PyBytes_AS_STRING(__pyx_t_2), (
char *)
"c", (
char *) __pyx_t_5);
4687 if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 103, __pyx_L1_error)
4688 __Pyx_GOTREF(__pyx_t_6);
4689 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
4690 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
4692 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_7))) {
4693 __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_7);
4694 if (likely(__pyx_t_2)) {
4695 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_7);
4696 __Pyx_INCREF(__pyx_t_2);
4697 __Pyx_INCREF(
function);
4698 __Pyx_DECREF_SET(__pyx_t_7,
function);
4701 __pyx_t_1 = (__pyx_t_2) ? __Pyx_PyObject_Call2Args(__pyx_t_7, __pyx_t_2, ((PyObject *)__pyx_t_6)) : __Pyx_PyObject_CallOneArg(__pyx_t_7, ((PyObject *)__pyx_t_6));
4702 __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
4703 __Pyx_DECREF(((PyObject *)__pyx_t_6)); __pyx_t_6 = 0;
4704 if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 103, __pyx_L1_error)
4705 __Pyx_GOTREF(__pyx_t_1);
4706 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
4707 if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(1, 103, __pyx_L1_error)
4708 __Pyx_GIVEREF(__pyx_t_1);
4709 __Pyx_GOTREF(__pyx_v_self->_ImH);
4710 __Pyx_DECREF(((PyObject *)__pyx_v_self->_ImH));
4711 __pyx_v_self->_ImH = ((PyArrayObject *)__pyx_t_1);
4721 __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_np);
if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 104, __pyx_L1_error)
4722 __Pyx_GOTREF(__pyx_t_7);
4723 __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_asarray);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 104, __pyx_L1_error)
4724 __Pyx_GOTREF(__pyx_t_2);
4725 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
4726 __pyx_t_5 = __pyx_v_self->s33.get_D();
4728 PyErr_SetString(PyExc_ValueError,
"Cannot create cython.array from NULL pointer");
4729 __PYX_ERR(1, 104, __pyx_L1_error)
4731 __pyx_t_3 = __pyx_format_from_typeinfo(&__Pyx_TypeInfo_double);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 104, __pyx_L1_error)
4732 __Pyx_GOTREF(__pyx_t_3);
4733 __pyx_t_7 = Py_BuildValue((
char*)
"(" __PYX_BUILD_PY_SSIZE_T
")", ((Py_ssize_t)__pyx_v_self->nQ));
if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 104, __pyx_L1_error)
4734 __Pyx_GOTREF(__pyx_t_7);
4735 __pyx_t_6 = __pyx_array_new(__pyx_t_7,
sizeof(
double), PyBytes_AS_STRING(__pyx_t_3), (
char *)
"c", (
char *) __pyx_t_5);
4736 if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 104, __pyx_L1_error)
4737 __Pyx_GOTREF(__pyx_t_6);
4738 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
4739 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
4741 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
4742 __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
4743 if (likely(__pyx_t_3)) {
4744 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_2);
4745 __Pyx_INCREF(__pyx_t_3);
4746 __Pyx_INCREF(
function);
4747 __Pyx_DECREF_SET(__pyx_t_2,
function);
4750 __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_3, ((PyObject *)__pyx_t_6)) : __Pyx_PyObject_CallOneArg(__pyx_t_2, ((PyObject *)__pyx_t_6));
4751 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
4752 __Pyx_DECREF(((PyObject *)__pyx_t_6)); __pyx_t_6 = 0;
4753 if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 104, __pyx_L1_error)
4754 __Pyx_GOTREF(__pyx_t_1);
4755 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
4756 if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(1, 104, __pyx_L1_error)
4757 __Pyx_GIVEREF(__pyx_t_1);
4758 __Pyx_GOTREF(__pyx_v_self->_D);
4759 __Pyx_DECREF(((PyObject *)__pyx_v_self->_D));
4760 __pyx_v_self->_D = ((PyArrayObject *)__pyx_t_1);
4770 __pyx_t_8 = __pyx_v_self->s33.inside_out;
4771 __pyx_v_self->inside_out = __pyx_t_8;
4792 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
4795 __Pyx_XDECREF(__pyx_t_1);
4796 __Pyx_XDECREF(__pyx_t_2);
4797 __Pyx_XDECREF(__pyx_t_3);
4798 __Pyx_XDECREF(((PyObject *)__pyx_t_6));
4799 __Pyx_XDECREF(__pyx_t_7);
4800 __Pyx_AddTraceback(
"equivalent_polynomials.Simplex.calculate", __pyx_clineno, __pyx_lineno, __pyx_filename);
4803 __Pyx_XGIVEREF(__pyx_r);
4804 __Pyx_RefNannyFinishContext();
4817 static PyObject *__pyx_pw_22equivalent_polynomials_7Simplex_5set_quad(PyObject *__pyx_v_self, PyObject *__pyx_arg_q);
4818 static PyObject *__pyx_pw_22equivalent_polynomials_7Simplex_5set_quad(PyObject *__pyx_v_self, PyObject *__pyx_arg_q) {
4820 int __pyx_lineno = 0;
4821 const char *__pyx_filename = NULL;
4822 int __pyx_clineno = 0;
4823 PyObject *__pyx_r = 0;
4824 __Pyx_RefNannyDeclarations
4825 __Pyx_RefNannySetupContext(
"set_quad (wrapper)", 0);
4826 assert(__pyx_arg_q); {
4827 __pyx_v_q = __Pyx_PyInt_As_int(__pyx_arg_q);
if (unlikely((__pyx_v_q == (
int)-1) && PyErr_Occurred())) __PYX_ERR(1, 106, __pyx_L3_error)
4829 goto __pyx_L4_argument_unpacking_done;
4831 __Pyx_AddTraceback(
"equivalent_polynomials.Simplex.set_quad", __pyx_clineno, __pyx_lineno, __pyx_filename);
4832 __Pyx_RefNannyFinishContext();
4834 __pyx_L4_argument_unpacking_done:;
4835 __pyx_r = __pyx_pf_22equivalent_polynomials_7Simplex_4set_quad(((
struct __pyx_obj_22equivalent_polynomials_Simplex *)__pyx_v_self), ((
int)__pyx_v_q));
4838 __Pyx_RefNannyFinishContext();
4842 static PyObject *__pyx_pf_22equivalent_polynomials_7Simplex_4set_quad(
struct __pyx_obj_22equivalent_polynomials_Simplex *__pyx_v_self,
int __pyx_v_q) {
4843 PyObject *__pyx_r = NULL;
4844 __Pyx_RefNannyDeclarations
4845 __Pyx_RefNannySetupContext(
"set_quad", 0);
4854 __pyx_v_self->q = __pyx_v_q;
4865 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
4866 __Pyx_XGIVEREF(__pyx_r);
4867 __Pyx_RefNannyFinishContext();
4880 static PyObject *__pyx_pw_22equivalent_polynomials_7Simplex_1H_1__get__(PyObject *__pyx_v_self);
4881 static PyObject *__pyx_pw_22equivalent_polynomials_7Simplex_1H_1__get__(PyObject *__pyx_v_self) {
4882 PyObject *__pyx_r = 0;
4883 __Pyx_RefNannyDeclarations
4884 __Pyx_RefNannySetupContext(
"__get__ (wrapper)", 0);
4885 __pyx_r = __pyx_pf_22equivalent_polynomials_7Simplex_1H___get__(((
struct __pyx_obj_22equivalent_polynomials_Simplex *)__pyx_v_self));
4888 __Pyx_RefNannyFinishContext();
4892 static PyObject *__pyx_pf_22equivalent_polynomials_7Simplex_1H___get__(
struct __pyx_obj_22equivalent_polynomials_Simplex *__pyx_v_self) {
4893 PyObject *__pyx_r = NULL;
4894 __Pyx_RefNannyDeclarations
4896 PyObject *__pyx_t_2 = NULL;
4897 int __pyx_lineno = 0;
4898 const char *__pyx_filename = NULL;
4899 int __pyx_clineno = 0;
4900 __Pyx_RefNannySetupContext(
"__get__", 0);
4909 __pyx_t_1 = (__pyx_v_self->inside_out != 0);
4919 __Pyx_XDECREF(__pyx_r);
4920 __pyx_t_2 = __Pyx_GetItemInt(((PyObject *)__pyx_v_self->_ImH), __pyx_v_self->q,
int, 1, __Pyx_PyInt_From_int, 0, 1, 1);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 111, __pyx_L1_error)
4921 __Pyx_GOTREF(__pyx_t_2);
4922 __pyx_r = __pyx_t_2;
4943 __Pyx_XDECREF(__pyx_r);
4944 __pyx_t_2 = __Pyx_GetItemInt(((PyObject *)__pyx_v_self->_H), __pyx_v_self->q,
int, 1, __Pyx_PyInt_From_int, 0, 1, 1);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 113, __pyx_L1_error)
4945 __Pyx_GOTREF(__pyx_t_2);
4946 __pyx_r = __pyx_t_2;
4961 __Pyx_XDECREF(__pyx_t_2);
4962 __Pyx_AddTraceback(
"equivalent_polynomials.Simplex.H.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
4965 __Pyx_XGIVEREF(__pyx_r);
4966 __Pyx_RefNannyFinishContext();
4979 static PyObject *__pyx_pw_22equivalent_polynomials_7Simplex_3ImH_1__get__(PyObject *__pyx_v_self);
4980 static PyObject *__pyx_pw_22equivalent_polynomials_7Simplex_3ImH_1__get__(PyObject *__pyx_v_self) {
4981 PyObject *__pyx_r = 0;
4982 __Pyx_RefNannyDeclarations
4983 __Pyx_RefNannySetupContext(
"__get__ (wrapper)", 0);
4984 __pyx_r = __pyx_pf_22equivalent_polynomials_7Simplex_3ImH___get__(((
struct __pyx_obj_22equivalent_polynomials_Simplex *)__pyx_v_self));
4987 __Pyx_RefNannyFinishContext();
4991 static PyObject *__pyx_pf_22equivalent_polynomials_7Simplex_3ImH___get__(
struct __pyx_obj_22equivalent_polynomials_Simplex *__pyx_v_self) {
4992 PyObject *__pyx_r = NULL;
4993 __Pyx_RefNannyDeclarations
4995 PyObject *__pyx_t_2 = NULL;
4996 int __pyx_lineno = 0;
4997 const char *__pyx_filename = NULL;
4998 int __pyx_clineno = 0;
4999 __Pyx_RefNannySetupContext(
"__get__", 0);
5008 __pyx_t_1 = (__pyx_v_self->inside_out != 0);
5018 __Pyx_XDECREF(__pyx_r);
5019 __pyx_t_2 = __Pyx_GetItemInt(((PyObject *)__pyx_v_self->_H), __pyx_v_self->q,
int, 1, __Pyx_PyInt_From_int, 0, 1, 1);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 117, __pyx_L1_error)
5020 __Pyx_GOTREF(__pyx_t_2);
5021 __pyx_r = __pyx_t_2;
5042 __Pyx_XDECREF(__pyx_r);
5043 __pyx_t_2 = __Pyx_GetItemInt(((PyObject *)__pyx_v_self->_ImH), __pyx_v_self->q,
int, 1, __Pyx_PyInt_From_int, 0, 1, 1);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 119, __pyx_L1_error)
5044 __Pyx_GOTREF(__pyx_t_2);
5045 __pyx_r = __pyx_t_2;
5060 __Pyx_XDECREF(__pyx_t_2);
5061 __Pyx_AddTraceback(
"equivalent_polynomials.Simplex.ImH.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
5064 __Pyx_XGIVEREF(__pyx_r);
5065 __Pyx_RefNannyFinishContext();
5077 static PyObject *__pyx_pw_22equivalent_polynomials_7Simplex_1D_1__get__(PyObject *__pyx_v_self);
5078 static PyObject *__pyx_pw_22equivalent_polynomials_7Simplex_1D_1__get__(PyObject *__pyx_v_self) {
5079 PyObject *__pyx_r = 0;
5080 __Pyx_RefNannyDeclarations
5081 __Pyx_RefNannySetupContext(
"__get__ (wrapper)", 0);
5082 __pyx_r = __pyx_pf_22equivalent_polynomials_7Simplex_1D___get__(((
struct __pyx_obj_22equivalent_polynomials_Simplex *)__pyx_v_self));
5085 __Pyx_RefNannyFinishContext();
5089 static PyObject *__pyx_pf_22equivalent_polynomials_7Simplex_1D___get__(
struct __pyx_obj_22equivalent_polynomials_Simplex *__pyx_v_self) {
5090 PyObject *__pyx_r = NULL;
5091 __Pyx_RefNannyDeclarations
5092 PyObject *__pyx_t_1 = NULL;
5093 int __pyx_lineno = 0;
5094 const char *__pyx_filename = NULL;
5095 int __pyx_clineno = 0;
5096 __Pyx_RefNannySetupContext(
"__get__", 0);
5103 __Pyx_XDECREF(__pyx_r);
5104 __pyx_t_1 = __Pyx_GetItemInt(((PyObject *)__pyx_v_self->_D), __pyx_v_self->q,
int, 1, __Pyx_PyInt_From_int, 0, 1, 1);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 122, __pyx_L1_error)
5105 __Pyx_GOTREF(__pyx_t_1);
5106 __pyx_r = __pyx_t_1;
5119 __Pyx_XDECREF(__pyx_t_1);
5120 __Pyx_AddTraceback(
"equivalent_polynomials.Simplex.D.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
5123 __Pyx_XGIVEREF(__pyx_r);
5124 __Pyx_RefNannyFinishContext();
5135 static PyObject *__pyx_pw_22equivalent_polynomials_7Simplex_7__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused);
5136 static PyObject *__pyx_pw_22equivalent_polynomials_7Simplex_7__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
5137 PyObject *__pyx_r = 0;
5138 __Pyx_RefNannyDeclarations
5139 __Pyx_RefNannySetupContext(
"__reduce_cython__ (wrapper)", 0);
5140 __pyx_r = __pyx_pf_22equivalent_polynomials_7Simplex_6__reduce_cython__(((
struct __pyx_obj_22equivalent_polynomials_Simplex *)__pyx_v_self));
5143 __Pyx_RefNannyFinishContext();
5147 static PyObject *__pyx_pf_22equivalent_polynomials_7Simplex_6__reduce_cython__(CYTHON_UNUSED
struct __pyx_obj_22equivalent_polynomials_Simplex *__pyx_v_self) {
5148 PyObject *__pyx_r = NULL;
5149 __Pyx_RefNannyDeclarations
5150 PyObject *__pyx_t_1 = NULL;
5151 int __pyx_lineno = 0;
5152 const char *__pyx_filename = NULL;
5153 int __pyx_clineno = 0;
5154 __Pyx_RefNannySetupContext(
"__reduce_cython__", 0);
5162 __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__12, NULL);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2, __pyx_L1_error)
5163 __Pyx_GOTREF(__pyx_t_1);
5164 __Pyx_Raise(__pyx_t_1, 0, 0, 0);
5165 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
5166 __PYX_ERR(0, 2, __pyx_L1_error)
5176 __Pyx_XDECREF(__pyx_t_1);
5177 __Pyx_AddTraceback(
"equivalent_polynomials.Simplex.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
5179 __Pyx_XGIVEREF(__pyx_r);
5180 __Pyx_RefNannyFinishContext();
5192 static PyObject *__pyx_pw_22equivalent_polynomials_7Simplex_9__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state);
5193 static PyObject *__pyx_pw_22equivalent_polynomials_7Simplex_9__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
5194 PyObject *__pyx_r = 0;
5195 __Pyx_RefNannyDeclarations
5196 __Pyx_RefNannySetupContext(
"__setstate_cython__ (wrapper)", 0);
5197 __pyx_r = __pyx_pf_22equivalent_polynomials_7Simplex_8__setstate_cython__(((
struct __pyx_obj_22equivalent_polynomials_Simplex *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state));
5200 __Pyx_RefNannyFinishContext();
5204 static PyObject *__pyx_pf_22equivalent_polynomials_7Simplex_8__setstate_cython__(CYTHON_UNUSED
struct __pyx_obj_22equivalent_polynomials_Simplex *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) {
5205 PyObject *__pyx_r = NULL;
5206 __Pyx_RefNannyDeclarations
5207 PyObject *__pyx_t_1 = NULL;
5208 int __pyx_lineno = 0;
5209 const char *__pyx_filename = NULL;
5210 int __pyx_clineno = 0;
5211 __Pyx_RefNannySetupContext(
"__setstate_cython__", 0);
5218 __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__13, NULL);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4, __pyx_L1_error)
5219 __Pyx_GOTREF(__pyx_t_1);
5220 __Pyx_Raise(__pyx_t_1, 0, 0, 0);
5221 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
5222 __PYX_ERR(0, 4, __pyx_L1_error)
5233 __Pyx_XDECREF(__pyx_t_1);
5234 __Pyx_AddTraceback(
"equivalent_polynomials.Simplex.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
5236 __Pyx_XGIVEREF(__pyx_r);
5237 __Pyx_RefNannyFinishContext();
5249 static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew1(PyObject *__pyx_v_a) {
5250 PyObject *__pyx_r = NULL;
5251 __Pyx_RefNannyDeclarations
5252 PyObject *__pyx_t_1 = NULL;
5253 int __pyx_lineno = 0;
5254 const char *__pyx_filename = NULL;
5255 int __pyx_clineno = 0;
5256 __Pyx_RefNannySetupContext(
"PyArray_MultiIterNew1", 0);
5265 __Pyx_XDECREF(__pyx_r);
5266 __pyx_t_1 = PyArray_MultiIterNew(1, ((
void *)__pyx_v_a));
if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 736, __pyx_L1_error)
5267 __Pyx_GOTREF(__pyx_t_1);
5268 __pyx_r = __pyx_t_1;
5282 __Pyx_XDECREF(__pyx_t_1);
5283 __Pyx_AddTraceback(
"numpy.PyArray_MultiIterNew1", __pyx_clineno, __pyx_lineno, __pyx_filename);
5286 __Pyx_XGIVEREF(__pyx_r);
5287 __Pyx_RefNannyFinishContext();
5299 static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew2(PyObject *__pyx_v_a, PyObject *__pyx_v_b) {
5300 PyObject *__pyx_r = NULL;
5301 __Pyx_RefNannyDeclarations
5302 PyObject *__pyx_t_1 = NULL;
5303 int __pyx_lineno = 0;
5304 const char *__pyx_filename = NULL;
5305 int __pyx_clineno = 0;
5306 __Pyx_RefNannySetupContext(
"PyArray_MultiIterNew2", 0);
5315 __Pyx_XDECREF(__pyx_r);
5316 __pyx_t_1 = PyArray_MultiIterNew(2, ((
void *)__pyx_v_a), ((
void *)__pyx_v_b));
if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 739, __pyx_L1_error)
5317 __Pyx_GOTREF(__pyx_t_1);
5318 __pyx_r = __pyx_t_1;
5332 __Pyx_XDECREF(__pyx_t_1);
5333 __Pyx_AddTraceback(
"numpy.PyArray_MultiIterNew2", __pyx_clineno, __pyx_lineno, __pyx_filename);
5336 __Pyx_XGIVEREF(__pyx_r);
5337 __Pyx_RefNannyFinishContext();
5349 static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew3(PyObject *__pyx_v_a, PyObject *__pyx_v_b, PyObject *__pyx_v_c) {
5350 PyObject *__pyx_r = NULL;
5351 __Pyx_RefNannyDeclarations
5352 PyObject *__pyx_t_1 = NULL;
5353 int __pyx_lineno = 0;
5354 const char *__pyx_filename = NULL;
5355 int __pyx_clineno = 0;
5356 __Pyx_RefNannySetupContext(
"PyArray_MultiIterNew3", 0);
5365 __Pyx_XDECREF(__pyx_r);
5366 __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(2, 742, __pyx_L1_error)
5367 __Pyx_GOTREF(__pyx_t_1);
5368 __pyx_r = __pyx_t_1;
5382 __Pyx_XDECREF(__pyx_t_1);
5383 __Pyx_AddTraceback(
"numpy.PyArray_MultiIterNew3", __pyx_clineno, __pyx_lineno, __pyx_filename);
5386 __Pyx_XGIVEREF(__pyx_r);
5387 __Pyx_RefNannyFinishContext();
5399 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) {
5400 PyObject *__pyx_r = NULL;
5401 __Pyx_RefNannyDeclarations
5402 PyObject *__pyx_t_1 = NULL;
5403 int __pyx_lineno = 0;
5404 const char *__pyx_filename = NULL;
5405 int __pyx_clineno = 0;
5406 __Pyx_RefNannySetupContext(
"PyArray_MultiIterNew4", 0);
5415 __Pyx_XDECREF(__pyx_r);
5416 __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(2, 745, __pyx_L1_error)
5417 __Pyx_GOTREF(__pyx_t_1);
5418 __pyx_r = __pyx_t_1;
5432 __Pyx_XDECREF(__pyx_t_1);
5433 __Pyx_AddTraceback(
"numpy.PyArray_MultiIterNew4", __pyx_clineno, __pyx_lineno, __pyx_filename);
5436 __Pyx_XGIVEREF(__pyx_r);
5437 __Pyx_RefNannyFinishContext();
5449 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) {
5450 PyObject *__pyx_r = NULL;
5451 __Pyx_RefNannyDeclarations
5452 PyObject *__pyx_t_1 = NULL;
5453 int __pyx_lineno = 0;
5454 const char *__pyx_filename = NULL;
5455 int __pyx_clineno = 0;
5456 __Pyx_RefNannySetupContext(
"PyArray_MultiIterNew5", 0);
5465 __Pyx_XDECREF(__pyx_r);
5466 __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(2, 748, __pyx_L1_error)
5467 __Pyx_GOTREF(__pyx_t_1);
5468 __pyx_r = __pyx_t_1;
5482 __Pyx_XDECREF(__pyx_t_1);
5483 __Pyx_AddTraceback(
"numpy.PyArray_MultiIterNew5", __pyx_clineno, __pyx_lineno, __pyx_filename);
5486 __Pyx_XGIVEREF(__pyx_r);
5487 __Pyx_RefNannyFinishContext();
5499 static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyDataType_SHAPE(PyArray_Descr *__pyx_v_d) {
5500 PyObject *__pyx_r = NULL;
5501 __Pyx_RefNannyDeclarations
5503 __Pyx_RefNannySetupContext(
"PyDataType_SHAPE", 0);
5512 __pyx_t_1 = (PyDataType_HASSUBARRAY(__pyx_v_d) != 0);
5522 __Pyx_XDECREF(__pyx_r);
5523 __Pyx_INCREF(((PyObject*)__pyx_v_d->subarray->shape));
5524 __pyx_r = ((PyObject*)__pyx_v_d->subarray->shape);
5544 __Pyx_XDECREF(__pyx_r);
5545 __Pyx_INCREF(__pyx_empty_tuple);
5546 __pyx_r = __pyx_empty_tuple;
5560 __Pyx_XGIVEREF(__pyx_r);
5561 __Pyx_RefNannyFinishContext();
5573 static CYTHON_INLINE
void __pyx_f_5numpy_set_array_base(PyArrayObject *__pyx_v_arr, PyObject *__pyx_v_base) {
5574 __Pyx_RefNannyDeclarations
5575 __Pyx_RefNannySetupContext(
"set_array_base", 0);
5584 Py_INCREF(__pyx_v_base);
5593 (void)(PyArray_SetBaseObject(__pyx_v_arr, __pyx_v_base));
5604 __Pyx_RefNannyFinishContext();
5615 static CYTHON_INLINE PyObject *__pyx_f_5numpy_get_array_base(PyArrayObject *__pyx_v_arr) {
5616 PyObject *__pyx_v_base;
5617 PyObject *__pyx_r = NULL;
5618 __Pyx_RefNannyDeclarations
5620 __Pyx_RefNannySetupContext(
"get_array_base", 0);
5629 __pyx_v_base = PyArray_BASE(__pyx_v_arr);
5638 __pyx_t_1 = ((__pyx_v_base == NULL) != 0);
5648 __Pyx_XDECREF(__pyx_r);
5649 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
5668 __Pyx_XDECREF(__pyx_r);
5669 __Pyx_INCREF(((PyObject *)__pyx_v_base));
5670 __pyx_r = ((PyObject *)__pyx_v_base);
5683 __Pyx_XGIVEREF(__pyx_r);
5684 __Pyx_RefNannyFinishContext();
5696 static CYTHON_INLINE
int __pyx_f_5numpy_import_array(
void) {
5698 __Pyx_RefNannyDeclarations
5699 PyObject *__pyx_t_1 = NULL;
5700 PyObject *__pyx_t_2 = NULL;
5701 PyObject *__pyx_t_3 = NULL;
5703 PyObject *__pyx_t_5 = NULL;
5704 PyObject *__pyx_t_6 = NULL;
5705 PyObject *__pyx_t_7 = NULL;
5706 PyObject *__pyx_t_8 = NULL;
5707 int __pyx_lineno = 0;
5708 const char *__pyx_filename = NULL;
5709 int __pyx_clineno = 0;
5710 __Pyx_RefNannySetupContext(
"import_array", 0);
5720 __Pyx_PyThreadState_declare
5721 __Pyx_PyThreadState_assign
5722 __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
5723 __Pyx_XGOTREF(__pyx_t_1);
5724 __Pyx_XGOTREF(__pyx_t_2);
5725 __Pyx_XGOTREF(__pyx_t_3);
5735 __pyx_t_4 = _import_array();
if (unlikely(__pyx_t_4 == ((
int)-1))) __PYX_ERR(2, 943, __pyx_L3_error)
5745 __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
5746 __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
5747 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
5748 goto __pyx_L8_try_end;
5758 __pyx_t_4 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0])));
5760 __Pyx_AddTraceback(
"numpy.import_array", __pyx_clineno, __pyx_lineno, __pyx_filename);
5761 if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(2, 944, __pyx_L5_except_error)
5762 __Pyx_GOTREF(__pyx_t_5);
5763 __Pyx_GOTREF(__pyx_t_6);
5764 __Pyx_GOTREF(__pyx_t_7);
5773 __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_ImportError, __pyx_tuple__14, NULL);
if (unlikely(!__pyx_t_8)) __PYX_ERR(2, 945, __pyx_L5_except_error)
5774 __Pyx_GOTREF(__pyx_t_8);
5775 __Pyx_Raise(__pyx_t_8, 0, 0, 0);
5776 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
5777 __PYX_ERR(2, 945, __pyx_L5_except_error)
5779 goto __pyx_L5_except_error;
5780 __pyx_L5_except_error:;
5789 __Pyx_XGIVEREF(__pyx_t_1);
5790 __Pyx_XGIVEREF(__pyx_t_2);
5791 __Pyx_XGIVEREF(__pyx_t_3);
5792 __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
5793 goto __pyx_L1_error;
5809 __Pyx_XDECREF(__pyx_t_5);
5810 __Pyx_XDECREF(__pyx_t_6);
5811 __Pyx_XDECREF(__pyx_t_7);
5812 __Pyx_XDECREF(__pyx_t_8);
5813 __Pyx_AddTraceback(
"numpy.import_array", __pyx_clineno, __pyx_lineno, __pyx_filename);
5816 __Pyx_RefNannyFinishContext();
5828 static CYTHON_INLINE
int __pyx_f_5numpy_import_umath(
void) {
5830 __Pyx_RefNannyDeclarations
5831 PyObject *__pyx_t_1 = NULL;
5832 PyObject *__pyx_t_2 = NULL;
5833 PyObject *__pyx_t_3 = NULL;
5835 PyObject *__pyx_t_5 = NULL;
5836 PyObject *__pyx_t_6 = NULL;
5837 PyObject *__pyx_t_7 = NULL;
5838 PyObject *__pyx_t_8 = NULL;
5839 int __pyx_lineno = 0;
5840 const char *__pyx_filename = NULL;
5841 int __pyx_clineno = 0;
5842 __Pyx_RefNannySetupContext(
"import_umath", 0);
5852 __Pyx_PyThreadState_declare
5853 __Pyx_PyThreadState_assign
5854 __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
5855 __Pyx_XGOTREF(__pyx_t_1);
5856 __Pyx_XGOTREF(__pyx_t_2);
5857 __Pyx_XGOTREF(__pyx_t_3);
5867 __pyx_t_4 = _import_umath();
if (unlikely(__pyx_t_4 == ((
int)-1))) __PYX_ERR(2, 949, __pyx_L3_error)
5877 __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
5878 __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
5879 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
5880 goto __pyx_L8_try_end;
5890 __pyx_t_4 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0])));
5892 __Pyx_AddTraceback(
"numpy.import_umath", __pyx_clineno, __pyx_lineno, __pyx_filename);
5893 if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(2, 950, __pyx_L5_except_error)
5894 __Pyx_GOTREF(__pyx_t_5);
5895 __Pyx_GOTREF(__pyx_t_6);
5896 __Pyx_GOTREF(__pyx_t_7);
5905 __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_ImportError, __pyx_tuple__15, NULL);
if (unlikely(!__pyx_t_8)) __PYX_ERR(2, 951, __pyx_L5_except_error)
5906 __Pyx_GOTREF(__pyx_t_8);
5907 __Pyx_Raise(__pyx_t_8, 0, 0, 0);
5908 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
5909 __PYX_ERR(2, 951, __pyx_L5_except_error)
5911 goto __pyx_L5_except_error;
5912 __pyx_L5_except_error:;
5921 __Pyx_XGIVEREF(__pyx_t_1);
5922 __Pyx_XGIVEREF(__pyx_t_2);
5923 __Pyx_XGIVEREF(__pyx_t_3);
5924 __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
5925 goto __pyx_L1_error;
5941 __Pyx_XDECREF(__pyx_t_5);
5942 __Pyx_XDECREF(__pyx_t_6);
5943 __Pyx_XDECREF(__pyx_t_7);
5944 __Pyx_XDECREF(__pyx_t_8);
5945 __Pyx_AddTraceback(
"numpy.import_umath", __pyx_clineno, __pyx_lineno, __pyx_filename);
5948 __Pyx_RefNannyFinishContext();
5960 static CYTHON_INLINE
int __pyx_f_5numpy_import_ufunc(
void) {
5962 __Pyx_RefNannyDeclarations
5963 PyObject *__pyx_t_1 = NULL;
5964 PyObject *__pyx_t_2 = NULL;
5965 PyObject *__pyx_t_3 = NULL;
5967 PyObject *__pyx_t_5 = NULL;
5968 PyObject *__pyx_t_6 = NULL;
5969 PyObject *__pyx_t_7 = NULL;
5970 PyObject *__pyx_t_8 = NULL;
5971 int __pyx_lineno = 0;
5972 const char *__pyx_filename = NULL;
5973 int __pyx_clineno = 0;
5974 __Pyx_RefNannySetupContext(
"import_ufunc", 0);
5984 __Pyx_PyThreadState_declare
5985 __Pyx_PyThreadState_assign
5986 __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
5987 __Pyx_XGOTREF(__pyx_t_1);
5988 __Pyx_XGOTREF(__pyx_t_2);
5989 __Pyx_XGOTREF(__pyx_t_3);
5999 __pyx_t_4 = _import_umath();
if (unlikely(__pyx_t_4 == ((
int)-1))) __PYX_ERR(2, 955, __pyx_L3_error)
6009 __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
6010 __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
6011 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
6012 goto __pyx_L8_try_end;
6022 __pyx_t_4 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0])));
6024 __Pyx_AddTraceback(
"numpy.import_ufunc", __pyx_clineno, __pyx_lineno, __pyx_filename);
6025 if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(2, 956, __pyx_L5_except_error)
6026 __Pyx_GOTREF(__pyx_t_5);
6027 __Pyx_GOTREF(__pyx_t_6);
6028 __Pyx_GOTREF(__pyx_t_7);
6037 __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_ImportError, __pyx_tuple__15, NULL);
if (unlikely(!__pyx_t_8)) __PYX_ERR(2, 957, __pyx_L5_except_error)
6038 __Pyx_GOTREF(__pyx_t_8);
6039 __Pyx_Raise(__pyx_t_8, 0, 0, 0);
6040 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
6041 __PYX_ERR(2, 957, __pyx_L5_except_error)
6043 goto __pyx_L5_except_error;
6044 __pyx_L5_except_error:;
6053 __Pyx_XGIVEREF(__pyx_t_1);
6054 __Pyx_XGIVEREF(__pyx_t_2);
6055 __Pyx_XGIVEREF(__pyx_t_3);
6056 __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
6057 goto __pyx_L1_error;
6073 __Pyx_XDECREF(__pyx_t_5);
6074 __Pyx_XDECREF(__pyx_t_6);
6075 __Pyx_XDECREF(__pyx_t_7);
6076 __Pyx_XDECREF(__pyx_t_8);
6077 __Pyx_AddTraceback(
"numpy.import_ufunc", __pyx_clineno, __pyx_lineno, __pyx_filename);
6080 __Pyx_RefNannyFinishContext();
6092 static CYTHON_INLINE
int __pyx_f_5numpy_is_timedelta64_object(PyObject *__pyx_v_obj) {
6094 __Pyx_RefNannyDeclarations
6095 __Pyx_RefNannySetupContext(
"is_timedelta64_object", 0);
6104 __pyx_r = PyObject_TypeCheck(__pyx_v_obj, (&PyTimedeltaArrType_Type));
6117 __Pyx_RefNannyFinishContext();
6129 static CYTHON_INLINE
int __pyx_f_5numpy_is_datetime64_object(PyObject *__pyx_v_obj) {
6131 __Pyx_RefNannyDeclarations
6132 __Pyx_RefNannySetupContext(
"is_datetime64_object", 0);
6141 __pyx_r = PyObject_TypeCheck(__pyx_v_obj, (&PyDatetimeArrType_Type));
6154 __Pyx_RefNannyFinishContext();
6166 static CYTHON_INLINE npy_datetime __pyx_f_5numpy_get_datetime64_value(PyObject *__pyx_v_obj) {
6167 npy_datetime __pyx_r;
6176 __pyx_r = ((PyDatetimeScalarObject *)__pyx_v_obj)->obval;
6200 static CYTHON_INLINE npy_timedelta __pyx_f_5numpy_get_timedelta64_value(PyObject *__pyx_v_obj) {
6201 npy_timedelta __pyx_r;
6210 __pyx_r = ((PyTimedeltaScalarObject *)__pyx_v_obj)->obval;
6234 static CYTHON_INLINE NPY_DATETIMEUNIT __pyx_f_5numpy_get_datetime64_unit(PyObject *__pyx_v_obj) {
6235 NPY_DATETIMEUNIT __pyx_r;
6242 __pyx_r = ((NPY_DATETIMEUNIT)((PyDatetimeScalarObject *)__pyx_v_obj)->obmeta.base);
6267 static int __pyx_array___cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
6268 static int __pyx_array___cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
6269 PyObject *__pyx_v_shape = 0;
6270 Py_ssize_t __pyx_v_itemsize;
6271 PyObject *__pyx_v_format = 0;
6272 PyObject *__pyx_v_mode = 0;
6273 int __pyx_v_allocate_buffer;
6274 int __pyx_lineno = 0;
6275 const char *__pyx_filename = NULL;
6276 int __pyx_clineno = 0;
6278 __Pyx_RefNannyDeclarations
6279 __Pyx_RefNannySetupContext(
"__cinit__ (wrapper)", 0);
6281 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_shape,&__pyx_n_s_itemsize,&__pyx_n_s_format,&__pyx_n_s_mode,&__pyx_n_s_allocate_buffer,0};
6282 PyObject* values[5] = {0,0,0,0,0};
6283 values[3] = ((PyObject *)__pyx_n_s_c);
6284 if (unlikely(__pyx_kwds)) {
6286 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
6288 case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
6290 case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
6292 case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
6294 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
6296 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
6299 default:
goto __pyx_L5_argtuple_error;
6301 kw_args = PyDict_Size(__pyx_kwds);
6304 if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_shape)) != 0)) kw_args--;
6305 else goto __pyx_L5_argtuple_error;
6308 if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_itemsize)) != 0)) kw_args--;
6310 __Pyx_RaiseArgtupleInvalid(
"__cinit__", 0, 3, 5, 1); __PYX_ERR(0, 122, __pyx_L3_error)
6314 if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_format)) != 0)) kw_args--;
6316 __Pyx_RaiseArgtupleInvalid(
"__cinit__", 0, 3, 5, 2); __PYX_ERR(0, 122, __pyx_L3_error)
6321 PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_mode);
6322 if (value) { values[3] = value; kw_args--; }
6327 PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_allocate_buffer);
6328 if (value) { values[4] = value; kw_args--; }
6331 if (unlikely(kw_args > 0)) {
6332 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args,
"__cinit__") < 0)) __PYX_ERR(0, 122, __pyx_L3_error)
6335 switch (PyTuple_GET_SIZE(__pyx_args)) {
6336 case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
6338 case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
6340 case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
6341 values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
6342 values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
6344 default:
goto __pyx_L5_argtuple_error;
6347 __pyx_v_shape = ((PyObject*)values[0]);
6348 __pyx_v_itemsize = __Pyx_PyIndex_AsSsize_t(values[1]);
if (unlikely((__pyx_v_itemsize == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 122, __pyx_L3_error)
6349 __pyx_v_format = values[2];
6350 __pyx_v_mode = values[3];
6352 __pyx_v_allocate_buffer = __Pyx_PyObject_IsTrue(values[4]);
if (unlikely((__pyx_v_allocate_buffer == (
int)-1) && PyErr_Occurred())) __PYX_ERR(0, 123, __pyx_L3_error)
6362 __pyx_v_allocate_buffer = ((int)1);
6365 goto __pyx_L4_argument_unpacking_done;
6366 __pyx_L5_argtuple_error:;
6367 __Pyx_RaiseArgtupleInvalid(
"__cinit__", 0, 3, 5, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 122, __pyx_L3_error)
6369 __Pyx_AddTraceback(
"View.MemoryView.array.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
6370 __Pyx_RefNannyFinishContext();
6372 __pyx_L4_argument_unpacking_done:;
6373 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_shape), (&PyTuple_Type), 1,
"shape", 1))) __PYX_ERR(0, 122, __pyx_L1_error)
6374 if (unlikely(((PyObject *)__pyx_v_format) == Py_None)) {
6375 PyErr_Format(PyExc_TypeError,
"Argument '%.200s' must not be None",
"format"); __PYX_ERR(0, 122, __pyx_L1_error)
6377 __pyx_r = __pyx_array___pyx_pf_15View_dot_MemoryView_5array___cinit__(((
struct __pyx_array_obj *)__pyx_v_self), __pyx_v_shape, __pyx_v_itemsize, __pyx_v_format, __pyx_v_mode, __pyx_v_allocate_buffer);
6392 __Pyx_RefNannyFinishContext();
6396 static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array___cinit__(
struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_shape, Py_ssize_t __pyx_v_itemsize, PyObject *__pyx_v_format, PyObject *__pyx_v_mode,
int __pyx_v_allocate_buffer) {
6398 Py_ssize_t __pyx_v_i;
6399 Py_ssize_t __pyx_v_dim;
6400 PyObject **__pyx_v_p;
6403 __Pyx_RefNannyDeclarations
6404 Py_ssize_t __pyx_t_1;
6406 PyObject *__pyx_t_3 = NULL;
6408 PyObject *__pyx_t_5 = NULL;
6409 PyObject *__pyx_t_6 = NULL;
6412 Py_ssize_t __pyx_t_9;
6413 PyObject *__pyx_t_10 = NULL;
6414 Py_ssize_t __pyx_t_11;
6415 int __pyx_lineno = 0;
6416 const char *__pyx_filename = NULL;
6417 int __pyx_clineno = 0;
6418 __Pyx_RefNannySetupContext(
"__cinit__", 0);
6419 __Pyx_INCREF(__pyx_v_format);
6428 if (unlikely(__pyx_v_shape == Py_None)) {
6429 PyErr_SetString(PyExc_TypeError,
"object of type 'NoneType' has no len()");
6430 __PYX_ERR(0, 129, __pyx_L1_error)
6432 __pyx_t_1 = PyTuple_GET_SIZE(__pyx_v_shape);
if (unlikely(__pyx_t_1 == ((Py_ssize_t)-1))) __PYX_ERR(0, 129, __pyx_L1_error)
6433 __pyx_v_self->ndim = ((int)__pyx_t_1);
6442 __pyx_v_self->itemsize = __pyx_v_itemsize;
6451 __pyx_t_2 = ((!(__pyx_v_self->ndim != 0)) != 0);
6452 if (unlikely(__pyx_t_2)) {
6461 __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__16, NULL);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 133, __pyx_L1_error)
6462 __Pyx_GOTREF(__pyx_t_3);
6463 __Pyx_Raise(__pyx_t_3, 0, 0, 0);
6464 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
6465 __PYX_ERR(0, 133, __pyx_L1_error)
6483 __pyx_t_2 = ((__pyx_v_itemsize <= 0) != 0);
6484 if (unlikely(__pyx_t_2)) {
6493 __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__17, NULL);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 136, __pyx_L1_error)
6494 __Pyx_GOTREF(__pyx_t_3);
6495 __Pyx_Raise(__pyx_t_3, 0, 0, 0);
6496 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
6497 __PYX_ERR(0, 136, __pyx_L1_error)
6515 __pyx_t_2 = PyBytes_Check(__pyx_v_format);
6516 __pyx_t_4 = ((!(__pyx_t_2 != 0)) != 0);
6526 __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_format, __pyx_n_s_encode);
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 139, __pyx_L1_error)
6527 __Pyx_GOTREF(__pyx_t_5);
6529 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) {
6530 __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5);
6531 if (likely(__pyx_t_6)) {
6532 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_5);
6533 __Pyx_INCREF(__pyx_t_6);
6534 __Pyx_INCREF(
function);
6535 __Pyx_DECREF_SET(__pyx_t_5,
function);
6538 __pyx_t_3 = (__pyx_t_6) ? __Pyx_PyObject_Call2Args(__pyx_t_5, __pyx_t_6, __pyx_n_s_ASCII) : __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_n_s_ASCII);
6539 __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
6540 if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 139, __pyx_L1_error)
6541 __Pyx_GOTREF(__pyx_t_3);
6542 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
6543 __Pyx_DECREF_SET(__pyx_v_format, __pyx_t_3);
6562 if (!(likely(PyBytes_CheckExact(__pyx_v_format))||((__pyx_v_format) == Py_None)||(PyErr_Format(PyExc_TypeError,
"Expected %.16s, got %.200s",
"bytes", Py_TYPE(__pyx_v_format)->tp_name), 0))) __PYX_ERR(0, 140, __pyx_L1_error)
6563 __pyx_t_3 = __pyx_v_format;
6564 __Pyx_INCREF(__pyx_t_3);
6565 __Pyx_GIVEREF(__pyx_t_3);
6566 __Pyx_GOTREF(__pyx_v_self->_format);
6567 __Pyx_DECREF(__pyx_v_self->_format);
6568 __pyx_v_self->_format = ((PyObject*)__pyx_t_3);
6578 if (unlikely(__pyx_v_self->_format == Py_None)) {
6579 PyErr_SetString(PyExc_TypeError,
"expected bytes, NoneType found");
6580 __PYX_ERR(0, 141, __pyx_L1_error)
6582 __pyx_t_7 = __Pyx_PyBytes_AsWritableString(__pyx_v_self->_format);
if (unlikely((!__pyx_t_7) && PyErr_Occurred())) __PYX_ERR(0, 141, __pyx_L1_error)
6583 __pyx_v_self->format = __pyx_t_7;
6592 __pyx_v_self->_shape = ((Py_ssize_t *)PyObject_Malloc((((
sizeof(Py_ssize_t)) * __pyx_v_self->ndim) * 2)));
6601 __pyx_v_self->_strides = (__pyx_v_self->_shape + __pyx_v_self->ndim);
6610 __pyx_t_4 = ((!(__pyx_v_self->_shape != 0)) != 0);
6611 if (unlikely(__pyx_t_4)) {
6620 __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_MemoryError, __pyx_tuple__18, NULL);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 148, __pyx_L1_error)
6621 __Pyx_GOTREF(__pyx_t_3);
6622 __Pyx_Raise(__pyx_t_3, 0, 0, 0);
6623 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
6624 __PYX_ERR(0, 148, __pyx_L1_error)
6643 __pyx_t_3 = __pyx_v_shape; __Pyx_INCREF(__pyx_t_3); __pyx_t_1 = 0;
6645 if (__pyx_t_1 >= PyTuple_GET_SIZE(__pyx_t_3))
break;
6646 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
6647 __pyx_t_5 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_1); __Pyx_INCREF(__pyx_t_5); __pyx_t_1++;
if (unlikely(0 < 0)) __PYX_ERR(0, 151, __pyx_L1_error)
6649 __pyx_t_5 = PySequence_ITEM(__pyx_t_3, __pyx_t_1); __pyx_t_1++;
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 151, __pyx_L1_error)
6650 __Pyx_GOTREF(__pyx_t_5);
6652 __pyx_t_9 = __Pyx_PyIndex_AsSsize_t(__pyx_t_5);
if (unlikely((__pyx_t_9 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 151, __pyx_L1_error)
6653 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
6654 __pyx_v_dim = __pyx_t_9;
6655 __pyx_v_idx = __pyx_t_8;
6656 __pyx_t_8 = (__pyx_t_8 + 1);
6665 __pyx_t_4 = ((__pyx_v_dim <= 0) != 0);
6666 if (unlikely(__pyx_t_4)) {
6675 __pyx_t_5 = __Pyx_PyInt_From_int(__pyx_v_idx);
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 153, __pyx_L1_error)
6676 __Pyx_GOTREF(__pyx_t_5);
6677 __pyx_t_6 = PyInt_FromSsize_t(__pyx_v_dim);
if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 153, __pyx_L1_error)
6678 __Pyx_GOTREF(__pyx_t_6);
6679 __pyx_t_10 = PyTuple_New(2);
if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 153, __pyx_L1_error)
6680 __Pyx_GOTREF(__pyx_t_10);
6681 __Pyx_GIVEREF(__pyx_t_5);
6682 PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_5);
6683 __Pyx_GIVEREF(__pyx_t_6);
6684 PyTuple_SET_ITEM(__pyx_t_10, 1, __pyx_t_6);
6687 __pyx_t_6 = __Pyx_PyString_Format(__pyx_kp_s_Invalid_shape_in_axis_d_d, __pyx_t_10);
if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 153, __pyx_L1_error)
6688 __Pyx_GOTREF(__pyx_t_6);
6689 __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
6690 __pyx_t_10 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_6);
if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 153, __pyx_L1_error)
6691 __Pyx_GOTREF(__pyx_t_10);
6692 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
6693 __Pyx_Raise(__pyx_t_10, 0, 0, 0);
6694 __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
6695 __PYX_ERR(0, 153, __pyx_L1_error)
6713 (__pyx_v_self->_shape[__pyx_v_idx]) = __pyx_v_dim;
6723 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
6732 __pyx_t_4 = (__Pyx_PyString_Equals(__pyx_v_mode, __pyx_n_s_fortran, Py_EQ));
if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 157, __pyx_L1_error)
6742 __pyx_v_order =
'F';
6751 __Pyx_INCREF(__pyx_n_u_fortran);
6752 __Pyx_GIVEREF(__pyx_n_u_fortran);
6753 __Pyx_GOTREF(__pyx_v_self->mode);
6754 __Pyx_DECREF(__pyx_v_self->mode);
6755 __pyx_v_self->mode = __pyx_n_u_fortran;
6774 __pyx_t_4 = (__Pyx_PyString_Equals(__pyx_v_mode, __pyx_n_s_c, Py_EQ));
if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 160, __pyx_L1_error)
6775 if (likely(__pyx_t_4)) {
6784 __pyx_v_order =
'C';
6793 __Pyx_INCREF(__pyx_n_u_c);
6794 __Pyx_GIVEREF(__pyx_n_u_c);
6795 __Pyx_GOTREF(__pyx_v_self->mode);
6796 __Pyx_DECREF(__pyx_v_self->mode);
6797 __pyx_v_self->mode = __pyx_n_u_c;
6817 __pyx_t_3 = __Pyx_PyString_FormatSafe(__pyx_kp_s_Invalid_mode_expected_c_or_fortr, __pyx_v_mode);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 164, __pyx_L1_error)
6818 __Pyx_GOTREF(__pyx_t_3);
6819 __pyx_t_10 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_3);
if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 164, __pyx_L1_error)
6820 __Pyx_GOTREF(__pyx_t_10);
6821 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
6822 __Pyx_Raise(__pyx_t_10, 0, 0, 0);
6823 __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
6824 __PYX_ERR(0, 164, __pyx_L1_error)
6835 __pyx_v_self->len = __pyx_fill_contig_strides_array(__pyx_v_self->_shape, __pyx_v_self->_strides, __pyx_v_itemsize, __pyx_v_self->ndim, __pyx_v_order);
6844 __pyx_v_self->free_data = __pyx_v_allocate_buffer;
6853 __pyx_t_10 = PyObject_RichCompare(__pyx_v_format, __pyx_n_b_O, Py_EQ); __Pyx_XGOTREF(__pyx_t_10);
if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 170, __pyx_L1_error)
6854 __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_10);
if (unlikely((__pyx_t_4 == (
int)-1) && PyErr_Occurred())) __PYX_ERR(0, 170, __pyx_L1_error)
6855 __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
6856 __pyx_v_self->dtype_is_object = __pyx_t_4;
6865 __pyx_t_4 = (__pyx_v_allocate_buffer != 0);
6875 __pyx_v_self->data = ((
char *)malloc(__pyx_v_self->len));
6884 __pyx_t_4 = ((!(__pyx_v_self->data != 0)) != 0);
6885 if (unlikely(__pyx_t_4)) {
6894 __pyx_t_10 = __Pyx_PyObject_Call(__pyx_builtin_MemoryError, __pyx_tuple__19, NULL);
if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 176, __pyx_L1_error)
6895 __Pyx_GOTREF(__pyx_t_10);
6896 __Pyx_Raise(__pyx_t_10, 0, 0, 0);
6897 __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
6898 __PYX_ERR(0, 176, __pyx_L1_error)
6916 __pyx_t_4 = (__pyx_v_self->dtype_is_object != 0);
6926 __pyx_v_p = ((PyObject **)__pyx_v_self->data);
6935 if (unlikely(__pyx_v_itemsize == 0)) {
6936 PyErr_SetString(PyExc_ZeroDivisionError,
"integer division or modulo by zero");
6937 __PYX_ERR(0, 180, __pyx_L1_error)
6939 else if (
sizeof(Py_ssize_t) ==
sizeof(
long) && (!(((Py_ssize_t)-1) > 0)) && unlikely(__pyx_v_itemsize == (Py_ssize_t)-1) && unlikely(UNARY_NEG_WOULD_OVERFLOW(__pyx_v_self->len))) {
6940 PyErr_SetString(PyExc_OverflowError,
"value too large to perform division");
6941 __PYX_ERR(0, 180, __pyx_L1_error)
6943 __pyx_t_1 = __Pyx_div_Py_ssize_t(__pyx_v_self->len, __pyx_v_itemsize);
6944 __pyx_t_9 = __pyx_t_1;
6945 for (__pyx_t_11 = 0; __pyx_t_11 < __pyx_t_9; __pyx_t_11+=1) {
6946 __pyx_v_i = __pyx_t_11;
6955 (__pyx_v_p[__pyx_v_i]) = Py_None;
6997 __Pyx_XDECREF(__pyx_t_3);
6998 __Pyx_XDECREF(__pyx_t_5);
6999 __Pyx_XDECREF(__pyx_t_6);
7000 __Pyx_XDECREF(__pyx_t_10);
7001 __Pyx_AddTraceback(
"View.MemoryView.array.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
7004 __Pyx_XDECREF(__pyx_v_format);
7005 __Pyx_RefNannyFinishContext();
7018 static CYTHON_UNUSED
int __pyx_array_getbuffer(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info,
int __pyx_v_flags);
7019 static CYTHON_UNUSED
int __pyx_array_getbuffer(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info,
int __pyx_v_flags) {
7021 __Pyx_RefNannyDeclarations
7022 __Pyx_RefNannySetupContext(
"__getbuffer__ (wrapper)", 0);
7023 __pyx_r = __pyx_array___pyx_pf_15View_dot_MemoryView_5array_2__getbuffer__(((
struct __pyx_array_obj *)__pyx_v_self), ((Py_buffer *)__pyx_v_info), ((
int)__pyx_v_flags));
7026 __Pyx_RefNannyFinishContext();
7030 static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array_2__getbuffer__(
struct __pyx_array_obj *__pyx_v_self, Py_buffer *__pyx_v_info,
int __pyx_v_flags) {
7031 int __pyx_v_bufmode;
7033 __Pyx_RefNannyDeclarations
7036 PyObject *__pyx_t_3 = NULL;
7038 Py_ssize_t __pyx_t_5;
7040 Py_ssize_t *__pyx_t_7;
7041 int __pyx_lineno = 0;
7042 const char *__pyx_filename = NULL;
7043 int __pyx_clineno = 0;
7044 if (__pyx_v_info == NULL) {
7045 PyErr_SetString(PyExc_BufferError,
"PyObject_GetBuffer: view==NULL argument is obsolete");
7048 __Pyx_RefNannySetupContext(
"__getbuffer__", 0);
7049 __pyx_v_info->obj = Py_None; __Pyx_INCREF(Py_None);
7050 __Pyx_GIVEREF(__pyx_v_info->obj);
7059 __pyx_v_bufmode = -1;
7068 __pyx_t_1 = (__Pyx_PyUnicode_Equals(__pyx_v_self->mode, __pyx_n_u_c, Py_EQ));
if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 187, __pyx_L1_error)
7069 __pyx_t_2 = (__pyx_t_1 != 0);
7079 __pyx_v_bufmode = (PyBUF_C_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS);
7098 __pyx_t_2 = (__Pyx_PyUnicode_Equals(__pyx_v_self->mode, __pyx_n_u_fortran, Py_EQ));
if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 189, __pyx_L1_error)
7099 __pyx_t_1 = (__pyx_t_2 != 0);
7109 __pyx_v_bufmode = (PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS);
7128 __pyx_t_1 = ((!((__pyx_v_flags & __pyx_v_bufmode) != 0)) != 0);
7129 if (unlikely(__pyx_t_1)) {
7138 __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__20, NULL);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 192, __pyx_L1_error)
7139 __Pyx_GOTREF(__pyx_t_3);
7140 __Pyx_Raise(__pyx_t_3, 0, 0, 0);
7141 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
7142 __PYX_ERR(0, 192, __pyx_L1_error)
7160 __pyx_t_4 = __pyx_v_self->data;
7161 __pyx_v_info->buf = __pyx_t_4;
7170 __pyx_t_5 = __pyx_v_self->len;
7171 __pyx_v_info->len = __pyx_t_5;
7180 __pyx_t_6 = __pyx_v_self->ndim;
7181 __pyx_v_info->ndim = __pyx_t_6;
7190 __pyx_t_7 = __pyx_v_self->_shape;
7191 __pyx_v_info->shape = __pyx_t_7;
7200 __pyx_t_7 = __pyx_v_self->_strides;
7201 __pyx_v_info->strides = __pyx_t_7;
7210 __pyx_v_info->suboffsets = NULL;
7219 __pyx_t_5 = __pyx_v_self->itemsize;
7220 __pyx_v_info->itemsize = __pyx_t_5;
7229 __pyx_v_info->readonly = 0;
7238 __pyx_t_1 = ((__pyx_v_flags & PyBUF_FORMAT) != 0);
7248 __pyx_t_4 = __pyx_v_self->format;
7249 __pyx_v_info->format = __pyx_t_4;
7269 __pyx_v_info->format = NULL;
7280 __Pyx_INCREF(((PyObject *)__pyx_v_self));
7281 __Pyx_GIVEREF(((PyObject *)__pyx_v_self));
7282 __Pyx_GOTREF(__pyx_v_info->obj);
7283 __Pyx_DECREF(__pyx_v_info->obj);
7284 __pyx_v_info->obj = ((PyObject *)__pyx_v_self);
7298 __Pyx_XDECREF(__pyx_t_3);
7299 __Pyx_AddTraceback(
"View.MemoryView.array.__getbuffer__", __pyx_clineno, __pyx_lineno, __pyx_filename);
7301 if (__pyx_v_info->obj != NULL) {
7302 __Pyx_GOTREF(__pyx_v_info->obj);
7303 __Pyx_DECREF(__pyx_v_info->obj); __pyx_v_info->obj = 0;
7307 if (__pyx_v_info->obj == Py_None) {
7308 __Pyx_GOTREF(__pyx_v_info->obj);
7309 __Pyx_DECREF(__pyx_v_info->obj); __pyx_v_info->obj = 0;
7312 __Pyx_RefNannyFinishContext();
7325 static void __pyx_array___dealloc__(PyObject *__pyx_v_self);
7326 static void __pyx_array___dealloc__(PyObject *__pyx_v_self) {
7327 __Pyx_RefNannyDeclarations
7328 __Pyx_RefNannySetupContext(
"__dealloc__ (wrapper)", 0);
7329 __pyx_array___pyx_pf_15View_dot_MemoryView_5array_4__dealloc__(((
struct __pyx_array_obj *)__pyx_v_self));
7332 __Pyx_RefNannyFinishContext();
7335 static void __pyx_array___pyx_pf_15View_dot_MemoryView_5array_4__dealloc__(
struct __pyx_array_obj *__pyx_v_self) {
7336 __Pyx_RefNannyDeclarations
7338 __Pyx_RefNannySetupContext(
"__dealloc__", 0);
7347 __pyx_t_1 = ((__pyx_v_self->callback_free_data != NULL) != 0);
7357 __pyx_v_self->callback_free_data(__pyx_v_self->data);
7376 __pyx_t_1 = (__pyx_v_self->free_data != 0);
7386 __pyx_t_1 = (__pyx_v_self->dtype_is_object != 0);
7396 __pyx_memoryview_refcount_objects_in_slice(__pyx_v_self->data, __pyx_v_self->_shape, __pyx_v_self->_strides, __pyx_v_self->ndim, 0);
7414 free(__pyx_v_self->data);
7433 PyObject_Free(__pyx_v_self->_shape);
7444 __Pyx_RefNannyFinishContext();
7456 static PyObject *__pyx_pw_15View_dot_MemoryView_5array_7memview_1__get__(PyObject *__pyx_v_self);
7457 static PyObject *__pyx_pw_15View_dot_MemoryView_5array_7memview_1__get__(PyObject *__pyx_v_self) {
7458 PyObject *__pyx_r = 0;
7459 __Pyx_RefNannyDeclarations
7460 __Pyx_RefNannySetupContext(
"__get__ (wrapper)", 0);
7461 __pyx_r = __pyx_pf_15View_dot_MemoryView_5array_7memview___get__(((
struct __pyx_array_obj *)__pyx_v_self));
7464 __Pyx_RefNannyFinishContext();
7468 static PyObject *__pyx_pf_15View_dot_MemoryView_5array_7memview___get__(
struct __pyx_array_obj *__pyx_v_self) {
7469 PyObject *__pyx_r = NULL;
7470 __Pyx_RefNannyDeclarations
7471 PyObject *__pyx_t_1 = NULL;
7472 int __pyx_lineno = 0;
7473 const char *__pyx_filename = NULL;
7474 int __pyx_clineno = 0;
7475 __Pyx_RefNannySetupContext(
"__get__", 0);
7484 __Pyx_XDECREF(__pyx_r);
7485 __pyx_t_1 = ((
struct __pyx_vtabstruct_array *)__pyx_v_self->__pyx_vtab)->get_memview(__pyx_v_self);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 223, __pyx_L1_error)
7486 __Pyx_GOTREF(__pyx_t_1);
7487 __pyx_r = __pyx_t_1;
7501 __Pyx_XDECREF(__pyx_t_1);
7502 __Pyx_AddTraceback(
"View.MemoryView.array.memview.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
7505 __Pyx_XGIVEREF(__pyx_r);
7506 __Pyx_RefNannyFinishContext();
7518 static PyObject *__pyx_array_get_memview(
struct __pyx_array_obj *__pyx_v_self) {
7520 PyObject *__pyx_r = NULL;
7521 __Pyx_RefNannyDeclarations
7522 PyObject *__pyx_t_1 = NULL;
7523 PyObject *__pyx_t_2 = NULL;
7524 PyObject *__pyx_t_3 = NULL;
7525 int __pyx_lineno = 0;
7526 const char *__pyx_filename = NULL;
7527 int __pyx_clineno = 0;
7528 __Pyx_RefNannySetupContext(
"get_memview", 0);
7537 __pyx_v_flags = ((PyBUF_ANY_CONTIGUOUS | PyBUF_FORMAT) | PyBUF_WRITABLE);
7546 __Pyx_XDECREF(__pyx_r);
7547 __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_flags);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 228, __pyx_L1_error)
7548 __Pyx_GOTREF(__pyx_t_1);
7549 __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_v_self->dtype_is_object);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 228, __pyx_L1_error)
7550 __Pyx_GOTREF(__pyx_t_2);
7551 __pyx_t_3 = PyTuple_New(3);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 228, __pyx_L1_error)
7552 __Pyx_GOTREF(__pyx_t_3);
7553 __Pyx_INCREF(((PyObject *)__pyx_v_self));
7554 __Pyx_GIVEREF(((PyObject *)__pyx_v_self));
7555 PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_v_self));
7556 __Pyx_GIVEREF(__pyx_t_1);
7557 PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_1);
7558 __Pyx_GIVEREF(__pyx_t_2);
7559 PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_t_2);
7562 __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_memoryview_type), __pyx_t_3, NULL);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 228, __pyx_L1_error)
7563 __Pyx_GOTREF(__pyx_t_2);
7564 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
7565 __pyx_r = __pyx_t_2;
7579 __Pyx_XDECREF(__pyx_t_1);
7580 __Pyx_XDECREF(__pyx_t_2);
7581 __Pyx_XDECREF(__pyx_t_3);
7582 __Pyx_AddTraceback(
"View.MemoryView.array.get_memview", __pyx_clineno, __pyx_lineno, __pyx_filename);
7585 __Pyx_XGIVEREF(__pyx_r);
7586 __Pyx_RefNannyFinishContext();
7599 static Py_ssize_t __pyx_array___len__(PyObject *__pyx_v_self);
7600 static Py_ssize_t __pyx_array___len__(PyObject *__pyx_v_self) {
7602 __Pyx_RefNannyDeclarations
7603 __Pyx_RefNannySetupContext(
"__len__ (wrapper)", 0);
7604 __pyx_r = __pyx_array___pyx_pf_15View_dot_MemoryView_5array_6__len__(((
struct __pyx_array_obj *)__pyx_v_self));
7607 __Pyx_RefNannyFinishContext();
7611 static Py_ssize_t __pyx_array___pyx_pf_15View_dot_MemoryView_5array_6__len__(
struct __pyx_array_obj *__pyx_v_self) {
7613 __Pyx_RefNannyDeclarations
7614 __Pyx_RefNannySetupContext(
"__len__", 0);
7623 __pyx_r = (__pyx_v_self->_shape[0]);
7636 __Pyx_RefNannyFinishContext();
7649 static PyObject *__pyx_array___getattr__(PyObject *__pyx_v_self, PyObject *__pyx_v_attr);
7650 static PyObject *__pyx_array___getattr__(PyObject *__pyx_v_self, PyObject *__pyx_v_attr) {
7651 PyObject *__pyx_r = 0;
7652 __Pyx_RefNannyDeclarations
7653 __Pyx_RefNannySetupContext(
"__getattr__ (wrapper)", 0);
7654 __pyx_r = __pyx_array___pyx_pf_15View_dot_MemoryView_5array_8__getattr__(((
struct __pyx_array_obj *)__pyx_v_self), ((PyObject *)__pyx_v_attr));
7657 __Pyx_RefNannyFinishContext();
7661 static PyObject *__pyx_array___pyx_pf_15View_dot_MemoryView_5array_8__getattr__(
struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_attr) {
7662 PyObject *__pyx_r = NULL;
7663 __Pyx_RefNannyDeclarations
7664 PyObject *__pyx_t_1 = NULL;
7665 PyObject *__pyx_t_2 = NULL;
7666 int __pyx_lineno = 0;
7667 const char *__pyx_filename = NULL;
7668 int __pyx_clineno = 0;
7669 __Pyx_RefNannySetupContext(
"__getattr__", 0);
7678 __Pyx_XDECREF(__pyx_r);
7679 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_memview);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 234, __pyx_L1_error)
7680 __Pyx_GOTREF(__pyx_t_1);
7681 __pyx_t_2 = __Pyx_GetAttr(__pyx_t_1, __pyx_v_attr);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 234, __pyx_L1_error)
7682 __Pyx_GOTREF(__pyx_t_2);
7683 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
7684 __pyx_r = __pyx_t_2;
7698 __Pyx_XDECREF(__pyx_t_1);
7699 __Pyx_XDECREF(__pyx_t_2);
7700 __Pyx_AddTraceback(
"View.MemoryView.array.__getattr__", __pyx_clineno, __pyx_lineno, __pyx_filename);
7703 __Pyx_XGIVEREF(__pyx_r);
7704 __Pyx_RefNannyFinishContext();
7717 static PyObject *__pyx_array___getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_item);
7718 static PyObject *__pyx_array___getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_item) {
7719 PyObject *__pyx_r = 0;
7720 __Pyx_RefNannyDeclarations
7721 __Pyx_RefNannySetupContext(
"__getitem__ (wrapper)", 0);
7722 __pyx_r = __pyx_array___pyx_pf_15View_dot_MemoryView_5array_10__getitem__(((
struct __pyx_array_obj *)__pyx_v_self), ((PyObject *)__pyx_v_item));
7725 __Pyx_RefNannyFinishContext();
7729 static PyObject *__pyx_array___pyx_pf_15View_dot_MemoryView_5array_10__getitem__(
struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_item) {
7730 PyObject *__pyx_r = NULL;
7731 __Pyx_RefNannyDeclarations
7732 PyObject *__pyx_t_1 = NULL;
7733 PyObject *__pyx_t_2 = NULL;
7734 int __pyx_lineno = 0;
7735 const char *__pyx_filename = NULL;
7736 int __pyx_clineno = 0;
7737 __Pyx_RefNannySetupContext(
"__getitem__", 0);
7746 __Pyx_XDECREF(__pyx_r);
7747 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_memview);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 237, __pyx_L1_error)
7748 __Pyx_GOTREF(__pyx_t_1);
7749 __pyx_t_2 = __Pyx_PyObject_GetItem(__pyx_t_1, __pyx_v_item);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 237, __pyx_L1_error)
7750 __Pyx_GOTREF(__pyx_t_2);
7751 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
7752 __pyx_r = __pyx_t_2;
7766 __Pyx_XDECREF(__pyx_t_1);
7767 __Pyx_XDECREF(__pyx_t_2);
7768 __Pyx_AddTraceback(
"View.MemoryView.array.__getitem__", __pyx_clineno, __pyx_lineno, __pyx_filename);
7771 __Pyx_XGIVEREF(__pyx_r);
7772 __Pyx_RefNannyFinishContext();
7785 static int __pyx_array___setitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_item, PyObject *__pyx_v_value);
7786 static int __pyx_array___setitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_item, PyObject *__pyx_v_value) {
7788 __Pyx_RefNannyDeclarations
7789 __Pyx_RefNannySetupContext(
"__setitem__ (wrapper)", 0);
7790 __pyx_r = __pyx_array___pyx_pf_15View_dot_MemoryView_5array_12__setitem__(((
struct __pyx_array_obj *)__pyx_v_self), ((PyObject *)__pyx_v_item), ((PyObject *)__pyx_v_value));
7793 __Pyx_RefNannyFinishContext();
7797 static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array_12__setitem__(
struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_item, PyObject *__pyx_v_value) {
7799 __Pyx_RefNannyDeclarations
7800 PyObject *__pyx_t_1 = NULL;
7801 int __pyx_lineno = 0;
7802 const char *__pyx_filename = NULL;
7803 int __pyx_clineno = 0;
7804 __Pyx_RefNannySetupContext(
"__setitem__", 0);
7813 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_memview);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 240, __pyx_L1_error)
7814 __Pyx_GOTREF(__pyx_t_1);
7815 if (unlikely(PyObject_SetItem(__pyx_t_1, __pyx_v_item, __pyx_v_value) < 0)) __PYX_ERR(0, 240, __pyx_L1_error)
7816 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
7830 __Pyx_XDECREF(__pyx_t_1);
7831 __Pyx_AddTraceback(
"View.MemoryView.array.__setitem__", __pyx_clineno, __pyx_lineno, __pyx_filename);
7834 __Pyx_RefNannyFinishContext();
7845 static PyObject *__pyx_pw___pyx_array_1__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused);
7846 static PyObject *__pyx_pw___pyx_array_1__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
7847 PyObject *__pyx_r = 0;
7848 __Pyx_RefNannyDeclarations
7849 __Pyx_RefNannySetupContext(
"__reduce_cython__ (wrapper)", 0);
7850 __pyx_r = __pyx_pf___pyx_array___reduce_cython__(((
struct __pyx_array_obj *)__pyx_v_self));
7853 __Pyx_RefNannyFinishContext();
7857 static PyObject *__pyx_pf___pyx_array___reduce_cython__(CYTHON_UNUSED
struct __pyx_array_obj *__pyx_v_self) {
7858 PyObject *__pyx_r = NULL;
7859 __Pyx_RefNannyDeclarations
7860 PyObject *__pyx_t_1 = NULL;
7861 int __pyx_lineno = 0;
7862 const char *__pyx_filename = NULL;
7863 int __pyx_clineno = 0;
7864 __Pyx_RefNannySetupContext(
"__reduce_cython__", 0);
7872 __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__21, NULL);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2, __pyx_L1_error)
7873 __Pyx_GOTREF(__pyx_t_1);
7874 __Pyx_Raise(__pyx_t_1, 0, 0, 0);
7875 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
7876 __PYX_ERR(0, 2, __pyx_L1_error)
7886 __Pyx_XDECREF(__pyx_t_1);
7887 __Pyx_AddTraceback(
"View.MemoryView.array.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
7889 __Pyx_XGIVEREF(__pyx_r);
7890 __Pyx_RefNannyFinishContext();
7902 static PyObject *__pyx_pw___pyx_array_3__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state);
7903 static PyObject *__pyx_pw___pyx_array_3__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
7904 PyObject *__pyx_r = 0;
7905 __Pyx_RefNannyDeclarations
7906 __Pyx_RefNannySetupContext(
"__setstate_cython__ (wrapper)", 0);
7907 __pyx_r = __pyx_pf___pyx_array_2__setstate_cython__(((
struct __pyx_array_obj *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state));
7910 __Pyx_RefNannyFinishContext();
7914 static PyObject *__pyx_pf___pyx_array_2__setstate_cython__(CYTHON_UNUSED
struct __pyx_array_obj *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) {
7915 PyObject *__pyx_r = NULL;
7916 __Pyx_RefNannyDeclarations
7917 PyObject *__pyx_t_1 = NULL;
7918 int __pyx_lineno = 0;
7919 const char *__pyx_filename = NULL;
7920 int __pyx_clineno = 0;
7921 __Pyx_RefNannySetupContext(
"__setstate_cython__", 0);
7928 __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__22, NULL);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4, __pyx_L1_error)
7929 __Pyx_GOTREF(__pyx_t_1);
7930 __Pyx_Raise(__pyx_t_1, 0, 0, 0);
7931 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
7932 __PYX_ERR(0, 4, __pyx_L1_error)
7943 __Pyx_XDECREF(__pyx_t_1);
7944 __Pyx_AddTraceback(
"View.MemoryView.array.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
7946 __Pyx_XGIVEREF(__pyx_r);
7947 __Pyx_RefNannyFinishContext();
7959 static struct __pyx_array_obj *__pyx_array_new(PyObject *__pyx_v_shape, Py_ssize_t __pyx_v_itemsize,
char *__pyx_v_format,
char *__pyx_v_mode,
char *__pyx_v_buf) {
7960 struct __pyx_array_obj *__pyx_v_result = 0;
7961 struct __pyx_array_obj *__pyx_r = NULL;
7962 __Pyx_RefNannyDeclarations
7964 PyObject *__pyx_t_2 = NULL;
7965 PyObject *__pyx_t_3 = NULL;
7966 PyObject *__pyx_t_4 = NULL;
7967 PyObject *__pyx_t_5 = NULL;
7968 int __pyx_lineno = 0;
7969 const char *__pyx_filename = NULL;
7970 int __pyx_clineno = 0;
7971 __Pyx_RefNannySetupContext(
"array_cwrapper", 0);
7980 __pyx_t_1 = ((__pyx_v_buf == NULL) != 0);
7990 __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_itemsize);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 249, __pyx_L1_error)
7991 __Pyx_GOTREF(__pyx_t_2);
7992 __pyx_t_3 = __Pyx_PyBytes_FromString(__pyx_v_format);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 249, __pyx_L1_error)
7993 __Pyx_GOTREF(__pyx_t_3);
7994 __pyx_t_4 = __Pyx_decode_c_string(__pyx_v_mode, 0, strlen(__pyx_v_mode), NULL, NULL, PyUnicode_DecodeASCII);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 249, __pyx_L1_error)
7995 __Pyx_GOTREF(__pyx_t_4);
7996 __pyx_t_5 = PyTuple_New(4);
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 249, __pyx_L1_error)
7997 __Pyx_GOTREF(__pyx_t_5);
7998 __Pyx_INCREF(__pyx_v_shape);
7999 __Pyx_GIVEREF(__pyx_v_shape);
8000 PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_v_shape);
8001 __Pyx_GIVEREF(__pyx_t_2);
8002 PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_2);
8003 __Pyx_GIVEREF(__pyx_t_3);
8004 PyTuple_SET_ITEM(__pyx_t_5, 2, __pyx_t_3);
8005 __Pyx_GIVEREF(__pyx_t_4);
8006 PyTuple_SET_ITEM(__pyx_t_5, 3, __pyx_t_4);
8010 __pyx_t_4 = __Pyx_PyObject_Call(((PyObject *)__pyx_array_type), __pyx_t_5, NULL);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 249, __pyx_L1_error)
8011 __Pyx_GOTREF(__pyx_t_4);
8012 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
8013 __pyx_v_result = ((
struct __pyx_array_obj *)__pyx_t_4);
8034 __pyx_t_4 = PyInt_FromSsize_t(__pyx_v_itemsize);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 251, __pyx_L1_error)
8035 __Pyx_GOTREF(__pyx_t_4);
8036 __pyx_t_5 = __Pyx_PyBytes_FromString(__pyx_v_format);
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 251, __pyx_L1_error)
8037 __Pyx_GOTREF(__pyx_t_5);
8038 __pyx_t_3 = __Pyx_decode_c_string(__pyx_v_mode, 0, strlen(__pyx_v_mode), NULL, NULL, PyUnicode_DecodeASCII);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 251, __pyx_L1_error)
8039 __Pyx_GOTREF(__pyx_t_3);
8040 __pyx_t_2 = PyTuple_New(4);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 251, __pyx_L1_error)
8041 __Pyx_GOTREF(__pyx_t_2);
8042 __Pyx_INCREF(__pyx_v_shape);
8043 __Pyx_GIVEREF(__pyx_v_shape);
8044 PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_shape);
8045 __Pyx_GIVEREF(__pyx_t_4);
8046 PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_4);
8047 __Pyx_GIVEREF(__pyx_t_5);
8048 PyTuple_SET_ITEM(__pyx_t_2, 2, __pyx_t_5);
8049 __Pyx_GIVEREF(__pyx_t_3);
8050 PyTuple_SET_ITEM(__pyx_t_2, 3, __pyx_t_3);
8062 __pyx_t_3 = __Pyx_PyDict_NewPresized(1);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 252, __pyx_L1_error)
8063 __Pyx_GOTREF(__pyx_t_3);
8064 if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_allocate_buffer, Py_False) < 0) __PYX_ERR(0, 252, __pyx_L1_error)
8073 __pyx_t_5 = __Pyx_PyObject_Call(((PyObject *)__pyx_array_type), __pyx_t_2, __pyx_t_3);
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 251, __pyx_L1_error)
8074 __Pyx_GOTREF(__pyx_t_5);
8075 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
8076 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
8077 __pyx_v_result = ((
struct __pyx_array_obj *)__pyx_t_5);
8087 __pyx_v_result->data = __pyx_v_buf;
8098 __Pyx_XDECREF(((PyObject *)__pyx_r));
8099 __Pyx_INCREF(((PyObject *)__pyx_v_result));
8100 __pyx_r = __pyx_v_result;
8113 __Pyx_XDECREF(__pyx_t_2);
8114 __Pyx_XDECREF(__pyx_t_3);
8115 __Pyx_XDECREF(__pyx_t_4);
8116 __Pyx_XDECREF(__pyx_t_5);
8117 __Pyx_AddTraceback(
"View.MemoryView.array_cwrapper", __pyx_clineno, __pyx_lineno, __pyx_filename);
8120 __Pyx_XDECREF((PyObject *)__pyx_v_result);
8121 __Pyx_XGIVEREF((PyObject *)__pyx_r);
8122 __Pyx_RefNannyFinishContext();
8135 static int __pyx_MemviewEnum___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
8136 static int __pyx_MemviewEnum___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
8137 PyObject *__pyx_v_name = 0;
8138 int __pyx_lineno = 0;
8139 const char *__pyx_filename = NULL;
8140 int __pyx_clineno = 0;
8142 __Pyx_RefNannyDeclarations
8143 __Pyx_RefNannySetupContext(
"__init__ (wrapper)", 0);
8145 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_name,0};
8146 PyObject* values[1] = {0};
8147 if (unlikely(__pyx_kwds)) {
8149 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
8151 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
8154 default:
goto __pyx_L5_argtuple_error;
8156 kw_args = PyDict_Size(__pyx_kwds);
8159 if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_name)) != 0)) kw_args--;
8160 else goto __pyx_L5_argtuple_error;
8162 if (unlikely(kw_args > 0)) {
8163 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args,
"__init__") < 0)) __PYX_ERR(0, 281, __pyx_L3_error)
8165 }
else if (PyTuple_GET_SIZE(__pyx_args) != 1) {
8166 goto __pyx_L5_argtuple_error;
8168 values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
8170 __pyx_v_name = values[0];
8172 goto __pyx_L4_argument_unpacking_done;
8173 __pyx_L5_argtuple_error:;
8174 __Pyx_RaiseArgtupleInvalid(
"__init__", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 281, __pyx_L3_error)
8176 __Pyx_AddTraceback(
"View.MemoryView.Enum.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
8177 __Pyx_RefNannyFinishContext();
8179 __pyx_L4_argument_unpacking_done:;
8180 __pyx_r = __pyx_MemviewEnum___pyx_pf_15View_dot_MemoryView_4Enum___init__(((
struct __pyx_MemviewEnum_obj *)__pyx_v_self), __pyx_v_name);
8183 __Pyx_RefNannyFinishContext();
8187 static int __pyx_MemviewEnum___pyx_pf_15View_dot_MemoryView_4Enum___init__(
struct __pyx_MemviewEnum_obj *__pyx_v_self, PyObject *__pyx_v_name) {
8189 __Pyx_RefNannyDeclarations
8190 __Pyx_RefNannySetupContext(
"__init__", 0);
8199 __Pyx_INCREF(__pyx_v_name);
8200 __Pyx_GIVEREF(__pyx_v_name);
8201 __Pyx_GOTREF(__pyx_v_self->name);
8202 __Pyx_DECREF(__pyx_v_self->name);
8203 __pyx_v_self->name = __pyx_v_name;
8215 __Pyx_RefNannyFinishContext();
8228 static PyObject *__pyx_MemviewEnum___repr__(PyObject *__pyx_v_self);
8229 static PyObject *__pyx_MemviewEnum___repr__(PyObject *__pyx_v_self) {
8230 PyObject *__pyx_r = 0;
8231 __Pyx_RefNannyDeclarations
8232 __Pyx_RefNannySetupContext(
"__repr__ (wrapper)", 0);
8233 __pyx_r = __pyx_MemviewEnum___pyx_pf_15View_dot_MemoryView_4Enum_2__repr__(((
struct __pyx_MemviewEnum_obj *)__pyx_v_self));
8236 __Pyx_RefNannyFinishContext();
8240 static PyObject *__pyx_MemviewEnum___pyx_pf_15View_dot_MemoryView_4Enum_2__repr__(
struct __pyx_MemviewEnum_obj *__pyx_v_self) {
8241 PyObject *__pyx_r = NULL;
8242 __Pyx_RefNannyDeclarations
8243 __Pyx_RefNannySetupContext(
"__repr__", 0);
8252 __Pyx_XDECREF(__pyx_r);
8253 __Pyx_INCREF(__pyx_v_self->name);
8254 __pyx_r = __pyx_v_self->name;
8267 __Pyx_XGIVEREF(__pyx_r);
8268 __Pyx_RefNannyFinishContext();
8279 static PyObject *__pyx_pw___pyx_MemviewEnum_1__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused);
8280 static PyObject *__pyx_pw___pyx_MemviewEnum_1__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
8281 PyObject *__pyx_r = 0;
8282 __Pyx_RefNannyDeclarations
8283 __Pyx_RefNannySetupContext(
"__reduce_cython__ (wrapper)", 0);
8284 __pyx_r = __pyx_pf___pyx_MemviewEnum___reduce_cython__(((
struct __pyx_MemviewEnum_obj *)__pyx_v_self));
8287 __Pyx_RefNannyFinishContext();
8291 static PyObject *__pyx_pf___pyx_MemviewEnum___reduce_cython__(
struct __pyx_MemviewEnum_obj *__pyx_v_self) {
8292 PyObject *__pyx_v_state = 0;
8293 PyObject *__pyx_v__dict = 0;
8294 int __pyx_v_use_setstate;
8295 PyObject *__pyx_r = NULL;
8296 __Pyx_RefNannyDeclarations
8297 PyObject *__pyx_t_1 = NULL;
8300 PyObject *__pyx_t_4 = NULL;
8301 PyObject *__pyx_t_5 = NULL;
8302 int __pyx_lineno = 0;
8303 const char *__pyx_filename = NULL;
8304 int __pyx_clineno = 0;
8305 __Pyx_RefNannySetupContext(
"__reduce_cython__", 0);
8314 __pyx_t_1 = PyTuple_New(1);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 5, __pyx_L1_error)
8315 __Pyx_GOTREF(__pyx_t_1);
8316 __Pyx_INCREF(__pyx_v_self->name);
8317 __Pyx_GIVEREF(__pyx_v_self->name);
8318 PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_self->name);
8319 __pyx_v_state = ((PyObject*)__pyx_t_1);
8329 __pyx_t_1 = __Pyx_GetAttr3(((PyObject *)__pyx_v_self), __pyx_n_s_dict, Py_None);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 6, __pyx_L1_error)
8330 __Pyx_GOTREF(__pyx_t_1);
8331 __pyx_v__dict = __pyx_t_1;
8341 __pyx_t_2 = (__pyx_v__dict != Py_None);
8342 __pyx_t_3 = (__pyx_t_2 != 0);
8352 __pyx_t_1 = PyTuple_New(1);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 8, __pyx_L1_error)
8353 __Pyx_GOTREF(__pyx_t_1);
8354 __Pyx_INCREF(__pyx_v__dict);
8355 __Pyx_GIVEREF(__pyx_v__dict);
8356 PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v__dict);
8357 __pyx_t_4 = PyNumber_InPlaceAdd(__pyx_v_state, __pyx_t_1);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 8, __pyx_L1_error)
8358 __Pyx_GOTREF(__pyx_t_4);
8359 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
8360 __Pyx_DECREF_SET(__pyx_v_state, ((PyObject*)__pyx_t_4));
8370 __pyx_v_use_setstate = 1;
8390 __pyx_t_3 = (__pyx_v_self->name != Py_None);
8391 __pyx_v_use_setstate = __pyx_t_3;
8402 __pyx_t_3 = (__pyx_v_use_setstate != 0);
8412 __Pyx_XDECREF(__pyx_r);
8413 __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_pyx_unpickle_Enum);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 13, __pyx_L1_error)
8414 __Pyx_GOTREF(__pyx_t_4);
8415 __pyx_t_1 = PyTuple_New(3);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 13, __pyx_L1_error)
8416 __Pyx_GOTREF(__pyx_t_1);
8417 __Pyx_INCREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
8418 __Pyx_GIVEREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
8419 PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
8420 __Pyx_INCREF(__pyx_int_184977713);
8421 __Pyx_GIVEREF(__pyx_int_184977713);
8422 PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_int_184977713);
8423 __Pyx_INCREF(Py_None);
8424 __Pyx_GIVEREF(Py_None);
8425 PyTuple_SET_ITEM(__pyx_t_1, 2, Py_None);
8426 __pyx_t_5 = PyTuple_New(3);
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 13, __pyx_L1_error)
8427 __Pyx_GOTREF(__pyx_t_5);
8428 __Pyx_GIVEREF(__pyx_t_4);
8429 PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4);
8430 __Pyx_GIVEREF(__pyx_t_1);
8431 PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_1);
8432 __Pyx_INCREF(__pyx_v_state);
8433 __Pyx_GIVEREF(__pyx_v_state);
8434 PyTuple_SET_ITEM(__pyx_t_5, 2, __pyx_v_state);
8437 __pyx_r = __pyx_t_5;
8458 __Pyx_XDECREF(__pyx_r);
8459 __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_pyx_unpickle_Enum);
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 15, __pyx_L1_error)
8460 __Pyx_GOTREF(__pyx_t_5);
8461 __pyx_t_1 = PyTuple_New(3);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 15, __pyx_L1_error)
8462 __Pyx_GOTREF(__pyx_t_1);
8463 __Pyx_INCREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
8464 __Pyx_GIVEREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
8465 PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
8466 __Pyx_INCREF(__pyx_int_184977713);
8467 __Pyx_GIVEREF(__pyx_int_184977713);
8468 PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_int_184977713);
8469 __Pyx_INCREF(__pyx_v_state);
8470 __Pyx_GIVEREF(__pyx_v_state);
8471 PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_v_state);
8472 __pyx_t_4 = PyTuple_New(2);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 15, __pyx_L1_error)
8473 __Pyx_GOTREF(__pyx_t_4);
8474 __Pyx_GIVEREF(__pyx_t_5);
8475 PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_5);
8476 __Pyx_GIVEREF(__pyx_t_1);
8477 PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_1);
8480 __pyx_r = __pyx_t_4;
8493 __Pyx_XDECREF(__pyx_t_1);
8494 __Pyx_XDECREF(__pyx_t_4);
8495 __Pyx_XDECREF(__pyx_t_5);
8496 __Pyx_AddTraceback(
"View.MemoryView.Enum.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
8499 __Pyx_XDECREF(__pyx_v_state);
8500 __Pyx_XDECREF(__pyx_v__dict);
8501 __Pyx_XGIVEREF(__pyx_r);
8502 __Pyx_RefNannyFinishContext();
8514 static PyObject *__pyx_pw___pyx_MemviewEnum_3__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state);
8515 static PyObject *__pyx_pw___pyx_MemviewEnum_3__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
8516 PyObject *__pyx_r = 0;
8517 __Pyx_RefNannyDeclarations
8518 __Pyx_RefNannySetupContext(
"__setstate_cython__ (wrapper)", 0);
8519 __pyx_r = __pyx_pf___pyx_MemviewEnum_2__setstate_cython__(((
struct __pyx_MemviewEnum_obj *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state));
8522 __Pyx_RefNannyFinishContext();
8526 static PyObject *__pyx_pf___pyx_MemviewEnum_2__setstate_cython__(
struct __pyx_MemviewEnum_obj *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
8527 PyObject *__pyx_r = NULL;
8528 __Pyx_RefNannyDeclarations
8529 PyObject *__pyx_t_1 = NULL;
8530 int __pyx_lineno = 0;
8531 const char *__pyx_filename = NULL;
8532 int __pyx_clineno = 0;
8533 __Pyx_RefNannySetupContext(
"__setstate_cython__", 0);
8540 if (!(likely(PyTuple_CheckExact(__pyx_v___pyx_state))||((__pyx_v___pyx_state) == Py_None)||(PyErr_Format(PyExc_TypeError,
"Expected %.16s, got %.200s",
"tuple", Py_TYPE(__pyx_v___pyx_state)->tp_name), 0))) __PYX_ERR(0, 17, __pyx_L1_error)
8541 __pyx_t_1 = __pyx_unpickle_Enum__set_state(__pyx_v_self, ((PyObject*)__pyx_v___pyx_state));
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 17, __pyx_L1_error)
8542 __Pyx_GOTREF(__pyx_t_1);
8543 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
8553 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
8556 __Pyx_XDECREF(__pyx_t_1);
8557 __Pyx_AddTraceback(
"View.MemoryView.Enum.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
8560 __Pyx_XGIVEREF(__pyx_r);
8561 __Pyx_RefNannyFinishContext();
8573 static void *__pyx_align_pointer(
void *__pyx_v_memory,
size_t __pyx_v_alignment) {
8574 Py_intptr_t __pyx_v_aligned_p;
8575 size_t __pyx_v_offset;
8586 __pyx_v_aligned_p = ((Py_intptr_t)__pyx_v_memory);
8595 __pyx_v_offset = (__pyx_v_aligned_p % __pyx_v_alignment);
8604 __pyx_t_1 = ((__pyx_v_offset > 0) != 0);
8614 __pyx_v_aligned_p = (__pyx_v_aligned_p + (__pyx_v_alignment - __pyx_v_offset));
8632 __pyx_r = ((
void *)__pyx_v_aligned_p);
8657 static int __pyx_memoryview___cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
8658 static int __pyx_memoryview___cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
8659 PyObject *__pyx_v_obj = 0;
8661 int __pyx_v_dtype_is_object;
8662 int __pyx_lineno = 0;
8663 const char *__pyx_filename = NULL;
8664 int __pyx_clineno = 0;
8666 __Pyx_RefNannyDeclarations
8667 __Pyx_RefNannySetupContext(
"__cinit__ (wrapper)", 0);
8669 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_obj,&__pyx_n_s_flags,&__pyx_n_s_dtype_is_object,0};
8670 PyObject* values[3] = {0,0,0};
8671 if (unlikely(__pyx_kwds)) {
8673 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
8675 case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
8677 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
8679 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
8682 default:
goto __pyx_L5_argtuple_error;
8684 kw_args = PyDict_Size(__pyx_kwds);
8687 if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_obj)) != 0)) kw_args--;
8688 else goto __pyx_L5_argtuple_error;
8691 if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_flags)) != 0)) kw_args--;
8693 __Pyx_RaiseArgtupleInvalid(
"__cinit__", 0, 2, 3, 1); __PYX_ERR(0, 345, __pyx_L3_error)
8698 PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_dtype_is_object);
8699 if (value) { values[2] = value; kw_args--; }
8702 if (unlikely(kw_args > 0)) {
8703 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args,
"__cinit__") < 0)) __PYX_ERR(0, 345, __pyx_L3_error)
8706 switch (PyTuple_GET_SIZE(__pyx_args)) {
8707 case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
8709 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
8710 values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
8712 default:
goto __pyx_L5_argtuple_error;
8715 __pyx_v_obj = values[0];
8716 __pyx_v_flags = __Pyx_PyInt_As_int(values[1]);
if (unlikely((__pyx_v_flags == (
int)-1) && PyErr_Occurred())) __PYX_ERR(0, 345, __pyx_L3_error)
8718 __pyx_v_dtype_is_object = __Pyx_PyObject_IsTrue(values[2]);
if (unlikely((__pyx_v_dtype_is_object == (
int)-1) && PyErr_Occurred())) __PYX_ERR(0, 345, __pyx_L3_error)
8720 __pyx_v_dtype_is_object = ((int)0);
8723 goto __pyx_L4_argument_unpacking_done;
8724 __pyx_L5_argtuple_error:;
8725 __Pyx_RaiseArgtupleInvalid(
"__cinit__", 0, 2, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 345, __pyx_L3_error)
8727 __Pyx_AddTraceback(
"View.MemoryView.memoryview.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
8728 __Pyx_RefNannyFinishContext();
8730 __pyx_L4_argument_unpacking_done:;
8731 __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview___cinit__(((
struct __pyx_memoryview_obj *)__pyx_v_self), __pyx_v_obj, __pyx_v_flags, __pyx_v_dtype_is_object);
8734 __Pyx_RefNannyFinishContext();
8738 static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview___cinit__(
struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_obj,
int __pyx_v_flags,
int __pyx_v_dtype_is_object) {
8740 __Pyx_RefNannyDeclarations
8745 int __pyx_lineno = 0;
8746 const char *__pyx_filename = NULL;
8747 int __pyx_clineno = 0;
8748 __Pyx_RefNannySetupContext(
"__cinit__", 0);
8757 __Pyx_INCREF(__pyx_v_obj);
8758 __Pyx_GIVEREF(__pyx_v_obj);
8759 __Pyx_GOTREF(__pyx_v_self->obj);
8760 __Pyx_DECREF(__pyx_v_self->obj);
8761 __pyx_v_self->obj = __pyx_v_obj;
8770 __pyx_v_self->flags = __pyx_v_flags;
8779 __pyx_t_2 = (((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))) == ((PyObject *)__pyx_memoryview_type));
8780 __pyx_t_3 = (__pyx_t_2 != 0);
8783 __pyx_t_1 = __pyx_t_3;
8784 goto __pyx_L4_bool_binop_done;
8786 __pyx_t_3 = (__pyx_v_obj != Py_None);
8787 __pyx_t_2 = (__pyx_t_3 != 0);
8788 __pyx_t_1 = __pyx_t_2;
8789 __pyx_L4_bool_binop_done:;
8799 __pyx_t_4 = __Pyx_GetBuffer(__pyx_v_obj, (&__pyx_v_self->view), __pyx_v_flags);
if (unlikely(__pyx_t_4 == ((
int)-1))) __PYX_ERR(0, 349, __pyx_L1_error)
8808 __pyx_t_1 = ((((PyObject *)__pyx_v_self->view.obj) == NULL) != 0);
8818 ((Py_buffer *)(&__pyx_v_self->view))->obj = Py_None;
8854 __pyx_t_1 = ((__pyx_memoryview_thread_locks_used < 8) != 0);
8864 __pyx_v_self->lock = (__pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used]);
8873 __pyx_memoryview_thread_locks_used = (__pyx_memoryview_thread_locks_used + 1);
8891 __pyx_t_1 = ((__pyx_v_self->lock == NULL) != 0);
8901 __pyx_v_self->lock = PyThread_allocate_lock();
8910 __pyx_t_1 = ((__pyx_v_self->lock == NULL) != 0);
8911 if (unlikely(__pyx_t_1)) {
8920 PyErr_NoMemory(); __PYX_ERR(0, 361, __pyx_L1_error)
8947 __pyx_t_1 = ((__pyx_v_flags & PyBUF_FORMAT) != 0);
8957 __pyx_t_2 = (((__pyx_v_self->view.format[0]) ==
'O') != 0);
8960 __pyx_t_1 = __pyx_t_2;
8961 goto __pyx_L11_bool_binop_done;
8963 __pyx_t_2 = (((__pyx_v_self->view.format[1]) ==
'\x00') != 0);
8964 __pyx_t_1 = __pyx_t_2;
8965 __pyx_L11_bool_binop_done:;
8966 __pyx_v_self->dtype_is_object = __pyx_t_1;
8986 __pyx_v_self->dtype_is_object = __pyx_v_dtype_is_object;
8997 __pyx_v_self->acquisition_count_aligned_p = ((__pyx_atomic_int *)__pyx_align_pointer(((
void *)(&(__pyx_v_self->acquisition_count[0]))), (
sizeof(__pyx_atomic_int))));
9006 __pyx_v_self->typeinfo = NULL;
9020 __Pyx_AddTraceback(
"View.MemoryView.memoryview.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
9023 __Pyx_RefNannyFinishContext();
9036 static void __pyx_memoryview___dealloc__(PyObject *__pyx_v_self);
9037 static void __pyx_memoryview___dealloc__(PyObject *__pyx_v_self) {
9038 __Pyx_RefNannyDeclarations
9039 __Pyx_RefNannySetupContext(
"__dealloc__ (wrapper)", 0);
9040 __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_2__dealloc__(((
struct __pyx_memoryview_obj *)__pyx_v_self));
9043 __Pyx_RefNannyFinishContext();
9046 static void __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_2__dealloc__(
struct __pyx_memoryview_obj *__pyx_v_self) {
9048 __Pyx_RefNannyDeclarations
9054 PyThread_type_lock __pyx_t_6;
9055 PyThread_type_lock __pyx_t_7;
9056 __Pyx_RefNannySetupContext(
"__dealloc__", 0);
9065 __pyx_t_1 = (__pyx_v_self->obj != Py_None);
9066 __pyx_t_2 = (__pyx_t_1 != 0);
9076 __Pyx_ReleaseBuffer((&__pyx_v_self->view));
9095 __pyx_t_2 = ((((Py_buffer *)(&__pyx_v_self->view))->obj == Py_None) != 0);
9105 ((Py_buffer *)(&__pyx_v_self->view))->obj = NULL;
9133 __pyx_t_2 = ((__pyx_v_self->lock != NULL) != 0);
9143 __pyx_t_3 = __pyx_memoryview_thread_locks_used;
9144 __pyx_t_4 = __pyx_t_3;
9145 for (__pyx_t_5 = 0; __pyx_t_5 < __pyx_t_4; __pyx_t_5+=1) {
9146 __pyx_v_i = __pyx_t_5;
9155 __pyx_t_2 = (((__pyx_memoryview_thread_locks[__pyx_v_i]) == __pyx_v_self->lock) != 0);
9165 __pyx_memoryview_thread_locks_used = (__pyx_memoryview_thread_locks_used - 1);
9174 __pyx_t_2 = ((__pyx_v_i != __pyx_memoryview_thread_locks_used) != 0);
9184 __pyx_t_6 = (__pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used]);
9185 __pyx_t_7 = (__pyx_memoryview_thread_locks[__pyx_v_i]);
9194 (__pyx_memoryview_thread_locks[__pyx_v_i]) = __pyx_t_6;
9195 (__pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used]) = __pyx_t_7;
9213 goto __pyx_L6_break;
9233 PyThread_free_lock(__pyx_v_self->lock);
9255 __Pyx_RefNannyFinishContext();
9266 static char *__pyx_memoryview_get_item_pointer(
struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index) {
9267 Py_ssize_t __pyx_v_dim;
9268 char *__pyx_v_itemp;
9269 PyObject *__pyx_v_idx = NULL;
9271 __Pyx_RefNannyDeclarations
9272 Py_ssize_t __pyx_t_1;
9273 PyObject *__pyx_t_2 = NULL;
9274 Py_ssize_t __pyx_t_3;
9275 PyObject *(*__pyx_t_4)(PyObject *);
9276 PyObject *__pyx_t_5 = NULL;
9277 Py_ssize_t __pyx_t_6;
9279 int __pyx_lineno = 0;
9280 const char *__pyx_filename = NULL;
9281 int __pyx_clineno = 0;
9282 __Pyx_RefNannySetupContext(
"get_item_pointer", 0);
9291 __pyx_v_itemp = ((
char *)__pyx_v_self->view.buf);
9301 if (likely(PyList_CheckExact(__pyx_v_index)) || PyTuple_CheckExact(__pyx_v_index)) {
9302 __pyx_t_2 = __pyx_v_index; __Pyx_INCREF(__pyx_t_2); __pyx_t_3 = 0;
9305 __pyx_t_3 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_v_index);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 397, __pyx_L1_error)
9306 __Pyx_GOTREF(__pyx_t_2);
9307 __pyx_t_4 = Py_TYPE(__pyx_t_2)->tp_iternext;
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 397, __pyx_L1_error)
9310 if (likely(!__pyx_t_4)) {
9311 if (likely(PyList_CheckExact(__pyx_t_2))) {
9312 if (__pyx_t_3 >= PyList_GET_SIZE(__pyx_t_2))
break;
9313 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
9314 __pyx_t_5 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_5); __pyx_t_3++;
if (unlikely(0 < 0)) __PYX_ERR(0, 397, __pyx_L1_error)
9316 __pyx_t_5 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++;
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 397, __pyx_L1_error)
9317 __Pyx_GOTREF(__pyx_t_5);
9320 if (__pyx_t_3 >= PyTuple_GET_SIZE(__pyx_t_2))
break;
9321 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
9322 __pyx_t_5 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_5); __pyx_t_3++;
if (unlikely(0 < 0)) __PYX_ERR(0, 397, __pyx_L1_error)
9324 __pyx_t_5 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++;
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 397, __pyx_L1_error)
9325 __Pyx_GOTREF(__pyx_t_5);
9329 __pyx_t_5 = __pyx_t_4(__pyx_t_2);
9330 if (unlikely(!__pyx_t_5)) {
9331 PyObject* exc_type = PyErr_Occurred();
9333 if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
9334 else __PYX_ERR(0, 397, __pyx_L1_error)
9338 __Pyx_GOTREF(__pyx_t_5);
9340 __Pyx_XDECREF_SET(__pyx_v_idx, __pyx_t_5);
9342 __pyx_v_dim = __pyx_t_1;
9343 __pyx_t_1 = (__pyx_t_1 + 1);
9352 __pyx_t_6 = __Pyx_PyIndex_AsSsize_t(__pyx_v_idx);
if (unlikely((__pyx_t_6 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 398, __pyx_L1_error)
9353 __pyx_t_7 = __pyx_pybuffer_index((&__pyx_v_self->view), __pyx_v_itemp, __pyx_t_6, __pyx_v_dim);
if (unlikely(__pyx_t_7 == ((
char *)NULL))) __PYX_ERR(0, 398, __pyx_L1_error)
9354 __pyx_v_itemp = __pyx_t_7;
9364 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
9373 __pyx_r = __pyx_v_itemp;
9386 __Pyx_XDECREF(__pyx_t_2);
9387 __Pyx_XDECREF(__pyx_t_5);
9388 __Pyx_AddTraceback(
"View.MemoryView.memoryview.get_item_pointer", __pyx_clineno, __pyx_lineno, __pyx_filename);
9391 __Pyx_XDECREF(__pyx_v_idx);
9392 __Pyx_RefNannyFinishContext();
9405 static PyObject *__pyx_memoryview___getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_index);
9406 static PyObject *__pyx_memoryview___getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_index) {
9407 PyObject *__pyx_r = 0;
9408 __Pyx_RefNannyDeclarations
9409 __Pyx_RefNannySetupContext(
"__getitem__ (wrapper)", 0);
9410 __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_4__getitem__(((
struct __pyx_memoryview_obj *)__pyx_v_self), ((PyObject *)__pyx_v_index));
9413 __Pyx_RefNannyFinishContext();
9417 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_4__getitem__(
struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index) {
9418 PyObject *__pyx_v_have_slices = NULL;
9419 PyObject *__pyx_v_indices = NULL;
9420 char *__pyx_v_itemp;
9421 PyObject *__pyx_r = NULL;
9422 __Pyx_RefNannyDeclarations
9425 PyObject *__pyx_t_3 = NULL;
9426 PyObject *__pyx_t_4 = NULL;
9427 PyObject *__pyx_t_5 = NULL;
9429 int __pyx_lineno = 0;
9430 const char *__pyx_filename = NULL;
9431 int __pyx_clineno = 0;
9432 __Pyx_RefNannySetupContext(
"__getitem__", 0);
9441 __pyx_t_1 = (__pyx_v_index == __pyx_builtin_Ellipsis);
9442 __pyx_t_2 = (__pyx_t_1 != 0);
9452 __Pyx_XDECREF(__pyx_r);
9453 __Pyx_INCREF(((PyObject *)__pyx_v_self));
9454 __pyx_r = ((PyObject *)__pyx_v_self);
9473 __pyx_t_3 = _unellipsify(__pyx_v_index, __pyx_v_self->view.ndim);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 407, __pyx_L1_error)
9474 __Pyx_GOTREF(__pyx_t_3);
9475 if (likely(__pyx_t_3 != Py_None)) {
9476 PyObject* sequence = __pyx_t_3;
9477 Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
9478 if (unlikely(size != 2)) {
9479 if (size > 2) __Pyx_RaiseTooManyValuesError(2);
9480 else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
9481 __PYX_ERR(0, 407, __pyx_L1_error)
9483 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
9484 __pyx_t_4 = PyTuple_GET_ITEM(sequence, 0);
9485 __pyx_t_5 = PyTuple_GET_ITEM(sequence, 1);
9486 __Pyx_INCREF(__pyx_t_4);
9487 __Pyx_INCREF(__pyx_t_5);
9489 __pyx_t_4 = PySequence_ITEM(sequence, 0);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 407, __pyx_L1_error)
9490 __Pyx_GOTREF(__pyx_t_4);
9491 __pyx_t_5 = PySequence_ITEM(sequence, 1);
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 407, __pyx_L1_error)
9492 __Pyx_GOTREF(__pyx_t_5);
9494 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
9496 __Pyx_RaiseNoneNotIterableError(); __PYX_ERR(0, 407, __pyx_L1_error)
9498 __pyx_v_have_slices = __pyx_t_4;
9500 __pyx_v_indices = __pyx_t_5;
9510 __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_have_slices);
if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 410, __pyx_L1_error)
9520 __Pyx_XDECREF(__pyx_r);
9521 __pyx_t_3 = ((PyObject *)__pyx_memview_slice(__pyx_v_self, __pyx_v_indices));
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 411, __pyx_L1_error)
9522 __Pyx_GOTREF(__pyx_t_3);
9523 __pyx_r = __pyx_t_3;
9544 __pyx_t_6 = ((
struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->get_item_pointer(__pyx_v_self, __pyx_v_indices);
if (unlikely(__pyx_t_6 == ((
char *)NULL))) __PYX_ERR(0, 413, __pyx_L1_error)
9545 __pyx_v_itemp = __pyx_t_6;
9554 __Pyx_XDECREF(__pyx_r);
9555 __pyx_t_3 = ((
struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->convert_item_to_object(__pyx_v_self, __pyx_v_itemp);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 414, __pyx_L1_error)
9556 __Pyx_GOTREF(__pyx_t_3);
9557 __pyx_r = __pyx_t_3;
9572 __Pyx_XDECREF(__pyx_t_3);
9573 __Pyx_XDECREF(__pyx_t_4);
9574 __Pyx_XDECREF(__pyx_t_5);
9575 __Pyx_AddTraceback(
"View.MemoryView.memoryview.__getitem__", __pyx_clineno, __pyx_lineno, __pyx_filename);
9578 __Pyx_XDECREF(__pyx_v_have_slices);
9579 __Pyx_XDECREF(__pyx_v_indices);
9580 __Pyx_XGIVEREF(__pyx_r);
9581 __Pyx_RefNannyFinishContext();
9594 static int __pyx_memoryview___setitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_index, PyObject *__pyx_v_value);
9595 static int __pyx_memoryview___setitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_index, PyObject *__pyx_v_value) {
9597 __Pyx_RefNannyDeclarations
9598 __Pyx_RefNannySetupContext(
"__setitem__ (wrapper)", 0);
9599 __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_6__setitem__(((
struct __pyx_memoryview_obj *)__pyx_v_self), ((PyObject *)__pyx_v_index), ((PyObject *)__pyx_v_value));
9602 __Pyx_RefNannyFinishContext();
9606 static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_6__setitem__(
struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index, PyObject *__pyx_v_value) {
9607 PyObject *__pyx_v_have_slices = NULL;
9608 PyObject *__pyx_v_obj = NULL;
9610 __Pyx_RefNannyDeclarations
9612 PyObject *__pyx_t_2 = NULL;
9613 PyObject *__pyx_t_3 = NULL;
9614 PyObject *__pyx_t_4 = NULL;
9615 int __pyx_lineno = 0;
9616 const char *__pyx_filename = NULL;
9617 int __pyx_clineno = 0;
9618 __Pyx_RefNannySetupContext(
"__setitem__", 0);
9619 __Pyx_INCREF(__pyx_v_index);
9628 __pyx_t_1 = (__pyx_v_self->view.readonly != 0);
9629 if (unlikely(__pyx_t_1)) {
9638 __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__23, NULL);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 418, __pyx_L1_error)
9639 __Pyx_GOTREF(__pyx_t_2);
9640 __Pyx_Raise(__pyx_t_2, 0, 0, 0);
9641 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
9642 __PYX_ERR(0, 418, __pyx_L1_error)
9660 __pyx_t_2 = _unellipsify(__pyx_v_index, __pyx_v_self->view.ndim);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 420, __pyx_L1_error)
9661 __Pyx_GOTREF(__pyx_t_2);
9662 if (likely(__pyx_t_2 != Py_None)) {
9663 PyObject* sequence = __pyx_t_2;
9664 Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
9665 if (unlikely(size != 2)) {
9666 if (size > 2) __Pyx_RaiseTooManyValuesError(2);
9667 else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
9668 __PYX_ERR(0, 420, __pyx_L1_error)
9670 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
9671 __pyx_t_3 = PyTuple_GET_ITEM(sequence, 0);
9672 __pyx_t_4 = PyTuple_GET_ITEM(sequence, 1);
9673 __Pyx_INCREF(__pyx_t_3);
9674 __Pyx_INCREF(__pyx_t_4);
9676 __pyx_t_3 = PySequence_ITEM(sequence, 0);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 420, __pyx_L1_error)
9677 __Pyx_GOTREF(__pyx_t_3);
9678 __pyx_t_4 = PySequence_ITEM(sequence, 1);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 420, __pyx_L1_error)
9679 __Pyx_GOTREF(__pyx_t_4);
9681 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
9683 __Pyx_RaiseNoneNotIterableError(); __PYX_ERR(0, 420, __pyx_L1_error)
9685 __pyx_v_have_slices = __pyx_t_3;
9687 __Pyx_DECREF_SET(__pyx_v_index, __pyx_t_4);
9697 __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_have_slices);
if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 422, __pyx_L1_error)
9707 __pyx_t_2 = ((
struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->is_slice(__pyx_v_self, __pyx_v_value);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 423, __pyx_L1_error)
9708 __Pyx_GOTREF(__pyx_t_2);
9709 __pyx_v_obj = __pyx_t_2;
9719 __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_obj);
if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 424, __pyx_L1_error)
9729 __pyx_t_2 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_self), __pyx_v_index);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 425, __pyx_L1_error)
9730 __Pyx_GOTREF(__pyx_t_2);
9731 __pyx_t_4 = ((
struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->setitem_slice_assignment(__pyx_v_self, __pyx_t_2, __pyx_v_obj);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 425, __pyx_L1_error)
9732 __Pyx_GOTREF(__pyx_t_4);
9733 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
9734 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
9754 __pyx_t_4 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_self), __pyx_v_index);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 427, __pyx_L1_error)
9755 __Pyx_GOTREF(__pyx_t_4);
9756 if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_memoryview_type))))) __PYX_ERR(0, 427, __pyx_L1_error)
9757 __pyx_t_2 = ((
struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->setitem_slice_assign_scalar(__pyx_v_self, ((
struct __pyx_memoryview_obj *)__pyx_t_4), __pyx_v_value);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 427, __pyx_L1_error)
9758 __Pyx_GOTREF(__pyx_t_2);
9759 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
9760 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
9782 __pyx_t_2 = ((
struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->setitem_indexed(__pyx_v_self, __pyx_v_index, __pyx_v_value);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 429, __pyx_L1_error)
9783 __Pyx_GOTREF(__pyx_t_2);
9784 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
9800 __Pyx_XDECREF(__pyx_t_2);
9801 __Pyx_XDECREF(__pyx_t_3);
9802 __Pyx_XDECREF(__pyx_t_4);
9803 __Pyx_AddTraceback(
"View.MemoryView.memoryview.__setitem__", __pyx_clineno, __pyx_lineno, __pyx_filename);
9806 __Pyx_XDECREF(__pyx_v_have_slices);
9807 __Pyx_XDECREF(__pyx_v_obj);
9808 __Pyx_XDECREF(__pyx_v_index);
9809 __Pyx_RefNannyFinishContext();
9821 static PyObject *__pyx_memoryview_is_slice(
struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_obj) {
9822 PyObject *__pyx_r = NULL;
9823 __Pyx_RefNannyDeclarations
9826 PyObject *__pyx_t_3 = NULL;
9827 PyObject *__pyx_t_4 = NULL;
9828 PyObject *__pyx_t_5 = NULL;
9829 PyObject *__pyx_t_6 = NULL;
9830 PyObject *__pyx_t_7 = NULL;
9831 PyObject *__pyx_t_8 = NULL;
9833 int __pyx_lineno = 0;
9834 const char *__pyx_filename = NULL;
9835 int __pyx_clineno = 0;
9836 __Pyx_RefNannySetupContext(
"is_slice", 0);
9837 __Pyx_INCREF(__pyx_v_obj);
9846 __pyx_t_1 = __Pyx_TypeCheck(__pyx_v_obj, __pyx_memoryview_type);
9847 __pyx_t_2 = ((!(__pyx_t_1 != 0)) != 0);
9858 __Pyx_PyThreadState_declare
9859 __Pyx_PyThreadState_assign
9860 __Pyx_ExceptionSave(&__pyx_t_3, &__pyx_t_4, &__pyx_t_5);
9861 __Pyx_XGOTREF(__pyx_t_3);
9862 __Pyx_XGOTREF(__pyx_t_4);
9863 __Pyx_XGOTREF(__pyx_t_5);
9873 __pyx_t_6 = __Pyx_PyInt_From_int(((__pyx_v_self->flags & (~PyBUF_WRITABLE)) | PyBUF_ANY_CONTIGUOUS));
if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 434, __pyx_L4_error)
9874 __Pyx_GOTREF(__pyx_t_6);
9883 __pyx_t_7 = __Pyx_PyBool_FromLong(__pyx_v_self->dtype_is_object);
if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 435, __pyx_L4_error)
9884 __Pyx_GOTREF(__pyx_t_7);
9893 __pyx_t_8 = PyTuple_New(3);
if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 434, __pyx_L4_error)
9894 __Pyx_GOTREF(__pyx_t_8);
9895 __Pyx_INCREF(__pyx_v_obj);
9896 __Pyx_GIVEREF(__pyx_v_obj);
9897 PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_v_obj);
9898 __Pyx_GIVEREF(__pyx_t_6);
9899 PyTuple_SET_ITEM(__pyx_t_8, 1, __pyx_t_6);
9900 __Pyx_GIVEREF(__pyx_t_7);
9901 PyTuple_SET_ITEM(__pyx_t_8, 2, __pyx_t_7);
9904 __pyx_t_7 = __Pyx_PyObject_Call(((PyObject *)__pyx_memoryview_type), __pyx_t_8, NULL);
if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 434, __pyx_L4_error)
9905 __Pyx_GOTREF(__pyx_t_7);
9906 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
9907 __Pyx_DECREF_SET(__pyx_v_obj, __pyx_t_7);
9918 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
9919 __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
9920 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
9921 goto __pyx_L9_try_end;
9923 __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
9924 __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
9925 __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
9934 __pyx_t_9 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_TypeError);
9936 __Pyx_AddTraceback(
"View.MemoryView.memoryview.is_slice", __pyx_clineno, __pyx_lineno, __pyx_filename);
9937 if (__Pyx_GetException(&__pyx_t_7, &__pyx_t_8, &__pyx_t_6) < 0) __PYX_ERR(0, 436, __pyx_L6_except_error)
9938 __Pyx_GOTREF(__pyx_t_7);
9939 __Pyx_GOTREF(__pyx_t_8);
9940 __Pyx_GOTREF(__pyx_t_6);
9949 __Pyx_XDECREF(__pyx_r);
9950 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
9951 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
9952 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
9953 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
9954 goto __pyx_L7_except_return;
9956 goto __pyx_L6_except_error;
9957 __pyx_L6_except_error:;
9966 __Pyx_XGIVEREF(__pyx_t_3);
9967 __Pyx_XGIVEREF(__pyx_t_4);
9968 __Pyx_XGIVEREF(__pyx_t_5);
9969 __Pyx_ExceptionReset(__pyx_t_3, __pyx_t_4, __pyx_t_5);
9970 goto __pyx_L1_error;
9971 __pyx_L7_except_return:;
9972 __Pyx_XGIVEREF(__pyx_t_3);
9973 __Pyx_XGIVEREF(__pyx_t_4);
9974 __Pyx_XGIVEREF(__pyx_t_5);
9975 __Pyx_ExceptionReset(__pyx_t_3, __pyx_t_4, __pyx_t_5);
9996 __Pyx_XDECREF(__pyx_r);
9997 __Pyx_INCREF(__pyx_v_obj);
9998 __pyx_r = __pyx_v_obj;
10011 __Pyx_XDECREF(__pyx_t_6);
10012 __Pyx_XDECREF(__pyx_t_7);
10013 __Pyx_XDECREF(__pyx_t_8);
10014 __Pyx_AddTraceback(
"View.MemoryView.memoryview.is_slice", __pyx_clineno, __pyx_lineno, __pyx_filename);
10017 __Pyx_XDECREF(__pyx_v_obj);
10018 __Pyx_XGIVEREF(__pyx_r);
10019 __Pyx_RefNannyFinishContext();
10031 static PyObject *__pyx_memoryview_setitem_slice_assignment(
struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_dst, PyObject *__pyx_v_src) {
10032 __Pyx_memviewslice __pyx_v_dst_slice;
10033 __Pyx_memviewslice __pyx_v_src_slice;
10034 PyObject *__pyx_r = NULL;
10035 __Pyx_RefNannyDeclarations
10036 __Pyx_memviewslice *__pyx_t_1;
10037 __Pyx_memviewslice *__pyx_t_2;
10038 PyObject *__pyx_t_3 = NULL;
10042 int __pyx_lineno = 0;
10043 const char *__pyx_filename = NULL;
10044 int __pyx_clineno = 0;
10045 __Pyx_RefNannySetupContext(
"setitem_slice_assignment", 0);
10054 if (!(likely(((__pyx_v_src) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_src, __pyx_memoryview_type))))) __PYX_ERR(0, 445, __pyx_L1_error)
10055 __pyx_t_1 = __pyx_memoryview_get_slice_from_memoryview(((
struct __pyx_memoryview_obj *)__pyx_v_src), (&__pyx_v_src_slice));
if (unlikely(__pyx_t_1 == ((__Pyx_memviewslice *)NULL))) __PYX_ERR(0, 445, __pyx_L1_error)
10064 if (!(likely(((__pyx_v_dst) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_dst, __pyx_memoryview_type))))) __PYX_ERR(0, 446, __pyx_L1_error)
10065 __pyx_t_2 = __pyx_memoryview_get_slice_from_memoryview(((
struct __pyx_memoryview_obj *)__pyx_v_dst), (&__pyx_v_dst_slice));
if (unlikely(__pyx_t_2 == ((__Pyx_memviewslice *)NULL))) __PYX_ERR(0, 446, __pyx_L1_error)
10074 __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_src, __pyx_n_s_ndim);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 447, __pyx_L1_error)
10075 __Pyx_GOTREF(__pyx_t_3);
10076 __pyx_t_4 = __Pyx_PyInt_As_int(__pyx_t_3);
if (unlikely((__pyx_t_4 == (
int)-1) && PyErr_Occurred())) __PYX_ERR(0, 447, __pyx_L1_error)
10077 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
10078 __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_dst, __pyx_n_s_ndim);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 447, __pyx_L1_error)
10079 __Pyx_GOTREF(__pyx_t_3);
10080 __pyx_t_5 = __Pyx_PyInt_As_int(__pyx_t_3);
if (unlikely((__pyx_t_5 == (
int)-1) && PyErr_Occurred())) __PYX_ERR(0, 447, __pyx_L1_error)
10081 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
10090 __pyx_t_6 = __pyx_memoryview_copy_contents((__pyx_t_1[0]), (__pyx_t_2[0]), __pyx_t_4, __pyx_t_5, __pyx_v_self->dtype_is_object);
if (unlikely(__pyx_t_6 == ((
int)-1))) __PYX_ERR(0, 445, __pyx_L1_error)
10101 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
10104 __Pyx_XDECREF(__pyx_t_3);
10105 __Pyx_AddTraceback(
"View.MemoryView.memoryview.setitem_slice_assignment", __pyx_clineno, __pyx_lineno, __pyx_filename);
10108 __Pyx_XGIVEREF(__pyx_r);
10109 __Pyx_RefNannyFinishContext();
10121 static PyObject *__pyx_memoryview_setitem_slice_assign_scalar(
struct __pyx_memoryview_obj *__pyx_v_self,
struct __pyx_memoryview_obj *__pyx_v_dst, PyObject *__pyx_v_value) {
10122 int __pyx_v_array[0x80];
10124 void *__pyx_v_item;
10125 __Pyx_memviewslice *__pyx_v_dst_slice;
10126 __Pyx_memviewslice __pyx_v_tmp_slice;
10127 PyObject *__pyx_r = NULL;
10128 __Pyx_RefNannyDeclarations
10129 __Pyx_memviewslice *__pyx_t_1;
10131 PyObject *__pyx_t_3 = NULL;
10134 char const *__pyx_t_6;
10135 PyObject *__pyx_t_7 = NULL;
10136 PyObject *__pyx_t_8 = NULL;
10137 PyObject *__pyx_t_9 = NULL;
10138 PyObject *__pyx_t_10 = NULL;
10139 PyObject *__pyx_t_11 = NULL;
10140 PyObject *__pyx_t_12 = NULL;
10141 int __pyx_lineno = 0;
10142 const char *__pyx_filename = NULL;
10143 int __pyx_clineno = 0;
10144 __Pyx_RefNannySetupContext(
"setitem_slice_assign_scalar", 0);
10153 __pyx_v_tmp = NULL;
10162 __pyx_t_1 = __pyx_memoryview_get_slice_from_memoryview(__pyx_v_dst, (&__pyx_v_tmp_slice));
if (unlikely(__pyx_t_1 == ((__Pyx_memviewslice *)NULL))) __PYX_ERR(0, 456, __pyx_L1_error)
10163 __pyx_v_dst_slice = __pyx_t_1;
10172 __pyx_t_2 = ((((size_t)__pyx_v_self->view.itemsize) > (
sizeof(__pyx_v_array))) != 0);
10182 __pyx_v_tmp = PyMem_Malloc(__pyx_v_self->view.itemsize);
10191 __pyx_t_2 = ((__pyx_v_tmp == NULL) != 0);
10192 if (unlikely(__pyx_t_2)) {
10201 PyErr_NoMemory(); __PYX_ERR(0, 461, __pyx_L1_error)
10219 __pyx_v_item = __pyx_v_tmp;
10239 __pyx_v_item = ((
void *)__pyx_v_array);
10259 __pyx_t_2 = (__pyx_v_self->dtype_is_object != 0);
10269 (((PyObject **)__pyx_v_item)[0]) = ((PyObject *)__pyx_v_value);
10289 __pyx_t_3 = ((
struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->assign_item_from_object(__pyx_v_self, ((
char *)__pyx_v_item), __pyx_v_value);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 470, __pyx_L6_error)
10290 __Pyx_GOTREF(__pyx_t_3);
10291 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
10302 __pyx_t_2 = ((__pyx_v_self->view.suboffsets != NULL) != 0);
10312 __pyx_t_3 = assert_direct_dimensions(__pyx_v_self->view.suboffsets, __pyx_v_self->view.ndim);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 475, __pyx_L6_error)
10313 __Pyx_GOTREF(__pyx_t_3);
10314 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
10332 __pyx_memoryview_slice_assign_scalar(__pyx_v_dst_slice, __pyx_v_dst->view.ndim, __pyx_v_self->view.itemsize, __pyx_v_item, __pyx_v_self->dtype_is_object);
10344 PyMem_Free(__pyx_v_tmp);
10349 __Pyx_PyThreadState_declare
10350 __Pyx_PyThreadState_assign
10351 __pyx_t_7 = 0; __pyx_t_8 = 0; __pyx_t_9 = 0; __pyx_t_10 = 0; __pyx_t_11 = 0; __pyx_t_12 = 0;
10352 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
10353 if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_10, &__pyx_t_11, &__pyx_t_12);
10354 if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_7, &__pyx_t_8, &__pyx_t_9) < 0)) __Pyx_ErrFetch(&__pyx_t_7, &__pyx_t_8, &__pyx_t_9);
10355 __Pyx_XGOTREF(__pyx_t_7);
10356 __Pyx_XGOTREF(__pyx_t_8);
10357 __Pyx_XGOTREF(__pyx_t_9);
10358 __Pyx_XGOTREF(__pyx_t_10);
10359 __Pyx_XGOTREF(__pyx_t_11);
10360 __Pyx_XGOTREF(__pyx_t_12);
10361 __pyx_t_4 = __pyx_lineno; __pyx_t_5 = __pyx_clineno; __pyx_t_6 = __pyx_filename;
10363 PyMem_Free(__pyx_v_tmp);
10365 if (PY_MAJOR_VERSION >= 3) {
10366 __Pyx_XGIVEREF(__pyx_t_10);
10367 __Pyx_XGIVEREF(__pyx_t_11);
10368 __Pyx_XGIVEREF(__pyx_t_12);
10369 __Pyx_ExceptionReset(__pyx_t_10, __pyx_t_11, __pyx_t_12);
10371 __Pyx_XGIVEREF(__pyx_t_7);
10372 __Pyx_XGIVEREF(__pyx_t_8);
10373 __Pyx_XGIVEREF(__pyx_t_9);
10374 __Pyx_ErrRestore(__pyx_t_7, __pyx_t_8, __pyx_t_9);
10375 __pyx_t_7 = 0; __pyx_t_8 = 0; __pyx_t_9 = 0; __pyx_t_10 = 0; __pyx_t_11 = 0; __pyx_t_12 = 0;
10376 __pyx_lineno = __pyx_t_4; __pyx_clineno = __pyx_t_5; __pyx_filename = __pyx_t_6;
10377 goto __pyx_L1_error;
10391 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
10394 __Pyx_XDECREF(__pyx_t_3);
10395 __Pyx_AddTraceback(
"View.MemoryView.memoryview.setitem_slice_assign_scalar", __pyx_clineno, __pyx_lineno, __pyx_filename);
10398 __Pyx_XGIVEREF(__pyx_r);
10399 __Pyx_RefNannyFinishContext();
10411 static PyObject *__pyx_memoryview_setitem_indexed(
struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index, PyObject *__pyx_v_value) {
10412 char *__pyx_v_itemp;
10413 PyObject *__pyx_r = NULL;
10414 __Pyx_RefNannyDeclarations
10416 PyObject *__pyx_t_2 = NULL;
10417 int __pyx_lineno = 0;
10418 const char *__pyx_filename = NULL;
10419 int __pyx_clineno = 0;
10420 __Pyx_RefNannySetupContext(
"setitem_indexed", 0);
10429 __pyx_t_1 = ((
struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->get_item_pointer(__pyx_v_self, __pyx_v_index);
if (unlikely(__pyx_t_1 == ((
char *)NULL))) __PYX_ERR(0, 482, __pyx_L1_error)
10430 __pyx_v_itemp = __pyx_t_1;
10439 __pyx_t_2 = ((
struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->assign_item_from_object(__pyx_v_self, __pyx_v_itemp, __pyx_v_value);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 483, __pyx_L1_error)
10440 __Pyx_GOTREF(__pyx_t_2);
10441 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
10452 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
10455 __Pyx_XDECREF(__pyx_t_2);
10456 __Pyx_AddTraceback(
"View.MemoryView.memoryview.setitem_indexed", __pyx_clineno, __pyx_lineno, __pyx_filename);
10459 __Pyx_XGIVEREF(__pyx_r);
10460 __Pyx_RefNannyFinishContext();
10472 static PyObject *__pyx_memoryview_convert_item_to_object(
struct __pyx_memoryview_obj *__pyx_v_self,
char *__pyx_v_itemp) {
10473 PyObject *__pyx_v_struct = NULL;
10474 PyObject *__pyx_v_bytesitem = 0;
10475 PyObject *__pyx_v_result = NULL;
10476 PyObject *__pyx_r = NULL;
10477 __Pyx_RefNannyDeclarations
10478 PyObject *__pyx_t_1 = NULL;
10479 PyObject *__pyx_t_2 = NULL;
10480 PyObject *__pyx_t_3 = NULL;
10481 PyObject *__pyx_t_4 = NULL;
10482 PyObject *__pyx_t_5 = NULL;
10483 PyObject *__pyx_t_6 = NULL;
10484 PyObject *__pyx_t_7 = NULL;
10486 PyObject *__pyx_t_9 = NULL;
10489 int __pyx_lineno = 0;
10490 const char *__pyx_filename = NULL;
10491 int __pyx_clineno = 0;
10492 __Pyx_RefNannySetupContext(
"convert_item_to_object", 0);
10501 __pyx_t_1 = __Pyx_Import(__pyx_n_s_struct, 0, 0);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 488, __pyx_L1_error)
10502 __Pyx_GOTREF(__pyx_t_1);
10503 __pyx_v_struct = __pyx_t_1;
10513 __pyx_t_1 = __Pyx_PyBytes_FromStringAndSize(__pyx_v_itemp + 0, __pyx_v_self->view.itemsize - 0);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 491, __pyx_L1_error)
10514 __Pyx_GOTREF(__pyx_t_1);
10515 __pyx_v_bytesitem = ((PyObject*)__pyx_t_1);
10526 __Pyx_PyThreadState_declare
10527 __Pyx_PyThreadState_assign
10528 __Pyx_ExceptionSave(&__pyx_t_2, &__pyx_t_3, &__pyx_t_4);
10529 __Pyx_XGOTREF(__pyx_t_2);
10530 __Pyx_XGOTREF(__pyx_t_3);
10531 __Pyx_XGOTREF(__pyx_t_4);
10541 __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_struct, __pyx_n_s_unpack);
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 493, __pyx_L3_error)
10542 __Pyx_GOTREF(__pyx_t_5);
10543 __pyx_t_6 = __Pyx_PyBytes_FromString(__pyx_v_self->view.format);
if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 493, __pyx_L3_error)
10544 __Pyx_GOTREF(__pyx_t_6);
10547 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) {
10548 __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_5);
10549 if (likely(__pyx_t_7)) {
10550 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_5);
10551 __Pyx_INCREF(__pyx_t_7);
10552 __Pyx_INCREF(
function);
10553 __Pyx_DECREF_SET(__pyx_t_5,
function);
10557 #if CYTHON_FAST_PYCALL
10558 if (PyFunction_Check(__pyx_t_5)) {
10559 PyObject *__pyx_temp[3] = {__pyx_t_7, __pyx_t_6, __pyx_v_bytesitem};
10560 __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 493, __pyx_L3_error)
10561 __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
10562 __Pyx_GOTREF(__pyx_t_1);
10563 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
10566 #if CYTHON_FAST_PYCCALL
10567 if (__Pyx_PyFastCFunction_Check(__pyx_t_5)) {
10568 PyObject *__pyx_temp[3] = {__pyx_t_7, __pyx_t_6, __pyx_v_bytesitem};
10569 __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 493, __pyx_L3_error)
10570 __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
10571 __Pyx_GOTREF(__pyx_t_1);
10572 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
10576 __pyx_t_9 = PyTuple_New(2+__pyx_t_8);
if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 493, __pyx_L3_error)
10577 __Pyx_GOTREF(__pyx_t_9);
10579 __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_7); __pyx_t_7 = NULL;
10581 __Pyx_GIVEREF(__pyx_t_6);
10582 PyTuple_SET_ITEM(__pyx_t_9, 0+__pyx_t_8, __pyx_t_6);
10583 __Pyx_INCREF(__pyx_v_bytesitem);
10584 __Pyx_GIVEREF(__pyx_v_bytesitem);
10585 PyTuple_SET_ITEM(__pyx_t_9, 1+__pyx_t_8, __pyx_v_bytesitem);
10587 __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_9, NULL);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 493, __pyx_L3_error)
10588 __Pyx_GOTREF(__pyx_t_1);
10589 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
10591 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
10592 __pyx_v_result = __pyx_t_1;
10612 __pyx_t_10 = strlen(__pyx_v_self->view.format);
10613 __pyx_t_11 = ((__pyx_t_10 == 1) != 0);
10623 __Pyx_XDECREF(__pyx_r);
10624 __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_result, 0,
long, 1, __Pyx_PyInt_From_long, 0, 0, 1);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 498, __pyx_L5_except_error)
10625 __Pyx_GOTREF(__pyx_t_1);
10626 __pyx_r = __pyx_t_1;
10628 goto __pyx_L6_except_return;
10646 __Pyx_XDECREF(__pyx_r);
10647 __Pyx_INCREF(__pyx_v_result);
10648 __pyx_r = __pyx_v_result;
10649 goto __pyx_L6_except_return;
10652 __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
10653 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
10654 __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
10655 __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
10656 __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
10665 __Pyx_ErrFetch(&__pyx_t_1, &__pyx_t_5, &__pyx_t_9);
10666 __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_struct, __pyx_n_s_error);
if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 494, __pyx_L5_except_error)
10667 __Pyx_GOTREF(__pyx_t_6);
10668 __pyx_t_8 = __Pyx_PyErr_GivenExceptionMatches(__pyx_t_1, __pyx_t_6);
10669 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
10670 __Pyx_ErrRestore(__pyx_t_1, __pyx_t_5, __pyx_t_9);
10671 __pyx_t_1 = 0; __pyx_t_5 = 0; __pyx_t_9 = 0;
10673 __Pyx_AddTraceback(
"View.MemoryView.memoryview.convert_item_to_object", __pyx_clineno, __pyx_lineno, __pyx_filename);
10674 if (__Pyx_GetException(&__pyx_t_9, &__pyx_t_5, &__pyx_t_1) < 0) __PYX_ERR(0, 494, __pyx_L5_except_error)
10675 __Pyx_GOTREF(__pyx_t_9);
10676 __Pyx_GOTREF(__pyx_t_5);
10677 __Pyx_GOTREF(__pyx_t_1);
10686 __pyx_t_6 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__24, NULL);
if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 495, __pyx_L5_except_error)
10687 __Pyx_GOTREF(__pyx_t_6);
10688 __Pyx_Raise(__pyx_t_6, 0, 0, 0);
10689 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
10690 __PYX_ERR(0, 495, __pyx_L5_except_error)
10692 goto __pyx_L5_except_error;
10693 __pyx_L5_except_error:;
10702 __Pyx_XGIVEREF(__pyx_t_2);
10703 __Pyx_XGIVEREF(__pyx_t_3);
10704 __Pyx_XGIVEREF(__pyx_t_4);
10705 __Pyx_ExceptionReset(__pyx_t_2, __pyx_t_3, __pyx_t_4);
10706 goto __pyx_L1_error;
10707 __pyx_L6_except_return:;
10708 __Pyx_XGIVEREF(__pyx_t_2);
10709 __Pyx_XGIVEREF(__pyx_t_3);
10710 __Pyx_XGIVEREF(__pyx_t_4);
10711 __Pyx_ExceptionReset(__pyx_t_2, __pyx_t_3, __pyx_t_4);
10725 __Pyx_XDECREF(__pyx_t_1);
10726 __Pyx_XDECREF(__pyx_t_5);
10727 __Pyx_XDECREF(__pyx_t_6);
10728 __Pyx_XDECREF(__pyx_t_7);
10729 __Pyx_XDECREF(__pyx_t_9);
10730 __Pyx_AddTraceback(
"View.MemoryView.memoryview.convert_item_to_object", __pyx_clineno, __pyx_lineno, __pyx_filename);
10733 __Pyx_XDECREF(__pyx_v_struct);
10734 __Pyx_XDECREF(__pyx_v_bytesitem);
10735 __Pyx_XDECREF(__pyx_v_result);
10736 __Pyx_XGIVEREF(__pyx_r);
10737 __Pyx_RefNannyFinishContext();
10749 static PyObject *__pyx_memoryview_assign_item_from_object(
struct __pyx_memoryview_obj *__pyx_v_self,
char *__pyx_v_itemp, PyObject *__pyx_v_value) {
10750 PyObject *__pyx_v_struct = NULL;
10752 PyObject *__pyx_v_bytesvalue = 0;
10753 Py_ssize_t __pyx_v_i;
10754 PyObject *__pyx_r = NULL;
10755 __Pyx_RefNannyDeclarations
10756 PyObject *__pyx_t_1 = NULL;
10759 PyObject *__pyx_t_4 = NULL;
10760 PyObject *__pyx_t_5 = NULL;
10761 PyObject *__pyx_t_6 = NULL;
10763 PyObject *__pyx_t_8 = NULL;
10764 Py_ssize_t __pyx_t_9;
10765 PyObject *__pyx_t_10 = NULL;
10770 int __pyx_lineno = 0;
10771 const char *__pyx_filename = NULL;
10772 int __pyx_clineno = 0;
10773 __Pyx_RefNannySetupContext(
"assign_item_from_object", 0);
10782 __pyx_t_1 = __Pyx_Import(__pyx_n_s_struct, 0, 0);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 504, __pyx_L1_error)
10783 __Pyx_GOTREF(__pyx_t_1);
10784 __pyx_v_struct = __pyx_t_1;
10794 __pyx_t_2 = PyTuple_Check(__pyx_v_value);
10795 __pyx_t_3 = (__pyx_t_2 != 0);
10805 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_struct, __pyx_n_s_pack);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 510, __pyx_L1_error)
10806 __Pyx_GOTREF(__pyx_t_1);
10807 __pyx_t_4 = __Pyx_PyBytes_FromString(__pyx_v_self->view.format);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 510, __pyx_L1_error)
10808 __Pyx_GOTREF(__pyx_t_4);
10809 __pyx_t_5 = PyTuple_New(1);
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 510, __pyx_L1_error)
10810 __Pyx_GOTREF(__pyx_t_5);
10811 __Pyx_GIVEREF(__pyx_t_4);
10812 PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4);
10814 __pyx_t_4 = __Pyx_PySequence_Tuple(__pyx_v_value);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 510, __pyx_L1_error)
10815 __Pyx_GOTREF(__pyx_t_4);
10816 __pyx_t_6 = PyNumber_Add(__pyx_t_5, __pyx_t_4);
if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 510, __pyx_L1_error)
10817 __Pyx_GOTREF(__pyx_t_6);
10818 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
10819 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
10820 __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_6, NULL);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 510, __pyx_L1_error)
10821 __Pyx_GOTREF(__pyx_t_4);
10822 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
10823 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
10824 if (!(likely(PyBytes_CheckExact(__pyx_t_4))||((__pyx_t_4) == Py_None)||(PyErr_Format(PyExc_TypeError,
"Expected %.16s, got %.200s",
"bytes", Py_TYPE(__pyx_t_4)->tp_name), 0))) __PYX_ERR(0, 510, __pyx_L1_error)
10825 __pyx_v_bytesvalue = ((PyObject*)__pyx_t_4);
10846 __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_struct, __pyx_n_s_pack);
if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 512, __pyx_L1_error)
10847 __Pyx_GOTREF(__pyx_t_6);
10848 __pyx_t_1 = __Pyx_PyBytes_FromString(__pyx_v_self->view.format);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 512, __pyx_L1_error)
10849 __Pyx_GOTREF(__pyx_t_1);
10852 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_6))) {
10853 __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_6);
10854 if (likely(__pyx_t_5)) {
10855 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_6);
10856 __Pyx_INCREF(__pyx_t_5);
10857 __Pyx_INCREF(
function);
10858 __Pyx_DECREF_SET(__pyx_t_6,
function);
10862 #if CYTHON_FAST_PYCALL
10863 if (PyFunction_Check(__pyx_t_6)) {
10864 PyObject *__pyx_temp[3] = {__pyx_t_5, __pyx_t_1, __pyx_v_value};
10865 __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 512, __pyx_L1_error)
10866 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
10867 __Pyx_GOTREF(__pyx_t_4);
10868 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
10871 #if CYTHON_FAST_PYCCALL
10872 if (__Pyx_PyFastCFunction_Check(__pyx_t_6)) {
10873 PyObject *__pyx_temp[3] = {__pyx_t_5, __pyx_t_1, __pyx_v_value};
10874 __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 512, __pyx_L1_error)
10875 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
10876 __Pyx_GOTREF(__pyx_t_4);
10877 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
10881 __pyx_t_8 = PyTuple_New(2+__pyx_t_7);
if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 512, __pyx_L1_error)
10882 __Pyx_GOTREF(__pyx_t_8);
10884 __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_5); __pyx_t_5 = NULL;
10886 __Pyx_GIVEREF(__pyx_t_1);
10887 PyTuple_SET_ITEM(__pyx_t_8, 0+__pyx_t_7, __pyx_t_1);
10888 __Pyx_INCREF(__pyx_v_value);
10889 __Pyx_GIVEREF(__pyx_v_value);
10890 PyTuple_SET_ITEM(__pyx_t_8, 1+__pyx_t_7, __pyx_v_value);
10892 __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_8, NULL);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 512, __pyx_L1_error)
10893 __Pyx_GOTREF(__pyx_t_4);
10894 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
10896 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
10897 if (!(likely(PyBytes_CheckExact(__pyx_t_4))||((__pyx_t_4) == Py_None)||(PyErr_Format(PyExc_TypeError,
"Expected %.16s, got %.200s",
"bytes", Py_TYPE(__pyx_t_4)->tp_name), 0))) __PYX_ERR(0, 512, __pyx_L1_error)
10898 __pyx_v_bytesvalue = ((PyObject*)__pyx_t_4);
10911 if (unlikely(__pyx_v_bytesvalue == Py_None)) {
10912 PyErr_SetString(PyExc_TypeError,
"'NoneType' is not iterable");
10913 __PYX_ERR(0, 514, __pyx_L1_error)
10915 __Pyx_INCREF(__pyx_v_bytesvalue);
10916 __pyx_t_10 = __pyx_v_bytesvalue;
10917 __pyx_t_12 = PyBytes_AS_STRING(__pyx_t_10);
10918 __pyx_t_13 = (__pyx_t_12 + PyBytes_GET_SIZE(__pyx_t_10));
10919 for (__pyx_t_14 = __pyx_t_12; __pyx_t_14 < __pyx_t_13; __pyx_t_14++) {
10920 __pyx_t_11 = __pyx_t_14;
10921 __pyx_v_c = (__pyx_t_11[0]);
10930 __pyx_v_i = __pyx_t_9;
10939 __pyx_t_9 = (__pyx_t_9 + 1);
10948 (__pyx_v_itemp[__pyx_v_i]) = __pyx_v_c;
10950 __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
10961 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
10964 __Pyx_XDECREF(__pyx_t_1);
10965 __Pyx_XDECREF(__pyx_t_4);
10966 __Pyx_XDECREF(__pyx_t_5);
10967 __Pyx_XDECREF(__pyx_t_6);
10968 __Pyx_XDECREF(__pyx_t_8);
10969 __Pyx_XDECREF(__pyx_t_10);
10970 __Pyx_AddTraceback(
"View.MemoryView.memoryview.assign_item_from_object", __pyx_clineno, __pyx_lineno, __pyx_filename);
10973 __Pyx_XDECREF(__pyx_v_struct);
10974 __Pyx_XDECREF(__pyx_v_bytesvalue);
10975 __Pyx_XGIVEREF(__pyx_r);
10976 __Pyx_RefNannyFinishContext();
10989 static CYTHON_UNUSED
int __pyx_memoryview_getbuffer(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info,
int __pyx_v_flags);
10990 static CYTHON_UNUSED
int __pyx_memoryview_getbuffer(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info,
int __pyx_v_flags) {
10992 __Pyx_RefNannyDeclarations
10993 __Pyx_RefNannySetupContext(
"__getbuffer__ (wrapper)", 0);
10994 __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_8__getbuffer__(((
struct __pyx_memoryview_obj *)__pyx_v_self), ((Py_buffer *)__pyx_v_info), ((
int)__pyx_v_flags));
10997 __Pyx_RefNannyFinishContext();
11001 static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_8__getbuffer__(
struct __pyx_memoryview_obj *__pyx_v_self, Py_buffer *__pyx_v_info,
int __pyx_v_flags) {
11003 __Pyx_RefNannyDeclarations
11006 PyObject *__pyx_t_3 = NULL;
11007 Py_ssize_t *__pyx_t_4;
11011 Py_ssize_t __pyx_t_8;
11012 int __pyx_lineno = 0;
11013 const char *__pyx_filename = NULL;
11014 int __pyx_clineno = 0;
11015 if (__pyx_v_info == NULL) {
11016 PyErr_SetString(PyExc_BufferError,
"PyObject_GetBuffer: view==NULL argument is obsolete");
11019 __Pyx_RefNannySetupContext(
"__getbuffer__", 0);
11020 __pyx_v_info->obj = Py_None; __Pyx_INCREF(Py_None);
11021 __Pyx_GIVEREF(__pyx_v_info->obj);
11030 __pyx_t_2 = ((__pyx_v_flags & PyBUF_WRITABLE) != 0);
11033 __pyx_t_1 = __pyx_t_2;
11034 goto __pyx_L4_bool_binop_done;
11036 __pyx_t_2 = (__pyx_v_self->view.readonly != 0);
11037 __pyx_t_1 = __pyx_t_2;
11038 __pyx_L4_bool_binop_done:;
11039 if (unlikely(__pyx_t_1)) {
11048 __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__25, NULL);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 520, __pyx_L1_error)
11049 __Pyx_GOTREF(__pyx_t_3);
11050 __Pyx_Raise(__pyx_t_3, 0, 0, 0);
11051 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
11052 __PYX_ERR(0, 520, __pyx_L1_error)
11070 __pyx_t_1 = ((__pyx_v_flags & PyBUF_ND) != 0);
11080 __pyx_t_4 = __pyx_v_self->view.shape;
11081 __pyx_v_info->shape = __pyx_t_4;
11101 __pyx_v_info->shape = NULL;
11112 __pyx_t_1 = ((__pyx_v_flags & PyBUF_STRIDES) != 0);
11122 __pyx_t_4 = __pyx_v_self->view.strides;
11123 __pyx_v_info->strides = __pyx_t_4;
11143 __pyx_v_info->strides = NULL;
11154 __pyx_t_1 = ((__pyx_v_flags & PyBUF_INDIRECT) != 0);
11164 __pyx_t_4 = __pyx_v_self->view.suboffsets;
11165 __pyx_v_info->suboffsets = __pyx_t_4;
11185 __pyx_v_info->suboffsets = NULL;
11196 __pyx_t_1 = ((__pyx_v_flags & PyBUF_FORMAT) != 0);
11206 __pyx_t_5 = __pyx_v_self->view.format;
11207 __pyx_v_info->format = __pyx_t_5;
11227 __pyx_v_info->format = NULL;
11238 __pyx_t_6 = __pyx_v_self->view.buf;
11239 __pyx_v_info->buf = __pyx_t_6;
11248 __pyx_t_7 = __pyx_v_self->view.ndim;
11249 __pyx_v_info->ndim = __pyx_t_7;
11258 __pyx_t_8 = __pyx_v_self->view.itemsize;
11259 __pyx_v_info->itemsize = __pyx_t_8;
11268 __pyx_t_8 = __pyx_v_self->view.len;
11269 __pyx_v_info->len = __pyx_t_8;
11278 __pyx_t_1 = __pyx_v_self->view.readonly;
11279 __pyx_v_info->readonly = __pyx_t_1;
11288 __Pyx_INCREF(((PyObject *)__pyx_v_self));
11289 __Pyx_GIVEREF(((PyObject *)__pyx_v_self));
11290 __Pyx_GOTREF(__pyx_v_info->obj);
11291 __Pyx_DECREF(__pyx_v_info->obj);
11292 __pyx_v_info->obj = ((PyObject *)__pyx_v_self);
11306 __Pyx_XDECREF(__pyx_t_3);
11307 __Pyx_AddTraceback(
"View.MemoryView.memoryview.__getbuffer__", __pyx_clineno, __pyx_lineno, __pyx_filename);
11309 if (__pyx_v_info->obj != NULL) {
11310 __Pyx_GOTREF(__pyx_v_info->obj);
11311 __Pyx_DECREF(__pyx_v_info->obj); __pyx_v_info->obj = 0;
11315 if (__pyx_v_info->obj == Py_None) {
11316 __Pyx_GOTREF(__pyx_v_info->obj);
11317 __Pyx_DECREF(__pyx_v_info->obj); __pyx_v_info->obj = 0;
11320 __Pyx_RefNannyFinishContext();
11333 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_1T_1__get__(PyObject *__pyx_v_self);
11334 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_1T_1__get__(PyObject *__pyx_v_self) {
11335 PyObject *__pyx_r = 0;
11336 __Pyx_RefNannyDeclarations
11337 __Pyx_RefNannySetupContext(
"__get__ (wrapper)", 0);
11338 __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_1T___get__(((
struct __pyx_memoryview_obj *)__pyx_v_self));
11341 __Pyx_RefNannyFinishContext();
11345 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_1T___get__(
struct __pyx_memoryview_obj *__pyx_v_self) {
11346 struct __pyx_memoryviewslice_obj *__pyx_v_result = 0;
11347 PyObject *__pyx_r = NULL;
11348 __Pyx_RefNannyDeclarations
11349 PyObject *__pyx_t_1 = NULL;
11351 int __pyx_lineno = 0;
11352 const char *__pyx_filename = NULL;
11353 int __pyx_clineno = 0;
11354 __Pyx_RefNannySetupContext(
"__get__", 0);
11363 __pyx_t_1 = __pyx_memoryview_copy_object(__pyx_v_self);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 554, __pyx_L1_error)
11364 __Pyx_GOTREF(__pyx_t_1);
11365 if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_memoryviewslice_type))))) __PYX_ERR(0, 554, __pyx_L1_error)
11366 __pyx_v_result = ((
struct __pyx_memoryviewslice_obj *)__pyx_t_1);
11376 __pyx_t_2 = __pyx_memslice_transpose((&__pyx_v_result->from_slice));
if (unlikely(__pyx_t_2 == ((
int)0))) __PYX_ERR(0, 555, __pyx_L1_error)
11385 __Pyx_XDECREF(__pyx_r);
11386 __Pyx_INCREF(((PyObject *)__pyx_v_result));
11387 __pyx_r = ((PyObject *)__pyx_v_result);
11400 __Pyx_XDECREF(__pyx_t_1);
11401 __Pyx_AddTraceback(
"View.MemoryView.memoryview.T.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
11404 __Pyx_XDECREF((PyObject *)__pyx_v_result);
11405 __Pyx_XGIVEREF(__pyx_r);
11406 __Pyx_RefNannyFinishContext();
11419 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_4base_1__get__(PyObject *__pyx_v_self);
11420 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_4base_1__get__(PyObject *__pyx_v_self) {
11421 PyObject *__pyx_r = 0;
11422 __Pyx_RefNannyDeclarations
11423 __Pyx_RefNannySetupContext(
"__get__ (wrapper)", 0);
11424 __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_4base___get__(((
struct __pyx_memoryview_obj *)__pyx_v_self));
11427 __Pyx_RefNannyFinishContext();
11431 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_4base___get__(
struct __pyx_memoryview_obj *__pyx_v_self) {
11432 PyObject *__pyx_r = NULL;
11433 __Pyx_RefNannyDeclarations
11434 __Pyx_RefNannySetupContext(
"__get__", 0);
11443 __Pyx_XDECREF(__pyx_r);
11444 __Pyx_INCREF(__pyx_v_self->obj);
11445 __pyx_r = __pyx_v_self->obj;
11458 __Pyx_XGIVEREF(__pyx_r);
11459 __Pyx_RefNannyFinishContext();
11472 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_5shape_1__get__(PyObject *__pyx_v_self);
11473 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_5shape_1__get__(PyObject *__pyx_v_self) {
11474 PyObject *__pyx_r = 0;
11475 __Pyx_RefNannyDeclarations
11476 __Pyx_RefNannySetupContext(
"__get__ (wrapper)", 0);
11477 __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_5shape___get__(((
struct __pyx_memoryview_obj *)__pyx_v_self));
11480 __Pyx_RefNannyFinishContext();
11484 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_5shape___get__(
struct __pyx_memoryview_obj *__pyx_v_self) {
11485 Py_ssize_t __pyx_v_length;
11486 PyObject *__pyx_r = NULL;
11487 __Pyx_RefNannyDeclarations
11488 PyObject *__pyx_t_1 = NULL;
11489 Py_ssize_t *__pyx_t_2;
11490 Py_ssize_t *__pyx_t_3;
11491 Py_ssize_t *__pyx_t_4;
11492 PyObject *__pyx_t_5 = NULL;
11493 int __pyx_lineno = 0;
11494 const char *__pyx_filename = NULL;
11495 int __pyx_clineno = 0;
11496 __Pyx_RefNannySetupContext(
"__get__", 0);
11505 __Pyx_XDECREF(__pyx_r);
11506 __pyx_t_1 = PyList_New(0);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 564, __pyx_L1_error)
11507 __Pyx_GOTREF(__pyx_t_1);
11508 __pyx_t_3 = (__pyx_v_self->view.shape + __pyx_v_self->view.ndim);
11509 for (__pyx_t_4 = __pyx_v_self->view.shape; __pyx_t_4 < __pyx_t_3; __pyx_t_4++) {
11510 __pyx_t_2 = __pyx_t_4;
11511 __pyx_v_length = (__pyx_t_2[0]);
11512 __pyx_t_5 = PyInt_FromSsize_t(__pyx_v_length);
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 564, __pyx_L1_error)
11513 __Pyx_GOTREF(__pyx_t_5);
11514 if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_t_5))) __PYX_ERR(0, 564, __pyx_L1_error)
11515 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
11517 __pyx_t_5 = PyList_AsTuple(((PyObject*)__pyx_t_1));
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 564, __pyx_L1_error)
11518 __Pyx_GOTREF(__pyx_t_5);
11519 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
11520 __pyx_r = __pyx_t_5;
11534 __Pyx_XDECREF(__pyx_t_1);
11535 __Pyx_XDECREF(__pyx_t_5);
11536 __Pyx_AddTraceback(
"View.MemoryView.memoryview.shape.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
11539 __Pyx_XGIVEREF(__pyx_r);
11540 __Pyx_RefNannyFinishContext();
11553 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_7strides_1__get__(PyObject *__pyx_v_self);
11554 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_7strides_1__get__(PyObject *__pyx_v_self) {
11555 PyObject *__pyx_r = 0;
11556 __Pyx_RefNannyDeclarations
11557 __Pyx_RefNannySetupContext(
"__get__ (wrapper)", 0);
11558 __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_7strides___get__(((
struct __pyx_memoryview_obj *)__pyx_v_self));
11561 __Pyx_RefNannyFinishContext();
11565 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_7strides___get__(
struct __pyx_memoryview_obj *__pyx_v_self) {
11566 Py_ssize_t __pyx_v_stride;
11567 PyObject *__pyx_r = NULL;
11568 __Pyx_RefNannyDeclarations
11570 PyObject *__pyx_t_2 = NULL;
11571 Py_ssize_t *__pyx_t_3;
11572 Py_ssize_t *__pyx_t_4;
11573 Py_ssize_t *__pyx_t_5;
11574 PyObject *__pyx_t_6 = NULL;
11575 int __pyx_lineno = 0;
11576 const char *__pyx_filename = NULL;
11577 int __pyx_clineno = 0;
11578 __Pyx_RefNannySetupContext(
"__get__", 0);
11587 __pyx_t_1 = ((__pyx_v_self->view.strides == NULL) != 0);
11588 if (unlikely(__pyx_t_1)) {
11597 __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__26, NULL);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 570, __pyx_L1_error)
11598 __Pyx_GOTREF(__pyx_t_2);
11599 __Pyx_Raise(__pyx_t_2, 0, 0, 0);
11600 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
11601 __PYX_ERR(0, 570, __pyx_L1_error)
11619 __Pyx_XDECREF(__pyx_r);
11620 __pyx_t_2 = PyList_New(0);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 572, __pyx_L1_error)
11621 __Pyx_GOTREF(__pyx_t_2);
11622 __pyx_t_4 = (__pyx_v_self->view.strides + __pyx_v_self->view.ndim);
11623 for (__pyx_t_5 = __pyx_v_self->view.strides; __pyx_t_5 < __pyx_t_4; __pyx_t_5++) {
11624 __pyx_t_3 = __pyx_t_5;
11625 __pyx_v_stride = (__pyx_t_3[0]);
11626 __pyx_t_6 = PyInt_FromSsize_t(__pyx_v_stride);
if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 572, __pyx_L1_error)
11627 __Pyx_GOTREF(__pyx_t_6);
11628 if (unlikely(__Pyx_ListComp_Append(__pyx_t_2, (PyObject*)__pyx_t_6))) __PYX_ERR(0, 572, __pyx_L1_error)
11629 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
11631 __pyx_t_6 = PyList_AsTuple(((PyObject*)__pyx_t_2));
if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 572, __pyx_L1_error)
11632 __Pyx_GOTREF(__pyx_t_6);
11633 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
11634 __pyx_r = __pyx_t_6;
11648 __Pyx_XDECREF(__pyx_t_2);
11649 __Pyx_XDECREF(__pyx_t_6);
11650 __Pyx_AddTraceback(
"View.MemoryView.memoryview.strides.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
11653 __Pyx_XGIVEREF(__pyx_r);
11654 __Pyx_RefNannyFinishContext();
11667 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_10suboffsets_1__get__(PyObject *__pyx_v_self);
11668 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_10suboffsets_1__get__(PyObject *__pyx_v_self) {
11669 PyObject *__pyx_r = 0;
11670 __Pyx_RefNannyDeclarations
11671 __Pyx_RefNannySetupContext(
"__get__ (wrapper)", 0);
11672 __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_10suboffsets___get__(((
struct __pyx_memoryview_obj *)__pyx_v_self));
11675 __Pyx_RefNannyFinishContext();
11679 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_10suboffsets___get__(
struct __pyx_memoryview_obj *__pyx_v_self) {
11680 Py_ssize_t __pyx_v_suboffset;
11681 PyObject *__pyx_r = NULL;
11682 __Pyx_RefNannyDeclarations
11684 PyObject *__pyx_t_2 = NULL;
11685 PyObject *__pyx_t_3 = NULL;
11686 Py_ssize_t *__pyx_t_4;
11687 Py_ssize_t *__pyx_t_5;
11688 Py_ssize_t *__pyx_t_6;
11689 int __pyx_lineno = 0;
11690 const char *__pyx_filename = NULL;
11691 int __pyx_clineno = 0;
11692 __Pyx_RefNannySetupContext(
"__get__", 0);
11701 __pyx_t_1 = ((__pyx_v_self->view.suboffsets == NULL) != 0);
11711 __Pyx_XDECREF(__pyx_r);
11712 __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_self->view.ndim);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 577, __pyx_L1_error)
11713 __Pyx_GOTREF(__pyx_t_2);
11714 __pyx_t_3 = PyNumber_Multiply(__pyx_tuple__27, __pyx_t_2);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 577, __pyx_L1_error)
11715 __Pyx_GOTREF(__pyx_t_3);
11716 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
11717 __pyx_r = __pyx_t_3;
11737 __Pyx_XDECREF(__pyx_r);
11738 __pyx_t_3 = PyList_New(0);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 579, __pyx_L1_error)
11739 __Pyx_GOTREF(__pyx_t_3);
11740 __pyx_t_5 = (__pyx_v_self->view.suboffsets + __pyx_v_self->view.ndim);
11741 for (__pyx_t_6 = __pyx_v_self->view.suboffsets; __pyx_t_6 < __pyx_t_5; __pyx_t_6++) {
11742 __pyx_t_4 = __pyx_t_6;
11743 __pyx_v_suboffset = (__pyx_t_4[0]);
11744 __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_suboffset);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 579, __pyx_L1_error)
11745 __Pyx_GOTREF(__pyx_t_2);
11746 if (unlikely(__Pyx_ListComp_Append(__pyx_t_3, (PyObject*)__pyx_t_2))) __PYX_ERR(0, 579, __pyx_L1_error)
11747 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
11749 __pyx_t_2 = PyList_AsTuple(((PyObject*)__pyx_t_3));
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 579, __pyx_L1_error)
11750 __Pyx_GOTREF(__pyx_t_2);
11751 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
11752 __pyx_r = __pyx_t_2;
11766 __Pyx_XDECREF(__pyx_t_2);
11767 __Pyx_XDECREF(__pyx_t_3);
11768 __Pyx_AddTraceback(
"View.MemoryView.memoryview.suboffsets.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
11771 __Pyx_XGIVEREF(__pyx_r);
11772 __Pyx_RefNannyFinishContext();
11785 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_4ndim_1__get__(PyObject *__pyx_v_self);
11786 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_4ndim_1__get__(PyObject *__pyx_v_self) {
11787 PyObject *__pyx_r = 0;
11788 __Pyx_RefNannyDeclarations
11789 __Pyx_RefNannySetupContext(
"__get__ (wrapper)", 0);
11790 __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_4ndim___get__(((
struct __pyx_memoryview_obj *)__pyx_v_self));
11793 __Pyx_RefNannyFinishContext();
11797 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_4ndim___get__(
struct __pyx_memoryview_obj *__pyx_v_self) {
11798 PyObject *__pyx_r = NULL;
11799 __Pyx_RefNannyDeclarations
11800 PyObject *__pyx_t_1 = NULL;
11801 int __pyx_lineno = 0;
11802 const char *__pyx_filename = NULL;
11803 int __pyx_clineno = 0;
11804 __Pyx_RefNannySetupContext(
"__get__", 0);
11813 __Pyx_XDECREF(__pyx_r);
11814 __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->view.ndim);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 583, __pyx_L1_error)
11815 __Pyx_GOTREF(__pyx_t_1);
11816 __pyx_r = __pyx_t_1;
11830 __Pyx_XDECREF(__pyx_t_1);
11831 __Pyx_AddTraceback(
"View.MemoryView.memoryview.ndim.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
11834 __Pyx_XGIVEREF(__pyx_r);
11835 __Pyx_RefNannyFinishContext();
11848 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_8itemsize_1__get__(PyObject *__pyx_v_self);
11849 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_8itemsize_1__get__(PyObject *__pyx_v_self) {
11850 PyObject *__pyx_r = 0;
11851 __Pyx_RefNannyDeclarations
11852 __Pyx_RefNannySetupContext(
"__get__ (wrapper)", 0);
11853 __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_8itemsize___get__(((
struct __pyx_memoryview_obj *)__pyx_v_self));
11856 __Pyx_RefNannyFinishContext();
11860 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_8itemsize___get__(
struct __pyx_memoryview_obj *__pyx_v_self) {
11861 PyObject *__pyx_r = NULL;
11862 __Pyx_RefNannyDeclarations
11863 PyObject *__pyx_t_1 = NULL;
11864 int __pyx_lineno = 0;
11865 const char *__pyx_filename = NULL;
11866 int __pyx_clineno = 0;
11867 __Pyx_RefNannySetupContext(
"__get__", 0);
11876 __Pyx_XDECREF(__pyx_r);
11877 __pyx_t_1 = PyInt_FromSsize_t(__pyx_v_self->view.itemsize);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 587, __pyx_L1_error)
11878 __Pyx_GOTREF(__pyx_t_1);
11879 __pyx_r = __pyx_t_1;
11893 __Pyx_XDECREF(__pyx_t_1);
11894 __Pyx_AddTraceback(
"View.MemoryView.memoryview.itemsize.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
11897 __Pyx_XGIVEREF(__pyx_r);
11898 __Pyx_RefNannyFinishContext();
11911 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_6nbytes_1__get__(PyObject *__pyx_v_self);
11912 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_6nbytes_1__get__(PyObject *__pyx_v_self) {
11913 PyObject *__pyx_r = 0;
11914 __Pyx_RefNannyDeclarations
11915 __Pyx_RefNannySetupContext(
"__get__ (wrapper)", 0);
11916 __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_6nbytes___get__(((
struct __pyx_memoryview_obj *)__pyx_v_self));
11919 __Pyx_RefNannyFinishContext();
11923 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_6nbytes___get__(
struct __pyx_memoryview_obj *__pyx_v_self) {
11924 PyObject *__pyx_r = NULL;
11925 __Pyx_RefNannyDeclarations
11926 PyObject *__pyx_t_1 = NULL;
11927 PyObject *__pyx_t_2 = NULL;
11928 PyObject *__pyx_t_3 = NULL;
11929 int __pyx_lineno = 0;
11930 const char *__pyx_filename = NULL;
11931 int __pyx_clineno = 0;
11932 __Pyx_RefNannySetupContext(
"__get__", 0);
11941 __Pyx_XDECREF(__pyx_r);
11942 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_size);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 591, __pyx_L1_error)
11943 __Pyx_GOTREF(__pyx_t_1);
11944 __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_self->view.itemsize);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 591, __pyx_L1_error)
11945 __Pyx_GOTREF(__pyx_t_2);
11946 __pyx_t_3 = PyNumber_Multiply(__pyx_t_1, __pyx_t_2);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 591, __pyx_L1_error)
11947 __Pyx_GOTREF(__pyx_t_3);
11948 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
11949 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
11950 __pyx_r = __pyx_t_3;
11964 __Pyx_XDECREF(__pyx_t_1);
11965 __Pyx_XDECREF(__pyx_t_2);
11966 __Pyx_XDECREF(__pyx_t_3);
11967 __Pyx_AddTraceback(
"View.MemoryView.memoryview.nbytes.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
11970 __Pyx_XGIVEREF(__pyx_r);
11971 __Pyx_RefNannyFinishContext();
11984 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_4size_1__get__(PyObject *__pyx_v_self);
11985 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_4size_1__get__(PyObject *__pyx_v_self) {
11986 PyObject *__pyx_r = 0;
11987 __Pyx_RefNannyDeclarations
11988 __Pyx_RefNannySetupContext(
"__get__ (wrapper)", 0);
11989 __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_4size___get__(((
struct __pyx_memoryview_obj *)__pyx_v_self));
11992 __Pyx_RefNannyFinishContext();
11996 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_4size___get__(
struct __pyx_memoryview_obj *__pyx_v_self) {
11997 PyObject *__pyx_v_result = NULL;
11998 PyObject *__pyx_v_length = NULL;
11999 PyObject *__pyx_r = NULL;
12000 __Pyx_RefNannyDeclarations
12003 Py_ssize_t *__pyx_t_3;
12004 Py_ssize_t *__pyx_t_4;
12005 Py_ssize_t *__pyx_t_5;
12006 PyObject *__pyx_t_6 = NULL;
12007 int __pyx_lineno = 0;
12008 const char *__pyx_filename = NULL;
12009 int __pyx_clineno = 0;
12010 __Pyx_RefNannySetupContext(
"__get__", 0);
12019 __pyx_t_1 = (__pyx_v_self->_size == Py_None);
12020 __pyx_t_2 = (__pyx_t_1 != 0);
12030 __Pyx_INCREF(__pyx_int_1);
12031 __pyx_v_result = __pyx_int_1;
12040 __pyx_t_4 = (__pyx_v_self->view.shape + __pyx_v_self->view.ndim);
12041 for (__pyx_t_5 = __pyx_v_self->view.shape; __pyx_t_5 < __pyx_t_4; __pyx_t_5++) {
12042 __pyx_t_3 = __pyx_t_5;
12043 __pyx_t_6 = PyInt_FromSsize_t((__pyx_t_3[0]));
if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 598, __pyx_L1_error)
12044 __Pyx_GOTREF(__pyx_t_6);
12045 __Pyx_XDECREF_SET(__pyx_v_length, __pyx_t_6);
12055 __pyx_t_6 = PyNumber_InPlaceMultiply(__pyx_v_result, __pyx_v_length);
if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 599, __pyx_L1_error)
12056 __Pyx_GOTREF(__pyx_t_6);
12057 __Pyx_DECREF_SET(__pyx_v_result, __pyx_t_6);
12068 __Pyx_INCREF(__pyx_v_result);
12069 __Pyx_GIVEREF(__pyx_v_result);
12070 __Pyx_GOTREF(__pyx_v_self->_size);
12071 __Pyx_DECREF(__pyx_v_self->_size);
12072 __pyx_v_self->_size = __pyx_v_result;
12090 __Pyx_XDECREF(__pyx_r);
12091 __Pyx_INCREF(__pyx_v_self->_size);
12092 __pyx_r = __pyx_v_self->_size;
12105 __Pyx_XDECREF(__pyx_t_6);
12106 __Pyx_AddTraceback(
"View.MemoryView.memoryview.size.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
12109 __Pyx_XDECREF(__pyx_v_result);
12110 __Pyx_XDECREF(__pyx_v_length);
12111 __Pyx_XGIVEREF(__pyx_r);
12112 __Pyx_RefNannyFinishContext();
12125 static Py_ssize_t __pyx_memoryview___len__(PyObject *__pyx_v_self);
12126 static Py_ssize_t __pyx_memoryview___len__(PyObject *__pyx_v_self) {
12127 Py_ssize_t __pyx_r;
12128 __Pyx_RefNannyDeclarations
12129 __Pyx_RefNannySetupContext(
"__len__ (wrapper)", 0);
12130 __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_10__len__(((
struct __pyx_memoryview_obj *)__pyx_v_self));
12133 __Pyx_RefNannyFinishContext();
12137 static Py_ssize_t __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_10__len__(
struct __pyx_memoryview_obj *__pyx_v_self) {
12138 Py_ssize_t __pyx_r;
12139 __Pyx_RefNannyDeclarations
12141 __Pyx_RefNannySetupContext(
"__len__", 0);
12150 __pyx_t_1 = ((__pyx_v_self->view.ndim >= 1) != 0);
12160 __pyx_r = (__pyx_v_self->view.shape[0]);
12192 __Pyx_RefNannyFinishContext();
12205 static PyObject *__pyx_memoryview___repr__(PyObject *__pyx_v_self);
12206 static PyObject *__pyx_memoryview___repr__(PyObject *__pyx_v_self) {
12207 PyObject *__pyx_r = 0;
12208 __Pyx_RefNannyDeclarations
12209 __Pyx_RefNannySetupContext(
"__repr__ (wrapper)", 0);
12210 __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_12__repr__(((
struct __pyx_memoryview_obj *)__pyx_v_self));
12213 __Pyx_RefNannyFinishContext();
12217 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_12__repr__(
struct __pyx_memoryview_obj *__pyx_v_self) {
12218 PyObject *__pyx_r = NULL;
12219 __Pyx_RefNannyDeclarations
12220 PyObject *__pyx_t_1 = NULL;
12221 PyObject *__pyx_t_2 = NULL;
12222 PyObject *__pyx_t_3 = NULL;
12223 int __pyx_lineno = 0;
12224 const char *__pyx_filename = NULL;
12225 int __pyx_clineno = 0;
12226 __Pyx_RefNannySetupContext(
"__repr__", 0);
12235 __Pyx_XDECREF(__pyx_r);
12236 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_base);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 612, __pyx_L1_error)
12237 __Pyx_GOTREF(__pyx_t_1);
12238 __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_class);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 612, __pyx_L1_error)
12239 __Pyx_GOTREF(__pyx_t_2);
12240 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
12241 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_name_2);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 612, __pyx_L1_error)
12242 __Pyx_GOTREF(__pyx_t_1);
12243 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
12252 __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_builtin_id, ((PyObject *)__pyx_v_self));
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 613, __pyx_L1_error)
12253 __Pyx_GOTREF(__pyx_t_2);
12262 __pyx_t_3 = PyTuple_New(2);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 612, __pyx_L1_error)
12263 __Pyx_GOTREF(__pyx_t_3);
12264 __Pyx_GIVEREF(__pyx_t_1);
12265 PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1);
12266 __Pyx_GIVEREF(__pyx_t_2);
12267 PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_2);
12270 __pyx_t_2 = __Pyx_PyString_Format(__pyx_kp_s_MemoryView_of_r_at_0x_x, __pyx_t_3);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 612, __pyx_L1_error)
12271 __Pyx_GOTREF(__pyx_t_2);
12272 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
12273 __pyx_r = __pyx_t_2;
12287 __Pyx_XDECREF(__pyx_t_1);
12288 __Pyx_XDECREF(__pyx_t_2);
12289 __Pyx_XDECREF(__pyx_t_3);
12290 __Pyx_AddTraceback(
"View.MemoryView.memoryview.__repr__", __pyx_clineno, __pyx_lineno, __pyx_filename);
12293 __Pyx_XGIVEREF(__pyx_r);
12294 __Pyx_RefNannyFinishContext();
12307 static PyObject *__pyx_memoryview___str__(PyObject *__pyx_v_self);
12308 static PyObject *__pyx_memoryview___str__(PyObject *__pyx_v_self) {
12309 PyObject *__pyx_r = 0;
12310 __Pyx_RefNannyDeclarations
12311 __Pyx_RefNannySetupContext(
"__str__ (wrapper)", 0);
12312 __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_14__str__(((
struct __pyx_memoryview_obj *)__pyx_v_self));
12315 __Pyx_RefNannyFinishContext();
12319 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_14__str__(
struct __pyx_memoryview_obj *__pyx_v_self) {
12320 PyObject *__pyx_r = NULL;
12321 __Pyx_RefNannyDeclarations
12322 PyObject *__pyx_t_1 = NULL;
12323 PyObject *__pyx_t_2 = NULL;
12324 int __pyx_lineno = 0;
12325 const char *__pyx_filename = NULL;
12326 int __pyx_clineno = 0;
12327 __Pyx_RefNannySetupContext(
"__str__", 0);
12336 __Pyx_XDECREF(__pyx_r);
12337 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_base);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 616, __pyx_L1_error)
12338 __Pyx_GOTREF(__pyx_t_1);
12339 __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_class);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 616, __pyx_L1_error)
12340 __Pyx_GOTREF(__pyx_t_2);
12341 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
12342 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_name_2);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 616, __pyx_L1_error)
12343 __Pyx_GOTREF(__pyx_t_1);
12344 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
12345 __pyx_t_2 = PyTuple_New(1);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 616, __pyx_L1_error)
12346 __Pyx_GOTREF(__pyx_t_2);
12347 __Pyx_GIVEREF(__pyx_t_1);
12348 PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1);
12350 __pyx_t_1 = __Pyx_PyString_Format(__pyx_kp_s_MemoryView_of_r_object, __pyx_t_2);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 616, __pyx_L1_error)
12351 __Pyx_GOTREF(__pyx_t_1);
12352 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
12353 __pyx_r = __pyx_t_1;
12367 __Pyx_XDECREF(__pyx_t_1);
12368 __Pyx_XDECREF(__pyx_t_2);
12369 __Pyx_AddTraceback(
"View.MemoryView.memoryview.__str__", __pyx_clineno, __pyx_lineno, __pyx_filename);
12372 __Pyx_XGIVEREF(__pyx_r);
12373 __Pyx_RefNannyFinishContext();
12386 static PyObject *__pyx_memoryview_is_c_contig(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused);
12387 static PyObject *__pyx_memoryview_is_c_contig(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
12388 PyObject *__pyx_r = 0;
12389 __Pyx_RefNannyDeclarations
12390 __Pyx_RefNannySetupContext(
"is_c_contig (wrapper)", 0);
12391 __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_16is_c_contig(((
struct __pyx_memoryview_obj *)__pyx_v_self));
12394 __Pyx_RefNannyFinishContext();
12398 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_16is_c_contig(
struct __pyx_memoryview_obj *__pyx_v_self) {
12399 __Pyx_memviewslice *__pyx_v_mslice;
12400 __Pyx_memviewslice __pyx_v_tmp;
12401 PyObject *__pyx_r = NULL;
12402 __Pyx_RefNannyDeclarations
12403 __Pyx_memviewslice *__pyx_t_1;
12404 PyObject *__pyx_t_2 = NULL;
12405 int __pyx_lineno = 0;
12406 const char *__pyx_filename = NULL;
12407 int __pyx_clineno = 0;
12408 __Pyx_RefNannySetupContext(
"is_c_contig", 0);
12417 __pyx_t_1 = __pyx_memoryview_get_slice_from_memoryview(__pyx_v_self, (&__pyx_v_tmp));
if (unlikely(__pyx_t_1 == ((__Pyx_memviewslice *)NULL))) __PYX_ERR(0, 622, __pyx_L1_error)
12418 __pyx_v_mslice = __pyx_t_1;
12427 __Pyx_XDECREF(__pyx_r);
12428 __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_memviewslice_is_contig((__pyx_v_mslice[0]),
'C', __pyx_v_self->view.ndim));
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 623, __pyx_L1_error)
12429 __Pyx_GOTREF(__pyx_t_2);
12430 __pyx_r = __pyx_t_2;
12444 __Pyx_XDECREF(__pyx_t_2);
12445 __Pyx_AddTraceback(
"View.MemoryView.memoryview.is_c_contig", __pyx_clineno, __pyx_lineno, __pyx_filename);
12448 __Pyx_XGIVEREF(__pyx_r);
12449 __Pyx_RefNannyFinishContext();
12462 static PyObject *__pyx_memoryview_is_f_contig(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused);
12463 static PyObject *__pyx_memoryview_is_f_contig(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
12464 PyObject *__pyx_r = 0;
12465 __Pyx_RefNannyDeclarations
12466 __Pyx_RefNannySetupContext(
"is_f_contig (wrapper)", 0);
12467 __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_18is_f_contig(((
struct __pyx_memoryview_obj *)__pyx_v_self));
12470 __Pyx_RefNannyFinishContext();
12474 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_18is_f_contig(
struct __pyx_memoryview_obj *__pyx_v_self) {
12475 __Pyx_memviewslice *__pyx_v_mslice;
12476 __Pyx_memviewslice __pyx_v_tmp;
12477 PyObject *__pyx_r = NULL;
12478 __Pyx_RefNannyDeclarations
12479 __Pyx_memviewslice *__pyx_t_1;
12480 PyObject *__pyx_t_2 = NULL;
12481 int __pyx_lineno = 0;
12482 const char *__pyx_filename = NULL;
12483 int __pyx_clineno = 0;
12484 __Pyx_RefNannySetupContext(
"is_f_contig", 0);
12493 __pyx_t_1 = __pyx_memoryview_get_slice_from_memoryview(__pyx_v_self, (&__pyx_v_tmp));
if (unlikely(__pyx_t_1 == ((__Pyx_memviewslice *)NULL))) __PYX_ERR(0, 628, __pyx_L1_error)
12494 __pyx_v_mslice = __pyx_t_1;
12503 __Pyx_XDECREF(__pyx_r);
12504 __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_memviewslice_is_contig((__pyx_v_mslice[0]),
'F', __pyx_v_self->view.ndim));
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 629, __pyx_L1_error)
12505 __Pyx_GOTREF(__pyx_t_2);
12506 __pyx_r = __pyx_t_2;
12520 __Pyx_XDECREF(__pyx_t_2);
12521 __Pyx_AddTraceback(
"View.MemoryView.memoryview.is_f_contig", __pyx_clineno, __pyx_lineno, __pyx_filename);
12524 __Pyx_XGIVEREF(__pyx_r);
12525 __Pyx_RefNannyFinishContext();
12538 static PyObject *__pyx_memoryview_copy(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused);
12539 static PyObject *__pyx_memoryview_copy(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
12540 PyObject *__pyx_r = 0;
12541 __Pyx_RefNannyDeclarations
12542 __Pyx_RefNannySetupContext(
"copy (wrapper)", 0);
12543 __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_20copy(((
struct __pyx_memoryview_obj *)__pyx_v_self));
12546 __Pyx_RefNannyFinishContext();
12550 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_20copy(
struct __pyx_memoryview_obj *__pyx_v_self) {
12551 __Pyx_memviewslice __pyx_v_mslice;
12553 PyObject *__pyx_r = NULL;
12554 __Pyx_RefNannyDeclarations
12555 __Pyx_memviewslice __pyx_t_1;
12556 PyObject *__pyx_t_2 = NULL;
12557 int __pyx_lineno = 0;
12558 const char *__pyx_filename = NULL;
12559 int __pyx_clineno = 0;
12560 __Pyx_RefNannySetupContext(
"copy", 0);
12569 __pyx_v_flags = (__pyx_v_self->flags & (~PyBUF_F_CONTIGUOUS));
12578 __pyx_memoryview_slice_copy(__pyx_v_self, (&__pyx_v_mslice));
12587 __pyx_t_1 = __pyx_memoryview_copy_new_contig((&__pyx_v_mslice), ((
char *)
"c"), __pyx_v_self->view.ndim, __pyx_v_self->view.itemsize, (__pyx_v_flags | PyBUF_C_CONTIGUOUS), __pyx_v_self->dtype_is_object);
if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 636, __pyx_L1_error)
12588 __pyx_v_mslice = __pyx_t_1;
12597 __Pyx_XDECREF(__pyx_r);
12598 __pyx_t_2 = __pyx_memoryview_copy_object_from_slice(__pyx_v_self, (&__pyx_v_mslice));
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 641, __pyx_L1_error)
12599 __Pyx_GOTREF(__pyx_t_2);
12600 __pyx_r = __pyx_t_2;
12614 __Pyx_XDECREF(__pyx_t_2);
12615 __Pyx_AddTraceback(
"View.MemoryView.memoryview.copy", __pyx_clineno, __pyx_lineno, __pyx_filename);
12618 __Pyx_XGIVEREF(__pyx_r);
12619 __Pyx_RefNannyFinishContext();
12632 static PyObject *__pyx_memoryview_copy_fortran(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused);
12633 static PyObject *__pyx_memoryview_copy_fortran(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
12634 PyObject *__pyx_r = 0;
12635 __Pyx_RefNannyDeclarations
12636 __Pyx_RefNannySetupContext(
"copy_fortran (wrapper)", 0);
12637 __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_22copy_fortran(((
struct __pyx_memoryview_obj *)__pyx_v_self));
12640 __Pyx_RefNannyFinishContext();
12644 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_22copy_fortran(
struct __pyx_memoryview_obj *__pyx_v_self) {
12645 __Pyx_memviewslice __pyx_v_src;
12646 __Pyx_memviewslice __pyx_v_dst;
12648 PyObject *__pyx_r = NULL;
12649 __Pyx_RefNannyDeclarations
12650 __Pyx_memviewslice __pyx_t_1;
12651 PyObject *__pyx_t_2 = NULL;
12652 int __pyx_lineno = 0;
12653 const char *__pyx_filename = NULL;
12654 int __pyx_clineno = 0;
12655 __Pyx_RefNannySetupContext(
"copy_fortran", 0);
12664 __pyx_v_flags = (__pyx_v_self->flags & (~PyBUF_C_CONTIGUOUS));
12673 __pyx_memoryview_slice_copy(__pyx_v_self, (&__pyx_v_src));
12682 __pyx_t_1 = __pyx_memoryview_copy_new_contig((&__pyx_v_src), ((
char *)
"fortran"), __pyx_v_self->view.ndim, __pyx_v_self->view.itemsize, (__pyx_v_flags | PyBUF_F_CONTIGUOUS), __pyx_v_self->dtype_is_object);
if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 648, __pyx_L1_error)
12683 __pyx_v_dst = __pyx_t_1;
12692 __Pyx_XDECREF(__pyx_r);
12693 __pyx_t_2 = __pyx_memoryview_copy_object_from_slice(__pyx_v_self, (&__pyx_v_dst));
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 653, __pyx_L1_error)
12694 __Pyx_GOTREF(__pyx_t_2);
12695 __pyx_r = __pyx_t_2;
12709 __Pyx_XDECREF(__pyx_t_2);
12710 __Pyx_AddTraceback(
"View.MemoryView.memoryview.copy_fortran", __pyx_clineno, __pyx_lineno, __pyx_filename);
12713 __Pyx_XGIVEREF(__pyx_r);
12714 __Pyx_RefNannyFinishContext();
12725 static PyObject *__pyx_pw___pyx_memoryview_1__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused);
12726 static PyObject *__pyx_pw___pyx_memoryview_1__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
12727 PyObject *__pyx_r = 0;
12728 __Pyx_RefNannyDeclarations
12729 __Pyx_RefNannySetupContext(
"__reduce_cython__ (wrapper)", 0);
12730 __pyx_r = __pyx_pf___pyx_memoryview___reduce_cython__(((
struct __pyx_memoryview_obj *)__pyx_v_self));
12733 __Pyx_RefNannyFinishContext();
12737 static PyObject *__pyx_pf___pyx_memoryview___reduce_cython__(CYTHON_UNUSED
struct __pyx_memoryview_obj *__pyx_v_self) {
12738 PyObject *__pyx_r = NULL;
12739 __Pyx_RefNannyDeclarations
12740 PyObject *__pyx_t_1 = NULL;
12741 int __pyx_lineno = 0;
12742 const char *__pyx_filename = NULL;
12743 int __pyx_clineno = 0;
12744 __Pyx_RefNannySetupContext(
"__reduce_cython__", 0);
12752 __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__28, NULL);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2, __pyx_L1_error)
12753 __Pyx_GOTREF(__pyx_t_1);
12754 __Pyx_Raise(__pyx_t_1, 0, 0, 0);
12755 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
12756 __PYX_ERR(0, 2, __pyx_L1_error)
12766 __Pyx_XDECREF(__pyx_t_1);
12767 __Pyx_AddTraceback(
"View.MemoryView.memoryview.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
12769 __Pyx_XGIVEREF(__pyx_r);
12770 __Pyx_RefNannyFinishContext();
12782 static PyObject *__pyx_pw___pyx_memoryview_3__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state);
12783 static PyObject *__pyx_pw___pyx_memoryview_3__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
12784 PyObject *__pyx_r = 0;
12785 __Pyx_RefNannyDeclarations
12786 __Pyx_RefNannySetupContext(
"__setstate_cython__ (wrapper)", 0);
12787 __pyx_r = __pyx_pf___pyx_memoryview_2__setstate_cython__(((
struct __pyx_memoryview_obj *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state));
12790 __Pyx_RefNannyFinishContext();
12794 static PyObject *__pyx_pf___pyx_memoryview_2__setstate_cython__(CYTHON_UNUSED
struct __pyx_memoryview_obj *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) {
12795 PyObject *__pyx_r = NULL;
12796 __Pyx_RefNannyDeclarations
12797 PyObject *__pyx_t_1 = NULL;
12798 int __pyx_lineno = 0;
12799 const char *__pyx_filename = NULL;
12800 int __pyx_clineno = 0;
12801 __Pyx_RefNannySetupContext(
"__setstate_cython__", 0);
12808 __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__29, NULL);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4, __pyx_L1_error)
12809 __Pyx_GOTREF(__pyx_t_1);
12810 __Pyx_Raise(__pyx_t_1, 0, 0, 0);
12811 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
12812 __PYX_ERR(0, 4, __pyx_L1_error)
12823 __Pyx_XDECREF(__pyx_t_1);
12824 __Pyx_AddTraceback(
"View.MemoryView.memoryview.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
12826 __Pyx_XGIVEREF(__pyx_r);
12827 __Pyx_RefNannyFinishContext();
12839 static PyObject *__pyx_memoryview_new(PyObject *__pyx_v_o,
int __pyx_v_flags,
int __pyx_v_dtype_is_object, __Pyx_TypeInfo *__pyx_v_typeinfo) {
12840 struct __pyx_memoryview_obj *__pyx_v_result = 0;
12841 PyObject *__pyx_r = NULL;
12842 __Pyx_RefNannyDeclarations
12843 PyObject *__pyx_t_1 = NULL;
12844 PyObject *__pyx_t_2 = NULL;
12845 PyObject *__pyx_t_3 = NULL;
12846 int __pyx_lineno = 0;
12847 const char *__pyx_filename = NULL;
12848 int __pyx_clineno = 0;
12849 __Pyx_RefNannySetupContext(
"memoryview_cwrapper", 0);
12858 __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_flags);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 658, __pyx_L1_error)
12859 __Pyx_GOTREF(__pyx_t_1);
12860 __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_v_dtype_is_object);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 658, __pyx_L1_error)
12861 __Pyx_GOTREF(__pyx_t_2);
12862 __pyx_t_3 = PyTuple_New(3);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 658, __pyx_L1_error)
12863 __Pyx_GOTREF(__pyx_t_3);
12864 __Pyx_INCREF(__pyx_v_o);
12865 __Pyx_GIVEREF(__pyx_v_o);
12866 PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_o);
12867 __Pyx_GIVEREF(__pyx_t_1);
12868 PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_1);
12869 __Pyx_GIVEREF(__pyx_t_2);
12870 PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_t_2);
12873 __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_memoryview_type), __pyx_t_3, NULL);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 658, __pyx_L1_error)
12874 __Pyx_GOTREF(__pyx_t_2);
12875 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
12876 __pyx_v_result = ((
struct __pyx_memoryview_obj *)__pyx_t_2);
12886 __pyx_v_result->typeinfo = __pyx_v_typeinfo;
12895 __Pyx_XDECREF(__pyx_r);
12896 __Pyx_INCREF(((PyObject *)__pyx_v_result));
12897 __pyx_r = ((PyObject *)__pyx_v_result);
12910 __Pyx_XDECREF(__pyx_t_1);
12911 __Pyx_XDECREF(__pyx_t_2);
12912 __Pyx_XDECREF(__pyx_t_3);
12913 __Pyx_AddTraceback(
"View.MemoryView.memoryview_cwrapper", __pyx_clineno, __pyx_lineno, __pyx_filename);
12916 __Pyx_XDECREF((PyObject *)__pyx_v_result);
12917 __Pyx_XGIVEREF(__pyx_r);
12918 __Pyx_RefNannyFinishContext();
12930 static CYTHON_INLINE
int __pyx_memoryview_check(PyObject *__pyx_v_o) {
12932 __Pyx_RefNannyDeclarations
12934 __Pyx_RefNannySetupContext(
"memoryview_check", 0);
12943 __pyx_t_1 = __Pyx_TypeCheck(__pyx_v_o, __pyx_memoryview_type);
12944 __pyx_r = __pyx_t_1;
12957 __Pyx_RefNannyFinishContext();
12969 static PyObject *_unellipsify(PyObject *__pyx_v_index,
int __pyx_v_ndim) {
12970 PyObject *__pyx_v_tup = NULL;
12971 PyObject *__pyx_v_result = NULL;
12972 int __pyx_v_have_slices;
12973 int __pyx_v_seen_ellipsis;
12974 CYTHON_UNUSED PyObject *__pyx_v_idx = NULL;
12975 PyObject *__pyx_v_item = NULL;
12976 Py_ssize_t __pyx_v_nslices;
12977 PyObject *__pyx_r = NULL;
12978 __Pyx_RefNannyDeclarations
12981 PyObject *__pyx_t_3 = NULL;
12982 PyObject *__pyx_t_4 = NULL;
12983 Py_ssize_t __pyx_t_5;
12984 PyObject *(*__pyx_t_6)(PyObject *);
12985 PyObject *__pyx_t_7 = NULL;
12986 Py_ssize_t __pyx_t_8;
12989 PyObject *__pyx_t_11 = NULL;
12990 int __pyx_lineno = 0;
12991 const char *__pyx_filename = NULL;
12992 int __pyx_clineno = 0;
12993 __Pyx_RefNannySetupContext(
"_unellipsify", 0);
13002 __pyx_t_1 = PyTuple_Check(__pyx_v_index);
13003 __pyx_t_2 = ((!(__pyx_t_1 != 0)) != 0);
13013 __pyx_t_3 = PyTuple_New(1);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 672, __pyx_L1_error)
13014 __Pyx_GOTREF(__pyx_t_3);
13015 __Pyx_INCREF(__pyx_v_index);
13016 __Pyx_GIVEREF(__pyx_v_index);
13017 PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_index);
13018 __pyx_v_tup = __pyx_t_3;
13039 __Pyx_INCREF(__pyx_v_index);
13040 __pyx_v_tup = __pyx_v_index;
13051 __pyx_t_3 = PyList_New(0);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 676, __pyx_L1_error)
13052 __Pyx_GOTREF(__pyx_t_3);
13053 __pyx_v_result = ((PyObject*)__pyx_t_3);
13063 __pyx_v_have_slices = 0;
13072 __pyx_v_seen_ellipsis = 0;
13081 __Pyx_INCREF(__pyx_int_0);
13082 __pyx_t_3 = __pyx_int_0;
13083 if (likely(PyList_CheckExact(__pyx_v_tup)) || PyTuple_CheckExact(__pyx_v_tup)) {
13084 __pyx_t_4 = __pyx_v_tup; __Pyx_INCREF(__pyx_t_4); __pyx_t_5 = 0;
13087 __pyx_t_5 = -1; __pyx_t_4 = PyObject_GetIter(__pyx_v_tup);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 679, __pyx_L1_error)
13088 __Pyx_GOTREF(__pyx_t_4);
13089 __pyx_t_6 = Py_TYPE(__pyx_t_4)->tp_iternext;
if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 679, __pyx_L1_error)
13092 if (likely(!__pyx_t_6)) {
13093 if (likely(PyList_CheckExact(__pyx_t_4))) {
13094 if (__pyx_t_5 >= PyList_GET_SIZE(__pyx_t_4))
break;
13095 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
13096 __pyx_t_7 = PyList_GET_ITEM(__pyx_t_4, __pyx_t_5); __Pyx_INCREF(__pyx_t_7); __pyx_t_5++;
if (unlikely(0 < 0)) __PYX_ERR(0, 679, __pyx_L1_error)
13098 __pyx_t_7 = PySequence_ITEM(__pyx_t_4, __pyx_t_5); __pyx_t_5++;
if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 679, __pyx_L1_error)
13099 __Pyx_GOTREF(__pyx_t_7);
13102 if (__pyx_t_5 >= PyTuple_GET_SIZE(__pyx_t_4))
break;
13103 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
13104 __pyx_t_7 = PyTuple_GET_ITEM(__pyx_t_4, __pyx_t_5); __Pyx_INCREF(__pyx_t_7); __pyx_t_5++;
if (unlikely(0 < 0)) __PYX_ERR(0, 679, __pyx_L1_error)
13106 __pyx_t_7 = PySequence_ITEM(__pyx_t_4, __pyx_t_5); __pyx_t_5++;
if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 679, __pyx_L1_error)
13107 __Pyx_GOTREF(__pyx_t_7);
13111 __pyx_t_7 = __pyx_t_6(__pyx_t_4);
13112 if (unlikely(!__pyx_t_7)) {
13113 PyObject* exc_type = PyErr_Occurred();
13115 if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
13116 else __PYX_ERR(0, 679, __pyx_L1_error)
13120 __Pyx_GOTREF(__pyx_t_7);
13122 __Pyx_XDECREF_SET(__pyx_v_item, __pyx_t_7);
13124 __Pyx_INCREF(__pyx_t_3);
13125 __Pyx_XDECREF_SET(__pyx_v_idx, __pyx_t_3);
13126 __pyx_t_7 = __Pyx_PyInt_AddObjC(__pyx_t_3, __pyx_int_1, 1, 0, 0);
if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 679, __pyx_L1_error)
13127 __Pyx_GOTREF(__pyx_t_7);
13128 __Pyx_DECREF(__pyx_t_3);
13129 __pyx_t_3 = __pyx_t_7;
13139 __pyx_t_2 = (__pyx_v_item == __pyx_builtin_Ellipsis);
13140 __pyx_t_1 = (__pyx_t_2 != 0);
13150 __pyx_t_1 = ((!(__pyx_v_seen_ellipsis != 0)) != 0);
13160 __pyx_t_8 = PyObject_Length(__pyx_v_tup);
if (unlikely(__pyx_t_8 == ((Py_ssize_t)-1))) __PYX_ERR(0, 682, __pyx_L1_error)
13161 __pyx_t_7 = PyList_New(1 * ((((__pyx_v_ndim - __pyx_t_8) + 1)<0) ? 0:((__pyx_v_ndim - __pyx_t_8) + 1)));
if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 682, __pyx_L1_error)
13162 __Pyx_GOTREF(__pyx_t_7);
13163 { Py_ssize_t __pyx_temp;
13164 for (__pyx_temp=0; __pyx_temp < ((__pyx_v_ndim - __pyx_t_8) + 1); __pyx_temp++) {
13165 __Pyx_INCREF(__pyx_slice__30);
13166 __Pyx_GIVEREF(__pyx_slice__30);
13167 PyList_SET_ITEM(__pyx_t_7, __pyx_temp, __pyx_slice__30);
13170 __pyx_t_9 = __Pyx_PyList_Extend(__pyx_v_result, __pyx_t_7);
if (unlikely(__pyx_t_9 == ((
int)-1))) __PYX_ERR(0, 682, __pyx_L1_error)
13171 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
13180 __pyx_v_seen_ellipsis = 1;
13200 __pyx_t_9 = __Pyx_PyList_Append(__pyx_v_result, __pyx_slice__30);
if (unlikely(__pyx_t_9 == ((
int)-1))) __PYX_ERR(0, 685, __pyx_L1_error)
13211 __pyx_v_have_slices = 1;
13231 __pyx_t_2 = PySlice_Check(__pyx_v_item);
13232 __pyx_t_10 = ((!(__pyx_t_2 != 0)) != 0);
13235 __pyx_t_1 = __pyx_t_10;
13236 goto __pyx_L9_bool_binop_done;
13238 __pyx_t_10 = ((!(PyIndex_Check(__pyx_v_item) != 0)) != 0);
13239 __pyx_t_1 = __pyx_t_10;
13240 __pyx_L9_bool_binop_done:;
13241 if (unlikely(__pyx_t_1)) {
13250 __pyx_t_7 = __Pyx_PyString_FormatSafe(__pyx_kp_s_Cannot_index_with_type_s, ((PyObject *)Py_TYPE(__pyx_v_item)));
if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 689, __pyx_L1_error)
13251 __Pyx_GOTREF(__pyx_t_7);
13252 __pyx_t_11 = __Pyx_PyObject_CallOneArg(__pyx_builtin_TypeError, __pyx_t_7);
if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 689, __pyx_L1_error)
13253 __Pyx_GOTREF(__pyx_t_11);
13254 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
13255 __Pyx_Raise(__pyx_t_11, 0, 0, 0);
13256 __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
13257 __PYX_ERR(0, 689, __pyx_L1_error)
13275 __pyx_t_10 = (__pyx_v_have_slices != 0);
13278 __pyx_t_1 = __pyx_t_10;
13279 goto __pyx_L11_bool_binop_done;
13281 __pyx_t_10 = PySlice_Check(__pyx_v_item);
13282 __pyx_t_2 = (__pyx_t_10 != 0);
13283 __pyx_t_1 = __pyx_t_2;
13284 __pyx_L11_bool_binop_done:;
13285 __pyx_v_have_slices = __pyx_t_1;
13294 __pyx_t_9 = __Pyx_PyList_Append(__pyx_v_result, __pyx_v_item);
if (unlikely(__pyx_t_9 == ((
int)-1))) __PYX_ERR(0, 692, __pyx_L1_error)
13306 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
13307 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
13316 __pyx_t_5 = PyList_GET_SIZE(__pyx_v_result);
if (unlikely(__pyx_t_5 == ((Py_ssize_t)-1))) __PYX_ERR(0, 694, __pyx_L1_error)
13317 __pyx_v_nslices = (__pyx_v_ndim - __pyx_t_5);
13326 __pyx_t_1 = (__pyx_v_nslices != 0);
13336 __pyx_t_3 = PyList_New(1 * ((__pyx_v_nslices<0) ? 0:__pyx_v_nslices));
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 696, __pyx_L1_error)
13337 __Pyx_GOTREF(__pyx_t_3);
13338 { Py_ssize_t __pyx_temp;
13339 for (__pyx_temp=0; __pyx_temp < __pyx_v_nslices; __pyx_temp++) {
13340 __Pyx_INCREF(__pyx_slice__30);
13341 __Pyx_GIVEREF(__pyx_slice__30);
13342 PyList_SET_ITEM(__pyx_t_3, __pyx_temp, __pyx_slice__30);
13345 __pyx_t_9 = __Pyx_PyList_Extend(__pyx_v_result, __pyx_t_3);
if (unlikely(__pyx_t_9 == ((
int)-1))) __PYX_ERR(0, 696, __pyx_L1_error)
13346 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
13364 __Pyx_XDECREF(__pyx_r);
13365 if (!__pyx_v_have_slices) {
13367 __pyx_t_4 = __Pyx_PyBool_FromLong(__pyx_v_have_slices);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 698, __pyx_L1_error)
13368 __Pyx_GOTREF(__pyx_t_4);
13369 __pyx_t_3 = __pyx_t_4;
13371 goto __pyx_L14_bool_binop_done;
13373 __pyx_t_4 = PyInt_FromSsize_t(__pyx_v_nslices);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 698, __pyx_L1_error)
13374 __Pyx_GOTREF(__pyx_t_4);
13375 __pyx_t_3 = __pyx_t_4;
13377 __pyx_L14_bool_binop_done:;
13378 __pyx_t_4 = PyList_AsTuple(__pyx_v_result);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 698, __pyx_L1_error)
13379 __Pyx_GOTREF(__pyx_t_4);
13380 __pyx_t_11 = PyTuple_New(2);
if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 698, __pyx_L1_error)
13381 __Pyx_GOTREF(__pyx_t_11);
13382 __Pyx_GIVEREF(__pyx_t_3);
13383 PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_t_3);
13384 __Pyx_GIVEREF(__pyx_t_4);
13385 PyTuple_SET_ITEM(__pyx_t_11, 1, __pyx_t_4);
13388 __pyx_r = ((PyObject*)__pyx_t_11);
13402 __Pyx_XDECREF(__pyx_t_3);
13403 __Pyx_XDECREF(__pyx_t_4);
13404 __Pyx_XDECREF(__pyx_t_7);
13405 __Pyx_XDECREF(__pyx_t_11);
13406 __Pyx_AddTraceback(
"View.MemoryView._unellipsify", __pyx_clineno, __pyx_lineno, __pyx_filename);
13409 __Pyx_XDECREF(__pyx_v_tup);
13410 __Pyx_XDECREF(__pyx_v_result);
13411 __Pyx_XDECREF(__pyx_v_idx);
13412 __Pyx_XDECREF(__pyx_v_item);
13413 __Pyx_XGIVEREF(__pyx_r);
13414 __Pyx_RefNannyFinishContext();
13426 static PyObject *assert_direct_dimensions(Py_ssize_t *__pyx_v_suboffsets,
int __pyx_v_ndim) {
13427 Py_ssize_t __pyx_v_suboffset;
13428 PyObject *__pyx_r = NULL;
13429 __Pyx_RefNannyDeclarations
13430 Py_ssize_t *__pyx_t_1;
13431 Py_ssize_t *__pyx_t_2;
13432 Py_ssize_t *__pyx_t_3;
13434 PyObject *__pyx_t_5 = NULL;
13435 int __pyx_lineno = 0;
13436 const char *__pyx_filename = NULL;
13437 int __pyx_clineno = 0;
13438 __Pyx_RefNannySetupContext(
"assert_direct_dimensions", 0);
13447 __pyx_t_2 = (__pyx_v_suboffsets + __pyx_v_ndim);
13448 for (__pyx_t_3 = __pyx_v_suboffsets; __pyx_t_3 < __pyx_t_2; __pyx_t_3++) {
13449 __pyx_t_1 = __pyx_t_3;
13450 __pyx_v_suboffset = (__pyx_t_1[0]);
13459 __pyx_t_4 = ((__pyx_v_suboffset >= 0) != 0);
13460 if (unlikely(__pyx_t_4)) {
13469 __pyx_t_5 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__31, NULL);
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 703, __pyx_L1_error)
13470 __Pyx_GOTREF(__pyx_t_5);
13471 __Pyx_Raise(__pyx_t_5, 0, 0, 0);
13472 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
13473 __PYX_ERR(0, 703, __pyx_L1_error)
13494 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
13497 __Pyx_XDECREF(__pyx_t_5);
13498 __Pyx_AddTraceback(
"View.MemoryView.assert_direct_dimensions", __pyx_clineno, __pyx_lineno, __pyx_filename);
13501 __Pyx_XGIVEREF(__pyx_r);
13502 __Pyx_RefNannyFinishContext();
13514 static struct __pyx_memoryview_obj *__pyx_memview_slice(
struct __pyx_memoryview_obj *__pyx_v_memview, PyObject *__pyx_v_indices) {
13515 int __pyx_v_new_ndim;
13516 int __pyx_v_suboffset_dim;
13518 __Pyx_memviewslice __pyx_v_src;
13519 __Pyx_memviewslice __pyx_v_dst;
13520 __Pyx_memviewslice *__pyx_v_p_src;
13521 struct __pyx_memoryviewslice_obj *__pyx_v_memviewsliceobj = 0;
13522 __Pyx_memviewslice *__pyx_v_p_dst;
13523 int *__pyx_v_p_suboffset_dim;
13524 Py_ssize_t __pyx_v_start;
13525 Py_ssize_t __pyx_v_stop;
13526 Py_ssize_t __pyx_v_step;
13527 int __pyx_v_have_start;
13528 int __pyx_v_have_stop;
13529 int __pyx_v_have_step;
13530 PyObject *__pyx_v_index = NULL;
13531 struct __pyx_memoryview_obj *__pyx_r = NULL;
13532 __Pyx_RefNannyDeclarations
13535 PyObject *__pyx_t_3 = NULL;
13536 struct __pyx_memoryview_obj *__pyx_t_4;
13539 Py_ssize_t __pyx_t_7;
13540 PyObject *(*__pyx_t_8)(PyObject *);
13541 PyObject *__pyx_t_9 = NULL;
13542 Py_ssize_t __pyx_t_10;
13544 Py_ssize_t __pyx_t_12;
13545 int __pyx_lineno = 0;
13546 const char *__pyx_filename = NULL;
13547 int __pyx_clineno = 0;
13548 __Pyx_RefNannySetupContext(
"memview_slice", 0);
13557 __pyx_v_new_ndim = 0;
13558 __pyx_v_suboffset_dim = -1;
13567 (void)(memset((&__pyx_v_dst), 0, (
sizeof(__pyx_v_dst))));
13576 #ifndef CYTHON_WITHOUT_ASSERTIONS
13577 if (unlikely(!Py_OptimizeFlag)) {
13578 if (unlikely(!((__pyx_v_memview->view.ndim > 0) != 0))) {
13579 PyErr_SetNone(PyExc_AssertionError);
13580 __PYX_ERR(0, 722, __pyx_L1_error)
13592 __pyx_t_1 = __Pyx_TypeCheck(((PyObject *)__pyx_v_memview), __pyx_memoryviewslice_type);
13593 __pyx_t_2 = (__pyx_t_1 != 0);
13603 if (!(likely(((((PyObject *)__pyx_v_memview)) == Py_None) || likely(__Pyx_TypeTest(((PyObject *)__pyx_v_memview), __pyx_memoryviewslice_type))))) __PYX_ERR(0, 725, __pyx_L1_error)
13604 __pyx_t_3 = ((PyObject *)__pyx_v_memview);
13605 __Pyx_INCREF(__pyx_t_3);
13606 __pyx_v_memviewsliceobj = ((
struct __pyx_memoryviewslice_obj *)__pyx_t_3);
13616 __pyx_v_p_src = (&__pyx_v_memviewsliceobj->from_slice);
13636 __pyx_memoryview_slice_copy(__pyx_v_memview, (&__pyx_v_src));
13645 __pyx_v_p_src = (&__pyx_v_src);
13656 __pyx_t_4 = __pyx_v_p_src->memview;
13657 __pyx_v_dst.memview = __pyx_t_4;
13666 __pyx_t_5 = __pyx_v_p_src->data;
13667 __pyx_v_dst.data = __pyx_t_5;
13676 __pyx_v_p_dst = (&__pyx_v_dst);
13685 __pyx_v_p_suboffset_dim = (&__pyx_v_suboffset_dim);
13695 if (likely(PyList_CheckExact(__pyx_v_indices)) || PyTuple_CheckExact(__pyx_v_indices)) {
13696 __pyx_t_3 = __pyx_v_indices; __Pyx_INCREF(__pyx_t_3); __pyx_t_7 = 0;
13699 __pyx_t_7 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_v_indices);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 746, __pyx_L1_error)
13700 __Pyx_GOTREF(__pyx_t_3);
13701 __pyx_t_8 = Py_TYPE(__pyx_t_3)->tp_iternext;
if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 746, __pyx_L1_error)
13704 if (likely(!__pyx_t_8)) {
13705 if (likely(PyList_CheckExact(__pyx_t_3))) {
13706 if (__pyx_t_7 >= PyList_GET_SIZE(__pyx_t_3))
break;
13707 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
13708 __pyx_t_9 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_7); __Pyx_INCREF(__pyx_t_9); __pyx_t_7++;
if (unlikely(0 < 0)) __PYX_ERR(0, 746, __pyx_L1_error)
13710 __pyx_t_9 = PySequence_ITEM(__pyx_t_3, __pyx_t_7); __pyx_t_7++;
if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 746, __pyx_L1_error)
13711 __Pyx_GOTREF(__pyx_t_9);
13714 if (__pyx_t_7 >= PyTuple_GET_SIZE(__pyx_t_3))
break;
13715 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
13716 __pyx_t_9 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_7); __Pyx_INCREF(__pyx_t_9); __pyx_t_7++;
if (unlikely(0 < 0)) __PYX_ERR(0, 746, __pyx_L1_error)
13718 __pyx_t_9 = PySequence_ITEM(__pyx_t_3, __pyx_t_7); __pyx_t_7++;
if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 746, __pyx_L1_error)
13719 __Pyx_GOTREF(__pyx_t_9);
13723 __pyx_t_9 = __pyx_t_8(__pyx_t_3);
13724 if (unlikely(!__pyx_t_9)) {
13725 PyObject* exc_type = PyErr_Occurred();
13727 if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
13728 else __PYX_ERR(0, 746, __pyx_L1_error)
13732 __Pyx_GOTREF(__pyx_t_9);
13734 __Pyx_XDECREF_SET(__pyx_v_index, __pyx_t_9);
13736 __pyx_v_dim = __pyx_t_6;
13737 __pyx_t_6 = (__pyx_t_6 + 1);
13746 __pyx_t_2 = (PyIndex_Check(__pyx_v_index) != 0);
13756 __pyx_t_10 = __Pyx_PyIndex_AsSsize_t(__pyx_v_index);
if (unlikely((__pyx_t_10 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 751, __pyx_L1_error)
13765 __pyx_t_11 = __pyx_memoryview_slice_memviewslice(__pyx_v_p_dst, (__pyx_v_p_src->shape[__pyx_v_dim]), (__pyx_v_p_src->strides[__pyx_v_dim]), (__pyx_v_p_src->suboffsets[__pyx_v_dim]), __pyx_v_dim, __pyx_v_new_ndim, __pyx_v_p_suboffset_dim, __pyx_t_10, 0, 0, 0, 0, 0, 0);
if (unlikely(__pyx_t_11 == ((
int)-1))) __PYX_ERR(0, 748, __pyx_L1_error)
13784 __pyx_t_2 = (__pyx_v_index == Py_None);
13785 __pyx_t_1 = (__pyx_t_2 != 0);
13795 (__pyx_v_p_dst->shape[__pyx_v_new_ndim]) = 1;
13804 (__pyx_v_p_dst->strides[__pyx_v_new_ndim]) = 0;
13813 (__pyx_v_p_dst->suboffsets[__pyx_v_new_ndim]) = -1
L;
13822 __pyx_v_new_ndim = (__pyx_v_new_ndim + 1);
13842 __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_start);
if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 760, __pyx_L1_error)
13843 __Pyx_GOTREF(__pyx_t_9);
13844 __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_9);
if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 760, __pyx_L1_error)
13846 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
13848 __pyx_t_12 = __Pyx_PyIndex_AsSsize_t(__pyx_t_9);
if (unlikely((__pyx_t_12 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 760, __pyx_L1_error)
13849 __pyx_t_10 = __pyx_t_12;
13850 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
13851 goto __pyx_L7_bool_binop_done;
13854 __pyx_L7_bool_binop_done:;
13855 __pyx_v_start = __pyx_t_10;
13864 __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_stop);
if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 761, __pyx_L1_error)
13865 __Pyx_GOTREF(__pyx_t_9);
13866 __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_9);
if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 761, __pyx_L1_error)
13868 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
13870 __pyx_t_12 = __Pyx_PyIndex_AsSsize_t(__pyx_t_9);
if (unlikely((__pyx_t_12 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 761, __pyx_L1_error)
13871 __pyx_t_10 = __pyx_t_12;
13872 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
13873 goto __pyx_L9_bool_binop_done;
13876 __pyx_L9_bool_binop_done:;
13877 __pyx_v_stop = __pyx_t_10;
13886 __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_step);
if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 762, __pyx_L1_error)
13887 __Pyx_GOTREF(__pyx_t_9);
13888 __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_9);
if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 762, __pyx_L1_error)
13890 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
13892 __pyx_t_12 = __Pyx_PyIndex_AsSsize_t(__pyx_t_9);
if (unlikely((__pyx_t_12 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 762, __pyx_L1_error)
13893 __pyx_t_10 = __pyx_t_12;
13894 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
13895 goto __pyx_L11_bool_binop_done;
13898 __pyx_L11_bool_binop_done:;
13899 __pyx_v_step = __pyx_t_10;
13908 __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_start);
if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 764, __pyx_L1_error)
13909 __Pyx_GOTREF(__pyx_t_9);
13910 __pyx_t_1 = (__pyx_t_9 != Py_None);
13911 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
13912 __pyx_v_have_start = __pyx_t_1;
13921 __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_stop);
if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 765, __pyx_L1_error)
13922 __Pyx_GOTREF(__pyx_t_9);
13923 __pyx_t_1 = (__pyx_t_9 != Py_None);
13924 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
13925 __pyx_v_have_stop = __pyx_t_1;
13934 __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_step);
if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 766, __pyx_L1_error)
13935 __Pyx_GOTREF(__pyx_t_9);
13936 __pyx_t_1 = (__pyx_t_9 != Py_None);
13937 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
13938 __pyx_v_have_step = __pyx_t_1;
13947 __pyx_t_11 = __pyx_memoryview_slice_memviewslice(__pyx_v_p_dst, (__pyx_v_p_src->shape[__pyx_v_dim]), (__pyx_v_p_src->strides[__pyx_v_dim]), (__pyx_v_p_src->suboffsets[__pyx_v_dim]), __pyx_v_dim, __pyx_v_new_ndim, __pyx_v_p_suboffset_dim, __pyx_v_start, __pyx_v_stop, __pyx_v_step, __pyx_v_have_start, __pyx_v_have_stop, __pyx_v_have_step, 1);
if (unlikely(__pyx_t_11 == ((
int)-1))) __PYX_ERR(0, 768, __pyx_L1_error)
13956 __pyx_v_new_ndim = (__pyx_v_new_ndim + 1);
13968 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
13977 __pyx_t_1 = __Pyx_TypeCheck(((PyObject *)__pyx_v_memview), __pyx_memoryviewslice_type);
13978 __pyx_t_2 = (__pyx_t_1 != 0);
13988 __Pyx_XDECREF(((PyObject *)__pyx_r));
13997 if (unlikely(!__pyx_v_memviewsliceobj)) { __Pyx_RaiseUnboundLocalError(
"memviewsliceobj"); __PYX_ERR(0, 778, __pyx_L1_error) }
14006 if (unlikely(!__pyx_v_memviewsliceobj)) { __Pyx_RaiseUnboundLocalError(
"memviewsliceobj"); __PYX_ERR(0, 779, __pyx_L1_error) }
14015 __pyx_t_3 = __pyx_memoryview_fromslice(__pyx_v_dst, __pyx_v_new_ndim, __pyx_v_memviewsliceobj->to_object_func, __pyx_v_memviewsliceobj->to_dtype_func, __pyx_v_memview->dtype_is_object);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 777, __pyx_L1_error)
14016 __Pyx_GOTREF(__pyx_t_3);
14017 if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_memoryview_type))))) __PYX_ERR(0, 777, __pyx_L1_error)
14018 __pyx_r = ((
struct __pyx_memoryview_obj *)__pyx_t_3);
14039 __Pyx_XDECREF(((PyObject *)__pyx_r));
14048 __pyx_t_3 = __pyx_memoryview_fromslice(__pyx_v_dst, __pyx_v_new_ndim, NULL, NULL, __pyx_v_memview->dtype_is_object);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 782, __pyx_L1_error)
14049 __Pyx_GOTREF(__pyx_t_3);
14058 if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_memoryview_type))))) __PYX_ERR(0, 782, __pyx_L1_error)
14059 __pyx_r = ((
struct __pyx_memoryview_obj *)__pyx_t_3);
14074 __Pyx_XDECREF(__pyx_t_3);
14075 __Pyx_XDECREF(__pyx_t_9);
14076 __Pyx_AddTraceback(
"View.MemoryView.memview_slice", __pyx_clineno, __pyx_lineno, __pyx_filename);
14079 __Pyx_XDECREF((PyObject *)__pyx_v_memviewsliceobj);
14080 __Pyx_XDECREF(__pyx_v_index);
14081 __Pyx_XGIVEREF((PyObject *)__pyx_r);
14082 __Pyx_RefNannyFinishContext();
14094 static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst, Py_ssize_t __pyx_v_shape, Py_ssize_t __pyx_v_stride, Py_ssize_t __pyx_v_suboffset,
int __pyx_v_dim,
int __pyx_v_new_ndim,
int *__pyx_v_suboffset_dim, Py_ssize_t __pyx_v_start, Py_ssize_t __pyx_v_stop, Py_ssize_t __pyx_v_step,
int __pyx_v_have_start,
int __pyx_v_have_stop,
int __pyx_v_have_step,
int __pyx_v_is_slice) {
14095 Py_ssize_t __pyx_v_new_shape;
14096 int __pyx_v_negative_step;
14101 int __pyx_lineno = 0;
14102 const char *__pyx_filename = NULL;
14103 int __pyx_clineno = 0;
14112 __pyx_t_1 = ((!(__pyx_v_is_slice != 0)) != 0);
14122 __pyx_t_1 = ((__pyx_v_start < 0) != 0);
14132 __pyx_v_start = (__pyx_v_start + __pyx_v_shape);
14150 __pyx_t_1 = (0 <= __pyx_v_start);
14152 __pyx_t_1 = (__pyx_v_start < __pyx_v_shape);
14154 __pyx_t_2 = ((!(__pyx_t_1 != 0)) != 0);
14164 __pyx_t_3 = __pyx_memoryview_err_dim(__pyx_builtin_IndexError, ((
char *)
"Index out of bounds (axis %d)"), __pyx_v_dim);
if (unlikely(__pyx_t_3 == ((
int)-1))) __PYX_ERR(0, 832, __pyx_L1_error)
14193 __pyx_t_1 = ((__pyx_v_have_step != 0) != 0);
14196 __pyx_t_2 = __pyx_t_1;
14197 goto __pyx_L6_bool_binop_done;
14199 __pyx_t_1 = ((__pyx_v_step < 0) != 0);
14200 __pyx_t_2 = __pyx_t_1;
14201 __pyx_L6_bool_binop_done:;
14202 __pyx_v_negative_step = __pyx_t_2;
14211 __pyx_t_1 = (__pyx_v_have_step != 0);
14214 __pyx_t_2 = __pyx_t_1;
14215 goto __pyx_L9_bool_binop_done;
14217 __pyx_t_1 = ((__pyx_v_step == 0) != 0);
14218 __pyx_t_2 = __pyx_t_1;
14219 __pyx_L9_bool_binop_done:;
14229 __pyx_t_3 = __pyx_memoryview_err_dim(__pyx_builtin_ValueError, ((
char *)
"Step may not be zero (axis %d)"), __pyx_v_dim);
if (unlikely(__pyx_t_3 == ((
int)-1))) __PYX_ERR(0, 838, __pyx_L1_error)
14247 __pyx_t_2 = (__pyx_v_have_start != 0);
14257 __pyx_t_2 = ((__pyx_v_start < 0) != 0);
14267 __pyx_v_start = (__pyx_v_start + __pyx_v_shape);
14276 __pyx_t_2 = ((__pyx_v_start < 0) != 0);
14314 __pyx_t_2 = ((__pyx_v_start >= __pyx_v_shape) != 0);
14324 __pyx_t_2 = (__pyx_v_negative_step != 0);
14334 __pyx_v_start = (__pyx_v_shape - 1);
14354 __pyx_v_start = __pyx_v_shape;
14386 __pyx_t_2 = (__pyx_v_negative_step != 0);
14396 __pyx_v_start = (__pyx_v_shape - 1);
14429 __pyx_t_2 = (__pyx_v_have_stop != 0);
14439 __pyx_t_2 = ((__pyx_v_stop < 0) != 0);
14449 __pyx_v_stop = (__pyx_v_stop + __pyx_v_shape);
14458 __pyx_t_2 = ((__pyx_v_stop < 0) != 0);
14496 __pyx_t_2 = ((__pyx_v_stop > __pyx_v_shape) != 0);
14506 __pyx_v_stop = __pyx_v_shape;
14536 __pyx_t_2 = (__pyx_v_negative_step != 0);
14546 __pyx_v_stop = -1
L;
14566 __pyx_v_stop = __pyx_v_shape;
14579 __pyx_t_2 = ((!(__pyx_v_have_step != 0)) != 0);
14607 __pyx_v_new_shape = ((__pyx_v_stop - __pyx_v_start) / __pyx_v_step);
14616 __pyx_t_2 = (((__pyx_v_stop - __pyx_v_start) - (__pyx_v_step * __pyx_v_new_shape)) != 0);
14626 __pyx_v_new_shape = (__pyx_v_new_shape + 1);
14644 __pyx_t_2 = ((__pyx_v_new_shape < 0) != 0);
14654 __pyx_v_new_shape = 0;
14672 (__pyx_v_dst->strides[__pyx_v_new_ndim]) = (__pyx_v_stride * __pyx_v_step);
14681 (__pyx_v_dst->shape[__pyx_v_new_ndim]) = __pyx_v_new_shape;
14690 (__pyx_v_dst->suboffsets[__pyx_v_new_ndim]) = __pyx_v_suboffset;
14701 __pyx_t_2 = (((__pyx_v_suboffset_dim[0]) < 0) != 0);
14711 __pyx_v_dst->data = (__pyx_v_dst->data + (__pyx_v_start * __pyx_v_stride));
14731 __pyx_t_3 = (__pyx_v_suboffset_dim[0]);
14732 (__pyx_v_dst->suboffsets[__pyx_t_3]) = ((__pyx_v_dst->suboffsets[__pyx_t_3]) + (__pyx_v_start * __pyx_v_stride));
14743 __pyx_t_2 = ((__pyx_v_suboffset >= 0) != 0);
14753 __pyx_t_2 = ((!(__pyx_v_is_slice != 0)) != 0);
14763 __pyx_t_2 = ((__pyx_v_new_ndim == 0) != 0);
14773 __pyx_v_dst->data = ((((
char **)__pyx_v_dst->data)[0]) + __pyx_v_suboffset);
14801 __pyx_t_3 = __pyx_memoryview_err_dim(__pyx_builtin_IndexError, ((
char *)
"All dimensions preceding dimension %d must be indexed and not sliced"), __pyx_v_dim);
if (unlikely(__pyx_t_3 == ((
int)-1))) __PYX_ERR(0, 899, __pyx_L1_error)
14823 (__pyx_v_suboffset_dim[0]) = __pyx_v_new_ndim;
14858 PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
14860 __Pyx_AddTraceback(
"View.MemoryView.slice_memviewslice", __pyx_clineno, __pyx_lineno, __pyx_filename);
14862 __Pyx_PyGILState_Release(__pyx_gilstate_save);
14878 static char *__pyx_pybuffer_index(Py_buffer *__pyx_v_view,
char *__pyx_v_bufp, Py_ssize_t __pyx_v_index, Py_ssize_t __pyx_v_dim) {
14879 Py_ssize_t __pyx_v_shape;
14880 Py_ssize_t __pyx_v_stride;
14881 Py_ssize_t __pyx_v_suboffset;
14882 Py_ssize_t __pyx_v_itemsize;
14883 char *__pyx_v_resultp;
14885 __Pyx_RefNannyDeclarations
14886 Py_ssize_t __pyx_t_1;
14888 PyObject *__pyx_t_3 = NULL;
14889 PyObject *__pyx_t_4 = NULL;
14890 int __pyx_lineno = 0;
14891 const char *__pyx_filename = NULL;
14892 int __pyx_clineno = 0;
14893 __Pyx_RefNannySetupContext(
"pybuffer_index", 0);
14902 __pyx_v_suboffset = -1
L;
14911 __pyx_t_1 = __pyx_v_view->itemsize;
14912 __pyx_v_itemsize = __pyx_t_1;
14921 __pyx_t_2 = ((__pyx_v_view->ndim == 0) != 0);
14931 if (unlikely(__pyx_v_itemsize == 0)) {
14932 PyErr_SetString(PyExc_ZeroDivisionError,
"integer division or modulo by zero");
14933 __PYX_ERR(0, 917, __pyx_L1_error)
14935 else if (
sizeof(Py_ssize_t) ==
sizeof(
long) && (!(((Py_ssize_t)-1) > 0)) && unlikely(__pyx_v_itemsize == (Py_ssize_t)-1) && unlikely(UNARY_NEG_WOULD_OVERFLOW(__pyx_v_view->len))) {
14936 PyErr_SetString(PyExc_OverflowError,
"value too large to perform division");
14937 __PYX_ERR(0, 917, __pyx_L1_error)
14939 __pyx_v_shape = __Pyx_div_Py_ssize_t(__pyx_v_view->len, __pyx_v_itemsize);
14948 __pyx_v_stride = __pyx_v_itemsize;
14968 __pyx_v_shape = (__pyx_v_view->shape[__pyx_v_dim]);
14977 __pyx_v_stride = (__pyx_v_view->strides[__pyx_v_dim]);
14986 __pyx_t_2 = ((__pyx_v_view->suboffsets != NULL) != 0);
14996 __pyx_v_suboffset = (__pyx_v_view->suboffsets[__pyx_v_dim]);
15016 __pyx_t_2 = ((__pyx_v_index < 0) != 0);
15026 __pyx_v_index = (__pyx_v_index + (__pyx_v_view->shape[__pyx_v_dim]));
15035 __pyx_t_2 = ((__pyx_v_index < 0) != 0);
15036 if (unlikely(__pyx_t_2)) {
15045 __pyx_t_3 = PyInt_FromSsize_t(__pyx_v_dim);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 928, __pyx_L1_error)
15046 __Pyx_GOTREF(__pyx_t_3);
15047 __pyx_t_4 = __Pyx_PyString_Format(__pyx_kp_s_Out_of_bounds_on_buffer_access_a, __pyx_t_3);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 928, __pyx_L1_error)
15048 __Pyx_GOTREF(__pyx_t_4);
15049 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
15050 __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_builtin_IndexError, __pyx_t_4);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 928, __pyx_L1_error)
15051 __Pyx_GOTREF(__pyx_t_3);
15052 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
15053 __Pyx_Raise(__pyx_t_3, 0, 0, 0);
15054 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
15055 __PYX_ERR(0, 928, __pyx_L1_error)
15082 __pyx_t_2 = ((__pyx_v_index >= __pyx_v_shape) != 0);
15083 if (unlikely(__pyx_t_2)) {
15092 __pyx_t_3 = PyInt_FromSsize_t(__pyx_v_dim);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 931, __pyx_L1_error)
15093 __Pyx_GOTREF(__pyx_t_3);
15094 __pyx_t_4 = __Pyx_PyString_Format(__pyx_kp_s_Out_of_bounds_on_buffer_access_a, __pyx_t_3);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 931, __pyx_L1_error)
15095 __Pyx_GOTREF(__pyx_t_4);
15096 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
15097 __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_builtin_IndexError, __pyx_t_4);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 931, __pyx_L1_error)
15098 __Pyx_GOTREF(__pyx_t_3);
15099 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
15100 __Pyx_Raise(__pyx_t_3, 0, 0, 0);
15101 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
15102 __PYX_ERR(0, 931, __pyx_L1_error)
15120 __pyx_v_resultp = (__pyx_v_bufp + (__pyx_v_index * __pyx_v_stride));
15129 __pyx_t_2 = ((__pyx_v_suboffset >= 0) != 0);
15139 __pyx_v_resultp = ((((
char **)__pyx_v_resultp)[0]) + __pyx_v_suboffset);
15157 __pyx_r = __pyx_v_resultp;
15170 __Pyx_XDECREF(__pyx_t_3);
15171 __Pyx_XDECREF(__pyx_t_4);
15172 __Pyx_AddTraceback(
"View.MemoryView.pybuffer_index", __pyx_clineno, __pyx_lineno, __pyx_filename);
15175 __Pyx_RefNannyFinishContext();
15187 static int __pyx_memslice_transpose(__Pyx_memviewslice *__pyx_v_memslice) {
15189 Py_ssize_t *__pyx_v_shape;
15190 Py_ssize_t *__pyx_v_strides;
15195 Py_ssize_t *__pyx_t_2;
15198 Py_ssize_t __pyx_t_5;
15199 Py_ssize_t __pyx_t_6;
15203 int __pyx_lineno = 0;
15204 const char *__pyx_filename = NULL;
15205 int __pyx_clineno = 0;
15214 __pyx_t_1 = __pyx_v_memslice->memview->view.ndim;
15215 __pyx_v_ndim = __pyx_t_1;
15224 __pyx_t_2 = __pyx_v_memslice->shape;
15225 __pyx_v_shape = __pyx_t_2;
15234 __pyx_t_2 = __pyx_v_memslice->strides;
15235 __pyx_v_strides = __pyx_t_2;
15244 __pyx_t_3 = __Pyx_div_long(__pyx_v_ndim, 2);
15245 __pyx_t_4 = __pyx_t_3;
15246 for (__pyx_t_1 = 0; __pyx_t_1 < __pyx_t_4; __pyx_t_1+=1) {
15247 __pyx_v_i = __pyx_t_1;
15256 __pyx_v_j = ((__pyx_v_ndim - 1) - __pyx_v_i);
15265 __pyx_t_5 = (__pyx_v_strides[__pyx_v_j]);
15266 __pyx_t_6 = (__pyx_v_strides[__pyx_v_i]);
15267 (__pyx_v_strides[__pyx_v_i]) = __pyx_t_5;
15268 (__pyx_v_strides[__pyx_v_j]) = __pyx_t_6;
15277 __pyx_t_6 = (__pyx_v_shape[__pyx_v_j]);
15278 __pyx_t_5 = (__pyx_v_shape[__pyx_v_i]);
15279 (__pyx_v_shape[__pyx_v_i]) = __pyx_t_6;
15280 (__pyx_v_shape[__pyx_v_j]) = __pyx_t_5;
15289 __pyx_t_8 = (((__pyx_v_memslice->suboffsets[__pyx_v_i]) >= 0) != 0);
15292 __pyx_t_7 = __pyx_t_8;
15293 goto __pyx_L6_bool_binop_done;
15295 __pyx_t_8 = (((__pyx_v_memslice->suboffsets[__pyx_v_j]) >= 0) != 0);
15296 __pyx_t_7 = __pyx_t_8;
15297 __pyx_L6_bool_binop_done:;
15307 __pyx_t_9 = __pyx_memoryview_err(__pyx_builtin_ValueError, ((
char *)
"Cannot transpose memoryview with indirect dimensions"));
if (unlikely(__pyx_t_9 == ((
int)-1))) __PYX_ERR(0, 957, __pyx_L1_error)
15341 PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
15343 __Pyx_AddTraceback(
"View.MemoryView.transpose_memslice", __pyx_clineno, __pyx_lineno, __pyx_filename);
15345 __Pyx_PyGILState_Release(__pyx_gilstate_save);
15362 static void __pyx_memoryviewslice___dealloc__(PyObject *__pyx_v_self);
15363 static void __pyx_memoryviewslice___dealloc__(PyObject *__pyx_v_self) {
15364 __Pyx_RefNannyDeclarations
15365 __Pyx_RefNannySetupContext(
"__dealloc__ (wrapper)", 0);
15366 __pyx_memoryviewslice___pyx_pf_15View_dot_MemoryView_16_memoryviewslice___dealloc__(((
struct __pyx_memoryviewslice_obj *)__pyx_v_self));
15369 __Pyx_RefNannyFinishContext();
15372 static void __pyx_memoryviewslice___pyx_pf_15View_dot_MemoryView_16_memoryviewslice___dealloc__(
struct __pyx_memoryviewslice_obj *__pyx_v_self) {
15373 __Pyx_RefNannyDeclarations
15374 __Pyx_RefNannySetupContext(
"__dealloc__", 0);
15383 __PYX_XDEC_MEMVIEW((&__pyx_v_self->from_slice), 1);
15394 __Pyx_RefNannyFinishContext();
15405 static PyObject *__pyx_memoryviewslice_convert_item_to_object(
struct __pyx_memoryviewslice_obj *__pyx_v_self,
char *__pyx_v_itemp) {
15406 PyObject *__pyx_r = NULL;
15407 __Pyx_RefNannyDeclarations
15409 PyObject *__pyx_t_2 = NULL;
15410 int __pyx_lineno = 0;
15411 const char *__pyx_filename = NULL;
15412 int __pyx_clineno = 0;
15413 __Pyx_RefNannySetupContext(
"convert_item_to_object", 0);
15422 __pyx_t_1 = ((__pyx_v_self->to_object_func != NULL) != 0);
15432 __Pyx_XDECREF(__pyx_r);
15433 __pyx_t_2 = __pyx_v_self->to_object_func(__pyx_v_itemp);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 981, __pyx_L1_error)
15434 __Pyx_GOTREF(__pyx_t_2);
15435 __pyx_r = __pyx_t_2;
15456 __Pyx_XDECREF(__pyx_r);
15457 __pyx_t_2 = __pyx_memoryview_convert_item_to_object(((
struct __pyx_memoryview_obj *)__pyx_v_self), __pyx_v_itemp);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 983, __pyx_L1_error)
15458 __Pyx_GOTREF(__pyx_t_2);
15459 __pyx_r = __pyx_t_2;
15474 __Pyx_XDECREF(__pyx_t_2);
15475 __Pyx_AddTraceback(
"View.MemoryView._memoryviewslice.convert_item_to_object", __pyx_clineno, __pyx_lineno, __pyx_filename);
15478 __Pyx_XGIVEREF(__pyx_r);
15479 __Pyx_RefNannyFinishContext();
15491 static PyObject *__pyx_memoryviewslice_assign_item_from_object(
struct __pyx_memoryviewslice_obj *__pyx_v_self,
char *__pyx_v_itemp, PyObject *__pyx_v_value) {
15492 PyObject *__pyx_r = NULL;
15493 __Pyx_RefNannyDeclarations
15496 PyObject *__pyx_t_3 = NULL;
15497 int __pyx_lineno = 0;
15498 const char *__pyx_filename = NULL;
15499 int __pyx_clineno = 0;
15500 __Pyx_RefNannySetupContext(
"assign_item_from_object", 0);
15509 __pyx_t_1 = ((__pyx_v_self->to_dtype_func != NULL) != 0);
15519 __pyx_t_2 = __pyx_v_self->to_dtype_func(__pyx_v_itemp, __pyx_v_value);
if (unlikely(__pyx_t_2 == ((
int)0))) __PYX_ERR(0, 987, __pyx_L1_error)
15539 __pyx_t_3 = __pyx_memoryview_assign_item_from_object(((
struct __pyx_memoryview_obj *)__pyx_v_self), __pyx_v_itemp, __pyx_v_value);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 989, __pyx_L1_error)
15540 __Pyx_GOTREF(__pyx_t_3);
15541 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
15554 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
15557 __Pyx_XDECREF(__pyx_t_3);
15558 __Pyx_AddTraceback(
"View.MemoryView._memoryviewslice.assign_item_from_object", __pyx_clineno, __pyx_lineno, __pyx_filename);
15561 __Pyx_XGIVEREF(__pyx_r);
15562 __Pyx_RefNannyFinishContext();
15575 static PyObject *__pyx_pw_15View_dot_MemoryView_16_memoryviewslice_4base_1__get__(PyObject *__pyx_v_self);
15576 static PyObject *__pyx_pw_15View_dot_MemoryView_16_memoryviewslice_4base_1__get__(PyObject *__pyx_v_self) {
15577 PyObject *__pyx_r = 0;
15578 __Pyx_RefNannyDeclarations
15579 __Pyx_RefNannySetupContext(
"__get__ (wrapper)", 0);
15580 __pyx_r = __pyx_pf_15View_dot_MemoryView_16_memoryviewslice_4base___get__(((
struct __pyx_memoryviewslice_obj *)__pyx_v_self));
15583 __Pyx_RefNannyFinishContext();
15587 static PyObject *__pyx_pf_15View_dot_MemoryView_16_memoryviewslice_4base___get__(
struct __pyx_memoryviewslice_obj *__pyx_v_self) {
15588 PyObject *__pyx_r = NULL;
15589 __Pyx_RefNannyDeclarations
15590 __Pyx_RefNannySetupContext(
"__get__", 0);
15599 __Pyx_XDECREF(__pyx_r);
15600 __Pyx_INCREF(__pyx_v_self->from_object);
15601 __pyx_r = __pyx_v_self->from_object;
15614 __Pyx_XGIVEREF(__pyx_r);
15615 __Pyx_RefNannyFinishContext();
15626 static PyObject *__pyx_pw___pyx_memoryviewslice_1__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused);
15627 static PyObject *__pyx_pw___pyx_memoryviewslice_1__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
15628 PyObject *__pyx_r = 0;
15629 __Pyx_RefNannyDeclarations
15630 __Pyx_RefNannySetupContext(
"__reduce_cython__ (wrapper)", 0);
15631 __pyx_r = __pyx_pf___pyx_memoryviewslice___reduce_cython__(((
struct __pyx_memoryviewslice_obj *)__pyx_v_self));
15634 __Pyx_RefNannyFinishContext();
15638 static PyObject *__pyx_pf___pyx_memoryviewslice___reduce_cython__(CYTHON_UNUSED
struct __pyx_memoryviewslice_obj *__pyx_v_self) {
15639 PyObject *__pyx_r = NULL;
15640 __Pyx_RefNannyDeclarations
15641 PyObject *__pyx_t_1 = NULL;
15642 int __pyx_lineno = 0;
15643 const char *__pyx_filename = NULL;
15644 int __pyx_clineno = 0;
15645 __Pyx_RefNannySetupContext(
"__reduce_cython__", 0);
15653 __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__32, NULL);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2, __pyx_L1_error)
15654 __Pyx_GOTREF(__pyx_t_1);
15655 __Pyx_Raise(__pyx_t_1, 0, 0, 0);
15656 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
15657 __PYX_ERR(0, 2, __pyx_L1_error)
15667 __Pyx_XDECREF(__pyx_t_1);
15668 __Pyx_AddTraceback(
"View.MemoryView._memoryviewslice.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
15670 __Pyx_XGIVEREF(__pyx_r);
15671 __Pyx_RefNannyFinishContext();
15683 static PyObject *__pyx_pw___pyx_memoryviewslice_3__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state);
15684 static PyObject *__pyx_pw___pyx_memoryviewslice_3__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
15685 PyObject *__pyx_r = 0;
15686 __Pyx_RefNannyDeclarations
15687 __Pyx_RefNannySetupContext(
"__setstate_cython__ (wrapper)", 0);
15688 __pyx_r = __pyx_pf___pyx_memoryviewslice_2__setstate_cython__(((
struct __pyx_memoryviewslice_obj *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state));
15691 __Pyx_RefNannyFinishContext();
15695 static PyObject *__pyx_pf___pyx_memoryviewslice_2__setstate_cython__(CYTHON_UNUSED
struct __pyx_memoryviewslice_obj *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) {
15696 PyObject *__pyx_r = NULL;
15697 __Pyx_RefNannyDeclarations
15698 PyObject *__pyx_t_1 = NULL;
15699 int __pyx_lineno = 0;
15700 const char *__pyx_filename = NULL;
15701 int __pyx_clineno = 0;
15702 __Pyx_RefNannySetupContext(
"__setstate_cython__", 0);
15709 __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__33, NULL);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4, __pyx_L1_error)
15710 __Pyx_GOTREF(__pyx_t_1);
15711 __Pyx_Raise(__pyx_t_1, 0, 0, 0);
15712 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
15713 __PYX_ERR(0, 4, __pyx_L1_error)
15724 __Pyx_XDECREF(__pyx_t_1);
15725 __Pyx_AddTraceback(
"View.MemoryView._memoryviewslice.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
15727 __Pyx_XGIVEREF(__pyx_r);
15728 __Pyx_RefNannyFinishContext();
15740 static PyObject *__pyx_memoryview_fromslice(__Pyx_memviewslice __pyx_v_memviewslice,
int __pyx_v_ndim, PyObject *(*__pyx_v_to_object_func)(
char *),
int (*__pyx_v_to_dtype_func)(
char *, PyObject *),
int __pyx_v_dtype_is_object) {
15741 struct __pyx_memoryviewslice_obj *__pyx_v_result = 0;
15742 Py_ssize_t __pyx_v_suboffset;
15743 PyObject *__pyx_v_length = NULL;
15744 PyObject *__pyx_r = NULL;
15745 __Pyx_RefNannyDeclarations
15747 PyObject *__pyx_t_2 = NULL;
15748 PyObject *__pyx_t_3 = NULL;
15749 __Pyx_TypeInfo *__pyx_t_4;
15750 Py_buffer __pyx_t_5;
15751 Py_ssize_t *__pyx_t_6;
15752 Py_ssize_t *__pyx_t_7;
15753 Py_ssize_t *__pyx_t_8;
15754 Py_ssize_t __pyx_t_9;
15755 int __pyx_lineno = 0;
15756 const char *__pyx_filename = NULL;
15757 int __pyx_clineno = 0;
15758 __Pyx_RefNannySetupContext(
"memoryview_fromslice", 0);
15767 __pyx_t_1 = ((((PyObject *)__pyx_v_memviewslice.memview) == Py_None) != 0);
15777 __Pyx_XDECREF(__pyx_r);
15778 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
15797 __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_v_dtype_is_object);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1013, __pyx_L1_error)
15798 __Pyx_GOTREF(__pyx_t_2);
15799 __pyx_t_3 = PyTuple_New(3);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1013, __pyx_L1_error)
15800 __Pyx_GOTREF(__pyx_t_3);
15801 __Pyx_INCREF(Py_None);
15802 __Pyx_GIVEREF(Py_None);
15803 PyTuple_SET_ITEM(__pyx_t_3, 0, Py_None);
15804 __Pyx_INCREF(__pyx_int_0);
15805 __Pyx_GIVEREF(__pyx_int_0);
15806 PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_int_0);
15807 __Pyx_GIVEREF(__pyx_t_2);
15808 PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_t_2);
15810 __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_memoryviewslice_type), __pyx_t_3, NULL);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1013, __pyx_L1_error)
15811 __Pyx_GOTREF(__pyx_t_2);
15812 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
15813 __pyx_v_result = ((
struct __pyx_memoryviewslice_obj *)__pyx_t_2);
15823 __pyx_v_result->from_slice = __pyx_v_memviewslice;
15832 __PYX_INC_MEMVIEW((&__pyx_v_memviewslice), 1);
15841 __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_memviewslice.memview), __pyx_n_s_base);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1018, __pyx_L1_error)
15842 __Pyx_GOTREF(__pyx_t_2);
15843 __Pyx_GIVEREF(__pyx_t_2);
15844 __Pyx_GOTREF(__pyx_v_result->from_object);
15845 __Pyx_DECREF(__pyx_v_result->from_object);
15846 __pyx_v_result->from_object = __pyx_t_2;
15856 __pyx_t_4 = __pyx_v_memviewslice.memview->typeinfo;
15857 __pyx_v_result->__pyx_base.typeinfo = __pyx_t_4;
15866 __pyx_t_5 = __pyx_v_memviewslice.memview->view;
15867 __pyx_v_result->__pyx_base.view = __pyx_t_5;
15876 __pyx_v_result->__pyx_base.view.buf = ((
void *)__pyx_v_memviewslice.data);
15885 __pyx_v_result->__pyx_base.view.ndim = __pyx_v_ndim;
15894 ((Py_buffer *)(&__pyx_v_result->__pyx_base.view))->obj = Py_None;
15903 Py_INCREF(Py_None);
15912 __pyx_t_1 = ((((
struct __pyx_memoryview_obj *)__pyx_v_memviewslice.memview)->flags & PyBUF_WRITABLE) != 0);
15922 __pyx_v_result->__pyx_base.flags = PyBUF_RECORDS;
15942 __pyx_v_result->__pyx_base.flags = PyBUF_RECORDS_RO;
15953 __pyx_v_result->__pyx_base.view.shape = ((Py_ssize_t *)__pyx_v_result->from_slice.shape);
15962 __pyx_v_result->__pyx_base.view.strides = ((Py_ssize_t *)__pyx_v_result->from_slice.strides);
15971 __pyx_v_result->__pyx_base.view.suboffsets = NULL;
15980 __pyx_t_7 = (__pyx_v_result->from_slice.suboffsets + __pyx_v_ndim);
15981 for (__pyx_t_8 = __pyx_v_result->from_slice.suboffsets; __pyx_t_8 < __pyx_t_7; __pyx_t_8++) {
15982 __pyx_t_6 = __pyx_t_8;
15983 __pyx_v_suboffset = (__pyx_t_6[0]);
15992 __pyx_t_1 = ((__pyx_v_suboffset >= 0) != 0);
16002 __pyx_v_result->__pyx_base.view.suboffsets = ((Py_ssize_t *)__pyx_v_result->from_slice.suboffsets);
16011 goto __pyx_L6_break;
16031 __pyx_t_9 = __pyx_v_result->__pyx_base.view.itemsize;
16032 __pyx_v_result->__pyx_base.view.len = __pyx_t_9;
16041 __pyx_t_7 = (__pyx_v_result->__pyx_base.view.shape + __pyx_v_ndim);
16042 for (__pyx_t_8 = __pyx_v_result->__pyx_base.view.shape; __pyx_t_8 < __pyx_t_7; __pyx_t_8++) {
16043 __pyx_t_6 = __pyx_t_8;
16044 __pyx_t_2 = PyInt_FromSsize_t((__pyx_t_6[0]));
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1043, __pyx_L1_error)
16045 __Pyx_GOTREF(__pyx_t_2);
16046 __Pyx_XDECREF_SET(__pyx_v_length, __pyx_t_2);
16056 __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_result->__pyx_base.view.len);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1044, __pyx_L1_error)
16057 __Pyx_GOTREF(__pyx_t_2);
16058 __pyx_t_3 = PyNumber_InPlaceMultiply(__pyx_t_2, __pyx_v_length);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1044, __pyx_L1_error)
16059 __Pyx_GOTREF(__pyx_t_3);
16060 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
16061 __pyx_t_9 = __Pyx_PyIndex_AsSsize_t(__pyx_t_3);
if (unlikely((__pyx_t_9 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1044, __pyx_L1_error)
16062 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
16063 __pyx_v_result->__pyx_base.view.len = __pyx_t_9;
16073 __pyx_v_result->to_object_func = __pyx_v_to_object_func;
16082 __pyx_v_result->to_dtype_func = __pyx_v_to_dtype_func;
16091 __Pyx_XDECREF(__pyx_r);
16092 __Pyx_INCREF(((PyObject *)__pyx_v_result));
16093 __pyx_r = ((PyObject *)__pyx_v_result);
16106 __Pyx_XDECREF(__pyx_t_2);
16107 __Pyx_XDECREF(__pyx_t_3);
16108 __Pyx_AddTraceback(
"View.MemoryView.memoryview_fromslice", __pyx_clineno, __pyx_lineno, __pyx_filename);
16111 __Pyx_XDECREF((PyObject *)__pyx_v_result);
16112 __Pyx_XDECREF(__pyx_v_length);
16113 __Pyx_XGIVEREF(__pyx_r);
16114 __Pyx_RefNannyFinishContext();
16126 static __Pyx_memviewslice *__pyx_memoryview_get_slice_from_memoryview(
struct __pyx_memoryview_obj *__pyx_v_memview, __Pyx_memviewslice *__pyx_v_mslice) {
16127 struct __pyx_memoryviewslice_obj *__pyx_v_obj = 0;
16128 __Pyx_memviewslice *__pyx_r;
16129 __Pyx_RefNannyDeclarations
16132 PyObject *__pyx_t_3 = NULL;
16133 int __pyx_lineno = 0;
16134 const char *__pyx_filename = NULL;
16135 int __pyx_clineno = 0;
16136 __Pyx_RefNannySetupContext(
"get_slice_from_memview", 0);
16145 __pyx_t_1 = __Pyx_TypeCheck(((PyObject *)__pyx_v_memview), __pyx_memoryviewslice_type);
16146 __pyx_t_2 = (__pyx_t_1 != 0);
16156 if (!(likely(((((PyObject *)__pyx_v_memview)) == Py_None) || likely(__Pyx_TypeTest(((PyObject *)__pyx_v_memview), __pyx_memoryviewslice_type))))) __PYX_ERR(0, 1056, __pyx_L1_error)
16157 __pyx_t_3 = ((PyObject *)__pyx_v_memview);
16158 __Pyx_INCREF(__pyx_t_3);
16159 __pyx_v_obj = ((
struct __pyx_memoryviewslice_obj *)__pyx_t_3);
16169 __pyx_r = (&__pyx_v_obj->from_slice);
16189 __pyx_memoryview_slice_copy(__pyx_v_memview, __pyx_v_mslice);
16198 __pyx_r = __pyx_v_mslice;
16212 __Pyx_XDECREF(__pyx_t_3);
16213 __Pyx_AddTraceback(
"View.MemoryView.get_slice_from_memview", __pyx_clineno, __pyx_lineno, __pyx_filename);
16216 __Pyx_XDECREF((PyObject *)__pyx_v_obj);
16217 __Pyx_RefNannyFinishContext();
16229 static void __pyx_memoryview_slice_copy(
struct __pyx_memoryview_obj *__pyx_v_memview, __Pyx_memviewslice *__pyx_v_dst) {
16231 Py_ssize_t *__pyx_v_shape;
16232 Py_ssize_t *__pyx_v_strides;
16233 Py_ssize_t *__pyx_v_suboffsets;
16234 __Pyx_RefNannyDeclarations
16235 Py_ssize_t *__pyx_t_1;
16239 Py_ssize_t __pyx_t_5;
16240 __Pyx_RefNannySetupContext(
"slice_copy", 0);
16249 __pyx_t_1 = __pyx_v_memview->view.shape;
16250 __pyx_v_shape = __pyx_t_1;
16259 __pyx_t_1 = __pyx_v_memview->view.strides;
16260 __pyx_v_strides = __pyx_t_1;
16269 __pyx_t_1 = __pyx_v_memview->view.suboffsets;
16270 __pyx_v_suboffsets = __pyx_t_1;
16279 __pyx_v_dst->memview = ((
struct __pyx_memoryview_obj *)__pyx_v_memview);
16288 __pyx_v_dst->data = ((
char *)__pyx_v_memview->view.buf);
16297 __pyx_t_2 = __pyx_v_memview->view.ndim;
16298 __pyx_t_3 = __pyx_t_2;
16299 for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
16300 __pyx_v_dim = __pyx_t_4;
16309 (__pyx_v_dst->shape[__pyx_v_dim]) = (__pyx_v_shape[__pyx_v_dim]);
16318 (__pyx_v_dst->strides[__pyx_v_dim]) = (__pyx_v_strides[__pyx_v_dim]);
16327 if ((__pyx_v_suboffsets != 0)) {
16328 __pyx_t_5 = (__pyx_v_suboffsets[__pyx_v_dim]);
16332 (__pyx_v_dst->suboffsets[__pyx_v_dim]) = __pyx_t_5;
16344 __Pyx_RefNannyFinishContext();
16355 static PyObject *__pyx_memoryview_copy_object(
struct __pyx_memoryview_obj *__pyx_v_memview) {
16356 __Pyx_memviewslice __pyx_v_memviewslice;
16357 PyObject *__pyx_r = NULL;
16358 __Pyx_RefNannyDeclarations
16359 PyObject *__pyx_t_1 = NULL;
16360 int __pyx_lineno = 0;
16361 const char *__pyx_filename = NULL;
16362 int __pyx_clineno = 0;
16363 __Pyx_RefNannySetupContext(
"memoryview_copy", 0);
16372 __pyx_memoryview_slice_copy(__pyx_v_memview, (&__pyx_v_memviewslice));
16381 __Pyx_XDECREF(__pyx_r);
16382 __pyx_t_1 = __pyx_memoryview_copy_object_from_slice(__pyx_v_memview, (&__pyx_v_memviewslice));
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1084, __pyx_L1_error)
16383 __Pyx_GOTREF(__pyx_t_1);
16384 __pyx_r = __pyx_t_1;
16398 __Pyx_XDECREF(__pyx_t_1);
16399 __Pyx_AddTraceback(
"View.MemoryView.memoryview_copy", __pyx_clineno, __pyx_lineno, __pyx_filename);
16402 __Pyx_XGIVEREF(__pyx_r);
16403 __Pyx_RefNannyFinishContext();
16415 static PyObject *__pyx_memoryview_copy_object_from_slice(
struct __pyx_memoryview_obj *__pyx_v_memview, __Pyx_memviewslice *__pyx_v_memviewslice) {
16416 PyObject *(*__pyx_v_to_object_func)(
char *);
16417 int (*__pyx_v_to_dtype_func)(
char *, PyObject *);
16418 PyObject *__pyx_r = NULL;
16419 __Pyx_RefNannyDeclarations
16422 PyObject *(*__pyx_t_3)(
char *);
16423 int (*__pyx_t_4)(
char *, PyObject *);
16424 PyObject *__pyx_t_5 = NULL;
16425 int __pyx_lineno = 0;
16426 const char *__pyx_filename = NULL;
16427 int __pyx_clineno = 0;
16428 __Pyx_RefNannySetupContext(
"memoryview_copy_from_slice", 0);
16437 __pyx_t_1 = __Pyx_TypeCheck(((PyObject *)__pyx_v_memview), __pyx_memoryviewslice_type);
16438 __pyx_t_2 = (__pyx_t_1 != 0);
16448 __pyx_t_3 = ((
struct __pyx_memoryviewslice_obj *)__pyx_v_memview)->to_object_func;
16449 __pyx_v_to_object_func = __pyx_t_3;
16458 __pyx_t_4 = ((
struct __pyx_memoryviewslice_obj *)__pyx_v_memview)->to_dtype_func;
16459 __pyx_v_to_dtype_func = __pyx_t_4;
16479 __pyx_v_to_object_func = NULL;
16488 __pyx_v_to_dtype_func = NULL;
16499 __Pyx_XDECREF(__pyx_r);
16508 __pyx_t_5 = __pyx_memoryview_fromslice((__pyx_v_memviewslice[0]), __pyx_v_memview->view.ndim, __pyx_v_to_object_func, __pyx_v_to_dtype_func, __pyx_v_memview->dtype_is_object);
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1101, __pyx_L1_error)
16509 __Pyx_GOTREF(__pyx_t_5);
16510 __pyx_r = __pyx_t_5;
16524 __Pyx_XDECREF(__pyx_t_5);
16525 __Pyx_AddTraceback(
"View.MemoryView.memoryview_copy_from_slice", __pyx_clineno, __pyx_lineno, __pyx_filename);
16528 __Pyx_XGIVEREF(__pyx_r);
16529 __Pyx_RefNannyFinishContext();
16541 static Py_ssize_t abs_py_ssize_t(Py_ssize_t __pyx_v_arg) {
16542 Py_ssize_t __pyx_r;
16552 __pyx_t_1 = ((__pyx_v_arg < 0) != 0);
16562 __pyx_r = (-__pyx_v_arg);
16582 __pyx_r = __pyx_v_arg;
16607 static char __pyx_get_best_slice_order(__Pyx_memviewslice *__pyx_v_mslice,
int __pyx_v_ndim) {
16609 Py_ssize_t __pyx_v_c_stride;
16610 Py_ssize_t __pyx_v_f_stride;
16624 __pyx_v_c_stride = 0;
16633 __pyx_v_f_stride = 0;
16642 for (__pyx_t_1 = (__pyx_v_ndim - 1); __pyx_t_1 > -1; __pyx_t_1-=1) {
16643 __pyx_v_i = __pyx_t_1;
16652 __pyx_t_2 = (((__pyx_v_mslice->shape[__pyx_v_i]) > 1) != 0);
16662 __pyx_v_c_stride = (__pyx_v_mslice->strides[__pyx_v_i]);
16671 goto __pyx_L4_break;
16691 __pyx_t_1 = __pyx_v_ndim;
16692 __pyx_t_3 = __pyx_t_1;
16693 for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
16694 __pyx_v_i = __pyx_t_4;
16703 __pyx_t_2 = (((__pyx_v_mslice->shape[__pyx_v_i]) > 1) != 0);
16713 __pyx_v_f_stride = (__pyx_v_mslice->strides[__pyx_v_i]);
16722 goto __pyx_L7_break;
16742 __pyx_t_2 = ((abs_py_ssize_t(__pyx_v_c_stride) <= abs_py_ssize_t(__pyx_v_f_stride)) != 0);
16797 static void _copy_strided_to_strided(
char *__pyx_v_src_data, Py_ssize_t *__pyx_v_src_strides,
char *__pyx_v_dst_data, Py_ssize_t *__pyx_v_dst_strides, Py_ssize_t *__pyx_v_src_shape, Py_ssize_t *__pyx_v_dst_shape,
int __pyx_v_ndim,
size_t __pyx_v_itemsize) {
16798 CYTHON_UNUSED Py_ssize_t __pyx_v_i;
16799 CYTHON_UNUSED Py_ssize_t __pyx_v_src_extent;
16800 Py_ssize_t __pyx_v_dst_extent;
16801 Py_ssize_t __pyx_v_src_stride;
16802 Py_ssize_t __pyx_v_dst_stride;
16806 Py_ssize_t __pyx_t_4;
16807 Py_ssize_t __pyx_t_5;
16808 Py_ssize_t __pyx_t_6;
16817 __pyx_v_src_extent = (__pyx_v_src_shape[0]);
16826 __pyx_v_dst_extent = (__pyx_v_dst_shape[0]);
16835 __pyx_v_src_stride = (__pyx_v_src_strides[0]);
16844 __pyx_v_dst_stride = (__pyx_v_dst_strides[0]);
16853 __pyx_t_1 = ((__pyx_v_ndim == 1) != 0);
16863 __pyx_t_2 = ((__pyx_v_src_stride > 0) != 0);
16866 __pyx_t_1 = __pyx_t_2;
16867 goto __pyx_L5_bool_binop_done;
16869 __pyx_t_2 = ((__pyx_v_dst_stride > 0) != 0);
16872 __pyx_t_1 = __pyx_t_2;
16873 goto __pyx_L5_bool_binop_done;
16883 __pyx_t_2 = (((size_t)__pyx_v_src_stride) == __pyx_v_itemsize);
16885 __pyx_t_2 = (__pyx_v_itemsize == ((size_t)__pyx_v_dst_stride));
16887 __pyx_t_3 = (__pyx_t_2 != 0);
16888 __pyx_t_1 = __pyx_t_3;
16889 __pyx_L5_bool_binop_done:;
16907 (void)(memcpy(__pyx_v_dst_data, __pyx_v_src_data, (__pyx_v_itemsize * __pyx_v_dst_extent)));
16927 __pyx_t_4 = __pyx_v_dst_extent;
16928 __pyx_t_5 = __pyx_t_4;
16929 for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) {
16930 __pyx_v_i = __pyx_t_6;
16939 (void)(memcpy(__pyx_v_dst_data, __pyx_v_src_data, __pyx_v_itemsize));
16948 __pyx_v_src_data = (__pyx_v_src_data + __pyx_v_src_stride);
16957 __pyx_v_dst_data = (__pyx_v_dst_data + __pyx_v_dst_stride);
16980 __pyx_t_4 = __pyx_v_dst_extent;
16981 __pyx_t_5 = __pyx_t_4;
16982 for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) {
16983 __pyx_v_i = __pyx_t_6;
16992 _copy_strided_to_strided(__pyx_v_src_data, (__pyx_v_src_strides + 1), __pyx_v_dst_data, (__pyx_v_dst_strides + 1), (__pyx_v_src_shape + 1), (__pyx_v_dst_shape + 1), (__pyx_v_ndim - 1), __pyx_v_itemsize);
17001 __pyx_v_src_data = (__pyx_v_src_data + __pyx_v_src_stride);
17010 __pyx_v_dst_data = (__pyx_v_dst_data + __pyx_v_dst_stride);
17034 static void copy_strided_to_strided(__Pyx_memviewslice *__pyx_v_src, __Pyx_memviewslice *__pyx_v_dst,
int __pyx_v_ndim,
size_t __pyx_v_itemsize) {
17043 _copy_strided_to_strided(__pyx_v_src->data, __pyx_v_src->strides, __pyx_v_dst->data, __pyx_v_dst->strides, __pyx_v_src->shape, __pyx_v_dst->shape, __pyx_v_ndim, __pyx_v_itemsize);
17064 static Py_ssize_t __pyx_memoryview_slice_get_size(__Pyx_memviewslice *__pyx_v_src,
int __pyx_v_ndim) {
17065 Py_ssize_t __pyx_v_shape;
17066 Py_ssize_t __pyx_v_size;
17067 Py_ssize_t __pyx_r;
17068 Py_ssize_t __pyx_t_1;
17069 Py_ssize_t *__pyx_t_2;
17070 Py_ssize_t *__pyx_t_3;
17071 Py_ssize_t *__pyx_t_4;
17080 __pyx_t_1 = __pyx_v_src->memview->view.itemsize;
17081 __pyx_v_size = __pyx_t_1;
17090 __pyx_t_3 = (__pyx_v_src->shape + __pyx_v_ndim);
17091 for (__pyx_t_4 = __pyx_v_src->shape; __pyx_t_4 < __pyx_t_3; __pyx_t_4++) {
17092 __pyx_t_2 = __pyx_t_4;
17093 __pyx_v_shape = (__pyx_t_2[0]);
17102 __pyx_v_size = (__pyx_v_size * __pyx_v_shape);
17112 __pyx_r = __pyx_v_size;
17136 static Py_ssize_t __pyx_fill_contig_strides_array(Py_ssize_t *__pyx_v_shape, Py_ssize_t *__pyx_v_strides, Py_ssize_t __pyx_v_stride,
int __pyx_v_ndim,
char __pyx_v_order) {
17138 Py_ssize_t __pyx_r;
17151 __pyx_t_1 = ((__pyx_v_order ==
'F') != 0);
17161 __pyx_t_2 = __pyx_v_ndim;
17162 __pyx_t_3 = __pyx_t_2;
17163 for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
17164 __pyx_v_idx = __pyx_t_4;
17173 (__pyx_v_strides[__pyx_v_idx]) = __pyx_v_stride;
17182 __pyx_v_stride = (__pyx_v_stride * (__pyx_v_shape[__pyx_v_idx]));
17203 for (__pyx_t_2 = (__pyx_v_ndim - 1); __pyx_t_2 > -1; __pyx_t_2-=1) {
17204 __pyx_v_idx = __pyx_t_2;
17213 (__pyx_v_strides[__pyx_v_idx]) = __pyx_v_stride;
17222 __pyx_v_stride = (__pyx_v_stride * (__pyx_v_shape[__pyx_v_idx]));
17234 __pyx_r = __pyx_v_stride;
17258 static void *__pyx_memoryview_copy_data_to_temp(__Pyx_memviewslice *__pyx_v_src, __Pyx_memviewslice *__pyx_v_tmpslice,
char __pyx_v_order,
int __pyx_v_ndim) {
17260 void *__pyx_v_result;
17261 size_t __pyx_v_itemsize;
17262 size_t __pyx_v_size;
17264 Py_ssize_t __pyx_t_1;
17267 struct __pyx_memoryview_obj *__pyx_t_4;
17270 int __pyx_lineno = 0;
17271 const char *__pyx_filename = NULL;
17272 int __pyx_clineno = 0;
17281 __pyx_t_1 = __pyx_v_src->memview->view.itemsize;
17282 __pyx_v_itemsize = __pyx_t_1;
17291 __pyx_v_size = __pyx_memoryview_slice_get_size(__pyx_v_src, __pyx_v_ndim);
17300 __pyx_v_result = malloc(__pyx_v_size);
17309 __pyx_t_2 = ((!(__pyx_v_result != 0)) != 0);
17319 __pyx_t_3 = __pyx_memoryview_err(__pyx_builtin_MemoryError, NULL);
if (unlikely(__pyx_t_3 == ((
int)-1))) __PYX_ERR(0, 1224, __pyx_L1_error)
17337 __pyx_v_tmpslice->data = ((
char *)__pyx_v_result);
17346 __pyx_t_4 = __pyx_v_src->memview;
17347 __pyx_v_tmpslice->memview = __pyx_t_4;
17356 __pyx_t_3 = __pyx_v_ndim;
17357 __pyx_t_5 = __pyx_t_3;
17358 for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) {
17359 __pyx_v_i = __pyx_t_6;
17368 (__pyx_v_tmpslice->shape[__pyx_v_i]) = (__pyx_v_src->shape[__pyx_v_i]);
17377 (__pyx_v_tmpslice->suboffsets[__pyx_v_i]) = -1
L;
17387 (void)(__pyx_fill_contig_strides_array((&(__pyx_v_tmpslice->shape[0])), (&(__pyx_v_tmpslice->strides[0])), __pyx_v_itemsize, __pyx_v_ndim, __pyx_v_order));
17396 __pyx_t_3 = __pyx_v_ndim;
17397 __pyx_t_5 = __pyx_t_3;
17398 for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) {
17399 __pyx_v_i = __pyx_t_6;
17408 __pyx_t_2 = (((__pyx_v_tmpslice->shape[__pyx_v_i]) == 1) != 0);
17418 (__pyx_v_tmpslice->strides[__pyx_v_i]) = 0;
17437 __pyx_t_2 = (__pyx_memviewslice_is_contig((__pyx_v_src[0]), __pyx_v_order, __pyx_v_ndim) != 0);
17447 (void)(memcpy(__pyx_v_result, __pyx_v_src->data, __pyx_v_size));
17467 copy_strided_to_strided(__pyx_v_src, __pyx_v_tmpslice, __pyx_v_ndim, __pyx_v_itemsize);
17478 __pyx_r = __pyx_v_result;
17493 PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
17495 __Pyx_AddTraceback(
"View.MemoryView.copy_data_to_temp", __pyx_clineno, __pyx_lineno, __pyx_filename);
17497 __Pyx_PyGILState_Release(__pyx_gilstate_save);
17513 static int __pyx_memoryview_err_extents(
int __pyx_v_i, Py_ssize_t __pyx_v_extent1, Py_ssize_t __pyx_v_extent2) {
17515 __Pyx_RefNannyDeclarations
17516 PyObject *__pyx_t_1 = NULL;
17517 PyObject *__pyx_t_2 = NULL;
17518 PyObject *__pyx_t_3 = NULL;
17519 PyObject *__pyx_t_4 = NULL;
17520 int __pyx_lineno = 0;
17521 const char *__pyx_filename = NULL;
17522 int __pyx_clineno = 0;
17524 PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
17526 __Pyx_RefNannySetupContext(
"_err_extents", 0);
17535 __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_i);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1254, __pyx_L1_error)
17536 __Pyx_GOTREF(__pyx_t_1);
17537 __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_extent1);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1254, __pyx_L1_error)
17538 __Pyx_GOTREF(__pyx_t_2);
17539 __pyx_t_3 = PyInt_FromSsize_t(__pyx_v_extent2);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1254, __pyx_L1_error)
17540 __Pyx_GOTREF(__pyx_t_3);
17541 __pyx_t_4 = PyTuple_New(3);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1254, __pyx_L1_error)
17542 __Pyx_GOTREF(__pyx_t_4);
17543 __Pyx_GIVEREF(__pyx_t_1);
17544 PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_1);
17545 __Pyx_GIVEREF(__pyx_t_2);
17546 PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_2);
17547 __Pyx_GIVEREF(__pyx_t_3);
17548 PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_t_3);
17560 __pyx_t_3 = __Pyx_PyString_Format(__pyx_kp_s_got_differing_extents_in_dimensi, __pyx_t_4);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1253, __pyx_L1_error)
17561 __Pyx_GOTREF(__pyx_t_3);
17562 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
17563 __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_3);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1253, __pyx_L1_error)
17564 __Pyx_GOTREF(__pyx_t_4);
17565 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
17566 __Pyx_Raise(__pyx_t_4, 0, 0, 0);
17567 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
17568 __PYX_ERR(0, 1253, __pyx_L1_error)
17580 __Pyx_XDECREF(__pyx_t_1);
17581 __Pyx_XDECREF(__pyx_t_2);
17582 __Pyx_XDECREF(__pyx_t_3);
17583 __Pyx_XDECREF(__pyx_t_4);
17584 __Pyx_AddTraceback(
"View.MemoryView._err_extents", __pyx_clineno, __pyx_lineno, __pyx_filename);
17586 __Pyx_RefNannyFinishContext();
17588 __Pyx_PyGILState_Release(__pyx_gilstate_save);
17601 static int __pyx_memoryview_err_dim(PyObject *__pyx_v_error,
char *__pyx_v_msg,
int __pyx_v_dim) {
17603 __Pyx_RefNannyDeclarations
17604 PyObject *__pyx_t_1 = NULL;
17605 PyObject *__pyx_t_2 = NULL;
17606 PyObject *__pyx_t_3 = NULL;
17607 PyObject *__pyx_t_4 = NULL;
17608 int __pyx_lineno = 0;
17609 const char *__pyx_filename = NULL;
17610 int __pyx_clineno = 0;
17612 PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
17614 __Pyx_RefNannySetupContext(
"_err_dim", 0);
17615 __Pyx_INCREF(__pyx_v_error);
17624 __pyx_t_2 = __Pyx_decode_c_string(__pyx_v_msg, 0, strlen(__pyx_v_msg), NULL, NULL, PyUnicode_DecodeASCII);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1258, __pyx_L1_error)
17625 __Pyx_GOTREF(__pyx_t_2);
17626 __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_dim);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1258, __pyx_L1_error)
17627 __Pyx_GOTREF(__pyx_t_3);
17628 __pyx_t_4 = PyUnicode_Format(__pyx_t_2, __pyx_t_3);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1258, __pyx_L1_error)
17629 __Pyx_GOTREF(__pyx_t_4);
17630 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
17631 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
17632 __Pyx_INCREF(__pyx_v_error);
17633 __pyx_t_3 = __pyx_v_error; __pyx_t_2 = NULL;
17634 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
17635 __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
17636 if (likely(__pyx_t_2)) {
17637 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_3);
17638 __Pyx_INCREF(__pyx_t_2);
17639 __Pyx_INCREF(
function);
17640 __Pyx_DECREF_SET(__pyx_t_3,
function);
17643 __pyx_t_1 = (__pyx_t_2) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_2, __pyx_t_4) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4);
17644 __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
17645 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
17646 if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1258, __pyx_L1_error)
17647 __Pyx_GOTREF(__pyx_t_1);
17648 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
17649 __Pyx_Raise(__pyx_t_1, 0, 0, 0);
17650 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
17651 __PYX_ERR(0, 1258, __pyx_L1_error)
17663 __Pyx_XDECREF(__pyx_t_1);
17664 __Pyx_XDECREF(__pyx_t_2);
17665 __Pyx_XDECREF(__pyx_t_3);
17666 __Pyx_XDECREF(__pyx_t_4);
17667 __Pyx_AddTraceback(
"View.MemoryView._err_dim", __pyx_clineno, __pyx_lineno, __pyx_filename);
17669 __Pyx_XDECREF(__pyx_v_error);
17670 __Pyx_RefNannyFinishContext();
17672 __Pyx_PyGILState_Release(__pyx_gilstate_save);
17685 static int __pyx_memoryview_err(PyObject *__pyx_v_error,
char *__pyx_v_msg) {
17687 __Pyx_RefNannyDeclarations
17689 PyObject *__pyx_t_2 = NULL;
17690 PyObject *__pyx_t_3 = NULL;
17691 PyObject *__pyx_t_4 = NULL;
17692 PyObject *__pyx_t_5 = NULL;
17693 int __pyx_lineno = 0;
17694 const char *__pyx_filename = NULL;
17695 int __pyx_clineno = 0;
17697 PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
17699 __Pyx_RefNannySetupContext(
"_err", 0);
17700 __Pyx_INCREF(__pyx_v_error);
17709 __pyx_t_1 = ((__pyx_v_msg != NULL) != 0);
17710 if (unlikely(__pyx_t_1)) {
17719 __pyx_t_3 = __Pyx_decode_c_string(__pyx_v_msg, 0, strlen(__pyx_v_msg), NULL, NULL, PyUnicode_DecodeASCII);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1263, __pyx_L1_error)
17720 __Pyx_GOTREF(__pyx_t_3);
17721 __Pyx_INCREF(__pyx_v_error);
17722 __pyx_t_4 = __pyx_v_error; __pyx_t_5 = NULL;
17723 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
17724 __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
17725 if (likely(__pyx_t_5)) {
17726 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_4);
17727 __Pyx_INCREF(__pyx_t_5);
17728 __Pyx_INCREF(
function);
17729 __Pyx_DECREF_SET(__pyx_t_4,
function);
17732 __pyx_t_2 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_5, __pyx_t_3) : __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_3);
17733 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
17734 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
17735 if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1263, __pyx_L1_error)
17736 __Pyx_GOTREF(__pyx_t_2);
17737 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
17738 __Pyx_Raise(__pyx_t_2, 0, 0, 0);
17739 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
17740 __PYX_ERR(0, 1263, __pyx_L1_error)
17759 __Pyx_Raise(__pyx_v_error, 0, 0, 0);
17760 __PYX_ERR(0, 1265, __pyx_L1_error)
17773 __Pyx_XDECREF(__pyx_t_2);
17774 __Pyx_XDECREF(__pyx_t_3);
17775 __Pyx_XDECREF(__pyx_t_4);
17776 __Pyx_XDECREF(__pyx_t_5);
17777 __Pyx_AddTraceback(
"View.MemoryView._err", __pyx_clineno, __pyx_lineno, __pyx_filename);
17779 __Pyx_XDECREF(__pyx_v_error);
17780 __Pyx_RefNannyFinishContext();
17782 __Pyx_PyGILState_Release(__pyx_gilstate_save);
17795 static int __pyx_memoryview_copy_contents(__Pyx_memviewslice __pyx_v_src, __Pyx_memviewslice __pyx_v_dst,
int __pyx_v_src_ndim,
int __pyx_v_dst_ndim,
int __pyx_v_dtype_is_object) {
17796 void *__pyx_v_tmpdata;
17797 size_t __pyx_v_itemsize;
17799 char __pyx_v_order;
17800 int __pyx_v_broadcasting;
17801 int __pyx_v_direct_copy;
17802 __Pyx_memviewslice __pyx_v_tmp;
17805 Py_ssize_t __pyx_t_1;
17813 int __pyx_lineno = 0;
17814 const char *__pyx_filename = NULL;
17815 int __pyx_clineno = 0;
17824 __pyx_v_tmpdata = NULL;
17833 __pyx_t_1 = __pyx_v_src.memview->view.itemsize;
17834 __pyx_v_itemsize = __pyx_t_1;
17843 __pyx_v_order = __pyx_get_best_slice_order((&__pyx_v_src), __pyx_v_src_ndim);
17852 __pyx_v_broadcasting = 0;
17861 __pyx_v_direct_copy = 0;
17870 __pyx_t_2 = ((__pyx_v_src_ndim < __pyx_v_dst_ndim) != 0);
17880 __pyx_memoryview_broadcast_leading((&__pyx_v_src), __pyx_v_src_ndim, __pyx_v_dst_ndim);
17899 __pyx_t_2 = ((__pyx_v_dst_ndim < __pyx_v_src_ndim) != 0);
17909 __pyx_memoryview_broadcast_leading((&__pyx_v_dst), __pyx_v_dst_ndim, __pyx_v_src_ndim);
17928 __pyx_t_3 = __pyx_v_dst_ndim;
17929 __pyx_t_4 = __pyx_v_src_ndim;
17930 if (((__pyx_t_3 > __pyx_t_4) != 0)) {
17931 __pyx_t_5 = __pyx_t_3;
17933 __pyx_t_5 = __pyx_t_4;
17935 __pyx_v_ndim = __pyx_t_5;
17944 __pyx_t_5 = __pyx_v_ndim;
17945 __pyx_t_3 = __pyx_t_5;
17946 for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
17947 __pyx_v_i = __pyx_t_4;
17956 __pyx_t_2 = (((__pyx_v_src.shape[__pyx_v_i]) != (__pyx_v_dst.shape[__pyx_v_i])) != 0);
17966 __pyx_t_2 = (((__pyx_v_src.shape[__pyx_v_i]) == 1) != 0);
17976 __pyx_v_broadcasting = 1;
17985 (__pyx_v_src.strides[__pyx_v_i]) = 0;
18005 __pyx_t_6 = __pyx_memoryview_err_extents(__pyx_v_i, (__pyx_v_dst.shape[__pyx_v_i]), (__pyx_v_src.shape[__pyx_v_i]));
if (unlikely(__pyx_t_6 == ((
int)-1))) __PYX_ERR(0, 1297, __pyx_L1_error)
18025 __pyx_t_2 = (((__pyx_v_src.suboffsets[__pyx_v_i]) >= 0) != 0);
18035 __pyx_t_6 = __pyx_memoryview_err_dim(__pyx_builtin_ValueError, ((
char *)
"Dimension %d is not direct"), __pyx_v_i);
if (unlikely(__pyx_t_6 == ((
int)-1))) __PYX_ERR(0, 1300, __pyx_L1_error)
18054 __pyx_t_2 = (__pyx_slices_overlap((&__pyx_v_src), (&__pyx_v_dst), __pyx_v_ndim, __pyx_v_itemsize) != 0);
18064 __pyx_t_2 = ((!(__pyx_memviewslice_is_contig(__pyx_v_src, __pyx_v_order, __pyx_v_ndim) != 0)) != 0);
18074 __pyx_v_order = __pyx_get_best_slice_order((&__pyx_v_dst), __pyx_v_ndim);
18092 __pyx_t_7 = __pyx_memoryview_copy_data_to_temp((&__pyx_v_src), (&__pyx_v_tmp), __pyx_v_order, __pyx_v_ndim);
if (unlikely(__pyx_t_7 == ((
void *)NULL))) __PYX_ERR(0, 1307, __pyx_L1_error)
18093 __pyx_v_tmpdata = __pyx_t_7;
18102 __pyx_v_src = __pyx_v_tmp;
18120 __pyx_t_2 = ((!(__pyx_v_broadcasting != 0)) != 0);
18130 __pyx_t_2 = (__pyx_memviewslice_is_contig(__pyx_v_src,
'C', __pyx_v_ndim) != 0);
18140 __pyx_v_direct_copy = __pyx_memviewslice_is_contig(__pyx_v_dst,
'C', __pyx_v_ndim);
18159 __pyx_t_2 = (__pyx_memviewslice_is_contig(__pyx_v_src,
'F', __pyx_v_ndim) != 0);
18169 __pyx_v_direct_copy = __pyx_memviewslice_is_contig(__pyx_v_dst,
'F', __pyx_v_ndim);
18188 __pyx_t_2 = (__pyx_v_direct_copy != 0);
18198 __pyx_memoryview_refcount_copying((&__pyx_v_dst), __pyx_v_dtype_is_object, __pyx_v_ndim, 0);
18207 (void)(memcpy(__pyx_v_dst.data, __pyx_v_src.data, __pyx_memoryview_slice_get_size((&__pyx_v_src), __pyx_v_ndim)));
18216 __pyx_memoryview_refcount_copying((&__pyx_v_dst), __pyx_v_dtype_is_object, __pyx_v_ndim, 1);
18225 free(__pyx_v_tmpdata);
18262 __pyx_t_2 = (__pyx_v_order ==
'F');
18264 __pyx_t_2 = (
'F' == __pyx_get_best_slice_order((&__pyx_v_dst), __pyx_v_ndim));
18266 __pyx_t_8 = (__pyx_t_2 != 0);
18276 __pyx_t_5 = __pyx_memslice_transpose((&__pyx_v_src));
if (unlikely(__pyx_t_5 == ((
int)0))) __PYX_ERR(0, 1329, __pyx_L1_error)
18285 __pyx_t_5 = __pyx_memslice_transpose((&__pyx_v_dst));
if (unlikely(__pyx_t_5 == ((
int)0))) __PYX_ERR(0, 1330, __pyx_L1_error)
18303 __pyx_memoryview_refcount_copying((&__pyx_v_dst), __pyx_v_dtype_is_object, __pyx_v_ndim, 0);
18312 copy_strided_to_strided((&__pyx_v_src), (&__pyx_v_dst), __pyx_v_ndim, __pyx_v_itemsize);
18321 __pyx_memoryview_refcount_copying((&__pyx_v_dst), __pyx_v_dtype_is_object, __pyx_v_ndim, 1);
18330 free(__pyx_v_tmpdata);
18354 PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
18356 __Pyx_AddTraceback(
"View.MemoryView.memoryview_copy_contents", __pyx_clineno, __pyx_lineno, __pyx_filename);
18358 __Pyx_PyGILState_Release(__pyx_gilstate_save);
18374 static void __pyx_memoryview_broadcast_leading(__Pyx_memviewslice *__pyx_v_mslice,
int __pyx_v_ndim,
int __pyx_v_ndim_other) {
18376 int __pyx_v_offset;
18388 __pyx_v_offset = (__pyx_v_ndim_other - __pyx_v_ndim);
18397 for (__pyx_t_1 = (__pyx_v_ndim - 1); __pyx_t_1 > -1; __pyx_t_1-=1) {
18398 __pyx_v_i = __pyx_t_1;
18407 (__pyx_v_mslice->shape[(__pyx_v_i + __pyx_v_offset)]) = (__pyx_v_mslice->shape[__pyx_v_i]);
18416 (__pyx_v_mslice->strides[(__pyx_v_i + __pyx_v_offset)]) = (__pyx_v_mslice->strides[__pyx_v_i]);
18425 (__pyx_v_mslice->suboffsets[(__pyx_v_i + __pyx_v_offset)]) = (__pyx_v_mslice->suboffsets[__pyx_v_i]);
18435 __pyx_t_1 = __pyx_v_offset;
18436 __pyx_t_2 = __pyx_t_1;
18437 for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) {
18438 __pyx_v_i = __pyx_t_3;
18447 (__pyx_v_mslice->shape[__pyx_v_i]) = 1;
18456 (__pyx_v_mslice->strides[__pyx_v_i]) = (__pyx_v_mslice->strides[0]);
18465 (__pyx_v_mslice->suboffsets[__pyx_v_i]) = -1
L;
18487 static void __pyx_memoryview_refcount_copying(__Pyx_memviewslice *__pyx_v_dst,
int __pyx_v_dtype_is_object,
int __pyx_v_ndim,
int __pyx_v_inc) {
18497 __pyx_t_1 = (__pyx_v_dtype_is_object != 0);
18507 __pyx_memoryview_refcount_objects_in_slice_with_gil(__pyx_v_dst->data, __pyx_v_dst->shape, __pyx_v_dst->strides, __pyx_v_ndim, __pyx_v_inc);
18537 static void __pyx_memoryview_refcount_objects_in_slice_with_gil(
char *__pyx_v_data, Py_ssize_t *__pyx_v_shape, Py_ssize_t *__pyx_v_strides,
int __pyx_v_ndim,
int __pyx_v_inc) {
18538 __Pyx_RefNannyDeclarations
18540 PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
18542 __Pyx_RefNannySetupContext(
"refcount_objects_in_slice_with_gil", 0);
18551 __pyx_memoryview_refcount_objects_in_slice(__pyx_v_data, __pyx_v_shape, __pyx_v_strides, __pyx_v_ndim, __pyx_v_inc);
18562 __Pyx_RefNannyFinishContext();
18564 __Pyx_PyGILState_Release(__pyx_gilstate_save);
18576 static void __pyx_memoryview_refcount_objects_in_slice(
char *__pyx_v_data, Py_ssize_t *__pyx_v_shape, Py_ssize_t *__pyx_v_strides,
int __pyx_v_ndim,
int __pyx_v_inc) {
18577 CYTHON_UNUSED Py_ssize_t __pyx_v_i;
18578 __Pyx_RefNannyDeclarations
18579 Py_ssize_t __pyx_t_1;
18580 Py_ssize_t __pyx_t_2;
18581 Py_ssize_t __pyx_t_3;
18583 __Pyx_RefNannySetupContext(
"refcount_objects_in_slice", 0);
18592 __pyx_t_1 = (__pyx_v_shape[0]);
18593 __pyx_t_2 = __pyx_t_1;
18594 for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) {
18595 __pyx_v_i = __pyx_t_3;
18604 __pyx_t_4 = ((__pyx_v_ndim == 1) != 0);
18614 __pyx_t_4 = (__pyx_v_inc != 0);
18624 Py_INCREF((((PyObject **)__pyx_v_data)[0]));
18644 Py_DECREF((((PyObject **)__pyx_v_data)[0]));
18674 __pyx_memoryview_refcount_objects_in_slice(__pyx_v_data, (__pyx_v_shape + 1), (__pyx_v_strides + 1), (__pyx_v_ndim - 1), __pyx_v_inc);
18685 __pyx_v_data = (__pyx_v_data + (__pyx_v_strides[0]));
18697 __Pyx_RefNannyFinishContext();
18708 static void __pyx_memoryview_slice_assign_scalar(__Pyx_memviewslice *__pyx_v_dst,
int __pyx_v_ndim,
size_t __pyx_v_itemsize,
void *__pyx_v_item,
int __pyx_v_dtype_is_object) {
18717 __pyx_memoryview_refcount_copying(__pyx_v_dst, __pyx_v_dtype_is_object, __pyx_v_ndim, 0);
18726 __pyx_memoryview__slice_assign_scalar(__pyx_v_dst->data, __pyx_v_dst->shape, __pyx_v_dst->strides, __pyx_v_ndim, __pyx_v_itemsize, __pyx_v_item);
18735 __pyx_memoryview_refcount_copying(__pyx_v_dst, __pyx_v_dtype_is_object, __pyx_v_ndim, 1);
18756 static void __pyx_memoryview__slice_assign_scalar(
char *__pyx_v_data, Py_ssize_t *__pyx_v_shape, Py_ssize_t *__pyx_v_strides,
int __pyx_v_ndim,
size_t __pyx_v_itemsize,
void *__pyx_v_item) {
18757 CYTHON_UNUSED Py_ssize_t __pyx_v_i;
18758 Py_ssize_t __pyx_v_stride;
18759 Py_ssize_t __pyx_v_extent;
18761 Py_ssize_t __pyx_t_2;
18762 Py_ssize_t __pyx_t_3;
18763 Py_ssize_t __pyx_t_4;
18772 __pyx_v_stride = (__pyx_v_strides[0]);
18781 __pyx_v_extent = (__pyx_v_shape[0]);
18790 __pyx_t_1 = ((__pyx_v_ndim == 1) != 0);
18800 __pyx_t_2 = __pyx_v_extent;
18801 __pyx_t_3 = __pyx_t_2;
18802 for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
18803 __pyx_v_i = __pyx_t_4;
18812 (void)(memcpy(__pyx_v_data, __pyx_v_item, __pyx_v_itemsize));
18821 __pyx_v_data = (__pyx_v_data + __pyx_v_stride);
18842 __pyx_t_2 = __pyx_v_extent;
18843 __pyx_t_3 = __pyx_t_2;
18844 for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
18845 __pyx_v_i = __pyx_t_4;
18854 __pyx_memoryview__slice_assign_scalar(__pyx_v_data, (__pyx_v_shape + 1), (__pyx_v_strides + 1), (__pyx_v_ndim - 1), __pyx_v_itemsize, __pyx_v_item);
18863 __pyx_v_data = (__pyx_v_data + __pyx_v_stride);
18886 static PyObject *__pyx_pw_15View_dot_MemoryView_1__pyx_unpickle_Enum(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
18887 static PyMethodDef __pyx_mdef_15View_dot_MemoryView_1__pyx_unpickle_Enum = {
"__pyx_unpickle_Enum", (PyCFunction)(
void*)(PyCFunctionWithKeywords)__pyx_pw_15View_dot_MemoryView_1__pyx_unpickle_Enum, METH_VARARGS|METH_KEYWORDS, 0};
18888 static PyObject *__pyx_pw_15View_dot_MemoryView_1__pyx_unpickle_Enum(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
18889 PyObject *__pyx_v___pyx_type = 0;
18890 long __pyx_v___pyx_checksum;
18891 PyObject *__pyx_v___pyx_state = 0;
18892 int __pyx_lineno = 0;
18893 const char *__pyx_filename = NULL;
18894 int __pyx_clineno = 0;
18895 PyObject *__pyx_r = 0;
18896 __Pyx_RefNannyDeclarations
18897 __Pyx_RefNannySetupContext(
"__pyx_unpickle_Enum (wrapper)", 0);
18899 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_pyx_type,&__pyx_n_s_pyx_checksum,&__pyx_n_s_pyx_state,0};
18900 PyObject* values[3] = {0,0,0};
18901 if (unlikely(__pyx_kwds)) {
18902 Py_ssize_t kw_args;
18903 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
18904 switch (pos_args) {
18905 case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
18906 CYTHON_FALLTHROUGH;
18907 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
18908 CYTHON_FALLTHROUGH;
18909 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
18910 CYTHON_FALLTHROUGH;
18912 default:
goto __pyx_L5_argtuple_error;
18914 kw_args = PyDict_Size(__pyx_kwds);
18915 switch (pos_args) {
18917 if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pyx_type)) != 0)) kw_args--;
18918 else goto __pyx_L5_argtuple_error;
18919 CYTHON_FALLTHROUGH;
18921 if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pyx_checksum)) != 0)) kw_args--;
18923 __Pyx_RaiseArgtupleInvalid(
"__pyx_unpickle_Enum", 1, 3, 3, 1); __PYX_ERR(0, 1, __pyx_L3_error)
18925 CYTHON_FALLTHROUGH;
18927 if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pyx_state)) != 0)) kw_args--;
18929 __Pyx_RaiseArgtupleInvalid(
"__pyx_unpickle_Enum", 1, 3, 3, 2); __PYX_ERR(0, 1, __pyx_L3_error)
18932 if (unlikely(kw_args > 0)) {
18933 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args,
"__pyx_unpickle_Enum") < 0)) __PYX_ERR(0, 1, __pyx_L3_error)
18935 }
else if (PyTuple_GET_SIZE(__pyx_args) != 3) {
18936 goto __pyx_L5_argtuple_error;
18938 values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
18939 values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
18940 values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
18942 __pyx_v___pyx_type = values[0];
18943 __pyx_v___pyx_checksum = __Pyx_PyInt_As_long(values[1]);
if (unlikely((__pyx_v___pyx_checksum == (
long)-1) && PyErr_Occurred())) __PYX_ERR(0, 1, __pyx_L3_error)
18944 __pyx_v___pyx_state = values[2];
18946 goto __pyx_L4_argument_unpacking_done;
18947 __pyx_L5_argtuple_error:;
18948 __Pyx_RaiseArgtupleInvalid(
"__pyx_unpickle_Enum", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1, __pyx_L3_error)
18950 __Pyx_AddTraceback(
"View.MemoryView.__pyx_unpickle_Enum", __pyx_clineno, __pyx_lineno, __pyx_filename);
18951 __Pyx_RefNannyFinishContext();
18953 __pyx_L4_argument_unpacking_done:;
18954 __pyx_r = __pyx_pf_15View_dot_MemoryView___pyx_unpickle_Enum(__pyx_self, __pyx_v___pyx_type, __pyx_v___pyx_checksum, __pyx_v___pyx_state);
18957 __Pyx_RefNannyFinishContext();
18961 static PyObject *__pyx_pf_15View_dot_MemoryView___pyx_unpickle_Enum(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v___pyx_type,
long __pyx_v___pyx_checksum, PyObject *__pyx_v___pyx_state) {
18962 PyObject *__pyx_v___pyx_PickleError = 0;
18963 PyObject *__pyx_v___pyx_result = 0;
18964 PyObject *__pyx_r = NULL;
18965 __Pyx_RefNannyDeclarations
18966 PyObject *__pyx_t_1 = NULL;
18969 PyObject *__pyx_t_4 = NULL;
18970 PyObject *__pyx_t_5 = NULL;
18971 PyObject *__pyx_t_6 = NULL;
18972 int __pyx_lineno = 0;
18973 const char *__pyx_filename = NULL;
18974 int __pyx_clineno = 0;
18975 __Pyx_RefNannySetupContext(
"__pyx_unpickle_Enum", 0);
18984 __pyx_t_1 = __Pyx_PyInt_From_long(__pyx_v___pyx_checksum);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4, __pyx_L1_error)
18985 __Pyx_GOTREF(__pyx_t_1);
18986 __pyx_t_2 = (__Pyx_PySequence_ContainsTF(__pyx_t_1, __pyx_tuple__34, Py_NE));
if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 4, __pyx_L1_error)
18987 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
18988 __pyx_t_3 = (__pyx_t_2 != 0);
18998 __pyx_t_1 = PyList_New(1);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 5, __pyx_L1_error)
18999 __Pyx_GOTREF(__pyx_t_1);
19000 __Pyx_INCREF(__pyx_n_s_PickleError);
19001 __Pyx_GIVEREF(__pyx_n_s_PickleError);
19002 PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_s_PickleError);
19003 __pyx_t_4 = __Pyx_Import(__pyx_n_s_pickle, __pyx_t_1, 0);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 5, __pyx_L1_error)
19004 __Pyx_GOTREF(__pyx_t_4);
19005 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
19006 __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_4, __pyx_n_s_PickleError);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 5, __pyx_L1_error)
19007 __Pyx_GOTREF(__pyx_t_1);
19008 __Pyx_INCREF(__pyx_t_1);
19009 __pyx_v___pyx_PickleError = __pyx_t_1;
19010 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
19011 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
19020 __pyx_t_1 = __Pyx_PyInt_From_long(__pyx_v___pyx_checksum);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 6, __pyx_L1_error)
19021 __Pyx_GOTREF(__pyx_t_1);
19022 __pyx_t_5 = __Pyx_PyString_Format(__pyx_kp_s_Incompatible_checksums_0x_x_vs_0, __pyx_t_1);
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 6, __pyx_L1_error)
19023 __Pyx_GOTREF(__pyx_t_5);
19024 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
19025 __Pyx_INCREF(__pyx_v___pyx_PickleError);
19026 __pyx_t_1 = __pyx_v___pyx_PickleError; __pyx_t_6 = NULL;
19027 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_1))) {
19028 __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_1);
19029 if (likely(__pyx_t_6)) {
19030 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_1);
19031 __Pyx_INCREF(__pyx_t_6);
19032 __Pyx_INCREF(
function);
19033 __Pyx_DECREF_SET(__pyx_t_1,
function);
19036 __pyx_t_4 = (__pyx_t_6) ? __Pyx_PyObject_Call2Args(__pyx_t_1, __pyx_t_6, __pyx_t_5) : __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_t_5);
19037 __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
19038 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
19039 if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 6, __pyx_L1_error)
19040 __Pyx_GOTREF(__pyx_t_4);
19041 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
19042 __Pyx_Raise(__pyx_t_4, 0, 0, 0);
19043 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
19044 __PYX_ERR(0, 6, __pyx_L1_error)
19062 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_MemviewEnum_type), __pyx_n_s_new);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 7, __pyx_L1_error)
19063 __Pyx_GOTREF(__pyx_t_1);
19065 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_1))) {
19066 __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_1);
19067 if (likely(__pyx_t_5)) {
19068 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_1);
19069 __Pyx_INCREF(__pyx_t_5);
19070 __Pyx_INCREF(
function);
19071 __Pyx_DECREF_SET(__pyx_t_1,
function);
19074 __pyx_t_4 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_1, __pyx_t_5, __pyx_v___pyx_type) : __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_v___pyx_type);
19075 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
19076 if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 7, __pyx_L1_error)
19077 __Pyx_GOTREF(__pyx_t_4);
19078 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
19079 __pyx_v___pyx_result = __pyx_t_4;
19089 __pyx_t_3 = (__pyx_v___pyx_state != Py_None);
19090 __pyx_t_2 = (__pyx_t_3 != 0);
19100 if (!(likely(PyTuple_CheckExact(__pyx_v___pyx_state))||((__pyx_v___pyx_state) == Py_None)||(PyErr_Format(PyExc_TypeError,
"Expected %.16s, got %.200s",
"tuple", Py_TYPE(__pyx_v___pyx_state)->tp_name), 0))) __PYX_ERR(0, 9, __pyx_L1_error)
19101 __pyx_t_4 = __pyx_unpickle_Enum__set_state(((
struct __pyx_MemviewEnum_obj *)__pyx_v___pyx_result), ((PyObject*)__pyx_v___pyx_state));
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 9, __pyx_L1_error)
19102 __Pyx_GOTREF(__pyx_t_4);
19103 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
19121 __Pyx_XDECREF(__pyx_r);
19122 __Pyx_INCREF(__pyx_v___pyx_result);
19123 __pyx_r = __pyx_v___pyx_result;
19134 __Pyx_XDECREF(__pyx_t_1);
19135 __Pyx_XDECREF(__pyx_t_4);
19136 __Pyx_XDECREF(__pyx_t_5);
19137 __Pyx_XDECREF(__pyx_t_6);
19138 __Pyx_AddTraceback(
"View.MemoryView.__pyx_unpickle_Enum", __pyx_clineno, __pyx_lineno, __pyx_filename);
19141 __Pyx_XDECREF(__pyx_v___pyx_PickleError);
19142 __Pyx_XDECREF(__pyx_v___pyx_result);
19143 __Pyx_XGIVEREF(__pyx_r);
19144 __Pyx_RefNannyFinishContext();
19156 static PyObject *__pyx_unpickle_Enum__set_state(
struct __pyx_MemviewEnum_obj *__pyx_v___pyx_result, PyObject *__pyx_v___pyx_state) {
19157 PyObject *__pyx_r = NULL;
19158 __Pyx_RefNannyDeclarations
19159 PyObject *__pyx_t_1 = NULL;
19161 Py_ssize_t __pyx_t_3;
19164 PyObject *__pyx_t_6 = NULL;
19165 PyObject *__pyx_t_7 = NULL;
19166 PyObject *__pyx_t_8 = NULL;
19167 int __pyx_lineno = 0;
19168 const char *__pyx_filename = NULL;
19169 int __pyx_clineno = 0;
19170 __Pyx_RefNannySetupContext(
"__pyx_unpickle_Enum__set_state", 0);
19179 if (unlikely(__pyx_v___pyx_state == Py_None)) {
19180 PyErr_SetString(PyExc_TypeError,
"'NoneType' object is not subscriptable");
19181 __PYX_ERR(0, 12, __pyx_L1_error)
19183 __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 0,
long, 1, __Pyx_PyInt_From_long, 0, 0, 1);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 12, __pyx_L1_error)
19184 __Pyx_GOTREF(__pyx_t_1);
19185 __Pyx_GIVEREF(__pyx_t_1);
19186 __Pyx_GOTREF(__pyx_v___pyx_result->name);
19187 __Pyx_DECREF(__pyx_v___pyx_result->name);
19188 __pyx_v___pyx_result->name = __pyx_t_1;
19197 if (unlikely(__pyx_v___pyx_state == Py_None)) {
19198 PyErr_SetString(PyExc_TypeError,
"object of type 'NoneType' has no len()");
19199 __PYX_ERR(0, 13, __pyx_L1_error)
19201 __pyx_t_3 = PyTuple_GET_SIZE(__pyx_v___pyx_state);
if (unlikely(__pyx_t_3 == ((Py_ssize_t)-1))) __PYX_ERR(0, 13, __pyx_L1_error)
19202 __pyx_t_4 = ((__pyx_t_3 > 1) != 0);
19205 __pyx_t_2 = __pyx_t_4;
19206 goto __pyx_L4_bool_binop_done;
19208 __pyx_t_4 = __Pyx_HasAttr(((PyObject *)__pyx_v___pyx_result), __pyx_n_s_dict);
if (unlikely(__pyx_t_4 == ((
int)-1))) __PYX_ERR(0, 13, __pyx_L1_error)
19209 __pyx_t_5 = (__pyx_t_4 != 0);
19210 __pyx_t_2 = __pyx_t_5;
19211 __pyx_L4_bool_binop_done:;
19219 __pyx_t_6 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v___pyx_result), __pyx_n_s_dict);
if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 14, __pyx_L1_error)
19220 __Pyx_GOTREF(__pyx_t_6);
19221 __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_update);
if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 14, __pyx_L1_error)
19222 __Pyx_GOTREF(__pyx_t_7);
19223 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
19224 if (unlikely(__pyx_v___pyx_state == Py_None)) {
19225 PyErr_SetString(PyExc_TypeError,
"'NoneType' object is not subscriptable");
19226 __PYX_ERR(0, 14, __pyx_L1_error)
19228 __pyx_t_6 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 1,
long, 1, __Pyx_PyInt_From_long, 0, 0, 1);
if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 14, __pyx_L1_error)
19229 __Pyx_GOTREF(__pyx_t_6);
19231 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_7))) {
19232 __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_7);
19233 if (likely(__pyx_t_8)) {
19234 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_7);
19235 __Pyx_INCREF(__pyx_t_8);
19236 __Pyx_INCREF(
function);
19237 __Pyx_DECREF_SET(__pyx_t_7,
function);
19240 __pyx_t_1 = (__pyx_t_8) ? __Pyx_PyObject_Call2Args(__pyx_t_7, __pyx_t_8, __pyx_t_6) : __Pyx_PyObject_CallOneArg(__pyx_t_7, __pyx_t_6);
19241 __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
19242 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
19243 if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 14, __pyx_L1_error)
19244 __Pyx_GOTREF(__pyx_t_1);
19245 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
19246 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
19265 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
19268 __Pyx_XDECREF(__pyx_t_1);
19269 __Pyx_XDECREF(__pyx_t_6);
19270 __Pyx_XDECREF(__pyx_t_7);
19271 __Pyx_XDECREF(__pyx_t_8);
19272 __Pyx_AddTraceback(
"View.MemoryView.__pyx_unpickle_Enum__set_state", __pyx_clineno, __pyx_lineno, __pyx_filename);
19275 __Pyx_XGIVEREF(__pyx_r);
19276 __Pyx_RefNannyFinishContext();
19288 static PyObject *__pyx_format_from_typeinfo(__Pyx_TypeInfo *__pyx_v_type) {
19289 __Pyx_StructField *__pyx_v_field;
19290 struct __pyx_typeinfo_string __pyx_v_fmt;
19291 PyObject *__pyx_v_part = 0;
19292 PyObject *__pyx_v_result = 0;
19293 PyObject *__pyx_v_alignment = NULL;
19294 PyObject *__pyx_v_parts = NULL;
19295 PyObject *__pyx_v_extents = NULL;
19297 PyObject *__pyx_r = NULL;
19298 __Pyx_RefNannyDeclarations
19300 PyObject *__pyx_t_2 = NULL;
19301 __Pyx_StructField *__pyx_t_3;
19302 PyObject *__pyx_t_4 = NULL;
19303 PyObject *__pyx_t_5 = NULL;
19308 int __pyx_lineno = 0;
19309 const char *__pyx_filename = NULL;
19310 int __pyx_clineno = 0;
19311 __Pyx_RefNannySetupContext(
"format_from_typeinfo", 0);
19320 __pyx_t_1 = ((__pyx_v_type->typegroup ==
'S') != 0);
19330 #ifndef CYTHON_WITHOUT_ASSERTIONS
19331 if (unlikely(!Py_OptimizeFlag)) {
19332 if (unlikely(!((__pyx_v_type->fields != NULL) != 0))) {
19333 PyErr_SetNone(PyExc_AssertionError);
19334 __PYX_ERR(0, 1469, __pyx_L1_error)
19346 #ifndef CYTHON_WITHOUT_ASSERTIONS
19347 if (unlikely(!Py_OptimizeFlag)) {
19348 if (unlikely(!((__pyx_v_type->fields->type != NULL) != 0))) {
19349 PyErr_SetNone(PyExc_AssertionError);
19350 __PYX_ERR(0, 1470, __pyx_L1_error)
19362 __pyx_t_1 = ((__pyx_v_type->flags & __PYX_BUF_FLAGS_PACKED_STRUCT) != 0);
19372 __Pyx_INCREF(__pyx_kp_b__35);
19373 __pyx_v_alignment = __pyx_kp_b__35;
19393 __Pyx_INCREF(__pyx_kp_b__36);
19394 __pyx_v_alignment = __pyx_kp_b__36;
19405 __pyx_t_2 = PyList_New(1);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1477, __pyx_L1_error)
19406 __Pyx_GOTREF(__pyx_t_2);
19407 __Pyx_INCREF(__pyx_kp_b_T);
19408 __Pyx_GIVEREF(__pyx_kp_b_T);
19409 PyList_SET_ITEM(__pyx_t_2, 0, __pyx_kp_b_T);
19410 __pyx_v_parts = ((PyObject*)__pyx_t_2);
19420 __pyx_t_3 = __pyx_v_type->fields;
19421 __pyx_v_field = __pyx_t_3;
19431 __pyx_t_1 = (__pyx_v_field->type != 0);
19432 if (!__pyx_t_1)
break;
19441 __pyx_t_2 = __pyx_format_from_typeinfo(__pyx_v_field->type);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1481, __pyx_L1_error)
19442 __Pyx_GOTREF(__pyx_t_2);
19443 __Pyx_XDECREF_SET(__pyx_v_part, ((PyObject*)__pyx_t_2));
19453 __pyx_t_2 = PyNumber_Add(__pyx_v_part, __pyx_kp_b__37);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1482, __pyx_L1_error)
19454 __Pyx_GOTREF(__pyx_t_2);
19455 __pyx_t_4 = __Pyx_PyBytes_FromString(__pyx_v_field->name);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1482, __pyx_L1_error)
19456 __Pyx_GOTREF(__pyx_t_4);
19457 __pyx_t_5 = PyNumber_Add(__pyx_t_2, __pyx_t_4);
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1482, __pyx_L1_error)
19458 __Pyx_GOTREF(__pyx_t_5);
19459 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
19460 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
19461 __pyx_t_4 = PyNumber_Add(__pyx_t_5, __pyx_kp_b__37);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1482, __pyx_L1_error)
19462 __Pyx_GOTREF(__pyx_t_4);
19463 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
19464 __pyx_t_6 = __Pyx_PyList_Append(__pyx_v_parts, __pyx_t_4);
if (unlikely(__pyx_t_6 == ((
int)-1))) __PYX_ERR(0, 1482, __pyx_L1_error)
19465 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
19474 __pyx_v_field = (__pyx_v_field + 1);
19484 __pyx_t_4 = __Pyx_PyBytes_Join(__pyx_v_alignment, __pyx_v_parts);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1485, __pyx_L1_error)
19485 __Pyx_GOTREF(__pyx_t_4);
19486 __pyx_t_5 = PyNumber_Add(__pyx_t_4, __pyx_kp_b__38);
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1485, __pyx_L1_error)
19487 __Pyx_GOTREF(__pyx_t_5);
19488 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
19489 if (!(likely(PyBytes_CheckExact(__pyx_t_5))||((__pyx_t_5) == Py_None)||(PyErr_Format(PyExc_TypeError,
"Expected %.16s, got %.200s",
"bytes", Py_TYPE(__pyx_t_5)->tp_name), 0))) __PYX_ERR(0, 1485, __pyx_L1_error)
19490 __pyx_v_result = ((PyObject*)__pyx_t_5);
19511 __pyx_v_fmt = __Pyx_TypeInfoToFormat(__pyx_v_type);
19520 __pyx_t_1 = ((__pyx_v_type->arraysize[0]) != 0);
19530 __pyx_t_5 = PyList_New(0);
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1489, __pyx_L1_error)
19531 __Pyx_GOTREF(__pyx_t_5);
19532 __pyx_t_7 = __pyx_v_type->ndim;
19533 __pyx_t_8 = __pyx_t_7;
19534 for (__pyx_t_9 = 0; __pyx_t_9 < __pyx_t_8; __pyx_t_9+=1) {
19535 __pyx_v_i = __pyx_t_9;
19536 __pyx_t_4 = __Pyx_PyInt_FromSize_t((__pyx_v_type->arraysize[__pyx_v_i]));
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1489, __pyx_L1_error)
19537 __Pyx_GOTREF(__pyx_t_4);
19538 __pyx_t_2 = __Pyx_PyObject_Unicode(__pyx_t_4);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1489, __pyx_L1_error)
19539 __Pyx_GOTREF(__pyx_t_2);
19540 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
19541 if (unlikely(__Pyx_ListComp_Append(__pyx_t_5, (PyObject*)__pyx_t_2))) __PYX_ERR(0, 1489, __pyx_L1_error)
19542 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
19544 __pyx_v_extents = ((PyObject*)__pyx_t_5);
19554 __pyx_t_5 = PyUnicode_Join(__pyx_kp_u__39, __pyx_v_extents);
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1490, __pyx_L1_error)
19555 __Pyx_GOTREF(__pyx_t_5);
19556 __pyx_t_2 = PyUnicode_Format(__pyx_kp_u_s, __pyx_t_5);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1490, __pyx_L1_error)
19557 __Pyx_GOTREF(__pyx_t_2);
19558 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
19559 __pyx_t_5 = PyUnicode_AsASCIIString(((PyObject*)__pyx_t_2));
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1490, __pyx_L1_error)
19560 __Pyx_GOTREF(__pyx_t_5);
19561 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
19562 __pyx_t_2 = __Pyx_PyObject_FromString(__pyx_v_fmt.string);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1490, __pyx_L1_error)
19563 __Pyx_GOTREF(__pyx_t_2);
19564 __pyx_t_4 = PyNumber_Add(__pyx_t_5, __pyx_t_2);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1490, __pyx_L1_error)
19565 __Pyx_GOTREF(__pyx_t_4);
19566 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
19567 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
19568 if (!(likely(PyBytes_CheckExact(__pyx_t_4))||(PyErr_Format(PyExc_TypeError,
"Expected %.16s, got %.200s",
"bytes", Py_TYPE(__pyx_t_4)->tp_name), 0))) __PYX_ERR(0, 1490, __pyx_L1_error)
19569 __pyx_v_result = ((PyObject*)__pyx_t_4);
19590 __pyx_t_4 = __Pyx_PyObject_FromString(__pyx_v_fmt.string);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1492, __pyx_L1_error)
19591 __Pyx_GOTREF(__pyx_t_4);
19592 __pyx_v_result = ((PyObject*)__pyx_t_4);
19604 __Pyx_XDECREF(__pyx_r);
19605 __Pyx_INCREF(__pyx_v_result);
19606 __pyx_r = __pyx_v_result;
19619 __Pyx_XDECREF(__pyx_t_2);
19620 __Pyx_XDECREF(__pyx_t_4);
19621 __Pyx_XDECREF(__pyx_t_5);
19622 __Pyx_AddTraceback(
"BufferFormatFromTypeInfo.format_from_typeinfo", __pyx_clineno, __pyx_lineno, __pyx_filename);
19625 __Pyx_XDECREF(__pyx_v_part);
19626 __Pyx_XDECREF(__pyx_v_result);
19627 __Pyx_XDECREF(__pyx_v_alignment);
19628 __Pyx_XDECREF(__pyx_v_parts);
19629 __Pyx_XDECREF(__pyx_v_extents);
19630 __Pyx_XGIVEREF(__pyx_r);
19631 __Pyx_RefNannyFinishContext();
19635 static PyObject *__pyx_tp_new_22equivalent_polynomials_Simplex(PyTypeObject *t, PyObject *a, PyObject *k) {
19636 struct __pyx_obj_22equivalent_polynomials_Simplex *p;
19638 if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) {
19639 o = (*t->tp_alloc)(t, 0);
19641 o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0);
19643 if (unlikely(!o))
return 0;
19644 p = ((
struct __pyx_obj_22equivalent_polynomials_Simplex *)o);
19654 p->xiBuffer = ((PyArrayObject *)Py_None); Py_INCREF(Py_None);
19655 p->_H = ((PyArrayObject *)Py_None); Py_INCREF(Py_None);
19656 p->_ImH = ((PyArrayObject *)Py_None); Py_INCREF(Py_None);
19657 p->_D = ((PyArrayObject *)Py_None); Py_INCREF(Py_None);
19658 if (unlikely(__pyx_pw_22equivalent_polynomials_7Simplex_1__cinit__(o, a, k) < 0))
goto bad;
19661 Py_DECREF(o); o = 0;
19665 static void __pyx_tp_dealloc_22equivalent_polynomials_Simplex(PyObject *o) {
19666 struct __pyx_obj_22equivalent_polynomials_Simplex *p = (
struct __pyx_obj_22equivalent_polynomials_Simplex *)o;
19667 #if CYTHON_USE_TP_FINALIZE
19668 if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) {
19669 if (PyObject_CallFinalizerFromDealloc(o))
return;
19672 PyObject_GC_UnTrack(o);
19673 __Pyx_call_destructor(p->s11);
19674 __Pyx_call_destructor(p->s12);
19675 __Pyx_call_destructor(p->s13);
19676 __Pyx_call_destructor(p->s21);
19677 __Pyx_call_destructor(p->s22);
19678 __Pyx_call_destructor(p->s23);
19679 __Pyx_call_destructor(p->s31);
19680 __Pyx_call_destructor(p->s32);
19681 __Pyx_call_destructor(p->s33);
19682 Py_CLEAR(p->xiBuffer);
19686 (*Py_TYPE(o)->tp_free)(o);
19689 static int __pyx_tp_traverse_22equivalent_polynomials_Simplex(PyObject *o, visitproc
v,
void *a) {
19691 struct __pyx_obj_22equivalent_polynomials_Simplex *p = (
struct __pyx_obj_22equivalent_polynomials_Simplex *)o;
19693 e = (*v)(((PyObject *)p->xiBuffer), a);
if (e)
return e;
19696 e = (*v)(((PyObject *)p->_H), a);
if (e)
return e;
19699 e = (*v)(((PyObject *)p->_ImH), a);
if (e)
return e;
19702 e = (*v)(((PyObject *)p->_D), a);
if (e)
return e;
19707 static int __pyx_tp_clear_22equivalent_polynomials_Simplex(PyObject *o) {
19709 struct __pyx_obj_22equivalent_polynomials_Simplex *p = (
struct __pyx_obj_22equivalent_polynomials_Simplex *)o;
19710 tmp = ((PyObject*)p->xiBuffer);
19711 p->xiBuffer = ((PyArrayObject *)Py_None); Py_INCREF(Py_None);
19713 tmp = ((PyObject*)p->_H);
19714 p->_H = ((PyArrayObject *)Py_None); Py_INCREF(Py_None);
19716 tmp = ((PyObject*)p->_ImH);
19717 p->_ImH = ((PyArrayObject *)Py_None); Py_INCREF(Py_None);
19719 tmp = ((PyObject*)p->_D);
19720 p->_D = ((PyArrayObject *)Py_None); Py_INCREF(Py_None);
19725 static PyObject *__pyx_getprop_22equivalent_polynomials_7Simplex_H(PyObject *o, CYTHON_UNUSED
void *x) {
19726 return __pyx_pw_22equivalent_polynomials_7Simplex_1H_1__get__(o);
19729 static PyObject *__pyx_getprop_22equivalent_polynomials_7Simplex_ImH(PyObject *o, CYTHON_UNUSED
void *x) {
19730 return __pyx_pw_22equivalent_polynomials_7Simplex_3ImH_1__get__(o);
19733 static PyObject *__pyx_getprop_22equivalent_polynomials_7Simplex_D(PyObject *o, CYTHON_UNUSED
void *x) {
19734 return __pyx_pw_22equivalent_polynomials_7Simplex_1D_1__get__(o);
19737 static PyMethodDef __pyx_methods_22equivalent_polynomials_Simplex[] = {
19738 {
"calculate", (PyCFunction)(
void*)(PyCFunctionWithKeywords)__pyx_pw_22equivalent_polynomials_7Simplex_3calculate, METH_VARARGS|METH_KEYWORDS, 0},
19739 {
"set_quad", (PyCFunction)__pyx_pw_22equivalent_polynomials_7Simplex_5set_quad, METH_O, 0},
19740 {
"__reduce_cython__", (PyCFunction)__pyx_pw_22equivalent_polynomials_7Simplex_7__reduce_cython__, METH_NOARGS, 0},
19741 {
"__setstate_cython__", (PyCFunction)__pyx_pw_22equivalent_polynomials_7Simplex_9__setstate_cython__, METH_O, 0},
19745 static struct PyGetSetDef __pyx_getsets_22equivalent_polynomials_Simplex[] = {
19746 {(
char *)
"H", __pyx_getprop_22equivalent_polynomials_7Simplex_H, 0, (
char *)0, 0},
19747 {(
char *)
"ImH", __pyx_getprop_22equivalent_polynomials_7Simplex_ImH, 0, (
char *)0, 0},
19748 {(
char *)
"D", __pyx_getprop_22equivalent_polynomials_7Simplex_D, 0, (
char *)0, 0},
19752 static PyTypeObject __pyx_type_22equivalent_polynomials_Simplex = {
19753 PyVarObject_HEAD_INIT(0, 0)
19754 "equivalent_polynomials.Simplex",
19755 sizeof(
struct __pyx_obj_22equivalent_polynomials_Simplex),
19757 __pyx_tp_dealloc_22equivalent_polynomials_Simplex,
19758 #
if PY_VERSION_HEX < 0x030800b4
19761 #
if PY_VERSION_HEX >= 0x030800b4
19766 #
if PY_MAJOR_VERSION < 3
19769 #
if PY_MAJOR_VERSION >= 3
19782 Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC,
19784 __pyx_tp_traverse_22equivalent_polynomials_Simplex,
19785 __pyx_tp_clear_22equivalent_polynomials_Simplex,
19790 __pyx_methods_22equivalent_polynomials_Simplex,
19792 __pyx_getsets_22equivalent_polynomials_Simplex,
19800 __pyx_tp_new_22equivalent_polynomials_Simplex,
19810 #
if PY_VERSION_HEX >= 0x030400a1
19813 #
if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800)
19816 #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
19819 #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000
19823 static struct __pyx_vtabstruct_array __pyx_vtable_array;
19825 static PyObject *__pyx_tp_new_array(PyTypeObject *t, PyObject *a, PyObject *k) {
19826 struct __pyx_array_obj *p;
19828 if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) {
19829 o = (*t->tp_alloc)(t, 0);
19831 o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0);
19833 if (unlikely(!o))
return 0;
19834 p = ((
struct __pyx_array_obj *)o);
19835 p->__pyx_vtab = __pyx_vtabptr_array;
19836 p->mode = ((PyObject*)Py_None); Py_INCREF(Py_None);
19837 p->_format = ((PyObject*)Py_None); Py_INCREF(Py_None);
19838 if (unlikely(__pyx_array___cinit__(o, a, k) < 0))
goto bad;
19841 Py_DECREF(o); o = 0;
19845 static void __pyx_tp_dealloc_array(PyObject *o) {
19846 struct __pyx_array_obj *p = (
struct __pyx_array_obj *)o;
19847 #if CYTHON_USE_TP_FINALIZE
19848 if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && (!PyType_IS_GC(Py_TYPE(o)) || !_PyGC_FINALIZED(o))) {
19849 if (PyObject_CallFinalizerFromDealloc(o))
return;
19853 PyObject *etype, *eval, *etb;
19854 PyErr_Fetch(&etype, &eval, &etb);
19855 __Pyx_SET_REFCNT(o, Py_REFCNT(o) + 1);
19856 __pyx_array___dealloc__(o);
19857 __Pyx_SET_REFCNT(o, Py_REFCNT(o) - 1);
19858 PyErr_Restore(etype, eval, etb);
19861 Py_CLEAR(p->_format);
19862 (*Py_TYPE(o)->tp_free)(o);
19864 static PyObject *__pyx_sq_item_array(PyObject *o, Py_ssize_t i) {
19866 PyObject *x = PyInt_FromSsize_t(i);
if(!x)
return 0;
19867 r = Py_TYPE(o)->tp_as_mapping->mp_subscript(o, x);
19872 static int __pyx_mp_ass_subscript_array(PyObject *o, PyObject *i, PyObject *
v) {
19874 return __pyx_array___setitem__(o, i,
v);
19877 PyErr_Format(PyExc_NotImplementedError,
19878 "Subscript deletion not supported by %.200s", Py_TYPE(o)->tp_name);
19883 static PyObject *__pyx_tp_getattro_array(PyObject *o, PyObject *
n) {
19884 PyObject *
v = __Pyx_PyObject_GenericGetAttr(o,
n);
19885 if (!
v && PyErr_ExceptionMatches(PyExc_AttributeError)) {
19887 v = __pyx_array___getattr__(o,
n);
19892 static PyObject *__pyx_getprop___pyx_array_memview(PyObject *o, CYTHON_UNUSED
void *x) {
19893 return __pyx_pw_15View_dot_MemoryView_5array_7memview_1__get__(o);
19896 static PyMethodDef __pyx_methods_array[] = {
19897 {
"__getattr__", (PyCFunction)__pyx_array___getattr__, METH_O|METH_COEXIST, 0},
19898 {
"__reduce_cython__", (PyCFunction)__pyx_pw___pyx_array_1__reduce_cython__, METH_NOARGS, 0},
19899 {
"__setstate_cython__", (PyCFunction)__pyx_pw___pyx_array_3__setstate_cython__, METH_O, 0},
19903 static struct PyGetSetDef __pyx_getsets_array[] = {
19904 {(
char *)
"memview", __pyx_getprop___pyx_array_memview, 0, (
char *)0, 0},
19908 static PySequenceMethods __pyx_tp_as_sequence_array = {
19909 __pyx_array___len__,
19912 __pyx_sq_item_array,
19921 static PyMappingMethods __pyx_tp_as_mapping_array = {
19922 __pyx_array___len__,
19923 __pyx_array___getitem__,
19924 __pyx_mp_ass_subscript_array,
19927 static PyBufferProcs __pyx_tp_as_buffer_array = {
19928 #if PY_MAJOR_VERSION < 3
19931 #if PY_MAJOR_VERSION < 3
19934 #if PY_MAJOR_VERSION < 3
19937 #if PY_MAJOR_VERSION < 3
19940 __pyx_array_getbuffer,
19944 static PyTypeObject __pyx_type___pyx_array = {
19945 PyVarObject_HEAD_INIT(0, 0)
19946 "equivalent_polynomials.array",
19947 sizeof(
struct __pyx_array_obj),
19949 __pyx_tp_dealloc_array,
19950 #
if PY_VERSION_HEX < 0x030800b4
19953 #
if PY_VERSION_HEX >= 0x030800b4
19958 #
if PY_MAJOR_VERSION < 3
19961 #
if PY_MAJOR_VERSION >= 3
19966 &__pyx_tp_as_sequence_array,
19967 &__pyx_tp_as_mapping_array,
19971 __pyx_tp_getattro_array,
19973 &__pyx_tp_as_buffer_array,
19974 Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE,
19982 __pyx_methods_array,
19984 __pyx_getsets_array,
19992 __pyx_tp_new_array,
20002 #
if PY_VERSION_HEX >= 0x030400a1
20005 #
if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800)
20008 #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
20011 #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000
20016 static PyObject *__pyx_tp_new_Enum(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
20017 struct __pyx_MemviewEnum_obj *p;
20019 if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) {
20020 o = (*t->tp_alloc)(t, 0);
20022 o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0);
20024 if (unlikely(!o))
return 0;
20025 p = ((
struct __pyx_MemviewEnum_obj *)o);
20026 p->name = Py_None; Py_INCREF(Py_None);
20030 static void __pyx_tp_dealloc_Enum(PyObject *o) {
20031 struct __pyx_MemviewEnum_obj *p = (
struct __pyx_MemviewEnum_obj *)o;
20032 #if CYTHON_USE_TP_FINALIZE
20033 if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) {
20034 if (PyObject_CallFinalizerFromDealloc(o))
return;
20037 PyObject_GC_UnTrack(o);
20039 (*Py_TYPE(o)->tp_free)(o);
20042 static int __pyx_tp_traverse_Enum(PyObject *o, visitproc
v,
void *a) {
20044 struct __pyx_MemviewEnum_obj *p = (
struct __pyx_MemviewEnum_obj *)o;
20046 e = (*v)(p->name, a);
if (e)
return e;
20051 static int __pyx_tp_clear_Enum(PyObject *o) {
20053 struct __pyx_MemviewEnum_obj *p = (
struct __pyx_MemviewEnum_obj *)o;
20054 tmp = ((PyObject*)p->name);
20055 p->name = Py_None; Py_INCREF(Py_None);
20060 static PyMethodDef __pyx_methods_Enum[] = {
20061 {
"__reduce_cython__", (PyCFunction)__pyx_pw___pyx_MemviewEnum_1__reduce_cython__, METH_NOARGS, 0},
20062 {
"__setstate_cython__", (PyCFunction)__pyx_pw___pyx_MemviewEnum_3__setstate_cython__, METH_O, 0},
20066 static PyTypeObject __pyx_type___pyx_MemviewEnum = {
20067 PyVarObject_HEAD_INIT(0, 0)
20068 "equivalent_polynomials.Enum",
20069 sizeof(
struct __pyx_MemviewEnum_obj),
20071 __pyx_tp_dealloc_Enum,
20072 #
if PY_VERSION_HEX < 0x030800b4
20075 #
if PY_VERSION_HEX >= 0x030800b4
20080 #
if PY_MAJOR_VERSION < 3
20083 #
if PY_MAJOR_VERSION >= 3
20086 __pyx_MemviewEnum___repr__,
20096 Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC,
20098 __pyx_tp_traverse_Enum,
20099 __pyx_tp_clear_Enum,
20104 __pyx_methods_Enum,
20112 __pyx_MemviewEnum___init__,
20124 #
if PY_VERSION_HEX >= 0x030400a1
20127 #
if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800)
20130 #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
20133 #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000
20137 static struct __pyx_vtabstruct_memoryview __pyx_vtable_memoryview;
20139 static PyObject *__pyx_tp_new_memoryview(PyTypeObject *t, PyObject *a, PyObject *k) {
20140 struct __pyx_memoryview_obj *p;
20142 if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) {
20143 o = (*t->tp_alloc)(t, 0);
20145 o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0);
20147 if (unlikely(!o))
return 0;
20148 p = ((
struct __pyx_memoryview_obj *)o);
20149 p->__pyx_vtab = __pyx_vtabptr_memoryview;
20150 p->obj = Py_None; Py_INCREF(Py_None);
20151 p->_size = Py_None; Py_INCREF(Py_None);
20152 p->_array_interface = Py_None; Py_INCREF(Py_None);
20153 p->view.obj = NULL;
20154 if (unlikely(__pyx_memoryview___cinit__(o, a, k) < 0))
goto bad;
20157 Py_DECREF(o); o = 0;
20161 static void __pyx_tp_dealloc_memoryview(PyObject *o) {
20162 struct __pyx_memoryview_obj *p = (
struct __pyx_memoryview_obj *)o;
20163 #if CYTHON_USE_TP_FINALIZE
20164 if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) {
20165 if (PyObject_CallFinalizerFromDealloc(o))
return;
20168 PyObject_GC_UnTrack(o);
20170 PyObject *etype, *eval, *etb;
20171 PyErr_Fetch(&etype, &eval, &etb);
20172 __Pyx_SET_REFCNT(o, Py_REFCNT(o) + 1);
20173 __pyx_memoryview___dealloc__(o);
20174 __Pyx_SET_REFCNT(o, Py_REFCNT(o) - 1);
20175 PyErr_Restore(etype, eval, etb);
20178 Py_CLEAR(p->_size);
20179 Py_CLEAR(p->_array_interface);
20180 (*Py_TYPE(o)->tp_free)(o);
20183 static int __pyx_tp_traverse_memoryview(PyObject *o, visitproc
v,
void *a) {
20185 struct __pyx_memoryview_obj *p = (
struct __pyx_memoryview_obj *)o;
20187 e = (*v)(p->obj, a);
if (e)
return e;
20190 e = (*v)(p->_size, a);
if (e)
return e;
20192 if (p->_array_interface) {
20193 e = (*v)(p->_array_interface, a);
if (e)
return e;
20196 e = (*v)(p->view.obj, a);
if (e)
return e;
20201 static int __pyx_tp_clear_memoryview(PyObject *o) {
20203 struct __pyx_memoryview_obj *p = (
struct __pyx_memoryview_obj *)o;
20204 tmp = ((PyObject*)p->obj);
20205 p->obj = Py_None; Py_INCREF(Py_None);
20207 tmp = ((PyObject*)p->_size);
20208 p->_size = Py_None; Py_INCREF(Py_None);
20210 tmp = ((PyObject*)p->_array_interface);
20211 p->_array_interface = Py_None; Py_INCREF(Py_None);
20213 Py_CLEAR(p->view.obj);
20216 static PyObject *__pyx_sq_item_memoryview(PyObject *o, Py_ssize_t i) {
20218 PyObject *x = PyInt_FromSsize_t(i);
if(!x)
return 0;
20219 r = Py_TYPE(o)->tp_as_mapping->mp_subscript(o, x);
20224 static int __pyx_mp_ass_subscript_memoryview(PyObject *o, PyObject *i, PyObject *
v) {
20226 return __pyx_memoryview___setitem__(o, i,
v);
20229 PyErr_Format(PyExc_NotImplementedError,
20230 "Subscript deletion not supported by %.200s", Py_TYPE(o)->tp_name);
20235 static PyObject *__pyx_getprop___pyx_memoryview_T(PyObject *o, CYTHON_UNUSED
void *x) {
20236 return __pyx_pw_15View_dot_MemoryView_10memoryview_1T_1__get__(o);
20239 static PyObject *__pyx_getprop___pyx_memoryview_base(PyObject *o, CYTHON_UNUSED
void *x) {
20240 return __pyx_pw_15View_dot_MemoryView_10memoryview_4base_1__get__(o);
20243 static PyObject *__pyx_getprop___pyx_memoryview_shape(PyObject *o, CYTHON_UNUSED
void *x) {
20244 return __pyx_pw_15View_dot_MemoryView_10memoryview_5shape_1__get__(o);
20247 static PyObject *__pyx_getprop___pyx_memoryview_strides(PyObject *o, CYTHON_UNUSED
void *x) {
20248 return __pyx_pw_15View_dot_MemoryView_10memoryview_7strides_1__get__(o);
20251 static PyObject *__pyx_getprop___pyx_memoryview_suboffsets(PyObject *o, CYTHON_UNUSED
void *x) {
20252 return __pyx_pw_15View_dot_MemoryView_10memoryview_10suboffsets_1__get__(o);
20255 static PyObject *__pyx_getprop___pyx_memoryview_ndim(PyObject *o, CYTHON_UNUSED
void *x) {
20256 return __pyx_pw_15View_dot_MemoryView_10memoryview_4ndim_1__get__(o);
20259 static PyObject *__pyx_getprop___pyx_memoryview_itemsize(PyObject *o, CYTHON_UNUSED
void *x) {
20260 return __pyx_pw_15View_dot_MemoryView_10memoryview_8itemsize_1__get__(o);
20263 static PyObject *__pyx_getprop___pyx_memoryview_nbytes(PyObject *o, CYTHON_UNUSED
void *x) {
20264 return __pyx_pw_15View_dot_MemoryView_10memoryview_6nbytes_1__get__(o);
20267 static PyObject *__pyx_getprop___pyx_memoryview_size(PyObject *o, CYTHON_UNUSED
void *x) {
20268 return __pyx_pw_15View_dot_MemoryView_10memoryview_4size_1__get__(o);
20271 static PyMethodDef __pyx_methods_memoryview[] = {
20272 {
"is_c_contig", (PyCFunction)__pyx_memoryview_is_c_contig, METH_NOARGS, 0},
20273 {
"is_f_contig", (PyCFunction)__pyx_memoryview_is_f_contig, METH_NOARGS, 0},
20274 {
"copy", (PyCFunction)__pyx_memoryview_copy, METH_NOARGS, 0},
20275 {
"copy_fortran", (PyCFunction)__pyx_memoryview_copy_fortran, METH_NOARGS, 0},
20276 {
"__reduce_cython__", (PyCFunction)__pyx_pw___pyx_memoryview_1__reduce_cython__, METH_NOARGS, 0},
20277 {
"__setstate_cython__", (PyCFunction)__pyx_pw___pyx_memoryview_3__setstate_cython__, METH_O, 0},
20281 static struct PyGetSetDef __pyx_getsets_memoryview[] = {
20282 {(
char *)
"T", __pyx_getprop___pyx_memoryview_T, 0, (
char *)0, 0},
20283 {(
char *)
"base", __pyx_getprop___pyx_memoryview_base, 0, (
char *)0, 0},
20284 {(
char *)
"shape", __pyx_getprop___pyx_memoryview_shape, 0, (
char *)0, 0},
20285 {(
char *)
"strides", __pyx_getprop___pyx_memoryview_strides, 0, (
char *)0, 0},
20286 {(
char *)
"suboffsets", __pyx_getprop___pyx_memoryview_suboffsets, 0, (
char *)0, 0},
20287 {(
char *)
"ndim", __pyx_getprop___pyx_memoryview_ndim, 0, (
char *)0, 0},
20288 {(
char *)
"itemsize", __pyx_getprop___pyx_memoryview_itemsize, 0, (
char *)0, 0},
20289 {(
char *)
"nbytes", __pyx_getprop___pyx_memoryview_nbytes, 0, (
char *)0, 0},
20290 {(
char *)
"size", __pyx_getprop___pyx_memoryview_size, 0, (
char *)0, 0},
20294 static PySequenceMethods __pyx_tp_as_sequence_memoryview = {
20295 __pyx_memoryview___len__,
20298 __pyx_sq_item_memoryview,
20307 static PyMappingMethods __pyx_tp_as_mapping_memoryview = {
20308 __pyx_memoryview___len__,
20309 __pyx_memoryview___getitem__,
20310 __pyx_mp_ass_subscript_memoryview,
20313 static PyBufferProcs __pyx_tp_as_buffer_memoryview = {
20314 #if PY_MAJOR_VERSION < 3
20317 #if PY_MAJOR_VERSION < 3
20320 #if PY_MAJOR_VERSION < 3
20323 #if PY_MAJOR_VERSION < 3
20326 __pyx_memoryview_getbuffer,
20330 static PyTypeObject __pyx_type___pyx_memoryview = {
20331 PyVarObject_HEAD_INIT(0, 0)
20332 "equivalent_polynomials.memoryview",
20333 sizeof(
struct __pyx_memoryview_obj),
20335 __pyx_tp_dealloc_memoryview,
20336 #
if PY_VERSION_HEX < 0x030800b4
20339 #
if PY_VERSION_HEX >= 0x030800b4
20344 #
if PY_MAJOR_VERSION < 3
20347 #
if PY_MAJOR_VERSION >= 3
20350 __pyx_memoryview___repr__,
20352 &__pyx_tp_as_sequence_memoryview,
20353 &__pyx_tp_as_mapping_memoryview,
20356 __pyx_memoryview___str__,
20359 &__pyx_tp_as_buffer_memoryview,
20360 Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC,
20362 __pyx_tp_traverse_memoryview,
20363 __pyx_tp_clear_memoryview,
20368 __pyx_methods_memoryview,
20370 __pyx_getsets_memoryview,
20378 __pyx_tp_new_memoryview,
20388 #
if PY_VERSION_HEX >= 0x030400a1
20391 #
if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800)
20394 #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
20397 #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000
20401 static struct __pyx_vtabstruct__memoryviewslice __pyx_vtable__memoryviewslice;
20403 static PyObject *__pyx_tp_new__memoryviewslice(PyTypeObject *t, PyObject *a, PyObject *k) {
20404 struct __pyx_memoryviewslice_obj *p;
20405 PyObject *o = __pyx_tp_new_memoryview(t, a, k);
20406 if (unlikely(!o))
return 0;
20407 p = ((
struct __pyx_memoryviewslice_obj *)o);
20408 p->__pyx_base.__pyx_vtab = (
struct __pyx_vtabstruct_memoryview*)__pyx_vtabptr__memoryviewslice;
20409 p->from_object = Py_None; Py_INCREF(Py_None);
20410 p->from_slice.memview = NULL;
20414 static void __pyx_tp_dealloc__memoryviewslice(PyObject *o) {
20415 struct __pyx_memoryviewslice_obj *p = (
struct __pyx_memoryviewslice_obj *)o;
20416 #if CYTHON_USE_TP_FINALIZE
20417 if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) {
20418 if (PyObject_CallFinalizerFromDealloc(o))
return;
20421 PyObject_GC_UnTrack(o);
20423 PyObject *etype, *eval, *etb;
20424 PyErr_Fetch(&etype, &eval, &etb);
20425 __Pyx_SET_REFCNT(o, Py_REFCNT(o) + 1);
20426 __pyx_memoryviewslice___dealloc__(o);
20427 __Pyx_SET_REFCNT(o, Py_REFCNT(o) - 1);
20428 PyErr_Restore(etype, eval, etb);
20430 Py_CLEAR(p->from_object);
20431 PyObject_GC_Track(o);
20432 __pyx_tp_dealloc_memoryview(o);
20435 static int __pyx_tp_traverse__memoryviewslice(PyObject *o, visitproc
v,
void *a) {
20437 struct __pyx_memoryviewslice_obj *p = (
struct __pyx_memoryviewslice_obj *)o;
20438 e = __pyx_tp_traverse_memoryview(o,
v, a);
if (e)
return e;
20439 if (p->from_object) {
20440 e = (*v)(p->from_object, a);
if (e)
return e;
20445 static int __pyx_tp_clear__memoryviewslice(PyObject *o) {
20447 struct __pyx_memoryviewslice_obj *p = (
struct __pyx_memoryviewslice_obj *)o;
20448 __pyx_tp_clear_memoryview(o);
20449 tmp = ((PyObject*)p->from_object);
20450 p->from_object = Py_None; Py_INCREF(Py_None);
20452 __PYX_XDEC_MEMVIEW(&p->from_slice, 1);
20456 static PyObject *__pyx_getprop___pyx_memoryviewslice_base(PyObject *o, CYTHON_UNUSED
void *x) {
20457 return __pyx_pw_15View_dot_MemoryView_16_memoryviewslice_4base_1__get__(o);
20460 static PyMethodDef __pyx_methods__memoryviewslice[] = {
20461 {
"__reduce_cython__", (PyCFunction)__pyx_pw___pyx_memoryviewslice_1__reduce_cython__, METH_NOARGS, 0},
20462 {
"__setstate_cython__", (PyCFunction)__pyx_pw___pyx_memoryviewslice_3__setstate_cython__, METH_O, 0},
20466 static struct PyGetSetDef __pyx_getsets__memoryviewslice[] = {
20467 {(
char *)
"base", __pyx_getprop___pyx_memoryviewslice_base, 0, (
char *)0, 0},
20471 static PyTypeObject __pyx_type___pyx_memoryviewslice = {
20472 PyVarObject_HEAD_INIT(0, 0)
20473 "equivalent_polynomials._memoryviewslice",
20474 sizeof(
struct __pyx_memoryviewslice_obj),
20476 __pyx_tp_dealloc__memoryviewslice,
20477 #
if PY_VERSION_HEX < 0x030800b4
20480 #
if PY_VERSION_HEX >= 0x030800b4
20485 #
if PY_MAJOR_VERSION < 3
20488 #
if PY_MAJOR_VERSION >= 3
20491 #
if CYTHON_COMPILING_IN_PYPY
20492 __pyx_memoryview___repr__,
20501 #
if CYTHON_COMPILING_IN_PYPY
20502 __pyx_memoryview___str__,
20509 Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC,
20510 "Internal class for passing memoryview slices to Python",
20511 __pyx_tp_traverse__memoryviewslice,
20512 __pyx_tp_clear__memoryviewslice,
20517 __pyx_methods__memoryviewslice,
20519 __pyx_getsets__memoryviewslice,
20527 __pyx_tp_new__memoryviewslice,
20537 #
if PY_VERSION_HEX >= 0x030400a1
20540 #
if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800)
20543 #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
20546 #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000
20551 static PyMethodDef __pyx_methods[] = {
20555 #if PY_MAJOR_VERSION >= 3
20556 #if CYTHON_PEP489_MULTI_PHASE_INIT
20557 static PyObject* __pyx_pymod_create(PyObject *spec, PyModuleDef *def);
20558 static int __pyx_pymod_exec_equivalent_polynomials(PyObject* module);
20559 static PyModuleDef_Slot __pyx_moduledef_slots[] = {
20560 {Py_mod_create, (
void*)__pyx_pymod_create},
20561 {Py_mod_exec, (
void*)__pyx_pymod_exec_equivalent_polynomials},
20566 static struct PyModuleDef __pyx_moduledef = {
20567 PyModuleDef_HEAD_INIT,
20568 "equivalent_polynomials",
20570 #if CYTHON_PEP489_MULTI_PHASE_INIT
20576 #if CYTHON_PEP489_MULTI_PHASE_INIT
20577 __pyx_moduledef_slots,
20586 #ifndef CYTHON_SMALL_CODE
20587 #if defined(__clang__)
20588 #define CYTHON_SMALL_CODE
20589 #elif defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 3))
20590 #define CYTHON_SMALL_CODE __attribute__((cold))
20592 #define CYTHON_SMALL_CODE
20596 static __Pyx_StringTabEntry __pyx_string_tab[] = {
20597 {&__pyx_n_s_ASCII, __pyx_k_ASCII,
sizeof(__pyx_k_ASCII), 0, 0, 1, 1},
20598 {&__pyx_kp_s_Buffer_view_does_not_expose_stri, __pyx_k_Buffer_view_does_not_expose_stri,
sizeof(__pyx_k_Buffer_view_does_not_expose_stri), 0, 0, 1, 0},
20599 {&__pyx_kp_s_Can_only_create_a_buffer_that_is, __pyx_k_Can_only_create_a_buffer_that_is,
sizeof(__pyx_k_Can_only_create_a_buffer_that_is), 0, 0, 1, 0},
20600 {&__pyx_kp_s_Cannot_assign_to_read_only_memor, __pyx_k_Cannot_assign_to_read_only_memor,
sizeof(__pyx_k_Cannot_assign_to_read_only_memor), 0, 0, 1, 0},
20601 {&__pyx_kp_s_Cannot_create_writable_memory_vi, __pyx_k_Cannot_create_writable_memory_vi,
sizeof(__pyx_k_Cannot_create_writable_memory_vi), 0, 0, 1, 0},
20602 {&__pyx_kp_s_Cannot_index_with_type_s, __pyx_k_Cannot_index_with_type_s,
sizeof(__pyx_k_Cannot_index_with_type_s), 0, 0, 1, 0},
20603 {&__pyx_n_s_Ellipsis, __pyx_k_Ellipsis,
sizeof(__pyx_k_Ellipsis), 0, 0, 1, 1},
20604 {&__pyx_kp_s_Empty_shape_tuple_for_cython_arr, __pyx_k_Empty_shape_tuple_for_cython_arr,
sizeof(__pyx_k_Empty_shape_tuple_for_cython_arr), 0, 0, 1, 0},
20605 {&__pyx_n_s_ImportError, __pyx_k_ImportError,
sizeof(__pyx_k_ImportError), 0, 0, 1, 1},
20606 {&__pyx_kp_s_Incompatible_checksums_0x_x_vs_0, __pyx_k_Incompatible_checksums_0x_x_vs_0,
sizeof(__pyx_k_Incompatible_checksums_0x_x_vs_0), 0, 0, 1, 0},
20607 {&__pyx_n_s_IndexError, __pyx_k_IndexError,
sizeof(__pyx_k_IndexError), 0, 0, 1, 1},
20608 {&__pyx_kp_s_Indirect_dimensions_not_supporte, __pyx_k_Indirect_dimensions_not_supporte,
sizeof(__pyx_k_Indirect_dimensions_not_supporte), 0, 0, 1, 0},
20609 {&__pyx_kp_s_Invalid_mode_expected_c_or_fortr, __pyx_k_Invalid_mode_expected_c_or_fortr,
sizeof(__pyx_k_Invalid_mode_expected_c_or_fortr), 0, 0, 1, 0},
20610 {&__pyx_kp_s_Invalid_shape_in_axis_d_d, __pyx_k_Invalid_shape_in_axis_d_d,
sizeof(__pyx_k_Invalid_shape_in_axis_d_d), 0, 0, 1, 0},
20611 {&__pyx_n_s_MemoryError, __pyx_k_MemoryError,
sizeof(__pyx_k_MemoryError), 0, 0, 1, 1},
20612 {&__pyx_kp_s_MemoryView_of_r_at_0x_x, __pyx_k_MemoryView_of_r_at_0x_x,
sizeof(__pyx_k_MemoryView_of_r_at_0x_x), 0, 0, 1, 0},
20613 {&__pyx_kp_s_MemoryView_of_r_object, __pyx_k_MemoryView_of_r_object,
sizeof(__pyx_k_MemoryView_of_r_object), 0, 0, 1, 0},
20614 {&__pyx_n_b_O, __pyx_k_O,
sizeof(__pyx_k_O), 0, 0, 0, 1},
20615 {&__pyx_kp_s_Out_of_bounds_on_buffer_access_a, __pyx_k_Out_of_bounds_on_buffer_access_a,
sizeof(__pyx_k_Out_of_bounds_on_buffer_access_a), 0, 0, 1, 0},
20616 {&__pyx_n_s_PickleError, __pyx_k_PickleError,
sizeof(__pyx_k_PickleError), 0, 0, 1, 1},
20617 {&__pyx_n_s_Simplex, __pyx_k_Simplex,
sizeof(__pyx_k_Simplex), 0, 0, 1, 1},
20618 {&__pyx_kp_b_T, __pyx_k_T,
sizeof(__pyx_k_T), 0, 0, 0, 0},
20619 {&__pyx_n_s_TypeError, __pyx_k_TypeError,
sizeof(__pyx_k_TypeError), 0, 0, 1, 1},
20620 {&__pyx_kp_s_Unable_to_convert_item_to_object, __pyx_k_Unable_to_convert_item_to_object,
sizeof(__pyx_k_Unable_to_convert_item_to_object), 0, 0, 1, 0},
20621 {&__pyx_n_s_ValueError, __pyx_k_ValueError,
sizeof(__pyx_k_ValueError), 0, 0, 1, 1},
20622 {&__pyx_n_s_View_MemoryView, __pyx_k_View_MemoryView,
sizeof(__pyx_k_View_MemoryView), 0, 0, 1, 1},
20623 {&__pyx_kp_b__35, __pyx_k__35,
sizeof(__pyx_k__35), 0, 0, 0, 0},
20624 {&__pyx_kp_b__36, __pyx_k__36,
sizeof(__pyx_k__36), 0, 0, 0, 0},
20625 {&__pyx_kp_b__37, __pyx_k__37,
sizeof(__pyx_k__37), 0, 0, 0, 0},
20626 {&__pyx_kp_b__38, __pyx_k__38,
sizeof(__pyx_k__38), 0, 0, 0, 0},
20627 {&__pyx_kp_u__39, __pyx_k__39,
sizeof(__pyx_k__39), 0, 1, 0, 0},
20628 {&__pyx_n_s_allocate_buffer, __pyx_k_allocate_buffer,
sizeof(__pyx_k_allocate_buffer), 0, 0, 1, 1},
20629 {&__pyx_n_s_asarray, __pyx_k_asarray,
sizeof(__pyx_k_asarray), 0, 0, 1, 1},
20630 {&__pyx_n_s_base, __pyx_k_base,
sizeof(__pyx_k_base), 0, 0, 1, 1},
20631 {&__pyx_n_s_c, __pyx_k_c,
sizeof(__pyx_k_c), 0, 0, 1, 1},
20632 {&__pyx_n_u_c, __pyx_k_c,
sizeof(__pyx_k_c), 0, 1, 0, 1},
20633 {&__pyx_n_s_class, __pyx_k_class,
sizeof(__pyx_k_class), 0, 0, 1, 1},
20634 {&__pyx_n_s_cline_in_traceback, __pyx_k_cline_in_traceback,
sizeof(__pyx_k_cline_in_traceback), 0, 0, 1, 1},
20635 {&__pyx_kp_s_contiguous_and_direct, __pyx_k_contiguous_and_direct,
sizeof(__pyx_k_contiguous_and_direct), 0, 0, 1, 0},
20636 {&__pyx_kp_s_contiguous_and_indirect, __pyx_k_contiguous_and_indirect,
sizeof(__pyx_k_contiguous_and_indirect), 0, 0, 1, 0},
20637 {&__pyx_n_s_d, __pyx_k_d,
sizeof(__pyx_k_d), 0, 0, 1, 1},
20638 {&__pyx_n_s_dict, __pyx_k_dict,
sizeof(__pyx_k_dict), 0, 0, 1, 1},
20639 {&__pyx_n_s_dtype_is_object, __pyx_k_dtype_is_object,
sizeof(__pyx_k_dtype_is_object), 0, 0, 1, 1},
20640 {&__pyx_n_s_encode, __pyx_k_encode,
sizeof(__pyx_k_encode), 0, 0, 1, 1},
20641 {&__pyx_n_s_enumerate, __pyx_k_enumerate,
sizeof(__pyx_k_enumerate), 0, 0, 1, 1},
20642 {&__pyx_n_s_error, __pyx_k_error,
sizeof(__pyx_k_error), 0, 0, 1, 1},
20643 {&__pyx_n_s_flags, __pyx_k_flags,
sizeof(__pyx_k_flags), 0, 0, 1, 1},
20644 {&__pyx_n_s_format, __pyx_k_format,
sizeof(__pyx_k_format), 0, 0, 1, 1},
20645 {&__pyx_n_s_fortran, __pyx_k_fortran,
sizeof(__pyx_k_fortran), 0, 0, 1, 1},
20646 {&__pyx_n_u_fortran, __pyx_k_fortran,
sizeof(__pyx_k_fortran), 0, 1, 0, 1},
20647 {&__pyx_n_s_getstate, __pyx_k_getstate,
sizeof(__pyx_k_getstate), 0, 0, 1, 1},
20648 {&__pyx_kp_s_got_differing_extents_in_dimensi, __pyx_k_got_differing_extents_in_dimensi,
sizeof(__pyx_k_got_differing_extents_in_dimensi), 0, 0, 1, 0},
20649 {&__pyx_n_s_id, __pyx_k_id,
sizeof(__pyx_k_id), 0, 0, 1, 1},
20650 {&__pyx_n_s_import, __pyx_k_import,
sizeof(__pyx_k_import), 0, 0, 1, 1},
20651 {&__pyx_n_s_itemsize, __pyx_k_itemsize,
sizeof(__pyx_k_itemsize), 0, 0, 1, 1},
20652 {&__pyx_kp_s_itemsize_0_for_cython_array, __pyx_k_itemsize_0_for_cython_array,
sizeof(__pyx_k_itemsize_0_for_cython_array), 0, 0, 1, 0},
20653 {&__pyx_n_s_join, __pyx_k_join,
sizeof(__pyx_k_join), 0, 0, 1, 1},
20654 {&__pyx_n_s_main, __pyx_k_main,
sizeof(__pyx_k_main), 0, 0, 1, 1},
20655 {&__pyx_n_s_memview, __pyx_k_memview,
sizeof(__pyx_k_memview), 0, 0, 1, 1},
20656 {&__pyx_n_s_mode, __pyx_k_mode,
sizeof(__pyx_k_mode), 0, 0, 1, 1},
20657 {&__pyx_n_s_nP, __pyx_k_nP,
sizeof(__pyx_k_nP), 0, 0, 1, 1},
20658 {&__pyx_n_s_nQ, __pyx_k_nQ,
sizeof(__pyx_k_nQ), 0, 0, 1, 1},
20659 {&__pyx_n_s_nSpace, __pyx_k_nSpace,
sizeof(__pyx_k_nSpace), 0, 0, 1, 1},
20660 {&__pyx_n_s_name, __pyx_k_name,
sizeof(__pyx_k_name), 0, 0, 1, 1},
20661 {&__pyx_n_s_name_2, __pyx_k_name_2,
sizeof(__pyx_k_name_2), 0, 0, 1, 1},
20662 {&__pyx_n_s_ndim, __pyx_k_ndim,
sizeof(__pyx_k_ndim), 0, 0, 1, 1},
20663 {&__pyx_n_s_new, __pyx_k_new,
sizeof(__pyx_k_new), 0, 0, 1, 1},
20664 {&__pyx_kp_s_no_default___reduce___due_to_non, __pyx_k_no_default___reduce___due_to_non,
sizeof(__pyx_k_no_default___reduce___due_to_non), 0, 0, 1, 0},
20665 {&__pyx_n_s_np, __pyx_k_np,
sizeof(__pyx_k_np), 0, 0, 1, 1},
20666 {&__pyx_n_s_numpy, __pyx_k_numpy,
sizeof(__pyx_k_numpy), 0, 0, 1, 1},
20667 {&__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},
20668 {&__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},
20669 {&__pyx_n_s_obj, __pyx_k_obj,
sizeof(__pyx_k_obj), 0, 0, 1, 1},
20670 {&__pyx_n_s_pack, __pyx_k_pack,
sizeof(__pyx_k_pack), 0, 0, 1, 1},
20671 {&__pyx_n_s_phi_dof, __pyx_k_phi_dof,
sizeof(__pyx_k_phi_dof), 0, 0, 1, 1},
20672 {&__pyx_n_s_phi_nodes, __pyx_k_phi_nodes,
sizeof(__pyx_k_phi_nodes), 0, 0, 1, 1},
20673 {&__pyx_n_s_pickle, __pyx_k_pickle,
sizeof(__pyx_k_pickle), 0, 0, 1, 1},
20674 {&__pyx_n_s_pyx_PickleError, __pyx_k_pyx_PickleError,
sizeof(__pyx_k_pyx_PickleError), 0, 0, 1, 1},
20675 {&__pyx_n_s_pyx_checksum, __pyx_k_pyx_checksum,
sizeof(__pyx_k_pyx_checksum), 0, 0, 1, 1},
20676 {&__pyx_n_s_pyx_getbuffer, __pyx_k_pyx_getbuffer,
sizeof(__pyx_k_pyx_getbuffer), 0, 0, 1, 1},
20677 {&__pyx_n_s_pyx_result, __pyx_k_pyx_result,
sizeof(__pyx_k_pyx_result), 0, 0, 1, 1},
20678 {&__pyx_n_s_pyx_state, __pyx_k_pyx_state,
sizeof(__pyx_k_pyx_state), 0, 0, 1, 1},
20679 {&__pyx_n_s_pyx_type, __pyx_k_pyx_type,
sizeof(__pyx_k_pyx_type), 0, 0, 1, 1},
20680 {&__pyx_n_s_pyx_unpickle_Enum, __pyx_k_pyx_unpickle_Enum,
sizeof(__pyx_k_pyx_unpickle_Enum), 0, 0, 1, 1},
20681 {&__pyx_n_s_pyx_vtable, __pyx_k_pyx_vtable,
sizeof(__pyx_k_pyx_vtable), 0, 0, 1, 1},
20682 {&__pyx_n_s_range, __pyx_k_range,
sizeof(__pyx_k_range), 0, 0, 1, 1},
20683 {&__pyx_n_s_reduce, __pyx_k_reduce,
sizeof(__pyx_k_reduce), 0, 0, 1, 1},
20684 {&__pyx_n_s_reduce_cython, __pyx_k_reduce_cython,
sizeof(__pyx_k_reduce_cython), 0, 0, 1, 1},
20685 {&__pyx_n_s_reduce_ex, __pyx_k_reduce_ex,
sizeof(__pyx_k_reduce_ex), 0, 0, 1, 1},
20686 {&__pyx_kp_u_s, __pyx_k_s,
sizeof(__pyx_k_s), 0, 1, 0, 0},
20687 {&__pyx_n_s_setstate, __pyx_k_setstate,
sizeof(__pyx_k_setstate), 0, 0, 1, 1},
20688 {&__pyx_n_s_setstate_cython, __pyx_k_setstate_cython,
sizeof(__pyx_k_setstate_cython), 0, 0, 1, 1},
20689 {&__pyx_n_s_shape, __pyx_k_shape,
sizeof(__pyx_k_shape), 0, 0, 1, 1},
20690 {&__pyx_n_s_size, __pyx_k_size,
sizeof(__pyx_k_size), 0, 0, 1, 1},
20691 {&__pyx_n_s_start, __pyx_k_start,
sizeof(__pyx_k_start), 0, 0, 1, 1},
20692 {&__pyx_n_s_step, __pyx_k_step,
sizeof(__pyx_k_step), 0, 0, 1, 1},
20693 {&__pyx_n_s_stop, __pyx_k_stop,
sizeof(__pyx_k_stop), 0, 0, 1, 1},
20694 {&__pyx_kp_s_strided_and_direct, __pyx_k_strided_and_direct,
sizeof(__pyx_k_strided_and_direct), 0, 0, 1, 0},
20695 {&__pyx_kp_s_strided_and_direct_or_indirect, __pyx_k_strided_and_direct_or_indirect,
sizeof(__pyx_k_strided_and_direct_or_indirect), 0, 0, 1, 0},
20696 {&__pyx_kp_s_strided_and_indirect, __pyx_k_strided_and_indirect,
sizeof(__pyx_k_strided_and_indirect), 0, 0, 1, 0},
20697 {&__pyx_kp_s_stringsource, __pyx_k_stringsource,
sizeof(__pyx_k_stringsource), 0, 0, 1, 0},
20698 {&__pyx_n_s_struct, __pyx_k_struct,
sizeof(__pyx_k_struct), 0, 0, 1, 1},
20699 {&__pyx_n_s_test, __pyx_k_test,
sizeof(__pyx_k_test), 0, 0, 1, 1},
20700 {&__pyx_kp_s_unable_to_allocate_array_data, __pyx_k_unable_to_allocate_array_data,
sizeof(__pyx_k_unable_to_allocate_array_data), 0, 0, 1, 0},
20701 {&__pyx_kp_s_unable_to_allocate_shape_and_str, __pyx_k_unable_to_allocate_shape_and_str,
sizeof(__pyx_k_unable_to_allocate_shape_and_str), 0, 0, 1, 0},
20702 {&__pyx_n_s_unpack, __pyx_k_unpack,
sizeof(__pyx_k_unpack), 0, 0, 1, 1},
20703 {&__pyx_n_s_update, __pyx_k_update,
sizeof(__pyx_k_update), 0, 0, 1, 1},
20704 {&__pyx_n_s_xi, __pyx_k_xi,
sizeof(__pyx_k_xi), 0, 0, 1, 1},
20705 {&__pyx_n_s_zeros, __pyx_k_zeros,
sizeof(__pyx_k_zeros), 0, 0, 1, 1},
20706 {0, 0, 0, 0, 0, 0, 0}
20708 static CYTHON_SMALL_CODE
int __Pyx_InitCachedBuiltins(
void) {
20709 __pyx_builtin_TypeError = __Pyx_GetBuiltinName(__pyx_n_s_TypeError);
if (!__pyx_builtin_TypeError) __PYX_ERR(0, 2, __pyx_L1_error)
20710 __pyx_builtin_ImportError = __Pyx_GetBuiltinName(__pyx_n_s_ImportError);
if (!__pyx_builtin_ImportError) __PYX_ERR(2, 945, __pyx_L1_error)
20711 __pyx_builtin_ValueError = __Pyx_GetBuiltinName(__pyx_n_s_ValueError);
if (!__pyx_builtin_ValueError) __PYX_ERR(0, 133, __pyx_L1_error)
20712 __pyx_builtin_MemoryError = __Pyx_GetBuiltinName(__pyx_n_s_MemoryError);
if (!__pyx_builtin_MemoryError) __PYX_ERR(0, 148, __pyx_L1_error)
20713 __pyx_builtin_enumerate = __Pyx_GetBuiltinName(__pyx_n_s_enumerate);
if (!__pyx_builtin_enumerate) __PYX_ERR(0, 151, __pyx_L1_error)
20714 __pyx_builtin_range = __Pyx_GetBuiltinName(__pyx_n_s_range);
if (!__pyx_builtin_range) __PYX_ERR(0, 180, __pyx_L1_error)
20715 __pyx_builtin_Ellipsis = __Pyx_GetBuiltinName(__pyx_n_s_Ellipsis);
if (!__pyx_builtin_Ellipsis) __PYX_ERR(0, 404, __pyx_L1_error)
20716 __pyx_builtin_id = __Pyx_GetBuiltinName(__pyx_n_s_id);
if (!__pyx_builtin_id) __PYX_ERR(0, 613, __pyx_L1_error)
20717 __pyx_builtin_IndexError = __Pyx_GetBuiltinName(__pyx_n_s_IndexError);
if (!__pyx_builtin_IndexError) __PYX_ERR(0, 832, __pyx_L1_error)
20723 static CYTHON_SMALL_CODE
int __Pyx_InitCachedConstants(
void) {
20724 __Pyx_RefNannyDeclarations
20725 __Pyx_RefNannySetupContext(
"__Pyx_InitCachedConstants", 0);
20734 __pyx_tuple_ = PyTuple_Pack(2, __pyx_int_50, __pyx_int_3);
if (unlikely(!__pyx_tuple_)) __PYX_ERR(1, 44, __pyx_L1_error)
20735 __Pyx_GOTREF(__pyx_tuple_);
20736 __Pyx_GIVEREF(__pyx_tuple_);
20737 __pyx_tuple__2 = PyTuple_Pack(2, __pyx_tuple_, __pyx_n_s_d);
if (unlikely(!__pyx_tuple__2)) __PYX_ERR(1, 44, __pyx_L1_error)
20738 __Pyx_GOTREF(__pyx_tuple__2);
20739 __Pyx_GIVEREF(__pyx_tuple__2);
20748 __pyx_tuple__3 = PyTuple_Pack(2, __pyx_int_1, __pyx_int_1);
if (unlikely(!__pyx_tuple__3)) __PYX_ERR(1, 52, __pyx_L1_error)
20749 __Pyx_GOTREF(__pyx_tuple__3);
20750 __Pyx_GIVEREF(__pyx_tuple__3);
20759 __pyx_tuple__4 = PyTuple_Pack(2, __pyx_int_1, __pyx_int_2);
if (unlikely(!__pyx_tuple__4)) __PYX_ERR(1, 58, __pyx_L1_error)
20760 __Pyx_GOTREF(__pyx_tuple__4);
20761 __Pyx_GIVEREF(__pyx_tuple__4);
20770 __pyx_tuple__5 = PyTuple_Pack(2, __pyx_int_1, __pyx_int_3);
if (unlikely(!__pyx_tuple__5)) __PYX_ERR(1, 64, __pyx_L1_error)
20771 __Pyx_GOTREF(__pyx_tuple__5);
20772 __Pyx_GIVEREF(__pyx_tuple__5);
20781 __pyx_tuple__6 = PyTuple_Pack(2, __pyx_int_2, __pyx_int_1);
if (unlikely(!__pyx_tuple__6)) __PYX_ERR(1, 70, __pyx_L1_error)
20782 __Pyx_GOTREF(__pyx_tuple__6);
20783 __Pyx_GIVEREF(__pyx_tuple__6);
20792 __pyx_tuple__7 = PyTuple_Pack(2, __pyx_int_2, __pyx_int_2);
if (unlikely(!__pyx_tuple__7)) __PYX_ERR(1, 76, __pyx_L1_error)
20793 __Pyx_GOTREF(__pyx_tuple__7);
20794 __Pyx_GIVEREF(__pyx_tuple__7);
20803 __pyx_tuple__8 = PyTuple_Pack(2, __pyx_int_2, __pyx_int_3);
if (unlikely(!__pyx_tuple__8)) __PYX_ERR(1, 82, __pyx_L1_error)
20804 __Pyx_GOTREF(__pyx_tuple__8);
20805 __Pyx_GIVEREF(__pyx_tuple__8);
20814 __pyx_tuple__9 = PyTuple_Pack(2, __pyx_int_3, __pyx_int_1);
if (unlikely(!__pyx_tuple__9)) __PYX_ERR(1, 88, __pyx_L1_error)
20815 __Pyx_GOTREF(__pyx_tuple__9);
20816 __Pyx_GIVEREF(__pyx_tuple__9);
20825 __pyx_tuple__10 = PyTuple_Pack(2, __pyx_int_3, __pyx_int_2);
if (unlikely(!__pyx_tuple__10)) __PYX_ERR(1, 94, __pyx_L1_error)
20826 __Pyx_GOTREF(__pyx_tuple__10);
20827 __Pyx_GIVEREF(__pyx_tuple__10);
20836 __pyx_tuple__11 = PyTuple_Pack(2, __pyx_int_3, __pyx_int_3);
if (unlikely(!__pyx_tuple__11)) __PYX_ERR(1, 100, __pyx_L1_error)
20837 __Pyx_GOTREF(__pyx_tuple__11);
20838 __Pyx_GIVEREF(__pyx_tuple__11);
20846 __pyx_tuple__12 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non);
if (unlikely(!__pyx_tuple__12)) __PYX_ERR(0, 2, __pyx_L1_error)
20847 __Pyx_GOTREF(__pyx_tuple__12);
20848 __Pyx_GIVEREF(__pyx_tuple__12);
20855 __pyx_tuple__13 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non);
if (unlikely(!__pyx_tuple__13)) __PYX_ERR(0, 4, __pyx_L1_error)
20856 __Pyx_GOTREF(__pyx_tuple__13);
20857 __Pyx_GIVEREF(__pyx_tuple__13);
20866 __pyx_tuple__14 = PyTuple_Pack(1, __pyx_kp_s_numpy_core_multiarray_failed_to);
if (unlikely(!__pyx_tuple__14)) __PYX_ERR(2, 945, __pyx_L1_error)
20867 __Pyx_GOTREF(__pyx_tuple__14);
20868 __Pyx_GIVEREF(__pyx_tuple__14);
20877 __pyx_tuple__15 = PyTuple_Pack(1, __pyx_kp_s_numpy_core_umath_failed_to_impor);
if (unlikely(!__pyx_tuple__15)) __PYX_ERR(2, 951, __pyx_L1_error)
20878 __Pyx_GOTREF(__pyx_tuple__15);
20879 __Pyx_GIVEREF(__pyx_tuple__15);
20888 __pyx_tuple__16 = PyTuple_Pack(1, __pyx_kp_s_Empty_shape_tuple_for_cython_arr);
if (unlikely(!__pyx_tuple__16)) __PYX_ERR(0, 133, __pyx_L1_error)
20889 __Pyx_GOTREF(__pyx_tuple__16);
20890 __Pyx_GIVEREF(__pyx_tuple__16);
20899 __pyx_tuple__17 = PyTuple_Pack(1, __pyx_kp_s_itemsize_0_for_cython_array);
if (unlikely(!__pyx_tuple__17)) __PYX_ERR(0, 136, __pyx_L1_error)
20900 __Pyx_GOTREF(__pyx_tuple__17);
20901 __Pyx_GIVEREF(__pyx_tuple__17);
20910 __pyx_tuple__18 = PyTuple_Pack(1, __pyx_kp_s_unable_to_allocate_shape_and_str);
if (unlikely(!__pyx_tuple__18)) __PYX_ERR(0, 148, __pyx_L1_error)
20911 __Pyx_GOTREF(__pyx_tuple__18);
20912 __Pyx_GIVEREF(__pyx_tuple__18);
20921 __pyx_tuple__19 = PyTuple_Pack(1, __pyx_kp_s_unable_to_allocate_array_data);
if (unlikely(!__pyx_tuple__19)) __PYX_ERR(0, 176, __pyx_L1_error)
20922 __Pyx_GOTREF(__pyx_tuple__19);
20923 __Pyx_GIVEREF(__pyx_tuple__19);
20932 __pyx_tuple__20 = PyTuple_Pack(1, __pyx_kp_s_Can_only_create_a_buffer_that_is);
if (unlikely(!__pyx_tuple__20)) __PYX_ERR(0, 192, __pyx_L1_error)
20933 __Pyx_GOTREF(__pyx_tuple__20);
20934 __Pyx_GIVEREF(__pyx_tuple__20);
20942 __pyx_tuple__21 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non);
if (unlikely(!__pyx_tuple__21)) __PYX_ERR(0, 2, __pyx_L1_error)
20943 __Pyx_GOTREF(__pyx_tuple__21);
20944 __Pyx_GIVEREF(__pyx_tuple__21);
20951 __pyx_tuple__22 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non);
if (unlikely(!__pyx_tuple__22)) __PYX_ERR(0, 4, __pyx_L1_error)
20952 __Pyx_GOTREF(__pyx_tuple__22);
20953 __Pyx_GIVEREF(__pyx_tuple__22);
20962 __pyx_tuple__23 = PyTuple_Pack(1, __pyx_kp_s_Cannot_assign_to_read_only_memor);
if (unlikely(!__pyx_tuple__23)) __PYX_ERR(0, 418, __pyx_L1_error)
20963 __Pyx_GOTREF(__pyx_tuple__23);
20964 __Pyx_GIVEREF(__pyx_tuple__23);
20973 __pyx_tuple__24 = PyTuple_Pack(1, __pyx_kp_s_Unable_to_convert_item_to_object);
if (unlikely(!__pyx_tuple__24)) __PYX_ERR(0, 495, __pyx_L1_error)
20974 __Pyx_GOTREF(__pyx_tuple__24);
20975 __Pyx_GIVEREF(__pyx_tuple__24);
20984 __pyx_tuple__25 = PyTuple_Pack(1, __pyx_kp_s_Cannot_create_writable_memory_vi);
if (unlikely(!__pyx_tuple__25)) __PYX_ERR(0, 520, __pyx_L1_error)
20985 __Pyx_GOTREF(__pyx_tuple__25);
20986 __Pyx_GIVEREF(__pyx_tuple__25);
20995 __pyx_tuple__26 = PyTuple_Pack(1, __pyx_kp_s_Buffer_view_does_not_expose_stri);
if (unlikely(!__pyx_tuple__26)) __PYX_ERR(0, 570, __pyx_L1_error)
20996 __Pyx_GOTREF(__pyx_tuple__26);
20997 __Pyx_GIVEREF(__pyx_tuple__26);
21006 __pyx_tuple__27 = PyTuple_New(1);
if (unlikely(!__pyx_tuple__27)) __PYX_ERR(0, 577, __pyx_L1_error)
21007 __Pyx_GOTREF(__pyx_tuple__27);
21008 __Pyx_INCREF(__pyx_int_neg_1);
21009 __Pyx_GIVEREF(__pyx_int_neg_1);
21010 PyTuple_SET_ITEM(__pyx_tuple__27, 0, __pyx_int_neg_1);
21011 __Pyx_GIVEREF(__pyx_tuple__27);
21019 __pyx_tuple__28 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non);
if (unlikely(!__pyx_tuple__28)) __PYX_ERR(0, 2, __pyx_L1_error)
21020 __Pyx_GOTREF(__pyx_tuple__28);
21021 __Pyx_GIVEREF(__pyx_tuple__28);
21028 __pyx_tuple__29 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non);
if (unlikely(!__pyx_tuple__29)) __PYX_ERR(0, 4, __pyx_L1_error)
21029 __Pyx_GOTREF(__pyx_tuple__29);
21030 __Pyx_GIVEREF(__pyx_tuple__29);
21039 __pyx_slice__30 = PySlice_New(Py_None, Py_None, Py_None);
if (unlikely(!__pyx_slice__30)) __PYX_ERR(0, 682, __pyx_L1_error)
21040 __Pyx_GOTREF(__pyx_slice__30);
21041 __Pyx_GIVEREF(__pyx_slice__30);
21050 __pyx_tuple__31 = PyTuple_Pack(1, __pyx_kp_s_Indirect_dimensions_not_supporte);
if (unlikely(!__pyx_tuple__31)) __PYX_ERR(0, 703, __pyx_L1_error)
21051 __Pyx_GOTREF(__pyx_tuple__31);
21052 __Pyx_GIVEREF(__pyx_tuple__31);
21060 __pyx_tuple__32 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non);
if (unlikely(!__pyx_tuple__32)) __PYX_ERR(0, 2, __pyx_L1_error)
21061 __Pyx_GOTREF(__pyx_tuple__32);
21062 __Pyx_GIVEREF(__pyx_tuple__32);
21069 __pyx_tuple__33 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non);
if (unlikely(!__pyx_tuple__33)) __PYX_ERR(0, 4, __pyx_L1_error)
21070 __Pyx_GOTREF(__pyx_tuple__33);
21071 __Pyx_GIVEREF(__pyx_tuple__33);
21072 __pyx_tuple__34 = PyTuple_Pack(3, __pyx_int_184977713, __pyx_int_136983863, __pyx_int_112105877);
if (unlikely(!__pyx_tuple__34)) __PYX_ERR(0, 4, __pyx_L1_error)
21073 __Pyx_GOTREF(__pyx_tuple__34);
21074 __Pyx_GIVEREF(__pyx_tuple__34);
21083 __pyx_tuple__40 = PyTuple_Pack(1, __pyx_kp_s_strided_and_direct_or_indirect);
if (unlikely(!__pyx_tuple__40)) __PYX_ERR(0, 286, __pyx_L1_error)
21084 __Pyx_GOTREF(__pyx_tuple__40);
21085 __Pyx_GIVEREF(__pyx_tuple__40);
21094 __pyx_tuple__41 = PyTuple_Pack(1, __pyx_kp_s_strided_and_direct);
if (unlikely(!__pyx_tuple__41)) __PYX_ERR(0, 287, __pyx_L1_error)
21095 __Pyx_GOTREF(__pyx_tuple__41);
21096 __Pyx_GIVEREF(__pyx_tuple__41);
21105 __pyx_tuple__42 = PyTuple_Pack(1, __pyx_kp_s_strided_and_indirect);
if (unlikely(!__pyx_tuple__42)) __PYX_ERR(0, 288, __pyx_L1_error)
21106 __Pyx_GOTREF(__pyx_tuple__42);
21107 __Pyx_GIVEREF(__pyx_tuple__42);
21116 __pyx_tuple__43 = PyTuple_Pack(1, __pyx_kp_s_contiguous_and_direct);
if (unlikely(!__pyx_tuple__43)) __PYX_ERR(0, 291, __pyx_L1_error)
21117 __Pyx_GOTREF(__pyx_tuple__43);
21118 __Pyx_GIVEREF(__pyx_tuple__43);
21127 __pyx_tuple__44 = PyTuple_Pack(1, __pyx_kp_s_contiguous_and_indirect);
if (unlikely(!__pyx_tuple__44)) __PYX_ERR(0, 292, __pyx_L1_error)
21128 __Pyx_GOTREF(__pyx_tuple__44);
21129 __Pyx_GIVEREF(__pyx_tuple__44);
21136 __pyx_tuple__45 = PyTuple_Pack(5, __pyx_n_s_pyx_type, __pyx_n_s_pyx_checksum, __pyx_n_s_pyx_state, __pyx_n_s_pyx_PickleError, __pyx_n_s_pyx_result);
if (unlikely(!__pyx_tuple__45)) __PYX_ERR(0, 1, __pyx_L1_error)
21137 __Pyx_GOTREF(__pyx_tuple__45);
21138 __Pyx_GIVEREF(__pyx_tuple__45);
21139 __pyx_codeobj__46 = (PyObject*)__Pyx_PyCode_New(3, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__45, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_pyx_unpickle_Enum, 1, __pyx_empty_bytes);
if (unlikely(!__pyx_codeobj__46)) __PYX_ERR(0, 1, __pyx_L1_error)
21140 __Pyx_RefNannyFinishContext();
21143 __Pyx_RefNannyFinishContext();
21147 static CYTHON_SMALL_CODE
int __Pyx_InitGlobals(
void) {
21148 if (__Pyx_InitStrings(__pyx_string_tab) < 0) __PYX_ERR(1, 1, __pyx_L1_error);
21149 __pyx_int_0 = PyInt_FromLong(0);
if (unlikely(!__pyx_int_0)) __PYX_ERR(1, 1, __pyx_L1_error)
21150 __pyx_int_1 = PyInt_FromLong(1);
if (unlikely(!__pyx_int_1)) __PYX_ERR(1, 1, __pyx_L1_error)
21151 __pyx_int_2 = PyInt_FromLong(2);
if (unlikely(!__pyx_int_2)) __PYX_ERR(1, 1, __pyx_L1_error)
21152 __pyx_int_3 = PyInt_FromLong(3);
if (unlikely(!__pyx_int_3)) __PYX_ERR(1, 1, __pyx_L1_error)
21153 __pyx_int_50 = PyInt_FromLong(50);
if (unlikely(!__pyx_int_50)) __PYX_ERR(1, 1, __pyx_L1_error)
21154 __pyx_int_112105877 = PyInt_FromLong(112105877
L);
if (unlikely(!__pyx_int_112105877)) __PYX_ERR(1, 1, __pyx_L1_error)
21155 __pyx_int_136983863 = PyInt_FromLong(136983863
L);
if (unlikely(!__pyx_int_136983863)) __PYX_ERR(1, 1, __pyx_L1_error)
21156 __pyx_int_184977713 = PyInt_FromLong(184977713
L);
if (unlikely(!__pyx_int_184977713)) __PYX_ERR(1, 1, __pyx_L1_error)
21157 __pyx_int_neg_1 = PyInt_FromLong(-1);
if (unlikely(!__pyx_int_neg_1)) __PYX_ERR(1, 1, __pyx_L1_error)
21163 static CYTHON_SMALL_CODE
int __Pyx_modinit_global_init_code(
void);
21164 static CYTHON_SMALL_CODE
int __Pyx_modinit_variable_export_code(
void);
21165 static CYTHON_SMALL_CODE
int __Pyx_modinit_function_export_code(
void);
21166 static CYTHON_SMALL_CODE
int __Pyx_modinit_type_init_code(
void);
21167 static CYTHON_SMALL_CODE
int __Pyx_modinit_type_import_code(
void);
21168 static CYTHON_SMALL_CODE
int __Pyx_modinit_variable_import_code(
void);
21169 static CYTHON_SMALL_CODE
int __Pyx_modinit_function_import_code(
void);
21171 static int __Pyx_modinit_global_init_code(
void) {
21172 __Pyx_RefNannyDeclarations
21173 __Pyx_RefNannySetupContext(
"__Pyx_modinit_global_init_code", 0);
21175 generic = Py_None; Py_INCREF(Py_None);
21176 strided = Py_None; Py_INCREF(Py_None);
21177 indirect = Py_None; Py_INCREF(Py_None);
21178 contiguous = Py_None; Py_INCREF(Py_None);
21179 indirect_contiguous = Py_None; Py_INCREF(Py_None);
21180 __Pyx_RefNannyFinishContext();
21184 static int __Pyx_modinit_variable_export_code(
void) {
21185 __Pyx_RefNannyDeclarations
21186 __Pyx_RefNannySetupContext(
"__Pyx_modinit_variable_export_code", 0);
21188 __Pyx_RefNannyFinishContext();
21192 static int __Pyx_modinit_function_export_code(
void) {
21193 __Pyx_RefNannyDeclarations
21194 __Pyx_RefNannySetupContext(
"__Pyx_modinit_function_export_code", 0);
21196 __Pyx_RefNannyFinishContext();
21200 static int __Pyx_modinit_type_init_code(
void) {
21201 __Pyx_RefNannyDeclarations
21202 int __pyx_lineno = 0;
21203 const char *__pyx_filename = NULL;
21204 int __pyx_clineno = 0;
21205 __Pyx_RefNannySetupContext(
"__Pyx_modinit_type_init_code", 0);
21207 if (PyType_Ready(&__pyx_type_22equivalent_polynomials_Simplex) < 0) __PYX_ERR(1, 22, __pyx_L1_error)
21208 #if PY_VERSION_HEX < 0x030800B1
21209 __pyx_type_22equivalent_polynomials_Simplex.tp_print = 0;
21211 if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_22equivalent_polynomials_Simplex.tp_dictoffset && __pyx_type_22equivalent_polynomials_Simplex.tp_getattro == PyObject_GenericGetAttr)) {
21212 __pyx_type_22equivalent_polynomials_Simplex.tp_getattro = __Pyx_PyObject_GenericGetAttr;
21214 if (PyObject_SetAttr(__pyx_m, __pyx_n_s_Simplex, (PyObject *)&__pyx_type_22equivalent_polynomials_Simplex) < 0) __PYX_ERR(1, 22, __pyx_L1_error)
21215 if (__Pyx_setup_reduce((PyObject*)&__pyx_type_22equivalent_polynomials_Simplex) < 0) __PYX_ERR(1, 22, __pyx_L1_error)
21216 __pyx_ptype_22equivalent_polynomials_Simplex = &__pyx_type_22equivalent_polynomials_Simplex;
21217 __pyx_vtabptr_array = &__pyx_vtable_array;
21218 __pyx_vtable_array.get_memview = (PyObject *(*)(
struct __pyx_array_obj *))__pyx_array_get_memview;
21219 if (PyType_Ready(&__pyx_type___pyx_array) < 0) __PYX_ERR(0, 105, __pyx_L1_error)
21220 #if PY_VERSION_HEX < 0x030800B1
21221 __pyx_type___pyx_array.tp_print = 0;
21223 if (__Pyx_SetVtable(__pyx_type___pyx_array.tp_dict, __pyx_vtabptr_array) < 0) __PYX_ERR(0, 105, __pyx_L1_error)
21224 if (__Pyx_setup_reduce((PyObject*)&__pyx_type___pyx_array) < 0) __PYX_ERR(0, 105, __pyx_L1_error)
21225 __pyx_array_type = &__pyx_type___pyx_array;
21226 if (PyType_Ready(&__pyx_type___pyx_MemviewEnum) < 0) __PYX_ERR(0, 279, __pyx_L1_error)
21227 #if PY_VERSION_HEX < 0x030800B1
21228 __pyx_type___pyx_MemviewEnum.tp_print = 0;
21230 if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type___pyx_MemviewEnum.tp_dictoffset && __pyx_type___pyx_MemviewEnum.tp_getattro == PyObject_GenericGetAttr)) {
21231 __pyx_type___pyx_MemviewEnum.tp_getattro = __Pyx_PyObject_GenericGetAttr;
21233 if (__Pyx_setup_reduce((PyObject*)&__pyx_type___pyx_MemviewEnum) < 0) __PYX_ERR(0, 279, __pyx_L1_error)
21234 __pyx_MemviewEnum_type = &__pyx_type___pyx_MemviewEnum;
21235 __pyx_vtabptr_memoryview = &__pyx_vtable_memoryview;
21236 __pyx_vtable_memoryview.get_item_pointer = (
char *(*)(
struct __pyx_memoryview_obj *, PyObject *))__pyx_memoryview_get_item_pointer;
21237 __pyx_vtable_memoryview.is_slice = (PyObject *(*)(
struct __pyx_memoryview_obj *, PyObject *))__pyx_memoryview_is_slice;
21238 __pyx_vtable_memoryview.setitem_slice_assignment = (PyObject *(*)(
struct __pyx_memoryview_obj *, PyObject *, PyObject *))__pyx_memoryview_setitem_slice_assignment;
21239 __pyx_vtable_memoryview.setitem_slice_assign_scalar = (PyObject *(*)(
struct __pyx_memoryview_obj *,
struct __pyx_memoryview_obj *, PyObject *))__pyx_memoryview_setitem_slice_assign_scalar;
21240 __pyx_vtable_memoryview.setitem_indexed = (PyObject *(*)(
struct __pyx_memoryview_obj *, PyObject *, PyObject *))__pyx_memoryview_setitem_indexed;
21241 __pyx_vtable_memoryview.convert_item_to_object = (PyObject *(*)(
struct __pyx_memoryview_obj *,
char *))__pyx_memoryview_convert_item_to_object;
21242 __pyx_vtable_memoryview.assign_item_from_object = (PyObject *(*)(
struct __pyx_memoryview_obj *,
char *, PyObject *))__pyx_memoryview_assign_item_from_object;
21243 if (PyType_Ready(&__pyx_type___pyx_memoryview) < 0) __PYX_ERR(0, 330, __pyx_L1_error)
21244 #if PY_VERSION_HEX < 0x030800B1
21245 __pyx_type___pyx_memoryview.tp_print = 0;
21247 if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type___pyx_memoryview.tp_dictoffset && __pyx_type___pyx_memoryview.tp_getattro == PyObject_GenericGetAttr)) {
21248 __pyx_type___pyx_memoryview.tp_getattro = __Pyx_PyObject_GenericGetAttr;
21250 if (__Pyx_SetVtable(__pyx_type___pyx_memoryview.tp_dict, __pyx_vtabptr_memoryview) < 0) __PYX_ERR(0, 330, __pyx_L1_error)
21251 if (__Pyx_setup_reduce((PyObject*)&__pyx_type___pyx_memoryview) < 0) __PYX_ERR(0, 330, __pyx_L1_error)
21252 __pyx_memoryview_type = &__pyx_type___pyx_memoryview;
21253 __pyx_vtabptr__memoryviewslice = &__pyx_vtable__memoryviewslice;
21254 __pyx_vtable__memoryviewslice.__pyx_base = *__pyx_vtabptr_memoryview;
21255 __pyx_vtable__memoryviewslice.__pyx_base.convert_item_to_object = (PyObject *(*)(
struct __pyx_memoryview_obj *,
char *))__pyx_memoryviewslice_convert_item_to_object;
21256 __pyx_vtable__memoryviewslice.__pyx_base.assign_item_from_object = (PyObject *(*)(
struct __pyx_memoryview_obj *,
char *, PyObject *))__pyx_memoryviewslice_assign_item_from_object;
21257 __pyx_type___pyx_memoryviewslice.tp_base = __pyx_memoryview_type;
21258 if (PyType_Ready(&__pyx_type___pyx_memoryviewslice) < 0) __PYX_ERR(0, 965, __pyx_L1_error)
21259 #if PY_VERSION_HEX < 0x030800B1
21260 __pyx_type___pyx_memoryviewslice.tp_print = 0;
21262 if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type___pyx_memoryviewslice.tp_dictoffset && __pyx_type___pyx_memoryviewslice.tp_getattro == PyObject_GenericGetAttr)) {
21263 __pyx_type___pyx_memoryviewslice.tp_getattro = __Pyx_PyObject_GenericGetAttr;
21265 if (__Pyx_SetVtable(__pyx_type___pyx_memoryviewslice.tp_dict, __pyx_vtabptr__memoryviewslice) < 0) __PYX_ERR(0, 965, __pyx_L1_error)
21266 if (__Pyx_setup_reduce((PyObject*)&__pyx_type___pyx_memoryviewslice) < 0) __PYX_ERR(0, 965, __pyx_L1_error)
21267 __pyx_memoryviewslice_type = &__pyx_type___pyx_memoryviewslice;
21268 __Pyx_RefNannyFinishContext();
21271 __Pyx_RefNannyFinishContext();
21275 static int __Pyx_modinit_type_import_code(
void) {
21276 __Pyx_RefNannyDeclarations
21277 PyObject *__pyx_t_1 = NULL;
21278 int __pyx_lineno = 0;
21279 const char *__pyx_filename = NULL;
21280 int __pyx_clineno = 0;
21281 __Pyx_RefNannySetupContext(
"__Pyx_modinit_type_import_code", 0);
21283 __pyx_t_1 = PyImport_ImportModule(__Pyx_BUILTIN_MODULE_NAME);
if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 9, __pyx_L1_error)
21284 __Pyx_GOTREF(__pyx_t_1);
21285 __pyx_ptype_7cpython_4type_type = __Pyx_ImportType(__pyx_t_1, __Pyx_BUILTIN_MODULE_NAME,
"type",
21286 #
if defined(PYPY_VERSION_NUM) && PYPY_VERSION_NUM < 0x050B0000
21287 sizeof(PyTypeObject),
21289 sizeof(PyHeapTypeObject),
21291 __Pyx_ImportType_CheckSize_Warn);
21292 if (!__pyx_ptype_7cpython_4type_type) __PYX_ERR(3, 9, __pyx_L1_error)
21293 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
21294 __pyx_t_1 = PyImport_ImportModule(
"numpy");
if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 200, __pyx_L1_error)
21295 __Pyx_GOTREF(__pyx_t_1);
21296 __pyx_ptype_5numpy_dtype = __Pyx_ImportType(__pyx_t_1,
"numpy",
"dtype",
sizeof(PyArray_Descr), __Pyx_ImportType_CheckSize_Ignore);
21297 if (!__pyx_ptype_5numpy_dtype) __PYX_ERR(2, 200, __pyx_L1_error)
21298 __pyx_ptype_5numpy_flatiter = __Pyx_ImportType(__pyx_t_1,
"numpy",
"flatiter",
sizeof(PyArrayIterObject), __Pyx_ImportType_CheckSize_Ignore);
21299 if (!__pyx_ptype_5numpy_flatiter) __PYX_ERR(2, 223, __pyx_L1_error)
21300 __pyx_ptype_5numpy_broadcast = __Pyx_ImportType(__pyx_t_1,
"numpy",
"broadcast",
sizeof(PyArrayMultiIterObject), __Pyx_ImportType_CheckSize_Ignore);
21301 if (!__pyx_ptype_5numpy_broadcast) __PYX_ERR(2, 227, __pyx_L1_error)
21302 __pyx_ptype_5numpy_ndarray = __Pyx_ImportType(__pyx_t_1,
"numpy",
"ndarray",
sizeof(PyArrayObject), __Pyx_ImportType_CheckSize_Ignore);
21303 if (!__pyx_ptype_5numpy_ndarray) __PYX_ERR(2, 239, __pyx_L1_error)
21304 __pyx_ptype_5numpy_generic = __Pyx_ImportType(__pyx_t_1,
"numpy",
"generic",
sizeof(PyObject), __Pyx_ImportType_CheckSize_Warn);
21305 if (!__pyx_ptype_5numpy_generic) __PYX_ERR(2, 771, __pyx_L1_error)
21306 __pyx_ptype_5numpy_number = __Pyx_ImportType(__pyx_t_1,
"numpy",
"number",
sizeof(PyObject), __Pyx_ImportType_CheckSize_Warn);
21307 if (!__pyx_ptype_5numpy_number) __PYX_ERR(2, 773, __pyx_L1_error)
21308 __pyx_ptype_5numpy_integer = __Pyx_ImportType(__pyx_t_1,
"numpy",
"integer",
sizeof(PyObject), __Pyx_ImportType_CheckSize_Warn);
21309 if (!__pyx_ptype_5numpy_integer) __PYX_ERR(2, 775, __pyx_L1_error)
21310 __pyx_ptype_5numpy_signedinteger = __Pyx_ImportType(__pyx_t_1,
"numpy",
"signedinteger",
sizeof(PyObject), __Pyx_ImportType_CheckSize_Warn);
21311 if (!__pyx_ptype_5numpy_signedinteger) __PYX_ERR(2, 777, __pyx_L1_error)
21312 __pyx_ptype_5numpy_unsignedinteger = __Pyx_ImportType(__pyx_t_1,
"numpy",
"unsignedinteger",
sizeof(PyObject), __Pyx_ImportType_CheckSize_Warn);
21313 if (!__pyx_ptype_5numpy_unsignedinteger) __PYX_ERR(2, 779, __pyx_L1_error)
21314 __pyx_ptype_5numpy_inexact = __Pyx_ImportType(__pyx_t_1,
"numpy",
"inexact",
sizeof(PyObject), __Pyx_ImportType_CheckSize_Warn);
21315 if (!__pyx_ptype_5numpy_inexact) __PYX_ERR(2, 781, __pyx_L1_error)
21316 __pyx_ptype_5numpy_floating = __Pyx_ImportType(__pyx_t_1,
"numpy",
"floating",
sizeof(PyObject), __Pyx_ImportType_CheckSize_Warn);
21317 if (!__pyx_ptype_5numpy_floating) __PYX_ERR(2, 783, __pyx_L1_error)
21318 __pyx_ptype_5numpy_complexfloating = __Pyx_ImportType(__pyx_t_1,
"numpy",
"complexfloating",
sizeof(PyObject), __Pyx_ImportType_CheckSize_Warn);
21319 if (!__pyx_ptype_5numpy_complexfloating) __PYX_ERR(2, 785, __pyx_L1_error)
21320 __pyx_ptype_5numpy_flexible = __Pyx_ImportType(__pyx_t_1,
"numpy",
"flexible",
sizeof(PyObject), __Pyx_ImportType_CheckSize_Warn);
21321 if (!__pyx_ptype_5numpy_flexible) __PYX_ERR(2, 787, __pyx_L1_error)
21322 __pyx_ptype_5numpy_character = __Pyx_ImportType(__pyx_t_1,
"numpy",
"character",
sizeof(PyObject), __Pyx_ImportType_CheckSize_Warn);
21323 if (!__pyx_ptype_5numpy_character) __PYX_ERR(2, 789, __pyx_L1_error)
21324 __pyx_ptype_5numpy_ufunc = __Pyx_ImportType(__pyx_t_1,
"numpy",
"ufunc",
sizeof(PyUFuncObject), __Pyx_ImportType_CheckSize_Ignore);
21325 if (!__pyx_ptype_5numpy_ufunc) __PYX_ERR(2, 827, __pyx_L1_error)
21326 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
21327 __Pyx_RefNannyFinishContext();
21330 __Pyx_XDECREF(__pyx_t_1);
21331 __Pyx_RefNannyFinishContext();
21335 static int __Pyx_modinit_variable_import_code(
void) {
21336 __Pyx_RefNannyDeclarations
21337 __Pyx_RefNannySetupContext(
"__Pyx_modinit_variable_import_code", 0);
21339 __Pyx_RefNannyFinishContext();
21343 static int __Pyx_modinit_function_import_code(
void) {
21344 __Pyx_RefNannyDeclarations
21345 __Pyx_RefNannySetupContext(
"__Pyx_modinit_function_import_code", 0);
21347 __Pyx_RefNannyFinishContext();
21352 #ifndef CYTHON_NO_PYINIT_EXPORT
21353 #define __Pyx_PyMODINIT_FUNC PyMODINIT_FUNC
21354 #elif PY_MAJOR_VERSION < 3
21356 #define __Pyx_PyMODINIT_FUNC extern "C" void
21358 #define __Pyx_PyMODINIT_FUNC void
21362 #define __Pyx_PyMODINIT_FUNC extern "C" PyObject *
21364 #define __Pyx_PyMODINIT_FUNC PyObject *
21369 #if PY_MAJOR_VERSION < 3
21370 __Pyx_PyMODINIT_FUNC initequivalent_polynomials(
void) CYTHON_SMALL_CODE;
21371 __Pyx_PyMODINIT_FUNC initequivalent_polynomials(
void)
21373 __Pyx_PyMODINIT_FUNC PyInit_equivalent_polynomials(
void) CYTHON_SMALL_CODE;
21374 __Pyx_PyMODINIT_FUNC PyInit_equivalent_polynomials(
void)
21375 #if CYTHON_PEP489_MULTI_PHASE_INIT
21377 return PyModuleDef_Init(&__pyx_moduledef);
21379 static CYTHON_SMALL_CODE
int __Pyx_check_single_interpreter(
void) {
21380 #if PY_VERSION_HEX >= 0x030700A1
21381 static PY_INT64_T main_interpreter_id = -1;
21382 PY_INT64_T current_id = PyInterpreterState_GetID(PyThreadState_Get()->interp);
21383 if (main_interpreter_id == -1) {
21384 main_interpreter_id = current_id;
21385 return (unlikely(current_id == -1)) ? -1 : 0;
21386 }
else if (unlikely(main_interpreter_id != current_id))
21388 static PyInterpreterState *main_interpreter = NULL;
21389 PyInterpreterState *current_interpreter = PyThreadState_Get()->interp;
21390 if (!main_interpreter) {
21391 main_interpreter = current_interpreter;
21392 }
else if (unlikely(main_interpreter != current_interpreter))
21397 "Interpreter change detected - this module can only be loaded into one interpreter per process.");
21402 static CYTHON_SMALL_CODE
int __Pyx_copy_spec_to_module(PyObject *spec, PyObject *moddict,
const char* from_name,
const char* to_name,
int allow_none) {
21403 PyObject *value = PyObject_GetAttrString(spec, from_name);
21405 if (likely(value)) {
21406 if (allow_none || value != Py_None) {
21407 result = PyDict_SetItemString(moddict, to_name, value);
21410 }
else if (PyErr_ExceptionMatches(PyExc_AttributeError)) {
21417 static CYTHON_SMALL_CODE PyObject* __pyx_pymod_create(PyObject *spec, CYTHON_UNUSED PyModuleDef *def) {
21418 PyObject *module = NULL, *moddict, *modname;
21419 if (__Pyx_check_single_interpreter())
21422 return __Pyx_NewRef(__pyx_m);
21423 modname = PyObject_GetAttrString(spec,
"name");
21424 if (unlikely(!modname))
goto bad;
21425 module = PyModule_NewObject(modname);
21426 Py_DECREF(modname);
21427 if (unlikely(!module))
goto bad;
21428 moddict = PyModule_GetDict(module);
21429 if (unlikely(!moddict))
goto bad;
21430 if (unlikely(__Pyx_copy_spec_to_module(spec, moddict,
"loader",
"__loader__", 1) < 0))
goto bad;
21431 if (unlikely(__Pyx_copy_spec_to_module(spec, moddict,
"origin",
"__file__", 1) < 0))
goto bad;
21432 if (unlikely(__Pyx_copy_spec_to_module(spec, moddict,
"parent",
"__package__", 1) < 0))
goto bad;
21433 if (unlikely(__Pyx_copy_spec_to_module(spec, moddict,
"submodule_search_locations",
"__path__", 0) < 0))
goto bad;
21436 Py_XDECREF(module);
21441 static CYTHON_SMALL_CODE
int __pyx_pymod_exec_equivalent_polynomials(PyObject *__pyx_pyinit_module)
21445 PyObject *__pyx_t_1 = NULL;
21446 static PyThread_type_lock __pyx_t_2[8];
21447 int __pyx_lineno = 0;
21448 const char *__pyx_filename = NULL;
21449 int __pyx_clineno = 0;
21450 __Pyx_RefNannyDeclarations
21451 #if CYTHON_PEP489_MULTI_PHASE_INIT
21453 if (__pyx_m == __pyx_pyinit_module)
return 0;
21454 PyErr_SetString(PyExc_RuntimeError,
"Module 'equivalent_polynomials' has already been imported. Re-initialisation is not supported.");
21457 #elif PY_MAJOR_VERSION >= 3
21458 if (__pyx_m)
return __Pyx_NewRef(__pyx_m);
21460 #if CYTHON_REFNANNY
21461 __Pyx_RefNanny = __Pyx_RefNannyImportAPI(
"refnanny");
21462 if (!__Pyx_RefNanny) {
21464 __Pyx_RefNanny = __Pyx_RefNannyImportAPI(
"Cython.Runtime.refnanny");
21465 if (!__Pyx_RefNanny)
21466 Py_FatalError(
"failed to import 'refnanny' module");
21469 __Pyx_RefNannySetupContext(
"__Pyx_PyMODINIT_FUNC PyInit_equivalent_polynomials(void)", 0);
21470 if (__Pyx_check_binary_version() < 0) __PYX_ERR(1, 1, __pyx_L1_error)
21471 #ifdef __Pxy_PyFrame_Initialize_Offsets
21472 __Pxy_PyFrame_Initialize_Offsets();
21474 __pyx_empty_tuple = PyTuple_New(0);
if (unlikely(!__pyx_empty_tuple)) __PYX_ERR(1, 1, __pyx_L1_error)
21475 __pyx_empty_bytes = PyBytes_FromStringAndSize(
"", 0);
if (unlikely(!__pyx_empty_bytes)) __PYX_ERR(1, 1, __pyx_L1_error)
21476 __pyx_empty_unicode = PyUnicode_FromStringAndSize(
"", 0);
if (unlikely(!__pyx_empty_unicode)) __PYX_ERR(1, 1, __pyx_L1_error)
21477 #ifdef __Pyx_CyFunction_USED
21478 if (__pyx_CyFunction_init() < 0) __PYX_ERR(1, 1, __pyx_L1_error)
21480 #ifdef __Pyx_FusedFunction_USED
21481 if (__pyx_FusedFunction_init() < 0) __PYX_ERR(1, 1, __pyx_L1_error)
21483 #ifdef __Pyx_Coroutine_USED
21484 if (__pyx_Coroutine_init() < 0) __PYX_ERR(1, 1, __pyx_L1_error)
21486 #ifdef __Pyx_Generator_USED
21487 if (__pyx_Generator_init() < 0) __PYX_ERR(1, 1, __pyx_L1_error)
21489 #ifdef __Pyx_AsyncGen_USED
21490 if (__pyx_AsyncGen_init() < 0) __PYX_ERR(1, 1, __pyx_L1_error)
21492 #ifdef __Pyx_StopAsyncIteration_USED
21493 if (__pyx_StopAsyncIteration_init() < 0) __PYX_ERR(1, 1, __pyx_L1_error)
21497 #if defined(WITH_THREAD) && PY_VERSION_HEX < 0x030700F0 && defined(__PYX_FORCE_INIT_THREADS) && __PYX_FORCE_INIT_THREADS
21498 PyEval_InitThreads();
21501 #if CYTHON_PEP489_MULTI_PHASE_INIT
21502 __pyx_m = __pyx_pyinit_module;
21503 Py_INCREF(__pyx_m);
21505 #if PY_MAJOR_VERSION < 3
21506 __pyx_m = Py_InitModule4(
"equivalent_polynomials", __pyx_methods, 0, 0, PYTHON_API_VERSION); Py_XINCREF(__pyx_m);
21508 __pyx_m = PyModule_Create(&__pyx_moduledef);
21510 if (unlikely(!__pyx_m)) __PYX_ERR(1, 1, __pyx_L1_error)
21512 __pyx_d = PyModule_GetDict(__pyx_m);
if (unlikely(!__pyx_d)) __PYX_ERR(1, 1, __pyx_L1_error)
21513 Py_INCREF(__pyx_d);
21514 __pyx_b = PyImport_AddModule(__Pyx_BUILTIN_MODULE_NAME);
if (unlikely(!__pyx_b)) __PYX_ERR(1, 1, __pyx_L1_error)
21515 Py_INCREF(__pyx_b);
21516 __pyx_cython_runtime = PyImport_AddModule((
char *)
"cython_runtime");
if (unlikely(!__pyx_cython_runtime)) __PYX_ERR(1, 1, __pyx_L1_error)
21517 Py_INCREF(__pyx_cython_runtime);
21518 if (PyObject_SetAttrString(__pyx_m,
"__builtins__", __pyx_b) < 0) __PYX_ERR(1, 1, __pyx_L1_error);
21520 if (__Pyx_InitGlobals() < 0) __PYX_ERR(1, 1, __pyx_L1_error)
21521 #if PY_MAJOR_VERSION < 3 && (__PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT)
21522 if (__Pyx_init_sys_getdefaultencoding_params() < 0) __PYX_ERR(1, 1, __pyx_L1_error)
21524 if (__pyx_module_is_main_equivalent_polynomials) {
21525 if (PyObject_SetAttr(__pyx_m, __pyx_n_s_name_2, __pyx_n_s_main) < 0) __PYX_ERR(1, 1, __pyx_L1_error)
21527 #if PY_MAJOR_VERSION >= 3
21529 PyObject *modules = PyImport_GetModuleDict();
if (unlikely(!modules)) __PYX_ERR(1, 1, __pyx_L1_error)
21530 if (!PyDict_GetItemString(modules,
"equivalent_polynomials")) {
21531 if (unlikely(PyDict_SetItemString(modules,
"equivalent_polynomials", __pyx_m) < 0)) __PYX_ERR(1, 1, __pyx_L1_error)
21536 if (__Pyx_InitCachedBuiltins() < 0) __PYX_ERR(1, 1, __pyx_L1_error)
21538 if (__Pyx_InitCachedConstants() < 0) __PYX_ERR(1, 1, __pyx_L1_error)
21540 (void)__Pyx_modinit_global_init_code();
21541 (void)__Pyx_modinit_variable_export_code();
21542 (void)__Pyx_modinit_function_export_code();
21543 if (unlikely(__Pyx_modinit_type_init_code() < 0)) __PYX_ERR(1, 1, __pyx_L1_error)
21544 if (unlikely(__Pyx_modinit_type_import_code() < 0)) __PYX_ERR(1, 1, __pyx_L1_error)
21545 (void)__Pyx_modinit_variable_import_code();
21546 (void)__Pyx_modinit_function_import_code();
21548 #if defined(__Pyx_Generator_USED) || defined(__Pyx_Coroutine_USED)
21549 if (__Pyx_patch_abc() < 0) __PYX_ERR(1, 1, __pyx_L1_error)
21558 __pyx_t_1 = __Pyx_Import(__pyx_n_s_numpy, 0, -1);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 2, __pyx_L1_error)
21559 __Pyx_GOTREF(__pyx_t_1);
21560 if (PyDict_SetItem(__pyx_d, __pyx_n_s_np, __pyx_t_1) < 0) __PYX_ERR(1, 2, __pyx_L1_error)
21561 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
21568 __pyx_t_1 = __Pyx_PyDict_NewPresized(0);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1, __pyx_L1_error)
21569 __Pyx_GOTREF(__pyx_t_1);
21570 if (PyDict_SetItem(__pyx_d, __pyx_n_s_test, __pyx_t_1) < 0) __PYX_ERR(1, 1, __pyx_L1_error)
21571 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
21580 __pyx_t_1 = __pyx_capsule_create(((
void *)(&__pyx_array_getbuffer)), ((
char *)
"getbuffer(obj, view, flags)"));
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 209, __pyx_L1_error)
21581 __Pyx_GOTREF(__pyx_t_1);
21582 if (PyDict_SetItem((PyObject *)__pyx_array_type->tp_dict, __pyx_n_s_pyx_getbuffer, __pyx_t_1) < 0) __PYX_ERR(0, 209, __pyx_L1_error)
21583 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
21584 PyType_Modified(__pyx_array_type);
21593 __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)__pyx_MemviewEnum_type), __pyx_tuple__40, NULL);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 286, __pyx_L1_error)
21594 __Pyx_GOTREF(__pyx_t_1);
21595 __Pyx_XGOTREF(
generic);
21596 __Pyx_DECREF_SET(
generic, __pyx_t_1);
21597 __Pyx_GIVEREF(__pyx_t_1);
21607 __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)__pyx_MemviewEnum_type), __pyx_tuple__41, NULL);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 287, __pyx_L1_error)
21608 __Pyx_GOTREF(__pyx_t_1);
21609 __Pyx_XGOTREF(strided);
21610 __Pyx_DECREF_SET(strided, __pyx_t_1);
21611 __Pyx_GIVEREF(__pyx_t_1);
21621 __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)__pyx_MemviewEnum_type), __pyx_tuple__42, NULL);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 288, __pyx_L1_error)
21622 __Pyx_GOTREF(__pyx_t_1);
21623 __Pyx_XGOTREF(indirect);
21624 __Pyx_DECREF_SET(indirect, __pyx_t_1);
21625 __Pyx_GIVEREF(__pyx_t_1);
21635 __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)__pyx_MemviewEnum_type), __pyx_tuple__43, NULL);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 291, __pyx_L1_error)
21636 __Pyx_GOTREF(__pyx_t_1);
21637 __Pyx_XGOTREF(contiguous);
21638 __Pyx_DECREF_SET(contiguous, __pyx_t_1);
21639 __Pyx_GIVEREF(__pyx_t_1);
21649 __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)__pyx_MemviewEnum_type), __pyx_tuple__44, NULL);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 292, __pyx_L1_error)
21650 __Pyx_GOTREF(__pyx_t_1);
21651 __Pyx_XGOTREF(indirect_contiguous);
21652 __Pyx_DECREF_SET(indirect_contiguous, __pyx_t_1);
21653 __Pyx_GIVEREF(__pyx_t_1);
21663 __pyx_memoryview_thread_locks_used = 0;
21672 __pyx_t_2[0] = PyThread_allocate_lock();
21673 __pyx_t_2[1] = PyThread_allocate_lock();
21674 __pyx_t_2[2] = PyThread_allocate_lock();
21675 __pyx_t_2[3] = PyThread_allocate_lock();
21676 __pyx_t_2[4] = PyThread_allocate_lock();
21677 __pyx_t_2[5] = PyThread_allocate_lock();
21678 __pyx_t_2[6] = PyThread_allocate_lock();
21679 __pyx_t_2[7] = PyThread_allocate_lock();
21680 memcpy(&(__pyx_memoryview_thread_locks[0]), __pyx_t_2,
sizeof(__pyx_memoryview_thread_locks[0]) * (8));
21689 __pyx_t_1 = __pyx_capsule_create(((
void *)(&__pyx_memoryview_getbuffer)), ((
char *)
"getbuffer(obj, view, flags)"));
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 549, __pyx_L1_error)
21690 __Pyx_GOTREF(__pyx_t_1);
21691 if (PyDict_SetItem((PyObject *)__pyx_memoryview_type->tp_dict, __pyx_n_s_pyx_getbuffer, __pyx_t_1) < 0) __PYX_ERR(0, 549, __pyx_L1_error)
21692 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
21693 PyType_Modified(__pyx_memoryview_type);
21702 __pyx_t_1 = __pyx_capsule_create(((
void *)(&__pyx_memoryview_getbuffer)), ((
char *)
"getbuffer(obj, view, flags)"));
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 995, __pyx_L1_error)
21703 __Pyx_GOTREF(__pyx_t_1);
21704 if (PyDict_SetItem((PyObject *)__pyx_memoryviewslice_type->tp_dict, __pyx_n_s_pyx_getbuffer, __pyx_t_1) < 0) __PYX_ERR(0, 995, __pyx_L1_error)
21705 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
21706 PyType_Modified(__pyx_memoryviewslice_type);
21713 __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_15View_dot_MemoryView_1__pyx_unpickle_Enum, NULL, __pyx_n_s_View_MemoryView);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1, __pyx_L1_error)
21714 __Pyx_GOTREF(__pyx_t_1);
21715 if (PyDict_SetItem(__pyx_d, __pyx_n_s_pyx_unpickle_Enum, __pyx_t_1) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
21716 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
21730 __Pyx_XDECREF(__pyx_t_1);
21733 __Pyx_AddTraceback(
"init equivalent_polynomials", __pyx_clineno, __pyx_lineno, __pyx_filename);
21736 }
else if (!PyErr_Occurred()) {
21737 PyErr_SetString(PyExc_ImportError,
"init equivalent_polynomials");
21740 __Pyx_RefNannyFinishContext();
21741 #if CYTHON_PEP489_MULTI_PHASE_INIT
21742 return (__pyx_m != NULL) ? 0 : -1;
21743 #elif PY_MAJOR_VERSION >= 3
21752 #if CYTHON_REFNANNY
21753 static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(
const char *modname) {
21754 PyObject *m = NULL, *p = NULL;
21756 m = PyImport_ImportModule(modname);
21758 p = PyObject_GetAttrString(m,
"RefNannyAPI");
21760 r = PyLong_AsVoidPtr(p);
21764 return (__Pyx_RefNannyAPIStruct *)
r;
21769 #if CYTHON_USE_TYPE_SLOTS
21770 static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name) {
21771 PyTypeObject* tp = Py_TYPE(obj);
21772 if (likely(tp->tp_getattro))
21773 return tp->tp_getattro(obj, attr_name);
21774 #if PY_MAJOR_VERSION < 3
21775 if (likely(tp->tp_getattr))
21776 return tp->tp_getattr(obj, PyString_AS_STRING(attr_name));
21778 return PyObject_GetAttr(obj, attr_name);
21783 static PyObject *__Pyx_GetBuiltinName(PyObject *name) {
21784 PyObject* result = __Pyx_PyObject_GetAttrStr(__pyx_b, name);
21785 if (unlikely(!result)) {
21786 PyErr_Format(PyExc_NameError,
21787 #
if PY_MAJOR_VERSION >= 3
21788 "name '%U' is not defined", name);
21790 "name '%.200s' is not defined", PyString_AS_STRING(name));
21797 static void __Pyx_RaiseArgtupleInvalid(
21798 const char* func_name,
21800 Py_ssize_t num_min,
21801 Py_ssize_t num_max,
21802 Py_ssize_t num_found)
21804 Py_ssize_t num_expected;
21805 const char *more_or_less;
21806 if (num_found < num_min) {
21807 num_expected = num_min;
21808 more_or_less =
"at least";
21810 num_expected = num_max;
21811 more_or_less =
"at most";
21814 more_or_less =
"exactly";
21816 PyErr_Format(PyExc_TypeError,
21817 "%.200s() takes %.8s %" CYTHON_FORMAT_SSIZE_T
"d positional argument%.1s (%" CYTHON_FORMAT_SSIZE_T
"d given)",
21818 func_name, more_or_less, num_expected,
21819 (num_expected == 1) ?
"" :
"s", num_found);
21823 static void __Pyx_RaiseDoubleKeywordsError(
21824 const char* func_name,
21827 PyErr_Format(PyExc_TypeError,
21828 #
if PY_MAJOR_VERSION >= 3
21829 "%s() got multiple values for keyword argument '%U'", func_name, kw_name);
21831 "%s() got multiple values for keyword argument '%s'", func_name,
21832 PyString_AsString(kw_name));
21837 static int __Pyx_ParseOptionalKeywords(
21839 PyObject **argnames[],
21841 PyObject *values[],
21842 Py_ssize_t num_pos_args,
21843 const char* function_name)
21845 PyObject *key = 0, *value = 0;
21846 Py_ssize_t
pos = 0;
21848 PyObject*** first_kw_arg = argnames + num_pos_args;
21849 while (PyDict_Next(kwds, &
pos, &key, &value)) {
21850 name = first_kw_arg;
21851 while (*name && (**name != key)) name++;
21853 values[name-argnames] = value;
21856 name = first_kw_arg;
21857 #if PY_MAJOR_VERSION < 3
21858 if (likely(PyString_Check(key))) {
21860 if ((CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**name) == PyString_GET_SIZE(key))
21861 && _PyString_Eq(**name, key)) {
21862 values[name-argnames] = value;
21867 if (*name)
continue;
21869 PyObject*** argname = argnames;
21870 while (argname != first_kw_arg) {
21871 if ((**argname == key) || (
21872 (CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**argname) == PyString_GET_SIZE(key))
21873 && _PyString_Eq(**argname, key))) {
21874 goto arg_passed_twice;
21881 if (likely(PyUnicode_Check(key))) {
21883 int cmp = (**name == key) ? 0 :
21884 #
if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3
21885 (__Pyx_PyUnicode_GET_LENGTH(**name) != __Pyx_PyUnicode_GET_LENGTH(key)) ? 1 :
21887 PyUnicode_Compare(**name, key);
21888 if (cmp < 0 && unlikely(PyErr_Occurred()))
goto bad;
21890 values[name-argnames] = value;
21895 if (*name)
continue;
21897 PyObject*** argname = argnames;
21898 while (argname != first_kw_arg) {
21899 int cmp = (**argname == key) ? 0 :
21900 #
if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3
21901 (__Pyx_PyUnicode_GET_LENGTH(**argname) != __Pyx_PyUnicode_GET_LENGTH(key)) ? 1 :
21903 PyUnicode_Compare(**argname, key);
21904 if (cmp < 0 && unlikely(PyErr_Occurred()))
goto bad;
21905 if (cmp == 0)
goto arg_passed_twice;
21910 goto invalid_keyword_type;
21912 if (unlikely(PyDict_SetItem(kwds2, key, value)))
goto bad;
21914 goto invalid_keyword;
21919 __Pyx_RaiseDoubleKeywordsError(function_name, key);
21921 invalid_keyword_type:
21922 PyErr_Format(PyExc_TypeError,
21923 "%.200s() keywords must be strings", function_name);
21926 PyErr_Format(PyExc_TypeError,
21927 #
if PY_MAJOR_VERSION < 3
21928 "%.200s() got an unexpected keyword argument '%.200s'",
21929 function_name, PyString_AsString(key));
21931 "%s() got an unexpected keyword argument '%U'",
21932 function_name, key);
21939 #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_TYPE_SLOTS
21940 static CYTHON_INLINE PY_UINT64_T __Pyx_get_tp_dict_version(PyObject *obj) {
21941 PyObject *dict = Py_TYPE(obj)->tp_dict;
21942 return likely(dict) ? __PYX_GET_DICT_VERSION(dict) : 0;
21944 static CYTHON_INLINE PY_UINT64_T __Pyx_get_object_dict_version(PyObject *obj) {
21945 PyObject **dictptr = NULL;
21946 Py_ssize_t offset = Py_TYPE(obj)->tp_dictoffset;
21948 #if CYTHON_COMPILING_IN_CPYTHON
21949 dictptr = (likely(offset > 0)) ? (PyObject **) ((
char *)obj + offset) : _PyObject_GetDictPtr(obj);
21951 dictptr = _PyObject_GetDictPtr(obj);
21954 return (dictptr && *dictptr) ? __PYX_GET_DICT_VERSION(*dictptr) : 0;
21956 static CYTHON_INLINE
int __Pyx_object_dict_version_matches(PyObject* obj, PY_UINT64_T tp_dict_version, PY_UINT64_T obj_dict_version) {
21957 PyObject *dict = Py_TYPE(obj)->tp_dict;
21958 if (unlikely(!dict) || unlikely(tp_dict_version != __PYX_GET_DICT_VERSION(dict)))
21960 return obj_dict_version == __Pyx_get_object_dict_version(obj);
21965 #if CYTHON_USE_DICT_VERSIONS
21966 static PyObject *__Pyx__GetModuleGlobalName(PyObject *name, PY_UINT64_T *dict_version, PyObject **dict_cached_value)
21968 static CYTHON_INLINE PyObject *__Pyx__GetModuleGlobalName(PyObject *name)
21972 #if !CYTHON_AVOID_BORROWED_REFS
21973 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030500A1
21974 result = _PyDict_GetItem_KnownHash(__pyx_d, name, ((PyASCIIObject *) name)->hash);
21975 __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version)
21976 if (likely(result)) {
21977 return __Pyx_NewRef(result);
21978 }
else if (unlikely(PyErr_Occurred())) {
21982 result = PyDict_GetItem(__pyx_d, name);
21983 __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version)
21984 if (likely(result)) {
21985 return __Pyx_NewRef(result);
21989 result = PyObject_GetItem(__pyx_d, name);
21990 __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version)
21991 if (likely(result)) {
21992 return __Pyx_NewRef(result);
21996 return __Pyx_GetBuiltinName(name);
22000 #if CYTHON_COMPILING_IN_CPYTHON
22001 static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw) {
22003 ternaryfunc call = Py_TYPE(func)->tp_call;
22004 if (unlikely(!call))
22005 return PyObject_Call(func, arg, kw);
22006 if (unlikely(Py_EnterRecursiveCall((
char*)
" while calling a Python object")))
22008 result = (*call)(func, arg, kw);
22009 Py_LeaveRecursiveCall();
22010 if (unlikely(!result) && unlikely(!PyErr_Occurred())) {
22013 "NULL result without error in PyObject_Call");
22020 static CYTHON_INLINE
int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type) {
22021 if (unlikely(!type)) {
22022 PyErr_SetString(PyExc_SystemError,
"Missing type object");
22025 if (likely(__Pyx_TypeCheck(obj, type)))
22027 PyErr_Format(PyExc_TypeError,
"Cannot convert %.200s to %.200s",
22028 Py_TYPE(obj)->tp_name, type->tp_name);
22033 static int __Pyx__ArgTypeTest(PyObject *obj, PyTypeObject *type,
const char *name,
int exact)
22035 if (unlikely(!type)) {
22036 PyErr_SetString(PyExc_SystemError,
"Missing type object");
22040 #if PY_MAJOR_VERSION == 2
22041 if ((type == &PyBaseString_Type) && likely(__Pyx_PyBaseString_CheckExact(obj)))
return 1;
22045 if (likely(__Pyx_TypeCheck(obj, type)))
return 1;
22047 PyErr_Format(PyExc_TypeError,
22048 "Argument '%.200s' has incorrect type (expected %.200s, got %.200s)",
22049 name, type->tp_name, Py_TYPE(obj)->tp_name);
22054 static CYTHON_INLINE
int __Pyx_PyObject_SetSlice(PyObject* obj, PyObject* value,
22055 Py_ssize_t cstart, Py_ssize_t cstop,
22056 PyObject** _py_start, PyObject** _py_stop, PyObject** _py_slice,
22057 int has_cstart,
int has_cstop, CYTHON_UNUSED
int wraparound) {
22058 #if CYTHON_USE_TYPE_SLOTS
22059 PyMappingMethods* mp;
22060 #if PY_MAJOR_VERSION < 3
22061 PySequenceMethods* ms = Py_TYPE(obj)->tp_as_sequence;
22062 if (likely(ms && ms->sq_ass_slice)) {
22064 if (_py_start && (*_py_start != Py_None)) {
22065 cstart = __Pyx_PyIndex_AsSsize_t(*_py_start);
22066 if ((cstart == (Py_ssize_t)-1) && PyErr_Occurred())
goto bad;
22071 if (_py_stop && (*_py_stop != Py_None)) {
22072 cstop = __Pyx_PyIndex_AsSsize_t(*_py_stop);
22073 if ((cstop == (Py_ssize_t)-1) && PyErr_Occurred())
goto bad;
22075 cstop = PY_SSIZE_T_MAX;
22077 if (wraparound && unlikely((cstart < 0) | (cstop < 0)) && likely(ms->sq_length)) {
22078 Py_ssize_t l = ms->sq_length(obj);
22079 if (likely(l >= 0)) {
22082 if (cstop < 0) cstop = 0;
22086 if (cstart < 0) cstart = 0;
22089 if (!PyErr_ExceptionMatches(PyExc_OverflowError))
22094 return ms->sq_ass_slice(obj, cstart, cstop, value);
22097 mp = Py_TYPE(obj)->tp_as_mapping;
22098 if (likely(mp && mp->mp_ass_subscript))
22102 PyObject *py_slice, *py_start, *py_stop;
22104 py_slice = *_py_slice;
22106 PyObject* owned_start = NULL;
22107 PyObject* owned_stop = NULL;
22109 py_start = *_py_start;
22112 owned_start = py_start = PyInt_FromSsize_t(cstart);
22113 if (unlikely(!py_start))
goto bad;
22115 py_start = Py_None;
22118 py_stop = *_py_stop;
22121 owned_stop = py_stop = PyInt_FromSsize_t(cstop);
22122 if (unlikely(!py_stop)) {
22123 Py_XDECREF(owned_start);
22129 py_slice = PySlice_New(py_start, py_stop, Py_None);
22130 Py_XDECREF(owned_start);
22131 Py_XDECREF(owned_stop);
22132 if (unlikely(!py_slice))
goto bad;
22134 #if CYTHON_USE_TYPE_SLOTS
22135 result = mp->mp_ass_subscript(obj, py_slice, value);
22137 result = value ? PyObject_SetItem(obj, py_slice, value) : PyObject_DelItem(obj, py_slice);
22140 Py_DECREF(py_slice);
22144 PyErr_Format(PyExc_TypeError,
22145 "'%.200s' object does not support slice %.10s",
22146 Py_TYPE(obj)->tp_name, value ?
"assignment" :
"deletion");
22152 #if CYTHON_FAST_PYCCALL
22153 static CYTHON_INLINE PyObject * __Pyx_PyCFunction_FastCall(PyObject *func_obj, PyObject **args, Py_ssize_t nargs) {
22154 PyCFunctionObject *func = (PyCFunctionObject*)func_obj;
22155 PyCFunction meth = PyCFunction_GET_FUNCTION(func);
22156 PyObject *
self = PyCFunction_GET_SELF(func);
22157 int flags = PyCFunction_GET_FLAGS(func);
22158 assert(PyCFunction_Check(func));
22159 assert(METH_FASTCALL == (flags & ~(METH_CLASS | METH_STATIC | METH_COEXIST | METH_KEYWORDS | METH_STACKLESS)));
22160 assert(nargs >= 0);
22161 assert(nargs == 0 || args != NULL);
22165 assert(!PyErr_Occurred());
22166 if ((PY_VERSION_HEX < 0x030700A0) || unlikely(flags & METH_KEYWORDS)) {
22167 return (*((__Pyx_PyCFunctionFastWithKeywords)(
void*)meth)) (
self, args, nargs, NULL);
22169 return (*((__Pyx_PyCFunctionFast)(
void*)meth)) (
self, args, nargs);
22175 #if CYTHON_FAST_PYCALL
22176 static PyObject* __Pyx_PyFunction_FastCallNoKw(PyCodeObject *co, PyObject **args, Py_ssize_t na,
22177 PyObject *globals) {
22179 PyThreadState *tstate = __Pyx_PyThreadState_Current;
22180 PyObject **fastlocals;
22183 assert(globals != NULL);
22188 assert(tstate != NULL);
22189 f = PyFrame_New(tstate, co, globals, NULL);
22193 fastlocals = __Pyx_PyFrame_GetLocalsplus(
f);
22194 for (i = 0; i < na; i++) {
22196 fastlocals[i] = *args++;
22198 result = PyEval_EvalFrameEx(
f,0);
22199 ++tstate->recursion_depth;
22201 --tstate->recursion_depth;
22204 #if 1 || PY_VERSION_HEX < 0x030600B1
22205 static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args, Py_ssize_t nargs, PyObject *kwargs) {
22206 PyCodeObject *co = (PyCodeObject *)PyFunction_GET_CODE(func);
22207 PyObject *globals = PyFunction_GET_GLOBALS(func);
22208 PyObject *argdefs = PyFunction_GET_DEFAULTS(func);
22210 #if PY_MAJOR_VERSION >= 3
22213 PyObject *kwtuple, **k;
22218 assert(kwargs == NULL || PyDict_Check(kwargs));
22219 nk = kwargs ? PyDict_Size(kwargs) : 0;
22220 if (Py_EnterRecursiveCall((
char*)
" while calling a Python object")) {
22224 #
if PY_MAJOR_VERSION >= 3
22225 co->co_kwonlyargcount == 0 &&
22227 likely(kwargs == NULL || nk == 0) &&
22228 co->co_flags == (CO_OPTIMIZED | CO_NEWLOCALS | CO_NOFREE)) {
22229 if (argdefs == NULL && co->co_argcount == nargs) {
22230 result = __Pyx_PyFunction_FastCallNoKw(co, args, nargs, globals);
22233 else if (nargs == 0 && argdefs != NULL
22234 && co->co_argcount == Py_SIZE(argdefs)) {
22237 args = &PyTuple_GET_ITEM(argdefs, 0);
22238 result =__Pyx_PyFunction_FastCallNoKw(co, args, Py_SIZE(argdefs), globals);
22242 if (kwargs != NULL) {
22244 kwtuple = PyTuple_New(2 * nk);
22245 if (kwtuple == NULL) {
22249 k = &PyTuple_GET_ITEM(kwtuple, 0);
22251 while (PyDict_Next(kwargs, &
pos, &k[i], &k[i+1])) {
22262 closure = PyFunction_GET_CLOSURE(func);
22263 #if PY_MAJOR_VERSION >= 3
22264 kwdefs = PyFunction_GET_KW_DEFAULTS(func);
22266 if (argdefs != NULL) {
22267 d = &PyTuple_GET_ITEM(argdefs, 0);
22268 nd = Py_SIZE(argdefs);
22274 #if PY_MAJOR_VERSION >= 3
22275 result = PyEval_EvalCodeEx((PyObject*)co, globals, (PyObject *)NULL,
22278 d, (
int)nd, kwdefs, closure);
22280 result = PyEval_EvalCodeEx(co, globals, (PyObject *)NULL,
22283 d, (
int)nd, closure);
22285 Py_XDECREF(kwtuple);
22287 Py_LeaveRecursiveCall();
22294 static CYTHON_UNUSED PyObject* __Pyx_PyObject_Call2Args(PyObject*
function, PyObject* arg1, PyObject* arg2) {
22295 PyObject *args, *result = NULL;
22296 #if CYTHON_FAST_PYCALL
22297 if (PyFunction_Check(
function)) {
22298 PyObject *args[2] = {arg1, arg2};
22299 return __Pyx_PyFunction_FastCall(
function, args, 2);
22302 #if CYTHON_FAST_PYCCALL
22303 if (__Pyx_PyFastCFunction_Check(
function)) {
22304 PyObject *args[2] = {arg1, arg2};
22305 return __Pyx_PyCFunction_FastCall(
function, args, 2);
22308 args = PyTuple_New(2);
22309 if (unlikely(!args))
goto done;
22311 PyTuple_SET_ITEM(args, 0, arg1);
22313 PyTuple_SET_ITEM(args, 1, arg2);
22314 Py_INCREF(
function);
22315 result = __Pyx_PyObject_Call(
function, args, NULL);
22317 Py_DECREF(
function);
22323 #if CYTHON_COMPILING_IN_CPYTHON
22324 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg) {
22325 PyObject *
self, *result;
22327 cfunc = PyCFunction_GET_FUNCTION(func);
22328 self = PyCFunction_GET_SELF(func);
22329 if (unlikely(Py_EnterRecursiveCall((
char*)
" while calling a Python object")))
22331 result = cfunc(
self, arg);
22332 Py_LeaveRecursiveCall();
22333 if (unlikely(!result) && unlikely(!PyErr_Occurred())) {
22336 "NULL result without error in PyObject_Call");
22343 #if CYTHON_COMPILING_IN_CPYTHON
22344 static PyObject* __Pyx__PyObject_CallOneArg(PyObject *func, PyObject *arg) {
22346 PyObject *args = PyTuple_New(1);
22347 if (unlikely(!args))
return NULL;
22349 PyTuple_SET_ITEM(args, 0, arg);
22350 result = __Pyx_PyObject_Call(func, args, NULL);
22354 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg) {
22355 #if CYTHON_FAST_PYCALL
22356 if (PyFunction_Check(func)) {
22357 return __Pyx_PyFunction_FastCall(func, &arg, 1);
22360 if (likely(PyCFunction_Check(func))) {
22361 if (likely(PyCFunction_GET_FLAGS(func) & METH_O)) {
22362 return __Pyx_PyObject_CallMethO(func, arg);
22363 #if CYTHON_FAST_PYCCALL
22364 }
else if (__Pyx_PyFastCFunction_Check(func)) {
22365 return __Pyx_PyCFunction_FastCall(func, &arg, 1);
22369 return __Pyx__PyObject_CallOneArg(func, arg);
22372 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg) {
22374 PyObject *args = PyTuple_Pack(1, arg);
22375 if (unlikely(!args))
return NULL;
22376 result = __Pyx_PyObject_Call(func, args, NULL);
22383 static PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j) {
22385 if (!j)
return NULL;
22386 r = PyObject_GetItem(o, j);
22390 static CYTHON_INLINE PyObject *__Pyx_GetItemInt_List_Fast(PyObject *o, Py_ssize_t i,
22391 CYTHON_NCP_UNUSED
int wraparound,
22392 CYTHON_NCP_UNUSED
int boundscheck) {
22393 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
22394 Py_ssize_t wrapped_i = i;
22395 if (wraparound & unlikely(i < 0)) {
22396 wrapped_i += PyList_GET_SIZE(o);
22398 if ((!boundscheck) || likely(__Pyx_is_valid_index(wrapped_i, PyList_GET_SIZE(o)))) {
22399 PyObject *
r = PyList_GET_ITEM(o, wrapped_i);
22403 return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i));
22405 return PySequence_GetItem(o, i);
22408 static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize_t i,
22409 CYTHON_NCP_UNUSED
int wraparound,
22410 CYTHON_NCP_UNUSED
int boundscheck) {
22411 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
22412 Py_ssize_t wrapped_i = i;
22413 if (wraparound & unlikely(i < 0)) {
22414 wrapped_i += PyTuple_GET_SIZE(o);
22416 if ((!boundscheck) || likely(__Pyx_is_valid_index(wrapped_i, PyTuple_GET_SIZE(o)))) {
22417 PyObject *
r = PyTuple_GET_ITEM(o, wrapped_i);
22421 return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i));
22423 return PySequence_GetItem(o, i);
22426 static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i,
int is_list,
22427 CYTHON_NCP_UNUSED
int wraparound,
22428 CYTHON_NCP_UNUSED
int boundscheck) {
22429 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS && CYTHON_USE_TYPE_SLOTS
22430 if (is_list || PyList_CheckExact(o)) {
22431 Py_ssize_t
n = ((!wraparound) | likely(i >= 0)) ? i : i + PyList_GET_SIZE(o);
22432 if ((!boundscheck) || (likely(__Pyx_is_valid_index(
n, PyList_GET_SIZE(o))))) {
22433 PyObject *
r = PyList_GET_ITEM(o,
n);
22438 else if (PyTuple_CheckExact(o)) {
22439 Py_ssize_t
n = ((!wraparound) | likely(i >= 0)) ? i : i + PyTuple_GET_SIZE(o);
22440 if ((!boundscheck) || likely(__Pyx_is_valid_index(
n, PyTuple_GET_SIZE(o)))) {
22441 PyObject *
r = PyTuple_GET_ITEM(o,
n);
22446 PySequenceMethods *m = Py_TYPE(o)->tp_as_sequence;
22447 if (likely(m && m->sq_item)) {
22448 if (wraparound && unlikely(i < 0) && likely(m->sq_length)) {
22449 Py_ssize_t l = m->sq_length(o);
22450 if (likely(l >= 0)) {
22453 if (!PyErr_ExceptionMatches(PyExc_OverflowError))
22458 return m->sq_item(o, i);
22462 if (is_list || PySequence_Check(o)) {
22463 return PySequence_GetItem(o, i);
22466 return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i));
22470 #if CYTHON_FAST_THREAD_STATE
22471 static CYTHON_INLINE
void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb) {
22472 PyObject *tmp_type, *tmp_value, *tmp_tb;
22473 tmp_type = tstate->curexc_type;
22474 tmp_value = tstate->curexc_value;
22475 tmp_tb = tstate->curexc_traceback;
22476 tstate->curexc_type = type;
22477 tstate->curexc_value = value;
22478 tstate->curexc_traceback = tb;
22479 Py_XDECREF(tmp_type);
22480 Py_XDECREF(tmp_value);
22481 Py_XDECREF(tmp_tb);
22483 static CYTHON_INLINE
void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) {
22484 *type = tstate->curexc_type;
22485 *value = tstate->curexc_value;
22486 *tb = tstate->curexc_traceback;
22487 tstate->curexc_type = 0;
22488 tstate->curexc_value = 0;
22489 tstate->curexc_traceback = 0;
22494 #if PY_MAJOR_VERSION < 3
22495 static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb,
22496 CYTHON_UNUSED PyObject *cause) {
22497 __Pyx_PyThreadState_declare
22499 if (!value || value == Py_None)
22503 if (!tb || tb == Py_None)
22507 if (!PyTraceBack_Check(tb)) {
22508 PyErr_SetString(PyExc_TypeError,
22509 "raise: arg 3 must be a traceback or None");
22513 if (PyType_Check(type)) {
22514 #if CYTHON_COMPILING_IN_PYPY
22516 Py_INCREF(Py_None);
22520 PyErr_NormalizeException(&type, &value, &tb);
22523 PyErr_SetString(PyExc_TypeError,
22524 "instance exception may not have a separate value");
22528 type = (PyObject*) Py_TYPE(type);
22530 if (!PyType_IsSubtype((PyTypeObject *)type, (PyTypeObject *)PyExc_BaseException)) {
22531 PyErr_SetString(PyExc_TypeError,
22532 "raise: exception class must be a subclass of BaseException");
22536 __Pyx_PyThreadState_assign
22537 __Pyx_ErrRestore(type, value, tb);
22546 static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause) {
22547 PyObject* owned_instance = NULL;
22548 if (tb == Py_None) {
22550 }
else if (tb && !PyTraceBack_Check(tb)) {
22551 PyErr_SetString(PyExc_TypeError,
22552 "raise: arg 3 must be a traceback or None");
22555 if (value == Py_None)
22557 if (PyExceptionInstance_Check(type)) {
22559 PyErr_SetString(PyExc_TypeError,
22560 "instance exception may not have a separate value");
22564 type = (PyObject*) Py_TYPE(value);
22565 }
else if (PyExceptionClass_Check(type)) {
22566 PyObject *instance_class = NULL;
22567 if (value && PyExceptionInstance_Check(value)) {
22568 instance_class = (PyObject*) Py_TYPE(value);
22569 if (instance_class != type) {
22570 int is_subclass = PyObject_IsSubclass(instance_class, type);
22571 if (!is_subclass) {
22572 instance_class = NULL;
22573 }
else if (unlikely(is_subclass == -1)) {
22576 type = instance_class;
22580 if (!instance_class) {
22583 args = PyTuple_New(0);
22584 else if (PyTuple_Check(value)) {
22588 args = PyTuple_Pack(1, value);
22591 owned_instance = PyObject_Call(type, args, NULL);
22593 if (!owned_instance)
22595 value = owned_instance;
22596 if (!PyExceptionInstance_Check(value)) {
22597 PyErr_Format(PyExc_TypeError,
22598 "calling %R should have returned an instance of "
22599 "BaseException, not %R",
22600 type, Py_TYPE(value));
22605 PyErr_SetString(PyExc_TypeError,
22606 "raise: exception class must be a subclass of BaseException");
22610 PyObject *fixed_cause;
22611 if (cause == Py_None) {
22612 fixed_cause = NULL;
22613 }
else if (PyExceptionClass_Check(cause)) {
22614 fixed_cause = PyObject_CallObject(cause, NULL);
22615 if (fixed_cause == NULL)
22617 }
else if (PyExceptionInstance_Check(cause)) {
22618 fixed_cause = cause;
22619 Py_INCREF(fixed_cause);
22621 PyErr_SetString(PyExc_TypeError,
22622 "exception causes must derive from "
22626 PyException_SetCause(value, fixed_cause);
22628 PyErr_SetObject(type, value);
22630 #if CYTHON_COMPILING_IN_PYPY
22631 PyObject *tmp_type, *tmp_value, *tmp_tb;
22632 PyErr_Fetch(&tmp_type, &tmp_value, &tmp_tb);
22634 PyErr_Restore(tmp_type, tmp_value, tb);
22635 Py_XDECREF(tmp_tb);
22637 PyThreadState *tstate = __Pyx_PyThreadState_Current;
22638 PyObject* tmp_tb = tstate->curexc_traceback;
22639 if (tb != tmp_tb) {
22641 tstate->curexc_traceback = tb;
22642 Py_XDECREF(tmp_tb);
22647 Py_XDECREF(owned_instance);
22653 #if CYTHON_USE_EXC_INFO_STACK
22654 static _PyErr_StackItem *
22655 __Pyx_PyErr_GetTopmostException(PyThreadState *tstate)
22657 _PyErr_StackItem *exc_info = tstate->exc_info;
22658 while ((exc_info->exc_type == NULL || exc_info->exc_type == Py_None) &&
22659 exc_info->previous_item != NULL)
22661 exc_info = exc_info->previous_item;
22668 #if CYTHON_FAST_THREAD_STATE
22669 static CYTHON_INLINE
void __Pyx__ExceptionSave(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) {
22670 #if CYTHON_USE_EXC_INFO_STACK
22671 _PyErr_StackItem *exc_info = __Pyx_PyErr_GetTopmostException(tstate);
22672 *type = exc_info->exc_type;
22673 *value = exc_info->exc_value;
22674 *tb = exc_info->exc_traceback;
22676 *type = tstate->exc_type;
22677 *value = tstate->exc_value;
22678 *tb = tstate->exc_traceback;
22681 Py_XINCREF(*value);
22684 static CYTHON_INLINE
void __Pyx__ExceptionReset(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb) {
22685 PyObject *tmp_type, *tmp_value, *tmp_tb;
22686 #if CYTHON_USE_EXC_INFO_STACK
22687 _PyErr_StackItem *exc_info = tstate->exc_info;
22688 tmp_type = exc_info->exc_type;
22689 tmp_value = exc_info->exc_value;
22690 tmp_tb = exc_info->exc_traceback;
22691 exc_info->exc_type = type;
22692 exc_info->exc_value = value;
22693 exc_info->exc_traceback = tb;
22695 tmp_type = tstate->exc_type;
22696 tmp_value = tstate->exc_value;
22697 tmp_tb = tstate->exc_traceback;
22698 tstate->exc_type = type;
22699 tstate->exc_value = value;
22700 tstate->exc_traceback = tb;
22702 Py_XDECREF(tmp_type);
22703 Py_XDECREF(tmp_value);
22704 Py_XDECREF(tmp_tb);
22709 #if CYTHON_FAST_THREAD_STATE
22710 static int __Pyx_PyErr_ExceptionMatchesTuple(PyObject *exc_type, PyObject *tuple) {
22712 n = PyTuple_GET_SIZE(tuple);
22713 #if PY_MAJOR_VERSION >= 3
22714 for (i=0; i<
n; i++) {
22715 if (exc_type == PyTuple_GET_ITEM(tuple, i))
return 1;
22718 for (i=0; i<
n; i++) {
22719 if (__Pyx_PyErr_GivenExceptionMatches(exc_type, PyTuple_GET_ITEM(tuple, i)))
return 1;
22723 static CYTHON_INLINE
int __Pyx_PyErr_ExceptionMatchesInState(PyThreadState* tstate, PyObject* err) {
22724 PyObject *exc_type = tstate->curexc_type;
22725 if (exc_type == err)
return 1;
22726 if (unlikely(!exc_type))
return 0;
22727 if (unlikely(PyTuple_Check(err)))
22728 return __Pyx_PyErr_ExceptionMatchesTuple(exc_type, err);
22729 return __Pyx_PyErr_GivenExceptionMatches(exc_type, err);
22734 #if CYTHON_FAST_THREAD_STATE
22735 static int __Pyx__GetException(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb)
22737 static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb)
22740 PyObject *local_type, *local_value, *local_tb;
22741 #if CYTHON_FAST_THREAD_STATE
22742 PyObject *tmp_type, *tmp_value, *tmp_tb;
22743 local_type = tstate->curexc_type;
22744 local_value = tstate->curexc_value;
22745 local_tb = tstate->curexc_traceback;
22746 tstate->curexc_type = 0;
22747 tstate->curexc_value = 0;
22748 tstate->curexc_traceback = 0;
22750 PyErr_Fetch(&local_type, &local_value, &local_tb);
22752 PyErr_NormalizeException(&local_type, &local_value, &local_tb);
22753 #if CYTHON_FAST_THREAD_STATE
22754 if (unlikely(tstate->curexc_type))
22756 if (unlikely(PyErr_Occurred()))
22759 #if PY_MAJOR_VERSION >= 3
22761 if (unlikely(PyException_SetTraceback(local_value, local_tb) < 0))
22765 Py_XINCREF(local_tb);
22766 Py_XINCREF(local_type);
22767 Py_XINCREF(local_value);
22768 *type = local_type;
22769 *value = local_value;
22771 #if CYTHON_FAST_THREAD_STATE
22772 #if CYTHON_USE_EXC_INFO_STACK
22774 _PyErr_StackItem *exc_info = tstate->exc_info;
22775 tmp_type = exc_info->exc_type;
22776 tmp_value = exc_info->exc_value;
22777 tmp_tb = exc_info->exc_traceback;
22778 exc_info->exc_type = local_type;
22779 exc_info->exc_value = local_value;
22780 exc_info->exc_traceback = local_tb;
22783 tmp_type = tstate->exc_type;
22784 tmp_value = tstate->exc_value;
22785 tmp_tb = tstate->exc_traceback;
22786 tstate->exc_type = local_type;
22787 tstate->exc_value = local_value;
22788 tstate->exc_traceback = local_tb;
22790 Py_XDECREF(tmp_type);
22791 Py_XDECREF(tmp_value);
22792 Py_XDECREF(tmp_tb);
22794 PyErr_SetExcInfo(local_type, local_value, local_tb);
22801 Py_XDECREF(local_type);
22802 Py_XDECREF(local_value);
22803 Py_XDECREF(local_tb);
22808 static CYTHON_INLINE
int __Pyx_PyBytes_Equals(PyObject* s1, PyObject* s2,
int equals) {
22809 #if CYTHON_COMPILING_IN_PYPY
22810 return PyObject_RichCompareBool(s1, s2, equals);
22813 return (equals == Py_EQ);
22814 }
else if (PyBytes_CheckExact(s1) & PyBytes_CheckExact(s2)) {
22815 const char *ps1, *ps2;
22816 Py_ssize_t length = PyBytes_GET_SIZE(s1);
22817 if (length != PyBytes_GET_SIZE(s2))
22818 return (equals == Py_NE);
22819 ps1 = PyBytes_AS_STRING(s1);
22820 ps2 = PyBytes_AS_STRING(s2);
22821 if (ps1[0] != ps2[0]) {
22822 return (equals == Py_NE);
22823 }
else if (length == 1) {
22824 return (equals == Py_EQ);
22827 #if CYTHON_USE_UNICODE_INTERNALS && (PY_VERSION_HEX < 0x030B0000)
22828 Py_hash_t hash1, hash2;
22829 hash1 = ((PyBytesObject*)s1)->ob_shash;
22830 hash2 = ((PyBytesObject*)s2)->ob_shash;
22831 if (hash1 != hash2 && hash1 != -1 && hash2 != -1) {
22832 return (equals == Py_NE);
22835 result = memcmp(ps1, ps2, (
size_t)length);
22836 return (equals == Py_EQ) ? (result == 0) : (result != 0);
22838 }
else if ((s1 == Py_None) & PyBytes_CheckExact(s2)) {
22839 return (equals == Py_NE);
22840 }
else if ((s2 == Py_None) & PyBytes_CheckExact(s1)) {
22841 return (equals == Py_NE);
22844 PyObject* py_result = PyObject_RichCompare(s1, s2, equals);
22847 result = __Pyx_PyObject_IsTrue(py_result);
22848 Py_DECREF(py_result);
22855 static CYTHON_INLINE
int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2,
int equals) {
22856 #if CYTHON_COMPILING_IN_PYPY
22857 return PyObject_RichCompareBool(s1, s2, equals);
22859 #if PY_MAJOR_VERSION < 3
22860 PyObject* owned_ref = NULL;
22862 int s1_is_unicode, s2_is_unicode;
22866 s1_is_unicode = PyUnicode_CheckExact(s1);
22867 s2_is_unicode = PyUnicode_CheckExact(s2);
22868 #if PY_MAJOR_VERSION < 3
22869 if ((s1_is_unicode & (!s2_is_unicode)) && PyString_CheckExact(s2)) {
22870 owned_ref = PyUnicode_FromObject(s2);
22871 if (unlikely(!owned_ref))
22875 }
else if ((s2_is_unicode & (!s1_is_unicode)) && PyString_CheckExact(s1)) {
22876 owned_ref = PyUnicode_FromObject(s1);
22877 if (unlikely(!owned_ref))
22881 }
else if (((!s2_is_unicode) & (!s1_is_unicode))) {
22882 return __Pyx_PyBytes_Equals(s1, s2, equals);
22885 if (s1_is_unicode & s2_is_unicode) {
22888 void *data1, *data2;
22889 if (unlikely(__Pyx_PyUnicode_READY(s1) < 0) || unlikely(__Pyx_PyUnicode_READY(s2) < 0))
22891 length = __Pyx_PyUnicode_GET_LENGTH(s1);
22892 if (length != __Pyx_PyUnicode_GET_LENGTH(s2)) {
22895 #if CYTHON_USE_UNICODE_INTERNALS
22897 Py_hash_t hash1, hash2;
22898 #if CYTHON_PEP393_ENABLED
22899 hash1 = ((PyASCIIObject*)s1)->hash;
22900 hash2 = ((PyASCIIObject*)s2)->hash;
22902 hash1 = ((PyUnicodeObject*)s1)->hash;
22903 hash2 = ((PyUnicodeObject*)s2)->hash;
22905 if (hash1 != hash2 && hash1 != -1 && hash2 != -1) {
22910 kind = __Pyx_PyUnicode_KIND(s1);
22911 if (kind != __Pyx_PyUnicode_KIND(s2)) {
22914 data1 = __Pyx_PyUnicode_DATA(s1);
22915 data2 = __Pyx_PyUnicode_DATA(s2);
22916 if (__Pyx_PyUnicode_READ(kind, data1, 0) != __Pyx_PyUnicode_READ(kind, data2, 0)) {
22918 }
else if (length == 1) {
22921 int result = memcmp(data1, data2, (
size_t)(length * kind));
22922 #if PY_MAJOR_VERSION < 3
22923 Py_XDECREF(owned_ref);
22925 return (equals == Py_EQ) ? (result == 0) : (result != 0);
22927 }
else if ((s1 == Py_None) & s2_is_unicode) {
22929 }
else if ((s2 == Py_None) & s1_is_unicode) {
22933 PyObject* py_result = PyObject_RichCompare(s1, s2, equals);
22934 #if PY_MAJOR_VERSION < 3
22935 Py_XDECREF(owned_ref);
22939 result = __Pyx_PyObject_IsTrue(py_result);
22940 Py_DECREF(py_result);
22944 #if PY_MAJOR_VERSION < 3
22945 Py_XDECREF(owned_ref);
22947 return (equals == Py_EQ);
22949 #if PY_MAJOR_VERSION < 3
22950 Py_XDECREF(owned_ref);
22952 return (equals == Py_NE);
22957 static CYTHON_INLINE Py_ssize_t __Pyx_div_Py_ssize_t(Py_ssize_t a, Py_ssize_t b) {
22958 Py_ssize_t
q = a / b;
22959 Py_ssize_t
r = a -
q*b;
22960 q -= ((
r != 0) & ((
r ^ b) < 0));
22965 static CYTHON_INLINE PyObject *__Pyx_GetAttr(PyObject *o, PyObject *
n) {
22966 #if CYTHON_USE_TYPE_SLOTS
22967 #if PY_MAJOR_VERSION >= 3
22968 if (likely(PyUnicode_Check(
n)))
22970 if (likely(PyString_Check(
n)))
22972 return __Pyx_PyObject_GetAttrStr(o,
n);
22974 return PyObject_GetAttr(o,
n);
22978 #if CYTHON_USE_TYPE_SLOTS
22979 static PyObject *__Pyx_PyObject_GetIndex(PyObject *obj, PyObject* index) {
22981 Py_ssize_t key_value;
22982 PySequenceMethods *m = Py_TYPE(obj)->tp_as_sequence;
22983 if (unlikely(!(m && m->sq_item))) {
22984 PyErr_Format(PyExc_TypeError,
"'%.200s' object is not subscriptable", Py_TYPE(obj)->tp_name);
22987 key_value = __Pyx_PyIndex_AsSsize_t(index);
22988 if (likely(key_value != -1 || !(runerr = PyErr_Occurred()))) {
22989 return __Pyx_GetItemInt_Fast(obj, key_value, 0, 1, 1);
22991 if (PyErr_GivenExceptionMatches(runerr, PyExc_OverflowError)) {
22993 PyErr_Format(PyExc_IndexError,
"cannot fit '%.200s' into an index-sized integer", Py_TYPE(index)->tp_name);
22997 static PyObject *__Pyx_PyObject_GetItem(PyObject *obj, PyObject* key) {
22998 PyMappingMethods *m = Py_TYPE(obj)->tp_as_mapping;
22999 if (likely(m && m->mp_subscript)) {
23000 return m->mp_subscript(obj, key);
23002 return __Pyx_PyObject_GetIndex(obj, key);
23007 static CYTHON_INLINE PyObject* __Pyx_decode_c_string(
23008 const char* cstring, Py_ssize_t start, Py_ssize_t stop,
23009 const char* encoding,
const char* errors,
23010 PyObject* (*decode_func)(
const char *
s, Py_ssize_t size,
const char *errors)) {
23012 if (unlikely((start < 0) | (stop < 0))) {
23013 size_t slen = strlen(cstring);
23014 if (unlikely(slen > (
size_t) PY_SSIZE_T_MAX)) {
23015 PyErr_SetString(PyExc_OverflowError,
23016 "c-string too long to convert to Python");
23019 length = (Py_ssize_t) slen;
23028 if (unlikely(stop <= start))
23029 return __Pyx_NewRef(__pyx_empty_unicode);
23030 length = stop - start;
23033 return decode_func(cstring, length, errors);
23035 return PyUnicode_Decode(cstring, length, encoding, errors);
23040 static PyObject *__Pyx_GetAttr3Default(PyObject *d) {
23041 __Pyx_PyThreadState_declare
23042 __Pyx_PyThreadState_assign
23043 if (unlikely(!__Pyx_PyErr_ExceptionMatches(PyExc_AttributeError)))
23045 __Pyx_PyErr_Clear();
23049 static CYTHON_INLINE PyObject *__Pyx_GetAttr3(PyObject *o, PyObject *
n, PyObject *d) {
23050 PyObject *
r = __Pyx_GetAttr(o,
n);
23051 return (likely(
r)) ?
r : __Pyx_GetAttr3Default(d);
23055 static CYTHON_INLINE
void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected) {
23056 PyErr_Format(PyExc_ValueError,
23057 "too many values to unpack (expected %" CYTHON_FORMAT_SSIZE_T
"d)", expected);
23061 static CYTHON_INLINE
void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index) {
23062 PyErr_Format(PyExc_ValueError,
23063 "need more than %" CYTHON_FORMAT_SSIZE_T
"d value%.1s to unpack",
23064 index, (index == 1) ?
"" :
"s");
23068 static CYTHON_INLINE
void __Pyx_RaiseNoneNotIterableError(
void) {
23069 PyErr_SetString(PyExc_TypeError,
"'NoneType' object is not iterable");
23073 #if CYTHON_FAST_THREAD_STATE
23074 static CYTHON_INLINE
void __Pyx__ExceptionSwap(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) {
23075 PyObject *tmp_type, *tmp_value, *tmp_tb;
23076 #if CYTHON_USE_EXC_INFO_STACK
23077 _PyErr_StackItem *exc_info = tstate->exc_info;
23078 tmp_type = exc_info->exc_type;
23079 tmp_value = exc_info->exc_value;
23080 tmp_tb = exc_info->exc_traceback;
23081 exc_info->exc_type = *type;
23082 exc_info->exc_value = *value;
23083 exc_info->exc_traceback = *tb;
23085 tmp_type = tstate->exc_type;
23086 tmp_value = tstate->exc_value;
23087 tmp_tb = tstate->exc_traceback;
23088 tstate->exc_type = *type;
23089 tstate->exc_value = *value;
23090 tstate->exc_traceback = *tb;
23093 *value = tmp_value;
23097 static CYTHON_INLINE
void __Pyx_ExceptionSwap(PyObject **type, PyObject **value, PyObject **tb) {
23098 PyObject *tmp_type, *tmp_value, *tmp_tb;
23099 PyErr_GetExcInfo(&tmp_type, &tmp_value, &tmp_tb);
23100 PyErr_SetExcInfo(*type, *value, *tb);
23102 *value = tmp_value;
23108 static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list,
int level) {
23109 PyObject *empty_list = 0;
23110 PyObject *module = 0;
23111 PyObject *global_dict = 0;
23112 PyObject *empty_dict = 0;
23114 #if PY_MAJOR_VERSION < 3
23115 PyObject *py_import;
23116 py_import = __Pyx_PyObject_GetAttrStr(__pyx_b, __pyx_n_s_import);
23123 empty_list = PyList_New(0);
23128 global_dict = PyModule_GetDict(__pyx_m);
23131 empty_dict = PyDict_New();
23135 #if PY_MAJOR_VERSION >= 3
23137 if ((1) && (strchr(__Pyx_MODULE_NAME,
'.'))) {
23138 module = PyImport_ImportModuleLevelObject(
23139 name, global_dict, empty_dict, list, 1);
23141 if (!PyErr_ExceptionMatches(PyExc_ImportError))
23150 #if PY_MAJOR_VERSION < 3
23151 PyObject *py_level = PyInt_FromLong(level);
23154 module = PyObject_CallFunctionObjArgs(py_import,
23155 name, global_dict, empty_dict, list, py_level, (PyObject *)NULL);
23156 Py_DECREF(py_level);
23158 module = PyImport_ImportModuleLevelObject(
23159 name, global_dict, empty_dict, list, level);
23164 #if PY_MAJOR_VERSION < 3
23165 Py_XDECREF(py_import);
23167 Py_XDECREF(empty_list);
23168 Py_XDECREF(empty_dict);
23173 #if CYTHON_COMPILING_IN_CPYTHON
23174 static int __Pyx_InBases(PyTypeObject *a, PyTypeObject *b) {
23180 return b == &PyBaseObject_Type;
23182 static CYTHON_INLINE
int __Pyx_IsSubtype(PyTypeObject *a, PyTypeObject *b) {
23184 if (a == b)
return 1;
23188 n = PyTuple_GET_SIZE(mro);
23189 for (i = 0; i <
n; i++) {
23190 if (PyTuple_GET_ITEM(mro, i) == (PyObject *)b)
23195 return __Pyx_InBases(a, b);
23197 #if PY_MAJOR_VERSION == 2
23198 static int __Pyx_inner_PyErr_GivenExceptionMatches2(PyObject *err, PyObject* exc_type1, PyObject* exc_type2) {
23199 PyObject *exception, *value, *tb;
23201 __Pyx_PyThreadState_declare
23202 __Pyx_PyThreadState_assign
23203 __Pyx_ErrFetch(&exception, &value, &tb);
23204 res = exc_type1 ? PyObject_IsSubclass(err, exc_type1) : 0;
23205 if (unlikely(res == -1)) {
23206 PyErr_WriteUnraisable(err);
23210 res = PyObject_IsSubclass(err, exc_type2);
23211 if (unlikely(res == -1)) {
23212 PyErr_WriteUnraisable(err);
23216 __Pyx_ErrRestore(exception, value, tb);
23220 static CYTHON_INLINE
int __Pyx_inner_PyErr_GivenExceptionMatches2(PyObject *err, PyObject* exc_type1, PyObject *exc_type2) {
23221 int res = exc_type1 ? __Pyx_IsSubtype((PyTypeObject*)err, (PyTypeObject*)exc_type1) : 0;
23223 res = __Pyx_IsSubtype((PyTypeObject*)err, (PyTypeObject*)exc_type2);
23228 static int __Pyx_PyErr_GivenExceptionMatchesTuple(PyObject *exc_type, PyObject *tuple) {
23230 assert(PyExceptionClass_Check(exc_type));
23231 n = PyTuple_GET_SIZE(tuple);
23232 #if PY_MAJOR_VERSION >= 3
23233 for (i=0; i<
n; i++) {
23234 if (exc_type == PyTuple_GET_ITEM(tuple, i))
return 1;
23237 for (i=0; i<
n; i++) {
23238 PyObject *t = PyTuple_GET_ITEM(tuple, i);
23239 #if PY_MAJOR_VERSION < 3
23240 if (likely(exc_type == t))
return 1;
23242 if (likely(PyExceptionClass_Check(t))) {
23243 if (__Pyx_inner_PyErr_GivenExceptionMatches2(exc_type, NULL, t))
return 1;
23249 static CYTHON_INLINE
int __Pyx_PyErr_GivenExceptionMatches(PyObject *err, PyObject* exc_type) {
23250 if (likely(err == exc_type))
return 1;
23251 if (likely(PyExceptionClass_Check(err))) {
23252 if (likely(PyExceptionClass_Check(exc_type))) {
23253 return __Pyx_inner_PyErr_GivenExceptionMatches2(err, NULL, exc_type);
23254 }
else if (likely(PyTuple_Check(exc_type))) {
23255 return __Pyx_PyErr_GivenExceptionMatchesTuple(err, exc_type);
23259 return PyErr_GivenExceptionMatches(err, exc_type);
23261 static CYTHON_INLINE
int __Pyx_PyErr_GivenExceptionMatches2(PyObject *err, PyObject *exc_type1, PyObject *exc_type2) {
23262 assert(PyExceptionClass_Check(exc_type1));
23263 assert(PyExceptionClass_Check(exc_type2));
23264 if (likely(err == exc_type1 || err == exc_type2))
return 1;
23265 if (likely(PyExceptionClass_Check(err))) {
23266 return __Pyx_inner_PyErr_GivenExceptionMatches2(err, exc_type1, exc_type2);
23268 return (PyErr_GivenExceptionMatches(err, exc_type1) || PyErr_GivenExceptionMatches(err, exc_type2));
23273 #if !CYTHON_COMPILING_IN_PYPY
23274 static PyObject* __Pyx_PyInt_AddObjC(PyObject *op1, PyObject *op2, CYTHON_UNUSED
long intval,
int inplace,
int zerodivision_check) {
23276 (void)zerodivision_check;
23277 #if PY_MAJOR_VERSION < 3
23278 if (likely(PyInt_CheckExact(op1))) {
23279 const long b = intval;
23281 long a = PyInt_AS_LONG(op1);
23282 x = (long)((
unsigned long)a + b);
23283 if (likely((x^a) >= 0 || (x^b) >= 0))
23284 return PyInt_FromLong(x);
23285 return PyLong_Type.tp_as_number->nb_add(op1, op2);
23288 #if CYTHON_USE_PYLONG_INTERNALS
23289 if (likely(PyLong_CheckExact(op1))) {
23290 const long b = intval;
23292 #ifdef HAVE_LONG_LONG
23293 const PY_LONG_LONG llb = intval;
23294 PY_LONG_LONG lla, llx;
23296 const digit* digits = ((PyLongObject*)op1)->ob_digit;
23297 const Py_ssize_t size = Py_SIZE(op1);
23298 if (likely(__Pyx_sst_abs(size) <= 1)) {
23299 a = likely(size) ? digits[0] : 0;
23300 if (size == -1) a = -a;
23304 if (8 *
sizeof(
long) - 1 > 2 * PyLong_SHIFT) {
23305 a = -(long) (((((
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0]));
23307 #ifdef HAVE_LONG_LONG
23308 }
else if (8 *
sizeof(PY_LONG_LONG) - 1 > 2 * PyLong_SHIFT) {
23309 lla = -(PY_LONG_LONG) (((((
unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (
unsigned PY_LONG_LONG)digits[0]));
23313 CYTHON_FALLTHROUGH;
23315 if (8 *
sizeof(
long) - 1 > 2 * PyLong_SHIFT) {
23316 a = (long) (((((
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0]));
23318 #ifdef HAVE_LONG_LONG
23319 }
else if (8 *
sizeof(PY_LONG_LONG) - 1 > 2 * PyLong_SHIFT) {
23320 lla = (PY_LONG_LONG) (((((
unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (
unsigned PY_LONG_LONG)digits[0]));
23324 CYTHON_FALLTHROUGH;
23326 if (8 *
sizeof(
long) - 1 > 3 * PyLong_SHIFT) {
23327 a = -(long) (((((((
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0]));
23329 #ifdef HAVE_LONG_LONG
23330 }
else if (8 *
sizeof(PY_LONG_LONG) - 1 > 3 * PyLong_SHIFT) {
23331 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]));
23335 CYTHON_FALLTHROUGH;
23337 if (8 *
sizeof(
long) - 1 > 3 * PyLong_SHIFT) {
23338 a = (long) (((((((
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0]));
23340 #ifdef HAVE_LONG_LONG
23341 }
else if (8 *
sizeof(PY_LONG_LONG) - 1 > 3 * PyLong_SHIFT) {
23342 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]));
23346 CYTHON_FALLTHROUGH;
23348 if (8 *
sizeof(
long) - 1 > 4 * PyLong_SHIFT) {
23349 a = -(long) (((((((((
unsigned long)digits[3]) << PyLong_SHIFT) | (
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0]));
23351 #ifdef HAVE_LONG_LONG
23352 }
else if (8 *
sizeof(PY_LONG_LONG) - 1 > 4 * PyLong_SHIFT) {
23353 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]));
23357 CYTHON_FALLTHROUGH;
23359 if (8 *
sizeof(
long) - 1 > 4 * PyLong_SHIFT) {
23360 a = (long) (((((((((
unsigned long)digits[3]) << PyLong_SHIFT) | (
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0]));
23362 #ifdef HAVE_LONG_LONG
23363 }
else if (8 *
sizeof(PY_LONG_LONG) - 1 > 4 * PyLong_SHIFT) {
23364 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]));
23368 CYTHON_FALLTHROUGH;
23369 default:
return PyLong_Type.tp_as_number->nb_add(op1, op2);
23373 return PyLong_FromLong(x);
23374 #ifdef HAVE_LONG_LONG
23377 return PyLong_FromLongLong(llx);
23383 if (PyFloat_CheckExact(op1)) {
23384 const long b = intval;
23385 double a = PyFloat_AS_DOUBLE(op1);
23387 PyFPE_START_PROTECT(
"add",
return NULL)
23388 result = ((double)a) + (double)b;
23389 PyFPE_END_PROTECT(result)
23390 return PyFloat_FromDouble(result);
23392 return (inplace ? PyNumber_InPlaceAdd : PyNumber_Add)(op1, op2);
23397 static CYTHON_INLINE
void __Pyx_RaiseUnboundLocalError(
const char *varname) {
23398 PyErr_Format(PyExc_UnboundLocalError,
"local variable '%s' referenced before assignment", varname);
23402 static CYTHON_INLINE
long __Pyx_div_long(
long a,
long b) {
23405 q -= ((
r != 0) & ((
r ^ b) < 0));
23410 static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name) {
23411 PyObject* value = __Pyx_PyObject_GetAttrStr(module, name);
23412 if (unlikely(!value) && PyErr_ExceptionMatches(PyExc_AttributeError)) {
23413 PyErr_Format(PyExc_ImportError,
23414 #
if PY_MAJOR_VERSION < 3
23415 "cannot import name %.230s", PyString_AS_STRING(name));
23417 "cannot import name %S", name);
23424 static CYTHON_INLINE
int __Pyx_HasAttr(PyObject *o, PyObject *
n) {
23426 if (unlikely(!__Pyx_PyBaseString_Check(
n))) {
23427 PyErr_SetString(PyExc_TypeError,
23428 "hasattr(): attribute name must be string");
23431 r = __Pyx_GetAttr(o,
n);
23432 if (unlikely(!
r)) {
23442 #if !CYTHON_COMPILING_IN_CPYTHON
23443 static CYTHON_INLINE PyObject* __Pyx_PyBytes_Join(PyObject* sep, PyObject* values) {
23444 return PyObject_CallMethodObjArgs(sep, __pyx_n_s_join, values, NULL);
23449 #if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000
23450 static PyObject *__Pyx_RaiseGenericGetAttributeError(PyTypeObject *tp, PyObject *attr_name) {
23451 PyErr_Format(PyExc_AttributeError,
23452 #
if PY_MAJOR_VERSION >= 3
23453 "'%.50s' object has no attribute '%U'",
23454 tp->tp_name, attr_name);
23456 "'%.50s' object has no attribute '%.400s'",
23457 tp->tp_name, PyString_AS_STRING(attr_name));
23461 static CYTHON_INLINE PyObject* __Pyx_PyObject_GenericGetAttrNoDict(PyObject* obj, PyObject* attr_name) {
23463 PyTypeObject *tp = Py_TYPE(obj);
23464 if (unlikely(!PyString_Check(attr_name))) {
23465 return PyObject_GenericGetAttr(obj, attr_name);
23467 assert(!tp->tp_dictoffset);
23468 descr = _PyType_Lookup(tp, attr_name);
23469 if (unlikely(!descr)) {
23470 return __Pyx_RaiseGenericGetAttributeError(tp, attr_name);
23473 #if PY_MAJOR_VERSION < 3
23474 if (likely(PyType_HasFeature(Py_TYPE(descr), Py_TPFLAGS_HAVE_CLASS)))
23477 descrgetfunc
f = Py_TYPE(descr)->tp_descr_get;
23479 PyObject *res =
f(descr, obj, (PyObject *)tp);
23489 #if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000
23490 static PyObject* __Pyx_PyObject_GenericGetAttr(PyObject* obj, PyObject* attr_name) {
23491 if (unlikely(Py_TYPE(obj)->tp_dictoffset)) {
23492 return PyObject_GenericGetAttr(obj, attr_name);
23494 return __Pyx_PyObject_GenericGetAttrNoDict(obj, attr_name);
23499 static void __Pyx_PyObject_GetAttrStr_ClearAttributeError(
void) {
23500 __Pyx_PyThreadState_declare
23501 __Pyx_PyThreadState_assign
23502 if (likely(__Pyx_PyErr_ExceptionMatches(PyExc_AttributeError)))
23503 __Pyx_PyErr_Clear();
23505 static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStrNoError(PyObject* obj, PyObject* attr_name) {
23507 #if CYTHON_COMPILING_IN_CPYTHON && CYTHON_USE_TYPE_SLOTS && PY_VERSION_HEX >= 0x030700B1
23508 PyTypeObject* tp = Py_TYPE(obj);
23509 if (likely(tp->tp_getattro == PyObject_GenericGetAttr)) {
23510 return _PyObject_GenericGetAttrWithDict(obj, attr_name, NULL, 1);
23513 result = __Pyx_PyObject_GetAttrStr(obj, attr_name);
23514 if (unlikely(!result)) {
23515 __Pyx_PyObject_GetAttrStr_ClearAttributeError();
23521 static int __Pyx_setup_reduce_is_named(PyObject* meth, PyObject* name) {
23523 PyObject *name_attr;
23524 name_attr = __Pyx_PyObject_GetAttrStr(meth, __pyx_n_s_name_2);
23525 if (likely(name_attr)) {
23526 ret = PyObject_RichCompareBool(name_attr, name, Py_EQ);
23530 if (unlikely(ret < 0)) {
23534 Py_XDECREF(name_attr);
23537 static int __Pyx_setup_reduce(PyObject* type_obj) {
23539 PyObject *object_reduce = NULL;
23540 PyObject *object_getstate = NULL;
23541 PyObject *object_reduce_ex = NULL;
23542 PyObject *reduce = NULL;
23543 PyObject *reduce_ex = NULL;
23544 PyObject *reduce_cython = NULL;
23545 PyObject *setstate = NULL;
23546 PyObject *setstate_cython = NULL;
23547 PyObject *getstate = NULL;
23548 #if CYTHON_USE_PYTYPE_LOOKUP
23549 getstate = _PyType_Lookup((PyTypeObject*)type_obj, __pyx_n_s_getstate);
23551 getstate = __Pyx_PyObject_GetAttrStrNoError(type_obj, __pyx_n_s_getstate);
23552 if (!getstate && PyErr_Occurred()) {
23557 #if CYTHON_USE_PYTYPE_LOOKUP
23558 object_getstate = _PyType_Lookup(&PyBaseObject_Type, __pyx_n_s_getstate);
23560 object_getstate = __Pyx_PyObject_GetAttrStrNoError((PyObject*)&PyBaseObject_Type, __pyx_n_s_getstate);
23561 if (!object_getstate && PyErr_Occurred()) {
23565 if (object_getstate != getstate) {
23569 #if CYTHON_USE_PYTYPE_LOOKUP
23570 object_reduce_ex = _PyType_Lookup(&PyBaseObject_Type, __pyx_n_s_reduce_ex);
if (!object_reduce_ex)
goto __PYX_BAD;
23572 object_reduce_ex = __Pyx_PyObject_GetAttrStr((PyObject*)&PyBaseObject_Type, __pyx_n_s_reduce_ex);
if (!object_reduce_ex)
goto __PYX_BAD;
23574 reduce_ex = __Pyx_PyObject_GetAttrStr(type_obj, __pyx_n_s_reduce_ex);
if (unlikely(!reduce_ex))
goto __PYX_BAD;
23575 if (reduce_ex == object_reduce_ex) {
23576 #if CYTHON_USE_PYTYPE_LOOKUP
23577 object_reduce = _PyType_Lookup(&PyBaseObject_Type, __pyx_n_s_reduce);
if (!object_reduce)
goto __PYX_BAD;
23579 object_reduce = __Pyx_PyObject_GetAttrStr((PyObject*)&PyBaseObject_Type, __pyx_n_s_reduce);
if (!object_reduce)
goto __PYX_BAD;
23581 reduce = __Pyx_PyObject_GetAttrStr(type_obj, __pyx_n_s_reduce);
if (unlikely(!reduce))
goto __PYX_BAD;
23582 if (reduce == object_reduce || __Pyx_setup_reduce_is_named(reduce, __pyx_n_s_reduce_cython)) {
23583 reduce_cython = __Pyx_PyObject_GetAttrStrNoError(type_obj, __pyx_n_s_reduce_cython);
23584 if (likely(reduce_cython)) {
23585 ret = PyDict_SetItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_reduce, reduce_cython);
if (unlikely(ret < 0))
goto __PYX_BAD;
23586 ret = PyDict_DelItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_reduce_cython);
if (unlikely(ret < 0))
goto __PYX_BAD;
23587 }
else if (reduce == object_reduce || PyErr_Occurred()) {
23590 setstate = __Pyx_PyObject_GetAttrStr(type_obj, __pyx_n_s_setstate);
23591 if (!setstate) PyErr_Clear();
23592 if (!setstate || __Pyx_setup_reduce_is_named(setstate, __pyx_n_s_setstate_cython)) {
23593 setstate_cython = __Pyx_PyObject_GetAttrStrNoError(type_obj, __pyx_n_s_setstate_cython);
23594 if (likely(setstate_cython)) {
23595 ret = PyDict_SetItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_setstate, setstate_cython);
if (unlikely(ret < 0))
goto __PYX_BAD;
23596 ret = PyDict_DelItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_setstate_cython);
if (unlikely(ret < 0))
goto __PYX_BAD;
23597 }
else if (!setstate || PyErr_Occurred()) {
23601 PyType_Modified((PyTypeObject*)type_obj);
23606 if (!PyErr_Occurred())
23607 PyErr_Format(PyExc_RuntimeError,
"Unable to initialize pickling for %s", ((PyTypeObject*)type_obj)->tp_name);
23610 #if !CYTHON_USE_PYTYPE_LOOKUP
23611 Py_XDECREF(object_reduce);
23612 Py_XDECREF(object_reduce_ex);
23613 Py_XDECREF(object_getstate);
23614 Py_XDECREF(getstate);
23616 Py_XDECREF(reduce);
23617 Py_XDECREF(reduce_ex);
23618 Py_XDECREF(reduce_cython);
23619 Py_XDECREF(setstate);
23620 Py_XDECREF(setstate_cython);
23625 static int __Pyx_SetVtable(PyObject *dict,
void *vtable) {
23626 #if PY_VERSION_HEX >= 0x02070000
23627 PyObject *ob = PyCapsule_New(vtable, 0, 0);
23629 PyObject *ob = PyCObject_FromVoidPtr(vtable, 0);
23633 if (PyDict_SetItem(dict, __pyx_n_s_pyx_vtable, ob) < 0)
23643 #ifndef __PYX_HAVE_RT_ImportType
23644 #define __PYX_HAVE_RT_ImportType
23645 static PyTypeObject *__Pyx_ImportType(PyObject *module,
const char *module_name,
const char *class_name,
23646 size_t size,
enum __Pyx_ImportType_CheckSize check_size)
23648 PyObject *result = 0;
23650 Py_ssize_t basicsize;
23651 #ifdef Py_LIMITED_API
23652 PyObject *py_basicsize;
23654 result = PyObject_GetAttrString(module, class_name);
23657 if (!PyType_Check(result)) {
23658 PyErr_Format(PyExc_TypeError,
23659 "%.200s.%.200s is not a type object",
23660 module_name, class_name);
23663 #ifndef Py_LIMITED_API
23664 basicsize = ((PyTypeObject *)result)->tp_basicsize;
23666 py_basicsize = PyObject_GetAttrString(result,
"__basicsize__");
23669 basicsize = PyLong_AsSsize_t(py_basicsize);
23670 Py_DECREF(py_basicsize);
23672 if (basicsize == (Py_ssize_t)-1 && PyErr_Occurred())
23675 if ((
size_t)basicsize < size) {
23676 PyErr_Format(PyExc_ValueError,
23677 "%.200s.%.200s size changed, may indicate binary incompatibility. "
23678 "Expected %zd from C header, got %zd from PyObject",
23679 module_name, class_name, size, basicsize);
23682 if (check_size == __Pyx_ImportType_CheckSize_Error && (
size_t)basicsize != size) {
23683 PyErr_Format(PyExc_ValueError,
23684 "%.200s.%.200s size changed, may indicate binary incompatibility. "
23685 "Expected %zd from C header, got %zd from PyObject",
23686 module_name, class_name, size, basicsize);
23689 else if (check_size == __Pyx_ImportType_CheckSize_Warn && (
size_t)basicsize > size) {
23690 PyOS_snprintf(warning,
sizeof(warning),
23691 "%s.%s size changed, may indicate binary incompatibility. "
23692 "Expected %zd from C header, got %zd from PyObject",
23693 module_name, class_name, size, basicsize);
23694 if (PyErr_WarnEx(NULL, warning, 0) < 0)
goto bad;
23696 return (PyTypeObject *)result;
23698 Py_XDECREF(result);
23704 #ifndef CYTHON_CLINE_IN_TRACEBACK
23705 static int __Pyx_CLineForTraceback(CYTHON_NCP_UNUSED PyThreadState *tstate,
int c_line) {
23706 PyObject *use_cline;
23707 PyObject *ptype, *pvalue, *ptraceback;
23708 #if CYTHON_COMPILING_IN_CPYTHON
23709 PyObject **cython_runtime_dict;
23711 if (unlikely(!__pyx_cython_runtime)) {
23714 __Pyx_ErrFetchInState(tstate, &ptype, &pvalue, &ptraceback);
23715 #if CYTHON_COMPILING_IN_CPYTHON
23716 cython_runtime_dict = _PyObject_GetDictPtr(__pyx_cython_runtime);
23717 if (likely(cython_runtime_dict)) {
23718 __PYX_PY_DICT_LOOKUP_IF_MODIFIED(
23719 use_cline, *cython_runtime_dict,
23720 __Pyx_PyDict_GetItemStr(*cython_runtime_dict, __pyx_n_s_cline_in_traceback))
23724 PyObject *use_cline_obj = __Pyx_PyObject_GetAttrStr(__pyx_cython_runtime, __pyx_n_s_cline_in_traceback);
23725 if (use_cline_obj) {
23726 use_cline = PyObject_Not(use_cline_obj) ? Py_False : Py_True;
23727 Py_DECREF(use_cline_obj);
23735 (void) PyObject_SetAttr(__pyx_cython_runtime, __pyx_n_s_cline_in_traceback, Py_False);
23737 else if (use_cline == Py_False || (use_cline != Py_True && PyObject_Not(use_cline) != 0)) {
23740 __Pyx_ErrRestoreInState(tstate, ptype, pvalue, ptraceback);
23746 static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries,
int count,
int code_line) {
23747 int start = 0, mid = 0, end = count - 1;
23748 if (end >= 0 && code_line > entries[end].code_line) {
23751 while (start < end) {
23752 mid = start + (end - start) / 2;
23753 if (code_line < entries[mid].code_line) {
23755 }
else if (code_line > entries[mid].code_line) {
23761 if (code_line <= entries[mid].code_line) {
23767 static PyCodeObject *__pyx_find_code_object(
int code_line) {
23768 PyCodeObject* code_object;
23770 if (unlikely(!code_line) || unlikely(!__pyx_code_cache.entries)) {
23773 pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line);
23774 if (unlikely(
pos >= __pyx_code_cache.count) || unlikely(__pyx_code_cache.entries[
pos].code_line != code_line)) {
23777 code_object = __pyx_code_cache.entries[
pos].code_object;
23778 Py_INCREF(code_object);
23779 return code_object;
23781 static void __pyx_insert_code_object(
int code_line, PyCodeObject* code_object) {
23783 __Pyx_CodeObjectCacheEntry* entries = __pyx_code_cache.entries;
23784 if (unlikely(!code_line)) {
23787 if (unlikely(!entries)) {
23788 entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Malloc(64*
sizeof(__Pyx_CodeObjectCacheEntry));
23789 if (likely(entries)) {
23790 __pyx_code_cache.entries = entries;
23791 __pyx_code_cache.max_count = 64;
23792 __pyx_code_cache.count = 1;
23793 entries[0].code_line = code_line;
23794 entries[0].code_object = code_object;
23795 Py_INCREF(code_object);
23799 pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line);
23800 if ((
pos < __pyx_code_cache.count) && unlikely(__pyx_code_cache.entries[
pos].code_line == code_line)) {
23801 PyCodeObject* tmp = entries[
pos].code_object;
23802 entries[
pos].code_object = code_object;
23806 if (__pyx_code_cache.count == __pyx_code_cache.max_count) {
23807 int new_max = __pyx_code_cache.max_count + 64;
23808 entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Realloc(
23809 __pyx_code_cache.entries, ((
size_t)new_max) *
sizeof(__Pyx_CodeObjectCacheEntry));
23810 if (unlikely(!entries)) {
23813 __pyx_code_cache.entries = entries;
23814 __pyx_code_cache.max_count = new_max;
23816 for (i=__pyx_code_cache.count; i>
pos; i--) {
23817 entries[i] = entries[i-1];
23819 entries[
pos].code_line = code_line;
23820 entries[
pos].code_object = code_object;
23821 __pyx_code_cache.count++;
23822 Py_INCREF(code_object);
23826 #include "compile.h"
23827 #include "frameobject.h"
23828 #include "traceback.h"
23829 #if PY_VERSION_HEX >= 0x030b00a6
23830 #ifndef Py_BUILD_CORE
23831 #define Py_BUILD_CORE 1
23833 #include "internal/pycore_frame.h"
23835 static PyCodeObject* __Pyx_CreateCodeObjectForTraceback(
23836 const char *funcname,
int c_line,
23837 int py_line,
const char *filename) {
23838 PyCodeObject *py_code = NULL;
23839 PyObject *py_funcname = NULL;
23840 #if PY_MAJOR_VERSION < 3
23841 PyObject *py_srcfile = NULL;
23842 py_srcfile = PyString_FromString(filename);
23843 if (!py_srcfile)
goto bad;
23846 #if PY_MAJOR_VERSION < 3
23847 py_funcname = PyString_FromFormat(
"%s (%s:%d)", funcname, __pyx_cfilenm, c_line);
23848 if (!py_funcname)
goto bad;
23850 py_funcname = PyUnicode_FromFormat(
"%s (%s:%d)", funcname, __pyx_cfilenm, c_line);
23851 if (!py_funcname)
goto bad;
23852 funcname = PyUnicode_AsUTF8(py_funcname);
23853 if (!funcname)
goto bad;
23857 #if PY_MAJOR_VERSION < 3
23858 py_funcname = PyString_FromString(funcname);
23859 if (!py_funcname)
goto bad;
23862 #if PY_MAJOR_VERSION < 3
23863 py_code = __Pyx_PyCode_New(
23880 Py_DECREF(py_srcfile);
23882 py_code = PyCode_NewEmpty(filename, funcname, py_line);
23884 Py_XDECREF(py_funcname);
23887 Py_XDECREF(py_funcname);
23888 #if PY_MAJOR_VERSION < 3
23889 Py_XDECREF(py_srcfile);
23893 static void __Pyx_AddTraceback(
const char *funcname,
int c_line,
23894 int py_line,
const char *filename) {
23895 PyCodeObject *py_code = 0;
23896 PyFrameObject *py_frame = 0;
23897 PyThreadState *tstate = __Pyx_PyThreadState_Current;
23898 PyObject *ptype, *pvalue, *ptraceback;
23900 c_line = __Pyx_CLineForTraceback(tstate, c_line);
23902 py_code = __pyx_find_code_object(c_line ? -c_line : py_line);
23904 __Pyx_ErrFetchInState(tstate, &ptype, &pvalue, &ptraceback);
23905 py_code = __Pyx_CreateCodeObjectForTraceback(
23906 funcname, c_line, py_line, filename);
23911 Py_XDECREF(pvalue);
23912 Py_XDECREF(ptraceback);
23915 __Pyx_ErrRestoreInState(tstate, ptype, pvalue, ptraceback);
23916 __pyx_insert_code_object(c_line ? -c_line : py_line, py_code);
23918 py_frame = PyFrame_New(
23924 if (!py_frame)
goto bad;
23925 __Pyx_PyFrame_SetLineNumber(py_frame, py_line);
23926 PyTraceBack_Here(py_frame);
23928 Py_XDECREF(py_code);
23929 Py_XDECREF(py_frame);
23933 #define __PYX_VERIFY_RETURN_INT(target_type, func_type, func_value)\
23934 __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 0)
23935 #define __PYX_VERIFY_RETURN_INT_EXC(target_type, func_type, func_value)\
23936 __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 1)
23937 #define __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, exc)\
23939 func_type value = func_value;\
23940 if (sizeof(target_type) < sizeof(func_type)) {\
23941 if (unlikely(value != (func_type) (target_type) value)) {\
23942 func_type zero = 0;\
23943 if (exc && unlikely(value == (func_type)-1 && PyErr_Occurred()))\
23944 return (target_type) -1;\
23945 if (is_unsigned && unlikely(value < zero))\
23946 goto raise_neg_overflow;\
23948 goto raise_overflow;\
23951 return (target_type) value;\
23955 static CYTHON_INLINE PyObject *__pyx_memview_get_double(
const char *itemp) {
23956 return (PyObject *) PyFloat_FromDouble(*(
double *) itemp);
23958 static CYTHON_INLINE
int __pyx_memview_set_double(
const char *itemp, PyObject *obj) {
23959 double value = __pyx_PyFloat_AsDouble(obj);
23960 if ((value == (
double)-1) && PyErr_Occurred())
23962 *(
double *) itemp = value;
23967 #if CYTHON_CCOMPLEX
23969 static CYTHON_INLINE __pyx_t_float_complex __pyx_t_float_complex_from_parts(
float x,
float y) {
23970 return ::std::complex< float >(x, y);
23973 static CYTHON_INLINE __pyx_t_float_complex __pyx_t_float_complex_from_parts(
float x,
float y) {
23974 return x + y*(__pyx_t_float_complex)_Complex_I;
23978 static CYTHON_INLINE __pyx_t_float_complex __pyx_t_float_complex_from_parts(
float x,
float y) {
23979 __pyx_t_float_complex
z;
23987 #if CYTHON_CCOMPLEX
23989 static CYTHON_INLINE
int __Pyx_c_eq_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
23990 return (a.real == b.real) && (a.imag == b.imag);
23992 static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_sum_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
23993 __pyx_t_float_complex
z;
23994 z.real = a.real + b.real;
23995 z.imag = a.imag + b.imag;
23998 static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_diff_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
23999 __pyx_t_float_complex
z;
24000 z.real = a.real - b.real;
24001 z.imag = a.imag - b.imag;
24004 static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_prod_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
24005 __pyx_t_float_complex
z;
24006 z.real = a.real * b.real - a.imag * b.imag;
24007 z.imag = a.real * b.imag + a.imag * b.real;
24011 static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_quot_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
24013 return __pyx_t_float_complex_from_parts(a.real / b.real, a.imag / b.real);
24014 }
else if (fabsf(b.real) >= fabsf(b.imag)) {
24015 if (b.real == 0 && b.imag == 0) {
24016 return __pyx_t_float_complex_from_parts(a.real / b.real, a.imag / b.imag);
24018 float r = b.imag / b.real;
24019 float s = (float)(1.0) / (b.real + b.imag *
r);
24020 return __pyx_t_float_complex_from_parts(
24021 (a.real + a.imag *
r) *
s, (a.imag - a.real *
r) *
s);
24024 float r = b.real / b.imag;
24025 float s = (float)(1.0) / (b.imag + b.real *
r);
24026 return __pyx_t_float_complex_from_parts(
24027 (a.real *
r + a.imag) *
s, (a.imag *
r - a.real) *
s);
24031 static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_quot_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
24033 return __pyx_t_float_complex_from_parts(a.real / b.real, a.imag / b.real);
24035 float denom = b.real * b.real + b.imag * b.imag;
24036 return __pyx_t_float_complex_from_parts(
24037 (a.real * b.real + a.imag * b.imag) / denom,
24038 (a.imag * b.real - a.real * b.imag) / denom);
24042 static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_neg_float(__pyx_t_float_complex a) {
24043 __pyx_t_float_complex
z;
24048 static CYTHON_INLINE
int __Pyx_c_is_zero_float(__pyx_t_float_complex a) {
24049 return (a.real == 0) && (a.imag == 0);
24051 static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_conj_float(__pyx_t_float_complex a) {
24052 __pyx_t_float_complex
z;
24058 static CYTHON_INLINE
float __Pyx_c_abs_float(__pyx_t_float_complex
z) {
24059 #if !defined(HAVE_HYPOT) || defined(_MSC_VER)
24060 return sqrtf(
z.real*
z.real +
z.imag*
z.imag);
24062 return hypotf(
z.real,
z.imag);
24065 static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_pow_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
24066 __pyx_t_float_complex
z;
24067 float r, lnr, theta, z_r, z_theta;
24068 if (b.imag == 0 && b.real == (
int)b.real) {
24070 float denom = a.real * a.real + a.imag * a.imag;
24071 a.real = a.real / denom;
24072 a.imag = -a.imag / denom;
24075 switch ((
int)b.real) {
24083 return __Pyx_c_prod_float(a, a);
24085 z = __Pyx_c_prod_float(a, a);
24086 return __Pyx_c_prod_float(
z, a);
24088 z = __Pyx_c_prod_float(a, a);
24089 return __Pyx_c_prod_float(
z,
z);
24095 }
else if (b.imag == 0) {
24096 z.real = powf(a.real, b.real);
24099 }
else if (a.real > 0) {
24104 theta = atan2f(0.0, -1.0);
24107 r = __Pyx_c_abs_float(a);
24108 theta = atan2f(a.imag, a.real);
24111 z_r = expf(lnr * b.real - theta * b.imag);
24112 z_theta = theta * b.real + lnr * b.imag;
24113 z.real = z_r * cosf(z_theta);
24114 z.imag = z_r * sinf(z_theta);
24121 #if CYTHON_CCOMPLEX
24123 static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(
double x,
double y) {
24124 return ::std::complex< double >(x, y);
24127 static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(
double x,
double y) {
24128 return x + y*(__pyx_t_double_complex)_Complex_I;
24132 static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(
double x,
double y) {
24133 __pyx_t_double_complex
z;
24141 #if CYTHON_CCOMPLEX
24143 static CYTHON_INLINE
int __Pyx_c_eq_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
24144 return (a.real == b.real) && (a.imag == b.imag);
24146 static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_sum_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
24147 __pyx_t_double_complex
z;
24148 z.real = a.real + b.real;
24149 z.imag = a.imag + b.imag;
24152 static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_diff_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
24153 __pyx_t_double_complex
z;
24154 z.real = a.real - b.real;
24155 z.imag = a.imag - b.imag;
24158 static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_prod_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
24159 __pyx_t_double_complex
z;
24160 z.real = a.real * b.real - a.imag * b.imag;
24161 z.imag = a.real * b.imag + a.imag * b.real;
24165 static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_quot_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
24167 return __pyx_t_double_complex_from_parts(a.real / b.real, a.imag / b.real);
24168 }
else if (fabs(b.real) >= fabs(b.imag)) {
24169 if (b.real == 0 && b.imag == 0) {
24170 return __pyx_t_double_complex_from_parts(a.real / b.real, a.imag / b.imag);
24172 double r = b.imag / b.real;
24173 double s = (double)(1.0) / (b.real + b.imag *
r);
24174 return __pyx_t_double_complex_from_parts(
24175 (a.real + a.imag *
r) *
s, (a.imag - a.real *
r) *
s);
24178 double r = b.real / b.imag;
24179 double s = (double)(1.0) / (b.imag + b.real *
r);
24180 return __pyx_t_double_complex_from_parts(
24181 (a.real *
r + a.imag) *
s, (a.imag *
r - a.real) *
s);
24185 static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_quot_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
24187 return __pyx_t_double_complex_from_parts(a.real / b.real, a.imag / b.real);
24189 double denom = b.real * b.real + b.imag * b.imag;
24190 return __pyx_t_double_complex_from_parts(
24191 (a.real * b.real + a.imag * b.imag) / denom,
24192 (a.imag * b.real - a.real * b.imag) / denom);
24196 static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_neg_double(__pyx_t_double_complex a) {
24197 __pyx_t_double_complex
z;
24202 static CYTHON_INLINE
int __Pyx_c_is_zero_double(__pyx_t_double_complex a) {
24203 return (a.real == 0) && (a.imag == 0);
24205 static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_conj_double(__pyx_t_double_complex a) {
24206 __pyx_t_double_complex
z;
24212 static CYTHON_INLINE
double __Pyx_c_abs_double(__pyx_t_double_complex
z) {
24213 #if !defined(HAVE_HYPOT) || defined(_MSC_VER)
24214 return sqrt(
z.real*
z.real +
z.imag*
z.imag);
24216 return hypot(
z.real,
z.imag);
24219 static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_pow_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
24220 __pyx_t_double_complex
z;
24221 double r, lnr, theta, z_r, z_theta;
24222 if (b.imag == 0 && b.real == (
int)b.real) {
24224 double denom = a.real * a.real + a.imag * a.imag;
24225 a.real = a.real / denom;
24226 a.imag = -a.imag / denom;
24229 switch ((
int)b.real) {
24237 return __Pyx_c_prod_double(a, a);
24239 z = __Pyx_c_prod_double(a, a);
24240 return __Pyx_c_prod_double(
z, a);
24242 z = __Pyx_c_prod_double(a, a);
24243 return __Pyx_c_prod_double(
z,
z);
24249 }
else if (b.imag == 0) {
24250 z.real = pow(a.real, b.real);
24253 }
else if (a.real > 0) {
24258 theta = atan2(0.0, -1.0);
24261 r = __Pyx_c_abs_double(a);
24262 theta = atan2(a.imag, a.real);
24265 z_r = exp(lnr * b.real - theta * b.imag);
24266 z_theta = theta * b.real + lnr * b.imag;
24267 z.real = z_r * cos(z_theta);
24268 z.imag = z_r * sin(z_theta);
24274 #if PY_MAJOR_VERSION < 3
24275 static int __Pyx_GetBuffer(PyObject *obj, Py_buffer *view,
int flags) {
24276 if (PyObject_CheckBuffer(obj))
return PyObject_GetBuffer(obj, view, flags);
24277 if (__Pyx_TypeCheck(obj, __pyx_array_type))
return __pyx_array_getbuffer(obj, view, flags);
24278 if (__Pyx_TypeCheck(obj, __pyx_memoryview_type))
return __pyx_memoryview_getbuffer(obj, view, flags);
24279 PyErr_Format(PyExc_TypeError,
"'%.200s' does not have the buffer interface", Py_TYPE(obj)->tp_name);
24282 static void __Pyx_ReleaseBuffer(Py_buffer *view) {
24283 PyObject *obj = view->obj;
24285 if (PyObject_CheckBuffer(obj)) {
24286 PyBuffer_Release(view);
24298 __pyx_memviewslice_is_contig(
const __Pyx_memviewslice mvs,
char order,
int ndim)
24300 int i, index, step, start;
24301 Py_ssize_t itemsize = mvs.memview->view.itemsize;
24302 if (order ==
'F') {
24309 for (i = 0; i < ndim; i++) {
24310 index = start + step * i;
24311 if (mvs.suboffsets[index] >= 0 || mvs.strides[index] != itemsize)
24313 itemsize *= mvs.shape[index];
24320 __pyx_get_array_memory_extents(__Pyx_memviewslice *slice,
24321 void **out_start,
void **out_end,
24322 int ndim,
size_t itemsize)
24326 start = end = slice->data;
24327 for (i = 0; i < ndim; i++) {
24328 Py_ssize_t stride = slice->strides[i];
24329 Py_ssize_t extent = slice->shape[i];
24331 *out_start = *out_end = start;
24335 end += stride * (extent - 1);
24337 start += stride * (extent - 1);
24340 *out_start = start;
24341 *out_end = end + itemsize;
24344 __pyx_slices_overlap(__Pyx_memviewslice *slice1,
24345 __Pyx_memviewslice *slice2,
24346 int ndim,
size_t itemsize)
24348 void *start1, *end1, *start2, *end2;
24349 __pyx_get_array_memory_extents(slice1, &start1, &end1, ndim, itemsize);
24350 __pyx_get_array_memory_extents(slice2, &start2, &end2, ndim, itemsize);
24351 return (start1 < end2) && (start2 < end1);
24355 static CYTHON_INLINE PyObject *
24356 __pyx_capsule_create(
void *p, CYTHON_UNUSED
const char *sig)
24359 #if PY_VERSION_HEX >= 0x02070000
24360 cobj = PyCapsule_New(p, sig, NULL);
24362 cobj = PyCObject_FromVoidPtr(p, NULL);
24368 static CYTHON_INLINE
int __Pyx_PyInt_As_int(PyObject *x) {
24369 #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
24370 #pragma GCC diagnostic push
24371 #pragma GCC diagnostic ignored "-Wconversion"
24373 const int neg_one = (int) -1, const_zero = (
int) 0;
24374 #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
24375 #pragma GCC diagnostic pop
24377 const int is_unsigned = neg_one > const_zero;
24378 #if PY_MAJOR_VERSION < 3
24379 if (likely(PyInt_Check(x))) {
24380 if (
sizeof(
int) <
sizeof(long)) {
24381 __PYX_VERIFY_RETURN_INT(
int,
long, PyInt_AS_LONG(x))
24383 long val = PyInt_AS_LONG(x);
24384 if (is_unsigned && unlikely(val < 0)) {
24385 goto raise_neg_overflow;
24391 if (likely(PyLong_Check(x))) {
24393 #if CYTHON_USE_PYLONG_INTERNALS
24394 const digit* digits = ((PyLongObject*)x)->ob_digit;
24395 switch (Py_SIZE(x)) {
24396 case 0:
return (
int) 0;
24397 case 1: __PYX_VERIFY_RETURN_INT(
int, digit, digits[0])
24399 if (8 *
sizeof(
int) > 1 * PyLong_SHIFT) {
24400 if (8 *
sizeof(
unsigned long) > 2 * PyLong_SHIFT) {
24401 __PYX_VERIFY_RETURN_INT(
int,
unsigned long, (((((
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
24402 }
else if (8 *
sizeof(
int) >= 2 * PyLong_SHIFT) {
24403 return (
int) (((((int)digits[1]) << PyLong_SHIFT) | (
int)digits[0]));
24408 if (8 *
sizeof(
int) > 2 * PyLong_SHIFT) {
24409 if (8 *
sizeof(
unsigned long) > 3 * PyLong_SHIFT) {
24410 __PYX_VERIFY_RETURN_INT(
int,
unsigned long, (((((((
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
24411 }
else if (8 *
sizeof(
int) >= 3 * PyLong_SHIFT) {
24412 return (
int) (((((((int)digits[2]) << PyLong_SHIFT) | (
int)digits[1]) << PyLong_SHIFT) | (int)digits[0]));
24417 if (8 *
sizeof(
int) > 3 * PyLong_SHIFT) {
24418 if (8 *
sizeof(
unsigned long) > 4 * PyLong_SHIFT) {
24419 __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])))
24420 }
else if (8 *
sizeof(
int) >= 4 * PyLong_SHIFT) {
24421 return (
int) (((((((((int)digits[3]) << PyLong_SHIFT) | (
int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (
int)digits[0]));
24427 #if CYTHON_COMPILING_IN_CPYTHON
24428 if (unlikely(Py_SIZE(x) < 0)) {
24429 goto raise_neg_overflow;
24433 int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
24434 if (unlikely(result < 0))
24436 if (unlikely(result == 1))
24437 goto raise_neg_overflow;
24440 if (
sizeof(
int) <=
sizeof(
unsigned long)) {
24441 __PYX_VERIFY_RETURN_INT_EXC(
int,
unsigned long, PyLong_AsUnsignedLong(x))
24442 #ifdef HAVE_LONG_LONG
24443 }
else if (
sizeof(
int) <=
sizeof(
unsigned PY_LONG_LONG)) {
24444 __PYX_VERIFY_RETURN_INT_EXC(
int,
unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
24448 #if CYTHON_USE_PYLONG_INTERNALS
24449 const digit* digits = ((PyLongObject*)x)->ob_digit;
24450 switch (Py_SIZE(x)) {
24451 case 0:
return (
int) 0;
24452 case -1: __PYX_VERIFY_RETURN_INT(
int, sdigit, (sdigit) (-(sdigit)digits[0]))
24453 case 1: __PYX_VERIFY_RETURN_INT(
int, digit, +digits[0])
24455 if (8 *
sizeof(
int) - 1 > 1 * PyLong_SHIFT) {
24456 if (8 *
sizeof(
unsigned long) > 2 * PyLong_SHIFT) {
24457 __PYX_VERIFY_RETURN_INT(
int,
long, -(
long) (((((
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
24458 }
else if (8 *
sizeof(
int) - 1 > 2 * PyLong_SHIFT) {
24459 return (
int) (((int)-1)*(((((int)digits[1]) << PyLong_SHIFT) | (
int)digits[0])));
24464 if (8 *
sizeof(
int) > 1 * PyLong_SHIFT) {
24465 if (8 *
sizeof(
unsigned long) > 2 * PyLong_SHIFT) {
24466 __PYX_VERIFY_RETURN_INT(
int,
unsigned long, (((((
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
24467 }
else if (8 *
sizeof(
int) - 1 > 2 * PyLong_SHIFT) {
24468 return (
int) ((((((int)digits[1]) << PyLong_SHIFT) | (
int)digits[0])));
24473 if (8 *
sizeof(
int) - 1 > 2 * PyLong_SHIFT) {
24474 if (8 *
sizeof(
unsigned long) > 3 * PyLong_SHIFT) {
24475 __PYX_VERIFY_RETURN_INT(
int,
long, -(
long) (((((((
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
24476 }
else if (8 *
sizeof(
int) - 1 > 3 * PyLong_SHIFT) {
24477 return (
int) (((int)-1)*(((((((int)digits[2]) << PyLong_SHIFT) | (
int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
24482 if (8 *
sizeof(
int) > 2 * PyLong_SHIFT) {
24483 if (8 *
sizeof(
unsigned long) > 3 * PyLong_SHIFT) {
24484 __PYX_VERIFY_RETURN_INT(
int,
unsigned long, (((((((
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
24485 }
else if (8 *
sizeof(
int) - 1 > 3 * PyLong_SHIFT) {
24486 return (
int) ((((((((int)digits[2]) << PyLong_SHIFT) | (
int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
24491 if (8 *
sizeof(
int) - 1 > 3 * PyLong_SHIFT) {
24492 if (8 *
sizeof(
unsigned long) > 4 * PyLong_SHIFT) {
24493 __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])))
24494 }
else if (8 *
sizeof(
int) - 1 > 4 * PyLong_SHIFT) {
24495 return (
int) (((int)-1)*(((((((((int)digits[3]) << PyLong_SHIFT) | (
int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (
int)digits[0])));
24500 if (8 *
sizeof(
int) > 3 * PyLong_SHIFT) {
24501 if (8 *
sizeof(
unsigned long) > 4 * PyLong_SHIFT) {
24502 __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])))
24503 }
else if (8 *
sizeof(
int) - 1 > 4 * PyLong_SHIFT) {
24504 return (
int) ((((((((((int)digits[3]) << PyLong_SHIFT) | (
int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (
int)digits[0])));
24510 if (
sizeof(
int) <=
sizeof(long)) {
24511 __PYX_VERIFY_RETURN_INT_EXC(
int,
long, PyLong_AsLong(x))
24512 #ifdef HAVE_LONG_LONG
24513 }
else if (
sizeof(
int) <=
sizeof(PY_LONG_LONG)) {
24514 __PYX_VERIFY_RETURN_INT_EXC(
int, PY_LONG_LONG, PyLong_AsLongLong(x))
24519 #if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray)
24520 PyErr_SetString(PyExc_RuntimeError,
24521 "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers");
24524 PyObject *
v = __Pyx_PyNumber_IntOrLong(x);
24525 #if PY_MAJOR_VERSION < 3
24526 if (likely(
v) && !PyLong_Check(
v)) {
24528 v = PyNumber_Long(tmp);
24533 int one = 1;
int is_little = (int)*(
unsigned char *)&one;
24534 unsigned char *bytes = (
unsigned char *)&val;
24535 int ret = _PyLong_AsByteArray((PyLongObject *)
v,
24536 bytes,
sizeof(val),
24537 is_little, !is_unsigned);
24547 PyObject *tmp = __Pyx_PyNumber_IntOrLong(x);
24548 if (!tmp)
return (
int) -1;
24549 val = __Pyx_PyInt_As_int(tmp);
24554 PyErr_SetString(PyExc_OverflowError,
24555 "value too large to convert to int");
24557 raise_neg_overflow:
24558 PyErr_SetString(PyExc_OverflowError,
24559 "can't convert negative value to int");
24564 static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(
int value) {
24565 #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
24566 #pragma GCC diagnostic push
24567 #pragma GCC diagnostic ignored "-Wconversion"
24569 const int neg_one = (int) -1, const_zero = (
int) 0;
24570 #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
24571 #pragma GCC diagnostic pop
24573 const int is_unsigned = neg_one > const_zero;
24575 if (
sizeof(
int) <
sizeof(long)) {
24576 return PyInt_FromLong((
long) value);
24577 }
else if (
sizeof(
int) <=
sizeof(
unsigned long)) {
24578 return PyLong_FromUnsignedLong((
unsigned long) value);
24579 #ifdef HAVE_LONG_LONG
24580 }
else if (
sizeof(
int) <=
sizeof(
unsigned PY_LONG_LONG)) {
24581 return PyLong_FromUnsignedLongLong((
unsigned PY_LONG_LONG) value);
24585 if (
sizeof(
int) <=
sizeof(
long)) {
24586 return PyInt_FromLong((
long) value);
24587 #ifdef HAVE_LONG_LONG
24588 }
else if (
sizeof(
int) <=
sizeof(PY_LONG_LONG)) {
24589 return PyLong_FromLongLong((PY_LONG_LONG) value);
24594 int one = 1;
int little = (int)*(
unsigned char *)&one;
24595 unsigned char *bytes = (
unsigned char *)&value;
24596 return _PyLong_FromByteArray(bytes,
sizeof(
int),
24597 little, !is_unsigned);
24602 static struct __pyx_typeinfo_string __Pyx_TypeInfoToFormat(__Pyx_TypeInfo *type) {
24603 struct __pyx_typeinfo_string result = { {0} };
24604 char *buf = (
char *) result.string;
24605 size_t size = type->size;
24606 switch (type->typegroup) {
24613 *buf = (type->is_unsigned) ?
'B' :
'b';
24614 else if (size == 2)
24615 *buf = (type->is_unsigned) ?
'H' :
'h';
24616 else if (size == 4)
24617 *buf = (type->is_unsigned) ?
'I' :
'i';
24618 else if (size == 8)
24619 *buf = (type->is_unsigned) ?
'Q' :
'q';
24626 __Pyx_TypeInfo complex_type = *type;
24627 complex_type.typegroup =
'R';
24628 complex_type.size /= 2;
24630 *buf = __Pyx_TypeInfoToFormat(&complex_type).string[0];
24636 else if (size == 8)
24646 static __Pyx_memviewslice
24647 __pyx_memoryview_copy_new_contig(
const __Pyx_memviewslice *from_mvs,
24648 const char *mode,
int ndim,
24649 size_t sizeof_dtype,
int contig_flag,
24650 int dtype_is_object)
24652 __Pyx_RefNannyDeclarations
24654 __Pyx_memviewslice new_mvs = { 0, 0, { 0 }, { 0 }, { 0 } };
24655 struct __pyx_memoryview_obj *from_memview = from_mvs->memview;
24656 Py_buffer *buf = &from_memview->view;
24657 PyObject *shape_tuple = NULL;
24658 PyObject *temp_int = NULL;
24659 struct __pyx_array_obj *array_obj = NULL;
24660 struct __pyx_memoryview_obj *memview_obj = NULL;
24661 __Pyx_RefNannySetupContext(
"__pyx_memoryview_copy_new_contig", 0);
24662 for (i = 0; i < ndim; i++) {
24663 if (unlikely(from_mvs->suboffsets[i] >= 0)) {
24664 PyErr_Format(PyExc_ValueError,
"Cannot copy memoryview slice with "
24665 "indirect dimensions (axis %d)", i);
24669 shape_tuple = PyTuple_New(ndim);
24670 if (unlikely(!shape_tuple)) {
24673 __Pyx_GOTREF(shape_tuple);
24674 for(i = 0; i < ndim; i++) {
24675 temp_int = PyInt_FromSsize_t(from_mvs->shape[i]);
24676 if(unlikely(!temp_int)) {
24679 PyTuple_SET_ITEM(shape_tuple, i, temp_int);
24683 array_obj = __pyx_array_new(shape_tuple, sizeof_dtype, buf->format, (
char *) mode, NULL);
24684 if (unlikely(!array_obj)) {
24687 __Pyx_GOTREF(array_obj);
24688 memview_obj = (
struct __pyx_memoryview_obj *) __pyx_memoryview_new(
24689 (PyObject *) array_obj, contig_flag,
24691 from_mvs->memview->typeinfo);
24692 if (unlikely(!memview_obj))
24694 if (unlikely(__Pyx_init_memviewslice(memview_obj, ndim, &new_mvs, 1) < 0))
24696 if (unlikely(__pyx_memoryview_copy_contents(*from_mvs, new_mvs, ndim, ndim,
24697 dtype_is_object) < 0))
24701 __Pyx_XDECREF(new_mvs.memview);
24702 new_mvs.memview = NULL;
24703 new_mvs.data = NULL;
24705 __Pyx_XDECREF(shape_tuple);
24706 __Pyx_XDECREF(temp_int);
24707 __Pyx_XDECREF(array_obj);
24708 __Pyx_RefNannyFinishContext();
24714 __Pyx_init_memviewslice(
struct __pyx_memoryview_obj *memview,
24716 __Pyx_memviewslice *memviewslice,
24717 int memview_is_new_reference)
24719 __Pyx_RefNannyDeclarations
24721 Py_buffer *buf = &memview->view;
24722 __Pyx_RefNannySetupContext(
"init_memviewslice", 0);
24723 if (unlikely(memviewslice->memview || memviewslice->data)) {
24724 PyErr_SetString(PyExc_ValueError,
24725 "memviewslice is already initialized!");
24728 if (buf->strides) {
24729 for (i = 0; i < ndim; i++) {
24730 memviewslice->strides[i] = buf->strides[i];
24733 Py_ssize_t stride = buf->itemsize;
24734 for (i = ndim - 1; i >= 0; i--) {
24735 memviewslice->strides[i] = stride;
24736 stride *= buf->shape[i];
24739 for (i = 0; i < ndim; i++) {
24740 memviewslice->shape[i] = buf->shape[i];
24741 if (buf->suboffsets) {
24742 memviewslice->suboffsets[i] = buf->suboffsets[i];
24744 memviewslice->suboffsets[i] = -1;
24747 memviewslice->memview = memview;
24748 memviewslice->data = (
char *)buf->buf;
24749 if (__pyx_add_acquisition_count(memview) == 0 && !memview_is_new_reference) {
24750 Py_INCREF(memview);
24755 memviewslice->memview = 0;
24756 memviewslice->data = 0;
24759 __Pyx_RefNannyFinishContext();
24762 #ifndef Py_NO_RETURN
24763 #define Py_NO_RETURN
24765 static void __pyx_fatalerror(
const char *fmt, ...) Py_NO_RETURN {
24768 #ifdef HAVE_STDARG_PROTOTYPES
24769 va_start(vargs, fmt);
24773 vsnprintf(msg, 200, fmt, vargs);
24775 Py_FatalError(msg);
24777 static CYTHON_INLINE
int
24778 __pyx_add_acquisition_count_locked(__pyx_atomic_int *acquisition_count,
24779 PyThread_type_lock lock)
24782 PyThread_acquire_lock(lock, 1);
24783 result = (*acquisition_count)++;
24784 PyThread_release_lock(lock);
24787 static CYTHON_INLINE
int
24788 __pyx_sub_acquisition_count_locked(__pyx_atomic_int *acquisition_count,
24789 PyThread_type_lock lock)
24792 PyThread_acquire_lock(lock, 1);
24793 result = (*acquisition_count)--;
24794 PyThread_release_lock(lock);
24797 static CYTHON_INLINE
void
24798 __Pyx_INC_MEMVIEW(__Pyx_memviewslice *memslice,
int have_gil,
int lineno)
24801 struct __pyx_memoryview_obj *memview = memslice->memview;
24802 if (unlikely(!memview || (PyObject *) memview == Py_None))
24804 if (unlikely(__pyx_get_slice_count(memview) < 0))
24805 __pyx_fatalerror(
"Acquisition count is %d (line %d)",
24806 __pyx_get_slice_count(memview), lineno);
24807 first_time = __pyx_add_acquisition_count(memview) == 0;
24808 if (unlikely(first_time)) {
24810 Py_INCREF((PyObject *) memview);
24812 PyGILState_STATE _gilstate = PyGILState_Ensure();
24813 Py_INCREF((PyObject *) memview);
24814 PyGILState_Release(_gilstate);
24818 static CYTHON_INLINE
void __Pyx_XDEC_MEMVIEW(__Pyx_memviewslice *memslice,
24819 int have_gil,
int lineno) {
24821 struct __pyx_memoryview_obj *memview = memslice->memview;
24822 if (unlikely(!memview || (PyObject *) memview == Py_None)) {
24823 memslice->memview = NULL;
24826 if (unlikely(__pyx_get_slice_count(memview) <= 0))
24827 __pyx_fatalerror(
"Acquisition count is %d (line %d)",
24828 __pyx_get_slice_count(memview), lineno);
24829 last_time = __pyx_sub_acquisition_count(memview) == 1;
24830 memslice->data = NULL;
24831 if (unlikely(last_time)) {
24833 Py_CLEAR(memslice->memview);
24835 PyGILState_STATE _gilstate = PyGILState_Ensure();
24836 Py_CLEAR(memslice->memview);
24837 PyGILState_Release(_gilstate);
24840 memslice->memview = NULL;
24845 static CYTHON_INLINE
long __Pyx_PyInt_As_long(PyObject *x) {
24846 #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
24847 #pragma GCC diagnostic push
24848 #pragma GCC diagnostic ignored "-Wconversion"
24850 const long neg_one = (long) -1, const_zero = (
long) 0;
24851 #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
24852 #pragma GCC diagnostic pop
24854 const int is_unsigned = neg_one > const_zero;
24855 #if PY_MAJOR_VERSION < 3
24856 if (likely(PyInt_Check(x))) {
24857 if (
sizeof(
long) <
sizeof(long)) {
24858 __PYX_VERIFY_RETURN_INT(
long,
long, PyInt_AS_LONG(x))
24860 long val = PyInt_AS_LONG(x);
24861 if (is_unsigned && unlikely(val < 0)) {
24862 goto raise_neg_overflow;
24868 if (likely(PyLong_Check(x))) {
24870 #if CYTHON_USE_PYLONG_INTERNALS
24871 const digit* digits = ((PyLongObject*)x)->ob_digit;
24872 switch (Py_SIZE(x)) {
24873 case 0:
return (
long) 0;
24874 case 1: __PYX_VERIFY_RETURN_INT(
long, digit, digits[0])
24876 if (8 *
sizeof(
long) > 1 * PyLong_SHIFT) {
24877 if (8 *
sizeof(
unsigned long) > 2 * PyLong_SHIFT) {
24878 __PYX_VERIFY_RETURN_INT(
long,
unsigned long, (((((
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
24879 }
else if (8 *
sizeof(
long) >= 2 * PyLong_SHIFT) {
24880 return (
long) (((((long)digits[1]) << PyLong_SHIFT) | (
long)digits[0]));
24885 if (8 *
sizeof(
long) > 2 * PyLong_SHIFT) {
24886 if (8 *
sizeof(
unsigned long) > 3 * PyLong_SHIFT) {
24887 __PYX_VERIFY_RETURN_INT(
long,
unsigned long, (((((((
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
24888 }
else if (8 *
sizeof(
long) >= 3 * PyLong_SHIFT) {
24889 return (
long) (((((((long)digits[2]) << PyLong_SHIFT) | (
long)digits[1]) << PyLong_SHIFT) | (long)digits[0]));
24894 if (8 *
sizeof(
long) > 3 * PyLong_SHIFT) {
24895 if (8 *
sizeof(
unsigned long) > 4 * PyLong_SHIFT) {
24896 __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])))
24897 }
else if (8 *
sizeof(
long) >= 4 * PyLong_SHIFT) {
24898 return (
long) (((((((((long)digits[3]) << PyLong_SHIFT) | (
long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (
long)digits[0]));
24904 #if CYTHON_COMPILING_IN_CPYTHON
24905 if (unlikely(Py_SIZE(x) < 0)) {
24906 goto raise_neg_overflow;
24910 int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
24911 if (unlikely(result < 0))
24913 if (unlikely(result == 1))
24914 goto raise_neg_overflow;
24917 if (
sizeof(
long) <=
sizeof(
unsigned long)) {
24918 __PYX_VERIFY_RETURN_INT_EXC(
long,
unsigned long, PyLong_AsUnsignedLong(x))
24919 #ifdef HAVE_LONG_LONG
24920 }
else if (
sizeof(
long) <=
sizeof(
unsigned PY_LONG_LONG)) {
24921 __PYX_VERIFY_RETURN_INT_EXC(
long,
unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
24925 #if CYTHON_USE_PYLONG_INTERNALS
24926 const digit* digits = ((PyLongObject*)x)->ob_digit;
24927 switch (Py_SIZE(x)) {
24928 case 0:
return (
long) 0;
24929 case -1: __PYX_VERIFY_RETURN_INT(
long, sdigit, (sdigit) (-(sdigit)digits[0]))
24930 case 1: __PYX_VERIFY_RETURN_INT(
long, digit, +digits[0])
24932 if (8 *
sizeof(
long) - 1 > 1 * PyLong_SHIFT) {
24933 if (8 *
sizeof(
unsigned long) > 2 * PyLong_SHIFT) {
24934 __PYX_VERIFY_RETURN_INT(
long,
long, -(
long) (((((
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
24935 }
else if (8 *
sizeof(
long) - 1 > 2 * PyLong_SHIFT) {
24936 return (
long) (((long)-1)*(((((long)digits[1]) << PyLong_SHIFT) | (
long)digits[0])));
24941 if (8 *
sizeof(
long) > 1 * PyLong_SHIFT) {
24942 if (8 *
sizeof(
unsigned long) > 2 * PyLong_SHIFT) {
24943 __PYX_VERIFY_RETURN_INT(
long,
unsigned long, (((((
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
24944 }
else if (8 *
sizeof(
long) - 1 > 2 * PyLong_SHIFT) {
24945 return (
long) ((((((long)digits[1]) << PyLong_SHIFT) | (
long)digits[0])));
24950 if (8 *
sizeof(
long) - 1 > 2 * PyLong_SHIFT) {
24951 if (8 *
sizeof(
unsigned long) > 3 * PyLong_SHIFT) {
24952 __PYX_VERIFY_RETURN_INT(
long,
long, -(
long) (((((((
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
24953 }
else if (8 *
sizeof(
long) - 1 > 3 * PyLong_SHIFT) {
24954 return (
long) (((long)-1)*(((((((long)digits[2]) << PyLong_SHIFT) | (
long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
24959 if (8 *
sizeof(
long) > 2 * PyLong_SHIFT) {
24960 if (8 *
sizeof(
unsigned long) > 3 * PyLong_SHIFT) {
24961 __PYX_VERIFY_RETURN_INT(
long,
unsigned long, (((((((
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
24962 }
else if (8 *
sizeof(
long) - 1 > 3 * PyLong_SHIFT) {
24963 return (
long) ((((((((long)digits[2]) << PyLong_SHIFT) | (
long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
24968 if (8 *
sizeof(
long) - 1 > 3 * PyLong_SHIFT) {
24969 if (8 *
sizeof(
unsigned long) > 4 * PyLong_SHIFT) {
24970 __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])))
24971 }
else if (8 *
sizeof(
long) - 1 > 4 * PyLong_SHIFT) {
24972 return (
long) (((long)-1)*(((((((((long)digits[3]) << PyLong_SHIFT) | (
long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (
long)digits[0])));
24977 if (8 *
sizeof(
long) > 3 * PyLong_SHIFT) {
24978 if (8 *
sizeof(
unsigned long) > 4 * PyLong_SHIFT) {
24979 __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])))
24980 }
else if (8 *
sizeof(
long) - 1 > 4 * PyLong_SHIFT) {
24981 return (
long) ((((((((((long)digits[3]) << PyLong_SHIFT) | (
long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (
long)digits[0])));
24987 if (
sizeof(
long) <=
sizeof(long)) {
24988 __PYX_VERIFY_RETURN_INT_EXC(
long,
long, PyLong_AsLong(x))
24989 #ifdef HAVE_LONG_LONG
24990 }
else if (
sizeof(
long) <=
sizeof(PY_LONG_LONG)) {
24991 __PYX_VERIFY_RETURN_INT_EXC(
long, PY_LONG_LONG, PyLong_AsLongLong(x))
24996 #if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray)
24997 PyErr_SetString(PyExc_RuntimeError,
24998 "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers");
25001 PyObject *
v = __Pyx_PyNumber_IntOrLong(x);
25002 #if PY_MAJOR_VERSION < 3
25003 if (likely(
v) && !PyLong_Check(
v)) {
25005 v = PyNumber_Long(tmp);
25010 int one = 1;
int is_little = (int)*(
unsigned char *)&one;
25011 unsigned char *bytes = (
unsigned char *)&val;
25012 int ret = _PyLong_AsByteArray((PyLongObject *)
v,
25013 bytes,
sizeof(val),
25014 is_little, !is_unsigned);
25024 PyObject *tmp = __Pyx_PyNumber_IntOrLong(x);
25025 if (!tmp)
return (
long) -1;
25026 val = __Pyx_PyInt_As_long(tmp);
25031 PyErr_SetString(PyExc_OverflowError,
25032 "value too large to convert to long");
25034 raise_neg_overflow:
25035 PyErr_SetString(PyExc_OverflowError,
25036 "can't convert negative value to long");
25041 static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(
long value) {
25042 #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
25043 #pragma GCC diagnostic push
25044 #pragma GCC diagnostic ignored "-Wconversion"
25046 const long neg_one = (long) -1, const_zero = (
long) 0;
25047 #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
25048 #pragma GCC diagnostic pop
25050 const int is_unsigned = neg_one > const_zero;
25052 if (
sizeof(
long) <
sizeof(long)) {
25053 return PyInt_FromLong((
long) value);
25054 }
else if (
sizeof(
long) <=
sizeof(
unsigned long)) {
25055 return PyLong_FromUnsignedLong((
unsigned long) value);
25056 #ifdef HAVE_LONG_LONG
25057 }
else if (
sizeof(
long) <=
sizeof(
unsigned PY_LONG_LONG)) {
25058 return PyLong_FromUnsignedLongLong((
unsigned PY_LONG_LONG) value);
25062 if (
sizeof(
long) <=
sizeof(
long)) {
25063 return PyInt_FromLong((
long) value);
25064 #ifdef HAVE_LONG_LONG
25065 }
else if (
sizeof(
long) <=
sizeof(PY_LONG_LONG)) {
25066 return PyLong_FromLongLong((PY_LONG_LONG) value);
25071 int one = 1;
int little = (int)*(
unsigned char *)&one;
25072 unsigned char *bytes = (
unsigned char *)&value;
25073 return _PyLong_FromByteArray(bytes,
sizeof(
long),
25074 little, !is_unsigned);
25079 static CYTHON_INLINE
char __Pyx_PyInt_As_char(PyObject *x) {
25080 #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
25081 #pragma GCC diagnostic push
25082 #pragma GCC diagnostic ignored "-Wconversion"
25084 const char neg_one = (char) -1, const_zero = (
char) 0;
25085 #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
25086 #pragma GCC diagnostic pop
25088 const int is_unsigned = neg_one > const_zero;
25089 #if PY_MAJOR_VERSION < 3
25090 if (likely(PyInt_Check(x))) {
25091 if (
sizeof(
char) <
sizeof(long)) {
25092 __PYX_VERIFY_RETURN_INT(
char,
long, PyInt_AS_LONG(x))
25094 long val = PyInt_AS_LONG(x);
25095 if (is_unsigned && unlikely(val < 0)) {
25096 goto raise_neg_overflow;
25102 if (likely(PyLong_Check(x))) {
25104 #if CYTHON_USE_PYLONG_INTERNALS
25105 const digit* digits = ((PyLongObject*)x)->ob_digit;
25106 switch (Py_SIZE(x)) {
25107 case 0:
return (
char) 0;
25108 case 1: __PYX_VERIFY_RETURN_INT(
char, digit, digits[0])
25110 if (8 *
sizeof(
char) > 1 * PyLong_SHIFT) {
25111 if (8 *
sizeof(
unsigned long) > 2 * PyLong_SHIFT) {
25112 __PYX_VERIFY_RETURN_INT(
char,
unsigned long, (((((
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
25113 }
else if (8 *
sizeof(
char) >= 2 * PyLong_SHIFT) {
25114 return (
char) (((((char)digits[1]) << PyLong_SHIFT) | (
char)digits[0]));
25119 if (8 *
sizeof(
char) > 2 * PyLong_SHIFT) {
25120 if (8 *
sizeof(
unsigned long) > 3 * PyLong_SHIFT) {
25121 __PYX_VERIFY_RETURN_INT(
char,
unsigned long, (((((((
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
25122 }
else if (8 *
sizeof(
char) >= 3 * PyLong_SHIFT) {
25123 return (
char) (((((((char)digits[2]) << PyLong_SHIFT) | (
char)digits[1]) << PyLong_SHIFT) | (char)digits[0]));
25128 if (8 *
sizeof(
char) > 3 * PyLong_SHIFT) {
25129 if (8 *
sizeof(
unsigned long) > 4 * PyLong_SHIFT) {
25130 __PYX_VERIFY_RETURN_INT(
char,
unsigned long, (((((((((
unsigned long)digits[3]) << PyLong_SHIFT) | (
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
25131 }
else if (8 *
sizeof(
char) >= 4 * PyLong_SHIFT) {
25132 return (
char) (((((((((char)digits[3]) << PyLong_SHIFT) | (
char)digits[2]) << PyLong_SHIFT) | (char)digits[1]) << PyLong_SHIFT) | (
char)digits[0]));
25138 #if CYTHON_COMPILING_IN_CPYTHON
25139 if (unlikely(Py_SIZE(x) < 0)) {
25140 goto raise_neg_overflow;
25144 int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
25145 if (unlikely(result < 0))
25147 if (unlikely(result == 1))
25148 goto raise_neg_overflow;
25151 if (
sizeof(
char) <=
sizeof(
unsigned long)) {
25152 __PYX_VERIFY_RETURN_INT_EXC(
char,
unsigned long, PyLong_AsUnsignedLong(x))
25153 #ifdef HAVE_LONG_LONG
25154 }
else if (
sizeof(
char) <=
sizeof(
unsigned PY_LONG_LONG)) {
25155 __PYX_VERIFY_RETURN_INT_EXC(
char,
unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
25159 #if CYTHON_USE_PYLONG_INTERNALS
25160 const digit* digits = ((PyLongObject*)x)->ob_digit;
25161 switch (Py_SIZE(x)) {
25162 case 0:
return (
char) 0;
25163 case -1: __PYX_VERIFY_RETURN_INT(
char, sdigit, (sdigit) (-(sdigit)digits[0]))
25164 case 1: __PYX_VERIFY_RETURN_INT(
char, digit, +digits[0])
25166 if (8 *
sizeof(
char) - 1 > 1 * PyLong_SHIFT) {
25167 if (8 *
sizeof(
unsigned long) > 2 * PyLong_SHIFT) {
25168 __PYX_VERIFY_RETURN_INT(
char,
long, -(
long) (((((
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
25169 }
else if (8 *
sizeof(
char) - 1 > 2 * PyLong_SHIFT) {
25170 return (
char) (((char)-1)*(((((char)digits[1]) << PyLong_SHIFT) | (
char)digits[0])));
25175 if (8 *
sizeof(
char) > 1 * PyLong_SHIFT) {
25176 if (8 *
sizeof(
unsigned long) > 2 * PyLong_SHIFT) {
25177 __PYX_VERIFY_RETURN_INT(
char,
unsigned long, (((((
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
25178 }
else if (8 *
sizeof(
char) - 1 > 2 * PyLong_SHIFT) {
25179 return (
char) ((((((char)digits[1]) << PyLong_SHIFT) | (
char)digits[0])));
25184 if (8 *
sizeof(
char) - 1 > 2 * PyLong_SHIFT) {
25185 if (8 *
sizeof(
unsigned long) > 3 * PyLong_SHIFT) {
25186 __PYX_VERIFY_RETURN_INT(
char,
long, -(
long) (((((((
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
25187 }
else if (8 *
sizeof(
char) - 1 > 3 * PyLong_SHIFT) {
25188 return (
char) (((char)-1)*(((((((char)digits[2]) << PyLong_SHIFT) | (
char)digits[1]) << PyLong_SHIFT) | (char)digits[0])));
25193 if (8 *
sizeof(
char) > 2 * PyLong_SHIFT) {
25194 if (8 *
sizeof(
unsigned long) > 3 * PyLong_SHIFT) {
25195 __PYX_VERIFY_RETURN_INT(
char,
unsigned long, (((((((
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
25196 }
else if (8 *
sizeof(
char) - 1 > 3 * PyLong_SHIFT) {
25197 return (
char) ((((((((char)digits[2]) << PyLong_SHIFT) | (
char)digits[1]) << PyLong_SHIFT) | (char)digits[0])));
25202 if (8 *
sizeof(
char) - 1 > 3 * PyLong_SHIFT) {
25203 if (8 *
sizeof(
unsigned long) > 4 * PyLong_SHIFT) {
25204 __PYX_VERIFY_RETURN_INT(
char,
long, -(
long) (((((((((
unsigned long)digits[3]) << PyLong_SHIFT) | (
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
25205 }
else if (8 *
sizeof(
char) - 1 > 4 * PyLong_SHIFT) {
25206 return (
char) (((char)-1)*(((((((((char)digits[3]) << PyLong_SHIFT) | (
char)digits[2]) << PyLong_SHIFT) | (char)digits[1]) << PyLong_SHIFT) | (
char)digits[0])));
25211 if (8 *
sizeof(
char) > 3 * PyLong_SHIFT) {
25212 if (8 *
sizeof(
unsigned long) > 4 * PyLong_SHIFT) {
25213 __PYX_VERIFY_RETURN_INT(
char,
unsigned long, (((((((((
unsigned long)digits[3]) << PyLong_SHIFT) | (
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
25214 }
else if (8 *
sizeof(
char) - 1 > 4 * PyLong_SHIFT) {
25215 return (
char) ((((((((((char)digits[3]) << PyLong_SHIFT) | (
char)digits[2]) << PyLong_SHIFT) | (char)digits[1]) << PyLong_SHIFT) | (
char)digits[0])));
25221 if (
sizeof(
char) <=
sizeof(long)) {
25222 __PYX_VERIFY_RETURN_INT_EXC(
char,
long, PyLong_AsLong(x))
25223 #ifdef HAVE_LONG_LONG
25224 }
else if (
sizeof(
char) <=
sizeof(PY_LONG_LONG)) {
25225 __PYX_VERIFY_RETURN_INT_EXC(
char, PY_LONG_LONG, PyLong_AsLongLong(x))
25230 #if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray)
25231 PyErr_SetString(PyExc_RuntimeError,
25232 "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers");
25235 PyObject *
v = __Pyx_PyNumber_IntOrLong(x);
25236 #if PY_MAJOR_VERSION < 3
25237 if (likely(
v) && !PyLong_Check(
v)) {
25239 v = PyNumber_Long(tmp);
25244 int one = 1;
int is_little = (int)*(
unsigned char *)&one;
25245 unsigned char *bytes = (
unsigned char *)&val;
25246 int ret = _PyLong_AsByteArray((PyLongObject *)
v,
25247 bytes,
sizeof(val),
25248 is_little, !is_unsigned);
25258 PyObject *tmp = __Pyx_PyNumber_IntOrLong(x);
25259 if (!tmp)
return (
char) -1;
25260 val = __Pyx_PyInt_As_char(tmp);
25265 PyErr_SetString(PyExc_OverflowError,
25266 "value too large to convert to char");
25268 raise_neg_overflow:
25269 PyErr_SetString(PyExc_OverflowError,
25270 "can't convert negative value to char");
25275 static int __Pyx_check_binary_version(
void) {
25277 int same=1, i, found_dot;
25278 const char* rt_from_call = Py_GetVersion();
25279 PyOS_snprintf(ctversion, 5,
"%d.%d", PY_MAJOR_VERSION, PY_MINOR_VERSION);
25281 for (i = 0; i < 4; i++) {
25282 if (!ctversion[i]) {
25283 same = (rt_from_call[i] <
'0' || rt_from_call[i] >
'9');
25286 if (rt_from_call[i] != ctversion[i]) {
25292 char rtversion[5] = {
'\0'};
25294 for (i=0; i<4; ++i) {
25295 if (rt_from_call[i] ==
'.') {
25296 if (found_dot)
break;
25298 }
else if (rt_from_call[i] <
'0' || rt_from_call[i] >
'9') {
25301 rtversion[i] = rt_from_call[i];
25303 PyOS_snprintf(message,
sizeof(message),
25304 "compiletime version %s of module '%.100s' "
25305 "does not match runtime version %s",
25306 ctversion, __Pyx_MODULE_NAME, rtversion);
25307 return PyErr_WarnEx(NULL, message, 1);
25313 static int __Pyx_InitStrings(__Pyx_StringTabEntry *t) {
25315 #if PY_MAJOR_VERSION < 3
25316 if (t->is_unicode) {
25317 *t->p = PyUnicode_DecodeUTF8(t->s, t->n - 1, NULL);
25318 }
else if (t->intern) {
25319 *t->p = PyString_InternFromString(t->s);
25321 *t->p = PyString_FromStringAndSize(t->s, t->n - 1);
25324 if (t->is_unicode | t->is_str) {
25326 *t->p = PyUnicode_InternFromString(t->s);
25327 }
else if (t->encoding) {
25328 *t->p = PyUnicode_Decode(t->s, t->n - 1, t->encoding, NULL);
25330 *t->p = PyUnicode_FromStringAndSize(t->s, t->n - 1);
25333 *t->p = PyBytes_FromStringAndSize(t->s, t->n - 1);
25338 if (PyObject_Hash(*t->p) == -1)
25345 static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(
const char* c_str) {
25346 return __Pyx_PyUnicode_FromStringAndSize(c_str, (Py_ssize_t)strlen(c_str));
25348 static CYTHON_INLINE
const char* __Pyx_PyObject_AsString(PyObject* o) {
25350 return __Pyx_PyObject_AsStringAndSize(o, &ignore);
25352 #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT
25353 #if !CYTHON_PEP393_ENABLED
25354 static const char* __Pyx_PyUnicode_AsStringAndSize(PyObject* o, Py_ssize_t *length) {
25356 PyObject* defenc = _PyUnicode_AsDefaultEncodedString(o, NULL);
25357 if (!defenc)
return NULL;
25358 defenc_c = PyBytes_AS_STRING(defenc);
25359 #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
25361 char* end = defenc_c + PyBytes_GET_SIZE(defenc);
25363 for (
c = defenc_c;
c < end;
c++) {
25364 if ((
unsigned char) (*
c) >= 128) {
25365 PyUnicode_AsASCIIString(o);
25371 *length = PyBytes_GET_SIZE(defenc);
25375 static CYTHON_INLINE
const char* __Pyx_PyUnicode_AsStringAndSize(PyObject* o, Py_ssize_t *length) {
25376 if (unlikely(__Pyx_PyUnicode_READY(o) == -1))
return NULL;
25377 #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
25378 if (likely(PyUnicode_IS_ASCII(o))) {
25379 *length = PyUnicode_GET_LENGTH(o);
25380 return PyUnicode_AsUTF8(o);
25382 PyUnicode_AsASCIIString(o);
25386 return PyUnicode_AsUTF8AndSize(o, length);
25391 static CYTHON_INLINE
const char* __Pyx_PyObject_AsStringAndSize(PyObject* o, Py_ssize_t *length) {
25392 #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT
25394 #
if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
25395 __Pyx_sys_getdefaultencoding_not_ascii &&
25397 PyUnicode_Check(o)) {
25398 return __Pyx_PyUnicode_AsStringAndSize(o, length);
25401 #if (!CYTHON_COMPILING_IN_PYPY) || (defined(PyByteArray_AS_STRING) && defined(PyByteArray_GET_SIZE))
25402 if (PyByteArray_Check(o)) {
25403 *length = PyByteArray_GET_SIZE(o);
25404 return PyByteArray_AS_STRING(o);
25409 int r = PyBytes_AsStringAndSize(o, &result, length);
25410 if (unlikely(
r < 0)) {
25417 static CYTHON_INLINE
int __Pyx_PyObject_IsTrue(PyObject* x) {
25418 int is_true = x == Py_True;
25419 if (is_true | (x == Py_False) | (x == Py_None))
return is_true;
25420 else return PyObject_IsTrue(x);
25422 static CYTHON_INLINE
int __Pyx_PyObject_IsTrueAndDecref(PyObject* x) {
25424 if (unlikely(!x))
return -1;
25425 retval = __Pyx_PyObject_IsTrue(x);
25429 static PyObject* __Pyx_PyNumber_IntOrLongWrongResultType(PyObject* result,
const char* type_name) {
25430 #if PY_MAJOR_VERSION >= 3
25431 if (PyLong_Check(result)) {
25432 if (PyErr_WarnFormat(PyExc_DeprecationWarning, 1,
25433 "__int__ returned non-int (type %.200s). "
25434 "The ability to return an instance of a strict subclass of int "
25435 "is deprecated, and may be removed in a future version of Python.",
25436 Py_TYPE(result)->tp_name)) {
25443 PyErr_Format(PyExc_TypeError,
25444 "__%.4s__ returned non-%.4s (type %.200s)",
25445 type_name, type_name, Py_TYPE(result)->tp_name);
25449 static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x) {
25450 #if CYTHON_USE_TYPE_SLOTS
25451 PyNumberMethods *m;
25453 const char *name = NULL;
25454 PyObject *res = NULL;
25455 #if PY_MAJOR_VERSION < 3
25456 if (likely(PyInt_Check(x) || PyLong_Check(x)))
25458 if (likely(PyLong_Check(x)))
25460 return __Pyx_NewRef(x);
25461 #if CYTHON_USE_TYPE_SLOTS
25462 m = Py_TYPE(x)->tp_as_number;
25463 #if PY_MAJOR_VERSION < 3
25464 if (m && m->nb_int) {
25466 res = m->nb_int(x);
25468 else if (m && m->nb_long) {
25470 res = m->nb_long(x);
25473 if (likely(m && m->nb_int)) {
25475 res = m->nb_int(x);
25479 if (!PyBytes_CheckExact(x) && !PyUnicode_CheckExact(x)) {
25480 res = PyNumber_Int(x);
25484 #if PY_MAJOR_VERSION < 3
25485 if (unlikely(!PyInt_Check(res) && !PyLong_Check(res))) {
25487 if (unlikely(!PyLong_CheckExact(res))) {
25489 return __Pyx_PyNumber_IntOrLongWrongResultType(res, name);
25492 else if (!PyErr_Occurred()) {
25493 PyErr_SetString(PyExc_TypeError,
25494 "an integer is required");
25498 static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject* b) {
25501 #if PY_MAJOR_VERSION < 3
25502 if (likely(PyInt_CheckExact(b))) {
25503 if (
sizeof(Py_ssize_t) >=
sizeof(
long))
25504 return PyInt_AS_LONG(b);
25506 return PyInt_AsSsize_t(b);
25509 if (likely(PyLong_CheckExact(b))) {
25510 #if CYTHON_USE_PYLONG_INTERNALS
25511 const digit* digits = ((PyLongObject*)b)->ob_digit;
25512 const Py_ssize_t size = Py_SIZE(b);
25513 if (likely(__Pyx_sst_abs(size) <= 1)) {
25514 ival = likely(size) ? digits[0] : 0;
25515 if (size == -1) ival = -ival;
25520 if (8 *
sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) {
25521 return (Py_ssize_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (
size_t)digits[0]));
25525 if (8 *
sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) {
25526 return -(Py_ssize_t) (((((
size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
25530 if (8 *
sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) {
25531 return (Py_ssize_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (
size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
25535 if (8 *
sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) {
25536 return -(Py_ssize_t) (((((((
size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (
size_t)digits[0]));
25540 if (8 *
sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) {
25541 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]));
25545 if (8 *
sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) {
25546 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]));
25552 return PyLong_AsSsize_t(b);
25554 x = PyNumber_Index(b);
25556 ival = PyInt_AsSsize_t(x);
25560 static CYTHON_INLINE Py_hash_t __Pyx_PyIndex_AsHash_t(PyObject* o) {
25561 if (
sizeof(Py_hash_t) ==
sizeof(Py_ssize_t)) {
25562 return (Py_hash_t) __Pyx_PyIndex_AsSsize_t(o);
25563 #if PY_MAJOR_VERSION < 3
25564 }
else if (likely(PyInt_CheckExact(o))) {
25565 return PyInt_AS_LONG(o);
25570 x = PyNumber_Index(o);
25572 ival = PyInt_AsLong(x);
25577 static CYTHON_INLINE PyObject * __Pyx_PyBool_FromLong(
long b) {
25578 return b ? __Pyx_NewRef(Py_True) : __Pyx_NewRef(Py_False);
25580 static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(
size_t ival) {
25581 return PyInt_FromSize_t(ival);