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__BoundaryConditions
708 #define __PYX_HAVE_API__BoundaryConditions
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 "pythread.h"
727 #if defined(PYREX_WITHOUT_ASSERTIONS) && !defined(CYTHON_WITHOUT_ASSERTIONS)
728 #define CYTHON_WITHOUT_ASSERTIONS
731 typedef struct {PyObject **p;
const char *
s;
const Py_ssize_t
n;
const char* encoding;
732 const char is_unicode;
const char is_str;
const char intern; } __Pyx_StringTabEntry;
734 #define __PYX_DEFAULT_STRING_ENCODING_IS_ASCII 0
735 #define __PYX_DEFAULT_STRING_ENCODING_IS_UTF8 0
736 #define __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT (PY_MAJOR_VERSION >= 3 && __PYX_DEFAULT_STRING_ENCODING_IS_UTF8)
737 #define __PYX_DEFAULT_STRING_ENCODING ""
738 #define __Pyx_PyObject_FromString __Pyx_PyBytes_FromString
739 #define __Pyx_PyObject_FromStringAndSize __Pyx_PyBytes_FromStringAndSize
740 #define __Pyx_uchar_cast(c) ((unsigned char)c)
741 #define __Pyx_long_cast(x) ((long)x)
742 #define __Pyx_fits_Py_ssize_t(v, type, is_signed) (\
743 (sizeof(type) < sizeof(Py_ssize_t)) ||\
744 (sizeof(type) > sizeof(Py_ssize_t) &&\
745 likely(v < (type)PY_SSIZE_T_MAX ||\
746 v == (type)PY_SSIZE_T_MAX) &&\
747 (!is_signed || likely(v > (type)PY_SSIZE_T_MIN ||\
748 v == (type)PY_SSIZE_T_MIN))) ||\
749 (sizeof(type) == sizeof(Py_ssize_t) &&\
750 (is_signed || likely(v < (type)PY_SSIZE_T_MAX ||\
751 v == (type)PY_SSIZE_T_MAX))) )
752 static CYTHON_INLINE
int __Pyx_is_valid_index(Py_ssize_t i, Py_ssize_t limit) {
753 return (
size_t) i < (size_t) limit;
755 #if defined (__cplusplus) && __cplusplus >= 201103L
757 #define __Pyx_sst_abs(value) std::abs(value)
758 #elif SIZEOF_INT >= SIZEOF_SIZE_T
759 #define __Pyx_sst_abs(value) abs(value)
760 #elif SIZEOF_LONG >= SIZEOF_SIZE_T
761 #define __Pyx_sst_abs(value) labs(value)
762 #elif defined (_MSC_VER)
763 #define __Pyx_sst_abs(value) ((Py_ssize_t)_abs64(value))
764 #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
765 #define __Pyx_sst_abs(value) llabs(value)
766 #elif defined (__GNUC__)
767 #define __Pyx_sst_abs(value) __builtin_llabs(value)
769 #define __Pyx_sst_abs(value) ((value<0) ? -value : value)
771 static CYTHON_INLINE
const char* __Pyx_PyObject_AsString(PyObject*);
772 static CYTHON_INLINE
const char* __Pyx_PyObject_AsStringAndSize(PyObject*, Py_ssize_t* length);
773 #define __Pyx_PyByteArray_FromString(s) PyByteArray_FromStringAndSize((const char*)s, strlen((const char*)s))
774 #define __Pyx_PyByteArray_FromStringAndSize(s, l) PyByteArray_FromStringAndSize((const char*)s, l)
775 #define __Pyx_PyBytes_FromString PyBytes_FromString
776 #define __Pyx_PyBytes_FromStringAndSize PyBytes_FromStringAndSize
777 static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(
const char*);
778 #if PY_MAJOR_VERSION < 3
779 #define __Pyx_PyStr_FromString __Pyx_PyBytes_FromString
780 #define __Pyx_PyStr_FromStringAndSize __Pyx_PyBytes_FromStringAndSize
782 #define __Pyx_PyStr_FromString __Pyx_PyUnicode_FromString
783 #define __Pyx_PyStr_FromStringAndSize __Pyx_PyUnicode_FromStringAndSize
785 #define __Pyx_PyBytes_AsWritableString(s) ((char*) PyBytes_AS_STRING(s))
786 #define __Pyx_PyBytes_AsWritableSString(s) ((signed char*) PyBytes_AS_STRING(s))
787 #define __Pyx_PyBytes_AsWritableUString(s) ((unsigned char*) PyBytes_AS_STRING(s))
788 #define __Pyx_PyBytes_AsString(s) ((const char*) PyBytes_AS_STRING(s))
789 #define __Pyx_PyBytes_AsSString(s) ((const signed char*) PyBytes_AS_STRING(s))
790 #define __Pyx_PyBytes_AsUString(s) ((const unsigned char*) PyBytes_AS_STRING(s))
791 #define __Pyx_PyObject_AsWritableString(s) ((char*) __Pyx_PyObject_AsString(s))
792 #define __Pyx_PyObject_AsWritableSString(s) ((signed char*) __Pyx_PyObject_AsString(s))
793 #define __Pyx_PyObject_AsWritableUString(s) ((unsigned char*) __Pyx_PyObject_AsString(s))
794 #define __Pyx_PyObject_AsSString(s) ((const signed char*) __Pyx_PyObject_AsString(s))
795 #define __Pyx_PyObject_AsUString(s) ((const unsigned char*) __Pyx_PyObject_AsString(s))
796 #define __Pyx_PyObject_FromCString(s) __Pyx_PyObject_FromString((const char*)s)
797 #define __Pyx_PyBytes_FromCString(s) __Pyx_PyBytes_FromString((const char*)s)
798 #define __Pyx_PyByteArray_FromCString(s) __Pyx_PyByteArray_FromString((const char*)s)
799 #define __Pyx_PyStr_FromCString(s) __Pyx_PyStr_FromString((const char*)s)
800 #define __Pyx_PyUnicode_FromCString(s) __Pyx_PyUnicode_FromString((const char*)s)
801 static CYTHON_INLINE
size_t __Pyx_Py_UNICODE_strlen(
const Py_UNICODE *
u) {
802 const Py_UNICODE *u_end =
u;
804 return (
size_t)(u_end -
u - 1);
806 #define __Pyx_PyUnicode_FromUnicode(u) PyUnicode_FromUnicode(u, __Pyx_Py_UNICODE_strlen(u))
807 #define __Pyx_PyUnicode_FromUnicodeAndLength PyUnicode_FromUnicode
808 #define __Pyx_PyUnicode_AsUnicode PyUnicode_AsUnicode
809 #define __Pyx_NewRef(obj) (Py_INCREF(obj), obj)
810 #define __Pyx_Owned_Py_None(b) __Pyx_NewRef(Py_None)
811 static CYTHON_INLINE PyObject * __Pyx_PyBool_FromLong(
long b);
812 static CYTHON_INLINE
int __Pyx_PyObject_IsTrue(PyObject*);
813 static CYTHON_INLINE
int __Pyx_PyObject_IsTrueAndDecref(PyObject*);
814 static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x);
815 #define __Pyx_PySequence_Tuple(obj)\
816 (likely(PyTuple_CheckExact(obj)) ? __Pyx_NewRef(obj) : PySequence_Tuple(obj))
817 static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject*);
818 static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(
size_t);
819 static CYTHON_INLINE Py_hash_t __Pyx_PyIndex_AsHash_t(PyObject*);
820 #if CYTHON_ASSUME_SAFE_MACROS
821 #define __pyx_PyFloat_AsDouble(x) (PyFloat_CheckExact(x) ? PyFloat_AS_DOUBLE(x) : PyFloat_AsDouble(x))
823 #define __pyx_PyFloat_AsDouble(x) PyFloat_AsDouble(x)
825 #define __pyx_PyFloat_AsFloat(x) ((float) __pyx_PyFloat_AsDouble(x))
826 #if PY_MAJOR_VERSION >= 3
827 #define __Pyx_PyNumber_Int(x) (PyLong_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Long(x))
829 #define __Pyx_PyNumber_Int(x) (PyInt_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Int(x))
831 #define __Pyx_PyNumber_Float(x) (PyFloat_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Float(x))
832 #if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
833 static int __Pyx_sys_getdefaultencoding_not_ascii;
834 static int __Pyx_init_sys_getdefaultencoding_params(
void) {
836 PyObject* default_encoding = NULL;
837 PyObject* ascii_chars_u = NULL;
838 PyObject* ascii_chars_b = NULL;
839 const char* default_encoding_c;
840 sys = PyImport_ImportModule(
"sys");
842 default_encoding = PyObject_CallMethod(sys, (
char*)
"getdefaultencoding", NULL);
844 if (!default_encoding)
goto bad;
845 default_encoding_c = PyBytes_AsString(default_encoding);
846 if (!default_encoding_c)
goto bad;
847 if (strcmp(default_encoding_c,
"ascii") == 0) {
848 __Pyx_sys_getdefaultencoding_not_ascii = 0;
850 char ascii_chars[128];
852 for (
c = 0;
c < 128;
c++) {
855 __Pyx_sys_getdefaultencoding_not_ascii = 1;
856 ascii_chars_u = PyUnicode_DecodeASCII(ascii_chars, 128, NULL);
857 if (!ascii_chars_u)
goto bad;
858 ascii_chars_b = PyUnicode_AsEncodedString(ascii_chars_u, default_encoding_c, NULL);
859 if (!ascii_chars_b || !PyBytes_Check(ascii_chars_b) || memcmp(ascii_chars, PyBytes_AS_STRING(ascii_chars_b), 128) != 0) {
862 "This module compiled with c_string_encoding=ascii, but default encoding '%.200s' is not a superset of ascii.",
866 Py_DECREF(ascii_chars_u);
867 Py_DECREF(ascii_chars_b);
869 Py_DECREF(default_encoding);
872 Py_XDECREF(default_encoding);
873 Py_XDECREF(ascii_chars_u);
874 Py_XDECREF(ascii_chars_b);
878 #if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT && PY_MAJOR_VERSION >= 3
879 #define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_DecodeUTF8(c_str, size, NULL)
881 #define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_Decode(c_str, size, __PYX_DEFAULT_STRING_ENCODING, NULL)
882 #if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT
883 static char* __PYX_DEFAULT_STRING_ENCODING;
884 static int __Pyx_init_sys_getdefaultencoding_params(
void) {
886 PyObject* default_encoding = NULL;
887 char* default_encoding_c;
888 sys = PyImport_ImportModule(
"sys");
890 default_encoding = PyObject_CallMethod(sys, (
char*) (
const char*)
"getdefaultencoding", NULL);
892 if (!default_encoding)
goto bad;
893 default_encoding_c = PyBytes_AsString(default_encoding);
894 if (!default_encoding_c)
goto bad;
895 __PYX_DEFAULT_STRING_ENCODING = (
char*) malloc(strlen(default_encoding_c) + 1);
896 if (!__PYX_DEFAULT_STRING_ENCODING)
goto bad;
897 strcpy(__PYX_DEFAULT_STRING_ENCODING, default_encoding_c);
898 Py_DECREF(default_encoding);
901 Py_XDECREF(default_encoding);
909 #if defined(__GNUC__) && (__GNUC__ > 2 || (__GNUC__ == 2 && (__GNUC_MINOR__ > 95)))
910 #define likely(x) __builtin_expect(!!(x), 1)
911 #define unlikely(x) __builtin_expect(!!(x), 0)
913 #define likely(x) (x)
914 #define unlikely(x) (x)
916 static CYTHON_INLINE
void __Pyx_pretend_to_initialize(
void* ptr) { (void)ptr; }
918 static PyObject *__pyx_m = NULL;
919 static PyObject *__pyx_d;
920 static PyObject *__pyx_b;
921 static PyObject *__pyx_cython_runtime = NULL;
922 static PyObject *__pyx_empty_tuple;
923 static PyObject *__pyx_empty_bytes;
924 static PyObject *__pyx_empty_unicode;
925 static int __pyx_lineno;
926 static int __pyx_clineno = 0;
927 static const char * __pyx_cfilenm= __FILE__;
928 static const char *__pyx_filename;
931 #if !defined(CYTHON_CCOMPLEX)
932 #if defined(__cplusplus)
933 #define CYTHON_CCOMPLEX 1
934 #elif defined(_Complex_I)
935 #define CYTHON_CCOMPLEX 1
937 #define CYTHON_CCOMPLEX 0
947 #if CYTHON_CCOMPLEX && !defined(__cplusplus) && defined(__sun__) && defined(__GNUC__)
949 #define _Complex_I 1.0fj
953 static const char *__pyx_f[] = {
954 "proteus/BoundaryConditions.py",
956 "proteus/BoundaryConditions.pxd",
961 struct __pyx_memoryview_obj;
963 struct __pyx_memoryview_obj *memview;
966 Py_ssize_t strides[8];
967 Py_ssize_t suboffsets[8];
968 } __Pyx_memviewslice;
969 #define __Pyx_MemoryView_Len(m) (m.shape[0])
972 #include <pythread.h>
973 #ifndef CYTHON_ATOMICS
974 #define CYTHON_ATOMICS 1
976 #define __pyx_atomic_int_type int
977 #if CYTHON_ATOMICS && __GNUC__ >= 4 && (__GNUC_MINOR__ > 1 ||\
978 (__GNUC_MINOR__ == 1 && __GNUC_PATCHLEVEL >= 2)) &&\
980 #define __pyx_atomic_incr_aligned(value, lock) __sync_fetch_and_add(value, 1)
981 #define __pyx_atomic_decr_aligned(value, lock) __sync_fetch_and_sub(value, 1)
982 #ifdef __PYX_DEBUG_ATOMICS
983 #warning "Using GNU atomics"
985 #elif CYTHON_ATOMICS && defined(_MSC_VER) && 0
987 #undef __pyx_atomic_int_type
988 #define __pyx_atomic_int_type LONG
989 #define __pyx_atomic_incr_aligned(value, lock) InterlockedIncrement(value)
990 #define __pyx_atomic_decr_aligned(value, lock) InterlockedDecrement(value)
991 #ifdef __PYX_DEBUG_ATOMICS
992 #pragma message ("Using MSVC atomics")
994 #elif CYTHON_ATOMICS && (defined(__ICC) || defined(__INTEL_COMPILER)) && 0
995 #define __pyx_atomic_incr_aligned(value, lock) _InterlockedIncrement(value)
996 #define __pyx_atomic_decr_aligned(value, lock) _InterlockedDecrement(value)
997 #ifdef __PYX_DEBUG_ATOMICS
998 #warning "Using Intel atomics"
1001 #undef CYTHON_ATOMICS
1002 #define CYTHON_ATOMICS 0
1003 #ifdef __PYX_DEBUG_ATOMICS
1004 #warning "Not using atomics"
1007 typedef volatile __pyx_atomic_int_type __pyx_atomic_int;
1009 #define __pyx_add_acquisition_count(memview)\
1010 __pyx_atomic_incr_aligned(__pyx_get_slice_count_pointer(memview), memview->lock)
1011 #define __pyx_sub_acquisition_count(memview)\
1012 __pyx_atomic_decr_aligned(__pyx_get_slice_count_pointer(memview), memview->lock)
1014 #define __pyx_add_acquisition_count(memview)\
1015 __pyx_add_acquisition_count_locked(__pyx_get_slice_count_pointer(memview), memview->lock)
1016 #define __pyx_sub_acquisition_count(memview)\
1017 __pyx_sub_acquisition_count_locked(__pyx_get_slice_count_pointer(memview), memview->lock)
1021 #ifndef __PYX_FORCE_INIT_THREADS
1022 #define __PYX_FORCE_INIT_THREADS 0
1026 #define __Pyx_PyGILState_Ensure PyGILState_Ensure
1027 #define __Pyx_PyGILState_Release PyGILState_Release
1028 #define __Pyx_FastGIL_Remember()
1029 #define __Pyx_FastGIL_Forget()
1030 #define __Pyx_FastGilFuncInit()
1033 #define IS_UNSIGNED(type) (((type) -1) > 0)
1034 struct __Pyx_StructField_;
1035 #define __PYX_BUF_FLAGS_PACKED_STRUCT (1 << 0)
1038 struct __Pyx_StructField_* fields;
1040 size_t arraysize[8];
1046 typedef struct __Pyx_StructField_ {
1047 __Pyx_TypeInfo* type;
1050 } __Pyx_StructField;
1052 __Pyx_StructField* field;
1053 size_t parent_offset;
1054 } __Pyx_BufFmt_StackElem;
1056 __Pyx_StructField root;
1057 __Pyx_BufFmt_StackElem* head;
1059 size_t new_count, enc_count;
1060 size_t struct_alignment;
1065 char is_valid_array;
1066 } __Pyx_BufFmt_Context;
1076 typedef npy_int8 __pyx_t_5numpy_int8_t;
1085 typedef npy_int16 __pyx_t_5numpy_int16_t;
1094 typedef npy_int32 __pyx_t_5numpy_int32_t;
1103 typedef npy_int64 __pyx_t_5numpy_int64_t;
1112 typedef npy_uint8 __pyx_t_5numpy_uint8_t;
1121 typedef npy_uint16 __pyx_t_5numpy_uint16_t;
1130 typedef npy_uint32 __pyx_t_5numpy_uint32_t;
1139 typedef npy_uint64 __pyx_t_5numpy_uint64_t;
1148 typedef npy_float32 __pyx_t_5numpy_float32_t;
1157 typedef npy_float64 __pyx_t_5numpy_float64_t;
1166 typedef npy_long __pyx_t_5numpy_int_t;
1175 typedef npy_longlong __pyx_t_5numpy_long_t;
1184 typedef npy_longlong __pyx_t_5numpy_longlong_t;
1193 typedef npy_ulong __pyx_t_5numpy_uint_t;
1202 typedef npy_ulonglong __pyx_t_5numpy_ulong_t;
1211 typedef npy_ulonglong __pyx_t_5numpy_ulonglong_t;
1220 typedef npy_intp __pyx_t_5numpy_intp_t;
1229 typedef npy_uintp __pyx_t_5numpy_uintp_t;
1238 typedef npy_double __pyx_t_5numpy_float_t;
1247 typedef npy_double __pyx_t_5numpy_double_t;
1256 typedef npy_longdouble __pyx_t_5numpy_longdouble_t;
1260 typedef ::std::complex< float > __pyx_t_float_complex;
1262 typedef float _Complex __pyx_t_float_complex;
1265 typedef struct {
float real, imag; } __pyx_t_float_complex;
1267 static CYTHON_INLINE __pyx_t_float_complex __pyx_t_float_complex_from_parts(
float,
float);
1272 typedef ::std::complex< double > __pyx_t_double_complex;
1274 typedef double _Complex __pyx_t_double_complex;
1277 typedef struct {
double real, imag; } __pyx_t_double_complex;
1279 static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(
double,
double);
1283 struct __pyx_obj_18BoundaryConditions_BC_Base;
1284 struct __pyx_obj_18BoundaryConditions_BoundaryCondition;
1285 struct __pyx_obj_18BoundaryConditions___pyx_scope_struct__setConstantBC;
1286 struct __pyx_obj_18BoundaryConditions___pyx_scope_struct_1_setLinearBC;
1287 struct __pyx_obj_18BoundaryConditions___pyx_scope_struct_2_setLinearRamp;
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;
1328 struct __pyx_defaults;
1329 typedef struct __pyx_defaults __pyx_defaults;
1330 struct __pyx_defaults1;
1331 typedef struct __pyx_defaults1 __pyx_defaults1;
1332 struct __pyx_defaults2;
1333 typedef struct __pyx_defaults2 __pyx_defaults2;
1342 typedef double (*__pyx_t_18BoundaryConditions_cpp_uOfXT)(
struct __pyx_obj_18BoundaryConditions_BoundaryCondition *, __Pyx_memviewslice, double);
1343 struct __pyx_defaults {
1344 PyObject *__pyx_arg_n;
1346 struct __pyx_defaults1 {
1347 PyObject *__pyx_arg_n;
1349 struct __pyx_defaults2 {
1350 PyObject *__pyx_arg_n;
1360 struct __pyx_obj_18BoundaryConditions_BC_Base {
1362 __Pyx_memviewslice _b_or;
1378 struct __pyx_obj_18BoundaryConditions_BoundaryCondition {
1380 struct __pyx_vtabstruct_18BoundaryConditions_BoundaryCondition *__pyx_vtab;
1381 __pyx_t_18BoundaryConditions_cpp_uOfXT uuOfXT;
1393 struct __pyx_obj_18BoundaryConditions___pyx_scope_struct__setConstantBC {
1395 PyObject *__pyx_v_value;
1406 struct __pyx_obj_18BoundaryConditions___pyx_scope_struct_1_setLinearBC {
1408 PyObject *__pyx_v_a;
1409 PyObject *__pyx_v_a0;
1420 struct __pyx_obj_18BoundaryConditions___pyx_scope_struct_2_setLinearRamp {
1422 PyObject *__pyx_v_t1;
1423 PyObject *__pyx_v_value;
1434 struct __pyx_array_obj {
1436 struct __pyx_vtabstruct_array *__pyx_vtab;
1442 Py_ssize_t *_strides;
1443 Py_ssize_t itemsize;
1446 void (*callback_free_data)(
void *);
1448 int dtype_is_object;
1459 struct __pyx_MemviewEnum_obj {
1472 struct __pyx_memoryview_obj {
1474 struct __pyx_vtabstruct_memoryview *__pyx_vtab;
1477 PyObject *_array_interface;
1478 PyThread_type_lock lock;
1479 __pyx_atomic_int acquisition_count[2];
1480 __pyx_atomic_int *acquisition_count_aligned_p;
1483 int dtype_is_object;
1484 __Pyx_TypeInfo *typeinfo;
1495 struct __pyx_memoryviewslice_obj {
1496 struct __pyx_memoryview_obj __pyx_base;
1497 __Pyx_memviewslice from_slice;
1498 PyObject *from_object;
1499 PyObject *(*to_object_func)(
char *);
1500 int (*to_dtype_func)(
char *, PyObject *);
1513 struct __pyx_vtabstruct_18BoundaryConditions_BoundaryCondition {
1514 void (*resetBC)(
struct __pyx_obj_18BoundaryConditions_BoundaryCondition *,
int __pyx_skip_dispatch);
1516 static struct __pyx_vtabstruct_18BoundaryConditions_BoundaryCondition *__pyx_vtabptr_18BoundaryConditions_BoundaryCondition;
1527 struct __pyx_vtabstruct_array {
1528 PyObject *(*get_memview)(
struct __pyx_array_obj *);
1530 static struct __pyx_vtabstruct_array *__pyx_vtabptr_array;
1541 struct __pyx_vtabstruct_memoryview {
1542 char *(*get_item_pointer)(
struct __pyx_memoryview_obj *, PyObject *);
1543 PyObject *(*is_slice)(
struct __pyx_memoryview_obj *, PyObject *);
1544 PyObject *(*setitem_slice_assignment)(
struct __pyx_memoryview_obj *, PyObject *, PyObject *);
1545 PyObject *(*setitem_slice_assign_scalar)(
struct __pyx_memoryview_obj *,
struct __pyx_memoryview_obj *, PyObject *);
1546 PyObject *(*setitem_indexed)(
struct __pyx_memoryview_obj *, PyObject *, PyObject *);
1547 PyObject *(*convert_item_to_object)(
struct __pyx_memoryview_obj *,
char *);
1548 PyObject *(*assign_item_from_object)(
struct __pyx_memoryview_obj *,
char *, PyObject *);
1550 static struct __pyx_vtabstruct_memoryview *__pyx_vtabptr_memoryview;
1561 struct __pyx_vtabstruct__memoryviewslice {
1562 struct __pyx_vtabstruct_memoryview __pyx_base;
1564 static struct __pyx_vtabstruct__memoryviewslice *__pyx_vtabptr__memoryviewslice;
1568 #ifndef CYTHON_REFNANNY
1569 #define CYTHON_REFNANNY 0
1573 void (*INCREF)(
void*, PyObject*, int);
1574 void (*DECREF)(
void*, PyObject*, int);
1575 void (*GOTREF)(
void*, PyObject*, int);
1576 void (*GIVEREF)(
void*, PyObject*, int);
1577 void* (*SetupContext)(
const char*, int,
const char*);
1578 void (*FinishContext)(
void**);
1579 } __Pyx_RefNannyAPIStruct;
1580 static __Pyx_RefNannyAPIStruct *__Pyx_RefNanny = NULL;
1581 static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(
const char *modname);
1582 #define __Pyx_RefNannyDeclarations void *__pyx_refnanny = NULL;
1584 #define __Pyx_RefNannySetupContext(name, acquire_gil)\
1586 PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();\
1587 __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__);\
1588 PyGILState_Release(__pyx_gilstate_save);\
1590 __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__);\
1593 #define __Pyx_RefNannySetupContext(name, acquire_gil)\
1594 __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__)
1596 #define __Pyx_RefNannyFinishContext()\
1597 __Pyx_RefNanny->FinishContext(&__pyx_refnanny)
1598 #define __Pyx_INCREF(r) __Pyx_RefNanny->INCREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
1599 #define __Pyx_DECREF(r) __Pyx_RefNanny->DECREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
1600 #define __Pyx_GOTREF(r) __Pyx_RefNanny->GOTREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
1601 #define __Pyx_GIVEREF(r) __Pyx_RefNanny->GIVEREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
1602 #define __Pyx_XINCREF(r) do { if((r) != NULL) {__Pyx_INCREF(r); }} while(0)
1603 #define __Pyx_XDECREF(r) do { if((r) != NULL) {__Pyx_DECREF(r); }} while(0)
1604 #define __Pyx_XGOTREF(r) do { if((r) != NULL) {__Pyx_GOTREF(r); }} while(0)
1605 #define __Pyx_XGIVEREF(r) do { if((r) != NULL) {__Pyx_GIVEREF(r);}} while(0)
1607 #define __Pyx_RefNannyDeclarations
1608 #define __Pyx_RefNannySetupContext(name, acquire_gil)
1609 #define __Pyx_RefNannyFinishContext()
1610 #define __Pyx_INCREF(r) Py_INCREF(r)
1611 #define __Pyx_DECREF(r) Py_DECREF(r)
1612 #define __Pyx_GOTREF(r)
1613 #define __Pyx_GIVEREF(r)
1614 #define __Pyx_XINCREF(r) Py_XINCREF(r)
1615 #define __Pyx_XDECREF(r) Py_XDECREF(r)
1616 #define __Pyx_XGOTREF(r)
1617 #define __Pyx_XGIVEREF(r)
1619 #define __Pyx_XDECREF_SET(r, v) do {\
1620 PyObject *tmp = (PyObject *) r;\
1621 r = v; __Pyx_XDECREF(tmp);\
1623 #define __Pyx_DECREF_SET(r, v) do {\
1624 PyObject *tmp = (PyObject *) r;\
1625 r = v; __Pyx_DECREF(tmp);\
1627 #define __Pyx_CLEAR(r) do { PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);} while(0)
1628 #define __Pyx_XCLEAR(r) do { if((r) != NULL) {PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);}} while(0)
1631 #if CYTHON_USE_TYPE_SLOTS
1632 static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name);
1634 #define __Pyx_PyObject_GetAttrStr(o,n) PyObject_GetAttr(o,n)
1638 static PyObject *__Pyx_GetBuiltinName(PyObject *name);
1641 static void __Pyx_RaiseDoubleKeywordsError(
const char* func_name, PyObject* kw_name);
1644 static int __Pyx_ParseOptionalKeywords(PyObject *kwds, PyObject **argnames[],\
1645 PyObject *kwds2, PyObject *values[], Py_ssize_t num_pos_args,\
1646 const char* function_name);
1649 static void __Pyx_RaiseArgtupleInvalid(
const char* func_name,
int exact,
1650 Py_ssize_t num_min, Py_ssize_t num_max, Py_ssize_t num_found);
1653 #if CYTHON_FAST_THREAD_STATE
1654 #define __Pyx_PyThreadState_declare PyThreadState *__pyx_tstate;
1655 #define __Pyx_PyThreadState_assign __pyx_tstate = __Pyx_PyThreadState_Current;
1656 #define __Pyx_PyErr_Occurred() __pyx_tstate->curexc_type
1658 #define __Pyx_PyThreadState_declare
1659 #define __Pyx_PyThreadState_assign
1660 #define __Pyx_PyErr_Occurred() PyErr_Occurred()
1664 #if CYTHON_FAST_THREAD_STATE
1665 #define __Pyx_PyErr_Clear() __Pyx_ErrRestore(NULL, NULL, NULL)
1666 #define __Pyx_ErrRestoreWithState(type, value, tb) __Pyx_ErrRestoreInState(PyThreadState_GET(), type, value, tb)
1667 #define __Pyx_ErrFetchWithState(type, value, tb) __Pyx_ErrFetchInState(PyThreadState_GET(), type, value, tb)
1668 #define __Pyx_ErrRestore(type, value, tb) __Pyx_ErrRestoreInState(__pyx_tstate, type, value, tb)
1669 #define __Pyx_ErrFetch(type, value, tb) __Pyx_ErrFetchInState(__pyx_tstate, type, value, tb)
1670 static CYTHON_INLINE
void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb);
1671 static CYTHON_INLINE
void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb);
1672 #if CYTHON_COMPILING_IN_CPYTHON
1673 #define __Pyx_PyErr_SetNone(exc) (Py_INCREF(exc), __Pyx_ErrRestore((exc), NULL, NULL))
1675 #define __Pyx_PyErr_SetNone(exc) PyErr_SetNone(exc)
1678 #define __Pyx_PyErr_Clear() PyErr_Clear()
1679 #define __Pyx_PyErr_SetNone(exc) PyErr_SetNone(exc)
1680 #define __Pyx_ErrRestoreWithState(type, value, tb) PyErr_Restore(type, value, tb)
1681 #define __Pyx_ErrFetchWithState(type, value, tb) PyErr_Fetch(type, value, tb)
1682 #define __Pyx_ErrRestoreInState(tstate, type, value, tb) PyErr_Restore(type, value, tb)
1683 #define __Pyx_ErrFetchInState(tstate, type, value, tb) PyErr_Fetch(type, value, tb)
1684 #define __Pyx_ErrRestore(type, value, tb) PyErr_Restore(type, value, tb)
1685 #define __Pyx_ErrFetch(type, value, tb) PyErr_Fetch(type, value, tb)
1689 #ifndef CYTHON_PROFILE
1690 #if CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_PYSTON
1691 #define CYTHON_PROFILE 0
1693 #define CYTHON_PROFILE 1
1696 #ifndef CYTHON_TRACE_NOGIL
1697 #define CYTHON_TRACE_NOGIL 0
1699 #if CYTHON_TRACE_NOGIL && !defined(CYTHON_TRACE)
1700 #define CYTHON_TRACE 1
1703 #ifndef CYTHON_TRACE
1704 #define CYTHON_TRACE 0
1707 #undef CYTHON_PROFILE_REUSE_FRAME
1709 #ifndef CYTHON_PROFILE_REUSE_FRAME
1710 #define CYTHON_PROFILE_REUSE_FRAME 0
1712 #if CYTHON_PROFILE || CYTHON_TRACE
1713 #include "compile.h"
1714 #include "frameobject.h"
1715 #include "traceback.h"
1716 #if PY_VERSION_HEX >= 0x030b00a6
1717 #ifndef Py_BUILD_CORE
1718 #define Py_BUILD_CORE 1
1720 #include "internal/pycore_frame.h"
1722 #if CYTHON_PROFILE_REUSE_FRAME
1723 #define CYTHON_FRAME_MODIFIER static
1724 #define CYTHON_FRAME_DEL(frame)
1726 #define CYTHON_FRAME_MODIFIER
1727 #define CYTHON_FRAME_DEL(frame) Py_CLEAR(frame)
1729 #define __Pyx_TraceDeclarations\
1730 static PyCodeObject *__pyx_frame_code = NULL;\
1731 CYTHON_FRAME_MODIFIER PyFrameObject *__pyx_frame = NULL;\
1732 int __Pyx_use_tracing = 0;
1733 #define __Pyx_TraceFrameInit(codeobj)\
1734 if (codeobj) __pyx_frame_code = (PyCodeObject*) codeobj;
1735 #if PY_VERSION_HEX >= 0x030b00a2
1736 #define __Pyx_IsTracing(tstate, check_tracing, check_funcs)\
1737 (unlikely((tstate)->cframe->use_tracing) &&\
1738 (!(check_tracing) || !(tstate)->tracing) &&\
1739 (!(check_funcs) || (tstate)->c_profilefunc || (CYTHON_TRACE && (tstate)->c_tracefunc)))
1740 #define __Pyx_EnterTracing(tstate) PyThreadState_EnterTracing(tstate)
1741 #define __Pyx_LeaveTracing(tstate) PyThreadState_LeaveTracing(tstate)
1742 #elif PY_VERSION_HEX >= 0x030a00b1
1743 #define __Pyx_IsTracing(tstate, check_tracing, check_funcs)\
1744 (unlikely((tstate)->cframe->use_tracing) &&\
1745 (!(check_tracing) || !(tstate)->tracing) &&\
1746 (!(check_funcs) || (tstate)->c_profilefunc || (CYTHON_TRACE && (tstate)->c_tracefunc)))
1747 #define __Pyx_EnterTracing(tstate)\
1748 do { tstate->tracing++; tstate->cframe->use_tracing = 0; } while (0)
1749 #define __Pyx_LeaveTracing(tstate)\
1752 tstate->cframe->use_tracing = ((CYTHON_TRACE && tstate->c_tracefunc != NULL)\
1753 || tstate->c_profilefunc != NULL);\
1756 #define __Pyx_IsTracing(tstate, check_tracing, check_funcs)\
1757 (unlikely((tstate)->use_tracing) &&\
1758 (!(check_tracing) || !(tstate)->tracing) &&\
1759 (!(check_funcs) || (tstate)->c_profilefunc || (CYTHON_TRACE && (tstate)->c_tracefunc)))
1760 #define __Pyx_EnterTracing(tstate)\
1761 do { tstate->tracing++; tstate->use_tracing = 0; } while (0)
1762 #define __Pyx_LeaveTracing(tstate)\
1765 tstate->use_tracing = ((CYTHON_TRACE && tstate->c_tracefunc != NULL)\
1766 || tstate->c_profilefunc != NULL);\
1770 #define __Pyx_TraceCall(funcname, srcfile, firstlineno, nogil, goto_error)\
1772 if (CYTHON_TRACE_NOGIL) {\
1773 PyThreadState *tstate;\
1774 PyGILState_STATE state = PyGILState_Ensure();\
1775 tstate = __Pyx_PyThreadState_Current;\
1776 if (__Pyx_IsTracing(tstate, 1, 1)) {\
1777 __Pyx_use_tracing = __Pyx_TraceSetupAndCall(&__pyx_frame_code, &__pyx_frame, tstate, funcname, srcfile, firstlineno);\
1779 PyGILState_Release(state);\
1780 if (unlikely(__Pyx_use_tracing < 0)) goto_error;\
1783 PyThreadState* tstate = PyThreadState_GET();\
1784 if (__Pyx_IsTracing(tstate, 1, 1)) {\
1785 __Pyx_use_tracing = __Pyx_TraceSetupAndCall(&__pyx_frame_code, &__pyx_frame, tstate, funcname, srcfile, firstlineno);\
1786 if (unlikely(__Pyx_use_tracing < 0)) goto_error;\
1790 #define __Pyx_TraceCall(funcname, srcfile, firstlineno, nogil, goto_error)\
1791 { PyThreadState* tstate = PyThreadState_GET();\
1792 if (__Pyx_IsTracing(tstate, 1, 1)) {\
1793 __Pyx_use_tracing = __Pyx_TraceSetupAndCall(&__pyx_frame_code, &__pyx_frame, tstate, funcname, srcfile, firstlineno);\
1794 if (unlikely(__Pyx_use_tracing < 0)) goto_error;\
1798 #define __Pyx_TraceException()\
1799 if (likely(!__Pyx_use_tracing)); else {\
1800 PyThreadState* tstate = __Pyx_PyThreadState_Current;\
1801 if (__Pyx_IsTracing(tstate, 0, 1)) {\
1802 __Pyx_EnterTracing(tstate);\
1803 PyObject *exc_info = __Pyx_GetExceptionTuple(tstate);\
1805 if (CYTHON_TRACE && tstate->c_tracefunc)\
1806 tstate->c_tracefunc(\
1807 tstate->c_traceobj, __pyx_frame, PyTrace_EXCEPTION, exc_info);\
1808 tstate->c_profilefunc(\
1809 tstate->c_profileobj, __pyx_frame, PyTrace_EXCEPTION, exc_info);\
1810 Py_DECREF(exc_info);\
1812 __Pyx_LeaveTracing(tstate);\
1815 static void __Pyx_call_return_trace_func(PyThreadState *tstate, PyFrameObject *frame, PyObject *result) {
1816 PyObject *type, *value, *traceback;
1817 __Pyx_ErrFetchInState(tstate, &type, &value, &traceback);
1818 __Pyx_EnterTracing(tstate);
1819 if (CYTHON_TRACE && tstate->c_tracefunc)
1820 tstate->c_tracefunc(tstate->c_traceobj, frame, PyTrace_RETURN, result);
1821 if (tstate->c_profilefunc)
1822 tstate->c_profilefunc(tstate->c_profileobj, frame, PyTrace_RETURN, result);
1823 CYTHON_FRAME_DEL(frame);
1824 __Pyx_LeaveTracing(tstate);
1825 __Pyx_ErrRestoreInState(tstate, type, value, traceback);
1828 #define __Pyx_TraceReturn(result, nogil)\
1829 if (likely(!__Pyx_use_tracing)); else {\
1831 if (CYTHON_TRACE_NOGIL) {\
1832 PyThreadState *tstate;\
1833 PyGILState_STATE state = PyGILState_Ensure();\
1834 tstate = __Pyx_PyThreadState_Current;\
1835 if (__Pyx_IsTracing(tstate, 0, 0)) {\
1836 __Pyx_call_return_trace_func(tstate, __pyx_frame, (PyObject*)result);\
1838 PyGILState_Release(state);\
1841 PyThreadState* tstate = __Pyx_PyThreadState_Current;\
1842 if (__Pyx_IsTracing(tstate, 0, 0)) {\
1843 __Pyx_call_return_trace_func(tstate, __pyx_frame, (PyObject*)result);\
1848 #define __Pyx_TraceReturn(result, nogil)\
1849 if (likely(!__Pyx_use_tracing)); else {\
1850 PyThreadState* tstate = __Pyx_PyThreadState_Current;\
1851 if (__Pyx_IsTracing(tstate, 0, 0)) {\
1852 __Pyx_call_return_trace_func(tstate, __pyx_frame, (PyObject*)result);\
1856 static PyCodeObject *__Pyx_createFrameCodeObject(
const char *funcname,
const char *srcfile,
int firstlineno);
1857 static int __Pyx_TraceSetupAndCall(PyCodeObject** code, PyFrameObject** frame, PyThreadState* tstate,
const char *funcname,
const char *srcfile,
int firstlineno);
1859 #define __Pyx_TraceDeclarations
1860 #define __Pyx_TraceFrameInit(codeobj)
1861 #define __Pyx_TraceCall(funcname, srcfile, firstlineno, nogil, goto_error) if ((1)); else goto_error;
1862 #define __Pyx_TraceException()
1863 #define __Pyx_TraceReturn(result, nogil)
1866 static int __Pyx_call_line_trace_func(PyThreadState *tstate, PyFrameObject *frame,
int lineno) {
1868 PyObject *type, *value, *traceback;
1869 __Pyx_ErrFetchInState(tstate, &type, &value, &traceback);
1870 __Pyx_PyFrame_SetLineNumber(frame, lineno);
1871 __Pyx_EnterTracing(tstate);
1872 ret = tstate->c_tracefunc(tstate->c_traceobj, frame, PyTrace_LINE, NULL);
1873 __Pyx_LeaveTracing(tstate);
1875 __Pyx_ErrRestoreInState(tstate, type, value, traceback);
1879 Py_XDECREF(traceback);
1884 #define __Pyx_TraceLine(lineno, nogil, goto_error)\
1885 if (likely(!__Pyx_use_tracing)); else {\
1887 if (CYTHON_TRACE_NOGIL) {\
1889 PyThreadState *tstate;\
1890 PyGILState_STATE state = PyGILState_Ensure();\
1891 tstate = __Pyx_PyThreadState_Current;\
1892 if (__Pyx_IsTracing(tstate, 0, 0) && tstate->c_tracefunc && __pyx_frame->f_trace) {\
1893 ret = __Pyx_call_line_trace_func(tstate, __pyx_frame, lineno);\
1895 PyGILState_Release(state);\
1896 if (unlikely(ret)) goto_error;\
1899 PyThreadState* tstate = __Pyx_PyThreadState_Current;\
1900 if (__Pyx_IsTracing(tstate, 0, 0) && tstate->c_tracefunc && __pyx_frame->f_trace) {\
1901 int ret = __Pyx_call_line_trace_func(tstate, __pyx_frame, lineno);\
1902 if (unlikely(ret)) goto_error;\
1907 #define __Pyx_TraceLine(lineno, nogil, goto_error)\
1908 if (likely(!__Pyx_use_tracing)); else {\
1909 PyThreadState* tstate = __Pyx_PyThreadState_Current;\
1910 if (__Pyx_IsTracing(tstate, 0, 0) && tstate->c_tracefunc && __pyx_frame->f_trace) {\
1911 int ret = __Pyx_call_line_trace_func(tstate, __pyx_frame, lineno);\
1912 if (unlikely(ret)) goto_error;\
1917 #define __Pyx_TraceLine(lineno, nogil, goto_error) if ((1)); else goto_error;
1921 #define __Pyx_GetItemInt(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\
1922 (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\
1923 __Pyx_GetItemInt_Fast(o, (Py_ssize_t)i, is_list, wraparound, boundscheck) :\
1924 (is_list ? (PyErr_SetString(PyExc_IndexError, "list index out of range"), (PyObject*)NULL) :\
1925 __Pyx_GetItemInt_Generic(o, to_py_func(i))))
1926 #define __Pyx_GetItemInt_List(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\
1927 (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\
1928 __Pyx_GetItemInt_List_Fast(o, (Py_ssize_t)i, wraparound, boundscheck) :\
1929 (PyErr_SetString(PyExc_IndexError, "list index out of range"), (PyObject*)NULL))
1930 static CYTHON_INLINE PyObject *__Pyx_GetItemInt_List_Fast(PyObject *o, Py_ssize_t i,
1931 int wraparound,
int boundscheck);
1932 #define __Pyx_GetItemInt_Tuple(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\
1933 (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\
1934 __Pyx_GetItemInt_Tuple_Fast(o, (Py_ssize_t)i, wraparound, boundscheck) :\
1935 (PyErr_SetString(PyExc_IndexError, "tuple index out of range"), (PyObject*)NULL))
1936 static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize_t i,
1937 int wraparound,
int boundscheck);
1938 static PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j);
1939 static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i,
1940 int is_list,
int wraparound,
int boundscheck);
1943 #if CYTHON_USE_TYPE_SLOTS
1944 static CYTHON_INLINE PyObject *__Pyx_PyObject_GetItem(PyObject *obj, PyObject* key);
1946 #define __Pyx_PyObject_GetItem(obj, key) PyObject_GetItem(obj, key)
1950 #define __Pyx_BUF_MAX_NDIMS %(BUF_MAX_NDIMS)d
1951 #define __Pyx_MEMVIEW_DIRECT 1
1952 #define __Pyx_MEMVIEW_PTR 2
1953 #define __Pyx_MEMVIEW_FULL 4
1954 #define __Pyx_MEMVIEW_CONTIG 8
1955 #define __Pyx_MEMVIEW_STRIDED 16
1956 #define __Pyx_MEMVIEW_FOLLOW 32
1957 #define __Pyx_IS_C_CONTIG 1
1958 #define __Pyx_IS_F_CONTIG 2
1959 static int __Pyx_init_memviewslice(
1960 struct __pyx_memoryview_obj *memview,
1962 __Pyx_memviewslice *memviewslice,
1963 int memview_is_new_reference);
1964 static CYTHON_INLINE
int __pyx_add_acquisition_count_locked(
1965 __pyx_atomic_int *acquisition_count, PyThread_type_lock lock);
1966 static CYTHON_INLINE
int __pyx_sub_acquisition_count_locked(
1967 __pyx_atomic_int *acquisition_count, PyThread_type_lock lock);
1968 #define __pyx_get_slice_count_pointer(memview) (memview->acquisition_count_aligned_p)
1969 #define __pyx_get_slice_count(memview) (*__pyx_get_slice_count_pointer(memview))
1970 #define __PYX_INC_MEMVIEW(slice, have_gil) __Pyx_INC_MEMVIEW(slice, have_gil, __LINE__)
1971 #define __PYX_XDEC_MEMVIEW(slice, have_gil) __Pyx_XDEC_MEMVIEW(slice, have_gil, __LINE__)
1972 static CYTHON_INLINE
void __Pyx_INC_MEMVIEW(__Pyx_memviewslice *,
int,
int);
1973 static CYTHON_INLINE
void __Pyx_XDEC_MEMVIEW(__Pyx_memviewslice *,
int,
int);
1976 static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list,
int level);
1979 static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name);
1982 #if CYTHON_FAST_PYCALL
1983 #define __Pyx_PyFunction_FastCall(func, args, nargs)\
1984 __Pyx_PyFunction_FastCallDict((func), (args), (nargs), NULL)
1985 #if 1 || PY_VERSION_HEX < 0x030600B1
1986 static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args, Py_ssize_t nargs, PyObject *kwargs);
1988 #define __Pyx_PyFunction_FastCallDict(func, args, nargs, kwargs) _PyFunction_FastCallDict(func, args, nargs, kwargs)
1990 #define __Pyx_BUILD_ASSERT_EXPR(cond)\
1991 (sizeof(char [1 - 2*!(cond)]) - 1)
1992 #ifndef Py_MEMBER_SIZE
1993 #define Py_MEMBER_SIZE(type, member) sizeof(((type *)0)->member)
1995 #if CYTHON_FAST_PYCALL
1996 static size_t __pyx_pyframe_localsplus_offset = 0;
1997 #include "frameobject.h"
1998 #if PY_VERSION_HEX >= 0x030b00a6
1999 #ifndef Py_BUILD_CORE
2000 #define Py_BUILD_CORE 1
2002 #include "internal/pycore_frame.h"
2004 #define __Pxy_PyFrame_Initialize_Offsets()\
2005 ((void)__Pyx_BUILD_ASSERT_EXPR(sizeof(PyFrameObject) == offsetof(PyFrameObject, f_localsplus) + Py_MEMBER_SIZE(PyFrameObject, f_localsplus)),\
2006 (void)(__pyx_pyframe_localsplus_offset = ((size_t)PyFrame_Type.tp_basicsize) - Py_MEMBER_SIZE(PyFrameObject, f_localsplus)))
2007 #define __Pyx_PyFrame_GetLocalsplus(frame)\
2008 (assert(__pyx_pyframe_localsplus_offset), (PyObject **)(((char *)(frame)) + __pyx_pyframe_localsplus_offset))
2009 #endif // CYTHON_FAST_PYCALL
2013 #if CYTHON_COMPILING_IN_CPYTHON
2014 static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw);
2016 #define __Pyx_PyObject_Call(func, arg, kw) PyObject_Call(func, arg, kw)
2020 #if CYTHON_COMPILING_IN_CPYTHON
2021 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg);
2025 #if CYTHON_COMPILING_IN_CPYTHON
2026 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallNoArg(PyObject *func);
2028 #define __Pyx_PyObject_CallNoArg(func) __Pyx_PyObject_Call(func, __pyx_empty_tuple, NULL)
2032 #if CYTHON_FAST_PYCCALL
2033 static CYTHON_INLINE PyObject *__Pyx_PyCFunction_FastCall(PyObject *func, PyObject **args, Py_ssize_t nargs);
2035 #define __Pyx_PyCFunction_FastCall(func, args, nargs) (assert(0), NULL)
2039 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg);
2042 #if CYTHON_FAST_THREAD_STATE
2043 #define __Pyx_PyErr_ExceptionMatches(err) __Pyx_PyErr_ExceptionMatchesInState(__pyx_tstate, err)
2044 static CYTHON_INLINE
int __Pyx_PyErr_ExceptionMatchesInState(PyThreadState* tstate, PyObject* err);
2046 #define __Pyx_PyErr_ExceptionMatches(err) PyErr_ExceptionMatches(err)
2050 static CYTHON_INLINE PyObject *__Pyx_GetAttr(PyObject *, PyObject *);
2053 static CYTHON_INLINE PyObject *__Pyx_GetAttr3(PyObject *, PyObject *, PyObject *);
2056 #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_TYPE_SLOTS
2057 #define __PYX_DICT_VERSION_INIT ((PY_UINT64_T) -1)
2058 #define __PYX_GET_DICT_VERSION(dict) (((PyDictObject*)(dict))->ma_version_tag)
2059 #define __PYX_UPDATE_DICT_CACHE(dict, value, cache_var, version_var)\
2060 (version_var) = __PYX_GET_DICT_VERSION(dict);\
2061 (cache_var) = (value);
2062 #define __PYX_PY_DICT_LOOKUP_IF_MODIFIED(VAR, DICT, LOOKUP) {\
2063 static PY_UINT64_T __pyx_dict_version = 0;\
2064 static PyObject *__pyx_dict_cached_value = NULL;\
2065 if (likely(__PYX_GET_DICT_VERSION(DICT) == __pyx_dict_version)) {\
2066 (VAR) = __pyx_dict_cached_value;\
2068 (VAR) = __pyx_dict_cached_value = (LOOKUP);\
2069 __pyx_dict_version = __PYX_GET_DICT_VERSION(DICT);\
2072 static CYTHON_INLINE PY_UINT64_T __Pyx_get_tp_dict_version(PyObject *obj);
2073 static CYTHON_INLINE PY_UINT64_T __Pyx_get_object_dict_version(PyObject *obj);
2074 static CYTHON_INLINE
int __Pyx_object_dict_version_matches(PyObject* obj, PY_UINT64_T tp_dict_version, PY_UINT64_T obj_dict_version);
2076 #define __PYX_GET_DICT_VERSION(dict) (0)
2077 #define __PYX_UPDATE_DICT_CACHE(dict, value, cache_var, version_var)
2078 #define __PYX_PY_DICT_LOOKUP_IF_MODIFIED(VAR, DICT, LOOKUP) (VAR) = (LOOKUP);
2082 #if CYTHON_USE_DICT_VERSIONS
2083 #define __Pyx_GetModuleGlobalName(var, name) {\
2084 static PY_UINT64_T __pyx_dict_version = 0;\
2085 static PyObject *__pyx_dict_cached_value = NULL;\
2086 (var) = (likely(__pyx_dict_version == __PYX_GET_DICT_VERSION(__pyx_d))) ?\
2087 (likely(__pyx_dict_cached_value) ? __Pyx_NewRef(__pyx_dict_cached_value) : __Pyx_GetBuiltinName(name)) :\
2088 __Pyx__GetModuleGlobalName(name, &__pyx_dict_version, &__pyx_dict_cached_value);\
2090 #define __Pyx_GetModuleGlobalNameUncached(var, name) {\
2091 PY_UINT64_T __pyx_dict_version;\
2092 PyObject *__pyx_dict_cached_value;\
2093 (var) = __Pyx__GetModuleGlobalName(name, &__pyx_dict_version, &__pyx_dict_cached_value);\
2095 static PyObject *__Pyx__GetModuleGlobalName(PyObject *name, PY_UINT64_T *dict_version, PyObject **dict_cached_value);
2097 #define __Pyx_GetModuleGlobalName(var, name) (var) = __Pyx__GetModuleGlobalName(name)
2098 #define __Pyx_GetModuleGlobalNameUncached(var, name) (var) = __Pyx__GetModuleGlobalName(name)
2099 static CYTHON_INLINE PyObject *__Pyx__GetModuleGlobalName(PyObject *name);
2103 static int __Pyx_CheckKeywordStrings(PyObject *kwdict,
const char* function_name,
int kw_allowed);
2106 static void __Pyx_WriteUnraisable(
const char *name,
int clineno,
2107 int lineno,
const char *filename,
2108 int full_traceback,
int nogil);
2111 static CYTHON_INLINE
void __Pyx_RaiseClosureNameError(
const char *varname);
2114 static PyTypeObject* __Pyx_FetchCommonType(PyTypeObject* type);
2117 #define __Pyx_CyFunction_USED 1
2118 #define __Pyx_CYFUNCTION_STATICMETHOD 0x01
2119 #define __Pyx_CYFUNCTION_CLASSMETHOD 0x02
2120 #define __Pyx_CYFUNCTION_CCLASS 0x04
2121 #define __Pyx_CyFunction_GetClosure(f)\
2122 (((__pyx_CyFunctionObject *) (f))->func_closure)
2123 #define __Pyx_CyFunction_GetClassObj(f)\
2124 (((__pyx_CyFunctionObject *) (f))->func_classobj)
2125 #define __Pyx_CyFunction_Defaults(type, f)\
2126 ((type *)(((__pyx_CyFunctionObject *) (f))->defaults))
2127 #define __Pyx_CyFunction_SetDefaultsGetter(f, g)\
2128 ((__pyx_CyFunctionObject *) (f))->defaults_getter = (g)
2130 PyCFunctionObject func;
2131 #if PY_VERSION_HEX < 0x030500A0
2132 PyObject *func_weakreflist;
2134 PyObject *func_dict;
2135 PyObject *func_name;
2136 PyObject *func_qualname;
2138 PyObject *func_globals;
2139 PyObject *func_code;
2140 PyObject *func_closure;
2141 PyObject *func_classobj;
2143 int defaults_pyobjects;
2144 size_t defaults_size;
2146 PyObject *defaults_tuple;
2147 PyObject *defaults_kwdict;
2148 PyObject *(*defaults_getter)(PyObject *);
2149 PyObject *func_annotations;
2150 } __pyx_CyFunctionObject;
2151 static PyTypeObject *__pyx_CyFunctionType = 0;
2152 #define __Pyx_CyFunction_Check(obj) (__Pyx_TypeCheck(obj, __pyx_CyFunctionType))
2153 static PyObject *__Pyx_CyFunction_Init(__pyx_CyFunctionObject* op, PyMethodDef *ml,
2154 int flags, PyObject* qualname,
2156 PyObject *module, PyObject *globals,
2158 static CYTHON_INLINE
void *__Pyx_CyFunction_InitDefaults(PyObject *m,
2161 static CYTHON_INLINE
void __Pyx_CyFunction_SetDefaultsTuple(PyObject *m,
2163 static CYTHON_INLINE
void __Pyx_CyFunction_SetDefaultsKwDict(PyObject *m,
2165 static CYTHON_INLINE
void __Pyx_CyFunction_SetAnnotationsDict(PyObject *m,
2167 static int __pyx_CyFunction_init(
void);
2170 static PyObject *__Pyx_CyFunction_New(PyMethodDef *ml,
2171 int flags, PyObject* qualname,
2173 PyObject *module, PyObject *globals,
2177 static CYTHON_UNUSED PyObject* __Pyx_PyObject_Call2Args(PyObject*
function, PyObject* arg1, PyObject* arg2);
2180 static CYTHON_INLINE PyObject* __Pyx_PyObject_GetSlice(
2181 PyObject* obj, Py_ssize_t cstart, Py_ssize_t cstop,
2182 PyObject** py_start, PyObject** py_stop, PyObject** py_slice,
2183 int has_cstart,
int has_cstop,
int wraparound);
2186 static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause);
2189 static CYTHON_INLINE
int __Pyx_PySequence_ContainsTF(PyObject* item, PyObject* seq,
int eq) {
2190 int result = PySequence_Contains(seq, item);
2191 return unlikely(result < 0) ? result : (result == (eq == Py_EQ));
2195 static CYTHON_INLINE
int __Pyx_HasAttr(PyObject *, PyObject *);
2198 #if CYTHON_USE_EXC_INFO_STACK
2199 static _PyErr_StackItem * __Pyx_PyErr_GetTopmostException(PyThreadState *tstate);
2203 #if CYTHON_FAST_THREAD_STATE
2204 #define __Pyx_ExceptionSave(type, value, tb) __Pyx__ExceptionSave(__pyx_tstate, type, value, tb)
2205 static CYTHON_INLINE
void __Pyx__ExceptionSave(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb);
2206 #define __Pyx_ExceptionReset(type, value, tb) __Pyx__ExceptionReset(__pyx_tstate, type, value, tb)
2207 static CYTHON_INLINE
void __Pyx__ExceptionReset(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb);
2209 #define __Pyx_ExceptionSave(type, value, tb) PyErr_GetExcInfo(type, value, tb)
2210 #define __Pyx_ExceptionReset(type, value, tb) PyErr_SetExcInfo(type, value, tb)
2214 #if CYTHON_FAST_THREAD_STATE
2215 #define __Pyx_GetException(type, value, tb) __Pyx__GetException(__pyx_tstate, type, value, tb)
2216 static int __Pyx__GetException(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb);
2218 static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb);
2222 #define __Pyx_ArgTypeTest(obj, type, none_allowed, name, exact)\
2223 ((likely((Py_TYPE(obj) == type) | (none_allowed && (obj == Py_None)))) ? 1 :\
2224 __Pyx__ArgTypeTest(obj, type, name, exact))
2225 static int __Pyx__ArgTypeTest(PyObject *obj, PyTypeObject *type,
const char *name,
int exact);
2231 static CYTHON_INLINE
int __Pyx_PyBytes_Equals(PyObject* s1, PyObject* s2,
int equals);
2234 static CYTHON_INLINE
int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2,
int equals);
2237 #if PY_MAJOR_VERSION >= 3
2238 #define __Pyx_PyString_Equals __Pyx_PyUnicode_Equals
2240 #define __Pyx_PyString_Equals __Pyx_PyBytes_Equals
2244 static CYTHON_INLINE Py_ssize_t __Pyx_div_Py_ssize_t(Py_ssize_t, Py_ssize_t);
2247 #define UNARY_NEG_WOULD_OVERFLOW(x)\
2248 (((x) < 0) & ((unsigned long)(x) == 0-(unsigned long)(x)))
2250 static CYTHON_UNUSED
int __pyx_array_getbuffer(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info,
int __pyx_v_flags);
2251 static PyObject *__pyx_array_get_memview(
struct __pyx_array_obj *);
2253 static CYTHON_INLINE PyObject *__Pyx_PyUnicode_DecodeUTF16(
const char *
s, Py_ssize_t size,
const char *errors) {
2255 return PyUnicode_DecodeUTF16(
s, size, errors, &byteorder);
2257 static CYTHON_INLINE PyObject *__Pyx_PyUnicode_DecodeUTF16LE(
const char *
s, Py_ssize_t size,
const char *errors) {
2259 return PyUnicode_DecodeUTF16(
s, size, errors, &byteorder);
2261 static CYTHON_INLINE PyObject *__Pyx_PyUnicode_DecodeUTF16BE(
const char *
s, Py_ssize_t size,
const char *errors) {
2263 return PyUnicode_DecodeUTF16(
s, size, errors, &byteorder);
2267 static CYTHON_INLINE PyObject* __Pyx_decode_c_string(
2268 const char* cstring, Py_ssize_t start, Py_ssize_t stop,
2269 const char* encoding,
const char* errors,
2270 PyObject* (*decode_func)(
const char *
s, Py_ssize_t size,
const char *errors));
2273 static CYTHON_INLINE
void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected);
2276 static CYTHON_INLINE
void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index);
2279 static CYTHON_INLINE
void __Pyx_RaiseNoneNotIterableError(
void);
2282 static CYTHON_INLINE
int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type);
2285 #if CYTHON_FAST_THREAD_STATE
2286 #define __Pyx_ExceptionSwap(type, value, tb) __Pyx__ExceptionSwap(__pyx_tstate, type, value, tb)
2287 static CYTHON_INLINE
void __Pyx__ExceptionSwap(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb);
2289 static CYTHON_INLINE
void __Pyx_ExceptionSwap(PyObject **type, PyObject **value, PyObject **tb);
2293 #if CYTHON_COMPILING_IN_CPYTHON
2294 #define __Pyx_TypeCheck(obj, type) __Pyx_IsSubtype(Py_TYPE(obj), (PyTypeObject *)type)
2295 static CYTHON_INLINE
int __Pyx_IsSubtype(PyTypeObject *a, PyTypeObject *b);
2296 static CYTHON_INLINE
int __Pyx_PyErr_GivenExceptionMatches(PyObject *err, PyObject *type);
2297 static CYTHON_INLINE
int __Pyx_PyErr_GivenExceptionMatches2(PyObject *err, PyObject *type1, PyObject *type2);
2299 #define __Pyx_TypeCheck(obj, type) PyObject_TypeCheck(obj, (PyTypeObject *)type)
2300 #define __Pyx_PyErr_GivenExceptionMatches(err, type) PyErr_GivenExceptionMatches(err, type)
2301 #define __Pyx_PyErr_GivenExceptionMatches2(err, type1, type2) (PyErr_GivenExceptionMatches(err, type1) || PyErr_GivenExceptionMatches(err, type2))
2303 #define __Pyx_PyException_Check(obj) __Pyx_TypeCheck(obj, PyExc_Exception)
2305 static CYTHON_UNUSED
int __pyx_memoryview_getbuffer(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info,
int __pyx_v_flags);
2307 #if CYTHON_USE_PYLIST_INTERNALS && CYTHON_ASSUME_SAFE_MACROS
2308 static CYTHON_INLINE
int __Pyx_ListComp_Append(PyObject* list, PyObject* x) {
2309 PyListObject*
L = (PyListObject*) list;
2310 Py_ssize_t len = Py_SIZE(list);
2311 if (likely(
L->allocated > len)) {
2313 PyList_SET_ITEM(list, len, x);
2314 __Pyx_SET_SIZE(list, len + 1);
2317 return PyList_Append(list, x);
2320 #define __Pyx_ListComp_Append(L,x) PyList_Append(L,x)
2324 #if !CYTHON_COMPILING_IN_PYPY
2325 static PyObject* __Pyx_PyInt_AddObjC(PyObject *op1, PyObject *op2,
long intval,
int inplace,
int zerodivision_check);
2327 #define __Pyx_PyInt_AddObjC(op1, op2, intval, inplace, zerodivision_check)\
2328 (inplace ? PyNumber_InPlaceAdd(op1, op2) : PyNumber_Add(op1, op2))
2332 static CYTHON_INLINE
int __Pyx_PyList_Extend(PyObject*
L, PyObject*
v) {
2333 #if CYTHON_COMPILING_IN_CPYTHON
2334 PyObject* none = _PyList_Extend((PyListObject*)
L,
v);
2335 if (unlikely(!none))
2340 return PyList_SetSlice(
L, PY_SSIZE_T_MAX, PY_SSIZE_T_MAX,
v);
2345 #if CYTHON_USE_PYLIST_INTERNALS && CYTHON_ASSUME_SAFE_MACROS
2346 static CYTHON_INLINE
int __Pyx_PyList_Append(PyObject* list, PyObject* x) {
2347 PyListObject*
L = (PyListObject*) list;
2348 Py_ssize_t len = Py_SIZE(list);
2349 if (likely(
L->allocated > len) & likely(len > (
L->allocated >> 1))) {
2351 PyList_SET_ITEM(list, len, x);
2352 __Pyx_SET_SIZE(list, len + 1);
2355 return PyList_Append(list, x);
2358 #define __Pyx_PyList_Append(L,x) PyList_Append(L,x)
2362 static CYTHON_INLINE
void __Pyx_RaiseUnboundLocalError(
const char *varname);
2365 static CYTHON_INLINE
long __Pyx_div_long(
long,
long);
2368 #if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000
2369 static CYTHON_INLINE PyObject* __Pyx_PyObject_GenericGetAttrNoDict(PyObject* obj, PyObject* attr_name);
2371 #define __Pyx_PyObject_GenericGetAttrNoDict PyObject_GenericGetAttr
2375 #if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000
2376 static PyObject* __Pyx_PyObject_GenericGetAttr(PyObject* obj, PyObject* attr_name);
2378 #define __Pyx_PyObject_GenericGetAttr PyObject_GenericGetAttr
2382 static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStrNoError(PyObject* obj, PyObject* attr_name);
2385 static int __Pyx_setup_reduce(PyObject* type_obj);
2388 static int __Pyx_SetVtable(PyObject *dict,
void *vtable);
2391 #ifndef __PYX_HAVE_RT_ImportType_proto
2392 #define __PYX_HAVE_RT_ImportType_proto
2393 enum __Pyx_ImportType_CheckSize {
2394 __Pyx_ImportType_CheckSize_Error = 0,
2395 __Pyx_ImportType_CheckSize_Warn = 1,
2396 __Pyx_ImportType_CheckSize_Ignore = 2
2398 static PyTypeObject *__Pyx_ImportType(PyObject* module,
const char *module_name,
const char *class_name,
size_t size,
enum __Pyx_ImportType_CheckSize check_size);
2402 #ifdef CYTHON_CLINE_IN_TRACEBACK
2403 #define __Pyx_CLineForTraceback(tstate, c_line) (((CYTHON_CLINE_IN_TRACEBACK)) ? c_line : 0)
2405 static int __Pyx_CLineForTraceback(PyThreadState *tstate,
int c_line);
2410 PyCodeObject* code_object;
2412 } __Pyx_CodeObjectCacheEntry;
2413 struct __Pyx_CodeObjectCache {
2416 __Pyx_CodeObjectCacheEntry* entries;
2418 static struct __Pyx_CodeObjectCache __pyx_code_cache = {0,0,NULL};
2419 static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries,
int count,
int code_line);
2420 static PyCodeObject *__pyx_find_code_object(
int code_line);
2421 static void __pyx_insert_code_object(
int code_line, PyCodeObject* code_object);
2424 static void __Pyx_AddTraceback(
const char *funcname,
int c_line,
2425 int py_line,
const char *filename);
2427 #if PY_MAJOR_VERSION < 3
2428 static int __Pyx_GetBuffer(PyObject *obj, Py_buffer *view,
int flags);
2429 static void __Pyx_ReleaseBuffer(Py_buffer *view);
2431 #define __Pyx_GetBuffer PyObject_GetBuffer
2432 #define __Pyx_ReleaseBuffer PyBuffer_Release
2438 Py_ssize_t shape, strides, suboffsets;
2439 } __Pyx_Buf_DimInfo;
2445 __Pyx_Buffer *rcbuffer;
2447 __Pyx_Buf_DimInfo diminfo[8];
2448 } __Pyx_LocalBuf_ND;
2451 static int __pyx_memviewslice_is_contig(
const __Pyx_memviewslice mvs,
char order,
int ndim);
2454 static int __pyx_slices_overlap(__Pyx_memviewslice *slice1,
2455 __Pyx_memviewslice *slice2,
2456 int ndim,
size_t itemsize);
2459 static CYTHON_INLINE PyObject *__pyx_capsule_create(
void *p,
const char *sig);
2462 static CYTHON_INLINE PyObject *__pyx_memview_get_double(
const char *itemp);
2463 static CYTHON_INLINE
int __pyx_memview_set_double(
const char *itemp, PyObject *obj);
2466 static CYTHON_INLINE
int __Pyx_Is_Little_Endian(
void);
2469 static const char* __Pyx_BufFmt_CheckString(__Pyx_BufFmt_Context* ctx,
const char* ts);
2470 static void __Pyx_BufFmt_Init(__Pyx_BufFmt_Context* ctx,
2471 __Pyx_BufFmt_StackElem* stack,
2472 __Pyx_TypeInfo* type);
2475 static int __pyx_typeinfo_cmp(__Pyx_TypeInfo *a, __Pyx_TypeInfo *b);
2478 static int __Pyx_ValidateAndInit_memviewslice(
2483 __Pyx_TypeInfo *dtype,
2484 __Pyx_BufFmt_StackElem stack[],
2485 __Pyx_memviewslice *memviewslice,
2486 PyObject *original_obj);
2489 static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_ds_double(PyObject *,
int writable_flag);
2492 #if defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 6))
2493 #define __Pyx_HAS_GCC_DIAGNOSTIC
2499 #define __Pyx_CREAL(z) ((z).real())
2500 #define __Pyx_CIMAG(z) ((z).imag())
2502 #define __Pyx_CREAL(z) (__real__(z))
2503 #define __Pyx_CIMAG(z) (__imag__(z))
2506 #define __Pyx_CREAL(z) ((z).real)
2507 #define __Pyx_CIMAG(z) ((z).imag)
2509 #if defined(__cplusplus) && CYTHON_CCOMPLEX\
2510 && (defined(_WIN32) || defined(__clang__) || (defined(__GNUC__) && (__GNUC__ >= 5 || __GNUC__ == 4 && __GNUC_MINOR__ >= 4 )) || __cplusplus >= 201103)
2511 #define __Pyx_SET_CREAL(z,x) ((z).real(x))
2512 #define __Pyx_SET_CIMAG(z,y) ((z).imag(y))
2514 #define __Pyx_SET_CREAL(z,x) __Pyx_CREAL(z) = (x)
2515 #define __Pyx_SET_CIMAG(z,y) __Pyx_CIMAG(z) = (y)
2520 #define __Pyx_c_eq_float(a, b) ((a)==(b))
2521 #define __Pyx_c_sum_float(a, b) ((a)+(b))
2522 #define __Pyx_c_diff_float(a, b) ((a)-(b))
2523 #define __Pyx_c_prod_float(a, b) ((a)*(b))
2524 #define __Pyx_c_quot_float(a, b) ((a)/(b))
2525 #define __Pyx_c_neg_float(a) (-(a))
2527 #define __Pyx_c_is_zero_float(z) ((z)==(float)0)
2528 #define __Pyx_c_conj_float(z) (::std::conj(z))
2530 #define __Pyx_c_abs_float(z) (::std::abs(z))
2531 #define __Pyx_c_pow_float(a, b) (::std::pow(a, b))
2534 #define __Pyx_c_is_zero_float(z) ((z)==0)
2535 #define __Pyx_c_conj_float(z) (conjf(z))
2537 #define __Pyx_c_abs_float(z) (cabsf(z))
2538 #define __Pyx_c_pow_float(a, b) (cpowf(a, b))
2542 static CYTHON_INLINE
int __Pyx_c_eq_float(__pyx_t_float_complex, __pyx_t_float_complex);
2543 static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_sum_float(__pyx_t_float_complex, __pyx_t_float_complex);
2544 static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_diff_float(__pyx_t_float_complex, __pyx_t_float_complex);
2545 static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_prod_float(__pyx_t_float_complex, __pyx_t_float_complex);
2546 static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_quot_float(__pyx_t_float_complex, __pyx_t_float_complex);
2547 static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_neg_float(__pyx_t_float_complex);
2548 static CYTHON_INLINE
int __Pyx_c_is_zero_float(__pyx_t_float_complex);
2549 static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_conj_float(__pyx_t_float_complex);
2551 static CYTHON_INLINE
float __Pyx_c_abs_float(__pyx_t_float_complex);
2552 static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_pow_float(__pyx_t_float_complex, __pyx_t_float_complex);
2558 #define __Pyx_c_eq_double(a, b) ((a)==(b))
2559 #define __Pyx_c_sum_double(a, b) ((a)+(b))
2560 #define __Pyx_c_diff_double(a, b) ((a)-(b))
2561 #define __Pyx_c_prod_double(a, b) ((a)*(b))
2562 #define __Pyx_c_quot_double(a, b) ((a)/(b))
2563 #define __Pyx_c_neg_double(a) (-(a))
2565 #define __Pyx_c_is_zero_double(z) ((z)==(double)0)
2566 #define __Pyx_c_conj_double(z) (::std::conj(z))
2568 #define __Pyx_c_abs_double(z) (::std::abs(z))
2569 #define __Pyx_c_pow_double(a, b) (::std::pow(a, b))
2572 #define __Pyx_c_is_zero_double(z) ((z)==0)
2573 #define __Pyx_c_conj_double(z) (conj(z))
2575 #define __Pyx_c_abs_double(z) (cabs(z))
2576 #define __Pyx_c_pow_double(a, b) (cpow(a, b))
2580 static CYTHON_INLINE
int __Pyx_c_eq_double(__pyx_t_double_complex, __pyx_t_double_complex);
2581 static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_sum_double(__pyx_t_double_complex, __pyx_t_double_complex);
2582 static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_diff_double(__pyx_t_double_complex, __pyx_t_double_complex);
2583 static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_prod_double(__pyx_t_double_complex, __pyx_t_double_complex);
2584 static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_quot_double(__pyx_t_double_complex, __pyx_t_double_complex);
2585 static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_neg_double(__pyx_t_double_complex);
2586 static CYTHON_INLINE
int __Pyx_c_is_zero_double(__pyx_t_double_complex);
2587 static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_conj_double(__pyx_t_double_complex);
2589 static CYTHON_INLINE
double __Pyx_c_abs_double(__pyx_t_double_complex);
2590 static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_pow_double(__pyx_t_double_complex, __pyx_t_double_complex);
2595 static __Pyx_memviewslice
2596 __pyx_memoryview_copy_new_contig(
const __Pyx_memviewslice *from_mvs,
2597 const char *mode,
int ndim,
2598 size_t sizeof_dtype,
int contig_flag,
2599 int dtype_is_object);
2602 static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(
int value);
2605 static CYTHON_INLINE
int __Pyx_PyInt_As_int(PyObject *);
2608 static CYTHON_INLINE
long __Pyx_PyInt_As_long(PyObject *);
2611 static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(
long value);
2614 static CYTHON_INLINE
char __Pyx_PyInt_As_char(PyObject *);
2617 static int __Pyx_check_binary_version(
void);
2620 static int __Pyx_InitStrings(__Pyx_StringTabEntry *t);
2622 static void __pyx_f_18BoundaryConditions_17BoundaryCondition_resetBC(
struct __pyx_obj_18BoundaryConditions_BoundaryCondition *__pyx_v_self,
int __pyx_skip_dispatch);
2623 static PyObject *__pyx_array_get_memview(
struct __pyx_array_obj *__pyx_v_self);
2624 static char *__pyx_memoryview_get_item_pointer(
struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index);
2625 static PyObject *__pyx_memoryview_is_slice(
struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_obj);
2626 static PyObject *__pyx_memoryview_setitem_slice_assignment(
struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_dst, PyObject *__pyx_v_src);
2627 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);
2628 static PyObject *__pyx_memoryview_setitem_indexed(
struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index, PyObject *__pyx_v_value);
2629 static PyObject *__pyx_memoryview_convert_item_to_object(
struct __pyx_memoryview_obj *__pyx_v_self,
char *__pyx_v_itemp);
2630 static PyObject *__pyx_memoryview_assign_item_from_object(
struct __pyx_memoryview_obj *__pyx_v_self,
char *__pyx_v_itemp, PyObject *__pyx_v_value);
2631 static PyObject *__pyx_memoryviewslice_convert_item_to_object(
struct __pyx_memoryviewslice_obj *__pyx_v_self,
char *__pyx_v_itemp);
2632 static PyObject *__pyx_memoryviewslice_assign_item_from_object(
struct __pyx_memoryviewslice_obj *__pyx_v_self,
char *__pyx_v_itemp, PyObject *__pyx_v_value);
2647 static PyTypeObject *__pyx_ptype_7cpython_4type_type = 0;
2660 static PyTypeObject *__pyx_ptype_5numpy_dtype = 0;
2661 static PyTypeObject *__pyx_ptype_5numpy_flatiter = 0;
2662 static PyTypeObject *__pyx_ptype_5numpy_broadcast = 0;
2663 static PyTypeObject *__pyx_ptype_5numpy_ndarray = 0;
2664 static PyTypeObject *__pyx_ptype_5numpy_generic = 0;
2665 static PyTypeObject *__pyx_ptype_5numpy_number = 0;
2666 static PyTypeObject *__pyx_ptype_5numpy_integer = 0;
2667 static PyTypeObject *__pyx_ptype_5numpy_signedinteger = 0;
2668 static PyTypeObject *__pyx_ptype_5numpy_unsignedinteger = 0;
2669 static PyTypeObject *__pyx_ptype_5numpy_inexact = 0;
2670 static PyTypeObject *__pyx_ptype_5numpy_floating = 0;
2671 static PyTypeObject *__pyx_ptype_5numpy_complexfloating = 0;
2672 static PyTypeObject *__pyx_ptype_5numpy_flexible = 0;
2673 static PyTypeObject *__pyx_ptype_5numpy_character = 0;
2674 static PyTypeObject *__pyx_ptype_5numpy_ufunc = 0;
2677 static PyTypeObject *__pyx_ptype_18BoundaryConditions_BC_Base = 0;
2678 static PyTypeObject *__pyx_ptype_18BoundaryConditions_BoundaryCondition = 0;
2679 static PyTypeObject *__pyx_ptype_18BoundaryConditions___pyx_scope_struct__setConstantBC = 0;
2680 static PyTypeObject *__pyx_ptype_18BoundaryConditions___pyx_scope_struct_1_setLinearBC = 0;
2681 static PyTypeObject *__pyx_ptype_18BoundaryConditions___pyx_scope_struct_2_setLinearRamp = 0;
2682 static PyTypeObject *__pyx_array_type = 0;
2683 static PyTypeObject *__pyx_MemviewEnum_type = 0;
2684 static PyTypeObject *__pyx_memoryview_type = 0;
2685 static PyTypeObject *__pyx_memoryviewslice_type = 0;
2686 static PyObject *
generic = 0;
2687 static PyObject *strided = 0;
2688 static PyObject *indirect = 0;
2689 static PyObject *contiguous = 0;
2690 static PyObject *indirect_contiguous = 0;
2691 static int __pyx_memoryview_thread_locks_used;
2692 static PyThread_type_lock __pyx_memoryview_thread_locks[8];
2693 static PyObject *__pyx_f_18BoundaryConditions___pyx_unpickle_BC_Base__set_state(
struct __pyx_obj_18BoundaryConditions_BC_Base *, PyObject *);
2694 static struct __pyx_array_obj *__pyx_array_new(PyObject *, Py_ssize_t,
char *,
char *,
char *);
2695 static void *__pyx_align_pointer(
void *,
size_t);
2696 static PyObject *__pyx_memoryview_new(PyObject *,
int,
int, __Pyx_TypeInfo *);
2697 static CYTHON_INLINE
int __pyx_memoryview_check(PyObject *);
2698 static PyObject *_unellipsify(PyObject *,
int);
2699 static PyObject *assert_direct_dimensions(Py_ssize_t *,
int);
2700 static struct __pyx_memoryview_obj *__pyx_memview_slice(
struct __pyx_memoryview_obj *, PyObject *);
2701 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);
2702 static char *__pyx_pybuffer_index(Py_buffer *,
char *, Py_ssize_t, Py_ssize_t);
2703 static int __pyx_memslice_transpose(__Pyx_memviewslice *);
2704 static PyObject *__pyx_memoryview_fromslice(__Pyx_memviewslice,
int, PyObject *(*)(
char *),
int (*)(
char *, PyObject *),
int);
2705 static __Pyx_memviewslice *__pyx_memoryview_get_slice_from_memoryview(
struct __pyx_memoryview_obj *, __Pyx_memviewslice *);
2706 static void __pyx_memoryview_slice_copy(
struct __pyx_memoryview_obj *, __Pyx_memviewslice *);
2707 static PyObject *__pyx_memoryview_copy_object(
struct __pyx_memoryview_obj *);
2708 static PyObject *__pyx_memoryview_copy_object_from_slice(
struct __pyx_memoryview_obj *, __Pyx_memviewslice *);
2709 static Py_ssize_t abs_py_ssize_t(Py_ssize_t);
2710 static char __pyx_get_best_slice_order(__Pyx_memviewslice *,
int);
2711 static void _copy_strided_to_strided(
char *, Py_ssize_t *,
char *, Py_ssize_t *, Py_ssize_t *, Py_ssize_t *,
int,
size_t);
2712 static void copy_strided_to_strided(__Pyx_memviewslice *, __Pyx_memviewslice *,
int,
size_t);
2713 static Py_ssize_t __pyx_memoryview_slice_get_size(__Pyx_memviewslice *,
int);
2714 static Py_ssize_t __pyx_fill_contig_strides_array(Py_ssize_t *, Py_ssize_t *, Py_ssize_t,
int,
char);
2715 static void *__pyx_memoryview_copy_data_to_temp(__Pyx_memviewslice *, __Pyx_memviewslice *,
char,
int);
2716 static int __pyx_memoryview_err_extents(
int, Py_ssize_t, Py_ssize_t);
2717 static int __pyx_memoryview_err_dim(PyObject *,
char *,
int);
2718 static int __pyx_memoryview_err(PyObject *,
char *);
2719 static int __pyx_memoryview_copy_contents(__Pyx_memviewslice, __Pyx_memviewslice,
int,
int,
int);
2720 static void __pyx_memoryview_broadcast_leading(__Pyx_memviewslice *,
int,
int);
2721 static void __pyx_memoryview_refcount_copying(__Pyx_memviewslice *,
int,
int,
int);
2722 static void __pyx_memoryview_refcount_objects_in_slice_with_gil(
char *, Py_ssize_t *, Py_ssize_t *,
int,
int);
2723 static void __pyx_memoryview_refcount_objects_in_slice(
char *, Py_ssize_t *, Py_ssize_t *,
int,
int);
2724 static void __pyx_memoryview_slice_assign_scalar(__Pyx_memviewslice *,
int,
size_t,
void *,
int);
2725 static void __pyx_memoryview__slice_assign_scalar(
char *, Py_ssize_t *, Py_ssize_t *,
int,
size_t,
void *);
2726 static PyObject *__pyx_unpickle_Enum__set_state(
struct __pyx_MemviewEnum_obj *, PyObject *);
2727 static __Pyx_TypeInfo __Pyx_TypeInfo_double = {
"double", NULL,
sizeof(double), { 0 }, 0,
'R', 0, 0 };
2728 #define __Pyx_MODULE_NAME "BoundaryConditions"
2729 extern int __pyx_module_is_main_BoundaryConditions;
2730 int __pyx_module_is_main_BoundaryConditions = 0;
2733 static PyObject *__pyx_builtin_sum;
2734 static PyObject *__pyx_builtin_TypeError;
2735 static PyObject *__pyx_builtin_ImportError;
2736 static PyObject *__pyx_builtin_ValueError;
2737 static PyObject *__pyx_builtin_MemoryError;
2738 static PyObject *__pyx_builtin_enumerate;
2739 static PyObject *__pyx_builtin_range;
2740 static PyObject *__pyx_builtin_Ellipsis;
2741 static PyObject *__pyx_builtin_id;
2742 static PyObject *__pyx_builtin_IndexError;
2743 static const char __pyx_k_O[] =
"O";
2744 static const char __pyx_k_a[] =
"a";
2745 static const char __pyx_k_c[] =
"c";
2746 static const char __pyx_k_n[] =
"n";
2747 static const char __pyx_k_t[] =
"t";
2748 static const char __pyx_k_x[] =
"x";
2749 static const char __pyx_k_a0[] =
"a0";
2750 static const char __pyx_k_id[] =
"id";
2751 static const char __pyx_k_nd[] =
"nd";
2752 static const char __pyx_k_np[] =
"np";
2753 static const char __pyx_k_t1[] =
"t1";
2754 static const char __pyx_k_all[] =
"__all__";
2755 static const char __pyx_k_b_i[] =
"b_i";
2756 static const char __pyx_k_get[] =
"get";
2757 static const char __pyx_k_new[] =
"__new__";
2758 static const char __pyx_k_obj[] =
"obj";
2759 static const char __pyx_k_sum[] =
"sum";
2760 static const char __pyx_k_None[] =
"None";
2761 static const char __pyx_k_b_or[] =
"b_or";
2762 static const char __pyx_k_base[] =
"base";
2763 static const char __pyx_k_dict[] =
"__dict__";
2764 static const char __pyx_k_main[] =
"__main__";
2765 static const char __pyx_k_mode[] =
"mode";
2766 static const char __pyx_k_name[] =
"name";
2767 static const char __pyx_k_ndim[] =
"ndim";
2768 static const char __pyx_k_pack[] =
"pack";
2769 static const char __pyx_k_self[] =
"self";
2770 static const char __pyx_k_size[] =
"size";
2771 static const char __pyx_k_step[] =
"step";
2772 static const char __pyx_k_stop[] =
"stop";
2773 static const char __pyx_k_test[] =
"__test__";
2774 static const char __pyx_k_ASCII[] =
"ASCII";
2775 static const char __pyx_k_class[] =
"__class__";
2776 static const char __pyx_k_error[] =
"error";
2777 static const char __pyx_k_flags[] =
"flags";
2778 static const char __pyx_k_numpy[] =
"numpy";
2779 static const char __pyx_k_range[] =
"range";
2780 static const char __pyx_k_shape[] =
"shape";
2781 static const char __pyx_k_start[] =
"start";
2782 static const char __pyx_k_state[] =
"state";
2783 static const char __pyx_k_value[] =
"value";
2784 static const char __pyx_k_zeros[] =
"zeros";
2785 static const char __pyx_k_Domain[] =
"Domain";
2786 static const char __pyx_k_dict_2[] =
"_dict";
2787 static const char __pyx_k_encode[] =
"encode";
2788 static const char __pyx_k_format[] =
"format";
2789 static const char __pyx_k_import[] =
"__import__";
2790 static const char __pyx_k_name_2[] =
"__name__";
2791 static const char __pyx_k_pickle[] =
"pickle";
2792 static const char __pyx_k_reduce[] =
"__reduce__";
2793 static const char __pyx_k_struct[] =
"struct";
2794 static const char __pyx_k_unpack[] =
"unpack";
2795 static const char __pyx_k_update[] =
"update";
2796 static const char __pyx_k_BC_Base[] =
"BC_Base";
2797 static const char __pyx_k_Context[] =
"Context";
2798 static const char __pyx_k_context[] =
"context";
2799 static const char __pyx_k_fortran[] =
"fortran";
2800 static const char __pyx_k_memview[] =
"memview";
2801 static const char __pyx_k_proteus[] =
"proteus";
2802 static const char __pyx_k_resetBC[] =
"resetBC";
2803 static const char __pyx_k_Ellipsis[] =
"Ellipsis";
2804 static const char __pyx_k_getstate[] =
"__getstate__";
2805 static const char __pyx_k_itemsize[] =
"itemsize";
2806 static const char __pyx_k_pyx_type[] =
"__pyx_type";
2807 static const char __pyx_k_setstate[] =
"__setstate__";
2808 static const char __pyx_k_TypeError[] =
"TypeError";
2809 static const char __pyx_k_enumerate[] =
"enumerate";
2810 static const char __pyx_k_pyx_state[] =
"__pyx_state";
2811 static const char __pyx_k_reduce_ex[] =
"__reduce_ex__";
2812 static const char __pyx_k_IndexError[] =
"IndexError";
2813 static const char __pyx_k_ValueError[] =
"ValueError";
2814 static const char __pyx_k_getContext[] =
"getContext";
2815 static const char __pyx_k_pyx_result[] =
"__pyx_result";
2816 static const char __pyx_k_pyx_vtable[] =
"__pyx_vtable__";
2817 static const char __pyx_k_ImportError[] =
"ImportError";
2818 static const char __pyx_k_MemoryError[] =
"MemoryError";
2819 static const char __pyx_k_PickleError[] =
"PickleError";
2820 static const char __pyx_k_init_cython[] =
"init_cython";
2821 static const char __pyx_k_setLinearBC[] =
"setLinearBC";
2822 static const char __pyx_k_pyx_checksum[] =
"__pyx_checksum";
2823 static const char __pyx_k_stringsource[] =
"stringsource";
2824 static const char __pyx_k_use_setstate[] =
"use_setstate";
2825 static const char __pyx_k_pyx_getbuffer[] =
"__pyx_getbuffer";
2826 static const char __pyx_k_reduce_cython[] =
"__reduce_cython__";
2827 static const char __pyx_k_setConstantBC[] =
"setConstantBC";
2828 static const char __pyx_k_setLinearRamp[] =
"setLinearRamp";
2829 static const char __pyx_k_View_MemoryView[] =
"View.MemoryView";
2830 static const char __pyx_k_allocate_buffer[] =
"allocate_buffer";
2831 static const char __pyx_k_dtype_is_object[] =
"dtype_is_object";
2832 static const char __pyx_k_pyx_PickleError[] =
"__pyx_PickleError";
2833 static const char __pyx_k_setstate_cython[] =
"__setstate_cython__";
2834 static const char __pyx_k_BoundaryCondition[] =
"BoundaryCondition";
2835 static const char __pyx_k_pyx_unpickle_Enum[] =
"__pyx_unpickle_Enum";
2836 static const char __pyx_k_BC_Base_getContext[] =
"BC_Base.getContext";
2837 static const char __pyx_k_BoundaryConditions[] =
"BoundaryConditions";
2838 static const char __pyx_k_cline_in_traceback[] =
"cline_in_traceback";
2839 static const char __pyx_k_strided_and_direct[] =
"<strided and direct>";
2840 static const char __pyx_k_pyx_unpickle_BC_Base[] =
"__pyx_unpickle_BC_Base";
2841 static const char __pyx_k_strided_and_indirect[] =
"<strided and indirect>";
2842 static const char __pyx_k_contiguous_and_direct[] =
"<contiguous and direct>";
2843 static const char __pyx_k_MemoryView_of_r_object[] =
"<MemoryView of %r object>";
2844 static const char __pyx_k_BC_Base___reduce_cython[] =
"BC_Base.__reduce_cython__";
2845 static const char __pyx_k_MemoryView_of_r_at_0x_x[] =
"<MemoryView of %r at 0x%x>";
2846 static const char __pyx_k_contiguous_and_indirect[] =
"<contiguous and indirect>";
2847 static const char __pyx_k_Cannot_index_with_type_s[] =
"Cannot index with type '%s'";
2848 static const char __pyx_k_BC_Base___setstate_cython[] =
"BC_Base.__setstate_cython__";
2849 static const char __pyx_k_BoundaryCondition_resetBC[] =
"BoundaryCondition.resetBC";
2850 static const char __pyx_k_Invalid_shape_in_axis_d_d[] =
"Invalid shape in axis %d: %d.";
2851 static const char __pyx_k_setLinearBC_locals_lambda[] =
"setLinearBC.<locals>.<lambda>";
2852 static const char __pyx_k_itemsize_0_for_cython_array[] =
"itemsize <= 0 for cython.array";
2853 static const char __pyx_k_setConstantBC_locals_lambda[] =
"setConstantBC.<locals>.<lambda>";
2854 static const char __pyx_k_setLinearRamp_locals_lambda[] =
"setLinearRamp.<locals>.<lambda>";
2855 static const char __pyx_k_BoundaryCondition_init_cython[] =
"BoundaryCondition.init_cython";
2856 static const char __pyx_k_BoundaryCondition_setLinearBC[] =
"BoundaryCondition.setLinearBC";
2857 static const char __pyx_k_proteus_BoundaryConditions_py[] =
"proteus/BoundaryConditions.py";
2858 static const char __pyx_k_unable_to_allocate_array_data[] =
"unable to allocate array data.";
2859 static const char __pyx_k_strided_and_direct_or_indirect[] =
"<strided and direct or indirect>";
2860 static const char __pyx_k_BoundaryCondition_setConstantBC[] =
"BoundaryCondition.setConstantBC";
2861 static const char __pyx_k_BoundaryCondition_setLinearRamp[] =
"BoundaryCondition.setLinearRamp";
2862 static const char __pyx_k_numpy_core_multiarray_failed_to[] =
"numpy.core.multiarray failed to import";
2863 static const char __pyx_k_self_uuOfXT_cannot_be_converted[] =
"self.uuOfXT cannot be converted to a Python object for pickling";
2864 static const char __pyx_k_BoundaryCondition___reduce_cytho[] =
"BoundaryCondition.__reduce_cython__";
2865 static const char __pyx_k_BoundaryCondition___setstate_cyt[] =
"BoundaryCondition.__setstate_cython__";
2866 static const char __pyx_k_Buffer_view_does_not_expose_stri[] =
"Buffer view does not expose strides";
2867 static const char __pyx_k_Can_only_create_a_buffer_that_is[] =
"Can only create a buffer that is contiguous in memory.";
2868 static const char __pyx_k_Cannot_assign_to_read_only_memor[] =
"Cannot assign to read-only memoryview";
2869 static const char __pyx_k_Cannot_create_writable_memory_vi[] =
"Cannot create writable memory view from read-only memoryview";
2870 static const char __pyx_k_Empty_shape_tuple_for_cython_arr[] =
"Empty shape tuple for cython.array";
2871 static const char __pyx_k_Incompatible_checksums_0x_x_vs_0[] =
"Incompatible checksums (0x%x vs (0x96e6a1f, 0x4d41573, 0x7d477a1) = (BC_type, Shape, _b_or, ct, name, nd))";
2872 static const char __pyx_k_Indirect_dimensions_not_supporte[] =
"Indirect dimensions not supported";
2873 static const char __pyx_k_Invalid_mode_expected_c_or_fortr[] =
"Invalid mode, expected 'c' or 'fortran', got %s";
2874 static const char __pyx_k_Out_of_bounds_on_buffer_access_a[] =
"Out of bounds on buffer access (axis %d)";
2875 static const char __pyx_k_Shape_or_nd_must_be_passed_to_BC[] =
"Shape or nd must be passed to BC";
2876 static const char __pyx_k_Unable_to_convert_item_to_object[] =
"Unable to convert item to object";
2877 static const char __pyx_k_got_differing_extents_in_dimensi[] =
"got differing extents in dimension %d (got %d and %d)";
2878 static const char __pyx_k_no_default___reduce___due_to_non[] =
"no default __reduce__ due to non-trivial __cinit__";
2879 static const char __pyx_k_numpy_core_umath_failed_to_impor[] =
"numpy.core.umath failed to import";
2880 static const char __pyx_k_unable_to_allocate_shape_and_str[] =
"unable to allocate shape and strides.";
2881 static const char __pyx_k_Incompatible_checksums_0x_x_vs_0_2[] =
"Incompatible checksums (0x%x vs (0xb068931, 0x82a3537, 0x6ae9995) = (name))";
2882 static PyObject *__pyx_n_s_ASCII;
2883 static PyObject *__pyx_n_s_BC_Base;
2884 static PyObject *__pyx_n_s_BC_Base___reduce_cython;
2885 static PyObject *__pyx_n_s_BC_Base___setstate_cython;
2886 static PyObject *__pyx_n_s_BC_Base_getContext;
2887 static PyObject *__pyx_n_s_BoundaryCondition;
2888 static PyObject *__pyx_n_s_BoundaryCondition___reduce_cytho;
2889 static PyObject *__pyx_n_s_BoundaryCondition___setstate_cyt;
2890 static PyObject *__pyx_n_s_BoundaryCondition_init_cython;
2891 static PyObject *__pyx_n_s_BoundaryCondition_resetBC;
2892 static PyObject *__pyx_n_s_BoundaryCondition_setConstantBC;
2893 static PyObject *__pyx_n_s_BoundaryCondition_setLinearBC;
2894 static PyObject *__pyx_n_s_BoundaryCondition_setLinearRamp;
2895 static PyObject *__pyx_n_s_BoundaryConditions;
2896 static PyObject *__pyx_kp_s_Buffer_view_does_not_expose_stri;
2897 static PyObject *__pyx_kp_s_Can_only_create_a_buffer_that_is;
2898 static PyObject *__pyx_kp_s_Cannot_assign_to_read_only_memor;
2899 static PyObject *__pyx_kp_s_Cannot_create_writable_memory_vi;
2900 static PyObject *__pyx_kp_s_Cannot_index_with_type_s;
2901 static PyObject *__pyx_n_s_Context;
2902 static PyObject *__pyx_n_s_Domain;
2903 static PyObject *__pyx_n_s_Ellipsis;
2904 static PyObject *__pyx_kp_s_Empty_shape_tuple_for_cython_arr;
2905 static PyObject *__pyx_n_s_ImportError;
2906 static PyObject *__pyx_kp_s_Incompatible_checksums_0x_x_vs_0;
2907 static PyObject *__pyx_kp_s_Incompatible_checksums_0x_x_vs_0_2;
2908 static PyObject *__pyx_n_s_IndexError;
2909 static PyObject *__pyx_kp_s_Indirect_dimensions_not_supporte;
2910 static PyObject *__pyx_kp_s_Invalid_mode_expected_c_or_fortr;
2911 static PyObject *__pyx_kp_s_Invalid_shape_in_axis_d_d;
2912 static PyObject *__pyx_n_s_MemoryError;
2913 static PyObject *__pyx_kp_s_MemoryView_of_r_at_0x_x;
2914 static PyObject *__pyx_kp_s_MemoryView_of_r_object;
2915 static PyObject *__pyx_n_s_None;
2916 static PyObject *__pyx_n_b_O;
2917 static PyObject *__pyx_kp_s_Out_of_bounds_on_buffer_access_a;
2918 static PyObject *__pyx_n_s_PickleError;
2919 static PyObject *__pyx_kp_s_Shape_or_nd_must_be_passed_to_BC;
2920 static PyObject *__pyx_n_s_TypeError;
2921 static PyObject *__pyx_kp_s_Unable_to_convert_item_to_object;
2922 static PyObject *__pyx_n_s_ValueError;
2923 static PyObject *__pyx_n_s_View_MemoryView;
2924 static PyObject *__pyx_n_s_a;
2925 static PyObject *__pyx_n_s_a0;
2926 static PyObject *__pyx_n_s_all;
2927 static PyObject *__pyx_n_s_allocate_buffer;
2928 static PyObject *__pyx_n_s_b_i;
2929 static PyObject *__pyx_n_s_b_or;
2930 static PyObject *__pyx_n_s_base;
2931 static PyObject *__pyx_n_s_c;
2932 static PyObject *__pyx_n_u_c;
2933 static PyObject *__pyx_n_s_class;
2934 static PyObject *__pyx_n_s_cline_in_traceback;
2935 static PyObject *__pyx_n_s_context;
2936 static PyObject *__pyx_kp_s_contiguous_and_direct;
2937 static PyObject *__pyx_kp_s_contiguous_and_indirect;
2938 static PyObject *__pyx_n_s_dict;
2939 static PyObject *__pyx_n_s_dict_2;
2940 static PyObject *__pyx_n_s_dtype_is_object;
2941 static PyObject *__pyx_n_s_encode;
2942 static PyObject *__pyx_n_s_enumerate;
2943 static PyObject *__pyx_n_s_error;
2944 static PyObject *__pyx_n_s_flags;
2945 static PyObject *__pyx_n_s_format;
2946 static PyObject *__pyx_n_s_fortran;
2947 static PyObject *__pyx_n_u_fortran;
2948 static PyObject *__pyx_n_s_get;
2949 static PyObject *__pyx_n_s_getContext;
2950 static PyObject *__pyx_n_s_getstate;
2951 static PyObject *__pyx_kp_s_got_differing_extents_in_dimensi;
2952 static PyObject *__pyx_n_s_id;
2953 static PyObject *__pyx_n_s_import;
2954 static PyObject *__pyx_n_s_init_cython;
2955 static PyObject *__pyx_n_s_itemsize;
2956 static PyObject *__pyx_kp_s_itemsize_0_for_cython_array;
2957 static PyObject *__pyx_n_s_main;
2958 static PyObject *__pyx_n_s_memview;
2959 static PyObject *__pyx_n_s_mode;
2960 static PyObject *__pyx_n_s_n;
2961 static PyObject *__pyx_n_s_name;
2962 static PyObject *__pyx_n_s_name_2;
2963 static PyObject *__pyx_n_s_nd;
2964 static PyObject *__pyx_n_s_ndim;
2965 static PyObject *__pyx_n_s_new;
2966 static PyObject *__pyx_kp_s_no_default___reduce___due_to_non;
2967 static PyObject *__pyx_n_s_np;
2968 static PyObject *__pyx_n_s_numpy;
2969 static PyObject *__pyx_kp_s_numpy_core_multiarray_failed_to;
2970 static PyObject *__pyx_kp_s_numpy_core_umath_failed_to_impor;
2971 static PyObject *__pyx_n_s_obj;
2972 static PyObject *__pyx_n_s_pack;
2973 static PyObject *__pyx_n_s_pickle;
2974 static PyObject *__pyx_n_s_proteus;
2975 static PyObject *__pyx_kp_s_proteus_BoundaryConditions_py;
2976 static PyObject *__pyx_n_s_pyx_PickleError;
2977 static PyObject *__pyx_n_s_pyx_checksum;
2978 static PyObject *__pyx_n_s_pyx_getbuffer;
2979 static PyObject *__pyx_n_s_pyx_result;
2980 static PyObject *__pyx_n_s_pyx_state;
2981 static PyObject *__pyx_n_s_pyx_type;
2982 static PyObject *__pyx_n_s_pyx_unpickle_BC_Base;
2983 static PyObject *__pyx_n_s_pyx_unpickle_Enum;
2984 static PyObject *__pyx_n_s_pyx_vtable;
2985 static PyObject *__pyx_n_s_range;
2986 static PyObject *__pyx_n_s_reduce;
2987 static PyObject *__pyx_n_s_reduce_cython;
2988 static PyObject *__pyx_n_s_reduce_ex;
2989 static PyObject *__pyx_n_s_resetBC;
2990 static PyObject *__pyx_n_s_self;
2991 static PyObject *__pyx_kp_s_self_uuOfXT_cannot_be_converted;
2992 static PyObject *__pyx_n_s_setConstantBC;
2993 static PyObject *__pyx_n_s_setConstantBC_locals_lambda;
2994 static PyObject *__pyx_n_s_setLinearBC;
2995 static PyObject *__pyx_n_s_setLinearBC_locals_lambda;
2996 static PyObject *__pyx_n_s_setLinearRamp;
2997 static PyObject *__pyx_n_s_setLinearRamp_locals_lambda;
2998 static PyObject *__pyx_n_s_setstate;
2999 static PyObject *__pyx_n_s_setstate_cython;
3000 static PyObject *__pyx_n_s_shape;
3001 static PyObject *__pyx_n_s_size;
3002 static PyObject *__pyx_n_s_start;
3003 static PyObject *__pyx_n_s_state;
3004 static PyObject *__pyx_n_s_step;
3005 static PyObject *__pyx_n_s_stop;
3006 static PyObject *__pyx_kp_s_strided_and_direct;
3007 static PyObject *__pyx_kp_s_strided_and_direct_or_indirect;
3008 static PyObject *__pyx_kp_s_strided_and_indirect;
3009 static PyObject *__pyx_kp_s_stringsource;
3010 static PyObject *__pyx_n_s_struct;
3011 static PyObject *__pyx_n_s_sum;
3012 static PyObject *__pyx_n_s_t;
3013 static PyObject *__pyx_n_s_t1;
3014 static PyObject *__pyx_n_s_test;
3015 static PyObject *__pyx_kp_s_unable_to_allocate_array_data;
3016 static PyObject *__pyx_kp_s_unable_to_allocate_shape_and_str;
3017 static PyObject *__pyx_n_s_unpack;
3018 static PyObject *__pyx_n_s_update;
3019 static PyObject *__pyx_n_s_use_setstate;
3020 static PyObject *__pyx_n_s_value;
3021 static PyObject *__pyx_n_s_x;
3022 static PyObject *__pyx_n_s_zeros;
3023 static int __pyx_pf_18BoundaryConditions_7BC_Base___init__(
struct __pyx_obj_18BoundaryConditions_BC_Base *__pyx_v_self, PyObject *__pyx_v_shape, PyObject *__pyx_v_name, PyObject *__pyx_v_b_or, PyObject *__pyx_v_b_i, PyObject *__pyx_v_nd);
3024 static PyObject *__pyx_pf_18BoundaryConditions_7BC_Base_2getContext(
struct __pyx_obj_18BoundaryConditions_BC_Base *__pyx_v_self, PyObject *__pyx_v_context);
3025 static PyObject *__pyx_pf_18BoundaryConditions_7BC_Base_2nd___get__(
struct __pyx_obj_18BoundaryConditions_BC_Base *__pyx_v_self);
3026 static int __pyx_pf_18BoundaryConditions_7BC_Base_2nd_2__set__(
struct __pyx_obj_18BoundaryConditions_BC_Base *__pyx_v_self, PyObject *__pyx_v_value);
3027 static PyObject *__pyx_pf_18BoundaryConditions_7BC_Base_5Shape___get__(
struct __pyx_obj_18BoundaryConditions_BC_Base *__pyx_v_self);
3028 static int __pyx_pf_18BoundaryConditions_7BC_Base_5Shape_2__set__(
struct __pyx_obj_18BoundaryConditions_BC_Base *__pyx_v_self, PyObject *__pyx_v_value);
3029 static int __pyx_pf_18BoundaryConditions_7BC_Base_5Shape_4__del__(
struct __pyx_obj_18BoundaryConditions_BC_Base *__pyx_v_self);
3030 static PyObject *__pyx_pf_18BoundaryConditions_7BC_Base_4name___get__(
struct __pyx_obj_18BoundaryConditions_BC_Base *__pyx_v_self);
3031 static int __pyx_pf_18BoundaryConditions_7BC_Base_4name_2__set__(
struct __pyx_obj_18BoundaryConditions_BC_Base *__pyx_v_self, PyObject *__pyx_v_value);
3032 static int __pyx_pf_18BoundaryConditions_7BC_Base_4name_4__del__(
struct __pyx_obj_18BoundaryConditions_BC_Base *__pyx_v_self);
3033 static PyObject *__pyx_pf_18BoundaryConditions_7BC_Base_7BC_type___get__(
struct __pyx_obj_18BoundaryConditions_BC_Base *__pyx_v_self);
3034 static int __pyx_pf_18BoundaryConditions_7BC_Base_7BC_type_2__set__(
struct __pyx_obj_18BoundaryConditions_BC_Base *__pyx_v_self, PyObject *__pyx_v_value);
3035 static int __pyx_pf_18BoundaryConditions_7BC_Base_7BC_type_4__del__(
struct __pyx_obj_18BoundaryConditions_BC_Base *__pyx_v_self);
3036 static PyObject *__pyx_pf_18BoundaryConditions_7BC_Base_2ct___get__(
struct __pyx_obj_18BoundaryConditions_BC_Base *__pyx_v_self);
3037 static int __pyx_pf_18BoundaryConditions_7BC_Base_2ct_2__set__(
struct __pyx_obj_18BoundaryConditions_BC_Base *__pyx_v_self, PyObject *__pyx_v_value);
3038 static int __pyx_pf_18BoundaryConditions_7BC_Base_2ct_4__del__(
struct __pyx_obj_18BoundaryConditions_BC_Base *__pyx_v_self);
3039 static PyObject *__pyx_pf_18BoundaryConditions_7BC_Base_4__reduce_cython__(
struct __pyx_obj_18BoundaryConditions_BC_Base *__pyx_v_self);
3040 static PyObject *__pyx_pf_18BoundaryConditions_7BC_Base_6__setstate_cython__(
struct __pyx_obj_18BoundaryConditions_BC_Base *__pyx_v_self, PyObject *__pyx_v___pyx_state);
3041 static int __pyx_pf_18BoundaryConditions_17BoundaryCondition___init__(
struct __pyx_obj_18BoundaryConditions_BoundaryCondition *__pyx_v_self);
3042 static PyObject *__pyx_pf_18BoundaryConditions_17BoundaryCondition_2init_cython(
struct __pyx_obj_18BoundaryConditions_BoundaryCondition *__pyx_v_self);
3043 static PyObject *__pyx_pf_18BoundaryConditions_17BoundaryCondition_4resetBC(
struct __pyx_obj_18BoundaryConditions_BoundaryCondition *__pyx_v_self);
3044 static PyObject *__pyx_pf_18BoundaryConditions_2__defaults__(CYTHON_UNUSED PyObject *__pyx_self);
3045 static PyObject *__pyx_lambda_funcdef_lambda(PyObject *__pyx_self, CYTHON_UNUSED PyObject *__pyx_v_x, CYTHON_UNUSED PyObject *__pyx_v_t, CYTHON_UNUSED PyObject *__pyx_v_n);
3046 static PyObject *__pyx_pf_18BoundaryConditions_17BoundaryCondition_6setConstantBC(
struct __pyx_obj_18BoundaryConditions_BoundaryCondition *__pyx_v_self, PyObject *__pyx_v_value);
3047 static PyObject *__pyx_pf_18BoundaryConditions_4__defaults__(CYTHON_UNUSED PyObject *__pyx_self);
3048 static PyObject *__pyx_lambda_funcdef_lambda1(PyObject *__pyx_self, PyObject *__pyx_v_x, CYTHON_UNUSED PyObject *__pyx_v_t, CYTHON_UNUSED PyObject *__pyx_v_n);
3049 static PyObject *__pyx_pf_18BoundaryConditions_17BoundaryCondition_8setLinearBC(
struct __pyx_obj_18BoundaryConditions_BoundaryCondition *__pyx_v_self, PyObject *__pyx_v_a0, PyObject *__pyx_v_a);
3050 static PyObject *__pyx_pf_18BoundaryConditions_6__defaults__(CYTHON_UNUSED PyObject *__pyx_self);
3051 static PyObject *__pyx_lambda_funcdef_lambda2(PyObject *__pyx_self, CYTHON_UNUSED PyObject *__pyx_v_x, PyObject *__pyx_v_t, CYTHON_UNUSED PyObject *__pyx_v_n);
3052 static PyObject *__pyx_pf_18BoundaryConditions_17BoundaryCondition_10setLinearRamp(
struct __pyx_obj_18BoundaryConditions_BoundaryCondition *__pyx_v_self, PyObject *__pyx_v_t1, PyObject *__pyx_v_value);
3053 static PyObject *__pyx_pf_18BoundaryConditions_17BoundaryCondition_5uOfXT___get__(
struct __pyx_obj_18BoundaryConditions_BoundaryCondition *__pyx_v_self);
3054 static int __pyx_pf_18BoundaryConditions_17BoundaryCondition_5uOfXT_2__set__(
struct __pyx_obj_18BoundaryConditions_BoundaryCondition *__pyx_v_self, PyObject *__pyx_v_value);
3055 static int __pyx_pf_18BoundaryConditions_17BoundaryCondition_5uOfXT_4__del__(
struct __pyx_obj_18BoundaryConditions_BoundaryCondition *__pyx_v_self);
3056 static PyObject *__pyx_pf_18BoundaryConditions_17BoundaryCondition_12__reduce_cython__(CYTHON_UNUSED
struct __pyx_obj_18BoundaryConditions_BoundaryCondition *__pyx_v_self);
3057 static PyObject *__pyx_pf_18BoundaryConditions_17BoundaryCondition_14__setstate_cython__(CYTHON_UNUSED
struct __pyx_obj_18BoundaryConditions_BoundaryCondition *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state);
3058 static PyObject *__pyx_pf_18BoundaryConditions___pyx_unpickle_BC_Base(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v___pyx_type,
long __pyx_v___pyx_checksum, PyObject *__pyx_v___pyx_state);
3059 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);
3060 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);
3061 static void __pyx_array___pyx_pf_15View_dot_MemoryView_5array_4__dealloc__(
struct __pyx_array_obj *__pyx_v_self);
3062 static PyObject *__pyx_pf_15View_dot_MemoryView_5array_7memview___get__(
struct __pyx_array_obj *__pyx_v_self);
3063 static Py_ssize_t __pyx_array___pyx_pf_15View_dot_MemoryView_5array_6__len__(
struct __pyx_array_obj *__pyx_v_self);
3064 static PyObject *__pyx_array___pyx_pf_15View_dot_MemoryView_5array_8__getattr__(
struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_attr);
3065 static PyObject *__pyx_array___pyx_pf_15View_dot_MemoryView_5array_10__getitem__(
struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_item);
3066 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);
3067 static PyObject *__pyx_pf___pyx_array___reduce_cython__(CYTHON_UNUSED
struct __pyx_array_obj *__pyx_v_self);
3068 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);
3069 static int __pyx_MemviewEnum___pyx_pf_15View_dot_MemoryView_4Enum___init__(
struct __pyx_MemviewEnum_obj *__pyx_v_self, PyObject *__pyx_v_name);
3070 static PyObject *__pyx_MemviewEnum___pyx_pf_15View_dot_MemoryView_4Enum_2__repr__(
struct __pyx_MemviewEnum_obj *__pyx_v_self);
3071 static PyObject *__pyx_pf___pyx_MemviewEnum___reduce_cython__(
struct __pyx_MemviewEnum_obj *__pyx_v_self);
3072 static PyObject *__pyx_pf___pyx_MemviewEnum_2__setstate_cython__(
struct __pyx_MemviewEnum_obj *__pyx_v_self, PyObject *__pyx_v___pyx_state);
3073 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);
3074 static void __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_2__dealloc__(
struct __pyx_memoryview_obj *__pyx_v_self);
3075 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_4__getitem__(
struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index);
3076 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);
3077 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);
3078 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_1T___get__(
struct __pyx_memoryview_obj *__pyx_v_self);
3079 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_4base___get__(
struct __pyx_memoryview_obj *__pyx_v_self);
3080 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_5shape___get__(
struct __pyx_memoryview_obj *__pyx_v_self);
3081 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_7strides___get__(
struct __pyx_memoryview_obj *__pyx_v_self);
3082 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_10suboffsets___get__(
struct __pyx_memoryview_obj *__pyx_v_self);
3083 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_4ndim___get__(
struct __pyx_memoryview_obj *__pyx_v_self);
3084 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_8itemsize___get__(
struct __pyx_memoryview_obj *__pyx_v_self);
3085 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_6nbytes___get__(
struct __pyx_memoryview_obj *__pyx_v_self);
3086 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_4size___get__(
struct __pyx_memoryview_obj *__pyx_v_self);
3087 static Py_ssize_t __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_10__len__(
struct __pyx_memoryview_obj *__pyx_v_self);
3088 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_12__repr__(
struct __pyx_memoryview_obj *__pyx_v_self);
3089 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_14__str__(
struct __pyx_memoryview_obj *__pyx_v_self);
3090 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_16is_c_contig(
struct __pyx_memoryview_obj *__pyx_v_self);
3091 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_18is_f_contig(
struct __pyx_memoryview_obj *__pyx_v_self);
3092 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_20copy(
struct __pyx_memoryview_obj *__pyx_v_self);
3093 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_22copy_fortran(
struct __pyx_memoryview_obj *__pyx_v_self);
3094 static PyObject *__pyx_pf___pyx_memoryview___reduce_cython__(CYTHON_UNUSED
struct __pyx_memoryview_obj *__pyx_v_self);
3095 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);
3096 static void __pyx_memoryviewslice___pyx_pf_15View_dot_MemoryView_16_memoryviewslice___dealloc__(
struct __pyx_memoryviewslice_obj *__pyx_v_self);
3097 static PyObject *__pyx_pf_15View_dot_MemoryView_16_memoryviewslice_4base___get__(
struct __pyx_memoryviewslice_obj *__pyx_v_self);
3098 static PyObject *__pyx_pf___pyx_memoryviewslice___reduce_cython__(CYTHON_UNUSED
struct __pyx_memoryviewslice_obj *__pyx_v_self);
3099 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);
3100 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);
3101 static PyObject *__pyx_tp_new_18BoundaryConditions_BC_Base(PyTypeObject *t, PyObject *a, PyObject *k);
3102 static PyObject *__pyx_tp_new_18BoundaryConditions_BoundaryCondition(PyTypeObject *t, PyObject *a, PyObject *k);
3103 static PyObject *__pyx_tp_new_18BoundaryConditions___pyx_scope_struct__setConstantBC(PyTypeObject *t, PyObject *a, PyObject *k);
3104 static PyObject *__pyx_tp_new_18BoundaryConditions___pyx_scope_struct_1_setLinearBC(PyTypeObject *t, PyObject *a, PyObject *k);
3105 static PyObject *__pyx_tp_new_18BoundaryConditions___pyx_scope_struct_2_setLinearRamp(PyTypeObject *t, PyObject *a, PyObject *k);
3106 static PyObject *__pyx_tp_new_array(PyTypeObject *t, PyObject *a, PyObject *k);
3107 static PyObject *__pyx_tp_new_Enum(PyTypeObject *t, PyObject *a, PyObject *k);
3108 static PyObject *__pyx_tp_new_memoryview(PyTypeObject *t, PyObject *a, PyObject *k);
3109 static PyObject *__pyx_tp_new__memoryviewslice(PyTypeObject *t, PyObject *a, PyObject *k);
3110 static PyObject *__pyx_int_0;
3111 static PyObject *__pyx_int_1;
3112 static PyObject *__pyx_int_3;
3113 static PyObject *__pyx_int_81007987;
3114 static PyObject *__pyx_int_112105877;
3115 static PyObject *__pyx_int_131364769;
3116 static PyObject *__pyx_int_136983863;
3117 static PyObject *__pyx_int_158231071;
3118 static PyObject *__pyx_int_184977713;
3119 static PyObject *__pyx_int_neg_1;
3120 static PyObject *__pyx_codeobj_;
3121 static PyObject *__pyx_slice__7;
3122 static PyObject *__pyx_tuple__11;
3123 static PyObject *__pyx_tuple__13;
3124 static PyObject *__pyx_tuple__15;
3125 static PyObject *__pyx_tuple__16;
3126 static PyObject *__pyx_tuple__17;
3127 static PyObject *__pyx_tuple__18;
3128 static PyObject *__pyx_tuple__19;
3129 static PyObject *__pyx_tuple__20;
3130 static PyObject *__pyx_tuple__21;
3131 static PyObject *__pyx_tuple__22;
3132 static PyObject *__pyx_tuple__23;
3133 static PyObject *__pyx_tuple__24;
3134 static PyObject *__pyx_tuple__25;
3135 static PyObject *__pyx_tuple__26;
3136 static PyObject *__pyx_tuple__27;
3137 static PyObject *__pyx_tuple__28;
3138 static PyObject *__pyx_tuple__29;
3139 static PyObject *__pyx_tuple__30;
3140 static PyObject *__pyx_tuple__31;
3141 static PyObject *__pyx_tuple__32;
3142 static PyObject *__pyx_tuple__33;
3143 static PyObject *__pyx_tuple__34;
3144 static PyObject *__pyx_tuple__36;
3145 static PyObject *__pyx_tuple__37;
3146 static PyObject *__pyx_tuple__38;
3147 static PyObject *__pyx_tuple__39;
3148 static PyObject *__pyx_tuple__40;
3149 static PyObject *__pyx_tuple__41;
3150 static PyObject *__pyx_tuple__42;
3151 static PyObject *__pyx_tuple__43;
3152 static PyObject *__pyx_tuple__44;
3153 static PyObject *__pyx_tuple__45;
3154 static PyObject *__pyx_tuple__46;
3155 static PyObject *__pyx_tuple__47;
3156 static PyObject *__pyx_tuple__48;
3157 static PyObject *__pyx_tuple__49;
3158 static PyObject *__pyx_tuple__50;
3159 static PyObject *__pyx_tuple__51;
3160 static PyObject *__pyx_tuple__52;
3161 static PyObject *__pyx_tuple__53;
3162 static PyObject *__pyx_codeobj__2;
3163 static PyObject *__pyx_codeobj__3;
3164 static PyObject *__pyx_codeobj__4;
3165 static PyObject *__pyx_codeobj__5;
3166 static PyObject *__pyx_codeobj__6;
3167 static PyObject *__pyx_codeobj__8;
3168 static PyObject *__pyx_codeobj__9;
3169 static PyObject *__pyx_codeobj__10;
3170 static PyObject *__pyx_codeobj__12;
3171 static PyObject *__pyx_codeobj__14;
3172 static PyObject *__pyx_codeobj__35;
3184 static int __pyx_pw_18BoundaryConditions_7BC_Base_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
3185 static int __pyx_pw_18BoundaryConditions_7BC_Base_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
3186 PyObject *__pyx_v_shape = 0;
3187 PyObject *__pyx_v_name = 0;
3188 PyObject *__pyx_v_b_or = 0;
3189 PyObject *__pyx_v_b_i = 0;
3190 PyObject *__pyx_v_nd = 0;
3191 int __pyx_lineno = 0;
3192 const char *__pyx_filename = NULL;
3193 int __pyx_clineno = 0;
3195 __Pyx_RefNannyDeclarations
3196 __Pyx_RefNannySetupContext(
"__init__ (wrapper)", 0);
3198 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_shape,&__pyx_n_s_name,&__pyx_n_s_b_or,&__pyx_n_s_b_i,&__pyx_n_s_nd,0};
3199 PyObject* values[5] = {0,0,0,0,0};
3200 values[0] = ((PyObject *)Py_None);
3201 values[1] = ((PyObject *)Py_None);
3202 values[2] = ((PyObject *)Py_None);
3203 values[3] = ((PyObject *)__pyx_int_0);
3204 values[4] = ((PyObject *)Py_None);
3205 if (unlikely(__pyx_kwds)) {
3207 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
3209 case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
3211 case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
3213 case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
3215 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
3217 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
3220 default:
goto __pyx_L5_argtuple_error;
3222 kw_args = PyDict_Size(__pyx_kwds);
3226 PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_shape);
3227 if (value) { values[0] = value; kw_args--; }
3232 PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_name);
3233 if (value) { values[1] = value; kw_args--; }
3238 PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_b_or);
3239 if (value) { values[2] = value; kw_args--; }
3244 PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_b_i);
3245 if (value) { values[3] = value; kw_args--; }
3250 PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_nd);
3251 if (value) { values[4] = value; kw_args--; }
3254 if (unlikely(kw_args > 0)) {
3255 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args,
"__init__") < 0)) __PYX_ERR(0, 24, __pyx_L3_error)
3258 switch (PyTuple_GET_SIZE(__pyx_args)) {
3259 case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
3261 case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
3263 case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
3265 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
3267 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
3270 default:
goto __pyx_L5_argtuple_error;
3273 __pyx_v_shape = values[0];
3274 __pyx_v_name = values[1];
3275 __pyx_v_b_or = values[2];
3276 __pyx_v_b_i = values[3];
3277 __pyx_v_nd = values[4];
3279 goto __pyx_L4_argument_unpacking_done;
3280 __pyx_L5_argtuple_error:;
3281 __Pyx_RaiseArgtupleInvalid(
"__init__", 0, 0, 5, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 24, __pyx_L3_error)
3283 __Pyx_AddTraceback(
"BoundaryConditions.BC_Base.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
3284 __Pyx_RefNannyFinishContext();
3286 __pyx_L4_argument_unpacking_done:;
3287 __pyx_r = __pyx_pf_18BoundaryConditions_7BC_Base___init__(((
struct __pyx_obj_18BoundaryConditions_BC_Base *)__pyx_v_self), __pyx_v_shape, __pyx_v_name, __pyx_v_b_or, __pyx_v_b_i, __pyx_v_nd);
3290 __Pyx_RefNannyFinishContext();
3294 static int __pyx_pf_18BoundaryConditions_7BC_Base___init__(
struct __pyx_obj_18BoundaryConditions_BC_Base *__pyx_v_self, PyObject *__pyx_v_shape, PyObject *__pyx_v_name, PyObject *__pyx_v_b_or, PyObject *__pyx_v_b_i, PyObject *__pyx_v_nd) {
3296 __Pyx_TraceDeclarations
3297 __Pyx_RefNannyDeclarations
3298 PyObject *__pyx_t_1 = NULL;
3301 PyObject *__pyx_t_4 = NULL;
3303 __Pyx_memviewslice __pyx_t_6 = { 0, 0, { 0 }, { 0 }, { 0 } };
3304 int __pyx_lineno = 0;
3305 const char *__pyx_filename = NULL;
3306 int __pyx_clineno = 0;
3307 __Pyx_RefNannySetupContext(
"__init__", 0);
3308 __Pyx_TraceCall(
"__init__", __pyx_f[0], 24, 0, __PYX_ERR(0, 24, __pyx_L1_error));
3317 __Pyx_INCREF(__pyx_v_shape);
3318 __Pyx_GIVEREF(__pyx_v_shape);
3319 __Pyx_GOTREF(__pyx_v_self->Shape);
3320 __Pyx_DECREF(__pyx_v_self->Shape);
3321 __pyx_v_self->Shape = __pyx_v_shape;
3330 if (!(likely(PyString_CheckExact(__pyx_v_name))||((__pyx_v_name) == Py_None)||(PyErr_Format(PyExc_TypeError,
"Expected %.16s, got %.200s",
"str", Py_TYPE(__pyx_v_name)->tp_name), 0))) __PYX_ERR(0, 26, __pyx_L1_error)
3331 __pyx_t_1 = __pyx_v_name;
3332 __Pyx_INCREF(__pyx_t_1);
3333 __Pyx_GIVEREF(__pyx_t_1);
3334 __Pyx_GOTREF(__pyx_v_self->name);
3335 __Pyx_DECREF(__pyx_v_self->name);
3336 __pyx_v_self->name = ((PyObject*)__pyx_t_1);
3346 __Pyx_INCREF(__pyx_n_s_None);
3347 __Pyx_GIVEREF(__pyx_n_s_None);
3348 __Pyx_GOTREF(__pyx_v_self->BC_type);
3349 __Pyx_DECREF(__pyx_v_self->BC_type);
3350 __pyx_v_self->BC_type = __pyx_n_s_None;
3359 __pyx_t_2 = (__pyx_v_shape != Py_None);
3360 __pyx_t_3 = (__pyx_t_2 != 0);
3370 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->Shape, __pyx_n_s_Domain);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 29, __pyx_L1_error)
3371 __Pyx_GOTREF(__pyx_t_1);
3372 __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_nd);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 29, __pyx_L1_error)
3373 __Pyx_GOTREF(__pyx_t_4);
3374 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
3375 __pyx_t_5 = __Pyx_PyInt_As_int(__pyx_t_4);
if (unlikely((__pyx_t_5 == (
int)-1) && PyErr_Occurred())) __PYX_ERR(0, 29, __pyx_L1_error)
3376 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
3377 __pyx_v_self->nd = __pyx_t_5;
3396 __pyx_t_3 = (__pyx_v_nd != Py_None);
3397 __pyx_t_2 = (__pyx_t_3 != 0);
3407 __pyx_t_5 = __Pyx_PyInt_As_int(__pyx_v_nd);
if (unlikely((__pyx_t_5 == (
int)-1) && PyErr_Occurred())) __PYX_ERR(0, 31, __pyx_L1_error)
3408 __pyx_v_self->nd = __pyx_t_5;
3428 #ifndef CYTHON_WITHOUT_ASSERTIONS
3429 if (unlikely(!Py_OptimizeFlag)) {
3430 __pyx_t_2 = (__pyx_v_nd != Py_None);
3431 if (unlikely(!(__pyx_t_2 != 0))) {
3432 PyErr_SetObject(PyExc_AssertionError, __pyx_kp_s_Shape_or_nd_must_be_passed_to_BC);
3433 __PYX_ERR(0, 33, __pyx_L1_error)
3447 __pyx_t_2 = (__pyx_v_b_or != Py_None);
3448 __pyx_t_3 = (__pyx_t_2 != 0);
3458 __pyx_t_4 = __Pyx_PyObject_GetItem(__pyx_v_b_or, __pyx_v_b_i);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 35, __pyx_L1_error)
3459 __Pyx_GOTREF(__pyx_t_4);
3460 __pyx_t_6 = __Pyx_PyObject_to_MemoryviewSlice_ds_double(__pyx_t_4, PyBUF_WRITABLE);
if (unlikely(!__pyx_t_6.memview)) __PYX_ERR(0, 35, __pyx_L1_error)
3461 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
3462 __PYX_XDEC_MEMVIEW(&__pyx_v_self->_b_or, 0);
3463 __pyx_v_self->_b_or = __pyx_t_6;
3464 __pyx_t_6.memview = NULL;
3465 __pyx_t_6.data = NULL;
3485 __pyx_t_6 = __Pyx_PyObject_to_MemoryviewSlice_ds_double(Py_None, PyBUF_WRITABLE);
if (unlikely(!__pyx_t_6.memview)) __PYX_ERR(0, 37, __pyx_L1_error)
3486 __PYX_XDEC_MEMVIEW(&__pyx_v_self->_b_or, 0);
3487 __pyx_v_self->_b_or = __pyx_t_6;
3488 __pyx_t_6.memview = NULL;
3489 __pyx_t_6.data = NULL;
3505 __Pyx_XDECREF(__pyx_t_1);
3506 __Pyx_XDECREF(__pyx_t_4);
3507 __PYX_XDEC_MEMVIEW(&__pyx_t_6, 1);
3508 __Pyx_AddTraceback(
"BoundaryConditions.BC_Base.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
3511 __Pyx_TraceReturn(Py_None, 0);
3512 __Pyx_RefNannyFinishContext();
3525 static PyObject *__pyx_pw_18BoundaryConditions_7BC_Base_3getContext(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
3526 static char __pyx_doc_18BoundaryConditions_7BC_Base_2getContext[] =
"BC_Base.getContext(self, context=None)\n\n Gets context from proteus.Context or\n\n Parameters\n ----------\n context: class, optional\n if set to None, the context will be created from proteus.Context\n ";
3527 static PyMethodDef __pyx_mdef_18BoundaryConditions_7BC_Base_3getContext = {
"getContext", (PyCFunction)(
void*)(PyCFunctionWithKeywords)__pyx_pw_18BoundaryConditions_7BC_Base_3getContext, METH_VARARGS|METH_KEYWORDS, __pyx_doc_18BoundaryConditions_7BC_Base_2getContext};
3528 static PyObject *__pyx_pw_18BoundaryConditions_7BC_Base_3getContext(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
3529 PyObject *__pyx_v_context = 0;
3530 int __pyx_lineno = 0;
3531 const char *__pyx_filename = NULL;
3532 int __pyx_clineno = 0;
3533 PyObject *__pyx_r = 0;
3534 __Pyx_RefNannyDeclarations
3535 __Pyx_RefNannySetupContext(
"getContext (wrapper)", 0);
3537 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_context,0};
3538 PyObject* values[1] = {0};
3539 values[0] = ((PyObject *)Py_None);
3540 if (unlikely(__pyx_kwds)) {
3542 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
3544 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
3547 default:
goto __pyx_L5_argtuple_error;
3549 kw_args = PyDict_Size(__pyx_kwds);
3553 PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_context);
3554 if (value) { values[0] = value; kw_args--; }
3557 if (unlikely(kw_args > 0)) {
3558 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args,
"getContext") < 0)) __PYX_ERR(0, 52, __pyx_L3_error)
3561 switch (PyTuple_GET_SIZE(__pyx_args)) {
3562 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
3565 default:
goto __pyx_L5_argtuple_error;
3568 __pyx_v_context = values[0];
3570 goto __pyx_L4_argument_unpacking_done;
3571 __pyx_L5_argtuple_error:;
3572 __Pyx_RaiseArgtupleInvalid(
"getContext", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 52, __pyx_L3_error)
3574 __Pyx_AddTraceback(
"BoundaryConditions.BC_Base.getContext", __pyx_clineno, __pyx_lineno, __pyx_filename);
3575 __Pyx_RefNannyFinishContext();
3577 __pyx_L4_argument_unpacking_done:;
3578 __pyx_r = __pyx_pf_18BoundaryConditions_7BC_Base_2getContext(((
struct __pyx_obj_18BoundaryConditions_BC_Base *)__pyx_v_self), __pyx_v_context);
3581 __Pyx_RefNannyFinishContext();
3585 static PyObject *__pyx_pf_18BoundaryConditions_7BC_Base_2getContext(
struct __pyx_obj_18BoundaryConditions_BC_Base *__pyx_v_self, PyObject *__pyx_v_context) {
3586 PyObject *__pyx_v_Context = NULL;
3587 PyObject *__pyx_r = NULL;
3588 __Pyx_TraceDeclarations
3589 __Pyx_RefNannyDeclarations
3591 PyObject *__pyx_t_2 = NULL;
3592 PyObject *__pyx_t_3 = NULL;
3593 PyObject *__pyx_t_4 = NULL;
3594 int __pyx_lineno = 0;
3595 const char *__pyx_filename = NULL;
3596 int __pyx_clineno = 0;
3597 __Pyx_TraceFrameInit(__pyx_codeobj_)
3598 __Pyx_RefNannySetupContext(
"getContext", 0);
3599 __Pyx_TraceCall(
"getContext", __pyx_f[0], 52, 0, __PYX_ERR(0, 52, __pyx_L1_error));
3608 __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_context);
if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 61, __pyx_L1_error)
3618 __pyx_t_2 = PyList_New(1);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 62, __pyx_L1_error)
3619 __Pyx_GOTREF(__pyx_t_2);
3620 __Pyx_INCREF(__pyx_n_s_Context);
3621 __Pyx_GIVEREF(__pyx_n_s_Context);
3622 PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_Context);
3623 __pyx_t_3 = __Pyx_Import(__pyx_n_s_proteus, __pyx_t_2, -1);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 62, __pyx_L1_error)
3624 __Pyx_GOTREF(__pyx_t_3);
3625 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
3626 __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_3, __pyx_n_s_Context);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 62, __pyx_L1_error)
3627 __Pyx_GOTREF(__pyx_t_2);
3628 __Pyx_INCREF(__pyx_t_2);
3629 __pyx_v_Context = __pyx_t_2;
3630 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
3631 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
3640 __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_Context, __pyx_n_s_get);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 63, __pyx_L1_error)
3641 __Pyx_GOTREF(__pyx_t_2);
3643 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
3644 __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2);
3645 if (likely(__pyx_t_4)) {
3646 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_2);
3647 __Pyx_INCREF(__pyx_t_4);
3648 __Pyx_INCREF(
function);
3649 __Pyx_DECREF_SET(__pyx_t_2,
function);
3652 __pyx_t_3 = (__pyx_t_4) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_4) : __Pyx_PyObject_CallNoArg(__pyx_t_2);
3653 __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
3654 if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 63, __pyx_L1_error)
3655 __Pyx_GOTREF(__pyx_t_3);
3656 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
3657 __Pyx_GIVEREF(__pyx_t_3);
3658 __Pyx_GOTREF(__pyx_v_self->ct);
3659 __Pyx_DECREF(__pyx_v_self->ct);
3660 __pyx_v_self->ct = __pyx_t_3;
3681 __Pyx_INCREF(__pyx_v_context);
3682 __Pyx_GIVEREF(__pyx_v_context);
3683 __Pyx_GOTREF(__pyx_v_self->ct);
3684 __Pyx_DECREF(__pyx_v_self->ct);
3685 __pyx_v_self->ct = __pyx_v_context;
3698 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
3701 __Pyx_XDECREF(__pyx_t_2);
3702 __Pyx_XDECREF(__pyx_t_3);
3703 __Pyx_XDECREF(__pyx_t_4);
3704 __Pyx_AddTraceback(
"BoundaryConditions.BC_Base.getContext", __pyx_clineno, __pyx_lineno, __pyx_filename);
3707 __Pyx_XDECREF(__pyx_v_Context);
3708 __Pyx_XGIVEREF(__pyx_r);
3709 __Pyx_TraceReturn(__pyx_r, 0);
3710 __Pyx_RefNannyFinishContext();
3723 static PyObject *__pyx_pw_18BoundaryConditions_7BC_Base_2nd_1__get__(PyObject *__pyx_v_self);
3724 static PyObject *__pyx_pw_18BoundaryConditions_7BC_Base_2nd_1__get__(PyObject *__pyx_v_self) {
3725 PyObject *__pyx_r = 0;
3726 __Pyx_RefNannyDeclarations
3727 __Pyx_RefNannySetupContext(
"__get__ (wrapper)", 0);
3728 __pyx_r = __pyx_pf_18BoundaryConditions_7BC_Base_2nd___get__(((
struct __pyx_obj_18BoundaryConditions_BC_Base *)__pyx_v_self));
3731 __Pyx_RefNannyFinishContext();
3735 static PyObject *__pyx_pf_18BoundaryConditions_7BC_Base_2nd___get__(
struct __pyx_obj_18BoundaryConditions_BC_Base *__pyx_v_self) {
3736 PyObject *__pyx_r = NULL;
3737 __Pyx_TraceDeclarations
3738 __Pyx_RefNannyDeclarations
3739 PyObject *__pyx_t_1 = NULL;
3740 int __pyx_lineno = 0;
3741 const char *__pyx_filename = NULL;
3742 int __pyx_clineno = 0;
3743 __Pyx_RefNannySetupContext(
"__get__", 0);
3744 __Pyx_TraceCall(
"__get__", __pyx_f[2], 8, 0, __PYX_ERR(2, 8, __pyx_L1_error));
3745 __Pyx_XDECREF(__pyx_r);
3746 __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->nd);
if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 8, __pyx_L1_error)
3747 __Pyx_GOTREF(__pyx_t_1);
3748 __pyx_r = __pyx_t_1;
3754 __Pyx_XDECREF(__pyx_t_1);
3755 __Pyx_AddTraceback(
"BoundaryConditions.BC_Base.nd.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
3758 __Pyx_XGIVEREF(__pyx_r);
3759 __Pyx_TraceReturn(__pyx_r, 0);
3760 __Pyx_RefNannyFinishContext();
3765 static int __pyx_pw_18BoundaryConditions_7BC_Base_2nd_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value);
3766 static int __pyx_pw_18BoundaryConditions_7BC_Base_2nd_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
3768 __Pyx_RefNannyDeclarations
3769 __Pyx_RefNannySetupContext(
"__set__ (wrapper)", 0);
3770 __pyx_r = __pyx_pf_18BoundaryConditions_7BC_Base_2nd_2__set__(((
struct __pyx_obj_18BoundaryConditions_BC_Base *)__pyx_v_self), ((PyObject *)__pyx_v_value));
3773 __Pyx_RefNannyFinishContext();
3777 static int __pyx_pf_18BoundaryConditions_7BC_Base_2nd_2__set__(
struct __pyx_obj_18BoundaryConditions_BC_Base *__pyx_v_self, PyObject *__pyx_v_value) {
3779 __Pyx_TraceDeclarations
3780 __Pyx_RefNannyDeclarations
3782 int __pyx_lineno = 0;
3783 const char *__pyx_filename = NULL;
3784 int __pyx_clineno = 0;
3785 __Pyx_RefNannySetupContext(
"__set__", 0);
3786 __Pyx_TraceCall(
"__set__", __pyx_f[2], 8, 0, __PYX_ERR(2, 8, __pyx_L1_error));
3787 __pyx_t_1 = __Pyx_PyInt_As_int(__pyx_v_value);
if (unlikely((__pyx_t_1 == (
int)-1) && PyErr_Occurred())) __PYX_ERR(2, 8, __pyx_L1_error)
3788 __pyx_v_self->nd = __pyx_t_1;
3794 __Pyx_AddTraceback(
"BoundaryConditions.BC_Base.nd.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
3797 __Pyx_TraceReturn(Py_None, 0);
3798 __Pyx_RefNannyFinishContext();
3811 static PyObject *__pyx_pw_18BoundaryConditions_7BC_Base_5Shape_1__get__(PyObject *__pyx_v_self);
3812 static PyObject *__pyx_pw_18BoundaryConditions_7BC_Base_5Shape_1__get__(PyObject *__pyx_v_self) {
3813 PyObject *__pyx_r = 0;
3814 __Pyx_RefNannyDeclarations
3815 __Pyx_RefNannySetupContext(
"__get__ (wrapper)", 0);
3816 __pyx_r = __pyx_pf_18BoundaryConditions_7BC_Base_5Shape___get__(((
struct __pyx_obj_18BoundaryConditions_BC_Base *)__pyx_v_self));
3819 __Pyx_RefNannyFinishContext();
3823 static PyObject *__pyx_pf_18BoundaryConditions_7BC_Base_5Shape___get__(
struct __pyx_obj_18BoundaryConditions_BC_Base *__pyx_v_self) {
3824 PyObject *__pyx_r = NULL;
3825 __Pyx_TraceDeclarations
3826 __Pyx_RefNannyDeclarations
3827 int __pyx_lineno = 0;
3828 const char *__pyx_filename = NULL;
3829 int __pyx_clineno = 0;
3830 __Pyx_RefNannySetupContext(
"__get__", 0);
3831 __Pyx_TraceCall(
"__get__", __pyx_f[2], 9, 0, __PYX_ERR(2, 9, __pyx_L1_error));
3832 __Pyx_XDECREF(__pyx_r);
3833 __Pyx_INCREF(__pyx_v_self->Shape);
3834 __pyx_r = __pyx_v_self->Shape;
3839 __Pyx_AddTraceback(
"BoundaryConditions.BC_Base.Shape.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
3842 __Pyx_XGIVEREF(__pyx_r);
3843 __Pyx_TraceReturn(__pyx_r, 0);
3844 __Pyx_RefNannyFinishContext();
3849 static int __pyx_pw_18BoundaryConditions_7BC_Base_5Shape_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value);
3850 static int __pyx_pw_18BoundaryConditions_7BC_Base_5Shape_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
3852 __Pyx_RefNannyDeclarations
3853 __Pyx_RefNannySetupContext(
"__set__ (wrapper)", 0);
3854 __pyx_r = __pyx_pf_18BoundaryConditions_7BC_Base_5Shape_2__set__(((
struct __pyx_obj_18BoundaryConditions_BC_Base *)__pyx_v_self), ((PyObject *)__pyx_v_value));
3857 __Pyx_RefNannyFinishContext();
3861 static int __pyx_pf_18BoundaryConditions_7BC_Base_5Shape_2__set__(
struct __pyx_obj_18BoundaryConditions_BC_Base *__pyx_v_self, PyObject *__pyx_v_value) {
3863 __Pyx_TraceDeclarations
3864 __Pyx_RefNannyDeclarations
3865 int __pyx_lineno = 0;
3866 const char *__pyx_filename = NULL;
3867 int __pyx_clineno = 0;
3868 __Pyx_RefNannySetupContext(
"__set__", 0);
3869 __Pyx_TraceCall(
"__set__", __pyx_f[2], 9, 0, __PYX_ERR(2, 9, __pyx_L1_error));
3870 __Pyx_INCREF(__pyx_v_value);
3871 __Pyx_GIVEREF(__pyx_v_value);
3872 __Pyx_GOTREF(__pyx_v_self->Shape);
3873 __Pyx_DECREF(__pyx_v_self->Shape);
3874 __pyx_v_self->Shape = __pyx_v_value;
3880 __Pyx_AddTraceback(
"BoundaryConditions.BC_Base.Shape.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
3883 __Pyx_TraceReturn(Py_None, 0);
3884 __Pyx_RefNannyFinishContext();
3889 static int __pyx_pw_18BoundaryConditions_7BC_Base_5Shape_5__del__(PyObject *__pyx_v_self);
3890 static int __pyx_pw_18BoundaryConditions_7BC_Base_5Shape_5__del__(PyObject *__pyx_v_self) {
3892 __Pyx_RefNannyDeclarations
3893 __Pyx_RefNannySetupContext(
"__del__ (wrapper)", 0);
3894 __pyx_r = __pyx_pf_18BoundaryConditions_7BC_Base_5Shape_4__del__(((
struct __pyx_obj_18BoundaryConditions_BC_Base *)__pyx_v_self));
3897 __Pyx_RefNannyFinishContext();
3901 static int __pyx_pf_18BoundaryConditions_7BC_Base_5Shape_4__del__(
struct __pyx_obj_18BoundaryConditions_BC_Base *__pyx_v_self) {
3903 __Pyx_TraceDeclarations
3904 __Pyx_RefNannyDeclarations
3905 int __pyx_lineno = 0;
3906 const char *__pyx_filename = NULL;
3907 int __pyx_clineno = 0;
3908 __Pyx_RefNannySetupContext(
"__del__", 0);
3909 __Pyx_TraceCall(
"__del__", __pyx_f[2], 9, 0, __PYX_ERR(2, 9, __pyx_L1_error));
3910 __Pyx_INCREF(Py_None);
3911 __Pyx_GIVEREF(Py_None);
3912 __Pyx_GOTREF(__pyx_v_self->Shape);
3913 __Pyx_DECREF(__pyx_v_self->Shape);
3914 __pyx_v_self->Shape = Py_None;
3920 __Pyx_AddTraceback(
"BoundaryConditions.BC_Base.Shape.__del__", __pyx_clineno, __pyx_lineno, __pyx_filename);
3923 __Pyx_TraceReturn(Py_None, 0);
3924 __Pyx_RefNannyFinishContext();
3937 static PyObject *__pyx_pw_18BoundaryConditions_7BC_Base_4name_1__get__(PyObject *__pyx_v_self);
3938 static PyObject *__pyx_pw_18BoundaryConditions_7BC_Base_4name_1__get__(PyObject *__pyx_v_self) {
3939 PyObject *__pyx_r = 0;
3940 __Pyx_RefNannyDeclarations
3941 __Pyx_RefNannySetupContext(
"__get__ (wrapper)", 0);
3942 __pyx_r = __pyx_pf_18BoundaryConditions_7BC_Base_4name___get__(((
struct __pyx_obj_18BoundaryConditions_BC_Base *)__pyx_v_self));
3945 __Pyx_RefNannyFinishContext();
3949 static PyObject *__pyx_pf_18BoundaryConditions_7BC_Base_4name___get__(
struct __pyx_obj_18BoundaryConditions_BC_Base *__pyx_v_self) {
3950 PyObject *__pyx_r = NULL;
3951 __Pyx_TraceDeclarations
3952 __Pyx_RefNannyDeclarations
3953 int __pyx_lineno = 0;
3954 const char *__pyx_filename = NULL;
3955 int __pyx_clineno = 0;
3956 __Pyx_RefNannySetupContext(
"__get__", 0);
3957 __Pyx_TraceCall(
"__get__", __pyx_f[2], 10, 0, __PYX_ERR(2, 10, __pyx_L1_error));
3958 __Pyx_XDECREF(__pyx_r);
3959 __Pyx_INCREF(__pyx_v_self->name);
3960 __pyx_r = __pyx_v_self->name;
3965 __Pyx_AddTraceback(
"BoundaryConditions.BC_Base.name.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
3968 __Pyx_XGIVEREF(__pyx_r);
3969 __Pyx_TraceReturn(__pyx_r, 0);
3970 __Pyx_RefNannyFinishContext();
3975 static int __pyx_pw_18BoundaryConditions_7BC_Base_4name_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value);
3976 static int __pyx_pw_18BoundaryConditions_7BC_Base_4name_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
3978 __Pyx_RefNannyDeclarations
3979 __Pyx_RefNannySetupContext(
"__set__ (wrapper)", 0);
3980 __pyx_r = __pyx_pf_18BoundaryConditions_7BC_Base_4name_2__set__(((
struct __pyx_obj_18BoundaryConditions_BC_Base *)__pyx_v_self), ((PyObject *)__pyx_v_value));
3983 __Pyx_RefNannyFinishContext();
3987 static int __pyx_pf_18BoundaryConditions_7BC_Base_4name_2__set__(
struct __pyx_obj_18BoundaryConditions_BC_Base *__pyx_v_self, PyObject *__pyx_v_value) {
3989 __Pyx_TraceDeclarations
3990 __Pyx_RefNannyDeclarations
3991 PyObject *__pyx_t_1 = NULL;
3992 int __pyx_lineno = 0;
3993 const char *__pyx_filename = NULL;
3994 int __pyx_clineno = 0;
3995 __Pyx_RefNannySetupContext(
"__set__", 0);
3996 __Pyx_TraceCall(
"__set__", __pyx_f[2], 10, 0, __PYX_ERR(2, 10, __pyx_L1_error));
3997 if (!(likely(PyString_CheckExact(__pyx_v_value))||((__pyx_v_value) == Py_None)||(PyErr_Format(PyExc_TypeError,
"Expected %.16s, got %.200s",
"str", Py_TYPE(__pyx_v_value)->tp_name), 0))) __PYX_ERR(2, 10, __pyx_L1_error)
3998 __pyx_t_1 = __pyx_v_value;
3999 __Pyx_INCREF(__pyx_t_1);
4000 __Pyx_GIVEREF(__pyx_t_1);
4001 __Pyx_GOTREF(__pyx_v_self->name);
4002 __Pyx_DECREF(__pyx_v_self->name);
4003 __pyx_v_self->name = ((PyObject*)__pyx_t_1);
4010 __Pyx_XDECREF(__pyx_t_1);
4011 __Pyx_AddTraceback(
"BoundaryConditions.BC_Base.name.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
4014 __Pyx_TraceReturn(Py_None, 0);
4015 __Pyx_RefNannyFinishContext();
4020 static int __pyx_pw_18BoundaryConditions_7BC_Base_4name_5__del__(PyObject *__pyx_v_self);
4021 static int __pyx_pw_18BoundaryConditions_7BC_Base_4name_5__del__(PyObject *__pyx_v_self) {
4023 __Pyx_RefNannyDeclarations
4024 __Pyx_RefNannySetupContext(
"__del__ (wrapper)", 0);
4025 __pyx_r = __pyx_pf_18BoundaryConditions_7BC_Base_4name_4__del__(((
struct __pyx_obj_18BoundaryConditions_BC_Base *)__pyx_v_self));
4028 __Pyx_RefNannyFinishContext();
4032 static int __pyx_pf_18BoundaryConditions_7BC_Base_4name_4__del__(
struct __pyx_obj_18BoundaryConditions_BC_Base *__pyx_v_self) {
4034 __Pyx_TraceDeclarations
4035 __Pyx_RefNannyDeclarations
4036 int __pyx_lineno = 0;
4037 const char *__pyx_filename = NULL;
4038 int __pyx_clineno = 0;
4039 __Pyx_RefNannySetupContext(
"__del__", 0);
4040 __Pyx_TraceCall(
"__del__", __pyx_f[2], 10, 0, __PYX_ERR(2, 10, __pyx_L1_error));
4041 __Pyx_INCREF(Py_None);
4042 __Pyx_GIVEREF(Py_None);
4043 __Pyx_GOTREF(__pyx_v_self->name);
4044 __Pyx_DECREF(__pyx_v_self->name);
4045 __pyx_v_self->name = ((PyObject*)Py_None);
4051 __Pyx_AddTraceback(
"BoundaryConditions.BC_Base.name.__del__", __pyx_clineno, __pyx_lineno, __pyx_filename);
4054 __Pyx_TraceReturn(Py_None, 0);
4055 __Pyx_RefNannyFinishContext();
4068 static PyObject *__pyx_pw_18BoundaryConditions_7BC_Base_7BC_type_1__get__(PyObject *__pyx_v_self);
4069 static PyObject *__pyx_pw_18BoundaryConditions_7BC_Base_7BC_type_1__get__(PyObject *__pyx_v_self) {
4070 PyObject *__pyx_r = 0;
4071 __Pyx_RefNannyDeclarations
4072 __Pyx_RefNannySetupContext(
"__get__ (wrapper)", 0);
4073 __pyx_r = __pyx_pf_18BoundaryConditions_7BC_Base_7BC_type___get__(((
struct __pyx_obj_18BoundaryConditions_BC_Base *)__pyx_v_self));
4076 __Pyx_RefNannyFinishContext();
4080 static PyObject *__pyx_pf_18BoundaryConditions_7BC_Base_7BC_type___get__(
struct __pyx_obj_18BoundaryConditions_BC_Base *__pyx_v_self) {
4081 PyObject *__pyx_r = NULL;
4082 __Pyx_TraceDeclarations
4083 __Pyx_RefNannyDeclarations
4084 int __pyx_lineno = 0;
4085 const char *__pyx_filename = NULL;
4086 int __pyx_clineno = 0;
4087 __Pyx_RefNannySetupContext(
"__get__", 0);
4088 __Pyx_TraceCall(
"__get__", __pyx_f[2], 11, 0, __PYX_ERR(2, 11, __pyx_L1_error));
4089 __Pyx_XDECREF(__pyx_r);
4090 __Pyx_INCREF(__pyx_v_self->BC_type);
4091 __pyx_r = __pyx_v_self->BC_type;
4096 __Pyx_AddTraceback(
"BoundaryConditions.BC_Base.BC_type.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
4099 __Pyx_XGIVEREF(__pyx_r);
4100 __Pyx_TraceReturn(__pyx_r, 0);
4101 __Pyx_RefNannyFinishContext();
4106 static int __pyx_pw_18BoundaryConditions_7BC_Base_7BC_type_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value);
4107 static int __pyx_pw_18BoundaryConditions_7BC_Base_7BC_type_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
4109 __Pyx_RefNannyDeclarations
4110 __Pyx_RefNannySetupContext(
"__set__ (wrapper)", 0);
4111 __pyx_r = __pyx_pf_18BoundaryConditions_7BC_Base_7BC_type_2__set__(((
struct __pyx_obj_18BoundaryConditions_BC_Base *)__pyx_v_self), ((PyObject *)__pyx_v_value));
4114 __Pyx_RefNannyFinishContext();
4118 static int __pyx_pf_18BoundaryConditions_7BC_Base_7BC_type_2__set__(
struct __pyx_obj_18BoundaryConditions_BC_Base *__pyx_v_self, PyObject *__pyx_v_value) {
4120 __Pyx_TraceDeclarations
4121 __Pyx_RefNannyDeclarations
4122 PyObject *__pyx_t_1 = NULL;
4123 int __pyx_lineno = 0;
4124 const char *__pyx_filename = NULL;
4125 int __pyx_clineno = 0;
4126 __Pyx_RefNannySetupContext(
"__set__", 0);
4127 __Pyx_TraceCall(
"__set__", __pyx_f[2], 11, 0, __PYX_ERR(2, 11, __pyx_L1_error));
4128 if (!(likely(PyString_CheckExact(__pyx_v_value))||((__pyx_v_value) == Py_None)||(PyErr_Format(PyExc_TypeError,
"Expected %.16s, got %.200s",
"str", Py_TYPE(__pyx_v_value)->tp_name), 0))) __PYX_ERR(2, 11, __pyx_L1_error)
4129 __pyx_t_1 = __pyx_v_value;
4130 __Pyx_INCREF(__pyx_t_1);
4131 __Pyx_GIVEREF(__pyx_t_1);
4132 __Pyx_GOTREF(__pyx_v_self->BC_type);
4133 __Pyx_DECREF(__pyx_v_self->BC_type);
4134 __pyx_v_self->BC_type = ((PyObject*)__pyx_t_1);
4141 __Pyx_XDECREF(__pyx_t_1);
4142 __Pyx_AddTraceback(
"BoundaryConditions.BC_Base.BC_type.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
4145 __Pyx_TraceReturn(Py_None, 0);
4146 __Pyx_RefNannyFinishContext();
4151 static int __pyx_pw_18BoundaryConditions_7BC_Base_7BC_type_5__del__(PyObject *__pyx_v_self);
4152 static int __pyx_pw_18BoundaryConditions_7BC_Base_7BC_type_5__del__(PyObject *__pyx_v_self) {
4154 __Pyx_RefNannyDeclarations
4155 __Pyx_RefNannySetupContext(
"__del__ (wrapper)", 0);
4156 __pyx_r = __pyx_pf_18BoundaryConditions_7BC_Base_7BC_type_4__del__(((
struct __pyx_obj_18BoundaryConditions_BC_Base *)__pyx_v_self));
4159 __Pyx_RefNannyFinishContext();
4163 static int __pyx_pf_18BoundaryConditions_7BC_Base_7BC_type_4__del__(
struct __pyx_obj_18BoundaryConditions_BC_Base *__pyx_v_self) {
4165 __Pyx_TraceDeclarations
4166 __Pyx_RefNannyDeclarations
4167 int __pyx_lineno = 0;
4168 const char *__pyx_filename = NULL;
4169 int __pyx_clineno = 0;
4170 __Pyx_RefNannySetupContext(
"__del__", 0);
4171 __Pyx_TraceCall(
"__del__", __pyx_f[2], 11, 0, __PYX_ERR(2, 11, __pyx_L1_error));
4172 __Pyx_INCREF(Py_None);
4173 __Pyx_GIVEREF(Py_None);
4174 __Pyx_GOTREF(__pyx_v_self->BC_type);
4175 __Pyx_DECREF(__pyx_v_self->BC_type);
4176 __pyx_v_self->BC_type = ((PyObject*)Py_None);
4182 __Pyx_AddTraceback(
"BoundaryConditions.BC_Base.BC_type.__del__", __pyx_clineno, __pyx_lineno, __pyx_filename);
4185 __Pyx_TraceReturn(Py_None, 0);
4186 __Pyx_RefNannyFinishContext();
4199 static PyObject *__pyx_pw_18BoundaryConditions_7BC_Base_2ct_1__get__(PyObject *__pyx_v_self);
4200 static PyObject *__pyx_pw_18BoundaryConditions_7BC_Base_2ct_1__get__(PyObject *__pyx_v_self) {
4201 PyObject *__pyx_r = 0;
4202 __Pyx_RefNannyDeclarations
4203 __Pyx_RefNannySetupContext(
"__get__ (wrapper)", 0);
4204 __pyx_r = __pyx_pf_18BoundaryConditions_7BC_Base_2ct___get__(((
struct __pyx_obj_18BoundaryConditions_BC_Base *)__pyx_v_self));
4207 __Pyx_RefNannyFinishContext();
4211 static PyObject *__pyx_pf_18BoundaryConditions_7BC_Base_2ct___get__(
struct __pyx_obj_18BoundaryConditions_BC_Base *__pyx_v_self) {
4212 PyObject *__pyx_r = NULL;
4213 __Pyx_TraceDeclarations
4214 __Pyx_RefNannyDeclarations
4215 int __pyx_lineno = 0;
4216 const char *__pyx_filename = NULL;
4217 int __pyx_clineno = 0;
4218 __Pyx_RefNannySetupContext(
"__get__", 0);
4219 __Pyx_TraceCall(
"__get__", __pyx_f[2], 12, 0, __PYX_ERR(2, 12, __pyx_L1_error));
4220 __Pyx_XDECREF(__pyx_r);
4221 __Pyx_INCREF(__pyx_v_self->ct);
4222 __pyx_r = __pyx_v_self->ct;
4227 __Pyx_AddTraceback(
"BoundaryConditions.BC_Base.ct.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
4230 __Pyx_XGIVEREF(__pyx_r);
4231 __Pyx_TraceReturn(__pyx_r, 0);
4232 __Pyx_RefNannyFinishContext();
4237 static int __pyx_pw_18BoundaryConditions_7BC_Base_2ct_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value);
4238 static int __pyx_pw_18BoundaryConditions_7BC_Base_2ct_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
4240 __Pyx_RefNannyDeclarations
4241 __Pyx_RefNannySetupContext(
"__set__ (wrapper)", 0);
4242 __pyx_r = __pyx_pf_18BoundaryConditions_7BC_Base_2ct_2__set__(((
struct __pyx_obj_18BoundaryConditions_BC_Base *)__pyx_v_self), ((PyObject *)__pyx_v_value));
4245 __Pyx_RefNannyFinishContext();
4249 static int __pyx_pf_18BoundaryConditions_7BC_Base_2ct_2__set__(
struct __pyx_obj_18BoundaryConditions_BC_Base *__pyx_v_self, PyObject *__pyx_v_value) {
4251 __Pyx_TraceDeclarations
4252 __Pyx_RefNannyDeclarations
4253 int __pyx_lineno = 0;
4254 const char *__pyx_filename = NULL;
4255 int __pyx_clineno = 0;
4256 __Pyx_RefNannySetupContext(
"__set__", 0);
4257 __Pyx_TraceCall(
"__set__", __pyx_f[2], 12, 0, __PYX_ERR(2, 12, __pyx_L1_error));
4258 __Pyx_INCREF(__pyx_v_value);
4259 __Pyx_GIVEREF(__pyx_v_value);
4260 __Pyx_GOTREF(__pyx_v_self->ct);
4261 __Pyx_DECREF(__pyx_v_self->ct);
4262 __pyx_v_self->ct = __pyx_v_value;
4268 __Pyx_AddTraceback(
"BoundaryConditions.BC_Base.ct.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
4271 __Pyx_TraceReturn(Py_None, 0);
4272 __Pyx_RefNannyFinishContext();
4277 static int __pyx_pw_18BoundaryConditions_7BC_Base_2ct_5__del__(PyObject *__pyx_v_self);
4278 static int __pyx_pw_18BoundaryConditions_7BC_Base_2ct_5__del__(PyObject *__pyx_v_self) {
4280 __Pyx_RefNannyDeclarations
4281 __Pyx_RefNannySetupContext(
"__del__ (wrapper)", 0);
4282 __pyx_r = __pyx_pf_18BoundaryConditions_7BC_Base_2ct_4__del__(((
struct __pyx_obj_18BoundaryConditions_BC_Base *)__pyx_v_self));
4285 __Pyx_RefNannyFinishContext();
4289 static int __pyx_pf_18BoundaryConditions_7BC_Base_2ct_4__del__(
struct __pyx_obj_18BoundaryConditions_BC_Base *__pyx_v_self) {
4291 __Pyx_TraceDeclarations
4292 __Pyx_RefNannyDeclarations
4293 int __pyx_lineno = 0;
4294 const char *__pyx_filename = NULL;
4295 int __pyx_clineno = 0;
4296 __Pyx_RefNannySetupContext(
"__del__", 0);
4297 __Pyx_TraceCall(
"__del__", __pyx_f[2], 12, 0, __PYX_ERR(2, 12, __pyx_L1_error));
4298 __Pyx_INCREF(Py_None);
4299 __Pyx_GIVEREF(Py_None);
4300 __Pyx_GOTREF(__pyx_v_self->ct);
4301 __Pyx_DECREF(__pyx_v_self->ct);
4302 __pyx_v_self->ct = Py_None;
4308 __Pyx_AddTraceback(
"BoundaryConditions.BC_Base.ct.__del__", __pyx_clineno, __pyx_lineno, __pyx_filename);
4311 __Pyx_TraceReturn(Py_None, 0);
4312 __Pyx_RefNannyFinishContext();
4323 static PyObject *__pyx_pw_18BoundaryConditions_7BC_Base_5__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused);
4324 static char __pyx_doc_18BoundaryConditions_7BC_Base_4__reduce_cython__[] =
"BC_Base.__reduce_cython__(self)";
4325 static PyMethodDef __pyx_mdef_18BoundaryConditions_7BC_Base_5__reduce_cython__ = {
"__reduce_cython__", (PyCFunction)__pyx_pw_18BoundaryConditions_7BC_Base_5__reduce_cython__, METH_NOARGS, __pyx_doc_18BoundaryConditions_7BC_Base_4__reduce_cython__};
4326 static PyObject *__pyx_pw_18BoundaryConditions_7BC_Base_5__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
4327 PyObject *__pyx_r = 0;
4328 __Pyx_RefNannyDeclarations
4329 __Pyx_RefNannySetupContext(
"__reduce_cython__ (wrapper)", 0);
4330 __pyx_r = __pyx_pf_18BoundaryConditions_7BC_Base_4__reduce_cython__(((
struct __pyx_obj_18BoundaryConditions_BC_Base *)__pyx_v_self));
4333 __Pyx_RefNannyFinishContext();
4337 static PyObject *__pyx_pf_18BoundaryConditions_7BC_Base_4__reduce_cython__(
struct __pyx_obj_18BoundaryConditions_BC_Base *__pyx_v_self) {
4338 PyObject *__pyx_v_state = 0;
4339 PyObject *__pyx_v__dict = 0;
4340 int __pyx_v_use_setstate;
4341 PyObject *__pyx_r = NULL;
4342 __Pyx_TraceDeclarations
4343 __Pyx_RefNannyDeclarations
4344 PyObject *__pyx_t_1 = NULL;
4345 PyObject *__pyx_t_2 = NULL;
4346 PyObject *__pyx_t_3 = NULL;
4350 int __pyx_lineno = 0;
4351 const char *__pyx_filename = NULL;
4352 int __pyx_clineno = 0;
4353 __Pyx_TraceFrameInit(__pyx_codeobj__2)
4354 __Pyx_RefNannySetupContext(
"__reduce_cython__", 0);
4355 __Pyx_TraceCall(
"__reduce_cython__", __pyx_f[1], 1, 0, __PYX_ERR(1, 1, __pyx_L1_error));
4364 __pyx_t_1 = __pyx_memoryview_fromslice(__pyx_v_self->_b_or, 1, (PyObject *(*)(
char *)) __pyx_memview_get_double, (int (*)(
char *, PyObject *)) __pyx_memview_set_double, 0);;
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 5, __pyx_L1_error)
4365 __Pyx_GOTREF(__pyx_t_1);
4366 __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_self->nd);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 5, __pyx_L1_error)
4367 __Pyx_GOTREF(__pyx_t_2);
4368 __pyx_t_3 = PyTuple_New(6);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 5, __pyx_L1_error)
4369 __Pyx_GOTREF(__pyx_t_3);
4370 __Pyx_INCREF(__pyx_v_self->BC_type);
4371 __Pyx_GIVEREF(__pyx_v_self->BC_type);
4372 PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_self->BC_type);
4373 __Pyx_INCREF(__pyx_v_self->Shape);
4374 __Pyx_GIVEREF(__pyx_v_self->Shape);
4375 PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_v_self->Shape);
4376 __Pyx_GIVEREF(__pyx_t_1);
4377 PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_t_1);
4378 __Pyx_INCREF(__pyx_v_self->ct);
4379 __Pyx_GIVEREF(__pyx_v_self->ct);
4380 PyTuple_SET_ITEM(__pyx_t_3, 3, __pyx_v_self->ct);
4381 __Pyx_INCREF(__pyx_v_self->name);
4382 __Pyx_GIVEREF(__pyx_v_self->name);
4383 PyTuple_SET_ITEM(__pyx_t_3, 4, __pyx_v_self->name);
4384 __Pyx_GIVEREF(__pyx_t_2);
4385 PyTuple_SET_ITEM(__pyx_t_3, 5, __pyx_t_2);
4388 __pyx_v_state = ((PyObject*)__pyx_t_3);
4398 __pyx_t_3 = __Pyx_GetAttr3(((PyObject *)__pyx_v_self), __pyx_n_s_dict, Py_None);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 6, __pyx_L1_error)
4399 __Pyx_GOTREF(__pyx_t_3);
4400 __pyx_v__dict = __pyx_t_3;
4410 __pyx_t_4 = (__pyx_v__dict != Py_None);
4411 __pyx_t_5 = (__pyx_t_4 != 0);
4421 __pyx_t_3 = PyTuple_New(1);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 8, __pyx_L1_error)
4422 __Pyx_GOTREF(__pyx_t_3);
4423 __Pyx_INCREF(__pyx_v__dict);
4424 __Pyx_GIVEREF(__pyx_v__dict);
4425 PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v__dict);
4426 __pyx_t_2 = PyNumber_InPlaceAdd(__pyx_v_state, __pyx_t_3);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 8, __pyx_L1_error)
4427 __Pyx_GOTREF(__pyx_t_2);
4428 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
4429 __Pyx_DECREF_SET(__pyx_v_state, ((PyObject*)__pyx_t_2));
4439 __pyx_v_use_setstate = 1;
4459 __pyx_t_4 = (__pyx_v_self->BC_type != ((PyObject*)Py_None));
4460 __pyx_t_6 = (__pyx_t_4 != 0);
4463 __pyx_t_5 = __pyx_t_6;
4464 goto __pyx_L4_bool_binop_done;
4466 __pyx_t_6 = (__pyx_v_self->Shape != Py_None);
4467 __pyx_t_4 = (__pyx_t_6 != 0);
4470 __pyx_t_5 = __pyx_t_4;
4471 goto __pyx_L4_bool_binop_done;
4473 __pyx_t_4 = (__pyx_v_self->ct != Py_None);
4474 __pyx_t_6 = (__pyx_t_4 != 0);
4477 __pyx_t_5 = __pyx_t_6;
4478 goto __pyx_L4_bool_binop_done;
4480 __pyx_t_6 = (__pyx_v_self->name != ((PyObject*)Py_None));
4481 __pyx_t_4 = (__pyx_t_6 != 0);
4482 __pyx_t_5 = __pyx_t_4;
4483 __pyx_L4_bool_binop_done:;
4484 __pyx_v_use_setstate = __pyx_t_5;
4495 __pyx_t_5 = (__pyx_v_use_setstate != 0);
4505 __Pyx_XDECREF(__pyx_r);
4506 __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_pyx_unpickle_BC_Base);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 13, __pyx_L1_error)
4507 __Pyx_GOTREF(__pyx_t_2);
4508 __pyx_t_3 = PyTuple_New(3);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 13, __pyx_L1_error)
4509 __Pyx_GOTREF(__pyx_t_3);
4510 __Pyx_INCREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
4511 __Pyx_GIVEREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
4512 PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
4513 __Pyx_INCREF(__pyx_int_158231071);
4514 __Pyx_GIVEREF(__pyx_int_158231071);
4515 PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_int_158231071);
4516 __Pyx_INCREF(Py_None);
4517 __Pyx_GIVEREF(Py_None);
4518 PyTuple_SET_ITEM(__pyx_t_3, 2, Py_None);
4519 __pyx_t_1 = PyTuple_New(3);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 13, __pyx_L1_error)
4520 __Pyx_GOTREF(__pyx_t_1);
4521 __Pyx_GIVEREF(__pyx_t_2);
4522 PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_2);
4523 __Pyx_GIVEREF(__pyx_t_3);
4524 PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_3);
4525 __Pyx_INCREF(__pyx_v_state);
4526 __Pyx_GIVEREF(__pyx_v_state);
4527 PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_v_state);
4530 __pyx_r = __pyx_t_1;
4551 __Pyx_XDECREF(__pyx_r);
4552 __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_pyx_unpickle_BC_Base);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 15, __pyx_L1_error)
4553 __Pyx_GOTREF(__pyx_t_1);
4554 __pyx_t_3 = PyTuple_New(3);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 15, __pyx_L1_error)
4555 __Pyx_GOTREF(__pyx_t_3);
4556 __Pyx_INCREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
4557 __Pyx_GIVEREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
4558 PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
4559 __Pyx_INCREF(__pyx_int_158231071);
4560 __Pyx_GIVEREF(__pyx_int_158231071);
4561 PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_int_158231071);
4562 __Pyx_INCREF(__pyx_v_state);
4563 __Pyx_GIVEREF(__pyx_v_state);
4564 PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_v_state);
4565 __pyx_t_2 = PyTuple_New(2);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 15, __pyx_L1_error)
4566 __Pyx_GOTREF(__pyx_t_2);
4567 __Pyx_GIVEREF(__pyx_t_1);
4568 PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1);
4569 __Pyx_GIVEREF(__pyx_t_3);
4570 PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_3);
4573 __pyx_r = __pyx_t_2;
4586 __Pyx_XDECREF(__pyx_t_1);
4587 __Pyx_XDECREF(__pyx_t_2);
4588 __Pyx_XDECREF(__pyx_t_3);
4589 __Pyx_AddTraceback(
"BoundaryConditions.BC_Base.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
4592 __Pyx_XDECREF(__pyx_v_state);
4593 __Pyx_XDECREF(__pyx_v__dict);
4594 __Pyx_XGIVEREF(__pyx_r);
4595 __Pyx_TraceReturn(__pyx_r, 0);
4596 __Pyx_RefNannyFinishContext();
4608 static PyObject *__pyx_pw_18BoundaryConditions_7BC_Base_7__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state);
4609 static char __pyx_doc_18BoundaryConditions_7BC_Base_6__setstate_cython__[] =
"BC_Base.__setstate_cython__(self, __pyx_state)";
4610 static PyMethodDef __pyx_mdef_18BoundaryConditions_7BC_Base_7__setstate_cython__ = {
"__setstate_cython__", (PyCFunction)__pyx_pw_18BoundaryConditions_7BC_Base_7__setstate_cython__, METH_O, __pyx_doc_18BoundaryConditions_7BC_Base_6__setstate_cython__};
4611 static PyObject *__pyx_pw_18BoundaryConditions_7BC_Base_7__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
4612 PyObject *__pyx_r = 0;
4613 __Pyx_RefNannyDeclarations
4614 __Pyx_RefNannySetupContext(
"__setstate_cython__ (wrapper)", 0);
4615 __pyx_r = __pyx_pf_18BoundaryConditions_7BC_Base_6__setstate_cython__(((
struct __pyx_obj_18BoundaryConditions_BC_Base *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state));
4618 __Pyx_RefNannyFinishContext();
4622 static PyObject *__pyx_pf_18BoundaryConditions_7BC_Base_6__setstate_cython__(
struct __pyx_obj_18BoundaryConditions_BC_Base *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
4623 PyObject *__pyx_r = NULL;
4624 __Pyx_TraceDeclarations
4625 __Pyx_RefNannyDeclarations
4626 PyObject *__pyx_t_1 = NULL;
4627 int __pyx_lineno = 0;
4628 const char *__pyx_filename = NULL;
4629 int __pyx_clineno = 0;
4630 __Pyx_TraceFrameInit(__pyx_codeobj__3)
4631 __Pyx_RefNannySetupContext(
"__setstate_cython__", 0);
4632 __Pyx_TraceCall(
"__setstate_cython__", __pyx_f[1], 16, 0, __PYX_ERR(1, 16, __pyx_L1_error));
4639 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(1, 17, __pyx_L1_error)
4640 __pyx_t_1 = __pyx_f_18BoundaryConditions___pyx_unpickle_BC_Base__set_state(__pyx_v_self, ((PyObject*)__pyx_v___pyx_state));
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 17, __pyx_L1_error)
4641 __Pyx_GOTREF(__pyx_t_1);
4642 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
4652 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
4655 __Pyx_XDECREF(__pyx_t_1);
4656 __Pyx_AddTraceback(
"BoundaryConditions.BC_Base.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
4659 __Pyx_XGIVEREF(__pyx_r);
4660 __Pyx_TraceReturn(__pyx_r, 0);
4661 __Pyx_RefNannyFinishContext();
4674 static int __pyx_pw_18BoundaryConditions_17BoundaryCondition_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
4675 static int __pyx_pw_18BoundaryConditions_17BoundaryCondition_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
4677 __Pyx_RefNannyDeclarations
4678 __Pyx_RefNannySetupContext(
"__init__ (wrapper)", 0);
4679 if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) {
4680 __Pyx_RaiseArgtupleInvalid(
"__init__", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args));
return -1;}
4681 if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds,
"__init__", 0)))
return -1;
4682 __pyx_r = __pyx_pf_18BoundaryConditions_17BoundaryCondition___init__(((
struct __pyx_obj_18BoundaryConditions_BoundaryCondition *)__pyx_v_self));
4685 __Pyx_RefNannyFinishContext();
4689 static int __pyx_pf_18BoundaryConditions_17BoundaryCondition___init__(
struct __pyx_obj_18BoundaryConditions_BoundaryCondition *__pyx_v_self) {
4691 __Pyx_TraceDeclarations
4692 __Pyx_RefNannyDeclarations
4693 int __pyx_lineno = 0;
4694 const char *__pyx_filename = NULL;
4695 int __pyx_clineno = 0;
4696 __Pyx_RefNannySetupContext(
"__init__", 0);
4697 __Pyx_TraceCall(
"__init__", __pyx_f[0], 78, 0, __PYX_ERR(0, 78, __pyx_L1_error));
4706 __Pyx_INCREF(Py_None);
4707 __Pyx_GIVEREF(Py_None);
4708 __Pyx_GOTREF(__pyx_v_self->uOfXT);
4709 __Pyx_DECREF(__pyx_v_self->uOfXT);
4710 __pyx_v_self->uOfXT = Py_None;
4724 __Pyx_AddTraceback(
"BoundaryConditions.BoundaryCondition.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
4727 __Pyx_TraceReturn(Py_None, 0);
4728 __Pyx_RefNannyFinishContext();
4741 static PyObject *__pyx_pw_18BoundaryConditions_17BoundaryCondition_3init_cython(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused);
4742 static char __pyx_doc_18BoundaryConditions_17BoundaryCondition_2init_cython[] =
"BoundaryCondition.init_cython(self)";
4743 static PyMethodDef __pyx_mdef_18BoundaryConditions_17BoundaryCondition_3init_cython = {
"init_cython", (PyCFunction)__pyx_pw_18BoundaryConditions_17BoundaryCondition_3init_cython, METH_NOARGS, __pyx_doc_18BoundaryConditions_17BoundaryCondition_2init_cython};
4744 static PyObject *__pyx_pw_18BoundaryConditions_17BoundaryCondition_3init_cython(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
4745 PyObject *__pyx_r = 0;
4746 __Pyx_RefNannyDeclarations
4747 __Pyx_RefNannySetupContext(
"init_cython (wrapper)", 0);
4748 __pyx_r = __pyx_pf_18BoundaryConditions_17BoundaryCondition_2init_cython(((
struct __pyx_obj_18BoundaryConditions_BoundaryCondition *)__pyx_v_self));
4751 __Pyx_RefNannyFinishContext();
4755 static PyObject *__pyx_pf_18BoundaryConditions_17BoundaryCondition_2init_cython(
struct __pyx_obj_18BoundaryConditions_BoundaryCondition *__pyx_v_self) {
4756 PyObject *__pyx_r = NULL;
4757 __Pyx_TraceDeclarations
4758 __Pyx_RefNannyDeclarations
4759 int __pyx_lineno = 0;
4760 const char *__pyx_filename = NULL;
4761 int __pyx_clineno = 0;
4762 __Pyx_TraceFrameInit(__pyx_codeobj__4)
4763 __Pyx_RefNannySetupContext(
"init_cython", 0);
4764 __Pyx_TraceCall(
"init_cython", __pyx_f[0], 81, 0, __PYX_ERR(0, 81, __pyx_L1_error));
4773 __Pyx_XDECREF(__pyx_r);
4774 __Pyx_INCREF(__pyx_v_self->uOfXT);
4775 __pyx_r = __pyx_v_self->uOfXT;
4788 __Pyx_AddTraceback(
"BoundaryConditions.BoundaryCondition.init_cython", __pyx_clineno, __pyx_lineno, __pyx_filename);
4791 __Pyx_XGIVEREF(__pyx_r);
4792 __Pyx_TraceReturn(__pyx_r, 0);
4793 __Pyx_RefNannyFinishContext();
4805 static PyObject *__pyx_pw_18BoundaryConditions_17BoundaryCondition_5resetBC(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused);
4806 static void __pyx_f_18BoundaryConditions_17BoundaryCondition_resetBC(
struct __pyx_obj_18BoundaryConditions_BoundaryCondition *__pyx_v_self,
int __pyx_skip_dispatch) {
4807 __Pyx_TraceDeclarations
4808 __Pyx_RefNannyDeclarations
4809 PyObject *__pyx_t_1 = NULL;
4810 PyObject *__pyx_t_2 = NULL;
4811 PyObject *__pyx_t_3 = NULL;
4812 PyObject *__pyx_t_4 = NULL;
4813 int __pyx_lineno = 0;
4814 const char *__pyx_filename = NULL;
4815 int __pyx_clineno = 0;
4816 __Pyx_TraceFrameInit(__pyx_codeobj__5)
4817 __Pyx_RefNannySetupContext(
"resetBC", 0);
4818 __Pyx_TraceCall(
"resetBC", __pyx_f[0], 84, 0, __PYX_ERR(0, 84, __pyx_L1_error));
4820 if (unlikely(__pyx_skip_dispatch)) ;
4822 else if (unlikely((Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0) || (Py_TYPE(((PyObject *)__pyx_v_self))->tp_flags & (Py_TPFLAGS_IS_ABSTRACT | Py_TPFLAGS_HEAPTYPE)))) {
4823 #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
4824 static PY_UINT64_T __pyx_tp_dict_version = __PYX_DICT_VERSION_INIT, __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
4825 if (unlikely(!__Pyx_object_dict_version_matches(((PyObject *)__pyx_v_self), __pyx_tp_dict_version, __pyx_obj_dict_version))) {
4826 PY_UINT64_T __pyx_type_dict_guard = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
4828 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_resetBC);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 84, __pyx_L1_error)
4829 __Pyx_GOTREF(__pyx_t_1);
4830 if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(
void*)__pyx_pw_18BoundaryConditions_17BoundaryCondition_5resetBC)) {
4831 __Pyx_INCREF(__pyx_t_1);
4832 __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
4833 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
4834 __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
4835 if (likely(__pyx_t_4)) {
4836 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_3);
4837 __Pyx_INCREF(__pyx_t_4);
4838 __Pyx_INCREF(
function);
4839 __Pyx_DECREF_SET(__pyx_t_3,
function);
4842 __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
4843 __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
4844 if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 84, __pyx_L1_error)
4845 __Pyx_GOTREF(__pyx_t_2);
4846 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
4847 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
4848 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
4851 #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
4852 __pyx_tp_dict_version = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
4853 __pyx_obj_dict_version = __Pyx_get_object_dict_version(((PyObject *)__pyx_v_self));
4854 if (unlikely(__pyx_type_dict_guard != __pyx_tp_dict_version)) {
4855 __pyx_tp_dict_version = __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
4858 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
4859 #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
4871 __Pyx_INCREF(Py_None);
4872 __Pyx_GIVEREF(Py_None);
4873 __Pyx_GOTREF(__pyx_v_self->uOfXT);
4874 __Pyx_DECREF(__pyx_v_self->uOfXT);
4875 __pyx_v_self->uOfXT = Py_None;
4888 __Pyx_XDECREF(__pyx_t_1);
4889 __Pyx_XDECREF(__pyx_t_2);
4890 __Pyx_XDECREF(__pyx_t_3);
4891 __Pyx_XDECREF(__pyx_t_4);
4892 __Pyx_WriteUnraisable(
"BoundaryConditions.BoundaryCondition.resetBC", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
4894 __Pyx_TraceReturn(Py_None, 0);
4895 __Pyx_RefNannyFinishContext();
4899 static PyObject *__pyx_pw_18BoundaryConditions_17BoundaryCondition_5resetBC(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused);
4900 static char __pyx_doc_18BoundaryConditions_17BoundaryCondition_4resetBC[] =
"BoundaryCondition.resetBC(self) -> void";
4901 static PyMethodDef __pyx_mdef_18BoundaryConditions_17BoundaryCondition_5resetBC = {
"resetBC", (PyCFunction)__pyx_pw_18BoundaryConditions_17BoundaryCondition_5resetBC, METH_NOARGS, __pyx_doc_18BoundaryConditions_17BoundaryCondition_4resetBC};
4902 static PyObject *__pyx_pw_18BoundaryConditions_17BoundaryCondition_5resetBC(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
4903 PyObject *__pyx_r = 0;
4904 __Pyx_RefNannyDeclarations
4905 __Pyx_RefNannySetupContext(
"resetBC (wrapper)", 0);
4906 __pyx_r = __pyx_pf_18BoundaryConditions_17BoundaryCondition_4resetBC(((
struct __pyx_obj_18BoundaryConditions_BoundaryCondition *)__pyx_v_self));
4909 __Pyx_RefNannyFinishContext();
4913 static PyObject *__pyx_pf_18BoundaryConditions_17BoundaryCondition_4resetBC(
struct __pyx_obj_18BoundaryConditions_BoundaryCondition *__pyx_v_self) {
4914 PyObject *__pyx_r = NULL;
4915 __Pyx_TraceDeclarations
4916 __Pyx_RefNannyDeclarations
4917 PyObject *__pyx_t_1 = NULL;
4918 int __pyx_lineno = 0;
4919 const char *__pyx_filename = NULL;
4920 int __pyx_clineno = 0;
4921 __Pyx_TraceFrameInit(__pyx_codeobj__5)
4922 __Pyx_RefNannySetupContext(
"resetBC", 0);
4923 __Pyx_TraceCall(
"resetBC (wrapper)", __pyx_f[0], 84, 0, __PYX_ERR(0, 84, __pyx_L1_error));
4924 __Pyx_XDECREF(__pyx_r);
4925 __pyx_t_1 = __Pyx_void_to_None(__pyx_f_18BoundaryConditions_17BoundaryCondition_resetBC(__pyx_v_self, 1));
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 84, __pyx_L1_error)
4926 __Pyx_GOTREF(__pyx_t_1);
4927 __pyx_r = __pyx_t_1;
4933 __Pyx_XDECREF(__pyx_t_1);
4934 __Pyx_AddTraceback(
"BoundaryConditions.BoundaryCondition.resetBC", __pyx_clineno, __pyx_lineno, __pyx_filename);
4937 __Pyx_XGIVEREF(__pyx_r);
4938 __Pyx_TraceReturn(__pyx_r, 0);
4939 __Pyx_RefNannyFinishContext();
4952 static PyObject *__pyx_pw_18BoundaryConditions_17BoundaryCondition_7setConstantBC(PyObject *__pyx_v_self, PyObject *__pyx_v_value);
4953 static char __pyx_doc_18BoundaryConditions_17BoundaryCondition_6setConstantBC[] =
"BoundaryCondition.setConstantBC(self, value)\n\n function returning constant BC\n\n Parameters\n ----------\n value : float\n Constant value\n\n ";
4954 static PyMethodDef __pyx_mdef_18BoundaryConditions_17BoundaryCondition_7setConstantBC = {
"setConstantBC", (PyCFunction)__pyx_pw_18BoundaryConditions_17BoundaryCondition_7setConstantBC, METH_O, __pyx_doc_18BoundaryConditions_17BoundaryCondition_6setConstantBC};
4955 static PyObject *__pyx_pw_18BoundaryConditions_17BoundaryCondition_7setConstantBC(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
4956 PyObject *__pyx_r = 0;
4957 __Pyx_RefNannyDeclarations
4958 __Pyx_RefNannySetupContext(
"setConstantBC (wrapper)", 0);
4959 __pyx_r = __pyx_pf_18BoundaryConditions_17BoundaryCondition_6setConstantBC(((
struct __pyx_obj_18BoundaryConditions_BoundaryCondition *)__pyx_v_self), ((PyObject *)__pyx_v_value));
4962 __Pyx_RefNannyFinishContext();
4974 static PyObject *__pyx_pf_18BoundaryConditions_2__defaults__(CYTHON_UNUSED PyObject *__pyx_self) {
4975 PyObject *__pyx_r = NULL;
4976 __Pyx_TraceDeclarations
4977 __Pyx_RefNannyDeclarations
4978 PyObject *__pyx_t_1 = NULL;
4979 PyObject *__pyx_t_2 = NULL;
4980 int __pyx_lineno = 0;
4981 const char *__pyx_filename = NULL;
4982 int __pyx_clineno = 0;
4983 __Pyx_RefNannySetupContext(
"__defaults__", 0);
4984 __Pyx_TraceCall(
"__defaults__", __pyx_f[0], 97, 0, __PYX_ERR(0, 97, __pyx_L1_error));
4985 __Pyx_XDECREF(__pyx_r);
4986 __pyx_t_1 = PyTuple_New(1);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 97, __pyx_L1_error)
4987 __Pyx_GOTREF(__pyx_t_1);
4988 __Pyx_INCREF(__Pyx_CyFunction_Defaults(__pyx_defaults, __pyx_self)->__pyx_arg_n);
4989 __Pyx_GIVEREF(__Pyx_CyFunction_Defaults(__pyx_defaults, __pyx_self)->__pyx_arg_n);
4990 PyTuple_SET_ITEM(__pyx_t_1, 0, __Pyx_CyFunction_Defaults(__pyx_defaults, __pyx_self)->__pyx_arg_n);
4991 __pyx_t_2 = PyTuple_New(2);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 97, __pyx_L1_error)
4992 __Pyx_GOTREF(__pyx_t_2);
4993 __Pyx_GIVEREF(__pyx_t_1);
4994 PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1);
4995 __Pyx_INCREF(Py_None);
4996 __Pyx_GIVEREF(Py_None);
4997 PyTuple_SET_ITEM(__pyx_t_2, 1, Py_None);
4999 __pyx_r = __pyx_t_2;
5005 __Pyx_XDECREF(__pyx_t_1);
5006 __Pyx_XDECREF(__pyx_t_2);
5007 __Pyx_AddTraceback(
"BoundaryConditions.__defaults__", __pyx_clineno, __pyx_lineno, __pyx_filename);
5010 __Pyx_XGIVEREF(__pyx_r);
5011 __Pyx_TraceReturn(__pyx_r, 0);
5012 __Pyx_RefNannyFinishContext();
5017 static PyObject *__pyx_pw_18BoundaryConditions_17BoundaryCondition_13setConstantBC_lambda(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
5018 static PyMethodDef __pyx_mdef_18BoundaryConditions_17BoundaryCondition_13setConstantBC_lambda = {
"lambda", (PyCFunction)(
void*)(PyCFunctionWithKeywords)__pyx_pw_18BoundaryConditions_17BoundaryCondition_13setConstantBC_lambda, METH_VARARGS|METH_KEYWORDS, 0};
5019 static PyObject *__pyx_pw_18BoundaryConditions_17BoundaryCondition_13setConstantBC_lambda(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
5020 CYTHON_UNUSED PyObject *__pyx_v_x = 0;
5021 CYTHON_UNUSED PyObject *__pyx_v_t = 0;
5022 CYTHON_UNUSED PyObject *__pyx_v_n = 0;
5023 int __pyx_lineno = 0;
5024 const char *__pyx_filename = NULL;
5025 int __pyx_clineno = 0;
5026 PyObject *__pyx_r = 0;
5027 __Pyx_RefNannyDeclarations
5028 __Pyx_RefNannySetupContext(
"lambda (wrapper)", 0);
5030 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_x,&__pyx_n_s_t,&__pyx_n_s_n,0};
5031 PyObject* values[3] = {0,0,0};
5032 __pyx_defaults *__pyx_dynamic_args = __Pyx_CyFunction_Defaults(__pyx_defaults, __pyx_self);
5033 values[2] = __pyx_dynamic_args->__pyx_arg_n;
5034 if (unlikely(__pyx_kwds)) {
5036 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
5038 case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
5040 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
5042 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
5045 default:
goto __pyx_L5_argtuple_error;
5047 kw_args = PyDict_Size(__pyx_kwds);
5050 if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_x)) != 0)) kw_args--;
5051 else goto __pyx_L5_argtuple_error;
5054 if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_t)) != 0)) kw_args--;
5056 __Pyx_RaiseArgtupleInvalid(
"lambda", 0, 2, 3, 1); __PYX_ERR(0, 97, __pyx_L3_error)
5061 PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_n);
5062 if (value) { values[2] = value; kw_args--; }
5065 if (unlikely(kw_args > 0)) {
5066 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args,
"lambda") < 0)) __PYX_ERR(0, 97, __pyx_L3_error)
5069 switch (PyTuple_GET_SIZE(__pyx_args)) {
5070 case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
5072 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
5073 values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
5075 default:
goto __pyx_L5_argtuple_error;
5078 __pyx_v_x = values[0];
5079 __pyx_v_t = values[1];
5080 __pyx_v_n = values[2];
5082 goto __pyx_L4_argument_unpacking_done;
5083 __pyx_L5_argtuple_error:;
5084 __Pyx_RaiseArgtupleInvalid(
"lambda", 0, 2, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 97, __pyx_L3_error)
5086 __Pyx_AddTraceback(
"BoundaryConditions.BoundaryCondition.setConstantBC.lambda", __pyx_clineno, __pyx_lineno, __pyx_filename);
5087 __Pyx_RefNannyFinishContext();
5089 __pyx_L4_argument_unpacking_done:;
5090 __pyx_r = __pyx_lambda_funcdef_lambda(__pyx_self, __pyx_v_x, __pyx_v_t, __pyx_v_n);
5093 __Pyx_RefNannyFinishContext();
5097 static PyObject *__pyx_lambda_funcdef_lambda(PyObject *__pyx_self, CYTHON_UNUSED PyObject *__pyx_v_x, CYTHON_UNUSED PyObject *__pyx_v_t, CYTHON_UNUSED PyObject *__pyx_v_n) {
5098 struct __pyx_obj_18BoundaryConditions___pyx_scope_struct__setConstantBC *__pyx_cur_scope;
5099 struct __pyx_obj_18BoundaryConditions___pyx_scope_struct__setConstantBC *__pyx_outer_scope;
5100 PyObject *__pyx_r = NULL;
5101 __Pyx_TraceDeclarations
5102 __Pyx_RefNannyDeclarations
5103 int __pyx_lineno = 0;
5104 const char *__pyx_filename = NULL;
5105 int __pyx_clineno = 0;
5106 __Pyx_RefNannySetupContext(
"lambda", 0);
5107 __pyx_outer_scope = (
struct __pyx_obj_18BoundaryConditions___pyx_scope_struct__setConstantBC *) __Pyx_CyFunction_GetClosure(__pyx_self);
5108 __pyx_cur_scope = __pyx_outer_scope;
5109 __Pyx_TraceCall(
"lambda", __pyx_f[0], 97, 0, __PYX_ERR(0, 97, __pyx_L1_error));
5110 __Pyx_XDECREF(__pyx_r);
5111 if (unlikely(!__pyx_cur_scope->__pyx_v_value)) { __Pyx_RaiseClosureNameError(
"value"); __PYX_ERR(0, 97, __pyx_L1_error) }
5112 __Pyx_INCREF(__pyx_cur_scope->__pyx_v_value);
5113 __pyx_r = __pyx_cur_scope->__pyx_v_value;
5118 __Pyx_AddTraceback(
"BoundaryConditions.BoundaryCondition.setConstantBC.lambda", __pyx_clineno, __pyx_lineno, __pyx_filename);
5121 __Pyx_XGIVEREF(__pyx_r);
5122 __Pyx_TraceReturn(__pyx_r, 0);
5123 __Pyx_RefNannyFinishContext();
5135 static PyObject *__pyx_pf_18BoundaryConditions_17BoundaryCondition_6setConstantBC(
struct __pyx_obj_18BoundaryConditions_BoundaryCondition *__pyx_v_self, PyObject *__pyx_v_value) {
5136 struct __pyx_obj_18BoundaryConditions___pyx_scope_struct__setConstantBC *__pyx_cur_scope;
5137 PyObject *__pyx_r = NULL;
5138 __Pyx_TraceDeclarations
5139 __Pyx_RefNannyDeclarations
5140 PyObject *__pyx_t_1 = NULL;
5141 PyObject *__pyx_t_2 = NULL;
5142 PyObject *__pyx_t_3 = NULL;
5143 PyObject *__pyx_t_4 = NULL;
5144 int __pyx_lineno = 0;
5145 const char *__pyx_filename = NULL;
5146 int __pyx_clineno = 0;
5147 __Pyx_TraceFrameInit(__pyx_codeobj__6)
5148 __Pyx_RefNannySetupContext(
"setConstantBC", 0);
5149 __pyx_cur_scope = (
struct __pyx_obj_18BoundaryConditions___pyx_scope_struct__setConstantBC *)__pyx_tp_new_18BoundaryConditions___pyx_scope_struct__setConstantBC(__pyx_ptype_18BoundaryConditions___pyx_scope_struct__setConstantBC, __pyx_empty_tuple, NULL);
5150 if (unlikely(!__pyx_cur_scope)) {
5151 __pyx_cur_scope = ((
struct __pyx_obj_18BoundaryConditions___pyx_scope_struct__setConstantBC *)Py_None);
5152 __Pyx_INCREF(Py_None);
5153 __PYX_ERR(0, 87, __pyx_L1_error)
5155 __Pyx_GOTREF(__pyx_cur_scope);
5157 __Pyx_TraceCall(
"setConstantBC", __pyx_f[0], 87, 0, __PYX_ERR(0, 87, __pyx_L1_error));
5158 __pyx_cur_scope->__pyx_v_value = __pyx_v_value;
5159 __Pyx_INCREF(__pyx_cur_scope->__pyx_v_value);
5160 __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_value);
5169 __pyx_t_1 = __Pyx_CyFunction_New(&__pyx_mdef_18BoundaryConditions_17BoundaryCondition_13setConstantBC_lambda, 0, __pyx_n_s_setConstantBC_locals_lambda, ((PyObject*)__pyx_cur_scope), __pyx_n_s_BoundaryConditions, __pyx_d, NULL);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 97, __pyx_L1_error)
5170 __Pyx_GOTREF(__pyx_t_1);
5171 if (!__Pyx_CyFunction_InitDefaults(__pyx_t_1,
sizeof(__pyx_defaults), 1)) __PYX_ERR(0, 97, __pyx_L1_error)
5172 __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_np);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 97, __pyx_L1_error)
5173 __Pyx_GOTREF(__pyx_t_3);
5174 __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_zeros);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 97, __pyx_L1_error)
5175 __Pyx_GOTREF(__pyx_t_4);
5176 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
5178 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
5179 __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_4);
5180 if (likely(__pyx_t_3)) {
5181 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_4);
5182 __Pyx_INCREF(__pyx_t_3);
5183 __Pyx_INCREF(
function);
5184 __Pyx_DECREF_SET(__pyx_t_4,
function);
5187 __pyx_t_2 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_3, __pyx_int_3) : __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_int_3);
5188 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
5189 if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 97, __pyx_L1_error)
5190 __Pyx_GOTREF(__pyx_t_2);
5191 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
5192 __Pyx_CyFunction_Defaults(__pyx_defaults, __pyx_t_1)->__pyx_arg_n = __pyx_t_2;
5193 __Pyx_GIVEREF(__pyx_t_2);
5195 __Pyx_CyFunction_SetDefaultsGetter(__pyx_t_1, __pyx_pf_18BoundaryConditions_2__defaults__);
5196 __Pyx_GIVEREF(__pyx_t_1);
5197 __Pyx_GOTREF(__pyx_v_self->uOfXT);
5198 __Pyx_DECREF(__pyx_v_self->uOfXT);
5199 __pyx_v_self->uOfXT = __pyx_t_1;
5211 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
5214 __Pyx_XDECREF(__pyx_t_1);
5215 __Pyx_XDECREF(__pyx_t_2);
5216 __Pyx_XDECREF(__pyx_t_3);
5217 __Pyx_XDECREF(__pyx_t_4);
5218 __Pyx_AddTraceback(
"BoundaryConditions.BoundaryCondition.setConstantBC", __pyx_clineno, __pyx_lineno, __pyx_filename);
5221 __Pyx_DECREF(((PyObject *)__pyx_cur_scope));
5222 __Pyx_XGIVEREF(__pyx_r);
5223 __Pyx_TraceReturn(__pyx_r, 0);
5224 __Pyx_RefNannyFinishContext();
5237 static PyObject *__pyx_pw_18BoundaryConditions_17BoundaryCondition_9setLinearBC(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
5238 static char __pyx_doc_18BoundaryConditions_17BoundaryCondition_8setLinearBC[] =
"BoundaryCondition.setLinearBC(self, a0, a)\n\n function returning value=a0+ax*x+ay*y+az*z\n\n Parameters\n ----------\n a0 : float\n constant\n a: numpy.ndarray\n ax,ay,az\n\n ";
5239 static PyMethodDef __pyx_mdef_18BoundaryConditions_17BoundaryCondition_9setLinearBC = {
"setLinearBC", (PyCFunction)(
void*)(PyCFunctionWithKeywords)__pyx_pw_18BoundaryConditions_17BoundaryCondition_9setLinearBC, METH_VARARGS|METH_KEYWORDS, __pyx_doc_18BoundaryConditions_17BoundaryCondition_8setLinearBC};
5240 static PyObject *__pyx_pw_18BoundaryConditions_17BoundaryCondition_9setLinearBC(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
5241 PyObject *__pyx_v_a0 = 0;
5242 PyObject *__pyx_v_a = 0;
5243 int __pyx_lineno = 0;
5244 const char *__pyx_filename = NULL;
5245 int __pyx_clineno = 0;
5246 PyObject *__pyx_r = 0;
5247 __Pyx_RefNannyDeclarations
5248 __Pyx_RefNannySetupContext(
"setLinearBC (wrapper)", 0);
5250 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_a0,&__pyx_n_s_a,0};
5251 PyObject* values[2] = {0,0};
5252 if (unlikely(__pyx_kwds)) {
5254 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
5256 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
5258 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
5261 default:
goto __pyx_L5_argtuple_error;
5263 kw_args = PyDict_Size(__pyx_kwds);
5266 if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_a0)) != 0)) kw_args--;
5267 else goto __pyx_L5_argtuple_error;
5270 if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_a)) != 0)) kw_args--;
5272 __Pyx_RaiseArgtupleInvalid(
"setLinearBC", 1, 2, 2, 1); __PYX_ERR(0, 100, __pyx_L3_error)
5275 if (unlikely(kw_args > 0)) {
5276 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args,
"setLinearBC") < 0)) __PYX_ERR(0, 100, __pyx_L3_error)
5278 }
else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
5279 goto __pyx_L5_argtuple_error;
5281 values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
5282 values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
5284 __pyx_v_a0 = values[0];
5285 __pyx_v_a = values[1];
5287 goto __pyx_L4_argument_unpacking_done;
5288 __pyx_L5_argtuple_error:;
5289 __Pyx_RaiseArgtupleInvalid(
"setLinearBC", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 100, __pyx_L3_error)
5291 __Pyx_AddTraceback(
"BoundaryConditions.BoundaryCondition.setLinearBC", __pyx_clineno, __pyx_lineno, __pyx_filename);
5292 __Pyx_RefNannyFinishContext();
5294 __pyx_L4_argument_unpacking_done:;
5295 __pyx_r = __pyx_pf_18BoundaryConditions_17BoundaryCondition_8setLinearBC(((
struct __pyx_obj_18BoundaryConditions_BoundaryCondition *)__pyx_v_self), __pyx_v_a0, __pyx_v_a);
5298 __Pyx_RefNannyFinishContext();
5310 static PyObject *__pyx_pf_18BoundaryConditions_4__defaults__(CYTHON_UNUSED PyObject *__pyx_self) {
5311 PyObject *__pyx_r = NULL;
5312 __Pyx_TraceDeclarations
5313 __Pyx_RefNannyDeclarations
5314 PyObject *__pyx_t_1 = NULL;
5315 PyObject *__pyx_t_2 = NULL;
5316 int __pyx_lineno = 0;
5317 const char *__pyx_filename = NULL;
5318 int __pyx_clineno = 0;
5319 __Pyx_RefNannySetupContext(
"__defaults__", 0);
5320 __Pyx_TraceCall(
"__defaults__", __pyx_f[0], 113, 0, __PYX_ERR(0, 113, __pyx_L1_error));
5321 __Pyx_XDECREF(__pyx_r);
5322 __pyx_t_1 = PyTuple_New(1);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 113, __pyx_L1_error)
5323 __Pyx_GOTREF(__pyx_t_1);
5324 __Pyx_INCREF(__Pyx_CyFunction_Defaults(__pyx_defaults1, __pyx_self)->__pyx_arg_n);
5325 __Pyx_GIVEREF(__Pyx_CyFunction_Defaults(__pyx_defaults1, __pyx_self)->__pyx_arg_n);
5326 PyTuple_SET_ITEM(__pyx_t_1, 0, __Pyx_CyFunction_Defaults(__pyx_defaults1, __pyx_self)->__pyx_arg_n);
5327 __pyx_t_2 = PyTuple_New(2);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 113, __pyx_L1_error)
5328 __Pyx_GOTREF(__pyx_t_2);
5329 __Pyx_GIVEREF(__pyx_t_1);
5330 PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1);
5331 __Pyx_INCREF(Py_None);
5332 __Pyx_GIVEREF(Py_None);
5333 PyTuple_SET_ITEM(__pyx_t_2, 1, Py_None);
5335 __pyx_r = __pyx_t_2;
5341 __Pyx_XDECREF(__pyx_t_1);
5342 __Pyx_XDECREF(__pyx_t_2);
5343 __Pyx_AddTraceback(
"BoundaryConditions.__defaults__", __pyx_clineno, __pyx_lineno, __pyx_filename);
5346 __Pyx_XGIVEREF(__pyx_r);
5347 __Pyx_TraceReturn(__pyx_r, 0);
5348 __Pyx_RefNannyFinishContext();
5353 static PyObject *__pyx_pw_18BoundaryConditions_17BoundaryCondition_11setLinearBC_lambda1(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
5354 static PyMethodDef __pyx_mdef_18BoundaryConditions_17BoundaryCondition_11setLinearBC_lambda1 = {
"lambda1", (PyCFunction)(
void*)(PyCFunctionWithKeywords)__pyx_pw_18BoundaryConditions_17BoundaryCondition_11setLinearBC_lambda1, METH_VARARGS|METH_KEYWORDS, 0};
5355 static PyObject *__pyx_pw_18BoundaryConditions_17BoundaryCondition_11setLinearBC_lambda1(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
5356 PyObject *__pyx_v_x = 0;
5357 CYTHON_UNUSED PyObject *__pyx_v_t = 0;
5358 CYTHON_UNUSED PyObject *__pyx_v_n = 0;
5359 int __pyx_lineno = 0;
5360 const char *__pyx_filename = NULL;
5361 int __pyx_clineno = 0;
5362 PyObject *__pyx_r = 0;
5363 __Pyx_RefNannyDeclarations
5364 __Pyx_RefNannySetupContext(
"lambda1 (wrapper)", 0);
5366 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_x,&__pyx_n_s_t,&__pyx_n_s_n,0};
5367 PyObject* values[3] = {0,0,0};
5368 __pyx_defaults1 *__pyx_dynamic_args = __Pyx_CyFunction_Defaults(__pyx_defaults1, __pyx_self);
5369 values[2] = __pyx_dynamic_args->__pyx_arg_n;
5370 if (unlikely(__pyx_kwds)) {
5372 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
5374 case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
5376 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
5378 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
5381 default:
goto __pyx_L5_argtuple_error;
5383 kw_args = PyDict_Size(__pyx_kwds);
5386 if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_x)) != 0)) kw_args--;
5387 else goto __pyx_L5_argtuple_error;
5390 if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_t)) != 0)) kw_args--;
5392 __Pyx_RaiseArgtupleInvalid(
"lambda1", 0, 2, 3, 1); __PYX_ERR(0, 113, __pyx_L3_error)
5397 PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_n);
5398 if (value) { values[2] = value; kw_args--; }
5401 if (unlikely(kw_args > 0)) {
5402 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args,
"lambda1") < 0)) __PYX_ERR(0, 113, __pyx_L3_error)
5405 switch (PyTuple_GET_SIZE(__pyx_args)) {
5406 case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
5408 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
5409 values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
5411 default:
goto __pyx_L5_argtuple_error;
5414 __pyx_v_x = values[0];
5415 __pyx_v_t = values[1];
5416 __pyx_v_n = values[2];
5418 goto __pyx_L4_argument_unpacking_done;
5419 __pyx_L5_argtuple_error:;
5420 __Pyx_RaiseArgtupleInvalid(
"lambda1", 0, 2, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 113, __pyx_L3_error)
5422 __Pyx_AddTraceback(
"BoundaryConditions.BoundaryCondition.setLinearBC.lambda1", __pyx_clineno, __pyx_lineno, __pyx_filename);
5423 __Pyx_RefNannyFinishContext();
5425 __pyx_L4_argument_unpacking_done:;
5426 __pyx_r = __pyx_lambda_funcdef_lambda1(__pyx_self, __pyx_v_x, __pyx_v_t, __pyx_v_n);
5429 __Pyx_RefNannyFinishContext();
5433 static PyObject *__pyx_lambda_funcdef_lambda1(PyObject *__pyx_self, PyObject *__pyx_v_x, CYTHON_UNUSED PyObject *__pyx_v_t, CYTHON_UNUSED PyObject *__pyx_v_n) {
5434 struct __pyx_obj_18BoundaryConditions___pyx_scope_struct_1_setLinearBC *__pyx_cur_scope;
5435 struct __pyx_obj_18BoundaryConditions___pyx_scope_struct_1_setLinearBC *__pyx_outer_scope;
5436 PyObject *__pyx_r = NULL;
5437 __Pyx_TraceDeclarations
5438 __Pyx_RefNannyDeclarations
5439 PyObject *__pyx_t_1 = NULL;
5440 PyObject *__pyx_t_2 = NULL;
5441 PyObject *__pyx_t_3 = NULL;
5442 int __pyx_lineno = 0;
5443 const char *__pyx_filename = NULL;
5444 int __pyx_clineno = 0;
5445 __Pyx_RefNannySetupContext(
"lambda1", 0);
5446 __pyx_outer_scope = (
struct __pyx_obj_18BoundaryConditions___pyx_scope_struct_1_setLinearBC *) __Pyx_CyFunction_GetClosure(__pyx_self);
5447 __pyx_cur_scope = __pyx_outer_scope;
5448 __Pyx_TraceCall(
"lambda1", __pyx_f[0], 113, 0, __PYX_ERR(0, 113, __pyx_L1_error));
5449 __Pyx_XDECREF(__pyx_r);
5450 if (unlikely(!__pyx_cur_scope->__pyx_v_a0)) { __Pyx_RaiseClosureNameError(
"a0"); __PYX_ERR(0, 113, __pyx_L1_error) }
5451 if (unlikely(!__pyx_cur_scope->__pyx_v_a)) { __Pyx_RaiseClosureNameError(
"a"); __PYX_ERR(0, 113, __pyx_L1_error) }
5452 __pyx_t_1 = __Pyx_PyObject_GetSlice(__pyx_cur_scope->__pyx_v_a, 0, 0, NULL, NULL, &__pyx_slice__7, 0, 0, 0);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 113, __pyx_L1_error)
5453 __Pyx_GOTREF(__pyx_t_1);
5454 __pyx_t_2 = __Pyx_PyObject_GetSlice(__pyx_v_x, 0, 0, NULL, NULL, &__pyx_slice__7, 0, 0, 0);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 113, __pyx_L1_error)
5455 __Pyx_GOTREF(__pyx_t_2);
5456 __pyx_t_3 = PyNumber_Multiply(__pyx_t_1, __pyx_t_2);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 113, __pyx_L1_error)
5457 __Pyx_GOTREF(__pyx_t_3);
5458 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
5459 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
5460 __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_builtin_sum, __pyx_t_3);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 113, __pyx_L1_error)
5461 __Pyx_GOTREF(__pyx_t_2);
5462 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
5463 __pyx_t_3 = PyNumber_Add(__pyx_cur_scope->__pyx_v_a0, __pyx_t_2);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 113, __pyx_L1_error)
5464 __Pyx_GOTREF(__pyx_t_3);
5465 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
5466 __pyx_r = __pyx_t_3;
5472 __Pyx_XDECREF(__pyx_t_1);
5473 __Pyx_XDECREF(__pyx_t_2);
5474 __Pyx_XDECREF(__pyx_t_3);
5475 __Pyx_AddTraceback(
"BoundaryConditions.BoundaryCondition.setLinearBC.lambda1", __pyx_clineno, __pyx_lineno, __pyx_filename);
5478 __Pyx_XGIVEREF(__pyx_r);
5479 __Pyx_TraceReturn(__pyx_r, 0);
5480 __Pyx_RefNannyFinishContext();
5492 static PyObject *__pyx_pf_18BoundaryConditions_17BoundaryCondition_8setLinearBC(
struct __pyx_obj_18BoundaryConditions_BoundaryCondition *__pyx_v_self, PyObject *__pyx_v_a0, PyObject *__pyx_v_a) {
5493 struct __pyx_obj_18BoundaryConditions___pyx_scope_struct_1_setLinearBC *__pyx_cur_scope;
5494 PyObject *__pyx_r = NULL;
5495 __Pyx_TraceDeclarations
5496 __Pyx_RefNannyDeclarations
5497 PyObject *__pyx_t_1 = NULL;
5498 PyObject *__pyx_t_2 = NULL;
5499 PyObject *__pyx_t_3 = NULL;
5500 PyObject *__pyx_t_4 = NULL;
5501 int __pyx_lineno = 0;
5502 const char *__pyx_filename = NULL;
5503 int __pyx_clineno = 0;
5504 __Pyx_TraceFrameInit(__pyx_codeobj__8)
5505 __Pyx_RefNannySetupContext(
"setLinearBC", 0);
5506 __pyx_cur_scope = (
struct __pyx_obj_18BoundaryConditions___pyx_scope_struct_1_setLinearBC *)__pyx_tp_new_18BoundaryConditions___pyx_scope_struct_1_setLinearBC(__pyx_ptype_18BoundaryConditions___pyx_scope_struct_1_setLinearBC, __pyx_empty_tuple, NULL);
5507 if (unlikely(!__pyx_cur_scope)) {
5508 __pyx_cur_scope = ((
struct __pyx_obj_18BoundaryConditions___pyx_scope_struct_1_setLinearBC *)Py_None);
5509 __Pyx_INCREF(Py_None);
5510 __PYX_ERR(0, 100, __pyx_L1_error)
5512 __Pyx_GOTREF(__pyx_cur_scope);
5514 __Pyx_TraceCall(
"setLinearBC", __pyx_f[0], 100, 0, __PYX_ERR(0, 100, __pyx_L1_error));
5515 __pyx_cur_scope->__pyx_v_a0 = __pyx_v_a0;
5516 __Pyx_INCREF(__pyx_cur_scope->__pyx_v_a0);
5517 __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_a0);
5518 __pyx_cur_scope->__pyx_v_a = __pyx_v_a;
5519 __Pyx_INCREF(__pyx_cur_scope->__pyx_v_a);
5520 __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_a);
5529 __pyx_t_1 = __Pyx_CyFunction_New(&__pyx_mdef_18BoundaryConditions_17BoundaryCondition_11setLinearBC_lambda1, 0, __pyx_n_s_setLinearBC_locals_lambda, ((PyObject*)__pyx_cur_scope), __pyx_n_s_BoundaryConditions, __pyx_d, NULL);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 113, __pyx_L1_error)
5530 __Pyx_GOTREF(__pyx_t_1);
5531 if (!__Pyx_CyFunction_InitDefaults(__pyx_t_1,
sizeof(__pyx_defaults1), 1)) __PYX_ERR(0, 113, __pyx_L1_error)
5532 __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_np);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 113, __pyx_L1_error)
5533 __Pyx_GOTREF(__pyx_t_3);
5534 __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_zeros);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 113, __pyx_L1_error)
5535 __Pyx_GOTREF(__pyx_t_4);
5536 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
5538 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
5539 __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_4);
5540 if (likely(__pyx_t_3)) {
5541 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_4);
5542 __Pyx_INCREF(__pyx_t_3);
5543 __Pyx_INCREF(
function);
5544 __Pyx_DECREF_SET(__pyx_t_4,
function);
5547 __pyx_t_2 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_3, __pyx_int_3) : __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_int_3);
5548 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
5549 if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 113, __pyx_L1_error)
5550 __Pyx_GOTREF(__pyx_t_2);
5551 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
5552 __Pyx_CyFunction_Defaults(__pyx_defaults1, __pyx_t_1)->__pyx_arg_n = __pyx_t_2;
5553 __Pyx_GIVEREF(__pyx_t_2);
5555 __Pyx_CyFunction_SetDefaultsGetter(__pyx_t_1, __pyx_pf_18BoundaryConditions_4__defaults__);
5556 __Pyx_GIVEREF(__pyx_t_1);
5557 __Pyx_GOTREF(__pyx_v_self->uOfXT);
5558 __Pyx_DECREF(__pyx_v_self->uOfXT);
5559 __pyx_v_self->uOfXT = __pyx_t_1;
5571 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
5574 __Pyx_XDECREF(__pyx_t_1);
5575 __Pyx_XDECREF(__pyx_t_2);
5576 __Pyx_XDECREF(__pyx_t_3);
5577 __Pyx_XDECREF(__pyx_t_4);
5578 __Pyx_AddTraceback(
"BoundaryConditions.BoundaryCondition.setLinearBC", __pyx_clineno, __pyx_lineno, __pyx_filename);
5581 __Pyx_DECREF(((PyObject *)__pyx_cur_scope));
5582 __Pyx_XGIVEREF(__pyx_r);
5583 __Pyx_TraceReturn(__pyx_r, 0);
5584 __Pyx_RefNannyFinishContext();
5597 static PyObject *__pyx_pw_18BoundaryConditions_17BoundaryCondition_11setLinearRamp(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
5598 static char __pyx_doc_18BoundaryConditions_17BoundaryCondition_10setLinearRamp[] =
"BoundaryCondition.setLinearRamp(self, t1, value)\n\n function setting a linear ramp from t=0 to t=t1\n\n Parameters\n -----------\n t1: float\n Ramp end time\n value: float\n Variable value\n ";
5599 static PyMethodDef __pyx_mdef_18BoundaryConditions_17BoundaryCondition_11setLinearRamp = {
"setLinearRamp", (PyCFunction)(
void*)(PyCFunctionWithKeywords)__pyx_pw_18BoundaryConditions_17BoundaryCondition_11setLinearRamp, METH_VARARGS|METH_KEYWORDS, __pyx_doc_18BoundaryConditions_17BoundaryCondition_10setLinearRamp};
5600 static PyObject *__pyx_pw_18BoundaryConditions_17BoundaryCondition_11setLinearRamp(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
5601 PyObject *__pyx_v_t1 = 0;
5602 PyObject *__pyx_v_value = 0;
5603 int __pyx_lineno = 0;
5604 const char *__pyx_filename = NULL;
5605 int __pyx_clineno = 0;
5606 PyObject *__pyx_r = 0;
5607 __Pyx_RefNannyDeclarations
5608 __Pyx_RefNannySetupContext(
"setLinearRamp (wrapper)", 0);
5610 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_t1,&__pyx_n_s_value,0};
5611 PyObject* values[2] = {0,0};
5612 if (unlikely(__pyx_kwds)) {
5614 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
5616 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
5618 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
5621 default:
goto __pyx_L5_argtuple_error;
5623 kw_args = PyDict_Size(__pyx_kwds);
5626 if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_t1)) != 0)) kw_args--;
5627 else goto __pyx_L5_argtuple_error;
5630 if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_value)) != 0)) kw_args--;
5632 __Pyx_RaiseArgtupleInvalid(
"setLinearRamp", 1, 2, 2, 1); __PYX_ERR(0, 115, __pyx_L3_error)
5635 if (unlikely(kw_args > 0)) {
5636 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args,
"setLinearRamp") < 0)) __PYX_ERR(0, 115, __pyx_L3_error)
5638 }
else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
5639 goto __pyx_L5_argtuple_error;
5641 values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
5642 values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
5644 __pyx_v_t1 = values[0];
5645 __pyx_v_value = values[1];
5647 goto __pyx_L4_argument_unpacking_done;
5648 __pyx_L5_argtuple_error:;
5649 __Pyx_RaiseArgtupleInvalid(
"setLinearRamp", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 115, __pyx_L3_error)
5651 __Pyx_AddTraceback(
"BoundaryConditions.BoundaryCondition.setLinearRamp", __pyx_clineno, __pyx_lineno, __pyx_filename);
5652 __Pyx_RefNannyFinishContext();
5654 __pyx_L4_argument_unpacking_done:;
5655 __pyx_r = __pyx_pf_18BoundaryConditions_17BoundaryCondition_10setLinearRamp(((
struct __pyx_obj_18BoundaryConditions_BoundaryCondition *)__pyx_v_self), __pyx_v_t1, __pyx_v_value);
5658 __Pyx_RefNannyFinishContext();
5668 static PyObject *__pyx_pf_18BoundaryConditions_6__defaults__(CYTHON_UNUSED PyObject *__pyx_self) {
5669 PyObject *__pyx_r = NULL;
5670 __Pyx_TraceDeclarations
5671 __Pyx_RefNannyDeclarations
5672 PyObject *__pyx_t_1 = NULL;
5673 PyObject *__pyx_t_2 = NULL;
5674 int __pyx_lineno = 0;
5675 const char *__pyx_filename = NULL;
5676 int __pyx_clineno = 0;
5677 __Pyx_RefNannySetupContext(
"__defaults__", 0);
5678 __Pyx_TraceCall(
"__defaults__", __pyx_f[0], 126, 0, __PYX_ERR(0, 126, __pyx_L1_error));
5679 __Pyx_XDECREF(__pyx_r);
5680 __pyx_t_1 = PyTuple_New(1);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 126, __pyx_L1_error)
5681 __Pyx_GOTREF(__pyx_t_1);
5682 __Pyx_INCREF(__Pyx_CyFunction_Defaults(__pyx_defaults2, __pyx_self)->__pyx_arg_n);
5683 __Pyx_GIVEREF(__Pyx_CyFunction_Defaults(__pyx_defaults2, __pyx_self)->__pyx_arg_n);
5684 PyTuple_SET_ITEM(__pyx_t_1, 0, __Pyx_CyFunction_Defaults(__pyx_defaults2, __pyx_self)->__pyx_arg_n);
5685 __pyx_t_2 = PyTuple_New(2);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 126, __pyx_L1_error)
5686 __Pyx_GOTREF(__pyx_t_2);
5687 __Pyx_GIVEREF(__pyx_t_1);
5688 PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1);
5689 __Pyx_INCREF(Py_None);
5690 __Pyx_GIVEREF(Py_None);
5691 PyTuple_SET_ITEM(__pyx_t_2, 1, Py_None);
5693 __pyx_r = __pyx_t_2;
5699 __Pyx_XDECREF(__pyx_t_1);
5700 __Pyx_XDECREF(__pyx_t_2);
5701 __Pyx_AddTraceback(
"BoundaryConditions.__defaults__", __pyx_clineno, __pyx_lineno, __pyx_filename);
5704 __Pyx_XGIVEREF(__pyx_r);
5705 __Pyx_TraceReturn(__pyx_r, 0);
5706 __Pyx_RefNannyFinishContext();
5711 static PyObject *__pyx_pw_18BoundaryConditions_17BoundaryCondition_13setLinearRamp_lambda2(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
5712 static PyMethodDef __pyx_mdef_18BoundaryConditions_17BoundaryCondition_13setLinearRamp_lambda2 = {
"lambda2", (PyCFunction)(
void*)(PyCFunctionWithKeywords)__pyx_pw_18BoundaryConditions_17BoundaryCondition_13setLinearRamp_lambda2, METH_VARARGS|METH_KEYWORDS, 0};
5713 static PyObject *__pyx_pw_18BoundaryConditions_17BoundaryCondition_13setLinearRamp_lambda2(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
5714 CYTHON_UNUSED PyObject *__pyx_v_x = 0;
5715 PyObject *__pyx_v_t = 0;
5716 CYTHON_UNUSED PyObject *__pyx_v_n = 0;
5717 int __pyx_lineno = 0;
5718 const char *__pyx_filename = NULL;
5719 int __pyx_clineno = 0;
5720 PyObject *__pyx_r = 0;
5721 __Pyx_RefNannyDeclarations
5722 __Pyx_RefNannySetupContext(
"lambda2 (wrapper)", 0);
5724 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_x,&__pyx_n_s_t,&__pyx_n_s_n,0};
5725 PyObject* values[3] = {0,0,0};
5726 __pyx_defaults2 *__pyx_dynamic_args = __Pyx_CyFunction_Defaults(__pyx_defaults2, __pyx_self);
5727 values[2] = __pyx_dynamic_args->__pyx_arg_n;
5728 if (unlikely(__pyx_kwds)) {
5730 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
5732 case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
5734 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
5736 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
5739 default:
goto __pyx_L5_argtuple_error;
5741 kw_args = PyDict_Size(__pyx_kwds);
5744 if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_x)) != 0)) kw_args--;
5745 else goto __pyx_L5_argtuple_error;
5748 if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_t)) != 0)) kw_args--;
5750 __Pyx_RaiseArgtupleInvalid(
"lambda2", 0, 2, 3, 1); __PYX_ERR(0, 126, __pyx_L3_error)
5755 PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_n);
5756 if (value) { values[2] = value; kw_args--; }
5759 if (unlikely(kw_args > 0)) {
5760 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args,
"lambda2") < 0)) __PYX_ERR(0, 126, __pyx_L3_error)
5763 switch (PyTuple_GET_SIZE(__pyx_args)) {
5764 case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
5766 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
5767 values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
5769 default:
goto __pyx_L5_argtuple_error;
5772 __pyx_v_x = values[0];
5773 __pyx_v_t = values[1];
5774 __pyx_v_n = values[2];
5776 goto __pyx_L4_argument_unpacking_done;
5777 __pyx_L5_argtuple_error:;
5778 __Pyx_RaiseArgtupleInvalid(
"lambda2", 0, 2, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 126, __pyx_L3_error)
5780 __Pyx_AddTraceback(
"BoundaryConditions.BoundaryCondition.setLinearRamp.lambda2", __pyx_clineno, __pyx_lineno, __pyx_filename);
5781 __Pyx_RefNannyFinishContext();
5783 __pyx_L4_argument_unpacking_done:;
5784 __pyx_r = __pyx_lambda_funcdef_lambda2(__pyx_self, __pyx_v_x, __pyx_v_t, __pyx_v_n);
5787 __Pyx_RefNannyFinishContext();
5791 static PyObject *__pyx_lambda_funcdef_lambda2(PyObject *__pyx_self, CYTHON_UNUSED PyObject *__pyx_v_x, PyObject *__pyx_v_t, CYTHON_UNUSED PyObject *__pyx_v_n) {
5792 struct __pyx_obj_18BoundaryConditions___pyx_scope_struct_2_setLinearRamp *__pyx_cur_scope;
5793 struct __pyx_obj_18BoundaryConditions___pyx_scope_struct_2_setLinearRamp *__pyx_outer_scope;
5794 PyObject *__pyx_r = NULL;
5795 __Pyx_TraceDeclarations
5796 __Pyx_RefNannyDeclarations
5798 PyObject *__pyx_t_2 = NULL;
5799 PyObject *__pyx_t_3 = NULL;
5800 PyObject *__pyx_t_4 = NULL;
5801 PyObject *__pyx_t_5 = NULL;
5803 int __pyx_lineno = 0;
5804 const char *__pyx_filename = NULL;
5805 int __pyx_clineno = 0;
5806 __Pyx_RefNannySetupContext(
"lambda2", 0);
5807 __pyx_outer_scope = (
struct __pyx_obj_18BoundaryConditions___pyx_scope_struct_2_setLinearRamp *) __Pyx_CyFunction_GetClosure(__pyx_self);
5808 __pyx_cur_scope = __pyx_outer_scope;
5809 __Pyx_TraceCall(
"lambda2", __pyx_f[0], 126, 0, __PYX_ERR(0, 126, __pyx_L1_error));
5810 __Pyx_XDECREF(__pyx_r);
5812 if (unlikely(!__pyx_cur_scope->__pyx_v_t1)) { __Pyx_RaiseClosureNameError(
"t1"); __PYX_ERR(0, 126, __pyx_L1_error) }
5813 __pyx_t_2 = __Pyx_PyNumber_Divide(__pyx_v_t, __pyx_cur_scope->__pyx_v_t1);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 126, __pyx_L1_error)
5814 __Pyx_GOTREF(__pyx_t_2);
5815 __pyx_t_4 = __Pyx_PyInt_From_long(__pyx_t_1);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 126, __pyx_L1_error)
5816 __Pyx_GOTREF(__pyx_t_4);
5817 __pyx_t_5 = PyObject_RichCompare(__pyx_t_4, __pyx_t_2, Py_LT); __Pyx_XGOTREF(__pyx_t_5);
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 126, __pyx_L1_error)
5818 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
5819 __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_5);
if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(0, 126, __pyx_L1_error)
5820 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
5822 __pyx_t_5 = __Pyx_PyInt_From_long(__pyx_t_1);
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 126, __pyx_L1_error)
5823 __Pyx_GOTREF(__pyx_t_5);
5824 __pyx_t_3 = __pyx_t_5;
5827 __Pyx_INCREF(__pyx_t_2);
5828 __pyx_t_3 = __pyx_t_2;
5830 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
5831 if (unlikely(!__pyx_cur_scope->__pyx_v_value)) { __Pyx_RaiseClosureNameError(
"value"); __PYX_ERR(0, 126, __pyx_L1_error) }
5832 __pyx_t_2 = PyNumber_Multiply(__pyx_t_3, __pyx_cur_scope->__pyx_v_value);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 126, __pyx_L1_error)
5833 __Pyx_GOTREF(__pyx_t_2);
5834 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
5835 __pyx_r = __pyx_t_2;
5841 __Pyx_XDECREF(__pyx_t_2);
5842 __Pyx_XDECREF(__pyx_t_3);
5843 __Pyx_XDECREF(__pyx_t_4);
5844 __Pyx_XDECREF(__pyx_t_5);
5845 __Pyx_AddTraceback(
"BoundaryConditions.BoundaryCondition.setLinearRamp.lambda2", __pyx_clineno, __pyx_lineno, __pyx_filename);
5848 __Pyx_XGIVEREF(__pyx_r);
5849 __Pyx_TraceReturn(__pyx_r, 0);
5850 __Pyx_RefNannyFinishContext();
5862 static PyObject *__pyx_pf_18BoundaryConditions_17BoundaryCondition_10setLinearRamp(
struct __pyx_obj_18BoundaryConditions_BoundaryCondition *__pyx_v_self, PyObject *__pyx_v_t1, PyObject *__pyx_v_value) {
5863 struct __pyx_obj_18BoundaryConditions___pyx_scope_struct_2_setLinearRamp *__pyx_cur_scope;
5864 PyObject *__pyx_r = NULL;
5865 __Pyx_TraceDeclarations
5866 __Pyx_RefNannyDeclarations
5867 PyObject *__pyx_t_1 = NULL;
5868 PyObject *__pyx_t_2 = NULL;
5869 PyObject *__pyx_t_3 = NULL;
5870 PyObject *__pyx_t_4 = NULL;
5871 int __pyx_lineno = 0;
5872 const char *__pyx_filename = NULL;
5873 int __pyx_clineno = 0;
5874 __Pyx_TraceFrameInit(__pyx_codeobj__9)
5875 __Pyx_RefNannySetupContext(
"setLinearRamp", 0);
5876 __pyx_cur_scope = (
struct __pyx_obj_18BoundaryConditions___pyx_scope_struct_2_setLinearRamp *)__pyx_tp_new_18BoundaryConditions___pyx_scope_struct_2_setLinearRamp(__pyx_ptype_18BoundaryConditions___pyx_scope_struct_2_setLinearRamp, __pyx_empty_tuple, NULL);
5877 if (unlikely(!__pyx_cur_scope)) {
5878 __pyx_cur_scope = ((
struct __pyx_obj_18BoundaryConditions___pyx_scope_struct_2_setLinearRamp *)Py_None);
5879 __Pyx_INCREF(Py_None);
5880 __PYX_ERR(0, 115, __pyx_L1_error)
5882 __Pyx_GOTREF(__pyx_cur_scope);
5884 __Pyx_TraceCall(
"setLinearRamp", __pyx_f[0], 115, 0, __PYX_ERR(0, 115, __pyx_L1_error));
5885 __pyx_cur_scope->__pyx_v_t1 = __pyx_v_t1;
5886 __Pyx_INCREF(__pyx_cur_scope->__pyx_v_t1);
5887 __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_t1);
5888 __pyx_cur_scope->__pyx_v_value = __pyx_v_value;
5889 __Pyx_INCREF(__pyx_cur_scope->__pyx_v_value);
5890 __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_value);
5897 __pyx_t_1 = __Pyx_CyFunction_New(&__pyx_mdef_18BoundaryConditions_17BoundaryCondition_13setLinearRamp_lambda2, 0, __pyx_n_s_setLinearRamp_locals_lambda, ((PyObject*)__pyx_cur_scope), __pyx_n_s_BoundaryConditions, __pyx_d, NULL);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 126, __pyx_L1_error)
5898 __Pyx_GOTREF(__pyx_t_1);
5899 if (!__Pyx_CyFunction_InitDefaults(__pyx_t_1,
sizeof(__pyx_defaults2), 1)) __PYX_ERR(0, 126, __pyx_L1_error)
5900 __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_np);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 126, __pyx_L1_error)
5901 __Pyx_GOTREF(__pyx_t_3);
5902 __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_zeros);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 126, __pyx_L1_error)
5903 __Pyx_GOTREF(__pyx_t_4);
5904 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
5906 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
5907 __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_4);
5908 if (likely(__pyx_t_3)) {
5909 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_4);
5910 __Pyx_INCREF(__pyx_t_3);
5911 __Pyx_INCREF(
function);
5912 __Pyx_DECREF_SET(__pyx_t_4,
function);
5915 __pyx_t_2 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_3, __pyx_int_3) : __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_int_3);
5916 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
5917 if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 126, __pyx_L1_error)
5918 __Pyx_GOTREF(__pyx_t_2);
5919 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
5920 __Pyx_CyFunction_Defaults(__pyx_defaults2, __pyx_t_1)->__pyx_arg_n = __pyx_t_2;
5921 __Pyx_GIVEREF(__pyx_t_2);
5923 __Pyx_CyFunction_SetDefaultsGetter(__pyx_t_1, __pyx_pf_18BoundaryConditions_6__defaults__);
5924 __Pyx_GIVEREF(__pyx_t_1);
5925 __Pyx_GOTREF(__pyx_v_self->uOfXT);
5926 __Pyx_DECREF(__pyx_v_self->uOfXT);
5927 __pyx_v_self->uOfXT = __pyx_t_1;
5939 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
5942 __Pyx_XDECREF(__pyx_t_1);
5943 __Pyx_XDECREF(__pyx_t_2);
5944 __Pyx_XDECREF(__pyx_t_3);
5945 __Pyx_XDECREF(__pyx_t_4);
5946 __Pyx_AddTraceback(
"BoundaryConditions.BoundaryCondition.setLinearRamp", __pyx_clineno, __pyx_lineno, __pyx_filename);
5949 __Pyx_DECREF(((PyObject *)__pyx_cur_scope));
5950 __Pyx_XGIVEREF(__pyx_r);
5951 __Pyx_TraceReturn(__pyx_r, 0);
5952 __Pyx_RefNannyFinishContext();
5965 static PyObject *__pyx_pw_18BoundaryConditions_17BoundaryCondition_5uOfXT_1__get__(PyObject *__pyx_v_self);
5966 static PyObject *__pyx_pw_18BoundaryConditions_17BoundaryCondition_5uOfXT_1__get__(PyObject *__pyx_v_self) {
5967 PyObject *__pyx_r = 0;
5968 __Pyx_RefNannyDeclarations
5969 __Pyx_RefNannySetupContext(
"__get__ (wrapper)", 0);
5970 __pyx_r = __pyx_pf_18BoundaryConditions_17BoundaryCondition_5uOfXT___get__(((
struct __pyx_obj_18BoundaryConditions_BoundaryCondition *)__pyx_v_self));
5973 __Pyx_RefNannyFinishContext();
5977 static PyObject *__pyx_pf_18BoundaryConditions_17BoundaryCondition_5uOfXT___get__(
struct __pyx_obj_18BoundaryConditions_BoundaryCondition *__pyx_v_self) {
5978 PyObject *__pyx_r = NULL;
5979 __Pyx_TraceDeclarations
5980 __Pyx_RefNannyDeclarations
5981 int __pyx_lineno = 0;
5982 const char *__pyx_filename = NULL;
5983 int __pyx_clineno = 0;
5984 __Pyx_RefNannySetupContext(
"__get__", 0);
5985 __Pyx_TraceCall(
"__get__", __pyx_f[2], 20, 0, __PYX_ERR(2, 20, __pyx_L1_error));
5986 __Pyx_XDECREF(__pyx_r);
5987 __Pyx_INCREF(__pyx_v_self->uOfXT);
5988 __pyx_r = __pyx_v_self->uOfXT;
5993 __Pyx_AddTraceback(
"BoundaryConditions.BoundaryCondition.uOfXT.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
5996 __Pyx_XGIVEREF(__pyx_r);
5997 __Pyx_TraceReturn(__pyx_r, 0);
5998 __Pyx_RefNannyFinishContext();
6003 static int __pyx_pw_18BoundaryConditions_17BoundaryCondition_5uOfXT_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value);
6004 static int __pyx_pw_18BoundaryConditions_17BoundaryCondition_5uOfXT_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
6006 __Pyx_RefNannyDeclarations
6007 __Pyx_RefNannySetupContext(
"__set__ (wrapper)", 0);
6008 __pyx_r = __pyx_pf_18BoundaryConditions_17BoundaryCondition_5uOfXT_2__set__(((
struct __pyx_obj_18BoundaryConditions_BoundaryCondition *)__pyx_v_self), ((PyObject *)__pyx_v_value));
6011 __Pyx_RefNannyFinishContext();
6015 static int __pyx_pf_18BoundaryConditions_17BoundaryCondition_5uOfXT_2__set__(
struct __pyx_obj_18BoundaryConditions_BoundaryCondition *__pyx_v_self, PyObject *__pyx_v_value) {
6017 __Pyx_TraceDeclarations
6018 __Pyx_RefNannyDeclarations
6019 int __pyx_lineno = 0;
6020 const char *__pyx_filename = NULL;
6021 int __pyx_clineno = 0;
6022 __Pyx_RefNannySetupContext(
"__set__", 0);
6023 __Pyx_TraceCall(
"__set__", __pyx_f[2], 20, 0, __PYX_ERR(2, 20, __pyx_L1_error));
6024 __Pyx_INCREF(__pyx_v_value);
6025 __Pyx_GIVEREF(__pyx_v_value);
6026 __Pyx_GOTREF(__pyx_v_self->uOfXT);
6027 __Pyx_DECREF(__pyx_v_self->uOfXT);
6028 __pyx_v_self->uOfXT = __pyx_v_value;
6034 __Pyx_AddTraceback(
"BoundaryConditions.BoundaryCondition.uOfXT.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
6037 __Pyx_TraceReturn(Py_None, 0);
6038 __Pyx_RefNannyFinishContext();
6043 static int __pyx_pw_18BoundaryConditions_17BoundaryCondition_5uOfXT_5__del__(PyObject *__pyx_v_self);
6044 static int __pyx_pw_18BoundaryConditions_17BoundaryCondition_5uOfXT_5__del__(PyObject *__pyx_v_self) {
6046 __Pyx_RefNannyDeclarations
6047 __Pyx_RefNannySetupContext(
"__del__ (wrapper)", 0);
6048 __pyx_r = __pyx_pf_18BoundaryConditions_17BoundaryCondition_5uOfXT_4__del__(((
struct __pyx_obj_18BoundaryConditions_BoundaryCondition *)__pyx_v_self));
6051 __Pyx_RefNannyFinishContext();
6055 static int __pyx_pf_18BoundaryConditions_17BoundaryCondition_5uOfXT_4__del__(
struct __pyx_obj_18BoundaryConditions_BoundaryCondition *__pyx_v_self) {
6057 __Pyx_TraceDeclarations
6058 __Pyx_RefNannyDeclarations
6059 int __pyx_lineno = 0;
6060 const char *__pyx_filename = NULL;
6061 int __pyx_clineno = 0;
6062 __Pyx_RefNannySetupContext(
"__del__", 0);
6063 __Pyx_TraceCall(
"__del__", __pyx_f[2], 20, 0, __PYX_ERR(2, 20, __pyx_L1_error));
6064 __Pyx_INCREF(Py_None);
6065 __Pyx_GIVEREF(Py_None);
6066 __Pyx_GOTREF(__pyx_v_self->uOfXT);
6067 __Pyx_DECREF(__pyx_v_self->uOfXT);
6068 __pyx_v_self->uOfXT = Py_None;
6074 __Pyx_AddTraceback(
"BoundaryConditions.BoundaryCondition.uOfXT.__del__", __pyx_clineno, __pyx_lineno, __pyx_filename);
6077 __Pyx_TraceReturn(Py_None, 0);
6078 __Pyx_RefNannyFinishContext();
6089 static PyObject *__pyx_pw_18BoundaryConditions_17BoundaryCondition_13__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused);
6090 static char __pyx_doc_18BoundaryConditions_17BoundaryCondition_12__reduce_cython__[] =
"BoundaryCondition.__reduce_cython__(self)";
6091 static PyMethodDef __pyx_mdef_18BoundaryConditions_17BoundaryCondition_13__reduce_cython__ = {
"__reduce_cython__", (PyCFunction)__pyx_pw_18BoundaryConditions_17BoundaryCondition_13__reduce_cython__, METH_NOARGS, __pyx_doc_18BoundaryConditions_17BoundaryCondition_12__reduce_cython__};
6092 static PyObject *__pyx_pw_18BoundaryConditions_17BoundaryCondition_13__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
6093 PyObject *__pyx_r = 0;
6094 __Pyx_RefNannyDeclarations
6095 __Pyx_RefNannySetupContext(
"__reduce_cython__ (wrapper)", 0);
6096 __pyx_r = __pyx_pf_18BoundaryConditions_17BoundaryCondition_12__reduce_cython__(((
struct __pyx_obj_18BoundaryConditions_BoundaryCondition *)__pyx_v_self));
6099 __Pyx_RefNannyFinishContext();
6103 static PyObject *__pyx_pf_18BoundaryConditions_17BoundaryCondition_12__reduce_cython__(CYTHON_UNUSED
struct __pyx_obj_18BoundaryConditions_BoundaryCondition *__pyx_v_self) {
6104 PyObject *__pyx_r = NULL;
6105 __Pyx_TraceDeclarations
6106 __Pyx_RefNannyDeclarations
6107 PyObject *__pyx_t_1 = NULL;
6108 int __pyx_lineno = 0;
6109 const char *__pyx_filename = NULL;
6110 int __pyx_clineno = 0;
6111 __Pyx_TraceFrameInit(__pyx_codeobj__10)
6112 __Pyx_RefNannySetupContext(
"__reduce_cython__", 0);
6113 __Pyx_TraceCall(
"__reduce_cython__", __pyx_f[1], 1, 0, __PYX_ERR(1, 1, __pyx_L1_error));
6121 __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__11, NULL);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 2, __pyx_L1_error)
6122 __Pyx_GOTREF(__pyx_t_1);
6123 __Pyx_Raise(__pyx_t_1, 0, 0, 0);
6124 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
6125 __PYX_ERR(1, 2, __pyx_L1_error)
6135 __Pyx_XDECREF(__pyx_t_1);
6136 __Pyx_AddTraceback(
"BoundaryConditions.BoundaryCondition.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
6138 __Pyx_XGIVEREF(__pyx_r);
6139 __Pyx_TraceReturn(__pyx_r, 0);
6140 __Pyx_RefNannyFinishContext();
6152 static PyObject *__pyx_pw_18BoundaryConditions_17BoundaryCondition_15__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state);
6153 static char __pyx_doc_18BoundaryConditions_17BoundaryCondition_14__setstate_cython__[] =
"BoundaryCondition.__setstate_cython__(self, __pyx_state)";
6154 static PyMethodDef __pyx_mdef_18BoundaryConditions_17BoundaryCondition_15__setstate_cython__ = {
"__setstate_cython__", (PyCFunction)__pyx_pw_18BoundaryConditions_17BoundaryCondition_15__setstate_cython__, METH_O, __pyx_doc_18BoundaryConditions_17BoundaryCondition_14__setstate_cython__};
6155 static PyObject *__pyx_pw_18BoundaryConditions_17BoundaryCondition_15__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
6156 PyObject *__pyx_r = 0;
6157 __Pyx_RefNannyDeclarations
6158 __Pyx_RefNannySetupContext(
"__setstate_cython__ (wrapper)", 0);
6159 __pyx_r = __pyx_pf_18BoundaryConditions_17BoundaryCondition_14__setstate_cython__(((
struct __pyx_obj_18BoundaryConditions_BoundaryCondition *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state));
6162 __Pyx_RefNannyFinishContext();
6166 static PyObject *__pyx_pf_18BoundaryConditions_17BoundaryCondition_14__setstate_cython__(CYTHON_UNUSED
struct __pyx_obj_18BoundaryConditions_BoundaryCondition *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) {
6167 PyObject *__pyx_r = NULL;
6168 __Pyx_TraceDeclarations
6169 __Pyx_RefNannyDeclarations
6170 PyObject *__pyx_t_1 = NULL;
6171 int __pyx_lineno = 0;
6172 const char *__pyx_filename = NULL;
6173 int __pyx_clineno = 0;
6174 __Pyx_TraceFrameInit(__pyx_codeobj__12)
6175 __Pyx_RefNannySetupContext(
"__setstate_cython__", 0);
6176 __Pyx_TraceCall(
"__setstate_cython__", __pyx_f[1], 3, 0, __PYX_ERR(1, 3, __pyx_L1_error));
6183 __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__13, NULL);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 4, __pyx_L1_error)
6184 __Pyx_GOTREF(__pyx_t_1);
6185 __Pyx_Raise(__pyx_t_1, 0, 0, 0);
6186 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
6187 __PYX_ERR(1, 4, __pyx_L1_error)
6198 __Pyx_XDECREF(__pyx_t_1);
6199 __Pyx_AddTraceback(
"BoundaryConditions.BoundaryCondition.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
6201 __Pyx_XGIVEREF(__pyx_r);
6202 __Pyx_TraceReturn(__pyx_r, 0);
6203 __Pyx_RefNannyFinishContext();
6214 static PyObject *__pyx_pw_18BoundaryConditions_1__pyx_unpickle_BC_Base(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
6215 static char __pyx_doc_18BoundaryConditions___pyx_unpickle_BC_Base[] =
"__pyx_unpickle_BC_Base(__pyx_type, long __pyx_checksum, __pyx_state)";
6216 static PyMethodDef __pyx_mdef_18BoundaryConditions_1__pyx_unpickle_BC_Base = {
"__pyx_unpickle_BC_Base", (PyCFunction)(
void*)(PyCFunctionWithKeywords)__pyx_pw_18BoundaryConditions_1__pyx_unpickle_BC_Base, METH_VARARGS|METH_KEYWORDS, __pyx_doc_18BoundaryConditions___pyx_unpickle_BC_Base};
6217 static PyObject *__pyx_pw_18BoundaryConditions_1__pyx_unpickle_BC_Base(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
6218 PyObject *__pyx_v___pyx_type = 0;
6219 long __pyx_v___pyx_checksum;
6220 PyObject *__pyx_v___pyx_state = 0;
6221 int __pyx_lineno = 0;
6222 const char *__pyx_filename = NULL;
6223 int __pyx_clineno = 0;
6224 PyObject *__pyx_r = 0;
6225 __Pyx_RefNannyDeclarations
6226 __Pyx_RefNannySetupContext(
"__pyx_unpickle_BC_Base (wrapper)", 0);
6228 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_pyx_type,&__pyx_n_s_pyx_checksum,&__pyx_n_s_pyx_state,0};
6229 PyObject* values[3] = {0,0,0};
6230 if (unlikely(__pyx_kwds)) {
6232 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
6234 case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
6236 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
6238 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
6241 default:
goto __pyx_L5_argtuple_error;
6243 kw_args = PyDict_Size(__pyx_kwds);
6246 if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pyx_type)) != 0)) kw_args--;
6247 else goto __pyx_L5_argtuple_error;
6250 if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pyx_checksum)) != 0)) kw_args--;
6252 __Pyx_RaiseArgtupleInvalid(
"__pyx_unpickle_BC_Base", 1, 3, 3, 1); __PYX_ERR(1, 1, __pyx_L3_error)
6256 if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pyx_state)) != 0)) kw_args--;
6258 __Pyx_RaiseArgtupleInvalid(
"__pyx_unpickle_BC_Base", 1, 3, 3, 2); __PYX_ERR(1, 1, __pyx_L3_error)
6261 if (unlikely(kw_args > 0)) {
6262 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args,
"__pyx_unpickle_BC_Base") < 0)) __PYX_ERR(1, 1, __pyx_L3_error)
6264 }
else if (PyTuple_GET_SIZE(__pyx_args) != 3) {
6265 goto __pyx_L5_argtuple_error;
6267 values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
6268 values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
6269 values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
6271 __pyx_v___pyx_type = values[0];
6272 __pyx_v___pyx_checksum = __Pyx_PyInt_As_long(values[1]);
if (unlikely((__pyx_v___pyx_checksum == (
long)-1) && PyErr_Occurred())) __PYX_ERR(1, 1, __pyx_L3_error)
6273 __pyx_v___pyx_state = values[2];
6275 goto __pyx_L4_argument_unpacking_done;
6276 __pyx_L5_argtuple_error:;
6277 __Pyx_RaiseArgtupleInvalid(
"__pyx_unpickle_BC_Base", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(1, 1, __pyx_L3_error)
6279 __Pyx_AddTraceback(
"BoundaryConditions.__pyx_unpickle_BC_Base", __pyx_clineno, __pyx_lineno, __pyx_filename);
6280 __Pyx_RefNannyFinishContext();
6282 __pyx_L4_argument_unpacking_done:;
6283 __pyx_r = __pyx_pf_18BoundaryConditions___pyx_unpickle_BC_Base(__pyx_self, __pyx_v___pyx_type, __pyx_v___pyx_checksum, __pyx_v___pyx_state);
6286 __Pyx_RefNannyFinishContext();
6290 static PyObject *__pyx_pf_18BoundaryConditions___pyx_unpickle_BC_Base(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v___pyx_type,
long __pyx_v___pyx_checksum, PyObject *__pyx_v___pyx_state) {
6291 PyObject *__pyx_v___pyx_PickleError = 0;
6292 PyObject *__pyx_v___pyx_result = 0;
6293 PyObject *__pyx_r = NULL;
6294 __Pyx_TraceDeclarations
6295 __Pyx_RefNannyDeclarations
6296 PyObject *__pyx_t_1 = NULL;
6299 PyObject *__pyx_t_4 = NULL;
6300 PyObject *__pyx_t_5 = NULL;
6301 PyObject *__pyx_t_6 = NULL;
6302 int __pyx_lineno = 0;
6303 const char *__pyx_filename = NULL;
6304 int __pyx_clineno = 0;
6305 __Pyx_TraceFrameInit(__pyx_codeobj__14)
6306 __Pyx_RefNannySetupContext(
"__pyx_unpickle_BC_Base", 0);
6307 __Pyx_TraceCall(
"__pyx_unpickle_BC_Base", __pyx_f[1], 1, 0, __PYX_ERR(1, 1, __pyx_L1_error));
6316 __pyx_t_1 = __Pyx_PyInt_From_long(__pyx_v___pyx_checksum);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 4, __pyx_L1_error)
6317 __Pyx_GOTREF(__pyx_t_1);
6318 __pyx_t_2 = (__Pyx_PySequence_ContainsTF(__pyx_t_1, __pyx_tuple__15, Py_NE));
if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(1, 4, __pyx_L1_error)
6319 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
6320 __pyx_t_3 = (__pyx_t_2 != 0);
6330 __pyx_t_1 = PyList_New(1);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 5, __pyx_L1_error)
6331 __Pyx_GOTREF(__pyx_t_1);
6332 __Pyx_INCREF(__pyx_n_s_PickleError);
6333 __Pyx_GIVEREF(__pyx_n_s_PickleError);
6334 PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_s_PickleError);
6335 __pyx_t_4 = __Pyx_Import(__pyx_n_s_pickle, __pyx_t_1, -1);
if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 5, __pyx_L1_error)
6336 __Pyx_GOTREF(__pyx_t_4);
6337 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
6338 __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_4, __pyx_n_s_PickleError);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 5, __pyx_L1_error)
6339 __Pyx_GOTREF(__pyx_t_1);
6340 __Pyx_INCREF(__pyx_t_1);
6341 __pyx_v___pyx_PickleError = __pyx_t_1;
6342 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
6343 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
6352 __pyx_t_1 = __Pyx_PyInt_From_long(__pyx_v___pyx_checksum);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 6, __pyx_L1_error)
6353 __Pyx_GOTREF(__pyx_t_1);
6354 __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(1, 6, __pyx_L1_error)
6355 __Pyx_GOTREF(__pyx_t_5);
6356 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
6357 __Pyx_INCREF(__pyx_v___pyx_PickleError);
6358 __pyx_t_1 = __pyx_v___pyx_PickleError; __pyx_t_6 = NULL;
6359 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_1))) {
6360 __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_1);
6361 if (likely(__pyx_t_6)) {
6362 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_1);
6363 __Pyx_INCREF(__pyx_t_6);
6364 __Pyx_INCREF(
function);
6365 __Pyx_DECREF_SET(__pyx_t_1,
function);
6368 __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);
6369 __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
6370 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
6371 if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 6, __pyx_L1_error)
6372 __Pyx_GOTREF(__pyx_t_4);
6373 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
6374 __Pyx_Raise(__pyx_t_4, 0, 0, 0);
6375 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
6376 __PYX_ERR(1, 6, __pyx_L1_error)
6394 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_ptype_18BoundaryConditions_BC_Base), __pyx_n_s_new);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 7, __pyx_L1_error)
6395 __Pyx_GOTREF(__pyx_t_1);
6397 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_1))) {
6398 __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_1);
6399 if (likely(__pyx_t_5)) {
6400 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_1);
6401 __Pyx_INCREF(__pyx_t_5);
6402 __Pyx_INCREF(
function);
6403 __Pyx_DECREF_SET(__pyx_t_1,
function);
6406 __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);
6407 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
6408 if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 7, __pyx_L1_error)
6409 __Pyx_GOTREF(__pyx_t_4);
6410 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
6411 __pyx_v___pyx_result = __pyx_t_4;
6421 __pyx_t_3 = (__pyx_v___pyx_state != Py_None);
6422 __pyx_t_2 = (__pyx_t_3 != 0);
6432 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(1, 9, __pyx_L1_error)
6433 __pyx_t_4 = __pyx_f_18BoundaryConditions___pyx_unpickle_BC_Base__set_state(((
struct __pyx_obj_18BoundaryConditions_BC_Base *)__pyx_v___pyx_result), ((PyObject*)__pyx_v___pyx_state));
if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 9, __pyx_L1_error)
6434 __Pyx_GOTREF(__pyx_t_4);
6435 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
6453 __Pyx_XDECREF(__pyx_r);
6454 __Pyx_INCREF(__pyx_v___pyx_result);
6455 __pyx_r = __pyx_v___pyx_result;
6466 __Pyx_XDECREF(__pyx_t_1);
6467 __Pyx_XDECREF(__pyx_t_4);
6468 __Pyx_XDECREF(__pyx_t_5);
6469 __Pyx_XDECREF(__pyx_t_6);
6470 __Pyx_AddTraceback(
"BoundaryConditions.__pyx_unpickle_BC_Base", __pyx_clineno, __pyx_lineno, __pyx_filename);
6473 __Pyx_XDECREF(__pyx_v___pyx_PickleError);
6474 __Pyx_XDECREF(__pyx_v___pyx_result);
6475 __Pyx_XGIVEREF(__pyx_r);
6476 __Pyx_TraceReturn(__pyx_r, 0);
6477 __Pyx_RefNannyFinishContext();
6489 static PyObject *__pyx_f_18BoundaryConditions___pyx_unpickle_BC_Base__set_state(
struct __pyx_obj_18BoundaryConditions_BC_Base *__pyx_v___pyx_result, PyObject *__pyx_v___pyx_state) {
6490 PyObject *__pyx_r = NULL;
6491 __Pyx_TraceDeclarations
6492 __Pyx_RefNannyDeclarations
6493 PyObject *__pyx_t_1 = NULL;
6494 __Pyx_memviewslice __pyx_t_2 = { 0, 0, { 0 }, { 0 }, { 0 } };
6497 Py_ssize_t __pyx_t_5;
6500 PyObject *__pyx_t_8 = NULL;
6501 PyObject *__pyx_t_9 = NULL;
6502 int __pyx_lineno = 0;
6503 const char *__pyx_filename = NULL;
6504 int __pyx_clineno = 0;
6505 __Pyx_RefNannySetupContext(
"__pyx_unpickle_BC_Base__set_state", 0);
6506 __Pyx_TraceCall(
"__pyx_unpickle_BC_Base__set_state", __pyx_f[1], 11, 0, __PYX_ERR(1, 11, __pyx_L1_error));
6515 if (unlikely(__pyx_v___pyx_state == Py_None)) {
6516 PyErr_SetString(PyExc_TypeError,
"'NoneType' object is not subscriptable");
6517 __PYX_ERR(1, 12, __pyx_L1_error)
6519 if (!(likely(PyString_CheckExact(PyTuple_GET_ITEM(__pyx_v___pyx_state, 0)))||((PyTuple_GET_ITEM(__pyx_v___pyx_state, 0)) == Py_None)||(PyErr_Format(PyExc_TypeError,
"Expected %.16s, got %.200s",
"str", Py_TYPE(PyTuple_GET_ITEM(__pyx_v___pyx_state, 0))->tp_name), 0))) __PYX_ERR(1, 12, __pyx_L1_error)
6520 __pyx_t_1 = PyTuple_GET_ITEM(__pyx_v___pyx_state, 0);
6521 __Pyx_INCREF(__pyx_t_1);
6522 __Pyx_GIVEREF(__pyx_t_1);
6523 __Pyx_GOTREF(__pyx_v___pyx_result->BC_type);
6524 __Pyx_DECREF(__pyx_v___pyx_result->BC_type);
6525 __pyx_v___pyx_result->BC_type = ((PyObject*)__pyx_t_1);
6527 if (unlikely(__pyx_v___pyx_state == Py_None)) {
6528 PyErr_SetString(PyExc_TypeError,
"'NoneType' object is not subscriptable");
6529 __PYX_ERR(1, 12, __pyx_L1_error)
6531 __pyx_t_1 = PyTuple_GET_ITEM(__pyx_v___pyx_state, 1);
6532 __Pyx_INCREF(__pyx_t_1);
6533 __Pyx_GIVEREF(__pyx_t_1);
6534 __Pyx_GOTREF(__pyx_v___pyx_result->Shape);
6535 __Pyx_DECREF(__pyx_v___pyx_result->Shape);
6536 __pyx_v___pyx_result->Shape = __pyx_t_1;
6538 if (unlikely(__pyx_v___pyx_state == Py_None)) {
6539 PyErr_SetString(PyExc_TypeError,
"'NoneType' object is not subscriptable");
6540 __PYX_ERR(1, 12, __pyx_L1_error)
6542 __pyx_t_2 = __Pyx_PyObject_to_MemoryviewSlice_ds_double(PyTuple_GET_ITEM(__pyx_v___pyx_state, 2), PyBUF_WRITABLE);
if (unlikely(!__pyx_t_2.memview)) __PYX_ERR(1, 12, __pyx_L1_error)
6543 __PYX_XDEC_MEMVIEW(&__pyx_v___pyx_result->_b_or, 0);
6544 __pyx_v___pyx_result->_b_or = __pyx_t_2;
6545 __pyx_t_2.memview = NULL;
6546 __pyx_t_2.data = NULL;
6547 if (unlikely(__pyx_v___pyx_state == Py_None)) {
6548 PyErr_SetString(PyExc_TypeError,
"'NoneType' object is not subscriptable");
6549 __PYX_ERR(1, 12, __pyx_L1_error)
6551 __pyx_t_1 = PyTuple_GET_ITEM(__pyx_v___pyx_state, 3);
6552 __Pyx_INCREF(__pyx_t_1);
6553 __Pyx_GIVEREF(__pyx_t_1);
6554 __Pyx_GOTREF(__pyx_v___pyx_result->ct);
6555 __Pyx_DECREF(__pyx_v___pyx_result->ct);
6556 __pyx_v___pyx_result->ct = __pyx_t_1;
6558 if (unlikely(__pyx_v___pyx_state == Py_None)) {
6559 PyErr_SetString(PyExc_TypeError,
"'NoneType' object is not subscriptable");
6560 __PYX_ERR(1, 12, __pyx_L1_error)
6562 if (!(likely(PyString_CheckExact(PyTuple_GET_ITEM(__pyx_v___pyx_state, 4)))||((PyTuple_GET_ITEM(__pyx_v___pyx_state, 4)) == Py_None)||(PyErr_Format(PyExc_TypeError,
"Expected %.16s, got %.200s",
"str", Py_TYPE(PyTuple_GET_ITEM(__pyx_v___pyx_state, 4))->tp_name), 0))) __PYX_ERR(1, 12, __pyx_L1_error)
6563 __pyx_t_1 = PyTuple_GET_ITEM(__pyx_v___pyx_state, 4);
6564 __Pyx_INCREF(__pyx_t_1);
6565 __Pyx_GIVEREF(__pyx_t_1);
6566 __Pyx_GOTREF(__pyx_v___pyx_result->name);
6567 __Pyx_DECREF(__pyx_v___pyx_result->name);
6568 __pyx_v___pyx_result->name = ((PyObject*)__pyx_t_1);
6570 if (unlikely(__pyx_v___pyx_state == Py_None)) {
6571 PyErr_SetString(PyExc_TypeError,
"'NoneType' object is not subscriptable");
6572 __PYX_ERR(1, 12, __pyx_L1_error)
6574 __pyx_t_3 = __Pyx_PyInt_As_int(PyTuple_GET_ITEM(__pyx_v___pyx_state, 5));
if (unlikely((__pyx_t_3 == (
int)-1) && PyErr_Occurred())) __PYX_ERR(1, 12, __pyx_L1_error)
6575 __pyx_v___pyx_result->nd = __pyx_t_3;
6583 if (unlikely(__pyx_v___pyx_state == Py_None)) {
6584 PyErr_SetString(PyExc_TypeError,
"object of type 'NoneType' has no len()");
6585 __PYX_ERR(1, 13, __pyx_L1_error)
6587 __pyx_t_5 = PyTuple_GET_SIZE(__pyx_v___pyx_state);
if (unlikely(__pyx_t_5 == ((Py_ssize_t)-1))) __PYX_ERR(1, 13, __pyx_L1_error)
6588 __pyx_t_6 = ((__pyx_t_5 > 6) != 0);
6591 __pyx_t_4 = __pyx_t_6;
6592 goto __pyx_L4_bool_binop_done;
6594 __pyx_t_6 = __Pyx_HasAttr(((PyObject *)__pyx_v___pyx_result), __pyx_n_s_dict);
if (unlikely(__pyx_t_6 == ((
int)-1))) __PYX_ERR(1, 13, __pyx_L1_error)
6595 __pyx_t_7 = (__pyx_t_6 != 0);
6596 __pyx_t_4 = __pyx_t_7;
6597 __pyx_L4_bool_binop_done:;
6605 __pyx_t_8 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v___pyx_result), __pyx_n_s_dict);
if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 14, __pyx_L1_error)
6606 __Pyx_GOTREF(__pyx_t_8);
6607 __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_update);
if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 14, __pyx_L1_error)
6608 __Pyx_GOTREF(__pyx_t_9);
6609 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
6610 if (unlikely(__pyx_v___pyx_state == Py_None)) {
6611 PyErr_SetString(PyExc_TypeError,
"'NoneType' object is not subscriptable");
6612 __PYX_ERR(1, 14, __pyx_L1_error)
6615 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_9))) {
6616 __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_9);
6617 if (likely(__pyx_t_8)) {
6618 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_9);
6619 __Pyx_INCREF(__pyx_t_8);
6620 __Pyx_INCREF(
function);
6621 __Pyx_DECREF_SET(__pyx_t_9,
function);
6624 __pyx_t_1 = (__pyx_t_8) ? __Pyx_PyObject_Call2Args(__pyx_t_9, __pyx_t_8, PyTuple_GET_ITEM(__pyx_v___pyx_state, 6)) : __Pyx_PyObject_CallOneArg(__pyx_t_9, PyTuple_GET_ITEM(__pyx_v___pyx_state, 6));
6625 __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
6626 if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 14, __pyx_L1_error)
6627 __Pyx_GOTREF(__pyx_t_1);
6628 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
6629 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
6648 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
6651 __Pyx_XDECREF(__pyx_t_1);
6652 __PYX_XDEC_MEMVIEW(&__pyx_t_2, 1);
6653 __Pyx_XDECREF(__pyx_t_8);
6654 __Pyx_XDECREF(__pyx_t_9);
6655 __Pyx_AddTraceback(
"BoundaryConditions.__pyx_unpickle_BC_Base__set_state", __pyx_clineno, __pyx_lineno, __pyx_filename);
6658 __Pyx_XGIVEREF(__pyx_r);
6659 __Pyx_TraceReturn(__pyx_r, 0);
6660 __Pyx_RefNannyFinishContext();
6672 static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew1(PyObject *__pyx_v_a) {
6673 PyObject *__pyx_r = NULL;
6674 __Pyx_TraceDeclarations
6675 __Pyx_RefNannyDeclarations
6676 PyObject *__pyx_t_1 = NULL;
6677 int __pyx_lineno = 0;
6678 const char *__pyx_filename = NULL;
6679 int __pyx_clineno = 0;
6680 __Pyx_RefNannySetupContext(
"PyArray_MultiIterNew1", 0);
6681 __Pyx_TraceCall(
"PyArray_MultiIterNew1", __pyx_f[3], 735, 0, __PYX_ERR(3, 735, __pyx_L1_error));
6690 __Pyx_XDECREF(__pyx_r);
6691 __pyx_t_1 = PyArray_MultiIterNew(1, ((
void *)__pyx_v_a));
if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 736, __pyx_L1_error)
6692 __Pyx_GOTREF(__pyx_t_1);
6693 __pyx_r = __pyx_t_1;
6707 __Pyx_XDECREF(__pyx_t_1);
6708 __Pyx_AddTraceback(
"numpy.PyArray_MultiIterNew1", __pyx_clineno, __pyx_lineno, __pyx_filename);
6711 __Pyx_XGIVEREF(__pyx_r);
6712 __Pyx_TraceReturn(__pyx_r, 0);
6713 __Pyx_RefNannyFinishContext();
6725 static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew2(PyObject *__pyx_v_a, PyObject *__pyx_v_b) {
6726 PyObject *__pyx_r = NULL;
6727 __Pyx_TraceDeclarations
6728 __Pyx_RefNannyDeclarations
6729 PyObject *__pyx_t_1 = NULL;
6730 int __pyx_lineno = 0;
6731 const char *__pyx_filename = NULL;
6732 int __pyx_clineno = 0;
6733 __Pyx_RefNannySetupContext(
"PyArray_MultiIterNew2", 0);
6734 __Pyx_TraceCall(
"PyArray_MultiIterNew2", __pyx_f[3], 738, 0, __PYX_ERR(3, 738, __pyx_L1_error));
6743 __Pyx_XDECREF(__pyx_r);
6744 __pyx_t_1 = PyArray_MultiIterNew(2, ((
void *)__pyx_v_a), ((
void *)__pyx_v_b));
if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 739, __pyx_L1_error)
6745 __Pyx_GOTREF(__pyx_t_1);
6746 __pyx_r = __pyx_t_1;
6760 __Pyx_XDECREF(__pyx_t_1);
6761 __Pyx_AddTraceback(
"numpy.PyArray_MultiIterNew2", __pyx_clineno, __pyx_lineno, __pyx_filename);
6764 __Pyx_XGIVEREF(__pyx_r);
6765 __Pyx_TraceReturn(__pyx_r, 0);
6766 __Pyx_RefNannyFinishContext();
6778 static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew3(PyObject *__pyx_v_a, PyObject *__pyx_v_b, PyObject *__pyx_v_c) {
6779 PyObject *__pyx_r = NULL;
6780 __Pyx_TraceDeclarations
6781 __Pyx_RefNannyDeclarations
6782 PyObject *__pyx_t_1 = NULL;
6783 int __pyx_lineno = 0;
6784 const char *__pyx_filename = NULL;
6785 int __pyx_clineno = 0;
6786 __Pyx_RefNannySetupContext(
"PyArray_MultiIterNew3", 0);
6787 __Pyx_TraceCall(
"PyArray_MultiIterNew3", __pyx_f[3], 741, 0, __PYX_ERR(3, 741, __pyx_L1_error));
6796 __Pyx_XDECREF(__pyx_r);
6797 __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(3, 742, __pyx_L1_error)
6798 __Pyx_GOTREF(__pyx_t_1);
6799 __pyx_r = __pyx_t_1;
6813 __Pyx_XDECREF(__pyx_t_1);
6814 __Pyx_AddTraceback(
"numpy.PyArray_MultiIterNew3", __pyx_clineno, __pyx_lineno, __pyx_filename);
6817 __Pyx_XGIVEREF(__pyx_r);
6818 __Pyx_TraceReturn(__pyx_r, 0);
6819 __Pyx_RefNannyFinishContext();
6831 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) {
6832 PyObject *__pyx_r = NULL;
6833 __Pyx_TraceDeclarations
6834 __Pyx_RefNannyDeclarations
6835 PyObject *__pyx_t_1 = NULL;
6836 int __pyx_lineno = 0;
6837 const char *__pyx_filename = NULL;
6838 int __pyx_clineno = 0;
6839 __Pyx_RefNannySetupContext(
"PyArray_MultiIterNew4", 0);
6840 __Pyx_TraceCall(
"PyArray_MultiIterNew4", __pyx_f[3], 744, 0, __PYX_ERR(3, 744, __pyx_L1_error));
6849 __Pyx_XDECREF(__pyx_r);
6850 __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(3, 745, __pyx_L1_error)
6851 __Pyx_GOTREF(__pyx_t_1);
6852 __pyx_r = __pyx_t_1;
6866 __Pyx_XDECREF(__pyx_t_1);
6867 __Pyx_AddTraceback(
"numpy.PyArray_MultiIterNew4", __pyx_clineno, __pyx_lineno, __pyx_filename);
6870 __Pyx_XGIVEREF(__pyx_r);
6871 __Pyx_TraceReturn(__pyx_r, 0);
6872 __Pyx_RefNannyFinishContext();
6884 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) {
6885 PyObject *__pyx_r = NULL;
6886 __Pyx_TraceDeclarations
6887 __Pyx_RefNannyDeclarations
6888 PyObject *__pyx_t_1 = NULL;
6889 int __pyx_lineno = 0;
6890 const char *__pyx_filename = NULL;
6891 int __pyx_clineno = 0;
6892 __Pyx_RefNannySetupContext(
"PyArray_MultiIterNew5", 0);
6893 __Pyx_TraceCall(
"PyArray_MultiIterNew5", __pyx_f[3], 747, 0, __PYX_ERR(3, 747, __pyx_L1_error));
6902 __Pyx_XDECREF(__pyx_r);
6903 __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(3, 748, __pyx_L1_error)
6904 __Pyx_GOTREF(__pyx_t_1);
6905 __pyx_r = __pyx_t_1;
6919 __Pyx_XDECREF(__pyx_t_1);
6920 __Pyx_AddTraceback(
"numpy.PyArray_MultiIterNew5", __pyx_clineno, __pyx_lineno, __pyx_filename);
6923 __Pyx_XGIVEREF(__pyx_r);
6924 __Pyx_TraceReturn(__pyx_r, 0);
6925 __Pyx_RefNannyFinishContext();
6937 static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyDataType_SHAPE(PyArray_Descr *__pyx_v_d) {
6938 PyObject *__pyx_r = NULL;
6939 __Pyx_TraceDeclarations
6940 __Pyx_RefNannyDeclarations
6942 int __pyx_lineno = 0;
6943 const char *__pyx_filename = NULL;
6944 int __pyx_clineno = 0;
6945 __Pyx_RefNannySetupContext(
"PyDataType_SHAPE", 0);
6946 __Pyx_TraceCall(
"PyDataType_SHAPE", __pyx_f[3], 750, 0, __PYX_ERR(3, 750, __pyx_L1_error));
6955 __pyx_t_1 = (PyDataType_HASSUBARRAY(__pyx_v_d) != 0);
6965 __Pyx_XDECREF(__pyx_r);
6966 __Pyx_INCREF(((PyObject*)__pyx_v_d->subarray->shape));
6967 __pyx_r = ((PyObject*)__pyx_v_d->subarray->shape);
6987 __Pyx_XDECREF(__pyx_r);
6988 __Pyx_INCREF(__pyx_empty_tuple);
6989 __pyx_r = __pyx_empty_tuple;
7003 __Pyx_AddTraceback(
"numpy.PyDataType_SHAPE", __pyx_clineno, __pyx_lineno, __pyx_filename);
7006 __Pyx_XGIVEREF(__pyx_r);
7007 __Pyx_TraceReturn(__pyx_r, 0);
7008 __Pyx_RefNannyFinishContext();
7020 static CYTHON_INLINE
void __pyx_f_5numpy_set_array_base(PyArrayObject *__pyx_v_arr, PyObject *__pyx_v_base) {
7021 __Pyx_TraceDeclarations
7022 __Pyx_RefNannyDeclarations
7023 int __pyx_lineno = 0;
7024 const char *__pyx_filename = NULL;
7025 int __pyx_clineno = 0;
7026 __Pyx_RefNannySetupContext(
"set_array_base", 0);
7027 __Pyx_TraceCall(
"set_array_base", __pyx_f[3], 929, 0, __PYX_ERR(3, 929, __pyx_L1_error));
7036 Py_INCREF(__pyx_v_base);
7045 (void)(PyArray_SetBaseObject(__pyx_v_arr, __pyx_v_base));
7058 __Pyx_WriteUnraisable(
"numpy.set_array_base", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
7060 __Pyx_TraceReturn(Py_None, 0);
7061 __Pyx_RefNannyFinishContext();
7072 static CYTHON_INLINE PyObject *__pyx_f_5numpy_get_array_base(PyArrayObject *__pyx_v_arr) {
7073 PyObject *__pyx_v_base;
7074 PyObject *__pyx_r = NULL;
7075 __Pyx_TraceDeclarations
7076 __Pyx_RefNannyDeclarations
7078 int __pyx_lineno = 0;
7079 const char *__pyx_filename = NULL;
7080 int __pyx_clineno = 0;
7081 __Pyx_RefNannySetupContext(
"get_array_base", 0);
7082 __Pyx_TraceCall(
"get_array_base", __pyx_f[3], 933, 0, __PYX_ERR(3, 933, __pyx_L1_error));
7091 __pyx_v_base = PyArray_BASE(__pyx_v_arr);
7100 __pyx_t_1 = ((__pyx_v_base == NULL) != 0);
7110 __Pyx_XDECREF(__pyx_r);
7111 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
7130 __Pyx_XDECREF(__pyx_r);
7131 __Pyx_INCREF(((PyObject *)__pyx_v_base));
7132 __pyx_r = ((PyObject *)__pyx_v_base);
7145 __Pyx_AddTraceback(
"numpy.get_array_base", __pyx_clineno, __pyx_lineno, __pyx_filename);
7148 __Pyx_XGIVEREF(__pyx_r);
7149 __Pyx_TraceReturn(__pyx_r, 0);
7150 __Pyx_RefNannyFinishContext();
7162 static CYTHON_INLINE
int __pyx_f_5numpy_import_array(
void) {
7164 __Pyx_TraceDeclarations
7165 __Pyx_RefNannyDeclarations
7166 PyObject *__pyx_t_1 = NULL;
7167 PyObject *__pyx_t_2 = NULL;
7168 PyObject *__pyx_t_3 = NULL;
7170 PyObject *__pyx_t_5 = NULL;
7171 PyObject *__pyx_t_6 = NULL;
7172 PyObject *__pyx_t_7 = NULL;
7173 PyObject *__pyx_t_8 = NULL;
7174 int __pyx_lineno = 0;
7175 const char *__pyx_filename = NULL;
7176 int __pyx_clineno = 0;
7177 __Pyx_RefNannySetupContext(
"import_array", 0);
7178 __Pyx_TraceCall(
"import_array", __pyx_f[3], 941, 0, __PYX_ERR(3, 941, __pyx_L1_error));
7188 __Pyx_PyThreadState_declare
7189 __Pyx_PyThreadState_assign
7190 __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
7191 __Pyx_XGOTREF(__pyx_t_1);
7192 __Pyx_XGOTREF(__pyx_t_2);
7193 __Pyx_XGOTREF(__pyx_t_3);
7203 __pyx_t_4 = _import_array();
if (unlikely(__pyx_t_4 == ((
int)-1))) __PYX_ERR(3, 943, __pyx_L3_error)
7213 __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
7214 __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
7215 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
7216 goto __pyx_L8_try_end;
7226 __pyx_t_4 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0])));
7228 __Pyx_AddTraceback(
"numpy.import_array", __pyx_clineno, __pyx_lineno, __pyx_filename);
7229 if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(3, 944, __pyx_L5_except_error)
7230 __Pyx_GOTREF(__pyx_t_5);
7231 __Pyx_GOTREF(__pyx_t_6);
7232 __Pyx_GOTREF(__pyx_t_7);
7241 __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_ImportError, __pyx_tuple__16, NULL);
if (unlikely(!__pyx_t_8)) __PYX_ERR(3, 945, __pyx_L5_except_error)
7242 __Pyx_GOTREF(__pyx_t_8);
7243 __Pyx_Raise(__pyx_t_8, 0, 0, 0);
7244 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
7245 __PYX_ERR(3, 945, __pyx_L5_except_error)
7247 goto __pyx_L5_except_error;
7248 __pyx_L5_except_error:;
7257 __Pyx_XGIVEREF(__pyx_t_1);
7258 __Pyx_XGIVEREF(__pyx_t_2);
7259 __Pyx_XGIVEREF(__pyx_t_3);
7260 __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
7261 goto __pyx_L1_error;
7277 __Pyx_XDECREF(__pyx_t_5);
7278 __Pyx_XDECREF(__pyx_t_6);
7279 __Pyx_XDECREF(__pyx_t_7);
7280 __Pyx_XDECREF(__pyx_t_8);
7281 __Pyx_AddTraceback(
"numpy.import_array", __pyx_clineno, __pyx_lineno, __pyx_filename);
7284 __Pyx_TraceReturn(Py_None, 0);
7285 __Pyx_RefNannyFinishContext();
7297 static CYTHON_INLINE
int __pyx_f_5numpy_import_umath(
void) {
7299 __Pyx_TraceDeclarations
7300 __Pyx_RefNannyDeclarations
7301 PyObject *__pyx_t_1 = NULL;
7302 PyObject *__pyx_t_2 = NULL;
7303 PyObject *__pyx_t_3 = NULL;
7305 PyObject *__pyx_t_5 = NULL;
7306 PyObject *__pyx_t_6 = NULL;
7307 PyObject *__pyx_t_7 = NULL;
7308 PyObject *__pyx_t_8 = NULL;
7309 int __pyx_lineno = 0;
7310 const char *__pyx_filename = NULL;
7311 int __pyx_clineno = 0;
7312 __Pyx_RefNannySetupContext(
"import_umath", 0);
7313 __Pyx_TraceCall(
"import_umath", __pyx_f[3], 947, 0, __PYX_ERR(3, 947, __pyx_L1_error));
7323 __Pyx_PyThreadState_declare
7324 __Pyx_PyThreadState_assign
7325 __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
7326 __Pyx_XGOTREF(__pyx_t_1);
7327 __Pyx_XGOTREF(__pyx_t_2);
7328 __Pyx_XGOTREF(__pyx_t_3);
7338 __pyx_t_4 = _import_umath();
if (unlikely(__pyx_t_4 == ((
int)-1))) __PYX_ERR(3, 949, __pyx_L3_error)
7348 __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
7349 __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
7350 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
7351 goto __pyx_L8_try_end;
7361 __pyx_t_4 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0])));
7363 __Pyx_AddTraceback(
"numpy.import_umath", __pyx_clineno, __pyx_lineno, __pyx_filename);
7364 if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(3, 950, __pyx_L5_except_error)
7365 __Pyx_GOTREF(__pyx_t_5);
7366 __Pyx_GOTREF(__pyx_t_6);
7367 __Pyx_GOTREF(__pyx_t_7);
7376 __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_ImportError, __pyx_tuple__17, NULL);
if (unlikely(!__pyx_t_8)) __PYX_ERR(3, 951, __pyx_L5_except_error)
7377 __Pyx_GOTREF(__pyx_t_8);
7378 __Pyx_Raise(__pyx_t_8, 0, 0, 0);
7379 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
7380 __PYX_ERR(3, 951, __pyx_L5_except_error)
7382 goto __pyx_L5_except_error;
7383 __pyx_L5_except_error:;
7392 __Pyx_XGIVEREF(__pyx_t_1);
7393 __Pyx_XGIVEREF(__pyx_t_2);
7394 __Pyx_XGIVEREF(__pyx_t_3);
7395 __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
7396 goto __pyx_L1_error;
7412 __Pyx_XDECREF(__pyx_t_5);
7413 __Pyx_XDECREF(__pyx_t_6);
7414 __Pyx_XDECREF(__pyx_t_7);
7415 __Pyx_XDECREF(__pyx_t_8);
7416 __Pyx_AddTraceback(
"numpy.import_umath", __pyx_clineno, __pyx_lineno, __pyx_filename);
7419 __Pyx_TraceReturn(Py_None, 0);
7420 __Pyx_RefNannyFinishContext();
7432 static CYTHON_INLINE
int __pyx_f_5numpy_import_ufunc(
void) {
7434 __Pyx_TraceDeclarations
7435 __Pyx_RefNannyDeclarations
7436 PyObject *__pyx_t_1 = NULL;
7437 PyObject *__pyx_t_2 = NULL;
7438 PyObject *__pyx_t_3 = NULL;
7440 PyObject *__pyx_t_5 = NULL;
7441 PyObject *__pyx_t_6 = NULL;
7442 PyObject *__pyx_t_7 = NULL;
7443 PyObject *__pyx_t_8 = NULL;
7444 int __pyx_lineno = 0;
7445 const char *__pyx_filename = NULL;
7446 int __pyx_clineno = 0;
7447 __Pyx_RefNannySetupContext(
"import_ufunc", 0);
7448 __Pyx_TraceCall(
"import_ufunc", __pyx_f[3], 953, 0, __PYX_ERR(3, 953, __pyx_L1_error));
7458 __Pyx_PyThreadState_declare
7459 __Pyx_PyThreadState_assign
7460 __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
7461 __Pyx_XGOTREF(__pyx_t_1);
7462 __Pyx_XGOTREF(__pyx_t_2);
7463 __Pyx_XGOTREF(__pyx_t_3);
7473 __pyx_t_4 = _import_umath();
if (unlikely(__pyx_t_4 == ((
int)-1))) __PYX_ERR(3, 955, __pyx_L3_error)
7483 __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
7484 __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
7485 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
7486 goto __pyx_L8_try_end;
7496 __pyx_t_4 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0])));
7498 __Pyx_AddTraceback(
"numpy.import_ufunc", __pyx_clineno, __pyx_lineno, __pyx_filename);
7499 if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(3, 956, __pyx_L5_except_error)
7500 __Pyx_GOTREF(__pyx_t_5);
7501 __Pyx_GOTREF(__pyx_t_6);
7502 __Pyx_GOTREF(__pyx_t_7);
7511 __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_ImportError, __pyx_tuple__17, NULL);
if (unlikely(!__pyx_t_8)) __PYX_ERR(3, 957, __pyx_L5_except_error)
7512 __Pyx_GOTREF(__pyx_t_8);
7513 __Pyx_Raise(__pyx_t_8, 0, 0, 0);
7514 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
7515 __PYX_ERR(3, 957, __pyx_L5_except_error)
7517 goto __pyx_L5_except_error;
7518 __pyx_L5_except_error:;
7527 __Pyx_XGIVEREF(__pyx_t_1);
7528 __Pyx_XGIVEREF(__pyx_t_2);
7529 __Pyx_XGIVEREF(__pyx_t_3);
7530 __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
7531 goto __pyx_L1_error;
7547 __Pyx_XDECREF(__pyx_t_5);
7548 __Pyx_XDECREF(__pyx_t_6);
7549 __Pyx_XDECREF(__pyx_t_7);
7550 __Pyx_XDECREF(__pyx_t_8);
7551 __Pyx_AddTraceback(
"numpy.import_ufunc", __pyx_clineno, __pyx_lineno, __pyx_filename);
7554 __Pyx_TraceReturn(Py_None, 0);
7555 __Pyx_RefNannyFinishContext();
7567 static CYTHON_INLINE
int __pyx_f_5numpy_is_timedelta64_object(PyObject *__pyx_v_obj) {
7569 __Pyx_TraceDeclarations
7570 __Pyx_RefNannyDeclarations
7571 int __pyx_lineno = 0;
7572 const char *__pyx_filename = NULL;
7573 int __pyx_clineno = 0;
7574 __Pyx_RefNannySetupContext(
"is_timedelta64_object", 0);
7575 __Pyx_TraceCall(
"is_timedelta64_object", __pyx_f[3], 967, 0, __PYX_ERR(3, 967, __pyx_L1_error));
7584 __pyx_r = PyObject_TypeCheck(__pyx_v_obj, (&PyTimedeltaArrType_Type));
7597 __Pyx_WriteUnraisable(
"numpy.is_timedelta64_object", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
7600 __Pyx_TraceReturn(Py_None, 0);
7601 __Pyx_RefNannyFinishContext();
7613 static CYTHON_INLINE
int __pyx_f_5numpy_is_datetime64_object(PyObject *__pyx_v_obj) {
7615 __Pyx_TraceDeclarations
7616 __Pyx_RefNannyDeclarations
7617 int __pyx_lineno = 0;
7618 const char *__pyx_filename = NULL;
7619 int __pyx_clineno = 0;
7620 __Pyx_RefNannySetupContext(
"is_datetime64_object", 0);
7621 __Pyx_TraceCall(
"is_datetime64_object", __pyx_f[3], 982, 0, __PYX_ERR(3, 982, __pyx_L1_error));
7630 __pyx_r = PyObject_TypeCheck(__pyx_v_obj, (&PyDatetimeArrType_Type));
7643 __Pyx_WriteUnraisable(
"numpy.is_datetime64_object", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
7646 __Pyx_TraceReturn(Py_None, 0);
7647 __Pyx_RefNannyFinishContext();
7659 static CYTHON_INLINE npy_datetime __pyx_f_5numpy_get_datetime64_value(PyObject *__pyx_v_obj) {
7660 npy_datetime __pyx_r;
7661 __Pyx_TraceDeclarations
7662 int __pyx_lineno = 0;
7663 const char *__pyx_filename = NULL;
7664 int __pyx_clineno = 0;
7665 __Pyx_TraceCall(
"get_datetime64_value", __pyx_f[3], 997, 1, __PYX_ERR(3, 997, __pyx_L1_error));
7674 __pyx_r = ((PyDatetimeScalarObject *)__pyx_v_obj)->obval;
7687 __Pyx_WriteUnraisable(
"numpy.get_datetime64_value", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 1);
7690 __Pyx_TraceReturn(Py_None, 1);
7702 static CYTHON_INLINE npy_timedelta __pyx_f_5numpy_get_timedelta64_value(PyObject *__pyx_v_obj) {
7703 npy_timedelta __pyx_r;
7704 __Pyx_TraceDeclarations
7705 int __pyx_lineno = 0;
7706 const char *__pyx_filename = NULL;
7707 int __pyx_clineno = 0;
7708 __Pyx_TraceCall(
"get_timedelta64_value", __pyx_f[3], 1007, 1, __PYX_ERR(3, 1007, __pyx_L1_error));
7717 __pyx_r = ((PyTimedeltaScalarObject *)__pyx_v_obj)->obval;
7730 __Pyx_WriteUnraisable(
"numpy.get_timedelta64_value", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 1);
7733 __Pyx_TraceReturn(Py_None, 1);
7745 static CYTHON_INLINE NPY_DATETIMEUNIT __pyx_f_5numpy_get_datetime64_unit(PyObject *__pyx_v_obj) {
7746 NPY_DATETIMEUNIT __pyx_r;
7747 __Pyx_TraceDeclarations
7748 int __pyx_lineno = 0;
7749 const char *__pyx_filename = NULL;
7750 int __pyx_clineno = 0;
7751 __Pyx_TraceCall(
"get_datetime64_unit", __pyx_f[3], 1014, 1, __PYX_ERR(3, 1014, __pyx_L1_error));
7758 __pyx_r = ((NPY_DATETIMEUNIT)((PyDatetimeScalarObject *)__pyx_v_obj)->obmeta.base);
7771 __Pyx_WriteUnraisable(
"numpy.get_datetime64_unit", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 1);
7772 __pyx_r = (NPY_DATETIMEUNIT) 0;
7774 __Pyx_TraceReturn(Py_None, 1);
7787 static int __pyx_array___cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
7788 static int __pyx_array___cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
7789 PyObject *__pyx_v_shape = 0;
7790 Py_ssize_t __pyx_v_itemsize;
7791 PyObject *__pyx_v_format = 0;
7792 PyObject *__pyx_v_mode = 0;
7793 int __pyx_v_allocate_buffer;
7794 int __pyx_lineno = 0;
7795 const char *__pyx_filename = NULL;
7796 int __pyx_clineno = 0;
7798 __Pyx_RefNannyDeclarations
7799 __Pyx_RefNannySetupContext(
"__cinit__ (wrapper)", 0);
7801 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};
7802 PyObject* values[5] = {0,0,0,0,0};
7803 values[3] = ((PyObject *)__pyx_n_s_c);
7804 if (unlikely(__pyx_kwds)) {
7806 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
7808 case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
7810 case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
7812 case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
7814 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
7816 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
7819 default:
goto __pyx_L5_argtuple_error;
7821 kw_args = PyDict_Size(__pyx_kwds);
7824 if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_shape)) != 0)) kw_args--;
7825 else goto __pyx_L5_argtuple_error;
7828 if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_itemsize)) != 0)) kw_args--;
7830 __Pyx_RaiseArgtupleInvalid(
"__cinit__", 0, 3, 5, 1); __PYX_ERR(1, 122, __pyx_L3_error)
7834 if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_format)) != 0)) kw_args--;
7836 __Pyx_RaiseArgtupleInvalid(
"__cinit__", 0, 3, 5, 2); __PYX_ERR(1, 122, __pyx_L3_error)
7841 PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_mode);
7842 if (value) { values[3] = value; kw_args--; }
7847 PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_allocate_buffer);
7848 if (value) { values[4] = value; kw_args--; }
7851 if (unlikely(kw_args > 0)) {
7852 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args,
"__cinit__") < 0)) __PYX_ERR(1, 122, __pyx_L3_error)
7855 switch (PyTuple_GET_SIZE(__pyx_args)) {
7856 case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
7858 case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
7860 case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
7861 values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
7862 values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
7864 default:
goto __pyx_L5_argtuple_error;
7867 __pyx_v_shape = ((PyObject*)values[0]);
7868 __pyx_v_itemsize = __Pyx_PyIndex_AsSsize_t(values[1]);
if (unlikely((__pyx_v_itemsize == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(1, 122, __pyx_L3_error)
7869 __pyx_v_format = values[2];
7870 __pyx_v_mode = values[3];
7872 __pyx_v_allocate_buffer = __Pyx_PyObject_IsTrue(values[4]);
if (unlikely((__pyx_v_allocate_buffer == (
int)-1) && PyErr_Occurred())) __PYX_ERR(1, 123, __pyx_L3_error)
7882 __pyx_v_allocate_buffer = ((int)1);
7885 goto __pyx_L4_argument_unpacking_done;
7886 __pyx_L5_argtuple_error:;
7887 __Pyx_RaiseArgtupleInvalid(
"__cinit__", 0, 3, 5, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(1, 122, __pyx_L3_error)
7889 __Pyx_AddTraceback(
"View.MemoryView.array.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
7890 __Pyx_RefNannyFinishContext();
7892 __pyx_L4_argument_unpacking_done:;
7893 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_shape), (&PyTuple_Type), 1,
"shape", 1))) __PYX_ERR(1, 122, __pyx_L1_error)
7894 if (unlikely(((PyObject *)__pyx_v_format) == Py_None)) {
7895 PyErr_Format(PyExc_TypeError,
"Argument '%.200s' must not be None",
"format"); __PYX_ERR(1, 122, __pyx_L1_error)
7897 __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);
7912 __Pyx_RefNannyFinishContext();
7916 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) {
7918 Py_ssize_t __pyx_v_i;
7919 Py_ssize_t __pyx_v_dim;
7920 PyObject **__pyx_v_p;
7923 __Pyx_TraceDeclarations
7924 __Pyx_RefNannyDeclarations
7925 Py_ssize_t __pyx_t_1;
7927 PyObject *__pyx_t_3 = NULL;
7929 PyObject *__pyx_t_5 = NULL;
7930 PyObject *__pyx_t_6 = NULL;
7933 Py_ssize_t __pyx_t_9;
7934 PyObject *__pyx_t_10 = NULL;
7935 Py_ssize_t __pyx_t_11;
7936 int __pyx_lineno = 0;
7937 const char *__pyx_filename = NULL;
7938 int __pyx_clineno = 0;
7939 __Pyx_RefNannySetupContext(
"__cinit__", 0);
7940 __Pyx_TraceCall(
"__cinit__", __pyx_f[1], 122, 0, __PYX_ERR(1, 122, __pyx_L1_error));
7941 __Pyx_INCREF(__pyx_v_format);
7950 if (unlikely(__pyx_v_shape == Py_None)) {
7951 PyErr_SetString(PyExc_TypeError,
"object of type 'NoneType' has no len()");
7952 __PYX_ERR(1, 129, __pyx_L1_error)
7954 __pyx_t_1 = PyTuple_GET_SIZE(__pyx_v_shape);
if (unlikely(__pyx_t_1 == ((Py_ssize_t)-1))) __PYX_ERR(1, 129, __pyx_L1_error)
7955 __pyx_v_self->ndim = ((int)__pyx_t_1);
7964 __pyx_v_self->itemsize = __pyx_v_itemsize;
7973 __pyx_t_2 = ((!(__pyx_v_self->ndim != 0)) != 0);
7974 if (unlikely(__pyx_t_2)) {
7983 __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__18, NULL);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 133, __pyx_L1_error)
7984 __Pyx_GOTREF(__pyx_t_3);
7985 __Pyx_Raise(__pyx_t_3, 0, 0, 0);
7986 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
7987 __PYX_ERR(1, 133, __pyx_L1_error)
8005 __pyx_t_2 = ((__pyx_v_itemsize <= 0) != 0);
8006 if (unlikely(__pyx_t_2)) {
8015 __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__19, NULL);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 136, __pyx_L1_error)
8016 __Pyx_GOTREF(__pyx_t_3);
8017 __Pyx_Raise(__pyx_t_3, 0, 0, 0);
8018 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
8019 __PYX_ERR(1, 136, __pyx_L1_error)
8037 __pyx_t_2 = PyBytes_Check(__pyx_v_format);
8038 __pyx_t_4 = ((!(__pyx_t_2 != 0)) != 0);
8048 __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_format, __pyx_n_s_encode);
if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 139, __pyx_L1_error)
8049 __Pyx_GOTREF(__pyx_t_5);
8051 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) {
8052 __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5);
8053 if (likely(__pyx_t_6)) {
8054 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_5);
8055 __Pyx_INCREF(__pyx_t_6);
8056 __Pyx_INCREF(
function);
8057 __Pyx_DECREF_SET(__pyx_t_5,
function);
8060 __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);
8061 __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
8062 if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 139, __pyx_L1_error)
8063 __Pyx_GOTREF(__pyx_t_3);
8064 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
8065 __Pyx_DECREF_SET(__pyx_v_format, __pyx_t_3);
8084 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(1, 140, __pyx_L1_error)
8085 __pyx_t_3 = __pyx_v_format;
8086 __Pyx_INCREF(__pyx_t_3);
8087 __Pyx_GIVEREF(__pyx_t_3);
8088 __Pyx_GOTREF(__pyx_v_self->_format);
8089 __Pyx_DECREF(__pyx_v_self->_format);
8090 __pyx_v_self->_format = ((PyObject*)__pyx_t_3);
8100 if (unlikely(__pyx_v_self->_format == Py_None)) {
8101 PyErr_SetString(PyExc_TypeError,
"expected bytes, NoneType found");
8102 __PYX_ERR(1, 141, __pyx_L1_error)
8104 __pyx_t_7 = __Pyx_PyBytes_AsWritableString(__pyx_v_self->_format);
if (unlikely((!__pyx_t_7) && PyErr_Occurred())) __PYX_ERR(1, 141, __pyx_L1_error)
8105 __pyx_v_self->format = __pyx_t_7;
8114 __pyx_v_self->_shape = ((Py_ssize_t *)PyObject_Malloc((((
sizeof(Py_ssize_t)) * __pyx_v_self->ndim) * 2)));
8123 __pyx_v_self->_strides = (__pyx_v_self->_shape + __pyx_v_self->ndim);
8132 __pyx_t_4 = ((!(__pyx_v_self->_shape != 0)) != 0);
8133 if (unlikely(__pyx_t_4)) {
8142 __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_MemoryError, __pyx_tuple__20, NULL);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 148, __pyx_L1_error)
8143 __Pyx_GOTREF(__pyx_t_3);
8144 __Pyx_Raise(__pyx_t_3, 0, 0, 0);
8145 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
8146 __PYX_ERR(1, 148, __pyx_L1_error)
8165 __pyx_t_3 = __pyx_v_shape; __Pyx_INCREF(__pyx_t_3); __pyx_t_1 = 0;
8167 if (__pyx_t_1 >= PyTuple_GET_SIZE(__pyx_t_3))
break;
8168 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
8169 __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(1, 151, __pyx_L1_error)
8171 __pyx_t_5 = PySequence_ITEM(__pyx_t_3, __pyx_t_1); __pyx_t_1++;
if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 151, __pyx_L1_error)
8172 __Pyx_GOTREF(__pyx_t_5);
8174 __pyx_t_9 = __Pyx_PyIndex_AsSsize_t(__pyx_t_5);
if (unlikely((__pyx_t_9 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(1, 151, __pyx_L1_error)
8175 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
8176 __pyx_v_dim = __pyx_t_9;
8177 __pyx_v_idx = __pyx_t_8;
8178 __pyx_t_8 = (__pyx_t_8 + 1);
8187 __pyx_t_4 = ((__pyx_v_dim <= 0) != 0);
8188 if (unlikely(__pyx_t_4)) {
8197 __pyx_t_5 = __Pyx_PyInt_From_int(__pyx_v_idx);
if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 153, __pyx_L1_error)
8198 __Pyx_GOTREF(__pyx_t_5);
8199 __pyx_t_6 = PyInt_FromSsize_t(__pyx_v_dim);
if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 153, __pyx_L1_error)
8200 __Pyx_GOTREF(__pyx_t_6);
8201 __pyx_t_10 = PyTuple_New(2);
if (unlikely(!__pyx_t_10)) __PYX_ERR(1, 153, __pyx_L1_error)
8202 __Pyx_GOTREF(__pyx_t_10);
8203 __Pyx_GIVEREF(__pyx_t_5);
8204 PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_5);
8205 __Pyx_GIVEREF(__pyx_t_6);
8206 PyTuple_SET_ITEM(__pyx_t_10, 1, __pyx_t_6);
8209 __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(1, 153, __pyx_L1_error)
8210 __Pyx_GOTREF(__pyx_t_6);
8211 __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
8212 __pyx_t_10 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_6);
if (unlikely(!__pyx_t_10)) __PYX_ERR(1, 153, __pyx_L1_error)
8213 __Pyx_GOTREF(__pyx_t_10);
8214 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
8215 __Pyx_Raise(__pyx_t_10, 0, 0, 0);
8216 __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
8217 __PYX_ERR(1, 153, __pyx_L1_error)
8235 (__pyx_v_self->_shape[__pyx_v_idx]) = __pyx_v_dim;
8245 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
8254 __pyx_t_4 = (__Pyx_PyString_Equals(__pyx_v_mode, __pyx_n_s_fortran, Py_EQ));
if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(1, 157, __pyx_L1_error)
8264 __pyx_v_order =
'F';
8273 __Pyx_INCREF(__pyx_n_u_fortran);
8274 __Pyx_GIVEREF(__pyx_n_u_fortran);
8275 __Pyx_GOTREF(__pyx_v_self->mode);
8276 __Pyx_DECREF(__pyx_v_self->mode);
8277 __pyx_v_self->mode = __pyx_n_u_fortran;
8296 __pyx_t_4 = (__Pyx_PyString_Equals(__pyx_v_mode, __pyx_n_s_c, Py_EQ));
if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(1, 160, __pyx_L1_error)
8297 if (likely(__pyx_t_4)) {
8306 __pyx_v_order =
'C';
8315 __Pyx_INCREF(__pyx_n_u_c);
8316 __Pyx_GIVEREF(__pyx_n_u_c);
8317 __Pyx_GOTREF(__pyx_v_self->mode);
8318 __Pyx_DECREF(__pyx_v_self->mode);
8319 __pyx_v_self->mode = __pyx_n_u_c;
8339 __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(1, 164, __pyx_L1_error)
8340 __Pyx_GOTREF(__pyx_t_3);
8341 __pyx_t_10 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_3);
if (unlikely(!__pyx_t_10)) __PYX_ERR(1, 164, __pyx_L1_error)
8342 __Pyx_GOTREF(__pyx_t_10);
8343 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
8344 __Pyx_Raise(__pyx_t_10, 0, 0, 0);
8345 __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
8346 __PYX_ERR(1, 164, __pyx_L1_error)
8357 __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);
8366 __pyx_v_self->free_data = __pyx_v_allocate_buffer;
8375 __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(1, 170, __pyx_L1_error)
8376 __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_10);
if (unlikely((__pyx_t_4 == (
int)-1) && PyErr_Occurred())) __PYX_ERR(1, 170, __pyx_L1_error)
8377 __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
8378 __pyx_v_self->dtype_is_object = __pyx_t_4;
8387 __pyx_t_4 = (__pyx_v_allocate_buffer != 0);
8397 __pyx_v_self->data = ((
char *)malloc(__pyx_v_self->len));
8406 __pyx_t_4 = ((!(__pyx_v_self->data != 0)) != 0);
8407 if (unlikely(__pyx_t_4)) {
8416 __pyx_t_10 = __Pyx_PyObject_Call(__pyx_builtin_MemoryError, __pyx_tuple__21, NULL);
if (unlikely(!__pyx_t_10)) __PYX_ERR(1, 176, __pyx_L1_error)
8417 __Pyx_GOTREF(__pyx_t_10);
8418 __Pyx_Raise(__pyx_t_10, 0, 0, 0);
8419 __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
8420 __PYX_ERR(1, 176, __pyx_L1_error)
8438 __pyx_t_4 = (__pyx_v_self->dtype_is_object != 0);
8448 __pyx_v_p = ((PyObject **)__pyx_v_self->data);
8457 if (unlikely(__pyx_v_itemsize == 0)) {
8458 PyErr_SetString(PyExc_ZeroDivisionError,
"integer division or modulo by zero");
8459 __PYX_ERR(1, 180, __pyx_L1_error)
8461 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))) {
8462 PyErr_SetString(PyExc_OverflowError,
"value too large to perform division");
8463 __PYX_ERR(1, 180, __pyx_L1_error)
8465 __pyx_t_1 = __Pyx_div_Py_ssize_t(__pyx_v_self->len, __pyx_v_itemsize);
8466 __pyx_t_9 = __pyx_t_1;
8467 for (__pyx_t_11 = 0; __pyx_t_11 < __pyx_t_9; __pyx_t_11+=1) {
8468 __pyx_v_i = __pyx_t_11;
8477 (__pyx_v_p[__pyx_v_i]) = Py_None;
8519 __Pyx_XDECREF(__pyx_t_3);
8520 __Pyx_XDECREF(__pyx_t_5);
8521 __Pyx_XDECREF(__pyx_t_6);
8522 __Pyx_XDECREF(__pyx_t_10);
8523 __Pyx_AddTraceback(
"View.MemoryView.array.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
8526 __Pyx_XDECREF(__pyx_v_format);
8527 __Pyx_TraceReturn(Py_None, 0);
8528 __Pyx_RefNannyFinishContext();
8541 static CYTHON_UNUSED
int __pyx_array_getbuffer(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info,
int __pyx_v_flags);
8542 static CYTHON_UNUSED
int __pyx_array_getbuffer(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info,
int __pyx_v_flags) {
8544 __Pyx_RefNannyDeclarations
8545 __Pyx_RefNannySetupContext(
"__getbuffer__ (wrapper)", 0);
8546 __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));
8549 __Pyx_RefNannyFinishContext();
8553 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) {
8554 int __pyx_v_bufmode;
8556 __Pyx_TraceDeclarations
8557 __Pyx_RefNannyDeclarations
8560 PyObject *__pyx_t_3 = NULL;
8562 Py_ssize_t __pyx_t_5;
8564 Py_ssize_t *__pyx_t_7;
8565 int __pyx_lineno = 0;
8566 const char *__pyx_filename = NULL;
8567 int __pyx_clineno = 0;
8568 if (__pyx_v_info == NULL) {
8569 PyErr_SetString(PyExc_BufferError,
"PyObject_GetBuffer: view==NULL argument is obsolete");
8572 __Pyx_RefNannySetupContext(
"__getbuffer__", 0);
8573 __pyx_v_info->obj = Py_None; __Pyx_INCREF(Py_None);
8574 __Pyx_GIVEREF(__pyx_v_info->obj);
8575 __Pyx_TraceCall(
"__getbuffer__", __pyx_f[1], 185, 0, __PYX_ERR(1, 185, __pyx_L1_error));
8584 __pyx_v_bufmode = -1;
8593 __pyx_t_1 = (__Pyx_PyUnicode_Equals(__pyx_v_self->mode, __pyx_n_u_c, Py_EQ));
if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(1, 187, __pyx_L1_error)
8594 __pyx_t_2 = (__pyx_t_1 != 0);
8604 __pyx_v_bufmode = (PyBUF_C_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS);
8623 __pyx_t_2 = (__Pyx_PyUnicode_Equals(__pyx_v_self->mode, __pyx_n_u_fortran, Py_EQ));
if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(1, 189, __pyx_L1_error)
8624 __pyx_t_1 = (__pyx_t_2 != 0);
8634 __pyx_v_bufmode = (PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS);
8653 __pyx_t_1 = ((!((__pyx_v_flags & __pyx_v_bufmode) != 0)) != 0);
8654 if (unlikely(__pyx_t_1)) {
8663 __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__22, NULL);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 192, __pyx_L1_error)
8664 __Pyx_GOTREF(__pyx_t_3);
8665 __Pyx_Raise(__pyx_t_3, 0, 0, 0);
8666 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
8667 __PYX_ERR(1, 192, __pyx_L1_error)
8685 __pyx_t_4 = __pyx_v_self->data;
8686 __pyx_v_info->buf = __pyx_t_4;
8695 __pyx_t_5 = __pyx_v_self->len;
8696 __pyx_v_info->len = __pyx_t_5;
8705 __pyx_t_6 = __pyx_v_self->ndim;
8706 __pyx_v_info->ndim = __pyx_t_6;
8715 __pyx_t_7 = __pyx_v_self->_shape;
8716 __pyx_v_info->shape = __pyx_t_7;
8725 __pyx_t_7 = __pyx_v_self->_strides;
8726 __pyx_v_info->strides = __pyx_t_7;
8735 __pyx_v_info->suboffsets = NULL;
8744 __pyx_t_5 = __pyx_v_self->itemsize;
8745 __pyx_v_info->itemsize = __pyx_t_5;
8754 __pyx_v_info->readonly = 0;
8763 __pyx_t_1 = ((__pyx_v_flags & PyBUF_FORMAT) != 0);
8773 __pyx_t_4 = __pyx_v_self->format;
8774 __pyx_v_info->format = __pyx_t_4;
8794 __pyx_v_info->format = NULL;
8805 __Pyx_INCREF(((PyObject *)__pyx_v_self));
8806 __Pyx_GIVEREF(((PyObject *)__pyx_v_self));
8807 __Pyx_GOTREF(__pyx_v_info->obj);
8808 __Pyx_DECREF(__pyx_v_info->obj);
8809 __pyx_v_info->obj = ((PyObject *)__pyx_v_self);
8823 __Pyx_XDECREF(__pyx_t_3);
8824 __Pyx_AddTraceback(
"View.MemoryView.array.__getbuffer__", __pyx_clineno, __pyx_lineno, __pyx_filename);
8826 if (__pyx_v_info->obj != NULL) {
8827 __Pyx_GOTREF(__pyx_v_info->obj);
8828 __Pyx_DECREF(__pyx_v_info->obj); __pyx_v_info->obj = 0;
8832 if (__pyx_v_info->obj == Py_None) {
8833 __Pyx_GOTREF(__pyx_v_info->obj);
8834 __Pyx_DECREF(__pyx_v_info->obj); __pyx_v_info->obj = 0;
8837 __Pyx_TraceReturn(Py_None, 0);
8838 __Pyx_RefNannyFinishContext();
8851 static void __pyx_array___dealloc__(PyObject *__pyx_v_self);
8852 static void __pyx_array___dealloc__(PyObject *__pyx_v_self) {
8853 __Pyx_RefNannyDeclarations
8854 __Pyx_RefNannySetupContext(
"__dealloc__ (wrapper)", 0);
8855 __pyx_array___pyx_pf_15View_dot_MemoryView_5array_4__dealloc__(((
struct __pyx_array_obj *)__pyx_v_self));
8858 __Pyx_RefNannyFinishContext();
8861 static void __pyx_array___pyx_pf_15View_dot_MemoryView_5array_4__dealloc__(
struct __pyx_array_obj *__pyx_v_self) {
8862 __Pyx_TraceDeclarations
8863 __Pyx_RefNannyDeclarations
8865 int __pyx_lineno = 0;
8866 const char *__pyx_filename = NULL;
8867 int __pyx_clineno = 0;
8868 __Pyx_RefNannySetupContext(
"__dealloc__", 0);
8869 __Pyx_TraceCall(
"__dealloc__", __pyx_f[1], 211, 0, __PYX_ERR(1, 211, __pyx_L1_error));
8878 __pyx_t_1 = ((__pyx_v_self->callback_free_data != NULL) != 0);
8888 __pyx_v_self->callback_free_data(__pyx_v_self->data);
8907 __pyx_t_1 = (__pyx_v_self->free_data != 0);
8917 __pyx_t_1 = (__pyx_v_self->dtype_is_object != 0);
8927 __pyx_memoryview_refcount_objects_in_slice(__pyx_v_self->data, __pyx_v_self->_shape, __pyx_v_self->_strides, __pyx_v_self->ndim, 0);
8945 free(__pyx_v_self->data);
8964 PyObject_Free(__pyx_v_self->_shape);
8977 __Pyx_WriteUnraisable(
"View.MemoryView.array.__dealloc__", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
8979 __Pyx_TraceReturn(Py_None, 0);
8980 __Pyx_RefNannyFinishContext();
8992 static PyObject *__pyx_pw_15View_dot_MemoryView_5array_7memview_1__get__(PyObject *__pyx_v_self);
8993 static PyObject *__pyx_pw_15View_dot_MemoryView_5array_7memview_1__get__(PyObject *__pyx_v_self) {
8994 PyObject *__pyx_r = 0;
8995 __Pyx_RefNannyDeclarations
8996 __Pyx_RefNannySetupContext(
"__get__ (wrapper)", 0);
8997 __pyx_r = __pyx_pf_15View_dot_MemoryView_5array_7memview___get__(((
struct __pyx_array_obj *)__pyx_v_self));
9000 __Pyx_RefNannyFinishContext();
9004 static PyObject *__pyx_pf_15View_dot_MemoryView_5array_7memview___get__(
struct __pyx_array_obj *__pyx_v_self) {
9005 PyObject *__pyx_r = NULL;
9006 __Pyx_TraceDeclarations
9007 __Pyx_RefNannyDeclarations
9008 PyObject *__pyx_t_1 = NULL;
9009 int __pyx_lineno = 0;
9010 const char *__pyx_filename = NULL;
9011 int __pyx_clineno = 0;
9012 __Pyx_RefNannySetupContext(
"__get__", 0);
9013 __Pyx_TraceCall(
"__get__", __pyx_f[1], 222, 0, __PYX_ERR(1, 222, __pyx_L1_error));
9022 __Pyx_XDECREF(__pyx_r);
9023 __pyx_t_1 = ((
struct __pyx_vtabstruct_array *)__pyx_v_self->__pyx_vtab)->get_memview(__pyx_v_self);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 223, __pyx_L1_error)
9024 __Pyx_GOTREF(__pyx_t_1);
9025 __pyx_r = __pyx_t_1;
9039 __Pyx_XDECREF(__pyx_t_1);
9040 __Pyx_AddTraceback(
"View.MemoryView.array.memview.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
9043 __Pyx_XGIVEREF(__pyx_r);
9044 __Pyx_TraceReturn(__pyx_r, 0);
9045 __Pyx_RefNannyFinishContext();
9057 static PyObject *__pyx_array_get_memview(
struct __pyx_array_obj *__pyx_v_self) {
9059 PyObject *__pyx_r = NULL;
9060 __Pyx_TraceDeclarations
9061 __Pyx_RefNannyDeclarations
9062 PyObject *__pyx_t_1 = NULL;
9063 PyObject *__pyx_t_2 = NULL;
9064 PyObject *__pyx_t_3 = NULL;
9065 int __pyx_lineno = 0;
9066 const char *__pyx_filename = NULL;
9067 int __pyx_clineno = 0;
9068 __Pyx_RefNannySetupContext(
"get_memview", 0);
9069 __Pyx_TraceCall(
"get_memview", __pyx_f[1], 226, 0, __PYX_ERR(1, 226, __pyx_L1_error));
9078 __pyx_v_flags = ((PyBUF_ANY_CONTIGUOUS | PyBUF_FORMAT) | PyBUF_WRITABLE);
9087 __Pyx_XDECREF(__pyx_r);
9088 __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_flags);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 228, __pyx_L1_error)
9089 __Pyx_GOTREF(__pyx_t_1);
9090 __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_v_self->dtype_is_object);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 228, __pyx_L1_error)
9091 __Pyx_GOTREF(__pyx_t_2);
9092 __pyx_t_3 = PyTuple_New(3);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 228, __pyx_L1_error)
9093 __Pyx_GOTREF(__pyx_t_3);
9094 __Pyx_INCREF(((PyObject *)__pyx_v_self));
9095 __Pyx_GIVEREF(((PyObject *)__pyx_v_self));
9096 PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_v_self));
9097 __Pyx_GIVEREF(__pyx_t_1);
9098 PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_1);
9099 __Pyx_GIVEREF(__pyx_t_2);
9100 PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_t_2);
9103 __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_memoryview_type), __pyx_t_3, NULL);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 228, __pyx_L1_error)
9104 __Pyx_GOTREF(__pyx_t_2);
9105 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
9106 __pyx_r = __pyx_t_2;
9120 __Pyx_XDECREF(__pyx_t_1);
9121 __Pyx_XDECREF(__pyx_t_2);
9122 __Pyx_XDECREF(__pyx_t_3);
9123 __Pyx_AddTraceback(
"View.MemoryView.array.get_memview", __pyx_clineno, __pyx_lineno, __pyx_filename);
9126 __Pyx_XGIVEREF(__pyx_r);
9127 __Pyx_TraceReturn(__pyx_r, 0);
9128 __Pyx_RefNannyFinishContext();
9141 static Py_ssize_t __pyx_array___len__(PyObject *__pyx_v_self);
9142 static Py_ssize_t __pyx_array___len__(PyObject *__pyx_v_self) {
9144 __Pyx_RefNannyDeclarations
9145 __Pyx_RefNannySetupContext(
"__len__ (wrapper)", 0);
9146 __pyx_r = __pyx_array___pyx_pf_15View_dot_MemoryView_5array_6__len__(((
struct __pyx_array_obj *)__pyx_v_self));
9149 __Pyx_RefNannyFinishContext();
9153 static Py_ssize_t __pyx_array___pyx_pf_15View_dot_MemoryView_5array_6__len__(
struct __pyx_array_obj *__pyx_v_self) {
9155 __Pyx_TraceDeclarations
9156 __Pyx_RefNannyDeclarations
9157 int __pyx_lineno = 0;
9158 const char *__pyx_filename = NULL;
9159 int __pyx_clineno = 0;
9160 __Pyx_RefNannySetupContext(
"__len__", 0);
9161 __Pyx_TraceCall(
"__len__", __pyx_f[1], 230, 0, __PYX_ERR(1, 230, __pyx_L1_error));
9170 __pyx_r = (__pyx_v_self->_shape[0]);
9183 __Pyx_AddTraceback(
"View.MemoryView.array.__len__", __pyx_clineno, __pyx_lineno, __pyx_filename);
9186 __Pyx_TraceReturn(Py_None, 0);
9187 __Pyx_RefNannyFinishContext();
9200 static PyObject *__pyx_array___getattr__(PyObject *__pyx_v_self, PyObject *__pyx_v_attr);
9201 static PyObject *__pyx_array___getattr__(PyObject *__pyx_v_self, PyObject *__pyx_v_attr) {
9202 PyObject *__pyx_r = 0;
9203 __Pyx_RefNannyDeclarations
9204 __Pyx_RefNannySetupContext(
"__getattr__ (wrapper)", 0);
9205 __pyx_r = __pyx_array___pyx_pf_15View_dot_MemoryView_5array_8__getattr__(((
struct __pyx_array_obj *)__pyx_v_self), ((PyObject *)__pyx_v_attr));
9208 __Pyx_RefNannyFinishContext();
9212 static PyObject *__pyx_array___pyx_pf_15View_dot_MemoryView_5array_8__getattr__(
struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_attr) {
9213 PyObject *__pyx_r = NULL;
9214 __Pyx_TraceDeclarations
9215 __Pyx_RefNannyDeclarations
9216 PyObject *__pyx_t_1 = NULL;
9217 PyObject *__pyx_t_2 = NULL;
9218 int __pyx_lineno = 0;
9219 const char *__pyx_filename = NULL;
9220 int __pyx_clineno = 0;
9221 __Pyx_RefNannySetupContext(
"__getattr__", 0);
9222 __Pyx_TraceCall(
"__getattr__", __pyx_f[1], 233, 0, __PYX_ERR(1, 233, __pyx_L1_error));
9231 __Pyx_XDECREF(__pyx_r);
9232 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_memview);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 234, __pyx_L1_error)
9233 __Pyx_GOTREF(__pyx_t_1);
9234 __pyx_t_2 = __Pyx_GetAttr(__pyx_t_1, __pyx_v_attr);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 234, __pyx_L1_error)
9235 __Pyx_GOTREF(__pyx_t_2);
9236 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
9237 __pyx_r = __pyx_t_2;
9251 __Pyx_XDECREF(__pyx_t_1);
9252 __Pyx_XDECREF(__pyx_t_2);
9253 __Pyx_AddTraceback(
"View.MemoryView.array.__getattr__", __pyx_clineno, __pyx_lineno, __pyx_filename);
9256 __Pyx_XGIVEREF(__pyx_r);
9257 __Pyx_TraceReturn(__pyx_r, 0);
9258 __Pyx_RefNannyFinishContext();
9271 static PyObject *__pyx_array___getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_item);
9272 static PyObject *__pyx_array___getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_item) {
9273 PyObject *__pyx_r = 0;
9274 __Pyx_RefNannyDeclarations
9275 __Pyx_RefNannySetupContext(
"__getitem__ (wrapper)", 0);
9276 __pyx_r = __pyx_array___pyx_pf_15View_dot_MemoryView_5array_10__getitem__(((
struct __pyx_array_obj *)__pyx_v_self), ((PyObject *)__pyx_v_item));
9279 __Pyx_RefNannyFinishContext();
9283 static PyObject *__pyx_array___pyx_pf_15View_dot_MemoryView_5array_10__getitem__(
struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_item) {
9284 PyObject *__pyx_r = NULL;
9285 __Pyx_TraceDeclarations
9286 __Pyx_RefNannyDeclarations
9287 PyObject *__pyx_t_1 = NULL;
9288 PyObject *__pyx_t_2 = NULL;
9289 int __pyx_lineno = 0;
9290 const char *__pyx_filename = NULL;
9291 int __pyx_clineno = 0;
9292 __Pyx_RefNannySetupContext(
"__getitem__", 0);
9293 __Pyx_TraceCall(
"__getitem__", __pyx_f[1], 236, 0, __PYX_ERR(1, 236, __pyx_L1_error));
9302 __Pyx_XDECREF(__pyx_r);
9303 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_memview);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 237, __pyx_L1_error)
9304 __Pyx_GOTREF(__pyx_t_1);
9305 __pyx_t_2 = __Pyx_PyObject_GetItem(__pyx_t_1, __pyx_v_item);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 237, __pyx_L1_error)
9306 __Pyx_GOTREF(__pyx_t_2);
9307 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
9308 __pyx_r = __pyx_t_2;
9322 __Pyx_XDECREF(__pyx_t_1);
9323 __Pyx_XDECREF(__pyx_t_2);
9324 __Pyx_AddTraceback(
"View.MemoryView.array.__getitem__", __pyx_clineno, __pyx_lineno, __pyx_filename);
9327 __Pyx_XGIVEREF(__pyx_r);
9328 __Pyx_TraceReturn(__pyx_r, 0);
9329 __Pyx_RefNannyFinishContext();
9342 static int __pyx_array___setitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_item, PyObject *__pyx_v_value);
9343 static int __pyx_array___setitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_item, PyObject *__pyx_v_value) {
9345 __Pyx_RefNannyDeclarations
9346 __Pyx_RefNannySetupContext(
"__setitem__ (wrapper)", 0);
9347 __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));
9350 __Pyx_RefNannyFinishContext();
9354 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) {
9356 __Pyx_TraceDeclarations
9357 __Pyx_RefNannyDeclarations
9358 PyObject *__pyx_t_1 = NULL;
9359 int __pyx_lineno = 0;
9360 const char *__pyx_filename = NULL;
9361 int __pyx_clineno = 0;
9362 __Pyx_RefNannySetupContext(
"__setitem__", 0);
9363 __Pyx_TraceCall(
"__setitem__", __pyx_f[1], 239, 0, __PYX_ERR(1, 239, __pyx_L1_error));
9372 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_memview);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 240, __pyx_L1_error)
9373 __Pyx_GOTREF(__pyx_t_1);
9374 if (unlikely(PyObject_SetItem(__pyx_t_1, __pyx_v_item, __pyx_v_value) < 0)) __PYX_ERR(1, 240, __pyx_L1_error)
9375 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
9389 __Pyx_XDECREF(__pyx_t_1);
9390 __Pyx_AddTraceback(
"View.MemoryView.array.__setitem__", __pyx_clineno, __pyx_lineno, __pyx_filename);
9393 __Pyx_TraceReturn(Py_None, 0);
9394 __Pyx_RefNannyFinishContext();
9405 static PyObject *__pyx_pw___pyx_array_1__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused);
9406 static PyMethodDef __pyx_mdef___pyx_array_1__reduce_cython__ = {
"__reduce_cython__", (PyCFunction)__pyx_pw___pyx_array_1__reduce_cython__, METH_NOARGS, 0};
9407 static PyObject *__pyx_pw___pyx_array_1__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
9408 PyObject *__pyx_r = 0;
9409 __Pyx_RefNannyDeclarations
9410 __Pyx_RefNannySetupContext(
"__reduce_cython__ (wrapper)", 0);
9411 __pyx_r = __pyx_pf___pyx_array___reduce_cython__(((
struct __pyx_array_obj *)__pyx_v_self));
9414 __Pyx_RefNannyFinishContext();
9418 static PyObject *__pyx_pf___pyx_array___reduce_cython__(CYTHON_UNUSED
struct __pyx_array_obj *__pyx_v_self) {
9419 PyObject *__pyx_r = NULL;
9420 __Pyx_TraceDeclarations
9421 __Pyx_RefNannyDeclarations
9422 PyObject *__pyx_t_1 = NULL;
9423 int __pyx_lineno = 0;
9424 const char *__pyx_filename = NULL;
9425 int __pyx_clineno = 0;
9426 __Pyx_RefNannySetupContext(
"__reduce_cython__", 0);
9427 __Pyx_TraceCall(
"__reduce_cython__", __pyx_f[1], 1, 0, __PYX_ERR(1, 1, __pyx_L1_error));
9435 __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__23, NULL);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 2, __pyx_L1_error)
9436 __Pyx_GOTREF(__pyx_t_1);
9437 __Pyx_Raise(__pyx_t_1, 0, 0, 0);
9438 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
9439 __PYX_ERR(1, 2, __pyx_L1_error)
9449 __Pyx_XDECREF(__pyx_t_1);
9450 __Pyx_AddTraceback(
"View.MemoryView.array.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
9452 __Pyx_XGIVEREF(__pyx_r);
9453 __Pyx_TraceReturn(__pyx_r, 0);
9454 __Pyx_RefNannyFinishContext();
9466 static PyObject *__pyx_pw___pyx_array_3__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state);
9467 static PyMethodDef __pyx_mdef___pyx_array_3__setstate_cython__ = {
"__setstate_cython__", (PyCFunction)__pyx_pw___pyx_array_3__setstate_cython__, METH_O, 0};
9468 static PyObject *__pyx_pw___pyx_array_3__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
9469 PyObject *__pyx_r = 0;
9470 __Pyx_RefNannyDeclarations
9471 __Pyx_RefNannySetupContext(
"__setstate_cython__ (wrapper)", 0);
9472 __pyx_r = __pyx_pf___pyx_array_2__setstate_cython__(((
struct __pyx_array_obj *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state));
9475 __Pyx_RefNannyFinishContext();
9479 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) {
9480 PyObject *__pyx_r = NULL;
9481 __Pyx_TraceDeclarations
9482 __Pyx_RefNannyDeclarations
9483 PyObject *__pyx_t_1 = NULL;
9484 int __pyx_lineno = 0;
9485 const char *__pyx_filename = NULL;
9486 int __pyx_clineno = 0;
9487 __Pyx_RefNannySetupContext(
"__setstate_cython__", 0);
9488 __Pyx_TraceCall(
"__setstate_cython__", __pyx_f[1], 3, 0, __PYX_ERR(1, 3, __pyx_L1_error));
9495 __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__24, NULL);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 4, __pyx_L1_error)
9496 __Pyx_GOTREF(__pyx_t_1);
9497 __Pyx_Raise(__pyx_t_1, 0, 0, 0);
9498 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
9499 __PYX_ERR(1, 4, __pyx_L1_error)
9510 __Pyx_XDECREF(__pyx_t_1);
9511 __Pyx_AddTraceback(
"View.MemoryView.array.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
9513 __Pyx_XGIVEREF(__pyx_r);
9514 __Pyx_TraceReturn(__pyx_r, 0);
9515 __Pyx_RefNannyFinishContext();
9527 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) {
9528 struct __pyx_array_obj *__pyx_v_result = 0;
9529 struct __pyx_array_obj *__pyx_r = NULL;
9530 __Pyx_TraceDeclarations
9531 __Pyx_RefNannyDeclarations
9533 PyObject *__pyx_t_2 = NULL;
9534 PyObject *__pyx_t_3 = NULL;
9535 PyObject *__pyx_t_4 = NULL;
9536 PyObject *__pyx_t_5 = NULL;
9537 int __pyx_lineno = 0;
9538 const char *__pyx_filename = NULL;
9539 int __pyx_clineno = 0;
9540 __Pyx_RefNannySetupContext(
"array_cwrapper", 0);
9541 __Pyx_TraceCall(
"array_cwrapper", __pyx_f[1], 244, 0, __PYX_ERR(1, 244, __pyx_L1_error));
9550 __pyx_t_1 = ((__pyx_v_buf == NULL) != 0);
9560 __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_itemsize);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 249, __pyx_L1_error)
9561 __Pyx_GOTREF(__pyx_t_2);
9562 __pyx_t_3 = __Pyx_PyBytes_FromString(__pyx_v_format);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 249, __pyx_L1_error)
9563 __Pyx_GOTREF(__pyx_t_3);
9564 __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(1, 249, __pyx_L1_error)
9565 __Pyx_GOTREF(__pyx_t_4);
9566 __pyx_t_5 = PyTuple_New(4);
if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 249, __pyx_L1_error)
9567 __Pyx_GOTREF(__pyx_t_5);
9568 __Pyx_INCREF(__pyx_v_shape);
9569 __Pyx_GIVEREF(__pyx_v_shape);
9570 PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_v_shape);
9571 __Pyx_GIVEREF(__pyx_t_2);
9572 PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_2);
9573 __Pyx_GIVEREF(__pyx_t_3);
9574 PyTuple_SET_ITEM(__pyx_t_5, 2, __pyx_t_3);
9575 __Pyx_GIVEREF(__pyx_t_4);
9576 PyTuple_SET_ITEM(__pyx_t_5, 3, __pyx_t_4);
9580 __pyx_t_4 = __Pyx_PyObject_Call(((PyObject *)__pyx_array_type), __pyx_t_5, NULL);
if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 249, __pyx_L1_error)
9581 __Pyx_GOTREF(__pyx_t_4);
9582 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
9583 __pyx_v_result = ((
struct __pyx_array_obj *)__pyx_t_4);
9604 __pyx_t_4 = PyInt_FromSsize_t(__pyx_v_itemsize);
if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 251, __pyx_L1_error)
9605 __Pyx_GOTREF(__pyx_t_4);
9606 __pyx_t_5 = __Pyx_PyBytes_FromString(__pyx_v_format);
if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 251, __pyx_L1_error)
9607 __Pyx_GOTREF(__pyx_t_5);
9608 __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(1, 251, __pyx_L1_error)
9609 __Pyx_GOTREF(__pyx_t_3);
9610 __pyx_t_2 = PyTuple_New(4);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 251, __pyx_L1_error)
9611 __Pyx_GOTREF(__pyx_t_2);
9612 __Pyx_INCREF(__pyx_v_shape);
9613 __Pyx_GIVEREF(__pyx_v_shape);
9614 PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_shape);
9615 __Pyx_GIVEREF(__pyx_t_4);
9616 PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_4);
9617 __Pyx_GIVEREF(__pyx_t_5);
9618 PyTuple_SET_ITEM(__pyx_t_2, 2, __pyx_t_5);
9619 __Pyx_GIVEREF(__pyx_t_3);
9620 PyTuple_SET_ITEM(__pyx_t_2, 3, __pyx_t_3);
9632 __pyx_t_3 = __Pyx_PyDict_NewPresized(1);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 252, __pyx_L1_error)
9633 __Pyx_GOTREF(__pyx_t_3);
9634 if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_allocate_buffer, Py_False) < 0) __PYX_ERR(1, 252, __pyx_L1_error)
9643 __pyx_t_5 = __Pyx_PyObject_Call(((PyObject *)__pyx_array_type), __pyx_t_2, __pyx_t_3);
if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 251, __pyx_L1_error)
9644 __Pyx_GOTREF(__pyx_t_5);
9645 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
9646 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
9647 __pyx_v_result = ((
struct __pyx_array_obj *)__pyx_t_5);
9657 __pyx_v_result->data = __pyx_v_buf;
9668 __Pyx_XDECREF(((PyObject *)__pyx_r));
9669 __Pyx_INCREF(((PyObject *)__pyx_v_result));
9670 __pyx_r = __pyx_v_result;
9683 __Pyx_XDECREF(__pyx_t_2);
9684 __Pyx_XDECREF(__pyx_t_3);
9685 __Pyx_XDECREF(__pyx_t_4);
9686 __Pyx_XDECREF(__pyx_t_5);
9687 __Pyx_AddTraceback(
"View.MemoryView.array_cwrapper", __pyx_clineno, __pyx_lineno, __pyx_filename);
9690 __Pyx_XDECREF((PyObject *)__pyx_v_result);
9691 __Pyx_XGIVEREF((PyObject *)__pyx_r);
9692 __Pyx_TraceReturn(__pyx_r, 0);
9693 __Pyx_RefNannyFinishContext();
9706 static int __pyx_MemviewEnum___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
9707 static int __pyx_MemviewEnum___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
9708 PyObject *__pyx_v_name = 0;
9709 int __pyx_lineno = 0;
9710 const char *__pyx_filename = NULL;
9711 int __pyx_clineno = 0;
9713 __Pyx_RefNannyDeclarations
9714 __Pyx_RefNannySetupContext(
"__init__ (wrapper)", 0);
9716 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_name,0};
9717 PyObject* values[1] = {0};
9718 if (unlikely(__pyx_kwds)) {
9720 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
9722 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
9725 default:
goto __pyx_L5_argtuple_error;
9727 kw_args = PyDict_Size(__pyx_kwds);
9730 if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_name)) != 0)) kw_args--;
9731 else goto __pyx_L5_argtuple_error;
9733 if (unlikely(kw_args > 0)) {
9734 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args,
"__init__") < 0)) __PYX_ERR(1, 281, __pyx_L3_error)
9736 }
else if (PyTuple_GET_SIZE(__pyx_args) != 1) {
9737 goto __pyx_L5_argtuple_error;
9739 values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
9741 __pyx_v_name = values[0];
9743 goto __pyx_L4_argument_unpacking_done;
9744 __pyx_L5_argtuple_error:;
9745 __Pyx_RaiseArgtupleInvalid(
"__init__", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(1, 281, __pyx_L3_error)
9747 __Pyx_AddTraceback(
"View.MemoryView.Enum.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
9748 __Pyx_RefNannyFinishContext();
9750 __pyx_L4_argument_unpacking_done:;
9751 __pyx_r = __pyx_MemviewEnum___pyx_pf_15View_dot_MemoryView_4Enum___init__(((
struct __pyx_MemviewEnum_obj *)__pyx_v_self), __pyx_v_name);
9754 __Pyx_RefNannyFinishContext();
9758 static int __pyx_MemviewEnum___pyx_pf_15View_dot_MemoryView_4Enum___init__(
struct __pyx_MemviewEnum_obj *__pyx_v_self, PyObject *__pyx_v_name) {
9760 __Pyx_TraceDeclarations
9761 __Pyx_RefNannyDeclarations
9762 int __pyx_lineno = 0;
9763 const char *__pyx_filename = NULL;
9764 int __pyx_clineno = 0;
9765 __Pyx_RefNannySetupContext(
"__init__", 0);
9766 __Pyx_TraceCall(
"__init__", __pyx_f[1], 281, 0, __PYX_ERR(1, 281, __pyx_L1_error));
9775 __Pyx_INCREF(__pyx_v_name);
9776 __Pyx_GIVEREF(__pyx_v_name);
9777 __Pyx_GOTREF(__pyx_v_self->name);
9778 __Pyx_DECREF(__pyx_v_self->name);
9779 __pyx_v_self->name = __pyx_v_name;
9793 __Pyx_AddTraceback(
"View.MemoryView.Enum.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
9796 __Pyx_TraceReturn(Py_None, 0);
9797 __Pyx_RefNannyFinishContext();
9810 static PyObject *__pyx_MemviewEnum___repr__(PyObject *__pyx_v_self);
9811 static PyObject *__pyx_MemviewEnum___repr__(PyObject *__pyx_v_self) {
9812 PyObject *__pyx_r = 0;
9813 __Pyx_RefNannyDeclarations
9814 __Pyx_RefNannySetupContext(
"__repr__ (wrapper)", 0);
9815 __pyx_r = __pyx_MemviewEnum___pyx_pf_15View_dot_MemoryView_4Enum_2__repr__(((
struct __pyx_MemviewEnum_obj *)__pyx_v_self));
9818 __Pyx_RefNannyFinishContext();
9822 static PyObject *__pyx_MemviewEnum___pyx_pf_15View_dot_MemoryView_4Enum_2__repr__(
struct __pyx_MemviewEnum_obj *__pyx_v_self) {
9823 PyObject *__pyx_r = NULL;
9824 __Pyx_TraceDeclarations
9825 __Pyx_RefNannyDeclarations
9826 int __pyx_lineno = 0;
9827 const char *__pyx_filename = NULL;
9828 int __pyx_clineno = 0;
9829 __Pyx_RefNannySetupContext(
"__repr__", 0);
9830 __Pyx_TraceCall(
"__repr__", __pyx_f[1], 283, 0, __PYX_ERR(1, 283, __pyx_L1_error));
9839 __Pyx_XDECREF(__pyx_r);
9840 __Pyx_INCREF(__pyx_v_self->name);
9841 __pyx_r = __pyx_v_self->name;
9854 __Pyx_AddTraceback(
"View.MemoryView.Enum.__repr__", __pyx_clineno, __pyx_lineno, __pyx_filename);
9857 __Pyx_XGIVEREF(__pyx_r);
9858 __Pyx_TraceReturn(__pyx_r, 0);
9859 __Pyx_RefNannyFinishContext();
9870 static PyObject *__pyx_pw___pyx_MemviewEnum_1__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused);
9871 static PyMethodDef __pyx_mdef___pyx_MemviewEnum_1__reduce_cython__ = {
"__reduce_cython__", (PyCFunction)__pyx_pw___pyx_MemviewEnum_1__reduce_cython__, METH_NOARGS, 0};
9872 static PyObject *__pyx_pw___pyx_MemviewEnum_1__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
9873 PyObject *__pyx_r = 0;
9874 __Pyx_RefNannyDeclarations
9875 __Pyx_RefNannySetupContext(
"__reduce_cython__ (wrapper)", 0);
9876 __pyx_r = __pyx_pf___pyx_MemviewEnum___reduce_cython__(((
struct __pyx_MemviewEnum_obj *)__pyx_v_self));
9879 __Pyx_RefNannyFinishContext();
9883 static PyObject *__pyx_pf___pyx_MemviewEnum___reduce_cython__(
struct __pyx_MemviewEnum_obj *__pyx_v_self) {
9884 PyObject *__pyx_v_state = 0;
9885 PyObject *__pyx_v__dict = 0;
9886 int __pyx_v_use_setstate;
9887 PyObject *__pyx_r = NULL;
9888 __Pyx_TraceDeclarations
9889 __Pyx_RefNannyDeclarations
9890 PyObject *__pyx_t_1 = NULL;
9893 PyObject *__pyx_t_4 = NULL;
9894 PyObject *__pyx_t_5 = NULL;
9895 int __pyx_lineno = 0;
9896 const char *__pyx_filename = NULL;
9897 int __pyx_clineno = 0;
9898 __Pyx_RefNannySetupContext(
"__reduce_cython__", 0);
9899 __Pyx_TraceCall(
"__reduce_cython__", __pyx_f[1], 1, 0, __PYX_ERR(1, 1, __pyx_L1_error));
9908 __pyx_t_1 = PyTuple_New(1);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 5, __pyx_L1_error)
9909 __Pyx_GOTREF(__pyx_t_1);
9910 __Pyx_INCREF(__pyx_v_self->name);
9911 __Pyx_GIVEREF(__pyx_v_self->name);
9912 PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_self->name);
9913 __pyx_v_state = ((PyObject*)__pyx_t_1);
9923 __pyx_t_1 = __Pyx_GetAttr3(((PyObject *)__pyx_v_self), __pyx_n_s_dict, Py_None);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 6, __pyx_L1_error)
9924 __Pyx_GOTREF(__pyx_t_1);
9925 __pyx_v__dict = __pyx_t_1;
9935 __pyx_t_2 = (__pyx_v__dict != Py_None);
9936 __pyx_t_3 = (__pyx_t_2 != 0);
9946 __pyx_t_1 = PyTuple_New(1);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 8, __pyx_L1_error)
9947 __Pyx_GOTREF(__pyx_t_1);
9948 __Pyx_INCREF(__pyx_v__dict);
9949 __Pyx_GIVEREF(__pyx_v__dict);
9950 PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v__dict);
9951 __pyx_t_4 = PyNumber_InPlaceAdd(__pyx_v_state, __pyx_t_1);
if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 8, __pyx_L1_error)
9952 __Pyx_GOTREF(__pyx_t_4);
9953 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
9954 __Pyx_DECREF_SET(__pyx_v_state, ((PyObject*)__pyx_t_4));
9964 __pyx_v_use_setstate = 1;
9984 __pyx_t_3 = (__pyx_v_self->name != Py_None);
9985 __pyx_v_use_setstate = __pyx_t_3;
9996 __pyx_t_3 = (__pyx_v_use_setstate != 0);
10006 __Pyx_XDECREF(__pyx_r);
10007 __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_pyx_unpickle_Enum);
if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 13, __pyx_L1_error)
10008 __Pyx_GOTREF(__pyx_t_4);
10009 __pyx_t_1 = PyTuple_New(3);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 13, __pyx_L1_error)
10010 __Pyx_GOTREF(__pyx_t_1);
10011 __Pyx_INCREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
10012 __Pyx_GIVEREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
10013 PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
10014 __Pyx_INCREF(__pyx_int_184977713);
10015 __Pyx_GIVEREF(__pyx_int_184977713);
10016 PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_int_184977713);
10017 __Pyx_INCREF(Py_None);
10018 __Pyx_GIVEREF(Py_None);
10019 PyTuple_SET_ITEM(__pyx_t_1, 2, Py_None);
10020 __pyx_t_5 = PyTuple_New(3);
if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 13, __pyx_L1_error)
10021 __Pyx_GOTREF(__pyx_t_5);
10022 __Pyx_GIVEREF(__pyx_t_4);
10023 PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4);
10024 __Pyx_GIVEREF(__pyx_t_1);
10025 PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_1);
10026 __Pyx_INCREF(__pyx_v_state);
10027 __Pyx_GIVEREF(__pyx_v_state);
10028 PyTuple_SET_ITEM(__pyx_t_5, 2, __pyx_v_state);
10031 __pyx_r = __pyx_t_5;
10052 __Pyx_XDECREF(__pyx_r);
10053 __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_pyx_unpickle_Enum);
if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 15, __pyx_L1_error)
10054 __Pyx_GOTREF(__pyx_t_5);
10055 __pyx_t_1 = PyTuple_New(3);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 15, __pyx_L1_error)
10056 __Pyx_GOTREF(__pyx_t_1);
10057 __Pyx_INCREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
10058 __Pyx_GIVEREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
10059 PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
10060 __Pyx_INCREF(__pyx_int_184977713);
10061 __Pyx_GIVEREF(__pyx_int_184977713);
10062 PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_int_184977713);
10063 __Pyx_INCREF(__pyx_v_state);
10064 __Pyx_GIVEREF(__pyx_v_state);
10065 PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_v_state);
10066 __pyx_t_4 = PyTuple_New(2);
if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 15, __pyx_L1_error)
10067 __Pyx_GOTREF(__pyx_t_4);
10068 __Pyx_GIVEREF(__pyx_t_5);
10069 PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_5);
10070 __Pyx_GIVEREF(__pyx_t_1);
10071 PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_1);
10074 __pyx_r = __pyx_t_4;
10087 __Pyx_XDECREF(__pyx_t_1);
10088 __Pyx_XDECREF(__pyx_t_4);
10089 __Pyx_XDECREF(__pyx_t_5);
10090 __Pyx_AddTraceback(
"View.MemoryView.Enum.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
10093 __Pyx_XDECREF(__pyx_v_state);
10094 __Pyx_XDECREF(__pyx_v__dict);
10095 __Pyx_XGIVEREF(__pyx_r);
10096 __Pyx_TraceReturn(__pyx_r, 0);
10097 __Pyx_RefNannyFinishContext();
10109 static PyObject *__pyx_pw___pyx_MemviewEnum_3__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state);
10110 static PyMethodDef __pyx_mdef___pyx_MemviewEnum_3__setstate_cython__ = {
"__setstate_cython__", (PyCFunction)__pyx_pw___pyx_MemviewEnum_3__setstate_cython__, METH_O, 0};
10111 static PyObject *__pyx_pw___pyx_MemviewEnum_3__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
10112 PyObject *__pyx_r = 0;
10113 __Pyx_RefNannyDeclarations
10114 __Pyx_RefNannySetupContext(
"__setstate_cython__ (wrapper)", 0);
10115 __pyx_r = __pyx_pf___pyx_MemviewEnum_2__setstate_cython__(((
struct __pyx_MemviewEnum_obj *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state));
10118 __Pyx_RefNannyFinishContext();
10122 static PyObject *__pyx_pf___pyx_MemviewEnum_2__setstate_cython__(
struct __pyx_MemviewEnum_obj *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
10123 PyObject *__pyx_r = NULL;
10124 __Pyx_TraceDeclarations
10125 __Pyx_RefNannyDeclarations
10126 PyObject *__pyx_t_1 = NULL;
10127 int __pyx_lineno = 0;
10128 const char *__pyx_filename = NULL;
10129 int __pyx_clineno = 0;
10130 __Pyx_RefNannySetupContext(
"__setstate_cython__", 0);
10131 __Pyx_TraceCall(
"__setstate_cython__", __pyx_f[1], 16, 0, __PYX_ERR(1, 16, __pyx_L1_error));
10138 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(1, 17, __pyx_L1_error)
10139 __pyx_t_1 = __pyx_unpickle_Enum__set_state(__pyx_v_self, ((PyObject*)__pyx_v___pyx_state));
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 17, __pyx_L1_error)
10140 __Pyx_GOTREF(__pyx_t_1);
10141 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
10151 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
10154 __Pyx_XDECREF(__pyx_t_1);
10155 __Pyx_AddTraceback(
"View.MemoryView.Enum.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
10158 __Pyx_XGIVEREF(__pyx_r);
10159 __Pyx_TraceReturn(__pyx_r, 0);
10160 __Pyx_RefNannyFinishContext();
10172 static void *__pyx_align_pointer(
void *__pyx_v_memory,
size_t __pyx_v_alignment) {
10173 Py_intptr_t __pyx_v_aligned_p;
10174 size_t __pyx_v_offset;
10176 __Pyx_TraceDeclarations
10178 int __pyx_lineno = 0;
10179 const char *__pyx_filename = NULL;
10180 int __pyx_clineno = 0;
10181 __Pyx_TraceCall(
"align_pointer", __pyx_f[1], 298, 1, __PYX_ERR(1, 298, __pyx_L1_error));
10190 __pyx_v_aligned_p = ((Py_intptr_t)__pyx_v_memory);
10199 __pyx_v_offset = (__pyx_v_aligned_p % __pyx_v_alignment);
10208 __pyx_t_1 = ((__pyx_v_offset > 0) != 0);
10218 __pyx_v_aligned_p = (__pyx_v_aligned_p + (__pyx_v_alignment - __pyx_v_offset));
10236 __pyx_r = ((
void *)__pyx_v_aligned_p);
10249 __Pyx_WriteUnraisable(
"View.MemoryView.align_pointer", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 1);
10252 __Pyx_TraceReturn(Py_None, 1);
10265 static int __pyx_memoryview___cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
10266 static int __pyx_memoryview___cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
10267 PyObject *__pyx_v_obj = 0;
10269 int __pyx_v_dtype_is_object;
10270 int __pyx_lineno = 0;
10271 const char *__pyx_filename = NULL;
10272 int __pyx_clineno = 0;
10274 __Pyx_RefNannyDeclarations
10275 __Pyx_RefNannySetupContext(
"__cinit__ (wrapper)", 0);
10277 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_obj,&__pyx_n_s_flags,&__pyx_n_s_dtype_is_object,0};
10278 PyObject* values[3] = {0,0,0};
10279 if (unlikely(__pyx_kwds)) {
10280 Py_ssize_t kw_args;
10281 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
10282 switch (pos_args) {
10283 case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
10284 CYTHON_FALLTHROUGH;
10285 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
10286 CYTHON_FALLTHROUGH;
10287 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
10288 CYTHON_FALLTHROUGH;
10290 default:
goto __pyx_L5_argtuple_error;
10292 kw_args = PyDict_Size(__pyx_kwds);
10293 switch (pos_args) {
10295 if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_obj)) != 0)) kw_args--;
10296 else goto __pyx_L5_argtuple_error;
10297 CYTHON_FALLTHROUGH;
10299 if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_flags)) != 0)) kw_args--;
10301 __Pyx_RaiseArgtupleInvalid(
"__cinit__", 0, 2, 3, 1); __PYX_ERR(1, 345, __pyx_L3_error)
10303 CYTHON_FALLTHROUGH;
10306 PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_dtype_is_object);
10307 if (value) { values[2] = value; kw_args--; }
10310 if (unlikely(kw_args > 0)) {
10311 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args,
"__cinit__") < 0)) __PYX_ERR(1, 345, __pyx_L3_error)
10314 switch (PyTuple_GET_SIZE(__pyx_args)) {
10315 case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
10316 CYTHON_FALLTHROUGH;
10317 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
10318 values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
10320 default:
goto __pyx_L5_argtuple_error;
10323 __pyx_v_obj = values[0];
10324 __pyx_v_flags = __Pyx_PyInt_As_int(values[1]);
if (unlikely((__pyx_v_flags == (
int)-1) && PyErr_Occurred())) __PYX_ERR(1, 345, __pyx_L3_error)
10326 __pyx_v_dtype_is_object = __Pyx_PyObject_IsTrue(values[2]);
if (unlikely((__pyx_v_dtype_is_object == (
int)-1) && PyErr_Occurred())) __PYX_ERR(1, 345, __pyx_L3_error)
10328 __pyx_v_dtype_is_object = ((int)0);
10331 goto __pyx_L4_argument_unpacking_done;
10332 __pyx_L5_argtuple_error:;
10333 __Pyx_RaiseArgtupleInvalid(
"__cinit__", 0, 2, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(1, 345, __pyx_L3_error)
10335 __Pyx_AddTraceback(
"View.MemoryView.memoryview.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
10336 __Pyx_RefNannyFinishContext();
10338 __pyx_L4_argument_unpacking_done:;
10339 __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);
10342 __Pyx_RefNannyFinishContext();
10346 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) {
10348 __Pyx_TraceDeclarations
10349 __Pyx_RefNannyDeclarations
10354 int __pyx_lineno = 0;
10355 const char *__pyx_filename = NULL;
10356 int __pyx_clineno = 0;
10357 __Pyx_RefNannySetupContext(
"__cinit__", 0);
10358 __Pyx_TraceCall(
"__cinit__", __pyx_f[1], 345, 0, __PYX_ERR(1, 345, __pyx_L1_error));
10367 __Pyx_INCREF(__pyx_v_obj);
10368 __Pyx_GIVEREF(__pyx_v_obj);
10369 __Pyx_GOTREF(__pyx_v_self->obj);
10370 __Pyx_DECREF(__pyx_v_self->obj);
10371 __pyx_v_self->obj = __pyx_v_obj;
10380 __pyx_v_self->flags = __pyx_v_flags;
10389 __pyx_t_2 = (((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))) == ((PyObject *)__pyx_memoryview_type));
10390 __pyx_t_3 = (__pyx_t_2 != 0);
10393 __pyx_t_1 = __pyx_t_3;
10394 goto __pyx_L4_bool_binop_done;
10396 __pyx_t_3 = (__pyx_v_obj != Py_None);
10397 __pyx_t_2 = (__pyx_t_3 != 0);
10398 __pyx_t_1 = __pyx_t_2;
10399 __pyx_L4_bool_binop_done:;
10409 __pyx_t_4 = __Pyx_GetBuffer(__pyx_v_obj, (&__pyx_v_self->view), __pyx_v_flags);
if (unlikely(__pyx_t_4 == ((
int)-1))) __PYX_ERR(1, 349, __pyx_L1_error)
10418 __pyx_t_1 = ((((PyObject *)__pyx_v_self->view.obj) == NULL) != 0);
10428 ((Py_buffer *)(&__pyx_v_self->view))->obj = Py_None;
10437 Py_INCREF(Py_None);
10464 __pyx_t_1 = ((__pyx_memoryview_thread_locks_used < 8) != 0);
10474 __pyx_v_self->lock = (__pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used]);
10483 __pyx_memoryview_thread_locks_used = (__pyx_memoryview_thread_locks_used + 1);
10501 __pyx_t_1 = ((__pyx_v_self->lock == NULL) != 0);
10511 __pyx_v_self->lock = PyThread_allocate_lock();
10520 __pyx_t_1 = ((__pyx_v_self->lock == NULL) != 0);
10521 if (unlikely(__pyx_t_1)) {
10530 PyErr_NoMemory(); __PYX_ERR(1, 361, __pyx_L1_error)
10557 __pyx_t_1 = ((__pyx_v_flags & PyBUF_FORMAT) != 0);
10567 __pyx_t_2 = (((__pyx_v_self->view.format[0]) ==
'O') != 0);
10570 __pyx_t_1 = __pyx_t_2;
10571 goto __pyx_L11_bool_binop_done;
10573 __pyx_t_2 = (((__pyx_v_self->view.format[1]) ==
'\x00') != 0);
10574 __pyx_t_1 = __pyx_t_2;
10575 __pyx_L11_bool_binop_done:;
10576 __pyx_v_self->dtype_is_object = __pyx_t_1;
10596 __pyx_v_self->dtype_is_object = __pyx_v_dtype_is_object;
10607 __pyx_v_self->acquisition_count_aligned_p = ((__pyx_atomic_int *)__pyx_align_pointer(((
void *)(&(__pyx_v_self->acquisition_count[0]))), (
sizeof(__pyx_atomic_int))));
10616 __pyx_v_self->typeinfo = NULL;
10630 __Pyx_AddTraceback(
"View.MemoryView.memoryview.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
10633 __Pyx_TraceReturn(Py_None, 0);
10634 __Pyx_RefNannyFinishContext();
10647 static void __pyx_memoryview___dealloc__(PyObject *__pyx_v_self);
10648 static void __pyx_memoryview___dealloc__(PyObject *__pyx_v_self) {
10649 __Pyx_RefNannyDeclarations
10650 __Pyx_RefNannySetupContext(
"__dealloc__ (wrapper)", 0);
10651 __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_2__dealloc__(((
struct __pyx_memoryview_obj *)__pyx_v_self));
10654 __Pyx_RefNannyFinishContext();
10657 static void __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_2__dealloc__(
struct __pyx_memoryview_obj *__pyx_v_self) {
10659 __Pyx_TraceDeclarations
10660 __Pyx_RefNannyDeclarations
10666 PyThread_type_lock __pyx_t_6;
10667 PyThread_type_lock __pyx_t_7;
10668 int __pyx_lineno = 0;
10669 const char *__pyx_filename = NULL;
10670 int __pyx_clineno = 0;
10671 __Pyx_RefNannySetupContext(
"__dealloc__", 0);
10672 __Pyx_TraceCall(
"__dealloc__", __pyx_f[1], 372, 0, __PYX_ERR(1, 372, __pyx_L1_error));
10681 __pyx_t_1 = (__pyx_v_self->obj != Py_None);
10682 __pyx_t_2 = (__pyx_t_1 != 0);
10692 __Pyx_ReleaseBuffer((&__pyx_v_self->view));
10711 __pyx_t_2 = ((((Py_buffer *)(&__pyx_v_self->view))->obj == Py_None) != 0);
10721 ((Py_buffer *)(&__pyx_v_self->view))->obj = NULL;
10730 Py_DECREF(Py_None);
10749 __pyx_t_2 = ((__pyx_v_self->lock != NULL) != 0);
10759 __pyx_t_3 = __pyx_memoryview_thread_locks_used;
10760 __pyx_t_4 = __pyx_t_3;
10761 for (__pyx_t_5 = 0; __pyx_t_5 < __pyx_t_4; __pyx_t_5+=1) {
10762 __pyx_v_i = __pyx_t_5;
10771 __pyx_t_2 = (((__pyx_memoryview_thread_locks[__pyx_v_i]) == __pyx_v_self->lock) != 0);
10781 __pyx_memoryview_thread_locks_used = (__pyx_memoryview_thread_locks_used - 1);
10790 __pyx_t_2 = ((__pyx_v_i != __pyx_memoryview_thread_locks_used) != 0);
10800 __pyx_t_6 = (__pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used]);
10801 __pyx_t_7 = (__pyx_memoryview_thread_locks[__pyx_v_i]);
10810 (__pyx_memoryview_thread_locks[__pyx_v_i]) = __pyx_t_6;
10811 (__pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used]) = __pyx_t_7;
10829 goto __pyx_L6_break;
10849 PyThread_free_lock(__pyx_v_self->lock);
10873 __Pyx_WriteUnraisable(
"View.MemoryView.memoryview.__dealloc__", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
10875 __Pyx_TraceReturn(Py_None, 0);
10876 __Pyx_RefNannyFinishContext();
10887 static char *__pyx_memoryview_get_item_pointer(
struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index) {
10888 Py_ssize_t __pyx_v_dim;
10889 char *__pyx_v_itemp;
10890 PyObject *__pyx_v_idx = NULL;
10892 __Pyx_TraceDeclarations
10893 __Pyx_RefNannyDeclarations
10894 Py_ssize_t __pyx_t_1;
10895 PyObject *__pyx_t_2 = NULL;
10896 Py_ssize_t __pyx_t_3;
10897 PyObject *(*__pyx_t_4)(PyObject *);
10898 PyObject *__pyx_t_5 = NULL;
10899 Py_ssize_t __pyx_t_6;
10901 int __pyx_lineno = 0;
10902 const char *__pyx_filename = NULL;
10903 int __pyx_clineno = 0;
10904 __Pyx_RefNannySetupContext(
"get_item_pointer", 0);
10905 __Pyx_TraceCall(
"get_item_pointer", __pyx_f[1], 393, 0, __PYX_ERR(1, 393, __pyx_L1_error));
10914 __pyx_v_itemp = ((
char *)__pyx_v_self->view.buf);
10924 if (likely(PyList_CheckExact(__pyx_v_index)) || PyTuple_CheckExact(__pyx_v_index)) {
10925 __pyx_t_2 = __pyx_v_index; __Pyx_INCREF(__pyx_t_2); __pyx_t_3 = 0;
10928 __pyx_t_3 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_v_index);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 397, __pyx_L1_error)
10929 __Pyx_GOTREF(__pyx_t_2);
10930 __pyx_t_4 = Py_TYPE(__pyx_t_2)->tp_iternext;
if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 397, __pyx_L1_error)
10933 if (likely(!__pyx_t_4)) {
10934 if (likely(PyList_CheckExact(__pyx_t_2))) {
10935 if (__pyx_t_3 >= PyList_GET_SIZE(__pyx_t_2))
break;
10936 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
10937 __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(1, 397, __pyx_L1_error)
10939 __pyx_t_5 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++;
if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 397, __pyx_L1_error)
10940 __Pyx_GOTREF(__pyx_t_5);
10943 if (__pyx_t_3 >= PyTuple_GET_SIZE(__pyx_t_2))
break;
10944 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
10945 __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(1, 397, __pyx_L1_error)
10947 __pyx_t_5 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++;
if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 397, __pyx_L1_error)
10948 __Pyx_GOTREF(__pyx_t_5);
10952 __pyx_t_5 = __pyx_t_4(__pyx_t_2);
10953 if (unlikely(!__pyx_t_5)) {
10954 PyObject* exc_type = PyErr_Occurred();
10956 if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
10957 else __PYX_ERR(1, 397, __pyx_L1_error)
10961 __Pyx_GOTREF(__pyx_t_5);
10963 __Pyx_XDECREF_SET(__pyx_v_idx, __pyx_t_5);
10965 __pyx_v_dim = __pyx_t_1;
10966 __pyx_t_1 = (__pyx_t_1 + 1);
10975 __pyx_t_6 = __Pyx_PyIndex_AsSsize_t(__pyx_v_idx);
if (unlikely((__pyx_t_6 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(1, 398, __pyx_L1_error)
10976 __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(1, 398, __pyx_L1_error)
10977 __pyx_v_itemp = __pyx_t_7;
10987 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
10996 __pyx_r = __pyx_v_itemp;
11009 __Pyx_XDECREF(__pyx_t_2);
11010 __Pyx_XDECREF(__pyx_t_5);
11011 __Pyx_AddTraceback(
"View.MemoryView.memoryview.get_item_pointer", __pyx_clineno, __pyx_lineno, __pyx_filename);
11014 __Pyx_XDECREF(__pyx_v_idx);
11015 __Pyx_TraceReturn(Py_None, 0);
11016 __Pyx_RefNannyFinishContext();
11029 static PyObject *__pyx_memoryview___getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_index);
11030 static PyObject *__pyx_memoryview___getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_index) {
11031 PyObject *__pyx_r = 0;
11032 __Pyx_RefNannyDeclarations
11033 __Pyx_RefNannySetupContext(
"__getitem__ (wrapper)", 0);
11034 __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_4__getitem__(((
struct __pyx_memoryview_obj *)__pyx_v_self), ((PyObject *)__pyx_v_index));
11037 __Pyx_RefNannyFinishContext();
11041 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_4__getitem__(
struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index) {
11042 PyObject *__pyx_v_have_slices = NULL;
11043 PyObject *__pyx_v_indices = NULL;
11044 char *__pyx_v_itemp;
11045 PyObject *__pyx_r = NULL;
11046 __Pyx_TraceDeclarations
11047 __Pyx_RefNannyDeclarations
11050 PyObject *__pyx_t_3 = NULL;
11051 PyObject *__pyx_t_4 = NULL;
11052 PyObject *__pyx_t_5 = NULL;
11054 int __pyx_lineno = 0;
11055 const char *__pyx_filename = NULL;
11056 int __pyx_clineno = 0;
11057 __Pyx_RefNannySetupContext(
"__getitem__", 0);
11058 __Pyx_TraceCall(
"__getitem__", __pyx_f[1], 403, 0, __PYX_ERR(1, 403, __pyx_L1_error));
11067 __pyx_t_1 = (__pyx_v_index == __pyx_builtin_Ellipsis);
11068 __pyx_t_2 = (__pyx_t_1 != 0);
11078 __Pyx_XDECREF(__pyx_r);
11079 __Pyx_INCREF(((PyObject *)__pyx_v_self));
11080 __pyx_r = ((PyObject *)__pyx_v_self);
11099 __pyx_t_3 = _unellipsify(__pyx_v_index, __pyx_v_self->view.ndim);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 407, __pyx_L1_error)
11100 __Pyx_GOTREF(__pyx_t_3);
11101 if (likely(__pyx_t_3 != Py_None)) {
11102 PyObject* sequence = __pyx_t_3;
11103 Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
11104 if (unlikely(size != 2)) {
11105 if (size > 2) __Pyx_RaiseTooManyValuesError(2);
11106 else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
11107 __PYX_ERR(1, 407, __pyx_L1_error)
11109 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
11110 __pyx_t_4 = PyTuple_GET_ITEM(sequence, 0);
11111 __pyx_t_5 = PyTuple_GET_ITEM(sequence, 1);
11112 __Pyx_INCREF(__pyx_t_4);
11113 __Pyx_INCREF(__pyx_t_5);
11115 __pyx_t_4 = PySequence_ITEM(sequence, 0);
if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 407, __pyx_L1_error)
11116 __Pyx_GOTREF(__pyx_t_4);
11117 __pyx_t_5 = PySequence_ITEM(sequence, 1);
if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 407, __pyx_L1_error)
11118 __Pyx_GOTREF(__pyx_t_5);
11120 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
11122 __Pyx_RaiseNoneNotIterableError(); __PYX_ERR(1, 407, __pyx_L1_error)
11124 __pyx_v_have_slices = __pyx_t_4;
11126 __pyx_v_indices = __pyx_t_5;
11136 __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_have_slices);
if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(1, 410, __pyx_L1_error)
11146 __Pyx_XDECREF(__pyx_r);
11147 __pyx_t_3 = ((PyObject *)__pyx_memview_slice(__pyx_v_self, __pyx_v_indices));
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 411, __pyx_L1_error)
11148 __Pyx_GOTREF(__pyx_t_3);
11149 __pyx_r = __pyx_t_3;
11170 __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(1, 413, __pyx_L1_error)
11171 __pyx_v_itemp = __pyx_t_6;
11180 __Pyx_XDECREF(__pyx_r);
11181 __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(1, 414, __pyx_L1_error)
11182 __Pyx_GOTREF(__pyx_t_3);
11183 __pyx_r = __pyx_t_3;
11198 __Pyx_XDECREF(__pyx_t_3);
11199 __Pyx_XDECREF(__pyx_t_4);
11200 __Pyx_XDECREF(__pyx_t_5);
11201 __Pyx_AddTraceback(
"View.MemoryView.memoryview.__getitem__", __pyx_clineno, __pyx_lineno, __pyx_filename);
11204 __Pyx_XDECREF(__pyx_v_have_slices);
11205 __Pyx_XDECREF(__pyx_v_indices);
11206 __Pyx_XGIVEREF(__pyx_r);
11207 __Pyx_TraceReturn(__pyx_r, 0);
11208 __Pyx_RefNannyFinishContext();
11221 static int __pyx_memoryview___setitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_index, PyObject *__pyx_v_value);
11222 static int __pyx_memoryview___setitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_index, PyObject *__pyx_v_value) {
11224 __Pyx_RefNannyDeclarations
11225 __Pyx_RefNannySetupContext(
"__setitem__ (wrapper)", 0);
11226 __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));
11229 __Pyx_RefNannyFinishContext();
11233 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) {
11234 PyObject *__pyx_v_have_slices = NULL;
11235 PyObject *__pyx_v_obj = NULL;
11237 __Pyx_TraceDeclarations
11238 __Pyx_RefNannyDeclarations
11240 PyObject *__pyx_t_2 = NULL;
11241 PyObject *__pyx_t_3 = NULL;
11242 PyObject *__pyx_t_4 = NULL;
11243 int __pyx_lineno = 0;
11244 const char *__pyx_filename = NULL;
11245 int __pyx_clineno = 0;
11246 __Pyx_RefNannySetupContext(
"__setitem__", 0);
11247 __Pyx_TraceCall(
"__setitem__", __pyx_f[1], 416, 0, __PYX_ERR(1, 416, __pyx_L1_error));
11248 __Pyx_INCREF(__pyx_v_index);
11257 __pyx_t_1 = (__pyx_v_self->view.readonly != 0);
11258 if (unlikely(__pyx_t_1)) {
11267 __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__25, NULL);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 418, __pyx_L1_error)
11268 __Pyx_GOTREF(__pyx_t_2);
11269 __Pyx_Raise(__pyx_t_2, 0, 0, 0);
11270 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
11271 __PYX_ERR(1, 418, __pyx_L1_error)
11289 __pyx_t_2 = _unellipsify(__pyx_v_index, __pyx_v_self->view.ndim);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 420, __pyx_L1_error)
11290 __Pyx_GOTREF(__pyx_t_2);
11291 if (likely(__pyx_t_2 != Py_None)) {
11292 PyObject* sequence = __pyx_t_2;
11293 Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
11294 if (unlikely(size != 2)) {
11295 if (size > 2) __Pyx_RaiseTooManyValuesError(2);
11296 else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
11297 __PYX_ERR(1, 420, __pyx_L1_error)
11299 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
11300 __pyx_t_3 = PyTuple_GET_ITEM(sequence, 0);
11301 __pyx_t_4 = PyTuple_GET_ITEM(sequence, 1);
11302 __Pyx_INCREF(__pyx_t_3);
11303 __Pyx_INCREF(__pyx_t_4);
11305 __pyx_t_3 = PySequence_ITEM(sequence, 0);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 420, __pyx_L1_error)
11306 __Pyx_GOTREF(__pyx_t_3);
11307 __pyx_t_4 = PySequence_ITEM(sequence, 1);
if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 420, __pyx_L1_error)
11308 __Pyx_GOTREF(__pyx_t_4);
11310 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
11312 __Pyx_RaiseNoneNotIterableError(); __PYX_ERR(1, 420, __pyx_L1_error)
11314 __pyx_v_have_slices = __pyx_t_3;
11316 __Pyx_DECREF_SET(__pyx_v_index, __pyx_t_4);
11326 __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_have_slices);
if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(1, 422, __pyx_L1_error)
11336 __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(1, 423, __pyx_L1_error)
11337 __Pyx_GOTREF(__pyx_t_2);
11338 __pyx_v_obj = __pyx_t_2;
11348 __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_obj);
if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(1, 424, __pyx_L1_error)
11358 __pyx_t_2 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_self), __pyx_v_index);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 425, __pyx_L1_error)
11359 __Pyx_GOTREF(__pyx_t_2);
11360 __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(1, 425, __pyx_L1_error)
11361 __Pyx_GOTREF(__pyx_t_4);
11362 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
11363 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
11383 __pyx_t_4 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_self), __pyx_v_index);
if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 427, __pyx_L1_error)
11384 __Pyx_GOTREF(__pyx_t_4);
11385 if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_memoryview_type))))) __PYX_ERR(1, 427, __pyx_L1_error)
11386 __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(1, 427, __pyx_L1_error)
11387 __Pyx_GOTREF(__pyx_t_2);
11388 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
11389 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
11411 __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(1, 429, __pyx_L1_error)
11412 __Pyx_GOTREF(__pyx_t_2);
11413 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
11429 __Pyx_XDECREF(__pyx_t_2);
11430 __Pyx_XDECREF(__pyx_t_3);
11431 __Pyx_XDECREF(__pyx_t_4);
11432 __Pyx_AddTraceback(
"View.MemoryView.memoryview.__setitem__", __pyx_clineno, __pyx_lineno, __pyx_filename);
11435 __Pyx_XDECREF(__pyx_v_have_slices);
11436 __Pyx_XDECREF(__pyx_v_obj);
11437 __Pyx_XDECREF(__pyx_v_index);
11438 __Pyx_TraceReturn(Py_None, 0);
11439 __Pyx_RefNannyFinishContext();
11451 static PyObject *__pyx_memoryview_is_slice(
struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_obj) {
11452 PyObject *__pyx_r = NULL;
11453 __Pyx_TraceDeclarations
11454 __Pyx_RefNannyDeclarations
11457 PyObject *__pyx_t_3 = NULL;
11458 PyObject *__pyx_t_4 = NULL;
11459 PyObject *__pyx_t_5 = NULL;
11460 PyObject *__pyx_t_6 = NULL;
11461 PyObject *__pyx_t_7 = NULL;
11462 PyObject *__pyx_t_8 = NULL;
11464 int __pyx_lineno = 0;
11465 const char *__pyx_filename = NULL;
11466 int __pyx_clineno = 0;
11467 __Pyx_RefNannySetupContext(
"is_slice", 0);
11468 __Pyx_TraceCall(
"is_slice", __pyx_f[1], 431, 0, __PYX_ERR(1, 431, __pyx_L1_error));
11469 __Pyx_INCREF(__pyx_v_obj);
11478 __pyx_t_1 = __Pyx_TypeCheck(__pyx_v_obj, __pyx_memoryview_type);
11479 __pyx_t_2 = ((!(__pyx_t_1 != 0)) != 0);
11490 __Pyx_PyThreadState_declare
11491 __Pyx_PyThreadState_assign
11492 __Pyx_ExceptionSave(&__pyx_t_3, &__pyx_t_4, &__pyx_t_5);
11493 __Pyx_XGOTREF(__pyx_t_3);
11494 __Pyx_XGOTREF(__pyx_t_4);
11495 __Pyx_XGOTREF(__pyx_t_5);
11505 __pyx_t_6 = __Pyx_PyInt_From_int(((__pyx_v_self->flags & (~PyBUF_WRITABLE)) | PyBUF_ANY_CONTIGUOUS));
if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 434, __pyx_L4_error)
11506 __Pyx_GOTREF(__pyx_t_6);
11515 __pyx_t_7 = __Pyx_PyBool_FromLong(__pyx_v_self->dtype_is_object);
if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 435, __pyx_L4_error)
11516 __Pyx_GOTREF(__pyx_t_7);
11525 __pyx_t_8 = PyTuple_New(3);
if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 434, __pyx_L4_error)
11526 __Pyx_GOTREF(__pyx_t_8);
11527 __Pyx_INCREF(__pyx_v_obj);
11528 __Pyx_GIVEREF(__pyx_v_obj);
11529 PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_v_obj);
11530 __Pyx_GIVEREF(__pyx_t_6);
11531 PyTuple_SET_ITEM(__pyx_t_8, 1, __pyx_t_6);
11532 __Pyx_GIVEREF(__pyx_t_7);
11533 PyTuple_SET_ITEM(__pyx_t_8, 2, __pyx_t_7);
11536 __pyx_t_7 = __Pyx_PyObject_Call(((PyObject *)__pyx_memoryview_type), __pyx_t_8, NULL);
if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 434, __pyx_L4_error)
11537 __Pyx_GOTREF(__pyx_t_7);
11538 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
11539 __Pyx_DECREF_SET(__pyx_v_obj, __pyx_t_7);
11550 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
11551 __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
11552 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
11553 goto __pyx_L9_try_end;
11555 __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
11556 __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
11557 __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
11566 __pyx_t_9 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_TypeError);
11568 __Pyx_AddTraceback(
"View.MemoryView.memoryview.is_slice", __pyx_clineno, __pyx_lineno, __pyx_filename);
11569 if (__Pyx_GetException(&__pyx_t_7, &__pyx_t_8, &__pyx_t_6) < 0) __PYX_ERR(1, 436, __pyx_L6_except_error)
11570 __Pyx_GOTREF(__pyx_t_7);
11571 __Pyx_GOTREF(__pyx_t_8);
11572 __Pyx_GOTREF(__pyx_t_6);
11581 __Pyx_XDECREF(__pyx_r);
11582 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
11583 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
11584 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
11585 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
11586 goto __pyx_L7_except_return;
11588 goto __pyx_L6_except_error;
11589 __pyx_L6_except_error:;
11598 __Pyx_XGIVEREF(__pyx_t_3);
11599 __Pyx_XGIVEREF(__pyx_t_4);
11600 __Pyx_XGIVEREF(__pyx_t_5);
11601 __Pyx_ExceptionReset(__pyx_t_3, __pyx_t_4, __pyx_t_5);
11602 goto __pyx_L1_error;
11603 __pyx_L7_except_return:;
11604 __Pyx_XGIVEREF(__pyx_t_3);
11605 __Pyx_XGIVEREF(__pyx_t_4);
11606 __Pyx_XGIVEREF(__pyx_t_5);
11607 __Pyx_ExceptionReset(__pyx_t_3, __pyx_t_4, __pyx_t_5);
11628 __Pyx_XDECREF(__pyx_r);
11629 __Pyx_INCREF(__pyx_v_obj);
11630 __pyx_r = __pyx_v_obj;
11643 __Pyx_XDECREF(__pyx_t_6);
11644 __Pyx_XDECREF(__pyx_t_7);
11645 __Pyx_XDECREF(__pyx_t_8);
11646 __Pyx_AddTraceback(
"View.MemoryView.memoryview.is_slice", __pyx_clineno, __pyx_lineno, __pyx_filename);
11649 __Pyx_XDECREF(__pyx_v_obj);
11650 __Pyx_XGIVEREF(__pyx_r);
11651 __Pyx_TraceReturn(__pyx_r, 0);
11652 __Pyx_RefNannyFinishContext();
11664 static PyObject *__pyx_memoryview_setitem_slice_assignment(
struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_dst, PyObject *__pyx_v_src) {
11665 __Pyx_memviewslice __pyx_v_dst_slice;
11666 __Pyx_memviewslice __pyx_v_src_slice;
11667 PyObject *__pyx_r = NULL;
11668 __Pyx_TraceDeclarations
11669 __Pyx_RefNannyDeclarations
11670 __Pyx_memviewslice *__pyx_t_1;
11671 __Pyx_memviewslice *__pyx_t_2;
11672 PyObject *__pyx_t_3 = NULL;
11676 int __pyx_lineno = 0;
11677 const char *__pyx_filename = NULL;
11678 int __pyx_clineno = 0;
11679 __Pyx_RefNannySetupContext(
"setitem_slice_assignment", 0);
11680 __Pyx_TraceCall(
"setitem_slice_assignment", __pyx_f[1], 441, 0, __PYX_ERR(1, 441, __pyx_L1_error));
11689 if (!(likely(((__pyx_v_src) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_src, __pyx_memoryview_type))))) __PYX_ERR(1, 445, __pyx_L1_error)
11690 __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(1, 445, __pyx_L1_error)
11699 if (!(likely(((__pyx_v_dst) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_dst, __pyx_memoryview_type))))) __PYX_ERR(1, 446, __pyx_L1_error)
11700 __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(1, 446, __pyx_L1_error)
11709 __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_src, __pyx_n_s_ndim);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 447, __pyx_L1_error)
11710 __Pyx_GOTREF(__pyx_t_3);
11711 __pyx_t_4 = __Pyx_PyInt_As_int(__pyx_t_3);
if (unlikely((__pyx_t_4 == (
int)-1) && PyErr_Occurred())) __PYX_ERR(1, 447, __pyx_L1_error)
11712 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
11713 __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_dst, __pyx_n_s_ndim);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 447, __pyx_L1_error)
11714 __Pyx_GOTREF(__pyx_t_3);
11715 __pyx_t_5 = __Pyx_PyInt_As_int(__pyx_t_3);
if (unlikely((__pyx_t_5 == (
int)-1) && PyErr_Occurred())) __PYX_ERR(1, 447, __pyx_L1_error)
11716 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
11725 __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(1, 445, __pyx_L1_error)
11736 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
11739 __Pyx_XDECREF(__pyx_t_3);
11740 __Pyx_AddTraceback(
"View.MemoryView.memoryview.setitem_slice_assignment", __pyx_clineno, __pyx_lineno, __pyx_filename);
11743 __Pyx_XGIVEREF(__pyx_r);
11744 __Pyx_TraceReturn(__pyx_r, 0);
11745 __Pyx_RefNannyFinishContext();
11757 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) {
11758 int __pyx_v_array[0x80];
11760 void *__pyx_v_item;
11761 __Pyx_memviewslice *__pyx_v_dst_slice;
11762 __Pyx_memviewslice __pyx_v_tmp_slice;
11763 PyObject *__pyx_r = NULL;
11764 __Pyx_TraceDeclarations
11765 __Pyx_RefNannyDeclarations
11766 __Pyx_memviewslice *__pyx_t_1;
11768 PyObject *__pyx_t_3 = NULL;
11771 char const *__pyx_t_6;
11772 PyObject *__pyx_t_7 = NULL;
11773 PyObject *__pyx_t_8 = NULL;
11774 PyObject *__pyx_t_9 = NULL;
11775 PyObject *__pyx_t_10 = NULL;
11776 PyObject *__pyx_t_11 = NULL;
11777 PyObject *__pyx_t_12 = NULL;
11778 int __pyx_lineno = 0;
11779 const char *__pyx_filename = NULL;
11780 int __pyx_clineno = 0;
11781 __Pyx_RefNannySetupContext(
"setitem_slice_assign_scalar", 0);
11782 __Pyx_TraceCall(
"setitem_slice_assign_scalar", __pyx_f[1], 449, 0, __PYX_ERR(1, 449, __pyx_L1_error));
11791 __pyx_v_tmp = NULL;
11800 __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(1, 456, __pyx_L1_error)
11801 __pyx_v_dst_slice = __pyx_t_1;
11810 __pyx_t_2 = ((((size_t)__pyx_v_self->view.itemsize) > (
sizeof(__pyx_v_array))) != 0);
11820 __pyx_v_tmp = PyMem_Malloc(__pyx_v_self->view.itemsize);
11829 __pyx_t_2 = ((__pyx_v_tmp == NULL) != 0);
11830 if (unlikely(__pyx_t_2)) {
11839 PyErr_NoMemory(); __PYX_ERR(1, 461, __pyx_L1_error)
11857 __pyx_v_item = __pyx_v_tmp;
11877 __pyx_v_item = ((
void *)__pyx_v_array);
11897 __pyx_t_2 = (__pyx_v_self->dtype_is_object != 0);
11907 (((PyObject **)__pyx_v_item)[0]) = ((PyObject *)__pyx_v_value);
11927 __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(1, 470, __pyx_L6_error)
11928 __Pyx_GOTREF(__pyx_t_3);
11929 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
11940 __pyx_t_2 = ((__pyx_v_self->view.suboffsets != NULL) != 0);
11950 __pyx_t_3 = assert_direct_dimensions(__pyx_v_self->view.suboffsets, __pyx_v_self->view.ndim);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 475, __pyx_L6_error)
11951 __Pyx_GOTREF(__pyx_t_3);
11952 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
11970 __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);
11982 PyMem_Free(__pyx_v_tmp);
11987 __Pyx_PyThreadState_declare
11988 __Pyx_PyThreadState_assign
11989 __pyx_t_7 = 0; __pyx_t_8 = 0; __pyx_t_9 = 0; __pyx_t_10 = 0; __pyx_t_11 = 0; __pyx_t_12 = 0;
11990 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
11991 if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_10, &__pyx_t_11, &__pyx_t_12);
11992 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);
11993 __Pyx_XGOTREF(__pyx_t_7);
11994 __Pyx_XGOTREF(__pyx_t_8);
11995 __Pyx_XGOTREF(__pyx_t_9);
11996 __Pyx_XGOTREF(__pyx_t_10);
11997 __Pyx_XGOTREF(__pyx_t_11);
11998 __Pyx_XGOTREF(__pyx_t_12);
11999 __pyx_t_4 = __pyx_lineno; __pyx_t_5 = __pyx_clineno; __pyx_t_6 = __pyx_filename;
12001 PyMem_Free(__pyx_v_tmp);
12003 if (PY_MAJOR_VERSION >= 3) {
12004 __Pyx_XGIVEREF(__pyx_t_10);
12005 __Pyx_XGIVEREF(__pyx_t_11);
12006 __Pyx_XGIVEREF(__pyx_t_12);
12007 __Pyx_ExceptionReset(__pyx_t_10, __pyx_t_11, __pyx_t_12);
12009 __Pyx_XGIVEREF(__pyx_t_7);
12010 __Pyx_XGIVEREF(__pyx_t_8);
12011 __Pyx_XGIVEREF(__pyx_t_9);
12012 __Pyx_ErrRestore(__pyx_t_7, __pyx_t_8, __pyx_t_9);
12013 __pyx_t_7 = 0; __pyx_t_8 = 0; __pyx_t_9 = 0; __pyx_t_10 = 0; __pyx_t_11 = 0; __pyx_t_12 = 0;
12014 __pyx_lineno = __pyx_t_4; __pyx_clineno = __pyx_t_5; __pyx_filename = __pyx_t_6;
12015 goto __pyx_L1_error;
12029 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
12032 __Pyx_XDECREF(__pyx_t_3);
12033 __Pyx_AddTraceback(
"View.MemoryView.memoryview.setitem_slice_assign_scalar", __pyx_clineno, __pyx_lineno, __pyx_filename);
12036 __Pyx_XGIVEREF(__pyx_r);
12037 __Pyx_TraceReturn(__pyx_r, 0);
12038 __Pyx_RefNannyFinishContext();
12050 static PyObject *__pyx_memoryview_setitem_indexed(
struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index, PyObject *__pyx_v_value) {
12051 char *__pyx_v_itemp;
12052 PyObject *__pyx_r = NULL;
12053 __Pyx_TraceDeclarations
12054 __Pyx_RefNannyDeclarations
12056 PyObject *__pyx_t_2 = NULL;
12057 int __pyx_lineno = 0;
12058 const char *__pyx_filename = NULL;
12059 int __pyx_clineno = 0;
12060 __Pyx_RefNannySetupContext(
"setitem_indexed", 0);
12061 __Pyx_TraceCall(
"setitem_indexed", __pyx_f[1], 481, 0, __PYX_ERR(1, 481, __pyx_L1_error));
12070 __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(1, 482, __pyx_L1_error)
12071 __pyx_v_itemp = __pyx_t_1;
12080 __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(1, 483, __pyx_L1_error)
12081 __Pyx_GOTREF(__pyx_t_2);
12082 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
12093 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
12096 __Pyx_XDECREF(__pyx_t_2);
12097 __Pyx_AddTraceback(
"View.MemoryView.memoryview.setitem_indexed", __pyx_clineno, __pyx_lineno, __pyx_filename);
12100 __Pyx_XGIVEREF(__pyx_r);
12101 __Pyx_TraceReturn(__pyx_r, 0);
12102 __Pyx_RefNannyFinishContext();
12114 static PyObject *__pyx_memoryview_convert_item_to_object(
struct __pyx_memoryview_obj *__pyx_v_self,
char *__pyx_v_itemp) {
12115 PyObject *__pyx_v_struct = NULL;
12116 PyObject *__pyx_v_bytesitem = 0;
12117 PyObject *__pyx_v_result = NULL;
12118 PyObject *__pyx_r = NULL;
12119 __Pyx_TraceDeclarations
12120 __Pyx_RefNannyDeclarations
12121 PyObject *__pyx_t_1 = NULL;
12122 PyObject *__pyx_t_2 = NULL;
12123 PyObject *__pyx_t_3 = NULL;
12124 PyObject *__pyx_t_4 = NULL;
12125 PyObject *__pyx_t_5 = NULL;
12126 PyObject *__pyx_t_6 = NULL;
12127 PyObject *__pyx_t_7 = NULL;
12129 PyObject *__pyx_t_9 = NULL;
12132 int __pyx_lineno = 0;
12133 const char *__pyx_filename = NULL;
12134 int __pyx_clineno = 0;
12135 __Pyx_RefNannySetupContext(
"convert_item_to_object", 0);
12136 __Pyx_TraceCall(
"convert_item_to_object", __pyx_f[1], 485, 0, __PYX_ERR(1, 485, __pyx_L1_error));
12145 __pyx_t_1 = __Pyx_Import(__pyx_n_s_struct, 0, 0);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 488, __pyx_L1_error)
12146 __Pyx_GOTREF(__pyx_t_1);
12147 __pyx_v_struct = __pyx_t_1;
12157 __pyx_t_1 = __Pyx_PyBytes_FromStringAndSize(__pyx_v_itemp + 0, __pyx_v_self->view.itemsize - 0);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 491, __pyx_L1_error)
12158 __Pyx_GOTREF(__pyx_t_1);
12159 __pyx_v_bytesitem = ((PyObject*)__pyx_t_1);
12170 __Pyx_PyThreadState_declare
12171 __Pyx_PyThreadState_assign
12172 __Pyx_ExceptionSave(&__pyx_t_2, &__pyx_t_3, &__pyx_t_4);
12173 __Pyx_XGOTREF(__pyx_t_2);
12174 __Pyx_XGOTREF(__pyx_t_3);
12175 __Pyx_XGOTREF(__pyx_t_4);
12185 __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_struct, __pyx_n_s_unpack);
if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 493, __pyx_L3_error)
12186 __Pyx_GOTREF(__pyx_t_5);
12187 __pyx_t_6 = __Pyx_PyBytes_FromString(__pyx_v_self->view.format);
if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 493, __pyx_L3_error)
12188 __Pyx_GOTREF(__pyx_t_6);
12191 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) {
12192 __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_5);
12193 if (likely(__pyx_t_7)) {
12194 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_5);
12195 __Pyx_INCREF(__pyx_t_7);
12196 __Pyx_INCREF(
function);
12197 __Pyx_DECREF_SET(__pyx_t_5,
function);
12201 #if CYTHON_FAST_PYCALL
12202 if (PyFunction_Check(__pyx_t_5)) {
12203 PyObject *__pyx_temp[3] = {__pyx_t_7, __pyx_t_6, __pyx_v_bytesitem};
12204 __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(1, 493, __pyx_L3_error)
12205 __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
12206 __Pyx_GOTREF(__pyx_t_1);
12207 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
12210 #if CYTHON_FAST_PYCCALL
12211 if (__Pyx_PyFastCFunction_Check(__pyx_t_5)) {
12212 PyObject *__pyx_temp[3] = {__pyx_t_7, __pyx_t_6, __pyx_v_bytesitem};
12213 __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(1, 493, __pyx_L3_error)
12214 __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
12215 __Pyx_GOTREF(__pyx_t_1);
12216 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
12220 __pyx_t_9 = PyTuple_New(2+__pyx_t_8);
if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 493, __pyx_L3_error)
12221 __Pyx_GOTREF(__pyx_t_9);
12223 __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_7); __pyx_t_7 = NULL;
12225 __Pyx_GIVEREF(__pyx_t_6);
12226 PyTuple_SET_ITEM(__pyx_t_9, 0+__pyx_t_8, __pyx_t_6);
12227 __Pyx_INCREF(__pyx_v_bytesitem);
12228 __Pyx_GIVEREF(__pyx_v_bytesitem);
12229 PyTuple_SET_ITEM(__pyx_t_9, 1+__pyx_t_8, __pyx_v_bytesitem);
12231 __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_9, NULL);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 493, __pyx_L3_error)
12232 __Pyx_GOTREF(__pyx_t_1);
12233 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
12235 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
12236 __pyx_v_result = __pyx_t_1;
12256 __pyx_t_10 = strlen(__pyx_v_self->view.format);
12257 __pyx_t_11 = ((__pyx_t_10 == 1) != 0);
12267 __Pyx_XDECREF(__pyx_r);
12268 __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_result, 0,
long, 1, __Pyx_PyInt_From_long, 0, 0, 0);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 498, __pyx_L5_except_error)
12269 __Pyx_GOTREF(__pyx_t_1);
12270 __pyx_r = __pyx_t_1;
12272 goto __pyx_L6_except_return;
12290 __Pyx_XDECREF(__pyx_r);
12291 __Pyx_INCREF(__pyx_v_result);
12292 __pyx_r = __pyx_v_result;
12293 goto __pyx_L6_except_return;
12296 __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
12297 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
12298 __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
12299 __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
12300 __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
12309 __Pyx_ErrFetch(&__pyx_t_1, &__pyx_t_5, &__pyx_t_9);
12310 __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_struct, __pyx_n_s_error);
if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 494, __pyx_L5_except_error)
12311 __Pyx_GOTREF(__pyx_t_6);
12312 __pyx_t_8 = __Pyx_PyErr_GivenExceptionMatches(__pyx_t_1, __pyx_t_6);
12313 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
12314 __Pyx_ErrRestore(__pyx_t_1, __pyx_t_5, __pyx_t_9);
12315 __pyx_t_1 = 0; __pyx_t_5 = 0; __pyx_t_9 = 0;
12317 __Pyx_AddTraceback(
"View.MemoryView.memoryview.convert_item_to_object", __pyx_clineno, __pyx_lineno, __pyx_filename);
12318 if (__Pyx_GetException(&__pyx_t_9, &__pyx_t_5, &__pyx_t_1) < 0) __PYX_ERR(1, 494, __pyx_L5_except_error)
12319 __Pyx_GOTREF(__pyx_t_9);
12320 __Pyx_GOTREF(__pyx_t_5);
12321 __Pyx_GOTREF(__pyx_t_1);
12330 __pyx_t_6 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__26, NULL);
if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 495, __pyx_L5_except_error)
12331 __Pyx_GOTREF(__pyx_t_6);
12332 __Pyx_Raise(__pyx_t_6, 0, 0, 0);
12333 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
12334 __PYX_ERR(1, 495, __pyx_L5_except_error)
12336 goto __pyx_L5_except_error;
12337 __pyx_L5_except_error:;
12346 __Pyx_XGIVEREF(__pyx_t_2);
12347 __Pyx_XGIVEREF(__pyx_t_3);
12348 __Pyx_XGIVEREF(__pyx_t_4);
12349 __Pyx_ExceptionReset(__pyx_t_2, __pyx_t_3, __pyx_t_4);
12350 goto __pyx_L1_error;
12351 __pyx_L6_except_return:;
12352 __Pyx_XGIVEREF(__pyx_t_2);
12353 __Pyx_XGIVEREF(__pyx_t_3);
12354 __Pyx_XGIVEREF(__pyx_t_4);
12355 __Pyx_ExceptionReset(__pyx_t_2, __pyx_t_3, __pyx_t_4);
12369 __Pyx_XDECREF(__pyx_t_1);
12370 __Pyx_XDECREF(__pyx_t_5);
12371 __Pyx_XDECREF(__pyx_t_6);
12372 __Pyx_XDECREF(__pyx_t_7);
12373 __Pyx_XDECREF(__pyx_t_9);
12374 __Pyx_AddTraceback(
"View.MemoryView.memoryview.convert_item_to_object", __pyx_clineno, __pyx_lineno, __pyx_filename);
12377 __Pyx_XDECREF(__pyx_v_struct);
12378 __Pyx_XDECREF(__pyx_v_bytesitem);
12379 __Pyx_XDECREF(__pyx_v_result);
12380 __Pyx_XGIVEREF(__pyx_r);
12381 __Pyx_TraceReturn(__pyx_r, 0);
12382 __Pyx_RefNannyFinishContext();
12394 static PyObject *__pyx_memoryview_assign_item_from_object(
struct __pyx_memoryview_obj *__pyx_v_self,
char *__pyx_v_itemp, PyObject *__pyx_v_value) {
12395 PyObject *__pyx_v_struct = NULL;
12397 PyObject *__pyx_v_bytesvalue = 0;
12398 Py_ssize_t __pyx_v_i;
12399 PyObject *__pyx_r = NULL;
12400 __Pyx_TraceDeclarations
12401 __Pyx_RefNannyDeclarations
12402 PyObject *__pyx_t_1 = NULL;
12405 PyObject *__pyx_t_4 = NULL;
12406 PyObject *__pyx_t_5 = NULL;
12407 PyObject *__pyx_t_6 = NULL;
12409 PyObject *__pyx_t_8 = NULL;
12410 Py_ssize_t __pyx_t_9;
12411 PyObject *__pyx_t_10 = NULL;
12416 int __pyx_lineno = 0;
12417 const char *__pyx_filename = NULL;
12418 int __pyx_clineno = 0;
12419 __Pyx_RefNannySetupContext(
"assign_item_from_object", 0);
12420 __Pyx_TraceCall(
"assign_item_from_object", __pyx_f[1], 501, 0, __PYX_ERR(1, 501, __pyx_L1_error));
12429 __pyx_t_1 = __Pyx_Import(__pyx_n_s_struct, 0, 0);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 504, __pyx_L1_error)
12430 __Pyx_GOTREF(__pyx_t_1);
12431 __pyx_v_struct = __pyx_t_1;
12441 __pyx_t_2 = PyTuple_Check(__pyx_v_value);
12442 __pyx_t_3 = (__pyx_t_2 != 0);
12452 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_struct, __pyx_n_s_pack);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 510, __pyx_L1_error)
12453 __Pyx_GOTREF(__pyx_t_1);
12454 __pyx_t_4 = __Pyx_PyBytes_FromString(__pyx_v_self->view.format);
if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 510, __pyx_L1_error)
12455 __Pyx_GOTREF(__pyx_t_4);
12456 __pyx_t_5 = PyTuple_New(1);
if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 510, __pyx_L1_error)
12457 __Pyx_GOTREF(__pyx_t_5);
12458 __Pyx_GIVEREF(__pyx_t_4);
12459 PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4);
12461 __pyx_t_4 = __Pyx_PySequence_Tuple(__pyx_v_value);
if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 510, __pyx_L1_error)
12462 __Pyx_GOTREF(__pyx_t_4);
12463 __pyx_t_6 = PyNumber_Add(__pyx_t_5, __pyx_t_4);
if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 510, __pyx_L1_error)
12464 __Pyx_GOTREF(__pyx_t_6);
12465 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
12466 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
12467 __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_6, NULL);
if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 510, __pyx_L1_error)
12468 __Pyx_GOTREF(__pyx_t_4);
12469 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
12470 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
12471 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(1, 510, __pyx_L1_error)
12472 __pyx_v_bytesvalue = ((PyObject*)__pyx_t_4);
12493 __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_struct, __pyx_n_s_pack);
if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 512, __pyx_L1_error)
12494 __Pyx_GOTREF(__pyx_t_6);
12495 __pyx_t_1 = __Pyx_PyBytes_FromString(__pyx_v_self->view.format);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 512, __pyx_L1_error)
12496 __Pyx_GOTREF(__pyx_t_1);
12499 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_6))) {
12500 __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_6);
12501 if (likely(__pyx_t_5)) {
12502 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_6);
12503 __Pyx_INCREF(__pyx_t_5);
12504 __Pyx_INCREF(
function);
12505 __Pyx_DECREF_SET(__pyx_t_6,
function);
12509 #if CYTHON_FAST_PYCALL
12510 if (PyFunction_Check(__pyx_t_6)) {
12511 PyObject *__pyx_temp[3] = {__pyx_t_5, __pyx_t_1, __pyx_v_value};
12512 __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(1, 512, __pyx_L1_error)
12513 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
12514 __Pyx_GOTREF(__pyx_t_4);
12515 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
12518 #if CYTHON_FAST_PYCCALL
12519 if (__Pyx_PyFastCFunction_Check(__pyx_t_6)) {
12520 PyObject *__pyx_temp[3] = {__pyx_t_5, __pyx_t_1, __pyx_v_value};
12521 __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(1, 512, __pyx_L1_error)
12522 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
12523 __Pyx_GOTREF(__pyx_t_4);
12524 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
12528 __pyx_t_8 = PyTuple_New(2+__pyx_t_7);
if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 512, __pyx_L1_error)
12529 __Pyx_GOTREF(__pyx_t_8);
12531 __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_5); __pyx_t_5 = NULL;
12533 __Pyx_GIVEREF(__pyx_t_1);
12534 PyTuple_SET_ITEM(__pyx_t_8, 0+__pyx_t_7, __pyx_t_1);
12535 __Pyx_INCREF(__pyx_v_value);
12536 __Pyx_GIVEREF(__pyx_v_value);
12537 PyTuple_SET_ITEM(__pyx_t_8, 1+__pyx_t_7, __pyx_v_value);
12539 __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_8, NULL);
if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 512, __pyx_L1_error)
12540 __Pyx_GOTREF(__pyx_t_4);
12541 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
12543 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
12544 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(1, 512, __pyx_L1_error)
12545 __pyx_v_bytesvalue = ((PyObject*)__pyx_t_4);
12558 if (unlikely(__pyx_v_bytesvalue == Py_None)) {
12559 PyErr_SetString(PyExc_TypeError,
"'NoneType' is not iterable");
12560 __PYX_ERR(1, 514, __pyx_L1_error)
12562 __Pyx_INCREF(__pyx_v_bytesvalue);
12563 __pyx_t_10 = __pyx_v_bytesvalue;
12564 __pyx_t_12 = PyBytes_AS_STRING(__pyx_t_10);
12565 __pyx_t_13 = (__pyx_t_12 + PyBytes_GET_SIZE(__pyx_t_10));
12566 for (__pyx_t_14 = __pyx_t_12; __pyx_t_14 < __pyx_t_13; __pyx_t_14++) {
12567 __pyx_t_11 = __pyx_t_14;
12568 __pyx_v_c = (__pyx_t_11[0]);
12577 __pyx_v_i = __pyx_t_9;
12586 __pyx_t_9 = (__pyx_t_9 + 1);
12595 (__pyx_v_itemp[__pyx_v_i]) = __pyx_v_c;
12597 __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
12608 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
12611 __Pyx_XDECREF(__pyx_t_1);
12612 __Pyx_XDECREF(__pyx_t_4);
12613 __Pyx_XDECREF(__pyx_t_5);
12614 __Pyx_XDECREF(__pyx_t_6);
12615 __Pyx_XDECREF(__pyx_t_8);
12616 __Pyx_XDECREF(__pyx_t_10);
12617 __Pyx_AddTraceback(
"View.MemoryView.memoryview.assign_item_from_object", __pyx_clineno, __pyx_lineno, __pyx_filename);
12620 __Pyx_XDECREF(__pyx_v_struct);
12621 __Pyx_XDECREF(__pyx_v_bytesvalue);
12622 __Pyx_XGIVEREF(__pyx_r);
12623 __Pyx_TraceReturn(__pyx_r, 0);
12624 __Pyx_RefNannyFinishContext();
12637 static CYTHON_UNUSED
int __pyx_memoryview_getbuffer(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info,
int __pyx_v_flags);
12638 static CYTHON_UNUSED
int __pyx_memoryview_getbuffer(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info,
int __pyx_v_flags) {
12640 __Pyx_RefNannyDeclarations
12641 __Pyx_RefNannySetupContext(
"__getbuffer__ (wrapper)", 0);
12642 __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));
12645 __Pyx_RefNannyFinishContext();
12649 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) {
12651 __Pyx_TraceDeclarations
12652 __Pyx_RefNannyDeclarations
12655 PyObject *__pyx_t_3 = NULL;
12656 Py_ssize_t *__pyx_t_4;
12660 Py_ssize_t __pyx_t_8;
12661 int __pyx_lineno = 0;
12662 const char *__pyx_filename = NULL;
12663 int __pyx_clineno = 0;
12664 if (__pyx_v_info == NULL) {
12665 PyErr_SetString(PyExc_BufferError,
"PyObject_GetBuffer: view==NULL argument is obsolete");
12668 __Pyx_RefNannySetupContext(
"__getbuffer__", 0);
12669 __pyx_v_info->obj = Py_None; __Pyx_INCREF(Py_None);
12670 __Pyx_GIVEREF(__pyx_v_info->obj);
12671 __Pyx_TraceCall(
"__getbuffer__", __pyx_f[1], 518, 0, __PYX_ERR(1, 518, __pyx_L1_error));
12680 __pyx_t_2 = ((__pyx_v_flags & PyBUF_WRITABLE) != 0);
12683 __pyx_t_1 = __pyx_t_2;
12684 goto __pyx_L4_bool_binop_done;
12686 __pyx_t_2 = (__pyx_v_self->view.readonly != 0);
12687 __pyx_t_1 = __pyx_t_2;
12688 __pyx_L4_bool_binop_done:;
12689 if (unlikely(__pyx_t_1)) {
12698 __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__27, NULL);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 520, __pyx_L1_error)
12699 __Pyx_GOTREF(__pyx_t_3);
12700 __Pyx_Raise(__pyx_t_3, 0, 0, 0);
12701 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
12702 __PYX_ERR(1, 520, __pyx_L1_error)
12720 __pyx_t_1 = ((__pyx_v_flags & PyBUF_ND) != 0);
12730 __pyx_t_4 = __pyx_v_self->view.shape;
12731 __pyx_v_info->shape = __pyx_t_4;
12751 __pyx_v_info->shape = NULL;
12762 __pyx_t_1 = ((__pyx_v_flags & PyBUF_STRIDES) != 0);
12772 __pyx_t_4 = __pyx_v_self->view.strides;
12773 __pyx_v_info->strides = __pyx_t_4;
12793 __pyx_v_info->strides = NULL;
12804 __pyx_t_1 = ((__pyx_v_flags & PyBUF_INDIRECT) != 0);
12814 __pyx_t_4 = __pyx_v_self->view.suboffsets;
12815 __pyx_v_info->suboffsets = __pyx_t_4;
12835 __pyx_v_info->suboffsets = NULL;
12846 __pyx_t_1 = ((__pyx_v_flags & PyBUF_FORMAT) != 0);
12856 __pyx_t_5 = __pyx_v_self->view.format;
12857 __pyx_v_info->format = __pyx_t_5;
12877 __pyx_v_info->format = NULL;
12888 __pyx_t_6 = __pyx_v_self->view.buf;
12889 __pyx_v_info->buf = __pyx_t_6;
12898 __pyx_t_7 = __pyx_v_self->view.ndim;
12899 __pyx_v_info->ndim = __pyx_t_7;
12908 __pyx_t_8 = __pyx_v_self->view.itemsize;
12909 __pyx_v_info->itemsize = __pyx_t_8;
12918 __pyx_t_8 = __pyx_v_self->view.len;
12919 __pyx_v_info->len = __pyx_t_8;
12928 __pyx_t_1 = __pyx_v_self->view.readonly;
12929 __pyx_v_info->readonly = __pyx_t_1;
12938 __Pyx_INCREF(((PyObject *)__pyx_v_self));
12939 __Pyx_GIVEREF(((PyObject *)__pyx_v_self));
12940 __Pyx_GOTREF(__pyx_v_info->obj);
12941 __Pyx_DECREF(__pyx_v_info->obj);
12942 __pyx_v_info->obj = ((PyObject *)__pyx_v_self);
12956 __Pyx_XDECREF(__pyx_t_3);
12957 __Pyx_AddTraceback(
"View.MemoryView.memoryview.__getbuffer__", __pyx_clineno, __pyx_lineno, __pyx_filename);
12959 if (__pyx_v_info->obj != NULL) {
12960 __Pyx_GOTREF(__pyx_v_info->obj);
12961 __Pyx_DECREF(__pyx_v_info->obj); __pyx_v_info->obj = 0;
12965 if (__pyx_v_info->obj == Py_None) {
12966 __Pyx_GOTREF(__pyx_v_info->obj);
12967 __Pyx_DECREF(__pyx_v_info->obj); __pyx_v_info->obj = 0;
12970 __Pyx_TraceReturn(Py_None, 0);
12971 __Pyx_RefNannyFinishContext();
12984 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_1T_1__get__(PyObject *__pyx_v_self);
12985 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_1T_1__get__(PyObject *__pyx_v_self) {
12986 PyObject *__pyx_r = 0;
12987 __Pyx_RefNannyDeclarations
12988 __Pyx_RefNannySetupContext(
"__get__ (wrapper)", 0);
12989 __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_1T___get__(((
struct __pyx_memoryview_obj *)__pyx_v_self));
12992 __Pyx_RefNannyFinishContext();
12996 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_1T___get__(
struct __pyx_memoryview_obj *__pyx_v_self) {
12997 struct __pyx_memoryviewslice_obj *__pyx_v_result = 0;
12998 PyObject *__pyx_r = NULL;
12999 __Pyx_TraceDeclarations
13000 __Pyx_RefNannyDeclarations
13001 PyObject *__pyx_t_1 = NULL;
13003 int __pyx_lineno = 0;
13004 const char *__pyx_filename = NULL;
13005 int __pyx_clineno = 0;
13006 __Pyx_RefNannySetupContext(
"__get__", 0);
13007 __Pyx_TraceCall(
"__get__", __pyx_f[1], 553, 0, __PYX_ERR(1, 553, __pyx_L1_error));
13016 __pyx_t_1 = __pyx_memoryview_copy_object(__pyx_v_self);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 554, __pyx_L1_error)
13017 __Pyx_GOTREF(__pyx_t_1);
13018 if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_memoryviewslice_type))))) __PYX_ERR(1, 554, __pyx_L1_error)
13019 __pyx_v_result = ((
struct __pyx_memoryviewslice_obj *)__pyx_t_1);
13029 __pyx_t_2 = __pyx_memslice_transpose((&__pyx_v_result->from_slice));
if (unlikely(__pyx_t_2 == ((
int)0))) __PYX_ERR(1, 555, __pyx_L1_error)
13038 __Pyx_XDECREF(__pyx_r);
13039 __Pyx_INCREF(((PyObject *)__pyx_v_result));
13040 __pyx_r = ((PyObject *)__pyx_v_result);
13053 __Pyx_XDECREF(__pyx_t_1);
13054 __Pyx_AddTraceback(
"View.MemoryView.memoryview.T.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
13057 __Pyx_XDECREF((PyObject *)__pyx_v_result);
13058 __Pyx_XGIVEREF(__pyx_r);
13059 __Pyx_TraceReturn(__pyx_r, 0);
13060 __Pyx_RefNannyFinishContext();
13073 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_4base_1__get__(PyObject *__pyx_v_self);
13074 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_4base_1__get__(PyObject *__pyx_v_self) {
13075 PyObject *__pyx_r = 0;
13076 __Pyx_RefNannyDeclarations
13077 __Pyx_RefNannySetupContext(
"__get__ (wrapper)", 0);
13078 __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_4base___get__(((
struct __pyx_memoryview_obj *)__pyx_v_self));
13081 __Pyx_RefNannyFinishContext();
13085 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_4base___get__(
struct __pyx_memoryview_obj *__pyx_v_self) {
13086 PyObject *__pyx_r = NULL;
13087 __Pyx_TraceDeclarations
13088 __Pyx_RefNannyDeclarations
13089 int __pyx_lineno = 0;
13090 const char *__pyx_filename = NULL;
13091 int __pyx_clineno = 0;
13092 __Pyx_RefNannySetupContext(
"__get__", 0);
13093 __Pyx_TraceCall(
"__get__", __pyx_f[1], 559, 0, __PYX_ERR(1, 559, __pyx_L1_error));
13102 __Pyx_XDECREF(__pyx_r);
13103 __Pyx_INCREF(__pyx_v_self->obj);
13104 __pyx_r = __pyx_v_self->obj;
13117 __Pyx_AddTraceback(
"View.MemoryView.memoryview.base.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
13120 __Pyx_XGIVEREF(__pyx_r);
13121 __Pyx_TraceReturn(__pyx_r, 0);
13122 __Pyx_RefNannyFinishContext();
13135 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_5shape_1__get__(PyObject *__pyx_v_self);
13136 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_5shape_1__get__(PyObject *__pyx_v_self) {
13137 PyObject *__pyx_r = 0;
13138 __Pyx_RefNannyDeclarations
13139 __Pyx_RefNannySetupContext(
"__get__ (wrapper)", 0);
13140 __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_5shape___get__(((
struct __pyx_memoryview_obj *)__pyx_v_self));
13143 __Pyx_RefNannyFinishContext();
13147 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_5shape___get__(
struct __pyx_memoryview_obj *__pyx_v_self) {
13148 Py_ssize_t __pyx_v_length;
13149 PyObject *__pyx_r = NULL;
13150 __Pyx_TraceDeclarations
13151 __Pyx_RefNannyDeclarations
13152 PyObject *__pyx_t_1 = NULL;
13153 Py_ssize_t *__pyx_t_2;
13154 Py_ssize_t *__pyx_t_3;
13155 Py_ssize_t *__pyx_t_4;
13156 PyObject *__pyx_t_5 = NULL;
13157 int __pyx_lineno = 0;
13158 const char *__pyx_filename = NULL;
13159 int __pyx_clineno = 0;
13160 __Pyx_RefNannySetupContext(
"__get__", 0);
13161 __Pyx_TraceCall(
"__get__", __pyx_f[1], 563, 0, __PYX_ERR(1, 563, __pyx_L1_error));
13170 __Pyx_XDECREF(__pyx_r);
13171 __pyx_t_1 = PyList_New(0);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 564, __pyx_L1_error)
13172 __Pyx_GOTREF(__pyx_t_1);
13173 __pyx_t_3 = (__pyx_v_self->view.shape + __pyx_v_self->view.ndim);
13174 for (__pyx_t_4 = __pyx_v_self->view.shape; __pyx_t_4 < __pyx_t_3; __pyx_t_4++) {
13175 __pyx_t_2 = __pyx_t_4;
13176 __pyx_v_length = (__pyx_t_2[0]);
13177 __pyx_t_5 = PyInt_FromSsize_t(__pyx_v_length);
if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 564, __pyx_L1_error)
13178 __Pyx_GOTREF(__pyx_t_5);
13179 if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_t_5))) __PYX_ERR(1, 564, __pyx_L1_error)
13180 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
13182 __pyx_t_5 = PyList_AsTuple(((PyObject*)__pyx_t_1));
if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 564, __pyx_L1_error)
13183 __Pyx_GOTREF(__pyx_t_5);
13184 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
13185 __pyx_r = __pyx_t_5;
13199 __Pyx_XDECREF(__pyx_t_1);
13200 __Pyx_XDECREF(__pyx_t_5);
13201 __Pyx_AddTraceback(
"View.MemoryView.memoryview.shape.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
13204 __Pyx_XGIVEREF(__pyx_r);
13205 __Pyx_TraceReturn(__pyx_r, 0);
13206 __Pyx_RefNannyFinishContext();
13219 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_7strides_1__get__(PyObject *__pyx_v_self);
13220 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_7strides_1__get__(PyObject *__pyx_v_self) {
13221 PyObject *__pyx_r = 0;
13222 __Pyx_RefNannyDeclarations
13223 __Pyx_RefNannySetupContext(
"__get__ (wrapper)", 0);
13224 __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_7strides___get__(((
struct __pyx_memoryview_obj *)__pyx_v_self));
13227 __Pyx_RefNannyFinishContext();
13231 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_7strides___get__(
struct __pyx_memoryview_obj *__pyx_v_self) {
13232 Py_ssize_t __pyx_v_stride;
13233 PyObject *__pyx_r = NULL;
13234 __Pyx_TraceDeclarations
13235 __Pyx_RefNannyDeclarations
13237 PyObject *__pyx_t_2 = NULL;
13238 Py_ssize_t *__pyx_t_3;
13239 Py_ssize_t *__pyx_t_4;
13240 Py_ssize_t *__pyx_t_5;
13241 PyObject *__pyx_t_6 = NULL;
13242 int __pyx_lineno = 0;
13243 const char *__pyx_filename = NULL;
13244 int __pyx_clineno = 0;
13245 __Pyx_RefNannySetupContext(
"__get__", 0);
13246 __Pyx_TraceCall(
"__get__", __pyx_f[1], 567, 0, __PYX_ERR(1, 567, __pyx_L1_error));
13255 __pyx_t_1 = ((__pyx_v_self->view.strides == NULL) != 0);
13256 if (unlikely(__pyx_t_1)) {
13265 __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__28, NULL);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 570, __pyx_L1_error)
13266 __Pyx_GOTREF(__pyx_t_2);
13267 __Pyx_Raise(__pyx_t_2, 0, 0, 0);
13268 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
13269 __PYX_ERR(1, 570, __pyx_L1_error)
13287 __Pyx_XDECREF(__pyx_r);
13288 __pyx_t_2 = PyList_New(0);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 572, __pyx_L1_error)
13289 __Pyx_GOTREF(__pyx_t_2);
13290 __pyx_t_4 = (__pyx_v_self->view.strides + __pyx_v_self->view.ndim);
13291 for (__pyx_t_5 = __pyx_v_self->view.strides; __pyx_t_5 < __pyx_t_4; __pyx_t_5++) {
13292 __pyx_t_3 = __pyx_t_5;
13293 __pyx_v_stride = (__pyx_t_3[0]);
13294 __pyx_t_6 = PyInt_FromSsize_t(__pyx_v_stride);
if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 572, __pyx_L1_error)
13295 __Pyx_GOTREF(__pyx_t_6);
13296 if (unlikely(__Pyx_ListComp_Append(__pyx_t_2, (PyObject*)__pyx_t_6))) __PYX_ERR(1, 572, __pyx_L1_error)
13297 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
13299 __pyx_t_6 = PyList_AsTuple(((PyObject*)__pyx_t_2));
if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 572, __pyx_L1_error)
13300 __Pyx_GOTREF(__pyx_t_6);
13301 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
13302 __pyx_r = __pyx_t_6;
13316 __Pyx_XDECREF(__pyx_t_2);
13317 __Pyx_XDECREF(__pyx_t_6);
13318 __Pyx_AddTraceback(
"View.MemoryView.memoryview.strides.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
13321 __Pyx_XGIVEREF(__pyx_r);
13322 __Pyx_TraceReturn(__pyx_r, 0);
13323 __Pyx_RefNannyFinishContext();
13336 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_10suboffsets_1__get__(PyObject *__pyx_v_self);
13337 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_10suboffsets_1__get__(PyObject *__pyx_v_self) {
13338 PyObject *__pyx_r = 0;
13339 __Pyx_RefNannyDeclarations
13340 __Pyx_RefNannySetupContext(
"__get__ (wrapper)", 0);
13341 __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_10suboffsets___get__(((
struct __pyx_memoryview_obj *)__pyx_v_self));
13344 __Pyx_RefNannyFinishContext();
13348 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_10suboffsets___get__(
struct __pyx_memoryview_obj *__pyx_v_self) {
13349 Py_ssize_t __pyx_v_suboffset;
13350 PyObject *__pyx_r = NULL;
13351 __Pyx_TraceDeclarations
13352 __Pyx_RefNannyDeclarations
13354 PyObject *__pyx_t_2 = NULL;
13355 PyObject *__pyx_t_3 = NULL;
13356 Py_ssize_t *__pyx_t_4;
13357 Py_ssize_t *__pyx_t_5;
13358 Py_ssize_t *__pyx_t_6;
13359 int __pyx_lineno = 0;
13360 const char *__pyx_filename = NULL;
13361 int __pyx_clineno = 0;
13362 __Pyx_RefNannySetupContext(
"__get__", 0);
13363 __Pyx_TraceCall(
"__get__", __pyx_f[1], 575, 0, __PYX_ERR(1, 575, __pyx_L1_error));
13372 __pyx_t_1 = ((__pyx_v_self->view.suboffsets == NULL) != 0);
13382 __Pyx_XDECREF(__pyx_r);
13383 __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_self->view.ndim);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 577, __pyx_L1_error)
13384 __Pyx_GOTREF(__pyx_t_2);
13385 __pyx_t_3 = PyNumber_Multiply(__pyx_tuple__29, __pyx_t_2);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 577, __pyx_L1_error)
13386 __Pyx_GOTREF(__pyx_t_3);
13387 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
13388 __pyx_r = __pyx_t_3;
13408 __Pyx_XDECREF(__pyx_r);
13409 __pyx_t_3 = PyList_New(0);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 579, __pyx_L1_error)
13410 __Pyx_GOTREF(__pyx_t_3);
13411 __pyx_t_5 = (__pyx_v_self->view.suboffsets + __pyx_v_self->view.ndim);
13412 for (__pyx_t_6 = __pyx_v_self->view.suboffsets; __pyx_t_6 < __pyx_t_5; __pyx_t_6++) {
13413 __pyx_t_4 = __pyx_t_6;
13414 __pyx_v_suboffset = (__pyx_t_4[0]);
13415 __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_suboffset);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 579, __pyx_L1_error)
13416 __Pyx_GOTREF(__pyx_t_2);
13417 if (unlikely(__Pyx_ListComp_Append(__pyx_t_3, (PyObject*)__pyx_t_2))) __PYX_ERR(1, 579, __pyx_L1_error)
13418 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
13420 __pyx_t_2 = PyList_AsTuple(((PyObject*)__pyx_t_3));
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 579, __pyx_L1_error)
13421 __Pyx_GOTREF(__pyx_t_2);
13422 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
13423 __pyx_r = __pyx_t_2;
13437 __Pyx_XDECREF(__pyx_t_2);
13438 __Pyx_XDECREF(__pyx_t_3);
13439 __Pyx_AddTraceback(
"View.MemoryView.memoryview.suboffsets.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
13442 __Pyx_XGIVEREF(__pyx_r);
13443 __Pyx_TraceReturn(__pyx_r, 0);
13444 __Pyx_RefNannyFinishContext();
13457 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_4ndim_1__get__(PyObject *__pyx_v_self);
13458 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_4ndim_1__get__(PyObject *__pyx_v_self) {
13459 PyObject *__pyx_r = 0;
13460 __Pyx_RefNannyDeclarations
13461 __Pyx_RefNannySetupContext(
"__get__ (wrapper)", 0);
13462 __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_4ndim___get__(((
struct __pyx_memoryview_obj *)__pyx_v_self));
13465 __Pyx_RefNannyFinishContext();
13469 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_4ndim___get__(
struct __pyx_memoryview_obj *__pyx_v_self) {
13470 PyObject *__pyx_r = NULL;
13471 __Pyx_TraceDeclarations
13472 __Pyx_RefNannyDeclarations
13473 PyObject *__pyx_t_1 = NULL;
13474 int __pyx_lineno = 0;
13475 const char *__pyx_filename = NULL;
13476 int __pyx_clineno = 0;
13477 __Pyx_RefNannySetupContext(
"__get__", 0);
13478 __Pyx_TraceCall(
"__get__", __pyx_f[1], 582, 0, __PYX_ERR(1, 582, __pyx_L1_error));
13487 __Pyx_XDECREF(__pyx_r);
13488 __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->view.ndim);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 583, __pyx_L1_error)
13489 __Pyx_GOTREF(__pyx_t_1);
13490 __pyx_r = __pyx_t_1;
13504 __Pyx_XDECREF(__pyx_t_1);
13505 __Pyx_AddTraceback(
"View.MemoryView.memoryview.ndim.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
13508 __Pyx_XGIVEREF(__pyx_r);
13509 __Pyx_TraceReturn(__pyx_r, 0);
13510 __Pyx_RefNannyFinishContext();
13523 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_8itemsize_1__get__(PyObject *__pyx_v_self);
13524 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_8itemsize_1__get__(PyObject *__pyx_v_self) {
13525 PyObject *__pyx_r = 0;
13526 __Pyx_RefNannyDeclarations
13527 __Pyx_RefNannySetupContext(
"__get__ (wrapper)", 0);
13528 __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_8itemsize___get__(((
struct __pyx_memoryview_obj *)__pyx_v_self));
13531 __Pyx_RefNannyFinishContext();
13535 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_8itemsize___get__(
struct __pyx_memoryview_obj *__pyx_v_self) {
13536 PyObject *__pyx_r = NULL;
13537 __Pyx_TraceDeclarations
13538 __Pyx_RefNannyDeclarations
13539 PyObject *__pyx_t_1 = NULL;
13540 int __pyx_lineno = 0;
13541 const char *__pyx_filename = NULL;
13542 int __pyx_clineno = 0;
13543 __Pyx_RefNannySetupContext(
"__get__", 0);
13544 __Pyx_TraceCall(
"__get__", __pyx_f[1], 586, 0, __PYX_ERR(1, 586, __pyx_L1_error));
13553 __Pyx_XDECREF(__pyx_r);
13554 __pyx_t_1 = PyInt_FromSsize_t(__pyx_v_self->view.itemsize);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 587, __pyx_L1_error)
13555 __Pyx_GOTREF(__pyx_t_1);
13556 __pyx_r = __pyx_t_1;
13570 __Pyx_XDECREF(__pyx_t_1);
13571 __Pyx_AddTraceback(
"View.MemoryView.memoryview.itemsize.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
13574 __Pyx_XGIVEREF(__pyx_r);
13575 __Pyx_TraceReturn(__pyx_r, 0);
13576 __Pyx_RefNannyFinishContext();
13589 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_6nbytes_1__get__(PyObject *__pyx_v_self);
13590 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_6nbytes_1__get__(PyObject *__pyx_v_self) {
13591 PyObject *__pyx_r = 0;
13592 __Pyx_RefNannyDeclarations
13593 __Pyx_RefNannySetupContext(
"__get__ (wrapper)", 0);
13594 __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_6nbytes___get__(((
struct __pyx_memoryview_obj *)__pyx_v_self));
13597 __Pyx_RefNannyFinishContext();
13601 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_6nbytes___get__(
struct __pyx_memoryview_obj *__pyx_v_self) {
13602 PyObject *__pyx_r = NULL;
13603 __Pyx_TraceDeclarations
13604 __Pyx_RefNannyDeclarations
13605 PyObject *__pyx_t_1 = NULL;
13606 PyObject *__pyx_t_2 = NULL;
13607 PyObject *__pyx_t_3 = NULL;
13608 int __pyx_lineno = 0;
13609 const char *__pyx_filename = NULL;
13610 int __pyx_clineno = 0;
13611 __Pyx_RefNannySetupContext(
"__get__", 0);
13612 __Pyx_TraceCall(
"__get__", __pyx_f[1], 590, 0, __PYX_ERR(1, 590, __pyx_L1_error));
13621 __Pyx_XDECREF(__pyx_r);
13622 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_size);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 591, __pyx_L1_error)
13623 __Pyx_GOTREF(__pyx_t_1);
13624 __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_self->view.itemsize);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 591, __pyx_L1_error)
13625 __Pyx_GOTREF(__pyx_t_2);
13626 __pyx_t_3 = PyNumber_Multiply(__pyx_t_1, __pyx_t_2);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 591, __pyx_L1_error)
13627 __Pyx_GOTREF(__pyx_t_3);
13628 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
13629 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
13630 __pyx_r = __pyx_t_3;
13644 __Pyx_XDECREF(__pyx_t_1);
13645 __Pyx_XDECREF(__pyx_t_2);
13646 __Pyx_XDECREF(__pyx_t_3);
13647 __Pyx_AddTraceback(
"View.MemoryView.memoryview.nbytes.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
13650 __Pyx_XGIVEREF(__pyx_r);
13651 __Pyx_TraceReturn(__pyx_r, 0);
13652 __Pyx_RefNannyFinishContext();
13665 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_4size_1__get__(PyObject *__pyx_v_self);
13666 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_4size_1__get__(PyObject *__pyx_v_self) {
13667 PyObject *__pyx_r = 0;
13668 __Pyx_RefNannyDeclarations
13669 __Pyx_RefNannySetupContext(
"__get__ (wrapper)", 0);
13670 __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_4size___get__(((
struct __pyx_memoryview_obj *)__pyx_v_self));
13673 __Pyx_RefNannyFinishContext();
13677 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_4size___get__(
struct __pyx_memoryview_obj *__pyx_v_self) {
13678 PyObject *__pyx_v_result = NULL;
13679 PyObject *__pyx_v_length = NULL;
13680 PyObject *__pyx_r = NULL;
13681 __Pyx_TraceDeclarations
13682 __Pyx_RefNannyDeclarations
13685 Py_ssize_t *__pyx_t_3;
13686 Py_ssize_t *__pyx_t_4;
13687 Py_ssize_t *__pyx_t_5;
13688 PyObject *__pyx_t_6 = NULL;
13689 int __pyx_lineno = 0;
13690 const char *__pyx_filename = NULL;
13691 int __pyx_clineno = 0;
13692 __Pyx_RefNannySetupContext(
"__get__", 0);
13693 __Pyx_TraceCall(
"__get__", __pyx_f[1], 594, 0, __PYX_ERR(1, 594, __pyx_L1_error));
13702 __pyx_t_1 = (__pyx_v_self->_size == Py_None);
13703 __pyx_t_2 = (__pyx_t_1 != 0);
13713 __Pyx_INCREF(__pyx_int_1);
13714 __pyx_v_result = __pyx_int_1;
13723 __pyx_t_4 = (__pyx_v_self->view.shape + __pyx_v_self->view.ndim);
13724 for (__pyx_t_5 = __pyx_v_self->view.shape; __pyx_t_5 < __pyx_t_4; __pyx_t_5++) {
13725 __pyx_t_3 = __pyx_t_5;
13726 __pyx_t_6 = PyInt_FromSsize_t((__pyx_t_3[0]));
if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 598, __pyx_L1_error)
13727 __Pyx_GOTREF(__pyx_t_6);
13728 __Pyx_XDECREF_SET(__pyx_v_length, __pyx_t_6);
13738 __pyx_t_6 = PyNumber_InPlaceMultiply(__pyx_v_result, __pyx_v_length);
if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 599, __pyx_L1_error)
13739 __Pyx_GOTREF(__pyx_t_6);
13740 __Pyx_DECREF_SET(__pyx_v_result, __pyx_t_6);
13751 __Pyx_INCREF(__pyx_v_result);
13752 __Pyx_GIVEREF(__pyx_v_result);
13753 __Pyx_GOTREF(__pyx_v_self->_size);
13754 __Pyx_DECREF(__pyx_v_self->_size);
13755 __pyx_v_self->_size = __pyx_v_result;
13773 __Pyx_XDECREF(__pyx_r);
13774 __Pyx_INCREF(__pyx_v_self->_size);
13775 __pyx_r = __pyx_v_self->_size;
13788 __Pyx_XDECREF(__pyx_t_6);
13789 __Pyx_AddTraceback(
"View.MemoryView.memoryview.size.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
13792 __Pyx_XDECREF(__pyx_v_result);
13793 __Pyx_XDECREF(__pyx_v_length);
13794 __Pyx_XGIVEREF(__pyx_r);
13795 __Pyx_TraceReturn(__pyx_r, 0);
13796 __Pyx_RefNannyFinishContext();
13809 static Py_ssize_t __pyx_memoryview___len__(PyObject *__pyx_v_self);
13810 static Py_ssize_t __pyx_memoryview___len__(PyObject *__pyx_v_self) {
13811 Py_ssize_t __pyx_r;
13812 __Pyx_RefNannyDeclarations
13813 __Pyx_RefNannySetupContext(
"__len__ (wrapper)", 0);
13814 __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_10__len__(((
struct __pyx_memoryview_obj *)__pyx_v_self));
13817 __Pyx_RefNannyFinishContext();
13821 static Py_ssize_t __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_10__len__(
struct __pyx_memoryview_obj *__pyx_v_self) {
13822 Py_ssize_t __pyx_r;
13823 __Pyx_TraceDeclarations
13824 __Pyx_RefNannyDeclarations
13826 int __pyx_lineno = 0;
13827 const char *__pyx_filename = NULL;
13828 int __pyx_clineno = 0;
13829 __Pyx_RefNannySetupContext(
"__len__", 0);
13830 __Pyx_TraceCall(
"__len__", __pyx_f[1], 605, 0, __PYX_ERR(1, 605, __pyx_L1_error));
13839 __pyx_t_1 = ((__pyx_v_self->view.ndim >= 1) != 0);
13849 __pyx_r = (__pyx_v_self->view.shape[0]);
13881 __Pyx_AddTraceback(
"View.MemoryView.memoryview.__len__", __pyx_clineno, __pyx_lineno, __pyx_filename);
13884 __Pyx_TraceReturn(Py_None, 0);
13885 __Pyx_RefNannyFinishContext();
13898 static PyObject *__pyx_memoryview___repr__(PyObject *__pyx_v_self);
13899 static PyObject *__pyx_memoryview___repr__(PyObject *__pyx_v_self) {
13900 PyObject *__pyx_r = 0;
13901 __Pyx_RefNannyDeclarations
13902 __Pyx_RefNannySetupContext(
"__repr__ (wrapper)", 0);
13903 __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_12__repr__(((
struct __pyx_memoryview_obj *)__pyx_v_self));
13906 __Pyx_RefNannyFinishContext();
13910 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_12__repr__(
struct __pyx_memoryview_obj *__pyx_v_self) {
13911 PyObject *__pyx_r = NULL;
13912 __Pyx_TraceDeclarations
13913 __Pyx_RefNannyDeclarations
13914 PyObject *__pyx_t_1 = NULL;
13915 PyObject *__pyx_t_2 = NULL;
13916 PyObject *__pyx_t_3 = NULL;
13917 int __pyx_lineno = 0;
13918 const char *__pyx_filename = NULL;
13919 int __pyx_clineno = 0;
13920 __Pyx_RefNannySetupContext(
"__repr__", 0);
13921 __Pyx_TraceCall(
"__repr__", __pyx_f[1], 611, 0, __PYX_ERR(1, 611, __pyx_L1_error));
13930 __Pyx_XDECREF(__pyx_r);
13931 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_base);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 612, __pyx_L1_error)
13932 __Pyx_GOTREF(__pyx_t_1);
13933 __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_class);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 612, __pyx_L1_error)
13934 __Pyx_GOTREF(__pyx_t_2);
13935 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
13936 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_name_2);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 612, __pyx_L1_error)
13937 __Pyx_GOTREF(__pyx_t_1);
13938 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
13947 __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_builtin_id, ((PyObject *)__pyx_v_self));
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 613, __pyx_L1_error)
13948 __Pyx_GOTREF(__pyx_t_2);
13957 __pyx_t_3 = PyTuple_New(2);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 612, __pyx_L1_error)
13958 __Pyx_GOTREF(__pyx_t_3);
13959 __Pyx_GIVEREF(__pyx_t_1);
13960 PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1);
13961 __Pyx_GIVEREF(__pyx_t_2);
13962 PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_2);
13965 __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(1, 612, __pyx_L1_error)
13966 __Pyx_GOTREF(__pyx_t_2);
13967 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
13968 __pyx_r = __pyx_t_2;
13982 __Pyx_XDECREF(__pyx_t_1);
13983 __Pyx_XDECREF(__pyx_t_2);
13984 __Pyx_XDECREF(__pyx_t_3);
13985 __Pyx_AddTraceback(
"View.MemoryView.memoryview.__repr__", __pyx_clineno, __pyx_lineno, __pyx_filename);
13988 __Pyx_XGIVEREF(__pyx_r);
13989 __Pyx_TraceReturn(__pyx_r, 0);
13990 __Pyx_RefNannyFinishContext();
14003 static PyObject *__pyx_memoryview___str__(PyObject *__pyx_v_self);
14004 static PyObject *__pyx_memoryview___str__(PyObject *__pyx_v_self) {
14005 PyObject *__pyx_r = 0;
14006 __Pyx_RefNannyDeclarations
14007 __Pyx_RefNannySetupContext(
"__str__ (wrapper)", 0);
14008 __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_14__str__(((
struct __pyx_memoryview_obj *)__pyx_v_self));
14011 __Pyx_RefNannyFinishContext();
14015 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_14__str__(
struct __pyx_memoryview_obj *__pyx_v_self) {
14016 PyObject *__pyx_r = NULL;
14017 __Pyx_TraceDeclarations
14018 __Pyx_RefNannyDeclarations
14019 PyObject *__pyx_t_1 = NULL;
14020 PyObject *__pyx_t_2 = NULL;
14021 int __pyx_lineno = 0;
14022 const char *__pyx_filename = NULL;
14023 int __pyx_clineno = 0;
14024 __Pyx_RefNannySetupContext(
"__str__", 0);
14025 __Pyx_TraceCall(
"__str__", __pyx_f[1], 615, 0, __PYX_ERR(1, 615, __pyx_L1_error));
14034 __Pyx_XDECREF(__pyx_r);
14035 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_base);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 616, __pyx_L1_error)
14036 __Pyx_GOTREF(__pyx_t_1);
14037 __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_class);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 616, __pyx_L1_error)
14038 __Pyx_GOTREF(__pyx_t_2);
14039 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
14040 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_name_2);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 616, __pyx_L1_error)
14041 __Pyx_GOTREF(__pyx_t_1);
14042 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
14043 __pyx_t_2 = PyTuple_New(1);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 616, __pyx_L1_error)
14044 __Pyx_GOTREF(__pyx_t_2);
14045 __Pyx_GIVEREF(__pyx_t_1);
14046 PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1);
14048 __pyx_t_1 = __Pyx_PyString_Format(__pyx_kp_s_MemoryView_of_r_object, __pyx_t_2);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 616, __pyx_L1_error)
14049 __Pyx_GOTREF(__pyx_t_1);
14050 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
14051 __pyx_r = __pyx_t_1;
14065 __Pyx_XDECREF(__pyx_t_1);
14066 __Pyx_XDECREF(__pyx_t_2);
14067 __Pyx_AddTraceback(
"View.MemoryView.memoryview.__str__", __pyx_clineno, __pyx_lineno, __pyx_filename);
14070 __Pyx_XGIVEREF(__pyx_r);
14071 __Pyx_TraceReturn(__pyx_r, 0);
14072 __Pyx_RefNannyFinishContext();
14085 static PyObject *__pyx_memoryview_is_c_contig(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused);
14086 static PyMethodDef __pyx_mdef_15View_dot_MemoryView_10memoryview_17is_c_contig = {
"is_c_contig", (PyCFunction)__pyx_memoryview_is_c_contig, METH_NOARGS, 0};
14087 static PyObject *__pyx_memoryview_is_c_contig(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
14088 PyObject *__pyx_r = 0;
14089 __Pyx_RefNannyDeclarations
14090 __Pyx_RefNannySetupContext(
"is_c_contig (wrapper)", 0);
14091 __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_16is_c_contig(((
struct __pyx_memoryview_obj *)__pyx_v_self));
14094 __Pyx_RefNannyFinishContext();
14098 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_16is_c_contig(
struct __pyx_memoryview_obj *__pyx_v_self) {
14099 __Pyx_memviewslice *__pyx_v_mslice;
14100 __Pyx_memviewslice __pyx_v_tmp;
14101 PyObject *__pyx_r = NULL;
14102 __Pyx_TraceDeclarations
14103 __Pyx_RefNannyDeclarations
14104 __Pyx_memviewslice *__pyx_t_1;
14105 PyObject *__pyx_t_2 = NULL;
14106 int __pyx_lineno = 0;
14107 const char *__pyx_filename = NULL;
14108 int __pyx_clineno = 0;
14109 __Pyx_RefNannySetupContext(
"is_c_contig", 0);
14110 __Pyx_TraceCall(
"is_c_contig", __pyx_f[1], 619, 0, __PYX_ERR(1, 619, __pyx_L1_error));
14119 __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(1, 622, __pyx_L1_error)
14120 __pyx_v_mslice = __pyx_t_1;
14129 __Pyx_XDECREF(__pyx_r);
14130 __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(1, 623, __pyx_L1_error)
14131 __Pyx_GOTREF(__pyx_t_2);
14132 __pyx_r = __pyx_t_2;
14146 __Pyx_XDECREF(__pyx_t_2);
14147 __Pyx_AddTraceback(
"View.MemoryView.memoryview.is_c_contig", __pyx_clineno, __pyx_lineno, __pyx_filename);
14150 __Pyx_XGIVEREF(__pyx_r);
14151 __Pyx_TraceReturn(__pyx_r, 0);
14152 __Pyx_RefNannyFinishContext();
14165 static PyObject *__pyx_memoryview_is_f_contig(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused);
14166 static PyMethodDef __pyx_mdef_15View_dot_MemoryView_10memoryview_19is_f_contig = {
"is_f_contig", (PyCFunction)__pyx_memoryview_is_f_contig, METH_NOARGS, 0};
14167 static PyObject *__pyx_memoryview_is_f_contig(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
14168 PyObject *__pyx_r = 0;
14169 __Pyx_RefNannyDeclarations
14170 __Pyx_RefNannySetupContext(
"is_f_contig (wrapper)", 0);
14171 __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_18is_f_contig(((
struct __pyx_memoryview_obj *)__pyx_v_self));
14174 __Pyx_RefNannyFinishContext();
14178 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_18is_f_contig(
struct __pyx_memoryview_obj *__pyx_v_self) {
14179 __Pyx_memviewslice *__pyx_v_mslice;
14180 __Pyx_memviewslice __pyx_v_tmp;
14181 PyObject *__pyx_r = NULL;
14182 __Pyx_TraceDeclarations
14183 __Pyx_RefNannyDeclarations
14184 __Pyx_memviewslice *__pyx_t_1;
14185 PyObject *__pyx_t_2 = NULL;
14186 int __pyx_lineno = 0;
14187 const char *__pyx_filename = NULL;
14188 int __pyx_clineno = 0;
14189 __Pyx_RefNannySetupContext(
"is_f_contig", 0);
14190 __Pyx_TraceCall(
"is_f_contig", __pyx_f[1], 625, 0, __PYX_ERR(1, 625, __pyx_L1_error));
14199 __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(1, 628, __pyx_L1_error)
14200 __pyx_v_mslice = __pyx_t_1;
14209 __Pyx_XDECREF(__pyx_r);
14210 __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(1, 629, __pyx_L1_error)
14211 __Pyx_GOTREF(__pyx_t_2);
14212 __pyx_r = __pyx_t_2;
14226 __Pyx_XDECREF(__pyx_t_2);
14227 __Pyx_AddTraceback(
"View.MemoryView.memoryview.is_f_contig", __pyx_clineno, __pyx_lineno, __pyx_filename);
14230 __Pyx_XGIVEREF(__pyx_r);
14231 __Pyx_TraceReturn(__pyx_r, 0);
14232 __Pyx_RefNannyFinishContext();
14245 static PyObject *__pyx_memoryview_copy(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused);
14246 static PyMethodDef __pyx_mdef_15View_dot_MemoryView_10memoryview_21copy = {
"copy", (PyCFunction)__pyx_memoryview_copy, METH_NOARGS, 0};
14247 static PyObject *__pyx_memoryview_copy(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
14248 PyObject *__pyx_r = 0;
14249 __Pyx_RefNannyDeclarations
14250 __Pyx_RefNannySetupContext(
"copy (wrapper)", 0);
14251 __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_20copy(((
struct __pyx_memoryview_obj *)__pyx_v_self));
14254 __Pyx_RefNannyFinishContext();
14258 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_20copy(
struct __pyx_memoryview_obj *__pyx_v_self) {
14259 __Pyx_memviewslice __pyx_v_mslice;
14261 PyObject *__pyx_r = NULL;
14262 __Pyx_TraceDeclarations
14263 __Pyx_RefNannyDeclarations
14264 __Pyx_memviewslice __pyx_t_1;
14265 PyObject *__pyx_t_2 = NULL;
14266 int __pyx_lineno = 0;
14267 const char *__pyx_filename = NULL;
14268 int __pyx_clineno = 0;
14269 __Pyx_RefNannySetupContext(
"copy", 0);
14270 __Pyx_TraceCall(
"copy", __pyx_f[1], 631, 0, __PYX_ERR(1, 631, __pyx_L1_error));
14279 __pyx_v_flags = (__pyx_v_self->flags & (~PyBUF_F_CONTIGUOUS));
14288 __pyx_memoryview_slice_copy(__pyx_v_self, (&__pyx_v_mslice));
14297 __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(1, 636, __pyx_L1_error)
14298 __pyx_v_mslice = __pyx_t_1;
14307 __Pyx_XDECREF(__pyx_r);
14308 __pyx_t_2 = __pyx_memoryview_copy_object_from_slice(__pyx_v_self, (&__pyx_v_mslice));
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 641, __pyx_L1_error)
14309 __Pyx_GOTREF(__pyx_t_2);
14310 __pyx_r = __pyx_t_2;
14324 __Pyx_XDECREF(__pyx_t_2);
14325 __Pyx_AddTraceback(
"View.MemoryView.memoryview.copy", __pyx_clineno, __pyx_lineno, __pyx_filename);
14328 __Pyx_XGIVEREF(__pyx_r);
14329 __Pyx_TraceReturn(__pyx_r, 0);
14330 __Pyx_RefNannyFinishContext();
14343 static PyObject *__pyx_memoryview_copy_fortran(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused);
14344 static PyMethodDef __pyx_mdef_15View_dot_MemoryView_10memoryview_23copy_fortran = {
"copy_fortran", (PyCFunction)__pyx_memoryview_copy_fortran, METH_NOARGS, 0};
14345 static PyObject *__pyx_memoryview_copy_fortran(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
14346 PyObject *__pyx_r = 0;
14347 __Pyx_RefNannyDeclarations
14348 __Pyx_RefNannySetupContext(
"copy_fortran (wrapper)", 0);
14349 __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_22copy_fortran(((
struct __pyx_memoryview_obj *)__pyx_v_self));
14352 __Pyx_RefNannyFinishContext();
14356 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_22copy_fortran(
struct __pyx_memoryview_obj *__pyx_v_self) {
14357 __Pyx_memviewslice __pyx_v_src;
14358 __Pyx_memviewslice __pyx_v_dst;
14360 PyObject *__pyx_r = NULL;
14361 __Pyx_TraceDeclarations
14362 __Pyx_RefNannyDeclarations
14363 __Pyx_memviewslice __pyx_t_1;
14364 PyObject *__pyx_t_2 = NULL;
14365 int __pyx_lineno = 0;
14366 const char *__pyx_filename = NULL;
14367 int __pyx_clineno = 0;
14368 __Pyx_RefNannySetupContext(
"copy_fortran", 0);
14369 __Pyx_TraceCall(
"copy_fortran", __pyx_f[1], 643, 0, __PYX_ERR(1, 643, __pyx_L1_error));
14378 __pyx_v_flags = (__pyx_v_self->flags & (~PyBUF_C_CONTIGUOUS));
14387 __pyx_memoryview_slice_copy(__pyx_v_self, (&__pyx_v_src));
14396 __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(1, 648, __pyx_L1_error)
14397 __pyx_v_dst = __pyx_t_1;
14406 __Pyx_XDECREF(__pyx_r);
14407 __pyx_t_2 = __pyx_memoryview_copy_object_from_slice(__pyx_v_self, (&__pyx_v_dst));
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 653, __pyx_L1_error)
14408 __Pyx_GOTREF(__pyx_t_2);
14409 __pyx_r = __pyx_t_2;
14423 __Pyx_XDECREF(__pyx_t_2);
14424 __Pyx_AddTraceback(
"View.MemoryView.memoryview.copy_fortran", __pyx_clineno, __pyx_lineno, __pyx_filename);
14427 __Pyx_XGIVEREF(__pyx_r);
14428 __Pyx_TraceReturn(__pyx_r, 0);
14429 __Pyx_RefNannyFinishContext();
14440 static PyObject *__pyx_pw___pyx_memoryview_1__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused);
14441 static PyMethodDef __pyx_mdef___pyx_memoryview_1__reduce_cython__ = {
"__reduce_cython__", (PyCFunction)__pyx_pw___pyx_memoryview_1__reduce_cython__, METH_NOARGS, 0};
14442 static PyObject *__pyx_pw___pyx_memoryview_1__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
14443 PyObject *__pyx_r = 0;
14444 __Pyx_RefNannyDeclarations
14445 __Pyx_RefNannySetupContext(
"__reduce_cython__ (wrapper)", 0);
14446 __pyx_r = __pyx_pf___pyx_memoryview___reduce_cython__(((
struct __pyx_memoryview_obj *)__pyx_v_self));
14449 __Pyx_RefNannyFinishContext();
14453 static PyObject *__pyx_pf___pyx_memoryview___reduce_cython__(CYTHON_UNUSED
struct __pyx_memoryview_obj *__pyx_v_self) {
14454 PyObject *__pyx_r = NULL;
14455 __Pyx_TraceDeclarations
14456 __Pyx_RefNannyDeclarations
14457 PyObject *__pyx_t_1 = NULL;
14458 int __pyx_lineno = 0;
14459 const char *__pyx_filename = NULL;
14460 int __pyx_clineno = 0;
14461 __Pyx_RefNannySetupContext(
"__reduce_cython__", 0);
14462 __Pyx_TraceCall(
"__reduce_cython__", __pyx_f[1], 1, 0, __PYX_ERR(1, 1, __pyx_L1_error));
14470 __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__30, NULL);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 2, __pyx_L1_error)
14471 __Pyx_GOTREF(__pyx_t_1);
14472 __Pyx_Raise(__pyx_t_1, 0, 0, 0);
14473 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
14474 __PYX_ERR(1, 2, __pyx_L1_error)
14484 __Pyx_XDECREF(__pyx_t_1);
14485 __Pyx_AddTraceback(
"View.MemoryView.memoryview.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
14487 __Pyx_XGIVEREF(__pyx_r);
14488 __Pyx_TraceReturn(__pyx_r, 0);
14489 __Pyx_RefNannyFinishContext();
14501 static PyObject *__pyx_pw___pyx_memoryview_3__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state);
14502 static PyMethodDef __pyx_mdef___pyx_memoryview_3__setstate_cython__ = {
"__setstate_cython__", (PyCFunction)__pyx_pw___pyx_memoryview_3__setstate_cython__, METH_O, 0};
14503 static PyObject *__pyx_pw___pyx_memoryview_3__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
14504 PyObject *__pyx_r = 0;
14505 __Pyx_RefNannyDeclarations
14506 __Pyx_RefNannySetupContext(
"__setstate_cython__ (wrapper)", 0);
14507 __pyx_r = __pyx_pf___pyx_memoryview_2__setstate_cython__(((
struct __pyx_memoryview_obj *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state));
14510 __Pyx_RefNannyFinishContext();
14514 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) {
14515 PyObject *__pyx_r = NULL;
14516 __Pyx_TraceDeclarations
14517 __Pyx_RefNannyDeclarations
14518 PyObject *__pyx_t_1 = NULL;
14519 int __pyx_lineno = 0;
14520 const char *__pyx_filename = NULL;
14521 int __pyx_clineno = 0;
14522 __Pyx_RefNannySetupContext(
"__setstate_cython__", 0);
14523 __Pyx_TraceCall(
"__setstate_cython__", __pyx_f[1], 3, 0, __PYX_ERR(1, 3, __pyx_L1_error));
14530 __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__31, NULL);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 4, __pyx_L1_error)
14531 __Pyx_GOTREF(__pyx_t_1);
14532 __Pyx_Raise(__pyx_t_1, 0, 0, 0);
14533 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
14534 __PYX_ERR(1, 4, __pyx_L1_error)
14545 __Pyx_XDECREF(__pyx_t_1);
14546 __Pyx_AddTraceback(
"View.MemoryView.memoryview.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
14548 __Pyx_XGIVEREF(__pyx_r);
14549 __Pyx_TraceReturn(__pyx_r, 0);
14550 __Pyx_RefNannyFinishContext();
14562 static PyObject *__pyx_memoryview_new(PyObject *__pyx_v_o,
int __pyx_v_flags,
int __pyx_v_dtype_is_object, __Pyx_TypeInfo *__pyx_v_typeinfo) {
14563 struct __pyx_memoryview_obj *__pyx_v_result = 0;
14564 PyObject *__pyx_r = NULL;
14565 __Pyx_TraceDeclarations
14566 __Pyx_RefNannyDeclarations
14567 PyObject *__pyx_t_1 = NULL;
14568 PyObject *__pyx_t_2 = NULL;
14569 PyObject *__pyx_t_3 = NULL;
14570 int __pyx_lineno = 0;
14571 const char *__pyx_filename = NULL;
14572 int __pyx_clineno = 0;
14573 __Pyx_RefNannySetupContext(
"memoryview_cwrapper", 0);
14574 __Pyx_TraceCall(
"memoryview_cwrapper", __pyx_f[1], 657, 0, __PYX_ERR(1, 657, __pyx_L1_error));
14583 __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_flags);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 658, __pyx_L1_error)
14584 __Pyx_GOTREF(__pyx_t_1);
14585 __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_v_dtype_is_object);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 658, __pyx_L1_error)
14586 __Pyx_GOTREF(__pyx_t_2);
14587 __pyx_t_3 = PyTuple_New(3);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 658, __pyx_L1_error)
14588 __Pyx_GOTREF(__pyx_t_3);
14589 __Pyx_INCREF(__pyx_v_o);
14590 __Pyx_GIVEREF(__pyx_v_o);
14591 PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_o);
14592 __Pyx_GIVEREF(__pyx_t_1);
14593 PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_1);
14594 __Pyx_GIVEREF(__pyx_t_2);
14595 PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_t_2);
14598 __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_memoryview_type), __pyx_t_3, NULL);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 658, __pyx_L1_error)
14599 __Pyx_GOTREF(__pyx_t_2);
14600 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
14601 __pyx_v_result = ((
struct __pyx_memoryview_obj *)__pyx_t_2);
14611 __pyx_v_result->typeinfo = __pyx_v_typeinfo;
14620 __Pyx_XDECREF(__pyx_r);
14621 __Pyx_INCREF(((PyObject *)__pyx_v_result));
14622 __pyx_r = ((PyObject *)__pyx_v_result);
14635 __Pyx_XDECREF(__pyx_t_1);
14636 __Pyx_XDECREF(__pyx_t_2);
14637 __Pyx_XDECREF(__pyx_t_3);
14638 __Pyx_AddTraceback(
"View.MemoryView.memoryview_cwrapper", __pyx_clineno, __pyx_lineno, __pyx_filename);
14641 __Pyx_XDECREF((PyObject *)__pyx_v_result);
14642 __Pyx_XGIVEREF(__pyx_r);
14643 __Pyx_TraceReturn(__pyx_r, 0);
14644 __Pyx_RefNannyFinishContext();
14656 static CYTHON_INLINE
int __pyx_memoryview_check(PyObject *__pyx_v_o) {
14658 __Pyx_TraceDeclarations
14659 __Pyx_RefNannyDeclarations
14661 int __pyx_lineno = 0;
14662 const char *__pyx_filename = NULL;
14663 int __pyx_clineno = 0;
14664 __Pyx_RefNannySetupContext(
"memoryview_check", 0);
14665 __Pyx_TraceCall(
"memoryview_check", __pyx_f[1], 663, 0, __PYX_ERR(1, 663, __pyx_L1_error));
14674 __pyx_t_1 = __Pyx_TypeCheck(__pyx_v_o, __pyx_memoryview_type);
14675 __pyx_r = __pyx_t_1;
14688 __Pyx_WriteUnraisable(
"View.MemoryView.memoryview_check", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
14691 __Pyx_TraceReturn(Py_None, 0);
14692 __Pyx_RefNannyFinishContext();
14704 static PyObject *_unellipsify(PyObject *__pyx_v_index,
int __pyx_v_ndim) {
14705 PyObject *__pyx_v_tup = NULL;
14706 PyObject *__pyx_v_result = NULL;
14707 int __pyx_v_have_slices;
14708 int __pyx_v_seen_ellipsis;
14709 CYTHON_UNUSED PyObject *__pyx_v_idx = NULL;
14710 PyObject *__pyx_v_item = NULL;
14711 Py_ssize_t __pyx_v_nslices;
14712 PyObject *__pyx_r = NULL;
14713 __Pyx_TraceDeclarations
14714 __Pyx_RefNannyDeclarations
14717 PyObject *__pyx_t_3 = NULL;
14718 PyObject *__pyx_t_4 = NULL;
14719 Py_ssize_t __pyx_t_5;
14720 PyObject *(*__pyx_t_6)(PyObject *);
14721 PyObject *__pyx_t_7 = NULL;
14722 Py_ssize_t __pyx_t_8;
14725 PyObject *__pyx_t_11 = NULL;
14726 int __pyx_lineno = 0;
14727 const char *__pyx_filename = NULL;
14728 int __pyx_clineno = 0;
14729 __Pyx_RefNannySetupContext(
"_unellipsify", 0);
14730 __Pyx_TraceCall(
"_unellipsify", __pyx_f[1], 666, 0, __PYX_ERR(1, 666, __pyx_L1_error));
14739 __pyx_t_1 = PyTuple_Check(__pyx_v_index);
14740 __pyx_t_2 = ((!(__pyx_t_1 != 0)) != 0);
14750 __pyx_t_3 = PyTuple_New(1);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 672, __pyx_L1_error)
14751 __Pyx_GOTREF(__pyx_t_3);
14752 __Pyx_INCREF(__pyx_v_index);
14753 __Pyx_GIVEREF(__pyx_v_index);
14754 PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_index);
14755 __pyx_v_tup = __pyx_t_3;
14776 __Pyx_INCREF(__pyx_v_index);
14777 __pyx_v_tup = __pyx_v_index;
14788 __pyx_t_3 = PyList_New(0);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 676, __pyx_L1_error)
14789 __Pyx_GOTREF(__pyx_t_3);
14790 __pyx_v_result = ((PyObject*)__pyx_t_3);
14800 __pyx_v_have_slices = 0;
14809 __pyx_v_seen_ellipsis = 0;
14818 __Pyx_INCREF(__pyx_int_0);
14819 __pyx_t_3 = __pyx_int_0;
14820 if (likely(PyList_CheckExact(__pyx_v_tup)) || PyTuple_CheckExact(__pyx_v_tup)) {
14821 __pyx_t_4 = __pyx_v_tup; __Pyx_INCREF(__pyx_t_4); __pyx_t_5 = 0;
14824 __pyx_t_5 = -1; __pyx_t_4 = PyObject_GetIter(__pyx_v_tup);
if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 679, __pyx_L1_error)
14825 __Pyx_GOTREF(__pyx_t_4);
14826 __pyx_t_6 = Py_TYPE(__pyx_t_4)->tp_iternext;
if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 679, __pyx_L1_error)
14829 if (likely(!__pyx_t_6)) {
14830 if (likely(PyList_CheckExact(__pyx_t_4))) {
14831 if (__pyx_t_5 >= PyList_GET_SIZE(__pyx_t_4))
break;
14832 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
14833 __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(1, 679, __pyx_L1_error)
14835 __pyx_t_7 = PySequence_ITEM(__pyx_t_4, __pyx_t_5); __pyx_t_5++;
if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 679, __pyx_L1_error)
14836 __Pyx_GOTREF(__pyx_t_7);
14839 if (__pyx_t_5 >= PyTuple_GET_SIZE(__pyx_t_4))
break;
14840 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
14841 __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(1, 679, __pyx_L1_error)
14843 __pyx_t_7 = PySequence_ITEM(__pyx_t_4, __pyx_t_5); __pyx_t_5++;
if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 679, __pyx_L1_error)
14844 __Pyx_GOTREF(__pyx_t_7);
14848 __pyx_t_7 = __pyx_t_6(__pyx_t_4);
14849 if (unlikely(!__pyx_t_7)) {
14850 PyObject* exc_type = PyErr_Occurred();
14852 if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
14853 else __PYX_ERR(1, 679, __pyx_L1_error)
14857 __Pyx_GOTREF(__pyx_t_7);
14859 __Pyx_XDECREF_SET(__pyx_v_item, __pyx_t_7);
14861 __Pyx_INCREF(__pyx_t_3);
14862 __Pyx_XDECREF_SET(__pyx_v_idx, __pyx_t_3);
14863 __pyx_t_7 = __Pyx_PyInt_AddObjC(__pyx_t_3, __pyx_int_1, 1, 0, 0);
if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 679, __pyx_L1_error)
14864 __Pyx_GOTREF(__pyx_t_7);
14865 __Pyx_DECREF(__pyx_t_3);
14866 __pyx_t_3 = __pyx_t_7;
14876 __pyx_t_2 = (__pyx_v_item == __pyx_builtin_Ellipsis);
14877 __pyx_t_1 = (__pyx_t_2 != 0);
14887 __pyx_t_1 = ((!(__pyx_v_seen_ellipsis != 0)) != 0);
14897 __pyx_t_8 = PyObject_Length(__pyx_v_tup);
if (unlikely(__pyx_t_8 == ((Py_ssize_t)-1))) __PYX_ERR(1, 682, __pyx_L1_error)
14898 __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(1, 682, __pyx_L1_error)
14899 __Pyx_GOTREF(__pyx_t_7);
14900 { Py_ssize_t __pyx_temp;
14901 for (__pyx_temp=0; __pyx_temp < ((__pyx_v_ndim - __pyx_t_8) + 1); __pyx_temp++) {
14902 __Pyx_INCREF(__pyx_slice__7);
14903 __Pyx_GIVEREF(__pyx_slice__7);
14904 PyList_SET_ITEM(__pyx_t_7, __pyx_temp, __pyx_slice__7);
14907 __pyx_t_9 = __Pyx_PyList_Extend(__pyx_v_result, __pyx_t_7);
if (unlikely(__pyx_t_9 == ((
int)-1))) __PYX_ERR(1, 682, __pyx_L1_error)
14908 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
14917 __pyx_v_seen_ellipsis = 1;
14937 __pyx_t_9 = __Pyx_PyList_Append(__pyx_v_result, __pyx_slice__7);
if (unlikely(__pyx_t_9 == ((
int)-1))) __PYX_ERR(1, 685, __pyx_L1_error)
14948 __pyx_v_have_slices = 1;
14968 __pyx_t_2 = PySlice_Check(__pyx_v_item);
14969 __pyx_t_10 = ((!(__pyx_t_2 != 0)) != 0);
14972 __pyx_t_1 = __pyx_t_10;
14973 goto __pyx_L9_bool_binop_done;
14975 __pyx_t_10 = ((!(PyIndex_Check(__pyx_v_item) != 0)) != 0);
14976 __pyx_t_1 = __pyx_t_10;
14977 __pyx_L9_bool_binop_done:;
14978 if (unlikely(__pyx_t_1)) {
14987 __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(1, 689, __pyx_L1_error)
14988 __Pyx_GOTREF(__pyx_t_7);
14989 __pyx_t_11 = __Pyx_PyObject_CallOneArg(__pyx_builtin_TypeError, __pyx_t_7);
if (unlikely(!__pyx_t_11)) __PYX_ERR(1, 689, __pyx_L1_error)
14990 __Pyx_GOTREF(__pyx_t_11);
14991 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
14992 __Pyx_Raise(__pyx_t_11, 0, 0, 0);
14993 __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
14994 __PYX_ERR(1, 689, __pyx_L1_error)
15012 __pyx_t_10 = (__pyx_v_have_slices != 0);
15015 __pyx_t_1 = __pyx_t_10;
15016 goto __pyx_L11_bool_binop_done;
15018 __pyx_t_10 = PySlice_Check(__pyx_v_item);
15019 __pyx_t_2 = (__pyx_t_10 != 0);
15020 __pyx_t_1 = __pyx_t_2;
15021 __pyx_L11_bool_binop_done:;
15022 __pyx_v_have_slices = __pyx_t_1;
15031 __pyx_t_9 = __Pyx_PyList_Append(__pyx_v_result, __pyx_v_item);
if (unlikely(__pyx_t_9 == ((
int)-1))) __PYX_ERR(1, 692, __pyx_L1_error)
15043 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
15044 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
15053 __pyx_t_5 = PyList_GET_SIZE(__pyx_v_result);
if (unlikely(__pyx_t_5 == ((Py_ssize_t)-1))) __PYX_ERR(1, 694, __pyx_L1_error)
15054 __pyx_v_nslices = (__pyx_v_ndim - __pyx_t_5);
15063 __pyx_t_1 = (__pyx_v_nslices != 0);
15073 __pyx_t_3 = PyList_New(1 * ((__pyx_v_nslices<0) ? 0:__pyx_v_nslices));
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 696, __pyx_L1_error)
15074 __Pyx_GOTREF(__pyx_t_3);
15075 { Py_ssize_t __pyx_temp;
15076 for (__pyx_temp=0; __pyx_temp < __pyx_v_nslices; __pyx_temp++) {
15077 __Pyx_INCREF(__pyx_slice__7);
15078 __Pyx_GIVEREF(__pyx_slice__7);
15079 PyList_SET_ITEM(__pyx_t_3, __pyx_temp, __pyx_slice__7);
15082 __pyx_t_9 = __Pyx_PyList_Extend(__pyx_v_result, __pyx_t_3);
if (unlikely(__pyx_t_9 == ((
int)-1))) __PYX_ERR(1, 696, __pyx_L1_error)
15083 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
15101 __Pyx_XDECREF(__pyx_r);
15102 if (!__pyx_v_have_slices) {
15104 __pyx_t_4 = __Pyx_PyBool_FromLong(__pyx_v_have_slices);
if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 698, __pyx_L1_error)
15105 __Pyx_GOTREF(__pyx_t_4);
15106 __pyx_t_3 = __pyx_t_4;
15108 goto __pyx_L14_bool_binop_done;
15110 __pyx_t_4 = PyInt_FromSsize_t(__pyx_v_nslices);
if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 698, __pyx_L1_error)
15111 __Pyx_GOTREF(__pyx_t_4);
15112 __pyx_t_3 = __pyx_t_4;
15114 __pyx_L14_bool_binop_done:;
15115 __pyx_t_4 = PyList_AsTuple(__pyx_v_result);
if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 698, __pyx_L1_error)
15116 __Pyx_GOTREF(__pyx_t_4);
15117 __pyx_t_11 = PyTuple_New(2);
if (unlikely(!__pyx_t_11)) __PYX_ERR(1, 698, __pyx_L1_error)
15118 __Pyx_GOTREF(__pyx_t_11);
15119 __Pyx_GIVEREF(__pyx_t_3);
15120 PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_t_3);
15121 __Pyx_GIVEREF(__pyx_t_4);
15122 PyTuple_SET_ITEM(__pyx_t_11, 1, __pyx_t_4);
15125 __pyx_r = ((PyObject*)__pyx_t_11);
15139 __Pyx_XDECREF(__pyx_t_3);
15140 __Pyx_XDECREF(__pyx_t_4);
15141 __Pyx_XDECREF(__pyx_t_7);
15142 __Pyx_XDECREF(__pyx_t_11);
15143 __Pyx_AddTraceback(
"View.MemoryView._unellipsify", __pyx_clineno, __pyx_lineno, __pyx_filename);
15146 __Pyx_XDECREF(__pyx_v_tup);
15147 __Pyx_XDECREF(__pyx_v_result);
15148 __Pyx_XDECREF(__pyx_v_idx);
15149 __Pyx_XDECREF(__pyx_v_item);
15150 __Pyx_XGIVEREF(__pyx_r);
15151 __Pyx_TraceReturn(__pyx_r, 0);
15152 __Pyx_RefNannyFinishContext();
15164 static PyObject *assert_direct_dimensions(Py_ssize_t *__pyx_v_suboffsets,
int __pyx_v_ndim) {
15165 Py_ssize_t __pyx_v_suboffset;
15166 PyObject *__pyx_r = NULL;
15167 __Pyx_TraceDeclarations
15168 __Pyx_RefNannyDeclarations
15169 Py_ssize_t *__pyx_t_1;
15170 Py_ssize_t *__pyx_t_2;
15171 Py_ssize_t *__pyx_t_3;
15173 PyObject *__pyx_t_5 = NULL;
15174 int __pyx_lineno = 0;
15175 const char *__pyx_filename = NULL;
15176 int __pyx_clineno = 0;
15177 __Pyx_RefNannySetupContext(
"assert_direct_dimensions", 0);
15178 __Pyx_TraceCall(
"assert_direct_dimensions", __pyx_f[1], 700, 0, __PYX_ERR(1, 700, __pyx_L1_error));
15187 __pyx_t_2 = (__pyx_v_suboffsets + __pyx_v_ndim);
15188 for (__pyx_t_3 = __pyx_v_suboffsets; __pyx_t_3 < __pyx_t_2; __pyx_t_3++) {
15189 __pyx_t_1 = __pyx_t_3;
15190 __pyx_v_suboffset = (__pyx_t_1[0]);
15199 __pyx_t_4 = ((__pyx_v_suboffset >= 0) != 0);
15200 if (unlikely(__pyx_t_4)) {
15209 __pyx_t_5 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__32, NULL);
if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 703, __pyx_L1_error)
15210 __Pyx_GOTREF(__pyx_t_5);
15211 __Pyx_Raise(__pyx_t_5, 0, 0, 0);
15212 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
15213 __PYX_ERR(1, 703, __pyx_L1_error)
15234 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
15237 __Pyx_XDECREF(__pyx_t_5);
15238 __Pyx_AddTraceback(
"View.MemoryView.assert_direct_dimensions", __pyx_clineno, __pyx_lineno, __pyx_filename);
15241 __Pyx_XGIVEREF(__pyx_r);
15242 __Pyx_TraceReturn(__pyx_r, 0);
15243 __Pyx_RefNannyFinishContext();
15255 static struct __pyx_memoryview_obj *__pyx_memview_slice(
struct __pyx_memoryview_obj *__pyx_v_memview, PyObject *__pyx_v_indices) {
15256 int __pyx_v_new_ndim;
15257 int __pyx_v_suboffset_dim;
15259 __Pyx_memviewslice __pyx_v_src;
15260 __Pyx_memviewslice __pyx_v_dst;
15261 __Pyx_memviewslice *__pyx_v_p_src;
15262 struct __pyx_memoryviewslice_obj *__pyx_v_memviewsliceobj = 0;
15263 __Pyx_memviewslice *__pyx_v_p_dst;
15264 int *__pyx_v_p_suboffset_dim;
15265 Py_ssize_t __pyx_v_start;
15266 Py_ssize_t __pyx_v_stop;
15267 Py_ssize_t __pyx_v_step;
15268 int __pyx_v_have_start;
15269 int __pyx_v_have_stop;
15270 int __pyx_v_have_step;
15271 PyObject *__pyx_v_index = NULL;
15272 struct __pyx_memoryview_obj *__pyx_r = NULL;
15273 __Pyx_TraceDeclarations
15274 __Pyx_RefNannyDeclarations
15277 PyObject *__pyx_t_3 = NULL;
15278 struct __pyx_memoryview_obj *__pyx_t_4;
15281 Py_ssize_t __pyx_t_7;
15282 PyObject *(*__pyx_t_8)(PyObject *);
15283 PyObject *__pyx_t_9 = NULL;
15284 Py_ssize_t __pyx_t_10;
15286 Py_ssize_t __pyx_t_12;
15287 int __pyx_lineno = 0;
15288 const char *__pyx_filename = NULL;
15289 int __pyx_clineno = 0;
15290 __Pyx_RefNannySetupContext(
"memview_slice", 0);
15291 __Pyx_TraceCall(
"memview_slice", __pyx_f[1], 710, 0, __PYX_ERR(1, 710, __pyx_L1_error));
15300 __pyx_v_new_ndim = 0;
15301 __pyx_v_suboffset_dim = -1;
15310 (void)(memset((&__pyx_v_dst), 0, (
sizeof(__pyx_v_dst))));
15319 #ifndef CYTHON_WITHOUT_ASSERTIONS
15320 if (unlikely(!Py_OptimizeFlag)) {
15321 if (unlikely(!((__pyx_v_memview->view.ndim > 0) != 0))) {
15322 PyErr_SetNone(PyExc_AssertionError);
15323 __PYX_ERR(1, 722, __pyx_L1_error)
15335 __pyx_t_1 = __Pyx_TypeCheck(((PyObject *)__pyx_v_memview), __pyx_memoryviewslice_type);
15336 __pyx_t_2 = (__pyx_t_1 != 0);
15346 if (!(likely(((((PyObject *)__pyx_v_memview)) == Py_None) || likely(__Pyx_TypeTest(((PyObject *)__pyx_v_memview), __pyx_memoryviewslice_type))))) __PYX_ERR(1, 725, __pyx_L1_error)
15347 __pyx_t_3 = ((PyObject *)__pyx_v_memview);
15348 __Pyx_INCREF(__pyx_t_3);
15349 __pyx_v_memviewsliceobj = ((
struct __pyx_memoryviewslice_obj *)__pyx_t_3);
15359 __pyx_v_p_src = (&__pyx_v_memviewsliceobj->from_slice);
15379 __pyx_memoryview_slice_copy(__pyx_v_memview, (&__pyx_v_src));
15388 __pyx_v_p_src = (&__pyx_v_src);
15399 __pyx_t_4 = __pyx_v_p_src->memview;
15400 __pyx_v_dst.memview = __pyx_t_4;
15409 __pyx_t_5 = __pyx_v_p_src->data;
15410 __pyx_v_dst.data = __pyx_t_5;
15419 __pyx_v_p_dst = (&__pyx_v_dst);
15428 __pyx_v_p_suboffset_dim = (&__pyx_v_suboffset_dim);
15438 if (likely(PyList_CheckExact(__pyx_v_indices)) || PyTuple_CheckExact(__pyx_v_indices)) {
15439 __pyx_t_3 = __pyx_v_indices; __Pyx_INCREF(__pyx_t_3); __pyx_t_7 = 0;
15442 __pyx_t_7 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_v_indices);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 746, __pyx_L1_error)
15443 __Pyx_GOTREF(__pyx_t_3);
15444 __pyx_t_8 = Py_TYPE(__pyx_t_3)->tp_iternext;
if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 746, __pyx_L1_error)
15447 if (likely(!__pyx_t_8)) {
15448 if (likely(PyList_CheckExact(__pyx_t_3))) {
15449 if (__pyx_t_7 >= PyList_GET_SIZE(__pyx_t_3))
break;
15450 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
15451 __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(1, 746, __pyx_L1_error)
15453 __pyx_t_9 = PySequence_ITEM(__pyx_t_3, __pyx_t_7); __pyx_t_7++;
if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 746, __pyx_L1_error)
15454 __Pyx_GOTREF(__pyx_t_9);
15457 if (__pyx_t_7 >= PyTuple_GET_SIZE(__pyx_t_3))
break;
15458 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
15459 __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(1, 746, __pyx_L1_error)
15461 __pyx_t_9 = PySequence_ITEM(__pyx_t_3, __pyx_t_7); __pyx_t_7++;
if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 746, __pyx_L1_error)
15462 __Pyx_GOTREF(__pyx_t_9);
15466 __pyx_t_9 = __pyx_t_8(__pyx_t_3);
15467 if (unlikely(!__pyx_t_9)) {
15468 PyObject* exc_type = PyErr_Occurred();
15470 if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
15471 else __PYX_ERR(1, 746, __pyx_L1_error)
15475 __Pyx_GOTREF(__pyx_t_9);
15477 __Pyx_XDECREF_SET(__pyx_v_index, __pyx_t_9);
15479 __pyx_v_dim = __pyx_t_6;
15480 __pyx_t_6 = (__pyx_t_6 + 1);
15489 __pyx_t_2 = (PyIndex_Check(__pyx_v_index) != 0);
15499 __pyx_t_10 = __Pyx_PyIndex_AsSsize_t(__pyx_v_index);
if (unlikely((__pyx_t_10 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(1, 751, __pyx_L1_error)
15508 __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(1, 748, __pyx_L1_error)
15527 __pyx_t_2 = (__pyx_v_index == Py_None);
15528 __pyx_t_1 = (__pyx_t_2 != 0);
15538 (__pyx_v_p_dst->shape[__pyx_v_new_ndim]) = 1;
15547 (__pyx_v_p_dst->strides[__pyx_v_new_ndim]) = 0;
15556 (__pyx_v_p_dst->suboffsets[__pyx_v_new_ndim]) = -1
L;
15565 __pyx_v_new_ndim = (__pyx_v_new_ndim + 1);
15585 __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_start);
if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 760, __pyx_L1_error)
15586 __Pyx_GOTREF(__pyx_t_9);
15587 __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_9);
if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(1, 760, __pyx_L1_error)
15589 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
15591 __pyx_t_12 = __Pyx_PyIndex_AsSsize_t(__pyx_t_9);
if (unlikely((__pyx_t_12 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(1, 760, __pyx_L1_error)
15592 __pyx_t_10 = __pyx_t_12;
15593 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
15594 goto __pyx_L7_bool_binop_done;
15597 __pyx_L7_bool_binop_done:;
15598 __pyx_v_start = __pyx_t_10;
15607 __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_stop);
if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 761, __pyx_L1_error)
15608 __Pyx_GOTREF(__pyx_t_9);
15609 __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_9);
if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(1, 761, __pyx_L1_error)
15611 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
15613 __pyx_t_12 = __Pyx_PyIndex_AsSsize_t(__pyx_t_9);
if (unlikely((__pyx_t_12 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(1, 761, __pyx_L1_error)
15614 __pyx_t_10 = __pyx_t_12;
15615 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
15616 goto __pyx_L9_bool_binop_done;
15619 __pyx_L9_bool_binop_done:;
15620 __pyx_v_stop = __pyx_t_10;
15629 __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_step);
if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 762, __pyx_L1_error)
15630 __Pyx_GOTREF(__pyx_t_9);
15631 __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_9);
if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(1, 762, __pyx_L1_error)
15633 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
15635 __pyx_t_12 = __Pyx_PyIndex_AsSsize_t(__pyx_t_9);
if (unlikely((__pyx_t_12 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(1, 762, __pyx_L1_error)
15636 __pyx_t_10 = __pyx_t_12;
15637 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
15638 goto __pyx_L11_bool_binop_done;
15641 __pyx_L11_bool_binop_done:;
15642 __pyx_v_step = __pyx_t_10;
15651 __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_start);
if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 764, __pyx_L1_error)
15652 __Pyx_GOTREF(__pyx_t_9);
15653 __pyx_t_1 = (__pyx_t_9 != Py_None);
15654 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
15655 __pyx_v_have_start = __pyx_t_1;
15664 __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_stop);
if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 765, __pyx_L1_error)
15665 __Pyx_GOTREF(__pyx_t_9);
15666 __pyx_t_1 = (__pyx_t_9 != Py_None);
15667 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
15668 __pyx_v_have_stop = __pyx_t_1;
15677 __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_step);
if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 766, __pyx_L1_error)
15678 __Pyx_GOTREF(__pyx_t_9);
15679 __pyx_t_1 = (__pyx_t_9 != Py_None);
15680 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
15681 __pyx_v_have_step = __pyx_t_1;
15690 __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(1, 768, __pyx_L1_error)
15699 __pyx_v_new_ndim = (__pyx_v_new_ndim + 1);
15711 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
15720 __pyx_t_1 = __Pyx_TypeCheck(((PyObject *)__pyx_v_memview), __pyx_memoryviewslice_type);
15721 __pyx_t_2 = (__pyx_t_1 != 0);
15731 __Pyx_XDECREF(((PyObject *)__pyx_r));
15740 if (unlikely(!__pyx_v_memviewsliceobj)) { __Pyx_RaiseUnboundLocalError(
"memviewsliceobj"); __PYX_ERR(1, 778, __pyx_L1_error) }
15749 if (unlikely(!__pyx_v_memviewsliceobj)) { __Pyx_RaiseUnboundLocalError(
"memviewsliceobj"); __PYX_ERR(1, 779, __pyx_L1_error) }
15758 __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(1, 777, __pyx_L1_error)
15759 __Pyx_GOTREF(__pyx_t_3);
15760 if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_memoryview_type))))) __PYX_ERR(1, 777, __pyx_L1_error)
15761 __pyx_r = ((
struct __pyx_memoryview_obj *)__pyx_t_3);
15782 __Pyx_XDECREF(((PyObject *)__pyx_r));
15791 __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(1, 782, __pyx_L1_error)
15792 __Pyx_GOTREF(__pyx_t_3);
15801 if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_memoryview_type))))) __PYX_ERR(1, 782, __pyx_L1_error)
15802 __pyx_r = ((
struct __pyx_memoryview_obj *)__pyx_t_3);
15817 __Pyx_XDECREF(__pyx_t_3);
15818 __Pyx_XDECREF(__pyx_t_9);
15819 __Pyx_AddTraceback(
"View.MemoryView.memview_slice", __pyx_clineno, __pyx_lineno, __pyx_filename);
15822 __Pyx_XDECREF((PyObject *)__pyx_v_memviewsliceobj);
15823 __Pyx_XDECREF(__pyx_v_index);
15824 __Pyx_XGIVEREF((PyObject *)__pyx_r);
15825 __Pyx_TraceReturn(__pyx_r, 0);
15826 __Pyx_RefNannyFinishContext();
15838 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) {
15839 Py_ssize_t __pyx_v_new_shape;
15840 int __pyx_v_negative_step;
15842 __Pyx_TraceDeclarations
15846 int __pyx_lineno = 0;
15847 const char *__pyx_filename = NULL;
15848 int __pyx_clineno = 0;
15849 __Pyx_TraceCall(
"slice_memviewslice", __pyx_f[1], 807, 1, __PYX_ERR(1, 807, __pyx_L1_error));
15858 __pyx_t_1 = ((!(__pyx_v_is_slice != 0)) != 0);
15868 __pyx_t_1 = ((__pyx_v_start < 0) != 0);
15878 __pyx_v_start = (__pyx_v_start + __pyx_v_shape);
15896 __pyx_t_1 = (0 <= __pyx_v_start);
15898 __pyx_t_1 = (__pyx_v_start < __pyx_v_shape);
15900 __pyx_t_2 = ((!(__pyx_t_1 != 0)) != 0);
15910 __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(1, 832, __pyx_L1_error)
15939 __pyx_t_1 = ((__pyx_v_have_step != 0) != 0);
15942 __pyx_t_2 = __pyx_t_1;
15943 goto __pyx_L6_bool_binop_done;
15945 __pyx_t_1 = ((__pyx_v_step < 0) != 0);
15946 __pyx_t_2 = __pyx_t_1;
15947 __pyx_L6_bool_binop_done:;
15948 __pyx_v_negative_step = __pyx_t_2;
15957 __pyx_t_1 = (__pyx_v_have_step != 0);
15960 __pyx_t_2 = __pyx_t_1;
15961 goto __pyx_L9_bool_binop_done;
15963 __pyx_t_1 = ((__pyx_v_step == 0) != 0);
15964 __pyx_t_2 = __pyx_t_1;
15965 __pyx_L9_bool_binop_done:;
15975 __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(1, 838, __pyx_L1_error)
15993 __pyx_t_2 = (__pyx_v_have_start != 0);
16003 __pyx_t_2 = ((__pyx_v_start < 0) != 0);
16013 __pyx_v_start = (__pyx_v_start + __pyx_v_shape);
16022 __pyx_t_2 = ((__pyx_v_start < 0) != 0);
16060 __pyx_t_2 = ((__pyx_v_start >= __pyx_v_shape) != 0);
16070 __pyx_t_2 = (__pyx_v_negative_step != 0);
16080 __pyx_v_start = (__pyx_v_shape - 1);
16100 __pyx_v_start = __pyx_v_shape;
16132 __pyx_t_2 = (__pyx_v_negative_step != 0);
16142 __pyx_v_start = (__pyx_v_shape - 1);
16175 __pyx_t_2 = (__pyx_v_have_stop != 0);
16185 __pyx_t_2 = ((__pyx_v_stop < 0) != 0);
16195 __pyx_v_stop = (__pyx_v_stop + __pyx_v_shape);
16204 __pyx_t_2 = ((__pyx_v_stop < 0) != 0);
16242 __pyx_t_2 = ((__pyx_v_stop > __pyx_v_shape) != 0);
16252 __pyx_v_stop = __pyx_v_shape;
16282 __pyx_t_2 = (__pyx_v_negative_step != 0);
16292 __pyx_v_stop = -1
L;
16312 __pyx_v_stop = __pyx_v_shape;
16325 __pyx_t_2 = ((!(__pyx_v_have_step != 0)) != 0);
16353 __pyx_v_new_shape = ((__pyx_v_stop - __pyx_v_start) / __pyx_v_step);
16362 __pyx_t_2 = (((__pyx_v_stop - __pyx_v_start) - (__pyx_v_step * __pyx_v_new_shape)) != 0);
16372 __pyx_v_new_shape = (__pyx_v_new_shape + 1);
16390 __pyx_t_2 = ((__pyx_v_new_shape < 0) != 0);
16400 __pyx_v_new_shape = 0;
16418 (__pyx_v_dst->strides[__pyx_v_new_ndim]) = (__pyx_v_stride * __pyx_v_step);
16427 (__pyx_v_dst->shape[__pyx_v_new_ndim]) = __pyx_v_new_shape;
16436 (__pyx_v_dst->suboffsets[__pyx_v_new_ndim]) = __pyx_v_suboffset;
16447 __pyx_t_2 = (((__pyx_v_suboffset_dim[0]) < 0) != 0);
16457 __pyx_v_dst->data = (__pyx_v_dst->data + (__pyx_v_start * __pyx_v_stride));
16477 __pyx_t_3 = (__pyx_v_suboffset_dim[0]);
16478 (__pyx_v_dst->suboffsets[__pyx_t_3]) = ((__pyx_v_dst->suboffsets[__pyx_t_3]) + (__pyx_v_start * __pyx_v_stride));
16489 __pyx_t_2 = ((__pyx_v_suboffset >= 0) != 0);
16499 __pyx_t_2 = ((!(__pyx_v_is_slice != 0)) != 0);
16509 __pyx_t_2 = ((__pyx_v_new_ndim == 0) != 0);
16519 __pyx_v_dst->data = ((((
char **)__pyx_v_dst->data)[0]) + __pyx_v_suboffset);
16547 __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(1, 899, __pyx_L1_error)
16569 (__pyx_v_suboffset_dim[0]) = __pyx_v_new_ndim;
16604 PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
16606 __Pyx_AddTraceback(
"View.MemoryView.slice_memviewslice", __pyx_clineno, __pyx_lineno, __pyx_filename);
16608 __Pyx_PyGILState_Release(__pyx_gilstate_save);
16613 __Pyx_TraceReturn(Py_None, 1);
16625 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) {
16626 Py_ssize_t __pyx_v_shape;
16627 Py_ssize_t __pyx_v_stride;
16628 Py_ssize_t __pyx_v_suboffset;
16629 Py_ssize_t __pyx_v_itemsize;
16630 char *__pyx_v_resultp;
16632 __Pyx_TraceDeclarations
16633 __Pyx_RefNannyDeclarations
16634 Py_ssize_t __pyx_t_1;
16636 PyObject *__pyx_t_3 = NULL;
16637 PyObject *__pyx_t_4 = NULL;
16638 int __pyx_lineno = 0;
16639 const char *__pyx_filename = NULL;
16640 int __pyx_clineno = 0;
16641 __Pyx_RefNannySetupContext(
"pybuffer_index", 0);
16642 __Pyx_TraceCall(
"pybuffer_index", __pyx_f[1], 910, 0, __PYX_ERR(1, 910, __pyx_L1_error));
16651 __pyx_v_suboffset = -1
L;
16660 __pyx_t_1 = __pyx_v_view->itemsize;
16661 __pyx_v_itemsize = __pyx_t_1;
16670 __pyx_t_2 = ((__pyx_v_view->ndim == 0) != 0);
16680 if (unlikely(__pyx_v_itemsize == 0)) {
16681 PyErr_SetString(PyExc_ZeroDivisionError,
"integer division or modulo by zero");
16682 __PYX_ERR(1, 917, __pyx_L1_error)
16684 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))) {
16685 PyErr_SetString(PyExc_OverflowError,
"value too large to perform division");
16686 __PYX_ERR(1, 917, __pyx_L1_error)
16688 __pyx_v_shape = __Pyx_div_Py_ssize_t(__pyx_v_view->len, __pyx_v_itemsize);
16697 __pyx_v_stride = __pyx_v_itemsize;
16717 __pyx_v_shape = (__pyx_v_view->shape[__pyx_v_dim]);
16726 __pyx_v_stride = (__pyx_v_view->strides[__pyx_v_dim]);
16735 __pyx_t_2 = ((__pyx_v_view->suboffsets != NULL) != 0);
16745 __pyx_v_suboffset = (__pyx_v_view->suboffsets[__pyx_v_dim]);
16765 __pyx_t_2 = ((__pyx_v_index < 0) != 0);
16775 __pyx_v_index = (__pyx_v_index + (__pyx_v_view->shape[__pyx_v_dim]));
16784 __pyx_t_2 = ((__pyx_v_index < 0) != 0);
16785 if (unlikely(__pyx_t_2)) {
16794 __pyx_t_3 = PyInt_FromSsize_t(__pyx_v_dim);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 928, __pyx_L1_error)
16795 __Pyx_GOTREF(__pyx_t_3);
16796 __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(1, 928, __pyx_L1_error)
16797 __Pyx_GOTREF(__pyx_t_4);
16798 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
16799 __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_builtin_IndexError, __pyx_t_4);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 928, __pyx_L1_error)
16800 __Pyx_GOTREF(__pyx_t_3);
16801 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
16802 __Pyx_Raise(__pyx_t_3, 0, 0, 0);
16803 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
16804 __PYX_ERR(1, 928, __pyx_L1_error)
16831 __pyx_t_2 = ((__pyx_v_index >= __pyx_v_shape) != 0);
16832 if (unlikely(__pyx_t_2)) {
16841 __pyx_t_3 = PyInt_FromSsize_t(__pyx_v_dim);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 931, __pyx_L1_error)
16842 __Pyx_GOTREF(__pyx_t_3);
16843 __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(1, 931, __pyx_L1_error)
16844 __Pyx_GOTREF(__pyx_t_4);
16845 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
16846 __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_builtin_IndexError, __pyx_t_4);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 931, __pyx_L1_error)
16847 __Pyx_GOTREF(__pyx_t_3);
16848 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
16849 __Pyx_Raise(__pyx_t_3, 0, 0, 0);
16850 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
16851 __PYX_ERR(1, 931, __pyx_L1_error)
16869 __pyx_v_resultp = (__pyx_v_bufp + (__pyx_v_index * __pyx_v_stride));
16878 __pyx_t_2 = ((__pyx_v_suboffset >= 0) != 0);
16888 __pyx_v_resultp = ((((
char **)__pyx_v_resultp)[0]) + __pyx_v_suboffset);
16906 __pyx_r = __pyx_v_resultp;
16919 __Pyx_XDECREF(__pyx_t_3);
16920 __Pyx_XDECREF(__pyx_t_4);
16921 __Pyx_AddTraceback(
"View.MemoryView.pybuffer_index", __pyx_clineno, __pyx_lineno, __pyx_filename);
16924 __Pyx_TraceReturn(Py_None, 0);
16925 __Pyx_RefNannyFinishContext();
16937 static int __pyx_memslice_transpose(__Pyx_memviewslice *__pyx_v_memslice) {
16939 Py_ssize_t *__pyx_v_shape;
16940 Py_ssize_t *__pyx_v_strides;
16944 __Pyx_TraceDeclarations
16946 Py_ssize_t *__pyx_t_2;
16949 Py_ssize_t __pyx_t_5;
16950 Py_ssize_t __pyx_t_6;
16954 int __pyx_lineno = 0;
16955 const char *__pyx_filename = NULL;
16956 int __pyx_clineno = 0;
16957 __Pyx_TraceCall(
"transpose_memslice", __pyx_f[1], 943, 1, __PYX_ERR(1, 943, __pyx_L1_error));
16966 __pyx_t_1 = __pyx_v_memslice->memview->view.ndim;
16967 __pyx_v_ndim = __pyx_t_1;
16976 __pyx_t_2 = __pyx_v_memslice->shape;
16977 __pyx_v_shape = __pyx_t_2;
16986 __pyx_t_2 = __pyx_v_memslice->strides;
16987 __pyx_v_strides = __pyx_t_2;
16996 __pyx_t_3 = __Pyx_div_long(__pyx_v_ndim, 2);
16997 __pyx_t_4 = __pyx_t_3;
16998 for (__pyx_t_1 = 0; __pyx_t_1 < __pyx_t_4; __pyx_t_1+=1) {
16999 __pyx_v_i = __pyx_t_1;
17008 __pyx_v_j = ((__pyx_v_ndim - 1) - __pyx_v_i);
17017 __pyx_t_5 = (__pyx_v_strides[__pyx_v_j]);
17018 __pyx_t_6 = (__pyx_v_strides[__pyx_v_i]);
17019 (__pyx_v_strides[__pyx_v_i]) = __pyx_t_5;
17020 (__pyx_v_strides[__pyx_v_j]) = __pyx_t_6;
17029 __pyx_t_6 = (__pyx_v_shape[__pyx_v_j]);
17030 __pyx_t_5 = (__pyx_v_shape[__pyx_v_i]);
17031 (__pyx_v_shape[__pyx_v_i]) = __pyx_t_6;
17032 (__pyx_v_shape[__pyx_v_j]) = __pyx_t_5;
17041 __pyx_t_8 = (((__pyx_v_memslice->suboffsets[__pyx_v_i]) >= 0) != 0);
17044 __pyx_t_7 = __pyx_t_8;
17045 goto __pyx_L6_bool_binop_done;
17047 __pyx_t_8 = (((__pyx_v_memslice->suboffsets[__pyx_v_j]) >= 0) != 0);
17048 __pyx_t_7 = __pyx_t_8;
17049 __pyx_L6_bool_binop_done:;
17059 __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(1, 957, __pyx_L1_error)
17093 PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
17095 __Pyx_AddTraceback(
"View.MemoryView.transpose_memslice", __pyx_clineno, __pyx_lineno, __pyx_filename);
17097 __Pyx_PyGILState_Release(__pyx_gilstate_save);
17102 __Pyx_TraceReturn(Py_None, 1);
17115 static void __pyx_memoryviewslice___dealloc__(PyObject *__pyx_v_self);
17116 static void __pyx_memoryviewslice___dealloc__(PyObject *__pyx_v_self) {
17117 __Pyx_RefNannyDeclarations
17118 __Pyx_RefNannySetupContext(
"__dealloc__ (wrapper)", 0);
17119 __pyx_memoryviewslice___pyx_pf_15View_dot_MemoryView_16_memoryviewslice___dealloc__(((
struct __pyx_memoryviewslice_obj *)__pyx_v_self));
17122 __Pyx_RefNannyFinishContext();
17125 static void __pyx_memoryviewslice___pyx_pf_15View_dot_MemoryView_16_memoryviewslice___dealloc__(
struct __pyx_memoryviewslice_obj *__pyx_v_self) {
17126 __Pyx_TraceDeclarations
17127 __Pyx_RefNannyDeclarations
17128 int __pyx_lineno = 0;
17129 const char *__pyx_filename = NULL;
17130 int __pyx_clineno = 0;
17131 __Pyx_RefNannySetupContext(
"__dealloc__", 0);
17132 __Pyx_TraceCall(
"__dealloc__", __pyx_f[1], 976, 0, __PYX_ERR(1, 976, __pyx_L1_error));
17141 __PYX_XDEC_MEMVIEW((&__pyx_v_self->from_slice), 1);
17154 __Pyx_WriteUnraisable(
"View.MemoryView._memoryviewslice.__dealloc__", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
17156 __Pyx_TraceReturn(Py_None, 0);
17157 __Pyx_RefNannyFinishContext();
17168 static PyObject *__pyx_memoryviewslice_convert_item_to_object(
struct __pyx_memoryviewslice_obj *__pyx_v_self,
char *__pyx_v_itemp) {
17169 PyObject *__pyx_r = NULL;
17170 __Pyx_TraceDeclarations
17171 __Pyx_RefNannyDeclarations
17173 PyObject *__pyx_t_2 = NULL;
17174 int __pyx_lineno = 0;
17175 const char *__pyx_filename = NULL;
17176 int __pyx_clineno = 0;
17177 __Pyx_RefNannySetupContext(
"convert_item_to_object", 0);
17178 __Pyx_TraceCall(
"convert_item_to_object", __pyx_f[1], 979, 0, __PYX_ERR(1, 979, __pyx_L1_error));
17187 __pyx_t_1 = ((__pyx_v_self->to_object_func != NULL) != 0);
17197 __Pyx_XDECREF(__pyx_r);
17198 __pyx_t_2 = __pyx_v_self->to_object_func(__pyx_v_itemp);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 981, __pyx_L1_error)
17199 __Pyx_GOTREF(__pyx_t_2);
17200 __pyx_r = __pyx_t_2;
17221 __Pyx_XDECREF(__pyx_r);
17222 __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(1, 983, __pyx_L1_error)
17223 __Pyx_GOTREF(__pyx_t_2);
17224 __pyx_r = __pyx_t_2;
17239 __Pyx_XDECREF(__pyx_t_2);
17240 __Pyx_AddTraceback(
"View.MemoryView._memoryviewslice.convert_item_to_object", __pyx_clineno, __pyx_lineno, __pyx_filename);
17243 __Pyx_XGIVEREF(__pyx_r);
17244 __Pyx_TraceReturn(__pyx_r, 0);
17245 __Pyx_RefNannyFinishContext();
17257 static PyObject *__pyx_memoryviewslice_assign_item_from_object(
struct __pyx_memoryviewslice_obj *__pyx_v_self,
char *__pyx_v_itemp, PyObject *__pyx_v_value) {
17258 PyObject *__pyx_r = NULL;
17259 __Pyx_TraceDeclarations
17260 __Pyx_RefNannyDeclarations
17263 PyObject *__pyx_t_3 = NULL;
17264 int __pyx_lineno = 0;
17265 const char *__pyx_filename = NULL;
17266 int __pyx_clineno = 0;
17267 __Pyx_RefNannySetupContext(
"assign_item_from_object", 0);
17268 __Pyx_TraceCall(
"assign_item_from_object", __pyx_f[1], 985, 0, __PYX_ERR(1, 985, __pyx_L1_error));
17277 __pyx_t_1 = ((__pyx_v_self->to_dtype_func != NULL) != 0);
17287 __pyx_t_2 = __pyx_v_self->to_dtype_func(__pyx_v_itemp, __pyx_v_value);
if (unlikely(__pyx_t_2 == ((
int)0))) __PYX_ERR(1, 987, __pyx_L1_error)
17307 __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(1, 989, __pyx_L1_error)
17308 __Pyx_GOTREF(__pyx_t_3);
17309 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
17322 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
17325 __Pyx_XDECREF(__pyx_t_3);
17326 __Pyx_AddTraceback(
"View.MemoryView._memoryviewslice.assign_item_from_object", __pyx_clineno, __pyx_lineno, __pyx_filename);
17329 __Pyx_XGIVEREF(__pyx_r);
17330 __Pyx_TraceReturn(__pyx_r, 0);
17331 __Pyx_RefNannyFinishContext();
17344 static PyObject *__pyx_pw_15View_dot_MemoryView_16_memoryviewslice_4base_1__get__(PyObject *__pyx_v_self);
17345 static PyObject *__pyx_pw_15View_dot_MemoryView_16_memoryviewslice_4base_1__get__(PyObject *__pyx_v_self) {
17346 PyObject *__pyx_r = 0;
17347 __Pyx_RefNannyDeclarations
17348 __Pyx_RefNannySetupContext(
"__get__ (wrapper)", 0);
17349 __pyx_r = __pyx_pf_15View_dot_MemoryView_16_memoryviewslice_4base___get__(((
struct __pyx_memoryviewslice_obj *)__pyx_v_self));
17352 __Pyx_RefNannyFinishContext();
17356 static PyObject *__pyx_pf_15View_dot_MemoryView_16_memoryviewslice_4base___get__(
struct __pyx_memoryviewslice_obj *__pyx_v_self) {
17357 PyObject *__pyx_r = NULL;
17358 __Pyx_TraceDeclarations
17359 __Pyx_RefNannyDeclarations
17360 int __pyx_lineno = 0;
17361 const char *__pyx_filename = NULL;
17362 int __pyx_clineno = 0;
17363 __Pyx_RefNannySetupContext(
"__get__", 0);
17364 __Pyx_TraceCall(
"__get__", __pyx_f[1], 992, 0, __PYX_ERR(1, 992, __pyx_L1_error));
17373 __Pyx_XDECREF(__pyx_r);
17374 __Pyx_INCREF(__pyx_v_self->from_object);
17375 __pyx_r = __pyx_v_self->from_object;
17388 __Pyx_AddTraceback(
"View.MemoryView._memoryviewslice.base.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
17391 __Pyx_XGIVEREF(__pyx_r);
17392 __Pyx_TraceReturn(__pyx_r, 0);
17393 __Pyx_RefNannyFinishContext();
17404 static PyObject *__pyx_pw___pyx_memoryviewslice_1__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused);
17405 static PyMethodDef __pyx_mdef___pyx_memoryviewslice_1__reduce_cython__ = {
"__reduce_cython__", (PyCFunction)__pyx_pw___pyx_memoryviewslice_1__reduce_cython__, METH_NOARGS, 0};
17406 static PyObject *__pyx_pw___pyx_memoryviewslice_1__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
17407 PyObject *__pyx_r = 0;
17408 __Pyx_RefNannyDeclarations
17409 __Pyx_RefNannySetupContext(
"__reduce_cython__ (wrapper)", 0);
17410 __pyx_r = __pyx_pf___pyx_memoryviewslice___reduce_cython__(((
struct __pyx_memoryviewslice_obj *)__pyx_v_self));
17413 __Pyx_RefNannyFinishContext();
17417 static PyObject *__pyx_pf___pyx_memoryviewslice___reduce_cython__(CYTHON_UNUSED
struct __pyx_memoryviewslice_obj *__pyx_v_self) {
17418 PyObject *__pyx_r = NULL;
17419 __Pyx_TraceDeclarations
17420 __Pyx_RefNannyDeclarations
17421 PyObject *__pyx_t_1 = NULL;
17422 int __pyx_lineno = 0;
17423 const char *__pyx_filename = NULL;
17424 int __pyx_clineno = 0;
17425 __Pyx_RefNannySetupContext(
"__reduce_cython__", 0);
17426 __Pyx_TraceCall(
"__reduce_cython__", __pyx_f[1], 1, 0, __PYX_ERR(1, 1, __pyx_L1_error));
17434 __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__33, NULL);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 2, __pyx_L1_error)
17435 __Pyx_GOTREF(__pyx_t_1);
17436 __Pyx_Raise(__pyx_t_1, 0, 0, 0);
17437 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
17438 __PYX_ERR(1, 2, __pyx_L1_error)
17448 __Pyx_XDECREF(__pyx_t_1);
17449 __Pyx_AddTraceback(
"View.MemoryView._memoryviewslice.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
17451 __Pyx_XGIVEREF(__pyx_r);
17452 __Pyx_TraceReturn(__pyx_r, 0);
17453 __Pyx_RefNannyFinishContext();
17465 static PyObject *__pyx_pw___pyx_memoryviewslice_3__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state);
17466 static PyMethodDef __pyx_mdef___pyx_memoryviewslice_3__setstate_cython__ = {
"__setstate_cython__", (PyCFunction)__pyx_pw___pyx_memoryviewslice_3__setstate_cython__, METH_O, 0};
17467 static PyObject *__pyx_pw___pyx_memoryviewslice_3__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
17468 PyObject *__pyx_r = 0;
17469 __Pyx_RefNannyDeclarations
17470 __Pyx_RefNannySetupContext(
"__setstate_cython__ (wrapper)", 0);
17471 __pyx_r = __pyx_pf___pyx_memoryviewslice_2__setstate_cython__(((
struct __pyx_memoryviewslice_obj *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state));
17474 __Pyx_RefNannyFinishContext();
17478 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) {
17479 PyObject *__pyx_r = NULL;
17480 __Pyx_TraceDeclarations
17481 __Pyx_RefNannyDeclarations
17482 PyObject *__pyx_t_1 = NULL;
17483 int __pyx_lineno = 0;
17484 const char *__pyx_filename = NULL;
17485 int __pyx_clineno = 0;
17486 __Pyx_RefNannySetupContext(
"__setstate_cython__", 0);
17487 __Pyx_TraceCall(
"__setstate_cython__", __pyx_f[1], 3, 0, __PYX_ERR(1, 3, __pyx_L1_error));
17494 __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__34, NULL);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 4, __pyx_L1_error)
17495 __Pyx_GOTREF(__pyx_t_1);
17496 __Pyx_Raise(__pyx_t_1, 0, 0, 0);
17497 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
17498 __PYX_ERR(1, 4, __pyx_L1_error)
17509 __Pyx_XDECREF(__pyx_t_1);
17510 __Pyx_AddTraceback(
"View.MemoryView._memoryviewslice.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
17512 __Pyx_XGIVEREF(__pyx_r);
17513 __Pyx_TraceReturn(__pyx_r, 0);
17514 __Pyx_RefNannyFinishContext();
17526 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) {
17527 struct __pyx_memoryviewslice_obj *__pyx_v_result = 0;
17528 Py_ssize_t __pyx_v_suboffset;
17529 PyObject *__pyx_v_length = NULL;
17530 PyObject *__pyx_r = NULL;
17531 __Pyx_TraceDeclarations
17532 __Pyx_RefNannyDeclarations
17534 PyObject *__pyx_t_2 = NULL;
17535 PyObject *__pyx_t_3 = NULL;
17536 __Pyx_TypeInfo *__pyx_t_4;
17537 Py_buffer __pyx_t_5;
17538 Py_ssize_t *__pyx_t_6;
17539 Py_ssize_t *__pyx_t_7;
17540 Py_ssize_t *__pyx_t_8;
17541 Py_ssize_t __pyx_t_9;
17542 int __pyx_lineno = 0;
17543 const char *__pyx_filename = NULL;
17544 int __pyx_clineno = 0;
17545 __Pyx_RefNannySetupContext(
"memoryview_fromslice", 0);
17546 __Pyx_TraceCall(
"memoryview_fromslice", __pyx_f[1], 999, 0, __PYX_ERR(1, 999, __pyx_L1_error));
17555 __pyx_t_1 = ((((PyObject *)__pyx_v_memviewslice.memview) == Py_None) != 0);
17565 __Pyx_XDECREF(__pyx_r);
17566 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
17585 __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_v_dtype_is_object);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1013, __pyx_L1_error)
17586 __Pyx_GOTREF(__pyx_t_2);
17587 __pyx_t_3 = PyTuple_New(3);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1013, __pyx_L1_error)
17588 __Pyx_GOTREF(__pyx_t_3);
17589 __Pyx_INCREF(Py_None);
17590 __Pyx_GIVEREF(Py_None);
17591 PyTuple_SET_ITEM(__pyx_t_3, 0, Py_None);
17592 __Pyx_INCREF(__pyx_int_0);
17593 __Pyx_GIVEREF(__pyx_int_0);
17594 PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_int_0);
17595 __Pyx_GIVEREF(__pyx_t_2);
17596 PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_t_2);
17598 __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_memoryviewslice_type), __pyx_t_3, NULL);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1013, __pyx_L1_error)
17599 __Pyx_GOTREF(__pyx_t_2);
17600 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
17601 __pyx_v_result = ((
struct __pyx_memoryviewslice_obj *)__pyx_t_2);
17611 __pyx_v_result->from_slice = __pyx_v_memviewslice;
17620 __PYX_INC_MEMVIEW((&__pyx_v_memviewslice), 1);
17629 __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_memviewslice.memview), __pyx_n_s_base);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1018, __pyx_L1_error)
17630 __Pyx_GOTREF(__pyx_t_2);
17631 __Pyx_GIVEREF(__pyx_t_2);
17632 __Pyx_GOTREF(__pyx_v_result->from_object);
17633 __Pyx_DECREF(__pyx_v_result->from_object);
17634 __pyx_v_result->from_object = __pyx_t_2;
17644 __pyx_t_4 = __pyx_v_memviewslice.memview->typeinfo;
17645 __pyx_v_result->__pyx_base.typeinfo = __pyx_t_4;
17654 __pyx_t_5 = __pyx_v_memviewslice.memview->view;
17655 __pyx_v_result->__pyx_base.view = __pyx_t_5;
17664 __pyx_v_result->__pyx_base.view.buf = ((
void *)__pyx_v_memviewslice.data);
17673 __pyx_v_result->__pyx_base.view.ndim = __pyx_v_ndim;
17682 ((Py_buffer *)(&__pyx_v_result->__pyx_base.view))->obj = Py_None;
17691 Py_INCREF(Py_None);
17700 __pyx_t_1 = ((((
struct __pyx_memoryview_obj *)__pyx_v_memviewslice.memview)->flags & PyBUF_WRITABLE) != 0);
17710 __pyx_v_result->__pyx_base.flags = PyBUF_RECORDS;
17730 __pyx_v_result->__pyx_base.flags = PyBUF_RECORDS_RO;
17741 __pyx_v_result->__pyx_base.view.shape = ((Py_ssize_t *)__pyx_v_result->from_slice.shape);
17750 __pyx_v_result->__pyx_base.view.strides = ((Py_ssize_t *)__pyx_v_result->from_slice.strides);
17759 __pyx_v_result->__pyx_base.view.suboffsets = NULL;
17768 __pyx_t_7 = (__pyx_v_result->from_slice.suboffsets + __pyx_v_ndim);
17769 for (__pyx_t_8 = __pyx_v_result->from_slice.suboffsets; __pyx_t_8 < __pyx_t_7; __pyx_t_8++) {
17770 __pyx_t_6 = __pyx_t_8;
17771 __pyx_v_suboffset = (__pyx_t_6[0]);
17780 __pyx_t_1 = ((__pyx_v_suboffset >= 0) != 0);
17790 __pyx_v_result->__pyx_base.view.suboffsets = ((Py_ssize_t *)__pyx_v_result->from_slice.suboffsets);
17799 goto __pyx_L6_break;
17819 __pyx_t_9 = __pyx_v_result->__pyx_base.view.itemsize;
17820 __pyx_v_result->__pyx_base.view.len = __pyx_t_9;
17829 __pyx_t_7 = (__pyx_v_result->__pyx_base.view.shape + __pyx_v_ndim);
17830 for (__pyx_t_8 = __pyx_v_result->__pyx_base.view.shape; __pyx_t_8 < __pyx_t_7; __pyx_t_8++) {
17831 __pyx_t_6 = __pyx_t_8;
17832 __pyx_t_2 = PyInt_FromSsize_t((__pyx_t_6[0]));
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1043, __pyx_L1_error)
17833 __Pyx_GOTREF(__pyx_t_2);
17834 __Pyx_XDECREF_SET(__pyx_v_length, __pyx_t_2);
17844 __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_result->__pyx_base.view.len);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1044, __pyx_L1_error)
17845 __Pyx_GOTREF(__pyx_t_2);
17846 __pyx_t_3 = PyNumber_InPlaceMultiply(__pyx_t_2, __pyx_v_length);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1044, __pyx_L1_error)
17847 __Pyx_GOTREF(__pyx_t_3);
17848 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
17849 __pyx_t_9 = __Pyx_PyIndex_AsSsize_t(__pyx_t_3);
if (unlikely((__pyx_t_9 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(1, 1044, __pyx_L1_error)
17850 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
17851 __pyx_v_result->__pyx_base.view.len = __pyx_t_9;
17861 __pyx_v_result->to_object_func = __pyx_v_to_object_func;
17870 __pyx_v_result->to_dtype_func = __pyx_v_to_dtype_func;
17879 __Pyx_XDECREF(__pyx_r);
17880 __Pyx_INCREF(((PyObject *)__pyx_v_result));
17881 __pyx_r = ((PyObject *)__pyx_v_result);
17894 __Pyx_XDECREF(__pyx_t_2);
17895 __Pyx_XDECREF(__pyx_t_3);
17896 __Pyx_AddTraceback(
"View.MemoryView.memoryview_fromslice", __pyx_clineno, __pyx_lineno, __pyx_filename);
17899 __Pyx_XDECREF((PyObject *)__pyx_v_result);
17900 __Pyx_XDECREF(__pyx_v_length);
17901 __Pyx_XGIVEREF(__pyx_r);
17902 __Pyx_TraceReturn(__pyx_r, 0);
17903 __Pyx_RefNannyFinishContext();
17915 static __Pyx_memviewslice *__pyx_memoryview_get_slice_from_memoryview(
struct __pyx_memoryview_obj *__pyx_v_memview, __Pyx_memviewslice *__pyx_v_mslice) {
17916 struct __pyx_memoryviewslice_obj *__pyx_v_obj = 0;
17917 __Pyx_memviewslice *__pyx_r;
17918 __Pyx_TraceDeclarations
17919 __Pyx_RefNannyDeclarations
17922 PyObject *__pyx_t_3 = NULL;
17923 int __pyx_lineno = 0;
17924 const char *__pyx_filename = NULL;
17925 int __pyx_clineno = 0;
17926 __Pyx_RefNannySetupContext(
"get_slice_from_memview", 0);
17927 __Pyx_TraceCall(
"get_slice_from_memview", __pyx_f[1], 1052, 0, __PYX_ERR(1, 1052, __pyx_L1_error));
17936 __pyx_t_1 = __Pyx_TypeCheck(((PyObject *)__pyx_v_memview), __pyx_memoryviewslice_type);
17937 __pyx_t_2 = (__pyx_t_1 != 0);
17947 if (!(likely(((((PyObject *)__pyx_v_memview)) == Py_None) || likely(__Pyx_TypeTest(((PyObject *)__pyx_v_memview), __pyx_memoryviewslice_type))))) __PYX_ERR(1, 1056, __pyx_L1_error)
17948 __pyx_t_3 = ((PyObject *)__pyx_v_memview);
17949 __Pyx_INCREF(__pyx_t_3);
17950 __pyx_v_obj = ((
struct __pyx_memoryviewslice_obj *)__pyx_t_3);
17960 __pyx_r = (&__pyx_v_obj->from_slice);
17980 __pyx_memoryview_slice_copy(__pyx_v_memview, __pyx_v_mslice);
17989 __pyx_r = __pyx_v_mslice;
18003 __Pyx_XDECREF(__pyx_t_3);
18004 __Pyx_AddTraceback(
"View.MemoryView.get_slice_from_memview", __pyx_clineno, __pyx_lineno, __pyx_filename);
18007 __Pyx_XDECREF((PyObject *)__pyx_v_obj);
18008 __Pyx_TraceReturn(Py_None, 0);
18009 __Pyx_RefNannyFinishContext();
18021 static void __pyx_memoryview_slice_copy(
struct __pyx_memoryview_obj *__pyx_v_memview, __Pyx_memviewslice *__pyx_v_dst) {
18023 Py_ssize_t *__pyx_v_shape;
18024 Py_ssize_t *__pyx_v_strides;
18025 Py_ssize_t *__pyx_v_suboffsets;
18026 __Pyx_TraceDeclarations
18027 __Pyx_RefNannyDeclarations
18028 Py_ssize_t *__pyx_t_1;
18032 Py_ssize_t __pyx_t_5;
18033 int __pyx_lineno = 0;
18034 const char *__pyx_filename = NULL;
18035 int __pyx_clineno = 0;
18036 __Pyx_RefNannySetupContext(
"slice_copy", 0);
18037 __Pyx_TraceCall(
"slice_copy", __pyx_f[1], 1063, 0, __PYX_ERR(1, 1063, __pyx_L1_error));
18046 __pyx_t_1 = __pyx_v_memview->view.shape;
18047 __pyx_v_shape = __pyx_t_1;
18056 __pyx_t_1 = __pyx_v_memview->view.strides;
18057 __pyx_v_strides = __pyx_t_1;
18066 __pyx_t_1 = __pyx_v_memview->view.suboffsets;
18067 __pyx_v_suboffsets = __pyx_t_1;
18076 __pyx_v_dst->memview = ((
struct __pyx_memoryview_obj *)__pyx_v_memview);
18085 __pyx_v_dst->data = ((
char *)__pyx_v_memview->view.buf);
18094 __pyx_t_2 = __pyx_v_memview->view.ndim;
18095 __pyx_t_3 = __pyx_t_2;
18096 for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
18097 __pyx_v_dim = __pyx_t_4;
18106 (__pyx_v_dst->shape[__pyx_v_dim]) = (__pyx_v_shape[__pyx_v_dim]);
18115 (__pyx_v_dst->strides[__pyx_v_dim]) = (__pyx_v_strides[__pyx_v_dim]);
18124 if ((__pyx_v_suboffsets != 0)) {
18125 __pyx_t_5 = (__pyx_v_suboffsets[__pyx_v_dim]);
18129 (__pyx_v_dst->suboffsets[__pyx_v_dim]) = __pyx_t_5;
18143 __Pyx_WriteUnraisable(
"View.MemoryView.slice_copy", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
18145 __Pyx_TraceReturn(Py_None, 0);
18146 __Pyx_RefNannyFinishContext();
18157 static PyObject *__pyx_memoryview_copy_object(
struct __pyx_memoryview_obj *__pyx_v_memview) {
18158 __Pyx_memviewslice __pyx_v_memviewslice;
18159 PyObject *__pyx_r = NULL;
18160 __Pyx_TraceDeclarations
18161 __Pyx_RefNannyDeclarations
18162 PyObject *__pyx_t_1 = NULL;
18163 int __pyx_lineno = 0;
18164 const char *__pyx_filename = NULL;
18165 int __pyx_clineno = 0;
18166 __Pyx_RefNannySetupContext(
"memoryview_copy", 0);
18167 __Pyx_TraceCall(
"memoryview_copy", __pyx_f[1], 1080, 0, __PYX_ERR(1, 1080, __pyx_L1_error));
18176 __pyx_memoryview_slice_copy(__pyx_v_memview, (&__pyx_v_memviewslice));
18185 __Pyx_XDECREF(__pyx_r);
18186 __pyx_t_1 = __pyx_memoryview_copy_object_from_slice(__pyx_v_memview, (&__pyx_v_memviewslice));
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1084, __pyx_L1_error)
18187 __Pyx_GOTREF(__pyx_t_1);
18188 __pyx_r = __pyx_t_1;
18202 __Pyx_XDECREF(__pyx_t_1);
18203 __Pyx_AddTraceback(
"View.MemoryView.memoryview_copy", __pyx_clineno, __pyx_lineno, __pyx_filename);
18206 __Pyx_XGIVEREF(__pyx_r);
18207 __Pyx_TraceReturn(__pyx_r, 0);
18208 __Pyx_RefNannyFinishContext();
18220 static PyObject *__pyx_memoryview_copy_object_from_slice(
struct __pyx_memoryview_obj *__pyx_v_memview, __Pyx_memviewslice *__pyx_v_memviewslice) {
18221 PyObject *(*__pyx_v_to_object_func)(
char *);
18222 int (*__pyx_v_to_dtype_func)(
char *, PyObject *);
18223 PyObject *__pyx_r = NULL;
18224 __Pyx_TraceDeclarations
18225 __Pyx_RefNannyDeclarations
18228 PyObject *(*__pyx_t_3)(
char *);
18229 int (*__pyx_t_4)(
char *, PyObject *);
18230 PyObject *__pyx_t_5 = NULL;
18231 int __pyx_lineno = 0;
18232 const char *__pyx_filename = NULL;
18233 int __pyx_clineno = 0;
18234 __Pyx_RefNannySetupContext(
"memoryview_copy_from_slice", 0);
18235 __Pyx_TraceCall(
"memoryview_copy_from_slice", __pyx_f[1], 1087, 0, __PYX_ERR(1, 1087, __pyx_L1_error));
18244 __pyx_t_1 = __Pyx_TypeCheck(((PyObject *)__pyx_v_memview), __pyx_memoryviewslice_type);
18245 __pyx_t_2 = (__pyx_t_1 != 0);
18255 __pyx_t_3 = ((
struct __pyx_memoryviewslice_obj *)__pyx_v_memview)->to_object_func;
18256 __pyx_v_to_object_func = __pyx_t_3;
18265 __pyx_t_4 = ((
struct __pyx_memoryviewslice_obj *)__pyx_v_memview)->to_dtype_func;
18266 __pyx_v_to_dtype_func = __pyx_t_4;
18286 __pyx_v_to_object_func = NULL;
18295 __pyx_v_to_dtype_func = NULL;
18306 __Pyx_XDECREF(__pyx_r);
18315 __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(1, 1101, __pyx_L1_error)
18316 __Pyx_GOTREF(__pyx_t_5);
18317 __pyx_r = __pyx_t_5;
18331 __Pyx_XDECREF(__pyx_t_5);
18332 __Pyx_AddTraceback(
"View.MemoryView.memoryview_copy_from_slice", __pyx_clineno, __pyx_lineno, __pyx_filename);
18335 __Pyx_XGIVEREF(__pyx_r);
18336 __Pyx_TraceReturn(__pyx_r, 0);
18337 __Pyx_RefNannyFinishContext();
18349 static Py_ssize_t abs_py_ssize_t(Py_ssize_t __pyx_v_arg) {
18350 Py_ssize_t __pyx_r;
18351 __Pyx_TraceDeclarations
18353 int __pyx_lineno = 0;
18354 const char *__pyx_filename = NULL;
18355 int __pyx_clineno = 0;
18356 __Pyx_TraceCall(
"abs_py_ssize_t", __pyx_f[1], 1109, 1, __PYX_ERR(1, 1109, __pyx_L1_error));
18365 __pyx_t_1 = ((__pyx_v_arg < 0) != 0);
18375 __pyx_r = (-__pyx_v_arg);
18395 __pyx_r = __pyx_v_arg;
18409 __Pyx_WriteUnraisable(
"View.MemoryView.abs_py_ssize_t", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 1);
18412 __Pyx_TraceReturn(Py_None, 1);
18424 static char __pyx_get_best_slice_order(__Pyx_memviewslice *__pyx_v_mslice,
int __pyx_v_ndim) {
18426 Py_ssize_t __pyx_v_c_stride;
18427 Py_ssize_t __pyx_v_f_stride;
18429 __Pyx_TraceDeclarations
18434 int __pyx_lineno = 0;
18435 const char *__pyx_filename = NULL;
18436 int __pyx_clineno = 0;
18437 __Pyx_TraceCall(
"get_best_order", __pyx_f[1], 1116, 1, __PYX_ERR(1, 1116, __pyx_L1_error));
18446 __pyx_v_c_stride = 0;
18455 __pyx_v_f_stride = 0;
18464 for (__pyx_t_1 = (__pyx_v_ndim - 1); __pyx_t_1 > -1; __pyx_t_1-=1) {
18465 __pyx_v_i = __pyx_t_1;
18474 __pyx_t_2 = (((__pyx_v_mslice->shape[__pyx_v_i]) > 1) != 0);
18484 __pyx_v_c_stride = (__pyx_v_mslice->strides[__pyx_v_i]);
18493 goto __pyx_L4_break;
18513 __pyx_t_1 = __pyx_v_ndim;
18514 __pyx_t_3 = __pyx_t_1;
18515 for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
18516 __pyx_v_i = __pyx_t_4;
18525 __pyx_t_2 = (((__pyx_v_mslice->shape[__pyx_v_i]) > 1) != 0);
18535 __pyx_v_f_stride = (__pyx_v_mslice->strides[__pyx_v_i]);
18544 goto __pyx_L7_break;
18564 __pyx_t_2 = ((abs_py_ssize_t(__pyx_v_c_stride) <= abs_py_ssize_t(__pyx_v_f_stride)) != 0);
18608 __Pyx_WriteUnraisable(
"View.MemoryView.get_best_order", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 1);
18611 __Pyx_TraceReturn(Py_None, 1);
18623 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) {
18624 CYTHON_UNUSED Py_ssize_t __pyx_v_i;
18625 CYTHON_UNUSED Py_ssize_t __pyx_v_src_extent;
18626 Py_ssize_t __pyx_v_dst_extent;
18627 Py_ssize_t __pyx_v_src_stride;
18628 Py_ssize_t __pyx_v_dst_stride;
18632 Py_ssize_t __pyx_t_4;
18633 Py_ssize_t __pyx_t_5;
18634 Py_ssize_t __pyx_t_6;
18643 __pyx_v_src_extent = (__pyx_v_src_shape[0]);
18652 __pyx_v_dst_extent = (__pyx_v_dst_shape[0]);
18661 __pyx_v_src_stride = (__pyx_v_src_strides[0]);
18670 __pyx_v_dst_stride = (__pyx_v_dst_strides[0]);
18679 __pyx_t_1 = ((__pyx_v_ndim == 1) != 0);
18689 __pyx_t_2 = ((__pyx_v_src_stride > 0) != 0);
18692 __pyx_t_1 = __pyx_t_2;
18693 goto __pyx_L5_bool_binop_done;
18695 __pyx_t_2 = ((__pyx_v_dst_stride > 0) != 0);
18698 __pyx_t_1 = __pyx_t_2;
18699 goto __pyx_L5_bool_binop_done;
18709 __pyx_t_2 = (((size_t)__pyx_v_src_stride) == __pyx_v_itemsize);
18711 __pyx_t_2 = (__pyx_v_itemsize == ((size_t)__pyx_v_dst_stride));
18713 __pyx_t_3 = (__pyx_t_2 != 0);
18714 __pyx_t_1 = __pyx_t_3;
18715 __pyx_L5_bool_binop_done:;
18733 (void)(memcpy(__pyx_v_dst_data, __pyx_v_src_data, (__pyx_v_itemsize * __pyx_v_dst_extent)));
18753 __pyx_t_4 = __pyx_v_dst_extent;
18754 __pyx_t_5 = __pyx_t_4;
18755 for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) {
18756 __pyx_v_i = __pyx_t_6;
18765 (void)(memcpy(__pyx_v_dst_data, __pyx_v_src_data, __pyx_v_itemsize));
18774 __pyx_v_src_data = (__pyx_v_src_data + __pyx_v_src_stride);
18783 __pyx_v_dst_data = (__pyx_v_dst_data + __pyx_v_dst_stride);
18806 __pyx_t_4 = __pyx_v_dst_extent;
18807 __pyx_t_5 = __pyx_t_4;
18808 for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) {
18809 __pyx_v_i = __pyx_t_6;
18818 _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);
18827 __pyx_v_src_data = (__pyx_v_src_data + __pyx_v_src_stride);
18836 __pyx_v_dst_data = (__pyx_v_dst_data + __pyx_v_dst_stride);
18860 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) {
18861 __Pyx_TraceDeclarations
18862 int __pyx_lineno = 0;
18863 const char *__pyx_filename = NULL;
18864 int __pyx_clineno = 0;
18865 __Pyx_TraceCall(
"copy_strided_to_strided", __pyx_f[1], 1170, 1, __PYX_ERR(1, 1170, __pyx_L1_error));
18874 _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);
18887 __Pyx_WriteUnraisable(
"View.MemoryView.copy_strided_to_strided", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 1);
18889 __Pyx_TraceReturn(Py_None, 1);
18900 static Py_ssize_t __pyx_memoryview_slice_get_size(__Pyx_memviewslice *__pyx_v_src,
int __pyx_v_ndim) {
18901 Py_ssize_t __pyx_v_shape;
18902 Py_ssize_t __pyx_v_size;
18903 Py_ssize_t __pyx_r;
18904 __Pyx_TraceDeclarations
18905 Py_ssize_t __pyx_t_1;
18906 Py_ssize_t *__pyx_t_2;
18907 Py_ssize_t *__pyx_t_3;
18908 Py_ssize_t *__pyx_t_4;
18909 int __pyx_lineno = 0;
18910 const char *__pyx_filename = NULL;
18911 int __pyx_clineno = 0;
18912 __Pyx_TraceCall(
"slice_get_size", __pyx_f[1], 1177, 1, __PYX_ERR(1, 1177, __pyx_L1_error));
18921 __pyx_t_1 = __pyx_v_src->memview->view.itemsize;
18922 __pyx_v_size = __pyx_t_1;
18931 __pyx_t_3 = (__pyx_v_src->shape + __pyx_v_ndim);
18932 for (__pyx_t_4 = __pyx_v_src->shape; __pyx_t_4 < __pyx_t_3; __pyx_t_4++) {
18933 __pyx_t_2 = __pyx_t_4;
18934 __pyx_v_shape = (__pyx_t_2[0]);
18943 __pyx_v_size = (__pyx_v_size * __pyx_v_shape);
18953 __pyx_r = __pyx_v_size;
18966 __Pyx_WriteUnraisable(
"View.MemoryView.slice_get_size", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 1);
18969 __Pyx_TraceReturn(Py_None, 1);
18981 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) {
18983 Py_ssize_t __pyx_r;
18984 __Pyx_TraceDeclarations
18989 int __pyx_lineno = 0;
18990 const char *__pyx_filename = NULL;
18991 int __pyx_clineno = 0;
18992 __Pyx_TraceCall(
"fill_contig_strides_array", __pyx_f[1], 1187, 1, __PYX_ERR(1, 1187, __pyx_L1_error));
19001 __pyx_t_1 = ((__pyx_v_order ==
'F') != 0);
19011 __pyx_t_2 = __pyx_v_ndim;
19012 __pyx_t_3 = __pyx_t_2;
19013 for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
19014 __pyx_v_idx = __pyx_t_4;
19023 (__pyx_v_strides[__pyx_v_idx]) = __pyx_v_stride;
19032 __pyx_v_stride = (__pyx_v_stride * (__pyx_v_shape[__pyx_v_idx]));
19053 for (__pyx_t_2 = (__pyx_v_ndim - 1); __pyx_t_2 > -1; __pyx_t_2-=1) {
19054 __pyx_v_idx = __pyx_t_2;
19063 (__pyx_v_strides[__pyx_v_idx]) = __pyx_v_stride;
19072 __pyx_v_stride = (__pyx_v_stride * (__pyx_v_shape[__pyx_v_idx]));
19084 __pyx_r = __pyx_v_stride;
19097 __Pyx_WriteUnraisable(
"View.MemoryView.fill_contig_strides_array", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 1);
19100 __Pyx_TraceReturn(Py_None, 1);
19112 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) {
19114 void *__pyx_v_result;
19115 size_t __pyx_v_itemsize;
19116 size_t __pyx_v_size;
19118 __Pyx_TraceDeclarations
19119 Py_ssize_t __pyx_t_1;
19122 struct __pyx_memoryview_obj *__pyx_t_4;
19125 int __pyx_lineno = 0;
19126 const char *__pyx_filename = NULL;
19127 int __pyx_clineno = 0;
19128 __Pyx_TraceCall(
"copy_data_to_temp", __pyx_f[1], 1208, 1, __PYX_ERR(1, 1208, __pyx_L1_error));
19137 __pyx_t_1 = __pyx_v_src->memview->view.itemsize;
19138 __pyx_v_itemsize = __pyx_t_1;
19147 __pyx_v_size = __pyx_memoryview_slice_get_size(__pyx_v_src, __pyx_v_ndim);
19156 __pyx_v_result = malloc(__pyx_v_size);
19165 __pyx_t_2 = ((!(__pyx_v_result != 0)) != 0);
19175 __pyx_t_3 = __pyx_memoryview_err(__pyx_builtin_MemoryError, NULL);
if (unlikely(__pyx_t_3 == ((
int)-1))) __PYX_ERR(1, 1224, __pyx_L1_error)
19193 __pyx_v_tmpslice->data = ((
char *)__pyx_v_result);
19202 __pyx_t_4 = __pyx_v_src->memview;
19203 __pyx_v_tmpslice->memview = __pyx_t_4;
19212 __pyx_t_3 = __pyx_v_ndim;
19213 __pyx_t_5 = __pyx_t_3;
19214 for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) {
19215 __pyx_v_i = __pyx_t_6;
19224 (__pyx_v_tmpslice->shape[__pyx_v_i]) = (__pyx_v_src->shape[__pyx_v_i]);
19233 (__pyx_v_tmpslice->suboffsets[__pyx_v_i]) = -1
L;
19243 (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));
19252 __pyx_t_3 = __pyx_v_ndim;
19253 __pyx_t_5 = __pyx_t_3;
19254 for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) {
19255 __pyx_v_i = __pyx_t_6;
19264 __pyx_t_2 = (((__pyx_v_tmpslice->shape[__pyx_v_i]) == 1) != 0);
19274 (__pyx_v_tmpslice->strides[__pyx_v_i]) = 0;
19293 __pyx_t_2 = (__pyx_memviewslice_is_contig((__pyx_v_src[0]), __pyx_v_order, __pyx_v_ndim) != 0);
19303 (void)(memcpy(__pyx_v_result, __pyx_v_src->data, __pyx_v_size));
19323 copy_strided_to_strided(__pyx_v_src, __pyx_v_tmpslice, __pyx_v_ndim, __pyx_v_itemsize);
19334 __pyx_r = __pyx_v_result;
19349 PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
19351 __Pyx_AddTraceback(
"View.MemoryView.copy_data_to_temp", __pyx_clineno, __pyx_lineno, __pyx_filename);
19353 __Pyx_PyGILState_Release(__pyx_gilstate_save);
19358 __Pyx_TraceReturn(Py_None, 1);
19370 static int __pyx_memoryview_err_extents(
int __pyx_v_i, Py_ssize_t __pyx_v_extent1, Py_ssize_t __pyx_v_extent2) {
19372 __Pyx_TraceDeclarations
19373 __Pyx_RefNannyDeclarations
19374 PyObject *__pyx_t_1 = NULL;
19375 PyObject *__pyx_t_2 = NULL;
19376 PyObject *__pyx_t_3 = NULL;
19377 PyObject *__pyx_t_4 = NULL;
19378 int __pyx_lineno = 0;
19379 const char *__pyx_filename = NULL;
19380 int __pyx_clineno = 0;
19382 PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
19384 __Pyx_RefNannySetupContext(
"_err_extents", 0);
19385 __Pyx_TraceCall(
"_err_extents", __pyx_f[1], 1251, 0, __PYX_ERR(1, 1251, __pyx_L1_error));
19394 __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_i);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1254, __pyx_L1_error)
19395 __Pyx_GOTREF(__pyx_t_1);
19396 __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_extent1);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1254, __pyx_L1_error)
19397 __Pyx_GOTREF(__pyx_t_2);
19398 __pyx_t_3 = PyInt_FromSsize_t(__pyx_v_extent2);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1254, __pyx_L1_error)
19399 __Pyx_GOTREF(__pyx_t_3);
19400 __pyx_t_4 = PyTuple_New(3);
if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 1254, __pyx_L1_error)
19401 __Pyx_GOTREF(__pyx_t_4);
19402 __Pyx_GIVEREF(__pyx_t_1);
19403 PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_1);
19404 __Pyx_GIVEREF(__pyx_t_2);
19405 PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_2);
19406 __Pyx_GIVEREF(__pyx_t_3);
19407 PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_t_3);
19419 __pyx_t_3 = __Pyx_PyString_Format(__pyx_kp_s_got_differing_extents_in_dimensi, __pyx_t_4);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1253, __pyx_L1_error)
19420 __Pyx_GOTREF(__pyx_t_3);
19421 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
19422 __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_3);
if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 1253, __pyx_L1_error)
19423 __Pyx_GOTREF(__pyx_t_4);
19424 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
19425 __Pyx_Raise(__pyx_t_4, 0, 0, 0);
19426 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
19427 __PYX_ERR(1, 1253, __pyx_L1_error)
19439 __Pyx_XDECREF(__pyx_t_1);
19440 __Pyx_XDECREF(__pyx_t_2);
19441 __Pyx_XDECREF(__pyx_t_3);
19442 __Pyx_XDECREF(__pyx_t_4);
19443 __Pyx_AddTraceback(
"View.MemoryView._err_extents", __pyx_clineno, __pyx_lineno, __pyx_filename);
19445 __Pyx_TraceReturn(Py_None, 0);
19446 __Pyx_RefNannyFinishContext();
19448 __Pyx_PyGILState_Release(__pyx_gilstate_save);
19461 static int __pyx_memoryview_err_dim(PyObject *__pyx_v_error,
char *__pyx_v_msg,
int __pyx_v_dim) {
19463 __Pyx_TraceDeclarations
19464 __Pyx_RefNannyDeclarations
19465 PyObject *__pyx_t_1 = NULL;
19466 PyObject *__pyx_t_2 = NULL;
19467 PyObject *__pyx_t_3 = NULL;
19468 PyObject *__pyx_t_4 = NULL;
19469 int __pyx_lineno = 0;
19470 const char *__pyx_filename = NULL;
19471 int __pyx_clineno = 0;
19473 PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
19475 __Pyx_RefNannySetupContext(
"_err_dim", 0);
19476 __Pyx_TraceCall(
"_err_dim", __pyx_f[1], 1257, 0, __PYX_ERR(1, 1257, __pyx_L1_error));
19477 __Pyx_INCREF(__pyx_v_error);
19486 __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(1, 1258, __pyx_L1_error)
19487 __Pyx_GOTREF(__pyx_t_2);
19488 __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_dim);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1258, __pyx_L1_error)
19489 __Pyx_GOTREF(__pyx_t_3);
19490 __pyx_t_4 = PyUnicode_Format(__pyx_t_2, __pyx_t_3);
if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 1258, __pyx_L1_error)
19491 __Pyx_GOTREF(__pyx_t_4);
19492 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
19493 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
19494 __Pyx_INCREF(__pyx_v_error);
19495 __pyx_t_3 = __pyx_v_error; __pyx_t_2 = NULL;
19496 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
19497 __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
19498 if (likely(__pyx_t_2)) {
19499 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_3);
19500 __Pyx_INCREF(__pyx_t_2);
19501 __Pyx_INCREF(
function);
19502 __Pyx_DECREF_SET(__pyx_t_3,
function);
19505 __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);
19506 __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
19507 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
19508 if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1258, __pyx_L1_error)
19509 __Pyx_GOTREF(__pyx_t_1);
19510 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
19511 __Pyx_Raise(__pyx_t_1, 0, 0, 0);
19512 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
19513 __PYX_ERR(1, 1258, __pyx_L1_error)
19525 __Pyx_XDECREF(__pyx_t_1);
19526 __Pyx_XDECREF(__pyx_t_2);
19527 __Pyx_XDECREF(__pyx_t_3);
19528 __Pyx_XDECREF(__pyx_t_4);
19529 __Pyx_AddTraceback(
"View.MemoryView._err_dim", __pyx_clineno, __pyx_lineno, __pyx_filename);
19531 __Pyx_XDECREF(__pyx_v_error);
19532 __Pyx_TraceReturn(Py_None, 0);
19533 __Pyx_RefNannyFinishContext();
19535 __Pyx_PyGILState_Release(__pyx_gilstate_save);
19548 static int __pyx_memoryview_err(PyObject *__pyx_v_error,
char *__pyx_v_msg) {
19550 __Pyx_TraceDeclarations
19551 __Pyx_RefNannyDeclarations
19553 PyObject *__pyx_t_2 = NULL;
19554 PyObject *__pyx_t_3 = NULL;
19555 PyObject *__pyx_t_4 = NULL;
19556 PyObject *__pyx_t_5 = NULL;
19557 int __pyx_lineno = 0;
19558 const char *__pyx_filename = NULL;
19559 int __pyx_clineno = 0;
19561 PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
19563 __Pyx_RefNannySetupContext(
"_err", 0);
19564 __Pyx_TraceCall(
"_err", __pyx_f[1], 1261, 0, __PYX_ERR(1, 1261, __pyx_L1_error));
19565 __Pyx_INCREF(__pyx_v_error);
19574 __pyx_t_1 = ((__pyx_v_msg != NULL) != 0);
19575 if (unlikely(__pyx_t_1)) {
19584 __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(1, 1263, __pyx_L1_error)
19585 __Pyx_GOTREF(__pyx_t_3);
19586 __Pyx_INCREF(__pyx_v_error);
19587 __pyx_t_4 = __pyx_v_error; __pyx_t_5 = NULL;
19588 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
19589 __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
19590 if (likely(__pyx_t_5)) {
19591 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_4);
19592 __Pyx_INCREF(__pyx_t_5);
19593 __Pyx_INCREF(
function);
19594 __Pyx_DECREF_SET(__pyx_t_4,
function);
19597 __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);
19598 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
19599 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
19600 if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1263, __pyx_L1_error)
19601 __Pyx_GOTREF(__pyx_t_2);
19602 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
19603 __Pyx_Raise(__pyx_t_2, 0, 0, 0);
19604 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
19605 __PYX_ERR(1, 1263, __pyx_L1_error)
19624 __Pyx_Raise(__pyx_v_error, 0, 0, 0);
19625 __PYX_ERR(1, 1265, __pyx_L1_error)
19638 __Pyx_XDECREF(__pyx_t_2);
19639 __Pyx_XDECREF(__pyx_t_3);
19640 __Pyx_XDECREF(__pyx_t_4);
19641 __Pyx_XDECREF(__pyx_t_5);
19642 __Pyx_AddTraceback(
"View.MemoryView._err", __pyx_clineno, __pyx_lineno, __pyx_filename);
19644 __Pyx_XDECREF(__pyx_v_error);
19645 __Pyx_TraceReturn(Py_None, 0);
19646 __Pyx_RefNannyFinishContext();
19648 __Pyx_PyGILState_Release(__pyx_gilstate_save);
19661 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) {
19662 void *__pyx_v_tmpdata;
19663 size_t __pyx_v_itemsize;
19665 char __pyx_v_order;
19666 int __pyx_v_broadcasting;
19667 int __pyx_v_direct_copy;
19668 __Pyx_memviewslice __pyx_v_tmp;
19671 __Pyx_TraceDeclarations
19672 Py_ssize_t __pyx_t_1;
19680 int __pyx_lineno = 0;
19681 const char *__pyx_filename = NULL;
19682 int __pyx_clineno = 0;
19683 __Pyx_TraceCall(
"memoryview_copy_contents", __pyx_f[1], 1268, 1, __PYX_ERR(1, 1268, __pyx_L1_error));
19692 __pyx_v_tmpdata = NULL;
19701 __pyx_t_1 = __pyx_v_src.memview->view.itemsize;
19702 __pyx_v_itemsize = __pyx_t_1;
19711 __pyx_v_order = __pyx_get_best_slice_order((&__pyx_v_src), __pyx_v_src_ndim);
19720 __pyx_v_broadcasting = 0;
19729 __pyx_v_direct_copy = 0;
19738 __pyx_t_2 = ((__pyx_v_src_ndim < __pyx_v_dst_ndim) != 0);
19748 __pyx_memoryview_broadcast_leading((&__pyx_v_src), __pyx_v_src_ndim, __pyx_v_dst_ndim);
19767 __pyx_t_2 = ((__pyx_v_dst_ndim < __pyx_v_src_ndim) != 0);
19777 __pyx_memoryview_broadcast_leading((&__pyx_v_dst), __pyx_v_dst_ndim, __pyx_v_src_ndim);
19796 __pyx_t_3 = __pyx_v_dst_ndim;
19797 __pyx_t_4 = __pyx_v_src_ndim;
19798 if (((__pyx_t_3 > __pyx_t_4) != 0)) {
19799 __pyx_t_5 = __pyx_t_3;
19801 __pyx_t_5 = __pyx_t_4;
19803 __pyx_v_ndim = __pyx_t_5;
19812 __pyx_t_5 = __pyx_v_ndim;
19813 __pyx_t_3 = __pyx_t_5;
19814 for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
19815 __pyx_v_i = __pyx_t_4;
19824 __pyx_t_2 = (((__pyx_v_src.shape[__pyx_v_i]) != (__pyx_v_dst.shape[__pyx_v_i])) != 0);
19834 __pyx_t_2 = (((__pyx_v_src.shape[__pyx_v_i]) == 1) != 0);
19844 __pyx_v_broadcasting = 1;
19853 (__pyx_v_src.strides[__pyx_v_i]) = 0;
19873 __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(1, 1297, __pyx_L1_error)
19893 __pyx_t_2 = (((__pyx_v_src.suboffsets[__pyx_v_i]) >= 0) != 0);
19903 __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(1, 1300, __pyx_L1_error)
19922 __pyx_t_2 = (__pyx_slices_overlap((&__pyx_v_src), (&__pyx_v_dst), __pyx_v_ndim, __pyx_v_itemsize) != 0);
19932 __pyx_t_2 = ((!(__pyx_memviewslice_is_contig(__pyx_v_src, __pyx_v_order, __pyx_v_ndim) != 0)) != 0);
19942 __pyx_v_order = __pyx_get_best_slice_order((&__pyx_v_dst), __pyx_v_ndim);
19960 __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(1, 1307, __pyx_L1_error)
19961 __pyx_v_tmpdata = __pyx_t_7;
19970 __pyx_v_src = __pyx_v_tmp;
19988 __pyx_t_2 = ((!(__pyx_v_broadcasting != 0)) != 0);
19998 __pyx_t_2 = (__pyx_memviewslice_is_contig(__pyx_v_src,
'C', __pyx_v_ndim) != 0);
20008 __pyx_v_direct_copy = __pyx_memviewslice_is_contig(__pyx_v_dst,
'C', __pyx_v_ndim);
20027 __pyx_t_2 = (__pyx_memviewslice_is_contig(__pyx_v_src,
'F', __pyx_v_ndim) != 0);
20037 __pyx_v_direct_copy = __pyx_memviewslice_is_contig(__pyx_v_dst,
'F', __pyx_v_ndim);
20056 __pyx_t_2 = (__pyx_v_direct_copy != 0);
20066 __pyx_memoryview_refcount_copying((&__pyx_v_dst), __pyx_v_dtype_is_object, __pyx_v_ndim, 0);
20075 (void)(memcpy(__pyx_v_dst.data, __pyx_v_src.data, __pyx_memoryview_slice_get_size((&__pyx_v_src), __pyx_v_ndim)));
20084 __pyx_memoryview_refcount_copying((&__pyx_v_dst), __pyx_v_dtype_is_object, __pyx_v_ndim, 1);
20093 free(__pyx_v_tmpdata);
20130 __pyx_t_2 = (__pyx_v_order ==
'F');
20132 __pyx_t_2 = (
'F' == __pyx_get_best_slice_order((&__pyx_v_dst), __pyx_v_ndim));
20134 __pyx_t_8 = (__pyx_t_2 != 0);
20144 __pyx_t_5 = __pyx_memslice_transpose((&__pyx_v_src));
if (unlikely(__pyx_t_5 == ((
int)0))) __PYX_ERR(1, 1329, __pyx_L1_error)
20153 __pyx_t_5 = __pyx_memslice_transpose((&__pyx_v_dst));
if (unlikely(__pyx_t_5 == ((
int)0))) __PYX_ERR(1, 1330, __pyx_L1_error)
20171 __pyx_memoryview_refcount_copying((&__pyx_v_dst), __pyx_v_dtype_is_object, __pyx_v_ndim, 0);
20180 copy_strided_to_strided((&__pyx_v_src), (&__pyx_v_dst), __pyx_v_ndim, __pyx_v_itemsize);
20189 __pyx_memoryview_refcount_copying((&__pyx_v_dst), __pyx_v_dtype_is_object, __pyx_v_ndim, 1);
20198 free(__pyx_v_tmpdata);
20222 PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
20224 __Pyx_AddTraceback(
"View.MemoryView.memoryview_copy_contents", __pyx_clineno, __pyx_lineno, __pyx_filename);
20226 __Pyx_PyGILState_Release(__pyx_gilstate_save);
20231 __Pyx_TraceReturn(Py_None, 1);
20243 static void __pyx_memoryview_broadcast_leading(__Pyx_memviewslice *__pyx_v_mslice,
int __pyx_v_ndim,
int __pyx_v_ndim_other) {
20245 int __pyx_v_offset;
20246 __Pyx_TraceDeclarations
20250 int __pyx_lineno = 0;
20251 const char *__pyx_filename = NULL;
20252 int __pyx_clineno = 0;
20253 __Pyx_TraceCall(
"broadcast_leading", __pyx_f[1], 1340, 1, __PYX_ERR(1, 1340, __pyx_L1_error));
20262 __pyx_v_offset = (__pyx_v_ndim_other - __pyx_v_ndim);
20271 for (__pyx_t_1 = (__pyx_v_ndim - 1); __pyx_t_1 > -1; __pyx_t_1-=1) {
20272 __pyx_v_i = __pyx_t_1;
20281 (__pyx_v_mslice->shape[(__pyx_v_i + __pyx_v_offset)]) = (__pyx_v_mslice->shape[__pyx_v_i]);
20290 (__pyx_v_mslice->strides[(__pyx_v_i + __pyx_v_offset)]) = (__pyx_v_mslice->strides[__pyx_v_i]);
20299 (__pyx_v_mslice->suboffsets[(__pyx_v_i + __pyx_v_offset)]) = (__pyx_v_mslice->suboffsets[__pyx_v_i]);
20309 __pyx_t_1 = __pyx_v_offset;
20310 __pyx_t_2 = __pyx_t_1;
20311 for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) {
20312 __pyx_v_i = __pyx_t_3;
20321 (__pyx_v_mslice->shape[__pyx_v_i]) = 1;
20330 (__pyx_v_mslice->strides[__pyx_v_i]) = (__pyx_v_mslice->strides[0]);
20339 (__pyx_v_mslice->suboffsets[__pyx_v_i]) = -1
L;
20353 __Pyx_WriteUnraisable(
"View.MemoryView.broadcast_leading", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 1);
20355 __Pyx_TraceReturn(Py_None, 1);
20366 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) {
20367 __Pyx_TraceDeclarations
20369 int __pyx_lineno = 0;
20370 const char *__pyx_filename = NULL;
20371 int __pyx_clineno = 0;
20372 __Pyx_TraceCall(
"refcount_copying", __pyx_f[1], 1362, 1, __PYX_ERR(1, 1362, __pyx_L1_error));
20381 __pyx_t_1 = (__pyx_v_dtype_is_object != 0);
20391 __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);
20413 __Pyx_WriteUnraisable(
"View.MemoryView.refcount_copying", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 1);
20415 __Pyx_TraceReturn(Py_None, 1);
20426 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) {
20427 __Pyx_TraceDeclarations
20428 __Pyx_RefNannyDeclarations
20429 int __pyx_lineno = 0;
20430 const char *__pyx_filename = NULL;
20431 int __pyx_clineno = 0;
20433 PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
20435 __Pyx_RefNannySetupContext(
"refcount_objects_in_slice_with_gil", 0);
20436 __Pyx_TraceCall(
"refcount_objects_in_slice_with_gil", __pyx_f[1], 1371, 0, __PYX_ERR(1, 1371, __pyx_L1_error));
20445 __pyx_memoryview_refcount_objects_in_slice(__pyx_v_data, __pyx_v_shape, __pyx_v_strides, __pyx_v_ndim, __pyx_v_inc);
20458 __Pyx_WriteUnraisable(
"View.MemoryView.refcount_objects_in_slice_with_gil", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
20460 __Pyx_TraceReturn(Py_None, 0);
20461 __Pyx_RefNannyFinishContext();
20463 __Pyx_PyGILState_Release(__pyx_gilstate_save);
20475 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) {
20476 CYTHON_UNUSED Py_ssize_t __pyx_v_i;
20477 __Pyx_TraceDeclarations
20478 __Pyx_RefNannyDeclarations
20479 Py_ssize_t __pyx_t_1;
20480 Py_ssize_t __pyx_t_2;
20481 Py_ssize_t __pyx_t_3;
20483 int __pyx_lineno = 0;
20484 const char *__pyx_filename = NULL;
20485 int __pyx_clineno = 0;
20486 __Pyx_RefNannySetupContext(
"refcount_objects_in_slice", 0);
20487 __Pyx_TraceCall(
"refcount_objects_in_slice", __pyx_f[1], 1377, 0, __PYX_ERR(1, 1377, __pyx_L1_error));
20496 __pyx_t_1 = (__pyx_v_shape[0]);
20497 __pyx_t_2 = __pyx_t_1;
20498 for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) {
20499 __pyx_v_i = __pyx_t_3;
20508 __pyx_t_4 = ((__pyx_v_ndim == 1) != 0);
20518 __pyx_t_4 = (__pyx_v_inc != 0);
20528 Py_INCREF((((PyObject **)__pyx_v_data)[0]));
20548 Py_DECREF((((PyObject **)__pyx_v_data)[0]));
20578 __pyx_memoryview_refcount_objects_in_slice(__pyx_v_data, (__pyx_v_shape + 1), (__pyx_v_strides + 1), (__pyx_v_ndim - 1), __pyx_v_inc);
20589 __pyx_v_data = (__pyx_v_data + (__pyx_v_strides[0]));
20603 __Pyx_WriteUnraisable(
"View.MemoryView.refcount_objects_in_slice", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
20605 __Pyx_TraceReturn(Py_None, 0);
20606 __Pyx_RefNannyFinishContext();
20617 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) {
20618 __Pyx_TraceDeclarations
20619 int __pyx_lineno = 0;
20620 const char *__pyx_filename = NULL;
20621 int __pyx_clineno = 0;
20622 __Pyx_TraceCall(
"slice_assign_scalar", __pyx_f[1], 1397, 1, __PYX_ERR(1, 1397, __pyx_L1_error));
20631 __pyx_memoryview_refcount_copying(__pyx_v_dst, __pyx_v_dtype_is_object, __pyx_v_ndim, 0);
20640 __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);
20649 __pyx_memoryview_refcount_copying(__pyx_v_dst, __pyx_v_dtype_is_object, __pyx_v_ndim, 1);
20662 __Pyx_WriteUnraisable(
"View.MemoryView.slice_assign_scalar", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 1);
20664 __Pyx_TraceReturn(Py_None, 1);
20675 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) {
20676 CYTHON_UNUSED Py_ssize_t __pyx_v_i;
20677 Py_ssize_t __pyx_v_stride;
20678 Py_ssize_t __pyx_v_extent;
20679 __Pyx_TraceDeclarations
20681 Py_ssize_t __pyx_t_2;
20682 Py_ssize_t __pyx_t_3;
20683 Py_ssize_t __pyx_t_4;
20684 int __pyx_lineno = 0;
20685 const char *__pyx_filename = NULL;
20686 int __pyx_clineno = 0;
20687 __Pyx_TraceCall(
"_slice_assign_scalar", __pyx_f[1], 1407, 1, __PYX_ERR(1, 1407, __pyx_L1_error));
20696 __pyx_v_stride = (__pyx_v_strides[0]);
20705 __pyx_v_extent = (__pyx_v_shape[0]);
20714 __pyx_t_1 = ((__pyx_v_ndim == 1) != 0);
20724 __pyx_t_2 = __pyx_v_extent;
20725 __pyx_t_3 = __pyx_t_2;
20726 for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
20727 __pyx_v_i = __pyx_t_4;
20736 (void)(memcpy(__pyx_v_data, __pyx_v_item, __pyx_v_itemsize));
20745 __pyx_v_data = (__pyx_v_data + __pyx_v_stride);
20766 __pyx_t_2 = __pyx_v_extent;
20767 __pyx_t_3 = __pyx_t_2;
20768 for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
20769 __pyx_v_i = __pyx_t_4;
20778 __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);
20787 __pyx_v_data = (__pyx_v_data + __pyx_v_stride);
20803 __Pyx_WriteUnraisable(
"View.MemoryView._slice_assign_scalar", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 1);
20805 __Pyx_TraceReturn(Py_None, 1);
20815 static PyObject *__pyx_pw_15View_dot_MemoryView_1__pyx_unpickle_Enum(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
20816 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};
20817 static PyObject *__pyx_pw_15View_dot_MemoryView_1__pyx_unpickle_Enum(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
20818 PyObject *__pyx_v___pyx_type = 0;
20819 long __pyx_v___pyx_checksum;
20820 PyObject *__pyx_v___pyx_state = 0;
20821 int __pyx_lineno = 0;
20822 const char *__pyx_filename = NULL;
20823 int __pyx_clineno = 0;
20824 PyObject *__pyx_r = 0;
20825 __Pyx_RefNannyDeclarations
20826 __Pyx_RefNannySetupContext(
"__pyx_unpickle_Enum (wrapper)", 0);
20828 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_pyx_type,&__pyx_n_s_pyx_checksum,&__pyx_n_s_pyx_state,0};
20829 PyObject* values[3] = {0,0,0};
20830 if (unlikely(__pyx_kwds)) {
20831 Py_ssize_t kw_args;
20832 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
20833 switch (pos_args) {
20834 case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
20835 CYTHON_FALLTHROUGH;
20836 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
20837 CYTHON_FALLTHROUGH;
20838 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
20839 CYTHON_FALLTHROUGH;
20841 default:
goto __pyx_L5_argtuple_error;
20843 kw_args = PyDict_Size(__pyx_kwds);
20844 switch (pos_args) {
20846 if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pyx_type)) != 0)) kw_args--;
20847 else goto __pyx_L5_argtuple_error;
20848 CYTHON_FALLTHROUGH;
20850 if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pyx_checksum)) != 0)) kw_args--;
20852 __Pyx_RaiseArgtupleInvalid(
"__pyx_unpickle_Enum", 1, 3, 3, 1); __PYX_ERR(1, 1, __pyx_L3_error)
20854 CYTHON_FALLTHROUGH;
20856 if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pyx_state)) != 0)) kw_args--;
20858 __Pyx_RaiseArgtupleInvalid(
"__pyx_unpickle_Enum", 1, 3, 3, 2); __PYX_ERR(1, 1, __pyx_L3_error)
20861 if (unlikely(kw_args > 0)) {
20862 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args,
"__pyx_unpickle_Enum") < 0)) __PYX_ERR(1, 1, __pyx_L3_error)
20864 }
else if (PyTuple_GET_SIZE(__pyx_args) != 3) {
20865 goto __pyx_L5_argtuple_error;
20867 values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
20868 values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
20869 values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
20871 __pyx_v___pyx_type = values[0];
20872 __pyx_v___pyx_checksum = __Pyx_PyInt_As_long(values[1]);
if (unlikely((__pyx_v___pyx_checksum == (
long)-1) && PyErr_Occurred())) __PYX_ERR(1, 1, __pyx_L3_error)
20873 __pyx_v___pyx_state = values[2];
20875 goto __pyx_L4_argument_unpacking_done;
20876 __pyx_L5_argtuple_error:;
20877 __Pyx_RaiseArgtupleInvalid(
"__pyx_unpickle_Enum", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(1, 1, __pyx_L3_error)
20879 __Pyx_AddTraceback(
"View.MemoryView.__pyx_unpickle_Enum", __pyx_clineno, __pyx_lineno, __pyx_filename);
20880 __Pyx_RefNannyFinishContext();
20882 __pyx_L4_argument_unpacking_done:;
20883 __pyx_r = __pyx_pf_15View_dot_MemoryView___pyx_unpickle_Enum(__pyx_self, __pyx_v___pyx_type, __pyx_v___pyx_checksum, __pyx_v___pyx_state);
20886 __Pyx_RefNannyFinishContext();
20890 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) {
20891 PyObject *__pyx_v___pyx_PickleError = 0;
20892 PyObject *__pyx_v___pyx_result = 0;
20893 PyObject *__pyx_r = NULL;
20894 __Pyx_TraceDeclarations
20895 __Pyx_RefNannyDeclarations
20896 PyObject *__pyx_t_1 = NULL;
20899 PyObject *__pyx_t_4 = NULL;
20900 PyObject *__pyx_t_5 = NULL;
20901 PyObject *__pyx_t_6 = NULL;
20902 int __pyx_lineno = 0;
20903 const char *__pyx_filename = NULL;
20904 int __pyx_clineno = 0;
20905 __Pyx_TraceFrameInit(__pyx_codeobj__35)
20906 __Pyx_RefNannySetupContext(
"__pyx_unpickle_Enum", 0);
20907 __Pyx_TraceCall(
"__pyx_unpickle_Enum", __pyx_f[1], 1, 0, __PYX_ERR(1, 1, __pyx_L1_error));
20916 __pyx_t_1 = __Pyx_PyInt_From_long(__pyx_v___pyx_checksum);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 4, __pyx_L1_error)
20917 __Pyx_GOTREF(__pyx_t_1);
20918 __pyx_t_2 = (__Pyx_PySequence_ContainsTF(__pyx_t_1, __pyx_tuple__36, Py_NE));
if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(1, 4, __pyx_L1_error)
20919 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
20920 __pyx_t_3 = (__pyx_t_2 != 0);
20930 __pyx_t_1 = PyList_New(1);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 5, __pyx_L1_error)
20931 __Pyx_GOTREF(__pyx_t_1);
20932 __Pyx_INCREF(__pyx_n_s_PickleError);
20933 __Pyx_GIVEREF(__pyx_n_s_PickleError);
20934 PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_s_PickleError);
20935 __pyx_t_4 = __Pyx_Import(__pyx_n_s_pickle, __pyx_t_1, 0);
if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 5, __pyx_L1_error)
20936 __Pyx_GOTREF(__pyx_t_4);
20937 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
20938 __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_4, __pyx_n_s_PickleError);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 5, __pyx_L1_error)
20939 __Pyx_GOTREF(__pyx_t_1);
20940 __Pyx_INCREF(__pyx_t_1);
20941 __pyx_v___pyx_PickleError = __pyx_t_1;
20942 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
20943 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
20952 __pyx_t_1 = __Pyx_PyInt_From_long(__pyx_v___pyx_checksum);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 6, __pyx_L1_error)
20953 __Pyx_GOTREF(__pyx_t_1);
20954 __pyx_t_5 = __Pyx_PyString_Format(__pyx_kp_s_Incompatible_checksums_0x_x_vs_0_2, __pyx_t_1);
if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 6, __pyx_L1_error)
20955 __Pyx_GOTREF(__pyx_t_5);
20956 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
20957 __Pyx_INCREF(__pyx_v___pyx_PickleError);
20958 __pyx_t_1 = __pyx_v___pyx_PickleError; __pyx_t_6 = NULL;
20959 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_1))) {
20960 __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_1);
20961 if (likely(__pyx_t_6)) {
20962 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_1);
20963 __Pyx_INCREF(__pyx_t_6);
20964 __Pyx_INCREF(
function);
20965 __Pyx_DECREF_SET(__pyx_t_1,
function);
20968 __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);
20969 __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
20970 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
20971 if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 6, __pyx_L1_error)
20972 __Pyx_GOTREF(__pyx_t_4);
20973 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
20974 __Pyx_Raise(__pyx_t_4, 0, 0, 0);
20975 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
20976 __PYX_ERR(1, 6, __pyx_L1_error)
20994 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_MemviewEnum_type), __pyx_n_s_new);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 7, __pyx_L1_error)
20995 __Pyx_GOTREF(__pyx_t_1);
20997 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_1))) {
20998 __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_1);
20999 if (likely(__pyx_t_5)) {
21000 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_1);
21001 __Pyx_INCREF(__pyx_t_5);
21002 __Pyx_INCREF(
function);
21003 __Pyx_DECREF_SET(__pyx_t_1,
function);
21006 __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);
21007 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
21008 if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 7, __pyx_L1_error)
21009 __Pyx_GOTREF(__pyx_t_4);
21010 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
21011 __pyx_v___pyx_result = __pyx_t_4;
21021 __pyx_t_3 = (__pyx_v___pyx_state != Py_None);
21022 __pyx_t_2 = (__pyx_t_3 != 0);
21032 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(1, 9, __pyx_L1_error)
21033 __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(1, 9, __pyx_L1_error)
21034 __Pyx_GOTREF(__pyx_t_4);
21035 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
21053 __Pyx_XDECREF(__pyx_r);
21054 __Pyx_INCREF(__pyx_v___pyx_result);
21055 __pyx_r = __pyx_v___pyx_result;
21066 __Pyx_XDECREF(__pyx_t_1);
21067 __Pyx_XDECREF(__pyx_t_4);
21068 __Pyx_XDECREF(__pyx_t_5);
21069 __Pyx_XDECREF(__pyx_t_6);
21070 __Pyx_AddTraceback(
"View.MemoryView.__pyx_unpickle_Enum", __pyx_clineno, __pyx_lineno, __pyx_filename);
21073 __Pyx_XDECREF(__pyx_v___pyx_PickleError);
21074 __Pyx_XDECREF(__pyx_v___pyx_result);
21075 __Pyx_XGIVEREF(__pyx_r);
21076 __Pyx_TraceReturn(__pyx_r, 0);
21077 __Pyx_RefNannyFinishContext();
21089 static PyObject *__pyx_unpickle_Enum__set_state(
struct __pyx_MemviewEnum_obj *__pyx_v___pyx_result, PyObject *__pyx_v___pyx_state) {
21090 PyObject *__pyx_r = NULL;
21091 __Pyx_TraceDeclarations
21092 __Pyx_RefNannyDeclarations
21093 PyObject *__pyx_t_1 = NULL;
21095 Py_ssize_t __pyx_t_3;
21098 PyObject *__pyx_t_6 = NULL;
21099 PyObject *__pyx_t_7 = NULL;
21100 PyObject *__pyx_t_8 = NULL;
21101 int __pyx_lineno = 0;
21102 const char *__pyx_filename = NULL;
21103 int __pyx_clineno = 0;
21104 __Pyx_RefNannySetupContext(
"__pyx_unpickle_Enum__set_state", 0);
21105 __Pyx_TraceCall(
"__pyx_unpickle_Enum__set_state", __pyx_f[1], 11, 0, __PYX_ERR(1, 11, __pyx_L1_error));
21114 if (unlikely(__pyx_v___pyx_state == Py_None)) {
21115 PyErr_SetString(PyExc_TypeError,
"'NoneType' object is not subscriptable");
21116 __PYX_ERR(1, 12, __pyx_L1_error)
21118 __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 0,
long, 1, __Pyx_PyInt_From_long, 0, 0, 0);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 12, __pyx_L1_error)
21119 __Pyx_GOTREF(__pyx_t_1);
21120 __Pyx_GIVEREF(__pyx_t_1);
21121 __Pyx_GOTREF(__pyx_v___pyx_result->name);
21122 __Pyx_DECREF(__pyx_v___pyx_result->name);
21123 __pyx_v___pyx_result->name = __pyx_t_1;
21132 if (unlikely(__pyx_v___pyx_state == Py_None)) {
21133 PyErr_SetString(PyExc_TypeError,
"object of type 'NoneType' has no len()");
21134 __PYX_ERR(1, 13, __pyx_L1_error)
21136 __pyx_t_3 = PyTuple_GET_SIZE(__pyx_v___pyx_state);
if (unlikely(__pyx_t_3 == ((Py_ssize_t)-1))) __PYX_ERR(1, 13, __pyx_L1_error)
21137 __pyx_t_4 = ((__pyx_t_3 > 1) != 0);
21140 __pyx_t_2 = __pyx_t_4;
21141 goto __pyx_L4_bool_binop_done;
21143 __pyx_t_4 = __Pyx_HasAttr(((PyObject *)__pyx_v___pyx_result), __pyx_n_s_dict);
if (unlikely(__pyx_t_4 == ((
int)-1))) __PYX_ERR(1, 13, __pyx_L1_error)
21144 __pyx_t_5 = (__pyx_t_4 != 0);
21145 __pyx_t_2 = __pyx_t_5;
21146 __pyx_L4_bool_binop_done:;
21154 __pyx_t_6 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v___pyx_result), __pyx_n_s_dict);
if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 14, __pyx_L1_error)
21155 __Pyx_GOTREF(__pyx_t_6);
21156 __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_update);
if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 14, __pyx_L1_error)
21157 __Pyx_GOTREF(__pyx_t_7);
21158 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
21159 if (unlikely(__pyx_v___pyx_state == Py_None)) {
21160 PyErr_SetString(PyExc_TypeError,
"'NoneType' object is not subscriptable");
21161 __PYX_ERR(1, 14, __pyx_L1_error)
21163 __pyx_t_6 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 1,
long, 1, __Pyx_PyInt_From_long, 0, 0, 0);
if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 14, __pyx_L1_error)
21164 __Pyx_GOTREF(__pyx_t_6);
21166 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_7))) {
21167 __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_7);
21168 if (likely(__pyx_t_8)) {
21169 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_7);
21170 __Pyx_INCREF(__pyx_t_8);
21171 __Pyx_INCREF(
function);
21172 __Pyx_DECREF_SET(__pyx_t_7,
function);
21175 __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);
21176 __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
21177 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
21178 if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 14, __pyx_L1_error)
21179 __Pyx_GOTREF(__pyx_t_1);
21180 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
21181 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
21200 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
21203 __Pyx_XDECREF(__pyx_t_1);
21204 __Pyx_XDECREF(__pyx_t_6);
21205 __Pyx_XDECREF(__pyx_t_7);
21206 __Pyx_XDECREF(__pyx_t_8);
21207 __Pyx_AddTraceback(
"View.MemoryView.__pyx_unpickle_Enum__set_state", __pyx_clineno, __pyx_lineno, __pyx_filename);
21210 __Pyx_XGIVEREF(__pyx_r);
21211 __Pyx_TraceReturn(__pyx_r, 0);
21212 __Pyx_RefNannyFinishContext();
21216 static PyObject *__pyx_tp_new_18BoundaryConditions_BC_Base(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
21217 struct __pyx_obj_18BoundaryConditions_BC_Base *p;
21219 if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) {
21220 o = (*t->tp_alloc)(t, 0);
21222 o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0);
21224 if (unlikely(!o))
return 0;
21225 p = ((
struct __pyx_obj_18BoundaryConditions_BC_Base *)o);
21226 p->Shape = Py_None; Py_INCREF(Py_None);
21227 p->name = ((PyObject*)Py_None); Py_INCREF(Py_None);
21228 p->BC_type = ((PyObject*)Py_None); Py_INCREF(Py_None);
21229 p->ct = Py_None; Py_INCREF(Py_None);
21230 p->_b_or.data = NULL;
21231 p->_b_or.memview = NULL;
21235 static void __pyx_tp_dealloc_18BoundaryConditions_BC_Base(PyObject *o) {
21236 struct __pyx_obj_18BoundaryConditions_BC_Base *p = (
struct __pyx_obj_18BoundaryConditions_BC_Base *)o;
21237 #if CYTHON_USE_TP_FINALIZE
21238 if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) {
21239 if (PyObject_CallFinalizerFromDealloc(o))
return;
21242 PyObject_GC_UnTrack(o);
21243 Py_CLEAR(p->Shape);
21245 Py_CLEAR(p->BC_type);
21247 __PYX_XDEC_MEMVIEW(&p->_b_or, 1);
21248 (*Py_TYPE(o)->tp_free)(o);
21251 static int __pyx_tp_traverse_18BoundaryConditions_BC_Base(PyObject *o, visitproc
v,
void *a) {
21253 struct __pyx_obj_18BoundaryConditions_BC_Base *p = (
struct __pyx_obj_18BoundaryConditions_BC_Base *)o;
21255 e = (*v)(p->Shape, a);
if (e)
return e;
21258 e = (*v)(p->ct, a);
if (e)
return e;
21263 static int __pyx_tp_clear_18BoundaryConditions_BC_Base(PyObject *o) {
21265 struct __pyx_obj_18BoundaryConditions_BC_Base *p = (
struct __pyx_obj_18BoundaryConditions_BC_Base *)o;
21266 tmp = ((PyObject*)p->Shape);
21267 p->Shape = Py_None; Py_INCREF(Py_None);
21269 tmp = ((PyObject*)p->ct);
21270 p->ct = Py_None; Py_INCREF(Py_None);
21275 static PyObject *__pyx_getprop_18BoundaryConditions_7BC_Base_nd(PyObject *o, CYTHON_UNUSED
void *x) {
21276 return __pyx_pw_18BoundaryConditions_7BC_Base_2nd_1__get__(o);
21279 static int __pyx_setprop_18BoundaryConditions_7BC_Base_nd(PyObject *o, PyObject *
v, CYTHON_UNUSED
void *x) {
21281 return __pyx_pw_18BoundaryConditions_7BC_Base_2nd_3__set__(o,
v);
21284 PyErr_SetString(PyExc_NotImplementedError,
"__del__");
21289 static PyObject *__pyx_getprop_18BoundaryConditions_7BC_Base_Shape(PyObject *o, CYTHON_UNUSED
void *x) {
21290 return __pyx_pw_18BoundaryConditions_7BC_Base_5Shape_1__get__(o);
21293 static int __pyx_setprop_18BoundaryConditions_7BC_Base_Shape(PyObject *o, PyObject *
v, CYTHON_UNUSED
void *x) {
21295 return __pyx_pw_18BoundaryConditions_7BC_Base_5Shape_3__set__(o,
v);
21298 return __pyx_pw_18BoundaryConditions_7BC_Base_5Shape_5__del__(o);
21302 static PyObject *__pyx_getprop_18BoundaryConditions_7BC_Base_name(PyObject *o, CYTHON_UNUSED
void *x) {
21303 return __pyx_pw_18BoundaryConditions_7BC_Base_4name_1__get__(o);
21306 static int __pyx_setprop_18BoundaryConditions_7BC_Base_name(PyObject *o, PyObject *
v, CYTHON_UNUSED
void *x) {
21308 return __pyx_pw_18BoundaryConditions_7BC_Base_4name_3__set__(o,
v);
21311 return __pyx_pw_18BoundaryConditions_7BC_Base_4name_5__del__(o);
21315 static PyObject *__pyx_getprop_18BoundaryConditions_7BC_Base_BC_type(PyObject *o, CYTHON_UNUSED
void *x) {
21316 return __pyx_pw_18BoundaryConditions_7BC_Base_7BC_type_1__get__(o);
21319 static int __pyx_setprop_18BoundaryConditions_7BC_Base_BC_type(PyObject *o, PyObject *
v, CYTHON_UNUSED
void *x) {
21321 return __pyx_pw_18BoundaryConditions_7BC_Base_7BC_type_3__set__(o,
v);
21324 return __pyx_pw_18BoundaryConditions_7BC_Base_7BC_type_5__del__(o);
21328 static PyObject *__pyx_getprop_18BoundaryConditions_7BC_Base_ct(PyObject *o, CYTHON_UNUSED
void *x) {
21329 return __pyx_pw_18BoundaryConditions_7BC_Base_2ct_1__get__(o);
21332 static int __pyx_setprop_18BoundaryConditions_7BC_Base_ct(PyObject *o, PyObject *
v, CYTHON_UNUSED
void *x) {
21334 return __pyx_pw_18BoundaryConditions_7BC_Base_2ct_3__set__(o,
v);
21337 return __pyx_pw_18BoundaryConditions_7BC_Base_2ct_5__del__(o);
21341 static PyMethodDef __pyx_methods_18BoundaryConditions_BC_Base[] = {
21342 {
"getContext", (PyCFunction)(
void*)(PyCFunctionWithKeywords)__pyx_pw_18BoundaryConditions_7BC_Base_3getContext, METH_VARARGS|METH_KEYWORDS, __pyx_doc_18BoundaryConditions_7BC_Base_2getContext},
21343 {
"__reduce_cython__", (PyCFunction)__pyx_pw_18BoundaryConditions_7BC_Base_5__reduce_cython__, METH_NOARGS, __pyx_doc_18BoundaryConditions_7BC_Base_4__reduce_cython__},
21344 {
"__setstate_cython__", (PyCFunction)__pyx_pw_18BoundaryConditions_7BC_Base_7__setstate_cython__, METH_O, __pyx_doc_18BoundaryConditions_7BC_Base_6__setstate_cython__},
21348 static struct PyGetSetDef __pyx_getsets_18BoundaryConditions_BC_Base[] = {
21349 {(
char *)
"nd", __pyx_getprop_18BoundaryConditions_7BC_Base_nd, __pyx_setprop_18BoundaryConditions_7BC_Base_nd, (
char *)
"nd: 'int'", 0},
21350 {(
char *)
"Shape", __pyx_getprop_18BoundaryConditions_7BC_Base_Shape, __pyx_setprop_18BoundaryConditions_7BC_Base_Shape, (
char *)
"Shape: object", 0},
21351 {(
char *)
"name", __pyx_getprop_18BoundaryConditions_7BC_Base_name, __pyx_setprop_18BoundaryConditions_7BC_Base_name, (
char *)
"name: str", 0},
21352 {(
char *)
"BC_type", __pyx_getprop_18BoundaryConditions_7BC_Base_BC_type, __pyx_setprop_18BoundaryConditions_7BC_Base_BC_type, (
char *)
"BC_type: str", 0},
21353 {(
char *)
"ct", __pyx_getprop_18BoundaryConditions_7BC_Base_ct, __pyx_setprop_18BoundaryConditions_7BC_Base_ct, (
char *)
"ct: object", 0},
21357 static PyTypeObject __pyx_type_18BoundaryConditions_BC_Base = {
21358 PyVarObject_HEAD_INIT(0, 0)
21359 "BoundaryConditions.BC_Base",
21360 sizeof(
struct __pyx_obj_18BoundaryConditions_BC_Base),
21362 __pyx_tp_dealloc_18BoundaryConditions_BC_Base,
21363 #if PY_VERSION_HEX < 0x030800b4
21366 #if PY_VERSION_HEX >= 0x030800b4
21371 #if PY_MAJOR_VERSION < 3
21374 #if PY_MAJOR_VERSION >= 3
21387 Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC,
21388 "BC_Base(shape=None, name=None, b_or=None, b_i=0, nd=None)\n\n Generic class regrouping boundary conditions\n ",
21389 __pyx_tp_traverse_18BoundaryConditions_BC_Base,
21390 __pyx_tp_clear_18BoundaryConditions_BC_Base,
21395 __pyx_methods_18BoundaryConditions_BC_Base,
21397 __pyx_getsets_18BoundaryConditions_BC_Base,
21403 __pyx_pw_18BoundaryConditions_7BC_Base_1__init__,
21405 __pyx_tp_new_18BoundaryConditions_BC_Base,
21415 #if PY_VERSION_HEX >= 0x030400a1
21418 #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800)
21421 #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
21424 #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000
21428 static struct __pyx_vtabstruct_18BoundaryConditions_BoundaryCondition __pyx_vtable_18BoundaryConditions_BoundaryCondition;
21430 static PyObject *__pyx_tp_new_18BoundaryConditions_BoundaryCondition(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
21431 struct __pyx_obj_18BoundaryConditions_BoundaryCondition *p;
21433 if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) {
21434 o = (*t->tp_alloc)(t, 0);
21436 o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0);
21438 if (unlikely(!o))
return 0;
21439 p = ((
struct __pyx_obj_18BoundaryConditions_BoundaryCondition *)o);
21440 p->__pyx_vtab = __pyx_vtabptr_18BoundaryConditions_BoundaryCondition;
21441 p->uOfXT = Py_None; Py_INCREF(Py_None);
21445 static void __pyx_tp_dealloc_18BoundaryConditions_BoundaryCondition(PyObject *o) {
21446 struct __pyx_obj_18BoundaryConditions_BoundaryCondition *p = (
struct __pyx_obj_18BoundaryConditions_BoundaryCondition *)o;
21447 #if CYTHON_USE_TP_FINALIZE
21448 if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) {
21449 if (PyObject_CallFinalizerFromDealloc(o))
return;
21452 PyObject_GC_UnTrack(o);
21453 Py_CLEAR(p->uOfXT);
21454 (*Py_TYPE(o)->tp_free)(o);
21457 static int __pyx_tp_traverse_18BoundaryConditions_BoundaryCondition(PyObject *o, visitproc
v,
void *a) {
21459 struct __pyx_obj_18BoundaryConditions_BoundaryCondition *p = (
struct __pyx_obj_18BoundaryConditions_BoundaryCondition *)o;
21461 e = (*v)(p->uOfXT, a);
if (e)
return e;
21466 static int __pyx_tp_clear_18BoundaryConditions_BoundaryCondition(PyObject *o) {
21468 struct __pyx_obj_18BoundaryConditions_BoundaryCondition *p = (
struct __pyx_obj_18BoundaryConditions_BoundaryCondition *)o;
21469 tmp = ((PyObject*)p->uOfXT);
21470 p->uOfXT = Py_None; Py_INCREF(Py_None);
21475 static PyObject *__pyx_getprop_18BoundaryConditions_17BoundaryCondition_uOfXT(PyObject *o, CYTHON_UNUSED
void *x) {
21476 return __pyx_pw_18BoundaryConditions_17BoundaryCondition_5uOfXT_1__get__(o);
21479 static int __pyx_setprop_18BoundaryConditions_17BoundaryCondition_uOfXT(PyObject *o, PyObject *
v, CYTHON_UNUSED
void *x) {
21481 return __pyx_pw_18BoundaryConditions_17BoundaryCondition_5uOfXT_3__set__(o,
v);
21484 return __pyx_pw_18BoundaryConditions_17BoundaryCondition_5uOfXT_5__del__(o);
21488 static PyMethodDef __pyx_methods_18BoundaryConditions_BoundaryCondition[] = {
21489 {
"init_cython", (PyCFunction)__pyx_pw_18BoundaryConditions_17BoundaryCondition_3init_cython, METH_NOARGS, __pyx_doc_18BoundaryConditions_17BoundaryCondition_2init_cython},
21490 {
"setConstantBC", (PyCFunction)__pyx_pw_18BoundaryConditions_17BoundaryCondition_7setConstantBC, METH_O, __pyx_doc_18BoundaryConditions_17BoundaryCondition_6setConstantBC},
21491 {
"setLinearBC", (PyCFunction)(
void*)(PyCFunctionWithKeywords)__pyx_pw_18BoundaryConditions_17BoundaryCondition_9setLinearBC, METH_VARARGS|METH_KEYWORDS, __pyx_doc_18BoundaryConditions_17BoundaryCondition_8setLinearBC},
21492 {
"setLinearRamp", (PyCFunction)(
void*)(PyCFunctionWithKeywords)__pyx_pw_18BoundaryConditions_17BoundaryCondition_11setLinearRamp, METH_VARARGS|METH_KEYWORDS, __pyx_doc_18BoundaryConditions_17BoundaryCondition_10setLinearRamp},
21493 {
"__reduce_cython__", (PyCFunction)__pyx_pw_18BoundaryConditions_17BoundaryCondition_13__reduce_cython__, METH_NOARGS, __pyx_doc_18BoundaryConditions_17BoundaryCondition_12__reduce_cython__},
21494 {
"__setstate_cython__", (PyCFunction)__pyx_pw_18BoundaryConditions_17BoundaryCondition_15__setstate_cython__, METH_O, __pyx_doc_18BoundaryConditions_17BoundaryCondition_14__setstate_cython__},
21498 static struct PyGetSetDef __pyx_getsets_18BoundaryConditions_BoundaryCondition[] = {
21499 {(
char *)
"uOfXT", __pyx_getprop_18BoundaryConditions_17BoundaryCondition_uOfXT, __pyx_setprop_18BoundaryConditions_17BoundaryCondition_uOfXT, (
char *)
"uOfXT: object", 0},
21503 static PyTypeObject __pyx_type_18BoundaryConditions_BoundaryCondition = {
21504 PyVarObject_HEAD_INIT(0, 0)
21505 "BoundaryConditions.BoundaryCondition",
21506 sizeof(
struct __pyx_obj_18BoundaryConditions_BoundaryCondition),
21508 __pyx_tp_dealloc_18BoundaryConditions_BoundaryCondition,
21509 #if PY_VERSION_HEX < 0x030800b4
21512 #if PY_VERSION_HEX >= 0x030800b4
21517 #if PY_MAJOR_VERSION < 3
21520 #if PY_MAJOR_VERSION >= 3
21533 Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC,
21534 "BoundaryCondition()\n\n Boundary condition class\n\n Attributes\n ----------\n uOfXT: func or None\n boundary condition function of x (array_like) and t (float) or None for\n no boundary condition\n ",
21535 __pyx_tp_traverse_18BoundaryConditions_BoundaryCondition,
21536 __pyx_tp_clear_18BoundaryConditions_BoundaryCondition,
21541 __pyx_methods_18BoundaryConditions_BoundaryCondition,
21543 __pyx_getsets_18BoundaryConditions_BoundaryCondition,
21549 __pyx_pw_18BoundaryConditions_17BoundaryCondition_1__init__,
21551 __pyx_tp_new_18BoundaryConditions_BoundaryCondition,
21561 #if PY_VERSION_HEX >= 0x030400a1
21564 #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800)
21567 #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
21570 #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000
21575 static struct __pyx_obj_18BoundaryConditions___pyx_scope_struct__setConstantBC *__pyx_freelist_18BoundaryConditions___pyx_scope_struct__setConstantBC[8];
21576 static int __pyx_freecount_18BoundaryConditions___pyx_scope_struct__setConstantBC = 0;
21578 static PyObject *__pyx_tp_new_18BoundaryConditions___pyx_scope_struct__setConstantBC(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
21580 if (CYTHON_COMPILING_IN_CPYTHON && likely((__pyx_freecount_18BoundaryConditions___pyx_scope_struct__setConstantBC > 0) & (t->tp_basicsize ==
sizeof(
struct __pyx_obj_18BoundaryConditions___pyx_scope_struct__setConstantBC)))) {
21581 o = (PyObject*)__pyx_freelist_18BoundaryConditions___pyx_scope_struct__setConstantBC[--__pyx_freecount_18BoundaryConditions___pyx_scope_struct__setConstantBC];
21582 memset(o, 0,
sizeof(
struct __pyx_obj_18BoundaryConditions___pyx_scope_struct__setConstantBC));
21583 (void) PyObject_INIT(o, t);
21584 PyObject_GC_Track(o);
21586 o = (*t->tp_alloc)(t, 0);
21587 if (unlikely(!o))
return 0;
21592 static void __pyx_tp_dealloc_18BoundaryConditions___pyx_scope_struct__setConstantBC(PyObject *o) {
21593 struct __pyx_obj_18BoundaryConditions___pyx_scope_struct__setConstantBC *p = (
struct __pyx_obj_18BoundaryConditions___pyx_scope_struct__setConstantBC *)o;
21594 PyObject_GC_UnTrack(o);
21595 Py_CLEAR(p->__pyx_v_value);
21596 if (CYTHON_COMPILING_IN_CPYTHON && ((__pyx_freecount_18BoundaryConditions___pyx_scope_struct__setConstantBC < 8) & (Py_TYPE(o)->tp_basicsize ==
sizeof(
struct __pyx_obj_18BoundaryConditions___pyx_scope_struct__setConstantBC)))) {
21597 __pyx_freelist_18BoundaryConditions___pyx_scope_struct__setConstantBC[__pyx_freecount_18BoundaryConditions___pyx_scope_struct__setConstantBC++] = ((
struct __pyx_obj_18BoundaryConditions___pyx_scope_struct__setConstantBC *)o);
21599 (*Py_TYPE(o)->tp_free)(o);
21603 static int __pyx_tp_traverse_18BoundaryConditions___pyx_scope_struct__setConstantBC(PyObject *o, visitproc
v,
void *a) {
21605 struct __pyx_obj_18BoundaryConditions___pyx_scope_struct__setConstantBC *p = (
struct __pyx_obj_18BoundaryConditions___pyx_scope_struct__setConstantBC *)o;
21606 if (p->__pyx_v_value) {
21607 e = (*v)(p->__pyx_v_value, a);
if (e)
return e;
21612 static int __pyx_tp_clear_18BoundaryConditions___pyx_scope_struct__setConstantBC(PyObject *o) {
21614 struct __pyx_obj_18BoundaryConditions___pyx_scope_struct__setConstantBC *p = (
struct __pyx_obj_18BoundaryConditions___pyx_scope_struct__setConstantBC *)o;
21615 tmp = ((PyObject*)p->__pyx_v_value);
21616 p->__pyx_v_value = Py_None; Py_INCREF(Py_None);
21621 static PyTypeObject __pyx_type_18BoundaryConditions___pyx_scope_struct__setConstantBC = {
21622 PyVarObject_HEAD_INIT(0, 0)
21623 "BoundaryConditions.__pyx_scope_struct__setConstantBC",
21624 sizeof(
struct __pyx_obj_18BoundaryConditions___pyx_scope_struct__setConstantBC),
21626 __pyx_tp_dealloc_18BoundaryConditions___pyx_scope_struct__setConstantBC,
21627 #if PY_VERSION_HEX < 0x030800b4
21630 #if PY_VERSION_HEX >= 0x030800b4
21635 #if PY_MAJOR_VERSION < 3
21638 #if PY_MAJOR_VERSION >= 3
21651 Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC,
21653 __pyx_tp_traverse_18BoundaryConditions___pyx_scope_struct__setConstantBC,
21654 __pyx_tp_clear_18BoundaryConditions___pyx_scope_struct__setConstantBC,
21669 __pyx_tp_new_18BoundaryConditions___pyx_scope_struct__setConstantBC,
21679 #if PY_VERSION_HEX >= 0x030400a1
21682 #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800)
21685 #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
21688 #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000
21693 static struct __pyx_obj_18BoundaryConditions___pyx_scope_struct_1_setLinearBC *__pyx_freelist_18BoundaryConditions___pyx_scope_struct_1_setLinearBC[8];
21694 static int __pyx_freecount_18BoundaryConditions___pyx_scope_struct_1_setLinearBC = 0;
21696 static PyObject *__pyx_tp_new_18BoundaryConditions___pyx_scope_struct_1_setLinearBC(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
21698 if (CYTHON_COMPILING_IN_CPYTHON && likely((__pyx_freecount_18BoundaryConditions___pyx_scope_struct_1_setLinearBC > 0) & (t->tp_basicsize ==
sizeof(
struct __pyx_obj_18BoundaryConditions___pyx_scope_struct_1_setLinearBC)))) {
21699 o = (PyObject*)__pyx_freelist_18BoundaryConditions___pyx_scope_struct_1_setLinearBC[--__pyx_freecount_18BoundaryConditions___pyx_scope_struct_1_setLinearBC];
21700 memset(o, 0,
sizeof(
struct __pyx_obj_18BoundaryConditions___pyx_scope_struct_1_setLinearBC));
21701 (void) PyObject_INIT(o, t);
21702 PyObject_GC_Track(o);
21704 o = (*t->tp_alloc)(t, 0);
21705 if (unlikely(!o))
return 0;
21710 static void __pyx_tp_dealloc_18BoundaryConditions___pyx_scope_struct_1_setLinearBC(PyObject *o) {
21711 struct __pyx_obj_18BoundaryConditions___pyx_scope_struct_1_setLinearBC *p = (
struct __pyx_obj_18BoundaryConditions___pyx_scope_struct_1_setLinearBC *)o;
21712 PyObject_GC_UnTrack(o);
21713 Py_CLEAR(p->__pyx_v_a);
21714 Py_CLEAR(p->__pyx_v_a0);
21715 if (CYTHON_COMPILING_IN_CPYTHON && ((__pyx_freecount_18BoundaryConditions___pyx_scope_struct_1_setLinearBC < 8) & (Py_TYPE(o)->tp_basicsize ==
sizeof(
struct __pyx_obj_18BoundaryConditions___pyx_scope_struct_1_setLinearBC)))) {
21716 __pyx_freelist_18BoundaryConditions___pyx_scope_struct_1_setLinearBC[__pyx_freecount_18BoundaryConditions___pyx_scope_struct_1_setLinearBC++] = ((
struct __pyx_obj_18BoundaryConditions___pyx_scope_struct_1_setLinearBC *)o);
21718 (*Py_TYPE(o)->tp_free)(o);
21722 static int __pyx_tp_traverse_18BoundaryConditions___pyx_scope_struct_1_setLinearBC(PyObject *o, visitproc
v,
void *a) {
21724 struct __pyx_obj_18BoundaryConditions___pyx_scope_struct_1_setLinearBC *p = (
struct __pyx_obj_18BoundaryConditions___pyx_scope_struct_1_setLinearBC *)o;
21725 if (p->__pyx_v_a) {
21726 e = (*v)(p->__pyx_v_a, a);
if (e)
return e;
21728 if (p->__pyx_v_a0) {
21729 e = (*v)(p->__pyx_v_a0, a);
if (e)
return e;
21734 static int __pyx_tp_clear_18BoundaryConditions___pyx_scope_struct_1_setLinearBC(PyObject *o) {
21736 struct __pyx_obj_18BoundaryConditions___pyx_scope_struct_1_setLinearBC *p = (
struct __pyx_obj_18BoundaryConditions___pyx_scope_struct_1_setLinearBC *)o;
21737 tmp = ((PyObject*)p->__pyx_v_a);
21738 p->__pyx_v_a = Py_None; Py_INCREF(Py_None);
21740 tmp = ((PyObject*)p->__pyx_v_a0);
21741 p->__pyx_v_a0 = Py_None; Py_INCREF(Py_None);
21746 static PyTypeObject __pyx_type_18BoundaryConditions___pyx_scope_struct_1_setLinearBC = {
21747 PyVarObject_HEAD_INIT(0, 0)
21748 "BoundaryConditions.__pyx_scope_struct_1_setLinearBC",
21749 sizeof(
struct __pyx_obj_18BoundaryConditions___pyx_scope_struct_1_setLinearBC),
21751 __pyx_tp_dealloc_18BoundaryConditions___pyx_scope_struct_1_setLinearBC,
21752 #if PY_VERSION_HEX < 0x030800b4
21755 #if PY_VERSION_HEX >= 0x030800b4
21760 #if PY_MAJOR_VERSION < 3
21763 #if PY_MAJOR_VERSION >= 3
21776 Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC,
21778 __pyx_tp_traverse_18BoundaryConditions___pyx_scope_struct_1_setLinearBC,
21779 __pyx_tp_clear_18BoundaryConditions___pyx_scope_struct_1_setLinearBC,
21794 __pyx_tp_new_18BoundaryConditions___pyx_scope_struct_1_setLinearBC,
21804 #if PY_VERSION_HEX >= 0x030400a1
21807 #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800)
21810 #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
21813 #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000
21818 static struct __pyx_obj_18BoundaryConditions___pyx_scope_struct_2_setLinearRamp *__pyx_freelist_18BoundaryConditions___pyx_scope_struct_2_setLinearRamp[8];
21819 static int __pyx_freecount_18BoundaryConditions___pyx_scope_struct_2_setLinearRamp = 0;
21821 static PyObject *__pyx_tp_new_18BoundaryConditions___pyx_scope_struct_2_setLinearRamp(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
21823 if (CYTHON_COMPILING_IN_CPYTHON && likely((__pyx_freecount_18BoundaryConditions___pyx_scope_struct_2_setLinearRamp > 0) & (t->tp_basicsize ==
sizeof(
struct __pyx_obj_18BoundaryConditions___pyx_scope_struct_2_setLinearRamp)))) {
21824 o = (PyObject*)__pyx_freelist_18BoundaryConditions___pyx_scope_struct_2_setLinearRamp[--__pyx_freecount_18BoundaryConditions___pyx_scope_struct_2_setLinearRamp];
21825 memset(o, 0,
sizeof(
struct __pyx_obj_18BoundaryConditions___pyx_scope_struct_2_setLinearRamp));
21826 (void) PyObject_INIT(o, t);
21827 PyObject_GC_Track(o);
21829 o = (*t->tp_alloc)(t, 0);
21830 if (unlikely(!o))
return 0;
21835 static void __pyx_tp_dealloc_18BoundaryConditions___pyx_scope_struct_2_setLinearRamp(PyObject *o) {
21836 struct __pyx_obj_18BoundaryConditions___pyx_scope_struct_2_setLinearRamp *p = (
struct __pyx_obj_18BoundaryConditions___pyx_scope_struct_2_setLinearRamp *)o;
21837 PyObject_GC_UnTrack(o);
21838 Py_CLEAR(p->__pyx_v_t1);
21839 Py_CLEAR(p->__pyx_v_value);
21840 if (CYTHON_COMPILING_IN_CPYTHON && ((__pyx_freecount_18BoundaryConditions___pyx_scope_struct_2_setLinearRamp < 8) & (Py_TYPE(o)->tp_basicsize ==
sizeof(
struct __pyx_obj_18BoundaryConditions___pyx_scope_struct_2_setLinearRamp)))) {
21841 __pyx_freelist_18BoundaryConditions___pyx_scope_struct_2_setLinearRamp[__pyx_freecount_18BoundaryConditions___pyx_scope_struct_2_setLinearRamp++] = ((
struct __pyx_obj_18BoundaryConditions___pyx_scope_struct_2_setLinearRamp *)o);
21843 (*Py_TYPE(o)->tp_free)(o);
21847 static int __pyx_tp_traverse_18BoundaryConditions___pyx_scope_struct_2_setLinearRamp(PyObject *o, visitproc
v,
void *a) {
21849 struct __pyx_obj_18BoundaryConditions___pyx_scope_struct_2_setLinearRamp *p = (
struct __pyx_obj_18BoundaryConditions___pyx_scope_struct_2_setLinearRamp *)o;
21850 if (p->__pyx_v_t1) {
21851 e = (*v)(p->__pyx_v_t1, a);
if (e)
return e;
21853 if (p->__pyx_v_value) {
21854 e = (*v)(p->__pyx_v_value, a);
if (e)
return e;
21859 static int __pyx_tp_clear_18BoundaryConditions___pyx_scope_struct_2_setLinearRamp(PyObject *o) {
21861 struct __pyx_obj_18BoundaryConditions___pyx_scope_struct_2_setLinearRamp *p = (
struct __pyx_obj_18BoundaryConditions___pyx_scope_struct_2_setLinearRamp *)o;
21862 tmp = ((PyObject*)p->__pyx_v_t1);
21863 p->__pyx_v_t1 = Py_None; Py_INCREF(Py_None);
21865 tmp = ((PyObject*)p->__pyx_v_value);
21866 p->__pyx_v_value = Py_None; Py_INCREF(Py_None);
21871 static PyTypeObject __pyx_type_18BoundaryConditions___pyx_scope_struct_2_setLinearRamp = {
21872 PyVarObject_HEAD_INIT(0, 0)
21873 "BoundaryConditions.__pyx_scope_struct_2_setLinearRamp",
21874 sizeof(
struct __pyx_obj_18BoundaryConditions___pyx_scope_struct_2_setLinearRamp),
21876 __pyx_tp_dealloc_18BoundaryConditions___pyx_scope_struct_2_setLinearRamp,
21877 #if PY_VERSION_HEX < 0x030800b4
21880 #if PY_VERSION_HEX >= 0x030800b4
21885 #if PY_MAJOR_VERSION < 3
21888 #if PY_MAJOR_VERSION >= 3
21901 Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC,
21903 __pyx_tp_traverse_18BoundaryConditions___pyx_scope_struct_2_setLinearRamp,
21904 __pyx_tp_clear_18BoundaryConditions___pyx_scope_struct_2_setLinearRamp,
21919 __pyx_tp_new_18BoundaryConditions___pyx_scope_struct_2_setLinearRamp,
21929 #if PY_VERSION_HEX >= 0x030400a1
21932 #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800)
21935 #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
21938 #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000
21942 static struct __pyx_vtabstruct_array __pyx_vtable_array;
21944 static PyObject *__pyx_tp_new_array(PyTypeObject *t, PyObject *a, PyObject *k) {
21945 struct __pyx_array_obj *p;
21947 if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) {
21948 o = (*t->tp_alloc)(t, 0);
21950 o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0);
21952 if (unlikely(!o))
return 0;
21953 p = ((
struct __pyx_array_obj *)o);
21954 p->__pyx_vtab = __pyx_vtabptr_array;
21955 p->mode = ((PyObject*)Py_None); Py_INCREF(Py_None);
21956 p->_format = ((PyObject*)Py_None); Py_INCREF(Py_None);
21957 if (unlikely(__pyx_array___cinit__(o, a, k) < 0))
goto bad;
21960 Py_DECREF(o); o = 0;
21964 static void __pyx_tp_dealloc_array(PyObject *o) {
21965 struct __pyx_array_obj *p = (
struct __pyx_array_obj *)o;
21966 #if CYTHON_USE_TP_FINALIZE
21967 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))) {
21968 if (PyObject_CallFinalizerFromDealloc(o))
return;
21972 PyObject *etype, *eval, *etb;
21973 PyErr_Fetch(&etype, &eval, &etb);
21974 __Pyx_SET_REFCNT(o, Py_REFCNT(o) + 1);
21975 __pyx_array___dealloc__(o);
21976 __Pyx_SET_REFCNT(o, Py_REFCNT(o) - 1);
21977 PyErr_Restore(etype, eval, etb);
21980 Py_CLEAR(p->_format);
21981 (*Py_TYPE(o)->tp_free)(o);
21983 static PyObject *__pyx_sq_item_array(PyObject *o, Py_ssize_t i) {
21985 PyObject *x = PyInt_FromSsize_t(i);
if(!x)
return 0;
21986 r = Py_TYPE(o)->tp_as_mapping->mp_subscript(o, x);
21991 static int __pyx_mp_ass_subscript_array(PyObject *o, PyObject *i, PyObject *
v) {
21993 return __pyx_array___setitem__(o, i,
v);
21996 PyErr_Format(PyExc_NotImplementedError,
21997 "Subscript deletion not supported by %.200s", Py_TYPE(o)->tp_name);
22002 static PyObject *__pyx_tp_getattro_array(PyObject *o, PyObject *
n) {
22003 PyObject *
v = __Pyx_PyObject_GenericGetAttr(o,
n);
22004 if (!
v && PyErr_ExceptionMatches(PyExc_AttributeError)) {
22006 v = __pyx_array___getattr__(o,
n);
22011 static PyObject *__pyx_getprop___pyx_array_memview(PyObject *o, CYTHON_UNUSED
void *x) {
22012 return __pyx_pw_15View_dot_MemoryView_5array_7memview_1__get__(o);
22015 static PyMethodDef __pyx_methods_array[] = {
22016 {
"__getattr__", (PyCFunction)__pyx_array___getattr__, METH_O|METH_COEXIST, 0},
22017 {
"__reduce_cython__", (PyCFunction)__pyx_pw___pyx_array_1__reduce_cython__, METH_NOARGS, 0},
22018 {
"__setstate_cython__", (PyCFunction)__pyx_pw___pyx_array_3__setstate_cython__, METH_O, 0},
22022 static struct PyGetSetDef __pyx_getsets_array[] = {
22023 {(
char *)
"memview", __pyx_getprop___pyx_array_memview, 0, (
char *)0, 0},
22027 static PySequenceMethods __pyx_tp_as_sequence_array = {
22028 __pyx_array___len__,
22031 __pyx_sq_item_array,
22040 static PyMappingMethods __pyx_tp_as_mapping_array = {
22041 __pyx_array___len__,
22042 __pyx_array___getitem__,
22043 __pyx_mp_ass_subscript_array,
22046 static PyBufferProcs __pyx_tp_as_buffer_array = {
22047 #if PY_MAJOR_VERSION < 3
22050 #if PY_MAJOR_VERSION < 3
22053 #if PY_MAJOR_VERSION < 3
22056 #if PY_MAJOR_VERSION < 3
22059 __pyx_array_getbuffer,
22063 static PyTypeObject __pyx_type___pyx_array = {
22064 PyVarObject_HEAD_INIT(0, 0)
22065 "BoundaryConditions.array",
22066 sizeof(
struct __pyx_array_obj),
22068 __pyx_tp_dealloc_array,
22069 #if PY_VERSION_HEX < 0x030800b4
22072 #if PY_VERSION_HEX >= 0x030800b4
22077 #if PY_MAJOR_VERSION < 3
22080 #if PY_MAJOR_VERSION >= 3
22085 &__pyx_tp_as_sequence_array,
22086 &__pyx_tp_as_mapping_array,
22090 __pyx_tp_getattro_array,
22092 &__pyx_tp_as_buffer_array,
22093 Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE,
22101 __pyx_methods_array,
22103 __pyx_getsets_array,
22111 __pyx_tp_new_array,
22121 #if PY_VERSION_HEX >= 0x030400a1
22124 #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800)
22127 #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
22130 #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000
22135 static PyObject *__pyx_tp_new_Enum(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
22136 struct __pyx_MemviewEnum_obj *p;
22138 if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) {
22139 o = (*t->tp_alloc)(t, 0);
22141 o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0);
22143 if (unlikely(!o))
return 0;
22144 p = ((
struct __pyx_MemviewEnum_obj *)o);
22145 p->name = Py_None; Py_INCREF(Py_None);
22149 static void __pyx_tp_dealloc_Enum(PyObject *o) {
22150 struct __pyx_MemviewEnum_obj *p = (
struct __pyx_MemviewEnum_obj *)o;
22151 #if CYTHON_USE_TP_FINALIZE
22152 if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) {
22153 if (PyObject_CallFinalizerFromDealloc(o))
return;
22156 PyObject_GC_UnTrack(o);
22158 (*Py_TYPE(o)->tp_free)(o);
22161 static int __pyx_tp_traverse_Enum(PyObject *o, visitproc
v,
void *a) {
22163 struct __pyx_MemviewEnum_obj *p = (
struct __pyx_MemviewEnum_obj *)o;
22165 e = (*v)(p->name, a);
if (e)
return e;
22170 static int __pyx_tp_clear_Enum(PyObject *o) {
22172 struct __pyx_MemviewEnum_obj *p = (
struct __pyx_MemviewEnum_obj *)o;
22173 tmp = ((PyObject*)p->name);
22174 p->name = Py_None; Py_INCREF(Py_None);
22179 static PyMethodDef __pyx_methods_Enum[] = {
22180 {
"__reduce_cython__", (PyCFunction)__pyx_pw___pyx_MemviewEnum_1__reduce_cython__, METH_NOARGS, 0},
22181 {
"__setstate_cython__", (PyCFunction)__pyx_pw___pyx_MemviewEnum_3__setstate_cython__, METH_O, 0},
22185 static PyTypeObject __pyx_type___pyx_MemviewEnum = {
22186 PyVarObject_HEAD_INIT(0, 0)
22187 "BoundaryConditions.Enum",
22188 sizeof(
struct __pyx_MemviewEnum_obj),
22190 __pyx_tp_dealloc_Enum,
22191 #if PY_VERSION_HEX < 0x030800b4
22194 #if PY_VERSION_HEX >= 0x030800b4
22199 #if PY_MAJOR_VERSION < 3
22202 #if PY_MAJOR_VERSION >= 3
22205 __pyx_MemviewEnum___repr__,
22215 Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC,
22217 __pyx_tp_traverse_Enum,
22218 __pyx_tp_clear_Enum,
22223 __pyx_methods_Enum,
22231 __pyx_MemviewEnum___init__,
22243 #if PY_VERSION_HEX >= 0x030400a1
22246 #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800)
22249 #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
22252 #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000
22256 static struct __pyx_vtabstruct_memoryview __pyx_vtable_memoryview;
22258 static PyObject *__pyx_tp_new_memoryview(PyTypeObject *t, PyObject *a, PyObject *k) {
22259 struct __pyx_memoryview_obj *p;
22261 if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) {
22262 o = (*t->tp_alloc)(t, 0);
22264 o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0);
22266 if (unlikely(!o))
return 0;
22267 p = ((
struct __pyx_memoryview_obj *)o);
22268 p->__pyx_vtab = __pyx_vtabptr_memoryview;
22269 p->obj = Py_None; Py_INCREF(Py_None);
22270 p->_size = Py_None; Py_INCREF(Py_None);
22271 p->_array_interface = Py_None; Py_INCREF(Py_None);
22272 p->view.obj = NULL;
22273 if (unlikely(__pyx_memoryview___cinit__(o, a, k) < 0))
goto bad;
22276 Py_DECREF(o); o = 0;
22280 static void __pyx_tp_dealloc_memoryview(PyObject *o) {
22281 struct __pyx_memoryview_obj *p = (
struct __pyx_memoryview_obj *)o;
22282 #if CYTHON_USE_TP_FINALIZE
22283 if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) {
22284 if (PyObject_CallFinalizerFromDealloc(o))
return;
22287 PyObject_GC_UnTrack(o);
22289 PyObject *etype, *eval, *etb;
22290 PyErr_Fetch(&etype, &eval, &etb);
22291 __Pyx_SET_REFCNT(o, Py_REFCNT(o) + 1);
22292 __pyx_memoryview___dealloc__(o);
22293 __Pyx_SET_REFCNT(o, Py_REFCNT(o) - 1);
22294 PyErr_Restore(etype, eval, etb);
22297 Py_CLEAR(p->_size);
22298 Py_CLEAR(p->_array_interface);
22299 (*Py_TYPE(o)->tp_free)(o);
22302 static int __pyx_tp_traverse_memoryview(PyObject *o, visitproc
v,
void *a) {
22304 struct __pyx_memoryview_obj *p = (
struct __pyx_memoryview_obj *)o;
22306 e = (*v)(p->obj, a);
if (e)
return e;
22309 e = (*v)(p->_size, a);
if (e)
return e;
22311 if (p->_array_interface) {
22312 e = (*v)(p->_array_interface, a);
if (e)
return e;
22315 e = (*v)(p->view.obj, a);
if (e)
return e;
22320 static int __pyx_tp_clear_memoryview(PyObject *o) {
22322 struct __pyx_memoryview_obj *p = (
struct __pyx_memoryview_obj *)o;
22323 tmp = ((PyObject*)p->obj);
22324 p->obj = Py_None; Py_INCREF(Py_None);
22326 tmp = ((PyObject*)p->_size);
22327 p->_size = Py_None; Py_INCREF(Py_None);
22329 tmp = ((PyObject*)p->_array_interface);
22330 p->_array_interface = Py_None; Py_INCREF(Py_None);
22332 Py_CLEAR(p->view.obj);
22335 static PyObject *__pyx_sq_item_memoryview(PyObject *o, Py_ssize_t i) {
22337 PyObject *x = PyInt_FromSsize_t(i);
if(!x)
return 0;
22338 r = Py_TYPE(o)->tp_as_mapping->mp_subscript(o, x);
22343 static int __pyx_mp_ass_subscript_memoryview(PyObject *o, PyObject *i, PyObject *
v) {
22345 return __pyx_memoryview___setitem__(o, i,
v);
22348 PyErr_Format(PyExc_NotImplementedError,
22349 "Subscript deletion not supported by %.200s", Py_TYPE(o)->tp_name);
22354 static PyObject *__pyx_getprop___pyx_memoryview_T(PyObject *o, CYTHON_UNUSED
void *x) {
22355 return __pyx_pw_15View_dot_MemoryView_10memoryview_1T_1__get__(o);
22358 static PyObject *__pyx_getprop___pyx_memoryview_base(PyObject *o, CYTHON_UNUSED
void *x) {
22359 return __pyx_pw_15View_dot_MemoryView_10memoryview_4base_1__get__(o);
22362 static PyObject *__pyx_getprop___pyx_memoryview_shape(PyObject *o, CYTHON_UNUSED
void *x) {
22363 return __pyx_pw_15View_dot_MemoryView_10memoryview_5shape_1__get__(o);
22366 static PyObject *__pyx_getprop___pyx_memoryview_strides(PyObject *o, CYTHON_UNUSED
void *x) {
22367 return __pyx_pw_15View_dot_MemoryView_10memoryview_7strides_1__get__(o);
22370 static PyObject *__pyx_getprop___pyx_memoryview_suboffsets(PyObject *o, CYTHON_UNUSED
void *x) {
22371 return __pyx_pw_15View_dot_MemoryView_10memoryview_10suboffsets_1__get__(o);
22374 static PyObject *__pyx_getprop___pyx_memoryview_ndim(PyObject *o, CYTHON_UNUSED
void *x) {
22375 return __pyx_pw_15View_dot_MemoryView_10memoryview_4ndim_1__get__(o);
22378 static PyObject *__pyx_getprop___pyx_memoryview_itemsize(PyObject *o, CYTHON_UNUSED
void *x) {
22379 return __pyx_pw_15View_dot_MemoryView_10memoryview_8itemsize_1__get__(o);
22382 static PyObject *__pyx_getprop___pyx_memoryview_nbytes(PyObject *o, CYTHON_UNUSED
void *x) {
22383 return __pyx_pw_15View_dot_MemoryView_10memoryview_6nbytes_1__get__(o);
22386 static PyObject *__pyx_getprop___pyx_memoryview_size(PyObject *o, CYTHON_UNUSED
void *x) {
22387 return __pyx_pw_15View_dot_MemoryView_10memoryview_4size_1__get__(o);
22390 static PyMethodDef __pyx_methods_memoryview[] = {
22391 {
"is_c_contig", (PyCFunction)__pyx_memoryview_is_c_contig, METH_NOARGS, 0},
22392 {
"is_f_contig", (PyCFunction)__pyx_memoryview_is_f_contig, METH_NOARGS, 0},
22393 {
"copy", (PyCFunction)__pyx_memoryview_copy, METH_NOARGS, 0},
22394 {
"copy_fortran", (PyCFunction)__pyx_memoryview_copy_fortran, METH_NOARGS, 0},
22395 {
"__reduce_cython__", (PyCFunction)__pyx_pw___pyx_memoryview_1__reduce_cython__, METH_NOARGS, 0},
22396 {
"__setstate_cython__", (PyCFunction)__pyx_pw___pyx_memoryview_3__setstate_cython__, METH_O, 0},
22400 static struct PyGetSetDef __pyx_getsets_memoryview[] = {
22401 {(
char *)
"T", __pyx_getprop___pyx_memoryview_T, 0, (
char *)0, 0},
22402 {(
char *)
"base", __pyx_getprop___pyx_memoryview_base, 0, (
char *)0, 0},
22403 {(
char *)
"shape", __pyx_getprop___pyx_memoryview_shape, 0, (
char *)0, 0},
22404 {(
char *)
"strides", __pyx_getprop___pyx_memoryview_strides, 0, (
char *)0, 0},
22405 {(
char *)
"suboffsets", __pyx_getprop___pyx_memoryview_suboffsets, 0, (
char *)0, 0},
22406 {(
char *)
"ndim", __pyx_getprop___pyx_memoryview_ndim, 0, (
char *)0, 0},
22407 {(
char *)
"itemsize", __pyx_getprop___pyx_memoryview_itemsize, 0, (
char *)0, 0},
22408 {(
char *)
"nbytes", __pyx_getprop___pyx_memoryview_nbytes, 0, (
char *)0, 0},
22409 {(
char *)
"size", __pyx_getprop___pyx_memoryview_size, 0, (
char *)0, 0},
22413 static PySequenceMethods __pyx_tp_as_sequence_memoryview = {
22414 __pyx_memoryview___len__,
22417 __pyx_sq_item_memoryview,
22426 static PyMappingMethods __pyx_tp_as_mapping_memoryview = {
22427 __pyx_memoryview___len__,
22428 __pyx_memoryview___getitem__,
22429 __pyx_mp_ass_subscript_memoryview,
22432 static PyBufferProcs __pyx_tp_as_buffer_memoryview = {
22433 #if PY_MAJOR_VERSION < 3
22436 #if PY_MAJOR_VERSION < 3
22439 #if PY_MAJOR_VERSION < 3
22442 #if PY_MAJOR_VERSION < 3
22445 __pyx_memoryview_getbuffer,
22449 static PyTypeObject __pyx_type___pyx_memoryview = {
22450 PyVarObject_HEAD_INIT(0, 0)
22451 "BoundaryConditions.memoryview",
22452 sizeof(
struct __pyx_memoryview_obj),
22454 __pyx_tp_dealloc_memoryview,
22455 #if PY_VERSION_HEX < 0x030800b4
22458 #if PY_VERSION_HEX >= 0x030800b4
22463 #if PY_MAJOR_VERSION < 3
22466 #if PY_MAJOR_VERSION >= 3
22469 __pyx_memoryview___repr__,
22471 &__pyx_tp_as_sequence_memoryview,
22472 &__pyx_tp_as_mapping_memoryview,
22475 __pyx_memoryview___str__,
22478 &__pyx_tp_as_buffer_memoryview,
22479 Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC,
22481 __pyx_tp_traverse_memoryview,
22482 __pyx_tp_clear_memoryview,
22487 __pyx_methods_memoryview,
22489 __pyx_getsets_memoryview,
22497 __pyx_tp_new_memoryview,
22507 #if PY_VERSION_HEX >= 0x030400a1
22510 #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800)
22513 #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
22516 #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000
22520 static struct __pyx_vtabstruct__memoryviewslice __pyx_vtable__memoryviewslice;
22522 static PyObject *__pyx_tp_new__memoryviewslice(PyTypeObject *t, PyObject *a, PyObject *k) {
22523 struct __pyx_memoryviewslice_obj *p;
22524 PyObject *o = __pyx_tp_new_memoryview(t, a, k);
22525 if (unlikely(!o))
return 0;
22526 p = ((
struct __pyx_memoryviewslice_obj *)o);
22527 p->__pyx_base.__pyx_vtab = (
struct __pyx_vtabstruct_memoryview*)__pyx_vtabptr__memoryviewslice;
22528 p->from_object = Py_None; Py_INCREF(Py_None);
22529 p->from_slice.memview = NULL;
22533 static void __pyx_tp_dealloc__memoryviewslice(PyObject *o) {
22534 struct __pyx_memoryviewslice_obj *p = (
struct __pyx_memoryviewslice_obj *)o;
22535 #if CYTHON_USE_TP_FINALIZE
22536 if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) {
22537 if (PyObject_CallFinalizerFromDealloc(o))
return;
22540 PyObject_GC_UnTrack(o);
22542 PyObject *etype, *eval, *etb;
22543 PyErr_Fetch(&etype, &eval, &etb);
22544 __Pyx_SET_REFCNT(o, Py_REFCNT(o) + 1);
22545 __pyx_memoryviewslice___dealloc__(o);
22546 __Pyx_SET_REFCNT(o, Py_REFCNT(o) - 1);
22547 PyErr_Restore(etype, eval, etb);
22549 Py_CLEAR(p->from_object);
22550 PyObject_GC_Track(o);
22551 __pyx_tp_dealloc_memoryview(o);
22554 static int __pyx_tp_traverse__memoryviewslice(PyObject *o, visitproc
v,
void *a) {
22556 struct __pyx_memoryviewslice_obj *p = (
struct __pyx_memoryviewslice_obj *)o;
22557 e = __pyx_tp_traverse_memoryview(o,
v, a);
if (e)
return e;
22558 if (p->from_object) {
22559 e = (*v)(p->from_object, a);
if (e)
return e;
22564 static int __pyx_tp_clear__memoryviewslice(PyObject *o) {
22566 struct __pyx_memoryviewslice_obj *p = (
struct __pyx_memoryviewslice_obj *)o;
22567 __pyx_tp_clear_memoryview(o);
22568 tmp = ((PyObject*)p->from_object);
22569 p->from_object = Py_None; Py_INCREF(Py_None);
22571 __PYX_XDEC_MEMVIEW(&p->from_slice, 1);
22575 static PyObject *__pyx_getprop___pyx_memoryviewslice_base(PyObject *o, CYTHON_UNUSED
void *x) {
22576 return __pyx_pw_15View_dot_MemoryView_16_memoryviewslice_4base_1__get__(o);
22579 static PyMethodDef __pyx_methods__memoryviewslice[] = {
22580 {
"__reduce_cython__", (PyCFunction)__pyx_pw___pyx_memoryviewslice_1__reduce_cython__, METH_NOARGS, 0},
22581 {
"__setstate_cython__", (PyCFunction)__pyx_pw___pyx_memoryviewslice_3__setstate_cython__, METH_O, 0},
22585 static struct PyGetSetDef __pyx_getsets__memoryviewslice[] = {
22586 {(
char *)
"base", __pyx_getprop___pyx_memoryviewslice_base, 0, (
char *)0, 0},
22590 static PyTypeObject __pyx_type___pyx_memoryviewslice = {
22591 PyVarObject_HEAD_INIT(0, 0)
22592 "BoundaryConditions._memoryviewslice",
22593 sizeof(
struct __pyx_memoryviewslice_obj),
22595 __pyx_tp_dealloc__memoryviewslice,
22596 #if PY_VERSION_HEX < 0x030800b4
22599 #if PY_VERSION_HEX >= 0x030800b4
22604 #if PY_MAJOR_VERSION < 3
22607 #if PY_MAJOR_VERSION >= 3
22610 #if CYTHON_COMPILING_IN_PYPY
22611 __pyx_memoryview___repr__,
22620 #if CYTHON_COMPILING_IN_PYPY
22621 __pyx_memoryview___str__,
22628 Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC,
22629 "Internal class for passing memoryview slices to Python",
22630 __pyx_tp_traverse__memoryviewslice,
22631 __pyx_tp_clear__memoryviewslice,
22636 __pyx_methods__memoryviewslice,
22638 __pyx_getsets__memoryviewslice,
22646 __pyx_tp_new__memoryviewslice,
22656 #if PY_VERSION_HEX >= 0x030400a1
22659 #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800)
22662 #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
22665 #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000
22670 static PyMethodDef __pyx_methods[] = {
22674 #if PY_MAJOR_VERSION >= 3
22675 #if CYTHON_PEP489_MULTI_PHASE_INIT
22676 static PyObject* __pyx_pymod_create(PyObject *spec, PyModuleDef *def);
22677 static int __pyx_pymod_exec_BoundaryConditions(PyObject* module);
22678 static PyModuleDef_Slot __pyx_moduledef_slots[] = {
22679 {Py_mod_create, (
void*)__pyx_pymod_create},
22680 {Py_mod_exec, (
void*)__pyx_pymod_exec_BoundaryConditions},
22685 static struct PyModuleDef __pyx_moduledef = {
22686 PyModuleDef_HEAD_INIT,
22687 "BoundaryConditions",
22689 #if CYTHON_PEP489_MULTI_PHASE_INIT
22695 #if CYTHON_PEP489_MULTI_PHASE_INIT
22696 __pyx_moduledef_slots,
22705 #ifndef CYTHON_SMALL_CODE
22706 #if defined(__clang__)
22707 #define CYTHON_SMALL_CODE
22708 #elif defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 3))
22709 #define CYTHON_SMALL_CODE __attribute__((cold))
22711 #define CYTHON_SMALL_CODE
22715 static __Pyx_StringTabEntry __pyx_string_tab[] = {
22716 {&__pyx_n_s_ASCII, __pyx_k_ASCII,
sizeof(__pyx_k_ASCII), 0, 0, 1, 1},
22717 {&__pyx_n_s_BC_Base, __pyx_k_BC_Base,
sizeof(__pyx_k_BC_Base), 0, 0, 1, 1},
22718 {&__pyx_n_s_BC_Base___reduce_cython, __pyx_k_BC_Base___reduce_cython,
sizeof(__pyx_k_BC_Base___reduce_cython), 0, 0, 1, 1},
22719 {&__pyx_n_s_BC_Base___setstate_cython, __pyx_k_BC_Base___setstate_cython,
sizeof(__pyx_k_BC_Base___setstate_cython), 0, 0, 1, 1},
22720 {&__pyx_n_s_BC_Base_getContext, __pyx_k_BC_Base_getContext,
sizeof(__pyx_k_BC_Base_getContext), 0, 0, 1, 1},
22721 {&__pyx_n_s_BoundaryCondition, __pyx_k_BoundaryCondition,
sizeof(__pyx_k_BoundaryCondition), 0, 0, 1, 1},
22722 {&__pyx_n_s_BoundaryCondition___reduce_cytho, __pyx_k_BoundaryCondition___reduce_cytho,
sizeof(__pyx_k_BoundaryCondition___reduce_cytho), 0, 0, 1, 1},
22723 {&__pyx_n_s_BoundaryCondition___setstate_cyt, __pyx_k_BoundaryCondition___setstate_cyt,
sizeof(__pyx_k_BoundaryCondition___setstate_cyt), 0, 0, 1, 1},
22724 {&__pyx_n_s_BoundaryCondition_init_cython, __pyx_k_BoundaryCondition_init_cython,
sizeof(__pyx_k_BoundaryCondition_init_cython), 0, 0, 1, 1},
22725 {&__pyx_n_s_BoundaryCondition_resetBC, __pyx_k_BoundaryCondition_resetBC,
sizeof(__pyx_k_BoundaryCondition_resetBC), 0, 0, 1, 1},
22726 {&__pyx_n_s_BoundaryCondition_setConstantBC, __pyx_k_BoundaryCondition_setConstantBC,
sizeof(__pyx_k_BoundaryCondition_setConstantBC), 0, 0, 1, 1},
22727 {&__pyx_n_s_BoundaryCondition_setLinearBC, __pyx_k_BoundaryCondition_setLinearBC,
sizeof(__pyx_k_BoundaryCondition_setLinearBC), 0, 0, 1, 1},
22728 {&__pyx_n_s_BoundaryCondition_setLinearRamp, __pyx_k_BoundaryCondition_setLinearRamp,
sizeof(__pyx_k_BoundaryCondition_setLinearRamp), 0, 0, 1, 1},
22729 {&__pyx_n_s_BoundaryConditions, __pyx_k_BoundaryConditions,
sizeof(__pyx_k_BoundaryConditions), 0, 0, 1, 1},
22730 {&__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},
22731 {&__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},
22732 {&__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},
22733 {&__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},
22734 {&__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},
22735 {&__pyx_n_s_Context, __pyx_k_Context,
sizeof(__pyx_k_Context), 0, 0, 1, 1},
22736 {&__pyx_n_s_Domain, __pyx_k_Domain,
sizeof(__pyx_k_Domain), 0, 0, 1, 1},
22737 {&__pyx_n_s_Ellipsis, __pyx_k_Ellipsis,
sizeof(__pyx_k_Ellipsis), 0, 0, 1, 1},
22738 {&__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},
22739 {&__pyx_n_s_ImportError, __pyx_k_ImportError,
sizeof(__pyx_k_ImportError), 0, 0, 1, 1},
22740 {&__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},
22741 {&__pyx_kp_s_Incompatible_checksums_0x_x_vs_0_2, __pyx_k_Incompatible_checksums_0x_x_vs_0_2,
sizeof(__pyx_k_Incompatible_checksums_0x_x_vs_0_2), 0, 0, 1, 0},
22742 {&__pyx_n_s_IndexError, __pyx_k_IndexError,
sizeof(__pyx_k_IndexError), 0, 0, 1, 1},
22743 {&__pyx_kp_s_Indirect_dimensions_not_supporte, __pyx_k_Indirect_dimensions_not_supporte,
sizeof(__pyx_k_Indirect_dimensions_not_supporte), 0, 0, 1, 0},
22744 {&__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},
22745 {&__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},
22746 {&__pyx_n_s_MemoryError, __pyx_k_MemoryError,
sizeof(__pyx_k_MemoryError), 0, 0, 1, 1},
22747 {&__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},
22748 {&__pyx_kp_s_MemoryView_of_r_object, __pyx_k_MemoryView_of_r_object,
sizeof(__pyx_k_MemoryView_of_r_object), 0, 0, 1, 0},
22749 {&__pyx_n_s_None, __pyx_k_None,
sizeof(__pyx_k_None), 0, 0, 1, 1},
22750 {&__pyx_n_b_O, __pyx_k_O,
sizeof(__pyx_k_O), 0, 0, 0, 1},
22751 {&__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},
22752 {&__pyx_n_s_PickleError, __pyx_k_PickleError,
sizeof(__pyx_k_PickleError), 0, 0, 1, 1},
22753 {&__pyx_kp_s_Shape_or_nd_must_be_passed_to_BC, __pyx_k_Shape_or_nd_must_be_passed_to_BC,
sizeof(__pyx_k_Shape_or_nd_must_be_passed_to_BC), 0, 0, 1, 0},
22754 {&__pyx_n_s_TypeError, __pyx_k_TypeError,
sizeof(__pyx_k_TypeError), 0, 0, 1, 1},
22755 {&__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},
22756 {&__pyx_n_s_ValueError, __pyx_k_ValueError,
sizeof(__pyx_k_ValueError), 0, 0, 1, 1},
22757 {&__pyx_n_s_View_MemoryView, __pyx_k_View_MemoryView,
sizeof(__pyx_k_View_MemoryView), 0, 0, 1, 1},
22758 {&__pyx_n_s_a, __pyx_k_a,
sizeof(__pyx_k_a), 0, 0, 1, 1},
22759 {&__pyx_n_s_a0, __pyx_k_a0,
sizeof(__pyx_k_a0), 0, 0, 1, 1},
22760 {&__pyx_n_s_all, __pyx_k_all,
sizeof(__pyx_k_all), 0, 0, 1, 1},
22761 {&__pyx_n_s_allocate_buffer, __pyx_k_allocate_buffer,
sizeof(__pyx_k_allocate_buffer), 0, 0, 1, 1},
22762 {&__pyx_n_s_b_i, __pyx_k_b_i,
sizeof(__pyx_k_b_i), 0, 0, 1, 1},
22763 {&__pyx_n_s_b_or, __pyx_k_b_or,
sizeof(__pyx_k_b_or), 0, 0, 1, 1},
22764 {&__pyx_n_s_base, __pyx_k_base,
sizeof(__pyx_k_base), 0, 0, 1, 1},
22765 {&__pyx_n_s_c, __pyx_k_c,
sizeof(__pyx_k_c), 0, 0, 1, 1},
22766 {&__pyx_n_u_c, __pyx_k_c,
sizeof(__pyx_k_c), 0, 1, 0, 1},
22767 {&__pyx_n_s_class, __pyx_k_class,
sizeof(__pyx_k_class), 0, 0, 1, 1},
22768 {&__pyx_n_s_cline_in_traceback, __pyx_k_cline_in_traceback,
sizeof(__pyx_k_cline_in_traceback), 0, 0, 1, 1},
22769 {&__pyx_n_s_context, __pyx_k_context,
sizeof(__pyx_k_context), 0, 0, 1, 1},
22770 {&__pyx_kp_s_contiguous_and_direct, __pyx_k_contiguous_and_direct,
sizeof(__pyx_k_contiguous_and_direct), 0, 0, 1, 0},
22771 {&__pyx_kp_s_contiguous_and_indirect, __pyx_k_contiguous_and_indirect,
sizeof(__pyx_k_contiguous_and_indirect), 0, 0, 1, 0},
22772 {&__pyx_n_s_dict, __pyx_k_dict,
sizeof(__pyx_k_dict), 0, 0, 1, 1},
22773 {&__pyx_n_s_dict_2, __pyx_k_dict_2,
sizeof(__pyx_k_dict_2), 0, 0, 1, 1},
22774 {&__pyx_n_s_dtype_is_object, __pyx_k_dtype_is_object,
sizeof(__pyx_k_dtype_is_object), 0, 0, 1, 1},
22775 {&__pyx_n_s_encode, __pyx_k_encode,
sizeof(__pyx_k_encode), 0, 0, 1, 1},
22776 {&__pyx_n_s_enumerate, __pyx_k_enumerate,
sizeof(__pyx_k_enumerate), 0, 0, 1, 1},
22777 {&__pyx_n_s_error, __pyx_k_error,
sizeof(__pyx_k_error), 0, 0, 1, 1},
22778 {&__pyx_n_s_flags, __pyx_k_flags,
sizeof(__pyx_k_flags), 0, 0, 1, 1},
22779 {&__pyx_n_s_format, __pyx_k_format,
sizeof(__pyx_k_format), 0, 0, 1, 1},
22780 {&__pyx_n_s_fortran, __pyx_k_fortran,
sizeof(__pyx_k_fortran), 0, 0, 1, 1},
22781 {&__pyx_n_u_fortran, __pyx_k_fortran,
sizeof(__pyx_k_fortran), 0, 1, 0, 1},
22782 {&__pyx_n_s_get, __pyx_k_get,
sizeof(__pyx_k_get), 0, 0, 1, 1},
22783 {&__pyx_n_s_getContext, __pyx_k_getContext,
sizeof(__pyx_k_getContext), 0, 0, 1, 1},
22784 {&__pyx_n_s_getstate, __pyx_k_getstate,
sizeof(__pyx_k_getstate), 0, 0, 1, 1},
22785 {&__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},
22786 {&__pyx_n_s_id, __pyx_k_id,
sizeof(__pyx_k_id), 0, 0, 1, 1},
22787 {&__pyx_n_s_import, __pyx_k_import,
sizeof(__pyx_k_import), 0, 0, 1, 1},
22788 {&__pyx_n_s_init_cython, __pyx_k_init_cython,
sizeof(__pyx_k_init_cython), 0, 0, 1, 1},
22789 {&__pyx_n_s_itemsize, __pyx_k_itemsize,
sizeof(__pyx_k_itemsize), 0, 0, 1, 1},
22790 {&__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},
22791 {&__pyx_n_s_main, __pyx_k_main,
sizeof(__pyx_k_main), 0, 0, 1, 1},
22792 {&__pyx_n_s_memview, __pyx_k_memview,
sizeof(__pyx_k_memview), 0, 0, 1, 1},
22793 {&__pyx_n_s_mode, __pyx_k_mode,
sizeof(__pyx_k_mode), 0, 0, 1, 1},
22794 {&__pyx_n_s_n, __pyx_k_n,
sizeof(__pyx_k_n), 0, 0, 1, 1},
22795 {&__pyx_n_s_name, __pyx_k_name,
sizeof(__pyx_k_name), 0, 0, 1, 1},
22796 {&__pyx_n_s_name_2, __pyx_k_name_2,
sizeof(__pyx_k_name_2), 0, 0, 1, 1},
22797 {&__pyx_n_s_nd, __pyx_k_nd,
sizeof(__pyx_k_nd), 0, 0, 1, 1},
22798 {&__pyx_n_s_ndim, __pyx_k_ndim,
sizeof(__pyx_k_ndim), 0, 0, 1, 1},
22799 {&__pyx_n_s_new, __pyx_k_new,
sizeof(__pyx_k_new), 0, 0, 1, 1},
22800 {&__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},
22801 {&__pyx_n_s_np, __pyx_k_np,
sizeof(__pyx_k_np), 0, 0, 1, 1},
22802 {&__pyx_n_s_numpy, __pyx_k_numpy,
sizeof(__pyx_k_numpy), 0, 0, 1, 1},
22803 {&__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},
22804 {&__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},
22805 {&__pyx_n_s_obj, __pyx_k_obj,
sizeof(__pyx_k_obj), 0, 0, 1, 1},
22806 {&__pyx_n_s_pack, __pyx_k_pack,
sizeof(__pyx_k_pack), 0, 0, 1, 1},
22807 {&__pyx_n_s_pickle, __pyx_k_pickle,
sizeof(__pyx_k_pickle), 0, 0, 1, 1},
22808 {&__pyx_n_s_proteus, __pyx_k_proteus,
sizeof(__pyx_k_proteus), 0, 0, 1, 1},
22809 {&__pyx_kp_s_proteus_BoundaryConditions_py, __pyx_k_proteus_BoundaryConditions_py,
sizeof(__pyx_k_proteus_BoundaryConditions_py), 0, 0, 1, 0},
22810 {&__pyx_n_s_pyx_PickleError, __pyx_k_pyx_PickleError,
sizeof(__pyx_k_pyx_PickleError), 0, 0, 1, 1},
22811 {&__pyx_n_s_pyx_checksum, __pyx_k_pyx_checksum,
sizeof(__pyx_k_pyx_checksum), 0, 0, 1, 1},
22812 {&__pyx_n_s_pyx_getbuffer, __pyx_k_pyx_getbuffer,
sizeof(__pyx_k_pyx_getbuffer), 0, 0, 1, 1},
22813 {&__pyx_n_s_pyx_result, __pyx_k_pyx_result,
sizeof(__pyx_k_pyx_result), 0, 0, 1, 1},
22814 {&__pyx_n_s_pyx_state, __pyx_k_pyx_state,
sizeof(__pyx_k_pyx_state), 0, 0, 1, 1},
22815 {&__pyx_n_s_pyx_type, __pyx_k_pyx_type,
sizeof(__pyx_k_pyx_type), 0, 0, 1, 1},
22816 {&__pyx_n_s_pyx_unpickle_BC_Base, __pyx_k_pyx_unpickle_BC_Base,
sizeof(__pyx_k_pyx_unpickle_BC_Base), 0, 0, 1, 1},
22817 {&__pyx_n_s_pyx_unpickle_Enum, __pyx_k_pyx_unpickle_Enum,
sizeof(__pyx_k_pyx_unpickle_Enum), 0, 0, 1, 1},
22818 {&__pyx_n_s_pyx_vtable, __pyx_k_pyx_vtable,
sizeof(__pyx_k_pyx_vtable), 0, 0, 1, 1},
22819 {&__pyx_n_s_range, __pyx_k_range,
sizeof(__pyx_k_range), 0, 0, 1, 1},
22820 {&__pyx_n_s_reduce, __pyx_k_reduce,
sizeof(__pyx_k_reduce), 0, 0, 1, 1},
22821 {&__pyx_n_s_reduce_cython, __pyx_k_reduce_cython,
sizeof(__pyx_k_reduce_cython), 0, 0, 1, 1},
22822 {&__pyx_n_s_reduce_ex, __pyx_k_reduce_ex,
sizeof(__pyx_k_reduce_ex), 0, 0, 1, 1},
22823 {&__pyx_n_s_resetBC, __pyx_k_resetBC,
sizeof(__pyx_k_resetBC), 0, 0, 1, 1},
22824 {&__pyx_n_s_self, __pyx_k_self,
sizeof(__pyx_k_self), 0, 0, 1, 1},
22825 {&__pyx_kp_s_self_uuOfXT_cannot_be_converted, __pyx_k_self_uuOfXT_cannot_be_converted,
sizeof(__pyx_k_self_uuOfXT_cannot_be_converted), 0, 0, 1, 0},
22826 {&__pyx_n_s_setConstantBC, __pyx_k_setConstantBC,
sizeof(__pyx_k_setConstantBC), 0, 0, 1, 1},
22827 {&__pyx_n_s_setConstantBC_locals_lambda, __pyx_k_setConstantBC_locals_lambda,
sizeof(__pyx_k_setConstantBC_locals_lambda), 0, 0, 1, 1},
22828 {&__pyx_n_s_setLinearBC, __pyx_k_setLinearBC,
sizeof(__pyx_k_setLinearBC), 0, 0, 1, 1},
22829 {&__pyx_n_s_setLinearBC_locals_lambda, __pyx_k_setLinearBC_locals_lambda,
sizeof(__pyx_k_setLinearBC_locals_lambda), 0, 0, 1, 1},
22830 {&__pyx_n_s_setLinearRamp, __pyx_k_setLinearRamp,
sizeof(__pyx_k_setLinearRamp), 0, 0, 1, 1},
22831 {&__pyx_n_s_setLinearRamp_locals_lambda, __pyx_k_setLinearRamp_locals_lambda,
sizeof(__pyx_k_setLinearRamp_locals_lambda), 0, 0, 1, 1},
22832 {&__pyx_n_s_setstate, __pyx_k_setstate,
sizeof(__pyx_k_setstate), 0, 0, 1, 1},
22833 {&__pyx_n_s_setstate_cython, __pyx_k_setstate_cython,
sizeof(__pyx_k_setstate_cython), 0, 0, 1, 1},
22834 {&__pyx_n_s_shape, __pyx_k_shape,
sizeof(__pyx_k_shape), 0, 0, 1, 1},
22835 {&__pyx_n_s_size, __pyx_k_size,
sizeof(__pyx_k_size), 0, 0, 1, 1},
22836 {&__pyx_n_s_start, __pyx_k_start,
sizeof(__pyx_k_start), 0, 0, 1, 1},
22837 {&__pyx_n_s_state, __pyx_k_state,
sizeof(__pyx_k_state), 0, 0, 1, 1},
22838 {&__pyx_n_s_step, __pyx_k_step,
sizeof(__pyx_k_step), 0, 0, 1, 1},
22839 {&__pyx_n_s_stop, __pyx_k_stop,
sizeof(__pyx_k_stop), 0, 0, 1, 1},
22840 {&__pyx_kp_s_strided_and_direct, __pyx_k_strided_and_direct,
sizeof(__pyx_k_strided_and_direct), 0, 0, 1, 0},
22841 {&__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},
22842 {&__pyx_kp_s_strided_and_indirect, __pyx_k_strided_and_indirect,
sizeof(__pyx_k_strided_and_indirect), 0, 0, 1, 0},
22843 {&__pyx_kp_s_stringsource, __pyx_k_stringsource,
sizeof(__pyx_k_stringsource), 0, 0, 1, 0},
22844 {&__pyx_n_s_struct, __pyx_k_struct,
sizeof(__pyx_k_struct), 0, 0, 1, 1},
22845 {&__pyx_n_s_sum, __pyx_k_sum,
sizeof(__pyx_k_sum), 0, 0, 1, 1},
22846 {&__pyx_n_s_t, __pyx_k_t,
sizeof(__pyx_k_t), 0, 0, 1, 1},
22847 {&__pyx_n_s_t1, __pyx_k_t1,
sizeof(__pyx_k_t1), 0, 0, 1, 1},
22848 {&__pyx_n_s_test, __pyx_k_test,
sizeof(__pyx_k_test), 0, 0, 1, 1},
22849 {&__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},
22850 {&__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},
22851 {&__pyx_n_s_unpack, __pyx_k_unpack,
sizeof(__pyx_k_unpack), 0, 0, 1, 1},
22852 {&__pyx_n_s_update, __pyx_k_update,
sizeof(__pyx_k_update), 0, 0, 1, 1},
22853 {&__pyx_n_s_use_setstate, __pyx_k_use_setstate,
sizeof(__pyx_k_use_setstate), 0, 0, 1, 1},
22854 {&__pyx_n_s_value, __pyx_k_value,
sizeof(__pyx_k_value), 0, 0, 1, 1},
22855 {&__pyx_n_s_x, __pyx_k_x,
sizeof(__pyx_k_x), 0, 0, 1, 1},
22856 {&__pyx_n_s_zeros, __pyx_k_zeros,
sizeof(__pyx_k_zeros), 0, 0, 1, 1},
22857 {0, 0, 0, 0, 0, 0, 0}
22859 static CYTHON_SMALL_CODE
int __Pyx_InitCachedBuiltins(
void) {
22860 __pyx_builtin_sum = __Pyx_GetBuiltinName(__pyx_n_s_sum);
if (!__pyx_builtin_sum) __PYX_ERR(0, 113, __pyx_L1_error)
22861 __pyx_builtin_TypeError = __Pyx_GetBuiltinName(__pyx_n_s_TypeError);
if (!__pyx_builtin_TypeError) __PYX_ERR(1, 2, __pyx_L1_error)
22862 __pyx_builtin_ImportError = __Pyx_GetBuiltinName(__pyx_n_s_ImportError);
if (!__pyx_builtin_ImportError) __PYX_ERR(3, 945, __pyx_L1_error)
22863 __pyx_builtin_ValueError = __Pyx_GetBuiltinName(__pyx_n_s_ValueError);
if (!__pyx_builtin_ValueError) __PYX_ERR(1, 133, __pyx_L1_error)
22864 __pyx_builtin_MemoryError = __Pyx_GetBuiltinName(__pyx_n_s_MemoryError);
if (!__pyx_builtin_MemoryError) __PYX_ERR(1, 148, __pyx_L1_error)
22865 __pyx_builtin_enumerate = __Pyx_GetBuiltinName(__pyx_n_s_enumerate);
if (!__pyx_builtin_enumerate) __PYX_ERR(1, 151, __pyx_L1_error)
22866 __pyx_builtin_range = __Pyx_GetBuiltinName(__pyx_n_s_range);
if (!__pyx_builtin_range) __PYX_ERR(1, 180, __pyx_L1_error)
22867 __pyx_builtin_Ellipsis = __Pyx_GetBuiltinName(__pyx_n_s_Ellipsis);
if (!__pyx_builtin_Ellipsis) __PYX_ERR(1, 404, __pyx_L1_error)
22868 __pyx_builtin_id = __Pyx_GetBuiltinName(__pyx_n_s_id);
if (!__pyx_builtin_id) __PYX_ERR(1, 613, __pyx_L1_error)
22869 __pyx_builtin_IndexError = __Pyx_GetBuiltinName(__pyx_n_s_IndexError);
if (!__pyx_builtin_IndexError) __PYX_ERR(1, 832, __pyx_L1_error)
22875 static CYTHON_SMALL_CODE
int __Pyx_InitCachedConstants(
void) {
22876 __Pyx_RefNannyDeclarations
22877 __Pyx_RefNannySetupContext(
"__Pyx_InitCachedConstants", 0);
22886 __pyx_slice__7 = PySlice_New(Py_None, Py_None, Py_None);
if (unlikely(!__pyx_slice__7)) __PYX_ERR(0, 113, __pyx_L1_error)
22887 __Pyx_GOTREF(__pyx_slice__7);
22888 __Pyx_GIVEREF(__pyx_slice__7);
22896 __pyx_tuple__11 = PyTuple_Pack(1, __pyx_kp_s_self_uuOfXT_cannot_be_converted);
if (unlikely(!__pyx_tuple__11)) __PYX_ERR(1, 2, __pyx_L1_error)
22897 __Pyx_GOTREF(__pyx_tuple__11);
22898 __Pyx_GIVEREF(__pyx_tuple__11);
22905 __pyx_tuple__13 = PyTuple_Pack(1, __pyx_kp_s_self_uuOfXT_cannot_be_converted);
if (unlikely(!__pyx_tuple__13)) __PYX_ERR(1, 4, __pyx_L1_error)
22906 __Pyx_GOTREF(__pyx_tuple__13);
22907 __Pyx_GIVEREF(__pyx_tuple__13);
22908 __pyx_tuple__15 = PyTuple_Pack(3, __pyx_int_158231071, __pyx_int_81007987, __pyx_int_131364769);
if (unlikely(!__pyx_tuple__15)) __PYX_ERR(1, 4, __pyx_L1_error)
22909 __Pyx_GOTREF(__pyx_tuple__15);
22910 __Pyx_GIVEREF(__pyx_tuple__15);
22919 __pyx_tuple__16 = PyTuple_Pack(1, __pyx_kp_s_numpy_core_multiarray_failed_to);
if (unlikely(!__pyx_tuple__16)) __PYX_ERR(3, 945, __pyx_L1_error)
22920 __Pyx_GOTREF(__pyx_tuple__16);
22921 __Pyx_GIVEREF(__pyx_tuple__16);
22930 __pyx_tuple__17 = PyTuple_Pack(1, __pyx_kp_s_numpy_core_umath_failed_to_impor);
if (unlikely(!__pyx_tuple__17)) __PYX_ERR(3, 951, __pyx_L1_error)
22931 __Pyx_GOTREF(__pyx_tuple__17);
22932 __Pyx_GIVEREF(__pyx_tuple__17);
22941 __pyx_tuple__18 = PyTuple_Pack(1, __pyx_kp_s_Empty_shape_tuple_for_cython_arr);
if (unlikely(!__pyx_tuple__18)) __PYX_ERR(1, 133, __pyx_L1_error)
22942 __Pyx_GOTREF(__pyx_tuple__18);
22943 __Pyx_GIVEREF(__pyx_tuple__18);
22952 __pyx_tuple__19 = PyTuple_Pack(1, __pyx_kp_s_itemsize_0_for_cython_array);
if (unlikely(!__pyx_tuple__19)) __PYX_ERR(1, 136, __pyx_L1_error)
22953 __Pyx_GOTREF(__pyx_tuple__19);
22954 __Pyx_GIVEREF(__pyx_tuple__19);
22963 __pyx_tuple__20 = PyTuple_Pack(1, __pyx_kp_s_unable_to_allocate_shape_and_str);
if (unlikely(!__pyx_tuple__20)) __PYX_ERR(1, 148, __pyx_L1_error)
22964 __Pyx_GOTREF(__pyx_tuple__20);
22965 __Pyx_GIVEREF(__pyx_tuple__20);
22974 __pyx_tuple__21 = PyTuple_Pack(1, __pyx_kp_s_unable_to_allocate_array_data);
if (unlikely(!__pyx_tuple__21)) __PYX_ERR(1, 176, __pyx_L1_error)
22975 __Pyx_GOTREF(__pyx_tuple__21);
22976 __Pyx_GIVEREF(__pyx_tuple__21);
22985 __pyx_tuple__22 = PyTuple_Pack(1, __pyx_kp_s_Can_only_create_a_buffer_that_is);
if (unlikely(!__pyx_tuple__22)) __PYX_ERR(1, 192, __pyx_L1_error)
22986 __Pyx_GOTREF(__pyx_tuple__22);
22987 __Pyx_GIVEREF(__pyx_tuple__22);
22995 __pyx_tuple__23 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non);
if (unlikely(!__pyx_tuple__23)) __PYX_ERR(1, 2, __pyx_L1_error)
22996 __Pyx_GOTREF(__pyx_tuple__23);
22997 __Pyx_GIVEREF(__pyx_tuple__23);
23004 __pyx_tuple__24 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non);
if (unlikely(!__pyx_tuple__24)) __PYX_ERR(1, 4, __pyx_L1_error)
23005 __Pyx_GOTREF(__pyx_tuple__24);
23006 __Pyx_GIVEREF(__pyx_tuple__24);
23015 __pyx_tuple__25 = PyTuple_Pack(1, __pyx_kp_s_Cannot_assign_to_read_only_memor);
if (unlikely(!__pyx_tuple__25)) __PYX_ERR(1, 418, __pyx_L1_error)
23016 __Pyx_GOTREF(__pyx_tuple__25);
23017 __Pyx_GIVEREF(__pyx_tuple__25);
23026 __pyx_tuple__26 = PyTuple_Pack(1, __pyx_kp_s_Unable_to_convert_item_to_object);
if (unlikely(!__pyx_tuple__26)) __PYX_ERR(1, 495, __pyx_L1_error)
23027 __Pyx_GOTREF(__pyx_tuple__26);
23028 __Pyx_GIVEREF(__pyx_tuple__26);
23037 __pyx_tuple__27 = PyTuple_Pack(1, __pyx_kp_s_Cannot_create_writable_memory_vi);
if (unlikely(!__pyx_tuple__27)) __PYX_ERR(1, 520, __pyx_L1_error)
23038 __Pyx_GOTREF(__pyx_tuple__27);
23039 __Pyx_GIVEREF(__pyx_tuple__27);
23048 __pyx_tuple__28 = PyTuple_Pack(1, __pyx_kp_s_Buffer_view_does_not_expose_stri);
if (unlikely(!__pyx_tuple__28)) __PYX_ERR(1, 570, __pyx_L1_error)
23049 __Pyx_GOTREF(__pyx_tuple__28);
23050 __Pyx_GIVEREF(__pyx_tuple__28);
23059 __pyx_tuple__29 = PyTuple_New(1);
if (unlikely(!__pyx_tuple__29)) __PYX_ERR(1, 577, __pyx_L1_error)
23060 __Pyx_GOTREF(__pyx_tuple__29);
23061 __Pyx_INCREF(__pyx_int_neg_1);
23062 __Pyx_GIVEREF(__pyx_int_neg_1);
23063 PyTuple_SET_ITEM(__pyx_tuple__29, 0, __pyx_int_neg_1);
23064 __Pyx_GIVEREF(__pyx_tuple__29);
23072 __pyx_tuple__30 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non);
if (unlikely(!__pyx_tuple__30)) __PYX_ERR(1, 2, __pyx_L1_error)
23073 __Pyx_GOTREF(__pyx_tuple__30);
23074 __Pyx_GIVEREF(__pyx_tuple__30);
23081 __pyx_tuple__31 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non);
if (unlikely(!__pyx_tuple__31)) __PYX_ERR(1, 4, __pyx_L1_error)
23082 __Pyx_GOTREF(__pyx_tuple__31);
23083 __Pyx_GIVEREF(__pyx_tuple__31);
23092 __pyx_tuple__32 = PyTuple_Pack(1, __pyx_kp_s_Indirect_dimensions_not_supporte);
if (unlikely(!__pyx_tuple__32)) __PYX_ERR(1, 703, __pyx_L1_error)
23093 __Pyx_GOTREF(__pyx_tuple__32);
23094 __Pyx_GIVEREF(__pyx_tuple__32);
23102 __pyx_tuple__33 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non);
if (unlikely(!__pyx_tuple__33)) __PYX_ERR(1, 2, __pyx_L1_error)
23103 __Pyx_GOTREF(__pyx_tuple__33);
23104 __Pyx_GIVEREF(__pyx_tuple__33);
23111 __pyx_tuple__34 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non);
if (unlikely(!__pyx_tuple__34)) __PYX_ERR(1, 4, __pyx_L1_error)
23112 __Pyx_GOTREF(__pyx_tuple__34);
23113 __Pyx_GIVEREF(__pyx_tuple__34);
23114 __pyx_tuple__36 = PyTuple_Pack(3, __pyx_int_184977713, __pyx_int_136983863, __pyx_int_112105877);
if (unlikely(!__pyx_tuple__36)) __PYX_ERR(1, 4, __pyx_L1_error)
23115 __Pyx_GOTREF(__pyx_tuple__36);
23116 __Pyx_GIVEREF(__pyx_tuple__36);
23125 __pyx_tuple__37 = PyTuple_Pack(3, __pyx_n_s_self, __pyx_n_s_context, __pyx_n_s_Context);
if (unlikely(!__pyx_tuple__37)) __PYX_ERR(0, 52, __pyx_L1_error)
23126 __Pyx_GOTREF(__pyx_tuple__37);
23127 __Pyx_GIVEREF(__pyx_tuple__37);
23128 __pyx_codeobj_ = (PyObject*)__Pyx_PyCode_New(2, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__37, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_proteus_BoundaryConditions_py, __pyx_n_s_getContext, 52, __pyx_empty_bytes);
if (unlikely(!__pyx_codeobj_)) __PYX_ERR(0, 52, __pyx_L1_error)
23135 __pyx_tuple__38 = PyTuple_Pack(4, __pyx_n_s_self, __pyx_n_s_state, __pyx_n_s_dict_2, __pyx_n_s_use_setstate);
if (unlikely(!__pyx_tuple__38)) __PYX_ERR(1, 1, __pyx_L1_error)
23136 __Pyx_GOTREF(__pyx_tuple__38);
23137 __Pyx_GIVEREF(__pyx_tuple__38);
23138 __pyx_codeobj__2 = (PyObject*)__Pyx_PyCode_New(1, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__38, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_reduce_cython, 1, __pyx_empty_bytes);
if (unlikely(!__pyx_codeobj__2)) __PYX_ERR(1, 1, __pyx_L1_error)
23146 __pyx_tuple__39 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_pyx_state);
if (unlikely(!__pyx_tuple__39)) __PYX_ERR(1, 16, __pyx_L1_error)
23147 __Pyx_GOTREF(__pyx_tuple__39);
23148 __Pyx_GIVEREF(__pyx_tuple__39);
23149 __pyx_codeobj__3 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__39, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_setstate_cython, 16, __pyx_empty_bytes);
if (unlikely(!__pyx_codeobj__3)) __PYX_ERR(1, 16, __pyx_L1_error)
23158 __pyx_tuple__40 = PyTuple_Pack(1, __pyx_n_s_self);
if (unlikely(!__pyx_tuple__40)) __PYX_ERR(0, 81, __pyx_L1_error)
23159 __Pyx_GOTREF(__pyx_tuple__40);
23160 __Pyx_GIVEREF(__pyx_tuple__40);
23161 __pyx_codeobj__4 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__40, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_proteus_BoundaryConditions_py, __pyx_n_s_init_cython, 81, __pyx_empty_bytes);
if (unlikely(!__pyx_codeobj__4)) __PYX_ERR(0, 81, __pyx_L1_error)
23170 __pyx_tuple__41 = PyTuple_Pack(1, __pyx_n_s_self);
if (unlikely(!__pyx_tuple__41)) __PYX_ERR(0, 84, __pyx_L1_error)
23171 __Pyx_GOTREF(__pyx_tuple__41);
23172 __Pyx_GIVEREF(__pyx_tuple__41);
23173 __pyx_codeobj__5 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__41, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_proteus_BoundaryConditions_py, __pyx_n_s_resetBC, 84, __pyx_empty_bytes);
if (unlikely(!__pyx_codeobj__5)) __PYX_ERR(0, 84, __pyx_L1_error)
23182 __pyx_tuple__42 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_value);
if (unlikely(!__pyx_tuple__42)) __PYX_ERR(0, 87, __pyx_L1_error)
23183 __Pyx_GOTREF(__pyx_tuple__42);
23184 __Pyx_GIVEREF(__pyx_tuple__42);
23185 __pyx_codeobj__6 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__42, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_proteus_BoundaryConditions_py, __pyx_n_s_setConstantBC, 87, __pyx_empty_bytes);
if (unlikely(!__pyx_codeobj__6)) __PYX_ERR(0, 87, __pyx_L1_error)
23194 __pyx_tuple__43 = PyTuple_Pack(3, __pyx_n_s_self, __pyx_n_s_a0, __pyx_n_s_a);
if (unlikely(!__pyx_tuple__43)) __PYX_ERR(0, 100, __pyx_L1_error)
23195 __Pyx_GOTREF(__pyx_tuple__43);
23196 __Pyx_GIVEREF(__pyx_tuple__43);
23197 __pyx_codeobj__8 = (PyObject*)__Pyx_PyCode_New(3, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__43, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_proteus_BoundaryConditions_py, __pyx_n_s_setLinearBC, 100, __pyx_empty_bytes);
if (unlikely(!__pyx_codeobj__8)) __PYX_ERR(0, 100, __pyx_L1_error)
23206 __pyx_tuple__44 = PyTuple_Pack(3, __pyx_n_s_self, __pyx_n_s_t1, __pyx_n_s_value);
if (unlikely(!__pyx_tuple__44)) __PYX_ERR(0, 115, __pyx_L1_error)
23207 __Pyx_GOTREF(__pyx_tuple__44);
23208 __Pyx_GIVEREF(__pyx_tuple__44);
23209 __pyx_codeobj__9 = (PyObject*)__Pyx_PyCode_New(3, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__44, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_proteus_BoundaryConditions_py, __pyx_n_s_setLinearRamp, 115, __pyx_empty_bytes);
if (unlikely(!__pyx_codeobj__9)) __PYX_ERR(0, 115, __pyx_L1_error)
23216 __pyx_tuple__45 = PyTuple_Pack(1, __pyx_n_s_self);
if (unlikely(!__pyx_tuple__45)) __PYX_ERR(1, 1, __pyx_L1_error)
23217 __Pyx_GOTREF(__pyx_tuple__45);
23218 __Pyx_GIVEREF(__pyx_tuple__45);
23219 __pyx_codeobj__10 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__45, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_reduce_cython, 1, __pyx_empty_bytes);
if (unlikely(!__pyx_codeobj__10)) __PYX_ERR(1, 1, __pyx_L1_error)
23227 __pyx_tuple__46 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_pyx_state);
if (unlikely(!__pyx_tuple__46)) __PYX_ERR(1, 3, __pyx_L1_error)
23228 __Pyx_GOTREF(__pyx_tuple__46);
23229 __Pyx_GIVEREF(__pyx_tuple__46);
23230 __pyx_codeobj__12 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__46, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_setstate_cython, 3, __pyx_empty_bytes);
if (unlikely(!__pyx_codeobj__12)) __PYX_ERR(1, 3, __pyx_L1_error)
23237 __pyx_tuple__47 = 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__47)) __PYX_ERR(1, 1, __pyx_L1_error)
23238 __Pyx_GOTREF(__pyx_tuple__47);
23239 __Pyx_GIVEREF(__pyx_tuple__47);
23240 __pyx_codeobj__14 = (PyObject*)__Pyx_PyCode_New(3, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__47, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_pyx_unpickle_BC_Base, 1, __pyx_empty_bytes);
if (unlikely(!__pyx_codeobj__14)) __PYX_ERR(1, 1, __pyx_L1_error)
23249 __pyx_tuple__48 = PyTuple_Pack(1, __pyx_kp_s_strided_and_direct_or_indirect);
if (unlikely(!__pyx_tuple__48)) __PYX_ERR(1, 286, __pyx_L1_error)
23250 __Pyx_GOTREF(__pyx_tuple__48);
23251 __Pyx_GIVEREF(__pyx_tuple__48);
23260 __pyx_tuple__49 = PyTuple_Pack(1, __pyx_kp_s_strided_and_direct);
if (unlikely(!__pyx_tuple__49)) __PYX_ERR(1, 287, __pyx_L1_error)
23261 __Pyx_GOTREF(__pyx_tuple__49);
23262 __Pyx_GIVEREF(__pyx_tuple__49);
23271 __pyx_tuple__50 = PyTuple_Pack(1, __pyx_kp_s_strided_and_indirect);
if (unlikely(!__pyx_tuple__50)) __PYX_ERR(1, 288, __pyx_L1_error)
23272 __Pyx_GOTREF(__pyx_tuple__50);
23273 __Pyx_GIVEREF(__pyx_tuple__50);
23282 __pyx_tuple__51 = PyTuple_Pack(1, __pyx_kp_s_contiguous_and_direct);
if (unlikely(!__pyx_tuple__51)) __PYX_ERR(1, 291, __pyx_L1_error)
23283 __Pyx_GOTREF(__pyx_tuple__51);
23284 __Pyx_GIVEREF(__pyx_tuple__51);
23293 __pyx_tuple__52 = PyTuple_Pack(1, __pyx_kp_s_contiguous_and_indirect);
if (unlikely(!__pyx_tuple__52)) __PYX_ERR(1, 292, __pyx_L1_error)
23294 __Pyx_GOTREF(__pyx_tuple__52);
23295 __Pyx_GIVEREF(__pyx_tuple__52);
23302 __pyx_tuple__53 = 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__53)) __PYX_ERR(1, 1, __pyx_L1_error)
23303 __Pyx_GOTREF(__pyx_tuple__53);
23304 __Pyx_GIVEREF(__pyx_tuple__53);
23305 __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__53, __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(1, 1, __pyx_L1_error)
23306 __Pyx_RefNannyFinishContext();
23309 __Pyx_RefNannyFinishContext();
23313 static CYTHON_SMALL_CODE
int __Pyx_InitGlobals(
void) {
23314 if (__Pyx_InitStrings(__pyx_string_tab) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
23315 __pyx_int_0 = PyInt_FromLong(0);
if (unlikely(!__pyx_int_0)) __PYX_ERR(0, 1, __pyx_L1_error)
23316 __pyx_int_1 = PyInt_FromLong(1);
if (unlikely(!__pyx_int_1)) __PYX_ERR(0, 1, __pyx_L1_error)
23317 __pyx_int_3 = PyInt_FromLong(3);
if (unlikely(!__pyx_int_3)) __PYX_ERR(0, 1, __pyx_L1_error)
23318 __pyx_int_81007987 = PyInt_FromLong(81007987
L);
if (unlikely(!__pyx_int_81007987)) __PYX_ERR(0, 1, __pyx_L1_error)
23319 __pyx_int_112105877 = PyInt_FromLong(112105877
L);
if (unlikely(!__pyx_int_112105877)) __PYX_ERR(0, 1, __pyx_L1_error)
23320 __pyx_int_131364769 = PyInt_FromLong(131364769
L);
if (unlikely(!__pyx_int_131364769)) __PYX_ERR(0, 1, __pyx_L1_error)
23321 __pyx_int_136983863 = PyInt_FromLong(136983863
L);
if (unlikely(!__pyx_int_136983863)) __PYX_ERR(0, 1, __pyx_L1_error)
23322 __pyx_int_158231071 = PyInt_FromLong(158231071
L);
if (unlikely(!__pyx_int_158231071)) __PYX_ERR(0, 1, __pyx_L1_error)
23323 __pyx_int_184977713 = PyInt_FromLong(184977713
L);
if (unlikely(!__pyx_int_184977713)) __PYX_ERR(0, 1, __pyx_L1_error)
23324 __pyx_int_neg_1 = PyInt_FromLong(-1);
if (unlikely(!__pyx_int_neg_1)) __PYX_ERR(0, 1, __pyx_L1_error)
23330 static CYTHON_SMALL_CODE
int __Pyx_modinit_global_init_code(
void);
23331 static CYTHON_SMALL_CODE
int __Pyx_modinit_variable_export_code(
void);
23332 static CYTHON_SMALL_CODE
int __Pyx_modinit_function_export_code(
void);
23333 static CYTHON_SMALL_CODE
int __Pyx_modinit_type_init_code(
void);
23334 static CYTHON_SMALL_CODE
int __Pyx_modinit_type_import_code(
void);
23335 static CYTHON_SMALL_CODE
int __Pyx_modinit_variable_import_code(
void);
23336 static CYTHON_SMALL_CODE
int __Pyx_modinit_function_import_code(
void);
23338 static int __Pyx_modinit_global_init_code(
void) {
23339 __Pyx_RefNannyDeclarations
23340 __Pyx_RefNannySetupContext(
"__Pyx_modinit_global_init_code", 0);
23342 generic = Py_None; Py_INCREF(Py_None);
23343 strided = Py_None; Py_INCREF(Py_None);
23344 indirect = Py_None; Py_INCREF(Py_None);
23345 contiguous = Py_None; Py_INCREF(Py_None);
23346 indirect_contiguous = Py_None; Py_INCREF(Py_None);
23347 __Pyx_RefNannyFinishContext();
23351 static int __Pyx_modinit_variable_export_code(
void) {
23352 __Pyx_RefNannyDeclarations
23353 __Pyx_RefNannySetupContext(
"__Pyx_modinit_variable_export_code", 0);
23355 __Pyx_RefNannyFinishContext();
23359 static int __Pyx_modinit_function_export_code(
void) {
23360 __Pyx_RefNannyDeclarations
23361 __Pyx_RefNannySetupContext(
"__Pyx_modinit_function_export_code", 0);
23363 __Pyx_RefNannyFinishContext();
23367 static int __Pyx_modinit_type_init_code(
void) {
23368 __Pyx_RefNannyDeclarations
23369 int __pyx_lineno = 0;
23370 const char *__pyx_filename = NULL;
23371 int __pyx_clineno = 0;
23372 __Pyx_RefNannySetupContext(
"__Pyx_modinit_type_init_code", 0);
23374 if (PyType_Ready(&__pyx_type_18BoundaryConditions_BC_Base) < 0) __PYX_ERR(0, 20, __pyx_L1_error)
23375 #if PY_VERSION_HEX < 0x030800B1
23376 __pyx_type_18BoundaryConditions_BC_Base.tp_print = 0;
23378 if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_18BoundaryConditions_BC_Base.tp_dictoffset && __pyx_type_18BoundaryConditions_BC_Base.tp_getattro == PyObject_GenericGetAttr)) {
23379 __pyx_type_18BoundaryConditions_BC_Base.tp_getattro = __Pyx_PyObject_GenericGetAttr;
23381 if (PyObject_SetAttr(__pyx_m, __pyx_n_s_BC_Base, (PyObject *)&__pyx_type_18BoundaryConditions_BC_Base) < 0) __PYX_ERR(0, 20, __pyx_L1_error)
23382 if (__Pyx_setup_reduce((PyObject*)&__pyx_type_18BoundaryConditions_BC_Base) < 0) __PYX_ERR(0, 20, __pyx_L1_error)
23383 __pyx_ptype_18BoundaryConditions_BC_Base = &__pyx_type_18BoundaryConditions_BC_Base;
23384 __pyx_vtabptr_18BoundaryConditions_BoundaryCondition = &__pyx_vtable_18BoundaryConditions_BoundaryCondition;
23385 __pyx_vtable_18BoundaryConditions_BoundaryCondition.resetBC = (void (*)(
struct __pyx_obj_18BoundaryConditions_BoundaryCondition *,
int __pyx_skip_dispatch))__pyx_f_18BoundaryConditions_17BoundaryCondition_resetBC;
23386 if (PyType_Ready(&__pyx_type_18BoundaryConditions_BoundaryCondition) < 0) __PYX_ERR(0, 68, __pyx_L1_error)
23387 #if PY_VERSION_HEX < 0x030800B1
23388 __pyx_type_18BoundaryConditions_BoundaryCondition.tp_print = 0;
23390 if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_18BoundaryConditions_BoundaryCondition.tp_dictoffset && __pyx_type_18BoundaryConditions_BoundaryCondition.tp_getattro == PyObject_GenericGetAttr)) {
23391 __pyx_type_18BoundaryConditions_BoundaryCondition.tp_getattro = __Pyx_PyObject_GenericGetAttr;
23393 if (__Pyx_SetVtable(__pyx_type_18BoundaryConditions_BoundaryCondition.tp_dict, __pyx_vtabptr_18BoundaryConditions_BoundaryCondition) < 0) __PYX_ERR(0, 68, __pyx_L1_error)
23394 if (PyObject_SetAttr(__pyx_m, __pyx_n_s_BoundaryCondition, (PyObject *)&__pyx_type_18BoundaryConditions_BoundaryCondition) < 0) __PYX_ERR(0, 68, __pyx_L1_error)
23395 if (__Pyx_setup_reduce((PyObject*)&__pyx_type_18BoundaryConditions_BoundaryCondition) < 0) __PYX_ERR(0, 68, __pyx_L1_error)
23396 __pyx_ptype_18BoundaryConditions_BoundaryCondition = &__pyx_type_18BoundaryConditions_BoundaryCondition;
23397 if (PyType_Ready(&__pyx_type_18BoundaryConditions___pyx_scope_struct__setConstantBC) < 0) __PYX_ERR(0, 87, __pyx_L1_error)
23398 #if PY_VERSION_HEX < 0x030800B1
23399 __pyx_type_18BoundaryConditions___pyx_scope_struct__setConstantBC.tp_print = 0;
23401 if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_18BoundaryConditions___pyx_scope_struct__setConstantBC.tp_dictoffset && __pyx_type_18BoundaryConditions___pyx_scope_struct__setConstantBC.tp_getattro == PyObject_GenericGetAttr)) {
23402 __pyx_type_18BoundaryConditions___pyx_scope_struct__setConstantBC.tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict;
23404 __pyx_ptype_18BoundaryConditions___pyx_scope_struct__setConstantBC = &__pyx_type_18BoundaryConditions___pyx_scope_struct__setConstantBC;
23405 if (PyType_Ready(&__pyx_type_18BoundaryConditions___pyx_scope_struct_1_setLinearBC) < 0) __PYX_ERR(0, 100, __pyx_L1_error)
23406 #if PY_VERSION_HEX < 0x030800B1
23407 __pyx_type_18BoundaryConditions___pyx_scope_struct_1_setLinearBC.tp_print = 0;
23409 if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_18BoundaryConditions___pyx_scope_struct_1_setLinearBC.tp_dictoffset && __pyx_type_18BoundaryConditions___pyx_scope_struct_1_setLinearBC.tp_getattro == PyObject_GenericGetAttr)) {
23410 __pyx_type_18BoundaryConditions___pyx_scope_struct_1_setLinearBC.tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict;
23412 __pyx_ptype_18BoundaryConditions___pyx_scope_struct_1_setLinearBC = &__pyx_type_18BoundaryConditions___pyx_scope_struct_1_setLinearBC;
23413 if (PyType_Ready(&__pyx_type_18BoundaryConditions___pyx_scope_struct_2_setLinearRamp) < 0) __PYX_ERR(0, 115, __pyx_L1_error)
23414 #if PY_VERSION_HEX < 0x030800B1
23415 __pyx_type_18BoundaryConditions___pyx_scope_struct_2_setLinearRamp.tp_print = 0;
23417 if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_18BoundaryConditions___pyx_scope_struct_2_setLinearRamp.tp_dictoffset && __pyx_type_18BoundaryConditions___pyx_scope_struct_2_setLinearRamp.tp_getattro == PyObject_GenericGetAttr)) {
23418 __pyx_type_18BoundaryConditions___pyx_scope_struct_2_setLinearRamp.tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict;
23420 __pyx_ptype_18BoundaryConditions___pyx_scope_struct_2_setLinearRamp = &__pyx_type_18BoundaryConditions___pyx_scope_struct_2_setLinearRamp;
23421 __pyx_vtabptr_array = &__pyx_vtable_array;
23422 __pyx_vtable_array.get_memview = (PyObject *(*)(
struct __pyx_array_obj *))__pyx_array_get_memview;
23423 if (PyType_Ready(&__pyx_type___pyx_array) < 0) __PYX_ERR(1, 105, __pyx_L1_error)
23424 #if PY_VERSION_HEX < 0x030800B1
23425 __pyx_type___pyx_array.tp_print = 0;
23427 if (__Pyx_SetVtable(__pyx_type___pyx_array.tp_dict, __pyx_vtabptr_array) < 0) __PYX_ERR(1, 105, __pyx_L1_error)
23428 if (__Pyx_setup_reduce((PyObject*)&__pyx_type___pyx_array) < 0) __PYX_ERR(1, 105, __pyx_L1_error)
23429 __pyx_array_type = &__pyx_type___pyx_array;
23430 if (PyType_Ready(&__pyx_type___pyx_MemviewEnum) < 0) __PYX_ERR(1, 279, __pyx_L1_error)
23431 #if PY_VERSION_HEX < 0x030800B1
23432 __pyx_type___pyx_MemviewEnum.tp_print = 0;
23434 if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type___pyx_MemviewEnum.tp_dictoffset && __pyx_type___pyx_MemviewEnum.tp_getattro == PyObject_GenericGetAttr)) {
23435 __pyx_type___pyx_MemviewEnum.tp_getattro = __Pyx_PyObject_GenericGetAttr;
23437 if (__Pyx_setup_reduce((PyObject*)&__pyx_type___pyx_MemviewEnum) < 0) __PYX_ERR(1, 279, __pyx_L1_error)
23438 __pyx_MemviewEnum_type = &__pyx_type___pyx_MemviewEnum;
23439 __pyx_vtabptr_memoryview = &__pyx_vtable_memoryview;
23440 __pyx_vtable_memoryview.get_item_pointer = (
char *(*)(
struct __pyx_memoryview_obj *, PyObject *))__pyx_memoryview_get_item_pointer;
23441 __pyx_vtable_memoryview.is_slice = (PyObject *(*)(
struct __pyx_memoryview_obj *, PyObject *))__pyx_memoryview_is_slice;
23442 __pyx_vtable_memoryview.setitem_slice_assignment = (PyObject *(*)(
struct __pyx_memoryview_obj *, PyObject *, PyObject *))__pyx_memoryview_setitem_slice_assignment;
23443 __pyx_vtable_memoryview.setitem_slice_assign_scalar = (PyObject *(*)(
struct __pyx_memoryview_obj *,
struct __pyx_memoryview_obj *, PyObject *))__pyx_memoryview_setitem_slice_assign_scalar;
23444 __pyx_vtable_memoryview.setitem_indexed = (PyObject *(*)(
struct __pyx_memoryview_obj *, PyObject *, PyObject *))__pyx_memoryview_setitem_indexed;
23445 __pyx_vtable_memoryview.convert_item_to_object = (PyObject *(*)(
struct __pyx_memoryview_obj *,
char *))__pyx_memoryview_convert_item_to_object;
23446 __pyx_vtable_memoryview.assign_item_from_object = (PyObject *(*)(
struct __pyx_memoryview_obj *,
char *, PyObject *))__pyx_memoryview_assign_item_from_object;
23447 if (PyType_Ready(&__pyx_type___pyx_memoryview) < 0) __PYX_ERR(1, 330, __pyx_L1_error)
23448 #if PY_VERSION_HEX < 0x030800B1
23449 __pyx_type___pyx_memoryview.tp_print = 0;
23451 if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type___pyx_memoryview.tp_dictoffset && __pyx_type___pyx_memoryview.tp_getattro == PyObject_GenericGetAttr)) {
23452 __pyx_type___pyx_memoryview.tp_getattro = __Pyx_PyObject_GenericGetAttr;
23454 if (__Pyx_SetVtable(__pyx_type___pyx_memoryview.tp_dict, __pyx_vtabptr_memoryview) < 0) __PYX_ERR(1, 330, __pyx_L1_error)
23455 if (__Pyx_setup_reduce((PyObject*)&__pyx_type___pyx_memoryview) < 0) __PYX_ERR(1, 330, __pyx_L1_error)
23456 __pyx_memoryview_type = &__pyx_type___pyx_memoryview;
23457 __pyx_vtabptr__memoryviewslice = &__pyx_vtable__memoryviewslice;
23458 __pyx_vtable__memoryviewslice.__pyx_base = *__pyx_vtabptr_memoryview;
23459 __pyx_vtable__memoryviewslice.__pyx_base.convert_item_to_object = (PyObject *(*)(
struct __pyx_memoryview_obj *,
char *))__pyx_memoryviewslice_convert_item_to_object;
23460 __pyx_vtable__memoryviewslice.__pyx_base.assign_item_from_object = (PyObject *(*)(
struct __pyx_memoryview_obj *,
char *, PyObject *))__pyx_memoryviewslice_assign_item_from_object;
23461 __pyx_type___pyx_memoryviewslice.tp_base = __pyx_memoryview_type;
23462 if (PyType_Ready(&__pyx_type___pyx_memoryviewslice) < 0) __PYX_ERR(1, 965, __pyx_L1_error)
23463 #if PY_VERSION_HEX < 0x030800B1
23464 __pyx_type___pyx_memoryviewslice.tp_print = 0;
23466 if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type___pyx_memoryviewslice.tp_dictoffset && __pyx_type___pyx_memoryviewslice.tp_getattro == PyObject_GenericGetAttr)) {
23467 __pyx_type___pyx_memoryviewslice.tp_getattro = __Pyx_PyObject_GenericGetAttr;
23469 if (__Pyx_SetVtable(__pyx_type___pyx_memoryviewslice.tp_dict, __pyx_vtabptr__memoryviewslice) < 0) __PYX_ERR(1, 965, __pyx_L1_error)
23470 if (__Pyx_setup_reduce((PyObject*)&__pyx_type___pyx_memoryviewslice) < 0) __PYX_ERR(1, 965, __pyx_L1_error)
23471 __pyx_memoryviewslice_type = &__pyx_type___pyx_memoryviewslice;
23472 __Pyx_RefNannyFinishContext();
23475 __Pyx_RefNannyFinishContext();
23479 static int __Pyx_modinit_type_import_code(
void) {
23480 __Pyx_RefNannyDeclarations
23481 PyObject *__pyx_t_1 = NULL;
23482 int __pyx_lineno = 0;
23483 const char *__pyx_filename = NULL;
23484 int __pyx_clineno = 0;
23485 __Pyx_RefNannySetupContext(
"__Pyx_modinit_type_import_code", 0);
23487 __pyx_t_1 = PyImport_ImportModule(__Pyx_BUILTIN_MODULE_NAME);
if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 9, __pyx_L1_error)
23488 __Pyx_GOTREF(__pyx_t_1);
23489 __pyx_ptype_7cpython_4type_type = __Pyx_ImportType(__pyx_t_1, __Pyx_BUILTIN_MODULE_NAME,
"type",
23490 #
if defined(PYPY_VERSION_NUM) && PYPY_VERSION_NUM < 0x050B0000
23491 sizeof(PyTypeObject),
23493 sizeof(PyHeapTypeObject),
23495 __Pyx_ImportType_CheckSize_Warn);
23496 if (!__pyx_ptype_7cpython_4type_type) __PYX_ERR(4, 9, __pyx_L1_error)
23497 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
23498 __pyx_t_1 = PyImport_ImportModule(
"numpy");
if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 200, __pyx_L1_error)
23499 __Pyx_GOTREF(__pyx_t_1);
23500 __pyx_ptype_5numpy_dtype = __Pyx_ImportType(__pyx_t_1,
"numpy",
"dtype",
sizeof(PyArray_Descr), __Pyx_ImportType_CheckSize_Ignore);
23501 if (!__pyx_ptype_5numpy_dtype) __PYX_ERR(3, 200, __pyx_L1_error)
23502 __pyx_ptype_5numpy_flatiter = __Pyx_ImportType(__pyx_t_1,
"numpy",
"flatiter",
sizeof(PyArrayIterObject), __Pyx_ImportType_CheckSize_Ignore);
23503 if (!__pyx_ptype_5numpy_flatiter) __PYX_ERR(3, 223, __pyx_L1_error)
23504 __pyx_ptype_5numpy_broadcast = __Pyx_ImportType(__pyx_t_1,
"numpy",
"broadcast",
sizeof(PyArrayMultiIterObject), __Pyx_ImportType_CheckSize_Ignore);
23505 if (!__pyx_ptype_5numpy_broadcast) __PYX_ERR(3, 227, __pyx_L1_error)
23506 __pyx_ptype_5numpy_ndarray = __Pyx_ImportType(__pyx_t_1,
"numpy",
"ndarray",
sizeof(PyArrayObject), __Pyx_ImportType_CheckSize_Ignore);
23507 if (!__pyx_ptype_5numpy_ndarray) __PYX_ERR(3, 239, __pyx_L1_error)
23508 __pyx_ptype_5numpy_generic = __Pyx_ImportType(__pyx_t_1,
"numpy",
"generic",
sizeof(PyObject), __Pyx_ImportType_CheckSize_Warn);
23509 if (!__pyx_ptype_5numpy_generic) __PYX_ERR(3, 771, __pyx_L1_error)
23510 __pyx_ptype_5numpy_number = __Pyx_ImportType(__pyx_t_1,
"numpy",
"number",
sizeof(PyObject), __Pyx_ImportType_CheckSize_Warn);
23511 if (!__pyx_ptype_5numpy_number) __PYX_ERR(3, 773, __pyx_L1_error)
23512 __pyx_ptype_5numpy_integer = __Pyx_ImportType(__pyx_t_1,
"numpy",
"integer",
sizeof(PyObject), __Pyx_ImportType_CheckSize_Warn);
23513 if (!__pyx_ptype_5numpy_integer) __PYX_ERR(3, 775, __pyx_L1_error)
23514 __pyx_ptype_5numpy_signedinteger = __Pyx_ImportType(__pyx_t_1,
"numpy",
"signedinteger",
sizeof(PyObject), __Pyx_ImportType_CheckSize_Warn);
23515 if (!__pyx_ptype_5numpy_signedinteger) __PYX_ERR(3, 777, __pyx_L1_error)
23516 __pyx_ptype_5numpy_unsignedinteger = __Pyx_ImportType(__pyx_t_1,
"numpy",
"unsignedinteger",
sizeof(PyObject), __Pyx_ImportType_CheckSize_Warn);
23517 if (!__pyx_ptype_5numpy_unsignedinteger) __PYX_ERR(3, 779, __pyx_L1_error)
23518 __pyx_ptype_5numpy_inexact = __Pyx_ImportType(__pyx_t_1,
"numpy",
"inexact",
sizeof(PyObject), __Pyx_ImportType_CheckSize_Warn);
23519 if (!__pyx_ptype_5numpy_inexact) __PYX_ERR(3, 781, __pyx_L1_error)
23520 __pyx_ptype_5numpy_floating = __Pyx_ImportType(__pyx_t_1,
"numpy",
"floating",
sizeof(PyObject), __Pyx_ImportType_CheckSize_Warn);
23521 if (!__pyx_ptype_5numpy_floating) __PYX_ERR(3, 783, __pyx_L1_error)
23522 __pyx_ptype_5numpy_complexfloating = __Pyx_ImportType(__pyx_t_1,
"numpy",
"complexfloating",
sizeof(PyObject), __Pyx_ImportType_CheckSize_Warn);
23523 if (!__pyx_ptype_5numpy_complexfloating) __PYX_ERR(3, 785, __pyx_L1_error)
23524 __pyx_ptype_5numpy_flexible = __Pyx_ImportType(__pyx_t_1,
"numpy",
"flexible",
sizeof(PyObject), __Pyx_ImportType_CheckSize_Warn);
23525 if (!__pyx_ptype_5numpy_flexible) __PYX_ERR(3, 787, __pyx_L1_error)
23526 __pyx_ptype_5numpy_character = __Pyx_ImportType(__pyx_t_1,
"numpy",
"character",
sizeof(PyObject), __Pyx_ImportType_CheckSize_Warn);
23527 if (!__pyx_ptype_5numpy_character) __PYX_ERR(3, 789, __pyx_L1_error)
23528 __pyx_ptype_5numpy_ufunc = __Pyx_ImportType(__pyx_t_1,
"numpy",
"ufunc",
sizeof(PyUFuncObject), __Pyx_ImportType_CheckSize_Ignore);
23529 if (!__pyx_ptype_5numpy_ufunc) __PYX_ERR(3, 827, __pyx_L1_error)
23530 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
23531 __Pyx_RefNannyFinishContext();
23534 __Pyx_XDECREF(__pyx_t_1);
23535 __Pyx_RefNannyFinishContext();
23539 static int __Pyx_modinit_variable_import_code(
void) {
23540 __Pyx_RefNannyDeclarations
23541 __Pyx_RefNannySetupContext(
"__Pyx_modinit_variable_import_code", 0);
23543 __Pyx_RefNannyFinishContext();
23547 static int __Pyx_modinit_function_import_code(
void) {
23548 __Pyx_RefNannyDeclarations
23549 __Pyx_RefNannySetupContext(
"__Pyx_modinit_function_import_code", 0);
23551 __Pyx_RefNannyFinishContext();
23556 #ifndef CYTHON_NO_PYINIT_EXPORT
23557 #define __Pyx_PyMODINIT_FUNC PyMODINIT_FUNC
23558 #elif PY_MAJOR_VERSION < 3
23560 #define __Pyx_PyMODINIT_FUNC extern "C" void
23562 #define __Pyx_PyMODINIT_FUNC void
23566 #define __Pyx_PyMODINIT_FUNC extern "C" PyObject *
23568 #define __Pyx_PyMODINIT_FUNC PyObject *
23573 #if PY_MAJOR_VERSION < 3
23574 __Pyx_PyMODINIT_FUNC initBoundaryConditions(
void) CYTHON_SMALL_CODE;
23575 __Pyx_PyMODINIT_FUNC initBoundaryConditions(
void)
23577 __Pyx_PyMODINIT_FUNC PyInit_BoundaryConditions(
void) CYTHON_SMALL_CODE;
23578 __Pyx_PyMODINIT_FUNC PyInit_BoundaryConditions(
void)
23579 #if CYTHON_PEP489_MULTI_PHASE_INIT
23581 return PyModuleDef_Init(&__pyx_moduledef);
23583 static CYTHON_SMALL_CODE
int __Pyx_check_single_interpreter(
void) {
23584 #if PY_VERSION_HEX >= 0x030700A1
23585 static PY_INT64_T main_interpreter_id = -1;
23586 PY_INT64_T current_id = PyInterpreterState_GetID(PyThreadState_Get()->interp);
23587 if (main_interpreter_id == -1) {
23588 main_interpreter_id = current_id;
23589 return (unlikely(current_id == -1)) ? -1 : 0;
23590 }
else if (unlikely(main_interpreter_id != current_id))
23592 static PyInterpreterState *main_interpreter = NULL;
23593 PyInterpreterState *current_interpreter = PyThreadState_Get()->interp;
23594 if (!main_interpreter) {
23595 main_interpreter = current_interpreter;
23596 }
else if (unlikely(main_interpreter != current_interpreter))
23601 "Interpreter change detected - this module can only be loaded into one interpreter per process.");
23606 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) {
23607 PyObject *value = PyObject_GetAttrString(spec, from_name);
23609 if (likely(value)) {
23610 if (allow_none || value != Py_None) {
23611 result = PyDict_SetItemString(moddict, to_name, value);
23614 }
else if (PyErr_ExceptionMatches(PyExc_AttributeError)) {
23621 static CYTHON_SMALL_CODE PyObject* __pyx_pymod_create(PyObject *spec, CYTHON_UNUSED PyModuleDef *def) {
23622 PyObject *module = NULL, *moddict, *modname;
23623 if (__Pyx_check_single_interpreter())
23626 return __Pyx_NewRef(__pyx_m);
23627 modname = PyObject_GetAttrString(spec,
"name");
23628 if (unlikely(!modname))
goto bad;
23629 module = PyModule_NewObject(modname);
23630 Py_DECREF(modname);
23631 if (unlikely(!module))
goto bad;
23632 moddict = PyModule_GetDict(module);
23633 if (unlikely(!moddict))
goto bad;
23634 if (unlikely(__Pyx_copy_spec_to_module(spec, moddict,
"loader",
"__loader__", 1) < 0))
goto bad;
23635 if (unlikely(__Pyx_copy_spec_to_module(spec, moddict,
"origin",
"__file__", 1) < 0))
goto bad;
23636 if (unlikely(__Pyx_copy_spec_to_module(spec, moddict,
"parent",
"__package__", 1) < 0))
goto bad;
23637 if (unlikely(__Pyx_copy_spec_to_module(spec, moddict,
"submodule_search_locations",
"__path__", 0) < 0))
goto bad;
23640 Py_XDECREF(module);
23645 static CYTHON_SMALL_CODE
int __pyx_pymod_exec_BoundaryConditions(PyObject *__pyx_pyinit_module)
23649 __Pyx_TraceDeclarations
23650 PyObject *__pyx_t_1 = NULL;
23651 static PyThread_type_lock __pyx_t_2[8];
23652 int __pyx_lineno = 0;
23653 const char *__pyx_filename = NULL;
23654 int __pyx_clineno = 0;
23655 __Pyx_RefNannyDeclarations
23656 #if CYTHON_PEP489_MULTI_PHASE_INIT
23658 if (__pyx_m == __pyx_pyinit_module)
return 0;
23659 PyErr_SetString(PyExc_RuntimeError,
"Module 'BoundaryConditions' has already been imported. Re-initialisation is not supported.");
23662 #elif PY_MAJOR_VERSION >= 3
23663 if (__pyx_m)
return __Pyx_NewRef(__pyx_m);
23665 #if CYTHON_REFNANNY
23666 __Pyx_RefNanny = __Pyx_RefNannyImportAPI(
"refnanny");
23667 if (!__Pyx_RefNanny) {
23669 __Pyx_RefNanny = __Pyx_RefNannyImportAPI(
"Cython.Runtime.refnanny");
23670 if (!__Pyx_RefNanny)
23671 Py_FatalError(
"failed to import 'refnanny' module");
23674 __Pyx_RefNannySetupContext(
"__Pyx_PyMODINIT_FUNC PyInit_BoundaryConditions(void)", 0);
23675 if (__Pyx_check_binary_version() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
23676 #ifdef __Pxy_PyFrame_Initialize_Offsets
23677 __Pxy_PyFrame_Initialize_Offsets();
23679 __pyx_empty_tuple = PyTuple_New(0);
if (unlikely(!__pyx_empty_tuple)) __PYX_ERR(0, 1, __pyx_L1_error)
23680 __pyx_empty_bytes = PyBytes_FromStringAndSize(
"", 0);
if (unlikely(!__pyx_empty_bytes)) __PYX_ERR(0, 1, __pyx_L1_error)
23681 __pyx_empty_unicode = PyUnicode_FromStringAndSize(
"", 0);
if (unlikely(!__pyx_empty_unicode)) __PYX_ERR(0, 1, __pyx_L1_error)
23682 #ifdef __Pyx_CyFunction_USED
23683 if (__pyx_CyFunction_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
23685 #ifdef __Pyx_FusedFunction_USED
23686 if (__pyx_FusedFunction_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
23688 #ifdef __Pyx_Coroutine_USED
23689 if (__pyx_Coroutine_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
23691 #ifdef __Pyx_Generator_USED
23692 if (__pyx_Generator_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
23694 #ifdef __Pyx_AsyncGen_USED
23695 if (__pyx_AsyncGen_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
23697 #ifdef __Pyx_StopAsyncIteration_USED
23698 if (__pyx_StopAsyncIteration_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
23702 #if defined(WITH_THREAD) && PY_VERSION_HEX < 0x030700F0 && defined(__PYX_FORCE_INIT_THREADS) && __PYX_FORCE_INIT_THREADS
23703 PyEval_InitThreads();
23706 #if CYTHON_PEP489_MULTI_PHASE_INIT
23707 __pyx_m = __pyx_pyinit_module;
23708 Py_INCREF(__pyx_m);
23710 #if PY_MAJOR_VERSION < 3
23711 __pyx_m = Py_InitModule4(
"BoundaryConditions", __pyx_methods, 0, 0, PYTHON_API_VERSION); Py_XINCREF(__pyx_m);
23713 __pyx_m = PyModule_Create(&__pyx_moduledef);
23715 if (unlikely(!__pyx_m)) __PYX_ERR(0, 1, __pyx_L1_error)
23717 __pyx_d = PyModule_GetDict(__pyx_m);
if (unlikely(!__pyx_d)) __PYX_ERR(0, 1, __pyx_L1_error)
23718 Py_INCREF(__pyx_d);
23719 __pyx_b = PyImport_AddModule(__Pyx_BUILTIN_MODULE_NAME);
if (unlikely(!__pyx_b)) __PYX_ERR(0, 1, __pyx_L1_error)
23720 Py_INCREF(__pyx_b);
23721 __pyx_cython_runtime = PyImport_AddModule((
char *)
"cython_runtime");
if (unlikely(!__pyx_cython_runtime)) __PYX_ERR(0, 1, __pyx_L1_error)
23722 Py_INCREF(__pyx_cython_runtime);
23723 if (PyObject_SetAttrString(__pyx_m,
"__builtins__", __pyx_b) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
23725 if (__Pyx_InitGlobals() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
23726 #if PY_MAJOR_VERSION < 3 && (__PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT)
23727 if (__Pyx_init_sys_getdefaultencoding_params() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
23729 if (__pyx_module_is_main_BoundaryConditions) {
23730 if (PyObject_SetAttr(__pyx_m, __pyx_n_s_name_2, __pyx_n_s_main) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
23732 #if PY_MAJOR_VERSION >= 3
23734 PyObject *modules = PyImport_GetModuleDict();
if (unlikely(!modules)) __PYX_ERR(0, 1, __pyx_L1_error)
23735 if (!PyDict_GetItemString(modules,
"BoundaryConditions")) {
23736 if (unlikely(PyDict_SetItemString(modules,
"BoundaryConditions", __pyx_m) < 0)) __PYX_ERR(0, 1, __pyx_L1_error)
23741 if (__Pyx_InitCachedBuiltins() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
23743 if (__Pyx_InitCachedConstants() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
23745 (void)__Pyx_modinit_global_init_code();
23746 (void)__Pyx_modinit_variable_export_code();
23747 (void)__Pyx_modinit_function_export_code();
23748 if (unlikely(__Pyx_modinit_type_init_code() < 0)) __PYX_ERR(0, 1, __pyx_L1_error)
23749 if (unlikely(__Pyx_modinit_type_import_code() < 0)) __PYX_ERR(0, 1, __pyx_L1_error)
23750 (void)__Pyx_modinit_variable_import_code();
23751 (void)__Pyx_modinit_function_import_code();
23753 #if defined(__Pyx_Generator_USED) || defined(__Pyx_Coroutine_USED)
23754 if (__Pyx_patch_abc() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
23756 __Pyx_TraceCall(
"__Pyx_PyMODINIT_FUNC PyInit_BoundaryConditions(void)", __pyx_f[0], 1, 0, __PYX_ERR(0, 1, __pyx_L1_error));
23765 __pyx_t_1 = __Pyx_Import(__pyx_n_s_numpy, 0, -1);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 9, __pyx_L1_error)
23766 __Pyx_GOTREF(__pyx_t_1);
23767 if (PyDict_SetItem(__pyx_d, __pyx_n_s_np, __pyx_t_1) < 0) __PYX_ERR(0, 9, __pyx_L1_error)
23768 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
23777 __pyx_t_1 = PyList_New(2);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 17, __pyx_L1_error)
23778 __Pyx_GOTREF(__pyx_t_1);
23779 __Pyx_INCREF(__pyx_n_s_BC_Base);
23780 __Pyx_GIVEREF(__pyx_n_s_BC_Base);
23781 PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_s_BC_Base);
23782 __Pyx_INCREF(__pyx_n_s_BoundaryCondition);
23783 __Pyx_GIVEREF(__pyx_n_s_BoundaryCondition);
23784 PyList_SET_ITEM(__pyx_t_1, 1, __pyx_n_s_BoundaryCondition);
23785 if (PyDict_SetItem(__pyx_d, __pyx_n_s_all, __pyx_t_1) < 0) __PYX_ERR(0, 17, __pyx_L1_error)
23786 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
23795 __pyx_t_1 = __Pyx_CyFunction_New(&__pyx_mdef_18BoundaryConditions_7BC_Base_3getContext, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_BC_Base_getContext, NULL, __pyx_n_s_BoundaryConditions, __pyx_d, ((PyObject *)__pyx_codeobj_));
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 52, __pyx_L1_error)
23796 __Pyx_GOTREF(__pyx_t_1);
23797 if (PyDict_SetItem((PyObject *)__pyx_ptype_18BoundaryConditions_BC_Base->tp_dict, __pyx_n_s_getContext, __pyx_t_1) < 0) __PYX_ERR(0, 52, __pyx_L1_error)
23798 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
23799 PyType_Modified(__pyx_ptype_18BoundaryConditions_BC_Base);
23806 __pyx_t_1 = __Pyx_CyFunction_New(&__pyx_mdef_18BoundaryConditions_7BC_Base_5__reduce_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_BC_Base___reduce_cython, NULL, __pyx_n_s_BoundaryConditions, __pyx_d, ((PyObject *)__pyx_codeobj__2));
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1, __pyx_L1_error)
23807 __Pyx_GOTREF(__pyx_t_1);
23808 if (PyDict_SetItem((PyObject *)__pyx_ptype_18BoundaryConditions_BC_Base->tp_dict, __pyx_n_s_reduce_cython, __pyx_t_1) < 0) __PYX_ERR(1, 1, __pyx_L1_error)
23809 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
23810 PyType_Modified(__pyx_ptype_18BoundaryConditions_BC_Base);
23818 __pyx_t_1 = __Pyx_CyFunction_New(&__pyx_mdef_18BoundaryConditions_7BC_Base_7__setstate_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_BC_Base___setstate_cython, NULL, __pyx_n_s_BoundaryConditions, __pyx_d, ((PyObject *)__pyx_codeobj__3));
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 16, __pyx_L1_error)
23819 __Pyx_GOTREF(__pyx_t_1);
23820 if (PyDict_SetItem((PyObject *)__pyx_ptype_18BoundaryConditions_BC_Base->tp_dict, __pyx_n_s_setstate_cython, __pyx_t_1) < 0) __PYX_ERR(1, 16, __pyx_L1_error)
23821 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
23822 PyType_Modified(__pyx_ptype_18BoundaryConditions_BC_Base);
23831 __pyx_t_1 = __Pyx_CyFunction_New(&__pyx_mdef_18BoundaryConditions_17BoundaryCondition_3init_cython, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_BoundaryCondition_init_cython, NULL, __pyx_n_s_BoundaryConditions, __pyx_d, ((PyObject *)__pyx_codeobj__4));
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 81, __pyx_L1_error)
23832 __Pyx_GOTREF(__pyx_t_1);
23833 if (PyDict_SetItem((PyObject *)__pyx_ptype_18BoundaryConditions_BoundaryCondition->tp_dict, __pyx_n_s_init_cython, __pyx_t_1) < 0) __PYX_ERR(0, 81, __pyx_L1_error)
23834 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
23835 PyType_Modified(__pyx_ptype_18BoundaryConditions_BoundaryCondition);
23844 __pyx_t_1 = __Pyx_CyFunction_New(&__pyx_mdef_18BoundaryConditions_17BoundaryCondition_5resetBC, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_BoundaryCondition_resetBC, NULL, __pyx_n_s_BoundaryConditions, __pyx_d, ((PyObject *)__pyx_codeobj__5));
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 84, __pyx_L1_error)
23845 __Pyx_GOTREF(__pyx_t_1);
23846 if (PyDict_SetItem((PyObject *)__pyx_ptype_18BoundaryConditions_BoundaryCondition->tp_dict, __pyx_n_s_resetBC, __pyx_t_1) < 0) __PYX_ERR(0, 84, __pyx_L1_error)
23847 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
23848 PyType_Modified(__pyx_ptype_18BoundaryConditions_BoundaryCondition);
23857 __pyx_t_1 = __Pyx_CyFunction_New(&__pyx_mdef_18BoundaryConditions_17BoundaryCondition_7setConstantBC, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_BoundaryCondition_setConstantBC, NULL, __pyx_n_s_BoundaryConditions, __pyx_d, ((PyObject *)__pyx_codeobj__6));
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 87, __pyx_L1_error)
23858 __Pyx_GOTREF(__pyx_t_1);
23859 if (PyDict_SetItem((PyObject *)__pyx_ptype_18BoundaryConditions_BoundaryCondition->tp_dict, __pyx_n_s_setConstantBC, __pyx_t_1) < 0) __PYX_ERR(0, 87, __pyx_L1_error)
23860 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
23861 PyType_Modified(__pyx_ptype_18BoundaryConditions_BoundaryCondition);
23870 __pyx_t_1 = __Pyx_CyFunction_New(&__pyx_mdef_18BoundaryConditions_17BoundaryCondition_9setLinearBC, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_BoundaryCondition_setLinearBC, NULL, __pyx_n_s_BoundaryConditions, __pyx_d, ((PyObject *)__pyx_codeobj__8));
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 100, __pyx_L1_error)
23871 __Pyx_GOTREF(__pyx_t_1);
23872 if (PyDict_SetItem((PyObject *)__pyx_ptype_18BoundaryConditions_BoundaryCondition->tp_dict, __pyx_n_s_setLinearBC, __pyx_t_1) < 0) __PYX_ERR(0, 100, __pyx_L1_error)
23873 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
23874 PyType_Modified(__pyx_ptype_18BoundaryConditions_BoundaryCondition);
23883 __pyx_t_1 = __Pyx_CyFunction_New(&__pyx_mdef_18BoundaryConditions_17BoundaryCondition_11setLinearRamp, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_BoundaryCondition_setLinearRamp, NULL, __pyx_n_s_BoundaryConditions, __pyx_d, ((PyObject *)__pyx_codeobj__9));
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 115, __pyx_L1_error)
23884 __Pyx_GOTREF(__pyx_t_1);
23885 if (PyDict_SetItem((PyObject *)__pyx_ptype_18BoundaryConditions_BoundaryCondition->tp_dict, __pyx_n_s_setLinearRamp, __pyx_t_1) < 0) __PYX_ERR(0, 115, __pyx_L1_error)
23886 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
23887 PyType_Modified(__pyx_ptype_18BoundaryConditions_BoundaryCondition);
23894 __pyx_t_1 = __Pyx_CyFunction_New(&__pyx_mdef_18BoundaryConditions_17BoundaryCondition_13__reduce_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_BoundaryCondition___reduce_cytho, NULL, __pyx_n_s_BoundaryConditions, __pyx_d, ((PyObject *)__pyx_codeobj__10));
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1, __pyx_L1_error)
23895 __Pyx_GOTREF(__pyx_t_1);
23896 if (PyDict_SetItem(__pyx_d, __pyx_n_s_reduce_cython, __pyx_t_1) < 0) __PYX_ERR(1, 1, __pyx_L1_error)
23897 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
23905 __pyx_t_1 = __Pyx_CyFunction_New(&__pyx_mdef_18BoundaryConditions_17BoundaryCondition_15__setstate_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_BoundaryCondition___setstate_cyt, NULL, __pyx_n_s_BoundaryConditions, __pyx_d, ((PyObject *)__pyx_codeobj__12));
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 3, __pyx_L1_error)
23906 __Pyx_GOTREF(__pyx_t_1);
23907 if (PyDict_SetItem(__pyx_d, __pyx_n_s_setstate_cython, __pyx_t_1) < 0) __PYX_ERR(1, 3, __pyx_L1_error)
23908 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
23915 __pyx_t_1 = __Pyx_CyFunction_New(&__pyx_mdef_18BoundaryConditions_1__pyx_unpickle_BC_Base, 0, __pyx_n_s_pyx_unpickle_BC_Base, NULL, __pyx_n_s_BoundaryConditions, __pyx_d, ((PyObject *)__pyx_codeobj__14));
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1, __pyx_L1_error)
23916 __Pyx_GOTREF(__pyx_t_1);
23917 if (PyDict_SetItem(__pyx_d, __pyx_n_s_pyx_unpickle_BC_Base, __pyx_t_1) < 0) __PYX_ERR(1, 1, __pyx_L1_error)
23918 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
23925 __pyx_t_1 = __Pyx_PyDict_NewPresized(0);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1, __pyx_L1_error)
23926 __Pyx_GOTREF(__pyx_t_1);
23927 if (PyDict_SetItem(__pyx_d, __pyx_n_s_test, __pyx_t_1) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
23928 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
23937 __pyx_t_1 = __pyx_capsule_create(((
void *)(&__pyx_array_getbuffer)), ((
char *)
"getbuffer(obj, view, flags)"));
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 209, __pyx_L1_error)
23938 __Pyx_GOTREF(__pyx_t_1);
23939 if (PyDict_SetItem((PyObject *)__pyx_array_type->tp_dict, __pyx_n_s_pyx_getbuffer, __pyx_t_1) < 0) __PYX_ERR(1, 209, __pyx_L1_error)
23940 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
23941 PyType_Modified(__pyx_array_type);
23950 __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)__pyx_MemviewEnum_type), __pyx_tuple__48, NULL);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 286, __pyx_L1_error)
23951 __Pyx_GOTREF(__pyx_t_1);
23952 __Pyx_XGOTREF(
generic);
23953 __Pyx_DECREF_SET(
generic, __pyx_t_1);
23954 __Pyx_GIVEREF(__pyx_t_1);
23964 __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)__pyx_MemviewEnum_type), __pyx_tuple__49, NULL);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 287, __pyx_L1_error)
23965 __Pyx_GOTREF(__pyx_t_1);
23966 __Pyx_XGOTREF(strided);
23967 __Pyx_DECREF_SET(strided, __pyx_t_1);
23968 __Pyx_GIVEREF(__pyx_t_1);
23978 __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)__pyx_MemviewEnum_type), __pyx_tuple__50, NULL);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 288, __pyx_L1_error)
23979 __Pyx_GOTREF(__pyx_t_1);
23980 __Pyx_XGOTREF(indirect);
23981 __Pyx_DECREF_SET(indirect, __pyx_t_1);
23982 __Pyx_GIVEREF(__pyx_t_1);
23992 __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)__pyx_MemviewEnum_type), __pyx_tuple__51, NULL);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 291, __pyx_L1_error)
23993 __Pyx_GOTREF(__pyx_t_1);
23994 __Pyx_XGOTREF(contiguous);
23995 __Pyx_DECREF_SET(contiguous, __pyx_t_1);
23996 __Pyx_GIVEREF(__pyx_t_1);
24006 __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)__pyx_MemviewEnum_type), __pyx_tuple__52, NULL);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 292, __pyx_L1_error)
24007 __Pyx_GOTREF(__pyx_t_1);
24008 __Pyx_XGOTREF(indirect_contiguous);
24009 __Pyx_DECREF_SET(indirect_contiguous, __pyx_t_1);
24010 __Pyx_GIVEREF(__pyx_t_1);
24020 __pyx_memoryview_thread_locks_used = 0;
24029 __pyx_t_2[0] = PyThread_allocate_lock();
24030 __pyx_t_2[1] = PyThread_allocate_lock();
24031 __pyx_t_2[2] = PyThread_allocate_lock();
24032 __pyx_t_2[3] = PyThread_allocate_lock();
24033 __pyx_t_2[4] = PyThread_allocate_lock();
24034 __pyx_t_2[5] = PyThread_allocate_lock();
24035 __pyx_t_2[6] = PyThread_allocate_lock();
24036 __pyx_t_2[7] = PyThread_allocate_lock();
24037 memcpy(&(__pyx_memoryview_thread_locks[0]), __pyx_t_2,
sizeof(__pyx_memoryview_thread_locks[0]) * (8));
24046 __pyx_t_1 = __pyx_capsule_create(((
void *)(&__pyx_memoryview_getbuffer)), ((
char *)
"getbuffer(obj, view, flags)"));
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 549, __pyx_L1_error)
24047 __Pyx_GOTREF(__pyx_t_1);
24048 if (PyDict_SetItem((PyObject *)__pyx_memoryview_type->tp_dict, __pyx_n_s_pyx_getbuffer, __pyx_t_1) < 0) __PYX_ERR(1, 549, __pyx_L1_error)
24049 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
24050 PyType_Modified(__pyx_memoryview_type);
24059 __pyx_t_1 = __pyx_capsule_create(((
void *)(&__pyx_memoryview_getbuffer)), ((
char *)
"getbuffer(obj, view, flags)"));
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 995, __pyx_L1_error)
24060 __Pyx_GOTREF(__pyx_t_1);
24061 if (PyDict_SetItem((PyObject *)__pyx_memoryviewslice_type->tp_dict, __pyx_n_s_pyx_getbuffer, __pyx_t_1) < 0) __PYX_ERR(1, 995, __pyx_L1_error)
24062 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
24063 PyType_Modified(__pyx_memoryviewslice_type);
24070 __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(1, 1, __pyx_L1_error)
24071 __Pyx_GOTREF(__pyx_t_1);
24072 if (PyDict_SetItem(__pyx_d, __pyx_n_s_pyx_unpickle_Enum, __pyx_t_1) < 0) __PYX_ERR(1, 1, __pyx_L1_error)
24073 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
24082 __Pyx_TraceReturn(Py_None, 0);
24088 __Pyx_XDECREF(__pyx_t_1);
24091 __Pyx_AddTraceback(
"init BoundaryConditions", __pyx_clineno, __pyx_lineno, __pyx_filename);
24094 }
else if (!PyErr_Occurred()) {
24095 PyErr_SetString(PyExc_ImportError,
"init BoundaryConditions");
24098 __Pyx_RefNannyFinishContext();
24099 #if CYTHON_PEP489_MULTI_PHASE_INIT
24100 return (__pyx_m != NULL) ? 0 : -1;
24101 #elif PY_MAJOR_VERSION >= 3
24110 #if CYTHON_REFNANNY
24111 static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(
const char *modname) {
24112 PyObject *m = NULL, *p = NULL;
24114 m = PyImport_ImportModule(modname);
24116 p = PyObject_GetAttrString(m,
"RefNannyAPI");
24118 r = PyLong_AsVoidPtr(p);
24122 return (__Pyx_RefNannyAPIStruct *)
r;
24127 #if CYTHON_USE_TYPE_SLOTS
24128 static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name) {
24129 PyTypeObject* tp = Py_TYPE(obj);
24130 if (likely(tp->tp_getattro))
24131 return tp->tp_getattro(obj, attr_name);
24132 #if PY_MAJOR_VERSION < 3
24133 if (likely(tp->tp_getattr))
24134 return tp->tp_getattr(obj, PyString_AS_STRING(attr_name));
24136 return PyObject_GetAttr(obj, attr_name);
24141 static PyObject *__Pyx_GetBuiltinName(PyObject *name) {
24142 PyObject* result = __Pyx_PyObject_GetAttrStr(__pyx_b, name);
24143 if (unlikely(!result)) {
24144 PyErr_Format(PyExc_NameError,
24145 #
if PY_MAJOR_VERSION >= 3
24146 "name '%U' is not defined", name);
24148 "name '%.200s' is not defined", PyString_AS_STRING(name));
24155 static void __Pyx_RaiseDoubleKeywordsError(
24156 const char* func_name,
24159 PyErr_Format(PyExc_TypeError,
24160 #
if PY_MAJOR_VERSION >= 3
24161 "%s() got multiple values for keyword argument '%U'", func_name, kw_name);
24163 "%s() got multiple values for keyword argument '%s'", func_name,
24164 PyString_AsString(kw_name));
24169 static int __Pyx_ParseOptionalKeywords(
24171 PyObject **argnames[],
24173 PyObject *values[],
24174 Py_ssize_t num_pos_args,
24175 const char* function_name)
24177 PyObject *key = 0, *value = 0;
24178 Py_ssize_t
pos = 0;
24180 PyObject*** first_kw_arg = argnames + num_pos_args;
24181 while (PyDict_Next(kwds, &
pos, &key, &value)) {
24182 name = first_kw_arg;
24183 while (*name && (**name != key)) name++;
24185 values[name-argnames] = value;
24188 name = first_kw_arg;
24189 #if PY_MAJOR_VERSION < 3
24190 if (likely(PyString_Check(key))) {
24192 if ((CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**name) == PyString_GET_SIZE(key))
24193 && _PyString_Eq(**name, key)) {
24194 values[name-argnames] = value;
24199 if (*name)
continue;
24201 PyObject*** argname = argnames;
24202 while (argname != first_kw_arg) {
24203 if ((**argname == key) || (
24204 (CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**argname) == PyString_GET_SIZE(key))
24205 && _PyString_Eq(**argname, key))) {
24206 goto arg_passed_twice;
24213 if (likely(PyUnicode_Check(key))) {
24215 int cmp = (**name == key) ? 0 :
24216 #
if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3
24217 (__Pyx_PyUnicode_GET_LENGTH(**name) != __Pyx_PyUnicode_GET_LENGTH(key)) ? 1 :
24219 PyUnicode_Compare(**name, key);
24220 if (cmp < 0 && unlikely(PyErr_Occurred()))
goto bad;
24222 values[name-argnames] = value;
24227 if (*name)
continue;
24229 PyObject*** argname = argnames;
24230 while (argname != first_kw_arg) {
24231 int cmp = (**argname == key) ? 0 :
24232 #
if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3
24233 (__Pyx_PyUnicode_GET_LENGTH(**argname) != __Pyx_PyUnicode_GET_LENGTH(key)) ? 1 :
24235 PyUnicode_Compare(**argname, key);
24236 if (cmp < 0 && unlikely(PyErr_Occurred()))
goto bad;
24237 if (cmp == 0)
goto arg_passed_twice;
24242 goto invalid_keyword_type;
24244 if (unlikely(PyDict_SetItem(kwds2, key, value)))
goto bad;
24246 goto invalid_keyword;
24251 __Pyx_RaiseDoubleKeywordsError(function_name, key);
24253 invalid_keyword_type:
24254 PyErr_Format(PyExc_TypeError,
24255 "%.200s() keywords must be strings", function_name);
24258 PyErr_Format(PyExc_TypeError,
24259 #
if PY_MAJOR_VERSION < 3
24260 "%.200s() got an unexpected keyword argument '%.200s'",
24261 function_name, PyString_AsString(key));
24263 "%s() got an unexpected keyword argument '%U'",
24264 function_name, key);
24271 static void __Pyx_RaiseArgtupleInvalid(
24272 const char* func_name,
24274 Py_ssize_t num_min,
24275 Py_ssize_t num_max,
24276 Py_ssize_t num_found)
24278 Py_ssize_t num_expected;
24279 const char *more_or_less;
24280 if (num_found < num_min) {
24281 num_expected = num_min;
24282 more_or_less =
"at least";
24284 num_expected = num_max;
24285 more_or_less =
"at most";
24288 more_or_less =
"exactly";
24290 PyErr_Format(PyExc_TypeError,
24291 "%.200s() takes %.8s %" CYTHON_FORMAT_SSIZE_T
"d positional argument%.1s (%" CYTHON_FORMAT_SSIZE_T
"d given)",
24292 func_name, more_or_less, num_expected,
24293 (num_expected == 1) ?
"" :
"s", num_found);
24297 #if CYTHON_FAST_THREAD_STATE
24298 static CYTHON_INLINE
void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb) {
24299 PyObject *tmp_type, *tmp_value, *tmp_tb;
24300 tmp_type = tstate->curexc_type;
24301 tmp_value = tstate->curexc_value;
24302 tmp_tb = tstate->curexc_traceback;
24303 tstate->curexc_type = type;
24304 tstate->curexc_value = value;
24305 tstate->curexc_traceback = tb;
24306 Py_XDECREF(tmp_type);
24307 Py_XDECREF(tmp_value);
24308 Py_XDECREF(tmp_tb);
24310 static CYTHON_INLINE
void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) {
24311 *type = tstate->curexc_type;
24312 *value = tstate->curexc_value;
24313 *tb = tstate->curexc_traceback;
24314 tstate->curexc_type = 0;
24315 tstate->curexc_value = 0;
24316 tstate->curexc_traceback = 0;
24322 static int __Pyx_TraceSetupAndCall(PyCodeObject** code,
24323 PyFrameObject** frame,
24324 PyThreadState* tstate,
24325 const char *funcname,
24326 const char *srcfile,
24328 PyObject *type, *value, *traceback;
24330 if (*frame == NULL || !CYTHON_PROFILE_REUSE_FRAME) {
24331 if (*code == NULL) {
24332 *code = __Pyx_createFrameCodeObject(funcname, srcfile, firstlineno);
24333 if (*code == NULL)
return 0;
24335 *frame = PyFrame_New(
24341 if (*frame == NULL)
return 0;
24342 if (CYTHON_TRACE && (*frame)->f_trace == NULL) {
24343 Py_INCREF(Py_None);
24344 (*frame)->f_trace = Py_None;
24346 #if PY_VERSION_HEX < 0x030400B1
24348 (*frame)->f_tstate = tstate;
24351 __Pyx_PyFrame_SetLineNumber(*frame, firstlineno);
24353 __Pyx_EnterTracing(tstate);
24354 __Pyx_ErrFetchInState(tstate, &type, &value, &traceback);
24356 if (tstate->c_tracefunc)
24357 retval = tstate->c_tracefunc(tstate->c_traceobj, *frame, PyTrace_CALL, NULL) == 0;
24358 if (retval && tstate->c_profilefunc)
24360 retval = tstate->c_profilefunc(tstate->c_profileobj, *frame, PyTrace_CALL, NULL) == 0;
24361 __Pyx_LeaveTracing(tstate);
24363 __Pyx_ErrRestoreInState(tstate, type, value, traceback);
24364 return __Pyx_IsTracing(tstate, 0, 0) && retval;
24368 Py_XDECREF(traceback);
24372 static PyCodeObject *__Pyx_createFrameCodeObject(
const char *funcname,
const char *srcfile,
int firstlineno) {
24373 PyCodeObject *py_code = 0;
24374 #if PY_MAJOR_VERSION >= 3
24375 py_code = PyCode_NewEmpty(srcfile, funcname, firstlineno);
24376 if (likely(py_code)) {
24377 py_code->co_flags |= CO_OPTIMIZED | CO_NEWLOCALS;
24380 PyObject *py_srcfile = 0;
24381 PyObject *py_funcname = 0;
24382 py_funcname = PyString_FromString(funcname);
24383 if (unlikely(!py_funcname))
goto bad;
24384 py_srcfile = PyString_FromString(srcfile);
24385 if (unlikely(!py_srcfile))
goto bad;
24386 py_code = PyCode_New(
24390 CO_OPTIMIZED | CO_NEWLOCALS,
24403 Py_XDECREF(py_srcfile);
24404 Py_XDECREF(py_funcname);
24411 static PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j) {
24413 if (!j)
return NULL;
24414 r = PyObject_GetItem(o, j);
24418 static CYTHON_INLINE PyObject *__Pyx_GetItemInt_List_Fast(PyObject *o, Py_ssize_t i,
24419 CYTHON_NCP_UNUSED
int wraparound,
24420 CYTHON_NCP_UNUSED
int boundscheck) {
24421 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
24422 Py_ssize_t wrapped_i = i;
24423 if (wraparound & unlikely(i < 0)) {
24424 wrapped_i += PyList_GET_SIZE(o);
24426 if ((!boundscheck) || likely(__Pyx_is_valid_index(wrapped_i, PyList_GET_SIZE(o)))) {
24427 PyObject *
r = PyList_GET_ITEM(o, wrapped_i);
24431 return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i));
24433 return PySequence_GetItem(o, i);
24436 static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize_t i,
24437 CYTHON_NCP_UNUSED
int wraparound,
24438 CYTHON_NCP_UNUSED
int boundscheck) {
24439 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
24440 Py_ssize_t wrapped_i = i;
24441 if (wraparound & unlikely(i < 0)) {
24442 wrapped_i += PyTuple_GET_SIZE(o);
24444 if ((!boundscheck) || likely(__Pyx_is_valid_index(wrapped_i, PyTuple_GET_SIZE(o)))) {
24445 PyObject *
r = PyTuple_GET_ITEM(o, wrapped_i);
24449 return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i));
24451 return PySequence_GetItem(o, i);
24454 static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i,
int is_list,
24455 CYTHON_NCP_UNUSED
int wraparound,
24456 CYTHON_NCP_UNUSED
int boundscheck) {
24457 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS && CYTHON_USE_TYPE_SLOTS
24458 if (is_list || PyList_CheckExact(o)) {
24459 Py_ssize_t
n = ((!wraparound) | likely(i >= 0)) ? i : i + PyList_GET_SIZE(o);
24460 if ((!boundscheck) || (likely(__Pyx_is_valid_index(
n, PyList_GET_SIZE(o))))) {
24461 PyObject *
r = PyList_GET_ITEM(o,
n);
24466 else if (PyTuple_CheckExact(o)) {
24467 Py_ssize_t
n = ((!wraparound) | likely(i >= 0)) ? i : i + PyTuple_GET_SIZE(o);
24468 if ((!boundscheck) || likely(__Pyx_is_valid_index(
n, PyTuple_GET_SIZE(o)))) {
24469 PyObject *
r = PyTuple_GET_ITEM(o,
n);
24474 PySequenceMethods *m = Py_TYPE(o)->tp_as_sequence;
24475 if (likely(m && m->sq_item)) {
24476 if (wraparound && unlikely(i < 0) && likely(m->sq_length)) {
24477 Py_ssize_t l = m->sq_length(o);
24478 if (likely(l >= 0)) {
24481 if (!PyErr_ExceptionMatches(PyExc_OverflowError))
24486 return m->sq_item(o, i);
24490 if (is_list || PySequence_Check(o)) {
24491 return PySequence_GetItem(o, i);
24494 return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i));
24498 #if CYTHON_USE_TYPE_SLOTS
24499 static PyObject *__Pyx_PyObject_GetIndex(PyObject *obj, PyObject* index) {
24501 Py_ssize_t key_value;
24502 PySequenceMethods *m = Py_TYPE(obj)->tp_as_sequence;
24503 if (unlikely(!(m && m->sq_item))) {
24504 PyErr_Format(PyExc_TypeError,
"'%.200s' object is not subscriptable", Py_TYPE(obj)->tp_name);
24507 key_value = __Pyx_PyIndex_AsSsize_t(index);
24508 if (likely(key_value != -1 || !(runerr = PyErr_Occurred()))) {
24509 return __Pyx_GetItemInt_Fast(obj, key_value, 0, 1, 1);
24511 if (PyErr_GivenExceptionMatches(runerr, PyExc_OverflowError)) {
24513 PyErr_Format(PyExc_IndexError,
"cannot fit '%.200s' into an index-sized integer", Py_TYPE(index)->tp_name);
24517 static PyObject *__Pyx_PyObject_GetItem(PyObject *obj, PyObject* key) {
24518 PyMappingMethods *m = Py_TYPE(obj)->tp_as_mapping;
24519 if (likely(m && m->mp_subscript)) {
24520 return m->mp_subscript(obj, key);
24522 return __Pyx_PyObject_GetIndex(obj, key);
24528 __Pyx_init_memviewslice(
struct __pyx_memoryview_obj *memview,
24530 __Pyx_memviewslice *memviewslice,
24531 int memview_is_new_reference)
24533 __Pyx_RefNannyDeclarations
24535 Py_buffer *buf = &memview->view;
24536 __Pyx_RefNannySetupContext(
"init_memviewslice", 0);
24537 if (unlikely(memviewslice->memview || memviewslice->data)) {
24538 PyErr_SetString(PyExc_ValueError,
24539 "memviewslice is already initialized!");
24542 if (buf->strides) {
24543 for (i = 0; i < ndim; i++) {
24544 memviewslice->strides[i] = buf->strides[i];
24547 Py_ssize_t stride = buf->itemsize;
24548 for (i = ndim - 1; i >= 0; i--) {
24549 memviewslice->strides[i] = stride;
24550 stride *= buf->shape[i];
24553 for (i = 0; i < ndim; i++) {
24554 memviewslice->shape[i] = buf->shape[i];
24555 if (buf->suboffsets) {
24556 memviewslice->suboffsets[i] = buf->suboffsets[i];
24558 memviewslice->suboffsets[i] = -1;
24561 memviewslice->memview = memview;
24562 memviewslice->data = (
char *)buf->buf;
24563 if (__pyx_add_acquisition_count(memview) == 0 && !memview_is_new_reference) {
24564 Py_INCREF(memview);
24569 memviewslice->memview = 0;
24570 memviewslice->data = 0;
24573 __Pyx_RefNannyFinishContext();
24576 #ifndef Py_NO_RETURN
24577 #define Py_NO_RETURN
24579 static void __pyx_fatalerror(
const char *fmt, ...) Py_NO_RETURN {
24582 #ifdef HAVE_STDARG_PROTOTYPES
24583 va_start(vargs, fmt);
24587 vsnprintf(msg, 200, fmt, vargs);
24589 Py_FatalError(msg);
24591 static CYTHON_INLINE
int
24592 __pyx_add_acquisition_count_locked(__pyx_atomic_int *acquisition_count,
24593 PyThread_type_lock lock)
24596 PyThread_acquire_lock(lock, 1);
24597 result = (*acquisition_count)++;
24598 PyThread_release_lock(lock);
24601 static CYTHON_INLINE
int
24602 __pyx_sub_acquisition_count_locked(__pyx_atomic_int *acquisition_count,
24603 PyThread_type_lock lock)
24606 PyThread_acquire_lock(lock, 1);
24607 result = (*acquisition_count)--;
24608 PyThread_release_lock(lock);
24611 static CYTHON_INLINE
void
24612 __Pyx_INC_MEMVIEW(__Pyx_memviewslice *memslice,
int have_gil,
int lineno)
24615 struct __pyx_memoryview_obj *memview = memslice->memview;
24616 if (unlikely(!memview || (PyObject *) memview == Py_None))
24618 if (unlikely(__pyx_get_slice_count(memview) < 0))
24619 __pyx_fatalerror(
"Acquisition count is %d (line %d)",
24620 __pyx_get_slice_count(memview), lineno);
24621 first_time = __pyx_add_acquisition_count(memview) == 0;
24622 if (unlikely(first_time)) {
24624 Py_INCREF((PyObject *) memview);
24626 PyGILState_STATE _gilstate = PyGILState_Ensure();
24627 Py_INCREF((PyObject *) memview);
24628 PyGILState_Release(_gilstate);
24632 static CYTHON_INLINE
void __Pyx_XDEC_MEMVIEW(__Pyx_memviewslice *memslice,
24633 int have_gil,
int lineno) {
24635 struct __pyx_memoryview_obj *memview = memslice->memview;
24636 if (unlikely(!memview || (PyObject *) memview == Py_None)) {
24637 memslice->memview = NULL;
24640 if (unlikely(__pyx_get_slice_count(memview) <= 0))
24641 __pyx_fatalerror(
"Acquisition count is %d (line %d)",
24642 __pyx_get_slice_count(memview), lineno);
24643 last_time = __pyx_sub_acquisition_count(memview) == 1;
24644 memslice->data = NULL;
24645 if (unlikely(last_time)) {
24647 Py_CLEAR(memslice->memview);
24649 PyGILState_STATE _gilstate = PyGILState_Ensure();
24650 Py_CLEAR(memslice->memview);
24651 PyGILState_Release(_gilstate);
24654 memslice->memview = NULL;
24659 static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list,
int level) {
24660 PyObject *empty_list = 0;
24661 PyObject *module = 0;
24662 PyObject *global_dict = 0;
24663 PyObject *empty_dict = 0;
24665 #if PY_MAJOR_VERSION < 3
24666 PyObject *py_import;
24667 py_import = __Pyx_PyObject_GetAttrStr(__pyx_b, __pyx_n_s_import);
24674 empty_list = PyList_New(0);
24679 global_dict = PyModule_GetDict(__pyx_m);
24682 empty_dict = PyDict_New();
24686 #if PY_MAJOR_VERSION >= 3
24688 if ((1) && (strchr(__Pyx_MODULE_NAME,
'.'))) {
24689 module = PyImport_ImportModuleLevelObject(
24690 name, global_dict, empty_dict, list, 1);
24692 if (!PyErr_ExceptionMatches(PyExc_ImportError))
24701 #if PY_MAJOR_VERSION < 3
24702 PyObject *py_level = PyInt_FromLong(level);
24705 module = PyObject_CallFunctionObjArgs(py_import,
24706 name, global_dict, empty_dict, list, py_level, (PyObject *)NULL);
24707 Py_DECREF(py_level);
24709 module = PyImport_ImportModuleLevelObject(
24710 name, global_dict, empty_dict, list, level);
24715 #if PY_MAJOR_VERSION < 3
24716 Py_XDECREF(py_import);
24718 Py_XDECREF(empty_list);
24719 Py_XDECREF(empty_dict);
24724 static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name) {
24725 PyObject* value = __Pyx_PyObject_GetAttrStr(module, name);
24726 if (unlikely(!value) && PyErr_ExceptionMatches(PyExc_AttributeError)) {
24727 PyErr_Format(PyExc_ImportError,
24728 #
if PY_MAJOR_VERSION < 3
24729 "cannot import name %.230s", PyString_AS_STRING(name));
24731 "cannot import name %S", name);
24738 #if CYTHON_FAST_PYCALL
24739 static PyObject* __Pyx_PyFunction_FastCallNoKw(PyCodeObject *co, PyObject **args, Py_ssize_t na,
24740 PyObject *globals) {
24742 PyThreadState *tstate = __Pyx_PyThreadState_Current;
24743 PyObject **fastlocals;
24746 assert(globals != NULL);
24751 assert(tstate != NULL);
24752 f = PyFrame_New(tstate, co, globals, NULL);
24756 fastlocals = __Pyx_PyFrame_GetLocalsplus(
f);
24757 for (i = 0; i < na; i++) {
24759 fastlocals[i] = *args++;
24761 result = PyEval_EvalFrameEx(
f,0);
24762 ++tstate->recursion_depth;
24764 --tstate->recursion_depth;
24767 #if 1 || PY_VERSION_HEX < 0x030600B1
24768 static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args, Py_ssize_t nargs, PyObject *kwargs) {
24769 PyCodeObject *co = (PyCodeObject *)PyFunction_GET_CODE(func);
24770 PyObject *globals = PyFunction_GET_GLOBALS(func);
24771 PyObject *argdefs = PyFunction_GET_DEFAULTS(func);
24773 #if PY_MAJOR_VERSION >= 3
24776 PyObject *kwtuple, **k;
24781 assert(kwargs == NULL || PyDict_Check(kwargs));
24782 nk = kwargs ? PyDict_Size(kwargs) : 0;
24783 if (Py_EnterRecursiveCall((
char*)
" while calling a Python object")) {
24787 #
if PY_MAJOR_VERSION >= 3
24788 co->co_kwonlyargcount == 0 &&
24790 likely(kwargs == NULL || nk == 0) &&
24791 co->co_flags == (CO_OPTIMIZED | CO_NEWLOCALS | CO_NOFREE)) {
24792 if (argdefs == NULL && co->co_argcount == nargs) {
24793 result = __Pyx_PyFunction_FastCallNoKw(co, args, nargs, globals);
24796 else if (nargs == 0 && argdefs != NULL
24797 && co->co_argcount == Py_SIZE(argdefs)) {
24800 args = &PyTuple_GET_ITEM(argdefs, 0);
24801 result =__Pyx_PyFunction_FastCallNoKw(co, args, Py_SIZE(argdefs), globals);
24805 if (kwargs != NULL) {
24807 kwtuple = PyTuple_New(2 * nk);
24808 if (kwtuple == NULL) {
24812 k = &PyTuple_GET_ITEM(kwtuple, 0);
24814 while (PyDict_Next(kwargs, &
pos, &k[i], &k[i+1])) {
24825 closure = PyFunction_GET_CLOSURE(func);
24826 #if PY_MAJOR_VERSION >= 3
24827 kwdefs = PyFunction_GET_KW_DEFAULTS(func);
24829 if (argdefs != NULL) {
24830 d = &PyTuple_GET_ITEM(argdefs, 0);
24831 nd = Py_SIZE(argdefs);
24837 #if PY_MAJOR_VERSION >= 3
24838 result = PyEval_EvalCodeEx((PyObject*)co, globals, (PyObject *)NULL,
24841 d, (
int)nd, kwdefs, closure);
24843 result = PyEval_EvalCodeEx(co, globals, (PyObject *)NULL,
24846 d, (
int)nd, closure);
24848 Py_XDECREF(kwtuple);
24850 Py_LeaveRecursiveCall();
24857 #if CYTHON_COMPILING_IN_CPYTHON
24858 static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw) {
24860 ternaryfunc call = Py_TYPE(func)->tp_call;
24861 if (unlikely(!call))
24862 return PyObject_Call(func, arg, kw);
24863 if (unlikely(Py_EnterRecursiveCall((
char*)
" while calling a Python object")))
24865 result = (*call)(func, arg, kw);
24866 Py_LeaveRecursiveCall();
24867 if (unlikely(!result) && unlikely(!PyErr_Occurred())) {
24870 "NULL result without error in PyObject_Call");
24877 #if CYTHON_COMPILING_IN_CPYTHON
24878 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg) {
24879 PyObject *
self, *result;
24881 cfunc = PyCFunction_GET_FUNCTION(func);
24882 self = PyCFunction_GET_SELF(func);
24883 if (unlikely(Py_EnterRecursiveCall((
char*)
" while calling a Python object")))
24885 result = cfunc(
self, arg);
24886 Py_LeaveRecursiveCall();
24887 if (unlikely(!result) && unlikely(!PyErr_Occurred())) {
24890 "NULL result without error in PyObject_Call");
24897 #if CYTHON_COMPILING_IN_CPYTHON
24898 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallNoArg(PyObject *func) {
24899 #if CYTHON_FAST_PYCALL
24900 if (PyFunction_Check(func)) {
24901 return __Pyx_PyFunction_FastCall(func, NULL, 0);
24904 #ifdef __Pyx_CyFunction_USED
24905 if (likely(PyCFunction_Check(func) || __Pyx_CyFunction_Check(func)))
24907 if (likely(PyCFunction_Check(func)))
24910 if (likely(PyCFunction_GET_FLAGS(func) & METH_NOARGS)) {
24911 return __Pyx_PyObject_CallMethO(func, NULL);
24914 return __Pyx_PyObject_Call(func, __pyx_empty_tuple, NULL);
24919 #if CYTHON_FAST_PYCCALL
24920 static CYTHON_INLINE PyObject * __Pyx_PyCFunction_FastCall(PyObject *func_obj, PyObject **args, Py_ssize_t nargs) {
24921 PyCFunctionObject *func = (PyCFunctionObject*)func_obj;
24922 PyCFunction meth = PyCFunction_GET_FUNCTION(func);
24923 PyObject *
self = PyCFunction_GET_SELF(func);
24924 int flags = PyCFunction_GET_FLAGS(func);
24925 assert(PyCFunction_Check(func));
24926 assert(METH_FASTCALL == (flags & ~(METH_CLASS | METH_STATIC | METH_COEXIST | METH_KEYWORDS | METH_STACKLESS)));
24927 assert(nargs >= 0);
24928 assert(nargs == 0 || args != NULL);
24932 assert(!PyErr_Occurred());
24933 if ((PY_VERSION_HEX < 0x030700A0) || unlikely(flags & METH_KEYWORDS)) {
24934 return (*((__Pyx_PyCFunctionFastWithKeywords)(
void*)meth)) (
self, args, nargs, NULL);
24936 return (*((__Pyx_PyCFunctionFast)(
void*)meth)) (
self, args, nargs);
24942 #if CYTHON_COMPILING_IN_CPYTHON
24943 static PyObject* __Pyx__PyObject_CallOneArg(PyObject *func, PyObject *arg) {
24945 PyObject *args = PyTuple_New(1);
24946 if (unlikely(!args))
return NULL;
24948 PyTuple_SET_ITEM(args, 0, arg);
24949 result = __Pyx_PyObject_Call(func, args, NULL);
24953 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg) {
24954 #if CYTHON_FAST_PYCALL
24955 if (PyFunction_Check(func)) {
24956 return __Pyx_PyFunction_FastCall(func, &arg, 1);
24959 if (likely(PyCFunction_Check(func))) {
24960 if (likely(PyCFunction_GET_FLAGS(func) & METH_O)) {
24961 return __Pyx_PyObject_CallMethO(func, arg);
24962 #if CYTHON_FAST_PYCCALL
24963 }
else if (__Pyx_PyFastCFunction_Check(func)) {
24964 return __Pyx_PyCFunction_FastCall(func, &arg, 1);
24968 return __Pyx__PyObject_CallOneArg(func, arg);
24971 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg) {
24973 PyObject *args = PyTuple_Pack(1, arg);
24974 if (unlikely(!args))
return NULL;
24975 result = __Pyx_PyObject_Call(func, args, NULL);
24982 #if CYTHON_FAST_THREAD_STATE
24983 static int __Pyx_PyErr_ExceptionMatchesTuple(PyObject *exc_type, PyObject *tuple) {
24985 n = PyTuple_GET_SIZE(tuple);
24986 #if PY_MAJOR_VERSION >= 3
24987 for (i=0; i<
n; i++) {
24988 if (exc_type == PyTuple_GET_ITEM(tuple, i))
return 1;
24991 for (i=0; i<
n; i++) {
24992 if (__Pyx_PyErr_GivenExceptionMatches(exc_type, PyTuple_GET_ITEM(tuple, i)))
return 1;
24996 static CYTHON_INLINE
int __Pyx_PyErr_ExceptionMatchesInState(PyThreadState* tstate, PyObject* err) {
24997 PyObject *exc_type = tstate->curexc_type;
24998 if (exc_type == err)
return 1;
24999 if (unlikely(!exc_type))
return 0;
25000 if (unlikely(PyTuple_Check(err)))
25001 return __Pyx_PyErr_ExceptionMatchesTuple(exc_type, err);
25002 return __Pyx_PyErr_GivenExceptionMatches(exc_type, err);
25007 static CYTHON_INLINE PyObject *__Pyx_GetAttr(PyObject *o, PyObject *
n) {
25008 #if CYTHON_USE_TYPE_SLOTS
25009 #if PY_MAJOR_VERSION >= 3
25010 if (likely(PyUnicode_Check(
n)))
25012 if (likely(PyString_Check(
n)))
25014 return __Pyx_PyObject_GetAttrStr(o,
n);
25016 return PyObject_GetAttr(o,
n);
25020 static PyObject *__Pyx_GetAttr3Default(PyObject *d) {
25021 __Pyx_PyThreadState_declare
25022 __Pyx_PyThreadState_assign
25023 if (unlikely(!__Pyx_PyErr_ExceptionMatches(PyExc_AttributeError)))
25025 __Pyx_PyErr_Clear();
25029 static CYTHON_INLINE PyObject *__Pyx_GetAttr3(PyObject *o, PyObject *
n, PyObject *d) {
25030 PyObject *
r = __Pyx_GetAttr(o,
n);
25031 return (likely(
r)) ?
r : __Pyx_GetAttr3Default(d);
25035 #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_TYPE_SLOTS
25036 static CYTHON_INLINE PY_UINT64_T __Pyx_get_tp_dict_version(PyObject *obj) {
25037 PyObject *dict = Py_TYPE(obj)->tp_dict;
25038 return likely(dict) ? __PYX_GET_DICT_VERSION(dict) : 0;
25040 static CYTHON_INLINE PY_UINT64_T __Pyx_get_object_dict_version(PyObject *obj) {
25041 PyObject **dictptr = NULL;
25042 Py_ssize_t offset = Py_TYPE(obj)->tp_dictoffset;
25044 #if CYTHON_COMPILING_IN_CPYTHON
25045 dictptr = (likely(offset > 0)) ? (PyObject **) ((
char *)obj + offset) : _PyObject_GetDictPtr(obj);
25047 dictptr = _PyObject_GetDictPtr(obj);
25050 return (dictptr && *dictptr) ? __PYX_GET_DICT_VERSION(*dictptr) : 0;
25052 static CYTHON_INLINE
int __Pyx_object_dict_version_matches(PyObject* obj, PY_UINT64_T tp_dict_version, PY_UINT64_T obj_dict_version) {
25053 PyObject *dict = Py_TYPE(obj)->tp_dict;
25054 if (unlikely(!dict) || unlikely(tp_dict_version != __PYX_GET_DICT_VERSION(dict)))
25056 return obj_dict_version == __Pyx_get_object_dict_version(obj);
25061 #if CYTHON_USE_DICT_VERSIONS
25062 static PyObject *__Pyx__GetModuleGlobalName(PyObject *name, PY_UINT64_T *dict_version, PyObject **dict_cached_value)
25064 static CYTHON_INLINE PyObject *__Pyx__GetModuleGlobalName(PyObject *name)
25068 #if !CYTHON_AVOID_BORROWED_REFS
25069 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030500A1
25070 result = _PyDict_GetItem_KnownHash(__pyx_d, name, ((PyASCIIObject *) name)->hash);
25071 __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version)
25072 if (likely(result)) {
25073 return __Pyx_NewRef(result);
25074 }
else if (unlikely(PyErr_Occurred())) {
25078 result = PyDict_GetItem(__pyx_d, name);
25079 __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version)
25080 if (likely(result)) {
25081 return __Pyx_NewRef(result);
25085 result = PyObject_GetItem(__pyx_d, name);
25086 __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version)
25087 if (likely(result)) {
25088 return __Pyx_NewRef(result);
25092 return __Pyx_GetBuiltinName(name);
25096 static int __Pyx_CheckKeywordStrings(
25098 const char* function_name,
25102 Py_ssize_t
pos = 0;
25103 #if CYTHON_COMPILING_IN_PYPY
25104 if (!kw_allowed && PyDict_Next(kwdict, &
pos, &key, 0))
25105 goto invalid_keyword;
25108 while (PyDict_Next(kwdict, &
pos, &key, 0)) {
25109 #if PY_MAJOR_VERSION < 3
25110 if (unlikely(!PyString_Check(key)))
25112 if (unlikely(!PyUnicode_Check(key)))
25113 goto invalid_keyword_type;
25115 if ((!kw_allowed) && unlikely(key))
25116 goto invalid_keyword;
25118 invalid_keyword_type:
25119 PyErr_Format(PyExc_TypeError,
25120 "%.200s() keywords must be strings", function_name);
25124 PyErr_Format(PyExc_TypeError,
25125 #
if PY_MAJOR_VERSION < 3
25126 "%.200s() got an unexpected keyword argument '%.200s'",
25127 function_name, PyString_AsString(key));
25129 "%s() got an unexpected keyword argument '%U'",
25130 function_name, key);
25136 static void __Pyx_WriteUnraisable(
const char *name, CYTHON_UNUSED
int clineno,
25137 CYTHON_UNUSED
int lineno, CYTHON_UNUSED
const char *filename,
25138 int full_traceback, CYTHON_UNUSED
int nogil) {
25139 PyObject *old_exc, *old_val, *old_tb;
25141 __Pyx_PyThreadState_declare
25143 PyGILState_STATE state;
25145 state = PyGILState_Ensure();
25147 else state = (PyGILState_STATE)-1;
25150 __Pyx_PyThreadState_assign
25151 __Pyx_ErrFetch(&old_exc, &old_val, &old_tb);
25152 if (full_traceback) {
25153 Py_XINCREF(old_exc);
25154 Py_XINCREF(old_val);
25155 Py_XINCREF(old_tb);
25156 __Pyx_ErrRestore(old_exc, old_val, old_tb);
25159 #if PY_MAJOR_VERSION < 3
25160 ctx = PyString_FromString(name);
25162 ctx = PyUnicode_FromString(name);
25164 __Pyx_ErrRestore(old_exc, old_val, old_tb);
25166 PyErr_WriteUnraisable(Py_None);
25168 PyErr_WriteUnraisable(ctx);
25173 PyGILState_Release(state);
25178 static CYTHON_INLINE
void __Pyx_RaiseClosureNameError(
const char *varname) {
25179 PyErr_Format(PyExc_NameError,
"free variable '%s' referenced before assignment in enclosing scope", varname);
25183 static PyTypeObject* __Pyx_FetchCommonType(PyTypeObject* type) {
25184 PyObject* fake_module;
25185 PyTypeObject* cached_type = NULL;
25186 fake_module = PyImport_AddModule((
char*)
"_cython_" CYTHON_ABI);
25187 if (!fake_module)
return NULL;
25188 Py_INCREF(fake_module);
25189 cached_type = (PyTypeObject*) PyObject_GetAttrString(fake_module, type->tp_name);
25191 if (!PyType_Check((PyObject*)cached_type)) {
25192 PyErr_Format(PyExc_TypeError,
25193 "Shared Cython type %.200s is not a type object",
25197 if (cached_type->tp_basicsize != type->tp_basicsize) {
25198 PyErr_Format(PyExc_TypeError,
25199 "Shared Cython type %.200s has the wrong size, try recompiling",
25204 if (!PyErr_ExceptionMatches(PyExc_AttributeError))
goto bad;
25206 if (PyType_Ready(type) < 0)
goto bad;
25207 if (PyObject_SetAttrString(fake_module, type->tp_name, (PyObject*) type) < 0)
25210 cached_type = type;
25213 Py_DECREF(fake_module);
25214 return cached_type;
25216 Py_XDECREF(cached_type);
25217 cached_type = NULL;
25222 #include <structmember.h>
25224 __Pyx_CyFunction_get_doc(__pyx_CyFunctionObject *op, CYTHON_UNUSED
void *closure)
25226 if (unlikely(op->func_doc == NULL)) {
25227 if (op->func.m_ml->ml_doc) {
25228 #if PY_MAJOR_VERSION >= 3
25229 op->func_doc = PyUnicode_FromString(op->func.m_ml->ml_doc);
25231 op->func_doc = PyString_FromString(op->func.m_ml->ml_doc);
25233 if (unlikely(op->func_doc == NULL))
25236 Py_INCREF(Py_None);
25240 Py_INCREF(op->func_doc);
25241 return op->func_doc;
25244 __Pyx_CyFunction_set_doc(__pyx_CyFunctionObject *op, PyObject *value, CYTHON_UNUSED
void *context)
25246 PyObject *tmp = op->func_doc;
25247 if (value == NULL) {
25251 op->func_doc = value;
25256 __Pyx_CyFunction_get_name(__pyx_CyFunctionObject *op, CYTHON_UNUSED
void *context)
25258 if (unlikely(op->func_name == NULL)) {
25259 #if PY_MAJOR_VERSION >= 3
25260 op->func_name = PyUnicode_InternFromString(op->func.m_ml->ml_name);
25262 op->func_name = PyString_InternFromString(op->func.m_ml->ml_name);
25264 if (unlikely(op->func_name == NULL))
25267 Py_INCREF(op->func_name);
25268 return op->func_name;
25271 __Pyx_CyFunction_set_name(__pyx_CyFunctionObject *op, PyObject *value, CYTHON_UNUSED
void *context)
25274 #if PY_MAJOR_VERSION >= 3
25275 if (unlikely(value == NULL || !PyUnicode_Check(value)))
25277 if (unlikely(value == NULL || !PyString_Check(value)))
25280 PyErr_SetString(PyExc_TypeError,
25281 "__name__ must be set to a string object");
25284 tmp = op->func_name;
25286 op->func_name = value;
25291 __Pyx_CyFunction_get_qualname(__pyx_CyFunctionObject *op, CYTHON_UNUSED
void *context)
25293 Py_INCREF(op->func_qualname);
25294 return op->func_qualname;
25297 __Pyx_CyFunction_set_qualname(__pyx_CyFunctionObject *op, PyObject *value, CYTHON_UNUSED
void *context)
25300 #if PY_MAJOR_VERSION >= 3
25301 if (unlikely(value == NULL || !PyUnicode_Check(value)))
25303 if (unlikely(value == NULL || !PyString_Check(value)))
25306 PyErr_SetString(PyExc_TypeError,
25307 "__qualname__ must be set to a string object");
25310 tmp = op->func_qualname;
25312 op->func_qualname = value;
25317 __Pyx_CyFunction_get_self(__pyx_CyFunctionObject *m, CYTHON_UNUSED
void *closure)
25320 self = m->func_closure;
25327 __Pyx_CyFunction_get_dict(__pyx_CyFunctionObject *op, CYTHON_UNUSED
void *context)
25329 if (unlikely(op->func_dict == NULL)) {
25330 op->func_dict = PyDict_New();
25331 if (unlikely(op->func_dict == NULL))
25334 Py_INCREF(op->func_dict);
25335 return op->func_dict;
25338 __Pyx_CyFunction_set_dict(__pyx_CyFunctionObject *op, PyObject *value, CYTHON_UNUSED
void *context)
25341 if (unlikely(value == NULL)) {
25342 PyErr_SetString(PyExc_TypeError,
25343 "function's dictionary may not be deleted");
25346 if (unlikely(!PyDict_Check(value))) {
25347 PyErr_SetString(PyExc_TypeError,
25348 "setting function's dictionary to a non-dict");
25351 tmp = op->func_dict;
25353 op->func_dict = value;
25358 __Pyx_CyFunction_get_globals(__pyx_CyFunctionObject *op, CYTHON_UNUSED
void *context)
25360 Py_INCREF(op->func_globals);
25361 return op->func_globals;
25364 __Pyx_CyFunction_get_closure(CYTHON_UNUSED __pyx_CyFunctionObject *op, CYTHON_UNUSED
void *context)
25366 Py_INCREF(Py_None);
25370 __Pyx_CyFunction_get_code(__pyx_CyFunctionObject *op, CYTHON_UNUSED
void *context)
25372 PyObject* result = (op->func_code) ? op->func_code : Py_None;
25377 __Pyx_CyFunction_init_defaults(__pyx_CyFunctionObject *op) {
25379 PyObject *res = op->defaults_getter((PyObject *) op);
25380 if (unlikely(!res))
25382 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
25383 op->defaults_tuple = PyTuple_GET_ITEM(res, 0);
25384 Py_INCREF(op->defaults_tuple);
25385 op->defaults_kwdict = PyTuple_GET_ITEM(res, 1);
25386 Py_INCREF(op->defaults_kwdict);
25388 op->defaults_tuple = PySequence_ITEM(res, 0);
25389 if (unlikely(!op->defaults_tuple)) result = -1;
25391 op->defaults_kwdict = PySequence_ITEM(res, 1);
25392 if (unlikely(!op->defaults_kwdict)) result = -1;
25399 __Pyx_CyFunction_set_defaults(__pyx_CyFunctionObject *op, PyObject* value, CYTHON_UNUSED
void *context) {
25403 }
else if (value != Py_None && !PyTuple_Check(value)) {
25404 PyErr_SetString(PyExc_TypeError,
25405 "__defaults__ must be set to a tuple object");
25409 tmp = op->defaults_tuple;
25410 op->defaults_tuple = value;
25415 __Pyx_CyFunction_get_defaults(__pyx_CyFunctionObject *op, CYTHON_UNUSED
void *context) {
25416 PyObject* result = op->defaults_tuple;
25417 if (unlikely(!result)) {
25418 if (op->defaults_getter) {
25419 if (__Pyx_CyFunction_init_defaults(op) < 0)
return NULL;
25420 result = op->defaults_tuple;
25429 __Pyx_CyFunction_set_kwdefaults(__pyx_CyFunctionObject *op, PyObject* value, CYTHON_UNUSED
void *context) {
25433 }
else if (value != Py_None && !PyDict_Check(value)) {
25434 PyErr_SetString(PyExc_TypeError,
25435 "__kwdefaults__ must be set to a dict object");
25439 tmp = op->defaults_kwdict;
25440 op->defaults_kwdict = value;
25445 __Pyx_CyFunction_get_kwdefaults(__pyx_CyFunctionObject *op, CYTHON_UNUSED
void *context) {
25446 PyObject* result = op->defaults_kwdict;
25447 if (unlikely(!result)) {
25448 if (op->defaults_getter) {
25449 if (__Pyx_CyFunction_init_defaults(op) < 0)
return NULL;
25450 result = op->defaults_kwdict;
25459 __Pyx_CyFunction_set_annotations(__pyx_CyFunctionObject *op, PyObject* value, CYTHON_UNUSED
void *context) {
25461 if (!value || value == Py_None) {
25463 }
else if (!PyDict_Check(value)) {
25464 PyErr_SetString(PyExc_TypeError,
25465 "__annotations__ must be set to a dict object");
25469 tmp = op->func_annotations;
25470 op->func_annotations = value;
25475 __Pyx_CyFunction_get_annotations(__pyx_CyFunctionObject *op, CYTHON_UNUSED
void *context) {
25476 PyObject* result = op->func_annotations;
25477 if (unlikely(!result)) {
25478 result = PyDict_New();
25479 if (unlikely(!result))
return NULL;
25480 op->func_annotations = result;
25485 static PyGetSetDef __pyx_CyFunction_getsets[] = {
25486 {(
char *)
"func_doc", (getter)__Pyx_CyFunction_get_doc, (setter)__Pyx_CyFunction_set_doc, 0, 0},
25487 {(
char *)
"__doc__", (getter)__Pyx_CyFunction_get_doc, (setter)__Pyx_CyFunction_set_doc, 0, 0},
25488 {(
char *)
"func_name", (getter)__Pyx_CyFunction_get_name, (setter)__Pyx_CyFunction_set_name, 0, 0},
25489 {(
char *)
"__name__", (getter)__Pyx_CyFunction_get_name, (setter)__Pyx_CyFunction_set_name, 0, 0},
25490 {(
char *)
"__qualname__", (getter)__Pyx_CyFunction_get_qualname, (setter)__Pyx_CyFunction_set_qualname, 0, 0},
25491 {(
char *)
"__self__", (getter)__Pyx_CyFunction_get_self, 0, 0, 0},
25492 {(
char *)
"func_dict", (getter)__Pyx_CyFunction_get_dict, (setter)__Pyx_CyFunction_set_dict, 0, 0},
25493 {(
char *)
"__dict__", (getter)__Pyx_CyFunction_get_dict, (setter)__Pyx_CyFunction_set_dict, 0, 0},
25494 {(
char *)
"func_globals", (getter)__Pyx_CyFunction_get_globals, 0, 0, 0},
25495 {(
char *)
"__globals__", (getter)__Pyx_CyFunction_get_globals, 0, 0, 0},
25496 {(
char *)
"func_closure", (getter)__Pyx_CyFunction_get_closure, 0, 0, 0},
25497 {(
char *)
"__closure__", (getter)__Pyx_CyFunction_get_closure, 0, 0, 0},
25498 {(
char *)
"func_code", (getter)__Pyx_CyFunction_get_code, 0, 0, 0},
25499 {(
char *)
"__code__", (getter)__Pyx_CyFunction_get_code, 0, 0, 0},
25500 {(
char *)
"func_defaults", (getter)__Pyx_CyFunction_get_defaults, (setter)__Pyx_CyFunction_set_defaults, 0, 0},
25501 {(
char *)
"__defaults__", (getter)__Pyx_CyFunction_get_defaults, (setter)__Pyx_CyFunction_set_defaults, 0, 0},
25502 {(
char *)
"__kwdefaults__", (getter)__Pyx_CyFunction_get_kwdefaults, (setter)__Pyx_CyFunction_set_kwdefaults, 0, 0},
25503 {(
char *)
"__annotations__", (getter)__Pyx_CyFunction_get_annotations, (setter)__Pyx_CyFunction_set_annotations, 0, 0},
25506 static PyMemberDef __pyx_CyFunction_members[] = {
25507 {(
char *)
"__module__", T_OBJECT, offsetof(PyCFunctionObject, m_module), PY_WRITE_RESTRICTED, 0},
25511 __Pyx_CyFunction_reduce(__pyx_CyFunctionObject *m, CYTHON_UNUSED PyObject *args)
25513 #if PY_MAJOR_VERSION >= 3
25514 Py_INCREF(m->func_qualname);
25515 return m->func_qualname;
25517 return PyString_FromString(m->func.m_ml->ml_name);
25520 static PyMethodDef __pyx_CyFunction_methods[] = {
25521 {
"__reduce__", (PyCFunction)__Pyx_CyFunction_reduce, METH_VARARGS, 0},
25524 #if PY_VERSION_HEX < 0x030500A0
25525 #define __Pyx_CyFunction_weakreflist(cyfunc) ((cyfunc)->func_weakreflist)
25527 #define __Pyx_CyFunction_weakreflist(cyfunc) ((cyfunc)->func.m_weakreflist)
25529 static PyObject *__Pyx_CyFunction_Init(__pyx_CyFunctionObject *op, PyMethodDef *ml,
int flags, PyObject* qualname,
25530 PyObject *closure, PyObject *module, PyObject* globals, PyObject* code) {
25531 if (unlikely(op == NULL))
25534 __Pyx_CyFunction_weakreflist(op) = NULL;
25535 op->func.m_ml = ml;
25536 op->func.m_self = (PyObject *) op;
25537 Py_XINCREF(closure);
25538 op->func_closure = closure;
25539 Py_XINCREF(module);
25540 op->func.m_module = module;
25541 op->func_dict = NULL;
25542 op->func_name = NULL;
25543 Py_INCREF(qualname);
25544 op->func_qualname = qualname;
25545 op->func_doc = NULL;
25546 op->func_classobj = NULL;
25547 op->func_globals = globals;
25548 Py_INCREF(op->func_globals);
25550 op->func_code = code;
25551 op->defaults_pyobjects = 0;
25552 op->defaults_size = 0;
25553 op->defaults = NULL;
25554 op->defaults_tuple = NULL;
25555 op->defaults_kwdict = NULL;
25556 op->defaults_getter = NULL;
25557 op->func_annotations = NULL;
25558 return (PyObject *) op;
25561 __Pyx_CyFunction_clear(__pyx_CyFunctionObject *m)
25563 Py_CLEAR(m->func_closure);
25564 Py_CLEAR(m->func.m_module);
25565 Py_CLEAR(m->func_dict);
25566 Py_CLEAR(m->func_name);
25567 Py_CLEAR(m->func_qualname);
25568 Py_CLEAR(m->func_doc);
25569 Py_CLEAR(m->func_globals);
25570 Py_CLEAR(m->func_code);
25571 Py_CLEAR(m->func_classobj);
25572 Py_CLEAR(m->defaults_tuple);
25573 Py_CLEAR(m->defaults_kwdict);
25574 Py_CLEAR(m->func_annotations);
25576 PyObject **pydefaults = __Pyx_CyFunction_Defaults(PyObject *, m);
25578 for (i = 0; i < m->defaults_pyobjects; i++)
25579 Py_XDECREF(pydefaults[i]);
25580 PyObject_Free(m->defaults);
25581 m->defaults = NULL;
25585 static void __Pyx__CyFunction_dealloc(__pyx_CyFunctionObject *m)
25587 if (__Pyx_CyFunction_weakreflist(m) != NULL)
25588 PyObject_ClearWeakRefs((PyObject *) m);
25589 __Pyx_CyFunction_clear(m);
25590 PyObject_GC_Del(m);
25592 static void __Pyx_CyFunction_dealloc(__pyx_CyFunctionObject *m)
25594 PyObject_GC_UnTrack(m);
25595 __Pyx__CyFunction_dealloc(m);
25597 static int __Pyx_CyFunction_traverse(__pyx_CyFunctionObject *m, visitproc visit,
void *arg)
25599 Py_VISIT(m->func_closure);
25600 Py_VISIT(m->func.m_module);
25601 Py_VISIT(m->func_dict);
25602 Py_VISIT(m->func_name);
25603 Py_VISIT(m->func_qualname);
25604 Py_VISIT(m->func_doc);
25605 Py_VISIT(m->func_globals);
25606 Py_VISIT(m->func_code);
25607 Py_VISIT(m->func_classobj);
25608 Py_VISIT(m->defaults_tuple);
25609 Py_VISIT(m->defaults_kwdict);
25611 PyObject **pydefaults = __Pyx_CyFunction_Defaults(PyObject *, m);
25613 for (i = 0; i < m->defaults_pyobjects; i++)
25614 Py_VISIT(pydefaults[i]);
25618 static PyObject *__Pyx_CyFunction_descr_get(PyObject *func, PyObject *obj, PyObject *type)
25620 #if PY_MAJOR_VERSION < 3
25621 __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func;
25622 if (m->flags & __Pyx_CYFUNCTION_STATICMETHOD) {
25626 if (m->flags & __Pyx_CYFUNCTION_CLASSMETHOD) {
25628 type = (PyObject *)(Py_TYPE(obj));
25629 return __Pyx_PyMethod_New(func, type, (PyObject *)(Py_TYPE(type)));
25631 if (obj == Py_None)
25634 return __Pyx_PyMethod_New(func, obj, type);
25637 __Pyx_CyFunction_repr(__pyx_CyFunctionObject *op)
25639 #if PY_MAJOR_VERSION >= 3
25640 return PyUnicode_FromFormat(
"<cyfunction %U at %p>",
25641 op->func_qualname, (
void *)op);
25643 return PyString_FromFormat(
"<cyfunction %s at %p>",
25644 PyString_AsString(op->func_qualname), (
void *)op);
25647 static PyObject * __Pyx_CyFunction_CallMethod(PyObject *func, PyObject *
self, PyObject *arg, PyObject *kw) {
25648 PyCFunctionObject*
f = (PyCFunctionObject*)func;
25649 PyCFunction meth =
f->m_ml->ml_meth;
25651 switch (
f->m_ml->ml_flags & (METH_VARARGS | METH_KEYWORDS | METH_NOARGS | METH_O)) {
25653 if (likely(kw == NULL || PyDict_Size(kw) == 0))
25654 return (*meth)(
self, arg);
25656 case METH_VARARGS | METH_KEYWORDS:
25657 return (*(PyCFunctionWithKeywords)(
void*)meth)(
self, arg, kw);
25659 if (likely(kw == NULL || PyDict_Size(kw) == 0)) {
25660 size = PyTuple_GET_SIZE(arg);
25661 if (likely(size == 0))
25662 return (*meth)(
self, NULL);
25663 PyErr_Format(PyExc_TypeError,
25664 "%.200s() takes no arguments (%" CYTHON_FORMAT_SSIZE_T
"d given)",
25665 f->m_ml->ml_name, size);
25670 if (likely(kw == NULL || PyDict_Size(kw) == 0)) {
25671 size = PyTuple_GET_SIZE(arg);
25672 if (likely(size == 1)) {
25673 PyObject *result, *arg0;
25674 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
25675 arg0 = PyTuple_GET_ITEM(arg, 0);
25677 arg0 = PySequence_ITEM(arg, 0);
if (unlikely(!arg0))
return NULL;
25679 result = (*meth)(
self, arg0);
25680 #if !(CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS)
25685 PyErr_Format(PyExc_TypeError,
25686 "%.200s() takes exactly one argument (%" CYTHON_FORMAT_SSIZE_T
"d given)",
25687 f->m_ml->ml_name, size);
25692 PyErr_SetString(PyExc_SystemError,
"Bad call flags in "
25693 "__Pyx_CyFunction_Call. METH_OLDARGS is no "
25694 "longer supported!");
25697 PyErr_Format(PyExc_TypeError,
"%.200s() takes no keyword arguments",
25701 static CYTHON_INLINE PyObject *__Pyx_CyFunction_Call(PyObject *func, PyObject *arg, PyObject *kw) {
25702 return __Pyx_CyFunction_CallMethod(func, ((PyCFunctionObject*)func)->m_self, arg, kw);
25704 static PyObject *__Pyx_CyFunction_CallAsMethod(PyObject *func, PyObject *args, PyObject *kw) {
25706 __pyx_CyFunctionObject *cyfunc = (__pyx_CyFunctionObject *) func;
25707 if ((cyfunc->flags & __Pyx_CYFUNCTION_CCLASS) && !(cyfunc->flags & __Pyx_CYFUNCTION_STATICMETHOD)) {
25709 PyObject *new_args;
25711 argc = PyTuple_GET_SIZE(args);
25712 new_args = PyTuple_GetSlice(args, 1, argc);
25713 if (unlikely(!new_args))
25715 self = PyTuple_GetItem(args, 0);
25716 if (unlikely(!
self)) {
25717 Py_DECREF(new_args);
25718 PyErr_Format(PyExc_TypeError,
25719 "unbound method %.200S() needs an argument",
25720 cyfunc->func_qualname);
25723 result = __Pyx_CyFunction_CallMethod(func,
self, new_args, kw);
25724 Py_DECREF(new_args);
25726 result = __Pyx_CyFunction_Call(func, args, kw);
25730 static PyTypeObject __pyx_CyFunctionType_type = {
25731 PyVarObject_HEAD_INIT(0, 0)
25732 "cython_function_or_method",
25733 sizeof(__pyx_CyFunctionObject),
25735 (destructor) __Pyx_CyFunction_dealloc,
25739 #if PY_MAJOR_VERSION < 3
25744 (reprfunc) __Pyx_CyFunction_repr,
25749 __Pyx_CyFunction_CallAsMethod,
25754 Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC,
25756 (traverseproc) __Pyx_CyFunction_traverse,
25757 (inquiry) __Pyx_CyFunction_clear,
25759 #
if PY_VERSION_HEX < 0x030500A0
25760 offsetof(__pyx_CyFunctionObject, func_weakreflist),
25762 offsetof(PyCFunctionObject, m_weakreflist),
25766 __pyx_CyFunction_methods,
25767 __pyx_CyFunction_members,
25768 __pyx_CyFunction_getsets,
25771 __Pyx_CyFunction_descr_get,
25773 offsetof(__pyx_CyFunctionObject, func_dict),
25786 #if PY_VERSION_HEX >= 0x030400a1
25789 #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800)
25792 #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
25795 #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000
25799 static int __pyx_CyFunction_init(
void) {
25800 __pyx_CyFunctionType = __Pyx_FetchCommonType(&__pyx_CyFunctionType_type);
25801 if (unlikely(__pyx_CyFunctionType == NULL)) {
25806 static CYTHON_INLINE
void *__Pyx_CyFunction_InitDefaults(PyObject *func,
size_t size,
int pyobjects) {
25807 __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func;
25808 m->defaults = PyObject_Malloc(size);
25809 if (unlikely(!m->defaults))
25810 return PyErr_NoMemory();
25811 memset(m->defaults, 0, size);
25812 m->defaults_pyobjects = pyobjects;
25813 m->defaults_size = size;
25814 return m->defaults;
25816 static CYTHON_INLINE
void __Pyx_CyFunction_SetDefaultsTuple(PyObject *func, PyObject *tuple) {
25817 __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func;
25818 m->defaults_tuple = tuple;
25821 static CYTHON_INLINE
void __Pyx_CyFunction_SetDefaultsKwDict(PyObject *func, PyObject *dict) {
25822 __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func;
25823 m->defaults_kwdict = dict;
25826 static CYTHON_INLINE
void __Pyx_CyFunction_SetAnnotationsDict(PyObject *func, PyObject *dict) {
25827 __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func;
25828 m->func_annotations = dict;
25833 static PyObject *__Pyx_CyFunction_New(PyMethodDef *ml,
int flags, PyObject* qualname,
25834 PyObject *closure, PyObject *module, PyObject* globals, PyObject* code) {
25835 PyObject *op = __Pyx_CyFunction_Init(
25836 PyObject_GC_New(__pyx_CyFunctionObject, __pyx_CyFunctionType),
25837 ml, flags, qualname, closure, module, globals, code
25840 PyObject_GC_Track(op);
25846 static CYTHON_UNUSED PyObject* __Pyx_PyObject_Call2Args(PyObject*
function, PyObject* arg1, PyObject* arg2) {
25847 PyObject *args, *result = NULL;
25848 #if CYTHON_FAST_PYCALL
25849 if (PyFunction_Check(
function)) {
25850 PyObject *args[2] = {arg1, arg2};
25851 return __Pyx_PyFunction_FastCall(
function, args, 2);
25854 #if CYTHON_FAST_PYCCALL
25855 if (__Pyx_PyFastCFunction_Check(
function)) {
25856 PyObject *args[2] = {arg1, arg2};
25857 return __Pyx_PyCFunction_FastCall(
function, args, 2);
25860 args = PyTuple_New(2);
25861 if (unlikely(!args))
goto done;
25863 PyTuple_SET_ITEM(args, 0, arg1);
25865 PyTuple_SET_ITEM(args, 1, arg2);
25866 Py_INCREF(
function);
25867 result = __Pyx_PyObject_Call(
function, args, NULL);
25869 Py_DECREF(
function);
25875 static CYTHON_INLINE PyObject* __Pyx_PyObject_GetSlice(PyObject* obj,
25876 Py_ssize_t cstart, Py_ssize_t cstop,
25877 PyObject** _py_start, PyObject** _py_stop, PyObject** _py_slice,
25878 int has_cstart,
int has_cstop, CYTHON_UNUSED
int wraparound) {
25879 #if CYTHON_USE_TYPE_SLOTS
25880 PyMappingMethods* mp;
25881 #if PY_MAJOR_VERSION < 3
25882 PySequenceMethods* ms = Py_TYPE(obj)->tp_as_sequence;
25883 if (likely(ms && ms->sq_slice)) {
25885 if (_py_start && (*_py_start != Py_None)) {
25886 cstart = __Pyx_PyIndex_AsSsize_t(*_py_start);
25887 if ((cstart == (Py_ssize_t)-1) && PyErr_Occurred())
goto bad;
25892 if (_py_stop && (*_py_stop != Py_None)) {
25893 cstop = __Pyx_PyIndex_AsSsize_t(*_py_stop);
25894 if ((cstop == (Py_ssize_t)-1) && PyErr_Occurred())
goto bad;
25896 cstop = PY_SSIZE_T_MAX;
25898 if (wraparound && unlikely((cstart < 0) | (cstop < 0)) && likely(ms->sq_length)) {
25899 Py_ssize_t l = ms->sq_length(obj);
25900 if (likely(l >= 0)) {
25903 if (cstop < 0) cstop = 0;
25907 if (cstart < 0) cstart = 0;
25910 if (!PyErr_ExceptionMatches(PyExc_OverflowError))
25915 return ms->sq_slice(obj, cstart, cstop);
25918 mp = Py_TYPE(obj)->tp_as_mapping;
25919 if (likely(mp && mp->mp_subscript))
25923 PyObject *py_slice, *py_start, *py_stop;
25925 py_slice = *_py_slice;
25927 PyObject* owned_start = NULL;
25928 PyObject* owned_stop = NULL;
25930 py_start = *_py_start;
25933 owned_start = py_start = PyInt_FromSsize_t(cstart);
25934 if (unlikely(!py_start))
goto bad;
25936 py_start = Py_None;
25939 py_stop = *_py_stop;
25942 owned_stop = py_stop = PyInt_FromSsize_t(cstop);
25943 if (unlikely(!py_stop)) {
25944 Py_XDECREF(owned_start);
25950 py_slice = PySlice_New(py_start, py_stop, Py_None);
25951 Py_XDECREF(owned_start);
25952 Py_XDECREF(owned_stop);
25953 if (unlikely(!py_slice))
goto bad;
25955 #if CYTHON_USE_TYPE_SLOTS
25956 result = mp->mp_subscript(obj, py_slice);
25958 result = PyObject_GetItem(obj, py_slice);
25961 Py_DECREF(py_slice);
25965 PyErr_Format(PyExc_TypeError,
25966 "'%.200s' object is unsliceable", Py_TYPE(obj)->tp_name);
25972 #if PY_MAJOR_VERSION < 3
25973 static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb,
25974 CYTHON_UNUSED PyObject *cause) {
25975 __Pyx_PyThreadState_declare
25977 if (!value || value == Py_None)
25981 if (!tb || tb == Py_None)
25985 if (!PyTraceBack_Check(tb)) {
25986 PyErr_SetString(PyExc_TypeError,
25987 "raise: arg 3 must be a traceback or None");
25991 if (PyType_Check(type)) {
25992 #if CYTHON_COMPILING_IN_PYPY
25994 Py_INCREF(Py_None);
25998 PyErr_NormalizeException(&type, &value, &tb);
26001 PyErr_SetString(PyExc_TypeError,
26002 "instance exception may not have a separate value");
26006 type = (PyObject*) Py_TYPE(type);
26008 if (!PyType_IsSubtype((PyTypeObject *)type, (PyTypeObject *)PyExc_BaseException)) {
26009 PyErr_SetString(PyExc_TypeError,
26010 "raise: exception class must be a subclass of BaseException");
26014 __Pyx_PyThreadState_assign
26015 __Pyx_ErrRestore(type, value, tb);
26024 static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause) {
26025 PyObject* owned_instance = NULL;
26026 if (tb == Py_None) {
26028 }
else if (tb && !PyTraceBack_Check(tb)) {
26029 PyErr_SetString(PyExc_TypeError,
26030 "raise: arg 3 must be a traceback or None");
26033 if (value == Py_None)
26035 if (PyExceptionInstance_Check(type)) {
26037 PyErr_SetString(PyExc_TypeError,
26038 "instance exception may not have a separate value");
26042 type = (PyObject*) Py_TYPE(value);
26043 }
else if (PyExceptionClass_Check(type)) {
26044 PyObject *instance_class = NULL;
26045 if (value && PyExceptionInstance_Check(value)) {
26046 instance_class = (PyObject*) Py_TYPE(value);
26047 if (instance_class != type) {
26048 int is_subclass = PyObject_IsSubclass(instance_class, type);
26049 if (!is_subclass) {
26050 instance_class = NULL;
26051 }
else if (unlikely(is_subclass == -1)) {
26054 type = instance_class;
26058 if (!instance_class) {
26061 args = PyTuple_New(0);
26062 else if (PyTuple_Check(value)) {
26066 args = PyTuple_Pack(1, value);
26069 owned_instance = PyObject_Call(type, args, NULL);
26071 if (!owned_instance)
26073 value = owned_instance;
26074 if (!PyExceptionInstance_Check(value)) {
26075 PyErr_Format(PyExc_TypeError,
26076 "calling %R should have returned an instance of "
26077 "BaseException, not %R",
26078 type, Py_TYPE(value));
26083 PyErr_SetString(PyExc_TypeError,
26084 "raise: exception class must be a subclass of BaseException");
26088 PyObject *fixed_cause;
26089 if (cause == Py_None) {
26090 fixed_cause = NULL;
26091 }
else if (PyExceptionClass_Check(cause)) {
26092 fixed_cause = PyObject_CallObject(cause, NULL);
26093 if (fixed_cause == NULL)
26095 }
else if (PyExceptionInstance_Check(cause)) {
26096 fixed_cause = cause;
26097 Py_INCREF(fixed_cause);
26099 PyErr_SetString(PyExc_TypeError,
26100 "exception causes must derive from "
26104 PyException_SetCause(value, fixed_cause);
26106 PyErr_SetObject(type, value);
26108 #if CYTHON_COMPILING_IN_PYPY
26109 PyObject *tmp_type, *tmp_value, *tmp_tb;
26110 PyErr_Fetch(&tmp_type, &tmp_value, &tmp_tb);
26112 PyErr_Restore(tmp_type, tmp_value, tb);
26113 Py_XDECREF(tmp_tb);
26115 PyThreadState *tstate = __Pyx_PyThreadState_Current;
26116 PyObject* tmp_tb = tstate->curexc_traceback;
26117 if (tb != tmp_tb) {
26119 tstate->curexc_traceback = tb;
26120 Py_XDECREF(tmp_tb);
26125 Py_XDECREF(owned_instance);
26131 static CYTHON_INLINE
int __Pyx_HasAttr(PyObject *o, PyObject *
n) {
26133 if (unlikely(!__Pyx_PyBaseString_Check(
n))) {
26134 PyErr_SetString(PyExc_TypeError,
26135 "hasattr(): attribute name must be string");
26138 r = __Pyx_GetAttr(o,
n);
26139 if (unlikely(!
r)) {
26149 #if CYTHON_USE_EXC_INFO_STACK
26150 static _PyErr_StackItem *
26151 __Pyx_PyErr_GetTopmostException(PyThreadState *tstate)
26153 _PyErr_StackItem *exc_info = tstate->exc_info;
26154 while ((exc_info->exc_type == NULL || exc_info->exc_type == Py_None) &&
26155 exc_info->previous_item != NULL)
26157 exc_info = exc_info->previous_item;
26164 #if CYTHON_FAST_THREAD_STATE
26165 static CYTHON_INLINE
void __Pyx__ExceptionSave(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) {
26166 #if CYTHON_USE_EXC_INFO_STACK
26167 _PyErr_StackItem *exc_info = __Pyx_PyErr_GetTopmostException(tstate);
26168 *type = exc_info->exc_type;
26169 *value = exc_info->exc_value;
26170 *tb = exc_info->exc_traceback;
26172 *type = tstate->exc_type;
26173 *value = tstate->exc_value;
26174 *tb = tstate->exc_traceback;
26177 Py_XINCREF(*value);
26180 static CYTHON_INLINE
void __Pyx__ExceptionReset(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb) {
26181 PyObject *tmp_type, *tmp_value, *tmp_tb;
26182 #if CYTHON_USE_EXC_INFO_STACK
26183 _PyErr_StackItem *exc_info = tstate->exc_info;
26184 tmp_type = exc_info->exc_type;
26185 tmp_value = exc_info->exc_value;
26186 tmp_tb = exc_info->exc_traceback;
26187 exc_info->exc_type = type;
26188 exc_info->exc_value = value;
26189 exc_info->exc_traceback = tb;
26191 tmp_type = tstate->exc_type;
26192 tmp_value = tstate->exc_value;
26193 tmp_tb = tstate->exc_traceback;
26194 tstate->exc_type = type;
26195 tstate->exc_value = value;
26196 tstate->exc_traceback = tb;
26198 Py_XDECREF(tmp_type);
26199 Py_XDECREF(tmp_value);
26200 Py_XDECREF(tmp_tb);
26205 #if CYTHON_FAST_THREAD_STATE
26206 static int __Pyx__GetException(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb)
26208 static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb)
26211 PyObject *local_type, *local_value, *local_tb;
26212 #if CYTHON_FAST_THREAD_STATE
26213 PyObject *tmp_type, *tmp_value, *tmp_tb;
26214 local_type = tstate->curexc_type;
26215 local_value = tstate->curexc_value;
26216 local_tb = tstate->curexc_traceback;
26217 tstate->curexc_type = 0;
26218 tstate->curexc_value = 0;
26219 tstate->curexc_traceback = 0;
26221 PyErr_Fetch(&local_type, &local_value, &local_tb);
26223 PyErr_NormalizeException(&local_type, &local_value, &local_tb);
26224 #if CYTHON_FAST_THREAD_STATE
26225 if (unlikely(tstate->curexc_type))
26227 if (unlikely(PyErr_Occurred()))
26230 #if PY_MAJOR_VERSION >= 3
26232 if (unlikely(PyException_SetTraceback(local_value, local_tb) < 0))
26236 Py_XINCREF(local_tb);
26237 Py_XINCREF(local_type);
26238 Py_XINCREF(local_value);
26239 *type = local_type;
26240 *value = local_value;
26242 #if CYTHON_FAST_THREAD_STATE
26243 #if CYTHON_USE_EXC_INFO_STACK
26245 _PyErr_StackItem *exc_info = tstate->exc_info;
26246 tmp_type = exc_info->exc_type;
26247 tmp_value = exc_info->exc_value;
26248 tmp_tb = exc_info->exc_traceback;
26249 exc_info->exc_type = local_type;
26250 exc_info->exc_value = local_value;
26251 exc_info->exc_traceback = local_tb;
26254 tmp_type = tstate->exc_type;
26255 tmp_value = tstate->exc_value;
26256 tmp_tb = tstate->exc_traceback;
26257 tstate->exc_type = local_type;
26258 tstate->exc_value = local_value;
26259 tstate->exc_traceback = local_tb;
26261 Py_XDECREF(tmp_type);
26262 Py_XDECREF(tmp_value);
26263 Py_XDECREF(tmp_tb);
26265 PyErr_SetExcInfo(local_type, local_value, local_tb);
26272 Py_XDECREF(local_type);
26273 Py_XDECREF(local_value);
26274 Py_XDECREF(local_tb);
26279 static int __Pyx__ArgTypeTest(PyObject *obj, PyTypeObject *type,
const char *name,
int exact)
26281 if (unlikely(!type)) {
26282 PyErr_SetString(PyExc_SystemError,
"Missing type object");
26286 #if PY_MAJOR_VERSION == 2
26287 if ((type == &PyBaseString_Type) && likely(__Pyx_PyBaseString_CheckExact(obj)))
return 1;
26291 if (likely(__Pyx_TypeCheck(obj, type)))
return 1;
26293 PyErr_Format(PyExc_TypeError,
26294 "Argument '%.200s' has incorrect type (expected %.200s, got %.200s)",
26295 name, type->tp_name, Py_TYPE(obj)->tp_name);
26300 static CYTHON_INLINE
int __Pyx_PyBytes_Equals(PyObject* s1, PyObject* s2,
int equals) {
26301 #if CYTHON_COMPILING_IN_PYPY
26302 return PyObject_RichCompareBool(s1, s2, equals);
26305 return (equals == Py_EQ);
26306 }
else if (PyBytes_CheckExact(s1) & PyBytes_CheckExact(s2)) {
26307 const char *ps1, *ps2;
26308 Py_ssize_t length = PyBytes_GET_SIZE(s1);
26309 if (length != PyBytes_GET_SIZE(s2))
26310 return (equals == Py_NE);
26311 ps1 = PyBytes_AS_STRING(s1);
26312 ps2 = PyBytes_AS_STRING(s2);
26313 if (ps1[0] != ps2[0]) {
26314 return (equals == Py_NE);
26315 }
else if (length == 1) {
26316 return (equals == Py_EQ);
26319 #if CYTHON_USE_UNICODE_INTERNALS && (PY_VERSION_HEX < 0x030B0000)
26320 Py_hash_t hash1, hash2;
26321 hash1 = ((PyBytesObject*)s1)->ob_shash;
26322 hash2 = ((PyBytesObject*)s2)->ob_shash;
26323 if (hash1 != hash2 && hash1 != -1 && hash2 != -1) {
26324 return (equals == Py_NE);
26327 result = memcmp(ps1, ps2, (
size_t)length);
26328 return (equals == Py_EQ) ? (result == 0) : (result != 0);
26330 }
else if ((s1 == Py_None) & PyBytes_CheckExact(s2)) {
26331 return (equals == Py_NE);
26332 }
else if ((s2 == Py_None) & PyBytes_CheckExact(s1)) {
26333 return (equals == Py_NE);
26336 PyObject* py_result = PyObject_RichCompare(s1, s2, equals);
26339 result = __Pyx_PyObject_IsTrue(py_result);
26340 Py_DECREF(py_result);
26347 static CYTHON_INLINE
int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2,
int equals) {
26348 #if CYTHON_COMPILING_IN_PYPY
26349 return PyObject_RichCompareBool(s1, s2, equals);
26351 #if PY_MAJOR_VERSION < 3
26352 PyObject* owned_ref = NULL;
26354 int s1_is_unicode, s2_is_unicode;
26358 s1_is_unicode = PyUnicode_CheckExact(s1);
26359 s2_is_unicode = PyUnicode_CheckExact(s2);
26360 #if PY_MAJOR_VERSION < 3
26361 if ((s1_is_unicode & (!s2_is_unicode)) && PyString_CheckExact(s2)) {
26362 owned_ref = PyUnicode_FromObject(s2);
26363 if (unlikely(!owned_ref))
26367 }
else if ((s2_is_unicode & (!s1_is_unicode)) && PyString_CheckExact(s1)) {
26368 owned_ref = PyUnicode_FromObject(s1);
26369 if (unlikely(!owned_ref))
26373 }
else if (((!s2_is_unicode) & (!s1_is_unicode))) {
26374 return __Pyx_PyBytes_Equals(s1, s2, equals);
26377 if (s1_is_unicode & s2_is_unicode) {
26380 void *data1, *data2;
26381 if (unlikely(__Pyx_PyUnicode_READY(s1) < 0) || unlikely(__Pyx_PyUnicode_READY(s2) < 0))
26383 length = __Pyx_PyUnicode_GET_LENGTH(s1);
26384 if (length != __Pyx_PyUnicode_GET_LENGTH(s2)) {
26387 #if CYTHON_USE_UNICODE_INTERNALS
26389 Py_hash_t hash1, hash2;
26390 #if CYTHON_PEP393_ENABLED
26391 hash1 = ((PyASCIIObject*)s1)->hash;
26392 hash2 = ((PyASCIIObject*)s2)->hash;
26394 hash1 = ((PyUnicodeObject*)s1)->hash;
26395 hash2 = ((PyUnicodeObject*)s2)->hash;
26397 if (hash1 != hash2 && hash1 != -1 && hash2 != -1) {
26402 kind = __Pyx_PyUnicode_KIND(s1);
26403 if (kind != __Pyx_PyUnicode_KIND(s2)) {
26406 data1 = __Pyx_PyUnicode_DATA(s1);
26407 data2 = __Pyx_PyUnicode_DATA(s2);
26408 if (__Pyx_PyUnicode_READ(kind, data1, 0) != __Pyx_PyUnicode_READ(kind, data2, 0)) {
26410 }
else if (length == 1) {
26413 int result = memcmp(data1, data2, (
size_t)(length * kind));
26414 #if PY_MAJOR_VERSION < 3
26415 Py_XDECREF(owned_ref);
26417 return (equals == Py_EQ) ? (result == 0) : (result != 0);
26419 }
else if ((s1 == Py_None) & s2_is_unicode) {
26421 }
else if ((s2 == Py_None) & s1_is_unicode) {
26425 PyObject* py_result = PyObject_RichCompare(s1, s2, equals);
26426 #if PY_MAJOR_VERSION < 3
26427 Py_XDECREF(owned_ref);
26431 result = __Pyx_PyObject_IsTrue(py_result);
26432 Py_DECREF(py_result);
26436 #if PY_MAJOR_VERSION < 3
26437 Py_XDECREF(owned_ref);
26439 return (equals == Py_EQ);
26441 #if PY_MAJOR_VERSION < 3
26442 Py_XDECREF(owned_ref);
26444 return (equals == Py_NE);
26449 static CYTHON_INLINE Py_ssize_t __Pyx_div_Py_ssize_t(Py_ssize_t a, Py_ssize_t b) {
26450 Py_ssize_t
q = a / b;
26451 Py_ssize_t
r = a -
q*b;
26452 q -= ((
r != 0) & ((
r ^ b) < 0));
26457 static CYTHON_INLINE PyObject* __Pyx_decode_c_string(
26458 const char* cstring, Py_ssize_t start, Py_ssize_t stop,
26459 const char* encoding,
const char* errors,
26460 PyObject* (*decode_func)(
const char *
s, Py_ssize_t size,
const char *errors)) {
26462 if (unlikely((start < 0) | (stop < 0))) {
26463 size_t slen = strlen(cstring);
26464 if (unlikely(slen > (
size_t) PY_SSIZE_T_MAX)) {
26465 PyErr_SetString(PyExc_OverflowError,
26466 "c-string too long to convert to Python");
26469 length = (Py_ssize_t) slen;
26478 if (unlikely(stop <= start))
26479 return __Pyx_NewRef(__pyx_empty_unicode);
26480 length = stop - start;
26483 return decode_func(cstring, length, errors);
26485 return PyUnicode_Decode(cstring, length, encoding, errors);
26490 static CYTHON_INLINE
void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected) {
26491 PyErr_Format(PyExc_ValueError,
26492 "too many values to unpack (expected %" CYTHON_FORMAT_SSIZE_T
"d)", expected);
26496 static CYTHON_INLINE
void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index) {
26497 PyErr_Format(PyExc_ValueError,
26498 "need more than %" CYTHON_FORMAT_SSIZE_T
"d value%.1s to unpack",
26499 index, (index == 1) ?
"" :
"s");
26503 static CYTHON_INLINE
void __Pyx_RaiseNoneNotIterableError(
void) {
26504 PyErr_SetString(PyExc_TypeError,
"'NoneType' object is not iterable");
26508 static CYTHON_INLINE
int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type) {
26509 if (unlikely(!type)) {
26510 PyErr_SetString(PyExc_SystemError,
"Missing type object");
26513 if (likely(__Pyx_TypeCheck(obj, type)))
26515 PyErr_Format(PyExc_TypeError,
"Cannot convert %.200s to %.200s",
26516 Py_TYPE(obj)->tp_name, type->tp_name);
26521 #if CYTHON_FAST_THREAD_STATE
26522 static CYTHON_INLINE
void __Pyx__ExceptionSwap(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) {
26523 PyObject *tmp_type, *tmp_value, *tmp_tb;
26524 #if CYTHON_USE_EXC_INFO_STACK
26525 _PyErr_StackItem *exc_info = tstate->exc_info;
26526 tmp_type = exc_info->exc_type;
26527 tmp_value = exc_info->exc_value;
26528 tmp_tb = exc_info->exc_traceback;
26529 exc_info->exc_type = *type;
26530 exc_info->exc_value = *value;
26531 exc_info->exc_traceback = *tb;
26533 tmp_type = tstate->exc_type;
26534 tmp_value = tstate->exc_value;
26535 tmp_tb = tstate->exc_traceback;
26536 tstate->exc_type = *type;
26537 tstate->exc_value = *value;
26538 tstate->exc_traceback = *tb;
26541 *value = tmp_value;
26545 static CYTHON_INLINE
void __Pyx_ExceptionSwap(PyObject **type, PyObject **value, PyObject **tb) {
26546 PyObject *tmp_type, *tmp_value, *tmp_tb;
26547 PyErr_GetExcInfo(&tmp_type, &tmp_value, &tmp_tb);
26548 PyErr_SetExcInfo(*type, *value, *tb);
26550 *value = tmp_value;
26556 #if CYTHON_COMPILING_IN_CPYTHON
26557 static int __Pyx_InBases(PyTypeObject *a, PyTypeObject *b) {
26563 return b == &PyBaseObject_Type;
26565 static CYTHON_INLINE
int __Pyx_IsSubtype(PyTypeObject *a, PyTypeObject *b) {
26567 if (a == b)
return 1;
26571 n = PyTuple_GET_SIZE(mro);
26572 for (i = 0; i <
n; i++) {
26573 if (PyTuple_GET_ITEM(mro, i) == (PyObject *)b)
26578 return __Pyx_InBases(a, b);
26580 #if PY_MAJOR_VERSION == 2
26581 static int __Pyx_inner_PyErr_GivenExceptionMatches2(PyObject *err, PyObject* exc_type1, PyObject* exc_type2) {
26582 PyObject *exception, *value, *tb;
26584 __Pyx_PyThreadState_declare
26585 __Pyx_PyThreadState_assign
26586 __Pyx_ErrFetch(&exception, &value, &tb);
26587 res = exc_type1 ? PyObject_IsSubclass(err, exc_type1) : 0;
26588 if (unlikely(res == -1)) {
26589 PyErr_WriteUnraisable(err);
26593 res = PyObject_IsSubclass(err, exc_type2);
26594 if (unlikely(res == -1)) {
26595 PyErr_WriteUnraisable(err);
26599 __Pyx_ErrRestore(exception, value, tb);
26603 static CYTHON_INLINE
int __Pyx_inner_PyErr_GivenExceptionMatches2(PyObject *err, PyObject* exc_type1, PyObject *exc_type2) {
26604 int res = exc_type1 ? __Pyx_IsSubtype((PyTypeObject*)err, (PyTypeObject*)exc_type1) : 0;
26606 res = __Pyx_IsSubtype((PyTypeObject*)err, (PyTypeObject*)exc_type2);
26611 static int __Pyx_PyErr_GivenExceptionMatchesTuple(PyObject *exc_type, PyObject *tuple) {
26613 assert(PyExceptionClass_Check(exc_type));
26614 n = PyTuple_GET_SIZE(tuple);
26615 #if PY_MAJOR_VERSION >= 3
26616 for (i=0; i<
n; i++) {
26617 if (exc_type == PyTuple_GET_ITEM(tuple, i))
return 1;
26620 for (i=0; i<
n; i++) {
26621 PyObject *t = PyTuple_GET_ITEM(tuple, i);
26622 #if PY_MAJOR_VERSION < 3
26623 if (likely(exc_type == t))
return 1;
26625 if (likely(PyExceptionClass_Check(t))) {
26626 if (__Pyx_inner_PyErr_GivenExceptionMatches2(exc_type, NULL, t))
return 1;
26632 static CYTHON_INLINE
int __Pyx_PyErr_GivenExceptionMatches(PyObject *err, PyObject* exc_type) {
26633 if (likely(err == exc_type))
return 1;
26634 if (likely(PyExceptionClass_Check(err))) {
26635 if (likely(PyExceptionClass_Check(exc_type))) {
26636 return __Pyx_inner_PyErr_GivenExceptionMatches2(err, NULL, exc_type);
26637 }
else if (likely(PyTuple_Check(exc_type))) {
26638 return __Pyx_PyErr_GivenExceptionMatchesTuple(err, exc_type);
26642 return PyErr_GivenExceptionMatches(err, exc_type);
26644 static CYTHON_INLINE
int __Pyx_PyErr_GivenExceptionMatches2(PyObject *err, PyObject *exc_type1, PyObject *exc_type2) {
26645 assert(PyExceptionClass_Check(exc_type1));
26646 assert(PyExceptionClass_Check(exc_type2));
26647 if (likely(err == exc_type1 || err == exc_type2))
return 1;
26648 if (likely(PyExceptionClass_Check(err))) {
26649 return __Pyx_inner_PyErr_GivenExceptionMatches2(err, exc_type1, exc_type2);
26651 return (PyErr_GivenExceptionMatches(err, exc_type1) || PyErr_GivenExceptionMatches(err, exc_type2));
26656 #if !CYTHON_COMPILING_IN_PYPY
26657 static PyObject* __Pyx_PyInt_AddObjC(PyObject *op1, PyObject *op2, CYTHON_UNUSED
long intval,
int inplace,
int zerodivision_check) {
26659 (void)zerodivision_check;
26660 #if PY_MAJOR_VERSION < 3
26661 if (likely(PyInt_CheckExact(op1))) {
26662 const long b = intval;
26664 long a = PyInt_AS_LONG(op1);
26665 x = (long)((
unsigned long)a + b);
26666 if (likely((x^a) >= 0 || (x^b) >= 0))
26667 return PyInt_FromLong(x);
26668 return PyLong_Type.tp_as_number->nb_add(op1, op2);
26671 #if CYTHON_USE_PYLONG_INTERNALS
26672 if (likely(PyLong_CheckExact(op1))) {
26673 const long b = intval;
26675 #ifdef HAVE_LONG_LONG
26676 const PY_LONG_LONG llb = intval;
26677 PY_LONG_LONG lla, llx;
26679 const digit* digits = ((PyLongObject*)op1)->ob_digit;
26680 const Py_ssize_t size = Py_SIZE(op1);
26681 if (likely(__Pyx_sst_abs(size) <= 1)) {
26682 a = likely(size) ? digits[0] : 0;
26683 if (size == -1) a = -a;
26687 if (8 *
sizeof(
long) - 1 > 2 * PyLong_SHIFT) {
26688 a = -(long) (((((
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0]));
26690 #ifdef HAVE_LONG_LONG
26691 }
else if (8 *
sizeof(PY_LONG_LONG) - 1 > 2 * PyLong_SHIFT) {
26692 lla = -(PY_LONG_LONG) (((((
unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (
unsigned PY_LONG_LONG)digits[0]));
26696 CYTHON_FALLTHROUGH;
26698 if (8 *
sizeof(
long) - 1 > 2 * PyLong_SHIFT) {
26699 a = (long) (((((
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0]));
26701 #ifdef HAVE_LONG_LONG
26702 }
else if (8 *
sizeof(PY_LONG_LONG) - 1 > 2 * PyLong_SHIFT) {
26703 lla = (PY_LONG_LONG) (((((
unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (
unsigned PY_LONG_LONG)digits[0]));
26707 CYTHON_FALLTHROUGH;
26709 if (8 *
sizeof(
long) - 1 > 3 * PyLong_SHIFT) {
26710 a = -(long) (((((((
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0]));
26712 #ifdef HAVE_LONG_LONG
26713 }
else if (8 *
sizeof(PY_LONG_LONG) - 1 > 3 * PyLong_SHIFT) {
26714 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]));
26718 CYTHON_FALLTHROUGH;
26720 if (8 *
sizeof(
long) - 1 > 3 * PyLong_SHIFT) {
26721 a = (long) (((((((
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0]));
26723 #ifdef HAVE_LONG_LONG
26724 }
else if (8 *
sizeof(PY_LONG_LONG) - 1 > 3 * PyLong_SHIFT) {
26725 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]));
26729 CYTHON_FALLTHROUGH;
26731 if (8 *
sizeof(
long) - 1 > 4 * PyLong_SHIFT) {
26732 a = -(long) (((((((((
unsigned long)digits[3]) << PyLong_SHIFT) | (
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0]));
26734 #ifdef HAVE_LONG_LONG
26735 }
else if (8 *
sizeof(PY_LONG_LONG) - 1 > 4 * PyLong_SHIFT) {
26736 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]));
26740 CYTHON_FALLTHROUGH;
26742 if (8 *
sizeof(
long) - 1 > 4 * PyLong_SHIFT) {
26743 a = (long) (((((((((
unsigned long)digits[3]) << PyLong_SHIFT) | (
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0]));
26745 #ifdef HAVE_LONG_LONG
26746 }
else if (8 *
sizeof(PY_LONG_LONG) - 1 > 4 * PyLong_SHIFT) {
26747 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]));
26751 CYTHON_FALLTHROUGH;
26752 default:
return PyLong_Type.tp_as_number->nb_add(op1, op2);
26756 return PyLong_FromLong(x);
26757 #ifdef HAVE_LONG_LONG
26760 return PyLong_FromLongLong(llx);
26766 if (PyFloat_CheckExact(op1)) {
26767 const long b = intval;
26768 double a = PyFloat_AS_DOUBLE(op1);
26770 PyFPE_START_PROTECT(
"add",
return NULL)
26771 result = ((double)a) + (double)b;
26772 PyFPE_END_PROTECT(result)
26773 return PyFloat_FromDouble(result);
26775 return (inplace ? PyNumber_InPlaceAdd : PyNumber_Add)(op1, op2);
26780 static CYTHON_INLINE
void __Pyx_RaiseUnboundLocalError(
const char *varname) {
26781 PyErr_Format(PyExc_UnboundLocalError,
"local variable '%s' referenced before assignment", varname);
26785 static CYTHON_INLINE
long __Pyx_div_long(
long a,
long b) {
26788 q -= ((
r != 0) & ((
r ^ b) < 0));
26793 #if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000
26794 static PyObject *__Pyx_RaiseGenericGetAttributeError(PyTypeObject *tp, PyObject *attr_name) {
26795 PyErr_Format(PyExc_AttributeError,
26796 #
if PY_MAJOR_VERSION >= 3
26797 "'%.50s' object has no attribute '%U'",
26798 tp->tp_name, attr_name);
26800 "'%.50s' object has no attribute '%.400s'",
26801 tp->tp_name, PyString_AS_STRING(attr_name));
26805 static CYTHON_INLINE PyObject* __Pyx_PyObject_GenericGetAttrNoDict(PyObject* obj, PyObject* attr_name) {
26807 PyTypeObject *tp = Py_TYPE(obj);
26808 if (unlikely(!PyString_Check(attr_name))) {
26809 return PyObject_GenericGetAttr(obj, attr_name);
26811 assert(!tp->tp_dictoffset);
26812 descr = _PyType_Lookup(tp, attr_name);
26813 if (unlikely(!descr)) {
26814 return __Pyx_RaiseGenericGetAttributeError(tp, attr_name);
26817 #if PY_MAJOR_VERSION < 3
26818 if (likely(PyType_HasFeature(Py_TYPE(descr), Py_TPFLAGS_HAVE_CLASS)))
26821 descrgetfunc
f = Py_TYPE(descr)->tp_descr_get;
26823 PyObject *res =
f(descr, obj, (PyObject *)tp);
26833 #if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000
26834 static PyObject* __Pyx_PyObject_GenericGetAttr(PyObject* obj, PyObject* attr_name) {
26835 if (unlikely(Py_TYPE(obj)->tp_dictoffset)) {
26836 return PyObject_GenericGetAttr(obj, attr_name);
26838 return __Pyx_PyObject_GenericGetAttrNoDict(obj, attr_name);
26843 static void __Pyx_PyObject_GetAttrStr_ClearAttributeError(
void) {
26844 __Pyx_PyThreadState_declare
26845 __Pyx_PyThreadState_assign
26846 if (likely(__Pyx_PyErr_ExceptionMatches(PyExc_AttributeError)))
26847 __Pyx_PyErr_Clear();
26849 static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStrNoError(PyObject* obj, PyObject* attr_name) {
26851 #if CYTHON_COMPILING_IN_CPYTHON && CYTHON_USE_TYPE_SLOTS && PY_VERSION_HEX >= 0x030700B1
26852 PyTypeObject* tp = Py_TYPE(obj);
26853 if (likely(tp->tp_getattro == PyObject_GenericGetAttr)) {
26854 return _PyObject_GenericGetAttrWithDict(obj, attr_name, NULL, 1);
26857 result = __Pyx_PyObject_GetAttrStr(obj, attr_name);
26858 if (unlikely(!result)) {
26859 __Pyx_PyObject_GetAttrStr_ClearAttributeError();
26865 static int __Pyx_setup_reduce_is_named(PyObject* meth, PyObject* name) {
26867 PyObject *name_attr;
26868 name_attr = __Pyx_PyObject_GetAttrStr(meth, __pyx_n_s_name_2);
26869 if (likely(name_attr)) {
26870 ret = PyObject_RichCompareBool(name_attr, name, Py_EQ);
26874 if (unlikely(ret < 0)) {
26878 Py_XDECREF(name_attr);
26881 static int __Pyx_setup_reduce(PyObject* type_obj) {
26883 PyObject *object_reduce = NULL;
26884 PyObject *object_getstate = NULL;
26885 PyObject *object_reduce_ex = NULL;
26886 PyObject *reduce = NULL;
26887 PyObject *reduce_ex = NULL;
26888 PyObject *reduce_cython = NULL;
26889 PyObject *setstate = NULL;
26890 PyObject *setstate_cython = NULL;
26891 PyObject *getstate = NULL;
26892 #if CYTHON_USE_PYTYPE_LOOKUP
26893 getstate = _PyType_Lookup((PyTypeObject*)type_obj, __pyx_n_s_getstate);
26895 getstate = __Pyx_PyObject_GetAttrStrNoError(type_obj, __pyx_n_s_getstate);
26896 if (!getstate && PyErr_Occurred()) {
26901 #if CYTHON_USE_PYTYPE_LOOKUP
26902 object_getstate = _PyType_Lookup(&PyBaseObject_Type, __pyx_n_s_getstate);
26904 object_getstate = __Pyx_PyObject_GetAttrStrNoError((PyObject*)&PyBaseObject_Type, __pyx_n_s_getstate);
26905 if (!object_getstate && PyErr_Occurred()) {
26909 if (object_getstate != getstate) {
26913 #if CYTHON_USE_PYTYPE_LOOKUP
26914 object_reduce_ex = _PyType_Lookup(&PyBaseObject_Type, __pyx_n_s_reduce_ex);
if (!object_reduce_ex)
goto __PYX_BAD;
26916 object_reduce_ex = __Pyx_PyObject_GetAttrStr((PyObject*)&PyBaseObject_Type, __pyx_n_s_reduce_ex);
if (!object_reduce_ex)
goto __PYX_BAD;
26918 reduce_ex = __Pyx_PyObject_GetAttrStr(type_obj, __pyx_n_s_reduce_ex);
if (unlikely(!reduce_ex))
goto __PYX_BAD;
26919 if (reduce_ex == object_reduce_ex) {
26920 #if CYTHON_USE_PYTYPE_LOOKUP
26921 object_reduce = _PyType_Lookup(&PyBaseObject_Type, __pyx_n_s_reduce);
if (!object_reduce)
goto __PYX_BAD;
26923 object_reduce = __Pyx_PyObject_GetAttrStr((PyObject*)&PyBaseObject_Type, __pyx_n_s_reduce);
if (!object_reduce)
goto __PYX_BAD;
26925 reduce = __Pyx_PyObject_GetAttrStr(type_obj, __pyx_n_s_reduce);
if (unlikely(!reduce))
goto __PYX_BAD;
26926 if (reduce == object_reduce || __Pyx_setup_reduce_is_named(reduce, __pyx_n_s_reduce_cython)) {
26927 reduce_cython = __Pyx_PyObject_GetAttrStrNoError(type_obj, __pyx_n_s_reduce_cython);
26928 if (likely(reduce_cython)) {
26929 ret = PyDict_SetItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_reduce, reduce_cython);
if (unlikely(ret < 0))
goto __PYX_BAD;
26930 ret = PyDict_DelItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_reduce_cython);
if (unlikely(ret < 0))
goto __PYX_BAD;
26931 }
else if (reduce == object_reduce || PyErr_Occurred()) {
26934 setstate = __Pyx_PyObject_GetAttrStr(type_obj, __pyx_n_s_setstate);
26935 if (!setstate) PyErr_Clear();
26936 if (!setstate || __Pyx_setup_reduce_is_named(setstate, __pyx_n_s_setstate_cython)) {
26937 setstate_cython = __Pyx_PyObject_GetAttrStrNoError(type_obj, __pyx_n_s_setstate_cython);
26938 if (likely(setstate_cython)) {
26939 ret = PyDict_SetItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_setstate, setstate_cython);
if (unlikely(ret < 0))
goto __PYX_BAD;
26940 ret = PyDict_DelItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_setstate_cython);
if (unlikely(ret < 0))
goto __PYX_BAD;
26941 }
else if (!setstate || PyErr_Occurred()) {
26945 PyType_Modified((PyTypeObject*)type_obj);
26950 if (!PyErr_Occurred())
26951 PyErr_Format(PyExc_RuntimeError,
"Unable to initialize pickling for %s", ((PyTypeObject*)type_obj)->tp_name);
26954 #if !CYTHON_USE_PYTYPE_LOOKUP
26955 Py_XDECREF(object_reduce);
26956 Py_XDECREF(object_reduce_ex);
26957 Py_XDECREF(object_getstate);
26958 Py_XDECREF(getstate);
26960 Py_XDECREF(reduce);
26961 Py_XDECREF(reduce_ex);
26962 Py_XDECREF(reduce_cython);
26963 Py_XDECREF(setstate);
26964 Py_XDECREF(setstate_cython);
26969 static int __Pyx_SetVtable(PyObject *dict,
void *vtable) {
26970 #if PY_VERSION_HEX >= 0x02070000
26971 PyObject *ob = PyCapsule_New(vtable, 0, 0);
26973 PyObject *ob = PyCObject_FromVoidPtr(vtable, 0);
26977 if (PyDict_SetItem(dict, __pyx_n_s_pyx_vtable, ob) < 0)
26987 #ifndef __PYX_HAVE_RT_ImportType
26988 #define __PYX_HAVE_RT_ImportType
26989 static PyTypeObject *__Pyx_ImportType(PyObject *module,
const char *module_name,
const char *class_name,
26990 size_t size,
enum __Pyx_ImportType_CheckSize check_size)
26992 PyObject *result = 0;
26994 Py_ssize_t basicsize;
26995 #ifdef Py_LIMITED_API
26996 PyObject *py_basicsize;
26998 result = PyObject_GetAttrString(module, class_name);
27001 if (!PyType_Check(result)) {
27002 PyErr_Format(PyExc_TypeError,
27003 "%.200s.%.200s is not a type object",
27004 module_name, class_name);
27007 #ifndef Py_LIMITED_API
27008 basicsize = ((PyTypeObject *)result)->tp_basicsize;
27010 py_basicsize = PyObject_GetAttrString(result,
"__basicsize__");
27013 basicsize = PyLong_AsSsize_t(py_basicsize);
27014 Py_DECREF(py_basicsize);
27016 if (basicsize == (Py_ssize_t)-1 && PyErr_Occurred())
27019 if ((
size_t)basicsize < size) {
27020 PyErr_Format(PyExc_ValueError,
27021 "%.200s.%.200s size changed, may indicate binary incompatibility. "
27022 "Expected %zd from C header, got %zd from PyObject",
27023 module_name, class_name, size, basicsize);
27026 if (check_size == __Pyx_ImportType_CheckSize_Error && (
size_t)basicsize != size) {
27027 PyErr_Format(PyExc_ValueError,
27028 "%.200s.%.200s size changed, may indicate binary incompatibility. "
27029 "Expected %zd from C header, got %zd from PyObject",
27030 module_name, class_name, size, basicsize);
27033 else if (check_size == __Pyx_ImportType_CheckSize_Warn && (
size_t)basicsize > size) {
27034 PyOS_snprintf(warning,
sizeof(warning),
27035 "%s.%s size changed, may indicate binary incompatibility. "
27036 "Expected %zd from C header, got %zd from PyObject",
27037 module_name, class_name, size, basicsize);
27038 if (PyErr_WarnEx(NULL, warning, 0) < 0)
goto bad;
27040 return (PyTypeObject *)result;
27042 Py_XDECREF(result);
27048 #ifndef CYTHON_CLINE_IN_TRACEBACK
27049 static int __Pyx_CLineForTraceback(CYTHON_NCP_UNUSED PyThreadState *tstate,
int c_line) {
27050 PyObject *use_cline;
27051 PyObject *ptype, *pvalue, *ptraceback;
27052 #if CYTHON_COMPILING_IN_CPYTHON
27053 PyObject **cython_runtime_dict;
27055 if (unlikely(!__pyx_cython_runtime)) {
27058 __Pyx_ErrFetchInState(tstate, &ptype, &pvalue, &ptraceback);
27059 #if CYTHON_COMPILING_IN_CPYTHON
27060 cython_runtime_dict = _PyObject_GetDictPtr(__pyx_cython_runtime);
27061 if (likely(cython_runtime_dict)) {
27062 __PYX_PY_DICT_LOOKUP_IF_MODIFIED(
27063 use_cline, *cython_runtime_dict,
27064 __Pyx_PyDict_GetItemStr(*cython_runtime_dict, __pyx_n_s_cline_in_traceback))
27068 PyObject *use_cline_obj = __Pyx_PyObject_GetAttrStr(__pyx_cython_runtime, __pyx_n_s_cline_in_traceback);
27069 if (use_cline_obj) {
27070 use_cline = PyObject_Not(use_cline_obj) ? Py_False : Py_True;
27071 Py_DECREF(use_cline_obj);
27079 (void) PyObject_SetAttr(__pyx_cython_runtime, __pyx_n_s_cline_in_traceback, Py_False);
27081 else if (use_cline == Py_False || (use_cline != Py_True && PyObject_Not(use_cline) != 0)) {
27084 __Pyx_ErrRestoreInState(tstate, ptype, pvalue, ptraceback);
27090 static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries,
int count,
int code_line) {
27091 int start = 0, mid = 0, end = count - 1;
27092 if (end >= 0 && code_line > entries[end].code_line) {
27095 while (start < end) {
27096 mid = start + (end - start) / 2;
27097 if (code_line < entries[mid].code_line) {
27099 }
else if (code_line > entries[mid].code_line) {
27105 if (code_line <= entries[mid].code_line) {
27111 static PyCodeObject *__pyx_find_code_object(
int code_line) {
27112 PyCodeObject* code_object;
27114 if (unlikely(!code_line) || unlikely(!__pyx_code_cache.entries)) {
27117 pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line);
27118 if (unlikely(
pos >= __pyx_code_cache.count) || unlikely(__pyx_code_cache.entries[
pos].code_line != code_line)) {
27121 code_object = __pyx_code_cache.entries[
pos].code_object;
27122 Py_INCREF(code_object);
27123 return code_object;
27125 static void __pyx_insert_code_object(
int code_line, PyCodeObject* code_object) {
27127 __Pyx_CodeObjectCacheEntry* entries = __pyx_code_cache.entries;
27128 if (unlikely(!code_line)) {
27131 if (unlikely(!entries)) {
27132 entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Malloc(64*
sizeof(__Pyx_CodeObjectCacheEntry));
27133 if (likely(entries)) {
27134 __pyx_code_cache.entries = entries;
27135 __pyx_code_cache.max_count = 64;
27136 __pyx_code_cache.count = 1;
27137 entries[0].code_line = code_line;
27138 entries[0].code_object = code_object;
27139 Py_INCREF(code_object);
27143 pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line);
27144 if ((
pos < __pyx_code_cache.count) && unlikely(__pyx_code_cache.entries[
pos].code_line == code_line)) {
27145 PyCodeObject* tmp = entries[
pos].code_object;
27146 entries[
pos].code_object = code_object;
27150 if (__pyx_code_cache.count == __pyx_code_cache.max_count) {
27151 int new_max = __pyx_code_cache.max_count + 64;
27152 entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Realloc(
27153 __pyx_code_cache.entries, ((
size_t)new_max) *
sizeof(__Pyx_CodeObjectCacheEntry));
27154 if (unlikely(!entries)) {
27157 __pyx_code_cache.entries = entries;
27158 __pyx_code_cache.max_count = new_max;
27160 for (i=__pyx_code_cache.count; i>
pos; i--) {
27161 entries[i] = entries[i-1];
27163 entries[
pos].code_line = code_line;
27164 entries[
pos].code_object = code_object;
27165 __pyx_code_cache.count++;
27166 Py_INCREF(code_object);
27170 #include "compile.h"
27171 #include "frameobject.h"
27172 #include "traceback.h"
27173 #if PY_VERSION_HEX >= 0x030b00a6
27174 #ifndef Py_BUILD_CORE
27175 #define Py_BUILD_CORE 1
27177 #include "internal/pycore_frame.h"
27179 static PyCodeObject* __Pyx_CreateCodeObjectForTraceback(
27180 const char *funcname,
int c_line,
27181 int py_line,
const char *filename) {
27182 PyCodeObject *py_code = NULL;
27183 PyObject *py_funcname = NULL;
27184 #if PY_MAJOR_VERSION < 3
27185 PyObject *py_srcfile = NULL;
27186 py_srcfile = PyString_FromString(filename);
27187 if (!py_srcfile)
goto bad;
27190 #if PY_MAJOR_VERSION < 3
27191 py_funcname = PyString_FromFormat(
"%s (%s:%d)", funcname, __pyx_cfilenm, c_line);
27192 if (!py_funcname)
goto bad;
27194 py_funcname = PyUnicode_FromFormat(
"%s (%s:%d)", funcname, __pyx_cfilenm, c_line);
27195 if (!py_funcname)
goto bad;
27196 funcname = PyUnicode_AsUTF8(py_funcname);
27197 if (!funcname)
goto bad;
27201 #if PY_MAJOR_VERSION < 3
27202 py_funcname = PyString_FromString(funcname);
27203 if (!py_funcname)
goto bad;
27206 #if PY_MAJOR_VERSION < 3
27207 py_code = __Pyx_PyCode_New(
27224 Py_DECREF(py_srcfile);
27226 py_code = PyCode_NewEmpty(filename, funcname, py_line);
27228 Py_XDECREF(py_funcname);
27231 Py_XDECREF(py_funcname);
27232 #if PY_MAJOR_VERSION < 3
27233 Py_XDECREF(py_srcfile);
27237 static void __Pyx_AddTraceback(
const char *funcname,
int c_line,
27238 int py_line,
const char *filename) {
27239 PyCodeObject *py_code = 0;
27240 PyFrameObject *py_frame = 0;
27241 PyThreadState *tstate = __Pyx_PyThreadState_Current;
27242 PyObject *ptype, *pvalue, *ptraceback;
27244 c_line = __Pyx_CLineForTraceback(tstate, c_line);
27246 py_code = __pyx_find_code_object(c_line ? -c_line : py_line);
27248 __Pyx_ErrFetchInState(tstate, &ptype, &pvalue, &ptraceback);
27249 py_code = __Pyx_CreateCodeObjectForTraceback(
27250 funcname, c_line, py_line, filename);
27255 Py_XDECREF(pvalue);
27256 Py_XDECREF(ptraceback);
27259 __Pyx_ErrRestoreInState(tstate, ptype, pvalue, ptraceback);
27260 __pyx_insert_code_object(c_line ? -c_line : py_line, py_code);
27262 py_frame = PyFrame_New(
27268 if (!py_frame)
goto bad;
27269 __Pyx_PyFrame_SetLineNumber(py_frame, py_line);
27270 PyTraceBack_Here(py_frame);
27272 Py_XDECREF(py_code);
27273 Py_XDECREF(py_frame);
27276 #if PY_MAJOR_VERSION < 3
27277 static int __Pyx_GetBuffer(PyObject *obj, Py_buffer *view,
int flags) {
27278 if (PyObject_CheckBuffer(obj))
return PyObject_GetBuffer(obj, view, flags);
27279 if (__Pyx_TypeCheck(obj, __pyx_array_type))
return __pyx_array_getbuffer(obj, view, flags);
27280 if (__Pyx_TypeCheck(obj, __pyx_memoryview_type))
return __pyx_memoryview_getbuffer(obj, view, flags);
27281 PyErr_Format(PyExc_TypeError,
"'%.200s' does not have the buffer interface", Py_TYPE(obj)->tp_name);
27284 static void __Pyx_ReleaseBuffer(Py_buffer *view) {
27285 PyObject *obj = view->obj;
27287 if (PyObject_CheckBuffer(obj)) {
27288 PyBuffer_Release(view);
27300 __pyx_memviewslice_is_contig(
const __Pyx_memviewslice mvs,
char order,
int ndim)
27302 int i, index, step, start;
27303 Py_ssize_t itemsize = mvs.memview->view.itemsize;
27304 if (order ==
'F') {
27311 for (i = 0; i < ndim; i++) {
27312 index = start + step * i;
27313 if (mvs.suboffsets[index] >= 0 || mvs.strides[index] != itemsize)
27315 itemsize *= mvs.shape[index];
27322 __pyx_get_array_memory_extents(__Pyx_memviewslice *slice,
27323 void **out_start,
void **out_end,
27324 int ndim,
size_t itemsize)
27328 start = end = slice->data;
27329 for (i = 0; i < ndim; i++) {
27330 Py_ssize_t stride = slice->strides[i];
27331 Py_ssize_t extent = slice->shape[i];
27333 *out_start = *out_end = start;
27337 end += stride * (extent - 1);
27339 start += stride * (extent - 1);
27342 *out_start = start;
27343 *out_end = end + itemsize;
27346 __pyx_slices_overlap(__Pyx_memviewslice *slice1,
27347 __Pyx_memviewslice *slice2,
27348 int ndim,
size_t itemsize)
27350 void *start1, *end1, *start2, *end2;
27351 __pyx_get_array_memory_extents(slice1, &start1, &end1, ndim, itemsize);
27352 __pyx_get_array_memory_extents(slice2, &start2, &end2, ndim, itemsize);
27353 return (start1 < end2) && (start2 < end1);
27357 static CYTHON_INLINE PyObject *
27358 __pyx_capsule_create(
void *p, CYTHON_UNUSED
const char *sig)
27361 #if PY_VERSION_HEX >= 0x02070000
27362 cobj = PyCapsule_New(p, sig, NULL);
27364 cobj = PyCObject_FromVoidPtr(p, NULL);
27370 static CYTHON_INLINE PyObject *__pyx_memview_get_double(
const char *itemp) {
27371 return (PyObject *) PyFloat_FromDouble(*(
double *) itemp);
27373 static CYTHON_INLINE
int __pyx_memview_set_double(
const char *itemp, PyObject *obj) {
27374 double value = __pyx_PyFloat_AsDouble(obj);
27375 if ((value == (
double)-1) && PyErr_Occurred())
27377 *(
double *) itemp = value;
27382 static CYTHON_INLINE
int __Pyx_Is_Little_Endian(
void)
27388 S.u32 = 0x01020304;
27389 return S.u8[0] == 4;
27393 static void __Pyx_BufFmt_Init(__Pyx_BufFmt_Context* ctx,
27394 __Pyx_BufFmt_StackElem* stack,
27395 __Pyx_TypeInfo* type) {
27396 stack[0].field = &ctx->root;
27397 stack[0].parent_offset = 0;
27398 ctx->root.type = type;
27399 ctx->root.name =
"buffer dtype";
27400 ctx->root.offset = 0;
27402 ctx->head->field = &ctx->root;
27403 ctx->fmt_offset = 0;
27404 ctx->head->parent_offset = 0;
27405 ctx->new_packmode =
'@';
27406 ctx->enc_packmode =
'@';
27407 ctx->new_count = 1;
27408 ctx->enc_count = 0;
27410 ctx->is_complex = 0;
27411 ctx->is_valid_array = 0;
27412 ctx->struct_alignment = 0;
27413 while (type->typegroup ==
'S') {
27415 ctx->head->field = type->fields;
27416 ctx->head->parent_offset = 0;
27417 type = type->fields->type;
27420 static int __Pyx_BufFmt_ParseNumber(
const char** ts) {
27422 const char* t = *ts;
27423 if (*t < '0' || *t >
'9') {
27426 count = *t++ -
'0';
27427 while (*t >=
'0' && *t <=
'9') {
27429 count += *t++ -
'0';
27435 static int __Pyx_BufFmt_ExpectNumber(
const char **ts) {
27436 int number = __Pyx_BufFmt_ParseNumber(ts);
27438 PyErr_Format(PyExc_ValueError,\
27439 "Does not understand character buffer dtype format string ('%c')", **ts);
27442 static void __Pyx_BufFmt_RaiseUnexpectedChar(
char ch) {
27443 PyErr_Format(PyExc_ValueError,
27444 "Unexpected format string character: '%c'", ch);
27446 static const char* __Pyx_BufFmt_DescribeTypeChar(
char ch,
int is_complex) {
27448 case '?':
return "'bool'";
27449 case 'c':
return "'char'";
27450 case 'b':
return "'signed char'";
27451 case 'B':
return "'unsigned char'";
27452 case 'h':
return "'short'";
27453 case 'H':
return "'unsigned short'";
27454 case 'i':
return "'int'";
27455 case 'I':
return "'unsigned int'";
27456 case 'l':
return "'long'";
27457 case 'L':
return "'unsigned long'";
27458 case 'q':
return "'long long'";
27459 case 'Q':
return "'unsigned long long'";
27460 case 'f':
return (is_complex ?
"'complex float'" :
"'float'");
27461 case 'd':
return (is_complex ?
"'complex double'" :
"'double'");
27462 case 'g':
return (is_complex ?
"'complex long double'" :
"'long double'");
27463 case 'T':
return "a struct";
27464 case 'O':
return "Python object";
27465 case 'P':
return "a pointer";
27466 case 's':
case 'p':
return "a string";
27467 case 0:
return "end";
27468 default:
return "unparseable format string";
27471 static size_t __Pyx_BufFmt_TypeCharToStandardSize(
char ch,
int is_complex) {
27473 case '?':
case 'c':
case 'b':
case 'B':
case 's':
case 'p':
return 1;
27474 case 'h':
case 'H':
return 2;
27475 case 'i':
case 'I':
case 'l':
case 'L':
return 4;
27476 case 'q':
case 'Q':
return 8;
27477 case 'f':
return (is_complex ? 8 : 4);
27478 case 'd':
return (is_complex ? 16 : 8);
27480 PyErr_SetString(PyExc_ValueError,
"Python does not define a standard format string size for long double ('g')..");
27483 case 'O':
case 'P':
return sizeof(
void*);
27485 __Pyx_BufFmt_RaiseUnexpectedChar(ch);
27489 static size_t __Pyx_BufFmt_TypeCharToNativeSize(
char ch,
int is_complex) {
27491 case '?':
case 'c':
case 'b':
case 'B':
case 's':
case 'p':
return 1;
27492 case 'h':
case 'H':
return sizeof(short);
27493 case 'i':
case 'I':
return sizeof(int);
27494 case 'l':
case 'L':
return sizeof(long);
27495 #ifdef HAVE_LONG_LONG
27496 case 'q':
case 'Q':
return sizeof(PY_LONG_LONG);
27498 case 'f':
return sizeof(float) * (is_complex ? 2 : 1);
27499 case 'd':
return sizeof(double) * (is_complex ? 2 : 1);
27500 case 'g':
return sizeof(
long double) * (is_complex ? 2 : 1);
27501 case 'O':
case 'P':
return sizeof(
void*);
27503 __Pyx_BufFmt_RaiseUnexpectedChar(ch);
27508 typedef struct {
char c;
short x; } __Pyx_st_short;
27509 typedef struct {
char c;
int x; } __Pyx_st_int;
27510 typedef struct {
char c;
long x; } __Pyx_st_long;
27511 typedef struct {
char c;
float x; } __Pyx_st_float;
27512 typedef struct {
char c;
double x; } __Pyx_st_double;
27513 typedef struct {
char c;
long double x; } __Pyx_st_longdouble;
27514 typedef struct {
char c;
void *x; } __Pyx_st_void_p;
27515 #ifdef HAVE_LONG_LONG
27516 typedef struct {
char c; PY_LONG_LONG x; } __Pyx_st_longlong;
27518 static size_t __Pyx_BufFmt_TypeCharToAlignment(
char ch, CYTHON_UNUSED
int is_complex) {
27520 case '?':
case 'c':
case 'b':
case 'B':
case 's':
case 'p':
return 1;
27521 case 'h':
case 'H':
return sizeof(__Pyx_st_short) -
sizeof(
short);
27522 case 'i':
case 'I':
return sizeof(__Pyx_st_int) -
sizeof(
int);
27523 case 'l':
case 'L':
return sizeof(__Pyx_st_long) -
sizeof(
long);
27524 #ifdef HAVE_LONG_LONG
27525 case 'q':
case 'Q':
return sizeof(__Pyx_st_longlong) -
sizeof(PY_LONG_LONG);
27527 case 'f':
return sizeof(__Pyx_st_float) -
sizeof(
float);
27528 case 'd':
return sizeof(__Pyx_st_double) -
sizeof(
double);
27529 case 'g':
return sizeof(__Pyx_st_longdouble) -
sizeof(
long double);
27530 case 'P':
case 'O':
return sizeof(__Pyx_st_void_p) -
sizeof(
void*);
27532 __Pyx_BufFmt_RaiseUnexpectedChar(ch);
27540 typedef struct {
short x;
char c; } __Pyx_pad_short;
27541 typedef struct {
int x;
char c; } __Pyx_pad_int;
27542 typedef struct {
long x;
char c; } __Pyx_pad_long;
27543 typedef struct {
float x;
char c; } __Pyx_pad_float;
27544 typedef struct {
double x;
char c; } __Pyx_pad_double;
27545 typedef struct {
long double x;
char c; } __Pyx_pad_longdouble;
27546 typedef struct {
void *x;
char c; } __Pyx_pad_void_p;
27547 #ifdef HAVE_LONG_LONG
27548 typedef struct { PY_LONG_LONG x;
char c; } __Pyx_pad_longlong;
27550 static size_t __Pyx_BufFmt_TypeCharToPadding(
char ch, CYTHON_UNUSED
int is_complex) {
27552 case '?':
case 'c':
case 'b':
case 'B':
case 's':
case 'p':
return 1;
27553 case 'h':
case 'H':
return sizeof(__Pyx_pad_short) -
sizeof(
short);
27554 case 'i':
case 'I':
return sizeof(__Pyx_pad_int) -
sizeof(
int);
27555 case 'l':
case 'L':
return sizeof(__Pyx_pad_long) -
sizeof(
long);
27556 #ifdef HAVE_LONG_LONG
27557 case 'q':
case 'Q':
return sizeof(__Pyx_pad_longlong) -
sizeof(PY_LONG_LONG);
27559 case 'f':
return sizeof(__Pyx_pad_float) -
sizeof(
float);
27560 case 'd':
return sizeof(__Pyx_pad_double) -
sizeof(
double);
27561 case 'g':
return sizeof(__Pyx_pad_longdouble) -
sizeof(
long double);
27562 case 'P':
case 'O':
return sizeof(__Pyx_pad_void_p) -
sizeof(
void*);
27564 __Pyx_BufFmt_RaiseUnexpectedChar(ch);
27568 static char __Pyx_BufFmt_TypeCharToGroup(
char ch,
int is_complex) {
27572 case 'b':
case 'h':
case 'i':
27573 case 'l':
case 'q':
case 's':
case 'p':
27575 case '?':
case 'B':
case 'H':
case 'I':
case 'L':
case 'Q':
27577 case 'f':
case 'd':
case 'g':
27578 return (is_complex ?
'C' :
'R');
27584 __Pyx_BufFmt_RaiseUnexpectedChar(ch);
27589 static void __Pyx_BufFmt_RaiseExpected(__Pyx_BufFmt_Context* ctx) {
27590 if (ctx->head == NULL || ctx->head->field == &ctx->root) {
27591 const char* expected;
27593 if (ctx->head == NULL) {
27597 expected = ctx->head->field->type->name;
27600 PyErr_Format(PyExc_ValueError,
27601 "Buffer dtype mismatch, expected %s%s%s but got %s",
27602 quote, expected, quote,
27603 __Pyx_BufFmt_DescribeTypeChar(ctx->enc_type, ctx->is_complex));
27605 __Pyx_StructField* field = ctx->head->field;
27606 __Pyx_StructField* parent = (ctx->head - 1)->field;
27607 PyErr_Format(PyExc_ValueError,
27608 "Buffer dtype mismatch, expected '%s' but got %s in '%s.%s'",
27609 field->type->name, __Pyx_BufFmt_DescribeTypeChar(ctx->enc_type, ctx->is_complex),
27610 parent->type->name, field->name);
27613 static int __Pyx_BufFmt_ProcessTypeChunk(__Pyx_BufFmt_Context* ctx) {
27615 size_t size, offset, arraysize = 1;
27616 if (ctx->enc_type == 0)
return 0;
27617 if (ctx->head->field->type->arraysize[0]) {
27619 if (ctx->enc_type ==
's' || ctx->enc_type ==
'p') {
27620 ctx->is_valid_array = ctx->head->field->type->ndim == 1;
27622 if (ctx->enc_count != ctx->head->field->type->arraysize[0]) {
27623 PyErr_Format(PyExc_ValueError,
27624 "Expected a dimension of size %zu, got %zu",
27625 ctx->head->field->type->arraysize[0], ctx->enc_count);
27629 if (!ctx->is_valid_array) {
27630 PyErr_Format(PyExc_ValueError,
"Expected %d dimensions, got %d",
27631 ctx->head->field->type->ndim, ndim);
27634 for (i = 0; i < ctx->head->field->type->ndim; i++) {
27635 arraysize *= ctx->head->field->type->arraysize[i];
27637 ctx->is_valid_array = 0;
27638 ctx->enc_count = 1;
27640 group = __Pyx_BufFmt_TypeCharToGroup(ctx->enc_type, ctx->is_complex);
27642 __Pyx_StructField* field = ctx->head->field;
27643 __Pyx_TypeInfo* type = field->type;
27644 if (ctx->enc_packmode ==
'@' || ctx->enc_packmode ==
'^') {
27645 size = __Pyx_BufFmt_TypeCharToNativeSize(ctx->enc_type, ctx->is_complex);
27647 size = __Pyx_BufFmt_TypeCharToStandardSize(ctx->enc_type, ctx->is_complex);
27649 if (ctx->enc_packmode ==
'@') {
27650 size_t align_at = __Pyx_BufFmt_TypeCharToAlignment(ctx->enc_type, ctx->is_complex);
27651 size_t align_mod_offset;
27652 if (align_at == 0)
return -1;
27653 align_mod_offset = ctx->fmt_offset % align_at;
27654 if (align_mod_offset > 0) ctx->fmt_offset += align_at - align_mod_offset;
27655 if (ctx->struct_alignment == 0)
27656 ctx->struct_alignment = __Pyx_BufFmt_TypeCharToPadding(ctx->enc_type,
27659 if (type->size != size || type->typegroup != group) {
27660 if (type->typegroup ==
'C' && type->fields != NULL) {
27661 size_t parent_offset = ctx->head->parent_offset + field->offset;
27663 ctx->head->field = type->fields;
27664 ctx->head->parent_offset = parent_offset;
27667 if ((type->typegroup ==
'H' || group ==
'H') && type->size == size) {
27669 __Pyx_BufFmt_RaiseExpected(ctx);
27673 offset = ctx->head->parent_offset + field->offset;
27674 if (ctx->fmt_offset != offset) {
27675 PyErr_Format(PyExc_ValueError,
27676 "Buffer dtype mismatch; next field is at offset %" CYTHON_FORMAT_SSIZE_T
"d but %" CYTHON_FORMAT_SSIZE_T
"d expected",
27677 (Py_ssize_t)ctx->fmt_offset, (Py_ssize_t)offset);
27680 ctx->fmt_offset += size;
27682 ctx->fmt_offset += (arraysize - 1) * size;
27685 if (field == &ctx->root) {
27687 if (ctx->enc_count != 0) {
27688 __Pyx_BufFmt_RaiseExpected(ctx);
27693 ctx->head->field = ++field;
27694 if (field->type == NULL) {
27696 field = ctx->head->field;
27698 }
else if (field->type->typegroup ==
'S') {
27699 size_t parent_offset = ctx->head->parent_offset + field->offset;
27700 if (field->type->fields->type == NULL)
continue;
27701 field = field->type->fields;
27703 ctx->head->field = field;
27704 ctx->head->parent_offset = parent_offset;
27710 }
while (ctx->enc_count);
27712 ctx->is_complex = 0;
27716 __pyx_buffmt_parse_array(__Pyx_BufFmt_Context* ctx,
const char** tsp)
27718 const char *ts = *tsp;
27719 int i = 0,
number, ndim;
27721 if (ctx->new_count != 1) {
27722 PyErr_SetString(PyExc_ValueError,
27723 "Cannot handle repeated arrays in format string");
27726 if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1)
return NULL;
27727 ndim = ctx->head->field->type->ndim;
27728 while (*ts && *ts !=
')') {
27730 case ' ':
case '\f':
case '\r':
case '\n':
case '\t':
case '\v':
continue;
27733 number = __Pyx_BufFmt_ExpectNumber(&ts);
27734 if (
number == -1)
return NULL;
27735 if (i < ndim && (
size_t)
number != ctx->head->field->type->arraysize[i])
27736 return PyErr_Format(PyExc_ValueError,
27737 "Expected a dimension of size %zu, got %d",
27738 ctx->head->field->type->arraysize[i],
number);
27739 if (*ts !=
',' && *ts !=
')')
27740 return PyErr_Format(PyExc_ValueError,
27741 "Expected a comma in format string, got '%c'", *ts);
27742 if (*ts ==
',') ts++;
27746 return PyErr_Format(PyExc_ValueError,
"Expected %d dimension(s), got %d",
27747 ctx->head->field->type->ndim, i);
27749 PyErr_SetString(PyExc_ValueError,
27750 "Unexpected end of format string, expected ')'");
27753 ctx->is_valid_array = 1;
27754 ctx->new_count = 1;
27758 static const char* __Pyx_BufFmt_CheckString(__Pyx_BufFmt_Context* ctx,
const char* ts) {
27763 if (ctx->enc_type != 0 && ctx->head == NULL) {
27764 __Pyx_BufFmt_RaiseExpected(ctx);
27767 if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1)
return NULL;
27768 if (ctx->head != NULL) {
27769 __Pyx_BufFmt_RaiseExpected(ctx);
27779 if (!__Pyx_Is_Little_Endian()) {
27780 PyErr_SetString(PyExc_ValueError,
"Little-endian buffer not supported on big-endian compiler");
27783 ctx->new_packmode =
'=';
27788 if (__Pyx_Is_Little_Endian()) {
27789 PyErr_SetString(PyExc_ValueError,
"Big-endian buffer not supported on little-endian compiler");
27792 ctx->new_packmode =
'=';
27798 ctx->new_packmode = *ts++;
27802 const char* ts_after_sub;
27803 size_t i, struct_count = ctx->new_count;
27804 size_t struct_alignment = ctx->struct_alignment;
27805 ctx->new_count = 1;
27808 PyErr_SetString(PyExc_ValueError,
"Buffer acquisition: Expected '{' after 'T'");
27811 if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1)
return NULL;
27813 ctx->enc_count = 0;
27814 ctx->struct_alignment = 0;
27817 for (i = 0; i != struct_count; ++i) {
27818 ts_after_sub = __Pyx_BufFmt_CheckString(ctx, ts);
27819 if (!ts_after_sub)
return NULL;
27822 if (struct_alignment) ctx->struct_alignment = struct_alignment;
27827 size_t alignment = ctx->struct_alignment;
27829 if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1)
return NULL;
27831 if (alignment && ctx->fmt_offset % alignment) {
27832 ctx->fmt_offset += alignment - (ctx->fmt_offset % alignment);
27837 if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1)
return NULL;
27838 ctx->fmt_offset += ctx->new_count;
27839 ctx->new_count = 1;
27840 ctx->enc_count = 0;
27842 ctx->enc_packmode = ctx->new_packmode;
27848 if (*ts !=
'f' && *ts !=
'd' && *ts !=
'g') {
27849 __Pyx_BufFmt_RaiseUnexpectedChar(
'Z');
27852 CYTHON_FALLTHROUGH;
27853 case '?':
case 'c':
case 'b':
case 'B':
case 'h':
case 'H':
case 'i':
case 'I':
27854 case 'l':
case 'L':
case 'q':
case 'Q':
27855 case 'f':
case 'd':
case 'g':
27856 case 'O':
case 'p':
27857 if ((ctx->enc_type == *ts) && (got_Z == ctx->is_complex) &&
27858 (ctx->enc_packmode == ctx->new_packmode) && (!ctx->is_valid_array)) {
27859 ctx->enc_count += ctx->new_count;
27860 ctx->new_count = 1;
27865 CYTHON_FALLTHROUGH;
27867 if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1)
return NULL;
27868 ctx->enc_count = ctx->new_count;
27869 ctx->enc_packmode = ctx->new_packmode;
27870 ctx->enc_type = *ts;
27871 ctx->is_complex = got_Z;
27873 ctx->new_count = 1;
27878 while(*ts !=
':') ++ts;
27882 if (!__pyx_buffmt_parse_array(ctx, &ts))
return NULL;
27886 int number = __Pyx_BufFmt_ExpectNumber(&ts);
27887 if (
number == -1)
return NULL;
27888 ctx->new_count = (size_t)
number;
27896 __pyx_typeinfo_cmp(__Pyx_TypeInfo *a, __Pyx_TypeInfo *b)
27903 if (a->size != b->size || a->typegroup != b->typegroup ||
27904 a->is_unsigned != b->is_unsigned || a->ndim != b->ndim) {
27905 if (a->typegroup ==
'H' || b->typegroup ==
'H') {
27906 return a->size == b->size;
27912 for (i = 0; i < a->ndim; i++)
27913 if (a->arraysize[i] != b->arraysize[i])
27916 if (a->typegroup ==
'S') {
27917 if (a->flags != b->flags)
27919 if (a->fields || b->fields) {
27920 if (!(a->fields && b->fields))
27922 for (i = 0; a->fields[i].type && b->fields[i].type; i++) {
27923 __Pyx_StructField *field_a = a->fields + i;
27924 __Pyx_StructField *field_b = b->fields + i;
27925 if (field_a->offset != field_b->offset ||
27926 !__pyx_typeinfo_cmp(field_a->type, field_b->type))
27929 return !a->fields[i].type && !b->fields[i].type;
27937 __pyx_check_strides(Py_buffer *buf,
int dim,
int ndim,
int spec)
27939 if (buf->shape[dim] <= 1)
27941 if (buf->strides) {
27942 if (spec & __Pyx_MEMVIEW_CONTIG) {
27943 if (spec & (__Pyx_MEMVIEW_PTR|__Pyx_MEMVIEW_FULL)) {
27944 if (unlikely(buf->strides[dim] !=
sizeof(
void *))) {
27945 PyErr_Format(PyExc_ValueError,
27946 "Buffer is not indirectly contiguous "
27947 "in dimension %d.", dim);
27950 }
else if (unlikely(buf->strides[dim] != buf->itemsize)) {
27951 PyErr_SetString(PyExc_ValueError,
27952 "Buffer and memoryview are not contiguous "
27953 "in the same dimension.");
27957 if (spec & __Pyx_MEMVIEW_FOLLOW) {
27958 Py_ssize_t stride = buf->strides[dim];
27961 if (unlikely(stride < buf->itemsize)) {
27962 PyErr_SetString(PyExc_ValueError,
27963 "Buffer and memoryview are not contiguous "
27964 "in the same dimension.");
27969 if (unlikely(spec & __Pyx_MEMVIEW_CONTIG && dim != ndim - 1)) {
27970 PyErr_Format(PyExc_ValueError,
27971 "C-contiguous buffer is not contiguous in "
27972 "dimension %d", dim);
27974 }
else if (unlikely(spec & (__Pyx_MEMVIEW_PTR))) {
27975 PyErr_Format(PyExc_ValueError,
27976 "C-contiguous buffer is not indirect in "
27977 "dimension %d", dim);
27979 }
else if (unlikely(buf->suboffsets)) {
27980 PyErr_SetString(PyExc_ValueError,
27981 "Buffer exposes suboffsets but no strides");
27990 __pyx_check_suboffsets(Py_buffer *buf,
int dim, CYTHON_UNUSED
int ndim,
int spec)
27992 if (spec & __Pyx_MEMVIEW_DIRECT) {
27993 if (unlikely(buf->suboffsets && buf->suboffsets[dim] >= 0)) {
27994 PyErr_Format(PyExc_ValueError,
27995 "Buffer not compatible with direct access "
27996 "in dimension %d.", dim);
28000 if (spec & __Pyx_MEMVIEW_PTR) {
28001 if (unlikely(!buf->suboffsets || (buf->suboffsets[dim] < 0))) {
28002 PyErr_Format(PyExc_ValueError,
28003 "Buffer is not indirectly accessible "
28004 "in dimension %d.", dim);
28013 __pyx_verify_contig(Py_buffer *buf,
int ndim,
int c_or_f_flag)
28016 if (c_or_f_flag & __Pyx_IS_F_CONTIG) {
28017 Py_ssize_t stride = 1;
28018 for (i = 0; i < ndim; i++) {
28019 if (unlikely(stride * buf->itemsize != buf->strides[i] && buf->shape[i] > 1)) {
28020 PyErr_SetString(PyExc_ValueError,
28021 "Buffer not fortran contiguous.");
28024 stride = stride * buf->shape[i];
28026 }
else if (c_or_f_flag & __Pyx_IS_C_CONTIG) {
28027 Py_ssize_t stride = 1;
28028 for (i = ndim - 1; i >- 1; i--) {
28029 if (unlikely(stride * buf->itemsize != buf->strides[i] && buf->shape[i] > 1)) {
28030 PyErr_SetString(PyExc_ValueError,
28031 "Buffer not C contiguous.");
28034 stride = stride * buf->shape[i];
28041 static int __Pyx_ValidateAndInit_memviewslice(
28046 __Pyx_TypeInfo *dtype,
28047 __Pyx_BufFmt_StackElem stack[],
28048 __Pyx_memviewslice *memviewslice,
28049 PyObject *original_obj)
28051 struct __pyx_memoryview_obj *memview, *new_memview;
28052 __Pyx_RefNannyDeclarations
28054 int i, spec = 0, retval = -1;
28055 __Pyx_BufFmt_Context ctx;
28056 int from_memoryview = __pyx_memoryview_check(original_obj);
28057 __Pyx_RefNannySetupContext(
"ValidateAndInit_memviewslice", 0);
28058 if (from_memoryview && __pyx_typeinfo_cmp(dtype, ((
struct __pyx_memoryview_obj *)
28059 original_obj)->typeinfo)) {
28060 memview = (
struct __pyx_memoryview_obj *) original_obj;
28061 new_memview = NULL;
28063 memview = (
struct __pyx_memoryview_obj *) __pyx_memoryview_new(
28064 original_obj, buf_flags, 0, dtype);
28065 new_memview = memview;
28066 if (unlikely(!memview))
28069 buf = &memview->view;
28070 if (unlikely(buf->ndim != ndim)) {
28071 PyErr_Format(PyExc_ValueError,
28072 "Buffer has wrong number of dimensions (expected %d, got %d)",
28077 __Pyx_BufFmt_Init(&ctx, stack, dtype);
28078 if (unlikely(!__Pyx_BufFmt_CheckString(&ctx, buf->format)))
goto fail;
28080 if (unlikely((
unsigned) buf->itemsize != dtype->size)) {
28081 PyErr_Format(PyExc_ValueError,
28082 "Item size of buffer (%" CYTHON_FORMAT_SSIZE_T
"u byte%s) "
28083 "does not match size of '%s' (%" CYTHON_FORMAT_SSIZE_T
"u byte%s)",
28085 (buf->itemsize > 1) ?
"s" :
"",
28088 (dtype->size > 1) ?
"s" :
"");
28091 if (buf->len > 0) {
28092 for (i = 0; i < ndim; i++) {
28093 spec = axes_specs[i];
28094 if (unlikely(!__pyx_check_strides(buf, i, ndim, spec)))
28096 if (unlikely(!__pyx_check_suboffsets(buf, i, ndim, spec)))
28099 if (unlikely(buf->strides && !__pyx_verify_contig(buf, ndim, c_or_f_flag)))
28102 if (unlikely(__Pyx_init_memviewslice(memview, ndim, memviewslice,
28103 new_memview != NULL) == -1)) {
28109 Py_XDECREF(new_memview);
28112 __Pyx_RefNannyFinishContext();
28117 static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_ds_double(PyObject *obj,
int writable_flag) {
28118 __Pyx_memviewslice result = { 0, 0, { 0 }, { 0 }, { 0 } };
28119 __Pyx_BufFmt_StackElem stack[1];
28120 int axes_specs[] = { (__Pyx_MEMVIEW_DIRECT | __Pyx_MEMVIEW_STRIDED) };
28122 if (obj == Py_None) {
28123 result.memview = (
struct __pyx_memoryview_obj *) Py_None;
28126 retcode = __Pyx_ValidateAndInit_memviewslice(axes_specs, 0,
28127 PyBUF_RECORDS_RO | writable_flag, 1,
28128 &__Pyx_TypeInfo_double, stack,
28130 if (unlikely(retcode == -1))
28134 result.memview = NULL;
28135 result.data = NULL;
28140 #define __PYX_VERIFY_RETURN_INT(target_type, func_type, func_value)\
28141 __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 0)
28142 #define __PYX_VERIFY_RETURN_INT_EXC(target_type, func_type, func_value)\
28143 __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 1)
28144 #define __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, exc)\
28146 func_type value = func_value;\
28147 if (sizeof(target_type) < sizeof(func_type)) {\
28148 if (unlikely(value != (func_type) (target_type) value)) {\
28149 func_type zero = 0;\
28150 if (exc && unlikely(value == (func_type)-1 && PyErr_Occurred()))\
28151 return (target_type) -1;\
28152 if (is_unsigned && unlikely(value < zero))\
28153 goto raise_neg_overflow;\
28155 goto raise_overflow;\
28158 return (target_type) value;\
28162 #if CYTHON_CCOMPLEX
28164 static CYTHON_INLINE __pyx_t_float_complex __pyx_t_float_complex_from_parts(
float x,
float y) {
28165 return ::std::complex< float >(x, y);
28168 static CYTHON_INLINE __pyx_t_float_complex __pyx_t_float_complex_from_parts(
float x,
float y) {
28169 return x + y*(__pyx_t_float_complex)_Complex_I;
28173 static CYTHON_INLINE __pyx_t_float_complex __pyx_t_float_complex_from_parts(
float x,
float y) {
28174 __pyx_t_float_complex
z;
28182 #if CYTHON_CCOMPLEX
28184 static CYTHON_INLINE
int __Pyx_c_eq_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
28185 return (a.real == b.real) && (a.imag == b.imag);
28187 static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_sum_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
28188 __pyx_t_float_complex
z;
28189 z.real = a.real + b.real;
28190 z.imag = a.imag + b.imag;
28193 static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_diff_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
28194 __pyx_t_float_complex
z;
28195 z.real = a.real - b.real;
28196 z.imag = a.imag - b.imag;
28199 static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_prod_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
28200 __pyx_t_float_complex
z;
28201 z.real = a.real * b.real - a.imag * b.imag;
28202 z.imag = a.real * b.imag + a.imag * b.real;
28206 static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_quot_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
28208 return __pyx_t_float_complex_from_parts(a.real / b.real, a.imag / b.real);
28209 }
else if (fabsf(b.real) >= fabsf(b.imag)) {
28210 if (b.real == 0 && b.imag == 0) {
28211 return __pyx_t_float_complex_from_parts(a.real / b.real, a.imag / b.imag);
28213 float r = b.imag / b.real;
28214 float s = (float)(1.0) / (b.real + b.imag *
r);
28215 return __pyx_t_float_complex_from_parts(
28216 (a.real + a.imag *
r) *
s, (a.imag - a.real *
r) *
s);
28219 float r = b.real / b.imag;
28220 float s = (float)(1.0) / (b.imag + b.real *
r);
28221 return __pyx_t_float_complex_from_parts(
28222 (a.real *
r + a.imag) *
s, (a.imag *
r - a.real) *
s);
28226 static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_quot_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
28228 return __pyx_t_float_complex_from_parts(a.real / b.real, a.imag / b.real);
28230 float denom = b.real * b.real + b.imag * b.imag;
28231 return __pyx_t_float_complex_from_parts(
28232 (a.real * b.real + a.imag * b.imag) / denom,
28233 (a.imag * b.real - a.real * b.imag) / denom);
28237 static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_neg_float(__pyx_t_float_complex a) {
28238 __pyx_t_float_complex
z;
28243 static CYTHON_INLINE
int __Pyx_c_is_zero_float(__pyx_t_float_complex a) {
28244 return (a.real == 0) && (a.imag == 0);
28246 static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_conj_float(__pyx_t_float_complex a) {
28247 __pyx_t_float_complex
z;
28253 static CYTHON_INLINE
float __Pyx_c_abs_float(__pyx_t_float_complex
z) {
28254 #if !defined(HAVE_HYPOT) || defined(_MSC_VER)
28255 return sqrtf(
z.real*
z.real +
z.imag*
z.imag);
28257 return hypotf(
z.real,
z.imag);
28260 static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_pow_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
28261 __pyx_t_float_complex
z;
28262 float r, lnr, theta, z_r, z_theta;
28263 if (b.imag == 0 && b.real == (
int)b.real) {
28265 float denom = a.real * a.real + a.imag * a.imag;
28266 a.real = a.real / denom;
28267 a.imag = -a.imag / denom;
28270 switch ((
int)b.real) {
28278 return __Pyx_c_prod_float(a, a);
28280 z = __Pyx_c_prod_float(a, a);
28281 return __Pyx_c_prod_float(
z, a);
28283 z = __Pyx_c_prod_float(a, a);
28284 return __Pyx_c_prod_float(
z,
z);
28290 }
else if (b.imag == 0) {
28291 z.real = powf(a.real, b.real);
28294 }
else if (a.real > 0) {
28299 theta = atan2f(0.0, -1.0);
28302 r = __Pyx_c_abs_float(a);
28303 theta = atan2f(a.imag, a.real);
28306 z_r = expf(lnr * b.real - theta * b.imag);
28307 z_theta = theta * b.real + lnr * b.imag;
28308 z.real = z_r * cosf(z_theta);
28309 z.imag = z_r * sinf(z_theta);
28316 #if CYTHON_CCOMPLEX
28318 static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(
double x,
double y) {
28319 return ::std::complex< double >(x, y);
28322 static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(
double x,
double y) {
28323 return x + y*(__pyx_t_double_complex)_Complex_I;
28327 static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(
double x,
double y) {
28328 __pyx_t_double_complex
z;
28336 #if CYTHON_CCOMPLEX
28338 static CYTHON_INLINE
int __Pyx_c_eq_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
28339 return (a.real == b.real) && (a.imag == b.imag);
28341 static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_sum_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
28342 __pyx_t_double_complex
z;
28343 z.real = a.real + b.real;
28344 z.imag = a.imag + b.imag;
28347 static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_diff_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
28348 __pyx_t_double_complex
z;
28349 z.real = a.real - b.real;
28350 z.imag = a.imag - b.imag;
28353 static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_prod_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
28354 __pyx_t_double_complex
z;
28355 z.real = a.real * b.real - a.imag * b.imag;
28356 z.imag = a.real * b.imag + a.imag * b.real;
28360 static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_quot_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
28362 return __pyx_t_double_complex_from_parts(a.real / b.real, a.imag / b.real);
28363 }
else if (fabs(b.real) >= fabs(b.imag)) {
28364 if (b.real == 0 && b.imag == 0) {
28365 return __pyx_t_double_complex_from_parts(a.real / b.real, a.imag / b.imag);
28367 double r = b.imag / b.real;
28368 double s = (double)(1.0) / (b.real + b.imag *
r);
28369 return __pyx_t_double_complex_from_parts(
28370 (a.real + a.imag *
r) *
s, (a.imag - a.real *
r) *
s);
28373 double r = b.real / b.imag;
28374 double s = (double)(1.0) / (b.imag + b.real *
r);
28375 return __pyx_t_double_complex_from_parts(
28376 (a.real *
r + a.imag) *
s, (a.imag *
r - a.real) *
s);
28380 static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_quot_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
28382 return __pyx_t_double_complex_from_parts(a.real / b.real, a.imag / b.real);
28384 double denom = b.real * b.real + b.imag * b.imag;
28385 return __pyx_t_double_complex_from_parts(
28386 (a.real * b.real + a.imag * b.imag) / denom,
28387 (a.imag * b.real - a.real * b.imag) / denom);
28391 static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_neg_double(__pyx_t_double_complex a) {
28392 __pyx_t_double_complex
z;
28397 static CYTHON_INLINE
int __Pyx_c_is_zero_double(__pyx_t_double_complex a) {
28398 return (a.real == 0) && (a.imag == 0);
28400 static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_conj_double(__pyx_t_double_complex a) {
28401 __pyx_t_double_complex
z;
28407 static CYTHON_INLINE
double __Pyx_c_abs_double(__pyx_t_double_complex
z) {
28408 #if !defined(HAVE_HYPOT) || defined(_MSC_VER)
28409 return sqrt(
z.real*
z.real +
z.imag*
z.imag);
28411 return hypot(
z.real,
z.imag);
28414 static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_pow_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
28415 __pyx_t_double_complex
z;
28416 double r, lnr, theta, z_r, z_theta;
28417 if (b.imag == 0 && b.real == (
int)b.real) {
28419 double denom = a.real * a.real + a.imag * a.imag;
28420 a.real = a.real / denom;
28421 a.imag = -a.imag / denom;
28424 switch ((
int)b.real) {
28432 return __Pyx_c_prod_double(a, a);
28434 z = __Pyx_c_prod_double(a, a);
28435 return __Pyx_c_prod_double(
z, a);
28437 z = __Pyx_c_prod_double(a, a);
28438 return __Pyx_c_prod_double(
z,
z);
28444 }
else if (b.imag == 0) {
28445 z.real = pow(a.real, b.real);
28448 }
else if (a.real > 0) {
28453 theta = atan2(0.0, -1.0);
28456 r = __Pyx_c_abs_double(a);
28457 theta = atan2(a.imag, a.real);
28460 z_r = exp(lnr * b.real - theta * b.imag);
28461 z_theta = theta * b.real + lnr * b.imag;
28462 z.real = z_r * cos(z_theta);
28463 z.imag = z_r * sin(z_theta);
28470 static __Pyx_memviewslice
28471 __pyx_memoryview_copy_new_contig(
const __Pyx_memviewslice *from_mvs,
28472 const char *mode,
int ndim,
28473 size_t sizeof_dtype,
int contig_flag,
28474 int dtype_is_object)
28476 __Pyx_RefNannyDeclarations
28478 __Pyx_memviewslice new_mvs = { 0, 0, { 0 }, { 0 }, { 0 } };
28479 struct __pyx_memoryview_obj *from_memview = from_mvs->memview;
28480 Py_buffer *buf = &from_memview->view;
28481 PyObject *shape_tuple = NULL;
28482 PyObject *temp_int = NULL;
28483 struct __pyx_array_obj *array_obj = NULL;
28484 struct __pyx_memoryview_obj *memview_obj = NULL;
28485 __Pyx_RefNannySetupContext(
"__pyx_memoryview_copy_new_contig", 0);
28486 for (i = 0; i < ndim; i++) {
28487 if (unlikely(from_mvs->suboffsets[i] >= 0)) {
28488 PyErr_Format(PyExc_ValueError,
"Cannot copy memoryview slice with "
28489 "indirect dimensions (axis %d)", i);
28493 shape_tuple = PyTuple_New(ndim);
28494 if (unlikely(!shape_tuple)) {
28497 __Pyx_GOTREF(shape_tuple);
28498 for(i = 0; i < ndim; i++) {
28499 temp_int = PyInt_FromSsize_t(from_mvs->shape[i]);
28500 if(unlikely(!temp_int)) {
28503 PyTuple_SET_ITEM(shape_tuple, i, temp_int);
28507 array_obj = __pyx_array_new(shape_tuple, sizeof_dtype, buf->format, (
char *) mode, NULL);
28508 if (unlikely(!array_obj)) {
28511 __Pyx_GOTREF(array_obj);
28512 memview_obj = (
struct __pyx_memoryview_obj *) __pyx_memoryview_new(
28513 (PyObject *) array_obj, contig_flag,
28515 from_mvs->memview->typeinfo);
28516 if (unlikely(!memview_obj))
28518 if (unlikely(__Pyx_init_memviewslice(memview_obj, ndim, &new_mvs, 1) < 0))
28520 if (unlikely(__pyx_memoryview_copy_contents(*from_mvs, new_mvs, ndim, ndim,
28521 dtype_is_object) < 0))
28525 __Pyx_XDECREF(new_mvs.memview);
28526 new_mvs.memview = NULL;
28527 new_mvs.data = NULL;
28529 __Pyx_XDECREF(shape_tuple);
28530 __Pyx_XDECREF(temp_int);
28531 __Pyx_XDECREF(array_obj);
28532 __Pyx_RefNannyFinishContext();
28537 static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(
int value) {
28538 #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
28539 #pragma GCC diagnostic push
28540 #pragma GCC diagnostic ignored "-Wconversion"
28542 const int neg_one = (int) -1, const_zero = (
int) 0;
28543 #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
28544 #pragma GCC diagnostic pop
28546 const int is_unsigned = neg_one > const_zero;
28548 if (
sizeof(
int) <
sizeof(long)) {
28549 return PyInt_FromLong((
long) value);
28550 }
else if (
sizeof(
int) <=
sizeof(
unsigned long)) {
28551 return PyLong_FromUnsignedLong((
unsigned long) value);
28552 #ifdef HAVE_LONG_LONG
28553 }
else if (
sizeof(
int) <=
sizeof(
unsigned PY_LONG_LONG)) {
28554 return PyLong_FromUnsignedLongLong((
unsigned PY_LONG_LONG) value);
28558 if (
sizeof(
int) <=
sizeof(
long)) {
28559 return PyInt_FromLong((
long) value);
28560 #ifdef HAVE_LONG_LONG
28561 }
else if (
sizeof(
int) <=
sizeof(PY_LONG_LONG)) {
28562 return PyLong_FromLongLong((PY_LONG_LONG) value);
28567 int one = 1;
int little = (int)*(
unsigned char *)&one;
28568 unsigned char *bytes = (
unsigned char *)&value;
28569 return _PyLong_FromByteArray(bytes,
sizeof(
int),
28570 little, !is_unsigned);
28575 static CYTHON_INLINE
int __Pyx_PyInt_As_int(PyObject *x) {
28576 #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
28577 #pragma GCC diagnostic push
28578 #pragma GCC diagnostic ignored "-Wconversion"
28580 const int neg_one = (int) -1, const_zero = (
int) 0;
28581 #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
28582 #pragma GCC diagnostic pop
28584 const int is_unsigned = neg_one > const_zero;
28585 #if PY_MAJOR_VERSION < 3
28586 if (likely(PyInt_Check(x))) {
28587 if (
sizeof(
int) <
sizeof(long)) {
28588 __PYX_VERIFY_RETURN_INT(
int,
long, PyInt_AS_LONG(x))
28590 long val = PyInt_AS_LONG(x);
28591 if (is_unsigned && unlikely(val < 0)) {
28592 goto raise_neg_overflow;
28598 if (likely(PyLong_Check(x))) {
28600 #if CYTHON_USE_PYLONG_INTERNALS
28601 const digit* digits = ((PyLongObject*)x)->ob_digit;
28602 switch (Py_SIZE(x)) {
28603 case 0:
return (
int) 0;
28604 case 1: __PYX_VERIFY_RETURN_INT(
int, digit, digits[0])
28606 if (8 *
sizeof(
int) > 1 * PyLong_SHIFT) {
28607 if (8 *
sizeof(
unsigned long) > 2 * PyLong_SHIFT) {
28608 __PYX_VERIFY_RETURN_INT(
int,
unsigned long, (((((
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
28609 }
else if (8 *
sizeof(
int) >= 2 * PyLong_SHIFT) {
28610 return (
int) (((((int)digits[1]) << PyLong_SHIFT) | (
int)digits[0]));
28615 if (8 *
sizeof(
int) > 2 * PyLong_SHIFT) {
28616 if (8 *
sizeof(
unsigned long) > 3 * PyLong_SHIFT) {
28617 __PYX_VERIFY_RETURN_INT(
int,
unsigned long, (((((((
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
28618 }
else if (8 *
sizeof(
int) >= 3 * PyLong_SHIFT) {
28619 return (
int) (((((((int)digits[2]) << PyLong_SHIFT) | (
int)digits[1]) << PyLong_SHIFT) | (int)digits[0]));
28624 if (8 *
sizeof(
int) > 3 * PyLong_SHIFT) {
28625 if (8 *
sizeof(
unsigned long) > 4 * PyLong_SHIFT) {
28626 __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])))
28627 }
else if (8 *
sizeof(
int) >= 4 * PyLong_SHIFT) {
28628 return (
int) (((((((((int)digits[3]) << PyLong_SHIFT) | (
int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (
int)digits[0]));
28634 #if CYTHON_COMPILING_IN_CPYTHON
28635 if (unlikely(Py_SIZE(x) < 0)) {
28636 goto raise_neg_overflow;
28640 int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
28641 if (unlikely(result < 0))
28643 if (unlikely(result == 1))
28644 goto raise_neg_overflow;
28647 if (
sizeof(
int) <=
sizeof(
unsigned long)) {
28648 __PYX_VERIFY_RETURN_INT_EXC(
int,
unsigned long, PyLong_AsUnsignedLong(x))
28649 #ifdef HAVE_LONG_LONG
28650 }
else if (
sizeof(
int) <=
sizeof(
unsigned PY_LONG_LONG)) {
28651 __PYX_VERIFY_RETURN_INT_EXC(
int,
unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
28655 #if CYTHON_USE_PYLONG_INTERNALS
28656 const digit* digits = ((PyLongObject*)x)->ob_digit;
28657 switch (Py_SIZE(x)) {
28658 case 0:
return (
int) 0;
28659 case -1: __PYX_VERIFY_RETURN_INT(
int, sdigit, (sdigit) (-(sdigit)digits[0]))
28660 case 1: __PYX_VERIFY_RETURN_INT(
int, digit, +digits[0])
28662 if (8 *
sizeof(
int) - 1 > 1 * PyLong_SHIFT) {
28663 if (8 *
sizeof(
unsigned long) > 2 * PyLong_SHIFT) {
28664 __PYX_VERIFY_RETURN_INT(
int,
long, -(
long) (((((
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
28665 }
else if (8 *
sizeof(
int) - 1 > 2 * PyLong_SHIFT) {
28666 return (
int) (((int)-1)*(((((int)digits[1]) << PyLong_SHIFT) | (
int)digits[0])));
28671 if (8 *
sizeof(
int) > 1 * PyLong_SHIFT) {
28672 if (8 *
sizeof(
unsigned long) > 2 * PyLong_SHIFT) {
28673 __PYX_VERIFY_RETURN_INT(
int,
unsigned long, (((((
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
28674 }
else if (8 *
sizeof(
int) - 1 > 2 * PyLong_SHIFT) {
28675 return (
int) ((((((int)digits[1]) << PyLong_SHIFT) | (
int)digits[0])));
28680 if (8 *
sizeof(
int) - 1 > 2 * PyLong_SHIFT) {
28681 if (8 *
sizeof(
unsigned long) > 3 * PyLong_SHIFT) {
28682 __PYX_VERIFY_RETURN_INT(
int,
long, -(
long) (((((((
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
28683 }
else if (8 *
sizeof(
int) - 1 > 3 * PyLong_SHIFT) {
28684 return (
int) (((int)-1)*(((((((int)digits[2]) << PyLong_SHIFT) | (
int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
28689 if (8 *
sizeof(
int) > 2 * PyLong_SHIFT) {
28690 if (8 *
sizeof(
unsigned long) > 3 * PyLong_SHIFT) {
28691 __PYX_VERIFY_RETURN_INT(
int,
unsigned long, (((((((
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
28692 }
else if (8 *
sizeof(
int) - 1 > 3 * PyLong_SHIFT) {
28693 return (
int) ((((((((int)digits[2]) << PyLong_SHIFT) | (
int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
28698 if (8 *
sizeof(
int) - 1 > 3 * PyLong_SHIFT) {
28699 if (8 *
sizeof(
unsigned long) > 4 * PyLong_SHIFT) {
28700 __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])))
28701 }
else if (8 *
sizeof(
int) - 1 > 4 * PyLong_SHIFT) {
28702 return (
int) (((int)-1)*(((((((((int)digits[3]) << PyLong_SHIFT) | (
int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (
int)digits[0])));
28707 if (8 *
sizeof(
int) > 3 * PyLong_SHIFT) {
28708 if (8 *
sizeof(
unsigned long) > 4 * PyLong_SHIFT) {
28709 __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])))
28710 }
else if (8 *
sizeof(
int) - 1 > 4 * PyLong_SHIFT) {
28711 return (
int) ((((((((((int)digits[3]) << PyLong_SHIFT) | (
int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (
int)digits[0])));
28717 if (
sizeof(
int) <=
sizeof(long)) {
28718 __PYX_VERIFY_RETURN_INT_EXC(
int,
long, PyLong_AsLong(x))
28719 #ifdef HAVE_LONG_LONG
28720 }
else if (
sizeof(
int) <=
sizeof(PY_LONG_LONG)) {
28721 __PYX_VERIFY_RETURN_INT_EXC(
int, PY_LONG_LONG, PyLong_AsLongLong(x))
28726 #if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray)
28727 PyErr_SetString(PyExc_RuntimeError,
28728 "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers");
28731 PyObject *
v = __Pyx_PyNumber_IntOrLong(x);
28732 #if PY_MAJOR_VERSION < 3
28733 if (likely(
v) && !PyLong_Check(
v)) {
28735 v = PyNumber_Long(tmp);
28740 int one = 1;
int is_little = (int)*(
unsigned char *)&one;
28741 unsigned char *bytes = (
unsigned char *)&val;
28742 int ret = _PyLong_AsByteArray((PyLongObject *)
v,
28743 bytes,
sizeof(val),
28744 is_little, !is_unsigned);
28754 PyObject *tmp = __Pyx_PyNumber_IntOrLong(x);
28755 if (!tmp)
return (
int) -1;
28756 val = __Pyx_PyInt_As_int(tmp);
28761 PyErr_SetString(PyExc_OverflowError,
28762 "value too large to convert to int");
28764 raise_neg_overflow:
28765 PyErr_SetString(PyExc_OverflowError,
28766 "can't convert negative value to int");
28771 static CYTHON_INLINE
long __Pyx_PyInt_As_long(PyObject *x) {
28772 #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
28773 #pragma GCC diagnostic push
28774 #pragma GCC diagnostic ignored "-Wconversion"
28776 const long neg_one = (long) -1, const_zero = (
long) 0;
28777 #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
28778 #pragma GCC diagnostic pop
28780 const int is_unsigned = neg_one > const_zero;
28781 #if PY_MAJOR_VERSION < 3
28782 if (likely(PyInt_Check(x))) {
28783 if (
sizeof(
long) <
sizeof(long)) {
28784 __PYX_VERIFY_RETURN_INT(
long,
long, PyInt_AS_LONG(x))
28786 long val = PyInt_AS_LONG(x);
28787 if (is_unsigned && unlikely(val < 0)) {
28788 goto raise_neg_overflow;
28794 if (likely(PyLong_Check(x))) {
28796 #if CYTHON_USE_PYLONG_INTERNALS
28797 const digit* digits = ((PyLongObject*)x)->ob_digit;
28798 switch (Py_SIZE(x)) {
28799 case 0:
return (
long) 0;
28800 case 1: __PYX_VERIFY_RETURN_INT(
long, digit, digits[0])
28802 if (8 *
sizeof(
long) > 1 * PyLong_SHIFT) {
28803 if (8 *
sizeof(
unsigned long) > 2 * PyLong_SHIFT) {
28804 __PYX_VERIFY_RETURN_INT(
long,
unsigned long, (((((
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
28805 }
else if (8 *
sizeof(
long) >= 2 * PyLong_SHIFT) {
28806 return (
long) (((((long)digits[1]) << PyLong_SHIFT) | (
long)digits[0]));
28811 if (8 *
sizeof(
long) > 2 * PyLong_SHIFT) {
28812 if (8 *
sizeof(
unsigned long) > 3 * PyLong_SHIFT) {
28813 __PYX_VERIFY_RETURN_INT(
long,
unsigned long, (((((((
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
28814 }
else if (8 *
sizeof(
long) >= 3 * PyLong_SHIFT) {
28815 return (
long) (((((((long)digits[2]) << PyLong_SHIFT) | (
long)digits[1]) << PyLong_SHIFT) | (long)digits[0]));
28820 if (8 *
sizeof(
long) > 3 * PyLong_SHIFT) {
28821 if (8 *
sizeof(
unsigned long) > 4 * PyLong_SHIFT) {
28822 __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])))
28823 }
else if (8 *
sizeof(
long) >= 4 * PyLong_SHIFT) {
28824 return (
long) (((((((((long)digits[3]) << PyLong_SHIFT) | (
long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (
long)digits[0]));
28830 #if CYTHON_COMPILING_IN_CPYTHON
28831 if (unlikely(Py_SIZE(x) < 0)) {
28832 goto raise_neg_overflow;
28836 int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
28837 if (unlikely(result < 0))
28839 if (unlikely(result == 1))
28840 goto raise_neg_overflow;
28843 if (
sizeof(
long) <=
sizeof(
unsigned long)) {
28844 __PYX_VERIFY_RETURN_INT_EXC(
long,
unsigned long, PyLong_AsUnsignedLong(x))
28845 #ifdef HAVE_LONG_LONG
28846 }
else if (
sizeof(
long) <=
sizeof(
unsigned PY_LONG_LONG)) {
28847 __PYX_VERIFY_RETURN_INT_EXC(
long,
unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
28851 #if CYTHON_USE_PYLONG_INTERNALS
28852 const digit* digits = ((PyLongObject*)x)->ob_digit;
28853 switch (Py_SIZE(x)) {
28854 case 0:
return (
long) 0;
28855 case -1: __PYX_VERIFY_RETURN_INT(
long, sdigit, (sdigit) (-(sdigit)digits[0]))
28856 case 1: __PYX_VERIFY_RETURN_INT(
long, digit, +digits[0])
28858 if (8 *
sizeof(
long) - 1 > 1 * PyLong_SHIFT) {
28859 if (8 *
sizeof(
unsigned long) > 2 * PyLong_SHIFT) {
28860 __PYX_VERIFY_RETURN_INT(
long,
long, -(
long) (((((
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
28861 }
else if (8 *
sizeof(
long) - 1 > 2 * PyLong_SHIFT) {
28862 return (
long) (((long)-1)*(((((long)digits[1]) << PyLong_SHIFT) | (
long)digits[0])));
28867 if (8 *
sizeof(
long) > 1 * PyLong_SHIFT) {
28868 if (8 *
sizeof(
unsigned long) > 2 * PyLong_SHIFT) {
28869 __PYX_VERIFY_RETURN_INT(
long,
unsigned long, (((((
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
28870 }
else if (8 *
sizeof(
long) - 1 > 2 * PyLong_SHIFT) {
28871 return (
long) ((((((long)digits[1]) << PyLong_SHIFT) | (
long)digits[0])));
28876 if (8 *
sizeof(
long) - 1 > 2 * PyLong_SHIFT) {
28877 if (8 *
sizeof(
unsigned long) > 3 * PyLong_SHIFT) {
28878 __PYX_VERIFY_RETURN_INT(
long,
long, -(
long) (((((((
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
28879 }
else if (8 *
sizeof(
long) - 1 > 3 * PyLong_SHIFT) {
28880 return (
long) (((long)-1)*(((((((long)digits[2]) << PyLong_SHIFT) | (
long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
28885 if (8 *
sizeof(
long) > 2 * PyLong_SHIFT) {
28886 if (8 *
sizeof(
unsigned long) > 3 * PyLong_SHIFT) {
28887 __PYX_VERIFY_RETURN_INT(
long,
unsigned long, (((((((
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
28888 }
else if (8 *
sizeof(
long) - 1 > 3 * PyLong_SHIFT) {
28889 return (
long) ((((((((long)digits[2]) << PyLong_SHIFT) | (
long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
28894 if (8 *
sizeof(
long) - 1 > 3 * PyLong_SHIFT) {
28895 if (8 *
sizeof(
unsigned long) > 4 * PyLong_SHIFT) {
28896 __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])))
28897 }
else if (8 *
sizeof(
long) - 1 > 4 * PyLong_SHIFT) {
28898 return (
long) (((long)-1)*(((((((((long)digits[3]) << PyLong_SHIFT) | (
long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (
long)digits[0])));
28903 if (8 *
sizeof(
long) > 3 * PyLong_SHIFT) {
28904 if (8 *
sizeof(
unsigned long) > 4 * PyLong_SHIFT) {
28905 __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])))
28906 }
else if (8 *
sizeof(
long) - 1 > 4 * PyLong_SHIFT) {
28907 return (
long) ((((((((((long)digits[3]) << PyLong_SHIFT) | (
long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (
long)digits[0])));
28913 if (
sizeof(
long) <=
sizeof(long)) {
28914 __PYX_VERIFY_RETURN_INT_EXC(
long,
long, PyLong_AsLong(x))
28915 #ifdef HAVE_LONG_LONG
28916 }
else if (
sizeof(
long) <=
sizeof(PY_LONG_LONG)) {
28917 __PYX_VERIFY_RETURN_INT_EXC(
long, PY_LONG_LONG, PyLong_AsLongLong(x))
28922 #if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray)
28923 PyErr_SetString(PyExc_RuntimeError,
28924 "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers");
28927 PyObject *
v = __Pyx_PyNumber_IntOrLong(x);
28928 #if PY_MAJOR_VERSION < 3
28929 if (likely(
v) && !PyLong_Check(
v)) {
28931 v = PyNumber_Long(tmp);
28936 int one = 1;
int is_little = (int)*(
unsigned char *)&one;
28937 unsigned char *bytes = (
unsigned char *)&val;
28938 int ret = _PyLong_AsByteArray((PyLongObject *)
v,
28939 bytes,
sizeof(val),
28940 is_little, !is_unsigned);
28950 PyObject *tmp = __Pyx_PyNumber_IntOrLong(x);
28951 if (!tmp)
return (
long) -1;
28952 val = __Pyx_PyInt_As_long(tmp);
28957 PyErr_SetString(PyExc_OverflowError,
28958 "value too large to convert to long");
28960 raise_neg_overflow:
28961 PyErr_SetString(PyExc_OverflowError,
28962 "can't convert negative value to long");
28967 static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(
long value) {
28968 #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
28969 #pragma GCC diagnostic push
28970 #pragma GCC diagnostic ignored "-Wconversion"
28972 const long neg_one = (long) -1, const_zero = (
long) 0;
28973 #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
28974 #pragma GCC diagnostic pop
28976 const int is_unsigned = neg_one > const_zero;
28978 if (
sizeof(
long) <
sizeof(long)) {
28979 return PyInt_FromLong((
long) value);
28980 }
else if (
sizeof(
long) <=
sizeof(
unsigned long)) {
28981 return PyLong_FromUnsignedLong((
unsigned long) value);
28982 #ifdef HAVE_LONG_LONG
28983 }
else if (
sizeof(
long) <=
sizeof(
unsigned PY_LONG_LONG)) {
28984 return PyLong_FromUnsignedLongLong((
unsigned PY_LONG_LONG) value);
28988 if (
sizeof(
long) <=
sizeof(
long)) {
28989 return PyInt_FromLong((
long) value);
28990 #ifdef HAVE_LONG_LONG
28991 }
else if (
sizeof(
long) <=
sizeof(PY_LONG_LONG)) {
28992 return PyLong_FromLongLong((PY_LONG_LONG) value);
28997 int one = 1;
int little = (int)*(
unsigned char *)&one;
28998 unsigned char *bytes = (
unsigned char *)&value;
28999 return _PyLong_FromByteArray(bytes,
sizeof(
long),
29000 little, !is_unsigned);
29005 static CYTHON_INLINE
char __Pyx_PyInt_As_char(PyObject *x) {
29006 #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
29007 #pragma GCC diagnostic push
29008 #pragma GCC diagnostic ignored "-Wconversion"
29010 const char neg_one = (char) -1, const_zero = (
char) 0;
29011 #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
29012 #pragma GCC diagnostic pop
29014 const int is_unsigned = neg_one > const_zero;
29015 #if PY_MAJOR_VERSION < 3
29016 if (likely(PyInt_Check(x))) {
29017 if (
sizeof(
char) <
sizeof(long)) {
29018 __PYX_VERIFY_RETURN_INT(
char,
long, PyInt_AS_LONG(x))
29020 long val = PyInt_AS_LONG(x);
29021 if (is_unsigned && unlikely(val < 0)) {
29022 goto raise_neg_overflow;
29028 if (likely(PyLong_Check(x))) {
29030 #if CYTHON_USE_PYLONG_INTERNALS
29031 const digit* digits = ((PyLongObject*)x)->ob_digit;
29032 switch (Py_SIZE(x)) {
29033 case 0:
return (
char) 0;
29034 case 1: __PYX_VERIFY_RETURN_INT(
char, digit, digits[0])
29036 if (8 *
sizeof(
char) > 1 * PyLong_SHIFT) {
29037 if (8 *
sizeof(
unsigned long) > 2 * PyLong_SHIFT) {
29038 __PYX_VERIFY_RETURN_INT(
char,
unsigned long, (((((
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
29039 }
else if (8 *
sizeof(
char) >= 2 * PyLong_SHIFT) {
29040 return (
char) (((((char)digits[1]) << PyLong_SHIFT) | (
char)digits[0]));
29045 if (8 *
sizeof(
char) > 2 * PyLong_SHIFT) {
29046 if (8 *
sizeof(
unsigned long) > 3 * PyLong_SHIFT) {
29047 __PYX_VERIFY_RETURN_INT(
char,
unsigned long, (((((((
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
29048 }
else if (8 *
sizeof(
char) >= 3 * PyLong_SHIFT) {
29049 return (
char) (((((((char)digits[2]) << PyLong_SHIFT) | (
char)digits[1]) << PyLong_SHIFT) | (char)digits[0]));
29054 if (8 *
sizeof(
char) > 3 * PyLong_SHIFT) {
29055 if (8 *
sizeof(
unsigned long) > 4 * PyLong_SHIFT) {
29056 __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])))
29057 }
else if (8 *
sizeof(
char) >= 4 * PyLong_SHIFT) {
29058 return (
char) (((((((((char)digits[3]) << PyLong_SHIFT) | (
char)digits[2]) << PyLong_SHIFT) | (char)digits[1]) << PyLong_SHIFT) | (
char)digits[0]));
29064 #if CYTHON_COMPILING_IN_CPYTHON
29065 if (unlikely(Py_SIZE(x) < 0)) {
29066 goto raise_neg_overflow;
29070 int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
29071 if (unlikely(result < 0))
29073 if (unlikely(result == 1))
29074 goto raise_neg_overflow;
29077 if (
sizeof(
char) <=
sizeof(
unsigned long)) {
29078 __PYX_VERIFY_RETURN_INT_EXC(
char,
unsigned long, PyLong_AsUnsignedLong(x))
29079 #ifdef HAVE_LONG_LONG
29080 }
else if (
sizeof(
char) <=
sizeof(
unsigned PY_LONG_LONG)) {
29081 __PYX_VERIFY_RETURN_INT_EXC(
char,
unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
29085 #if CYTHON_USE_PYLONG_INTERNALS
29086 const digit* digits = ((PyLongObject*)x)->ob_digit;
29087 switch (Py_SIZE(x)) {
29088 case 0:
return (
char) 0;
29089 case -1: __PYX_VERIFY_RETURN_INT(
char, sdigit, (sdigit) (-(sdigit)digits[0]))
29090 case 1: __PYX_VERIFY_RETURN_INT(
char, digit, +digits[0])
29092 if (8 *
sizeof(
char) - 1 > 1 * PyLong_SHIFT) {
29093 if (8 *
sizeof(
unsigned long) > 2 * PyLong_SHIFT) {
29094 __PYX_VERIFY_RETURN_INT(
char,
long, -(
long) (((((
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
29095 }
else if (8 *
sizeof(
char) - 1 > 2 * PyLong_SHIFT) {
29096 return (
char) (((char)-1)*(((((char)digits[1]) << PyLong_SHIFT) | (
char)digits[0])));
29101 if (8 *
sizeof(
char) > 1 * PyLong_SHIFT) {
29102 if (8 *
sizeof(
unsigned long) > 2 * PyLong_SHIFT) {
29103 __PYX_VERIFY_RETURN_INT(
char,
unsigned long, (((((
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
29104 }
else if (8 *
sizeof(
char) - 1 > 2 * PyLong_SHIFT) {
29105 return (
char) ((((((char)digits[1]) << PyLong_SHIFT) | (
char)digits[0])));
29110 if (8 *
sizeof(
char) - 1 > 2 * PyLong_SHIFT) {
29111 if (8 *
sizeof(
unsigned long) > 3 * PyLong_SHIFT) {
29112 __PYX_VERIFY_RETURN_INT(
char,
long, -(
long) (((((((
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
29113 }
else if (8 *
sizeof(
char) - 1 > 3 * PyLong_SHIFT) {
29114 return (
char) (((char)-1)*(((((((char)digits[2]) << PyLong_SHIFT) | (
char)digits[1]) << PyLong_SHIFT) | (char)digits[0])));
29119 if (8 *
sizeof(
char) > 2 * PyLong_SHIFT) {
29120 if (8 *
sizeof(
unsigned long) > 3 * PyLong_SHIFT) {
29121 __PYX_VERIFY_RETURN_INT(
char,
unsigned long, (((((((
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
29122 }
else if (8 *
sizeof(
char) - 1 > 3 * PyLong_SHIFT) {
29123 return (
char) ((((((((char)digits[2]) << PyLong_SHIFT) | (
char)digits[1]) << PyLong_SHIFT) | (char)digits[0])));
29128 if (8 *
sizeof(
char) - 1 > 3 * PyLong_SHIFT) {
29129 if (8 *
sizeof(
unsigned long) > 4 * PyLong_SHIFT) {
29130 __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])))
29131 }
else if (8 *
sizeof(
char) - 1 > 4 * PyLong_SHIFT) {
29132 return (
char) (((char)-1)*(((((((((char)digits[3]) << PyLong_SHIFT) | (
char)digits[2]) << PyLong_SHIFT) | (char)digits[1]) << PyLong_SHIFT) | (
char)digits[0])));
29137 if (8 *
sizeof(
char) > 3 * PyLong_SHIFT) {
29138 if (8 *
sizeof(
unsigned long) > 4 * PyLong_SHIFT) {
29139 __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])))
29140 }
else if (8 *
sizeof(
char) - 1 > 4 * PyLong_SHIFT) {
29141 return (
char) ((((((((((char)digits[3]) << PyLong_SHIFT) | (
char)digits[2]) << PyLong_SHIFT) | (char)digits[1]) << PyLong_SHIFT) | (
char)digits[0])));
29147 if (
sizeof(
char) <=
sizeof(long)) {
29148 __PYX_VERIFY_RETURN_INT_EXC(
char,
long, PyLong_AsLong(x))
29149 #ifdef HAVE_LONG_LONG
29150 }
else if (
sizeof(
char) <=
sizeof(PY_LONG_LONG)) {
29151 __PYX_VERIFY_RETURN_INT_EXC(
char, PY_LONG_LONG, PyLong_AsLongLong(x))
29156 #if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray)
29157 PyErr_SetString(PyExc_RuntimeError,
29158 "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers");
29161 PyObject *
v = __Pyx_PyNumber_IntOrLong(x);
29162 #if PY_MAJOR_VERSION < 3
29163 if (likely(
v) && !PyLong_Check(
v)) {
29165 v = PyNumber_Long(tmp);
29170 int one = 1;
int is_little = (int)*(
unsigned char *)&one;
29171 unsigned char *bytes = (
unsigned char *)&val;
29172 int ret = _PyLong_AsByteArray((PyLongObject *)
v,
29173 bytes,
sizeof(val),
29174 is_little, !is_unsigned);
29184 PyObject *tmp = __Pyx_PyNumber_IntOrLong(x);
29185 if (!tmp)
return (
char) -1;
29186 val = __Pyx_PyInt_As_char(tmp);
29191 PyErr_SetString(PyExc_OverflowError,
29192 "value too large to convert to char");
29194 raise_neg_overflow:
29195 PyErr_SetString(PyExc_OverflowError,
29196 "can't convert negative value to char");
29201 static int __Pyx_check_binary_version(
void) {
29203 int same=1, i, found_dot;
29204 const char* rt_from_call = Py_GetVersion();
29205 PyOS_snprintf(ctversion, 5,
"%d.%d", PY_MAJOR_VERSION, PY_MINOR_VERSION);
29207 for (i = 0; i < 4; i++) {
29208 if (!ctversion[i]) {
29209 same = (rt_from_call[i] <
'0' || rt_from_call[i] >
'9');
29212 if (rt_from_call[i] != ctversion[i]) {
29218 char rtversion[5] = {
'\0'};
29220 for (i=0; i<4; ++i) {
29221 if (rt_from_call[i] ==
'.') {
29222 if (found_dot)
break;
29224 }
else if (rt_from_call[i] <
'0' || rt_from_call[i] >
'9') {
29227 rtversion[i] = rt_from_call[i];
29229 PyOS_snprintf(message,
sizeof(message),
29230 "compiletime version %s of module '%.100s' "
29231 "does not match runtime version %s",
29232 ctversion, __Pyx_MODULE_NAME, rtversion);
29233 return PyErr_WarnEx(NULL, message, 1);
29239 static int __Pyx_InitStrings(__Pyx_StringTabEntry *t) {
29241 #if PY_MAJOR_VERSION < 3
29242 if (t->is_unicode) {
29243 *t->p = PyUnicode_DecodeUTF8(t->s, t->n - 1, NULL);
29244 }
else if (t->intern) {
29245 *t->p = PyString_InternFromString(t->s);
29247 *t->p = PyString_FromStringAndSize(t->s, t->n - 1);
29250 if (t->is_unicode | t->is_str) {
29252 *t->p = PyUnicode_InternFromString(t->s);
29253 }
else if (t->encoding) {
29254 *t->p = PyUnicode_Decode(t->s, t->n - 1, t->encoding, NULL);
29256 *t->p = PyUnicode_FromStringAndSize(t->s, t->n - 1);
29259 *t->p = PyBytes_FromStringAndSize(t->s, t->n - 1);
29264 if (PyObject_Hash(*t->p) == -1)
29271 static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(
const char* c_str) {
29272 return __Pyx_PyUnicode_FromStringAndSize(c_str, (Py_ssize_t)strlen(c_str));
29274 static CYTHON_INLINE
const char* __Pyx_PyObject_AsString(PyObject* o) {
29276 return __Pyx_PyObject_AsStringAndSize(o, &ignore);
29278 #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT
29279 #if !CYTHON_PEP393_ENABLED
29280 static const char* __Pyx_PyUnicode_AsStringAndSize(PyObject* o, Py_ssize_t *length) {
29282 PyObject* defenc = _PyUnicode_AsDefaultEncodedString(o, NULL);
29283 if (!defenc)
return NULL;
29284 defenc_c = PyBytes_AS_STRING(defenc);
29285 #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
29287 char* end = defenc_c + PyBytes_GET_SIZE(defenc);
29289 for (
c = defenc_c;
c < end;
c++) {
29290 if ((
unsigned char) (*
c) >= 128) {
29291 PyUnicode_AsASCIIString(o);
29297 *length = PyBytes_GET_SIZE(defenc);
29301 static CYTHON_INLINE
const char* __Pyx_PyUnicode_AsStringAndSize(PyObject* o, Py_ssize_t *length) {
29302 if (unlikely(__Pyx_PyUnicode_READY(o) == -1))
return NULL;
29303 #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
29304 if (likely(PyUnicode_IS_ASCII(o))) {
29305 *length = PyUnicode_GET_LENGTH(o);
29306 return PyUnicode_AsUTF8(o);
29308 PyUnicode_AsASCIIString(o);
29312 return PyUnicode_AsUTF8AndSize(o, length);
29317 static CYTHON_INLINE
const char* __Pyx_PyObject_AsStringAndSize(PyObject* o, Py_ssize_t *length) {
29318 #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT
29320 #
if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
29321 __Pyx_sys_getdefaultencoding_not_ascii &&
29323 PyUnicode_Check(o)) {
29324 return __Pyx_PyUnicode_AsStringAndSize(o, length);
29327 #if (!CYTHON_COMPILING_IN_PYPY) || (defined(PyByteArray_AS_STRING) && defined(PyByteArray_GET_SIZE))
29328 if (PyByteArray_Check(o)) {
29329 *length = PyByteArray_GET_SIZE(o);
29330 return PyByteArray_AS_STRING(o);
29335 int r = PyBytes_AsStringAndSize(o, &result, length);
29336 if (unlikely(
r < 0)) {
29343 static CYTHON_INLINE
int __Pyx_PyObject_IsTrue(PyObject* x) {
29344 int is_true = x == Py_True;
29345 if (is_true | (x == Py_False) | (x == Py_None))
return is_true;
29346 else return PyObject_IsTrue(x);
29348 static CYTHON_INLINE
int __Pyx_PyObject_IsTrueAndDecref(PyObject* x) {
29350 if (unlikely(!x))
return -1;
29351 retval = __Pyx_PyObject_IsTrue(x);
29355 static PyObject* __Pyx_PyNumber_IntOrLongWrongResultType(PyObject* result,
const char* type_name) {
29356 #if PY_MAJOR_VERSION >= 3
29357 if (PyLong_Check(result)) {
29358 if (PyErr_WarnFormat(PyExc_DeprecationWarning, 1,
29359 "__int__ returned non-int (type %.200s). "
29360 "The ability to return an instance of a strict subclass of int "
29361 "is deprecated, and may be removed in a future version of Python.",
29362 Py_TYPE(result)->tp_name)) {
29369 PyErr_Format(PyExc_TypeError,
29370 "__%.4s__ returned non-%.4s (type %.200s)",
29371 type_name, type_name, Py_TYPE(result)->tp_name);
29375 static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x) {
29376 #if CYTHON_USE_TYPE_SLOTS
29377 PyNumberMethods *m;
29379 const char *name = NULL;
29380 PyObject *res = NULL;
29381 #if PY_MAJOR_VERSION < 3
29382 if (likely(PyInt_Check(x) || PyLong_Check(x)))
29384 if (likely(PyLong_Check(x)))
29386 return __Pyx_NewRef(x);
29387 #if CYTHON_USE_TYPE_SLOTS
29388 m = Py_TYPE(x)->tp_as_number;
29389 #if PY_MAJOR_VERSION < 3
29390 if (m && m->nb_int) {
29392 res = m->nb_int(x);
29394 else if (m && m->nb_long) {
29396 res = m->nb_long(x);
29399 if (likely(m && m->nb_int)) {
29401 res = m->nb_int(x);
29405 if (!PyBytes_CheckExact(x) && !PyUnicode_CheckExact(x)) {
29406 res = PyNumber_Int(x);
29410 #if PY_MAJOR_VERSION < 3
29411 if (unlikely(!PyInt_Check(res) && !PyLong_Check(res))) {
29413 if (unlikely(!PyLong_CheckExact(res))) {
29415 return __Pyx_PyNumber_IntOrLongWrongResultType(res, name);
29418 else if (!PyErr_Occurred()) {
29419 PyErr_SetString(PyExc_TypeError,
29420 "an integer is required");
29424 static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject* b) {
29427 #if PY_MAJOR_VERSION < 3
29428 if (likely(PyInt_CheckExact(b))) {
29429 if (
sizeof(Py_ssize_t) >=
sizeof(
long))
29430 return PyInt_AS_LONG(b);
29432 return PyInt_AsSsize_t(b);
29435 if (likely(PyLong_CheckExact(b))) {
29436 #if CYTHON_USE_PYLONG_INTERNALS
29437 const digit* digits = ((PyLongObject*)b)->ob_digit;
29438 const Py_ssize_t size = Py_SIZE(b);
29439 if (likely(__Pyx_sst_abs(size) <= 1)) {
29440 ival = likely(size) ? digits[0] : 0;
29441 if (size == -1) ival = -ival;
29446 if (8 *
sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) {
29447 return (Py_ssize_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (
size_t)digits[0]));
29451 if (8 *
sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) {
29452 return -(Py_ssize_t) (((((
size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
29456 if (8 *
sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) {
29457 return (Py_ssize_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (
size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
29461 if (8 *
sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) {
29462 return -(Py_ssize_t) (((((((
size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (
size_t)digits[0]));
29466 if (8 *
sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) {
29467 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]));
29471 if (8 *
sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) {
29472 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]));
29478 return PyLong_AsSsize_t(b);
29480 x = PyNumber_Index(b);
29482 ival = PyInt_AsSsize_t(x);
29486 static CYTHON_INLINE Py_hash_t __Pyx_PyIndex_AsHash_t(PyObject* o) {
29487 if (
sizeof(Py_hash_t) ==
sizeof(Py_ssize_t)) {
29488 return (Py_hash_t) __Pyx_PyIndex_AsSsize_t(o);
29489 #if PY_MAJOR_VERSION < 3
29490 }
else if (likely(PyInt_CheckExact(o))) {
29491 return PyInt_AS_LONG(o);
29496 x = PyNumber_Index(o);
29498 ival = PyInt_AsLong(x);
29503 static CYTHON_INLINE PyObject * __Pyx_PyBool_FromLong(
long b) {
29504 return b ? __Pyx_NewRef(Py_True) : __Pyx_NewRef(Py_False);
29506 static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(
size_t ival) {
29507 return PyInt_FromSize_t(ival);