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
306 #ifndef CYTHON_INLINE
307 #if defined(__clang__)
308 #define CYTHON_INLINE __inline__ __attribute__ ((__unused__))
309 #elif defined(__GNUC__)
310 #define CYTHON_INLINE __inline__
311 #elif defined(_MSC_VER)
312 #define CYTHON_INLINE __inline
313 #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
314 #define CYTHON_INLINE inline
316 #define CYTHON_INLINE
320 #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x02070600 && !defined(Py_OptimizeFlag)
321 #define Py_OptimizeFlag 0
323 #define __PYX_BUILD_PY_SSIZE_T "n"
324 #define CYTHON_FORMAT_SSIZE_T "z"
325 #if PY_MAJOR_VERSION < 3
326 #define __Pyx_BUILTIN_MODULE_NAME "__builtin__"
327 #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\
328 PyCode_New(a+k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)
329 #define __Pyx_DefaultClassType PyClass_Type
331 #define __Pyx_BUILTIN_MODULE_NAME "builtins"
332 #define __Pyx_DefaultClassType PyType_Type
333 #if PY_VERSION_HEX >= 0x030B00A1
334 static CYTHON_INLINE PyCodeObject* __Pyx_PyCode_New(
int a,
int k,
int l,
int s,
int f,
335 PyObject *code, PyObject *
c, PyObject*
n, PyObject *
v,
336 PyObject *fv, PyObject *cell, PyObject* fn,
337 PyObject *name,
int fline, PyObject *lnos) {
338 PyObject *kwds=NULL, *argcount=NULL, *posonlyargcount=NULL, *kwonlyargcount=NULL;
339 PyObject *nlocals=NULL, *stacksize=NULL, *flags=NULL, *replace=NULL, *call_result=NULL, *empty=NULL;
340 const char *fn_cstr=NULL;
341 const char *name_cstr=NULL;
342 PyCodeObject* co=NULL;
343 PyObject *type, *value, *traceback;
344 PyErr_Fetch(&type, &value, &traceback);
345 if (!(kwds=PyDict_New()))
goto end;
346 if (!(argcount=PyLong_FromLong(a)))
goto end;
347 if (PyDict_SetItemString(kwds,
"co_argcount", argcount) != 0)
goto end;
348 if (!(posonlyargcount=PyLong_FromLong(0)))
goto end;
349 if (PyDict_SetItemString(kwds,
"co_posonlyargcount", posonlyargcount) != 0)
goto end;
350 if (!(kwonlyargcount=PyLong_FromLong(k)))
goto end;
351 if (PyDict_SetItemString(kwds,
"co_kwonlyargcount", kwonlyargcount) != 0)
goto end;
352 if (!(nlocals=PyLong_FromLong(l)))
goto end;
353 if (PyDict_SetItemString(kwds,
"co_nlocals", nlocals) != 0)
goto end;
354 if (!(stacksize=PyLong_FromLong(
s)))
goto end;
355 if (PyDict_SetItemString(kwds,
"co_stacksize", stacksize) != 0)
goto end;
356 if (!(flags=PyLong_FromLong(
f)))
goto end;
357 if (PyDict_SetItemString(kwds,
"co_flags", flags) != 0)
goto end;
358 if (PyDict_SetItemString(kwds,
"co_code", code) != 0)
goto end;
359 if (PyDict_SetItemString(kwds,
"co_consts",
c) != 0)
goto end;
360 if (PyDict_SetItemString(kwds,
"co_names",
n) != 0)
goto end;
361 if (PyDict_SetItemString(kwds,
"co_varnames",
v) != 0)
goto end;
362 if (PyDict_SetItemString(kwds,
"co_freevars", fv) != 0)
goto end;
363 if (PyDict_SetItemString(kwds,
"co_cellvars", cell) != 0)
goto end;
364 if (PyDict_SetItemString(kwds,
"co_linetable", lnos) != 0)
goto end;
365 if (!(fn_cstr=PyUnicode_AsUTF8AndSize(fn, NULL)))
goto end;
366 if (!(name_cstr=PyUnicode_AsUTF8AndSize(name, NULL)))
goto end;
367 if (!(co = PyCode_NewEmpty(fn_cstr, name_cstr, fline)))
goto end;
368 if (!(replace = PyObject_GetAttrString((PyObject*)co,
"replace")))
goto cleanup_code_too;
369 if (!(empty = PyTuple_New(0)))
goto cleanup_code_too;
370 if (!(call_result = PyObject_Call(replace, empty, kwds)))
goto cleanup_code_too;
371 Py_XDECREF((PyObject*)co);
372 co = (PyCodeObject*)call_result;
376 Py_XDECREF((PyObject*)co);
381 Py_XDECREF(argcount);
382 Py_XDECREF(posonlyargcount);
383 Py_XDECREF(kwonlyargcount);
385 Py_XDECREF(stacksize);
387 Py_XDECREF(call_result);
390 PyErr_Restore(type, value, traceback);
395 #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\
396 PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)
398 #define __Pyx_DefaultClassType PyType_Type
400 #ifndef Py_TPFLAGS_CHECKTYPES
401 #define Py_TPFLAGS_CHECKTYPES 0
403 #ifndef Py_TPFLAGS_HAVE_INDEX
404 #define Py_TPFLAGS_HAVE_INDEX 0
406 #ifndef Py_TPFLAGS_HAVE_NEWBUFFER
407 #define Py_TPFLAGS_HAVE_NEWBUFFER 0
409 #ifndef Py_TPFLAGS_HAVE_FINALIZE
410 #define Py_TPFLAGS_HAVE_FINALIZE 0
412 #ifndef METH_STACKLESS
413 #define METH_STACKLESS 0
415 #if PY_VERSION_HEX <= 0x030700A3 || !defined(METH_FASTCALL)
416 #ifndef METH_FASTCALL
417 #define METH_FASTCALL 0x80
419 typedef PyObject *(*__Pyx_PyCFunctionFast) (PyObject *
self, PyObject *
const *args, Py_ssize_t nargs);
420 typedef PyObject *(*__Pyx_PyCFunctionFastWithKeywords) (PyObject *
self, PyObject *
const *args,
421 Py_ssize_t nargs, PyObject *kwnames);
423 #define __Pyx_PyCFunctionFast _PyCFunctionFast
424 #define __Pyx_PyCFunctionFastWithKeywords _PyCFunctionFastWithKeywords
426 #if CYTHON_FAST_PYCCALL
427 #define __Pyx_PyFastCFunction_Check(func)\
428 ((PyCFunction_Check(func) && (METH_FASTCALL == (PyCFunction_GET_FLAGS(func) & ~(METH_CLASS | METH_STATIC | METH_COEXIST | METH_KEYWORDS | METH_STACKLESS)))))
430 #define __Pyx_PyFastCFunction_Check(func) 0
432 #if CYTHON_COMPILING_IN_PYPY && !defined(PyObject_Malloc)
433 #define PyObject_Malloc(s) PyMem_Malloc(s)
434 #define PyObject_Free(p) PyMem_Free(p)
435 #define PyObject_Realloc(p) PyMem_Realloc(p)
437 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030400A1
438 #define PyMem_RawMalloc(n) PyMem_Malloc(n)
439 #define PyMem_RawRealloc(p, n) PyMem_Realloc(p, n)
440 #define PyMem_RawFree(p) PyMem_Free(p)
442 #if CYTHON_COMPILING_IN_PYSTON
443 #define __Pyx_PyCode_HasFreeVars(co) PyCode_HasFreeVars(co)
444 #define __Pyx_PyFrame_SetLineNumber(frame, lineno) PyFrame_SetLineNumber(frame, lineno)
446 #define __Pyx_PyCode_HasFreeVars(co) (PyCode_GetNumFree(co) > 0)
447 #define __Pyx_PyFrame_SetLineNumber(frame, lineno) (frame)->f_lineno = (lineno)
449 #if !CYTHON_FAST_THREAD_STATE || PY_VERSION_HEX < 0x02070000
450 #define __Pyx_PyThreadState_Current PyThreadState_GET()
451 #elif PY_VERSION_HEX >= 0x03060000
452 #define __Pyx_PyThreadState_Current _PyThreadState_UncheckedGet()
453 #elif PY_VERSION_HEX >= 0x03000000
454 #define __Pyx_PyThreadState_Current PyThreadState_GET()
456 #define __Pyx_PyThreadState_Current _PyThreadState_Current
458 #if PY_VERSION_HEX < 0x030700A2 && !defined(PyThread_tss_create) && !defined(Py_tss_NEEDS_INIT)
459 #include "pythread.h"
460 #define Py_tss_NEEDS_INIT 0
461 typedef int Py_tss_t;
462 static CYTHON_INLINE
int PyThread_tss_create(Py_tss_t *key) {
463 *key = PyThread_create_key();
466 static CYTHON_INLINE Py_tss_t * PyThread_tss_alloc(
void) {
467 Py_tss_t *key = (Py_tss_t *)PyObject_Malloc(
sizeof(Py_tss_t));
468 *key = Py_tss_NEEDS_INIT;
471 static CYTHON_INLINE
void PyThread_tss_free(Py_tss_t *key) {
474 static CYTHON_INLINE
int PyThread_tss_is_created(Py_tss_t *key) {
475 return *key != Py_tss_NEEDS_INIT;
477 static CYTHON_INLINE
void PyThread_tss_delete(Py_tss_t *key) {
478 PyThread_delete_key(*key);
479 *key = Py_tss_NEEDS_INIT;
481 static CYTHON_INLINE
int PyThread_tss_set(Py_tss_t *key,
void *value) {
482 return PyThread_set_key_value(*key, value);
484 static CYTHON_INLINE
void * PyThread_tss_get(Py_tss_t *key) {
485 return PyThread_get_key_value(*key);
488 #if CYTHON_COMPILING_IN_CPYTHON || defined(_PyDict_NewPresized)
489 #define __Pyx_PyDict_NewPresized(n) ((n <= 8) ? PyDict_New() : _PyDict_NewPresized(n))
491 #define __Pyx_PyDict_NewPresized(n) PyDict_New()
493 #if PY_MAJOR_VERSION >= 3 || CYTHON_FUTURE_DIVISION
494 #define __Pyx_PyNumber_Divide(x,y) PyNumber_TrueDivide(x,y)
495 #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceTrueDivide(x,y)
497 #define __Pyx_PyNumber_Divide(x,y) PyNumber_Divide(x,y)
498 #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceDivide(x,y)
500 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030500A1 && CYTHON_USE_UNICODE_INTERNALS
501 #define __Pyx_PyDict_GetItemStr(dict, name) _PyDict_GetItem_KnownHash(dict, name, ((PyASCIIObject *) name)->hash)
503 #define __Pyx_PyDict_GetItemStr(dict, name) PyDict_GetItem(dict, name)
505 #if PY_VERSION_HEX > 0x03030000 && defined(PyUnicode_KIND)
506 #define CYTHON_PEP393_ENABLED 1
507 #if defined(PyUnicode_IS_READY)
508 #define __Pyx_PyUnicode_READY(op) (likely(PyUnicode_IS_READY(op)) ?\
509 0 : _PyUnicode_Ready((PyObject *)(op)))
511 #define __Pyx_PyUnicode_READY(op) (0)
513 #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_LENGTH(u)
514 #define __Pyx_PyUnicode_READ_CHAR(u, i) PyUnicode_READ_CHAR(u, i)
515 #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u) PyUnicode_MAX_CHAR_VALUE(u)
516 #define __Pyx_PyUnicode_KIND(u) PyUnicode_KIND(u)
517 #define __Pyx_PyUnicode_DATA(u) PyUnicode_DATA(u)
518 #define __Pyx_PyUnicode_READ(k, d, i) PyUnicode_READ(k, d, i)
519 #define __Pyx_PyUnicode_WRITE(k, d, i, ch) PyUnicode_WRITE(k, d, i, ch)
520 #if defined(PyUnicode_IS_READY) && defined(PyUnicode_GET_SIZE)
521 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x03090000
522 #define __Pyx_PyUnicode_IS_TRUE(u) (0 != (likely(PyUnicode_IS_READY(u)) ? PyUnicode_GET_LENGTH(u) : ((PyCompactUnicodeObject *)(u))->wstr_length))
524 #define __Pyx_PyUnicode_IS_TRUE(u) (0 != (likely(PyUnicode_IS_READY(u)) ? PyUnicode_GET_LENGTH(u) : PyUnicode_GET_SIZE(u)))
527 #define __Pyx_PyUnicode_IS_TRUE(u) (0 != PyUnicode_GET_LENGTH(u))
530 #define CYTHON_PEP393_ENABLED 0
531 #define PyUnicode_1BYTE_KIND 1
532 #define PyUnicode_2BYTE_KIND 2
533 #define PyUnicode_4BYTE_KIND 4
534 #define __Pyx_PyUnicode_READY(op) (0)
535 #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_SIZE(u)
536 #define __Pyx_PyUnicode_READ_CHAR(u, i) ((Py_UCS4)(PyUnicode_AS_UNICODE(u)[i]))
537 #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u) ((sizeof(Py_UNICODE) == 2) ? 65535 : 1114111)
538 #define __Pyx_PyUnicode_KIND(u) (sizeof(Py_UNICODE))
539 #define __Pyx_PyUnicode_DATA(u) ((void*)PyUnicode_AS_UNICODE(u))
540 #define __Pyx_PyUnicode_READ(k, d, i) ((void)(k), (Py_UCS4)(((Py_UNICODE*)d)[i]))
541 #define __Pyx_PyUnicode_WRITE(k, d, i, ch) (((void)(k)), ((Py_UNICODE*)d)[i] = ch)
542 #define __Pyx_PyUnicode_IS_TRUE(u) (0 != PyUnicode_GET_SIZE(u))
544 #if CYTHON_COMPILING_IN_PYPY
545 #define __Pyx_PyUnicode_Concat(a, b) PyNumber_Add(a, b)
546 #define __Pyx_PyUnicode_ConcatSafe(a, b) PyNumber_Add(a, b)
548 #define __Pyx_PyUnicode_Concat(a, b) PyUnicode_Concat(a, b)
549 #define __Pyx_PyUnicode_ConcatSafe(a, b) ((unlikely((a) == Py_None) || unlikely((b) == Py_None)) ?\
550 PyNumber_Add(a, b) : __Pyx_PyUnicode_Concat(a, b))
552 #if CYTHON_COMPILING_IN_PYPY && !defined(PyUnicode_Contains)
553 #define PyUnicode_Contains(u, s) PySequence_Contains(u, s)
555 #if CYTHON_COMPILING_IN_PYPY && !defined(PyByteArray_Check)
556 #define PyByteArray_Check(obj) PyObject_TypeCheck(obj, &PyByteArray_Type)
558 #if CYTHON_COMPILING_IN_PYPY && !defined(PyObject_Format)
559 #define PyObject_Format(obj, fmt) PyObject_CallMethod(obj, "__format__", "O", fmt)
561 #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))
562 #define __Pyx_PyUnicode_FormatSafe(a, b) ((unlikely((a) == Py_None || (PyUnicode_Check(b) && !PyUnicode_CheckExact(b)))) ? PyNumber_Remainder(a, b) : PyUnicode_Format(a, b))
563 #if PY_MAJOR_VERSION >= 3
564 #define __Pyx_PyString_Format(a, b) PyUnicode_Format(a, b)
566 #define __Pyx_PyString_Format(a, b) PyString_Format(a, b)
568 #if PY_MAJOR_VERSION < 3 && !defined(PyObject_ASCII)
569 #define PyObject_ASCII(o) PyObject_Repr(o)
571 #if PY_MAJOR_VERSION >= 3
572 #define PyBaseString_Type PyUnicode_Type
573 #define PyStringObject PyUnicodeObject
574 #define PyString_Type PyUnicode_Type
575 #define PyString_Check PyUnicode_Check
576 #define PyString_CheckExact PyUnicode_CheckExact
577 #ifndef PyObject_Unicode
578 #define PyObject_Unicode PyObject_Str
581 #if PY_MAJOR_VERSION >= 3
582 #define __Pyx_PyBaseString_Check(obj) PyUnicode_Check(obj)
583 #define __Pyx_PyBaseString_CheckExact(obj) PyUnicode_CheckExact(obj)
585 #define __Pyx_PyBaseString_Check(obj) (PyString_Check(obj) || PyUnicode_Check(obj))
586 #define __Pyx_PyBaseString_CheckExact(obj) (PyString_CheckExact(obj) || PyUnicode_CheckExact(obj))
588 #ifndef PySet_CheckExact
589 #define PySet_CheckExact(obj) (Py_TYPE(obj) == &PySet_Type)
591 #if PY_VERSION_HEX >= 0x030900A4
592 #define __Pyx_SET_REFCNT(obj, refcnt) Py_SET_REFCNT(obj, refcnt)
593 #define __Pyx_SET_SIZE(obj, size) Py_SET_SIZE(obj, size)
595 #define __Pyx_SET_REFCNT(obj, refcnt) Py_REFCNT(obj) = (refcnt)
596 #define __Pyx_SET_SIZE(obj, size) Py_SIZE(obj) = (size)
598 #if CYTHON_ASSUME_SAFE_MACROS
599 #define __Pyx_PySequence_SIZE(seq) Py_SIZE(seq)
601 #define __Pyx_PySequence_SIZE(seq) PySequence_Size(seq)
603 #if PY_MAJOR_VERSION >= 3
604 #define PyIntObject PyLongObject
605 #define PyInt_Type PyLong_Type
606 #define PyInt_Check(op) PyLong_Check(op)
607 #define PyInt_CheckExact(op) PyLong_CheckExact(op)
608 #define PyInt_FromString PyLong_FromString
609 #define PyInt_FromUnicode PyLong_FromUnicode
610 #define PyInt_FromLong PyLong_FromLong
611 #define PyInt_FromSize_t PyLong_FromSize_t
612 #define PyInt_FromSsize_t PyLong_FromSsize_t
613 #define PyInt_AsLong PyLong_AsLong
614 #define PyInt_AS_LONG PyLong_AS_LONG
615 #define PyInt_AsSsize_t PyLong_AsSsize_t
616 #define PyInt_AsUnsignedLongMask PyLong_AsUnsignedLongMask
617 #define PyInt_AsUnsignedLongLongMask PyLong_AsUnsignedLongLongMask
618 #define PyNumber_Int PyNumber_Long
620 #if PY_MAJOR_VERSION >= 3
621 #define PyBoolObject PyLongObject
623 #if PY_MAJOR_VERSION >= 3 && CYTHON_COMPILING_IN_PYPY
624 #ifndef PyUnicode_InternFromString
625 #define PyUnicode_InternFromString(s) PyUnicode_FromString(s)
628 #if PY_VERSION_HEX < 0x030200A4
629 typedef long Py_hash_t;
630 #define __Pyx_PyInt_FromHash_t PyInt_FromLong
631 #define __Pyx_PyInt_AsHash_t __Pyx_PyIndex_AsHash_t
633 #define __Pyx_PyInt_FromHash_t PyInt_FromSsize_t
634 #define __Pyx_PyInt_AsHash_t __Pyx_PyIndex_AsSsize_t
636 #if PY_MAJOR_VERSION >= 3
637 #define __Pyx_PyMethod_New(func, self, klass) ((self) ? ((void)(klass), PyMethod_New(func, self)) : __Pyx_NewRef(func))
639 #define __Pyx_PyMethod_New(func, self, klass) PyMethod_New(func, self, klass)
641 #if CYTHON_USE_ASYNC_SLOTS
642 #if PY_VERSION_HEX >= 0x030500B1
643 #define __Pyx_PyAsyncMethodsStruct PyAsyncMethods
644 #define __Pyx_PyType_AsAsync(obj) (Py_TYPE(obj)->tp_as_async)
646 #define __Pyx_PyType_AsAsync(obj) ((__Pyx_PyAsyncMethodsStruct*) (Py_TYPE(obj)->tp_reserved))
649 #define __Pyx_PyType_AsAsync(obj) NULL
651 #ifndef __Pyx_PyAsyncMethodsStruct
656 } __Pyx_PyAsyncMethodsStruct;
659 #if defined(_WIN32) || defined(WIN32) || defined(MS_WINDOWS)
660 #if !defined(_USE_MATH_DEFINES)
661 #define _USE_MATH_DEFINES
666 #define __PYX_NAN() ((float) NAN)
668 static CYTHON_INLINE
float __PYX_NAN() {
670 memset(&value, 0xFF,
sizeof(value));
674 #if defined(__CYGWIN__) && defined(_LDBL_EQ_DBL)
675 #define __Pyx_truncl trunc
677 #define __Pyx_truncl truncl
680 #define __PYX_MARK_ERR_POS(f_index, lineno) \
681 { __pyx_filename = __pyx_f[f_index]; (void)__pyx_filename; __pyx_lineno = lineno; (void)__pyx_lineno; __pyx_clineno = __LINE__; (void)__pyx_clineno; }
682 #define __PYX_ERR(f_index, lineno, Ln_error) \
683 { __PYX_MARK_ERR_POS(f_index, lineno) goto Ln_error; }
685 #ifndef __PYX_EXTERN_C
687 #define __PYX_EXTERN_C extern "C"
689 #define __PYX_EXTERN_C extern
693 #define __PYX_HAVE__csmoothers
694 #define __PYX_HAVE_API__csmoothers
698 #include "numpy/arrayobject.h"
699 #include "numpy/ndarrayobject.h"
700 #include "numpy/ndarraytypes.h"
701 #include "numpy/arrayscalars.h"
702 #include "numpy/ufuncobject.h"
708 #include "pythread.h"
715 #if defined(PYREX_WITHOUT_ASSERTIONS) && !defined(CYTHON_WITHOUT_ASSERTIONS)
716 #define CYTHON_WITHOUT_ASSERTIONS
719 typedef struct {PyObject **p;
const char *
s;
const Py_ssize_t
n;
const char* encoding;
720 const char is_unicode;
const char is_str;
const char intern; } __Pyx_StringTabEntry;
722 #define __PYX_DEFAULT_STRING_ENCODING_IS_ASCII 0
723 #define __PYX_DEFAULT_STRING_ENCODING_IS_UTF8 0
724 #define __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT (PY_MAJOR_VERSION >= 3 && __PYX_DEFAULT_STRING_ENCODING_IS_UTF8)
725 #define __PYX_DEFAULT_STRING_ENCODING ""
726 #define __Pyx_PyObject_FromString __Pyx_PyBytes_FromString
727 #define __Pyx_PyObject_FromStringAndSize __Pyx_PyBytes_FromStringAndSize
728 #define __Pyx_uchar_cast(c) ((unsigned char)c)
729 #define __Pyx_long_cast(x) ((long)x)
730 #define __Pyx_fits_Py_ssize_t(v, type, is_signed) (\
731 (sizeof(type) < sizeof(Py_ssize_t)) ||\
732 (sizeof(type) > sizeof(Py_ssize_t) &&\
733 likely(v < (type)PY_SSIZE_T_MAX ||\
734 v == (type)PY_SSIZE_T_MAX) &&\
735 (!is_signed || likely(v > (type)PY_SSIZE_T_MIN ||\
736 v == (type)PY_SSIZE_T_MIN))) ||\
737 (sizeof(type) == sizeof(Py_ssize_t) &&\
738 (is_signed || likely(v < (type)PY_SSIZE_T_MAX ||\
739 v == (type)PY_SSIZE_T_MAX))) )
740 static CYTHON_INLINE
int __Pyx_is_valid_index(Py_ssize_t i, Py_ssize_t limit) {
741 return (
size_t) i < (size_t) limit;
743 #if defined (__cplusplus) && __cplusplus >= 201103L
745 #define __Pyx_sst_abs(value) std::abs(value)
746 #elif SIZEOF_INT >= SIZEOF_SIZE_T
747 #define __Pyx_sst_abs(value) abs(value)
748 #elif SIZEOF_LONG >= SIZEOF_SIZE_T
749 #define __Pyx_sst_abs(value) labs(value)
750 #elif defined (_MSC_VER)
751 #define __Pyx_sst_abs(value) ((Py_ssize_t)_abs64(value))
752 #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
753 #define __Pyx_sst_abs(value) llabs(value)
754 #elif defined (__GNUC__)
755 #define __Pyx_sst_abs(value) __builtin_llabs(value)
757 #define __Pyx_sst_abs(value) ((value<0) ? -value : value)
759 static CYTHON_INLINE
const char* __Pyx_PyObject_AsString(PyObject*);
760 static CYTHON_INLINE
const char* __Pyx_PyObject_AsStringAndSize(PyObject*, Py_ssize_t* length);
761 #define __Pyx_PyByteArray_FromString(s) PyByteArray_FromStringAndSize((const char*)s, strlen((const char*)s))
762 #define __Pyx_PyByteArray_FromStringAndSize(s, l) PyByteArray_FromStringAndSize((const char*)s, l)
763 #define __Pyx_PyBytes_FromString PyBytes_FromString
764 #define __Pyx_PyBytes_FromStringAndSize PyBytes_FromStringAndSize
765 static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(
const char*);
766 #if PY_MAJOR_VERSION < 3
767 #define __Pyx_PyStr_FromString __Pyx_PyBytes_FromString
768 #define __Pyx_PyStr_FromStringAndSize __Pyx_PyBytes_FromStringAndSize
770 #define __Pyx_PyStr_FromString __Pyx_PyUnicode_FromString
771 #define __Pyx_PyStr_FromStringAndSize __Pyx_PyUnicode_FromStringAndSize
773 #define __Pyx_PyBytes_AsWritableString(s) ((char*) PyBytes_AS_STRING(s))
774 #define __Pyx_PyBytes_AsWritableSString(s) ((signed char*) PyBytes_AS_STRING(s))
775 #define __Pyx_PyBytes_AsWritableUString(s) ((unsigned char*) PyBytes_AS_STRING(s))
776 #define __Pyx_PyBytes_AsString(s) ((const char*) PyBytes_AS_STRING(s))
777 #define __Pyx_PyBytes_AsSString(s) ((const signed char*) PyBytes_AS_STRING(s))
778 #define __Pyx_PyBytes_AsUString(s) ((const unsigned char*) PyBytes_AS_STRING(s))
779 #define __Pyx_PyObject_AsWritableString(s) ((char*) __Pyx_PyObject_AsString(s))
780 #define __Pyx_PyObject_AsWritableSString(s) ((signed char*) __Pyx_PyObject_AsString(s))
781 #define __Pyx_PyObject_AsWritableUString(s) ((unsigned char*) __Pyx_PyObject_AsString(s))
782 #define __Pyx_PyObject_AsSString(s) ((const signed char*) __Pyx_PyObject_AsString(s))
783 #define __Pyx_PyObject_AsUString(s) ((const unsigned char*) __Pyx_PyObject_AsString(s))
784 #define __Pyx_PyObject_FromCString(s) __Pyx_PyObject_FromString((const char*)s)
785 #define __Pyx_PyBytes_FromCString(s) __Pyx_PyBytes_FromString((const char*)s)
786 #define __Pyx_PyByteArray_FromCString(s) __Pyx_PyByteArray_FromString((const char*)s)
787 #define __Pyx_PyStr_FromCString(s) __Pyx_PyStr_FromString((const char*)s)
788 #define __Pyx_PyUnicode_FromCString(s) __Pyx_PyUnicode_FromString((const char*)s)
789 static CYTHON_INLINE
size_t __Pyx_Py_UNICODE_strlen(
const Py_UNICODE *
u) {
790 const Py_UNICODE *u_end =
u;
792 return (
size_t)(u_end -
u - 1);
794 #define __Pyx_PyUnicode_FromUnicode(u) PyUnicode_FromUnicode(u, __Pyx_Py_UNICODE_strlen(u))
795 #define __Pyx_PyUnicode_FromUnicodeAndLength PyUnicode_FromUnicode
796 #define __Pyx_PyUnicode_AsUnicode PyUnicode_AsUnicode
797 #define __Pyx_NewRef(obj) (Py_INCREF(obj), obj)
798 #define __Pyx_Owned_Py_None(b) __Pyx_NewRef(Py_None)
799 static CYTHON_INLINE PyObject * __Pyx_PyBool_FromLong(
long b);
800 static CYTHON_INLINE
int __Pyx_PyObject_IsTrue(PyObject*);
801 static CYTHON_INLINE
int __Pyx_PyObject_IsTrueAndDecref(PyObject*);
802 static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x);
803 #define __Pyx_PySequence_Tuple(obj)\
804 (likely(PyTuple_CheckExact(obj)) ? __Pyx_NewRef(obj) : PySequence_Tuple(obj))
805 static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject*);
806 static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(
size_t);
807 static CYTHON_INLINE Py_hash_t __Pyx_PyIndex_AsHash_t(PyObject*);
808 #if CYTHON_ASSUME_SAFE_MACROS
809 #define __pyx_PyFloat_AsDouble(x) (PyFloat_CheckExact(x) ? PyFloat_AS_DOUBLE(x) : PyFloat_AsDouble(x))
811 #define __pyx_PyFloat_AsDouble(x) PyFloat_AsDouble(x)
813 #define __pyx_PyFloat_AsFloat(x) ((float) __pyx_PyFloat_AsDouble(x))
814 #if PY_MAJOR_VERSION >= 3
815 #define __Pyx_PyNumber_Int(x) (PyLong_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Long(x))
817 #define __Pyx_PyNumber_Int(x) (PyInt_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Int(x))
819 #define __Pyx_PyNumber_Float(x) (PyFloat_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Float(x))
820 #if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
821 static int __Pyx_sys_getdefaultencoding_not_ascii;
822 static int __Pyx_init_sys_getdefaultencoding_params(
void) {
824 PyObject* default_encoding = NULL;
825 PyObject* ascii_chars_u = NULL;
826 PyObject* ascii_chars_b = NULL;
827 const char* default_encoding_c;
828 sys = PyImport_ImportModule(
"sys");
830 default_encoding = PyObject_CallMethod(sys, (
char*)
"getdefaultencoding", NULL);
832 if (!default_encoding)
goto bad;
833 default_encoding_c = PyBytes_AsString(default_encoding);
834 if (!default_encoding_c)
goto bad;
835 if (strcmp(default_encoding_c,
"ascii") == 0) {
836 __Pyx_sys_getdefaultencoding_not_ascii = 0;
838 char ascii_chars[128];
840 for (
c = 0;
c < 128;
c++) {
843 __Pyx_sys_getdefaultencoding_not_ascii = 1;
844 ascii_chars_u = PyUnicode_DecodeASCII(ascii_chars, 128, NULL);
845 if (!ascii_chars_u)
goto bad;
846 ascii_chars_b = PyUnicode_AsEncodedString(ascii_chars_u, default_encoding_c, NULL);
847 if (!ascii_chars_b || !PyBytes_Check(ascii_chars_b) || memcmp(ascii_chars, PyBytes_AS_STRING(ascii_chars_b), 128) != 0) {
850 "This module compiled with c_string_encoding=ascii, but default encoding '%.200s' is not a superset of ascii.",
854 Py_DECREF(ascii_chars_u);
855 Py_DECREF(ascii_chars_b);
857 Py_DECREF(default_encoding);
860 Py_XDECREF(default_encoding);
861 Py_XDECREF(ascii_chars_u);
862 Py_XDECREF(ascii_chars_b);
866 #if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT && PY_MAJOR_VERSION >= 3
867 #define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_DecodeUTF8(c_str, size, NULL)
869 #define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_Decode(c_str, size, __PYX_DEFAULT_STRING_ENCODING, NULL)
870 #if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT
871 static char* __PYX_DEFAULT_STRING_ENCODING;
872 static int __Pyx_init_sys_getdefaultencoding_params(
void) {
874 PyObject* default_encoding = NULL;
875 char* default_encoding_c;
876 sys = PyImport_ImportModule(
"sys");
878 default_encoding = PyObject_CallMethod(sys, (
char*) (
const char*)
"getdefaultencoding", NULL);
880 if (!default_encoding)
goto bad;
881 default_encoding_c = PyBytes_AsString(default_encoding);
882 if (!default_encoding_c)
goto bad;
883 __PYX_DEFAULT_STRING_ENCODING = (
char*) malloc(strlen(default_encoding_c) + 1);
884 if (!__PYX_DEFAULT_STRING_ENCODING)
goto bad;
885 strcpy(__PYX_DEFAULT_STRING_ENCODING, default_encoding_c);
886 Py_DECREF(default_encoding);
889 Py_XDECREF(default_encoding);
897 #if defined(__GNUC__) && (__GNUC__ > 2 || (__GNUC__ == 2 && (__GNUC_MINOR__ > 95)))
898 #define likely(x) __builtin_expect(!!(x), 1)
899 #define unlikely(x) __builtin_expect(!!(x), 0)
901 #define likely(x) (x)
902 #define unlikely(x) (x)
904 static CYTHON_INLINE
void __Pyx_pretend_to_initialize(
void* ptr) { (void)ptr; }
906 static PyObject *__pyx_m = NULL;
907 static PyObject *__pyx_d;
908 static PyObject *__pyx_b;
909 static PyObject *__pyx_cython_runtime = NULL;
910 static PyObject *__pyx_empty_tuple;
911 static PyObject *__pyx_empty_bytes;
912 static PyObject *__pyx_empty_unicode;
913 static int __pyx_lineno;
914 static int __pyx_clineno = 0;
915 static const char * __pyx_cfilenm= __FILE__;
916 static const char *__pyx_filename;
919 #if !defined(CYTHON_CCOMPLEX)
920 #if defined(__cplusplus)
921 #define CYTHON_CCOMPLEX 1
922 #elif defined(_Complex_I)
923 #define CYTHON_CCOMPLEX 1
925 #define CYTHON_CCOMPLEX 0
935 #if CYTHON_CCOMPLEX && !defined(__cplusplus) && defined(__sun__) && defined(__GNUC__)
937 #define _Complex_I 1.0fj
941 static const char *__pyx_f[] = {
942 "proteus/csmoothers.pyx",
946 "proteus/superluWrappers.pxd",
949 struct __pyx_memoryview_obj;
951 struct __pyx_memoryview_obj *memview;
954 Py_ssize_t strides[8];
955 Py_ssize_t suboffsets[8];
956 } __Pyx_memviewslice;
957 #define __Pyx_MemoryView_Len(m) (m.shape[0])
960 #include <pythread.h>
961 #ifndef CYTHON_ATOMICS
962 #define CYTHON_ATOMICS 1
964 #define __pyx_atomic_int_type int
965 #if CYTHON_ATOMICS && __GNUC__ >= 4 && (__GNUC_MINOR__ > 1 ||\
966 (__GNUC_MINOR__ == 1 && __GNUC_PATCHLEVEL >= 2)) &&\
968 #define __pyx_atomic_incr_aligned(value, lock) __sync_fetch_and_add(value, 1)
969 #define __pyx_atomic_decr_aligned(value, lock) __sync_fetch_and_sub(value, 1)
970 #ifdef __PYX_DEBUG_ATOMICS
971 #warning "Using GNU atomics"
973 #elif CYTHON_ATOMICS && defined(_MSC_VER) && 0
975 #undef __pyx_atomic_int_type
976 #define __pyx_atomic_int_type LONG
977 #define __pyx_atomic_incr_aligned(value, lock) InterlockedIncrement(value)
978 #define __pyx_atomic_decr_aligned(value, lock) InterlockedDecrement(value)
979 #ifdef __PYX_DEBUG_ATOMICS
980 #pragma message ("Using MSVC atomics")
982 #elif CYTHON_ATOMICS && (defined(__ICC) || defined(__INTEL_COMPILER)) && 0
983 #define __pyx_atomic_incr_aligned(value, lock) _InterlockedIncrement(value)
984 #define __pyx_atomic_decr_aligned(value, lock) _InterlockedDecrement(value)
985 #ifdef __PYX_DEBUG_ATOMICS
986 #warning "Using Intel atomics"
989 #undef CYTHON_ATOMICS
990 #define CYTHON_ATOMICS 0
991 #ifdef __PYX_DEBUG_ATOMICS
992 #warning "Not using atomics"
995 typedef volatile __pyx_atomic_int_type __pyx_atomic_int;
997 #define __pyx_add_acquisition_count(memview)\
998 __pyx_atomic_incr_aligned(__pyx_get_slice_count_pointer(memview), memview->lock)
999 #define __pyx_sub_acquisition_count(memview)\
1000 __pyx_atomic_decr_aligned(__pyx_get_slice_count_pointer(memview), memview->lock)
1002 #define __pyx_add_acquisition_count(memview)\
1003 __pyx_add_acquisition_count_locked(__pyx_get_slice_count_pointer(memview), memview->lock)
1004 #define __pyx_sub_acquisition_count(memview)\
1005 __pyx_sub_acquisition_count_locked(__pyx_get_slice_count_pointer(memview), memview->lock)
1009 #ifndef __PYX_FORCE_INIT_THREADS
1010 #define __PYX_FORCE_INIT_THREADS 0
1014 #define __Pyx_PyGILState_Ensure PyGILState_Ensure
1015 #define __Pyx_PyGILState_Release PyGILState_Release
1016 #define __Pyx_FastGIL_Remember()
1017 #define __Pyx_FastGIL_Forget()
1018 #define __Pyx_FastGilFuncInit()
1021 #define IS_UNSIGNED(type) (((type) -1) > 0)
1022 struct __Pyx_StructField_;
1023 #define __PYX_BUF_FLAGS_PACKED_STRUCT (1 << 0)
1026 struct __Pyx_StructField_* fields;
1028 size_t arraysize[8];
1034 typedef struct __Pyx_StructField_ {
1035 __Pyx_TypeInfo* type;
1038 } __Pyx_StructField;
1040 __Pyx_StructField* field;
1041 size_t parent_offset;
1042 } __Pyx_BufFmt_StackElem;
1044 __Pyx_StructField root;
1045 __Pyx_BufFmt_StackElem* head;
1047 size_t new_count, enc_count;
1048 size_t struct_alignment;
1053 char is_valid_array;
1054 } __Pyx_BufFmt_Context;
1064 typedef npy_int8 __pyx_t_5numpy_int8_t;
1073 typedef npy_int16 __pyx_t_5numpy_int16_t;
1082 typedef npy_int32 __pyx_t_5numpy_int32_t;
1091 typedef npy_int64 __pyx_t_5numpy_int64_t;
1100 typedef npy_uint8 __pyx_t_5numpy_uint8_t;
1109 typedef npy_uint16 __pyx_t_5numpy_uint16_t;
1118 typedef npy_uint32 __pyx_t_5numpy_uint32_t;
1127 typedef npy_uint64 __pyx_t_5numpy_uint64_t;
1136 typedef npy_float32 __pyx_t_5numpy_float32_t;
1145 typedef npy_float64 __pyx_t_5numpy_float64_t;
1154 typedef npy_long __pyx_t_5numpy_int_t;
1163 typedef npy_longlong __pyx_t_5numpy_long_t;
1172 typedef npy_longlong __pyx_t_5numpy_longlong_t;
1181 typedef npy_ulong __pyx_t_5numpy_uint_t;
1190 typedef npy_ulonglong __pyx_t_5numpy_ulong_t;
1199 typedef npy_ulonglong __pyx_t_5numpy_ulonglong_t;
1208 typedef npy_intp __pyx_t_5numpy_intp_t;
1217 typedef npy_uintp __pyx_t_5numpy_uintp_t;
1226 typedef npy_double __pyx_t_5numpy_float_t;
1235 typedef npy_double __pyx_t_5numpy_double_t;
1244 typedef npy_longdouble __pyx_t_5numpy_longdouble_t;
1253 typedef int __pyx_t_10csmoothers_PROTEUS_LAPACK_INTEGER;
1257 typedef ::std::complex< float > __pyx_t_float_complex;
1259 typedef float _Complex __pyx_t_float_complex;
1262 typedef struct {
float real, imag; } __pyx_t_float_complex;
1264 static CYTHON_INLINE __pyx_t_float_complex __pyx_t_float_complex_from_parts(
float,
float);
1269 typedef ::std::complex< double > __pyx_t_double_complex;
1271 typedef double _Complex __pyx_t_double_complex;
1274 typedef struct {
double real, imag; } __pyx_t_double_complex;
1276 static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(
double,
double);
1280 struct __pyx_obj_7proteus_15superluWrappers_cSparseMatrix;
1281 struct __pyx_obj_10csmoothers_cASMFactor;
1282 struct __pyx_obj_10csmoothers_cBASMFactor;
1283 struct __pyx_array_obj;
1284 struct __pyx_MemviewEnum_obj;
1285 struct __pyx_memoryview_obj;
1286 struct __pyx_memoryviewslice_obj;
1295 typedef npy_cfloat __pyx_t_5numpy_cfloat_t;
1304 typedef npy_cdouble __pyx_t_5numpy_cdouble_t;
1313 typedef npy_clongdouble __pyx_t_5numpy_clongdouble_t;
1322 typedef npy_cdouble __pyx_t_5numpy_complex_t;
1323 struct __pyx_t_7proteus_15superluWrappers__NRformat;
1332 struct __pyx_t_7proteus_15superluWrappers__NRformat {
1333 __pyx_t_5numpy_int32_t
nnz;
1334 __pyx_t_5numpy_float64_t *nzval;
1335 __pyx_t_5numpy_int32_t *colind;
1336 __pyx_t_5numpy_int32_t *rowptr;
1346 typedef __Pyx_memviewslice __pyx_t_10csmoothers_DDATA;
1355 typedef __Pyx_memviewslice __pyx_t_10csmoothers_IDATA;
1364 typedef SuperMatrix __pyx_t_10csmoothers_SuperMatrix;
1373 struct __pyx_obj_7proteus_15superluWrappers_cSparseMatrix {
1375 __pyx_t_5numpy_int32_t dim[2];
1376 struct __pyx_t_7proteus_15superluWrappers__NRformat A;
1387 struct __pyx_obj_10csmoothers_cASMFactor {
1392 double **subdomain_L;
1393 double **subdomain_R;
1394 double **subdomain_dX;
1395 __pyx_t_10csmoothers_PROTEUS_LAPACK_INTEGER **subdomain_pivots;
1406 struct __pyx_obj_10csmoothers_cBASMFactor {
1412 double **subdomain_L;
1413 double **subdomain_R;
1414 double **subdomain_dX;
1415 __pyx_t_10csmoothers_PROTEUS_LAPACK_INTEGER **subdomain_pivots;
1416 __pyx_t_10csmoothers_PROTEUS_LAPACK_INTEGER **subdomain_col_pivots;
1427 struct __pyx_array_obj {
1429 struct __pyx_vtabstruct_array *__pyx_vtab;
1435 Py_ssize_t *_strides;
1436 Py_ssize_t itemsize;
1439 void (*callback_free_data)(
void *);
1441 int dtype_is_object;
1452 struct __pyx_MemviewEnum_obj {
1465 struct __pyx_memoryview_obj {
1467 struct __pyx_vtabstruct_memoryview *__pyx_vtab;
1470 PyObject *_array_interface;
1471 PyThread_type_lock lock;
1472 __pyx_atomic_int acquisition_count[2];
1473 __pyx_atomic_int *acquisition_count_aligned_p;
1476 int dtype_is_object;
1477 __Pyx_TypeInfo *typeinfo;
1488 struct __pyx_memoryviewslice_obj {
1489 struct __pyx_memoryview_obj __pyx_base;
1490 __Pyx_memviewslice from_slice;
1491 PyObject *from_object;
1492 PyObject *(*to_object_func)(
char *);
1493 int (*to_dtype_func)(
char *, PyObject *);
1506 struct __pyx_vtabstruct_array {
1507 PyObject *(*get_memview)(
struct __pyx_array_obj *);
1509 static struct __pyx_vtabstruct_array *__pyx_vtabptr_array;
1520 struct __pyx_vtabstruct_memoryview {
1521 char *(*get_item_pointer)(
struct __pyx_memoryview_obj *, PyObject *);
1522 PyObject *(*is_slice)(
struct __pyx_memoryview_obj *, PyObject *);
1523 PyObject *(*setitem_slice_assignment)(
struct __pyx_memoryview_obj *, PyObject *, PyObject *);
1524 PyObject *(*setitem_slice_assign_scalar)(
struct __pyx_memoryview_obj *,
struct __pyx_memoryview_obj *, PyObject *);
1525 PyObject *(*setitem_indexed)(
struct __pyx_memoryview_obj *, PyObject *, PyObject *);
1526 PyObject *(*convert_item_to_object)(
struct __pyx_memoryview_obj *,
char *);
1527 PyObject *(*assign_item_from_object)(
struct __pyx_memoryview_obj *,
char *, PyObject *);
1529 static struct __pyx_vtabstruct_memoryview *__pyx_vtabptr_memoryview;
1540 struct __pyx_vtabstruct__memoryviewslice {
1541 struct __pyx_vtabstruct_memoryview __pyx_base;
1543 static struct __pyx_vtabstruct__memoryviewslice *__pyx_vtabptr__memoryviewslice;
1547 #ifndef CYTHON_REFNANNY
1548 #define CYTHON_REFNANNY 0
1552 void (*INCREF)(
void*, PyObject*, int);
1553 void (*DECREF)(
void*, PyObject*, int);
1554 void (*GOTREF)(
void*, PyObject*, int);
1555 void (*GIVEREF)(
void*, PyObject*, int);
1556 void* (*SetupContext)(
const char*, int,
const char*);
1557 void (*FinishContext)(
void**);
1558 } __Pyx_RefNannyAPIStruct;
1559 static __Pyx_RefNannyAPIStruct *__Pyx_RefNanny = NULL;
1560 static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(
const char *modname);
1561 #define __Pyx_RefNannyDeclarations void *__pyx_refnanny = NULL;
1563 #define __Pyx_RefNannySetupContext(name, acquire_gil)\
1565 PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();\
1566 __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__);\
1567 PyGILState_Release(__pyx_gilstate_save);\
1569 __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__);\
1572 #define __Pyx_RefNannySetupContext(name, acquire_gil)\
1573 __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__)
1575 #define __Pyx_RefNannyFinishContext()\
1576 __Pyx_RefNanny->FinishContext(&__pyx_refnanny)
1577 #define __Pyx_INCREF(r) __Pyx_RefNanny->INCREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
1578 #define __Pyx_DECREF(r) __Pyx_RefNanny->DECREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
1579 #define __Pyx_GOTREF(r) __Pyx_RefNanny->GOTREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
1580 #define __Pyx_GIVEREF(r) __Pyx_RefNanny->GIVEREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
1581 #define __Pyx_XINCREF(r) do { if((r) != NULL) {__Pyx_INCREF(r); }} while(0)
1582 #define __Pyx_XDECREF(r) do { if((r) != NULL) {__Pyx_DECREF(r); }} while(0)
1583 #define __Pyx_XGOTREF(r) do { if((r) != NULL) {__Pyx_GOTREF(r); }} while(0)
1584 #define __Pyx_XGIVEREF(r) do { if((r) != NULL) {__Pyx_GIVEREF(r);}} while(0)
1586 #define __Pyx_RefNannyDeclarations
1587 #define __Pyx_RefNannySetupContext(name, acquire_gil)
1588 #define __Pyx_RefNannyFinishContext()
1589 #define __Pyx_INCREF(r) Py_INCREF(r)
1590 #define __Pyx_DECREF(r) Py_DECREF(r)
1591 #define __Pyx_GOTREF(r)
1592 #define __Pyx_GIVEREF(r)
1593 #define __Pyx_XINCREF(r) Py_XINCREF(r)
1594 #define __Pyx_XDECREF(r) Py_XDECREF(r)
1595 #define __Pyx_XGOTREF(r)
1596 #define __Pyx_XGIVEREF(r)
1598 #define __Pyx_XDECREF_SET(r, v) do {\
1599 PyObject *tmp = (PyObject *) r;\
1600 r = v; __Pyx_XDECREF(tmp);\
1602 #define __Pyx_DECREF_SET(r, v) do {\
1603 PyObject *tmp = (PyObject *) r;\
1604 r = v; __Pyx_DECREF(tmp);\
1606 #define __Pyx_CLEAR(r) do { PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);} while(0)
1607 #define __Pyx_XCLEAR(r) do { if((r) != NULL) {PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);}} while(0)
1610 #if CYTHON_USE_TYPE_SLOTS
1611 static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name);
1613 #define __Pyx_PyObject_GetAttrStr(o,n) PyObject_GetAttr(o,n)
1617 static PyObject *__Pyx_GetBuiltinName(PyObject *name);
1620 static void __Pyx_RaiseArgtupleInvalid(
const char* func_name,
int exact,
1621 Py_ssize_t num_min, Py_ssize_t num_max, Py_ssize_t num_found);
1624 static void __Pyx_RaiseDoubleKeywordsError(
const char* func_name, PyObject* kw_name);
1627 static int __Pyx_ParseOptionalKeywords(PyObject *kwds, PyObject **argnames[],\
1628 PyObject *kwds2, PyObject *values[], Py_ssize_t num_pos_args,\
1629 const char* function_name);
1632 #if CYTHON_USE_TYPE_SLOTS
1633 #define __Pyx_PyObject_DelAttrStr(o,n) __Pyx_PyObject_SetAttrStr(o, n, NULL)
1634 static CYTHON_INLINE
int __Pyx_PyObject_SetAttrStr(PyObject* obj, PyObject* attr_name, PyObject* value);
1636 #define __Pyx_PyObject_DelAttrStr(o,n) PyObject_DelAttr(o,n)
1637 #define __Pyx_PyObject_SetAttrStr(o,n,v) PyObject_SetAttr(o,n,v)
1641 #if CYTHON_FAST_PYCCALL
1642 static CYTHON_INLINE PyObject *__Pyx_PyCFunction_FastCall(PyObject *func, PyObject **args, Py_ssize_t nargs);
1644 #define __Pyx_PyCFunction_FastCall(func, args, nargs) (assert(0), NULL)
1648 #if CYTHON_FAST_PYCALL
1649 #define __Pyx_PyFunction_FastCall(func, args, nargs)\
1650 __Pyx_PyFunction_FastCallDict((func), (args), (nargs), NULL)
1651 #if 1 || PY_VERSION_HEX < 0x030600B1
1652 static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args, Py_ssize_t nargs, PyObject *kwargs);
1654 #define __Pyx_PyFunction_FastCallDict(func, args, nargs, kwargs) _PyFunction_FastCallDict(func, args, nargs, kwargs)
1656 #define __Pyx_BUILD_ASSERT_EXPR(cond)\
1657 (sizeof(char [1 - 2*!(cond)]) - 1)
1658 #ifndef Py_MEMBER_SIZE
1659 #define Py_MEMBER_SIZE(type, member) sizeof(((type *)0)->member)
1661 #if CYTHON_FAST_PYCALL
1662 static size_t __pyx_pyframe_localsplus_offset = 0;
1663 #include "frameobject.h"
1664 #if PY_VERSION_HEX >= 0x030b00a6
1665 #ifndef Py_BUILD_CORE
1666 #define Py_BUILD_CORE 1
1668 #include "internal/pycore_frame.h"
1670 #define __Pxy_PyFrame_Initialize_Offsets()\
1671 ((void)__Pyx_BUILD_ASSERT_EXPR(sizeof(PyFrameObject) == offsetof(PyFrameObject, f_localsplus) + Py_MEMBER_SIZE(PyFrameObject, f_localsplus)),\
1672 (void)(__pyx_pyframe_localsplus_offset = ((size_t)PyFrame_Type.tp_basicsize) - Py_MEMBER_SIZE(PyFrameObject, f_localsplus)))
1673 #define __Pyx_PyFrame_GetLocalsplus(frame)\
1674 (assert(__pyx_pyframe_localsplus_offset), (PyObject **)(((char *)(frame)) + __pyx_pyframe_localsplus_offset))
1675 #endif // CYTHON_FAST_PYCALL
1679 #if CYTHON_COMPILING_IN_CPYTHON
1680 static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw);
1682 #define __Pyx_PyObject_Call(func, arg, kw) PyObject_Call(func, arg, kw)
1686 #if CYTHON_COMPILING_IN_CPYTHON
1687 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg);
1691 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg);
1694 #define __Pyx_ArgTypeTest(obj, type, none_allowed, name, exact)\
1695 ((likely((Py_TYPE(obj) == type) | (none_allowed && (obj == Py_None)))) ? 1 :\
1696 __Pyx__ArgTypeTest(obj, type, name, exact))
1697 static int __Pyx__ArgTypeTest(PyObject *obj, PyTypeObject *type,
const char *name,
int exact);
1700 #if CYTHON_FAST_THREAD_STATE
1701 #define __Pyx_PyThreadState_declare PyThreadState *__pyx_tstate;
1702 #define __Pyx_PyThreadState_assign __pyx_tstate = __Pyx_PyThreadState_Current;
1703 #define __Pyx_PyErr_Occurred() __pyx_tstate->curexc_type
1705 #define __Pyx_PyThreadState_declare
1706 #define __Pyx_PyThreadState_assign
1707 #define __Pyx_PyErr_Occurred() PyErr_Occurred()
1711 #if CYTHON_FAST_THREAD_STATE
1712 #define __Pyx_PyErr_Clear() __Pyx_ErrRestore(NULL, NULL, NULL)
1713 #define __Pyx_ErrRestoreWithState(type, value, tb) __Pyx_ErrRestoreInState(PyThreadState_GET(), type, value, tb)
1714 #define __Pyx_ErrFetchWithState(type, value, tb) __Pyx_ErrFetchInState(PyThreadState_GET(), type, value, tb)
1715 #define __Pyx_ErrRestore(type, value, tb) __Pyx_ErrRestoreInState(__pyx_tstate, type, value, tb)
1716 #define __Pyx_ErrFetch(type, value, tb) __Pyx_ErrFetchInState(__pyx_tstate, type, value, tb)
1717 static CYTHON_INLINE
void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb);
1718 static CYTHON_INLINE
void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb);
1719 #if CYTHON_COMPILING_IN_CPYTHON
1720 #define __Pyx_PyErr_SetNone(exc) (Py_INCREF(exc), __Pyx_ErrRestore((exc), NULL, NULL))
1722 #define __Pyx_PyErr_SetNone(exc) PyErr_SetNone(exc)
1725 #define __Pyx_PyErr_Clear() PyErr_Clear()
1726 #define __Pyx_PyErr_SetNone(exc) PyErr_SetNone(exc)
1727 #define __Pyx_ErrRestoreWithState(type, value, tb) PyErr_Restore(type, value, tb)
1728 #define __Pyx_ErrFetchWithState(type, value, tb) PyErr_Fetch(type, value, tb)
1729 #define __Pyx_ErrRestoreInState(tstate, type, value, tb) PyErr_Restore(type, value, tb)
1730 #define __Pyx_ErrFetchInState(tstate, type, value, tb) PyErr_Fetch(type, value, tb)
1731 #define __Pyx_ErrRestore(type, value, tb) PyErr_Restore(type, value, tb)
1732 #define __Pyx_ErrFetch(type, value, tb) PyErr_Fetch(type, value, tb)
1736 static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause);
1739 static CYTHON_INLINE
int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type);
1742 #define __Pyx_BUF_MAX_NDIMS %(BUF_MAX_NDIMS)d
1743 #define __Pyx_MEMVIEW_DIRECT 1
1744 #define __Pyx_MEMVIEW_PTR 2
1745 #define __Pyx_MEMVIEW_FULL 4
1746 #define __Pyx_MEMVIEW_CONTIG 8
1747 #define __Pyx_MEMVIEW_STRIDED 16
1748 #define __Pyx_MEMVIEW_FOLLOW 32
1749 #define __Pyx_IS_C_CONTIG 1
1750 #define __Pyx_IS_F_CONTIG 2
1751 static int __Pyx_init_memviewslice(
1752 struct __pyx_memoryview_obj *memview,
1754 __Pyx_memviewslice *memviewslice,
1755 int memview_is_new_reference);
1756 static CYTHON_INLINE
int __pyx_add_acquisition_count_locked(
1757 __pyx_atomic_int *acquisition_count, PyThread_type_lock lock);
1758 static CYTHON_INLINE
int __pyx_sub_acquisition_count_locked(
1759 __pyx_atomic_int *acquisition_count, PyThread_type_lock lock);
1760 #define __pyx_get_slice_count_pointer(memview) (memview->acquisition_count_aligned_p)
1761 #define __pyx_get_slice_count(memview) (*__pyx_get_slice_count_pointer(memview))
1762 #define __PYX_INC_MEMVIEW(slice, have_gil) __Pyx_INC_MEMVIEW(slice, have_gil, __LINE__)
1763 #define __PYX_XDEC_MEMVIEW(slice, have_gil) __Pyx_XDEC_MEMVIEW(slice, have_gil, __LINE__)
1764 static CYTHON_INLINE
void __Pyx_INC_MEMVIEW(__Pyx_memviewslice *,
int,
int);
1765 static CYTHON_INLINE
void __Pyx_XDEC_MEMVIEW(__Pyx_memviewslice *,
int,
int);
1768 static void __Pyx_RaiseBufferIndexError(
int axis);
1771 static void __Pyx_WriteUnraisable(
const char *name,
int clineno,
1772 int lineno,
const char *filename,
1773 int full_traceback,
int nogil);
1776 #if CYTHON_USE_EXC_INFO_STACK
1777 static _PyErr_StackItem * __Pyx_PyErr_GetTopmostException(PyThreadState *tstate);
1781 #if CYTHON_FAST_THREAD_STATE
1782 #define __Pyx_ExceptionSave(type, value, tb) __Pyx__ExceptionSave(__pyx_tstate, type, value, tb)
1783 static CYTHON_INLINE
void __Pyx__ExceptionSave(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb);
1784 #define __Pyx_ExceptionReset(type, value, tb) __Pyx__ExceptionReset(__pyx_tstate, type, value, tb)
1785 static CYTHON_INLINE
void __Pyx__ExceptionReset(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb);
1787 #define __Pyx_ExceptionSave(type, value, tb) PyErr_GetExcInfo(type, value, tb)
1788 #define __Pyx_ExceptionReset(type, value, tb) PyErr_SetExcInfo(type, value, tb)
1792 #if CYTHON_FAST_THREAD_STATE
1793 #define __Pyx_PyErr_ExceptionMatches(err) __Pyx_PyErr_ExceptionMatchesInState(__pyx_tstate, err)
1794 static CYTHON_INLINE
int __Pyx_PyErr_ExceptionMatchesInState(PyThreadState* tstate, PyObject* err);
1796 #define __Pyx_PyErr_ExceptionMatches(err) PyErr_ExceptionMatches(err)
1800 #if CYTHON_FAST_THREAD_STATE
1801 #define __Pyx_GetException(type, value, tb) __Pyx__GetException(__pyx_tstate, type, value, tb)
1802 static int __Pyx__GetException(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb);
1804 static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb);
1808 static CYTHON_UNUSED PyObject* __Pyx_PyObject_Call2Args(PyObject*
function, PyObject* arg1, PyObject* arg2);
1814 static CYTHON_INLINE
int __Pyx_PyBytes_Equals(PyObject* s1, PyObject* s2,
int equals);
1817 static CYTHON_INLINE
int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2,
int equals);
1820 #if PY_MAJOR_VERSION >= 3
1821 #define __Pyx_PyString_Equals __Pyx_PyUnicode_Equals
1823 #define __Pyx_PyString_Equals __Pyx_PyBytes_Equals
1827 static CYTHON_INLINE Py_ssize_t __Pyx_div_Py_ssize_t(Py_ssize_t, Py_ssize_t);
1830 #define UNARY_NEG_WOULD_OVERFLOW(x)\
1831 (((x) < 0) & ((unsigned long)(x) == 0-(unsigned long)(x)))
1833 static CYTHON_UNUSED
int __pyx_array_getbuffer(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info,
int __pyx_v_flags);
1834 static PyObject *__pyx_array_get_memview(
struct __pyx_array_obj *);
1836 static CYTHON_INLINE PyObject *__Pyx_GetAttr(PyObject *, PyObject *);
1839 #define __Pyx_GetItemInt(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\
1840 (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\
1841 __Pyx_GetItemInt_Fast(o, (Py_ssize_t)i, is_list, wraparound, boundscheck) :\
1842 (is_list ? (PyErr_SetString(PyExc_IndexError, "list index out of range"), (PyObject*)NULL) :\
1843 __Pyx_GetItemInt_Generic(o, to_py_func(i))))
1844 #define __Pyx_GetItemInt_List(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\
1845 (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\
1846 __Pyx_GetItemInt_List_Fast(o, (Py_ssize_t)i, wraparound, boundscheck) :\
1847 (PyErr_SetString(PyExc_IndexError, "list index out of range"), (PyObject*)NULL))
1848 static CYTHON_INLINE PyObject *__Pyx_GetItemInt_List_Fast(PyObject *o, Py_ssize_t i,
1849 int wraparound,
int boundscheck);
1850 #define __Pyx_GetItemInt_Tuple(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\
1851 (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\
1852 __Pyx_GetItemInt_Tuple_Fast(o, (Py_ssize_t)i, wraparound, boundscheck) :\
1853 (PyErr_SetString(PyExc_IndexError, "tuple index out of range"), (PyObject*)NULL))
1854 static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize_t i,
1855 int wraparound,
int boundscheck);
1856 static PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j);
1857 static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i,
1858 int is_list,
int wraparound,
int boundscheck);
1861 #if CYTHON_USE_TYPE_SLOTS
1862 static CYTHON_INLINE PyObject *__Pyx_PyObject_GetItem(PyObject *obj, PyObject* key);
1864 #define __Pyx_PyObject_GetItem(obj, key) PyObject_GetItem(obj, key)
1868 static CYTHON_INLINE PyObject *__Pyx_PyUnicode_DecodeUTF16(
const char *
s, Py_ssize_t size,
const char *errors) {
1870 return PyUnicode_DecodeUTF16(
s, size, errors, &byteorder);
1872 static CYTHON_INLINE PyObject *__Pyx_PyUnicode_DecodeUTF16LE(
const char *
s, Py_ssize_t size,
const char *errors) {
1874 return PyUnicode_DecodeUTF16(
s, size, errors, &byteorder);
1876 static CYTHON_INLINE PyObject *__Pyx_PyUnicode_DecodeUTF16BE(
const char *
s, Py_ssize_t size,
const char *errors) {
1878 return PyUnicode_DecodeUTF16(
s, size, errors, &byteorder);
1882 static CYTHON_INLINE PyObject* __Pyx_decode_c_string(
1883 const char* cstring, Py_ssize_t start, Py_ssize_t stop,
1884 const char* encoding,
const char* errors,
1885 PyObject* (*decode_func)(
const char *
s, Py_ssize_t size,
const char *errors));
1888 static CYTHON_INLINE PyObject *__Pyx_GetAttr3(PyObject *, PyObject *, PyObject *);
1891 #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_TYPE_SLOTS
1892 #define __PYX_DICT_VERSION_INIT ((PY_UINT64_T) -1)
1893 #define __PYX_GET_DICT_VERSION(dict) (((PyDictObject*)(dict))->ma_version_tag)
1894 #define __PYX_UPDATE_DICT_CACHE(dict, value, cache_var, version_var)\
1895 (version_var) = __PYX_GET_DICT_VERSION(dict);\
1896 (cache_var) = (value);
1897 #define __PYX_PY_DICT_LOOKUP_IF_MODIFIED(VAR, DICT, LOOKUP) {\
1898 static PY_UINT64_T __pyx_dict_version = 0;\
1899 static PyObject *__pyx_dict_cached_value = NULL;\
1900 if (likely(__PYX_GET_DICT_VERSION(DICT) == __pyx_dict_version)) {\
1901 (VAR) = __pyx_dict_cached_value;\
1903 (VAR) = __pyx_dict_cached_value = (LOOKUP);\
1904 __pyx_dict_version = __PYX_GET_DICT_VERSION(DICT);\
1907 static CYTHON_INLINE PY_UINT64_T __Pyx_get_tp_dict_version(PyObject *obj);
1908 static CYTHON_INLINE PY_UINT64_T __Pyx_get_object_dict_version(PyObject *obj);
1909 static CYTHON_INLINE
int __Pyx_object_dict_version_matches(PyObject* obj, PY_UINT64_T tp_dict_version, PY_UINT64_T obj_dict_version);
1911 #define __PYX_GET_DICT_VERSION(dict) (0)
1912 #define __PYX_UPDATE_DICT_CACHE(dict, value, cache_var, version_var)
1913 #define __PYX_PY_DICT_LOOKUP_IF_MODIFIED(VAR, DICT, LOOKUP) (VAR) = (LOOKUP);
1917 #if CYTHON_USE_DICT_VERSIONS
1918 #define __Pyx_GetModuleGlobalName(var, name) {\
1919 static PY_UINT64_T __pyx_dict_version = 0;\
1920 static PyObject *__pyx_dict_cached_value = NULL;\
1921 (var) = (likely(__pyx_dict_version == __PYX_GET_DICT_VERSION(__pyx_d))) ?\
1922 (likely(__pyx_dict_cached_value) ? __Pyx_NewRef(__pyx_dict_cached_value) : __Pyx_GetBuiltinName(name)) :\
1923 __Pyx__GetModuleGlobalName(name, &__pyx_dict_version, &__pyx_dict_cached_value);\
1925 #define __Pyx_GetModuleGlobalNameUncached(var, name) {\
1926 PY_UINT64_T __pyx_dict_version;\
1927 PyObject *__pyx_dict_cached_value;\
1928 (var) = __Pyx__GetModuleGlobalName(name, &__pyx_dict_version, &__pyx_dict_cached_value);\
1930 static PyObject *__Pyx__GetModuleGlobalName(PyObject *name, PY_UINT64_T *dict_version, PyObject **dict_cached_value);
1932 #define __Pyx_GetModuleGlobalName(var, name) (var) = __Pyx__GetModuleGlobalName(name)
1933 #define __Pyx_GetModuleGlobalNameUncached(var, name) (var) = __Pyx__GetModuleGlobalName(name)
1934 static CYTHON_INLINE PyObject *__Pyx__GetModuleGlobalName(PyObject *name);
1938 static CYTHON_INLINE
void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected);
1941 static CYTHON_INLINE
void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index);
1944 static CYTHON_INLINE
void __Pyx_RaiseNoneNotIterableError(
void);
1947 #if CYTHON_FAST_THREAD_STATE
1948 #define __Pyx_ExceptionSwap(type, value, tb) __Pyx__ExceptionSwap(__pyx_tstate, type, value, tb)
1949 static CYTHON_INLINE
void __Pyx__ExceptionSwap(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb);
1951 static CYTHON_INLINE
void __Pyx_ExceptionSwap(PyObject **type, PyObject **value, PyObject **tb);
1955 static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list,
int level);
1958 #if CYTHON_COMPILING_IN_CPYTHON
1959 #define __Pyx_TypeCheck(obj, type) __Pyx_IsSubtype(Py_TYPE(obj), (PyTypeObject *)type)
1960 static CYTHON_INLINE
int __Pyx_IsSubtype(PyTypeObject *a, PyTypeObject *b);
1961 static CYTHON_INLINE
int __Pyx_PyErr_GivenExceptionMatches(PyObject *err, PyObject *type);
1962 static CYTHON_INLINE
int __Pyx_PyErr_GivenExceptionMatches2(PyObject *err, PyObject *type1, PyObject *type2);
1964 #define __Pyx_TypeCheck(obj, type) PyObject_TypeCheck(obj, (PyTypeObject *)type)
1965 #define __Pyx_PyErr_GivenExceptionMatches(err, type) PyErr_GivenExceptionMatches(err, type)
1966 #define __Pyx_PyErr_GivenExceptionMatches2(err, type1, type2) (PyErr_GivenExceptionMatches(err, type1) || PyErr_GivenExceptionMatches(err, type2))
1968 #define __Pyx_PyException_Check(obj) __Pyx_TypeCheck(obj, PyExc_Exception)
1970 static CYTHON_UNUSED
int __pyx_memoryview_getbuffer(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info,
int __pyx_v_flags);
1972 #if CYTHON_USE_PYLIST_INTERNALS && CYTHON_ASSUME_SAFE_MACROS
1973 static CYTHON_INLINE
int __Pyx_ListComp_Append(PyObject* list, PyObject* x) {
1974 PyListObject*
L = (PyListObject*) list;
1975 Py_ssize_t len = Py_SIZE(list);
1976 if (likely(
L->allocated > len)) {
1978 PyList_SET_ITEM(list, len, x);
1979 __Pyx_SET_SIZE(list, len + 1);
1982 return PyList_Append(list, x);
1985 #define __Pyx_ListComp_Append(L,x) PyList_Append(L,x)
1989 #if !CYTHON_COMPILING_IN_PYPY
1990 static PyObject* __Pyx_PyInt_AddObjC(PyObject *op1, PyObject *op2,
long intval,
int inplace,
int zerodivision_check);
1992 #define __Pyx_PyInt_AddObjC(op1, op2, intval, inplace, zerodivision_check)\
1993 (inplace ? PyNumber_InPlaceAdd(op1, op2) : PyNumber_Add(op1, op2))
1997 static CYTHON_INLINE
int __Pyx_PyList_Extend(PyObject*
L, PyObject*
v) {
1998 #if CYTHON_COMPILING_IN_CPYTHON
1999 PyObject* none = _PyList_Extend((PyListObject*)
L,
v);
2000 if (unlikely(!none))
2005 return PyList_SetSlice(
L, PY_SSIZE_T_MAX, PY_SSIZE_T_MAX,
v);
2010 #if CYTHON_USE_PYLIST_INTERNALS && CYTHON_ASSUME_SAFE_MACROS
2011 static CYTHON_INLINE
int __Pyx_PyList_Append(PyObject* list, PyObject* x) {
2012 PyListObject*
L = (PyListObject*) list;
2013 Py_ssize_t len = Py_SIZE(list);
2014 if (likely(
L->allocated > len) & likely(len > (
L->allocated >> 1))) {
2016 PyList_SET_ITEM(list, len, x);
2017 __Pyx_SET_SIZE(list, len + 1);
2020 return PyList_Append(list, x);
2023 #define __Pyx_PyList_Append(L,x) PyList_Append(L,x)
2027 static CYTHON_INLINE
void __Pyx_RaiseUnboundLocalError(
const char *varname);
2030 static CYTHON_INLINE
long __Pyx_div_long(
long,
long);
2033 static CYTHON_INLINE
int __Pyx_PySequence_ContainsTF(PyObject* item, PyObject* seq,
int eq) {
2034 int result = PySequence_Contains(seq, item);
2035 return unlikely(result < 0) ? result : (result == (eq == Py_EQ));
2039 static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name);
2042 static CYTHON_INLINE
int __Pyx_HasAttr(PyObject *, PyObject *);
2045 #if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000
2046 static CYTHON_INLINE PyObject* __Pyx_PyObject_GenericGetAttrNoDict(PyObject* obj, PyObject* attr_name);
2048 #define __Pyx_PyObject_GenericGetAttrNoDict PyObject_GenericGetAttr
2052 #if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000
2053 static PyObject* __Pyx_PyObject_GenericGetAttr(PyObject* obj, PyObject* attr_name);
2055 #define __Pyx_PyObject_GenericGetAttr PyObject_GenericGetAttr
2059 static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStrNoError(PyObject* obj, PyObject* attr_name);
2062 static int __Pyx_setup_reduce(PyObject* type_obj);
2065 static int __Pyx_SetVtable(PyObject *dict,
void *vtable);
2068 #ifndef __PYX_HAVE_RT_ImportType_proto
2069 #define __PYX_HAVE_RT_ImportType_proto
2070 enum __Pyx_ImportType_CheckSize {
2071 __Pyx_ImportType_CheckSize_Error = 0,
2072 __Pyx_ImportType_CheckSize_Warn = 1,
2073 __Pyx_ImportType_CheckSize_Ignore = 2
2075 static PyTypeObject *__Pyx_ImportType(PyObject* module,
const char *module_name,
const char *class_name,
size_t size,
enum __Pyx_ImportType_CheckSize check_size);
2079 static PyObject *__Pyx_CalculateMetaclass(PyTypeObject *metaclass, PyObject *bases);
2082 static PyTypeObject* __Pyx_FetchCommonType(PyTypeObject* type);
2085 #define __Pyx_CyFunction_USED 1
2086 #define __Pyx_CYFUNCTION_STATICMETHOD 0x01
2087 #define __Pyx_CYFUNCTION_CLASSMETHOD 0x02
2088 #define __Pyx_CYFUNCTION_CCLASS 0x04
2089 #define __Pyx_CyFunction_GetClosure(f)\
2090 (((__pyx_CyFunctionObject *) (f))->func_closure)
2091 #define __Pyx_CyFunction_GetClassObj(f)\
2092 (((__pyx_CyFunctionObject *) (f))->func_classobj)
2093 #define __Pyx_CyFunction_Defaults(type, f)\
2094 ((type *)(((__pyx_CyFunctionObject *) (f))->defaults))
2095 #define __Pyx_CyFunction_SetDefaultsGetter(f, g)\
2096 ((__pyx_CyFunctionObject *) (f))->defaults_getter = (g)
2098 PyCFunctionObject func;
2099 #if PY_VERSION_HEX < 0x030500A0
2100 PyObject *func_weakreflist;
2102 PyObject *func_dict;
2103 PyObject *func_name;
2104 PyObject *func_qualname;
2106 PyObject *func_globals;
2107 PyObject *func_code;
2108 PyObject *func_closure;
2109 PyObject *func_classobj;
2111 int defaults_pyobjects;
2112 size_t defaults_size;
2114 PyObject *defaults_tuple;
2115 PyObject *defaults_kwdict;
2116 PyObject *(*defaults_getter)(PyObject *);
2117 PyObject *func_annotations;
2118 } __pyx_CyFunctionObject;
2119 static PyTypeObject *__pyx_CyFunctionType = 0;
2120 #define __Pyx_CyFunction_Check(obj) (__Pyx_TypeCheck(obj, __pyx_CyFunctionType))
2121 static PyObject *__Pyx_CyFunction_Init(__pyx_CyFunctionObject* op, PyMethodDef *ml,
2122 int flags, PyObject* qualname,
2124 PyObject *module, PyObject *globals,
2126 static CYTHON_INLINE
void *__Pyx_CyFunction_InitDefaults(PyObject *m,
2129 static CYTHON_INLINE
void __Pyx_CyFunction_SetDefaultsTuple(PyObject *m,
2131 static CYTHON_INLINE
void __Pyx_CyFunction_SetDefaultsKwDict(PyObject *m,
2133 static CYTHON_INLINE
void __Pyx_CyFunction_SetAnnotationsDict(PyObject *m,
2135 static int __pyx_CyFunction_init(
void);
2138 static PyObject *__Pyx_CyFunction_New(PyMethodDef *ml,
2139 int flags, PyObject* qualname,
2141 PyObject *module, PyObject *globals,
2145 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030500A1
2146 #define __Pyx_SetNameInClass(ns, name, value)\
2147 (likely(PyDict_CheckExact(ns)) ? _PyDict_SetItem_KnownHash(ns, name, value, ((PyASCIIObject *) name)->hash) : PyObject_SetItem(ns, name, value))
2148 #elif CYTHON_COMPILING_IN_CPYTHON
2149 #define __Pyx_SetNameInClass(ns, name, value)\
2150 (likely(PyDict_CheckExact(ns)) ? PyDict_SetItem(ns, name, value) : PyObject_SetItem(ns, name, value))
2152 #define __Pyx_SetNameInClass(ns, name, value) PyObject_SetItem(ns, name, value)
2156 static PyObject *__Pyx_Py3MetaclassPrepare(PyObject *metaclass, PyObject *bases, PyObject *name, PyObject *qualname,
2157 PyObject *mkw, PyObject *modname, PyObject *doc);
2158 static PyObject *__Pyx_Py3ClassCreate(PyObject *metaclass, PyObject *name, PyObject *bases, PyObject *dict,
2159 PyObject *mkw,
int calculate_metaclass,
int allow_py2_metaclass);
2162 #ifdef CYTHON_CLINE_IN_TRACEBACK
2163 #define __Pyx_CLineForTraceback(tstate, c_line) (((CYTHON_CLINE_IN_TRACEBACK)) ? c_line : 0)
2165 static int __Pyx_CLineForTraceback(PyThreadState *tstate,
int c_line);
2170 PyCodeObject* code_object;
2172 } __Pyx_CodeObjectCacheEntry;
2173 struct __Pyx_CodeObjectCache {
2176 __Pyx_CodeObjectCacheEntry* entries;
2178 static struct __Pyx_CodeObjectCache __pyx_code_cache = {0,0,NULL};
2179 static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries,
int count,
int code_line);
2180 static PyCodeObject *__pyx_find_code_object(
int code_line);
2181 static void __pyx_insert_code_object(
int code_line, PyCodeObject* code_object);
2184 static void __Pyx_AddTraceback(
const char *funcname,
int c_line,
2185 int py_line,
const char *filename);
2187 #if PY_MAJOR_VERSION < 3
2188 static int __Pyx_GetBuffer(PyObject *obj, Py_buffer *view,
int flags);
2189 static void __Pyx_ReleaseBuffer(Py_buffer *view);
2191 #define __Pyx_GetBuffer PyObject_GetBuffer
2192 #define __Pyx_ReleaseBuffer PyBuffer_Release
2198 Py_ssize_t shape, strides, suboffsets;
2199 } __Pyx_Buf_DimInfo;
2205 __Pyx_Buffer *rcbuffer;
2207 __Pyx_Buf_DimInfo diminfo[8];
2208 } __Pyx_LocalBuf_ND;
2211 static int __pyx_memviewslice_is_contig(
const __Pyx_memviewslice mvs,
char order,
int ndim);
2214 static int __pyx_slices_overlap(__Pyx_memviewslice *slice1,
2215 __Pyx_memviewslice *slice2,
2216 int ndim,
size_t itemsize);
2219 static CYTHON_INLINE PyObject *__pyx_capsule_create(
void *p,
const char *sig);
2222 #if defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 6))
2223 #define __Pyx_HAS_GCC_DIAGNOSTIC
2227 static CYTHON_INLINE
int __Pyx_Is_Little_Endian(
void);
2230 static const char* __Pyx_BufFmt_CheckString(__Pyx_BufFmt_Context* ctx,
const char* ts);
2231 static void __Pyx_BufFmt_Init(__Pyx_BufFmt_Context* ctx,
2232 __Pyx_BufFmt_StackElem* stack,
2233 __Pyx_TypeInfo* type);
2236 static int __pyx_typeinfo_cmp(__Pyx_TypeInfo *a, __Pyx_TypeInfo *b);
2239 static int __Pyx_ValidateAndInit_memviewslice(
2244 __Pyx_TypeInfo *dtype,
2245 __Pyx_BufFmt_StackElem stack[],
2246 __Pyx_memviewslice *memviewslice,
2247 PyObject *original_obj);
2250 static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_ds_double(PyObject *,
int writable_flag);
2253 static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_ds_int(PyObject *,
int writable_flag);
2258 #define __Pyx_CREAL(z) ((z).real())
2259 #define __Pyx_CIMAG(z) ((z).imag())
2261 #define __Pyx_CREAL(z) (__real__(z))
2262 #define __Pyx_CIMAG(z) (__imag__(z))
2265 #define __Pyx_CREAL(z) ((z).real)
2266 #define __Pyx_CIMAG(z) ((z).imag)
2268 #if defined(__cplusplus) && CYTHON_CCOMPLEX\
2269 && (defined(_WIN32) || defined(__clang__) || (defined(__GNUC__) && (__GNUC__ >= 5 || __GNUC__ == 4 && __GNUC_MINOR__ >= 4 )) || __cplusplus >= 201103)
2270 #define __Pyx_SET_CREAL(z,x) ((z).real(x))
2271 #define __Pyx_SET_CIMAG(z,y) ((z).imag(y))
2273 #define __Pyx_SET_CREAL(z,x) __Pyx_CREAL(z) = (x)
2274 #define __Pyx_SET_CIMAG(z,y) __Pyx_CIMAG(z) = (y)
2279 #define __Pyx_c_eq_float(a, b) ((a)==(b))
2280 #define __Pyx_c_sum_float(a, b) ((a)+(b))
2281 #define __Pyx_c_diff_float(a, b) ((a)-(b))
2282 #define __Pyx_c_prod_float(a, b) ((a)*(b))
2283 #define __Pyx_c_quot_float(a, b) ((a)/(b))
2284 #define __Pyx_c_neg_float(a) (-(a))
2286 #define __Pyx_c_is_zero_float(z) ((z)==(float)0)
2287 #define __Pyx_c_conj_float(z) (::std::conj(z))
2289 #define __Pyx_c_abs_float(z) (::std::abs(z))
2290 #define __Pyx_c_pow_float(a, b) (::std::pow(a, b))
2293 #define __Pyx_c_is_zero_float(z) ((z)==0)
2294 #define __Pyx_c_conj_float(z) (conjf(z))
2296 #define __Pyx_c_abs_float(z) (cabsf(z))
2297 #define __Pyx_c_pow_float(a, b) (cpowf(a, b))
2301 static CYTHON_INLINE
int __Pyx_c_eq_float(__pyx_t_float_complex, __pyx_t_float_complex);
2302 static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_sum_float(__pyx_t_float_complex, __pyx_t_float_complex);
2303 static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_diff_float(__pyx_t_float_complex, __pyx_t_float_complex);
2304 static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_prod_float(__pyx_t_float_complex, __pyx_t_float_complex);
2305 static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_quot_float(__pyx_t_float_complex, __pyx_t_float_complex);
2306 static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_neg_float(__pyx_t_float_complex);
2307 static CYTHON_INLINE
int __Pyx_c_is_zero_float(__pyx_t_float_complex);
2308 static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_conj_float(__pyx_t_float_complex);
2310 static CYTHON_INLINE
float __Pyx_c_abs_float(__pyx_t_float_complex);
2311 static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_pow_float(__pyx_t_float_complex, __pyx_t_float_complex);
2317 #define __Pyx_c_eq_double(a, b) ((a)==(b))
2318 #define __Pyx_c_sum_double(a, b) ((a)+(b))
2319 #define __Pyx_c_diff_double(a, b) ((a)-(b))
2320 #define __Pyx_c_prod_double(a, b) ((a)*(b))
2321 #define __Pyx_c_quot_double(a, b) ((a)/(b))
2322 #define __Pyx_c_neg_double(a) (-(a))
2324 #define __Pyx_c_is_zero_double(z) ((z)==(double)0)
2325 #define __Pyx_c_conj_double(z) (::std::conj(z))
2327 #define __Pyx_c_abs_double(z) (::std::abs(z))
2328 #define __Pyx_c_pow_double(a, b) (::std::pow(a, b))
2331 #define __Pyx_c_is_zero_double(z) ((z)==0)
2332 #define __Pyx_c_conj_double(z) (conj(z))
2334 #define __Pyx_c_abs_double(z) (cabs(z))
2335 #define __Pyx_c_pow_double(a, b) (cpow(a, b))
2339 static CYTHON_INLINE
int __Pyx_c_eq_double(__pyx_t_double_complex, __pyx_t_double_complex);
2340 static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_sum_double(__pyx_t_double_complex, __pyx_t_double_complex);
2341 static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_diff_double(__pyx_t_double_complex, __pyx_t_double_complex);
2342 static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_prod_double(__pyx_t_double_complex, __pyx_t_double_complex);
2343 static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_quot_double(__pyx_t_double_complex, __pyx_t_double_complex);
2344 static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_neg_double(__pyx_t_double_complex);
2345 static CYTHON_INLINE
int __Pyx_c_is_zero_double(__pyx_t_double_complex);
2346 static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_conj_double(__pyx_t_double_complex);
2348 static CYTHON_INLINE
double __Pyx_c_abs_double(__pyx_t_double_complex);
2349 static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_pow_double(__pyx_t_double_complex, __pyx_t_double_complex);
2354 static __Pyx_memviewslice
2355 __pyx_memoryview_copy_new_contig(
const __Pyx_memviewslice *from_mvs,
2356 const char *mode,
int ndim,
2357 size_t sizeof_dtype,
int contig_flag,
2358 int dtype_is_object);
2361 static CYTHON_INLINE
int __Pyx_PyInt_As_int(PyObject *);
2364 static CYTHON_INLINE
long __Pyx_PyInt_As_long(PyObject *);
2367 static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(
int value);
2370 static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(
long value);
2373 static CYTHON_INLINE
char __Pyx_PyInt_As_char(PyObject *);
2376 static int __Pyx_check_binary_version(
void);
2379 static int __Pyx_InitStrings(__Pyx_StringTabEntry *t);
2381 static PyObject *__pyx_array_get_memview(
struct __pyx_array_obj *__pyx_v_self);
2382 static char *__pyx_memoryview_get_item_pointer(
struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index);
2383 static PyObject *__pyx_memoryview_is_slice(
struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_obj);
2384 static PyObject *__pyx_memoryview_setitem_slice_assignment(
struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_dst, PyObject *__pyx_v_src);
2385 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);
2386 static PyObject *__pyx_memoryview_setitem_indexed(
struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index, PyObject *__pyx_v_value);
2387 static PyObject *__pyx_memoryview_convert_item_to_object(
struct __pyx_memoryview_obj *__pyx_v_self,
char *__pyx_v_itemp);
2388 static PyObject *__pyx_memoryview_assign_item_from_object(
struct __pyx_memoryview_obj *__pyx_v_self,
char *__pyx_v_itemp, PyObject *__pyx_v_value);
2389 static PyObject *__pyx_memoryviewslice_convert_item_to_object(
struct __pyx_memoryviewslice_obj *__pyx_v_self,
char *__pyx_v_itemp);
2390 static PyObject *__pyx_memoryviewslice_assign_item_from_object(
struct __pyx_memoryviewslice_obj *__pyx_v_self,
char *__pyx_v_itemp, PyObject *__pyx_v_value);
2403 static PyTypeObject *__pyx_ptype_7cpython_4type_type = 0;
2416 static PyTypeObject *__pyx_ptype_5numpy_dtype = 0;
2417 static PyTypeObject *__pyx_ptype_5numpy_flatiter = 0;
2418 static PyTypeObject *__pyx_ptype_5numpy_broadcast = 0;
2419 static PyTypeObject *__pyx_ptype_5numpy_ndarray = 0;
2420 static PyTypeObject *__pyx_ptype_5numpy_generic = 0;
2421 static PyTypeObject *__pyx_ptype_5numpy_number = 0;
2422 static PyTypeObject *__pyx_ptype_5numpy_integer = 0;
2423 static PyTypeObject *__pyx_ptype_5numpy_signedinteger = 0;
2424 static PyTypeObject *__pyx_ptype_5numpy_unsignedinteger = 0;
2425 static PyTypeObject *__pyx_ptype_5numpy_inexact = 0;
2426 static PyTypeObject *__pyx_ptype_5numpy_floating = 0;
2427 static PyTypeObject *__pyx_ptype_5numpy_complexfloating = 0;
2428 static PyTypeObject *__pyx_ptype_5numpy_flexible = 0;
2429 static PyTypeObject *__pyx_ptype_5numpy_character = 0;
2430 static PyTypeObject *__pyx_ptype_5numpy_ufunc = 0;
2433 static PyTypeObject *__pyx_ptype_7proteus_15superluWrappers_cSparseMatrix = 0;
2440 static PyTypeObject *__pyx_ptype_10csmoothers_cASMFactor = 0;
2441 static PyTypeObject *__pyx_ptype_10csmoothers_cBASMFactor = 0;
2442 static PyTypeObject *__pyx_array_type = 0;
2443 static PyTypeObject *__pyx_MemviewEnum_type = 0;
2444 static PyTypeObject *__pyx_memoryview_type = 0;
2445 static PyTypeObject *__pyx_memoryviewslice_type = 0;
2446 static PyObject *
generic = 0;
2447 static PyObject *strided = 0;
2448 static PyObject *indirect = 0;
2449 static PyObject *contiguous = 0;
2450 static PyObject *indirect_contiguous = 0;
2451 static int __pyx_memoryview_thread_locks_used;
2452 static PyThread_type_lock __pyx_memoryview_thread_locks[8];
2453 static void __pyx_f_10csmoothers_smootherWrappersjacobi_NR_prepare(
struct __pyx_obj_7proteus_15superluWrappers_cSparseMatrix *,
double,
double, __pyx_t_10csmoothers_DDATA);
2454 static void __pyx_f_10csmoothers_smootherWrappersjacobi_NR_solve(
struct __pyx_obj_7proteus_15superluWrappers_cSparseMatrix *, __pyx_t_10csmoothers_DDATA, __pyx_t_10csmoothers_DDATA, __pyx_t_10csmoothers_IDATA, __pyx_t_10csmoothers_DDATA);
2455 static void __pyx_f_10csmoothers_smootherWrappersnl_jacobi_NR_solve(
struct __pyx_obj_7proteus_15superluWrappers_cSparseMatrix *, __pyx_t_10csmoothers_DDATA, __pyx_t_10csmoothers_IDATA,
double,
double, __pyx_t_10csmoothers_DDATA);
2456 static void __pyx_f_10csmoothers_smootherWrappersgauss_seidel_NR_prepare(
struct __pyx_obj_7proteus_15superluWrappers_cSparseMatrix *,
double,
double, __pyx_t_10csmoothers_DDATA);
2457 static void __pyx_f_10csmoothers_smootherWrappersgauss_seidel_NR_solve(
struct __pyx_obj_7proteus_15superluWrappers_cSparseMatrix *, __pyx_t_10csmoothers_DDATA, __pyx_t_10csmoothers_DDATA, __pyx_t_10csmoothers_IDATA, __pyx_t_10csmoothers_DDATA);
2458 static PyObject *__pyx_f_10csmoothers_smootherWrappers_nl_gauss_seidel_NR_solve(
struct __pyx_obj_7proteus_15superluWrappers_cSparseMatrix *, __pyx_t_10csmoothers_DDATA, __pyx_t_10csmoothers_IDATA,
double,
double, __pyx_t_10csmoothers_DDATA);
2459 static void __pyx_f_10csmoothers_smootherWrappers_asm_NR_prepare(
struct __pyx_obj_7proteus_15superluWrappers_cSparseMatrix *,
struct __pyx_obj_10csmoothers_cASMFactor *);
2460 static void __pyx_f_10csmoothers_smootherWrappers_asm_NR_solve(
struct __pyx_obj_7proteus_15superluWrappers_cSparseMatrix *,
double,
struct __pyx_obj_10csmoothers_cASMFactor *, __pyx_t_10csmoothers_IDATA, __pyx_t_10csmoothers_DDATA, __pyx_t_10csmoothers_DDATA);
2461 static void __pyx_f_10csmoothers_smootherWrappers_basm_NR_prepare(
struct __pyx_obj_7proteus_15superluWrappers_cSparseMatrix *,
struct __pyx_obj_10csmoothers_cBASMFactor *);
2462 static void __pyx_f_10csmoothers_smootherWrappers_basm_NR_solve(
struct __pyx_obj_7proteus_15superluWrappers_cSparseMatrix *,
double,
struct __pyx_obj_10csmoothers_cBASMFactor *, __pyx_t_10csmoothers_IDATA, __pyx_t_10csmoothers_DDATA, __pyx_t_10csmoothers_DDATA);
2463 static struct __pyx_array_obj *__pyx_array_new(PyObject *, Py_ssize_t,
char *,
char *,
char *);
2464 static void *__pyx_align_pointer(
void *,
size_t);
2465 static PyObject *__pyx_memoryview_new(PyObject *,
int,
int, __Pyx_TypeInfo *);
2466 static CYTHON_INLINE
int __pyx_memoryview_check(PyObject *);
2467 static PyObject *_unellipsify(PyObject *,
int);
2468 static PyObject *assert_direct_dimensions(Py_ssize_t *,
int);
2469 static struct __pyx_memoryview_obj *__pyx_memview_slice(
struct __pyx_memoryview_obj *, PyObject *);
2470 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);
2471 static char *__pyx_pybuffer_index(Py_buffer *,
char *, Py_ssize_t, Py_ssize_t);
2472 static int __pyx_memslice_transpose(__Pyx_memviewslice *);
2473 static PyObject *__pyx_memoryview_fromslice(__Pyx_memviewslice,
int, PyObject *(*)(
char *),
int (*)(
char *, PyObject *),
int);
2474 static __Pyx_memviewslice *__pyx_memoryview_get_slice_from_memoryview(
struct __pyx_memoryview_obj *, __Pyx_memviewslice *);
2475 static void __pyx_memoryview_slice_copy(
struct __pyx_memoryview_obj *, __Pyx_memviewslice *);
2476 static PyObject *__pyx_memoryview_copy_object(
struct __pyx_memoryview_obj *);
2477 static PyObject *__pyx_memoryview_copy_object_from_slice(
struct __pyx_memoryview_obj *, __Pyx_memviewslice *);
2478 static Py_ssize_t abs_py_ssize_t(Py_ssize_t);
2479 static char __pyx_get_best_slice_order(__Pyx_memviewslice *,
int);
2480 static void _copy_strided_to_strided(
char *, Py_ssize_t *,
char *, Py_ssize_t *, Py_ssize_t *, Py_ssize_t *,
int,
size_t);
2481 static void copy_strided_to_strided(__Pyx_memviewslice *, __Pyx_memviewslice *,
int,
size_t);
2482 static Py_ssize_t __pyx_memoryview_slice_get_size(__Pyx_memviewslice *,
int);
2483 static Py_ssize_t __pyx_fill_contig_strides_array(Py_ssize_t *, Py_ssize_t *, Py_ssize_t,
int,
char);
2484 static void *__pyx_memoryview_copy_data_to_temp(__Pyx_memviewslice *, __Pyx_memviewslice *,
char,
int);
2485 static int __pyx_memoryview_err_extents(
int, Py_ssize_t, Py_ssize_t);
2486 static int __pyx_memoryview_err_dim(PyObject *,
char *,
int);
2487 static int __pyx_memoryview_err(PyObject *,
char *);
2488 static int __pyx_memoryview_copy_contents(__Pyx_memviewslice, __Pyx_memviewslice,
int,
int,
int);
2489 static void __pyx_memoryview_broadcast_leading(__Pyx_memviewslice *,
int,
int);
2490 static void __pyx_memoryview_refcount_copying(__Pyx_memviewslice *,
int,
int,
int);
2491 static void __pyx_memoryview_refcount_objects_in_slice_with_gil(
char *, Py_ssize_t *, Py_ssize_t *,
int,
int);
2492 static void __pyx_memoryview_refcount_objects_in_slice(
char *, Py_ssize_t *, Py_ssize_t *,
int,
int);
2493 static void __pyx_memoryview_slice_assign_scalar(__Pyx_memviewslice *,
int,
size_t,
void *,
int);
2494 static void __pyx_memoryview__slice_assign_scalar(
char *, Py_ssize_t *, Py_ssize_t *,
int,
size_t,
void *);
2495 static PyObject *__pyx_unpickle_Enum__set_state(
struct __pyx_MemviewEnum_obj *, PyObject *);
2496 static __Pyx_TypeInfo __Pyx_TypeInfo_double = {
"double", NULL,
sizeof(double), { 0 }, 0,
'R', 0, 0 };
2497 static __Pyx_TypeInfo __Pyx_TypeInfo_int = {
"int", NULL,
sizeof(int), { 0 }, 0, IS_UNSIGNED(
int) ?
'U' :
'I', IS_UNSIGNED(
int), 0 };
2498 #define __Pyx_MODULE_NAME "csmoothers"
2499 extern int __pyx_module_is_main_csmoothers;
2500 int __pyx_module_is_main_csmoothers = 0;
2503 static PyObject *__pyx_builtin_object;
2504 static PyObject *__pyx_builtin_TypeError;
2505 static PyObject *__pyx_builtin_ImportError;
2506 static PyObject *__pyx_builtin_ValueError;
2507 static PyObject *__pyx_builtin_MemoryError;
2508 static PyObject *__pyx_builtin_enumerate;
2509 static PyObject *__pyx_builtin_range;
2510 static PyObject *__pyx_builtin_Ellipsis;
2511 static PyObject *__pyx_builtin_id;
2512 static PyObject *__pyx_builtin_IndexError;
2513 static const char __pyx_k_A[] =
"A";
2514 static const char __pyx_k_L[] =
"L";
2515 static const char __pyx_k_M[] =
"M";
2516 static const char __pyx_k_O[] =
"O";
2517 static const char __pyx_k_R[] =
"R";
2518 static const char __pyx_k_c[] =
"c";
2519 static const char __pyx_k_w[] =
"w";
2520 static const char __pyx_k_bs[] =
"bs";
2521 static const char __pyx_k_dX[] =
"dX";
2522 static const char __pyx_k_id[] =
"id";
2523 static const char __pyx_k_nc[] =
"nc";
2524 static const char __pyx_k_np[] =
"np";
2525 static const char __pyx_k_nr[] =
"nr";
2526 static const char __pyx_k_doc[] =
"__doc__";
2527 static const char __pyx_k_new[] =
"__new__";
2528 static const char __pyx_k_obj[] =
"obj";
2529 static const char __pyx_k_tol[] =
"tol";
2530 static const char __pyx_k_base[] =
"base";
2531 static const char __pyx_k_dict[] =
"__dict__";
2532 static const char __pyx_k_init[] =
"__init__";
2533 static const char __pyx_k_main[] =
"__main__";
2534 static const char __pyx_k_mode[] =
"mode";
2535 static const char __pyx_k_name[] =
"name";
2536 static const char __pyx_k_ndim[] =
"ndim";
2537 static const char __pyx_k_pack[] =
"pack";
2538 static const char __pyx_k_self[] =
"self";
2539 static const char __pyx_k_size[] =
"size";
2540 static const char __pyx_k_step[] =
"step";
2541 static const char __pyx_k_stop[] =
"stop";
2542 static const char __pyx_k_test[] =
"__test__";
2543 static const char __pyx_k_ASCII[] =
"ASCII";
2544 static const char __pyx_k_class[] =
"__class__";
2545 static const char __pyx_k_error[] =
"error";
2546 static const char __pyx_k_flags[] =
"flags";
2547 static const char __pyx_k_numpy[] =
"numpy";
2548 static const char __pyx_k_range[] =
"range";
2549 static const char __pyx_k_shape[] =
"shape";
2550 static const char __pyx_k_start[] =
"start";
2551 static const char __pyx_k_encode[] =
"encode";
2552 static const char __pyx_k_format[] =
"format";
2553 static const char __pyx_k_import[] =
"__import__";
2554 static const char __pyx_k_module[] =
"__module__";
2555 static const char __pyx_k_name_2[] =
"__name__";
2556 static const char __pyx_k_object[] =
"object";
2557 static const char __pyx_k_pickle[] =
"pickle";
2558 static const char __pyx_k_reduce[] =
"__reduce__";
2559 static const char __pyx_k_struct[] =
"struct";
2560 static const char __pyx_k_unpack[] =
"unpack";
2561 static const char __pyx_k_update[] =
"update";
2562 static const char __pyx_k_fortran[] =
"fortran";
2563 static const char __pyx_k_memview[] =
"memview";
2564 static const char __pyx_k_prepare[] =
"__prepare__";
2565 static const char __pyx_k_Ellipsis[] =
"Ellipsis";
2566 static const char __pyx_k_getstate[] =
"__getstate__";
2567 static const char __pyx_k_itemsize[] =
"itemsize";
2568 static const char __pyx_k_pyx_type[] =
"__pyx_type";
2569 static const char __pyx_k_qualname[] =
"__qualname__";
2570 static const char __pyx_k_setstate[] =
"__setstate__";
2571 static const char __pyx_k_ASMFactor[] =
"ASMFactor";
2572 static const char __pyx_k_TypeError[] =
"TypeError";
2573 static const char __pyx_k_asmFactor[] =
"asmFactor";
2574 static const char __pyx_k_enumerate[] =
"enumerate";
2575 static const char __pyx_k_metaclass[] =
"__metaclass__";
2576 static const char __pyx_k_pyx_state[] =
"__pyx_state";
2577 static const char __pyx_k_reduce_ex[] =
"__reduce_ex__";
2578 static const char __pyx_k_BASMFactor[] =
"BASMFactor";
2579 static const char __pyx_k_IndexError[] =
"IndexError";
2580 static const char __pyx_k_ValueError[] =
"ValueError";
2581 static const char __pyx_k_basmFactor[] =
"basmFactor";
2582 static const char __pyx_k_cASMFactor[] =
"_cASMFactor";
2583 static const char __pyx_k_csmoothers[] =
"csmoothers";
2584 static const char __pyx_k_node_order[] =
"node_order";
2585 static const char __pyx_k_pyx_result[] =
"__pyx_result";
2586 static const char __pyx_k_pyx_vtable[] =
"__pyx_vtable__";
2587 static const char __pyx_k_ImportError[] =
"ImportError";
2588 static const char __pyx_k_MemoryError[] =
"MemoryError";
2589 static const char __pyx_k_PickleError[] =
"PickleError";
2590 static const char __pyx_k_cBASMFactor[] =
"_cBASMFactor";
2591 static const char __pyx_k_asm_NR_solve[] =
"asm_NR_solve";
2592 static const char __pyx_k_cASMFactor_2[] =
"cASMFactor";
2593 static const char __pyx_k_pyx_checksum[] =
"__pyx_checksum";
2594 static const char __pyx_k_stringsource[] =
"stringsource";
2595 static const char __pyx_k_basm_NR_solve[] =
"basm_NR_solve";
2596 static const char __pyx_k_cBASMFactor_2[] =
"cBASMFactor";
2597 static const char __pyx_k_cSparseMatrix[] =
"_cSparseMatrix";
2598 static const char __pyx_k_pyx_getbuffer[] =
"__pyx_getbuffer";
2599 static const char __pyx_k_reduce_cython[] =
"__reduce_cython__";
2600 static const char __pyx_k_asm_NR_prepare[] =
"asm_NR_prepare";
2601 static const char __pyx_k_View_MemoryView[] =
"View.MemoryView";
2602 static const char __pyx_k_allocate_buffer[] =
"allocate_buffer";
2603 static const char __pyx_k_basm_NR_prepare[] =
"basm_NR_prepare";
2604 static const char __pyx_k_dtype_is_object[] =
"dtype_is_object";
2605 static const char __pyx_k_jacobi_NR_solve[] =
"jacobi_NR_solve";
2606 static const char __pyx_k_pyx_PickleError[] =
"__pyx_PickleError";
2607 static const char __pyx_k_setstate_cython[] =
"__setstate_cython__";
2608 static const char __pyx_k_ASMFactor___init[] =
"ASMFactor.__init__";
2609 static const char __pyx_k_BASMFactor___init[] =
"BASMFactor.__init__";
2610 static const char __pyx_k_jacobi_NR_prepare[] =
"jacobi_NR_prepare";
2611 static const char __pyx_k_pyx_unpickle_Enum[] =
"__pyx_unpickle_Enum";
2612 static const char __pyx_k_cline_in_traceback[] =
"cline_in_traceback";
2613 static const char __pyx_k_nl_jacobi_NR_solve[] =
"nl_jacobi_NR_solve";
2614 static const char __pyx_k_strided_and_direct[] =
"<strided and direct>";
2615 static const char __pyx_k_strided_and_indirect[] =
"<strided and indirect>";
2616 static const char __pyx_k_contiguous_and_direct[] =
"<contiguous and direct>";
2617 static const char __pyx_k_gauss_seidel_NR_solve[] =
"gauss_seidel_NR_solve";
2618 static const char __pyx_k_MemoryView_of_r_object[] =
"<MemoryView of %r object>";
2619 static const char __pyx_k_gauss_seidel_NR_preare[] =
"gauss_seidel_NR_preare";
2620 static const char __pyx_k_proteus_csmoothers_pyx[] =
"proteus/csmoothers.pyx";
2621 static const char __pyx_k_MemoryView_of_r_at_0x_x[] =
"<MemoryView of %r at 0x%x>";
2622 static const char __pyx_k_contiguous_and_indirect[] =
"<contiguous and indirect>";
2623 static const char __pyx_k_Cannot_index_with_type_s[] =
"Cannot index with type '%s'";
2624 static const char __pyx_k_nl_gauss_seidel_NR_solve[] =
"nl_gauss_seidel_NR_solve";
2625 static const char __pyx_k_Invalid_shape_in_axis_d_d[] =
"Invalid shape in axis %d: %d.";
2626 static const char __pyx_k_itemsize_0_for_cython_array[] =
"itemsize <= 0 for cython.array";
2627 static const char __pyx_k_unable_to_allocate_array_data[] =
"unable to allocate array data.";
2628 static const char __pyx_k_strided_and_direct_or_indirect[] =
"<strided and direct or indirect>";
2629 static const char __pyx_k_numpy_core_multiarray_failed_to[] =
"numpy.core.multiarray failed to import";
2630 static const char __pyx_k_Buffer_view_does_not_expose_stri[] =
"Buffer view does not expose strides";
2631 static const char __pyx_k_Can_only_create_a_buffer_that_is[] =
"Can only create a buffer that is contiguous in memory.";
2632 static const char __pyx_k_Cannot_assign_to_read_only_memor[] =
"Cannot assign to read-only memoryview";
2633 static const char __pyx_k_Cannot_create_writable_memory_vi[] =
"Cannot create writable memory view from read-only memoryview";
2634 static const char __pyx_k_Empty_shape_tuple_for_cython_arr[] =
"Empty shape tuple for cython.array";
2635 static const char __pyx_k_Incompatible_checksums_0x_x_vs_0[] =
"Incompatible checksums (0x%x vs (0xb068931, 0x82a3537, 0x6ae9995) = (name))";
2636 static const char __pyx_k_Indirect_dimensions_not_supporte[] =
"Indirect dimensions not supported";
2637 static const char __pyx_k_Invalid_mode_expected_c_or_fortr[] =
"Invalid mode, expected 'c' or 'fortran', got %s";
2638 static const char __pyx_k_Out_of_bounds_on_buffer_access_a[] =
"Out of bounds on buffer access (axis %d)";
2639 static const char __pyx_k_Unable_to_convert_item_to_object[] =
"Unable to convert item to object";
2640 static const char __pyx_k_got_differing_extents_in_dimensi[] =
"got differing extents in dimension %d (got %d and %d)";
2641 static const char __pyx_k_no_default___reduce___due_to_non[] =
"no default __reduce__ due to non-trivial __cinit__";
2642 static const char __pyx_k_numpy_core_umath_failed_to_impor[] =
"numpy.core.umath failed to import";
2643 static const char __pyx_k_unable_to_allocate_shape_and_str[] =
"unable to allocate shape and strides.";
2644 static PyObject *__pyx_n_s_A;
2645 static PyObject *__pyx_n_s_ASCII;
2646 static PyObject *__pyx_n_s_ASMFactor;
2647 static PyObject *__pyx_n_s_ASMFactor___init;
2648 static PyObject *__pyx_n_s_BASMFactor;
2649 static PyObject *__pyx_n_s_BASMFactor___init;
2650 static PyObject *__pyx_kp_s_Buffer_view_does_not_expose_stri;
2651 static PyObject *__pyx_kp_s_Can_only_create_a_buffer_that_is;
2652 static PyObject *__pyx_kp_s_Cannot_assign_to_read_only_memor;
2653 static PyObject *__pyx_kp_s_Cannot_create_writable_memory_vi;
2654 static PyObject *__pyx_kp_s_Cannot_index_with_type_s;
2655 static PyObject *__pyx_n_s_Ellipsis;
2656 static PyObject *__pyx_kp_s_Empty_shape_tuple_for_cython_arr;
2657 static PyObject *__pyx_n_s_ImportError;
2658 static PyObject *__pyx_kp_s_Incompatible_checksums_0x_x_vs_0;
2659 static PyObject *__pyx_n_s_IndexError;
2660 static PyObject *__pyx_kp_s_Indirect_dimensions_not_supporte;
2661 static PyObject *__pyx_kp_s_Invalid_mode_expected_c_or_fortr;
2662 static PyObject *__pyx_kp_s_Invalid_shape_in_axis_d_d;
2663 static PyObject *__pyx_n_s_L;
2664 static PyObject *__pyx_n_s_M;
2665 static PyObject *__pyx_n_s_MemoryError;
2666 static PyObject *__pyx_kp_s_MemoryView_of_r_at_0x_x;
2667 static PyObject *__pyx_kp_s_MemoryView_of_r_object;
2668 static PyObject *__pyx_n_b_O;
2669 static PyObject *__pyx_kp_s_Out_of_bounds_on_buffer_access_a;
2670 static PyObject *__pyx_n_s_PickleError;
2671 static PyObject *__pyx_n_s_R;
2672 static PyObject *__pyx_n_s_TypeError;
2673 static PyObject *__pyx_kp_s_Unable_to_convert_item_to_object;
2674 static PyObject *__pyx_n_s_ValueError;
2675 static PyObject *__pyx_n_s_View_MemoryView;
2676 static PyObject *__pyx_n_s_allocate_buffer;
2677 static PyObject *__pyx_n_s_asmFactor;
2678 static PyObject *__pyx_n_s_asm_NR_prepare;
2679 static PyObject *__pyx_n_s_asm_NR_solve;
2680 static PyObject *__pyx_n_s_base;
2681 static PyObject *__pyx_n_s_basmFactor;
2682 static PyObject *__pyx_n_s_basm_NR_prepare;
2683 static PyObject *__pyx_n_s_basm_NR_solve;
2684 static PyObject *__pyx_n_s_bs;
2685 static PyObject *__pyx_n_s_c;
2686 static PyObject *__pyx_n_u_c;
2687 static PyObject *__pyx_n_s_cASMFactor;
2688 static PyObject *__pyx_n_s_cASMFactor_2;
2689 static PyObject *__pyx_n_s_cBASMFactor;
2690 static PyObject *__pyx_n_s_cBASMFactor_2;
2691 static PyObject *__pyx_n_s_cSparseMatrix;
2692 static PyObject *__pyx_n_s_class;
2693 static PyObject *__pyx_n_s_cline_in_traceback;
2694 static PyObject *__pyx_kp_s_contiguous_and_direct;
2695 static PyObject *__pyx_kp_s_contiguous_and_indirect;
2696 static PyObject *__pyx_n_s_csmoothers;
2697 static PyObject *__pyx_n_s_dX;
2698 static PyObject *__pyx_n_s_dict;
2699 static PyObject *__pyx_n_s_doc;
2700 static PyObject *__pyx_n_s_dtype_is_object;
2701 static PyObject *__pyx_n_s_encode;
2702 static PyObject *__pyx_n_s_enumerate;
2703 static PyObject *__pyx_n_s_error;
2704 static PyObject *__pyx_n_s_flags;
2705 static PyObject *__pyx_n_s_format;
2706 static PyObject *__pyx_n_s_fortran;
2707 static PyObject *__pyx_n_u_fortran;
2708 static PyObject *__pyx_n_s_gauss_seidel_NR_preare;
2709 static PyObject *__pyx_n_s_gauss_seidel_NR_solve;
2710 static PyObject *__pyx_n_s_getstate;
2711 static PyObject *__pyx_kp_s_got_differing_extents_in_dimensi;
2712 static PyObject *__pyx_n_s_id;
2713 static PyObject *__pyx_n_s_import;
2714 static PyObject *__pyx_n_s_init;
2715 static PyObject *__pyx_n_s_itemsize;
2716 static PyObject *__pyx_kp_s_itemsize_0_for_cython_array;
2717 static PyObject *__pyx_n_s_jacobi_NR_prepare;
2718 static PyObject *__pyx_n_s_jacobi_NR_solve;
2719 static PyObject *__pyx_n_s_main;
2720 static PyObject *__pyx_n_s_memview;
2721 static PyObject *__pyx_n_s_metaclass;
2722 static PyObject *__pyx_n_s_mode;
2723 static PyObject *__pyx_n_s_module;
2724 static PyObject *__pyx_n_s_name;
2725 static PyObject *__pyx_n_s_name_2;
2726 static PyObject *__pyx_n_s_nc;
2727 static PyObject *__pyx_n_s_ndim;
2728 static PyObject *__pyx_n_s_new;
2729 static PyObject *__pyx_n_s_nl_gauss_seidel_NR_solve;
2730 static PyObject *__pyx_n_s_nl_jacobi_NR_solve;
2731 static PyObject *__pyx_kp_s_no_default___reduce___due_to_non;
2732 static PyObject *__pyx_n_s_node_order;
2733 static PyObject *__pyx_n_s_np;
2734 static PyObject *__pyx_n_s_nr;
2735 static PyObject *__pyx_n_s_numpy;
2736 static PyObject *__pyx_kp_s_numpy_core_multiarray_failed_to;
2737 static PyObject *__pyx_kp_s_numpy_core_umath_failed_to_impor;
2738 static PyObject *__pyx_n_s_obj;
2739 static PyObject *__pyx_n_s_object;
2740 static PyObject *__pyx_n_s_pack;
2741 static PyObject *__pyx_n_s_pickle;
2742 static PyObject *__pyx_n_s_prepare;
2743 static PyObject *__pyx_kp_s_proteus_csmoothers_pyx;
2744 static PyObject *__pyx_n_s_pyx_PickleError;
2745 static PyObject *__pyx_n_s_pyx_checksum;
2746 static PyObject *__pyx_n_s_pyx_getbuffer;
2747 static PyObject *__pyx_n_s_pyx_result;
2748 static PyObject *__pyx_n_s_pyx_state;
2749 static PyObject *__pyx_n_s_pyx_type;
2750 static PyObject *__pyx_n_s_pyx_unpickle_Enum;
2751 static PyObject *__pyx_n_s_pyx_vtable;
2752 static PyObject *__pyx_n_s_qualname;
2753 static PyObject *__pyx_n_s_range;
2754 static PyObject *__pyx_n_s_reduce;
2755 static PyObject *__pyx_n_s_reduce_cython;
2756 static PyObject *__pyx_n_s_reduce_ex;
2757 static PyObject *__pyx_n_s_self;
2758 static PyObject *__pyx_n_s_setstate;
2759 static PyObject *__pyx_n_s_setstate_cython;
2760 static PyObject *__pyx_n_s_shape;
2761 static PyObject *__pyx_n_s_size;
2762 static PyObject *__pyx_n_s_start;
2763 static PyObject *__pyx_n_s_step;
2764 static PyObject *__pyx_n_s_stop;
2765 static PyObject *__pyx_kp_s_strided_and_direct;
2766 static PyObject *__pyx_kp_s_strided_and_direct_or_indirect;
2767 static PyObject *__pyx_kp_s_strided_and_indirect;
2768 static PyObject *__pyx_kp_s_stringsource;
2769 static PyObject *__pyx_n_s_struct;
2770 static PyObject *__pyx_n_s_test;
2771 static PyObject *__pyx_n_s_tol;
2772 static PyObject *__pyx_kp_s_unable_to_allocate_array_data;
2773 static PyObject *__pyx_kp_s_unable_to_allocate_shape_and_str;
2774 static PyObject *__pyx_n_s_unpack;
2775 static PyObject *__pyx_n_s_update;
2776 static PyObject *__pyx_n_s_w;
2777 static PyObject *__pyx_pf_10csmoothers_9ASMFactor___init__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_L);
2778 static int __pyx_pf_10csmoothers_10cASMFactor___cinit__(
struct __pyx_obj_10csmoothers_cASMFactor *__pyx_v_self,
struct __pyx_obj_7proteus_15superluWrappers_cSparseMatrix *__pyx_v_L);
2779 static void __pyx_pf_10csmoothers_10cASMFactor_2__dealloc__(
struct __pyx_obj_10csmoothers_cASMFactor *__pyx_v_self);
2780 static PyObject *__pyx_pf_10csmoothers_10cASMFactor_4__reduce_cython__(CYTHON_UNUSED
struct __pyx_obj_10csmoothers_cASMFactor *__pyx_v_self);
2781 static PyObject *__pyx_pf_10csmoothers_10cASMFactor_6__setstate_cython__(CYTHON_UNUSED
struct __pyx_obj_10csmoothers_cASMFactor *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state);
2782 static PyObject *__pyx_pf_10csmoothers_10BASMFactor___init__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_L, PyObject *__pyx_v_bs);
2783 static int __pyx_pf_10csmoothers_11cBASMFactor___cinit__(
struct __pyx_obj_10csmoothers_cBASMFactor *__pyx_v_self,
struct __pyx_obj_7proteus_15superluWrappers_cSparseMatrix *__pyx_v_L,
int __pyx_v_bs);
2784 static void __pyx_pf_10csmoothers_11cBASMFactor_2__dealloc__(
struct __pyx_obj_10csmoothers_cBASMFactor *__pyx_v_self);
2785 static PyObject *__pyx_pf_10csmoothers_11cBASMFactor_4__reduce_cython__(CYTHON_UNUSED
struct __pyx_obj_10csmoothers_cBASMFactor *__pyx_v_self);
2786 static PyObject *__pyx_pf_10csmoothers_11cBASMFactor_6__setstate_cython__(CYTHON_UNUSED
struct __pyx_obj_10csmoothers_cBASMFactor *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state);
2787 static PyObject *__pyx_pf_10csmoothers_jacobi_NR_prepare(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_A, PyObject *__pyx_v_w, PyObject *__pyx_v_tol, PyObject *__pyx_v_M);
2788 static PyObject *__pyx_pf_10csmoothers_2jacobi_NR_solve(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_A, PyObject *__pyx_v_M, PyObject *__pyx_v_R, PyObject *__pyx_v_node_order, PyObject *__pyx_v_dX);
2789 static PyObject *__pyx_pf_10csmoothers_4nl_jacobi_NR_solve(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_A, PyObject *__pyx_v_R, PyObject *__pyx_v_node_order, PyObject *__pyx_v_w, PyObject *__pyx_v_tol, PyObject *__pyx_v_dX);
2790 static PyObject *__pyx_pf_10csmoothers_6gauss_seidel_NR_preare(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_A, PyObject *__pyx_v_w, PyObject *__pyx_v_tol, PyObject *__pyx_v_M);
2791 static PyObject *__pyx_pf_10csmoothers_8gauss_seidel_NR_solve(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_A, PyObject *__pyx_v_M, PyObject *__pyx_v_R, PyObject *__pyx_v_node_order, PyObject *__pyx_v_dX);
2792 static PyObject *__pyx_pf_10csmoothers_10nl_gauss_seidel_NR_solve(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_A, PyObject *__pyx_v_R, PyObject *__pyx_v_node_order, PyObject *__pyx_v_w, PyObject *__pyx_v_tol, PyObject *__pyx_v_dX);
2793 static PyObject *__pyx_pf_10csmoothers_12asm_NR_prepare(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_A, PyObject *__pyx_v_asmFactor);
2794 static PyObject *__pyx_pf_10csmoothers_14asm_NR_solve(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_A, PyObject *__pyx_v_w, PyObject *__pyx_v_asmFactor, PyObject *__pyx_v_node_order, PyObject *__pyx_v_R, PyObject *__pyx_v_dX);
2795 static PyObject *__pyx_pf_10csmoothers_16basm_NR_prepare(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_A, PyObject *__pyx_v_basmFactor);
2796 static PyObject *__pyx_pf_10csmoothers_18basm_NR_solve(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_A, PyObject *__pyx_v_w, PyObject *__pyx_v_basmFactor, PyObject *__pyx_v_node_order, PyObject *__pyx_v_R, PyObject *__pyx_v_dX);
2797 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);
2798 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);
2799 static void __pyx_array___pyx_pf_15View_dot_MemoryView_5array_4__dealloc__(
struct __pyx_array_obj *__pyx_v_self);
2800 static PyObject *__pyx_pf_15View_dot_MemoryView_5array_7memview___get__(
struct __pyx_array_obj *__pyx_v_self);
2801 static Py_ssize_t __pyx_array___pyx_pf_15View_dot_MemoryView_5array_6__len__(
struct __pyx_array_obj *__pyx_v_self);
2802 static PyObject *__pyx_array___pyx_pf_15View_dot_MemoryView_5array_8__getattr__(
struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_attr);
2803 static PyObject *__pyx_array___pyx_pf_15View_dot_MemoryView_5array_10__getitem__(
struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_item);
2804 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);
2805 static PyObject *__pyx_pf___pyx_array___reduce_cython__(CYTHON_UNUSED
struct __pyx_array_obj *__pyx_v_self);
2806 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);
2807 static int __pyx_MemviewEnum___pyx_pf_15View_dot_MemoryView_4Enum___init__(
struct __pyx_MemviewEnum_obj *__pyx_v_self, PyObject *__pyx_v_name);
2808 static PyObject *__pyx_MemviewEnum___pyx_pf_15View_dot_MemoryView_4Enum_2__repr__(
struct __pyx_MemviewEnum_obj *__pyx_v_self);
2809 static PyObject *__pyx_pf___pyx_MemviewEnum___reduce_cython__(
struct __pyx_MemviewEnum_obj *__pyx_v_self);
2810 static PyObject *__pyx_pf___pyx_MemviewEnum_2__setstate_cython__(
struct __pyx_MemviewEnum_obj *__pyx_v_self, PyObject *__pyx_v___pyx_state);
2811 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);
2812 static void __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_2__dealloc__(
struct __pyx_memoryview_obj *__pyx_v_self);
2813 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_4__getitem__(
struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index);
2814 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);
2815 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);
2816 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_1T___get__(
struct __pyx_memoryview_obj *__pyx_v_self);
2817 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_4base___get__(
struct __pyx_memoryview_obj *__pyx_v_self);
2818 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_5shape___get__(
struct __pyx_memoryview_obj *__pyx_v_self);
2819 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_7strides___get__(
struct __pyx_memoryview_obj *__pyx_v_self);
2820 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_10suboffsets___get__(
struct __pyx_memoryview_obj *__pyx_v_self);
2821 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_4ndim___get__(
struct __pyx_memoryview_obj *__pyx_v_self);
2822 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_8itemsize___get__(
struct __pyx_memoryview_obj *__pyx_v_self);
2823 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_6nbytes___get__(
struct __pyx_memoryview_obj *__pyx_v_self);
2824 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_4size___get__(
struct __pyx_memoryview_obj *__pyx_v_self);
2825 static Py_ssize_t __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_10__len__(
struct __pyx_memoryview_obj *__pyx_v_self);
2826 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_12__repr__(
struct __pyx_memoryview_obj *__pyx_v_self);
2827 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_14__str__(
struct __pyx_memoryview_obj *__pyx_v_self);
2828 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_16is_c_contig(
struct __pyx_memoryview_obj *__pyx_v_self);
2829 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_18is_f_contig(
struct __pyx_memoryview_obj *__pyx_v_self);
2830 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_20copy(
struct __pyx_memoryview_obj *__pyx_v_self);
2831 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_22copy_fortran(
struct __pyx_memoryview_obj *__pyx_v_self);
2832 static PyObject *__pyx_pf___pyx_memoryview___reduce_cython__(CYTHON_UNUSED
struct __pyx_memoryview_obj *__pyx_v_self);
2833 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);
2834 static void __pyx_memoryviewslice___pyx_pf_15View_dot_MemoryView_16_memoryviewslice___dealloc__(
struct __pyx_memoryviewslice_obj *__pyx_v_self);
2835 static PyObject *__pyx_pf_15View_dot_MemoryView_16_memoryviewslice_4base___get__(
struct __pyx_memoryviewslice_obj *__pyx_v_self);
2836 static PyObject *__pyx_pf___pyx_memoryviewslice___reduce_cython__(CYTHON_UNUSED
struct __pyx_memoryviewslice_obj *__pyx_v_self);
2837 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);
2838 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);
2839 static PyObject *__pyx_tp_new_10csmoothers_cASMFactor(PyTypeObject *t, PyObject *a, PyObject *k);
2840 static PyObject *__pyx_tp_new_10csmoothers_cBASMFactor(PyTypeObject *t, PyObject *a, PyObject *k);
2841 static PyObject *__pyx_tp_new_array(PyTypeObject *t, PyObject *a, PyObject *k);
2842 static PyObject *__pyx_tp_new_Enum(PyTypeObject *t, PyObject *a, PyObject *k);
2843 static PyObject *__pyx_tp_new_memoryview(PyTypeObject *t, PyObject *a, PyObject *k);
2844 static PyObject *__pyx_tp_new__memoryviewslice(PyTypeObject *t, PyObject *a, PyObject *k);
2845 static PyObject *__pyx_int_0;
2846 static PyObject *__pyx_int_1;
2847 static PyObject *__pyx_int_112105877;
2848 static PyObject *__pyx_int_136983863;
2849 static PyObject *__pyx_int_184977713;
2850 static PyObject *__pyx_int_neg_1;
2851 static PyObject *__pyx_tuple_;
2852 static PyObject *__pyx_tuple__2;
2853 static PyObject *__pyx_tuple__3;
2854 static PyObject *__pyx_tuple__4;
2855 static PyObject *__pyx_tuple__5;
2856 static PyObject *__pyx_tuple__6;
2857 static PyObject *__pyx_tuple__7;
2858 static PyObject *__pyx_tuple__8;
2859 static PyObject *__pyx_tuple__9;
2860 static PyObject *__pyx_slice__21;
2861 static PyObject *__pyx_tuple__10;
2862 static PyObject *__pyx_tuple__11;
2863 static PyObject *__pyx_tuple__12;
2864 static PyObject *__pyx_tuple__13;
2865 static PyObject *__pyx_tuple__14;
2866 static PyObject *__pyx_tuple__15;
2867 static PyObject *__pyx_tuple__16;
2868 static PyObject *__pyx_tuple__17;
2869 static PyObject *__pyx_tuple__18;
2870 static PyObject *__pyx_tuple__19;
2871 static PyObject *__pyx_tuple__20;
2872 static PyObject *__pyx_tuple__22;
2873 static PyObject *__pyx_tuple__23;
2874 static PyObject *__pyx_tuple__24;
2875 static PyObject *__pyx_tuple__25;
2876 static PyObject *__pyx_tuple__26;
2877 static PyObject *__pyx_tuple__27;
2878 static PyObject *__pyx_tuple__29;
2879 static PyObject *__pyx_tuple__30;
2880 static PyObject *__pyx_tuple__32;
2881 static PyObject *__pyx_tuple__34;
2882 static PyObject *__pyx_tuple__36;
2883 static PyObject *__pyx_tuple__38;
2884 static PyObject *__pyx_tuple__40;
2885 static PyObject *__pyx_tuple__42;
2886 static PyObject *__pyx_tuple__44;
2887 static PyObject *__pyx_tuple__46;
2888 static PyObject *__pyx_tuple__48;
2889 static PyObject *__pyx_tuple__50;
2890 static PyObject *__pyx_tuple__52;
2891 static PyObject *__pyx_tuple__53;
2892 static PyObject *__pyx_tuple__54;
2893 static PyObject *__pyx_tuple__55;
2894 static PyObject *__pyx_tuple__56;
2895 static PyObject *__pyx_tuple__57;
2896 static PyObject *__pyx_codeobj__28;
2897 static PyObject *__pyx_codeobj__31;
2898 static PyObject *__pyx_codeobj__33;
2899 static PyObject *__pyx_codeobj__35;
2900 static PyObject *__pyx_codeobj__37;
2901 static PyObject *__pyx_codeobj__39;
2902 static PyObject *__pyx_codeobj__41;
2903 static PyObject *__pyx_codeobj__43;
2904 static PyObject *__pyx_codeobj__45;
2905 static PyObject *__pyx_codeobj__47;
2906 static PyObject *__pyx_codeobj__49;
2907 static PyObject *__pyx_codeobj__51;
2908 static PyObject *__pyx_codeobj__58;
2920 static PyObject *__pyx_pw_10csmoothers_9ASMFactor_1__init__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
2921 static PyMethodDef __pyx_mdef_10csmoothers_9ASMFactor_1__init__ = {
"__init__", (PyCFunction)(
void*)(PyCFunctionWithKeywords)__pyx_pw_10csmoothers_9ASMFactor_1__init__, METH_VARARGS|METH_KEYWORDS, 0};
2922 static PyObject *__pyx_pw_10csmoothers_9ASMFactor_1__init__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
2923 PyObject *__pyx_v_self = 0;
2924 PyObject *__pyx_v_L = 0;
2925 int __pyx_lineno = 0;
2926 const char *__pyx_filename = NULL;
2927 int __pyx_clineno = 0;
2928 PyObject *__pyx_r = 0;
2929 __Pyx_RefNannyDeclarations
2930 __Pyx_RefNannySetupContext(
"__init__ (wrapper)", 0);
2932 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_L,0};
2933 PyObject* values[2] = {0,0};
2934 if (unlikely(__pyx_kwds)) {
2936 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
2938 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
2940 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
2943 default:
goto __pyx_L5_argtuple_error;
2945 kw_args = PyDict_Size(__pyx_kwds);
2948 if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--;
2949 else goto __pyx_L5_argtuple_error;
2952 if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_L)) != 0)) kw_args--;
2954 __Pyx_RaiseArgtupleInvalid(
"__init__", 1, 2, 2, 1); __PYX_ERR(0, 7, __pyx_L3_error)
2957 if (unlikely(kw_args > 0)) {
2958 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args,
"__init__") < 0)) __PYX_ERR(0, 7, __pyx_L3_error)
2960 }
else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
2961 goto __pyx_L5_argtuple_error;
2963 values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
2964 values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
2966 __pyx_v_self = values[0];
2967 __pyx_v_L = values[1];
2969 goto __pyx_L4_argument_unpacking_done;
2970 __pyx_L5_argtuple_error:;
2971 __Pyx_RaiseArgtupleInvalid(
"__init__", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 7, __pyx_L3_error)
2973 __Pyx_AddTraceback(
"csmoothers.ASMFactor.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
2974 __Pyx_RefNannyFinishContext();
2976 __pyx_L4_argument_unpacking_done:;
2977 __pyx_r = __pyx_pf_10csmoothers_9ASMFactor___init__(__pyx_self, __pyx_v_self, __pyx_v_L);
2980 __Pyx_RefNannyFinishContext();
2984 static PyObject *__pyx_pf_10csmoothers_9ASMFactor___init__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_L) {
2985 PyObject *__pyx_r = NULL;
2986 __Pyx_RefNannyDeclarations
2987 PyObject *__pyx_t_1 = NULL;
2988 PyObject *__pyx_t_2 = NULL;
2989 int __pyx_lineno = 0;
2990 const char *__pyx_filename = NULL;
2991 int __pyx_clineno = 0;
2992 __Pyx_RefNannySetupContext(
"__init__", 0);
3001 if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_L, __pyx_v_L) < 0) __PYX_ERR(0, 8, __pyx_L1_error)
3010 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_L);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 9, __pyx_L1_error)
3011 __Pyx_GOTREF(__pyx_t_1);
3012 __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_cSparseMatrix);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 9, __pyx_L1_error)
3013 __Pyx_GOTREF(__pyx_t_2);
3014 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
3015 __pyx_t_1 = __Pyx_PyObject_CallOneArg(((PyObject *)__pyx_ptype_10csmoothers_cASMFactor), __pyx_t_2);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 9, __pyx_L1_error)
3016 __Pyx_GOTREF(__pyx_t_1);
3017 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
3018 if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_cASMFactor, __pyx_t_1) < 0) __PYX_ERR(0, 9, __pyx_L1_error)
3019 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
3030 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
3033 __Pyx_XDECREF(__pyx_t_1);
3034 __Pyx_XDECREF(__pyx_t_2);
3035 __Pyx_AddTraceback(
"csmoothers.ASMFactor.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
3038 __Pyx_XGIVEREF(__pyx_r);
3039 __Pyx_RefNannyFinishContext();
3052 static int __pyx_pw_10csmoothers_10cASMFactor_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
3053 static int __pyx_pw_10csmoothers_10cASMFactor_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
3054 struct __pyx_obj_7proteus_15superluWrappers_cSparseMatrix *__pyx_v_L = 0;
3055 int __pyx_lineno = 0;
3056 const char *__pyx_filename = NULL;
3057 int __pyx_clineno = 0;
3059 __Pyx_RefNannyDeclarations
3060 __Pyx_RefNannySetupContext(
"__cinit__ (wrapper)", 0);
3062 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_L,0};
3063 PyObject* values[1] = {0};
3064 if (unlikely(__pyx_kwds)) {
3066 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
3068 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
3071 default:
goto __pyx_L5_argtuple_error;
3073 kw_args = PyDict_Size(__pyx_kwds);
3076 if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_L)) != 0)) kw_args--;
3077 else goto __pyx_L5_argtuple_error;
3079 if (unlikely(kw_args > 0)) {
3080 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args,
"__cinit__") < 0)) __PYX_ERR(0, 13, __pyx_L3_error)
3082 }
else if (PyTuple_GET_SIZE(__pyx_args) != 1) {
3083 goto __pyx_L5_argtuple_error;
3085 values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
3087 __pyx_v_L = ((
struct __pyx_obj_7proteus_15superluWrappers_cSparseMatrix *)values[0]);
3089 goto __pyx_L4_argument_unpacking_done;
3090 __pyx_L5_argtuple_error:;
3091 __Pyx_RaiseArgtupleInvalid(
"__cinit__", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 13, __pyx_L3_error)
3093 __Pyx_AddTraceback(
"csmoothers.cASMFactor.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
3094 __Pyx_RefNannyFinishContext();
3096 __pyx_L4_argument_unpacking_done:;
3097 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_L), __pyx_ptype_7proteus_15superluWrappers_cSparseMatrix, 1,
"L", 0))) __PYX_ERR(0, 14, __pyx_L1_error)
3098 __pyx_r = __pyx_pf_10csmoothers_10cASMFactor___cinit__(((
struct __pyx_obj_10csmoothers_cASMFactor *)__pyx_v_self), __pyx_v_L);
3105 __Pyx_RefNannyFinishContext();
3109 static int __pyx_pf_10csmoothers_10cASMFactor___cinit__(
struct __pyx_obj_10csmoothers_cASMFactor *__pyx_v_self,
struct __pyx_obj_7proteus_15superluWrappers_cSparseMatrix *__pyx_v_L) {
3111 __pyx_t_10csmoothers_SuperMatrix __pyx_v_AS;
3113 __Pyx_RefNannyDeclarations
3114 PyObject *__pyx_t_1 = NULL;
3116 int __pyx_lineno = 0;
3117 const char *__pyx_filename = NULL;
3118 int __pyx_clineno = 0;
3119 __Pyx_RefNannySetupContext(
"__cinit__", 0);
3137 __pyx_v_AS.Stype = SLU_NR;
3146 __pyx_v_AS.Dtype = SLU_D;
3155 __pyx_v_AS.Mtype = SLU_GE;
3164 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_L), __pyx_n_s_nr);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 20, __pyx_L1_error)
3165 __Pyx_GOTREF(__pyx_t_1);
3166 __pyx_t_2 = __Pyx_PyInt_As_int(__pyx_t_1);
if (unlikely((__pyx_t_2 == (
int)-1) && PyErr_Occurred())) __PYX_ERR(0, 20, __pyx_L1_error)
3167 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
3168 __pyx_v_AS.nrow = __pyx_t_2;
3177 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_L), __pyx_n_s_nc);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 21, __pyx_L1_error)
3178 __Pyx_GOTREF(__pyx_t_1);
3179 __pyx_t_2 = __Pyx_PyInt_As_int(__pyx_t_1);
if (unlikely((__pyx_t_2 == (
int)-1) && PyErr_Occurred())) __PYX_ERR(0, 21, __pyx_L1_error)
3180 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
3181 __pyx_v_AS.ncol = __pyx_t_2;
3190 __pyx_v_AS.Store = (&__pyx_v_L->A);
3199 __pyx_v_rval =
asm_NR_init((&__pyx_v_AS), (&__pyx_v_self->subdomain_dim), (&__pyx_v_self->l2g_L), (&__pyx_v_self->subdomain_L), (&__pyx_v_self->subdomain_R), (&__pyx_v_self->subdomain_dX), (&__pyx_v_self->subdomain_pivots));
3208 #ifndef CYTHON_WITHOUT_ASSERTIONS
3209 if (unlikely(!Py_OptimizeFlag)) {
3210 if (unlikely(!((__pyx_v_rval == 0) != 0))) {
3211 PyErr_SetNone(PyExc_AssertionError);
3212 __PYX_ERR(0, 30, __pyx_L1_error)
3229 __Pyx_XDECREF(__pyx_t_1);
3230 __Pyx_AddTraceback(
"csmoothers.cASMFactor.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
3233 __Pyx_RefNannyFinishContext();
3246 static void __pyx_pw_10csmoothers_10cASMFactor_3__dealloc__(PyObject *__pyx_v_self);
3247 static void __pyx_pw_10csmoothers_10cASMFactor_3__dealloc__(PyObject *__pyx_v_self) {
3248 __Pyx_RefNannyDeclarations
3249 __Pyx_RefNannySetupContext(
"__dealloc__ (wrapper)", 0);
3250 __pyx_pf_10csmoothers_10cASMFactor_2__dealloc__(((
struct __pyx_obj_10csmoothers_cASMFactor *)__pyx_v_self));
3253 __Pyx_RefNannyFinishContext();
3256 static void __pyx_pf_10csmoothers_10cASMFactor_2__dealloc__(
struct __pyx_obj_10csmoothers_cASMFactor *__pyx_v_self) {
3257 __Pyx_RefNannyDeclarations
3258 __Pyx_RefNannySetupContext(
"__dealloc__", 0);
3267 asm_NR_free(__pyx_v_self->N, __pyx_v_self->subdomain_dim, __pyx_v_self->l2g_L, __pyx_v_self->subdomain_L, __pyx_v_self->subdomain_R, __pyx_v_self->subdomain_dX, __pyx_v_self->subdomain_pivots);
3278 __Pyx_RefNannyFinishContext();
3288 static PyObject *__pyx_pw_10csmoothers_10cASMFactor_5__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused);
3289 static PyObject *__pyx_pw_10csmoothers_10cASMFactor_5__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
3290 PyObject *__pyx_r = 0;
3291 __Pyx_RefNannyDeclarations
3292 __Pyx_RefNannySetupContext(
"__reduce_cython__ (wrapper)", 0);
3293 __pyx_r = __pyx_pf_10csmoothers_10cASMFactor_4__reduce_cython__(((
struct __pyx_obj_10csmoothers_cASMFactor *)__pyx_v_self));
3296 __Pyx_RefNannyFinishContext();
3300 static PyObject *__pyx_pf_10csmoothers_10cASMFactor_4__reduce_cython__(CYTHON_UNUSED
struct __pyx_obj_10csmoothers_cASMFactor *__pyx_v_self) {
3301 PyObject *__pyx_r = NULL;
3302 __Pyx_RefNannyDeclarations
3303 PyObject *__pyx_t_1 = NULL;
3304 int __pyx_lineno = 0;
3305 const char *__pyx_filename = NULL;
3306 int __pyx_clineno = 0;
3307 __Pyx_RefNannySetupContext(
"__reduce_cython__", 0);
3315 __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple_, NULL);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 2, __pyx_L1_error)
3316 __Pyx_GOTREF(__pyx_t_1);
3317 __Pyx_Raise(__pyx_t_1, 0, 0, 0);
3318 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
3319 __PYX_ERR(1, 2, __pyx_L1_error)
3329 __Pyx_XDECREF(__pyx_t_1);
3330 __Pyx_AddTraceback(
"csmoothers.cASMFactor.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
3332 __Pyx_XGIVEREF(__pyx_r);
3333 __Pyx_RefNannyFinishContext();
3345 static PyObject *__pyx_pw_10csmoothers_10cASMFactor_7__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state);
3346 static PyObject *__pyx_pw_10csmoothers_10cASMFactor_7__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
3347 PyObject *__pyx_r = 0;
3348 __Pyx_RefNannyDeclarations
3349 __Pyx_RefNannySetupContext(
"__setstate_cython__ (wrapper)", 0);
3350 __pyx_r = __pyx_pf_10csmoothers_10cASMFactor_6__setstate_cython__(((
struct __pyx_obj_10csmoothers_cASMFactor *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state));
3353 __Pyx_RefNannyFinishContext();
3357 static PyObject *__pyx_pf_10csmoothers_10cASMFactor_6__setstate_cython__(CYTHON_UNUSED
struct __pyx_obj_10csmoothers_cASMFactor *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) {
3358 PyObject *__pyx_r = NULL;
3359 __Pyx_RefNannyDeclarations
3360 PyObject *__pyx_t_1 = NULL;
3361 int __pyx_lineno = 0;
3362 const char *__pyx_filename = NULL;
3363 int __pyx_clineno = 0;
3364 __Pyx_RefNannySetupContext(
"__setstate_cython__", 0);
3371 __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__2, NULL);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 4, __pyx_L1_error)
3372 __Pyx_GOTREF(__pyx_t_1);
3373 __Pyx_Raise(__pyx_t_1, 0, 0, 0);
3374 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
3375 __PYX_ERR(1, 4, __pyx_L1_error)
3386 __Pyx_XDECREF(__pyx_t_1);
3387 __Pyx_AddTraceback(
"csmoothers.cASMFactor.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
3389 __Pyx_XGIVEREF(__pyx_r);
3390 __Pyx_RefNannyFinishContext();
3403 static PyObject *__pyx_pw_10csmoothers_10BASMFactor_1__init__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
3404 static PyMethodDef __pyx_mdef_10csmoothers_10BASMFactor_1__init__ = {
"__init__", (PyCFunction)(
void*)(PyCFunctionWithKeywords)__pyx_pw_10csmoothers_10BASMFactor_1__init__, METH_VARARGS|METH_KEYWORDS, 0};
3405 static PyObject *__pyx_pw_10csmoothers_10BASMFactor_1__init__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
3406 PyObject *__pyx_v_self = 0;
3407 PyObject *__pyx_v_L = 0;
3408 PyObject *__pyx_v_bs = 0;
3409 int __pyx_lineno = 0;
3410 const char *__pyx_filename = NULL;
3411 int __pyx_clineno = 0;
3412 PyObject *__pyx_r = 0;
3413 __Pyx_RefNannyDeclarations
3414 __Pyx_RefNannySetupContext(
"__init__ (wrapper)", 0);
3416 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_L,&__pyx_n_s_bs,0};
3417 PyObject* values[3] = {0,0,0};
3418 if (unlikely(__pyx_kwds)) {
3420 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
3422 case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
3424 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
3426 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
3429 default:
goto __pyx_L5_argtuple_error;
3431 kw_args = PyDict_Size(__pyx_kwds);
3434 if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--;
3435 else goto __pyx_L5_argtuple_error;
3438 if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_L)) != 0)) kw_args--;
3440 __Pyx_RaiseArgtupleInvalid(
"__init__", 1, 3, 3, 1); __PYX_ERR(0, 44, __pyx_L3_error)
3444 if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_bs)) != 0)) kw_args--;
3446 __Pyx_RaiseArgtupleInvalid(
"__init__", 1, 3, 3, 2); __PYX_ERR(0, 44, __pyx_L3_error)
3449 if (unlikely(kw_args > 0)) {
3450 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args,
"__init__") < 0)) __PYX_ERR(0, 44, __pyx_L3_error)
3452 }
else if (PyTuple_GET_SIZE(__pyx_args) != 3) {
3453 goto __pyx_L5_argtuple_error;
3455 values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
3456 values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
3457 values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
3459 __pyx_v_self = values[0];
3460 __pyx_v_L = values[1];
3461 __pyx_v_bs = values[2];
3463 goto __pyx_L4_argument_unpacking_done;
3464 __pyx_L5_argtuple_error:;
3465 __Pyx_RaiseArgtupleInvalid(
"__init__", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 44, __pyx_L3_error)
3467 __Pyx_AddTraceback(
"csmoothers.BASMFactor.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
3468 __Pyx_RefNannyFinishContext();
3470 __pyx_L4_argument_unpacking_done:;
3471 __pyx_r = __pyx_pf_10csmoothers_10BASMFactor___init__(__pyx_self, __pyx_v_self, __pyx_v_L, __pyx_v_bs);
3474 __Pyx_RefNannyFinishContext();
3478 static PyObject *__pyx_pf_10csmoothers_10BASMFactor___init__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_L, PyObject *__pyx_v_bs) {
3479 PyObject *__pyx_r = NULL;
3480 __Pyx_RefNannyDeclarations
3481 PyObject *__pyx_t_1 = NULL;
3482 PyObject *__pyx_t_2 = NULL;
3483 PyObject *__pyx_t_3 = NULL;
3484 int __pyx_lineno = 0;
3485 const char *__pyx_filename = NULL;
3486 int __pyx_clineno = 0;
3487 __Pyx_RefNannySetupContext(
"__init__", 0);
3496 if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_L, __pyx_v_L) < 0) __PYX_ERR(0, 45, __pyx_L1_error)
3505 if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_bs, __pyx_v_bs) < 0) __PYX_ERR(0, 46, __pyx_L1_error)
3514 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_L);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 47, __pyx_L1_error)
3515 __Pyx_GOTREF(__pyx_t_1);
3516 __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_cSparseMatrix);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 47, __pyx_L1_error)
3517 __Pyx_GOTREF(__pyx_t_2);
3518 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
3527 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_bs);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 48, __pyx_L1_error)
3528 __Pyx_GOTREF(__pyx_t_1);
3537 __pyx_t_3 = PyTuple_New(2);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 47, __pyx_L1_error)
3538 __Pyx_GOTREF(__pyx_t_3);
3539 __Pyx_GIVEREF(__pyx_t_2);
3540 PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2);
3541 __Pyx_GIVEREF(__pyx_t_1);
3542 PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_1);
3545 __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_10csmoothers_cBASMFactor), __pyx_t_3, NULL);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 47, __pyx_L1_error)
3546 __Pyx_GOTREF(__pyx_t_1);
3547 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
3548 if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_cBASMFactor, __pyx_t_1) < 0) __PYX_ERR(0, 47, __pyx_L1_error)
3549 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
3560 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
3563 __Pyx_XDECREF(__pyx_t_1);
3564 __Pyx_XDECREF(__pyx_t_2);
3565 __Pyx_XDECREF(__pyx_t_3);
3566 __Pyx_AddTraceback(
"csmoothers.BASMFactor.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
3569 __Pyx_XGIVEREF(__pyx_r);
3570 __Pyx_RefNannyFinishContext();
3583 static int __pyx_pw_10csmoothers_11cBASMFactor_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
3584 static int __pyx_pw_10csmoothers_11cBASMFactor_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
3585 struct __pyx_obj_7proteus_15superluWrappers_cSparseMatrix *__pyx_v_L = 0;
3587 int __pyx_lineno = 0;
3588 const char *__pyx_filename = NULL;
3589 int __pyx_clineno = 0;
3591 __Pyx_RefNannyDeclarations
3592 __Pyx_RefNannySetupContext(
"__cinit__ (wrapper)", 0);
3594 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_L,&__pyx_n_s_bs,0};
3595 PyObject* values[2] = {0,0};
3596 if (unlikely(__pyx_kwds)) {
3598 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
3600 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
3602 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
3605 default:
goto __pyx_L5_argtuple_error;
3607 kw_args = PyDict_Size(__pyx_kwds);
3610 if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_L)) != 0)) kw_args--;
3611 else goto __pyx_L5_argtuple_error;
3614 if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_bs)) != 0)) kw_args--;
3616 __Pyx_RaiseArgtupleInvalid(
"__cinit__", 1, 2, 2, 1); __PYX_ERR(0, 52, __pyx_L3_error)
3619 if (unlikely(kw_args > 0)) {
3620 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args,
"__cinit__") < 0)) __PYX_ERR(0, 52, __pyx_L3_error)
3622 }
else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
3623 goto __pyx_L5_argtuple_error;
3625 values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
3626 values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
3628 __pyx_v_L = ((
struct __pyx_obj_7proteus_15superluWrappers_cSparseMatrix *)values[0]);
3629 __pyx_v_bs = __Pyx_PyInt_As_int(values[1]);
if (unlikely((__pyx_v_bs == (
int)-1) && PyErr_Occurred())) __PYX_ERR(0, 54, __pyx_L3_error)
3631 goto __pyx_L4_argument_unpacking_done;
3632 __pyx_L5_argtuple_error:;
3633 __Pyx_RaiseArgtupleInvalid(
"__cinit__", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 52, __pyx_L3_error)
3635 __Pyx_AddTraceback(
"csmoothers.cBASMFactor.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
3636 __Pyx_RefNannyFinishContext();
3638 __pyx_L4_argument_unpacking_done:;
3639 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_L), __pyx_ptype_7proteus_15superluWrappers_cSparseMatrix, 1,
"L", 0))) __PYX_ERR(0, 53, __pyx_L1_error)
3640 __pyx_r = __pyx_pf_10csmoothers_11cBASMFactor___cinit__(((
struct __pyx_obj_10csmoothers_cBASMFactor *)__pyx_v_self), __pyx_v_L, __pyx_v_bs);
3647 __Pyx_RefNannyFinishContext();
3651 static int __pyx_pf_10csmoothers_11cBASMFactor___cinit__(
struct __pyx_obj_10csmoothers_cBASMFactor *__pyx_v_self,
struct __pyx_obj_7proteus_15superluWrappers_cSparseMatrix *__pyx_v_L,
int __pyx_v_bs) {
3653 __pyx_t_10csmoothers_SuperMatrix __pyx_v_AS;
3655 __Pyx_RefNannyDeclarations
3656 PyObject *__pyx_t_1 = NULL;
3658 int __pyx_lineno = 0;
3659 const char *__pyx_filename = NULL;
3660 int __pyx_clineno = 0;
3661 __Pyx_RefNannySetupContext(
"__cinit__", 0);
3679 __pyx_v_AS.Stype = SLU_NR;
3688 __pyx_v_AS.Dtype = SLU_D;
3697 __pyx_v_AS.Mtype = SLU_GE;
3706 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_L), __pyx_n_s_nr);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 60, __pyx_L1_error)
3707 __Pyx_GOTREF(__pyx_t_1);
3708 __pyx_t_2 = __Pyx_PyInt_As_int(__pyx_t_1);
if (unlikely((__pyx_t_2 == (
int)-1) && PyErr_Occurred())) __PYX_ERR(0, 60, __pyx_L1_error)
3709 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
3710 __pyx_v_AS.nrow = __pyx_t_2;
3719 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_L), __pyx_n_s_nc);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 61, __pyx_L1_error)
3720 __Pyx_GOTREF(__pyx_t_1);
3721 __pyx_t_2 = __Pyx_PyInt_As_int(__pyx_t_1);
if (unlikely((__pyx_t_2 == (
int)-1) && PyErr_Occurred())) __PYX_ERR(0, 61, __pyx_L1_error)
3722 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
3723 __pyx_v_AS.ncol = __pyx_t_2;
3732 __pyx_v_AS.Store = (&__pyx_v_L->A);
3741 __pyx_v_rval =
basm_NR_init(__pyx_v_bs, (&__pyx_v_AS), (&__pyx_v_self->subdomain_dim), (&__pyx_v_self->l2g_L), (&__pyx_v_self->subdomain_L), (&__pyx_v_self->subdomain_R), (&__pyx_v_self->subdomain_dX), (&__pyx_v_self->subdomain_pivots), (&__pyx_v_self->subdomain_col_pivots));
3750 #ifndef CYTHON_WITHOUT_ASSERTIONS
3751 if (unlikely(!Py_OptimizeFlag)) {
3752 if (unlikely(!((__pyx_v_rval == 0) != 0))) {
3753 PyErr_SetNone(PyExc_AssertionError);
3754 __PYX_ERR(0, 72, __pyx_L1_error)
3771 __Pyx_XDECREF(__pyx_t_1);
3772 __Pyx_AddTraceback(
"csmoothers.cBASMFactor.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
3775 __Pyx_RefNannyFinishContext();
3788 static void __pyx_pw_10csmoothers_11cBASMFactor_3__dealloc__(PyObject *__pyx_v_self);
3789 static void __pyx_pw_10csmoothers_11cBASMFactor_3__dealloc__(PyObject *__pyx_v_self) {
3790 __Pyx_RefNannyDeclarations
3791 __Pyx_RefNannySetupContext(
"__dealloc__ (wrapper)", 0);
3792 __pyx_pf_10csmoothers_11cBASMFactor_2__dealloc__(((
struct __pyx_obj_10csmoothers_cBASMFactor *)__pyx_v_self));
3795 __Pyx_RefNannyFinishContext();
3798 static void __pyx_pf_10csmoothers_11cBASMFactor_2__dealloc__(
struct __pyx_obj_10csmoothers_cBASMFactor *__pyx_v_self) {
3799 __Pyx_RefNannyDeclarations
3800 __Pyx_RefNannySetupContext(
"__dealloc__", 0);
3809 basm_NR_free(__pyx_v_self->N, __pyx_v_self->subdomain_dim, __pyx_v_self->l2g_L, __pyx_v_self->subdomain_L, __pyx_v_self->subdomain_R, __pyx_v_self->subdomain_dX, __pyx_v_self->subdomain_pivots, __pyx_v_self->subdomain_col_pivots);
3820 __Pyx_RefNannyFinishContext();
3830 static PyObject *__pyx_pw_10csmoothers_11cBASMFactor_5__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused);
3831 static PyObject *__pyx_pw_10csmoothers_11cBASMFactor_5__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
3832 PyObject *__pyx_r = 0;
3833 __Pyx_RefNannyDeclarations
3834 __Pyx_RefNannySetupContext(
"__reduce_cython__ (wrapper)", 0);
3835 __pyx_r = __pyx_pf_10csmoothers_11cBASMFactor_4__reduce_cython__(((
struct __pyx_obj_10csmoothers_cBASMFactor *)__pyx_v_self));
3838 __Pyx_RefNannyFinishContext();
3842 static PyObject *__pyx_pf_10csmoothers_11cBASMFactor_4__reduce_cython__(CYTHON_UNUSED
struct __pyx_obj_10csmoothers_cBASMFactor *__pyx_v_self) {
3843 PyObject *__pyx_r = NULL;
3844 __Pyx_RefNannyDeclarations
3845 PyObject *__pyx_t_1 = NULL;
3846 int __pyx_lineno = 0;
3847 const char *__pyx_filename = NULL;
3848 int __pyx_clineno = 0;
3849 __Pyx_RefNannySetupContext(
"__reduce_cython__", 0);
3857 __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__3, NULL);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 2, __pyx_L1_error)
3858 __Pyx_GOTREF(__pyx_t_1);
3859 __Pyx_Raise(__pyx_t_1, 0, 0, 0);
3860 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
3861 __PYX_ERR(1, 2, __pyx_L1_error)
3871 __Pyx_XDECREF(__pyx_t_1);
3872 __Pyx_AddTraceback(
"csmoothers.cBASMFactor.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
3874 __Pyx_XGIVEREF(__pyx_r);
3875 __Pyx_RefNannyFinishContext();
3887 static PyObject *__pyx_pw_10csmoothers_11cBASMFactor_7__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state);
3888 static PyObject *__pyx_pw_10csmoothers_11cBASMFactor_7__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
3889 PyObject *__pyx_r = 0;
3890 __Pyx_RefNannyDeclarations
3891 __Pyx_RefNannySetupContext(
"__setstate_cython__ (wrapper)", 0);
3892 __pyx_r = __pyx_pf_10csmoothers_11cBASMFactor_6__setstate_cython__(((
struct __pyx_obj_10csmoothers_cBASMFactor *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state));
3895 __Pyx_RefNannyFinishContext();
3899 static PyObject *__pyx_pf_10csmoothers_11cBASMFactor_6__setstate_cython__(CYTHON_UNUSED
struct __pyx_obj_10csmoothers_cBASMFactor *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) {
3900 PyObject *__pyx_r = NULL;
3901 __Pyx_RefNannyDeclarations
3902 PyObject *__pyx_t_1 = NULL;
3903 int __pyx_lineno = 0;
3904 const char *__pyx_filename = NULL;
3905 int __pyx_clineno = 0;
3906 __Pyx_RefNannySetupContext(
"__setstate_cython__", 0);
3913 __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__4, NULL);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 4, __pyx_L1_error)
3914 __Pyx_GOTREF(__pyx_t_1);
3915 __Pyx_Raise(__pyx_t_1, 0, 0, 0);
3916 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
3917 __PYX_ERR(1, 4, __pyx_L1_error)
3928 __Pyx_XDECREF(__pyx_t_1);
3929 __Pyx_AddTraceback(
"csmoothers.cBASMFactor.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
3931 __Pyx_XGIVEREF(__pyx_r);
3932 __Pyx_RefNannyFinishContext();
3945 static PyObject *__pyx_pw_10csmoothers_1jacobi_NR_prepare(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
3946 static char __pyx_doc_10csmoothers_jacobi_NR_prepare[] =
"\n\n Arguments\n ---------\n A : superluWrappers.SparseMatrix\n w : double\n tol : double\n M : np.array\n ";
3947 static PyMethodDef __pyx_mdef_10csmoothers_1jacobi_NR_prepare = {
"jacobi_NR_prepare", (PyCFunction)(
void*)(PyCFunctionWithKeywords)__pyx_pw_10csmoothers_1jacobi_NR_prepare, METH_VARARGS|METH_KEYWORDS, __pyx_doc_10csmoothers_jacobi_NR_prepare};
3948 static PyObject *__pyx_pw_10csmoothers_1jacobi_NR_prepare(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
3949 PyObject *__pyx_v_A = 0;
3950 PyObject *__pyx_v_w = 0;
3951 PyObject *__pyx_v_tol = 0;
3952 PyObject *__pyx_v_M = 0;
3953 int __pyx_lineno = 0;
3954 const char *__pyx_filename = NULL;
3955 int __pyx_clineno = 0;
3956 PyObject *__pyx_r = 0;
3957 __Pyx_RefNannyDeclarations
3958 __Pyx_RefNannySetupContext(
"jacobi_NR_prepare (wrapper)", 0);
3960 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_A,&__pyx_n_s_w,&__pyx_n_s_tol,&__pyx_n_s_M,0};
3961 PyObject* values[4] = {0,0,0,0};
3962 if (unlikely(__pyx_kwds)) {
3964 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
3966 case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
3968 case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
3970 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
3972 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
3975 default:
goto __pyx_L5_argtuple_error;
3977 kw_args = PyDict_Size(__pyx_kwds);
3980 if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_A)) != 0)) kw_args--;
3981 else goto __pyx_L5_argtuple_error;
3984 if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_w)) != 0)) kw_args--;
3986 __Pyx_RaiseArgtupleInvalid(
"jacobi_NR_prepare", 1, 4, 4, 1); __PYX_ERR(0, 84, __pyx_L3_error)
3990 if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_tol)) != 0)) kw_args--;
3992 __Pyx_RaiseArgtupleInvalid(
"jacobi_NR_prepare", 1, 4, 4, 2); __PYX_ERR(0, 84, __pyx_L3_error)
3996 if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_M)) != 0)) kw_args--;
3998 __Pyx_RaiseArgtupleInvalid(
"jacobi_NR_prepare", 1, 4, 4, 3); __PYX_ERR(0, 84, __pyx_L3_error)
4001 if (unlikely(kw_args > 0)) {
4002 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args,
"jacobi_NR_prepare") < 0)) __PYX_ERR(0, 84, __pyx_L3_error)
4004 }
else if (PyTuple_GET_SIZE(__pyx_args) != 4) {
4005 goto __pyx_L5_argtuple_error;
4007 values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
4008 values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
4009 values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
4010 values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
4012 __pyx_v_A = values[0];
4013 __pyx_v_w = values[1];
4014 __pyx_v_tol = values[2];
4015 __pyx_v_M = values[3];
4017 goto __pyx_L4_argument_unpacking_done;
4018 __pyx_L5_argtuple_error:;
4019 __Pyx_RaiseArgtupleInvalid(
"jacobi_NR_prepare", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 84, __pyx_L3_error)
4021 __Pyx_AddTraceback(
"csmoothers.jacobi_NR_prepare", __pyx_clineno, __pyx_lineno, __pyx_filename);
4022 __Pyx_RefNannyFinishContext();
4024 __pyx_L4_argument_unpacking_done:;
4025 __pyx_r = __pyx_pf_10csmoothers_jacobi_NR_prepare(__pyx_self, __pyx_v_A, __pyx_v_w, __pyx_v_tol, __pyx_v_M);
4028 __Pyx_RefNannyFinishContext();
4032 static PyObject *__pyx_pf_10csmoothers_jacobi_NR_prepare(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_A, PyObject *__pyx_v_w, PyObject *__pyx_v_tol, PyObject *__pyx_v_M) {
4033 PyObject *__pyx_r = NULL;
4034 __Pyx_RefNannyDeclarations
4035 PyObject *__pyx_t_1 = NULL;
4038 __pyx_t_10csmoothers_DDATA __pyx_t_4 = { 0, 0, { 0 }, { 0 }, { 0 } };
4039 int __pyx_lineno = 0;
4040 const char *__pyx_filename = NULL;
4041 int __pyx_clineno = 0;
4042 __Pyx_RefNannySetupContext(
"jacobi_NR_prepare", 0);
4051 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_A, __pyx_n_s_cSparseMatrix);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 94, __pyx_L1_error)
4052 __Pyx_GOTREF(__pyx_t_1);
4053 if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_7proteus_15superluWrappers_cSparseMatrix))))) __PYX_ERR(0, 94, __pyx_L1_error)
4054 __pyx_t_2 = __pyx_PyFloat_AsDouble(__pyx_v_w);
if (unlikely((__pyx_t_2 == (
double)-1) && PyErr_Occurred())) __PYX_ERR(0, 94, __pyx_L1_error)
4055 __pyx_t_3 = __pyx_PyFloat_AsDouble(__pyx_v_tol);
if (unlikely((__pyx_t_3 == (
double)-1) && PyErr_Occurred())) __PYX_ERR(0, 94, __pyx_L1_error)
4056 __pyx_t_4 = __Pyx_PyObject_to_MemoryviewSlice_ds_double(__pyx_v_M, PyBUF_WRITABLE);
if (unlikely(!__pyx_t_4.memview)) __PYX_ERR(0, 94, __pyx_L1_error)
4057 __pyx_f_10csmoothers_smootherWrappersjacobi_NR_prepare(((
struct __pyx_obj_7proteus_15superluWrappers_cSparseMatrix *)__pyx_t_1), __pyx_t_2, __pyx_t_3, __pyx_t_4);
4058 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
4059 __PYX_XDEC_MEMVIEW(&__pyx_t_4, 1);
4060 __pyx_t_4.memview = NULL;
4061 __pyx_t_4.data = NULL;
4072 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
4075 __Pyx_XDECREF(__pyx_t_1);
4076 __PYX_XDEC_MEMVIEW(&__pyx_t_4, 1);
4077 __Pyx_AddTraceback(
"csmoothers.jacobi_NR_prepare", __pyx_clineno, __pyx_lineno, __pyx_filename);
4080 __Pyx_XGIVEREF(__pyx_r);
4081 __Pyx_RefNannyFinishContext();
4093 static void __pyx_f_10csmoothers_smootherWrappersjacobi_NR_prepare(
struct __pyx_obj_7proteus_15superluWrappers_cSparseMatrix *__pyx_v_sm,
double __pyx_v_w,
double __pyx_v_tol, __pyx_t_10csmoothers_DDATA __pyx_v_M) {
4094 __pyx_t_10csmoothers_SuperMatrix __pyx_v_AS;
4095 __Pyx_RefNannyDeclarations
4096 PyObject *__pyx_t_1 = NULL;
4098 Py_ssize_t __pyx_t_3;
4099 int __pyx_lineno = 0;
4100 const char *__pyx_filename = NULL;
4101 int __pyx_clineno = 0;
4102 __Pyx_RefNannySetupContext(
"smootherWrappersjacobi_NR_prepare", 0);
4111 __pyx_v_AS.Stype = SLU_NR;
4120 __pyx_v_AS.Dtype = SLU_D;
4129 __pyx_v_AS.Mtype = SLU_GE;
4138 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_sm), __pyx_n_s_nr);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 104, __pyx_L1_error)
4139 __Pyx_GOTREF(__pyx_t_1);
4140 __pyx_t_2 = __Pyx_PyInt_As_int(__pyx_t_1);
if (unlikely((__pyx_t_2 == (
int)-1) && PyErr_Occurred())) __PYX_ERR(0, 104, __pyx_L1_error)
4141 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
4142 __pyx_v_AS.nrow = __pyx_t_2;
4151 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_sm), __pyx_n_s_nc);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 105, __pyx_L1_error)
4152 __Pyx_GOTREF(__pyx_t_1);
4153 __pyx_t_2 = __Pyx_PyInt_As_int(__pyx_t_1);
if (unlikely((__pyx_t_2 == (
int)-1) && PyErr_Occurred())) __PYX_ERR(0, 105, __pyx_L1_error)
4154 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
4155 __pyx_v_AS.ncol = __pyx_t_2;
4164 __pyx_v_AS.Store = (&__pyx_v_sm->A);
4175 if (__pyx_t_3 < 0) {
4176 __pyx_t_3 += __pyx_v_M.shape[0];
4177 if (unlikely(__pyx_t_3 < 0)) __pyx_t_2 = 0;
4178 }
else if (unlikely(__pyx_t_3 >= __pyx_v_M.shape[0])) __pyx_t_2 = 0;
4179 if (unlikely(__pyx_t_2 != -1)) {
4180 __Pyx_RaiseBufferIndexError(__pyx_t_2);
4181 __PYX_ERR(0, 107, __pyx_L1_error)
4183 jacobi_NR_prepare((&__pyx_v_AS), __pyx_v_w, __pyx_v_tol, (&(*((
double *) ( (__pyx_v_M.data + __pyx_t_3 * __pyx_v_M.strides[0]) )))));
4196 __Pyx_XDECREF(__pyx_t_1);
4197 __Pyx_WriteUnraisable(
"csmoothers.smootherWrappersjacobi_NR_prepare", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
4199 __Pyx_RefNannyFinishContext();
4211 static PyObject *__pyx_pw_10csmoothers_3jacobi_NR_solve(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
4212 static char __pyx_doc_10csmoothers_2jacobi_NR_solve[] =
"\n \n Arguments\n ---------\n A : superluWrappers.SparseMatrix\n M : np.array double\n R : np.array double\n node_order : np.array int\n dX : np.array double\n ";
4213 static PyMethodDef __pyx_mdef_10csmoothers_3jacobi_NR_solve = {
"jacobi_NR_solve", (PyCFunction)(
void*)(PyCFunctionWithKeywords)__pyx_pw_10csmoothers_3jacobi_NR_solve, METH_VARARGS|METH_KEYWORDS, __pyx_doc_10csmoothers_2jacobi_NR_solve};
4214 static PyObject *__pyx_pw_10csmoothers_3jacobi_NR_solve(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
4215 PyObject *__pyx_v_A = 0;
4216 PyObject *__pyx_v_M = 0;
4217 PyObject *__pyx_v_R = 0;
4218 PyObject *__pyx_v_node_order = 0;
4219 PyObject *__pyx_v_dX = 0;
4220 int __pyx_lineno = 0;
4221 const char *__pyx_filename = NULL;
4222 int __pyx_clineno = 0;
4223 PyObject *__pyx_r = 0;
4224 __Pyx_RefNannyDeclarations
4225 __Pyx_RefNannySetupContext(
"jacobi_NR_solve (wrapper)", 0);
4227 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_A,&__pyx_n_s_M,&__pyx_n_s_R,&__pyx_n_s_node_order,&__pyx_n_s_dX,0};
4228 PyObject* values[5] = {0,0,0,0,0};
4229 if (unlikely(__pyx_kwds)) {
4231 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
4233 case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
4235 case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
4237 case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
4239 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
4241 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
4244 default:
goto __pyx_L5_argtuple_error;
4246 kw_args = PyDict_Size(__pyx_kwds);
4249 if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_A)) != 0)) kw_args--;
4250 else goto __pyx_L5_argtuple_error;
4253 if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_M)) != 0)) kw_args--;
4255 __Pyx_RaiseArgtupleInvalid(
"jacobi_NR_solve", 1, 5, 5, 1); __PYX_ERR(0, 109, __pyx_L3_error)
4259 if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_R)) != 0)) kw_args--;
4261 __Pyx_RaiseArgtupleInvalid(
"jacobi_NR_solve", 1, 5, 5, 2); __PYX_ERR(0, 109, __pyx_L3_error)
4265 if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_node_order)) != 0)) kw_args--;
4267 __Pyx_RaiseArgtupleInvalid(
"jacobi_NR_solve", 1, 5, 5, 3); __PYX_ERR(0, 109, __pyx_L3_error)
4271 if (likely((values[4] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_dX)) != 0)) kw_args--;
4273 __Pyx_RaiseArgtupleInvalid(
"jacobi_NR_solve", 1, 5, 5, 4); __PYX_ERR(0, 109, __pyx_L3_error)
4276 if (unlikely(kw_args > 0)) {
4277 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args,
"jacobi_NR_solve") < 0)) __PYX_ERR(0, 109, __pyx_L3_error)
4279 }
else if (PyTuple_GET_SIZE(__pyx_args) != 5) {
4280 goto __pyx_L5_argtuple_error;
4282 values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
4283 values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
4284 values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
4285 values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
4286 values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
4288 __pyx_v_A = values[0];
4289 __pyx_v_M = values[1];
4290 __pyx_v_R = values[2];
4291 __pyx_v_node_order = values[3];
4292 __pyx_v_dX = values[4];
4294 goto __pyx_L4_argument_unpacking_done;
4295 __pyx_L5_argtuple_error:;
4296 __Pyx_RaiseArgtupleInvalid(
"jacobi_NR_solve", 1, 5, 5, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 109, __pyx_L3_error)
4298 __Pyx_AddTraceback(
"csmoothers.jacobi_NR_solve", __pyx_clineno, __pyx_lineno, __pyx_filename);
4299 __Pyx_RefNannyFinishContext();
4301 __pyx_L4_argument_unpacking_done:;
4302 __pyx_r = __pyx_pf_10csmoothers_2jacobi_NR_solve(__pyx_self, __pyx_v_A, __pyx_v_M, __pyx_v_R, __pyx_v_node_order, __pyx_v_dX);
4305 __Pyx_RefNannyFinishContext();
4309 static PyObject *__pyx_pf_10csmoothers_2jacobi_NR_solve(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_A, PyObject *__pyx_v_M, PyObject *__pyx_v_R, PyObject *__pyx_v_node_order, PyObject *__pyx_v_dX) {
4310 PyObject *__pyx_r = NULL;
4311 __Pyx_RefNannyDeclarations
4312 PyObject *__pyx_t_1 = NULL;
4313 __pyx_t_10csmoothers_DDATA __pyx_t_2 = { 0, 0, { 0 }, { 0 }, { 0 } };
4314 __pyx_t_10csmoothers_DDATA __pyx_t_3 = { 0, 0, { 0 }, { 0 }, { 0 } };
4315 __pyx_t_10csmoothers_IDATA __pyx_t_4 = { 0, 0, { 0 }, { 0 }, { 0 } };
4316 __pyx_t_10csmoothers_DDATA __pyx_t_5 = { 0, 0, { 0 }, { 0 }, { 0 } };
4317 int __pyx_lineno = 0;
4318 const char *__pyx_filename = NULL;
4319 int __pyx_clineno = 0;
4320 __Pyx_RefNannySetupContext(
"jacobi_NR_solve", 0);
4329 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_A, __pyx_n_s_cSparseMatrix);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 120, __pyx_L1_error)
4330 __Pyx_GOTREF(__pyx_t_1);
4331 if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_7proteus_15superluWrappers_cSparseMatrix))))) __PYX_ERR(0, 120, __pyx_L1_error)
4332 __pyx_t_2 = __Pyx_PyObject_to_MemoryviewSlice_ds_double(__pyx_v_M, PyBUF_WRITABLE);
if (unlikely(!__pyx_t_2.memview)) __PYX_ERR(0, 120, __pyx_L1_error)
4333 __pyx_t_3 = __Pyx_PyObject_to_MemoryviewSlice_ds_double(__pyx_v_R, PyBUF_WRITABLE);
if (unlikely(!__pyx_t_3.memview)) __PYX_ERR(0, 120, __pyx_L1_error)
4334 __pyx_t_4 = __Pyx_PyObject_to_MemoryviewSlice_ds_int(__pyx_v_node_order, PyBUF_WRITABLE);
if (unlikely(!__pyx_t_4.memview)) __PYX_ERR(0, 120, __pyx_L1_error)
4335 __pyx_t_5 = __Pyx_PyObject_to_MemoryviewSlice_ds_double(__pyx_v_dX, PyBUF_WRITABLE);
if (unlikely(!__pyx_t_5.memview)) __PYX_ERR(0, 120, __pyx_L1_error)
4336 __pyx_f_10csmoothers_smootherWrappersjacobi_NR_solve(((
struct __pyx_obj_7proteus_15superluWrappers_cSparseMatrix *)__pyx_t_1), __pyx_t_2, __pyx_t_3, __pyx_t_4, __pyx_t_5);
4337 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
4338 __PYX_XDEC_MEMVIEW(&__pyx_t_2, 1);
4339 __pyx_t_2.memview = NULL;
4340 __pyx_t_2.data = NULL;
4341 __PYX_XDEC_MEMVIEW(&__pyx_t_3, 1);
4342 __pyx_t_3.memview = NULL;
4343 __pyx_t_3.data = NULL;
4344 __PYX_XDEC_MEMVIEW(&__pyx_t_4, 1);
4345 __pyx_t_4.memview = NULL;
4346 __pyx_t_4.data = NULL;
4347 __PYX_XDEC_MEMVIEW(&__pyx_t_5, 1);
4348 __pyx_t_5.memview = NULL;
4349 __pyx_t_5.data = NULL;
4360 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
4363 __Pyx_XDECREF(__pyx_t_1);
4364 __PYX_XDEC_MEMVIEW(&__pyx_t_2, 1);
4365 __PYX_XDEC_MEMVIEW(&__pyx_t_3, 1);
4366 __PYX_XDEC_MEMVIEW(&__pyx_t_4, 1);
4367 __PYX_XDEC_MEMVIEW(&__pyx_t_5, 1);
4368 __Pyx_AddTraceback(
"csmoothers.jacobi_NR_solve", __pyx_clineno, __pyx_lineno, __pyx_filename);
4371 __Pyx_XGIVEREF(__pyx_r);
4372 __Pyx_RefNannyFinishContext();
4384 static void __pyx_f_10csmoothers_smootherWrappersjacobi_NR_solve(
struct __pyx_obj_7proteus_15superluWrappers_cSparseMatrix *__pyx_v_sm, __pyx_t_10csmoothers_DDATA __pyx_v_M, __pyx_t_10csmoothers_DDATA __pyx_v_R, __pyx_t_10csmoothers_IDATA __pyx_v_node_order, __pyx_t_10csmoothers_DDATA __pyx_v_dX) {
4385 __pyx_t_10csmoothers_SuperMatrix __pyx_v_AS;
4386 __Pyx_RefNannyDeclarations
4387 PyObject *__pyx_t_1 = NULL;
4389 Py_ssize_t __pyx_t_3;
4390 Py_ssize_t __pyx_t_4;
4391 Py_ssize_t __pyx_t_5;
4392 Py_ssize_t __pyx_t_6;
4393 int __pyx_lineno = 0;
4394 const char *__pyx_filename = NULL;
4395 int __pyx_clineno = 0;
4396 __Pyx_RefNannySetupContext(
"smootherWrappersjacobi_NR_solve", 0);
4405 __pyx_v_AS.Stype = SLU_NR;
4414 __pyx_v_AS.Dtype = SLU_D;
4423 __pyx_v_AS.Mtype = SLU_GE;
4432 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_sm), __pyx_n_s_nr);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 131, __pyx_L1_error)
4433 __Pyx_GOTREF(__pyx_t_1);
4434 __pyx_t_2 = __Pyx_PyInt_As_int(__pyx_t_1);
if (unlikely((__pyx_t_2 == (
int)-1) && PyErr_Occurred())) __PYX_ERR(0, 131, __pyx_L1_error)
4435 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
4436 __pyx_v_AS.nrow = __pyx_t_2;
4445 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_sm), __pyx_n_s_nc);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 132, __pyx_L1_error)
4446 __Pyx_GOTREF(__pyx_t_1);
4447 __pyx_t_2 = __Pyx_PyInt_As_int(__pyx_t_1);
if (unlikely((__pyx_t_2 == (
int)-1) && PyErr_Occurred())) __PYX_ERR(0, 132, __pyx_L1_error)
4448 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
4449 __pyx_v_AS.ncol = __pyx_t_2;
4458 __pyx_v_AS.Store = (&__pyx_v_sm->A);
4469 if (__pyx_t_3 < 0) {
4470 __pyx_t_3 += __pyx_v_M.shape[0];
4471 if (unlikely(__pyx_t_3 < 0)) __pyx_t_2 = 0;
4472 }
else if (unlikely(__pyx_t_3 >= __pyx_v_M.shape[0])) __pyx_t_2 = 0;
4473 if (unlikely(__pyx_t_2 != -1)) {
4474 __Pyx_RaiseBufferIndexError(__pyx_t_2);
4475 __PYX_ERR(0, 134, __pyx_L1_error)
4479 if (__pyx_t_4 < 0) {
4480 __pyx_t_4 += __pyx_v_R.shape[0];
4481 if (unlikely(__pyx_t_4 < 0)) __pyx_t_2 = 0;
4482 }
else if (unlikely(__pyx_t_4 >= __pyx_v_R.shape[0])) __pyx_t_2 = 0;
4483 if (unlikely(__pyx_t_2 != -1)) {
4484 __Pyx_RaiseBufferIndexError(__pyx_t_2);
4485 __PYX_ERR(0, 134, __pyx_L1_error)
4489 if (__pyx_t_5 < 0) {
4490 __pyx_t_5 += __pyx_v_node_order.shape[0];
4491 if (unlikely(__pyx_t_5 < 0)) __pyx_t_2 = 0;
4492 }
else if (unlikely(__pyx_t_5 >= __pyx_v_node_order.shape[0])) __pyx_t_2 = 0;
4493 if (unlikely(__pyx_t_2 != -1)) {
4494 __Pyx_RaiseBufferIndexError(__pyx_t_2);
4495 __PYX_ERR(0, 134, __pyx_L1_error)
4499 if (__pyx_t_6 < 0) {
4500 __pyx_t_6 += __pyx_v_dX.shape[0];
4501 if (unlikely(__pyx_t_6 < 0)) __pyx_t_2 = 0;
4502 }
else if (unlikely(__pyx_t_6 >= __pyx_v_dX.shape[0])) __pyx_t_2 = 0;
4503 if (unlikely(__pyx_t_2 != -1)) {
4504 __Pyx_RaiseBufferIndexError(__pyx_t_2);
4505 __PYX_ERR(0, 134, __pyx_L1_error)
4507 jacobi_NR_solve((&__pyx_v_AS), (&(*((
double *) ( (__pyx_v_M.data + __pyx_t_3 * __pyx_v_M.strides[0]) )))), (&(*((
double *) ( (__pyx_v_R.data + __pyx_t_4 * __pyx_v_R.strides[0]) )))), (&(*((
int *) ( (__pyx_v_node_order.data + __pyx_t_5 * __pyx_v_node_order.strides[0]) )))), (&(*((
double *) ( (__pyx_v_dX.data + __pyx_t_6 * __pyx_v_dX.strides[0]) )))));
4520 __Pyx_XDECREF(__pyx_t_1);
4521 __Pyx_WriteUnraisable(
"csmoothers.smootherWrappersjacobi_NR_solve", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
4523 __Pyx_RefNannyFinishContext();
4535 static PyObject *__pyx_pw_10csmoothers_5nl_jacobi_NR_solve(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
4536 static char __pyx_doc_10csmoothers_4nl_jacobi_NR_solve[] =
"\n\n Arguments\n ---------\n A : superluWrappers.SparseMatrix\n R : np.array double\n node_order : np.array int\n w : np.float\n tol : np.float\n dX : np.array double\n ";
4537 static PyMethodDef __pyx_mdef_10csmoothers_5nl_jacobi_NR_solve = {
"nl_jacobi_NR_solve", (PyCFunction)(
void*)(PyCFunctionWithKeywords)__pyx_pw_10csmoothers_5nl_jacobi_NR_solve, METH_VARARGS|METH_KEYWORDS, __pyx_doc_10csmoothers_4nl_jacobi_NR_solve};
4538 static PyObject *__pyx_pw_10csmoothers_5nl_jacobi_NR_solve(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
4539 PyObject *__pyx_v_A = 0;
4540 PyObject *__pyx_v_R = 0;
4541 PyObject *__pyx_v_node_order = 0;
4542 PyObject *__pyx_v_w = 0;
4543 PyObject *__pyx_v_tol = 0;
4544 PyObject *__pyx_v_dX = 0;
4545 int __pyx_lineno = 0;
4546 const char *__pyx_filename = NULL;
4547 int __pyx_clineno = 0;
4548 PyObject *__pyx_r = 0;
4549 __Pyx_RefNannyDeclarations
4550 __Pyx_RefNannySetupContext(
"nl_jacobi_NR_solve (wrapper)", 0);
4552 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_A,&__pyx_n_s_R,&__pyx_n_s_node_order,&__pyx_n_s_w,&__pyx_n_s_tol,&__pyx_n_s_dX,0};
4553 PyObject* values[6] = {0,0,0,0,0,0};
4554 if (unlikely(__pyx_kwds)) {
4556 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
4558 case 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
4560 case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
4562 case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
4564 case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
4566 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
4568 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
4571 default:
goto __pyx_L5_argtuple_error;
4573 kw_args = PyDict_Size(__pyx_kwds);
4576 if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_A)) != 0)) kw_args--;
4577 else goto __pyx_L5_argtuple_error;
4580 if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_R)) != 0)) kw_args--;
4582 __Pyx_RaiseArgtupleInvalid(
"nl_jacobi_NR_solve", 1, 6, 6, 1); __PYX_ERR(0, 136, __pyx_L3_error)
4586 if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_node_order)) != 0)) kw_args--;
4588 __Pyx_RaiseArgtupleInvalid(
"nl_jacobi_NR_solve", 1, 6, 6, 2); __PYX_ERR(0, 136, __pyx_L3_error)
4592 if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_w)) != 0)) kw_args--;
4594 __Pyx_RaiseArgtupleInvalid(
"nl_jacobi_NR_solve", 1, 6, 6, 3); __PYX_ERR(0, 136, __pyx_L3_error)
4598 if (likely((values[4] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_tol)) != 0)) kw_args--;
4600 __Pyx_RaiseArgtupleInvalid(
"nl_jacobi_NR_solve", 1, 6, 6, 4); __PYX_ERR(0, 136, __pyx_L3_error)
4604 if (likely((values[5] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_dX)) != 0)) kw_args--;
4606 __Pyx_RaiseArgtupleInvalid(
"nl_jacobi_NR_solve", 1, 6, 6, 5); __PYX_ERR(0, 136, __pyx_L3_error)
4609 if (unlikely(kw_args > 0)) {
4610 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args,
"nl_jacobi_NR_solve") < 0)) __PYX_ERR(0, 136, __pyx_L3_error)
4612 }
else if (PyTuple_GET_SIZE(__pyx_args) != 6) {
4613 goto __pyx_L5_argtuple_error;
4615 values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
4616 values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
4617 values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
4618 values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
4619 values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
4620 values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
4622 __pyx_v_A = values[0];
4623 __pyx_v_R = values[1];
4624 __pyx_v_node_order = values[2];
4625 __pyx_v_w = values[3];
4626 __pyx_v_tol = values[4];
4627 __pyx_v_dX = values[5];
4629 goto __pyx_L4_argument_unpacking_done;
4630 __pyx_L5_argtuple_error:;
4631 __Pyx_RaiseArgtupleInvalid(
"nl_jacobi_NR_solve", 1, 6, 6, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 136, __pyx_L3_error)
4633 __Pyx_AddTraceback(
"csmoothers.nl_jacobi_NR_solve", __pyx_clineno, __pyx_lineno, __pyx_filename);
4634 __Pyx_RefNannyFinishContext();
4636 __pyx_L4_argument_unpacking_done:;
4637 __pyx_r = __pyx_pf_10csmoothers_4nl_jacobi_NR_solve(__pyx_self, __pyx_v_A, __pyx_v_R, __pyx_v_node_order, __pyx_v_w, __pyx_v_tol, __pyx_v_dX);
4640 __Pyx_RefNannyFinishContext();
4644 static PyObject *__pyx_pf_10csmoothers_4nl_jacobi_NR_solve(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_A, PyObject *__pyx_v_R, PyObject *__pyx_v_node_order, PyObject *__pyx_v_w, PyObject *__pyx_v_tol, PyObject *__pyx_v_dX) {
4645 PyObject *__pyx_r = NULL;
4646 __Pyx_RefNannyDeclarations
4647 PyObject *__pyx_t_1 = NULL;
4648 __pyx_t_10csmoothers_DDATA __pyx_t_2 = { 0, 0, { 0 }, { 0 }, { 0 } };
4649 __pyx_t_10csmoothers_IDATA __pyx_t_3 = { 0, 0, { 0 }, { 0 }, { 0 } };
4652 __pyx_t_10csmoothers_DDATA __pyx_t_6 = { 0, 0, { 0 }, { 0 }, { 0 } };
4653 int __pyx_lineno = 0;
4654 const char *__pyx_filename = NULL;
4655 int __pyx_clineno = 0;
4656 __Pyx_RefNannySetupContext(
"nl_jacobi_NR_solve", 0);
4665 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_A, __pyx_n_s_cSparseMatrix);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 148, __pyx_L1_error)
4666 __Pyx_GOTREF(__pyx_t_1);
4667 if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_7proteus_15superluWrappers_cSparseMatrix))))) __PYX_ERR(0, 148, __pyx_L1_error)
4668 __pyx_t_2 = __Pyx_PyObject_to_MemoryviewSlice_ds_double(__pyx_v_R, PyBUF_WRITABLE);
if (unlikely(!__pyx_t_2.memview)) __PYX_ERR(0, 148, __pyx_L1_error)
4669 __pyx_t_3 = __Pyx_PyObject_to_MemoryviewSlice_ds_int(__pyx_v_node_order, PyBUF_WRITABLE);
if (unlikely(!__pyx_t_3.memview)) __PYX_ERR(0, 148, __pyx_L1_error)
4670 __pyx_t_4 = __pyx_PyFloat_AsDouble(__pyx_v_w);
if (unlikely((__pyx_t_4 == (
double)-1) && PyErr_Occurred())) __PYX_ERR(0, 148, __pyx_L1_error)
4671 __pyx_t_5 = __pyx_PyFloat_AsDouble(__pyx_v_tol);
if (unlikely((__pyx_t_5 == (
double)-1) && PyErr_Occurred())) __PYX_ERR(0, 148, __pyx_L1_error)
4672 __pyx_t_6 = __Pyx_PyObject_to_MemoryviewSlice_ds_double(__pyx_v_dX, PyBUF_WRITABLE);
if (unlikely(!__pyx_t_6.memview)) __PYX_ERR(0, 148, __pyx_L1_error)
4673 __pyx_f_10csmoothers_smootherWrappersnl_jacobi_NR_solve(((
struct __pyx_obj_7proteus_15superluWrappers_cSparseMatrix *)__pyx_t_1), __pyx_t_2, __pyx_t_3, __pyx_t_4, __pyx_t_5, __pyx_t_6);
4674 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
4675 __PYX_XDEC_MEMVIEW(&__pyx_t_2, 1);
4676 __pyx_t_2.memview = NULL;
4677 __pyx_t_2.data = NULL;
4678 __PYX_XDEC_MEMVIEW(&__pyx_t_3, 1);
4679 __pyx_t_3.memview = NULL;
4680 __pyx_t_3.data = NULL;
4681 __PYX_XDEC_MEMVIEW(&__pyx_t_6, 1);
4682 __pyx_t_6.memview = NULL;
4683 __pyx_t_6.data = NULL;
4694 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
4697 __Pyx_XDECREF(__pyx_t_1);
4698 __PYX_XDEC_MEMVIEW(&__pyx_t_2, 1);
4699 __PYX_XDEC_MEMVIEW(&__pyx_t_3, 1);
4700 __PYX_XDEC_MEMVIEW(&__pyx_t_6, 1);
4701 __Pyx_AddTraceback(
"csmoothers.nl_jacobi_NR_solve", __pyx_clineno, __pyx_lineno, __pyx_filename);
4704 __Pyx_XGIVEREF(__pyx_r);
4705 __Pyx_RefNannyFinishContext();
4717 static void __pyx_f_10csmoothers_smootherWrappersnl_jacobi_NR_solve(
struct __pyx_obj_7proteus_15superluWrappers_cSparseMatrix *__pyx_v_sm, __pyx_t_10csmoothers_DDATA __pyx_v_R, __pyx_t_10csmoothers_IDATA __pyx_v_node_order,
double __pyx_v_w,
double __pyx_v_tol, __pyx_t_10csmoothers_DDATA __pyx_v_dX) {
4718 __pyx_t_10csmoothers_SuperMatrix __pyx_v_AS;
4719 __Pyx_RefNannyDeclarations
4720 PyObject *__pyx_t_1 = NULL;
4722 Py_ssize_t __pyx_t_3;
4723 Py_ssize_t __pyx_t_4;
4724 Py_ssize_t __pyx_t_5;
4725 int __pyx_lineno = 0;
4726 const char *__pyx_filename = NULL;
4727 int __pyx_clineno = 0;
4728 __Pyx_RefNannySetupContext(
"smootherWrappersnl_jacobi_NR_solve", 0);
4737 __pyx_v_AS.Stype = SLU_NR;
4746 __pyx_v_AS.Dtype = SLU_D;
4755 __pyx_v_AS.Mtype = SLU_GE;
4764 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_sm), __pyx_n_s_nr);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 160, __pyx_L1_error)
4765 __Pyx_GOTREF(__pyx_t_1);
4766 __pyx_t_2 = __Pyx_PyInt_As_int(__pyx_t_1);
if (unlikely((__pyx_t_2 == (
int)-1) && PyErr_Occurred())) __PYX_ERR(0, 160, __pyx_L1_error)
4767 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
4768 __pyx_v_AS.nrow = __pyx_t_2;
4777 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_sm), __pyx_n_s_nc);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 161, __pyx_L1_error)
4778 __Pyx_GOTREF(__pyx_t_1);
4779 __pyx_t_2 = __Pyx_PyInt_As_int(__pyx_t_1);
if (unlikely((__pyx_t_2 == (
int)-1) && PyErr_Occurred())) __PYX_ERR(0, 161, __pyx_L1_error)
4780 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
4781 __pyx_v_AS.ncol = __pyx_t_2;
4790 __pyx_v_AS.Store = (&__pyx_v_sm->A);
4801 if (__pyx_t_3 < 0) {
4802 __pyx_t_3 += __pyx_v_R.shape[0];
4803 if (unlikely(__pyx_t_3 < 0)) __pyx_t_2 = 0;
4804 }
else if (unlikely(__pyx_t_3 >= __pyx_v_R.shape[0])) __pyx_t_2 = 0;
4805 if (unlikely(__pyx_t_2 != -1)) {
4806 __Pyx_RaiseBufferIndexError(__pyx_t_2);
4807 __PYX_ERR(0, 163, __pyx_L1_error)
4811 if (__pyx_t_4 < 0) {
4812 __pyx_t_4 += __pyx_v_node_order.shape[0];
4813 if (unlikely(__pyx_t_4 < 0)) __pyx_t_2 = 0;
4814 }
else if (unlikely(__pyx_t_4 >= __pyx_v_node_order.shape[0])) __pyx_t_2 = 0;
4815 if (unlikely(__pyx_t_2 != -1)) {
4816 __Pyx_RaiseBufferIndexError(__pyx_t_2);
4817 __PYX_ERR(0, 163, __pyx_L1_error)
4821 if (__pyx_t_5 < 0) {
4822 __pyx_t_5 += __pyx_v_dX.shape[0];
4823 if (unlikely(__pyx_t_5 < 0)) __pyx_t_2 = 0;
4824 }
else if (unlikely(__pyx_t_5 >= __pyx_v_dX.shape[0])) __pyx_t_2 = 0;
4825 if (unlikely(__pyx_t_2 != -1)) {
4826 __Pyx_RaiseBufferIndexError(__pyx_t_2);
4827 __PYX_ERR(0, 163, __pyx_L1_error)
4829 nl_jacobi_NR_solve((&__pyx_v_AS), (&(*((
double *) ( (__pyx_v_R.data + __pyx_t_3 * __pyx_v_R.strides[0]) )))), (&(*((
int *) ( (__pyx_v_node_order.data + __pyx_t_4 * __pyx_v_node_order.strides[0]) )))), __pyx_v_w, __pyx_v_tol, (&(*((
double *) ( (__pyx_v_dX.data + __pyx_t_5 * __pyx_v_dX.strides[0]) )))));
4842 __Pyx_XDECREF(__pyx_t_1);
4843 __Pyx_WriteUnraisable(
"csmoothers.smootherWrappersnl_jacobi_NR_solve", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
4845 __Pyx_RefNannyFinishContext();
4857 static PyObject *__pyx_pw_10csmoothers_7gauss_seidel_NR_preare(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
4858 static char __pyx_doc_10csmoothers_6gauss_seidel_NR_preare[] =
"\n\n Arguments\n ---------\n A :\n w :\n tol :\n M :\n ";
4859 static PyMethodDef __pyx_mdef_10csmoothers_7gauss_seidel_NR_preare = {
"gauss_seidel_NR_preare", (PyCFunction)(
void*)(PyCFunctionWithKeywords)__pyx_pw_10csmoothers_7gauss_seidel_NR_preare, METH_VARARGS|METH_KEYWORDS, __pyx_doc_10csmoothers_6gauss_seidel_NR_preare};
4860 static PyObject *__pyx_pw_10csmoothers_7gauss_seidel_NR_preare(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
4861 PyObject *__pyx_v_A = 0;
4862 PyObject *__pyx_v_w = 0;
4863 PyObject *__pyx_v_tol = 0;
4864 PyObject *__pyx_v_M = 0;
4865 int __pyx_lineno = 0;
4866 const char *__pyx_filename = NULL;
4867 int __pyx_clineno = 0;
4868 PyObject *__pyx_r = 0;
4869 __Pyx_RefNannyDeclarations
4870 __Pyx_RefNannySetupContext(
"gauss_seidel_NR_preare (wrapper)", 0);
4872 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_A,&__pyx_n_s_w,&__pyx_n_s_tol,&__pyx_n_s_M,0};
4873 PyObject* values[4] = {0,0,0,0};
4874 if (unlikely(__pyx_kwds)) {
4876 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
4878 case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
4880 case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
4882 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
4884 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
4887 default:
goto __pyx_L5_argtuple_error;
4889 kw_args = PyDict_Size(__pyx_kwds);
4892 if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_A)) != 0)) kw_args--;
4893 else goto __pyx_L5_argtuple_error;
4896 if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_w)) != 0)) kw_args--;
4898 __Pyx_RaiseArgtupleInvalid(
"gauss_seidel_NR_preare", 1, 4, 4, 1); __PYX_ERR(0, 165, __pyx_L3_error)
4902 if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_tol)) != 0)) kw_args--;
4904 __Pyx_RaiseArgtupleInvalid(
"gauss_seidel_NR_preare", 1, 4, 4, 2); __PYX_ERR(0, 165, __pyx_L3_error)
4908 if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_M)) != 0)) kw_args--;
4910 __Pyx_RaiseArgtupleInvalid(
"gauss_seidel_NR_preare", 1, 4, 4, 3); __PYX_ERR(0, 165, __pyx_L3_error)
4913 if (unlikely(kw_args > 0)) {
4914 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args,
"gauss_seidel_NR_preare") < 0)) __PYX_ERR(0, 165, __pyx_L3_error)
4916 }
else if (PyTuple_GET_SIZE(__pyx_args) != 4) {
4917 goto __pyx_L5_argtuple_error;
4919 values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
4920 values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
4921 values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
4922 values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
4924 __pyx_v_A = values[0];
4925 __pyx_v_w = values[1];
4926 __pyx_v_tol = values[2];
4927 __pyx_v_M = values[3];
4929 goto __pyx_L4_argument_unpacking_done;
4930 __pyx_L5_argtuple_error:;
4931 __Pyx_RaiseArgtupleInvalid(
"gauss_seidel_NR_preare", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 165, __pyx_L3_error)
4933 __Pyx_AddTraceback(
"csmoothers.gauss_seidel_NR_preare", __pyx_clineno, __pyx_lineno, __pyx_filename);
4934 __Pyx_RefNannyFinishContext();
4936 __pyx_L4_argument_unpacking_done:;
4937 __pyx_r = __pyx_pf_10csmoothers_6gauss_seidel_NR_preare(__pyx_self, __pyx_v_A, __pyx_v_w, __pyx_v_tol, __pyx_v_M);
4940 __Pyx_RefNannyFinishContext();
4944 static PyObject *__pyx_pf_10csmoothers_6gauss_seidel_NR_preare(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_A, PyObject *__pyx_v_w, PyObject *__pyx_v_tol, PyObject *__pyx_v_M) {
4945 PyObject *__pyx_r = NULL;
4946 __Pyx_RefNannyDeclarations
4947 PyObject *__pyx_t_1 = NULL;
4950 __pyx_t_10csmoothers_DDATA __pyx_t_4 = { 0, 0, { 0 }, { 0 }, { 0 } };
4951 int __pyx_lineno = 0;
4952 const char *__pyx_filename = NULL;
4953 int __pyx_clineno = 0;
4954 __Pyx_RefNannySetupContext(
"gauss_seidel_NR_preare", 0);
4963 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_A, __pyx_n_s_cSparseMatrix);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 175, __pyx_L1_error)
4964 __Pyx_GOTREF(__pyx_t_1);
4965 if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_7proteus_15superluWrappers_cSparseMatrix))))) __PYX_ERR(0, 175, __pyx_L1_error)
4966 __pyx_t_2 = __pyx_PyFloat_AsDouble(__pyx_v_w);
if (unlikely((__pyx_t_2 == (
double)-1) && PyErr_Occurred())) __PYX_ERR(0, 175, __pyx_L1_error)
4967 __pyx_t_3 = __pyx_PyFloat_AsDouble(__pyx_v_tol);
if (unlikely((__pyx_t_3 == (
double)-1) && PyErr_Occurred())) __PYX_ERR(0, 175, __pyx_L1_error)
4968 __pyx_t_4 = __Pyx_PyObject_to_MemoryviewSlice_ds_double(__pyx_v_M, PyBUF_WRITABLE);
if (unlikely(!__pyx_t_4.memview)) __PYX_ERR(0, 175, __pyx_L1_error)
4969 __pyx_f_10csmoothers_smootherWrappersgauss_seidel_NR_prepare(((
struct __pyx_obj_7proteus_15superluWrappers_cSparseMatrix *)__pyx_t_1), __pyx_t_2, __pyx_t_3, __pyx_t_4);
4970 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
4971 __PYX_XDEC_MEMVIEW(&__pyx_t_4, 1);
4972 __pyx_t_4.memview = NULL;
4973 __pyx_t_4.data = NULL;
4984 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
4987 __Pyx_XDECREF(__pyx_t_1);
4988 __PYX_XDEC_MEMVIEW(&__pyx_t_4, 1);
4989 __Pyx_AddTraceback(
"csmoothers.gauss_seidel_NR_preare", __pyx_clineno, __pyx_lineno, __pyx_filename);
4992 __Pyx_XGIVEREF(__pyx_r);
4993 __Pyx_RefNannyFinishContext();
5005 static void __pyx_f_10csmoothers_smootherWrappersgauss_seidel_NR_prepare(
struct __pyx_obj_7proteus_15superluWrappers_cSparseMatrix *__pyx_v_sm,
double __pyx_v_w,
double __pyx_v_tol, __pyx_t_10csmoothers_DDATA __pyx_v_M) {
5006 __pyx_t_10csmoothers_SuperMatrix __pyx_v_AS;
5007 __Pyx_RefNannyDeclarations
5008 PyObject *__pyx_t_1 = NULL;
5010 Py_ssize_t __pyx_t_3;
5011 int __pyx_lineno = 0;
5012 const char *__pyx_filename = NULL;
5013 int __pyx_clineno = 0;
5014 __Pyx_RefNannySetupContext(
"smootherWrappersgauss_seidel_NR_prepare", 0);
5023 __pyx_v_AS.Stype = SLU_NR;
5032 __pyx_v_AS.Dtype = SLU_D;
5041 __pyx_v_AS.Mtype = SLU_GE;
5050 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_sm), __pyx_n_s_nr);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 185, __pyx_L1_error)
5051 __Pyx_GOTREF(__pyx_t_1);
5052 __pyx_t_2 = __Pyx_PyInt_As_int(__pyx_t_1);
if (unlikely((__pyx_t_2 == (
int)-1) && PyErr_Occurred())) __PYX_ERR(0, 185, __pyx_L1_error)
5053 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
5054 __pyx_v_AS.nrow = __pyx_t_2;
5063 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_sm), __pyx_n_s_nc);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 186, __pyx_L1_error)
5064 __Pyx_GOTREF(__pyx_t_1);
5065 __pyx_t_2 = __Pyx_PyInt_As_int(__pyx_t_1);
if (unlikely((__pyx_t_2 == (
int)-1) && PyErr_Occurred())) __PYX_ERR(0, 186, __pyx_L1_error)
5066 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
5067 __pyx_v_AS.ncol = __pyx_t_2;
5076 __pyx_v_AS.Store = (&__pyx_v_sm->A);
5087 if (__pyx_t_3 < 0) {
5088 __pyx_t_3 += __pyx_v_M.shape[0];
5089 if (unlikely(__pyx_t_3 < 0)) __pyx_t_2 = 0;
5090 }
else if (unlikely(__pyx_t_3 >= __pyx_v_M.shape[0])) __pyx_t_2 = 0;
5091 if (unlikely(__pyx_t_2 != -1)) {
5092 __Pyx_RaiseBufferIndexError(__pyx_t_2);
5093 __PYX_ERR(0, 188, __pyx_L1_error)
5095 gauss_seidel_NR_prepare((&__pyx_v_AS), __pyx_v_w, __pyx_v_tol, (&(*((
double *) ( (__pyx_v_M.data + __pyx_t_3 * __pyx_v_M.strides[0]) )))));
5108 __Pyx_XDECREF(__pyx_t_1);
5109 __Pyx_WriteUnraisable(
"csmoothers.smootherWrappersgauss_seidel_NR_prepare", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
5111 __Pyx_RefNannyFinishContext();
5123 static PyObject *__pyx_pw_10csmoothers_9gauss_seidel_NR_solve(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
5124 static char __pyx_doc_10csmoothers_8gauss_seidel_NR_solve[] =
"\n\n Arguments\n ---------\n A : superluWrappers.SparseMatrix\n M : np.array double\n R : np.array double\n node_order : np.array int\n dX : np.array double\n ";
5125 static PyMethodDef __pyx_mdef_10csmoothers_9gauss_seidel_NR_solve = {
"gauss_seidel_NR_solve", (PyCFunction)(
void*)(PyCFunctionWithKeywords)__pyx_pw_10csmoothers_9gauss_seidel_NR_solve, METH_VARARGS|METH_KEYWORDS, __pyx_doc_10csmoothers_8gauss_seidel_NR_solve};
5126 static PyObject *__pyx_pw_10csmoothers_9gauss_seidel_NR_solve(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
5127 PyObject *__pyx_v_A = 0;
5128 PyObject *__pyx_v_M = 0;
5129 PyObject *__pyx_v_R = 0;
5130 PyObject *__pyx_v_node_order = 0;
5131 PyObject *__pyx_v_dX = 0;
5132 int __pyx_lineno = 0;
5133 const char *__pyx_filename = NULL;
5134 int __pyx_clineno = 0;
5135 PyObject *__pyx_r = 0;
5136 __Pyx_RefNannyDeclarations
5137 __Pyx_RefNannySetupContext(
"gauss_seidel_NR_solve (wrapper)", 0);
5139 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_A,&__pyx_n_s_M,&__pyx_n_s_R,&__pyx_n_s_node_order,&__pyx_n_s_dX,0};
5140 PyObject* values[5] = {0,0,0,0,0};
5141 if (unlikely(__pyx_kwds)) {
5143 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
5145 case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
5147 case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
5149 case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
5151 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
5153 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
5156 default:
goto __pyx_L5_argtuple_error;
5158 kw_args = PyDict_Size(__pyx_kwds);
5161 if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_A)) != 0)) kw_args--;
5162 else goto __pyx_L5_argtuple_error;
5165 if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_M)) != 0)) kw_args--;
5167 __Pyx_RaiseArgtupleInvalid(
"gauss_seidel_NR_solve", 1, 5, 5, 1); __PYX_ERR(0, 190, __pyx_L3_error)
5171 if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_R)) != 0)) kw_args--;
5173 __Pyx_RaiseArgtupleInvalid(
"gauss_seidel_NR_solve", 1, 5, 5, 2); __PYX_ERR(0, 190, __pyx_L3_error)
5177 if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_node_order)) != 0)) kw_args--;
5179 __Pyx_RaiseArgtupleInvalid(
"gauss_seidel_NR_solve", 1, 5, 5, 3); __PYX_ERR(0, 190, __pyx_L3_error)
5183 if (likely((values[4] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_dX)) != 0)) kw_args--;
5185 __Pyx_RaiseArgtupleInvalid(
"gauss_seidel_NR_solve", 1, 5, 5, 4); __PYX_ERR(0, 190, __pyx_L3_error)
5188 if (unlikely(kw_args > 0)) {
5189 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args,
"gauss_seidel_NR_solve") < 0)) __PYX_ERR(0, 190, __pyx_L3_error)
5191 }
else if (PyTuple_GET_SIZE(__pyx_args) != 5) {
5192 goto __pyx_L5_argtuple_error;
5194 values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
5195 values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
5196 values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
5197 values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
5198 values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
5200 __pyx_v_A = values[0];
5201 __pyx_v_M = values[1];
5202 __pyx_v_R = values[2];
5203 __pyx_v_node_order = values[3];
5204 __pyx_v_dX = values[4];
5206 goto __pyx_L4_argument_unpacking_done;
5207 __pyx_L5_argtuple_error:;
5208 __Pyx_RaiseArgtupleInvalid(
"gauss_seidel_NR_solve", 1, 5, 5, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 190, __pyx_L3_error)
5210 __Pyx_AddTraceback(
"csmoothers.gauss_seidel_NR_solve", __pyx_clineno, __pyx_lineno, __pyx_filename);
5211 __Pyx_RefNannyFinishContext();
5213 __pyx_L4_argument_unpacking_done:;
5214 __pyx_r = __pyx_pf_10csmoothers_8gauss_seidel_NR_solve(__pyx_self, __pyx_v_A, __pyx_v_M, __pyx_v_R, __pyx_v_node_order, __pyx_v_dX);
5217 __Pyx_RefNannyFinishContext();
5221 static PyObject *__pyx_pf_10csmoothers_8gauss_seidel_NR_solve(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_A, PyObject *__pyx_v_M, PyObject *__pyx_v_R, PyObject *__pyx_v_node_order, PyObject *__pyx_v_dX) {
5222 PyObject *__pyx_r = NULL;
5223 __Pyx_RefNannyDeclarations
5224 PyObject *__pyx_t_1 = NULL;
5225 __pyx_t_10csmoothers_DDATA __pyx_t_2 = { 0, 0, { 0 }, { 0 }, { 0 } };
5226 __pyx_t_10csmoothers_DDATA __pyx_t_3 = { 0, 0, { 0 }, { 0 }, { 0 } };
5227 __pyx_t_10csmoothers_IDATA __pyx_t_4 = { 0, 0, { 0 }, { 0 }, { 0 } };
5228 __pyx_t_10csmoothers_DDATA __pyx_t_5 = { 0, 0, { 0 }, { 0 }, { 0 } };
5229 int __pyx_lineno = 0;
5230 const char *__pyx_filename = NULL;
5231 int __pyx_clineno = 0;
5232 __Pyx_RefNannySetupContext(
"gauss_seidel_NR_solve", 0);
5241 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_A, __pyx_n_s_cSparseMatrix);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 201, __pyx_L1_error)
5242 __Pyx_GOTREF(__pyx_t_1);
5243 if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_7proteus_15superluWrappers_cSparseMatrix))))) __PYX_ERR(0, 201, __pyx_L1_error)
5244 __pyx_t_2 = __Pyx_PyObject_to_MemoryviewSlice_ds_double(__pyx_v_M, PyBUF_WRITABLE);
if (unlikely(!__pyx_t_2.memview)) __PYX_ERR(0, 201, __pyx_L1_error)
5245 __pyx_t_3 = __Pyx_PyObject_to_MemoryviewSlice_ds_double(__pyx_v_R, PyBUF_WRITABLE);
if (unlikely(!__pyx_t_3.memview)) __PYX_ERR(0, 201, __pyx_L1_error)
5246 __pyx_t_4 = __Pyx_PyObject_to_MemoryviewSlice_ds_int(__pyx_v_node_order, PyBUF_WRITABLE);
if (unlikely(!__pyx_t_4.memview)) __PYX_ERR(0, 201, __pyx_L1_error)
5247 __pyx_t_5 = __Pyx_PyObject_to_MemoryviewSlice_ds_double(__pyx_v_dX, PyBUF_WRITABLE);
if (unlikely(!__pyx_t_5.memview)) __PYX_ERR(0, 201, __pyx_L1_error)
5248 __pyx_f_10csmoothers_smootherWrappersgauss_seidel_NR_solve(((
struct __pyx_obj_7proteus_15superluWrappers_cSparseMatrix *)__pyx_t_1), __pyx_t_2, __pyx_t_3, __pyx_t_4, __pyx_t_5);
5249 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
5250 __PYX_XDEC_MEMVIEW(&__pyx_t_2, 1);
5251 __pyx_t_2.memview = NULL;
5252 __pyx_t_2.data = NULL;
5253 __PYX_XDEC_MEMVIEW(&__pyx_t_3, 1);
5254 __pyx_t_3.memview = NULL;
5255 __pyx_t_3.data = NULL;
5256 __PYX_XDEC_MEMVIEW(&__pyx_t_4, 1);
5257 __pyx_t_4.memview = NULL;
5258 __pyx_t_4.data = NULL;
5259 __PYX_XDEC_MEMVIEW(&__pyx_t_5, 1);
5260 __pyx_t_5.memview = NULL;
5261 __pyx_t_5.data = NULL;
5272 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
5275 __Pyx_XDECREF(__pyx_t_1);
5276 __PYX_XDEC_MEMVIEW(&__pyx_t_2, 1);
5277 __PYX_XDEC_MEMVIEW(&__pyx_t_3, 1);
5278 __PYX_XDEC_MEMVIEW(&__pyx_t_4, 1);
5279 __PYX_XDEC_MEMVIEW(&__pyx_t_5, 1);
5280 __Pyx_AddTraceback(
"csmoothers.gauss_seidel_NR_solve", __pyx_clineno, __pyx_lineno, __pyx_filename);
5283 __Pyx_XGIVEREF(__pyx_r);
5284 __Pyx_RefNannyFinishContext();
5296 static void __pyx_f_10csmoothers_smootherWrappersgauss_seidel_NR_solve(
struct __pyx_obj_7proteus_15superluWrappers_cSparseMatrix *__pyx_v_sm, __pyx_t_10csmoothers_DDATA __pyx_v_M, __pyx_t_10csmoothers_DDATA __pyx_v_R, __pyx_t_10csmoothers_IDATA __pyx_v_node_order, __pyx_t_10csmoothers_DDATA __pyx_v_dX) {
5297 __pyx_t_10csmoothers_SuperMatrix __pyx_v_AS;
5298 __Pyx_RefNannyDeclarations
5299 PyObject *__pyx_t_1 = NULL;
5301 Py_ssize_t __pyx_t_3;
5302 Py_ssize_t __pyx_t_4;
5303 Py_ssize_t __pyx_t_5;
5304 Py_ssize_t __pyx_t_6;
5305 int __pyx_lineno = 0;
5306 const char *__pyx_filename = NULL;
5307 int __pyx_clineno = 0;
5308 __Pyx_RefNannySetupContext(
"smootherWrappersgauss_seidel_NR_solve", 0);
5317 __pyx_v_AS.Stype = SLU_NR;
5326 __pyx_v_AS.Dtype = SLU_D;
5335 __pyx_v_AS.Mtype = SLU_GE;
5344 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_sm), __pyx_n_s_nr);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 212, __pyx_L1_error)
5345 __Pyx_GOTREF(__pyx_t_1);
5346 __pyx_t_2 = __Pyx_PyInt_As_int(__pyx_t_1);
if (unlikely((__pyx_t_2 == (
int)-1) && PyErr_Occurred())) __PYX_ERR(0, 212, __pyx_L1_error)
5347 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
5348 __pyx_v_AS.nrow = __pyx_t_2;
5357 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_sm), __pyx_n_s_nc);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 213, __pyx_L1_error)
5358 __Pyx_GOTREF(__pyx_t_1);
5359 __pyx_t_2 = __Pyx_PyInt_As_int(__pyx_t_1);
if (unlikely((__pyx_t_2 == (
int)-1) && PyErr_Occurred())) __PYX_ERR(0, 213, __pyx_L1_error)
5360 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
5361 __pyx_v_AS.ncol = __pyx_t_2;
5370 __pyx_v_AS.Store = (&__pyx_v_sm->A);
5381 if (__pyx_t_3 < 0) {
5382 __pyx_t_3 += __pyx_v_M.shape[0];
5383 if (unlikely(__pyx_t_3 < 0)) __pyx_t_2 = 0;
5384 }
else if (unlikely(__pyx_t_3 >= __pyx_v_M.shape[0])) __pyx_t_2 = 0;
5385 if (unlikely(__pyx_t_2 != -1)) {
5386 __Pyx_RaiseBufferIndexError(__pyx_t_2);
5387 __PYX_ERR(0, 215, __pyx_L1_error)
5391 if (__pyx_t_4 < 0) {
5392 __pyx_t_4 += __pyx_v_R.shape[0];
5393 if (unlikely(__pyx_t_4 < 0)) __pyx_t_2 = 0;
5394 }
else if (unlikely(__pyx_t_4 >= __pyx_v_R.shape[0])) __pyx_t_2 = 0;
5395 if (unlikely(__pyx_t_2 != -1)) {
5396 __Pyx_RaiseBufferIndexError(__pyx_t_2);
5397 __PYX_ERR(0, 215, __pyx_L1_error)
5401 if (__pyx_t_5 < 0) {
5402 __pyx_t_5 += __pyx_v_node_order.shape[0];
5403 if (unlikely(__pyx_t_5 < 0)) __pyx_t_2 = 0;
5404 }
else if (unlikely(__pyx_t_5 >= __pyx_v_node_order.shape[0])) __pyx_t_2 = 0;
5405 if (unlikely(__pyx_t_2 != -1)) {
5406 __Pyx_RaiseBufferIndexError(__pyx_t_2);
5407 __PYX_ERR(0, 215, __pyx_L1_error)
5411 if (__pyx_t_6 < 0) {
5412 __pyx_t_6 += __pyx_v_dX.shape[0];
5413 if (unlikely(__pyx_t_6 < 0)) __pyx_t_2 = 0;
5414 }
else if (unlikely(__pyx_t_6 >= __pyx_v_dX.shape[0])) __pyx_t_2 = 0;
5415 if (unlikely(__pyx_t_2 != -1)) {
5416 __Pyx_RaiseBufferIndexError(__pyx_t_2);
5417 __PYX_ERR(0, 215, __pyx_L1_error)
5419 gauss_seidel_NR_solve((&__pyx_v_AS), (&(*((
double *) ( (__pyx_v_M.data + __pyx_t_3 * __pyx_v_M.strides[0]) )))), (&(*((
double *) ( (__pyx_v_R.data + __pyx_t_4 * __pyx_v_R.strides[0]) )))), (&(*((
int *) ( (__pyx_v_node_order.data + __pyx_t_5 * __pyx_v_node_order.strides[0]) )))), (&(*((
double *) ( (__pyx_v_dX.data + __pyx_t_6 * __pyx_v_dX.strides[0]) )))));
5432 __Pyx_XDECREF(__pyx_t_1);
5433 __Pyx_WriteUnraisable(
"csmoothers.smootherWrappersgauss_seidel_NR_solve", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
5435 __Pyx_RefNannyFinishContext();
5447 static PyObject *__pyx_pw_10csmoothers_11nl_gauss_seidel_NR_solve(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
5448 static char __pyx_doc_10csmoothers_10nl_gauss_seidel_NR_solve[] =
"\n \n Arguments\n ---------\n A : superluWrappers.SparseMatrix\n R : np.array double\n node_order : np.array int\n w : double\n tol : double\n dX : np.array double\n ";
5449 static PyMethodDef __pyx_mdef_10csmoothers_11nl_gauss_seidel_NR_solve = {
"nl_gauss_seidel_NR_solve", (PyCFunction)(
void*)(PyCFunctionWithKeywords)__pyx_pw_10csmoothers_11nl_gauss_seidel_NR_solve, METH_VARARGS|METH_KEYWORDS, __pyx_doc_10csmoothers_10nl_gauss_seidel_NR_solve};
5450 static PyObject *__pyx_pw_10csmoothers_11nl_gauss_seidel_NR_solve(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
5451 PyObject *__pyx_v_A = 0;
5452 PyObject *__pyx_v_R = 0;
5453 PyObject *__pyx_v_node_order = 0;
5454 PyObject *__pyx_v_w = 0;
5455 PyObject *__pyx_v_tol = 0;
5456 PyObject *__pyx_v_dX = 0;
5457 int __pyx_lineno = 0;
5458 const char *__pyx_filename = NULL;
5459 int __pyx_clineno = 0;
5460 PyObject *__pyx_r = 0;
5461 __Pyx_RefNannyDeclarations
5462 __Pyx_RefNannySetupContext(
"nl_gauss_seidel_NR_solve (wrapper)", 0);
5464 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_A,&__pyx_n_s_R,&__pyx_n_s_node_order,&__pyx_n_s_w,&__pyx_n_s_tol,&__pyx_n_s_dX,0};
5465 PyObject* values[6] = {0,0,0,0,0,0};
5466 if (unlikely(__pyx_kwds)) {
5468 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
5470 case 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
5472 case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
5474 case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
5476 case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
5478 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
5480 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
5483 default:
goto __pyx_L5_argtuple_error;
5485 kw_args = PyDict_Size(__pyx_kwds);
5488 if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_A)) != 0)) kw_args--;
5489 else goto __pyx_L5_argtuple_error;
5492 if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_R)) != 0)) kw_args--;
5494 __Pyx_RaiseArgtupleInvalid(
"nl_gauss_seidel_NR_solve", 1, 6, 6, 1); __PYX_ERR(0, 217, __pyx_L3_error)
5498 if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_node_order)) != 0)) kw_args--;
5500 __Pyx_RaiseArgtupleInvalid(
"nl_gauss_seidel_NR_solve", 1, 6, 6, 2); __PYX_ERR(0, 217, __pyx_L3_error)
5504 if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_w)) != 0)) kw_args--;
5506 __Pyx_RaiseArgtupleInvalid(
"nl_gauss_seidel_NR_solve", 1, 6, 6, 3); __PYX_ERR(0, 217, __pyx_L3_error)
5510 if (likely((values[4] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_tol)) != 0)) kw_args--;
5512 __Pyx_RaiseArgtupleInvalid(
"nl_gauss_seidel_NR_solve", 1, 6, 6, 4); __PYX_ERR(0, 217, __pyx_L3_error)
5516 if (likely((values[5] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_dX)) != 0)) kw_args--;
5518 __Pyx_RaiseArgtupleInvalid(
"nl_gauss_seidel_NR_solve", 1, 6, 6, 5); __PYX_ERR(0, 217, __pyx_L3_error)
5521 if (unlikely(kw_args > 0)) {
5522 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args,
"nl_gauss_seidel_NR_solve") < 0)) __PYX_ERR(0, 217, __pyx_L3_error)
5524 }
else if (PyTuple_GET_SIZE(__pyx_args) != 6) {
5525 goto __pyx_L5_argtuple_error;
5527 values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
5528 values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
5529 values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
5530 values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
5531 values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
5532 values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
5534 __pyx_v_A = values[0];
5535 __pyx_v_R = values[1];
5536 __pyx_v_node_order = values[2];
5537 __pyx_v_w = values[3];
5538 __pyx_v_tol = values[4];
5539 __pyx_v_dX = values[5];
5541 goto __pyx_L4_argument_unpacking_done;
5542 __pyx_L5_argtuple_error:;
5543 __Pyx_RaiseArgtupleInvalid(
"nl_gauss_seidel_NR_solve", 1, 6, 6, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 217, __pyx_L3_error)
5545 __Pyx_AddTraceback(
"csmoothers.nl_gauss_seidel_NR_solve", __pyx_clineno, __pyx_lineno, __pyx_filename);
5546 __Pyx_RefNannyFinishContext();
5548 __pyx_L4_argument_unpacking_done:;
5549 __pyx_r = __pyx_pf_10csmoothers_10nl_gauss_seidel_NR_solve(__pyx_self, __pyx_v_A, __pyx_v_R, __pyx_v_node_order, __pyx_v_w, __pyx_v_tol, __pyx_v_dX);
5552 __Pyx_RefNannyFinishContext();
5556 static PyObject *__pyx_pf_10csmoothers_10nl_gauss_seidel_NR_solve(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_A, PyObject *__pyx_v_R, PyObject *__pyx_v_node_order, PyObject *__pyx_v_w, PyObject *__pyx_v_tol, PyObject *__pyx_v_dX) {
5557 PyObject *__pyx_r = NULL;
5558 __Pyx_RefNannyDeclarations
5559 PyObject *__pyx_t_1 = NULL;
5560 __pyx_t_10csmoothers_DDATA __pyx_t_2 = { 0, 0, { 0 }, { 0 }, { 0 } };
5561 __pyx_t_10csmoothers_IDATA __pyx_t_3 = { 0, 0, { 0 }, { 0 }, { 0 } };
5564 __pyx_t_10csmoothers_DDATA __pyx_t_6 = { 0, 0, { 0 }, { 0 }, { 0 } };
5565 PyObject *__pyx_t_7 = NULL;
5566 int __pyx_lineno = 0;
5567 const char *__pyx_filename = NULL;
5568 int __pyx_clineno = 0;
5569 __Pyx_RefNannySetupContext(
"nl_gauss_seidel_NR_solve", 0);
5578 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_A, __pyx_n_s_cSparseMatrix);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 229, __pyx_L1_error)
5579 __Pyx_GOTREF(__pyx_t_1);
5580 if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_7proteus_15superluWrappers_cSparseMatrix))))) __PYX_ERR(0, 229, __pyx_L1_error)
5589 __pyx_t_2 = __Pyx_PyObject_to_MemoryviewSlice_ds_double(__pyx_v_R, PyBUF_WRITABLE);
if (unlikely(!__pyx_t_2.memview)) __PYX_ERR(0, 230, __pyx_L1_error)
5598 __pyx_t_3 = __Pyx_PyObject_to_MemoryviewSlice_ds_int(__pyx_v_node_order, PyBUF_WRITABLE);
if (unlikely(!__pyx_t_3.memview)) __PYX_ERR(0, 231, __pyx_L1_error)
5607 __pyx_t_4 = __pyx_PyFloat_AsDouble(__pyx_v_w);
if (unlikely((__pyx_t_4 == (
double)-1) && PyErr_Occurred())) __PYX_ERR(0, 232, __pyx_L1_error)
5616 __pyx_t_5 = __pyx_PyFloat_AsDouble(__pyx_v_tol);
if (unlikely((__pyx_t_5 == (
double)-1) && PyErr_Occurred())) __PYX_ERR(0, 233, __pyx_L1_error)
5625 __pyx_t_6 = __Pyx_PyObject_to_MemoryviewSlice_ds_double(__pyx_v_dX, PyBUF_WRITABLE);
if (unlikely(!__pyx_t_6.memview)) __PYX_ERR(0, 234, __pyx_L1_error)
5634 __pyx_t_7 = __pyx_f_10csmoothers_smootherWrappers_nl_gauss_seidel_NR_solve(((
struct __pyx_obj_7proteus_15superluWrappers_cSparseMatrix *)__pyx_t_1), __pyx_t_2, __pyx_t_3, __pyx_t_4, __pyx_t_5, __pyx_t_6);
if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 229, __pyx_L1_error)
5635 __Pyx_GOTREF(__pyx_t_7);
5636 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
5637 __PYX_XDEC_MEMVIEW(&__pyx_t_2, 1);
5638 __pyx_t_2.memview = NULL;
5639 __pyx_t_2.data = NULL;
5640 __PYX_XDEC_MEMVIEW(&__pyx_t_3, 1);
5641 __pyx_t_3.memview = NULL;
5642 __pyx_t_3.data = NULL;
5643 __PYX_XDEC_MEMVIEW(&__pyx_t_6, 1);
5644 __pyx_t_6.memview = NULL;
5645 __pyx_t_6.data = NULL;
5646 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
5657 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
5660 __Pyx_XDECREF(__pyx_t_1);
5661 __PYX_XDEC_MEMVIEW(&__pyx_t_2, 1);
5662 __PYX_XDEC_MEMVIEW(&__pyx_t_3, 1);
5663 __PYX_XDEC_MEMVIEW(&__pyx_t_6, 1);
5664 __Pyx_XDECREF(__pyx_t_7);
5665 __Pyx_AddTraceback(
"csmoothers.nl_gauss_seidel_NR_solve", __pyx_clineno, __pyx_lineno, __pyx_filename);
5668 __Pyx_XGIVEREF(__pyx_r);
5669 __Pyx_RefNannyFinishContext();
5681 static PyObject *__pyx_f_10csmoothers_smootherWrappers_nl_gauss_seidel_NR_solve(
struct __pyx_obj_7proteus_15superluWrappers_cSparseMatrix *__pyx_v_sm, __pyx_t_10csmoothers_DDATA __pyx_v_R, __pyx_t_10csmoothers_IDATA __pyx_v_node_order,
double __pyx_v_w,
double __pyx_v_tol, __pyx_t_10csmoothers_DDATA __pyx_v_dX) {
5682 __pyx_t_10csmoothers_SuperMatrix __pyx_v_AS;
5683 PyObject *__pyx_r = NULL;
5684 __Pyx_RefNannyDeclarations
5685 PyObject *__pyx_t_1 = NULL;
5687 Py_ssize_t __pyx_t_3;
5688 Py_ssize_t __pyx_t_4;
5689 Py_ssize_t __pyx_t_5;
5690 int __pyx_lineno = 0;
5691 const char *__pyx_filename = NULL;
5692 int __pyx_clineno = 0;
5693 __Pyx_RefNannySetupContext(
"smootherWrappers_nl_gauss_seidel_NR_solve", 0);
5702 __pyx_v_AS.Stype = SLU_NR;
5711 __pyx_v_AS.Dtype = SLU_D;
5720 __pyx_v_AS.Mtype = SLU_GE;
5729 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_sm), __pyx_n_s_nr);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 246, __pyx_L1_error)
5730 __Pyx_GOTREF(__pyx_t_1);
5731 __pyx_t_2 = __Pyx_PyInt_As_int(__pyx_t_1);
if (unlikely((__pyx_t_2 == (
int)-1) && PyErr_Occurred())) __PYX_ERR(0, 246, __pyx_L1_error)
5732 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
5733 __pyx_v_AS.nrow = __pyx_t_2;
5742 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_sm), __pyx_n_s_nc);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 247, __pyx_L1_error)
5743 __Pyx_GOTREF(__pyx_t_1);
5744 __pyx_t_2 = __Pyx_PyInt_As_int(__pyx_t_1);
if (unlikely((__pyx_t_2 == (
int)-1) && PyErr_Occurred())) __PYX_ERR(0, 247, __pyx_L1_error)
5745 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
5746 __pyx_v_AS.ncol = __pyx_t_2;
5755 __pyx_v_AS.Store = (&__pyx_v_sm->A);
5766 if (__pyx_t_3 < 0) {
5767 __pyx_t_3 += __pyx_v_R.shape[0];
5768 if (unlikely(__pyx_t_3 < 0)) __pyx_t_2 = 0;
5769 }
else if (unlikely(__pyx_t_3 >= __pyx_v_R.shape[0])) __pyx_t_2 = 0;
5770 if (unlikely(__pyx_t_2 != -1)) {
5771 __Pyx_RaiseBufferIndexError(__pyx_t_2);
5772 __PYX_ERR(0, 249, __pyx_L1_error)
5776 if (__pyx_t_4 < 0) {
5777 __pyx_t_4 += __pyx_v_node_order.shape[0];
5778 if (unlikely(__pyx_t_4 < 0)) __pyx_t_2 = 0;
5779 }
else if (unlikely(__pyx_t_4 >= __pyx_v_node_order.shape[0])) __pyx_t_2 = 0;
5780 if (unlikely(__pyx_t_2 != -1)) {
5781 __Pyx_RaiseBufferIndexError(__pyx_t_2);
5782 __PYX_ERR(0, 249, __pyx_L1_error)
5786 if (__pyx_t_5 < 0) {
5787 __pyx_t_5 += __pyx_v_dX.shape[0];
5788 if (unlikely(__pyx_t_5 < 0)) __pyx_t_2 = 0;
5789 }
else if (unlikely(__pyx_t_5 >= __pyx_v_dX.shape[0])) __pyx_t_2 = 0;
5790 if (unlikely(__pyx_t_2 != -1)) {
5791 __Pyx_RaiseBufferIndexError(__pyx_t_2);
5792 __PYX_ERR(0, 249, __pyx_L1_error)
5794 nl_gauss_seidel_NR_solve((&__pyx_v_AS), (&(*((
double *) ( (__pyx_v_R.data + __pyx_t_3 * __pyx_v_R.strides[0]) )))), (&(*((
int *) ( (__pyx_v_node_order.data + __pyx_t_4 * __pyx_v_node_order.strides[0]) )))), __pyx_v_w, __pyx_v_tol, (&(*((
double *) ( (__pyx_v_dX.data + __pyx_t_5 * __pyx_v_dX.strides[0]) )))));
5805 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
5808 __Pyx_XDECREF(__pyx_t_1);
5809 __Pyx_AddTraceback(
"csmoothers.smootherWrappers_nl_gauss_seidel_NR_solve", __pyx_clineno, __pyx_lineno, __pyx_filename);
5812 __Pyx_XGIVEREF(__pyx_r);
5813 __Pyx_RefNannyFinishContext();
5826 static PyObject *__pyx_pw_10csmoothers_13asm_NR_prepare(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
5827 static char __pyx_doc_10csmoothers_12asm_NR_prepare[] =
"\n\n Arguments\n ---------\n A :\n asmFactor :\n ";
5828 static PyMethodDef __pyx_mdef_10csmoothers_13asm_NR_prepare = {
"asm_NR_prepare", (PyCFunction)(
void*)(PyCFunctionWithKeywords)__pyx_pw_10csmoothers_13asm_NR_prepare, METH_VARARGS|METH_KEYWORDS, __pyx_doc_10csmoothers_12asm_NR_prepare};
5829 static PyObject *__pyx_pw_10csmoothers_13asm_NR_prepare(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
5830 PyObject *__pyx_v_A = 0;
5831 PyObject *__pyx_v_asmFactor = 0;
5832 int __pyx_lineno = 0;
5833 const char *__pyx_filename = NULL;
5834 int __pyx_clineno = 0;
5835 PyObject *__pyx_r = 0;
5836 __Pyx_RefNannyDeclarations
5837 __Pyx_RefNannySetupContext(
"asm_NR_prepare (wrapper)", 0);
5839 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_A,&__pyx_n_s_asmFactor,0};
5840 PyObject* values[2] = {0,0};
5841 if (unlikely(__pyx_kwds)) {
5843 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
5845 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
5847 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
5850 default:
goto __pyx_L5_argtuple_error;
5852 kw_args = PyDict_Size(__pyx_kwds);
5855 if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_A)) != 0)) kw_args--;
5856 else goto __pyx_L5_argtuple_error;
5859 if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_asmFactor)) != 0)) kw_args--;
5861 __Pyx_RaiseArgtupleInvalid(
"asm_NR_prepare", 1, 2, 2, 1); __PYX_ERR(0, 251, __pyx_L3_error)
5864 if (unlikely(kw_args > 0)) {
5865 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args,
"asm_NR_prepare") < 0)) __PYX_ERR(0, 251, __pyx_L3_error)
5867 }
else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
5868 goto __pyx_L5_argtuple_error;
5870 values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
5871 values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
5873 __pyx_v_A = values[0];
5874 __pyx_v_asmFactor = values[1];
5876 goto __pyx_L4_argument_unpacking_done;
5877 __pyx_L5_argtuple_error:;
5878 __Pyx_RaiseArgtupleInvalid(
"asm_NR_prepare", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 251, __pyx_L3_error)
5880 __Pyx_AddTraceback(
"csmoothers.asm_NR_prepare", __pyx_clineno, __pyx_lineno, __pyx_filename);
5881 __Pyx_RefNannyFinishContext();
5883 __pyx_L4_argument_unpacking_done:;
5884 __pyx_r = __pyx_pf_10csmoothers_12asm_NR_prepare(__pyx_self, __pyx_v_A, __pyx_v_asmFactor);
5887 __Pyx_RefNannyFinishContext();
5891 static PyObject *__pyx_pf_10csmoothers_12asm_NR_prepare(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_A, PyObject *__pyx_v_asmFactor) {
5892 PyObject *__pyx_r = NULL;
5893 __Pyx_RefNannyDeclarations
5894 PyObject *__pyx_t_1 = NULL;
5895 PyObject *__pyx_t_2 = NULL;
5896 int __pyx_lineno = 0;
5897 const char *__pyx_filename = NULL;
5898 int __pyx_clineno = 0;
5899 __Pyx_RefNannySetupContext(
"asm_NR_prepare", 0);
5908 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_A, __pyx_n_s_cSparseMatrix);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 259, __pyx_L1_error)
5909 __Pyx_GOTREF(__pyx_t_1);
5910 if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_7proteus_15superluWrappers_cSparseMatrix))))) __PYX_ERR(0, 259, __pyx_L1_error)
5919 __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_asmFactor, __pyx_n_s_cASMFactor);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 260, __pyx_L1_error)
5920 __Pyx_GOTREF(__pyx_t_2);
5921 if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_10csmoothers_cASMFactor))))) __PYX_ERR(0, 260, __pyx_L1_error)
5930 __pyx_f_10csmoothers_smootherWrappers_asm_NR_prepare(((
struct __pyx_obj_7proteus_15superluWrappers_cSparseMatrix *)__pyx_t_1), ((
struct __pyx_obj_10csmoothers_cASMFactor *)__pyx_t_2));
5931 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
5932 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
5943 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
5946 __Pyx_XDECREF(__pyx_t_1);
5947 __Pyx_XDECREF(__pyx_t_2);
5948 __Pyx_AddTraceback(
"csmoothers.asm_NR_prepare", __pyx_clineno, __pyx_lineno, __pyx_filename);
5951 __Pyx_XGIVEREF(__pyx_r);
5952 __Pyx_RefNannyFinishContext();
5964 static void __pyx_f_10csmoothers_smootherWrappers_asm_NR_prepare(
struct __pyx_obj_7proteus_15superluWrappers_cSparseMatrix *__pyx_v_sm,
struct __pyx_obj_10csmoothers_cASMFactor *__pyx_v_asmFactor) {
5965 __pyx_t_10csmoothers_SuperMatrix __pyx_v_AS;
5966 __Pyx_RefNannyDeclarations
5967 PyObject *__pyx_t_1 = NULL;
5969 int __pyx_lineno = 0;
5970 const char *__pyx_filename = NULL;
5971 int __pyx_clineno = 0;
5972 __Pyx_RefNannySetupContext(
"smootherWrappers_asm_NR_prepare", 0);
5981 __pyx_v_AS.Stype = SLU_NR;
5990 __pyx_v_AS.Dtype = SLU_D;
5999 __pyx_v_AS.Mtype = SLU_GE;
6008 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_sm), __pyx_n_s_nr);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 268, __pyx_L1_error)
6009 __Pyx_GOTREF(__pyx_t_1);
6010 __pyx_t_2 = __Pyx_PyInt_As_int(__pyx_t_1);
if (unlikely((__pyx_t_2 == (
int)-1) && PyErr_Occurred())) __PYX_ERR(0, 268, __pyx_L1_error)
6011 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
6012 __pyx_v_AS.nrow = __pyx_t_2;
6021 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_sm), __pyx_n_s_nc);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 269, __pyx_L1_error)
6022 __Pyx_GOTREF(__pyx_t_1);
6023 __pyx_t_2 = __Pyx_PyInt_As_int(__pyx_t_1);
if (unlikely((__pyx_t_2 == (
int)-1) && PyErr_Occurred())) __PYX_ERR(0, 269, __pyx_L1_error)
6024 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
6025 __pyx_v_AS.ncol = __pyx_t_2;
6034 __pyx_v_AS.Store = (&__pyx_v_sm->A);
6043 asm_NR_prepare((&__pyx_v_AS), __pyx_v_asmFactor->subdomain_dim, __pyx_v_asmFactor->l2g_L, __pyx_v_asmFactor->subdomain_L, __pyx_v_asmFactor->subdomain_pivots);
6056 __Pyx_XDECREF(__pyx_t_1);
6057 __Pyx_WriteUnraisable(
"csmoothers.smootherWrappers_asm_NR_prepare", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
6059 __Pyx_RefNannyFinishContext();
6071 static PyObject *__pyx_pw_10csmoothers_15asm_NR_solve(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
6072 static char __pyx_doc_10csmoothers_14asm_NR_solve[] =
"\n \n Arguments\n ---------\n A : superluWrappers.sparseMatrix\n w : double\n asmFactor : csmoothers.asmFactor\n node_order : np.array int\n R : np.array double\n dX : np.array double\n ";
6073 static PyMethodDef __pyx_mdef_10csmoothers_15asm_NR_solve = {
"asm_NR_solve", (PyCFunction)(
void*)(PyCFunctionWithKeywords)__pyx_pw_10csmoothers_15asm_NR_solve, METH_VARARGS|METH_KEYWORDS, __pyx_doc_10csmoothers_14asm_NR_solve};
6074 static PyObject *__pyx_pw_10csmoothers_15asm_NR_solve(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
6075 PyObject *__pyx_v_A = 0;
6076 PyObject *__pyx_v_w = 0;
6077 PyObject *__pyx_v_asmFactor = 0;
6078 PyObject *__pyx_v_node_order = 0;
6079 PyObject *__pyx_v_R = 0;
6080 PyObject *__pyx_v_dX = 0;
6081 int __pyx_lineno = 0;
6082 const char *__pyx_filename = NULL;
6083 int __pyx_clineno = 0;
6084 PyObject *__pyx_r = 0;
6085 __Pyx_RefNannyDeclarations
6086 __Pyx_RefNannySetupContext(
"asm_NR_solve (wrapper)", 0);
6088 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_A,&__pyx_n_s_w,&__pyx_n_s_asmFactor,&__pyx_n_s_node_order,&__pyx_n_s_R,&__pyx_n_s_dX,0};
6089 PyObject* values[6] = {0,0,0,0,0,0};
6090 if (unlikely(__pyx_kwds)) {
6092 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
6094 case 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
6096 case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
6098 case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
6100 case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
6102 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
6104 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
6107 default:
goto __pyx_L5_argtuple_error;
6109 kw_args = PyDict_Size(__pyx_kwds);
6112 if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_A)) != 0)) kw_args--;
6113 else goto __pyx_L5_argtuple_error;
6116 if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_w)) != 0)) kw_args--;
6118 __Pyx_RaiseArgtupleInvalid(
"asm_NR_solve", 1, 6, 6, 1); __PYX_ERR(0, 277, __pyx_L3_error)
6122 if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_asmFactor)) != 0)) kw_args--;
6124 __Pyx_RaiseArgtupleInvalid(
"asm_NR_solve", 1, 6, 6, 2); __PYX_ERR(0, 277, __pyx_L3_error)
6128 if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_node_order)) != 0)) kw_args--;
6130 __Pyx_RaiseArgtupleInvalid(
"asm_NR_solve", 1, 6, 6, 3); __PYX_ERR(0, 277, __pyx_L3_error)
6134 if (likely((values[4] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_R)) != 0)) kw_args--;
6136 __Pyx_RaiseArgtupleInvalid(
"asm_NR_solve", 1, 6, 6, 4); __PYX_ERR(0, 277, __pyx_L3_error)
6140 if (likely((values[5] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_dX)) != 0)) kw_args--;
6142 __Pyx_RaiseArgtupleInvalid(
"asm_NR_solve", 1, 6, 6, 5); __PYX_ERR(0, 277, __pyx_L3_error)
6145 if (unlikely(kw_args > 0)) {
6146 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args,
"asm_NR_solve") < 0)) __PYX_ERR(0, 277, __pyx_L3_error)
6148 }
else if (PyTuple_GET_SIZE(__pyx_args) != 6) {
6149 goto __pyx_L5_argtuple_error;
6151 values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
6152 values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
6153 values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
6154 values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
6155 values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
6156 values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
6158 __pyx_v_A = values[0];
6159 __pyx_v_w = values[1];
6160 __pyx_v_asmFactor = values[2];
6161 __pyx_v_node_order = values[3];
6162 __pyx_v_R = values[4];
6163 __pyx_v_dX = values[5];
6165 goto __pyx_L4_argument_unpacking_done;
6166 __pyx_L5_argtuple_error:;
6167 __Pyx_RaiseArgtupleInvalid(
"asm_NR_solve", 1, 6, 6, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 277, __pyx_L3_error)
6169 __Pyx_AddTraceback(
"csmoothers.asm_NR_solve", __pyx_clineno, __pyx_lineno, __pyx_filename);
6170 __Pyx_RefNannyFinishContext();
6172 __pyx_L4_argument_unpacking_done:;
6173 __pyx_r = __pyx_pf_10csmoothers_14asm_NR_solve(__pyx_self, __pyx_v_A, __pyx_v_w, __pyx_v_asmFactor, __pyx_v_node_order, __pyx_v_R, __pyx_v_dX);
6176 __Pyx_RefNannyFinishContext();
6180 static PyObject *__pyx_pf_10csmoothers_14asm_NR_solve(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_A, PyObject *__pyx_v_w, PyObject *__pyx_v_asmFactor, PyObject *__pyx_v_node_order, PyObject *__pyx_v_R, PyObject *__pyx_v_dX) {
6181 PyObject *__pyx_r = NULL;
6182 __Pyx_RefNannyDeclarations
6183 PyObject *__pyx_t_1 = NULL;
6185 PyObject *__pyx_t_3 = NULL;
6186 __pyx_t_10csmoothers_IDATA __pyx_t_4 = { 0, 0, { 0 }, { 0 }, { 0 } };
6187 __pyx_t_10csmoothers_DDATA __pyx_t_5 = { 0, 0, { 0 }, { 0 }, { 0 } };
6188 __pyx_t_10csmoothers_DDATA __pyx_t_6 = { 0, 0, { 0 }, { 0 }, { 0 } };
6189 int __pyx_lineno = 0;
6190 const char *__pyx_filename = NULL;
6191 int __pyx_clineno = 0;
6192 __Pyx_RefNannySetupContext(
"asm_NR_solve", 0);
6201 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_A, __pyx_n_s_cSparseMatrix);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 289, __pyx_L1_error)
6202 __Pyx_GOTREF(__pyx_t_1);
6203 if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_7proteus_15superluWrappers_cSparseMatrix))))) __PYX_ERR(0, 289, __pyx_L1_error)
6212 __pyx_t_2 = __pyx_PyFloat_AsDouble(__pyx_v_w);
if (unlikely((__pyx_t_2 == (
double)-1) && PyErr_Occurred())) __PYX_ERR(0, 290, __pyx_L1_error)
6221 __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_asmFactor, __pyx_n_s_cASMFactor);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 291, __pyx_L1_error)
6222 __Pyx_GOTREF(__pyx_t_3);
6223 if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_10csmoothers_cASMFactor))))) __PYX_ERR(0, 291, __pyx_L1_error)
6232 __pyx_t_4 = __Pyx_PyObject_to_MemoryviewSlice_ds_int(__pyx_v_node_order, PyBUF_WRITABLE);
if (unlikely(!__pyx_t_4.memview)) __PYX_ERR(0, 292, __pyx_L1_error)
6241 __pyx_t_5 = __Pyx_PyObject_to_MemoryviewSlice_ds_double(__pyx_v_R, PyBUF_WRITABLE);
if (unlikely(!__pyx_t_5.memview)) __PYX_ERR(0, 293, __pyx_L1_error)
6250 __pyx_t_6 = __Pyx_PyObject_to_MemoryviewSlice_ds_double(__pyx_v_dX, PyBUF_WRITABLE);
if (unlikely(!__pyx_t_6.memview)) __PYX_ERR(0, 294, __pyx_L1_error)
6259 __pyx_f_10csmoothers_smootherWrappers_asm_NR_solve(((
struct __pyx_obj_7proteus_15superluWrappers_cSparseMatrix *)__pyx_t_1), __pyx_t_2, ((
struct __pyx_obj_10csmoothers_cASMFactor *)__pyx_t_3), __pyx_t_4, __pyx_t_5, __pyx_t_6);
6260 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
6261 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
6262 __PYX_XDEC_MEMVIEW(&__pyx_t_4, 1);
6263 __pyx_t_4.memview = NULL;
6264 __pyx_t_4.data = NULL;
6265 __PYX_XDEC_MEMVIEW(&__pyx_t_5, 1);
6266 __pyx_t_5.memview = NULL;
6267 __pyx_t_5.data = NULL;
6268 __PYX_XDEC_MEMVIEW(&__pyx_t_6, 1);
6269 __pyx_t_6.memview = NULL;
6270 __pyx_t_6.data = NULL;
6281 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
6284 __Pyx_XDECREF(__pyx_t_1);
6285 __Pyx_XDECREF(__pyx_t_3);
6286 __PYX_XDEC_MEMVIEW(&__pyx_t_4, 1);
6287 __PYX_XDEC_MEMVIEW(&__pyx_t_5, 1);
6288 __PYX_XDEC_MEMVIEW(&__pyx_t_6, 1);
6289 __Pyx_AddTraceback(
"csmoothers.asm_NR_solve", __pyx_clineno, __pyx_lineno, __pyx_filename);
6292 __Pyx_XGIVEREF(__pyx_r);
6293 __Pyx_RefNannyFinishContext();
6305 static void __pyx_f_10csmoothers_smootherWrappers_asm_NR_solve(
struct __pyx_obj_7proteus_15superluWrappers_cSparseMatrix *__pyx_v_sm,
double __pyx_v_w,
struct __pyx_obj_10csmoothers_cASMFactor *__pyx_v_asmFactor, __pyx_t_10csmoothers_IDATA __pyx_v_node_order, __pyx_t_10csmoothers_DDATA __pyx_v_R, __pyx_t_10csmoothers_DDATA __pyx_v_dX) {
6306 __pyx_t_10csmoothers_SuperMatrix __pyx_v_AS;
6307 __Pyx_RefNannyDeclarations
6308 PyObject *__pyx_t_1 = NULL;
6310 Py_ssize_t __pyx_t_3;
6311 Py_ssize_t __pyx_t_4;
6312 Py_ssize_t __pyx_t_5;
6313 int __pyx_lineno = 0;
6314 const char *__pyx_filename = NULL;
6315 int __pyx_clineno = 0;
6316 __Pyx_RefNannySetupContext(
"smootherWrappers_asm_NR_solve", 0);
6325 __pyx_v_AS.Stype = SLU_NR;
6334 __pyx_v_AS.Dtype = SLU_D;
6343 __pyx_v_AS.Mtype = SLU_GE;
6352 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_sm), __pyx_n_s_nr);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 306, __pyx_L1_error)
6353 __Pyx_GOTREF(__pyx_t_1);
6354 __pyx_t_2 = __Pyx_PyInt_As_int(__pyx_t_1);
if (unlikely((__pyx_t_2 == (
int)-1) && PyErr_Occurred())) __PYX_ERR(0, 306, __pyx_L1_error)
6355 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
6356 __pyx_v_AS.nrow = __pyx_t_2;
6365 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_sm), __pyx_n_s_nc);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 307, __pyx_L1_error)
6366 __Pyx_GOTREF(__pyx_t_1);
6367 __pyx_t_2 = __Pyx_PyInt_As_int(__pyx_t_1);
if (unlikely((__pyx_t_2 == (
int)-1) && PyErr_Occurred())) __PYX_ERR(0, 307, __pyx_L1_error)
6368 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
6369 __pyx_v_AS.ncol = __pyx_t_2;
6378 __pyx_v_AS.Store = (&__pyx_v_sm->A);
6389 if (__pyx_t_3 < 0) {
6390 __pyx_t_3 += __pyx_v_R.shape[0];
6391 if (unlikely(__pyx_t_3 < 0)) __pyx_t_2 = 0;
6392 }
else if (unlikely(__pyx_t_3 >= __pyx_v_R.shape[0])) __pyx_t_2 = 0;
6393 if (unlikely(__pyx_t_2 != -1)) {
6394 __Pyx_RaiseBufferIndexError(__pyx_t_2);
6395 __PYX_ERR(0, 314, __pyx_L1_error)
6407 if (__pyx_t_4 < 0) {
6408 __pyx_t_4 += __pyx_v_node_order.shape[0];
6409 if (unlikely(__pyx_t_4 < 0)) __pyx_t_2 = 0;
6410 }
else if (unlikely(__pyx_t_4 >= __pyx_v_node_order.shape[0])) __pyx_t_2 = 0;
6411 if (unlikely(__pyx_t_2 != -1)) {
6412 __Pyx_RaiseBufferIndexError(__pyx_t_2);
6413 __PYX_ERR(0, 316, __pyx_L1_error)
6425 if (__pyx_t_5 < 0) {
6426 __pyx_t_5 += __pyx_v_dX.shape[0];
6427 if (unlikely(__pyx_t_5 < 0)) __pyx_t_2 = 0;
6428 }
else if (unlikely(__pyx_t_5 >= __pyx_v_dX.shape[0])) __pyx_t_2 = 0;
6429 if (unlikely(__pyx_t_2 != -1)) {
6430 __Pyx_RaiseBufferIndexError(__pyx_t_2);
6431 __PYX_ERR(0, 318, __pyx_L1_error)
6441 asm_NR_solve((&__pyx_v_AS), __pyx_v_w, __pyx_v_asmFactor->subdomain_L, __pyx_v_asmFactor->subdomain_dim, __pyx_v_asmFactor->l2g_L, (&(*((
double *) ( (__pyx_v_R.data + __pyx_t_3 * __pyx_v_R.strides[0]) )))), __pyx_v_asmFactor->subdomain_R, (&(*((
int *) ( (__pyx_v_node_order.data + __pyx_t_4 * __pyx_v_node_order.strides[0]) )))), __pyx_v_asmFactor->subdomain_dX, (&(*((
double *) ( (__pyx_v_dX.data + __pyx_t_5 * __pyx_v_dX.strides[0]) )))), __pyx_v_asmFactor->subdomain_pivots);
6454 __Pyx_XDECREF(__pyx_t_1);
6455 __Pyx_WriteUnraisable(
"csmoothers.smootherWrappers_asm_NR_solve", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
6457 __Pyx_RefNannyFinishContext();
6469 static PyObject *__pyx_pw_10csmoothers_17basm_NR_prepare(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
6470 static char __pyx_doc_10csmoothers_16basm_NR_prepare[] =
"\n\n Arguments\n ---------\n A :\n basmFactor :\n ";
6471 static PyMethodDef __pyx_mdef_10csmoothers_17basm_NR_prepare = {
"basm_NR_prepare", (PyCFunction)(
void*)(PyCFunctionWithKeywords)__pyx_pw_10csmoothers_17basm_NR_prepare, METH_VARARGS|METH_KEYWORDS, __pyx_doc_10csmoothers_16basm_NR_prepare};
6472 static PyObject *__pyx_pw_10csmoothers_17basm_NR_prepare(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
6473 PyObject *__pyx_v_A = 0;
6474 PyObject *__pyx_v_basmFactor = 0;
6475 int __pyx_lineno = 0;
6476 const char *__pyx_filename = NULL;
6477 int __pyx_clineno = 0;
6478 PyObject *__pyx_r = 0;
6479 __Pyx_RefNannyDeclarations
6480 __Pyx_RefNannySetupContext(
"basm_NR_prepare (wrapper)", 0);
6482 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_A,&__pyx_n_s_basmFactor,0};
6483 PyObject* values[2] = {0,0};
6484 if (unlikely(__pyx_kwds)) {
6486 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
6488 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
6490 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
6493 default:
goto __pyx_L5_argtuple_error;
6495 kw_args = PyDict_Size(__pyx_kwds);
6498 if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_A)) != 0)) kw_args--;
6499 else goto __pyx_L5_argtuple_error;
6502 if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_basmFactor)) != 0)) kw_args--;
6504 __Pyx_RaiseArgtupleInvalid(
"basm_NR_prepare", 1, 2, 2, 1); __PYX_ERR(0, 321, __pyx_L3_error)
6507 if (unlikely(kw_args > 0)) {
6508 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args,
"basm_NR_prepare") < 0)) __PYX_ERR(0, 321, __pyx_L3_error)
6510 }
else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
6511 goto __pyx_L5_argtuple_error;
6513 values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
6514 values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
6516 __pyx_v_A = values[0];
6517 __pyx_v_basmFactor = values[1];
6519 goto __pyx_L4_argument_unpacking_done;
6520 __pyx_L5_argtuple_error:;
6521 __Pyx_RaiseArgtupleInvalid(
"basm_NR_prepare", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 321, __pyx_L3_error)
6523 __Pyx_AddTraceback(
"csmoothers.basm_NR_prepare", __pyx_clineno, __pyx_lineno, __pyx_filename);
6524 __Pyx_RefNannyFinishContext();
6526 __pyx_L4_argument_unpacking_done:;
6527 __pyx_r = __pyx_pf_10csmoothers_16basm_NR_prepare(__pyx_self, __pyx_v_A, __pyx_v_basmFactor);
6530 __Pyx_RefNannyFinishContext();
6534 static PyObject *__pyx_pf_10csmoothers_16basm_NR_prepare(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_A, PyObject *__pyx_v_basmFactor) {
6535 PyObject *__pyx_r = NULL;
6536 __Pyx_RefNannyDeclarations
6537 PyObject *__pyx_t_1 = NULL;
6538 PyObject *__pyx_t_2 = NULL;
6539 int __pyx_lineno = 0;
6540 const char *__pyx_filename = NULL;
6541 int __pyx_clineno = 0;
6542 __Pyx_RefNannySetupContext(
"basm_NR_prepare", 0);
6551 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_A, __pyx_n_s_cSparseMatrix);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 329, __pyx_L1_error)
6552 __Pyx_GOTREF(__pyx_t_1);
6553 if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_7proteus_15superluWrappers_cSparseMatrix))))) __PYX_ERR(0, 329, __pyx_L1_error)
6562 __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_basmFactor, __pyx_n_s_cBASMFactor);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 330, __pyx_L1_error)
6563 __Pyx_GOTREF(__pyx_t_2);
6564 if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_10csmoothers_cBASMFactor))))) __PYX_ERR(0, 330, __pyx_L1_error)
6573 __pyx_f_10csmoothers_smootherWrappers_basm_NR_prepare(((
struct __pyx_obj_7proteus_15superluWrappers_cSparseMatrix *)__pyx_t_1), ((
struct __pyx_obj_10csmoothers_cBASMFactor *)__pyx_t_2));
6574 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
6575 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
6586 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
6589 __Pyx_XDECREF(__pyx_t_1);
6590 __Pyx_XDECREF(__pyx_t_2);
6591 __Pyx_AddTraceback(
"csmoothers.basm_NR_prepare", __pyx_clineno, __pyx_lineno, __pyx_filename);
6594 __Pyx_XGIVEREF(__pyx_r);
6595 __Pyx_RefNannyFinishContext();
6607 static void __pyx_f_10csmoothers_smootherWrappers_basm_NR_prepare(
struct __pyx_obj_7proteus_15superluWrappers_cSparseMatrix *__pyx_v_sm,
struct __pyx_obj_10csmoothers_cBASMFactor *__pyx_v_basmFactor) {
6608 __pyx_t_10csmoothers_SuperMatrix __pyx_v_AS;
6609 __Pyx_RefNannyDeclarations
6610 PyObject *__pyx_t_1 = NULL;
6612 int __pyx_lineno = 0;
6613 const char *__pyx_filename = NULL;
6614 int __pyx_clineno = 0;
6615 __Pyx_RefNannySetupContext(
"smootherWrappers_basm_NR_prepare", 0);
6624 __pyx_v_AS.Dtype = SLU_D;
6633 __pyx_v_AS.Mtype = SLU_GE;
6642 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_sm), __pyx_n_s_nr);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 337, __pyx_L1_error)
6643 __Pyx_GOTREF(__pyx_t_1);
6644 __pyx_t_2 = __Pyx_PyInt_As_int(__pyx_t_1);
if (unlikely((__pyx_t_2 == (
int)-1) && PyErr_Occurred())) __PYX_ERR(0, 337, __pyx_L1_error)
6645 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
6646 __pyx_v_AS.nrow = __pyx_t_2;
6655 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_sm), __pyx_n_s_nc);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 338, __pyx_L1_error)
6656 __Pyx_GOTREF(__pyx_t_1);
6657 __pyx_t_2 = __Pyx_PyInt_As_int(__pyx_t_1);
if (unlikely((__pyx_t_2 == (
int)-1) && PyErr_Occurred())) __PYX_ERR(0, 338, __pyx_L1_error)
6658 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
6659 __pyx_v_AS.ncol = __pyx_t_2;
6668 __pyx_v_AS.Store = (&__pyx_v_sm->A);
6677 basm_NR_prepare(__pyx_v_basmFactor->bs, __pyx_v_basmFactor->N, (&__pyx_v_AS), __pyx_v_basmFactor->subdomain_dim, __pyx_v_basmFactor->l2g_L, __pyx_v_basmFactor->subdomain_L, __pyx_v_basmFactor->subdomain_pivots, __pyx_v_basmFactor->subdomain_col_pivots);
6690 __Pyx_XDECREF(__pyx_t_1);
6691 __Pyx_WriteUnraisable(
"csmoothers.smootherWrappers_basm_NR_prepare", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
6693 __Pyx_RefNannyFinishContext();
6705 static PyObject *__pyx_pw_10csmoothers_19basm_NR_solve(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
6706 static char __pyx_doc_10csmoothers_18basm_NR_solve[] =
"\n \n Arguments\n ---------\n A :\n w :\n basmFactor :\n node_order :\n R :\n dX :\n ";
6707 static PyMethodDef __pyx_mdef_10csmoothers_19basm_NR_solve = {
"basm_NR_solve", (PyCFunction)(
void*)(PyCFunctionWithKeywords)__pyx_pw_10csmoothers_19basm_NR_solve, METH_VARARGS|METH_KEYWORDS, __pyx_doc_10csmoothers_18basm_NR_solve};
6708 static PyObject *__pyx_pw_10csmoothers_19basm_NR_solve(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
6709 PyObject *__pyx_v_A = 0;
6710 PyObject *__pyx_v_w = 0;
6711 PyObject *__pyx_v_basmFactor = 0;
6712 PyObject *__pyx_v_node_order = 0;
6713 PyObject *__pyx_v_R = 0;
6714 PyObject *__pyx_v_dX = 0;
6715 int __pyx_lineno = 0;
6716 const char *__pyx_filename = NULL;
6717 int __pyx_clineno = 0;
6718 PyObject *__pyx_r = 0;
6719 __Pyx_RefNannyDeclarations
6720 __Pyx_RefNannySetupContext(
"basm_NR_solve (wrapper)", 0);
6722 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_A,&__pyx_n_s_w,&__pyx_n_s_basmFactor,&__pyx_n_s_node_order,&__pyx_n_s_R,&__pyx_n_s_dX,0};
6723 PyObject* values[6] = {0,0,0,0,0,0};
6724 if (unlikely(__pyx_kwds)) {
6726 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
6728 case 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
6730 case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
6732 case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
6734 case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
6736 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
6738 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
6741 default:
goto __pyx_L5_argtuple_error;
6743 kw_args = PyDict_Size(__pyx_kwds);
6746 if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_A)) != 0)) kw_args--;
6747 else goto __pyx_L5_argtuple_error;
6750 if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_w)) != 0)) kw_args--;
6752 __Pyx_RaiseArgtupleInvalid(
"basm_NR_solve", 1, 6, 6, 1); __PYX_ERR(0, 350, __pyx_L3_error)
6756 if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_basmFactor)) != 0)) kw_args--;
6758 __Pyx_RaiseArgtupleInvalid(
"basm_NR_solve", 1, 6, 6, 2); __PYX_ERR(0, 350, __pyx_L3_error)
6762 if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_node_order)) != 0)) kw_args--;
6764 __Pyx_RaiseArgtupleInvalid(
"basm_NR_solve", 1, 6, 6, 3); __PYX_ERR(0, 350, __pyx_L3_error)
6768 if (likely((values[4] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_R)) != 0)) kw_args--;
6770 __Pyx_RaiseArgtupleInvalid(
"basm_NR_solve", 1, 6, 6, 4); __PYX_ERR(0, 350, __pyx_L3_error)
6774 if (likely((values[5] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_dX)) != 0)) kw_args--;
6776 __Pyx_RaiseArgtupleInvalid(
"basm_NR_solve", 1, 6, 6, 5); __PYX_ERR(0, 350, __pyx_L3_error)
6779 if (unlikely(kw_args > 0)) {
6780 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args,
"basm_NR_solve") < 0)) __PYX_ERR(0, 350, __pyx_L3_error)
6782 }
else if (PyTuple_GET_SIZE(__pyx_args) != 6) {
6783 goto __pyx_L5_argtuple_error;
6785 values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
6786 values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
6787 values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
6788 values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
6789 values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
6790 values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
6792 __pyx_v_A = values[0];
6793 __pyx_v_w = values[1];
6794 __pyx_v_basmFactor = values[2];
6795 __pyx_v_node_order = values[3];
6796 __pyx_v_R = values[4];
6797 __pyx_v_dX = values[5];
6799 goto __pyx_L4_argument_unpacking_done;
6800 __pyx_L5_argtuple_error:;
6801 __Pyx_RaiseArgtupleInvalid(
"basm_NR_solve", 1, 6, 6, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 350, __pyx_L3_error)
6803 __Pyx_AddTraceback(
"csmoothers.basm_NR_solve", __pyx_clineno, __pyx_lineno, __pyx_filename);
6804 __Pyx_RefNannyFinishContext();
6806 __pyx_L4_argument_unpacking_done:;
6807 __pyx_r = __pyx_pf_10csmoothers_18basm_NR_solve(__pyx_self, __pyx_v_A, __pyx_v_w, __pyx_v_basmFactor, __pyx_v_node_order, __pyx_v_R, __pyx_v_dX);
6810 __Pyx_RefNannyFinishContext();
6814 static PyObject *__pyx_pf_10csmoothers_18basm_NR_solve(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_A, PyObject *__pyx_v_w, PyObject *__pyx_v_basmFactor, PyObject *__pyx_v_node_order, PyObject *__pyx_v_R, PyObject *__pyx_v_dX) {
6815 PyObject *__pyx_r = NULL;
6816 __Pyx_RefNannyDeclarations
6817 PyObject *__pyx_t_1 = NULL;
6819 PyObject *__pyx_t_3 = NULL;
6820 __pyx_t_10csmoothers_IDATA __pyx_t_4 = { 0, 0, { 0 }, { 0 }, { 0 } };
6821 __pyx_t_10csmoothers_DDATA __pyx_t_5 = { 0, 0, { 0 }, { 0 }, { 0 } };
6822 __pyx_t_10csmoothers_DDATA __pyx_t_6 = { 0, 0, { 0 }, { 0 }, { 0 } };
6823 int __pyx_lineno = 0;
6824 const char *__pyx_filename = NULL;
6825 int __pyx_clineno = 0;
6826 __Pyx_RefNannySetupContext(
"basm_NR_solve", 0);
6835 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_A, __pyx_n_s_cSparseMatrix);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 362, __pyx_L1_error)
6836 __Pyx_GOTREF(__pyx_t_1);
6837 if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_7proteus_15superluWrappers_cSparseMatrix))))) __PYX_ERR(0, 362, __pyx_L1_error)
6846 __pyx_t_2 = __pyx_PyFloat_AsDouble(__pyx_v_w);
if (unlikely((__pyx_t_2 == (
double)-1) && PyErr_Occurred())) __PYX_ERR(0, 363, __pyx_L1_error)
6855 __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_basmFactor, __pyx_n_s_cBASMFactor);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 364, __pyx_L1_error)
6856 __Pyx_GOTREF(__pyx_t_3);
6857 if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_10csmoothers_cBASMFactor))))) __PYX_ERR(0, 364, __pyx_L1_error)
6866 __pyx_t_4 = __Pyx_PyObject_to_MemoryviewSlice_ds_int(__pyx_v_node_order, PyBUF_WRITABLE);
if (unlikely(!__pyx_t_4.memview)) __PYX_ERR(0, 365, __pyx_L1_error)
6875 __pyx_t_5 = __Pyx_PyObject_to_MemoryviewSlice_ds_double(__pyx_v_R, PyBUF_WRITABLE);
if (unlikely(!__pyx_t_5.memview)) __PYX_ERR(0, 366, __pyx_L1_error)
6884 __pyx_t_6 = __Pyx_PyObject_to_MemoryviewSlice_ds_double(__pyx_v_dX, PyBUF_WRITABLE);
if (unlikely(!__pyx_t_6.memview)) __PYX_ERR(0, 367, __pyx_L1_error)
6893 __pyx_f_10csmoothers_smootherWrappers_basm_NR_solve(((
struct __pyx_obj_7proteus_15superluWrappers_cSparseMatrix *)__pyx_t_1), __pyx_t_2, ((
struct __pyx_obj_10csmoothers_cBASMFactor *)__pyx_t_3), __pyx_t_4, __pyx_t_5, __pyx_t_6);
6894 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
6895 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
6896 __PYX_XDEC_MEMVIEW(&__pyx_t_4, 1);
6897 __pyx_t_4.memview = NULL;
6898 __pyx_t_4.data = NULL;
6899 __PYX_XDEC_MEMVIEW(&__pyx_t_5, 1);
6900 __pyx_t_5.memview = NULL;
6901 __pyx_t_5.data = NULL;
6902 __PYX_XDEC_MEMVIEW(&__pyx_t_6, 1);
6903 __pyx_t_6.memview = NULL;
6904 __pyx_t_6.data = NULL;
6915 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
6918 __Pyx_XDECREF(__pyx_t_1);
6919 __Pyx_XDECREF(__pyx_t_3);
6920 __PYX_XDEC_MEMVIEW(&__pyx_t_4, 1);
6921 __PYX_XDEC_MEMVIEW(&__pyx_t_5, 1);
6922 __PYX_XDEC_MEMVIEW(&__pyx_t_6, 1);
6923 __Pyx_AddTraceback(
"csmoothers.basm_NR_solve", __pyx_clineno, __pyx_lineno, __pyx_filename);
6926 __Pyx_XGIVEREF(__pyx_r);
6927 __Pyx_RefNannyFinishContext();
6939 static void __pyx_f_10csmoothers_smootherWrappers_basm_NR_solve(
struct __pyx_obj_7proteus_15superluWrappers_cSparseMatrix *__pyx_v_sm,
double __pyx_v_w,
struct __pyx_obj_10csmoothers_cBASMFactor *__pyx_v_basmFactor, __pyx_t_10csmoothers_IDATA __pyx_v_node_order, __pyx_t_10csmoothers_DDATA __pyx_v_R, __pyx_t_10csmoothers_DDATA __pyx_v_dX) {
6940 __pyx_t_10csmoothers_SuperMatrix __pyx_v_AS;
6941 __Pyx_RefNannyDeclarations
6942 PyObject *__pyx_t_1 = NULL;
6944 Py_ssize_t __pyx_t_3;
6945 Py_ssize_t __pyx_t_4;
6946 Py_ssize_t __pyx_t_5;
6947 int __pyx_lineno = 0;
6948 const char *__pyx_filename = NULL;
6949 int __pyx_clineno = 0;
6950 __Pyx_RefNannySetupContext(
"smootherWrappers_basm_NR_solve", 0);
6959 __pyx_v_AS.Stype = SLU_NR;
6968 __pyx_v_AS.Dtype = SLU_D;
6977 __pyx_v_AS.Mtype = SLU_GE;
6986 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_sm), __pyx_n_s_nr);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 379, __pyx_L1_error)
6987 __Pyx_GOTREF(__pyx_t_1);
6988 __pyx_t_2 = __Pyx_PyInt_As_int(__pyx_t_1);
if (unlikely((__pyx_t_2 == (
int)-1) && PyErr_Occurred())) __PYX_ERR(0, 379, __pyx_L1_error)
6989 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
6990 __pyx_v_AS.nrow = __pyx_t_2;
6999 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_sm), __pyx_n_s_nc);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 380, __pyx_L1_error)
7000 __Pyx_GOTREF(__pyx_t_1);
7001 __pyx_t_2 = __Pyx_PyInt_As_int(__pyx_t_1);
if (unlikely((__pyx_t_2 == (
int)-1) && PyErr_Occurred())) __PYX_ERR(0, 380, __pyx_L1_error)
7002 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
7003 __pyx_v_AS.ncol = __pyx_t_2;
7012 __pyx_v_AS.Store = (&__pyx_v_sm->A);
7023 if (__pyx_t_3 < 0) {
7024 __pyx_t_3 += __pyx_v_R.shape[0];
7025 if (unlikely(__pyx_t_3 < 0)) __pyx_t_2 = 0;
7026 }
else if (unlikely(__pyx_t_3 >= __pyx_v_R.shape[0])) __pyx_t_2 = 0;
7027 if (unlikely(__pyx_t_2 != -1)) {
7028 __Pyx_RaiseBufferIndexError(__pyx_t_2);
7029 __PYX_ERR(0, 389, __pyx_L1_error)
7041 if (__pyx_t_4 < 0) {
7042 __pyx_t_4 += __pyx_v_node_order.shape[0];
7043 if (unlikely(__pyx_t_4 < 0)) __pyx_t_2 = 0;
7044 }
else if (unlikely(__pyx_t_4 >= __pyx_v_node_order.shape[0])) __pyx_t_2 = 0;
7045 if (unlikely(__pyx_t_2 != -1)) {
7046 __Pyx_RaiseBufferIndexError(__pyx_t_2);
7047 __PYX_ERR(0, 391, __pyx_L1_error)
7059 if (__pyx_t_5 < 0) {
7060 __pyx_t_5 += __pyx_v_dX.shape[0];
7061 if (unlikely(__pyx_t_5 < 0)) __pyx_t_2 = 0;
7062 }
else if (unlikely(__pyx_t_5 >= __pyx_v_dX.shape[0])) __pyx_t_2 = 0;
7063 if (unlikely(__pyx_t_2 != -1)) {
7064 __Pyx_RaiseBufferIndexError(__pyx_t_2);
7065 __PYX_ERR(0, 393, __pyx_L1_error)
7075 basm_NR_solve(__pyx_v_basmFactor->bs, __pyx_v_basmFactor->N, (&__pyx_v_AS), __pyx_v_w, __pyx_v_basmFactor->subdomain_L, __pyx_v_basmFactor->subdomain_dim, __pyx_v_basmFactor->l2g_L, (&(*((
double *) ( (__pyx_v_R.data + __pyx_t_3 * __pyx_v_R.strides[0]) )))), __pyx_v_basmFactor->subdomain_R, (&(*((
int *) ( (__pyx_v_node_order.data + __pyx_t_4 * __pyx_v_node_order.strides[0]) )))), __pyx_v_basmFactor->subdomain_dX, (&(*((
double *) ( (__pyx_v_dX.data + __pyx_t_5 * __pyx_v_dX.strides[0]) )))), __pyx_v_basmFactor->subdomain_pivots, __pyx_v_basmFactor->subdomain_col_pivots);
7088 __Pyx_XDECREF(__pyx_t_1);
7089 __Pyx_WriteUnraisable(
"csmoothers.smootherWrappers_basm_NR_solve", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
7091 __Pyx_RefNannyFinishContext();
7102 static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew1(PyObject *__pyx_v_a) {
7103 PyObject *__pyx_r = NULL;
7104 __Pyx_RefNannyDeclarations
7105 PyObject *__pyx_t_1 = NULL;
7106 int __pyx_lineno = 0;
7107 const char *__pyx_filename = NULL;
7108 int __pyx_clineno = 0;
7109 __Pyx_RefNannySetupContext(
"PyArray_MultiIterNew1", 0);
7118 __Pyx_XDECREF(__pyx_r);
7119 __pyx_t_1 = PyArray_MultiIterNew(1, ((
void *)__pyx_v_a));
if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 736, __pyx_L1_error)
7120 __Pyx_GOTREF(__pyx_t_1);
7121 __pyx_r = __pyx_t_1;
7135 __Pyx_XDECREF(__pyx_t_1);
7136 __Pyx_AddTraceback(
"numpy.PyArray_MultiIterNew1", __pyx_clineno, __pyx_lineno, __pyx_filename);
7139 __Pyx_XGIVEREF(__pyx_r);
7140 __Pyx_RefNannyFinishContext();
7152 static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew2(PyObject *__pyx_v_a, PyObject *__pyx_v_b) {
7153 PyObject *__pyx_r = NULL;
7154 __Pyx_RefNannyDeclarations
7155 PyObject *__pyx_t_1 = NULL;
7156 int __pyx_lineno = 0;
7157 const char *__pyx_filename = NULL;
7158 int __pyx_clineno = 0;
7159 __Pyx_RefNannySetupContext(
"PyArray_MultiIterNew2", 0);
7168 __Pyx_XDECREF(__pyx_r);
7169 __pyx_t_1 = PyArray_MultiIterNew(2, ((
void *)__pyx_v_a), ((
void *)__pyx_v_b));
if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 739, __pyx_L1_error)
7170 __Pyx_GOTREF(__pyx_t_1);
7171 __pyx_r = __pyx_t_1;
7185 __Pyx_XDECREF(__pyx_t_1);
7186 __Pyx_AddTraceback(
"numpy.PyArray_MultiIterNew2", __pyx_clineno, __pyx_lineno, __pyx_filename);
7189 __Pyx_XGIVEREF(__pyx_r);
7190 __Pyx_RefNannyFinishContext();
7202 static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew3(PyObject *__pyx_v_a, PyObject *__pyx_v_b, PyObject *__pyx_v_c) {
7203 PyObject *__pyx_r = NULL;
7204 __Pyx_RefNannyDeclarations
7205 PyObject *__pyx_t_1 = NULL;
7206 int __pyx_lineno = 0;
7207 const char *__pyx_filename = NULL;
7208 int __pyx_clineno = 0;
7209 __Pyx_RefNannySetupContext(
"PyArray_MultiIterNew3", 0);
7218 __Pyx_XDECREF(__pyx_r);
7219 __pyx_t_1 = PyArray_MultiIterNew(3, ((
void *)__pyx_v_a), ((
void *)__pyx_v_b), ((
void *)__pyx_v_c));
if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 742, __pyx_L1_error)
7220 __Pyx_GOTREF(__pyx_t_1);
7221 __pyx_r = __pyx_t_1;
7235 __Pyx_XDECREF(__pyx_t_1);
7236 __Pyx_AddTraceback(
"numpy.PyArray_MultiIterNew3", __pyx_clineno, __pyx_lineno, __pyx_filename);
7239 __Pyx_XGIVEREF(__pyx_r);
7240 __Pyx_RefNannyFinishContext();
7252 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) {
7253 PyObject *__pyx_r = NULL;
7254 __Pyx_RefNannyDeclarations
7255 PyObject *__pyx_t_1 = NULL;
7256 int __pyx_lineno = 0;
7257 const char *__pyx_filename = NULL;
7258 int __pyx_clineno = 0;
7259 __Pyx_RefNannySetupContext(
"PyArray_MultiIterNew4", 0);
7268 __Pyx_XDECREF(__pyx_r);
7269 __pyx_t_1 = PyArray_MultiIterNew(4, ((
void *)__pyx_v_a), ((
void *)__pyx_v_b), ((
void *)__pyx_v_c), ((
void *)__pyx_v_d));
if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 745, __pyx_L1_error)
7270 __Pyx_GOTREF(__pyx_t_1);
7271 __pyx_r = __pyx_t_1;
7285 __Pyx_XDECREF(__pyx_t_1);
7286 __Pyx_AddTraceback(
"numpy.PyArray_MultiIterNew4", __pyx_clineno, __pyx_lineno, __pyx_filename);
7289 __Pyx_XGIVEREF(__pyx_r);
7290 __Pyx_RefNannyFinishContext();
7302 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) {
7303 PyObject *__pyx_r = NULL;
7304 __Pyx_RefNannyDeclarations
7305 PyObject *__pyx_t_1 = NULL;
7306 int __pyx_lineno = 0;
7307 const char *__pyx_filename = NULL;
7308 int __pyx_clineno = 0;
7309 __Pyx_RefNannySetupContext(
"PyArray_MultiIterNew5", 0);
7318 __Pyx_XDECREF(__pyx_r);
7319 __pyx_t_1 = PyArray_MultiIterNew(5, ((
void *)__pyx_v_a), ((
void *)__pyx_v_b), ((
void *)__pyx_v_c), ((
void *)__pyx_v_d), ((
void *)__pyx_v_e));
if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 748, __pyx_L1_error)
7320 __Pyx_GOTREF(__pyx_t_1);
7321 __pyx_r = __pyx_t_1;
7335 __Pyx_XDECREF(__pyx_t_1);
7336 __Pyx_AddTraceback(
"numpy.PyArray_MultiIterNew5", __pyx_clineno, __pyx_lineno, __pyx_filename);
7339 __Pyx_XGIVEREF(__pyx_r);
7340 __Pyx_RefNannyFinishContext();
7352 static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyDataType_SHAPE(PyArray_Descr *__pyx_v_d) {
7353 PyObject *__pyx_r = NULL;
7354 __Pyx_RefNannyDeclarations
7356 __Pyx_RefNannySetupContext(
"PyDataType_SHAPE", 0);
7365 __pyx_t_1 = (PyDataType_HASSUBARRAY(__pyx_v_d) != 0);
7375 __Pyx_XDECREF(__pyx_r);
7376 __Pyx_INCREF(((PyObject*)__pyx_v_d->subarray->shape));
7377 __pyx_r = ((PyObject*)__pyx_v_d->subarray->shape);
7397 __Pyx_XDECREF(__pyx_r);
7398 __Pyx_INCREF(__pyx_empty_tuple);
7399 __pyx_r = __pyx_empty_tuple;
7413 __Pyx_XGIVEREF(__pyx_r);
7414 __Pyx_RefNannyFinishContext();
7426 static CYTHON_INLINE
void __pyx_f_5numpy_set_array_base(PyArrayObject *__pyx_v_arr, PyObject *__pyx_v_base) {
7427 __Pyx_RefNannyDeclarations
7428 __Pyx_RefNannySetupContext(
"set_array_base", 0);
7437 Py_INCREF(__pyx_v_base);
7446 (void)(PyArray_SetBaseObject(__pyx_v_arr, __pyx_v_base));
7457 __Pyx_RefNannyFinishContext();
7468 static CYTHON_INLINE PyObject *__pyx_f_5numpy_get_array_base(PyArrayObject *__pyx_v_arr) {
7469 PyObject *__pyx_v_base;
7470 PyObject *__pyx_r = NULL;
7471 __Pyx_RefNannyDeclarations
7473 __Pyx_RefNannySetupContext(
"get_array_base", 0);
7482 __pyx_v_base = PyArray_BASE(__pyx_v_arr);
7491 __pyx_t_1 = ((__pyx_v_base == NULL) != 0);
7501 __Pyx_XDECREF(__pyx_r);
7502 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
7521 __Pyx_XDECREF(__pyx_r);
7522 __Pyx_INCREF(((PyObject *)__pyx_v_base));
7523 __pyx_r = ((PyObject *)__pyx_v_base);
7536 __Pyx_XGIVEREF(__pyx_r);
7537 __Pyx_RefNannyFinishContext();
7549 static CYTHON_INLINE
int __pyx_f_5numpy_import_array(
void) {
7551 __Pyx_RefNannyDeclarations
7552 PyObject *__pyx_t_1 = NULL;
7553 PyObject *__pyx_t_2 = NULL;
7554 PyObject *__pyx_t_3 = NULL;
7556 PyObject *__pyx_t_5 = NULL;
7557 PyObject *__pyx_t_6 = NULL;
7558 PyObject *__pyx_t_7 = NULL;
7559 PyObject *__pyx_t_8 = NULL;
7560 int __pyx_lineno = 0;
7561 const char *__pyx_filename = NULL;
7562 int __pyx_clineno = 0;
7563 __Pyx_RefNannySetupContext(
"import_array", 0);
7573 __Pyx_PyThreadState_declare
7574 __Pyx_PyThreadState_assign
7575 __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
7576 __Pyx_XGOTREF(__pyx_t_1);
7577 __Pyx_XGOTREF(__pyx_t_2);
7578 __Pyx_XGOTREF(__pyx_t_3);
7588 __pyx_t_4 = _import_array();
if (unlikely(__pyx_t_4 == ((
int)-1))) __PYX_ERR(2, 943, __pyx_L3_error)
7598 __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
7599 __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
7600 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
7601 goto __pyx_L8_try_end;
7611 __pyx_t_4 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0])));
7613 __Pyx_AddTraceback(
"numpy.import_array", __pyx_clineno, __pyx_lineno, __pyx_filename);
7614 if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(2, 944, __pyx_L5_except_error)
7615 __Pyx_GOTREF(__pyx_t_5);
7616 __Pyx_GOTREF(__pyx_t_6);
7617 __Pyx_GOTREF(__pyx_t_7);
7626 __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_ImportError, __pyx_tuple__5, NULL);
if (unlikely(!__pyx_t_8)) __PYX_ERR(2, 945, __pyx_L5_except_error)
7627 __Pyx_GOTREF(__pyx_t_8);
7628 __Pyx_Raise(__pyx_t_8, 0, 0, 0);
7629 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
7630 __PYX_ERR(2, 945, __pyx_L5_except_error)
7632 goto __pyx_L5_except_error;
7633 __pyx_L5_except_error:;
7642 __Pyx_XGIVEREF(__pyx_t_1);
7643 __Pyx_XGIVEREF(__pyx_t_2);
7644 __Pyx_XGIVEREF(__pyx_t_3);
7645 __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
7646 goto __pyx_L1_error;
7662 __Pyx_XDECREF(__pyx_t_5);
7663 __Pyx_XDECREF(__pyx_t_6);
7664 __Pyx_XDECREF(__pyx_t_7);
7665 __Pyx_XDECREF(__pyx_t_8);
7666 __Pyx_AddTraceback(
"numpy.import_array", __pyx_clineno, __pyx_lineno, __pyx_filename);
7669 __Pyx_RefNannyFinishContext();
7681 static CYTHON_INLINE
int __pyx_f_5numpy_import_umath(
void) {
7683 __Pyx_RefNannyDeclarations
7684 PyObject *__pyx_t_1 = NULL;
7685 PyObject *__pyx_t_2 = NULL;
7686 PyObject *__pyx_t_3 = NULL;
7688 PyObject *__pyx_t_5 = NULL;
7689 PyObject *__pyx_t_6 = NULL;
7690 PyObject *__pyx_t_7 = NULL;
7691 PyObject *__pyx_t_8 = NULL;
7692 int __pyx_lineno = 0;
7693 const char *__pyx_filename = NULL;
7694 int __pyx_clineno = 0;
7695 __Pyx_RefNannySetupContext(
"import_umath", 0);
7705 __Pyx_PyThreadState_declare
7706 __Pyx_PyThreadState_assign
7707 __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
7708 __Pyx_XGOTREF(__pyx_t_1);
7709 __Pyx_XGOTREF(__pyx_t_2);
7710 __Pyx_XGOTREF(__pyx_t_3);
7720 __pyx_t_4 = _import_umath();
if (unlikely(__pyx_t_4 == ((
int)-1))) __PYX_ERR(2, 949, __pyx_L3_error)
7730 __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
7731 __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
7732 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
7733 goto __pyx_L8_try_end;
7743 __pyx_t_4 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0])));
7745 __Pyx_AddTraceback(
"numpy.import_umath", __pyx_clineno, __pyx_lineno, __pyx_filename);
7746 if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(2, 950, __pyx_L5_except_error)
7747 __Pyx_GOTREF(__pyx_t_5);
7748 __Pyx_GOTREF(__pyx_t_6);
7749 __Pyx_GOTREF(__pyx_t_7);
7758 __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_ImportError, __pyx_tuple__6, NULL);
if (unlikely(!__pyx_t_8)) __PYX_ERR(2, 951, __pyx_L5_except_error)
7759 __Pyx_GOTREF(__pyx_t_8);
7760 __Pyx_Raise(__pyx_t_8, 0, 0, 0);
7761 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
7762 __PYX_ERR(2, 951, __pyx_L5_except_error)
7764 goto __pyx_L5_except_error;
7765 __pyx_L5_except_error:;
7774 __Pyx_XGIVEREF(__pyx_t_1);
7775 __Pyx_XGIVEREF(__pyx_t_2);
7776 __Pyx_XGIVEREF(__pyx_t_3);
7777 __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
7778 goto __pyx_L1_error;
7794 __Pyx_XDECREF(__pyx_t_5);
7795 __Pyx_XDECREF(__pyx_t_6);
7796 __Pyx_XDECREF(__pyx_t_7);
7797 __Pyx_XDECREF(__pyx_t_8);
7798 __Pyx_AddTraceback(
"numpy.import_umath", __pyx_clineno, __pyx_lineno, __pyx_filename);
7801 __Pyx_RefNannyFinishContext();
7813 static CYTHON_INLINE
int __pyx_f_5numpy_import_ufunc(
void) {
7815 __Pyx_RefNannyDeclarations
7816 PyObject *__pyx_t_1 = NULL;
7817 PyObject *__pyx_t_2 = NULL;
7818 PyObject *__pyx_t_3 = NULL;
7820 PyObject *__pyx_t_5 = NULL;
7821 PyObject *__pyx_t_6 = NULL;
7822 PyObject *__pyx_t_7 = NULL;
7823 PyObject *__pyx_t_8 = NULL;
7824 int __pyx_lineno = 0;
7825 const char *__pyx_filename = NULL;
7826 int __pyx_clineno = 0;
7827 __Pyx_RefNannySetupContext(
"import_ufunc", 0);
7837 __Pyx_PyThreadState_declare
7838 __Pyx_PyThreadState_assign
7839 __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
7840 __Pyx_XGOTREF(__pyx_t_1);
7841 __Pyx_XGOTREF(__pyx_t_2);
7842 __Pyx_XGOTREF(__pyx_t_3);
7852 __pyx_t_4 = _import_umath();
if (unlikely(__pyx_t_4 == ((
int)-1))) __PYX_ERR(2, 955, __pyx_L3_error)
7862 __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
7863 __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
7864 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
7865 goto __pyx_L8_try_end;
7875 __pyx_t_4 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0])));
7877 __Pyx_AddTraceback(
"numpy.import_ufunc", __pyx_clineno, __pyx_lineno, __pyx_filename);
7878 if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(2, 956, __pyx_L5_except_error)
7879 __Pyx_GOTREF(__pyx_t_5);
7880 __Pyx_GOTREF(__pyx_t_6);
7881 __Pyx_GOTREF(__pyx_t_7);
7890 __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_ImportError, __pyx_tuple__6, NULL);
if (unlikely(!__pyx_t_8)) __PYX_ERR(2, 957, __pyx_L5_except_error)
7891 __Pyx_GOTREF(__pyx_t_8);
7892 __Pyx_Raise(__pyx_t_8, 0, 0, 0);
7893 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
7894 __PYX_ERR(2, 957, __pyx_L5_except_error)
7896 goto __pyx_L5_except_error;
7897 __pyx_L5_except_error:;
7906 __Pyx_XGIVEREF(__pyx_t_1);
7907 __Pyx_XGIVEREF(__pyx_t_2);
7908 __Pyx_XGIVEREF(__pyx_t_3);
7909 __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
7910 goto __pyx_L1_error;
7926 __Pyx_XDECREF(__pyx_t_5);
7927 __Pyx_XDECREF(__pyx_t_6);
7928 __Pyx_XDECREF(__pyx_t_7);
7929 __Pyx_XDECREF(__pyx_t_8);
7930 __Pyx_AddTraceback(
"numpy.import_ufunc", __pyx_clineno, __pyx_lineno, __pyx_filename);
7933 __Pyx_RefNannyFinishContext();
7945 static CYTHON_INLINE
int __pyx_f_5numpy_is_timedelta64_object(PyObject *__pyx_v_obj) {
7947 __Pyx_RefNannyDeclarations
7948 __Pyx_RefNannySetupContext(
"is_timedelta64_object", 0);
7957 __pyx_r = PyObject_TypeCheck(__pyx_v_obj, (&PyTimedeltaArrType_Type));
7970 __Pyx_RefNannyFinishContext();
7982 static CYTHON_INLINE
int __pyx_f_5numpy_is_datetime64_object(PyObject *__pyx_v_obj) {
7984 __Pyx_RefNannyDeclarations
7985 __Pyx_RefNannySetupContext(
"is_datetime64_object", 0);
7994 __pyx_r = PyObject_TypeCheck(__pyx_v_obj, (&PyDatetimeArrType_Type));
8007 __Pyx_RefNannyFinishContext();
8019 static CYTHON_INLINE npy_datetime __pyx_f_5numpy_get_datetime64_value(PyObject *__pyx_v_obj) {
8020 npy_datetime __pyx_r;
8029 __pyx_r = ((PyDatetimeScalarObject *)__pyx_v_obj)->obval;
8053 static CYTHON_INLINE npy_timedelta __pyx_f_5numpy_get_timedelta64_value(PyObject *__pyx_v_obj) {
8054 npy_timedelta __pyx_r;
8063 __pyx_r = ((PyTimedeltaScalarObject *)__pyx_v_obj)->obval;
8087 static CYTHON_INLINE NPY_DATETIMEUNIT __pyx_f_5numpy_get_datetime64_unit(PyObject *__pyx_v_obj) {
8088 NPY_DATETIMEUNIT __pyx_r;
8095 __pyx_r = ((NPY_DATETIMEUNIT)((PyDatetimeScalarObject *)__pyx_v_obj)->obmeta.base);
8120 static int __pyx_array___cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
8121 static int __pyx_array___cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
8122 PyObject *__pyx_v_shape = 0;
8123 Py_ssize_t __pyx_v_itemsize;
8124 PyObject *__pyx_v_format = 0;
8125 PyObject *__pyx_v_mode = 0;
8126 int __pyx_v_allocate_buffer;
8127 int __pyx_lineno = 0;
8128 const char *__pyx_filename = NULL;
8129 int __pyx_clineno = 0;
8131 __Pyx_RefNannyDeclarations
8132 __Pyx_RefNannySetupContext(
"__cinit__ (wrapper)", 0);
8134 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};
8135 PyObject* values[5] = {0,0,0,0,0};
8136 values[3] = ((PyObject *)__pyx_n_s_c);
8137 if (unlikely(__pyx_kwds)) {
8139 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
8141 case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
8143 case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
8145 case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
8147 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
8149 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
8152 default:
goto __pyx_L5_argtuple_error;
8154 kw_args = PyDict_Size(__pyx_kwds);
8157 if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_shape)) != 0)) kw_args--;
8158 else goto __pyx_L5_argtuple_error;
8161 if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_itemsize)) != 0)) kw_args--;
8163 __Pyx_RaiseArgtupleInvalid(
"__cinit__", 0, 3, 5, 1); __PYX_ERR(1, 122, __pyx_L3_error)
8167 if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_format)) != 0)) kw_args--;
8169 __Pyx_RaiseArgtupleInvalid(
"__cinit__", 0, 3, 5, 2); __PYX_ERR(1, 122, __pyx_L3_error)
8174 PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_mode);
8175 if (value) { values[3] = value; kw_args--; }
8180 PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_allocate_buffer);
8181 if (value) { values[4] = value; kw_args--; }
8184 if (unlikely(kw_args > 0)) {
8185 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args,
"__cinit__") < 0)) __PYX_ERR(1, 122, __pyx_L3_error)
8188 switch (PyTuple_GET_SIZE(__pyx_args)) {
8189 case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
8191 case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
8193 case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
8194 values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
8195 values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
8197 default:
goto __pyx_L5_argtuple_error;
8200 __pyx_v_shape = ((PyObject*)values[0]);
8201 __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)
8202 __pyx_v_format = values[2];
8203 __pyx_v_mode = values[3];
8205 __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)
8215 __pyx_v_allocate_buffer = ((int)1);
8218 goto __pyx_L4_argument_unpacking_done;
8219 __pyx_L5_argtuple_error:;
8220 __Pyx_RaiseArgtupleInvalid(
"__cinit__", 0, 3, 5, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(1, 122, __pyx_L3_error)
8222 __Pyx_AddTraceback(
"View.MemoryView.array.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
8223 __Pyx_RefNannyFinishContext();
8225 __pyx_L4_argument_unpacking_done:;
8226 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_shape), (&PyTuple_Type), 1,
"shape", 1))) __PYX_ERR(1, 122, __pyx_L1_error)
8227 if (unlikely(((PyObject *)__pyx_v_format) == Py_None)) {
8228 PyErr_Format(PyExc_TypeError,
"Argument '%.200s' must not be None",
"format"); __PYX_ERR(1, 122, __pyx_L1_error)
8230 __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);
8245 __Pyx_RefNannyFinishContext();
8249 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) {
8251 Py_ssize_t __pyx_v_i;
8252 Py_ssize_t __pyx_v_dim;
8253 PyObject **__pyx_v_p;
8256 __Pyx_RefNannyDeclarations
8257 Py_ssize_t __pyx_t_1;
8259 PyObject *__pyx_t_3 = NULL;
8261 PyObject *__pyx_t_5 = NULL;
8262 PyObject *__pyx_t_6 = NULL;
8265 Py_ssize_t __pyx_t_9;
8266 PyObject *__pyx_t_10 = NULL;
8267 Py_ssize_t __pyx_t_11;
8268 int __pyx_lineno = 0;
8269 const char *__pyx_filename = NULL;
8270 int __pyx_clineno = 0;
8271 __Pyx_RefNannySetupContext(
"__cinit__", 0);
8272 __Pyx_INCREF(__pyx_v_format);
8281 if (unlikely(__pyx_v_shape == Py_None)) {
8282 PyErr_SetString(PyExc_TypeError,
"object of type 'NoneType' has no len()");
8283 __PYX_ERR(1, 129, __pyx_L1_error)
8285 __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)
8286 __pyx_v_self->ndim = ((int)__pyx_t_1);
8295 __pyx_v_self->itemsize = __pyx_v_itemsize;
8304 __pyx_t_2 = ((!(__pyx_v_self->ndim != 0)) != 0);
8305 if (unlikely(__pyx_t_2)) {
8314 __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__7, NULL);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 133, __pyx_L1_error)
8315 __Pyx_GOTREF(__pyx_t_3);
8316 __Pyx_Raise(__pyx_t_3, 0, 0, 0);
8317 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
8318 __PYX_ERR(1, 133, __pyx_L1_error)
8336 __pyx_t_2 = ((__pyx_v_itemsize <= 0) != 0);
8337 if (unlikely(__pyx_t_2)) {
8346 __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__8, NULL);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 136, __pyx_L1_error)
8347 __Pyx_GOTREF(__pyx_t_3);
8348 __Pyx_Raise(__pyx_t_3, 0, 0, 0);
8349 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
8350 __PYX_ERR(1, 136, __pyx_L1_error)
8368 __pyx_t_2 = PyBytes_Check(__pyx_v_format);
8369 __pyx_t_4 = ((!(__pyx_t_2 != 0)) != 0);
8379 __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)
8380 __Pyx_GOTREF(__pyx_t_5);
8382 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) {
8383 __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5);
8384 if (likely(__pyx_t_6)) {
8385 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_5);
8386 __Pyx_INCREF(__pyx_t_6);
8387 __Pyx_INCREF(
function);
8388 __Pyx_DECREF_SET(__pyx_t_5,
function);
8391 __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);
8392 __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
8393 if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 139, __pyx_L1_error)
8394 __Pyx_GOTREF(__pyx_t_3);
8395 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
8396 __Pyx_DECREF_SET(__pyx_v_format, __pyx_t_3);
8415 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)
8416 __pyx_t_3 = __pyx_v_format;
8417 __Pyx_INCREF(__pyx_t_3);
8418 __Pyx_GIVEREF(__pyx_t_3);
8419 __Pyx_GOTREF(__pyx_v_self->_format);
8420 __Pyx_DECREF(__pyx_v_self->_format);
8421 __pyx_v_self->_format = ((PyObject*)__pyx_t_3);
8431 if (unlikely(__pyx_v_self->_format == Py_None)) {
8432 PyErr_SetString(PyExc_TypeError,
"expected bytes, NoneType found");
8433 __PYX_ERR(1, 141, __pyx_L1_error)
8435 __pyx_t_7 = __Pyx_PyBytes_AsWritableString(__pyx_v_self->_format);
if (unlikely((!__pyx_t_7) && PyErr_Occurred())) __PYX_ERR(1, 141, __pyx_L1_error)
8436 __pyx_v_self->format = __pyx_t_7;
8445 __pyx_v_self->_shape = ((Py_ssize_t *)PyObject_Malloc((((
sizeof(Py_ssize_t)) * __pyx_v_self->ndim) * 2)));
8454 __pyx_v_self->_strides = (__pyx_v_self->_shape + __pyx_v_self->ndim);
8463 __pyx_t_4 = ((!(__pyx_v_self->_shape != 0)) != 0);
8464 if (unlikely(__pyx_t_4)) {
8473 __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_MemoryError, __pyx_tuple__9, NULL);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 148, __pyx_L1_error)
8474 __Pyx_GOTREF(__pyx_t_3);
8475 __Pyx_Raise(__pyx_t_3, 0, 0, 0);
8476 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
8477 __PYX_ERR(1, 148, __pyx_L1_error)
8496 __pyx_t_3 = __pyx_v_shape; __Pyx_INCREF(__pyx_t_3); __pyx_t_1 = 0;
8498 if (__pyx_t_1 >= PyTuple_GET_SIZE(__pyx_t_3))
break;
8499 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
8500 __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)
8502 __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)
8503 __Pyx_GOTREF(__pyx_t_5);
8505 __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)
8506 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
8507 __pyx_v_dim = __pyx_t_9;
8508 __pyx_v_idx = __pyx_t_8;
8509 __pyx_t_8 = (__pyx_t_8 + 1);
8518 __pyx_t_4 = ((__pyx_v_dim <= 0) != 0);
8519 if (unlikely(__pyx_t_4)) {
8528 __pyx_t_5 = __Pyx_PyInt_From_int(__pyx_v_idx);
if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 153, __pyx_L1_error)
8529 __Pyx_GOTREF(__pyx_t_5);
8530 __pyx_t_6 = PyInt_FromSsize_t(__pyx_v_dim);
if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 153, __pyx_L1_error)
8531 __Pyx_GOTREF(__pyx_t_6);
8532 __pyx_t_10 = PyTuple_New(2);
if (unlikely(!__pyx_t_10)) __PYX_ERR(1, 153, __pyx_L1_error)
8533 __Pyx_GOTREF(__pyx_t_10);
8534 __Pyx_GIVEREF(__pyx_t_5);
8535 PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_5);
8536 __Pyx_GIVEREF(__pyx_t_6);
8537 PyTuple_SET_ITEM(__pyx_t_10, 1, __pyx_t_6);
8540 __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)
8541 __Pyx_GOTREF(__pyx_t_6);
8542 __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
8543 __pyx_t_10 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_6);
if (unlikely(!__pyx_t_10)) __PYX_ERR(1, 153, __pyx_L1_error)
8544 __Pyx_GOTREF(__pyx_t_10);
8545 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
8546 __Pyx_Raise(__pyx_t_10, 0, 0, 0);
8547 __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
8548 __PYX_ERR(1, 153, __pyx_L1_error)
8566 (__pyx_v_self->_shape[__pyx_v_idx]) = __pyx_v_dim;
8576 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
8585 __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)
8595 __pyx_v_order =
'F';
8604 __Pyx_INCREF(__pyx_n_u_fortran);
8605 __Pyx_GIVEREF(__pyx_n_u_fortran);
8606 __Pyx_GOTREF(__pyx_v_self->mode);
8607 __Pyx_DECREF(__pyx_v_self->mode);
8608 __pyx_v_self->mode = __pyx_n_u_fortran;
8627 __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)
8628 if (likely(__pyx_t_4)) {
8637 __pyx_v_order =
'C';
8646 __Pyx_INCREF(__pyx_n_u_c);
8647 __Pyx_GIVEREF(__pyx_n_u_c);
8648 __Pyx_GOTREF(__pyx_v_self->mode);
8649 __Pyx_DECREF(__pyx_v_self->mode);
8650 __pyx_v_self->mode = __pyx_n_u_c;
8670 __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)
8671 __Pyx_GOTREF(__pyx_t_3);
8672 __pyx_t_10 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_3);
if (unlikely(!__pyx_t_10)) __PYX_ERR(1, 164, __pyx_L1_error)
8673 __Pyx_GOTREF(__pyx_t_10);
8674 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
8675 __Pyx_Raise(__pyx_t_10, 0, 0, 0);
8676 __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
8677 __PYX_ERR(1, 164, __pyx_L1_error)
8688 __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);
8697 __pyx_v_self->free_data = __pyx_v_allocate_buffer;
8706 __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)
8707 __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)
8708 __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
8709 __pyx_v_self->dtype_is_object = __pyx_t_4;
8718 __pyx_t_4 = (__pyx_v_allocate_buffer != 0);
8728 __pyx_v_self->data = ((
char *)malloc(__pyx_v_self->len));
8737 __pyx_t_4 = ((!(__pyx_v_self->data != 0)) != 0);
8738 if (unlikely(__pyx_t_4)) {
8747 __pyx_t_10 = __Pyx_PyObject_Call(__pyx_builtin_MemoryError, __pyx_tuple__10, NULL);
if (unlikely(!__pyx_t_10)) __PYX_ERR(1, 176, __pyx_L1_error)
8748 __Pyx_GOTREF(__pyx_t_10);
8749 __Pyx_Raise(__pyx_t_10, 0, 0, 0);
8750 __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
8751 __PYX_ERR(1, 176, __pyx_L1_error)
8769 __pyx_t_4 = (__pyx_v_self->dtype_is_object != 0);
8779 __pyx_v_p = ((PyObject **)__pyx_v_self->data);
8788 if (unlikely(__pyx_v_itemsize == 0)) {
8789 PyErr_SetString(PyExc_ZeroDivisionError,
"integer division or modulo by zero");
8790 __PYX_ERR(1, 180, __pyx_L1_error)
8792 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))) {
8793 PyErr_SetString(PyExc_OverflowError,
"value too large to perform division");
8794 __PYX_ERR(1, 180, __pyx_L1_error)
8796 __pyx_t_1 = __Pyx_div_Py_ssize_t(__pyx_v_self->len, __pyx_v_itemsize);
8797 __pyx_t_9 = __pyx_t_1;
8798 for (__pyx_t_11 = 0; __pyx_t_11 < __pyx_t_9; __pyx_t_11+=1) {
8799 __pyx_v_i = __pyx_t_11;
8808 (__pyx_v_p[__pyx_v_i]) = Py_None;
8850 __Pyx_XDECREF(__pyx_t_3);
8851 __Pyx_XDECREF(__pyx_t_5);
8852 __Pyx_XDECREF(__pyx_t_6);
8853 __Pyx_XDECREF(__pyx_t_10);
8854 __Pyx_AddTraceback(
"View.MemoryView.array.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
8857 __Pyx_XDECREF(__pyx_v_format);
8858 __Pyx_RefNannyFinishContext();
8871 static CYTHON_UNUSED
int __pyx_array_getbuffer(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info,
int __pyx_v_flags);
8872 static CYTHON_UNUSED
int __pyx_array_getbuffer(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info,
int __pyx_v_flags) {
8874 __Pyx_RefNannyDeclarations
8875 __Pyx_RefNannySetupContext(
"__getbuffer__ (wrapper)", 0);
8876 __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));
8879 __Pyx_RefNannyFinishContext();
8883 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) {
8884 int __pyx_v_bufmode;
8886 __Pyx_RefNannyDeclarations
8889 PyObject *__pyx_t_3 = NULL;
8891 Py_ssize_t __pyx_t_5;
8893 Py_ssize_t *__pyx_t_7;
8894 int __pyx_lineno = 0;
8895 const char *__pyx_filename = NULL;
8896 int __pyx_clineno = 0;
8897 if (__pyx_v_info == NULL) {
8898 PyErr_SetString(PyExc_BufferError,
"PyObject_GetBuffer: view==NULL argument is obsolete");
8901 __Pyx_RefNannySetupContext(
"__getbuffer__", 0);
8902 __pyx_v_info->obj = Py_None; __Pyx_INCREF(Py_None);
8903 __Pyx_GIVEREF(__pyx_v_info->obj);
8912 __pyx_v_bufmode = -1;
8921 __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)
8922 __pyx_t_2 = (__pyx_t_1 != 0);
8932 __pyx_v_bufmode = (PyBUF_C_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS);
8951 __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)
8952 __pyx_t_1 = (__pyx_t_2 != 0);
8962 __pyx_v_bufmode = (PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS);
8981 __pyx_t_1 = ((!((__pyx_v_flags & __pyx_v_bufmode) != 0)) != 0);
8982 if (unlikely(__pyx_t_1)) {
8991 __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__11, NULL);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 192, __pyx_L1_error)
8992 __Pyx_GOTREF(__pyx_t_3);
8993 __Pyx_Raise(__pyx_t_3, 0, 0, 0);
8994 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
8995 __PYX_ERR(1, 192, __pyx_L1_error)
9013 __pyx_t_4 = __pyx_v_self->data;
9014 __pyx_v_info->buf = __pyx_t_4;
9023 __pyx_t_5 = __pyx_v_self->len;
9024 __pyx_v_info->len = __pyx_t_5;
9033 __pyx_t_6 = __pyx_v_self->ndim;
9034 __pyx_v_info->ndim = __pyx_t_6;
9043 __pyx_t_7 = __pyx_v_self->_shape;
9044 __pyx_v_info->shape = __pyx_t_7;
9053 __pyx_t_7 = __pyx_v_self->_strides;
9054 __pyx_v_info->strides = __pyx_t_7;
9063 __pyx_v_info->suboffsets = NULL;
9072 __pyx_t_5 = __pyx_v_self->itemsize;
9073 __pyx_v_info->itemsize = __pyx_t_5;
9082 __pyx_v_info->readonly = 0;
9091 __pyx_t_1 = ((__pyx_v_flags & PyBUF_FORMAT) != 0);
9101 __pyx_t_4 = __pyx_v_self->format;
9102 __pyx_v_info->format = __pyx_t_4;
9122 __pyx_v_info->format = NULL;
9133 __Pyx_INCREF(((PyObject *)__pyx_v_self));
9134 __Pyx_GIVEREF(((PyObject *)__pyx_v_self));
9135 __Pyx_GOTREF(__pyx_v_info->obj);
9136 __Pyx_DECREF(__pyx_v_info->obj);
9137 __pyx_v_info->obj = ((PyObject *)__pyx_v_self);
9151 __Pyx_XDECREF(__pyx_t_3);
9152 __Pyx_AddTraceback(
"View.MemoryView.array.__getbuffer__", __pyx_clineno, __pyx_lineno, __pyx_filename);
9154 if (__pyx_v_info->obj != NULL) {
9155 __Pyx_GOTREF(__pyx_v_info->obj);
9156 __Pyx_DECREF(__pyx_v_info->obj); __pyx_v_info->obj = 0;
9160 if (__pyx_v_info->obj == Py_None) {
9161 __Pyx_GOTREF(__pyx_v_info->obj);
9162 __Pyx_DECREF(__pyx_v_info->obj); __pyx_v_info->obj = 0;
9165 __Pyx_RefNannyFinishContext();
9178 static void __pyx_array___dealloc__(PyObject *__pyx_v_self);
9179 static void __pyx_array___dealloc__(PyObject *__pyx_v_self) {
9180 __Pyx_RefNannyDeclarations
9181 __Pyx_RefNannySetupContext(
"__dealloc__ (wrapper)", 0);
9182 __pyx_array___pyx_pf_15View_dot_MemoryView_5array_4__dealloc__(((
struct __pyx_array_obj *)__pyx_v_self));
9185 __Pyx_RefNannyFinishContext();
9188 static void __pyx_array___pyx_pf_15View_dot_MemoryView_5array_4__dealloc__(
struct __pyx_array_obj *__pyx_v_self) {
9189 __Pyx_RefNannyDeclarations
9191 __Pyx_RefNannySetupContext(
"__dealloc__", 0);
9200 __pyx_t_1 = ((__pyx_v_self->callback_free_data != NULL) != 0);
9210 __pyx_v_self->callback_free_data(__pyx_v_self->data);
9229 __pyx_t_1 = (__pyx_v_self->free_data != 0);
9239 __pyx_t_1 = (__pyx_v_self->dtype_is_object != 0);
9249 __pyx_memoryview_refcount_objects_in_slice(__pyx_v_self->data, __pyx_v_self->_shape, __pyx_v_self->_strides, __pyx_v_self->ndim, 0);
9267 free(__pyx_v_self->data);
9286 PyObject_Free(__pyx_v_self->_shape);
9297 __Pyx_RefNannyFinishContext();
9309 static PyObject *__pyx_pw_15View_dot_MemoryView_5array_7memview_1__get__(PyObject *__pyx_v_self);
9310 static PyObject *__pyx_pw_15View_dot_MemoryView_5array_7memview_1__get__(PyObject *__pyx_v_self) {
9311 PyObject *__pyx_r = 0;
9312 __Pyx_RefNannyDeclarations
9313 __Pyx_RefNannySetupContext(
"__get__ (wrapper)", 0);
9314 __pyx_r = __pyx_pf_15View_dot_MemoryView_5array_7memview___get__(((
struct __pyx_array_obj *)__pyx_v_self));
9317 __Pyx_RefNannyFinishContext();
9321 static PyObject *__pyx_pf_15View_dot_MemoryView_5array_7memview___get__(
struct __pyx_array_obj *__pyx_v_self) {
9322 PyObject *__pyx_r = NULL;
9323 __Pyx_RefNannyDeclarations
9324 PyObject *__pyx_t_1 = NULL;
9325 int __pyx_lineno = 0;
9326 const char *__pyx_filename = NULL;
9327 int __pyx_clineno = 0;
9328 __Pyx_RefNannySetupContext(
"__get__", 0);
9337 __Pyx_XDECREF(__pyx_r);
9338 __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)
9339 __Pyx_GOTREF(__pyx_t_1);
9340 __pyx_r = __pyx_t_1;
9354 __Pyx_XDECREF(__pyx_t_1);
9355 __Pyx_AddTraceback(
"View.MemoryView.array.memview.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
9358 __Pyx_XGIVEREF(__pyx_r);
9359 __Pyx_RefNannyFinishContext();
9371 static PyObject *__pyx_array_get_memview(
struct __pyx_array_obj *__pyx_v_self) {
9373 PyObject *__pyx_r = NULL;
9374 __Pyx_RefNannyDeclarations
9375 PyObject *__pyx_t_1 = NULL;
9376 PyObject *__pyx_t_2 = NULL;
9377 PyObject *__pyx_t_3 = NULL;
9378 int __pyx_lineno = 0;
9379 const char *__pyx_filename = NULL;
9380 int __pyx_clineno = 0;
9381 __Pyx_RefNannySetupContext(
"get_memview", 0);
9390 __pyx_v_flags = ((PyBUF_ANY_CONTIGUOUS | PyBUF_FORMAT) | PyBUF_WRITABLE);
9399 __Pyx_XDECREF(__pyx_r);
9400 __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_flags);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 228, __pyx_L1_error)
9401 __Pyx_GOTREF(__pyx_t_1);
9402 __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_v_self->dtype_is_object);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 228, __pyx_L1_error)
9403 __Pyx_GOTREF(__pyx_t_2);
9404 __pyx_t_3 = PyTuple_New(3);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 228, __pyx_L1_error)
9405 __Pyx_GOTREF(__pyx_t_3);
9406 __Pyx_INCREF(((PyObject *)__pyx_v_self));
9407 __Pyx_GIVEREF(((PyObject *)__pyx_v_self));
9408 PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_v_self));
9409 __Pyx_GIVEREF(__pyx_t_1);
9410 PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_1);
9411 __Pyx_GIVEREF(__pyx_t_2);
9412 PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_t_2);
9415 __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)
9416 __Pyx_GOTREF(__pyx_t_2);
9417 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
9418 __pyx_r = __pyx_t_2;
9432 __Pyx_XDECREF(__pyx_t_1);
9433 __Pyx_XDECREF(__pyx_t_2);
9434 __Pyx_XDECREF(__pyx_t_3);
9435 __Pyx_AddTraceback(
"View.MemoryView.array.get_memview", __pyx_clineno, __pyx_lineno, __pyx_filename);
9438 __Pyx_XGIVEREF(__pyx_r);
9439 __Pyx_RefNannyFinishContext();
9452 static Py_ssize_t __pyx_array___len__(PyObject *__pyx_v_self);
9453 static Py_ssize_t __pyx_array___len__(PyObject *__pyx_v_self) {
9455 __Pyx_RefNannyDeclarations
9456 __Pyx_RefNannySetupContext(
"__len__ (wrapper)", 0);
9457 __pyx_r = __pyx_array___pyx_pf_15View_dot_MemoryView_5array_6__len__(((
struct __pyx_array_obj *)__pyx_v_self));
9460 __Pyx_RefNannyFinishContext();
9464 static Py_ssize_t __pyx_array___pyx_pf_15View_dot_MemoryView_5array_6__len__(
struct __pyx_array_obj *__pyx_v_self) {
9466 __Pyx_RefNannyDeclarations
9467 __Pyx_RefNannySetupContext(
"__len__", 0);
9476 __pyx_r = (__pyx_v_self->_shape[0]);
9489 __Pyx_RefNannyFinishContext();
9502 static PyObject *__pyx_array___getattr__(PyObject *__pyx_v_self, PyObject *__pyx_v_attr);
9503 static PyObject *__pyx_array___getattr__(PyObject *__pyx_v_self, PyObject *__pyx_v_attr) {
9504 PyObject *__pyx_r = 0;
9505 __Pyx_RefNannyDeclarations
9506 __Pyx_RefNannySetupContext(
"__getattr__ (wrapper)", 0);
9507 __pyx_r = __pyx_array___pyx_pf_15View_dot_MemoryView_5array_8__getattr__(((
struct __pyx_array_obj *)__pyx_v_self), ((PyObject *)__pyx_v_attr));
9510 __Pyx_RefNannyFinishContext();
9514 static PyObject *__pyx_array___pyx_pf_15View_dot_MemoryView_5array_8__getattr__(
struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_attr) {
9515 PyObject *__pyx_r = NULL;
9516 __Pyx_RefNannyDeclarations
9517 PyObject *__pyx_t_1 = NULL;
9518 PyObject *__pyx_t_2 = NULL;
9519 int __pyx_lineno = 0;
9520 const char *__pyx_filename = NULL;
9521 int __pyx_clineno = 0;
9522 __Pyx_RefNannySetupContext(
"__getattr__", 0);
9531 __Pyx_XDECREF(__pyx_r);
9532 __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)
9533 __Pyx_GOTREF(__pyx_t_1);
9534 __pyx_t_2 = __Pyx_GetAttr(__pyx_t_1, __pyx_v_attr);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 234, __pyx_L1_error)
9535 __Pyx_GOTREF(__pyx_t_2);
9536 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
9537 __pyx_r = __pyx_t_2;
9551 __Pyx_XDECREF(__pyx_t_1);
9552 __Pyx_XDECREF(__pyx_t_2);
9553 __Pyx_AddTraceback(
"View.MemoryView.array.__getattr__", __pyx_clineno, __pyx_lineno, __pyx_filename);
9556 __Pyx_XGIVEREF(__pyx_r);
9557 __Pyx_RefNannyFinishContext();
9570 static PyObject *__pyx_array___getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_item);
9571 static PyObject *__pyx_array___getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_item) {
9572 PyObject *__pyx_r = 0;
9573 __Pyx_RefNannyDeclarations
9574 __Pyx_RefNannySetupContext(
"__getitem__ (wrapper)", 0);
9575 __pyx_r = __pyx_array___pyx_pf_15View_dot_MemoryView_5array_10__getitem__(((
struct __pyx_array_obj *)__pyx_v_self), ((PyObject *)__pyx_v_item));
9578 __Pyx_RefNannyFinishContext();
9582 static PyObject *__pyx_array___pyx_pf_15View_dot_MemoryView_5array_10__getitem__(
struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_item) {
9583 PyObject *__pyx_r = NULL;
9584 __Pyx_RefNannyDeclarations
9585 PyObject *__pyx_t_1 = NULL;
9586 PyObject *__pyx_t_2 = NULL;
9587 int __pyx_lineno = 0;
9588 const char *__pyx_filename = NULL;
9589 int __pyx_clineno = 0;
9590 __Pyx_RefNannySetupContext(
"__getitem__", 0);
9599 __Pyx_XDECREF(__pyx_r);
9600 __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)
9601 __Pyx_GOTREF(__pyx_t_1);
9602 __pyx_t_2 = __Pyx_PyObject_GetItem(__pyx_t_1, __pyx_v_item);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 237, __pyx_L1_error)
9603 __Pyx_GOTREF(__pyx_t_2);
9604 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
9605 __pyx_r = __pyx_t_2;
9619 __Pyx_XDECREF(__pyx_t_1);
9620 __Pyx_XDECREF(__pyx_t_2);
9621 __Pyx_AddTraceback(
"View.MemoryView.array.__getitem__", __pyx_clineno, __pyx_lineno, __pyx_filename);
9624 __Pyx_XGIVEREF(__pyx_r);
9625 __Pyx_RefNannyFinishContext();
9638 static int __pyx_array___setitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_item, PyObject *__pyx_v_value);
9639 static int __pyx_array___setitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_item, PyObject *__pyx_v_value) {
9641 __Pyx_RefNannyDeclarations
9642 __Pyx_RefNannySetupContext(
"__setitem__ (wrapper)", 0);
9643 __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));
9646 __Pyx_RefNannyFinishContext();
9650 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) {
9652 __Pyx_RefNannyDeclarations
9653 PyObject *__pyx_t_1 = NULL;
9654 int __pyx_lineno = 0;
9655 const char *__pyx_filename = NULL;
9656 int __pyx_clineno = 0;
9657 __Pyx_RefNannySetupContext(
"__setitem__", 0);
9666 __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)
9667 __Pyx_GOTREF(__pyx_t_1);
9668 if (unlikely(PyObject_SetItem(__pyx_t_1, __pyx_v_item, __pyx_v_value) < 0)) __PYX_ERR(1, 240, __pyx_L1_error)
9669 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
9683 __Pyx_XDECREF(__pyx_t_1);
9684 __Pyx_AddTraceback(
"View.MemoryView.array.__setitem__", __pyx_clineno, __pyx_lineno, __pyx_filename);
9687 __Pyx_RefNannyFinishContext();
9698 static PyObject *__pyx_pw___pyx_array_1__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused);
9699 static PyObject *__pyx_pw___pyx_array_1__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
9700 PyObject *__pyx_r = 0;
9701 __Pyx_RefNannyDeclarations
9702 __Pyx_RefNannySetupContext(
"__reduce_cython__ (wrapper)", 0);
9703 __pyx_r = __pyx_pf___pyx_array___reduce_cython__(((
struct __pyx_array_obj *)__pyx_v_self));
9706 __Pyx_RefNannyFinishContext();
9710 static PyObject *__pyx_pf___pyx_array___reduce_cython__(CYTHON_UNUSED
struct __pyx_array_obj *__pyx_v_self) {
9711 PyObject *__pyx_r = NULL;
9712 __Pyx_RefNannyDeclarations
9713 PyObject *__pyx_t_1 = NULL;
9714 int __pyx_lineno = 0;
9715 const char *__pyx_filename = NULL;
9716 int __pyx_clineno = 0;
9717 __Pyx_RefNannySetupContext(
"__reduce_cython__", 0);
9725 __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__12, NULL);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 2, __pyx_L1_error)
9726 __Pyx_GOTREF(__pyx_t_1);
9727 __Pyx_Raise(__pyx_t_1, 0, 0, 0);
9728 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
9729 __PYX_ERR(1, 2, __pyx_L1_error)
9739 __Pyx_XDECREF(__pyx_t_1);
9740 __Pyx_AddTraceback(
"View.MemoryView.array.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
9742 __Pyx_XGIVEREF(__pyx_r);
9743 __Pyx_RefNannyFinishContext();
9755 static PyObject *__pyx_pw___pyx_array_3__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state);
9756 static PyObject *__pyx_pw___pyx_array_3__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
9757 PyObject *__pyx_r = 0;
9758 __Pyx_RefNannyDeclarations
9759 __Pyx_RefNannySetupContext(
"__setstate_cython__ (wrapper)", 0);
9760 __pyx_r = __pyx_pf___pyx_array_2__setstate_cython__(((
struct __pyx_array_obj *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state));
9763 __Pyx_RefNannyFinishContext();
9767 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) {
9768 PyObject *__pyx_r = NULL;
9769 __Pyx_RefNannyDeclarations
9770 PyObject *__pyx_t_1 = NULL;
9771 int __pyx_lineno = 0;
9772 const char *__pyx_filename = NULL;
9773 int __pyx_clineno = 0;
9774 __Pyx_RefNannySetupContext(
"__setstate_cython__", 0);
9781 __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)
9782 __Pyx_GOTREF(__pyx_t_1);
9783 __Pyx_Raise(__pyx_t_1, 0, 0, 0);
9784 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
9785 __PYX_ERR(1, 4, __pyx_L1_error)
9796 __Pyx_XDECREF(__pyx_t_1);
9797 __Pyx_AddTraceback(
"View.MemoryView.array.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
9799 __Pyx_XGIVEREF(__pyx_r);
9800 __Pyx_RefNannyFinishContext();
9812 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) {
9813 struct __pyx_array_obj *__pyx_v_result = 0;
9814 struct __pyx_array_obj *__pyx_r = NULL;
9815 __Pyx_RefNannyDeclarations
9817 PyObject *__pyx_t_2 = NULL;
9818 PyObject *__pyx_t_3 = NULL;
9819 PyObject *__pyx_t_4 = NULL;
9820 PyObject *__pyx_t_5 = NULL;
9821 int __pyx_lineno = 0;
9822 const char *__pyx_filename = NULL;
9823 int __pyx_clineno = 0;
9824 __Pyx_RefNannySetupContext(
"array_cwrapper", 0);
9833 __pyx_t_1 = ((__pyx_v_buf == NULL) != 0);
9843 __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_itemsize);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 249, __pyx_L1_error)
9844 __Pyx_GOTREF(__pyx_t_2);
9845 __pyx_t_3 = __Pyx_PyBytes_FromString(__pyx_v_format);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 249, __pyx_L1_error)
9846 __Pyx_GOTREF(__pyx_t_3);
9847 __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)
9848 __Pyx_GOTREF(__pyx_t_4);
9849 __pyx_t_5 = PyTuple_New(4);
if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 249, __pyx_L1_error)
9850 __Pyx_GOTREF(__pyx_t_5);
9851 __Pyx_INCREF(__pyx_v_shape);
9852 __Pyx_GIVEREF(__pyx_v_shape);
9853 PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_v_shape);
9854 __Pyx_GIVEREF(__pyx_t_2);
9855 PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_2);
9856 __Pyx_GIVEREF(__pyx_t_3);
9857 PyTuple_SET_ITEM(__pyx_t_5, 2, __pyx_t_3);
9858 __Pyx_GIVEREF(__pyx_t_4);
9859 PyTuple_SET_ITEM(__pyx_t_5, 3, __pyx_t_4);
9863 __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)
9864 __Pyx_GOTREF(__pyx_t_4);
9865 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
9866 __pyx_v_result = ((
struct __pyx_array_obj *)__pyx_t_4);
9887 __pyx_t_4 = PyInt_FromSsize_t(__pyx_v_itemsize);
if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 251, __pyx_L1_error)
9888 __Pyx_GOTREF(__pyx_t_4);
9889 __pyx_t_5 = __Pyx_PyBytes_FromString(__pyx_v_format);
if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 251, __pyx_L1_error)
9890 __Pyx_GOTREF(__pyx_t_5);
9891 __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)
9892 __Pyx_GOTREF(__pyx_t_3);
9893 __pyx_t_2 = PyTuple_New(4);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 251, __pyx_L1_error)
9894 __Pyx_GOTREF(__pyx_t_2);
9895 __Pyx_INCREF(__pyx_v_shape);
9896 __Pyx_GIVEREF(__pyx_v_shape);
9897 PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_shape);
9898 __Pyx_GIVEREF(__pyx_t_4);
9899 PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_4);
9900 __Pyx_GIVEREF(__pyx_t_5);
9901 PyTuple_SET_ITEM(__pyx_t_2, 2, __pyx_t_5);
9902 __Pyx_GIVEREF(__pyx_t_3);
9903 PyTuple_SET_ITEM(__pyx_t_2, 3, __pyx_t_3);
9915 __pyx_t_3 = __Pyx_PyDict_NewPresized(1);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 252, __pyx_L1_error)
9916 __Pyx_GOTREF(__pyx_t_3);
9917 if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_allocate_buffer, Py_False) < 0) __PYX_ERR(1, 252, __pyx_L1_error)
9926 __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)
9927 __Pyx_GOTREF(__pyx_t_5);
9928 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
9929 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
9930 __pyx_v_result = ((
struct __pyx_array_obj *)__pyx_t_5);
9940 __pyx_v_result->data = __pyx_v_buf;
9951 __Pyx_XDECREF(((PyObject *)__pyx_r));
9952 __Pyx_INCREF(((PyObject *)__pyx_v_result));
9953 __pyx_r = __pyx_v_result;
9966 __Pyx_XDECREF(__pyx_t_2);
9967 __Pyx_XDECREF(__pyx_t_3);
9968 __Pyx_XDECREF(__pyx_t_4);
9969 __Pyx_XDECREF(__pyx_t_5);
9970 __Pyx_AddTraceback(
"View.MemoryView.array_cwrapper", __pyx_clineno, __pyx_lineno, __pyx_filename);
9973 __Pyx_XDECREF((PyObject *)__pyx_v_result);
9974 __Pyx_XGIVEREF((PyObject *)__pyx_r);
9975 __Pyx_RefNannyFinishContext();
9988 static int __pyx_MemviewEnum___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
9989 static int __pyx_MemviewEnum___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
9990 PyObject *__pyx_v_name = 0;
9991 int __pyx_lineno = 0;
9992 const char *__pyx_filename = NULL;
9993 int __pyx_clineno = 0;
9995 __Pyx_RefNannyDeclarations
9996 __Pyx_RefNannySetupContext(
"__init__ (wrapper)", 0);
9998 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_name,0};
9999 PyObject* values[1] = {0};
10000 if (unlikely(__pyx_kwds)) {
10001 Py_ssize_t kw_args;
10002 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
10003 switch (pos_args) {
10004 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
10005 CYTHON_FALLTHROUGH;
10007 default:
goto __pyx_L5_argtuple_error;
10009 kw_args = PyDict_Size(__pyx_kwds);
10010 switch (pos_args) {
10012 if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_name)) != 0)) kw_args--;
10013 else goto __pyx_L5_argtuple_error;
10015 if (unlikely(kw_args > 0)) {
10016 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args,
"__init__") < 0)) __PYX_ERR(1, 281, __pyx_L3_error)
10018 }
else if (PyTuple_GET_SIZE(__pyx_args) != 1) {
10019 goto __pyx_L5_argtuple_error;
10021 values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
10023 __pyx_v_name = values[0];
10025 goto __pyx_L4_argument_unpacking_done;
10026 __pyx_L5_argtuple_error:;
10027 __Pyx_RaiseArgtupleInvalid(
"__init__", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(1, 281, __pyx_L3_error)
10029 __Pyx_AddTraceback(
"View.MemoryView.Enum.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
10030 __Pyx_RefNannyFinishContext();
10032 __pyx_L4_argument_unpacking_done:;
10033 __pyx_r = __pyx_MemviewEnum___pyx_pf_15View_dot_MemoryView_4Enum___init__(((
struct __pyx_MemviewEnum_obj *)__pyx_v_self), __pyx_v_name);
10036 __Pyx_RefNannyFinishContext();
10040 static int __pyx_MemviewEnum___pyx_pf_15View_dot_MemoryView_4Enum___init__(
struct __pyx_MemviewEnum_obj *__pyx_v_self, PyObject *__pyx_v_name) {
10042 __Pyx_RefNannyDeclarations
10043 __Pyx_RefNannySetupContext(
"__init__", 0);
10052 __Pyx_INCREF(__pyx_v_name);
10053 __Pyx_GIVEREF(__pyx_v_name);
10054 __Pyx_GOTREF(__pyx_v_self->name);
10055 __Pyx_DECREF(__pyx_v_self->name);
10056 __pyx_v_self->name = __pyx_v_name;
10068 __Pyx_RefNannyFinishContext();
10081 static PyObject *__pyx_MemviewEnum___repr__(PyObject *__pyx_v_self);
10082 static PyObject *__pyx_MemviewEnum___repr__(PyObject *__pyx_v_self) {
10083 PyObject *__pyx_r = 0;
10084 __Pyx_RefNannyDeclarations
10085 __Pyx_RefNannySetupContext(
"__repr__ (wrapper)", 0);
10086 __pyx_r = __pyx_MemviewEnum___pyx_pf_15View_dot_MemoryView_4Enum_2__repr__(((
struct __pyx_MemviewEnum_obj *)__pyx_v_self));
10089 __Pyx_RefNannyFinishContext();
10093 static PyObject *__pyx_MemviewEnum___pyx_pf_15View_dot_MemoryView_4Enum_2__repr__(
struct __pyx_MemviewEnum_obj *__pyx_v_self) {
10094 PyObject *__pyx_r = NULL;
10095 __Pyx_RefNannyDeclarations
10096 __Pyx_RefNannySetupContext(
"__repr__", 0);
10105 __Pyx_XDECREF(__pyx_r);
10106 __Pyx_INCREF(__pyx_v_self->name);
10107 __pyx_r = __pyx_v_self->name;
10120 __Pyx_XGIVEREF(__pyx_r);
10121 __Pyx_RefNannyFinishContext();
10132 static PyObject *__pyx_pw___pyx_MemviewEnum_1__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused);
10133 static PyObject *__pyx_pw___pyx_MemviewEnum_1__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
10134 PyObject *__pyx_r = 0;
10135 __Pyx_RefNannyDeclarations
10136 __Pyx_RefNannySetupContext(
"__reduce_cython__ (wrapper)", 0);
10137 __pyx_r = __pyx_pf___pyx_MemviewEnum___reduce_cython__(((
struct __pyx_MemviewEnum_obj *)__pyx_v_self));
10140 __Pyx_RefNannyFinishContext();
10144 static PyObject *__pyx_pf___pyx_MemviewEnum___reduce_cython__(
struct __pyx_MemviewEnum_obj *__pyx_v_self) {
10145 PyObject *__pyx_v_state = 0;
10146 PyObject *__pyx_v__dict = 0;
10147 int __pyx_v_use_setstate;
10148 PyObject *__pyx_r = NULL;
10149 __Pyx_RefNannyDeclarations
10150 PyObject *__pyx_t_1 = NULL;
10153 PyObject *__pyx_t_4 = NULL;
10154 PyObject *__pyx_t_5 = NULL;
10155 int __pyx_lineno = 0;
10156 const char *__pyx_filename = NULL;
10157 int __pyx_clineno = 0;
10158 __Pyx_RefNannySetupContext(
"__reduce_cython__", 0);
10167 __pyx_t_1 = PyTuple_New(1);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 5, __pyx_L1_error)
10168 __Pyx_GOTREF(__pyx_t_1);
10169 __Pyx_INCREF(__pyx_v_self->name);
10170 __Pyx_GIVEREF(__pyx_v_self->name);
10171 PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_self->name);
10172 __pyx_v_state = ((PyObject*)__pyx_t_1);
10182 __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)
10183 __Pyx_GOTREF(__pyx_t_1);
10184 __pyx_v__dict = __pyx_t_1;
10194 __pyx_t_2 = (__pyx_v__dict != Py_None);
10195 __pyx_t_3 = (__pyx_t_2 != 0);
10205 __pyx_t_1 = PyTuple_New(1);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 8, __pyx_L1_error)
10206 __Pyx_GOTREF(__pyx_t_1);
10207 __Pyx_INCREF(__pyx_v__dict);
10208 __Pyx_GIVEREF(__pyx_v__dict);
10209 PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v__dict);
10210 __pyx_t_4 = PyNumber_InPlaceAdd(__pyx_v_state, __pyx_t_1);
if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 8, __pyx_L1_error)
10211 __Pyx_GOTREF(__pyx_t_4);
10212 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
10213 __Pyx_DECREF_SET(__pyx_v_state, ((PyObject*)__pyx_t_4));
10223 __pyx_v_use_setstate = 1;
10243 __pyx_t_3 = (__pyx_v_self->name != Py_None);
10244 __pyx_v_use_setstate = __pyx_t_3;
10255 __pyx_t_3 = (__pyx_v_use_setstate != 0);
10265 __Pyx_XDECREF(__pyx_r);
10266 __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_pyx_unpickle_Enum);
if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 13, __pyx_L1_error)
10267 __Pyx_GOTREF(__pyx_t_4);
10268 __pyx_t_1 = PyTuple_New(3);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 13, __pyx_L1_error)
10269 __Pyx_GOTREF(__pyx_t_1);
10270 __Pyx_INCREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
10271 __Pyx_GIVEREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
10272 PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
10273 __Pyx_INCREF(__pyx_int_184977713);
10274 __Pyx_GIVEREF(__pyx_int_184977713);
10275 PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_int_184977713);
10276 __Pyx_INCREF(Py_None);
10277 __Pyx_GIVEREF(Py_None);
10278 PyTuple_SET_ITEM(__pyx_t_1, 2, Py_None);
10279 __pyx_t_5 = PyTuple_New(3);
if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 13, __pyx_L1_error)
10280 __Pyx_GOTREF(__pyx_t_5);
10281 __Pyx_GIVEREF(__pyx_t_4);
10282 PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4);
10283 __Pyx_GIVEREF(__pyx_t_1);
10284 PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_1);
10285 __Pyx_INCREF(__pyx_v_state);
10286 __Pyx_GIVEREF(__pyx_v_state);
10287 PyTuple_SET_ITEM(__pyx_t_5, 2, __pyx_v_state);
10290 __pyx_r = __pyx_t_5;
10311 __Pyx_XDECREF(__pyx_r);
10312 __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_pyx_unpickle_Enum);
if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 15, __pyx_L1_error)
10313 __Pyx_GOTREF(__pyx_t_5);
10314 __pyx_t_1 = PyTuple_New(3);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 15, __pyx_L1_error)
10315 __Pyx_GOTREF(__pyx_t_1);
10316 __Pyx_INCREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
10317 __Pyx_GIVEREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
10318 PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
10319 __Pyx_INCREF(__pyx_int_184977713);
10320 __Pyx_GIVEREF(__pyx_int_184977713);
10321 PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_int_184977713);
10322 __Pyx_INCREF(__pyx_v_state);
10323 __Pyx_GIVEREF(__pyx_v_state);
10324 PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_v_state);
10325 __pyx_t_4 = PyTuple_New(2);
if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 15, __pyx_L1_error)
10326 __Pyx_GOTREF(__pyx_t_4);
10327 __Pyx_GIVEREF(__pyx_t_5);
10328 PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_5);
10329 __Pyx_GIVEREF(__pyx_t_1);
10330 PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_1);
10333 __pyx_r = __pyx_t_4;
10346 __Pyx_XDECREF(__pyx_t_1);
10347 __Pyx_XDECREF(__pyx_t_4);
10348 __Pyx_XDECREF(__pyx_t_5);
10349 __Pyx_AddTraceback(
"View.MemoryView.Enum.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
10352 __Pyx_XDECREF(__pyx_v_state);
10353 __Pyx_XDECREF(__pyx_v__dict);
10354 __Pyx_XGIVEREF(__pyx_r);
10355 __Pyx_RefNannyFinishContext();
10367 static PyObject *__pyx_pw___pyx_MemviewEnum_3__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state);
10368 static PyObject *__pyx_pw___pyx_MemviewEnum_3__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
10369 PyObject *__pyx_r = 0;
10370 __Pyx_RefNannyDeclarations
10371 __Pyx_RefNannySetupContext(
"__setstate_cython__ (wrapper)", 0);
10372 __pyx_r = __pyx_pf___pyx_MemviewEnum_2__setstate_cython__(((
struct __pyx_MemviewEnum_obj *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state));
10375 __Pyx_RefNannyFinishContext();
10379 static PyObject *__pyx_pf___pyx_MemviewEnum_2__setstate_cython__(
struct __pyx_MemviewEnum_obj *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
10380 PyObject *__pyx_r = NULL;
10381 __Pyx_RefNannyDeclarations
10382 PyObject *__pyx_t_1 = NULL;
10383 int __pyx_lineno = 0;
10384 const char *__pyx_filename = NULL;
10385 int __pyx_clineno = 0;
10386 __Pyx_RefNannySetupContext(
"__setstate_cython__", 0);
10393 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)
10394 __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)
10395 __Pyx_GOTREF(__pyx_t_1);
10396 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
10406 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
10409 __Pyx_XDECREF(__pyx_t_1);
10410 __Pyx_AddTraceback(
"View.MemoryView.Enum.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
10413 __Pyx_XGIVEREF(__pyx_r);
10414 __Pyx_RefNannyFinishContext();
10426 static void *__pyx_align_pointer(
void *__pyx_v_memory,
size_t __pyx_v_alignment) {
10427 Py_intptr_t __pyx_v_aligned_p;
10428 size_t __pyx_v_offset;
10439 __pyx_v_aligned_p = ((Py_intptr_t)__pyx_v_memory);
10448 __pyx_v_offset = (__pyx_v_aligned_p % __pyx_v_alignment);
10457 __pyx_t_1 = ((__pyx_v_offset > 0) != 0);
10467 __pyx_v_aligned_p = (__pyx_v_aligned_p + (__pyx_v_alignment - __pyx_v_offset));
10485 __pyx_r = ((
void *)__pyx_v_aligned_p);
10510 static int __pyx_memoryview___cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
10511 static int __pyx_memoryview___cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
10512 PyObject *__pyx_v_obj = 0;
10514 int __pyx_v_dtype_is_object;
10515 int __pyx_lineno = 0;
10516 const char *__pyx_filename = NULL;
10517 int __pyx_clineno = 0;
10519 __Pyx_RefNannyDeclarations
10520 __Pyx_RefNannySetupContext(
"__cinit__ (wrapper)", 0);
10522 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_obj,&__pyx_n_s_flags,&__pyx_n_s_dtype_is_object,0};
10523 PyObject* values[3] = {0,0,0};
10524 if (unlikely(__pyx_kwds)) {
10525 Py_ssize_t kw_args;
10526 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
10527 switch (pos_args) {
10528 case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
10529 CYTHON_FALLTHROUGH;
10530 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
10531 CYTHON_FALLTHROUGH;
10532 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
10533 CYTHON_FALLTHROUGH;
10535 default:
goto __pyx_L5_argtuple_error;
10537 kw_args = PyDict_Size(__pyx_kwds);
10538 switch (pos_args) {
10540 if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_obj)) != 0)) kw_args--;
10541 else goto __pyx_L5_argtuple_error;
10542 CYTHON_FALLTHROUGH;
10544 if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_flags)) != 0)) kw_args--;
10546 __Pyx_RaiseArgtupleInvalid(
"__cinit__", 0, 2, 3, 1); __PYX_ERR(1, 345, __pyx_L3_error)
10548 CYTHON_FALLTHROUGH;
10551 PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_dtype_is_object);
10552 if (value) { values[2] = value; kw_args--; }
10555 if (unlikely(kw_args > 0)) {
10556 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args,
"__cinit__") < 0)) __PYX_ERR(1, 345, __pyx_L3_error)
10559 switch (PyTuple_GET_SIZE(__pyx_args)) {
10560 case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
10561 CYTHON_FALLTHROUGH;
10562 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
10563 values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
10565 default:
goto __pyx_L5_argtuple_error;
10568 __pyx_v_obj = values[0];
10569 __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)
10571 __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)
10573 __pyx_v_dtype_is_object = ((int)0);
10576 goto __pyx_L4_argument_unpacking_done;
10577 __pyx_L5_argtuple_error:;
10578 __Pyx_RaiseArgtupleInvalid(
"__cinit__", 0, 2, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(1, 345, __pyx_L3_error)
10580 __Pyx_AddTraceback(
"View.MemoryView.memoryview.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
10581 __Pyx_RefNannyFinishContext();
10583 __pyx_L4_argument_unpacking_done:;
10584 __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);
10587 __Pyx_RefNannyFinishContext();
10591 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) {
10593 __Pyx_RefNannyDeclarations
10598 int __pyx_lineno = 0;
10599 const char *__pyx_filename = NULL;
10600 int __pyx_clineno = 0;
10601 __Pyx_RefNannySetupContext(
"__cinit__", 0);
10610 __Pyx_INCREF(__pyx_v_obj);
10611 __Pyx_GIVEREF(__pyx_v_obj);
10612 __Pyx_GOTREF(__pyx_v_self->obj);
10613 __Pyx_DECREF(__pyx_v_self->obj);
10614 __pyx_v_self->obj = __pyx_v_obj;
10623 __pyx_v_self->flags = __pyx_v_flags;
10632 __pyx_t_2 = (((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))) == ((PyObject *)__pyx_memoryview_type));
10633 __pyx_t_3 = (__pyx_t_2 != 0);
10636 __pyx_t_1 = __pyx_t_3;
10637 goto __pyx_L4_bool_binop_done;
10639 __pyx_t_3 = (__pyx_v_obj != Py_None);
10640 __pyx_t_2 = (__pyx_t_3 != 0);
10641 __pyx_t_1 = __pyx_t_2;
10642 __pyx_L4_bool_binop_done:;
10652 __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)
10661 __pyx_t_1 = ((((PyObject *)__pyx_v_self->view.obj) == NULL) != 0);
10671 ((Py_buffer *)(&__pyx_v_self->view))->obj = Py_None;
10680 Py_INCREF(Py_None);
10707 __pyx_t_1 = ((__pyx_memoryview_thread_locks_used < 8) != 0);
10717 __pyx_v_self->lock = (__pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used]);
10726 __pyx_memoryview_thread_locks_used = (__pyx_memoryview_thread_locks_used + 1);
10744 __pyx_t_1 = ((__pyx_v_self->lock == NULL) != 0);
10754 __pyx_v_self->lock = PyThread_allocate_lock();
10763 __pyx_t_1 = ((__pyx_v_self->lock == NULL) != 0);
10764 if (unlikely(__pyx_t_1)) {
10773 PyErr_NoMemory(); __PYX_ERR(1, 361, __pyx_L1_error)
10800 __pyx_t_1 = ((__pyx_v_flags & PyBUF_FORMAT) != 0);
10810 __pyx_t_2 = (((__pyx_v_self->view.format[0]) ==
'O') != 0);
10813 __pyx_t_1 = __pyx_t_2;
10814 goto __pyx_L11_bool_binop_done;
10816 __pyx_t_2 = (((__pyx_v_self->view.format[1]) ==
'\x00') != 0);
10817 __pyx_t_1 = __pyx_t_2;
10818 __pyx_L11_bool_binop_done:;
10819 __pyx_v_self->dtype_is_object = __pyx_t_1;
10839 __pyx_v_self->dtype_is_object = __pyx_v_dtype_is_object;
10850 __pyx_v_self->acquisition_count_aligned_p = ((__pyx_atomic_int *)__pyx_align_pointer(((
void *)(&(__pyx_v_self->acquisition_count[0]))), (
sizeof(__pyx_atomic_int))));
10859 __pyx_v_self->typeinfo = NULL;
10873 __Pyx_AddTraceback(
"View.MemoryView.memoryview.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
10876 __Pyx_RefNannyFinishContext();
10889 static void __pyx_memoryview___dealloc__(PyObject *__pyx_v_self);
10890 static void __pyx_memoryview___dealloc__(PyObject *__pyx_v_self) {
10891 __Pyx_RefNannyDeclarations
10892 __Pyx_RefNannySetupContext(
"__dealloc__ (wrapper)", 0);
10893 __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_2__dealloc__(((
struct __pyx_memoryview_obj *)__pyx_v_self));
10896 __Pyx_RefNannyFinishContext();
10899 static void __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_2__dealloc__(
struct __pyx_memoryview_obj *__pyx_v_self) {
10901 __Pyx_RefNannyDeclarations
10907 PyThread_type_lock __pyx_t_6;
10908 PyThread_type_lock __pyx_t_7;
10909 __Pyx_RefNannySetupContext(
"__dealloc__", 0);
10918 __pyx_t_1 = (__pyx_v_self->obj != Py_None);
10919 __pyx_t_2 = (__pyx_t_1 != 0);
10929 __Pyx_ReleaseBuffer((&__pyx_v_self->view));
10948 __pyx_t_2 = ((((Py_buffer *)(&__pyx_v_self->view))->obj == Py_None) != 0);
10958 ((Py_buffer *)(&__pyx_v_self->view))->obj = NULL;
10967 Py_DECREF(Py_None);
10986 __pyx_t_2 = ((__pyx_v_self->lock != NULL) != 0);
10996 __pyx_t_3 = __pyx_memoryview_thread_locks_used;
10997 __pyx_t_4 = __pyx_t_3;
10998 for (__pyx_t_5 = 0; __pyx_t_5 < __pyx_t_4; __pyx_t_5+=1) {
10999 __pyx_v_i = __pyx_t_5;
11008 __pyx_t_2 = (((__pyx_memoryview_thread_locks[__pyx_v_i]) == __pyx_v_self->lock) != 0);
11018 __pyx_memoryview_thread_locks_used = (__pyx_memoryview_thread_locks_used - 1);
11027 __pyx_t_2 = ((__pyx_v_i != __pyx_memoryview_thread_locks_used) != 0);
11037 __pyx_t_6 = (__pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used]);
11038 __pyx_t_7 = (__pyx_memoryview_thread_locks[__pyx_v_i]);
11047 (__pyx_memoryview_thread_locks[__pyx_v_i]) = __pyx_t_6;
11048 (__pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used]) = __pyx_t_7;
11066 goto __pyx_L6_break;
11086 PyThread_free_lock(__pyx_v_self->lock);
11108 __Pyx_RefNannyFinishContext();
11119 static char *__pyx_memoryview_get_item_pointer(
struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index) {
11120 Py_ssize_t __pyx_v_dim;
11121 char *__pyx_v_itemp;
11122 PyObject *__pyx_v_idx = NULL;
11124 __Pyx_RefNannyDeclarations
11125 Py_ssize_t __pyx_t_1;
11126 PyObject *__pyx_t_2 = NULL;
11127 Py_ssize_t __pyx_t_3;
11128 PyObject *(*__pyx_t_4)(PyObject *);
11129 PyObject *__pyx_t_5 = NULL;
11130 Py_ssize_t __pyx_t_6;
11132 int __pyx_lineno = 0;
11133 const char *__pyx_filename = NULL;
11134 int __pyx_clineno = 0;
11135 __Pyx_RefNannySetupContext(
"get_item_pointer", 0);
11144 __pyx_v_itemp = ((
char *)__pyx_v_self->view.buf);
11154 if (likely(PyList_CheckExact(__pyx_v_index)) || PyTuple_CheckExact(__pyx_v_index)) {
11155 __pyx_t_2 = __pyx_v_index; __Pyx_INCREF(__pyx_t_2); __pyx_t_3 = 0;
11158 __pyx_t_3 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_v_index);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 397, __pyx_L1_error)
11159 __Pyx_GOTREF(__pyx_t_2);
11160 __pyx_t_4 = Py_TYPE(__pyx_t_2)->tp_iternext;
if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 397, __pyx_L1_error)
11163 if (likely(!__pyx_t_4)) {
11164 if (likely(PyList_CheckExact(__pyx_t_2))) {
11165 if (__pyx_t_3 >= PyList_GET_SIZE(__pyx_t_2))
break;
11166 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
11167 __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)
11169 __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)
11170 __Pyx_GOTREF(__pyx_t_5);
11173 if (__pyx_t_3 >= PyTuple_GET_SIZE(__pyx_t_2))
break;
11174 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
11175 __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)
11177 __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)
11178 __Pyx_GOTREF(__pyx_t_5);
11182 __pyx_t_5 = __pyx_t_4(__pyx_t_2);
11183 if (unlikely(!__pyx_t_5)) {
11184 PyObject* exc_type = PyErr_Occurred();
11186 if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
11187 else __PYX_ERR(1, 397, __pyx_L1_error)
11191 __Pyx_GOTREF(__pyx_t_5);
11193 __Pyx_XDECREF_SET(__pyx_v_idx, __pyx_t_5);
11195 __pyx_v_dim = __pyx_t_1;
11196 __pyx_t_1 = (__pyx_t_1 + 1);
11205 __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)
11206 __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)
11207 __pyx_v_itemp = __pyx_t_7;
11217 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
11226 __pyx_r = __pyx_v_itemp;
11239 __Pyx_XDECREF(__pyx_t_2);
11240 __Pyx_XDECREF(__pyx_t_5);
11241 __Pyx_AddTraceback(
"View.MemoryView.memoryview.get_item_pointer", __pyx_clineno, __pyx_lineno, __pyx_filename);
11244 __Pyx_XDECREF(__pyx_v_idx);
11245 __Pyx_RefNannyFinishContext();
11258 static PyObject *__pyx_memoryview___getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_index);
11259 static PyObject *__pyx_memoryview___getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_index) {
11260 PyObject *__pyx_r = 0;
11261 __Pyx_RefNannyDeclarations
11262 __Pyx_RefNannySetupContext(
"__getitem__ (wrapper)", 0);
11263 __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_4__getitem__(((
struct __pyx_memoryview_obj *)__pyx_v_self), ((PyObject *)__pyx_v_index));
11266 __Pyx_RefNannyFinishContext();
11270 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_4__getitem__(
struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index) {
11271 PyObject *__pyx_v_have_slices = NULL;
11272 PyObject *__pyx_v_indices = NULL;
11273 char *__pyx_v_itemp;
11274 PyObject *__pyx_r = NULL;
11275 __Pyx_RefNannyDeclarations
11278 PyObject *__pyx_t_3 = NULL;
11279 PyObject *__pyx_t_4 = NULL;
11280 PyObject *__pyx_t_5 = NULL;
11282 int __pyx_lineno = 0;
11283 const char *__pyx_filename = NULL;
11284 int __pyx_clineno = 0;
11285 __Pyx_RefNannySetupContext(
"__getitem__", 0);
11294 __pyx_t_1 = (__pyx_v_index == __pyx_builtin_Ellipsis);
11295 __pyx_t_2 = (__pyx_t_1 != 0);
11305 __Pyx_XDECREF(__pyx_r);
11306 __Pyx_INCREF(((PyObject *)__pyx_v_self));
11307 __pyx_r = ((PyObject *)__pyx_v_self);
11326 __pyx_t_3 = _unellipsify(__pyx_v_index, __pyx_v_self->view.ndim);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 407, __pyx_L1_error)
11327 __Pyx_GOTREF(__pyx_t_3);
11328 if (likely(__pyx_t_3 != Py_None)) {
11329 PyObject* sequence = __pyx_t_3;
11330 Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
11331 if (unlikely(size != 2)) {
11332 if (size > 2) __Pyx_RaiseTooManyValuesError(2);
11333 else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
11334 __PYX_ERR(1, 407, __pyx_L1_error)
11336 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
11337 __pyx_t_4 = PyTuple_GET_ITEM(sequence, 0);
11338 __pyx_t_5 = PyTuple_GET_ITEM(sequence, 1);
11339 __Pyx_INCREF(__pyx_t_4);
11340 __Pyx_INCREF(__pyx_t_5);
11342 __pyx_t_4 = PySequence_ITEM(sequence, 0);
if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 407, __pyx_L1_error)
11343 __Pyx_GOTREF(__pyx_t_4);
11344 __pyx_t_5 = PySequence_ITEM(sequence, 1);
if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 407, __pyx_L1_error)
11345 __Pyx_GOTREF(__pyx_t_5);
11347 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
11349 __Pyx_RaiseNoneNotIterableError(); __PYX_ERR(1, 407, __pyx_L1_error)
11351 __pyx_v_have_slices = __pyx_t_4;
11353 __pyx_v_indices = __pyx_t_5;
11363 __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_have_slices);
if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(1, 410, __pyx_L1_error)
11373 __Pyx_XDECREF(__pyx_r);
11374 __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)
11375 __Pyx_GOTREF(__pyx_t_3);
11376 __pyx_r = __pyx_t_3;
11397 __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)
11398 __pyx_v_itemp = __pyx_t_6;
11407 __Pyx_XDECREF(__pyx_r);
11408 __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)
11409 __Pyx_GOTREF(__pyx_t_3);
11410 __pyx_r = __pyx_t_3;
11425 __Pyx_XDECREF(__pyx_t_3);
11426 __Pyx_XDECREF(__pyx_t_4);
11427 __Pyx_XDECREF(__pyx_t_5);
11428 __Pyx_AddTraceback(
"View.MemoryView.memoryview.__getitem__", __pyx_clineno, __pyx_lineno, __pyx_filename);
11431 __Pyx_XDECREF(__pyx_v_have_slices);
11432 __Pyx_XDECREF(__pyx_v_indices);
11433 __Pyx_XGIVEREF(__pyx_r);
11434 __Pyx_RefNannyFinishContext();
11447 static int __pyx_memoryview___setitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_index, PyObject *__pyx_v_value);
11448 static int __pyx_memoryview___setitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_index, PyObject *__pyx_v_value) {
11450 __Pyx_RefNannyDeclarations
11451 __Pyx_RefNannySetupContext(
"__setitem__ (wrapper)", 0);
11452 __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));
11455 __Pyx_RefNannyFinishContext();
11459 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) {
11460 PyObject *__pyx_v_have_slices = NULL;
11461 PyObject *__pyx_v_obj = NULL;
11463 __Pyx_RefNannyDeclarations
11465 PyObject *__pyx_t_2 = NULL;
11466 PyObject *__pyx_t_3 = NULL;
11467 PyObject *__pyx_t_4 = NULL;
11468 int __pyx_lineno = 0;
11469 const char *__pyx_filename = NULL;
11470 int __pyx_clineno = 0;
11471 __Pyx_RefNannySetupContext(
"__setitem__", 0);
11472 __Pyx_INCREF(__pyx_v_index);
11481 __pyx_t_1 = (__pyx_v_self->view.readonly != 0);
11482 if (unlikely(__pyx_t_1)) {
11491 __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__14, NULL);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 418, __pyx_L1_error)
11492 __Pyx_GOTREF(__pyx_t_2);
11493 __Pyx_Raise(__pyx_t_2, 0, 0, 0);
11494 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
11495 __PYX_ERR(1, 418, __pyx_L1_error)
11513 __pyx_t_2 = _unellipsify(__pyx_v_index, __pyx_v_self->view.ndim);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 420, __pyx_L1_error)
11514 __Pyx_GOTREF(__pyx_t_2);
11515 if (likely(__pyx_t_2 != Py_None)) {
11516 PyObject* sequence = __pyx_t_2;
11517 Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
11518 if (unlikely(size != 2)) {
11519 if (size > 2) __Pyx_RaiseTooManyValuesError(2);
11520 else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
11521 __PYX_ERR(1, 420, __pyx_L1_error)
11523 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
11524 __pyx_t_3 = PyTuple_GET_ITEM(sequence, 0);
11525 __pyx_t_4 = PyTuple_GET_ITEM(sequence, 1);
11526 __Pyx_INCREF(__pyx_t_3);
11527 __Pyx_INCREF(__pyx_t_4);
11529 __pyx_t_3 = PySequence_ITEM(sequence, 0);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 420, __pyx_L1_error)
11530 __Pyx_GOTREF(__pyx_t_3);
11531 __pyx_t_4 = PySequence_ITEM(sequence, 1);
if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 420, __pyx_L1_error)
11532 __Pyx_GOTREF(__pyx_t_4);
11534 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
11536 __Pyx_RaiseNoneNotIterableError(); __PYX_ERR(1, 420, __pyx_L1_error)
11538 __pyx_v_have_slices = __pyx_t_3;
11540 __Pyx_DECREF_SET(__pyx_v_index, __pyx_t_4);
11550 __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_have_slices);
if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(1, 422, __pyx_L1_error)
11560 __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)
11561 __Pyx_GOTREF(__pyx_t_2);
11562 __pyx_v_obj = __pyx_t_2;
11572 __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_obj);
if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(1, 424, __pyx_L1_error)
11582 __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)
11583 __Pyx_GOTREF(__pyx_t_2);
11584 __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)
11585 __Pyx_GOTREF(__pyx_t_4);
11586 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
11587 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
11607 __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)
11608 __Pyx_GOTREF(__pyx_t_4);
11609 if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_memoryview_type))))) __PYX_ERR(1, 427, __pyx_L1_error)
11610 __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)
11611 __Pyx_GOTREF(__pyx_t_2);
11612 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
11613 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
11635 __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)
11636 __Pyx_GOTREF(__pyx_t_2);
11637 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
11653 __Pyx_XDECREF(__pyx_t_2);
11654 __Pyx_XDECREF(__pyx_t_3);
11655 __Pyx_XDECREF(__pyx_t_4);
11656 __Pyx_AddTraceback(
"View.MemoryView.memoryview.__setitem__", __pyx_clineno, __pyx_lineno, __pyx_filename);
11659 __Pyx_XDECREF(__pyx_v_have_slices);
11660 __Pyx_XDECREF(__pyx_v_obj);
11661 __Pyx_XDECREF(__pyx_v_index);
11662 __Pyx_RefNannyFinishContext();
11674 static PyObject *__pyx_memoryview_is_slice(
struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_obj) {
11675 PyObject *__pyx_r = NULL;
11676 __Pyx_RefNannyDeclarations
11679 PyObject *__pyx_t_3 = NULL;
11680 PyObject *__pyx_t_4 = NULL;
11681 PyObject *__pyx_t_5 = NULL;
11682 PyObject *__pyx_t_6 = NULL;
11683 PyObject *__pyx_t_7 = NULL;
11684 PyObject *__pyx_t_8 = NULL;
11686 int __pyx_lineno = 0;
11687 const char *__pyx_filename = NULL;
11688 int __pyx_clineno = 0;
11689 __Pyx_RefNannySetupContext(
"is_slice", 0);
11690 __Pyx_INCREF(__pyx_v_obj);
11699 __pyx_t_1 = __Pyx_TypeCheck(__pyx_v_obj, __pyx_memoryview_type);
11700 __pyx_t_2 = ((!(__pyx_t_1 != 0)) != 0);
11711 __Pyx_PyThreadState_declare
11712 __Pyx_PyThreadState_assign
11713 __Pyx_ExceptionSave(&__pyx_t_3, &__pyx_t_4, &__pyx_t_5);
11714 __Pyx_XGOTREF(__pyx_t_3);
11715 __Pyx_XGOTREF(__pyx_t_4);
11716 __Pyx_XGOTREF(__pyx_t_5);
11726 __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)
11727 __Pyx_GOTREF(__pyx_t_6);
11736 __pyx_t_7 = __Pyx_PyBool_FromLong(__pyx_v_self->dtype_is_object);
if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 435, __pyx_L4_error)
11737 __Pyx_GOTREF(__pyx_t_7);
11746 __pyx_t_8 = PyTuple_New(3);
if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 434, __pyx_L4_error)
11747 __Pyx_GOTREF(__pyx_t_8);
11748 __Pyx_INCREF(__pyx_v_obj);
11749 __Pyx_GIVEREF(__pyx_v_obj);
11750 PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_v_obj);
11751 __Pyx_GIVEREF(__pyx_t_6);
11752 PyTuple_SET_ITEM(__pyx_t_8, 1, __pyx_t_6);
11753 __Pyx_GIVEREF(__pyx_t_7);
11754 PyTuple_SET_ITEM(__pyx_t_8, 2, __pyx_t_7);
11757 __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)
11758 __Pyx_GOTREF(__pyx_t_7);
11759 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
11760 __Pyx_DECREF_SET(__pyx_v_obj, __pyx_t_7);
11771 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
11772 __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
11773 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
11774 goto __pyx_L9_try_end;
11776 __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
11777 __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
11778 __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
11787 __pyx_t_9 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_TypeError);
11789 __Pyx_AddTraceback(
"View.MemoryView.memoryview.is_slice", __pyx_clineno, __pyx_lineno, __pyx_filename);
11790 if (__Pyx_GetException(&__pyx_t_7, &__pyx_t_8, &__pyx_t_6) < 0) __PYX_ERR(1, 436, __pyx_L6_except_error)
11791 __Pyx_GOTREF(__pyx_t_7);
11792 __Pyx_GOTREF(__pyx_t_8);
11793 __Pyx_GOTREF(__pyx_t_6);
11802 __Pyx_XDECREF(__pyx_r);
11803 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
11804 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
11805 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
11806 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
11807 goto __pyx_L7_except_return;
11809 goto __pyx_L6_except_error;
11810 __pyx_L6_except_error:;
11819 __Pyx_XGIVEREF(__pyx_t_3);
11820 __Pyx_XGIVEREF(__pyx_t_4);
11821 __Pyx_XGIVEREF(__pyx_t_5);
11822 __Pyx_ExceptionReset(__pyx_t_3, __pyx_t_4, __pyx_t_5);
11823 goto __pyx_L1_error;
11824 __pyx_L7_except_return:;
11825 __Pyx_XGIVEREF(__pyx_t_3);
11826 __Pyx_XGIVEREF(__pyx_t_4);
11827 __Pyx_XGIVEREF(__pyx_t_5);
11828 __Pyx_ExceptionReset(__pyx_t_3, __pyx_t_4, __pyx_t_5);
11849 __Pyx_XDECREF(__pyx_r);
11850 __Pyx_INCREF(__pyx_v_obj);
11851 __pyx_r = __pyx_v_obj;
11864 __Pyx_XDECREF(__pyx_t_6);
11865 __Pyx_XDECREF(__pyx_t_7);
11866 __Pyx_XDECREF(__pyx_t_8);
11867 __Pyx_AddTraceback(
"View.MemoryView.memoryview.is_slice", __pyx_clineno, __pyx_lineno, __pyx_filename);
11870 __Pyx_XDECREF(__pyx_v_obj);
11871 __Pyx_XGIVEREF(__pyx_r);
11872 __Pyx_RefNannyFinishContext();
11884 static PyObject *__pyx_memoryview_setitem_slice_assignment(
struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_dst, PyObject *__pyx_v_src) {
11885 __Pyx_memviewslice __pyx_v_dst_slice;
11886 __Pyx_memviewslice __pyx_v_src_slice;
11887 PyObject *__pyx_r = NULL;
11888 __Pyx_RefNannyDeclarations
11889 __Pyx_memviewslice *__pyx_t_1;
11890 __Pyx_memviewslice *__pyx_t_2;
11891 PyObject *__pyx_t_3 = NULL;
11895 int __pyx_lineno = 0;
11896 const char *__pyx_filename = NULL;
11897 int __pyx_clineno = 0;
11898 __Pyx_RefNannySetupContext(
"setitem_slice_assignment", 0);
11907 if (!(likely(((__pyx_v_src) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_src, __pyx_memoryview_type))))) __PYX_ERR(1, 445, __pyx_L1_error)
11908 __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)
11917 if (!(likely(((__pyx_v_dst) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_dst, __pyx_memoryview_type))))) __PYX_ERR(1, 446, __pyx_L1_error)
11918 __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)
11927 __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)
11928 __Pyx_GOTREF(__pyx_t_3);
11929 __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)
11930 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
11931 __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)
11932 __Pyx_GOTREF(__pyx_t_3);
11933 __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)
11934 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
11943 __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)
11954 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
11957 __Pyx_XDECREF(__pyx_t_3);
11958 __Pyx_AddTraceback(
"View.MemoryView.memoryview.setitem_slice_assignment", __pyx_clineno, __pyx_lineno, __pyx_filename);
11961 __Pyx_XGIVEREF(__pyx_r);
11962 __Pyx_RefNannyFinishContext();
11974 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) {
11975 int __pyx_v_array[0x80];
11977 void *__pyx_v_item;
11978 __Pyx_memviewslice *__pyx_v_dst_slice;
11979 __Pyx_memviewslice __pyx_v_tmp_slice;
11980 PyObject *__pyx_r = NULL;
11981 __Pyx_RefNannyDeclarations
11982 __Pyx_memviewslice *__pyx_t_1;
11984 PyObject *__pyx_t_3 = NULL;
11987 char const *__pyx_t_6;
11988 PyObject *__pyx_t_7 = NULL;
11989 PyObject *__pyx_t_8 = NULL;
11990 PyObject *__pyx_t_9 = NULL;
11991 PyObject *__pyx_t_10 = NULL;
11992 PyObject *__pyx_t_11 = NULL;
11993 PyObject *__pyx_t_12 = NULL;
11994 int __pyx_lineno = 0;
11995 const char *__pyx_filename = NULL;
11996 int __pyx_clineno = 0;
11997 __Pyx_RefNannySetupContext(
"setitem_slice_assign_scalar", 0);
12006 __pyx_v_tmp = NULL;
12015 __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)
12016 __pyx_v_dst_slice = __pyx_t_1;
12025 __pyx_t_2 = ((((size_t)__pyx_v_self->view.itemsize) > (
sizeof(__pyx_v_array))) != 0);
12035 __pyx_v_tmp = PyMem_Malloc(__pyx_v_self->view.itemsize);
12044 __pyx_t_2 = ((__pyx_v_tmp == NULL) != 0);
12045 if (unlikely(__pyx_t_2)) {
12054 PyErr_NoMemory(); __PYX_ERR(1, 461, __pyx_L1_error)
12072 __pyx_v_item = __pyx_v_tmp;
12092 __pyx_v_item = ((
void *)__pyx_v_array);
12112 __pyx_t_2 = (__pyx_v_self->dtype_is_object != 0);
12122 (((PyObject **)__pyx_v_item)[0]) = ((PyObject *)__pyx_v_value);
12142 __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)
12143 __Pyx_GOTREF(__pyx_t_3);
12144 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
12155 __pyx_t_2 = ((__pyx_v_self->view.suboffsets != NULL) != 0);
12165 __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)
12166 __Pyx_GOTREF(__pyx_t_3);
12167 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
12185 __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);
12197 PyMem_Free(__pyx_v_tmp);
12202 __Pyx_PyThreadState_declare
12203 __Pyx_PyThreadState_assign
12204 __pyx_t_7 = 0; __pyx_t_8 = 0; __pyx_t_9 = 0; __pyx_t_10 = 0; __pyx_t_11 = 0; __pyx_t_12 = 0;
12205 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
12206 if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_10, &__pyx_t_11, &__pyx_t_12);
12207 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);
12208 __Pyx_XGOTREF(__pyx_t_7);
12209 __Pyx_XGOTREF(__pyx_t_8);
12210 __Pyx_XGOTREF(__pyx_t_9);
12211 __Pyx_XGOTREF(__pyx_t_10);
12212 __Pyx_XGOTREF(__pyx_t_11);
12213 __Pyx_XGOTREF(__pyx_t_12);
12214 __pyx_t_4 = __pyx_lineno; __pyx_t_5 = __pyx_clineno; __pyx_t_6 = __pyx_filename;
12216 PyMem_Free(__pyx_v_tmp);
12218 if (PY_MAJOR_VERSION >= 3) {
12219 __Pyx_XGIVEREF(__pyx_t_10);
12220 __Pyx_XGIVEREF(__pyx_t_11);
12221 __Pyx_XGIVEREF(__pyx_t_12);
12222 __Pyx_ExceptionReset(__pyx_t_10, __pyx_t_11, __pyx_t_12);
12224 __Pyx_XGIVEREF(__pyx_t_7);
12225 __Pyx_XGIVEREF(__pyx_t_8);
12226 __Pyx_XGIVEREF(__pyx_t_9);
12227 __Pyx_ErrRestore(__pyx_t_7, __pyx_t_8, __pyx_t_9);
12228 __pyx_t_7 = 0; __pyx_t_8 = 0; __pyx_t_9 = 0; __pyx_t_10 = 0; __pyx_t_11 = 0; __pyx_t_12 = 0;
12229 __pyx_lineno = __pyx_t_4; __pyx_clineno = __pyx_t_5; __pyx_filename = __pyx_t_6;
12230 goto __pyx_L1_error;
12244 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
12247 __Pyx_XDECREF(__pyx_t_3);
12248 __Pyx_AddTraceback(
"View.MemoryView.memoryview.setitem_slice_assign_scalar", __pyx_clineno, __pyx_lineno, __pyx_filename);
12251 __Pyx_XGIVEREF(__pyx_r);
12252 __Pyx_RefNannyFinishContext();
12264 static PyObject *__pyx_memoryview_setitem_indexed(
struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index, PyObject *__pyx_v_value) {
12265 char *__pyx_v_itemp;
12266 PyObject *__pyx_r = NULL;
12267 __Pyx_RefNannyDeclarations
12269 PyObject *__pyx_t_2 = NULL;
12270 int __pyx_lineno = 0;
12271 const char *__pyx_filename = NULL;
12272 int __pyx_clineno = 0;
12273 __Pyx_RefNannySetupContext(
"setitem_indexed", 0);
12282 __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)
12283 __pyx_v_itemp = __pyx_t_1;
12292 __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)
12293 __Pyx_GOTREF(__pyx_t_2);
12294 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
12305 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
12308 __Pyx_XDECREF(__pyx_t_2);
12309 __Pyx_AddTraceback(
"View.MemoryView.memoryview.setitem_indexed", __pyx_clineno, __pyx_lineno, __pyx_filename);
12312 __Pyx_XGIVEREF(__pyx_r);
12313 __Pyx_RefNannyFinishContext();
12325 static PyObject *__pyx_memoryview_convert_item_to_object(
struct __pyx_memoryview_obj *__pyx_v_self,
char *__pyx_v_itemp) {
12326 PyObject *__pyx_v_struct = NULL;
12327 PyObject *__pyx_v_bytesitem = 0;
12328 PyObject *__pyx_v_result = NULL;
12329 PyObject *__pyx_r = NULL;
12330 __Pyx_RefNannyDeclarations
12331 PyObject *__pyx_t_1 = NULL;
12332 PyObject *__pyx_t_2 = NULL;
12333 PyObject *__pyx_t_3 = NULL;
12334 PyObject *__pyx_t_4 = NULL;
12335 PyObject *__pyx_t_5 = NULL;
12336 PyObject *__pyx_t_6 = NULL;
12337 PyObject *__pyx_t_7 = NULL;
12339 PyObject *__pyx_t_9 = NULL;
12342 int __pyx_lineno = 0;
12343 const char *__pyx_filename = NULL;
12344 int __pyx_clineno = 0;
12345 __Pyx_RefNannySetupContext(
"convert_item_to_object", 0);
12354 __pyx_t_1 = __Pyx_Import(__pyx_n_s_struct, 0, 0);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 488, __pyx_L1_error)
12355 __Pyx_GOTREF(__pyx_t_1);
12356 __pyx_v_struct = __pyx_t_1;
12366 __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)
12367 __Pyx_GOTREF(__pyx_t_1);
12368 __pyx_v_bytesitem = ((PyObject*)__pyx_t_1);
12379 __Pyx_PyThreadState_declare
12380 __Pyx_PyThreadState_assign
12381 __Pyx_ExceptionSave(&__pyx_t_2, &__pyx_t_3, &__pyx_t_4);
12382 __Pyx_XGOTREF(__pyx_t_2);
12383 __Pyx_XGOTREF(__pyx_t_3);
12384 __Pyx_XGOTREF(__pyx_t_4);
12394 __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)
12395 __Pyx_GOTREF(__pyx_t_5);
12396 __pyx_t_6 = __Pyx_PyBytes_FromString(__pyx_v_self->view.format);
if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 493, __pyx_L3_error)
12397 __Pyx_GOTREF(__pyx_t_6);
12400 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) {
12401 __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_5);
12402 if (likely(__pyx_t_7)) {
12403 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_5);
12404 __Pyx_INCREF(__pyx_t_7);
12405 __Pyx_INCREF(
function);
12406 __Pyx_DECREF_SET(__pyx_t_5,
function);
12410 #if CYTHON_FAST_PYCALL
12411 if (PyFunction_Check(__pyx_t_5)) {
12412 PyObject *__pyx_temp[3] = {__pyx_t_7, __pyx_t_6, __pyx_v_bytesitem};
12413 __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)
12414 __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
12415 __Pyx_GOTREF(__pyx_t_1);
12416 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
12419 #if CYTHON_FAST_PYCCALL
12420 if (__Pyx_PyFastCFunction_Check(__pyx_t_5)) {
12421 PyObject *__pyx_temp[3] = {__pyx_t_7, __pyx_t_6, __pyx_v_bytesitem};
12422 __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)
12423 __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
12424 __Pyx_GOTREF(__pyx_t_1);
12425 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
12429 __pyx_t_9 = PyTuple_New(2+__pyx_t_8);
if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 493, __pyx_L3_error)
12430 __Pyx_GOTREF(__pyx_t_9);
12432 __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_7); __pyx_t_7 = NULL;
12434 __Pyx_GIVEREF(__pyx_t_6);
12435 PyTuple_SET_ITEM(__pyx_t_9, 0+__pyx_t_8, __pyx_t_6);
12436 __Pyx_INCREF(__pyx_v_bytesitem);
12437 __Pyx_GIVEREF(__pyx_v_bytesitem);
12438 PyTuple_SET_ITEM(__pyx_t_9, 1+__pyx_t_8, __pyx_v_bytesitem);
12440 __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)
12441 __Pyx_GOTREF(__pyx_t_1);
12442 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
12444 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
12445 __pyx_v_result = __pyx_t_1;
12465 __pyx_t_10 = strlen(__pyx_v_self->view.format);
12466 __pyx_t_11 = ((__pyx_t_10 == 1) != 0);
12476 __Pyx_XDECREF(__pyx_r);
12477 __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_result, 0,
long, 1, __Pyx_PyInt_From_long, 0, 0, 1);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 498, __pyx_L5_except_error)
12478 __Pyx_GOTREF(__pyx_t_1);
12479 __pyx_r = __pyx_t_1;
12481 goto __pyx_L6_except_return;
12499 __Pyx_XDECREF(__pyx_r);
12500 __Pyx_INCREF(__pyx_v_result);
12501 __pyx_r = __pyx_v_result;
12502 goto __pyx_L6_except_return;
12505 __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
12506 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
12507 __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
12508 __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
12509 __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
12518 __Pyx_ErrFetch(&__pyx_t_1, &__pyx_t_5, &__pyx_t_9);
12519 __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)
12520 __Pyx_GOTREF(__pyx_t_6);
12521 __pyx_t_8 = __Pyx_PyErr_GivenExceptionMatches(__pyx_t_1, __pyx_t_6);
12522 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
12523 __Pyx_ErrRestore(__pyx_t_1, __pyx_t_5, __pyx_t_9);
12524 __pyx_t_1 = 0; __pyx_t_5 = 0; __pyx_t_9 = 0;
12526 __Pyx_AddTraceback(
"View.MemoryView.memoryview.convert_item_to_object", __pyx_clineno, __pyx_lineno, __pyx_filename);
12527 if (__Pyx_GetException(&__pyx_t_9, &__pyx_t_5, &__pyx_t_1) < 0) __PYX_ERR(1, 494, __pyx_L5_except_error)
12528 __Pyx_GOTREF(__pyx_t_9);
12529 __Pyx_GOTREF(__pyx_t_5);
12530 __Pyx_GOTREF(__pyx_t_1);
12539 __pyx_t_6 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__15, NULL);
if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 495, __pyx_L5_except_error)
12540 __Pyx_GOTREF(__pyx_t_6);
12541 __Pyx_Raise(__pyx_t_6, 0, 0, 0);
12542 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
12543 __PYX_ERR(1, 495, __pyx_L5_except_error)
12545 goto __pyx_L5_except_error;
12546 __pyx_L5_except_error:;
12555 __Pyx_XGIVEREF(__pyx_t_2);
12556 __Pyx_XGIVEREF(__pyx_t_3);
12557 __Pyx_XGIVEREF(__pyx_t_4);
12558 __Pyx_ExceptionReset(__pyx_t_2, __pyx_t_3, __pyx_t_4);
12559 goto __pyx_L1_error;
12560 __pyx_L6_except_return:;
12561 __Pyx_XGIVEREF(__pyx_t_2);
12562 __Pyx_XGIVEREF(__pyx_t_3);
12563 __Pyx_XGIVEREF(__pyx_t_4);
12564 __Pyx_ExceptionReset(__pyx_t_2, __pyx_t_3, __pyx_t_4);
12578 __Pyx_XDECREF(__pyx_t_1);
12579 __Pyx_XDECREF(__pyx_t_5);
12580 __Pyx_XDECREF(__pyx_t_6);
12581 __Pyx_XDECREF(__pyx_t_7);
12582 __Pyx_XDECREF(__pyx_t_9);
12583 __Pyx_AddTraceback(
"View.MemoryView.memoryview.convert_item_to_object", __pyx_clineno, __pyx_lineno, __pyx_filename);
12586 __Pyx_XDECREF(__pyx_v_struct);
12587 __Pyx_XDECREF(__pyx_v_bytesitem);
12588 __Pyx_XDECREF(__pyx_v_result);
12589 __Pyx_XGIVEREF(__pyx_r);
12590 __Pyx_RefNannyFinishContext();
12602 static PyObject *__pyx_memoryview_assign_item_from_object(
struct __pyx_memoryview_obj *__pyx_v_self,
char *__pyx_v_itemp, PyObject *__pyx_v_value) {
12603 PyObject *__pyx_v_struct = NULL;
12605 PyObject *__pyx_v_bytesvalue = 0;
12606 Py_ssize_t __pyx_v_i;
12607 PyObject *__pyx_r = NULL;
12608 __Pyx_RefNannyDeclarations
12609 PyObject *__pyx_t_1 = NULL;
12612 PyObject *__pyx_t_4 = NULL;
12613 PyObject *__pyx_t_5 = NULL;
12614 PyObject *__pyx_t_6 = NULL;
12616 PyObject *__pyx_t_8 = NULL;
12617 Py_ssize_t __pyx_t_9;
12618 PyObject *__pyx_t_10 = NULL;
12623 int __pyx_lineno = 0;
12624 const char *__pyx_filename = NULL;
12625 int __pyx_clineno = 0;
12626 __Pyx_RefNannySetupContext(
"assign_item_from_object", 0);
12635 __pyx_t_1 = __Pyx_Import(__pyx_n_s_struct, 0, 0);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 504, __pyx_L1_error)
12636 __Pyx_GOTREF(__pyx_t_1);
12637 __pyx_v_struct = __pyx_t_1;
12647 __pyx_t_2 = PyTuple_Check(__pyx_v_value);
12648 __pyx_t_3 = (__pyx_t_2 != 0);
12658 __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)
12659 __Pyx_GOTREF(__pyx_t_1);
12660 __pyx_t_4 = __Pyx_PyBytes_FromString(__pyx_v_self->view.format);
if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 510, __pyx_L1_error)
12661 __Pyx_GOTREF(__pyx_t_4);
12662 __pyx_t_5 = PyTuple_New(1);
if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 510, __pyx_L1_error)
12663 __Pyx_GOTREF(__pyx_t_5);
12664 __Pyx_GIVEREF(__pyx_t_4);
12665 PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4);
12667 __pyx_t_4 = __Pyx_PySequence_Tuple(__pyx_v_value);
if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 510, __pyx_L1_error)
12668 __Pyx_GOTREF(__pyx_t_4);
12669 __pyx_t_6 = PyNumber_Add(__pyx_t_5, __pyx_t_4);
if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 510, __pyx_L1_error)
12670 __Pyx_GOTREF(__pyx_t_6);
12671 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
12672 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
12673 __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)
12674 __Pyx_GOTREF(__pyx_t_4);
12675 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
12676 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
12677 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)
12678 __pyx_v_bytesvalue = ((PyObject*)__pyx_t_4);
12699 __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)
12700 __Pyx_GOTREF(__pyx_t_6);
12701 __pyx_t_1 = __Pyx_PyBytes_FromString(__pyx_v_self->view.format);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 512, __pyx_L1_error)
12702 __Pyx_GOTREF(__pyx_t_1);
12705 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_6))) {
12706 __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_6);
12707 if (likely(__pyx_t_5)) {
12708 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_6);
12709 __Pyx_INCREF(__pyx_t_5);
12710 __Pyx_INCREF(
function);
12711 __Pyx_DECREF_SET(__pyx_t_6,
function);
12715 #if CYTHON_FAST_PYCALL
12716 if (PyFunction_Check(__pyx_t_6)) {
12717 PyObject *__pyx_temp[3] = {__pyx_t_5, __pyx_t_1, __pyx_v_value};
12718 __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)
12719 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
12720 __Pyx_GOTREF(__pyx_t_4);
12721 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
12724 #if CYTHON_FAST_PYCCALL
12725 if (__Pyx_PyFastCFunction_Check(__pyx_t_6)) {
12726 PyObject *__pyx_temp[3] = {__pyx_t_5, __pyx_t_1, __pyx_v_value};
12727 __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)
12728 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
12729 __Pyx_GOTREF(__pyx_t_4);
12730 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
12734 __pyx_t_8 = PyTuple_New(2+__pyx_t_7);
if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 512, __pyx_L1_error)
12735 __Pyx_GOTREF(__pyx_t_8);
12737 __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_5); __pyx_t_5 = NULL;
12739 __Pyx_GIVEREF(__pyx_t_1);
12740 PyTuple_SET_ITEM(__pyx_t_8, 0+__pyx_t_7, __pyx_t_1);
12741 __Pyx_INCREF(__pyx_v_value);
12742 __Pyx_GIVEREF(__pyx_v_value);
12743 PyTuple_SET_ITEM(__pyx_t_8, 1+__pyx_t_7, __pyx_v_value);
12745 __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)
12746 __Pyx_GOTREF(__pyx_t_4);
12747 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
12749 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
12750 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)
12751 __pyx_v_bytesvalue = ((PyObject*)__pyx_t_4);
12764 if (unlikely(__pyx_v_bytesvalue == Py_None)) {
12765 PyErr_SetString(PyExc_TypeError,
"'NoneType' is not iterable");
12766 __PYX_ERR(1, 514, __pyx_L1_error)
12768 __Pyx_INCREF(__pyx_v_bytesvalue);
12769 __pyx_t_10 = __pyx_v_bytesvalue;
12770 __pyx_t_12 = PyBytes_AS_STRING(__pyx_t_10);
12771 __pyx_t_13 = (__pyx_t_12 + PyBytes_GET_SIZE(__pyx_t_10));
12772 for (__pyx_t_14 = __pyx_t_12; __pyx_t_14 < __pyx_t_13; __pyx_t_14++) {
12773 __pyx_t_11 = __pyx_t_14;
12774 __pyx_v_c = (__pyx_t_11[0]);
12783 __pyx_v_i = __pyx_t_9;
12792 __pyx_t_9 = (__pyx_t_9 + 1);
12801 (__pyx_v_itemp[__pyx_v_i]) = __pyx_v_c;
12803 __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
12814 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
12817 __Pyx_XDECREF(__pyx_t_1);
12818 __Pyx_XDECREF(__pyx_t_4);
12819 __Pyx_XDECREF(__pyx_t_5);
12820 __Pyx_XDECREF(__pyx_t_6);
12821 __Pyx_XDECREF(__pyx_t_8);
12822 __Pyx_XDECREF(__pyx_t_10);
12823 __Pyx_AddTraceback(
"View.MemoryView.memoryview.assign_item_from_object", __pyx_clineno, __pyx_lineno, __pyx_filename);
12826 __Pyx_XDECREF(__pyx_v_struct);
12827 __Pyx_XDECREF(__pyx_v_bytesvalue);
12828 __Pyx_XGIVEREF(__pyx_r);
12829 __Pyx_RefNannyFinishContext();
12842 static CYTHON_UNUSED
int __pyx_memoryview_getbuffer(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info,
int __pyx_v_flags);
12843 static CYTHON_UNUSED
int __pyx_memoryview_getbuffer(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info,
int __pyx_v_flags) {
12845 __Pyx_RefNannyDeclarations
12846 __Pyx_RefNannySetupContext(
"__getbuffer__ (wrapper)", 0);
12847 __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));
12850 __Pyx_RefNannyFinishContext();
12854 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) {
12856 __Pyx_RefNannyDeclarations
12859 PyObject *__pyx_t_3 = NULL;
12860 Py_ssize_t *__pyx_t_4;
12864 Py_ssize_t __pyx_t_8;
12865 int __pyx_lineno = 0;
12866 const char *__pyx_filename = NULL;
12867 int __pyx_clineno = 0;
12868 if (__pyx_v_info == NULL) {
12869 PyErr_SetString(PyExc_BufferError,
"PyObject_GetBuffer: view==NULL argument is obsolete");
12872 __Pyx_RefNannySetupContext(
"__getbuffer__", 0);
12873 __pyx_v_info->obj = Py_None; __Pyx_INCREF(Py_None);
12874 __Pyx_GIVEREF(__pyx_v_info->obj);
12883 __pyx_t_2 = ((__pyx_v_flags & PyBUF_WRITABLE) != 0);
12886 __pyx_t_1 = __pyx_t_2;
12887 goto __pyx_L4_bool_binop_done;
12889 __pyx_t_2 = (__pyx_v_self->view.readonly != 0);
12890 __pyx_t_1 = __pyx_t_2;
12891 __pyx_L4_bool_binop_done:;
12892 if (unlikely(__pyx_t_1)) {
12901 __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__16, NULL);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 520, __pyx_L1_error)
12902 __Pyx_GOTREF(__pyx_t_3);
12903 __Pyx_Raise(__pyx_t_3, 0, 0, 0);
12904 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
12905 __PYX_ERR(1, 520, __pyx_L1_error)
12923 __pyx_t_1 = ((__pyx_v_flags & PyBUF_ND) != 0);
12933 __pyx_t_4 = __pyx_v_self->view.shape;
12934 __pyx_v_info->shape = __pyx_t_4;
12954 __pyx_v_info->shape = NULL;
12965 __pyx_t_1 = ((__pyx_v_flags & PyBUF_STRIDES) != 0);
12975 __pyx_t_4 = __pyx_v_self->view.strides;
12976 __pyx_v_info->strides = __pyx_t_4;
12996 __pyx_v_info->strides = NULL;
13007 __pyx_t_1 = ((__pyx_v_flags & PyBUF_INDIRECT) != 0);
13017 __pyx_t_4 = __pyx_v_self->view.suboffsets;
13018 __pyx_v_info->suboffsets = __pyx_t_4;
13038 __pyx_v_info->suboffsets = NULL;
13049 __pyx_t_1 = ((__pyx_v_flags & PyBUF_FORMAT) != 0);
13059 __pyx_t_5 = __pyx_v_self->view.format;
13060 __pyx_v_info->format = __pyx_t_5;
13080 __pyx_v_info->format = NULL;
13091 __pyx_t_6 = __pyx_v_self->view.buf;
13092 __pyx_v_info->buf = __pyx_t_6;
13101 __pyx_t_7 = __pyx_v_self->view.ndim;
13102 __pyx_v_info->ndim = __pyx_t_7;
13111 __pyx_t_8 = __pyx_v_self->view.itemsize;
13112 __pyx_v_info->itemsize = __pyx_t_8;
13121 __pyx_t_8 = __pyx_v_self->view.len;
13122 __pyx_v_info->len = __pyx_t_8;
13131 __pyx_t_1 = __pyx_v_self->view.readonly;
13132 __pyx_v_info->readonly = __pyx_t_1;
13141 __Pyx_INCREF(((PyObject *)__pyx_v_self));
13142 __Pyx_GIVEREF(((PyObject *)__pyx_v_self));
13143 __Pyx_GOTREF(__pyx_v_info->obj);
13144 __Pyx_DECREF(__pyx_v_info->obj);
13145 __pyx_v_info->obj = ((PyObject *)__pyx_v_self);
13159 __Pyx_XDECREF(__pyx_t_3);
13160 __Pyx_AddTraceback(
"View.MemoryView.memoryview.__getbuffer__", __pyx_clineno, __pyx_lineno, __pyx_filename);
13162 if (__pyx_v_info->obj != NULL) {
13163 __Pyx_GOTREF(__pyx_v_info->obj);
13164 __Pyx_DECREF(__pyx_v_info->obj); __pyx_v_info->obj = 0;
13168 if (__pyx_v_info->obj == Py_None) {
13169 __Pyx_GOTREF(__pyx_v_info->obj);
13170 __Pyx_DECREF(__pyx_v_info->obj); __pyx_v_info->obj = 0;
13173 __Pyx_RefNannyFinishContext();
13186 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_1T_1__get__(PyObject *__pyx_v_self);
13187 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_1T_1__get__(PyObject *__pyx_v_self) {
13188 PyObject *__pyx_r = 0;
13189 __Pyx_RefNannyDeclarations
13190 __Pyx_RefNannySetupContext(
"__get__ (wrapper)", 0);
13191 __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_1T___get__(((
struct __pyx_memoryview_obj *)__pyx_v_self));
13194 __Pyx_RefNannyFinishContext();
13198 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_1T___get__(
struct __pyx_memoryview_obj *__pyx_v_self) {
13199 struct __pyx_memoryviewslice_obj *__pyx_v_result = 0;
13200 PyObject *__pyx_r = NULL;
13201 __Pyx_RefNannyDeclarations
13202 PyObject *__pyx_t_1 = NULL;
13204 int __pyx_lineno = 0;
13205 const char *__pyx_filename = NULL;
13206 int __pyx_clineno = 0;
13207 __Pyx_RefNannySetupContext(
"__get__", 0);
13216 __pyx_t_1 = __pyx_memoryview_copy_object(__pyx_v_self);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 554, __pyx_L1_error)
13217 __Pyx_GOTREF(__pyx_t_1);
13218 if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_memoryviewslice_type))))) __PYX_ERR(1, 554, __pyx_L1_error)
13219 __pyx_v_result = ((
struct __pyx_memoryviewslice_obj *)__pyx_t_1);
13229 __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)
13238 __Pyx_XDECREF(__pyx_r);
13239 __Pyx_INCREF(((PyObject *)__pyx_v_result));
13240 __pyx_r = ((PyObject *)__pyx_v_result);
13253 __Pyx_XDECREF(__pyx_t_1);
13254 __Pyx_AddTraceback(
"View.MemoryView.memoryview.T.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
13257 __Pyx_XDECREF((PyObject *)__pyx_v_result);
13258 __Pyx_XGIVEREF(__pyx_r);
13259 __Pyx_RefNannyFinishContext();
13272 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_4base_1__get__(PyObject *__pyx_v_self);
13273 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_4base_1__get__(PyObject *__pyx_v_self) {
13274 PyObject *__pyx_r = 0;
13275 __Pyx_RefNannyDeclarations
13276 __Pyx_RefNannySetupContext(
"__get__ (wrapper)", 0);
13277 __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_4base___get__(((
struct __pyx_memoryview_obj *)__pyx_v_self));
13280 __Pyx_RefNannyFinishContext();
13284 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_4base___get__(
struct __pyx_memoryview_obj *__pyx_v_self) {
13285 PyObject *__pyx_r = NULL;
13286 __Pyx_RefNannyDeclarations
13287 __Pyx_RefNannySetupContext(
"__get__", 0);
13296 __Pyx_XDECREF(__pyx_r);
13297 __Pyx_INCREF(__pyx_v_self->obj);
13298 __pyx_r = __pyx_v_self->obj;
13311 __Pyx_XGIVEREF(__pyx_r);
13312 __Pyx_RefNannyFinishContext();
13325 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_5shape_1__get__(PyObject *__pyx_v_self);
13326 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_5shape_1__get__(PyObject *__pyx_v_self) {
13327 PyObject *__pyx_r = 0;
13328 __Pyx_RefNannyDeclarations
13329 __Pyx_RefNannySetupContext(
"__get__ (wrapper)", 0);
13330 __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_5shape___get__(((
struct __pyx_memoryview_obj *)__pyx_v_self));
13333 __Pyx_RefNannyFinishContext();
13337 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_5shape___get__(
struct __pyx_memoryview_obj *__pyx_v_self) {
13338 Py_ssize_t __pyx_v_length;
13339 PyObject *__pyx_r = NULL;
13340 __Pyx_RefNannyDeclarations
13341 PyObject *__pyx_t_1 = NULL;
13342 Py_ssize_t *__pyx_t_2;
13343 Py_ssize_t *__pyx_t_3;
13344 Py_ssize_t *__pyx_t_4;
13345 PyObject *__pyx_t_5 = NULL;
13346 int __pyx_lineno = 0;
13347 const char *__pyx_filename = NULL;
13348 int __pyx_clineno = 0;
13349 __Pyx_RefNannySetupContext(
"__get__", 0);
13358 __Pyx_XDECREF(__pyx_r);
13359 __pyx_t_1 = PyList_New(0);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 564, __pyx_L1_error)
13360 __Pyx_GOTREF(__pyx_t_1);
13361 __pyx_t_3 = (__pyx_v_self->view.shape + __pyx_v_self->view.ndim);
13362 for (__pyx_t_4 = __pyx_v_self->view.shape; __pyx_t_4 < __pyx_t_3; __pyx_t_4++) {
13363 __pyx_t_2 = __pyx_t_4;
13364 __pyx_v_length = (__pyx_t_2[0]);
13365 __pyx_t_5 = PyInt_FromSsize_t(__pyx_v_length);
if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 564, __pyx_L1_error)
13366 __Pyx_GOTREF(__pyx_t_5);
13367 if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_t_5))) __PYX_ERR(1, 564, __pyx_L1_error)
13368 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
13370 __pyx_t_5 = PyList_AsTuple(((PyObject*)__pyx_t_1));
if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 564, __pyx_L1_error)
13371 __Pyx_GOTREF(__pyx_t_5);
13372 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
13373 __pyx_r = __pyx_t_5;
13387 __Pyx_XDECREF(__pyx_t_1);
13388 __Pyx_XDECREF(__pyx_t_5);
13389 __Pyx_AddTraceback(
"View.MemoryView.memoryview.shape.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
13392 __Pyx_XGIVEREF(__pyx_r);
13393 __Pyx_RefNannyFinishContext();
13406 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_7strides_1__get__(PyObject *__pyx_v_self);
13407 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_7strides_1__get__(PyObject *__pyx_v_self) {
13408 PyObject *__pyx_r = 0;
13409 __Pyx_RefNannyDeclarations
13410 __Pyx_RefNannySetupContext(
"__get__ (wrapper)", 0);
13411 __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_7strides___get__(((
struct __pyx_memoryview_obj *)__pyx_v_self));
13414 __Pyx_RefNannyFinishContext();
13418 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_7strides___get__(
struct __pyx_memoryview_obj *__pyx_v_self) {
13419 Py_ssize_t __pyx_v_stride;
13420 PyObject *__pyx_r = NULL;
13421 __Pyx_RefNannyDeclarations
13423 PyObject *__pyx_t_2 = NULL;
13424 Py_ssize_t *__pyx_t_3;
13425 Py_ssize_t *__pyx_t_4;
13426 Py_ssize_t *__pyx_t_5;
13427 PyObject *__pyx_t_6 = NULL;
13428 int __pyx_lineno = 0;
13429 const char *__pyx_filename = NULL;
13430 int __pyx_clineno = 0;
13431 __Pyx_RefNannySetupContext(
"__get__", 0);
13440 __pyx_t_1 = ((__pyx_v_self->view.strides == NULL) != 0);
13441 if (unlikely(__pyx_t_1)) {
13450 __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__17, NULL);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 570, __pyx_L1_error)
13451 __Pyx_GOTREF(__pyx_t_2);
13452 __Pyx_Raise(__pyx_t_2, 0, 0, 0);
13453 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
13454 __PYX_ERR(1, 570, __pyx_L1_error)
13472 __Pyx_XDECREF(__pyx_r);
13473 __pyx_t_2 = PyList_New(0);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 572, __pyx_L1_error)
13474 __Pyx_GOTREF(__pyx_t_2);
13475 __pyx_t_4 = (__pyx_v_self->view.strides + __pyx_v_self->view.ndim);
13476 for (__pyx_t_5 = __pyx_v_self->view.strides; __pyx_t_5 < __pyx_t_4; __pyx_t_5++) {
13477 __pyx_t_3 = __pyx_t_5;
13478 __pyx_v_stride = (__pyx_t_3[0]);
13479 __pyx_t_6 = PyInt_FromSsize_t(__pyx_v_stride);
if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 572, __pyx_L1_error)
13480 __Pyx_GOTREF(__pyx_t_6);
13481 if (unlikely(__Pyx_ListComp_Append(__pyx_t_2, (PyObject*)__pyx_t_6))) __PYX_ERR(1, 572, __pyx_L1_error)
13482 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
13484 __pyx_t_6 = PyList_AsTuple(((PyObject*)__pyx_t_2));
if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 572, __pyx_L1_error)
13485 __Pyx_GOTREF(__pyx_t_6);
13486 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
13487 __pyx_r = __pyx_t_6;
13501 __Pyx_XDECREF(__pyx_t_2);
13502 __Pyx_XDECREF(__pyx_t_6);
13503 __Pyx_AddTraceback(
"View.MemoryView.memoryview.strides.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
13506 __Pyx_XGIVEREF(__pyx_r);
13507 __Pyx_RefNannyFinishContext();
13520 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_10suboffsets_1__get__(PyObject *__pyx_v_self);
13521 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_10suboffsets_1__get__(PyObject *__pyx_v_self) {
13522 PyObject *__pyx_r = 0;
13523 __Pyx_RefNannyDeclarations
13524 __Pyx_RefNannySetupContext(
"__get__ (wrapper)", 0);
13525 __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_10suboffsets___get__(((
struct __pyx_memoryview_obj *)__pyx_v_self));
13528 __Pyx_RefNannyFinishContext();
13532 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_10suboffsets___get__(
struct __pyx_memoryview_obj *__pyx_v_self) {
13533 Py_ssize_t __pyx_v_suboffset;
13534 PyObject *__pyx_r = NULL;
13535 __Pyx_RefNannyDeclarations
13537 PyObject *__pyx_t_2 = NULL;
13538 PyObject *__pyx_t_3 = NULL;
13539 Py_ssize_t *__pyx_t_4;
13540 Py_ssize_t *__pyx_t_5;
13541 Py_ssize_t *__pyx_t_6;
13542 int __pyx_lineno = 0;
13543 const char *__pyx_filename = NULL;
13544 int __pyx_clineno = 0;
13545 __Pyx_RefNannySetupContext(
"__get__", 0);
13554 __pyx_t_1 = ((__pyx_v_self->view.suboffsets == NULL) != 0);
13564 __Pyx_XDECREF(__pyx_r);
13565 __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_self->view.ndim);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 577, __pyx_L1_error)
13566 __Pyx_GOTREF(__pyx_t_2);
13567 __pyx_t_3 = PyNumber_Multiply(__pyx_tuple__18, __pyx_t_2);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 577, __pyx_L1_error)
13568 __Pyx_GOTREF(__pyx_t_3);
13569 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
13570 __pyx_r = __pyx_t_3;
13590 __Pyx_XDECREF(__pyx_r);
13591 __pyx_t_3 = PyList_New(0);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 579, __pyx_L1_error)
13592 __Pyx_GOTREF(__pyx_t_3);
13593 __pyx_t_5 = (__pyx_v_self->view.suboffsets + __pyx_v_self->view.ndim);
13594 for (__pyx_t_6 = __pyx_v_self->view.suboffsets; __pyx_t_6 < __pyx_t_5; __pyx_t_6++) {
13595 __pyx_t_4 = __pyx_t_6;
13596 __pyx_v_suboffset = (__pyx_t_4[0]);
13597 __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_suboffset);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 579, __pyx_L1_error)
13598 __Pyx_GOTREF(__pyx_t_2);
13599 if (unlikely(__Pyx_ListComp_Append(__pyx_t_3, (PyObject*)__pyx_t_2))) __PYX_ERR(1, 579, __pyx_L1_error)
13600 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
13602 __pyx_t_2 = PyList_AsTuple(((PyObject*)__pyx_t_3));
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 579, __pyx_L1_error)
13603 __Pyx_GOTREF(__pyx_t_2);
13604 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
13605 __pyx_r = __pyx_t_2;
13619 __Pyx_XDECREF(__pyx_t_2);
13620 __Pyx_XDECREF(__pyx_t_3);
13621 __Pyx_AddTraceback(
"View.MemoryView.memoryview.suboffsets.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
13624 __Pyx_XGIVEREF(__pyx_r);
13625 __Pyx_RefNannyFinishContext();
13638 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_4ndim_1__get__(PyObject *__pyx_v_self);
13639 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_4ndim_1__get__(PyObject *__pyx_v_self) {
13640 PyObject *__pyx_r = 0;
13641 __Pyx_RefNannyDeclarations
13642 __Pyx_RefNannySetupContext(
"__get__ (wrapper)", 0);
13643 __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_4ndim___get__(((
struct __pyx_memoryview_obj *)__pyx_v_self));
13646 __Pyx_RefNannyFinishContext();
13650 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_4ndim___get__(
struct __pyx_memoryview_obj *__pyx_v_self) {
13651 PyObject *__pyx_r = NULL;
13652 __Pyx_RefNannyDeclarations
13653 PyObject *__pyx_t_1 = NULL;
13654 int __pyx_lineno = 0;
13655 const char *__pyx_filename = NULL;
13656 int __pyx_clineno = 0;
13657 __Pyx_RefNannySetupContext(
"__get__", 0);
13666 __Pyx_XDECREF(__pyx_r);
13667 __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->view.ndim);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 583, __pyx_L1_error)
13668 __Pyx_GOTREF(__pyx_t_1);
13669 __pyx_r = __pyx_t_1;
13683 __Pyx_XDECREF(__pyx_t_1);
13684 __Pyx_AddTraceback(
"View.MemoryView.memoryview.ndim.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
13687 __Pyx_XGIVEREF(__pyx_r);
13688 __Pyx_RefNannyFinishContext();
13701 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_8itemsize_1__get__(PyObject *__pyx_v_self);
13702 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_8itemsize_1__get__(PyObject *__pyx_v_self) {
13703 PyObject *__pyx_r = 0;
13704 __Pyx_RefNannyDeclarations
13705 __Pyx_RefNannySetupContext(
"__get__ (wrapper)", 0);
13706 __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_8itemsize___get__(((
struct __pyx_memoryview_obj *)__pyx_v_self));
13709 __Pyx_RefNannyFinishContext();
13713 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_8itemsize___get__(
struct __pyx_memoryview_obj *__pyx_v_self) {
13714 PyObject *__pyx_r = NULL;
13715 __Pyx_RefNannyDeclarations
13716 PyObject *__pyx_t_1 = NULL;
13717 int __pyx_lineno = 0;
13718 const char *__pyx_filename = NULL;
13719 int __pyx_clineno = 0;
13720 __Pyx_RefNannySetupContext(
"__get__", 0);
13729 __Pyx_XDECREF(__pyx_r);
13730 __pyx_t_1 = PyInt_FromSsize_t(__pyx_v_self->view.itemsize);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 587, __pyx_L1_error)
13731 __Pyx_GOTREF(__pyx_t_1);
13732 __pyx_r = __pyx_t_1;
13746 __Pyx_XDECREF(__pyx_t_1);
13747 __Pyx_AddTraceback(
"View.MemoryView.memoryview.itemsize.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
13750 __Pyx_XGIVEREF(__pyx_r);
13751 __Pyx_RefNannyFinishContext();
13764 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_6nbytes_1__get__(PyObject *__pyx_v_self);
13765 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_6nbytes_1__get__(PyObject *__pyx_v_self) {
13766 PyObject *__pyx_r = 0;
13767 __Pyx_RefNannyDeclarations
13768 __Pyx_RefNannySetupContext(
"__get__ (wrapper)", 0);
13769 __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_6nbytes___get__(((
struct __pyx_memoryview_obj *)__pyx_v_self));
13772 __Pyx_RefNannyFinishContext();
13776 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_6nbytes___get__(
struct __pyx_memoryview_obj *__pyx_v_self) {
13777 PyObject *__pyx_r = NULL;
13778 __Pyx_RefNannyDeclarations
13779 PyObject *__pyx_t_1 = NULL;
13780 PyObject *__pyx_t_2 = NULL;
13781 PyObject *__pyx_t_3 = NULL;
13782 int __pyx_lineno = 0;
13783 const char *__pyx_filename = NULL;
13784 int __pyx_clineno = 0;
13785 __Pyx_RefNannySetupContext(
"__get__", 0);
13794 __Pyx_XDECREF(__pyx_r);
13795 __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)
13796 __Pyx_GOTREF(__pyx_t_1);
13797 __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_self->view.itemsize);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 591, __pyx_L1_error)
13798 __Pyx_GOTREF(__pyx_t_2);
13799 __pyx_t_3 = PyNumber_Multiply(__pyx_t_1, __pyx_t_2);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 591, __pyx_L1_error)
13800 __Pyx_GOTREF(__pyx_t_3);
13801 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
13802 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
13803 __pyx_r = __pyx_t_3;
13817 __Pyx_XDECREF(__pyx_t_1);
13818 __Pyx_XDECREF(__pyx_t_2);
13819 __Pyx_XDECREF(__pyx_t_3);
13820 __Pyx_AddTraceback(
"View.MemoryView.memoryview.nbytes.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
13823 __Pyx_XGIVEREF(__pyx_r);
13824 __Pyx_RefNannyFinishContext();
13837 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_4size_1__get__(PyObject *__pyx_v_self);
13838 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_4size_1__get__(PyObject *__pyx_v_self) {
13839 PyObject *__pyx_r = 0;
13840 __Pyx_RefNannyDeclarations
13841 __Pyx_RefNannySetupContext(
"__get__ (wrapper)", 0);
13842 __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_4size___get__(((
struct __pyx_memoryview_obj *)__pyx_v_self));
13845 __Pyx_RefNannyFinishContext();
13849 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_4size___get__(
struct __pyx_memoryview_obj *__pyx_v_self) {
13850 PyObject *__pyx_v_result = NULL;
13851 PyObject *__pyx_v_length = NULL;
13852 PyObject *__pyx_r = NULL;
13853 __Pyx_RefNannyDeclarations
13856 Py_ssize_t *__pyx_t_3;
13857 Py_ssize_t *__pyx_t_4;
13858 Py_ssize_t *__pyx_t_5;
13859 PyObject *__pyx_t_6 = NULL;
13860 int __pyx_lineno = 0;
13861 const char *__pyx_filename = NULL;
13862 int __pyx_clineno = 0;
13863 __Pyx_RefNannySetupContext(
"__get__", 0);
13872 __pyx_t_1 = (__pyx_v_self->_size == Py_None);
13873 __pyx_t_2 = (__pyx_t_1 != 0);
13883 __Pyx_INCREF(__pyx_int_1);
13884 __pyx_v_result = __pyx_int_1;
13893 __pyx_t_4 = (__pyx_v_self->view.shape + __pyx_v_self->view.ndim);
13894 for (__pyx_t_5 = __pyx_v_self->view.shape; __pyx_t_5 < __pyx_t_4; __pyx_t_5++) {
13895 __pyx_t_3 = __pyx_t_5;
13896 __pyx_t_6 = PyInt_FromSsize_t((__pyx_t_3[0]));
if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 598, __pyx_L1_error)
13897 __Pyx_GOTREF(__pyx_t_6);
13898 __Pyx_XDECREF_SET(__pyx_v_length, __pyx_t_6);
13908 __pyx_t_6 = PyNumber_InPlaceMultiply(__pyx_v_result, __pyx_v_length);
if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 599, __pyx_L1_error)
13909 __Pyx_GOTREF(__pyx_t_6);
13910 __Pyx_DECREF_SET(__pyx_v_result, __pyx_t_6);
13921 __Pyx_INCREF(__pyx_v_result);
13922 __Pyx_GIVEREF(__pyx_v_result);
13923 __Pyx_GOTREF(__pyx_v_self->_size);
13924 __Pyx_DECREF(__pyx_v_self->_size);
13925 __pyx_v_self->_size = __pyx_v_result;
13943 __Pyx_XDECREF(__pyx_r);
13944 __Pyx_INCREF(__pyx_v_self->_size);
13945 __pyx_r = __pyx_v_self->_size;
13958 __Pyx_XDECREF(__pyx_t_6);
13959 __Pyx_AddTraceback(
"View.MemoryView.memoryview.size.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
13962 __Pyx_XDECREF(__pyx_v_result);
13963 __Pyx_XDECREF(__pyx_v_length);
13964 __Pyx_XGIVEREF(__pyx_r);
13965 __Pyx_RefNannyFinishContext();
13978 static Py_ssize_t __pyx_memoryview___len__(PyObject *__pyx_v_self);
13979 static Py_ssize_t __pyx_memoryview___len__(PyObject *__pyx_v_self) {
13980 Py_ssize_t __pyx_r;
13981 __Pyx_RefNannyDeclarations
13982 __Pyx_RefNannySetupContext(
"__len__ (wrapper)", 0);
13983 __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_10__len__(((
struct __pyx_memoryview_obj *)__pyx_v_self));
13986 __Pyx_RefNannyFinishContext();
13990 static Py_ssize_t __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_10__len__(
struct __pyx_memoryview_obj *__pyx_v_self) {
13991 Py_ssize_t __pyx_r;
13992 __Pyx_RefNannyDeclarations
13994 __Pyx_RefNannySetupContext(
"__len__", 0);
14003 __pyx_t_1 = ((__pyx_v_self->view.ndim >= 1) != 0);
14013 __pyx_r = (__pyx_v_self->view.shape[0]);
14045 __Pyx_RefNannyFinishContext();
14058 static PyObject *__pyx_memoryview___repr__(PyObject *__pyx_v_self);
14059 static PyObject *__pyx_memoryview___repr__(PyObject *__pyx_v_self) {
14060 PyObject *__pyx_r = 0;
14061 __Pyx_RefNannyDeclarations
14062 __Pyx_RefNannySetupContext(
"__repr__ (wrapper)", 0);
14063 __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_12__repr__(((
struct __pyx_memoryview_obj *)__pyx_v_self));
14066 __Pyx_RefNannyFinishContext();
14070 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_12__repr__(
struct __pyx_memoryview_obj *__pyx_v_self) {
14071 PyObject *__pyx_r = NULL;
14072 __Pyx_RefNannyDeclarations
14073 PyObject *__pyx_t_1 = NULL;
14074 PyObject *__pyx_t_2 = NULL;
14075 PyObject *__pyx_t_3 = NULL;
14076 int __pyx_lineno = 0;
14077 const char *__pyx_filename = NULL;
14078 int __pyx_clineno = 0;
14079 __Pyx_RefNannySetupContext(
"__repr__", 0);
14088 __Pyx_XDECREF(__pyx_r);
14089 __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)
14090 __Pyx_GOTREF(__pyx_t_1);
14091 __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)
14092 __Pyx_GOTREF(__pyx_t_2);
14093 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
14094 __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)
14095 __Pyx_GOTREF(__pyx_t_1);
14096 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
14105 __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)
14106 __Pyx_GOTREF(__pyx_t_2);
14115 __pyx_t_3 = PyTuple_New(2);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 612, __pyx_L1_error)
14116 __Pyx_GOTREF(__pyx_t_3);
14117 __Pyx_GIVEREF(__pyx_t_1);
14118 PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1);
14119 __Pyx_GIVEREF(__pyx_t_2);
14120 PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_2);
14123 __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)
14124 __Pyx_GOTREF(__pyx_t_2);
14125 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
14126 __pyx_r = __pyx_t_2;
14140 __Pyx_XDECREF(__pyx_t_1);
14141 __Pyx_XDECREF(__pyx_t_2);
14142 __Pyx_XDECREF(__pyx_t_3);
14143 __Pyx_AddTraceback(
"View.MemoryView.memoryview.__repr__", __pyx_clineno, __pyx_lineno, __pyx_filename);
14146 __Pyx_XGIVEREF(__pyx_r);
14147 __Pyx_RefNannyFinishContext();
14160 static PyObject *__pyx_memoryview___str__(PyObject *__pyx_v_self);
14161 static PyObject *__pyx_memoryview___str__(PyObject *__pyx_v_self) {
14162 PyObject *__pyx_r = 0;
14163 __Pyx_RefNannyDeclarations
14164 __Pyx_RefNannySetupContext(
"__str__ (wrapper)", 0);
14165 __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_14__str__(((
struct __pyx_memoryview_obj *)__pyx_v_self));
14168 __Pyx_RefNannyFinishContext();
14172 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_14__str__(
struct __pyx_memoryview_obj *__pyx_v_self) {
14173 PyObject *__pyx_r = NULL;
14174 __Pyx_RefNannyDeclarations
14175 PyObject *__pyx_t_1 = NULL;
14176 PyObject *__pyx_t_2 = NULL;
14177 int __pyx_lineno = 0;
14178 const char *__pyx_filename = NULL;
14179 int __pyx_clineno = 0;
14180 __Pyx_RefNannySetupContext(
"__str__", 0);
14189 __Pyx_XDECREF(__pyx_r);
14190 __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)
14191 __Pyx_GOTREF(__pyx_t_1);
14192 __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)
14193 __Pyx_GOTREF(__pyx_t_2);
14194 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
14195 __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)
14196 __Pyx_GOTREF(__pyx_t_1);
14197 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
14198 __pyx_t_2 = PyTuple_New(1);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 616, __pyx_L1_error)
14199 __Pyx_GOTREF(__pyx_t_2);
14200 __Pyx_GIVEREF(__pyx_t_1);
14201 PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1);
14203 __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)
14204 __Pyx_GOTREF(__pyx_t_1);
14205 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
14206 __pyx_r = __pyx_t_1;
14220 __Pyx_XDECREF(__pyx_t_1);
14221 __Pyx_XDECREF(__pyx_t_2);
14222 __Pyx_AddTraceback(
"View.MemoryView.memoryview.__str__", __pyx_clineno, __pyx_lineno, __pyx_filename);
14225 __Pyx_XGIVEREF(__pyx_r);
14226 __Pyx_RefNannyFinishContext();
14239 static PyObject *__pyx_memoryview_is_c_contig(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused);
14240 static PyObject *__pyx_memoryview_is_c_contig(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
14241 PyObject *__pyx_r = 0;
14242 __Pyx_RefNannyDeclarations
14243 __Pyx_RefNannySetupContext(
"is_c_contig (wrapper)", 0);
14244 __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_16is_c_contig(((
struct __pyx_memoryview_obj *)__pyx_v_self));
14247 __Pyx_RefNannyFinishContext();
14251 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_16is_c_contig(
struct __pyx_memoryview_obj *__pyx_v_self) {
14252 __Pyx_memviewslice *__pyx_v_mslice;
14253 __Pyx_memviewslice __pyx_v_tmp;
14254 PyObject *__pyx_r = NULL;
14255 __Pyx_RefNannyDeclarations
14256 __Pyx_memviewslice *__pyx_t_1;
14257 PyObject *__pyx_t_2 = NULL;
14258 int __pyx_lineno = 0;
14259 const char *__pyx_filename = NULL;
14260 int __pyx_clineno = 0;
14261 __Pyx_RefNannySetupContext(
"is_c_contig", 0);
14270 __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)
14271 __pyx_v_mslice = __pyx_t_1;
14280 __Pyx_XDECREF(__pyx_r);
14281 __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)
14282 __Pyx_GOTREF(__pyx_t_2);
14283 __pyx_r = __pyx_t_2;
14297 __Pyx_XDECREF(__pyx_t_2);
14298 __Pyx_AddTraceback(
"View.MemoryView.memoryview.is_c_contig", __pyx_clineno, __pyx_lineno, __pyx_filename);
14301 __Pyx_XGIVEREF(__pyx_r);
14302 __Pyx_RefNannyFinishContext();
14315 static PyObject *__pyx_memoryview_is_f_contig(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused);
14316 static PyObject *__pyx_memoryview_is_f_contig(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
14317 PyObject *__pyx_r = 0;
14318 __Pyx_RefNannyDeclarations
14319 __Pyx_RefNannySetupContext(
"is_f_contig (wrapper)", 0);
14320 __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_18is_f_contig(((
struct __pyx_memoryview_obj *)__pyx_v_self));
14323 __Pyx_RefNannyFinishContext();
14327 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_18is_f_contig(
struct __pyx_memoryview_obj *__pyx_v_self) {
14328 __Pyx_memviewslice *__pyx_v_mslice;
14329 __Pyx_memviewslice __pyx_v_tmp;
14330 PyObject *__pyx_r = NULL;
14331 __Pyx_RefNannyDeclarations
14332 __Pyx_memviewslice *__pyx_t_1;
14333 PyObject *__pyx_t_2 = NULL;
14334 int __pyx_lineno = 0;
14335 const char *__pyx_filename = NULL;
14336 int __pyx_clineno = 0;
14337 __Pyx_RefNannySetupContext(
"is_f_contig", 0);
14346 __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)
14347 __pyx_v_mslice = __pyx_t_1;
14356 __Pyx_XDECREF(__pyx_r);
14357 __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)
14358 __Pyx_GOTREF(__pyx_t_2);
14359 __pyx_r = __pyx_t_2;
14373 __Pyx_XDECREF(__pyx_t_2);
14374 __Pyx_AddTraceback(
"View.MemoryView.memoryview.is_f_contig", __pyx_clineno, __pyx_lineno, __pyx_filename);
14377 __Pyx_XGIVEREF(__pyx_r);
14378 __Pyx_RefNannyFinishContext();
14391 static PyObject *__pyx_memoryview_copy(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused);
14392 static PyObject *__pyx_memoryview_copy(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
14393 PyObject *__pyx_r = 0;
14394 __Pyx_RefNannyDeclarations
14395 __Pyx_RefNannySetupContext(
"copy (wrapper)", 0);
14396 __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_20copy(((
struct __pyx_memoryview_obj *)__pyx_v_self));
14399 __Pyx_RefNannyFinishContext();
14403 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_20copy(
struct __pyx_memoryview_obj *__pyx_v_self) {
14404 __Pyx_memviewslice __pyx_v_mslice;
14406 PyObject *__pyx_r = NULL;
14407 __Pyx_RefNannyDeclarations
14408 __Pyx_memviewslice __pyx_t_1;
14409 PyObject *__pyx_t_2 = NULL;
14410 int __pyx_lineno = 0;
14411 const char *__pyx_filename = NULL;
14412 int __pyx_clineno = 0;
14413 __Pyx_RefNannySetupContext(
"copy", 0);
14422 __pyx_v_flags = (__pyx_v_self->flags & (~PyBUF_F_CONTIGUOUS));
14431 __pyx_memoryview_slice_copy(__pyx_v_self, (&__pyx_v_mslice));
14440 __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)
14441 __pyx_v_mslice = __pyx_t_1;
14450 __Pyx_XDECREF(__pyx_r);
14451 __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)
14452 __Pyx_GOTREF(__pyx_t_2);
14453 __pyx_r = __pyx_t_2;
14467 __Pyx_XDECREF(__pyx_t_2);
14468 __Pyx_AddTraceback(
"View.MemoryView.memoryview.copy", __pyx_clineno, __pyx_lineno, __pyx_filename);
14471 __Pyx_XGIVEREF(__pyx_r);
14472 __Pyx_RefNannyFinishContext();
14485 static PyObject *__pyx_memoryview_copy_fortran(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused);
14486 static PyObject *__pyx_memoryview_copy_fortran(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
14487 PyObject *__pyx_r = 0;
14488 __Pyx_RefNannyDeclarations
14489 __Pyx_RefNannySetupContext(
"copy_fortran (wrapper)", 0);
14490 __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_22copy_fortran(((
struct __pyx_memoryview_obj *)__pyx_v_self));
14493 __Pyx_RefNannyFinishContext();
14497 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_22copy_fortran(
struct __pyx_memoryview_obj *__pyx_v_self) {
14498 __Pyx_memviewslice __pyx_v_src;
14499 __Pyx_memviewslice __pyx_v_dst;
14501 PyObject *__pyx_r = NULL;
14502 __Pyx_RefNannyDeclarations
14503 __Pyx_memviewslice __pyx_t_1;
14504 PyObject *__pyx_t_2 = NULL;
14505 int __pyx_lineno = 0;
14506 const char *__pyx_filename = NULL;
14507 int __pyx_clineno = 0;
14508 __Pyx_RefNannySetupContext(
"copy_fortran", 0);
14517 __pyx_v_flags = (__pyx_v_self->flags & (~PyBUF_C_CONTIGUOUS));
14526 __pyx_memoryview_slice_copy(__pyx_v_self, (&__pyx_v_src));
14535 __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)
14536 __pyx_v_dst = __pyx_t_1;
14545 __Pyx_XDECREF(__pyx_r);
14546 __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)
14547 __Pyx_GOTREF(__pyx_t_2);
14548 __pyx_r = __pyx_t_2;
14562 __Pyx_XDECREF(__pyx_t_2);
14563 __Pyx_AddTraceback(
"View.MemoryView.memoryview.copy_fortran", __pyx_clineno, __pyx_lineno, __pyx_filename);
14566 __Pyx_XGIVEREF(__pyx_r);
14567 __Pyx_RefNannyFinishContext();
14578 static PyObject *__pyx_pw___pyx_memoryview_1__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused);
14579 static PyObject *__pyx_pw___pyx_memoryview_1__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
14580 PyObject *__pyx_r = 0;
14581 __Pyx_RefNannyDeclarations
14582 __Pyx_RefNannySetupContext(
"__reduce_cython__ (wrapper)", 0);
14583 __pyx_r = __pyx_pf___pyx_memoryview___reduce_cython__(((
struct __pyx_memoryview_obj *)__pyx_v_self));
14586 __Pyx_RefNannyFinishContext();
14590 static PyObject *__pyx_pf___pyx_memoryview___reduce_cython__(CYTHON_UNUSED
struct __pyx_memoryview_obj *__pyx_v_self) {
14591 PyObject *__pyx_r = NULL;
14592 __Pyx_RefNannyDeclarations
14593 PyObject *__pyx_t_1 = NULL;
14594 int __pyx_lineno = 0;
14595 const char *__pyx_filename = NULL;
14596 int __pyx_clineno = 0;
14597 __Pyx_RefNannySetupContext(
"__reduce_cython__", 0);
14605 __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__19, NULL);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 2, __pyx_L1_error)
14606 __Pyx_GOTREF(__pyx_t_1);
14607 __Pyx_Raise(__pyx_t_1, 0, 0, 0);
14608 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
14609 __PYX_ERR(1, 2, __pyx_L1_error)
14619 __Pyx_XDECREF(__pyx_t_1);
14620 __Pyx_AddTraceback(
"View.MemoryView.memoryview.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
14622 __Pyx_XGIVEREF(__pyx_r);
14623 __Pyx_RefNannyFinishContext();
14635 static PyObject *__pyx_pw___pyx_memoryview_3__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state);
14636 static PyObject *__pyx_pw___pyx_memoryview_3__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
14637 PyObject *__pyx_r = 0;
14638 __Pyx_RefNannyDeclarations
14639 __Pyx_RefNannySetupContext(
"__setstate_cython__ (wrapper)", 0);
14640 __pyx_r = __pyx_pf___pyx_memoryview_2__setstate_cython__(((
struct __pyx_memoryview_obj *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state));
14643 __Pyx_RefNannyFinishContext();
14647 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) {
14648 PyObject *__pyx_r = NULL;
14649 __Pyx_RefNannyDeclarations
14650 PyObject *__pyx_t_1 = NULL;
14651 int __pyx_lineno = 0;
14652 const char *__pyx_filename = NULL;
14653 int __pyx_clineno = 0;
14654 __Pyx_RefNannySetupContext(
"__setstate_cython__", 0);
14661 __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__20, NULL);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 4, __pyx_L1_error)
14662 __Pyx_GOTREF(__pyx_t_1);
14663 __Pyx_Raise(__pyx_t_1, 0, 0, 0);
14664 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
14665 __PYX_ERR(1, 4, __pyx_L1_error)
14676 __Pyx_XDECREF(__pyx_t_1);
14677 __Pyx_AddTraceback(
"View.MemoryView.memoryview.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
14679 __Pyx_XGIVEREF(__pyx_r);
14680 __Pyx_RefNannyFinishContext();
14692 static PyObject *__pyx_memoryview_new(PyObject *__pyx_v_o,
int __pyx_v_flags,
int __pyx_v_dtype_is_object, __Pyx_TypeInfo *__pyx_v_typeinfo) {
14693 struct __pyx_memoryview_obj *__pyx_v_result = 0;
14694 PyObject *__pyx_r = NULL;
14695 __Pyx_RefNannyDeclarations
14696 PyObject *__pyx_t_1 = NULL;
14697 PyObject *__pyx_t_2 = NULL;
14698 PyObject *__pyx_t_3 = NULL;
14699 int __pyx_lineno = 0;
14700 const char *__pyx_filename = NULL;
14701 int __pyx_clineno = 0;
14702 __Pyx_RefNannySetupContext(
"memoryview_cwrapper", 0);
14711 __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_flags);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 658, __pyx_L1_error)
14712 __Pyx_GOTREF(__pyx_t_1);
14713 __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_v_dtype_is_object);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 658, __pyx_L1_error)
14714 __Pyx_GOTREF(__pyx_t_2);
14715 __pyx_t_3 = PyTuple_New(3);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 658, __pyx_L1_error)
14716 __Pyx_GOTREF(__pyx_t_3);
14717 __Pyx_INCREF(__pyx_v_o);
14718 __Pyx_GIVEREF(__pyx_v_o);
14719 PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_o);
14720 __Pyx_GIVEREF(__pyx_t_1);
14721 PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_1);
14722 __Pyx_GIVEREF(__pyx_t_2);
14723 PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_t_2);
14726 __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)
14727 __Pyx_GOTREF(__pyx_t_2);
14728 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
14729 __pyx_v_result = ((
struct __pyx_memoryview_obj *)__pyx_t_2);
14739 __pyx_v_result->typeinfo = __pyx_v_typeinfo;
14748 __Pyx_XDECREF(__pyx_r);
14749 __Pyx_INCREF(((PyObject *)__pyx_v_result));
14750 __pyx_r = ((PyObject *)__pyx_v_result);
14763 __Pyx_XDECREF(__pyx_t_1);
14764 __Pyx_XDECREF(__pyx_t_2);
14765 __Pyx_XDECREF(__pyx_t_3);
14766 __Pyx_AddTraceback(
"View.MemoryView.memoryview_cwrapper", __pyx_clineno, __pyx_lineno, __pyx_filename);
14769 __Pyx_XDECREF((PyObject *)__pyx_v_result);
14770 __Pyx_XGIVEREF(__pyx_r);
14771 __Pyx_RefNannyFinishContext();
14783 static CYTHON_INLINE
int __pyx_memoryview_check(PyObject *__pyx_v_o) {
14785 __Pyx_RefNannyDeclarations
14787 __Pyx_RefNannySetupContext(
"memoryview_check", 0);
14796 __pyx_t_1 = __Pyx_TypeCheck(__pyx_v_o, __pyx_memoryview_type);
14797 __pyx_r = __pyx_t_1;
14810 __Pyx_RefNannyFinishContext();
14822 static PyObject *_unellipsify(PyObject *__pyx_v_index,
int __pyx_v_ndim) {
14823 PyObject *__pyx_v_tup = NULL;
14824 PyObject *__pyx_v_result = NULL;
14825 int __pyx_v_have_slices;
14826 int __pyx_v_seen_ellipsis;
14827 CYTHON_UNUSED PyObject *__pyx_v_idx = NULL;
14828 PyObject *__pyx_v_item = NULL;
14829 Py_ssize_t __pyx_v_nslices;
14830 PyObject *__pyx_r = NULL;
14831 __Pyx_RefNannyDeclarations
14834 PyObject *__pyx_t_3 = NULL;
14835 PyObject *__pyx_t_4 = NULL;
14836 Py_ssize_t __pyx_t_5;
14837 PyObject *(*__pyx_t_6)(PyObject *);
14838 PyObject *__pyx_t_7 = NULL;
14839 Py_ssize_t __pyx_t_8;
14842 PyObject *__pyx_t_11 = NULL;
14843 int __pyx_lineno = 0;
14844 const char *__pyx_filename = NULL;
14845 int __pyx_clineno = 0;
14846 __Pyx_RefNannySetupContext(
"_unellipsify", 0);
14855 __pyx_t_1 = PyTuple_Check(__pyx_v_index);
14856 __pyx_t_2 = ((!(__pyx_t_1 != 0)) != 0);
14866 __pyx_t_3 = PyTuple_New(1);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 672, __pyx_L1_error)
14867 __Pyx_GOTREF(__pyx_t_3);
14868 __Pyx_INCREF(__pyx_v_index);
14869 __Pyx_GIVEREF(__pyx_v_index);
14870 PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_index);
14871 __pyx_v_tup = __pyx_t_3;
14892 __Pyx_INCREF(__pyx_v_index);
14893 __pyx_v_tup = __pyx_v_index;
14904 __pyx_t_3 = PyList_New(0);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 676, __pyx_L1_error)
14905 __Pyx_GOTREF(__pyx_t_3);
14906 __pyx_v_result = ((PyObject*)__pyx_t_3);
14916 __pyx_v_have_slices = 0;
14925 __pyx_v_seen_ellipsis = 0;
14934 __Pyx_INCREF(__pyx_int_0);
14935 __pyx_t_3 = __pyx_int_0;
14936 if (likely(PyList_CheckExact(__pyx_v_tup)) || PyTuple_CheckExact(__pyx_v_tup)) {
14937 __pyx_t_4 = __pyx_v_tup; __Pyx_INCREF(__pyx_t_4); __pyx_t_5 = 0;
14940 __pyx_t_5 = -1; __pyx_t_4 = PyObject_GetIter(__pyx_v_tup);
if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 679, __pyx_L1_error)
14941 __Pyx_GOTREF(__pyx_t_4);
14942 __pyx_t_6 = Py_TYPE(__pyx_t_4)->tp_iternext;
if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 679, __pyx_L1_error)
14945 if (likely(!__pyx_t_6)) {
14946 if (likely(PyList_CheckExact(__pyx_t_4))) {
14947 if (__pyx_t_5 >= PyList_GET_SIZE(__pyx_t_4))
break;
14948 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
14949 __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)
14951 __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)
14952 __Pyx_GOTREF(__pyx_t_7);
14955 if (__pyx_t_5 >= PyTuple_GET_SIZE(__pyx_t_4))
break;
14956 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
14957 __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)
14959 __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)
14960 __Pyx_GOTREF(__pyx_t_7);
14964 __pyx_t_7 = __pyx_t_6(__pyx_t_4);
14965 if (unlikely(!__pyx_t_7)) {
14966 PyObject* exc_type = PyErr_Occurred();
14968 if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
14969 else __PYX_ERR(1, 679, __pyx_L1_error)
14973 __Pyx_GOTREF(__pyx_t_7);
14975 __Pyx_XDECREF_SET(__pyx_v_item, __pyx_t_7);
14977 __Pyx_INCREF(__pyx_t_3);
14978 __Pyx_XDECREF_SET(__pyx_v_idx, __pyx_t_3);
14979 __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)
14980 __Pyx_GOTREF(__pyx_t_7);
14981 __Pyx_DECREF(__pyx_t_3);
14982 __pyx_t_3 = __pyx_t_7;
14992 __pyx_t_2 = (__pyx_v_item == __pyx_builtin_Ellipsis);
14993 __pyx_t_1 = (__pyx_t_2 != 0);
15003 __pyx_t_1 = ((!(__pyx_v_seen_ellipsis != 0)) != 0);
15013 __pyx_t_8 = PyObject_Length(__pyx_v_tup);
if (unlikely(__pyx_t_8 == ((Py_ssize_t)-1))) __PYX_ERR(1, 682, __pyx_L1_error)
15014 __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)
15015 __Pyx_GOTREF(__pyx_t_7);
15016 { Py_ssize_t __pyx_temp;
15017 for (__pyx_temp=0; __pyx_temp < ((__pyx_v_ndim - __pyx_t_8) + 1); __pyx_temp++) {
15018 __Pyx_INCREF(__pyx_slice__21);
15019 __Pyx_GIVEREF(__pyx_slice__21);
15020 PyList_SET_ITEM(__pyx_t_7, __pyx_temp, __pyx_slice__21);
15023 __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)
15024 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
15033 __pyx_v_seen_ellipsis = 1;
15053 __pyx_t_9 = __Pyx_PyList_Append(__pyx_v_result, __pyx_slice__21);
if (unlikely(__pyx_t_9 == ((
int)-1))) __PYX_ERR(1, 685, __pyx_L1_error)
15064 __pyx_v_have_slices = 1;
15084 __pyx_t_2 = PySlice_Check(__pyx_v_item);
15085 __pyx_t_10 = ((!(__pyx_t_2 != 0)) != 0);
15088 __pyx_t_1 = __pyx_t_10;
15089 goto __pyx_L9_bool_binop_done;
15091 __pyx_t_10 = ((!(PyIndex_Check(__pyx_v_item) != 0)) != 0);
15092 __pyx_t_1 = __pyx_t_10;
15093 __pyx_L9_bool_binop_done:;
15094 if (unlikely(__pyx_t_1)) {
15103 __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)
15104 __Pyx_GOTREF(__pyx_t_7);
15105 __pyx_t_11 = __Pyx_PyObject_CallOneArg(__pyx_builtin_TypeError, __pyx_t_7);
if (unlikely(!__pyx_t_11)) __PYX_ERR(1, 689, __pyx_L1_error)
15106 __Pyx_GOTREF(__pyx_t_11);
15107 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
15108 __Pyx_Raise(__pyx_t_11, 0, 0, 0);
15109 __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
15110 __PYX_ERR(1, 689, __pyx_L1_error)
15128 __pyx_t_10 = (__pyx_v_have_slices != 0);
15131 __pyx_t_1 = __pyx_t_10;
15132 goto __pyx_L11_bool_binop_done;
15134 __pyx_t_10 = PySlice_Check(__pyx_v_item);
15135 __pyx_t_2 = (__pyx_t_10 != 0);
15136 __pyx_t_1 = __pyx_t_2;
15137 __pyx_L11_bool_binop_done:;
15138 __pyx_v_have_slices = __pyx_t_1;
15147 __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)
15159 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
15160 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
15169 __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)
15170 __pyx_v_nslices = (__pyx_v_ndim - __pyx_t_5);
15179 __pyx_t_1 = (__pyx_v_nslices != 0);
15189 __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)
15190 __Pyx_GOTREF(__pyx_t_3);
15191 { Py_ssize_t __pyx_temp;
15192 for (__pyx_temp=0; __pyx_temp < __pyx_v_nslices; __pyx_temp++) {
15193 __Pyx_INCREF(__pyx_slice__21);
15194 __Pyx_GIVEREF(__pyx_slice__21);
15195 PyList_SET_ITEM(__pyx_t_3, __pyx_temp, __pyx_slice__21);
15198 __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)
15199 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
15217 __Pyx_XDECREF(__pyx_r);
15218 if (!__pyx_v_have_slices) {
15220 __pyx_t_4 = __Pyx_PyBool_FromLong(__pyx_v_have_slices);
if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 698, __pyx_L1_error)
15221 __Pyx_GOTREF(__pyx_t_4);
15222 __pyx_t_3 = __pyx_t_4;
15224 goto __pyx_L14_bool_binop_done;
15226 __pyx_t_4 = PyInt_FromSsize_t(__pyx_v_nslices);
if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 698, __pyx_L1_error)
15227 __Pyx_GOTREF(__pyx_t_4);
15228 __pyx_t_3 = __pyx_t_4;
15230 __pyx_L14_bool_binop_done:;
15231 __pyx_t_4 = PyList_AsTuple(__pyx_v_result);
if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 698, __pyx_L1_error)
15232 __Pyx_GOTREF(__pyx_t_4);
15233 __pyx_t_11 = PyTuple_New(2);
if (unlikely(!__pyx_t_11)) __PYX_ERR(1, 698, __pyx_L1_error)
15234 __Pyx_GOTREF(__pyx_t_11);
15235 __Pyx_GIVEREF(__pyx_t_3);
15236 PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_t_3);
15237 __Pyx_GIVEREF(__pyx_t_4);
15238 PyTuple_SET_ITEM(__pyx_t_11, 1, __pyx_t_4);
15241 __pyx_r = ((PyObject*)__pyx_t_11);
15255 __Pyx_XDECREF(__pyx_t_3);
15256 __Pyx_XDECREF(__pyx_t_4);
15257 __Pyx_XDECREF(__pyx_t_7);
15258 __Pyx_XDECREF(__pyx_t_11);
15259 __Pyx_AddTraceback(
"View.MemoryView._unellipsify", __pyx_clineno, __pyx_lineno, __pyx_filename);
15262 __Pyx_XDECREF(__pyx_v_tup);
15263 __Pyx_XDECREF(__pyx_v_result);
15264 __Pyx_XDECREF(__pyx_v_idx);
15265 __Pyx_XDECREF(__pyx_v_item);
15266 __Pyx_XGIVEREF(__pyx_r);
15267 __Pyx_RefNannyFinishContext();
15279 static PyObject *assert_direct_dimensions(Py_ssize_t *__pyx_v_suboffsets,
int __pyx_v_ndim) {
15280 Py_ssize_t __pyx_v_suboffset;
15281 PyObject *__pyx_r = NULL;
15282 __Pyx_RefNannyDeclarations
15283 Py_ssize_t *__pyx_t_1;
15284 Py_ssize_t *__pyx_t_2;
15285 Py_ssize_t *__pyx_t_3;
15287 PyObject *__pyx_t_5 = NULL;
15288 int __pyx_lineno = 0;
15289 const char *__pyx_filename = NULL;
15290 int __pyx_clineno = 0;
15291 __Pyx_RefNannySetupContext(
"assert_direct_dimensions", 0);
15300 __pyx_t_2 = (__pyx_v_suboffsets + __pyx_v_ndim);
15301 for (__pyx_t_3 = __pyx_v_suboffsets; __pyx_t_3 < __pyx_t_2; __pyx_t_3++) {
15302 __pyx_t_1 = __pyx_t_3;
15303 __pyx_v_suboffset = (__pyx_t_1[0]);
15312 __pyx_t_4 = ((__pyx_v_suboffset >= 0) != 0);
15313 if (unlikely(__pyx_t_4)) {
15322 __pyx_t_5 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__22, NULL);
if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 703, __pyx_L1_error)
15323 __Pyx_GOTREF(__pyx_t_5);
15324 __Pyx_Raise(__pyx_t_5, 0, 0, 0);
15325 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
15326 __PYX_ERR(1, 703, __pyx_L1_error)
15347 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
15350 __Pyx_XDECREF(__pyx_t_5);
15351 __Pyx_AddTraceback(
"View.MemoryView.assert_direct_dimensions", __pyx_clineno, __pyx_lineno, __pyx_filename);
15354 __Pyx_XGIVEREF(__pyx_r);
15355 __Pyx_RefNannyFinishContext();
15367 static struct __pyx_memoryview_obj *__pyx_memview_slice(
struct __pyx_memoryview_obj *__pyx_v_memview, PyObject *__pyx_v_indices) {
15368 int __pyx_v_new_ndim;
15369 int __pyx_v_suboffset_dim;
15371 __Pyx_memviewslice __pyx_v_src;
15372 __Pyx_memviewslice __pyx_v_dst;
15373 __Pyx_memviewslice *__pyx_v_p_src;
15374 struct __pyx_memoryviewslice_obj *__pyx_v_memviewsliceobj = 0;
15375 __Pyx_memviewslice *__pyx_v_p_dst;
15376 int *__pyx_v_p_suboffset_dim;
15377 Py_ssize_t __pyx_v_start;
15378 Py_ssize_t __pyx_v_stop;
15379 Py_ssize_t __pyx_v_step;
15380 int __pyx_v_have_start;
15381 int __pyx_v_have_stop;
15382 int __pyx_v_have_step;
15383 PyObject *__pyx_v_index = NULL;
15384 struct __pyx_memoryview_obj *__pyx_r = NULL;
15385 __Pyx_RefNannyDeclarations
15388 PyObject *__pyx_t_3 = NULL;
15389 struct __pyx_memoryview_obj *__pyx_t_4;
15392 Py_ssize_t __pyx_t_7;
15393 PyObject *(*__pyx_t_8)(PyObject *);
15394 PyObject *__pyx_t_9 = NULL;
15395 Py_ssize_t __pyx_t_10;
15397 Py_ssize_t __pyx_t_12;
15398 int __pyx_lineno = 0;
15399 const char *__pyx_filename = NULL;
15400 int __pyx_clineno = 0;
15401 __Pyx_RefNannySetupContext(
"memview_slice", 0);
15410 __pyx_v_new_ndim = 0;
15411 __pyx_v_suboffset_dim = -1;
15420 (void)(memset((&__pyx_v_dst), 0, (
sizeof(__pyx_v_dst))));
15429 #ifndef CYTHON_WITHOUT_ASSERTIONS
15430 if (unlikely(!Py_OptimizeFlag)) {
15431 if (unlikely(!((__pyx_v_memview->view.ndim > 0) != 0))) {
15432 PyErr_SetNone(PyExc_AssertionError);
15433 __PYX_ERR(1, 722, __pyx_L1_error)
15445 __pyx_t_1 = __Pyx_TypeCheck(((PyObject *)__pyx_v_memview), __pyx_memoryviewslice_type);
15446 __pyx_t_2 = (__pyx_t_1 != 0);
15456 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)
15457 __pyx_t_3 = ((PyObject *)__pyx_v_memview);
15458 __Pyx_INCREF(__pyx_t_3);
15459 __pyx_v_memviewsliceobj = ((
struct __pyx_memoryviewslice_obj *)__pyx_t_3);
15469 __pyx_v_p_src = (&__pyx_v_memviewsliceobj->from_slice);
15489 __pyx_memoryview_slice_copy(__pyx_v_memview, (&__pyx_v_src));
15498 __pyx_v_p_src = (&__pyx_v_src);
15509 __pyx_t_4 = __pyx_v_p_src->memview;
15510 __pyx_v_dst.memview = __pyx_t_4;
15519 __pyx_t_5 = __pyx_v_p_src->data;
15520 __pyx_v_dst.data = __pyx_t_5;
15529 __pyx_v_p_dst = (&__pyx_v_dst);
15538 __pyx_v_p_suboffset_dim = (&__pyx_v_suboffset_dim);
15548 if (likely(PyList_CheckExact(__pyx_v_indices)) || PyTuple_CheckExact(__pyx_v_indices)) {
15549 __pyx_t_3 = __pyx_v_indices; __Pyx_INCREF(__pyx_t_3); __pyx_t_7 = 0;
15552 __pyx_t_7 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_v_indices);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 746, __pyx_L1_error)
15553 __Pyx_GOTREF(__pyx_t_3);
15554 __pyx_t_8 = Py_TYPE(__pyx_t_3)->tp_iternext;
if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 746, __pyx_L1_error)
15557 if (likely(!__pyx_t_8)) {
15558 if (likely(PyList_CheckExact(__pyx_t_3))) {
15559 if (__pyx_t_7 >= PyList_GET_SIZE(__pyx_t_3))
break;
15560 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
15561 __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)
15563 __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)
15564 __Pyx_GOTREF(__pyx_t_9);
15567 if (__pyx_t_7 >= PyTuple_GET_SIZE(__pyx_t_3))
break;
15568 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
15569 __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)
15571 __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)
15572 __Pyx_GOTREF(__pyx_t_9);
15576 __pyx_t_9 = __pyx_t_8(__pyx_t_3);
15577 if (unlikely(!__pyx_t_9)) {
15578 PyObject* exc_type = PyErr_Occurred();
15580 if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
15581 else __PYX_ERR(1, 746, __pyx_L1_error)
15585 __Pyx_GOTREF(__pyx_t_9);
15587 __Pyx_XDECREF_SET(__pyx_v_index, __pyx_t_9);
15589 __pyx_v_dim = __pyx_t_6;
15590 __pyx_t_6 = (__pyx_t_6 + 1);
15599 __pyx_t_2 = (PyIndex_Check(__pyx_v_index) != 0);
15609 __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)
15618 __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)
15637 __pyx_t_2 = (__pyx_v_index == Py_None);
15638 __pyx_t_1 = (__pyx_t_2 != 0);
15648 (__pyx_v_p_dst->shape[__pyx_v_new_ndim]) = 1;
15657 (__pyx_v_p_dst->strides[__pyx_v_new_ndim]) = 0;
15666 (__pyx_v_p_dst->suboffsets[__pyx_v_new_ndim]) = -1
L;
15675 __pyx_v_new_ndim = (__pyx_v_new_ndim + 1);
15695 __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)
15696 __Pyx_GOTREF(__pyx_t_9);
15697 __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_9);
if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(1, 760, __pyx_L1_error)
15699 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
15701 __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)
15702 __pyx_t_10 = __pyx_t_12;
15703 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
15704 goto __pyx_L7_bool_binop_done;
15707 __pyx_L7_bool_binop_done:;
15708 __pyx_v_start = __pyx_t_10;
15717 __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)
15718 __Pyx_GOTREF(__pyx_t_9);
15719 __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_9);
if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(1, 761, __pyx_L1_error)
15721 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
15723 __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)
15724 __pyx_t_10 = __pyx_t_12;
15725 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
15726 goto __pyx_L9_bool_binop_done;
15729 __pyx_L9_bool_binop_done:;
15730 __pyx_v_stop = __pyx_t_10;
15739 __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)
15740 __Pyx_GOTREF(__pyx_t_9);
15741 __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_9);
if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(1, 762, __pyx_L1_error)
15743 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
15745 __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)
15746 __pyx_t_10 = __pyx_t_12;
15747 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
15748 goto __pyx_L11_bool_binop_done;
15751 __pyx_L11_bool_binop_done:;
15752 __pyx_v_step = __pyx_t_10;
15761 __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)
15762 __Pyx_GOTREF(__pyx_t_9);
15763 __pyx_t_1 = (__pyx_t_9 != Py_None);
15764 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
15765 __pyx_v_have_start = __pyx_t_1;
15774 __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)
15775 __Pyx_GOTREF(__pyx_t_9);
15776 __pyx_t_1 = (__pyx_t_9 != Py_None);
15777 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
15778 __pyx_v_have_stop = __pyx_t_1;
15787 __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)
15788 __Pyx_GOTREF(__pyx_t_9);
15789 __pyx_t_1 = (__pyx_t_9 != Py_None);
15790 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
15791 __pyx_v_have_step = __pyx_t_1;
15800 __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)
15809 __pyx_v_new_ndim = (__pyx_v_new_ndim + 1);
15821 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
15830 __pyx_t_1 = __Pyx_TypeCheck(((PyObject *)__pyx_v_memview), __pyx_memoryviewslice_type);
15831 __pyx_t_2 = (__pyx_t_1 != 0);
15841 __Pyx_XDECREF(((PyObject *)__pyx_r));
15850 if (unlikely(!__pyx_v_memviewsliceobj)) { __Pyx_RaiseUnboundLocalError(
"memviewsliceobj"); __PYX_ERR(1, 778, __pyx_L1_error) }
15859 if (unlikely(!__pyx_v_memviewsliceobj)) { __Pyx_RaiseUnboundLocalError(
"memviewsliceobj"); __PYX_ERR(1, 779, __pyx_L1_error) }
15868 __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)
15869 __Pyx_GOTREF(__pyx_t_3);
15870 if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_memoryview_type))))) __PYX_ERR(1, 777, __pyx_L1_error)
15871 __pyx_r = ((
struct __pyx_memoryview_obj *)__pyx_t_3);
15892 __Pyx_XDECREF(((PyObject *)__pyx_r));
15901 __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)
15902 __Pyx_GOTREF(__pyx_t_3);
15911 if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_memoryview_type))))) __PYX_ERR(1, 782, __pyx_L1_error)
15912 __pyx_r = ((
struct __pyx_memoryview_obj *)__pyx_t_3);
15927 __Pyx_XDECREF(__pyx_t_3);
15928 __Pyx_XDECREF(__pyx_t_9);
15929 __Pyx_AddTraceback(
"View.MemoryView.memview_slice", __pyx_clineno, __pyx_lineno, __pyx_filename);
15932 __Pyx_XDECREF((PyObject *)__pyx_v_memviewsliceobj);
15933 __Pyx_XDECREF(__pyx_v_index);
15934 __Pyx_XGIVEREF((PyObject *)__pyx_r);
15935 __Pyx_RefNannyFinishContext();
15947 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) {
15948 Py_ssize_t __pyx_v_new_shape;
15949 int __pyx_v_negative_step;
15954 int __pyx_lineno = 0;
15955 const char *__pyx_filename = NULL;
15956 int __pyx_clineno = 0;
15965 __pyx_t_1 = ((!(__pyx_v_is_slice != 0)) != 0);
15975 __pyx_t_1 = ((__pyx_v_start < 0) != 0);
15985 __pyx_v_start = (__pyx_v_start + __pyx_v_shape);
16003 __pyx_t_1 = (0 <= __pyx_v_start);
16005 __pyx_t_1 = (__pyx_v_start < __pyx_v_shape);
16007 __pyx_t_2 = ((!(__pyx_t_1 != 0)) != 0);
16017 __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)
16046 __pyx_t_1 = ((__pyx_v_have_step != 0) != 0);
16049 __pyx_t_2 = __pyx_t_1;
16050 goto __pyx_L6_bool_binop_done;
16052 __pyx_t_1 = ((__pyx_v_step < 0) != 0);
16053 __pyx_t_2 = __pyx_t_1;
16054 __pyx_L6_bool_binop_done:;
16055 __pyx_v_negative_step = __pyx_t_2;
16064 __pyx_t_1 = (__pyx_v_have_step != 0);
16067 __pyx_t_2 = __pyx_t_1;
16068 goto __pyx_L9_bool_binop_done;
16070 __pyx_t_1 = ((__pyx_v_step == 0) != 0);
16071 __pyx_t_2 = __pyx_t_1;
16072 __pyx_L9_bool_binop_done:;
16082 __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)
16100 __pyx_t_2 = (__pyx_v_have_start != 0);
16110 __pyx_t_2 = ((__pyx_v_start < 0) != 0);
16120 __pyx_v_start = (__pyx_v_start + __pyx_v_shape);
16129 __pyx_t_2 = ((__pyx_v_start < 0) != 0);
16167 __pyx_t_2 = ((__pyx_v_start >= __pyx_v_shape) != 0);
16177 __pyx_t_2 = (__pyx_v_negative_step != 0);
16187 __pyx_v_start = (__pyx_v_shape - 1);
16207 __pyx_v_start = __pyx_v_shape;
16239 __pyx_t_2 = (__pyx_v_negative_step != 0);
16249 __pyx_v_start = (__pyx_v_shape - 1);
16282 __pyx_t_2 = (__pyx_v_have_stop != 0);
16292 __pyx_t_2 = ((__pyx_v_stop < 0) != 0);
16302 __pyx_v_stop = (__pyx_v_stop + __pyx_v_shape);
16311 __pyx_t_2 = ((__pyx_v_stop < 0) != 0);
16349 __pyx_t_2 = ((__pyx_v_stop > __pyx_v_shape) != 0);
16359 __pyx_v_stop = __pyx_v_shape;
16389 __pyx_t_2 = (__pyx_v_negative_step != 0);
16399 __pyx_v_stop = -1
L;
16419 __pyx_v_stop = __pyx_v_shape;
16432 __pyx_t_2 = ((!(__pyx_v_have_step != 0)) != 0);
16460 __pyx_v_new_shape = ((__pyx_v_stop - __pyx_v_start) / __pyx_v_step);
16469 __pyx_t_2 = (((__pyx_v_stop - __pyx_v_start) - (__pyx_v_step * __pyx_v_new_shape)) != 0);
16479 __pyx_v_new_shape = (__pyx_v_new_shape + 1);
16497 __pyx_t_2 = ((__pyx_v_new_shape < 0) != 0);
16507 __pyx_v_new_shape = 0;
16525 (__pyx_v_dst->strides[__pyx_v_new_ndim]) = (__pyx_v_stride * __pyx_v_step);
16534 (__pyx_v_dst->shape[__pyx_v_new_ndim]) = __pyx_v_new_shape;
16543 (__pyx_v_dst->suboffsets[__pyx_v_new_ndim]) = __pyx_v_suboffset;
16554 __pyx_t_2 = (((__pyx_v_suboffset_dim[0]) < 0) != 0);
16564 __pyx_v_dst->data = (__pyx_v_dst->data + (__pyx_v_start * __pyx_v_stride));
16584 __pyx_t_3 = (__pyx_v_suboffset_dim[0]);
16585 (__pyx_v_dst->suboffsets[__pyx_t_3]) = ((__pyx_v_dst->suboffsets[__pyx_t_3]) + (__pyx_v_start * __pyx_v_stride));
16596 __pyx_t_2 = ((__pyx_v_suboffset >= 0) != 0);
16606 __pyx_t_2 = ((!(__pyx_v_is_slice != 0)) != 0);
16616 __pyx_t_2 = ((__pyx_v_new_ndim == 0) != 0);
16626 __pyx_v_dst->data = ((((
char **)__pyx_v_dst->data)[0]) + __pyx_v_suboffset);
16654 __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)
16676 (__pyx_v_suboffset_dim[0]) = __pyx_v_new_ndim;
16711 PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
16713 __Pyx_AddTraceback(
"View.MemoryView.slice_memviewslice", __pyx_clineno, __pyx_lineno, __pyx_filename);
16715 __Pyx_PyGILState_Release(__pyx_gilstate_save);
16731 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) {
16732 Py_ssize_t __pyx_v_shape;
16733 Py_ssize_t __pyx_v_stride;
16734 Py_ssize_t __pyx_v_suboffset;
16735 Py_ssize_t __pyx_v_itemsize;
16736 char *__pyx_v_resultp;
16738 __Pyx_RefNannyDeclarations
16739 Py_ssize_t __pyx_t_1;
16741 PyObject *__pyx_t_3 = NULL;
16742 PyObject *__pyx_t_4 = NULL;
16743 int __pyx_lineno = 0;
16744 const char *__pyx_filename = NULL;
16745 int __pyx_clineno = 0;
16746 __Pyx_RefNannySetupContext(
"pybuffer_index", 0);
16755 __pyx_v_suboffset = -1
L;
16764 __pyx_t_1 = __pyx_v_view->itemsize;
16765 __pyx_v_itemsize = __pyx_t_1;
16774 __pyx_t_2 = ((__pyx_v_view->ndim == 0) != 0);
16784 if (unlikely(__pyx_v_itemsize == 0)) {
16785 PyErr_SetString(PyExc_ZeroDivisionError,
"integer division or modulo by zero");
16786 __PYX_ERR(1, 917, __pyx_L1_error)
16788 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))) {
16789 PyErr_SetString(PyExc_OverflowError,
"value too large to perform division");
16790 __PYX_ERR(1, 917, __pyx_L1_error)
16792 __pyx_v_shape = __Pyx_div_Py_ssize_t(__pyx_v_view->len, __pyx_v_itemsize);
16801 __pyx_v_stride = __pyx_v_itemsize;
16821 __pyx_v_shape = (__pyx_v_view->shape[__pyx_v_dim]);
16830 __pyx_v_stride = (__pyx_v_view->strides[__pyx_v_dim]);
16839 __pyx_t_2 = ((__pyx_v_view->suboffsets != NULL) != 0);
16849 __pyx_v_suboffset = (__pyx_v_view->suboffsets[__pyx_v_dim]);
16869 __pyx_t_2 = ((__pyx_v_index < 0) != 0);
16879 __pyx_v_index = (__pyx_v_index + (__pyx_v_view->shape[__pyx_v_dim]));
16888 __pyx_t_2 = ((__pyx_v_index < 0) != 0);
16889 if (unlikely(__pyx_t_2)) {
16898 __pyx_t_3 = PyInt_FromSsize_t(__pyx_v_dim);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 928, __pyx_L1_error)
16899 __Pyx_GOTREF(__pyx_t_3);
16900 __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)
16901 __Pyx_GOTREF(__pyx_t_4);
16902 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
16903 __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_builtin_IndexError, __pyx_t_4);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 928, __pyx_L1_error)
16904 __Pyx_GOTREF(__pyx_t_3);
16905 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
16906 __Pyx_Raise(__pyx_t_3, 0, 0, 0);
16907 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
16908 __PYX_ERR(1, 928, __pyx_L1_error)
16935 __pyx_t_2 = ((__pyx_v_index >= __pyx_v_shape) != 0);
16936 if (unlikely(__pyx_t_2)) {
16945 __pyx_t_3 = PyInt_FromSsize_t(__pyx_v_dim);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 931, __pyx_L1_error)
16946 __Pyx_GOTREF(__pyx_t_3);
16947 __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)
16948 __Pyx_GOTREF(__pyx_t_4);
16949 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
16950 __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_builtin_IndexError, __pyx_t_4);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 931, __pyx_L1_error)
16951 __Pyx_GOTREF(__pyx_t_3);
16952 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
16953 __Pyx_Raise(__pyx_t_3, 0, 0, 0);
16954 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
16955 __PYX_ERR(1, 931, __pyx_L1_error)
16973 __pyx_v_resultp = (__pyx_v_bufp + (__pyx_v_index * __pyx_v_stride));
16982 __pyx_t_2 = ((__pyx_v_suboffset >= 0) != 0);
16992 __pyx_v_resultp = ((((
char **)__pyx_v_resultp)[0]) + __pyx_v_suboffset);
17010 __pyx_r = __pyx_v_resultp;
17023 __Pyx_XDECREF(__pyx_t_3);
17024 __Pyx_XDECREF(__pyx_t_4);
17025 __Pyx_AddTraceback(
"View.MemoryView.pybuffer_index", __pyx_clineno, __pyx_lineno, __pyx_filename);
17028 __Pyx_RefNannyFinishContext();
17040 static int __pyx_memslice_transpose(__Pyx_memviewslice *__pyx_v_memslice) {
17042 Py_ssize_t *__pyx_v_shape;
17043 Py_ssize_t *__pyx_v_strides;
17048 Py_ssize_t *__pyx_t_2;
17051 Py_ssize_t __pyx_t_5;
17052 Py_ssize_t __pyx_t_6;
17056 int __pyx_lineno = 0;
17057 const char *__pyx_filename = NULL;
17058 int __pyx_clineno = 0;
17067 __pyx_t_1 = __pyx_v_memslice->memview->view.ndim;
17068 __pyx_v_ndim = __pyx_t_1;
17077 __pyx_t_2 = __pyx_v_memslice->shape;
17078 __pyx_v_shape = __pyx_t_2;
17087 __pyx_t_2 = __pyx_v_memslice->strides;
17088 __pyx_v_strides = __pyx_t_2;
17097 __pyx_t_3 = __Pyx_div_long(__pyx_v_ndim, 2);
17098 __pyx_t_4 = __pyx_t_3;
17099 for (__pyx_t_1 = 0; __pyx_t_1 < __pyx_t_4; __pyx_t_1+=1) {
17100 __pyx_v_i = __pyx_t_1;
17109 __pyx_v_j = ((__pyx_v_ndim - 1) - __pyx_v_i);
17118 __pyx_t_5 = (__pyx_v_strides[__pyx_v_j]);
17119 __pyx_t_6 = (__pyx_v_strides[__pyx_v_i]);
17120 (__pyx_v_strides[__pyx_v_i]) = __pyx_t_5;
17121 (__pyx_v_strides[__pyx_v_j]) = __pyx_t_6;
17130 __pyx_t_6 = (__pyx_v_shape[__pyx_v_j]);
17131 __pyx_t_5 = (__pyx_v_shape[__pyx_v_i]);
17132 (__pyx_v_shape[__pyx_v_i]) = __pyx_t_6;
17133 (__pyx_v_shape[__pyx_v_j]) = __pyx_t_5;
17142 __pyx_t_8 = (((__pyx_v_memslice->suboffsets[__pyx_v_i]) >= 0) != 0);
17145 __pyx_t_7 = __pyx_t_8;
17146 goto __pyx_L6_bool_binop_done;
17148 __pyx_t_8 = (((__pyx_v_memslice->suboffsets[__pyx_v_j]) >= 0) != 0);
17149 __pyx_t_7 = __pyx_t_8;
17150 __pyx_L6_bool_binop_done:;
17160 __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)
17194 PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
17196 __Pyx_AddTraceback(
"View.MemoryView.transpose_memslice", __pyx_clineno, __pyx_lineno, __pyx_filename);
17198 __Pyx_PyGILState_Release(__pyx_gilstate_save);
17215 static void __pyx_memoryviewslice___dealloc__(PyObject *__pyx_v_self);
17216 static void __pyx_memoryviewslice___dealloc__(PyObject *__pyx_v_self) {
17217 __Pyx_RefNannyDeclarations
17218 __Pyx_RefNannySetupContext(
"__dealloc__ (wrapper)", 0);
17219 __pyx_memoryviewslice___pyx_pf_15View_dot_MemoryView_16_memoryviewslice___dealloc__(((
struct __pyx_memoryviewslice_obj *)__pyx_v_self));
17222 __Pyx_RefNannyFinishContext();
17225 static void __pyx_memoryviewslice___pyx_pf_15View_dot_MemoryView_16_memoryviewslice___dealloc__(
struct __pyx_memoryviewslice_obj *__pyx_v_self) {
17226 __Pyx_RefNannyDeclarations
17227 __Pyx_RefNannySetupContext(
"__dealloc__", 0);
17236 __PYX_XDEC_MEMVIEW((&__pyx_v_self->from_slice), 1);
17247 __Pyx_RefNannyFinishContext();
17258 static PyObject *__pyx_memoryviewslice_convert_item_to_object(
struct __pyx_memoryviewslice_obj *__pyx_v_self,
char *__pyx_v_itemp) {
17259 PyObject *__pyx_r = NULL;
17260 __Pyx_RefNannyDeclarations
17262 PyObject *__pyx_t_2 = NULL;
17263 int __pyx_lineno = 0;
17264 const char *__pyx_filename = NULL;
17265 int __pyx_clineno = 0;
17266 __Pyx_RefNannySetupContext(
"convert_item_to_object", 0);
17275 __pyx_t_1 = ((__pyx_v_self->to_object_func != NULL) != 0);
17285 __Pyx_XDECREF(__pyx_r);
17286 __pyx_t_2 = __pyx_v_self->to_object_func(__pyx_v_itemp);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 981, __pyx_L1_error)
17287 __Pyx_GOTREF(__pyx_t_2);
17288 __pyx_r = __pyx_t_2;
17309 __Pyx_XDECREF(__pyx_r);
17310 __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)
17311 __Pyx_GOTREF(__pyx_t_2);
17312 __pyx_r = __pyx_t_2;
17327 __Pyx_XDECREF(__pyx_t_2);
17328 __Pyx_AddTraceback(
"View.MemoryView._memoryviewslice.convert_item_to_object", __pyx_clineno, __pyx_lineno, __pyx_filename);
17331 __Pyx_XGIVEREF(__pyx_r);
17332 __Pyx_RefNannyFinishContext();
17344 static PyObject *__pyx_memoryviewslice_assign_item_from_object(
struct __pyx_memoryviewslice_obj *__pyx_v_self,
char *__pyx_v_itemp, PyObject *__pyx_v_value) {
17345 PyObject *__pyx_r = NULL;
17346 __Pyx_RefNannyDeclarations
17349 PyObject *__pyx_t_3 = NULL;
17350 int __pyx_lineno = 0;
17351 const char *__pyx_filename = NULL;
17352 int __pyx_clineno = 0;
17353 __Pyx_RefNannySetupContext(
"assign_item_from_object", 0);
17362 __pyx_t_1 = ((__pyx_v_self->to_dtype_func != NULL) != 0);
17372 __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)
17392 __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)
17393 __Pyx_GOTREF(__pyx_t_3);
17394 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
17407 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
17410 __Pyx_XDECREF(__pyx_t_3);
17411 __Pyx_AddTraceback(
"View.MemoryView._memoryviewslice.assign_item_from_object", __pyx_clineno, __pyx_lineno, __pyx_filename);
17414 __Pyx_XGIVEREF(__pyx_r);
17415 __Pyx_RefNannyFinishContext();
17428 static PyObject *__pyx_pw_15View_dot_MemoryView_16_memoryviewslice_4base_1__get__(PyObject *__pyx_v_self);
17429 static PyObject *__pyx_pw_15View_dot_MemoryView_16_memoryviewslice_4base_1__get__(PyObject *__pyx_v_self) {
17430 PyObject *__pyx_r = 0;
17431 __Pyx_RefNannyDeclarations
17432 __Pyx_RefNannySetupContext(
"__get__ (wrapper)", 0);
17433 __pyx_r = __pyx_pf_15View_dot_MemoryView_16_memoryviewslice_4base___get__(((
struct __pyx_memoryviewslice_obj *)__pyx_v_self));
17436 __Pyx_RefNannyFinishContext();
17440 static PyObject *__pyx_pf_15View_dot_MemoryView_16_memoryviewslice_4base___get__(
struct __pyx_memoryviewslice_obj *__pyx_v_self) {
17441 PyObject *__pyx_r = NULL;
17442 __Pyx_RefNannyDeclarations
17443 __Pyx_RefNannySetupContext(
"__get__", 0);
17452 __Pyx_XDECREF(__pyx_r);
17453 __Pyx_INCREF(__pyx_v_self->from_object);
17454 __pyx_r = __pyx_v_self->from_object;
17467 __Pyx_XGIVEREF(__pyx_r);
17468 __Pyx_RefNannyFinishContext();
17479 static PyObject *__pyx_pw___pyx_memoryviewslice_1__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused);
17480 static PyObject *__pyx_pw___pyx_memoryviewslice_1__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
17481 PyObject *__pyx_r = 0;
17482 __Pyx_RefNannyDeclarations
17483 __Pyx_RefNannySetupContext(
"__reduce_cython__ (wrapper)", 0);
17484 __pyx_r = __pyx_pf___pyx_memoryviewslice___reduce_cython__(((
struct __pyx_memoryviewslice_obj *)__pyx_v_self));
17487 __Pyx_RefNannyFinishContext();
17491 static PyObject *__pyx_pf___pyx_memoryviewslice___reduce_cython__(CYTHON_UNUSED
struct __pyx_memoryviewslice_obj *__pyx_v_self) {
17492 PyObject *__pyx_r = NULL;
17493 __Pyx_RefNannyDeclarations
17494 PyObject *__pyx_t_1 = NULL;
17495 int __pyx_lineno = 0;
17496 const char *__pyx_filename = NULL;
17497 int __pyx_clineno = 0;
17498 __Pyx_RefNannySetupContext(
"__reduce_cython__", 0);
17506 __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)
17507 __Pyx_GOTREF(__pyx_t_1);
17508 __Pyx_Raise(__pyx_t_1, 0, 0, 0);
17509 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
17510 __PYX_ERR(1, 2, __pyx_L1_error)
17520 __Pyx_XDECREF(__pyx_t_1);
17521 __Pyx_AddTraceback(
"View.MemoryView._memoryviewslice.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
17523 __Pyx_XGIVEREF(__pyx_r);
17524 __Pyx_RefNannyFinishContext();
17536 static PyObject *__pyx_pw___pyx_memoryviewslice_3__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state);
17537 static PyObject *__pyx_pw___pyx_memoryviewslice_3__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
17538 PyObject *__pyx_r = 0;
17539 __Pyx_RefNannyDeclarations
17540 __Pyx_RefNannySetupContext(
"__setstate_cython__ (wrapper)", 0);
17541 __pyx_r = __pyx_pf___pyx_memoryviewslice_2__setstate_cython__(((
struct __pyx_memoryviewslice_obj *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state));
17544 __Pyx_RefNannyFinishContext();
17548 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) {
17549 PyObject *__pyx_r = NULL;
17550 __Pyx_RefNannyDeclarations
17551 PyObject *__pyx_t_1 = NULL;
17552 int __pyx_lineno = 0;
17553 const char *__pyx_filename = NULL;
17554 int __pyx_clineno = 0;
17555 __Pyx_RefNannySetupContext(
"__setstate_cython__", 0);
17562 __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)
17563 __Pyx_GOTREF(__pyx_t_1);
17564 __Pyx_Raise(__pyx_t_1, 0, 0, 0);
17565 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
17566 __PYX_ERR(1, 4, __pyx_L1_error)
17577 __Pyx_XDECREF(__pyx_t_1);
17578 __Pyx_AddTraceback(
"View.MemoryView._memoryviewslice.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
17580 __Pyx_XGIVEREF(__pyx_r);
17581 __Pyx_RefNannyFinishContext();
17593 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) {
17594 struct __pyx_memoryviewslice_obj *__pyx_v_result = 0;
17595 Py_ssize_t __pyx_v_suboffset;
17596 PyObject *__pyx_v_length = NULL;
17597 PyObject *__pyx_r = NULL;
17598 __Pyx_RefNannyDeclarations
17600 PyObject *__pyx_t_2 = NULL;
17601 PyObject *__pyx_t_3 = NULL;
17602 __Pyx_TypeInfo *__pyx_t_4;
17603 Py_buffer __pyx_t_5;
17604 Py_ssize_t *__pyx_t_6;
17605 Py_ssize_t *__pyx_t_7;
17606 Py_ssize_t *__pyx_t_8;
17607 Py_ssize_t __pyx_t_9;
17608 int __pyx_lineno = 0;
17609 const char *__pyx_filename = NULL;
17610 int __pyx_clineno = 0;
17611 __Pyx_RefNannySetupContext(
"memoryview_fromslice", 0);
17620 __pyx_t_1 = ((((PyObject *)__pyx_v_memviewslice.memview) == Py_None) != 0);
17630 __Pyx_XDECREF(__pyx_r);
17631 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
17650 __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_v_dtype_is_object);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1013, __pyx_L1_error)
17651 __Pyx_GOTREF(__pyx_t_2);
17652 __pyx_t_3 = PyTuple_New(3);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1013, __pyx_L1_error)
17653 __Pyx_GOTREF(__pyx_t_3);
17654 __Pyx_INCREF(Py_None);
17655 __Pyx_GIVEREF(Py_None);
17656 PyTuple_SET_ITEM(__pyx_t_3, 0, Py_None);
17657 __Pyx_INCREF(__pyx_int_0);
17658 __Pyx_GIVEREF(__pyx_int_0);
17659 PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_int_0);
17660 __Pyx_GIVEREF(__pyx_t_2);
17661 PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_t_2);
17663 __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)
17664 __Pyx_GOTREF(__pyx_t_2);
17665 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
17666 __pyx_v_result = ((
struct __pyx_memoryviewslice_obj *)__pyx_t_2);
17676 __pyx_v_result->from_slice = __pyx_v_memviewslice;
17685 __PYX_INC_MEMVIEW((&__pyx_v_memviewslice), 1);
17694 __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)
17695 __Pyx_GOTREF(__pyx_t_2);
17696 __Pyx_GIVEREF(__pyx_t_2);
17697 __Pyx_GOTREF(__pyx_v_result->from_object);
17698 __Pyx_DECREF(__pyx_v_result->from_object);
17699 __pyx_v_result->from_object = __pyx_t_2;
17709 __pyx_t_4 = __pyx_v_memviewslice.memview->typeinfo;
17710 __pyx_v_result->__pyx_base.typeinfo = __pyx_t_4;
17719 __pyx_t_5 = __pyx_v_memviewslice.memview->view;
17720 __pyx_v_result->__pyx_base.view = __pyx_t_5;
17729 __pyx_v_result->__pyx_base.view.buf = ((
void *)__pyx_v_memviewslice.data);
17738 __pyx_v_result->__pyx_base.view.ndim = __pyx_v_ndim;
17747 ((Py_buffer *)(&__pyx_v_result->__pyx_base.view))->obj = Py_None;
17756 Py_INCREF(Py_None);
17765 __pyx_t_1 = ((((
struct __pyx_memoryview_obj *)__pyx_v_memviewslice.memview)->flags & PyBUF_WRITABLE) != 0);
17775 __pyx_v_result->__pyx_base.flags = PyBUF_RECORDS;
17795 __pyx_v_result->__pyx_base.flags = PyBUF_RECORDS_RO;
17806 __pyx_v_result->__pyx_base.view.shape = ((Py_ssize_t *)__pyx_v_result->from_slice.shape);
17815 __pyx_v_result->__pyx_base.view.strides = ((Py_ssize_t *)__pyx_v_result->from_slice.strides);
17824 __pyx_v_result->__pyx_base.view.suboffsets = NULL;
17833 __pyx_t_7 = (__pyx_v_result->from_slice.suboffsets + __pyx_v_ndim);
17834 for (__pyx_t_8 = __pyx_v_result->from_slice.suboffsets; __pyx_t_8 < __pyx_t_7; __pyx_t_8++) {
17835 __pyx_t_6 = __pyx_t_8;
17836 __pyx_v_suboffset = (__pyx_t_6[0]);
17845 __pyx_t_1 = ((__pyx_v_suboffset >= 0) != 0);
17855 __pyx_v_result->__pyx_base.view.suboffsets = ((Py_ssize_t *)__pyx_v_result->from_slice.suboffsets);
17864 goto __pyx_L6_break;
17884 __pyx_t_9 = __pyx_v_result->__pyx_base.view.itemsize;
17885 __pyx_v_result->__pyx_base.view.len = __pyx_t_9;
17894 __pyx_t_7 = (__pyx_v_result->__pyx_base.view.shape + __pyx_v_ndim);
17895 for (__pyx_t_8 = __pyx_v_result->__pyx_base.view.shape; __pyx_t_8 < __pyx_t_7; __pyx_t_8++) {
17896 __pyx_t_6 = __pyx_t_8;
17897 __pyx_t_2 = PyInt_FromSsize_t((__pyx_t_6[0]));
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1043, __pyx_L1_error)
17898 __Pyx_GOTREF(__pyx_t_2);
17899 __Pyx_XDECREF_SET(__pyx_v_length, __pyx_t_2);
17909 __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)
17910 __Pyx_GOTREF(__pyx_t_2);
17911 __pyx_t_3 = PyNumber_InPlaceMultiply(__pyx_t_2, __pyx_v_length);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1044, __pyx_L1_error)
17912 __Pyx_GOTREF(__pyx_t_3);
17913 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
17914 __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)
17915 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
17916 __pyx_v_result->__pyx_base.view.len = __pyx_t_9;
17926 __pyx_v_result->to_object_func = __pyx_v_to_object_func;
17935 __pyx_v_result->to_dtype_func = __pyx_v_to_dtype_func;
17944 __Pyx_XDECREF(__pyx_r);
17945 __Pyx_INCREF(((PyObject *)__pyx_v_result));
17946 __pyx_r = ((PyObject *)__pyx_v_result);
17959 __Pyx_XDECREF(__pyx_t_2);
17960 __Pyx_XDECREF(__pyx_t_3);
17961 __Pyx_AddTraceback(
"View.MemoryView.memoryview_fromslice", __pyx_clineno, __pyx_lineno, __pyx_filename);
17964 __Pyx_XDECREF((PyObject *)__pyx_v_result);
17965 __Pyx_XDECREF(__pyx_v_length);
17966 __Pyx_XGIVEREF(__pyx_r);
17967 __Pyx_RefNannyFinishContext();
17979 static __Pyx_memviewslice *__pyx_memoryview_get_slice_from_memoryview(
struct __pyx_memoryview_obj *__pyx_v_memview, __Pyx_memviewslice *__pyx_v_mslice) {
17980 struct __pyx_memoryviewslice_obj *__pyx_v_obj = 0;
17981 __Pyx_memviewslice *__pyx_r;
17982 __Pyx_RefNannyDeclarations
17985 PyObject *__pyx_t_3 = NULL;
17986 int __pyx_lineno = 0;
17987 const char *__pyx_filename = NULL;
17988 int __pyx_clineno = 0;
17989 __Pyx_RefNannySetupContext(
"get_slice_from_memview", 0);
17998 __pyx_t_1 = __Pyx_TypeCheck(((PyObject *)__pyx_v_memview), __pyx_memoryviewslice_type);
17999 __pyx_t_2 = (__pyx_t_1 != 0);
18009 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)
18010 __pyx_t_3 = ((PyObject *)__pyx_v_memview);
18011 __Pyx_INCREF(__pyx_t_3);
18012 __pyx_v_obj = ((
struct __pyx_memoryviewslice_obj *)__pyx_t_3);
18022 __pyx_r = (&__pyx_v_obj->from_slice);
18042 __pyx_memoryview_slice_copy(__pyx_v_memview, __pyx_v_mslice);
18051 __pyx_r = __pyx_v_mslice;
18065 __Pyx_XDECREF(__pyx_t_3);
18066 __Pyx_AddTraceback(
"View.MemoryView.get_slice_from_memview", __pyx_clineno, __pyx_lineno, __pyx_filename);
18069 __Pyx_XDECREF((PyObject *)__pyx_v_obj);
18070 __Pyx_RefNannyFinishContext();
18082 static void __pyx_memoryview_slice_copy(
struct __pyx_memoryview_obj *__pyx_v_memview, __Pyx_memviewslice *__pyx_v_dst) {
18084 Py_ssize_t *__pyx_v_shape;
18085 Py_ssize_t *__pyx_v_strides;
18086 Py_ssize_t *__pyx_v_suboffsets;
18087 __Pyx_RefNannyDeclarations
18088 Py_ssize_t *__pyx_t_1;
18092 Py_ssize_t __pyx_t_5;
18093 __Pyx_RefNannySetupContext(
"slice_copy", 0);
18102 __pyx_t_1 = __pyx_v_memview->view.shape;
18103 __pyx_v_shape = __pyx_t_1;
18112 __pyx_t_1 = __pyx_v_memview->view.strides;
18113 __pyx_v_strides = __pyx_t_1;
18122 __pyx_t_1 = __pyx_v_memview->view.suboffsets;
18123 __pyx_v_suboffsets = __pyx_t_1;
18132 __pyx_v_dst->memview = ((
struct __pyx_memoryview_obj *)__pyx_v_memview);
18141 __pyx_v_dst->data = ((
char *)__pyx_v_memview->view.buf);
18150 __pyx_t_2 = __pyx_v_memview->view.ndim;
18151 __pyx_t_3 = __pyx_t_2;
18152 for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
18153 __pyx_v_dim = __pyx_t_4;
18162 (__pyx_v_dst->shape[__pyx_v_dim]) = (__pyx_v_shape[__pyx_v_dim]);
18171 (__pyx_v_dst->strides[__pyx_v_dim]) = (__pyx_v_strides[__pyx_v_dim]);
18180 if ((__pyx_v_suboffsets != 0)) {
18181 __pyx_t_5 = (__pyx_v_suboffsets[__pyx_v_dim]);
18185 (__pyx_v_dst->suboffsets[__pyx_v_dim]) = __pyx_t_5;
18197 __Pyx_RefNannyFinishContext();
18208 static PyObject *__pyx_memoryview_copy_object(
struct __pyx_memoryview_obj *__pyx_v_memview) {
18209 __Pyx_memviewslice __pyx_v_memviewslice;
18210 PyObject *__pyx_r = NULL;
18211 __Pyx_RefNannyDeclarations
18212 PyObject *__pyx_t_1 = NULL;
18213 int __pyx_lineno = 0;
18214 const char *__pyx_filename = NULL;
18215 int __pyx_clineno = 0;
18216 __Pyx_RefNannySetupContext(
"memoryview_copy", 0);
18225 __pyx_memoryview_slice_copy(__pyx_v_memview, (&__pyx_v_memviewslice));
18234 __Pyx_XDECREF(__pyx_r);
18235 __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)
18236 __Pyx_GOTREF(__pyx_t_1);
18237 __pyx_r = __pyx_t_1;
18251 __Pyx_XDECREF(__pyx_t_1);
18252 __Pyx_AddTraceback(
"View.MemoryView.memoryview_copy", __pyx_clineno, __pyx_lineno, __pyx_filename);
18255 __Pyx_XGIVEREF(__pyx_r);
18256 __Pyx_RefNannyFinishContext();
18268 static PyObject *__pyx_memoryview_copy_object_from_slice(
struct __pyx_memoryview_obj *__pyx_v_memview, __Pyx_memviewslice *__pyx_v_memviewslice) {
18269 PyObject *(*__pyx_v_to_object_func)(
char *);
18270 int (*__pyx_v_to_dtype_func)(
char *, PyObject *);
18271 PyObject *__pyx_r = NULL;
18272 __Pyx_RefNannyDeclarations
18275 PyObject *(*__pyx_t_3)(
char *);
18276 int (*__pyx_t_4)(
char *, PyObject *);
18277 PyObject *__pyx_t_5 = NULL;
18278 int __pyx_lineno = 0;
18279 const char *__pyx_filename = NULL;
18280 int __pyx_clineno = 0;
18281 __Pyx_RefNannySetupContext(
"memoryview_copy_from_slice", 0);
18290 __pyx_t_1 = __Pyx_TypeCheck(((PyObject *)__pyx_v_memview), __pyx_memoryviewslice_type);
18291 __pyx_t_2 = (__pyx_t_1 != 0);
18301 __pyx_t_3 = ((
struct __pyx_memoryviewslice_obj *)__pyx_v_memview)->to_object_func;
18302 __pyx_v_to_object_func = __pyx_t_3;
18311 __pyx_t_4 = ((
struct __pyx_memoryviewslice_obj *)__pyx_v_memview)->to_dtype_func;
18312 __pyx_v_to_dtype_func = __pyx_t_4;
18332 __pyx_v_to_object_func = NULL;
18341 __pyx_v_to_dtype_func = NULL;
18352 __Pyx_XDECREF(__pyx_r);
18361 __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)
18362 __Pyx_GOTREF(__pyx_t_5);
18363 __pyx_r = __pyx_t_5;
18377 __Pyx_XDECREF(__pyx_t_5);
18378 __Pyx_AddTraceback(
"View.MemoryView.memoryview_copy_from_slice", __pyx_clineno, __pyx_lineno, __pyx_filename);
18381 __Pyx_XGIVEREF(__pyx_r);
18382 __Pyx_RefNannyFinishContext();
18394 static Py_ssize_t abs_py_ssize_t(Py_ssize_t __pyx_v_arg) {
18395 Py_ssize_t __pyx_r;
18405 __pyx_t_1 = ((__pyx_v_arg < 0) != 0);
18415 __pyx_r = (-__pyx_v_arg);
18435 __pyx_r = __pyx_v_arg;
18460 static char __pyx_get_best_slice_order(__Pyx_memviewslice *__pyx_v_mslice,
int __pyx_v_ndim) {
18462 Py_ssize_t __pyx_v_c_stride;
18463 Py_ssize_t __pyx_v_f_stride;
18477 __pyx_v_c_stride = 0;
18486 __pyx_v_f_stride = 0;
18495 for (__pyx_t_1 = (__pyx_v_ndim - 1); __pyx_t_1 > -1; __pyx_t_1-=1) {
18496 __pyx_v_i = __pyx_t_1;
18505 __pyx_t_2 = (((__pyx_v_mslice->shape[__pyx_v_i]) > 1) != 0);
18515 __pyx_v_c_stride = (__pyx_v_mslice->strides[__pyx_v_i]);
18524 goto __pyx_L4_break;
18544 __pyx_t_1 = __pyx_v_ndim;
18545 __pyx_t_3 = __pyx_t_1;
18546 for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
18547 __pyx_v_i = __pyx_t_4;
18556 __pyx_t_2 = (((__pyx_v_mslice->shape[__pyx_v_i]) > 1) != 0);
18566 __pyx_v_f_stride = (__pyx_v_mslice->strides[__pyx_v_i]);
18575 goto __pyx_L7_break;
18595 __pyx_t_2 = ((abs_py_ssize_t(__pyx_v_c_stride) <= abs_py_ssize_t(__pyx_v_f_stride)) != 0);
18650 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) {
18651 CYTHON_UNUSED Py_ssize_t __pyx_v_i;
18652 CYTHON_UNUSED Py_ssize_t __pyx_v_src_extent;
18653 Py_ssize_t __pyx_v_dst_extent;
18654 Py_ssize_t __pyx_v_src_stride;
18655 Py_ssize_t __pyx_v_dst_stride;
18659 Py_ssize_t __pyx_t_4;
18660 Py_ssize_t __pyx_t_5;
18661 Py_ssize_t __pyx_t_6;
18670 __pyx_v_src_extent = (__pyx_v_src_shape[0]);
18679 __pyx_v_dst_extent = (__pyx_v_dst_shape[0]);
18688 __pyx_v_src_stride = (__pyx_v_src_strides[0]);
18697 __pyx_v_dst_stride = (__pyx_v_dst_strides[0]);
18706 __pyx_t_1 = ((__pyx_v_ndim == 1) != 0);
18716 __pyx_t_2 = ((__pyx_v_src_stride > 0) != 0);
18719 __pyx_t_1 = __pyx_t_2;
18720 goto __pyx_L5_bool_binop_done;
18722 __pyx_t_2 = ((__pyx_v_dst_stride > 0) != 0);
18725 __pyx_t_1 = __pyx_t_2;
18726 goto __pyx_L5_bool_binop_done;
18736 __pyx_t_2 = (((size_t)__pyx_v_src_stride) == __pyx_v_itemsize);
18738 __pyx_t_2 = (__pyx_v_itemsize == ((size_t)__pyx_v_dst_stride));
18740 __pyx_t_3 = (__pyx_t_2 != 0);
18741 __pyx_t_1 = __pyx_t_3;
18742 __pyx_L5_bool_binop_done:;
18760 (void)(memcpy(__pyx_v_dst_data, __pyx_v_src_data, (__pyx_v_itemsize * __pyx_v_dst_extent)));
18780 __pyx_t_4 = __pyx_v_dst_extent;
18781 __pyx_t_5 = __pyx_t_4;
18782 for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) {
18783 __pyx_v_i = __pyx_t_6;
18792 (void)(memcpy(__pyx_v_dst_data, __pyx_v_src_data, __pyx_v_itemsize));
18801 __pyx_v_src_data = (__pyx_v_src_data + __pyx_v_src_stride);
18810 __pyx_v_dst_data = (__pyx_v_dst_data + __pyx_v_dst_stride);
18833 __pyx_t_4 = __pyx_v_dst_extent;
18834 __pyx_t_5 = __pyx_t_4;
18835 for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) {
18836 __pyx_v_i = __pyx_t_6;
18845 _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);
18854 __pyx_v_src_data = (__pyx_v_src_data + __pyx_v_src_stride);
18863 __pyx_v_dst_data = (__pyx_v_dst_data + __pyx_v_dst_stride);
18887 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) {
18896 _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);
18917 static Py_ssize_t __pyx_memoryview_slice_get_size(__Pyx_memviewslice *__pyx_v_src,
int __pyx_v_ndim) {
18918 Py_ssize_t __pyx_v_shape;
18919 Py_ssize_t __pyx_v_size;
18920 Py_ssize_t __pyx_r;
18921 Py_ssize_t __pyx_t_1;
18922 Py_ssize_t *__pyx_t_2;
18923 Py_ssize_t *__pyx_t_3;
18924 Py_ssize_t *__pyx_t_4;
18933 __pyx_t_1 = __pyx_v_src->memview->view.itemsize;
18934 __pyx_v_size = __pyx_t_1;
18943 __pyx_t_3 = (__pyx_v_src->shape + __pyx_v_ndim);
18944 for (__pyx_t_4 = __pyx_v_src->shape; __pyx_t_4 < __pyx_t_3; __pyx_t_4++) {
18945 __pyx_t_2 = __pyx_t_4;
18946 __pyx_v_shape = (__pyx_t_2[0]);
18955 __pyx_v_size = (__pyx_v_size * __pyx_v_shape);
18965 __pyx_r = __pyx_v_size;
18989 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) {
18991 Py_ssize_t __pyx_r;
19004 __pyx_t_1 = ((__pyx_v_order ==
'F') != 0);
19014 __pyx_t_2 = __pyx_v_ndim;
19015 __pyx_t_3 = __pyx_t_2;
19016 for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
19017 __pyx_v_idx = __pyx_t_4;
19026 (__pyx_v_strides[__pyx_v_idx]) = __pyx_v_stride;
19035 __pyx_v_stride = (__pyx_v_stride * (__pyx_v_shape[__pyx_v_idx]));
19056 for (__pyx_t_2 = (__pyx_v_ndim - 1); __pyx_t_2 > -1; __pyx_t_2-=1) {
19057 __pyx_v_idx = __pyx_t_2;
19066 (__pyx_v_strides[__pyx_v_idx]) = __pyx_v_stride;
19075 __pyx_v_stride = (__pyx_v_stride * (__pyx_v_shape[__pyx_v_idx]));
19087 __pyx_r = __pyx_v_stride;
19111 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) {
19113 void *__pyx_v_result;
19114 size_t __pyx_v_itemsize;
19115 size_t __pyx_v_size;
19117 Py_ssize_t __pyx_t_1;
19120 struct __pyx_memoryview_obj *__pyx_t_4;
19123 int __pyx_lineno = 0;
19124 const char *__pyx_filename = NULL;
19125 int __pyx_clineno = 0;
19134 __pyx_t_1 = __pyx_v_src->memview->view.itemsize;
19135 __pyx_v_itemsize = __pyx_t_1;
19144 __pyx_v_size = __pyx_memoryview_slice_get_size(__pyx_v_src, __pyx_v_ndim);
19153 __pyx_v_result = malloc(__pyx_v_size);
19162 __pyx_t_2 = ((!(__pyx_v_result != 0)) != 0);
19172 __pyx_t_3 = __pyx_memoryview_err(__pyx_builtin_MemoryError, NULL);
if (unlikely(__pyx_t_3 == ((
int)-1))) __PYX_ERR(1, 1224, __pyx_L1_error)
19190 __pyx_v_tmpslice->data = ((
char *)__pyx_v_result);
19199 __pyx_t_4 = __pyx_v_src->memview;
19200 __pyx_v_tmpslice->memview = __pyx_t_4;
19209 __pyx_t_3 = __pyx_v_ndim;
19210 __pyx_t_5 = __pyx_t_3;
19211 for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) {
19212 __pyx_v_i = __pyx_t_6;
19221 (__pyx_v_tmpslice->shape[__pyx_v_i]) = (__pyx_v_src->shape[__pyx_v_i]);
19230 (__pyx_v_tmpslice->suboffsets[__pyx_v_i]) = -1
L;
19240 (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));
19249 __pyx_t_3 = __pyx_v_ndim;
19250 __pyx_t_5 = __pyx_t_3;
19251 for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) {
19252 __pyx_v_i = __pyx_t_6;
19261 __pyx_t_2 = (((__pyx_v_tmpslice->shape[__pyx_v_i]) == 1) != 0);
19271 (__pyx_v_tmpslice->strides[__pyx_v_i]) = 0;
19290 __pyx_t_2 = (__pyx_memviewslice_is_contig((__pyx_v_src[0]), __pyx_v_order, __pyx_v_ndim) != 0);
19300 (void)(memcpy(__pyx_v_result, __pyx_v_src->data, __pyx_v_size));
19320 copy_strided_to_strided(__pyx_v_src, __pyx_v_tmpslice, __pyx_v_ndim, __pyx_v_itemsize);
19331 __pyx_r = __pyx_v_result;
19346 PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
19348 __Pyx_AddTraceback(
"View.MemoryView.copy_data_to_temp", __pyx_clineno, __pyx_lineno, __pyx_filename);
19350 __Pyx_PyGILState_Release(__pyx_gilstate_save);
19366 static int __pyx_memoryview_err_extents(
int __pyx_v_i, Py_ssize_t __pyx_v_extent1, Py_ssize_t __pyx_v_extent2) {
19368 __Pyx_RefNannyDeclarations
19369 PyObject *__pyx_t_1 = NULL;
19370 PyObject *__pyx_t_2 = NULL;
19371 PyObject *__pyx_t_3 = NULL;
19372 PyObject *__pyx_t_4 = NULL;
19373 int __pyx_lineno = 0;
19374 const char *__pyx_filename = NULL;
19375 int __pyx_clineno = 0;
19377 PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
19379 __Pyx_RefNannySetupContext(
"_err_extents", 0);
19388 __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_i);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1254, __pyx_L1_error)
19389 __Pyx_GOTREF(__pyx_t_1);
19390 __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_extent1);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1254, __pyx_L1_error)
19391 __Pyx_GOTREF(__pyx_t_2);
19392 __pyx_t_3 = PyInt_FromSsize_t(__pyx_v_extent2);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1254, __pyx_L1_error)
19393 __Pyx_GOTREF(__pyx_t_3);
19394 __pyx_t_4 = PyTuple_New(3);
if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 1254, __pyx_L1_error)
19395 __Pyx_GOTREF(__pyx_t_4);
19396 __Pyx_GIVEREF(__pyx_t_1);
19397 PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_1);
19398 __Pyx_GIVEREF(__pyx_t_2);
19399 PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_2);
19400 __Pyx_GIVEREF(__pyx_t_3);
19401 PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_t_3);
19413 __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)
19414 __Pyx_GOTREF(__pyx_t_3);
19415 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
19416 __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_3);
if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 1253, __pyx_L1_error)
19417 __Pyx_GOTREF(__pyx_t_4);
19418 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
19419 __Pyx_Raise(__pyx_t_4, 0, 0, 0);
19420 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
19421 __PYX_ERR(1, 1253, __pyx_L1_error)
19433 __Pyx_XDECREF(__pyx_t_1);
19434 __Pyx_XDECREF(__pyx_t_2);
19435 __Pyx_XDECREF(__pyx_t_3);
19436 __Pyx_XDECREF(__pyx_t_4);
19437 __Pyx_AddTraceback(
"View.MemoryView._err_extents", __pyx_clineno, __pyx_lineno, __pyx_filename);
19439 __Pyx_RefNannyFinishContext();
19441 __Pyx_PyGILState_Release(__pyx_gilstate_save);
19454 static int __pyx_memoryview_err_dim(PyObject *__pyx_v_error,
char *__pyx_v_msg,
int __pyx_v_dim) {
19456 __Pyx_RefNannyDeclarations
19457 PyObject *__pyx_t_1 = NULL;
19458 PyObject *__pyx_t_2 = NULL;
19459 PyObject *__pyx_t_3 = NULL;
19460 PyObject *__pyx_t_4 = NULL;
19461 int __pyx_lineno = 0;
19462 const char *__pyx_filename = NULL;
19463 int __pyx_clineno = 0;
19465 PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
19467 __Pyx_RefNannySetupContext(
"_err_dim", 0);
19468 __Pyx_INCREF(__pyx_v_error);
19477 __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)
19478 __Pyx_GOTREF(__pyx_t_2);
19479 __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_dim);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1258, __pyx_L1_error)
19480 __Pyx_GOTREF(__pyx_t_3);
19481 __pyx_t_4 = PyUnicode_Format(__pyx_t_2, __pyx_t_3);
if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 1258, __pyx_L1_error)
19482 __Pyx_GOTREF(__pyx_t_4);
19483 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
19484 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
19485 __Pyx_INCREF(__pyx_v_error);
19486 __pyx_t_3 = __pyx_v_error; __pyx_t_2 = NULL;
19487 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
19488 __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
19489 if (likely(__pyx_t_2)) {
19490 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_3);
19491 __Pyx_INCREF(__pyx_t_2);
19492 __Pyx_INCREF(
function);
19493 __Pyx_DECREF_SET(__pyx_t_3,
function);
19496 __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);
19497 __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
19498 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
19499 if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1258, __pyx_L1_error)
19500 __Pyx_GOTREF(__pyx_t_1);
19501 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
19502 __Pyx_Raise(__pyx_t_1, 0, 0, 0);
19503 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
19504 __PYX_ERR(1, 1258, __pyx_L1_error)
19516 __Pyx_XDECREF(__pyx_t_1);
19517 __Pyx_XDECREF(__pyx_t_2);
19518 __Pyx_XDECREF(__pyx_t_3);
19519 __Pyx_XDECREF(__pyx_t_4);
19520 __Pyx_AddTraceback(
"View.MemoryView._err_dim", __pyx_clineno, __pyx_lineno, __pyx_filename);
19522 __Pyx_XDECREF(__pyx_v_error);
19523 __Pyx_RefNannyFinishContext();
19525 __Pyx_PyGILState_Release(__pyx_gilstate_save);
19538 static int __pyx_memoryview_err(PyObject *__pyx_v_error,
char *__pyx_v_msg) {
19540 __Pyx_RefNannyDeclarations
19542 PyObject *__pyx_t_2 = NULL;
19543 PyObject *__pyx_t_3 = NULL;
19544 PyObject *__pyx_t_4 = NULL;
19545 PyObject *__pyx_t_5 = NULL;
19546 int __pyx_lineno = 0;
19547 const char *__pyx_filename = NULL;
19548 int __pyx_clineno = 0;
19550 PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
19552 __Pyx_RefNannySetupContext(
"_err", 0);
19553 __Pyx_INCREF(__pyx_v_error);
19562 __pyx_t_1 = ((__pyx_v_msg != NULL) != 0);
19563 if (unlikely(__pyx_t_1)) {
19572 __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)
19573 __Pyx_GOTREF(__pyx_t_3);
19574 __Pyx_INCREF(__pyx_v_error);
19575 __pyx_t_4 = __pyx_v_error; __pyx_t_5 = NULL;
19576 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
19577 __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
19578 if (likely(__pyx_t_5)) {
19579 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_4);
19580 __Pyx_INCREF(__pyx_t_5);
19581 __Pyx_INCREF(
function);
19582 __Pyx_DECREF_SET(__pyx_t_4,
function);
19585 __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);
19586 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
19587 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
19588 if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1263, __pyx_L1_error)
19589 __Pyx_GOTREF(__pyx_t_2);
19590 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
19591 __Pyx_Raise(__pyx_t_2, 0, 0, 0);
19592 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
19593 __PYX_ERR(1, 1263, __pyx_L1_error)
19612 __Pyx_Raise(__pyx_v_error, 0, 0, 0);
19613 __PYX_ERR(1, 1265, __pyx_L1_error)
19626 __Pyx_XDECREF(__pyx_t_2);
19627 __Pyx_XDECREF(__pyx_t_3);
19628 __Pyx_XDECREF(__pyx_t_4);
19629 __Pyx_XDECREF(__pyx_t_5);
19630 __Pyx_AddTraceback(
"View.MemoryView._err", __pyx_clineno, __pyx_lineno, __pyx_filename);
19632 __Pyx_XDECREF(__pyx_v_error);
19633 __Pyx_RefNannyFinishContext();
19635 __Pyx_PyGILState_Release(__pyx_gilstate_save);
19648 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) {
19649 void *__pyx_v_tmpdata;
19650 size_t __pyx_v_itemsize;
19652 char __pyx_v_order;
19653 int __pyx_v_broadcasting;
19654 int __pyx_v_direct_copy;
19655 __Pyx_memviewslice __pyx_v_tmp;
19658 Py_ssize_t __pyx_t_1;
19666 int __pyx_lineno = 0;
19667 const char *__pyx_filename = NULL;
19668 int __pyx_clineno = 0;
19677 __pyx_v_tmpdata = NULL;
19686 __pyx_t_1 = __pyx_v_src.memview->view.itemsize;
19687 __pyx_v_itemsize = __pyx_t_1;
19696 __pyx_v_order = __pyx_get_best_slice_order((&__pyx_v_src), __pyx_v_src_ndim);
19705 __pyx_v_broadcasting = 0;
19714 __pyx_v_direct_copy = 0;
19723 __pyx_t_2 = ((__pyx_v_src_ndim < __pyx_v_dst_ndim) != 0);
19733 __pyx_memoryview_broadcast_leading((&__pyx_v_src), __pyx_v_src_ndim, __pyx_v_dst_ndim);
19752 __pyx_t_2 = ((__pyx_v_dst_ndim < __pyx_v_src_ndim) != 0);
19762 __pyx_memoryview_broadcast_leading((&__pyx_v_dst), __pyx_v_dst_ndim, __pyx_v_src_ndim);
19781 __pyx_t_3 = __pyx_v_dst_ndim;
19782 __pyx_t_4 = __pyx_v_src_ndim;
19783 if (((__pyx_t_3 > __pyx_t_4) != 0)) {
19784 __pyx_t_5 = __pyx_t_3;
19786 __pyx_t_5 = __pyx_t_4;
19788 __pyx_v_ndim = __pyx_t_5;
19797 __pyx_t_5 = __pyx_v_ndim;
19798 __pyx_t_3 = __pyx_t_5;
19799 for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
19800 __pyx_v_i = __pyx_t_4;
19809 __pyx_t_2 = (((__pyx_v_src.shape[__pyx_v_i]) != (__pyx_v_dst.shape[__pyx_v_i])) != 0);
19819 __pyx_t_2 = (((__pyx_v_src.shape[__pyx_v_i]) == 1) != 0);
19829 __pyx_v_broadcasting = 1;
19838 (__pyx_v_src.strides[__pyx_v_i]) = 0;
19858 __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)
19878 __pyx_t_2 = (((__pyx_v_src.suboffsets[__pyx_v_i]) >= 0) != 0);
19888 __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)
19907 __pyx_t_2 = (__pyx_slices_overlap((&__pyx_v_src), (&__pyx_v_dst), __pyx_v_ndim, __pyx_v_itemsize) != 0);
19917 __pyx_t_2 = ((!(__pyx_memviewslice_is_contig(__pyx_v_src, __pyx_v_order, __pyx_v_ndim) != 0)) != 0);
19927 __pyx_v_order = __pyx_get_best_slice_order((&__pyx_v_dst), __pyx_v_ndim);
19945 __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)
19946 __pyx_v_tmpdata = __pyx_t_7;
19955 __pyx_v_src = __pyx_v_tmp;
19973 __pyx_t_2 = ((!(__pyx_v_broadcasting != 0)) != 0);
19983 __pyx_t_2 = (__pyx_memviewslice_is_contig(__pyx_v_src,
'C', __pyx_v_ndim) != 0);
19993 __pyx_v_direct_copy = __pyx_memviewslice_is_contig(__pyx_v_dst,
'C', __pyx_v_ndim);
20012 __pyx_t_2 = (__pyx_memviewslice_is_contig(__pyx_v_src,
'F', __pyx_v_ndim) != 0);
20022 __pyx_v_direct_copy = __pyx_memviewslice_is_contig(__pyx_v_dst,
'F', __pyx_v_ndim);
20041 __pyx_t_2 = (__pyx_v_direct_copy != 0);
20051 __pyx_memoryview_refcount_copying((&__pyx_v_dst), __pyx_v_dtype_is_object, __pyx_v_ndim, 0);
20060 (void)(memcpy(__pyx_v_dst.data, __pyx_v_src.data, __pyx_memoryview_slice_get_size((&__pyx_v_src), __pyx_v_ndim)));
20069 __pyx_memoryview_refcount_copying((&__pyx_v_dst), __pyx_v_dtype_is_object, __pyx_v_ndim, 1);
20078 free(__pyx_v_tmpdata);
20115 __pyx_t_2 = (__pyx_v_order ==
'F');
20117 __pyx_t_2 = (
'F' == __pyx_get_best_slice_order((&__pyx_v_dst), __pyx_v_ndim));
20119 __pyx_t_8 = (__pyx_t_2 != 0);
20129 __pyx_t_5 = __pyx_memslice_transpose((&__pyx_v_src));
if (unlikely(__pyx_t_5 == ((
int)0))) __PYX_ERR(1, 1329, __pyx_L1_error)
20138 __pyx_t_5 = __pyx_memslice_transpose((&__pyx_v_dst));
if (unlikely(__pyx_t_5 == ((
int)0))) __PYX_ERR(1, 1330, __pyx_L1_error)
20156 __pyx_memoryview_refcount_copying((&__pyx_v_dst), __pyx_v_dtype_is_object, __pyx_v_ndim, 0);
20165 copy_strided_to_strided((&__pyx_v_src), (&__pyx_v_dst), __pyx_v_ndim, __pyx_v_itemsize);
20174 __pyx_memoryview_refcount_copying((&__pyx_v_dst), __pyx_v_dtype_is_object, __pyx_v_ndim, 1);
20183 free(__pyx_v_tmpdata);
20207 PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
20209 __Pyx_AddTraceback(
"View.MemoryView.memoryview_copy_contents", __pyx_clineno, __pyx_lineno, __pyx_filename);
20211 __Pyx_PyGILState_Release(__pyx_gilstate_save);
20227 static void __pyx_memoryview_broadcast_leading(__Pyx_memviewslice *__pyx_v_mslice,
int __pyx_v_ndim,
int __pyx_v_ndim_other) {
20229 int __pyx_v_offset;
20241 __pyx_v_offset = (__pyx_v_ndim_other - __pyx_v_ndim);
20250 for (__pyx_t_1 = (__pyx_v_ndim - 1); __pyx_t_1 > -1; __pyx_t_1-=1) {
20251 __pyx_v_i = __pyx_t_1;
20260 (__pyx_v_mslice->shape[(__pyx_v_i + __pyx_v_offset)]) = (__pyx_v_mslice->shape[__pyx_v_i]);
20269 (__pyx_v_mslice->strides[(__pyx_v_i + __pyx_v_offset)]) = (__pyx_v_mslice->strides[__pyx_v_i]);
20278 (__pyx_v_mslice->suboffsets[(__pyx_v_i + __pyx_v_offset)]) = (__pyx_v_mslice->suboffsets[__pyx_v_i]);
20288 __pyx_t_1 = __pyx_v_offset;
20289 __pyx_t_2 = __pyx_t_1;
20290 for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) {
20291 __pyx_v_i = __pyx_t_3;
20300 (__pyx_v_mslice->shape[__pyx_v_i]) = 1;
20309 (__pyx_v_mslice->strides[__pyx_v_i]) = (__pyx_v_mslice->strides[0]);
20318 (__pyx_v_mslice->suboffsets[__pyx_v_i]) = -1
L;
20340 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) {
20350 __pyx_t_1 = (__pyx_v_dtype_is_object != 0);
20360 __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);
20390 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) {
20391 __Pyx_RefNannyDeclarations
20393 PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
20395 __Pyx_RefNannySetupContext(
"refcount_objects_in_slice_with_gil", 0);
20404 __pyx_memoryview_refcount_objects_in_slice(__pyx_v_data, __pyx_v_shape, __pyx_v_strides, __pyx_v_ndim, __pyx_v_inc);
20415 __Pyx_RefNannyFinishContext();
20417 __Pyx_PyGILState_Release(__pyx_gilstate_save);
20429 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) {
20430 CYTHON_UNUSED Py_ssize_t __pyx_v_i;
20431 __Pyx_RefNannyDeclarations
20432 Py_ssize_t __pyx_t_1;
20433 Py_ssize_t __pyx_t_2;
20434 Py_ssize_t __pyx_t_3;
20436 __Pyx_RefNannySetupContext(
"refcount_objects_in_slice", 0);
20445 __pyx_t_1 = (__pyx_v_shape[0]);
20446 __pyx_t_2 = __pyx_t_1;
20447 for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) {
20448 __pyx_v_i = __pyx_t_3;
20457 __pyx_t_4 = ((__pyx_v_ndim == 1) != 0);
20467 __pyx_t_4 = (__pyx_v_inc != 0);
20477 Py_INCREF((((PyObject **)__pyx_v_data)[0]));
20497 Py_DECREF((((PyObject **)__pyx_v_data)[0]));
20527 __pyx_memoryview_refcount_objects_in_slice(__pyx_v_data, (__pyx_v_shape + 1), (__pyx_v_strides + 1), (__pyx_v_ndim - 1), __pyx_v_inc);
20538 __pyx_v_data = (__pyx_v_data + (__pyx_v_strides[0]));
20550 __Pyx_RefNannyFinishContext();
20561 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) {
20570 __pyx_memoryview_refcount_copying(__pyx_v_dst, __pyx_v_dtype_is_object, __pyx_v_ndim, 0);
20579 __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);
20588 __pyx_memoryview_refcount_copying(__pyx_v_dst, __pyx_v_dtype_is_object, __pyx_v_ndim, 1);
20609 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) {
20610 CYTHON_UNUSED Py_ssize_t __pyx_v_i;
20611 Py_ssize_t __pyx_v_stride;
20612 Py_ssize_t __pyx_v_extent;
20614 Py_ssize_t __pyx_t_2;
20615 Py_ssize_t __pyx_t_3;
20616 Py_ssize_t __pyx_t_4;
20625 __pyx_v_stride = (__pyx_v_strides[0]);
20634 __pyx_v_extent = (__pyx_v_shape[0]);
20643 __pyx_t_1 = ((__pyx_v_ndim == 1) != 0);
20653 __pyx_t_2 = __pyx_v_extent;
20654 __pyx_t_3 = __pyx_t_2;
20655 for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
20656 __pyx_v_i = __pyx_t_4;
20665 (void)(memcpy(__pyx_v_data, __pyx_v_item, __pyx_v_itemsize));
20674 __pyx_v_data = (__pyx_v_data + __pyx_v_stride);
20695 __pyx_t_2 = __pyx_v_extent;
20696 __pyx_t_3 = __pyx_t_2;
20697 for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
20698 __pyx_v_i = __pyx_t_4;
20707 __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);
20716 __pyx_v_data = (__pyx_v_data + __pyx_v_stride);
20739 static PyObject *__pyx_pw_15View_dot_MemoryView_1__pyx_unpickle_Enum(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
20740 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};
20741 static PyObject *__pyx_pw_15View_dot_MemoryView_1__pyx_unpickle_Enum(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
20742 PyObject *__pyx_v___pyx_type = 0;
20743 long __pyx_v___pyx_checksum;
20744 PyObject *__pyx_v___pyx_state = 0;
20745 int __pyx_lineno = 0;
20746 const char *__pyx_filename = NULL;
20747 int __pyx_clineno = 0;
20748 PyObject *__pyx_r = 0;
20749 __Pyx_RefNannyDeclarations
20750 __Pyx_RefNannySetupContext(
"__pyx_unpickle_Enum (wrapper)", 0);
20752 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_pyx_type,&__pyx_n_s_pyx_checksum,&__pyx_n_s_pyx_state,0};
20753 PyObject* values[3] = {0,0,0};
20754 if (unlikely(__pyx_kwds)) {
20755 Py_ssize_t kw_args;
20756 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
20757 switch (pos_args) {
20758 case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
20759 CYTHON_FALLTHROUGH;
20760 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
20761 CYTHON_FALLTHROUGH;
20762 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
20763 CYTHON_FALLTHROUGH;
20765 default:
goto __pyx_L5_argtuple_error;
20767 kw_args = PyDict_Size(__pyx_kwds);
20768 switch (pos_args) {
20770 if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pyx_type)) != 0)) kw_args--;
20771 else goto __pyx_L5_argtuple_error;
20772 CYTHON_FALLTHROUGH;
20774 if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pyx_checksum)) != 0)) kw_args--;
20776 __Pyx_RaiseArgtupleInvalid(
"__pyx_unpickle_Enum", 1, 3, 3, 1); __PYX_ERR(1, 1, __pyx_L3_error)
20778 CYTHON_FALLTHROUGH;
20780 if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pyx_state)) != 0)) kw_args--;
20782 __Pyx_RaiseArgtupleInvalid(
"__pyx_unpickle_Enum", 1, 3, 3, 2); __PYX_ERR(1, 1, __pyx_L3_error)
20785 if (unlikely(kw_args > 0)) {
20786 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args,
"__pyx_unpickle_Enum") < 0)) __PYX_ERR(1, 1, __pyx_L3_error)
20788 }
else if (PyTuple_GET_SIZE(__pyx_args) != 3) {
20789 goto __pyx_L5_argtuple_error;
20791 values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
20792 values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
20793 values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
20795 __pyx_v___pyx_type = values[0];
20796 __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)
20797 __pyx_v___pyx_state = values[2];
20799 goto __pyx_L4_argument_unpacking_done;
20800 __pyx_L5_argtuple_error:;
20801 __Pyx_RaiseArgtupleInvalid(
"__pyx_unpickle_Enum", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(1, 1, __pyx_L3_error)
20803 __Pyx_AddTraceback(
"View.MemoryView.__pyx_unpickle_Enum", __pyx_clineno, __pyx_lineno, __pyx_filename);
20804 __Pyx_RefNannyFinishContext();
20806 __pyx_L4_argument_unpacking_done:;
20807 __pyx_r = __pyx_pf_15View_dot_MemoryView___pyx_unpickle_Enum(__pyx_self, __pyx_v___pyx_type, __pyx_v___pyx_checksum, __pyx_v___pyx_state);
20810 __Pyx_RefNannyFinishContext();
20814 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) {
20815 PyObject *__pyx_v___pyx_PickleError = 0;
20816 PyObject *__pyx_v___pyx_result = 0;
20817 PyObject *__pyx_r = NULL;
20818 __Pyx_RefNannyDeclarations
20819 PyObject *__pyx_t_1 = NULL;
20822 PyObject *__pyx_t_4 = NULL;
20823 PyObject *__pyx_t_5 = NULL;
20824 PyObject *__pyx_t_6 = NULL;
20825 int __pyx_lineno = 0;
20826 const char *__pyx_filename = NULL;
20827 int __pyx_clineno = 0;
20828 __Pyx_RefNannySetupContext(
"__pyx_unpickle_Enum", 0);
20837 __pyx_t_1 = __Pyx_PyInt_From_long(__pyx_v___pyx_checksum);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 4, __pyx_L1_error)
20838 __Pyx_GOTREF(__pyx_t_1);
20839 __pyx_t_2 = (__Pyx_PySequence_ContainsTF(__pyx_t_1, __pyx_tuple__25, Py_NE));
if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(1, 4, __pyx_L1_error)
20840 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
20841 __pyx_t_3 = (__pyx_t_2 != 0);
20851 __pyx_t_1 = PyList_New(1);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 5, __pyx_L1_error)
20852 __Pyx_GOTREF(__pyx_t_1);
20853 __Pyx_INCREF(__pyx_n_s_PickleError);
20854 __Pyx_GIVEREF(__pyx_n_s_PickleError);
20855 PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_s_PickleError);
20856 __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)
20857 __Pyx_GOTREF(__pyx_t_4);
20858 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
20859 __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_4, __pyx_n_s_PickleError);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 5, __pyx_L1_error)
20860 __Pyx_GOTREF(__pyx_t_1);
20861 __Pyx_INCREF(__pyx_t_1);
20862 __pyx_v___pyx_PickleError = __pyx_t_1;
20863 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
20864 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
20873 __pyx_t_1 = __Pyx_PyInt_From_long(__pyx_v___pyx_checksum);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 6, __pyx_L1_error)
20874 __Pyx_GOTREF(__pyx_t_1);
20875 __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)
20876 __Pyx_GOTREF(__pyx_t_5);
20877 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
20878 __Pyx_INCREF(__pyx_v___pyx_PickleError);
20879 __pyx_t_1 = __pyx_v___pyx_PickleError; __pyx_t_6 = NULL;
20880 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_1))) {
20881 __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_1);
20882 if (likely(__pyx_t_6)) {
20883 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_1);
20884 __Pyx_INCREF(__pyx_t_6);
20885 __Pyx_INCREF(
function);
20886 __Pyx_DECREF_SET(__pyx_t_1,
function);
20889 __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);
20890 __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
20891 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
20892 if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 6, __pyx_L1_error)
20893 __Pyx_GOTREF(__pyx_t_4);
20894 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
20895 __Pyx_Raise(__pyx_t_4, 0, 0, 0);
20896 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
20897 __PYX_ERR(1, 6, __pyx_L1_error)
20915 __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)
20916 __Pyx_GOTREF(__pyx_t_1);
20918 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_1))) {
20919 __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_1);
20920 if (likely(__pyx_t_5)) {
20921 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_1);
20922 __Pyx_INCREF(__pyx_t_5);
20923 __Pyx_INCREF(
function);
20924 __Pyx_DECREF_SET(__pyx_t_1,
function);
20927 __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);
20928 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
20929 if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 7, __pyx_L1_error)
20930 __Pyx_GOTREF(__pyx_t_4);
20931 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
20932 __pyx_v___pyx_result = __pyx_t_4;
20942 __pyx_t_3 = (__pyx_v___pyx_state != Py_None);
20943 __pyx_t_2 = (__pyx_t_3 != 0);
20953 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)
20954 __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)
20955 __Pyx_GOTREF(__pyx_t_4);
20956 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
20974 __Pyx_XDECREF(__pyx_r);
20975 __Pyx_INCREF(__pyx_v___pyx_result);
20976 __pyx_r = __pyx_v___pyx_result;
20987 __Pyx_XDECREF(__pyx_t_1);
20988 __Pyx_XDECREF(__pyx_t_4);
20989 __Pyx_XDECREF(__pyx_t_5);
20990 __Pyx_XDECREF(__pyx_t_6);
20991 __Pyx_AddTraceback(
"View.MemoryView.__pyx_unpickle_Enum", __pyx_clineno, __pyx_lineno, __pyx_filename);
20994 __Pyx_XDECREF(__pyx_v___pyx_PickleError);
20995 __Pyx_XDECREF(__pyx_v___pyx_result);
20996 __Pyx_XGIVEREF(__pyx_r);
20997 __Pyx_RefNannyFinishContext();
21009 static PyObject *__pyx_unpickle_Enum__set_state(
struct __pyx_MemviewEnum_obj *__pyx_v___pyx_result, PyObject *__pyx_v___pyx_state) {
21010 PyObject *__pyx_r = NULL;
21011 __Pyx_RefNannyDeclarations
21012 PyObject *__pyx_t_1 = NULL;
21014 Py_ssize_t __pyx_t_3;
21017 PyObject *__pyx_t_6 = NULL;
21018 PyObject *__pyx_t_7 = NULL;
21019 PyObject *__pyx_t_8 = NULL;
21020 int __pyx_lineno = 0;
21021 const char *__pyx_filename = NULL;
21022 int __pyx_clineno = 0;
21023 __Pyx_RefNannySetupContext(
"__pyx_unpickle_Enum__set_state", 0);
21032 if (unlikely(__pyx_v___pyx_state == Py_None)) {
21033 PyErr_SetString(PyExc_TypeError,
"'NoneType' object is not subscriptable");
21034 __PYX_ERR(1, 12, __pyx_L1_error)
21036 __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 0,
long, 1, __Pyx_PyInt_From_long, 0, 0, 1);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 12, __pyx_L1_error)
21037 __Pyx_GOTREF(__pyx_t_1);
21038 __Pyx_GIVEREF(__pyx_t_1);
21039 __Pyx_GOTREF(__pyx_v___pyx_result->name);
21040 __Pyx_DECREF(__pyx_v___pyx_result->name);
21041 __pyx_v___pyx_result->name = __pyx_t_1;
21050 if (unlikely(__pyx_v___pyx_state == Py_None)) {
21051 PyErr_SetString(PyExc_TypeError,
"object of type 'NoneType' has no len()");
21052 __PYX_ERR(1, 13, __pyx_L1_error)
21054 __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)
21055 __pyx_t_4 = ((__pyx_t_3 > 1) != 0);
21058 __pyx_t_2 = __pyx_t_4;
21059 goto __pyx_L4_bool_binop_done;
21061 __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)
21062 __pyx_t_5 = (__pyx_t_4 != 0);
21063 __pyx_t_2 = __pyx_t_5;
21064 __pyx_L4_bool_binop_done:;
21072 __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)
21073 __Pyx_GOTREF(__pyx_t_6);
21074 __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)
21075 __Pyx_GOTREF(__pyx_t_7);
21076 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
21077 if (unlikely(__pyx_v___pyx_state == Py_None)) {
21078 PyErr_SetString(PyExc_TypeError,
"'NoneType' object is not subscriptable");
21079 __PYX_ERR(1, 14, __pyx_L1_error)
21081 __pyx_t_6 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 1,
long, 1, __Pyx_PyInt_From_long, 0, 0, 1);
if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 14, __pyx_L1_error)
21082 __Pyx_GOTREF(__pyx_t_6);
21084 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_7))) {
21085 __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_7);
21086 if (likely(__pyx_t_8)) {
21087 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_7);
21088 __Pyx_INCREF(__pyx_t_8);
21089 __Pyx_INCREF(
function);
21090 __Pyx_DECREF_SET(__pyx_t_7,
function);
21093 __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);
21094 __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
21095 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
21096 if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 14, __pyx_L1_error)
21097 __Pyx_GOTREF(__pyx_t_1);
21098 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
21099 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
21118 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
21121 __Pyx_XDECREF(__pyx_t_1);
21122 __Pyx_XDECREF(__pyx_t_6);
21123 __Pyx_XDECREF(__pyx_t_7);
21124 __Pyx_XDECREF(__pyx_t_8);
21125 __Pyx_AddTraceback(
"View.MemoryView.__pyx_unpickle_Enum__set_state", __pyx_clineno, __pyx_lineno, __pyx_filename);
21128 __Pyx_XGIVEREF(__pyx_r);
21129 __Pyx_RefNannyFinishContext();
21133 static PyObject *__pyx_tp_new_10csmoothers_cASMFactor(PyTypeObject *t, PyObject *a, PyObject *k) {
21135 if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) {
21136 o = (*t->tp_alloc)(t, 0);
21138 o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0);
21140 if (unlikely(!o))
return 0;
21141 if (unlikely(__pyx_pw_10csmoothers_10cASMFactor_1__cinit__(o, a, k) < 0))
goto bad;
21144 Py_DECREF(o); o = 0;
21148 static void __pyx_tp_dealloc_10csmoothers_cASMFactor(PyObject *o) {
21149 #if CYTHON_USE_TP_FINALIZE
21150 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))) {
21151 if (PyObject_CallFinalizerFromDealloc(o))
return;
21155 PyObject *etype, *eval, *etb;
21156 PyErr_Fetch(&etype, &eval, &etb);
21157 __Pyx_SET_REFCNT(o, Py_REFCNT(o) + 1);
21158 __pyx_pw_10csmoothers_10cASMFactor_3__dealloc__(o);
21159 __Pyx_SET_REFCNT(o, Py_REFCNT(o) - 1);
21160 PyErr_Restore(etype, eval, etb);
21162 (*Py_TYPE(o)->tp_free)(o);
21165 static PyMethodDef __pyx_methods_10csmoothers_cASMFactor[] = {
21166 {
"__reduce_cython__", (PyCFunction)__pyx_pw_10csmoothers_10cASMFactor_5__reduce_cython__, METH_NOARGS, 0},
21167 {
"__setstate_cython__", (PyCFunction)__pyx_pw_10csmoothers_10cASMFactor_7__setstate_cython__, METH_O, 0},
21171 static PyTypeObject __pyx_type_10csmoothers_cASMFactor = {
21172 PyVarObject_HEAD_INIT(0, 0)
21173 "csmoothers.cASMFactor",
21174 sizeof(
struct __pyx_obj_10csmoothers_cASMFactor),
21176 __pyx_tp_dealloc_10csmoothers_cASMFactor,
21177 #
if PY_VERSION_HEX < 0x030800b4
21180 #
if PY_VERSION_HEX >= 0x030800b4
21185 #
if PY_MAJOR_VERSION < 3
21188 #
if PY_MAJOR_VERSION >= 3
21201 Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE,
21209 __pyx_methods_10csmoothers_cASMFactor,
21219 __pyx_tp_new_10csmoothers_cASMFactor,
21229 #
if PY_VERSION_HEX >= 0x030400a1
21232 #
if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800)
21235 #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
21238 #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000
21243 static PyObject *__pyx_tp_new_10csmoothers_cBASMFactor(PyTypeObject *t, PyObject *a, PyObject *k) {
21245 if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) {
21246 o = (*t->tp_alloc)(t, 0);
21248 o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0);
21250 if (unlikely(!o))
return 0;
21251 if (unlikely(__pyx_pw_10csmoothers_11cBASMFactor_1__cinit__(o, a, k) < 0))
goto bad;
21254 Py_DECREF(o); o = 0;
21258 static void __pyx_tp_dealloc_10csmoothers_cBASMFactor(PyObject *o) {
21259 #if CYTHON_USE_TP_FINALIZE
21260 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))) {
21261 if (PyObject_CallFinalizerFromDealloc(o))
return;
21265 PyObject *etype, *eval, *etb;
21266 PyErr_Fetch(&etype, &eval, &etb);
21267 __Pyx_SET_REFCNT(o, Py_REFCNT(o) + 1);
21268 __pyx_pw_10csmoothers_11cBASMFactor_3__dealloc__(o);
21269 __Pyx_SET_REFCNT(o, Py_REFCNT(o) - 1);
21270 PyErr_Restore(etype, eval, etb);
21272 (*Py_TYPE(o)->tp_free)(o);
21275 static PyMethodDef __pyx_methods_10csmoothers_cBASMFactor[] = {
21276 {
"__reduce_cython__", (PyCFunction)__pyx_pw_10csmoothers_11cBASMFactor_5__reduce_cython__, METH_NOARGS, 0},
21277 {
"__setstate_cython__", (PyCFunction)__pyx_pw_10csmoothers_11cBASMFactor_7__setstate_cython__, METH_O, 0},
21281 static PyTypeObject __pyx_type_10csmoothers_cBASMFactor = {
21282 PyVarObject_HEAD_INIT(0, 0)
21283 "csmoothers.cBASMFactor",
21284 sizeof(
struct __pyx_obj_10csmoothers_cBASMFactor),
21286 __pyx_tp_dealloc_10csmoothers_cBASMFactor,
21287 #
if PY_VERSION_HEX < 0x030800b4
21290 #
if PY_VERSION_HEX >= 0x030800b4
21295 #
if PY_MAJOR_VERSION < 3
21298 #
if PY_MAJOR_VERSION >= 3
21311 Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE,
21319 __pyx_methods_10csmoothers_cBASMFactor,
21329 __pyx_tp_new_10csmoothers_cBASMFactor,
21339 #
if PY_VERSION_HEX >= 0x030400a1
21342 #
if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800)
21345 #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
21348 #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000
21352 static struct __pyx_vtabstruct_array __pyx_vtable_array;
21354 static PyObject *__pyx_tp_new_array(PyTypeObject *t, PyObject *a, PyObject *k) {
21355 struct __pyx_array_obj *p;
21357 if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) {
21358 o = (*t->tp_alloc)(t, 0);
21360 o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0);
21362 if (unlikely(!o))
return 0;
21363 p = ((
struct __pyx_array_obj *)o);
21364 p->__pyx_vtab = __pyx_vtabptr_array;
21365 p->mode = ((PyObject*)Py_None); Py_INCREF(Py_None);
21366 p->_format = ((PyObject*)Py_None); Py_INCREF(Py_None);
21367 if (unlikely(__pyx_array___cinit__(o, a, k) < 0))
goto bad;
21370 Py_DECREF(o); o = 0;
21374 static void __pyx_tp_dealloc_array(PyObject *o) {
21375 struct __pyx_array_obj *p = (
struct __pyx_array_obj *)o;
21376 #if CYTHON_USE_TP_FINALIZE
21377 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))) {
21378 if (PyObject_CallFinalizerFromDealloc(o))
return;
21382 PyObject *etype, *eval, *etb;
21383 PyErr_Fetch(&etype, &eval, &etb);
21384 __Pyx_SET_REFCNT(o, Py_REFCNT(o) + 1);
21385 __pyx_array___dealloc__(o);
21386 __Pyx_SET_REFCNT(o, Py_REFCNT(o) - 1);
21387 PyErr_Restore(etype, eval, etb);
21390 Py_CLEAR(p->_format);
21391 (*Py_TYPE(o)->tp_free)(o);
21393 static PyObject *__pyx_sq_item_array(PyObject *o, Py_ssize_t i) {
21395 PyObject *x = PyInt_FromSsize_t(i);
if(!x)
return 0;
21396 r = Py_TYPE(o)->tp_as_mapping->mp_subscript(o, x);
21401 static int __pyx_mp_ass_subscript_array(PyObject *o, PyObject *i, PyObject *
v) {
21403 return __pyx_array___setitem__(o, i,
v);
21406 PyErr_Format(PyExc_NotImplementedError,
21407 "Subscript deletion not supported by %.200s", Py_TYPE(o)->tp_name);
21412 static PyObject *__pyx_tp_getattro_array(PyObject *o, PyObject *
n) {
21413 PyObject *
v = __Pyx_PyObject_GenericGetAttr(o,
n);
21414 if (!
v && PyErr_ExceptionMatches(PyExc_AttributeError)) {
21416 v = __pyx_array___getattr__(o,
n);
21421 static PyObject *__pyx_getprop___pyx_array_memview(PyObject *o, CYTHON_UNUSED
void *x) {
21422 return __pyx_pw_15View_dot_MemoryView_5array_7memview_1__get__(o);
21425 static PyMethodDef __pyx_methods_array[] = {
21426 {
"__getattr__", (PyCFunction)__pyx_array___getattr__, METH_O|METH_COEXIST, 0},
21427 {
"__reduce_cython__", (PyCFunction)__pyx_pw___pyx_array_1__reduce_cython__, METH_NOARGS, 0},
21428 {
"__setstate_cython__", (PyCFunction)__pyx_pw___pyx_array_3__setstate_cython__, METH_O, 0},
21432 static struct PyGetSetDef __pyx_getsets_array[] = {
21433 {(
char *)
"memview", __pyx_getprop___pyx_array_memview, 0, (
char *)0, 0},
21437 static PySequenceMethods __pyx_tp_as_sequence_array = {
21438 __pyx_array___len__,
21441 __pyx_sq_item_array,
21450 static PyMappingMethods __pyx_tp_as_mapping_array = {
21451 __pyx_array___len__,
21452 __pyx_array___getitem__,
21453 __pyx_mp_ass_subscript_array,
21456 static PyBufferProcs __pyx_tp_as_buffer_array = {
21457 #if PY_MAJOR_VERSION < 3
21460 #if PY_MAJOR_VERSION < 3
21463 #if PY_MAJOR_VERSION < 3
21466 #if PY_MAJOR_VERSION < 3
21469 __pyx_array_getbuffer,
21473 static PyTypeObject __pyx_type___pyx_array = {
21474 PyVarObject_HEAD_INIT(0, 0)
21475 "csmoothers.array",
21476 sizeof(
struct __pyx_array_obj),
21478 __pyx_tp_dealloc_array,
21479 #
if PY_VERSION_HEX < 0x030800b4
21482 #
if PY_VERSION_HEX >= 0x030800b4
21487 #
if PY_MAJOR_VERSION < 3
21490 #
if PY_MAJOR_VERSION >= 3
21495 &__pyx_tp_as_sequence_array,
21496 &__pyx_tp_as_mapping_array,
21500 __pyx_tp_getattro_array,
21502 &__pyx_tp_as_buffer_array,
21503 Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE,
21511 __pyx_methods_array,
21513 __pyx_getsets_array,
21521 __pyx_tp_new_array,
21531 #
if PY_VERSION_HEX >= 0x030400a1
21534 #
if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800)
21537 #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
21540 #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000
21545 static PyObject *__pyx_tp_new_Enum(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
21546 struct __pyx_MemviewEnum_obj *p;
21548 if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) {
21549 o = (*t->tp_alloc)(t, 0);
21551 o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0);
21553 if (unlikely(!o))
return 0;
21554 p = ((
struct __pyx_MemviewEnum_obj *)o);
21555 p->name = Py_None; Py_INCREF(Py_None);
21559 static void __pyx_tp_dealloc_Enum(PyObject *o) {
21560 struct __pyx_MemviewEnum_obj *p = (
struct __pyx_MemviewEnum_obj *)o;
21561 #if CYTHON_USE_TP_FINALIZE
21562 if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) {
21563 if (PyObject_CallFinalizerFromDealloc(o))
return;
21566 PyObject_GC_UnTrack(o);
21568 (*Py_TYPE(o)->tp_free)(o);
21571 static int __pyx_tp_traverse_Enum(PyObject *o, visitproc
v,
void *a) {
21573 struct __pyx_MemviewEnum_obj *p = (
struct __pyx_MemviewEnum_obj *)o;
21575 e = (*v)(p->name, a);
if (e)
return e;
21580 static int __pyx_tp_clear_Enum(PyObject *o) {
21582 struct __pyx_MemviewEnum_obj *p = (
struct __pyx_MemviewEnum_obj *)o;
21583 tmp = ((PyObject*)p->name);
21584 p->name = Py_None; Py_INCREF(Py_None);
21589 static PyMethodDef __pyx_methods_Enum[] = {
21590 {
"__reduce_cython__", (PyCFunction)__pyx_pw___pyx_MemviewEnum_1__reduce_cython__, METH_NOARGS, 0},
21591 {
"__setstate_cython__", (PyCFunction)__pyx_pw___pyx_MemviewEnum_3__setstate_cython__, METH_O, 0},
21595 static PyTypeObject __pyx_type___pyx_MemviewEnum = {
21596 PyVarObject_HEAD_INIT(0, 0)
21598 sizeof(
struct __pyx_MemviewEnum_obj),
21600 __pyx_tp_dealloc_Enum,
21601 #
if PY_VERSION_HEX < 0x030800b4
21604 #
if PY_VERSION_HEX >= 0x030800b4
21609 #
if PY_MAJOR_VERSION < 3
21612 #
if PY_MAJOR_VERSION >= 3
21615 __pyx_MemviewEnum___repr__,
21625 Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC,
21627 __pyx_tp_traverse_Enum,
21628 __pyx_tp_clear_Enum,
21633 __pyx_methods_Enum,
21641 __pyx_MemviewEnum___init__,
21653 #
if PY_VERSION_HEX >= 0x030400a1
21656 #
if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800)
21659 #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
21662 #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000
21666 static struct __pyx_vtabstruct_memoryview __pyx_vtable_memoryview;
21668 static PyObject *__pyx_tp_new_memoryview(PyTypeObject *t, PyObject *a, PyObject *k) {
21669 struct __pyx_memoryview_obj *p;
21671 if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) {
21672 o = (*t->tp_alloc)(t, 0);
21674 o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0);
21676 if (unlikely(!o))
return 0;
21677 p = ((
struct __pyx_memoryview_obj *)o);
21678 p->__pyx_vtab = __pyx_vtabptr_memoryview;
21679 p->obj = Py_None; Py_INCREF(Py_None);
21680 p->_size = Py_None; Py_INCREF(Py_None);
21681 p->_array_interface = Py_None; Py_INCREF(Py_None);
21682 p->view.obj = NULL;
21683 if (unlikely(__pyx_memoryview___cinit__(o, a, k) < 0))
goto bad;
21686 Py_DECREF(o); o = 0;
21690 static void __pyx_tp_dealloc_memoryview(PyObject *o) {
21691 struct __pyx_memoryview_obj *p = (
struct __pyx_memoryview_obj *)o;
21692 #if CYTHON_USE_TP_FINALIZE
21693 if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) {
21694 if (PyObject_CallFinalizerFromDealloc(o))
return;
21697 PyObject_GC_UnTrack(o);
21699 PyObject *etype, *eval, *etb;
21700 PyErr_Fetch(&etype, &eval, &etb);
21701 __Pyx_SET_REFCNT(o, Py_REFCNT(o) + 1);
21702 __pyx_memoryview___dealloc__(o);
21703 __Pyx_SET_REFCNT(o, Py_REFCNT(o) - 1);
21704 PyErr_Restore(etype, eval, etb);
21707 Py_CLEAR(p->_size);
21708 Py_CLEAR(p->_array_interface);
21709 (*Py_TYPE(o)->tp_free)(o);
21712 static int __pyx_tp_traverse_memoryview(PyObject *o, visitproc
v,
void *a) {
21714 struct __pyx_memoryview_obj *p = (
struct __pyx_memoryview_obj *)o;
21716 e = (*v)(p->obj, a);
if (e)
return e;
21719 e = (*v)(p->_size, a);
if (e)
return e;
21721 if (p->_array_interface) {
21722 e = (*v)(p->_array_interface, a);
if (e)
return e;
21725 e = (*v)(p->view.obj, a);
if (e)
return e;
21730 static int __pyx_tp_clear_memoryview(PyObject *o) {
21732 struct __pyx_memoryview_obj *p = (
struct __pyx_memoryview_obj *)o;
21733 tmp = ((PyObject*)p->obj);
21734 p->obj = Py_None; Py_INCREF(Py_None);
21736 tmp = ((PyObject*)p->_size);
21737 p->_size = Py_None; Py_INCREF(Py_None);
21739 tmp = ((PyObject*)p->_array_interface);
21740 p->_array_interface = Py_None; Py_INCREF(Py_None);
21742 Py_CLEAR(p->view.obj);
21745 static PyObject *__pyx_sq_item_memoryview(PyObject *o, Py_ssize_t i) {
21747 PyObject *x = PyInt_FromSsize_t(i);
if(!x)
return 0;
21748 r = Py_TYPE(o)->tp_as_mapping->mp_subscript(o, x);
21753 static int __pyx_mp_ass_subscript_memoryview(PyObject *o, PyObject *i, PyObject *
v) {
21755 return __pyx_memoryview___setitem__(o, i,
v);
21758 PyErr_Format(PyExc_NotImplementedError,
21759 "Subscript deletion not supported by %.200s", Py_TYPE(o)->tp_name);
21764 static PyObject *__pyx_getprop___pyx_memoryview_T(PyObject *o, CYTHON_UNUSED
void *x) {
21765 return __pyx_pw_15View_dot_MemoryView_10memoryview_1T_1__get__(o);
21768 static PyObject *__pyx_getprop___pyx_memoryview_base(PyObject *o, CYTHON_UNUSED
void *x) {
21769 return __pyx_pw_15View_dot_MemoryView_10memoryview_4base_1__get__(o);
21772 static PyObject *__pyx_getprop___pyx_memoryview_shape(PyObject *o, CYTHON_UNUSED
void *x) {
21773 return __pyx_pw_15View_dot_MemoryView_10memoryview_5shape_1__get__(o);
21776 static PyObject *__pyx_getprop___pyx_memoryview_strides(PyObject *o, CYTHON_UNUSED
void *x) {
21777 return __pyx_pw_15View_dot_MemoryView_10memoryview_7strides_1__get__(o);
21780 static PyObject *__pyx_getprop___pyx_memoryview_suboffsets(PyObject *o, CYTHON_UNUSED
void *x) {
21781 return __pyx_pw_15View_dot_MemoryView_10memoryview_10suboffsets_1__get__(o);
21784 static PyObject *__pyx_getprop___pyx_memoryview_ndim(PyObject *o, CYTHON_UNUSED
void *x) {
21785 return __pyx_pw_15View_dot_MemoryView_10memoryview_4ndim_1__get__(o);
21788 static PyObject *__pyx_getprop___pyx_memoryview_itemsize(PyObject *o, CYTHON_UNUSED
void *x) {
21789 return __pyx_pw_15View_dot_MemoryView_10memoryview_8itemsize_1__get__(o);
21792 static PyObject *__pyx_getprop___pyx_memoryview_nbytes(PyObject *o, CYTHON_UNUSED
void *x) {
21793 return __pyx_pw_15View_dot_MemoryView_10memoryview_6nbytes_1__get__(o);
21796 static PyObject *__pyx_getprop___pyx_memoryview_size(PyObject *o, CYTHON_UNUSED
void *x) {
21797 return __pyx_pw_15View_dot_MemoryView_10memoryview_4size_1__get__(o);
21800 static PyMethodDef __pyx_methods_memoryview[] = {
21801 {
"is_c_contig", (PyCFunction)__pyx_memoryview_is_c_contig, METH_NOARGS, 0},
21802 {
"is_f_contig", (PyCFunction)__pyx_memoryview_is_f_contig, METH_NOARGS, 0},
21803 {
"copy", (PyCFunction)__pyx_memoryview_copy, METH_NOARGS, 0},
21804 {
"copy_fortran", (PyCFunction)__pyx_memoryview_copy_fortran, METH_NOARGS, 0},
21805 {
"__reduce_cython__", (PyCFunction)__pyx_pw___pyx_memoryview_1__reduce_cython__, METH_NOARGS, 0},
21806 {
"__setstate_cython__", (PyCFunction)__pyx_pw___pyx_memoryview_3__setstate_cython__, METH_O, 0},
21810 static struct PyGetSetDef __pyx_getsets_memoryview[] = {
21811 {(
char *)
"T", __pyx_getprop___pyx_memoryview_T, 0, (
char *)0, 0},
21812 {(
char *)
"base", __pyx_getprop___pyx_memoryview_base, 0, (
char *)0, 0},
21813 {(
char *)
"shape", __pyx_getprop___pyx_memoryview_shape, 0, (
char *)0, 0},
21814 {(
char *)
"strides", __pyx_getprop___pyx_memoryview_strides, 0, (
char *)0, 0},
21815 {(
char *)
"suboffsets", __pyx_getprop___pyx_memoryview_suboffsets, 0, (
char *)0, 0},
21816 {(
char *)
"ndim", __pyx_getprop___pyx_memoryview_ndim, 0, (
char *)0, 0},
21817 {(
char *)
"itemsize", __pyx_getprop___pyx_memoryview_itemsize, 0, (
char *)0, 0},
21818 {(
char *)
"nbytes", __pyx_getprop___pyx_memoryview_nbytes, 0, (
char *)0, 0},
21819 {(
char *)
"size", __pyx_getprop___pyx_memoryview_size, 0, (
char *)0, 0},
21823 static PySequenceMethods __pyx_tp_as_sequence_memoryview = {
21824 __pyx_memoryview___len__,
21827 __pyx_sq_item_memoryview,
21836 static PyMappingMethods __pyx_tp_as_mapping_memoryview = {
21837 __pyx_memoryview___len__,
21838 __pyx_memoryview___getitem__,
21839 __pyx_mp_ass_subscript_memoryview,
21842 static PyBufferProcs __pyx_tp_as_buffer_memoryview = {
21843 #if PY_MAJOR_VERSION < 3
21846 #if PY_MAJOR_VERSION < 3
21849 #if PY_MAJOR_VERSION < 3
21852 #if PY_MAJOR_VERSION < 3
21855 __pyx_memoryview_getbuffer,
21859 static PyTypeObject __pyx_type___pyx_memoryview = {
21860 PyVarObject_HEAD_INIT(0, 0)
21861 "csmoothers.memoryview",
21862 sizeof(
struct __pyx_memoryview_obj),
21864 __pyx_tp_dealloc_memoryview,
21865 #
if PY_VERSION_HEX < 0x030800b4
21868 #
if PY_VERSION_HEX >= 0x030800b4
21873 #
if PY_MAJOR_VERSION < 3
21876 #
if PY_MAJOR_VERSION >= 3
21879 __pyx_memoryview___repr__,
21881 &__pyx_tp_as_sequence_memoryview,
21882 &__pyx_tp_as_mapping_memoryview,
21885 __pyx_memoryview___str__,
21888 &__pyx_tp_as_buffer_memoryview,
21889 Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC,
21891 __pyx_tp_traverse_memoryview,
21892 __pyx_tp_clear_memoryview,
21897 __pyx_methods_memoryview,
21899 __pyx_getsets_memoryview,
21907 __pyx_tp_new_memoryview,
21917 #
if PY_VERSION_HEX >= 0x030400a1
21920 #
if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800)
21923 #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
21926 #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000
21930 static struct __pyx_vtabstruct__memoryviewslice __pyx_vtable__memoryviewslice;
21932 static PyObject *__pyx_tp_new__memoryviewslice(PyTypeObject *t, PyObject *a, PyObject *k) {
21933 struct __pyx_memoryviewslice_obj *p;
21934 PyObject *o = __pyx_tp_new_memoryview(t, a, k);
21935 if (unlikely(!o))
return 0;
21936 p = ((
struct __pyx_memoryviewslice_obj *)o);
21937 p->__pyx_base.__pyx_vtab = (
struct __pyx_vtabstruct_memoryview*)__pyx_vtabptr__memoryviewslice;
21938 p->from_object = Py_None; Py_INCREF(Py_None);
21939 p->from_slice.memview = NULL;
21943 static void __pyx_tp_dealloc__memoryviewslice(PyObject *o) {
21944 struct __pyx_memoryviewslice_obj *p = (
struct __pyx_memoryviewslice_obj *)o;
21945 #if CYTHON_USE_TP_FINALIZE
21946 if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) {
21947 if (PyObject_CallFinalizerFromDealloc(o))
return;
21950 PyObject_GC_UnTrack(o);
21952 PyObject *etype, *eval, *etb;
21953 PyErr_Fetch(&etype, &eval, &etb);
21954 __Pyx_SET_REFCNT(o, Py_REFCNT(o) + 1);
21955 __pyx_memoryviewslice___dealloc__(o);
21956 __Pyx_SET_REFCNT(o, Py_REFCNT(o) - 1);
21957 PyErr_Restore(etype, eval, etb);
21959 Py_CLEAR(p->from_object);
21960 PyObject_GC_Track(o);
21961 __pyx_tp_dealloc_memoryview(o);
21964 static int __pyx_tp_traverse__memoryviewslice(PyObject *o, visitproc
v,
void *a) {
21966 struct __pyx_memoryviewslice_obj *p = (
struct __pyx_memoryviewslice_obj *)o;
21967 e = __pyx_tp_traverse_memoryview(o,
v, a);
if (e)
return e;
21968 if (p->from_object) {
21969 e = (*v)(p->from_object, a);
if (e)
return e;
21974 static int __pyx_tp_clear__memoryviewslice(PyObject *o) {
21976 struct __pyx_memoryviewslice_obj *p = (
struct __pyx_memoryviewslice_obj *)o;
21977 __pyx_tp_clear_memoryview(o);
21978 tmp = ((PyObject*)p->from_object);
21979 p->from_object = Py_None; Py_INCREF(Py_None);
21981 __PYX_XDEC_MEMVIEW(&p->from_slice, 1);
21985 static PyObject *__pyx_getprop___pyx_memoryviewslice_base(PyObject *o, CYTHON_UNUSED
void *x) {
21986 return __pyx_pw_15View_dot_MemoryView_16_memoryviewslice_4base_1__get__(o);
21989 static PyMethodDef __pyx_methods__memoryviewslice[] = {
21990 {
"__reduce_cython__", (PyCFunction)__pyx_pw___pyx_memoryviewslice_1__reduce_cython__, METH_NOARGS, 0},
21991 {
"__setstate_cython__", (PyCFunction)__pyx_pw___pyx_memoryviewslice_3__setstate_cython__, METH_O, 0},
21995 static struct PyGetSetDef __pyx_getsets__memoryviewslice[] = {
21996 {(
char *)
"base", __pyx_getprop___pyx_memoryviewslice_base, 0, (
char *)0, 0},
22000 static PyTypeObject __pyx_type___pyx_memoryviewslice = {
22001 PyVarObject_HEAD_INIT(0, 0)
22002 "csmoothers._memoryviewslice",
22003 sizeof(
struct __pyx_memoryviewslice_obj),
22005 __pyx_tp_dealloc__memoryviewslice,
22006 #
if PY_VERSION_HEX < 0x030800b4
22009 #
if PY_VERSION_HEX >= 0x030800b4
22014 #
if PY_MAJOR_VERSION < 3
22017 #
if PY_MAJOR_VERSION >= 3
22020 #
if CYTHON_COMPILING_IN_PYPY
22021 __pyx_memoryview___repr__,
22030 #
if CYTHON_COMPILING_IN_PYPY
22031 __pyx_memoryview___str__,
22038 Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC,
22039 "Internal class for passing memoryview slices to Python",
22040 __pyx_tp_traverse__memoryviewslice,
22041 __pyx_tp_clear__memoryviewslice,
22046 __pyx_methods__memoryviewslice,
22048 __pyx_getsets__memoryviewslice,
22056 __pyx_tp_new__memoryviewslice,
22066 #
if PY_VERSION_HEX >= 0x030400a1
22069 #
if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800)
22072 #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
22075 #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000
22080 static PyMethodDef __pyx_methods[] = {
22084 #if PY_MAJOR_VERSION >= 3
22085 #if CYTHON_PEP489_MULTI_PHASE_INIT
22086 static PyObject* __pyx_pymod_create(PyObject *spec, PyModuleDef *def);
22087 static int __pyx_pymod_exec_csmoothers(PyObject* module);
22088 static PyModuleDef_Slot __pyx_moduledef_slots[] = {
22089 {Py_mod_create, (
void*)__pyx_pymod_create},
22090 {Py_mod_exec, (
void*)__pyx_pymod_exec_csmoothers},
22095 static struct PyModuleDef __pyx_moduledef = {
22096 PyModuleDef_HEAD_INIT,
22099 #if CYTHON_PEP489_MULTI_PHASE_INIT
22105 #if CYTHON_PEP489_MULTI_PHASE_INIT
22106 __pyx_moduledef_slots,
22115 #ifndef CYTHON_SMALL_CODE
22116 #if defined(__clang__)
22117 #define CYTHON_SMALL_CODE
22118 #elif defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 3))
22119 #define CYTHON_SMALL_CODE __attribute__((cold))
22121 #define CYTHON_SMALL_CODE
22125 static __Pyx_StringTabEntry __pyx_string_tab[] = {
22126 {&__pyx_n_s_A, __pyx_k_A,
sizeof(__pyx_k_A), 0, 0, 1, 1},
22127 {&__pyx_n_s_ASCII, __pyx_k_ASCII,
sizeof(__pyx_k_ASCII), 0, 0, 1, 1},
22128 {&__pyx_n_s_ASMFactor, __pyx_k_ASMFactor,
sizeof(__pyx_k_ASMFactor), 0, 0, 1, 1},
22129 {&__pyx_n_s_ASMFactor___init, __pyx_k_ASMFactor___init,
sizeof(__pyx_k_ASMFactor___init), 0, 0, 1, 1},
22130 {&__pyx_n_s_BASMFactor, __pyx_k_BASMFactor,
sizeof(__pyx_k_BASMFactor), 0, 0, 1, 1},
22131 {&__pyx_n_s_BASMFactor___init, __pyx_k_BASMFactor___init,
sizeof(__pyx_k_BASMFactor___init), 0, 0, 1, 1},
22132 {&__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},
22133 {&__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},
22134 {&__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},
22135 {&__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},
22136 {&__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},
22137 {&__pyx_n_s_Ellipsis, __pyx_k_Ellipsis,
sizeof(__pyx_k_Ellipsis), 0, 0, 1, 1},
22138 {&__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},
22139 {&__pyx_n_s_ImportError, __pyx_k_ImportError,
sizeof(__pyx_k_ImportError), 0, 0, 1, 1},
22140 {&__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},
22141 {&__pyx_n_s_IndexError, __pyx_k_IndexError,
sizeof(__pyx_k_IndexError), 0, 0, 1, 1},
22142 {&__pyx_kp_s_Indirect_dimensions_not_supporte, __pyx_k_Indirect_dimensions_not_supporte,
sizeof(__pyx_k_Indirect_dimensions_not_supporte), 0, 0, 1, 0},
22143 {&__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},
22144 {&__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},
22145 {&__pyx_n_s_L, __pyx_k_L,
sizeof(__pyx_k_L), 0, 0, 1, 1},
22146 {&__pyx_n_s_M, __pyx_k_M,
sizeof(__pyx_k_M), 0, 0, 1, 1},
22147 {&__pyx_n_s_MemoryError, __pyx_k_MemoryError,
sizeof(__pyx_k_MemoryError), 0, 0, 1, 1},
22148 {&__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},
22149 {&__pyx_kp_s_MemoryView_of_r_object, __pyx_k_MemoryView_of_r_object,
sizeof(__pyx_k_MemoryView_of_r_object), 0, 0, 1, 0},
22150 {&__pyx_n_b_O, __pyx_k_O,
sizeof(__pyx_k_O), 0, 0, 0, 1},
22151 {&__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},
22152 {&__pyx_n_s_PickleError, __pyx_k_PickleError,
sizeof(__pyx_k_PickleError), 0, 0, 1, 1},
22153 {&__pyx_n_s_R, __pyx_k_R,
sizeof(__pyx_k_R), 0, 0, 1, 1},
22154 {&__pyx_n_s_TypeError, __pyx_k_TypeError,
sizeof(__pyx_k_TypeError), 0, 0, 1, 1},
22155 {&__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},
22156 {&__pyx_n_s_ValueError, __pyx_k_ValueError,
sizeof(__pyx_k_ValueError), 0, 0, 1, 1},
22157 {&__pyx_n_s_View_MemoryView, __pyx_k_View_MemoryView,
sizeof(__pyx_k_View_MemoryView), 0, 0, 1, 1},
22158 {&__pyx_n_s_allocate_buffer, __pyx_k_allocate_buffer,
sizeof(__pyx_k_allocate_buffer), 0, 0, 1, 1},
22159 {&__pyx_n_s_asmFactor, __pyx_k_asmFactor,
sizeof(__pyx_k_asmFactor), 0, 0, 1, 1},
22160 {&__pyx_n_s_asm_NR_prepare, __pyx_k_asm_NR_prepare,
sizeof(__pyx_k_asm_NR_prepare), 0, 0, 1, 1},
22161 {&__pyx_n_s_asm_NR_solve, __pyx_k_asm_NR_solve,
sizeof(__pyx_k_asm_NR_solve), 0, 0, 1, 1},
22162 {&__pyx_n_s_base, __pyx_k_base,
sizeof(__pyx_k_base), 0, 0, 1, 1},
22163 {&__pyx_n_s_basmFactor, __pyx_k_basmFactor,
sizeof(__pyx_k_basmFactor), 0, 0, 1, 1},
22164 {&__pyx_n_s_basm_NR_prepare, __pyx_k_basm_NR_prepare,
sizeof(__pyx_k_basm_NR_prepare), 0, 0, 1, 1},
22165 {&__pyx_n_s_basm_NR_solve, __pyx_k_basm_NR_solve,
sizeof(__pyx_k_basm_NR_solve), 0, 0, 1, 1},
22166 {&__pyx_n_s_bs, __pyx_k_bs,
sizeof(__pyx_k_bs), 0, 0, 1, 1},
22167 {&__pyx_n_s_c, __pyx_k_c,
sizeof(__pyx_k_c), 0, 0, 1, 1},
22168 {&__pyx_n_u_c, __pyx_k_c,
sizeof(__pyx_k_c), 0, 1, 0, 1},
22169 {&__pyx_n_s_cASMFactor, __pyx_k_cASMFactor,
sizeof(__pyx_k_cASMFactor), 0, 0, 1, 1},
22170 {&__pyx_n_s_cASMFactor_2, __pyx_k_cASMFactor_2,
sizeof(__pyx_k_cASMFactor_2), 0, 0, 1, 1},
22171 {&__pyx_n_s_cBASMFactor, __pyx_k_cBASMFactor,
sizeof(__pyx_k_cBASMFactor), 0, 0, 1, 1},
22172 {&__pyx_n_s_cBASMFactor_2, __pyx_k_cBASMFactor_2,
sizeof(__pyx_k_cBASMFactor_2), 0, 0, 1, 1},
22173 {&__pyx_n_s_cSparseMatrix, __pyx_k_cSparseMatrix,
sizeof(__pyx_k_cSparseMatrix), 0, 0, 1, 1},
22174 {&__pyx_n_s_class, __pyx_k_class,
sizeof(__pyx_k_class), 0, 0, 1, 1},
22175 {&__pyx_n_s_cline_in_traceback, __pyx_k_cline_in_traceback,
sizeof(__pyx_k_cline_in_traceback), 0, 0, 1, 1},
22176 {&__pyx_kp_s_contiguous_and_direct, __pyx_k_contiguous_and_direct,
sizeof(__pyx_k_contiguous_and_direct), 0, 0, 1, 0},
22177 {&__pyx_kp_s_contiguous_and_indirect, __pyx_k_contiguous_and_indirect,
sizeof(__pyx_k_contiguous_and_indirect), 0, 0, 1, 0},
22178 {&__pyx_n_s_csmoothers, __pyx_k_csmoothers,
sizeof(__pyx_k_csmoothers), 0, 0, 1, 1},
22179 {&__pyx_n_s_dX, __pyx_k_dX,
sizeof(__pyx_k_dX), 0, 0, 1, 1},
22180 {&__pyx_n_s_dict, __pyx_k_dict,
sizeof(__pyx_k_dict), 0, 0, 1, 1},
22181 {&__pyx_n_s_doc, __pyx_k_doc,
sizeof(__pyx_k_doc), 0, 0, 1, 1},
22182 {&__pyx_n_s_dtype_is_object, __pyx_k_dtype_is_object,
sizeof(__pyx_k_dtype_is_object), 0, 0, 1, 1},
22183 {&__pyx_n_s_encode, __pyx_k_encode,
sizeof(__pyx_k_encode), 0, 0, 1, 1},
22184 {&__pyx_n_s_enumerate, __pyx_k_enumerate,
sizeof(__pyx_k_enumerate), 0, 0, 1, 1},
22185 {&__pyx_n_s_error, __pyx_k_error,
sizeof(__pyx_k_error), 0, 0, 1, 1},
22186 {&__pyx_n_s_flags, __pyx_k_flags,
sizeof(__pyx_k_flags), 0, 0, 1, 1},
22187 {&__pyx_n_s_format, __pyx_k_format,
sizeof(__pyx_k_format), 0, 0, 1, 1},
22188 {&__pyx_n_s_fortran, __pyx_k_fortran,
sizeof(__pyx_k_fortran), 0, 0, 1, 1},
22189 {&__pyx_n_u_fortran, __pyx_k_fortran,
sizeof(__pyx_k_fortran), 0, 1, 0, 1},
22190 {&__pyx_n_s_gauss_seidel_NR_preare, __pyx_k_gauss_seidel_NR_preare,
sizeof(__pyx_k_gauss_seidel_NR_preare), 0, 0, 1, 1},
22191 {&__pyx_n_s_gauss_seidel_NR_solve, __pyx_k_gauss_seidel_NR_solve,
sizeof(__pyx_k_gauss_seidel_NR_solve), 0, 0, 1, 1},
22192 {&__pyx_n_s_getstate, __pyx_k_getstate,
sizeof(__pyx_k_getstate), 0, 0, 1, 1},
22193 {&__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},
22194 {&__pyx_n_s_id, __pyx_k_id,
sizeof(__pyx_k_id), 0, 0, 1, 1},
22195 {&__pyx_n_s_import, __pyx_k_import,
sizeof(__pyx_k_import), 0, 0, 1, 1},
22196 {&__pyx_n_s_init, __pyx_k_init,
sizeof(__pyx_k_init), 0, 0, 1, 1},
22197 {&__pyx_n_s_itemsize, __pyx_k_itemsize,
sizeof(__pyx_k_itemsize), 0, 0, 1, 1},
22198 {&__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},
22199 {&__pyx_n_s_jacobi_NR_prepare, __pyx_k_jacobi_NR_prepare,
sizeof(__pyx_k_jacobi_NR_prepare), 0, 0, 1, 1},
22200 {&__pyx_n_s_jacobi_NR_solve, __pyx_k_jacobi_NR_solve,
sizeof(__pyx_k_jacobi_NR_solve), 0, 0, 1, 1},
22201 {&__pyx_n_s_main, __pyx_k_main,
sizeof(__pyx_k_main), 0, 0, 1, 1},
22202 {&__pyx_n_s_memview, __pyx_k_memview,
sizeof(__pyx_k_memview), 0, 0, 1, 1},
22203 {&__pyx_n_s_metaclass, __pyx_k_metaclass,
sizeof(__pyx_k_metaclass), 0, 0, 1, 1},
22204 {&__pyx_n_s_mode, __pyx_k_mode,
sizeof(__pyx_k_mode), 0, 0, 1, 1},
22205 {&__pyx_n_s_module, __pyx_k_module,
sizeof(__pyx_k_module), 0, 0, 1, 1},
22206 {&__pyx_n_s_name, __pyx_k_name,
sizeof(__pyx_k_name), 0, 0, 1, 1},
22207 {&__pyx_n_s_name_2, __pyx_k_name_2,
sizeof(__pyx_k_name_2), 0, 0, 1, 1},
22208 {&__pyx_n_s_nc, __pyx_k_nc,
sizeof(__pyx_k_nc), 0, 0, 1, 1},
22209 {&__pyx_n_s_ndim, __pyx_k_ndim,
sizeof(__pyx_k_ndim), 0, 0, 1, 1},
22210 {&__pyx_n_s_new, __pyx_k_new,
sizeof(__pyx_k_new), 0, 0, 1, 1},
22211 {&__pyx_n_s_nl_gauss_seidel_NR_solve, __pyx_k_nl_gauss_seidel_NR_solve,
sizeof(__pyx_k_nl_gauss_seidel_NR_solve), 0, 0, 1, 1},
22212 {&__pyx_n_s_nl_jacobi_NR_solve, __pyx_k_nl_jacobi_NR_solve,
sizeof(__pyx_k_nl_jacobi_NR_solve), 0, 0, 1, 1},
22213 {&__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},
22214 {&__pyx_n_s_node_order, __pyx_k_node_order,
sizeof(__pyx_k_node_order), 0, 0, 1, 1},
22215 {&__pyx_n_s_np, __pyx_k_np,
sizeof(__pyx_k_np), 0, 0, 1, 1},
22216 {&__pyx_n_s_nr, __pyx_k_nr,
sizeof(__pyx_k_nr), 0, 0, 1, 1},
22217 {&__pyx_n_s_numpy, __pyx_k_numpy,
sizeof(__pyx_k_numpy), 0, 0, 1, 1},
22218 {&__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},
22219 {&__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},
22220 {&__pyx_n_s_obj, __pyx_k_obj,
sizeof(__pyx_k_obj), 0, 0, 1, 1},
22221 {&__pyx_n_s_object, __pyx_k_object,
sizeof(__pyx_k_object), 0, 0, 1, 1},
22222 {&__pyx_n_s_pack, __pyx_k_pack,
sizeof(__pyx_k_pack), 0, 0, 1, 1},
22223 {&__pyx_n_s_pickle, __pyx_k_pickle,
sizeof(__pyx_k_pickle), 0, 0, 1, 1},
22224 {&__pyx_n_s_prepare, __pyx_k_prepare,
sizeof(__pyx_k_prepare), 0, 0, 1, 1},
22225 {&__pyx_kp_s_proteus_csmoothers_pyx, __pyx_k_proteus_csmoothers_pyx,
sizeof(__pyx_k_proteus_csmoothers_pyx), 0, 0, 1, 0},
22226 {&__pyx_n_s_pyx_PickleError, __pyx_k_pyx_PickleError,
sizeof(__pyx_k_pyx_PickleError), 0, 0, 1, 1},
22227 {&__pyx_n_s_pyx_checksum, __pyx_k_pyx_checksum,
sizeof(__pyx_k_pyx_checksum), 0, 0, 1, 1},
22228 {&__pyx_n_s_pyx_getbuffer, __pyx_k_pyx_getbuffer,
sizeof(__pyx_k_pyx_getbuffer), 0, 0, 1, 1},
22229 {&__pyx_n_s_pyx_result, __pyx_k_pyx_result,
sizeof(__pyx_k_pyx_result), 0, 0, 1, 1},
22230 {&__pyx_n_s_pyx_state, __pyx_k_pyx_state,
sizeof(__pyx_k_pyx_state), 0, 0, 1, 1},
22231 {&__pyx_n_s_pyx_type, __pyx_k_pyx_type,
sizeof(__pyx_k_pyx_type), 0, 0, 1, 1},
22232 {&__pyx_n_s_pyx_unpickle_Enum, __pyx_k_pyx_unpickle_Enum,
sizeof(__pyx_k_pyx_unpickle_Enum), 0, 0, 1, 1},
22233 {&__pyx_n_s_pyx_vtable, __pyx_k_pyx_vtable,
sizeof(__pyx_k_pyx_vtable), 0, 0, 1, 1},
22234 {&__pyx_n_s_qualname, __pyx_k_qualname,
sizeof(__pyx_k_qualname), 0, 0, 1, 1},
22235 {&__pyx_n_s_range, __pyx_k_range,
sizeof(__pyx_k_range), 0, 0, 1, 1},
22236 {&__pyx_n_s_reduce, __pyx_k_reduce,
sizeof(__pyx_k_reduce), 0, 0, 1, 1},
22237 {&__pyx_n_s_reduce_cython, __pyx_k_reduce_cython,
sizeof(__pyx_k_reduce_cython), 0, 0, 1, 1},
22238 {&__pyx_n_s_reduce_ex, __pyx_k_reduce_ex,
sizeof(__pyx_k_reduce_ex), 0, 0, 1, 1},
22239 {&__pyx_n_s_self, __pyx_k_self,
sizeof(__pyx_k_self), 0, 0, 1, 1},
22240 {&__pyx_n_s_setstate, __pyx_k_setstate,
sizeof(__pyx_k_setstate), 0, 0, 1, 1},
22241 {&__pyx_n_s_setstate_cython, __pyx_k_setstate_cython,
sizeof(__pyx_k_setstate_cython), 0, 0, 1, 1},
22242 {&__pyx_n_s_shape, __pyx_k_shape,
sizeof(__pyx_k_shape), 0, 0, 1, 1},
22243 {&__pyx_n_s_size, __pyx_k_size,
sizeof(__pyx_k_size), 0, 0, 1, 1},
22244 {&__pyx_n_s_start, __pyx_k_start,
sizeof(__pyx_k_start), 0, 0, 1, 1},
22245 {&__pyx_n_s_step, __pyx_k_step,
sizeof(__pyx_k_step), 0, 0, 1, 1},
22246 {&__pyx_n_s_stop, __pyx_k_stop,
sizeof(__pyx_k_stop), 0, 0, 1, 1},
22247 {&__pyx_kp_s_strided_and_direct, __pyx_k_strided_and_direct,
sizeof(__pyx_k_strided_and_direct), 0, 0, 1, 0},
22248 {&__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},
22249 {&__pyx_kp_s_strided_and_indirect, __pyx_k_strided_and_indirect,
sizeof(__pyx_k_strided_and_indirect), 0, 0, 1, 0},
22250 {&__pyx_kp_s_stringsource, __pyx_k_stringsource,
sizeof(__pyx_k_stringsource), 0, 0, 1, 0},
22251 {&__pyx_n_s_struct, __pyx_k_struct,
sizeof(__pyx_k_struct), 0, 0, 1, 1},
22252 {&__pyx_n_s_test, __pyx_k_test,
sizeof(__pyx_k_test), 0, 0, 1, 1},
22253 {&__pyx_n_s_tol, __pyx_k_tol,
sizeof(__pyx_k_tol), 0, 0, 1, 1},
22254 {&__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},
22255 {&__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},
22256 {&__pyx_n_s_unpack, __pyx_k_unpack,
sizeof(__pyx_k_unpack), 0, 0, 1, 1},
22257 {&__pyx_n_s_update, __pyx_k_update,
sizeof(__pyx_k_update), 0, 0, 1, 1},
22258 {&__pyx_n_s_w, __pyx_k_w,
sizeof(__pyx_k_w), 0, 0, 1, 1},
22259 {0, 0, 0, 0, 0, 0, 0}
22261 static CYTHON_SMALL_CODE
int __Pyx_InitCachedBuiltins(
void) {
22262 __pyx_builtin_object = __Pyx_GetBuiltinName(__pyx_n_s_object);
if (!__pyx_builtin_object) __PYX_ERR(0, 5, __pyx_L1_error)
22263 __pyx_builtin_TypeError = __Pyx_GetBuiltinName(__pyx_n_s_TypeError);
if (!__pyx_builtin_TypeError) __PYX_ERR(1, 2, __pyx_L1_error)
22264 __pyx_builtin_ImportError = __Pyx_GetBuiltinName(__pyx_n_s_ImportError);
if (!__pyx_builtin_ImportError) __PYX_ERR(2, 945, __pyx_L1_error)
22265 __pyx_builtin_ValueError = __Pyx_GetBuiltinName(__pyx_n_s_ValueError);
if (!__pyx_builtin_ValueError) __PYX_ERR(1, 133, __pyx_L1_error)
22266 __pyx_builtin_MemoryError = __Pyx_GetBuiltinName(__pyx_n_s_MemoryError);
if (!__pyx_builtin_MemoryError) __PYX_ERR(1, 148, __pyx_L1_error)
22267 __pyx_builtin_enumerate = __Pyx_GetBuiltinName(__pyx_n_s_enumerate);
if (!__pyx_builtin_enumerate) __PYX_ERR(1, 151, __pyx_L1_error)
22268 __pyx_builtin_range = __Pyx_GetBuiltinName(__pyx_n_s_range);
if (!__pyx_builtin_range) __PYX_ERR(1, 180, __pyx_L1_error)
22269 __pyx_builtin_Ellipsis = __Pyx_GetBuiltinName(__pyx_n_s_Ellipsis);
if (!__pyx_builtin_Ellipsis) __PYX_ERR(1, 404, __pyx_L1_error)
22270 __pyx_builtin_id = __Pyx_GetBuiltinName(__pyx_n_s_id);
if (!__pyx_builtin_id) __PYX_ERR(1, 613, __pyx_L1_error)
22271 __pyx_builtin_IndexError = __Pyx_GetBuiltinName(__pyx_n_s_IndexError);
if (!__pyx_builtin_IndexError) __PYX_ERR(1, 832, __pyx_L1_error)
22277 static CYTHON_SMALL_CODE
int __Pyx_InitCachedConstants(
void) {
22278 __Pyx_RefNannyDeclarations
22279 __Pyx_RefNannySetupContext(
"__Pyx_InitCachedConstants", 0);
22287 __pyx_tuple_ = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non);
if (unlikely(!__pyx_tuple_)) __PYX_ERR(1, 2, __pyx_L1_error)
22288 __Pyx_GOTREF(__pyx_tuple_);
22289 __Pyx_GIVEREF(__pyx_tuple_);
22296 __pyx_tuple__2 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non);
if (unlikely(!__pyx_tuple__2)) __PYX_ERR(1, 4, __pyx_L1_error)
22297 __Pyx_GOTREF(__pyx_tuple__2);
22298 __Pyx_GIVEREF(__pyx_tuple__2);
22306 __pyx_tuple__3 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non);
if (unlikely(!__pyx_tuple__3)) __PYX_ERR(1, 2, __pyx_L1_error)
22307 __Pyx_GOTREF(__pyx_tuple__3);
22308 __Pyx_GIVEREF(__pyx_tuple__3);
22315 __pyx_tuple__4 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non);
if (unlikely(!__pyx_tuple__4)) __PYX_ERR(1, 4, __pyx_L1_error)
22316 __Pyx_GOTREF(__pyx_tuple__4);
22317 __Pyx_GIVEREF(__pyx_tuple__4);
22326 __pyx_tuple__5 = PyTuple_Pack(1, __pyx_kp_s_numpy_core_multiarray_failed_to);
if (unlikely(!__pyx_tuple__5)) __PYX_ERR(2, 945, __pyx_L1_error)
22327 __Pyx_GOTREF(__pyx_tuple__5);
22328 __Pyx_GIVEREF(__pyx_tuple__5);
22337 __pyx_tuple__6 = PyTuple_Pack(1, __pyx_kp_s_numpy_core_umath_failed_to_impor);
if (unlikely(!__pyx_tuple__6)) __PYX_ERR(2, 951, __pyx_L1_error)
22338 __Pyx_GOTREF(__pyx_tuple__6);
22339 __Pyx_GIVEREF(__pyx_tuple__6);
22348 __pyx_tuple__7 = PyTuple_Pack(1, __pyx_kp_s_Empty_shape_tuple_for_cython_arr);
if (unlikely(!__pyx_tuple__7)) __PYX_ERR(1, 133, __pyx_L1_error)
22349 __Pyx_GOTREF(__pyx_tuple__7);
22350 __Pyx_GIVEREF(__pyx_tuple__7);
22359 __pyx_tuple__8 = PyTuple_Pack(1, __pyx_kp_s_itemsize_0_for_cython_array);
if (unlikely(!__pyx_tuple__8)) __PYX_ERR(1, 136, __pyx_L1_error)
22360 __Pyx_GOTREF(__pyx_tuple__8);
22361 __Pyx_GIVEREF(__pyx_tuple__8);
22370 __pyx_tuple__9 = PyTuple_Pack(1, __pyx_kp_s_unable_to_allocate_shape_and_str);
if (unlikely(!__pyx_tuple__9)) __PYX_ERR(1, 148, __pyx_L1_error)
22371 __Pyx_GOTREF(__pyx_tuple__9);
22372 __Pyx_GIVEREF(__pyx_tuple__9);
22381 __pyx_tuple__10 = PyTuple_Pack(1, __pyx_kp_s_unable_to_allocate_array_data);
if (unlikely(!__pyx_tuple__10)) __PYX_ERR(1, 176, __pyx_L1_error)
22382 __Pyx_GOTREF(__pyx_tuple__10);
22383 __Pyx_GIVEREF(__pyx_tuple__10);
22392 __pyx_tuple__11 = PyTuple_Pack(1, __pyx_kp_s_Can_only_create_a_buffer_that_is);
if (unlikely(!__pyx_tuple__11)) __PYX_ERR(1, 192, __pyx_L1_error)
22393 __Pyx_GOTREF(__pyx_tuple__11);
22394 __Pyx_GIVEREF(__pyx_tuple__11);
22402 __pyx_tuple__12 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non);
if (unlikely(!__pyx_tuple__12)) __PYX_ERR(1, 2, __pyx_L1_error)
22403 __Pyx_GOTREF(__pyx_tuple__12);
22404 __Pyx_GIVEREF(__pyx_tuple__12);
22411 __pyx_tuple__13 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non);
if (unlikely(!__pyx_tuple__13)) __PYX_ERR(1, 4, __pyx_L1_error)
22412 __Pyx_GOTREF(__pyx_tuple__13);
22413 __Pyx_GIVEREF(__pyx_tuple__13);
22422 __pyx_tuple__14 = PyTuple_Pack(1, __pyx_kp_s_Cannot_assign_to_read_only_memor);
if (unlikely(!__pyx_tuple__14)) __PYX_ERR(1, 418, __pyx_L1_error)
22423 __Pyx_GOTREF(__pyx_tuple__14);
22424 __Pyx_GIVEREF(__pyx_tuple__14);
22433 __pyx_tuple__15 = PyTuple_Pack(1, __pyx_kp_s_Unable_to_convert_item_to_object);
if (unlikely(!__pyx_tuple__15)) __PYX_ERR(1, 495, __pyx_L1_error)
22434 __Pyx_GOTREF(__pyx_tuple__15);
22435 __Pyx_GIVEREF(__pyx_tuple__15);
22444 __pyx_tuple__16 = PyTuple_Pack(1, __pyx_kp_s_Cannot_create_writable_memory_vi);
if (unlikely(!__pyx_tuple__16)) __PYX_ERR(1, 520, __pyx_L1_error)
22445 __Pyx_GOTREF(__pyx_tuple__16);
22446 __Pyx_GIVEREF(__pyx_tuple__16);
22455 __pyx_tuple__17 = PyTuple_Pack(1, __pyx_kp_s_Buffer_view_does_not_expose_stri);
if (unlikely(!__pyx_tuple__17)) __PYX_ERR(1, 570, __pyx_L1_error)
22456 __Pyx_GOTREF(__pyx_tuple__17);
22457 __Pyx_GIVEREF(__pyx_tuple__17);
22466 __pyx_tuple__18 = PyTuple_New(1);
if (unlikely(!__pyx_tuple__18)) __PYX_ERR(1, 577, __pyx_L1_error)
22467 __Pyx_GOTREF(__pyx_tuple__18);
22468 __Pyx_INCREF(__pyx_int_neg_1);
22469 __Pyx_GIVEREF(__pyx_int_neg_1);
22470 PyTuple_SET_ITEM(__pyx_tuple__18, 0, __pyx_int_neg_1);
22471 __Pyx_GIVEREF(__pyx_tuple__18);
22479 __pyx_tuple__19 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non);
if (unlikely(!__pyx_tuple__19)) __PYX_ERR(1, 2, __pyx_L1_error)
22480 __Pyx_GOTREF(__pyx_tuple__19);
22481 __Pyx_GIVEREF(__pyx_tuple__19);
22488 __pyx_tuple__20 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non);
if (unlikely(!__pyx_tuple__20)) __PYX_ERR(1, 4, __pyx_L1_error)
22489 __Pyx_GOTREF(__pyx_tuple__20);
22490 __Pyx_GIVEREF(__pyx_tuple__20);
22499 __pyx_slice__21 = PySlice_New(Py_None, Py_None, Py_None);
if (unlikely(!__pyx_slice__21)) __PYX_ERR(1, 682, __pyx_L1_error)
22500 __Pyx_GOTREF(__pyx_slice__21);
22501 __Pyx_GIVEREF(__pyx_slice__21);
22510 __pyx_tuple__22 = PyTuple_Pack(1, __pyx_kp_s_Indirect_dimensions_not_supporte);
if (unlikely(!__pyx_tuple__22)) __PYX_ERR(1, 703, __pyx_L1_error)
22511 __Pyx_GOTREF(__pyx_tuple__22);
22512 __Pyx_GIVEREF(__pyx_tuple__22);
22520 __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)
22521 __Pyx_GOTREF(__pyx_tuple__23);
22522 __Pyx_GIVEREF(__pyx_tuple__23);
22529 __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)
22530 __Pyx_GOTREF(__pyx_tuple__24);
22531 __Pyx_GIVEREF(__pyx_tuple__24);
22532 __pyx_tuple__25 = PyTuple_Pack(3, __pyx_int_184977713, __pyx_int_136983863, __pyx_int_112105877);
if (unlikely(!__pyx_tuple__25)) __PYX_ERR(1, 4, __pyx_L1_error)
22533 __Pyx_GOTREF(__pyx_tuple__25);
22534 __Pyx_GIVEREF(__pyx_tuple__25);
22543 __pyx_tuple__26 = PyTuple_Pack(1, __pyx_builtin_object);
if (unlikely(!__pyx_tuple__26)) __PYX_ERR(0, 5, __pyx_L1_error)
22544 __Pyx_GOTREF(__pyx_tuple__26);
22545 __Pyx_GIVEREF(__pyx_tuple__26);
22554 __pyx_tuple__27 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_L);
if (unlikely(!__pyx_tuple__27)) __PYX_ERR(0, 7, __pyx_L1_error)
22555 __Pyx_GOTREF(__pyx_tuple__27);
22556 __Pyx_GIVEREF(__pyx_tuple__27);
22557 __pyx_codeobj__28 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__27, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_proteus_csmoothers_pyx, __pyx_n_s_init, 7, __pyx_empty_bytes);
if (unlikely(!__pyx_codeobj__28)) __PYX_ERR(0, 7, __pyx_L1_error)
22566 __pyx_tuple__29 = PyTuple_Pack(1, __pyx_builtin_object);
if (unlikely(!__pyx_tuple__29)) __PYX_ERR(0, 42, __pyx_L1_error)
22567 __Pyx_GOTREF(__pyx_tuple__29);
22568 __Pyx_GIVEREF(__pyx_tuple__29);
22577 __pyx_tuple__30 = PyTuple_Pack(3, __pyx_n_s_self, __pyx_n_s_L, __pyx_n_s_bs);
if (unlikely(!__pyx_tuple__30)) __PYX_ERR(0, 44, __pyx_L1_error)
22578 __Pyx_GOTREF(__pyx_tuple__30);
22579 __Pyx_GIVEREF(__pyx_tuple__30);
22580 __pyx_codeobj__31 = (PyObject*)__Pyx_PyCode_New(3, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__30, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_proteus_csmoothers_pyx, __pyx_n_s_init, 44, __pyx_empty_bytes);
if (unlikely(!__pyx_codeobj__31)) __PYX_ERR(0, 44, __pyx_L1_error)
22589 __pyx_tuple__32 = PyTuple_Pack(4, __pyx_n_s_A, __pyx_n_s_w, __pyx_n_s_tol, __pyx_n_s_M);
if (unlikely(!__pyx_tuple__32)) __PYX_ERR(0, 84, __pyx_L1_error)
22590 __Pyx_GOTREF(__pyx_tuple__32);
22591 __Pyx_GIVEREF(__pyx_tuple__32);
22592 __pyx_codeobj__33 = (PyObject*)__Pyx_PyCode_New(4, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__32, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_proteus_csmoothers_pyx, __pyx_n_s_jacobi_NR_prepare, 84, __pyx_empty_bytes);
if (unlikely(!__pyx_codeobj__33)) __PYX_ERR(0, 84, __pyx_L1_error)
22601 __pyx_tuple__34 = PyTuple_Pack(5, __pyx_n_s_A, __pyx_n_s_M, __pyx_n_s_R, __pyx_n_s_node_order, __pyx_n_s_dX);
if (unlikely(!__pyx_tuple__34)) __PYX_ERR(0, 109, __pyx_L1_error)
22602 __Pyx_GOTREF(__pyx_tuple__34);
22603 __Pyx_GIVEREF(__pyx_tuple__34);
22604 __pyx_codeobj__35 = (PyObject*)__Pyx_PyCode_New(5, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__34, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_proteus_csmoothers_pyx, __pyx_n_s_jacobi_NR_solve, 109, __pyx_empty_bytes);
if (unlikely(!__pyx_codeobj__35)) __PYX_ERR(0, 109, __pyx_L1_error)
22613 __pyx_tuple__36 = PyTuple_Pack(6, __pyx_n_s_A, __pyx_n_s_R, __pyx_n_s_node_order, __pyx_n_s_w, __pyx_n_s_tol, __pyx_n_s_dX);
if (unlikely(!__pyx_tuple__36)) __PYX_ERR(0, 136, __pyx_L1_error)
22614 __Pyx_GOTREF(__pyx_tuple__36);
22615 __Pyx_GIVEREF(__pyx_tuple__36);
22616 __pyx_codeobj__37 = (PyObject*)__Pyx_PyCode_New(6, 0, 6, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__36, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_proteus_csmoothers_pyx, __pyx_n_s_nl_jacobi_NR_solve, 136, __pyx_empty_bytes);
if (unlikely(!__pyx_codeobj__37)) __PYX_ERR(0, 136, __pyx_L1_error)
22625 __pyx_tuple__38 = PyTuple_Pack(4, __pyx_n_s_A, __pyx_n_s_w, __pyx_n_s_tol, __pyx_n_s_M);
if (unlikely(!__pyx_tuple__38)) __PYX_ERR(0, 165, __pyx_L1_error)
22626 __Pyx_GOTREF(__pyx_tuple__38);
22627 __Pyx_GIVEREF(__pyx_tuple__38);
22628 __pyx_codeobj__39 = (PyObject*)__Pyx_PyCode_New(4, 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_proteus_csmoothers_pyx, __pyx_n_s_gauss_seidel_NR_preare, 165, __pyx_empty_bytes);
if (unlikely(!__pyx_codeobj__39)) __PYX_ERR(0, 165, __pyx_L1_error)
22637 __pyx_tuple__40 = PyTuple_Pack(5, __pyx_n_s_A, __pyx_n_s_M, __pyx_n_s_R, __pyx_n_s_node_order, __pyx_n_s_dX);
if (unlikely(!__pyx_tuple__40)) __PYX_ERR(0, 190, __pyx_L1_error)
22638 __Pyx_GOTREF(__pyx_tuple__40);
22639 __Pyx_GIVEREF(__pyx_tuple__40);
22640 __pyx_codeobj__41 = (PyObject*)__Pyx_PyCode_New(5, 0, 5, 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_csmoothers_pyx, __pyx_n_s_gauss_seidel_NR_solve, 190, __pyx_empty_bytes);
if (unlikely(!__pyx_codeobj__41)) __PYX_ERR(0, 190, __pyx_L1_error)
22649 __pyx_tuple__42 = PyTuple_Pack(6, __pyx_n_s_A, __pyx_n_s_R, __pyx_n_s_node_order, __pyx_n_s_w, __pyx_n_s_tol, __pyx_n_s_dX);
if (unlikely(!__pyx_tuple__42)) __PYX_ERR(0, 217, __pyx_L1_error)
22650 __Pyx_GOTREF(__pyx_tuple__42);
22651 __Pyx_GIVEREF(__pyx_tuple__42);
22652 __pyx_codeobj__43 = (PyObject*)__Pyx_PyCode_New(6, 0, 6, 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_csmoothers_pyx, __pyx_n_s_nl_gauss_seidel_NR_solve, 217, __pyx_empty_bytes);
if (unlikely(!__pyx_codeobj__43)) __PYX_ERR(0, 217, __pyx_L1_error)
22661 __pyx_tuple__44 = PyTuple_Pack(2, __pyx_n_s_A, __pyx_n_s_asmFactor);
if (unlikely(!__pyx_tuple__44)) __PYX_ERR(0, 251, __pyx_L1_error)
22662 __Pyx_GOTREF(__pyx_tuple__44);
22663 __Pyx_GIVEREF(__pyx_tuple__44);
22664 __pyx_codeobj__45 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 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_csmoothers_pyx, __pyx_n_s_asm_NR_prepare, 251, __pyx_empty_bytes);
if (unlikely(!__pyx_codeobj__45)) __PYX_ERR(0, 251, __pyx_L1_error)
22673 __pyx_tuple__46 = PyTuple_Pack(6, __pyx_n_s_A, __pyx_n_s_w, __pyx_n_s_asmFactor, __pyx_n_s_node_order, __pyx_n_s_R, __pyx_n_s_dX);
if (unlikely(!__pyx_tuple__46)) __PYX_ERR(0, 277, __pyx_L1_error)
22674 __Pyx_GOTREF(__pyx_tuple__46);
22675 __Pyx_GIVEREF(__pyx_tuple__46);
22676 __pyx_codeobj__47 = (PyObject*)__Pyx_PyCode_New(6, 0, 6, 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_proteus_csmoothers_pyx, __pyx_n_s_asm_NR_solve, 277, __pyx_empty_bytes);
if (unlikely(!__pyx_codeobj__47)) __PYX_ERR(0, 277, __pyx_L1_error)
22685 __pyx_tuple__48 = PyTuple_Pack(2, __pyx_n_s_A, __pyx_n_s_basmFactor);
if (unlikely(!__pyx_tuple__48)) __PYX_ERR(0, 321, __pyx_L1_error)
22686 __Pyx_GOTREF(__pyx_tuple__48);
22687 __Pyx_GIVEREF(__pyx_tuple__48);
22688 __pyx_codeobj__49 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__48, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_proteus_csmoothers_pyx, __pyx_n_s_basm_NR_prepare, 321, __pyx_empty_bytes);
if (unlikely(!__pyx_codeobj__49)) __PYX_ERR(0, 321, __pyx_L1_error)
22697 __pyx_tuple__50 = PyTuple_Pack(6, __pyx_n_s_A, __pyx_n_s_w, __pyx_n_s_basmFactor, __pyx_n_s_node_order, __pyx_n_s_R, __pyx_n_s_dX);
if (unlikely(!__pyx_tuple__50)) __PYX_ERR(0, 350, __pyx_L1_error)
22698 __Pyx_GOTREF(__pyx_tuple__50);
22699 __Pyx_GIVEREF(__pyx_tuple__50);
22700 __pyx_codeobj__51 = (PyObject*)__Pyx_PyCode_New(6, 0, 6, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__50, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_proteus_csmoothers_pyx, __pyx_n_s_basm_NR_solve, 350, __pyx_empty_bytes);
if (unlikely(!__pyx_codeobj__51)) __PYX_ERR(0, 350, __pyx_L1_error)
22709 __pyx_tuple__52 = PyTuple_Pack(1, __pyx_kp_s_strided_and_direct_or_indirect);
if (unlikely(!__pyx_tuple__52)) __PYX_ERR(1, 286, __pyx_L1_error)
22710 __Pyx_GOTREF(__pyx_tuple__52);
22711 __Pyx_GIVEREF(__pyx_tuple__52);
22720 __pyx_tuple__53 = PyTuple_Pack(1, __pyx_kp_s_strided_and_direct);
if (unlikely(!__pyx_tuple__53)) __PYX_ERR(1, 287, __pyx_L1_error)
22721 __Pyx_GOTREF(__pyx_tuple__53);
22722 __Pyx_GIVEREF(__pyx_tuple__53);
22731 __pyx_tuple__54 = PyTuple_Pack(1, __pyx_kp_s_strided_and_indirect);
if (unlikely(!__pyx_tuple__54)) __PYX_ERR(1, 288, __pyx_L1_error)
22732 __Pyx_GOTREF(__pyx_tuple__54);
22733 __Pyx_GIVEREF(__pyx_tuple__54);
22742 __pyx_tuple__55 = PyTuple_Pack(1, __pyx_kp_s_contiguous_and_direct);
if (unlikely(!__pyx_tuple__55)) __PYX_ERR(1, 291, __pyx_L1_error)
22743 __Pyx_GOTREF(__pyx_tuple__55);
22744 __Pyx_GIVEREF(__pyx_tuple__55);
22753 __pyx_tuple__56 = PyTuple_Pack(1, __pyx_kp_s_contiguous_and_indirect);
if (unlikely(!__pyx_tuple__56)) __PYX_ERR(1, 292, __pyx_L1_error)
22754 __Pyx_GOTREF(__pyx_tuple__56);
22755 __Pyx_GIVEREF(__pyx_tuple__56);
22762 __pyx_tuple__57 = 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__57)) __PYX_ERR(1, 1, __pyx_L1_error)
22763 __Pyx_GOTREF(__pyx_tuple__57);
22764 __Pyx_GIVEREF(__pyx_tuple__57);
22765 __pyx_codeobj__58 = (PyObject*)__Pyx_PyCode_New(3, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__57, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_pyx_unpickle_Enum, 1, __pyx_empty_bytes);
if (unlikely(!__pyx_codeobj__58)) __PYX_ERR(1, 1, __pyx_L1_error)
22766 __Pyx_RefNannyFinishContext();
22769 __Pyx_RefNannyFinishContext();
22773 static CYTHON_SMALL_CODE
int __Pyx_InitGlobals(
void) {
22774 if (__Pyx_InitStrings(__pyx_string_tab) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
22775 __pyx_int_0 = PyInt_FromLong(0);
if (unlikely(!__pyx_int_0)) __PYX_ERR(0, 1, __pyx_L1_error)
22776 __pyx_int_1 = PyInt_FromLong(1);
if (unlikely(!__pyx_int_1)) __PYX_ERR(0, 1, __pyx_L1_error)
22777 __pyx_int_112105877 = PyInt_FromLong(112105877
L);
if (unlikely(!__pyx_int_112105877)) __PYX_ERR(0, 1, __pyx_L1_error)
22778 __pyx_int_136983863 = PyInt_FromLong(136983863
L);
if (unlikely(!__pyx_int_136983863)) __PYX_ERR(0, 1, __pyx_L1_error)
22779 __pyx_int_184977713 = PyInt_FromLong(184977713
L);
if (unlikely(!__pyx_int_184977713)) __PYX_ERR(0, 1, __pyx_L1_error)
22780 __pyx_int_neg_1 = PyInt_FromLong(-1);
if (unlikely(!__pyx_int_neg_1)) __PYX_ERR(0, 1, __pyx_L1_error)
22786 static CYTHON_SMALL_CODE
int __Pyx_modinit_global_init_code(
void);
22787 static CYTHON_SMALL_CODE
int __Pyx_modinit_variable_export_code(
void);
22788 static CYTHON_SMALL_CODE
int __Pyx_modinit_function_export_code(
void);
22789 static CYTHON_SMALL_CODE
int __Pyx_modinit_type_init_code(
void);
22790 static CYTHON_SMALL_CODE
int __Pyx_modinit_type_import_code(
void);
22791 static CYTHON_SMALL_CODE
int __Pyx_modinit_variable_import_code(
void);
22792 static CYTHON_SMALL_CODE
int __Pyx_modinit_function_import_code(
void);
22794 static int __Pyx_modinit_global_init_code(
void) {
22795 __Pyx_RefNannyDeclarations
22796 __Pyx_RefNannySetupContext(
"__Pyx_modinit_global_init_code", 0);
22798 generic = Py_None; Py_INCREF(Py_None);
22799 strided = Py_None; Py_INCREF(Py_None);
22800 indirect = Py_None; Py_INCREF(Py_None);
22801 contiguous = Py_None; Py_INCREF(Py_None);
22802 indirect_contiguous = Py_None; Py_INCREF(Py_None);
22803 __Pyx_RefNannyFinishContext();
22807 static int __Pyx_modinit_variable_export_code(
void) {
22808 __Pyx_RefNannyDeclarations
22809 __Pyx_RefNannySetupContext(
"__Pyx_modinit_variable_export_code", 0);
22811 __Pyx_RefNannyFinishContext();
22815 static int __Pyx_modinit_function_export_code(
void) {
22816 __Pyx_RefNannyDeclarations
22817 __Pyx_RefNannySetupContext(
"__Pyx_modinit_function_export_code", 0);
22819 __Pyx_RefNannyFinishContext();
22823 static int __Pyx_modinit_type_init_code(
void) {
22824 __Pyx_RefNannyDeclarations
22825 int __pyx_lineno = 0;
22826 const char *__pyx_filename = NULL;
22827 int __pyx_clineno = 0;
22828 __Pyx_RefNannySetupContext(
"__Pyx_modinit_type_init_code", 0);
22830 if (PyType_Ready(&__pyx_type_10csmoothers_cASMFactor) < 0) __PYX_ERR(0, 11, __pyx_L1_error)
22831 #if PY_VERSION_HEX < 0x030800B1
22832 __pyx_type_10csmoothers_cASMFactor.tp_print = 0;
22834 if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_10csmoothers_cASMFactor.tp_dictoffset && __pyx_type_10csmoothers_cASMFactor.tp_getattro == PyObject_GenericGetAttr)) {
22835 __pyx_type_10csmoothers_cASMFactor.tp_getattro = __Pyx_PyObject_GenericGetAttr;
22837 if (PyObject_SetAttr(__pyx_m, __pyx_n_s_cASMFactor_2, (PyObject *)&__pyx_type_10csmoothers_cASMFactor) < 0) __PYX_ERR(0, 11, __pyx_L1_error)
22838 if (__Pyx_setup_reduce((PyObject*)&__pyx_type_10csmoothers_cASMFactor) < 0) __PYX_ERR(0, 11, __pyx_L1_error)
22839 __pyx_ptype_10csmoothers_cASMFactor = &__pyx_type_10csmoothers_cASMFactor;
22840 if (PyType_Ready(&__pyx_type_10csmoothers_cBASMFactor) < 0) __PYX_ERR(0, 50, __pyx_L1_error)
22841 #if PY_VERSION_HEX < 0x030800B1
22842 __pyx_type_10csmoothers_cBASMFactor.tp_print = 0;
22844 if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_10csmoothers_cBASMFactor.tp_dictoffset && __pyx_type_10csmoothers_cBASMFactor.tp_getattro == PyObject_GenericGetAttr)) {
22845 __pyx_type_10csmoothers_cBASMFactor.tp_getattro = __Pyx_PyObject_GenericGetAttr;
22847 if (PyObject_SetAttr(__pyx_m, __pyx_n_s_cBASMFactor_2, (PyObject *)&__pyx_type_10csmoothers_cBASMFactor) < 0) __PYX_ERR(0, 50, __pyx_L1_error)
22848 if (__Pyx_setup_reduce((PyObject*)&__pyx_type_10csmoothers_cBASMFactor) < 0) __PYX_ERR(0, 50, __pyx_L1_error)
22849 __pyx_ptype_10csmoothers_cBASMFactor = &__pyx_type_10csmoothers_cBASMFactor;
22850 __pyx_vtabptr_array = &__pyx_vtable_array;
22851 __pyx_vtable_array.get_memview = (PyObject *(*)(
struct __pyx_array_obj *))__pyx_array_get_memview;
22852 if (PyType_Ready(&__pyx_type___pyx_array) < 0) __PYX_ERR(1, 105, __pyx_L1_error)
22853 #if PY_VERSION_HEX < 0x030800B1
22854 __pyx_type___pyx_array.tp_print = 0;
22856 if (__Pyx_SetVtable(__pyx_type___pyx_array.tp_dict, __pyx_vtabptr_array) < 0) __PYX_ERR(1, 105, __pyx_L1_error)
22857 if (__Pyx_setup_reduce((PyObject*)&__pyx_type___pyx_array) < 0) __PYX_ERR(1, 105, __pyx_L1_error)
22858 __pyx_array_type = &__pyx_type___pyx_array;
22859 if (PyType_Ready(&__pyx_type___pyx_MemviewEnum) < 0) __PYX_ERR(1, 279, __pyx_L1_error)
22860 #if PY_VERSION_HEX < 0x030800B1
22861 __pyx_type___pyx_MemviewEnum.tp_print = 0;
22863 if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type___pyx_MemviewEnum.tp_dictoffset && __pyx_type___pyx_MemviewEnum.tp_getattro == PyObject_GenericGetAttr)) {
22864 __pyx_type___pyx_MemviewEnum.tp_getattro = __Pyx_PyObject_GenericGetAttr;
22866 if (__Pyx_setup_reduce((PyObject*)&__pyx_type___pyx_MemviewEnum) < 0) __PYX_ERR(1, 279, __pyx_L1_error)
22867 __pyx_MemviewEnum_type = &__pyx_type___pyx_MemviewEnum;
22868 __pyx_vtabptr_memoryview = &__pyx_vtable_memoryview;
22869 __pyx_vtable_memoryview.get_item_pointer = (
char *(*)(
struct __pyx_memoryview_obj *, PyObject *))__pyx_memoryview_get_item_pointer;
22870 __pyx_vtable_memoryview.is_slice = (PyObject *(*)(
struct __pyx_memoryview_obj *, PyObject *))__pyx_memoryview_is_slice;
22871 __pyx_vtable_memoryview.setitem_slice_assignment = (PyObject *(*)(
struct __pyx_memoryview_obj *, PyObject *, PyObject *))__pyx_memoryview_setitem_slice_assignment;
22872 __pyx_vtable_memoryview.setitem_slice_assign_scalar = (PyObject *(*)(
struct __pyx_memoryview_obj *,
struct __pyx_memoryview_obj *, PyObject *))__pyx_memoryview_setitem_slice_assign_scalar;
22873 __pyx_vtable_memoryview.setitem_indexed = (PyObject *(*)(
struct __pyx_memoryview_obj *, PyObject *, PyObject *))__pyx_memoryview_setitem_indexed;
22874 __pyx_vtable_memoryview.convert_item_to_object = (PyObject *(*)(
struct __pyx_memoryview_obj *,
char *))__pyx_memoryview_convert_item_to_object;
22875 __pyx_vtable_memoryview.assign_item_from_object = (PyObject *(*)(
struct __pyx_memoryview_obj *,
char *, PyObject *))__pyx_memoryview_assign_item_from_object;
22876 if (PyType_Ready(&__pyx_type___pyx_memoryview) < 0) __PYX_ERR(1, 330, __pyx_L1_error)
22877 #if PY_VERSION_HEX < 0x030800B1
22878 __pyx_type___pyx_memoryview.tp_print = 0;
22880 if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type___pyx_memoryview.tp_dictoffset && __pyx_type___pyx_memoryview.tp_getattro == PyObject_GenericGetAttr)) {
22881 __pyx_type___pyx_memoryview.tp_getattro = __Pyx_PyObject_GenericGetAttr;
22883 if (__Pyx_SetVtable(__pyx_type___pyx_memoryview.tp_dict, __pyx_vtabptr_memoryview) < 0) __PYX_ERR(1, 330, __pyx_L1_error)
22884 if (__Pyx_setup_reduce((PyObject*)&__pyx_type___pyx_memoryview) < 0) __PYX_ERR(1, 330, __pyx_L1_error)
22885 __pyx_memoryview_type = &__pyx_type___pyx_memoryview;
22886 __pyx_vtabptr__memoryviewslice = &__pyx_vtable__memoryviewslice;
22887 __pyx_vtable__memoryviewslice.__pyx_base = *__pyx_vtabptr_memoryview;
22888 __pyx_vtable__memoryviewslice.__pyx_base.convert_item_to_object = (PyObject *(*)(
struct __pyx_memoryview_obj *,
char *))__pyx_memoryviewslice_convert_item_to_object;
22889 __pyx_vtable__memoryviewslice.__pyx_base.assign_item_from_object = (PyObject *(*)(
struct __pyx_memoryview_obj *,
char *, PyObject *))__pyx_memoryviewslice_assign_item_from_object;
22890 __pyx_type___pyx_memoryviewslice.tp_base = __pyx_memoryview_type;
22891 if (PyType_Ready(&__pyx_type___pyx_memoryviewslice) < 0) __PYX_ERR(1, 965, __pyx_L1_error)
22892 #if PY_VERSION_HEX < 0x030800B1
22893 __pyx_type___pyx_memoryviewslice.tp_print = 0;
22895 if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type___pyx_memoryviewslice.tp_dictoffset && __pyx_type___pyx_memoryviewslice.tp_getattro == PyObject_GenericGetAttr)) {
22896 __pyx_type___pyx_memoryviewslice.tp_getattro = __Pyx_PyObject_GenericGetAttr;
22898 if (__Pyx_SetVtable(__pyx_type___pyx_memoryviewslice.tp_dict, __pyx_vtabptr__memoryviewslice) < 0) __PYX_ERR(1, 965, __pyx_L1_error)
22899 if (__Pyx_setup_reduce((PyObject*)&__pyx_type___pyx_memoryviewslice) < 0) __PYX_ERR(1, 965, __pyx_L1_error)
22900 __pyx_memoryviewslice_type = &__pyx_type___pyx_memoryviewslice;
22901 __Pyx_RefNannyFinishContext();
22904 __Pyx_RefNannyFinishContext();
22908 static int __Pyx_modinit_type_import_code(
void) {
22909 __Pyx_RefNannyDeclarations
22910 PyObject *__pyx_t_1 = NULL;
22911 int __pyx_lineno = 0;
22912 const char *__pyx_filename = NULL;
22913 int __pyx_clineno = 0;
22914 __Pyx_RefNannySetupContext(
"__Pyx_modinit_type_import_code", 0);
22916 __pyx_t_1 = PyImport_ImportModule(__Pyx_BUILTIN_MODULE_NAME);
if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 9, __pyx_L1_error)
22917 __Pyx_GOTREF(__pyx_t_1);
22918 __pyx_ptype_7cpython_4type_type = __Pyx_ImportType(__pyx_t_1, __Pyx_BUILTIN_MODULE_NAME,
"type",
22919 #
if defined(PYPY_VERSION_NUM) && PYPY_VERSION_NUM < 0x050B0000
22920 sizeof(PyTypeObject),
22922 sizeof(PyHeapTypeObject),
22924 __Pyx_ImportType_CheckSize_Warn);
22925 if (!__pyx_ptype_7cpython_4type_type) __PYX_ERR(3, 9, __pyx_L1_error)
22926 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
22927 __pyx_t_1 = PyImport_ImportModule(
"numpy");
if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 200, __pyx_L1_error)
22928 __Pyx_GOTREF(__pyx_t_1);
22929 __pyx_ptype_5numpy_dtype = __Pyx_ImportType(__pyx_t_1,
"numpy",
"dtype",
sizeof(PyArray_Descr), __Pyx_ImportType_CheckSize_Ignore);
22930 if (!__pyx_ptype_5numpy_dtype) __PYX_ERR(2, 200, __pyx_L1_error)
22931 __pyx_ptype_5numpy_flatiter = __Pyx_ImportType(__pyx_t_1,
"numpy",
"flatiter",
sizeof(PyArrayIterObject), __Pyx_ImportType_CheckSize_Ignore);
22932 if (!__pyx_ptype_5numpy_flatiter) __PYX_ERR(2, 223, __pyx_L1_error)
22933 __pyx_ptype_5numpy_broadcast = __Pyx_ImportType(__pyx_t_1,
"numpy",
"broadcast",
sizeof(PyArrayMultiIterObject), __Pyx_ImportType_CheckSize_Ignore);
22934 if (!__pyx_ptype_5numpy_broadcast) __PYX_ERR(2, 227, __pyx_L1_error)
22935 __pyx_ptype_5numpy_ndarray = __Pyx_ImportType(__pyx_t_1,
"numpy",
"ndarray",
sizeof(PyArrayObject), __Pyx_ImportType_CheckSize_Ignore);
22936 if (!__pyx_ptype_5numpy_ndarray) __PYX_ERR(2, 239, __pyx_L1_error)
22937 __pyx_ptype_5numpy_generic = __Pyx_ImportType(__pyx_t_1,
"numpy",
"generic",
sizeof(PyObject), __Pyx_ImportType_CheckSize_Warn);
22938 if (!__pyx_ptype_5numpy_generic) __PYX_ERR(2, 771, __pyx_L1_error)
22939 __pyx_ptype_5numpy_number = __Pyx_ImportType(__pyx_t_1,
"numpy",
"number",
sizeof(PyObject), __Pyx_ImportType_CheckSize_Warn);
22940 if (!__pyx_ptype_5numpy_number) __PYX_ERR(2, 773, __pyx_L1_error)
22941 __pyx_ptype_5numpy_integer = __Pyx_ImportType(__pyx_t_1,
"numpy",
"integer",
sizeof(PyObject), __Pyx_ImportType_CheckSize_Warn);
22942 if (!__pyx_ptype_5numpy_integer) __PYX_ERR(2, 775, __pyx_L1_error)
22943 __pyx_ptype_5numpy_signedinteger = __Pyx_ImportType(__pyx_t_1,
"numpy",
"signedinteger",
sizeof(PyObject), __Pyx_ImportType_CheckSize_Warn);
22944 if (!__pyx_ptype_5numpy_signedinteger) __PYX_ERR(2, 777, __pyx_L1_error)
22945 __pyx_ptype_5numpy_unsignedinteger = __Pyx_ImportType(__pyx_t_1,
"numpy",
"unsignedinteger",
sizeof(PyObject), __Pyx_ImportType_CheckSize_Warn);
22946 if (!__pyx_ptype_5numpy_unsignedinteger) __PYX_ERR(2, 779, __pyx_L1_error)
22947 __pyx_ptype_5numpy_inexact = __Pyx_ImportType(__pyx_t_1,
"numpy",
"inexact",
sizeof(PyObject), __Pyx_ImportType_CheckSize_Warn);
22948 if (!__pyx_ptype_5numpy_inexact) __PYX_ERR(2, 781, __pyx_L1_error)
22949 __pyx_ptype_5numpy_floating = __Pyx_ImportType(__pyx_t_1,
"numpy",
"floating",
sizeof(PyObject), __Pyx_ImportType_CheckSize_Warn);
22950 if (!__pyx_ptype_5numpy_floating) __PYX_ERR(2, 783, __pyx_L1_error)
22951 __pyx_ptype_5numpy_complexfloating = __Pyx_ImportType(__pyx_t_1,
"numpy",
"complexfloating",
sizeof(PyObject), __Pyx_ImportType_CheckSize_Warn);
22952 if (!__pyx_ptype_5numpy_complexfloating) __PYX_ERR(2, 785, __pyx_L1_error)
22953 __pyx_ptype_5numpy_flexible = __Pyx_ImportType(__pyx_t_1,
"numpy",
"flexible",
sizeof(PyObject), __Pyx_ImportType_CheckSize_Warn);
22954 if (!__pyx_ptype_5numpy_flexible) __PYX_ERR(2, 787, __pyx_L1_error)
22955 __pyx_ptype_5numpy_character = __Pyx_ImportType(__pyx_t_1,
"numpy",
"character",
sizeof(PyObject), __Pyx_ImportType_CheckSize_Warn);
22956 if (!__pyx_ptype_5numpy_character) __PYX_ERR(2, 789, __pyx_L1_error)
22957 __pyx_ptype_5numpy_ufunc = __Pyx_ImportType(__pyx_t_1,
"numpy",
"ufunc",
sizeof(PyUFuncObject), __Pyx_ImportType_CheckSize_Ignore);
22958 if (!__pyx_ptype_5numpy_ufunc) __PYX_ERR(2, 827, __pyx_L1_error)
22959 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
22960 __pyx_t_1 = PyImport_ImportModule(
"proteus.superluWrappers");
if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 67, __pyx_L1_error)
22961 __Pyx_GOTREF(__pyx_t_1);
22962 __pyx_ptype_7proteus_15superluWrappers_cSparseMatrix = __Pyx_ImportType(__pyx_t_1,
"proteus.superluWrappers",
"cSparseMatrix",
sizeof(
struct __pyx_obj_7proteus_15superluWrappers_cSparseMatrix), __Pyx_ImportType_CheckSize_Warn);
22963 if (!__pyx_ptype_7proteus_15superluWrappers_cSparseMatrix) __PYX_ERR(4, 67, __pyx_L1_error)
22964 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
22965 __Pyx_RefNannyFinishContext();
22968 __Pyx_XDECREF(__pyx_t_1);
22969 __Pyx_RefNannyFinishContext();
22973 static int __Pyx_modinit_variable_import_code(
void) {
22974 __Pyx_RefNannyDeclarations
22975 __Pyx_RefNannySetupContext(
"__Pyx_modinit_variable_import_code", 0);
22977 __Pyx_RefNannyFinishContext();
22981 static int __Pyx_modinit_function_import_code(
void) {
22982 __Pyx_RefNannyDeclarations
22983 __Pyx_RefNannySetupContext(
"__Pyx_modinit_function_import_code", 0);
22985 __Pyx_RefNannyFinishContext();
22990 #ifndef CYTHON_NO_PYINIT_EXPORT
22991 #define __Pyx_PyMODINIT_FUNC PyMODINIT_FUNC
22992 #elif PY_MAJOR_VERSION < 3
22994 #define __Pyx_PyMODINIT_FUNC extern "C" void
22996 #define __Pyx_PyMODINIT_FUNC void
23000 #define __Pyx_PyMODINIT_FUNC extern "C" PyObject *
23002 #define __Pyx_PyMODINIT_FUNC PyObject *
23007 #if PY_MAJOR_VERSION < 3
23008 __Pyx_PyMODINIT_FUNC initcsmoothers(
void) CYTHON_SMALL_CODE;
23009 __Pyx_PyMODINIT_FUNC initcsmoothers(
void)
23011 __Pyx_PyMODINIT_FUNC PyInit_csmoothers(
void) CYTHON_SMALL_CODE;
23012 __Pyx_PyMODINIT_FUNC PyInit_csmoothers(
void)
23013 #if CYTHON_PEP489_MULTI_PHASE_INIT
23015 return PyModuleDef_Init(&__pyx_moduledef);
23017 static CYTHON_SMALL_CODE
int __Pyx_check_single_interpreter(
void) {
23018 #if PY_VERSION_HEX >= 0x030700A1
23019 static PY_INT64_T main_interpreter_id = -1;
23020 PY_INT64_T current_id = PyInterpreterState_GetID(PyThreadState_Get()->interp);
23021 if (main_interpreter_id == -1) {
23022 main_interpreter_id = current_id;
23023 return (unlikely(current_id == -1)) ? -1 : 0;
23024 }
else if (unlikely(main_interpreter_id != current_id))
23026 static PyInterpreterState *main_interpreter = NULL;
23027 PyInterpreterState *current_interpreter = PyThreadState_Get()->interp;
23028 if (!main_interpreter) {
23029 main_interpreter = current_interpreter;
23030 }
else if (unlikely(main_interpreter != current_interpreter))
23035 "Interpreter change detected - this module can only be loaded into one interpreter per process.");
23040 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) {
23041 PyObject *value = PyObject_GetAttrString(spec, from_name);
23043 if (likely(value)) {
23044 if (allow_none || value != Py_None) {
23045 result = PyDict_SetItemString(moddict, to_name, value);
23048 }
else if (PyErr_ExceptionMatches(PyExc_AttributeError)) {
23055 static CYTHON_SMALL_CODE PyObject* __pyx_pymod_create(PyObject *spec, CYTHON_UNUSED PyModuleDef *def) {
23056 PyObject *module = NULL, *moddict, *modname;
23057 if (__Pyx_check_single_interpreter())
23060 return __Pyx_NewRef(__pyx_m);
23061 modname = PyObject_GetAttrString(spec,
"name");
23062 if (unlikely(!modname))
goto bad;
23063 module = PyModule_NewObject(modname);
23064 Py_DECREF(modname);
23065 if (unlikely(!module))
goto bad;
23066 moddict = PyModule_GetDict(module);
23067 if (unlikely(!moddict))
goto bad;
23068 if (unlikely(__Pyx_copy_spec_to_module(spec, moddict,
"loader",
"__loader__", 1) < 0))
goto bad;
23069 if (unlikely(__Pyx_copy_spec_to_module(spec, moddict,
"origin",
"__file__", 1) < 0))
goto bad;
23070 if (unlikely(__Pyx_copy_spec_to_module(spec, moddict,
"parent",
"__package__", 1) < 0))
goto bad;
23071 if (unlikely(__Pyx_copy_spec_to_module(spec, moddict,
"submodule_search_locations",
"__path__", 0) < 0))
goto bad;
23074 Py_XDECREF(module);
23079 static CYTHON_SMALL_CODE
int __pyx_pymod_exec_csmoothers(PyObject *__pyx_pyinit_module)
23083 PyObject *__pyx_t_1 = NULL;
23084 PyObject *__pyx_t_2 = NULL;
23085 PyObject *__pyx_t_3 = NULL;
23086 static PyThread_type_lock __pyx_t_4[8];
23087 int __pyx_lineno = 0;
23088 const char *__pyx_filename = NULL;
23089 int __pyx_clineno = 0;
23090 __Pyx_RefNannyDeclarations
23091 #if CYTHON_PEP489_MULTI_PHASE_INIT
23093 if (__pyx_m == __pyx_pyinit_module)
return 0;
23094 PyErr_SetString(PyExc_RuntimeError,
"Module 'csmoothers' has already been imported. Re-initialisation is not supported.");
23097 #elif PY_MAJOR_VERSION >= 3
23098 if (__pyx_m)
return __Pyx_NewRef(__pyx_m);
23100 #if CYTHON_REFNANNY
23101 __Pyx_RefNanny = __Pyx_RefNannyImportAPI(
"refnanny");
23102 if (!__Pyx_RefNanny) {
23104 __Pyx_RefNanny = __Pyx_RefNannyImportAPI(
"Cython.Runtime.refnanny");
23105 if (!__Pyx_RefNanny)
23106 Py_FatalError(
"failed to import 'refnanny' module");
23109 __Pyx_RefNannySetupContext(
"__Pyx_PyMODINIT_FUNC PyInit_csmoothers(void)", 0);
23110 if (__Pyx_check_binary_version() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
23111 #ifdef __Pxy_PyFrame_Initialize_Offsets
23112 __Pxy_PyFrame_Initialize_Offsets();
23114 __pyx_empty_tuple = PyTuple_New(0);
if (unlikely(!__pyx_empty_tuple)) __PYX_ERR(0, 1, __pyx_L1_error)
23115 __pyx_empty_bytes = PyBytes_FromStringAndSize(
"", 0);
if (unlikely(!__pyx_empty_bytes)) __PYX_ERR(0, 1, __pyx_L1_error)
23116 __pyx_empty_unicode = PyUnicode_FromStringAndSize(
"", 0);
if (unlikely(!__pyx_empty_unicode)) __PYX_ERR(0, 1, __pyx_L1_error)
23117 #ifdef __Pyx_CyFunction_USED
23118 if (__pyx_CyFunction_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
23120 #ifdef __Pyx_FusedFunction_USED
23121 if (__pyx_FusedFunction_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
23123 #ifdef __Pyx_Coroutine_USED
23124 if (__pyx_Coroutine_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
23126 #ifdef __Pyx_Generator_USED
23127 if (__pyx_Generator_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
23129 #ifdef __Pyx_AsyncGen_USED
23130 if (__pyx_AsyncGen_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
23132 #ifdef __Pyx_StopAsyncIteration_USED
23133 if (__pyx_StopAsyncIteration_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
23137 #if defined(WITH_THREAD) && PY_VERSION_HEX < 0x030700F0 && defined(__PYX_FORCE_INIT_THREADS) && __PYX_FORCE_INIT_THREADS
23138 PyEval_InitThreads();
23141 #if CYTHON_PEP489_MULTI_PHASE_INIT
23142 __pyx_m = __pyx_pyinit_module;
23143 Py_INCREF(__pyx_m);
23145 #if PY_MAJOR_VERSION < 3
23146 __pyx_m = Py_InitModule4(
"csmoothers", __pyx_methods, 0, 0, PYTHON_API_VERSION); Py_XINCREF(__pyx_m);
23148 __pyx_m = PyModule_Create(&__pyx_moduledef);
23150 if (unlikely(!__pyx_m)) __PYX_ERR(0, 1, __pyx_L1_error)
23152 __pyx_d = PyModule_GetDict(__pyx_m);
if (unlikely(!__pyx_d)) __PYX_ERR(0, 1, __pyx_L1_error)
23153 Py_INCREF(__pyx_d);
23154 __pyx_b = PyImport_AddModule(__Pyx_BUILTIN_MODULE_NAME);
if (unlikely(!__pyx_b)) __PYX_ERR(0, 1, __pyx_L1_error)
23155 Py_INCREF(__pyx_b);
23156 __pyx_cython_runtime = PyImport_AddModule((
char *)
"cython_runtime");
if (unlikely(!__pyx_cython_runtime)) __PYX_ERR(0, 1, __pyx_L1_error)
23157 Py_INCREF(__pyx_cython_runtime);
23158 if (PyObject_SetAttrString(__pyx_m,
"__builtins__", __pyx_b) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
23160 if (__Pyx_InitGlobals() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
23161 #if PY_MAJOR_VERSION < 3 && (__PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT)
23162 if (__Pyx_init_sys_getdefaultencoding_params() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
23164 if (__pyx_module_is_main_csmoothers) {
23165 if (PyObject_SetAttr(__pyx_m, __pyx_n_s_name_2, __pyx_n_s_main) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
23167 #if PY_MAJOR_VERSION >= 3
23169 PyObject *modules = PyImport_GetModuleDict();
if (unlikely(!modules)) __PYX_ERR(0, 1, __pyx_L1_error)
23170 if (!PyDict_GetItemString(modules,
"csmoothers")) {
23171 if (unlikely(PyDict_SetItemString(modules,
"csmoothers", __pyx_m) < 0)) __PYX_ERR(0, 1, __pyx_L1_error)
23176 if (__Pyx_InitCachedBuiltins() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
23178 if (__Pyx_InitCachedConstants() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
23180 (void)__Pyx_modinit_global_init_code();
23181 (void)__Pyx_modinit_variable_export_code();
23182 (void)__Pyx_modinit_function_export_code();
23183 if (unlikely(__Pyx_modinit_type_init_code() < 0)) __PYX_ERR(0, 1, __pyx_L1_error)
23184 if (unlikely(__Pyx_modinit_type_import_code() < 0)) __PYX_ERR(0, 1, __pyx_L1_error)
23185 (void)__Pyx_modinit_variable_import_code();
23186 (void)__Pyx_modinit_function_import_code();
23188 #if defined(__Pyx_Generator_USED) || defined(__Pyx_Coroutine_USED)
23189 if (__Pyx_patch_abc() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
23197 __pyx_t_1 = __Pyx_Import(__pyx_n_s_numpy, 0, -1);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1, __pyx_L1_error)
23198 __Pyx_GOTREF(__pyx_t_1);
23199 if (PyDict_SetItem(__pyx_d, __pyx_n_s_np, __pyx_t_1) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
23200 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
23209 __pyx_t_1 = __Pyx_CalculateMetaclass(NULL, __pyx_tuple__26);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 5, __pyx_L1_error)
23210 __Pyx_GOTREF(__pyx_t_1);
23211 __pyx_t_2 = __Pyx_Py3MetaclassPrepare(__pyx_t_1, __pyx_tuple__26, __pyx_n_s_ASMFactor, __pyx_n_s_ASMFactor, (PyObject *) NULL, __pyx_n_s_csmoothers, (PyObject *) NULL);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5, __pyx_L1_error)
23212 __Pyx_GOTREF(__pyx_t_2);
23221 __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_10csmoothers_9ASMFactor_1__init__, 0, __pyx_n_s_ASMFactor___init, NULL, __pyx_n_s_csmoothers, __pyx_d, ((PyObject *)__pyx_codeobj__28));
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 7, __pyx_L1_error)
23222 __Pyx_GOTREF(__pyx_t_3);
23223 if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_n_s_init, __pyx_t_3) < 0) __PYX_ERR(0, 7, __pyx_L1_error)
23224 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
23233 __pyx_t_3 = __Pyx_Py3ClassCreate(__pyx_t_1, __pyx_n_s_ASMFactor, __pyx_tuple__26, __pyx_t_2, NULL, 0, 1);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 5, __pyx_L1_error)
23234 __Pyx_GOTREF(__pyx_t_3);
23235 if (PyDict_SetItem(__pyx_d, __pyx_n_s_ASMFactor, __pyx_t_3) < 0) __PYX_ERR(0, 5, __pyx_L1_error)
23236 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
23237 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
23238 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
23247 __pyx_t_1 = __Pyx_CalculateMetaclass(NULL, __pyx_tuple__29);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 42, __pyx_L1_error)
23248 __Pyx_GOTREF(__pyx_t_1);
23249 __pyx_t_2 = __Pyx_Py3MetaclassPrepare(__pyx_t_1, __pyx_tuple__29, __pyx_n_s_BASMFactor, __pyx_n_s_BASMFactor, (PyObject *) NULL, __pyx_n_s_csmoothers, (PyObject *) NULL);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 42, __pyx_L1_error)
23250 __Pyx_GOTREF(__pyx_t_2);
23259 __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_10csmoothers_10BASMFactor_1__init__, 0, __pyx_n_s_BASMFactor___init, NULL, __pyx_n_s_csmoothers, __pyx_d, ((PyObject *)__pyx_codeobj__31));
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 44, __pyx_L1_error)
23260 __Pyx_GOTREF(__pyx_t_3);
23261 if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_n_s_init, __pyx_t_3) < 0) __PYX_ERR(0, 44, __pyx_L1_error)
23262 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
23271 __pyx_t_3 = __Pyx_Py3ClassCreate(__pyx_t_1, __pyx_n_s_BASMFactor, __pyx_tuple__29, __pyx_t_2, NULL, 0, 1);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 42, __pyx_L1_error)
23272 __Pyx_GOTREF(__pyx_t_3);
23273 if (PyDict_SetItem(__pyx_d, __pyx_n_s_BASMFactor, __pyx_t_3) < 0) __PYX_ERR(0, 42, __pyx_L1_error)
23274 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
23275 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
23276 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
23285 __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_10csmoothers_1jacobi_NR_prepare, NULL, __pyx_n_s_csmoothers);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 84, __pyx_L1_error)
23286 __Pyx_GOTREF(__pyx_t_1);
23287 if (PyDict_SetItem(__pyx_d, __pyx_n_s_jacobi_NR_prepare, __pyx_t_1) < 0) __PYX_ERR(0, 84, __pyx_L1_error)
23288 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
23297 __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_10csmoothers_3jacobi_NR_solve, NULL, __pyx_n_s_csmoothers);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 109, __pyx_L1_error)
23298 __Pyx_GOTREF(__pyx_t_1);
23299 if (PyDict_SetItem(__pyx_d, __pyx_n_s_jacobi_NR_solve, __pyx_t_1) < 0) __PYX_ERR(0, 109, __pyx_L1_error)
23300 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
23309 __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_10csmoothers_5nl_jacobi_NR_solve, NULL, __pyx_n_s_csmoothers);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 136, __pyx_L1_error)
23310 __Pyx_GOTREF(__pyx_t_1);
23311 if (PyDict_SetItem(__pyx_d, __pyx_n_s_nl_jacobi_NR_solve, __pyx_t_1) < 0) __PYX_ERR(0, 136, __pyx_L1_error)
23312 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
23321 __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_10csmoothers_7gauss_seidel_NR_preare, NULL, __pyx_n_s_csmoothers);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 165, __pyx_L1_error)
23322 __Pyx_GOTREF(__pyx_t_1);
23323 if (PyDict_SetItem(__pyx_d, __pyx_n_s_gauss_seidel_NR_preare, __pyx_t_1) < 0) __PYX_ERR(0, 165, __pyx_L1_error)
23324 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
23333 __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_10csmoothers_9gauss_seidel_NR_solve, NULL, __pyx_n_s_csmoothers);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 190, __pyx_L1_error)
23334 __Pyx_GOTREF(__pyx_t_1);
23335 if (PyDict_SetItem(__pyx_d, __pyx_n_s_gauss_seidel_NR_solve, __pyx_t_1) < 0) __PYX_ERR(0, 190, __pyx_L1_error)
23336 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
23345 __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_10csmoothers_11nl_gauss_seidel_NR_solve, NULL, __pyx_n_s_csmoothers);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 217, __pyx_L1_error)
23346 __Pyx_GOTREF(__pyx_t_1);
23347 if (PyDict_SetItem(__pyx_d, __pyx_n_s_nl_gauss_seidel_NR_solve, __pyx_t_1) < 0) __PYX_ERR(0, 217, __pyx_L1_error)
23348 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
23357 __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_10csmoothers_13asm_NR_prepare, NULL, __pyx_n_s_csmoothers);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 251, __pyx_L1_error)
23358 __Pyx_GOTREF(__pyx_t_1);
23359 if (PyDict_SetItem(__pyx_d, __pyx_n_s_asm_NR_prepare, __pyx_t_1) < 0) __PYX_ERR(0, 251, __pyx_L1_error)
23360 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
23369 __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_10csmoothers_15asm_NR_solve, NULL, __pyx_n_s_csmoothers);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 277, __pyx_L1_error)
23370 __Pyx_GOTREF(__pyx_t_1);
23371 if (PyDict_SetItem(__pyx_d, __pyx_n_s_asm_NR_solve, __pyx_t_1) < 0) __PYX_ERR(0, 277, __pyx_L1_error)
23372 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
23381 __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_10csmoothers_17basm_NR_prepare, NULL, __pyx_n_s_csmoothers);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 321, __pyx_L1_error)
23382 __Pyx_GOTREF(__pyx_t_1);
23383 if (PyDict_SetItem(__pyx_d, __pyx_n_s_basm_NR_prepare, __pyx_t_1) < 0) __PYX_ERR(0, 321, __pyx_L1_error)
23384 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
23393 __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_10csmoothers_19basm_NR_solve, NULL, __pyx_n_s_csmoothers);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 350, __pyx_L1_error)
23394 __Pyx_GOTREF(__pyx_t_1);
23395 if (PyDict_SetItem(__pyx_d, __pyx_n_s_basm_NR_solve, __pyx_t_1) < 0) __PYX_ERR(0, 350, __pyx_L1_error)
23396 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
23403 __pyx_t_1 = __Pyx_PyDict_NewPresized(0);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1, __pyx_L1_error)
23404 __Pyx_GOTREF(__pyx_t_1);
23405 if (PyDict_SetItem(__pyx_d, __pyx_n_s_test, __pyx_t_1) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
23406 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
23415 __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)
23416 __Pyx_GOTREF(__pyx_t_1);
23417 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)
23418 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
23419 PyType_Modified(__pyx_array_type);
23428 __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)__pyx_MemviewEnum_type), __pyx_tuple__52, NULL);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 286, __pyx_L1_error)
23429 __Pyx_GOTREF(__pyx_t_1);
23430 __Pyx_XGOTREF(
generic);
23431 __Pyx_DECREF_SET(
generic, __pyx_t_1);
23432 __Pyx_GIVEREF(__pyx_t_1);
23442 __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)__pyx_MemviewEnum_type), __pyx_tuple__53, NULL);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 287, __pyx_L1_error)
23443 __Pyx_GOTREF(__pyx_t_1);
23444 __Pyx_XGOTREF(strided);
23445 __Pyx_DECREF_SET(strided, __pyx_t_1);
23446 __Pyx_GIVEREF(__pyx_t_1);
23456 __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)__pyx_MemviewEnum_type), __pyx_tuple__54, NULL);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 288, __pyx_L1_error)
23457 __Pyx_GOTREF(__pyx_t_1);
23458 __Pyx_XGOTREF(indirect);
23459 __Pyx_DECREF_SET(indirect, __pyx_t_1);
23460 __Pyx_GIVEREF(__pyx_t_1);
23470 __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)__pyx_MemviewEnum_type), __pyx_tuple__55, NULL);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 291, __pyx_L1_error)
23471 __Pyx_GOTREF(__pyx_t_1);
23472 __Pyx_XGOTREF(contiguous);
23473 __Pyx_DECREF_SET(contiguous, __pyx_t_1);
23474 __Pyx_GIVEREF(__pyx_t_1);
23484 __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)__pyx_MemviewEnum_type), __pyx_tuple__56, NULL);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 292, __pyx_L1_error)
23485 __Pyx_GOTREF(__pyx_t_1);
23486 __Pyx_XGOTREF(indirect_contiguous);
23487 __Pyx_DECREF_SET(indirect_contiguous, __pyx_t_1);
23488 __Pyx_GIVEREF(__pyx_t_1);
23498 __pyx_memoryview_thread_locks_used = 0;
23507 __pyx_t_4[0] = PyThread_allocate_lock();
23508 __pyx_t_4[1] = PyThread_allocate_lock();
23509 __pyx_t_4[2] = PyThread_allocate_lock();
23510 __pyx_t_4[3] = PyThread_allocate_lock();
23511 __pyx_t_4[4] = PyThread_allocate_lock();
23512 __pyx_t_4[5] = PyThread_allocate_lock();
23513 __pyx_t_4[6] = PyThread_allocate_lock();
23514 __pyx_t_4[7] = PyThread_allocate_lock();
23515 memcpy(&(__pyx_memoryview_thread_locks[0]), __pyx_t_4,
sizeof(__pyx_memoryview_thread_locks[0]) * (8));
23524 __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)
23525 __Pyx_GOTREF(__pyx_t_1);
23526 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)
23527 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
23528 PyType_Modified(__pyx_memoryview_type);
23537 __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)
23538 __Pyx_GOTREF(__pyx_t_1);
23539 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)
23540 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
23541 PyType_Modified(__pyx_memoryviewslice_type);
23548 __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)
23549 __Pyx_GOTREF(__pyx_t_1);
23550 if (PyDict_SetItem(__pyx_d, __pyx_n_s_pyx_unpickle_Enum, __pyx_t_1) < 0) __PYX_ERR(1, 1, __pyx_L1_error)
23551 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
23565 __Pyx_XDECREF(__pyx_t_1);
23566 __Pyx_XDECREF(__pyx_t_2);
23567 __Pyx_XDECREF(__pyx_t_3);
23570 __Pyx_AddTraceback(
"init csmoothers", __pyx_clineno, __pyx_lineno, __pyx_filename);
23573 }
else if (!PyErr_Occurred()) {
23574 PyErr_SetString(PyExc_ImportError,
"init csmoothers");
23577 __Pyx_RefNannyFinishContext();
23578 #if CYTHON_PEP489_MULTI_PHASE_INIT
23579 return (__pyx_m != NULL) ? 0 : -1;
23580 #elif PY_MAJOR_VERSION >= 3
23589 #if CYTHON_REFNANNY
23590 static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(
const char *modname) {
23591 PyObject *m = NULL, *p = NULL;
23593 m = PyImport_ImportModule(modname);
23595 p = PyObject_GetAttrString(m,
"RefNannyAPI");
23597 r = PyLong_AsVoidPtr(p);
23601 return (__Pyx_RefNannyAPIStruct *)
r;
23606 #if CYTHON_USE_TYPE_SLOTS
23607 static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name) {
23608 PyTypeObject* tp = Py_TYPE(obj);
23609 if (likely(tp->tp_getattro))
23610 return tp->tp_getattro(obj, attr_name);
23611 #if PY_MAJOR_VERSION < 3
23612 if (likely(tp->tp_getattr))
23613 return tp->tp_getattr(obj, PyString_AS_STRING(attr_name));
23615 return PyObject_GetAttr(obj, attr_name);
23620 static PyObject *__Pyx_GetBuiltinName(PyObject *name) {
23621 PyObject* result = __Pyx_PyObject_GetAttrStr(__pyx_b, name);
23622 if (unlikely(!result)) {
23623 PyErr_Format(PyExc_NameError,
23624 #
if PY_MAJOR_VERSION >= 3
23625 "name '%U' is not defined", name);
23627 "name '%.200s' is not defined", PyString_AS_STRING(name));
23634 static void __Pyx_RaiseArgtupleInvalid(
23635 const char* func_name,
23637 Py_ssize_t num_min,
23638 Py_ssize_t num_max,
23639 Py_ssize_t num_found)
23641 Py_ssize_t num_expected;
23642 const char *more_or_less;
23643 if (num_found < num_min) {
23644 num_expected = num_min;
23645 more_or_less =
"at least";
23647 num_expected = num_max;
23648 more_or_less =
"at most";
23651 more_or_less =
"exactly";
23653 PyErr_Format(PyExc_TypeError,
23654 "%.200s() takes %.8s %" CYTHON_FORMAT_SSIZE_T
"d positional argument%.1s (%" CYTHON_FORMAT_SSIZE_T
"d given)",
23655 func_name, more_or_less, num_expected,
23656 (num_expected == 1) ?
"" :
"s", num_found);
23660 static void __Pyx_RaiseDoubleKeywordsError(
23661 const char* func_name,
23664 PyErr_Format(PyExc_TypeError,
23665 #
if PY_MAJOR_VERSION >= 3
23666 "%s() got multiple values for keyword argument '%U'", func_name, kw_name);
23668 "%s() got multiple values for keyword argument '%s'", func_name,
23669 PyString_AsString(kw_name));
23674 static int __Pyx_ParseOptionalKeywords(
23676 PyObject **argnames[],
23678 PyObject *values[],
23679 Py_ssize_t num_pos_args,
23680 const char* function_name)
23682 PyObject *key = 0, *value = 0;
23683 Py_ssize_t
pos = 0;
23685 PyObject*** first_kw_arg = argnames + num_pos_args;
23686 while (PyDict_Next(kwds, &
pos, &key, &value)) {
23687 name = first_kw_arg;
23688 while (*name && (**name != key)) name++;
23690 values[name-argnames] = value;
23693 name = first_kw_arg;
23694 #if PY_MAJOR_VERSION < 3
23695 if (likely(PyString_Check(key))) {
23697 if ((CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**name) == PyString_GET_SIZE(key))
23698 && _PyString_Eq(**name, key)) {
23699 values[name-argnames] = value;
23704 if (*name)
continue;
23706 PyObject*** argname = argnames;
23707 while (argname != first_kw_arg) {
23708 if ((**argname == key) || (
23709 (CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**argname) == PyString_GET_SIZE(key))
23710 && _PyString_Eq(**argname, key))) {
23711 goto arg_passed_twice;
23718 if (likely(PyUnicode_Check(key))) {
23720 int cmp = (**name == key) ? 0 :
23721 #
if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3
23722 (__Pyx_PyUnicode_GET_LENGTH(**name) != __Pyx_PyUnicode_GET_LENGTH(key)) ? 1 :
23724 PyUnicode_Compare(**name, key);
23725 if (cmp < 0 && unlikely(PyErr_Occurred()))
goto bad;
23727 values[name-argnames] = value;
23732 if (*name)
continue;
23734 PyObject*** argname = argnames;
23735 while (argname != first_kw_arg) {
23736 int cmp = (**argname == key) ? 0 :
23737 #
if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3
23738 (__Pyx_PyUnicode_GET_LENGTH(**argname) != __Pyx_PyUnicode_GET_LENGTH(key)) ? 1 :
23740 PyUnicode_Compare(**argname, key);
23741 if (cmp < 0 && unlikely(PyErr_Occurred()))
goto bad;
23742 if (cmp == 0)
goto arg_passed_twice;
23747 goto invalid_keyword_type;
23749 if (unlikely(PyDict_SetItem(kwds2, key, value)))
goto bad;
23751 goto invalid_keyword;
23756 __Pyx_RaiseDoubleKeywordsError(function_name, key);
23758 invalid_keyword_type:
23759 PyErr_Format(PyExc_TypeError,
23760 "%.200s() keywords must be strings", function_name);
23763 PyErr_Format(PyExc_TypeError,
23764 #
if PY_MAJOR_VERSION < 3
23765 "%.200s() got an unexpected keyword argument '%.200s'",
23766 function_name, PyString_AsString(key));
23768 "%s() got an unexpected keyword argument '%U'",
23769 function_name, key);
23776 #if CYTHON_USE_TYPE_SLOTS
23777 static CYTHON_INLINE
int __Pyx_PyObject_SetAttrStr(PyObject* obj, PyObject* attr_name, PyObject* value) {
23778 PyTypeObject* tp = Py_TYPE(obj);
23779 if (likely(tp->tp_setattro))
23780 return tp->tp_setattro(obj, attr_name, value);
23781 #if PY_MAJOR_VERSION < 3
23782 if (likely(tp->tp_setattr))
23783 return tp->tp_setattr(obj, PyString_AS_STRING(attr_name), value);
23785 return PyObject_SetAttr(obj, attr_name, value);
23790 #if CYTHON_FAST_PYCCALL
23791 static CYTHON_INLINE PyObject * __Pyx_PyCFunction_FastCall(PyObject *func_obj, PyObject **args, Py_ssize_t nargs) {
23792 PyCFunctionObject *func = (PyCFunctionObject*)func_obj;
23793 PyCFunction meth = PyCFunction_GET_FUNCTION(func);
23794 PyObject *
self = PyCFunction_GET_SELF(func);
23795 int flags = PyCFunction_GET_FLAGS(func);
23796 assert(PyCFunction_Check(func));
23797 assert(METH_FASTCALL == (flags & ~(METH_CLASS | METH_STATIC | METH_COEXIST | METH_KEYWORDS | METH_STACKLESS)));
23798 assert(nargs >= 0);
23799 assert(nargs == 0 || args != NULL);
23803 assert(!PyErr_Occurred());
23804 if ((PY_VERSION_HEX < 0x030700A0) || unlikely(flags & METH_KEYWORDS)) {
23805 return (*((__Pyx_PyCFunctionFastWithKeywords)(
void*)meth)) (
self, args, nargs, NULL);
23807 return (*((__Pyx_PyCFunctionFast)(
void*)meth)) (
self, args, nargs);
23813 #if CYTHON_FAST_PYCALL
23814 static PyObject* __Pyx_PyFunction_FastCallNoKw(PyCodeObject *co, PyObject **args, Py_ssize_t na,
23815 PyObject *globals) {
23817 PyThreadState *tstate = __Pyx_PyThreadState_Current;
23818 PyObject **fastlocals;
23821 assert(globals != NULL);
23826 assert(tstate != NULL);
23827 f = PyFrame_New(tstate, co, globals, NULL);
23831 fastlocals = __Pyx_PyFrame_GetLocalsplus(
f);
23832 for (i = 0; i < na; i++) {
23834 fastlocals[i] = *args++;
23836 result = PyEval_EvalFrameEx(
f,0);
23837 ++tstate->recursion_depth;
23839 --tstate->recursion_depth;
23842 #if 1 || PY_VERSION_HEX < 0x030600B1
23843 static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args, Py_ssize_t nargs, PyObject *kwargs) {
23844 PyCodeObject *co = (PyCodeObject *)PyFunction_GET_CODE(func);
23845 PyObject *globals = PyFunction_GET_GLOBALS(func);
23846 PyObject *argdefs = PyFunction_GET_DEFAULTS(func);
23848 #if PY_MAJOR_VERSION >= 3
23851 PyObject *kwtuple, **k;
23856 assert(kwargs == NULL || PyDict_Check(kwargs));
23857 nk = kwargs ? PyDict_Size(kwargs) : 0;
23858 if (Py_EnterRecursiveCall((
char*)
" while calling a Python object")) {
23862 #
if PY_MAJOR_VERSION >= 3
23863 co->co_kwonlyargcount == 0 &&
23865 likely(kwargs == NULL || nk == 0) &&
23866 co->co_flags == (CO_OPTIMIZED | CO_NEWLOCALS | CO_NOFREE)) {
23867 if (argdefs == NULL && co->co_argcount == nargs) {
23868 result = __Pyx_PyFunction_FastCallNoKw(co, args, nargs, globals);
23871 else if (nargs == 0 && argdefs != NULL
23872 && co->co_argcount == Py_SIZE(argdefs)) {
23875 args = &PyTuple_GET_ITEM(argdefs, 0);
23876 result =__Pyx_PyFunction_FastCallNoKw(co, args, Py_SIZE(argdefs), globals);
23880 if (kwargs != NULL) {
23882 kwtuple = PyTuple_New(2 * nk);
23883 if (kwtuple == NULL) {
23887 k = &PyTuple_GET_ITEM(kwtuple, 0);
23889 while (PyDict_Next(kwargs, &
pos, &k[i], &k[i+1])) {
23900 closure = PyFunction_GET_CLOSURE(func);
23901 #if PY_MAJOR_VERSION >= 3
23902 kwdefs = PyFunction_GET_KW_DEFAULTS(func);
23904 if (argdefs != NULL) {
23905 d = &PyTuple_GET_ITEM(argdefs, 0);
23906 nd = Py_SIZE(argdefs);
23912 #if PY_MAJOR_VERSION >= 3
23913 result = PyEval_EvalCodeEx((PyObject*)co, globals, (PyObject *)NULL,
23916 d, (
int)nd, kwdefs, closure);
23918 result = PyEval_EvalCodeEx(co, globals, (PyObject *)NULL,
23921 d, (
int)nd, closure);
23923 Py_XDECREF(kwtuple);
23925 Py_LeaveRecursiveCall();
23932 #if CYTHON_COMPILING_IN_CPYTHON
23933 static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw) {
23935 ternaryfunc call = Py_TYPE(func)->tp_call;
23936 if (unlikely(!call))
23937 return PyObject_Call(func, arg, kw);
23938 if (unlikely(Py_EnterRecursiveCall((
char*)
" while calling a Python object")))
23940 result = (*call)(func, arg, kw);
23941 Py_LeaveRecursiveCall();
23942 if (unlikely(!result) && unlikely(!PyErr_Occurred())) {
23945 "NULL result without error in PyObject_Call");
23952 #if CYTHON_COMPILING_IN_CPYTHON
23953 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg) {
23954 PyObject *
self, *result;
23956 cfunc = PyCFunction_GET_FUNCTION(func);
23957 self = PyCFunction_GET_SELF(func);
23958 if (unlikely(Py_EnterRecursiveCall((
char*)
" while calling a Python object")))
23960 result = cfunc(
self, arg);
23961 Py_LeaveRecursiveCall();
23962 if (unlikely(!result) && unlikely(!PyErr_Occurred())) {
23965 "NULL result without error in PyObject_Call");
23972 #if CYTHON_COMPILING_IN_CPYTHON
23973 static PyObject* __Pyx__PyObject_CallOneArg(PyObject *func, PyObject *arg) {
23975 PyObject *args = PyTuple_New(1);
23976 if (unlikely(!args))
return NULL;
23978 PyTuple_SET_ITEM(args, 0, arg);
23979 result = __Pyx_PyObject_Call(func, args, NULL);
23983 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg) {
23984 #if CYTHON_FAST_PYCALL
23985 if (PyFunction_Check(func)) {
23986 return __Pyx_PyFunction_FastCall(func, &arg, 1);
23989 if (likely(PyCFunction_Check(func))) {
23990 if (likely(PyCFunction_GET_FLAGS(func) & METH_O)) {
23991 return __Pyx_PyObject_CallMethO(func, arg);
23992 #if CYTHON_FAST_PYCCALL
23993 }
else if (__Pyx_PyFastCFunction_Check(func)) {
23994 return __Pyx_PyCFunction_FastCall(func, &arg, 1);
23998 return __Pyx__PyObject_CallOneArg(func, arg);
24001 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg) {
24003 PyObject *args = PyTuple_Pack(1, arg);
24004 if (unlikely(!args))
return NULL;
24005 result = __Pyx_PyObject_Call(func, args, NULL);
24012 static int __Pyx__ArgTypeTest(PyObject *obj, PyTypeObject *type,
const char *name,
int exact)
24014 if (unlikely(!type)) {
24015 PyErr_SetString(PyExc_SystemError,
"Missing type object");
24019 #if PY_MAJOR_VERSION == 2
24020 if ((type == &PyBaseString_Type) && likely(__Pyx_PyBaseString_CheckExact(obj)))
return 1;
24024 if (likely(__Pyx_TypeCheck(obj, type)))
return 1;
24026 PyErr_Format(PyExc_TypeError,
24027 "Argument '%.200s' has incorrect type (expected %.200s, got %.200s)",
24028 name, type->tp_name, Py_TYPE(obj)->tp_name);
24033 #if CYTHON_FAST_THREAD_STATE
24034 static CYTHON_INLINE
void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb) {
24035 PyObject *tmp_type, *tmp_value, *tmp_tb;
24036 tmp_type = tstate->curexc_type;
24037 tmp_value = tstate->curexc_value;
24038 tmp_tb = tstate->curexc_traceback;
24039 tstate->curexc_type = type;
24040 tstate->curexc_value = value;
24041 tstate->curexc_traceback = tb;
24042 Py_XDECREF(tmp_type);
24043 Py_XDECREF(tmp_value);
24044 Py_XDECREF(tmp_tb);
24046 static CYTHON_INLINE
void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) {
24047 *type = tstate->curexc_type;
24048 *value = tstate->curexc_value;
24049 *tb = tstate->curexc_traceback;
24050 tstate->curexc_type = 0;
24051 tstate->curexc_value = 0;
24052 tstate->curexc_traceback = 0;
24057 #if PY_MAJOR_VERSION < 3
24058 static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb,
24059 CYTHON_UNUSED PyObject *cause) {
24060 __Pyx_PyThreadState_declare
24062 if (!value || value == Py_None)
24066 if (!tb || tb == Py_None)
24070 if (!PyTraceBack_Check(tb)) {
24071 PyErr_SetString(PyExc_TypeError,
24072 "raise: arg 3 must be a traceback or None");
24076 if (PyType_Check(type)) {
24077 #if CYTHON_COMPILING_IN_PYPY
24079 Py_INCREF(Py_None);
24083 PyErr_NormalizeException(&type, &value, &tb);
24086 PyErr_SetString(PyExc_TypeError,
24087 "instance exception may not have a separate value");
24091 type = (PyObject*) Py_TYPE(type);
24093 if (!PyType_IsSubtype((PyTypeObject *)type, (PyTypeObject *)PyExc_BaseException)) {
24094 PyErr_SetString(PyExc_TypeError,
24095 "raise: exception class must be a subclass of BaseException");
24099 __Pyx_PyThreadState_assign
24100 __Pyx_ErrRestore(type, value, tb);
24109 static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause) {
24110 PyObject* owned_instance = NULL;
24111 if (tb == Py_None) {
24113 }
else if (tb && !PyTraceBack_Check(tb)) {
24114 PyErr_SetString(PyExc_TypeError,
24115 "raise: arg 3 must be a traceback or None");
24118 if (value == Py_None)
24120 if (PyExceptionInstance_Check(type)) {
24122 PyErr_SetString(PyExc_TypeError,
24123 "instance exception may not have a separate value");
24127 type = (PyObject*) Py_TYPE(value);
24128 }
else if (PyExceptionClass_Check(type)) {
24129 PyObject *instance_class = NULL;
24130 if (value && PyExceptionInstance_Check(value)) {
24131 instance_class = (PyObject*) Py_TYPE(value);
24132 if (instance_class != type) {
24133 int is_subclass = PyObject_IsSubclass(instance_class, type);
24134 if (!is_subclass) {
24135 instance_class = NULL;
24136 }
else if (unlikely(is_subclass == -1)) {
24139 type = instance_class;
24143 if (!instance_class) {
24146 args = PyTuple_New(0);
24147 else if (PyTuple_Check(value)) {
24151 args = PyTuple_Pack(1, value);
24154 owned_instance = PyObject_Call(type, args, NULL);
24156 if (!owned_instance)
24158 value = owned_instance;
24159 if (!PyExceptionInstance_Check(value)) {
24160 PyErr_Format(PyExc_TypeError,
24161 "calling %R should have returned an instance of "
24162 "BaseException, not %R",
24163 type, Py_TYPE(value));
24168 PyErr_SetString(PyExc_TypeError,
24169 "raise: exception class must be a subclass of BaseException");
24173 PyObject *fixed_cause;
24174 if (cause == Py_None) {
24175 fixed_cause = NULL;
24176 }
else if (PyExceptionClass_Check(cause)) {
24177 fixed_cause = PyObject_CallObject(cause, NULL);
24178 if (fixed_cause == NULL)
24180 }
else if (PyExceptionInstance_Check(cause)) {
24181 fixed_cause = cause;
24182 Py_INCREF(fixed_cause);
24184 PyErr_SetString(PyExc_TypeError,
24185 "exception causes must derive from "
24189 PyException_SetCause(value, fixed_cause);
24191 PyErr_SetObject(type, value);
24193 #if CYTHON_COMPILING_IN_PYPY
24194 PyObject *tmp_type, *tmp_value, *tmp_tb;
24195 PyErr_Fetch(&tmp_type, &tmp_value, &tmp_tb);
24197 PyErr_Restore(tmp_type, tmp_value, tb);
24198 Py_XDECREF(tmp_tb);
24200 PyThreadState *tstate = __Pyx_PyThreadState_Current;
24201 PyObject* tmp_tb = tstate->curexc_traceback;
24202 if (tb != tmp_tb) {
24204 tstate->curexc_traceback = tb;
24205 Py_XDECREF(tmp_tb);
24210 Py_XDECREF(owned_instance);
24216 static CYTHON_INLINE
int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type) {
24217 if (unlikely(!type)) {
24218 PyErr_SetString(PyExc_SystemError,
"Missing type object");
24221 if (likely(__Pyx_TypeCheck(obj, type)))
24223 PyErr_Format(PyExc_TypeError,
"Cannot convert %.200s to %.200s",
24224 Py_TYPE(obj)->tp_name, type->tp_name);
24230 __Pyx_init_memviewslice(
struct __pyx_memoryview_obj *memview,
24232 __Pyx_memviewslice *memviewslice,
24233 int memview_is_new_reference)
24235 __Pyx_RefNannyDeclarations
24237 Py_buffer *buf = &memview->view;
24238 __Pyx_RefNannySetupContext(
"init_memviewslice", 0);
24239 if (unlikely(memviewslice->memview || memviewslice->data)) {
24240 PyErr_SetString(PyExc_ValueError,
24241 "memviewslice is already initialized!");
24244 if (buf->strides) {
24245 for (i = 0; i < ndim; i++) {
24246 memviewslice->strides[i] = buf->strides[i];
24249 Py_ssize_t stride = buf->itemsize;
24250 for (i = ndim - 1; i >= 0; i--) {
24251 memviewslice->strides[i] = stride;
24252 stride *= buf->shape[i];
24255 for (i = 0; i < ndim; i++) {
24256 memviewslice->shape[i] = buf->shape[i];
24257 if (buf->suboffsets) {
24258 memviewslice->suboffsets[i] = buf->suboffsets[i];
24260 memviewslice->suboffsets[i] = -1;
24263 memviewslice->memview = memview;
24264 memviewslice->data = (
char *)buf->buf;
24265 if (__pyx_add_acquisition_count(memview) == 0 && !memview_is_new_reference) {
24266 Py_INCREF(memview);
24271 memviewslice->memview = 0;
24272 memviewslice->data = 0;
24275 __Pyx_RefNannyFinishContext();
24278 #ifndef Py_NO_RETURN
24279 #define Py_NO_RETURN
24281 static void __pyx_fatalerror(
const char *fmt, ...) Py_NO_RETURN {
24284 #ifdef HAVE_STDARG_PROTOTYPES
24285 va_start(vargs, fmt);
24289 vsnprintf(msg, 200, fmt, vargs);
24291 Py_FatalError(msg);
24293 static CYTHON_INLINE
int
24294 __pyx_add_acquisition_count_locked(__pyx_atomic_int *acquisition_count,
24295 PyThread_type_lock lock)
24298 PyThread_acquire_lock(lock, 1);
24299 result = (*acquisition_count)++;
24300 PyThread_release_lock(lock);
24303 static CYTHON_INLINE
int
24304 __pyx_sub_acquisition_count_locked(__pyx_atomic_int *acquisition_count,
24305 PyThread_type_lock lock)
24308 PyThread_acquire_lock(lock, 1);
24309 result = (*acquisition_count)--;
24310 PyThread_release_lock(lock);
24313 static CYTHON_INLINE
void
24314 __Pyx_INC_MEMVIEW(__Pyx_memviewslice *memslice,
int have_gil,
int lineno)
24317 struct __pyx_memoryview_obj *memview = memslice->memview;
24318 if (unlikely(!memview || (PyObject *) memview == Py_None))
24320 if (unlikely(__pyx_get_slice_count(memview) < 0))
24321 __pyx_fatalerror(
"Acquisition count is %d (line %d)",
24322 __pyx_get_slice_count(memview), lineno);
24323 first_time = __pyx_add_acquisition_count(memview) == 0;
24324 if (unlikely(first_time)) {
24326 Py_INCREF((PyObject *) memview);
24328 PyGILState_STATE _gilstate = PyGILState_Ensure();
24329 Py_INCREF((PyObject *) memview);
24330 PyGILState_Release(_gilstate);
24334 static CYTHON_INLINE
void __Pyx_XDEC_MEMVIEW(__Pyx_memviewslice *memslice,
24335 int have_gil,
int lineno) {
24337 struct __pyx_memoryview_obj *memview = memslice->memview;
24338 if (unlikely(!memview || (PyObject *) memview == Py_None)) {
24339 memslice->memview = NULL;
24342 if (unlikely(__pyx_get_slice_count(memview) <= 0))
24343 __pyx_fatalerror(
"Acquisition count is %d (line %d)",
24344 __pyx_get_slice_count(memview), lineno);
24345 last_time = __pyx_sub_acquisition_count(memview) == 1;
24346 memslice->data = NULL;
24347 if (unlikely(last_time)) {
24349 Py_CLEAR(memslice->memview);
24351 PyGILState_STATE _gilstate = PyGILState_Ensure();
24352 Py_CLEAR(memslice->memview);
24353 PyGILState_Release(_gilstate);
24356 memslice->memview = NULL;
24361 static void __Pyx_RaiseBufferIndexError(
int axis) {
24362 PyErr_Format(PyExc_IndexError,
24363 "Out of bounds on buffer access (axis %d)", axis);
24367 static void __Pyx_WriteUnraisable(
const char *name, CYTHON_UNUSED
int clineno,
24368 CYTHON_UNUSED
int lineno, CYTHON_UNUSED
const char *filename,
24369 int full_traceback, CYTHON_UNUSED
int nogil) {
24370 PyObject *old_exc, *old_val, *old_tb;
24372 __Pyx_PyThreadState_declare
24374 PyGILState_STATE state;
24376 state = PyGILState_Ensure();
24378 else state = (PyGILState_STATE)-1;
24381 __Pyx_PyThreadState_assign
24382 __Pyx_ErrFetch(&old_exc, &old_val, &old_tb);
24383 if (full_traceback) {
24384 Py_XINCREF(old_exc);
24385 Py_XINCREF(old_val);
24386 Py_XINCREF(old_tb);
24387 __Pyx_ErrRestore(old_exc, old_val, old_tb);
24390 #if PY_MAJOR_VERSION < 3
24391 ctx = PyString_FromString(name);
24393 ctx = PyUnicode_FromString(name);
24395 __Pyx_ErrRestore(old_exc, old_val, old_tb);
24397 PyErr_WriteUnraisable(Py_None);
24399 PyErr_WriteUnraisable(ctx);
24404 PyGILState_Release(state);
24409 #if CYTHON_USE_EXC_INFO_STACK
24410 static _PyErr_StackItem *
24411 __Pyx_PyErr_GetTopmostException(PyThreadState *tstate)
24413 _PyErr_StackItem *exc_info = tstate->exc_info;
24414 while ((exc_info->exc_type == NULL || exc_info->exc_type == Py_None) &&
24415 exc_info->previous_item != NULL)
24417 exc_info = exc_info->previous_item;
24424 #if CYTHON_FAST_THREAD_STATE
24425 static CYTHON_INLINE
void __Pyx__ExceptionSave(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) {
24426 #if CYTHON_USE_EXC_INFO_STACK
24427 _PyErr_StackItem *exc_info = __Pyx_PyErr_GetTopmostException(tstate);
24428 *type = exc_info->exc_type;
24429 *value = exc_info->exc_value;
24430 *tb = exc_info->exc_traceback;
24432 *type = tstate->exc_type;
24433 *value = tstate->exc_value;
24434 *tb = tstate->exc_traceback;
24437 Py_XINCREF(*value);
24440 static CYTHON_INLINE
void __Pyx__ExceptionReset(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb) {
24441 PyObject *tmp_type, *tmp_value, *tmp_tb;
24442 #if CYTHON_USE_EXC_INFO_STACK
24443 _PyErr_StackItem *exc_info = tstate->exc_info;
24444 tmp_type = exc_info->exc_type;
24445 tmp_value = exc_info->exc_value;
24446 tmp_tb = exc_info->exc_traceback;
24447 exc_info->exc_type = type;
24448 exc_info->exc_value = value;
24449 exc_info->exc_traceback = tb;
24451 tmp_type = tstate->exc_type;
24452 tmp_value = tstate->exc_value;
24453 tmp_tb = tstate->exc_traceback;
24454 tstate->exc_type = type;
24455 tstate->exc_value = value;
24456 tstate->exc_traceback = tb;
24458 Py_XDECREF(tmp_type);
24459 Py_XDECREF(tmp_value);
24460 Py_XDECREF(tmp_tb);
24465 #if CYTHON_FAST_THREAD_STATE
24466 static int __Pyx_PyErr_ExceptionMatchesTuple(PyObject *exc_type, PyObject *tuple) {
24468 n = PyTuple_GET_SIZE(tuple);
24469 #if PY_MAJOR_VERSION >= 3
24470 for (i=0; i<
n; i++) {
24471 if (exc_type == PyTuple_GET_ITEM(tuple, i))
return 1;
24474 for (i=0; i<
n; i++) {
24475 if (__Pyx_PyErr_GivenExceptionMatches(exc_type, PyTuple_GET_ITEM(tuple, i)))
return 1;
24479 static CYTHON_INLINE
int __Pyx_PyErr_ExceptionMatchesInState(PyThreadState* tstate, PyObject* err) {
24480 PyObject *exc_type = tstate->curexc_type;
24481 if (exc_type == err)
return 1;
24482 if (unlikely(!exc_type))
return 0;
24483 if (unlikely(PyTuple_Check(err)))
24484 return __Pyx_PyErr_ExceptionMatchesTuple(exc_type, err);
24485 return __Pyx_PyErr_GivenExceptionMatches(exc_type, err);
24490 #if CYTHON_FAST_THREAD_STATE
24491 static int __Pyx__GetException(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb)
24493 static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb)
24496 PyObject *local_type, *local_value, *local_tb;
24497 #if CYTHON_FAST_THREAD_STATE
24498 PyObject *tmp_type, *tmp_value, *tmp_tb;
24499 local_type = tstate->curexc_type;
24500 local_value = tstate->curexc_value;
24501 local_tb = tstate->curexc_traceback;
24502 tstate->curexc_type = 0;
24503 tstate->curexc_value = 0;
24504 tstate->curexc_traceback = 0;
24506 PyErr_Fetch(&local_type, &local_value, &local_tb);
24508 PyErr_NormalizeException(&local_type, &local_value, &local_tb);
24509 #if CYTHON_FAST_THREAD_STATE
24510 if (unlikely(tstate->curexc_type))
24512 if (unlikely(PyErr_Occurred()))
24515 #if PY_MAJOR_VERSION >= 3
24517 if (unlikely(PyException_SetTraceback(local_value, local_tb) < 0))
24521 Py_XINCREF(local_tb);
24522 Py_XINCREF(local_type);
24523 Py_XINCREF(local_value);
24524 *type = local_type;
24525 *value = local_value;
24527 #if CYTHON_FAST_THREAD_STATE
24528 #if CYTHON_USE_EXC_INFO_STACK
24530 _PyErr_StackItem *exc_info = tstate->exc_info;
24531 tmp_type = exc_info->exc_type;
24532 tmp_value = exc_info->exc_value;
24533 tmp_tb = exc_info->exc_traceback;
24534 exc_info->exc_type = local_type;
24535 exc_info->exc_value = local_value;
24536 exc_info->exc_traceback = local_tb;
24539 tmp_type = tstate->exc_type;
24540 tmp_value = tstate->exc_value;
24541 tmp_tb = tstate->exc_traceback;
24542 tstate->exc_type = local_type;
24543 tstate->exc_value = local_value;
24544 tstate->exc_traceback = local_tb;
24546 Py_XDECREF(tmp_type);
24547 Py_XDECREF(tmp_value);
24548 Py_XDECREF(tmp_tb);
24550 PyErr_SetExcInfo(local_type, local_value, local_tb);
24557 Py_XDECREF(local_type);
24558 Py_XDECREF(local_value);
24559 Py_XDECREF(local_tb);
24564 static CYTHON_UNUSED PyObject* __Pyx_PyObject_Call2Args(PyObject*
function, PyObject* arg1, PyObject* arg2) {
24565 PyObject *args, *result = NULL;
24566 #if CYTHON_FAST_PYCALL
24567 if (PyFunction_Check(
function)) {
24568 PyObject *args[2] = {arg1, arg2};
24569 return __Pyx_PyFunction_FastCall(
function, args, 2);
24572 #if CYTHON_FAST_PYCCALL
24573 if (__Pyx_PyFastCFunction_Check(
function)) {
24574 PyObject *args[2] = {arg1, arg2};
24575 return __Pyx_PyCFunction_FastCall(
function, args, 2);
24578 args = PyTuple_New(2);
24579 if (unlikely(!args))
goto done;
24581 PyTuple_SET_ITEM(args, 0, arg1);
24583 PyTuple_SET_ITEM(args, 1, arg2);
24584 Py_INCREF(
function);
24585 result = __Pyx_PyObject_Call(
function, args, NULL);
24587 Py_DECREF(
function);
24593 static CYTHON_INLINE
int __Pyx_PyBytes_Equals(PyObject* s1, PyObject* s2,
int equals) {
24594 #if CYTHON_COMPILING_IN_PYPY
24595 return PyObject_RichCompareBool(s1, s2, equals);
24598 return (equals == Py_EQ);
24599 }
else if (PyBytes_CheckExact(s1) & PyBytes_CheckExact(s2)) {
24600 const char *ps1, *ps2;
24601 Py_ssize_t length = PyBytes_GET_SIZE(s1);
24602 if (length != PyBytes_GET_SIZE(s2))
24603 return (equals == Py_NE);
24604 ps1 = PyBytes_AS_STRING(s1);
24605 ps2 = PyBytes_AS_STRING(s2);
24606 if (ps1[0] != ps2[0]) {
24607 return (equals == Py_NE);
24608 }
else if (length == 1) {
24609 return (equals == Py_EQ);
24612 #if CYTHON_USE_UNICODE_INTERNALS && (PY_VERSION_HEX < 0x030B0000)
24613 Py_hash_t hash1, hash2;
24614 hash1 = ((PyBytesObject*)s1)->ob_shash;
24615 hash2 = ((PyBytesObject*)s2)->ob_shash;
24616 if (hash1 != hash2 && hash1 != -1 && hash2 != -1) {
24617 return (equals == Py_NE);
24620 result = memcmp(ps1, ps2, (
size_t)length);
24621 return (equals == Py_EQ) ? (result == 0) : (result != 0);
24623 }
else if ((s1 == Py_None) & PyBytes_CheckExact(s2)) {
24624 return (equals == Py_NE);
24625 }
else if ((s2 == Py_None) & PyBytes_CheckExact(s1)) {
24626 return (equals == Py_NE);
24629 PyObject* py_result = PyObject_RichCompare(s1, s2, equals);
24632 result = __Pyx_PyObject_IsTrue(py_result);
24633 Py_DECREF(py_result);
24640 static CYTHON_INLINE
int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2,
int equals) {
24641 #if CYTHON_COMPILING_IN_PYPY
24642 return PyObject_RichCompareBool(s1, s2, equals);
24644 #if PY_MAJOR_VERSION < 3
24645 PyObject* owned_ref = NULL;
24647 int s1_is_unicode, s2_is_unicode;
24651 s1_is_unicode = PyUnicode_CheckExact(s1);
24652 s2_is_unicode = PyUnicode_CheckExact(s2);
24653 #if PY_MAJOR_VERSION < 3
24654 if ((s1_is_unicode & (!s2_is_unicode)) && PyString_CheckExact(s2)) {
24655 owned_ref = PyUnicode_FromObject(s2);
24656 if (unlikely(!owned_ref))
24660 }
else if ((s2_is_unicode & (!s1_is_unicode)) && PyString_CheckExact(s1)) {
24661 owned_ref = PyUnicode_FromObject(s1);
24662 if (unlikely(!owned_ref))
24666 }
else if (((!s2_is_unicode) & (!s1_is_unicode))) {
24667 return __Pyx_PyBytes_Equals(s1, s2, equals);
24670 if (s1_is_unicode & s2_is_unicode) {
24673 void *data1, *data2;
24674 if (unlikely(__Pyx_PyUnicode_READY(s1) < 0) || unlikely(__Pyx_PyUnicode_READY(s2) < 0))
24676 length = __Pyx_PyUnicode_GET_LENGTH(s1);
24677 if (length != __Pyx_PyUnicode_GET_LENGTH(s2)) {
24680 #if CYTHON_USE_UNICODE_INTERNALS
24682 Py_hash_t hash1, hash2;
24683 #if CYTHON_PEP393_ENABLED
24684 hash1 = ((PyASCIIObject*)s1)->hash;
24685 hash2 = ((PyASCIIObject*)s2)->hash;
24687 hash1 = ((PyUnicodeObject*)s1)->hash;
24688 hash2 = ((PyUnicodeObject*)s2)->hash;
24690 if (hash1 != hash2 && hash1 != -1 && hash2 != -1) {
24695 kind = __Pyx_PyUnicode_KIND(s1);
24696 if (kind != __Pyx_PyUnicode_KIND(s2)) {
24699 data1 = __Pyx_PyUnicode_DATA(s1);
24700 data2 = __Pyx_PyUnicode_DATA(s2);
24701 if (__Pyx_PyUnicode_READ(kind, data1, 0) != __Pyx_PyUnicode_READ(kind, data2, 0)) {
24703 }
else if (length == 1) {
24706 int result = memcmp(data1, data2, (
size_t)(length * kind));
24707 #if PY_MAJOR_VERSION < 3
24708 Py_XDECREF(owned_ref);
24710 return (equals == Py_EQ) ? (result == 0) : (result != 0);
24712 }
else if ((s1 == Py_None) & s2_is_unicode) {
24714 }
else if ((s2 == Py_None) & s1_is_unicode) {
24718 PyObject* py_result = PyObject_RichCompare(s1, s2, equals);
24719 #if PY_MAJOR_VERSION < 3
24720 Py_XDECREF(owned_ref);
24724 result = __Pyx_PyObject_IsTrue(py_result);
24725 Py_DECREF(py_result);
24729 #if PY_MAJOR_VERSION < 3
24730 Py_XDECREF(owned_ref);
24732 return (equals == Py_EQ);
24734 #if PY_MAJOR_VERSION < 3
24735 Py_XDECREF(owned_ref);
24737 return (equals == Py_NE);
24742 static CYTHON_INLINE Py_ssize_t __Pyx_div_Py_ssize_t(Py_ssize_t a, Py_ssize_t b) {
24743 Py_ssize_t
q = a / b;
24744 Py_ssize_t
r = a -
q*b;
24745 q -= ((
r != 0) & ((
r ^ b) < 0));
24750 static CYTHON_INLINE PyObject *__Pyx_GetAttr(PyObject *o, PyObject *
n) {
24751 #if CYTHON_USE_TYPE_SLOTS
24752 #if PY_MAJOR_VERSION >= 3
24753 if (likely(PyUnicode_Check(
n)))
24755 if (likely(PyString_Check(
n)))
24757 return __Pyx_PyObject_GetAttrStr(o,
n);
24759 return PyObject_GetAttr(o,
n);
24763 static PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j) {
24765 if (!j)
return NULL;
24766 r = PyObject_GetItem(o, j);
24770 static CYTHON_INLINE PyObject *__Pyx_GetItemInt_List_Fast(PyObject *o, Py_ssize_t i,
24771 CYTHON_NCP_UNUSED
int wraparound,
24772 CYTHON_NCP_UNUSED
int boundscheck) {
24773 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
24774 Py_ssize_t wrapped_i = i;
24775 if (wraparound & unlikely(i < 0)) {
24776 wrapped_i += PyList_GET_SIZE(o);
24778 if ((!boundscheck) || likely(__Pyx_is_valid_index(wrapped_i, PyList_GET_SIZE(o)))) {
24779 PyObject *
r = PyList_GET_ITEM(o, wrapped_i);
24783 return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i));
24785 return PySequence_GetItem(o, i);
24788 static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize_t i,
24789 CYTHON_NCP_UNUSED
int wraparound,
24790 CYTHON_NCP_UNUSED
int boundscheck) {
24791 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
24792 Py_ssize_t wrapped_i = i;
24793 if (wraparound & unlikely(i < 0)) {
24794 wrapped_i += PyTuple_GET_SIZE(o);
24796 if ((!boundscheck) || likely(__Pyx_is_valid_index(wrapped_i, PyTuple_GET_SIZE(o)))) {
24797 PyObject *
r = PyTuple_GET_ITEM(o, wrapped_i);
24801 return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i));
24803 return PySequence_GetItem(o, i);
24806 static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i,
int is_list,
24807 CYTHON_NCP_UNUSED
int wraparound,
24808 CYTHON_NCP_UNUSED
int boundscheck) {
24809 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS && CYTHON_USE_TYPE_SLOTS
24810 if (is_list || PyList_CheckExact(o)) {
24811 Py_ssize_t
n = ((!wraparound) | likely(i >= 0)) ? i : i + PyList_GET_SIZE(o);
24812 if ((!boundscheck) || (likely(__Pyx_is_valid_index(
n, PyList_GET_SIZE(o))))) {
24813 PyObject *
r = PyList_GET_ITEM(o,
n);
24818 else if (PyTuple_CheckExact(o)) {
24819 Py_ssize_t
n = ((!wraparound) | likely(i >= 0)) ? i : i + PyTuple_GET_SIZE(o);
24820 if ((!boundscheck) || likely(__Pyx_is_valid_index(
n, PyTuple_GET_SIZE(o)))) {
24821 PyObject *
r = PyTuple_GET_ITEM(o,
n);
24826 PySequenceMethods *m = Py_TYPE(o)->tp_as_sequence;
24827 if (likely(m && m->sq_item)) {
24828 if (wraparound && unlikely(i < 0) && likely(m->sq_length)) {
24829 Py_ssize_t l = m->sq_length(o);
24830 if (likely(l >= 0)) {
24833 if (!PyErr_ExceptionMatches(PyExc_OverflowError))
24838 return m->sq_item(o, i);
24842 if (is_list || PySequence_Check(o)) {
24843 return PySequence_GetItem(o, i);
24846 return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i));
24850 #if CYTHON_USE_TYPE_SLOTS
24851 static PyObject *__Pyx_PyObject_GetIndex(PyObject *obj, PyObject* index) {
24853 Py_ssize_t key_value;
24854 PySequenceMethods *m = Py_TYPE(obj)->tp_as_sequence;
24855 if (unlikely(!(m && m->sq_item))) {
24856 PyErr_Format(PyExc_TypeError,
"'%.200s' object is not subscriptable", Py_TYPE(obj)->tp_name);
24859 key_value = __Pyx_PyIndex_AsSsize_t(index);
24860 if (likely(key_value != -1 || !(runerr = PyErr_Occurred()))) {
24861 return __Pyx_GetItemInt_Fast(obj, key_value, 0, 1, 1);
24863 if (PyErr_GivenExceptionMatches(runerr, PyExc_OverflowError)) {
24865 PyErr_Format(PyExc_IndexError,
"cannot fit '%.200s' into an index-sized integer", Py_TYPE(index)->tp_name);
24869 static PyObject *__Pyx_PyObject_GetItem(PyObject *obj, PyObject* key) {
24870 PyMappingMethods *m = Py_TYPE(obj)->tp_as_mapping;
24871 if (likely(m && m->mp_subscript)) {
24872 return m->mp_subscript(obj, key);
24874 return __Pyx_PyObject_GetIndex(obj, key);
24879 static CYTHON_INLINE PyObject* __Pyx_decode_c_string(
24880 const char* cstring, Py_ssize_t start, Py_ssize_t stop,
24881 const char* encoding,
const char* errors,
24882 PyObject* (*decode_func)(
const char *
s, Py_ssize_t size,
const char *errors)) {
24884 if (unlikely((start < 0) | (stop < 0))) {
24885 size_t slen = strlen(cstring);
24886 if (unlikely(slen > (
size_t) PY_SSIZE_T_MAX)) {
24887 PyErr_SetString(PyExc_OverflowError,
24888 "c-string too long to convert to Python");
24891 length = (Py_ssize_t) slen;
24900 if (unlikely(stop <= start))
24901 return __Pyx_NewRef(__pyx_empty_unicode);
24902 length = stop - start;
24905 return decode_func(cstring, length, errors);
24907 return PyUnicode_Decode(cstring, length, encoding, errors);
24912 static PyObject *__Pyx_GetAttr3Default(PyObject *d) {
24913 __Pyx_PyThreadState_declare
24914 __Pyx_PyThreadState_assign
24915 if (unlikely(!__Pyx_PyErr_ExceptionMatches(PyExc_AttributeError)))
24917 __Pyx_PyErr_Clear();
24921 static CYTHON_INLINE PyObject *__Pyx_GetAttr3(PyObject *o, PyObject *
n, PyObject *d) {
24922 PyObject *
r = __Pyx_GetAttr(o,
n);
24923 return (likely(
r)) ?
r : __Pyx_GetAttr3Default(d);
24927 #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_TYPE_SLOTS
24928 static CYTHON_INLINE PY_UINT64_T __Pyx_get_tp_dict_version(PyObject *obj) {
24929 PyObject *dict = Py_TYPE(obj)->tp_dict;
24930 return likely(dict) ? __PYX_GET_DICT_VERSION(dict) : 0;
24932 static CYTHON_INLINE PY_UINT64_T __Pyx_get_object_dict_version(PyObject *obj) {
24933 PyObject **dictptr = NULL;
24934 Py_ssize_t offset = Py_TYPE(obj)->tp_dictoffset;
24936 #if CYTHON_COMPILING_IN_CPYTHON
24937 dictptr = (likely(offset > 0)) ? (PyObject **) ((
char *)obj + offset) : _PyObject_GetDictPtr(obj);
24939 dictptr = _PyObject_GetDictPtr(obj);
24942 return (dictptr && *dictptr) ? __PYX_GET_DICT_VERSION(*dictptr) : 0;
24944 static CYTHON_INLINE
int __Pyx_object_dict_version_matches(PyObject* obj, PY_UINT64_T tp_dict_version, PY_UINT64_T obj_dict_version) {
24945 PyObject *dict = Py_TYPE(obj)->tp_dict;
24946 if (unlikely(!dict) || unlikely(tp_dict_version != __PYX_GET_DICT_VERSION(dict)))
24948 return obj_dict_version == __Pyx_get_object_dict_version(obj);
24953 #if CYTHON_USE_DICT_VERSIONS
24954 static PyObject *__Pyx__GetModuleGlobalName(PyObject *name, PY_UINT64_T *dict_version, PyObject **dict_cached_value)
24956 static CYTHON_INLINE PyObject *__Pyx__GetModuleGlobalName(PyObject *name)
24960 #if !CYTHON_AVOID_BORROWED_REFS
24961 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030500A1
24962 result = _PyDict_GetItem_KnownHash(__pyx_d, name, ((PyASCIIObject *) name)->hash);
24963 __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version)
24964 if (likely(result)) {
24965 return __Pyx_NewRef(result);
24966 }
else if (unlikely(PyErr_Occurred())) {
24970 result = PyDict_GetItem(__pyx_d, name);
24971 __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version)
24972 if (likely(result)) {
24973 return __Pyx_NewRef(result);
24977 result = PyObject_GetItem(__pyx_d, name);
24978 __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version)
24979 if (likely(result)) {
24980 return __Pyx_NewRef(result);
24984 return __Pyx_GetBuiltinName(name);
24988 static CYTHON_INLINE
void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected) {
24989 PyErr_Format(PyExc_ValueError,
24990 "too many values to unpack (expected %" CYTHON_FORMAT_SSIZE_T
"d)", expected);
24994 static CYTHON_INLINE
void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index) {
24995 PyErr_Format(PyExc_ValueError,
24996 "need more than %" CYTHON_FORMAT_SSIZE_T
"d value%.1s to unpack",
24997 index, (index == 1) ?
"" :
"s");
25001 static CYTHON_INLINE
void __Pyx_RaiseNoneNotIterableError(
void) {
25002 PyErr_SetString(PyExc_TypeError,
"'NoneType' object is not iterable");
25006 #if CYTHON_FAST_THREAD_STATE
25007 static CYTHON_INLINE
void __Pyx__ExceptionSwap(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) {
25008 PyObject *tmp_type, *tmp_value, *tmp_tb;
25009 #if CYTHON_USE_EXC_INFO_STACK
25010 _PyErr_StackItem *exc_info = tstate->exc_info;
25011 tmp_type = exc_info->exc_type;
25012 tmp_value = exc_info->exc_value;
25013 tmp_tb = exc_info->exc_traceback;
25014 exc_info->exc_type = *type;
25015 exc_info->exc_value = *value;
25016 exc_info->exc_traceback = *tb;
25018 tmp_type = tstate->exc_type;
25019 tmp_value = tstate->exc_value;
25020 tmp_tb = tstate->exc_traceback;
25021 tstate->exc_type = *type;
25022 tstate->exc_value = *value;
25023 tstate->exc_traceback = *tb;
25026 *value = tmp_value;
25030 static CYTHON_INLINE
void __Pyx_ExceptionSwap(PyObject **type, PyObject **value, PyObject **tb) {
25031 PyObject *tmp_type, *tmp_value, *tmp_tb;
25032 PyErr_GetExcInfo(&tmp_type, &tmp_value, &tmp_tb);
25033 PyErr_SetExcInfo(*type, *value, *tb);
25035 *value = tmp_value;
25041 static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list,
int level) {
25042 PyObject *empty_list = 0;
25043 PyObject *module = 0;
25044 PyObject *global_dict = 0;
25045 PyObject *empty_dict = 0;
25047 #if PY_MAJOR_VERSION < 3
25048 PyObject *py_import;
25049 py_import = __Pyx_PyObject_GetAttrStr(__pyx_b, __pyx_n_s_import);
25056 empty_list = PyList_New(0);
25061 global_dict = PyModule_GetDict(__pyx_m);
25064 empty_dict = PyDict_New();
25068 #if PY_MAJOR_VERSION >= 3
25070 if ((1) && (strchr(__Pyx_MODULE_NAME,
'.'))) {
25071 module = PyImport_ImportModuleLevelObject(
25072 name, global_dict, empty_dict, list, 1);
25074 if (!PyErr_ExceptionMatches(PyExc_ImportError))
25083 #if PY_MAJOR_VERSION < 3
25084 PyObject *py_level = PyInt_FromLong(level);
25087 module = PyObject_CallFunctionObjArgs(py_import,
25088 name, global_dict, empty_dict, list, py_level, (PyObject *)NULL);
25089 Py_DECREF(py_level);
25091 module = PyImport_ImportModuleLevelObject(
25092 name, global_dict, empty_dict, list, level);
25097 #if PY_MAJOR_VERSION < 3
25098 Py_XDECREF(py_import);
25100 Py_XDECREF(empty_list);
25101 Py_XDECREF(empty_dict);
25106 #if CYTHON_COMPILING_IN_CPYTHON
25107 static int __Pyx_InBases(PyTypeObject *a, PyTypeObject *b) {
25113 return b == &PyBaseObject_Type;
25115 static CYTHON_INLINE
int __Pyx_IsSubtype(PyTypeObject *a, PyTypeObject *b) {
25117 if (a == b)
return 1;
25121 n = PyTuple_GET_SIZE(mro);
25122 for (i = 0; i <
n; i++) {
25123 if (PyTuple_GET_ITEM(mro, i) == (PyObject *)b)
25128 return __Pyx_InBases(a, b);
25130 #if PY_MAJOR_VERSION == 2
25131 static int __Pyx_inner_PyErr_GivenExceptionMatches2(PyObject *err, PyObject* exc_type1, PyObject* exc_type2) {
25132 PyObject *exception, *value, *tb;
25134 __Pyx_PyThreadState_declare
25135 __Pyx_PyThreadState_assign
25136 __Pyx_ErrFetch(&exception, &value, &tb);
25137 res = exc_type1 ? PyObject_IsSubclass(err, exc_type1) : 0;
25138 if (unlikely(res == -1)) {
25139 PyErr_WriteUnraisable(err);
25143 res = PyObject_IsSubclass(err, exc_type2);
25144 if (unlikely(res == -1)) {
25145 PyErr_WriteUnraisable(err);
25149 __Pyx_ErrRestore(exception, value, tb);
25153 static CYTHON_INLINE
int __Pyx_inner_PyErr_GivenExceptionMatches2(PyObject *err, PyObject* exc_type1, PyObject *exc_type2) {
25154 int res = exc_type1 ? __Pyx_IsSubtype((PyTypeObject*)err, (PyTypeObject*)exc_type1) : 0;
25156 res = __Pyx_IsSubtype((PyTypeObject*)err, (PyTypeObject*)exc_type2);
25161 static int __Pyx_PyErr_GivenExceptionMatchesTuple(PyObject *exc_type, PyObject *tuple) {
25163 assert(PyExceptionClass_Check(exc_type));
25164 n = PyTuple_GET_SIZE(tuple);
25165 #if PY_MAJOR_VERSION >= 3
25166 for (i=0; i<
n; i++) {
25167 if (exc_type == PyTuple_GET_ITEM(tuple, i))
return 1;
25170 for (i=0; i<
n; i++) {
25171 PyObject *t = PyTuple_GET_ITEM(tuple, i);
25172 #if PY_MAJOR_VERSION < 3
25173 if (likely(exc_type == t))
return 1;
25175 if (likely(PyExceptionClass_Check(t))) {
25176 if (__Pyx_inner_PyErr_GivenExceptionMatches2(exc_type, NULL, t))
return 1;
25182 static CYTHON_INLINE
int __Pyx_PyErr_GivenExceptionMatches(PyObject *err, PyObject* exc_type) {
25183 if (likely(err == exc_type))
return 1;
25184 if (likely(PyExceptionClass_Check(err))) {
25185 if (likely(PyExceptionClass_Check(exc_type))) {
25186 return __Pyx_inner_PyErr_GivenExceptionMatches2(err, NULL, exc_type);
25187 }
else if (likely(PyTuple_Check(exc_type))) {
25188 return __Pyx_PyErr_GivenExceptionMatchesTuple(err, exc_type);
25192 return PyErr_GivenExceptionMatches(err, exc_type);
25194 static CYTHON_INLINE
int __Pyx_PyErr_GivenExceptionMatches2(PyObject *err, PyObject *exc_type1, PyObject *exc_type2) {
25195 assert(PyExceptionClass_Check(exc_type1));
25196 assert(PyExceptionClass_Check(exc_type2));
25197 if (likely(err == exc_type1 || err == exc_type2))
return 1;
25198 if (likely(PyExceptionClass_Check(err))) {
25199 return __Pyx_inner_PyErr_GivenExceptionMatches2(err, exc_type1, exc_type2);
25201 return (PyErr_GivenExceptionMatches(err, exc_type1) || PyErr_GivenExceptionMatches(err, exc_type2));
25206 #if !CYTHON_COMPILING_IN_PYPY
25207 static PyObject* __Pyx_PyInt_AddObjC(PyObject *op1, PyObject *op2, CYTHON_UNUSED
long intval,
int inplace,
int zerodivision_check) {
25209 (void)zerodivision_check;
25210 #if PY_MAJOR_VERSION < 3
25211 if (likely(PyInt_CheckExact(op1))) {
25212 const long b = intval;
25214 long a = PyInt_AS_LONG(op1);
25215 x = (long)((
unsigned long)a + b);
25216 if (likely((x^a) >= 0 || (x^b) >= 0))
25217 return PyInt_FromLong(x);
25218 return PyLong_Type.tp_as_number->nb_add(op1, op2);
25221 #if CYTHON_USE_PYLONG_INTERNALS
25222 if (likely(PyLong_CheckExact(op1))) {
25223 const long b = intval;
25225 #ifdef HAVE_LONG_LONG
25226 const PY_LONG_LONG llb = intval;
25227 PY_LONG_LONG lla, llx;
25229 const digit* digits = ((PyLongObject*)op1)->ob_digit;
25230 const Py_ssize_t size = Py_SIZE(op1);
25231 if (likely(__Pyx_sst_abs(size) <= 1)) {
25232 a = likely(size) ? digits[0] : 0;
25233 if (size == -1) a = -a;
25237 if (8 *
sizeof(
long) - 1 > 2 * PyLong_SHIFT) {
25238 a = -(long) (((((
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0]));
25240 #ifdef HAVE_LONG_LONG
25241 }
else if (8 *
sizeof(PY_LONG_LONG) - 1 > 2 * PyLong_SHIFT) {
25242 lla = -(PY_LONG_LONG) (((((
unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (
unsigned PY_LONG_LONG)digits[0]));
25246 CYTHON_FALLTHROUGH;
25248 if (8 *
sizeof(
long) - 1 > 2 * PyLong_SHIFT) {
25249 a = (long) (((((
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0]));
25251 #ifdef HAVE_LONG_LONG
25252 }
else if (8 *
sizeof(PY_LONG_LONG) - 1 > 2 * PyLong_SHIFT) {
25253 lla = (PY_LONG_LONG) (((((
unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (
unsigned PY_LONG_LONG)digits[0]));
25257 CYTHON_FALLTHROUGH;
25259 if (8 *
sizeof(
long) - 1 > 3 * PyLong_SHIFT) {
25260 a = -(long) (((((((
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0]));
25262 #ifdef HAVE_LONG_LONG
25263 }
else if (8 *
sizeof(PY_LONG_LONG) - 1 > 3 * PyLong_SHIFT) {
25264 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]));
25268 CYTHON_FALLTHROUGH;
25270 if (8 *
sizeof(
long) - 1 > 3 * PyLong_SHIFT) {
25271 a = (long) (((((((
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0]));
25273 #ifdef HAVE_LONG_LONG
25274 }
else if (8 *
sizeof(PY_LONG_LONG) - 1 > 3 * PyLong_SHIFT) {
25275 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]));
25279 CYTHON_FALLTHROUGH;
25281 if (8 *
sizeof(
long) - 1 > 4 * PyLong_SHIFT) {
25282 a = -(long) (((((((((
unsigned long)digits[3]) << PyLong_SHIFT) | (
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0]));
25284 #ifdef HAVE_LONG_LONG
25285 }
else if (8 *
sizeof(PY_LONG_LONG) - 1 > 4 * PyLong_SHIFT) {
25286 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]));
25290 CYTHON_FALLTHROUGH;
25292 if (8 *
sizeof(
long) - 1 > 4 * PyLong_SHIFT) {
25293 a = (long) (((((((((
unsigned long)digits[3]) << PyLong_SHIFT) | (
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0]));
25295 #ifdef HAVE_LONG_LONG
25296 }
else if (8 *
sizeof(PY_LONG_LONG) - 1 > 4 * PyLong_SHIFT) {
25297 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]));
25301 CYTHON_FALLTHROUGH;
25302 default:
return PyLong_Type.tp_as_number->nb_add(op1, op2);
25306 return PyLong_FromLong(x);
25307 #ifdef HAVE_LONG_LONG
25310 return PyLong_FromLongLong(llx);
25316 if (PyFloat_CheckExact(op1)) {
25317 const long b = intval;
25318 double a = PyFloat_AS_DOUBLE(op1);
25320 PyFPE_START_PROTECT(
"add",
return NULL)
25321 result = ((double)a) + (double)b;
25322 PyFPE_END_PROTECT(result)
25323 return PyFloat_FromDouble(result);
25325 return (inplace ? PyNumber_InPlaceAdd : PyNumber_Add)(op1, op2);
25330 static CYTHON_INLINE
void __Pyx_RaiseUnboundLocalError(
const char *varname) {
25331 PyErr_Format(PyExc_UnboundLocalError,
"local variable '%s' referenced before assignment", varname);
25335 static CYTHON_INLINE
long __Pyx_div_long(
long a,
long b) {
25338 q -= ((
r != 0) & ((
r ^ b) < 0));
25343 static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name) {
25344 PyObject* value = __Pyx_PyObject_GetAttrStr(module, name);
25345 if (unlikely(!value) && PyErr_ExceptionMatches(PyExc_AttributeError)) {
25346 PyErr_Format(PyExc_ImportError,
25347 #
if PY_MAJOR_VERSION < 3
25348 "cannot import name %.230s", PyString_AS_STRING(name));
25350 "cannot import name %S", name);
25357 static CYTHON_INLINE
int __Pyx_HasAttr(PyObject *o, PyObject *
n) {
25359 if (unlikely(!__Pyx_PyBaseString_Check(
n))) {
25360 PyErr_SetString(PyExc_TypeError,
25361 "hasattr(): attribute name must be string");
25364 r = __Pyx_GetAttr(o,
n);
25365 if (unlikely(!
r)) {
25375 #if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000
25376 static PyObject *__Pyx_RaiseGenericGetAttributeError(PyTypeObject *tp, PyObject *attr_name) {
25377 PyErr_Format(PyExc_AttributeError,
25378 #
if PY_MAJOR_VERSION >= 3
25379 "'%.50s' object has no attribute '%U'",
25380 tp->tp_name, attr_name);
25382 "'%.50s' object has no attribute '%.400s'",
25383 tp->tp_name, PyString_AS_STRING(attr_name));
25387 static CYTHON_INLINE PyObject* __Pyx_PyObject_GenericGetAttrNoDict(PyObject* obj, PyObject* attr_name) {
25389 PyTypeObject *tp = Py_TYPE(obj);
25390 if (unlikely(!PyString_Check(attr_name))) {
25391 return PyObject_GenericGetAttr(obj, attr_name);
25393 assert(!tp->tp_dictoffset);
25394 descr = _PyType_Lookup(tp, attr_name);
25395 if (unlikely(!descr)) {
25396 return __Pyx_RaiseGenericGetAttributeError(tp, attr_name);
25399 #if PY_MAJOR_VERSION < 3
25400 if (likely(PyType_HasFeature(Py_TYPE(descr), Py_TPFLAGS_HAVE_CLASS)))
25403 descrgetfunc
f = Py_TYPE(descr)->tp_descr_get;
25405 PyObject *res =
f(descr, obj, (PyObject *)tp);
25415 #if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000
25416 static PyObject* __Pyx_PyObject_GenericGetAttr(PyObject* obj, PyObject* attr_name) {
25417 if (unlikely(Py_TYPE(obj)->tp_dictoffset)) {
25418 return PyObject_GenericGetAttr(obj, attr_name);
25420 return __Pyx_PyObject_GenericGetAttrNoDict(obj, attr_name);
25425 static void __Pyx_PyObject_GetAttrStr_ClearAttributeError(
void) {
25426 __Pyx_PyThreadState_declare
25427 __Pyx_PyThreadState_assign
25428 if (likely(__Pyx_PyErr_ExceptionMatches(PyExc_AttributeError)))
25429 __Pyx_PyErr_Clear();
25431 static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStrNoError(PyObject* obj, PyObject* attr_name) {
25433 #if CYTHON_COMPILING_IN_CPYTHON && CYTHON_USE_TYPE_SLOTS && PY_VERSION_HEX >= 0x030700B1
25434 PyTypeObject* tp = Py_TYPE(obj);
25435 if (likely(tp->tp_getattro == PyObject_GenericGetAttr)) {
25436 return _PyObject_GenericGetAttrWithDict(obj, attr_name, NULL, 1);
25439 result = __Pyx_PyObject_GetAttrStr(obj, attr_name);
25440 if (unlikely(!result)) {
25441 __Pyx_PyObject_GetAttrStr_ClearAttributeError();
25447 static int __Pyx_setup_reduce_is_named(PyObject* meth, PyObject* name) {
25449 PyObject *name_attr;
25450 name_attr = __Pyx_PyObject_GetAttrStr(meth, __pyx_n_s_name_2);
25451 if (likely(name_attr)) {
25452 ret = PyObject_RichCompareBool(name_attr, name, Py_EQ);
25456 if (unlikely(ret < 0)) {
25460 Py_XDECREF(name_attr);
25463 static int __Pyx_setup_reduce(PyObject* type_obj) {
25465 PyObject *object_reduce = NULL;
25466 PyObject *object_getstate = NULL;
25467 PyObject *object_reduce_ex = NULL;
25468 PyObject *reduce = NULL;
25469 PyObject *reduce_ex = NULL;
25470 PyObject *reduce_cython = NULL;
25471 PyObject *setstate = NULL;
25472 PyObject *setstate_cython = NULL;
25473 PyObject *getstate = NULL;
25474 #if CYTHON_USE_PYTYPE_LOOKUP
25475 getstate = _PyType_Lookup((PyTypeObject*)type_obj, __pyx_n_s_getstate);
25477 getstate = __Pyx_PyObject_GetAttrStrNoError(type_obj, __pyx_n_s_getstate);
25478 if (!getstate && PyErr_Occurred()) {
25483 #if CYTHON_USE_PYTYPE_LOOKUP
25484 object_getstate = _PyType_Lookup(&PyBaseObject_Type, __pyx_n_s_getstate);
25486 object_getstate = __Pyx_PyObject_GetAttrStrNoError((PyObject*)&PyBaseObject_Type, __pyx_n_s_getstate);
25487 if (!object_getstate && PyErr_Occurred()) {
25491 if (object_getstate != getstate) {
25495 #if CYTHON_USE_PYTYPE_LOOKUP
25496 object_reduce_ex = _PyType_Lookup(&PyBaseObject_Type, __pyx_n_s_reduce_ex);
if (!object_reduce_ex)
goto __PYX_BAD;
25498 object_reduce_ex = __Pyx_PyObject_GetAttrStr((PyObject*)&PyBaseObject_Type, __pyx_n_s_reduce_ex);
if (!object_reduce_ex)
goto __PYX_BAD;
25500 reduce_ex = __Pyx_PyObject_GetAttrStr(type_obj, __pyx_n_s_reduce_ex);
if (unlikely(!reduce_ex))
goto __PYX_BAD;
25501 if (reduce_ex == object_reduce_ex) {
25502 #if CYTHON_USE_PYTYPE_LOOKUP
25503 object_reduce = _PyType_Lookup(&PyBaseObject_Type, __pyx_n_s_reduce);
if (!object_reduce)
goto __PYX_BAD;
25505 object_reduce = __Pyx_PyObject_GetAttrStr((PyObject*)&PyBaseObject_Type, __pyx_n_s_reduce);
if (!object_reduce)
goto __PYX_BAD;
25507 reduce = __Pyx_PyObject_GetAttrStr(type_obj, __pyx_n_s_reduce);
if (unlikely(!reduce))
goto __PYX_BAD;
25508 if (reduce == object_reduce || __Pyx_setup_reduce_is_named(reduce, __pyx_n_s_reduce_cython)) {
25509 reduce_cython = __Pyx_PyObject_GetAttrStrNoError(type_obj, __pyx_n_s_reduce_cython);
25510 if (likely(reduce_cython)) {
25511 ret = PyDict_SetItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_reduce, reduce_cython);
if (unlikely(ret < 0))
goto __PYX_BAD;
25512 ret = PyDict_DelItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_reduce_cython);
if (unlikely(ret < 0))
goto __PYX_BAD;
25513 }
else if (reduce == object_reduce || PyErr_Occurred()) {
25516 setstate = __Pyx_PyObject_GetAttrStr(type_obj, __pyx_n_s_setstate);
25517 if (!setstate) PyErr_Clear();
25518 if (!setstate || __Pyx_setup_reduce_is_named(setstate, __pyx_n_s_setstate_cython)) {
25519 setstate_cython = __Pyx_PyObject_GetAttrStrNoError(type_obj, __pyx_n_s_setstate_cython);
25520 if (likely(setstate_cython)) {
25521 ret = PyDict_SetItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_setstate, setstate_cython);
if (unlikely(ret < 0))
goto __PYX_BAD;
25522 ret = PyDict_DelItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_setstate_cython);
if (unlikely(ret < 0))
goto __PYX_BAD;
25523 }
else if (!setstate || PyErr_Occurred()) {
25527 PyType_Modified((PyTypeObject*)type_obj);
25532 if (!PyErr_Occurred())
25533 PyErr_Format(PyExc_RuntimeError,
"Unable to initialize pickling for %s", ((PyTypeObject*)type_obj)->tp_name);
25536 #if !CYTHON_USE_PYTYPE_LOOKUP
25537 Py_XDECREF(object_reduce);
25538 Py_XDECREF(object_reduce_ex);
25539 Py_XDECREF(object_getstate);
25540 Py_XDECREF(getstate);
25542 Py_XDECREF(reduce);
25543 Py_XDECREF(reduce_ex);
25544 Py_XDECREF(reduce_cython);
25545 Py_XDECREF(setstate);
25546 Py_XDECREF(setstate_cython);
25551 static int __Pyx_SetVtable(PyObject *dict,
void *vtable) {
25552 #if PY_VERSION_HEX >= 0x02070000
25553 PyObject *ob = PyCapsule_New(vtable, 0, 0);
25555 PyObject *ob = PyCObject_FromVoidPtr(vtable, 0);
25559 if (PyDict_SetItem(dict, __pyx_n_s_pyx_vtable, ob) < 0)
25569 #ifndef __PYX_HAVE_RT_ImportType
25570 #define __PYX_HAVE_RT_ImportType
25571 static PyTypeObject *__Pyx_ImportType(PyObject *module,
const char *module_name,
const char *class_name,
25572 size_t size,
enum __Pyx_ImportType_CheckSize check_size)
25574 PyObject *result = 0;
25576 Py_ssize_t basicsize;
25577 #ifdef Py_LIMITED_API
25578 PyObject *py_basicsize;
25580 result = PyObject_GetAttrString(module, class_name);
25583 if (!PyType_Check(result)) {
25584 PyErr_Format(PyExc_TypeError,
25585 "%.200s.%.200s is not a type object",
25586 module_name, class_name);
25589 #ifndef Py_LIMITED_API
25590 basicsize = ((PyTypeObject *)result)->tp_basicsize;
25592 py_basicsize = PyObject_GetAttrString(result,
"__basicsize__");
25595 basicsize = PyLong_AsSsize_t(py_basicsize);
25596 Py_DECREF(py_basicsize);
25598 if (basicsize == (Py_ssize_t)-1 && PyErr_Occurred())
25601 if ((
size_t)basicsize < size) {
25602 PyErr_Format(PyExc_ValueError,
25603 "%.200s.%.200s size changed, may indicate binary incompatibility. "
25604 "Expected %zd from C header, got %zd from PyObject",
25605 module_name, class_name, size, basicsize);
25608 if (check_size == __Pyx_ImportType_CheckSize_Error && (
size_t)basicsize != size) {
25609 PyErr_Format(PyExc_ValueError,
25610 "%.200s.%.200s size changed, may indicate binary incompatibility. "
25611 "Expected %zd from C header, got %zd from PyObject",
25612 module_name, class_name, size, basicsize);
25615 else if (check_size == __Pyx_ImportType_CheckSize_Warn && (
size_t)basicsize > size) {
25616 PyOS_snprintf(warning,
sizeof(warning),
25617 "%s.%s size changed, may indicate binary incompatibility. "
25618 "Expected %zd from C header, got %zd from PyObject",
25619 module_name, class_name, size, basicsize);
25620 if (PyErr_WarnEx(NULL, warning, 0) < 0)
goto bad;
25622 return (PyTypeObject *)result;
25624 Py_XDECREF(result);
25630 static PyObject *__Pyx_CalculateMetaclass(PyTypeObject *metaclass, PyObject *bases) {
25631 Py_ssize_t i, nbases = PyTuple_GET_SIZE(bases);
25632 for (i=0; i < nbases; i++) {
25633 PyTypeObject *tmptype;
25634 PyObject *tmp = PyTuple_GET_ITEM(bases, i);
25635 tmptype = Py_TYPE(tmp);
25636 #if PY_MAJOR_VERSION < 3
25637 if (tmptype == &PyClass_Type)
25641 metaclass = tmptype;
25644 if (PyType_IsSubtype(metaclass, tmptype))
25646 if (PyType_IsSubtype(tmptype, metaclass)) {
25647 metaclass = tmptype;
25650 PyErr_SetString(PyExc_TypeError,
25651 "metaclass conflict: "
25652 "the metaclass of a derived class "
25653 "must be a (non-strict) subclass "
25654 "of the metaclasses of all its bases");
25658 #if PY_MAJOR_VERSION < 3
25659 metaclass = &PyClass_Type;
25661 metaclass = &PyType_Type;
25664 Py_INCREF((PyObject*) metaclass);
25665 return (PyObject*) metaclass;
25669 static PyTypeObject* __Pyx_FetchCommonType(PyTypeObject* type) {
25670 PyObject* fake_module;
25671 PyTypeObject* cached_type = NULL;
25672 fake_module = PyImport_AddModule((
char*)
"_cython_" CYTHON_ABI);
25673 if (!fake_module)
return NULL;
25674 Py_INCREF(fake_module);
25675 cached_type = (PyTypeObject*) PyObject_GetAttrString(fake_module, type->tp_name);
25677 if (!PyType_Check((PyObject*)cached_type)) {
25678 PyErr_Format(PyExc_TypeError,
25679 "Shared Cython type %.200s is not a type object",
25683 if (cached_type->tp_basicsize != type->tp_basicsize) {
25684 PyErr_Format(PyExc_TypeError,
25685 "Shared Cython type %.200s has the wrong size, try recompiling",
25690 if (!PyErr_ExceptionMatches(PyExc_AttributeError))
goto bad;
25692 if (PyType_Ready(type) < 0)
goto bad;
25693 if (PyObject_SetAttrString(fake_module, type->tp_name, (PyObject*) type) < 0)
25696 cached_type = type;
25699 Py_DECREF(fake_module);
25700 return cached_type;
25702 Py_XDECREF(cached_type);
25703 cached_type = NULL;
25708 #include <structmember.h>
25710 __Pyx_CyFunction_get_doc(__pyx_CyFunctionObject *op, CYTHON_UNUSED
void *closure)
25712 if (unlikely(op->func_doc == NULL)) {
25713 if (op->func.m_ml->ml_doc) {
25714 #if PY_MAJOR_VERSION >= 3
25715 op->func_doc = PyUnicode_FromString(op->func.m_ml->ml_doc);
25717 op->func_doc = PyString_FromString(op->func.m_ml->ml_doc);
25719 if (unlikely(op->func_doc == NULL))
25722 Py_INCREF(Py_None);
25726 Py_INCREF(op->func_doc);
25727 return op->func_doc;
25730 __Pyx_CyFunction_set_doc(__pyx_CyFunctionObject *op, PyObject *value, CYTHON_UNUSED
void *context)
25732 PyObject *tmp = op->func_doc;
25733 if (value == NULL) {
25737 op->func_doc = value;
25742 __Pyx_CyFunction_get_name(__pyx_CyFunctionObject *op, CYTHON_UNUSED
void *context)
25744 if (unlikely(op->func_name == NULL)) {
25745 #if PY_MAJOR_VERSION >= 3
25746 op->func_name = PyUnicode_InternFromString(op->func.m_ml->ml_name);
25748 op->func_name = PyString_InternFromString(op->func.m_ml->ml_name);
25750 if (unlikely(op->func_name == NULL))
25753 Py_INCREF(op->func_name);
25754 return op->func_name;
25757 __Pyx_CyFunction_set_name(__pyx_CyFunctionObject *op, PyObject *value, CYTHON_UNUSED
void *context)
25760 #if PY_MAJOR_VERSION >= 3
25761 if (unlikely(value == NULL || !PyUnicode_Check(value)))
25763 if (unlikely(value == NULL || !PyString_Check(value)))
25766 PyErr_SetString(PyExc_TypeError,
25767 "__name__ must be set to a string object");
25770 tmp = op->func_name;
25772 op->func_name = value;
25777 __Pyx_CyFunction_get_qualname(__pyx_CyFunctionObject *op, CYTHON_UNUSED
void *context)
25779 Py_INCREF(op->func_qualname);
25780 return op->func_qualname;
25783 __Pyx_CyFunction_set_qualname(__pyx_CyFunctionObject *op, PyObject *value, CYTHON_UNUSED
void *context)
25786 #if PY_MAJOR_VERSION >= 3
25787 if (unlikely(value == NULL || !PyUnicode_Check(value)))
25789 if (unlikely(value == NULL || !PyString_Check(value)))
25792 PyErr_SetString(PyExc_TypeError,
25793 "__qualname__ must be set to a string object");
25796 tmp = op->func_qualname;
25798 op->func_qualname = value;
25803 __Pyx_CyFunction_get_self(__pyx_CyFunctionObject *m, CYTHON_UNUSED
void *closure)
25806 self = m->func_closure;
25813 __Pyx_CyFunction_get_dict(__pyx_CyFunctionObject *op, CYTHON_UNUSED
void *context)
25815 if (unlikely(op->func_dict == NULL)) {
25816 op->func_dict = PyDict_New();
25817 if (unlikely(op->func_dict == NULL))
25820 Py_INCREF(op->func_dict);
25821 return op->func_dict;
25824 __Pyx_CyFunction_set_dict(__pyx_CyFunctionObject *op, PyObject *value, CYTHON_UNUSED
void *context)
25827 if (unlikely(value == NULL)) {
25828 PyErr_SetString(PyExc_TypeError,
25829 "function's dictionary may not be deleted");
25832 if (unlikely(!PyDict_Check(value))) {
25833 PyErr_SetString(PyExc_TypeError,
25834 "setting function's dictionary to a non-dict");
25837 tmp = op->func_dict;
25839 op->func_dict = value;
25844 __Pyx_CyFunction_get_globals(__pyx_CyFunctionObject *op, CYTHON_UNUSED
void *context)
25846 Py_INCREF(op->func_globals);
25847 return op->func_globals;
25850 __Pyx_CyFunction_get_closure(CYTHON_UNUSED __pyx_CyFunctionObject *op, CYTHON_UNUSED
void *context)
25852 Py_INCREF(Py_None);
25856 __Pyx_CyFunction_get_code(__pyx_CyFunctionObject *op, CYTHON_UNUSED
void *context)
25858 PyObject* result = (op->func_code) ? op->func_code : Py_None;
25863 __Pyx_CyFunction_init_defaults(__pyx_CyFunctionObject *op) {
25865 PyObject *res = op->defaults_getter((PyObject *) op);
25866 if (unlikely(!res))
25868 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
25869 op->defaults_tuple = PyTuple_GET_ITEM(res, 0);
25870 Py_INCREF(op->defaults_tuple);
25871 op->defaults_kwdict = PyTuple_GET_ITEM(res, 1);
25872 Py_INCREF(op->defaults_kwdict);
25874 op->defaults_tuple = PySequence_ITEM(res, 0);
25875 if (unlikely(!op->defaults_tuple)) result = -1;
25877 op->defaults_kwdict = PySequence_ITEM(res, 1);
25878 if (unlikely(!op->defaults_kwdict)) result = -1;
25885 __Pyx_CyFunction_set_defaults(__pyx_CyFunctionObject *op, PyObject* value, CYTHON_UNUSED
void *context) {
25889 }
else if (value != Py_None && !PyTuple_Check(value)) {
25890 PyErr_SetString(PyExc_TypeError,
25891 "__defaults__ must be set to a tuple object");
25895 tmp = op->defaults_tuple;
25896 op->defaults_tuple = value;
25901 __Pyx_CyFunction_get_defaults(__pyx_CyFunctionObject *op, CYTHON_UNUSED
void *context) {
25902 PyObject* result = op->defaults_tuple;
25903 if (unlikely(!result)) {
25904 if (op->defaults_getter) {
25905 if (__Pyx_CyFunction_init_defaults(op) < 0)
return NULL;
25906 result = op->defaults_tuple;
25915 __Pyx_CyFunction_set_kwdefaults(__pyx_CyFunctionObject *op, PyObject* value, CYTHON_UNUSED
void *context) {
25919 }
else if (value != Py_None && !PyDict_Check(value)) {
25920 PyErr_SetString(PyExc_TypeError,
25921 "__kwdefaults__ must be set to a dict object");
25925 tmp = op->defaults_kwdict;
25926 op->defaults_kwdict = value;
25931 __Pyx_CyFunction_get_kwdefaults(__pyx_CyFunctionObject *op, CYTHON_UNUSED
void *context) {
25932 PyObject* result = op->defaults_kwdict;
25933 if (unlikely(!result)) {
25934 if (op->defaults_getter) {
25935 if (__Pyx_CyFunction_init_defaults(op) < 0)
return NULL;
25936 result = op->defaults_kwdict;
25945 __Pyx_CyFunction_set_annotations(__pyx_CyFunctionObject *op, PyObject* value, CYTHON_UNUSED
void *context) {
25947 if (!value || value == Py_None) {
25949 }
else if (!PyDict_Check(value)) {
25950 PyErr_SetString(PyExc_TypeError,
25951 "__annotations__ must be set to a dict object");
25955 tmp = op->func_annotations;
25956 op->func_annotations = value;
25961 __Pyx_CyFunction_get_annotations(__pyx_CyFunctionObject *op, CYTHON_UNUSED
void *context) {
25962 PyObject* result = op->func_annotations;
25963 if (unlikely(!result)) {
25964 result = PyDict_New();
25965 if (unlikely(!result))
return NULL;
25966 op->func_annotations = result;
25971 static PyGetSetDef __pyx_CyFunction_getsets[] = {
25972 {(
char *)
"func_doc", (getter)__Pyx_CyFunction_get_doc, (setter)__Pyx_CyFunction_set_doc, 0, 0},
25973 {(
char *)
"__doc__", (getter)__Pyx_CyFunction_get_doc, (setter)__Pyx_CyFunction_set_doc, 0, 0},
25974 {(
char *)
"func_name", (getter)__Pyx_CyFunction_get_name, (setter)__Pyx_CyFunction_set_name, 0, 0},
25975 {(
char *)
"__name__", (getter)__Pyx_CyFunction_get_name, (setter)__Pyx_CyFunction_set_name, 0, 0},
25976 {(
char *)
"__qualname__", (getter)__Pyx_CyFunction_get_qualname, (setter)__Pyx_CyFunction_set_qualname, 0, 0},
25977 {(
char *)
"__self__", (getter)__Pyx_CyFunction_get_self, 0, 0, 0},
25978 {(
char *)
"func_dict", (getter)__Pyx_CyFunction_get_dict, (setter)__Pyx_CyFunction_set_dict, 0, 0},
25979 {(
char *)
"__dict__", (getter)__Pyx_CyFunction_get_dict, (setter)__Pyx_CyFunction_set_dict, 0, 0},
25980 {(
char *)
"func_globals", (getter)__Pyx_CyFunction_get_globals, 0, 0, 0},
25981 {(
char *)
"__globals__", (getter)__Pyx_CyFunction_get_globals, 0, 0, 0},
25982 {(
char *)
"func_closure", (getter)__Pyx_CyFunction_get_closure, 0, 0, 0},
25983 {(
char *)
"__closure__", (getter)__Pyx_CyFunction_get_closure, 0, 0, 0},
25984 {(
char *)
"func_code", (getter)__Pyx_CyFunction_get_code, 0, 0, 0},
25985 {(
char *)
"__code__", (getter)__Pyx_CyFunction_get_code, 0, 0, 0},
25986 {(
char *)
"func_defaults", (getter)__Pyx_CyFunction_get_defaults, (setter)__Pyx_CyFunction_set_defaults, 0, 0},
25987 {(
char *)
"__defaults__", (getter)__Pyx_CyFunction_get_defaults, (setter)__Pyx_CyFunction_set_defaults, 0, 0},
25988 {(
char *)
"__kwdefaults__", (getter)__Pyx_CyFunction_get_kwdefaults, (setter)__Pyx_CyFunction_set_kwdefaults, 0, 0},
25989 {(
char *)
"__annotations__", (getter)__Pyx_CyFunction_get_annotations, (setter)__Pyx_CyFunction_set_annotations, 0, 0},
25992 static PyMemberDef __pyx_CyFunction_members[] = {
25993 {(
char *)
"__module__", T_OBJECT, offsetof(PyCFunctionObject, m_module), PY_WRITE_RESTRICTED, 0},
25997 __Pyx_CyFunction_reduce(__pyx_CyFunctionObject *m, CYTHON_UNUSED PyObject *args)
25999 #if PY_MAJOR_VERSION >= 3
26000 Py_INCREF(m->func_qualname);
26001 return m->func_qualname;
26003 return PyString_FromString(m->func.m_ml->ml_name);
26006 static PyMethodDef __pyx_CyFunction_methods[] = {
26007 {
"__reduce__", (PyCFunction)__Pyx_CyFunction_reduce, METH_VARARGS, 0},
26010 #if PY_VERSION_HEX < 0x030500A0
26011 #define __Pyx_CyFunction_weakreflist(cyfunc) ((cyfunc)->func_weakreflist)
26013 #define __Pyx_CyFunction_weakreflist(cyfunc) ((cyfunc)->func.m_weakreflist)
26015 static PyObject *__Pyx_CyFunction_Init(__pyx_CyFunctionObject *op, PyMethodDef *ml,
int flags, PyObject* qualname,
26016 PyObject *closure, PyObject *module, PyObject* globals, PyObject* code) {
26017 if (unlikely(op == NULL))
26020 __Pyx_CyFunction_weakreflist(op) = NULL;
26021 op->func.m_ml = ml;
26022 op->func.m_self = (PyObject *) op;
26023 Py_XINCREF(closure);
26024 op->func_closure = closure;
26025 Py_XINCREF(module);
26026 op->func.m_module = module;
26027 op->func_dict = NULL;
26028 op->func_name = NULL;
26029 Py_INCREF(qualname);
26030 op->func_qualname = qualname;
26031 op->func_doc = NULL;
26032 op->func_classobj = NULL;
26033 op->func_globals = globals;
26034 Py_INCREF(op->func_globals);
26036 op->func_code = code;
26037 op->defaults_pyobjects = 0;
26038 op->defaults_size = 0;
26039 op->defaults = NULL;
26040 op->defaults_tuple = NULL;
26041 op->defaults_kwdict = NULL;
26042 op->defaults_getter = NULL;
26043 op->func_annotations = NULL;
26044 return (PyObject *) op;
26047 __Pyx_CyFunction_clear(__pyx_CyFunctionObject *m)
26049 Py_CLEAR(m->func_closure);
26050 Py_CLEAR(m->func.m_module);
26051 Py_CLEAR(m->func_dict);
26052 Py_CLEAR(m->func_name);
26053 Py_CLEAR(m->func_qualname);
26054 Py_CLEAR(m->func_doc);
26055 Py_CLEAR(m->func_globals);
26056 Py_CLEAR(m->func_code);
26057 Py_CLEAR(m->func_classobj);
26058 Py_CLEAR(m->defaults_tuple);
26059 Py_CLEAR(m->defaults_kwdict);
26060 Py_CLEAR(m->func_annotations);
26062 PyObject **pydefaults = __Pyx_CyFunction_Defaults(PyObject *, m);
26064 for (i = 0; i < m->defaults_pyobjects; i++)
26065 Py_XDECREF(pydefaults[i]);
26066 PyObject_Free(m->defaults);
26067 m->defaults = NULL;
26071 static void __Pyx__CyFunction_dealloc(__pyx_CyFunctionObject *m)
26073 if (__Pyx_CyFunction_weakreflist(m) != NULL)
26074 PyObject_ClearWeakRefs((PyObject *) m);
26075 __Pyx_CyFunction_clear(m);
26076 PyObject_GC_Del(m);
26078 static void __Pyx_CyFunction_dealloc(__pyx_CyFunctionObject *m)
26080 PyObject_GC_UnTrack(m);
26081 __Pyx__CyFunction_dealloc(m);
26083 static int __Pyx_CyFunction_traverse(__pyx_CyFunctionObject *m, visitproc visit,
void *arg)
26085 Py_VISIT(m->func_closure);
26086 Py_VISIT(m->func.m_module);
26087 Py_VISIT(m->func_dict);
26088 Py_VISIT(m->func_name);
26089 Py_VISIT(m->func_qualname);
26090 Py_VISIT(m->func_doc);
26091 Py_VISIT(m->func_globals);
26092 Py_VISIT(m->func_code);
26093 Py_VISIT(m->func_classobj);
26094 Py_VISIT(m->defaults_tuple);
26095 Py_VISIT(m->defaults_kwdict);
26097 PyObject **pydefaults = __Pyx_CyFunction_Defaults(PyObject *, m);
26099 for (i = 0; i < m->defaults_pyobjects; i++)
26100 Py_VISIT(pydefaults[i]);
26104 static PyObject *__Pyx_CyFunction_descr_get(PyObject *func, PyObject *obj, PyObject *type)
26106 #if PY_MAJOR_VERSION < 3
26107 __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func;
26108 if (m->flags & __Pyx_CYFUNCTION_STATICMETHOD) {
26112 if (m->flags & __Pyx_CYFUNCTION_CLASSMETHOD) {
26114 type = (PyObject *)(Py_TYPE(obj));
26115 return __Pyx_PyMethod_New(func, type, (PyObject *)(Py_TYPE(type)));
26117 if (obj == Py_None)
26120 return __Pyx_PyMethod_New(func, obj, type);
26123 __Pyx_CyFunction_repr(__pyx_CyFunctionObject *op)
26125 #if PY_MAJOR_VERSION >= 3
26126 return PyUnicode_FromFormat(
"<cyfunction %U at %p>",
26127 op->func_qualname, (
void *)op);
26129 return PyString_FromFormat(
"<cyfunction %s at %p>",
26130 PyString_AsString(op->func_qualname), (
void *)op);
26133 static PyObject * __Pyx_CyFunction_CallMethod(PyObject *func, PyObject *
self, PyObject *arg, PyObject *kw) {
26134 PyCFunctionObject*
f = (PyCFunctionObject*)func;
26135 PyCFunction meth =
f->m_ml->ml_meth;
26137 switch (
f->m_ml->ml_flags & (METH_VARARGS | METH_KEYWORDS | METH_NOARGS | METH_O)) {
26139 if (likely(kw == NULL || PyDict_Size(kw) == 0))
26140 return (*meth)(
self, arg);
26142 case METH_VARARGS | METH_KEYWORDS:
26143 return (*(PyCFunctionWithKeywords)(
void*)meth)(
self, arg, kw);
26145 if (likely(kw == NULL || PyDict_Size(kw) == 0)) {
26146 size = PyTuple_GET_SIZE(arg);
26147 if (likely(size == 0))
26148 return (*meth)(
self, NULL);
26149 PyErr_Format(PyExc_TypeError,
26150 "%.200s() takes no arguments (%" CYTHON_FORMAT_SSIZE_T
"d given)",
26151 f->m_ml->ml_name, size);
26156 if (likely(kw == NULL || PyDict_Size(kw) == 0)) {
26157 size = PyTuple_GET_SIZE(arg);
26158 if (likely(size == 1)) {
26159 PyObject *result, *arg0;
26160 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
26161 arg0 = PyTuple_GET_ITEM(arg, 0);
26163 arg0 = PySequence_ITEM(arg, 0);
if (unlikely(!arg0))
return NULL;
26165 result = (*meth)(
self, arg0);
26166 #if !(CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS)
26171 PyErr_Format(PyExc_TypeError,
26172 "%.200s() takes exactly one argument (%" CYTHON_FORMAT_SSIZE_T
"d given)",
26173 f->m_ml->ml_name, size);
26178 PyErr_SetString(PyExc_SystemError,
"Bad call flags in "
26179 "__Pyx_CyFunction_Call. METH_OLDARGS is no "
26180 "longer supported!");
26183 PyErr_Format(PyExc_TypeError,
"%.200s() takes no keyword arguments",
26187 static CYTHON_INLINE PyObject *__Pyx_CyFunction_Call(PyObject *func, PyObject *arg, PyObject *kw) {
26188 return __Pyx_CyFunction_CallMethod(func, ((PyCFunctionObject*)func)->m_self, arg, kw);
26190 static PyObject *__Pyx_CyFunction_CallAsMethod(PyObject *func, PyObject *args, PyObject *kw) {
26192 __pyx_CyFunctionObject *cyfunc = (__pyx_CyFunctionObject *) func;
26193 if ((cyfunc->flags & __Pyx_CYFUNCTION_CCLASS) && !(cyfunc->flags & __Pyx_CYFUNCTION_STATICMETHOD)) {
26195 PyObject *new_args;
26197 argc = PyTuple_GET_SIZE(args);
26198 new_args = PyTuple_GetSlice(args, 1, argc);
26199 if (unlikely(!new_args))
26201 self = PyTuple_GetItem(args, 0);
26202 if (unlikely(!
self)) {
26203 Py_DECREF(new_args);
26204 PyErr_Format(PyExc_TypeError,
26205 "unbound method %.200S() needs an argument",
26206 cyfunc->func_qualname);
26209 result = __Pyx_CyFunction_CallMethod(func,
self, new_args, kw);
26210 Py_DECREF(new_args);
26212 result = __Pyx_CyFunction_Call(func, args, kw);
26216 static PyTypeObject __pyx_CyFunctionType_type = {
26217 PyVarObject_HEAD_INIT(0, 0)
26218 "cython_function_or_method",
26219 sizeof(__pyx_CyFunctionObject),
26221 (destructor) __Pyx_CyFunction_dealloc,
26225 #if PY_MAJOR_VERSION < 3
26230 (reprfunc) __Pyx_CyFunction_repr,
26235 __Pyx_CyFunction_CallAsMethod,
26240 Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC,
26242 (traverseproc) __Pyx_CyFunction_traverse,
26243 (inquiry) __Pyx_CyFunction_clear,
26245 #
if PY_VERSION_HEX < 0x030500A0
26246 offsetof(__pyx_CyFunctionObject, func_weakreflist),
26248 offsetof(PyCFunctionObject, m_weakreflist),
26252 __pyx_CyFunction_methods,
26253 __pyx_CyFunction_members,
26254 __pyx_CyFunction_getsets,
26257 __Pyx_CyFunction_descr_get,
26259 offsetof(__pyx_CyFunctionObject, func_dict),
26272 #if PY_VERSION_HEX >= 0x030400a1
26275 #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800)
26278 #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
26281 #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000
26285 static int __pyx_CyFunction_init(
void) {
26286 __pyx_CyFunctionType = __Pyx_FetchCommonType(&__pyx_CyFunctionType_type);
26287 if (unlikely(__pyx_CyFunctionType == NULL)) {
26292 static CYTHON_INLINE
void *__Pyx_CyFunction_InitDefaults(PyObject *func,
size_t size,
int pyobjects) {
26293 __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func;
26294 m->defaults = PyObject_Malloc(size);
26295 if (unlikely(!m->defaults))
26296 return PyErr_NoMemory();
26297 memset(m->defaults, 0, size);
26298 m->defaults_pyobjects = pyobjects;
26299 m->defaults_size = size;
26300 return m->defaults;
26302 static CYTHON_INLINE
void __Pyx_CyFunction_SetDefaultsTuple(PyObject *func, PyObject *tuple) {
26303 __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func;
26304 m->defaults_tuple = tuple;
26307 static CYTHON_INLINE
void __Pyx_CyFunction_SetDefaultsKwDict(PyObject *func, PyObject *dict) {
26308 __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func;
26309 m->defaults_kwdict = dict;
26312 static CYTHON_INLINE
void __Pyx_CyFunction_SetAnnotationsDict(PyObject *func, PyObject *dict) {
26313 __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func;
26314 m->func_annotations = dict;
26319 static PyObject *__Pyx_CyFunction_New(PyMethodDef *ml,
int flags, PyObject* qualname,
26320 PyObject *closure, PyObject *module, PyObject* globals, PyObject* code) {
26321 PyObject *op = __Pyx_CyFunction_Init(
26322 PyObject_GC_New(__pyx_CyFunctionObject, __pyx_CyFunctionType),
26323 ml, flags, qualname, closure, module, globals, code
26326 PyObject_GC_Track(op);
26332 static PyObject *__Pyx_Py3MetaclassPrepare(PyObject *metaclass, PyObject *bases, PyObject *name,
26333 PyObject *qualname, PyObject *mkw, PyObject *modname, PyObject *doc) {
26336 PyObject *prep = __Pyx_PyObject_GetAttrStr(metaclass, __pyx_n_s_prepare);
26338 PyObject *pargs = PyTuple_Pack(2, name, bases);
26339 if (unlikely(!pargs)) {
26343 ns = PyObject_Call(prep, pargs, mkw);
26347 if (unlikely(!PyErr_ExceptionMatches(PyExc_AttributeError)))
26357 if (unlikely(PyObject_SetItem(
ns, __pyx_n_s_module, modname) < 0))
goto bad;
26358 if (unlikely(PyObject_SetItem(
ns, __pyx_n_s_qualname, qualname) < 0))
goto bad;
26359 if (unlikely(doc && PyObject_SetItem(
ns, __pyx_n_s_doc, doc) < 0))
goto bad;
26365 static PyObject *__Pyx_Py3ClassCreate(PyObject *metaclass, PyObject *name, PyObject *bases,
26366 PyObject *dict, PyObject *mkw,
26367 int calculate_metaclass,
int allow_py2_metaclass) {
26368 PyObject *result, *margs;
26369 PyObject *owned_metaclass = NULL;
26370 if (allow_py2_metaclass) {
26371 owned_metaclass = PyObject_GetItem(dict, __pyx_n_s_metaclass);
26372 if (owned_metaclass) {
26373 metaclass = owned_metaclass;
26374 }
else if (likely(PyErr_ExceptionMatches(PyExc_KeyError))) {
26380 if (calculate_metaclass && (!metaclass || PyType_Check(metaclass))) {
26381 metaclass = __Pyx_CalculateMetaclass((PyTypeObject*) metaclass, bases);
26382 Py_XDECREF(owned_metaclass);
26383 if (unlikely(!metaclass))
26385 owned_metaclass = metaclass;
26387 margs = PyTuple_Pack(3, name, bases, dict);
26388 if (unlikely(!margs)) {
26391 result = PyObject_Call(metaclass, margs, mkw);
26394 Py_XDECREF(owned_metaclass);
26399 #ifndef CYTHON_CLINE_IN_TRACEBACK
26400 static int __Pyx_CLineForTraceback(CYTHON_NCP_UNUSED PyThreadState *tstate,
int c_line) {
26401 PyObject *use_cline;
26402 PyObject *ptype, *pvalue, *ptraceback;
26403 #if CYTHON_COMPILING_IN_CPYTHON
26404 PyObject **cython_runtime_dict;
26406 if (unlikely(!__pyx_cython_runtime)) {
26409 __Pyx_ErrFetchInState(tstate, &ptype, &pvalue, &ptraceback);
26410 #if CYTHON_COMPILING_IN_CPYTHON
26411 cython_runtime_dict = _PyObject_GetDictPtr(__pyx_cython_runtime);
26412 if (likely(cython_runtime_dict)) {
26413 __PYX_PY_DICT_LOOKUP_IF_MODIFIED(
26414 use_cline, *cython_runtime_dict,
26415 __Pyx_PyDict_GetItemStr(*cython_runtime_dict, __pyx_n_s_cline_in_traceback))
26419 PyObject *use_cline_obj = __Pyx_PyObject_GetAttrStr(__pyx_cython_runtime, __pyx_n_s_cline_in_traceback);
26420 if (use_cline_obj) {
26421 use_cline = PyObject_Not(use_cline_obj) ? Py_False : Py_True;
26422 Py_DECREF(use_cline_obj);
26430 (void) PyObject_SetAttr(__pyx_cython_runtime, __pyx_n_s_cline_in_traceback, Py_False);
26432 else if (use_cline == Py_False || (use_cline != Py_True && PyObject_Not(use_cline) != 0)) {
26435 __Pyx_ErrRestoreInState(tstate, ptype, pvalue, ptraceback);
26441 static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries,
int count,
int code_line) {
26442 int start = 0, mid = 0, end = count - 1;
26443 if (end >= 0 && code_line > entries[end].code_line) {
26446 while (start < end) {
26447 mid = start + (end - start) / 2;
26448 if (code_line < entries[mid].code_line) {
26450 }
else if (code_line > entries[mid].code_line) {
26456 if (code_line <= entries[mid].code_line) {
26462 static PyCodeObject *__pyx_find_code_object(
int code_line) {
26463 PyCodeObject* code_object;
26465 if (unlikely(!code_line) || unlikely(!__pyx_code_cache.entries)) {
26468 pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line);
26469 if (unlikely(
pos >= __pyx_code_cache.count) || unlikely(__pyx_code_cache.entries[
pos].code_line != code_line)) {
26472 code_object = __pyx_code_cache.entries[
pos].code_object;
26473 Py_INCREF(code_object);
26474 return code_object;
26476 static void __pyx_insert_code_object(
int code_line, PyCodeObject* code_object) {
26478 __Pyx_CodeObjectCacheEntry* entries = __pyx_code_cache.entries;
26479 if (unlikely(!code_line)) {
26482 if (unlikely(!entries)) {
26483 entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Malloc(64*
sizeof(__Pyx_CodeObjectCacheEntry));
26484 if (likely(entries)) {
26485 __pyx_code_cache.entries = entries;
26486 __pyx_code_cache.max_count = 64;
26487 __pyx_code_cache.count = 1;
26488 entries[0].code_line = code_line;
26489 entries[0].code_object = code_object;
26490 Py_INCREF(code_object);
26494 pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line);
26495 if ((
pos < __pyx_code_cache.count) && unlikely(__pyx_code_cache.entries[
pos].code_line == code_line)) {
26496 PyCodeObject* tmp = entries[
pos].code_object;
26497 entries[
pos].code_object = code_object;
26501 if (__pyx_code_cache.count == __pyx_code_cache.max_count) {
26502 int new_max = __pyx_code_cache.max_count + 64;
26503 entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Realloc(
26504 __pyx_code_cache.entries, ((
size_t)new_max) *
sizeof(__Pyx_CodeObjectCacheEntry));
26505 if (unlikely(!entries)) {
26508 __pyx_code_cache.entries = entries;
26509 __pyx_code_cache.max_count = new_max;
26511 for (i=__pyx_code_cache.count; i>
pos; i--) {
26512 entries[i] = entries[i-1];
26514 entries[
pos].code_line = code_line;
26515 entries[
pos].code_object = code_object;
26516 __pyx_code_cache.count++;
26517 Py_INCREF(code_object);
26521 #include "compile.h"
26522 #include "frameobject.h"
26523 #include "traceback.h"
26524 #if PY_VERSION_HEX >= 0x030b00a6
26525 #ifndef Py_BUILD_CORE
26526 #define Py_BUILD_CORE 1
26528 #include "internal/pycore_frame.h"
26530 static PyCodeObject* __Pyx_CreateCodeObjectForTraceback(
26531 const char *funcname,
int c_line,
26532 int py_line,
const char *filename) {
26533 PyCodeObject *py_code = NULL;
26534 PyObject *py_funcname = NULL;
26535 #if PY_MAJOR_VERSION < 3
26536 PyObject *py_srcfile = NULL;
26537 py_srcfile = PyString_FromString(filename);
26538 if (!py_srcfile)
goto bad;
26541 #if PY_MAJOR_VERSION < 3
26542 py_funcname = PyString_FromFormat(
"%s (%s:%d)", funcname, __pyx_cfilenm, c_line);
26543 if (!py_funcname)
goto bad;
26545 py_funcname = PyUnicode_FromFormat(
"%s (%s:%d)", funcname, __pyx_cfilenm, c_line);
26546 if (!py_funcname)
goto bad;
26547 funcname = PyUnicode_AsUTF8(py_funcname);
26548 if (!funcname)
goto bad;
26552 #if PY_MAJOR_VERSION < 3
26553 py_funcname = PyString_FromString(funcname);
26554 if (!py_funcname)
goto bad;
26557 #if PY_MAJOR_VERSION < 3
26558 py_code = __Pyx_PyCode_New(
26575 Py_DECREF(py_srcfile);
26577 py_code = PyCode_NewEmpty(filename, funcname, py_line);
26579 Py_XDECREF(py_funcname);
26582 Py_XDECREF(py_funcname);
26583 #if PY_MAJOR_VERSION < 3
26584 Py_XDECREF(py_srcfile);
26588 static void __Pyx_AddTraceback(
const char *funcname,
int c_line,
26589 int py_line,
const char *filename) {
26590 PyCodeObject *py_code = 0;
26591 PyFrameObject *py_frame = 0;
26592 PyThreadState *tstate = __Pyx_PyThreadState_Current;
26593 PyObject *ptype, *pvalue, *ptraceback;
26595 c_line = __Pyx_CLineForTraceback(tstate, c_line);
26597 py_code = __pyx_find_code_object(c_line ? -c_line : py_line);
26599 __Pyx_ErrFetchInState(tstate, &ptype, &pvalue, &ptraceback);
26600 py_code = __Pyx_CreateCodeObjectForTraceback(
26601 funcname, c_line, py_line, filename);
26606 Py_XDECREF(pvalue);
26607 Py_XDECREF(ptraceback);
26610 __Pyx_ErrRestoreInState(tstate, ptype, pvalue, ptraceback);
26611 __pyx_insert_code_object(c_line ? -c_line : py_line, py_code);
26613 py_frame = PyFrame_New(
26619 if (!py_frame)
goto bad;
26620 __Pyx_PyFrame_SetLineNumber(py_frame, py_line);
26621 PyTraceBack_Here(py_frame);
26623 Py_XDECREF(py_code);
26624 Py_XDECREF(py_frame);
26627 #if PY_MAJOR_VERSION < 3
26628 static int __Pyx_GetBuffer(PyObject *obj, Py_buffer *view,
int flags) {
26629 if (PyObject_CheckBuffer(obj))
return PyObject_GetBuffer(obj, view, flags);
26630 if (__Pyx_TypeCheck(obj, __pyx_array_type))
return __pyx_array_getbuffer(obj, view, flags);
26631 if (__Pyx_TypeCheck(obj, __pyx_memoryview_type))
return __pyx_memoryview_getbuffer(obj, view, flags);
26632 PyErr_Format(PyExc_TypeError,
"'%.200s' does not have the buffer interface", Py_TYPE(obj)->tp_name);
26635 static void __Pyx_ReleaseBuffer(Py_buffer *view) {
26636 PyObject *obj = view->obj;
26638 if (PyObject_CheckBuffer(obj)) {
26639 PyBuffer_Release(view);
26651 __pyx_memviewslice_is_contig(
const __Pyx_memviewslice mvs,
char order,
int ndim)
26653 int i, index, step, start;
26654 Py_ssize_t itemsize = mvs.memview->view.itemsize;
26655 if (order ==
'F') {
26662 for (i = 0; i < ndim; i++) {
26663 index = start + step * i;
26664 if (mvs.suboffsets[index] >= 0 || mvs.strides[index] != itemsize)
26666 itemsize *= mvs.shape[index];
26673 __pyx_get_array_memory_extents(__Pyx_memviewslice *slice,
26674 void **out_start,
void **out_end,
26675 int ndim,
size_t itemsize)
26679 start = end = slice->data;
26680 for (i = 0; i < ndim; i++) {
26681 Py_ssize_t stride = slice->strides[i];
26682 Py_ssize_t extent = slice->shape[i];
26684 *out_start = *out_end = start;
26688 end += stride * (extent - 1);
26690 start += stride * (extent - 1);
26693 *out_start = start;
26694 *out_end = end + itemsize;
26697 __pyx_slices_overlap(__Pyx_memviewslice *slice1,
26698 __Pyx_memviewslice *slice2,
26699 int ndim,
size_t itemsize)
26701 void *start1, *end1, *start2, *end2;
26702 __pyx_get_array_memory_extents(slice1, &start1, &end1, ndim, itemsize);
26703 __pyx_get_array_memory_extents(slice2, &start2, &end2, ndim, itemsize);
26704 return (start1 < end2) && (start2 < end1);
26708 static CYTHON_INLINE PyObject *
26709 __pyx_capsule_create(
void *p, CYTHON_UNUSED
const char *sig)
26712 #if PY_VERSION_HEX >= 0x02070000
26713 cobj = PyCapsule_New(p, sig, NULL);
26715 cobj = PyCObject_FromVoidPtr(p, NULL);
26721 #define __PYX_VERIFY_RETURN_INT(target_type, func_type, func_value)\
26722 __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 0)
26723 #define __PYX_VERIFY_RETURN_INT_EXC(target_type, func_type, func_value)\
26724 __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 1)
26725 #define __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, exc)\
26727 func_type value = func_value;\
26728 if (sizeof(target_type) < sizeof(func_type)) {\
26729 if (unlikely(value != (func_type) (target_type) value)) {\
26730 func_type zero = 0;\
26731 if (exc && unlikely(value == (func_type)-1 && PyErr_Occurred()))\
26732 return (target_type) -1;\
26733 if (is_unsigned && unlikely(value < zero))\
26734 goto raise_neg_overflow;\
26736 goto raise_overflow;\
26739 return (target_type) value;\
26743 static CYTHON_INLINE
int __Pyx_Is_Little_Endian(
void)
26749 S.u32 = 0x01020304;
26750 return S.u8[0] == 4;
26754 static void __Pyx_BufFmt_Init(__Pyx_BufFmt_Context* ctx,
26755 __Pyx_BufFmt_StackElem* stack,
26756 __Pyx_TypeInfo* type) {
26757 stack[0].field = &ctx->root;
26758 stack[0].parent_offset = 0;
26759 ctx->root.type = type;
26760 ctx->root.name =
"buffer dtype";
26761 ctx->root.offset = 0;
26763 ctx->head->field = &ctx->root;
26764 ctx->fmt_offset = 0;
26765 ctx->head->parent_offset = 0;
26766 ctx->new_packmode =
'@';
26767 ctx->enc_packmode =
'@';
26768 ctx->new_count = 1;
26769 ctx->enc_count = 0;
26771 ctx->is_complex = 0;
26772 ctx->is_valid_array = 0;
26773 ctx->struct_alignment = 0;
26774 while (type->typegroup ==
'S') {
26776 ctx->head->field = type->fields;
26777 ctx->head->parent_offset = 0;
26778 type = type->fields->type;
26781 static int __Pyx_BufFmt_ParseNumber(
const char** ts) {
26783 const char* t = *ts;
26784 if (*t < '0' || *t >
'9') {
26787 count = *t++ -
'0';
26788 while (*t >=
'0' && *t <=
'9') {
26790 count += *t++ -
'0';
26796 static int __Pyx_BufFmt_ExpectNumber(
const char **ts) {
26797 int number = __Pyx_BufFmt_ParseNumber(ts);
26799 PyErr_Format(PyExc_ValueError,\
26800 "Does not understand character buffer dtype format string ('%c')", **ts);
26803 static void __Pyx_BufFmt_RaiseUnexpectedChar(
char ch) {
26804 PyErr_Format(PyExc_ValueError,
26805 "Unexpected format string character: '%c'", ch);
26807 static const char* __Pyx_BufFmt_DescribeTypeChar(
char ch,
int is_complex) {
26809 case '?':
return "'bool'";
26810 case 'c':
return "'char'";
26811 case 'b':
return "'signed char'";
26812 case 'B':
return "'unsigned char'";
26813 case 'h':
return "'short'";
26814 case 'H':
return "'unsigned short'";
26815 case 'i':
return "'int'";
26816 case 'I':
return "'unsigned int'";
26817 case 'l':
return "'long'";
26818 case 'L':
return "'unsigned long'";
26819 case 'q':
return "'long long'";
26820 case 'Q':
return "'unsigned long long'";
26821 case 'f':
return (is_complex ?
"'complex float'" :
"'float'");
26822 case 'd':
return (is_complex ?
"'complex double'" :
"'double'");
26823 case 'g':
return (is_complex ?
"'complex long double'" :
"'long double'");
26824 case 'T':
return "a struct";
26825 case 'O':
return "Python object";
26826 case 'P':
return "a pointer";
26827 case 's':
case 'p':
return "a string";
26828 case 0:
return "end";
26829 default:
return "unparseable format string";
26832 static size_t __Pyx_BufFmt_TypeCharToStandardSize(
char ch,
int is_complex) {
26834 case '?':
case 'c':
case 'b':
case 'B':
case 's':
case 'p':
return 1;
26835 case 'h':
case 'H':
return 2;
26836 case 'i':
case 'I':
case 'l':
case 'L':
return 4;
26837 case 'q':
case 'Q':
return 8;
26838 case 'f':
return (is_complex ? 8 : 4);
26839 case 'd':
return (is_complex ? 16 : 8);
26841 PyErr_SetString(PyExc_ValueError,
"Python does not define a standard format string size for long double ('g')..");
26844 case 'O':
case 'P':
return sizeof(
void*);
26846 __Pyx_BufFmt_RaiseUnexpectedChar(ch);
26850 static size_t __Pyx_BufFmt_TypeCharToNativeSize(
char ch,
int is_complex) {
26852 case '?':
case 'c':
case 'b':
case 'B':
case 's':
case 'p':
return 1;
26853 case 'h':
case 'H':
return sizeof(short);
26854 case 'i':
case 'I':
return sizeof(int);
26855 case 'l':
case 'L':
return sizeof(long);
26856 #ifdef HAVE_LONG_LONG
26857 case 'q':
case 'Q':
return sizeof(PY_LONG_LONG);
26859 case 'f':
return sizeof(float) * (is_complex ? 2 : 1);
26860 case 'd':
return sizeof(double) * (is_complex ? 2 : 1);
26861 case 'g':
return sizeof(
long double) * (is_complex ? 2 : 1);
26862 case 'O':
case 'P':
return sizeof(
void*);
26864 __Pyx_BufFmt_RaiseUnexpectedChar(ch);
26869 typedef struct {
char c;
short x; } __Pyx_st_short;
26870 typedef struct {
char c;
int x; } __Pyx_st_int;
26871 typedef struct {
char c;
long x; } __Pyx_st_long;
26872 typedef struct {
char c;
float x; } __Pyx_st_float;
26873 typedef struct {
char c;
double x; } __Pyx_st_double;
26874 typedef struct {
char c;
long double x; } __Pyx_st_longdouble;
26875 typedef struct {
char c;
void *x; } __Pyx_st_void_p;
26876 #ifdef HAVE_LONG_LONG
26877 typedef struct {
char c; PY_LONG_LONG x; } __Pyx_st_longlong;
26879 static size_t __Pyx_BufFmt_TypeCharToAlignment(
char ch, CYTHON_UNUSED
int is_complex) {
26881 case '?':
case 'c':
case 'b':
case 'B':
case 's':
case 'p':
return 1;
26882 case 'h':
case 'H':
return sizeof(__Pyx_st_short) -
sizeof(
short);
26883 case 'i':
case 'I':
return sizeof(__Pyx_st_int) -
sizeof(
int);
26884 case 'l':
case 'L':
return sizeof(__Pyx_st_long) -
sizeof(
long);
26885 #ifdef HAVE_LONG_LONG
26886 case 'q':
case 'Q':
return sizeof(__Pyx_st_longlong) -
sizeof(PY_LONG_LONG);
26888 case 'f':
return sizeof(__Pyx_st_float) -
sizeof(
float);
26889 case 'd':
return sizeof(__Pyx_st_double) -
sizeof(
double);
26890 case 'g':
return sizeof(__Pyx_st_longdouble) -
sizeof(
long double);
26891 case 'P':
case 'O':
return sizeof(__Pyx_st_void_p) -
sizeof(
void*);
26893 __Pyx_BufFmt_RaiseUnexpectedChar(ch);
26901 typedef struct {
short x;
char c; } __Pyx_pad_short;
26902 typedef struct {
int x;
char c; } __Pyx_pad_int;
26903 typedef struct {
long x;
char c; } __Pyx_pad_long;
26904 typedef struct {
float x;
char c; } __Pyx_pad_float;
26905 typedef struct {
double x;
char c; } __Pyx_pad_double;
26906 typedef struct {
long double x;
char c; } __Pyx_pad_longdouble;
26907 typedef struct {
void *x;
char c; } __Pyx_pad_void_p;
26908 #ifdef HAVE_LONG_LONG
26909 typedef struct { PY_LONG_LONG x;
char c; } __Pyx_pad_longlong;
26911 static size_t __Pyx_BufFmt_TypeCharToPadding(
char ch, CYTHON_UNUSED
int is_complex) {
26913 case '?':
case 'c':
case 'b':
case 'B':
case 's':
case 'p':
return 1;
26914 case 'h':
case 'H':
return sizeof(__Pyx_pad_short) -
sizeof(
short);
26915 case 'i':
case 'I':
return sizeof(__Pyx_pad_int) -
sizeof(
int);
26916 case 'l':
case 'L':
return sizeof(__Pyx_pad_long) -
sizeof(
long);
26917 #ifdef HAVE_LONG_LONG
26918 case 'q':
case 'Q':
return sizeof(__Pyx_pad_longlong) -
sizeof(PY_LONG_LONG);
26920 case 'f':
return sizeof(__Pyx_pad_float) -
sizeof(
float);
26921 case 'd':
return sizeof(__Pyx_pad_double) -
sizeof(
double);
26922 case 'g':
return sizeof(__Pyx_pad_longdouble) -
sizeof(
long double);
26923 case 'P':
case 'O':
return sizeof(__Pyx_pad_void_p) -
sizeof(
void*);
26925 __Pyx_BufFmt_RaiseUnexpectedChar(ch);
26929 static char __Pyx_BufFmt_TypeCharToGroup(
char ch,
int is_complex) {
26933 case 'b':
case 'h':
case 'i':
26934 case 'l':
case 'q':
case 's':
case 'p':
26936 case '?':
case 'B':
case 'H':
case 'I':
case 'L':
case 'Q':
26938 case 'f':
case 'd':
case 'g':
26939 return (is_complex ?
'C' :
'R');
26945 __Pyx_BufFmt_RaiseUnexpectedChar(ch);
26950 static void __Pyx_BufFmt_RaiseExpected(__Pyx_BufFmt_Context* ctx) {
26951 if (ctx->head == NULL || ctx->head->field == &ctx->root) {
26952 const char* expected;
26954 if (ctx->head == NULL) {
26958 expected = ctx->head->field->type->name;
26961 PyErr_Format(PyExc_ValueError,
26962 "Buffer dtype mismatch, expected %s%s%s but got %s",
26963 quote, expected, quote,
26964 __Pyx_BufFmt_DescribeTypeChar(ctx->enc_type, ctx->is_complex));
26966 __Pyx_StructField* field = ctx->head->field;
26967 __Pyx_StructField* parent = (ctx->head - 1)->field;
26968 PyErr_Format(PyExc_ValueError,
26969 "Buffer dtype mismatch, expected '%s' but got %s in '%s.%s'",
26970 field->type->name, __Pyx_BufFmt_DescribeTypeChar(ctx->enc_type, ctx->is_complex),
26971 parent->type->name, field->name);
26974 static int __Pyx_BufFmt_ProcessTypeChunk(__Pyx_BufFmt_Context* ctx) {
26976 size_t size, offset, arraysize = 1;
26977 if (ctx->enc_type == 0)
return 0;
26978 if (ctx->head->field->type->arraysize[0]) {
26980 if (ctx->enc_type ==
's' || ctx->enc_type ==
'p') {
26981 ctx->is_valid_array = ctx->head->field->type->ndim == 1;
26983 if (ctx->enc_count != ctx->head->field->type->arraysize[0]) {
26984 PyErr_Format(PyExc_ValueError,
26985 "Expected a dimension of size %zu, got %zu",
26986 ctx->head->field->type->arraysize[0], ctx->enc_count);
26990 if (!ctx->is_valid_array) {
26991 PyErr_Format(PyExc_ValueError,
"Expected %d dimensions, got %d",
26992 ctx->head->field->type->ndim, ndim);
26995 for (i = 0; i < ctx->head->field->type->ndim; i++) {
26996 arraysize *= ctx->head->field->type->arraysize[i];
26998 ctx->is_valid_array = 0;
26999 ctx->enc_count = 1;
27001 group = __Pyx_BufFmt_TypeCharToGroup(ctx->enc_type, ctx->is_complex);
27003 __Pyx_StructField* field = ctx->head->field;
27004 __Pyx_TypeInfo* type = field->type;
27005 if (ctx->enc_packmode ==
'@' || ctx->enc_packmode ==
'^') {
27006 size = __Pyx_BufFmt_TypeCharToNativeSize(ctx->enc_type, ctx->is_complex);
27008 size = __Pyx_BufFmt_TypeCharToStandardSize(ctx->enc_type, ctx->is_complex);
27010 if (ctx->enc_packmode ==
'@') {
27011 size_t align_at = __Pyx_BufFmt_TypeCharToAlignment(ctx->enc_type, ctx->is_complex);
27012 size_t align_mod_offset;
27013 if (align_at == 0)
return -1;
27014 align_mod_offset = ctx->fmt_offset % align_at;
27015 if (align_mod_offset > 0) ctx->fmt_offset += align_at - align_mod_offset;
27016 if (ctx->struct_alignment == 0)
27017 ctx->struct_alignment = __Pyx_BufFmt_TypeCharToPadding(ctx->enc_type,
27020 if (type->size != size || type->typegroup != group) {
27021 if (type->typegroup ==
'C' && type->fields != NULL) {
27022 size_t parent_offset = ctx->head->parent_offset + field->offset;
27024 ctx->head->field = type->fields;
27025 ctx->head->parent_offset = parent_offset;
27028 if ((type->typegroup ==
'H' || group ==
'H') && type->size == size) {
27030 __Pyx_BufFmt_RaiseExpected(ctx);
27034 offset = ctx->head->parent_offset + field->offset;
27035 if (ctx->fmt_offset != offset) {
27036 PyErr_Format(PyExc_ValueError,
27037 "Buffer dtype mismatch; next field is at offset %" CYTHON_FORMAT_SSIZE_T
"d but %" CYTHON_FORMAT_SSIZE_T
"d expected",
27038 (Py_ssize_t)ctx->fmt_offset, (Py_ssize_t)offset);
27041 ctx->fmt_offset += size;
27043 ctx->fmt_offset += (arraysize - 1) * size;
27046 if (field == &ctx->root) {
27048 if (ctx->enc_count != 0) {
27049 __Pyx_BufFmt_RaiseExpected(ctx);
27054 ctx->head->field = ++field;
27055 if (field->type == NULL) {
27057 field = ctx->head->field;
27059 }
else if (field->type->typegroup ==
'S') {
27060 size_t parent_offset = ctx->head->parent_offset + field->offset;
27061 if (field->type->fields->type == NULL)
continue;
27062 field = field->type->fields;
27064 ctx->head->field = field;
27065 ctx->head->parent_offset = parent_offset;
27071 }
while (ctx->enc_count);
27073 ctx->is_complex = 0;
27077 __pyx_buffmt_parse_array(__Pyx_BufFmt_Context* ctx,
const char** tsp)
27079 const char *ts = *tsp;
27080 int i = 0,
number, ndim;
27082 if (ctx->new_count != 1) {
27083 PyErr_SetString(PyExc_ValueError,
27084 "Cannot handle repeated arrays in format string");
27087 if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1)
return NULL;
27088 ndim = ctx->head->field->type->ndim;
27089 while (*ts && *ts !=
')') {
27091 case ' ':
case '\f':
case '\r':
case '\n':
case '\t':
case '\v':
continue;
27094 number = __Pyx_BufFmt_ExpectNumber(&ts);
27095 if (
number == -1)
return NULL;
27096 if (i < ndim && (
size_t)
number != ctx->head->field->type->arraysize[i])
27097 return PyErr_Format(PyExc_ValueError,
27098 "Expected a dimension of size %zu, got %d",
27099 ctx->head->field->type->arraysize[i],
number);
27100 if (*ts !=
',' && *ts !=
')')
27101 return PyErr_Format(PyExc_ValueError,
27102 "Expected a comma in format string, got '%c'", *ts);
27103 if (*ts ==
',') ts++;
27107 return PyErr_Format(PyExc_ValueError,
"Expected %d dimension(s), got %d",
27108 ctx->head->field->type->ndim, i);
27110 PyErr_SetString(PyExc_ValueError,
27111 "Unexpected end of format string, expected ')'");
27114 ctx->is_valid_array = 1;
27115 ctx->new_count = 1;
27119 static const char* __Pyx_BufFmt_CheckString(__Pyx_BufFmt_Context* ctx,
const char* ts) {
27124 if (ctx->enc_type != 0 && ctx->head == NULL) {
27125 __Pyx_BufFmt_RaiseExpected(ctx);
27128 if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1)
return NULL;
27129 if (ctx->head != NULL) {
27130 __Pyx_BufFmt_RaiseExpected(ctx);
27140 if (!__Pyx_Is_Little_Endian()) {
27141 PyErr_SetString(PyExc_ValueError,
"Little-endian buffer not supported on big-endian compiler");
27144 ctx->new_packmode =
'=';
27149 if (__Pyx_Is_Little_Endian()) {
27150 PyErr_SetString(PyExc_ValueError,
"Big-endian buffer not supported on little-endian compiler");
27153 ctx->new_packmode =
'=';
27159 ctx->new_packmode = *ts++;
27163 const char* ts_after_sub;
27164 size_t i, struct_count = ctx->new_count;
27165 size_t struct_alignment = ctx->struct_alignment;
27166 ctx->new_count = 1;
27169 PyErr_SetString(PyExc_ValueError,
"Buffer acquisition: Expected '{' after 'T'");
27172 if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1)
return NULL;
27174 ctx->enc_count = 0;
27175 ctx->struct_alignment = 0;
27178 for (i = 0; i != struct_count; ++i) {
27179 ts_after_sub = __Pyx_BufFmt_CheckString(ctx, ts);
27180 if (!ts_after_sub)
return NULL;
27183 if (struct_alignment) ctx->struct_alignment = struct_alignment;
27188 size_t alignment = ctx->struct_alignment;
27190 if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1)
return NULL;
27192 if (alignment && ctx->fmt_offset % alignment) {
27193 ctx->fmt_offset += alignment - (ctx->fmt_offset % alignment);
27198 if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1)
return NULL;
27199 ctx->fmt_offset += ctx->new_count;
27200 ctx->new_count = 1;
27201 ctx->enc_count = 0;
27203 ctx->enc_packmode = ctx->new_packmode;
27209 if (*ts !=
'f' && *ts !=
'd' && *ts !=
'g') {
27210 __Pyx_BufFmt_RaiseUnexpectedChar(
'Z');
27213 CYTHON_FALLTHROUGH;
27214 case '?':
case 'c':
case 'b':
case 'B':
case 'h':
case 'H':
case 'i':
case 'I':
27215 case 'l':
case 'L':
case 'q':
case 'Q':
27216 case 'f':
case 'd':
case 'g':
27217 case 'O':
case 'p':
27218 if ((ctx->enc_type == *ts) && (got_Z == ctx->is_complex) &&
27219 (ctx->enc_packmode == ctx->new_packmode) && (!ctx->is_valid_array)) {
27220 ctx->enc_count += ctx->new_count;
27221 ctx->new_count = 1;
27226 CYTHON_FALLTHROUGH;
27228 if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1)
return NULL;
27229 ctx->enc_count = ctx->new_count;
27230 ctx->enc_packmode = ctx->new_packmode;
27231 ctx->enc_type = *ts;
27232 ctx->is_complex = got_Z;
27234 ctx->new_count = 1;
27239 while(*ts !=
':') ++ts;
27243 if (!__pyx_buffmt_parse_array(ctx, &ts))
return NULL;
27247 int number = __Pyx_BufFmt_ExpectNumber(&ts);
27248 if (
number == -1)
return NULL;
27249 ctx->new_count = (size_t)
number;
27257 __pyx_typeinfo_cmp(__Pyx_TypeInfo *a, __Pyx_TypeInfo *b)
27264 if (a->size != b->size || a->typegroup != b->typegroup ||
27265 a->is_unsigned != b->is_unsigned || a->ndim != b->ndim) {
27266 if (a->typegroup ==
'H' || b->typegroup ==
'H') {
27267 return a->size == b->size;
27273 for (i = 0; i < a->ndim; i++)
27274 if (a->arraysize[i] != b->arraysize[i])
27277 if (a->typegroup ==
'S') {
27278 if (a->flags != b->flags)
27280 if (a->fields || b->fields) {
27281 if (!(a->fields && b->fields))
27283 for (i = 0; a->fields[i].type && b->fields[i].type; i++) {
27284 __Pyx_StructField *field_a = a->fields + i;
27285 __Pyx_StructField *field_b = b->fields + i;
27286 if (field_a->offset != field_b->offset ||
27287 !__pyx_typeinfo_cmp(field_a->type, field_b->type))
27290 return !a->fields[i].type && !b->fields[i].type;
27298 __pyx_check_strides(Py_buffer *buf,
int dim,
int ndim,
int spec)
27300 if (buf->shape[dim] <= 1)
27302 if (buf->strides) {
27303 if (spec & __Pyx_MEMVIEW_CONTIG) {
27304 if (spec & (__Pyx_MEMVIEW_PTR|__Pyx_MEMVIEW_FULL)) {
27305 if (unlikely(buf->strides[dim] !=
sizeof(
void *))) {
27306 PyErr_Format(PyExc_ValueError,
27307 "Buffer is not indirectly contiguous "
27308 "in dimension %d.", dim);
27311 }
else if (unlikely(buf->strides[dim] != buf->itemsize)) {
27312 PyErr_SetString(PyExc_ValueError,
27313 "Buffer and memoryview are not contiguous "
27314 "in the same dimension.");
27318 if (spec & __Pyx_MEMVIEW_FOLLOW) {
27319 Py_ssize_t stride = buf->strides[dim];
27322 if (unlikely(stride < buf->itemsize)) {
27323 PyErr_SetString(PyExc_ValueError,
27324 "Buffer and memoryview are not contiguous "
27325 "in the same dimension.");
27330 if (unlikely(spec & __Pyx_MEMVIEW_CONTIG && dim != ndim - 1)) {
27331 PyErr_Format(PyExc_ValueError,
27332 "C-contiguous buffer is not contiguous in "
27333 "dimension %d", dim);
27335 }
else if (unlikely(spec & (__Pyx_MEMVIEW_PTR))) {
27336 PyErr_Format(PyExc_ValueError,
27337 "C-contiguous buffer is not indirect in "
27338 "dimension %d", dim);
27340 }
else if (unlikely(buf->suboffsets)) {
27341 PyErr_SetString(PyExc_ValueError,
27342 "Buffer exposes suboffsets but no strides");
27351 __pyx_check_suboffsets(Py_buffer *buf,
int dim, CYTHON_UNUSED
int ndim,
int spec)
27353 if (spec & __Pyx_MEMVIEW_DIRECT) {
27354 if (unlikely(buf->suboffsets && buf->suboffsets[dim] >= 0)) {
27355 PyErr_Format(PyExc_ValueError,
27356 "Buffer not compatible with direct access "
27357 "in dimension %d.", dim);
27361 if (spec & __Pyx_MEMVIEW_PTR) {
27362 if (unlikely(!buf->suboffsets || (buf->suboffsets[dim] < 0))) {
27363 PyErr_Format(PyExc_ValueError,
27364 "Buffer is not indirectly accessible "
27365 "in dimension %d.", dim);
27374 __pyx_verify_contig(Py_buffer *buf,
int ndim,
int c_or_f_flag)
27377 if (c_or_f_flag & __Pyx_IS_F_CONTIG) {
27378 Py_ssize_t stride = 1;
27379 for (i = 0; i < ndim; i++) {
27380 if (unlikely(stride * buf->itemsize != buf->strides[i] && buf->shape[i] > 1)) {
27381 PyErr_SetString(PyExc_ValueError,
27382 "Buffer not fortran contiguous.");
27385 stride = stride * buf->shape[i];
27387 }
else if (c_or_f_flag & __Pyx_IS_C_CONTIG) {
27388 Py_ssize_t stride = 1;
27389 for (i = ndim - 1; i >- 1; i--) {
27390 if (unlikely(stride * buf->itemsize != buf->strides[i] && buf->shape[i] > 1)) {
27391 PyErr_SetString(PyExc_ValueError,
27392 "Buffer not C contiguous.");
27395 stride = stride * buf->shape[i];
27402 static int __Pyx_ValidateAndInit_memviewslice(
27407 __Pyx_TypeInfo *dtype,
27408 __Pyx_BufFmt_StackElem stack[],
27409 __Pyx_memviewslice *memviewslice,
27410 PyObject *original_obj)
27412 struct __pyx_memoryview_obj *memview, *new_memview;
27413 __Pyx_RefNannyDeclarations
27415 int i, spec = 0, retval = -1;
27416 __Pyx_BufFmt_Context ctx;
27417 int from_memoryview = __pyx_memoryview_check(original_obj);
27418 __Pyx_RefNannySetupContext(
"ValidateAndInit_memviewslice", 0);
27419 if (from_memoryview && __pyx_typeinfo_cmp(dtype, ((
struct __pyx_memoryview_obj *)
27420 original_obj)->typeinfo)) {
27421 memview = (
struct __pyx_memoryview_obj *) original_obj;
27422 new_memview = NULL;
27424 memview = (
struct __pyx_memoryview_obj *) __pyx_memoryview_new(
27425 original_obj, buf_flags, 0, dtype);
27426 new_memview = memview;
27427 if (unlikely(!memview))
27430 buf = &memview->view;
27431 if (unlikely(buf->ndim != ndim)) {
27432 PyErr_Format(PyExc_ValueError,
27433 "Buffer has wrong number of dimensions (expected %d, got %d)",
27438 __Pyx_BufFmt_Init(&ctx, stack, dtype);
27439 if (unlikely(!__Pyx_BufFmt_CheckString(&ctx, buf->format)))
goto fail;
27441 if (unlikely((
unsigned) buf->itemsize != dtype->size)) {
27442 PyErr_Format(PyExc_ValueError,
27443 "Item size of buffer (%" CYTHON_FORMAT_SSIZE_T
"u byte%s) "
27444 "does not match size of '%s' (%" CYTHON_FORMAT_SSIZE_T
"u byte%s)",
27446 (buf->itemsize > 1) ?
"s" :
"",
27449 (dtype->size > 1) ?
"s" :
"");
27452 if (buf->len > 0) {
27453 for (i = 0; i < ndim; i++) {
27454 spec = axes_specs[i];
27455 if (unlikely(!__pyx_check_strides(buf, i, ndim, spec)))
27457 if (unlikely(!__pyx_check_suboffsets(buf, i, ndim, spec)))
27460 if (unlikely(buf->strides && !__pyx_verify_contig(buf, ndim, c_or_f_flag)))
27463 if (unlikely(__Pyx_init_memviewslice(memview, ndim, memviewslice,
27464 new_memview != NULL) == -1)) {
27470 Py_XDECREF(new_memview);
27473 __Pyx_RefNannyFinishContext();
27478 static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_ds_double(PyObject *obj,
int writable_flag) {
27479 __Pyx_memviewslice result = { 0, 0, { 0 }, { 0 }, { 0 } };
27480 __Pyx_BufFmt_StackElem stack[1];
27481 int axes_specs[] = { (__Pyx_MEMVIEW_DIRECT | __Pyx_MEMVIEW_STRIDED) };
27483 if (obj == Py_None) {
27484 result.memview = (
struct __pyx_memoryview_obj *) Py_None;
27487 retcode = __Pyx_ValidateAndInit_memviewslice(axes_specs, 0,
27488 PyBUF_RECORDS_RO | writable_flag, 1,
27489 &__Pyx_TypeInfo_double, stack,
27491 if (unlikely(retcode == -1))
27495 result.memview = NULL;
27496 result.data = NULL;
27501 static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_ds_int(PyObject *obj,
int writable_flag) {
27502 __Pyx_memviewslice result = { 0, 0, { 0 }, { 0 }, { 0 } };
27503 __Pyx_BufFmt_StackElem stack[1];
27504 int axes_specs[] = { (__Pyx_MEMVIEW_DIRECT | __Pyx_MEMVIEW_STRIDED) };
27506 if (obj == Py_None) {
27507 result.memview = (
struct __pyx_memoryview_obj *) Py_None;
27510 retcode = __Pyx_ValidateAndInit_memviewslice(axes_specs, 0,
27511 PyBUF_RECORDS_RO | writable_flag, 1,
27512 &__Pyx_TypeInfo_int, stack,
27514 if (unlikely(retcode == -1))
27518 result.memview = NULL;
27519 result.data = NULL;
27524 #if CYTHON_CCOMPLEX
27526 static CYTHON_INLINE __pyx_t_float_complex __pyx_t_float_complex_from_parts(
float x,
float y) {
27527 return ::std::complex< float >(x, y);
27530 static CYTHON_INLINE __pyx_t_float_complex __pyx_t_float_complex_from_parts(
float x,
float y) {
27531 return x + y*(__pyx_t_float_complex)_Complex_I;
27535 static CYTHON_INLINE __pyx_t_float_complex __pyx_t_float_complex_from_parts(
float x,
float y) {
27536 __pyx_t_float_complex
z;
27544 #if CYTHON_CCOMPLEX
27546 static CYTHON_INLINE
int __Pyx_c_eq_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
27547 return (a.real == b.real) && (a.imag == b.imag);
27549 static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_sum_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
27550 __pyx_t_float_complex
z;
27551 z.real = a.real + b.real;
27552 z.imag = a.imag + b.imag;
27555 static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_diff_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
27556 __pyx_t_float_complex
z;
27557 z.real = a.real - b.real;
27558 z.imag = a.imag - b.imag;
27561 static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_prod_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
27562 __pyx_t_float_complex
z;
27563 z.real = a.real * b.real - a.imag * b.imag;
27564 z.imag = a.real * b.imag + a.imag * b.real;
27568 static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_quot_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
27570 return __pyx_t_float_complex_from_parts(a.real / b.real, a.imag / b.real);
27571 }
else if (fabsf(b.real) >= fabsf(b.imag)) {
27572 if (b.real == 0 && b.imag == 0) {
27573 return __pyx_t_float_complex_from_parts(a.real / b.real, a.imag / b.imag);
27575 float r = b.imag / b.real;
27576 float s = (float)(1.0) / (b.real + b.imag *
r);
27577 return __pyx_t_float_complex_from_parts(
27578 (a.real + a.imag *
r) *
s, (a.imag - a.real *
r) *
s);
27581 float r = b.real / b.imag;
27582 float s = (float)(1.0) / (b.imag + b.real *
r);
27583 return __pyx_t_float_complex_from_parts(
27584 (a.real *
r + a.imag) *
s, (a.imag *
r - a.real) *
s);
27588 static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_quot_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
27590 return __pyx_t_float_complex_from_parts(a.real / b.real, a.imag / b.real);
27592 float denom = b.real * b.real + b.imag * b.imag;
27593 return __pyx_t_float_complex_from_parts(
27594 (a.real * b.real + a.imag * b.imag) / denom,
27595 (a.imag * b.real - a.real * b.imag) / denom);
27599 static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_neg_float(__pyx_t_float_complex a) {
27600 __pyx_t_float_complex
z;
27605 static CYTHON_INLINE
int __Pyx_c_is_zero_float(__pyx_t_float_complex a) {
27606 return (a.real == 0) && (a.imag == 0);
27608 static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_conj_float(__pyx_t_float_complex a) {
27609 __pyx_t_float_complex
z;
27615 static CYTHON_INLINE
float __Pyx_c_abs_float(__pyx_t_float_complex
z) {
27616 #if !defined(HAVE_HYPOT) || defined(_MSC_VER)
27617 return sqrtf(
z.real*
z.real +
z.imag*
z.imag);
27619 return hypotf(
z.real,
z.imag);
27622 static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_pow_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
27623 __pyx_t_float_complex
z;
27624 float r, lnr, theta, z_r, z_theta;
27625 if (b.imag == 0 && b.real == (
int)b.real) {
27627 float denom = a.real * a.real + a.imag * a.imag;
27628 a.real = a.real / denom;
27629 a.imag = -a.imag / denom;
27632 switch ((
int)b.real) {
27640 return __Pyx_c_prod_float(a, a);
27642 z = __Pyx_c_prod_float(a, a);
27643 return __Pyx_c_prod_float(
z, a);
27645 z = __Pyx_c_prod_float(a, a);
27646 return __Pyx_c_prod_float(
z,
z);
27652 }
else if (b.imag == 0) {
27653 z.real = powf(a.real, b.real);
27656 }
else if (a.real > 0) {
27661 theta = atan2f(0.0, -1.0);
27664 r = __Pyx_c_abs_float(a);
27665 theta = atan2f(a.imag, a.real);
27668 z_r = expf(lnr * b.real - theta * b.imag);
27669 z_theta = theta * b.real + lnr * b.imag;
27670 z.real = z_r * cosf(z_theta);
27671 z.imag = z_r * sinf(z_theta);
27678 #if CYTHON_CCOMPLEX
27680 static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(
double x,
double y) {
27681 return ::std::complex< double >(x, y);
27684 static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(
double x,
double y) {
27685 return x + y*(__pyx_t_double_complex)_Complex_I;
27689 static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(
double x,
double y) {
27690 __pyx_t_double_complex
z;
27698 #if CYTHON_CCOMPLEX
27700 static CYTHON_INLINE
int __Pyx_c_eq_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
27701 return (a.real == b.real) && (a.imag == b.imag);
27703 static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_sum_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
27704 __pyx_t_double_complex
z;
27705 z.real = a.real + b.real;
27706 z.imag = a.imag + b.imag;
27709 static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_diff_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
27710 __pyx_t_double_complex
z;
27711 z.real = a.real - b.real;
27712 z.imag = a.imag - b.imag;
27715 static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_prod_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
27716 __pyx_t_double_complex
z;
27717 z.real = a.real * b.real - a.imag * b.imag;
27718 z.imag = a.real * b.imag + a.imag * b.real;
27722 static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_quot_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
27724 return __pyx_t_double_complex_from_parts(a.real / b.real, a.imag / b.real);
27725 }
else if (fabs(b.real) >= fabs(b.imag)) {
27726 if (b.real == 0 && b.imag == 0) {
27727 return __pyx_t_double_complex_from_parts(a.real / b.real, a.imag / b.imag);
27729 double r = b.imag / b.real;
27730 double s = (double)(1.0) / (b.real + b.imag *
r);
27731 return __pyx_t_double_complex_from_parts(
27732 (a.real + a.imag *
r) *
s, (a.imag - a.real *
r) *
s);
27735 double r = b.real / b.imag;
27736 double s = (double)(1.0) / (b.imag + b.real *
r);
27737 return __pyx_t_double_complex_from_parts(
27738 (a.real *
r + a.imag) *
s, (a.imag *
r - a.real) *
s);
27742 static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_quot_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
27744 return __pyx_t_double_complex_from_parts(a.real / b.real, a.imag / b.real);
27746 double denom = b.real * b.real + b.imag * b.imag;
27747 return __pyx_t_double_complex_from_parts(
27748 (a.real * b.real + a.imag * b.imag) / denom,
27749 (a.imag * b.real - a.real * b.imag) / denom);
27753 static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_neg_double(__pyx_t_double_complex a) {
27754 __pyx_t_double_complex
z;
27759 static CYTHON_INLINE
int __Pyx_c_is_zero_double(__pyx_t_double_complex a) {
27760 return (a.real == 0) && (a.imag == 0);
27762 static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_conj_double(__pyx_t_double_complex a) {
27763 __pyx_t_double_complex
z;
27769 static CYTHON_INLINE
double __Pyx_c_abs_double(__pyx_t_double_complex
z) {
27770 #if !defined(HAVE_HYPOT) || defined(_MSC_VER)
27771 return sqrt(
z.real*
z.real +
z.imag*
z.imag);
27773 return hypot(
z.real,
z.imag);
27776 static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_pow_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
27777 __pyx_t_double_complex
z;
27778 double r, lnr, theta, z_r, z_theta;
27779 if (b.imag == 0 && b.real == (
int)b.real) {
27781 double denom = a.real * a.real + a.imag * a.imag;
27782 a.real = a.real / denom;
27783 a.imag = -a.imag / denom;
27786 switch ((
int)b.real) {
27794 return __Pyx_c_prod_double(a, a);
27796 z = __Pyx_c_prod_double(a, a);
27797 return __Pyx_c_prod_double(
z, a);
27799 z = __Pyx_c_prod_double(a, a);
27800 return __Pyx_c_prod_double(
z,
z);
27806 }
else if (b.imag == 0) {
27807 z.real = pow(a.real, b.real);
27810 }
else if (a.real > 0) {
27815 theta = atan2(0.0, -1.0);
27818 r = __Pyx_c_abs_double(a);
27819 theta = atan2(a.imag, a.real);
27822 z_r = exp(lnr * b.real - theta * b.imag);
27823 z_theta = theta * b.real + lnr * b.imag;
27824 z.real = z_r * cos(z_theta);
27825 z.imag = z_r * sin(z_theta);
27832 static __Pyx_memviewslice
27833 __pyx_memoryview_copy_new_contig(
const __Pyx_memviewslice *from_mvs,
27834 const char *mode,
int ndim,
27835 size_t sizeof_dtype,
int contig_flag,
27836 int dtype_is_object)
27838 __Pyx_RefNannyDeclarations
27840 __Pyx_memviewslice new_mvs = { 0, 0, { 0 }, { 0 }, { 0 } };
27841 struct __pyx_memoryview_obj *from_memview = from_mvs->memview;
27842 Py_buffer *buf = &from_memview->view;
27843 PyObject *shape_tuple = NULL;
27844 PyObject *temp_int = NULL;
27845 struct __pyx_array_obj *array_obj = NULL;
27846 struct __pyx_memoryview_obj *memview_obj = NULL;
27847 __Pyx_RefNannySetupContext(
"__pyx_memoryview_copy_new_contig", 0);
27848 for (i = 0; i < ndim; i++) {
27849 if (unlikely(from_mvs->suboffsets[i] >= 0)) {
27850 PyErr_Format(PyExc_ValueError,
"Cannot copy memoryview slice with "
27851 "indirect dimensions (axis %d)", i);
27855 shape_tuple = PyTuple_New(ndim);
27856 if (unlikely(!shape_tuple)) {
27859 __Pyx_GOTREF(shape_tuple);
27860 for(i = 0; i < ndim; i++) {
27861 temp_int = PyInt_FromSsize_t(from_mvs->shape[i]);
27862 if(unlikely(!temp_int)) {
27865 PyTuple_SET_ITEM(shape_tuple, i, temp_int);
27869 array_obj = __pyx_array_new(shape_tuple, sizeof_dtype, buf->format, (
char *) mode, NULL);
27870 if (unlikely(!array_obj)) {
27873 __Pyx_GOTREF(array_obj);
27874 memview_obj = (
struct __pyx_memoryview_obj *) __pyx_memoryview_new(
27875 (PyObject *) array_obj, contig_flag,
27877 from_mvs->memview->typeinfo);
27878 if (unlikely(!memview_obj))
27880 if (unlikely(__Pyx_init_memviewslice(memview_obj, ndim, &new_mvs, 1) < 0))
27882 if (unlikely(__pyx_memoryview_copy_contents(*from_mvs, new_mvs, ndim, ndim,
27883 dtype_is_object) < 0))
27887 __Pyx_XDECREF(new_mvs.memview);
27888 new_mvs.memview = NULL;
27889 new_mvs.data = NULL;
27891 __Pyx_XDECREF(shape_tuple);
27892 __Pyx_XDECREF(temp_int);
27893 __Pyx_XDECREF(array_obj);
27894 __Pyx_RefNannyFinishContext();
27899 static CYTHON_INLINE
int __Pyx_PyInt_As_int(PyObject *x) {
27900 #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
27901 #pragma GCC diagnostic push
27902 #pragma GCC diagnostic ignored "-Wconversion"
27904 const int neg_one = (int) -1, const_zero = (
int) 0;
27905 #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
27906 #pragma GCC diagnostic pop
27908 const int is_unsigned = neg_one > const_zero;
27909 #if PY_MAJOR_VERSION < 3
27910 if (likely(PyInt_Check(x))) {
27911 if (
sizeof(
int) <
sizeof(long)) {
27912 __PYX_VERIFY_RETURN_INT(
int,
long, PyInt_AS_LONG(x))
27914 long val = PyInt_AS_LONG(x);
27915 if (is_unsigned && unlikely(val < 0)) {
27916 goto raise_neg_overflow;
27922 if (likely(PyLong_Check(x))) {
27924 #if CYTHON_USE_PYLONG_INTERNALS
27925 const digit* digits = ((PyLongObject*)x)->ob_digit;
27926 switch (Py_SIZE(x)) {
27927 case 0:
return (
int) 0;
27928 case 1: __PYX_VERIFY_RETURN_INT(
int, digit, digits[0])
27930 if (8 *
sizeof(
int) > 1 * PyLong_SHIFT) {
27931 if (8 *
sizeof(
unsigned long) > 2 * PyLong_SHIFT) {
27932 __PYX_VERIFY_RETURN_INT(
int,
unsigned long, (((((
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
27933 }
else if (8 *
sizeof(
int) >= 2 * PyLong_SHIFT) {
27934 return (
int) (((((int)digits[1]) << PyLong_SHIFT) | (
int)digits[0]));
27939 if (8 *
sizeof(
int) > 2 * PyLong_SHIFT) {
27940 if (8 *
sizeof(
unsigned long) > 3 * PyLong_SHIFT) {
27941 __PYX_VERIFY_RETURN_INT(
int,
unsigned long, (((((((
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
27942 }
else if (8 *
sizeof(
int) >= 3 * PyLong_SHIFT) {
27943 return (
int) (((((((int)digits[2]) << PyLong_SHIFT) | (
int)digits[1]) << PyLong_SHIFT) | (int)digits[0]));
27948 if (8 *
sizeof(
int) > 3 * PyLong_SHIFT) {
27949 if (8 *
sizeof(
unsigned long) > 4 * PyLong_SHIFT) {
27950 __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])))
27951 }
else if (8 *
sizeof(
int) >= 4 * PyLong_SHIFT) {
27952 return (
int) (((((((((int)digits[3]) << PyLong_SHIFT) | (
int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (
int)digits[0]));
27958 #if CYTHON_COMPILING_IN_CPYTHON
27959 if (unlikely(Py_SIZE(x) < 0)) {
27960 goto raise_neg_overflow;
27964 int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
27965 if (unlikely(result < 0))
27967 if (unlikely(result == 1))
27968 goto raise_neg_overflow;
27971 if (
sizeof(
int) <=
sizeof(
unsigned long)) {
27972 __PYX_VERIFY_RETURN_INT_EXC(
int,
unsigned long, PyLong_AsUnsignedLong(x))
27973 #ifdef HAVE_LONG_LONG
27974 }
else if (
sizeof(
int) <=
sizeof(
unsigned PY_LONG_LONG)) {
27975 __PYX_VERIFY_RETURN_INT_EXC(
int,
unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
27979 #if CYTHON_USE_PYLONG_INTERNALS
27980 const digit* digits = ((PyLongObject*)x)->ob_digit;
27981 switch (Py_SIZE(x)) {
27982 case 0:
return (
int) 0;
27983 case -1: __PYX_VERIFY_RETURN_INT(
int, sdigit, (sdigit) (-(sdigit)digits[0]))
27984 case 1: __PYX_VERIFY_RETURN_INT(
int, digit, +digits[0])
27986 if (8 *
sizeof(
int) - 1 > 1 * PyLong_SHIFT) {
27987 if (8 *
sizeof(
unsigned long) > 2 * PyLong_SHIFT) {
27988 __PYX_VERIFY_RETURN_INT(
int,
long, -(
long) (((((
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
27989 }
else if (8 *
sizeof(
int) - 1 > 2 * PyLong_SHIFT) {
27990 return (
int) (((int)-1)*(((((int)digits[1]) << PyLong_SHIFT) | (
int)digits[0])));
27995 if (8 *
sizeof(
int) > 1 * PyLong_SHIFT) {
27996 if (8 *
sizeof(
unsigned long) > 2 * PyLong_SHIFT) {
27997 __PYX_VERIFY_RETURN_INT(
int,
unsigned long, (((((
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
27998 }
else if (8 *
sizeof(
int) - 1 > 2 * PyLong_SHIFT) {
27999 return (
int) ((((((int)digits[1]) << PyLong_SHIFT) | (
int)digits[0])));
28004 if (8 *
sizeof(
int) - 1 > 2 * PyLong_SHIFT) {
28005 if (8 *
sizeof(
unsigned long) > 3 * PyLong_SHIFT) {
28006 __PYX_VERIFY_RETURN_INT(
int,
long, -(
long) (((((((
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
28007 }
else if (8 *
sizeof(
int) - 1 > 3 * PyLong_SHIFT) {
28008 return (
int) (((int)-1)*(((((((int)digits[2]) << PyLong_SHIFT) | (
int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
28013 if (8 *
sizeof(
int) > 2 * PyLong_SHIFT) {
28014 if (8 *
sizeof(
unsigned long) > 3 * PyLong_SHIFT) {
28015 __PYX_VERIFY_RETURN_INT(
int,
unsigned long, (((((((
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
28016 }
else if (8 *
sizeof(
int) - 1 > 3 * PyLong_SHIFT) {
28017 return (
int) ((((((((int)digits[2]) << PyLong_SHIFT) | (
int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
28022 if (8 *
sizeof(
int) - 1 > 3 * PyLong_SHIFT) {
28023 if (8 *
sizeof(
unsigned long) > 4 * PyLong_SHIFT) {
28024 __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])))
28025 }
else if (8 *
sizeof(
int) - 1 > 4 * PyLong_SHIFT) {
28026 return (
int) (((int)-1)*(((((((((int)digits[3]) << PyLong_SHIFT) | (
int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (
int)digits[0])));
28031 if (8 *
sizeof(
int) > 3 * PyLong_SHIFT) {
28032 if (8 *
sizeof(
unsigned long) > 4 * PyLong_SHIFT) {
28033 __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])))
28034 }
else if (8 *
sizeof(
int) - 1 > 4 * PyLong_SHIFT) {
28035 return (
int) ((((((((((int)digits[3]) << PyLong_SHIFT) | (
int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (
int)digits[0])));
28041 if (
sizeof(
int) <=
sizeof(long)) {
28042 __PYX_VERIFY_RETURN_INT_EXC(
int,
long, PyLong_AsLong(x))
28043 #ifdef HAVE_LONG_LONG
28044 }
else if (
sizeof(
int) <=
sizeof(PY_LONG_LONG)) {
28045 __PYX_VERIFY_RETURN_INT_EXC(
int, PY_LONG_LONG, PyLong_AsLongLong(x))
28050 #if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray)
28051 PyErr_SetString(PyExc_RuntimeError,
28052 "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers");
28055 PyObject *
v = __Pyx_PyNumber_IntOrLong(x);
28056 #if PY_MAJOR_VERSION < 3
28057 if (likely(
v) && !PyLong_Check(
v)) {
28059 v = PyNumber_Long(tmp);
28064 int one = 1;
int is_little = (int)*(
unsigned char *)&one;
28065 unsigned char *bytes = (
unsigned char *)&val;
28066 int ret = _PyLong_AsByteArray((PyLongObject *)
v,
28067 bytes,
sizeof(val),
28068 is_little, !is_unsigned);
28078 PyObject *tmp = __Pyx_PyNumber_IntOrLong(x);
28079 if (!tmp)
return (
int) -1;
28080 val = __Pyx_PyInt_As_int(tmp);
28085 PyErr_SetString(PyExc_OverflowError,
28086 "value too large to convert to int");
28088 raise_neg_overflow:
28089 PyErr_SetString(PyExc_OverflowError,
28090 "can't convert negative value to int");
28095 static CYTHON_INLINE
long __Pyx_PyInt_As_long(PyObject *x) {
28096 #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
28097 #pragma GCC diagnostic push
28098 #pragma GCC diagnostic ignored "-Wconversion"
28100 const long neg_one = (long) -1, const_zero = (
long) 0;
28101 #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
28102 #pragma GCC diagnostic pop
28104 const int is_unsigned = neg_one > const_zero;
28105 #if PY_MAJOR_VERSION < 3
28106 if (likely(PyInt_Check(x))) {
28107 if (
sizeof(
long) <
sizeof(long)) {
28108 __PYX_VERIFY_RETURN_INT(
long,
long, PyInt_AS_LONG(x))
28110 long val = PyInt_AS_LONG(x);
28111 if (is_unsigned && unlikely(val < 0)) {
28112 goto raise_neg_overflow;
28118 if (likely(PyLong_Check(x))) {
28120 #if CYTHON_USE_PYLONG_INTERNALS
28121 const digit* digits = ((PyLongObject*)x)->ob_digit;
28122 switch (Py_SIZE(x)) {
28123 case 0:
return (
long) 0;
28124 case 1: __PYX_VERIFY_RETURN_INT(
long, digit, digits[0])
28126 if (8 *
sizeof(
long) > 1 * PyLong_SHIFT) {
28127 if (8 *
sizeof(
unsigned long) > 2 * PyLong_SHIFT) {
28128 __PYX_VERIFY_RETURN_INT(
long,
unsigned long, (((((
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
28129 }
else if (8 *
sizeof(
long) >= 2 * PyLong_SHIFT) {
28130 return (
long) (((((long)digits[1]) << PyLong_SHIFT) | (
long)digits[0]));
28135 if (8 *
sizeof(
long) > 2 * PyLong_SHIFT) {
28136 if (8 *
sizeof(
unsigned long) > 3 * PyLong_SHIFT) {
28137 __PYX_VERIFY_RETURN_INT(
long,
unsigned long, (((((((
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
28138 }
else if (8 *
sizeof(
long) >= 3 * PyLong_SHIFT) {
28139 return (
long) (((((((long)digits[2]) << PyLong_SHIFT) | (
long)digits[1]) << PyLong_SHIFT) | (long)digits[0]));
28144 if (8 *
sizeof(
long) > 3 * PyLong_SHIFT) {
28145 if (8 *
sizeof(
unsigned long) > 4 * PyLong_SHIFT) {
28146 __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])))
28147 }
else if (8 *
sizeof(
long) >= 4 * PyLong_SHIFT) {
28148 return (
long) (((((((((long)digits[3]) << PyLong_SHIFT) | (
long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (
long)digits[0]));
28154 #if CYTHON_COMPILING_IN_CPYTHON
28155 if (unlikely(Py_SIZE(x) < 0)) {
28156 goto raise_neg_overflow;
28160 int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
28161 if (unlikely(result < 0))
28163 if (unlikely(result == 1))
28164 goto raise_neg_overflow;
28167 if (
sizeof(
long) <=
sizeof(
unsigned long)) {
28168 __PYX_VERIFY_RETURN_INT_EXC(
long,
unsigned long, PyLong_AsUnsignedLong(x))
28169 #ifdef HAVE_LONG_LONG
28170 }
else if (
sizeof(
long) <=
sizeof(
unsigned PY_LONG_LONG)) {
28171 __PYX_VERIFY_RETURN_INT_EXC(
long,
unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
28175 #if CYTHON_USE_PYLONG_INTERNALS
28176 const digit* digits = ((PyLongObject*)x)->ob_digit;
28177 switch (Py_SIZE(x)) {
28178 case 0:
return (
long) 0;
28179 case -1: __PYX_VERIFY_RETURN_INT(
long, sdigit, (sdigit) (-(sdigit)digits[0]))
28180 case 1: __PYX_VERIFY_RETURN_INT(
long, digit, +digits[0])
28182 if (8 *
sizeof(
long) - 1 > 1 * PyLong_SHIFT) {
28183 if (8 *
sizeof(
unsigned long) > 2 * PyLong_SHIFT) {
28184 __PYX_VERIFY_RETURN_INT(
long,
long, -(
long) (((((
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
28185 }
else if (8 *
sizeof(
long) - 1 > 2 * PyLong_SHIFT) {
28186 return (
long) (((long)-1)*(((((long)digits[1]) << PyLong_SHIFT) | (
long)digits[0])));
28191 if (8 *
sizeof(
long) > 1 * PyLong_SHIFT) {
28192 if (8 *
sizeof(
unsigned long) > 2 * PyLong_SHIFT) {
28193 __PYX_VERIFY_RETURN_INT(
long,
unsigned long, (((((
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
28194 }
else if (8 *
sizeof(
long) - 1 > 2 * PyLong_SHIFT) {
28195 return (
long) ((((((long)digits[1]) << PyLong_SHIFT) | (
long)digits[0])));
28200 if (8 *
sizeof(
long) - 1 > 2 * PyLong_SHIFT) {
28201 if (8 *
sizeof(
unsigned long) > 3 * PyLong_SHIFT) {
28202 __PYX_VERIFY_RETURN_INT(
long,
long, -(
long) (((((((
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
28203 }
else if (8 *
sizeof(
long) - 1 > 3 * PyLong_SHIFT) {
28204 return (
long) (((long)-1)*(((((((long)digits[2]) << PyLong_SHIFT) | (
long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
28209 if (8 *
sizeof(
long) > 2 * PyLong_SHIFT) {
28210 if (8 *
sizeof(
unsigned long) > 3 * PyLong_SHIFT) {
28211 __PYX_VERIFY_RETURN_INT(
long,
unsigned long, (((((((
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
28212 }
else if (8 *
sizeof(
long) - 1 > 3 * PyLong_SHIFT) {
28213 return (
long) ((((((((long)digits[2]) << PyLong_SHIFT) | (
long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
28218 if (8 *
sizeof(
long) - 1 > 3 * PyLong_SHIFT) {
28219 if (8 *
sizeof(
unsigned long) > 4 * PyLong_SHIFT) {
28220 __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])))
28221 }
else if (8 *
sizeof(
long) - 1 > 4 * PyLong_SHIFT) {
28222 return (
long) (((long)-1)*(((((((((long)digits[3]) << PyLong_SHIFT) | (
long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (
long)digits[0])));
28227 if (8 *
sizeof(
long) > 3 * PyLong_SHIFT) {
28228 if (8 *
sizeof(
unsigned long) > 4 * PyLong_SHIFT) {
28229 __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])))
28230 }
else if (8 *
sizeof(
long) - 1 > 4 * PyLong_SHIFT) {
28231 return (
long) ((((((((((long)digits[3]) << PyLong_SHIFT) | (
long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (
long)digits[0])));
28237 if (
sizeof(
long) <=
sizeof(long)) {
28238 __PYX_VERIFY_RETURN_INT_EXC(
long,
long, PyLong_AsLong(x))
28239 #ifdef HAVE_LONG_LONG
28240 }
else if (
sizeof(
long) <=
sizeof(PY_LONG_LONG)) {
28241 __PYX_VERIFY_RETURN_INT_EXC(
long, PY_LONG_LONG, PyLong_AsLongLong(x))
28246 #if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray)
28247 PyErr_SetString(PyExc_RuntimeError,
28248 "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers");
28251 PyObject *
v = __Pyx_PyNumber_IntOrLong(x);
28252 #if PY_MAJOR_VERSION < 3
28253 if (likely(
v) && !PyLong_Check(
v)) {
28255 v = PyNumber_Long(tmp);
28260 int one = 1;
int is_little = (int)*(
unsigned char *)&one;
28261 unsigned char *bytes = (
unsigned char *)&val;
28262 int ret = _PyLong_AsByteArray((PyLongObject *)
v,
28263 bytes,
sizeof(val),
28264 is_little, !is_unsigned);
28274 PyObject *tmp = __Pyx_PyNumber_IntOrLong(x);
28275 if (!tmp)
return (
long) -1;
28276 val = __Pyx_PyInt_As_long(tmp);
28281 PyErr_SetString(PyExc_OverflowError,
28282 "value too large to convert to long");
28284 raise_neg_overflow:
28285 PyErr_SetString(PyExc_OverflowError,
28286 "can't convert negative value to long");
28291 static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(
int value) {
28292 #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
28293 #pragma GCC diagnostic push
28294 #pragma GCC diagnostic ignored "-Wconversion"
28296 const int neg_one = (int) -1, const_zero = (
int) 0;
28297 #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
28298 #pragma GCC diagnostic pop
28300 const int is_unsigned = neg_one > const_zero;
28302 if (
sizeof(
int) <
sizeof(long)) {
28303 return PyInt_FromLong((
long) value);
28304 }
else if (
sizeof(
int) <=
sizeof(
unsigned long)) {
28305 return PyLong_FromUnsignedLong((
unsigned long) value);
28306 #ifdef HAVE_LONG_LONG
28307 }
else if (
sizeof(
int) <=
sizeof(
unsigned PY_LONG_LONG)) {
28308 return PyLong_FromUnsignedLongLong((
unsigned PY_LONG_LONG) value);
28312 if (
sizeof(
int) <=
sizeof(
long)) {
28313 return PyInt_FromLong((
long) value);
28314 #ifdef HAVE_LONG_LONG
28315 }
else if (
sizeof(
int) <=
sizeof(PY_LONG_LONG)) {
28316 return PyLong_FromLongLong((PY_LONG_LONG) value);
28321 int one = 1;
int little = (int)*(
unsigned char *)&one;
28322 unsigned char *bytes = (
unsigned char *)&value;
28323 return _PyLong_FromByteArray(bytes,
sizeof(
int),
28324 little, !is_unsigned);
28329 static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(
long value) {
28330 #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
28331 #pragma GCC diagnostic push
28332 #pragma GCC diagnostic ignored "-Wconversion"
28334 const long neg_one = (long) -1, const_zero = (
long) 0;
28335 #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
28336 #pragma GCC diagnostic pop
28338 const int is_unsigned = neg_one > const_zero;
28340 if (
sizeof(
long) <
sizeof(long)) {
28341 return PyInt_FromLong((
long) value);
28342 }
else if (
sizeof(
long) <=
sizeof(
unsigned long)) {
28343 return PyLong_FromUnsignedLong((
unsigned long) value);
28344 #ifdef HAVE_LONG_LONG
28345 }
else if (
sizeof(
long) <=
sizeof(
unsigned PY_LONG_LONG)) {
28346 return PyLong_FromUnsignedLongLong((
unsigned PY_LONG_LONG) value);
28350 if (
sizeof(
long) <=
sizeof(
long)) {
28351 return PyInt_FromLong((
long) value);
28352 #ifdef HAVE_LONG_LONG
28353 }
else if (
sizeof(
long) <=
sizeof(PY_LONG_LONG)) {
28354 return PyLong_FromLongLong((PY_LONG_LONG) value);
28359 int one = 1;
int little = (int)*(
unsigned char *)&one;
28360 unsigned char *bytes = (
unsigned char *)&value;
28361 return _PyLong_FromByteArray(bytes,
sizeof(
long),
28362 little, !is_unsigned);
28367 static CYTHON_INLINE
char __Pyx_PyInt_As_char(PyObject *x) {
28368 #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
28369 #pragma GCC diagnostic push
28370 #pragma GCC diagnostic ignored "-Wconversion"
28372 const char neg_one = (char) -1, const_zero = (
char) 0;
28373 #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
28374 #pragma GCC diagnostic pop
28376 const int is_unsigned = neg_one > const_zero;
28377 #if PY_MAJOR_VERSION < 3
28378 if (likely(PyInt_Check(x))) {
28379 if (
sizeof(
char) <
sizeof(long)) {
28380 __PYX_VERIFY_RETURN_INT(
char,
long, PyInt_AS_LONG(x))
28382 long val = PyInt_AS_LONG(x);
28383 if (is_unsigned && unlikely(val < 0)) {
28384 goto raise_neg_overflow;
28390 if (likely(PyLong_Check(x))) {
28392 #if CYTHON_USE_PYLONG_INTERNALS
28393 const digit* digits = ((PyLongObject*)x)->ob_digit;
28394 switch (Py_SIZE(x)) {
28395 case 0:
return (
char) 0;
28396 case 1: __PYX_VERIFY_RETURN_INT(
char, digit, digits[0])
28398 if (8 *
sizeof(
char) > 1 * PyLong_SHIFT) {
28399 if (8 *
sizeof(
unsigned long) > 2 * PyLong_SHIFT) {
28400 __PYX_VERIFY_RETURN_INT(
char,
unsigned long, (((((
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
28401 }
else if (8 *
sizeof(
char) >= 2 * PyLong_SHIFT) {
28402 return (
char) (((((char)digits[1]) << PyLong_SHIFT) | (
char)digits[0]));
28407 if (8 *
sizeof(
char) > 2 * PyLong_SHIFT) {
28408 if (8 *
sizeof(
unsigned long) > 3 * PyLong_SHIFT) {
28409 __PYX_VERIFY_RETURN_INT(
char,
unsigned long, (((((((
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
28410 }
else if (8 *
sizeof(
char) >= 3 * PyLong_SHIFT) {
28411 return (
char) (((((((char)digits[2]) << PyLong_SHIFT) | (
char)digits[1]) << PyLong_SHIFT) | (char)digits[0]));
28416 if (8 *
sizeof(
char) > 3 * PyLong_SHIFT) {
28417 if (8 *
sizeof(
unsigned long) > 4 * PyLong_SHIFT) {
28418 __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])))
28419 }
else if (8 *
sizeof(
char) >= 4 * PyLong_SHIFT) {
28420 return (
char) (((((((((char)digits[3]) << PyLong_SHIFT) | (
char)digits[2]) << PyLong_SHIFT) | (char)digits[1]) << PyLong_SHIFT) | (
char)digits[0]));
28426 #if CYTHON_COMPILING_IN_CPYTHON
28427 if (unlikely(Py_SIZE(x) < 0)) {
28428 goto raise_neg_overflow;
28432 int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
28433 if (unlikely(result < 0))
28435 if (unlikely(result == 1))
28436 goto raise_neg_overflow;
28439 if (
sizeof(
char) <=
sizeof(
unsigned long)) {
28440 __PYX_VERIFY_RETURN_INT_EXC(
char,
unsigned long, PyLong_AsUnsignedLong(x))
28441 #ifdef HAVE_LONG_LONG
28442 }
else if (
sizeof(
char) <=
sizeof(
unsigned PY_LONG_LONG)) {
28443 __PYX_VERIFY_RETURN_INT_EXC(
char,
unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
28447 #if CYTHON_USE_PYLONG_INTERNALS
28448 const digit* digits = ((PyLongObject*)x)->ob_digit;
28449 switch (Py_SIZE(x)) {
28450 case 0:
return (
char) 0;
28451 case -1: __PYX_VERIFY_RETURN_INT(
char, sdigit, (sdigit) (-(sdigit)digits[0]))
28452 case 1: __PYX_VERIFY_RETURN_INT(
char, digit, +digits[0])
28454 if (8 *
sizeof(
char) - 1 > 1 * PyLong_SHIFT) {
28455 if (8 *
sizeof(
unsigned long) > 2 * PyLong_SHIFT) {
28456 __PYX_VERIFY_RETURN_INT(
char,
long, -(
long) (((((
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
28457 }
else if (8 *
sizeof(
char) - 1 > 2 * PyLong_SHIFT) {
28458 return (
char) (((char)-1)*(((((char)digits[1]) << PyLong_SHIFT) | (
char)digits[0])));
28463 if (8 *
sizeof(
char) > 1 * PyLong_SHIFT) {
28464 if (8 *
sizeof(
unsigned long) > 2 * PyLong_SHIFT) {
28465 __PYX_VERIFY_RETURN_INT(
char,
unsigned long, (((((
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
28466 }
else if (8 *
sizeof(
char) - 1 > 2 * PyLong_SHIFT) {
28467 return (
char) ((((((char)digits[1]) << PyLong_SHIFT) | (
char)digits[0])));
28472 if (8 *
sizeof(
char) - 1 > 2 * PyLong_SHIFT) {
28473 if (8 *
sizeof(
unsigned long) > 3 * PyLong_SHIFT) {
28474 __PYX_VERIFY_RETURN_INT(
char,
long, -(
long) (((((((
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
28475 }
else if (8 *
sizeof(
char) - 1 > 3 * PyLong_SHIFT) {
28476 return (
char) (((char)-1)*(((((((char)digits[2]) << PyLong_SHIFT) | (
char)digits[1]) << PyLong_SHIFT) | (char)digits[0])));
28481 if (8 *
sizeof(
char) > 2 * PyLong_SHIFT) {
28482 if (8 *
sizeof(
unsigned long) > 3 * PyLong_SHIFT) {
28483 __PYX_VERIFY_RETURN_INT(
char,
unsigned long, (((((((
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
28484 }
else if (8 *
sizeof(
char) - 1 > 3 * PyLong_SHIFT) {
28485 return (
char) ((((((((char)digits[2]) << PyLong_SHIFT) | (
char)digits[1]) << PyLong_SHIFT) | (char)digits[0])));
28490 if (8 *
sizeof(
char) - 1 > 3 * PyLong_SHIFT) {
28491 if (8 *
sizeof(
unsigned long) > 4 * PyLong_SHIFT) {
28492 __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])))
28493 }
else if (8 *
sizeof(
char) - 1 > 4 * PyLong_SHIFT) {
28494 return (
char) (((char)-1)*(((((((((char)digits[3]) << PyLong_SHIFT) | (
char)digits[2]) << PyLong_SHIFT) | (char)digits[1]) << PyLong_SHIFT) | (
char)digits[0])));
28499 if (8 *
sizeof(
char) > 3 * PyLong_SHIFT) {
28500 if (8 *
sizeof(
unsigned long) > 4 * PyLong_SHIFT) {
28501 __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])))
28502 }
else if (8 *
sizeof(
char) - 1 > 4 * PyLong_SHIFT) {
28503 return (
char) ((((((((((char)digits[3]) << PyLong_SHIFT) | (
char)digits[2]) << PyLong_SHIFT) | (char)digits[1]) << PyLong_SHIFT) | (
char)digits[0])));
28509 if (
sizeof(
char) <=
sizeof(long)) {
28510 __PYX_VERIFY_RETURN_INT_EXC(
char,
long, PyLong_AsLong(x))
28511 #ifdef HAVE_LONG_LONG
28512 }
else if (
sizeof(
char) <=
sizeof(PY_LONG_LONG)) {
28513 __PYX_VERIFY_RETURN_INT_EXC(
char, PY_LONG_LONG, PyLong_AsLongLong(x))
28518 #if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray)
28519 PyErr_SetString(PyExc_RuntimeError,
28520 "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers");
28523 PyObject *
v = __Pyx_PyNumber_IntOrLong(x);
28524 #if PY_MAJOR_VERSION < 3
28525 if (likely(
v) && !PyLong_Check(
v)) {
28527 v = PyNumber_Long(tmp);
28532 int one = 1;
int is_little = (int)*(
unsigned char *)&one;
28533 unsigned char *bytes = (
unsigned char *)&val;
28534 int ret = _PyLong_AsByteArray((PyLongObject *)
v,
28535 bytes,
sizeof(val),
28536 is_little, !is_unsigned);
28546 PyObject *tmp = __Pyx_PyNumber_IntOrLong(x);
28547 if (!tmp)
return (
char) -1;
28548 val = __Pyx_PyInt_As_char(tmp);
28553 PyErr_SetString(PyExc_OverflowError,
28554 "value too large to convert to char");
28556 raise_neg_overflow:
28557 PyErr_SetString(PyExc_OverflowError,
28558 "can't convert negative value to char");
28563 static int __Pyx_check_binary_version(
void) {
28565 int same=1, i, found_dot;
28566 const char* rt_from_call = Py_GetVersion();
28567 PyOS_snprintf(ctversion, 5,
"%d.%d", PY_MAJOR_VERSION, PY_MINOR_VERSION);
28569 for (i = 0; i < 4; i++) {
28570 if (!ctversion[i]) {
28571 same = (rt_from_call[i] <
'0' || rt_from_call[i] >
'9');
28574 if (rt_from_call[i] != ctversion[i]) {
28580 char rtversion[5] = {
'\0'};
28582 for (i=0; i<4; ++i) {
28583 if (rt_from_call[i] ==
'.') {
28584 if (found_dot)
break;
28586 }
else if (rt_from_call[i] <
'0' || rt_from_call[i] >
'9') {
28589 rtversion[i] = rt_from_call[i];
28591 PyOS_snprintf(message,
sizeof(message),
28592 "compiletime version %s of module '%.100s' "
28593 "does not match runtime version %s",
28594 ctversion, __Pyx_MODULE_NAME, rtversion);
28595 return PyErr_WarnEx(NULL, message, 1);
28601 static int __Pyx_InitStrings(__Pyx_StringTabEntry *t) {
28603 #if PY_MAJOR_VERSION < 3
28604 if (t->is_unicode) {
28605 *t->p = PyUnicode_DecodeUTF8(t->s, t->n - 1, NULL);
28606 }
else if (t->intern) {
28607 *t->p = PyString_InternFromString(t->s);
28609 *t->p = PyString_FromStringAndSize(t->s, t->n - 1);
28612 if (t->is_unicode | t->is_str) {
28614 *t->p = PyUnicode_InternFromString(t->s);
28615 }
else if (t->encoding) {
28616 *t->p = PyUnicode_Decode(t->s, t->n - 1, t->encoding, NULL);
28618 *t->p = PyUnicode_FromStringAndSize(t->s, t->n - 1);
28621 *t->p = PyBytes_FromStringAndSize(t->s, t->n - 1);
28626 if (PyObject_Hash(*t->p) == -1)
28633 static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(
const char* c_str) {
28634 return __Pyx_PyUnicode_FromStringAndSize(c_str, (Py_ssize_t)strlen(c_str));
28636 static CYTHON_INLINE
const char* __Pyx_PyObject_AsString(PyObject* o) {
28638 return __Pyx_PyObject_AsStringAndSize(o, &ignore);
28640 #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT
28641 #if !CYTHON_PEP393_ENABLED
28642 static const char* __Pyx_PyUnicode_AsStringAndSize(PyObject* o, Py_ssize_t *length) {
28644 PyObject* defenc = _PyUnicode_AsDefaultEncodedString(o, NULL);
28645 if (!defenc)
return NULL;
28646 defenc_c = PyBytes_AS_STRING(defenc);
28647 #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
28649 char* end = defenc_c + PyBytes_GET_SIZE(defenc);
28651 for (
c = defenc_c;
c < end;
c++) {
28652 if ((
unsigned char) (*
c) >= 128) {
28653 PyUnicode_AsASCIIString(o);
28659 *length = PyBytes_GET_SIZE(defenc);
28663 static CYTHON_INLINE
const char* __Pyx_PyUnicode_AsStringAndSize(PyObject* o, Py_ssize_t *length) {
28664 if (unlikely(__Pyx_PyUnicode_READY(o) == -1))
return NULL;
28665 #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
28666 if (likely(PyUnicode_IS_ASCII(o))) {
28667 *length = PyUnicode_GET_LENGTH(o);
28668 return PyUnicode_AsUTF8(o);
28670 PyUnicode_AsASCIIString(o);
28674 return PyUnicode_AsUTF8AndSize(o, length);
28679 static CYTHON_INLINE
const char* __Pyx_PyObject_AsStringAndSize(PyObject* o, Py_ssize_t *length) {
28680 #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT
28682 #
if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
28683 __Pyx_sys_getdefaultencoding_not_ascii &&
28685 PyUnicode_Check(o)) {
28686 return __Pyx_PyUnicode_AsStringAndSize(o, length);
28689 #if (!CYTHON_COMPILING_IN_PYPY) || (defined(PyByteArray_AS_STRING) && defined(PyByteArray_GET_SIZE))
28690 if (PyByteArray_Check(o)) {
28691 *length = PyByteArray_GET_SIZE(o);
28692 return PyByteArray_AS_STRING(o);
28697 int r = PyBytes_AsStringAndSize(o, &result, length);
28698 if (unlikely(
r < 0)) {
28705 static CYTHON_INLINE
int __Pyx_PyObject_IsTrue(PyObject* x) {
28706 int is_true = x == Py_True;
28707 if (is_true | (x == Py_False) | (x == Py_None))
return is_true;
28708 else return PyObject_IsTrue(x);
28710 static CYTHON_INLINE
int __Pyx_PyObject_IsTrueAndDecref(PyObject* x) {
28712 if (unlikely(!x))
return -1;
28713 retval = __Pyx_PyObject_IsTrue(x);
28717 static PyObject* __Pyx_PyNumber_IntOrLongWrongResultType(PyObject* result,
const char* type_name) {
28718 #if PY_MAJOR_VERSION >= 3
28719 if (PyLong_Check(result)) {
28720 if (PyErr_WarnFormat(PyExc_DeprecationWarning, 1,
28721 "__int__ returned non-int (type %.200s). "
28722 "The ability to return an instance of a strict subclass of int "
28723 "is deprecated, and may be removed in a future version of Python.",
28724 Py_TYPE(result)->tp_name)) {
28731 PyErr_Format(PyExc_TypeError,
28732 "__%.4s__ returned non-%.4s (type %.200s)",
28733 type_name, type_name, Py_TYPE(result)->tp_name);
28737 static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x) {
28738 #if CYTHON_USE_TYPE_SLOTS
28739 PyNumberMethods *m;
28741 const char *name = NULL;
28742 PyObject *res = NULL;
28743 #if PY_MAJOR_VERSION < 3
28744 if (likely(PyInt_Check(x) || PyLong_Check(x)))
28746 if (likely(PyLong_Check(x)))
28748 return __Pyx_NewRef(x);
28749 #if CYTHON_USE_TYPE_SLOTS
28750 m = Py_TYPE(x)->tp_as_number;
28751 #if PY_MAJOR_VERSION < 3
28752 if (m && m->nb_int) {
28754 res = m->nb_int(x);
28756 else if (m && m->nb_long) {
28758 res = m->nb_long(x);
28761 if (likely(m && m->nb_int)) {
28763 res = m->nb_int(x);
28767 if (!PyBytes_CheckExact(x) && !PyUnicode_CheckExact(x)) {
28768 res = PyNumber_Int(x);
28772 #if PY_MAJOR_VERSION < 3
28773 if (unlikely(!PyInt_Check(res) && !PyLong_Check(res))) {
28775 if (unlikely(!PyLong_CheckExact(res))) {
28777 return __Pyx_PyNumber_IntOrLongWrongResultType(res, name);
28780 else if (!PyErr_Occurred()) {
28781 PyErr_SetString(PyExc_TypeError,
28782 "an integer is required");
28786 static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject* b) {
28789 #if PY_MAJOR_VERSION < 3
28790 if (likely(PyInt_CheckExact(b))) {
28791 if (
sizeof(Py_ssize_t) >=
sizeof(
long))
28792 return PyInt_AS_LONG(b);
28794 return PyInt_AsSsize_t(b);
28797 if (likely(PyLong_CheckExact(b))) {
28798 #if CYTHON_USE_PYLONG_INTERNALS
28799 const digit* digits = ((PyLongObject*)b)->ob_digit;
28800 const Py_ssize_t size = Py_SIZE(b);
28801 if (likely(__Pyx_sst_abs(size) <= 1)) {
28802 ival = likely(size) ? digits[0] : 0;
28803 if (size == -1) ival = -ival;
28808 if (8 *
sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) {
28809 return (Py_ssize_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (
size_t)digits[0]));
28813 if (8 *
sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) {
28814 return -(Py_ssize_t) (((((
size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
28818 if (8 *
sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) {
28819 return (Py_ssize_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (
size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
28823 if (8 *
sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) {
28824 return -(Py_ssize_t) (((((((
size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (
size_t)digits[0]));
28828 if (8 *
sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) {
28829 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]));
28833 if (8 *
sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) {
28834 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]));
28840 return PyLong_AsSsize_t(b);
28842 x = PyNumber_Index(b);
28844 ival = PyInt_AsSsize_t(x);
28848 static CYTHON_INLINE Py_hash_t __Pyx_PyIndex_AsHash_t(PyObject* o) {
28849 if (
sizeof(Py_hash_t) ==
sizeof(Py_ssize_t)) {
28850 return (Py_hash_t) __Pyx_PyIndex_AsSsize_t(o);
28851 #if PY_MAJOR_VERSION < 3
28852 }
else if (likely(PyInt_CheckExact(o))) {
28853 return PyInt_AS_LONG(o);
28858 x = PyNumber_Index(o);
28860 ival = PyInt_AsLong(x);
28865 static CYTHON_INLINE PyObject * __Pyx_PyBool_FromLong(
long b) {
28866 return b ? __Pyx_NewRef(Py_True) : __Pyx_NewRef(Py_False);
28868 static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(
size_t ival) {
28869 return PyInt_FromSize_t(ival);