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__flcbdfWrappers
708 #define __PYX_HAVE_API__flcbdfWrappers
712 #include "numpy/arrayobject.h"
713 #include "numpy/ndarrayobject.h"
714 #include "numpy/ndarraytypes.h"
715 #include "numpy/arrayscalars.h"
716 #include "numpy/ufuncobject.h"
720 #include "FullDataFile.h"
721 #include "DaetkPetscSys.h"
722 #include "DaetkPetscVec.h"
723 #include "WeightedRMSNorm.h"
724 #include "FLCBDF_lite.h"
725 #include "pythread.h"
732 #if defined(PYREX_WITHOUT_ASSERTIONS) && !defined(CYTHON_WITHOUT_ASSERTIONS)
733 #define CYTHON_WITHOUT_ASSERTIONS
736 typedef struct {PyObject **p;
const char *
s;
const Py_ssize_t
n;
const char* encoding;
737 const char is_unicode;
const char is_str;
const char intern; } __Pyx_StringTabEntry;
739 #define __PYX_DEFAULT_STRING_ENCODING_IS_ASCII 0
740 #define __PYX_DEFAULT_STRING_ENCODING_IS_UTF8 0
741 #define __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT (PY_MAJOR_VERSION >= 3 && __PYX_DEFAULT_STRING_ENCODING_IS_UTF8)
742 #define __PYX_DEFAULT_STRING_ENCODING ""
743 #define __Pyx_PyObject_FromString __Pyx_PyBytes_FromString
744 #define __Pyx_PyObject_FromStringAndSize __Pyx_PyBytes_FromStringAndSize
745 #define __Pyx_uchar_cast(c) ((unsigned char)c)
746 #define __Pyx_long_cast(x) ((long)x)
747 #define __Pyx_fits_Py_ssize_t(v, type, is_signed) (\
748 (sizeof(type) < sizeof(Py_ssize_t)) ||\
749 (sizeof(type) > sizeof(Py_ssize_t) &&\
750 likely(v < (type)PY_SSIZE_T_MAX ||\
751 v == (type)PY_SSIZE_T_MAX) &&\
752 (!is_signed || likely(v > (type)PY_SSIZE_T_MIN ||\
753 v == (type)PY_SSIZE_T_MIN))) ||\
754 (sizeof(type) == sizeof(Py_ssize_t) &&\
755 (is_signed || likely(v < (type)PY_SSIZE_T_MAX ||\
756 v == (type)PY_SSIZE_T_MAX))) )
757 static CYTHON_INLINE
int __Pyx_is_valid_index(Py_ssize_t i, Py_ssize_t limit) {
758 return (
size_t) i < (size_t) limit;
760 #if defined (__cplusplus) && __cplusplus >= 201103L
762 #define __Pyx_sst_abs(value) std::abs(value)
763 #elif SIZEOF_INT >= SIZEOF_SIZE_T
764 #define __Pyx_sst_abs(value) abs(value)
765 #elif SIZEOF_LONG >= SIZEOF_SIZE_T
766 #define __Pyx_sst_abs(value) labs(value)
767 #elif defined (_MSC_VER)
768 #define __Pyx_sst_abs(value) ((Py_ssize_t)_abs64(value))
769 #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
770 #define __Pyx_sst_abs(value) llabs(value)
771 #elif defined (__GNUC__)
772 #define __Pyx_sst_abs(value) __builtin_llabs(value)
774 #define __Pyx_sst_abs(value) ((value<0) ? -value : value)
776 static CYTHON_INLINE
const char* __Pyx_PyObject_AsString(PyObject*);
777 static CYTHON_INLINE
const char* __Pyx_PyObject_AsStringAndSize(PyObject*, Py_ssize_t* length);
778 #define __Pyx_PyByteArray_FromString(s) PyByteArray_FromStringAndSize((const char*)s, strlen((const char*)s))
779 #define __Pyx_PyByteArray_FromStringAndSize(s, l) PyByteArray_FromStringAndSize((const char*)s, l)
780 #define __Pyx_PyBytes_FromString PyBytes_FromString
781 #define __Pyx_PyBytes_FromStringAndSize PyBytes_FromStringAndSize
782 static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(
const char*);
783 #if PY_MAJOR_VERSION < 3
784 #define __Pyx_PyStr_FromString __Pyx_PyBytes_FromString
785 #define __Pyx_PyStr_FromStringAndSize __Pyx_PyBytes_FromStringAndSize
787 #define __Pyx_PyStr_FromString __Pyx_PyUnicode_FromString
788 #define __Pyx_PyStr_FromStringAndSize __Pyx_PyUnicode_FromStringAndSize
790 #define __Pyx_PyBytes_AsWritableString(s) ((char*) PyBytes_AS_STRING(s))
791 #define __Pyx_PyBytes_AsWritableSString(s) ((signed char*) PyBytes_AS_STRING(s))
792 #define __Pyx_PyBytes_AsWritableUString(s) ((unsigned char*) PyBytes_AS_STRING(s))
793 #define __Pyx_PyBytes_AsString(s) ((const char*) PyBytes_AS_STRING(s))
794 #define __Pyx_PyBytes_AsSString(s) ((const signed char*) PyBytes_AS_STRING(s))
795 #define __Pyx_PyBytes_AsUString(s) ((const unsigned char*) PyBytes_AS_STRING(s))
796 #define __Pyx_PyObject_AsWritableString(s) ((char*) __Pyx_PyObject_AsString(s))
797 #define __Pyx_PyObject_AsWritableSString(s) ((signed char*) __Pyx_PyObject_AsString(s))
798 #define __Pyx_PyObject_AsWritableUString(s) ((unsigned char*) __Pyx_PyObject_AsString(s))
799 #define __Pyx_PyObject_AsSString(s) ((const signed char*) __Pyx_PyObject_AsString(s))
800 #define __Pyx_PyObject_AsUString(s) ((const unsigned char*) __Pyx_PyObject_AsString(s))
801 #define __Pyx_PyObject_FromCString(s) __Pyx_PyObject_FromString((const char*)s)
802 #define __Pyx_PyBytes_FromCString(s) __Pyx_PyBytes_FromString((const char*)s)
803 #define __Pyx_PyByteArray_FromCString(s) __Pyx_PyByteArray_FromString((const char*)s)
804 #define __Pyx_PyStr_FromCString(s) __Pyx_PyStr_FromString((const char*)s)
805 #define __Pyx_PyUnicode_FromCString(s) __Pyx_PyUnicode_FromString((const char*)s)
806 static CYTHON_INLINE
size_t __Pyx_Py_UNICODE_strlen(
const Py_UNICODE *
u) {
807 const Py_UNICODE *u_end =
u;
809 return (
size_t)(u_end -
u - 1);
811 #define __Pyx_PyUnicode_FromUnicode(u) PyUnicode_FromUnicode(u, __Pyx_Py_UNICODE_strlen(u))
812 #define __Pyx_PyUnicode_FromUnicodeAndLength PyUnicode_FromUnicode
813 #define __Pyx_PyUnicode_AsUnicode PyUnicode_AsUnicode
814 #define __Pyx_NewRef(obj) (Py_INCREF(obj), obj)
815 #define __Pyx_Owned_Py_None(b) __Pyx_NewRef(Py_None)
816 static CYTHON_INLINE PyObject * __Pyx_PyBool_FromLong(
long b);
817 static CYTHON_INLINE
int __Pyx_PyObject_IsTrue(PyObject*);
818 static CYTHON_INLINE
int __Pyx_PyObject_IsTrueAndDecref(PyObject*);
819 static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x);
820 #define __Pyx_PySequence_Tuple(obj)\
821 (likely(PyTuple_CheckExact(obj)) ? __Pyx_NewRef(obj) : PySequence_Tuple(obj))
822 static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject*);
823 static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(
size_t);
824 static CYTHON_INLINE Py_hash_t __Pyx_PyIndex_AsHash_t(PyObject*);
825 #if CYTHON_ASSUME_SAFE_MACROS
826 #define __pyx_PyFloat_AsDouble(x) (PyFloat_CheckExact(x) ? PyFloat_AS_DOUBLE(x) : PyFloat_AsDouble(x))
828 #define __pyx_PyFloat_AsDouble(x) PyFloat_AsDouble(x)
830 #define __pyx_PyFloat_AsFloat(x) ((float) __pyx_PyFloat_AsDouble(x))
831 #if PY_MAJOR_VERSION >= 3
832 #define __Pyx_PyNumber_Int(x) (PyLong_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Long(x))
834 #define __Pyx_PyNumber_Int(x) (PyInt_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Int(x))
836 #define __Pyx_PyNumber_Float(x) (PyFloat_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Float(x))
837 #if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
838 static int __Pyx_sys_getdefaultencoding_not_ascii;
839 static int __Pyx_init_sys_getdefaultencoding_params(
void) {
841 PyObject* default_encoding = NULL;
842 PyObject* ascii_chars_u = NULL;
843 PyObject* ascii_chars_b = NULL;
844 const char* default_encoding_c;
845 sys = PyImport_ImportModule(
"sys");
847 default_encoding = PyObject_CallMethod(sys, (
char*)
"getdefaultencoding", NULL);
849 if (!default_encoding)
goto bad;
850 default_encoding_c = PyBytes_AsString(default_encoding);
851 if (!default_encoding_c)
goto bad;
852 if (strcmp(default_encoding_c,
"ascii") == 0) {
853 __Pyx_sys_getdefaultencoding_not_ascii = 0;
855 char ascii_chars[128];
857 for (
c = 0;
c < 128;
c++) {
860 __Pyx_sys_getdefaultencoding_not_ascii = 1;
861 ascii_chars_u = PyUnicode_DecodeASCII(ascii_chars, 128, NULL);
862 if (!ascii_chars_u)
goto bad;
863 ascii_chars_b = PyUnicode_AsEncodedString(ascii_chars_u, default_encoding_c, NULL);
864 if (!ascii_chars_b || !PyBytes_Check(ascii_chars_b) || memcmp(ascii_chars, PyBytes_AS_STRING(ascii_chars_b), 128) != 0) {
867 "This module compiled with c_string_encoding=ascii, but default encoding '%.200s' is not a superset of ascii.",
871 Py_DECREF(ascii_chars_u);
872 Py_DECREF(ascii_chars_b);
874 Py_DECREF(default_encoding);
877 Py_XDECREF(default_encoding);
878 Py_XDECREF(ascii_chars_u);
879 Py_XDECREF(ascii_chars_b);
883 #if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT && PY_MAJOR_VERSION >= 3
884 #define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_DecodeUTF8(c_str, size, NULL)
886 #define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_Decode(c_str, size, __PYX_DEFAULT_STRING_ENCODING, NULL)
887 #if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT
888 static char* __PYX_DEFAULT_STRING_ENCODING;
889 static int __Pyx_init_sys_getdefaultencoding_params(
void) {
891 PyObject* default_encoding = NULL;
892 char* default_encoding_c;
893 sys = PyImport_ImportModule(
"sys");
895 default_encoding = PyObject_CallMethod(sys, (
char*) (
const char*)
"getdefaultencoding", NULL);
897 if (!default_encoding)
goto bad;
898 default_encoding_c = PyBytes_AsString(default_encoding);
899 if (!default_encoding_c)
goto bad;
900 __PYX_DEFAULT_STRING_ENCODING = (
char*) malloc(strlen(default_encoding_c) + 1);
901 if (!__PYX_DEFAULT_STRING_ENCODING)
goto bad;
902 strcpy(__PYX_DEFAULT_STRING_ENCODING, default_encoding_c);
903 Py_DECREF(default_encoding);
906 Py_XDECREF(default_encoding);
914 #if defined(__GNUC__) && (__GNUC__ > 2 || (__GNUC__ == 2 && (__GNUC_MINOR__ > 95)))
915 #define likely(x) __builtin_expect(!!(x), 1)
916 #define unlikely(x) __builtin_expect(!!(x), 0)
918 #define likely(x) (x)
919 #define unlikely(x) (x)
921 static CYTHON_INLINE
void __Pyx_pretend_to_initialize(
void* ptr) { (void)ptr; }
923 static PyObject *__pyx_m = NULL;
924 static PyObject *__pyx_d;
925 static PyObject *__pyx_b;
926 static PyObject *__pyx_cython_runtime = NULL;
927 static PyObject *__pyx_empty_tuple;
928 static PyObject *__pyx_empty_bytes;
929 static PyObject *__pyx_empty_unicode;
930 static int __pyx_lineno;
931 static int __pyx_clineno = 0;
932 static const char * __pyx_cfilenm= __FILE__;
933 static const char *__pyx_filename;
936 #if !defined(CYTHON_CCOMPLEX)
937 #if defined(__cplusplus)
938 #define CYTHON_CCOMPLEX 1
939 #elif defined(_Complex_I)
940 #define CYTHON_CCOMPLEX 1
942 #define CYTHON_CCOMPLEX 0
952 #if CYTHON_CCOMPLEX && !defined(__cplusplus) && defined(__sun__) && defined(__GNUC__)
954 #define _Complex_I 1.0fj
958 static const char *__pyx_f[] = {
960 "proteus/flcbdfWrappers.pyx",
965 #ifndef __PYX_FORCE_INIT_THREADS
966 #define __PYX_FORCE_INIT_THREADS 0
970 #define __Pyx_PyGILState_Ensure PyGILState_Ensure
971 #define __Pyx_PyGILState_Release PyGILState_Release
972 #define __Pyx_FastGIL_Remember()
973 #define __Pyx_FastGIL_Forget()
974 #define __Pyx_FastGilFuncInit()
977 #define IS_UNSIGNED(type) (((type) -1) > 0)
978 struct __Pyx_StructField_;
979 #define __PYX_BUF_FLAGS_PACKED_STRUCT (1 << 0)
982 struct __Pyx_StructField_* fields;
990 typedef struct __Pyx_StructField_ {
991 __Pyx_TypeInfo* type;
996 __Pyx_StructField* field;
997 size_t parent_offset;
998 } __Pyx_BufFmt_StackElem;
1000 __Pyx_StructField root;
1001 __Pyx_BufFmt_StackElem* head;
1003 size_t new_count, enc_count;
1004 size_t struct_alignment;
1009 char is_valid_array;
1010 } __Pyx_BufFmt_Context;
1013 #include <pythread.h>
1014 #ifndef CYTHON_ATOMICS
1015 #define CYTHON_ATOMICS 1
1017 #define __pyx_atomic_int_type int
1018 #if CYTHON_ATOMICS && __GNUC__ >= 4 && (__GNUC_MINOR__ > 1 ||\
1019 (__GNUC_MINOR__ == 1 && __GNUC_PATCHLEVEL >= 2)) &&\
1021 #define __pyx_atomic_incr_aligned(value, lock) __sync_fetch_and_add(value, 1)
1022 #define __pyx_atomic_decr_aligned(value, lock) __sync_fetch_and_sub(value, 1)
1023 #ifdef __PYX_DEBUG_ATOMICS
1024 #warning "Using GNU atomics"
1026 #elif CYTHON_ATOMICS && defined(_MSC_VER) && 0
1027 #include <Windows.h>
1028 #undef __pyx_atomic_int_type
1029 #define __pyx_atomic_int_type LONG
1030 #define __pyx_atomic_incr_aligned(value, lock) InterlockedIncrement(value)
1031 #define __pyx_atomic_decr_aligned(value, lock) InterlockedDecrement(value)
1032 #ifdef __PYX_DEBUG_ATOMICS
1033 #pragma message ("Using MSVC atomics")
1035 #elif CYTHON_ATOMICS && (defined(__ICC) || defined(__INTEL_COMPILER)) && 0
1036 #define __pyx_atomic_incr_aligned(value, lock) _InterlockedIncrement(value)
1037 #define __pyx_atomic_decr_aligned(value, lock) _InterlockedDecrement(value)
1038 #ifdef __PYX_DEBUG_ATOMICS
1039 #warning "Using Intel atomics"
1042 #undef CYTHON_ATOMICS
1043 #define CYTHON_ATOMICS 0
1044 #ifdef __PYX_DEBUG_ATOMICS
1045 #warning "Not using atomics"
1048 typedef volatile __pyx_atomic_int_type __pyx_atomic_int;
1050 #define __pyx_add_acquisition_count(memview)\
1051 __pyx_atomic_incr_aligned(__pyx_get_slice_count_pointer(memview), memview->lock)
1052 #define __pyx_sub_acquisition_count(memview)\
1053 __pyx_atomic_decr_aligned(__pyx_get_slice_count_pointer(memview), memview->lock)
1055 #define __pyx_add_acquisition_count(memview)\
1056 __pyx_add_acquisition_count_locked(__pyx_get_slice_count_pointer(memview), memview->lock)
1057 #define __pyx_sub_acquisition_count(memview)\
1058 __pyx_sub_acquisition_count_locked(__pyx_get_slice_count_pointer(memview), memview->lock)
1062 struct __pyx_memoryview_obj;
1064 struct __pyx_memoryview_obj *memview;
1066 Py_ssize_t shape[8];
1067 Py_ssize_t strides[8];
1068 Py_ssize_t suboffsets[8];
1069 } __Pyx_memviewslice;
1070 #define __Pyx_MemoryView_Len(m) (m.shape[0])
1080 typedef npy_int8 __pyx_t_5numpy_int8_t;
1089 typedef npy_int16 __pyx_t_5numpy_int16_t;
1098 typedef npy_int32 __pyx_t_5numpy_int32_t;
1107 typedef npy_int64 __pyx_t_5numpy_int64_t;
1116 typedef npy_uint8 __pyx_t_5numpy_uint8_t;
1125 typedef npy_uint16 __pyx_t_5numpy_uint16_t;
1134 typedef npy_uint32 __pyx_t_5numpy_uint32_t;
1143 typedef npy_uint64 __pyx_t_5numpy_uint64_t;
1152 typedef npy_float32 __pyx_t_5numpy_float32_t;
1161 typedef npy_float64 __pyx_t_5numpy_float64_t;
1170 typedef npy_long __pyx_t_5numpy_int_t;
1179 typedef npy_longlong __pyx_t_5numpy_long_t;
1188 typedef npy_longlong __pyx_t_5numpy_longlong_t;
1197 typedef npy_ulong __pyx_t_5numpy_uint_t;
1206 typedef npy_ulonglong __pyx_t_5numpy_ulong_t;
1215 typedef npy_ulonglong __pyx_t_5numpy_ulonglong_t;
1224 typedef npy_intp __pyx_t_5numpy_intp_t;
1233 typedef npy_uintp __pyx_t_5numpy_uintp_t;
1242 typedef npy_double __pyx_t_5numpy_float_t;
1251 typedef npy_double __pyx_t_5numpy_double_t;
1260 typedef npy_longdouble __pyx_t_5numpy_longdouble_t;
1264 typedef ::std::complex< float > __pyx_t_float_complex;
1266 typedef float _Complex __pyx_t_float_complex;
1269 typedef struct {
float real, imag; } __pyx_t_float_complex;
1271 static CYTHON_INLINE __pyx_t_float_complex __pyx_t_float_complex_from_parts(
float,
float);
1276 typedef ::std::complex< double > __pyx_t_double_complex;
1278 typedef double _Complex __pyx_t_double_complex;
1281 typedef struct {
double real, imag; } __pyx_t_double_complex;
1283 static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(
double,
double);
1287 struct __pyx_obj_14flcbdfWrappers_FLCBDF_integrator;
1288 struct __pyx_array_obj;
1289 struct __pyx_MemviewEnum_obj;
1290 struct __pyx_memoryview_obj;
1291 struct __pyx_memoryviewslice_obj;
1300 typedef npy_cfloat __pyx_t_5numpy_cfloat_t;
1309 typedef npy_cdouble __pyx_t_5numpy_cdouble_t;
1318 typedef npy_clongdouble __pyx_t_5numpy_clongdouble_t;
1327 typedef npy_cdouble __pyx_t_5numpy_complex_t;
1336 struct __pyx_obj_14flcbdfWrappers_FLCBDF_integrator {
1338 Daetk::Petsc::Sys *petscSys;
1339 Daetk::WeightedL2Norm *wNormp;
1340 Daetk::FullDataFile *data;
1341 Daetk::FLCBDF_lite *flcbdf;
1342 Daetk::Petsc::Vec *yVec;
1343 Daetk::Petsc::Vec *DyVec;
1344 Daetk::Petsc::Vec *yprimeVec;
1345 Daetk::Petsc::Vec *DyprimeVec;
1346 Daetk::Petsc::Vec *sizeVec;
1357 struct __pyx_array_obj {
1359 struct __pyx_vtabstruct_array *__pyx_vtab;
1365 Py_ssize_t *_strides;
1366 Py_ssize_t itemsize;
1369 void (*callback_free_data)(
void *);
1371 int dtype_is_object;
1382 struct __pyx_MemviewEnum_obj {
1395 struct __pyx_memoryview_obj {
1397 struct __pyx_vtabstruct_memoryview *__pyx_vtab;
1400 PyObject *_array_interface;
1401 PyThread_type_lock lock;
1402 __pyx_atomic_int acquisition_count[2];
1403 __pyx_atomic_int *acquisition_count_aligned_p;
1406 int dtype_is_object;
1407 __Pyx_TypeInfo *typeinfo;
1418 struct __pyx_memoryviewslice_obj {
1419 struct __pyx_memoryview_obj __pyx_base;
1420 __Pyx_memviewslice from_slice;
1421 PyObject *from_object;
1422 PyObject *(*to_object_func)(
char *);
1423 int (*to_dtype_func)(
char *, PyObject *);
1436 struct __pyx_vtabstruct_array {
1437 PyObject *(*get_memview)(
struct __pyx_array_obj *);
1439 static struct __pyx_vtabstruct_array *__pyx_vtabptr_array;
1450 struct __pyx_vtabstruct_memoryview {
1451 char *(*get_item_pointer)(
struct __pyx_memoryview_obj *, PyObject *);
1452 PyObject *(*is_slice)(
struct __pyx_memoryview_obj *, PyObject *);
1453 PyObject *(*setitem_slice_assignment)(
struct __pyx_memoryview_obj *, PyObject *, PyObject *);
1454 PyObject *(*setitem_slice_assign_scalar)(
struct __pyx_memoryview_obj *,
struct __pyx_memoryview_obj *, PyObject *);
1455 PyObject *(*setitem_indexed)(
struct __pyx_memoryview_obj *, PyObject *, PyObject *);
1456 PyObject *(*convert_item_to_object)(
struct __pyx_memoryview_obj *,
char *);
1457 PyObject *(*assign_item_from_object)(
struct __pyx_memoryview_obj *,
char *, PyObject *);
1459 static struct __pyx_vtabstruct_memoryview *__pyx_vtabptr_memoryview;
1470 struct __pyx_vtabstruct__memoryviewslice {
1471 struct __pyx_vtabstruct_memoryview __pyx_base;
1473 static struct __pyx_vtabstruct__memoryviewslice *__pyx_vtabptr__memoryviewslice;
1477 #ifndef CYTHON_REFNANNY
1478 #define CYTHON_REFNANNY 0
1482 void (*INCREF)(
void*, PyObject*, int);
1483 void (*DECREF)(
void*, PyObject*, int);
1484 void (*GOTREF)(
void*, PyObject*, int);
1485 void (*GIVEREF)(
void*, PyObject*, int);
1486 void* (*SetupContext)(
const char*, int,
const char*);
1487 void (*FinishContext)(
void**);
1488 } __Pyx_RefNannyAPIStruct;
1489 static __Pyx_RefNannyAPIStruct *__Pyx_RefNanny = NULL;
1490 static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(
const char *modname);
1491 #define __Pyx_RefNannyDeclarations void *__pyx_refnanny = NULL;
1493 #define __Pyx_RefNannySetupContext(name, acquire_gil)\
1495 PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();\
1496 __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__);\
1497 PyGILState_Release(__pyx_gilstate_save);\
1499 __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__);\
1502 #define __Pyx_RefNannySetupContext(name, acquire_gil)\
1503 __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__)
1505 #define __Pyx_RefNannyFinishContext()\
1506 __Pyx_RefNanny->FinishContext(&__pyx_refnanny)
1507 #define __Pyx_INCREF(r) __Pyx_RefNanny->INCREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
1508 #define __Pyx_DECREF(r) __Pyx_RefNanny->DECREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
1509 #define __Pyx_GOTREF(r) __Pyx_RefNanny->GOTREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
1510 #define __Pyx_GIVEREF(r) __Pyx_RefNanny->GIVEREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
1511 #define __Pyx_XINCREF(r) do { if((r) != NULL) {__Pyx_INCREF(r); }} while(0)
1512 #define __Pyx_XDECREF(r) do { if((r) != NULL) {__Pyx_DECREF(r); }} while(0)
1513 #define __Pyx_XGOTREF(r) do { if((r) != NULL) {__Pyx_GOTREF(r); }} while(0)
1514 #define __Pyx_XGIVEREF(r) do { if((r) != NULL) {__Pyx_GIVEREF(r);}} while(0)
1516 #define __Pyx_RefNannyDeclarations
1517 #define __Pyx_RefNannySetupContext(name, acquire_gil)
1518 #define __Pyx_RefNannyFinishContext()
1519 #define __Pyx_INCREF(r) Py_INCREF(r)
1520 #define __Pyx_DECREF(r) Py_DECREF(r)
1521 #define __Pyx_GOTREF(r)
1522 #define __Pyx_GIVEREF(r)
1523 #define __Pyx_XINCREF(r) Py_XINCREF(r)
1524 #define __Pyx_XDECREF(r) Py_XDECREF(r)
1525 #define __Pyx_XGOTREF(r)
1526 #define __Pyx_XGIVEREF(r)
1528 #define __Pyx_XDECREF_SET(r, v) do {\
1529 PyObject *tmp = (PyObject *) r;\
1530 r = v; __Pyx_XDECREF(tmp);\
1532 #define __Pyx_DECREF_SET(r, v) do {\
1533 PyObject *tmp = (PyObject *) r;\
1534 r = v; __Pyx_DECREF(tmp);\
1536 #define __Pyx_CLEAR(r) do { PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);} while(0)
1537 #define __Pyx_XCLEAR(r) do { if((r) != NULL) {PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);}} while(0)
1540 #if CYTHON_USE_TYPE_SLOTS
1541 static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name);
1543 #define __Pyx_PyObject_GetAttrStr(o,n) PyObject_GetAttr(o,n)
1547 static PyObject *__Pyx_GetBuiltinName(PyObject *name);
1550 static void __Pyx_RaiseArgtupleInvalid(
const char* func_name,
int exact,
1551 Py_ssize_t num_min, Py_ssize_t num_max, Py_ssize_t num_found);
1554 static void __Pyx_RaiseDoubleKeywordsError(
const char* func_name, PyObject* kw_name);
1557 static int __Pyx_ParseOptionalKeywords(PyObject *kwds, PyObject **argnames[],\
1558 PyObject *kwds2, PyObject *values[], Py_ssize_t num_pos_args,\
1559 const char* function_name);
1562 #define __Pyx_ArgTypeTest(obj, type, none_allowed, name, exact)\
1563 ((likely((Py_TYPE(obj) == type) | (none_allowed && (obj == Py_None)))) ? 1 :\
1564 __Pyx__ArgTypeTest(obj, type, name, exact))
1565 static int __Pyx__ArgTypeTest(PyObject *obj, PyTypeObject *type,
const char *name,
int exact);
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_FAST_PYCCALL
1616 static CYTHON_INLINE PyObject *__Pyx_PyCFunction_FastCall(PyObject *func, PyObject **args, Py_ssize_t nargs);
1618 #define __Pyx_PyCFunction_FastCall(func, args, nargs) (assert(0), NULL)
1622 #if CYTHON_FAST_PYCALL
1623 #define __Pyx_PyFunction_FastCall(func, args, nargs)\
1624 __Pyx_PyFunction_FastCallDict((func), (args), (nargs), NULL)
1625 #if 1 || PY_VERSION_HEX < 0x030600B1
1626 static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args, Py_ssize_t nargs, PyObject *kwargs);
1628 #define __Pyx_PyFunction_FastCallDict(func, args, nargs, kwargs) _PyFunction_FastCallDict(func, args, nargs, kwargs)
1630 #define __Pyx_BUILD_ASSERT_EXPR(cond)\
1631 (sizeof(char [1 - 2*!(cond)]) - 1)
1632 #ifndef Py_MEMBER_SIZE
1633 #define Py_MEMBER_SIZE(type, member) sizeof(((type *)0)->member)
1635 #if CYTHON_FAST_PYCALL
1636 static size_t __pyx_pyframe_localsplus_offset = 0;
1637 #include "frameobject.h"
1638 #if PY_VERSION_HEX >= 0x030b00a6
1639 #ifndef Py_BUILD_CORE
1640 #define Py_BUILD_CORE 1
1642 #include "internal/pycore_frame.h"
1644 #define __Pxy_PyFrame_Initialize_Offsets()\
1645 ((void)__Pyx_BUILD_ASSERT_EXPR(sizeof(PyFrameObject) == offsetof(PyFrameObject, f_localsplus) + Py_MEMBER_SIZE(PyFrameObject, f_localsplus)),\
1646 (void)(__pyx_pyframe_localsplus_offset = ((size_t)PyFrame_Type.tp_basicsize) - Py_MEMBER_SIZE(PyFrameObject, f_localsplus)))
1647 #define __Pyx_PyFrame_GetLocalsplus(frame)\
1648 (assert(__pyx_pyframe_localsplus_offset), (PyObject **)(((char *)(frame)) + __pyx_pyframe_localsplus_offset))
1649 #endif // CYTHON_FAST_PYCALL
1653 #if CYTHON_COMPILING_IN_CPYTHON
1654 static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw);
1656 #define __Pyx_PyObject_Call(func, arg, kw) PyObject_Call(func, arg, kw)
1660 static CYTHON_UNUSED PyObject* __Pyx_PyObject_Call2Args(PyObject*
function, PyObject* arg1, PyObject* arg2);
1663 #if CYTHON_COMPILING_IN_CPYTHON
1664 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg);
1668 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg);
1671 #define __Pyx_PyObject_DelSlice(obj, cstart, cstop, py_start, py_stop, py_slice, has_cstart, has_cstop, wraparound)\
1672 __Pyx_PyObject_SetSlice(obj, (PyObject*)NULL, cstart, cstop, py_start, py_stop, py_slice, has_cstart, has_cstop, wraparound)
1673 static CYTHON_INLINE
int __Pyx_PyObject_SetSlice(
1674 PyObject* obj, PyObject* value, Py_ssize_t cstart, Py_ssize_t cstop,
1675 PyObject** py_start, PyObject** py_stop, PyObject** py_slice,
1676 int has_cstart,
int has_cstop,
int wraparound);
1679 #if CYTHON_COMPILING_IN_CPYTHON
1680 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallNoArg(PyObject *func);
1682 #define __Pyx_PyObject_CallNoArg(func) __Pyx_PyObject_Call(func, __pyx_empty_tuple, NULL)
1686 #if CYTHON_FAST_THREAD_STATE
1687 #define __Pyx_PyThreadState_declare PyThreadState *__pyx_tstate;
1688 #define __Pyx_PyThreadState_assign __pyx_tstate = __Pyx_PyThreadState_Current;
1689 #define __Pyx_PyErr_Occurred() __pyx_tstate->curexc_type
1691 #define __Pyx_PyThreadState_declare
1692 #define __Pyx_PyThreadState_assign
1693 #define __Pyx_PyErr_Occurred() PyErr_Occurred()
1697 #if CYTHON_FAST_THREAD_STATE
1698 #define __Pyx_PyErr_Clear() __Pyx_ErrRestore(NULL, NULL, NULL)
1699 #define __Pyx_ErrRestoreWithState(type, value, tb) __Pyx_ErrRestoreInState(PyThreadState_GET(), type, value, tb)
1700 #define __Pyx_ErrFetchWithState(type, value, tb) __Pyx_ErrFetchInState(PyThreadState_GET(), type, value, tb)
1701 #define __Pyx_ErrRestore(type, value, tb) __Pyx_ErrRestoreInState(__pyx_tstate, type, value, tb)
1702 #define __Pyx_ErrFetch(type, value, tb) __Pyx_ErrFetchInState(__pyx_tstate, type, value, tb)
1703 static CYTHON_INLINE
void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb);
1704 static CYTHON_INLINE
void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb);
1705 #if CYTHON_COMPILING_IN_CPYTHON
1706 #define __Pyx_PyErr_SetNone(exc) (Py_INCREF(exc), __Pyx_ErrRestore((exc), NULL, NULL))
1708 #define __Pyx_PyErr_SetNone(exc) PyErr_SetNone(exc)
1711 #define __Pyx_PyErr_Clear() PyErr_Clear()
1712 #define __Pyx_PyErr_SetNone(exc) PyErr_SetNone(exc)
1713 #define __Pyx_ErrRestoreWithState(type, value, tb) PyErr_Restore(type, value, tb)
1714 #define __Pyx_ErrFetchWithState(type, value, tb) PyErr_Fetch(type, value, tb)
1715 #define __Pyx_ErrRestoreInState(tstate, type, value, tb) PyErr_Restore(type, value, tb)
1716 #define __Pyx_ErrFetchInState(tstate, type, value, tb) PyErr_Fetch(type, value, tb)
1717 #define __Pyx_ErrRestore(type, value, tb) PyErr_Restore(type, value, tb)
1718 #define __Pyx_ErrFetch(type, value, tb) PyErr_Fetch(type, value, tb)
1722 static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause);
1725 #if CYTHON_USE_EXC_INFO_STACK
1726 static _PyErr_StackItem * __Pyx_PyErr_GetTopmostException(PyThreadState *tstate);
1730 #if CYTHON_FAST_THREAD_STATE
1731 #define __Pyx_ExceptionSave(type, value, tb) __Pyx__ExceptionSave(__pyx_tstate, type, value, tb)
1732 static CYTHON_INLINE
void __Pyx__ExceptionSave(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb);
1733 #define __Pyx_ExceptionReset(type, value, tb) __Pyx__ExceptionReset(__pyx_tstate, type, value, tb)
1734 static CYTHON_INLINE
void __Pyx__ExceptionReset(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb);
1736 #define __Pyx_ExceptionSave(type, value, tb) PyErr_GetExcInfo(type, value, tb)
1737 #define __Pyx_ExceptionReset(type, value, tb) PyErr_SetExcInfo(type, value, tb)
1741 #if CYTHON_FAST_THREAD_STATE
1742 #define __Pyx_PyErr_ExceptionMatches(err) __Pyx_PyErr_ExceptionMatchesInState(__pyx_tstate, err)
1743 static CYTHON_INLINE
int __Pyx_PyErr_ExceptionMatchesInState(PyThreadState* tstate, PyObject* err);
1745 #define __Pyx_PyErr_ExceptionMatches(err) PyErr_ExceptionMatches(err)
1749 #if CYTHON_FAST_THREAD_STATE
1750 #define __Pyx_GetException(type, value, tb) __Pyx__GetException(__pyx_tstate, type, value, tb)
1751 static int __Pyx__GetException(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb);
1753 static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb);
1760 static CYTHON_INLINE
int __Pyx_PyBytes_Equals(PyObject* s1, PyObject* s2,
int equals);
1763 static CYTHON_INLINE
int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2,
int equals);
1766 #if PY_MAJOR_VERSION >= 3
1767 #define __Pyx_PyString_Equals __Pyx_PyUnicode_Equals
1769 #define __Pyx_PyString_Equals __Pyx_PyBytes_Equals
1773 static CYTHON_INLINE Py_ssize_t __Pyx_div_Py_ssize_t(Py_ssize_t, Py_ssize_t);
1776 #define UNARY_NEG_WOULD_OVERFLOW(x)\
1777 (((x) < 0) & ((unsigned long)(x) == 0-(unsigned long)(x)))
1779 static CYTHON_UNUSED
int __pyx_array_getbuffer(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info,
int __pyx_v_flags);
1780 static PyObject *__pyx_array_get_memview(
struct __pyx_array_obj *);
1782 static CYTHON_INLINE PyObject *__Pyx_GetAttr(PyObject *, PyObject *);
1785 #define __Pyx_GetItemInt(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\
1786 (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\
1787 __Pyx_GetItemInt_Fast(o, (Py_ssize_t)i, is_list, wraparound, boundscheck) :\
1788 (is_list ? (PyErr_SetString(PyExc_IndexError, "list index out of range"), (PyObject*)NULL) :\
1789 __Pyx_GetItemInt_Generic(o, to_py_func(i))))
1790 #define __Pyx_GetItemInt_List(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\
1791 (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\
1792 __Pyx_GetItemInt_List_Fast(o, (Py_ssize_t)i, wraparound, boundscheck) :\
1793 (PyErr_SetString(PyExc_IndexError, "list index out of range"), (PyObject*)NULL))
1794 static CYTHON_INLINE PyObject *__Pyx_GetItemInt_List_Fast(PyObject *o, Py_ssize_t i,
1795 int wraparound,
int boundscheck);
1796 #define __Pyx_GetItemInt_Tuple(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\
1797 (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\
1798 __Pyx_GetItemInt_Tuple_Fast(o, (Py_ssize_t)i, wraparound, boundscheck) :\
1799 (PyErr_SetString(PyExc_IndexError, "tuple index out of range"), (PyObject*)NULL))
1800 static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize_t i,
1801 int wraparound,
int boundscheck);
1802 static PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j);
1803 static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i,
1804 int is_list,
int wraparound,
int boundscheck);
1807 #if CYTHON_USE_TYPE_SLOTS
1808 static CYTHON_INLINE PyObject *__Pyx_PyObject_GetItem(PyObject *obj, PyObject* key);
1810 #define __Pyx_PyObject_GetItem(obj, key) PyObject_GetItem(obj, key)
1814 static CYTHON_INLINE PyObject *__Pyx_PyUnicode_DecodeUTF16(
const char *
s, Py_ssize_t size,
const char *errors) {
1816 return PyUnicode_DecodeUTF16(
s, size, errors, &byteorder);
1818 static CYTHON_INLINE PyObject *__Pyx_PyUnicode_DecodeUTF16LE(
const char *
s, Py_ssize_t size,
const char *errors) {
1820 return PyUnicode_DecodeUTF16(
s, size, errors, &byteorder);
1822 static CYTHON_INLINE PyObject *__Pyx_PyUnicode_DecodeUTF16BE(
const char *
s, Py_ssize_t size,
const char *errors) {
1824 return PyUnicode_DecodeUTF16(
s, size, errors, &byteorder);
1828 static CYTHON_INLINE PyObject* __Pyx_decode_c_string(
1829 const char* cstring, Py_ssize_t start, Py_ssize_t stop,
1830 const char* encoding,
const char* errors,
1831 PyObject* (*decode_func)(
const char *
s, Py_ssize_t size,
const char *errors));
1834 static CYTHON_INLINE PyObject *__Pyx_GetAttr3(PyObject *, PyObject *, PyObject *);
1837 static CYTHON_INLINE
void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected);
1840 static CYTHON_INLINE
void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index);
1843 static CYTHON_INLINE
void __Pyx_RaiseNoneNotIterableError(
void);
1846 static CYTHON_INLINE
int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type);
1849 #if CYTHON_FAST_THREAD_STATE
1850 #define __Pyx_ExceptionSwap(type, value, tb) __Pyx__ExceptionSwap(__pyx_tstate, type, value, tb)
1851 static CYTHON_INLINE
void __Pyx__ExceptionSwap(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb);
1853 static CYTHON_INLINE
void __Pyx_ExceptionSwap(PyObject **type, PyObject **value, PyObject **tb);
1857 static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list,
int level);
1860 #if CYTHON_COMPILING_IN_CPYTHON
1861 #define __Pyx_TypeCheck(obj, type) __Pyx_IsSubtype(Py_TYPE(obj), (PyTypeObject *)type)
1862 static CYTHON_INLINE
int __Pyx_IsSubtype(PyTypeObject *a, PyTypeObject *b);
1863 static CYTHON_INLINE
int __Pyx_PyErr_GivenExceptionMatches(PyObject *err, PyObject *type);
1864 static CYTHON_INLINE
int __Pyx_PyErr_GivenExceptionMatches2(PyObject *err, PyObject *type1, PyObject *type2);
1866 #define __Pyx_TypeCheck(obj, type) PyObject_TypeCheck(obj, (PyTypeObject *)type)
1867 #define __Pyx_PyErr_GivenExceptionMatches(err, type) PyErr_GivenExceptionMatches(err, type)
1868 #define __Pyx_PyErr_GivenExceptionMatches2(err, type1, type2) (PyErr_GivenExceptionMatches(err, type1) || PyErr_GivenExceptionMatches(err, type2))
1870 #define __Pyx_PyException_Check(obj) __Pyx_TypeCheck(obj, PyExc_Exception)
1872 static CYTHON_UNUSED
int __pyx_memoryview_getbuffer(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info,
int __pyx_v_flags);
1874 #if CYTHON_USE_PYLIST_INTERNALS && CYTHON_ASSUME_SAFE_MACROS
1875 static CYTHON_INLINE
int __Pyx_ListComp_Append(PyObject* list, PyObject* x) {
1876 PyListObject*
L = (PyListObject*) list;
1877 Py_ssize_t len = Py_SIZE(list);
1878 if (likely(
L->allocated > len)) {
1880 PyList_SET_ITEM(list, len, x);
1881 __Pyx_SET_SIZE(list, len + 1);
1884 return PyList_Append(list, x);
1887 #define __Pyx_ListComp_Append(L,x) PyList_Append(L,x)
1891 #if !CYTHON_COMPILING_IN_PYPY
1892 static PyObject* __Pyx_PyInt_AddObjC(PyObject *op1, PyObject *op2,
long intval,
int inplace,
int zerodivision_check);
1894 #define __Pyx_PyInt_AddObjC(op1, op2, intval, inplace, zerodivision_check)\
1895 (inplace ? PyNumber_InPlaceAdd(op1, op2) : PyNumber_Add(op1, op2))
1899 static CYTHON_INLINE
int __Pyx_PyList_Extend(PyObject*
L, PyObject*
v) {
1900 #if CYTHON_COMPILING_IN_CPYTHON
1901 PyObject* none = _PyList_Extend((PyListObject*)
L,
v);
1902 if (unlikely(!none))
1907 return PyList_SetSlice(
L, PY_SSIZE_T_MAX, PY_SSIZE_T_MAX,
v);
1912 #if CYTHON_USE_PYLIST_INTERNALS && CYTHON_ASSUME_SAFE_MACROS
1913 static CYTHON_INLINE
int __Pyx_PyList_Append(PyObject* list, PyObject* x) {
1914 PyListObject*
L = (PyListObject*) list;
1915 Py_ssize_t len = Py_SIZE(list);
1916 if (likely(
L->allocated > len) & likely(len > (
L->allocated >> 1))) {
1918 PyList_SET_ITEM(list, len, x);
1919 __Pyx_SET_SIZE(list, len + 1);
1922 return PyList_Append(list, x);
1925 #define __Pyx_PyList_Append(L,x) PyList_Append(L,x)
1929 static CYTHON_INLINE
void __Pyx_RaiseUnboundLocalError(
const char *varname);
1932 static CYTHON_INLINE
long __Pyx_div_long(
long,
long);
1935 static CYTHON_INLINE
int __Pyx_PySequence_ContainsTF(PyObject* item, PyObject* seq,
int eq) {
1936 int result = PySequence_Contains(seq, item);
1937 return unlikely(result < 0) ? result : (result == (eq == Py_EQ));
1941 static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name);
1944 static CYTHON_INLINE
int __Pyx_HasAttr(PyObject *, PyObject *);
1947 #if PY_MAJOR_VERSION < 3
1948 #define __Pyx_PyString_Join __Pyx_PyBytes_Join
1949 #define __Pyx_PyBaseString_Join(s, v) (PyUnicode_CheckExact(s) ? PyUnicode_Join(s, v) : __Pyx_PyBytes_Join(s, v))
1951 #define __Pyx_PyString_Join PyUnicode_Join
1952 #define __Pyx_PyBaseString_Join PyUnicode_Join
1954 #if CYTHON_COMPILING_IN_CPYTHON
1955 #if PY_MAJOR_VERSION < 3
1956 #define __Pyx_PyBytes_Join _PyString_Join
1958 #define __Pyx_PyBytes_Join _PyBytes_Join
1961 static CYTHON_INLINE PyObject* __Pyx_PyBytes_Join(PyObject* sep, PyObject* values);
1965 #if PY_MAJOR_VERSION >= 3
1966 #define __Pyx_PyObject_Unicode(obj)\
1967 (likely(PyUnicode_CheckExact(obj)) ? __Pyx_NewRef(obj) : PyObject_Str(obj))
1969 #define __Pyx_PyObject_Unicode(obj)\
1970 (likely(PyUnicode_CheckExact(obj)) ? __Pyx_NewRef(obj) : PyObject_Unicode(obj))
1974 #if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000
1975 static CYTHON_INLINE PyObject* __Pyx_PyObject_GenericGetAttrNoDict(PyObject* obj, PyObject* attr_name);
1977 #define __Pyx_PyObject_GenericGetAttrNoDict PyObject_GenericGetAttr
1981 #if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000
1982 static PyObject* __Pyx_PyObject_GenericGetAttr(PyObject* obj, PyObject* attr_name);
1984 #define __Pyx_PyObject_GenericGetAttr PyObject_GenericGetAttr
1988 static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStrNoError(PyObject* obj, PyObject* attr_name);
1991 static int __Pyx_setup_reduce(PyObject* type_obj);
1994 static int __Pyx_SetVtable(PyObject *dict,
void *vtable);
1997 #ifndef __PYX_HAVE_RT_ImportType_proto
1998 #define __PYX_HAVE_RT_ImportType_proto
1999 enum __Pyx_ImportType_CheckSize {
2000 __Pyx_ImportType_CheckSize_Error = 0,
2001 __Pyx_ImportType_CheckSize_Warn = 1,
2002 __Pyx_ImportType_CheckSize_Ignore = 2
2004 static PyTypeObject *__Pyx_ImportType(PyObject* module,
const char *module_name,
const char *class_name,
size_t size,
enum __Pyx_ImportType_CheckSize check_size);
2008 #ifdef CYTHON_CLINE_IN_TRACEBACK
2009 #define __Pyx_CLineForTraceback(tstate, c_line) (((CYTHON_CLINE_IN_TRACEBACK)) ? c_line : 0)
2011 static int __Pyx_CLineForTraceback(PyThreadState *tstate,
int c_line);
2016 PyCodeObject* code_object;
2018 } __Pyx_CodeObjectCacheEntry;
2019 struct __Pyx_CodeObjectCache {
2022 __Pyx_CodeObjectCacheEntry* entries;
2024 static struct __Pyx_CodeObjectCache __pyx_code_cache = {0,0,NULL};
2025 static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries,
int count,
int code_line);
2026 static PyCodeObject *__pyx_find_code_object(
int code_line);
2027 static void __pyx_insert_code_object(
int code_line, PyCodeObject* code_object);
2030 static void __Pyx_AddTraceback(
const char *funcname,
int c_line,
2031 int py_line,
const char *filename);
2034 #if defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 6))
2035 #define __Pyx_HAS_GCC_DIAGNOSTIC
2039 static CYTHON_INLINE PyObject *__pyx_memview_get_double(
const char *itemp);
2040 static CYTHON_INLINE
int __pyx_memview_set_double(
const char *itemp, PyObject *obj);
2045 #define __Pyx_CREAL(z) ((z).real())
2046 #define __Pyx_CIMAG(z) ((z).imag())
2048 #define __Pyx_CREAL(z) (__real__(z))
2049 #define __Pyx_CIMAG(z) (__imag__(z))
2052 #define __Pyx_CREAL(z) ((z).real)
2053 #define __Pyx_CIMAG(z) ((z).imag)
2055 #if defined(__cplusplus) && CYTHON_CCOMPLEX\
2056 && (defined(_WIN32) || defined(__clang__) || (defined(__GNUC__) && (__GNUC__ >= 5 || __GNUC__ == 4 && __GNUC_MINOR__ >= 4 )) || __cplusplus >= 201103)
2057 #define __Pyx_SET_CREAL(z,x) ((z).real(x))
2058 #define __Pyx_SET_CIMAG(z,y) ((z).imag(y))
2060 #define __Pyx_SET_CREAL(z,x) __Pyx_CREAL(z) = (x)
2061 #define __Pyx_SET_CIMAG(z,y) __Pyx_CIMAG(z) = (y)
2066 #define __Pyx_c_eq_float(a, b) ((a)==(b))
2067 #define __Pyx_c_sum_float(a, b) ((a)+(b))
2068 #define __Pyx_c_diff_float(a, b) ((a)-(b))
2069 #define __Pyx_c_prod_float(a, b) ((a)*(b))
2070 #define __Pyx_c_quot_float(a, b) ((a)/(b))
2071 #define __Pyx_c_neg_float(a) (-(a))
2073 #define __Pyx_c_is_zero_float(z) ((z)==(float)0)
2074 #define __Pyx_c_conj_float(z) (::std::conj(z))
2076 #define __Pyx_c_abs_float(z) (::std::abs(z))
2077 #define __Pyx_c_pow_float(a, b) (::std::pow(a, b))
2080 #define __Pyx_c_is_zero_float(z) ((z)==0)
2081 #define __Pyx_c_conj_float(z) (conjf(z))
2083 #define __Pyx_c_abs_float(z) (cabsf(z))
2084 #define __Pyx_c_pow_float(a, b) (cpowf(a, b))
2088 static CYTHON_INLINE
int __Pyx_c_eq_float(__pyx_t_float_complex, __pyx_t_float_complex);
2089 static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_sum_float(__pyx_t_float_complex, __pyx_t_float_complex);
2090 static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_diff_float(__pyx_t_float_complex, __pyx_t_float_complex);
2091 static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_prod_float(__pyx_t_float_complex, __pyx_t_float_complex);
2092 static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_quot_float(__pyx_t_float_complex, __pyx_t_float_complex);
2093 static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_neg_float(__pyx_t_float_complex);
2094 static CYTHON_INLINE
int __Pyx_c_is_zero_float(__pyx_t_float_complex);
2095 static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_conj_float(__pyx_t_float_complex);
2097 static CYTHON_INLINE
float __Pyx_c_abs_float(__pyx_t_float_complex);
2098 static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_pow_float(__pyx_t_float_complex, __pyx_t_float_complex);
2104 #define __Pyx_c_eq_double(a, b) ((a)==(b))
2105 #define __Pyx_c_sum_double(a, b) ((a)+(b))
2106 #define __Pyx_c_diff_double(a, b) ((a)-(b))
2107 #define __Pyx_c_prod_double(a, b) ((a)*(b))
2108 #define __Pyx_c_quot_double(a, b) ((a)/(b))
2109 #define __Pyx_c_neg_double(a) (-(a))
2111 #define __Pyx_c_is_zero_double(z) ((z)==(double)0)
2112 #define __Pyx_c_conj_double(z) (::std::conj(z))
2114 #define __Pyx_c_abs_double(z) (::std::abs(z))
2115 #define __Pyx_c_pow_double(a, b) (::std::pow(a, b))
2118 #define __Pyx_c_is_zero_double(z) ((z)==0)
2119 #define __Pyx_c_conj_double(z) (conj(z))
2121 #define __Pyx_c_abs_double(z) (cabs(z))
2122 #define __Pyx_c_pow_double(a, b) (cpow(a, b))
2126 static CYTHON_INLINE
int __Pyx_c_eq_double(__pyx_t_double_complex, __pyx_t_double_complex);
2127 static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_sum_double(__pyx_t_double_complex, __pyx_t_double_complex);
2128 static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_diff_double(__pyx_t_double_complex, __pyx_t_double_complex);
2129 static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_prod_double(__pyx_t_double_complex, __pyx_t_double_complex);
2130 static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_quot_double(__pyx_t_double_complex, __pyx_t_double_complex);
2131 static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_neg_double(__pyx_t_double_complex);
2132 static CYTHON_INLINE
int __Pyx_c_is_zero_double(__pyx_t_double_complex);
2133 static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_conj_double(__pyx_t_double_complex);
2135 static CYTHON_INLINE
double __Pyx_c_abs_double(__pyx_t_double_complex);
2136 static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_pow_double(__pyx_t_double_complex, __pyx_t_double_complex);
2140 #if PY_MAJOR_VERSION < 3
2141 static int __Pyx_GetBuffer(PyObject *obj, Py_buffer *view,
int flags);
2142 static void __Pyx_ReleaseBuffer(Py_buffer *view);
2144 #define __Pyx_GetBuffer PyObject_GetBuffer
2145 #define __Pyx_ReleaseBuffer PyBuffer_Release
2151 Py_ssize_t shape, strides, suboffsets;
2152 } __Pyx_Buf_DimInfo;
2158 __Pyx_Buffer *rcbuffer;
2160 __Pyx_Buf_DimInfo diminfo[8];
2161 } __Pyx_LocalBuf_ND;
2164 static int __pyx_memviewslice_is_contig(
const __Pyx_memviewslice mvs,
char order,
int ndim);
2167 static int __pyx_slices_overlap(__Pyx_memviewslice *slice1,
2168 __Pyx_memviewslice *slice2,
2169 int ndim,
size_t itemsize);
2172 static CYTHON_INLINE PyObject *__pyx_capsule_create(
void *p,
const char *sig);
2175 static CYTHON_INLINE
int __Pyx_PyInt_As_int(PyObject *);
2178 static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(
int value);
2181 struct __pyx_typeinfo_string {
2184 static struct __pyx_typeinfo_string __Pyx_TypeInfoToFormat(__Pyx_TypeInfo *type);
2187 static __Pyx_memviewslice
2188 __pyx_memoryview_copy_new_contig(
const __Pyx_memviewslice *from_mvs,
2189 const char *mode,
int ndim,
2190 size_t sizeof_dtype,
int contig_flag,
2191 int dtype_is_object);
2194 #define __Pyx_BUF_MAX_NDIMS %(BUF_MAX_NDIMS)d
2195 #define __Pyx_MEMVIEW_DIRECT 1
2196 #define __Pyx_MEMVIEW_PTR 2
2197 #define __Pyx_MEMVIEW_FULL 4
2198 #define __Pyx_MEMVIEW_CONTIG 8
2199 #define __Pyx_MEMVIEW_STRIDED 16
2200 #define __Pyx_MEMVIEW_FOLLOW 32
2201 #define __Pyx_IS_C_CONTIG 1
2202 #define __Pyx_IS_F_CONTIG 2
2203 static int __Pyx_init_memviewslice(
2204 struct __pyx_memoryview_obj *memview,
2206 __Pyx_memviewslice *memviewslice,
2207 int memview_is_new_reference);
2208 static CYTHON_INLINE
int __pyx_add_acquisition_count_locked(
2209 __pyx_atomic_int *acquisition_count, PyThread_type_lock lock);
2210 static CYTHON_INLINE
int __pyx_sub_acquisition_count_locked(
2211 __pyx_atomic_int *acquisition_count, PyThread_type_lock lock);
2212 #define __pyx_get_slice_count_pointer(memview) (memview->acquisition_count_aligned_p)
2213 #define __pyx_get_slice_count(memview) (*__pyx_get_slice_count_pointer(memview))
2214 #define __PYX_INC_MEMVIEW(slice, have_gil) __Pyx_INC_MEMVIEW(slice, have_gil, __LINE__)
2215 #define __PYX_XDEC_MEMVIEW(slice, have_gil) __Pyx_XDEC_MEMVIEW(slice, have_gil, __LINE__)
2216 static CYTHON_INLINE
void __Pyx_INC_MEMVIEW(__Pyx_memviewslice *,
int,
int);
2217 static CYTHON_INLINE
void __Pyx_XDEC_MEMVIEW(__Pyx_memviewslice *,
int,
int);
2220 static CYTHON_INLINE
long __Pyx_PyInt_As_long(PyObject *);
2223 static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(
long value);
2226 static CYTHON_INLINE
char __Pyx_PyInt_As_char(PyObject *);
2229 static int __Pyx_check_binary_version(
void);
2232 static int __Pyx_InitStrings(__Pyx_StringTabEntry *t);
2234 static PyObject *__pyx_array_get_memview(
struct __pyx_array_obj *__pyx_v_self);
2235 static char *__pyx_memoryview_get_item_pointer(
struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index);
2236 static PyObject *__pyx_memoryview_is_slice(
struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_obj);
2237 static PyObject *__pyx_memoryview_setitem_slice_assignment(
struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_dst, PyObject *__pyx_v_src);
2238 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);
2239 static PyObject *__pyx_memoryview_setitem_indexed(
struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index, PyObject *__pyx_v_value);
2240 static PyObject *__pyx_memoryview_convert_item_to_object(
struct __pyx_memoryview_obj *__pyx_v_self,
char *__pyx_v_itemp);
2241 static PyObject *__pyx_memoryview_assign_item_from_object(
struct __pyx_memoryview_obj *__pyx_v_self,
char *__pyx_v_itemp, PyObject *__pyx_v_value);
2242 static PyObject *__pyx_memoryviewslice_convert_item_to_object(
struct __pyx_memoryviewslice_obj *__pyx_v_self,
char *__pyx_v_itemp);
2243 static PyObject *__pyx_memoryviewslice_assign_item_from_object(
struct __pyx_memoryviewslice_obj *__pyx_v_self,
char *__pyx_v_itemp, PyObject *__pyx_v_value);
2254 static PyTypeObject *__pyx_ptype_7cpython_4type_type = 0;
2267 static PyTypeObject *__pyx_ptype_5numpy_dtype = 0;
2268 static PyTypeObject *__pyx_ptype_5numpy_flatiter = 0;
2269 static PyTypeObject *__pyx_ptype_5numpy_broadcast = 0;
2270 static PyTypeObject *__pyx_ptype_5numpy_ndarray = 0;
2271 static PyTypeObject *__pyx_ptype_5numpy_generic = 0;
2272 static PyTypeObject *__pyx_ptype_5numpy_number = 0;
2273 static PyTypeObject *__pyx_ptype_5numpy_integer = 0;
2274 static PyTypeObject *__pyx_ptype_5numpy_signedinteger = 0;
2275 static PyTypeObject *__pyx_ptype_5numpy_unsignedinteger = 0;
2276 static PyTypeObject *__pyx_ptype_5numpy_inexact = 0;
2277 static PyTypeObject *__pyx_ptype_5numpy_floating = 0;
2278 static PyTypeObject *__pyx_ptype_5numpy_complexfloating = 0;
2279 static PyTypeObject *__pyx_ptype_5numpy_flexible = 0;
2280 static PyTypeObject *__pyx_ptype_5numpy_character = 0;
2281 static PyTypeObject *__pyx_ptype_5numpy_ufunc = 0;
2286 static PyTypeObject *__pyx_ptype_14flcbdfWrappers_FLCBDF_integrator = 0;
2287 static PyTypeObject *__pyx_array_type = 0;
2288 static PyTypeObject *__pyx_MemviewEnum_type = 0;
2289 static PyTypeObject *__pyx_memoryview_type = 0;
2290 static PyTypeObject *__pyx_memoryviewslice_type = 0;
2291 static PyObject *
generic = 0;
2292 static PyObject *strided = 0;
2293 static PyObject *indirect = 0;
2294 static PyObject *contiguous = 0;
2295 static PyObject *indirect_contiguous = 0;
2296 static int __pyx_memoryview_thread_locks_used;
2297 static PyThread_type_lock __pyx_memoryview_thread_locks[8];
2298 static struct __pyx_array_obj *__pyx_array_new(PyObject *, Py_ssize_t,
char *,
char *,
char *);
2299 static void *__pyx_align_pointer(
void *,
size_t);
2300 static PyObject *__pyx_memoryview_new(PyObject *,
int,
int, __Pyx_TypeInfo *);
2301 static CYTHON_INLINE
int __pyx_memoryview_check(PyObject *);
2302 static PyObject *_unellipsify(PyObject *,
int);
2303 static PyObject *assert_direct_dimensions(Py_ssize_t *,
int);
2304 static struct __pyx_memoryview_obj *__pyx_memview_slice(
struct __pyx_memoryview_obj *, PyObject *);
2305 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);
2306 static char *__pyx_pybuffer_index(Py_buffer *,
char *, Py_ssize_t, Py_ssize_t);
2307 static int __pyx_memslice_transpose(__Pyx_memviewslice *);
2308 static PyObject *__pyx_memoryview_fromslice(__Pyx_memviewslice,
int, PyObject *(*)(
char *),
int (*)(
char *, PyObject *),
int);
2309 static __Pyx_memviewslice *__pyx_memoryview_get_slice_from_memoryview(
struct __pyx_memoryview_obj *, __Pyx_memviewslice *);
2310 static void __pyx_memoryview_slice_copy(
struct __pyx_memoryview_obj *, __Pyx_memviewslice *);
2311 static PyObject *__pyx_memoryview_copy_object(
struct __pyx_memoryview_obj *);
2312 static PyObject *__pyx_memoryview_copy_object_from_slice(
struct __pyx_memoryview_obj *, __Pyx_memviewslice *);
2313 static Py_ssize_t abs_py_ssize_t(Py_ssize_t);
2314 static char __pyx_get_best_slice_order(__Pyx_memviewslice *,
int);
2315 static void _copy_strided_to_strided(
char *, Py_ssize_t *,
char *, Py_ssize_t *, Py_ssize_t *, Py_ssize_t *,
int,
size_t);
2316 static void copy_strided_to_strided(__Pyx_memviewslice *, __Pyx_memviewslice *,
int,
size_t);
2317 static Py_ssize_t __pyx_memoryview_slice_get_size(__Pyx_memviewslice *,
int);
2318 static Py_ssize_t __pyx_fill_contig_strides_array(Py_ssize_t *, Py_ssize_t *, Py_ssize_t,
int,
char);
2319 static void *__pyx_memoryview_copy_data_to_temp(__Pyx_memviewslice *, __Pyx_memviewslice *,
char,
int);
2320 static int __pyx_memoryview_err_extents(
int, Py_ssize_t, Py_ssize_t);
2321 static int __pyx_memoryview_err_dim(PyObject *,
char *,
int);
2322 static int __pyx_memoryview_err(PyObject *,
char *);
2323 static int __pyx_memoryview_copy_contents(__Pyx_memviewslice, __Pyx_memviewslice,
int,
int,
int);
2324 static void __pyx_memoryview_broadcast_leading(__Pyx_memviewslice *,
int,
int);
2325 static void __pyx_memoryview_refcount_copying(__Pyx_memviewslice *,
int,
int,
int);
2326 static void __pyx_memoryview_refcount_objects_in_slice_with_gil(
char *, Py_ssize_t *, Py_ssize_t *,
int,
int);
2327 static void __pyx_memoryview_refcount_objects_in_slice(
char *, Py_ssize_t *, Py_ssize_t *,
int,
int);
2328 static void __pyx_memoryview_slice_assign_scalar(__Pyx_memviewslice *,
int,
size_t,
void *,
int);
2329 static void __pyx_memoryview__slice_assign_scalar(
char *, Py_ssize_t *, Py_ssize_t *,
int,
size_t,
void *);
2330 static PyObject *__pyx_unpickle_Enum__set_state(
struct __pyx_MemviewEnum_obj *, PyObject *);
2331 static PyObject *__pyx_format_from_typeinfo(__Pyx_TypeInfo *);
2332 static __Pyx_TypeInfo __Pyx_TypeInfo_double = {
"double", NULL,
sizeof(double), { 0 }, 0,
'R', 0, 0 };
2333 #define __Pyx_MODULE_NAME "flcbdfWrappers"
2334 extern int __pyx_module_is_main_flcbdfWrappers;
2335 int __pyx_module_is_main_flcbdfWrappers = 0;
2338 static PyObject *__pyx_builtin_TypeError;
2339 static PyObject *__pyx_builtin_ImportError;
2340 static PyObject *__pyx_builtin_ValueError;
2341 static PyObject *__pyx_builtin_MemoryError;
2342 static PyObject *__pyx_builtin_enumerate;
2343 static PyObject *__pyx_builtin_range;
2344 static PyObject *__pyx_builtin_Ellipsis;
2345 static PyObject *__pyx_builtin_id;
2346 static PyObject *__pyx_builtin_IndexError;
2347 static const char __pyx_k_O[] =
"O";
2348 static const char __pyx_k_T[] =
"T{";
2349 static const char __pyx_k_c[] =
"c";
2350 static const char __pyx_k_s[] =
"(%s)";
2351 static const char __pyx_k_t[] =
"t";
2352 static const char __pyx_k_y[] =
"y";
2353 static const char __pyx_k_Dy[] =
"Dy";
2354 static const char __pyx_k_dV[] =
"dV";
2355 static const char __pyx_k_id[] =
"id";
2356 static const char __pyx_k_np[] =
"np";
2357 static const char __pyx_k_t0[] =
"t0";
2358 static const char __pyx_k__24[] =
"^";
2359 static const char __pyx_k__25[] =
"";
2360 static const char __pyx_k__26[] =
":";
2361 static const char __pyx_k__27[] =
"}";
2362 static const char __pyx_k__28[] =
",";
2363 static const char __pyx_k_new[] =
"__new__";
2364 static const char __pyx_k_obj[] =
"obj";
2365 static const char __pyx_k_atol[] =
"atol";
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_rtol[] =
"rtol";
2375 static const char __pyx_k_size[] =
"size";
2376 static const char __pyx_k_step[] =
"step";
2377 static const char __pyx_k_stop[] =
"stop";
2378 static const char __pyx_k_tOut[] =
"tOut";
2379 static const char __pyx_k_test[] =
"__test__";
2380 static const char __pyx_k_tout[] =
"tout";
2381 static const char __pyx_k_ASCII[] =
"ASCII";
2382 static const char __pyx_k_class[] =
"__class__";
2383 static const char __pyx_k_error[] =
"error";
2384 static const char __pyx_k_flags[] =
"flags";
2385 static const char __pyx_k_numpy[] =
"numpy";
2386 static const char __pyx_k_range[] =
"range";
2387 static const char __pyx_k_shape[] =
"shape";
2388 static const char __pyx_k_start[] =
"start";
2389 static const char __pyx_k_yName[] =
"yName";
2390 static const char __pyx_k_encode[] =
"encode";
2391 static const char __pyx_k_format[] =
"format";
2392 static const char __pyx_k_import[] =
"__import__";
2393 static const char __pyx_k_name_2[] =
"__name__";
2394 static const char __pyx_k_pickle[] =
"pickle";
2395 static const char __pyx_k_reduce[] =
"__reduce__";
2396 static const char __pyx_k_struct[] =
"struct";
2397 static const char __pyx_k_unpack[] =
"unpack";
2398 static const char __pyx_k_update[] =
"update";
2399 static const char __pyx_k_yPrime[] =
"yPrime";
2400 static const char __pyx_k_yprime[] =
"yprime";
2401 static const char __pyx_k_Dyprime[] =
"Dyprime";
2402 static const char __pyx_k_asarray[] =
"asarray";
2403 static const char __pyx_k_fortran[] =
"fortran";
2404 static const char __pyx_k_memview[] =
"memview";
2405 static const char __pyx_k_Ellipsis[] =
"Ellipsis";
2406 static const char __pyx_k_getstate[] =
"__getstate__";
2407 static const char __pyx_k_itemsize[] =
"itemsize";
2408 static const char __pyx_k_pyx_type[] =
"__pyx_type";
2409 static const char __pyx_k_setstate[] =
"__setstate__";
2410 static const char __pyx_k_TypeError[] =
"TypeError";
2411 static const char __pyx_k_enumerate[] =
"enumerate";
2412 static const char __pyx_k_pyx_state[] =
"__pyx_state";
2413 static const char __pyx_k_reduce_ex[] =
"__reduce_ex__";
2414 static const char __pyx_k_IndexError[] =
"IndexError";
2415 static const char __pyx_k_ValueError[] =
"ValueError";
2416 static const char __pyx_k_pyx_result[] =
"__pyx_result";
2417 static const char __pyx_k_pyx_vtable[] =
"__pyx_vtable__";
2418 static const char __pyx_k_ImportError[] =
"ImportError";
2419 static const char __pyx_k_MemoryError[] =
"MemoryError";
2420 static const char __pyx_k_PickleError[] =
"PickleError";
2421 static const char __pyx_k_pyx_checksum[] =
"__pyx_checksum";
2422 static const char __pyx_k_stringsource[] =
"stringsource";
2423 static const char __pyx_k_pyx_getbuffer[] =
"__pyx_getbuffer";
2424 static const char __pyx_k_reduce_cython[] =
"__reduce_cython__";
2425 static const char __pyx_k_View_MemoryView[] =
"View.MemoryView";
2426 static const char __pyx_k_allocate_buffer[] =
"allocate_buffer";
2427 static const char __pyx_k_dtype_is_object[] =
"dtype_is_object";
2428 static const char __pyx_k_pyx_PickleError[] =
"__pyx_PickleError";
2429 static const char __pyx_k_setstate_cython[] =
"__setstate_cython__";
2430 static const char __pyx_k_FLCBDF_integrator[] =
"FLCBDF_integrator";
2431 static const char __pyx_k_pyx_unpickle_Enum[] =
"__pyx_unpickle_Enum";
2432 static const char __pyx_k_cline_in_traceback[] =
"cline_in_traceback";
2433 static const char __pyx_k_strided_and_direct[] =
"<strided and direct>";
2434 static const char __pyx_k_data__0_d___1_s_txt[] =
"data_{0:d}_{1:s}.txt";
2435 static const char __pyx_k_strided_and_indirect[] =
"<strided and indirect>";
2436 static const char __pyx_k_contiguous_and_direct[] =
"<contiguous and direct>";
2437 static const char __pyx_k_MemoryView_of_r_object[] =
"<MemoryView of %r object>";
2438 static const char __pyx_k_MemoryView_of_r_at_0x_x[] =
"<MemoryView of %r at 0x%x>";
2439 static const char __pyx_k_contiguous_and_indirect[] =
"<contiguous and indirect>";
2440 static const char __pyx_k_Cannot_index_with_type_s[] =
"Cannot index with type '%s'";
2441 static const char __pyx_k_Invalid_shape_in_axis_d_d[] =
"Invalid shape in axis %d: %d.";
2442 static const char __pyx_k_itemsize_0_for_cython_array[] =
"itemsize <= 0 for cython.array";
2443 static const char __pyx_k_unable_to_allocate_array_data[] =
"unable to allocate array data.";
2444 static const char __pyx_k_strided_and_direct_or_indirect[] =
"<strided and direct or indirect>";
2445 static const char __pyx_k_numpy_core_multiarray_failed_to[] =
"numpy.core.multiarray failed to import";
2446 static const char __pyx_k_Buffer_view_does_not_expose_stri[] =
"Buffer view does not expose strides";
2447 static const char __pyx_k_Can_only_create_a_buffer_that_is[] =
"Can only create a buffer that is contiguous in memory.";
2448 static const char __pyx_k_Cannot_assign_to_read_only_memor[] =
"Cannot assign to read-only memoryview";
2449 static const char __pyx_k_Cannot_create_writable_memory_vi[] =
"Cannot create writable memory view from read-only memoryview";
2450 static const char __pyx_k_Empty_shape_tuple_for_cython_arr[] =
"Empty shape tuple for cython.array";
2451 static const char __pyx_k_Incompatible_checksums_0x_x_vs_0[] =
"Incompatible checksums (0x%x vs (0xb068931, 0x82a3537, 0x6ae9995) = (name))";
2452 static const char __pyx_k_Indirect_dimensions_not_supporte[] =
"Indirect dimensions not supported";
2453 static const char __pyx_k_Invalid_mode_expected_c_or_fortr[] =
"Invalid mode, expected 'c' or 'fortran', got %s";
2454 static const char __pyx_k_Out_of_bounds_on_buffer_access_a[] =
"Out of bounds on buffer access (axis %d)";
2455 static const char __pyx_k_Unable_to_convert_item_to_object[] =
"Unable to convert item to object";
2456 static const char __pyx_k_got_differing_extents_in_dimensi[] =
"got differing extents in dimension %d (got %d and %d)";
2457 static const char __pyx_k_no_default___reduce___due_to_non[] =
"no default __reduce__ due to non-trivial __cinit__";
2458 static const char __pyx_k_numpy_core_umath_failed_to_impor[] =
"numpy.core.umath failed to import";
2459 static const char __pyx_k_unable_to_allocate_shape_and_str[] =
"unable to allocate shape and strides.";
2460 static PyObject *__pyx_n_s_ASCII;
2461 static PyObject *__pyx_kp_s_Buffer_view_does_not_expose_stri;
2462 static PyObject *__pyx_kp_s_Can_only_create_a_buffer_that_is;
2463 static PyObject *__pyx_kp_s_Cannot_assign_to_read_only_memor;
2464 static PyObject *__pyx_kp_s_Cannot_create_writable_memory_vi;
2465 static PyObject *__pyx_kp_s_Cannot_index_with_type_s;
2466 static PyObject *__pyx_n_s_Dy;
2467 static PyObject *__pyx_n_s_Dyprime;
2468 static PyObject *__pyx_n_s_Ellipsis;
2469 static PyObject *__pyx_kp_s_Empty_shape_tuple_for_cython_arr;
2470 static PyObject *__pyx_n_s_FLCBDF_integrator;
2471 static PyObject *__pyx_n_s_ImportError;
2472 static PyObject *__pyx_kp_s_Incompatible_checksums_0x_x_vs_0;
2473 static PyObject *__pyx_n_s_IndexError;
2474 static PyObject *__pyx_kp_s_Indirect_dimensions_not_supporte;
2475 static PyObject *__pyx_kp_s_Invalid_mode_expected_c_or_fortr;
2476 static PyObject *__pyx_kp_s_Invalid_shape_in_axis_d_d;
2477 static PyObject *__pyx_n_s_MemoryError;
2478 static PyObject *__pyx_kp_s_MemoryView_of_r_at_0x_x;
2479 static PyObject *__pyx_kp_s_MemoryView_of_r_object;
2480 static PyObject *__pyx_n_b_O;
2481 static PyObject *__pyx_kp_s_Out_of_bounds_on_buffer_access_a;
2482 static PyObject *__pyx_n_s_PickleError;
2483 static PyObject *__pyx_kp_b_T;
2484 static PyObject *__pyx_n_s_TypeError;
2485 static PyObject *__pyx_kp_s_Unable_to_convert_item_to_object;
2486 static PyObject *__pyx_n_s_ValueError;
2487 static PyObject *__pyx_n_s_View_MemoryView;
2488 static PyObject *__pyx_kp_b__24;
2489 static PyObject *__pyx_kp_b__25;
2490 static PyObject *__pyx_kp_b__26;
2491 static PyObject *__pyx_kp_b__27;
2492 static PyObject *__pyx_kp_u__28;
2493 static PyObject *__pyx_n_s_allocate_buffer;
2494 static PyObject *__pyx_n_s_asarray;
2495 static PyObject *__pyx_n_s_atol;
2496 static PyObject *__pyx_n_s_base;
2497 static PyObject *__pyx_n_s_c;
2498 static PyObject *__pyx_n_u_c;
2499 static PyObject *__pyx_n_s_class;
2500 static PyObject *__pyx_n_s_cline_in_traceback;
2501 static PyObject *__pyx_kp_s_contiguous_and_direct;
2502 static PyObject *__pyx_kp_s_contiguous_and_indirect;
2503 static PyObject *__pyx_n_s_dV;
2504 static PyObject *__pyx_kp_s_data__0_d___1_s_txt;
2505 static PyObject *__pyx_n_s_dict;
2506 static PyObject *__pyx_n_s_dtype_is_object;
2507 static PyObject *__pyx_n_s_encode;
2508 static PyObject *__pyx_n_s_enumerate;
2509 static PyObject *__pyx_n_s_error;
2510 static PyObject *__pyx_n_s_flags;
2511 static PyObject *__pyx_n_s_format;
2512 static PyObject *__pyx_n_s_fortran;
2513 static PyObject *__pyx_n_u_fortran;
2514 static PyObject *__pyx_n_s_getstate;
2515 static PyObject *__pyx_kp_s_got_differing_extents_in_dimensi;
2516 static PyObject *__pyx_n_s_id;
2517 static PyObject *__pyx_n_s_import;
2518 static PyObject *__pyx_n_s_itemsize;
2519 static PyObject *__pyx_kp_s_itemsize_0_for_cython_array;
2520 static PyObject *__pyx_n_s_join;
2521 static PyObject *__pyx_n_s_main;
2522 static PyObject *__pyx_n_s_memview;
2523 static PyObject *__pyx_n_s_mode;
2524 static PyObject *__pyx_n_s_name;
2525 static PyObject *__pyx_n_s_name_2;
2526 static PyObject *__pyx_n_s_ndim;
2527 static PyObject *__pyx_n_s_new;
2528 static PyObject *__pyx_kp_s_no_default___reduce___due_to_non;
2529 static PyObject *__pyx_n_s_np;
2530 static PyObject *__pyx_n_s_numpy;
2531 static PyObject *__pyx_kp_s_numpy_core_multiarray_failed_to;
2532 static PyObject *__pyx_kp_s_numpy_core_umath_failed_to_impor;
2533 static PyObject *__pyx_n_s_obj;
2534 static PyObject *__pyx_n_s_pack;
2535 static PyObject *__pyx_n_s_pickle;
2536 static PyObject *__pyx_n_s_pyx_PickleError;
2537 static PyObject *__pyx_n_s_pyx_checksum;
2538 static PyObject *__pyx_n_s_pyx_getbuffer;
2539 static PyObject *__pyx_n_s_pyx_result;
2540 static PyObject *__pyx_n_s_pyx_state;
2541 static PyObject *__pyx_n_s_pyx_type;
2542 static PyObject *__pyx_n_s_pyx_unpickle_Enum;
2543 static PyObject *__pyx_n_s_pyx_vtable;
2544 static PyObject *__pyx_n_s_range;
2545 static PyObject *__pyx_n_s_reduce;
2546 static PyObject *__pyx_n_s_reduce_cython;
2547 static PyObject *__pyx_n_s_reduce_ex;
2548 static PyObject *__pyx_n_s_rtol;
2549 static PyObject *__pyx_kp_u_s;
2550 static PyObject *__pyx_n_s_setstate;
2551 static PyObject *__pyx_n_s_setstate_cython;
2552 static PyObject *__pyx_n_s_shape;
2553 static PyObject *__pyx_n_s_size;
2554 static PyObject *__pyx_n_s_start;
2555 static PyObject *__pyx_n_s_step;
2556 static PyObject *__pyx_n_s_stop;
2557 static PyObject *__pyx_kp_s_strided_and_direct;
2558 static PyObject *__pyx_kp_s_strided_and_direct_or_indirect;
2559 static PyObject *__pyx_kp_s_strided_and_indirect;
2560 static PyObject *__pyx_kp_s_stringsource;
2561 static PyObject *__pyx_n_s_struct;
2562 static PyObject *__pyx_n_s_t;
2563 static PyObject *__pyx_n_s_t0;
2564 static PyObject *__pyx_n_s_tOut;
2565 static PyObject *__pyx_n_s_test;
2566 static PyObject *__pyx_n_s_tout;
2567 static PyObject *__pyx_kp_s_unable_to_allocate_array_data;
2568 static PyObject *__pyx_kp_s_unable_to_allocate_shape_and_str;
2569 static PyObject *__pyx_n_s_unpack;
2570 static PyObject *__pyx_n_s_update;
2571 static PyObject *__pyx_n_s_y;
2572 static PyObject *__pyx_n_s_yName;
2573 static PyObject *__pyx_n_s_yPrime;
2574 static PyObject *__pyx_n_s_yprime;
2575 static PyObject *__pyx_pf_14flcbdfWrappers_17FLCBDF_integrator_choose_dt(
struct __pyx_obj_14flcbdfWrappers_FLCBDF_integrator *__pyx_v_self,
double __pyx_v_t,
double __pyx_v_tout);
2576 static PyObject *__pyx_pf_14flcbdfWrappers_17FLCBDF_integrator_2set_dt(
struct __pyx_obj_14flcbdfWrappers_FLCBDF_integrator *__pyx_v_self,
double __pyx_v_DT);
2577 static PyObject *__pyx_pf_14flcbdfWrappers_17FLCBDF_integrator_4set_order(
struct __pyx_obj_14flcbdfWrappers_FLCBDF_integrator *__pyx_v_self,
int __pyx_v_k);
2578 static PyObject *__pyx_pf_14flcbdfWrappers_17FLCBDF_integrator_6initialize_dt(
struct __pyx_obj_14flcbdfWrappers_FLCBDF_integrator *__pyx_v_self,
double __pyx_v_t0,
double __pyx_v_tOut, PyArrayObject *__pyx_v_y, PyArrayObject *__pyx_v_yPrime);
2579 static PyObject *__pyx_pf_14flcbdfWrappers_17FLCBDF_integrator_8setInitialGuess(
struct __pyx_obj_14flcbdfWrappers_FLCBDF_integrator *__pyx_v_self, PyArrayObject *__pyx_v_y);
2580 static PyObject *__pyx_pf_14flcbdfWrappers_17FLCBDF_integrator_10lastStepErrorOk(
struct __pyx_obj_14flcbdfWrappers_FLCBDF_integrator *__pyx_v_self, PyArrayObject *__pyx_v_y);
2581 static PyObject *__pyx_pf_14flcbdfWrappers_17FLCBDF_integrator_12calculate_yprime(
struct __pyx_obj_14flcbdfWrappers_FLCBDF_integrator *__pyx_v_self, PyArrayObject *__pyx_v_y, PyArrayObject *__pyx_v_Dy, PyArrayObject *__pyx_v_yprime, PyArrayObject *__pyx_v_Dyprime);
2582 static PyObject *__pyx_pf_14flcbdfWrappers_17FLCBDF_integrator_14stepTaken(
struct __pyx_obj_14flcbdfWrappers_FLCBDF_integrator *__pyx_v_self, PyArrayObject *__pyx_v_y);
2583 static PyObject *__pyx_pf_14flcbdfWrappers_17FLCBDF_integrator_16retryStep_errorFailure(
struct __pyx_obj_14flcbdfWrappers_FLCBDF_integrator *__pyx_v_self);
2584 static PyObject *__pyx_pf_14flcbdfWrappers_17FLCBDF_integrator_18retryStep_solverFailure(
struct __pyx_obj_14flcbdfWrappers_FLCBDF_integrator *__pyx_v_self);
2585 static PyObject *__pyx_pf_14flcbdfWrappers_17FLCBDF_integrator_20initializeTimeHistory(
struct __pyx_obj_14flcbdfWrappers_FLCBDF_integrator *__pyx_v_self, PyArrayObject *__pyx_v_y, PyArrayObject *__pyx_v_yPrime);
2586 static PyObject *__pyx_pf_14flcbdfWrappers_17FLCBDF_integrator_22setTolerances(
struct __pyx_obj_14flcbdfWrappers_FLCBDF_integrator *__pyx_v_self,
double __pyx_v_atol,
double __pyx_v_rtol, PyArrayObject *__pyx_v_dV);
2587 static PyObject *__pyx_pf_14flcbdfWrappers_17FLCBDF_integrator_24getCurrentAlpha(
struct __pyx_obj_14flcbdfWrappers_FLCBDF_integrator *__pyx_v_self);
2588 static int __pyx_pf_14flcbdfWrappers_17FLCBDF_integrator_26__cinit__(
struct __pyx_obj_14flcbdfWrappers_FLCBDF_integrator *__pyx_v_self, PyArrayObject *__pyx_v_y, PyObject *__pyx_v_yName);
2589 static void __pyx_pf_14flcbdfWrappers_17FLCBDF_integrator_28__dealloc__(
struct __pyx_obj_14flcbdfWrappers_FLCBDF_integrator *__pyx_v_self);
2590 static PyObject *__pyx_pf_14flcbdfWrappers_17FLCBDF_integrator_30__reduce_cython__(CYTHON_UNUSED
struct __pyx_obj_14flcbdfWrappers_FLCBDF_integrator *__pyx_v_self);
2591 static PyObject *__pyx_pf_14flcbdfWrappers_17FLCBDF_integrator_32__setstate_cython__(CYTHON_UNUSED
struct __pyx_obj_14flcbdfWrappers_FLCBDF_integrator *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state);
2592 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);
2593 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);
2594 static void __pyx_array___pyx_pf_15View_dot_MemoryView_5array_4__dealloc__(
struct __pyx_array_obj *__pyx_v_self);
2595 static PyObject *__pyx_pf_15View_dot_MemoryView_5array_7memview___get__(
struct __pyx_array_obj *__pyx_v_self);
2596 static Py_ssize_t __pyx_array___pyx_pf_15View_dot_MemoryView_5array_6__len__(
struct __pyx_array_obj *__pyx_v_self);
2597 static PyObject *__pyx_array___pyx_pf_15View_dot_MemoryView_5array_8__getattr__(
struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_attr);
2598 static PyObject *__pyx_array___pyx_pf_15View_dot_MemoryView_5array_10__getitem__(
struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_item);
2599 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);
2600 static PyObject *__pyx_pf___pyx_array___reduce_cython__(CYTHON_UNUSED
struct __pyx_array_obj *__pyx_v_self);
2601 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);
2602 static int __pyx_MemviewEnum___pyx_pf_15View_dot_MemoryView_4Enum___init__(
struct __pyx_MemviewEnum_obj *__pyx_v_self, PyObject *__pyx_v_name);
2603 static PyObject *__pyx_MemviewEnum___pyx_pf_15View_dot_MemoryView_4Enum_2__repr__(
struct __pyx_MemviewEnum_obj *__pyx_v_self);
2604 static PyObject *__pyx_pf___pyx_MemviewEnum___reduce_cython__(
struct __pyx_MemviewEnum_obj *__pyx_v_self);
2605 static PyObject *__pyx_pf___pyx_MemviewEnum_2__setstate_cython__(
struct __pyx_MemviewEnum_obj *__pyx_v_self, PyObject *__pyx_v___pyx_state);
2606 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);
2607 static void __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_2__dealloc__(
struct __pyx_memoryview_obj *__pyx_v_self);
2608 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_4__getitem__(
struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index);
2609 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);
2610 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);
2611 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_1T___get__(
struct __pyx_memoryview_obj *__pyx_v_self);
2612 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_4base___get__(
struct __pyx_memoryview_obj *__pyx_v_self);
2613 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_5shape___get__(
struct __pyx_memoryview_obj *__pyx_v_self);
2614 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_7strides___get__(
struct __pyx_memoryview_obj *__pyx_v_self);
2615 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_10suboffsets___get__(
struct __pyx_memoryview_obj *__pyx_v_self);
2616 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_4ndim___get__(
struct __pyx_memoryview_obj *__pyx_v_self);
2617 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_8itemsize___get__(
struct __pyx_memoryview_obj *__pyx_v_self);
2618 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_6nbytes___get__(
struct __pyx_memoryview_obj *__pyx_v_self);
2619 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_4size___get__(
struct __pyx_memoryview_obj *__pyx_v_self);
2620 static Py_ssize_t __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_10__len__(
struct __pyx_memoryview_obj *__pyx_v_self);
2621 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_12__repr__(
struct __pyx_memoryview_obj *__pyx_v_self);
2622 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_14__str__(
struct __pyx_memoryview_obj *__pyx_v_self);
2623 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_16is_c_contig(
struct __pyx_memoryview_obj *__pyx_v_self);
2624 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_18is_f_contig(
struct __pyx_memoryview_obj *__pyx_v_self);
2625 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_20copy(
struct __pyx_memoryview_obj *__pyx_v_self);
2626 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_22copy_fortran(
struct __pyx_memoryview_obj *__pyx_v_self);
2627 static PyObject *__pyx_pf___pyx_memoryview___reduce_cython__(CYTHON_UNUSED
struct __pyx_memoryview_obj *__pyx_v_self);
2628 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);
2629 static void __pyx_memoryviewslice___pyx_pf_15View_dot_MemoryView_16_memoryviewslice___dealloc__(
struct __pyx_memoryviewslice_obj *__pyx_v_self);
2630 static PyObject *__pyx_pf_15View_dot_MemoryView_16_memoryviewslice_4base___get__(
struct __pyx_memoryviewslice_obj *__pyx_v_self);
2631 static PyObject *__pyx_pf___pyx_memoryviewslice___reduce_cython__(CYTHON_UNUSED
struct __pyx_memoryviewslice_obj *__pyx_v_self);
2632 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);
2633 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);
2634 static PyObject *__pyx_tp_new_14flcbdfWrappers_FLCBDF_integrator(PyTypeObject *t, PyObject *a, PyObject *k);
2635 static PyObject *__pyx_tp_new_array(PyTypeObject *t, PyObject *a, PyObject *k);
2636 static PyObject *__pyx_tp_new_Enum(PyTypeObject *t, PyObject *a, PyObject *k);
2637 static PyObject *__pyx_tp_new_memoryview(PyTypeObject *t, PyObject *a, PyObject *k);
2638 static PyObject *__pyx_tp_new__memoryviewslice(PyTypeObject *t, PyObject *a, PyObject *k);
2639 static PyObject *__pyx_int_0;
2640 static PyObject *__pyx_int_1;
2641 static PyObject *__pyx_int_112105877;
2642 static PyObject *__pyx_int_136983863;
2643 static PyObject *__pyx_int_184977713;
2644 static PyObject *__pyx_int_neg_1;
2645 static PyObject *__pyx_slice_;
2646 static PyObject *__pyx_tuple__2;
2647 static PyObject *__pyx_tuple__3;
2648 static PyObject *__pyx_tuple__4;
2649 static PyObject *__pyx_tuple__5;
2650 static PyObject *__pyx_tuple__6;
2651 static PyObject *__pyx_tuple__7;
2652 static PyObject *__pyx_tuple__8;
2653 static PyObject *__pyx_tuple__9;
2654 static PyObject *__pyx_tuple__10;
2655 static PyObject *__pyx_tuple__11;
2656 static PyObject *__pyx_tuple__12;
2657 static PyObject *__pyx_tuple__13;
2658 static PyObject *__pyx_tuple__14;
2659 static PyObject *__pyx_tuple__15;
2660 static PyObject *__pyx_tuple__16;
2661 static PyObject *__pyx_tuple__17;
2662 static PyObject *__pyx_tuple__18;
2663 static PyObject *__pyx_tuple__19;
2664 static PyObject *__pyx_tuple__20;
2665 static PyObject *__pyx_tuple__21;
2666 static PyObject *__pyx_tuple__22;
2667 static PyObject *__pyx_tuple__23;
2668 static PyObject *__pyx_tuple__29;
2669 static PyObject *__pyx_tuple__30;
2670 static PyObject *__pyx_tuple__31;
2671 static PyObject *__pyx_tuple__32;
2672 static PyObject *__pyx_tuple__33;
2673 static PyObject *__pyx_tuple__34;
2674 static PyObject *__pyx_codeobj__35;
2686 static PyObject *__pyx_pw_14flcbdfWrappers_17FLCBDF_integrator_1choose_dt(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
2687 static PyObject *__pyx_pw_14flcbdfWrappers_17FLCBDF_integrator_1choose_dt(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
2689 double __pyx_v_tout;
2690 int __pyx_lineno = 0;
2691 const char *__pyx_filename = NULL;
2692 int __pyx_clineno = 0;
2693 PyObject *__pyx_r = 0;
2694 __Pyx_RefNannyDeclarations
2695 __Pyx_RefNannySetupContext(
"choose_dt (wrapper)", 0);
2697 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_t,&__pyx_n_s_tout,0};
2698 PyObject* values[2] = {0,0};
2699 if (unlikely(__pyx_kwds)) {
2701 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
2703 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
2705 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
2708 default:
goto __pyx_L5_argtuple_error;
2710 kw_args = PyDict_Size(__pyx_kwds);
2713 if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_t)) != 0)) kw_args--;
2714 else goto __pyx_L5_argtuple_error;
2717 if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_tout)) != 0)) kw_args--;
2719 __Pyx_RaiseArgtupleInvalid(
"choose_dt", 1, 2, 2, 1); __PYX_ERR(1, 6, __pyx_L3_error)
2722 if (unlikely(kw_args > 0)) {
2723 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args,
"choose_dt") < 0)) __PYX_ERR(1, 6, __pyx_L3_error)
2725 }
else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
2726 goto __pyx_L5_argtuple_error;
2728 values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
2729 values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
2731 __pyx_v_t = __pyx_PyFloat_AsDouble(values[0]);
if (unlikely((__pyx_v_t == (
double)-1) && PyErr_Occurred())) __PYX_ERR(1, 6, __pyx_L3_error)
2732 __pyx_v_tout = __pyx_PyFloat_AsDouble(values[1]);
if (unlikely((__pyx_v_tout == (
double)-1) && PyErr_Occurred())) __PYX_ERR(1, 6, __pyx_L3_error)
2734 goto __pyx_L4_argument_unpacking_done;
2735 __pyx_L5_argtuple_error:;
2736 __Pyx_RaiseArgtupleInvalid(
"choose_dt", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(1, 6, __pyx_L3_error)
2738 __Pyx_AddTraceback(
"flcbdfWrappers.FLCBDF_integrator.choose_dt", __pyx_clineno, __pyx_lineno, __pyx_filename);
2739 __Pyx_RefNannyFinishContext();
2741 __pyx_L4_argument_unpacking_done:;
2742 __pyx_r = __pyx_pf_14flcbdfWrappers_17FLCBDF_integrator_choose_dt(((
struct __pyx_obj_14flcbdfWrappers_FLCBDF_integrator *)__pyx_v_self), __pyx_v_t, __pyx_v_tout);
2745 __Pyx_RefNannyFinishContext();
2749 static PyObject *__pyx_pf_14flcbdfWrappers_17FLCBDF_integrator_choose_dt(
struct __pyx_obj_14flcbdfWrappers_FLCBDF_integrator *__pyx_v_self,
double __pyx_v_t,
double __pyx_v_tout) {
2750 PyObject *__pyx_r = NULL;
2751 __Pyx_RefNannyDeclarations
2752 PyObject *__pyx_t_1 = NULL;
2753 int __pyx_lineno = 0;
2754 const char *__pyx_filename = NULL;
2755 int __pyx_clineno = 0;
2756 __Pyx_RefNannySetupContext(
"choose_dt", 0);
2765 __Pyx_XDECREF(__pyx_r);
2766 __pyx_t_1 = PyFloat_FromDouble(__pyx_v_self->flcbdf->chooseDT(__pyx_v_t, __pyx_v_tout));
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 7, __pyx_L1_error)
2767 __Pyx_GOTREF(__pyx_t_1);
2768 __pyx_r = __pyx_t_1;
2782 __Pyx_XDECREF(__pyx_t_1);
2783 __Pyx_AddTraceback(
"flcbdfWrappers.FLCBDF_integrator.choose_dt", __pyx_clineno, __pyx_lineno, __pyx_filename);
2786 __Pyx_XGIVEREF(__pyx_r);
2787 __Pyx_RefNannyFinishContext();
2800 static PyObject *__pyx_pw_14flcbdfWrappers_17FLCBDF_integrator_3set_dt(PyObject *__pyx_v_self, PyObject *__pyx_arg_DT);
2801 static PyObject *__pyx_pw_14flcbdfWrappers_17FLCBDF_integrator_3set_dt(PyObject *__pyx_v_self, PyObject *__pyx_arg_DT) {
2803 int __pyx_lineno = 0;
2804 const char *__pyx_filename = NULL;
2805 int __pyx_clineno = 0;
2806 PyObject *__pyx_r = 0;
2807 __Pyx_RefNannyDeclarations
2808 __Pyx_RefNannySetupContext(
"set_dt (wrapper)", 0);
2809 assert(__pyx_arg_DT); {
2810 __pyx_v_DT = __pyx_PyFloat_AsDouble(__pyx_arg_DT);
if (unlikely((__pyx_v_DT == (
double)-1) && PyErr_Occurred())) __PYX_ERR(1, 9, __pyx_L3_error)
2812 goto __pyx_L4_argument_unpacking_done;
2814 __Pyx_AddTraceback(
"flcbdfWrappers.FLCBDF_integrator.set_dt", __pyx_clineno, __pyx_lineno, __pyx_filename);
2815 __Pyx_RefNannyFinishContext();
2817 __pyx_L4_argument_unpacking_done:;
2818 __pyx_r = __pyx_pf_14flcbdfWrappers_17FLCBDF_integrator_2set_dt(((
struct __pyx_obj_14flcbdfWrappers_FLCBDF_integrator *)__pyx_v_self), ((
double)__pyx_v_DT));
2821 __Pyx_RefNannyFinishContext();
2825 static PyObject *__pyx_pf_14flcbdfWrappers_17FLCBDF_integrator_2set_dt(
struct __pyx_obj_14flcbdfWrappers_FLCBDF_integrator *__pyx_v_self,
double __pyx_v_DT) {
2826 PyObject *__pyx_r = NULL;
2827 __Pyx_RefNannyDeclarations
2828 PyObject *__pyx_t_1 = NULL;
2829 int __pyx_lineno = 0;
2830 const char *__pyx_filename = NULL;
2831 int __pyx_clineno = 0;
2832 __Pyx_RefNannySetupContext(
"set_dt", 0);
2841 (void)(__pyx_v_self->flcbdf->setDT(__pyx_v_DT));
2850 __Pyx_XDECREF(__pyx_r);
2851 __pyx_t_1 = PyFloat_FromDouble(__pyx_v_DT);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 11, __pyx_L1_error)
2852 __Pyx_GOTREF(__pyx_t_1);
2853 __pyx_r = __pyx_t_1;
2867 __Pyx_XDECREF(__pyx_t_1);
2868 __Pyx_AddTraceback(
"flcbdfWrappers.FLCBDF_integrator.set_dt", __pyx_clineno, __pyx_lineno, __pyx_filename);
2871 __Pyx_XGIVEREF(__pyx_r);
2872 __Pyx_RefNannyFinishContext();
2885 static PyObject *__pyx_pw_14flcbdfWrappers_17FLCBDF_integrator_5set_order(PyObject *__pyx_v_self, PyObject *__pyx_arg_k);
2886 static PyObject *__pyx_pw_14flcbdfWrappers_17FLCBDF_integrator_5set_order(PyObject *__pyx_v_self, PyObject *__pyx_arg_k) {
2888 int __pyx_lineno = 0;
2889 const char *__pyx_filename = NULL;
2890 int __pyx_clineno = 0;
2891 PyObject *__pyx_r = 0;
2892 __Pyx_RefNannyDeclarations
2893 __Pyx_RefNannySetupContext(
"set_order (wrapper)", 0);
2894 assert(__pyx_arg_k); {
2895 __pyx_v_k = __Pyx_PyInt_As_int(__pyx_arg_k);
if (unlikely((__pyx_v_k == (
int)-1) && PyErr_Occurred())) __PYX_ERR(1, 13, __pyx_L3_error)
2897 goto __pyx_L4_argument_unpacking_done;
2899 __Pyx_AddTraceback(
"flcbdfWrappers.FLCBDF_integrator.set_order", __pyx_clineno, __pyx_lineno, __pyx_filename);
2900 __Pyx_RefNannyFinishContext();
2902 __pyx_L4_argument_unpacking_done:;
2903 __pyx_r = __pyx_pf_14flcbdfWrappers_17FLCBDF_integrator_4set_order(((
struct __pyx_obj_14flcbdfWrappers_FLCBDF_integrator *)__pyx_v_self), ((
int)__pyx_v_k));
2906 __Pyx_RefNannyFinishContext();
2910 static PyObject *__pyx_pf_14flcbdfWrappers_17FLCBDF_integrator_4set_order(
struct __pyx_obj_14flcbdfWrappers_FLCBDF_integrator *__pyx_v_self,
int __pyx_v_k) {
2911 PyObject *__pyx_r = NULL;
2912 __Pyx_RefNannyDeclarations
2913 PyObject *__pyx_t_1 = NULL;
2914 int __pyx_lineno = 0;
2915 const char *__pyx_filename = NULL;
2916 int __pyx_clineno = 0;
2917 __Pyx_RefNannySetupContext(
"set_order", 0);
2926 __pyx_v_self->flcbdf->useFixedOrder(__pyx_v_k);
2935 __Pyx_XDECREF(__pyx_r);
2936 __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_k);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 15, __pyx_L1_error)
2937 __Pyx_GOTREF(__pyx_t_1);
2938 __pyx_r = __pyx_t_1;
2952 __Pyx_XDECREF(__pyx_t_1);
2953 __Pyx_AddTraceback(
"flcbdfWrappers.FLCBDF_integrator.set_order", __pyx_clineno, __pyx_lineno, __pyx_filename);
2956 __Pyx_XGIVEREF(__pyx_r);
2957 __Pyx_RefNannyFinishContext();
2970 static PyObject *__pyx_pw_14flcbdfWrappers_17FLCBDF_integrator_7initialize_dt(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
2971 static PyObject *__pyx_pw_14flcbdfWrappers_17FLCBDF_integrator_7initialize_dt(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
2973 double __pyx_v_tOut;
2974 PyArrayObject *__pyx_v_y = 0;
2975 PyArrayObject *__pyx_v_yPrime = 0;
2976 int __pyx_lineno = 0;
2977 const char *__pyx_filename = NULL;
2978 int __pyx_clineno = 0;
2979 PyObject *__pyx_r = 0;
2980 __Pyx_RefNannyDeclarations
2981 __Pyx_RefNannySetupContext(
"initialize_dt (wrapper)", 0);
2983 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_t0,&__pyx_n_s_tOut,&__pyx_n_s_y,&__pyx_n_s_yPrime,0};
2984 PyObject* values[4] = {0,0,0,0};
2985 if (unlikely(__pyx_kwds)) {
2987 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
2989 case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
2991 case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
2993 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
2995 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
2998 default:
goto __pyx_L5_argtuple_error;
3000 kw_args = PyDict_Size(__pyx_kwds);
3003 if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_t0)) != 0)) kw_args--;
3004 else goto __pyx_L5_argtuple_error;
3007 if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_tOut)) != 0)) kw_args--;
3009 __Pyx_RaiseArgtupleInvalid(
"initialize_dt", 1, 4, 4, 1); __PYX_ERR(1, 17, __pyx_L3_error)
3013 if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_y)) != 0)) kw_args--;
3015 __Pyx_RaiseArgtupleInvalid(
"initialize_dt", 1, 4, 4, 2); __PYX_ERR(1, 17, __pyx_L3_error)
3019 if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_yPrime)) != 0)) kw_args--;
3021 __Pyx_RaiseArgtupleInvalid(
"initialize_dt", 1, 4, 4, 3); __PYX_ERR(1, 17, __pyx_L3_error)
3024 if (unlikely(kw_args > 0)) {
3025 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args,
"initialize_dt") < 0)) __PYX_ERR(1, 17, __pyx_L3_error)
3027 }
else if (PyTuple_GET_SIZE(__pyx_args) != 4) {
3028 goto __pyx_L5_argtuple_error;
3030 values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
3031 values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
3032 values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
3033 values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
3035 __pyx_v_t0 = __pyx_PyFloat_AsDouble(values[0]);
if (unlikely((__pyx_v_t0 == (
double)-1) && PyErr_Occurred())) __PYX_ERR(1, 18, __pyx_L3_error)
3036 __pyx_v_tOut = __pyx_PyFloat_AsDouble(values[1]);
if (unlikely((__pyx_v_tOut == (
double)-1) && PyErr_Occurred())) __PYX_ERR(1, 19, __pyx_L3_error)
3037 __pyx_v_y = ((PyArrayObject *)values[2]);
3038 __pyx_v_yPrime = ((PyArrayObject *)values[3]);
3040 goto __pyx_L4_argument_unpacking_done;
3041 __pyx_L5_argtuple_error:;
3042 __Pyx_RaiseArgtupleInvalid(
"initialize_dt", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(1, 17, __pyx_L3_error)
3044 __Pyx_AddTraceback(
"flcbdfWrappers.FLCBDF_integrator.initialize_dt", __pyx_clineno, __pyx_lineno, __pyx_filename);
3045 __Pyx_RefNannyFinishContext();
3047 __pyx_L4_argument_unpacking_done:;
3048 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_y), __pyx_ptype_5numpy_ndarray, 1,
"y", 0))) __PYX_ERR(1, 20, __pyx_L1_error)
3049 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_yPrime), __pyx_ptype_5numpy_ndarray, 1,
"yPrime", 0))) __PYX_ERR(1, 21, __pyx_L1_error)
3050 __pyx_r = __pyx_pf_14flcbdfWrappers_17FLCBDF_integrator_6initialize_dt(((
struct __pyx_obj_14flcbdfWrappers_FLCBDF_integrator *)__pyx_v_self), __pyx_v_t0, __pyx_v_tOut, __pyx_v_y, __pyx_v_yPrime);
3057 __Pyx_RefNannyFinishContext();
3061 static PyObject *__pyx_pf_14flcbdfWrappers_17FLCBDF_integrator_6initialize_dt(
struct __pyx_obj_14flcbdfWrappers_FLCBDF_integrator *__pyx_v_self,
double __pyx_v_t0,
double __pyx_v_tOut, PyArrayObject *__pyx_v_y, PyArrayObject *__pyx_v_yPrime) {
3062 Daetk::Petsc::Vec *__pyx_v_yVec;
3063 Daetk::Petsc::Vec *__pyx_v_yPrimeVec;
3065 PyObject *__pyx_r = NULL;
3066 __Pyx_RefNannyDeclarations
3067 PyObject *__pyx_t_1 = NULL;
3068 int __pyx_lineno = 0;
3069 const char *__pyx_filename = NULL;
3070 int __pyx_clineno = 0;
3071 __Pyx_RefNannySetupContext(
"initialize_dt", 0);
3080 __pyx_v_yVec =
new Daetk::Petsc::Vec(((Daetk::Petsc::Vec::CopyType)Daetk::Petsc::Vec::REF), ((
double *)__pyx_v_y->data), __pyx_v_self->flcbdf->yn.ldim_);
3089 __pyx_v_yPrimeVec =
new Daetk::Petsc::Vec(((Daetk::Petsc::Vec::CopyType)Daetk::Petsc::Vec::REF), ((
double *)__pyx_v_yPrime->data), __pyx_v_self->flcbdf->yn.ldim_);
3098 __pyx_v_DT = __pyx_v_self->flcbdf->chooseInitialStepSize(__pyx_v_t0, __pyx_v_tOut, (__pyx_v_yVec[0]), (__pyx_v_yPrimeVec[0]));
3107 delete __pyx_v_yVec;
3116 delete __pyx_v_yPrimeVec;
3125 __Pyx_XDECREF(__pyx_r);
3126 __pyx_t_1 = PyFloat_FromDouble(__pyx_v_DT);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 27, __pyx_L1_error)
3127 __Pyx_GOTREF(__pyx_t_1);
3128 __pyx_r = __pyx_t_1;
3142 __Pyx_XDECREF(__pyx_t_1);
3143 __Pyx_AddTraceback(
"flcbdfWrappers.FLCBDF_integrator.initialize_dt", __pyx_clineno, __pyx_lineno, __pyx_filename);
3146 __Pyx_XGIVEREF(__pyx_r);
3147 __Pyx_RefNannyFinishContext();
3160 static PyObject *__pyx_pw_14flcbdfWrappers_17FLCBDF_integrator_9setInitialGuess(PyObject *__pyx_v_self, PyObject *__pyx_v_y);
3161 static PyObject *__pyx_pw_14flcbdfWrappers_17FLCBDF_integrator_9setInitialGuess(PyObject *__pyx_v_self, PyObject *__pyx_v_y) {
3162 int __pyx_lineno = 0;
3163 const char *__pyx_filename = NULL;
3164 int __pyx_clineno = 0;
3165 PyObject *__pyx_r = 0;
3166 __Pyx_RefNannyDeclarations
3167 __Pyx_RefNannySetupContext(
"setInitialGuess (wrapper)", 0);
3168 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_y), __pyx_ptype_5numpy_ndarray, 1,
"y", 0))) __PYX_ERR(1, 29, __pyx_L1_error)
3169 __pyx_r = __pyx_pf_14flcbdfWrappers_17FLCBDF_integrator_8setInitialGuess(((
struct __pyx_obj_14flcbdfWrappers_FLCBDF_integrator *)__pyx_v_self), ((PyArrayObject *)__pyx_v_y));
3176 __Pyx_RefNannyFinishContext();
3180 static PyObject *__pyx_pf_14flcbdfWrappers_17FLCBDF_integrator_8setInitialGuess(
struct __pyx_obj_14flcbdfWrappers_FLCBDF_integrator *__pyx_v_self, PyArrayObject *__pyx_v_y) {
3181 PyObject *__pyx_v_yn = NULL;
3182 PyObject *__pyx_r = NULL;
3183 __Pyx_RefNannyDeclarations
3184 PyObject *__pyx_t_1 = NULL;
3185 PyObject *__pyx_t_2 = NULL;
3186 PyObject *__pyx_t_3 = NULL;
3188 struct __pyx_array_obj *__pyx_t_5 = NULL;
3189 PyObject *__pyx_t_6 = NULL;
3190 int __pyx_lineno = 0;
3191 const char *__pyx_filename = NULL;
3192 int __pyx_clineno = 0;
3193 __Pyx_RefNannySetupContext(
"setInitialGuess", 0);
3202 __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_np);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 30, __pyx_L1_error)
3203 __Pyx_GOTREF(__pyx_t_2);
3204 __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_asarray);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 30, __pyx_L1_error)
3205 __Pyx_GOTREF(__pyx_t_3);
3206 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
3207 __pyx_t_4 = __pyx_v_self->flcbdf->yn.p_;
3209 PyErr_SetString(PyExc_ValueError,
"Cannot create cython.array from NULL pointer");
3210 __PYX_ERR(1, 30, __pyx_L1_error)
3212 __pyx_t_6 = __pyx_format_from_typeinfo(&__Pyx_TypeInfo_double);
if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 30, __pyx_L1_error)
3213 __Pyx_GOTREF(__pyx_t_6);
3214 __pyx_t_2 = Py_BuildValue((
char*)
"(" __PYX_BUILD_PY_SSIZE_T
")", ((Py_ssize_t)__pyx_v_self->flcbdf->yn.ldim_));
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 30, __pyx_L1_error)
3215 __Pyx_GOTREF(__pyx_t_2);
3216 __pyx_t_5 = __pyx_array_new(__pyx_t_2,
sizeof(
double), PyBytes_AS_STRING(__pyx_t_6), (
char *)
"c", (
char *) __pyx_t_4);
3217 if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 30, __pyx_L1_error)
3218 __Pyx_GOTREF(__pyx_t_5);
3219 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
3220 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
3222 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
3223 __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_3);
3224 if (likely(__pyx_t_6)) {
3225 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_3);
3226 __Pyx_INCREF(__pyx_t_6);
3227 __Pyx_INCREF(
function);
3228 __Pyx_DECREF_SET(__pyx_t_3,
function);
3231 __pyx_t_1 = (__pyx_t_6) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_6, ((PyObject *)__pyx_t_5)) : __Pyx_PyObject_CallOneArg(__pyx_t_3, ((PyObject *)__pyx_t_5));
3232 __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
3233 __Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0;
3234 if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 30, __pyx_L1_error)
3235 __Pyx_GOTREF(__pyx_t_1);
3236 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
3237 __pyx_v_yn = __pyx_t_1;
3247 if (__Pyx_PyObject_SetSlice(((PyObject *)__pyx_v_y), __pyx_v_yn, 0, 0, NULL, NULL, &__pyx_slice_, 0, 0, 1) < 0) __PYX_ERR(1, 31, __pyx_L1_error)
3258 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
3261 __Pyx_XDECREF(__pyx_t_1);
3262 __Pyx_XDECREF(__pyx_t_2);
3263 __Pyx_XDECREF(__pyx_t_3);
3264 __Pyx_XDECREF(((PyObject *)__pyx_t_5));
3265 __Pyx_XDECREF(__pyx_t_6);
3266 __Pyx_AddTraceback(
"flcbdfWrappers.FLCBDF_integrator.setInitialGuess", __pyx_clineno, __pyx_lineno, __pyx_filename);
3269 __Pyx_XDECREF(__pyx_v_yn);
3270 __Pyx_XGIVEREF(__pyx_r);
3271 __Pyx_RefNannyFinishContext();
3284 static PyObject *__pyx_pw_14flcbdfWrappers_17FLCBDF_integrator_11lastStepErrorOk(PyObject *__pyx_v_self, PyObject *__pyx_v_y);
3285 static PyObject *__pyx_pw_14flcbdfWrappers_17FLCBDF_integrator_11lastStepErrorOk(PyObject *__pyx_v_self, PyObject *__pyx_v_y) {
3286 int __pyx_lineno = 0;
3287 const char *__pyx_filename = NULL;
3288 int __pyx_clineno = 0;
3289 PyObject *__pyx_r = 0;
3290 __Pyx_RefNannyDeclarations
3291 __Pyx_RefNannySetupContext(
"lastStepErrorOk (wrapper)", 0);
3292 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_y), __pyx_ptype_5numpy_ndarray, 1,
"y", 0))) __PYX_ERR(1, 33, __pyx_L1_error)
3293 __pyx_r = __pyx_pf_14flcbdfWrappers_17FLCBDF_integrator_10lastStepErrorOk(((
struct __pyx_obj_14flcbdfWrappers_FLCBDF_integrator *)__pyx_v_self), ((PyArrayObject *)__pyx_v_y));
3300 __Pyx_RefNannyFinishContext();
3304 static PyObject *__pyx_pf_14flcbdfWrappers_17FLCBDF_integrator_10lastStepErrorOk(
struct __pyx_obj_14flcbdfWrappers_FLCBDF_integrator *__pyx_v_self, PyArrayObject *__pyx_v_y) {
3305 Daetk::Petsc::Vec *__pyx_v_yVec;
3307 PyObject *__pyx_r = NULL;
3308 __Pyx_RefNannyDeclarations
3309 PyObject *__pyx_t_1 = NULL;
3310 PyObject *__pyx_t_2 = NULL;
3311 int __pyx_lineno = 0;
3312 const char *__pyx_filename = NULL;
3313 int __pyx_clineno = 0;
3314 __Pyx_RefNannySetupContext(
"lastStepErrorOk", 0);
3323 __pyx_v_yVec =
new Daetk::Petsc::Vec(((Daetk::Petsc::Vec::CopyType)Daetk::Petsc::Vec::REF), ((
double *)__pyx_v_y->data), __pyx_v_self->flcbdf->yn.ldim_);
3332 __pyx_v_Ok = (!(__pyx_v_self->flcbdf->errorForStepTooLarge((__pyx_v_yVec[0])) != 0));
3341 delete __pyx_v_yVec;
3350 __Pyx_XDECREF(__pyx_r);
3351 __pyx_t_1 = __Pyx_PyBool_FromLong(__pyx_v_Ok);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 37, __pyx_L1_error)
3352 __Pyx_GOTREF(__pyx_t_1);
3353 __pyx_t_2 = __Pyx_PyObject_CallOneArg(((PyObject *)(&PyInt_Type)), __pyx_t_1);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 37, __pyx_L1_error)
3354 __Pyx_GOTREF(__pyx_t_2);
3355 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
3356 __pyx_r = __pyx_t_2;
3370 __Pyx_XDECREF(__pyx_t_1);
3371 __Pyx_XDECREF(__pyx_t_2);
3372 __Pyx_AddTraceback(
"flcbdfWrappers.FLCBDF_integrator.lastStepErrorOk", __pyx_clineno, __pyx_lineno, __pyx_filename);
3375 __Pyx_XGIVEREF(__pyx_r);
3376 __Pyx_RefNannyFinishContext();
3389 static PyObject *__pyx_pw_14flcbdfWrappers_17FLCBDF_integrator_13calculate_yprime(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
3390 static PyObject *__pyx_pw_14flcbdfWrappers_17FLCBDF_integrator_13calculate_yprime(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
3391 PyArrayObject *__pyx_v_y = 0;
3392 PyArrayObject *__pyx_v_Dy = 0;
3393 PyArrayObject *__pyx_v_yprime = 0;
3394 PyArrayObject *__pyx_v_Dyprime = 0;
3395 int __pyx_lineno = 0;
3396 const char *__pyx_filename = NULL;
3397 int __pyx_clineno = 0;
3398 PyObject *__pyx_r = 0;
3399 __Pyx_RefNannyDeclarations
3400 __Pyx_RefNannySetupContext(
"calculate_yprime (wrapper)", 0);
3402 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_y,&__pyx_n_s_Dy,&__pyx_n_s_yprime,&__pyx_n_s_Dyprime,0};
3403 PyObject* values[4] = {0,0,0,0};
3404 if (unlikely(__pyx_kwds)) {
3406 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
3408 case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
3410 case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
3412 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
3414 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
3417 default:
goto __pyx_L5_argtuple_error;
3419 kw_args = PyDict_Size(__pyx_kwds);
3422 if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_y)) != 0)) kw_args--;
3423 else goto __pyx_L5_argtuple_error;
3426 if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_Dy)) != 0)) kw_args--;
3428 __Pyx_RaiseArgtupleInvalid(
"calculate_yprime", 1, 4, 4, 1); __PYX_ERR(1, 39, __pyx_L3_error)
3432 if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_yprime)) != 0)) kw_args--;
3434 __Pyx_RaiseArgtupleInvalid(
"calculate_yprime", 1, 4, 4, 2); __PYX_ERR(1, 39, __pyx_L3_error)
3438 if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_Dyprime)) != 0)) kw_args--;
3440 __Pyx_RaiseArgtupleInvalid(
"calculate_yprime", 1, 4, 4, 3); __PYX_ERR(1, 39, __pyx_L3_error)
3443 if (unlikely(kw_args > 0)) {
3444 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args,
"calculate_yprime") < 0)) __PYX_ERR(1, 39, __pyx_L3_error)
3446 }
else if (PyTuple_GET_SIZE(__pyx_args) != 4) {
3447 goto __pyx_L5_argtuple_error;
3449 values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
3450 values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
3451 values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
3452 values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
3454 __pyx_v_y = ((PyArrayObject *)values[0]);
3455 __pyx_v_Dy = ((PyArrayObject *)values[1]);
3456 __pyx_v_yprime = ((PyArrayObject *)values[2]);
3457 __pyx_v_Dyprime = ((PyArrayObject *)values[3]);
3459 goto __pyx_L4_argument_unpacking_done;
3460 __pyx_L5_argtuple_error:;
3461 __Pyx_RaiseArgtupleInvalid(
"calculate_yprime", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(1, 39, __pyx_L3_error)
3463 __Pyx_AddTraceback(
"flcbdfWrappers.FLCBDF_integrator.calculate_yprime", __pyx_clineno, __pyx_lineno, __pyx_filename);
3464 __Pyx_RefNannyFinishContext();
3466 __pyx_L4_argument_unpacking_done:;
3467 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_y), __pyx_ptype_5numpy_ndarray, 1,
"y", 0))) __PYX_ERR(1, 40, __pyx_L1_error)
3468 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_Dy), __pyx_ptype_5numpy_ndarray, 1,
"Dy", 0))) __PYX_ERR(1, 41, __pyx_L1_error)
3469 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_yprime), __pyx_ptype_5numpy_ndarray, 1,
"yprime", 0))) __PYX_ERR(1, 42, __pyx_L1_error)
3470 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_Dyprime), __pyx_ptype_5numpy_ndarray, 1,
"Dyprime", 0))) __PYX_ERR(1, 43, __pyx_L1_error)
3471 __pyx_r = __pyx_pf_14flcbdfWrappers_17FLCBDF_integrator_12calculate_yprime(((
struct __pyx_obj_14flcbdfWrappers_FLCBDF_integrator *)__pyx_v_self), __pyx_v_y, __pyx_v_Dy, __pyx_v_yprime, __pyx_v_Dyprime);
3478 __Pyx_RefNannyFinishContext();
3482 static PyObject *__pyx_pf_14flcbdfWrappers_17FLCBDF_integrator_12calculate_yprime(
struct __pyx_obj_14flcbdfWrappers_FLCBDF_integrator *__pyx_v_self, PyArrayObject *__pyx_v_y, PyArrayObject *__pyx_v_Dy, PyArrayObject *__pyx_v_yprime, PyArrayObject *__pyx_v_Dyprime) {
3483 PyObject *__pyx_r = NULL;
3484 __Pyx_RefNannyDeclarations
3486 __Pyx_RefNannySetupContext(
"calculate_yprime", 0);
3495 __pyx_t_1 = ((__pyx_v_self->yVec == NULL) != 0);
3505 __pyx_v_self->yVec =
new Daetk::Petsc::Vec(((Daetk::Petsc::Vec::CopyType)Daetk::Petsc::Vec::REF), ((
double *)__pyx_v_y->data), __pyx_v_self->flcbdf->yn.ldim_);
3514 __pyx_v_self->DyVec =
new Daetk::Petsc::Vec(((Daetk::Petsc::Vec::CopyType)Daetk::Petsc::Vec::REF), ((
double *)__pyx_v_Dy->data), __pyx_v_self->flcbdf->yn.ldim_);
3523 __pyx_v_self->yprimeVec =
new Daetk::Petsc::Vec(((Daetk::Petsc::Vec::CopyType)Daetk::Petsc::Vec::REF), ((
double *)__pyx_v_yprime->data), __pyx_v_self->flcbdf->yn.ldim_);
3532 __pyx_v_self->DyprimeVec =
new Daetk::Petsc::Vec(((Daetk::Petsc::Vec::CopyType)Daetk::Petsc::Vec::REF), ((
double *)__pyx_v_Dyprime->data), __pyx_v_self->flcbdf->yn.ldim_);
3550 (void)(__pyx_v_self->flcbdf->calculate_yprime((__pyx_v_self->yVec[0]), (__pyx_v_self->DyVec[0]), (__pyx_v_self->yprimeVec[0]), (__pyx_v_self->DyprimeVec[0])));
3561 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
3562 __Pyx_XGIVEREF(__pyx_r);
3563 __Pyx_RefNannyFinishContext();
3576 static PyObject *__pyx_pw_14flcbdfWrappers_17FLCBDF_integrator_15stepTaken(PyObject *__pyx_v_self, PyObject *__pyx_v_y);
3577 static PyObject *__pyx_pw_14flcbdfWrappers_17FLCBDF_integrator_15stepTaken(PyObject *__pyx_v_self, PyObject *__pyx_v_y) {
3578 int __pyx_lineno = 0;
3579 const char *__pyx_filename = NULL;
3580 int __pyx_clineno = 0;
3581 PyObject *__pyx_r = 0;
3582 __Pyx_RefNannyDeclarations
3583 __Pyx_RefNannySetupContext(
"stepTaken (wrapper)", 0);
3584 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_y), __pyx_ptype_5numpy_ndarray, 1,
"y", 0))) __PYX_ERR(1, 51, __pyx_L1_error)
3585 __pyx_r = __pyx_pf_14flcbdfWrappers_17FLCBDF_integrator_14stepTaken(((
struct __pyx_obj_14flcbdfWrappers_FLCBDF_integrator *)__pyx_v_self), ((PyArrayObject *)__pyx_v_y));
3592 __Pyx_RefNannyFinishContext();
3596 static PyObject *__pyx_pf_14flcbdfWrappers_17FLCBDF_integrator_14stepTaken(
struct __pyx_obj_14flcbdfWrappers_FLCBDF_integrator *__pyx_v_self, PyArrayObject *__pyx_v_y) {
3597 Daetk::Petsc::Vec *__pyx_v_yVec;
3598 PyObject *__pyx_r = NULL;
3599 __Pyx_RefNannyDeclarations
3600 __Pyx_RefNannySetupContext(
"stepTaken", 0);
3609 __pyx_v_yVec =
new Daetk::Petsc::Vec(((Daetk::Petsc::Vec::CopyType)Daetk::Petsc::Vec::REF), ((
double *)__pyx_v_y->data), __pyx_v_self->flcbdf->yn.ldim_);
3618 (void)(__pyx_v_self->flcbdf->estimateError((__pyx_v_yVec[0])));
3627 delete __pyx_v_yVec;
3638 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
3639 __Pyx_XGIVEREF(__pyx_r);
3640 __Pyx_RefNannyFinishContext();
3653 static PyObject *__pyx_pw_14flcbdfWrappers_17FLCBDF_integrator_17retryStep_errorFailure(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused);
3654 static PyObject *__pyx_pw_14flcbdfWrappers_17FLCBDF_integrator_17retryStep_errorFailure(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
3655 PyObject *__pyx_r = 0;
3656 __Pyx_RefNannyDeclarations
3657 __Pyx_RefNannySetupContext(
"retryStep_errorFailure (wrapper)", 0);
3658 __pyx_r = __pyx_pf_14flcbdfWrappers_17FLCBDF_integrator_16retryStep_errorFailure(((
struct __pyx_obj_14flcbdfWrappers_FLCBDF_integrator *)__pyx_v_self));
3661 __Pyx_RefNannyFinishContext();
3665 static PyObject *__pyx_pf_14flcbdfWrappers_17FLCBDF_integrator_16retryStep_errorFailure(
struct __pyx_obj_14flcbdfWrappers_FLCBDF_integrator *__pyx_v_self) {
3667 PyObject *__pyx_r = NULL;
3668 __Pyx_RefNannyDeclarations
3669 PyObject *__pyx_t_1 = NULL;
3670 int __pyx_lineno = 0;
3671 const char *__pyx_filename = NULL;
3672 int __pyx_clineno = 0;
3673 __Pyx_RefNannySetupContext(
"retryStep_errorFailure", 0);
3682 __pyx_v_h = __pyx_v_self->flcbdf->retryStep_errorFailure();
3691 __Pyx_XDECREF(__pyx_r);
3692 __pyx_t_1 = PyFloat_FromDouble(__pyx_v_h);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 59, __pyx_L1_error)
3693 __Pyx_GOTREF(__pyx_t_1);
3694 __pyx_r = __pyx_t_1;
3708 __Pyx_XDECREF(__pyx_t_1);
3709 __Pyx_AddTraceback(
"flcbdfWrappers.FLCBDF_integrator.retryStep_errorFailure", __pyx_clineno, __pyx_lineno, __pyx_filename);
3712 __Pyx_XGIVEREF(__pyx_r);
3713 __Pyx_RefNannyFinishContext();
3726 static PyObject *__pyx_pw_14flcbdfWrappers_17FLCBDF_integrator_19retryStep_solverFailure(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused);
3727 static PyObject *__pyx_pw_14flcbdfWrappers_17FLCBDF_integrator_19retryStep_solverFailure(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
3728 PyObject *__pyx_r = 0;
3729 __Pyx_RefNannyDeclarations
3730 __Pyx_RefNannySetupContext(
"retryStep_solverFailure (wrapper)", 0);
3731 __pyx_r = __pyx_pf_14flcbdfWrappers_17FLCBDF_integrator_18retryStep_solverFailure(((
struct __pyx_obj_14flcbdfWrappers_FLCBDF_integrator *)__pyx_v_self));
3734 __Pyx_RefNannyFinishContext();
3738 static PyObject *__pyx_pf_14flcbdfWrappers_17FLCBDF_integrator_18retryStep_solverFailure(
struct __pyx_obj_14flcbdfWrappers_FLCBDF_integrator *__pyx_v_self) {
3740 PyObject *__pyx_r = NULL;
3741 __Pyx_RefNannyDeclarations
3742 PyObject *__pyx_t_1 = NULL;
3743 int __pyx_lineno = 0;
3744 const char *__pyx_filename = NULL;
3745 int __pyx_clineno = 0;
3746 __Pyx_RefNannySetupContext(
"retryStep_solverFailure", 0);
3755 __pyx_v_h = __pyx_v_self->flcbdf->retryStep_solverFailure();
3764 __Pyx_XDECREF(__pyx_r);
3765 __pyx_t_1 = PyFloat_FromDouble(__pyx_v_h);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 64, __pyx_L1_error)
3766 __Pyx_GOTREF(__pyx_t_1);
3767 __pyx_r = __pyx_t_1;
3781 __Pyx_XDECREF(__pyx_t_1);
3782 __Pyx_AddTraceback(
"flcbdfWrappers.FLCBDF_integrator.retryStep_solverFailure", __pyx_clineno, __pyx_lineno, __pyx_filename);
3785 __Pyx_XGIVEREF(__pyx_r);
3786 __Pyx_RefNannyFinishContext();
3799 static PyObject *__pyx_pw_14flcbdfWrappers_17FLCBDF_integrator_21initializeTimeHistory(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
3800 static PyObject *__pyx_pw_14flcbdfWrappers_17FLCBDF_integrator_21initializeTimeHistory(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
3801 PyArrayObject *__pyx_v_y = 0;
3802 PyArrayObject *__pyx_v_yPrime = 0;
3803 int __pyx_lineno = 0;
3804 const char *__pyx_filename = NULL;
3805 int __pyx_clineno = 0;
3806 PyObject *__pyx_r = 0;
3807 __Pyx_RefNannyDeclarations
3808 __Pyx_RefNannySetupContext(
"initializeTimeHistory (wrapper)", 0);
3810 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_y,&__pyx_n_s_yPrime,0};
3811 PyObject* values[2] = {0,0};
3812 if (unlikely(__pyx_kwds)) {
3814 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
3816 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
3818 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
3821 default:
goto __pyx_L5_argtuple_error;
3823 kw_args = PyDict_Size(__pyx_kwds);
3826 if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_y)) != 0)) kw_args--;
3827 else goto __pyx_L5_argtuple_error;
3830 if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_yPrime)) != 0)) kw_args--;
3832 __Pyx_RaiseArgtupleInvalid(
"initializeTimeHistory", 1, 2, 2, 1); __PYX_ERR(1, 66, __pyx_L3_error)
3835 if (unlikely(kw_args > 0)) {
3836 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args,
"initializeTimeHistory") < 0)) __PYX_ERR(1, 66, __pyx_L3_error)
3838 }
else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
3839 goto __pyx_L5_argtuple_error;
3841 values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
3842 values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
3844 __pyx_v_y = ((PyArrayObject *)values[0]);
3845 __pyx_v_yPrime = ((PyArrayObject *)values[1]);
3847 goto __pyx_L4_argument_unpacking_done;
3848 __pyx_L5_argtuple_error:;
3849 __Pyx_RaiseArgtupleInvalid(
"initializeTimeHistory", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(1, 66, __pyx_L3_error)
3851 __Pyx_AddTraceback(
"flcbdfWrappers.FLCBDF_integrator.initializeTimeHistory", __pyx_clineno, __pyx_lineno, __pyx_filename);
3852 __Pyx_RefNannyFinishContext();
3854 __pyx_L4_argument_unpacking_done:;
3855 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_y), __pyx_ptype_5numpy_ndarray, 1,
"y", 0))) __PYX_ERR(1, 67, __pyx_L1_error)
3856 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_yPrime), __pyx_ptype_5numpy_ndarray, 1,
"yPrime", 0))) __PYX_ERR(1, 68, __pyx_L1_error)
3857 __pyx_r = __pyx_pf_14flcbdfWrappers_17FLCBDF_integrator_20initializeTimeHistory(((
struct __pyx_obj_14flcbdfWrappers_FLCBDF_integrator *)__pyx_v_self), __pyx_v_y, __pyx_v_yPrime);
3864 __Pyx_RefNannyFinishContext();
3868 static PyObject *__pyx_pf_14flcbdfWrappers_17FLCBDF_integrator_20initializeTimeHistory(
struct __pyx_obj_14flcbdfWrappers_FLCBDF_integrator *__pyx_v_self, PyArrayObject *__pyx_v_y, PyArrayObject *__pyx_v_yPrime) {
3869 Daetk::Petsc::Vec *__pyx_v_yVec;
3870 Daetk::Petsc::Vec *__pyx_v_yPrimeVec;
3871 PyObject *__pyx_r = NULL;
3872 __Pyx_RefNannyDeclarations
3873 __Pyx_RefNannySetupContext(
"initializeTimeHistory", 0);
3882 __pyx_v_yVec =
new Daetk::Petsc::Vec(((Daetk::Petsc::Vec::CopyType)Daetk::Petsc::Vec::REF), ((
double *)__pyx_v_y->data), __pyx_v_self->flcbdf->yn.ldim_);
3891 __pyx_v_yPrimeVec =
new Daetk::Petsc::Vec(((Daetk::Petsc::Vec::CopyType)Daetk::Petsc::Vec::REF), ((
double *)__pyx_v_yPrime->data), __pyx_v_self->flcbdf->yn.ldim_);
3900 (void)(__pyx_v_self->flcbdf->initializeTimeHistory((__pyx_v_yVec[0]), (__pyx_v_yPrimeVec[0])));
3909 delete __pyx_v_yVec;
3918 delete __pyx_v_yPrimeVec;
3929 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
3930 __Pyx_XGIVEREF(__pyx_r);
3931 __Pyx_RefNannyFinishContext();
3944 static PyObject *__pyx_pw_14flcbdfWrappers_17FLCBDF_integrator_23setTolerances(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
3945 static PyObject *__pyx_pw_14flcbdfWrappers_17FLCBDF_integrator_23setTolerances(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
3946 double __pyx_v_atol;
3947 double __pyx_v_rtol;
3948 PyArrayObject *__pyx_v_dV = 0;
3949 int __pyx_lineno = 0;
3950 const char *__pyx_filename = NULL;
3951 int __pyx_clineno = 0;
3952 PyObject *__pyx_r = 0;
3953 __Pyx_RefNannyDeclarations
3954 __Pyx_RefNannySetupContext(
"setTolerances (wrapper)", 0);
3956 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_atol,&__pyx_n_s_rtol,&__pyx_n_s_dV,0};
3957 PyObject* values[3] = {0,0,0};
3958 if (unlikely(__pyx_kwds)) {
3960 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
3962 case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
3964 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
3966 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
3969 default:
goto __pyx_L5_argtuple_error;
3971 kw_args = PyDict_Size(__pyx_kwds);
3974 if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_atol)) != 0)) kw_args--;
3975 else goto __pyx_L5_argtuple_error;
3978 if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_rtol)) != 0)) kw_args--;
3980 __Pyx_RaiseArgtupleInvalid(
"setTolerances", 1, 3, 3, 1); __PYX_ERR(1, 75, __pyx_L3_error)
3984 if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_dV)) != 0)) kw_args--;
3986 __Pyx_RaiseArgtupleInvalid(
"setTolerances", 1, 3, 3, 2); __PYX_ERR(1, 75, __pyx_L3_error)
3989 if (unlikely(kw_args > 0)) {
3990 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args,
"setTolerances") < 0)) __PYX_ERR(1, 75, __pyx_L3_error)
3992 }
else if (PyTuple_GET_SIZE(__pyx_args) != 3) {
3993 goto __pyx_L5_argtuple_error;
3995 values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
3996 values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
3997 values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
3999 __pyx_v_atol = __pyx_PyFloat_AsDouble(values[0]);
if (unlikely((__pyx_v_atol == (
double)-1) && PyErr_Occurred())) __PYX_ERR(1, 76, __pyx_L3_error)
4000 __pyx_v_rtol = __pyx_PyFloat_AsDouble(values[1]);
if (unlikely((__pyx_v_rtol == (
double)-1) && PyErr_Occurred())) __PYX_ERR(1, 77, __pyx_L3_error)
4001 __pyx_v_dV = ((PyArrayObject *)values[2]);
4003 goto __pyx_L4_argument_unpacking_done;
4004 __pyx_L5_argtuple_error:;
4005 __Pyx_RaiseArgtupleInvalid(
"setTolerances", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(1, 75, __pyx_L3_error)
4007 __Pyx_AddTraceback(
"flcbdfWrappers.FLCBDF_integrator.setTolerances", __pyx_clineno, __pyx_lineno, __pyx_filename);
4008 __Pyx_RefNannyFinishContext();
4010 __pyx_L4_argument_unpacking_done:;
4011 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_dV), __pyx_ptype_5numpy_ndarray, 1,
"dV", 0))) __PYX_ERR(1, 78, __pyx_L1_error)
4012 __pyx_r = __pyx_pf_14flcbdfWrappers_17FLCBDF_integrator_22setTolerances(((
struct __pyx_obj_14flcbdfWrappers_FLCBDF_integrator *)__pyx_v_self), __pyx_v_atol, __pyx_v_rtol, __pyx_v_dV);
4019 __Pyx_RefNannyFinishContext();
4023 static PyObject *__pyx_pf_14flcbdfWrappers_17FLCBDF_integrator_22setTolerances(
struct __pyx_obj_14flcbdfWrappers_FLCBDF_integrator *__pyx_v_self,
double __pyx_v_atol,
double __pyx_v_rtol, PyArrayObject *__pyx_v_dV) {
4024 Daetk::Petsc::Vec *__pyx_v_dV_Vec;
4025 PyObject *__pyx_r = NULL;
4026 __Pyx_RefNannyDeclarations
4027 __Pyx_RefNannySetupContext(
"setTolerances", 0);
4036 __pyx_v_dV_Vec =
new Daetk::Petsc::Vec(((Daetk::Petsc::Vec::CopyType)Daetk::Petsc::Vec::REF), ((
double *)__pyx_v_dV->data), __pyx_v_self->flcbdf->yn.ldim_);
4045 __pyx_v_self->wNormp->setTolerances(__pyx_v_atol, __pyx_v_rtol, (__pyx_v_dV_Vec[0]));
4054 delete __pyx_v_dV_Vec;
4065 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
4066 __Pyx_XGIVEREF(__pyx_r);
4067 __Pyx_RefNannyFinishContext();
4080 static PyObject *__pyx_pw_14flcbdfWrappers_17FLCBDF_integrator_25getCurrentAlpha(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused);
4081 static PyObject *__pyx_pw_14flcbdfWrappers_17FLCBDF_integrator_25getCurrentAlpha(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
4082 PyObject *__pyx_r = 0;
4083 __Pyx_RefNannyDeclarations
4084 __Pyx_RefNannySetupContext(
"getCurrentAlpha (wrapper)", 0);
4085 __pyx_r = __pyx_pf_14flcbdfWrappers_17FLCBDF_integrator_24getCurrentAlpha(((
struct __pyx_obj_14flcbdfWrappers_FLCBDF_integrator *)__pyx_v_self));
4088 __Pyx_RefNannyFinishContext();
4092 static PyObject *__pyx_pf_14flcbdfWrappers_17FLCBDF_integrator_24getCurrentAlpha(
struct __pyx_obj_14flcbdfWrappers_FLCBDF_integrator *__pyx_v_self) {
4093 double __pyx_v_alpha;
4094 PyObject *__pyx_r = NULL;
4095 __Pyx_RefNannyDeclarations
4096 PyObject *__pyx_t_1 = NULL;
4097 int __pyx_lineno = 0;
4098 const char *__pyx_filename = NULL;
4099 int __pyx_clineno = 0;
4100 __Pyx_RefNannySetupContext(
"getCurrentAlpha", 0);
4109 __pyx_v_alpha = __pyx_v_self->flcbdf->getCurrentAlpha();
4118 __Pyx_XDECREF(__pyx_r);
4119 __pyx_t_1 = PyFloat_FromDouble(__pyx_v_alpha);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 86, __pyx_L1_error)
4120 __Pyx_GOTREF(__pyx_t_1);
4121 __pyx_r = __pyx_t_1;
4135 __Pyx_XDECREF(__pyx_t_1);
4136 __Pyx_AddTraceback(
"flcbdfWrappers.FLCBDF_integrator.getCurrentAlpha", __pyx_clineno, __pyx_lineno, __pyx_filename);
4139 __Pyx_XGIVEREF(__pyx_r);
4140 __Pyx_RefNannyFinishContext();
4153 static int __pyx_pw_14flcbdfWrappers_17FLCBDF_integrator_27__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
4154 static int __pyx_pw_14flcbdfWrappers_17FLCBDF_integrator_27__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
4155 PyArrayObject *__pyx_v_y = 0;
4156 PyObject *__pyx_v_yName = 0;
4157 int __pyx_lineno = 0;
4158 const char *__pyx_filename = NULL;
4159 int __pyx_clineno = 0;
4161 __Pyx_RefNannyDeclarations
4162 __Pyx_RefNannySetupContext(
"__cinit__ (wrapper)", 0);
4164 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_y,&__pyx_n_s_yName,0};
4165 PyObject* values[2] = {0,0};
4166 if (unlikely(__pyx_kwds)) {
4168 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
4170 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
4172 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
4175 default:
goto __pyx_L5_argtuple_error;
4177 kw_args = PyDict_Size(__pyx_kwds);
4180 if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_y)) != 0)) kw_args--;
4181 else goto __pyx_L5_argtuple_error;
4184 if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_yName)) != 0)) kw_args--;
4186 __Pyx_RaiseArgtupleInvalid(
"__cinit__", 1, 2, 2, 1); __PYX_ERR(1, 88, __pyx_L3_error)
4189 if (unlikely(kw_args > 0)) {
4190 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args,
"__cinit__") < 0)) __PYX_ERR(1, 88, __pyx_L3_error)
4192 }
else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
4193 goto __pyx_L5_argtuple_error;
4195 values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
4196 values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
4198 __pyx_v_y = ((PyArrayObject *)values[0]);
4199 __pyx_v_yName = values[1];
4201 goto __pyx_L4_argument_unpacking_done;
4202 __pyx_L5_argtuple_error:;
4203 __Pyx_RaiseArgtupleInvalid(
"__cinit__", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(1, 88, __pyx_L3_error)
4205 __Pyx_AddTraceback(
"flcbdfWrappers.FLCBDF_integrator.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
4206 __Pyx_RefNannyFinishContext();
4208 __pyx_L4_argument_unpacking_done:;
4209 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_y), __pyx_ptype_5numpy_ndarray, 1,
"y", 0))) __PYX_ERR(1, 89, __pyx_L1_error)
4210 __pyx_r = __pyx_pf_14flcbdfWrappers_17FLCBDF_integrator_26__cinit__(((
struct __pyx_obj_14flcbdfWrappers_FLCBDF_integrator *)__pyx_v_self), __pyx_v_y, __pyx_v_yName);
4217 __Pyx_RefNannyFinishContext();
4221 static int __pyx_pf_14flcbdfWrappers_17FLCBDF_integrator_26__cinit__(
struct __pyx_obj_14flcbdfWrappers_FLCBDF_integrator *__pyx_v_self, PyArrayObject *__pyx_v_y, PyObject *__pyx_v_yName) {
4222 CYTHON_UNUSED
int __pyx_v_initialized;
4223 int __pyx_v_ignore1;
4224 char **__pyx_v_ignore2;
4226 PyObject *__pyx_v_dataFilename = NULL;
4228 __Pyx_RefNannyDeclarations
4229 PyObject *__pyx_t_1 = NULL;
4233 PyObject *__pyx_t_5 = NULL;
4234 PyObject *__pyx_t_6 = NULL;
4235 PyObject *__pyx_t_7 = NULL;
4236 PyObject *__pyx_t_8 = NULL;
4237 char const *__pyx_t_9;
4238 int __pyx_lineno = 0;
4239 const char *__pyx_filename = NULL;
4240 int __pyx_clineno = 0;
4241 __Pyx_RefNannySetupContext(
"__cinit__", 0);
4242 __Pyx_INCREF(__pyx_v_yName);
4251 __pyx_v_initialized = 1;
4260 __pyx_v_self->petscSys =
new Daetk::Petsc::Sys(__pyx_v_ignore1, __pyx_v_ignore2, NULL, NULL);
4269 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_y), __pyx_n_s_size);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 95, __pyx_L1_error)
4270 __Pyx_GOTREF(__pyx_t_1);
4271 __pyx_t_2 = __Pyx_PyInt_As_int(__pyx_t_1);
if (unlikely((__pyx_t_2 == (
int)-1) && PyErr_Occurred())) __PYX_ERR(1, 95, __pyx_L1_error)
4272 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
4273 __pyx_v_dim = __pyx_t_2;
4282 __pyx_v_self->sizeVec =
new Daetk::Petsc::Vec(((Daetk::Petsc::Vec::CopyType)Daetk::Petsc::Vec::REF), ((
double *)__pyx_v_y->data), __pyx_v_dim);
4291 __pyx_v_self->sizeVec->setExample();
4300 __pyx_v_self->wNormp =
new Daetk::WeightedL2Norm(__pyx_v_dim);
4309 __pyx_t_3 = PyBytes_Check(__pyx_v_yName);
4310 __pyx_t_4 = ((!(__pyx_t_3 != 0)) != 0);
4320 __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_yName, __pyx_n_s_encode);
if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 100, __pyx_L1_error)
4321 __Pyx_GOTREF(__pyx_t_5);
4323 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) {
4324 __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5);
4325 if (likely(__pyx_t_6)) {
4326 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_5);
4327 __Pyx_INCREF(__pyx_t_6);
4328 __Pyx_INCREF(
function);
4329 __Pyx_DECREF_SET(__pyx_t_5,
function);
4332 __pyx_t_1 = (__pyx_t_6) ? __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_6) : __Pyx_PyObject_CallNoArg(__pyx_t_5);
4333 __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
4334 if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 100, __pyx_L1_error)
4335 __Pyx_GOTREF(__pyx_t_1);
4336 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
4337 __Pyx_DECREF_SET(__pyx_v_yName, __pyx_t_1);
4356 __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_kp_s_data__0_d___1_s_txt, __pyx_n_s_format);
if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 101, __pyx_L1_error)
4357 __Pyx_GOTREF(__pyx_t_5);
4358 __pyx_t_6 = __Pyx_PyInt_From_int(__pyx_v_dim);
if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 101, __pyx_L1_error)
4359 __Pyx_GOTREF(__pyx_t_6);
4362 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) {
4363 __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_5);
4364 if (likely(__pyx_t_7)) {
4365 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_5);
4366 __Pyx_INCREF(__pyx_t_7);
4367 __Pyx_INCREF(
function);
4368 __Pyx_DECREF_SET(__pyx_t_5,
function);
4372 #if CYTHON_FAST_PYCALL
4373 if (PyFunction_Check(__pyx_t_5)) {
4374 PyObject *__pyx_temp[3] = {__pyx_t_7, __pyx_t_6, __pyx_v_yName};
4375 __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_2, 2+__pyx_t_2);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 101, __pyx_L1_error)
4376 __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
4377 __Pyx_GOTREF(__pyx_t_1);
4378 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
4381 #if CYTHON_FAST_PYCCALL
4382 if (__Pyx_PyFastCFunction_Check(__pyx_t_5)) {
4383 PyObject *__pyx_temp[3] = {__pyx_t_7, __pyx_t_6, __pyx_v_yName};
4384 __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_2, 2+__pyx_t_2);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 101, __pyx_L1_error)
4385 __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
4386 __Pyx_GOTREF(__pyx_t_1);
4387 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
4391 __pyx_t_8 = PyTuple_New(2+__pyx_t_2);
if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 101, __pyx_L1_error)
4392 __Pyx_GOTREF(__pyx_t_8);
4394 __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_7); __pyx_t_7 = NULL;
4396 __Pyx_GIVEREF(__pyx_t_6);
4397 PyTuple_SET_ITEM(__pyx_t_8, 0+__pyx_t_2, __pyx_t_6);
4398 __Pyx_INCREF(__pyx_v_yName);
4399 __Pyx_GIVEREF(__pyx_v_yName);
4400 PyTuple_SET_ITEM(__pyx_t_8, 1+__pyx_t_2, __pyx_v_yName);
4402 __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_8, NULL);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 101, __pyx_L1_error)
4403 __Pyx_GOTREF(__pyx_t_1);
4404 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
4406 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
4407 __pyx_v_dataFilename = __pyx_t_1;
4417 __pyx_t_9 = __Pyx_PyObject_AsString(__pyx_v_dataFilename);
if (unlikely((!__pyx_t_9) && PyErr_Occurred())) __PYX_ERR(1, 102, __pyx_L1_error)
4418 __pyx_v_self->data =
new Daetk::FullDataFile(0.0, __pyx_t_9);
4427 __pyx_v_self->flcbdf =
new Daetk::FLCBDF_lite(__pyx_v_dim, (__pyx_v_self->wNormp[0]), (__pyx_v_self->data[0]));
4441 __Pyx_XDECREF(__pyx_t_1);
4442 __Pyx_XDECREF(__pyx_t_5);
4443 __Pyx_XDECREF(__pyx_t_6);
4444 __Pyx_XDECREF(__pyx_t_7);
4445 __Pyx_XDECREF(__pyx_t_8);
4446 __Pyx_AddTraceback(
"flcbdfWrappers.FLCBDF_integrator.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
4449 __Pyx_XDECREF(__pyx_v_dataFilename);
4450 __Pyx_XDECREF(__pyx_v_yName);
4451 __Pyx_RefNannyFinishContext();
4464 static void __pyx_pw_14flcbdfWrappers_17FLCBDF_integrator_29__dealloc__(PyObject *__pyx_v_self);
4465 static void __pyx_pw_14flcbdfWrappers_17FLCBDF_integrator_29__dealloc__(PyObject *__pyx_v_self) {
4466 __Pyx_RefNannyDeclarations
4467 __Pyx_RefNannySetupContext(
"__dealloc__ (wrapper)", 0);
4468 __pyx_pf_14flcbdfWrappers_17FLCBDF_integrator_28__dealloc__(((
struct __pyx_obj_14flcbdfWrappers_FLCBDF_integrator *)__pyx_v_self));
4471 __Pyx_RefNannyFinishContext();
4474 static void __pyx_pf_14flcbdfWrappers_17FLCBDF_integrator_28__dealloc__(
struct __pyx_obj_14flcbdfWrappers_FLCBDF_integrator *__pyx_v_self) {
4475 __Pyx_RefNannyDeclarations
4476 __Pyx_RefNannySetupContext(
"__dealloc__", 0);
4485 delete __pyx_v_self->wNormp;
4494 delete __pyx_v_self->petscSys;
4503 delete __pyx_v_self->data;
4511 delete __pyx_v_self->flcbdf;
4518 delete __pyx_v_self->sizeVec;
4529 __Pyx_RefNannyFinishContext();
4539 static PyObject *__pyx_pw_14flcbdfWrappers_17FLCBDF_integrator_31__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused);
4540 static PyObject *__pyx_pw_14flcbdfWrappers_17FLCBDF_integrator_31__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
4541 PyObject *__pyx_r = 0;
4542 __Pyx_RefNannyDeclarations
4543 __Pyx_RefNannySetupContext(
"__reduce_cython__ (wrapper)", 0);
4544 __pyx_r = __pyx_pf_14flcbdfWrappers_17FLCBDF_integrator_30__reduce_cython__(((
struct __pyx_obj_14flcbdfWrappers_FLCBDF_integrator *)__pyx_v_self));
4547 __Pyx_RefNannyFinishContext();
4551 static PyObject *__pyx_pf_14flcbdfWrappers_17FLCBDF_integrator_30__reduce_cython__(CYTHON_UNUSED
struct __pyx_obj_14flcbdfWrappers_FLCBDF_integrator *__pyx_v_self) {
4552 PyObject *__pyx_r = NULL;
4553 __Pyx_RefNannyDeclarations
4554 PyObject *__pyx_t_1 = NULL;
4555 int __pyx_lineno = 0;
4556 const char *__pyx_filename = NULL;
4557 int __pyx_clineno = 0;
4558 __Pyx_RefNannySetupContext(
"__reduce_cython__", 0);
4566 __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__2, NULL);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2, __pyx_L1_error)
4567 __Pyx_GOTREF(__pyx_t_1);
4568 __Pyx_Raise(__pyx_t_1, 0, 0, 0);
4569 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
4570 __PYX_ERR(0, 2, __pyx_L1_error)
4580 __Pyx_XDECREF(__pyx_t_1);
4581 __Pyx_AddTraceback(
"flcbdfWrappers.FLCBDF_integrator.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
4583 __Pyx_XGIVEREF(__pyx_r);
4584 __Pyx_RefNannyFinishContext();
4596 static PyObject *__pyx_pw_14flcbdfWrappers_17FLCBDF_integrator_33__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state);
4597 static PyObject *__pyx_pw_14flcbdfWrappers_17FLCBDF_integrator_33__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
4598 PyObject *__pyx_r = 0;
4599 __Pyx_RefNannyDeclarations
4600 __Pyx_RefNannySetupContext(
"__setstate_cython__ (wrapper)", 0);
4601 __pyx_r = __pyx_pf_14flcbdfWrappers_17FLCBDF_integrator_32__setstate_cython__(((
struct __pyx_obj_14flcbdfWrappers_FLCBDF_integrator *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state));
4604 __Pyx_RefNannyFinishContext();
4608 static PyObject *__pyx_pf_14flcbdfWrappers_17FLCBDF_integrator_32__setstate_cython__(CYTHON_UNUSED
struct __pyx_obj_14flcbdfWrappers_FLCBDF_integrator *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) {
4609 PyObject *__pyx_r = NULL;
4610 __Pyx_RefNannyDeclarations
4611 PyObject *__pyx_t_1 = NULL;
4612 int __pyx_lineno = 0;
4613 const char *__pyx_filename = NULL;
4614 int __pyx_clineno = 0;
4615 __Pyx_RefNannySetupContext(
"__setstate_cython__", 0);
4622 __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__3, NULL);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4, __pyx_L1_error)
4623 __Pyx_GOTREF(__pyx_t_1);
4624 __Pyx_Raise(__pyx_t_1, 0, 0, 0);
4625 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
4626 __PYX_ERR(0, 4, __pyx_L1_error)
4637 __Pyx_XDECREF(__pyx_t_1);
4638 __Pyx_AddTraceback(
"flcbdfWrappers.FLCBDF_integrator.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
4640 __Pyx_XGIVEREF(__pyx_r);
4641 __Pyx_RefNannyFinishContext();
4653 static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew1(PyObject *__pyx_v_a) {
4654 PyObject *__pyx_r = NULL;
4655 __Pyx_RefNannyDeclarations
4656 PyObject *__pyx_t_1 = NULL;
4657 int __pyx_lineno = 0;
4658 const char *__pyx_filename = NULL;
4659 int __pyx_clineno = 0;
4660 __Pyx_RefNannySetupContext(
"PyArray_MultiIterNew1", 0);
4669 __Pyx_XDECREF(__pyx_r);
4670 __pyx_t_1 = PyArray_MultiIterNew(1, ((
void *)__pyx_v_a));
if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 736, __pyx_L1_error)
4671 __Pyx_GOTREF(__pyx_t_1);
4672 __pyx_r = __pyx_t_1;
4686 __Pyx_XDECREF(__pyx_t_1);
4687 __Pyx_AddTraceback(
"numpy.PyArray_MultiIterNew1", __pyx_clineno, __pyx_lineno, __pyx_filename);
4690 __Pyx_XGIVEREF(__pyx_r);
4691 __Pyx_RefNannyFinishContext();
4703 static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew2(PyObject *__pyx_v_a, PyObject *__pyx_v_b) {
4704 PyObject *__pyx_r = NULL;
4705 __Pyx_RefNannyDeclarations
4706 PyObject *__pyx_t_1 = NULL;
4707 int __pyx_lineno = 0;
4708 const char *__pyx_filename = NULL;
4709 int __pyx_clineno = 0;
4710 __Pyx_RefNannySetupContext(
"PyArray_MultiIterNew2", 0);
4719 __Pyx_XDECREF(__pyx_r);
4720 __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)
4721 __Pyx_GOTREF(__pyx_t_1);
4722 __pyx_r = __pyx_t_1;
4736 __Pyx_XDECREF(__pyx_t_1);
4737 __Pyx_AddTraceback(
"numpy.PyArray_MultiIterNew2", __pyx_clineno, __pyx_lineno, __pyx_filename);
4740 __Pyx_XGIVEREF(__pyx_r);
4741 __Pyx_RefNannyFinishContext();
4753 static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew3(PyObject *__pyx_v_a, PyObject *__pyx_v_b, PyObject *__pyx_v_c) {
4754 PyObject *__pyx_r = NULL;
4755 __Pyx_RefNannyDeclarations
4756 PyObject *__pyx_t_1 = NULL;
4757 int __pyx_lineno = 0;
4758 const char *__pyx_filename = NULL;
4759 int __pyx_clineno = 0;
4760 __Pyx_RefNannySetupContext(
"PyArray_MultiIterNew3", 0);
4769 __Pyx_XDECREF(__pyx_r);
4770 __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)
4771 __Pyx_GOTREF(__pyx_t_1);
4772 __pyx_r = __pyx_t_1;
4786 __Pyx_XDECREF(__pyx_t_1);
4787 __Pyx_AddTraceback(
"numpy.PyArray_MultiIterNew3", __pyx_clineno, __pyx_lineno, __pyx_filename);
4790 __Pyx_XGIVEREF(__pyx_r);
4791 __Pyx_RefNannyFinishContext();
4803 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) {
4804 PyObject *__pyx_r = NULL;
4805 __Pyx_RefNannyDeclarations
4806 PyObject *__pyx_t_1 = NULL;
4807 int __pyx_lineno = 0;
4808 const char *__pyx_filename = NULL;
4809 int __pyx_clineno = 0;
4810 __Pyx_RefNannySetupContext(
"PyArray_MultiIterNew4", 0);
4819 __Pyx_XDECREF(__pyx_r);
4820 __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)
4821 __Pyx_GOTREF(__pyx_t_1);
4822 __pyx_r = __pyx_t_1;
4836 __Pyx_XDECREF(__pyx_t_1);
4837 __Pyx_AddTraceback(
"numpy.PyArray_MultiIterNew4", __pyx_clineno, __pyx_lineno, __pyx_filename);
4840 __Pyx_XGIVEREF(__pyx_r);
4841 __Pyx_RefNannyFinishContext();
4853 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) {
4854 PyObject *__pyx_r = NULL;
4855 __Pyx_RefNannyDeclarations
4856 PyObject *__pyx_t_1 = NULL;
4857 int __pyx_lineno = 0;
4858 const char *__pyx_filename = NULL;
4859 int __pyx_clineno = 0;
4860 __Pyx_RefNannySetupContext(
"PyArray_MultiIterNew5", 0);
4869 __Pyx_XDECREF(__pyx_r);
4870 __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)
4871 __Pyx_GOTREF(__pyx_t_1);
4872 __pyx_r = __pyx_t_1;
4886 __Pyx_XDECREF(__pyx_t_1);
4887 __Pyx_AddTraceback(
"numpy.PyArray_MultiIterNew5", __pyx_clineno, __pyx_lineno, __pyx_filename);
4890 __Pyx_XGIVEREF(__pyx_r);
4891 __Pyx_RefNannyFinishContext();
4903 static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyDataType_SHAPE(PyArray_Descr *__pyx_v_d) {
4904 PyObject *__pyx_r = NULL;
4905 __Pyx_RefNannyDeclarations
4907 __Pyx_RefNannySetupContext(
"PyDataType_SHAPE", 0);
4916 __pyx_t_1 = (PyDataType_HASSUBARRAY(__pyx_v_d) != 0);
4926 __Pyx_XDECREF(__pyx_r);
4927 __Pyx_INCREF(((PyObject*)__pyx_v_d->subarray->shape));
4928 __pyx_r = ((PyObject*)__pyx_v_d->subarray->shape);
4948 __Pyx_XDECREF(__pyx_r);
4949 __Pyx_INCREF(__pyx_empty_tuple);
4950 __pyx_r = __pyx_empty_tuple;
4964 __Pyx_XGIVEREF(__pyx_r);
4965 __Pyx_RefNannyFinishContext();
4977 static CYTHON_INLINE
void __pyx_f_5numpy_set_array_base(PyArrayObject *__pyx_v_arr, PyObject *__pyx_v_base) {
4978 __Pyx_RefNannyDeclarations
4979 __Pyx_RefNannySetupContext(
"set_array_base", 0);
4988 Py_INCREF(__pyx_v_base);
4997 (void)(PyArray_SetBaseObject(__pyx_v_arr, __pyx_v_base));
5008 __Pyx_RefNannyFinishContext();
5019 static CYTHON_INLINE PyObject *__pyx_f_5numpy_get_array_base(PyArrayObject *__pyx_v_arr) {
5020 PyObject *__pyx_v_base;
5021 PyObject *__pyx_r = NULL;
5022 __Pyx_RefNannyDeclarations
5024 __Pyx_RefNannySetupContext(
"get_array_base", 0);
5033 __pyx_v_base = PyArray_BASE(__pyx_v_arr);
5042 __pyx_t_1 = ((__pyx_v_base == NULL) != 0);
5052 __Pyx_XDECREF(__pyx_r);
5053 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
5072 __Pyx_XDECREF(__pyx_r);
5073 __Pyx_INCREF(((PyObject *)__pyx_v_base));
5074 __pyx_r = ((PyObject *)__pyx_v_base);
5087 __Pyx_XGIVEREF(__pyx_r);
5088 __Pyx_RefNannyFinishContext();
5100 static CYTHON_INLINE
int __pyx_f_5numpy_import_array(
void) {
5102 __Pyx_RefNannyDeclarations
5103 PyObject *__pyx_t_1 = NULL;
5104 PyObject *__pyx_t_2 = NULL;
5105 PyObject *__pyx_t_3 = NULL;
5107 PyObject *__pyx_t_5 = NULL;
5108 PyObject *__pyx_t_6 = NULL;
5109 PyObject *__pyx_t_7 = NULL;
5110 PyObject *__pyx_t_8 = NULL;
5111 int __pyx_lineno = 0;
5112 const char *__pyx_filename = NULL;
5113 int __pyx_clineno = 0;
5114 __Pyx_RefNannySetupContext(
"import_array", 0);
5124 __Pyx_PyThreadState_declare
5125 __Pyx_PyThreadState_assign
5126 __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
5127 __Pyx_XGOTREF(__pyx_t_1);
5128 __Pyx_XGOTREF(__pyx_t_2);
5129 __Pyx_XGOTREF(__pyx_t_3);
5139 __pyx_t_4 = _import_array();
if (unlikely(__pyx_t_4 == ((
int)-1))) __PYX_ERR(2, 943, __pyx_L3_error)
5149 __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
5150 __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
5151 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
5152 goto __pyx_L8_try_end;
5162 __pyx_t_4 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0])));
5164 __Pyx_AddTraceback(
"numpy.import_array", __pyx_clineno, __pyx_lineno, __pyx_filename);
5165 if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(2, 944, __pyx_L5_except_error)
5166 __Pyx_GOTREF(__pyx_t_5);
5167 __Pyx_GOTREF(__pyx_t_6);
5168 __Pyx_GOTREF(__pyx_t_7);
5177 __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_ImportError, __pyx_tuple__4, NULL);
if (unlikely(!__pyx_t_8)) __PYX_ERR(2, 945, __pyx_L5_except_error)
5178 __Pyx_GOTREF(__pyx_t_8);
5179 __Pyx_Raise(__pyx_t_8, 0, 0, 0);
5180 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
5181 __PYX_ERR(2, 945, __pyx_L5_except_error)
5183 goto __pyx_L5_except_error;
5184 __pyx_L5_except_error:;
5193 __Pyx_XGIVEREF(__pyx_t_1);
5194 __Pyx_XGIVEREF(__pyx_t_2);
5195 __Pyx_XGIVEREF(__pyx_t_3);
5196 __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
5197 goto __pyx_L1_error;
5213 __Pyx_XDECREF(__pyx_t_5);
5214 __Pyx_XDECREF(__pyx_t_6);
5215 __Pyx_XDECREF(__pyx_t_7);
5216 __Pyx_XDECREF(__pyx_t_8);
5217 __Pyx_AddTraceback(
"numpy.import_array", __pyx_clineno, __pyx_lineno, __pyx_filename);
5220 __Pyx_RefNannyFinishContext();
5232 static CYTHON_INLINE
int __pyx_f_5numpy_import_umath(
void) {
5234 __Pyx_RefNannyDeclarations
5235 PyObject *__pyx_t_1 = NULL;
5236 PyObject *__pyx_t_2 = NULL;
5237 PyObject *__pyx_t_3 = NULL;
5239 PyObject *__pyx_t_5 = NULL;
5240 PyObject *__pyx_t_6 = NULL;
5241 PyObject *__pyx_t_7 = NULL;
5242 PyObject *__pyx_t_8 = NULL;
5243 int __pyx_lineno = 0;
5244 const char *__pyx_filename = NULL;
5245 int __pyx_clineno = 0;
5246 __Pyx_RefNannySetupContext(
"import_umath", 0);
5256 __Pyx_PyThreadState_declare
5257 __Pyx_PyThreadState_assign
5258 __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
5259 __Pyx_XGOTREF(__pyx_t_1);
5260 __Pyx_XGOTREF(__pyx_t_2);
5261 __Pyx_XGOTREF(__pyx_t_3);
5271 __pyx_t_4 = _import_umath();
if (unlikely(__pyx_t_4 == ((
int)-1))) __PYX_ERR(2, 949, __pyx_L3_error)
5281 __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
5282 __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
5283 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
5284 goto __pyx_L8_try_end;
5294 __pyx_t_4 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0])));
5296 __Pyx_AddTraceback(
"numpy.import_umath", __pyx_clineno, __pyx_lineno, __pyx_filename);
5297 if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(2, 950, __pyx_L5_except_error)
5298 __Pyx_GOTREF(__pyx_t_5);
5299 __Pyx_GOTREF(__pyx_t_6);
5300 __Pyx_GOTREF(__pyx_t_7);
5309 __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_ImportError, __pyx_tuple__5, NULL);
if (unlikely(!__pyx_t_8)) __PYX_ERR(2, 951, __pyx_L5_except_error)
5310 __Pyx_GOTREF(__pyx_t_8);
5311 __Pyx_Raise(__pyx_t_8, 0, 0, 0);
5312 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
5313 __PYX_ERR(2, 951, __pyx_L5_except_error)
5315 goto __pyx_L5_except_error;
5316 __pyx_L5_except_error:;
5325 __Pyx_XGIVEREF(__pyx_t_1);
5326 __Pyx_XGIVEREF(__pyx_t_2);
5327 __Pyx_XGIVEREF(__pyx_t_3);
5328 __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
5329 goto __pyx_L1_error;
5345 __Pyx_XDECREF(__pyx_t_5);
5346 __Pyx_XDECREF(__pyx_t_6);
5347 __Pyx_XDECREF(__pyx_t_7);
5348 __Pyx_XDECREF(__pyx_t_8);
5349 __Pyx_AddTraceback(
"numpy.import_umath", __pyx_clineno, __pyx_lineno, __pyx_filename);
5352 __Pyx_RefNannyFinishContext();
5364 static CYTHON_INLINE
int __pyx_f_5numpy_import_ufunc(
void) {
5366 __Pyx_RefNannyDeclarations
5367 PyObject *__pyx_t_1 = NULL;
5368 PyObject *__pyx_t_2 = NULL;
5369 PyObject *__pyx_t_3 = NULL;
5371 PyObject *__pyx_t_5 = NULL;
5372 PyObject *__pyx_t_6 = NULL;
5373 PyObject *__pyx_t_7 = NULL;
5374 PyObject *__pyx_t_8 = NULL;
5375 int __pyx_lineno = 0;
5376 const char *__pyx_filename = NULL;
5377 int __pyx_clineno = 0;
5378 __Pyx_RefNannySetupContext(
"import_ufunc", 0);
5388 __Pyx_PyThreadState_declare
5389 __Pyx_PyThreadState_assign
5390 __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
5391 __Pyx_XGOTREF(__pyx_t_1);
5392 __Pyx_XGOTREF(__pyx_t_2);
5393 __Pyx_XGOTREF(__pyx_t_3);
5403 __pyx_t_4 = _import_umath();
if (unlikely(__pyx_t_4 == ((
int)-1))) __PYX_ERR(2, 955, __pyx_L3_error)
5413 __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
5414 __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
5415 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
5416 goto __pyx_L8_try_end;
5426 __pyx_t_4 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0])));
5428 __Pyx_AddTraceback(
"numpy.import_ufunc", __pyx_clineno, __pyx_lineno, __pyx_filename);
5429 if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(2, 956, __pyx_L5_except_error)
5430 __Pyx_GOTREF(__pyx_t_5);
5431 __Pyx_GOTREF(__pyx_t_6);
5432 __Pyx_GOTREF(__pyx_t_7);
5441 __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_ImportError, __pyx_tuple__5, NULL);
if (unlikely(!__pyx_t_8)) __PYX_ERR(2, 957, __pyx_L5_except_error)
5442 __Pyx_GOTREF(__pyx_t_8);
5443 __Pyx_Raise(__pyx_t_8, 0, 0, 0);
5444 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
5445 __PYX_ERR(2, 957, __pyx_L5_except_error)
5447 goto __pyx_L5_except_error;
5448 __pyx_L5_except_error:;
5457 __Pyx_XGIVEREF(__pyx_t_1);
5458 __Pyx_XGIVEREF(__pyx_t_2);
5459 __Pyx_XGIVEREF(__pyx_t_3);
5460 __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
5461 goto __pyx_L1_error;
5477 __Pyx_XDECREF(__pyx_t_5);
5478 __Pyx_XDECREF(__pyx_t_6);
5479 __Pyx_XDECREF(__pyx_t_7);
5480 __Pyx_XDECREF(__pyx_t_8);
5481 __Pyx_AddTraceback(
"numpy.import_ufunc", __pyx_clineno, __pyx_lineno, __pyx_filename);
5484 __Pyx_RefNannyFinishContext();
5496 static CYTHON_INLINE
int __pyx_f_5numpy_is_timedelta64_object(PyObject *__pyx_v_obj) {
5498 __Pyx_RefNannyDeclarations
5499 __Pyx_RefNannySetupContext(
"is_timedelta64_object", 0);
5508 __pyx_r = PyObject_TypeCheck(__pyx_v_obj, (&PyTimedeltaArrType_Type));
5521 __Pyx_RefNannyFinishContext();
5533 static CYTHON_INLINE
int __pyx_f_5numpy_is_datetime64_object(PyObject *__pyx_v_obj) {
5535 __Pyx_RefNannyDeclarations
5536 __Pyx_RefNannySetupContext(
"is_datetime64_object", 0);
5545 __pyx_r = PyObject_TypeCheck(__pyx_v_obj, (&PyDatetimeArrType_Type));
5558 __Pyx_RefNannyFinishContext();
5570 static CYTHON_INLINE npy_datetime __pyx_f_5numpy_get_datetime64_value(PyObject *__pyx_v_obj) {
5571 npy_datetime __pyx_r;
5580 __pyx_r = ((PyDatetimeScalarObject *)__pyx_v_obj)->obval;
5604 static CYTHON_INLINE npy_timedelta __pyx_f_5numpy_get_timedelta64_value(PyObject *__pyx_v_obj) {
5605 npy_timedelta __pyx_r;
5614 __pyx_r = ((PyTimedeltaScalarObject *)__pyx_v_obj)->obval;
5638 static CYTHON_INLINE NPY_DATETIMEUNIT __pyx_f_5numpy_get_datetime64_unit(PyObject *__pyx_v_obj) {
5639 NPY_DATETIMEUNIT __pyx_r;
5646 __pyx_r = ((NPY_DATETIMEUNIT)((PyDatetimeScalarObject *)__pyx_v_obj)->obmeta.base);
5671 static int __pyx_array___cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
5672 static int __pyx_array___cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
5673 PyObject *__pyx_v_shape = 0;
5674 Py_ssize_t __pyx_v_itemsize;
5675 PyObject *__pyx_v_format = 0;
5676 PyObject *__pyx_v_mode = 0;
5677 int __pyx_v_allocate_buffer;
5678 int __pyx_lineno = 0;
5679 const char *__pyx_filename = NULL;
5680 int __pyx_clineno = 0;
5682 __Pyx_RefNannyDeclarations
5683 __Pyx_RefNannySetupContext(
"__cinit__ (wrapper)", 0);
5685 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};
5686 PyObject* values[5] = {0,0,0,0,0};
5687 values[3] = ((PyObject *)__pyx_n_s_c);
5688 if (unlikely(__pyx_kwds)) {
5690 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
5692 case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
5694 case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
5696 case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
5698 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
5700 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
5703 default:
goto __pyx_L5_argtuple_error;
5705 kw_args = PyDict_Size(__pyx_kwds);
5708 if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_shape)) != 0)) kw_args--;
5709 else goto __pyx_L5_argtuple_error;
5712 if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_itemsize)) != 0)) kw_args--;
5714 __Pyx_RaiseArgtupleInvalid(
"__cinit__", 0, 3, 5, 1); __PYX_ERR(0, 122, __pyx_L3_error)
5718 if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_format)) != 0)) kw_args--;
5720 __Pyx_RaiseArgtupleInvalid(
"__cinit__", 0, 3, 5, 2); __PYX_ERR(0, 122, __pyx_L3_error)
5725 PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_mode);
5726 if (value) { values[3] = value; kw_args--; }
5731 PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_allocate_buffer);
5732 if (value) { values[4] = value; kw_args--; }
5735 if (unlikely(kw_args > 0)) {
5736 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args,
"__cinit__") < 0)) __PYX_ERR(0, 122, __pyx_L3_error)
5739 switch (PyTuple_GET_SIZE(__pyx_args)) {
5740 case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
5742 case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
5744 case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
5745 values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
5746 values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
5748 default:
goto __pyx_L5_argtuple_error;
5751 __pyx_v_shape = ((PyObject*)values[0]);
5752 __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)
5753 __pyx_v_format = values[2];
5754 __pyx_v_mode = values[3];
5756 __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)
5766 __pyx_v_allocate_buffer = ((int)1);
5769 goto __pyx_L4_argument_unpacking_done;
5770 __pyx_L5_argtuple_error:;
5771 __Pyx_RaiseArgtupleInvalid(
"__cinit__", 0, 3, 5, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 122, __pyx_L3_error)
5773 __Pyx_AddTraceback(
"View.MemoryView.array.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
5774 __Pyx_RefNannyFinishContext();
5776 __pyx_L4_argument_unpacking_done:;
5777 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_shape), (&PyTuple_Type), 1,
"shape", 1))) __PYX_ERR(0, 122, __pyx_L1_error)
5778 if (unlikely(((PyObject *)__pyx_v_format) == Py_None)) {
5779 PyErr_Format(PyExc_TypeError,
"Argument '%.200s' must not be None",
"format"); __PYX_ERR(0, 122, __pyx_L1_error)
5781 __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);
5796 __Pyx_RefNannyFinishContext();
5800 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) {
5802 Py_ssize_t __pyx_v_i;
5803 Py_ssize_t __pyx_v_dim;
5804 PyObject **__pyx_v_p;
5807 __Pyx_RefNannyDeclarations
5808 Py_ssize_t __pyx_t_1;
5810 PyObject *__pyx_t_3 = NULL;
5812 PyObject *__pyx_t_5 = NULL;
5813 PyObject *__pyx_t_6 = NULL;
5816 Py_ssize_t __pyx_t_9;
5817 PyObject *__pyx_t_10 = NULL;
5818 Py_ssize_t __pyx_t_11;
5819 int __pyx_lineno = 0;
5820 const char *__pyx_filename = NULL;
5821 int __pyx_clineno = 0;
5822 __Pyx_RefNannySetupContext(
"__cinit__", 0);
5823 __Pyx_INCREF(__pyx_v_format);
5832 if (unlikely(__pyx_v_shape == Py_None)) {
5833 PyErr_SetString(PyExc_TypeError,
"object of type 'NoneType' has no len()");
5834 __PYX_ERR(0, 129, __pyx_L1_error)
5836 __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)
5837 __pyx_v_self->ndim = ((int)__pyx_t_1);
5846 __pyx_v_self->itemsize = __pyx_v_itemsize;
5855 __pyx_t_2 = ((!(__pyx_v_self->ndim != 0)) != 0);
5856 if (unlikely(__pyx_t_2)) {
5865 __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__6, NULL);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 133, __pyx_L1_error)
5866 __Pyx_GOTREF(__pyx_t_3);
5867 __Pyx_Raise(__pyx_t_3, 0, 0, 0);
5868 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
5869 __PYX_ERR(0, 133, __pyx_L1_error)
5887 __pyx_t_2 = ((__pyx_v_itemsize <= 0) != 0);
5888 if (unlikely(__pyx_t_2)) {
5897 __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__7, NULL);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 136, __pyx_L1_error)
5898 __Pyx_GOTREF(__pyx_t_3);
5899 __Pyx_Raise(__pyx_t_3, 0, 0, 0);
5900 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
5901 __PYX_ERR(0, 136, __pyx_L1_error)
5919 __pyx_t_2 = PyBytes_Check(__pyx_v_format);
5920 __pyx_t_4 = ((!(__pyx_t_2 != 0)) != 0);
5930 __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)
5931 __Pyx_GOTREF(__pyx_t_5);
5933 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) {
5934 __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5);
5935 if (likely(__pyx_t_6)) {
5936 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_5);
5937 __Pyx_INCREF(__pyx_t_6);
5938 __Pyx_INCREF(
function);
5939 __Pyx_DECREF_SET(__pyx_t_5,
function);
5942 __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);
5943 __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
5944 if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 139, __pyx_L1_error)
5945 __Pyx_GOTREF(__pyx_t_3);
5946 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
5947 __Pyx_DECREF_SET(__pyx_v_format, __pyx_t_3);
5966 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)
5967 __pyx_t_3 = __pyx_v_format;
5968 __Pyx_INCREF(__pyx_t_3);
5969 __Pyx_GIVEREF(__pyx_t_3);
5970 __Pyx_GOTREF(__pyx_v_self->_format);
5971 __Pyx_DECREF(__pyx_v_self->_format);
5972 __pyx_v_self->_format = ((PyObject*)__pyx_t_3);
5982 if (unlikely(__pyx_v_self->_format == Py_None)) {
5983 PyErr_SetString(PyExc_TypeError,
"expected bytes, NoneType found");
5984 __PYX_ERR(0, 141, __pyx_L1_error)
5986 __pyx_t_7 = __Pyx_PyBytes_AsWritableString(__pyx_v_self->_format);
if (unlikely((!__pyx_t_7) && PyErr_Occurred())) __PYX_ERR(0, 141, __pyx_L1_error)
5987 __pyx_v_self->format = __pyx_t_7;
5996 __pyx_v_self->_shape = ((Py_ssize_t *)PyObject_Malloc((((
sizeof(Py_ssize_t)) * __pyx_v_self->ndim) * 2)));
6005 __pyx_v_self->_strides = (__pyx_v_self->_shape + __pyx_v_self->ndim);
6014 __pyx_t_4 = ((!(__pyx_v_self->_shape != 0)) != 0);
6015 if (unlikely(__pyx_t_4)) {
6024 __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_MemoryError, __pyx_tuple__8, NULL);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 148, __pyx_L1_error)
6025 __Pyx_GOTREF(__pyx_t_3);
6026 __Pyx_Raise(__pyx_t_3, 0, 0, 0);
6027 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
6028 __PYX_ERR(0, 148, __pyx_L1_error)
6047 __pyx_t_3 = __pyx_v_shape; __Pyx_INCREF(__pyx_t_3); __pyx_t_1 = 0;
6049 if (__pyx_t_1 >= PyTuple_GET_SIZE(__pyx_t_3))
break;
6050 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
6051 __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)
6053 __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)
6054 __Pyx_GOTREF(__pyx_t_5);
6056 __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)
6057 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
6058 __pyx_v_dim = __pyx_t_9;
6059 __pyx_v_idx = __pyx_t_8;
6060 __pyx_t_8 = (__pyx_t_8 + 1);
6069 __pyx_t_4 = ((__pyx_v_dim <= 0) != 0);
6070 if (unlikely(__pyx_t_4)) {
6079 __pyx_t_5 = __Pyx_PyInt_From_int(__pyx_v_idx);
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 153, __pyx_L1_error)
6080 __Pyx_GOTREF(__pyx_t_5);
6081 __pyx_t_6 = PyInt_FromSsize_t(__pyx_v_dim);
if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 153, __pyx_L1_error)
6082 __Pyx_GOTREF(__pyx_t_6);
6083 __pyx_t_10 = PyTuple_New(2);
if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 153, __pyx_L1_error)
6084 __Pyx_GOTREF(__pyx_t_10);
6085 __Pyx_GIVEREF(__pyx_t_5);
6086 PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_5);
6087 __Pyx_GIVEREF(__pyx_t_6);
6088 PyTuple_SET_ITEM(__pyx_t_10, 1, __pyx_t_6);
6091 __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)
6092 __Pyx_GOTREF(__pyx_t_6);
6093 __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
6094 __pyx_t_10 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_6);
if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 153, __pyx_L1_error)
6095 __Pyx_GOTREF(__pyx_t_10);
6096 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
6097 __Pyx_Raise(__pyx_t_10, 0, 0, 0);
6098 __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
6099 __PYX_ERR(0, 153, __pyx_L1_error)
6117 (__pyx_v_self->_shape[__pyx_v_idx]) = __pyx_v_dim;
6127 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
6136 __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)
6146 __pyx_v_order =
'F';
6155 __Pyx_INCREF(__pyx_n_u_fortran);
6156 __Pyx_GIVEREF(__pyx_n_u_fortran);
6157 __Pyx_GOTREF(__pyx_v_self->mode);
6158 __Pyx_DECREF(__pyx_v_self->mode);
6159 __pyx_v_self->mode = __pyx_n_u_fortran;
6178 __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)
6179 if (likely(__pyx_t_4)) {
6188 __pyx_v_order =
'C';
6197 __Pyx_INCREF(__pyx_n_u_c);
6198 __Pyx_GIVEREF(__pyx_n_u_c);
6199 __Pyx_GOTREF(__pyx_v_self->mode);
6200 __Pyx_DECREF(__pyx_v_self->mode);
6201 __pyx_v_self->mode = __pyx_n_u_c;
6221 __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)
6222 __Pyx_GOTREF(__pyx_t_3);
6223 __pyx_t_10 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_3);
if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 164, __pyx_L1_error)
6224 __Pyx_GOTREF(__pyx_t_10);
6225 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
6226 __Pyx_Raise(__pyx_t_10, 0, 0, 0);
6227 __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
6228 __PYX_ERR(0, 164, __pyx_L1_error)
6239 __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);
6248 __pyx_v_self->free_data = __pyx_v_allocate_buffer;
6257 __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)
6258 __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)
6259 __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
6260 __pyx_v_self->dtype_is_object = __pyx_t_4;
6269 __pyx_t_4 = (__pyx_v_allocate_buffer != 0);
6279 __pyx_v_self->data = ((
char *)malloc(__pyx_v_self->len));
6288 __pyx_t_4 = ((!(__pyx_v_self->data != 0)) != 0);
6289 if (unlikely(__pyx_t_4)) {
6298 __pyx_t_10 = __Pyx_PyObject_Call(__pyx_builtin_MemoryError, __pyx_tuple__9, NULL);
if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 176, __pyx_L1_error)
6299 __Pyx_GOTREF(__pyx_t_10);
6300 __Pyx_Raise(__pyx_t_10, 0, 0, 0);
6301 __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
6302 __PYX_ERR(0, 176, __pyx_L1_error)
6320 __pyx_t_4 = (__pyx_v_self->dtype_is_object != 0);
6330 __pyx_v_p = ((PyObject **)__pyx_v_self->data);
6339 if (unlikely(__pyx_v_itemsize == 0)) {
6340 PyErr_SetString(PyExc_ZeroDivisionError,
"integer division or modulo by zero");
6341 __PYX_ERR(0, 180, __pyx_L1_error)
6343 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))) {
6344 PyErr_SetString(PyExc_OverflowError,
"value too large to perform division");
6345 __PYX_ERR(0, 180, __pyx_L1_error)
6347 __pyx_t_1 = __Pyx_div_Py_ssize_t(__pyx_v_self->len, __pyx_v_itemsize);
6348 __pyx_t_9 = __pyx_t_1;
6349 for (__pyx_t_11 = 0; __pyx_t_11 < __pyx_t_9; __pyx_t_11+=1) {
6350 __pyx_v_i = __pyx_t_11;
6359 (__pyx_v_p[__pyx_v_i]) = Py_None;
6401 __Pyx_XDECREF(__pyx_t_3);
6402 __Pyx_XDECREF(__pyx_t_5);
6403 __Pyx_XDECREF(__pyx_t_6);
6404 __Pyx_XDECREF(__pyx_t_10);
6405 __Pyx_AddTraceback(
"View.MemoryView.array.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
6408 __Pyx_XDECREF(__pyx_v_format);
6409 __Pyx_RefNannyFinishContext();
6422 static CYTHON_UNUSED
int __pyx_array_getbuffer(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info,
int __pyx_v_flags);
6423 static CYTHON_UNUSED
int __pyx_array_getbuffer(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info,
int __pyx_v_flags) {
6425 __Pyx_RefNannyDeclarations
6426 __Pyx_RefNannySetupContext(
"__getbuffer__ (wrapper)", 0);
6427 __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));
6430 __Pyx_RefNannyFinishContext();
6434 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) {
6435 int __pyx_v_bufmode;
6437 __Pyx_RefNannyDeclarations
6440 PyObject *__pyx_t_3 = NULL;
6442 Py_ssize_t __pyx_t_5;
6444 Py_ssize_t *__pyx_t_7;
6445 int __pyx_lineno = 0;
6446 const char *__pyx_filename = NULL;
6447 int __pyx_clineno = 0;
6448 if (__pyx_v_info == NULL) {
6449 PyErr_SetString(PyExc_BufferError,
"PyObject_GetBuffer: view==NULL argument is obsolete");
6452 __Pyx_RefNannySetupContext(
"__getbuffer__", 0);
6453 __pyx_v_info->obj = Py_None; __Pyx_INCREF(Py_None);
6454 __Pyx_GIVEREF(__pyx_v_info->obj);
6463 __pyx_v_bufmode = -1;
6472 __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)
6473 __pyx_t_2 = (__pyx_t_1 != 0);
6483 __pyx_v_bufmode = (PyBUF_C_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS);
6502 __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)
6503 __pyx_t_1 = (__pyx_t_2 != 0);
6513 __pyx_v_bufmode = (PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS);
6532 __pyx_t_1 = ((!((__pyx_v_flags & __pyx_v_bufmode) != 0)) != 0);
6533 if (unlikely(__pyx_t_1)) {
6542 __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__10, NULL);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 192, __pyx_L1_error)
6543 __Pyx_GOTREF(__pyx_t_3);
6544 __Pyx_Raise(__pyx_t_3, 0, 0, 0);
6545 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
6546 __PYX_ERR(0, 192, __pyx_L1_error)
6564 __pyx_t_4 = __pyx_v_self->data;
6565 __pyx_v_info->buf = __pyx_t_4;
6574 __pyx_t_5 = __pyx_v_self->len;
6575 __pyx_v_info->len = __pyx_t_5;
6584 __pyx_t_6 = __pyx_v_self->ndim;
6585 __pyx_v_info->ndim = __pyx_t_6;
6594 __pyx_t_7 = __pyx_v_self->_shape;
6595 __pyx_v_info->shape = __pyx_t_7;
6604 __pyx_t_7 = __pyx_v_self->_strides;
6605 __pyx_v_info->strides = __pyx_t_7;
6614 __pyx_v_info->suboffsets = NULL;
6623 __pyx_t_5 = __pyx_v_self->itemsize;
6624 __pyx_v_info->itemsize = __pyx_t_5;
6633 __pyx_v_info->readonly = 0;
6642 __pyx_t_1 = ((__pyx_v_flags & PyBUF_FORMAT) != 0);
6652 __pyx_t_4 = __pyx_v_self->format;
6653 __pyx_v_info->format = __pyx_t_4;
6673 __pyx_v_info->format = NULL;
6684 __Pyx_INCREF(((PyObject *)__pyx_v_self));
6685 __Pyx_GIVEREF(((PyObject *)__pyx_v_self));
6686 __Pyx_GOTREF(__pyx_v_info->obj);
6687 __Pyx_DECREF(__pyx_v_info->obj);
6688 __pyx_v_info->obj = ((PyObject *)__pyx_v_self);
6702 __Pyx_XDECREF(__pyx_t_3);
6703 __Pyx_AddTraceback(
"View.MemoryView.array.__getbuffer__", __pyx_clineno, __pyx_lineno, __pyx_filename);
6705 if (__pyx_v_info->obj != NULL) {
6706 __Pyx_GOTREF(__pyx_v_info->obj);
6707 __Pyx_DECREF(__pyx_v_info->obj); __pyx_v_info->obj = 0;
6711 if (__pyx_v_info->obj == Py_None) {
6712 __Pyx_GOTREF(__pyx_v_info->obj);
6713 __Pyx_DECREF(__pyx_v_info->obj); __pyx_v_info->obj = 0;
6716 __Pyx_RefNannyFinishContext();
6729 static void __pyx_array___dealloc__(PyObject *__pyx_v_self);
6730 static void __pyx_array___dealloc__(PyObject *__pyx_v_self) {
6731 __Pyx_RefNannyDeclarations
6732 __Pyx_RefNannySetupContext(
"__dealloc__ (wrapper)", 0);
6733 __pyx_array___pyx_pf_15View_dot_MemoryView_5array_4__dealloc__(((
struct __pyx_array_obj *)__pyx_v_self));
6736 __Pyx_RefNannyFinishContext();
6739 static void __pyx_array___pyx_pf_15View_dot_MemoryView_5array_4__dealloc__(
struct __pyx_array_obj *__pyx_v_self) {
6740 __Pyx_RefNannyDeclarations
6742 __Pyx_RefNannySetupContext(
"__dealloc__", 0);
6751 __pyx_t_1 = ((__pyx_v_self->callback_free_data != NULL) != 0);
6761 __pyx_v_self->callback_free_data(__pyx_v_self->data);
6780 __pyx_t_1 = (__pyx_v_self->free_data != 0);
6790 __pyx_t_1 = (__pyx_v_self->dtype_is_object != 0);
6800 __pyx_memoryview_refcount_objects_in_slice(__pyx_v_self->data, __pyx_v_self->_shape, __pyx_v_self->_strides, __pyx_v_self->ndim, 0);
6818 free(__pyx_v_self->data);
6837 PyObject_Free(__pyx_v_self->_shape);
6848 __Pyx_RefNannyFinishContext();
6860 static PyObject *__pyx_pw_15View_dot_MemoryView_5array_7memview_1__get__(PyObject *__pyx_v_self);
6861 static PyObject *__pyx_pw_15View_dot_MemoryView_5array_7memview_1__get__(PyObject *__pyx_v_self) {
6862 PyObject *__pyx_r = 0;
6863 __Pyx_RefNannyDeclarations
6864 __Pyx_RefNannySetupContext(
"__get__ (wrapper)", 0);
6865 __pyx_r = __pyx_pf_15View_dot_MemoryView_5array_7memview___get__(((
struct __pyx_array_obj *)__pyx_v_self));
6868 __Pyx_RefNannyFinishContext();
6872 static PyObject *__pyx_pf_15View_dot_MemoryView_5array_7memview___get__(
struct __pyx_array_obj *__pyx_v_self) {
6873 PyObject *__pyx_r = NULL;
6874 __Pyx_RefNannyDeclarations
6875 PyObject *__pyx_t_1 = NULL;
6876 int __pyx_lineno = 0;
6877 const char *__pyx_filename = NULL;
6878 int __pyx_clineno = 0;
6879 __Pyx_RefNannySetupContext(
"__get__", 0);
6888 __Pyx_XDECREF(__pyx_r);
6889 __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)
6890 __Pyx_GOTREF(__pyx_t_1);
6891 __pyx_r = __pyx_t_1;
6905 __Pyx_XDECREF(__pyx_t_1);
6906 __Pyx_AddTraceback(
"View.MemoryView.array.memview.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
6909 __Pyx_XGIVEREF(__pyx_r);
6910 __Pyx_RefNannyFinishContext();
6922 static PyObject *__pyx_array_get_memview(
struct __pyx_array_obj *__pyx_v_self) {
6924 PyObject *__pyx_r = NULL;
6925 __Pyx_RefNannyDeclarations
6926 PyObject *__pyx_t_1 = NULL;
6927 PyObject *__pyx_t_2 = NULL;
6928 PyObject *__pyx_t_3 = NULL;
6929 int __pyx_lineno = 0;
6930 const char *__pyx_filename = NULL;
6931 int __pyx_clineno = 0;
6932 __Pyx_RefNannySetupContext(
"get_memview", 0);
6941 __pyx_v_flags = ((PyBUF_ANY_CONTIGUOUS | PyBUF_FORMAT) | PyBUF_WRITABLE);
6950 __Pyx_XDECREF(__pyx_r);
6951 __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_flags);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 228, __pyx_L1_error)
6952 __Pyx_GOTREF(__pyx_t_1);
6953 __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_v_self->dtype_is_object);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 228, __pyx_L1_error)
6954 __Pyx_GOTREF(__pyx_t_2);
6955 __pyx_t_3 = PyTuple_New(3);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 228, __pyx_L1_error)
6956 __Pyx_GOTREF(__pyx_t_3);
6957 __Pyx_INCREF(((PyObject *)__pyx_v_self));
6958 __Pyx_GIVEREF(((PyObject *)__pyx_v_self));
6959 PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_v_self));
6960 __Pyx_GIVEREF(__pyx_t_1);
6961 PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_1);
6962 __Pyx_GIVEREF(__pyx_t_2);
6963 PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_t_2);
6966 __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)
6967 __Pyx_GOTREF(__pyx_t_2);
6968 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
6969 __pyx_r = __pyx_t_2;
6983 __Pyx_XDECREF(__pyx_t_1);
6984 __Pyx_XDECREF(__pyx_t_2);
6985 __Pyx_XDECREF(__pyx_t_3);
6986 __Pyx_AddTraceback(
"View.MemoryView.array.get_memview", __pyx_clineno, __pyx_lineno, __pyx_filename);
6989 __Pyx_XGIVEREF(__pyx_r);
6990 __Pyx_RefNannyFinishContext();
7003 static Py_ssize_t __pyx_array___len__(PyObject *__pyx_v_self);
7004 static Py_ssize_t __pyx_array___len__(PyObject *__pyx_v_self) {
7006 __Pyx_RefNannyDeclarations
7007 __Pyx_RefNannySetupContext(
"__len__ (wrapper)", 0);
7008 __pyx_r = __pyx_array___pyx_pf_15View_dot_MemoryView_5array_6__len__(((
struct __pyx_array_obj *)__pyx_v_self));
7011 __Pyx_RefNannyFinishContext();
7015 static Py_ssize_t __pyx_array___pyx_pf_15View_dot_MemoryView_5array_6__len__(
struct __pyx_array_obj *__pyx_v_self) {
7017 __Pyx_RefNannyDeclarations
7018 __Pyx_RefNannySetupContext(
"__len__", 0);
7027 __pyx_r = (__pyx_v_self->_shape[0]);
7040 __Pyx_RefNannyFinishContext();
7053 static PyObject *__pyx_array___getattr__(PyObject *__pyx_v_self, PyObject *__pyx_v_attr);
7054 static PyObject *__pyx_array___getattr__(PyObject *__pyx_v_self, PyObject *__pyx_v_attr) {
7055 PyObject *__pyx_r = 0;
7056 __Pyx_RefNannyDeclarations
7057 __Pyx_RefNannySetupContext(
"__getattr__ (wrapper)", 0);
7058 __pyx_r = __pyx_array___pyx_pf_15View_dot_MemoryView_5array_8__getattr__(((
struct __pyx_array_obj *)__pyx_v_self), ((PyObject *)__pyx_v_attr));
7061 __Pyx_RefNannyFinishContext();
7065 static PyObject *__pyx_array___pyx_pf_15View_dot_MemoryView_5array_8__getattr__(
struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_attr) {
7066 PyObject *__pyx_r = NULL;
7067 __Pyx_RefNannyDeclarations
7068 PyObject *__pyx_t_1 = NULL;
7069 PyObject *__pyx_t_2 = NULL;
7070 int __pyx_lineno = 0;
7071 const char *__pyx_filename = NULL;
7072 int __pyx_clineno = 0;
7073 __Pyx_RefNannySetupContext(
"__getattr__", 0);
7082 __Pyx_XDECREF(__pyx_r);
7083 __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)
7084 __Pyx_GOTREF(__pyx_t_1);
7085 __pyx_t_2 = __Pyx_GetAttr(__pyx_t_1, __pyx_v_attr);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 234, __pyx_L1_error)
7086 __Pyx_GOTREF(__pyx_t_2);
7087 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
7088 __pyx_r = __pyx_t_2;
7102 __Pyx_XDECREF(__pyx_t_1);
7103 __Pyx_XDECREF(__pyx_t_2);
7104 __Pyx_AddTraceback(
"View.MemoryView.array.__getattr__", __pyx_clineno, __pyx_lineno, __pyx_filename);
7107 __Pyx_XGIVEREF(__pyx_r);
7108 __Pyx_RefNannyFinishContext();
7121 static PyObject *__pyx_array___getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_item);
7122 static PyObject *__pyx_array___getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_item) {
7123 PyObject *__pyx_r = 0;
7124 __Pyx_RefNannyDeclarations
7125 __Pyx_RefNannySetupContext(
"__getitem__ (wrapper)", 0);
7126 __pyx_r = __pyx_array___pyx_pf_15View_dot_MemoryView_5array_10__getitem__(((
struct __pyx_array_obj *)__pyx_v_self), ((PyObject *)__pyx_v_item));
7129 __Pyx_RefNannyFinishContext();
7133 static PyObject *__pyx_array___pyx_pf_15View_dot_MemoryView_5array_10__getitem__(
struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_item) {
7134 PyObject *__pyx_r = NULL;
7135 __Pyx_RefNannyDeclarations
7136 PyObject *__pyx_t_1 = NULL;
7137 PyObject *__pyx_t_2 = NULL;
7138 int __pyx_lineno = 0;
7139 const char *__pyx_filename = NULL;
7140 int __pyx_clineno = 0;
7141 __Pyx_RefNannySetupContext(
"__getitem__", 0);
7150 __Pyx_XDECREF(__pyx_r);
7151 __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)
7152 __Pyx_GOTREF(__pyx_t_1);
7153 __pyx_t_2 = __Pyx_PyObject_GetItem(__pyx_t_1, __pyx_v_item);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 237, __pyx_L1_error)
7154 __Pyx_GOTREF(__pyx_t_2);
7155 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
7156 __pyx_r = __pyx_t_2;
7170 __Pyx_XDECREF(__pyx_t_1);
7171 __Pyx_XDECREF(__pyx_t_2);
7172 __Pyx_AddTraceback(
"View.MemoryView.array.__getitem__", __pyx_clineno, __pyx_lineno, __pyx_filename);
7175 __Pyx_XGIVEREF(__pyx_r);
7176 __Pyx_RefNannyFinishContext();
7189 static int __pyx_array___setitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_item, PyObject *__pyx_v_value);
7190 static int __pyx_array___setitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_item, PyObject *__pyx_v_value) {
7192 __Pyx_RefNannyDeclarations
7193 __Pyx_RefNannySetupContext(
"__setitem__ (wrapper)", 0);
7194 __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));
7197 __Pyx_RefNannyFinishContext();
7201 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) {
7203 __Pyx_RefNannyDeclarations
7204 PyObject *__pyx_t_1 = NULL;
7205 int __pyx_lineno = 0;
7206 const char *__pyx_filename = NULL;
7207 int __pyx_clineno = 0;
7208 __Pyx_RefNannySetupContext(
"__setitem__", 0);
7217 __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)
7218 __Pyx_GOTREF(__pyx_t_1);
7219 if (unlikely(PyObject_SetItem(__pyx_t_1, __pyx_v_item, __pyx_v_value) < 0)) __PYX_ERR(0, 240, __pyx_L1_error)
7220 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
7234 __Pyx_XDECREF(__pyx_t_1);
7235 __Pyx_AddTraceback(
"View.MemoryView.array.__setitem__", __pyx_clineno, __pyx_lineno, __pyx_filename);
7238 __Pyx_RefNannyFinishContext();
7249 static PyObject *__pyx_pw___pyx_array_1__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused);
7250 static PyObject *__pyx_pw___pyx_array_1__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
7251 PyObject *__pyx_r = 0;
7252 __Pyx_RefNannyDeclarations
7253 __Pyx_RefNannySetupContext(
"__reduce_cython__ (wrapper)", 0);
7254 __pyx_r = __pyx_pf___pyx_array___reduce_cython__(((
struct __pyx_array_obj *)__pyx_v_self));
7257 __Pyx_RefNannyFinishContext();
7261 static PyObject *__pyx_pf___pyx_array___reduce_cython__(CYTHON_UNUSED
struct __pyx_array_obj *__pyx_v_self) {
7262 PyObject *__pyx_r = NULL;
7263 __Pyx_RefNannyDeclarations
7264 PyObject *__pyx_t_1 = NULL;
7265 int __pyx_lineno = 0;
7266 const char *__pyx_filename = NULL;
7267 int __pyx_clineno = 0;
7268 __Pyx_RefNannySetupContext(
"__reduce_cython__", 0);
7276 __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__11, NULL);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2, __pyx_L1_error)
7277 __Pyx_GOTREF(__pyx_t_1);
7278 __Pyx_Raise(__pyx_t_1, 0, 0, 0);
7279 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
7280 __PYX_ERR(0, 2, __pyx_L1_error)
7290 __Pyx_XDECREF(__pyx_t_1);
7291 __Pyx_AddTraceback(
"View.MemoryView.array.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
7293 __Pyx_XGIVEREF(__pyx_r);
7294 __Pyx_RefNannyFinishContext();
7306 static PyObject *__pyx_pw___pyx_array_3__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state);
7307 static PyObject *__pyx_pw___pyx_array_3__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
7308 PyObject *__pyx_r = 0;
7309 __Pyx_RefNannyDeclarations
7310 __Pyx_RefNannySetupContext(
"__setstate_cython__ (wrapper)", 0);
7311 __pyx_r = __pyx_pf___pyx_array_2__setstate_cython__(((
struct __pyx_array_obj *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state));
7314 __Pyx_RefNannyFinishContext();
7318 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) {
7319 PyObject *__pyx_r = NULL;
7320 __Pyx_RefNannyDeclarations
7321 PyObject *__pyx_t_1 = NULL;
7322 int __pyx_lineno = 0;
7323 const char *__pyx_filename = NULL;
7324 int __pyx_clineno = 0;
7325 __Pyx_RefNannySetupContext(
"__setstate_cython__", 0);
7332 __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__12, NULL);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4, __pyx_L1_error)
7333 __Pyx_GOTREF(__pyx_t_1);
7334 __Pyx_Raise(__pyx_t_1, 0, 0, 0);
7335 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
7336 __PYX_ERR(0, 4, __pyx_L1_error)
7347 __Pyx_XDECREF(__pyx_t_1);
7348 __Pyx_AddTraceback(
"View.MemoryView.array.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
7350 __Pyx_XGIVEREF(__pyx_r);
7351 __Pyx_RefNannyFinishContext();
7363 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) {
7364 struct __pyx_array_obj *__pyx_v_result = 0;
7365 struct __pyx_array_obj *__pyx_r = NULL;
7366 __Pyx_RefNannyDeclarations
7368 PyObject *__pyx_t_2 = NULL;
7369 PyObject *__pyx_t_3 = NULL;
7370 PyObject *__pyx_t_4 = NULL;
7371 PyObject *__pyx_t_5 = NULL;
7372 int __pyx_lineno = 0;
7373 const char *__pyx_filename = NULL;
7374 int __pyx_clineno = 0;
7375 __Pyx_RefNannySetupContext(
"array_cwrapper", 0);
7384 __pyx_t_1 = ((__pyx_v_buf == NULL) != 0);
7394 __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_itemsize);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 249, __pyx_L1_error)
7395 __Pyx_GOTREF(__pyx_t_2);
7396 __pyx_t_3 = __Pyx_PyBytes_FromString(__pyx_v_format);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 249, __pyx_L1_error)
7397 __Pyx_GOTREF(__pyx_t_3);
7398 __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)
7399 __Pyx_GOTREF(__pyx_t_4);
7400 __pyx_t_5 = PyTuple_New(4);
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 249, __pyx_L1_error)
7401 __Pyx_GOTREF(__pyx_t_5);
7402 __Pyx_INCREF(__pyx_v_shape);
7403 __Pyx_GIVEREF(__pyx_v_shape);
7404 PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_v_shape);
7405 __Pyx_GIVEREF(__pyx_t_2);
7406 PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_2);
7407 __Pyx_GIVEREF(__pyx_t_3);
7408 PyTuple_SET_ITEM(__pyx_t_5, 2, __pyx_t_3);
7409 __Pyx_GIVEREF(__pyx_t_4);
7410 PyTuple_SET_ITEM(__pyx_t_5, 3, __pyx_t_4);
7414 __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)
7415 __Pyx_GOTREF(__pyx_t_4);
7416 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
7417 __pyx_v_result = ((
struct __pyx_array_obj *)__pyx_t_4);
7438 __pyx_t_4 = PyInt_FromSsize_t(__pyx_v_itemsize);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 251, __pyx_L1_error)
7439 __Pyx_GOTREF(__pyx_t_4);
7440 __pyx_t_5 = __Pyx_PyBytes_FromString(__pyx_v_format);
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 251, __pyx_L1_error)
7441 __Pyx_GOTREF(__pyx_t_5);
7442 __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)
7443 __Pyx_GOTREF(__pyx_t_3);
7444 __pyx_t_2 = PyTuple_New(4);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 251, __pyx_L1_error)
7445 __Pyx_GOTREF(__pyx_t_2);
7446 __Pyx_INCREF(__pyx_v_shape);
7447 __Pyx_GIVEREF(__pyx_v_shape);
7448 PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_shape);
7449 __Pyx_GIVEREF(__pyx_t_4);
7450 PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_4);
7451 __Pyx_GIVEREF(__pyx_t_5);
7452 PyTuple_SET_ITEM(__pyx_t_2, 2, __pyx_t_5);
7453 __Pyx_GIVEREF(__pyx_t_3);
7454 PyTuple_SET_ITEM(__pyx_t_2, 3, __pyx_t_3);
7466 __pyx_t_3 = __Pyx_PyDict_NewPresized(1);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 252, __pyx_L1_error)
7467 __Pyx_GOTREF(__pyx_t_3);
7468 if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_allocate_buffer, Py_False) < 0) __PYX_ERR(0, 252, __pyx_L1_error)
7477 __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)
7478 __Pyx_GOTREF(__pyx_t_5);
7479 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
7480 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
7481 __pyx_v_result = ((
struct __pyx_array_obj *)__pyx_t_5);
7491 __pyx_v_result->data = __pyx_v_buf;
7502 __Pyx_XDECREF(((PyObject *)__pyx_r));
7503 __Pyx_INCREF(((PyObject *)__pyx_v_result));
7504 __pyx_r = __pyx_v_result;
7517 __Pyx_XDECREF(__pyx_t_2);
7518 __Pyx_XDECREF(__pyx_t_3);
7519 __Pyx_XDECREF(__pyx_t_4);
7520 __Pyx_XDECREF(__pyx_t_5);
7521 __Pyx_AddTraceback(
"View.MemoryView.array_cwrapper", __pyx_clineno, __pyx_lineno, __pyx_filename);
7524 __Pyx_XDECREF((PyObject *)__pyx_v_result);
7525 __Pyx_XGIVEREF((PyObject *)__pyx_r);
7526 __Pyx_RefNannyFinishContext();
7539 static int __pyx_MemviewEnum___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
7540 static int __pyx_MemviewEnum___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
7541 PyObject *__pyx_v_name = 0;
7542 int __pyx_lineno = 0;
7543 const char *__pyx_filename = NULL;
7544 int __pyx_clineno = 0;
7546 __Pyx_RefNannyDeclarations
7547 __Pyx_RefNannySetupContext(
"__init__ (wrapper)", 0);
7549 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_name,0};
7550 PyObject* values[1] = {0};
7551 if (unlikely(__pyx_kwds)) {
7553 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
7555 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
7558 default:
goto __pyx_L5_argtuple_error;
7560 kw_args = PyDict_Size(__pyx_kwds);
7563 if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_name)) != 0)) kw_args--;
7564 else goto __pyx_L5_argtuple_error;
7566 if (unlikely(kw_args > 0)) {
7567 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args,
"__init__") < 0)) __PYX_ERR(0, 281, __pyx_L3_error)
7569 }
else if (PyTuple_GET_SIZE(__pyx_args) != 1) {
7570 goto __pyx_L5_argtuple_error;
7572 values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
7574 __pyx_v_name = values[0];
7576 goto __pyx_L4_argument_unpacking_done;
7577 __pyx_L5_argtuple_error:;
7578 __Pyx_RaiseArgtupleInvalid(
"__init__", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 281, __pyx_L3_error)
7580 __Pyx_AddTraceback(
"View.MemoryView.Enum.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
7581 __Pyx_RefNannyFinishContext();
7583 __pyx_L4_argument_unpacking_done:;
7584 __pyx_r = __pyx_MemviewEnum___pyx_pf_15View_dot_MemoryView_4Enum___init__(((
struct __pyx_MemviewEnum_obj *)__pyx_v_self), __pyx_v_name);
7587 __Pyx_RefNannyFinishContext();
7591 static int __pyx_MemviewEnum___pyx_pf_15View_dot_MemoryView_4Enum___init__(
struct __pyx_MemviewEnum_obj *__pyx_v_self, PyObject *__pyx_v_name) {
7593 __Pyx_RefNannyDeclarations
7594 __Pyx_RefNannySetupContext(
"__init__", 0);
7603 __Pyx_INCREF(__pyx_v_name);
7604 __Pyx_GIVEREF(__pyx_v_name);
7605 __Pyx_GOTREF(__pyx_v_self->name);
7606 __Pyx_DECREF(__pyx_v_self->name);
7607 __pyx_v_self->name = __pyx_v_name;
7619 __Pyx_RefNannyFinishContext();
7632 static PyObject *__pyx_MemviewEnum___repr__(PyObject *__pyx_v_self);
7633 static PyObject *__pyx_MemviewEnum___repr__(PyObject *__pyx_v_self) {
7634 PyObject *__pyx_r = 0;
7635 __Pyx_RefNannyDeclarations
7636 __Pyx_RefNannySetupContext(
"__repr__ (wrapper)", 0);
7637 __pyx_r = __pyx_MemviewEnum___pyx_pf_15View_dot_MemoryView_4Enum_2__repr__(((
struct __pyx_MemviewEnum_obj *)__pyx_v_self));
7640 __Pyx_RefNannyFinishContext();
7644 static PyObject *__pyx_MemviewEnum___pyx_pf_15View_dot_MemoryView_4Enum_2__repr__(
struct __pyx_MemviewEnum_obj *__pyx_v_self) {
7645 PyObject *__pyx_r = NULL;
7646 __Pyx_RefNannyDeclarations
7647 __Pyx_RefNannySetupContext(
"__repr__", 0);
7656 __Pyx_XDECREF(__pyx_r);
7657 __Pyx_INCREF(__pyx_v_self->name);
7658 __pyx_r = __pyx_v_self->name;
7671 __Pyx_XGIVEREF(__pyx_r);
7672 __Pyx_RefNannyFinishContext();
7683 static PyObject *__pyx_pw___pyx_MemviewEnum_1__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused);
7684 static PyObject *__pyx_pw___pyx_MemviewEnum_1__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
7685 PyObject *__pyx_r = 0;
7686 __Pyx_RefNannyDeclarations
7687 __Pyx_RefNannySetupContext(
"__reduce_cython__ (wrapper)", 0);
7688 __pyx_r = __pyx_pf___pyx_MemviewEnum___reduce_cython__(((
struct __pyx_MemviewEnum_obj *)__pyx_v_self));
7691 __Pyx_RefNannyFinishContext();
7695 static PyObject *__pyx_pf___pyx_MemviewEnum___reduce_cython__(
struct __pyx_MemviewEnum_obj *__pyx_v_self) {
7696 PyObject *__pyx_v_state = 0;
7697 PyObject *__pyx_v__dict = 0;
7698 int __pyx_v_use_setstate;
7699 PyObject *__pyx_r = NULL;
7700 __Pyx_RefNannyDeclarations
7701 PyObject *__pyx_t_1 = NULL;
7704 PyObject *__pyx_t_4 = NULL;
7705 PyObject *__pyx_t_5 = NULL;
7706 int __pyx_lineno = 0;
7707 const char *__pyx_filename = NULL;
7708 int __pyx_clineno = 0;
7709 __Pyx_RefNannySetupContext(
"__reduce_cython__", 0);
7718 __pyx_t_1 = PyTuple_New(1);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 5, __pyx_L1_error)
7719 __Pyx_GOTREF(__pyx_t_1);
7720 __Pyx_INCREF(__pyx_v_self->name);
7721 __Pyx_GIVEREF(__pyx_v_self->name);
7722 PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_self->name);
7723 __pyx_v_state = ((PyObject*)__pyx_t_1);
7733 __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)
7734 __Pyx_GOTREF(__pyx_t_1);
7735 __pyx_v__dict = __pyx_t_1;
7745 __pyx_t_2 = (__pyx_v__dict != Py_None);
7746 __pyx_t_3 = (__pyx_t_2 != 0);
7756 __pyx_t_1 = PyTuple_New(1);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 8, __pyx_L1_error)
7757 __Pyx_GOTREF(__pyx_t_1);
7758 __Pyx_INCREF(__pyx_v__dict);
7759 __Pyx_GIVEREF(__pyx_v__dict);
7760 PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v__dict);
7761 __pyx_t_4 = PyNumber_InPlaceAdd(__pyx_v_state, __pyx_t_1);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 8, __pyx_L1_error)
7762 __Pyx_GOTREF(__pyx_t_4);
7763 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
7764 __Pyx_DECREF_SET(__pyx_v_state, ((PyObject*)__pyx_t_4));
7774 __pyx_v_use_setstate = 1;
7794 __pyx_t_3 = (__pyx_v_self->name != Py_None);
7795 __pyx_v_use_setstate = __pyx_t_3;
7806 __pyx_t_3 = (__pyx_v_use_setstate != 0);
7816 __Pyx_XDECREF(__pyx_r);
7817 __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_pyx_unpickle_Enum);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 13, __pyx_L1_error)
7818 __Pyx_GOTREF(__pyx_t_4);
7819 __pyx_t_1 = PyTuple_New(3);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 13, __pyx_L1_error)
7820 __Pyx_GOTREF(__pyx_t_1);
7821 __Pyx_INCREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
7822 __Pyx_GIVEREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
7823 PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
7824 __Pyx_INCREF(__pyx_int_184977713);
7825 __Pyx_GIVEREF(__pyx_int_184977713);
7826 PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_int_184977713);
7827 __Pyx_INCREF(Py_None);
7828 __Pyx_GIVEREF(Py_None);
7829 PyTuple_SET_ITEM(__pyx_t_1, 2, Py_None);
7830 __pyx_t_5 = PyTuple_New(3);
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 13, __pyx_L1_error)
7831 __Pyx_GOTREF(__pyx_t_5);
7832 __Pyx_GIVEREF(__pyx_t_4);
7833 PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4);
7834 __Pyx_GIVEREF(__pyx_t_1);
7835 PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_1);
7836 __Pyx_INCREF(__pyx_v_state);
7837 __Pyx_GIVEREF(__pyx_v_state);
7838 PyTuple_SET_ITEM(__pyx_t_5, 2, __pyx_v_state);
7841 __pyx_r = __pyx_t_5;
7862 __Pyx_XDECREF(__pyx_r);
7863 __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_pyx_unpickle_Enum);
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 15, __pyx_L1_error)
7864 __Pyx_GOTREF(__pyx_t_5);
7865 __pyx_t_1 = PyTuple_New(3);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 15, __pyx_L1_error)
7866 __Pyx_GOTREF(__pyx_t_1);
7867 __Pyx_INCREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
7868 __Pyx_GIVEREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
7869 PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
7870 __Pyx_INCREF(__pyx_int_184977713);
7871 __Pyx_GIVEREF(__pyx_int_184977713);
7872 PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_int_184977713);
7873 __Pyx_INCREF(__pyx_v_state);
7874 __Pyx_GIVEREF(__pyx_v_state);
7875 PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_v_state);
7876 __pyx_t_4 = PyTuple_New(2);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 15, __pyx_L1_error)
7877 __Pyx_GOTREF(__pyx_t_4);
7878 __Pyx_GIVEREF(__pyx_t_5);
7879 PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_5);
7880 __Pyx_GIVEREF(__pyx_t_1);
7881 PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_1);
7884 __pyx_r = __pyx_t_4;
7897 __Pyx_XDECREF(__pyx_t_1);
7898 __Pyx_XDECREF(__pyx_t_4);
7899 __Pyx_XDECREF(__pyx_t_5);
7900 __Pyx_AddTraceback(
"View.MemoryView.Enum.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
7903 __Pyx_XDECREF(__pyx_v_state);
7904 __Pyx_XDECREF(__pyx_v__dict);
7905 __Pyx_XGIVEREF(__pyx_r);
7906 __Pyx_RefNannyFinishContext();
7918 static PyObject *__pyx_pw___pyx_MemviewEnum_3__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state);
7919 static PyObject *__pyx_pw___pyx_MemviewEnum_3__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
7920 PyObject *__pyx_r = 0;
7921 __Pyx_RefNannyDeclarations
7922 __Pyx_RefNannySetupContext(
"__setstate_cython__ (wrapper)", 0);
7923 __pyx_r = __pyx_pf___pyx_MemviewEnum_2__setstate_cython__(((
struct __pyx_MemviewEnum_obj *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state));
7926 __Pyx_RefNannyFinishContext();
7930 static PyObject *__pyx_pf___pyx_MemviewEnum_2__setstate_cython__(
struct __pyx_MemviewEnum_obj *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
7931 PyObject *__pyx_r = NULL;
7932 __Pyx_RefNannyDeclarations
7933 PyObject *__pyx_t_1 = NULL;
7934 int __pyx_lineno = 0;
7935 const char *__pyx_filename = NULL;
7936 int __pyx_clineno = 0;
7937 __Pyx_RefNannySetupContext(
"__setstate_cython__", 0);
7944 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)
7945 __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)
7946 __Pyx_GOTREF(__pyx_t_1);
7947 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
7957 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
7960 __Pyx_XDECREF(__pyx_t_1);
7961 __Pyx_AddTraceback(
"View.MemoryView.Enum.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
7964 __Pyx_XGIVEREF(__pyx_r);
7965 __Pyx_RefNannyFinishContext();
7977 static void *__pyx_align_pointer(
void *__pyx_v_memory,
size_t __pyx_v_alignment) {
7978 Py_intptr_t __pyx_v_aligned_p;
7979 size_t __pyx_v_offset;
7990 __pyx_v_aligned_p = ((Py_intptr_t)__pyx_v_memory);
7999 __pyx_v_offset = (__pyx_v_aligned_p % __pyx_v_alignment);
8008 __pyx_t_1 = ((__pyx_v_offset > 0) != 0);
8018 __pyx_v_aligned_p = (__pyx_v_aligned_p + (__pyx_v_alignment - __pyx_v_offset));
8036 __pyx_r = ((
void *)__pyx_v_aligned_p);
8061 static int __pyx_memoryview___cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
8062 static int __pyx_memoryview___cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
8063 PyObject *__pyx_v_obj = 0;
8065 int __pyx_v_dtype_is_object;
8066 int __pyx_lineno = 0;
8067 const char *__pyx_filename = NULL;
8068 int __pyx_clineno = 0;
8070 __Pyx_RefNannyDeclarations
8071 __Pyx_RefNannySetupContext(
"__cinit__ (wrapper)", 0);
8073 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_obj,&__pyx_n_s_flags,&__pyx_n_s_dtype_is_object,0};
8074 PyObject* values[3] = {0,0,0};
8075 if (unlikely(__pyx_kwds)) {
8077 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
8079 case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
8081 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
8083 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
8086 default:
goto __pyx_L5_argtuple_error;
8088 kw_args = PyDict_Size(__pyx_kwds);
8091 if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_obj)) != 0)) kw_args--;
8092 else goto __pyx_L5_argtuple_error;
8095 if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_flags)) != 0)) kw_args--;
8097 __Pyx_RaiseArgtupleInvalid(
"__cinit__", 0, 2, 3, 1); __PYX_ERR(0, 345, __pyx_L3_error)
8102 PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_dtype_is_object);
8103 if (value) { values[2] = value; kw_args--; }
8106 if (unlikely(kw_args > 0)) {
8107 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args,
"__cinit__") < 0)) __PYX_ERR(0, 345, __pyx_L3_error)
8110 switch (PyTuple_GET_SIZE(__pyx_args)) {
8111 case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
8113 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
8114 values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
8116 default:
goto __pyx_L5_argtuple_error;
8119 __pyx_v_obj = values[0];
8120 __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)
8122 __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)
8124 __pyx_v_dtype_is_object = ((int)0);
8127 goto __pyx_L4_argument_unpacking_done;
8128 __pyx_L5_argtuple_error:;
8129 __Pyx_RaiseArgtupleInvalid(
"__cinit__", 0, 2, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 345, __pyx_L3_error)
8131 __Pyx_AddTraceback(
"View.MemoryView.memoryview.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
8132 __Pyx_RefNannyFinishContext();
8134 __pyx_L4_argument_unpacking_done:;
8135 __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);
8138 __Pyx_RefNannyFinishContext();
8142 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) {
8144 __Pyx_RefNannyDeclarations
8149 int __pyx_lineno = 0;
8150 const char *__pyx_filename = NULL;
8151 int __pyx_clineno = 0;
8152 __Pyx_RefNannySetupContext(
"__cinit__", 0);
8161 __Pyx_INCREF(__pyx_v_obj);
8162 __Pyx_GIVEREF(__pyx_v_obj);
8163 __Pyx_GOTREF(__pyx_v_self->obj);
8164 __Pyx_DECREF(__pyx_v_self->obj);
8165 __pyx_v_self->obj = __pyx_v_obj;
8174 __pyx_v_self->flags = __pyx_v_flags;
8183 __pyx_t_2 = (((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))) == ((PyObject *)__pyx_memoryview_type));
8184 __pyx_t_3 = (__pyx_t_2 != 0);
8187 __pyx_t_1 = __pyx_t_3;
8188 goto __pyx_L4_bool_binop_done;
8190 __pyx_t_3 = (__pyx_v_obj != Py_None);
8191 __pyx_t_2 = (__pyx_t_3 != 0);
8192 __pyx_t_1 = __pyx_t_2;
8193 __pyx_L4_bool_binop_done:;
8203 __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)
8212 __pyx_t_1 = ((((PyObject *)__pyx_v_self->view.obj) == NULL) != 0);
8222 ((Py_buffer *)(&__pyx_v_self->view))->obj = Py_None;
8258 __pyx_t_1 = ((__pyx_memoryview_thread_locks_used < 8) != 0);
8268 __pyx_v_self->lock = (__pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used]);
8277 __pyx_memoryview_thread_locks_used = (__pyx_memoryview_thread_locks_used + 1);
8295 __pyx_t_1 = ((__pyx_v_self->lock == NULL) != 0);
8305 __pyx_v_self->lock = PyThread_allocate_lock();
8314 __pyx_t_1 = ((__pyx_v_self->lock == NULL) != 0);
8315 if (unlikely(__pyx_t_1)) {
8324 PyErr_NoMemory(); __PYX_ERR(0, 361, __pyx_L1_error)
8351 __pyx_t_1 = ((__pyx_v_flags & PyBUF_FORMAT) != 0);
8361 __pyx_t_2 = (((__pyx_v_self->view.format[0]) ==
'O') != 0);
8364 __pyx_t_1 = __pyx_t_2;
8365 goto __pyx_L11_bool_binop_done;
8367 __pyx_t_2 = (((__pyx_v_self->view.format[1]) ==
'\x00') != 0);
8368 __pyx_t_1 = __pyx_t_2;
8369 __pyx_L11_bool_binop_done:;
8370 __pyx_v_self->dtype_is_object = __pyx_t_1;
8390 __pyx_v_self->dtype_is_object = __pyx_v_dtype_is_object;
8401 __pyx_v_self->acquisition_count_aligned_p = ((__pyx_atomic_int *)__pyx_align_pointer(((
void *)(&(__pyx_v_self->acquisition_count[0]))), (
sizeof(__pyx_atomic_int))));
8410 __pyx_v_self->typeinfo = NULL;
8424 __Pyx_AddTraceback(
"View.MemoryView.memoryview.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
8427 __Pyx_RefNannyFinishContext();
8440 static void __pyx_memoryview___dealloc__(PyObject *__pyx_v_self);
8441 static void __pyx_memoryview___dealloc__(PyObject *__pyx_v_self) {
8442 __Pyx_RefNannyDeclarations
8443 __Pyx_RefNannySetupContext(
"__dealloc__ (wrapper)", 0);
8444 __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_2__dealloc__(((
struct __pyx_memoryview_obj *)__pyx_v_self));
8447 __Pyx_RefNannyFinishContext();
8450 static void __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_2__dealloc__(
struct __pyx_memoryview_obj *__pyx_v_self) {
8452 __Pyx_RefNannyDeclarations
8458 PyThread_type_lock __pyx_t_6;
8459 PyThread_type_lock __pyx_t_7;
8460 __Pyx_RefNannySetupContext(
"__dealloc__", 0);
8469 __pyx_t_1 = (__pyx_v_self->obj != Py_None);
8470 __pyx_t_2 = (__pyx_t_1 != 0);
8480 __Pyx_ReleaseBuffer((&__pyx_v_self->view));
8499 __pyx_t_2 = ((((Py_buffer *)(&__pyx_v_self->view))->obj == Py_None) != 0);
8509 ((Py_buffer *)(&__pyx_v_self->view))->obj = NULL;
8537 __pyx_t_2 = ((__pyx_v_self->lock != NULL) != 0);
8547 __pyx_t_3 = __pyx_memoryview_thread_locks_used;
8548 __pyx_t_4 = __pyx_t_3;
8549 for (__pyx_t_5 = 0; __pyx_t_5 < __pyx_t_4; __pyx_t_5+=1) {
8550 __pyx_v_i = __pyx_t_5;
8559 __pyx_t_2 = (((__pyx_memoryview_thread_locks[__pyx_v_i]) == __pyx_v_self->lock) != 0);
8569 __pyx_memoryview_thread_locks_used = (__pyx_memoryview_thread_locks_used - 1);
8578 __pyx_t_2 = ((__pyx_v_i != __pyx_memoryview_thread_locks_used) != 0);
8588 __pyx_t_6 = (__pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used]);
8589 __pyx_t_7 = (__pyx_memoryview_thread_locks[__pyx_v_i]);
8598 (__pyx_memoryview_thread_locks[__pyx_v_i]) = __pyx_t_6;
8599 (__pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used]) = __pyx_t_7;
8617 goto __pyx_L6_break;
8637 PyThread_free_lock(__pyx_v_self->lock);
8659 __Pyx_RefNannyFinishContext();
8670 static char *__pyx_memoryview_get_item_pointer(
struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index) {
8671 Py_ssize_t __pyx_v_dim;
8672 char *__pyx_v_itemp;
8673 PyObject *__pyx_v_idx = NULL;
8675 __Pyx_RefNannyDeclarations
8676 Py_ssize_t __pyx_t_1;
8677 PyObject *__pyx_t_2 = NULL;
8678 Py_ssize_t __pyx_t_3;
8679 PyObject *(*__pyx_t_4)(PyObject *);
8680 PyObject *__pyx_t_5 = NULL;
8681 Py_ssize_t __pyx_t_6;
8683 int __pyx_lineno = 0;
8684 const char *__pyx_filename = NULL;
8685 int __pyx_clineno = 0;
8686 __Pyx_RefNannySetupContext(
"get_item_pointer", 0);
8695 __pyx_v_itemp = ((
char *)__pyx_v_self->view.buf);
8705 if (likely(PyList_CheckExact(__pyx_v_index)) || PyTuple_CheckExact(__pyx_v_index)) {
8706 __pyx_t_2 = __pyx_v_index; __Pyx_INCREF(__pyx_t_2); __pyx_t_3 = 0;
8709 __pyx_t_3 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_v_index);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 397, __pyx_L1_error)
8710 __Pyx_GOTREF(__pyx_t_2);
8711 __pyx_t_4 = Py_TYPE(__pyx_t_2)->tp_iternext;
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 397, __pyx_L1_error)
8714 if (likely(!__pyx_t_4)) {
8715 if (likely(PyList_CheckExact(__pyx_t_2))) {
8716 if (__pyx_t_3 >= PyList_GET_SIZE(__pyx_t_2))
break;
8717 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
8718 __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)
8720 __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)
8721 __Pyx_GOTREF(__pyx_t_5);
8724 if (__pyx_t_3 >= PyTuple_GET_SIZE(__pyx_t_2))
break;
8725 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
8726 __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)
8728 __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)
8729 __Pyx_GOTREF(__pyx_t_5);
8733 __pyx_t_5 = __pyx_t_4(__pyx_t_2);
8734 if (unlikely(!__pyx_t_5)) {
8735 PyObject* exc_type = PyErr_Occurred();
8737 if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
8738 else __PYX_ERR(0, 397, __pyx_L1_error)
8742 __Pyx_GOTREF(__pyx_t_5);
8744 __Pyx_XDECREF_SET(__pyx_v_idx, __pyx_t_5);
8746 __pyx_v_dim = __pyx_t_1;
8747 __pyx_t_1 = (__pyx_t_1 + 1);
8756 __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)
8757 __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)
8758 __pyx_v_itemp = __pyx_t_7;
8768 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
8777 __pyx_r = __pyx_v_itemp;
8790 __Pyx_XDECREF(__pyx_t_2);
8791 __Pyx_XDECREF(__pyx_t_5);
8792 __Pyx_AddTraceback(
"View.MemoryView.memoryview.get_item_pointer", __pyx_clineno, __pyx_lineno, __pyx_filename);
8795 __Pyx_XDECREF(__pyx_v_idx);
8796 __Pyx_RefNannyFinishContext();
8809 static PyObject *__pyx_memoryview___getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_index);
8810 static PyObject *__pyx_memoryview___getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_index) {
8811 PyObject *__pyx_r = 0;
8812 __Pyx_RefNannyDeclarations
8813 __Pyx_RefNannySetupContext(
"__getitem__ (wrapper)", 0);
8814 __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_4__getitem__(((
struct __pyx_memoryview_obj *)__pyx_v_self), ((PyObject *)__pyx_v_index));
8817 __Pyx_RefNannyFinishContext();
8821 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_4__getitem__(
struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index) {
8822 PyObject *__pyx_v_have_slices = NULL;
8823 PyObject *__pyx_v_indices = NULL;
8824 char *__pyx_v_itemp;
8825 PyObject *__pyx_r = NULL;
8826 __Pyx_RefNannyDeclarations
8829 PyObject *__pyx_t_3 = NULL;
8830 PyObject *__pyx_t_4 = NULL;
8831 PyObject *__pyx_t_5 = NULL;
8833 int __pyx_lineno = 0;
8834 const char *__pyx_filename = NULL;
8835 int __pyx_clineno = 0;
8836 __Pyx_RefNannySetupContext(
"__getitem__", 0);
8845 __pyx_t_1 = (__pyx_v_index == __pyx_builtin_Ellipsis);
8846 __pyx_t_2 = (__pyx_t_1 != 0);
8856 __Pyx_XDECREF(__pyx_r);
8857 __Pyx_INCREF(((PyObject *)__pyx_v_self));
8858 __pyx_r = ((PyObject *)__pyx_v_self);
8877 __pyx_t_3 = _unellipsify(__pyx_v_index, __pyx_v_self->view.ndim);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 407, __pyx_L1_error)
8878 __Pyx_GOTREF(__pyx_t_3);
8879 if (likely(__pyx_t_3 != Py_None)) {
8880 PyObject* sequence = __pyx_t_3;
8881 Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
8882 if (unlikely(size != 2)) {
8883 if (size > 2) __Pyx_RaiseTooManyValuesError(2);
8884 else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
8885 __PYX_ERR(0, 407, __pyx_L1_error)
8887 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
8888 __pyx_t_4 = PyTuple_GET_ITEM(sequence, 0);
8889 __pyx_t_5 = PyTuple_GET_ITEM(sequence, 1);
8890 __Pyx_INCREF(__pyx_t_4);
8891 __Pyx_INCREF(__pyx_t_5);
8893 __pyx_t_4 = PySequence_ITEM(sequence, 0);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 407, __pyx_L1_error)
8894 __Pyx_GOTREF(__pyx_t_4);
8895 __pyx_t_5 = PySequence_ITEM(sequence, 1);
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 407, __pyx_L1_error)
8896 __Pyx_GOTREF(__pyx_t_5);
8898 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
8900 __Pyx_RaiseNoneNotIterableError(); __PYX_ERR(0, 407, __pyx_L1_error)
8902 __pyx_v_have_slices = __pyx_t_4;
8904 __pyx_v_indices = __pyx_t_5;
8914 __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_have_slices);
if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 410, __pyx_L1_error)
8924 __Pyx_XDECREF(__pyx_r);
8925 __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)
8926 __Pyx_GOTREF(__pyx_t_3);
8927 __pyx_r = __pyx_t_3;
8948 __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)
8949 __pyx_v_itemp = __pyx_t_6;
8958 __Pyx_XDECREF(__pyx_r);
8959 __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)
8960 __Pyx_GOTREF(__pyx_t_3);
8961 __pyx_r = __pyx_t_3;
8976 __Pyx_XDECREF(__pyx_t_3);
8977 __Pyx_XDECREF(__pyx_t_4);
8978 __Pyx_XDECREF(__pyx_t_5);
8979 __Pyx_AddTraceback(
"View.MemoryView.memoryview.__getitem__", __pyx_clineno, __pyx_lineno, __pyx_filename);
8982 __Pyx_XDECREF(__pyx_v_have_slices);
8983 __Pyx_XDECREF(__pyx_v_indices);
8984 __Pyx_XGIVEREF(__pyx_r);
8985 __Pyx_RefNannyFinishContext();
8998 static int __pyx_memoryview___setitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_index, PyObject *__pyx_v_value);
8999 static int __pyx_memoryview___setitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_index, PyObject *__pyx_v_value) {
9001 __Pyx_RefNannyDeclarations
9002 __Pyx_RefNannySetupContext(
"__setitem__ (wrapper)", 0);
9003 __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));
9006 __Pyx_RefNannyFinishContext();
9010 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) {
9011 PyObject *__pyx_v_have_slices = NULL;
9012 PyObject *__pyx_v_obj = NULL;
9014 __Pyx_RefNannyDeclarations
9016 PyObject *__pyx_t_2 = NULL;
9017 PyObject *__pyx_t_3 = NULL;
9018 PyObject *__pyx_t_4 = NULL;
9019 int __pyx_lineno = 0;
9020 const char *__pyx_filename = NULL;
9021 int __pyx_clineno = 0;
9022 __Pyx_RefNannySetupContext(
"__setitem__", 0);
9023 __Pyx_INCREF(__pyx_v_index);
9032 __pyx_t_1 = (__pyx_v_self->view.readonly != 0);
9033 if (unlikely(__pyx_t_1)) {
9042 __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__13, NULL);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 418, __pyx_L1_error)
9043 __Pyx_GOTREF(__pyx_t_2);
9044 __Pyx_Raise(__pyx_t_2, 0, 0, 0);
9045 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
9046 __PYX_ERR(0, 418, __pyx_L1_error)
9064 __pyx_t_2 = _unellipsify(__pyx_v_index, __pyx_v_self->view.ndim);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 420, __pyx_L1_error)
9065 __Pyx_GOTREF(__pyx_t_2);
9066 if (likely(__pyx_t_2 != Py_None)) {
9067 PyObject* sequence = __pyx_t_2;
9068 Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
9069 if (unlikely(size != 2)) {
9070 if (size > 2) __Pyx_RaiseTooManyValuesError(2);
9071 else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
9072 __PYX_ERR(0, 420, __pyx_L1_error)
9074 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
9075 __pyx_t_3 = PyTuple_GET_ITEM(sequence, 0);
9076 __pyx_t_4 = PyTuple_GET_ITEM(sequence, 1);
9077 __Pyx_INCREF(__pyx_t_3);
9078 __Pyx_INCREF(__pyx_t_4);
9080 __pyx_t_3 = PySequence_ITEM(sequence, 0);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 420, __pyx_L1_error)
9081 __Pyx_GOTREF(__pyx_t_3);
9082 __pyx_t_4 = PySequence_ITEM(sequence, 1);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 420, __pyx_L1_error)
9083 __Pyx_GOTREF(__pyx_t_4);
9085 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
9087 __Pyx_RaiseNoneNotIterableError(); __PYX_ERR(0, 420, __pyx_L1_error)
9089 __pyx_v_have_slices = __pyx_t_3;
9091 __Pyx_DECREF_SET(__pyx_v_index, __pyx_t_4);
9101 __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_have_slices);
if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 422, __pyx_L1_error)
9111 __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)
9112 __Pyx_GOTREF(__pyx_t_2);
9113 __pyx_v_obj = __pyx_t_2;
9123 __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_obj);
if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 424, __pyx_L1_error)
9133 __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)
9134 __Pyx_GOTREF(__pyx_t_2);
9135 __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)
9136 __Pyx_GOTREF(__pyx_t_4);
9137 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
9138 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
9158 __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)
9159 __Pyx_GOTREF(__pyx_t_4);
9160 if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_memoryview_type))))) __PYX_ERR(0, 427, __pyx_L1_error)
9161 __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)
9162 __Pyx_GOTREF(__pyx_t_2);
9163 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
9164 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
9186 __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)
9187 __Pyx_GOTREF(__pyx_t_2);
9188 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
9204 __Pyx_XDECREF(__pyx_t_2);
9205 __Pyx_XDECREF(__pyx_t_3);
9206 __Pyx_XDECREF(__pyx_t_4);
9207 __Pyx_AddTraceback(
"View.MemoryView.memoryview.__setitem__", __pyx_clineno, __pyx_lineno, __pyx_filename);
9210 __Pyx_XDECREF(__pyx_v_have_slices);
9211 __Pyx_XDECREF(__pyx_v_obj);
9212 __Pyx_XDECREF(__pyx_v_index);
9213 __Pyx_RefNannyFinishContext();
9225 static PyObject *__pyx_memoryview_is_slice(
struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_obj) {
9226 PyObject *__pyx_r = NULL;
9227 __Pyx_RefNannyDeclarations
9230 PyObject *__pyx_t_3 = NULL;
9231 PyObject *__pyx_t_4 = NULL;
9232 PyObject *__pyx_t_5 = NULL;
9233 PyObject *__pyx_t_6 = NULL;
9234 PyObject *__pyx_t_7 = NULL;
9235 PyObject *__pyx_t_8 = NULL;
9237 int __pyx_lineno = 0;
9238 const char *__pyx_filename = NULL;
9239 int __pyx_clineno = 0;
9240 __Pyx_RefNannySetupContext(
"is_slice", 0);
9241 __Pyx_INCREF(__pyx_v_obj);
9250 __pyx_t_1 = __Pyx_TypeCheck(__pyx_v_obj, __pyx_memoryview_type);
9251 __pyx_t_2 = ((!(__pyx_t_1 != 0)) != 0);
9262 __Pyx_PyThreadState_declare
9263 __Pyx_PyThreadState_assign
9264 __Pyx_ExceptionSave(&__pyx_t_3, &__pyx_t_4, &__pyx_t_5);
9265 __Pyx_XGOTREF(__pyx_t_3);
9266 __Pyx_XGOTREF(__pyx_t_4);
9267 __Pyx_XGOTREF(__pyx_t_5);
9277 __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)
9278 __Pyx_GOTREF(__pyx_t_6);
9287 __pyx_t_7 = __Pyx_PyBool_FromLong(__pyx_v_self->dtype_is_object);
if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 435, __pyx_L4_error)
9288 __Pyx_GOTREF(__pyx_t_7);
9297 __pyx_t_8 = PyTuple_New(3);
if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 434, __pyx_L4_error)
9298 __Pyx_GOTREF(__pyx_t_8);
9299 __Pyx_INCREF(__pyx_v_obj);
9300 __Pyx_GIVEREF(__pyx_v_obj);
9301 PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_v_obj);
9302 __Pyx_GIVEREF(__pyx_t_6);
9303 PyTuple_SET_ITEM(__pyx_t_8, 1, __pyx_t_6);
9304 __Pyx_GIVEREF(__pyx_t_7);
9305 PyTuple_SET_ITEM(__pyx_t_8, 2, __pyx_t_7);
9308 __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)
9309 __Pyx_GOTREF(__pyx_t_7);
9310 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
9311 __Pyx_DECREF_SET(__pyx_v_obj, __pyx_t_7);
9322 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
9323 __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
9324 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
9325 goto __pyx_L9_try_end;
9327 __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
9328 __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
9329 __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
9338 __pyx_t_9 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_TypeError);
9340 __Pyx_AddTraceback(
"View.MemoryView.memoryview.is_slice", __pyx_clineno, __pyx_lineno, __pyx_filename);
9341 if (__Pyx_GetException(&__pyx_t_7, &__pyx_t_8, &__pyx_t_6) < 0) __PYX_ERR(0, 436, __pyx_L6_except_error)
9342 __Pyx_GOTREF(__pyx_t_7);
9343 __Pyx_GOTREF(__pyx_t_8);
9344 __Pyx_GOTREF(__pyx_t_6);
9353 __Pyx_XDECREF(__pyx_r);
9354 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
9355 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
9356 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
9357 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
9358 goto __pyx_L7_except_return;
9360 goto __pyx_L6_except_error;
9361 __pyx_L6_except_error:;
9370 __Pyx_XGIVEREF(__pyx_t_3);
9371 __Pyx_XGIVEREF(__pyx_t_4);
9372 __Pyx_XGIVEREF(__pyx_t_5);
9373 __Pyx_ExceptionReset(__pyx_t_3, __pyx_t_4, __pyx_t_5);
9374 goto __pyx_L1_error;
9375 __pyx_L7_except_return:;
9376 __Pyx_XGIVEREF(__pyx_t_3);
9377 __Pyx_XGIVEREF(__pyx_t_4);
9378 __Pyx_XGIVEREF(__pyx_t_5);
9379 __Pyx_ExceptionReset(__pyx_t_3, __pyx_t_4, __pyx_t_5);
9400 __Pyx_XDECREF(__pyx_r);
9401 __Pyx_INCREF(__pyx_v_obj);
9402 __pyx_r = __pyx_v_obj;
9415 __Pyx_XDECREF(__pyx_t_6);
9416 __Pyx_XDECREF(__pyx_t_7);
9417 __Pyx_XDECREF(__pyx_t_8);
9418 __Pyx_AddTraceback(
"View.MemoryView.memoryview.is_slice", __pyx_clineno, __pyx_lineno, __pyx_filename);
9421 __Pyx_XDECREF(__pyx_v_obj);
9422 __Pyx_XGIVEREF(__pyx_r);
9423 __Pyx_RefNannyFinishContext();
9435 static PyObject *__pyx_memoryview_setitem_slice_assignment(
struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_dst, PyObject *__pyx_v_src) {
9436 __Pyx_memviewslice __pyx_v_dst_slice;
9437 __Pyx_memviewslice __pyx_v_src_slice;
9438 PyObject *__pyx_r = NULL;
9439 __Pyx_RefNannyDeclarations
9440 __Pyx_memviewslice *__pyx_t_1;
9441 __Pyx_memviewslice *__pyx_t_2;
9442 PyObject *__pyx_t_3 = NULL;
9446 int __pyx_lineno = 0;
9447 const char *__pyx_filename = NULL;
9448 int __pyx_clineno = 0;
9449 __Pyx_RefNannySetupContext(
"setitem_slice_assignment", 0);
9458 if (!(likely(((__pyx_v_src) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_src, __pyx_memoryview_type))))) __PYX_ERR(0, 445, __pyx_L1_error)
9459 __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)
9468 if (!(likely(((__pyx_v_dst) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_dst, __pyx_memoryview_type))))) __PYX_ERR(0, 446, __pyx_L1_error)
9469 __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)
9478 __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)
9479 __Pyx_GOTREF(__pyx_t_3);
9480 __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)
9481 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
9482 __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)
9483 __Pyx_GOTREF(__pyx_t_3);
9484 __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)
9485 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
9494 __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)
9505 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
9508 __Pyx_XDECREF(__pyx_t_3);
9509 __Pyx_AddTraceback(
"View.MemoryView.memoryview.setitem_slice_assignment", __pyx_clineno, __pyx_lineno, __pyx_filename);
9512 __Pyx_XGIVEREF(__pyx_r);
9513 __Pyx_RefNannyFinishContext();
9525 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) {
9526 int __pyx_v_array[0x80];
9529 __Pyx_memviewslice *__pyx_v_dst_slice;
9530 __Pyx_memviewslice __pyx_v_tmp_slice;
9531 PyObject *__pyx_r = NULL;
9532 __Pyx_RefNannyDeclarations
9533 __Pyx_memviewslice *__pyx_t_1;
9535 PyObject *__pyx_t_3 = NULL;
9538 char const *__pyx_t_6;
9539 PyObject *__pyx_t_7 = NULL;
9540 PyObject *__pyx_t_8 = NULL;
9541 PyObject *__pyx_t_9 = NULL;
9542 PyObject *__pyx_t_10 = NULL;
9543 PyObject *__pyx_t_11 = NULL;
9544 PyObject *__pyx_t_12 = NULL;
9545 int __pyx_lineno = 0;
9546 const char *__pyx_filename = NULL;
9547 int __pyx_clineno = 0;
9548 __Pyx_RefNannySetupContext(
"setitem_slice_assign_scalar", 0);
9566 __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)
9567 __pyx_v_dst_slice = __pyx_t_1;
9576 __pyx_t_2 = ((((size_t)__pyx_v_self->view.itemsize) > (
sizeof(__pyx_v_array))) != 0);
9586 __pyx_v_tmp = PyMem_Malloc(__pyx_v_self->view.itemsize);
9595 __pyx_t_2 = ((__pyx_v_tmp == NULL) != 0);
9596 if (unlikely(__pyx_t_2)) {
9605 PyErr_NoMemory(); __PYX_ERR(0, 461, __pyx_L1_error)
9623 __pyx_v_item = __pyx_v_tmp;
9643 __pyx_v_item = ((
void *)__pyx_v_array);
9663 __pyx_t_2 = (__pyx_v_self->dtype_is_object != 0);
9673 (((PyObject **)__pyx_v_item)[0]) = ((PyObject *)__pyx_v_value);
9693 __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)
9694 __Pyx_GOTREF(__pyx_t_3);
9695 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
9706 __pyx_t_2 = ((__pyx_v_self->view.suboffsets != NULL) != 0);
9716 __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)
9717 __Pyx_GOTREF(__pyx_t_3);
9718 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
9736 __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);
9748 PyMem_Free(__pyx_v_tmp);
9753 __Pyx_PyThreadState_declare
9754 __Pyx_PyThreadState_assign
9755 __pyx_t_7 = 0; __pyx_t_8 = 0; __pyx_t_9 = 0; __pyx_t_10 = 0; __pyx_t_11 = 0; __pyx_t_12 = 0;
9756 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
9757 if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_10, &__pyx_t_11, &__pyx_t_12);
9758 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);
9759 __Pyx_XGOTREF(__pyx_t_7);
9760 __Pyx_XGOTREF(__pyx_t_8);
9761 __Pyx_XGOTREF(__pyx_t_9);
9762 __Pyx_XGOTREF(__pyx_t_10);
9763 __Pyx_XGOTREF(__pyx_t_11);
9764 __Pyx_XGOTREF(__pyx_t_12);
9765 __pyx_t_4 = __pyx_lineno; __pyx_t_5 = __pyx_clineno; __pyx_t_6 = __pyx_filename;
9767 PyMem_Free(__pyx_v_tmp);
9769 if (PY_MAJOR_VERSION >= 3) {
9770 __Pyx_XGIVEREF(__pyx_t_10);
9771 __Pyx_XGIVEREF(__pyx_t_11);
9772 __Pyx_XGIVEREF(__pyx_t_12);
9773 __Pyx_ExceptionReset(__pyx_t_10, __pyx_t_11, __pyx_t_12);
9775 __Pyx_XGIVEREF(__pyx_t_7);
9776 __Pyx_XGIVEREF(__pyx_t_8);
9777 __Pyx_XGIVEREF(__pyx_t_9);
9778 __Pyx_ErrRestore(__pyx_t_7, __pyx_t_8, __pyx_t_9);
9779 __pyx_t_7 = 0; __pyx_t_8 = 0; __pyx_t_9 = 0; __pyx_t_10 = 0; __pyx_t_11 = 0; __pyx_t_12 = 0;
9780 __pyx_lineno = __pyx_t_4; __pyx_clineno = __pyx_t_5; __pyx_filename = __pyx_t_6;
9781 goto __pyx_L1_error;
9795 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
9798 __Pyx_XDECREF(__pyx_t_3);
9799 __Pyx_AddTraceback(
"View.MemoryView.memoryview.setitem_slice_assign_scalar", __pyx_clineno, __pyx_lineno, __pyx_filename);
9802 __Pyx_XGIVEREF(__pyx_r);
9803 __Pyx_RefNannyFinishContext();
9815 static PyObject *__pyx_memoryview_setitem_indexed(
struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index, PyObject *__pyx_v_value) {
9816 char *__pyx_v_itemp;
9817 PyObject *__pyx_r = NULL;
9818 __Pyx_RefNannyDeclarations
9820 PyObject *__pyx_t_2 = NULL;
9821 int __pyx_lineno = 0;
9822 const char *__pyx_filename = NULL;
9823 int __pyx_clineno = 0;
9824 __Pyx_RefNannySetupContext(
"setitem_indexed", 0);
9833 __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)
9834 __pyx_v_itemp = __pyx_t_1;
9843 __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)
9844 __Pyx_GOTREF(__pyx_t_2);
9845 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
9856 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
9859 __Pyx_XDECREF(__pyx_t_2);
9860 __Pyx_AddTraceback(
"View.MemoryView.memoryview.setitem_indexed", __pyx_clineno, __pyx_lineno, __pyx_filename);
9863 __Pyx_XGIVEREF(__pyx_r);
9864 __Pyx_RefNannyFinishContext();
9876 static PyObject *__pyx_memoryview_convert_item_to_object(
struct __pyx_memoryview_obj *__pyx_v_self,
char *__pyx_v_itemp) {
9877 PyObject *__pyx_v_struct = NULL;
9878 PyObject *__pyx_v_bytesitem = 0;
9879 PyObject *__pyx_v_result = NULL;
9880 PyObject *__pyx_r = NULL;
9881 __Pyx_RefNannyDeclarations
9882 PyObject *__pyx_t_1 = NULL;
9883 PyObject *__pyx_t_2 = NULL;
9884 PyObject *__pyx_t_3 = NULL;
9885 PyObject *__pyx_t_4 = NULL;
9886 PyObject *__pyx_t_5 = NULL;
9887 PyObject *__pyx_t_6 = NULL;
9888 PyObject *__pyx_t_7 = NULL;
9890 PyObject *__pyx_t_9 = NULL;
9893 int __pyx_lineno = 0;
9894 const char *__pyx_filename = NULL;
9895 int __pyx_clineno = 0;
9896 __Pyx_RefNannySetupContext(
"convert_item_to_object", 0);
9905 __pyx_t_1 = __Pyx_Import(__pyx_n_s_struct, 0, 0);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 488, __pyx_L1_error)
9906 __Pyx_GOTREF(__pyx_t_1);
9907 __pyx_v_struct = __pyx_t_1;
9917 __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)
9918 __Pyx_GOTREF(__pyx_t_1);
9919 __pyx_v_bytesitem = ((PyObject*)__pyx_t_1);
9930 __Pyx_PyThreadState_declare
9931 __Pyx_PyThreadState_assign
9932 __Pyx_ExceptionSave(&__pyx_t_2, &__pyx_t_3, &__pyx_t_4);
9933 __Pyx_XGOTREF(__pyx_t_2);
9934 __Pyx_XGOTREF(__pyx_t_3);
9935 __Pyx_XGOTREF(__pyx_t_4);
9945 __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)
9946 __Pyx_GOTREF(__pyx_t_5);
9947 __pyx_t_6 = __Pyx_PyBytes_FromString(__pyx_v_self->view.format);
if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 493, __pyx_L3_error)
9948 __Pyx_GOTREF(__pyx_t_6);
9951 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) {
9952 __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_5);
9953 if (likely(__pyx_t_7)) {
9954 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_5);
9955 __Pyx_INCREF(__pyx_t_7);
9956 __Pyx_INCREF(
function);
9957 __Pyx_DECREF_SET(__pyx_t_5,
function);
9961 #if CYTHON_FAST_PYCALL
9962 if (PyFunction_Check(__pyx_t_5)) {
9963 PyObject *__pyx_temp[3] = {__pyx_t_7, __pyx_t_6, __pyx_v_bytesitem};
9964 __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)
9965 __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
9966 __Pyx_GOTREF(__pyx_t_1);
9967 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
9970 #if CYTHON_FAST_PYCCALL
9971 if (__Pyx_PyFastCFunction_Check(__pyx_t_5)) {
9972 PyObject *__pyx_temp[3] = {__pyx_t_7, __pyx_t_6, __pyx_v_bytesitem};
9973 __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)
9974 __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
9975 __Pyx_GOTREF(__pyx_t_1);
9976 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
9980 __pyx_t_9 = PyTuple_New(2+__pyx_t_8);
if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 493, __pyx_L3_error)
9981 __Pyx_GOTREF(__pyx_t_9);
9983 __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_7); __pyx_t_7 = NULL;
9985 __Pyx_GIVEREF(__pyx_t_6);
9986 PyTuple_SET_ITEM(__pyx_t_9, 0+__pyx_t_8, __pyx_t_6);
9987 __Pyx_INCREF(__pyx_v_bytesitem);
9988 __Pyx_GIVEREF(__pyx_v_bytesitem);
9989 PyTuple_SET_ITEM(__pyx_t_9, 1+__pyx_t_8, __pyx_v_bytesitem);
9991 __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)
9992 __Pyx_GOTREF(__pyx_t_1);
9993 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
9995 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
9996 __pyx_v_result = __pyx_t_1;
10016 __pyx_t_10 = strlen(__pyx_v_self->view.format);
10017 __pyx_t_11 = ((__pyx_t_10 == 1) != 0);
10027 __Pyx_XDECREF(__pyx_r);
10028 __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)
10029 __Pyx_GOTREF(__pyx_t_1);
10030 __pyx_r = __pyx_t_1;
10032 goto __pyx_L6_except_return;
10050 __Pyx_XDECREF(__pyx_r);
10051 __Pyx_INCREF(__pyx_v_result);
10052 __pyx_r = __pyx_v_result;
10053 goto __pyx_L6_except_return;
10056 __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
10057 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
10058 __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
10059 __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
10060 __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
10069 __Pyx_ErrFetch(&__pyx_t_1, &__pyx_t_5, &__pyx_t_9);
10070 __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)
10071 __Pyx_GOTREF(__pyx_t_6);
10072 __pyx_t_8 = __Pyx_PyErr_GivenExceptionMatches(__pyx_t_1, __pyx_t_6);
10073 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
10074 __Pyx_ErrRestore(__pyx_t_1, __pyx_t_5, __pyx_t_9);
10075 __pyx_t_1 = 0; __pyx_t_5 = 0; __pyx_t_9 = 0;
10077 __Pyx_AddTraceback(
"View.MemoryView.memoryview.convert_item_to_object", __pyx_clineno, __pyx_lineno, __pyx_filename);
10078 if (__Pyx_GetException(&__pyx_t_9, &__pyx_t_5, &__pyx_t_1) < 0) __PYX_ERR(0, 494, __pyx_L5_except_error)
10079 __Pyx_GOTREF(__pyx_t_9);
10080 __Pyx_GOTREF(__pyx_t_5);
10081 __Pyx_GOTREF(__pyx_t_1);
10090 __pyx_t_6 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__14, NULL);
if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 495, __pyx_L5_except_error)
10091 __Pyx_GOTREF(__pyx_t_6);
10092 __Pyx_Raise(__pyx_t_6, 0, 0, 0);
10093 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
10094 __PYX_ERR(0, 495, __pyx_L5_except_error)
10096 goto __pyx_L5_except_error;
10097 __pyx_L5_except_error:;
10106 __Pyx_XGIVEREF(__pyx_t_2);
10107 __Pyx_XGIVEREF(__pyx_t_3);
10108 __Pyx_XGIVEREF(__pyx_t_4);
10109 __Pyx_ExceptionReset(__pyx_t_2, __pyx_t_3, __pyx_t_4);
10110 goto __pyx_L1_error;
10111 __pyx_L6_except_return:;
10112 __Pyx_XGIVEREF(__pyx_t_2);
10113 __Pyx_XGIVEREF(__pyx_t_3);
10114 __Pyx_XGIVEREF(__pyx_t_4);
10115 __Pyx_ExceptionReset(__pyx_t_2, __pyx_t_3, __pyx_t_4);
10129 __Pyx_XDECREF(__pyx_t_1);
10130 __Pyx_XDECREF(__pyx_t_5);
10131 __Pyx_XDECREF(__pyx_t_6);
10132 __Pyx_XDECREF(__pyx_t_7);
10133 __Pyx_XDECREF(__pyx_t_9);
10134 __Pyx_AddTraceback(
"View.MemoryView.memoryview.convert_item_to_object", __pyx_clineno, __pyx_lineno, __pyx_filename);
10137 __Pyx_XDECREF(__pyx_v_struct);
10138 __Pyx_XDECREF(__pyx_v_bytesitem);
10139 __Pyx_XDECREF(__pyx_v_result);
10140 __Pyx_XGIVEREF(__pyx_r);
10141 __Pyx_RefNannyFinishContext();
10153 static PyObject *__pyx_memoryview_assign_item_from_object(
struct __pyx_memoryview_obj *__pyx_v_self,
char *__pyx_v_itemp, PyObject *__pyx_v_value) {
10154 PyObject *__pyx_v_struct = NULL;
10156 PyObject *__pyx_v_bytesvalue = 0;
10157 Py_ssize_t __pyx_v_i;
10158 PyObject *__pyx_r = NULL;
10159 __Pyx_RefNannyDeclarations
10160 PyObject *__pyx_t_1 = NULL;
10163 PyObject *__pyx_t_4 = NULL;
10164 PyObject *__pyx_t_5 = NULL;
10165 PyObject *__pyx_t_6 = NULL;
10167 PyObject *__pyx_t_8 = NULL;
10168 Py_ssize_t __pyx_t_9;
10169 PyObject *__pyx_t_10 = NULL;
10174 int __pyx_lineno = 0;
10175 const char *__pyx_filename = NULL;
10176 int __pyx_clineno = 0;
10177 __Pyx_RefNannySetupContext(
"assign_item_from_object", 0);
10186 __pyx_t_1 = __Pyx_Import(__pyx_n_s_struct, 0, 0);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 504, __pyx_L1_error)
10187 __Pyx_GOTREF(__pyx_t_1);
10188 __pyx_v_struct = __pyx_t_1;
10198 __pyx_t_2 = PyTuple_Check(__pyx_v_value);
10199 __pyx_t_3 = (__pyx_t_2 != 0);
10209 __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)
10210 __Pyx_GOTREF(__pyx_t_1);
10211 __pyx_t_4 = __Pyx_PyBytes_FromString(__pyx_v_self->view.format);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 510, __pyx_L1_error)
10212 __Pyx_GOTREF(__pyx_t_4);
10213 __pyx_t_5 = PyTuple_New(1);
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 510, __pyx_L1_error)
10214 __Pyx_GOTREF(__pyx_t_5);
10215 __Pyx_GIVEREF(__pyx_t_4);
10216 PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4);
10218 __pyx_t_4 = __Pyx_PySequence_Tuple(__pyx_v_value);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 510, __pyx_L1_error)
10219 __Pyx_GOTREF(__pyx_t_4);
10220 __pyx_t_6 = PyNumber_Add(__pyx_t_5, __pyx_t_4);
if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 510, __pyx_L1_error)
10221 __Pyx_GOTREF(__pyx_t_6);
10222 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
10223 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
10224 __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)
10225 __Pyx_GOTREF(__pyx_t_4);
10226 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
10227 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
10228 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)
10229 __pyx_v_bytesvalue = ((PyObject*)__pyx_t_4);
10250 __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)
10251 __Pyx_GOTREF(__pyx_t_6);
10252 __pyx_t_1 = __Pyx_PyBytes_FromString(__pyx_v_self->view.format);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 512, __pyx_L1_error)
10253 __Pyx_GOTREF(__pyx_t_1);
10256 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_6))) {
10257 __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_6);
10258 if (likely(__pyx_t_5)) {
10259 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_6);
10260 __Pyx_INCREF(__pyx_t_5);
10261 __Pyx_INCREF(
function);
10262 __Pyx_DECREF_SET(__pyx_t_6,
function);
10266 #if CYTHON_FAST_PYCALL
10267 if (PyFunction_Check(__pyx_t_6)) {
10268 PyObject *__pyx_temp[3] = {__pyx_t_5, __pyx_t_1, __pyx_v_value};
10269 __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)
10270 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
10271 __Pyx_GOTREF(__pyx_t_4);
10272 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
10275 #if CYTHON_FAST_PYCCALL
10276 if (__Pyx_PyFastCFunction_Check(__pyx_t_6)) {
10277 PyObject *__pyx_temp[3] = {__pyx_t_5, __pyx_t_1, __pyx_v_value};
10278 __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)
10279 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
10280 __Pyx_GOTREF(__pyx_t_4);
10281 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
10285 __pyx_t_8 = PyTuple_New(2+__pyx_t_7);
if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 512, __pyx_L1_error)
10286 __Pyx_GOTREF(__pyx_t_8);
10288 __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_5); __pyx_t_5 = NULL;
10290 __Pyx_GIVEREF(__pyx_t_1);
10291 PyTuple_SET_ITEM(__pyx_t_8, 0+__pyx_t_7, __pyx_t_1);
10292 __Pyx_INCREF(__pyx_v_value);
10293 __Pyx_GIVEREF(__pyx_v_value);
10294 PyTuple_SET_ITEM(__pyx_t_8, 1+__pyx_t_7, __pyx_v_value);
10296 __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)
10297 __Pyx_GOTREF(__pyx_t_4);
10298 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
10300 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
10301 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)
10302 __pyx_v_bytesvalue = ((PyObject*)__pyx_t_4);
10315 if (unlikely(__pyx_v_bytesvalue == Py_None)) {
10316 PyErr_SetString(PyExc_TypeError,
"'NoneType' is not iterable");
10317 __PYX_ERR(0, 514, __pyx_L1_error)
10319 __Pyx_INCREF(__pyx_v_bytesvalue);
10320 __pyx_t_10 = __pyx_v_bytesvalue;
10321 __pyx_t_12 = PyBytes_AS_STRING(__pyx_t_10);
10322 __pyx_t_13 = (__pyx_t_12 + PyBytes_GET_SIZE(__pyx_t_10));
10323 for (__pyx_t_14 = __pyx_t_12; __pyx_t_14 < __pyx_t_13; __pyx_t_14++) {
10324 __pyx_t_11 = __pyx_t_14;
10325 __pyx_v_c = (__pyx_t_11[0]);
10334 __pyx_v_i = __pyx_t_9;
10343 __pyx_t_9 = (__pyx_t_9 + 1);
10352 (__pyx_v_itemp[__pyx_v_i]) = __pyx_v_c;
10354 __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
10365 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
10368 __Pyx_XDECREF(__pyx_t_1);
10369 __Pyx_XDECREF(__pyx_t_4);
10370 __Pyx_XDECREF(__pyx_t_5);
10371 __Pyx_XDECREF(__pyx_t_6);
10372 __Pyx_XDECREF(__pyx_t_8);
10373 __Pyx_XDECREF(__pyx_t_10);
10374 __Pyx_AddTraceback(
"View.MemoryView.memoryview.assign_item_from_object", __pyx_clineno, __pyx_lineno, __pyx_filename);
10377 __Pyx_XDECREF(__pyx_v_struct);
10378 __Pyx_XDECREF(__pyx_v_bytesvalue);
10379 __Pyx_XGIVEREF(__pyx_r);
10380 __Pyx_RefNannyFinishContext();
10393 static CYTHON_UNUSED
int __pyx_memoryview_getbuffer(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info,
int __pyx_v_flags);
10394 static CYTHON_UNUSED
int __pyx_memoryview_getbuffer(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info,
int __pyx_v_flags) {
10396 __Pyx_RefNannyDeclarations
10397 __Pyx_RefNannySetupContext(
"__getbuffer__ (wrapper)", 0);
10398 __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));
10401 __Pyx_RefNannyFinishContext();
10405 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) {
10407 __Pyx_RefNannyDeclarations
10410 PyObject *__pyx_t_3 = NULL;
10411 Py_ssize_t *__pyx_t_4;
10415 Py_ssize_t __pyx_t_8;
10416 int __pyx_lineno = 0;
10417 const char *__pyx_filename = NULL;
10418 int __pyx_clineno = 0;
10419 if (__pyx_v_info == NULL) {
10420 PyErr_SetString(PyExc_BufferError,
"PyObject_GetBuffer: view==NULL argument is obsolete");
10423 __Pyx_RefNannySetupContext(
"__getbuffer__", 0);
10424 __pyx_v_info->obj = Py_None; __Pyx_INCREF(Py_None);
10425 __Pyx_GIVEREF(__pyx_v_info->obj);
10434 __pyx_t_2 = ((__pyx_v_flags & PyBUF_WRITABLE) != 0);
10437 __pyx_t_1 = __pyx_t_2;
10438 goto __pyx_L4_bool_binop_done;
10440 __pyx_t_2 = (__pyx_v_self->view.readonly != 0);
10441 __pyx_t_1 = __pyx_t_2;
10442 __pyx_L4_bool_binop_done:;
10443 if (unlikely(__pyx_t_1)) {
10452 __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__15, NULL);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 520, __pyx_L1_error)
10453 __Pyx_GOTREF(__pyx_t_3);
10454 __Pyx_Raise(__pyx_t_3, 0, 0, 0);
10455 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
10456 __PYX_ERR(0, 520, __pyx_L1_error)
10474 __pyx_t_1 = ((__pyx_v_flags & PyBUF_ND) != 0);
10484 __pyx_t_4 = __pyx_v_self->view.shape;
10485 __pyx_v_info->shape = __pyx_t_4;
10505 __pyx_v_info->shape = NULL;
10516 __pyx_t_1 = ((__pyx_v_flags & PyBUF_STRIDES) != 0);
10526 __pyx_t_4 = __pyx_v_self->view.strides;
10527 __pyx_v_info->strides = __pyx_t_4;
10547 __pyx_v_info->strides = NULL;
10558 __pyx_t_1 = ((__pyx_v_flags & PyBUF_INDIRECT) != 0);
10568 __pyx_t_4 = __pyx_v_self->view.suboffsets;
10569 __pyx_v_info->suboffsets = __pyx_t_4;
10589 __pyx_v_info->suboffsets = NULL;
10600 __pyx_t_1 = ((__pyx_v_flags & PyBUF_FORMAT) != 0);
10610 __pyx_t_5 = __pyx_v_self->view.format;
10611 __pyx_v_info->format = __pyx_t_5;
10631 __pyx_v_info->format = NULL;
10642 __pyx_t_6 = __pyx_v_self->view.buf;
10643 __pyx_v_info->buf = __pyx_t_6;
10652 __pyx_t_7 = __pyx_v_self->view.ndim;
10653 __pyx_v_info->ndim = __pyx_t_7;
10662 __pyx_t_8 = __pyx_v_self->view.itemsize;
10663 __pyx_v_info->itemsize = __pyx_t_8;
10672 __pyx_t_8 = __pyx_v_self->view.len;
10673 __pyx_v_info->len = __pyx_t_8;
10682 __pyx_t_1 = __pyx_v_self->view.readonly;
10683 __pyx_v_info->readonly = __pyx_t_1;
10692 __Pyx_INCREF(((PyObject *)__pyx_v_self));
10693 __Pyx_GIVEREF(((PyObject *)__pyx_v_self));
10694 __Pyx_GOTREF(__pyx_v_info->obj);
10695 __Pyx_DECREF(__pyx_v_info->obj);
10696 __pyx_v_info->obj = ((PyObject *)__pyx_v_self);
10710 __Pyx_XDECREF(__pyx_t_3);
10711 __Pyx_AddTraceback(
"View.MemoryView.memoryview.__getbuffer__", __pyx_clineno, __pyx_lineno, __pyx_filename);
10713 if (__pyx_v_info->obj != NULL) {
10714 __Pyx_GOTREF(__pyx_v_info->obj);
10715 __Pyx_DECREF(__pyx_v_info->obj); __pyx_v_info->obj = 0;
10719 if (__pyx_v_info->obj == Py_None) {
10720 __Pyx_GOTREF(__pyx_v_info->obj);
10721 __Pyx_DECREF(__pyx_v_info->obj); __pyx_v_info->obj = 0;
10724 __Pyx_RefNannyFinishContext();
10737 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_1T_1__get__(PyObject *__pyx_v_self);
10738 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_1T_1__get__(PyObject *__pyx_v_self) {
10739 PyObject *__pyx_r = 0;
10740 __Pyx_RefNannyDeclarations
10741 __Pyx_RefNannySetupContext(
"__get__ (wrapper)", 0);
10742 __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_1T___get__(((
struct __pyx_memoryview_obj *)__pyx_v_self));
10745 __Pyx_RefNannyFinishContext();
10749 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_1T___get__(
struct __pyx_memoryview_obj *__pyx_v_self) {
10750 struct __pyx_memoryviewslice_obj *__pyx_v_result = 0;
10751 PyObject *__pyx_r = NULL;
10752 __Pyx_RefNannyDeclarations
10753 PyObject *__pyx_t_1 = NULL;
10755 int __pyx_lineno = 0;
10756 const char *__pyx_filename = NULL;
10757 int __pyx_clineno = 0;
10758 __Pyx_RefNannySetupContext(
"__get__", 0);
10767 __pyx_t_1 = __pyx_memoryview_copy_object(__pyx_v_self);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 554, __pyx_L1_error)
10768 __Pyx_GOTREF(__pyx_t_1);
10769 if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_memoryviewslice_type))))) __PYX_ERR(0, 554, __pyx_L1_error)
10770 __pyx_v_result = ((
struct __pyx_memoryviewslice_obj *)__pyx_t_1);
10780 __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)
10789 __Pyx_XDECREF(__pyx_r);
10790 __Pyx_INCREF(((PyObject *)__pyx_v_result));
10791 __pyx_r = ((PyObject *)__pyx_v_result);
10804 __Pyx_XDECREF(__pyx_t_1);
10805 __Pyx_AddTraceback(
"View.MemoryView.memoryview.T.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
10808 __Pyx_XDECREF((PyObject *)__pyx_v_result);
10809 __Pyx_XGIVEREF(__pyx_r);
10810 __Pyx_RefNannyFinishContext();
10823 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_4base_1__get__(PyObject *__pyx_v_self);
10824 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_4base_1__get__(PyObject *__pyx_v_self) {
10825 PyObject *__pyx_r = 0;
10826 __Pyx_RefNannyDeclarations
10827 __Pyx_RefNannySetupContext(
"__get__ (wrapper)", 0);
10828 __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_4base___get__(((
struct __pyx_memoryview_obj *)__pyx_v_self));
10831 __Pyx_RefNannyFinishContext();
10835 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_4base___get__(
struct __pyx_memoryview_obj *__pyx_v_self) {
10836 PyObject *__pyx_r = NULL;
10837 __Pyx_RefNannyDeclarations
10838 __Pyx_RefNannySetupContext(
"__get__", 0);
10847 __Pyx_XDECREF(__pyx_r);
10848 __Pyx_INCREF(__pyx_v_self->obj);
10849 __pyx_r = __pyx_v_self->obj;
10862 __Pyx_XGIVEREF(__pyx_r);
10863 __Pyx_RefNannyFinishContext();
10876 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_5shape_1__get__(PyObject *__pyx_v_self);
10877 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_5shape_1__get__(PyObject *__pyx_v_self) {
10878 PyObject *__pyx_r = 0;
10879 __Pyx_RefNannyDeclarations
10880 __Pyx_RefNannySetupContext(
"__get__ (wrapper)", 0);
10881 __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_5shape___get__(((
struct __pyx_memoryview_obj *)__pyx_v_self));
10884 __Pyx_RefNannyFinishContext();
10888 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_5shape___get__(
struct __pyx_memoryview_obj *__pyx_v_self) {
10889 Py_ssize_t __pyx_v_length;
10890 PyObject *__pyx_r = NULL;
10891 __Pyx_RefNannyDeclarations
10892 PyObject *__pyx_t_1 = NULL;
10893 Py_ssize_t *__pyx_t_2;
10894 Py_ssize_t *__pyx_t_3;
10895 Py_ssize_t *__pyx_t_4;
10896 PyObject *__pyx_t_5 = NULL;
10897 int __pyx_lineno = 0;
10898 const char *__pyx_filename = NULL;
10899 int __pyx_clineno = 0;
10900 __Pyx_RefNannySetupContext(
"__get__", 0);
10909 __Pyx_XDECREF(__pyx_r);
10910 __pyx_t_1 = PyList_New(0);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 564, __pyx_L1_error)
10911 __Pyx_GOTREF(__pyx_t_1);
10912 __pyx_t_3 = (__pyx_v_self->view.shape + __pyx_v_self->view.ndim);
10913 for (__pyx_t_4 = __pyx_v_self->view.shape; __pyx_t_4 < __pyx_t_3; __pyx_t_4++) {
10914 __pyx_t_2 = __pyx_t_4;
10915 __pyx_v_length = (__pyx_t_2[0]);
10916 __pyx_t_5 = PyInt_FromSsize_t(__pyx_v_length);
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 564, __pyx_L1_error)
10917 __Pyx_GOTREF(__pyx_t_5);
10918 if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_t_5))) __PYX_ERR(0, 564, __pyx_L1_error)
10919 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
10921 __pyx_t_5 = PyList_AsTuple(((PyObject*)__pyx_t_1));
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 564, __pyx_L1_error)
10922 __Pyx_GOTREF(__pyx_t_5);
10923 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
10924 __pyx_r = __pyx_t_5;
10938 __Pyx_XDECREF(__pyx_t_1);
10939 __Pyx_XDECREF(__pyx_t_5);
10940 __Pyx_AddTraceback(
"View.MemoryView.memoryview.shape.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
10943 __Pyx_XGIVEREF(__pyx_r);
10944 __Pyx_RefNannyFinishContext();
10957 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_7strides_1__get__(PyObject *__pyx_v_self);
10958 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_7strides_1__get__(PyObject *__pyx_v_self) {
10959 PyObject *__pyx_r = 0;
10960 __Pyx_RefNannyDeclarations
10961 __Pyx_RefNannySetupContext(
"__get__ (wrapper)", 0);
10962 __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_7strides___get__(((
struct __pyx_memoryview_obj *)__pyx_v_self));
10965 __Pyx_RefNannyFinishContext();
10969 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_7strides___get__(
struct __pyx_memoryview_obj *__pyx_v_self) {
10970 Py_ssize_t __pyx_v_stride;
10971 PyObject *__pyx_r = NULL;
10972 __Pyx_RefNannyDeclarations
10974 PyObject *__pyx_t_2 = NULL;
10975 Py_ssize_t *__pyx_t_3;
10976 Py_ssize_t *__pyx_t_4;
10977 Py_ssize_t *__pyx_t_5;
10978 PyObject *__pyx_t_6 = NULL;
10979 int __pyx_lineno = 0;
10980 const char *__pyx_filename = NULL;
10981 int __pyx_clineno = 0;
10982 __Pyx_RefNannySetupContext(
"__get__", 0);
10991 __pyx_t_1 = ((__pyx_v_self->view.strides == NULL) != 0);
10992 if (unlikely(__pyx_t_1)) {
11001 __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__16, NULL);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 570, __pyx_L1_error)
11002 __Pyx_GOTREF(__pyx_t_2);
11003 __Pyx_Raise(__pyx_t_2, 0, 0, 0);
11004 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
11005 __PYX_ERR(0, 570, __pyx_L1_error)
11023 __Pyx_XDECREF(__pyx_r);
11024 __pyx_t_2 = PyList_New(0);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 572, __pyx_L1_error)
11025 __Pyx_GOTREF(__pyx_t_2);
11026 __pyx_t_4 = (__pyx_v_self->view.strides + __pyx_v_self->view.ndim);
11027 for (__pyx_t_5 = __pyx_v_self->view.strides; __pyx_t_5 < __pyx_t_4; __pyx_t_5++) {
11028 __pyx_t_3 = __pyx_t_5;
11029 __pyx_v_stride = (__pyx_t_3[0]);
11030 __pyx_t_6 = PyInt_FromSsize_t(__pyx_v_stride);
if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 572, __pyx_L1_error)
11031 __Pyx_GOTREF(__pyx_t_6);
11032 if (unlikely(__Pyx_ListComp_Append(__pyx_t_2, (PyObject*)__pyx_t_6))) __PYX_ERR(0, 572, __pyx_L1_error)
11033 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
11035 __pyx_t_6 = PyList_AsTuple(((PyObject*)__pyx_t_2));
if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 572, __pyx_L1_error)
11036 __Pyx_GOTREF(__pyx_t_6);
11037 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
11038 __pyx_r = __pyx_t_6;
11052 __Pyx_XDECREF(__pyx_t_2);
11053 __Pyx_XDECREF(__pyx_t_6);
11054 __Pyx_AddTraceback(
"View.MemoryView.memoryview.strides.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
11057 __Pyx_XGIVEREF(__pyx_r);
11058 __Pyx_RefNannyFinishContext();
11071 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_10suboffsets_1__get__(PyObject *__pyx_v_self);
11072 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_10suboffsets_1__get__(PyObject *__pyx_v_self) {
11073 PyObject *__pyx_r = 0;
11074 __Pyx_RefNannyDeclarations
11075 __Pyx_RefNannySetupContext(
"__get__ (wrapper)", 0);
11076 __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_10suboffsets___get__(((
struct __pyx_memoryview_obj *)__pyx_v_self));
11079 __Pyx_RefNannyFinishContext();
11083 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_10suboffsets___get__(
struct __pyx_memoryview_obj *__pyx_v_self) {
11084 Py_ssize_t __pyx_v_suboffset;
11085 PyObject *__pyx_r = NULL;
11086 __Pyx_RefNannyDeclarations
11088 PyObject *__pyx_t_2 = NULL;
11089 PyObject *__pyx_t_3 = NULL;
11090 Py_ssize_t *__pyx_t_4;
11091 Py_ssize_t *__pyx_t_5;
11092 Py_ssize_t *__pyx_t_6;
11093 int __pyx_lineno = 0;
11094 const char *__pyx_filename = NULL;
11095 int __pyx_clineno = 0;
11096 __Pyx_RefNannySetupContext(
"__get__", 0);
11105 __pyx_t_1 = ((__pyx_v_self->view.suboffsets == NULL) != 0);
11115 __Pyx_XDECREF(__pyx_r);
11116 __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_self->view.ndim);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 577, __pyx_L1_error)
11117 __Pyx_GOTREF(__pyx_t_2);
11118 __pyx_t_3 = PyNumber_Multiply(__pyx_tuple__17, __pyx_t_2);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 577, __pyx_L1_error)
11119 __Pyx_GOTREF(__pyx_t_3);
11120 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
11121 __pyx_r = __pyx_t_3;
11141 __Pyx_XDECREF(__pyx_r);
11142 __pyx_t_3 = PyList_New(0);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 579, __pyx_L1_error)
11143 __Pyx_GOTREF(__pyx_t_3);
11144 __pyx_t_5 = (__pyx_v_self->view.suboffsets + __pyx_v_self->view.ndim);
11145 for (__pyx_t_6 = __pyx_v_self->view.suboffsets; __pyx_t_6 < __pyx_t_5; __pyx_t_6++) {
11146 __pyx_t_4 = __pyx_t_6;
11147 __pyx_v_suboffset = (__pyx_t_4[0]);
11148 __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_suboffset);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 579, __pyx_L1_error)
11149 __Pyx_GOTREF(__pyx_t_2);
11150 if (unlikely(__Pyx_ListComp_Append(__pyx_t_3, (PyObject*)__pyx_t_2))) __PYX_ERR(0, 579, __pyx_L1_error)
11151 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
11153 __pyx_t_2 = PyList_AsTuple(((PyObject*)__pyx_t_3));
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 579, __pyx_L1_error)
11154 __Pyx_GOTREF(__pyx_t_2);
11155 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
11156 __pyx_r = __pyx_t_2;
11170 __Pyx_XDECREF(__pyx_t_2);
11171 __Pyx_XDECREF(__pyx_t_3);
11172 __Pyx_AddTraceback(
"View.MemoryView.memoryview.suboffsets.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
11175 __Pyx_XGIVEREF(__pyx_r);
11176 __Pyx_RefNannyFinishContext();
11189 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_4ndim_1__get__(PyObject *__pyx_v_self);
11190 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_4ndim_1__get__(PyObject *__pyx_v_self) {
11191 PyObject *__pyx_r = 0;
11192 __Pyx_RefNannyDeclarations
11193 __Pyx_RefNannySetupContext(
"__get__ (wrapper)", 0);
11194 __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_4ndim___get__(((
struct __pyx_memoryview_obj *)__pyx_v_self));
11197 __Pyx_RefNannyFinishContext();
11201 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_4ndim___get__(
struct __pyx_memoryview_obj *__pyx_v_self) {
11202 PyObject *__pyx_r = NULL;
11203 __Pyx_RefNannyDeclarations
11204 PyObject *__pyx_t_1 = NULL;
11205 int __pyx_lineno = 0;
11206 const char *__pyx_filename = NULL;
11207 int __pyx_clineno = 0;
11208 __Pyx_RefNannySetupContext(
"__get__", 0);
11217 __Pyx_XDECREF(__pyx_r);
11218 __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->view.ndim);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 583, __pyx_L1_error)
11219 __Pyx_GOTREF(__pyx_t_1);
11220 __pyx_r = __pyx_t_1;
11234 __Pyx_XDECREF(__pyx_t_1);
11235 __Pyx_AddTraceback(
"View.MemoryView.memoryview.ndim.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
11238 __Pyx_XGIVEREF(__pyx_r);
11239 __Pyx_RefNannyFinishContext();
11252 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_8itemsize_1__get__(PyObject *__pyx_v_self);
11253 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_8itemsize_1__get__(PyObject *__pyx_v_self) {
11254 PyObject *__pyx_r = 0;
11255 __Pyx_RefNannyDeclarations
11256 __Pyx_RefNannySetupContext(
"__get__ (wrapper)", 0);
11257 __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_8itemsize___get__(((
struct __pyx_memoryview_obj *)__pyx_v_self));
11260 __Pyx_RefNannyFinishContext();
11264 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_8itemsize___get__(
struct __pyx_memoryview_obj *__pyx_v_self) {
11265 PyObject *__pyx_r = NULL;
11266 __Pyx_RefNannyDeclarations
11267 PyObject *__pyx_t_1 = NULL;
11268 int __pyx_lineno = 0;
11269 const char *__pyx_filename = NULL;
11270 int __pyx_clineno = 0;
11271 __Pyx_RefNannySetupContext(
"__get__", 0);
11280 __Pyx_XDECREF(__pyx_r);
11281 __pyx_t_1 = PyInt_FromSsize_t(__pyx_v_self->view.itemsize);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 587, __pyx_L1_error)
11282 __Pyx_GOTREF(__pyx_t_1);
11283 __pyx_r = __pyx_t_1;
11297 __Pyx_XDECREF(__pyx_t_1);
11298 __Pyx_AddTraceback(
"View.MemoryView.memoryview.itemsize.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
11301 __Pyx_XGIVEREF(__pyx_r);
11302 __Pyx_RefNannyFinishContext();
11315 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_6nbytes_1__get__(PyObject *__pyx_v_self);
11316 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_6nbytes_1__get__(PyObject *__pyx_v_self) {
11317 PyObject *__pyx_r = 0;
11318 __Pyx_RefNannyDeclarations
11319 __Pyx_RefNannySetupContext(
"__get__ (wrapper)", 0);
11320 __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_6nbytes___get__(((
struct __pyx_memoryview_obj *)__pyx_v_self));
11323 __Pyx_RefNannyFinishContext();
11327 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_6nbytes___get__(
struct __pyx_memoryview_obj *__pyx_v_self) {
11328 PyObject *__pyx_r = NULL;
11329 __Pyx_RefNannyDeclarations
11330 PyObject *__pyx_t_1 = NULL;
11331 PyObject *__pyx_t_2 = NULL;
11332 PyObject *__pyx_t_3 = NULL;
11333 int __pyx_lineno = 0;
11334 const char *__pyx_filename = NULL;
11335 int __pyx_clineno = 0;
11336 __Pyx_RefNannySetupContext(
"__get__", 0);
11345 __Pyx_XDECREF(__pyx_r);
11346 __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)
11347 __Pyx_GOTREF(__pyx_t_1);
11348 __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_self->view.itemsize);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 591, __pyx_L1_error)
11349 __Pyx_GOTREF(__pyx_t_2);
11350 __pyx_t_3 = PyNumber_Multiply(__pyx_t_1, __pyx_t_2);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 591, __pyx_L1_error)
11351 __Pyx_GOTREF(__pyx_t_3);
11352 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
11353 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
11354 __pyx_r = __pyx_t_3;
11368 __Pyx_XDECREF(__pyx_t_1);
11369 __Pyx_XDECREF(__pyx_t_2);
11370 __Pyx_XDECREF(__pyx_t_3);
11371 __Pyx_AddTraceback(
"View.MemoryView.memoryview.nbytes.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
11374 __Pyx_XGIVEREF(__pyx_r);
11375 __Pyx_RefNannyFinishContext();
11388 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_4size_1__get__(PyObject *__pyx_v_self);
11389 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_4size_1__get__(PyObject *__pyx_v_self) {
11390 PyObject *__pyx_r = 0;
11391 __Pyx_RefNannyDeclarations
11392 __Pyx_RefNannySetupContext(
"__get__ (wrapper)", 0);
11393 __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_4size___get__(((
struct __pyx_memoryview_obj *)__pyx_v_self));
11396 __Pyx_RefNannyFinishContext();
11400 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_4size___get__(
struct __pyx_memoryview_obj *__pyx_v_self) {
11401 PyObject *__pyx_v_result = NULL;
11402 PyObject *__pyx_v_length = NULL;
11403 PyObject *__pyx_r = NULL;
11404 __Pyx_RefNannyDeclarations
11407 Py_ssize_t *__pyx_t_3;
11408 Py_ssize_t *__pyx_t_4;
11409 Py_ssize_t *__pyx_t_5;
11410 PyObject *__pyx_t_6 = NULL;
11411 int __pyx_lineno = 0;
11412 const char *__pyx_filename = NULL;
11413 int __pyx_clineno = 0;
11414 __Pyx_RefNannySetupContext(
"__get__", 0);
11423 __pyx_t_1 = (__pyx_v_self->_size == Py_None);
11424 __pyx_t_2 = (__pyx_t_1 != 0);
11434 __Pyx_INCREF(__pyx_int_1);
11435 __pyx_v_result = __pyx_int_1;
11444 __pyx_t_4 = (__pyx_v_self->view.shape + __pyx_v_self->view.ndim);
11445 for (__pyx_t_5 = __pyx_v_self->view.shape; __pyx_t_5 < __pyx_t_4; __pyx_t_5++) {
11446 __pyx_t_3 = __pyx_t_5;
11447 __pyx_t_6 = PyInt_FromSsize_t((__pyx_t_3[0]));
if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 598, __pyx_L1_error)
11448 __Pyx_GOTREF(__pyx_t_6);
11449 __Pyx_XDECREF_SET(__pyx_v_length, __pyx_t_6);
11459 __pyx_t_6 = PyNumber_InPlaceMultiply(__pyx_v_result, __pyx_v_length);
if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 599, __pyx_L1_error)
11460 __Pyx_GOTREF(__pyx_t_6);
11461 __Pyx_DECREF_SET(__pyx_v_result, __pyx_t_6);
11472 __Pyx_INCREF(__pyx_v_result);
11473 __Pyx_GIVEREF(__pyx_v_result);
11474 __Pyx_GOTREF(__pyx_v_self->_size);
11475 __Pyx_DECREF(__pyx_v_self->_size);
11476 __pyx_v_self->_size = __pyx_v_result;
11494 __Pyx_XDECREF(__pyx_r);
11495 __Pyx_INCREF(__pyx_v_self->_size);
11496 __pyx_r = __pyx_v_self->_size;
11509 __Pyx_XDECREF(__pyx_t_6);
11510 __Pyx_AddTraceback(
"View.MemoryView.memoryview.size.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
11513 __Pyx_XDECREF(__pyx_v_result);
11514 __Pyx_XDECREF(__pyx_v_length);
11515 __Pyx_XGIVEREF(__pyx_r);
11516 __Pyx_RefNannyFinishContext();
11529 static Py_ssize_t __pyx_memoryview___len__(PyObject *__pyx_v_self);
11530 static Py_ssize_t __pyx_memoryview___len__(PyObject *__pyx_v_self) {
11531 Py_ssize_t __pyx_r;
11532 __Pyx_RefNannyDeclarations
11533 __Pyx_RefNannySetupContext(
"__len__ (wrapper)", 0);
11534 __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_10__len__(((
struct __pyx_memoryview_obj *)__pyx_v_self));
11537 __Pyx_RefNannyFinishContext();
11541 static Py_ssize_t __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_10__len__(
struct __pyx_memoryview_obj *__pyx_v_self) {
11542 Py_ssize_t __pyx_r;
11543 __Pyx_RefNannyDeclarations
11545 __Pyx_RefNannySetupContext(
"__len__", 0);
11554 __pyx_t_1 = ((__pyx_v_self->view.ndim >= 1) != 0);
11564 __pyx_r = (__pyx_v_self->view.shape[0]);
11596 __Pyx_RefNannyFinishContext();
11609 static PyObject *__pyx_memoryview___repr__(PyObject *__pyx_v_self);
11610 static PyObject *__pyx_memoryview___repr__(PyObject *__pyx_v_self) {
11611 PyObject *__pyx_r = 0;
11612 __Pyx_RefNannyDeclarations
11613 __Pyx_RefNannySetupContext(
"__repr__ (wrapper)", 0);
11614 __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_12__repr__(((
struct __pyx_memoryview_obj *)__pyx_v_self));
11617 __Pyx_RefNannyFinishContext();
11621 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_12__repr__(
struct __pyx_memoryview_obj *__pyx_v_self) {
11622 PyObject *__pyx_r = NULL;
11623 __Pyx_RefNannyDeclarations
11624 PyObject *__pyx_t_1 = NULL;
11625 PyObject *__pyx_t_2 = NULL;
11626 PyObject *__pyx_t_3 = NULL;
11627 int __pyx_lineno = 0;
11628 const char *__pyx_filename = NULL;
11629 int __pyx_clineno = 0;
11630 __Pyx_RefNannySetupContext(
"__repr__", 0);
11639 __Pyx_XDECREF(__pyx_r);
11640 __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)
11641 __Pyx_GOTREF(__pyx_t_1);
11642 __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)
11643 __Pyx_GOTREF(__pyx_t_2);
11644 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
11645 __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)
11646 __Pyx_GOTREF(__pyx_t_1);
11647 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
11656 __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)
11657 __Pyx_GOTREF(__pyx_t_2);
11666 __pyx_t_3 = PyTuple_New(2);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 612, __pyx_L1_error)
11667 __Pyx_GOTREF(__pyx_t_3);
11668 __Pyx_GIVEREF(__pyx_t_1);
11669 PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1);
11670 __Pyx_GIVEREF(__pyx_t_2);
11671 PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_2);
11674 __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)
11675 __Pyx_GOTREF(__pyx_t_2);
11676 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
11677 __pyx_r = __pyx_t_2;
11691 __Pyx_XDECREF(__pyx_t_1);
11692 __Pyx_XDECREF(__pyx_t_2);
11693 __Pyx_XDECREF(__pyx_t_3);
11694 __Pyx_AddTraceback(
"View.MemoryView.memoryview.__repr__", __pyx_clineno, __pyx_lineno, __pyx_filename);
11697 __Pyx_XGIVEREF(__pyx_r);
11698 __Pyx_RefNannyFinishContext();
11711 static PyObject *__pyx_memoryview___str__(PyObject *__pyx_v_self);
11712 static PyObject *__pyx_memoryview___str__(PyObject *__pyx_v_self) {
11713 PyObject *__pyx_r = 0;
11714 __Pyx_RefNannyDeclarations
11715 __Pyx_RefNannySetupContext(
"__str__ (wrapper)", 0);
11716 __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_14__str__(((
struct __pyx_memoryview_obj *)__pyx_v_self));
11719 __Pyx_RefNannyFinishContext();
11723 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_14__str__(
struct __pyx_memoryview_obj *__pyx_v_self) {
11724 PyObject *__pyx_r = NULL;
11725 __Pyx_RefNannyDeclarations
11726 PyObject *__pyx_t_1 = NULL;
11727 PyObject *__pyx_t_2 = NULL;
11728 int __pyx_lineno = 0;
11729 const char *__pyx_filename = NULL;
11730 int __pyx_clineno = 0;
11731 __Pyx_RefNannySetupContext(
"__str__", 0);
11740 __Pyx_XDECREF(__pyx_r);
11741 __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)
11742 __Pyx_GOTREF(__pyx_t_1);
11743 __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)
11744 __Pyx_GOTREF(__pyx_t_2);
11745 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
11746 __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)
11747 __Pyx_GOTREF(__pyx_t_1);
11748 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
11749 __pyx_t_2 = PyTuple_New(1);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 616, __pyx_L1_error)
11750 __Pyx_GOTREF(__pyx_t_2);
11751 __Pyx_GIVEREF(__pyx_t_1);
11752 PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1);
11754 __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)
11755 __Pyx_GOTREF(__pyx_t_1);
11756 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
11757 __pyx_r = __pyx_t_1;
11771 __Pyx_XDECREF(__pyx_t_1);
11772 __Pyx_XDECREF(__pyx_t_2);
11773 __Pyx_AddTraceback(
"View.MemoryView.memoryview.__str__", __pyx_clineno, __pyx_lineno, __pyx_filename);
11776 __Pyx_XGIVEREF(__pyx_r);
11777 __Pyx_RefNannyFinishContext();
11790 static PyObject *__pyx_memoryview_is_c_contig(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused);
11791 static PyObject *__pyx_memoryview_is_c_contig(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
11792 PyObject *__pyx_r = 0;
11793 __Pyx_RefNannyDeclarations
11794 __Pyx_RefNannySetupContext(
"is_c_contig (wrapper)", 0);
11795 __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_16is_c_contig(((
struct __pyx_memoryview_obj *)__pyx_v_self));
11798 __Pyx_RefNannyFinishContext();
11802 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_16is_c_contig(
struct __pyx_memoryview_obj *__pyx_v_self) {
11803 __Pyx_memviewslice *__pyx_v_mslice;
11804 __Pyx_memviewslice __pyx_v_tmp;
11805 PyObject *__pyx_r = NULL;
11806 __Pyx_RefNannyDeclarations
11807 __Pyx_memviewslice *__pyx_t_1;
11808 PyObject *__pyx_t_2 = NULL;
11809 int __pyx_lineno = 0;
11810 const char *__pyx_filename = NULL;
11811 int __pyx_clineno = 0;
11812 __Pyx_RefNannySetupContext(
"is_c_contig", 0);
11821 __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)
11822 __pyx_v_mslice = __pyx_t_1;
11831 __Pyx_XDECREF(__pyx_r);
11832 __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)
11833 __Pyx_GOTREF(__pyx_t_2);
11834 __pyx_r = __pyx_t_2;
11848 __Pyx_XDECREF(__pyx_t_2);
11849 __Pyx_AddTraceback(
"View.MemoryView.memoryview.is_c_contig", __pyx_clineno, __pyx_lineno, __pyx_filename);
11852 __Pyx_XGIVEREF(__pyx_r);
11853 __Pyx_RefNannyFinishContext();
11866 static PyObject *__pyx_memoryview_is_f_contig(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused);
11867 static PyObject *__pyx_memoryview_is_f_contig(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
11868 PyObject *__pyx_r = 0;
11869 __Pyx_RefNannyDeclarations
11870 __Pyx_RefNannySetupContext(
"is_f_contig (wrapper)", 0);
11871 __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_18is_f_contig(((
struct __pyx_memoryview_obj *)__pyx_v_self));
11874 __Pyx_RefNannyFinishContext();
11878 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_18is_f_contig(
struct __pyx_memoryview_obj *__pyx_v_self) {
11879 __Pyx_memviewslice *__pyx_v_mslice;
11880 __Pyx_memviewslice __pyx_v_tmp;
11881 PyObject *__pyx_r = NULL;
11882 __Pyx_RefNannyDeclarations
11883 __Pyx_memviewslice *__pyx_t_1;
11884 PyObject *__pyx_t_2 = NULL;
11885 int __pyx_lineno = 0;
11886 const char *__pyx_filename = NULL;
11887 int __pyx_clineno = 0;
11888 __Pyx_RefNannySetupContext(
"is_f_contig", 0);
11897 __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)
11898 __pyx_v_mslice = __pyx_t_1;
11907 __Pyx_XDECREF(__pyx_r);
11908 __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)
11909 __Pyx_GOTREF(__pyx_t_2);
11910 __pyx_r = __pyx_t_2;
11924 __Pyx_XDECREF(__pyx_t_2);
11925 __Pyx_AddTraceback(
"View.MemoryView.memoryview.is_f_contig", __pyx_clineno, __pyx_lineno, __pyx_filename);
11928 __Pyx_XGIVEREF(__pyx_r);
11929 __Pyx_RefNannyFinishContext();
11942 static PyObject *__pyx_memoryview_copy(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused);
11943 static PyObject *__pyx_memoryview_copy(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
11944 PyObject *__pyx_r = 0;
11945 __Pyx_RefNannyDeclarations
11946 __Pyx_RefNannySetupContext(
"copy (wrapper)", 0);
11947 __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_20copy(((
struct __pyx_memoryview_obj *)__pyx_v_self));
11950 __Pyx_RefNannyFinishContext();
11954 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_20copy(
struct __pyx_memoryview_obj *__pyx_v_self) {
11955 __Pyx_memviewslice __pyx_v_mslice;
11957 PyObject *__pyx_r = NULL;
11958 __Pyx_RefNannyDeclarations
11959 __Pyx_memviewslice __pyx_t_1;
11960 PyObject *__pyx_t_2 = NULL;
11961 int __pyx_lineno = 0;
11962 const char *__pyx_filename = NULL;
11963 int __pyx_clineno = 0;
11964 __Pyx_RefNannySetupContext(
"copy", 0);
11973 __pyx_v_flags = (__pyx_v_self->flags & (~PyBUF_F_CONTIGUOUS));
11982 __pyx_memoryview_slice_copy(__pyx_v_self, (&__pyx_v_mslice));
11991 __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)
11992 __pyx_v_mslice = __pyx_t_1;
12001 __Pyx_XDECREF(__pyx_r);
12002 __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)
12003 __Pyx_GOTREF(__pyx_t_2);
12004 __pyx_r = __pyx_t_2;
12018 __Pyx_XDECREF(__pyx_t_2);
12019 __Pyx_AddTraceback(
"View.MemoryView.memoryview.copy", __pyx_clineno, __pyx_lineno, __pyx_filename);
12022 __Pyx_XGIVEREF(__pyx_r);
12023 __Pyx_RefNannyFinishContext();
12036 static PyObject *__pyx_memoryview_copy_fortran(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused);
12037 static PyObject *__pyx_memoryview_copy_fortran(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
12038 PyObject *__pyx_r = 0;
12039 __Pyx_RefNannyDeclarations
12040 __Pyx_RefNannySetupContext(
"copy_fortran (wrapper)", 0);
12041 __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_22copy_fortran(((
struct __pyx_memoryview_obj *)__pyx_v_self));
12044 __Pyx_RefNannyFinishContext();
12048 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_22copy_fortran(
struct __pyx_memoryview_obj *__pyx_v_self) {
12049 __Pyx_memviewslice __pyx_v_src;
12050 __Pyx_memviewslice __pyx_v_dst;
12052 PyObject *__pyx_r = NULL;
12053 __Pyx_RefNannyDeclarations
12054 __Pyx_memviewslice __pyx_t_1;
12055 PyObject *__pyx_t_2 = NULL;
12056 int __pyx_lineno = 0;
12057 const char *__pyx_filename = NULL;
12058 int __pyx_clineno = 0;
12059 __Pyx_RefNannySetupContext(
"copy_fortran", 0);
12068 __pyx_v_flags = (__pyx_v_self->flags & (~PyBUF_C_CONTIGUOUS));
12077 __pyx_memoryview_slice_copy(__pyx_v_self, (&__pyx_v_src));
12086 __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)
12087 __pyx_v_dst = __pyx_t_1;
12096 __Pyx_XDECREF(__pyx_r);
12097 __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)
12098 __Pyx_GOTREF(__pyx_t_2);
12099 __pyx_r = __pyx_t_2;
12113 __Pyx_XDECREF(__pyx_t_2);
12114 __Pyx_AddTraceback(
"View.MemoryView.memoryview.copy_fortran", __pyx_clineno, __pyx_lineno, __pyx_filename);
12117 __Pyx_XGIVEREF(__pyx_r);
12118 __Pyx_RefNannyFinishContext();
12129 static PyObject *__pyx_pw___pyx_memoryview_1__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused);
12130 static PyObject *__pyx_pw___pyx_memoryview_1__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
12131 PyObject *__pyx_r = 0;
12132 __Pyx_RefNannyDeclarations
12133 __Pyx_RefNannySetupContext(
"__reduce_cython__ (wrapper)", 0);
12134 __pyx_r = __pyx_pf___pyx_memoryview___reduce_cython__(((
struct __pyx_memoryview_obj *)__pyx_v_self));
12137 __Pyx_RefNannyFinishContext();
12141 static PyObject *__pyx_pf___pyx_memoryview___reduce_cython__(CYTHON_UNUSED
struct __pyx_memoryview_obj *__pyx_v_self) {
12142 PyObject *__pyx_r = NULL;
12143 __Pyx_RefNannyDeclarations
12144 PyObject *__pyx_t_1 = NULL;
12145 int __pyx_lineno = 0;
12146 const char *__pyx_filename = NULL;
12147 int __pyx_clineno = 0;
12148 __Pyx_RefNannySetupContext(
"__reduce_cython__", 0);
12156 __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__18, NULL);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2, __pyx_L1_error)
12157 __Pyx_GOTREF(__pyx_t_1);
12158 __Pyx_Raise(__pyx_t_1, 0, 0, 0);
12159 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
12160 __PYX_ERR(0, 2, __pyx_L1_error)
12170 __Pyx_XDECREF(__pyx_t_1);
12171 __Pyx_AddTraceback(
"View.MemoryView.memoryview.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
12173 __Pyx_XGIVEREF(__pyx_r);
12174 __Pyx_RefNannyFinishContext();
12186 static PyObject *__pyx_pw___pyx_memoryview_3__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state);
12187 static PyObject *__pyx_pw___pyx_memoryview_3__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
12188 PyObject *__pyx_r = 0;
12189 __Pyx_RefNannyDeclarations
12190 __Pyx_RefNannySetupContext(
"__setstate_cython__ (wrapper)", 0);
12191 __pyx_r = __pyx_pf___pyx_memoryview_2__setstate_cython__(((
struct __pyx_memoryview_obj *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state));
12194 __Pyx_RefNannyFinishContext();
12198 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) {
12199 PyObject *__pyx_r = NULL;
12200 __Pyx_RefNannyDeclarations
12201 PyObject *__pyx_t_1 = NULL;
12202 int __pyx_lineno = 0;
12203 const char *__pyx_filename = NULL;
12204 int __pyx_clineno = 0;
12205 __Pyx_RefNannySetupContext(
"__setstate_cython__", 0);
12212 __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__19, NULL);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4, __pyx_L1_error)
12213 __Pyx_GOTREF(__pyx_t_1);
12214 __Pyx_Raise(__pyx_t_1, 0, 0, 0);
12215 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
12216 __PYX_ERR(0, 4, __pyx_L1_error)
12227 __Pyx_XDECREF(__pyx_t_1);
12228 __Pyx_AddTraceback(
"View.MemoryView.memoryview.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
12230 __Pyx_XGIVEREF(__pyx_r);
12231 __Pyx_RefNannyFinishContext();
12243 static PyObject *__pyx_memoryview_new(PyObject *__pyx_v_o,
int __pyx_v_flags,
int __pyx_v_dtype_is_object, __Pyx_TypeInfo *__pyx_v_typeinfo) {
12244 struct __pyx_memoryview_obj *__pyx_v_result = 0;
12245 PyObject *__pyx_r = NULL;
12246 __Pyx_RefNannyDeclarations
12247 PyObject *__pyx_t_1 = NULL;
12248 PyObject *__pyx_t_2 = NULL;
12249 PyObject *__pyx_t_3 = NULL;
12250 int __pyx_lineno = 0;
12251 const char *__pyx_filename = NULL;
12252 int __pyx_clineno = 0;
12253 __Pyx_RefNannySetupContext(
"memoryview_cwrapper", 0);
12262 __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_flags);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 658, __pyx_L1_error)
12263 __Pyx_GOTREF(__pyx_t_1);
12264 __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_v_dtype_is_object);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 658, __pyx_L1_error)
12265 __Pyx_GOTREF(__pyx_t_2);
12266 __pyx_t_3 = PyTuple_New(3);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 658, __pyx_L1_error)
12267 __Pyx_GOTREF(__pyx_t_3);
12268 __Pyx_INCREF(__pyx_v_o);
12269 __Pyx_GIVEREF(__pyx_v_o);
12270 PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_o);
12271 __Pyx_GIVEREF(__pyx_t_1);
12272 PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_1);
12273 __Pyx_GIVEREF(__pyx_t_2);
12274 PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_t_2);
12277 __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)
12278 __Pyx_GOTREF(__pyx_t_2);
12279 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
12280 __pyx_v_result = ((
struct __pyx_memoryview_obj *)__pyx_t_2);
12290 __pyx_v_result->typeinfo = __pyx_v_typeinfo;
12299 __Pyx_XDECREF(__pyx_r);
12300 __Pyx_INCREF(((PyObject *)__pyx_v_result));
12301 __pyx_r = ((PyObject *)__pyx_v_result);
12314 __Pyx_XDECREF(__pyx_t_1);
12315 __Pyx_XDECREF(__pyx_t_2);
12316 __Pyx_XDECREF(__pyx_t_3);
12317 __Pyx_AddTraceback(
"View.MemoryView.memoryview_cwrapper", __pyx_clineno, __pyx_lineno, __pyx_filename);
12320 __Pyx_XDECREF((PyObject *)__pyx_v_result);
12321 __Pyx_XGIVEREF(__pyx_r);
12322 __Pyx_RefNannyFinishContext();
12334 static CYTHON_INLINE
int __pyx_memoryview_check(PyObject *__pyx_v_o) {
12336 __Pyx_RefNannyDeclarations
12338 __Pyx_RefNannySetupContext(
"memoryview_check", 0);
12347 __pyx_t_1 = __Pyx_TypeCheck(__pyx_v_o, __pyx_memoryview_type);
12348 __pyx_r = __pyx_t_1;
12361 __Pyx_RefNannyFinishContext();
12373 static PyObject *_unellipsify(PyObject *__pyx_v_index,
int __pyx_v_ndim) {
12374 PyObject *__pyx_v_tup = NULL;
12375 PyObject *__pyx_v_result = NULL;
12376 int __pyx_v_have_slices;
12377 int __pyx_v_seen_ellipsis;
12378 CYTHON_UNUSED PyObject *__pyx_v_idx = NULL;
12379 PyObject *__pyx_v_item = NULL;
12380 Py_ssize_t __pyx_v_nslices;
12381 PyObject *__pyx_r = NULL;
12382 __Pyx_RefNannyDeclarations
12385 PyObject *__pyx_t_3 = NULL;
12386 PyObject *__pyx_t_4 = NULL;
12387 Py_ssize_t __pyx_t_5;
12388 PyObject *(*__pyx_t_6)(PyObject *);
12389 PyObject *__pyx_t_7 = NULL;
12390 Py_ssize_t __pyx_t_8;
12393 PyObject *__pyx_t_11 = NULL;
12394 int __pyx_lineno = 0;
12395 const char *__pyx_filename = NULL;
12396 int __pyx_clineno = 0;
12397 __Pyx_RefNannySetupContext(
"_unellipsify", 0);
12406 __pyx_t_1 = PyTuple_Check(__pyx_v_index);
12407 __pyx_t_2 = ((!(__pyx_t_1 != 0)) != 0);
12417 __pyx_t_3 = PyTuple_New(1);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 672, __pyx_L1_error)
12418 __Pyx_GOTREF(__pyx_t_3);
12419 __Pyx_INCREF(__pyx_v_index);
12420 __Pyx_GIVEREF(__pyx_v_index);
12421 PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_index);
12422 __pyx_v_tup = __pyx_t_3;
12443 __Pyx_INCREF(__pyx_v_index);
12444 __pyx_v_tup = __pyx_v_index;
12455 __pyx_t_3 = PyList_New(0);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 676, __pyx_L1_error)
12456 __Pyx_GOTREF(__pyx_t_3);
12457 __pyx_v_result = ((PyObject*)__pyx_t_3);
12467 __pyx_v_have_slices = 0;
12476 __pyx_v_seen_ellipsis = 0;
12485 __Pyx_INCREF(__pyx_int_0);
12486 __pyx_t_3 = __pyx_int_0;
12487 if (likely(PyList_CheckExact(__pyx_v_tup)) || PyTuple_CheckExact(__pyx_v_tup)) {
12488 __pyx_t_4 = __pyx_v_tup; __Pyx_INCREF(__pyx_t_4); __pyx_t_5 = 0;
12491 __pyx_t_5 = -1; __pyx_t_4 = PyObject_GetIter(__pyx_v_tup);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 679, __pyx_L1_error)
12492 __Pyx_GOTREF(__pyx_t_4);
12493 __pyx_t_6 = Py_TYPE(__pyx_t_4)->tp_iternext;
if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 679, __pyx_L1_error)
12496 if (likely(!__pyx_t_6)) {
12497 if (likely(PyList_CheckExact(__pyx_t_4))) {
12498 if (__pyx_t_5 >= PyList_GET_SIZE(__pyx_t_4))
break;
12499 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
12500 __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)
12502 __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)
12503 __Pyx_GOTREF(__pyx_t_7);
12506 if (__pyx_t_5 >= PyTuple_GET_SIZE(__pyx_t_4))
break;
12507 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
12508 __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)
12510 __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)
12511 __Pyx_GOTREF(__pyx_t_7);
12515 __pyx_t_7 = __pyx_t_6(__pyx_t_4);
12516 if (unlikely(!__pyx_t_7)) {
12517 PyObject* exc_type = PyErr_Occurred();
12519 if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
12520 else __PYX_ERR(0, 679, __pyx_L1_error)
12524 __Pyx_GOTREF(__pyx_t_7);
12526 __Pyx_XDECREF_SET(__pyx_v_item, __pyx_t_7);
12528 __Pyx_INCREF(__pyx_t_3);
12529 __Pyx_XDECREF_SET(__pyx_v_idx, __pyx_t_3);
12530 __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)
12531 __Pyx_GOTREF(__pyx_t_7);
12532 __Pyx_DECREF(__pyx_t_3);
12533 __pyx_t_3 = __pyx_t_7;
12543 __pyx_t_2 = (__pyx_v_item == __pyx_builtin_Ellipsis);
12544 __pyx_t_1 = (__pyx_t_2 != 0);
12554 __pyx_t_1 = ((!(__pyx_v_seen_ellipsis != 0)) != 0);
12564 __pyx_t_8 = PyObject_Length(__pyx_v_tup);
if (unlikely(__pyx_t_8 == ((Py_ssize_t)-1))) __PYX_ERR(0, 682, __pyx_L1_error)
12565 __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)
12566 __Pyx_GOTREF(__pyx_t_7);
12567 { Py_ssize_t __pyx_temp;
12568 for (__pyx_temp=0; __pyx_temp < ((__pyx_v_ndim - __pyx_t_8) + 1); __pyx_temp++) {
12569 __Pyx_INCREF(__pyx_slice_);
12570 __Pyx_GIVEREF(__pyx_slice_);
12571 PyList_SET_ITEM(__pyx_t_7, __pyx_temp, __pyx_slice_);
12574 __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)
12575 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
12584 __pyx_v_seen_ellipsis = 1;
12604 __pyx_t_9 = __Pyx_PyList_Append(__pyx_v_result, __pyx_slice_);
if (unlikely(__pyx_t_9 == ((
int)-1))) __PYX_ERR(0, 685, __pyx_L1_error)
12615 __pyx_v_have_slices = 1;
12635 __pyx_t_2 = PySlice_Check(__pyx_v_item);
12636 __pyx_t_10 = ((!(__pyx_t_2 != 0)) != 0);
12639 __pyx_t_1 = __pyx_t_10;
12640 goto __pyx_L9_bool_binop_done;
12642 __pyx_t_10 = ((!(PyIndex_Check(__pyx_v_item) != 0)) != 0);
12643 __pyx_t_1 = __pyx_t_10;
12644 __pyx_L9_bool_binop_done:;
12645 if (unlikely(__pyx_t_1)) {
12654 __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)
12655 __Pyx_GOTREF(__pyx_t_7);
12656 __pyx_t_11 = __Pyx_PyObject_CallOneArg(__pyx_builtin_TypeError, __pyx_t_7);
if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 689, __pyx_L1_error)
12657 __Pyx_GOTREF(__pyx_t_11);
12658 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
12659 __Pyx_Raise(__pyx_t_11, 0, 0, 0);
12660 __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
12661 __PYX_ERR(0, 689, __pyx_L1_error)
12679 __pyx_t_10 = (__pyx_v_have_slices != 0);
12682 __pyx_t_1 = __pyx_t_10;
12683 goto __pyx_L11_bool_binop_done;
12685 __pyx_t_10 = PySlice_Check(__pyx_v_item);
12686 __pyx_t_2 = (__pyx_t_10 != 0);
12687 __pyx_t_1 = __pyx_t_2;
12688 __pyx_L11_bool_binop_done:;
12689 __pyx_v_have_slices = __pyx_t_1;
12698 __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)
12710 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
12711 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
12720 __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)
12721 __pyx_v_nslices = (__pyx_v_ndim - __pyx_t_5);
12730 __pyx_t_1 = (__pyx_v_nslices != 0);
12740 __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)
12741 __Pyx_GOTREF(__pyx_t_3);
12742 { Py_ssize_t __pyx_temp;
12743 for (__pyx_temp=0; __pyx_temp < __pyx_v_nslices; __pyx_temp++) {
12744 __Pyx_INCREF(__pyx_slice_);
12745 __Pyx_GIVEREF(__pyx_slice_);
12746 PyList_SET_ITEM(__pyx_t_3, __pyx_temp, __pyx_slice_);
12749 __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)
12750 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
12768 __Pyx_XDECREF(__pyx_r);
12769 if (!__pyx_v_have_slices) {
12771 __pyx_t_4 = __Pyx_PyBool_FromLong(__pyx_v_have_slices);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 698, __pyx_L1_error)
12772 __Pyx_GOTREF(__pyx_t_4);
12773 __pyx_t_3 = __pyx_t_4;
12775 goto __pyx_L14_bool_binop_done;
12777 __pyx_t_4 = PyInt_FromSsize_t(__pyx_v_nslices);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 698, __pyx_L1_error)
12778 __Pyx_GOTREF(__pyx_t_4);
12779 __pyx_t_3 = __pyx_t_4;
12781 __pyx_L14_bool_binop_done:;
12782 __pyx_t_4 = PyList_AsTuple(__pyx_v_result);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 698, __pyx_L1_error)
12783 __Pyx_GOTREF(__pyx_t_4);
12784 __pyx_t_11 = PyTuple_New(2);
if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 698, __pyx_L1_error)
12785 __Pyx_GOTREF(__pyx_t_11);
12786 __Pyx_GIVEREF(__pyx_t_3);
12787 PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_t_3);
12788 __Pyx_GIVEREF(__pyx_t_4);
12789 PyTuple_SET_ITEM(__pyx_t_11, 1, __pyx_t_4);
12792 __pyx_r = ((PyObject*)__pyx_t_11);
12806 __Pyx_XDECREF(__pyx_t_3);
12807 __Pyx_XDECREF(__pyx_t_4);
12808 __Pyx_XDECREF(__pyx_t_7);
12809 __Pyx_XDECREF(__pyx_t_11);
12810 __Pyx_AddTraceback(
"View.MemoryView._unellipsify", __pyx_clineno, __pyx_lineno, __pyx_filename);
12813 __Pyx_XDECREF(__pyx_v_tup);
12814 __Pyx_XDECREF(__pyx_v_result);
12815 __Pyx_XDECREF(__pyx_v_idx);
12816 __Pyx_XDECREF(__pyx_v_item);
12817 __Pyx_XGIVEREF(__pyx_r);
12818 __Pyx_RefNannyFinishContext();
12830 static PyObject *assert_direct_dimensions(Py_ssize_t *__pyx_v_suboffsets,
int __pyx_v_ndim) {
12831 Py_ssize_t __pyx_v_suboffset;
12832 PyObject *__pyx_r = NULL;
12833 __Pyx_RefNannyDeclarations
12834 Py_ssize_t *__pyx_t_1;
12835 Py_ssize_t *__pyx_t_2;
12836 Py_ssize_t *__pyx_t_3;
12838 PyObject *__pyx_t_5 = NULL;
12839 int __pyx_lineno = 0;
12840 const char *__pyx_filename = NULL;
12841 int __pyx_clineno = 0;
12842 __Pyx_RefNannySetupContext(
"assert_direct_dimensions", 0);
12851 __pyx_t_2 = (__pyx_v_suboffsets + __pyx_v_ndim);
12852 for (__pyx_t_3 = __pyx_v_suboffsets; __pyx_t_3 < __pyx_t_2; __pyx_t_3++) {
12853 __pyx_t_1 = __pyx_t_3;
12854 __pyx_v_suboffset = (__pyx_t_1[0]);
12863 __pyx_t_4 = ((__pyx_v_suboffset >= 0) != 0);
12864 if (unlikely(__pyx_t_4)) {
12873 __pyx_t_5 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__20, NULL);
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 703, __pyx_L1_error)
12874 __Pyx_GOTREF(__pyx_t_5);
12875 __Pyx_Raise(__pyx_t_5, 0, 0, 0);
12876 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
12877 __PYX_ERR(0, 703, __pyx_L1_error)
12898 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
12901 __Pyx_XDECREF(__pyx_t_5);
12902 __Pyx_AddTraceback(
"View.MemoryView.assert_direct_dimensions", __pyx_clineno, __pyx_lineno, __pyx_filename);
12905 __Pyx_XGIVEREF(__pyx_r);
12906 __Pyx_RefNannyFinishContext();
12918 static struct __pyx_memoryview_obj *__pyx_memview_slice(
struct __pyx_memoryview_obj *__pyx_v_memview, PyObject *__pyx_v_indices) {
12919 int __pyx_v_new_ndim;
12920 int __pyx_v_suboffset_dim;
12922 __Pyx_memviewslice __pyx_v_src;
12923 __Pyx_memviewslice __pyx_v_dst;
12924 __Pyx_memviewslice *__pyx_v_p_src;
12925 struct __pyx_memoryviewslice_obj *__pyx_v_memviewsliceobj = 0;
12926 __Pyx_memviewslice *__pyx_v_p_dst;
12927 int *__pyx_v_p_suboffset_dim;
12928 Py_ssize_t __pyx_v_start;
12929 Py_ssize_t __pyx_v_stop;
12930 Py_ssize_t __pyx_v_step;
12931 int __pyx_v_have_start;
12932 int __pyx_v_have_stop;
12933 int __pyx_v_have_step;
12934 PyObject *__pyx_v_index = NULL;
12935 struct __pyx_memoryview_obj *__pyx_r = NULL;
12936 __Pyx_RefNannyDeclarations
12939 PyObject *__pyx_t_3 = NULL;
12940 struct __pyx_memoryview_obj *__pyx_t_4;
12943 Py_ssize_t __pyx_t_7;
12944 PyObject *(*__pyx_t_8)(PyObject *);
12945 PyObject *__pyx_t_9 = NULL;
12946 Py_ssize_t __pyx_t_10;
12948 Py_ssize_t __pyx_t_12;
12949 int __pyx_lineno = 0;
12950 const char *__pyx_filename = NULL;
12951 int __pyx_clineno = 0;
12952 __Pyx_RefNannySetupContext(
"memview_slice", 0);
12961 __pyx_v_new_ndim = 0;
12962 __pyx_v_suboffset_dim = -1;
12971 (void)(memset((&__pyx_v_dst), 0, (
sizeof(__pyx_v_dst))));
12980 #ifndef CYTHON_WITHOUT_ASSERTIONS
12981 if (unlikely(!Py_OptimizeFlag)) {
12982 if (unlikely(!((__pyx_v_memview->view.ndim > 0) != 0))) {
12983 PyErr_SetNone(PyExc_AssertionError);
12984 __PYX_ERR(0, 722, __pyx_L1_error)
12996 __pyx_t_1 = __Pyx_TypeCheck(((PyObject *)__pyx_v_memview), __pyx_memoryviewslice_type);
12997 __pyx_t_2 = (__pyx_t_1 != 0);
13007 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)
13008 __pyx_t_3 = ((PyObject *)__pyx_v_memview);
13009 __Pyx_INCREF(__pyx_t_3);
13010 __pyx_v_memviewsliceobj = ((
struct __pyx_memoryviewslice_obj *)__pyx_t_3);
13020 __pyx_v_p_src = (&__pyx_v_memviewsliceobj->from_slice);
13040 __pyx_memoryview_slice_copy(__pyx_v_memview, (&__pyx_v_src));
13049 __pyx_v_p_src = (&__pyx_v_src);
13060 __pyx_t_4 = __pyx_v_p_src->memview;
13061 __pyx_v_dst.memview = __pyx_t_4;
13070 __pyx_t_5 = __pyx_v_p_src->data;
13071 __pyx_v_dst.data = __pyx_t_5;
13080 __pyx_v_p_dst = (&__pyx_v_dst);
13089 __pyx_v_p_suboffset_dim = (&__pyx_v_suboffset_dim);
13099 if (likely(PyList_CheckExact(__pyx_v_indices)) || PyTuple_CheckExact(__pyx_v_indices)) {
13100 __pyx_t_3 = __pyx_v_indices; __Pyx_INCREF(__pyx_t_3); __pyx_t_7 = 0;
13103 __pyx_t_7 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_v_indices);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 746, __pyx_L1_error)
13104 __Pyx_GOTREF(__pyx_t_3);
13105 __pyx_t_8 = Py_TYPE(__pyx_t_3)->tp_iternext;
if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 746, __pyx_L1_error)
13108 if (likely(!__pyx_t_8)) {
13109 if (likely(PyList_CheckExact(__pyx_t_3))) {
13110 if (__pyx_t_7 >= PyList_GET_SIZE(__pyx_t_3))
break;
13111 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
13112 __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)
13114 __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)
13115 __Pyx_GOTREF(__pyx_t_9);
13118 if (__pyx_t_7 >= PyTuple_GET_SIZE(__pyx_t_3))
break;
13119 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
13120 __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)
13122 __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)
13123 __Pyx_GOTREF(__pyx_t_9);
13127 __pyx_t_9 = __pyx_t_8(__pyx_t_3);
13128 if (unlikely(!__pyx_t_9)) {
13129 PyObject* exc_type = PyErr_Occurred();
13131 if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
13132 else __PYX_ERR(0, 746, __pyx_L1_error)
13136 __Pyx_GOTREF(__pyx_t_9);
13138 __Pyx_XDECREF_SET(__pyx_v_index, __pyx_t_9);
13140 __pyx_v_dim = __pyx_t_6;
13141 __pyx_t_6 = (__pyx_t_6 + 1);
13150 __pyx_t_2 = (PyIndex_Check(__pyx_v_index) != 0);
13160 __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)
13169 __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)
13188 __pyx_t_2 = (__pyx_v_index == Py_None);
13189 __pyx_t_1 = (__pyx_t_2 != 0);
13199 (__pyx_v_p_dst->shape[__pyx_v_new_ndim]) = 1;
13208 (__pyx_v_p_dst->strides[__pyx_v_new_ndim]) = 0;
13217 (__pyx_v_p_dst->suboffsets[__pyx_v_new_ndim]) = -1
L;
13226 __pyx_v_new_ndim = (__pyx_v_new_ndim + 1);
13246 __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)
13247 __Pyx_GOTREF(__pyx_t_9);
13248 __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_9);
if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 760, __pyx_L1_error)
13250 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
13252 __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)
13253 __pyx_t_10 = __pyx_t_12;
13254 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
13255 goto __pyx_L7_bool_binop_done;
13258 __pyx_L7_bool_binop_done:;
13259 __pyx_v_start = __pyx_t_10;
13268 __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)
13269 __Pyx_GOTREF(__pyx_t_9);
13270 __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_9);
if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 761, __pyx_L1_error)
13272 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
13274 __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)
13275 __pyx_t_10 = __pyx_t_12;
13276 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
13277 goto __pyx_L9_bool_binop_done;
13280 __pyx_L9_bool_binop_done:;
13281 __pyx_v_stop = __pyx_t_10;
13290 __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)
13291 __Pyx_GOTREF(__pyx_t_9);
13292 __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_9);
if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 762, __pyx_L1_error)
13294 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
13296 __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)
13297 __pyx_t_10 = __pyx_t_12;
13298 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
13299 goto __pyx_L11_bool_binop_done;
13302 __pyx_L11_bool_binop_done:;
13303 __pyx_v_step = __pyx_t_10;
13312 __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)
13313 __Pyx_GOTREF(__pyx_t_9);
13314 __pyx_t_1 = (__pyx_t_9 != Py_None);
13315 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
13316 __pyx_v_have_start = __pyx_t_1;
13325 __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)
13326 __Pyx_GOTREF(__pyx_t_9);
13327 __pyx_t_1 = (__pyx_t_9 != Py_None);
13328 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
13329 __pyx_v_have_stop = __pyx_t_1;
13338 __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)
13339 __Pyx_GOTREF(__pyx_t_9);
13340 __pyx_t_1 = (__pyx_t_9 != Py_None);
13341 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
13342 __pyx_v_have_step = __pyx_t_1;
13351 __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)
13360 __pyx_v_new_ndim = (__pyx_v_new_ndim + 1);
13372 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
13381 __pyx_t_1 = __Pyx_TypeCheck(((PyObject *)__pyx_v_memview), __pyx_memoryviewslice_type);
13382 __pyx_t_2 = (__pyx_t_1 != 0);
13392 __Pyx_XDECREF(((PyObject *)__pyx_r));
13401 if (unlikely(!__pyx_v_memviewsliceobj)) { __Pyx_RaiseUnboundLocalError(
"memviewsliceobj"); __PYX_ERR(0, 778, __pyx_L1_error) }
13410 if (unlikely(!__pyx_v_memviewsliceobj)) { __Pyx_RaiseUnboundLocalError(
"memviewsliceobj"); __PYX_ERR(0, 779, __pyx_L1_error) }
13419 __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)
13420 __Pyx_GOTREF(__pyx_t_3);
13421 if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_memoryview_type))))) __PYX_ERR(0, 777, __pyx_L1_error)
13422 __pyx_r = ((
struct __pyx_memoryview_obj *)__pyx_t_3);
13443 __Pyx_XDECREF(((PyObject *)__pyx_r));
13452 __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)
13453 __Pyx_GOTREF(__pyx_t_3);
13462 if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_memoryview_type))))) __PYX_ERR(0, 782, __pyx_L1_error)
13463 __pyx_r = ((
struct __pyx_memoryview_obj *)__pyx_t_3);
13478 __Pyx_XDECREF(__pyx_t_3);
13479 __Pyx_XDECREF(__pyx_t_9);
13480 __Pyx_AddTraceback(
"View.MemoryView.memview_slice", __pyx_clineno, __pyx_lineno, __pyx_filename);
13483 __Pyx_XDECREF((PyObject *)__pyx_v_memviewsliceobj);
13484 __Pyx_XDECREF(__pyx_v_index);
13485 __Pyx_XGIVEREF((PyObject *)__pyx_r);
13486 __Pyx_RefNannyFinishContext();
13498 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) {
13499 Py_ssize_t __pyx_v_new_shape;
13500 int __pyx_v_negative_step;
13505 int __pyx_lineno = 0;
13506 const char *__pyx_filename = NULL;
13507 int __pyx_clineno = 0;
13516 __pyx_t_1 = ((!(__pyx_v_is_slice != 0)) != 0);
13526 __pyx_t_1 = ((__pyx_v_start < 0) != 0);
13536 __pyx_v_start = (__pyx_v_start + __pyx_v_shape);
13554 __pyx_t_1 = (0 <= __pyx_v_start);
13556 __pyx_t_1 = (__pyx_v_start < __pyx_v_shape);
13558 __pyx_t_2 = ((!(__pyx_t_1 != 0)) != 0);
13568 __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)
13597 __pyx_t_1 = ((__pyx_v_have_step != 0) != 0);
13600 __pyx_t_2 = __pyx_t_1;
13601 goto __pyx_L6_bool_binop_done;
13603 __pyx_t_1 = ((__pyx_v_step < 0) != 0);
13604 __pyx_t_2 = __pyx_t_1;
13605 __pyx_L6_bool_binop_done:;
13606 __pyx_v_negative_step = __pyx_t_2;
13615 __pyx_t_1 = (__pyx_v_have_step != 0);
13618 __pyx_t_2 = __pyx_t_1;
13619 goto __pyx_L9_bool_binop_done;
13621 __pyx_t_1 = ((__pyx_v_step == 0) != 0);
13622 __pyx_t_2 = __pyx_t_1;
13623 __pyx_L9_bool_binop_done:;
13633 __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)
13651 __pyx_t_2 = (__pyx_v_have_start != 0);
13661 __pyx_t_2 = ((__pyx_v_start < 0) != 0);
13671 __pyx_v_start = (__pyx_v_start + __pyx_v_shape);
13680 __pyx_t_2 = ((__pyx_v_start < 0) != 0);
13718 __pyx_t_2 = ((__pyx_v_start >= __pyx_v_shape) != 0);
13728 __pyx_t_2 = (__pyx_v_negative_step != 0);
13738 __pyx_v_start = (__pyx_v_shape - 1);
13758 __pyx_v_start = __pyx_v_shape;
13790 __pyx_t_2 = (__pyx_v_negative_step != 0);
13800 __pyx_v_start = (__pyx_v_shape - 1);
13833 __pyx_t_2 = (__pyx_v_have_stop != 0);
13843 __pyx_t_2 = ((__pyx_v_stop < 0) != 0);
13853 __pyx_v_stop = (__pyx_v_stop + __pyx_v_shape);
13862 __pyx_t_2 = ((__pyx_v_stop < 0) != 0);
13900 __pyx_t_2 = ((__pyx_v_stop > __pyx_v_shape) != 0);
13910 __pyx_v_stop = __pyx_v_shape;
13940 __pyx_t_2 = (__pyx_v_negative_step != 0);
13950 __pyx_v_stop = -1
L;
13970 __pyx_v_stop = __pyx_v_shape;
13983 __pyx_t_2 = ((!(__pyx_v_have_step != 0)) != 0);
14011 __pyx_v_new_shape = ((__pyx_v_stop - __pyx_v_start) / __pyx_v_step);
14020 __pyx_t_2 = (((__pyx_v_stop - __pyx_v_start) - (__pyx_v_step * __pyx_v_new_shape)) != 0);
14030 __pyx_v_new_shape = (__pyx_v_new_shape + 1);
14048 __pyx_t_2 = ((__pyx_v_new_shape < 0) != 0);
14058 __pyx_v_new_shape = 0;
14076 (__pyx_v_dst->strides[__pyx_v_new_ndim]) = (__pyx_v_stride * __pyx_v_step);
14085 (__pyx_v_dst->shape[__pyx_v_new_ndim]) = __pyx_v_new_shape;
14094 (__pyx_v_dst->suboffsets[__pyx_v_new_ndim]) = __pyx_v_suboffset;
14105 __pyx_t_2 = (((__pyx_v_suboffset_dim[0]) < 0) != 0);
14115 __pyx_v_dst->data = (__pyx_v_dst->data + (__pyx_v_start * __pyx_v_stride));
14135 __pyx_t_3 = (__pyx_v_suboffset_dim[0]);
14136 (__pyx_v_dst->suboffsets[__pyx_t_3]) = ((__pyx_v_dst->suboffsets[__pyx_t_3]) + (__pyx_v_start * __pyx_v_stride));
14147 __pyx_t_2 = ((__pyx_v_suboffset >= 0) != 0);
14157 __pyx_t_2 = ((!(__pyx_v_is_slice != 0)) != 0);
14167 __pyx_t_2 = ((__pyx_v_new_ndim == 0) != 0);
14177 __pyx_v_dst->data = ((((
char **)__pyx_v_dst->data)[0]) + __pyx_v_suboffset);
14205 __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)
14227 (__pyx_v_suboffset_dim[0]) = __pyx_v_new_ndim;
14262 PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
14264 __Pyx_AddTraceback(
"View.MemoryView.slice_memviewslice", __pyx_clineno, __pyx_lineno, __pyx_filename);
14266 __Pyx_PyGILState_Release(__pyx_gilstate_save);
14282 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) {
14283 Py_ssize_t __pyx_v_shape;
14284 Py_ssize_t __pyx_v_stride;
14285 Py_ssize_t __pyx_v_suboffset;
14286 Py_ssize_t __pyx_v_itemsize;
14287 char *__pyx_v_resultp;
14289 __Pyx_RefNannyDeclarations
14290 Py_ssize_t __pyx_t_1;
14292 PyObject *__pyx_t_3 = NULL;
14293 PyObject *__pyx_t_4 = NULL;
14294 int __pyx_lineno = 0;
14295 const char *__pyx_filename = NULL;
14296 int __pyx_clineno = 0;
14297 __Pyx_RefNannySetupContext(
"pybuffer_index", 0);
14306 __pyx_v_suboffset = -1
L;
14315 __pyx_t_1 = __pyx_v_view->itemsize;
14316 __pyx_v_itemsize = __pyx_t_1;
14325 __pyx_t_2 = ((__pyx_v_view->ndim == 0) != 0);
14335 if (unlikely(__pyx_v_itemsize == 0)) {
14336 PyErr_SetString(PyExc_ZeroDivisionError,
"integer division or modulo by zero");
14337 __PYX_ERR(0, 917, __pyx_L1_error)
14339 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))) {
14340 PyErr_SetString(PyExc_OverflowError,
"value too large to perform division");
14341 __PYX_ERR(0, 917, __pyx_L1_error)
14343 __pyx_v_shape = __Pyx_div_Py_ssize_t(__pyx_v_view->len, __pyx_v_itemsize);
14352 __pyx_v_stride = __pyx_v_itemsize;
14372 __pyx_v_shape = (__pyx_v_view->shape[__pyx_v_dim]);
14381 __pyx_v_stride = (__pyx_v_view->strides[__pyx_v_dim]);
14390 __pyx_t_2 = ((__pyx_v_view->suboffsets != NULL) != 0);
14400 __pyx_v_suboffset = (__pyx_v_view->suboffsets[__pyx_v_dim]);
14420 __pyx_t_2 = ((__pyx_v_index < 0) != 0);
14430 __pyx_v_index = (__pyx_v_index + (__pyx_v_view->shape[__pyx_v_dim]));
14439 __pyx_t_2 = ((__pyx_v_index < 0) != 0);
14440 if (unlikely(__pyx_t_2)) {
14449 __pyx_t_3 = PyInt_FromSsize_t(__pyx_v_dim);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 928, __pyx_L1_error)
14450 __Pyx_GOTREF(__pyx_t_3);
14451 __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)
14452 __Pyx_GOTREF(__pyx_t_4);
14453 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
14454 __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_builtin_IndexError, __pyx_t_4);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 928, __pyx_L1_error)
14455 __Pyx_GOTREF(__pyx_t_3);
14456 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
14457 __Pyx_Raise(__pyx_t_3, 0, 0, 0);
14458 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
14459 __PYX_ERR(0, 928, __pyx_L1_error)
14486 __pyx_t_2 = ((__pyx_v_index >= __pyx_v_shape) != 0);
14487 if (unlikely(__pyx_t_2)) {
14496 __pyx_t_3 = PyInt_FromSsize_t(__pyx_v_dim);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 931, __pyx_L1_error)
14497 __Pyx_GOTREF(__pyx_t_3);
14498 __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)
14499 __Pyx_GOTREF(__pyx_t_4);
14500 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
14501 __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_builtin_IndexError, __pyx_t_4);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 931, __pyx_L1_error)
14502 __Pyx_GOTREF(__pyx_t_3);
14503 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
14504 __Pyx_Raise(__pyx_t_3, 0, 0, 0);
14505 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
14506 __PYX_ERR(0, 931, __pyx_L1_error)
14524 __pyx_v_resultp = (__pyx_v_bufp + (__pyx_v_index * __pyx_v_stride));
14533 __pyx_t_2 = ((__pyx_v_suboffset >= 0) != 0);
14543 __pyx_v_resultp = ((((
char **)__pyx_v_resultp)[0]) + __pyx_v_suboffset);
14561 __pyx_r = __pyx_v_resultp;
14574 __Pyx_XDECREF(__pyx_t_3);
14575 __Pyx_XDECREF(__pyx_t_4);
14576 __Pyx_AddTraceback(
"View.MemoryView.pybuffer_index", __pyx_clineno, __pyx_lineno, __pyx_filename);
14579 __Pyx_RefNannyFinishContext();
14591 static int __pyx_memslice_transpose(__Pyx_memviewslice *__pyx_v_memslice) {
14593 Py_ssize_t *__pyx_v_shape;
14594 Py_ssize_t *__pyx_v_strides;
14599 Py_ssize_t *__pyx_t_2;
14602 Py_ssize_t __pyx_t_5;
14603 Py_ssize_t __pyx_t_6;
14607 int __pyx_lineno = 0;
14608 const char *__pyx_filename = NULL;
14609 int __pyx_clineno = 0;
14618 __pyx_t_1 = __pyx_v_memslice->memview->view.ndim;
14619 __pyx_v_ndim = __pyx_t_1;
14628 __pyx_t_2 = __pyx_v_memslice->shape;
14629 __pyx_v_shape = __pyx_t_2;
14638 __pyx_t_2 = __pyx_v_memslice->strides;
14639 __pyx_v_strides = __pyx_t_2;
14648 __pyx_t_3 = __Pyx_div_long(__pyx_v_ndim, 2);
14649 __pyx_t_4 = __pyx_t_3;
14650 for (__pyx_t_1 = 0; __pyx_t_1 < __pyx_t_4; __pyx_t_1+=1) {
14651 __pyx_v_i = __pyx_t_1;
14660 __pyx_v_j = ((__pyx_v_ndim - 1) - __pyx_v_i);
14669 __pyx_t_5 = (__pyx_v_strides[__pyx_v_j]);
14670 __pyx_t_6 = (__pyx_v_strides[__pyx_v_i]);
14671 (__pyx_v_strides[__pyx_v_i]) = __pyx_t_5;
14672 (__pyx_v_strides[__pyx_v_j]) = __pyx_t_6;
14681 __pyx_t_6 = (__pyx_v_shape[__pyx_v_j]);
14682 __pyx_t_5 = (__pyx_v_shape[__pyx_v_i]);
14683 (__pyx_v_shape[__pyx_v_i]) = __pyx_t_6;
14684 (__pyx_v_shape[__pyx_v_j]) = __pyx_t_5;
14693 __pyx_t_8 = (((__pyx_v_memslice->suboffsets[__pyx_v_i]) >= 0) != 0);
14696 __pyx_t_7 = __pyx_t_8;
14697 goto __pyx_L6_bool_binop_done;
14699 __pyx_t_8 = (((__pyx_v_memslice->suboffsets[__pyx_v_j]) >= 0) != 0);
14700 __pyx_t_7 = __pyx_t_8;
14701 __pyx_L6_bool_binop_done:;
14711 __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)
14745 PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
14747 __Pyx_AddTraceback(
"View.MemoryView.transpose_memslice", __pyx_clineno, __pyx_lineno, __pyx_filename);
14749 __Pyx_PyGILState_Release(__pyx_gilstate_save);
14766 static void __pyx_memoryviewslice___dealloc__(PyObject *__pyx_v_self);
14767 static void __pyx_memoryviewslice___dealloc__(PyObject *__pyx_v_self) {
14768 __Pyx_RefNannyDeclarations
14769 __Pyx_RefNannySetupContext(
"__dealloc__ (wrapper)", 0);
14770 __pyx_memoryviewslice___pyx_pf_15View_dot_MemoryView_16_memoryviewslice___dealloc__(((
struct __pyx_memoryviewslice_obj *)__pyx_v_self));
14773 __Pyx_RefNannyFinishContext();
14776 static void __pyx_memoryviewslice___pyx_pf_15View_dot_MemoryView_16_memoryviewslice___dealloc__(
struct __pyx_memoryviewslice_obj *__pyx_v_self) {
14777 __Pyx_RefNannyDeclarations
14778 __Pyx_RefNannySetupContext(
"__dealloc__", 0);
14787 __PYX_XDEC_MEMVIEW((&__pyx_v_self->from_slice), 1);
14798 __Pyx_RefNannyFinishContext();
14809 static PyObject *__pyx_memoryviewslice_convert_item_to_object(
struct __pyx_memoryviewslice_obj *__pyx_v_self,
char *__pyx_v_itemp) {
14810 PyObject *__pyx_r = NULL;
14811 __Pyx_RefNannyDeclarations
14813 PyObject *__pyx_t_2 = NULL;
14814 int __pyx_lineno = 0;
14815 const char *__pyx_filename = NULL;
14816 int __pyx_clineno = 0;
14817 __Pyx_RefNannySetupContext(
"convert_item_to_object", 0);
14826 __pyx_t_1 = ((__pyx_v_self->to_object_func != NULL) != 0);
14836 __Pyx_XDECREF(__pyx_r);
14837 __pyx_t_2 = __pyx_v_self->to_object_func(__pyx_v_itemp);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 981, __pyx_L1_error)
14838 __Pyx_GOTREF(__pyx_t_2);
14839 __pyx_r = __pyx_t_2;
14860 __Pyx_XDECREF(__pyx_r);
14861 __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)
14862 __Pyx_GOTREF(__pyx_t_2);
14863 __pyx_r = __pyx_t_2;
14878 __Pyx_XDECREF(__pyx_t_2);
14879 __Pyx_AddTraceback(
"View.MemoryView._memoryviewslice.convert_item_to_object", __pyx_clineno, __pyx_lineno, __pyx_filename);
14882 __Pyx_XGIVEREF(__pyx_r);
14883 __Pyx_RefNannyFinishContext();
14895 static PyObject *__pyx_memoryviewslice_assign_item_from_object(
struct __pyx_memoryviewslice_obj *__pyx_v_self,
char *__pyx_v_itemp, PyObject *__pyx_v_value) {
14896 PyObject *__pyx_r = NULL;
14897 __Pyx_RefNannyDeclarations
14900 PyObject *__pyx_t_3 = NULL;
14901 int __pyx_lineno = 0;
14902 const char *__pyx_filename = NULL;
14903 int __pyx_clineno = 0;
14904 __Pyx_RefNannySetupContext(
"assign_item_from_object", 0);
14913 __pyx_t_1 = ((__pyx_v_self->to_dtype_func != NULL) != 0);
14923 __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)
14943 __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)
14944 __Pyx_GOTREF(__pyx_t_3);
14945 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
14958 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
14961 __Pyx_XDECREF(__pyx_t_3);
14962 __Pyx_AddTraceback(
"View.MemoryView._memoryviewslice.assign_item_from_object", __pyx_clineno, __pyx_lineno, __pyx_filename);
14965 __Pyx_XGIVEREF(__pyx_r);
14966 __Pyx_RefNannyFinishContext();
14979 static PyObject *__pyx_pw_15View_dot_MemoryView_16_memoryviewslice_4base_1__get__(PyObject *__pyx_v_self);
14980 static PyObject *__pyx_pw_15View_dot_MemoryView_16_memoryviewslice_4base_1__get__(PyObject *__pyx_v_self) {
14981 PyObject *__pyx_r = 0;
14982 __Pyx_RefNannyDeclarations
14983 __Pyx_RefNannySetupContext(
"__get__ (wrapper)", 0);
14984 __pyx_r = __pyx_pf_15View_dot_MemoryView_16_memoryviewslice_4base___get__(((
struct __pyx_memoryviewslice_obj *)__pyx_v_self));
14987 __Pyx_RefNannyFinishContext();
14991 static PyObject *__pyx_pf_15View_dot_MemoryView_16_memoryviewslice_4base___get__(
struct __pyx_memoryviewslice_obj *__pyx_v_self) {
14992 PyObject *__pyx_r = NULL;
14993 __Pyx_RefNannyDeclarations
14994 __Pyx_RefNannySetupContext(
"__get__", 0);
15003 __Pyx_XDECREF(__pyx_r);
15004 __Pyx_INCREF(__pyx_v_self->from_object);
15005 __pyx_r = __pyx_v_self->from_object;
15018 __Pyx_XGIVEREF(__pyx_r);
15019 __Pyx_RefNannyFinishContext();
15030 static PyObject *__pyx_pw___pyx_memoryviewslice_1__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused);
15031 static PyObject *__pyx_pw___pyx_memoryviewslice_1__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
15032 PyObject *__pyx_r = 0;
15033 __Pyx_RefNannyDeclarations
15034 __Pyx_RefNannySetupContext(
"__reduce_cython__ (wrapper)", 0);
15035 __pyx_r = __pyx_pf___pyx_memoryviewslice___reduce_cython__(((
struct __pyx_memoryviewslice_obj *)__pyx_v_self));
15038 __Pyx_RefNannyFinishContext();
15042 static PyObject *__pyx_pf___pyx_memoryviewslice___reduce_cython__(CYTHON_UNUSED
struct __pyx_memoryviewslice_obj *__pyx_v_self) {
15043 PyObject *__pyx_r = NULL;
15044 __Pyx_RefNannyDeclarations
15045 PyObject *__pyx_t_1 = NULL;
15046 int __pyx_lineno = 0;
15047 const char *__pyx_filename = NULL;
15048 int __pyx_clineno = 0;
15049 __Pyx_RefNannySetupContext(
"__reduce_cython__", 0);
15057 __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)
15058 __Pyx_GOTREF(__pyx_t_1);
15059 __Pyx_Raise(__pyx_t_1, 0, 0, 0);
15060 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
15061 __PYX_ERR(0, 2, __pyx_L1_error)
15071 __Pyx_XDECREF(__pyx_t_1);
15072 __Pyx_AddTraceback(
"View.MemoryView._memoryviewslice.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
15074 __Pyx_XGIVEREF(__pyx_r);
15075 __Pyx_RefNannyFinishContext();
15087 static PyObject *__pyx_pw___pyx_memoryviewslice_3__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state);
15088 static PyObject *__pyx_pw___pyx_memoryviewslice_3__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
15089 PyObject *__pyx_r = 0;
15090 __Pyx_RefNannyDeclarations
15091 __Pyx_RefNannySetupContext(
"__setstate_cython__ (wrapper)", 0);
15092 __pyx_r = __pyx_pf___pyx_memoryviewslice_2__setstate_cython__(((
struct __pyx_memoryviewslice_obj *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state));
15095 __Pyx_RefNannyFinishContext();
15099 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) {
15100 PyObject *__pyx_r = NULL;
15101 __Pyx_RefNannyDeclarations
15102 PyObject *__pyx_t_1 = NULL;
15103 int __pyx_lineno = 0;
15104 const char *__pyx_filename = NULL;
15105 int __pyx_clineno = 0;
15106 __Pyx_RefNannySetupContext(
"__setstate_cython__", 0);
15113 __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)
15114 __Pyx_GOTREF(__pyx_t_1);
15115 __Pyx_Raise(__pyx_t_1, 0, 0, 0);
15116 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
15117 __PYX_ERR(0, 4, __pyx_L1_error)
15128 __Pyx_XDECREF(__pyx_t_1);
15129 __Pyx_AddTraceback(
"View.MemoryView._memoryviewslice.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
15131 __Pyx_XGIVEREF(__pyx_r);
15132 __Pyx_RefNannyFinishContext();
15144 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) {
15145 struct __pyx_memoryviewslice_obj *__pyx_v_result = 0;
15146 Py_ssize_t __pyx_v_suboffset;
15147 PyObject *__pyx_v_length = NULL;
15148 PyObject *__pyx_r = NULL;
15149 __Pyx_RefNannyDeclarations
15151 PyObject *__pyx_t_2 = NULL;
15152 PyObject *__pyx_t_3 = NULL;
15153 __Pyx_TypeInfo *__pyx_t_4;
15154 Py_buffer __pyx_t_5;
15155 Py_ssize_t *__pyx_t_6;
15156 Py_ssize_t *__pyx_t_7;
15157 Py_ssize_t *__pyx_t_8;
15158 Py_ssize_t __pyx_t_9;
15159 int __pyx_lineno = 0;
15160 const char *__pyx_filename = NULL;
15161 int __pyx_clineno = 0;
15162 __Pyx_RefNannySetupContext(
"memoryview_fromslice", 0);
15171 __pyx_t_1 = ((((PyObject *)__pyx_v_memviewslice.memview) == Py_None) != 0);
15181 __Pyx_XDECREF(__pyx_r);
15182 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
15201 __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_v_dtype_is_object);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1013, __pyx_L1_error)
15202 __Pyx_GOTREF(__pyx_t_2);
15203 __pyx_t_3 = PyTuple_New(3);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1013, __pyx_L1_error)
15204 __Pyx_GOTREF(__pyx_t_3);
15205 __Pyx_INCREF(Py_None);
15206 __Pyx_GIVEREF(Py_None);
15207 PyTuple_SET_ITEM(__pyx_t_3, 0, Py_None);
15208 __Pyx_INCREF(__pyx_int_0);
15209 __Pyx_GIVEREF(__pyx_int_0);
15210 PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_int_0);
15211 __Pyx_GIVEREF(__pyx_t_2);
15212 PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_t_2);
15214 __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)
15215 __Pyx_GOTREF(__pyx_t_2);
15216 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
15217 __pyx_v_result = ((
struct __pyx_memoryviewslice_obj *)__pyx_t_2);
15227 __pyx_v_result->from_slice = __pyx_v_memviewslice;
15236 __PYX_INC_MEMVIEW((&__pyx_v_memviewslice), 1);
15245 __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)
15246 __Pyx_GOTREF(__pyx_t_2);
15247 __Pyx_GIVEREF(__pyx_t_2);
15248 __Pyx_GOTREF(__pyx_v_result->from_object);
15249 __Pyx_DECREF(__pyx_v_result->from_object);
15250 __pyx_v_result->from_object = __pyx_t_2;
15260 __pyx_t_4 = __pyx_v_memviewslice.memview->typeinfo;
15261 __pyx_v_result->__pyx_base.typeinfo = __pyx_t_4;
15270 __pyx_t_5 = __pyx_v_memviewslice.memview->view;
15271 __pyx_v_result->__pyx_base.view = __pyx_t_5;
15280 __pyx_v_result->__pyx_base.view.buf = ((
void *)__pyx_v_memviewslice.data);
15289 __pyx_v_result->__pyx_base.view.ndim = __pyx_v_ndim;
15298 ((Py_buffer *)(&__pyx_v_result->__pyx_base.view))->obj = Py_None;
15307 Py_INCREF(Py_None);
15316 __pyx_t_1 = ((((
struct __pyx_memoryview_obj *)__pyx_v_memviewslice.memview)->flags & PyBUF_WRITABLE) != 0);
15326 __pyx_v_result->__pyx_base.flags = PyBUF_RECORDS;
15346 __pyx_v_result->__pyx_base.flags = PyBUF_RECORDS_RO;
15357 __pyx_v_result->__pyx_base.view.shape = ((Py_ssize_t *)__pyx_v_result->from_slice.shape);
15366 __pyx_v_result->__pyx_base.view.strides = ((Py_ssize_t *)__pyx_v_result->from_slice.strides);
15375 __pyx_v_result->__pyx_base.view.suboffsets = NULL;
15384 __pyx_t_7 = (__pyx_v_result->from_slice.suboffsets + __pyx_v_ndim);
15385 for (__pyx_t_8 = __pyx_v_result->from_slice.suboffsets; __pyx_t_8 < __pyx_t_7; __pyx_t_8++) {
15386 __pyx_t_6 = __pyx_t_8;
15387 __pyx_v_suboffset = (__pyx_t_6[0]);
15396 __pyx_t_1 = ((__pyx_v_suboffset >= 0) != 0);
15406 __pyx_v_result->__pyx_base.view.suboffsets = ((Py_ssize_t *)__pyx_v_result->from_slice.suboffsets);
15415 goto __pyx_L6_break;
15435 __pyx_t_9 = __pyx_v_result->__pyx_base.view.itemsize;
15436 __pyx_v_result->__pyx_base.view.len = __pyx_t_9;
15445 __pyx_t_7 = (__pyx_v_result->__pyx_base.view.shape + __pyx_v_ndim);
15446 for (__pyx_t_8 = __pyx_v_result->__pyx_base.view.shape; __pyx_t_8 < __pyx_t_7; __pyx_t_8++) {
15447 __pyx_t_6 = __pyx_t_8;
15448 __pyx_t_2 = PyInt_FromSsize_t((__pyx_t_6[0]));
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1043, __pyx_L1_error)
15449 __Pyx_GOTREF(__pyx_t_2);
15450 __Pyx_XDECREF_SET(__pyx_v_length, __pyx_t_2);
15460 __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)
15461 __Pyx_GOTREF(__pyx_t_2);
15462 __pyx_t_3 = PyNumber_InPlaceMultiply(__pyx_t_2, __pyx_v_length);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1044, __pyx_L1_error)
15463 __Pyx_GOTREF(__pyx_t_3);
15464 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
15465 __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)
15466 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
15467 __pyx_v_result->__pyx_base.view.len = __pyx_t_9;
15477 __pyx_v_result->to_object_func = __pyx_v_to_object_func;
15486 __pyx_v_result->to_dtype_func = __pyx_v_to_dtype_func;
15495 __Pyx_XDECREF(__pyx_r);
15496 __Pyx_INCREF(((PyObject *)__pyx_v_result));
15497 __pyx_r = ((PyObject *)__pyx_v_result);
15510 __Pyx_XDECREF(__pyx_t_2);
15511 __Pyx_XDECREF(__pyx_t_3);
15512 __Pyx_AddTraceback(
"View.MemoryView.memoryview_fromslice", __pyx_clineno, __pyx_lineno, __pyx_filename);
15515 __Pyx_XDECREF((PyObject *)__pyx_v_result);
15516 __Pyx_XDECREF(__pyx_v_length);
15517 __Pyx_XGIVEREF(__pyx_r);
15518 __Pyx_RefNannyFinishContext();
15530 static __Pyx_memviewslice *__pyx_memoryview_get_slice_from_memoryview(
struct __pyx_memoryview_obj *__pyx_v_memview, __Pyx_memviewslice *__pyx_v_mslice) {
15531 struct __pyx_memoryviewslice_obj *__pyx_v_obj = 0;
15532 __Pyx_memviewslice *__pyx_r;
15533 __Pyx_RefNannyDeclarations
15536 PyObject *__pyx_t_3 = NULL;
15537 int __pyx_lineno = 0;
15538 const char *__pyx_filename = NULL;
15539 int __pyx_clineno = 0;
15540 __Pyx_RefNannySetupContext(
"get_slice_from_memview", 0);
15549 __pyx_t_1 = __Pyx_TypeCheck(((PyObject *)__pyx_v_memview), __pyx_memoryviewslice_type);
15550 __pyx_t_2 = (__pyx_t_1 != 0);
15560 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)
15561 __pyx_t_3 = ((PyObject *)__pyx_v_memview);
15562 __Pyx_INCREF(__pyx_t_3);
15563 __pyx_v_obj = ((
struct __pyx_memoryviewslice_obj *)__pyx_t_3);
15573 __pyx_r = (&__pyx_v_obj->from_slice);
15593 __pyx_memoryview_slice_copy(__pyx_v_memview, __pyx_v_mslice);
15602 __pyx_r = __pyx_v_mslice;
15616 __Pyx_XDECREF(__pyx_t_3);
15617 __Pyx_AddTraceback(
"View.MemoryView.get_slice_from_memview", __pyx_clineno, __pyx_lineno, __pyx_filename);
15620 __Pyx_XDECREF((PyObject *)__pyx_v_obj);
15621 __Pyx_RefNannyFinishContext();
15633 static void __pyx_memoryview_slice_copy(
struct __pyx_memoryview_obj *__pyx_v_memview, __Pyx_memviewslice *__pyx_v_dst) {
15635 Py_ssize_t *__pyx_v_shape;
15636 Py_ssize_t *__pyx_v_strides;
15637 Py_ssize_t *__pyx_v_suboffsets;
15638 __Pyx_RefNannyDeclarations
15639 Py_ssize_t *__pyx_t_1;
15643 Py_ssize_t __pyx_t_5;
15644 __Pyx_RefNannySetupContext(
"slice_copy", 0);
15653 __pyx_t_1 = __pyx_v_memview->view.shape;
15654 __pyx_v_shape = __pyx_t_1;
15663 __pyx_t_1 = __pyx_v_memview->view.strides;
15664 __pyx_v_strides = __pyx_t_1;
15673 __pyx_t_1 = __pyx_v_memview->view.suboffsets;
15674 __pyx_v_suboffsets = __pyx_t_1;
15683 __pyx_v_dst->memview = ((
struct __pyx_memoryview_obj *)__pyx_v_memview);
15692 __pyx_v_dst->data = ((
char *)__pyx_v_memview->view.buf);
15701 __pyx_t_2 = __pyx_v_memview->view.ndim;
15702 __pyx_t_3 = __pyx_t_2;
15703 for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
15704 __pyx_v_dim = __pyx_t_4;
15713 (__pyx_v_dst->shape[__pyx_v_dim]) = (__pyx_v_shape[__pyx_v_dim]);
15722 (__pyx_v_dst->strides[__pyx_v_dim]) = (__pyx_v_strides[__pyx_v_dim]);
15731 if ((__pyx_v_suboffsets != 0)) {
15732 __pyx_t_5 = (__pyx_v_suboffsets[__pyx_v_dim]);
15736 (__pyx_v_dst->suboffsets[__pyx_v_dim]) = __pyx_t_5;
15748 __Pyx_RefNannyFinishContext();
15759 static PyObject *__pyx_memoryview_copy_object(
struct __pyx_memoryview_obj *__pyx_v_memview) {
15760 __Pyx_memviewslice __pyx_v_memviewslice;
15761 PyObject *__pyx_r = NULL;
15762 __Pyx_RefNannyDeclarations
15763 PyObject *__pyx_t_1 = NULL;
15764 int __pyx_lineno = 0;
15765 const char *__pyx_filename = NULL;
15766 int __pyx_clineno = 0;
15767 __Pyx_RefNannySetupContext(
"memoryview_copy", 0);
15776 __pyx_memoryview_slice_copy(__pyx_v_memview, (&__pyx_v_memviewslice));
15785 __Pyx_XDECREF(__pyx_r);
15786 __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)
15787 __Pyx_GOTREF(__pyx_t_1);
15788 __pyx_r = __pyx_t_1;
15802 __Pyx_XDECREF(__pyx_t_1);
15803 __Pyx_AddTraceback(
"View.MemoryView.memoryview_copy", __pyx_clineno, __pyx_lineno, __pyx_filename);
15806 __Pyx_XGIVEREF(__pyx_r);
15807 __Pyx_RefNannyFinishContext();
15819 static PyObject *__pyx_memoryview_copy_object_from_slice(
struct __pyx_memoryview_obj *__pyx_v_memview, __Pyx_memviewslice *__pyx_v_memviewslice) {
15820 PyObject *(*__pyx_v_to_object_func)(
char *);
15821 int (*__pyx_v_to_dtype_func)(
char *, PyObject *);
15822 PyObject *__pyx_r = NULL;
15823 __Pyx_RefNannyDeclarations
15826 PyObject *(*__pyx_t_3)(
char *);
15827 int (*__pyx_t_4)(
char *, PyObject *);
15828 PyObject *__pyx_t_5 = NULL;
15829 int __pyx_lineno = 0;
15830 const char *__pyx_filename = NULL;
15831 int __pyx_clineno = 0;
15832 __Pyx_RefNannySetupContext(
"memoryview_copy_from_slice", 0);
15841 __pyx_t_1 = __Pyx_TypeCheck(((PyObject *)__pyx_v_memview), __pyx_memoryviewslice_type);
15842 __pyx_t_2 = (__pyx_t_1 != 0);
15852 __pyx_t_3 = ((
struct __pyx_memoryviewslice_obj *)__pyx_v_memview)->to_object_func;
15853 __pyx_v_to_object_func = __pyx_t_3;
15862 __pyx_t_4 = ((
struct __pyx_memoryviewslice_obj *)__pyx_v_memview)->to_dtype_func;
15863 __pyx_v_to_dtype_func = __pyx_t_4;
15883 __pyx_v_to_object_func = NULL;
15892 __pyx_v_to_dtype_func = NULL;
15903 __Pyx_XDECREF(__pyx_r);
15912 __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)
15913 __Pyx_GOTREF(__pyx_t_5);
15914 __pyx_r = __pyx_t_5;
15928 __Pyx_XDECREF(__pyx_t_5);
15929 __Pyx_AddTraceback(
"View.MemoryView.memoryview_copy_from_slice", __pyx_clineno, __pyx_lineno, __pyx_filename);
15932 __Pyx_XGIVEREF(__pyx_r);
15933 __Pyx_RefNannyFinishContext();
15945 static Py_ssize_t abs_py_ssize_t(Py_ssize_t __pyx_v_arg) {
15946 Py_ssize_t __pyx_r;
15956 __pyx_t_1 = ((__pyx_v_arg < 0) != 0);
15966 __pyx_r = (-__pyx_v_arg);
15986 __pyx_r = __pyx_v_arg;
16011 static char __pyx_get_best_slice_order(__Pyx_memviewslice *__pyx_v_mslice,
int __pyx_v_ndim) {
16013 Py_ssize_t __pyx_v_c_stride;
16014 Py_ssize_t __pyx_v_f_stride;
16028 __pyx_v_c_stride = 0;
16037 __pyx_v_f_stride = 0;
16046 for (__pyx_t_1 = (__pyx_v_ndim - 1); __pyx_t_1 > -1; __pyx_t_1-=1) {
16047 __pyx_v_i = __pyx_t_1;
16056 __pyx_t_2 = (((__pyx_v_mslice->shape[__pyx_v_i]) > 1) != 0);
16066 __pyx_v_c_stride = (__pyx_v_mslice->strides[__pyx_v_i]);
16075 goto __pyx_L4_break;
16095 __pyx_t_1 = __pyx_v_ndim;
16096 __pyx_t_3 = __pyx_t_1;
16097 for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
16098 __pyx_v_i = __pyx_t_4;
16107 __pyx_t_2 = (((__pyx_v_mslice->shape[__pyx_v_i]) > 1) != 0);
16117 __pyx_v_f_stride = (__pyx_v_mslice->strides[__pyx_v_i]);
16126 goto __pyx_L7_break;
16146 __pyx_t_2 = ((abs_py_ssize_t(__pyx_v_c_stride) <= abs_py_ssize_t(__pyx_v_f_stride)) != 0);
16201 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) {
16202 CYTHON_UNUSED Py_ssize_t __pyx_v_i;
16203 CYTHON_UNUSED Py_ssize_t __pyx_v_src_extent;
16204 Py_ssize_t __pyx_v_dst_extent;
16205 Py_ssize_t __pyx_v_src_stride;
16206 Py_ssize_t __pyx_v_dst_stride;
16210 Py_ssize_t __pyx_t_4;
16211 Py_ssize_t __pyx_t_5;
16212 Py_ssize_t __pyx_t_6;
16221 __pyx_v_src_extent = (__pyx_v_src_shape[0]);
16230 __pyx_v_dst_extent = (__pyx_v_dst_shape[0]);
16239 __pyx_v_src_stride = (__pyx_v_src_strides[0]);
16248 __pyx_v_dst_stride = (__pyx_v_dst_strides[0]);
16257 __pyx_t_1 = ((__pyx_v_ndim == 1) != 0);
16267 __pyx_t_2 = ((__pyx_v_src_stride > 0) != 0);
16270 __pyx_t_1 = __pyx_t_2;
16271 goto __pyx_L5_bool_binop_done;
16273 __pyx_t_2 = ((__pyx_v_dst_stride > 0) != 0);
16276 __pyx_t_1 = __pyx_t_2;
16277 goto __pyx_L5_bool_binop_done;
16287 __pyx_t_2 = (((size_t)__pyx_v_src_stride) == __pyx_v_itemsize);
16289 __pyx_t_2 = (__pyx_v_itemsize == ((size_t)__pyx_v_dst_stride));
16291 __pyx_t_3 = (__pyx_t_2 != 0);
16292 __pyx_t_1 = __pyx_t_3;
16293 __pyx_L5_bool_binop_done:;
16311 (void)(memcpy(__pyx_v_dst_data, __pyx_v_src_data, (__pyx_v_itemsize * __pyx_v_dst_extent)));
16331 __pyx_t_4 = __pyx_v_dst_extent;
16332 __pyx_t_5 = __pyx_t_4;
16333 for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) {
16334 __pyx_v_i = __pyx_t_6;
16343 (void)(memcpy(__pyx_v_dst_data, __pyx_v_src_data, __pyx_v_itemsize));
16352 __pyx_v_src_data = (__pyx_v_src_data + __pyx_v_src_stride);
16361 __pyx_v_dst_data = (__pyx_v_dst_data + __pyx_v_dst_stride);
16384 __pyx_t_4 = __pyx_v_dst_extent;
16385 __pyx_t_5 = __pyx_t_4;
16386 for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) {
16387 __pyx_v_i = __pyx_t_6;
16396 _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);
16405 __pyx_v_src_data = (__pyx_v_src_data + __pyx_v_src_stride);
16414 __pyx_v_dst_data = (__pyx_v_dst_data + __pyx_v_dst_stride);
16438 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) {
16447 _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);
16468 static Py_ssize_t __pyx_memoryview_slice_get_size(__Pyx_memviewslice *__pyx_v_src,
int __pyx_v_ndim) {
16469 Py_ssize_t __pyx_v_shape;
16470 Py_ssize_t __pyx_v_size;
16471 Py_ssize_t __pyx_r;
16472 Py_ssize_t __pyx_t_1;
16473 Py_ssize_t *__pyx_t_2;
16474 Py_ssize_t *__pyx_t_3;
16475 Py_ssize_t *__pyx_t_4;
16484 __pyx_t_1 = __pyx_v_src->memview->view.itemsize;
16485 __pyx_v_size = __pyx_t_1;
16494 __pyx_t_3 = (__pyx_v_src->shape + __pyx_v_ndim);
16495 for (__pyx_t_4 = __pyx_v_src->shape; __pyx_t_4 < __pyx_t_3; __pyx_t_4++) {
16496 __pyx_t_2 = __pyx_t_4;
16497 __pyx_v_shape = (__pyx_t_2[0]);
16506 __pyx_v_size = (__pyx_v_size * __pyx_v_shape);
16516 __pyx_r = __pyx_v_size;
16540 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) {
16542 Py_ssize_t __pyx_r;
16555 __pyx_t_1 = ((__pyx_v_order ==
'F') != 0);
16565 __pyx_t_2 = __pyx_v_ndim;
16566 __pyx_t_3 = __pyx_t_2;
16567 for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
16568 __pyx_v_idx = __pyx_t_4;
16577 (__pyx_v_strides[__pyx_v_idx]) = __pyx_v_stride;
16586 __pyx_v_stride = (__pyx_v_stride * (__pyx_v_shape[__pyx_v_idx]));
16607 for (__pyx_t_2 = (__pyx_v_ndim - 1); __pyx_t_2 > -1; __pyx_t_2-=1) {
16608 __pyx_v_idx = __pyx_t_2;
16617 (__pyx_v_strides[__pyx_v_idx]) = __pyx_v_stride;
16626 __pyx_v_stride = (__pyx_v_stride * (__pyx_v_shape[__pyx_v_idx]));
16638 __pyx_r = __pyx_v_stride;
16662 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) {
16664 void *__pyx_v_result;
16665 size_t __pyx_v_itemsize;
16666 size_t __pyx_v_size;
16668 Py_ssize_t __pyx_t_1;
16671 struct __pyx_memoryview_obj *__pyx_t_4;
16674 int __pyx_lineno = 0;
16675 const char *__pyx_filename = NULL;
16676 int __pyx_clineno = 0;
16685 __pyx_t_1 = __pyx_v_src->memview->view.itemsize;
16686 __pyx_v_itemsize = __pyx_t_1;
16695 __pyx_v_size = __pyx_memoryview_slice_get_size(__pyx_v_src, __pyx_v_ndim);
16704 __pyx_v_result = malloc(__pyx_v_size);
16713 __pyx_t_2 = ((!(__pyx_v_result != 0)) != 0);
16723 __pyx_t_3 = __pyx_memoryview_err(__pyx_builtin_MemoryError, NULL);
if (unlikely(__pyx_t_3 == ((
int)-1))) __PYX_ERR(0, 1224, __pyx_L1_error)
16741 __pyx_v_tmpslice->data = ((
char *)__pyx_v_result);
16750 __pyx_t_4 = __pyx_v_src->memview;
16751 __pyx_v_tmpslice->memview = __pyx_t_4;
16760 __pyx_t_3 = __pyx_v_ndim;
16761 __pyx_t_5 = __pyx_t_3;
16762 for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) {
16763 __pyx_v_i = __pyx_t_6;
16772 (__pyx_v_tmpslice->shape[__pyx_v_i]) = (__pyx_v_src->shape[__pyx_v_i]);
16781 (__pyx_v_tmpslice->suboffsets[__pyx_v_i]) = -1
L;
16791 (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));
16800 __pyx_t_3 = __pyx_v_ndim;
16801 __pyx_t_5 = __pyx_t_3;
16802 for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) {
16803 __pyx_v_i = __pyx_t_6;
16812 __pyx_t_2 = (((__pyx_v_tmpslice->shape[__pyx_v_i]) == 1) != 0);
16822 (__pyx_v_tmpslice->strides[__pyx_v_i]) = 0;
16841 __pyx_t_2 = (__pyx_memviewslice_is_contig((__pyx_v_src[0]), __pyx_v_order, __pyx_v_ndim) != 0);
16851 (void)(memcpy(__pyx_v_result, __pyx_v_src->data, __pyx_v_size));
16871 copy_strided_to_strided(__pyx_v_src, __pyx_v_tmpslice, __pyx_v_ndim, __pyx_v_itemsize);
16882 __pyx_r = __pyx_v_result;
16897 PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
16899 __Pyx_AddTraceback(
"View.MemoryView.copy_data_to_temp", __pyx_clineno, __pyx_lineno, __pyx_filename);
16901 __Pyx_PyGILState_Release(__pyx_gilstate_save);
16917 static int __pyx_memoryview_err_extents(
int __pyx_v_i, Py_ssize_t __pyx_v_extent1, Py_ssize_t __pyx_v_extent2) {
16919 __Pyx_RefNannyDeclarations
16920 PyObject *__pyx_t_1 = NULL;
16921 PyObject *__pyx_t_2 = NULL;
16922 PyObject *__pyx_t_3 = NULL;
16923 PyObject *__pyx_t_4 = NULL;
16924 int __pyx_lineno = 0;
16925 const char *__pyx_filename = NULL;
16926 int __pyx_clineno = 0;
16928 PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
16930 __Pyx_RefNannySetupContext(
"_err_extents", 0);
16939 __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_i);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1254, __pyx_L1_error)
16940 __Pyx_GOTREF(__pyx_t_1);
16941 __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_extent1);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1254, __pyx_L1_error)
16942 __Pyx_GOTREF(__pyx_t_2);
16943 __pyx_t_3 = PyInt_FromSsize_t(__pyx_v_extent2);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1254, __pyx_L1_error)
16944 __Pyx_GOTREF(__pyx_t_3);
16945 __pyx_t_4 = PyTuple_New(3);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1254, __pyx_L1_error)
16946 __Pyx_GOTREF(__pyx_t_4);
16947 __Pyx_GIVEREF(__pyx_t_1);
16948 PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_1);
16949 __Pyx_GIVEREF(__pyx_t_2);
16950 PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_2);
16951 __Pyx_GIVEREF(__pyx_t_3);
16952 PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_t_3);
16964 __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)
16965 __Pyx_GOTREF(__pyx_t_3);
16966 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
16967 __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_3);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1253, __pyx_L1_error)
16968 __Pyx_GOTREF(__pyx_t_4);
16969 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
16970 __Pyx_Raise(__pyx_t_4, 0, 0, 0);
16971 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
16972 __PYX_ERR(0, 1253, __pyx_L1_error)
16984 __Pyx_XDECREF(__pyx_t_1);
16985 __Pyx_XDECREF(__pyx_t_2);
16986 __Pyx_XDECREF(__pyx_t_3);
16987 __Pyx_XDECREF(__pyx_t_4);
16988 __Pyx_AddTraceback(
"View.MemoryView._err_extents", __pyx_clineno, __pyx_lineno, __pyx_filename);
16990 __Pyx_RefNannyFinishContext();
16992 __Pyx_PyGILState_Release(__pyx_gilstate_save);
17005 static int __pyx_memoryview_err_dim(PyObject *__pyx_v_error,
char *__pyx_v_msg,
int __pyx_v_dim) {
17007 __Pyx_RefNannyDeclarations
17008 PyObject *__pyx_t_1 = NULL;
17009 PyObject *__pyx_t_2 = NULL;
17010 PyObject *__pyx_t_3 = NULL;
17011 PyObject *__pyx_t_4 = NULL;
17012 int __pyx_lineno = 0;
17013 const char *__pyx_filename = NULL;
17014 int __pyx_clineno = 0;
17016 PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
17018 __Pyx_RefNannySetupContext(
"_err_dim", 0);
17019 __Pyx_INCREF(__pyx_v_error);
17028 __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)
17029 __Pyx_GOTREF(__pyx_t_2);
17030 __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_dim);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1258, __pyx_L1_error)
17031 __Pyx_GOTREF(__pyx_t_3);
17032 __pyx_t_4 = PyUnicode_Format(__pyx_t_2, __pyx_t_3);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1258, __pyx_L1_error)
17033 __Pyx_GOTREF(__pyx_t_4);
17034 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
17035 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
17036 __Pyx_INCREF(__pyx_v_error);
17037 __pyx_t_3 = __pyx_v_error; __pyx_t_2 = NULL;
17038 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
17039 __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
17040 if (likely(__pyx_t_2)) {
17041 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_3);
17042 __Pyx_INCREF(__pyx_t_2);
17043 __Pyx_INCREF(
function);
17044 __Pyx_DECREF_SET(__pyx_t_3,
function);
17047 __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);
17048 __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
17049 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
17050 if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1258, __pyx_L1_error)
17051 __Pyx_GOTREF(__pyx_t_1);
17052 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
17053 __Pyx_Raise(__pyx_t_1, 0, 0, 0);
17054 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
17055 __PYX_ERR(0, 1258, __pyx_L1_error)
17067 __Pyx_XDECREF(__pyx_t_1);
17068 __Pyx_XDECREF(__pyx_t_2);
17069 __Pyx_XDECREF(__pyx_t_3);
17070 __Pyx_XDECREF(__pyx_t_4);
17071 __Pyx_AddTraceback(
"View.MemoryView._err_dim", __pyx_clineno, __pyx_lineno, __pyx_filename);
17073 __Pyx_XDECREF(__pyx_v_error);
17074 __Pyx_RefNannyFinishContext();
17076 __Pyx_PyGILState_Release(__pyx_gilstate_save);
17089 static int __pyx_memoryview_err(PyObject *__pyx_v_error,
char *__pyx_v_msg) {
17091 __Pyx_RefNannyDeclarations
17093 PyObject *__pyx_t_2 = NULL;
17094 PyObject *__pyx_t_3 = NULL;
17095 PyObject *__pyx_t_4 = NULL;
17096 PyObject *__pyx_t_5 = NULL;
17097 int __pyx_lineno = 0;
17098 const char *__pyx_filename = NULL;
17099 int __pyx_clineno = 0;
17101 PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
17103 __Pyx_RefNannySetupContext(
"_err", 0);
17104 __Pyx_INCREF(__pyx_v_error);
17113 __pyx_t_1 = ((__pyx_v_msg != NULL) != 0);
17114 if (unlikely(__pyx_t_1)) {
17123 __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)
17124 __Pyx_GOTREF(__pyx_t_3);
17125 __Pyx_INCREF(__pyx_v_error);
17126 __pyx_t_4 = __pyx_v_error; __pyx_t_5 = NULL;
17127 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
17128 __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
17129 if (likely(__pyx_t_5)) {
17130 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_4);
17131 __Pyx_INCREF(__pyx_t_5);
17132 __Pyx_INCREF(
function);
17133 __Pyx_DECREF_SET(__pyx_t_4,
function);
17136 __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);
17137 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
17138 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
17139 if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1263, __pyx_L1_error)
17140 __Pyx_GOTREF(__pyx_t_2);
17141 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
17142 __Pyx_Raise(__pyx_t_2, 0, 0, 0);
17143 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
17144 __PYX_ERR(0, 1263, __pyx_L1_error)
17163 __Pyx_Raise(__pyx_v_error, 0, 0, 0);
17164 __PYX_ERR(0, 1265, __pyx_L1_error)
17177 __Pyx_XDECREF(__pyx_t_2);
17178 __Pyx_XDECREF(__pyx_t_3);
17179 __Pyx_XDECREF(__pyx_t_4);
17180 __Pyx_XDECREF(__pyx_t_5);
17181 __Pyx_AddTraceback(
"View.MemoryView._err", __pyx_clineno, __pyx_lineno, __pyx_filename);
17183 __Pyx_XDECREF(__pyx_v_error);
17184 __Pyx_RefNannyFinishContext();
17186 __Pyx_PyGILState_Release(__pyx_gilstate_save);
17199 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) {
17200 void *__pyx_v_tmpdata;
17201 size_t __pyx_v_itemsize;
17203 char __pyx_v_order;
17204 int __pyx_v_broadcasting;
17205 int __pyx_v_direct_copy;
17206 __Pyx_memviewslice __pyx_v_tmp;
17209 Py_ssize_t __pyx_t_1;
17217 int __pyx_lineno = 0;
17218 const char *__pyx_filename = NULL;
17219 int __pyx_clineno = 0;
17228 __pyx_v_tmpdata = NULL;
17237 __pyx_t_1 = __pyx_v_src.memview->view.itemsize;
17238 __pyx_v_itemsize = __pyx_t_1;
17247 __pyx_v_order = __pyx_get_best_slice_order((&__pyx_v_src), __pyx_v_src_ndim);
17256 __pyx_v_broadcasting = 0;
17265 __pyx_v_direct_copy = 0;
17274 __pyx_t_2 = ((__pyx_v_src_ndim < __pyx_v_dst_ndim) != 0);
17284 __pyx_memoryview_broadcast_leading((&__pyx_v_src), __pyx_v_src_ndim, __pyx_v_dst_ndim);
17303 __pyx_t_2 = ((__pyx_v_dst_ndim < __pyx_v_src_ndim) != 0);
17313 __pyx_memoryview_broadcast_leading((&__pyx_v_dst), __pyx_v_dst_ndim, __pyx_v_src_ndim);
17332 __pyx_t_3 = __pyx_v_dst_ndim;
17333 __pyx_t_4 = __pyx_v_src_ndim;
17334 if (((__pyx_t_3 > __pyx_t_4) != 0)) {
17335 __pyx_t_5 = __pyx_t_3;
17337 __pyx_t_5 = __pyx_t_4;
17339 __pyx_v_ndim = __pyx_t_5;
17348 __pyx_t_5 = __pyx_v_ndim;
17349 __pyx_t_3 = __pyx_t_5;
17350 for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
17351 __pyx_v_i = __pyx_t_4;
17360 __pyx_t_2 = (((__pyx_v_src.shape[__pyx_v_i]) != (__pyx_v_dst.shape[__pyx_v_i])) != 0);
17370 __pyx_t_2 = (((__pyx_v_src.shape[__pyx_v_i]) == 1) != 0);
17380 __pyx_v_broadcasting = 1;
17389 (__pyx_v_src.strides[__pyx_v_i]) = 0;
17409 __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)
17429 __pyx_t_2 = (((__pyx_v_src.suboffsets[__pyx_v_i]) >= 0) != 0);
17439 __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)
17458 __pyx_t_2 = (__pyx_slices_overlap((&__pyx_v_src), (&__pyx_v_dst), __pyx_v_ndim, __pyx_v_itemsize) != 0);
17468 __pyx_t_2 = ((!(__pyx_memviewslice_is_contig(__pyx_v_src, __pyx_v_order, __pyx_v_ndim) != 0)) != 0);
17478 __pyx_v_order = __pyx_get_best_slice_order((&__pyx_v_dst), __pyx_v_ndim);
17496 __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)
17497 __pyx_v_tmpdata = __pyx_t_7;
17506 __pyx_v_src = __pyx_v_tmp;
17524 __pyx_t_2 = ((!(__pyx_v_broadcasting != 0)) != 0);
17534 __pyx_t_2 = (__pyx_memviewslice_is_contig(__pyx_v_src,
'C', __pyx_v_ndim) != 0);
17544 __pyx_v_direct_copy = __pyx_memviewslice_is_contig(__pyx_v_dst,
'C', __pyx_v_ndim);
17563 __pyx_t_2 = (__pyx_memviewslice_is_contig(__pyx_v_src,
'F', __pyx_v_ndim) != 0);
17573 __pyx_v_direct_copy = __pyx_memviewslice_is_contig(__pyx_v_dst,
'F', __pyx_v_ndim);
17592 __pyx_t_2 = (__pyx_v_direct_copy != 0);
17602 __pyx_memoryview_refcount_copying((&__pyx_v_dst), __pyx_v_dtype_is_object, __pyx_v_ndim, 0);
17611 (void)(memcpy(__pyx_v_dst.data, __pyx_v_src.data, __pyx_memoryview_slice_get_size((&__pyx_v_src), __pyx_v_ndim)));
17620 __pyx_memoryview_refcount_copying((&__pyx_v_dst), __pyx_v_dtype_is_object, __pyx_v_ndim, 1);
17629 free(__pyx_v_tmpdata);
17666 __pyx_t_2 = (__pyx_v_order ==
'F');
17668 __pyx_t_2 = (
'F' == __pyx_get_best_slice_order((&__pyx_v_dst), __pyx_v_ndim));
17670 __pyx_t_8 = (__pyx_t_2 != 0);
17680 __pyx_t_5 = __pyx_memslice_transpose((&__pyx_v_src));
if (unlikely(__pyx_t_5 == ((
int)0))) __PYX_ERR(0, 1329, __pyx_L1_error)
17689 __pyx_t_5 = __pyx_memslice_transpose((&__pyx_v_dst));
if (unlikely(__pyx_t_5 == ((
int)0))) __PYX_ERR(0, 1330, __pyx_L1_error)
17707 __pyx_memoryview_refcount_copying((&__pyx_v_dst), __pyx_v_dtype_is_object, __pyx_v_ndim, 0);
17716 copy_strided_to_strided((&__pyx_v_src), (&__pyx_v_dst), __pyx_v_ndim, __pyx_v_itemsize);
17725 __pyx_memoryview_refcount_copying((&__pyx_v_dst), __pyx_v_dtype_is_object, __pyx_v_ndim, 1);
17734 free(__pyx_v_tmpdata);
17758 PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
17760 __Pyx_AddTraceback(
"View.MemoryView.memoryview_copy_contents", __pyx_clineno, __pyx_lineno, __pyx_filename);
17762 __Pyx_PyGILState_Release(__pyx_gilstate_save);
17778 static void __pyx_memoryview_broadcast_leading(__Pyx_memviewslice *__pyx_v_mslice,
int __pyx_v_ndim,
int __pyx_v_ndim_other) {
17780 int __pyx_v_offset;
17792 __pyx_v_offset = (__pyx_v_ndim_other - __pyx_v_ndim);
17801 for (__pyx_t_1 = (__pyx_v_ndim - 1); __pyx_t_1 > -1; __pyx_t_1-=1) {
17802 __pyx_v_i = __pyx_t_1;
17811 (__pyx_v_mslice->shape[(__pyx_v_i + __pyx_v_offset)]) = (__pyx_v_mslice->shape[__pyx_v_i]);
17820 (__pyx_v_mslice->strides[(__pyx_v_i + __pyx_v_offset)]) = (__pyx_v_mslice->strides[__pyx_v_i]);
17829 (__pyx_v_mslice->suboffsets[(__pyx_v_i + __pyx_v_offset)]) = (__pyx_v_mslice->suboffsets[__pyx_v_i]);
17839 __pyx_t_1 = __pyx_v_offset;
17840 __pyx_t_2 = __pyx_t_1;
17841 for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) {
17842 __pyx_v_i = __pyx_t_3;
17851 (__pyx_v_mslice->shape[__pyx_v_i]) = 1;
17860 (__pyx_v_mslice->strides[__pyx_v_i]) = (__pyx_v_mslice->strides[0]);
17869 (__pyx_v_mslice->suboffsets[__pyx_v_i]) = -1
L;
17891 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) {
17901 __pyx_t_1 = (__pyx_v_dtype_is_object != 0);
17911 __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);
17941 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) {
17942 __Pyx_RefNannyDeclarations
17944 PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
17946 __Pyx_RefNannySetupContext(
"refcount_objects_in_slice_with_gil", 0);
17955 __pyx_memoryview_refcount_objects_in_slice(__pyx_v_data, __pyx_v_shape, __pyx_v_strides, __pyx_v_ndim, __pyx_v_inc);
17966 __Pyx_RefNannyFinishContext();
17968 __Pyx_PyGILState_Release(__pyx_gilstate_save);
17980 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) {
17981 CYTHON_UNUSED Py_ssize_t __pyx_v_i;
17982 __Pyx_RefNannyDeclarations
17983 Py_ssize_t __pyx_t_1;
17984 Py_ssize_t __pyx_t_2;
17985 Py_ssize_t __pyx_t_3;
17987 __Pyx_RefNannySetupContext(
"refcount_objects_in_slice", 0);
17996 __pyx_t_1 = (__pyx_v_shape[0]);
17997 __pyx_t_2 = __pyx_t_1;
17998 for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) {
17999 __pyx_v_i = __pyx_t_3;
18008 __pyx_t_4 = ((__pyx_v_ndim == 1) != 0);
18018 __pyx_t_4 = (__pyx_v_inc != 0);
18028 Py_INCREF((((PyObject **)__pyx_v_data)[0]));
18048 Py_DECREF((((PyObject **)__pyx_v_data)[0]));
18078 __pyx_memoryview_refcount_objects_in_slice(__pyx_v_data, (__pyx_v_shape + 1), (__pyx_v_strides + 1), (__pyx_v_ndim - 1), __pyx_v_inc);
18089 __pyx_v_data = (__pyx_v_data + (__pyx_v_strides[0]));
18101 __Pyx_RefNannyFinishContext();
18112 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) {
18121 __pyx_memoryview_refcount_copying(__pyx_v_dst, __pyx_v_dtype_is_object, __pyx_v_ndim, 0);
18130 __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);
18139 __pyx_memoryview_refcount_copying(__pyx_v_dst, __pyx_v_dtype_is_object, __pyx_v_ndim, 1);
18160 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) {
18161 CYTHON_UNUSED Py_ssize_t __pyx_v_i;
18162 Py_ssize_t __pyx_v_stride;
18163 Py_ssize_t __pyx_v_extent;
18165 Py_ssize_t __pyx_t_2;
18166 Py_ssize_t __pyx_t_3;
18167 Py_ssize_t __pyx_t_4;
18176 __pyx_v_stride = (__pyx_v_strides[0]);
18185 __pyx_v_extent = (__pyx_v_shape[0]);
18194 __pyx_t_1 = ((__pyx_v_ndim == 1) != 0);
18204 __pyx_t_2 = __pyx_v_extent;
18205 __pyx_t_3 = __pyx_t_2;
18206 for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
18207 __pyx_v_i = __pyx_t_4;
18216 (void)(memcpy(__pyx_v_data, __pyx_v_item, __pyx_v_itemsize));
18225 __pyx_v_data = (__pyx_v_data + __pyx_v_stride);
18246 __pyx_t_2 = __pyx_v_extent;
18247 __pyx_t_3 = __pyx_t_2;
18248 for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
18249 __pyx_v_i = __pyx_t_4;
18258 __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);
18267 __pyx_v_data = (__pyx_v_data + __pyx_v_stride);
18290 static PyObject *__pyx_pw_15View_dot_MemoryView_1__pyx_unpickle_Enum(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
18291 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};
18292 static PyObject *__pyx_pw_15View_dot_MemoryView_1__pyx_unpickle_Enum(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
18293 PyObject *__pyx_v___pyx_type = 0;
18294 long __pyx_v___pyx_checksum;
18295 PyObject *__pyx_v___pyx_state = 0;
18296 int __pyx_lineno = 0;
18297 const char *__pyx_filename = NULL;
18298 int __pyx_clineno = 0;
18299 PyObject *__pyx_r = 0;
18300 __Pyx_RefNannyDeclarations
18301 __Pyx_RefNannySetupContext(
"__pyx_unpickle_Enum (wrapper)", 0);
18303 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_pyx_type,&__pyx_n_s_pyx_checksum,&__pyx_n_s_pyx_state,0};
18304 PyObject* values[3] = {0,0,0};
18305 if (unlikely(__pyx_kwds)) {
18306 Py_ssize_t kw_args;
18307 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
18308 switch (pos_args) {
18309 case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
18310 CYTHON_FALLTHROUGH;
18311 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
18312 CYTHON_FALLTHROUGH;
18313 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
18314 CYTHON_FALLTHROUGH;
18316 default:
goto __pyx_L5_argtuple_error;
18318 kw_args = PyDict_Size(__pyx_kwds);
18319 switch (pos_args) {
18321 if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pyx_type)) != 0)) kw_args--;
18322 else goto __pyx_L5_argtuple_error;
18323 CYTHON_FALLTHROUGH;
18325 if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pyx_checksum)) != 0)) kw_args--;
18327 __Pyx_RaiseArgtupleInvalid(
"__pyx_unpickle_Enum", 1, 3, 3, 1); __PYX_ERR(0, 1, __pyx_L3_error)
18329 CYTHON_FALLTHROUGH;
18331 if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pyx_state)) != 0)) kw_args--;
18333 __Pyx_RaiseArgtupleInvalid(
"__pyx_unpickle_Enum", 1, 3, 3, 2); __PYX_ERR(0, 1, __pyx_L3_error)
18336 if (unlikely(kw_args > 0)) {
18337 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args,
"__pyx_unpickle_Enum") < 0)) __PYX_ERR(0, 1, __pyx_L3_error)
18339 }
else if (PyTuple_GET_SIZE(__pyx_args) != 3) {
18340 goto __pyx_L5_argtuple_error;
18342 values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
18343 values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
18344 values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
18346 __pyx_v___pyx_type = values[0];
18347 __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)
18348 __pyx_v___pyx_state = values[2];
18350 goto __pyx_L4_argument_unpacking_done;
18351 __pyx_L5_argtuple_error:;
18352 __Pyx_RaiseArgtupleInvalid(
"__pyx_unpickle_Enum", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1, __pyx_L3_error)
18354 __Pyx_AddTraceback(
"View.MemoryView.__pyx_unpickle_Enum", __pyx_clineno, __pyx_lineno, __pyx_filename);
18355 __Pyx_RefNannyFinishContext();
18357 __pyx_L4_argument_unpacking_done:;
18358 __pyx_r = __pyx_pf_15View_dot_MemoryView___pyx_unpickle_Enum(__pyx_self, __pyx_v___pyx_type, __pyx_v___pyx_checksum, __pyx_v___pyx_state);
18361 __Pyx_RefNannyFinishContext();
18365 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) {
18366 PyObject *__pyx_v___pyx_PickleError = 0;
18367 PyObject *__pyx_v___pyx_result = 0;
18368 PyObject *__pyx_r = NULL;
18369 __Pyx_RefNannyDeclarations
18370 PyObject *__pyx_t_1 = NULL;
18373 PyObject *__pyx_t_4 = NULL;
18374 PyObject *__pyx_t_5 = NULL;
18375 PyObject *__pyx_t_6 = NULL;
18376 int __pyx_lineno = 0;
18377 const char *__pyx_filename = NULL;
18378 int __pyx_clineno = 0;
18379 __Pyx_RefNannySetupContext(
"__pyx_unpickle_Enum", 0);
18388 __pyx_t_1 = __Pyx_PyInt_From_long(__pyx_v___pyx_checksum);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4, __pyx_L1_error)
18389 __Pyx_GOTREF(__pyx_t_1);
18390 __pyx_t_2 = (__Pyx_PySequence_ContainsTF(__pyx_t_1, __pyx_tuple__23, Py_NE));
if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 4, __pyx_L1_error)
18391 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
18392 __pyx_t_3 = (__pyx_t_2 != 0);
18402 __pyx_t_1 = PyList_New(1);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 5, __pyx_L1_error)
18403 __Pyx_GOTREF(__pyx_t_1);
18404 __Pyx_INCREF(__pyx_n_s_PickleError);
18405 __Pyx_GIVEREF(__pyx_n_s_PickleError);
18406 PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_s_PickleError);
18407 __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)
18408 __Pyx_GOTREF(__pyx_t_4);
18409 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
18410 __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_4, __pyx_n_s_PickleError);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 5, __pyx_L1_error)
18411 __Pyx_GOTREF(__pyx_t_1);
18412 __Pyx_INCREF(__pyx_t_1);
18413 __pyx_v___pyx_PickleError = __pyx_t_1;
18414 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
18415 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
18424 __pyx_t_1 = __Pyx_PyInt_From_long(__pyx_v___pyx_checksum);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 6, __pyx_L1_error)
18425 __Pyx_GOTREF(__pyx_t_1);
18426 __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)
18427 __Pyx_GOTREF(__pyx_t_5);
18428 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
18429 __Pyx_INCREF(__pyx_v___pyx_PickleError);
18430 __pyx_t_1 = __pyx_v___pyx_PickleError; __pyx_t_6 = NULL;
18431 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_1))) {
18432 __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_1);
18433 if (likely(__pyx_t_6)) {
18434 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_1);
18435 __Pyx_INCREF(__pyx_t_6);
18436 __Pyx_INCREF(
function);
18437 __Pyx_DECREF_SET(__pyx_t_1,
function);
18440 __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);
18441 __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
18442 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
18443 if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 6, __pyx_L1_error)
18444 __Pyx_GOTREF(__pyx_t_4);
18445 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
18446 __Pyx_Raise(__pyx_t_4, 0, 0, 0);
18447 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
18448 __PYX_ERR(0, 6, __pyx_L1_error)
18466 __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)
18467 __Pyx_GOTREF(__pyx_t_1);
18469 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_1))) {
18470 __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_1);
18471 if (likely(__pyx_t_5)) {
18472 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_1);
18473 __Pyx_INCREF(__pyx_t_5);
18474 __Pyx_INCREF(
function);
18475 __Pyx_DECREF_SET(__pyx_t_1,
function);
18478 __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);
18479 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
18480 if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 7, __pyx_L1_error)
18481 __Pyx_GOTREF(__pyx_t_4);
18482 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
18483 __pyx_v___pyx_result = __pyx_t_4;
18493 __pyx_t_3 = (__pyx_v___pyx_state != Py_None);
18494 __pyx_t_2 = (__pyx_t_3 != 0);
18504 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)
18505 __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)
18506 __Pyx_GOTREF(__pyx_t_4);
18507 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
18525 __Pyx_XDECREF(__pyx_r);
18526 __Pyx_INCREF(__pyx_v___pyx_result);
18527 __pyx_r = __pyx_v___pyx_result;
18538 __Pyx_XDECREF(__pyx_t_1);
18539 __Pyx_XDECREF(__pyx_t_4);
18540 __Pyx_XDECREF(__pyx_t_5);
18541 __Pyx_XDECREF(__pyx_t_6);
18542 __Pyx_AddTraceback(
"View.MemoryView.__pyx_unpickle_Enum", __pyx_clineno, __pyx_lineno, __pyx_filename);
18545 __Pyx_XDECREF(__pyx_v___pyx_PickleError);
18546 __Pyx_XDECREF(__pyx_v___pyx_result);
18547 __Pyx_XGIVEREF(__pyx_r);
18548 __Pyx_RefNannyFinishContext();
18560 static PyObject *__pyx_unpickle_Enum__set_state(
struct __pyx_MemviewEnum_obj *__pyx_v___pyx_result, PyObject *__pyx_v___pyx_state) {
18561 PyObject *__pyx_r = NULL;
18562 __Pyx_RefNannyDeclarations
18563 PyObject *__pyx_t_1 = NULL;
18565 Py_ssize_t __pyx_t_3;
18568 PyObject *__pyx_t_6 = NULL;
18569 PyObject *__pyx_t_7 = NULL;
18570 PyObject *__pyx_t_8 = NULL;
18571 int __pyx_lineno = 0;
18572 const char *__pyx_filename = NULL;
18573 int __pyx_clineno = 0;
18574 __Pyx_RefNannySetupContext(
"__pyx_unpickle_Enum__set_state", 0);
18583 if (unlikely(__pyx_v___pyx_state == Py_None)) {
18584 PyErr_SetString(PyExc_TypeError,
"'NoneType' object is not subscriptable");
18585 __PYX_ERR(0, 12, __pyx_L1_error)
18587 __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)
18588 __Pyx_GOTREF(__pyx_t_1);
18589 __Pyx_GIVEREF(__pyx_t_1);
18590 __Pyx_GOTREF(__pyx_v___pyx_result->name);
18591 __Pyx_DECREF(__pyx_v___pyx_result->name);
18592 __pyx_v___pyx_result->name = __pyx_t_1;
18601 if (unlikely(__pyx_v___pyx_state == Py_None)) {
18602 PyErr_SetString(PyExc_TypeError,
"object of type 'NoneType' has no len()");
18603 __PYX_ERR(0, 13, __pyx_L1_error)
18605 __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)
18606 __pyx_t_4 = ((__pyx_t_3 > 1) != 0);
18609 __pyx_t_2 = __pyx_t_4;
18610 goto __pyx_L4_bool_binop_done;
18612 __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)
18613 __pyx_t_5 = (__pyx_t_4 != 0);
18614 __pyx_t_2 = __pyx_t_5;
18615 __pyx_L4_bool_binop_done:;
18623 __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)
18624 __Pyx_GOTREF(__pyx_t_6);
18625 __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)
18626 __Pyx_GOTREF(__pyx_t_7);
18627 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
18628 if (unlikely(__pyx_v___pyx_state == Py_None)) {
18629 PyErr_SetString(PyExc_TypeError,
"'NoneType' object is not subscriptable");
18630 __PYX_ERR(0, 14, __pyx_L1_error)
18632 __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)
18633 __Pyx_GOTREF(__pyx_t_6);
18635 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_7))) {
18636 __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_7);
18637 if (likely(__pyx_t_8)) {
18638 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_7);
18639 __Pyx_INCREF(__pyx_t_8);
18640 __Pyx_INCREF(
function);
18641 __Pyx_DECREF_SET(__pyx_t_7,
function);
18644 __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);
18645 __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
18646 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
18647 if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 14, __pyx_L1_error)
18648 __Pyx_GOTREF(__pyx_t_1);
18649 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
18650 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
18669 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
18672 __Pyx_XDECREF(__pyx_t_1);
18673 __Pyx_XDECREF(__pyx_t_6);
18674 __Pyx_XDECREF(__pyx_t_7);
18675 __Pyx_XDECREF(__pyx_t_8);
18676 __Pyx_AddTraceback(
"View.MemoryView.__pyx_unpickle_Enum__set_state", __pyx_clineno, __pyx_lineno, __pyx_filename);
18679 __Pyx_XGIVEREF(__pyx_r);
18680 __Pyx_RefNannyFinishContext();
18692 static PyObject *__pyx_format_from_typeinfo(__Pyx_TypeInfo *__pyx_v_type) {
18693 __Pyx_StructField *__pyx_v_field;
18694 struct __pyx_typeinfo_string __pyx_v_fmt;
18695 PyObject *__pyx_v_part = 0;
18696 PyObject *__pyx_v_result = 0;
18697 PyObject *__pyx_v_alignment = NULL;
18698 PyObject *__pyx_v_parts = NULL;
18699 PyObject *__pyx_v_extents = NULL;
18701 PyObject *__pyx_r = NULL;
18702 __Pyx_RefNannyDeclarations
18704 PyObject *__pyx_t_2 = NULL;
18705 __Pyx_StructField *__pyx_t_3;
18706 PyObject *__pyx_t_4 = NULL;
18707 PyObject *__pyx_t_5 = NULL;
18712 int __pyx_lineno = 0;
18713 const char *__pyx_filename = NULL;
18714 int __pyx_clineno = 0;
18715 __Pyx_RefNannySetupContext(
"format_from_typeinfo", 0);
18724 __pyx_t_1 = ((__pyx_v_type->typegroup ==
'S') != 0);
18734 #ifndef CYTHON_WITHOUT_ASSERTIONS
18735 if (unlikely(!Py_OptimizeFlag)) {
18736 if (unlikely(!((__pyx_v_type->fields != NULL) != 0))) {
18737 PyErr_SetNone(PyExc_AssertionError);
18738 __PYX_ERR(0, 1469, __pyx_L1_error)
18750 #ifndef CYTHON_WITHOUT_ASSERTIONS
18751 if (unlikely(!Py_OptimizeFlag)) {
18752 if (unlikely(!((__pyx_v_type->fields->type != NULL) != 0))) {
18753 PyErr_SetNone(PyExc_AssertionError);
18754 __PYX_ERR(0, 1470, __pyx_L1_error)
18766 __pyx_t_1 = ((__pyx_v_type->flags & __PYX_BUF_FLAGS_PACKED_STRUCT) != 0);
18776 __Pyx_INCREF(__pyx_kp_b__24);
18777 __pyx_v_alignment = __pyx_kp_b__24;
18797 __Pyx_INCREF(__pyx_kp_b__25);
18798 __pyx_v_alignment = __pyx_kp_b__25;
18809 __pyx_t_2 = PyList_New(1);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1477, __pyx_L1_error)
18810 __Pyx_GOTREF(__pyx_t_2);
18811 __Pyx_INCREF(__pyx_kp_b_T);
18812 __Pyx_GIVEREF(__pyx_kp_b_T);
18813 PyList_SET_ITEM(__pyx_t_2, 0, __pyx_kp_b_T);
18814 __pyx_v_parts = ((PyObject*)__pyx_t_2);
18824 __pyx_t_3 = __pyx_v_type->fields;
18825 __pyx_v_field = __pyx_t_3;
18835 __pyx_t_1 = (__pyx_v_field->type != 0);
18836 if (!__pyx_t_1)
break;
18845 __pyx_t_2 = __pyx_format_from_typeinfo(__pyx_v_field->type);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1481, __pyx_L1_error)
18846 __Pyx_GOTREF(__pyx_t_2);
18847 __Pyx_XDECREF_SET(__pyx_v_part, ((PyObject*)__pyx_t_2));
18857 __pyx_t_2 = PyNumber_Add(__pyx_v_part, __pyx_kp_b__26);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1482, __pyx_L1_error)
18858 __Pyx_GOTREF(__pyx_t_2);
18859 __pyx_t_4 = __Pyx_PyBytes_FromString(__pyx_v_field->name);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1482, __pyx_L1_error)
18860 __Pyx_GOTREF(__pyx_t_4);
18861 __pyx_t_5 = PyNumber_Add(__pyx_t_2, __pyx_t_4);
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1482, __pyx_L1_error)
18862 __Pyx_GOTREF(__pyx_t_5);
18863 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
18864 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
18865 __pyx_t_4 = PyNumber_Add(__pyx_t_5, __pyx_kp_b__26);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1482, __pyx_L1_error)
18866 __Pyx_GOTREF(__pyx_t_4);
18867 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
18868 __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)
18869 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
18878 __pyx_v_field = (__pyx_v_field + 1);
18888 __pyx_t_4 = __Pyx_PyBytes_Join(__pyx_v_alignment, __pyx_v_parts);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1485, __pyx_L1_error)
18889 __Pyx_GOTREF(__pyx_t_4);
18890 __pyx_t_5 = PyNumber_Add(__pyx_t_4, __pyx_kp_b__27);
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1485, __pyx_L1_error)
18891 __Pyx_GOTREF(__pyx_t_5);
18892 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
18893 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)
18894 __pyx_v_result = ((PyObject*)__pyx_t_5);
18915 __pyx_v_fmt = __Pyx_TypeInfoToFormat(__pyx_v_type);
18924 __pyx_t_1 = ((__pyx_v_type->arraysize[0]) != 0);
18934 __pyx_t_5 = PyList_New(0);
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1489, __pyx_L1_error)
18935 __Pyx_GOTREF(__pyx_t_5);
18936 __pyx_t_7 = __pyx_v_type->ndim;
18937 __pyx_t_8 = __pyx_t_7;
18938 for (__pyx_t_9 = 0; __pyx_t_9 < __pyx_t_8; __pyx_t_9+=1) {
18939 __pyx_v_i = __pyx_t_9;
18940 __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)
18941 __Pyx_GOTREF(__pyx_t_4);
18942 __pyx_t_2 = __Pyx_PyObject_Unicode(__pyx_t_4);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1489, __pyx_L1_error)
18943 __Pyx_GOTREF(__pyx_t_2);
18944 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
18945 if (unlikely(__Pyx_ListComp_Append(__pyx_t_5, (PyObject*)__pyx_t_2))) __PYX_ERR(0, 1489, __pyx_L1_error)
18946 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
18948 __pyx_v_extents = ((PyObject*)__pyx_t_5);
18958 __pyx_t_5 = PyUnicode_Join(__pyx_kp_u__28, __pyx_v_extents);
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1490, __pyx_L1_error)
18959 __Pyx_GOTREF(__pyx_t_5);
18960 __pyx_t_2 = PyUnicode_Format(__pyx_kp_u_s, __pyx_t_5);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1490, __pyx_L1_error)
18961 __Pyx_GOTREF(__pyx_t_2);
18962 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
18963 __pyx_t_5 = PyUnicode_AsASCIIString(((PyObject*)__pyx_t_2));
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1490, __pyx_L1_error)
18964 __Pyx_GOTREF(__pyx_t_5);
18965 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
18966 __pyx_t_2 = __Pyx_PyObject_FromString(__pyx_v_fmt.string);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1490, __pyx_L1_error)
18967 __Pyx_GOTREF(__pyx_t_2);
18968 __pyx_t_4 = PyNumber_Add(__pyx_t_5, __pyx_t_2);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1490, __pyx_L1_error)
18969 __Pyx_GOTREF(__pyx_t_4);
18970 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
18971 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
18972 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)
18973 __pyx_v_result = ((PyObject*)__pyx_t_4);
18994 __pyx_t_4 = __Pyx_PyObject_FromString(__pyx_v_fmt.string);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1492, __pyx_L1_error)
18995 __Pyx_GOTREF(__pyx_t_4);
18996 __pyx_v_result = ((PyObject*)__pyx_t_4);
19008 __Pyx_XDECREF(__pyx_r);
19009 __Pyx_INCREF(__pyx_v_result);
19010 __pyx_r = __pyx_v_result;
19023 __Pyx_XDECREF(__pyx_t_2);
19024 __Pyx_XDECREF(__pyx_t_4);
19025 __Pyx_XDECREF(__pyx_t_5);
19026 __Pyx_AddTraceback(
"BufferFormatFromTypeInfo.format_from_typeinfo", __pyx_clineno, __pyx_lineno, __pyx_filename);
19029 __Pyx_XDECREF(__pyx_v_part);
19030 __Pyx_XDECREF(__pyx_v_result);
19031 __Pyx_XDECREF(__pyx_v_alignment);
19032 __Pyx_XDECREF(__pyx_v_parts);
19033 __Pyx_XDECREF(__pyx_v_extents);
19034 __Pyx_XGIVEREF(__pyx_r);
19035 __Pyx_RefNannyFinishContext();
19039 static PyObject *__pyx_tp_new_14flcbdfWrappers_FLCBDF_integrator(PyTypeObject *t, PyObject *a, PyObject *k) {
19041 if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) {
19042 o = (*t->tp_alloc)(t, 0);
19044 o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0);
19046 if (unlikely(!o))
return 0;
19047 if (unlikely(__pyx_pw_14flcbdfWrappers_17FLCBDF_integrator_27__cinit__(o, a, k) < 0))
goto bad;
19050 Py_DECREF(o); o = 0;
19054 static void __pyx_tp_dealloc_14flcbdfWrappers_FLCBDF_integrator(PyObject *o) {
19055 #if CYTHON_USE_TP_FINALIZE
19056 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))) {
19057 if (PyObject_CallFinalizerFromDealloc(o))
return;
19061 PyObject *etype, *eval, *etb;
19062 PyErr_Fetch(&etype, &eval, &etb);
19063 __Pyx_SET_REFCNT(o, Py_REFCNT(o) + 1);
19064 __pyx_pw_14flcbdfWrappers_17FLCBDF_integrator_29__dealloc__(o);
19065 __Pyx_SET_REFCNT(o, Py_REFCNT(o) - 1);
19066 PyErr_Restore(etype, eval, etb);
19068 (*Py_TYPE(o)->tp_free)(o);
19071 static PyMethodDef __pyx_methods_14flcbdfWrappers_FLCBDF_integrator[] = {
19072 {
"choose_dt", (PyCFunction)(
void*)(PyCFunctionWithKeywords)__pyx_pw_14flcbdfWrappers_17FLCBDF_integrator_1choose_dt, METH_VARARGS|METH_KEYWORDS, 0},
19073 {
"set_dt", (PyCFunction)__pyx_pw_14flcbdfWrappers_17FLCBDF_integrator_3set_dt, METH_O, 0},
19074 {
"set_order", (PyCFunction)__pyx_pw_14flcbdfWrappers_17FLCBDF_integrator_5set_order, METH_O, 0},
19075 {
"initialize_dt", (PyCFunction)(
void*)(PyCFunctionWithKeywords)__pyx_pw_14flcbdfWrappers_17FLCBDF_integrator_7initialize_dt, METH_VARARGS|METH_KEYWORDS, 0},
19076 {
"setInitialGuess", (PyCFunction)__pyx_pw_14flcbdfWrappers_17FLCBDF_integrator_9setInitialGuess, METH_O, 0},
19077 {
"lastStepErrorOk", (PyCFunction)__pyx_pw_14flcbdfWrappers_17FLCBDF_integrator_11lastStepErrorOk, METH_O, 0},
19078 {
"calculate_yprime", (PyCFunction)(
void*)(PyCFunctionWithKeywords)__pyx_pw_14flcbdfWrappers_17FLCBDF_integrator_13calculate_yprime, METH_VARARGS|METH_KEYWORDS, 0},
19079 {
"stepTaken", (PyCFunction)__pyx_pw_14flcbdfWrappers_17FLCBDF_integrator_15stepTaken, METH_O, 0},
19080 {
"retryStep_errorFailure", (PyCFunction)__pyx_pw_14flcbdfWrappers_17FLCBDF_integrator_17retryStep_errorFailure, METH_NOARGS, 0},
19081 {
"retryStep_solverFailure", (PyCFunction)__pyx_pw_14flcbdfWrappers_17FLCBDF_integrator_19retryStep_solverFailure, METH_NOARGS, 0},
19082 {
"initializeTimeHistory", (PyCFunction)(
void*)(PyCFunctionWithKeywords)__pyx_pw_14flcbdfWrappers_17FLCBDF_integrator_21initializeTimeHistory, METH_VARARGS|METH_KEYWORDS, 0},
19083 {
"setTolerances", (PyCFunction)(
void*)(PyCFunctionWithKeywords)__pyx_pw_14flcbdfWrappers_17FLCBDF_integrator_23setTolerances, METH_VARARGS|METH_KEYWORDS, 0},
19084 {
"getCurrentAlpha", (PyCFunction)__pyx_pw_14flcbdfWrappers_17FLCBDF_integrator_25getCurrentAlpha, METH_NOARGS, 0},
19085 {
"__reduce_cython__", (PyCFunction)__pyx_pw_14flcbdfWrappers_17FLCBDF_integrator_31__reduce_cython__, METH_NOARGS, 0},
19086 {
"__setstate_cython__", (PyCFunction)__pyx_pw_14flcbdfWrappers_17FLCBDF_integrator_33__setstate_cython__, METH_O, 0},
19090 static PyTypeObject __pyx_type_14flcbdfWrappers_FLCBDF_integrator = {
19091 PyVarObject_HEAD_INIT(0, 0)
19092 "flcbdfWrappers.FLCBDF_integrator",
19093 sizeof(
struct __pyx_obj_14flcbdfWrappers_FLCBDF_integrator),
19095 __pyx_tp_dealloc_14flcbdfWrappers_FLCBDF_integrator,
19096 #
if PY_VERSION_HEX < 0x030800b4
19099 #
if PY_VERSION_HEX >= 0x030800b4
19104 #
if PY_MAJOR_VERSION < 3
19107 #
if PY_MAJOR_VERSION >= 3
19120 Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE,
19128 __pyx_methods_14flcbdfWrappers_FLCBDF_integrator,
19138 __pyx_tp_new_14flcbdfWrappers_FLCBDF_integrator,
19148 #
if PY_VERSION_HEX >= 0x030400a1
19151 #
if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800)
19154 #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
19157 #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000
19161 static struct __pyx_vtabstruct_array __pyx_vtable_array;
19163 static PyObject *__pyx_tp_new_array(PyTypeObject *t, PyObject *a, PyObject *k) {
19164 struct __pyx_array_obj *p;
19166 if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) {
19167 o = (*t->tp_alloc)(t, 0);
19169 o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0);
19171 if (unlikely(!o))
return 0;
19172 p = ((
struct __pyx_array_obj *)o);
19173 p->__pyx_vtab = __pyx_vtabptr_array;
19174 p->mode = ((PyObject*)Py_None); Py_INCREF(Py_None);
19175 p->_format = ((PyObject*)Py_None); Py_INCREF(Py_None);
19176 if (unlikely(__pyx_array___cinit__(o, a, k) < 0))
goto bad;
19179 Py_DECREF(o); o = 0;
19183 static void __pyx_tp_dealloc_array(PyObject *o) {
19184 struct __pyx_array_obj *p = (
struct __pyx_array_obj *)o;
19185 #if CYTHON_USE_TP_FINALIZE
19186 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))) {
19187 if (PyObject_CallFinalizerFromDealloc(o))
return;
19191 PyObject *etype, *eval, *etb;
19192 PyErr_Fetch(&etype, &eval, &etb);
19193 __Pyx_SET_REFCNT(o, Py_REFCNT(o) + 1);
19194 __pyx_array___dealloc__(o);
19195 __Pyx_SET_REFCNT(o, Py_REFCNT(o) - 1);
19196 PyErr_Restore(etype, eval, etb);
19199 Py_CLEAR(p->_format);
19200 (*Py_TYPE(o)->tp_free)(o);
19202 static PyObject *__pyx_sq_item_array(PyObject *o, Py_ssize_t i) {
19204 PyObject *x = PyInt_FromSsize_t(i);
if(!x)
return 0;
19205 r = Py_TYPE(o)->tp_as_mapping->mp_subscript(o, x);
19210 static int __pyx_mp_ass_subscript_array(PyObject *o, PyObject *i, PyObject *
v) {
19212 return __pyx_array___setitem__(o, i,
v);
19215 PyErr_Format(PyExc_NotImplementedError,
19216 "Subscript deletion not supported by %.200s", Py_TYPE(o)->tp_name);
19221 static PyObject *__pyx_tp_getattro_array(PyObject *o, PyObject *
n) {
19222 PyObject *
v = __Pyx_PyObject_GenericGetAttr(o,
n);
19223 if (!
v && PyErr_ExceptionMatches(PyExc_AttributeError)) {
19225 v = __pyx_array___getattr__(o,
n);
19230 static PyObject *__pyx_getprop___pyx_array_memview(PyObject *o, CYTHON_UNUSED
void *x) {
19231 return __pyx_pw_15View_dot_MemoryView_5array_7memview_1__get__(o);
19234 static PyMethodDef __pyx_methods_array[] = {
19235 {
"__getattr__", (PyCFunction)__pyx_array___getattr__, METH_O|METH_COEXIST, 0},
19236 {
"__reduce_cython__", (PyCFunction)__pyx_pw___pyx_array_1__reduce_cython__, METH_NOARGS, 0},
19237 {
"__setstate_cython__", (PyCFunction)__pyx_pw___pyx_array_3__setstate_cython__, METH_O, 0},
19241 static struct PyGetSetDef __pyx_getsets_array[] = {
19242 {(
char *)
"memview", __pyx_getprop___pyx_array_memview, 0, (
char *)0, 0},
19246 static PySequenceMethods __pyx_tp_as_sequence_array = {
19247 __pyx_array___len__,
19250 __pyx_sq_item_array,
19259 static PyMappingMethods __pyx_tp_as_mapping_array = {
19260 __pyx_array___len__,
19261 __pyx_array___getitem__,
19262 __pyx_mp_ass_subscript_array,
19265 static PyBufferProcs __pyx_tp_as_buffer_array = {
19266 #if PY_MAJOR_VERSION < 3
19269 #if PY_MAJOR_VERSION < 3
19272 #if PY_MAJOR_VERSION < 3
19275 #if PY_MAJOR_VERSION < 3
19278 __pyx_array_getbuffer,
19282 static PyTypeObject __pyx_type___pyx_array = {
19283 PyVarObject_HEAD_INIT(0, 0)
19284 "flcbdfWrappers.array",
19285 sizeof(
struct __pyx_array_obj),
19287 __pyx_tp_dealloc_array,
19288 #
if PY_VERSION_HEX < 0x030800b4
19291 #
if PY_VERSION_HEX >= 0x030800b4
19296 #
if PY_MAJOR_VERSION < 3
19299 #
if PY_MAJOR_VERSION >= 3
19304 &__pyx_tp_as_sequence_array,
19305 &__pyx_tp_as_mapping_array,
19309 __pyx_tp_getattro_array,
19311 &__pyx_tp_as_buffer_array,
19312 Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE,
19320 __pyx_methods_array,
19322 __pyx_getsets_array,
19330 __pyx_tp_new_array,
19340 #
if PY_VERSION_HEX >= 0x030400a1
19343 #
if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800)
19346 #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
19349 #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000
19354 static PyObject *__pyx_tp_new_Enum(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
19355 struct __pyx_MemviewEnum_obj *p;
19357 if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) {
19358 o = (*t->tp_alloc)(t, 0);
19360 o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0);
19362 if (unlikely(!o))
return 0;
19363 p = ((
struct __pyx_MemviewEnum_obj *)o);
19364 p->name = Py_None; Py_INCREF(Py_None);
19368 static void __pyx_tp_dealloc_Enum(PyObject *o) {
19369 struct __pyx_MemviewEnum_obj *p = (
struct __pyx_MemviewEnum_obj *)o;
19370 #if CYTHON_USE_TP_FINALIZE
19371 if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) {
19372 if (PyObject_CallFinalizerFromDealloc(o))
return;
19375 PyObject_GC_UnTrack(o);
19377 (*Py_TYPE(o)->tp_free)(o);
19380 static int __pyx_tp_traverse_Enum(PyObject *o, visitproc
v,
void *a) {
19382 struct __pyx_MemviewEnum_obj *p = (
struct __pyx_MemviewEnum_obj *)o;
19384 e = (*v)(p->name, a);
if (e)
return e;
19389 static int __pyx_tp_clear_Enum(PyObject *o) {
19391 struct __pyx_MemviewEnum_obj *p = (
struct __pyx_MemviewEnum_obj *)o;
19392 tmp = ((PyObject*)p->name);
19393 p->name = Py_None; Py_INCREF(Py_None);
19398 static PyMethodDef __pyx_methods_Enum[] = {
19399 {
"__reduce_cython__", (PyCFunction)__pyx_pw___pyx_MemviewEnum_1__reduce_cython__, METH_NOARGS, 0},
19400 {
"__setstate_cython__", (PyCFunction)__pyx_pw___pyx_MemviewEnum_3__setstate_cython__, METH_O, 0},
19404 static PyTypeObject __pyx_type___pyx_MemviewEnum = {
19405 PyVarObject_HEAD_INIT(0, 0)
19406 "flcbdfWrappers.Enum",
19407 sizeof(
struct __pyx_MemviewEnum_obj),
19409 __pyx_tp_dealloc_Enum,
19410 #
if PY_VERSION_HEX < 0x030800b4
19413 #
if PY_VERSION_HEX >= 0x030800b4
19418 #
if PY_MAJOR_VERSION < 3
19421 #
if PY_MAJOR_VERSION >= 3
19424 __pyx_MemviewEnum___repr__,
19434 Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC,
19436 __pyx_tp_traverse_Enum,
19437 __pyx_tp_clear_Enum,
19442 __pyx_methods_Enum,
19450 __pyx_MemviewEnum___init__,
19462 #
if PY_VERSION_HEX >= 0x030400a1
19465 #
if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800)
19468 #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
19471 #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000
19475 static struct __pyx_vtabstruct_memoryview __pyx_vtable_memoryview;
19477 static PyObject *__pyx_tp_new_memoryview(PyTypeObject *t, PyObject *a, PyObject *k) {
19478 struct __pyx_memoryview_obj *p;
19480 if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) {
19481 o = (*t->tp_alloc)(t, 0);
19483 o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0);
19485 if (unlikely(!o))
return 0;
19486 p = ((
struct __pyx_memoryview_obj *)o);
19487 p->__pyx_vtab = __pyx_vtabptr_memoryview;
19488 p->obj = Py_None; Py_INCREF(Py_None);
19489 p->_size = Py_None; Py_INCREF(Py_None);
19490 p->_array_interface = Py_None; Py_INCREF(Py_None);
19491 p->view.obj = NULL;
19492 if (unlikely(__pyx_memoryview___cinit__(o, a, k) < 0))
goto bad;
19495 Py_DECREF(o); o = 0;
19499 static void __pyx_tp_dealloc_memoryview(PyObject *o) {
19500 struct __pyx_memoryview_obj *p = (
struct __pyx_memoryview_obj *)o;
19501 #if CYTHON_USE_TP_FINALIZE
19502 if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) {
19503 if (PyObject_CallFinalizerFromDealloc(o))
return;
19506 PyObject_GC_UnTrack(o);
19508 PyObject *etype, *eval, *etb;
19509 PyErr_Fetch(&etype, &eval, &etb);
19510 __Pyx_SET_REFCNT(o, Py_REFCNT(o) + 1);
19511 __pyx_memoryview___dealloc__(o);
19512 __Pyx_SET_REFCNT(o, Py_REFCNT(o) - 1);
19513 PyErr_Restore(etype, eval, etb);
19516 Py_CLEAR(p->_size);
19517 Py_CLEAR(p->_array_interface);
19518 (*Py_TYPE(o)->tp_free)(o);
19521 static int __pyx_tp_traverse_memoryview(PyObject *o, visitproc
v,
void *a) {
19523 struct __pyx_memoryview_obj *p = (
struct __pyx_memoryview_obj *)o;
19525 e = (*v)(p->obj, a);
if (e)
return e;
19528 e = (*v)(p->_size, a);
if (e)
return e;
19530 if (p->_array_interface) {
19531 e = (*v)(p->_array_interface, a);
if (e)
return e;
19534 e = (*v)(p->view.obj, a);
if (e)
return e;
19539 static int __pyx_tp_clear_memoryview(PyObject *o) {
19541 struct __pyx_memoryview_obj *p = (
struct __pyx_memoryview_obj *)o;
19542 tmp = ((PyObject*)p->obj);
19543 p->obj = Py_None; Py_INCREF(Py_None);
19545 tmp = ((PyObject*)p->_size);
19546 p->_size = Py_None; Py_INCREF(Py_None);
19548 tmp = ((PyObject*)p->_array_interface);
19549 p->_array_interface = Py_None; Py_INCREF(Py_None);
19551 Py_CLEAR(p->view.obj);
19554 static PyObject *__pyx_sq_item_memoryview(PyObject *o, Py_ssize_t i) {
19556 PyObject *x = PyInt_FromSsize_t(i);
if(!x)
return 0;
19557 r = Py_TYPE(o)->tp_as_mapping->mp_subscript(o, x);
19562 static int __pyx_mp_ass_subscript_memoryview(PyObject *o, PyObject *i, PyObject *
v) {
19564 return __pyx_memoryview___setitem__(o, i,
v);
19567 PyErr_Format(PyExc_NotImplementedError,
19568 "Subscript deletion not supported by %.200s", Py_TYPE(o)->tp_name);
19573 static PyObject *__pyx_getprop___pyx_memoryview_T(PyObject *o, CYTHON_UNUSED
void *x) {
19574 return __pyx_pw_15View_dot_MemoryView_10memoryview_1T_1__get__(o);
19577 static PyObject *__pyx_getprop___pyx_memoryview_base(PyObject *o, CYTHON_UNUSED
void *x) {
19578 return __pyx_pw_15View_dot_MemoryView_10memoryview_4base_1__get__(o);
19581 static PyObject *__pyx_getprop___pyx_memoryview_shape(PyObject *o, CYTHON_UNUSED
void *x) {
19582 return __pyx_pw_15View_dot_MemoryView_10memoryview_5shape_1__get__(o);
19585 static PyObject *__pyx_getprop___pyx_memoryview_strides(PyObject *o, CYTHON_UNUSED
void *x) {
19586 return __pyx_pw_15View_dot_MemoryView_10memoryview_7strides_1__get__(o);
19589 static PyObject *__pyx_getprop___pyx_memoryview_suboffsets(PyObject *o, CYTHON_UNUSED
void *x) {
19590 return __pyx_pw_15View_dot_MemoryView_10memoryview_10suboffsets_1__get__(o);
19593 static PyObject *__pyx_getprop___pyx_memoryview_ndim(PyObject *o, CYTHON_UNUSED
void *x) {
19594 return __pyx_pw_15View_dot_MemoryView_10memoryview_4ndim_1__get__(o);
19597 static PyObject *__pyx_getprop___pyx_memoryview_itemsize(PyObject *o, CYTHON_UNUSED
void *x) {
19598 return __pyx_pw_15View_dot_MemoryView_10memoryview_8itemsize_1__get__(o);
19601 static PyObject *__pyx_getprop___pyx_memoryview_nbytes(PyObject *o, CYTHON_UNUSED
void *x) {
19602 return __pyx_pw_15View_dot_MemoryView_10memoryview_6nbytes_1__get__(o);
19605 static PyObject *__pyx_getprop___pyx_memoryview_size(PyObject *o, CYTHON_UNUSED
void *x) {
19606 return __pyx_pw_15View_dot_MemoryView_10memoryview_4size_1__get__(o);
19609 static PyMethodDef __pyx_methods_memoryview[] = {
19610 {
"is_c_contig", (PyCFunction)__pyx_memoryview_is_c_contig, METH_NOARGS, 0},
19611 {
"is_f_contig", (PyCFunction)__pyx_memoryview_is_f_contig, METH_NOARGS, 0},
19612 {
"copy", (PyCFunction)__pyx_memoryview_copy, METH_NOARGS, 0},
19613 {
"copy_fortran", (PyCFunction)__pyx_memoryview_copy_fortran, METH_NOARGS, 0},
19614 {
"__reduce_cython__", (PyCFunction)__pyx_pw___pyx_memoryview_1__reduce_cython__, METH_NOARGS, 0},
19615 {
"__setstate_cython__", (PyCFunction)__pyx_pw___pyx_memoryview_3__setstate_cython__, METH_O, 0},
19619 static struct PyGetSetDef __pyx_getsets_memoryview[] = {
19620 {(
char *)
"T", __pyx_getprop___pyx_memoryview_T, 0, (
char *)0, 0},
19621 {(
char *)
"base", __pyx_getprop___pyx_memoryview_base, 0, (
char *)0, 0},
19622 {(
char *)
"shape", __pyx_getprop___pyx_memoryview_shape, 0, (
char *)0, 0},
19623 {(
char *)
"strides", __pyx_getprop___pyx_memoryview_strides, 0, (
char *)0, 0},
19624 {(
char *)
"suboffsets", __pyx_getprop___pyx_memoryview_suboffsets, 0, (
char *)0, 0},
19625 {(
char *)
"ndim", __pyx_getprop___pyx_memoryview_ndim, 0, (
char *)0, 0},
19626 {(
char *)
"itemsize", __pyx_getprop___pyx_memoryview_itemsize, 0, (
char *)0, 0},
19627 {(
char *)
"nbytes", __pyx_getprop___pyx_memoryview_nbytes, 0, (
char *)0, 0},
19628 {(
char *)
"size", __pyx_getprop___pyx_memoryview_size, 0, (
char *)0, 0},
19632 static PySequenceMethods __pyx_tp_as_sequence_memoryview = {
19633 __pyx_memoryview___len__,
19636 __pyx_sq_item_memoryview,
19645 static PyMappingMethods __pyx_tp_as_mapping_memoryview = {
19646 __pyx_memoryview___len__,
19647 __pyx_memoryview___getitem__,
19648 __pyx_mp_ass_subscript_memoryview,
19651 static PyBufferProcs __pyx_tp_as_buffer_memoryview = {
19652 #if PY_MAJOR_VERSION < 3
19655 #if PY_MAJOR_VERSION < 3
19658 #if PY_MAJOR_VERSION < 3
19661 #if PY_MAJOR_VERSION < 3
19664 __pyx_memoryview_getbuffer,
19668 static PyTypeObject __pyx_type___pyx_memoryview = {
19669 PyVarObject_HEAD_INIT(0, 0)
19670 "flcbdfWrappers.memoryview",
19671 sizeof(
struct __pyx_memoryview_obj),
19673 __pyx_tp_dealloc_memoryview,
19674 #
if PY_VERSION_HEX < 0x030800b4
19677 #
if PY_VERSION_HEX >= 0x030800b4
19682 #
if PY_MAJOR_VERSION < 3
19685 #
if PY_MAJOR_VERSION >= 3
19688 __pyx_memoryview___repr__,
19690 &__pyx_tp_as_sequence_memoryview,
19691 &__pyx_tp_as_mapping_memoryview,
19694 __pyx_memoryview___str__,
19697 &__pyx_tp_as_buffer_memoryview,
19698 Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC,
19700 __pyx_tp_traverse_memoryview,
19701 __pyx_tp_clear_memoryview,
19706 __pyx_methods_memoryview,
19708 __pyx_getsets_memoryview,
19716 __pyx_tp_new_memoryview,
19726 #
if PY_VERSION_HEX >= 0x030400a1
19729 #
if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800)
19732 #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
19735 #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000
19739 static struct __pyx_vtabstruct__memoryviewslice __pyx_vtable__memoryviewslice;
19741 static PyObject *__pyx_tp_new__memoryviewslice(PyTypeObject *t, PyObject *a, PyObject *k) {
19742 struct __pyx_memoryviewslice_obj *p;
19743 PyObject *o = __pyx_tp_new_memoryview(t, a, k);
19744 if (unlikely(!o))
return 0;
19745 p = ((
struct __pyx_memoryviewslice_obj *)o);
19746 p->__pyx_base.__pyx_vtab = (
struct __pyx_vtabstruct_memoryview*)__pyx_vtabptr__memoryviewslice;
19747 p->from_object = Py_None; Py_INCREF(Py_None);
19748 p->from_slice.memview = NULL;
19752 static void __pyx_tp_dealloc__memoryviewslice(PyObject *o) {
19753 struct __pyx_memoryviewslice_obj *p = (
struct __pyx_memoryviewslice_obj *)o;
19754 #if CYTHON_USE_TP_FINALIZE
19755 if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) {
19756 if (PyObject_CallFinalizerFromDealloc(o))
return;
19759 PyObject_GC_UnTrack(o);
19761 PyObject *etype, *eval, *etb;
19762 PyErr_Fetch(&etype, &eval, &etb);
19763 __Pyx_SET_REFCNT(o, Py_REFCNT(o) + 1);
19764 __pyx_memoryviewslice___dealloc__(o);
19765 __Pyx_SET_REFCNT(o, Py_REFCNT(o) - 1);
19766 PyErr_Restore(etype, eval, etb);
19768 Py_CLEAR(p->from_object);
19769 PyObject_GC_Track(o);
19770 __pyx_tp_dealloc_memoryview(o);
19773 static int __pyx_tp_traverse__memoryviewslice(PyObject *o, visitproc
v,
void *a) {
19775 struct __pyx_memoryviewslice_obj *p = (
struct __pyx_memoryviewslice_obj *)o;
19776 e = __pyx_tp_traverse_memoryview(o,
v, a);
if (e)
return e;
19777 if (p->from_object) {
19778 e = (*v)(p->from_object, a);
if (e)
return e;
19783 static int __pyx_tp_clear__memoryviewslice(PyObject *o) {
19785 struct __pyx_memoryviewslice_obj *p = (
struct __pyx_memoryviewslice_obj *)o;
19786 __pyx_tp_clear_memoryview(o);
19787 tmp = ((PyObject*)p->from_object);
19788 p->from_object = Py_None; Py_INCREF(Py_None);
19790 __PYX_XDEC_MEMVIEW(&p->from_slice, 1);
19794 static PyObject *__pyx_getprop___pyx_memoryviewslice_base(PyObject *o, CYTHON_UNUSED
void *x) {
19795 return __pyx_pw_15View_dot_MemoryView_16_memoryviewslice_4base_1__get__(o);
19798 static PyMethodDef __pyx_methods__memoryviewslice[] = {
19799 {
"__reduce_cython__", (PyCFunction)__pyx_pw___pyx_memoryviewslice_1__reduce_cython__, METH_NOARGS, 0},
19800 {
"__setstate_cython__", (PyCFunction)__pyx_pw___pyx_memoryviewslice_3__setstate_cython__, METH_O, 0},
19804 static struct PyGetSetDef __pyx_getsets__memoryviewslice[] = {
19805 {(
char *)
"base", __pyx_getprop___pyx_memoryviewslice_base, 0, (
char *)0, 0},
19809 static PyTypeObject __pyx_type___pyx_memoryviewslice = {
19810 PyVarObject_HEAD_INIT(0, 0)
19811 "flcbdfWrappers._memoryviewslice",
19812 sizeof(
struct __pyx_memoryviewslice_obj),
19814 __pyx_tp_dealloc__memoryviewslice,
19815 #
if PY_VERSION_HEX < 0x030800b4
19818 #
if PY_VERSION_HEX >= 0x030800b4
19823 #
if PY_MAJOR_VERSION < 3
19826 #
if PY_MAJOR_VERSION >= 3
19829 #
if CYTHON_COMPILING_IN_PYPY
19830 __pyx_memoryview___repr__,
19839 #
if CYTHON_COMPILING_IN_PYPY
19840 __pyx_memoryview___str__,
19847 Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC,
19848 "Internal class for passing memoryview slices to Python",
19849 __pyx_tp_traverse__memoryviewslice,
19850 __pyx_tp_clear__memoryviewslice,
19855 __pyx_methods__memoryviewslice,
19857 __pyx_getsets__memoryviewslice,
19865 __pyx_tp_new__memoryviewslice,
19875 #
if PY_VERSION_HEX >= 0x030400a1
19878 #
if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800)
19881 #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
19884 #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000
19889 static PyMethodDef __pyx_methods[] = {
19893 #if PY_MAJOR_VERSION >= 3
19894 #if CYTHON_PEP489_MULTI_PHASE_INIT
19895 static PyObject* __pyx_pymod_create(PyObject *spec, PyModuleDef *def);
19896 static int __pyx_pymod_exec_flcbdfWrappers(PyObject* module);
19897 static PyModuleDef_Slot __pyx_moduledef_slots[] = {
19898 {Py_mod_create, (
void*)__pyx_pymod_create},
19899 {Py_mod_exec, (
void*)__pyx_pymod_exec_flcbdfWrappers},
19904 static struct PyModuleDef __pyx_moduledef = {
19905 PyModuleDef_HEAD_INIT,
19908 #if CYTHON_PEP489_MULTI_PHASE_INIT
19914 #if CYTHON_PEP489_MULTI_PHASE_INIT
19915 __pyx_moduledef_slots,
19924 #ifndef CYTHON_SMALL_CODE
19925 #if defined(__clang__)
19926 #define CYTHON_SMALL_CODE
19927 #elif defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 3))
19928 #define CYTHON_SMALL_CODE __attribute__((cold))
19930 #define CYTHON_SMALL_CODE
19934 static __Pyx_StringTabEntry __pyx_string_tab[] = {
19935 {&__pyx_n_s_ASCII, __pyx_k_ASCII,
sizeof(__pyx_k_ASCII), 0, 0, 1, 1},
19936 {&__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},
19937 {&__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},
19938 {&__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},
19939 {&__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},
19940 {&__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},
19941 {&__pyx_n_s_Dy, __pyx_k_Dy,
sizeof(__pyx_k_Dy), 0, 0, 1, 1},
19942 {&__pyx_n_s_Dyprime, __pyx_k_Dyprime,
sizeof(__pyx_k_Dyprime), 0, 0, 1, 1},
19943 {&__pyx_n_s_Ellipsis, __pyx_k_Ellipsis,
sizeof(__pyx_k_Ellipsis), 0, 0, 1, 1},
19944 {&__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},
19945 {&__pyx_n_s_FLCBDF_integrator, __pyx_k_FLCBDF_integrator,
sizeof(__pyx_k_FLCBDF_integrator), 0, 0, 1, 1},
19946 {&__pyx_n_s_ImportError, __pyx_k_ImportError,
sizeof(__pyx_k_ImportError), 0, 0, 1, 1},
19947 {&__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},
19948 {&__pyx_n_s_IndexError, __pyx_k_IndexError,
sizeof(__pyx_k_IndexError), 0, 0, 1, 1},
19949 {&__pyx_kp_s_Indirect_dimensions_not_supporte, __pyx_k_Indirect_dimensions_not_supporte,
sizeof(__pyx_k_Indirect_dimensions_not_supporte), 0, 0, 1, 0},
19950 {&__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},
19951 {&__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},
19952 {&__pyx_n_s_MemoryError, __pyx_k_MemoryError,
sizeof(__pyx_k_MemoryError), 0, 0, 1, 1},
19953 {&__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},
19954 {&__pyx_kp_s_MemoryView_of_r_object, __pyx_k_MemoryView_of_r_object,
sizeof(__pyx_k_MemoryView_of_r_object), 0, 0, 1, 0},
19955 {&__pyx_n_b_O, __pyx_k_O,
sizeof(__pyx_k_O), 0, 0, 0, 1},
19956 {&__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},
19957 {&__pyx_n_s_PickleError, __pyx_k_PickleError,
sizeof(__pyx_k_PickleError), 0, 0, 1, 1},
19958 {&__pyx_kp_b_T, __pyx_k_T,
sizeof(__pyx_k_T), 0, 0, 0, 0},
19959 {&__pyx_n_s_TypeError, __pyx_k_TypeError,
sizeof(__pyx_k_TypeError), 0, 0, 1, 1},
19960 {&__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},
19961 {&__pyx_n_s_ValueError, __pyx_k_ValueError,
sizeof(__pyx_k_ValueError), 0, 0, 1, 1},
19962 {&__pyx_n_s_View_MemoryView, __pyx_k_View_MemoryView,
sizeof(__pyx_k_View_MemoryView), 0, 0, 1, 1},
19963 {&__pyx_kp_b__24, __pyx_k__24,
sizeof(__pyx_k__24), 0, 0, 0, 0},
19964 {&__pyx_kp_b__25, __pyx_k__25,
sizeof(__pyx_k__25), 0, 0, 0, 0},
19965 {&__pyx_kp_b__26, __pyx_k__26,
sizeof(__pyx_k__26), 0, 0, 0, 0},
19966 {&__pyx_kp_b__27, __pyx_k__27,
sizeof(__pyx_k__27), 0, 0, 0, 0},
19967 {&__pyx_kp_u__28, __pyx_k__28,
sizeof(__pyx_k__28), 0, 1, 0, 0},
19968 {&__pyx_n_s_allocate_buffer, __pyx_k_allocate_buffer,
sizeof(__pyx_k_allocate_buffer), 0, 0, 1, 1},
19969 {&__pyx_n_s_asarray, __pyx_k_asarray,
sizeof(__pyx_k_asarray), 0, 0, 1, 1},
19970 {&__pyx_n_s_atol, __pyx_k_atol,
sizeof(__pyx_k_atol), 0, 0, 1, 1},
19971 {&__pyx_n_s_base, __pyx_k_base,
sizeof(__pyx_k_base), 0, 0, 1, 1},
19972 {&__pyx_n_s_c, __pyx_k_c,
sizeof(__pyx_k_c), 0, 0, 1, 1},
19973 {&__pyx_n_u_c, __pyx_k_c,
sizeof(__pyx_k_c), 0, 1, 0, 1},
19974 {&__pyx_n_s_class, __pyx_k_class,
sizeof(__pyx_k_class), 0, 0, 1, 1},
19975 {&__pyx_n_s_cline_in_traceback, __pyx_k_cline_in_traceback,
sizeof(__pyx_k_cline_in_traceback), 0, 0, 1, 1},
19976 {&__pyx_kp_s_contiguous_and_direct, __pyx_k_contiguous_and_direct,
sizeof(__pyx_k_contiguous_and_direct), 0, 0, 1, 0},
19977 {&__pyx_kp_s_contiguous_and_indirect, __pyx_k_contiguous_and_indirect,
sizeof(__pyx_k_contiguous_and_indirect), 0, 0, 1, 0},
19978 {&__pyx_n_s_dV, __pyx_k_dV,
sizeof(__pyx_k_dV), 0, 0, 1, 1},
19979 {&__pyx_kp_s_data__0_d___1_s_txt, __pyx_k_data__0_d___1_s_txt,
sizeof(__pyx_k_data__0_d___1_s_txt), 0, 0, 1, 0},
19980 {&__pyx_n_s_dict, __pyx_k_dict,
sizeof(__pyx_k_dict), 0, 0, 1, 1},
19981 {&__pyx_n_s_dtype_is_object, __pyx_k_dtype_is_object,
sizeof(__pyx_k_dtype_is_object), 0, 0, 1, 1},
19982 {&__pyx_n_s_encode, __pyx_k_encode,
sizeof(__pyx_k_encode), 0, 0, 1, 1},
19983 {&__pyx_n_s_enumerate, __pyx_k_enumerate,
sizeof(__pyx_k_enumerate), 0, 0, 1, 1},
19984 {&__pyx_n_s_error, __pyx_k_error,
sizeof(__pyx_k_error), 0, 0, 1, 1},
19985 {&__pyx_n_s_flags, __pyx_k_flags,
sizeof(__pyx_k_flags), 0, 0, 1, 1},
19986 {&__pyx_n_s_format, __pyx_k_format,
sizeof(__pyx_k_format), 0, 0, 1, 1},
19987 {&__pyx_n_s_fortran, __pyx_k_fortran,
sizeof(__pyx_k_fortran), 0, 0, 1, 1},
19988 {&__pyx_n_u_fortran, __pyx_k_fortran,
sizeof(__pyx_k_fortran), 0, 1, 0, 1},
19989 {&__pyx_n_s_getstate, __pyx_k_getstate,
sizeof(__pyx_k_getstate), 0, 0, 1, 1},
19990 {&__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},
19991 {&__pyx_n_s_id, __pyx_k_id,
sizeof(__pyx_k_id), 0, 0, 1, 1},
19992 {&__pyx_n_s_import, __pyx_k_import,
sizeof(__pyx_k_import), 0, 0, 1, 1},
19993 {&__pyx_n_s_itemsize, __pyx_k_itemsize,
sizeof(__pyx_k_itemsize), 0, 0, 1, 1},
19994 {&__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},
19995 {&__pyx_n_s_join, __pyx_k_join,
sizeof(__pyx_k_join), 0, 0, 1, 1},
19996 {&__pyx_n_s_main, __pyx_k_main,
sizeof(__pyx_k_main), 0, 0, 1, 1},
19997 {&__pyx_n_s_memview, __pyx_k_memview,
sizeof(__pyx_k_memview), 0, 0, 1, 1},
19998 {&__pyx_n_s_mode, __pyx_k_mode,
sizeof(__pyx_k_mode), 0, 0, 1, 1},
19999 {&__pyx_n_s_name, __pyx_k_name,
sizeof(__pyx_k_name), 0, 0, 1, 1},
20000 {&__pyx_n_s_name_2, __pyx_k_name_2,
sizeof(__pyx_k_name_2), 0, 0, 1, 1},
20001 {&__pyx_n_s_ndim, __pyx_k_ndim,
sizeof(__pyx_k_ndim), 0, 0, 1, 1},
20002 {&__pyx_n_s_new, __pyx_k_new,
sizeof(__pyx_k_new), 0, 0, 1, 1},
20003 {&__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},
20004 {&__pyx_n_s_np, __pyx_k_np,
sizeof(__pyx_k_np), 0, 0, 1, 1},
20005 {&__pyx_n_s_numpy, __pyx_k_numpy,
sizeof(__pyx_k_numpy), 0, 0, 1, 1},
20006 {&__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},
20007 {&__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},
20008 {&__pyx_n_s_obj, __pyx_k_obj,
sizeof(__pyx_k_obj), 0, 0, 1, 1},
20009 {&__pyx_n_s_pack, __pyx_k_pack,
sizeof(__pyx_k_pack), 0, 0, 1, 1},
20010 {&__pyx_n_s_pickle, __pyx_k_pickle,
sizeof(__pyx_k_pickle), 0, 0, 1, 1},
20011 {&__pyx_n_s_pyx_PickleError, __pyx_k_pyx_PickleError,
sizeof(__pyx_k_pyx_PickleError), 0, 0, 1, 1},
20012 {&__pyx_n_s_pyx_checksum, __pyx_k_pyx_checksum,
sizeof(__pyx_k_pyx_checksum), 0, 0, 1, 1},
20013 {&__pyx_n_s_pyx_getbuffer, __pyx_k_pyx_getbuffer,
sizeof(__pyx_k_pyx_getbuffer), 0, 0, 1, 1},
20014 {&__pyx_n_s_pyx_result, __pyx_k_pyx_result,
sizeof(__pyx_k_pyx_result), 0, 0, 1, 1},
20015 {&__pyx_n_s_pyx_state, __pyx_k_pyx_state,
sizeof(__pyx_k_pyx_state), 0, 0, 1, 1},
20016 {&__pyx_n_s_pyx_type, __pyx_k_pyx_type,
sizeof(__pyx_k_pyx_type), 0, 0, 1, 1},
20017 {&__pyx_n_s_pyx_unpickle_Enum, __pyx_k_pyx_unpickle_Enum,
sizeof(__pyx_k_pyx_unpickle_Enum), 0, 0, 1, 1},
20018 {&__pyx_n_s_pyx_vtable, __pyx_k_pyx_vtable,
sizeof(__pyx_k_pyx_vtable), 0, 0, 1, 1},
20019 {&__pyx_n_s_range, __pyx_k_range,
sizeof(__pyx_k_range), 0, 0, 1, 1},
20020 {&__pyx_n_s_reduce, __pyx_k_reduce,
sizeof(__pyx_k_reduce), 0, 0, 1, 1},
20021 {&__pyx_n_s_reduce_cython, __pyx_k_reduce_cython,
sizeof(__pyx_k_reduce_cython), 0, 0, 1, 1},
20022 {&__pyx_n_s_reduce_ex, __pyx_k_reduce_ex,
sizeof(__pyx_k_reduce_ex), 0, 0, 1, 1},
20023 {&__pyx_n_s_rtol, __pyx_k_rtol,
sizeof(__pyx_k_rtol), 0, 0, 1, 1},
20024 {&__pyx_kp_u_s, __pyx_k_s,
sizeof(__pyx_k_s), 0, 1, 0, 0},
20025 {&__pyx_n_s_setstate, __pyx_k_setstate,
sizeof(__pyx_k_setstate), 0, 0, 1, 1},
20026 {&__pyx_n_s_setstate_cython, __pyx_k_setstate_cython,
sizeof(__pyx_k_setstate_cython), 0, 0, 1, 1},
20027 {&__pyx_n_s_shape, __pyx_k_shape,
sizeof(__pyx_k_shape), 0, 0, 1, 1},
20028 {&__pyx_n_s_size, __pyx_k_size,
sizeof(__pyx_k_size), 0, 0, 1, 1},
20029 {&__pyx_n_s_start, __pyx_k_start,
sizeof(__pyx_k_start), 0, 0, 1, 1},
20030 {&__pyx_n_s_step, __pyx_k_step,
sizeof(__pyx_k_step), 0, 0, 1, 1},
20031 {&__pyx_n_s_stop, __pyx_k_stop,
sizeof(__pyx_k_stop), 0, 0, 1, 1},
20032 {&__pyx_kp_s_strided_and_direct, __pyx_k_strided_and_direct,
sizeof(__pyx_k_strided_and_direct), 0, 0, 1, 0},
20033 {&__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},
20034 {&__pyx_kp_s_strided_and_indirect, __pyx_k_strided_and_indirect,
sizeof(__pyx_k_strided_and_indirect), 0, 0, 1, 0},
20035 {&__pyx_kp_s_stringsource, __pyx_k_stringsource,
sizeof(__pyx_k_stringsource), 0, 0, 1, 0},
20036 {&__pyx_n_s_struct, __pyx_k_struct,
sizeof(__pyx_k_struct), 0, 0, 1, 1},
20037 {&__pyx_n_s_t, __pyx_k_t,
sizeof(__pyx_k_t), 0, 0, 1, 1},
20038 {&__pyx_n_s_t0, __pyx_k_t0,
sizeof(__pyx_k_t0), 0, 0, 1, 1},
20039 {&__pyx_n_s_tOut, __pyx_k_tOut,
sizeof(__pyx_k_tOut), 0, 0, 1, 1},
20040 {&__pyx_n_s_test, __pyx_k_test,
sizeof(__pyx_k_test), 0, 0, 1, 1},
20041 {&__pyx_n_s_tout, __pyx_k_tout,
sizeof(__pyx_k_tout), 0, 0, 1, 1},
20042 {&__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},
20043 {&__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},
20044 {&__pyx_n_s_unpack, __pyx_k_unpack,
sizeof(__pyx_k_unpack), 0, 0, 1, 1},
20045 {&__pyx_n_s_update, __pyx_k_update,
sizeof(__pyx_k_update), 0, 0, 1, 1},
20046 {&__pyx_n_s_y, __pyx_k_y,
sizeof(__pyx_k_y), 0, 0, 1, 1},
20047 {&__pyx_n_s_yName, __pyx_k_yName,
sizeof(__pyx_k_yName), 0, 0, 1, 1},
20048 {&__pyx_n_s_yPrime, __pyx_k_yPrime,
sizeof(__pyx_k_yPrime), 0, 0, 1, 1},
20049 {&__pyx_n_s_yprime, __pyx_k_yprime,
sizeof(__pyx_k_yprime), 0, 0, 1, 1},
20050 {0, 0, 0, 0, 0, 0, 0}
20052 static CYTHON_SMALL_CODE
int __Pyx_InitCachedBuiltins(
void) {
20053 __pyx_builtin_TypeError = __Pyx_GetBuiltinName(__pyx_n_s_TypeError);
if (!__pyx_builtin_TypeError) __PYX_ERR(0, 2, __pyx_L1_error)
20054 __pyx_builtin_ImportError = __Pyx_GetBuiltinName(__pyx_n_s_ImportError);
if (!__pyx_builtin_ImportError) __PYX_ERR(2, 945, __pyx_L1_error)
20055 __pyx_builtin_ValueError = __Pyx_GetBuiltinName(__pyx_n_s_ValueError);
if (!__pyx_builtin_ValueError) __PYX_ERR(0, 133, __pyx_L1_error)
20056 __pyx_builtin_MemoryError = __Pyx_GetBuiltinName(__pyx_n_s_MemoryError);
if (!__pyx_builtin_MemoryError) __PYX_ERR(0, 148, __pyx_L1_error)
20057 __pyx_builtin_enumerate = __Pyx_GetBuiltinName(__pyx_n_s_enumerate);
if (!__pyx_builtin_enumerate) __PYX_ERR(0, 151, __pyx_L1_error)
20058 __pyx_builtin_range = __Pyx_GetBuiltinName(__pyx_n_s_range);
if (!__pyx_builtin_range) __PYX_ERR(0, 180, __pyx_L1_error)
20059 __pyx_builtin_Ellipsis = __Pyx_GetBuiltinName(__pyx_n_s_Ellipsis);
if (!__pyx_builtin_Ellipsis) __PYX_ERR(0, 404, __pyx_L1_error)
20060 __pyx_builtin_id = __Pyx_GetBuiltinName(__pyx_n_s_id);
if (!__pyx_builtin_id) __PYX_ERR(0, 613, __pyx_L1_error)
20061 __pyx_builtin_IndexError = __Pyx_GetBuiltinName(__pyx_n_s_IndexError);
if (!__pyx_builtin_IndexError) __PYX_ERR(0, 832, __pyx_L1_error)
20067 static CYTHON_SMALL_CODE
int __Pyx_InitCachedConstants(
void) {
20068 __Pyx_RefNannyDeclarations
20069 __Pyx_RefNannySetupContext(
"__Pyx_InitCachedConstants", 0);
20078 __pyx_slice_ = PySlice_New(Py_None, Py_None, Py_None);
if (unlikely(!__pyx_slice_)) __PYX_ERR(1, 31, __pyx_L1_error)
20079 __Pyx_GOTREF(__pyx_slice_);
20080 __Pyx_GIVEREF(__pyx_slice_);
20088 __pyx_tuple__2 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non);
if (unlikely(!__pyx_tuple__2)) __PYX_ERR(0, 2, __pyx_L1_error)
20089 __Pyx_GOTREF(__pyx_tuple__2);
20090 __Pyx_GIVEREF(__pyx_tuple__2);
20097 __pyx_tuple__3 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non);
if (unlikely(!__pyx_tuple__3)) __PYX_ERR(0, 4, __pyx_L1_error)
20098 __Pyx_GOTREF(__pyx_tuple__3);
20099 __Pyx_GIVEREF(__pyx_tuple__3);
20108 __pyx_tuple__4 = PyTuple_Pack(1, __pyx_kp_s_numpy_core_multiarray_failed_to);
if (unlikely(!__pyx_tuple__4)) __PYX_ERR(2, 945, __pyx_L1_error)
20109 __Pyx_GOTREF(__pyx_tuple__4);
20110 __Pyx_GIVEREF(__pyx_tuple__4);
20119 __pyx_tuple__5 = PyTuple_Pack(1, __pyx_kp_s_numpy_core_umath_failed_to_impor);
if (unlikely(!__pyx_tuple__5)) __PYX_ERR(2, 951, __pyx_L1_error)
20120 __Pyx_GOTREF(__pyx_tuple__5);
20121 __Pyx_GIVEREF(__pyx_tuple__5);
20130 __pyx_tuple__6 = PyTuple_Pack(1, __pyx_kp_s_Empty_shape_tuple_for_cython_arr);
if (unlikely(!__pyx_tuple__6)) __PYX_ERR(0, 133, __pyx_L1_error)
20131 __Pyx_GOTREF(__pyx_tuple__6);
20132 __Pyx_GIVEREF(__pyx_tuple__6);
20141 __pyx_tuple__7 = PyTuple_Pack(1, __pyx_kp_s_itemsize_0_for_cython_array);
if (unlikely(!__pyx_tuple__7)) __PYX_ERR(0, 136, __pyx_L1_error)
20142 __Pyx_GOTREF(__pyx_tuple__7);
20143 __Pyx_GIVEREF(__pyx_tuple__7);
20152 __pyx_tuple__8 = PyTuple_Pack(1, __pyx_kp_s_unable_to_allocate_shape_and_str);
if (unlikely(!__pyx_tuple__8)) __PYX_ERR(0, 148, __pyx_L1_error)
20153 __Pyx_GOTREF(__pyx_tuple__8);
20154 __Pyx_GIVEREF(__pyx_tuple__8);
20163 __pyx_tuple__9 = PyTuple_Pack(1, __pyx_kp_s_unable_to_allocate_array_data);
if (unlikely(!__pyx_tuple__9)) __PYX_ERR(0, 176, __pyx_L1_error)
20164 __Pyx_GOTREF(__pyx_tuple__9);
20165 __Pyx_GIVEREF(__pyx_tuple__9);
20174 __pyx_tuple__10 = PyTuple_Pack(1, __pyx_kp_s_Can_only_create_a_buffer_that_is);
if (unlikely(!__pyx_tuple__10)) __PYX_ERR(0, 192, __pyx_L1_error)
20175 __Pyx_GOTREF(__pyx_tuple__10);
20176 __Pyx_GIVEREF(__pyx_tuple__10);
20184 __pyx_tuple__11 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non);
if (unlikely(!__pyx_tuple__11)) __PYX_ERR(0, 2, __pyx_L1_error)
20185 __Pyx_GOTREF(__pyx_tuple__11);
20186 __Pyx_GIVEREF(__pyx_tuple__11);
20193 __pyx_tuple__12 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non);
if (unlikely(!__pyx_tuple__12)) __PYX_ERR(0, 4, __pyx_L1_error)
20194 __Pyx_GOTREF(__pyx_tuple__12);
20195 __Pyx_GIVEREF(__pyx_tuple__12);
20204 __pyx_tuple__13 = PyTuple_Pack(1, __pyx_kp_s_Cannot_assign_to_read_only_memor);
if (unlikely(!__pyx_tuple__13)) __PYX_ERR(0, 418, __pyx_L1_error)
20205 __Pyx_GOTREF(__pyx_tuple__13);
20206 __Pyx_GIVEREF(__pyx_tuple__13);
20215 __pyx_tuple__14 = PyTuple_Pack(1, __pyx_kp_s_Unable_to_convert_item_to_object);
if (unlikely(!__pyx_tuple__14)) __PYX_ERR(0, 495, __pyx_L1_error)
20216 __Pyx_GOTREF(__pyx_tuple__14);
20217 __Pyx_GIVEREF(__pyx_tuple__14);
20226 __pyx_tuple__15 = PyTuple_Pack(1, __pyx_kp_s_Cannot_create_writable_memory_vi);
if (unlikely(!__pyx_tuple__15)) __PYX_ERR(0, 520, __pyx_L1_error)
20227 __Pyx_GOTREF(__pyx_tuple__15);
20228 __Pyx_GIVEREF(__pyx_tuple__15);
20237 __pyx_tuple__16 = PyTuple_Pack(1, __pyx_kp_s_Buffer_view_does_not_expose_stri);
if (unlikely(!__pyx_tuple__16)) __PYX_ERR(0, 570, __pyx_L1_error)
20238 __Pyx_GOTREF(__pyx_tuple__16);
20239 __Pyx_GIVEREF(__pyx_tuple__16);
20248 __pyx_tuple__17 = PyTuple_New(1);
if (unlikely(!__pyx_tuple__17)) __PYX_ERR(0, 577, __pyx_L1_error)
20249 __Pyx_GOTREF(__pyx_tuple__17);
20250 __Pyx_INCREF(__pyx_int_neg_1);
20251 __Pyx_GIVEREF(__pyx_int_neg_1);
20252 PyTuple_SET_ITEM(__pyx_tuple__17, 0, __pyx_int_neg_1);
20253 __Pyx_GIVEREF(__pyx_tuple__17);
20261 __pyx_tuple__18 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non);
if (unlikely(!__pyx_tuple__18)) __PYX_ERR(0, 2, __pyx_L1_error)
20262 __Pyx_GOTREF(__pyx_tuple__18);
20263 __Pyx_GIVEREF(__pyx_tuple__18);
20270 __pyx_tuple__19 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non);
if (unlikely(!__pyx_tuple__19)) __PYX_ERR(0, 4, __pyx_L1_error)
20271 __Pyx_GOTREF(__pyx_tuple__19);
20272 __Pyx_GIVEREF(__pyx_tuple__19);
20281 __pyx_tuple__20 = PyTuple_Pack(1, __pyx_kp_s_Indirect_dimensions_not_supporte);
if (unlikely(!__pyx_tuple__20)) __PYX_ERR(0, 703, __pyx_L1_error)
20282 __Pyx_GOTREF(__pyx_tuple__20);
20283 __Pyx_GIVEREF(__pyx_tuple__20);
20291 __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)
20292 __Pyx_GOTREF(__pyx_tuple__21);
20293 __Pyx_GIVEREF(__pyx_tuple__21);
20300 __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)
20301 __Pyx_GOTREF(__pyx_tuple__22);
20302 __Pyx_GIVEREF(__pyx_tuple__22);
20303 __pyx_tuple__23 = PyTuple_Pack(3, __pyx_int_184977713, __pyx_int_136983863, __pyx_int_112105877);
if (unlikely(!__pyx_tuple__23)) __PYX_ERR(0, 4, __pyx_L1_error)
20304 __Pyx_GOTREF(__pyx_tuple__23);
20305 __Pyx_GIVEREF(__pyx_tuple__23);
20314 __pyx_tuple__29 = PyTuple_Pack(1, __pyx_kp_s_strided_and_direct_or_indirect);
if (unlikely(!__pyx_tuple__29)) __PYX_ERR(0, 286, __pyx_L1_error)
20315 __Pyx_GOTREF(__pyx_tuple__29);
20316 __Pyx_GIVEREF(__pyx_tuple__29);
20325 __pyx_tuple__30 = PyTuple_Pack(1, __pyx_kp_s_strided_and_direct);
if (unlikely(!__pyx_tuple__30)) __PYX_ERR(0, 287, __pyx_L1_error)
20326 __Pyx_GOTREF(__pyx_tuple__30);
20327 __Pyx_GIVEREF(__pyx_tuple__30);
20336 __pyx_tuple__31 = PyTuple_Pack(1, __pyx_kp_s_strided_and_indirect);
if (unlikely(!__pyx_tuple__31)) __PYX_ERR(0, 288, __pyx_L1_error)
20337 __Pyx_GOTREF(__pyx_tuple__31);
20338 __Pyx_GIVEREF(__pyx_tuple__31);
20347 __pyx_tuple__32 = PyTuple_Pack(1, __pyx_kp_s_contiguous_and_direct);
if (unlikely(!__pyx_tuple__32)) __PYX_ERR(0, 291, __pyx_L1_error)
20348 __Pyx_GOTREF(__pyx_tuple__32);
20349 __Pyx_GIVEREF(__pyx_tuple__32);
20358 __pyx_tuple__33 = PyTuple_Pack(1, __pyx_kp_s_contiguous_and_indirect);
if (unlikely(!__pyx_tuple__33)) __PYX_ERR(0, 292, __pyx_L1_error)
20359 __Pyx_GOTREF(__pyx_tuple__33);
20360 __Pyx_GIVEREF(__pyx_tuple__33);
20367 __pyx_tuple__34 = 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__34)) __PYX_ERR(0, 1, __pyx_L1_error)
20368 __Pyx_GOTREF(__pyx_tuple__34);
20369 __Pyx_GIVEREF(__pyx_tuple__34);
20370 __pyx_codeobj__35 = (PyObject*)__Pyx_PyCode_New(3, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__34, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_pyx_unpickle_Enum, 1, __pyx_empty_bytes);
if (unlikely(!__pyx_codeobj__35)) __PYX_ERR(0, 1, __pyx_L1_error)
20371 __Pyx_RefNannyFinishContext();
20374 __Pyx_RefNannyFinishContext();
20378 static CYTHON_SMALL_CODE
int __Pyx_InitGlobals(
void) {
20379 if (__Pyx_InitStrings(__pyx_string_tab) < 0) __PYX_ERR(1, 1, __pyx_L1_error);
20380 __pyx_int_0 = PyInt_FromLong(0);
if (unlikely(!__pyx_int_0)) __PYX_ERR(1, 1, __pyx_L1_error)
20381 __pyx_int_1 = PyInt_FromLong(1);
if (unlikely(!__pyx_int_1)) __PYX_ERR(1, 1, __pyx_L1_error)
20382 __pyx_int_112105877 = PyInt_FromLong(112105877
L);
if (unlikely(!__pyx_int_112105877)) __PYX_ERR(1, 1, __pyx_L1_error)
20383 __pyx_int_136983863 = PyInt_FromLong(136983863
L);
if (unlikely(!__pyx_int_136983863)) __PYX_ERR(1, 1, __pyx_L1_error)
20384 __pyx_int_184977713 = PyInt_FromLong(184977713
L);
if (unlikely(!__pyx_int_184977713)) __PYX_ERR(1, 1, __pyx_L1_error)
20385 __pyx_int_neg_1 = PyInt_FromLong(-1);
if (unlikely(!__pyx_int_neg_1)) __PYX_ERR(1, 1, __pyx_L1_error)
20391 static CYTHON_SMALL_CODE
int __Pyx_modinit_global_init_code(
void);
20392 static CYTHON_SMALL_CODE
int __Pyx_modinit_variable_export_code(
void);
20393 static CYTHON_SMALL_CODE
int __Pyx_modinit_function_export_code(
void);
20394 static CYTHON_SMALL_CODE
int __Pyx_modinit_type_init_code(
void);
20395 static CYTHON_SMALL_CODE
int __Pyx_modinit_type_import_code(
void);
20396 static CYTHON_SMALL_CODE
int __Pyx_modinit_variable_import_code(
void);
20397 static CYTHON_SMALL_CODE
int __Pyx_modinit_function_import_code(
void);
20399 static int __Pyx_modinit_global_init_code(
void) {
20400 __Pyx_RefNannyDeclarations
20401 __Pyx_RefNannySetupContext(
"__Pyx_modinit_global_init_code", 0);
20403 generic = Py_None; Py_INCREF(Py_None);
20404 strided = Py_None; Py_INCREF(Py_None);
20405 indirect = Py_None; Py_INCREF(Py_None);
20406 contiguous = Py_None; Py_INCREF(Py_None);
20407 indirect_contiguous = Py_None; Py_INCREF(Py_None);
20408 __Pyx_RefNannyFinishContext();
20412 static int __Pyx_modinit_variable_export_code(
void) {
20413 __Pyx_RefNannyDeclarations
20414 __Pyx_RefNannySetupContext(
"__Pyx_modinit_variable_export_code", 0);
20416 __Pyx_RefNannyFinishContext();
20420 static int __Pyx_modinit_function_export_code(
void) {
20421 __Pyx_RefNannyDeclarations
20422 __Pyx_RefNannySetupContext(
"__Pyx_modinit_function_export_code", 0);
20424 __Pyx_RefNannyFinishContext();
20428 static int __Pyx_modinit_type_init_code(
void) {
20429 __Pyx_RefNannyDeclarations
20430 int __pyx_lineno = 0;
20431 const char *__pyx_filename = NULL;
20432 int __pyx_clineno = 0;
20433 __Pyx_RefNannySetupContext(
"__Pyx_modinit_type_init_code", 0);
20435 if (PyType_Ready(&__pyx_type_14flcbdfWrappers_FLCBDF_integrator) < 0) __PYX_ERR(1, 5, __pyx_L1_error)
20436 #if PY_VERSION_HEX < 0x030800B1
20437 __pyx_type_14flcbdfWrappers_FLCBDF_integrator.tp_print = 0;
20439 if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_14flcbdfWrappers_FLCBDF_integrator.tp_dictoffset && __pyx_type_14flcbdfWrappers_FLCBDF_integrator.tp_getattro == PyObject_GenericGetAttr)) {
20440 __pyx_type_14flcbdfWrappers_FLCBDF_integrator.tp_getattro = __Pyx_PyObject_GenericGetAttr;
20442 if (PyObject_SetAttr(__pyx_m, __pyx_n_s_FLCBDF_integrator, (PyObject *)&__pyx_type_14flcbdfWrappers_FLCBDF_integrator) < 0) __PYX_ERR(1, 5, __pyx_L1_error)
20443 if (__Pyx_setup_reduce((PyObject*)&__pyx_type_14flcbdfWrappers_FLCBDF_integrator) < 0) __PYX_ERR(1, 5, __pyx_L1_error)
20444 __pyx_ptype_14flcbdfWrappers_FLCBDF_integrator = &__pyx_type_14flcbdfWrappers_FLCBDF_integrator;
20445 __pyx_vtabptr_array = &__pyx_vtable_array;
20446 __pyx_vtable_array.get_memview = (PyObject *(*)(
struct __pyx_array_obj *))__pyx_array_get_memview;
20447 if (PyType_Ready(&__pyx_type___pyx_array) < 0) __PYX_ERR(0, 105, __pyx_L1_error)
20448 #if PY_VERSION_HEX < 0x030800B1
20449 __pyx_type___pyx_array.tp_print = 0;
20451 if (__Pyx_SetVtable(__pyx_type___pyx_array.tp_dict, __pyx_vtabptr_array) < 0) __PYX_ERR(0, 105, __pyx_L1_error)
20452 if (__Pyx_setup_reduce((PyObject*)&__pyx_type___pyx_array) < 0) __PYX_ERR(0, 105, __pyx_L1_error)
20453 __pyx_array_type = &__pyx_type___pyx_array;
20454 if (PyType_Ready(&__pyx_type___pyx_MemviewEnum) < 0) __PYX_ERR(0, 279, __pyx_L1_error)
20455 #if PY_VERSION_HEX < 0x030800B1
20456 __pyx_type___pyx_MemviewEnum.tp_print = 0;
20458 if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type___pyx_MemviewEnum.tp_dictoffset && __pyx_type___pyx_MemviewEnum.tp_getattro == PyObject_GenericGetAttr)) {
20459 __pyx_type___pyx_MemviewEnum.tp_getattro = __Pyx_PyObject_GenericGetAttr;
20461 if (__Pyx_setup_reduce((PyObject*)&__pyx_type___pyx_MemviewEnum) < 0) __PYX_ERR(0, 279, __pyx_L1_error)
20462 __pyx_MemviewEnum_type = &__pyx_type___pyx_MemviewEnum;
20463 __pyx_vtabptr_memoryview = &__pyx_vtable_memoryview;
20464 __pyx_vtable_memoryview.get_item_pointer = (
char *(*)(
struct __pyx_memoryview_obj *, PyObject *))__pyx_memoryview_get_item_pointer;
20465 __pyx_vtable_memoryview.is_slice = (PyObject *(*)(
struct __pyx_memoryview_obj *, PyObject *))__pyx_memoryview_is_slice;
20466 __pyx_vtable_memoryview.setitem_slice_assignment = (PyObject *(*)(
struct __pyx_memoryview_obj *, PyObject *, PyObject *))__pyx_memoryview_setitem_slice_assignment;
20467 __pyx_vtable_memoryview.setitem_slice_assign_scalar = (PyObject *(*)(
struct __pyx_memoryview_obj *,
struct __pyx_memoryview_obj *, PyObject *))__pyx_memoryview_setitem_slice_assign_scalar;
20468 __pyx_vtable_memoryview.setitem_indexed = (PyObject *(*)(
struct __pyx_memoryview_obj *, PyObject *, PyObject *))__pyx_memoryview_setitem_indexed;
20469 __pyx_vtable_memoryview.convert_item_to_object = (PyObject *(*)(
struct __pyx_memoryview_obj *,
char *))__pyx_memoryview_convert_item_to_object;
20470 __pyx_vtable_memoryview.assign_item_from_object = (PyObject *(*)(
struct __pyx_memoryview_obj *,
char *, PyObject *))__pyx_memoryview_assign_item_from_object;
20471 if (PyType_Ready(&__pyx_type___pyx_memoryview) < 0) __PYX_ERR(0, 330, __pyx_L1_error)
20472 #if PY_VERSION_HEX < 0x030800B1
20473 __pyx_type___pyx_memoryview.tp_print = 0;
20475 if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type___pyx_memoryview.tp_dictoffset && __pyx_type___pyx_memoryview.tp_getattro == PyObject_GenericGetAttr)) {
20476 __pyx_type___pyx_memoryview.tp_getattro = __Pyx_PyObject_GenericGetAttr;
20478 if (__Pyx_SetVtable(__pyx_type___pyx_memoryview.tp_dict, __pyx_vtabptr_memoryview) < 0) __PYX_ERR(0, 330, __pyx_L1_error)
20479 if (__Pyx_setup_reduce((PyObject*)&__pyx_type___pyx_memoryview) < 0) __PYX_ERR(0, 330, __pyx_L1_error)
20480 __pyx_memoryview_type = &__pyx_type___pyx_memoryview;
20481 __pyx_vtabptr__memoryviewslice = &__pyx_vtable__memoryviewslice;
20482 __pyx_vtable__memoryviewslice.__pyx_base = *__pyx_vtabptr_memoryview;
20483 __pyx_vtable__memoryviewslice.__pyx_base.convert_item_to_object = (PyObject *(*)(
struct __pyx_memoryview_obj *,
char *))__pyx_memoryviewslice_convert_item_to_object;
20484 __pyx_vtable__memoryviewslice.__pyx_base.assign_item_from_object = (PyObject *(*)(
struct __pyx_memoryview_obj *,
char *, PyObject *))__pyx_memoryviewslice_assign_item_from_object;
20485 __pyx_type___pyx_memoryviewslice.tp_base = __pyx_memoryview_type;
20486 if (PyType_Ready(&__pyx_type___pyx_memoryviewslice) < 0) __PYX_ERR(0, 965, __pyx_L1_error)
20487 #if PY_VERSION_HEX < 0x030800B1
20488 __pyx_type___pyx_memoryviewslice.tp_print = 0;
20490 if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type___pyx_memoryviewslice.tp_dictoffset && __pyx_type___pyx_memoryviewslice.tp_getattro == PyObject_GenericGetAttr)) {
20491 __pyx_type___pyx_memoryviewslice.tp_getattro = __Pyx_PyObject_GenericGetAttr;
20493 if (__Pyx_SetVtable(__pyx_type___pyx_memoryviewslice.tp_dict, __pyx_vtabptr__memoryviewslice) < 0) __PYX_ERR(0, 965, __pyx_L1_error)
20494 if (__Pyx_setup_reduce((PyObject*)&__pyx_type___pyx_memoryviewslice) < 0) __PYX_ERR(0, 965, __pyx_L1_error)
20495 __pyx_memoryviewslice_type = &__pyx_type___pyx_memoryviewslice;
20496 __Pyx_RefNannyFinishContext();
20499 __Pyx_RefNannyFinishContext();
20503 static int __Pyx_modinit_type_import_code(
void) {
20504 __Pyx_RefNannyDeclarations
20505 PyObject *__pyx_t_1 = NULL;
20506 int __pyx_lineno = 0;
20507 const char *__pyx_filename = NULL;
20508 int __pyx_clineno = 0;
20509 __Pyx_RefNannySetupContext(
"__Pyx_modinit_type_import_code", 0);
20511 __pyx_t_1 = PyImport_ImportModule(__Pyx_BUILTIN_MODULE_NAME);
if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 9, __pyx_L1_error)
20512 __Pyx_GOTREF(__pyx_t_1);
20513 __pyx_ptype_7cpython_4type_type = __Pyx_ImportType(__pyx_t_1, __Pyx_BUILTIN_MODULE_NAME,
"type",
20514 #
if defined(PYPY_VERSION_NUM) && PYPY_VERSION_NUM < 0x050B0000
20515 sizeof(PyTypeObject),
20517 sizeof(PyHeapTypeObject),
20519 __Pyx_ImportType_CheckSize_Warn);
20520 if (!__pyx_ptype_7cpython_4type_type) __PYX_ERR(3, 9, __pyx_L1_error)
20521 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
20522 __pyx_t_1 = PyImport_ImportModule(
"numpy");
if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 200, __pyx_L1_error)
20523 __Pyx_GOTREF(__pyx_t_1);
20524 __pyx_ptype_5numpy_dtype = __Pyx_ImportType(__pyx_t_1,
"numpy",
"dtype",
sizeof(PyArray_Descr), __Pyx_ImportType_CheckSize_Ignore);
20525 if (!__pyx_ptype_5numpy_dtype) __PYX_ERR(2, 200, __pyx_L1_error)
20526 __pyx_ptype_5numpy_flatiter = __Pyx_ImportType(__pyx_t_1,
"numpy",
"flatiter",
sizeof(PyArrayIterObject), __Pyx_ImportType_CheckSize_Ignore);
20527 if (!__pyx_ptype_5numpy_flatiter) __PYX_ERR(2, 223, __pyx_L1_error)
20528 __pyx_ptype_5numpy_broadcast = __Pyx_ImportType(__pyx_t_1,
"numpy",
"broadcast",
sizeof(PyArrayMultiIterObject), __Pyx_ImportType_CheckSize_Ignore);
20529 if (!__pyx_ptype_5numpy_broadcast) __PYX_ERR(2, 227, __pyx_L1_error)
20530 __pyx_ptype_5numpy_ndarray = __Pyx_ImportType(__pyx_t_1,
"numpy",
"ndarray",
sizeof(PyArrayObject), __Pyx_ImportType_CheckSize_Ignore);
20531 if (!__pyx_ptype_5numpy_ndarray) __PYX_ERR(2, 239, __pyx_L1_error)
20532 __pyx_ptype_5numpy_generic = __Pyx_ImportType(__pyx_t_1,
"numpy",
"generic",
sizeof(PyObject), __Pyx_ImportType_CheckSize_Warn);
20533 if (!__pyx_ptype_5numpy_generic) __PYX_ERR(2, 771, __pyx_L1_error)
20534 __pyx_ptype_5numpy_number = __Pyx_ImportType(__pyx_t_1,
"numpy",
"number",
sizeof(PyObject), __Pyx_ImportType_CheckSize_Warn);
20535 if (!__pyx_ptype_5numpy_number) __PYX_ERR(2, 773, __pyx_L1_error)
20536 __pyx_ptype_5numpy_integer = __Pyx_ImportType(__pyx_t_1,
"numpy",
"integer",
sizeof(PyObject), __Pyx_ImportType_CheckSize_Warn);
20537 if (!__pyx_ptype_5numpy_integer) __PYX_ERR(2, 775, __pyx_L1_error)
20538 __pyx_ptype_5numpy_signedinteger = __Pyx_ImportType(__pyx_t_1,
"numpy",
"signedinteger",
sizeof(PyObject), __Pyx_ImportType_CheckSize_Warn);
20539 if (!__pyx_ptype_5numpy_signedinteger) __PYX_ERR(2, 777, __pyx_L1_error)
20540 __pyx_ptype_5numpy_unsignedinteger = __Pyx_ImportType(__pyx_t_1,
"numpy",
"unsignedinteger",
sizeof(PyObject), __Pyx_ImportType_CheckSize_Warn);
20541 if (!__pyx_ptype_5numpy_unsignedinteger) __PYX_ERR(2, 779, __pyx_L1_error)
20542 __pyx_ptype_5numpy_inexact = __Pyx_ImportType(__pyx_t_1,
"numpy",
"inexact",
sizeof(PyObject), __Pyx_ImportType_CheckSize_Warn);
20543 if (!__pyx_ptype_5numpy_inexact) __PYX_ERR(2, 781, __pyx_L1_error)
20544 __pyx_ptype_5numpy_floating = __Pyx_ImportType(__pyx_t_1,
"numpy",
"floating",
sizeof(PyObject), __Pyx_ImportType_CheckSize_Warn);
20545 if (!__pyx_ptype_5numpy_floating) __PYX_ERR(2, 783, __pyx_L1_error)
20546 __pyx_ptype_5numpy_complexfloating = __Pyx_ImportType(__pyx_t_1,
"numpy",
"complexfloating",
sizeof(PyObject), __Pyx_ImportType_CheckSize_Warn);
20547 if (!__pyx_ptype_5numpy_complexfloating) __PYX_ERR(2, 785, __pyx_L1_error)
20548 __pyx_ptype_5numpy_flexible = __Pyx_ImportType(__pyx_t_1,
"numpy",
"flexible",
sizeof(PyObject), __Pyx_ImportType_CheckSize_Warn);
20549 if (!__pyx_ptype_5numpy_flexible) __PYX_ERR(2, 787, __pyx_L1_error)
20550 __pyx_ptype_5numpy_character = __Pyx_ImportType(__pyx_t_1,
"numpy",
"character",
sizeof(PyObject), __Pyx_ImportType_CheckSize_Warn);
20551 if (!__pyx_ptype_5numpy_character) __PYX_ERR(2, 789, __pyx_L1_error)
20552 __pyx_ptype_5numpy_ufunc = __Pyx_ImportType(__pyx_t_1,
"numpy",
"ufunc",
sizeof(PyUFuncObject), __Pyx_ImportType_CheckSize_Ignore);
20553 if (!__pyx_ptype_5numpy_ufunc) __PYX_ERR(2, 827, __pyx_L1_error)
20554 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
20555 __Pyx_RefNannyFinishContext();
20558 __Pyx_XDECREF(__pyx_t_1);
20559 __Pyx_RefNannyFinishContext();
20563 static int __Pyx_modinit_variable_import_code(
void) {
20564 __Pyx_RefNannyDeclarations
20565 __Pyx_RefNannySetupContext(
"__Pyx_modinit_variable_import_code", 0);
20567 __Pyx_RefNannyFinishContext();
20571 static int __Pyx_modinit_function_import_code(
void) {
20572 __Pyx_RefNannyDeclarations
20573 __Pyx_RefNannySetupContext(
"__Pyx_modinit_function_import_code", 0);
20575 __Pyx_RefNannyFinishContext();
20580 #ifndef CYTHON_NO_PYINIT_EXPORT
20581 #define __Pyx_PyMODINIT_FUNC PyMODINIT_FUNC
20582 #elif PY_MAJOR_VERSION < 3
20584 #define __Pyx_PyMODINIT_FUNC extern "C" void
20586 #define __Pyx_PyMODINIT_FUNC void
20590 #define __Pyx_PyMODINIT_FUNC extern "C" PyObject *
20592 #define __Pyx_PyMODINIT_FUNC PyObject *
20597 #if PY_MAJOR_VERSION < 3
20598 __Pyx_PyMODINIT_FUNC initflcbdfWrappers(
void) CYTHON_SMALL_CODE;
20599 __Pyx_PyMODINIT_FUNC initflcbdfWrappers(
void)
20601 __Pyx_PyMODINIT_FUNC PyInit_flcbdfWrappers(
void) CYTHON_SMALL_CODE;
20602 __Pyx_PyMODINIT_FUNC PyInit_flcbdfWrappers(
void)
20603 #if CYTHON_PEP489_MULTI_PHASE_INIT
20605 return PyModuleDef_Init(&__pyx_moduledef);
20607 static CYTHON_SMALL_CODE
int __Pyx_check_single_interpreter(
void) {
20608 #if PY_VERSION_HEX >= 0x030700A1
20609 static PY_INT64_T main_interpreter_id = -1;
20610 PY_INT64_T current_id = PyInterpreterState_GetID(PyThreadState_Get()->interp);
20611 if (main_interpreter_id == -1) {
20612 main_interpreter_id = current_id;
20613 return (unlikely(current_id == -1)) ? -1 : 0;
20614 }
else if (unlikely(main_interpreter_id != current_id))
20616 static PyInterpreterState *main_interpreter = NULL;
20617 PyInterpreterState *current_interpreter = PyThreadState_Get()->interp;
20618 if (!main_interpreter) {
20619 main_interpreter = current_interpreter;
20620 }
else if (unlikely(main_interpreter != current_interpreter))
20625 "Interpreter change detected - this module can only be loaded into one interpreter per process.");
20630 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) {
20631 PyObject *value = PyObject_GetAttrString(spec, from_name);
20633 if (likely(value)) {
20634 if (allow_none || value != Py_None) {
20635 result = PyDict_SetItemString(moddict, to_name, value);
20638 }
else if (PyErr_ExceptionMatches(PyExc_AttributeError)) {
20645 static CYTHON_SMALL_CODE PyObject* __pyx_pymod_create(PyObject *spec, CYTHON_UNUSED PyModuleDef *def) {
20646 PyObject *module = NULL, *moddict, *modname;
20647 if (__Pyx_check_single_interpreter())
20650 return __Pyx_NewRef(__pyx_m);
20651 modname = PyObject_GetAttrString(spec,
"name");
20652 if (unlikely(!modname))
goto bad;
20653 module = PyModule_NewObject(modname);
20654 Py_DECREF(modname);
20655 if (unlikely(!module))
goto bad;
20656 moddict = PyModule_GetDict(module);
20657 if (unlikely(!moddict))
goto bad;
20658 if (unlikely(__Pyx_copy_spec_to_module(spec, moddict,
"loader",
"__loader__", 1) < 0))
goto bad;
20659 if (unlikely(__Pyx_copy_spec_to_module(spec, moddict,
"origin",
"__file__", 1) < 0))
goto bad;
20660 if (unlikely(__Pyx_copy_spec_to_module(spec, moddict,
"parent",
"__package__", 1) < 0))
goto bad;
20661 if (unlikely(__Pyx_copy_spec_to_module(spec, moddict,
"submodule_search_locations",
"__path__", 0) < 0))
goto bad;
20664 Py_XDECREF(module);
20669 static CYTHON_SMALL_CODE
int __pyx_pymod_exec_flcbdfWrappers(PyObject *__pyx_pyinit_module)
20673 PyObject *__pyx_t_1 = NULL;
20674 static PyThread_type_lock __pyx_t_2[8];
20675 int __pyx_lineno = 0;
20676 const char *__pyx_filename = NULL;
20677 int __pyx_clineno = 0;
20678 __Pyx_RefNannyDeclarations
20679 #if CYTHON_PEP489_MULTI_PHASE_INIT
20681 if (__pyx_m == __pyx_pyinit_module)
return 0;
20682 PyErr_SetString(PyExc_RuntimeError,
"Module 'flcbdfWrappers' has already been imported. Re-initialisation is not supported.");
20685 #elif PY_MAJOR_VERSION >= 3
20686 if (__pyx_m)
return __Pyx_NewRef(__pyx_m);
20688 #if CYTHON_REFNANNY
20689 __Pyx_RefNanny = __Pyx_RefNannyImportAPI(
"refnanny");
20690 if (!__Pyx_RefNanny) {
20692 __Pyx_RefNanny = __Pyx_RefNannyImportAPI(
"Cython.Runtime.refnanny");
20693 if (!__Pyx_RefNanny)
20694 Py_FatalError(
"failed to import 'refnanny' module");
20697 __Pyx_RefNannySetupContext(
"__Pyx_PyMODINIT_FUNC PyInit_flcbdfWrappers(void)", 0);
20698 if (__Pyx_check_binary_version() < 0) __PYX_ERR(1, 1, __pyx_L1_error)
20699 #ifdef __Pxy_PyFrame_Initialize_Offsets
20700 __Pxy_PyFrame_Initialize_Offsets();
20702 __pyx_empty_tuple = PyTuple_New(0);
if (unlikely(!__pyx_empty_tuple)) __PYX_ERR(1, 1, __pyx_L1_error)
20703 __pyx_empty_bytes = PyBytes_FromStringAndSize(
"", 0);
if (unlikely(!__pyx_empty_bytes)) __PYX_ERR(1, 1, __pyx_L1_error)
20704 __pyx_empty_unicode = PyUnicode_FromStringAndSize(
"", 0);
if (unlikely(!__pyx_empty_unicode)) __PYX_ERR(1, 1, __pyx_L1_error)
20705 #ifdef __Pyx_CyFunction_USED
20706 if (__pyx_CyFunction_init() < 0) __PYX_ERR(1, 1, __pyx_L1_error)
20708 #ifdef __Pyx_FusedFunction_USED
20709 if (__pyx_FusedFunction_init() < 0) __PYX_ERR(1, 1, __pyx_L1_error)
20711 #ifdef __Pyx_Coroutine_USED
20712 if (__pyx_Coroutine_init() < 0) __PYX_ERR(1, 1, __pyx_L1_error)
20714 #ifdef __Pyx_Generator_USED
20715 if (__pyx_Generator_init() < 0) __PYX_ERR(1, 1, __pyx_L1_error)
20717 #ifdef __Pyx_AsyncGen_USED
20718 if (__pyx_AsyncGen_init() < 0) __PYX_ERR(1, 1, __pyx_L1_error)
20720 #ifdef __Pyx_StopAsyncIteration_USED
20721 if (__pyx_StopAsyncIteration_init() < 0) __PYX_ERR(1, 1, __pyx_L1_error)
20725 #if defined(WITH_THREAD) && PY_VERSION_HEX < 0x030700F0 && defined(__PYX_FORCE_INIT_THREADS) && __PYX_FORCE_INIT_THREADS
20726 PyEval_InitThreads();
20729 #if CYTHON_PEP489_MULTI_PHASE_INIT
20730 __pyx_m = __pyx_pyinit_module;
20731 Py_INCREF(__pyx_m);
20733 #if PY_MAJOR_VERSION < 3
20734 __pyx_m = Py_InitModule4(
"flcbdfWrappers", __pyx_methods, 0, 0, PYTHON_API_VERSION); Py_XINCREF(__pyx_m);
20736 __pyx_m = PyModule_Create(&__pyx_moduledef);
20738 if (unlikely(!__pyx_m)) __PYX_ERR(1, 1, __pyx_L1_error)
20740 __pyx_d = PyModule_GetDict(__pyx_m);
if (unlikely(!__pyx_d)) __PYX_ERR(1, 1, __pyx_L1_error)
20741 Py_INCREF(__pyx_d);
20742 __pyx_b = PyImport_AddModule(__Pyx_BUILTIN_MODULE_NAME);
if (unlikely(!__pyx_b)) __PYX_ERR(1, 1, __pyx_L1_error)
20743 Py_INCREF(__pyx_b);
20744 __pyx_cython_runtime = PyImport_AddModule((
char *)
"cython_runtime");
if (unlikely(!__pyx_cython_runtime)) __PYX_ERR(1, 1, __pyx_L1_error)
20745 Py_INCREF(__pyx_cython_runtime);
20746 if (PyObject_SetAttrString(__pyx_m,
"__builtins__", __pyx_b) < 0) __PYX_ERR(1, 1, __pyx_L1_error);
20748 if (__Pyx_InitGlobals() < 0) __PYX_ERR(1, 1, __pyx_L1_error)
20749 #if PY_MAJOR_VERSION < 3 && (__PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT)
20750 if (__Pyx_init_sys_getdefaultencoding_params() < 0) __PYX_ERR(1, 1, __pyx_L1_error)
20752 if (__pyx_module_is_main_flcbdfWrappers) {
20753 if (PyObject_SetAttr(__pyx_m, __pyx_n_s_name_2, __pyx_n_s_main) < 0) __PYX_ERR(1, 1, __pyx_L1_error)
20755 #if PY_MAJOR_VERSION >= 3
20757 PyObject *modules = PyImport_GetModuleDict();
if (unlikely(!modules)) __PYX_ERR(1, 1, __pyx_L1_error)
20758 if (!PyDict_GetItemString(modules,
"flcbdfWrappers")) {
20759 if (unlikely(PyDict_SetItemString(modules,
"flcbdfWrappers", __pyx_m) < 0)) __PYX_ERR(1, 1, __pyx_L1_error)
20764 if (__Pyx_InitCachedBuiltins() < 0) __PYX_ERR(1, 1, __pyx_L1_error)
20766 if (__Pyx_InitCachedConstants() < 0) __PYX_ERR(1, 1, __pyx_L1_error)
20768 (void)__Pyx_modinit_global_init_code();
20769 (void)__Pyx_modinit_variable_export_code();
20770 (void)__Pyx_modinit_function_export_code();
20771 if (unlikely(__Pyx_modinit_type_init_code() < 0)) __PYX_ERR(1, 1, __pyx_L1_error)
20772 if (unlikely(__Pyx_modinit_type_import_code() < 0)) __PYX_ERR(1, 1, __pyx_L1_error)
20773 (void)__Pyx_modinit_variable_import_code();
20774 (void)__Pyx_modinit_function_import_code();
20776 #if defined(__Pyx_Generator_USED) || defined(__Pyx_Coroutine_USED)
20777 if (__Pyx_patch_abc() < 0) __PYX_ERR(1, 1, __pyx_L1_error)
20786 __pyx_t_1 = __Pyx_Import(__pyx_n_s_numpy, 0, -1);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 2, __pyx_L1_error)
20787 __Pyx_GOTREF(__pyx_t_1);
20788 if (PyDict_SetItem(__pyx_d, __pyx_n_s_np, __pyx_t_1) < 0) __PYX_ERR(1, 2, __pyx_L1_error)
20789 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
20796 __pyx_t_1 = __Pyx_PyDict_NewPresized(0);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1, __pyx_L1_error)
20797 __Pyx_GOTREF(__pyx_t_1);
20798 if (PyDict_SetItem(__pyx_d, __pyx_n_s_test, __pyx_t_1) < 0) __PYX_ERR(1, 1, __pyx_L1_error)
20799 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
20808 __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)
20809 __Pyx_GOTREF(__pyx_t_1);
20810 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)
20811 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
20812 PyType_Modified(__pyx_array_type);
20821 __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)__pyx_MemviewEnum_type), __pyx_tuple__29, NULL);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 286, __pyx_L1_error)
20822 __Pyx_GOTREF(__pyx_t_1);
20823 __Pyx_XGOTREF(
generic);
20824 __Pyx_DECREF_SET(
generic, __pyx_t_1);
20825 __Pyx_GIVEREF(__pyx_t_1);
20835 __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)__pyx_MemviewEnum_type), __pyx_tuple__30, NULL);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 287, __pyx_L1_error)
20836 __Pyx_GOTREF(__pyx_t_1);
20837 __Pyx_XGOTREF(strided);
20838 __Pyx_DECREF_SET(strided, __pyx_t_1);
20839 __Pyx_GIVEREF(__pyx_t_1);
20849 __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)__pyx_MemviewEnum_type), __pyx_tuple__31, NULL);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 288, __pyx_L1_error)
20850 __Pyx_GOTREF(__pyx_t_1);
20851 __Pyx_XGOTREF(indirect);
20852 __Pyx_DECREF_SET(indirect, __pyx_t_1);
20853 __Pyx_GIVEREF(__pyx_t_1);
20863 __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)__pyx_MemviewEnum_type), __pyx_tuple__32, NULL);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 291, __pyx_L1_error)
20864 __Pyx_GOTREF(__pyx_t_1);
20865 __Pyx_XGOTREF(contiguous);
20866 __Pyx_DECREF_SET(contiguous, __pyx_t_1);
20867 __Pyx_GIVEREF(__pyx_t_1);
20877 __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)__pyx_MemviewEnum_type), __pyx_tuple__33, NULL);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 292, __pyx_L1_error)
20878 __Pyx_GOTREF(__pyx_t_1);
20879 __Pyx_XGOTREF(indirect_contiguous);
20880 __Pyx_DECREF_SET(indirect_contiguous, __pyx_t_1);
20881 __Pyx_GIVEREF(__pyx_t_1);
20891 __pyx_memoryview_thread_locks_used = 0;
20900 __pyx_t_2[0] = PyThread_allocate_lock();
20901 __pyx_t_2[1] = PyThread_allocate_lock();
20902 __pyx_t_2[2] = PyThread_allocate_lock();
20903 __pyx_t_2[3] = PyThread_allocate_lock();
20904 __pyx_t_2[4] = PyThread_allocate_lock();
20905 __pyx_t_2[5] = PyThread_allocate_lock();
20906 __pyx_t_2[6] = PyThread_allocate_lock();
20907 __pyx_t_2[7] = PyThread_allocate_lock();
20908 memcpy(&(__pyx_memoryview_thread_locks[0]), __pyx_t_2,
sizeof(__pyx_memoryview_thread_locks[0]) * (8));
20917 __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)
20918 __Pyx_GOTREF(__pyx_t_1);
20919 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)
20920 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
20921 PyType_Modified(__pyx_memoryview_type);
20930 __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)
20931 __Pyx_GOTREF(__pyx_t_1);
20932 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)
20933 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
20934 PyType_Modified(__pyx_memoryviewslice_type);
20941 __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)
20942 __Pyx_GOTREF(__pyx_t_1);
20943 if (PyDict_SetItem(__pyx_d, __pyx_n_s_pyx_unpickle_Enum, __pyx_t_1) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
20944 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
20958 __Pyx_XDECREF(__pyx_t_1);
20961 __Pyx_AddTraceback(
"init flcbdfWrappers", __pyx_clineno, __pyx_lineno, __pyx_filename);
20964 }
else if (!PyErr_Occurred()) {
20965 PyErr_SetString(PyExc_ImportError,
"init flcbdfWrappers");
20968 __Pyx_RefNannyFinishContext();
20969 #if CYTHON_PEP489_MULTI_PHASE_INIT
20970 return (__pyx_m != NULL) ? 0 : -1;
20971 #elif PY_MAJOR_VERSION >= 3
20980 #if CYTHON_REFNANNY
20981 static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(
const char *modname) {
20982 PyObject *m = NULL, *p = NULL;
20984 m = PyImport_ImportModule(modname);
20986 p = PyObject_GetAttrString(m,
"RefNannyAPI");
20988 r = PyLong_AsVoidPtr(p);
20992 return (__Pyx_RefNannyAPIStruct *)
r;
20997 #if CYTHON_USE_TYPE_SLOTS
20998 static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name) {
20999 PyTypeObject* tp = Py_TYPE(obj);
21000 if (likely(tp->tp_getattro))
21001 return tp->tp_getattro(obj, attr_name);
21002 #if PY_MAJOR_VERSION < 3
21003 if (likely(tp->tp_getattr))
21004 return tp->tp_getattr(obj, PyString_AS_STRING(attr_name));
21006 return PyObject_GetAttr(obj, attr_name);
21011 static PyObject *__Pyx_GetBuiltinName(PyObject *name) {
21012 PyObject* result = __Pyx_PyObject_GetAttrStr(__pyx_b, name);
21013 if (unlikely(!result)) {
21014 PyErr_Format(PyExc_NameError,
21015 #
if PY_MAJOR_VERSION >= 3
21016 "name '%U' is not defined", name);
21018 "name '%.200s' is not defined", PyString_AS_STRING(name));
21025 static void __Pyx_RaiseArgtupleInvalid(
21026 const char* func_name,
21028 Py_ssize_t num_min,
21029 Py_ssize_t num_max,
21030 Py_ssize_t num_found)
21032 Py_ssize_t num_expected;
21033 const char *more_or_less;
21034 if (num_found < num_min) {
21035 num_expected = num_min;
21036 more_or_less =
"at least";
21038 num_expected = num_max;
21039 more_or_less =
"at most";
21042 more_or_less =
"exactly";
21044 PyErr_Format(PyExc_TypeError,
21045 "%.200s() takes %.8s %" CYTHON_FORMAT_SSIZE_T
"d positional argument%.1s (%" CYTHON_FORMAT_SSIZE_T
"d given)",
21046 func_name, more_or_less, num_expected,
21047 (num_expected == 1) ?
"" :
"s", num_found);
21051 static void __Pyx_RaiseDoubleKeywordsError(
21052 const char* func_name,
21055 PyErr_Format(PyExc_TypeError,
21056 #
if PY_MAJOR_VERSION >= 3
21057 "%s() got multiple values for keyword argument '%U'", func_name, kw_name);
21059 "%s() got multiple values for keyword argument '%s'", func_name,
21060 PyString_AsString(kw_name));
21065 static int __Pyx_ParseOptionalKeywords(
21067 PyObject **argnames[],
21069 PyObject *values[],
21070 Py_ssize_t num_pos_args,
21071 const char* function_name)
21073 PyObject *key = 0, *value = 0;
21074 Py_ssize_t
pos = 0;
21076 PyObject*** first_kw_arg = argnames + num_pos_args;
21077 while (PyDict_Next(kwds, &
pos, &key, &value)) {
21078 name = first_kw_arg;
21079 while (*name && (**name != key)) name++;
21081 values[name-argnames] = value;
21084 name = first_kw_arg;
21085 #if PY_MAJOR_VERSION < 3
21086 if (likely(PyString_Check(key))) {
21088 if ((CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**name) == PyString_GET_SIZE(key))
21089 && _PyString_Eq(**name, key)) {
21090 values[name-argnames] = value;
21095 if (*name)
continue;
21097 PyObject*** argname = argnames;
21098 while (argname != first_kw_arg) {
21099 if ((**argname == key) || (
21100 (CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**argname) == PyString_GET_SIZE(key))
21101 && _PyString_Eq(**argname, key))) {
21102 goto arg_passed_twice;
21109 if (likely(PyUnicode_Check(key))) {
21111 int cmp = (**name == key) ? 0 :
21112 #
if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3
21113 (__Pyx_PyUnicode_GET_LENGTH(**name) != __Pyx_PyUnicode_GET_LENGTH(key)) ? 1 :
21115 PyUnicode_Compare(**name, key);
21116 if (cmp < 0 && unlikely(PyErr_Occurred()))
goto bad;
21118 values[name-argnames] = value;
21123 if (*name)
continue;
21125 PyObject*** argname = argnames;
21126 while (argname != first_kw_arg) {
21127 int cmp = (**argname == key) ? 0 :
21128 #
if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3
21129 (__Pyx_PyUnicode_GET_LENGTH(**argname) != __Pyx_PyUnicode_GET_LENGTH(key)) ? 1 :
21131 PyUnicode_Compare(**argname, key);
21132 if (cmp < 0 && unlikely(PyErr_Occurred()))
goto bad;
21133 if (cmp == 0)
goto arg_passed_twice;
21138 goto invalid_keyword_type;
21140 if (unlikely(PyDict_SetItem(kwds2, key, value)))
goto bad;
21142 goto invalid_keyword;
21147 __Pyx_RaiseDoubleKeywordsError(function_name, key);
21149 invalid_keyword_type:
21150 PyErr_Format(PyExc_TypeError,
21151 "%.200s() keywords must be strings", function_name);
21154 PyErr_Format(PyExc_TypeError,
21155 #
if PY_MAJOR_VERSION < 3
21156 "%.200s() got an unexpected keyword argument '%.200s'",
21157 function_name, PyString_AsString(key));
21159 "%s() got an unexpected keyword argument '%U'",
21160 function_name, key);
21167 static int __Pyx__ArgTypeTest(PyObject *obj, PyTypeObject *type,
const char *name,
int exact)
21169 if (unlikely(!type)) {
21170 PyErr_SetString(PyExc_SystemError,
"Missing type object");
21174 #if PY_MAJOR_VERSION == 2
21175 if ((type == &PyBaseString_Type) && likely(__Pyx_PyBaseString_CheckExact(obj)))
return 1;
21179 if (likely(__Pyx_TypeCheck(obj, type)))
return 1;
21181 PyErr_Format(PyExc_TypeError,
21182 "Argument '%.200s' has incorrect type (expected %.200s, got %.200s)",
21183 name, type->tp_name, Py_TYPE(obj)->tp_name);
21188 #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_TYPE_SLOTS
21189 static CYTHON_INLINE PY_UINT64_T __Pyx_get_tp_dict_version(PyObject *obj) {
21190 PyObject *dict = Py_TYPE(obj)->tp_dict;
21191 return likely(dict) ? __PYX_GET_DICT_VERSION(dict) : 0;
21193 static CYTHON_INLINE PY_UINT64_T __Pyx_get_object_dict_version(PyObject *obj) {
21194 PyObject **dictptr = NULL;
21195 Py_ssize_t offset = Py_TYPE(obj)->tp_dictoffset;
21197 #if CYTHON_COMPILING_IN_CPYTHON
21198 dictptr = (likely(offset > 0)) ? (PyObject **) ((
char *)obj + offset) : _PyObject_GetDictPtr(obj);
21200 dictptr = _PyObject_GetDictPtr(obj);
21203 return (dictptr && *dictptr) ? __PYX_GET_DICT_VERSION(*dictptr) : 0;
21205 static CYTHON_INLINE
int __Pyx_object_dict_version_matches(PyObject* obj, PY_UINT64_T tp_dict_version, PY_UINT64_T obj_dict_version) {
21206 PyObject *dict = Py_TYPE(obj)->tp_dict;
21207 if (unlikely(!dict) || unlikely(tp_dict_version != __PYX_GET_DICT_VERSION(dict)))
21209 return obj_dict_version == __Pyx_get_object_dict_version(obj);
21214 #if CYTHON_USE_DICT_VERSIONS
21215 static PyObject *__Pyx__GetModuleGlobalName(PyObject *name, PY_UINT64_T *dict_version, PyObject **dict_cached_value)
21217 static CYTHON_INLINE PyObject *__Pyx__GetModuleGlobalName(PyObject *name)
21221 #if !CYTHON_AVOID_BORROWED_REFS
21222 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030500A1
21223 result = _PyDict_GetItem_KnownHash(__pyx_d, name, ((PyASCIIObject *) name)->hash);
21224 __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version)
21225 if (likely(result)) {
21226 return __Pyx_NewRef(result);
21227 }
else if (unlikely(PyErr_Occurred())) {
21231 result = PyDict_GetItem(__pyx_d, name);
21232 __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version)
21233 if (likely(result)) {
21234 return __Pyx_NewRef(result);
21238 result = PyObject_GetItem(__pyx_d, name);
21239 __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version)
21240 if (likely(result)) {
21241 return __Pyx_NewRef(result);
21245 return __Pyx_GetBuiltinName(name);
21249 #if CYTHON_FAST_PYCCALL
21250 static CYTHON_INLINE PyObject * __Pyx_PyCFunction_FastCall(PyObject *func_obj, PyObject **args, Py_ssize_t nargs) {
21251 PyCFunctionObject *func = (PyCFunctionObject*)func_obj;
21252 PyCFunction meth = PyCFunction_GET_FUNCTION(func);
21253 PyObject *
self = PyCFunction_GET_SELF(func);
21254 int flags = PyCFunction_GET_FLAGS(func);
21255 assert(PyCFunction_Check(func));
21256 assert(METH_FASTCALL == (flags & ~(METH_CLASS | METH_STATIC | METH_COEXIST | METH_KEYWORDS | METH_STACKLESS)));
21257 assert(nargs >= 0);
21258 assert(nargs == 0 || args != NULL);
21262 assert(!PyErr_Occurred());
21263 if ((PY_VERSION_HEX < 0x030700A0) || unlikely(flags & METH_KEYWORDS)) {
21264 return (*((__Pyx_PyCFunctionFastWithKeywords)(
void*)meth)) (
self, args, nargs, NULL);
21266 return (*((__Pyx_PyCFunctionFast)(
void*)meth)) (
self, args, nargs);
21272 #if CYTHON_FAST_PYCALL
21273 static PyObject* __Pyx_PyFunction_FastCallNoKw(PyCodeObject *co, PyObject **args, Py_ssize_t na,
21274 PyObject *globals) {
21276 PyThreadState *tstate = __Pyx_PyThreadState_Current;
21277 PyObject **fastlocals;
21280 assert(globals != NULL);
21285 assert(tstate != NULL);
21286 f = PyFrame_New(tstate, co, globals, NULL);
21290 fastlocals = __Pyx_PyFrame_GetLocalsplus(
f);
21291 for (i = 0; i < na; i++) {
21293 fastlocals[i] = *args++;
21295 result = PyEval_EvalFrameEx(
f,0);
21296 ++tstate->recursion_depth;
21298 --tstate->recursion_depth;
21301 #if 1 || PY_VERSION_HEX < 0x030600B1
21302 static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args, Py_ssize_t nargs, PyObject *kwargs) {
21303 PyCodeObject *co = (PyCodeObject *)PyFunction_GET_CODE(func);
21304 PyObject *globals = PyFunction_GET_GLOBALS(func);
21305 PyObject *argdefs = PyFunction_GET_DEFAULTS(func);
21307 #if PY_MAJOR_VERSION >= 3
21310 PyObject *kwtuple, **k;
21315 assert(kwargs == NULL || PyDict_Check(kwargs));
21316 nk = kwargs ? PyDict_Size(kwargs) : 0;
21317 if (Py_EnterRecursiveCall((
char*)
" while calling a Python object")) {
21321 #
if PY_MAJOR_VERSION >= 3
21322 co->co_kwonlyargcount == 0 &&
21324 likely(kwargs == NULL || nk == 0) &&
21325 co->co_flags == (CO_OPTIMIZED | CO_NEWLOCALS | CO_NOFREE)) {
21326 if (argdefs == NULL && co->co_argcount == nargs) {
21327 result = __Pyx_PyFunction_FastCallNoKw(co, args, nargs, globals);
21330 else if (nargs == 0 && argdefs != NULL
21331 && co->co_argcount == Py_SIZE(argdefs)) {
21334 args = &PyTuple_GET_ITEM(argdefs, 0);
21335 result =__Pyx_PyFunction_FastCallNoKw(co, args, Py_SIZE(argdefs), globals);
21339 if (kwargs != NULL) {
21341 kwtuple = PyTuple_New(2 * nk);
21342 if (kwtuple == NULL) {
21346 k = &PyTuple_GET_ITEM(kwtuple, 0);
21348 while (PyDict_Next(kwargs, &
pos, &k[i], &k[i+1])) {
21359 closure = PyFunction_GET_CLOSURE(func);
21360 #if PY_MAJOR_VERSION >= 3
21361 kwdefs = PyFunction_GET_KW_DEFAULTS(func);
21363 if (argdefs != NULL) {
21364 d = &PyTuple_GET_ITEM(argdefs, 0);
21365 nd = Py_SIZE(argdefs);
21371 #if PY_MAJOR_VERSION >= 3
21372 result = PyEval_EvalCodeEx((PyObject*)co, globals, (PyObject *)NULL,
21375 d, (
int)nd, kwdefs, closure);
21377 result = PyEval_EvalCodeEx(co, globals, (PyObject *)NULL,
21380 d, (
int)nd, closure);
21382 Py_XDECREF(kwtuple);
21384 Py_LeaveRecursiveCall();
21391 #if CYTHON_COMPILING_IN_CPYTHON
21392 static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw) {
21394 ternaryfunc call = Py_TYPE(func)->tp_call;
21395 if (unlikely(!call))
21396 return PyObject_Call(func, arg, kw);
21397 if (unlikely(Py_EnterRecursiveCall((
char*)
" while calling a Python object")))
21399 result = (*call)(func, arg, kw);
21400 Py_LeaveRecursiveCall();
21401 if (unlikely(!result) && unlikely(!PyErr_Occurred())) {
21404 "NULL result without error in PyObject_Call");
21411 static CYTHON_UNUSED PyObject* __Pyx_PyObject_Call2Args(PyObject*
function, PyObject* arg1, PyObject* arg2) {
21412 PyObject *args, *result = NULL;
21413 #if CYTHON_FAST_PYCALL
21414 if (PyFunction_Check(
function)) {
21415 PyObject *args[2] = {arg1, arg2};
21416 return __Pyx_PyFunction_FastCall(
function, args, 2);
21419 #if CYTHON_FAST_PYCCALL
21420 if (__Pyx_PyFastCFunction_Check(
function)) {
21421 PyObject *args[2] = {arg1, arg2};
21422 return __Pyx_PyCFunction_FastCall(
function, args, 2);
21425 args = PyTuple_New(2);
21426 if (unlikely(!args))
goto done;
21428 PyTuple_SET_ITEM(args, 0, arg1);
21430 PyTuple_SET_ITEM(args, 1, arg2);
21431 Py_INCREF(
function);
21432 result = __Pyx_PyObject_Call(
function, args, NULL);
21434 Py_DECREF(
function);
21440 #if CYTHON_COMPILING_IN_CPYTHON
21441 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg) {
21442 PyObject *
self, *result;
21444 cfunc = PyCFunction_GET_FUNCTION(func);
21445 self = PyCFunction_GET_SELF(func);
21446 if (unlikely(Py_EnterRecursiveCall((
char*)
" while calling a Python object")))
21448 result = cfunc(
self, arg);
21449 Py_LeaveRecursiveCall();
21450 if (unlikely(!result) && unlikely(!PyErr_Occurred())) {
21453 "NULL result without error in PyObject_Call");
21460 #if CYTHON_COMPILING_IN_CPYTHON
21461 static PyObject* __Pyx__PyObject_CallOneArg(PyObject *func, PyObject *arg) {
21463 PyObject *args = PyTuple_New(1);
21464 if (unlikely(!args))
return NULL;
21466 PyTuple_SET_ITEM(args, 0, arg);
21467 result = __Pyx_PyObject_Call(func, args, NULL);
21471 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg) {
21472 #if CYTHON_FAST_PYCALL
21473 if (PyFunction_Check(func)) {
21474 return __Pyx_PyFunction_FastCall(func, &arg, 1);
21477 if (likely(PyCFunction_Check(func))) {
21478 if (likely(PyCFunction_GET_FLAGS(func) & METH_O)) {
21479 return __Pyx_PyObject_CallMethO(func, arg);
21480 #if CYTHON_FAST_PYCCALL
21481 }
else if (__Pyx_PyFastCFunction_Check(func)) {
21482 return __Pyx_PyCFunction_FastCall(func, &arg, 1);
21486 return __Pyx__PyObject_CallOneArg(func, arg);
21489 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg) {
21491 PyObject *args = PyTuple_Pack(1, arg);
21492 if (unlikely(!args))
return NULL;
21493 result = __Pyx_PyObject_Call(func, args, NULL);
21500 static CYTHON_INLINE
int __Pyx_PyObject_SetSlice(PyObject* obj, PyObject* value,
21501 Py_ssize_t cstart, Py_ssize_t cstop,
21502 PyObject** _py_start, PyObject** _py_stop, PyObject** _py_slice,
21503 int has_cstart,
int has_cstop, CYTHON_UNUSED
int wraparound) {
21504 #if CYTHON_USE_TYPE_SLOTS
21505 PyMappingMethods* mp;
21506 #if PY_MAJOR_VERSION < 3
21507 PySequenceMethods* ms = Py_TYPE(obj)->tp_as_sequence;
21508 if (likely(ms && ms->sq_ass_slice)) {
21510 if (_py_start && (*_py_start != Py_None)) {
21511 cstart = __Pyx_PyIndex_AsSsize_t(*_py_start);
21512 if ((cstart == (Py_ssize_t)-1) && PyErr_Occurred())
goto bad;
21517 if (_py_stop && (*_py_stop != Py_None)) {
21518 cstop = __Pyx_PyIndex_AsSsize_t(*_py_stop);
21519 if ((cstop == (Py_ssize_t)-1) && PyErr_Occurred())
goto bad;
21521 cstop = PY_SSIZE_T_MAX;
21523 if (wraparound && unlikely((cstart < 0) | (cstop < 0)) && likely(ms->sq_length)) {
21524 Py_ssize_t l = ms->sq_length(obj);
21525 if (likely(l >= 0)) {
21528 if (cstop < 0) cstop = 0;
21532 if (cstart < 0) cstart = 0;
21535 if (!PyErr_ExceptionMatches(PyExc_OverflowError))
21540 return ms->sq_ass_slice(obj, cstart, cstop, value);
21543 mp = Py_TYPE(obj)->tp_as_mapping;
21544 if (likely(mp && mp->mp_ass_subscript))
21548 PyObject *py_slice, *py_start, *py_stop;
21550 py_slice = *_py_slice;
21552 PyObject* owned_start = NULL;
21553 PyObject* owned_stop = NULL;
21555 py_start = *_py_start;
21558 owned_start = py_start = PyInt_FromSsize_t(cstart);
21559 if (unlikely(!py_start))
goto bad;
21561 py_start = Py_None;
21564 py_stop = *_py_stop;
21567 owned_stop = py_stop = PyInt_FromSsize_t(cstop);
21568 if (unlikely(!py_stop)) {
21569 Py_XDECREF(owned_start);
21575 py_slice = PySlice_New(py_start, py_stop, Py_None);
21576 Py_XDECREF(owned_start);
21577 Py_XDECREF(owned_stop);
21578 if (unlikely(!py_slice))
goto bad;
21580 #if CYTHON_USE_TYPE_SLOTS
21581 result = mp->mp_ass_subscript(obj, py_slice, value);
21583 result = value ? PyObject_SetItem(obj, py_slice, value) : PyObject_DelItem(obj, py_slice);
21586 Py_DECREF(py_slice);
21590 PyErr_Format(PyExc_TypeError,
21591 "'%.200s' object does not support slice %.10s",
21592 Py_TYPE(obj)->tp_name, value ?
"assignment" :
"deletion");
21598 #if CYTHON_COMPILING_IN_CPYTHON
21599 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallNoArg(PyObject *func) {
21600 #if CYTHON_FAST_PYCALL
21601 if (PyFunction_Check(func)) {
21602 return __Pyx_PyFunction_FastCall(func, NULL, 0);
21605 #ifdef __Pyx_CyFunction_USED
21606 if (likely(PyCFunction_Check(func) || __Pyx_CyFunction_Check(func)))
21608 if (likely(PyCFunction_Check(func)))
21611 if (likely(PyCFunction_GET_FLAGS(func) & METH_NOARGS)) {
21612 return __Pyx_PyObject_CallMethO(func, NULL);
21615 return __Pyx_PyObject_Call(func, __pyx_empty_tuple, NULL);
21620 #if CYTHON_FAST_THREAD_STATE
21621 static CYTHON_INLINE
void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb) {
21622 PyObject *tmp_type, *tmp_value, *tmp_tb;
21623 tmp_type = tstate->curexc_type;
21624 tmp_value = tstate->curexc_value;
21625 tmp_tb = tstate->curexc_traceback;
21626 tstate->curexc_type = type;
21627 tstate->curexc_value = value;
21628 tstate->curexc_traceback = tb;
21629 Py_XDECREF(tmp_type);
21630 Py_XDECREF(tmp_value);
21631 Py_XDECREF(tmp_tb);
21633 static CYTHON_INLINE
void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) {
21634 *type = tstate->curexc_type;
21635 *value = tstate->curexc_value;
21636 *tb = tstate->curexc_traceback;
21637 tstate->curexc_type = 0;
21638 tstate->curexc_value = 0;
21639 tstate->curexc_traceback = 0;
21644 #if PY_MAJOR_VERSION < 3
21645 static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb,
21646 CYTHON_UNUSED PyObject *cause) {
21647 __Pyx_PyThreadState_declare
21649 if (!value || value == Py_None)
21653 if (!tb || tb == Py_None)
21657 if (!PyTraceBack_Check(tb)) {
21658 PyErr_SetString(PyExc_TypeError,
21659 "raise: arg 3 must be a traceback or None");
21663 if (PyType_Check(type)) {
21664 #if CYTHON_COMPILING_IN_PYPY
21666 Py_INCREF(Py_None);
21670 PyErr_NormalizeException(&type, &value, &tb);
21673 PyErr_SetString(PyExc_TypeError,
21674 "instance exception may not have a separate value");
21678 type = (PyObject*) Py_TYPE(type);
21680 if (!PyType_IsSubtype((PyTypeObject *)type, (PyTypeObject *)PyExc_BaseException)) {
21681 PyErr_SetString(PyExc_TypeError,
21682 "raise: exception class must be a subclass of BaseException");
21686 __Pyx_PyThreadState_assign
21687 __Pyx_ErrRestore(type, value, tb);
21696 static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause) {
21697 PyObject* owned_instance = NULL;
21698 if (tb == Py_None) {
21700 }
else if (tb && !PyTraceBack_Check(tb)) {
21701 PyErr_SetString(PyExc_TypeError,
21702 "raise: arg 3 must be a traceback or None");
21705 if (value == Py_None)
21707 if (PyExceptionInstance_Check(type)) {
21709 PyErr_SetString(PyExc_TypeError,
21710 "instance exception may not have a separate value");
21714 type = (PyObject*) Py_TYPE(value);
21715 }
else if (PyExceptionClass_Check(type)) {
21716 PyObject *instance_class = NULL;
21717 if (value && PyExceptionInstance_Check(value)) {
21718 instance_class = (PyObject*) Py_TYPE(value);
21719 if (instance_class != type) {
21720 int is_subclass = PyObject_IsSubclass(instance_class, type);
21721 if (!is_subclass) {
21722 instance_class = NULL;
21723 }
else if (unlikely(is_subclass == -1)) {
21726 type = instance_class;
21730 if (!instance_class) {
21733 args = PyTuple_New(0);
21734 else if (PyTuple_Check(value)) {
21738 args = PyTuple_Pack(1, value);
21741 owned_instance = PyObject_Call(type, args, NULL);
21743 if (!owned_instance)
21745 value = owned_instance;
21746 if (!PyExceptionInstance_Check(value)) {
21747 PyErr_Format(PyExc_TypeError,
21748 "calling %R should have returned an instance of "
21749 "BaseException, not %R",
21750 type, Py_TYPE(value));
21755 PyErr_SetString(PyExc_TypeError,
21756 "raise: exception class must be a subclass of BaseException");
21760 PyObject *fixed_cause;
21761 if (cause == Py_None) {
21762 fixed_cause = NULL;
21763 }
else if (PyExceptionClass_Check(cause)) {
21764 fixed_cause = PyObject_CallObject(cause, NULL);
21765 if (fixed_cause == NULL)
21767 }
else if (PyExceptionInstance_Check(cause)) {
21768 fixed_cause = cause;
21769 Py_INCREF(fixed_cause);
21771 PyErr_SetString(PyExc_TypeError,
21772 "exception causes must derive from "
21776 PyException_SetCause(value, fixed_cause);
21778 PyErr_SetObject(type, value);
21780 #if CYTHON_COMPILING_IN_PYPY
21781 PyObject *tmp_type, *tmp_value, *tmp_tb;
21782 PyErr_Fetch(&tmp_type, &tmp_value, &tmp_tb);
21784 PyErr_Restore(tmp_type, tmp_value, tb);
21785 Py_XDECREF(tmp_tb);
21787 PyThreadState *tstate = __Pyx_PyThreadState_Current;
21788 PyObject* tmp_tb = tstate->curexc_traceback;
21789 if (tb != tmp_tb) {
21791 tstate->curexc_traceback = tb;
21792 Py_XDECREF(tmp_tb);
21797 Py_XDECREF(owned_instance);
21803 #if CYTHON_USE_EXC_INFO_STACK
21804 static _PyErr_StackItem *
21805 __Pyx_PyErr_GetTopmostException(PyThreadState *tstate)
21807 _PyErr_StackItem *exc_info = tstate->exc_info;
21808 while ((exc_info->exc_type == NULL || exc_info->exc_type == Py_None) &&
21809 exc_info->previous_item != NULL)
21811 exc_info = exc_info->previous_item;
21818 #if CYTHON_FAST_THREAD_STATE
21819 static CYTHON_INLINE
void __Pyx__ExceptionSave(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) {
21820 #if CYTHON_USE_EXC_INFO_STACK
21821 _PyErr_StackItem *exc_info = __Pyx_PyErr_GetTopmostException(tstate);
21822 *type = exc_info->exc_type;
21823 *value = exc_info->exc_value;
21824 *tb = exc_info->exc_traceback;
21826 *type = tstate->exc_type;
21827 *value = tstate->exc_value;
21828 *tb = tstate->exc_traceback;
21831 Py_XINCREF(*value);
21834 static CYTHON_INLINE
void __Pyx__ExceptionReset(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb) {
21835 PyObject *tmp_type, *tmp_value, *tmp_tb;
21836 #if CYTHON_USE_EXC_INFO_STACK
21837 _PyErr_StackItem *exc_info = tstate->exc_info;
21838 tmp_type = exc_info->exc_type;
21839 tmp_value = exc_info->exc_value;
21840 tmp_tb = exc_info->exc_traceback;
21841 exc_info->exc_type = type;
21842 exc_info->exc_value = value;
21843 exc_info->exc_traceback = tb;
21845 tmp_type = tstate->exc_type;
21846 tmp_value = tstate->exc_value;
21847 tmp_tb = tstate->exc_traceback;
21848 tstate->exc_type = type;
21849 tstate->exc_value = value;
21850 tstate->exc_traceback = tb;
21852 Py_XDECREF(tmp_type);
21853 Py_XDECREF(tmp_value);
21854 Py_XDECREF(tmp_tb);
21859 #if CYTHON_FAST_THREAD_STATE
21860 static int __Pyx_PyErr_ExceptionMatchesTuple(PyObject *exc_type, PyObject *tuple) {
21862 n = PyTuple_GET_SIZE(tuple);
21863 #if PY_MAJOR_VERSION >= 3
21864 for (i=0; i<
n; i++) {
21865 if (exc_type == PyTuple_GET_ITEM(tuple, i))
return 1;
21868 for (i=0; i<
n; i++) {
21869 if (__Pyx_PyErr_GivenExceptionMatches(exc_type, PyTuple_GET_ITEM(tuple, i)))
return 1;
21873 static CYTHON_INLINE
int __Pyx_PyErr_ExceptionMatchesInState(PyThreadState* tstate, PyObject* err) {
21874 PyObject *exc_type = tstate->curexc_type;
21875 if (exc_type == err)
return 1;
21876 if (unlikely(!exc_type))
return 0;
21877 if (unlikely(PyTuple_Check(err)))
21878 return __Pyx_PyErr_ExceptionMatchesTuple(exc_type, err);
21879 return __Pyx_PyErr_GivenExceptionMatches(exc_type, err);
21884 #if CYTHON_FAST_THREAD_STATE
21885 static int __Pyx__GetException(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb)
21887 static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb)
21890 PyObject *local_type, *local_value, *local_tb;
21891 #if CYTHON_FAST_THREAD_STATE
21892 PyObject *tmp_type, *tmp_value, *tmp_tb;
21893 local_type = tstate->curexc_type;
21894 local_value = tstate->curexc_value;
21895 local_tb = tstate->curexc_traceback;
21896 tstate->curexc_type = 0;
21897 tstate->curexc_value = 0;
21898 tstate->curexc_traceback = 0;
21900 PyErr_Fetch(&local_type, &local_value, &local_tb);
21902 PyErr_NormalizeException(&local_type, &local_value, &local_tb);
21903 #if CYTHON_FAST_THREAD_STATE
21904 if (unlikely(tstate->curexc_type))
21906 if (unlikely(PyErr_Occurred()))
21909 #if PY_MAJOR_VERSION >= 3
21911 if (unlikely(PyException_SetTraceback(local_value, local_tb) < 0))
21915 Py_XINCREF(local_tb);
21916 Py_XINCREF(local_type);
21917 Py_XINCREF(local_value);
21918 *type = local_type;
21919 *value = local_value;
21921 #if CYTHON_FAST_THREAD_STATE
21922 #if CYTHON_USE_EXC_INFO_STACK
21924 _PyErr_StackItem *exc_info = tstate->exc_info;
21925 tmp_type = exc_info->exc_type;
21926 tmp_value = exc_info->exc_value;
21927 tmp_tb = exc_info->exc_traceback;
21928 exc_info->exc_type = local_type;
21929 exc_info->exc_value = local_value;
21930 exc_info->exc_traceback = local_tb;
21933 tmp_type = tstate->exc_type;
21934 tmp_value = tstate->exc_value;
21935 tmp_tb = tstate->exc_traceback;
21936 tstate->exc_type = local_type;
21937 tstate->exc_value = local_value;
21938 tstate->exc_traceback = local_tb;
21940 Py_XDECREF(tmp_type);
21941 Py_XDECREF(tmp_value);
21942 Py_XDECREF(tmp_tb);
21944 PyErr_SetExcInfo(local_type, local_value, local_tb);
21951 Py_XDECREF(local_type);
21952 Py_XDECREF(local_value);
21953 Py_XDECREF(local_tb);
21958 static CYTHON_INLINE
int __Pyx_PyBytes_Equals(PyObject* s1, PyObject* s2,
int equals) {
21959 #if CYTHON_COMPILING_IN_PYPY
21960 return PyObject_RichCompareBool(s1, s2, equals);
21963 return (equals == Py_EQ);
21964 }
else if (PyBytes_CheckExact(s1) & PyBytes_CheckExact(s2)) {
21965 const char *ps1, *ps2;
21966 Py_ssize_t length = PyBytes_GET_SIZE(s1);
21967 if (length != PyBytes_GET_SIZE(s2))
21968 return (equals == Py_NE);
21969 ps1 = PyBytes_AS_STRING(s1);
21970 ps2 = PyBytes_AS_STRING(s2);
21971 if (ps1[0] != ps2[0]) {
21972 return (equals == Py_NE);
21973 }
else if (length == 1) {
21974 return (equals == Py_EQ);
21977 #if CYTHON_USE_UNICODE_INTERNALS && (PY_VERSION_HEX < 0x030B0000)
21978 Py_hash_t hash1, hash2;
21979 hash1 = ((PyBytesObject*)s1)->ob_shash;
21980 hash2 = ((PyBytesObject*)s2)->ob_shash;
21981 if (hash1 != hash2 && hash1 != -1 && hash2 != -1) {
21982 return (equals == Py_NE);
21985 result = memcmp(ps1, ps2, (
size_t)length);
21986 return (equals == Py_EQ) ? (result == 0) : (result != 0);
21988 }
else if ((s1 == Py_None) & PyBytes_CheckExact(s2)) {
21989 return (equals == Py_NE);
21990 }
else if ((s2 == Py_None) & PyBytes_CheckExact(s1)) {
21991 return (equals == Py_NE);
21994 PyObject* py_result = PyObject_RichCompare(s1, s2, equals);
21997 result = __Pyx_PyObject_IsTrue(py_result);
21998 Py_DECREF(py_result);
22005 static CYTHON_INLINE
int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2,
int equals) {
22006 #if CYTHON_COMPILING_IN_PYPY
22007 return PyObject_RichCompareBool(s1, s2, equals);
22009 #if PY_MAJOR_VERSION < 3
22010 PyObject* owned_ref = NULL;
22012 int s1_is_unicode, s2_is_unicode;
22016 s1_is_unicode = PyUnicode_CheckExact(s1);
22017 s2_is_unicode = PyUnicode_CheckExact(s2);
22018 #if PY_MAJOR_VERSION < 3
22019 if ((s1_is_unicode & (!s2_is_unicode)) && PyString_CheckExact(s2)) {
22020 owned_ref = PyUnicode_FromObject(s2);
22021 if (unlikely(!owned_ref))
22025 }
else if ((s2_is_unicode & (!s1_is_unicode)) && PyString_CheckExact(s1)) {
22026 owned_ref = PyUnicode_FromObject(s1);
22027 if (unlikely(!owned_ref))
22031 }
else if (((!s2_is_unicode) & (!s1_is_unicode))) {
22032 return __Pyx_PyBytes_Equals(s1, s2, equals);
22035 if (s1_is_unicode & s2_is_unicode) {
22038 void *data1, *data2;
22039 if (unlikely(__Pyx_PyUnicode_READY(s1) < 0) || unlikely(__Pyx_PyUnicode_READY(s2) < 0))
22041 length = __Pyx_PyUnicode_GET_LENGTH(s1);
22042 if (length != __Pyx_PyUnicode_GET_LENGTH(s2)) {
22045 #if CYTHON_USE_UNICODE_INTERNALS
22047 Py_hash_t hash1, hash2;
22048 #if CYTHON_PEP393_ENABLED
22049 hash1 = ((PyASCIIObject*)s1)->hash;
22050 hash2 = ((PyASCIIObject*)s2)->hash;
22052 hash1 = ((PyUnicodeObject*)s1)->hash;
22053 hash2 = ((PyUnicodeObject*)s2)->hash;
22055 if (hash1 != hash2 && hash1 != -1 && hash2 != -1) {
22060 kind = __Pyx_PyUnicode_KIND(s1);
22061 if (kind != __Pyx_PyUnicode_KIND(s2)) {
22064 data1 = __Pyx_PyUnicode_DATA(s1);
22065 data2 = __Pyx_PyUnicode_DATA(s2);
22066 if (__Pyx_PyUnicode_READ(kind, data1, 0) != __Pyx_PyUnicode_READ(kind, data2, 0)) {
22068 }
else if (length == 1) {
22071 int result = memcmp(data1, data2, (
size_t)(length * kind));
22072 #if PY_MAJOR_VERSION < 3
22073 Py_XDECREF(owned_ref);
22075 return (equals == Py_EQ) ? (result == 0) : (result != 0);
22077 }
else if ((s1 == Py_None) & s2_is_unicode) {
22079 }
else if ((s2 == Py_None) & s1_is_unicode) {
22083 PyObject* py_result = PyObject_RichCompare(s1, s2, equals);
22084 #if PY_MAJOR_VERSION < 3
22085 Py_XDECREF(owned_ref);
22089 result = __Pyx_PyObject_IsTrue(py_result);
22090 Py_DECREF(py_result);
22094 #if PY_MAJOR_VERSION < 3
22095 Py_XDECREF(owned_ref);
22097 return (equals == Py_EQ);
22099 #if PY_MAJOR_VERSION < 3
22100 Py_XDECREF(owned_ref);
22102 return (equals == Py_NE);
22107 static CYTHON_INLINE Py_ssize_t __Pyx_div_Py_ssize_t(Py_ssize_t a, Py_ssize_t b) {
22108 Py_ssize_t
q = a / b;
22109 Py_ssize_t
r = a -
q*b;
22110 q -= ((
r != 0) & ((
r ^ b) < 0));
22115 static CYTHON_INLINE PyObject *__Pyx_GetAttr(PyObject *o, PyObject *
n) {
22116 #if CYTHON_USE_TYPE_SLOTS
22117 #if PY_MAJOR_VERSION >= 3
22118 if (likely(PyUnicode_Check(
n)))
22120 if (likely(PyString_Check(
n)))
22122 return __Pyx_PyObject_GetAttrStr(o,
n);
22124 return PyObject_GetAttr(o,
n);
22128 static PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j) {
22130 if (!j)
return NULL;
22131 r = PyObject_GetItem(o, j);
22135 static CYTHON_INLINE PyObject *__Pyx_GetItemInt_List_Fast(PyObject *o, Py_ssize_t i,
22136 CYTHON_NCP_UNUSED
int wraparound,
22137 CYTHON_NCP_UNUSED
int boundscheck) {
22138 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
22139 Py_ssize_t wrapped_i = i;
22140 if (wraparound & unlikely(i < 0)) {
22141 wrapped_i += PyList_GET_SIZE(o);
22143 if ((!boundscheck) || likely(__Pyx_is_valid_index(wrapped_i, PyList_GET_SIZE(o)))) {
22144 PyObject *
r = PyList_GET_ITEM(o, wrapped_i);
22148 return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i));
22150 return PySequence_GetItem(o, i);
22153 static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize_t i,
22154 CYTHON_NCP_UNUSED
int wraparound,
22155 CYTHON_NCP_UNUSED
int boundscheck) {
22156 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
22157 Py_ssize_t wrapped_i = i;
22158 if (wraparound & unlikely(i < 0)) {
22159 wrapped_i += PyTuple_GET_SIZE(o);
22161 if ((!boundscheck) || likely(__Pyx_is_valid_index(wrapped_i, PyTuple_GET_SIZE(o)))) {
22162 PyObject *
r = PyTuple_GET_ITEM(o, wrapped_i);
22166 return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i));
22168 return PySequence_GetItem(o, i);
22171 static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i,
int is_list,
22172 CYTHON_NCP_UNUSED
int wraparound,
22173 CYTHON_NCP_UNUSED
int boundscheck) {
22174 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS && CYTHON_USE_TYPE_SLOTS
22175 if (is_list || PyList_CheckExact(o)) {
22176 Py_ssize_t
n = ((!wraparound) | likely(i >= 0)) ? i : i + PyList_GET_SIZE(o);
22177 if ((!boundscheck) || (likely(__Pyx_is_valid_index(
n, PyList_GET_SIZE(o))))) {
22178 PyObject *
r = PyList_GET_ITEM(o,
n);
22183 else if (PyTuple_CheckExact(o)) {
22184 Py_ssize_t
n = ((!wraparound) | likely(i >= 0)) ? i : i + PyTuple_GET_SIZE(o);
22185 if ((!boundscheck) || likely(__Pyx_is_valid_index(
n, PyTuple_GET_SIZE(o)))) {
22186 PyObject *
r = PyTuple_GET_ITEM(o,
n);
22191 PySequenceMethods *m = Py_TYPE(o)->tp_as_sequence;
22192 if (likely(m && m->sq_item)) {
22193 if (wraparound && unlikely(i < 0) && likely(m->sq_length)) {
22194 Py_ssize_t l = m->sq_length(o);
22195 if (likely(l >= 0)) {
22198 if (!PyErr_ExceptionMatches(PyExc_OverflowError))
22203 return m->sq_item(o, i);
22207 if (is_list || PySequence_Check(o)) {
22208 return PySequence_GetItem(o, i);
22211 return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i));
22215 #if CYTHON_USE_TYPE_SLOTS
22216 static PyObject *__Pyx_PyObject_GetIndex(PyObject *obj, PyObject* index) {
22218 Py_ssize_t key_value;
22219 PySequenceMethods *m = Py_TYPE(obj)->tp_as_sequence;
22220 if (unlikely(!(m && m->sq_item))) {
22221 PyErr_Format(PyExc_TypeError,
"'%.200s' object is not subscriptable", Py_TYPE(obj)->tp_name);
22224 key_value = __Pyx_PyIndex_AsSsize_t(index);
22225 if (likely(key_value != -1 || !(runerr = PyErr_Occurred()))) {
22226 return __Pyx_GetItemInt_Fast(obj, key_value, 0, 1, 1);
22228 if (PyErr_GivenExceptionMatches(runerr, PyExc_OverflowError)) {
22230 PyErr_Format(PyExc_IndexError,
"cannot fit '%.200s' into an index-sized integer", Py_TYPE(index)->tp_name);
22234 static PyObject *__Pyx_PyObject_GetItem(PyObject *obj, PyObject* key) {
22235 PyMappingMethods *m = Py_TYPE(obj)->tp_as_mapping;
22236 if (likely(m && m->mp_subscript)) {
22237 return m->mp_subscript(obj, key);
22239 return __Pyx_PyObject_GetIndex(obj, key);
22244 static CYTHON_INLINE PyObject* __Pyx_decode_c_string(
22245 const char* cstring, Py_ssize_t start, Py_ssize_t stop,
22246 const char* encoding,
const char* errors,
22247 PyObject* (*decode_func)(
const char *
s, Py_ssize_t size,
const char *errors)) {
22249 if (unlikely((start < 0) | (stop < 0))) {
22250 size_t slen = strlen(cstring);
22251 if (unlikely(slen > (
size_t) PY_SSIZE_T_MAX)) {
22252 PyErr_SetString(PyExc_OverflowError,
22253 "c-string too long to convert to Python");
22256 length = (Py_ssize_t) slen;
22265 if (unlikely(stop <= start))
22266 return __Pyx_NewRef(__pyx_empty_unicode);
22267 length = stop - start;
22270 return decode_func(cstring, length, errors);
22272 return PyUnicode_Decode(cstring, length, encoding, errors);
22277 static PyObject *__Pyx_GetAttr3Default(PyObject *d) {
22278 __Pyx_PyThreadState_declare
22279 __Pyx_PyThreadState_assign
22280 if (unlikely(!__Pyx_PyErr_ExceptionMatches(PyExc_AttributeError)))
22282 __Pyx_PyErr_Clear();
22286 static CYTHON_INLINE PyObject *__Pyx_GetAttr3(PyObject *o, PyObject *
n, PyObject *d) {
22287 PyObject *
r = __Pyx_GetAttr(o,
n);
22288 return (likely(
r)) ?
r : __Pyx_GetAttr3Default(d);
22292 static CYTHON_INLINE
void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected) {
22293 PyErr_Format(PyExc_ValueError,
22294 "too many values to unpack (expected %" CYTHON_FORMAT_SSIZE_T
"d)", expected);
22298 static CYTHON_INLINE
void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index) {
22299 PyErr_Format(PyExc_ValueError,
22300 "need more than %" CYTHON_FORMAT_SSIZE_T
"d value%.1s to unpack",
22301 index, (index == 1) ?
"" :
"s");
22305 static CYTHON_INLINE
void __Pyx_RaiseNoneNotIterableError(
void) {
22306 PyErr_SetString(PyExc_TypeError,
"'NoneType' object is not iterable");
22310 static CYTHON_INLINE
int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type) {
22311 if (unlikely(!type)) {
22312 PyErr_SetString(PyExc_SystemError,
"Missing type object");
22315 if (likely(__Pyx_TypeCheck(obj, type)))
22317 PyErr_Format(PyExc_TypeError,
"Cannot convert %.200s to %.200s",
22318 Py_TYPE(obj)->tp_name, type->tp_name);
22323 #if CYTHON_FAST_THREAD_STATE
22324 static CYTHON_INLINE
void __Pyx__ExceptionSwap(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) {
22325 PyObject *tmp_type, *tmp_value, *tmp_tb;
22326 #if CYTHON_USE_EXC_INFO_STACK
22327 _PyErr_StackItem *exc_info = tstate->exc_info;
22328 tmp_type = exc_info->exc_type;
22329 tmp_value = exc_info->exc_value;
22330 tmp_tb = exc_info->exc_traceback;
22331 exc_info->exc_type = *type;
22332 exc_info->exc_value = *value;
22333 exc_info->exc_traceback = *tb;
22335 tmp_type = tstate->exc_type;
22336 tmp_value = tstate->exc_value;
22337 tmp_tb = tstate->exc_traceback;
22338 tstate->exc_type = *type;
22339 tstate->exc_value = *value;
22340 tstate->exc_traceback = *tb;
22343 *value = tmp_value;
22347 static CYTHON_INLINE
void __Pyx_ExceptionSwap(PyObject **type, PyObject **value, PyObject **tb) {
22348 PyObject *tmp_type, *tmp_value, *tmp_tb;
22349 PyErr_GetExcInfo(&tmp_type, &tmp_value, &tmp_tb);
22350 PyErr_SetExcInfo(*type, *value, *tb);
22352 *value = tmp_value;
22358 static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list,
int level) {
22359 PyObject *empty_list = 0;
22360 PyObject *module = 0;
22361 PyObject *global_dict = 0;
22362 PyObject *empty_dict = 0;
22364 #if PY_MAJOR_VERSION < 3
22365 PyObject *py_import;
22366 py_import = __Pyx_PyObject_GetAttrStr(__pyx_b, __pyx_n_s_import);
22373 empty_list = PyList_New(0);
22378 global_dict = PyModule_GetDict(__pyx_m);
22381 empty_dict = PyDict_New();
22385 #if PY_MAJOR_VERSION >= 3
22387 if ((1) && (strchr(__Pyx_MODULE_NAME,
'.'))) {
22388 module = PyImport_ImportModuleLevelObject(
22389 name, global_dict, empty_dict, list, 1);
22391 if (!PyErr_ExceptionMatches(PyExc_ImportError))
22400 #if PY_MAJOR_VERSION < 3
22401 PyObject *py_level = PyInt_FromLong(level);
22404 module = PyObject_CallFunctionObjArgs(py_import,
22405 name, global_dict, empty_dict, list, py_level, (PyObject *)NULL);
22406 Py_DECREF(py_level);
22408 module = PyImport_ImportModuleLevelObject(
22409 name, global_dict, empty_dict, list, level);
22414 #if PY_MAJOR_VERSION < 3
22415 Py_XDECREF(py_import);
22417 Py_XDECREF(empty_list);
22418 Py_XDECREF(empty_dict);
22423 #if CYTHON_COMPILING_IN_CPYTHON
22424 static int __Pyx_InBases(PyTypeObject *a, PyTypeObject *b) {
22430 return b == &PyBaseObject_Type;
22432 static CYTHON_INLINE
int __Pyx_IsSubtype(PyTypeObject *a, PyTypeObject *b) {
22434 if (a == b)
return 1;
22438 n = PyTuple_GET_SIZE(mro);
22439 for (i = 0; i <
n; i++) {
22440 if (PyTuple_GET_ITEM(mro, i) == (PyObject *)b)
22445 return __Pyx_InBases(a, b);
22447 #if PY_MAJOR_VERSION == 2
22448 static int __Pyx_inner_PyErr_GivenExceptionMatches2(PyObject *err, PyObject* exc_type1, PyObject* exc_type2) {
22449 PyObject *exception, *value, *tb;
22451 __Pyx_PyThreadState_declare
22452 __Pyx_PyThreadState_assign
22453 __Pyx_ErrFetch(&exception, &value, &tb);
22454 res = exc_type1 ? PyObject_IsSubclass(err, exc_type1) : 0;
22455 if (unlikely(res == -1)) {
22456 PyErr_WriteUnraisable(err);
22460 res = PyObject_IsSubclass(err, exc_type2);
22461 if (unlikely(res == -1)) {
22462 PyErr_WriteUnraisable(err);
22466 __Pyx_ErrRestore(exception, value, tb);
22470 static CYTHON_INLINE
int __Pyx_inner_PyErr_GivenExceptionMatches2(PyObject *err, PyObject* exc_type1, PyObject *exc_type2) {
22471 int res = exc_type1 ? __Pyx_IsSubtype((PyTypeObject*)err, (PyTypeObject*)exc_type1) : 0;
22473 res = __Pyx_IsSubtype((PyTypeObject*)err, (PyTypeObject*)exc_type2);
22478 static int __Pyx_PyErr_GivenExceptionMatchesTuple(PyObject *exc_type, PyObject *tuple) {
22480 assert(PyExceptionClass_Check(exc_type));
22481 n = PyTuple_GET_SIZE(tuple);
22482 #if PY_MAJOR_VERSION >= 3
22483 for (i=0; i<
n; i++) {
22484 if (exc_type == PyTuple_GET_ITEM(tuple, i))
return 1;
22487 for (i=0; i<
n; i++) {
22488 PyObject *t = PyTuple_GET_ITEM(tuple, i);
22489 #if PY_MAJOR_VERSION < 3
22490 if (likely(exc_type == t))
return 1;
22492 if (likely(PyExceptionClass_Check(t))) {
22493 if (__Pyx_inner_PyErr_GivenExceptionMatches2(exc_type, NULL, t))
return 1;
22499 static CYTHON_INLINE
int __Pyx_PyErr_GivenExceptionMatches(PyObject *err, PyObject* exc_type) {
22500 if (likely(err == exc_type))
return 1;
22501 if (likely(PyExceptionClass_Check(err))) {
22502 if (likely(PyExceptionClass_Check(exc_type))) {
22503 return __Pyx_inner_PyErr_GivenExceptionMatches2(err, NULL, exc_type);
22504 }
else if (likely(PyTuple_Check(exc_type))) {
22505 return __Pyx_PyErr_GivenExceptionMatchesTuple(err, exc_type);
22509 return PyErr_GivenExceptionMatches(err, exc_type);
22511 static CYTHON_INLINE
int __Pyx_PyErr_GivenExceptionMatches2(PyObject *err, PyObject *exc_type1, PyObject *exc_type2) {
22512 assert(PyExceptionClass_Check(exc_type1));
22513 assert(PyExceptionClass_Check(exc_type2));
22514 if (likely(err == exc_type1 || err == exc_type2))
return 1;
22515 if (likely(PyExceptionClass_Check(err))) {
22516 return __Pyx_inner_PyErr_GivenExceptionMatches2(err, exc_type1, exc_type2);
22518 return (PyErr_GivenExceptionMatches(err, exc_type1) || PyErr_GivenExceptionMatches(err, exc_type2));
22523 #if !CYTHON_COMPILING_IN_PYPY
22524 static PyObject* __Pyx_PyInt_AddObjC(PyObject *op1, PyObject *op2, CYTHON_UNUSED
long intval,
int inplace,
int zerodivision_check) {
22526 (void)zerodivision_check;
22527 #if PY_MAJOR_VERSION < 3
22528 if (likely(PyInt_CheckExact(op1))) {
22529 const long b = intval;
22531 long a = PyInt_AS_LONG(op1);
22532 x = (long)((
unsigned long)a + b);
22533 if (likely((x^a) >= 0 || (x^b) >= 0))
22534 return PyInt_FromLong(x);
22535 return PyLong_Type.tp_as_number->nb_add(op1, op2);
22538 #if CYTHON_USE_PYLONG_INTERNALS
22539 if (likely(PyLong_CheckExact(op1))) {
22540 const long b = intval;
22542 #ifdef HAVE_LONG_LONG
22543 const PY_LONG_LONG llb = intval;
22544 PY_LONG_LONG lla, llx;
22546 const digit* digits = ((PyLongObject*)op1)->ob_digit;
22547 const Py_ssize_t size = Py_SIZE(op1);
22548 if (likely(__Pyx_sst_abs(size) <= 1)) {
22549 a = likely(size) ? digits[0] : 0;
22550 if (size == -1) a = -a;
22554 if (8 *
sizeof(
long) - 1 > 2 * PyLong_SHIFT) {
22555 a = -(long) (((((
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0]));
22557 #ifdef HAVE_LONG_LONG
22558 }
else if (8 *
sizeof(PY_LONG_LONG) - 1 > 2 * PyLong_SHIFT) {
22559 lla = -(PY_LONG_LONG) (((((
unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (
unsigned PY_LONG_LONG)digits[0]));
22563 CYTHON_FALLTHROUGH;
22565 if (8 *
sizeof(
long) - 1 > 2 * PyLong_SHIFT) {
22566 a = (long) (((((
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0]));
22568 #ifdef HAVE_LONG_LONG
22569 }
else if (8 *
sizeof(PY_LONG_LONG) - 1 > 2 * PyLong_SHIFT) {
22570 lla = (PY_LONG_LONG) (((((
unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (
unsigned PY_LONG_LONG)digits[0]));
22574 CYTHON_FALLTHROUGH;
22576 if (8 *
sizeof(
long) - 1 > 3 * PyLong_SHIFT) {
22577 a = -(long) (((((((
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0]));
22579 #ifdef HAVE_LONG_LONG
22580 }
else if (8 *
sizeof(PY_LONG_LONG) - 1 > 3 * PyLong_SHIFT) {
22581 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]));
22585 CYTHON_FALLTHROUGH;
22587 if (8 *
sizeof(
long) - 1 > 3 * PyLong_SHIFT) {
22588 a = (long) (((((((
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0]));
22590 #ifdef HAVE_LONG_LONG
22591 }
else if (8 *
sizeof(PY_LONG_LONG) - 1 > 3 * PyLong_SHIFT) {
22592 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]));
22596 CYTHON_FALLTHROUGH;
22598 if (8 *
sizeof(
long) - 1 > 4 * PyLong_SHIFT) {
22599 a = -(long) (((((((((
unsigned long)digits[3]) << PyLong_SHIFT) | (
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0]));
22601 #ifdef HAVE_LONG_LONG
22602 }
else if (8 *
sizeof(PY_LONG_LONG) - 1 > 4 * PyLong_SHIFT) {
22603 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]));
22607 CYTHON_FALLTHROUGH;
22609 if (8 *
sizeof(
long) - 1 > 4 * PyLong_SHIFT) {
22610 a = (long) (((((((((
unsigned long)digits[3]) << PyLong_SHIFT) | (
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0]));
22612 #ifdef HAVE_LONG_LONG
22613 }
else if (8 *
sizeof(PY_LONG_LONG) - 1 > 4 * PyLong_SHIFT) {
22614 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]));
22618 CYTHON_FALLTHROUGH;
22619 default:
return PyLong_Type.tp_as_number->nb_add(op1, op2);
22623 return PyLong_FromLong(x);
22624 #ifdef HAVE_LONG_LONG
22627 return PyLong_FromLongLong(llx);
22633 if (PyFloat_CheckExact(op1)) {
22634 const long b = intval;
22635 double a = PyFloat_AS_DOUBLE(op1);
22637 PyFPE_START_PROTECT(
"add",
return NULL)
22638 result = ((double)a) + (double)b;
22639 PyFPE_END_PROTECT(result)
22640 return PyFloat_FromDouble(result);
22642 return (inplace ? PyNumber_InPlaceAdd : PyNumber_Add)(op1, op2);
22647 static CYTHON_INLINE
void __Pyx_RaiseUnboundLocalError(
const char *varname) {
22648 PyErr_Format(PyExc_UnboundLocalError,
"local variable '%s' referenced before assignment", varname);
22652 static CYTHON_INLINE
long __Pyx_div_long(
long a,
long b) {
22655 q -= ((
r != 0) & ((
r ^ b) < 0));
22660 static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name) {
22661 PyObject* value = __Pyx_PyObject_GetAttrStr(module, name);
22662 if (unlikely(!value) && PyErr_ExceptionMatches(PyExc_AttributeError)) {
22663 PyErr_Format(PyExc_ImportError,
22664 #
if PY_MAJOR_VERSION < 3
22665 "cannot import name %.230s", PyString_AS_STRING(name));
22667 "cannot import name %S", name);
22674 static CYTHON_INLINE
int __Pyx_HasAttr(PyObject *o, PyObject *
n) {
22676 if (unlikely(!__Pyx_PyBaseString_Check(
n))) {
22677 PyErr_SetString(PyExc_TypeError,
22678 "hasattr(): attribute name must be string");
22681 r = __Pyx_GetAttr(o,
n);
22682 if (unlikely(!
r)) {
22692 #if !CYTHON_COMPILING_IN_CPYTHON
22693 static CYTHON_INLINE PyObject* __Pyx_PyBytes_Join(PyObject* sep, PyObject* values) {
22694 return PyObject_CallMethodObjArgs(sep, __pyx_n_s_join, values, NULL);
22699 #if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000
22700 static PyObject *__Pyx_RaiseGenericGetAttributeError(PyTypeObject *tp, PyObject *attr_name) {
22701 PyErr_Format(PyExc_AttributeError,
22702 #
if PY_MAJOR_VERSION >= 3
22703 "'%.50s' object has no attribute '%U'",
22704 tp->tp_name, attr_name);
22706 "'%.50s' object has no attribute '%.400s'",
22707 tp->tp_name, PyString_AS_STRING(attr_name));
22711 static CYTHON_INLINE PyObject* __Pyx_PyObject_GenericGetAttrNoDict(PyObject* obj, PyObject* attr_name) {
22713 PyTypeObject *tp = Py_TYPE(obj);
22714 if (unlikely(!PyString_Check(attr_name))) {
22715 return PyObject_GenericGetAttr(obj, attr_name);
22717 assert(!tp->tp_dictoffset);
22718 descr = _PyType_Lookup(tp, attr_name);
22719 if (unlikely(!descr)) {
22720 return __Pyx_RaiseGenericGetAttributeError(tp, attr_name);
22723 #if PY_MAJOR_VERSION < 3
22724 if (likely(PyType_HasFeature(Py_TYPE(descr), Py_TPFLAGS_HAVE_CLASS)))
22727 descrgetfunc
f = Py_TYPE(descr)->tp_descr_get;
22729 PyObject *res =
f(descr, obj, (PyObject *)tp);
22739 #if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000
22740 static PyObject* __Pyx_PyObject_GenericGetAttr(PyObject* obj, PyObject* attr_name) {
22741 if (unlikely(Py_TYPE(obj)->tp_dictoffset)) {
22742 return PyObject_GenericGetAttr(obj, attr_name);
22744 return __Pyx_PyObject_GenericGetAttrNoDict(obj, attr_name);
22749 static void __Pyx_PyObject_GetAttrStr_ClearAttributeError(
void) {
22750 __Pyx_PyThreadState_declare
22751 __Pyx_PyThreadState_assign
22752 if (likely(__Pyx_PyErr_ExceptionMatches(PyExc_AttributeError)))
22753 __Pyx_PyErr_Clear();
22755 static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStrNoError(PyObject* obj, PyObject* attr_name) {
22757 #if CYTHON_COMPILING_IN_CPYTHON && CYTHON_USE_TYPE_SLOTS && PY_VERSION_HEX >= 0x030700B1
22758 PyTypeObject* tp = Py_TYPE(obj);
22759 if (likely(tp->tp_getattro == PyObject_GenericGetAttr)) {
22760 return _PyObject_GenericGetAttrWithDict(obj, attr_name, NULL, 1);
22763 result = __Pyx_PyObject_GetAttrStr(obj, attr_name);
22764 if (unlikely(!result)) {
22765 __Pyx_PyObject_GetAttrStr_ClearAttributeError();
22771 static int __Pyx_setup_reduce_is_named(PyObject* meth, PyObject* name) {
22773 PyObject *name_attr;
22774 name_attr = __Pyx_PyObject_GetAttrStr(meth, __pyx_n_s_name_2);
22775 if (likely(name_attr)) {
22776 ret = PyObject_RichCompareBool(name_attr, name, Py_EQ);
22780 if (unlikely(ret < 0)) {
22784 Py_XDECREF(name_attr);
22787 static int __Pyx_setup_reduce(PyObject* type_obj) {
22789 PyObject *object_reduce = NULL;
22790 PyObject *object_getstate = NULL;
22791 PyObject *object_reduce_ex = NULL;
22792 PyObject *reduce = NULL;
22793 PyObject *reduce_ex = NULL;
22794 PyObject *reduce_cython = NULL;
22795 PyObject *setstate = NULL;
22796 PyObject *setstate_cython = NULL;
22797 PyObject *getstate = NULL;
22798 #if CYTHON_USE_PYTYPE_LOOKUP
22799 getstate = _PyType_Lookup((PyTypeObject*)type_obj, __pyx_n_s_getstate);
22801 getstate = __Pyx_PyObject_GetAttrStrNoError(type_obj, __pyx_n_s_getstate);
22802 if (!getstate && PyErr_Occurred()) {
22807 #if CYTHON_USE_PYTYPE_LOOKUP
22808 object_getstate = _PyType_Lookup(&PyBaseObject_Type, __pyx_n_s_getstate);
22810 object_getstate = __Pyx_PyObject_GetAttrStrNoError((PyObject*)&PyBaseObject_Type, __pyx_n_s_getstate);
22811 if (!object_getstate && PyErr_Occurred()) {
22815 if (object_getstate != getstate) {
22819 #if CYTHON_USE_PYTYPE_LOOKUP
22820 object_reduce_ex = _PyType_Lookup(&PyBaseObject_Type, __pyx_n_s_reduce_ex);
if (!object_reduce_ex)
goto __PYX_BAD;
22822 object_reduce_ex = __Pyx_PyObject_GetAttrStr((PyObject*)&PyBaseObject_Type, __pyx_n_s_reduce_ex);
if (!object_reduce_ex)
goto __PYX_BAD;
22824 reduce_ex = __Pyx_PyObject_GetAttrStr(type_obj, __pyx_n_s_reduce_ex);
if (unlikely(!reduce_ex))
goto __PYX_BAD;
22825 if (reduce_ex == object_reduce_ex) {
22826 #if CYTHON_USE_PYTYPE_LOOKUP
22827 object_reduce = _PyType_Lookup(&PyBaseObject_Type, __pyx_n_s_reduce);
if (!object_reduce)
goto __PYX_BAD;
22829 object_reduce = __Pyx_PyObject_GetAttrStr((PyObject*)&PyBaseObject_Type, __pyx_n_s_reduce);
if (!object_reduce)
goto __PYX_BAD;
22831 reduce = __Pyx_PyObject_GetAttrStr(type_obj, __pyx_n_s_reduce);
if (unlikely(!reduce))
goto __PYX_BAD;
22832 if (reduce == object_reduce || __Pyx_setup_reduce_is_named(reduce, __pyx_n_s_reduce_cython)) {
22833 reduce_cython = __Pyx_PyObject_GetAttrStrNoError(type_obj, __pyx_n_s_reduce_cython);
22834 if (likely(reduce_cython)) {
22835 ret = PyDict_SetItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_reduce, reduce_cython);
if (unlikely(ret < 0))
goto __PYX_BAD;
22836 ret = PyDict_DelItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_reduce_cython);
if (unlikely(ret < 0))
goto __PYX_BAD;
22837 }
else if (reduce == object_reduce || PyErr_Occurred()) {
22840 setstate = __Pyx_PyObject_GetAttrStr(type_obj, __pyx_n_s_setstate);
22841 if (!setstate) PyErr_Clear();
22842 if (!setstate || __Pyx_setup_reduce_is_named(setstate, __pyx_n_s_setstate_cython)) {
22843 setstate_cython = __Pyx_PyObject_GetAttrStrNoError(type_obj, __pyx_n_s_setstate_cython);
22844 if (likely(setstate_cython)) {
22845 ret = PyDict_SetItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_setstate, setstate_cython);
if (unlikely(ret < 0))
goto __PYX_BAD;
22846 ret = PyDict_DelItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_setstate_cython);
if (unlikely(ret < 0))
goto __PYX_BAD;
22847 }
else if (!setstate || PyErr_Occurred()) {
22851 PyType_Modified((PyTypeObject*)type_obj);
22856 if (!PyErr_Occurred())
22857 PyErr_Format(PyExc_RuntimeError,
"Unable to initialize pickling for %s", ((PyTypeObject*)type_obj)->tp_name);
22860 #if !CYTHON_USE_PYTYPE_LOOKUP
22861 Py_XDECREF(object_reduce);
22862 Py_XDECREF(object_reduce_ex);
22863 Py_XDECREF(object_getstate);
22864 Py_XDECREF(getstate);
22866 Py_XDECREF(reduce);
22867 Py_XDECREF(reduce_ex);
22868 Py_XDECREF(reduce_cython);
22869 Py_XDECREF(setstate);
22870 Py_XDECREF(setstate_cython);
22875 static int __Pyx_SetVtable(PyObject *dict,
void *vtable) {
22876 #if PY_VERSION_HEX >= 0x02070000
22877 PyObject *ob = PyCapsule_New(vtable, 0, 0);
22879 PyObject *ob = PyCObject_FromVoidPtr(vtable, 0);
22883 if (PyDict_SetItem(dict, __pyx_n_s_pyx_vtable, ob) < 0)
22893 #ifndef __PYX_HAVE_RT_ImportType
22894 #define __PYX_HAVE_RT_ImportType
22895 static PyTypeObject *__Pyx_ImportType(PyObject *module,
const char *module_name,
const char *class_name,
22896 size_t size,
enum __Pyx_ImportType_CheckSize check_size)
22898 PyObject *result = 0;
22900 Py_ssize_t basicsize;
22901 #ifdef Py_LIMITED_API
22902 PyObject *py_basicsize;
22904 result = PyObject_GetAttrString(module, class_name);
22907 if (!PyType_Check(result)) {
22908 PyErr_Format(PyExc_TypeError,
22909 "%.200s.%.200s is not a type object",
22910 module_name, class_name);
22913 #ifndef Py_LIMITED_API
22914 basicsize = ((PyTypeObject *)result)->tp_basicsize;
22916 py_basicsize = PyObject_GetAttrString(result,
"__basicsize__");
22919 basicsize = PyLong_AsSsize_t(py_basicsize);
22920 Py_DECREF(py_basicsize);
22922 if (basicsize == (Py_ssize_t)-1 && PyErr_Occurred())
22925 if ((
size_t)basicsize < size) {
22926 PyErr_Format(PyExc_ValueError,
22927 "%.200s.%.200s size changed, may indicate binary incompatibility. "
22928 "Expected %zd from C header, got %zd from PyObject",
22929 module_name, class_name, size, basicsize);
22932 if (check_size == __Pyx_ImportType_CheckSize_Error && (
size_t)basicsize != size) {
22933 PyErr_Format(PyExc_ValueError,
22934 "%.200s.%.200s size changed, may indicate binary incompatibility. "
22935 "Expected %zd from C header, got %zd from PyObject",
22936 module_name, class_name, size, basicsize);
22939 else if (check_size == __Pyx_ImportType_CheckSize_Warn && (
size_t)basicsize > size) {
22940 PyOS_snprintf(warning,
sizeof(warning),
22941 "%s.%s size changed, may indicate binary incompatibility. "
22942 "Expected %zd from C header, got %zd from PyObject",
22943 module_name, class_name, size, basicsize);
22944 if (PyErr_WarnEx(NULL, warning, 0) < 0)
goto bad;
22946 return (PyTypeObject *)result;
22948 Py_XDECREF(result);
22954 #ifndef CYTHON_CLINE_IN_TRACEBACK
22955 static int __Pyx_CLineForTraceback(CYTHON_NCP_UNUSED PyThreadState *tstate,
int c_line) {
22956 PyObject *use_cline;
22957 PyObject *ptype, *pvalue, *ptraceback;
22958 #if CYTHON_COMPILING_IN_CPYTHON
22959 PyObject **cython_runtime_dict;
22961 if (unlikely(!__pyx_cython_runtime)) {
22964 __Pyx_ErrFetchInState(tstate, &ptype, &pvalue, &ptraceback);
22965 #if CYTHON_COMPILING_IN_CPYTHON
22966 cython_runtime_dict = _PyObject_GetDictPtr(__pyx_cython_runtime);
22967 if (likely(cython_runtime_dict)) {
22968 __PYX_PY_DICT_LOOKUP_IF_MODIFIED(
22969 use_cline, *cython_runtime_dict,
22970 __Pyx_PyDict_GetItemStr(*cython_runtime_dict, __pyx_n_s_cline_in_traceback))
22974 PyObject *use_cline_obj = __Pyx_PyObject_GetAttrStr(__pyx_cython_runtime, __pyx_n_s_cline_in_traceback);
22975 if (use_cline_obj) {
22976 use_cline = PyObject_Not(use_cline_obj) ? Py_False : Py_True;
22977 Py_DECREF(use_cline_obj);
22985 (void) PyObject_SetAttr(__pyx_cython_runtime, __pyx_n_s_cline_in_traceback, Py_False);
22987 else if (use_cline == Py_False || (use_cline != Py_True && PyObject_Not(use_cline) != 0)) {
22990 __Pyx_ErrRestoreInState(tstate, ptype, pvalue, ptraceback);
22996 static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries,
int count,
int code_line) {
22997 int start = 0, mid = 0, end = count - 1;
22998 if (end >= 0 && code_line > entries[end].code_line) {
23001 while (start < end) {
23002 mid = start + (end - start) / 2;
23003 if (code_line < entries[mid].code_line) {
23005 }
else if (code_line > entries[mid].code_line) {
23011 if (code_line <= entries[mid].code_line) {
23017 static PyCodeObject *__pyx_find_code_object(
int code_line) {
23018 PyCodeObject* code_object;
23020 if (unlikely(!code_line) || unlikely(!__pyx_code_cache.entries)) {
23023 pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line);
23024 if (unlikely(
pos >= __pyx_code_cache.count) || unlikely(__pyx_code_cache.entries[
pos].code_line != code_line)) {
23027 code_object = __pyx_code_cache.entries[
pos].code_object;
23028 Py_INCREF(code_object);
23029 return code_object;
23031 static void __pyx_insert_code_object(
int code_line, PyCodeObject* code_object) {
23033 __Pyx_CodeObjectCacheEntry* entries = __pyx_code_cache.entries;
23034 if (unlikely(!code_line)) {
23037 if (unlikely(!entries)) {
23038 entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Malloc(64*
sizeof(__Pyx_CodeObjectCacheEntry));
23039 if (likely(entries)) {
23040 __pyx_code_cache.entries = entries;
23041 __pyx_code_cache.max_count = 64;
23042 __pyx_code_cache.count = 1;
23043 entries[0].code_line = code_line;
23044 entries[0].code_object = code_object;
23045 Py_INCREF(code_object);
23049 pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line);
23050 if ((
pos < __pyx_code_cache.count) && unlikely(__pyx_code_cache.entries[
pos].code_line == code_line)) {
23051 PyCodeObject* tmp = entries[
pos].code_object;
23052 entries[
pos].code_object = code_object;
23056 if (__pyx_code_cache.count == __pyx_code_cache.max_count) {
23057 int new_max = __pyx_code_cache.max_count + 64;
23058 entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Realloc(
23059 __pyx_code_cache.entries, ((
size_t)new_max) *
sizeof(__Pyx_CodeObjectCacheEntry));
23060 if (unlikely(!entries)) {
23063 __pyx_code_cache.entries = entries;
23064 __pyx_code_cache.max_count = new_max;
23066 for (i=__pyx_code_cache.count; i>
pos; i--) {
23067 entries[i] = entries[i-1];
23069 entries[
pos].code_line = code_line;
23070 entries[
pos].code_object = code_object;
23071 __pyx_code_cache.count++;
23072 Py_INCREF(code_object);
23076 #include "compile.h"
23077 #include "frameobject.h"
23078 #include "traceback.h"
23079 #if PY_VERSION_HEX >= 0x030b00a6
23080 #ifndef Py_BUILD_CORE
23081 #define Py_BUILD_CORE 1
23083 #include "internal/pycore_frame.h"
23085 static PyCodeObject* __Pyx_CreateCodeObjectForTraceback(
23086 const char *funcname,
int c_line,
23087 int py_line,
const char *filename) {
23088 PyCodeObject *py_code = NULL;
23089 PyObject *py_funcname = NULL;
23090 #if PY_MAJOR_VERSION < 3
23091 PyObject *py_srcfile = NULL;
23092 py_srcfile = PyString_FromString(filename);
23093 if (!py_srcfile)
goto bad;
23096 #if PY_MAJOR_VERSION < 3
23097 py_funcname = PyString_FromFormat(
"%s (%s:%d)", funcname, __pyx_cfilenm, c_line);
23098 if (!py_funcname)
goto bad;
23100 py_funcname = PyUnicode_FromFormat(
"%s (%s:%d)", funcname, __pyx_cfilenm, c_line);
23101 if (!py_funcname)
goto bad;
23102 funcname = PyUnicode_AsUTF8(py_funcname);
23103 if (!funcname)
goto bad;
23107 #if PY_MAJOR_VERSION < 3
23108 py_funcname = PyString_FromString(funcname);
23109 if (!py_funcname)
goto bad;
23112 #if PY_MAJOR_VERSION < 3
23113 py_code = __Pyx_PyCode_New(
23130 Py_DECREF(py_srcfile);
23132 py_code = PyCode_NewEmpty(filename, funcname, py_line);
23134 Py_XDECREF(py_funcname);
23137 Py_XDECREF(py_funcname);
23138 #if PY_MAJOR_VERSION < 3
23139 Py_XDECREF(py_srcfile);
23143 static void __Pyx_AddTraceback(
const char *funcname,
int c_line,
23144 int py_line,
const char *filename) {
23145 PyCodeObject *py_code = 0;
23146 PyFrameObject *py_frame = 0;
23147 PyThreadState *tstate = __Pyx_PyThreadState_Current;
23148 PyObject *ptype, *pvalue, *ptraceback;
23150 c_line = __Pyx_CLineForTraceback(tstate, c_line);
23152 py_code = __pyx_find_code_object(c_line ? -c_line : py_line);
23154 __Pyx_ErrFetchInState(tstate, &ptype, &pvalue, &ptraceback);
23155 py_code = __Pyx_CreateCodeObjectForTraceback(
23156 funcname, c_line, py_line, filename);
23161 Py_XDECREF(pvalue);
23162 Py_XDECREF(ptraceback);
23165 __Pyx_ErrRestoreInState(tstate, ptype, pvalue, ptraceback);
23166 __pyx_insert_code_object(c_line ? -c_line : py_line, py_code);
23168 py_frame = PyFrame_New(
23174 if (!py_frame)
goto bad;
23175 __Pyx_PyFrame_SetLineNumber(py_frame, py_line);
23176 PyTraceBack_Here(py_frame);
23178 Py_XDECREF(py_code);
23179 Py_XDECREF(py_frame);
23183 #define __PYX_VERIFY_RETURN_INT(target_type, func_type, func_value)\
23184 __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 0)
23185 #define __PYX_VERIFY_RETURN_INT_EXC(target_type, func_type, func_value)\
23186 __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 1)
23187 #define __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, exc)\
23189 func_type value = func_value;\
23190 if (sizeof(target_type) < sizeof(func_type)) {\
23191 if (unlikely(value != (func_type) (target_type) value)) {\
23192 func_type zero = 0;\
23193 if (exc && unlikely(value == (func_type)-1 && PyErr_Occurred()))\
23194 return (target_type) -1;\
23195 if (is_unsigned && unlikely(value < zero))\
23196 goto raise_neg_overflow;\
23198 goto raise_overflow;\
23201 return (target_type) value;\
23205 static CYTHON_INLINE PyObject *__pyx_memview_get_double(
const char *itemp) {
23206 return (PyObject *) PyFloat_FromDouble(*(
double *) itemp);
23208 static CYTHON_INLINE
int __pyx_memview_set_double(
const char *itemp, PyObject *obj) {
23209 double value = __pyx_PyFloat_AsDouble(obj);
23210 if ((value == (
double)-1) && PyErr_Occurred())
23212 *(
double *) itemp = value;
23217 #if CYTHON_CCOMPLEX
23219 static CYTHON_INLINE __pyx_t_float_complex __pyx_t_float_complex_from_parts(
float x,
float y) {
23220 return ::std::complex< float >(x, y);
23223 static CYTHON_INLINE __pyx_t_float_complex __pyx_t_float_complex_from_parts(
float x,
float y) {
23224 return x + y*(__pyx_t_float_complex)_Complex_I;
23228 static CYTHON_INLINE __pyx_t_float_complex __pyx_t_float_complex_from_parts(
float x,
float y) {
23229 __pyx_t_float_complex
z;
23237 #if CYTHON_CCOMPLEX
23239 static CYTHON_INLINE
int __Pyx_c_eq_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
23240 return (a.real == b.real) && (a.imag == b.imag);
23242 static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_sum_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
23243 __pyx_t_float_complex
z;
23244 z.real = a.real + b.real;
23245 z.imag = a.imag + b.imag;
23248 static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_diff_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
23249 __pyx_t_float_complex
z;
23250 z.real = a.real - b.real;
23251 z.imag = a.imag - b.imag;
23254 static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_prod_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
23255 __pyx_t_float_complex
z;
23256 z.real = a.real * b.real - a.imag * b.imag;
23257 z.imag = a.real * b.imag + a.imag * b.real;
23261 static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_quot_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
23263 return __pyx_t_float_complex_from_parts(a.real / b.real, a.imag / b.real);
23264 }
else if (fabsf(b.real) >= fabsf(b.imag)) {
23265 if (b.real == 0 && b.imag == 0) {
23266 return __pyx_t_float_complex_from_parts(a.real / b.real, a.imag / b.imag);
23268 float r = b.imag / b.real;
23269 float s = (float)(1.0) / (b.real + b.imag *
r);
23270 return __pyx_t_float_complex_from_parts(
23271 (a.real + a.imag *
r) *
s, (a.imag - a.real *
r) *
s);
23274 float r = b.real / b.imag;
23275 float s = (float)(1.0) / (b.imag + b.real *
r);
23276 return __pyx_t_float_complex_from_parts(
23277 (a.real *
r + a.imag) *
s, (a.imag *
r - a.real) *
s);
23281 static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_quot_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
23283 return __pyx_t_float_complex_from_parts(a.real / b.real, a.imag / b.real);
23285 float denom = b.real * b.real + b.imag * b.imag;
23286 return __pyx_t_float_complex_from_parts(
23287 (a.real * b.real + a.imag * b.imag) / denom,
23288 (a.imag * b.real - a.real * b.imag) / denom);
23292 static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_neg_float(__pyx_t_float_complex a) {
23293 __pyx_t_float_complex
z;
23298 static CYTHON_INLINE
int __Pyx_c_is_zero_float(__pyx_t_float_complex a) {
23299 return (a.real == 0) && (a.imag == 0);
23301 static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_conj_float(__pyx_t_float_complex a) {
23302 __pyx_t_float_complex
z;
23308 static CYTHON_INLINE
float __Pyx_c_abs_float(__pyx_t_float_complex
z) {
23309 #if !defined(HAVE_HYPOT) || defined(_MSC_VER)
23310 return sqrtf(
z.real*
z.real +
z.imag*
z.imag);
23312 return hypotf(
z.real,
z.imag);
23315 static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_pow_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
23316 __pyx_t_float_complex
z;
23317 float r, lnr, theta, z_r, z_theta;
23318 if (b.imag == 0 && b.real == (
int)b.real) {
23320 float denom = a.real * a.real + a.imag * a.imag;
23321 a.real = a.real / denom;
23322 a.imag = -a.imag / denom;
23325 switch ((
int)b.real) {
23333 return __Pyx_c_prod_float(a, a);
23335 z = __Pyx_c_prod_float(a, a);
23336 return __Pyx_c_prod_float(
z, a);
23338 z = __Pyx_c_prod_float(a, a);
23339 return __Pyx_c_prod_float(
z,
z);
23345 }
else if (b.imag == 0) {
23346 z.real = powf(a.real, b.real);
23349 }
else if (a.real > 0) {
23354 theta = atan2f(0.0, -1.0);
23357 r = __Pyx_c_abs_float(a);
23358 theta = atan2f(a.imag, a.real);
23361 z_r = expf(lnr * b.real - theta * b.imag);
23362 z_theta = theta * b.real + lnr * b.imag;
23363 z.real = z_r * cosf(z_theta);
23364 z.imag = z_r * sinf(z_theta);
23371 #if CYTHON_CCOMPLEX
23373 static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(
double x,
double y) {
23374 return ::std::complex< double >(x, y);
23377 static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(
double x,
double y) {
23378 return x + y*(__pyx_t_double_complex)_Complex_I;
23382 static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(
double x,
double y) {
23383 __pyx_t_double_complex
z;
23391 #if CYTHON_CCOMPLEX
23393 static CYTHON_INLINE
int __Pyx_c_eq_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
23394 return (a.real == b.real) && (a.imag == b.imag);
23396 static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_sum_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
23397 __pyx_t_double_complex
z;
23398 z.real = a.real + b.real;
23399 z.imag = a.imag + b.imag;
23402 static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_diff_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
23403 __pyx_t_double_complex
z;
23404 z.real = a.real - b.real;
23405 z.imag = a.imag - b.imag;
23408 static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_prod_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
23409 __pyx_t_double_complex
z;
23410 z.real = a.real * b.real - a.imag * b.imag;
23411 z.imag = a.real * b.imag + a.imag * b.real;
23415 static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_quot_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
23417 return __pyx_t_double_complex_from_parts(a.real / b.real, a.imag / b.real);
23418 }
else if (fabs(b.real) >= fabs(b.imag)) {
23419 if (b.real == 0 && b.imag == 0) {
23420 return __pyx_t_double_complex_from_parts(a.real / b.real, a.imag / b.imag);
23422 double r = b.imag / b.real;
23423 double s = (double)(1.0) / (b.real + b.imag *
r);
23424 return __pyx_t_double_complex_from_parts(
23425 (a.real + a.imag *
r) *
s, (a.imag - a.real *
r) *
s);
23428 double r = b.real / b.imag;
23429 double s = (double)(1.0) / (b.imag + b.real *
r);
23430 return __pyx_t_double_complex_from_parts(
23431 (a.real *
r + a.imag) *
s, (a.imag *
r - a.real) *
s);
23435 static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_quot_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
23437 return __pyx_t_double_complex_from_parts(a.real / b.real, a.imag / b.real);
23439 double denom = b.real * b.real + b.imag * b.imag;
23440 return __pyx_t_double_complex_from_parts(
23441 (a.real * b.real + a.imag * b.imag) / denom,
23442 (a.imag * b.real - a.real * b.imag) / denom);
23446 static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_neg_double(__pyx_t_double_complex a) {
23447 __pyx_t_double_complex
z;
23452 static CYTHON_INLINE
int __Pyx_c_is_zero_double(__pyx_t_double_complex a) {
23453 return (a.real == 0) && (a.imag == 0);
23455 static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_conj_double(__pyx_t_double_complex a) {
23456 __pyx_t_double_complex
z;
23462 static CYTHON_INLINE
double __Pyx_c_abs_double(__pyx_t_double_complex
z) {
23463 #if !defined(HAVE_HYPOT) || defined(_MSC_VER)
23464 return sqrt(
z.real*
z.real +
z.imag*
z.imag);
23466 return hypot(
z.real,
z.imag);
23469 static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_pow_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
23470 __pyx_t_double_complex
z;
23471 double r, lnr, theta, z_r, z_theta;
23472 if (b.imag == 0 && b.real == (
int)b.real) {
23474 double denom = a.real * a.real + a.imag * a.imag;
23475 a.real = a.real / denom;
23476 a.imag = -a.imag / denom;
23479 switch ((
int)b.real) {
23487 return __Pyx_c_prod_double(a, a);
23489 z = __Pyx_c_prod_double(a, a);
23490 return __Pyx_c_prod_double(
z, a);
23492 z = __Pyx_c_prod_double(a, a);
23493 return __Pyx_c_prod_double(
z,
z);
23499 }
else if (b.imag == 0) {
23500 z.real = pow(a.real, b.real);
23503 }
else if (a.real > 0) {
23508 theta = atan2(0.0, -1.0);
23511 r = __Pyx_c_abs_double(a);
23512 theta = atan2(a.imag, a.real);
23515 z_r = exp(lnr * b.real - theta * b.imag);
23516 z_theta = theta * b.real + lnr * b.imag;
23517 z.real = z_r * cos(z_theta);
23518 z.imag = z_r * sin(z_theta);
23524 #if PY_MAJOR_VERSION < 3
23525 static int __Pyx_GetBuffer(PyObject *obj, Py_buffer *view,
int flags) {
23526 if (PyObject_CheckBuffer(obj))
return PyObject_GetBuffer(obj, view, flags);
23527 if (__Pyx_TypeCheck(obj, __pyx_array_type))
return __pyx_array_getbuffer(obj, view, flags);
23528 if (__Pyx_TypeCheck(obj, __pyx_memoryview_type))
return __pyx_memoryview_getbuffer(obj, view, flags);
23529 PyErr_Format(PyExc_TypeError,
"'%.200s' does not have the buffer interface", Py_TYPE(obj)->tp_name);
23532 static void __Pyx_ReleaseBuffer(Py_buffer *view) {
23533 PyObject *obj = view->obj;
23535 if (PyObject_CheckBuffer(obj)) {
23536 PyBuffer_Release(view);
23548 __pyx_memviewslice_is_contig(
const __Pyx_memviewslice mvs,
char order,
int ndim)
23550 int i, index, step, start;
23551 Py_ssize_t itemsize = mvs.memview->view.itemsize;
23552 if (order ==
'F') {
23559 for (i = 0; i < ndim; i++) {
23560 index = start + step * i;
23561 if (mvs.suboffsets[index] >= 0 || mvs.strides[index] != itemsize)
23563 itemsize *= mvs.shape[index];
23570 __pyx_get_array_memory_extents(__Pyx_memviewslice *slice,
23571 void **out_start,
void **out_end,
23572 int ndim,
size_t itemsize)
23576 start = end = slice->data;
23577 for (i = 0; i < ndim; i++) {
23578 Py_ssize_t stride = slice->strides[i];
23579 Py_ssize_t extent = slice->shape[i];
23581 *out_start = *out_end = start;
23585 end += stride * (extent - 1);
23587 start += stride * (extent - 1);
23590 *out_start = start;
23591 *out_end = end + itemsize;
23594 __pyx_slices_overlap(__Pyx_memviewslice *slice1,
23595 __Pyx_memviewslice *slice2,
23596 int ndim,
size_t itemsize)
23598 void *start1, *end1, *start2, *end2;
23599 __pyx_get_array_memory_extents(slice1, &start1, &end1, ndim, itemsize);
23600 __pyx_get_array_memory_extents(slice2, &start2, &end2, ndim, itemsize);
23601 return (start1 < end2) && (start2 < end1);
23605 static CYTHON_INLINE PyObject *
23606 __pyx_capsule_create(
void *p, CYTHON_UNUSED
const char *sig)
23609 #if PY_VERSION_HEX >= 0x02070000
23610 cobj = PyCapsule_New(p, sig, NULL);
23612 cobj = PyCObject_FromVoidPtr(p, NULL);
23618 static CYTHON_INLINE
int __Pyx_PyInt_As_int(PyObject *x) {
23619 #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
23620 #pragma GCC diagnostic push
23621 #pragma GCC diagnostic ignored "-Wconversion"
23623 const int neg_one = (int) -1, const_zero = (
int) 0;
23624 #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
23625 #pragma GCC diagnostic pop
23627 const int is_unsigned = neg_one > const_zero;
23628 #if PY_MAJOR_VERSION < 3
23629 if (likely(PyInt_Check(x))) {
23630 if (
sizeof(
int) <
sizeof(long)) {
23631 __PYX_VERIFY_RETURN_INT(
int,
long, PyInt_AS_LONG(x))
23633 long val = PyInt_AS_LONG(x);
23634 if (is_unsigned && unlikely(val < 0)) {
23635 goto raise_neg_overflow;
23641 if (likely(PyLong_Check(x))) {
23643 #if CYTHON_USE_PYLONG_INTERNALS
23644 const digit* digits = ((PyLongObject*)x)->ob_digit;
23645 switch (Py_SIZE(x)) {
23646 case 0:
return (
int) 0;
23647 case 1: __PYX_VERIFY_RETURN_INT(
int, digit, digits[0])
23649 if (8 *
sizeof(
int) > 1 * PyLong_SHIFT) {
23650 if (8 *
sizeof(
unsigned long) > 2 * PyLong_SHIFT) {
23651 __PYX_VERIFY_RETURN_INT(
int,
unsigned long, (((((
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
23652 }
else if (8 *
sizeof(
int) >= 2 * PyLong_SHIFT) {
23653 return (
int) (((((int)digits[1]) << PyLong_SHIFT) | (
int)digits[0]));
23658 if (8 *
sizeof(
int) > 2 * PyLong_SHIFT) {
23659 if (8 *
sizeof(
unsigned long) > 3 * PyLong_SHIFT) {
23660 __PYX_VERIFY_RETURN_INT(
int,
unsigned long, (((((((
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
23661 }
else if (8 *
sizeof(
int) >= 3 * PyLong_SHIFT) {
23662 return (
int) (((((((int)digits[2]) << PyLong_SHIFT) | (
int)digits[1]) << PyLong_SHIFT) | (int)digits[0]));
23667 if (8 *
sizeof(
int) > 3 * PyLong_SHIFT) {
23668 if (8 *
sizeof(
unsigned long) > 4 * PyLong_SHIFT) {
23669 __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])))
23670 }
else if (8 *
sizeof(
int) >= 4 * PyLong_SHIFT) {
23671 return (
int) (((((((((int)digits[3]) << PyLong_SHIFT) | (
int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (
int)digits[0]));
23677 #if CYTHON_COMPILING_IN_CPYTHON
23678 if (unlikely(Py_SIZE(x) < 0)) {
23679 goto raise_neg_overflow;
23683 int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
23684 if (unlikely(result < 0))
23686 if (unlikely(result == 1))
23687 goto raise_neg_overflow;
23690 if (
sizeof(
int) <=
sizeof(
unsigned long)) {
23691 __PYX_VERIFY_RETURN_INT_EXC(
int,
unsigned long, PyLong_AsUnsignedLong(x))
23692 #ifdef HAVE_LONG_LONG
23693 }
else if (
sizeof(
int) <=
sizeof(
unsigned PY_LONG_LONG)) {
23694 __PYX_VERIFY_RETURN_INT_EXC(
int,
unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
23698 #if CYTHON_USE_PYLONG_INTERNALS
23699 const digit* digits = ((PyLongObject*)x)->ob_digit;
23700 switch (Py_SIZE(x)) {
23701 case 0:
return (
int) 0;
23702 case -1: __PYX_VERIFY_RETURN_INT(
int, sdigit, (sdigit) (-(sdigit)digits[0]))
23703 case 1: __PYX_VERIFY_RETURN_INT(
int, digit, +digits[0])
23705 if (8 *
sizeof(
int) - 1 > 1 * PyLong_SHIFT) {
23706 if (8 *
sizeof(
unsigned long) > 2 * PyLong_SHIFT) {
23707 __PYX_VERIFY_RETURN_INT(
int,
long, -(
long) (((((
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
23708 }
else if (8 *
sizeof(
int) - 1 > 2 * PyLong_SHIFT) {
23709 return (
int) (((int)-1)*(((((int)digits[1]) << PyLong_SHIFT) | (
int)digits[0])));
23714 if (8 *
sizeof(
int) > 1 * PyLong_SHIFT) {
23715 if (8 *
sizeof(
unsigned long) > 2 * PyLong_SHIFT) {
23716 __PYX_VERIFY_RETURN_INT(
int,
unsigned long, (((((
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
23717 }
else if (8 *
sizeof(
int) - 1 > 2 * PyLong_SHIFT) {
23718 return (
int) ((((((int)digits[1]) << PyLong_SHIFT) | (
int)digits[0])));
23723 if (8 *
sizeof(
int) - 1 > 2 * PyLong_SHIFT) {
23724 if (8 *
sizeof(
unsigned long) > 3 * PyLong_SHIFT) {
23725 __PYX_VERIFY_RETURN_INT(
int,
long, -(
long) (((((((
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
23726 }
else if (8 *
sizeof(
int) - 1 > 3 * PyLong_SHIFT) {
23727 return (
int) (((int)-1)*(((((((int)digits[2]) << PyLong_SHIFT) | (
int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
23732 if (8 *
sizeof(
int) > 2 * PyLong_SHIFT) {
23733 if (8 *
sizeof(
unsigned long) > 3 * PyLong_SHIFT) {
23734 __PYX_VERIFY_RETURN_INT(
int,
unsigned long, (((((((
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
23735 }
else if (8 *
sizeof(
int) - 1 > 3 * PyLong_SHIFT) {
23736 return (
int) ((((((((int)digits[2]) << PyLong_SHIFT) | (
int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
23741 if (8 *
sizeof(
int) - 1 > 3 * PyLong_SHIFT) {
23742 if (8 *
sizeof(
unsigned long) > 4 * PyLong_SHIFT) {
23743 __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])))
23744 }
else if (8 *
sizeof(
int) - 1 > 4 * PyLong_SHIFT) {
23745 return (
int) (((int)-1)*(((((((((int)digits[3]) << PyLong_SHIFT) | (
int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (
int)digits[0])));
23750 if (8 *
sizeof(
int) > 3 * PyLong_SHIFT) {
23751 if (8 *
sizeof(
unsigned long) > 4 * PyLong_SHIFT) {
23752 __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])))
23753 }
else if (8 *
sizeof(
int) - 1 > 4 * PyLong_SHIFT) {
23754 return (
int) ((((((((((int)digits[3]) << PyLong_SHIFT) | (
int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (
int)digits[0])));
23760 if (
sizeof(
int) <=
sizeof(long)) {
23761 __PYX_VERIFY_RETURN_INT_EXC(
int,
long, PyLong_AsLong(x))
23762 #ifdef HAVE_LONG_LONG
23763 }
else if (
sizeof(
int) <=
sizeof(PY_LONG_LONG)) {
23764 __PYX_VERIFY_RETURN_INT_EXC(
int, PY_LONG_LONG, PyLong_AsLongLong(x))
23769 #if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray)
23770 PyErr_SetString(PyExc_RuntimeError,
23771 "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers");
23774 PyObject *
v = __Pyx_PyNumber_IntOrLong(x);
23775 #if PY_MAJOR_VERSION < 3
23776 if (likely(
v) && !PyLong_Check(
v)) {
23778 v = PyNumber_Long(tmp);
23783 int one = 1;
int is_little = (int)*(
unsigned char *)&one;
23784 unsigned char *bytes = (
unsigned char *)&val;
23785 int ret = _PyLong_AsByteArray((PyLongObject *)
v,
23786 bytes,
sizeof(val),
23787 is_little, !is_unsigned);
23797 PyObject *tmp = __Pyx_PyNumber_IntOrLong(x);
23798 if (!tmp)
return (
int) -1;
23799 val = __Pyx_PyInt_As_int(tmp);
23804 PyErr_SetString(PyExc_OverflowError,
23805 "value too large to convert to int");
23807 raise_neg_overflow:
23808 PyErr_SetString(PyExc_OverflowError,
23809 "can't convert negative value to int");
23814 static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(
int value) {
23815 #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
23816 #pragma GCC diagnostic push
23817 #pragma GCC diagnostic ignored "-Wconversion"
23819 const int neg_one = (int) -1, const_zero = (
int) 0;
23820 #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
23821 #pragma GCC diagnostic pop
23823 const int is_unsigned = neg_one > const_zero;
23825 if (
sizeof(
int) <
sizeof(long)) {
23826 return PyInt_FromLong((
long) value);
23827 }
else if (
sizeof(
int) <=
sizeof(
unsigned long)) {
23828 return PyLong_FromUnsignedLong((
unsigned long) value);
23829 #ifdef HAVE_LONG_LONG
23830 }
else if (
sizeof(
int) <=
sizeof(
unsigned PY_LONG_LONG)) {
23831 return PyLong_FromUnsignedLongLong((
unsigned PY_LONG_LONG) value);
23835 if (
sizeof(
int) <=
sizeof(
long)) {
23836 return PyInt_FromLong((
long) value);
23837 #ifdef HAVE_LONG_LONG
23838 }
else if (
sizeof(
int) <=
sizeof(PY_LONG_LONG)) {
23839 return PyLong_FromLongLong((PY_LONG_LONG) value);
23844 int one = 1;
int little = (int)*(
unsigned char *)&one;
23845 unsigned char *bytes = (
unsigned char *)&value;
23846 return _PyLong_FromByteArray(bytes,
sizeof(
int),
23847 little, !is_unsigned);
23852 static struct __pyx_typeinfo_string __Pyx_TypeInfoToFormat(__Pyx_TypeInfo *type) {
23853 struct __pyx_typeinfo_string result = { {0} };
23854 char *buf = (
char *) result.string;
23855 size_t size = type->size;
23856 switch (type->typegroup) {
23863 *buf = (type->is_unsigned) ?
'B' :
'b';
23864 else if (size == 2)
23865 *buf = (type->is_unsigned) ?
'H' :
'h';
23866 else if (size == 4)
23867 *buf = (type->is_unsigned) ?
'I' :
'i';
23868 else if (size == 8)
23869 *buf = (type->is_unsigned) ?
'Q' :
'q';
23876 __Pyx_TypeInfo complex_type = *type;
23877 complex_type.typegroup =
'R';
23878 complex_type.size /= 2;
23880 *buf = __Pyx_TypeInfoToFormat(&complex_type).string[0];
23886 else if (size == 8)
23896 static __Pyx_memviewslice
23897 __pyx_memoryview_copy_new_contig(
const __Pyx_memviewslice *from_mvs,
23898 const char *mode,
int ndim,
23899 size_t sizeof_dtype,
int contig_flag,
23900 int dtype_is_object)
23902 __Pyx_RefNannyDeclarations
23904 __Pyx_memviewslice new_mvs = { 0, 0, { 0 }, { 0 }, { 0 } };
23905 struct __pyx_memoryview_obj *from_memview = from_mvs->memview;
23906 Py_buffer *buf = &from_memview->view;
23907 PyObject *shape_tuple = NULL;
23908 PyObject *temp_int = NULL;
23909 struct __pyx_array_obj *array_obj = NULL;
23910 struct __pyx_memoryview_obj *memview_obj = NULL;
23911 __Pyx_RefNannySetupContext(
"__pyx_memoryview_copy_new_contig", 0);
23912 for (i = 0; i < ndim; i++) {
23913 if (unlikely(from_mvs->suboffsets[i] >= 0)) {
23914 PyErr_Format(PyExc_ValueError,
"Cannot copy memoryview slice with "
23915 "indirect dimensions (axis %d)", i);
23919 shape_tuple = PyTuple_New(ndim);
23920 if (unlikely(!shape_tuple)) {
23923 __Pyx_GOTREF(shape_tuple);
23924 for(i = 0; i < ndim; i++) {
23925 temp_int = PyInt_FromSsize_t(from_mvs->shape[i]);
23926 if(unlikely(!temp_int)) {
23929 PyTuple_SET_ITEM(shape_tuple, i, temp_int);
23933 array_obj = __pyx_array_new(shape_tuple, sizeof_dtype, buf->format, (
char *) mode, NULL);
23934 if (unlikely(!array_obj)) {
23937 __Pyx_GOTREF(array_obj);
23938 memview_obj = (
struct __pyx_memoryview_obj *) __pyx_memoryview_new(
23939 (PyObject *) array_obj, contig_flag,
23941 from_mvs->memview->typeinfo);
23942 if (unlikely(!memview_obj))
23944 if (unlikely(__Pyx_init_memviewslice(memview_obj, ndim, &new_mvs, 1) < 0))
23946 if (unlikely(__pyx_memoryview_copy_contents(*from_mvs, new_mvs, ndim, ndim,
23947 dtype_is_object) < 0))
23951 __Pyx_XDECREF(new_mvs.memview);
23952 new_mvs.memview = NULL;
23953 new_mvs.data = NULL;
23955 __Pyx_XDECREF(shape_tuple);
23956 __Pyx_XDECREF(temp_int);
23957 __Pyx_XDECREF(array_obj);
23958 __Pyx_RefNannyFinishContext();
23964 __Pyx_init_memviewslice(
struct __pyx_memoryview_obj *memview,
23966 __Pyx_memviewslice *memviewslice,
23967 int memview_is_new_reference)
23969 __Pyx_RefNannyDeclarations
23971 Py_buffer *buf = &memview->view;
23972 __Pyx_RefNannySetupContext(
"init_memviewslice", 0);
23973 if (unlikely(memviewslice->memview || memviewslice->data)) {
23974 PyErr_SetString(PyExc_ValueError,
23975 "memviewslice is already initialized!");
23978 if (buf->strides) {
23979 for (i = 0; i < ndim; i++) {
23980 memviewslice->strides[i] = buf->strides[i];
23983 Py_ssize_t stride = buf->itemsize;
23984 for (i = ndim - 1; i >= 0; i--) {
23985 memviewslice->strides[i] = stride;
23986 stride *= buf->shape[i];
23989 for (i = 0; i < ndim; i++) {
23990 memviewslice->shape[i] = buf->shape[i];
23991 if (buf->suboffsets) {
23992 memviewslice->suboffsets[i] = buf->suboffsets[i];
23994 memviewslice->suboffsets[i] = -1;
23997 memviewslice->memview = memview;
23998 memviewslice->data = (
char *)buf->buf;
23999 if (__pyx_add_acquisition_count(memview) == 0 && !memview_is_new_reference) {
24000 Py_INCREF(memview);
24005 memviewslice->memview = 0;
24006 memviewslice->data = 0;
24009 __Pyx_RefNannyFinishContext();
24012 #ifndef Py_NO_RETURN
24013 #define Py_NO_RETURN
24015 static void __pyx_fatalerror(
const char *fmt, ...) Py_NO_RETURN {
24018 #ifdef HAVE_STDARG_PROTOTYPES
24019 va_start(vargs, fmt);
24023 vsnprintf(msg, 200, fmt, vargs);
24025 Py_FatalError(msg);
24027 static CYTHON_INLINE
int
24028 __pyx_add_acquisition_count_locked(__pyx_atomic_int *acquisition_count,
24029 PyThread_type_lock lock)
24032 PyThread_acquire_lock(lock, 1);
24033 result = (*acquisition_count)++;
24034 PyThread_release_lock(lock);
24037 static CYTHON_INLINE
int
24038 __pyx_sub_acquisition_count_locked(__pyx_atomic_int *acquisition_count,
24039 PyThread_type_lock lock)
24042 PyThread_acquire_lock(lock, 1);
24043 result = (*acquisition_count)--;
24044 PyThread_release_lock(lock);
24047 static CYTHON_INLINE
void
24048 __Pyx_INC_MEMVIEW(__Pyx_memviewslice *memslice,
int have_gil,
int lineno)
24051 struct __pyx_memoryview_obj *memview = memslice->memview;
24052 if (unlikely(!memview || (PyObject *) memview == Py_None))
24054 if (unlikely(__pyx_get_slice_count(memview) < 0))
24055 __pyx_fatalerror(
"Acquisition count is %d (line %d)",
24056 __pyx_get_slice_count(memview), lineno);
24057 first_time = __pyx_add_acquisition_count(memview) == 0;
24058 if (unlikely(first_time)) {
24060 Py_INCREF((PyObject *) memview);
24062 PyGILState_STATE _gilstate = PyGILState_Ensure();
24063 Py_INCREF((PyObject *) memview);
24064 PyGILState_Release(_gilstate);
24068 static CYTHON_INLINE
void __Pyx_XDEC_MEMVIEW(__Pyx_memviewslice *memslice,
24069 int have_gil,
int lineno) {
24071 struct __pyx_memoryview_obj *memview = memslice->memview;
24072 if (unlikely(!memview || (PyObject *) memview == Py_None)) {
24073 memslice->memview = NULL;
24076 if (unlikely(__pyx_get_slice_count(memview) <= 0))
24077 __pyx_fatalerror(
"Acquisition count is %d (line %d)",
24078 __pyx_get_slice_count(memview), lineno);
24079 last_time = __pyx_sub_acquisition_count(memview) == 1;
24080 memslice->data = NULL;
24081 if (unlikely(last_time)) {
24083 Py_CLEAR(memslice->memview);
24085 PyGILState_STATE _gilstate = PyGILState_Ensure();
24086 Py_CLEAR(memslice->memview);
24087 PyGILState_Release(_gilstate);
24090 memslice->memview = NULL;
24095 static CYTHON_INLINE
long __Pyx_PyInt_As_long(PyObject *x) {
24096 #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
24097 #pragma GCC diagnostic push
24098 #pragma GCC diagnostic ignored "-Wconversion"
24100 const long neg_one = (long) -1, const_zero = (
long) 0;
24101 #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
24102 #pragma GCC diagnostic pop
24104 const int is_unsigned = neg_one > const_zero;
24105 #if PY_MAJOR_VERSION < 3
24106 if (likely(PyInt_Check(x))) {
24107 if (
sizeof(
long) <
sizeof(long)) {
24108 __PYX_VERIFY_RETURN_INT(
long,
long, PyInt_AS_LONG(x))
24110 long val = PyInt_AS_LONG(x);
24111 if (is_unsigned && unlikely(val < 0)) {
24112 goto raise_neg_overflow;
24118 if (likely(PyLong_Check(x))) {
24120 #if CYTHON_USE_PYLONG_INTERNALS
24121 const digit* digits = ((PyLongObject*)x)->ob_digit;
24122 switch (Py_SIZE(x)) {
24123 case 0:
return (
long) 0;
24124 case 1: __PYX_VERIFY_RETURN_INT(
long, digit, digits[0])
24126 if (8 *
sizeof(
long) > 1 * PyLong_SHIFT) {
24127 if (8 *
sizeof(
unsigned long) > 2 * PyLong_SHIFT) {
24128 __PYX_VERIFY_RETURN_INT(
long,
unsigned long, (((((
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
24129 }
else if (8 *
sizeof(
long) >= 2 * PyLong_SHIFT) {
24130 return (
long) (((((long)digits[1]) << PyLong_SHIFT) | (
long)digits[0]));
24135 if (8 *
sizeof(
long) > 2 * PyLong_SHIFT) {
24136 if (8 *
sizeof(
unsigned long) > 3 * PyLong_SHIFT) {
24137 __PYX_VERIFY_RETURN_INT(
long,
unsigned long, (((((((
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
24138 }
else if (8 *
sizeof(
long) >= 3 * PyLong_SHIFT) {
24139 return (
long) (((((((long)digits[2]) << PyLong_SHIFT) | (
long)digits[1]) << PyLong_SHIFT) | (long)digits[0]));
24144 if (8 *
sizeof(
long) > 3 * PyLong_SHIFT) {
24145 if (8 *
sizeof(
unsigned long) > 4 * PyLong_SHIFT) {
24146 __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])))
24147 }
else if (8 *
sizeof(
long) >= 4 * PyLong_SHIFT) {
24148 return (
long) (((((((((long)digits[3]) << PyLong_SHIFT) | (
long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (
long)digits[0]));
24154 #if CYTHON_COMPILING_IN_CPYTHON
24155 if (unlikely(Py_SIZE(x) < 0)) {
24156 goto raise_neg_overflow;
24160 int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
24161 if (unlikely(result < 0))
24163 if (unlikely(result == 1))
24164 goto raise_neg_overflow;
24167 if (
sizeof(
long) <=
sizeof(
unsigned long)) {
24168 __PYX_VERIFY_RETURN_INT_EXC(
long,
unsigned long, PyLong_AsUnsignedLong(x))
24169 #ifdef HAVE_LONG_LONG
24170 }
else if (
sizeof(
long) <=
sizeof(
unsigned PY_LONG_LONG)) {
24171 __PYX_VERIFY_RETURN_INT_EXC(
long,
unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
24175 #if CYTHON_USE_PYLONG_INTERNALS
24176 const digit* digits = ((PyLongObject*)x)->ob_digit;
24177 switch (Py_SIZE(x)) {
24178 case 0:
return (
long) 0;
24179 case -1: __PYX_VERIFY_RETURN_INT(
long, sdigit, (sdigit) (-(sdigit)digits[0]))
24180 case 1: __PYX_VERIFY_RETURN_INT(
long, digit, +digits[0])
24182 if (8 *
sizeof(
long) - 1 > 1 * PyLong_SHIFT) {
24183 if (8 *
sizeof(
unsigned long) > 2 * PyLong_SHIFT) {
24184 __PYX_VERIFY_RETURN_INT(
long,
long, -(
long) (((((
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
24185 }
else if (8 *
sizeof(
long) - 1 > 2 * PyLong_SHIFT) {
24186 return (
long) (((long)-1)*(((((long)digits[1]) << PyLong_SHIFT) | (
long)digits[0])));
24191 if (8 *
sizeof(
long) > 1 * PyLong_SHIFT) {
24192 if (8 *
sizeof(
unsigned long) > 2 * PyLong_SHIFT) {
24193 __PYX_VERIFY_RETURN_INT(
long,
unsigned long, (((((
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
24194 }
else if (8 *
sizeof(
long) - 1 > 2 * PyLong_SHIFT) {
24195 return (
long) ((((((long)digits[1]) << PyLong_SHIFT) | (
long)digits[0])));
24200 if (8 *
sizeof(
long) - 1 > 2 * PyLong_SHIFT) {
24201 if (8 *
sizeof(
unsigned long) > 3 * PyLong_SHIFT) {
24202 __PYX_VERIFY_RETURN_INT(
long,
long, -(
long) (((((((
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
24203 }
else if (8 *
sizeof(
long) - 1 > 3 * PyLong_SHIFT) {
24204 return (
long) (((long)-1)*(((((((long)digits[2]) << PyLong_SHIFT) | (
long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
24209 if (8 *
sizeof(
long) > 2 * PyLong_SHIFT) {
24210 if (8 *
sizeof(
unsigned long) > 3 * PyLong_SHIFT) {
24211 __PYX_VERIFY_RETURN_INT(
long,
unsigned long, (((((((
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
24212 }
else if (8 *
sizeof(
long) - 1 > 3 * PyLong_SHIFT) {
24213 return (
long) ((((((((long)digits[2]) << PyLong_SHIFT) | (
long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
24218 if (8 *
sizeof(
long) - 1 > 3 * PyLong_SHIFT) {
24219 if (8 *
sizeof(
unsigned long) > 4 * PyLong_SHIFT) {
24220 __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])))
24221 }
else if (8 *
sizeof(
long) - 1 > 4 * PyLong_SHIFT) {
24222 return (
long) (((long)-1)*(((((((((long)digits[3]) << PyLong_SHIFT) | (
long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (
long)digits[0])));
24227 if (8 *
sizeof(
long) > 3 * PyLong_SHIFT) {
24228 if (8 *
sizeof(
unsigned long) > 4 * PyLong_SHIFT) {
24229 __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])))
24230 }
else if (8 *
sizeof(
long) - 1 > 4 * PyLong_SHIFT) {
24231 return (
long) ((((((((((long)digits[3]) << PyLong_SHIFT) | (
long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (
long)digits[0])));
24237 if (
sizeof(
long) <=
sizeof(long)) {
24238 __PYX_VERIFY_RETURN_INT_EXC(
long,
long, PyLong_AsLong(x))
24239 #ifdef HAVE_LONG_LONG
24240 }
else if (
sizeof(
long) <=
sizeof(PY_LONG_LONG)) {
24241 __PYX_VERIFY_RETURN_INT_EXC(
long, PY_LONG_LONG, PyLong_AsLongLong(x))
24246 #if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray)
24247 PyErr_SetString(PyExc_RuntimeError,
24248 "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers");
24251 PyObject *
v = __Pyx_PyNumber_IntOrLong(x);
24252 #if PY_MAJOR_VERSION < 3
24253 if (likely(
v) && !PyLong_Check(
v)) {
24255 v = PyNumber_Long(tmp);
24260 int one = 1;
int is_little = (int)*(
unsigned char *)&one;
24261 unsigned char *bytes = (
unsigned char *)&val;
24262 int ret = _PyLong_AsByteArray((PyLongObject *)
v,
24263 bytes,
sizeof(val),
24264 is_little, !is_unsigned);
24274 PyObject *tmp = __Pyx_PyNumber_IntOrLong(x);
24275 if (!tmp)
return (
long) -1;
24276 val = __Pyx_PyInt_As_long(tmp);
24281 PyErr_SetString(PyExc_OverflowError,
24282 "value too large to convert to long");
24284 raise_neg_overflow:
24285 PyErr_SetString(PyExc_OverflowError,
24286 "can't convert negative value to long");
24291 static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(
long value) {
24292 #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
24293 #pragma GCC diagnostic push
24294 #pragma GCC diagnostic ignored "-Wconversion"
24296 const long neg_one = (long) -1, const_zero = (
long) 0;
24297 #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
24298 #pragma GCC diagnostic pop
24300 const int is_unsigned = neg_one > const_zero;
24302 if (
sizeof(
long) <
sizeof(long)) {
24303 return PyInt_FromLong((
long) value);
24304 }
else if (
sizeof(
long) <=
sizeof(
unsigned long)) {
24305 return PyLong_FromUnsignedLong((
unsigned long) value);
24306 #ifdef HAVE_LONG_LONG
24307 }
else if (
sizeof(
long) <=
sizeof(
unsigned PY_LONG_LONG)) {
24308 return PyLong_FromUnsignedLongLong((
unsigned PY_LONG_LONG) value);
24312 if (
sizeof(
long) <=
sizeof(
long)) {
24313 return PyInt_FromLong((
long) value);
24314 #ifdef HAVE_LONG_LONG
24315 }
else if (
sizeof(
long) <=
sizeof(PY_LONG_LONG)) {
24316 return PyLong_FromLongLong((PY_LONG_LONG) value);
24321 int one = 1;
int little = (int)*(
unsigned char *)&one;
24322 unsigned char *bytes = (
unsigned char *)&value;
24323 return _PyLong_FromByteArray(bytes,
sizeof(
long),
24324 little, !is_unsigned);
24329 static CYTHON_INLINE
char __Pyx_PyInt_As_char(PyObject *x) {
24330 #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
24331 #pragma GCC diagnostic push
24332 #pragma GCC diagnostic ignored "-Wconversion"
24334 const char neg_one = (char) -1, const_zero = (
char) 0;
24335 #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
24336 #pragma GCC diagnostic pop
24338 const int is_unsigned = neg_one > const_zero;
24339 #if PY_MAJOR_VERSION < 3
24340 if (likely(PyInt_Check(x))) {
24341 if (
sizeof(
char) <
sizeof(long)) {
24342 __PYX_VERIFY_RETURN_INT(
char,
long, PyInt_AS_LONG(x))
24344 long val = PyInt_AS_LONG(x);
24345 if (is_unsigned && unlikely(val < 0)) {
24346 goto raise_neg_overflow;
24352 if (likely(PyLong_Check(x))) {
24354 #if CYTHON_USE_PYLONG_INTERNALS
24355 const digit* digits = ((PyLongObject*)x)->ob_digit;
24356 switch (Py_SIZE(x)) {
24357 case 0:
return (
char) 0;
24358 case 1: __PYX_VERIFY_RETURN_INT(
char, digit, digits[0])
24360 if (8 *
sizeof(
char) > 1 * PyLong_SHIFT) {
24361 if (8 *
sizeof(
unsigned long) > 2 * PyLong_SHIFT) {
24362 __PYX_VERIFY_RETURN_INT(
char,
unsigned long, (((((
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
24363 }
else if (8 *
sizeof(
char) >= 2 * PyLong_SHIFT) {
24364 return (
char) (((((char)digits[1]) << PyLong_SHIFT) | (
char)digits[0]));
24369 if (8 *
sizeof(
char) > 2 * PyLong_SHIFT) {
24370 if (8 *
sizeof(
unsigned long) > 3 * PyLong_SHIFT) {
24371 __PYX_VERIFY_RETURN_INT(
char,
unsigned long, (((((((
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
24372 }
else if (8 *
sizeof(
char) >= 3 * PyLong_SHIFT) {
24373 return (
char) (((((((char)digits[2]) << PyLong_SHIFT) | (
char)digits[1]) << PyLong_SHIFT) | (char)digits[0]));
24378 if (8 *
sizeof(
char) > 3 * PyLong_SHIFT) {
24379 if (8 *
sizeof(
unsigned long) > 4 * PyLong_SHIFT) {
24380 __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])))
24381 }
else if (8 *
sizeof(
char) >= 4 * PyLong_SHIFT) {
24382 return (
char) (((((((((char)digits[3]) << PyLong_SHIFT) | (
char)digits[2]) << PyLong_SHIFT) | (char)digits[1]) << PyLong_SHIFT) | (
char)digits[0]));
24388 #if CYTHON_COMPILING_IN_CPYTHON
24389 if (unlikely(Py_SIZE(x) < 0)) {
24390 goto raise_neg_overflow;
24394 int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
24395 if (unlikely(result < 0))
24397 if (unlikely(result == 1))
24398 goto raise_neg_overflow;
24401 if (
sizeof(
char) <=
sizeof(
unsigned long)) {
24402 __PYX_VERIFY_RETURN_INT_EXC(
char,
unsigned long, PyLong_AsUnsignedLong(x))
24403 #ifdef HAVE_LONG_LONG
24404 }
else if (
sizeof(
char) <=
sizeof(
unsigned PY_LONG_LONG)) {
24405 __PYX_VERIFY_RETURN_INT_EXC(
char,
unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
24409 #if CYTHON_USE_PYLONG_INTERNALS
24410 const digit* digits = ((PyLongObject*)x)->ob_digit;
24411 switch (Py_SIZE(x)) {
24412 case 0:
return (
char) 0;
24413 case -1: __PYX_VERIFY_RETURN_INT(
char, sdigit, (sdigit) (-(sdigit)digits[0]))
24414 case 1: __PYX_VERIFY_RETURN_INT(
char, digit, +digits[0])
24416 if (8 *
sizeof(
char) - 1 > 1 * PyLong_SHIFT) {
24417 if (8 *
sizeof(
unsigned long) > 2 * PyLong_SHIFT) {
24418 __PYX_VERIFY_RETURN_INT(
char,
long, -(
long) (((((
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
24419 }
else if (8 *
sizeof(
char) - 1 > 2 * PyLong_SHIFT) {
24420 return (
char) (((char)-1)*(((((char)digits[1]) << PyLong_SHIFT) | (
char)digits[0])));
24425 if (8 *
sizeof(
char) > 1 * PyLong_SHIFT) {
24426 if (8 *
sizeof(
unsigned long) > 2 * PyLong_SHIFT) {
24427 __PYX_VERIFY_RETURN_INT(
char,
unsigned long, (((((
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
24428 }
else if (8 *
sizeof(
char) - 1 > 2 * PyLong_SHIFT) {
24429 return (
char) ((((((char)digits[1]) << PyLong_SHIFT) | (
char)digits[0])));
24434 if (8 *
sizeof(
char) - 1 > 2 * PyLong_SHIFT) {
24435 if (8 *
sizeof(
unsigned long) > 3 * PyLong_SHIFT) {
24436 __PYX_VERIFY_RETURN_INT(
char,
long, -(
long) (((((((
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
24437 }
else if (8 *
sizeof(
char) - 1 > 3 * PyLong_SHIFT) {
24438 return (
char) (((char)-1)*(((((((char)digits[2]) << PyLong_SHIFT) | (
char)digits[1]) << PyLong_SHIFT) | (char)digits[0])));
24443 if (8 *
sizeof(
char) > 2 * PyLong_SHIFT) {
24444 if (8 *
sizeof(
unsigned long) > 3 * PyLong_SHIFT) {
24445 __PYX_VERIFY_RETURN_INT(
char,
unsigned long, (((((((
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
24446 }
else if (8 *
sizeof(
char) - 1 > 3 * PyLong_SHIFT) {
24447 return (
char) ((((((((char)digits[2]) << PyLong_SHIFT) | (
char)digits[1]) << PyLong_SHIFT) | (char)digits[0])));
24452 if (8 *
sizeof(
char) - 1 > 3 * PyLong_SHIFT) {
24453 if (8 *
sizeof(
unsigned long) > 4 * PyLong_SHIFT) {
24454 __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])))
24455 }
else if (8 *
sizeof(
char) - 1 > 4 * PyLong_SHIFT) {
24456 return (
char) (((char)-1)*(((((((((char)digits[3]) << PyLong_SHIFT) | (
char)digits[2]) << PyLong_SHIFT) | (char)digits[1]) << PyLong_SHIFT) | (
char)digits[0])));
24461 if (8 *
sizeof(
char) > 3 * PyLong_SHIFT) {
24462 if (8 *
sizeof(
unsigned long) > 4 * PyLong_SHIFT) {
24463 __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])))
24464 }
else if (8 *
sizeof(
char) - 1 > 4 * PyLong_SHIFT) {
24465 return (
char) ((((((((((char)digits[3]) << PyLong_SHIFT) | (
char)digits[2]) << PyLong_SHIFT) | (char)digits[1]) << PyLong_SHIFT) | (
char)digits[0])));
24471 if (
sizeof(
char) <=
sizeof(long)) {
24472 __PYX_VERIFY_RETURN_INT_EXC(
char,
long, PyLong_AsLong(x))
24473 #ifdef HAVE_LONG_LONG
24474 }
else if (
sizeof(
char) <=
sizeof(PY_LONG_LONG)) {
24475 __PYX_VERIFY_RETURN_INT_EXC(
char, PY_LONG_LONG, PyLong_AsLongLong(x))
24480 #if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray)
24481 PyErr_SetString(PyExc_RuntimeError,
24482 "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers");
24485 PyObject *
v = __Pyx_PyNumber_IntOrLong(x);
24486 #if PY_MAJOR_VERSION < 3
24487 if (likely(
v) && !PyLong_Check(
v)) {
24489 v = PyNumber_Long(tmp);
24494 int one = 1;
int is_little = (int)*(
unsigned char *)&one;
24495 unsigned char *bytes = (
unsigned char *)&val;
24496 int ret = _PyLong_AsByteArray((PyLongObject *)
v,
24497 bytes,
sizeof(val),
24498 is_little, !is_unsigned);
24508 PyObject *tmp = __Pyx_PyNumber_IntOrLong(x);
24509 if (!tmp)
return (
char) -1;
24510 val = __Pyx_PyInt_As_char(tmp);
24515 PyErr_SetString(PyExc_OverflowError,
24516 "value too large to convert to char");
24518 raise_neg_overflow:
24519 PyErr_SetString(PyExc_OverflowError,
24520 "can't convert negative value to char");
24525 static int __Pyx_check_binary_version(
void) {
24527 int same=1, i, found_dot;
24528 const char* rt_from_call = Py_GetVersion();
24529 PyOS_snprintf(ctversion, 5,
"%d.%d", PY_MAJOR_VERSION, PY_MINOR_VERSION);
24531 for (i = 0; i < 4; i++) {
24532 if (!ctversion[i]) {
24533 same = (rt_from_call[i] <
'0' || rt_from_call[i] >
'9');
24536 if (rt_from_call[i] != ctversion[i]) {
24542 char rtversion[5] = {
'\0'};
24544 for (i=0; i<4; ++i) {
24545 if (rt_from_call[i] ==
'.') {
24546 if (found_dot)
break;
24548 }
else if (rt_from_call[i] <
'0' || rt_from_call[i] >
'9') {
24551 rtversion[i] = rt_from_call[i];
24553 PyOS_snprintf(message,
sizeof(message),
24554 "compiletime version %s of module '%.100s' "
24555 "does not match runtime version %s",
24556 ctversion, __Pyx_MODULE_NAME, rtversion);
24557 return PyErr_WarnEx(NULL, message, 1);
24563 static int __Pyx_InitStrings(__Pyx_StringTabEntry *t) {
24565 #if PY_MAJOR_VERSION < 3
24566 if (t->is_unicode) {
24567 *t->p = PyUnicode_DecodeUTF8(t->s, t->n - 1, NULL);
24568 }
else if (t->intern) {
24569 *t->p = PyString_InternFromString(t->s);
24571 *t->p = PyString_FromStringAndSize(t->s, t->n - 1);
24574 if (t->is_unicode | t->is_str) {
24576 *t->p = PyUnicode_InternFromString(t->s);
24577 }
else if (t->encoding) {
24578 *t->p = PyUnicode_Decode(t->s, t->n - 1, t->encoding, NULL);
24580 *t->p = PyUnicode_FromStringAndSize(t->s, t->n - 1);
24583 *t->p = PyBytes_FromStringAndSize(t->s, t->n - 1);
24588 if (PyObject_Hash(*t->p) == -1)
24595 static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(
const char* c_str) {
24596 return __Pyx_PyUnicode_FromStringAndSize(c_str, (Py_ssize_t)strlen(c_str));
24598 static CYTHON_INLINE
const char* __Pyx_PyObject_AsString(PyObject* o) {
24600 return __Pyx_PyObject_AsStringAndSize(o, &ignore);
24602 #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT
24603 #if !CYTHON_PEP393_ENABLED
24604 static const char* __Pyx_PyUnicode_AsStringAndSize(PyObject* o, Py_ssize_t *length) {
24606 PyObject* defenc = _PyUnicode_AsDefaultEncodedString(o, NULL);
24607 if (!defenc)
return NULL;
24608 defenc_c = PyBytes_AS_STRING(defenc);
24609 #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
24611 char* end = defenc_c + PyBytes_GET_SIZE(defenc);
24613 for (
c = defenc_c;
c < end;
c++) {
24614 if ((
unsigned char) (*
c) >= 128) {
24615 PyUnicode_AsASCIIString(o);
24621 *length = PyBytes_GET_SIZE(defenc);
24625 static CYTHON_INLINE
const char* __Pyx_PyUnicode_AsStringAndSize(PyObject* o, Py_ssize_t *length) {
24626 if (unlikely(__Pyx_PyUnicode_READY(o) == -1))
return NULL;
24627 #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
24628 if (likely(PyUnicode_IS_ASCII(o))) {
24629 *length = PyUnicode_GET_LENGTH(o);
24630 return PyUnicode_AsUTF8(o);
24632 PyUnicode_AsASCIIString(o);
24636 return PyUnicode_AsUTF8AndSize(o, length);
24641 static CYTHON_INLINE
const char* __Pyx_PyObject_AsStringAndSize(PyObject* o, Py_ssize_t *length) {
24642 #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT
24644 #
if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
24645 __Pyx_sys_getdefaultencoding_not_ascii &&
24647 PyUnicode_Check(o)) {
24648 return __Pyx_PyUnicode_AsStringAndSize(o, length);
24651 #if (!CYTHON_COMPILING_IN_PYPY) || (defined(PyByteArray_AS_STRING) && defined(PyByteArray_GET_SIZE))
24652 if (PyByteArray_Check(o)) {
24653 *length = PyByteArray_GET_SIZE(o);
24654 return PyByteArray_AS_STRING(o);
24659 int r = PyBytes_AsStringAndSize(o, &result, length);
24660 if (unlikely(
r < 0)) {
24667 static CYTHON_INLINE
int __Pyx_PyObject_IsTrue(PyObject* x) {
24668 int is_true = x == Py_True;
24669 if (is_true | (x == Py_False) | (x == Py_None))
return is_true;
24670 else return PyObject_IsTrue(x);
24672 static CYTHON_INLINE
int __Pyx_PyObject_IsTrueAndDecref(PyObject* x) {
24674 if (unlikely(!x))
return -1;
24675 retval = __Pyx_PyObject_IsTrue(x);
24679 static PyObject* __Pyx_PyNumber_IntOrLongWrongResultType(PyObject* result,
const char* type_name) {
24680 #if PY_MAJOR_VERSION >= 3
24681 if (PyLong_Check(result)) {
24682 if (PyErr_WarnFormat(PyExc_DeprecationWarning, 1,
24683 "__int__ returned non-int (type %.200s). "
24684 "The ability to return an instance of a strict subclass of int "
24685 "is deprecated, and may be removed in a future version of Python.",
24686 Py_TYPE(result)->tp_name)) {
24693 PyErr_Format(PyExc_TypeError,
24694 "__%.4s__ returned non-%.4s (type %.200s)",
24695 type_name, type_name, Py_TYPE(result)->tp_name);
24699 static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x) {
24700 #if CYTHON_USE_TYPE_SLOTS
24701 PyNumberMethods *m;
24703 const char *name = NULL;
24704 PyObject *res = NULL;
24705 #if PY_MAJOR_VERSION < 3
24706 if (likely(PyInt_Check(x) || PyLong_Check(x)))
24708 if (likely(PyLong_Check(x)))
24710 return __Pyx_NewRef(x);
24711 #if CYTHON_USE_TYPE_SLOTS
24712 m = Py_TYPE(x)->tp_as_number;
24713 #if PY_MAJOR_VERSION < 3
24714 if (m && m->nb_int) {
24716 res = m->nb_int(x);
24718 else if (m && m->nb_long) {
24720 res = m->nb_long(x);
24723 if (likely(m && m->nb_int)) {
24725 res = m->nb_int(x);
24729 if (!PyBytes_CheckExact(x) && !PyUnicode_CheckExact(x)) {
24730 res = PyNumber_Int(x);
24734 #if PY_MAJOR_VERSION < 3
24735 if (unlikely(!PyInt_Check(res) && !PyLong_Check(res))) {
24737 if (unlikely(!PyLong_CheckExact(res))) {
24739 return __Pyx_PyNumber_IntOrLongWrongResultType(res, name);
24742 else if (!PyErr_Occurred()) {
24743 PyErr_SetString(PyExc_TypeError,
24744 "an integer is required");
24748 static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject* b) {
24751 #if PY_MAJOR_VERSION < 3
24752 if (likely(PyInt_CheckExact(b))) {
24753 if (
sizeof(Py_ssize_t) >=
sizeof(
long))
24754 return PyInt_AS_LONG(b);
24756 return PyInt_AsSsize_t(b);
24759 if (likely(PyLong_CheckExact(b))) {
24760 #if CYTHON_USE_PYLONG_INTERNALS
24761 const digit* digits = ((PyLongObject*)b)->ob_digit;
24762 const Py_ssize_t size = Py_SIZE(b);
24763 if (likely(__Pyx_sst_abs(size) <= 1)) {
24764 ival = likely(size) ? digits[0] : 0;
24765 if (size == -1) ival = -ival;
24770 if (8 *
sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) {
24771 return (Py_ssize_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (
size_t)digits[0]));
24775 if (8 *
sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) {
24776 return -(Py_ssize_t) (((((
size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
24780 if (8 *
sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) {
24781 return (Py_ssize_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (
size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
24785 if (8 *
sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) {
24786 return -(Py_ssize_t) (((((((
size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (
size_t)digits[0]));
24790 if (8 *
sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) {
24791 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]));
24795 if (8 *
sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) {
24796 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]));
24802 return PyLong_AsSsize_t(b);
24804 x = PyNumber_Index(b);
24806 ival = PyInt_AsSsize_t(x);
24810 static CYTHON_INLINE Py_hash_t __Pyx_PyIndex_AsHash_t(PyObject* o) {
24811 if (
sizeof(Py_hash_t) ==
sizeof(Py_ssize_t)) {
24812 return (Py_hash_t) __Pyx_PyIndex_AsSsize_t(o);
24813 #if PY_MAJOR_VERSION < 3
24814 }
else if (likely(PyInt_CheckExact(o))) {
24815 return PyInt_AS_LONG(o);
24820 x = PyNumber_Index(o);
24822 ival = PyInt_AsLong(x);
24827 static CYTHON_INLINE PyObject * __Pyx_PyBool_FromLong(
long b) {
24828 return b ? __Pyx_NewRef(Py_True) : __Pyx_NewRef(Py_False);
24830 static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(
size_t ival) {
24831 return PyInt_FromSize_t(ival);