3 #ifndef PY_SSIZE_T_CLEAN
4 #define PY_SSIZE_T_CLEAN
8 #error Python headers needed to compile C extensions, please install development version of Python.
9 #elif PY_VERSION_HEX < 0x02060000 || (0x03000000 <= PY_VERSION_HEX && PY_VERSION_HEX < 0x03030000)
10 #error Cython requires Python 2.6+ or Python 3.3+.
12 #define CYTHON_ABI "0_29_30"
13 #define CYTHON_HEX_VERSION 0x001D1EF0
14 #define CYTHON_FUTURE_DIVISION 0
17 #define offsetof(type, member) ( (size_t) & ((type*)0) -> member )
19 #if !defined(WIN32) && !defined(MS_WINDOWS)
31 #define DL_IMPORT(t) t
34 #define DL_EXPORT(t) t
37 #ifndef HAVE_LONG_LONG
38 #if PY_VERSION_HEX >= 0x02070000
39 #define HAVE_LONG_LONG
43 #define PY_LONG_LONG LONG_LONG
46 #define Py_HUGE_VAL HUGE_VAL
49 #define CYTHON_COMPILING_IN_PYPY 1
50 #define CYTHON_COMPILING_IN_PYSTON 0
51 #define CYTHON_COMPILING_IN_CPYTHON 0
52 #undef CYTHON_USE_TYPE_SLOTS
53 #define CYTHON_USE_TYPE_SLOTS 0
54 #undef CYTHON_USE_PYTYPE_LOOKUP
55 #define CYTHON_USE_PYTYPE_LOOKUP 0
56 #if PY_VERSION_HEX < 0x03050000
57 #undef CYTHON_USE_ASYNC_SLOTS
58 #define CYTHON_USE_ASYNC_SLOTS 0
59 #elif !defined(CYTHON_USE_ASYNC_SLOTS)
60 #define CYTHON_USE_ASYNC_SLOTS 1
62 #undef CYTHON_USE_PYLIST_INTERNALS
63 #define CYTHON_USE_PYLIST_INTERNALS 0
64 #undef CYTHON_USE_UNICODE_INTERNALS
65 #define CYTHON_USE_UNICODE_INTERNALS 0
66 #undef CYTHON_USE_UNICODE_WRITER
67 #define CYTHON_USE_UNICODE_WRITER 0
68 #undef CYTHON_USE_PYLONG_INTERNALS
69 #define CYTHON_USE_PYLONG_INTERNALS 0
70 #undef CYTHON_AVOID_BORROWED_REFS
71 #define CYTHON_AVOID_BORROWED_REFS 1
72 #undef CYTHON_ASSUME_SAFE_MACROS
73 #define CYTHON_ASSUME_SAFE_MACROS 0
74 #undef CYTHON_UNPACK_METHODS
75 #define CYTHON_UNPACK_METHODS 0
76 #undef CYTHON_FAST_THREAD_STATE
77 #define CYTHON_FAST_THREAD_STATE 0
78 #undef CYTHON_FAST_PYCALL
79 #define CYTHON_FAST_PYCALL 0
80 #undef CYTHON_PEP489_MULTI_PHASE_INIT
81 #define CYTHON_PEP489_MULTI_PHASE_INIT 0
82 #undef CYTHON_USE_TP_FINALIZE
83 #define CYTHON_USE_TP_FINALIZE 0
84 #undef CYTHON_USE_DICT_VERSIONS
85 #define CYTHON_USE_DICT_VERSIONS 0
86 #undef CYTHON_USE_EXC_INFO_STACK
87 #define CYTHON_USE_EXC_INFO_STACK 0
88 #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC
89 #define CYTHON_UPDATE_DESCRIPTOR_DOC (PYPY_VERSION_HEX >= 0x07030900)
91 #elif defined(PYSTON_VERSION)
92 #define CYTHON_COMPILING_IN_PYPY 0
93 #define CYTHON_COMPILING_IN_PYSTON 1
94 #define CYTHON_COMPILING_IN_CPYTHON 0
95 #ifndef CYTHON_USE_TYPE_SLOTS
96 #define CYTHON_USE_TYPE_SLOTS 1
98 #undef CYTHON_USE_PYTYPE_LOOKUP
99 #define CYTHON_USE_PYTYPE_LOOKUP 0
100 #undef CYTHON_USE_ASYNC_SLOTS
101 #define CYTHON_USE_ASYNC_SLOTS 0
102 #undef CYTHON_USE_PYLIST_INTERNALS
103 #define CYTHON_USE_PYLIST_INTERNALS 0
104 #ifndef CYTHON_USE_UNICODE_INTERNALS
105 #define CYTHON_USE_UNICODE_INTERNALS 1
107 #undef CYTHON_USE_UNICODE_WRITER
108 #define CYTHON_USE_UNICODE_WRITER 0
109 #undef CYTHON_USE_PYLONG_INTERNALS
110 #define CYTHON_USE_PYLONG_INTERNALS 0
111 #ifndef CYTHON_AVOID_BORROWED_REFS
112 #define CYTHON_AVOID_BORROWED_REFS 0
114 #ifndef CYTHON_ASSUME_SAFE_MACROS
115 #define CYTHON_ASSUME_SAFE_MACROS 1
117 #ifndef CYTHON_UNPACK_METHODS
118 #define CYTHON_UNPACK_METHODS 1
120 #undef CYTHON_FAST_THREAD_STATE
121 #define CYTHON_FAST_THREAD_STATE 0
122 #undef CYTHON_FAST_PYCALL
123 #define CYTHON_FAST_PYCALL 0
124 #undef CYTHON_PEP489_MULTI_PHASE_INIT
125 #define CYTHON_PEP489_MULTI_PHASE_INIT 0
126 #undef CYTHON_USE_TP_FINALIZE
127 #define CYTHON_USE_TP_FINALIZE 0
128 #undef CYTHON_USE_DICT_VERSIONS
129 #define CYTHON_USE_DICT_VERSIONS 0
130 #undef CYTHON_USE_EXC_INFO_STACK
131 #define CYTHON_USE_EXC_INFO_STACK 0
132 #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC
133 #define CYTHON_UPDATE_DESCRIPTOR_DOC 0
136 #define CYTHON_COMPILING_IN_PYPY 0
137 #define CYTHON_COMPILING_IN_PYSTON 0
138 #define CYTHON_COMPILING_IN_CPYTHON 1
139 #ifndef CYTHON_USE_TYPE_SLOTS
140 #define CYTHON_USE_TYPE_SLOTS 1
142 #if PY_VERSION_HEX < 0x02070000
143 #undef CYTHON_USE_PYTYPE_LOOKUP
144 #define CYTHON_USE_PYTYPE_LOOKUP 0
145 #elif !defined(CYTHON_USE_PYTYPE_LOOKUP)
146 #define CYTHON_USE_PYTYPE_LOOKUP 1
148 #if PY_MAJOR_VERSION < 3
149 #undef CYTHON_USE_ASYNC_SLOTS
150 #define CYTHON_USE_ASYNC_SLOTS 0
151 #elif !defined(CYTHON_USE_ASYNC_SLOTS)
152 #define CYTHON_USE_ASYNC_SLOTS 1
154 #if PY_VERSION_HEX < 0x02070000
155 #undef CYTHON_USE_PYLONG_INTERNALS
156 #define CYTHON_USE_PYLONG_INTERNALS 0
157 #elif !defined(CYTHON_USE_PYLONG_INTERNALS)
158 #define CYTHON_USE_PYLONG_INTERNALS 1
160 #ifndef CYTHON_USE_PYLIST_INTERNALS
161 #define CYTHON_USE_PYLIST_INTERNALS 1
163 #ifndef CYTHON_USE_UNICODE_INTERNALS
164 #define CYTHON_USE_UNICODE_INTERNALS 1
166 #if PY_VERSION_HEX < 0x030300F0 || PY_VERSION_HEX >= 0x030B00A2
167 #undef CYTHON_USE_UNICODE_WRITER
168 #define CYTHON_USE_UNICODE_WRITER 0
169 #elif !defined(CYTHON_USE_UNICODE_WRITER)
170 #define CYTHON_USE_UNICODE_WRITER 1
172 #ifndef CYTHON_AVOID_BORROWED_REFS
173 #define CYTHON_AVOID_BORROWED_REFS 0
175 #ifndef CYTHON_ASSUME_SAFE_MACROS
176 #define CYTHON_ASSUME_SAFE_MACROS 1
178 #ifndef CYTHON_UNPACK_METHODS
179 #define CYTHON_UNPACK_METHODS 1
181 #if PY_VERSION_HEX >= 0x030B00A4
182 #undef CYTHON_FAST_THREAD_STATE
183 #define CYTHON_FAST_THREAD_STATE 0
184 #elif !defined(CYTHON_FAST_THREAD_STATE)
185 #define CYTHON_FAST_THREAD_STATE 1
187 #ifndef CYTHON_FAST_PYCALL
188 #define CYTHON_FAST_PYCALL (PY_VERSION_HEX < 0x030A0000)
190 #ifndef CYTHON_PEP489_MULTI_PHASE_INIT
191 #define CYTHON_PEP489_MULTI_PHASE_INIT (PY_VERSION_HEX >= 0x03050000)
193 #ifndef CYTHON_USE_TP_FINALIZE
194 #define CYTHON_USE_TP_FINALIZE (PY_VERSION_HEX >= 0x030400a1)
196 #ifndef CYTHON_USE_DICT_VERSIONS
197 #define CYTHON_USE_DICT_VERSIONS (PY_VERSION_HEX >= 0x030600B1)
199 #if PY_VERSION_HEX >= 0x030B00A4
200 #undef CYTHON_USE_EXC_INFO_STACK
201 #define CYTHON_USE_EXC_INFO_STACK 0
202 #elif !defined(CYTHON_USE_EXC_INFO_STACK)
203 #define CYTHON_USE_EXC_INFO_STACK (PY_VERSION_HEX >= 0x030700A3)
205 #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC
206 #define CYTHON_UPDATE_DESCRIPTOR_DOC 1
209 #if !defined(CYTHON_FAST_PYCCALL)
210 #define CYTHON_FAST_PYCCALL (CYTHON_FAST_PYCALL && PY_VERSION_HEX >= 0x030600B1)
212 #if CYTHON_USE_PYLONG_INTERNALS
213 #if PY_MAJOR_VERSION < 3
214 #include "longintrepr.h"
220 enum { __pyx_check_sizeof_voidp = 1 / (int)(SIZEOF_VOID_P ==
sizeof(
void*)) };
223 #ifndef __has_attribute
224 #define __has_attribute(x) 0
226 #ifndef __has_cpp_attribute
227 #define __has_cpp_attribute(x) 0
229 #ifndef CYTHON_RESTRICT
230 #if defined(__GNUC__)
231 #define CYTHON_RESTRICT __restrict__
232 #elif defined(_MSC_VER) && _MSC_VER >= 1400
233 #define CYTHON_RESTRICT __restrict
234 #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
235 #define CYTHON_RESTRICT restrict
237 #define CYTHON_RESTRICT
240 #ifndef CYTHON_UNUSED
241 # if defined(__GNUC__)
242 # if !(defined(__cplusplus)) || (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4))
243 # define CYTHON_UNUSED __attribute__ ((__unused__))
245 # define CYTHON_UNUSED
247 # elif defined(__ICC) || (defined(__INTEL_COMPILER) && !defined(_MSC_VER))
248 # define CYTHON_UNUSED __attribute__ ((__unused__))
250 # define CYTHON_UNUSED
253 #ifndef CYTHON_MAYBE_UNUSED_VAR
254 # if defined(__cplusplus)
255 template<
class T>
void CYTHON_MAYBE_UNUSED_VAR(
const T& ) { }
257 # define CYTHON_MAYBE_UNUSED_VAR(x) (void)(x)
260 #ifndef CYTHON_NCP_UNUSED
261 # if CYTHON_COMPILING_IN_CPYTHON
262 # define CYTHON_NCP_UNUSED
264 # define CYTHON_NCP_UNUSED CYTHON_UNUSED
267 #define __Pyx_void_to_None(void_result) ((void)(void_result), Py_INCREF(Py_None), Py_None)
269 #ifndef _MSC_STDINT_H_
271 typedef unsigned char uint8_t;
272 typedef unsigned int uint32_t;
274 typedef unsigned __int8 uint8_t;
275 typedef unsigned __int32 uint32_t;
281 #ifndef CYTHON_FALLTHROUGH
282 #if defined(__cplusplus) && __cplusplus >= 201103L
283 #if __has_cpp_attribute(fallthrough)
284 #define CYTHON_FALLTHROUGH [[fallthrough]]
285 #elif __has_cpp_attribute(clang::fallthrough)
286 #define CYTHON_FALLTHROUGH [[clang::fallthrough]]
287 #elif __has_cpp_attribute(gnu::fallthrough)
288 #define CYTHON_FALLTHROUGH [[gnu::fallthrough]]
291 #ifndef CYTHON_FALLTHROUGH
292 #if __has_attribute(fallthrough)
293 #define CYTHON_FALLTHROUGH __attribute__((fallthrough))
295 #define CYTHON_FALLTHROUGH
298 #if defined(__clang__ ) && defined(__apple_build_version__)
299 #if __apple_build_version__ < 7000000
300 #undef CYTHON_FALLTHROUGH
301 #define CYTHON_FALLTHROUGH
307 #error "Cython files generated with the C++ option must be compiled with a C++ compiler."
309 #ifndef CYTHON_INLINE
310 #if defined(__clang__)
311 #define CYTHON_INLINE __inline__ __attribute__ ((__unused__))
313 #define CYTHON_INLINE inline
317 void __Pyx_call_destructor(
T& x) {
321 class __Pyx_FakeReference {
323 __Pyx_FakeReference() : ptr(NULL) { }
324 __Pyx_FakeReference(
const T& ref) : ptr(const_cast<
T*>(&ref)) { }
325 T *operator->() {
return ptr; }
326 T *operator&() {
return ptr; }
327 operator T&() {
return *ptr; }
328 template<
typename U>
bool operator ==(
U other) {
return *ptr == other; }
329 template<
typename U>
bool operator !=(
U other) {
return *ptr != other; }
334 #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x02070600 && !defined(Py_OptimizeFlag)
335 #define Py_OptimizeFlag 0
337 #define __PYX_BUILD_PY_SSIZE_T "n"
338 #define CYTHON_FORMAT_SSIZE_T "z"
339 #if PY_MAJOR_VERSION < 3
340 #define __Pyx_BUILTIN_MODULE_NAME "__builtin__"
341 #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\
342 PyCode_New(a+k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)
343 #define __Pyx_DefaultClassType PyClass_Type
345 #define __Pyx_BUILTIN_MODULE_NAME "builtins"
346 #define __Pyx_DefaultClassType PyType_Type
347 #if PY_VERSION_HEX >= 0x030B00A1
348 static CYTHON_INLINE PyCodeObject* __Pyx_PyCode_New(
int a,
int k,
int l,
int s,
int f,
349 PyObject *code, PyObject *
c, PyObject*
n, PyObject *
v,
350 PyObject *fv, PyObject *cell, PyObject* fn,
351 PyObject *name,
int fline, PyObject *lnos) {
352 PyObject *kwds=NULL, *argcount=NULL, *posonlyargcount=NULL, *kwonlyargcount=NULL;
353 PyObject *nlocals=NULL, *stacksize=NULL, *flags=NULL, *replace=NULL, *call_result=NULL, *empty=NULL;
354 const char *fn_cstr=NULL;
355 const char *name_cstr=NULL;
356 PyCodeObject* co=NULL;
357 PyObject *type, *value, *traceback;
358 PyErr_Fetch(&type, &value, &traceback);
359 if (!(kwds=PyDict_New()))
goto end;
360 if (!(argcount=PyLong_FromLong(a)))
goto end;
361 if (PyDict_SetItemString(kwds,
"co_argcount", argcount) != 0)
goto end;
362 if (!(posonlyargcount=PyLong_FromLong(0)))
goto end;
363 if (PyDict_SetItemString(kwds,
"co_posonlyargcount", posonlyargcount) != 0)
goto end;
364 if (!(kwonlyargcount=PyLong_FromLong(k)))
goto end;
365 if (PyDict_SetItemString(kwds,
"co_kwonlyargcount", kwonlyargcount) != 0)
goto end;
366 if (!(nlocals=PyLong_FromLong(l)))
goto end;
367 if (PyDict_SetItemString(kwds,
"co_nlocals", nlocals) != 0)
goto end;
368 if (!(stacksize=PyLong_FromLong(
s)))
goto end;
369 if (PyDict_SetItemString(kwds,
"co_stacksize", stacksize) != 0)
goto end;
370 if (!(flags=PyLong_FromLong(
f)))
goto end;
371 if (PyDict_SetItemString(kwds,
"co_flags", flags) != 0)
goto end;
372 if (PyDict_SetItemString(kwds,
"co_code", code) != 0)
goto end;
373 if (PyDict_SetItemString(kwds,
"co_consts",
c) != 0)
goto end;
374 if (PyDict_SetItemString(kwds,
"co_names",
n) != 0)
goto end;
375 if (PyDict_SetItemString(kwds,
"co_varnames",
v) != 0)
goto end;
376 if (PyDict_SetItemString(kwds,
"co_freevars", fv) != 0)
goto end;
377 if (PyDict_SetItemString(kwds,
"co_cellvars", cell) != 0)
goto end;
378 if (PyDict_SetItemString(kwds,
"co_linetable", lnos) != 0)
goto end;
379 if (!(fn_cstr=PyUnicode_AsUTF8AndSize(fn, NULL)))
goto end;
380 if (!(name_cstr=PyUnicode_AsUTF8AndSize(name, NULL)))
goto end;
381 if (!(co = PyCode_NewEmpty(fn_cstr, name_cstr, fline)))
goto end;
382 if (!(replace = PyObject_GetAttrString((PyObject*)co,
"replace")))
goto cleanup_code_too;
383 if (!(empty = PyTuple_New(0)))
goto cleanup_code_too;
384 if (!(call_result = PyObject_Call(replace, empty, kwds)))
goto cleanup_code_too;
385 Py_XDECREF((PyObject*)co);
386 co = (PyCodeObject*)call_result;
390 Py_XDECREF((PyObject*)co);
395 Py_XDECREF(argcount);
396 Py_XDECREF(posonlyargcount);
397 Py_XDECREF(kwonlyargcount);
399 Py_XDECREF(stacksize);
401 Py_XDECREF(call_result);
404 PyErr_Restore(type, value, traceback);
409 #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\
410 PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)
412 #define __Pyx_DefaultClassType PyType_Type
414 #ifndef Py_TPFLAGS_CHECKTYPES
415 #define Py_TPFLAGS_CHECKTYPES 0
417 #ifndef Py_TPFLAGS_HAVE_INDEX
418 #define Py_TPFLAGS_HAVE_INDEX 0
420 #ifndef Py_TPFLAGS_HAVE_NEWBUFFER
421 #define Py_TPFLAGS_HAVE_NEWBUFFER 0
423 #ifndef Py_TPFLAGS_HAVE_FINALIZE
424 #define Py_TPFLAGS_HAVE_FINALIZE 0
426 #ifndef METH_STACKLESS
427 #define METH_STACKLESS 0
429 #if PY_VERSION_HEX <= 0x030700A3 || !defined(METH_FASTCALL)
430 #ifndef METH_FASTCALL
431 #define METH_FASTCALL 0x80
433 typedef PyObject *(*__Pyx_PyCFunctionFast) (PyObject *
self, PyObject *
const *args, Py_ssize_t nargs);
434 typedef PyObject *(*__Pyx_PyCFunctionFastWithKeywords) (PyObject *
self, PyObject *
const *args,
435 Py_ssize_t nargs, PyObject *kwnames);
437 #define __Pyx_PyCFunctionFast _PyCFunctionFast
438 #define __Pyx_PyCFunctionFastWithKeywords _PyCFunctionFastWithKeywords
440 #if CYTHON_FAST_PYCCALL
441 #define __Pyx_PyFastCFunction_Check(func)\
442 ((PyCFunction_Check(func) && (METH_FASTCALL == (PyCFunction_GET_FLAGS(func) & ~(METH_CLASS | METH_STATIC | METH_COEXIST | METH_KEYWORDS | METH_STACKLESS)))))
444 #define __Pyx_PyFastCFunction_Check(func) 0
446 #if CYTHON_COMPILING_IN_PYPY && !defined(PyObject_Malloc)
447 #define PyObject_Malloc(s) PyMem_Malloc(s)
448 #define PyObject_Free(p) PyMem_Free(p)
449 #define PyObject_Realloc(p) PyMem_Realloc(p)
451 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030400A1
452 #define PyMem_RawMalloc(n) PyMem_Malloc(n)
453 #define PyMem_RawRealloc(p, n) PyMem_Realloc(p, n)
454 #define PyMem_RawFree(p) PyMem_Free(p)
456 #if CYTHON_COMPILING_IN_PYSTON
457 #define __Pyx_PyCode_HasFreeVars(co) PyCode_HasFreeVars(co)
458 #define __Pyx_PyFrame_SetLineNumber(frame, lineno) PyFrame_SetLineNumber(frame, lineno)
460 #define __Pyx_PyCode_HasFreeVars(co) (PyCode_GetNumFree(co) > 0)
461 #define __Pyx_PyFrame_SetLineNumber(frame, lineno) (frame)->f_lineno = (lineno)
463 #if !CYTHON_FAST_THREAD_STATE || PY_VERSION_HEX < 0x02070000
464 #define __Pyx_PyThreadState_Current PyThreadState_GET()
465 #elif PY_VERSION_HEX >= 0x03060000
466 #define __Pyx_PyThreadState_Current _PyThreadState_UncheckedGet()
467 #elif PY_VERSION_HEX >= 0x03000000
468 #define __Pyx_PyThreadState_Current PyThreadState_GET()
470 #define __Pyx_PyThreadState_Current _PyThreadState_Current
472 #if PY_VERSION_HEX < 0x030700A2 && !defined(PyThread_tss_create) && !defined(Py_tss_NEEDS_INIT)
473 #include "pythread.h"
474 #define Py_tss_NEEDS_INIT 0
475 typedef int Py_tss_t;
476 static CYTHON_INLINE
int PyThread_tss_create(Py_tss_t *key) {
477 *key = PyThread_create_key();
480 static CYTHON_INLINE Py_tss_t * PyThread_tss_alloc(
void) {
481 Py_tss_t *key = (Py_tss_t *)PyObject_Malloc(
sizeof(Py_tss_t));
482 *key = Py_tss_NEEDS_INIT;
485 static CYTHON_INLINE
void PyThread_tss_free(Py_tss_t *key) {
488 static CYTHON_INLINE
int PyThread_tss_is_created(Py_tss_t *key) {
489 return *key != Py_tss_NEEDS_INIT;
491 static CYTHON_INLINE
void PyThread_tss_delete(Py_tss_t *key) {
492 PyThread_delete_key(*key);
493 *key = Py_tss_NEEDS_INIT;
495 static CYTHON_INLINE
int PyThread_tss_set(Py_tss_t *key,
void *value) {
496 return PyThread_set_key_value(*key, value);
498 static CYTHON_INLINE
void * PyThread_tss_get(Py_tss_t *key) {
499 return PyThread_get_key_value(*key);
502 #if CYTHON_COMPILING_IN_CPYTHON || defined(_PyDict_NewPresized)
503 #define __Pyx_PyDict_NewPresized(n) ((n <= 8) ? PyDict_New() : _PyDict_NewPresized(n))
505 #define __Pyx_PyDict_NewPresized(n) PyDict_New()
507 #if PY_MAJOR_VERSION >= 3 || CYTHON_FUTURE_DIVISION
508 #define __Pyx_PyNumber_Divide(x,y) PyNumber_TrueDivide(x,y)
509 #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceTrueDivide(x,y)
511 #define __Pyx_PyNumber_Divide(x,y) PyNumber_Divide(x,y)
512 #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceDivide(x,y)
514 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030500A1 && CYTHON_USE_UNICODE_INTERNALS
515 #define __Pyx_PyDict_GetItemStr(dict, name) _PyDict_GetItem_KnownHash(dict, name, ((PyASCIIObject *) name)->hash)
517 #define __Pyx_PyDict_GetItemStr(dict, name) PyDict_GetItem(dict, name)
519 #if PY_VERSION_HEX > 0x03030000 && defined(PyUnicode_KIND)
520 #define CYTHON_PEP393_ENABLED 1
521 #if defined(PyUnicode_IS_READY)
522 #define __Pyx_PyUnicode_READY(op) (likely(PyUnicode_IS_READY(op)) ?\
523 0 : _PyUnicode_Ready((PyObject *)(op)))
525 #define __Pyx_PyUnicode_READY(op) (0)
527 #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_LENGTH(u)
528 #define __Pyx_PyUnicode_READ_CHAR(u, i) PyUnicode_READ_CHAR(u, i)
529 #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u) PyUnicode_MAX_CHAR_VALUE(u)
530 #define __Pyx_PyUnicode_KIND(u) PyUnicode_KIND(u)
531 #define __Pyx_PyUnicode_DATA(u) PyUnicode_DATA(u)
532 #define __Pyx_PyUnicode_READ(k, d, i) PyUnicode_READ(k, d, i)
533 #define __Pyx_PyUnicode_WRITE(k, d, i, ch) PyUnicode_WRITE(k, d, i, ch)
534 #if defined(PyUnicode_IS_READY) && defined(PyUnicode_GET_SIZE)
535 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x03090000
536 #define __Pyx_PyUnicode_IS_TRUE(u) (0 != (likely(PyUnicode_IS_READY(u)) ? PyUnicode_GET_LENGTH(u) : ((PyCompactUnicodeObject *)(u))->wstr_length))
538 #define __Pyx_PyUnicode_IS_TRUE(u) (0 != (likely(PyUnicode_IS_READY(u)) ? PyUnicode_GET_LENGTH(u) : PyUnicode_GET_SIZE(u)))
541 #define __Pyx_PyUnicode_IS_TRUE(u) (0 != PyUnicode_GET_LENGTH(u))
544 #define CYTHON_PEP393_ENABLED 0
545 #define PyUnicode_1BYTE_KIND 1
546 #define PyUnicode_2BYTE_KIND 2
547 #define PyUnicode_4BYTE_KIND 4
548 #define __Pyx_PyUnicode_READY(op) (0)
549 #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_SIZE(u)
550 #define __Pyx_PyUnicode_READ_CHAR(u, i) ((Py_UCS4)(PyUnicode_AS_UNICODE(u)[i]))
551 #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u) ((sizeof(Py_UNICODE) == 2) ? 65535 : 1114111)
552 #define __Pyx_PyUnicode_KIND(u) (sizeof(Py_UNICODE))
553 #define __Pyx_PyUnicode_DATA(u) ((void*)PyUnicode_AS_UNICODE(u))
554 #define __Pyx_PyUnicode_READ(k, d, i) ((void)(k), (Py_UCS4)(((Py_UNICODE*)d)[i]))
555 #define __Pyx_PyUnicode_WRITE(k, d, i, ch) (((void)(k)), ((Py_UNICODE*)d)[i] = ch)
556 #define __Pyx_PyUnicode_IS_TRUE(u) (0 != PyUnicode_GET_SIZE(u))
558 #if CYTHON_COMPILING_IN_PYPY
559 #define __Pyx_PyUnicode_Concat(a, b) PyNumber_Add(a, b)
560 #define __Pyx_PyUnicode_ConcatSafe(a, b) PyNumber_Add(a, b)
562 #define __Pyx_PyUnicode_Concat(a, b) PyUnicode_Concat(a, b)
563 #define __Pyx_PyUnicode_ConcatSafe(a, b) ((unlikely((a) == Py_None) || unlikely((b) == Py_None)) ?\
564 PyNumber_Add(a, b) : __Pyx_PyUnicode_Concat(a, b))
566 #if CYTHON_COMPILING_IN_PYPY && !defined(PyUnicode_Contains)
567 #define PyUnicode_Contains(u, s) PySequence_Contains(u, s)
569 #if CYTHON_COMPILING_IN_PYPY && !defined(PyByteArray_Check)
570 #define PyByteArray_Check(obj) PyObject_TypeCheck(obj, &PyByteArray_Type)
572 #if CYTHON_COMPILING_IN_PYPY && !defined(PyObject_Format)
573 #define PyObject_Format(obj, fmt) PyObject_CallMethod(obj, "__format__", "O", fmt)
575 #define __Pyx_PyString_FormatSafe(a, b) ((unlikely((a) == Py_None || (PyString_Check(b) && !PyString_CheckExact(b)))) ? PyNumber_Remainder(a, b) : __Pyx_PyString_Format(a, b))
576 #define __Pyx_PyUnicode_FormatSafe(a, b) ((unlikely((a) == Py_None || (PyUnicode_Check(b) && !PyUnicode_CheckExact(b)))) ? PyNumber_Remainder(a, b) : PyUnicode_Format(a, b))
577 #if PY_MAJOR_VERSION >= 3
578 #define __Pyx_PyString_Format(a, b) PyUnicode_Format(a, b)
580 #define __Pyx_PyString_Format(a, b) PyString_Format(a, b)
582 #if PY_MAJOR_VERSION < 3 && !defined(PyObject_ASCII)
583 #define PyObject_ASCII(o) PyObject_Repr(o)
585 #if PY_MAJOR_VERSION >= 3
586 #define PyBaseString_Type PyUnicode_Type
587 #define PyStringObject PyUnicodeObject
588 #define PyString_Type PyUnicode_Type
589 #define PyString_Check PyUnicode_Check
590 #define PyString_CheckExact PyUnicode_CheckExact
591 #ifndef PyObject_Unicode
592 #define PyObject_Unicode PyObject_Str
595 #if PY_MAJOR_VERSION >= 3
596 #define __Pyx_PyBaseString_Check(obj) PyUnicode_Check(obj)
597 #define __Pyx_PyBaseString_CheckExact(obj) PyUnicode_CheckExact(obj)
599 #define __Pyx_PyBaseString_Check(obj) (PyString_Check(obj) || PyUnicode_Check(obj))
600 #define __Pyx_PyBaseString_CheckExact(obj) (PyString_CheckExact(obj) || PyUnicode_CheckExact(obj))
602 #ifndef PySet_CheckExact
603 #define PySet_CheckExact(obj) (Py_TYPE(obj) == &PySet_Type)
605 #if PY_VERSION_HEX >= 0x030900A4
606 #define __Pyx_SET_REFCNT(obj, refcnt) Py_SET_REFCNT(obj, refcnt)
607 #define __Pyx_SET_SIZE(obj, size) Py_SET_SIZE(obj, size)
609 #define __Pyx_SET_REFCNT(obj, refcnt) Py_REFCNT(obj) = (refcnt)
610 #define __Pyx_SET_SIZE(obj, size) Py_SIZE(obj) = (size)
612 #if CYTHON_ASSUME_SAFE_MACROS
613 #define __Pyx_PySequence_SIZE(seq) Py_SIZE(seq)
615 #define __Pyx_PySequence_SIZE(seq) PySequence_Size(seq)
617 #if PY_MAJOR_VERSION >= 3
618 #define PyIntObject PyLongObject
619 #define PyInt_Type PyLong_Type
620 #define PyInt_Check(op) PyLong_Check(op)
621 #define PyInt_CheckExact(op) PyLong_CheckExact(op)
622 #define PyInt_FromString PyLong_FromString
623 #define PyInt_FromUnicode PyLong_FromUnicode
624 #define PyInt_FromLong PyLong_FromLong
625 #define PyInt_FromSize_t PyLong_FromSize_t
626 #define PyInt_FromSsize_t PyLong_FromSsize_t
627 #define PyInt_AsLong PyLong_AsLong
628 #define PyInt_AS_LONG PyLong_AS_LONG
629 #define PyInt_AsSsize_t PyLong_AsSsize_t
630 #define PyInt_AsUnsignedLongMask PyLong_AsUnsignedLongMask
631 #define PyInt_AsUnsignedLongLongMask PyLong_AsUnsignedLongLongMask
632 #define PyNumber_Int PyNumber_Long
634 #if PY_MAJOR_VERSION >= 3
635 #define PyBoolObject PyLongObject
637 #if PY_MAJOR_VERSION >= 3 && CYTHON_COMPILING_IN_PYPY
638 #ifndef PyUnicode_InternFromString
639 #define PyUnicode_InternFromString(s) PyUnicode_FromString(s)
642 #if PY_VERSION_HEX < 0x030200A4
643 typedef long Py_hash_t;
644 #define __Pyx_PyInt_FromHash_t PyInt_FromLong
645 #define __Pyx_PyInt_AsHash_t __Pyx_PyIndex_AsHash_t
647 #define __Pyx_PyInt_FromHash_t PyInt_FromSsize_t
648 #define __Pyx_PyInt_AsHash_t __Pyx_PyIndex_AsSsize_t
650 #if PY_MAJOR_VERSION >= 3
651 #define __Pyx_PyMethod_New(func, self, klass) ((self) ? ((void)(klass), PyMethod_New(func, self)) : __Pyx_NewRef(func))
653 #define __Pyx_PyMethod_New(func, self, klass) PyMethod_New(func, self, klass)
655 #if CYTHON_USE_ASYNC_SLOTS
656 #if PY_VERSION_HEX >= 0x030500B1
657 #define __Pyx_PyAsyncMethodsStruct PyAsyncMethods
658 #define __Pyx_PyType_AsAsync(obj) (Py_TYPE(obj)->tp_as_async)
660 #define __Pyx_PyType_AsAsync(obj) ((__Pyx_PyAsyncMethodsStruct*) (Py_TYPE(obj)->tp_reserved))
663 #define __Pyx_PyType_AsAsync(obj) NULL
665 #ifndef __Pyx_PyAsyncMethodsStruct
670 } __Pyx_PyAsyncMethodsStruct;
673 #if defined(_WIN32) || defined(WIN32) || defined(MS_WINDOWS)
674 #if !defined(_USE_MATH_DEFINES)
675 #define _USE_MATH_DEFINES
680 #define __PYX_NAN() ((float) NAN)
682 static CYTHON_INLINE
float __PYX_NAN() {
684 memset(&value, 0xFF,
sizeof(value));
688 #if defined(__CYGWIN__) && defined(_LDBL_EQ_DBL)
689 #define __Pyx_truncl trunc
691 #define __Pyx_truncl truncl
694 #define __PYX_MARK_ERR_POS(f_index, lineno) \
695 { __pyx_filename = __pyx_f[f_index]; (void)__pyx_filename; __pyx_lineno = lineno; (void)__pyx_lineno; __pyx_clineno = __LINE__; (void)__pyx_clineno; }
696 #define __PYX_ERR(f_index, lineno, Ln_error) \
697 { __PYX_MARK_ERR_POS(f_index, lineno) goto Ln_error; }
699 #ifndef __PYX_EXTERN_C
701 #define __PYX_EXTERN_C extern "C"
703 #define __PYX_EXTERN_C extern
707 #define __PYX_HAVE__cpartitioning
708 #define __PYX_HAVE_API__cpartitioning
712 #include "numpy/arrayobject.h"
713 #include "numpy/ndarrayobject.h"
714 #include "numpy/ndarraytypes.h"
715 #include "numpy/arrayscalars.h"
716 #include "numpy/ufuncobject.h"
723 #include "pythread.h"
730 #if defined(PYREX_WITHOUT_ASSERTIONS) && !defined(CYTHON_WITHOUT_ASSERTIONS)
731 #define CYTHON_WITHOUT_ASSERTIONS
734 typedef struct {PyObject **p;
const char *
s;
const Py_ssize_t
n;
const char* encoding;
735 const char is_unicode;
const char is_str;
const char intern; } __Pyx_StringTabEntry;
737 #define __PYX_DEFAULT_STRING_ENCODING_IS_ASCII 0
738 #define __PYX_DEFAULT_STRING_ENCODING_IS_UTF8 0
739 #define __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT (PY_MAJOR_VERSION >= 3 && __PYX_DEFAULT_STRING_ENCODING_IS_UTF8)
740 #define __PYX_DEFAULT_STRING_ENCODING ""
741 #define __Pyx_PyObject_FromString __Pyx_PyBytes_FromString
742 #define __Pyx_PyObject_FromStringAndSize __Pyx_PyBytes_FromStringAndSize
743 #define __Pyx_uchar_cast(c) ((unsigned char)c)
744 #define __Pyx_long_cast(x) ((long)x)
745 #define __Pyx_fits_Py_ssize_t(v, type, is_signed) (\
746 (sizeof(type) < sizeof(Py_ssize_t)) ||\
747 (sizeof(type) > sizeof(Py_ssize_t) &&\
748 likely(v < (type)PY_SSIZE_T_MAX ||\
749 v == (type)PY_SSIZE_T_MAX) &&\
750 (!is_signed || likely(v > (type)PY_SSIZE_T_MIN ||\
751 v == (type)PY_SSIZE_T_MIN))) ||\
752 (sizeof(type) == sizeof(Py_ssize_t) &&\
753 (is_signed || likely(v < (type)PY_SSIZE_T_MAX ||\
754 v == (type)PY_SSIZE_T_MAX))) )
755 static CYTHON_INLINE
int __Pyx_is_valid_index(Py_ssize_t i, Py_ssize_t limit) {
756 return (
size_t) i < (size_t) limit;
758 #if defined (__cplusplus) && __cplusplus >= 201103L
760 #define __Pyx_sst_abs(value) std::abs(value)
761 #elif SIZEOF_INT >= SIZEOF_SIZE_T
762 #define __Pyx_sst_abs(value) abs(value)
763 #elif SIZEOF_LONG >= SIZEOF_SIZE_T
764 #define __Pyx_sst_abs(value) labs(value)
765 #elif defined (_MSC_VER)
766 #define __Pyx_sst_abs(value) ((Py_ssize_t)_abs64(value))
767 #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
768 #define __Pyx_sst_abs(value) llabs(value)
769 #elif defined (__GNUC__)
770 #define __Pyx_sst_abs(value) __builtin_llabs(value)
772 #define __Pyx_sst_abs(value) ((value<0) ? -value : value)
774 static CYTHON_INLINE
const char* __Pyx_PyObject_AsString(PyObject*);
775 static CYTHON_INLINE
const char* __Pyx_PyObject_AsStringAndSize(PyObject*, Py_ssize_t* length);
776 #define __Pyx_PyByteArray_FromString(s) PyByteArray_FromStringAndSize((const char*)s, strlen((const char*)s))
777 #define __Pyx_PyByteArray_FromStringAndSize(s, l) PyByteArray_FromStringAndSize((const char*)s, l)
778 #define __Pyx_PyBytes_FromString PyBytes_FromString
779 #define __Pyx_PyBytes_FromStringAndSize PyBytes_FromStringAndSize
780 static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(
const char*);
781 #if PY_MAJOR_VERSION < 3
782 #define __Pyx_PyStr_FromString __Pyx_PyBytes_FromString
783 #define __Pyx_PyStr_FromStringAndSize __Pyx_PyBytes_FromStringAndSize
785 #define __Pyx_PyStr_FromString __Pyx_PyUnicode_FromString
786 #define __Pyx_PyStr_FromStringAndSize __Pyx_PyUnicode_FromStringAndSize
788 #define __Pyx_PyBytes_AsWritableString(s) ((char*) PyBytes_AS_STRING(s))
789 #define __Pyx_PyBytes_AsWritableSString(s) ((signed char*) PyBytes_AS_STRING(s))
790 #define __Pyx_PyBytes_AsWritableUString(s) ((unsigned char*) PyBytes_AS_STRING(s))
791 #define __Pyx_PyBytes_AsString(s) ((const char*) PyBytes_AS_STRING(s))
792 #define __Pyx_PyBytes_AsSString(s) ((const signed char*) PyBytes_AS_STRING(s))
793 #define __Pyx_PyBytes_AsUString(s) ((const unsigned char*) PyBytes_AS_STRING(s))
794 #define __Pyx_PyObject_AsWritableString(s) ((char*) __Pyx_PyObject_AsString(s))
795 #define __Pyx_PyObject_AsWritableSString(s) ((signed char*) __Pyx_PyObject_AsString(s))
796 #define __Pyx_PyObject_AsWritableUString(s) ((unsigned char*) __Pyx_PyObject_AsString(s))
797 #define __Pyx_PyObject_AsSString(s) ((const signed char*) __Pyx_PyObject_AsString(s))
798 #define __Pyx_PyObject_AsUString(s) ((const unsigned char*) __Pyx_PyObject_AsString(s))
799 #define __Pyx_PyObject_FromCString(s) __Pyx_PyObject_FromString((const char*)s)
800 #define __Pyx_PyBytes_FromCString(s) __Pyx_PyBytes_FromString((const char*)s)
801 #define __Pyx_PyByteArray_FromCString(s) __Pyx_PyByteArray_FromString((const char*)s)
802 #define __Pyx_PyStr_FromCString(s) __Pyx_PyStr_FromString((const char*)s)
803 #define __Pyx_PyUnicode_FromCString(s) __Pyx_PyUnicode_FromString((const char*)s)
804 static CYTHON_INLINE
size_t __Pyx_Py_UNICODE_strlen(
const Py_UNICODE *
u) {
805 const Py_UNICODE *u_end =
u;
807 return (
size_t)(u_end -
u - 1);
809 #define __Pyx_PyUnicode_FromUnicode(u) PyUnicode_FromUnicode(u, __Pyx_Py_UNICODE_strlen(u))
810 #define __Pyx_PyUnicode_FromUnicodeAndLength PyUnicode_FromUnicode
811 #define __Pyx_PyUnicode_AsUnicode PyUnicode_AsUnicode
812 #define __Pyx_NewRef(obj) (Py_INCREF(obj), obj)
813 #define __Pyx_Owned_Py_None(b) __Pyx_NewRef(Py_None)
814 static CYTHON_INLINE PyObject * __Pyx_PyBool_FromLong(
long b);
815 static CYTHON_INLINE
int __Pyx_PyObject_IsTrue(PyObject*);
816 static CYTHON_INLINE
int __Pyx_PyObject_IsTrueAndDecref(PyObject*);
817 static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x);
818 #define __Pyx_PySequence_Tuple(obj)\
819 (likely(PyTuple_CheckExact(obj)) ? __Pyx_NewRef(obj) : PySequence_Tuple(obj))
820 static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject*);
821 static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(
size_t);
822 static CYTHON_INLINE Py_hash_t __Pyx_PyIndex_AsHash_t(PyObject*);
823 #if CYTHON_ASSUME_SAFE_MACROS
824 #define __pyx_PyFloat_AsDouble(x) (PyFloat_CheckExact(x) ? PyFloat_AS_DOUBLE(x) : PyFloat_AsDouble(x))
826 #define __pyx_PyFloat_AsDouble(x) PyFloat_AsDouble(x)
828 #define __pyx_PyFloat_AsFloat(x) ((float) __pyx_PyFloat_AsDouble(x))
829 #if PY_MAJOR_VERSION >= 3
830 #define __Pyx_PyNumber_Int(x) (PyLong_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Long(x))
832 #define __Pyx_PyNumber_Int(x) (PyInt_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Int(x))
834 #define __Pyx_PyNumber_Float(x) (PyFloat_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Float(x))
835 #if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
836 static int __Pyx_sys_getdefaultencoding_not_ascii;
837 static int __Pyx_init_sys_getdefaultencoding_params(
void) {
839 PyObject* default_encoding = NULL;
840 PyObject* ascii_chars_u = NULL;
841 PyObject* ascii_chars_b = NULL;
842 const char* default_encoding_c;
843 sys = PyImport_ImportModule(
"sys");
845 default_encoding = PyObject_CallMethod(sys, (
char*)
"getdefaultencoding", NULL);
847 if (!default_encoding)
goto bad;
848 default_encoding_c = PyBytes_AsString(default_encoding);
849 if (!default_encoding_c)
goto bad;
850 if (strcmp(default_encoding_c,
"ascii") == 0) {
851 __Pyx_sys_getdefaultencoding_not_ascii = 0;
853 char ascii_chars[128];
855 for (
c = 0;
c < 128;
c++) {
858 __Pyx_sys_getdefaultencoding_not_ascii = 1;
859 ascii_chars_u = PyUnicode_DecodeASCII(ascii_chars, 128, NULL);
860 if (!ascii_chars_u)
goto bad;
861 ascii_chars_b = PyUnicode_AsEncodedString(ascii_chars_u, default_encoding_c, NULL);
862 if (!ascii_chars_b || !PyBytes_Check(ascii_chars_b) || memcmp(ascii_chars, PyBytes_AS_STRING(ascii_chars_b), 128) != 0) {
865 "This module compiled with c_string_encoding=ascii, but default encoding '%.200s' is not a superset of ascii.",
869 Py_DECREF(ascii_chars_u);
870 Py_DECREF(ascii_chars_b);
872 Py_DECREF(default_encoding);
875 Py_XDECREF(default_encoding);
876 Py_XDECREF(ascii_chars_u);
877 Py_XDECREF(ascii_chars_b);
881 #if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT && PY_MAJOR_VERSION >= 3
882 #define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_DecodeUTF8(c_str, size, NULL)
884 #define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_Decode(c_str, size, __PYX_DEFAULT_STRING_ENCODING, NULL)
885 #if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT
886 static char* __PYX_DEFAULT_STRING_ENCODING;
887 static int __Pyx_init_sys_getdefaultencoding_params(
void) {
889 PyObject* default_encoding = NULL;
890 char* default_encoding_c;
891 sys = PyImport_ImportModule(
"sys");
893 default_encoding = PyObject_CallMethod(sys, (
char*) (
const char*)
"getdefaultencoding", NULL);
895 if (!default_encoding)
goto bad;
896 default_encoding_c = PyBytes_AsString(default_encoding);
897 if (!default_encoding_c)
goto bad;
898 __PYX_DEFAULT_STRING_ENCODING = (
char*) malloc(strlen(default_encoding_c) + 1);
899 if (!__PYX_DEFAULT_STRING_ENCODING)
goto bad;
900 strcpy(__PYX_DEFAULT_STRING_ENCODING, default_encoding_c);
901 Py_DECREF(default_encoding);
904 Py_XDECREF(default_encoding);
912 #if defined(__GNUC__) && (__GNUC__ > 2 || (__GNUC__ == 2 && (__GNUC_MINOR__ > 95)))
913 #define likely(x) __builtin_expect(!!(x), 1)
914 #define unlikely(x) __builtin_expect(!!(x), 0)
916 #define likely(x) (x)
917 #define unlikely(x) (x)
919 static CYTHON_INLINE
void __Pyx_pretend_to_initialize(
void* ptr) { (void)ptr; }
921 static PyObject *__pyx_m = NULL;
922 static PyObject *__pyx_d;
923 static PyObject *__pyx_b;
924 static PyObject *__pyx_cython_runtime = NULL;
925 static PyObject *__pyx_empty_tuple;
926 static PyObject *__pyx_empty_bytes;
927 static PyObject *__pyx_empty_unicode;
928 static int __pyx_lineno;
929 static int __pyx_clineno = 0;
930 static const char * __pyx_cfilenm= __FILE__;
931 static const char *__pyx_filename;
934 #if !defined(CYTHON_CCOMPLEX)
935 #if defined(__cplusplus)
936 #define CYTHON_CCOMPLEX 1
937 #elif defined(_Complex_I)
938 #define CYTHON_CCOMPLEX 1
940 #define CYTHON_CCOMPLEX 0
950 #if CYTHON_CCOMPLEX && !defined(__cplusplus) && defined(__sun__) && defined(__GNUC__)
952 #define _Complex_I 1.0fj
956 static const char *__pyx_f[] = {
957 "proteus/cpartitioning.pyx",
962 "proteus/cmeshTools.pxd",
965 #ifndef __PYX_FORCE_INIT_THREADS
966 #define __PYX_FORCE_INIT_THREADS 0
970 #define __Pyx_PyGILState_Ensure PyGILState_Ensure
971 #define __Pyx_PyGILState_Release PyGILState_Release
972 #define __Pyx_FastGIL_Remember()
973 #define __Pyx_FastGIL_Forget()
974 #define __Pyx_FastGilFuncInit()
977 #define IS_UNSIGNED(type) (((type) -1) > 0)
978 struct __Pyx_StructField_;
979 #define __PYX_BUF_FLAGS_PACKED_STRUCT (1 << 0)
982 struct __Pyx_StructField_* fields;
990 typedef struct __Pyx_StructField_ {
991 __Pyx_TypeInfo* type;
996 __Pyx_StructField* field;
997 size_t parent_offset;
998 } __Pyx_BufFmt_StackElem;
1000 __Pyx_StructField root;
1001 __Pyx_BufFmt_StackElem* head;
1003 size_t new_count, enc_count;
1004 size_t struct_alignment;
1009 char is_valid_array;
1010 } __Pyx_BufFmt_Context;
1013 #include <pythread.h>
1014 #ifndef CYTHON_ATOMICS
1015 #define CYTHON_ATOMICS 1
1017 #define __pyx_atomic_int_type int
1018 #if CYTHON_ATOMICS && __GNUC__ >= 4 && (__GNUC_MINOR__ > 1 ||\
1019 (__GNUC_MINOR__ == 1 && __GNUC_PATCHLEVEL >= 2)) &&\
1021 #define __pyx_atomic_incr_aligned(value, lock) __sync_fetch_and_add(value, 1)
1022 #define __pyx_atomic_decr_aligned(value, lock) __sync_fetch_and_sub(value, 1)
1023 #ifdef __PYX_DEBUG_ATOMICS
1024 #warning "Using GNU atomics"
1026 #elif CYTHON_ATOMICS && defined(_MSC_VER) && 0
1027 #include <Windows.h>
1028 #undef __pyx_atomic_int_type
1029 #define __pyx_atomic_int_type LONG
1030 #define __pyx_atomic_incr_aligned(value, lock) InterlockedIncrement(value)
1031 #define __pyx_atomic_decr_aligned(value, lock) InterlockedDecrement(value)
1032 #ifdef __PYX_DEBUG_ATOMICS
1033 #pragma message ("Using MSVC atomics")
1035 #elif CYTHON_ATOMICS && (defined(__ICC) || defined(__INTEL_COMPILER)) && 0
1036 #define __pyx_atomic_incr_aligned(value, lock) _InterlockedIncrement(value)
1037 #define __pyx_atomic_decr_aligned(value, lock) _InterlockedDecrement(value)
1038 #ifdef __PYX_DEBUG_ATOMICS
1039 #warning "Using Intel atomics"
1042 #undef CYTHON_ATOMICS
1043 #define CYTHON_ATOMICS 0
1044 #ifdef __PYX_DEBUG_ATOMICS
1045 #warning "Not using atomics"
1048 typedef volatile __pyx_atomic_int_type __pyx_atomic_int;
1050 #define __pyx_add_acquisition_count(memview)\
1051 __pyx_atomic_incr_aligned(__pyx_get_slice_count_pointer(memview), memview->lock)
1052 #define __pyx_sub_acquisition_count(memview)\
1053 __pyx_atomic_decr_aligned(__pyx_get_slice_count_pointer(memview), memview->lock)
1055 #define __pyx_add_acquisition_count(memview)\
1056 __pyx_add_acquisition_count_locked(__pyx_get_slice_count_pointer(memview), memview->lock)
1057 #define __pyx_sub_acquisition_count(memview)\
1058 __pyx_sub_acquisition_count_locked(__pyx_get_slice_count_pointer(memview), memview->lock)
1062 struct __pyx_memoryview_obj;
1064 struct __pyx_memoryview_obj *memview;
1066 Py_ssize_t shape[8];
1067 Py_ssize_t strides[8];
1068 Py_ssize_t suboffsets[8];
1069 } __Pyx_memviewslice;
1070 #define __Pyx_MemoryView_Len(m) (m.shape[0])
1080 typedef npy_int8 __pyx_t_5numpy_int8_t;
1089 typedef npy_int16 __pyx_t_5numpy_int16_t;
1098 typedef npy_int32 __pyx_t_5numpy_int32_t;
1107 typedef npy_int64 __pyx_t_5numpy_int64_t;
1116 typedef npy_uint8 __pyx_t_5numpy_uint8_t;
1125 typedef npy_uint16 __pyx_t_5numpy_uint16_t;
1134 typedef npy_uint32 __pyx_t_5numpy_uint32_t;
1143 typedef npy_uint64 __pyx_t_5numpy_uint64_t;
1152 typedef npy_float32 __pyx_t_5numpy_float32_t;
1161 typedef npy_float64 __pyx_t_5numpy_float64_t;
1170 typedef npy_long __pyx_t_5numpy_int_t;
1179 typedef npy_longlong __pyx_t_5numpy_long_t;
1188 typedef npy_longlong __pyx_t_5numpy_longlong_t;
1197 typedef npy_ulong __pyx_t_5numpy_uint_t;
1206 typedef npy_ulonglong __pyx_t_5numpy_ulong_t;
1215 typedef npy_ulonglong __pyx_t_5numpy_ulonglong_t;
1224 typedef npy_intp __pyx_t_5numpy_intp_t;
1233 typedef npy_uintp __pyx_t_5numpy_uintp_t;
1242 typedef npy_double __pyx_t_5numpy_float_t;
1251 typedef npy_double __pyx_t_5numpy_double_t;
1260 typedef npy_longdouble __pyx_t_5numpy_longdouble_t;
1264 typedef ::std::complex< float > __pyx_t_float_complex;
1266 typedef float _Complex __pyx_t_float_complex;
1269 typedef struct {
float real, imag; } __pyx_t_float_complex;
1271 static CYTHON_INLINE __pyx_t_float_complex __pyx_t_float_complex_from_parts(
float,
float);
1276 typedef ::std::complex< double > __pyx_t_double_complex;
1278 typedef double _Complex __pyx_t_double_complex;
1281 typedef struct {
double real, imag; } __pyx_t_double_complex;
1283 static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(
double,
double);
1287 struct PyMPIDatatypeObject;
1288 struct PyMPIStatusObject;
1289 struct PyMPIRequestObject;
1290 struct PyMPIPrequestObject;
1291 struct PyMPIGrequestObject;
1292 struct PyMPIMessageObject;
1293 struct PyMPIOpObject;
1294 struct PyMPIGroupObject;
1295 struct PyMPIInfoObject;
1296 struct PyMPIErrhandlerObject;
1297 struct PyMPICommObject;
1298 struct PyMPIIntracommObject;
1299 struct PyMPITopocommObject;
1300 struct PyMPICartcommObject;
1301 struct PyMPIGraphcommObject;
1302 struct PyMPIDistgraphcommObject;
1303 struct PyMPIIntercommObject;
1304 struct PyMPIWinObject;
1305 struct PyMPIFileObject;
1306 struct __pyx_obj_7proteus_10cmeshTools_CMesh;
1307 struct __pyx_array_obj;
1308 struct __pyx_MemviewEnum_obj;
1309 struct __pyx_memoryview_obj;
1310 struct __pyx_memoryviewslice_obj;
1319 typedef npy_cfloat __pyx_t_5numpy_cfloat_t;
1328 typedef npy_cdouble __pyx_t_5numpy_cdouble_t;
1337 typedef npy_clongdouble __pyx_t_5numpy_clongdouble_t;
1346 typedef npy_cdouble __pyx_t_5numpy_complex_t;
1355 struct PyMPIDatatypeObject {
1357 MPI_Datatype ob_mpi;
1359 PyObject *__weakref__;
1361 typedef struct PyMPIDatatypeObject PyMPIDatatypeObject;
1363 __PYX_EXTERN_C DL_EXPORT(PyTypeObject) PyMPIDatatype_Type;
1372 struct PyMPIStatusObject {
1376 PyObject *__weakref__;
1378 typedef struct PyMPIStatusObject PyMPIStatusObject;
1380 __PYX_EXTERN_C DL_EXPORT(PyTypeObject) PyMPIStatus_Type;
1389 struct PyMPIRequestObject {
1393 PyObject *__weakref__;
1396 typedef struct PyMPIRequestObject PyMPIRequestObject;
1398 __PYX_EXTERN_C DL_EXPORT(PyTypeObject) PyMPIRequest_Type;
1407 struct PyMPIPrequestObject {
1408 struct PyMPIRequestObject __pyx_base;
1410 typedef struct PyMPIPrequestObject PyMPIPrequestObject;
1412 __PYX_EXTERN_C DL_EXPORT(PyTypeObject) PyMPIPrequest_Type;
1421 struct PyMPIGrequestObject {
1422 struct PyMPIRequestObject __pyx_base;
1423 MPI_Request ob_grequest;
1425 typedef struct PyMPIGrequestObject PyMPIGrequestObject;
1427 __PYX_EXTERN_C DL_EXPORT(PyTypeObject) PyMPIGrequest_Type;
1436 struct PyMPIMessageObject {
1440 PyObject *__weakref__;
1443 typedef struct PyMPIMessageObject PyMPIMessageObject;
1445 __PYX_EXTERN_C DL_EXPORT(PyTypeObject) PyMPIMessage_Type;
1454 struct PyMPIOpObject {
1458 PyObject *__weakref__;
1459 PyObject *(*ob_func)(PyObject *, PyObject *);
1462 typedef struct PyMPIOpObject PyMPIOpObject;
1464 __PYX_EXTERN_C DL_EXPORT(PyTypeObject) PyMPIOp_Type;
1473 struct PyMPIGroupObject {
1477 PyObject *__weakref__;
1479 typedef struct PyMPIGroupObject PyMPIGroupObject;
1481 __PYX_EXTERN_C DL_EXPORT(PyTypeObject) PyMPIGroup_Type;
1490 struct PyMPIInfoObject {
1494 PyObject *__weakref__;
1496 typedef struct PyMPIInfoObject PyMPIInfoObject;
1498 __PYX_EXTERN_C DL_EXPORT(PyTypeObject) PyMPIInfo_Type;
1507 struct PyMPIErrhandlerObject {
1509 MPI_Errhandler ob_mpi;
1511 PyObject *__weakref__;
1513 typedef struct PyMPIErrhandlerObject PyMPIErrhandlerObject;
1515 __PYX_EXTERN_C DL_EXPORT(PyTypeObject) PyMPIErrhandler_Type;
1524 struct PyMPICommObject {
1528 PyObject *__weakref__;
1530 typedef struct PyMPICommObject PyMPICommObject;
1532 __PYX_EXTERN_C DL_EXPORT(PyTypeObject) PyMPIComm_Type;
1541 struct PyMPIIntracommObject {
1542 struct PyMPICommObject __pyx_base;
1544 typedef struct PyMPIIntracommObject PyMPIIntracommObject;
1546 __PYX_EXTERN_C DL_EXPORT(PyTypeObject) PyMPIIntracomm_Type;
1555 struct PyMPITopocommObject {
1556 struct PyMPIIntracommObject __pyx_base;
1558 typedef struct PyMPITopocommObject PyMPITopocommObject;
1560 __PYX_EXTERN_C DL_EXPORT(PyTypeObject) PyMPITopocomm_Type;
1569 struct PyMPICartcommObject {
1570 struct PyMPITopocommObject __pyx_base;
1572 typedef struct PyMPICartcommObject PyMPICartcommObject;
1574 __PYX_EXTERN_C DL_EXPORT(PyTypeObject) PyMPICartcomm_Type;
1583 struct PyMPIGraphcommObject {
1584 struct PyMPITopocommObject __pyx_base;
1586 typedef struct PyMPIGraphcommObject PyMPIGraphcommObject;
1588 __PYX_EXTERN_C DL_EXPORT(PyTypeObject) PyMPIGraphcomm_Type;
1597 struct PyMPIDistgraphcommObject {
1598 struct PyMPITopocommObject __pyx_base;
1600 typedef struct PyMPIDistgraphcommObject PyMPIDistgraphcommObject;
1602 __PYX_EXTERN_C DL_EXPORT(PyTypeObject) PyMPIDistgraphcomm_Type;
1611 struct PyMPIIntercommObject {
1612 struct PyMPICommObject __pyx_base;
1614 typedef struct PyMPIIntercommObject PyMPIIntercommObject;
1616 __PYX_EXTERN_C DL_EXPORT(PyTypeObject) PyMPIIntercomm_Type;
1625 struct PyMPIWinObject {
1629 PyObject *__weakref__;
1632 typedef struct PyMPIWinObject PyMPIWinObject;
1634 __PYX_EXTERN_C DL_EXPORT(PyTypeObject) PyMPIWin_Type;
1643 struct PyMPIFileObject {
1647 PyObject *__weakref__;
1649 typedef struct PyMPIFileObject PyMPIFileObject;
1651 __PYX_EXTERN_C DL_EXPORT(PyTypeObject) PyMPIFile_Type;
1660 struct __pyx_obj_7proteus_10cmeshTools_CMesh {
1723 struct __pyx_array_obj {
1725 struct __pyx_vtabstruct_array *__pyx_vtab;
1731 Py_ssize_t *_strides;
1732 Py_ssize_t itemsize;
1735 void (*callback_free_data)(
void *);
1737 int dtype_is_object;
1748 struct __pyx_MemviewEnum_obj {
1761 struct __pyx_memoryview_obj {
1763 struct __pyx_vtabstruct_memoryview *__pyx_vtab;
1766 PyObject *_array_interface;
1767 PyThread_type_lock lock;
1768 __pyx_atomic_int acquisition_count[2];
1769 __pyx_atomic_int *acquisition_count_aligned_p;
1772 int dtype_is_object;
1773 __Pyx_TypeInfo *typeinfo;
1784 struct __pyx_memoryviewslice_obj {
1785 struct __pyx_memoryview_obj __pyx_base;
1786 __Pyx_memviewslice from_slice;
1787 PyObject *from_object;
1788 PyObject *(*to_object_func)(
char *);
1789 int (*to_dtype_func)(
char *, PyObject *);
1802 struct __pyx_vtabstruct_array {
1803 PyObject *(*get_memview)(
struct __pyx_array_obj *);
1805 static struct __pyx_vtabstruct_array *__pyx_vtabptr_array;
1816 struct __pyx_vtabstruct_memoryview {
1817 char *(*get_item_pointer)(
struct __pyx_memoryview_obj *, PyObject *);
1818 PyObject *(*is_slice)(
struct __pyx_memoryview_obj *, PyObject *);
1819 PyObject *(*setitem_slice_assignment)(
struct __pyx_memoryview_obj *, PyObject *, PyObject *);
1820 PyObject *(*setitem_slice_assign_scalar)(
struct __pyx_memoryview_obj *,
struct __pyx_memoryview_obj *, PyObject *);
1821 PyObject *(*setitem_indexed)(
struct __pyx_memoryview_obj *, PyObject *, PyObject *);
1822 PyObject *(*convert_item_to_object)(
struct __pyx_memoryview_obj *,
char *);
1823 PyObject *(*assign_item_from_object)(
struct __pyx_memoryview_obj *,
char *, PyObject *);
1825 static struct __pyx_vtabstruct_memoryview *__pyx_vtabptr_memoryview;
1836 struct __pyx_vtabstruct__memoryviewslice {
1837 struct __pyx_vtabstruct_memoryview __pyx_base;
1839 static struct __pyx_vtabstruct__memoryviewslice *__pyx_vtabptr__memoryviewslice;
1843 #ifndef CYTHON_REFNANNY
1844 #define CYTHON_REFNANNY 0
1848 void (*INCREF)(
void*, PyObject*, int);
1849 void (*DECREF)(
void*, PyObject*, int);
1850 void (*GOTREF)(
void*, PyObject*, int);
1851 void (*GIVEREF)(
void*, PyObject*, int);
1852 void* (*SetupContext)(
const char*, int,
const char*);
1853 void (*FinishContext)(
void**);
1854 } __Pyx_RefNannyAPIStruct;
1855 static __Pyx_RefNannyAPIStruct *__Pyx_RefNanny = NULL;
1856 static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(
const char *modname);
1857 #define __Pyx_RefNannyDeclarations void *__pyx_refnanny = NULL;
1859 #define __Pyx_RefNannySetupContext(name, acquire_gil)\
1861 PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();\
1862 __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__);\
1863 PyGILState_Release(__pyx_gilstate_save);\
1865 __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__);\
1868 #define __Pyx_RefNannySetupContext(name, acquire_gil)\
1869 __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__)
1871 #define __Pyx_RefNannyFinishContext()\
1872 __Pyx_RefNanny->FinishContext(&__pyx_refnanny)
1873 #define __Pyx_INCREF(r) __Pyx_RefNanny->INCREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
1874 #define __Pyx_DECREF(r) __Pyx_RefNanny->DECREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
1875 #define __Pyx_GOTREF(r) __Pyx_RefNanny->GOTREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
1876 #define __Pyx_GIVEREF(r) __Pyx_RefNanny->GIVEREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
1877 #define __Pyx_XINCREF(r) do { if((r) != NULL) {__Pyx_INCREF(r); }} while(0)
1878 #define __Pyx_XDECREF(r) do { if((r) != NULL) {__Pyx_DECREF(r); }} while(0)
1879 #define __Pyx_XGOTREF(r) do { if((r) != NULL) {__Pyx_GOTREF(r); }} while(0)
1880 #define __Pyx_XGIVEREF(r) do { if((r) != NULL) {__Pyx_GIVEREF(r);}} while(0)
1882 #define __Pyx_RefNannyDeclarations
1883 #define __Pyx_RefNannySetupContext(name, acquire_gil)
1884 #define __Pyx_RefNannyFinishContext()
1885 #define __Pyx_INCREF(r) Py_INCREF(r)
1886 #define __Pyx_DECREF(r) Py_DECREF(r)
1887 #define __Pyx_GOTREF(r)
1888 #define __Pyx_GIVEREF(r)
1889 #define __Pyx_XINCREF(r) Py_XINCREF(r)
1890 #define __Pyx_XDECREF(r) Py_XDECREF(r)
1891 #define __Pyx_XGOTREF(r)
1892 #define __Pyx_XGIVEREF(r)
1894 #define __Pyx_XDECREF_SET(r, v) do {\
1895 PyObject *tmp = (PyObject *) r;\
1896 r = v; __Pyx_XDECREF(tmp);\
1898 #define __Pyx_DECREF_SET(r, v) do {\
1899 PyObject *tmp = (PyObject *) r;\
1900 r = v; __Pyx_DECREF(tmp);\
1902 #define __Pyx_CLEAR(r) do { PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);} while(0)
1903 #define __Pyx_XCLEAR(r) do { if((r) != NULL) {PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);}} while(0)
1906 static void __Pyx_RaiseArgtupleInvalid(
const char* func_name,
int exact,
1907 Py_ssize_t num_min, Py_ssize_t num_max, Py_ssize_t num_found);
1910 static void __Pyx_RaiseDoubleKeywordsError(
const char* func_name, PyObject* kw_name);
1913 static int __Pyx_ParseOptionalKeywords(PyObject *kwds, PyObject **argnames[],\
1914 PyObject *kwds2, PyObject *values[], Py_ssize_t num_pos_args,\
1915 const char* function_name);
1918 #define __Pyx_ArgTypeTest(obj, type, none_allowed, name, exact)\
1919 ((likely((Py_TYPE(obj) == type) | (none_allowed && (obj == Py_None)))) ? 1 :\
1920 __Pyx__ArgTypeTest(obj, type, name, exact))
1921 static int __Pyx__ArgTypeTest(PyObject *obj, PyTypeObject *type,
const char *name,
int exact);
1924 #if CYTHON_USE_TYPE_SLOTS
1925 static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name);
1927 #define __Pyx_PyObject_GetAttrStr(o,n) PyObject_GetAttr(o,n)
1931 static PyObject *__Pyx_GetBuiltinName(PyObject *name);
1934 #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_TYPE_SLOTS
1935 #define __PYX_DICT_VERSION_INIT ((PY_UINT64_T) -1)
1936 #define __PYX_GET_DICT_VERSION(dict) (((PyDictObject*)(dict))->ma_version_tag)
1937 #define __PYX_UPDATE_DICT_CACHE(dict, value, cache_var, version_var)\
1938 (version_var) = __PYX_GET_DICT_VERSION(dict);\
1939 (cache_var) = (value);
1940 #define __PYX_PY_DICT_LOOKUP_IF_MODIFIED(VAR, DICT, LOOKUP) {\
1941 static PY_UINT64_T __pyx_dict_version = 0;\
1942 static PyObject *__pyx_dict_cached_value = NULL;\
1943 if (likely(__PYX_GET_DICT_VERSION(DICT) == __pyx_dict_version)) {\
1944 (VAR) = __pyx_dict_cached_value;\
1946 (VAR) = __pyx_dict_cached_value = (LOOKUP);\
1947 __pyx_dict_version = __PYX_GET_DICT_VERSION(DICT);\
1950 static CYTHON_INLINE PY_UINT64_T __Pyx_get_tp_dict_version(PyObject *obj);
1951 static CYTHON_INLINE PY_UINT64_T __Pyx_get_object_dict_version(PyObject *obj);
1952 static CYTHON_INLINE
int __Pyx_object_dict_version_matches(PyObject* obj, PY_UINT64_T tp_dict_version, PY_UINT64_T obj_dict_version);
1954 #define __PYX_GET_DICT_VERSION(dict) (0)
1955 #define __PYX_UPDATE_DICT_CACHE(dict, value, cache_var, version_var)
1956 #define __PYX_PY_DICT_LOOKUP_IF_MODIFIED(VAR, DICT, LOOKUP) (VAR) = (LOOKUP);
1960 #if CYTHON_USE_DICT_VERSIONS
1961 #define __Pyx_GetModuleGlobalName(var, name) {\
1962 static PY_UINT64_T __pyx_dict_version = 0;\
1963 static PyObject *__pyx_dict_cached_value = NULL;\
1964 (var) = (likely(__pyx_dict_version == __PYX_GET_DICT_VERSION(__pyx_d))) ?\
1965 (likely(__pyx_dict_cached_value) ? __Pyx_NewRef(__pyx_dict_cached_value) : __Pyx_GetBuiltinName(name)) :\
1966 __Pyx__GetModuleGlobalName(name, &__pyx_dict_version, &__pyx_dict_cached_value);\
1968 #define __Pyx_GetModuleGlobalNameUncached(var, name) {\
1969 PY_UINT64_T __pyx_dict_version;\
1970 PyObject *__pyx_dict_cached_value;\
1971 (var) = __Pyx__GetModuleGlobalName(name, &__pyx_dict_version, &__pyx_dict_cached_value);\
1973 static PyObject *__Pyx__GetModuleGlobalName(PyObject *name, PY_UINT64_T *dict_version, PyObject **dict_cached_value);
1975 #define __Pyx_GetModuleGlobalName(var, name) (var) = __Pyx__GetModuleGlobalName(name)
1976 #define __Pyx_GetModuleGlobalNameUncached(var, name) (var) = __Pyx__GetModuleGlobalName(name)
1977 static CYTHON_INLINE PyObject *__Pyx__GetModuleGlobalName(PyObject *name);
1981 #if !CYTHON_COMPILING_IN_PYPY
1982 static PyObject* __Pyx_PyInt_AddObjC(PyObject *op1, PyObject *op2,
long intval,
int inplace,
int zerodivision_check);
1984 #define __Pyx_PyInt_AddObjC(op1, op2, intval, inplace, zerodivision_check)\
1985 (inplace ? PyNumber_InPlaceAdd(op1, op2) : PyNumber_Add(op1, op2))
1989 #if CYTHON_FAST_PYCCALL
1990 static CYTHON_INLINE PyObject *__Pyx_PyCFunction_FastCall(PyObject *func, PyObject **args, Py_ssize_t nargs);
1992 #define __Pyx_PyCFunction_FastCall(func, args, nargs) (assert(0), NULL)
1996 #if CYTHON_FAST_PYCALL
1997 #define __Pyx_PyFunction_FastCall(func, args, nargs)\
1998 __Pyx_PyFunction_FastCallDict((func), (args), (nargs), NULL)
1999 #if 1 || PY_VERSION_HEX < 0x030600B1
2000 static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args, Py_ssize_t nargs, PyObject *kwargs);
2002 #define __Pyx_PyFunction_FastCallDict(func, args, nargs, kwargs) _PyFunction_FastCallDict(func, args, nargs, kwargs)
2004 #define __Pyx_BUILD_ASSERT_EXPR(cond)\
2005 (sizeof(char [1 - 2*!(cond)]) - 1)
2006 #ifndef Py_MEMBER_SIZE
2007 #define Py_MEMBER_SIZE(type, member) sizeof(((type *)0)->member)
2009 #if CYTHON_FAST_PYCALL
2010 static size_t __pyx_pyframe_localsplus_offset = 0;
2011 #include "frameobject.h"
2012 #if PY_VERSION_HEX >= 0x030b00a6
2013 #ifndef Py_BUILD_CORE
2014 #define Py_BUILD_CORE 1
2016 #include "internal/pycore_frame.h"
2018 #define __Pxy_PyFrame_Initialize_Offsets()\
2019 ((void)__Pyx_BUILD_ASSERT_EXPR(sizeof(PyFrameObject) == offsetof(PyFrameObject, f_localsplus) + Py_MEMBER_SIZE(PyFrameObject, f_localsplus)),\
2020 (void)(__pyx_pyframe_localsplus_offset = ((size_t)PyFrame_Type.tp_basicsize) - Py_MEMBER_SIZE(PyFrameObject, f_localsplus)))
2021 #define __Pyx_PyFrame_GetLocalsplus(frame)\
2022 (assert(__pyx_pyframe_localsplus_offset), (PyObject **)(((char *)(frame)) + __pyx_pyframe_localsplus_offset))
2023 #endif // CYTHON_FAST_PYCALL
2027 #if CYTHON_COMPILING_IN_CPYTHON
2028 static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw);
2030 #define __Pyx_PyObject_Call(func, arg, kw) PyObject_Call(func, arg, kw)
2034 static CYTHON_UNUSED PyObject* __Pyx_PyObject_Call2Args(PyObject*
function, PyObject* arg1, PyObject* arg2);
2037 #if CYTHON_COMPILING_IN_CPYTHON
2038 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg);
2042 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg);
2045 #if CYTHON_COMPILING_IN_CPYTHON
2046 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallNoArg(PyObject *func);
2048 #define __Pyx_PyObject_CallNoArg(func) __Pyx_PyObject_Call(func, __pyx_empty_tuple, NULL)
2052 #if CYTHON_USE_EXC_INFO_STACK
2053 static _PyErr_StackItem * __Pyx_PyErr_GetTopmostException(PyThreadState *tstate);
2057 #if CYTHON_FAST_THREAD_STATE
2058 #define __Pyx_PyThreadState_declare PyThreadState *__pyx_tstate;
2059 #define __Pyx_PyThreadState_assign __pyx_tstate = __Pyx_PyThreadState_Current;
2060 #define __Pyx_PyErr_Occurred() __pyx_tstate->curexc_type
2062 #define __Pyx_PyThreadState_declare
2063 #define __Pyx_PyThreadState_assign
2064 #define __Pyx_PyErr_Occurred() PyErr_Occurred()
2068 #if CYTHON_FAST_THREAD_STATE
2069 #define __Pyx_ExceptionSave(type, value, tb) __Pyx__ExceptionSave(__pyx_tstate, type, value, tb)
2070 static CYTHON_INLINE
void __Pyx__ExceptionSave(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb);
2071 #define __Pyx_ExceptionReset(type, value, tb) __Pyx__ExceptionReset(__pyx_tstate, type, value, tb)
2072 static CYTHON_INLINE
void __Pyx__ExceptionReset(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb);
2074 #define __Pyx_ExceptionSave(type, value, tb) PyErr_GetExcInfo(type, value, tb)
2075 #define __Pyx_ExceptionReset(type, value, tb) PyErr_SetExcInfo(type, value, tb)
2079 #if CYTHON_FAST_THREAD_STATE
2080 #define __Pyx_PyErr_ExceptionMatches(err) __Pyx_PyErr_ExceptionMatchesInState(__pyx_tstate, err)
2081 static CYTHON_INLINE
int __Pyx_PyErr_ExceptionMatchesInState(PyThreadState* tstate, PyObject* err);
2083 #define __Pyx_PyErr_ExceptionMatches(err) PyErr_ExceptionMatches(err)
2087 #if CYTHON_FAST_THREAD_STATE
2088 #define __Pyx_GetException(type, value, tb) __Pyx__GetException(__pyx_tstate, type, value, tb)
2089 static int __Pyx__GetException(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb);
2091 static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb);
2095 #if CYTHON_FAST_THREAD_STATE
2096 #define __Pyx_PyErr_Clear() __Pyx_ErrRestore(NULL, NULL, NULL)
2097 #define __Pyx_ErrRestoreWithState(type, value, tb) __Pyx_ErrRestoreInState(PyThreadState_GET(), type, value, tb)
2098 #define __Pyx_ErrFetchWithState(type, value, tb) __Pyx_ErrFetchInState(PyThreadState_GET(), type, value, tb)
2099 #define __Pyx_ErrRestore(type, value, tb) __Pyx_ErrRestoreInState(__pyx_tstate, type, value, tb)
2100 #define __Pyx_ErrFetch(type, value, tb) __Pyx_ErrFetchInState(__pyx_tstate, type, value, tb)
2101 static CYTHON_INLINE
void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb);
2102 static CYTHON_INLINE
void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb);
2103 #if CYTHON_COMPILING_IN_CPYTHON
2104 #define __Pyx_PyErr_SetNone(exc) (Py_INCREF(exc), __Pyx_ErrRestore((exc), NULL, NULL))
2106 #define __Pyx_PyErr_SetNone(exc) PyErr_SetNone(exc)
2109 #define __Pyx_PyErr_Clear() PyErr_Clear()
2110 #define __Pyx_PyErr_SetNone(exc) PyErr_SetNone(exc)
2111 #define __Pyx_ErrRestoreWithState(type, value, tb) PyErr_Restore(type, value, tb)
2112 #define __Pyx_ErrFetchWithState(type, value, tb) PyErr_Fetch(type, value, tb)
2113 #define __Pyx_ErrRestoreInState(tstate, type, value, tb) PyErr_Restore(type, value, tb)
2114 #define __Pyx_ErrFetchInState(tstate, type, value, tb) PyErr_Fetch(type, value, tb)
2115 #define __Pyx_ErrRestore(type, value, tb) PyErr_Restore(type, value, tb)
2116 #define __Pyx_ErrFetch(type, value, tb) PyErr_Fetch(type, value, tb)
2120 static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause);
2126 static CYTHON_INLINE
int __Pyx_PyBytes_Equals(PyObject* s1, PyObject* s2,
int equals);
2129 static CYTHON_INLINE
int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2,
int equals);
2132 #if PY_MAJOR_VERSION >= 3
2133 #define __Pyx_PyString_Equals __Pyx_PyUnicode_Equals
2135 #define __Pyx_PyString_Equals __Pyx_PyBytes_Equals
2139 static CYTHON_INLINE Py_ssize_t __Pyx_div_Py_ssize_t(Py_ssize_t, Py_ssize_t);
2142 #define UNARY_NEG_WOULD_OVERFLOW(x)\
2143 (((x) < 0) & ((unsigned long)(x) == 0-(unsigned long)(x)))
2145 static CYTHON_UNUSED
int __pyx_array_getbuffer(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info,
int __pyx_v_flags);
2146 static PyObject *__pyx_array_get_memview(
struct __pyx_array_obj *);
2148 static CYTHON_INLINE PyObject *__Pyx_GetAttr(PyObject *, PyObject *);
2151 #define __Pyx_GetItemInt(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\
2152 (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\
2153 __Pyx_GetItemInt_Fast(o, (Py_ssize_t)i, is_list, wraparound, boundscheck) :\
2154 (is_list ? (PyErr_SetString(PyExc_IndexError, "list index out of range"), (PyObject*)NULL) :\
2155 __Pyx_GetItemInt_Generic(o, to_py_func(i))))
2156 #define __Pyx_GetItemInt_List(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\
2157 (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\
2158 __Pyx_GetItemInt_List_Fast(o, (Py_ssize_t)i, wraparound, boundscheck) :\
2159 (PyErr_SetString(PyExc_IndexError, "list index out of range"), (PyObject*)NULL))
2160 static CYTHON_INLINE PyObject *__Pyx_GetItemInt_List_Fast(PyObject *o, Py_ssize_t i,
2161 int wraparound,
int boundscheck);
2162 #define __Pyx_GetItemInt_Tuple(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\
2163 (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\
2164 __Pyx_GetItemInt_Tuple_Fast(o, (Py_ssize_t)i, wraparound, boundscheck) :\
2165 (PyErr_SetString(PyExc_IndexError, "tuple index out of range"), (PyObject*)NULL))
2166 static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize_t i,
2167 int wraparound,
int boundscheck);
2168 static PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j);
2169 static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i,
2170 int is_list,
int wraparound,
int boundscheck);
2173 #if CYTHON_USE_TYPE_SLOTS
2174 static CYTHON_INLINE PyObject *__Pyx_PyObject_GetItem(PyObject *obj, PyObject* key);
2176 #define __Pyx_PyObject_GetItem(obj, key) PyObject_GetItem(obj, key)
2180 static CYTHON_INLINE PyObject *__Pyx_PyUnicode_DecodeUTF16(
const char *
s, Py_ssize_t size,
const char *errors) {
2182 return PyUnicode_DecodeUTF16(
s, size, errors, &byteorder);
2184 static CYTHON_INLINE PyObject *__Pyx_PyUnicode_DecodeUTF16LE(
const char *
s, Py_ssize_t size,
const char *errors) {
2186 return PyUnicode_DecodeUTF16(
s, size, errors, &byteorder);
2188 static CYTHON_INLINE PyObject *__Pyx_PyUnicode_DecodeUTF16BE(
const char *
s, Py_ssize_t size,
const char *errors) {
2190 return PyUnicode_DecodeUTF16(
s, size, errors, &byteorder);
2194 static CYTHON_INLINE PyObject* __Pyx_decode_c_string(
2195 const char* cstring, Py_ssize_t start, Py_ssize_t stop,
2196 const char* encoding,
const char* errors,
2197 PyObject* (*decode_func)(
const char *
s, Py_ssize_t size,
const char *errors));
2200 static CYTHON_INLINE PyObject *__Pyx_GetAttr3(PyObject *, PyObject *, PyObject *);
2203 static CYTHON_INLINE
void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected);
2206 static CYTHON_INLINE
void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index);
2209 static CYTHON_INLINE
void __Pyx_RaiseNoneNotIterableError(
void);
2212 static CYTHON_INLINE
int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type);
2215 #if CYTHON_FAST_THREAD_STATE
2216 #define __Pyx_ExceptionSwap(type, value, tb) __Pyx__ExceptionSwap(__pyx_tstate, type, value, tb)
2217 static CYTHON_INLINE
void __Pyx__ExceptionSwap(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb);
2219 static CYTHON_INLINE
void __Pyx_ExceptionSwap(PyObject **type, PyObject **value, PyObject **tb);
2223 static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list,
int level);
2226 #if CYTHON_COMPILING_IN_CPYTHON
2227 #define __Pyx_TypeCheck(obj, type) __Pyx_IsSubtype(Py_TYPE(obj), (PyTypeObject *)type)
2228 static CYTHON_INLINE
int __Pyx_IsSubtype(PyTypeObject *a, PyTypeObject *b);
2229 static CYTHON_INLINE
int __Pyx_PyErr_GivenExceptionMatches(PyObject *err, PyObject *type);
2230 static CYTHON_INLINE
int __Pyx_PyErr_GivenExceptionMatches2(PyObject *err, PyObject *type1, PyObject *type2);
2232 #define __Pyx_TypeCheck(obj, type) PyObject_TypeCheck(obj, (PyTypeObject *)type)
2233 #define __Pyx_PyErr_GivenExceptionMatches(err, type) PyErr_GivenExceptionMatches(err, type)
2234 #define __Pyx_PyErr_GivenExceptionMatches2(err, type1, type2) (PyErr_GivenExceptionMatches(err, type1) || PyErr_GivenExceptionMatches(err, type2))
2236 #define __Pyx_PyException_Check(obj) __Pyx_TypeCheck(obj, PyExc_Exception)
2238 static CYTHON_UNUSED
int __pyx_memoryview_getbuffer(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info,
int __pyx_v_flags);
2240 #if CYTHON_USE_PYLIST_INTERNALS && CYTHON_ASSUME_SAFE_MACROS
2241 static CYTHON_INLINE
int __Pyx_ListComp_Append(PyObject* list, PyObject* x) {
2242 PyListObject*
L = (PyListObject*) list;
2243 Py_ssize_t len = Py_SIZE(list);
2244 if (likely(
L->allocated > len)) {
2246 PyList_SET_ITEM(list, len, x);
2247 __Pyx_SET_SIZE(list, len + 1);
2250 return PyList_Append(list, x);
2253 #define __Pyx_ListComp_Append(L,x) PyList_Append(L,x)
2257 static CYTHON_INLINE
int __Pyx_PyList_Extend(PyObject*
L, PyObject*
v) {
2258 #if CYTHON_COMPILING_IN_CPYTHON
2259 PyObject* none = _PyList_Extend((PyListObject*)
L,
v);
2260 if (unlikely(!none))
2265 return PyList_SetSlice(
L, PY_SSIZE_T_MAX, PY_SSIZE_T_MAX,
v);
2270 #if CYTHON_USE_PYLIST_INTERNALS && CYTHON_ASSUME_SAFE_MACROS
2271 static CYTHON_INLINE
int __Pyx_PyList_Append(PyObject* list, PyObject* x) {
2272 PyListObject*
L = (PyListObject*) list;
2273 Py_ssize_t len = Py_SIZE(list);
2274 if (likely(
L->allocated > len) & likely(len > (
L->allocated >> 1))) {
2276 PyList_SET_ITEM(list, len, x);
2277 __Pyx_SET_SIZE(list, len + 1);
2280 return PyList_Append(list, x);
2283 #define __Pyx_PyList_Append(L,x) PyList_Append(L,x)
2287 static CYTHON_INLINE
void __Pyx_RaiseUnboundLocalError(
const char *varname);
2290 static CYTHON_INLINE
long __Pyx_div_long(
long,
long);
2293 static CYTHON_INLINE
int __Pyx_PySequence_ContainsTF(PyObject* item, PyObject* seq,
int eq) {
2294 int result = PySequence_Contains(seq, item);
2295 return unlikely(result < 0) ? result : (result == (eq == Py_EQ));
2299 static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name);
2302 static CYTHON_INLINE
int __Pyx_HasAttr(PyObject *, PyObject *);
2305 #if PY_MAJOR_VERSION < 3
2306 #define __Pyx_PyString_Join __Pyx_PyBytes_Join
2307 #define __Pyx_PyBaseString_Join(s, v) (PyUnicode_CheckExact(s) ? PyUnicode_Join(s, v) : __Pyx_PyBytes_Join(s, v))
2309 #define __Pyx_PyString_Join PyUnicode_Join
2310 #define __Pyx_PyBaseString_Join PyUnicode_Join
2312 #if CYTHON_COMPILING_IN_CPYTHON
2313 #if PY_MAJOR_VERSION < 3
2314 #define __Pyx_PyBytes_Join _PyString_Join
2316 #define __Pyx_PyBytes_Join _PyBytes_Join
2319 static CYTHON_INLINE PyObject* __Pyx_PyBytes_Join(PyObject* sep, PyObject* values);
2323 #if PY_MAJOR_VERSION >= 3
2324 #define __Pyx_PyObject_Unicode(obj)\
2325 (likely(PyUnicode_CheckExact(obj)) ? __Pyx_NewRef(obj) : PyObject_Str(obj))
2327 #define __Pyx_PyObject_Unicode(obj)\
2328 (likely(PyUnicode_CheckExact(obj)) ? __Pyx_NewRef(obj) : PyObject_Unicode(obj))
2332 #if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000
2333 static CYTHON_INLINE PyObject* __Pyx_PyObject_GenericGetAttrNoDict(PyObject* obj, PyObject* attr_name);
2335 #define __Pyx_PyObject_GenericGetAttrNoDict PyObject_GenericGetAttr
2339 #if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000
2340 static PyObject* __Pyx_PyObject_GenericGetAttr(PyObject* obj, PyObject* attr_name);
2342 #define __Pyx_PyObject_GenericGetAttr PyObject_GenericGetAttr
2346 static int __Pyx_SetVtable(PyObject *dict,
void *vtable);
2349 static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStrNoError(PyObject* obj, PyObject* attr_name);
2352 static int __Pyx_setup_reduce(PyObject* type_obj);
2355 #ifndef __PYX_HAVE_RT_ImportType_proto
2356 #define __PYX_HAVE_RT_ImportType_proto
2357 enum __Pyx_ImportType_CheckSize {
2358 __Pyx_ImportType_CheckSize_Error = 0,
2359 __Pyx_ImportType_CheckSize_Warn = 1,
2360 __Pyx_ImportType_CheckSize_Ignore = 2
2362 static PyTypeObject *__Pyx_ImportType(PyObject* module,
const char *module_name,
const char *class_name,
size_t size,
enum __Pyx_ImportType_CheckSize check_size);
2366 #ifdef CYTHON_CLINE_IN_TRACEBACK
2367 #define __Pyx_CLineForTraceback(tstate, c_line) (((CYTHON_CLINE_IN_TRACEBACK)) ? c_line : 0)
2369 static int __Pyx_CLineForTraceback(PyThreadState *tstate,
int c_line);
2374 PyCodeObject* code_object;
2376 } __Pyx_CodeObjectCacheEntry;
2377 struct __Pyx_CodeObjectCache {
2380 __Pyx_CodeObjectCacheEntry* entries;
2382 static struct __Pyx_CodeObjectCache __pyx_code_cache = {0,0,NULL};
2383 static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries,
int count,
int code_line);
2384 static PyCodeObject *__pyx_find_code_object(
int code_line);
2385 static void __pyx_insert_code_object(
int code_line, PyCodeObject* code_object);
2388 static void __Pyx_AddTraceback(
const char *funcname,
int c_line,
2389 int py_line,
const char *filename);
2392 #if defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 6))
2393 #define __Pyx_HAS_GCC_DIAGNOSTIC
2397 static CYTHON_INLINE PyObject *__pyx_memview_get_int(
const char *itemp);
2398 static CYTHON_INLINE
int __pyx_memview_set_int(
const char *itemp, PyObject *obj);
2403 #define __Pyx_CREAL(z) ((z).real())
2404 #define __Pyx_CIMAG(z) ((z).imag())
2406 #define __Pyx_CREAL(z) (__real__(z))
2407 #define __Pyx_CIMAG(z) (__imag__(z))
2410 #define __Pyx_CREAL(z) ((z).real)
2411 #define __Pyx_CIMAG(z) ((z).imag)
2413 #if defined(__cplusplus) && CYTHON_CCOMPLEX\
2414 && (defined(_WIN32) || defined(__clang__) || (defined(__GNUC__) && (__GNUC__ >= 5 || __GNUC__ == 4 && __GNUC_MINOR__ >= 4 )) || __cplusplus >= 201103)
2415 #define __Pyx_SET_CREAL(z,x) ((z).real(x))
2416 #define __Pyx_SET_CIMAG(z,y) ((z).imag(y))
2418 #define __Pyx_SET_CREAL(z,x) __Pyx_CREAL(z) = (x)
2419 #define __Pyx_SET_CIMAG(z,y) __Pyx_CIMAG(z) = (y)
2424 #define __Pyx_c_eq_float(a, b) ((a)==(b))
2425 #define __Pyx_c_sum_float(a, b) ((a)+(b))
2426 #define __Pyx_c_diff_float(a, b) ((a)-(b))
2427 #define __Pyx_c_prod_float(a, b) ((a)*(b))
2428 #define __Pyx_c_quot_float(a, b) ((a)/(b))
2429 #define __Pyx_c_neg_float(a) (-(a))
2431 #define __Pyx_c_is_zero_float(z) ((z)==(float)0)
2432 #define __Pyx_c_conj_float(z) (::std::conj(z))
2434 #define __Pyx_c_abs_float(z) (::std::abs(z))
2435 #define __Pyx_c_pow_float(a, b) (::std::pow(a, b))
2438 #define __Pyx_c_is_zero_float(z) ((z)==0)
2439 #define __Pyx_c_conj_float(z) (conjf(z))
2441 #define __Pyx_c_abs_float(z) (cabsf(z))
2442 #define __Pyx_c_pow_float(a, b) (cpowf(a, b))
2446 static CYTHON_INLINE
int __Pyx_c_eq_float(__pyx_t_float_complex, __pyx_t_float_complex);
2447 static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_sum_float(__pyx_t_float_complex, __pyx_t_float_complex);
2448 static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_diff_float(__pyx_t_float_complex, __pyx_t_float_complex);
2449 static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_prod_float(__pyx_t_float_complex, __pyx_t_float_complex);
2450 static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_quot_float(__pyx_t_float_complex, __pyx_t_float_complex);
2451 static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_neg_float(__pyx_t_float_complex);
2452 static CYTHON_INLINE
int __Pyx_c_is_zero_float(__pyx_t_float_complex);
2453 static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_conj_float(__pyx_t_float_complex);
2455 static CYTHON_INLINE
float __Pyx_c_abs_float(__pyx_t_float_complex);
2456 static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_pow_float(__pyx_t_float_complex, __pyx_t_float_complex);
2462 #define __Pyx_c_eq_double(a, b) ((a)==(b))
2463 #define __Pyx_c_sum_double(a, b) ((a)+(b))
2464 #define __Pyx_c_diff_double(a, b) ((a)-(b))
2465 #define __Pyx_c_prod_double(a, b) ((a)*(b))
2466 #define __Pyx_c_quot_double(a, b) ((a)/(b))
2467 #define __Pyx_c_neg_double(a) (-(a))
2469 #define __Pyx_c_is_zero_double(z) ((z)==(double)0)
2470 #define __Pyx_c_conj_double(z) (::std::conj(z))
2472 #define __Pyx_c_abs_double(z) (::std::abs(z))
2473 #define __Pyx_c_pow_double(a, b) (::std::pow(a, b))
2476 #define __Pyx_c_is_zero_double(z) ((z)==0)
2477 #define __Pyx_c_conj_double(z) (conj(z))
2479 #define __Pyx_c_abs_double(z) (cabs(z))
2480 #define __Pyx_c_pow_double(a, b) (cpow(a, b))
2484 static CYTHON_INLINE
int __Pyx_c_eq_double(__pyx_t_double_complex, __pyx_t_double_complex);
2485 static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_sum_double(__pyx_t_double_complex, __pyx_t_double_complex);
2486 static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_diff_double(__pyx_t_double_complex, __pyx_t_double_complex);
2487 static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_prod_double(__pyx_t_double_complex, __pyx_t_double_complex);
2488 static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_quot_double(__pyx_t_double_complex, __pyx_t_double_complex);
2489 static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_neg_double(__pyx_t_double_complex);
2490 static CYTHON_INLINE
int __Pyx_c_is_zero_double(__pyx_t_double_complex);
2491 static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_conj_double(__pyx_t_double_complex);
2493 static CYTHON_INLINE
double __Pyx_c_abs_double(__pyx_t_double_complex);
2494 static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_pow_double(__pyx_t_double_complex, __pyx_t_double_complex);
2498 #if PY_MAJOR_VERSION < 3
2499 static int __Pyx_GetBuffer(PyObject *obj, Py_buffer *view,
int flags);
2500 static void __Pyx_ReleaseBuffer(Py_buffer *view);
2502 #define __Pyx_GetBuffer PyObject_GetBuffer
2503 #define __Pyx_ReleaseBuffer PyBuffer_Release
2509 Py_ssize_t shape, strides, suboffsets;
2510 } __Pyx_Buf_DimInfo;
2516 __Pyx_Buffer *rcbuffer;
2518 __Pyx_Buf_DimInfo diminfo[8];
2519 } __Pyx_LocalBuf_ND;
2522 static int __pyx_memviewslice_is_contig(
const __Pyx_memviewslice mvs,
char order,
int ndim);
2525 static int __pyx_slices_overlap(__Pyx_memviewslice *slice1,
2526 __Pyx_memviewslice *slice2,
2527 int ndim,
size_t itemsize);
2530 static CYTHON_INLINE PyObject *__pyx_capsule_create(
void *p,
const char *sig);
2533 static CYTHON_INLINE
int __Pyx_PyInt_As_int(PyObject *);
2536 static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(
int value);
2539 struct __pyx_typeinfo_string {
2542 static struct __pyx_typeinfo_string __Pyx_TypeInfoToFormat(__Pyx_TypeInfo *type);
2545 static __Pyx_memviewslice
2546 __pyx_memoryview_copy_new_contig(
const __Pyx_memviewslice *from_mvs,
2547 const char *mode,
int ndim,
2548 size_t sizeof_dtype,
int contig_flag,
2549 int dtype_is_object);
2552 #define __Pyx_BUF_MAX_NDIMS %(BUF_MAX_NDIMS)d
2553 #define __Pyx_MEMVIEW_DIRECT 1
2554 #define __Pyx_MEMVIEW_PTR 2
2555 #define __Pyx_MEMVIEW_FULL 4
2556 #define __Pyx_MEMVIEW_CONTIG 8
2557 #define __Pyx_MEMVIEW_STRIDED 16
2558 #define __Pyx_MEMVIEW_FOLLOW 32
2559 #define __Pyx_IS_C_CONTIG 1
2560 #define __Pyx_IS_F_CONTIG 2
2561 static int __Pyx_init_memviewslice(
2562 struct __pyx_memoryview_obj *memview,
2564 __Pyx_memviewslice *memviewslice,
2565 int memview_is_new_reference);
2566 static CYTHON_INLINE
int __pyx_add_acquisition_count_locked(
2567 __pyx_atomic_int *acquisition_count, PyThread_type_lock lock);
2568 static CYTHON_INLINE
int __pyx_sub_acquisition_count_locked(
2569 __pyx_atomic_int *acquisition_count, PyThread_type_lock lock);
2570 #define __pyx_get_slice_count_pointer(memview) (memview->acquisition_count_aligned_p)
2571 #define __pyx_get_slice_count(memview) (*__pyx_get_slice_count_pointer(memview))
2572 #define __PYX_INC_MEMVIEW(slice, have_gil) __Pyx_INC_MEMVIEW(slice, have_gil, __LINE__)
2573 #define __PYX_XDEC_MEMVIEW(slice, have_gil) __Pyx_XDEC_MEMVIEW(slice, have_gil, __LINE__)
2574 static CYTHON_INLINE
void __Pyx_INC_MEMVIEW(__Pyx_memviewslice *,
int,
int);
2575 static CYTHON_INLINE
void __Pyx_XDEC_MEMVIEW(__Pyx_memviewslice *,
int,
int);
2578 static CYTHON_INLINE
long __Pyx_PyInt_As_long(PyObject *);
2581 static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(
long value);
2584 static CYTHON_INLINE
char __Pyx_PyInt_As_char(PyObject *);
2587 static int __Pyx_check_binary_version(
void);
2590 static int __Pyx_InitStrings(__Pyx_StringTabEntry *t);
2592 static PyObject *__pyx_array_get_memview(
struct __pyx_array_obj *__pyx_v_self);
2593 static char *__pyx_memoryview_get_item_pointer(
struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index);
2594 static PyObject *__pyx_memoryview_is_slice(
struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_obj);
2595 static PyObject *__pyx_memoryview_setitem_slice_assignment(
struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_dst, PyObject *__pyx_v_src);
2596 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);
2597 static PyObject *__pyx_memoryview_setitem_indexed(
struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index, PyObject *__pyx_v_value);
2598 static PyObject *__pyx_memoryview_convert_item_to_object(
struct __pyx_memoryview_obj *__pyx_v_self,
char *__pyx_v_itemp);
2599 static PyObject *__pyx_memoryview_assign_item_from_object(
struct __pyx_memoryview_obj *__pyx_v_self,
char *__pyx_v_itemp, PyObject *__pyx_v_value);
2600 static PyObject *__pyx_memoryviewslice_convert_item_to_object(
struct __pyx_memoryviewslice_obj *__pyx_v_self,
char *__pyx_v_itemp);
2601 static PyObject *__pyx_memoryviewslice_assign_item_from_object(
struct __pyx_memoryviewslice_obj *__pyx_v_self,
char *__pyx_v_itemp, PyObject *__pyx_v_value);
2612 static PyTypeObject *__pyx_ptype_7cpython_4type_type = 0;
2625 static PyTypeObject *__pyx_ptype_5numpy_dtype = 0;
2626 static PyTypeObject *__pyx_ptype_5numpy_flatiter = 0;
2627 static PyTypeObject *__pyx_ptype_5numpy_broadcast = 0;
2628 static PyTypeObject *__pyx_ptype_5numpy_ndarray = 0;
2629 static PyTypeObject *__pyx_ptype_5numpy_generic = 0;
2630 static PyTypeObject *__pyx_ptype_5numpy_number = 0;
2631 static PyTypeObject *__pyx_ptype_5numpy_integer = 0;
2632 static PyTypeObject *__pyx_ptype_5numpy_signedinteger = 0;
2633 static PyTypeObject *__pyx_ptype_5numpy_unsignedinteger = 0;
2634 static PyTypeObject *__pyx_ptype_5numpy_inexact = 0;
2635 static PyTypeObject *__pyx_ptype_5numpy_floating = 0;
2636 static PyTypeObject *__pyx_ptype_5numpy_complexfloating = 0;
2637 static PyTypeObject *__pyx_ptype_5numpy_flexible = 0;
2638 static PyTypeObject *__pyx_ptype_5numpy_character = 0;
2639 static PyTypeObject *__pyx_ptype_5numpy_ufunc = 0;
2644 static PyTypeObject *__pyx_ptype_6mpi4py_3MPI_Datatype = 0;
2645 static PyTypeObject *__pyx_ptype_6mpi4py_3MPI_Status = 0;
2646 static PyTypeObject *__pyx_ptype_6mpi4py_3MPI_Request = 0;
2647 static PyTypeObject *__pyx_ptype_6mpi4py_3MPI_Prequest = 0;
2648 static PyTypeObject *__pyx_ptype_6mpi4py_3MPI_Grequest = 0;
2649 static PyTypeObject *__pyx_ptype_6mpi4py_3MPI_Message = 0;
2650 static PyTypeObject *__pyx_ptype_6mpi4py_3MPI_Op = 0;
2651 static PyTypeObject *__pyx_ptype_6mpi4py_3MPI_Group = 0;
2652 static PyTypeObject *__pyx_ptype_6mpi4py_3MPI_Info = 0;
2653 static PyTypeObject *__pyx_ptype_6mpi4py_3MPI_Errhandler = 0;
2654 static PyTypeObject *__pyx_ptype_6mpi4py_3MPI_Comm = 0;
2655 static PyTypeObject *__pyx_ptype_6mpi4py_3MPI_Intracomm = 0;
2656 static PyTypeObject *__pyx_ptype_6mpi4py_3MPI_Topocomm = 0;
2657 static PyTypeObject *__pyx_ptype_6mpi4py_3MPI_Cartcomm = 0;
2658 static PyTypeObject *__pyx_ptype_6mpi4py_3MPI_Graphcomm = 0;
2659 static PyTypeObject *__pyx_ptype_6mpi4py_3MPI_Distgraphcomm = 0;
2660 static PyTypeObject *__pyx_ptype_6mpi4py_3MPI_Intercomm = 0;
2661 static PyTypeObject *__pyx_ptype_6mpi4py_3MPI_Win = 0;
2662 static PyTypeObject *__pyx_ptype_6mpi4py_3MPI_File = 0;
2673 static PyTypeObject *__pyx_ptype_7proteus_10cmeshTools_CMesh = 0;
2678 static PyTypeObject *__pyx_array_type = 0;
2679 static PyTypeObject *__pyx_MemviewEnum_type = 0;
2680 static PyTypeObject *__pyx_memoryview_type = 0;
2681 static PyTypeObject *__pyx_memoryviewslice_type = 0;
2682 static PyObject *
generic = 0;
2683 static PyObject *strided = 0;
2684 static PyObject *indirect = 0;
2685 static PyObject *contiguous = 0;
2686 static PyObject *indirect_contiguous = 0;
2687 static int __pyx_memoryview_thread_locks_used;
2688 static PyThread_type_lock __pyx_memoryview_thread_locks[8];
2689 static struct __pyx_array_obj *__pyx_array_new(PyObject *, Py_ssize_t,
char *,
char *,
char *);
2690 static void *__pyx_align_pointer(
void *,
size_t);
2691 static PyObject *__pyx_memoryview_new(PyObject *,
int,
int, __Pyx_TypeInfo *);
2692 static CYTHON_INLINE
int __pyx_memoryview_check(PyObject *);
2693 static PyObject *_unellipsify(PyObject *,
int);
2694 static PyObject *assert_direct_dimensions(Py_ssize_t *,
int);
2695 static struct __pyx_memoryview_obj *__pyx_memview_slice(
struct __pyx_memoryview_obj *, PyObject *);
2696 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);
2697 static char *__pyx_pybuffer_index(Py_buffer *,
char *, Py_ssize_t, Py_ssize_t);
2698 static int __pyx_memslice_transpose(__Pyx_memviewslice *);
2699 static PyObject *__pyx_memoryview_fromslice(__Pyx_memviewslice,
int, PyObject *(*)(
char *),
int (*)(
char *, PyObject *),
int);
2700 static __Pyx_memviewslice *__pyx_memoryview_get_slice_from_memoryview(
struct __pyx_memoryview_obj *, __Pyx_memviewslice *);
2701 static void __pyx_memoryview_slice_copy(
struct __pyx_memoryview_obj *, __Pyx_memviewslice *);
2702 static PyObject *__pyx_memoryview_copy_object(
struct __pyx_memoryview_obj *);
2703 static PyObject *__pyx_memoryview_copy_object_from_slice(
struct __pyx_memoryview_obj *, __Pyx_memviewslice *);
2704 static Py_ssize_t abs_py_ssize_t(Py_ssize_t);
2705 static char __pyx_get_best_slice_order(__Pyx_memviewslice *,
int);
2706 static void _copy_strided_to_strided(
char *, Py_ssize_t *,
char *, Py_ssize_t *, Py_ssize_t *, Py_ssize_t *,
int,
size_t);
2707 static void copy_strided_to_strided(__Pyx_memviewslice *, __Pyx_memviewslice *,
int,
size_t);
2708 static Py_ssize_t __pyx_memoryview_slice_get_size(__Pyx_memviewslice *,
int);
2709 static Py_ssize_t __pyx_fill_contig_strides_array(Py_ssize_t *, Py_ssize_t *, Py_ssize_t,
int,
char);
2710 static void *__pyx_memoryview_copy_data_to_temp(__Pyx_memviewslice *, __Pyx_memviewslice *,
char,
int);
2711 static int __pyx_memoryview_err_extents(
int, Py_ssize_t, Py_ssize_t);
2712 static int __pyx_memoryview_err_dim(PyObject *,
char *,
int);
2713 static int __pyx_memoryview_err(PyObject *,
char *);
2714 static int __pyx_memoryview_copy_contents(__Pyx_memviewslice, __Pyx_memviewslice,
int,
int,
int);
2715 static void __pyx_memoryview_broadcast_leading(__Pyx_memviewslice *,
int,
int);
2716 static void __pyx_memoryview_refcount_copying(__Pyx_memviewslice *,
int,
int,
int);
2717 static void __pyx_memoryview_refcount_objects_in_slice_with_gil(
char *, Py_ssize_t *, Py_ssize_t *,
int,
int);
2718 static void __pyx_memoryview_refcount_objects_in_slice(
char *, Py_ssize_t *, Py_ssize_t *,
int,
int);
2719 static void __pyx_memoryview_slice_assign_scalar(__Pyx_memviewslice *,
int,
size_t,
void *,
int);
2720 static void __pyx_memoryview__slice_assign_scalar(
char *, Py_ssize_t *, Py_ssize_t *,
int,
size_t,
void *);
2721 static PyObject *__pyx_unpickle_Enum__set_state(
struct __pyx_MemviewEnum_obj *, PyObject *);
2722 static PyObject *__pyx_format_from_typeinfo(__Pyx_TypeInfo *);
2723 static __Pyx_TypeInfo __Pyx_TypeInfo_int = {
"int", NULL,
sizeof(int), { 0 }, 0, IS_UNSIGNED(
int) ?
'U' :
'I', IS_UNSIGNED(
int), 0 };
2724 #define __Pyx_MODULE_NAME "cpartitioning"
2725 extern int __pyx_module_is_main_cpartitioning;
2726 int __pyx_module_is_main_cpartitioning = 0;
2729 static PyObject *__pyx_builtin_ImportError;
2730 static PyObject *__pyx_builtin_ValueError;
2731 static PyObject *__pyx_builtin_MemoryError;
2732 static PyObject *__pyx_builtin_enumerate;
2733 static PyObject *__pyx_builtin_range;
2734 static PyObject *__pyx_builtin_TypeError;
2735 static PyObject *__pyx_builtin_Ellipsis;
2736 static PyObject *__pyx_builtin_id;
2737 static PyObject *__pyx_builtin_IndexError;
2738 static const char __pyx_k_O[] =
"O";
2739 static const char __pyx_k_T[] =
"T{";
2740 static const char __pyx_k_c[] =
"c";
2741 static const char __pyx_k_s[] =
"(%s)";
2742 static const char __pyx_k_id[] =
"id";
2743 static const char __pyx_k_np[] =
"np";
2744 static const char __pyx_k__22[] =
"^";
2745 static const char __pyx_k__23[] =
"";
2746 static const char __pyx_k__24[] =
":";
2747 static const char __pyx_k__25[] =
"}";
2748 static const char __pyx_k__26[] =
",";
2749 static const char __pyx_k_new[] =
"__new__";
2750 static const char __pyx_k_obj[] =
"obj";
2751 static const char __pyx_k_Comm[] =
"Comm";
2752 static const char __pyx_k_base[] =
"base";
2753 static const char __pyx_k_comm[] =
"comm";
2754 static const char __pyx_k_dict[] =
"__dict__";
2755 static const char __pyx_k_join[] =
"join";
2756 static const char __pyx_k_main[] =
"__main__";
2757 static const char __pyx_k_mode[] =
"mode";
2758 static const char __pyx_k_name[] =
"name";
2759 static const char __pyx_k_ndim[] =
"ndim";
2760 static const char __pyx_k_pack[] =
"pack";
2761 static const char __pyx_k_size[] =
"size";
2762 static const char __pyx_k_step[] =
"step";
2763 static const char __pyx_k_stop[] =
"stop";
2764 static const char __pyx_k_test[] =
"__test__";
2765 static const char __pyx_k_ASCII[] =
"ASCII";
2766 static const char __pyx_k_class[] =
"__class__";
2767 static const char __pyx_k_cmesh[] =
"cmesh";
2768 static const char __pyx_k_error[] =
"error";
2769 static const char __pyx_k_flags[] =
"flags";
2770 static const char __pyx_k_numpy[] =
"numpy";
2771 static const char __pyx_k_range[] =
"range";
2772 static const char __pyx_k_shape[] =
"shape";
2773 static const char __pyx_k_start[] =
"start";
2774 static const char __pyx_k_encode[] =
"encode";
2775 static const char __pyx_k_format[] =
"format";
2776 static const char __pyx_k_import[] =
"__import__";
2777 static const char __pyx_k_nSpace[] =
"nSpace";
2778 static const char __pyx_k_name_2[] =
"__name__";
2779 static const char __pyx_k_pickle[] =
"pickle";
2780 static const char __pyx_k_reduce[] =
"__reduce__";
2781 static const char __pyx_k_struct[] =
"struct";
2782 static const char __pyx_k_unpack[] =
"unpack";
2783 static const char __pyx_k_update[] =
"update";
2784 static const char __pyx_k_asarray[] =
"asarray";
2785 static const char __pyx_k_fortran[] =
"fortran";
2786 static const char __pyx_k_memview[] =
"memview";
2787 static const char __pyx_k_proteus[] =
"proteus";
2788 static const char __pyx_k_Ellipsis[] =
"Ellipsis";
2789 static const char __pyx_k_filebase[] =
"filebase";
2790 static const char __pyx_k_getstate[] =
"__getstate__";
2791 static const char __pyx_k_itemsize[] =
"itemsize";
2792 static const char __pyx_k_pyx_type[] =
"__pyx_type";
2793 static const char __pyx_k_setstate[] =
"__setstate__";
2794 static const char __pyx_k_TypeError[] =
"TypeError";
2795 static const char __pyx_k_enumerate[] =
"enumerate";
2796 static const char __pyx_k_indexBase[] =
"indexBase";
2797 static const char __pyx_k_pyx_state[] =
"__pyx_state";
2798 static const char __pyx_k_reduce_ex[] =
"__reduce_ex__";
2799 static const char __pyx_k_IndexError[] =
"IndexError";
2800 static const char __pyx_k_ValueError[] =
"ValueError";
2801 static const char __pyx_k_pyx_result[] =
"__pyx_result";
2802 static const char __pyx_k_pyx_vtable[] =
"__pyx_vtable__";
2803 static const char __pyx_k_ImportError[] =
"ImportError";
2804 static const char __pyx_k_MemoryError[] =
"MemoryError";
2805 static const char __pyx_k_PickleError[] =
"PickleError";
2806 static const char __pyx_k_nDOF_element[] =
"nDOF_element";
2807 static const char __pyx_k_proteus_Comm[] =
"proteus_Comm";
2808 static const char __pyx_k_pyx_checksum[] =
"__pyx_checksum";
2809 static const char __pyx_k_stringsource[] =
"stringsource";
2810 static const char __pyx_k_cpartitioning[] =
"cpartitioning";
2811 static const char __pyx_k_pyx_getbuffer[] =
"__pyx_getbuffer";
2812 static const char __pyx_k_reduce_cython[] =
"__reduce_cython__";
2813 static const char __pyx_k_nDOF_subdomain[] =
"nDOF_subdomain";
2814 static const char __pyx_k_partitionNodes[] =
"partitionNodes";
2815 static const char __pyx_k_View_MemoryView[] =
"View.MemoryView";
2816 static const char __pyx_k_allocate_buffer[] =
"allocate_buffer";
2817 static const char __pyx_k_dtype_is_object[] =
"dtype_is_object";
2818 static const char __pyx_k_pyx_PickleError[] =
"__pyx_PickleError";
2819 static const char __pyx_k_setstate_cython[] =
"__setstate_cython__";
2820 static const char __pyx_k_subdomain_cmesh[] =
"subdomain_cmesh";
2821 static const char __pyx_k_dg_subdomain_l2g[] =
"dg_subdomain_l2g";
2822 static const char __pyx_k_nLayersOfOverlap[] =
"nLayersOfOverlap";
2823 static const char __pyx_k_max_dof_neighbors[] =
"max_dof_neighbors";
2824 static const char __pyx_k_partitionElements[] =
"partitionElements";
2825 static const char __pyx_k_pyx_unpickle_Enum[] =
"__pyx_unpickle_Enum";
2826 static const char __pyx_k_cline_in_traceback[] =
"cline_in_traceback";
2827 static const char __pyx_k_nDOF_all_processes[] =
"nDOF_all_processes";
2828 static const char __pyx_k_strided_and_direct[] =
"<strided and direct>";
2829 static const char __pyx_k_strided_and_indirect[] =
"<strided and indirect>";
2830 static const char __pyx_k_contiguous_and_direct[] =
"<contiguous and direct>";
2831 static const char __pyx_k_MemoryView_of_r_object[] =
"<MemoryView of %r object>";
2832 static const char __pyx_k_MemoryView_of_r_at_0x_x[] =
"<MemoryView of %r at 0x%x>";
2833 static const char __pyx_k_contiguous_and_indirect[] =
"<contiguous and indirect>";
2834 static const char __pyx_k_quadratic_lagrangeNodes[] =
"quadratic_lagrangeNodes";
2835 static const char __pyx_k_quadratic_subdomain_l2g[] =
"quadratic_subdomain_l2g";
2836 static const char __pyx_k_Cannot_index_with_type_s[] =
"Cannot index with type '%s'";
2837 static const char __pyx_k_Invalid_shape_in_axis_d_d[] =
"Invalid shape in axis %d: %d.";
2838 static const char __pyx_k_proteus_cpartitioning_pyx[] =
"proteus/cpartitioning.pyx";
2839 static const char __pyx_k_edgeOffsets_subdomain_owned[] =
"edgeOffsets_subdomain_owned";
2840 static const char __pyx_k_itemsize_0_for_cython_array[] =
"itemsize <= 0 for cython.array";
2841 static const char __pyx_k_nodeOffsets_subdomain_owned[] =
"nodeOffsets_subdomain_owned";
2842 static const char __pyx_k_convertPUMIPartitionToPython[] =
"convertPUMIPartitionToPython";
2843 static const char __pyx_k_dgNumbering_subdomain2global[] =
"dgNumbering_subdomain2global";
2844 static const char __pyx_k_partitionNodesFromTetgenFiles[] =
"partitionNodesFromTetgenFiles";
2845 static const char __pyx_k_unable_to_allocate_array_data[] =
"unable to allocate array data.";
2846 static const char __pyx_k_dg_dof_offsets_subdomain_owned[] =
"dg_dof_offsets_subdomain_owned";
2847 static const char __pyx_k_edgeNumbering_subdomain2global[] =
"edgeNumbering_subdomain2global";
2848 static const char __pyx_k_elementOffsets_subdomain_owned[] =
"elementOffsets_subdomain_owned";
2849 static const char __pyx_k_nodeNumbering_subdomain2global[] =
"nodeNumbering_subdomain2global";
2850 static const char __pyx_k_strided_and_direct_or_indirect[] =
"<strided and direct or indirect>";
2851 static const char __pyx_k_numpy_core_multiarray_failed_to[] =
"numpy.core.multiarray failed to import";
2852 static const char __pyx_k_partitionNodesFromTriangleFiles[] =
"partitionNodesFromTriangleFiles";
2853 static const char __pyx_k_quadratic_dof_offsets_subdomain[] =
"quadratic_dof_offsets_subdomain_owned";
2854 static const char __pyx_k_Buffer_view_does_not_expose_stri[] =
"Buffer view does not expose strides";
2855 static const char __pyx_k_Can_only_create_a_buffer_that_is[] =
"Can only create a buffer that is contiguous in memory.";
2856 static const char __pyx_k_Cannot_assign_to_read_only_memor[] =
"Cannot assign to read-only memoryview";
2857 static const char __pyx_k_Cannot_create_writable_memory_vi[] =
"Cannot create writable memory view from read-only memoryview";
2858 static const char __pyx_k_Empty_shape_tuple_for_cython_arr[] =
"Empty shape tuple for cython.array";
2859 static const char __pyx_k_Incompatible_checksums_0x_x_vs_0[] =
"Incompatible checksums (0x%x vs (0xb068931, 0x82a3537, 0x6ae9995) = (name))";
2860 static const char __pyx_k_Indirect_dimensions_not_supporte[] =
"Indirect dimensions not supported";
2861 static const char __pyx_k_Invalid_mode_expected_c_or_fortr[] =
"Invalid mode, expected 'c' or 'fortran', got %s";
2862 static const char __pyx_k_Out_of_bounds_on_buffer_access_a[] =
"Out of bounds on buffer access (axis %d)";
2863 static const char __pyx_k_Unable_to_convert_item_to_object[] =
"Unable to convert item to object";
2864 static const char __pyx_k_buildDiscontinuousGalerkinLocal2[] =
"buildDiscontinuousGalerkinLocal2GlobalMappings";
2865 static const char __pyx_k_buildQuadraticCubeLocal2GlobalMa[] =
"buildQuadraticCubeLocal2GlobalMappings";
2866 static const char __pyx_k_buildQuadraticCubeSubdomain2Glob[] =
"buildQuadraticCubeSubdomain2GlobalMappings_1d not implemented!!";
2867 static const char __pyx_k_buildQuadraticLocal2GlobalMappin[] =
"buildQuadraticLocal2GlobalMappings";
2868 static const char __pyx_k_elementBoundaryNumbering_subdoma[] =
"elementBoundaryNumbering_subdomain2global";
2869 static const char __pyx_k_elementBoundaryOffsets_subdomain[] =
"elementBoundaryOffsets_subdomain_owned";
2870 static const char __pyx_k_elementNumbering_subdomain2globa[] =
"elementNumbering_subdomain2global";
2871 static const char __pyx_k_got_differing_extents_in_dimensi[] =
"got differing extents in dimension %d (got %d and %d)";
2872 static const char __pyx_k_no_default___reduce___due_to_non[] =
"no default __reduce__ due to non-trivial __cinit__";
2873 static const char __pyx_k_numpy_core_umath_failed_to_impor[] =
"numpy.core.umath failed to import";
2874 static const char __pyx_k_quadraticNumbering_subdomain2glo[] =
"quadraticNumbering_subdomain2global";
2875 static const char __pyx_k_unable_to_allocate_shape_and_str[] =
"unable to allocate shape and strides.";
2876 static const char __pyx_k_buildQuadraticCubeSubdomain2Glob_2[] =
"buildQuadraticCubeSubdomain2GlobalMappings_2d not implemented!!";
2877 static PyObject *__pyx_n_s_ASCII;
2878 static PyObject *__pyx_kp_s_Buffer_view_does_not_expose_stri;
2879 static PyObject *__pyx_kp_s_Can_only_create_a_buffer_that_is;
2880 static PyObject *__pyx_kp_s_Cannot_assign_to_read_only_memor;
2881 static PyObject *__pyx_kp_s_Cannot_create_writable_memory_vi;
2882 static PyObject *__pyx_kp_s_Cannot_index_with_type_s;
2883 static PyObject *__pyx_n_s_Comm;
2884 static PyObject *__pyx_n_s_Ellipsis;
2885 static PyObject *__pyx_kp_s_Empty_shape_tuple_for_cython_arr;
2886 static PyObject *__pyx_n_s_ImportError;
2887 static PyObject *__pyx_kp_s_Incompatible_checksums_0x_x_vs_0;
2888 static PyObject *__pyx_n_s_IndexError;
2889 static PyObject *__pyx_kp_s_Indirect_dimensions_not_supporte;
2890 static PyObject *__pyx_kp_s_Invalid_mode_expected_c_or_fortr;
2891 static PyObject *__pyx_kp_s_Invalid_shape_in_axis_d_d;
2892 static PyObject *__pyx_n_s_MemoryError;
2893 static PyObject *__pyx_kp_s_MemoryView_of_r_at_0x_x;
2894 static PyObject *__pyx_kp_s_MemoryView_of_r_object;
2895 static PyObject *__pyx_n_b_O;
2896 static PyObject *__pyx_kp_s_Out_of_bounds_on_buffer_access_a;
2897 static PyObject *__pyx_n_s_PickleError;
2898 static PyObject *__pyx_kp_b_T;
2899 static PyObject *__pyx_n_s_TypeError;
2900 static PyObject *__pyx_kp_s_Unable_to_convert_item_to_object;
2901 static PyObject *__pyx_n_s_ValueError;
2902 static PyObject *__pyx_n_s_View_MemoryView;
2903 static PyObject *__pyx_kp_b__22;
2904 static PyObject *__pyx_kp_b__23;
2905 static PyObject *__pyx_kp_b__24;
2906 static PyObject *__pyx_kp_b__25;
2907 static PyObject *__pyx_kp_u__26;
2908 static PyObject *__pyx_n_s_allocate_buffer;
2909 static PyObject *__pyx_n_s_asarray;
2910 static PyObject *__pyx_n_s_base;
2911 static PyObject *__pyx_n_s_buildDiscontinuousGalerkinLocal2;
2912 static PyObject *__pyx_n_s_buildQuadraticCubeLocal2GlobalMa;
2913 static PyObject *__pyx_kp_s_buildQuadraticCubeSubdomain2Glob;
2914 static PyObject *__pyx_kp_s_buildQuadraticCubeSubdomain2Glob_2;
2915 static PyObject *__pyx_n_s_buildQuadraticLocal2GlobalMappin;
2916 static PyObject *__pyx_n_s_c;
2917 static PyObject *__pyx_n_u_c;
2918 static PyObject *__pyx_n_s_class;
2919 static PyObject *__pyx_n_s_cline_in_traceback;
2920 static PyObject *__pyx_n_s_cmesh;
2921 static PyObject *__pyx_n_s_comm;
2922 static PyObject *__pyx_kp_s_contiguous_and_direct;
2923 static PyObject *__pyx_kp_s_contiguous_and_indirect;
2924 static PyObject *__pyx_n_s_convertPUMIPartitionToPython;
2925 static PyObject *__pyx_n_s_cpartitioning;
2926 static PyObject *__pyx_n_s_dgNumbering_subdomain2global;
2927 static PyObject *__pyx_n_s_dg_dof_offsets_subdomain_owned;
2928 static PyObject *__pyx_n_s_dg_subdomain_l2g;
2929 static PyObject *__pyx_n_s_dict;
2930 static PyObject *__pyx_n_s_dtype_is_object;
2931 static PyObject *__pyx_n_s_edgeNumbering_subdomain2global;
2932 static PyObject *__pyx_n_s_edgeOffsets_subdomain_owned;
2933 static PyObject *__pyx_n_s_elementBoundaryNumbering_subdoma;
2934 static PyObject *__pyx_n_s_elementBoundaryOffsets_subdomain;
2935 static PyObject *__pyx_n_s_elementNumbering_subdomain2globa;
2936 static PyObject *__pyx_n_s_elementOffsets_subdomain_owned;
2937 static PyObject *__pyx_n_s_encode;
2938 static PyObject *__pyx_n_s_enumerate;
2939 static PyObject *__pyx_n_s_error;
2940 static PyObject *__pyx_n_s_filebase;
2941 static PyObject *__pyx_n_s_flags;
2942 static PyObject *__pyx_n_s_format;
2943 static PyObject *__pyx_n_s_fortran;
2944 static PyObject *__pyx_n_u_fortran;
2945 static PyObject *__pyx_n_s_getstate;
2946 static PyObject *__pyx_kp_s_got_differing_extents_in_dimensi;
2947 static PyObject *__pyx_n_s_id;
2948 static PyObject *__pyx_n_s_import;
2949 static PyObject *__pyx_n_s_indexBase;
2950 static PyObject *__pyx_n_s_itemsize;
2951 static PyObject *__pyx_kp_s_itemsize_0_for_cython_array;
2952 static PyObject *__pyx_n_s_join;
2953 static PyObject *__pyx_n_s_main;
2954 static PyObject *__pyx_n_s_max_dof_neighbors;
2955 static PyObject *__pyx_n_s_memview;
2956 static PyObject *__pyx_n_s_mode;
2957 static PyObject *__pyx_n_s_nDOF_all_processes;
2958 static PyObject *__pyx_n_s_nDOF_element;
2959 static PyObject *__pyx_n_s_nDOF_subdomain;
2960 static PyObject *__pyx_n_s_nLayersOfOverlap;
2961 static PyObject *__pyx_n_s_nSpace;
2962 static PyObject *__pyx_n_s_name;
2963 static PyObject *__pyx_n_s_name_2;
2964 static PyObject *__pyx_n_s_ndim;
2965 static PyObject *__pyx_n_s_new;
2966 static PyObject *__pyx_kp_s_no_default___reduce___due_to_non;
2967 static PyObject *__pyx_n_s_nodeNumbering_subdomain2global;
2968 static PyObject *__pyx_n_s_nodeOffsets_subdomain_owned;
2969 static PyObject *__pyx_n_s_np;
2970 static PyObject *__pyx_n_s_numpy;
2971 static PyObject *__pyx_kp_s_numpy_core_multiarray_failed_to;
2972 static PyObject *__pyx_kp_s_numpy_core_umath_failed_to_impor;
2973 static PyObject *__pyx_n_s_obj;
2974 static PyObject *__pyx_n_s_pack;
2975 static PyObject *__pyx_n_s_partitionElements;
2976 static PyObject *__pyx_n_s_partitionNodes;
2977 static PyObject *__pyx_n_s_partitionNodesFromTetgenFiles;
2978 static PyObject *__pyx_n_s_partitionNodesFromTriangleFiles;
2979 static PyObject *__pyx_n_s_pickle;
2980 static PyObject *__pyx_n_s_proteus;
2981 static PyObject *__pyx_n_s_proteus_Comm;
2982 static PyObject *__pyx_kp_s_proteus_cpartitioning_pyx;
2983 static PyObject *__pyx_n_s_pyx_PickleError;
2984 static PyObject *__pyx_n_s_pyx_checksum;
2985 static PyObject *__pyx_n_s_pyx_getbuffer;
2986 static PyObject *__pyx_n_s_pyx_result;
2987 static PyObject *__pyx_n_s_pyx_state;
2988 static PyObject *__pyx_n_s_pyx_type;
2989 static PyObject *__pyx_n_s_pyx_unpickle_Enum;
2990 static PyObject *__pyx_n_s_pyx_vtable;
2991 static PyObject *__pyx_n_s_quadraticNumbering_subdomain2glo;
2992 static PyObject *__pyx_n_s_quadratic_dof_offsets_subdomain;
2993 static PyObject *__pyx_n_s_quadratic_lagrangeNodes;
2994 static PyObject *__pyx_n_s_quadratic_subdomain_l2g;
2995 static PyObject *__pyx_n_s_range;
2996 static PyObject *__pyx_n_s_reduce;
2997 static PyObject *__pyx_n_s_reduce_cython;
2998 static PyObject *__pyx_n_s_reduce_ex;
2999 static PyObject *__pyx_kp_u_s;
3000 static PyObject *__pyx_n_s_setstate;
3001 static PyObject *__pyx_n_s_setstate_cython;
3002 static PyObject *__pyx_n_s_shape;
3003 static PyObject *__pyx_n_s_size;
3004 static PyObject *__pyx_n_s_start;
3005 static PyObject *__pyx_n_s_step;
3006 static PyObject *__pyx_n_s_stop;
3007 static PyObject *__pyx_kp_s_strided_and_direct;
3008 static PyObject *__pyx_kp_s_strided_and_direct_or_indirect;
3009 static PyObject *__pyx_kp_s_strided_and_indirect;
3010 static PyObject *__pyx_kp_s_stringsource;
3011 static PyObject *__pyx_n_s_struct;
3012 static PyObject *__pyx_n_s_subdomain_cmesh;
3013 static PyObject *__pyx_n_s_test;
3014 static PyObject *__pyx_kp_s_unable_to_allocate_array_data;
3015 static PyObject *__pyx_kp_s_unable_to_allocate_shape_and_str;
3016 static PyObject *__pyx_n_s_unpack;
3017 static PyObject *__pyx_n_s_update;
3018 static PyObject *__pyx_pf_13cpartitioning_partitionElements(CYTHON_UNUSED PyObject *__pyx_self,
struct PyMPICommObject *__pyx_v_comm,
int __pyx_v_nLayersOfOverlap,
struct __pyx_obj_7proteus_10cmeshTools_CMesh *__pyx_v_cmesh,
struct __pyx_obj_7proteus_10cmeshTools_CMesh *__pyx_v_subdomain_cmesh);
3019 static PyObject *__pyx_pf_13cpartitioning_2partitionNodes(CYTHON_UNUSED PyObject *__pyx_self,
struct PyMPICommObject *__pyx_v_comm,
int __pyx_v_nLayersOfOverlap,
struct __pyx_obj_7proteus_10cmeshTools_CMesh *__pyx_v_cmesh,
struct __pyx_obj_7proteus_10cmeshTools_CMesh *__pyx_v_subdomain_cmesh);
3020 static PyObject *__pyx_pf_13cpartitioning_4convertPUMIPartitionToPython(CYTHON_UNUSED PyObject *__pyx_self, CYTHON_UNUSED
struct PyMPICommObject *__pyx_v_comm,
struct __pyx_obj_7proteus_10cmeshTools_CMesh *__pyx_v_cmesh,
struct __pyx_obj_7proteus_10cmeshTools_CMesh *__pyx_v_subdomain_cmesh);
3021 static PyObject *__pyx_pf_13cpartitioning_6partitionNodesFromTetgenFiles(CYTHON_UNUSED PyObject *__pyx_self,
struct PyMPICommObject *__pyx_v_comm, PyObject *__pyx_v_filebase,
int __pyx_v_indexBase,
int __pyx_v_nLayersOfOverlap,
struct __pyx_obj_7proteus_10cmeshTools_CMesh *__pyx_v_cmesh,
struct __pyx_obj_7proteus_10cmeshTools_CMesh *__pyx_v_subdomain_cmesh);
3022 static PyObject *__pyx_pf_13cpartitioning_8partitionNodesFromTriangleFiles(CYTHON_UNUSED PyObject *__pyx_self,
struct PyMPICommObject *__pyx_v_comm, PyObject *__pyx_v_filebase,
int __pyx_v_indexBase,
int __pyx_v_nLayersOfOverlap,
struct __pyx_obj_7proteus_10cmeshTools_CMesh *__pyx_v_cmesh,
struct __pyx_obj_7proteus_10cmeshTools_CMesh *__pyx_v_subdomain_cmesh);
3023 static PyObject *__pyx_pf_13cpartitioning_10buildQuadraticLocal2GlobalMappings(CYTHON_UNUSED PyObject *__pyx_self,
struct PyMPICommObject *__pyx_v_comm,
int __pyx_v_nSpace,
struct __pyx_obj_7proteus_10cmeshTools_CMesh *__pyx_v_cmesh, CYTHON_UNUSED
struct __pyx_obj_7proteus_10cmeshTools_CMesh *__pyx_v_subdomain_cmesh, PyArrayObject *__pyx_v_elementOffsets_subdomain_owned, PyArrayObject *__pyx_v_nodeOffsets_subdomain_owned, PyArrayObject *__pyx_v_elementBoundaryOffsets_subdomain_owned, PyArrayObject *__pyx_v_edgeOffsets_subdomain_owned, PyArrayObject *__pyx_v_elementNumbering_subdomain2global, PyArrayObject *__pyx_v_nodeNumbering_subdomain2global, PyArrayObject *__pyx_v_elementBoundaryNumbering_subdomain2global, PyArrayObject *__pyx_v_edgeNumbering_subdomain2global, PyArrayObject *__pyx_v_quadratic_dof_offsets_subdomain_owned, PyArrayObject *__pyx_v_quadratic_subdomain_l2g, PyArrayObject *__pyx_v_quadraticNumbering_subdomain2global, PyArrayObject *__pyx_v_quadratic_lagrangeNodes);
3024 static PyObject *__pyx_pf_13cpartitioning_12buildQuadraticCubeLocal2GlobalMappings(CYTHON_UNUSED PyObject *__pyx_self,
struct PyMPICommObject *__pyx_v_comm,
int __pyx_v_nSpace,
struct __pyx_obj_7proteus_10cmeshTools_CMesh *__pyx_v_cmesh, CYTHON_UNUSED
struct __pyx_obj_7proteus_10cmeshTools_CMesh *__pyx_v_subdomain_cmesh, CYTHON_UNUSED PyArrayObject *__pyx_v_elementOffsets_subdomain_owned, PyArrayObject *__pyx_v_nodeOffsets_subdomain_owned, CYTHON_UNUSED PyArrayObject *__pyx_v_elementBoundaryOffsets_subdomain_owned, PyArrayObject *__pyx_v_edgeOffsets_subdomain_owned, CYTHON_UNUSED PyArrayObject *__pyx_v_elementNumbering_subdomain2global, PyArrayObject *__pyx_v_nodeNumbering_subdomain2global, CYTHON_UNUSED PyArrayObject *__pyx_v_elementBoundaryNumbering_subdomain2global, PyArrayObject *__pyx_v_edgeNumbering_subdomain2global, PyArrayObject *__pyx_v_quadratic_dof_offsets_subdomain_owned, PyArrayObject *__pyx_v_quadratic_subdomain_l2g, PyArrayObject *__pyx_v_quadraticNumbering_subdomain2global, PyArrayObject *__pyx_v_quadratic_lagrangeNodes);
3025 static PyObject *__pyx_pf_13cpartitioning_14buildDiscontinuousGalerkinLocal2GlobalMappings(CYTHON_UNUSED PyObject *__pyx_self,
struct PyMPICommObject *__pyx_v_comm,
int __pyx_v_nDOF_element,
struct __pyx_obj_7proteus_10cmeshTools_CMesh *__pyx_v_cmesh, CYTHON_UNUSED
struct __pyx_obj_7proteus_10cmeshTools_CMesh *__pyx_v_subdomain_cmesh, PyArrayObject *__pyx_v_elementOffsets_subdomain_owned, PyArrayObject *__pyx_v_elementNumbering_subdomain2global, PyArrayObject *__pyx_v_dg_dof_offsets_subdomain_owned, PyArrayObject *__pyx_v_dg_subdomain_l2g, PyArrayObject *__pyx_v_dgNumbering_subdomain2global);
3026 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);
3027 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);
3028 static void __pyx_array___pyx_pf_15View_dot_MemoryView_5array_4__dealloc__(
struct __pyx_array_obj *__pyx_v_self);
3029 static PyObject *__pyx_pf_15View_dot_MemoryView_5array_7memview___get__(
struct __pyx_array_obj *__pyx_v_self);
3030 static Py_ssize_t __pyx_array___pyx_pf_15View_dot_MemoryView_5array_6__len__(
struct __pyx_array_obj *__pyx_v_self);
3031 static PyObject *__pyx_array___pyx_pf_15View_dot_MemoryView_5array_8__getattr__(
struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_attr);
3032 static PyObject *__pyx_array___pyx_pf_15View_dot_MemoryView_5array_10__getitem__(
struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_item);
3033 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);
3034 static PyObject *__pyx_pf___pyx_array___reduce_cython__(CYTHON_UNUSED
struct __pyx_array_obj *__pyx_v_self);
3035 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);
3036 static int __pyx_MemviewEnum___pyx_pf_15View_dot_MemoryView_4Enum___init__(
struct __pyx_MemviewEnum_obj *__pyx_v_self, PyObject *__pyx_v_name);
3037 static PyObject *__pyx_MemviewEnum___pyx_pf_15View_dot_MemoryView_4Enum_2__repr__(
struct __pyx_MemviewEnum_obj *__pyx_v_self);
3038 static PyObject *__pyx_pf___pyx_MemviewEnum___reduce_cython__(
struct __pyx_MemviewEnum_obj *__pyx_v_self);
3039 static PyObject *__pyx_pf___pyx_MemviewEnum_2__setstate_cython__(
struct __pyx_MemviewEnum_obj *__pyx_v_self, PyObject *__pyx_v___pyx_state);
3040 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);
3041 static void __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_2__dealloc__(
struct __pyx_memoryview_obj *__pyx_v_self);
3042 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_4__getitem__(
struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index);
3043 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);
3044 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);
3045 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_1T___get__(
struct __pyx_memoryview_obj *__pyx_v_self);
3046 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_4base___get__(
struct __pyx_memoryview_obj *__pyx_v_self);
3047 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_5shape___get__(
struct __pyx_memoryview_obj *__pyx_v_self);
3048 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_7strides___get__(
struct __pyx_memoryview_obj *__pyx_v_self);
3049 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_10suboffsets___get__(
struct __pyx_memoryview_obj *__pyx_v_self);
3050 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_4ndim___get__(
struct __pyx_memoryview_obj *__pyx_v_self);
3051 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_8itemsize___get__(
struct __pyx_memoryview_obj *__pyx_v_self);
3052 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_6nbytes___get__(
struct __pyx_memoryview_obj *__pyx_v_self);
3053 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_4size___get__(
struct __pyx_memoryview_obj *__pyx_v_self);
3054 static Py_ssize_t __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_10__len__(
struct __pyx_memoryview_obj *__pyx_v_self);
3055 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_12__repr__(
struct __pyx_memoryview_obj *__pyx_v_self);
3056 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_14__str__(
struct __pyx_memoryview_obj *__pyx_v_self);
3057 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_16is_c_contig(
struct __pyx_memoryview_obj *__pyx_v_self);
3058 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_18is_f_contig(
struct __pyx_memoryview_obj *__pyx_v_self);
3059 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_20copy(
struct __pyx_memoryview_obj *__pyx_v_self);
3060 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_22copy_fortran(
struct __pyx_memoryview_obj *__pyx_v_self);
3061 static PyObject *__pyx_pf___pyx_memoryview___reduce_cython__(CYTHON_UNUSED
struct __pyx_memoryview_obj *__pyx_v_self);
3062 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);
3063 static void __pyx_memoryviewslice___pyx_pf_15View_dot_MemoryView_16_memoryviewslice___dealloc__(
struct __pyx_memoryviewslice_obj *__pyx_v_self);
3064 static PyObject *__pyx_pf_15View_dot_MemoryView_16_memoryviewslice_4base___get__(
struct __pyx_memoryviewslice_obj *__pyx_v_self);
3065 static PyObject *__pyx_pf___pyx_memoryviewslice___reduce_cython__(CYTHON_UNUSED
struct __pyx_memoryviewslice_obj *__pyx_v_self);
3066 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);
3067 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);
3068 static PyObject *__pyx_tp_new_array(PyTypeObject *t, PyObject *a, PyObject *k);
3069 static PyObject *__pyx_tp_new_Enum(PyTypeObject *t, PyObject *a, PyObject *k);
3070 static PyObject *__pyx_tp_new_memoryview(PyTypeObject *t, PyObject *a, PyObject *k);
3071 static PyObject *__pyx_tp_new__memoryviewslice(PyTypeObject *t, PyObject *a, PyObject *k);
3072 static PyObject *__pyx_int_0;
3073 static PyObject *__pyx_int_1;
3074 static PyObject *__pyx_int_112105877;
3075 static PyObject *__pyx_int_136983863;
3076 static PyObject *__pyx_int_184977713;
3077 static PyObject *__pyx_int_neg_1;
3078 static PyObject *__pyx_tuple_;
3079 static PyObject *__pyx_tuple__2;
3080 static PyObject *__pyx_tuple__3;
3081 static PyObject *__pyx_tuple__4;
3082 static PyObject *__pyx_tuple__5;
3083 static PyObject *__pyx_tuple__6;
3084 static PyObject *__pyx_tuple__7;
3085 static PyObject *__pyx_tuple__8;
3086 static PyObject *__pyx_tuple__9;
3087 static PyObject *__pyx_slice__17;
3088 static PyObject *__pyx_tuple__10;
3089 static PyObject *__pyx_tuple__11;
3090 static PyObject *__pyx_tuple__12;
3091 static PyObject *__pyx_tuple__13;
3092 static PyObject *__pyx_tuple__14;
3093 static PyObject *__pyx_tuple__15;
3094 static PyObject *__pyx_tuple__16;
3095 static PyObject *__pyx_tuple__18;
3096 static PyObject *__pyx_tuple__19;
3097 static PyObject *__pyx_tuple__20;
3098 static PyObject *__pyx_tuple__21;
3099 static PyObject *__pyx_tuple__27;
3100 static PyObject *__pyx_tuple__29;
3101 static PyObject *__pyx_tuple__31;
3102 static PyObject *__pyx_tuple__33;
3103 static PyObject *__pyx_tuple__35;
3104 static PyObject *__pyx_tuple__37;
3105 static PyObject *__pyx_tuple__39;
3106 static PyObject *__pyx_tuple__41;
3107 static PyObject *__pyx_tuple__43;
3108 static PyObject *__pyx_tuple__44;
3109 static PyObject *__pyx_tuple__45;
3110 static PyObject *__pyx_tuple__46;
3111 static PyObject *__pyx_tuple__47;
3112 static PyObject *__pyx_tuple__48;
3113 static PyObject *__pyx_codeobj__28;
3114 static PyObject *__pyx_codeobj__30;
3115 static PyObject *__pyx_codeobj__32;
3116 static PyObject *__pyx_codeobj__34;
3117 static PyObject *__pyx_codeobj__36;
3118 static PyObject *__pyx_codeobj__38;
3119 static PyObject *__pyx_codeobj__40;
3120 static PyObject *__pyx_codeobj__42;
3121 static PyObject *__pyx_codeobj__49;
3133 static PyObject *__pyx_pw_13cpartitioning_1partitionElements(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
3134 static PyMethodDef __pyx_mdef_13cpartitioning_1partitionElements = {
"partitionElements", (PyCFunction)(
void*)(PyCFunctionWithKeywords)__pyx_pw_13cpartitioning_1partitionElements, METH_VARARGS|METH_KEYWORDS, 0};
3135 static PyObject *__pyx_pw_13cpartitioning_1partitionElements(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
3136 struct PyMPICommObject *__pyx_v_comm = 0;
3137 int __pyx_v_nLayersOfOverlap;
3138 struct __pyx_obj_7proteus_10cmeshTools_CMesh *__pyx_v_cmesh = 0;
3139 struct __pyx_obj_7proteus_10cmeshTools_CMesh *__pyx_v_subdomain_cmesh = 0;
3140 int __pyx_lineno = 0;
3141 const char *__pyx_filename = NULL;
3142 int __pyx_clineno = 0;
3143 PyObject *__pyx_r = 0;
3144 __Pyx_RefNannyDeclarations
3145 __Pyx_RefNannySetupContext(
"partitionElements (wrapper)", 0);
3147 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_comm,&__pyx_n_s_nLayersOfOverlap,&__pyx_n_s_cmesh,&__pyx_n_s_subdomain_cmesh,0};
3148 PyObject* values[4] = {0,0,0,0};
3149 if (unlikely(__pyx_kwds)) {
3151 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
3153 case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
3155 case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
3157 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
3159 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
3162 default:
goto __pyx_L5_argtuple_error;
3164 kw_args = PyDict_Size(__pyx_kwds);
3167 if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_comm)) != 0)) kw_args--;
3168 else goto __pyx_L5_argtuple_error;
3171 if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_nLayersOfOverlap)) != 0)) kw_args--;
3173 __Pyx_RaiseArgtupleInvalid(
"partitionElements", 1, 4, 4, 1); __PYX_ERR(0, 20, __pyx_L3_error)
3177 if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_cmesh)) != 0)) kw_args--;
3179 __Pyx_RaiseArgtupleInvalid(
"partitionElements", 1, 4, 4, 2); __PYX_ERR(0, 20, __pyx_L3_error)
3183 if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_subdomain_cmesh)) != 0)) kw_args--;
3185 __Pyx_RaiseArgtupleInvalid(
"partitionElements", 1, 4, 4, 3); __PYX_ERR(0, 20, __pyx_L3_error)
3188 if (unlikely(kw_args > 0)) {
3189 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args,
"partitionElements") < 0)) __PYX_ERR(0, 20, __pyx_L3_error)
3191 }
else if (PyTuple_GET_SIZE(__pyx_args) != 4) {
3192 goto __pyx_L5_argtuple_error;
3194 values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
3195 values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
3196 values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
3197 values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
3199 __pyx_v_comm = ((
struct PyMPICommObject *)values[0]);
3200 __pyx_v_nLayersOfOverlap = __Pyx_PyInt_As_int(values[1]);
if (unlikely((__pyx_v_nLayersOfOverlap == (
int)-1) && PyErr_Occurred())) __PYX_ERR(0, 20, __pyx_L3_error)
3201 __pyx_v_cmesh = ((
struct __pyx_obj_7proteus_10cmeshTools_CMesh *)values[2]);
3202 __pyx_v_subdomain_cmesh = ((
struct __pyx_obj_7proteus_10cmeshTools_CMesh *)values[3]);
3204 goto __pyx_L4_argument_unpacking_done;
3205 __pyx_L5_argtuple_error:;
3206 __Pyx_RaiseArgtupleInvalid(
"partitionElements", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 20, __pyx_L3_error)
3208 __Pyx_AddTraceback(
"cpartitioning.partitionElements", __pyx_clineno, __pyx_lineno, __pyx_filename);
3209 __Pyx_RefNannyFinishContext();
3211 __pyx_L4_argument_unpacking_done:;
3212 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_comm), __pyx_ptype_6mpi4py_3MPI_Comm, 1,
"comm", 0))) __PYX_ERR(0, 20, __pyx_L1_error)
3213 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_cmesh), __pyx_ptype_7proteus_10cmeshTools_CMesh, 1,
"cmesh", 0))) __PYX_ERR(0, 20, __pyx_L1_error)
3214 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_subdomain_cmesh), __pyx_ptype_7proteus_10cmeshTools_CMesh, 1,
"subdomain_cmesh", 0))) __PYX_ERR(0, 20, __pyx_L1_error)
3215 __pyx_r = __pyx_pf_13cpartitioning_partitionElements(__pyx_self, __pyx_v_comm, __pyx_v_nLayersOfOverlap, __pyx_v_cmesh, __pyx_v_subdomain_cmesh);
3222 __Pyx_RefNannyFinishContext();
3226 static PyObject *__pyx_pf_13cpartitioning_partitionElements(CYTHON_UNUSED PyObject *__pyx_self,
struct PyMPICommObject *__pyx_v_comm,
int __pyx_v_nLayersOfOverlap,
struct __pyx_obj_7proteus_10cmeshTools_CMesh *__pyx_v_cmesh,
struct __pyx_obj_7proteus_10cmeshTools_CMesh *__pyx_v_subdomain_cmesh) {
3227 PyObject *__pyx_r = NULL;
3228 __Pyx_RefNannyDeclarations
3229 PyObject *__pyx_t_1 = NULL;
3230 PyObject *__pyx_t_2 = NULL;
3231 PyObject *__pyx_t_3 = NULL;
3233 PyObject *__pyx_t_5 = NULL;
3234 Py_ssize_t __pyx_t_6;
3235 struct __pyx_array_obj *__pyx_t_7 = NULL;
3236 PyObject *__pyx_t_8 = NULL;
3237 PyObject *__pyx_t_9 = NULL;
3238 PyObject *__pyx_t_10 = NULL;
3239 PyObject *__pyx_t_11 = NULL;
3240 PyObject *__pyx_t_12 = NULL;
3241 PyObject *__pyx_t_13 = NULL;
3242 PyObject *__pyx_t_14 = NULL;
3243 int __pyx_lineno = 0;
3244 const char *__pyx_filename = NULL;
3245 int __pyx_clineno = 0;
3246 __Pyx_RefNannySetupContext(
"partitionElements", 0);
3255 __pyx_v_cmesh->mesh.subdomainp = (&__pyx_v_subdomain_cmesh->mesh);
3273 __Pyx_XDECREF(__pyx_r);
3282 __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_np);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 26, __pyx_L1_error)
3283 __Pyx_GOTREF(__pyx_t_2);
3284 __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_asarray);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 26, __pyx_L1_error)
3285 __Pyx_GOTREF(__pyx_t_3);
3286 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
3287 __pyx_t_4 = __pyx_v_cmesh->mesh.elementOffsets_subdomain_owned;
3288 __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_comm), __pyx_n_s_size);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 26, __pyx_L1_error)
3289 __Pyx_GOTREF(__pyx_t_2);
3290 __pyx_t_5 = __Pyx_PyInt_AddObjC(__pyx_t_2, __pyx_int_1, 1, 0, 0);
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 26, __pyx_L1_error)
3291 __Pyx_GOTREF(__pyx_t_5);
3292 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
3293 __pyx_t_6 = __Pyx_PyIndex_AsSsize_t(__pyx_t_5);
if (unlikely((__pyx_t_6 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 26, __pyx_L1_error)
3294 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
3296 PyErr_SetString(PyExc_ValueError,
"Cannot create cython.array from NULL pointer");
3297 __PYX_ERR(0, 26, __pyx_L1_error)
3299 __pyx_t_2 = __pyx_format_from_typeinfo(&__Pyx_TypeInfo_int);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 26, __pyx_L1_error)
3300 __Pyx_GOTREF(__pyx_t_2);
3301 __pyx_t_5 = Py_BuildValue((
char*)
"(" __PYX_BUILD_PY_SSIZE_T
")", ((Py_ssize_t)__pyx_t_6));
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 26, __pyx_L1_error)
3302 __Pyx_GOTREF(__pyx_t_5);
3303 __pyx_t_7 = __pyx_array_new(__pyx_t_5,
sizeof(
int), PyBytes_AS_STRING(__pyx_t_2), (
char *)
"c", (
char *) __pyx_t_4);
3304 if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 26, __pyx_L1_error)
3305 __Pyx_GOTREF(__pyx_t_7);
3306 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
3307 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
3309 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
3310 __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
3311 if (likely(__pyx_t_2)) {
3312 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_3);
3313 __Pyx_INCREF(__pyx_t_2);
3314 __Pyx_INCREF(
function);
3315 __Pyx_DECREF_SET(__pyx_t_3,
function);
3318 __pyx_t_1 = (__pyx_t_2) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_2, ((PyObject *)__pyx_t_7)) : __Pyx_PyObject_CallOneArg(__pyx_t_3, ((PyObject *)__pyx_t_7));
3319 __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
3320 __Pyx_DECREF(((PyObject *)__pyx_t_7)); __pyx_t_7 = 0;
3321 if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 26, __pyx_L1_error)
3322 __Pyx_GOTREF(__pyx_t_1);
3323 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
3332 __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_np);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 27, __pyx_L1_error)
3333 __Pyx_GOTREF(__pyx_t_2);
3334 __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_asarray);
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 27, __pyx_L1_error)
3335 __Pyx_GOTREF(__pyx_t_5);
3336 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
3337 __pyx_t_4 = __pyx_v_cmesh->mesh.elementNumbering_subdomain2global;
3339 PyErr_SetString(PyExc_ValueError,
"Cannot create cython.array from NULL pointer");
3340 __PYX_ERR(0, 27, __pyx_L1_error)
3342 __pyx_t_8 = __pyx_format_from_typeinfo(&__Pyx_TypeInfo_int);
if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 27, __pyx_L1_error)
3343 __Pyx_GOTREF(__pyx_t_8);
3344 __pyx_t_2 = Py_BuildValue((
char*)
"(" __PYX_BUILD_PY_SSIZE_T
")", ((Py_ssize_t)__pyx_v_cmesh->mesh.subdomainp->nElements_global));
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 27, __pyx_L1_error)
3345 __Pyx_GOTREF(__pyx_t_2);
3346 __pyx_t_7 = __pyx_array_new(__pyx_t_2,
sizeof(
int), PyBytes_AS_STRING(__pyx_t_8), (
char *)
"c", (
char *) __pyx_t_4);
3347 if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 27, __pyx_L1_error)
3348 __Pyx_GOTREF(__pyx_t_7);
3349 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
3350 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
3352 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_5))) {
3353 __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_5);
3354 if (likely(__pyx_t_8)) {
3355 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_5);
3356 __Pyx_INCREF(__pyx_t_8);
3357 __Pyx_INCREF(
function);
3358 __Pyx_DECREF_SET(__pyx_t_5,
function);
3361 __pyx_t_3 = (__pyx_t_8) ? __Pyx_PyObject_Call2Args(__pyx_t_5, __pyx_t_8, ((PyObject *)__pyx_t_7)) : __Pyx_PyObject_CallOneArg(__pyx_t_5, ((PyObject *)__pyx_t_7));
3362 __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
3363 __Pyx_DECREF(((PyObject *)__pyx_t_7)); __pyx_t_7 = 0;
3364 if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 27, __pyx_L1_error)
3365 __Pyx_GOTREF(__pyx_t_3);
3366 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
3375 __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_n_s_np);
if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 28, __pyx_L1_error)
3376 __Pyx_GOTREF(__pyx_t_8);
3377 __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_asarray);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 28, __pyx_L1_error)
3378 __Pyx_GOTREF(__pyx_t_2);
3379 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
3380 __pyx_t_4 = __pyx_v_cmesh->mesh.nodeOffsets_subdomain_owned;
3381 __pyx_t_8 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_comm), __pyx_n_s_size);
if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 28, __pyx_L1_error)
3382 __Pyx_GOTREF(__pyx_t_8);
3383 __pyx_t_9 = __Pyx_PyInt_AddObjC(__pyx_t_8, __pyx_int_1, 1, 0, 0);
if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 28, __pyx_L1_error)
3384 __Pyx_GOTREF(__pyx_t_9);
3385 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
3386 __pyx_t_6 = __Pyx_PyIndex_AsSsize_t(__pyx_t_9);
if (unlikely((__pyx_t_6 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 28, __pyx_L1_error)
3387 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
3389 PyErr_SetString(PyExc_ValueError,
"Cannot create cython.array from NULL pointer");
3390 __PYX_ERR(0, 28, __pyx_L1_error)
3392 __pyx_t_8 = __pyx_format_from_typeinfo(&__Pyx_TypeInfo_int);
if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 28, __pyx_L1_error)
3393 __Pyx_GOTREF(__pyx_t_8);
3394 __pyx_t_9 = Py_BuildValue((
char*)
"(" __PYX_BUILD_PY_SSIZE_T
")", ((Py_ssize_t)__pyx_t_6));
if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 28, __pyx_L1_error)
3395 __Pyx_GOTREF(__pyx_t_9);
3396 __pyx_t_7 = __pyx_array_new(__pyx_t_9,
sizeof(
int), PyBytes_AS_STRING(__pyx_t_8), (
char *)
"c", (
char *) __pyx_t_4);
3397 if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 28, __pyx_L1_error)
3398 __Pyx_GOTREF(__pyx_t_7);
3399 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
3400 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
3402 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
3403 __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_2);
3404 if (likely(__pyx_t_8)) {
3405 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_2);
3406 __Pyx_INCREF(__pyx_t_8);
3407 __Pyx_INCREF(
function);
3408 __Pyx_DECREF_SET(__pyx_t_2,
function);
3411 __pyx_t_5 = (__pyx_t_8) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_8, ((PyObject *)__pyx_t_7)) : __Pyx_PyObject_CallOneArg(__pyx_t_2, ((PyObject *)__pyx_t_7));
3412 __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
3413 __Pyx_DECREF(((PyObject *)__pyx_t_7)); __pyx_t_7 = 0;
3414 if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 28, __pyx_L1_error)
3415 __Pyx_GOTREF(__pyx_t_5);
3416 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
3425 __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_n_s_np);
if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 29, __pyx_L1_error)
3426 __Pyx_GOTREF(__pyx_t_8);
3427 __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_asarray);
if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 29, __pyx_L1_error)
3428 __Pyx_GOTREF(__pyx_t_9);
3429 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
3430 __pyx_t_4 = __pyx_v_cmesh->mesh.nodeNumbering_subdomain2global;
3432 PyErr_SetString(PyExc_ValueError,
"Cannot create cython.array from NULL pointer");
3433 __PYX_ERR(0, 29, __pyx_L1_error)
3435 __pyx_t_10 = __pyx_format_from_typeinfo(&__Pyx_TypeInfo_int);
if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 29, __pyx_L1_error)
3436 __Pyx_GOTREF(__pyx_t_10);
3437 __pyx_t_8 = Py_BuildValue((
char*)
"(" __PYX_BUILD_PY_SSIZE_T
")", ((Py_ssize_t)__pyx_v_cmesh->mesh.subdomainp->nNodes_global));
if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 29, __pyx_L1_error)
3438 __Pyx_GOTREF(__pyx_t_8);
3439 __pyx_t_7 = __pyx_array_new(__pyx_t_8,
sizeof(
int), PyBytes_AS_STRING(__pyx_t_10), (
char *)
"c", (
char *) __pyx_t_4);
3440 if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 29, __pyx_L1_error)
3441 __Pyx_GOTREF(__pyx_t_7);
3442 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
3443 __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
3445 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_9))) {
3446 __pyx_t_10 = PyMethod_GET_SELF(__pyx_t_9);
3447 if (likely(__pyx_t_10)) {
3448 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_9);
3449 __Pyx_INCREF(__pyx_t_10);
3450 __Pyx_INCREF(
function);
3451 __Pyx_DECREF_SET(__pyx_t_9,
function);
3454 __pyx_t_2 = (__pyx_t_10) ? __Pyx_PyObject_Call2Args(__pyx_t_9, __pyx_t_10, ((PyObject *)__pyx_t_7)) : __Pyx_PyObject_CallOneArg(__pyx_t_9, ((PyObject *)__pyx_t_7));
3455 __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
3456 __Pyx_DECREF(((PyObject *)__pyx_t_7)); __pyx_t_7 = 0;
3457 if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 29, __pyx_L1_error)
3458 __Pyx_GOTREF(__pyx_t_2);
3459 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
3468 __Pyx_GetModuleGlobalName(__pyx_t_10, __pyx_n_s_np);
if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 30, __pyx_L1_error)
3469 __Pyx_GOTREF(__pyx_t_10);
3470 __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_n_s_asarray);
if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 30, __pyx_L1_error)
3471 __Pyx_GOTREF(__pyx_t_8);
3472 __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
3473 __pyx_t_4 = __pyx_v_cmesh->mesh.elementBoundaryOffsets_subdomain_owned;
3474 __pyx_t_10 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_comm), __pyx_n_s_size);
if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 30, __pyx_L1_error)
3475 __Pyx_GOTREF(__pyx_t_10);
3476 __pyx_t_11 = __Pyx_PyInt_AddObjC(__pyx_t_10, __pyx_int_1, 1, 0, 0);
if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 30, __pyx_L1_error)
3477 __Pyx_GOTREF(__pyx_t_11);
3478 __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
3479 __pyx_t_6 = __Pyx_PyIndex_AsSsize_t(__pyx_t_11);
if (unlikely((__pyx_t_6 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 30, __pyx_L1_error)
3480 __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
3482 PyErr_SetString(PyExc_ValueError,
"Cannot create cython.array from NULL pointer");
3483 __PYX_ERR(0, 30, __pyx_L1_error)
3485 __pyx_t_10 = __pyx_format_from_typeinfo(&__Pyx_TypeInfo_int);
if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 30, __pyx_L1_error)
3486 __Pyx_GOTREF(__pyx_t_10);
3487 __pyx_t_11 = Py_BuildValue((
char*)
"(" __PYX_BUILD_PY_SSIZE_T
")", ((Py_ssize_t)__pyx_t_6));
if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 30, __pyx_L1_error)
3488 __Pyx_GOTREF(__pyx_t_11);
3489 __pyx_t_7 = __pyx_array_new(__pyx_t_11,
sizeof(
int), PyBytes_AS_STRING(__pyx_t_10), (
char *)
"c", (
char *) __pyx_t_4);
3490 if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 30, __pyx_L1_error)
3491 __Pyx_GOTREF(__pyx_t_7);
3492 __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
3493 __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
3495 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_8))) {
3496 __pyx_t_10 = PyMethod_GET_SELF(__pyx_t_8);
3497 if (likely(__pyx_t_10)) {
3498 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_8);
3499 __Pyx_INCREF(__pyx_t_10);
3500 __Pyx_INCREF(
function);
3501 __Pyx_DECREF_SET(__pyx_t_8,
function);
3504 __pyx_t_9 = (__pyx_t_10) ? __Pyx_PyObject_Call2Args(__pyx_t_8, __pyx_t_10, ((PyObject *)__pyx_t_7)) : __Pyx_PyObject_CallOneArg(__pyx_t_8, ((PyObject *)__pyx_t_7));
3505 __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
3506 __Pyx_DECREF(((PyObject *)__pyx_t_7)); __pyx_t_7 = 0;
3507 if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 30, __pyx_L1_error)
3508 __Pyx_GOTREF(__pyx_t_9);
3509 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
3518 __Pyx_GetModuleGlobalName(__pyx_t_10, __pyx_n_s_np);
if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 31, __pyx_L1_error)
3519 __Pyx_GOTREF(__pyx_t_10);
3520 __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_n_s_asarray);
if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 31, __pyx_L1_error)
3521 __Pyx_GOTREF(__pyx_t_11);
3522 __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
3523 __pyx_t_4 = __pyx_v_cmesh->mesh.elementBoundaryNumbering_subdomain2global;
3525 PyErr_SetString(PyExc_ValueError,
"Cannot create cython.array from NULL pointer");
3526 __PYX_ERR(0, 31, __pyx_L1_error)
3528 __pyx_t_12 = __pyx_format_from_typeinfo(&__Pyx_TypeInfo_int);
if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 31, __pyx_L1_error)
3529 __Pyx_GOTREF(__pyx_t_12);
3530 __pyx_t_10 = Py_BuildValue((
char*)
"(" __PYX_BUILD_PY_SSIZE_T
")", ((Py_ssize_t)__pyx_v_cmesh->mesh.subdomainp->nElementBoundaries_global));
if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 31, __pyx_L1_error)
3531 __Pyx_GOTREF(__pyx_t_10);
3532 __pyx_t_7 = __pyx_array_new(__pyx_t_10,
sizeof(
int), PyBytes_AS_STRING(__pyx_t_12), (
char *)
"c", (
char *) __pyx_t_4);
3533 if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 31, __pyx_L1_error)
3534 __Pyx_GOTREF(__pyx_t_7);
3535 __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
3536 __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
3538 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_11))) {
3539 __pyx_t_12 = PyMethod_GET_SELF(__pyx_t_11);
3540 if (likely(__pyx_t_12)) {
3541 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_11);
3542 __Pyx_INCREF(__pyx_t_12);
3543 __Pyx_INCREF(
function);
3544 __Pyx_DECREF_SET(__pyx_t_11,
function);
3547 __pyx_t_8 = (__pyx_t_12) ? __Pyx_PyObject_Call2Args(__pyx_t_11, __pyx_t_12, ((PyObject *)__pyx_t_7)) : __Pyx_PyObject_CallOneArg(__pyx_t_11, ((PyObject *)__pyx_t_7));
3548 __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
3549 __Pyx_DECREF(((PyObject *)__pyx_t_7)); __pyx_t_7 = 0;
3550 if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 31, __pyx_L1_error)
3551 __Pyx_GOTREF(__pyx_t_8);
3552 __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
3561 __Pyx_GetModuleGlobalName(__pyx_t_12, __pyx_n_s_np);
if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 32, __pyx_L1_error)
3562 __Pyx_GOTREF(__pyx_t_12);
3563 __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_12, __pyx_n_s_asarray);
if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 32, __pyx_L1_error)
3564 __Pyx_GOTREF(__pyx_t_10);
3565 __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
3566 __pyx_t_4 = __pyx_v_cmesh->mesh.edgeOffsets_subdomain_owned;
3567 __pyx_t_12 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_comm), __pyx_n_s_size);
if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 32, __pyx_L1_error)
3568 __Pyx_GOTREF(__pyx_t_12);
3569 __pyx_t_13 = __Pyx_PyInt_AddObjC(__pyx_t_12, __pyx_int_1, 1, 0, 0);
if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 32, __pyx_L1_error)
3570 __Pyx_GOTREF(__pyx_t_13);
3571 __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
3572 __pyx_t_6 = __Pyx_PyIndex_AsSsize_t(__pyx_t_13);
if (unlikely((__pyx_t_6 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 32, __pyx_L1_error)
3573 __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
3575 PyErr_SetString(PyExc_ValueError,
"Cannot create cython.array from NULL pointer");
3576 __PYX_ERR(0, 32, __pyx_L1_error)
3578 __pyx_t_12 = __pyx_format_from_typeinfo(&__Pyx_TypeInfo_int);
if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 32, __pyx_L1_error)
3579 __Pyx_GOTREF(__pyx_t_12);
3580 __pyx_t_13 = Py_BuildValue((
char*)
"(" __PYX_BUILD_PY_SSIZE_T
")", ((Py_ssize_t)__pyx_t_6));
if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 32, __pyx_L1_error)
3581 __Pyx_GOTREF(__pyx_t_13);
3582 __pyx_t_7 = __pyx_array_new(__pyx_t_13,
sizeof(
int), PyBytes_AS_STRING(__pyx_t_12), (
char *)
"c", (
char *) __pyx_t_4);
3583 if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 32, __pyx_L1_error)
3584 __Pyx_GOTREF(__pyx_t_7);
3585 __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
3586 __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
3588 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_10))) {
3589 __pyx_t_12 = PyMethod_GET_SELF(__pyx_t_10);
3590 if (likely(__pyx_t_12)) {
3591 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_10);
3592 __Pyx_INCREF(__pyx_t_12);
3593 __Pyx_INCREF(
function);
3594 __Pyx_DECREF_SET(__pyx_t_10,
function);
3597 __pyx_t_11 = (__pyx_t_12) ? __Pyx_PyObject_Call2Args(__pyx_t_10, __pyx_t_12, ((PyObject *)__pyx_t_7)) : __Pyx_PyObject_CallOneArg(__pyx_t_10, ((PyObject *)__pyx_t_7));
3598 __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
3599 __Pyx_DECREF(((PyObject *)__pyx_t_7)); __pyx_t_7 = 0;
3600 if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 32, __pyx_L1_error)
3601 __Pyx_GOTREF(__pyx_t_11);
3602 __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
3611 __Pyx_GetModuleGlobalName(__pyx_t_12, __pyx_n_s_np);
if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 33, __pyx_L1_error)
3612 __Pyx_GOTREF(__pyx_t_12);
3613 __pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_t_12, __pyx_n_s_asarray);
if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 33, __pyx_L1_error)
3614 __Pyx_GOTREF(__pyx_t_13);
3615 __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
3616 __pyx_t_4 = __pyx_v_cmesh->mesh.edgeNumbering_subdomain2global;
3618 PyErr_SetString(PyExc_ValueError,
"Cannot create cython.array from NULL pointer");
3619 __PYX_ERR(0, 33, __pyx_L1_error)
3621 __pyx_t_14 = __pyx_format_from_typeinfo(&__Pyx_TypeInfo_int);
if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 33, __pyx_L1_error)
3622 __Pyx_GOTREF(__pyx_t_14);
3623 __pyx_t_12 = Py_BuildValue((
char*)
"(" __PYX_BUILD_PY_SSIZE_T
")", ((Py_ssize_t)__pyx_v_cmesh->mesh.subdomainp->nEdges_global));
if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 33, __pyx_L1_error)
3624 __Pyx_GOTREF(__pyx_t_12);
3625 __pyx_t_7 = __pyx_array_new(__pyx_t_12,
sizeof(
int), PyBytes_AS_STRING(__pyx_t_14), (
char *)
"c", (
char *) __pyx_t_4);
3626 if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 33, __pyx_L1_error)
3627 __Pyx_GOTREF(__pyx_t_7);
3628 __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
3629 __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
3631 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_13))) {
3632 __pyx_t_14 = PyMethod_GET_SELF(__pyx_t_13);
3633 if (likely(__pyx_t_14)) {
3634 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_13);
3635 __Pyx_INCREF(__pyx_t_14);
3636 __Pyx_INCREF(
function);
3637 __Pyx_DECREF_SET(__pyx_t_13,
function);
3640 __pyx_t_10 = (__pyx_t_14) ? __Pyx_PyObject_Call2Args(__pyx_t_13, __pyx_t_14, ((PyObject *)__pyx_t_7)) : __Pyx_PyObject_CallOneArg(__pyx_t_13, ((PyObject *)__pyx_t_7));
3641 __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0;
3642 __Pyx_DECREF(((PyObject *)__pyx_t_7)); __pyx_t_7 = 0;
3643 if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 33, __pyx_L1_error)
3644 __Pyx_GOTREF(__pyx_t_10);
3645 __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
3654 __pyx_t_13 = PyTuple_New(8);
if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 26, __pyx_L1_error)
3655 __Pyx_GOTREF(__pyx_t_13);
3656 __Pyx_GIVEREF(__pyx_t_1);
3657 PyTuple_SET_ITEM(__pyx_t_13, 0, __pyx_t_1);
3658 __Pyx_GIVEREF(__pyx_t_3);
3659 PyTuple_SET_ITEM(__pyx_t_13, 1, __pyx_t_3);
3660 __Pyx_GIVEREF(__pyx_t_5);
3661 PyTuple_SET_ITEM(__pyx_t_13, 2, __pyx_t_5);
3662 __Pyx_GIVEREF(__pyx_t_2);
3663 PyTuple_SET_ITEM(__pyx_t_13, 3, __pyx_t_2);
3664 __Pyx_GIVEREF(__pyx_t_9);
3665 PyTuple_SET_ITEM(__pyx_t_13, 4, __pyx_t_9);
3666 __Pyx_GIVEREF(__pyx_t_8);
3667 PyTuple_SET_ITEM(__pyx_t_13, 5, __pyx_t_8);
3668 __Pyx_GIVEREF(__pyx_t_11);
3669 PyTuple_SET_ITEM(__pyx_t_13, 6, __pyx_t_11);
3670 __Pyx_GIVEREF(__pyx_t_10);
3671 PyTuple_SET_ITEM(__pyx_t_13, 7, __pyx_t_10);
3680 __pyx_r = __pyx_t_13;
3694 __Pyx_XDECREF(__pyx_t_1);
3695 __Pyx_XDECREF(__pyx_t_2);
3696 __Pyx_XDECREF(__pyx_t_3);
3697 __Pyx_XDECREF(__pyx_t_5);
3698 __Pyx_XDECREF(((PyObject *)__pyx_t_7));
3699 __Pyx_XDECREF(__pyx_t_8);
3700 __Pyx_XDECREF(__pyx_t_9);
3701 __Pyx_XDECREF(__pyx_t_10);
3702 __Pyx_XDECREF(__pyx_t_11);
3703 __Pyx_XDECREF(__pyx_t_12);
3704 __Pyx_XDECREF(__pyx_t_13);
3705 __Pyx_XDECREF(__pyx_t_14);
3706 __Pyx_AddTraceback(
"cpartitioning.partitionElements", __pyx_clineno, __pyx_lineno, __pyx_filename);
3709 __Pyx_XGIVEREF(__pyx_r);
3710 __Pyx_RefNannyFinishContext();
3723 static PyObject *__pyx_pw_13cpartitioning_3partitionNodes(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
3724 static PyMethodDef __pyx_mdef_13cpartitioning_3partitionNodes = {
"partitionNodes", (PyCFunction)(
void*)(PyCFunctionWithKeywords)__pyx_pw_13cpartitioning_3partitionNodes, METH_VARARGS|METH_KEYWORDS, 0};
3725 static PyObject *__pyx_pw_13cpartitioning_3partitionNodes(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
3726 struct PyMPICommObject *__pyx_v_comm = 0;
3727 int __pyx_v_nLayersOfOverlap;
3728 struct __pyx_obj_7proteus_10cmeshTools_CMesh *__pyx_v_cmesh = 0;
3729 struct __pyx_obj_7proteus_10cmeshTools_CMesh *__pyx_v_subdomain_cmesh = 0;
3730 int __pyx_lineno = 0;
3731 const char *__pyx_filename = NULL;
3732 int __pyx_clineno = 0;
3733 PyObject *__pyx_r = 0;
3734 __Pyx_RefNannyDeclarations
3735 __Pyx_RefNannySetupContext(
"partitionNodes (wrapper)", 0);
3737 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_comm,&__pyx_n_s_nLayersOfOverlap,&__pyx_n_s_cmesh,&__pyx_n_s_subdomain_cmesh,0};
3738 PyObject* values[4] = {0,0,0,0};
3739 if (unlikely(__pyx_kwds)) {
3741 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
3743 case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
3745 case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
3747 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
3749 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
3752 default:
goto __pyx_L5_argtuple_error;
3754 kw_args = PyDict_Size(__pyx_kwds);
3757 if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_comm)) != 0)) kw_args--;
3758 else goto __pyx_L5_argtuple_error;
3761 if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_nLayersOfOverlap)) != 0)) kw_args--;
3763 __Pyx_RaiseArgtupleInvalid(
"partitionNodes", 1, 4, 4, 1); __PYX_ERR(0, 36, __pyx_L3_error)
3767 if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_cmesh)) != 0)) kw_args--;
3769 __Pyx_RaiseArgtupleInvalid(
"partitionNodes", 1, 4, 4, 2); __PYX_ERR(0, 36, __pyx_L3_error)
3773 if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_subdomain_cmesh)) != 0)) kw_args--;
3775 __Pyx_RaiseArgtupleInvalid(
"partitionNodes", 1, 4, 4, 3); __PYX_ERR(0, 36, __pyx_L3_error)
3778 if (unlikely(kw_args > 0)) {
3779 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args,
"partitionNodes") < 0)) __PYX_ERR(0, 36, __pyx_L3_error)
3781 }
else if (PyTuple_GET_SIZE(__pyx_args) != 4) {
3782 goto __pyx_L5_argtuple_error;
3784 values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
3785 values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
3786 values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
3787 values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
3789 __pyx_v_comm = ((
struct PyMPICommObject *)values[0]);
3790 __pyx_v_nLayersOfOverlap = __Pyx_PyInt_As_int(values[1]);
if (unlikely((__pyx_v_nLayersOfOverlap == (
int)-1) && PyErr_Occurred())) __PYX_ERR(0, 36, __pyx_L3_error)
3791 __pyx_v_cmesh = ((
struct __pyx_obj_7proteus_10cmeshTools_CMesh *)values[2]);
3792 __pyx_v_subdomain_cmesh = ((
struct __pyx_obj_7proteus_10cmeshTools_CMesh *)values[3]);
3794 goto __pyx_L4_argument_unpacking_done;
3795 __pyx_L5_argtuple_error:;
3796 __Pyx_RaiseArgtupleInvalid(
"partitionNodes", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 36, __pyx_L3_error)
3798 __Pyx_AddTraceback(
"cpartitioning.partitionNodes", __pyx_clineno, __pyx_lineno, __pyx_filename);
3799 __Pyx_RefNannyFinishContext();
3801 __pyx_L4_argument_unpacking_done:;
3802 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_comm), __pyx_ptype_6mpi4py_3MPI_Comm, 1,
"comm", 0))) __PYX_ERR(0, 36, __pyx_L1_error)
3803 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_cmesh), __pyx_ptype_7proteus_10cmeshTools_CMesh, 1,
"cmesh", 0))) __PYX_ERR(0, 36, __pyx_L1_error)
3804 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_subdomain_cmesh), __pyx_ptype_7proteus_10cmeshTools_CMesh, 1,
"subdomain_cmesh", 0))) __PYX_ERR(0, 36, __pyx_L1_error)
3805 __pyx_r = __pyx_pf_13cpartitioning_2partitionNodes(__pyx_self, __pyx_v_comm, __pyx_v_nLayersOfOverlap, __pyx_v_cmesh, __pyx_v_subdomain_cmesh);
3812 __Pyx_RefNannyFinishContext();
3816 static PyObject *__pyx_pf_13cpartitioning_2partitionNodes(CYTHON_UNUSED PyObject *__pyx_self,
struct PyMPICommObject *__pyx_v_comm,
int __pyx_v_nLayersOfOverlap,
struct __pyx_obj_7proteus_10cmeshTools_CMesh *__pyx_v_cmesh,
struct __pyx_obj_7proteus_10cmeshTools_CMesh *__pyx_v_subdomain_cmesh) {
3817 PyObject *__pyx_r = NULL;
3818 __Pyx_RefNannyDeclarations
3819 PyObject *__pyx_t_1 = NULL;
3820 PyObject *__pyx_t_2 = NULL;
3821 PyObject *__pyx_t_3 = NULL;
3823 PyObject *__pyx_t_5 = NULL;
3824 Py_ssize_t __pyx_t_6;
3825 struct __pyx_array_obj *__pyx_t_7 = NULL;
3826 PyObject *__pyx_t_8 = NULL;
3827 PyObject *__pyx_t_9 = NULL;
3828 PyObject *__pyx_t_10 = NULL;
3829 PyObject *__pyx_t_11 = NULL;
3830 PyObject *__pyx_t_12 = NULL;
3831 PyObject *__pyx_t_13 = NULL;
3832 PyObject *__pyx_t_14 = NULL;
3833 int __pyx_lineno = 0;
3834 const char *__pyx_filename = NULL;
3835 int __pyx_clineno = 0;
3836 __Pyx_RefNannySetupContext(
"partitionNodes", 0);
3845 __pyx_v_cmesh->mesh.subdomainp = (&__pyx_v_subdomain_cmesh->mesh);
3863 __Pyx_XDECREF(__pyx_r);
3872 __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_np);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 42, __pyx_L1_error)
3873 __Pyx_GOTREF(__pyx_t_2);
3874 __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_asarray);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 42, __pyx_L1_error)
3875 __Pyx_GOTREF(__pyx_t_3);
3876 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
3877 __pyx_t_4 = __pyx_v_cmesh->mesh.elementOffsets_subdomain_owned;
3878 __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_comm), __pyx_n_s_size);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 42, __pyx_L1_error)
3879 __Pyx_GOTREF(__pyx_t_2);
3880 __pyx_t_5 = __Pyx_PyInt_AddObjC(__pyx_t_2, __pyx_int_1, 1, 0, 0);
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 42, __pyx_L1_error)
3881 __Pyx_GOTREF(__pyx_t_5);
3882 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
3883 __pyx_t_6 = __Pyx_PyIndex_AsSsize_t(__pyx_t_5);
if (unlikely((__pyx_t_6 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 42, __pyx_L1_error)
3884 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
3886 PyErr_SetString(PyExc_ValueError,
"Cannot create cython.array from NULL pointer");
3887 __PYX_ERR(0, 42, __pyx_L1_error)
3889 __pyx_t_2 = __pyx_format_from_typeinfo(&__Pyx_TypeInfo_int);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 42, __pyx_L1_error)
3890 __Pyx_GOTREF(__pyx_t_2);
3891 __pyx_t_5 = Py_BuildValue((
char*)
"(" __PYX_BUILD_PY_SSIZE_T
")", ((Py_ssize_t)__pyx_t_6));
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 42, __pyx_L1_error)
3892 __Pyx_GOTREF(__pyx_t_5);
3893 __pyx_t_7 = __pyx_array_new(__pyx_t_5,
sizeof(
int), PyBytes_AS_STRING(__pyx_t_2), (
char *)
"c", (
char *) __pyx_t_4);
3894 if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 42, __pyx_L1_error)
3895 __Pyx_GOTREF(__pyx_t_7);
3896 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
3897 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
3899 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
3900 __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
3901 if (likely(__pyx_t_2)) {
3902 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_3);
3903 __Pyx_INCREF(__pyx_t_2);
3904 __Pyx_INCREF(
function);
3905 __Pyx_DECREF_SET(__pyx_t_3,
function);
3908 __pyx_t_1 = (__pyx_t_2) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_2, ((PyObject *)__pyx_t_7)) : __Pyx_PyObject_CallOneArg(__pyx_t_3, ((PyObject *)__pyx_t_7));
3909 __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
3910 __Pyx_DECREF(((PyObject *)__pyx_t_7)); __pyx_t_7 = 0;
3911 if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 42, __pyx_L1_error)
3912 __Pyx_GOTREF(__pyx_t_1);
3913 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
3922 __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_np);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 43, __pyx_L1_error)
3923 __Pyx_GOTREF(__pyx_t_2);
3924 __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_asarray);
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 43, __pyx_L1_error)
3925 __Pyx_GOTREF(__pyx_t_5);
3926 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
3927 __pyx_t_4 = __pyx_v_cmesh->mesh.elementNumbering_subdomain2global;
3929 PyErr_SetString(PyExc_ValueError,
"Cannot create cython.array from NULL pointer");
3930 __PYX_ERR(0, 43, __pyx_L1_error)
3932 __pyx_t_8 = __pyx_format_from_typeinfo(&__Pyx_TypeInfo_int);
if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 43, __pyx_L1_error)
3933 __Pyx_GOTREF(__pyx_t_8);
3934 __pyx_t_2 = Py_BuildValue((
char*)
"(" __PYX_BUILD_PY_SSIZE_T
")", ((Py_ssize_t)__pyx_v_cmesh->mesh.subdomainp->nElements_global));
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 43, __pyx_L1_error)
3935 __Pyx_GOTREF(__pyx_t_2);
3936 __pyx_t_7 = __pyx_array_new(__pyx_t_2,
sizeof(
int), PyBytes_AS_STRING(__pyx_t_8), (
char *)
"c", (
char *) __pyx_t_4);
3937 if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 43, __pyx_L1_error)
3938 __Pyx_GOTREF(__pyx_t_7);
3939 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
3940 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
3942 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_5))) {
3943 __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_5);
3944 if (likely(__pyx_t_8)) {
3945 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_5);
3946 __Pyx_INCREF(__pyx_t_8);
3947 __Pyx_INCREF(
function);
3948 __Pyx_DECREF_SET(__pyx_t_5,
function);
3951 __pyx_t_3 = (__pyx_t_8) ? __Pyx_PyObject_Call2Args(__pyx_t_5, __pyx_t_8, ((PyObject *)__pyx_t_7)) : __Pyx_PyObject_CallOneArg(__pyx_t_5, ((PyObject *)__pyx_t_7));
3952 __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
3953 __Pyx_DECREF(((PyObject *)__pyx_t_7)); __pyx_t_7 = 0;
3954 if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 43, __pyx_L1_error)
3955 __Pyx_GOTREF(__pyx_t_3);
3956 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
3965 __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_n_s_np);
if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 44, __pyx_L1_error)
3966 __Pyx_GOTREF(__pyx_t_8);
3967 __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_asarray);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 44, __pyx_L1_error)
3968 __Pyx_GOTREF(__pyx_t_2);
3969 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
3970 __pyx_t_4 = __pyx_v_cmesh->mesh.nodeOffsets_subdomain_owned;
3971 __pyx_t_8 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_comm), __pyx_n_s_size);
if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 44, __pyx_L1_error)
3972 __Pyx_GOTREF(__pyx_t_8);
3973 __pyx_t_9 = __Pyx_PyInt_AddObjC(__pyx_t_8, __pyx_int_1, 1, 0, 0);
if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 44, __pyx_L1_error)
3974 __Pyx_GOTREF(__pyx_t_9);
3975 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
3976 __pyx_t_6 = __Pyx_PyIndex_AsSsize_t(__pyx_t_9);
if (unlikely((__pyx_t_6 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 44, __pyx_L1_error)
3977 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
3979 PyErr_SetString(PyExc_ValueError,
"Cannot create cython.array from NULL pointer");
3980 __PYX_ERR(0, 44, __pyx_L1_error)
3982 __pyx_t_8 = __pyx_format_from_typeinfo(&__Pyx_TypeInfo_int);
if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 44, __pyx_L1_error)
3983 __Pyx_GOTREF(__pyx_t_8);
3984 __pyx_t_9 = Py_BuildValue((
char*)
"(" __PYX_BUILD_PY_SSIZE_T
")", ((Py_ssize_t)__pyx_t_6));
if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 44, __pyx_L1_error)
3985 __Pyx_GOTREF(__pyx_t_9);
3986 __pyx_t_7 = __pyx_array_new(__pyx_t_9,
sizeof(
int), PyBytes_AS_STRING(__pyx_t_8), (
char *)
"c", (
char *) __pyx_t_4);
3987 if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 44, __pyx_L1_error)
3988 __Pyx_GOTREF(__pyx_t_7);
3989 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
3990 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
3992 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
3993 __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_2);
3994 if (likely(__pyx_t_8)) {
3995 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_2);
3996 __Pyx_INCREF(__pyx_t_8);
3997 __Pyx_INCREF(
function);
3998 __Pyx_DECREF_SET(__pyx_t_2,
function);
4001 __pyx_t_5 = (__pyx_t_8) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_8, ((PyObject *)__pyx_t_7)) : __Pyx_PyObject_CallOneArg(__pyx_t_2, ((PyObject *)__pyx_t_7));
4002 __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
4003 __Pyx_DECREF(((PyObject *)__pyx_t_7)); __pyx_t_7 = 0;
4004 if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 44, __pyx_L1_error)
4005 __Pyx_GOTREF(__pyx_t_5);
4006 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
4015 __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_n_s_np);
if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 45, __pyx_L1_error)
4016 __Pyx_GOTREF(__pyx_t_8);
4017 __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_asarray);
if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 45, __pyx_L1_error)
4018 __Pyx_GOTREF(__pyx_t_9);
4019 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
4020 __pyx_t_4 = __pyx_v_cmesh->mesh.nodeNumbering_subdomain2global;
4022 PyErr_SetString(PyExc_ValueError,
"Cannot create cython.array from NULL pointer");
4023 __PYX_ERR(0, 45, __pyx_L1_error)
4025 __pyx_t_10 = __pyx_format_from_typeinfo(&__Pyx_TypeInfo_int);
if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 45, __pyx_L1_error)
4026 __Pyx_GOTREF(__pyx_t_10);
4027 __pyx_t_8 = Py_BuildValue((
char*)
"(" __PYX_BUILD_PY_SSIZE_T
")", ((Py_ssize_t)__pyx_v_cmesh->mesh.subdomainp->nNodes_global));
if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 45, __pyx_L1_error)
4028 __Pyx_GOTREF(__pyx_t_8);
4029 __pyx_t_7 = __pyx_array_new(__pyx_t_8,
sizeof(
int), PyBytes_AS_STRING(__pyx_t_10), (
char *)
"c", (
char *) __pyx_t_4);
4030 if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 45, __pyx_L1_error)
4031 __Pyx_GOTREF(__pyx_t_7);
4032 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
4033 __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
4035 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_9))) {
4036 __pyx_t_10 = PyMethod_GET_SELF(__pyx_t_9);
4037 if (likely(__pyx_t_10)) {
4038 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_9);
4039 __Pyx_INCREF(__pyx_t_10);
4040 __Pyx_INCREF(
function);
4041 __Pyx_DECREF_SET(__pyx_t_9,
function);
4044 __pyx_t_2 = (__pyx_t_10) ? __Pyx_PyObject_Call2Args(__pyx_t_9, __pyx_t_10, ((PyObject *)__pyx_t_7)) : __Pyx_PyObject_CallOneArg(__pyx_t_9, ((PyObject *)__pyx_t_7));
4045 __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
4046 __Pyx_DECREF(((PyObject *)__pyx_t_7)); __pyx_t_7 = 0;
4047 if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 45, __pyx_L1_error)
4048 __Pyx_GOTREF(__pyx_t_2);
4049 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
4058 __Pyx_GetModuleGlobalName(__pyx_t_10, __pyx_n_s_np);
if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 46, __pyx_L1_error)
4059 __Pyx_GOTREF(__pyx_t_10);
4060 __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_n_s_asarray);
if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 46, __pyx_L1_error)
4061 __Pyx_GOTREF(__pyx_t_8);
4062 __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
4063 __pyx_t_4 = __pyx_v_cmesh->mesh.elementBoundaryOffsets_subdomain_owned;
4064 __pyx_t_10 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_comm), __pyx_n_s_size);
if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 46, __pyx_L1_error)
4065 __Pyx_GOTREF(__pyx_t_10);
4066 __pyx_t_11 = __Pyx_PyInt_AddObjC(__pyx_t_10, __pyx_int_1, 1, 0, 0);
if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 46, __pyx_L1_error)
4067 __Pyx_GOTREF(__pyx_t_11);
4068 __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
4069 __pyx_t_6 = __Pyx_PyIndex_AsSsize_t(__pyx_t_11);
if (unlikely((__pyx_t_6 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 46, __pyx_L1_error)
4070 __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
4072 PyErr_SetString(PyExc_ValueError,
"Cannot create cython.array from NULL pointer");
4073 __PYX_ERR(0, 46, __pyx_L1_error)
4075 __pyx_t_10 = __pyx_format_from_typeinfo(&__Pyx_TypeInfo_int);
if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 46, __pyx_L1_error)
4076 __Pyx_GOTREF(__pyx_t_10);
4077 __pyx_t_11 = Py_BuildValue((
char*)
"(" __PYX_BUILD_PY_SSIZE_T
")", ((Py_ssize_t)__pyx_t_6));
if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 46, __pyx_L1_error)
4078 __Pyx_GOTREF(__pyx_t_11);
4079 __pyx_t_7 = __pyx_array_new(__pyx_t_11,
sizeof(
int), PyBytes_AS_STRING(__pyx_t_10), (
char *)
"c", (
char *) __pyx_t_4);
4080 if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 46, __pyx_L1_error)
4081 __Pyx_GOTREF(__pyx_t_7);
4082 __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
4083 __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
4085 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_8))) {
4086 __pyx_t_10 = PyMethod_GET_SELF(__pyx_t_8);
4087 if (likely(__pyx_t_10)) {
4088 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_8);
4089 __Pyx_INCREF(__pyx_t_10);
4090 __Pyx_INCREF(
function);
4091 __Pyx_DECREF_SET(__pyx_t_8,
function);
4094 __pyx_t_9 = (__pyx_t_10) ? __Pyx_PyObject_Call2Args(__pyx_t_8, __pyx_t_10, ((PyObject *)__pyx_t_7)) : __Pyx_PyObject_CallOneArg(__pyx_t_8, ((PyObject *)__pyx_t_7));
4095 __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
4096 __Pyx_DECREF(((PyObject *)__pyx_t_7)); __pyx_t_7 = 0;
4097 if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 46, __pyx_L1_error)
4098 __Pyx_GOTREF(__pyx_t_9);
4099 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
4108 __Pyx_GetModuleGlobalName(__pyx_t_10, __pyx_n_s_np);
if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 47, __pyx_L1_error)
4109 __Pyx_GOTREF(__pyx_t_10);
4110 __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_n_s_asarray);
if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 47, __pyx_L1_error)
4111 __Pyx_GOTREF(__pyx_t_11);
4112 __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
4113 __pyx_t_4 = __pyx_v_cmesh->mesh.elementBoundaryNumbering_subdomain2global;
4115 PyErr_SetString(PyExc_ValueError,
"Cannot create cython.array from NULL pointer");
4116 __PYX_ERR(0, 47, __pyx_L1_error)
4118 __pyx_t_12 = __pyx_format_from_typeinfo(&__Pyx_TypeInfo_int);
if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 47, __pyx_L1_error)
4119 __Pyx_GOTREF(__pyx_t_12);
4120 __pyx_t_10 = Py_BuildValue((
char*)
"(" __PYX_BUILD_PY_SSIZE_T
")", ((Py_ssize_t)__pyx_v_cmesh->mesh.subdomainp->nElementBoundaries_global));
if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 47, __pyx_L1_error)
4121 __Pyx_GOTREF(__pyx_t_10);
4122 __pyx_t_7 = __pyx_array_new(__pyx_t_10,
sizeof(
int), PyBytes_AS_STRING(__pyx_t_12), (
char *)
"c", (
char *) __pyx_t_4);
4123 if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 47, __pyx_L1_error)
4124 __Pyx_GOTREF(__pyx_t_7);
4125 __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
4126 __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
4128 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_11))) {
4129 __pyx_t_12 = PyMethod_GET_SELF(__pyx_t_11);
4130 if (likely(__pyx_t_12)) {
4131 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_11);
4132 __Pyx_INCREF(__pyx_t_12);
4133 __Pyx_INCREF(
function);
4134 __Pyx_DECREF_SET(__pyx_t_11,
function);
4137 __pyx_t_8 = (__pyx_t_12) ? __Pyx_PyObject_Call2Args(__pyx_t_11, __pyx_t_12, ((PyObject *)__pyx_t_7)) : __Pyx_PyObject_CallOneArg(__pyx_t_11, ((PyObject *)__pyx_t_7));
4138 __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
4139 __Pyx_DECREF(((PyObject *)__pyx_t_7)); __pyx_t_7 = 0;
4140 if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 47, __pyx_L1_error)
4141 __Pyx_GOTREF(__pyx_t_8);
4142 __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
4151 __Pyx_GetModuleGlobalName(__pyx_t_12, __pyx_n_s_np);
if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 48, __pyx_L1_error)
4152 __Pyx_GOTREF(__pyx_t_12);
4153 __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_12, __pyx_n_s_asarray);
if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 48, __pyx_L1_error)
4154 __Pyx_GOTREF(__pyx_t_10);
4155 __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
4156 __pyx_t_4 = __pyx_v_cmesh->mesh.edgeOffsets_subdomain_owned;
4157 __pyx_t_12 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_comm), __pyx_n_s_size);
if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 48, __pyx_L1_error)
4158 __Pyx_GOTREF(__pyx_t_12);
4159 __pyx_t_13 = __Pyx_PyInt_AddObjC(__pyx_t_12, __pyx_int_1, 1, 0, 0);
if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 48, __pyx_L1_error)
4160 __Pyx_GOTREF(__pyx_t_13);
4161 __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
4162 __pyx_t_6 = __Pyx_PyIndex_AsSsize_t(__pyx_t_13);
if (unlikely((__pyx_t_6 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 48, __pyx_L1_error)
4163 __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
4165 PyErr_SetString(PyExc_ValueError,
"Cannot create cython.array from NULL pointer");
4166 __PYX_ERR(0, 48, __pyx_L1_error)
4168 __pyx_t_12 = __pyx_format_from_typeinfo(&__Pyx_TypeInfo_int);
if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 48, __pyx_L1_error)
4169 __Pyx_GOTREF(__pyx_t_12);
4170 __pyx_t_13 = Py_BuildValue((
char*)
"(" __PYX_BUILD_PY_SSIZE_T
")", ((Py_ssize_t)__pyx_t_6));
if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 48, __pyx_L1_error)
4171 __Pyx_GOTREF(__pyx_t_13);
4172 __pyx_t_7 = __pyx_array_new(__pyx_t_13,
sizeof(
int), PyBytes_AS_STRING(__pyx_t_12), (
char *)
"c", (
char *) __pyx_t_4);
4173 if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 48, __pyx_L1_error)
4174 __Pyx_GOTREF(__pyx_t_7);
4175 __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
4176 __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
4178 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_10))) {
4179 __pyx_t_12 = PyMethod_GET_SELF(__pyx_t_10);
4180 if (likely(__pyx_t_12)) {
4181 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_10);
4182 __Pyx_INCREF(__pyx_t_12);
4183 __Pyx_INCREF(
function);
4184 __Pyx_DECREF_SET(__pyx_t_10,
function);
4187 __pyx_t_11 = (__pyx_t_12) ? __Pyx_PyObject_Call2Args(__pyx_t_10, __pyx_t_12, ((PyObject *)__pyx_t_7)) : __Pyx_PyObject_CallOneArg(__pyx_t_10, ((PyObject *)__pyx_t_7));
4188 __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
4189 __Pyx_DECREF(((PyObject *)__pyx_t_7)); __pyx_t_7 = 0;
4190 if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 48, __pyx_L1_error)
4191 __Pyx_GOTREF(__pyx_t_11);
4192 __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
4201 __Pyx_GetModuleGlobalName(__pyx_t_12, __pyx_n_s_np);
if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 49, __pyx_L1_error)
4202 __Pyx_GOTREF(__pyx_t_12);
4203 __pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_t_12, __pyx_n_s_asarray);
if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 49, __pyx_L1_error)
4204 __Pyx_GOTREF(__pyx_t_13);
4205 __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
4206 __pyx_t_4 = __pyx_v_cmesh->mesh.edgeNumbering_subdomain2global;
4208 PyErr_SetString(PyExc_ValueError,
"Cannot create cython.array from NULL pointer");
4209 __PYX_ERR(0, 49, __pyx_L1_error)
4211 __pyx_t_14 = __pyx_format_from_typeinfo(&__Pyx_TypeInfo_int);
if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 49, __pyx_L1_error)
4212 __Pyx_GOTREF(__pyx_t_14);
4213 __pyx_t_12 = Py_BuildValue((
char*)
"(" __PYX_BUILD_PY_SSIZE_T
")", ((Py_ssize_t)__pyx_v_cmesh->mesh.subdomainp->nEdges_global));
if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 49, __pyx_L1_error)
4214 __Pyx_GOTREF(__pyx_t_12);
4215 __pyx_t_7 = __pyx_array_new(__pyx_t_12,
sizeof(
int), PyBytes_AS_STRING(__pyx_t_14), (
char *)
"c", (
char *) __pyx_t_4);
4216 if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 49, __pyx_L1_error)
4217 __Pyx_GOTREF(__pyx_t_7);
4218 __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
4219 __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
4221 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_13))) {
4222 __pyx_t_14 = PyMethod_GET_SELF(__pyx_t_13);
4223 if (likely(__pyx_t_14)) {
4224 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_13);
4225 __Pyx_INCREF(__pyx_t_14);
4226 __Pyx_INCREF(
function);
4227 __Pyx_DECREF_SET(__pyx_t_13,
function);
4230 __pyx_t_10 = (__pyx_t_14) ? __Pyx_PyObject_Call2Args(__pyx_t_13, __pyx_t_14, ((PyObject *)__pyx_t_7)) : __Pyx_PyObject_CallOneArg(__pyx_t_13, ((PyObject *)__pyx_t_7));
4231 __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0;
4232 __Pyx_DECREF(((PyObject *)__pyx_t_7)); __pyx_t_7 = 0;
4233 if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 49, __pyx_L1_error)
4234 __Pyx_GOTREF(__pyx_t_10);
4235 __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
4244 __pyx_t_13 = PyTuple_New(8);
if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 42, __pyx_L1_error)
4245 __Pyx_GOTREF(__pyx_t_13);
4246 __Pyx_GIVEREF(__pyx_t_1);
4247 PyTuple_SET_ITEM(__pyx_t_13, 0, __pyx_t_1);
4248 __Pyx_GIVEREF(__pyx_t_3);
4249 PyTuple_SET_ITEM(__pyx_t_13, 1, __pyx_t_3);
4250 __Pyx_GIVEREF(__pyx_t_5);
4251 PyTuple_SET_ITEM(__pyx_t_13, 2, __pyx_t_5);
4252 __Pyx_GIVEREF(__pyx_t_2);
4253 PyTuple_SET_ITEM(__pyx_t_13, 3, __pyx_t_2);
4254 __Pyx_GIVEREF(__pyx_t_9);
4255 PyTuple_SET_ITEM(__pyx_t_13, 4, __pyx_t_9);
4256 __Pyx_GIVEREF(__pyx_t_8);
4257 PyTuple_SET_ITEM(__pyx_t_13, 5, __pyx_t_8);
4258 __Pyx_GIVEREF(__pyx_t_11);
4259 PyTuple_SET_ITEM(__pyx_t_13, 6, __pyx_t_11);
4260 __Pyx_GIVEREF(__pyx_t_10);
4261 PyTuple_SET_ITEM(__pyx_t_13, 7, __pyx_t_10);
4270 __pyx_r = __pyx_t_13;
4284 __Pyx_XDECREF(__pyx_t_1);
4285 __Pyx_XDECREF(__pyx_t_2);
4286 __Pyx_XDECREF(__pyx_t_3);
4287 __Pyx_XDECREF(__pyx_t_5);
4288 __Pyx_XDECREF(((PyObject *)__pyx_t_7));
4289 __Pyx_XDECREF(__pyx_t_8);
4290 __Pyx_XDECREF(__pyx_t_9);
4291 __Pyx_XDECREF(__pyx_t_10);
4292 __Pyx_XDECREF(__pyx_t_11);
4293 __Pyx_XDECREF(__pyx_t_12);
4294 __Pyx_XDECREF(__pyx_t_13);
4295 __Pyx_XDECREF(__pyx_t_14);
4296 __Pyx_AddTraceback(
"cpartitioning.partitionNodes", __pyx_clineno, __pyx_lineno, __pyx_filename);
4299 __Pyx_XGIVEREF(__pyx_r);
4300 __Pyx_RefNannyFinishContext();
4313 static PyObject *__pyx_pw_13cpartitioning_5convertPUMIPartitionToPython(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
4314 static PyMethodDef __pyx_mdef_13cpartitioning_5convertPUMIPartitionToPython = {
"convertPUMIPartitionToPython", (PyCFunction)(
void*)(PyCFunctionWithKeywords)__pyx_pw_13cpartitioning_5convertPUMIPartitionToPython, METH_VARARGS|METH_KEYWORDS, 0};
4315 static PyObject *__pyx_pw_13cpartitioning_5convertPUMIPartitionToPython(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
4316 CYTHON_UNUSED
struct PyMPICommObject *__pyx_v_comm = 0;
4317 struct __pyx_obj_7proteus_10cmeshTools_CMesh *__pyx_v_cmesh = 0;
4318 struct __pyx_obj_7proteus_10cmeshTools_CMesh *__pyx_v_subdomain_cmesh = 0;
4319 int __pyx_lineno = 0;
4320 const char *__pyx_filename = NULL;
4321 int __pyx_clineno = 0;
4322 PyObject *__pyx_r = 0;
4323 __Pyx_RefNannyDeclarations
4324 __Pyx_RefNannySetupContext(
"convertPUMIPartitionToPython (wrapper)", 0);
4326 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_comm,&__pyx_n_s_cmesh,&__pyx_n_s_subdomain_cmesh,0};
4327 PyObject* values[3] = {0,0,0};
4328 if (unlikely(__pyx_kwds)) {
4330 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
4332 case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
4334 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
4336 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
4339 default:
goto __pyx_L5_argtuple_error;
4341 kw_args = PyDict_Size(__pyx_kwds);
4344 if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_comm)) != 0)) kw_args--;
4345 else goto __pyx_L5_argtuple_error;
4348 if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_cmesh)) != 0)) kw_args--;
4350 __Pyx_RaiseArgtupleInvalid(
"convertPUMIPartitionToPython", 1, 3, 3, 1); __PYX_ERR(0, 52, __pyx_L3_error)
4354 if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_subdomain_cmesh)) != 0)) kw_args--;
4356 __Pyx_RaiseArgtupleInvalid(
"convertPUMIPartitionToPython", 1, 3, 3, 2); __PYX_ERR(0, 52, __pyx_L3_error)
4359 if (unlikely(kw_args > 0)) {
4360 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args,
"convertPUMIPartitionToPython") < 0)) __PYX_ERR(0, 52, __pyx_L3_error)
4362 }
else if (PyTuple_GET_SIZE(__pyx_args) != 3) {
4363 goto __pyx_L5_argtuple_error;
4365 values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
4366 values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
4367 values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
4369 __pyx_v_comm = ((
struct PyMPICommObject *)values[0]);
4370 __pyx_v_cmesh = ((
struct __pyx_obj_7proteus_10cmeshTools_CMesh *)values[1]);
4371 __pyx_v_subdomain_cmesh = ((
struct __pyx_obj_7proteus_10cmeshTools_CMesh *)values[2]);
4373 goto __pyx_L4_argument_unpacking_done;
4374 __pyx_L5_argtuple_error:;
4375 __Pyx_RaiseArgtupleInvalid(
"convertPUMIPartitionToPython", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 52, __pyx_L3_error)
4377 __Pyx_AddTraceback(
"cpartitioning.convertPUMIPartitionToPython", __pyx_clineno, __pyx_lineno, __pyx_filename);
4378 __Pyx_RefNannyFinishContext();
4380 __pyx_L4_argument_unpacking_done:;
4381 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_comm), __pyx_ptype_6mpi4py_3MPI_Comm, 1,
"comm", 0))) __PYX_ERR(0, 52, __pyx_L1_error)
4382 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_cmesh), __pyx_ptype_7proteus_10cmeshTools_CMesh, 1,
"cmesh", 0))) __PYX_ERR(0, 52, __pyx_L1_error)
4383 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_subdomain_cmesh), __pyx_ptype_7proteus_10cmeshTools_CMesh, 1,
"subdomain_cmesh", 0))) __PYX_ERR(0, 52, __pyx_L1_error)
4384 __pyx_r = __pyx_pf_13cpartitioning_4convertPUMIPartitionToPython(__pyx_self, __pyx_v_comm, __pyx_v_cmesh, __pyx_v_subdomain_cmesh);
4391 __Pyx_RefNannyFinishContext();
4395 static PyObject *__pyx_pf_13cpartitioning_4convertPUMIPartitionToPython(CYTHON_UNUSED PyObject *__pyx_self, CYTHON_UNUSED
struct PyMPICommObject *__pyx_v_comm,
struct __pyx_obj_7proteus_10cmeshTools_CMesh *__pyx_v_cmesh,
struct __pyx_obj_7proteus_10cmeshTools_CMesh *__pyx_v_subdomain_cmesh) {
4396 PyObject *__pyx_r = NULL;
4397 __Pyx_RefNannyDeclarations
4398 PyObject *__pyx_t_1 = NULL;
4399 PyObject *__pyx_t_2 = NULL;
4400 PyObject *__pyx_t_3 = NULL;
4402 PyObject *__pyx_t_5 = NULL;
4403 Py_ssize_t __pyx_t_6;
4404 struct __pyx_array_obj *__pyx_t_7 = NULL;
4405 PyObject *__pyx_t_8 = NULL;
4406 PyObject *__pyx_t_9 = NULL;
4407 PyObject *__pyx_t_10 = NULL;
4408 PyObject *__pyx_t_11 = NULL;
4409 PyObject *__pyx_t_12 = NULL;
4410 PyObject *__pyx_t_13 = NULL;
4411 PyObject *__pyx_t_14 = NULL;
4412 int __pyx_lineno = 0;
4413 const char *__pyx_filename = NULL;
4414 int __pyx_clineno = 0;
4415 __Pyx_RefNannySetupContext(
"convertPUMIPartitionToPython", 0);
4424 __pyx_v_cmesh->mesh.subdomainp = (&__pyx_v_subdomain_cmesh->mesh);
4433 __Pyx_XDECREF(__pyx_r);
4442 __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_np);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 56, __pyx_L1_error)
4443 __Pyx_GOTREF(__pyx_t_2);
4444 __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_asarray);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 56, __pyx_L1_error)
4445 __Pyx_GOTREF(__pyx_t_3);
4446 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
4447 __pyx_t_4 = __pyx_v_cmesh->mesh.elementOffsets_subdomain_owned;
4448 __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_comm), __pyx_n_s_size);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 56, __pyx_L1_error)
4449 __Pyx_GOTREF(__pyx_t_2);
4450 __pyx_t_5 = __Pyx_PyInt_AddObjC(__pyx_t_2, __pyx_int_1, 1, 0, 0);
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 56, __pyx_L1_error)
4451 __Pyx_GOTREF(__pyx_t_5);
4452 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
4453 __pyx_t_6 = __Pyx_PyIndex_AsSsize_t(__pyx_t_5);
if (unlikely((__pyx_t_6 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 56, __pyx_L1_error)
4454 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
4456 PyErr_SetString(PyExc_ValueError,
"Cannot create cython.array from NULL pointer");
4457 __PYX_ERR(0, 56, __pyx_L1_error)
4459 __pyx_t_2 = __pyx_format_from_typeinfo(&__Pyx_TypeInfo_int);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 56, __pyx_L1_error)
4460 __Pyx_GOTREF(__pyx_t_2);
4461 __pyx_t_5 = Py_BuildValue((
char*)
"(" __PYX_BUILD_PY_SSIZE_T
")", ((Py_ssize_t)__pyx_t_6));
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 56, __pyx_L1_error)
4462 __Pyx_GOTREF(__pyx_t_5);
4463 __pyx_t_7 = __pyx_array_new(__pyx_t_5,
sizeof(
int), PyBytes_AS_STRING(__pyx_t_2), (
char *)
"c", (
char *) __pyx_t_4);
4464 if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 56, __pyx_L1_error)
4465 __Pyx_GOTREF(__pyx_t_7);
4466 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
4467 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
4469 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
4470 __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
4471 if (likely(__pyx_t_2)) {
4472 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_3);
4473 __Pyx_INCREF(__pyx_t_2);
4474 __Pyx_INCREF(
function);
4475 __Pyx_DECREF_SET(__pyx_t_3,
function);
4478 __pyx_t_1 = (__pyx_t_2) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_2, ((PyObject *)__pyx_t_7)) : __Pyx_PyObject_CallOneArg(__pyx_t_3, ((PyObject *)__pyx_t_7));
4479 __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
4480 __Pyx_DECREF(((PyObject *)__pyx_t_7)); __pyx_t_7 = 0;
4481 if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 56, __pyx_L1_error)
4482 __Pyx_GOTREF(__pyx_t_1);
4483 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
4492 __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_np);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 57, __pyx_L1_error)
4493 __Pyx_GOTREF(__pyx_t_2);
4494 __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_asarray);
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 57, __pyx_L1_error)
4495 __Pyx_GOTREF(__pyx_t_5);
4496 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
4497 __pyx_t_4 = __pyx_v_cmesh->mesh.elementNumbering_subdomain2global;
4499 PyErr_SetString(PyExc_ValueError,
"Cannot create cython.array from NULL pointer");
4500 __PYX_ERR(0, 57, __pyx_L1_error)
4502 __pyx_t_8 = __pyx_format_from_typeinfo(&__Pyx_TypeInfo_int);
if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 57, __pyx_L1_error)
4503 __Pyx_GOTREF(__pyx_t_8);
4504 __pyx_t_2 = Py_BuildValue((
char*)
"(" __PYX_BUILD_PY_SSIZE_T
")", ((Py_ssize_t)__pyx_v_cmesh->mesh.subdomainp->nElements_global));
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 57, __pyx_L1_error)
4505 __Pyx_GOTREF(__pyx_t_2);
4506 __pyx_t_7 = __pyx_array_new(__pyx_t_2,
sizeof(
int), PyBytes_AS_STRING(__pyx_t_8), (
char *)
"c", (
char *) __pyx_t_4);
4507 if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 57, __pyx_L1_error)
4508 __Pyx_GOTREF(__pyx_t_7);
4509 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
4510 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
4512 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_5))) {
4513 __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_5);
4514 if (likely(__pyx_t_8)) {
4515 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_5);
4516 __Pyx_INCREF(__pyx_t_8);
4517 __Pyx_INCREF(
function);
4518 __Pyx_DECREF_SET(__pyx_t_5,
function);
4521 __pyx_t_3 = (__pyx_t_8) ? __Pyx_PyObject_Call2Args(__pyx_t_5, __pyx_t_8, ((PyObject *)__pyx_t_7)) : __Pyx_PyObject_CallOneArg(__pyx_t_5, ((PyObject *)__pyx_t_7));
4522 __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
4523 __Pyx_DECREF(((PyObject *)__pyx_t_7)); __pyx_t_7 = 0;
4524 if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 57, __pyx_L1_error)
4525 __Pyx_GOTREF(__pyx_t_3);
4526 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
4535 __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_n_s_np);
if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 58, __pyx_L1_error)
4536 __Pyx_GOTREF(__pyx_t_8);
4537 __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_asarray);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 58, __pyx_L1_error)
4538 __Pyx_GOTREF(__pyx_t_2);
4539 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
4540 __pyx_t_4 = __pyx_v_cmesh->mesh.nodeOffsets_subdomain_owned;
4541 __pyx_t_8 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_comm), __pyx_n_s_size);
if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 58, __pyx_L1_error)
4542 __Pyx_GOTREF(__pyx_t_8);
4543 __pyx_t_9 = __Pyx_PyInt_AddObjC(__pyx_t_8, __pyx_int_1, 1, 0, 0);
if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 58, __pyx_L1_error)
4544 __Pyx_GOTREF(__pyx_t_9);
4545 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
4546 __pyx_t_6 = __Pyx_PyIndex_AsSsize_t(__pyx_t_9);
if (unlikely((__pyx_t_6 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 58, __pyx_L1_error)
4547 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
4549 PyErr_SetString(PyExc_ValueError,
"Cannot create cython.array from NULL pointer");
4550 __PYX_ERR(0, 58, __pyx_L1_error)
4552 __pyx_t_8 = __pyx_format_from_typeinfo(&__Pyx_TypeInfo_int);
if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 58, __pyx_L1_error)
4553 __Pyx_GOTREF(__pyx_t_8);
4554 __pyx_t_9 = Py_BuildValue((
char*)
"(" __PYX_BUILD_PY_SSIZE_T
")", ((Py_ssize_t)__pyx_t_6));
if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 58, __pyx_L1_error)
4555 __Pyx_GOTREF(__pyx_t_9);
4556 __pyx_t_7 = __pyx_array_new(__pyx_t_9,
sizeof(
int), PyBytes_AS_STRING(__pyx_t_8), (
char *)
"c", (
char *) __pyx_t_4);
4557 if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 58, __pyx_L1_error)
4558 __Pyx_GOTREF(__pyx_t_7);
4559 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
4560 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
4562 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
4563 __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_2);
4564 if (likely(__pyx_t_8)) {
4565 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_2);
4566 __Pyx_INCREF(__pyx_t_8);
4567 __Pyx_INCREF(
function);
4568 __Pyx_DECREF_SET(__pyx_t_2,
function);
4571 __pyx_t_5 = (__pyx_t_8) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_8, ((PyObject *)__pyx_t_7)) : __Pyx_PyObject_CallOneArg(__pyx_t_2, ((PyObject *)__pyx_t_7));
4572 __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
4573 __Pyx_DECREF(((PyObject *)__pyx_t_7)); __pyx_t_7 = 0;
4574 if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 58, __pyx_L1_error)
4575 __Pyx_GOTREF(__pyx_t_5);
4576 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
4585 __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_n_s_np);
if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 59, __pyx_L1_error)
4586 __Pyx_GOTREF(__pyx_t_8);
4587 __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_asarray);
if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 59, __pyx_L1_error)
4588 __Pyx_GOTREF(__pyx_t_9);
4589 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
4590 __pyx_t_4 = __pyx_v_cmesh->mesh.nodeNumbering_subdomain2global;
4592 PyErr_SetString(PyExc_ValueError,
"Cannot create cython.array from NULL pointer");
4593 __PYX_ERR(0, 59, __pyx_L1_error)
4595 __pyx_t_10 = __pyx_format_from_typeinfo(&__Pyx_TypeInfo_int);
if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 59, __pyx_L1_error)
4596 __Pyx_GOTREF(__pyx_t_10);
4597 __pyx_t_8 = Py_BuildValue((
char*)
"(" __PYX_BUILD_PY_SSIZE_T
")", ((Py_ssize_t)__pyx_v_cmesh->mesh.subdomainp->nNodes_global));
if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 59, __pyx_L1_error)
4598 __Pyx_GOTREF(__pyx_t_8);
4599 __pyx_t_7 = __pyx_array_new(__pyx_t_8,
sizeof(
int), PyBytes_AS_STRING(__pyx_t_10), (
char *)
"c", (
char *) __pyx_t_4);
4600 if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 59, __pyx_L1_error)
4601 __Pyx_GOTREF(__pyx_t_7);
4602 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
4603 __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
4605 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_9))) {
4606 __pyx_t_10 = PyMethod_GET_SELF(__pyx_t_9);
4607 if (likely(__pyx_t_10)) {
4608 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_9);
4609 __Pyx_INCREF(__pyx_t_10);
4610 __Pyx_INCREF(
function);
4611 __Pyx_DECREF_SET(__pyx_t_9,
function);
4614 __pyx_t_2 = (__pyx_t_10) ? __Pyx_PyObject_Call2Args(__pyx_t_9, __pyx_t_10, ((PyObject *)__pyx_t_7)) : __Pyx_PyObject_CallOneArg(__pyx_t_9, ((PyObject *)__pyx_t_7));
4615 __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
4616 __Pyx_DECREF(((PyObject *)__pyx_t_7)); __pyx_t_7 = 0;
4617 if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 59, __pyx_L1_error)
4618 __Pyx_GOTREF(__pyx_t_2);
4619 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
4628 __Pyx_GetModuleGlobalName(__pyx_t_10, __pyx_n_s_np);
if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 60, __pyx_L1_error)
4629 __Pyx_GOTREF(__pyx_t_10);
4630 __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_n_s_asarray);
if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 60, __pyx_L1_error)
4631 __Pyx_GOTREF(__pyx_t_8);
4632 __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
4633 __pyx_t_4 = __pyx_v_cmesh->mesh.elementBoundaryOffsets_subdomain_owned;
4634 __pyx_t_10 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_comm), __pyx_n_s_size);
if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 60, __pyx_L1_error)
4635 __Pyx_GOTREF(__pyx_t_10);
4636 __pyx_t_11 = __Pyx_PyInt_AddObjC(__pyx_t_10, __pyx_int_1, 1, 0, 0);
if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 60, __pyx_L1_error)
4637 __Pyx_GOTREF(__pyx_t_11);
4638 __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
4639 __pyx_t_6 = __Pyx_PyIndex_AsSsize_t(__pyx_t_11);
if (unlikely((__pyx_t_6 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 60, __pyx_L1_error)
4640 __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
4642 PyErr_SetString(PyExc_ValueError,
"Cannot create cython.array from NULL pointer");
4643 __PYX_ERR(0, 60, __pyx_L1_error)
4645 __pyx_t_10 = __pyx_format_from_typeinfo(&__Pyx_TypeInfo_int);
if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 60, __pyx_L1_error)
4646 __Pyx_GOTREF(__pyx_t_10);
4647 __pyx_t_11 = Py_BuildValue((
char*)
"(" __PYX_BUILD_PY_SSIZE_T
")", ((Py_ssize_t)__pyx_t_6));
if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 60, __pyx_L1_error)
4648 __Pyx_GOTREF(__pyx_t_11);
4649 __pyx_t_7 = __pyx_array_new(__pyx_t_11,
sizeof(
int), PyBytes_AS_STRING(__pyx_t_10), (
char *)
"c", (
char *) __pyx_t_4);
4650 if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 60, __pyx_L1_error)
4651 __Pyx_GOTREF(__pyx_t_7);
4652 __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
4653 __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
4655 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_8))) {
4656 __pyx_t_10 = PyMethod_GET_SELF(__pyx_t_8);
4657 if (likely(__pyx_t_10)) {
4658 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_8);
4659 __Pyx_INCREF(__pyx_t_10);
4660 __Pyx_INCREF(
function);
4661 __Pyx_DECREF_SET(__pyx_t_8,
function);
4664 __pyx_t_9 = (__pyx_t_10) ? __Pyx_PyObject_Call2Args(__pyx_t_8, __pyx_t_10, ((PyObject *)__pyx_t_7)) : __Pyx_PyObject_CallOneArg(__pyx_t_8, ((PyObject *)__pyx_t_7));
4665 __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
4666 __Pyx_DECREF(((PyObject *)__pyx_t_7)); __pyx_t_7 = 0;
4667 if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 60, __pyx_L1_error)
4668 __Pyx_GOTREF(__pyx_t_9);
4669 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
4678 __Pyx_GetModuleGlobalName(__pyx_t_10, __pyx_n_s_np);
if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 61, __pyx_L1_error)
4679 __Pyx_GOTREF(__pyx_t_10);
4680 __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_n_s_asarray);
if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 61, __pyx_L1_error)
4681 __Pyx_GOTREF(__pyx_t_11);
4682 __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
4683 __pyx_t_4 = __pyx_v_cmesh->mesh.elementBoundaryNumbering_subdomain2global;
4685 PyErr_SetString(PyExc_ValueError,
"Cannot create cython.array from NULL pointer");
4686 __PYX_ERR(0, 61, __pyx_L1_error)
4688 __pyx_t_12 = __pyx_format_from_typeinfo(&__Pyx_TypeInfo_int);
if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 61, __pyx_L1_error)
4689 __Pyx_GOTREF(__pyx_t_12);
4690 __pyx_t_10 = Py_BuildValue((
char*)
"(" __PYX_BUILD_PY_SSIZE_T
")", ((Py_ssize_t)__pyx_v_cmesh->mesh.subdomainp->nElementBoundaries_global));
if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 61, __pyx_L1_error)
4691 __Pyx_GOTREF(__pyx_t_10);
4692 __pyx_t_7 = __pyx_array_new(__pyx_t_10,
sizeof(
int), PyBytes_AS_STRING(__pyx_t_12), (
char *)
"c", (
char *) __pyx_t_4);
4693 if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 61, __pyx_L1_error)
4694 __Pyx_GOTREF(__pyx_t_7);
4695 __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
4696 __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
4698 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_11))) {
4699 __pyx_t_12 = PyMethod_GET_SELF(__pyx_t_11);
4700 if (likely(__pyx_t_12)) {
4701 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_11);
4702 __Pyx_INCREF(__pyx_t_12);
4703 __Pyx_INCREF(
function);
4704 __Pyx_DECREF_SET(__pyx_t_11,
function);
4707 __pyx_t_8 = (__pyx_t_12) ? __Pyx_PyObject_Call2Args(__pyx_t_11, __pyx_t_12, ((PyObject *)__pyx_t_7)) : __Pyx_PyObject_CallOneArg(__pyx_t_11, ((PyObject *)__pyx_t_7));
4708 __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
4709 __Pyx_DECREF(((PyObject *)__pyx_t_7)); __pyx_t_7 = 0;
4710 if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 61, __pyx_L1_error)
4711 __Pyx_GOTREF(__pyx_t_8);
4712 __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
4721 __Pyx_GetModuleGlobalName(__pyx_t_12, __pyx_n_s_np);
if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 62, __pyx_L1_error)
4722 __Pyx_GOTREF(__pyx_t_12);
4723 __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_12, __pyx_n_s_asarray);
if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 62, __pyx_L1_error)
4724 __Pyx_GOTREF(__pyx_t_10);
4725 __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
4726 __pyx_t_4 = __pyx_v_cmesh->mesh.edgeOffsets_subdomain_owned;
4727 __pyx_t_12 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_comm), __pyx_n_s_size);
if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 62, __pyx_L1_error)
4728 __Pyx_GOTREF(__pyx_t_12);
4729 __pyx_t_13 = __Pyx_PyInt_AddObjC(__pyx_t_12, __pyx_int_1, 1, 0, 0);
if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 62, __pyx_L1_error)
4730 __Pyx_GOTREF(__pyx_t_13);
4731 __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
4732 __pyx_t_6 = __Pyx_PyIndex_AsSsize_t(__pyx_t_13);
if (unlikely((__pyx_t_6 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 62, __pyx_L1_error)
4733 __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
4735 PyErr_SetString(PyExc_ValueError,
"Cannot create cython.array from NULL pointer");
4736 __PYX_ERR(0, 62, __pyx_L1_error)
4738 __pyx_t_12 = __pyx_format_from_typeinfo(&__Pyx_TypeInfo_int);
if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 62, __pyx_L1_error)
4739 __Pyx_GOTREF(__pyx_t_12);
4740 __pyx_t_13 = Py_BuildValue((
char*)
"(" __PYX_BUILD_PY_SSIZE_T
")", ((Py_ssize_t)__pyx_t_6));
if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 62, __pyx_L1_error)
4741 __Pyx_GOTREF(__pyx_t_13);
4742 __pyx_t_7 = __pyx_array_new(__pyx_t_13,
sizeof(
int), PyBytes_AS_STRING(__pyx_t_12), (
char *)
"c", (
char *) __pyx_t_4);
4743 if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 62, __pyx_L1_error)
4744 __Pyx_GOTREF(__pyx_t_7);
4745 __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
4746 __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
4748 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_10))) {
4749 __pyx_t_12 = PyMethod_GET_SELF(__pyx_t_10);
4750 if (likely(__pyx_t_12)) {
4751 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_10);
4752 __Pyx_INCREF(__pyx_t_12);
4753 __Pyx_INCREF(
function);
4754 __Pyx_DECREF_SET(__pyx_t_10,
function);
4757 __pyx_t_11 = (__pyx_t_12) ? __Pyx_PyObject_Call2Args(__pyx_t_10, __pyx_t_12, ((PyObject *)__pyx_t_7)) : __Pyx_PyObject_CallOneArg(__pyx_t_10, ((PyObject *)__pyx_t_7));
4758 __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
4759 __Pyx_DECREF(((PyObject *)__pyx_t_7)); __pyx_t_7 = 0;
4760 if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 62, __pyx_L1_error)
4761 __Pyx_GOTREF(__pyx_t_11);
4762 __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
4771 __Pyx_GetModuleGlobalName(__pyx_t_12, __pyx_n_s_np);
if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 63, __pyx_L1_error)
4772 __Pyx_GOTREF(__pyx_t_12);
4773 __pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_t_12, __pyx_n_s_asarray);
if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 63, __pyx_L1_error)
4774 __Pyx_GOTREF(__pyx_t_13);
4775 __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
4776 __pyx_t_4 = __pyx_v_cmesh->mesh.edgeNumbering_subdomain2global;
4778 PyErr_SetString(PyExc_ValueError,
"Cannot create cython.array from NULL pointer");
4779 __PYX_ERR(0, 63, __pyx_L1_error)
4781 __pyx_t_14 = __pyx_format_from_typeinfo(&__Pyx_TypeInfo_int);
if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 63, __pyx_L1_error)
4782 __Pyx_GOTREF(__pyx_t_14);
4783 __pyx_t_12 = Py_BuildValue((
char*)
"(" __PYX_BUILD_PY_SSIZE_T
")", ((Py_ssize_t)__pyx_v_cmesh->mesh.subdomainp->nEdges_global));
if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 63, __pyx_L1_error)
4784 __Pyx_GOTREF(__pyx_t_12);
4785 __pyx_t_7 = __pyx_array_new(__pyx_t_12,
sizeof(
int), PyBytes_AS_STRING(__pyx_t_14), (
char *)
"c", (
char *) __pyx_t_4);
4786 if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 63, __pyx_L1_error)
4787 __Pyx_GOTREF(__pyx_t_7);
4788 __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
4789 __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
4791 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_13))) {
4792 __pyx_t_14 = PyMethod_GET_SELF(__pyx_t_13);
4793 if (likely(__pyx_t_14)) {
4794 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_13);
4795 __Pyx_INCREF(__pyx_t_14);
4796 __Pyx_INCREF(
function);
4797 __Pyx_DECREF_SET(__pyx_t_13,
function);
4800 __pyx_t_10 = (__pyx_t_14) ? __Pyx_PyObject_Call2Args(__pyx_t_13, __pyx_t_14, ((PyObject *)__pyx_t_7)) : __Pyx_PyObject_CallOneArg(__pyx_t_13, ((PyObject *)__pyx_t_7));
4801 __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0;
4802 __Pyx_DECREF(((PyObject *)__pyx_t_7)); __pyx_t_7 = 0;
4803 if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 63, __pyx_L1_error)
4804 __Pyx_GOTREF(__pyx_t_10);
4805 __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
4814 __pyx_t_13 = PyTuple_New(8);
if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 56, __pyx_L1_error)
4815 __Pyx_GOTREF(__pyx_t_13);
4816 __Pyx_GIVEREF(__pyx_t_1);
4817 PyTuple_SET_ITEM(__pyx_t_13, 0, __pyx_t_1);
4818 __Pyx_GIVEREF(__pyx_t_3);
4819 PyTuple_SET_ITEM(__pyx_t_13, 1, __pyx_t_3);
4820 __Pyx_GIVEREF(__pyx_t_5);
4821 PyTuple_SET_ITEM(__pyx_t_13, 2, __pyx_t_5);
4822 __Pyx_GIVEREF(__pyx_t_2);
4823 PyTuple_SET_ITEM(__pyx_t_13, 3, __pyx_t_2);
4824 __Pyx_GIVEREF(__pyx_t_9);
4825 PyTuple_SET_ITEM(__pyx_t_13, 4, __pyx_t_9);
4826 __Pyx_GIVEREF(__pyx_t_8);
4827 PyTuple_SET_ITEM(__pyx_t_13, 5, __pyx_t_8);
4828 __Pyx_GIVEREF(__pyx_t_11);
4829 PyTuple_SET_ITEM(__pyx_t_13, 6, __pyx_t_11);
4830 __Pyx_GIVEREF(__pyx_t_10);
4831 PyTuple_SET_ITEM(__pyx_t_13, 7, __pyx_t_10);
4840 __pyx_r = __pyx_t_13;
4854 __Pyx_XDECREF(__pyx_t_1);
4855 __Pyx_XDECREF(__pyx_t_2);
4856 __Pyx_XDECREF(__pyx_t_3);
4857 __Pyx_XDECREF(__pyx_t_5);
4858 __Pyx_XDECREF(((PyObject *)__pyx_t_7));
4859 __Pyx_XDECREF(__pyx_t_8);
4860 __Pyx_XDECREF(__pyx_t_9);
4861 __Pyx_XDECREF(__pyx_t_10);
4862 __Pyx_XDECREF(__pyx_t_11);
4863 __Pyx_XDECREF(__pyx_t_12);
4864 __Pyx_XDECREF(__pyx_t_13);
4865 __Pyx_XDECREF(__pyx_t_14);
4866 __Pyx_AddTraceback(
"cpartitioning.convertPUMIPartitionToPython", __pyx_clineno, __pyx_lineno, __pyx_filename);
4869 __Pyx_XGIVEREF(__pyx_r);
4870 __Pyx_RefNannyFinishContext();
4883 static PyObject *__pyx_pw_13cpartitioning_7partitionNodesFromTetgenFiles(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
4884 static PyMethodDef __pyx_mdef_13cpartitioning_7partitionNodesFromTetgenFiles = {
"partitionNodesFromTetgenFiles", (PyCFunction)(
void*)(PyCFunctionWithKeywords)__pyx_pw_13cpartitioning_7partitionNodesFromTetgenFiles, METH_VARARGS|METH_KEYWORDS, 0};
4885 static PyObject *__pyx_pw_13cpartitioning_7partitionNodesFromTetgenFiles(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
4886 struct PyMPICommObject *__pyx_v_comm = 0;
4887 PyObject *__pyx_v_filebase = 0;
4888 int __pyx_v_indexBase;
4889 int __pyx_v_nLayersOfOverlap;
4890 struct __pyx_obj_7proteus_10cmeshTools_CMesh *__pyx_v_cmesh = 0;
4891 struct __pyx_obj_7proteus_10cmeshTools_CMesh *__pyx_v_subdomain_cmesh = 0;
4892 int __pyx_lineno = 0;
4893 const char *__pyx_filename = NULL;
4894 int __pyx_clineno = 0;
4895 PyObject *__pyx_r = 0;
4896 __Pyx_RefNannyDeclarations
4897 __Pyx_RefNannySetupContext(
"partitionNodesFromTetgenFiles (wrapper)", 0);
4899 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_comm,&__pyx_n_s_filebase,&__pyx_n_s_indexBase,&__pyx_n_s_nLayersOfOverlap,&__pyx_n_s_cmesh,&__pyx_n_s_subdomain_cmesh,0};
4900 PyObject* values[6] = {0,0,0,0,0,0};
4901 if (unlikely(__pyx_kwds)) {
4903 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
4905 case 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
4907 case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
4909 case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
4911 case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
4913 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
4915 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
4918 default:
goto __pyx_L5_argtuple_error;
4920 kw_args = PyDict_Size(__pyx_kwds);
4923 if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_comm)) != 0)) kw_args--;
4924 else goto __pyx_L5_argtuple_error;
4927 if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_filebase)) != 0)) kw_args--;
4929 __Pyx_RaiseArgtupleInvalid(
"partitionNodesFromTetgenFiles", 1, 6, 6, 1); __PYX_ERR(0, 66, __pyx_L3_error)
4933 if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_indexBase)) != 0)) kw_args--;
4935 __Pyx_RaiseArgtupleInvalid(
"partitionNodesFromTetgenFiles", 1, 6, 6, 2); __PYX_ERR(0, 66, __pyx_L3_error)
4939 if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_nLayersOfOverlap)) != 0)) kw_args--;
4941 __Pyx_RaiseArgtupleInvalid(
"partitionNodesFromTetgenFiles", 1, 6, 6, 3); __PYX_ERR(0, 66, __pyx_L3_error)
4945 if (likely((values[4] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_cmesh)) != 0)) kw_args--;
4947 __Pyx_RaiseArgtupleInvalid(
"partitionNodesFromTetgenFiles", 1, 6, 6, 4); __PYX_ERR(0, 66, __pyx_L3_error)
4951 if (likely((values[5] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_subdomain_cmesh)) != 0)) kw_args--;
4953 __Pyx_RaiseArgtupleInvalid(
"partitionNodesFromTetgenFiles", 1, 6, 6, 5); __PYX_ERR(0, 66, __pyx_L3_error)
4956 if (unlikely(kw_args > 0)) {
4957 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args,
"partitionNodesFromTetgenFiles") < 0)) __PYX_ERR(0, 66, __pyx_L3_error)
4959 }
else if (PyTuple_GET_SIZE(__pyx_args) != 6) {
4960 goto __pyx_L5_argtuple_error;
4962 values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
4963 values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
4964 values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
4965 values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
4966 values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
4967 values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
4969 __pyx_v_comm = ((
struct PyMPICommObject *)values[0]);
4970 __pyx_v_filebase = values[1];
4971 __pyx_v_indexBase = __Pyx_PyInt_As_int(values[2]);
if (unlikely((__pyx_v_indexBase == (
int)-1) && PyErr_Occurred())) __PYX_ERR(0, 66, __pyx_L3_error)
4972 __pyx_v_nLayersOfOverlap = __Pyx_PyInt_As_int(values[3]);
if (unlikely((__pyx_v_nLayersOfOverlap == (
int)-1) && PyErr_Occurred())) __PYX_ERR(0, 66, __pyx_L3_error)
4973 __pyx_v_cmesh = ((
struct __pyx_obj_7proteus_10cmeshTools_CMesh *)values[4]);
4974 __pyx_v_subdomain_cmesh = ((
struct __pyx_obj_7proteus_10cmeshTools_CMesh *)values[5]);
4976 goto __pyx_L4_argument_unpacking_done;
4977 __pyx_L5_argtuple_error:;
4978 __Pyx_RaiseArgtupleInvalid(
"partitionNodesFromTetgenFiles", 1, 6, 6, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 66, __pyx_L3_error)
4980 __Pyx_AddTraceback(
"cpartitioning.partitionNodesFromTetgenFiles", __pyx_clineno, __pyx_lineno, __pyx_filename);
4981 __Pyx_RefNannyFinishContext();
4983 __pyx_L4_argument_unpacking_done:;
4984 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_comm), __pyx_ptype_6mpi4py_3MPI_Comm, 1,
"comm", 0))) __PYX_ERR(0, 66, __pyx_L1_error)
4985 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_cmesh), __pyx_ptype_7proteus_10cmeshTools_CMesh, 1,
"cmesh", 0))) __PYX_ERR(0, 66, __pyx_L1_error)
4986 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_subdomain_cmesh), __pyx_ptype_7proteus_10cmeshTools_CMesh, 1,
"subdomain_cmesh", 0))) __PYX_ERR(0, 66, __pyx_L1_error)
4987 __pyx_r = __pyx_pf_13cpartitioning_6partitionNodesFromTetgenFiles(__pyx_self, __pyx_v_comm, __pyx_v_filebase, __pyx_v_indexBase, __pyx_v_nLayersOfOverlap, __pyx_v_cmesh, __pyx_v_subdomain_cmesh);
4994 __Pyx_RefNannyFinishContext();
4998 static PyObject *__pyx_pf_13cpartitioning_6partitionNodesFromTetgenFiles(CYTHON_UNUSED PyObject *__pyx_self,
struct PyMPICommObject *__pyx_v_comm, PyObject *__pyx_v_filebase,
int __pyx_v_indexBase,
int __pyx_v_nLayersOfOverlap,
struct __pyx_obj_7proteus_10cmeshTools_CMesh *__pyx_v_cmesh,
struct __pyx_obj_7proteus_10cmeshTools_CMesh *__pyx_v_subdomain_cmesh) {
4999 PyObject *__pyx_r = NULL;
5000 __Pyx_RefNannyDeclarations
5003 PyObject *__pyx_t_3 = NULL;
5004 PyObject *__pyx_t_4 = NULL;
5005 PyObject *__pyx_t_5 = NULL;
5008 PyObject *__pyx_t_8 = NULL;
5009 Py_ssize_t __pyx_t_9;
5010 struct __pyx_array_obj *__pyx_t_10 = NULL;
5011 PyObject *__pyx_t_11 = NULL;
5012 PyObject *__pyx_t_12 = NULL;
5013 PyObject *__pyx_t_13 = NULL;
5014 PyObject *__pyx_t_14 = NULL;
5015 PyObject *__pyx_t_15 = NULL;
5016 PyObject *__pyx_t_16 = NULL;
5017 PyObject *__pyx_t_17 = NULL;
5018 int __pyx_lineno = 0;
5019 const char *__pyx_filename = NULL;
5020 int __pyx_clineno = 0;
5021 __Pyx_RefNannySetupContext(
"partitionNodesFromTetgenFiles", 0);
5022 __Pyx_INCREF(__pyx_v_filebase);
5031 __pyx_v_cmesh->mesh.subdomainp = (&__pyx_v_subdomain_cmesh->mesh);
5040 __pyx_t_1 = PyBytes_Check(__pyx_v_filebase);
5041 __pyx_t_2 = ((!(__pyx_t_1 != 0)) != 0);
5051 __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_filebase, __pyx_n_s_encode);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 69, __pyx_L1_error)
5052 __Pyx_GOTREF(__pyx_t_4);
5054 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) {
5055 __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
5056 if (likely(__pyx_t_5)) {
5057 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_4);
5058 __Pyx_INCREF(__pyx_t_5);
5059 __Pyx_INCREF(
function);
5060 __Pyx_DECREF_SET(__pyx_t_4,
function);
5063 __pyx_t_3 = (__pyx_t_5) ? __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_5) : __Pyx_PyObject_CallNoArg(__pyx_t_4);
5064 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
5065 if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 69, __pyx_L1_error)
5066 __Pyx_GOTREF(__pyx_t_3);
5067 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
5068 __Pyx_DECREF_SET(__pyx_v_filebase, __pyx_t_3);
5087 __pyx_t_6 = __Pyx_PyObject_AsWritableString(__pyx_v_filebase);
if (unlikely((!__pyx_t_6) && PyErr_Occurred())) __PYX_ERR(0, 71, __pyx_L1_error)
5105 __Pyx_XDECREF(__pyx_r);
5114 __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_np);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 76, __pyx_L1_error)
5115 __Pyx_GOTREF(__pyx_t_4);
5116 __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_asarray);
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 76, __pyx_L1_error)
5117 __Pyx_GOTREF(__pyx_t_5);
5118 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
5119 __pyx_t_7 = __pyx_v_cmesh->mesh.elementOffsets_subdomain_owned;
5120 __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_comm), __pyx_n_s_size);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 76, __pyx_L1_error)
5121 __Pyx_GOTREF(__pyx_t_4);
5122 __pyx_t_8 = __Pyx_PyInt_AddObjC(__pyx_t_4, __pyx_int_1, 1, 0, 0);
if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 76, __pyx_L1_error)
5123 __Pyx_GOTREF(__pyx_t_8);
5124 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
5125 __pyx_t_9 = __Pyx_PyIndex_AsSsize_t(__pyx_t_8);
if (unlikely((__pyx_t_9 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 76, __pyx_L1_error)
5126 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
5128 PyErr_SetString(PyExc_ValueError,
"Cannot create cython.array from NULL pointer");
5129 __PYX_ERR(0, 76, __pyx_L1_error)
5131 __pyx_t_4 = __pyx_format_from_typeinfo(&__Pyx_TypeInfo_int);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 76, __pyx_L1_error)
5132 __Pyx_GOTREF(__pyx_t_4);
5133 __pyx_t_8 = Py_BuildValue((
char*)
"(" __PYX_BUILD_PY_SSIZE_T
")", ((Py_ssize_t)__pyx_t_9));
if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 76, __pyx_L1_error)
5134 __Pyx_GOTREF(__pyx_t_8);
5135 __pyx_t_10 = __pyx_array_new(__pyx_t_8,
sizeof(
int), PyBytes_AS_STRING(__pyx_t_4), (
char *)
"c", (
char *) __pyx_t_7);
5136 if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 76, __pyx_L1_error)
5137 __Pyx_GOTREF(__pyx_t_10);
5138 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
5139 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
5141 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_5))) {
5142 __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_5);
5143 if (likely(__pyx_t_4)) {
5144 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_5);
5145 __Pyx_INCREF(__pyx_t_4);
5146 __Pyx_INCREF(
function);
5147 __Pyx_DECREF_SET(__pyx_t_5,
function);
5150 __pyx_t_3 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_5, __pyx_t_4, ((PyObject *)__pyx_t_10)) : __Pyx_PyObject_CallOneArg(__pyx_t_5, ((PyObject *)__pyx_t_10));
5151 __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
5152 __Pyx_DECREF(((PyObject *)__pyx_t_10)); __pyx_t_10 = 0;
5153 if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 76, __pyx_L1_error)
5154 __Pyx_GOTREF(__pyx_t_3);
5155 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
5164 __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_np);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 77, __pyx_L1_error)
5165 __Pyx_GOTREF(__pyx_t_4);
5166 __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_asarray);
if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 77, __pyx_L1_error)
5167 __Pyx_GOTREF(__pyx_t_8);
5168 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
5169 __pyx_t_7 = __pyx_v_cmesh->mesh.elementNumbering_subdomain2global;
5171 PyErr_SetString(PyExc_ValueError,
"Cannot create cython.array from NULL pointer");
5172 __PYX_ERR(0, 77, __pyx_L1_error)
5174 __pyx_t_11 = __pyx_format_from_typeinfo(&__Pyx_TypeInfo_int);
if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 77, __pyx_L1_error)
5175 __Pyx_GOTREF(__pyx_t_11);
5176 __pyx_t_4 = Py_BuildValue((
char*)
"(" __PYX_BUILD_PY_SSIZE_T
")", ((Py_ssize_t)__pyx_v_cmesh->mesh.subdomainp->nElements_global));
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 77, __pyx_L1_error)
5177 __Pyx_GOTREF(__pyx_t_4);
5178 __pyx_t_10 = __pyx_array_new(__pyx_t_4,
sizeof(
int), PyBytes_AS_STRING(__pyx_t_11), (
char *)
"c", (
char *) __pyx_t_7);
5179 if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 77, __pyx_L1_error)
5180 __Pyx_GOTREF(__pyx_t_10);
5181 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
5182 __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
5184 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_8))) {
5185 __pyx_t_11 = PyMethod_GET_SELF(__pyx_t_8);
5186 if (likely(__pyx_t_11)) {
5187 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_8);
5188 __Pyx_INCREF(__pyx_t_11);
5189 __Pyx_INCREF(
function);
5190 __Pyx_DECREF_SET(__pyx_t_8,
function);
5193 __pyx_t_5 = (__pyx_t_11) ? __Pyx_PyObject_Call2Args(__pyx_t_8, __pyx_t_11, ((PyObject *)__pyx_t_10)) : __Pyx_PyObject_CallOneArg(__pyx_t_8, ((PyObject *)__pyx_t_10));
5194 __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
5195 __Pyx_DECREF(((PyObject *)__pyx_t_10)); __pyx_t_10 = 0;
5196 if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 77, __pyx_L1_error)
5197 __Pyx_GOTREF(__pyx_t_5);
5198 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
5207 __Pyx_GetModuleGlobalName(__pyx_t_11, __pyx_n_s_np);
if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 78, __pyx_L1_error)
5208 __Pyx_GOTREF(__pyx_t_11);
5209 __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_11, __pyx_n_s_asarray);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 78, __pyx_L1_error)
5210 __Pyx_GOTREF(__pyx_t_4);
5211 __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
5212 __pyx_t_7 = __pyx_v_cmesh->mesh.nodeOffsets_subdomain_owned;
5213 __pyx_t_11 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_comm), __pyx_n_s_size);
if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 78, __pyx_L1_error)
5214 __Pyx_GOTREF(__pyx_t_11);
5215 __pyx_t_12 = __Pyx_PyInt_AddObjC(__pyx_t_11, __pyx_int_1, 1, 0, 0);
if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 78, __pyx_L1_error)
5216 __Pyx_GOTREF(__pyx_t_12);
5217 __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
5218 __pyx_t_9 = __Pyx_PyIndex_AsSsize_t(__pyx_t_12);
if (unlikely((__pyx_t_9 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 78, __pyx_L1_error)
5219 __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
5221 PyErr_SetString(PyExc_ValueError,
"Cannot create cython.array from NULL pointer");
5222 __PYX_ERR(0, 78, __pyx_L1_error)
5224 __pyx_t_11 = __pyx_format_from_typeinfo(&__Pyx_TypeInfo_int);
if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 78, __pyx_L1_error)
5225 __Pyx_GOTREF(__pyx_t_11);
5226 __pyx_t_12 = Py_BuildValue((
char*)
"(" __PYX_BUILD_PY_SSIZE_T
")", ((Py_ssize_t)__pyx_t_9));
if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 78, __pyx_L1_error)
5227 __Pyx_GOTREF(__pyx_t_12);
5228 __pyx_t_10 = __pyx_array_new(__pyx_t_12,
sizeof(
int), PyBytes_AS_STRING(__pyx_t_11), (
char *)
"c", (
char *) __pyx_t_7);
5229 if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 78, __pyx_L1_error)
5230 __Pyx_GOTREF(__pyx_t_10);
5231 __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
5232 __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
5234 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
5235 __pyx_t_11 = PyMethod_GET_SELF(__pyx_t_4);
5236 if (likely(__pyx_t_11)) {
5237 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_4);
5238 __Pyx_INCREF(__pyx_t_11);
5239 __Pyx_INCREF(
function);
5240 __Pyx_DECREF_SET(__pyx_t_4,
function);
5243 __pyx_t_8 = (__pyx_t_11) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_11, ((PyObject *)__pyx_t_10)) : __Pyx_PyObject_CallOneArg(__pyx_t_4, ((PyObject *)__pyx_t_10));
5244 __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
5245 __Pyx_DECREF(((PyObject *)__pyx_t_10)); __pyx_t_10 = 0;
5246 if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 78, __pyx_L1_error)
5247 __Pyx_GOTREF(__pyx_t_8);
5248 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
5257 __Pyx_GetModuleGlobalName(__pyx_t_11, __pyx_n_s_np);
if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 79, __pyx_L1_error)
5258 __Pyx_GOTREF(__pyx_t_11);
5259 __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_t_11, __pyx_n_s_asarray);
if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 79, __pyx_L1_error)
5260 __Pyx_GOTREF(__pyx_t_12);
5261 __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
5262 __pyx_t_7 = __pyx_v_cmesh->mesh.nodeNumbering_subdomain2global;
5264 PyErr_SetString(PyExc_ValueError,
"Cannot create cython.array from NULL pointer");
5265 __PYX_ERR(0, 79, __pyx_L1_error)
5267 __pyx_t_13 = __pyx_format_from_typeinfo(&__Pyx_TypeInfo_int);
if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 79, __pyx_L1_error)
5268 __Pyx_GOTREF(__pyx_t_13);
5269 __pyx_t_11 = Py_BuildValue((
char*)
"(" __PYX_BUILD_PY_SSIZE_T
")", ((Py_ssize_t)__pyx_v_cmesh->mesh.subdomainp->nNodes_global));
if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 79, __pyx_L1_error)
5270 __Pyx_GOTREF(__pyx_t_11);
5271 __pyx_t_10 = __pyx_array_new(__pyx_t_11,
sizeof(
int), PyBytes_AS_STRING(__pyx_t_13), (
char *)
"c", (
char *) __pyx_t_7);
5272 if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 79, __pyx_L1_error)
5273 __Pyx_GOTREF(__pyx_t_10);
5274 __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
5275 __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
5277 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_12))) {
5278 __pyx_t_13 = PyMethod_GET_SELF(__pyx_t_12);
5279 if (likely(__pyx_t_13)) {
5280 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_12);
5281 __Pyx_INCREF(__pyx_t_13);
5282 __Pyx_INCREF(
function);
5283 __Pyx_DECREF_SET(__pyx_t_12,
function);
5286 __pyx_t_4 = (__pyx_t_13) ? __Pyx_PyObject_Call2Args(__pyx_t_12, __pyx_t_13, ((PyObject *)__pyx_t_10)) : __Pyx_PyObject_CallOneArg(__pyx_t_12, ((PyObject *)__pyx_t_10));
5287 __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
5288 __Pyx_DECREF(((PyObject *)__pyx_t_10)); __pyx_t_10 = 0;
5289 if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 79, __pyx_L1_error)
5290 __Pyx_GOTREF(__pyx_t_4);
5291 __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
5300 __Pyx_GetModuleGlobalName(__pyx_t_13, __pyx_n_s_np);
if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 80, __pyx_L1_error)
5301 __Pyx_GOTREF(__pyx_t_13);
5302 __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_t_13, __pyx_n_s_asarray);
if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 80, __pyx_L1_error)
5303 __Pyx_GOTREF(__pyx_t_11);
5304 __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
5305 __pyx_t_7 = __pyx_v_cmesh->mesh.elementBoundaryOffsets_subdomain_owned;
5306 __pyx_t_13 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_comm), __pyx_n_s_size);
if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 80, __pyx_L1_error)
5307 __Pyx_GOTREF(__pyx_t_13);
5308 __pyx_t_14 = __Pyx_PyInt_AddObjC(__pyx_t_13, __pyx_int_1, 1, 0, 0);
if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 80, __pyx_L1_error)
5309 __Pyx_GOTREF(__pyx_t_14);
5310 __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
5311 __pyx_t_9 = __Pyx_PyIndex_AsSsize_t(__pyx_t_14);
if (unlikely((__pyx_t_9 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 80, __pyx_L1_error)
5312 __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
5314 PyErr_SetString(PyExc_ValueError,
"Cannot create cython.array from NULL pointer");
5315 __PYX_ERR(0, 80, __pyx_L1_error)
5317 __pyx_t_13 = __pyx_format_from_typeinfo(&__Pyx_TypeInfo_int);
if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 80, __pyx_L1_error)
5318 __Pyx_GOTREF(__pyx_t_13);
5319 __pyx_t_14 = Py_BuildValue((
char*)
"(" __PYX_BUILD_PY_SSIZE_T
")", ((Py_ssize_t)__pyx_t_9));
if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 80, __pyx_L1_error)
5320 __Pyx_GOTREF(__pyx_t_14);
5321 __pyx_t_10 = __pyx_array_new(__pyx_t_14,
sizeof(
int), PyBytes_AS_STRING(__pyx_t_13), (
char *)
"c", (
char *) __pyx_t_7);
5322 if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 80, __pyx_L1_error)
5323 __Pyx_GOTREF(__pyx_t_10);
5324 __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
5325 __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
5327 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_11))) {
5328 __pyx_t_13 = PyMethod_GET_SELF(__pyx_t_11);
5329 if (likely(__pyx_t_13)) {
5330 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_11);
5331 __Pyx_INCREF(__pyx_t_13);
5332 __Pyx_INCREF(
function);
5333 __Pyx_DECREF_SET(__pyx_t_11,
function);
5336 __pyx_t_12 = (__pyx_t_13) ? __Pyx_PyObject_Call2Args(__pyx_t_11, __pyx_t_13, ((PyObject *)__pyx_t_10)) : __Pyx_PyObject_CallOneArg(__pyx_t_11, ((PyObject *)__pyx_t_10));
5337 __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
5338 __Pyx_DECREF(((PyObject *)__pyx_t_10)); __pyx_t_10 = 0;
5339 if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 80, __pyx_L1_error)
5340 __Pyx_GOTREF(__pyx_t_12);
5341 __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
5350 __Pyx_GetModuleGlobalName(__pyx_t_13, __pyx_n_s_np);
if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 81, __pyx_L1_error)
5351 __Pyx_GOTREF(__pyx_t_13);
5352 __pyx_t_14 = __Pyx_PyObject_GetAttrStr(__pyx_t_13, __pyx_n_s_asarray);
if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 81, __pyx_L1_error)
5353 __Pyx_GOTREF(__pyx_t_14);
5354 __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
5355 __pyx_t_7 = __pyx_v_cmesh->mesh.elementBoundaryNumbering_subdomain2global;
5357 PyErr_SetString(PyExc_ValueError,
"Cannot create cython.array from NULL pointer");
5358 __PYX_ERR(0, 81, __pyx_L1_error)
5360 __pyx_t_15 = __pyx_format_from_typeinfo(&__Pyx_TypeInfo_int);
if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 81, __pyx_L1_error)
5361 __Pyx_GOTREF(__pyx_t_15);
5362 __pyx_t_13 = Py_BuildValue((
char*)
"(" __PYX_BUILD_PY_SSIZE_T
")", ((Py_ssize_t)__pyx_v_cmesh->mesh.subdomainp->nElementBoundaries_global));
if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 81, __pyx_L1_error)
5363 __Pyx_GOTREF(__pyx_t_13);
5364 __pyx_t_10 = __pyx_array_new(__pyx_t_13,
sizeof(
int), PyBytes_AS_STRING(__pyx_t_15), (
char *)
"c", (
char *) __pyx_t_7);
5365 if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 81, __pyx_L1_error)
5366 __Pyx_GOTREF(__pyx_t_10);
5367 __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
5368 __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
5370 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_14))) {
5371 __pyx_t_15 = PyMethod_GET_SELF(__pyx_t_14);
5372 if (likely(__pyx_t_15)) {
5373 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_14);
5374 __Pyx_INCREF(__pyx_t_15);
5375 __Pyx_INCREF(
function);
5376 __Pyx_DECREF_SET(__pyx_t_14,
function);
5379 __pyx_t_11 = (__pyx_t_15) ? __Pyx_PyObject_Call2Args(__pyx_t_14, __pyx_t_15, ((PyObject *)__pyx_t_10)) : __Pyx_PyObject_CallOneArg(__pyx_t_14, ((PyObject *)__pyx_t_10));
5380 __Pyx_XDECREF(__pyx_t_15); __pyx_t_15 = 0;
5381 __Pyx_DECREF(((PyObject *)__pyx_t_10)); __pyx_t_10 = 0;
5382 if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 81, __pyx_L1_error)
5383 __Pyx_GOTREF(__pyx_t_11);
5384 __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
5393 __Pyx_GetModuleGlobalName(__pyx_t_15, __pyx_n_s_np);
if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 82, __pyx_L1_error)
5394 __Pyx_GOTREF(__pyx_t_15);
5395 __pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_t_15, __pyx_n_s_asarray);
if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 82, __pyx_L1_error)
5396 __Pyx_GOTREF(__pyx_t_13);
5397 __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
5398 __pyx_t_7 = __pyx_v_cmesh->mesh.edgeOffsets_subdomain_owned;
5399 __pyx_t_15 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_comm), __pyx_n_s_size);
if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 82, __pyx_L1_error)
5400 __Pyx_GOTREF(__pyx_t_15);
5401 __pyx_t_16 = __Pyx_PyInt_AddObjC(__pyx_t_15, __pyx_int_1, 1, 0, 0);
if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 82, __pyx_L1_error)
5402 __Pyx_GOTREF(__pyx_t_16);
5403 __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
5404 __pyx_t_9 = __Pyx_PyIndex_AsSsize_t(__pyx_t_16);
if (unlikely((__pyx_t_9 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 82, __pyx_L1_error)
5405 __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
5407 PyErr_SetString(PyExc_ValueError,
"Cannot create cython.array from NULL pointer");
5408 __PYX_ERR(0, 82, __pyx_L1_error)
5410 __pyx_t_15 = __pyx_format_from_typeinfo(&__Pyx_TypeInfo_int);
if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 82, __pyx_L1_error)
5411 __Pyx_GOTREF(__pyx_t_15);
5412 __pyx_t_16 = Py_BuildValue((
char*)
"(" __PYX_BUILD_PY_SSIZE_T
")", ((Py_ssize_t)__pyx_t_9));
if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 82, __pyx_L1_error)
5413 __Pyx_GOTREF(__pyx_t_16);
5414 __pyx_t_10 = __pyx_array_new(__pyx_t_16,
sizeof(
int), PyBytes_AS_STRING(__pyx_t_15), (
char *)
"c", (
char *) __pyx_t_7);
5415 if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 82, __pyx_L1_error)
5416 __Pyx_GOTREF(__pyx_t_10);
5417 __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
5418 __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
5420 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_13))) {
5421 __pyx_t_15 = PyMethod_GET_SELF(__pyx_t_13);
5422 if (likely(__pyx_t_15)) {
5423 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_13);
5424 __Pyx_INCREF(__pyx_t_15);
5425 __Pyx_INCREF(
function);
5426 __Pyx_DECREF_SET(__pyx_t_13,
function);
5429 __pyx_t_14 = (__pyx_t_15) ? __Pyx_PyObject_Call2Args(__pyx_t_13, __pyx_t_15, ((PyObject *)__pyx_t_10)) : __Pyx_PyObject_CallOneArg(__pyx_t_13, ((PyObject *)__pyx_t_10));
5430 __Pyx_XDECREF(__pyx_t_15); __pyx_t_15 = 0;
5431 __Pyx_DECREF(((PyObject *)__pyx_t_10)); __pyx_t_10 = 0;
5432 if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 82, __pyx_L1_error)
5433 __Pyx_GOTREF(__pyx_t_14);
5434 __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
5443 __Pyx_GetModuleGlobalName(__pyx_t_15, __pyx_n_s_np);
if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 83, __pyx_L1_error)
5444 __Pyx_GOTREF(__pyx_t_15);
5445 __pyx_t_16 = __Pyx_PyObject_GetAttrStr(__pyx_t_15, __pyx_n_s_asarray);
if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 83, __pyx_L1_error)
5446 __Pyx_GOTREF(__pyx_t_16);
5447 __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
5448 __pyx_t_7 = __pyx_v_cmesh->mesh.edgeNumbering_subdomain2global;
5450 PyErr_SetString(PyExc_ValueError,
"Cannot create cython.array from NULL pointer");
5451 __PYX_ERR(0, 83, __pyx_L1_error)
5453 __pyx_t_17 = __pyx_format_from_typeinfo(&__Pyx_TypeInfo_int);
if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 83, __pyx_L1_error)
5454 __Pyx_GOTREF(__pyx_t_17);
5455 __pyx_t_15 = Py_BuildValue((
char*)
"(" __PYX_BUILD_PY_SSIZE_T
")", ((Py_ssize_t)__pyx_v_cmesh->mesh.subdomainp->nEdges_global));
if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 83, __pyx_L1_error)
5456 __Pyx_GOTREF(__pyx_t_15);
5457 __pyx_t_10 = __pyx_array_new(__pyx_t_15,
sizeof(
int), PyBytes_AS_STRING(__pyx_t_17), (
char *)
"c", (
char *) __pyx_t_7);
5458 if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 83, __pyx_L1_error)
5459 __Pyx_GOTREF(__pyx_t_10);
5460 __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
5461 __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
5463 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_16))) {
5464 __pyx_t_17 = PyMethod_GET_SELF(__pyx_t_16);
5465 if (likely(__pyx_t_17)) {
5466 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_16);
5467 __Pyx_INCREF(__pyx_t_17);
5468 __Pyx_INCREF(
function);
5469 __Pyx_DECREF_SET(__pyx_t_16,
function);
5472 __pyx_t_13 = (__pyx_t_17) ? __Pyx_PyObject_Call2Args(__pyx_t_16, __pyx_t_17, ((PyObject *)__pyx_t_10)) : __Pyx_PyObject_CallOneArg(__pyx_t_16, ((PyObject *)__pyx_t_10));
5473 __Pyx_XDECREF(__pyx_t_17); __pyx_t_17 = 0;
5474 __Pyx_DECREF(((PyObject *)__pyx_t_10)); __pyx_t_10 = 0;
5475 if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 83, __pyx_L1_error)
5476 __Pyx_GOTREF(__pyx_t_13);
5477 __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
5486 __pyx_t_16 = PyTuple_New(8);
if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 76, __pyx_L1_error)
5487 __Pyx_GOTREF(__pyx_t_16);
5488 __Pyx_GIVEREF(__pyx_t_3);
5489 PyTuple_SET_ITEM(__pyx_t_16, 0, __pyx_t_3);
5490 __Pyx_GIVEREF(__pyx_t_5);
5491 PyTuple_SET_ITEM(__pyx_t_16, 1, __pyx_t_5);
5492 __Pyx_GIVEREF(__pyx_t_8);
5493 PyTuple_SET_ITEM(__pyx_t_16, 2, __pyx_t_8);
5494 __Pyx_GIVEREF(__pyx_t_4);
5495 PyTuple_SET_ITEM(__pyx_t_16, 3, __pyx_t_4);
5496 __Pyx_GIVEREF(__pyx_t_12);
5497 PyTuple_SET_ITEM(__pyx_t_16, 4, __pyx_t_12);
5498 __Pyx_GIVEREF(__pyx_t_11);
5499 PyTuple_SET_ITEM(__pyx_t_16, 5, __pyx_t_11);
5500 __Pyx_GIVEREF(__pyx_t_14);
5501 PyTuple_SET_ITEM(__pyx_t_16, 6, __pyx_t_14);
5502 __Pyx_GIVEREF(__pyx_t_13);
5503 PyTuple_SET_ITEM(__pyx_t_16, 7, __pyx_t_13);
5512 __pyx_r = __pyx_t_16;
5526 __Pyx_XDECREF(__pyx_t_3);
5527 __Pyx_XDECREF(__pyx_t_4);
5528 __Pyx_XDECREF(__pyx_t_5);
5529 __Pyx_XDECREF(__pyx_t_8);
5530 __Pyx_XDECREF(((PyObject *)__pyx_t_10));
5531 __Pyx_XDECREF(__pyx_t_11);
5532 __Pyx_XDECREF(__pyx_t_12);
5533 __Pyx_XDECREF(__pyx_t_13);
5534 __Pyx_XDECREF(__pyx_t_14);
5535 __Pyx_XDECREF(__pyx_t_15);
5536 __Pyx_XDECREF(__pyx_t_16);
5537 __Pyx_XDECREF(__pyx_t_17);
5538 __Pyx_AddTraceback(
"cpartitioning.partitionNodesFromTetgenFiles", __pyx_clineno, __pyx_lineno, __pyx_filename);
5541 __Pyx_XDECREF(__pyx_v_filebase);
5542 __Pyx_XGIVEREF(__pyx_r);
5543 __Pyx_RefNannyFinishContext();
5556 static PyObject *__pyx_pw_13cpartitioning_9partitionNodesFromTriangleFiles(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
5557 static PyMethodDef __pyx_mdef_13cpartitioning_9partitionNodesFromTriangleFiles = {
"partitionNodesFromTriangleFiles", (PyCFunction)(
void*)(PyCFunctionWithKeywords)__pyx_pw_13cpartitioning_9partitionNodesFromTriangleFiles, METH_VARARGS|METH_KEYWORDS, 0};
5558 static PyObject *__pyx_pw_13cpartitioning_9partitionNodesFromTriangleFiles(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
5559 struct PyMPICommObject *__pyx_v_comm = 0;
5560 PyObject *__pyx_v_filebase = 0;
5561 int __pyx_v_indexBase;
5562 int __pyx_v_nLayersOfOverlap;
5563 struct __pyx_obj_7proteus_10cmeshTools_CMesh *__pyx_v_cmesh = 0;
5564 struct __pyx_obj_7proteus_10cmeshTools_CMesh *__pyx_v_subdomain_cmesh = 0;
5565 int __pyx_lineno = 0;
5566 const char *__pyx_filename = NULL;
5567 int __pyx_clineno = 0;
5568 PyObject *__pyx_r = 0;
5569 __Pyx_RefNannyDeclarations
5570 __Pyx_RefNannySetupContext(
"partitionNodesFromTriangleFiles (wrapper)", 0);
5572 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_comm,&__pyx_n_s_filebase,&__pyx_n_s_indexBase,&__pyx_n_s_nLayersOfOverlap,&__pyx_n_s_cmesh,&__pyx_n_s_subdomain_cmesh,0};
5573 PyObject* values[6] = {0,0,0,0,0,0};
5574 if (unlikely(__pyx_kwds)) {
5576 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
5578 case 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
5580 case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
5582 case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
5584 case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
5586 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
5588 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
5591 default:
goto __pyx_L5_argtuple_error;
5593 kw_args = PyDict_Size(__pyx_kwds);
5596 if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_comm)) != 0)) kw_args--;
5597 else goto __pyx_L5_argtuple_error;
5600 if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_filebase)) != 0)) kw_args--;
5602 __Pyx_RaiseArgtupleInvalid(
"partitionNodesFromTriangleFiles", 1, 6, 6, 1); __PYX_ERR(0, 86, __pyx_L3_error)
5606 if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_indexBase)) != 0)) kw_args--;
5608 __Pyx_RaiseArgtupleInvalid(
"partitionNodesFromTriangleFiles", 1, 6, 6, 2); __PYX_ERR(0, 86, __pyx_L3_error)
5612 if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_nLayersOfOverlap)) != 0)) kw_args--;
5614 __Pyx_RaiseArgtupleInvalid(
"partitionNodesFromTriangleFiles", 1, 6, 6, 3); __PYX_ERR(0, 86, __pyx_L3_error)
5618 if (likely((values[4] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_cmesh)) != 0)) kw_args--;
5620 __Pyx_RaiseArgtupleInvalid(
"partitionNodesFromTriangleFiles", 1, 6, 6, 4); __PYX_ERR(0, 86, __pyx_L3_error)
5624 if (likely((values[5] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_subdomain_cmesh)) != 0)) kw_args--;
5626 __Pyx_RaiseArgtupleInvalid(
"partitionNodesFromTriangleFiles", 1, 6, 6, 5); __PYX_ERR(0, 86, __pyx_L3_error)
5629 if (unlikely(kw_args > 0)) {
5630 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args,
"partitionNodesFromTriangleFiles") < 0)) __PYX_ERR(0, 86, __pyx_L3_error)
5632 }
else if (PyTuple_GET_SIZE(__pyx_args) != 6) {
5633 goto __pyx_L5_argtuple_error;
5635 values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
5636 values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
5637 values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
5638 values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
5639 values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
5640 values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
5642 __pyx_v_comm = ((
struct PyMPICommObject *)values[0]);
5643 __pyx_v_filebase = values[1];
5644 __pyx_v_indexBase = __Pyx_PyInt_As_int(values[2]);
if (unlikely((__pyx_v_indexBase == (
int)-1) && PyErr_Occurred())) __PYX_ERR(0, 86, __pyx_L3_error)
5645 __pyx_v_nLayersOfOverlap = __Pyx_PyInt_As_int(values[3]);
if (unlikely((__pyx_v_nLayersOfOverlap == (
int)-1) && PyErr_Occurred())) __PYX_ERR(0, 86, __pyx_L3_error)
5646 __pyx_v_cmesh = ((
struct __pyx_obj_7proteus_10cmeshTools_CMesh *)values[4]);
5647 __pyx_v_subdomain_cmesh = ((
struct __pyx_obj_7proteus_10cmeshTools_CMesh *)values[5]);
5649 goto __pyx_L4_argument_unpacking_done;
5650 __pyx_L5_argtuple_error:;
5651 __Pyx_RaiseArgtupleInvalid(
"partitionNodesFromTriangleFiles", 1, 6, 6, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 86, __pyx_L3_error)
5653 __Pyx_AddTraceback(
"cpartitioning.partitionNodesFromTriangleFiles", __pyx_clineno, __pyx_lineno, __pyx_filename);
5654 __Pyx_RefNannyFinishContext();
5656 __pyx_L4_argument_unpacking_done:;
5657 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_comm), __pyx_ptype_6mpi4py_3MPI_Comm, 1,
"comm", 0))) __PYX_ERR(0, 86, __pyx_L1_error)
5658 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_cmesh), __pyx_ptype_7proteus_10cmeshTools_CMesh, 1,
"cmesh", 0))) __PYX_ERR(0, 86, __pyx_L1_error)
5659 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_subdomain_cmesh), __pyx_ptype_7proteus_10cmeshTools_CMesh, 1,
"subdomain_cmesh", 0))) __PYX_ERR(0, 86, __pyx_L1_error)
5660 __pyx_r = __pyx_pf_13cpartitioning_8partitionNodesFromTriangleFiles(__pyx_self, __pyx_v_comm, __pyx_v_filebase, __pyx_v_indexBase, __pyx_v_nLayersOfOverlap, __pyx_v_cmesh, __pyx_v_subdomain_cmesh);
5667 __Pyx_RefNannyFinishContext();
5671 static PyObject *__pyx_pf_13cpartitioning_8partitionNodesFromTriangleFiles(CYTHON_UNUSED PyObject *__pyx_self,
struct PyMPICommObject *__pyx_v_comm, PyObject *__pyx_v_filebase,
int __pyx_v_indexBase,
int __pyx_v_nLayersOfOverlap,
struct __pyx_obj_7proteus_10cmeshTools_CMesh *__pyx_v_cmesh,
struct __pyx_obj_7proteus_10cmeshTools_CMesh *__pyx_v_subdomain_cmesh) {
5672 PyObject *__pyx_r = NULL;
5673 __Pyx_RefNannyDeclarations
5676 PyObject *__pyx_t_3 = NULL;
5677 PyObject *__pyx_t_4 = NULL;
5678 PyObject *__pyx_t_5 = NULL;
5681 PyObject *__pyx_t_8 = NULL;
5682 Py_ssize_t __pyx_t_9;
5683 struct __pyx_array_obj *__pyx_t_10 = NULL;
5684 PyObject *__pyx_t_11 = NULL;
5685 PyObject *__pyx_t_12 = NULL;
5686 PyObject *__pyx_t_13 = NULL;
5687 PyObject *__pyx_t_14 = NULL;
5688 PyObject *__pyx_t_15 = NULL;
5689 PyObject *__pyx_t_16 = NULL;
5690 PyObject *__pyx_t_17 = NULL;
5691 int __pyx_lineno = 0;
5692 const char *__pyx_filename = NULL;
5693 int __pyx_clineno = 0;
5694 __Pyx_RefNannySetupContext(
"partitionNodesFromTriangleFiles", 0);
5695 __Pyx_INCREF(__pyx_v_filebase);
5704 __pyx_v_cmesh->mesh.subdomainp = (&__pyx_v_subdomain_cmesh->mesh);
5713 __pyx_t_1 = PyBytes_Check(__pyx_v_filebase);
5714 __pyx_t_2 = ((!(__pyx_t_1 != 0)) != 0);
5724 __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_filebase, __pyx_n_s_encode);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 89, __pyx_L1_error)
5725 __Pyx_GOTREF(__pyx_t_4);
5727 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) {
5728 __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
5729 if (likely(__pyx_t_5)) {
5730 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_4);
5731 __Pyx_INCREF(__pyx_t_5);
5732 __Pyx_INCREF(
function);
5733 __Pyx_DECREF_SET(__pyx_t_4,
function);
5736 __pyx_t_3 = (__pyx_t_5) ? __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_5) : __Pyx_PyObject_CallNoArg(__pyx_t_4);
5737 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
5738 if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 89, __pyx_L1_error)
5739 __Pyx_GOTREF(__pyx_t_3);
5740 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
5741 __Pyx_DECREF_SET(__pyx_v_filebase, __pyx_t_3);
5760 __pyx_t_6 = __Pyx_PyObject_AsWritableString(__pyx_v_filebase);
if (unlikely((!__pyx_t_6) && PyErr_Occurred())) __PYX_ERR(0, 91, __pyx_L1_error)
5778 __Pyx_XDECREF(__pyx_r);
5787 __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_np);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 96, __pyx_L1_error)
5788 __Pyx_GOTREF(__pyx_t_4);
5789 __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_asarray);
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 96, __pyx_L1_error)
5790 __Pyx_GOTREF(__pyx_t_5);
5791 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
5792 __pyx_t_7 = __pyx_v_cmesh->mesh.elementOffsets_subdomain_owned;
5793 __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_comm), __pyx_n_s_size);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 96, __pyx_L1_error)
5794 __Pyx_GOTREF(__pyx_t_4);
5795 __pyx_t_8 = __Pyx_PyInt_AddObjC(__pyx_t_4, __pyx_int_1, 1, 0, 0);
if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 96, __pyx_L1_error)
5796 __Pyx_GOTREF(__pyx_t_8);
5797 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
5798 __pyx_t_9 = __Pyx_PyIndex_AsSsize_t(__pyx_t_8);
if (unlikely((__pyx_t_9 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 96, __pyx_L1_error)
5799 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
5801 PyErr_SetString(PyExc_ValueError,
"Cannot create cython.array from NULL pointer");
5802 __PYX_ERR(0, 96, __pyx_L1_error)
5804 __pyx_t_4 = __pyx_format_from_typeinfo(&__Pyx_TypeInfo_int);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 96, __pyx_L1_error)
5805 __Pyx_GOTREF(__pyx_t_4);
5806 __pyx_t_8 = Py_BuildValue((
char*)
"(" __PYX_BUILD_PY_SSIZE_T
")", ((Py_ssize_t)__pyx_t_9));
if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 96, __pyx_L1_error)
5807 __Pyx_GOTREF(__pyx_t_8);
5808 __pyx_t_10 = __pyx_array_new(__pyx_t_8,
sizeof(
int), PyBytes_AS_STRING(__pyx_t_4), (
char *)
"c", (
char *) __pyx_t_7);
5809 if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 96, __pyx_L1_error)
5810 __Pyx_GOTREF(__pyx_t_10);
5811 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
5812 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
5814 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_5))) {
5815 __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_5);
5816 if (likely(__pyx_t_4)) {
5817 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_5);
5818 __Pyx_INCREF(__pyx_t_4);
5819 __Pyx_INCREF(
function);
5820 __Pyx_DECREF_SET(__pyx_t_5,
function);
5823 __pyx_t_3 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_5, __pyx_t_4, ((PyObject *)__pyx_t_10)) : __Pyx_PyObject_CallOneArg(__pyx_t_5, ((PyObject *)__pyx_t_10));
5824 __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
5825 __Pyx_DECREF(((PyObject *)__pyx_t_10)); __pyx_t_10 = 0;
5826 if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 96, __pyx_L1_error)
5827 __Pyx_GOTREF(__pyx_t_3);
5828 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
5837 __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_np);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 97, __pyx_L1_error)
5838 __Pyx_GOTREF(__pyx_t_4);
5839 __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_asarray);
if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 97, __pyx_L1_error)
5840 __Pyx_GOTREF(__pyx_t_8);
5841 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
5842 __pyx_t_7 = __pyx_v_cmesh->mesh.elementNumbering_subdomain2global;
5844 PyErr_SetString(PyExc_ValueError,
"Cannot create cython.array from NULL pointer");
5845 __PYX_ERR(0, 97, __pyx_L1_error)
5847 __pyx_t_11 = __pyx_format_from_typeinfo(&__Pyx_TypeInfo_int);
if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 97, __pyx_L1_error)
5848 __Pyx_GOTREF(__pyx_t_11);
5849 __pyx_t_4 = Py_BuildValue((
char*)
"(" __PYX_BUILD_PY_SSIZE_T
")", ((Py_ssize_t)__pyx_v_cmesh->mesh.subdomainp->nElements_global));
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 97, __pyx_L1_error)
5850 __Pyx_GOTREF(__pyx_t_4);
5851 __pyx_t_10 = __pyx_array_new(__pyx_t_4,
sizeof(
int), PyBytes_AS_STRING(__pyx_t_11), (
char *)
"c", (
char *) __pyx_t_7);
5852 if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 97, __pyx_L1_error)
5853 __Pyx_GOTREF(__pyx_t_10);
5854 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
5855 __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
5857 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_8))) {
5858 __pyx_t_11 = PyMethod_GET_SELF(__pyx_t_8);
5859 if (likely(__pyx_t_11)) {
5860 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_8);
5861 __Pyx_INCREF(__pyx_t_11);
5862 __Pyx_INCREF(
function);
5863 __Pyx_DECREF_SET(__pyx_t_8,
function);
5866 __pyx_t_5 = (__pyx_t_11) ? __Pyx_PyObject_Call2Args(__pyx_t_8, __pyx_t_11, ((PyObject *)__pyx_t_10)) : __Pyx_PyObject_CallOneArg(__pyx_t_8, ((PyObject *)__pyx_t_10));
5867 __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
5868 __Pyx_DECREF(((PyObject *)__pyx_t_10)); __pyx_t_10 = 0;
5869 if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 97, __pyx_L1_error)
5870 __Pyx_GOTREF(__pyx_t_5);
5871 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
5880 __Pyx_GetModuleGlobalName(__pyx_t_11, __pyx_n_s_np);
if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 98, __pyx_L1_error)
5881 __Pyx_GOTREF(__pyx_t_11);
5882 __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_11, __pyx_n_s_asarray);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 98, __pyx_L1_error)
5883 __Pyx_GOTREF(__pyx_t_4);
5884 __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
5885 __pyx_t_7 = __pyx_v_cmesh->mesh.nodeOffsets_subdomain_owned;
5886 __pyx_t_11 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_comm), __pyx_n_s_size);
if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 98, __pyx_L1_error)
5887 __Pyx_GOTREF(__pyx_t_11);
5888 __pyx_t_12 = __Pyx_PyInt_AddObjC(__pyx_t_11, __pyx_int_1, 1, 0, 0);
if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 98, __pyx_L1_error)
5889 __Pyx_GOTREF(__pyx_t_12);
5890 __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
5891 __pyx_t_9 = __Pyx_PyIndex_AsSsize_t(__pyx_t_12);
if (unlikely((__pyx_t_9 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 98, __pyx_L1_error)
5892 __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
5894 PyErr_SetString(PyExc_ValueError,
"Cannot create cython.array from NULL pointer");
5895 __PYX_ERR(0, 98, __pyx_L1_error)
5897 __pyx_t_11 = __pyx_format_from_typeinfo(&__Pyx_TypeInfo_int);
if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 98, __pyx_L1_error)
5898 __Pyx_GOTREF(__pyx_t_11);
5899 __pyx_t_12 = Py_BuildValue((
char*)
"(" __PYX_BUILD_PY_SSIZE_T
")", ((Py_ssize_t)__pyx_t_9));
if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 98, __pyx_L1_error)
5900 __Pyx_GOTREF(__pyx_t_12);
5901 __pyx_t_10 = __pyx_array_new(__pyx_t_12,
sizeof(
int), PyBytes_AS_STRING(__pyx_t_11), (
char *)
"c", (
char *) __pyx_t_7);
5902 if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 98, __pyx_L1_error)
5903 __Pyx_GOTREF(__pyx_t_10);
5904 __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
5905 __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
5907 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
5908 __pyx_t_11 = PyMethod_GET_SELF(__pyx_t_4);
5909 if (likely(__pyx_t_11)) {
5910 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_4);
5911 __Pyx_INCREF(__pyx_t_11);
5912 __Pyx_INCREF(
function);
5913 __Pyx_DECREF_SET(__pyx_t_4,
function);
5916 __pyx_t_8 = (__pyx_t_11) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_11, ((PyObject *)__pyx_t_10)) : __Pyx_PyObject_CallOneArg(__pyx_t_4, ((PyObject *)__pyx_t_10));
5917 __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
5918 __Pyx_DECREF(((PyObject *)__pyx_t_10)); __pyx_t_10 = 0;
5919 if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 98, __pyx_L1_error)
5920 __Pyx_GOTREF(__pyx_t_8);
5921 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
5930 __Pyx_GetModuleGlobalName(__pyx_t_11, __pyx_n_s_np);
if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 99, __pyx_L1_error)
5931 __Pyx_GOTREF(__pyx_t_11);
5932 __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_t_11, __pyx_n_s_asarray);
if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 99, __pyx_L1_error)
5933 __Pyx_GOTREF(__pyx_t_12);
5934 __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
5935 __pyx_t_7 = __pyx_v_cmesh->mesh.nodeNumbering_subdomain2global;
5937 PyErr_SetString(PyExc_ValueError,
"Cannot create cython.array from NULL pointer");
5938 __PYX_ERR(0, 99, __pyx_L1_error)
5940 __pyx_t_13 = __pyx_format_from_typeinfo(&__Pyx_TypeInfo_int);
if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 99, __pyx_L1_error)
5941 __Pyx_GOTREF(__pyx_t_13);
5942 __pyx_t_11 = Py_BuildValue((
char*)
"(" __PYX_BUILD_PY_SSIZE_T
")", ((Py_ssize_t)__pyx_v_cmesh->mesh.subdomainp->nNodes_global));
if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 99, __pyx_L1_error)
5943 __Pyx_GOTREF(__pyx_t_11);
5944 __pyx_t_10 = __pyx_array_new(__pyx_t_11,
sizeof(
int), PyBytes_AS_STRING(__pyx_t_13), (
char *)
"c", (
char *) __pyx_t_7);
5945 if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 99, __pyx_L1_error)
5946 __Pyx_GOTREF(__pyx_t_10);
5947 __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
5948 __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
5950 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_12))) {
5951 __pyx_t_13 = PyMethod_GET_SELF(__pyx_t_12);
5952 if (likely(__pyx_t_13)) {
5953 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_12);
5954 __Pyx_INCREF(__pyx_t_13);
5955 __Pyx_INCREF(
function);
5956 __Pyx_DECREF_SET(__pyx_t_12,
function);
5959 __pyx_t_4 = (__pyx_t_13) ? __Pyx_PyObject_Call2Args(__pyx_t_12, __pyx_t_13, ((PyObject *)__pyx_t_10)) : __Pyx_PyObject_CallOneArg(__pyx_t_12, ((PyObject *)__pyx_t_10));
5960 __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
5961 __Pyx_DECREF(((PyObject *)__pyx_t_10)); __pyx_t_10 = 0;
5962 if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 99, __pyx_L1_error)
5963 __Pyx_GOTREF(__pyx_t_4);
5964 __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
5973 __Pyx_GetModuleGlobalName(__pyx_t_13, __pyx_n_s_np);
if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 100, __pyx_L1_error)
5974 __Pyx_GOTREF(__pyx_t_13);
5975 __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_t_13, __pyx_n_s_asarray);
if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 100, __pyx_L1_error)
5976 __Pyx_GOTREF(__pyx_t_11);
5977 __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
5978 __pyx_t_7 = __pyx_v_cmesh->mesh.elementBoundaryOffsets_subdomain_owned;
5979 __pyx_t_13 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_comm), __pyx_n_s_size);
if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 100, __pyx_L1_error)
5980 __Pyx_GOTREF(__pyx_t_13);
5981 __pyx_t_14 = __Pyx_PyInt_AddObjC(__pyx_t_13, __pyx_int_1, 1, 0, 0);
if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 100, __pyx_L1_error)
5982 __Pyx_GOTREF(__pyx_t_14);
5983 __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
5984 __pyx_t_9 = __Pyx_PyIndex_AsSsize_t(__pyx_t_14);
if (unlikely((__pyx_t_9 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 100, __pyx_L1_error)
5985 __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
5987 PyErr_SetString(PyExc_ValueError,
"Cannot create cython.array from NULL pointer");
5988 __PYX_ERR(0, 100, __pyx_L1_error)
5990 __pyx_t_13 = __pyx_format_from_typeinfo(&__Pyx_TypeInfo_int);
if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 100, __pyx_L1_error)
5991 __Pyx_GOTREF(__pyx_t_13);
5992 __pyx_t_14 = Py_BuildValue((
char*)
"(" __PYX_BUILD_PY_SSIZE_T
")", ((Py_ssize_t)__pyx_t_9));
if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 100, __pyx_L1_error)
5993 __Pyx_GOTREF(__pyx_t_14);
5994 __pyx_t_10 = __pyx_array_new(__pyx_t_14,
sizeof(
int), PyBytes_AS_STRING(__pyx_t_13), (
char *)
"c", (
char *) __pyx_t_7);
5995 if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 100, __pyx_L1_error)
5996 __Pyx_GOTREF(__pyx_t_10);
5997 __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
5998 __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
6000 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_11))) {
6001 __pyx_t_13 = PyMethod_GET_SELF(__pyx_t_11);
6002 if (likely(__pyx_t_13)) {
6003 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_11);
6004 __Pyx_INCREF(__pyx_t_13);
6005 __Pyx_INCREF(
function);
6006 __Pyx_DECREF_SET(__pyx_t_11,
function);
6009 __pyx_t_12 = (__pyx_t_13) ? __Pyx_PyObject_Call2Args(__pyx_t_11, __pyx_t_13, ((PyObject *)__pyx_t_10)) : __Pyx_PyObject_CallOneArg(__pyx_t_11, ((PyObject *)__pyx_t_10));
6010 __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
6011 __Pyx_DECREF(((PyObject *)__pyx_t_10)); __pyx_t_10 = 0;
6012 if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 100, __pyx_L1_error)
6013 __Pyx_GOTREF(__pyx_t_12);
6014 __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
6023 __Pyx_GetModuleGlobalName(__pyx_t_13, __pyx_n_s_np);
if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 101, __pyx_L1_error)
6024 __Pyx_GOTREF(__pyx_t_13);
6025 __pyx_t_14 = __Pyx_PyObject_GetAttrStr(__pyx_t_13, __pyx_n_s_asarray);
if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 101, __pyx_L1_error)
6026 __Pyx_GOTREF(__pyx_t_14);
6027 __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
6028 __pyx_t_7 = __pyx_v_cmesh->mesh.elementBoundaryNumbering_subdomain2global;
6030 PyErr_SetString(PyExc_ValueError,
"Cannot create cython.array from NULL pointer");
6031 __PYX_ERR(0, 101, __pyx_L1_error)
6033 __pyx_t_15 = __pyx_format_from_typeinfo(&__Pyx_TypeInfo_int);
if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 101, __pyx_L1_error)
6034 __Pyx_GOTREF(__pyx_t_15);
6035 __pyx_t_13 = Py_BuildValue((
char*)
"(" __PYX_BUILD_PY_SSIZE_T
")", ((Py_ssize_t)__pyx_v_cmesh->mesh.subdomainp->nElementBoundaries_global));
if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 101, __pyx_L1_error)
6036 __Pyx_GOTREF(__pyx_t_13);
6037 __pyx_t_10 = __pyx_array_new(__pyx_t_13,
sizeof(
int), PyBytes_AS_STRING(__pyx_t_15), (
char *)
"c", (
char *) __pyx_t_7);
6038 if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 101, __pyx_L1_error)
6039 __Pyx_GOTREF(__pyx_t_10);
6040 __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
6041 __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
6043 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_14))) {
6044 __pyx_t_15 = PyMethod_GET_SELF(__pyx_t_14);
6045 if (likely(__pyx_t_15)) {
6046 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_14);
6047 __Pyx_INCREF(__pyx_t_15);
6048 __Pyx_INCREF(
function);
6049 __Pyx_DECREF_SET(__pyx_t_14,
function);
6052 __pyx_t_11 = (__pyx_t_15) ? __Pyx_PyObject_Call2Args(__pyx_t_14, __pyx_t_15, ((PyObject *)__pyx_t_10)) : __Pyx_PyObject_CallOneArg(__pyx_t_14, ((PyObject *)__pyx_t_10));
6053 __Pyx_XDECREF(__pyx_t_15); __pyx_t_15 = 0;
6054 __Pyx_DECREF(((PyObject *)__pyx_t_10)); __pyx_t_10 = 0;
6055 if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 101, __pyx_L1_error)
6056 __Pyx_GOTREF(__pyx_t_11);
6057 __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
6066 __Pyx_GetModuleGlobalName(__pyx_t_15, __pyx_n_s_np);
if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 102, __pyx_L1_error)
6067 __Pyx_GOTREF(__pyx_t_15);
6068 __pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_t_15, __pyx_n_s_asarray);
if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 102, __pyx_L1_error)
6069 __Pyx_GOTREF(__pyx_t_13);
6070 __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
6071 __pyx_t_7 = __pyx_v_cmesh->mesh.edgeOffsets_subdomain_owned;
6072 __pyx_t_15 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_comm), __pyx_n_s_size);
if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 102, __pyx_L1_error)
6073 __Pyx_GOTREF(__pyx_t_15);
6074 __pyx_t_16 = __Pyx_PyInt_AddObjC(__pyx_t_15, __pyx_int_1, 1, 0, 0);
if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 102, __pyx_L1_error)
6075 __Pyx_GOTREF(__pyx_t_16);
6076 __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
6077 __pyx_t_9 = __Pyx_PyIndex_AsSsize_t(__pyx_t_16);
if (unlikely((__pyx_t_9 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 102, __pyx_L1_error)
6078 __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
6080 PyErr_SetString(PyExc_ValueError,
"Cannot create cython.array from NULL pointer");
6081 __PYX_ERR(0, 102, __pyx_L1_error)
6083 __pyx_t_15 = __pyx_format_from_typeinfo(&__Pyx_TypeInfo_int);
if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 102, __pyx_L1_error)
6084 __Pyx_GOTREF(__pyx_t_15);
6085 __pyx_t_16 = Py_BuildValue((
char*)
"(" __PYX_BUILD_PY_SSIZE_T
")", ((Py_ssize_t)__pyx_t_9));
if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 102, __pyx_L1_error)
6086 __Pyx_GOTREF(__pyx_t_16);
6087 __pyx_t_10 = __pyx_array_new(__pyx_t_16,
sizeof(
int), PyBytes_AS_STRING(__pyx_t_15), (
char *)
"c", (
char *) __pyx_t_7);
6088 if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 102, __pyx_L1_error)
6089 __Pyx_GOTREF(__pyx_t_10);
6090 __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
6091 __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
6093 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_13))) {
6094 __pyx_t_15 = PyMethod_GET_SELF(__pyx_t_13);
6095 if (likely(__pyx_t_15)) {
6096 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_13);
6097 __Pyx_INCREF(__pyx_t_15);
6098 __Pyx_INCREF(
function);
6099 __Pyx_DECREF_SET(__pyx_t_13,
function);
6102 __pyx_t_14 = (__pyx_t_15) ? __Pyx_PyObject_Call2Args(__pyx_t_13, __pyx_t_15, ((PyObject *)__pyx_t_10)) : __Pyx_PyObject_CallOneArg(__pyx_t_13, ((PyObject *)__pyx_t_10));
6103 __Pyx_XDECREF(__pyx_t_15); __pyx_t_15 = 0;
6104 __Pyx_DECREF(((PyObject *)__pyx_t_10)); __pyx_t_10 = 0;
6105 if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 102, __pyx_L1_error)
6106 __Pyx_GOTREF(__pyx_t_14);
6107 __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
6116 __Pyx_GetModuleGlobalName(__pyx_t_15, __pyx_n_s_np);
if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 103, __pyx_L1_error)
6117 __Pyx_GOTREF(__pyx_t_15);
6118 __pyx_t_16 = __Pyx_PyObject_GetAttrStr(__pyx_t_15, __pyx_n_s_asarray);
if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 103, __pyx_L1_error)
6119 __Pyx_GOTREF(__pyx_t_16);
6120 __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
6121 __pyx_t_7 = __pyx_v_cmesh->mesh.edgeNumbering_subdomain2global;
6123 PyErr_SetString(PyExc_ValueError,
"Cannot create cython.array from NULL pointer");
6124 __PYX_ERR(0, 103, __pyx_L1_error)
6126 __pyx_t_17 = __pyx_format_from_typeinfo(&__Pyx_TypeInfo_int);
if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 103, __pyx_L1_error)
6127 __Pyx_GOTREF(__pyx_t_17);
6128 __pyx_t_15 = Py_BuildValue((
char*)
"(" __PYX_BUILD_PY_SSIZE_T
")", ((Py_ssize_t)__pyx_v_cmesh->mesh.subdomainp->nEdges_global));
if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 103, __pyx_L1_error)
6129 __Pyx_GOTREF(__pyx_t_15);
6130 __pyx_t_10 = __pyx_array_new(__pyx_t_15,
sizeof(
int), PyBytes_AS_STRING(__pyx_t_17), (
char *)
"c", (
char *) __pyx_t_7);
6131 if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 103, __pyx_L1_error)
6132 __Pyx_GOTREF(__pyx_t_10);
6133 __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
6134 __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
6136 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_16))) {
6137 __pyx_t_17 = PyMethod_GET_SELF(__pyx_t_16);
6138 if (likely(__pyx_t_17)) {
6139 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_16);
6140 __Pyx_INCREF(__pyx_t_17);
6141 __Pyx_INCREF(
function);
6142 __Pyx_DECREF_SET(__pyx_t_16,
function);
6145 __pyx_t_13 = (__pyx_t_17) ? __Pyx_PyObject_Call2Args(__pyx_t_16, __pyx_t_17, ((PyObject *)__pyx_t_10)) : __Pyx_PyObject_CallOneArg(__pyx_t_16, ((PyObject *)__pyx_t_10));
6146 __Pyx_XDECREF(__pyx_t_17); __pyx_t_17 = 0;
6147 __Pyx_DECREF(((PyObject *)__pyx_t_10)); __pyx_t_10 = 0;
6148 if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 103, __pyx_L1_error)
6149 __Pyx_GOTREF(__pyx_t_13);
6150 __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
6159 __pyx_t_16 = PyTuple_New(8);
if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 96, __pyx_L1_error)
6160 __Pyx_GOTREF(__pyx_t_16);
6161 __Pyx_GIVEREF(__pyx_t_3);
6162 PyTuple_SET_ITEM(__pyx_t_16, 0, __pyx_t_3);
6163 __Pyx_GIVEREF(__pyx_t_5);
6164 PyTuple_SET_ITEM(__pyx_t_16, 1, __pyx_t_5);
6165 __Pyx_GIVEREF(__pyx_t_8);
6166 PyTuple_SET_ITEM(__pyx_t_16, 2, __pyx_t_8);
6167 __Pyx_GIVEREF(__pyx_t_4);
6168 PyTuple_SET_ITEM(__pyx_t_16, 3, __pyx_t_4);
6169 __Pyx_GIVEREF(__pyx_t_12);
6170 PyTuple_SET_ITEM(__pyx_t_16, 4, __pyx_t_12);
6171 __Pyx_GIVEREF(__pyx_t_11);
6172 PyTuple_SET_ITEM(__pyx_t_16, 5, __pyx_t_11);
6173 __Pyx_GIVEREF(__pyx_t_14);
6174 PyTuple_SET_ITEM(__pyx_t_16, 6, __pyx_t_14);
6175 __Pyx_GIVEREF(__pyx_t_13);
6176 PyTuple_SET_ITEM(__pyx_t_16, 7, __pyx_t_13);
6185 __pyx_r = __pyx_t_16;
6199 __Pyx_XDECREF(__pyx_t_3);
6200 __Pyx_XDECREF(__pyx_t_4);
6201 __Pyx_XDECREF(__pyx_t_5);
6202 __Pyx_XDECREF(__pyx_t_8);
6203 __Pyx_XDECREF(((PyObject *)__pyx_t_10));
6204 __Pyx_XDECREF(__pyx_t_11);
6205 __Pyx_XDECREF(__pyx_t_12);
6206 __Pyx_XDECREF(__pyx_t_13);
6207 __Pyx_XDECREF(__pyx_t_14);
6208 __Pyx_XDECREF(__pyx_t_15);
6209 __Pyx_XDECREF(__pyx_t_16);
6210 __Pyx_XDECREF(__pyx_t_17);
6211 __Pyx_AddTraceback(
"cpartitioning.partitionNodesFromTriangleFiles", __pyx_clineno, __pyx_lineno, __pyx_filename);
6214 __Pyx_XDECREF(__pyx_v_filebase);
6215 __Pyx_XGIVEREF(__pyx_r);
6216 __Pyx_RefNannyFinishContext();
6229 static PyObject *__pyx_pw_13cpartitioning_11buildQuadraticLocal2GlobalMappings(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
6230 static PyMethodDef __pyx_mdef_13cpartitioning_11buildQuadraticLocal2GlobalMappings = {
"buildQuadraticLocal2GlobalMappings", (PyCFunction)(
void*)(PyCFunctionWithKeywords)__pyx_pw_13cpartitioning_11buildQuadraticLocal2GlobalMappings, METH_VARARGS|METH_KEYWORDS, 0};
6231 static PyObject *__pyx_pw_13cpartitioning_11buildQuadraticLocal2GlobalMappings(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
6232 struct PyMPICommObject *__pyx_v_comm = 0;
6234 struct __pyx_obj_7proteus_10cmeshTools_CMesh *__pyx_v_cmesh = 0;
6235 CYTHON_UNUSED
struct __pyx_obj_7proteus_10cmeshTools_CMesh *__pyx_v_subdomain_cmesh = 0;
6236 PyArrayObject *__pyx_v_elementOffsets_subdomain_owned = 0;
6237 PyArrayObject *__pyx_v_nodeOffsets_subdomain_owned = 0;
6238 PyArrayObject *__pyx_v_elementBoundaryOffsets_subdomain_owned = 0;
6239 PyArrayObject *__pyx_v_edgeOffsets_subdomain_owned = 0;
6240 PyArrayObject *__pyx_v_elementNumbering_subdomain2global = 0;
6241 PyArrayObject *__pyx_v_nodeNumbering_subdomain2global = 0;
6242 PyArrayObject *__pyx_v_elementBoundaryNumbering_subdomain2global = 0;
6243 PyArrayObject *__pyx_v_edgeNumbering_subdomain2global = 0;
6244 PyArrayObject *__pyx_v_quadratic_dof_offsets_subdomain_owned = 0;
6245 PyArrayObject *__pyx_v_quadratic_subdomain_l2g = 0;
6246 PyArrayObject *__pyx_v_quadraticNumbering_subdomain2global = 0;
6247 PyArrayObject *__pyx_v_quadratic_lagrangeNodes = 0;
6248 int __pyx_lineno = 0;
6249 const char *__pyx_filename = NULL;
6250 int __pyx_clineno = 0;
6251 PyObject *__pyx_r = 0;
6252 __Pyx_RefNannyDeclarations
6253 __Pyx_RefNannySetupContext(
"buildQuadraticLocal2GlobalMappings (wrapper)", 0);
6255 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_comm,&__pyx_n_s_nSpace,&__pyx_n_s_cmesh,&__pyx_n_s_subdomain_cmesh,&__pyx_n_s_elementOffsets_subdomain_owned,&__pyx_n_s_nodeOffsets_subdomain_owned,&__pyx_n_s_elementBoundaryOffsets_subdomain,&__pyx_n_s_edgeOffsets_subdomain_owned,&__pyx_n_s_elementNumbering_subdomain2globa,&__pyx_n_s_nodeNumbering_subdomain2global,&__pyx_n_s_elementBoundaryNumbering_subdoma,&__pyx_n_s_edgeNumbering_subdomain2global,&__pyx_n_s_quadratic_dof_offsets_subdomain,&__pyx_n_s_quadratic_subdomain_l2g,&__pyx_n_s_quadraticNumbering_subdomain2glo,&__pyx_n_s_quadratic_lagrangeNodes,0};
6256 PyObject* values[16] = {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0};
6257 if (unlikely(__pyx_kwds)) {
6259 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
6261 case 16: values[15] = PyTuple_GET_ITEM(__pyx_args, 15);
6263 case 15: values[14] = PyTuple_GET_ITEM(__pyx_args, 14);
6265 case 14: values[13] = PyTuple_GET_ITEM(__pyx_args, 13);
6267 case 13: values[12] = PyTuple_GET_ITEM(__pyx_args, 12);
6269 case 12: values[11] = PyTuple_GET_ITEM(__pyx_args, 11);
6271 case 11: values[10] = PyTuple_GET_ITEM(__pyx_args, 10);
6273 case 10: values[9] = PyTuple_GET_ITEM(__pyx_args, 9);
6275 case 9: values[8] = PyTuple_GET_ITEM(__pyx_args, 8);
6277 case 8: values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
6279 case 7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
6281 case 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
6283 case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
6285 case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
6287 case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
6289 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
6291 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
6294 default:
goto __pyx_L5_argtuple_error;
6296 kw_args = PyDict_Size(__pyx_kwds);
6299 if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_comm)) != 0)) kw_args--;
6300 else goto __pyx_L5_argtuple_error;
6303 if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_nSpace)) != 0)) kw_args--;
6305 __Pyx_RaiseArgtupleInvalid(
"buildQuadraticLocal2GlobalMappings", 1, 16, 16, 1); __PYX_ERR(0, 106, __pyx_L3_error)
6309 if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_cmesh)) != 0)) kw_args--;
6311 __Pyx_RaiseArgtupleInvalid(
"buildQuadraticLocal2GlobalMappings", 1, 16, 16, 2); __PYX_ERR(0, 106, __pyx_L3_error)
6315 if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_subdomain_cmesh)) != 0)) kw_args--;
6317 __Pyx_RaiseArgtupleInvalid(
"buildQuadraticLocal2GlobalMappings", 1, 16, 16, 3); __PYX_ERR(0, 106, __pyx_L3_error)
6321 if (likely((values[4] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_elementOffsets_subdomain_owned)) != 0)) kw_args--;
6323 __Pyx_RaiseArgtupleInvalid(
"buildQuadraticLocal2GlobalMappings", 1, 16, 16, 4); __PYX_ERR(0, 106, __pyx_L3_error)
6327 if (likely((values[5] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_nodeOffsets_subdomain_owned)) != 0)) kw_args--;
6329 __Pyx_RaiseArgtupleInvalid(
"buildQuadraticLocal2GlobalMappings", 1, 16, 16, 5); __PYX_ERR(0, 106, __pyx_L3_error)
6333 if (likely((values[6] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_elementBoundaryOffsets_subdomain)) != 0)) kw_args--;
6335 __Pyx_RaiseArgtupleInvalid(
"buildQuadraticLocal2GlobalMappings", 1, 16, 16, 6); __PYX_ERR(0, 106, __pyx_L3_error)
6339 if (likely((values[7] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_edgeOffsets_subdomain_owned)) != 0)) kw_args--;
6341 __Pyx_RaiseArgtupleInvalid(
"buildQuadraticLocal2GlobalMappings", 1, 16, 16, 7); __PYX_ERR(0, 106, __pyx_L3_error)
6345 if (likely((values[8] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_elementNumbering_subdomain2globa)) != 0)) kw_args--;
6347 __Pyx_RaiseArgtupleInvalid(
"buildQuadraticLocal2GlobalMappings", 1, 16, 16, 8); __PYX_ERR(0, 106, __pyx_L3_error)
6351 if (likely((values[9] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_nodeNumbering_subdomain2global)) != 0)) kw_args--;
6353 __Pyx_RaiseArgtupleInvalid(
"buildQuadraticLocal2GlobalMappings", 1, 16, 16, 9); __PYX_ERR(0, 106, __pyx_L3_error)
6357 if (likely((values[10] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_elementBoundaryNumbering_subdoma)) != 0)) kw_args--;
6359 __Pyx_RaiseArgtupleInvalid(
"buildQuadraticLocal2GlobalMappings", 1, 16, 16, 10); __PYX_ERR(0, 106, __pyx_L3_error)
6363 if (likely((values[11] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_edgeNumbering_subdomain2global)) != 0)) kw_args--;
6365 __Pyx_RaiseArgtupleInvalid(
"buildQuadraticLocal2GlobalMappings", 1, 16, 16, 11); __PYX_ERR(0, 106, __pyx_L3_error)
6369 if (likely((values[12] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_quadratic_dof_offsets_subdomain)) != 0)) kw_args--;
6371 __Pyx_RaiseArgtupleInvalid(
"buildQuadraticLocal2GlobalMappings", 1, 16, 16, 12); __PYX_ERR(0, 106, __pyx_L3_error)
6375 if (likely((values[13] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_quadratic_subdomain_l2g)) != 0)) kw_args--;
6377 __Pyx_RaiseArgtupleInvalid(
"buildQuadraticLocal2GlobalMappings", 1, 16, 16, 13); __PYX_ERR(0, 106, __pyx_L3_error)
6381 if (likely((values[14] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_quadraticNumbering_subdomain2glo)) != 0)) kw_args--;
6383 __Pyx_RaiseArgtupleInvalid(
"buildQuadraticLocal2GlobalMappings", 1, 16, 16, 14); __PYX_ERR(0, 106, __pyx_L3_error)
6387 if (likely((values[15] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_quadratic_lagrangeNodes)) != 0)) kw_args--;
6389 __Pyx_RaiseArgtupleInvalid(
"buildQuadraticLocal2GlobalMappings", 1, 16, 16, 15); __PYX_ERR(0, 106, __pyx_L3_error)
6392 if (unlikely(kw_args > 0)) {
6393 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args,
"buildQuadraticLocal2GlobalMappings") < 0)) __PYX_ERR(0, 106, __pyx_L3_error)
6395 }
else if (PyTuple_GET_SIZE(__pyx_args) != 16) {
6396 goto __pyx_L5_argtuple_error;
6398 values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
6399 values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
6400 values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
6401 values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
6402 values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
6403 values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
6404 values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
6405 values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
6406 values[8] = PyTuple_GET_ITEM(__pyx_args, 8);
6407 values[9] = PyTuple_GET_ITEM(__pyx_args, 9);
6408 values[10] = PyTuple_GET_ITEM(__pyx_args, 10);
6409 values[11] = PyTuple_GET_ITEM(__pyx_args, 11);
6410 values[12] = PyTuple_GET_ITEM(__pyx_args, 12);
6411 values[13] = PyTuple_GET_ITEM(__pyx_args, 13);
6412 values[14] = PyTuple_GET_ITEM(__pyx_args, 14);
6413 values[15] = PyTuple_GET_ITEM(__pyx_args, 15);
6415 __pyx_v_comm = ((
struct PyMPICommObject *)values[0]);
6416 __pyx_v_nSpace = __Pyx_PyInt_As_int(values[1]);
if (unlikely((__pyx_v_nSpace == (
int)-1) && PyErr_Occurred())) __PYX_ERR(0, 107, __pyx_L3_error)
6417 __pyx_v_cmesh = ((
struct __pyx_obj_7proteus_10cmeshTools_CMesh *)values[2]);
6418 __pyx_v_subdomain_cmesh = ((
struct __pyx_obj_7proteus_10cmeshTools_CMesh *)values[3]);
6419 __pyx_v_elementOffsets_subdomain_owned = ((PyArrayObject *)values[4]);
6420 __pyx_v_nodeOffsets_subdomain_owned = ((PyArrayObject *)values[5]);
6421 __pyx_v_elementBoundaryOffsets_subdomain_owned = ((PyArrayObject *)values[6]);
6422 __pyx_v_edgeOffsets_subdomain_owned = ((PyArrayObject *)values[7]);
6423 __pyx_v_elementNumbering_subdomain2global = ((PyArrayObject *)values[8]);
6424 __pyx_v_nodeNumbering_subdomain2global = ((PyArrayObject *)values[9]);
6425 __pyx_v_elementBoundaryNumbering_subdomain2global = ((PyArrayObject *)values[10]);
6426 __pyx_v_edgeNumbering_subdomain2global = ((PyArrayObject *)values[11]);
6427 __pyx_v_quadratic_dof_offsets_subdomain_owned = ((PyArrayObject *)values[12]);
6428 __pyx_v_quadratic_subdomain_l2g = ((PyArrayObject *)values[13]);
6429 __pyx_v_quadraticNumbering_subdomain2global = ((PyArrayObject *)values[14]);
6430 __pyx_v_quadratic_lagrangeNodes = ((PyArrayObject *)values[15]);
6432 goto __pyx_L4_argument_unpacking_done;
6433 __pyx_L5_argtuple_error:;
6434 __Pyx_RaiseArgtupleInvalid(
"buildQuadraticLocal2GlobalMappings", 1, 16, 16, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 106, __pyx_L3_error)
6436 __Pyx_AddTraceback(
"cpartitioning.buildQuadraticLocal2GlobalMappings", __pyx_clineno, __pyx_lineno, __pyx_filename);
6437 __Pyx_RefNannyFinishContext();
6439 __pyx_L4_argument_unpacking_done:;
6440 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_comm), __pyx_ptype_6mpi4py_3MPI_Comm, 1,
"comm", 0))) __PYX_ERR(0, 106, __pyx_L1_error)
6441 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_cmesh), __pyx_ptype_7proteus_10cmeshTools_CMesh, 1,
"cmesh", 0))) __PYX_ERR(0, 108, __pyx_L1_error)
6442 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_subdomain_cmesh), __pyx_ptype_7proteus_10cmeshTools_CMesh, 1,
"subdomain_cmesh", 0))) __PYX_ERR(0, 109, __pyx_L1_error)
6443 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_elementOffsets_subdomain_owned), __pyx_ptype_5numpy_ndarray, 1,
"elementOffsets_subdomain_owned", 0))) __PYX_ERR(0, 110, __pyx_L1_error)
6444 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_nodeOffsets_subdomain_owned), __pyx_ptype_5numpy_ndarray, 1,
"nodeOffsets_subdomain_owned", 0))) __PYX_ERR(0, 111, __pyx_L1_error)
6445 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_elementBoundaryOffsets_subdomain_owned), __pyx_ptype_5numpy_ndarray, 1,
"elementBoundaryOffsets_subdomain_owned", 0))) __PYX_ERR(0, 112, __pyx_L1_error)
6446 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_edgeOffsets_subdomain_owned), __pyx_ptype_5numpy_ndarray, 1,
"edgeOffsets_subdomain_owned", 0))) __PYX_ERR(0, 113, __pyx_L1_error)
6447 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_elementNumbering_subdomain2global), __pyx_ptype_5numpy_ndarray, 1,
"elementNumbering_subdomain2global", 0))) __PYX_ERR(0, 114, __pyx_L1_error)
6448 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_nodeNumbering_subdomain2global), __pyx_ptype_5numpy_ndarray, 1,
"nodeNumbering_subdomain2global", 0))) __PYX_ERR(0, 115, __pyx_L1_error)
6449 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_elementBoundaryNumbering_subdomain2global), __pyx_ptype_5numpy_ndarray, 1,
"elementBoundaryNumbering_subdomain2global", 0))) __PYX_ERR(0, 116, __pyx_L1_error)
6450 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_edgeNumbering_subdomain2global), __pyx_ptype_5numpy_ndarray, 1,
"edgeNumbering_subdomain2global", 0))) __PYX_ERR(0, 117, __pyx_L1_error)
6451 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_quadratic_dof_offsets_subdomain_owned), __pyx_ptype_5numpy_ndarray, 1,
"quadratic_dof_offsets_subdomain_owned", 0))) __PYX_ERR(0, 118, __pyx_L1_error)
6452 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_quadratic_subdomain_l2g), __pyx_ptype_5numpy_ndarray, 1,
"quadratic_subdomain_l2g", 0))) __PYX_ERR(0, 119, __pyx_L1_error)
6453 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_quadraticNumbering_subdomain2global), __pyx_ptype_5numpy_ndarray, 1,
"quadraticNumbering_subdomain2global", 0))) __PYX_ERR(0, 120, __pyx_L1_error)
6454 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_quadratic_lagrangeNodes), __pyx_ptype_5numpy_ndarray, 1,
"quadratic_lagrangeNodes", 0))) __PYX_ERR(0, 121, __pyx_L1_error)
6455 __pyx_r = __pyx_pf_13cpartitioning_10buildQuadraticLocal2GlobalMappings(__pyx_self, __pyx_v_comm, __pyx_v_nSpace, __pyx_v_cmesh, __pyx_v_subdomain_cmesh, __pyx_v_elementOffsets_subdomain_owned, __pyx_v_nodeOffsets_subdomain_owned, __pyx_v_elementBoundaryOffsets_subdomain_owned, __pyx_v_edgeOffsets_subdomain_owned, __pyx_v_elementNumbering_subdomain2global, __pyx_v_nodeNumbering_subdomain2global, __pyx_v_elementBoundaryNumbering_subdomain2global, __pyx_v_edgeNumbering_subdomain2global, __pyx_v_quadratic_dof_offsets_subdomain_owned, __pyx_v_quadratic_subdomain_l2g, __pyx_v_quadraticNumbering_subdomain2global, __pyx_v_quadratic_lagrangeNodes);
6462 __Pyx_RefNannyFinishContext();
6466 static PyObject *__pyx_pf_13cpartitioning_10buildQuadraticLocal2GlobalMappings(CYTHON_UNUSED PyObject *__pyx_self,
struct PyMPICommObject *__pyx_v_comm,
int __pyx_v_nSpace,
struct __pyx_obj_7proteus_10cmeshTools_CMesh *__pyx_v_cmesh, CYTHON_UNUSED
struct __pyx_obj_7proteus_10cmeshTools_CMesh *__pyx_v_subdomain_cmesh, PyArrayObject *__pyx_v_elementOffsets_subdomain_owned, PyArrayObject *__pyx_v_nodeOffsets_subdomain_owned, PyArrayObject *__pyx_v_elementBoundaryOffsets_subdomain_owned, PyArrayObject *__pyx_v_edgeOffsets_subdomain_owned, PyArrayObject *__pyx_v_elementNumbering_subdomain2global, PyArrayObject *__pyx_v_nodeNumbering_subdomain2global, PyArrayObject *__pyx_v_elementBoundaryNumbering_subdomain2global, PyArrayObject *__pyx_v_edgeNumbering_subdomain2global, PyArrayObject *__pyx_v_quadratic_dof_offsets_subdomain_owned, PyArrayObject *__pyx_v_quadratic_subdomain_l2g, PyArrayObject *__pyx_v_quadraticNumbering_subdomain2global, PyArrayObject *__pyx_v_quadratic_lagrangeNodes) {
6467 int __pyx_v_nDOF_all_processes;
6468 int __pyx_v_nDOF_subdomain;
6469 int __pyx_v_max_dof_neighbors;
6470 PyObject *__pyx_r = NULL;
6471 __Pyx_RefNannyDeclarations
6472 PyObject *__pyx_t_1 = NULL;
6473 PyObject *__pyx_t_2 = NULL;
6474 PyObject *__pyx_t_3 = NULL;
6475 PyObject *__pyx_t_4 = NULL;
6476 int __pyx_lineno = 0;
6477 const char *__pyx_filename = NULL;
6478 int __pyx_clineno = 0;
6479 __Pyx_RefNannySetupContext(
"buildQuadraticLocal2GlobalMappings", 0);
6488 __pyx_v_nDOF_all_processes = 0;
6497 __pyx_v_nDOF_subdomain = 0;
6506 __pyx_v_max_dof_neighbors = 0;
6515 switch (__pyx_v_nSpace) {
6525 (void)(
proteus::buildQuadraticSubdomain2GlobalMappings_1d(__pyx_v_comm->ob_mpi, __pyx_v_cmesh->mesh, ((
int *)__pyx_v_elementOffsets_subdomain_owned->data), ((
int *)__pyx_v_nodeOffsets_subdomain_owned->data), ((
int *)__pyx_v_elementNumbering_subdomain2global->data), ((
int *)__pyx_v_nodeNumbering_subdomain2global->data), __pyx_v_nDOF_all_processes, __pyx_v_nDOF_subdomain, __pyx_v_max_dof_neighbors, ((
int *)__pyx_v_quadratic_dof_offsets_subdomain_owned->data), ((
int *)__pyx_v_quadratic_subdomain_l2g->data), ((
int *)__pyx_v_quadraticNumbering_subdomain2global->data), ((
double *)__pyx_v_quadratic_lagrangeNodes->data)));
6544 (void)(
proteus::buildQuadraticSubdomain2GlobalMappings_2d(__pyx_v_comm->ob_mpi, __pyx_v_cmesh->mesh, ((
int *)__pyx_v_elementBoundaryOffsets_subdomain_owned->data), ((
int *)__pyx_v_nodeOffsets_subdomain_owned->data), ((
int *)__pyx_v_elementBoundaryNumbering_subdomain2global->data), ((
int *)__pyx_v_nodeNumbering_subdomain2global->data), __pyx_v_nDOF_all_processes, __pyx_v_nDOF_subdomain, __pyx_v_max_dof_neighbors, ((
int *)__pyx_v_quadratic_dof_offsets_subdomain_owned->data), ((
int *)__pyx_v_quadratic_subdomain_l2g->data), ((
int *)__pyx_v_quadraticNumbering_subdomain2global->data), ((
double *)__pyx_v_quadratic_lagrangeNodes->data)));
6563 (void)(
proteus::buildQuadraticSubdomain2GlobalMappings_3d(__pyx_v_comm->ob_mpi, __pyx_v_cmesh->mesh, ((
int *)__pyx_v_edgeOffsets_subdomain_owned->data), ((
int *)__pyx_v_nodeOffsets_subdomain_owned->data), ((
int *)__pyx_v_edgeNumbering_subdomain2global->data), ((
int *)__pyx_v_nodeNumbering_subdomain2global->data), __pyx_v_nDOF_all_processes, __pyx_v_nDOF_subdomain, __pyx_v_max_dof_neighbors, ((
int *)__pyx_v_quadratic_dof_offsets_subdomain_owned->data), ((
int *)__pyx_v_quadratic_subdomain_l2g->data), ((
int *)__pyx_v_quadraticNumbering_subdomain2global->data), ((
double *)__pyx_v_quadratic_lagrangeNodes->data)));
6574 __Pyx_XDECREF(__pyx_r);
6575 __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_nDOF_all_processes);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 167, __pyx_L1_error)
6576 __Pyx_GOTREF(__pyx_t_1);
6585 __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_nDOF_subdomain);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 168, __pyx_L1_error)
6586 __Pyx_GOTREF(__pyx_t_2);
6595 __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_max_dof_neighbors);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 169, __pyx_L1_error)
6596 __Pyx_GOTREF(__pyx_t_3);
6605 __pyx_t_4 = PyTuple_New(3);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 167, __pyx_L1_error)
6606 __Pyx_GOTREF(__pyx_t_4);
6607 __Pyx_GIVEREF(__pyx_t_1);
6608 PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_1);
6609 __Pyx_GIVEREF(__pyx_t_2);
6610 PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_2);
6611 __Pyx_GIVEREF(__pyx_t_3);
6612 PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_t_3);
6616 __pyx_r = __pyx_t_4;
6630 __Pyx_XDECREF(__pyx_t_1);
6631 __Pyx_XDECREF(__pyx_t_2);
6632 __Pyx_XDECREF(__pyx_t_3);
6633 __Pyx_XDECREF(__pyx_t_4);
6634 __Pyx_AddTraceback(
"cpartitioning.buildQuadraticLocal2GlobalMappings", __pyx_clineno, __pyx_lineno, __pyx_filename);
6637 __Pyx_XGIVEREF(__pyx_r);
6638 __Pyx_RefNannyFinishContext();
6651 static PyObject *__pyx_pw_13cpartitioning_13buildQuadraticCubeLocal2GlobalMappings(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
6652 static PyMethodDef __pyx_mdef_13cpartitioning_13buildQuadraticCubeLocal2GlobalMappings = {
"buildQuadraticCubeLocal2GlobalMappings", (PyCFunction)(
void*)(PyCFunctionWithKeywords)__pyx_pw_13cpartitioning_13buildQuadraticCubeLocal2GlobalMappings, METH_VARARGS|METH_KEYWORDS, 0};
6653 static PyObject *__pyx_pw_13cpartitioning_13buildQuadraticCubeLocal2GlobalMappings(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
6654 struct PyMPICommObject *__pyx_v_comm = 0;
6656 struct __pyx_obj_7proteus_10cmeshTools_CMesh *__pyx_v_cmesh = 0;
6657 CYTHON_UNUSED
struct __pyx_obj_7proteus_10cmeshTools_CMesh *__pyx_v_subdomain_cmesh = 0;
6658 CYTHON_UNUSED PyArrayObject *__pyx_v_elementOffsets_subdomain_owned = 0;
6659 PyArrayObject *__pyx_v_nodeOffsets_subdomain_owned = 0;
6660 CYTHON_UNUSED PyArrayObject *__pyx_v_elementBoundaryOffsets_subdomain_owned = 0;
6661 PyArrayObject *__pyx_v_edgeOffsets_subdomain_owned = 0;
6662 CYTHON_UNUSED PyArrayObject *__pyx_v_elementNumbering_subdomain2global = 0;
6663 PyArrayObject *__pyx_v_nodeNumbering_subdomain2global = 0;
6664 CYTHON_UNUSED PyArrayObject *__pyx_v_elementBoundaryNumbering_subdomain2global = 0;
6665 PyArrayObject *__pyx_v_edgeNumbering_subdomain2global = 0;
6666 PyArrayObject *__pyx_v_quadratic_dof_offsets_subdomain_owned = 0;
6667 PyArrayObject *__pyx_v_quadratic_subdomain_l2g = 0;
6668 PyArrayObject *__pyx_v_quadraticNumbering_subdomain2global = 0;
6669 PyArrayObject *__pyx_v_quadratic_lagrangeNodes = 0;
6670 int __pyx_lineno = 0;
6671 const char *__pyx_filename = NULL;
6672 int __pyx_clineno = 0;
6673 PyObject *__pyx_r = 0;
6674 __Pyx_RefNannyDeclarations
6675 __Pyx_RefNannySetupContext(
"buildQuadraticCubeLocal2GlobalMappings (wrapper)", 0);
6677 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_comm,&__pyx_n_s_nSpace,&__pyx_n_s_cmesh,&__pyx_n_s_subdomain_cmesh,&__pyx_n_s_elementOffsets_subdomain_owned,&__pyx_n_s_nodeOffsets_subdomain_owned,&__pyx_n_s_elementBoundaryOffsets_subdomain,&__pyx_n_s_edgeOffsets_subdomain_owned,&__pyx_n_s_elementNumbering_subdomain2globa,&__pyx_n_s_nodeNumbering_subdomain2global,&__pyx_n_s_elementBoundaryNumbering_subdoma,&__pyx_n_s_edgeNumbering_subdomain2global,&__pyx_n_s_quadratic_dof_offsets_subdomain,&__pyx_n_s_quadratic_subdomain_l2g,&__pyx_n_s_quadraticNumbering_subdomain2glo,&__pyx_n_s_quadratic_lagrangeNodes,0};
6678 PyObject* values[16] = {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0};
6679 if (unlikely(__pyx_kwds)) {
6681 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
6683 case 16: values[15] = PyTuple_GET_ITEM(__pyx_args, 15);
6685 case 15: values[14] = PyTuple_GET_ITEM(__pyx_args, 14);
6687 case 14: values[13] = PyTuple_GET_ITEM(__pyx_args, 13);
6689 case 13: values[12] = PyTuple_GET_ITEM(__pyx_args, 12);
6691 case 12: values[11] = PyTuple_GET_ITEM(__pyx_args, 11);
6693 case 11: values[10] = PyTuple_GET_ITEM(__pyx_args, 10);
6695 case 10: values[9] = PyTuple_GET_ITEM(__pyx_args, 9);
6697 case 9: values[8] = PyTuple_GET_ITEM(__pyx_args, 8);
6699 case 8: values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
6701 case 7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
6703 case 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
6705 case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
6707 case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
6709 case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
6711 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
6713 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
6716 default:
goto __pyx_L5_argtuple_error;
6718 kw_args = PyDict_Size(__pyx_kwds);
6721 if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_comm)) != 0)) kw_args--;
6722 else goto __pyx_L5_argtuple_error;
6725 if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_nSpace)) != 0)) kw_args--;
6727 __Pyx_RaiseArgtupleInvalid(
"buildQuadraticCubeLocal2GlobalMappings", 1, 16, 16, 1); __PYX_ERR(0, 171, __pyx_L3_error)
6731 if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_cmesh)) != 0)) kw_args--;
6733 __Pyx_RaiseArgtupleInvalid(
"buildQuadraticCubeLocal2GlobalMappings", 1, 16, 16, 2); __PYX_ERR(0, 171, __pyx_L3_error)
6737 if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_subdomain_cmesh)) != 0)) kw_args--;
6739 __Pyx_RaiseArgtupleInvalid(
"buildQuadraticCubeLocal2GlobalMappings", 1, 16, 16, 3); __PYX_ERR(0, 171, __pyx_L3_error)
6743 if (likely((values[4] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_elementOffsets_subdomain_owned)) != 0)) kw_args--;
6745 __Pyx_RaiseArgtupleInvalid(
"buildQuadraticCubeLocal2GlobalMappings", 1, 16, 16, 4); __PYX_ERR(0, 171, __pyx_L3_error)
6749 if (likely((values[5] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_nodeOffsets_subdomain_owned)) != 0)) kw_args--;
6751 __Pyx_RaiseArgtupleInvalid(
"buildQuadraticCubeLocal2GlobalMappings", 1, 16, 16, 5); __PYX_ERR(0, 171, __pyx_L3_error)
6755 if (likely((values[6] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_elementBoundaryOffsets_subdomain)) != 0)) kw_args--;
6757 __Pyx_RaiseArgtupleInvalid(
"buildQuadraticCubeLocal2GlobalMappings", 1, 16, 16, 6); __PYX_ERR(0, 171, __pyx_L3_error)
6761 if (likely((values[7] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_edgeOffsets_subdomain_owned)) != 0)) kw_args--;
6763 __Pyx_RaiseArgtupleInvalid(
"buildQuadraticCubeLocal2GlobalMappings", 1, 16, 16, 7); __PYX_ERR(0, 171, __pyx_L3_error)
6767 if (likely((values[8] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_elementNumbering_subdomain2globa)) != 0)) kw_args--;
6769 __Pyx_RaiseArgtupleInvalid(
"buildQuadraticCubeLocal2GlobalMappings", 1, 16, 16, 8); __PYX_ERR(0, 171, __pyx_L3_error)
6773 if (likely((values[9] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_nodeNumbering_subdomain2global)) != 0)) kw_args--;
6775 __Pyx_RaiseArgtupleInvalid(
"buildQuadraticCubeLocal2GlobalMappings", 1, 16, 16, 9); __PYX_ERR(0, 171, __pyx_L3_error)
6779 if (likely((values[10] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_elementBoundaryNumbering_subdoma)) != 0)) kw_args--;
6781 __Pyx_RaiseArgtupleInvalid(
"buildQuadraticCubeLocal2GlobalMappings", 1, 16, 16, 10); __PYX_ERR(0, 171, __pyx_L3_error)
6785 if (likely((values[11] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_edgeNumbering_subdomain2global)) != 0)) kw_args--;
6787 __Pyx_RaiseArgtupleInvalid(
"buildQuadraticCubeLocal2GlobalMappings", 1, 16, 16, 11); __PYX_ERR(0, 171, __pyx_L3_error)
6791 if (likely((values[12] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_quadratic_dof_offsets_subdomain)) != 0)) kw_args--;
6793 __Pyx_RaiseArgtupleInvalid(
"buildQuadraticCubeLocal2GlobalMappings", 1, 16, 16, 12); __PYX_ERR(0, 171, __pyx_L3_error)
6797 if (likely((values[13] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_quadratic_subdomain_l2g)) != 0)) kw_args--;
6799 __Pyx_RaiseArgtupleInvalid(
"buildQuadraticCubeLocal2GlobalMappings", 1, 16, 16, 13); __PYX_ERR(0, 171, __pyx_L3_error)
6803 if (likely((values[14] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_quadraticNumbering_subdomain2glo)) != 0)) kw_args--;
6805 __Pyx_RaiseArgtupleInvalid(
"buildQuadraticCubeLocal2GlobalMappings", 1, 16, 16, 14); __PYX_ERR(0, 171, __pyx_L3_error)
6809 if (likely((values[15] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_quadratic_lagrangeNodes)) != 0)) kw_args--;
6811 __Pyx_RaiseArgtupleInvalid(
"buildQuadraticCubeLocal2GlobalMappings", 1, 16, 16, 15); __PYX_ERR(0, 171, __pyx_L3_error)
6814 if (unlikely(kw_args > 0)) {
6815 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args,
"buildQuadraticCubeLocal2GlobalMappings") < 0)) __PYX_ERR(0, 171, __pyx_L3_error)
6817 }
else if (PyTuple_GET_SIZE(__pyx_args) != 16) {
6818 goto __pyx_L5_argtuple_error;
6820 values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
6821 values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
6822 values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
6823 values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
6824 values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
6825 values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
6826 values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
6827 values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
6828 values[8] = PyTuple_GET_ITEM(__pyx_args, 8);
6829 values[9] = PyTuple_GET_ITEM(__pyx_args, 9);
6830 values[10] = PyTuple_GET_ITEM(__pyx_args, 10);
6831 values[11] = PyTuple_GET_ITEM(__pyx_args, 11);
6832 values[12] = PyTuple_GET_ITEM(__pyx_args, 12);
6833 values[13] = PyTuple_GET_ITEM(__pyx_args, 13);
6834 values[14] = PyTuple_GET_ITEM(__pyx_args, 14);
6835 values[15] = PyTuple_GET_ITEM(__pyx_args, 15);
6837 __pyx_v_comm = ((
struct PyMPICommObject *)values[0]);
6838 __pyx_v_nSpace = __Pyx_PyInt_As_int(values[1]);
if (unlikely((__pyx_v_nSpace == (
int)-1) && PyErr_Occurred())) __PYX_ERR(0, 172, __pyx_L3_error)
6839 __pyx_v_cmesh = ((
struct __pyx_obj_7proteus_10cmeshTools_CMesh *)values[2]);
6840 __pyx_v_subdomain_cmesh = ((
struct __pyx_obj_7proteus_10cmeshTools_CMesh *)values[3]);
6841 __pyx_v_elementOffsets_subdomain_owned = ((PyArrayObject *)values[4]);
6842 __pyx_v_nodeOffsets_subdomain_owned = ((PyArrayObject *)values[5]);
6843 __pyx_v_elementBoundaryOffsets_subdomain_owned = ((PyArrayObject *)values[6]);
6844 __pyx_v_edgeOffsets_subdomain_owned = ((PyArrayObject *)values[7]);
6845 __pyx_v_elementNumbering_subdomain2global = ((PyArrayObject *)values[8]);
6846 __pyx_v_nodeNumbering_subdomain2global = ((PyArrayObject *)values[9]);
6847 __pyx_v_elementBoundaryNumbering_subdomain2global = ((PyArrayObject *)values[10]);
6848 __pyx_v_edgeNumbering_subdomain2global = ((PyArrayObject *)values[11]);
6849 __pyx_v_quadratic_dof_offsets_subdomain_owned = ((PyArrayObject *)values[12]);
6850 __pyx_v_quadratic_subdomain_l2g = ((PyArrayObject *)values[13]);
6851 __pyx_v_quadraticNumbering_subdomain2global = ((PyArrayObject *)values[14]);
6852 __pyx_v_quadratic_lagrangeNodes = ((PyArrayObject *)values[15]);
6854 goto __pyx_L4_argument_unpacking_done;
6855 __pyx_L5_argtuple_error:;
6856 __Pyx_RaiseArgtupleInvalid(
"buildQuadraticCubeLocal2GlobalMappings", 1, 16, 16, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 171, __pyx_L3_error)
6858 __Pyx_AddTraceback(
"cpartitioning.buildQuadraticCubeLocal2GlobalMappings", __pyx_clineno, __pyx_lineno, __pyx_filename);
6859 __Pyx_RefNannyFinishContext();
6861 __pyx_L4_argument_unpacking_done:;
6862 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_comm), __pyx_ptype_6mpi4py_3MPI_Comm, 1,
"comm", 0))) __PYX_ERR(0, 171, __pyx_L1_error)
6863 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_cmesh), __pyx_ptype_7proteus_10cmeshTools_CMesh, 1,
"cmesh", 0))) __PYX_ERR(0, 173, __pyx_L1_error)
6864 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_subdomain_cmesh), __pyx_ptype_7proteus_10cmeshTools_CMesh, 1,
"subdomain_cmesh", 0))) __PYX_ERR(0, 174, __pyx_L1_error)
6865 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_elementOffsets_subdomain_owned), __pyx_ptype_5numpy_ndarray, 1,
"elementOffsets_subdomain_owned", 0))) __PYX_ERR(0, 175, __pyx_L1_error)
6866 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_nodeOffsets_subdomain_owned), __pyx_ptype_5numpy_ndarray, 1,
"nodeOffsets_subdomain_owned", 0))) __PYX_ERR(0, 176, __pyx_L1_error)
6867 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_elementBoundaryOffsets_subdomain_owned), __pyx_ptype_5numpy_ndarray, 1,
"elementBoundaryOffsets_subdomain_owned", 0))) __PYX_ERR(0, 177, __pyx_L1_error)
6868 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_edgeOffsets_subdomain_owned), __pyx_ptype_5numpy_ndarray, 1,
"edgeOffsets_subdomain_owned", 0))) __PYX_ERR(0, 178, __pyx_L1_error)
6869 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_elementNumbering_subdomain2global), __pyx_ptype_5numpy_ndarray, 1,
"elementNumbering_subdomain2global", 0))) __PYX_ERR(0, 179, __pyx_L1_error)
6870 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_nodeNumbering_subdomain2global), __pyx_ptype_5numpy_ndarray, 1,
"nodeNumbering_subdomain2global", 0))) __PYX_ERR(0, 180, __pyx_L1_error)
6871 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_elementBoundaryNumbering_subdomain2global), __pyx_ptype_5numpy_ndarray, 1,
"elementBoundaryNumbering_subdomain2global", 0))) __PYX_ERR(0, 181, __pyx_L1_error)
6872 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_edgeNumbering_subdomain2global), __pyx_ptype_5numpy_ndarray, 1,
"edgeNumbering_subdomain2global", 0))) __PYX_ERR(0, 182, __pyx_L1_error)
6873 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_quadratic_dof_offsets_subdomain_owned), __pyx_ptype_5numpy_ndarray, 1,
"quadratic_dof_offsets_subdomain_owned", 0))) __PYX_ERR(0, 183, __pyx_L1_error)
6874 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_quadratic_subdomain_l2g), __pyx_ptype_5numpy_ndarray, 1,
"quadratic_subdomain_l2g", 0))) __PYX_ERR(0, 184, __pyx_L1_error)
6875 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_quadraticNumbering_subdomain2global), __pyx_ptype_5numpy_ndarray, 1,
"quadraticNumbering_subdomain2global", 0))) __PYX_ERR(0, 185, __pyx_L1_error)
6876 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_quadratic_lagrangeNodes), __pyx_ptype_5numpy_ndarray, 1,
"quadratic_lagrangeNodes", 0))) __PYX_ERR(0, 186, __pyx_L1_error)
6877 __pyx_r = __pyx_pf_13cpartitioning_12buildQuadraticCubeLocal2GlobalMappings(__pyx_self, __pyx_v_comm, __pyx_v_nSpace, __pyx_v_cmesh, __pyx_v_subdomain_cmesh, __pyx_v_elementOffsets_subdomain_owned, __pyx_v_nodeOffsets_subdomain_owned, __pyx_v_elementBoundaryOffsets_subdomain_owned, __pyx_v_edgeOffsets_subdomain_owned, __pyx_v_elementNumbering_subdomain2global, __pyx_v_nodeNumbering_subdomain2global, __pyx_v_elementBoundaryNumbering_subdomain2global, __pyx_v_edgeNumbering_subdomain2global, __pyx_v_quadratic_dof_offsets_subdomain_owned, __pyx_v_quadratic_subdomain_l2g, __pyx_v_quadraticNumbering_subdomain2global, __pyx_v_quadratic_lagrangeNodes);
6884 __Pyx_RefNannyFinishContext();
6888 static PyObject *__pyx_pf_13cpartitioning_12buildQuadraticCubeLocal2GlobalMappings(CYTHON_UNUSED PyObject *__pyx_self,
struct PyMPICommObject *__pyx_v_comm,
int __pyx_v_nSpace,
struct __pyx_obj_7proteus_10cmeshTools_CMesh *__pyx_v_cmesh, CYTHON_UNUSED
struct __pyx_obj_7proteus_10cmeshTools_CMesh *__pyx_v_subdomain_cmesh, CYTHON_UNUSED PyArrayObject *__pyx_v_elementOffsets_subdomain_owned, PyArrayObject *__pyx_v_nodeOffsets_subdomain_owned, CYTHON_UNUSED PyArrayObject *__pyx_v_elementBoundaryOffsets_subdomain_owned, PyArrayObject *__pyx_v_edgeOffsets_subdomain_owned, CYTHON_UNUSED PyArrayObject *__pyx_v_elementNumbering_subdomain2global, PyArrayObject *__pyx_v_nodeNumbering_subdomain2global, CYTHON_UNUSED PyArrayObject *__pyx_v_elementBoundaryNumbering_subdomain2global, PyArrayObject *__pyx_v_edgeNumbering_subdomain2global, PyArrayObject *__pyx_v_quadratic_dof_offsets_subdomain_owned, PyArrayObject *__pyx_v_quadratic_subdomain_l2g, PyArrayObject *__pyx_v_quadraticNumbering_subdomain2global, PyArrayObject *__pyx_v_quadratic_lagrangeNodes) {
6889 int __pyx_v_nDOF_all_processes;
6890 int __pyx_v_nDOF_subdomain;
6891 int __pyx_v_max_dof_neighbors;
6892 PyObject *__pyx_r = NULL;
6893 __Pyx_RefNannyDeclarations
6894 PyObject *__pyx_t_1 = NULL;
6895 PyObject *__pyx_t_2 = NULL;
6896 PyObject *__pyx_t_3 = NULL;
6897 PyObject *__pyx_t_4 = NULL;
6898 int __pyx_lineno = 0;
6899 const char *__pyx_filename = NULL;
6900 int __pyx_clineno = 0;
6901 __Pyx_RefNannySetupContext(
"buildQuadraticCubeLocal2GlobalMappings", 0);
6910 __pyx_v_nDOF_all_processes = 0;
6919 __pyx_v_nDOF_subdomain = 0;
6928 __pyx_v_max_dof_neighbors = 0;
6937 switch (__pyx_v_nSpace) {
6947 #ifndef CYTHON_WITHOUT_ASSERTIONS
6948 if (unlikely(!Py_OptimizeFlag)) {
6950 PyErr_SetObject(PyExc_AssertionError, __pyx_kp_s_buildQuadraticCubeSubdomain2Glob);
6951 __PYX_ERR(0, 191, __pyx_L1_error)
6973 #ifndef CYTHON_WITHOUT_ASSERTIONS
6974 if (unlikely(!Py_OptimizeFlag)) {
6976 PyErr_SetObject(PyExc_AssertionError, __pyx_kp_s_buildQuadraticCubeSubdomain2Glob_2);
6977 __PYX_ERR(0, 193, __pyx_L1_error)
6999 (void)(
proteus::buildQuadraticCubeSubdomain2GlobalMappings_3d(__pyx_v_comm->ob_mpi, __pyx_v_cmesh->mesh, ((
int *)__pyx_v_edgeOffsets_subdomain_owned->data), ((
int *)__pyx_v_nodeOffsets_subdomain_owned->data), ((
int *)__pyx_v_edgeNumbering_subdomain2global->data), ((
int *)__pyx_v_nodeNumbering_subdomain2global->data), __pyx_v_nDOF_all_processes, __pyx_v_nDOF_subdomain, __pyx_v_max_dof_neighbors, ((
int *)__pyx_v_quadratic_dof_offsets_subdomain_owned->data), ((
int *)__pyx_v_quadratic_subdomain_l2g->data), ((
int *)__pyx_v_quadraticNumbering_subdomain2global->data), ((
double *)__pyx_v_quadratic_lagrangeNodes->data)));
7010 __Pyx_XDECREF(__pyx_r);
7011 __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_nDOF_all_processes);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 208, __pyx_L1_error)
7012 __Pyx_GOTREF(__pyx_t_1);
7021 __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_nDOF_subdomain);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 209, __pyx_L1_error)
7022 __Pyx_GOTREF(__pyx_t_2);
7031 __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_max_dof_neighbors);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 210, __pyx_L1_error)
7032 __Pyx_GOTREF(__pyx_t_3);
7041 __pyx_t_4 = PyTuple_New(3);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 208, __pyx_L1_error)
7042 __Pyx_GOTREF(__pyx_t_4);
7043 __Pyx_GIVEREF(__pyx_t_1);
7044 PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_1);
7045 __Pyx_GIVEREF(__pyx_t_2);
7046 PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_2);
7047 __Pyx_GIVEREF(__pyx_t_3);
7048 PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_t_3);
7052 __pyx_r = __pyx_t_4;
7066 __Pyx_XDECREF(__pyx_t_1);
7067 __Pyx_XDECREF(__pyx_t_2);
7068 __Pyx_XDECREF(__pyx_t_3);
7069 __Pyx_XDECREF(__pyx_t_4);
7070 __Pyx_AddTraceback(
"cpartitioning.buildQuadraticCubeLocal2GlobalMappings", __pyx_clineno, __pyx_lineno, __pyx_filename);
7073 __Pyx_XGIVEREF(__pyx_r);
7074 __Pyx_RefNannyFinishContext();
7087 static PyObject *__pyx_pw_13cpartitioning_15buildDiscontinuousGalerkinLocal2GlobalMappings(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
7088 static PyMethodDef __pyx_mdef_13cpartitioning_15buildDiscontinuousGalerkinLocal2GlobalMappings = {
"buildDiscontinuousGalerkinLocal2GlobalMappings", (PyCFunction)(
void*)(PyCFunctionWithKeywords)__pyx_pw_13cpartitioning_15buildDiscontinuousGalerkinLocal2GlobalMappings, METH_VARARGS|METH_KEYWORDS, 0};
7089 static PyObject *__pyx_pw_13cpartitioning_15buildDiscontinuousGalerkinLocal2GlobalMappings(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
7090 struct PyMPICommObject *__pyx_v_comm = 0;
7091 int __pyx_v_nDOF_element;
7092 struct __pyx_obj_7proteus_10cmeshTools_CMesh *__pyx_v_cmesh = 0;
7093 CYTHON_UNUSED
struct __pyx_obj_7proteus_10cmeshTools_CMesh *__pyx_v_subdomain_cmesh = 0;
7094 PyArrayObject *__pyx_v_elementOffsets_subdomain_owned = 0;
7095 PyArrayObject *__pyx_v_elementNumbering_subdomain2global = 0;
7096 PyArrayObject *__pyx_v_dg_dof_offsets_subdomain_owned = 0;
7097 PyArrayObject *__pyx_v_dg_subdomain_l2g = 0;
7098 PyArrayObject *__pyx_v_dgNumbering_subdomain2global = 0;
7099 int __pyx_lineno = 0;
7100 const char *__pyx_filename = NULL;
7101 int __pyx_clineno = 0;
7102 PyObject *__pyx_r = 0;
7103 __Pyx_RefNannyDeclarations
7104 __Pyx_RefNannySetupContext(
"buildDiscontinuousGalerkinLocal2GlobalMappings (wrapper)", 0);
7106 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_comm,&__pyx_n_s_nDOF_element,&__pyx_n_s_cmesh,&__pyx_n_s_subdomain_cmesh,&__pyx_n_s_elementOffsets_subdomain_owned,&__pyx_n_s_elementNumbering_subdomain2globa,&__pyx_n_s_dg_dof_offsets_subdomain_owned,&__pyx_n_s_dg_subdomain_l2g,&__pyx_n_s_dgNumbering_subdomain2global,0};
7107 PyObject* values[9] = {0,0,0,0,0,0,0,0,0};
7108 if (unlikely(__pyx_kwds)) {
7110 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
7112 case 9: values[8] = PyTuple_GET_ITEM(__pyx_args, 8);
7114 case 8: values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
7116 case 7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
7118 case 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
7120 case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
7122 case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
7124 case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
7126 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
7128 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
7131 default:
goto __pyx_L5_argtuple_error;
7133 kw_args = PyDict_Size(__pyx_kwds);
7136 if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_comm)) != 0)) kw_args--;
7137 else goto __pyx_L5_argtuple_error;
7140 if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_nDOF_element)) != 0)) kw_args--;
7142 __Pyx_RaiseArgtupleInvalid(
"buildDiscontinuousGalerkinLocal2GlobalMappings", 1, 9, 9, 1); __PYX_ERR(0, 212, __pyx_L3_error)
7146 if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_cmesh)) != 0)) kw_args--;
7148 __Pyx_RaiseArgtupleInvalid(
"buildDiscontinuousGalerkinLocal2GlobalMappings", 1, 9, 9, 2); __PYX_ERR(0, 212, __pyx_L3_error)
7152 if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_subdomain_cmesh)) != 0)) kw_args--;
7154 __Pyx_RaiseArgtupleInvalid(
"buildDiscontinuousGalerkinLocal2GlobalMappings", 1, 9, 9, 3); __PYX_ERR(0, 212, __pyx_L3_error)
7158 if (likely((values[4] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_elementOffsets_subdomain_owned)) != 0)) kw_args--;
7160 __Pyx_RaiseArgtupleInvalid(
"buildDiscontinuousGalerkinLocal2GlobalMappings", 1, 9, 9, 4); __PYX_ERR(0, 212, __pyx_L3_error)
7164 if (likely((values[5] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_elementNumbering_subdomain2globa)) != 0)) kw_args--;
7166 __Pyx_RaiseArgtupleInvalid(
"buildDiscontinuousGalerkinLocal2GlobalMappings", 1, 9, 9, 5); __PYX_ERR(0, 212, __pyx_L3_error)
7170 if (likely((values[6] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_dg_dof_offsets_subdomain_owned)) != 0)) kw_args--;
7172 __Pyx_RaiseArgtupleInvalid(
"buildDiscontinuousGalerkinLocal2GlobalMappings", 1, 9, 9, 6); __PYX_ERR(0, 212, __pyx_L3_error)
7176 if (likely((values[7] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_dg_subdomain_l2g)) != 0)) kw_args--;
7178 __Pyx_RaiseArgtupleInvalid(
"buildDiscontinuousGalerkinLocal2GlobalMappings", 1, 9, 9, 7); __PYX_ERR(0, 212, __pyx_L3_error)
7182 if (likely((values[8] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_dgNumbering_subdomain2global)) != 0)) kw_args--;
7184 __Pyx_RaiseArgtupleInvalid(
"buildDiscontinuousGalerkinLocal2GlobalMappings", 1, 9, 9, 8); __PYX_ERR(0, 212, __pyx_L3_error)
7187 if (unlikely(kw_args > 0)) {
7188 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args,
"buildDiscontinuousGalerkinLocal2GlobalMappings") < 0)) __PYX_ERR(0, 212, __pyx_L3_error)
7190 }
else if (PyTuple_GET_SIZE(__pyx_args) != 9) {
7191 goto __pyx_L5_argtuple_error;
7193 values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
7194 values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
7195 values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
7196 values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
7197 values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
7198 values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
7199 values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
7200 values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
7201 values[8] = PyTuple_GET_ITEM(__pyx_args, 8);
7203 __pyx_v_comm = ((
struct PyMPICommObject *)values[0]);
7204 __pyx_v_nDOF_element = __Pyx_PyInt_As_int(values[1]);
if (unlikely((__pyx_v_nDOF_element == (
int)-1) && PyErr_Occurred())) __PYX_ERR(0, 213, __pyx_L3_error)
7205 __pyx_v_cmesh = ((
struct __pyx_obj_7proteus_10cmeshTools_CMesh *)values[2]);
7206 __pyx_v_subdomain_cmesh = ((
struct __pyx_obj_7proteus_10cmeshTools_CMesh *)values[3]);
7207 __pyx_v_elementOffsets_subdomain_owned = ((PyArrayObject *)values[4]);
7208 __pyx_v_elementNumbering_subdomain2global = ((PyArrayObject *)values[5]);
7209 __pyx_v_dg_dof_offsets_subdomain_owned = ((PyArrayObject *)values[6]);
7210 __pyx_v_dg_subdomain_l2g = ((PyArrayObject *)values[7]);
7211 __pyx_v_dgNumbering_subdomain2global = ((PyArrayObject *)values[8]);
7213 goto __pyx_L4_argument_unpacking_done;
7214 __pyx_L5_argtuple_error:;
7215 __Pyx_RaiseArgtupleInvalid(
"buildDiscontinuousGalerkinLocal2GlobalMappings", 1, 9, 9, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 212, __pyx_L3_error)
7217 __Pyx_AddTraceback(
"cpartitioning.buildDiscontinuousGalerkinLocal2GlobalMappings", __pyx_clineno, __pyx_lineno, __pyx_filename);
7218 __Pyx_RefNannyFinishContext();
7220 __pyx_L4_argument_unpacking_done:;
7221 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_comm), __pyx_ptype_6mpi4py_3MPI_Comm, 1,
"comm", 0))) __PYX_ERR(0, 212, __pyx_L1_error)
7222 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_cmesh), __pyx_ptype_7proteus_10cmeshTools_CMesh, 1,
"cmesh", 0))) __PYX_ERR(0, 214, __pyx_L1_error)
7223 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_subdomain_cmesh), __pyx_ptype_7proteus_10cmeshTools_CMesh, 1,
"subdomain_cmesh", 0))) __PYX_ERR(0, 215, __pyx_L1_error)
7224 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_elementOffsets_subdomain_owned), __pyx_ptype_5numpy_ndarray, 1,
"elementOffsets_subdomain_owned", 0))) __PYX_ERR(0, 216, __pyx_L1_error)
7225 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_elementNumbering_subdomain2global), __pyx_ptype_5numpy_ndarray, 1,
"elementNumbering_subdomain2global", 0))) __PYX_ERR(0, 217, __pyx_L1_error)
7226 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_dg_dof_offsets_subdomain_owned), __pyx_ptype_5numpy_ndarray, 1,
"dg_dof_offsets_subdomain_owned", 0))) __PYX_ERR(0, 218, __pyx_L1_error)
7227 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_dg_subdomain_l2g), __pyx_ptype_5numpy_ndarray, 1,
"dg_subdomain_l2g", 0))) __PYX_ERR(0, 219, __pyx_L1_error)
7228 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_dgNumbering_subdomain2global), __pyx_ptype_5numpy_ndarray, 1,
"dgNumbering_subdomain2global", 0))) __PYX_ERR(0, 220, __pyx_L1_error)
7229 __pyx_r = __pyx_pf_13cpartitioning_14buildDiscontinuousGalerkinLocal2GlobalMappings(__pyx_self, __pyx_v_comm, __pyx_v_nDOF_element, __pyx_v_cmesh, __pyx_v_subdomain_cmesh, __pyx_v_elementOffsets_subdomain_owned, __pyx_v_elementNumbering_subdomain2global, __pyx_v_dg_dof_offsets_subdomain_owned, __pyx_v_dg_subdomain_l2g, __pyx_v_dgNumbering_subdomain2global);
7236 __Pyx_RefNannyFinishContext();
7240 static PyObject *__pyx_pf_13cpartitioning_14buildDiscontinuousGalerkinLocal2GlobalMappings(CYTHON_UNUSED PyObject *__pyx_self,
struct PyMPICommObject *__pyx_v_comm,
int __pyx_v_nDOF_element,
struct __pyx_obj_7proteus_10cmeshTools_CMesh *__pyx_v_cmesh, CYTHON_UNUSED
struct __pyx_obj_7proteus_10cmeshTools_CMesh *__pyx_v_subdomain_cmesh, PyArrayObject *__pyx_v_elementOffsets_subdomain_owned, PyArrayObject *__pyx_v_elementNumbering_subdomain2global, PyArrayObject *__pyx_v_dg_dof_offsets_subdomain_owned, PyArrayObject *__pyx_v_dg_subdomain_l2g, PyArrayObject *__pyx_v_dgNumbering_subdomain2global) {
7241 int __pyx_v_nDOF_all_processes;
7242 int __pyx_v_nDOF_subdomain;
7243 int __pyx_v_max_dof_neighbors;
7244 PyObject *__pyx_r = NULL;
7245 __Pyx_RefNannyDeclarations
7246 PyObject *__pyx_t_1 = NULL;
7247 PyObject *__pyx_t_2 = NULL;
7248 PyObject *__pyx_t_3 = NULL;
7249 PyObject *__pyx_t_4 = NULL;
7250 int __pyx_lineno = 0;
7251 const char *__pyx_filename = NULL;
7252 int __pyx_clineno = 0;
7253 __Pyx_RefNannySetupContext(
"buildDiscontinuousGalerkinLocal2GlobalMappings", 0);
7262 __pyx_v_nDOF_all_processes = 0;
7271 __pyx_v_nDOF_subdomain = 0;
7280 __pyx_v_max_dof_neighbors = 0;
7289 (void)(
proteus::buildDiscontinuousGalerkinSubdomain2GlobalMappings(__pyx_v_comm->ob_mpi, __pyx_v_cmesh->mesh, ((
int *)__pyx_v_elementOffsets_subdomain_owned->data), ((
int *)__pyx_v_elementNumbering_subdomain2global->data), __pyx_v_nDOF_element, __pyx_v_nDOF_all_processes, __pyx_v_nDOF_subdomain, __pyx_v_max_dof_neighbors, ((
int *)__pyx_v_dg_dof_offsets_subdomain_owned->data), ((
int *)__pyx_v_dg_subdomain_l2g->data), ((
int *)__pyx_v_dgNumbering_subdomain2global->data)));
7298 __Pyx_XDECREF(__pyx_r);
7299 __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_nDOF_all_processes);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 235, __pyx_L1_error)
7300 __Pyx_GOTREF(__pyx_t_1);
7308 __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_nDOF_subdomain);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 236, __pyx_L1_error)
7309 __Pyx_GOTREF(__pyx_t_2);
7316 __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_max_dof_neighbors);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 237, __pyx_L1_error)
7317 __Pyx_GOTREF(__pyx_t_3);
7326 __pyx_t_4 = PyTuple_New(3);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 235, __pyx_L1_error)
7327 __Pyx_GOTREF(__pyx_t_4);
7328 __Pyx_GIVEREF(__pyx_t_1);
7329 PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_1);
7330 __Pyx_GIVEREF(__pyx_t_2);
7331 PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_2);
7332 __Pyx_GIVEREF(__pyx_t_3);
7333 PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_t_3);
7337 __pyx_r = __pyx_t_4;
7351 __Pyx_XDECREF(__pyx_t_1);
7352 __Pyx_XDECREF(__pyx_t_2);
7353 __Pyx_XDECREF(__pyx_t_3);
7354 __Pyx_XDECREF(__pyx_t_4);
7355 __Pyx_AddTraceback(
"cpartitioning.buildDiscontinuousGalerkinLocal2GlobalMappings", __pyx_clineno, __pyx_lineno, __pyx_filename);
7358 __Pyx_XGIVEREF(__pyx_r);
7359 __Pyx_RefNannyFinishContext();
7371 static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew1(PyObject *__pyx_v_a) {
7372 PyObject *__pyx_r = NULL;
7373 __Pyx_RefNannyDeclarations
7374 PyObject *__pyx_t_1 = NULL;
7375 int __pyx_lineno = 0;
7376 const char *__pyx_filename = NULL;
7377 int __pyx_clineno = 0;
7378 __Pyx_RefNannySetupContext(
"PyArray_MultiIterNew1", 0);
7387 __Pyx_XDECREF(__pyx_r);
7388 __pyx_t_1 = PyArray_MultiIterNew(1, ((
void *)__pyx_v_a));
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 736, __pyx_L1_error)
7389 __Pyx_GOTREF(__pyx_t_1);
7390 __pyx_r = __pyx_t_1;
7404 __Pyx_XDECREF(__pyx_t_1);
7405 __Pyx_AddTraceback(
"numpy.PyArray_MultiIterNew1", __pyx_clineno, __pyx_lineno, __pyx_filename);
7408 __Pyx_XGIVEREF(__pyx_r);
7409 __Pyx_RefNannyFinishContext();
7421 static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew2(PyObject *__pyx_v_a, PyObject *__pyx_v_b) {
7422 PyObject *__pyx_r = NULL;
7423 __Pyx_RefNannyDeclarations
7424 PyObject *__pyx_t_1 = NULL;
7425 int __pyx_lineno = 0;
7426 const char *__pyx_filename = NULL;
7427 int __pyx_clineno = 0;
7428 __Pyx_RefNannySetupContext(
"PyArray_MultiIterNew2", 0);
7437 __Pyx_XDECREF(__pyx_r);
7438 __pyx_t_1 = PyArray_MultiIterNew(2, ((
void *)__pyx_v_a), ((
void *)__pyx_v_b));
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 739, __pyx_L1_error)
7439 __Pyx_GOTREF(__pyx_t_1);
7440 __pyx_r = __pyx_t_1;
7454 __Pyx_XDECREF(__pyx_t_1);
7455 __Pyx_AddTraceback(
"numpy.PyArray_MultiIterNew2", __pyx_clineno, __pyx_lineno, __pyx_filename);
7458 __Pyx_XGIVEREF(__pyx_r);
7459 __Pyx_RefNannyFinishContext();
7471 static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew3(PyObject *__pyx_v_a, PyObject *__pyx_v_b, PyObject *__pyx_v_c) {
7472 PyObject *__pyx_r = NULL;
7473 __Pyx_RefNannyDeclarations
7474 PyObject *__pyx_t_1 = NULL;
7475 int __pyx_lineno = 0;
7476 const char *__pyx_filename = NULL;
7477 int __pyx_clineno = 0;
7478 __Pyx_RefNannySetupContext(
"PyArray_MultiIterNew3", 0);
7487 __Pyx_XDECREF(__pyx_r);
7488 __pyx_t_1 = PyArray_MultiIterNew(3, ((
void *)__pyx_v_a), ((
void *)__pyx_v_b), ((
void *)__pyx_v_c));
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 742, __pyx_L1_error)
7489 __Pyx_GOTREF(__pyx_t_1);
7490 __pyx_r = __pyx_t_1;
7504 __Pyx_XDECREF(__pyx_t_1);
7505 __Pyx_AddTraceback(
"numpy.PyArray_MultiIterNew3", __pyx_clineno, __pyx_lineno, __pyx_filename);
7508 __Pyx_XGIVEREF(__pyx_r);
7509 __Pyx_RefNannyFinishContext();
7521 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) {
7522 PyObject *__pyx_r = NULL;
7523 __Pyx_RefNannyDeclarations
7524 PyObject *__pyx_t_1 = NULL;
7525 int __pyx_lineno = 0;
7526 const char *__pyx_filename = NULL;
7527 int __pyx_clineno = 0;
7528 __Pyx_RefNannySetupContext(
"PyArray_MultiIterNew4", 0);
7537 __Pyx_XDECREF(__pyx_r);
7538 __pyx_t_1 = PyArray_MultiIterNew(4, ((
void *)__pyx_v_a), ((
void *)__pyx_v_b), ((
void *)__pyx_v_c), ((
void *)__pyx_v_d));
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 745, __pyx_L1_error)
7539 __Pyx_GOTREF(__pyx_t_1);
7540 __pyx_r = __pyx_t_1;
7554 __Pyx_XDECREF(__pyx_t_1);
7555 __Pyx_AddTraceback(
"numpy.PyArray_MultiIterNew4", __pyx_clineno, __pyx_lineno, __pyx_filename);
7558 __Pyx_XGIVEREF(__pyx_r);
7559 __Pyx_RefNannyFinishContext();
7571 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) {
7572 PyObject *__pyx_r = NULL;
7573 __Pyx_RefNannyDeclarations
7574 PyObject *__pyx_t_1 = NULL;
7575 int __pyx_lineno = 0;
7576 const char *__pyx_filename = NULL;
7577 int __pyx_clineno = 0;
7578 __Pyx_RefNannySetupContext(
"PyArray_MultiIterNew5", 0);
7587 __Pyx_XDECREF(__pyx_r);
7588 __pyx_t_1 = PyArray_MultiIterNew(5, ((
void *)__pyx_v_a), ((
void *)__pyx_v_b), ((
void *)__pyx_v_c), ((
void *)__pyx_v_d), ((
void *)__pyx_v_e));
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 748, __pyx_L1_error)
7589 __Pyx_GOTREF(__pyx_t_1);
7590 __pyx_r = __pyx_t_1;
7604 __Pyx_XDECREF(__pyx_t_1);
7605 __Pyx_AddTraceback(
"numpy.PyArray_MultiIterNew5", __pyx_clineno, __pyx_lineno, __pyx_filename);
7608 __Pyx_XGIVEREF(__pyx_r);
7609 __Pyx_RefNannyFinishContext();
7621 static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyDataType_SHAPE(PyArray_Descr *__pyx_v_d) {
7622 PyObject *__pyx_r = NULL;
7623 __Pyx_RefNannyDeclarations
7625 __Pyx_RefNannySetupContext(
"PyDataType_SHAPE", 0);
7634 __pyx_t_1 = (PyDataType_HASSUBARRAY(__pyx_v_d) != 0);
7644 __Pyx_XDECREF(__pyx_r);
7645 __Pyx_INCREF(((PyObject*)__pyx_v_d->subarray->shape));
7646 __pyx_r = ((PyObject*)__pyx_v_d->subarray->shape);
7666 __Pyx_XDECREF(__pyx_r);
7667 __Pyx_INCREF(__pyx_empty_tuple);
7668 __pyx_r = __pyx_empty_tuple;
7682 __Pyx_XGIVEREF(__pyx_r);
7683 __Pyx_RefNannyFinishContext();
7695 static CYTHON_INLINE
void __pyx_f_5numpy_set_array_base(PyArrayObject *__pyx_v_arr, PyObject *__pyx_v_base) {
7696 __Pyx_RefNannyDeclarations
7697 __Pyx_RefNannySetupContext(
"set_array_base", 0);
7706 Py_INCREF(__pyx_v_base);
7715 (void)(PyArray_SetBaseObject(__pyx_v_arr, __pyx_v_base));
7726 __Pyx_RefNannyFinishContext();
7737 static CYTHON_INLINE PyObject *__pyx_f_5numpy_get_array_base(PyArrayObject *__pyx_v_arr) {
7738 PyObject *__pyx_v_base;
7739 PyObject *__pyx_r = NULL;
7740 __Pyx_RefNannyDeclarations
7742 __Pyx_RefNannySetupContext(
"get_array_base", 0);
7751 __pyx_v_base = PyArray_BASE(__pyx_v_arr);
7760 __pyx_t_1 = ((__pyx_v_base == NULL) != 0);
7770 __Pyx_XDECREF(__pyx_r);
7771 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
7790 __Pyx_XDECREF(__pyx_r);
7791 __Pyx_INCREF(((PyObject *)__pyx_v_base));
7792 __pyx_r = ((PyObject *)__pyx_v_base);
7805 __Pyx_XGIVEREF(__pyx_r);
7806 __Pyx_RefNannyFinishContext();
7818 static CYTHON_INLINE
int __pyx_f_5numpy_import_array(
void) {
7820 __Pyx_RefNannyDeclarations
7821 PyObject *__pyx_t_1 = NULL;
7822 PyObject *__pyx_t_2 = NULL;
7823 PyObject *__pyx_t_3 = NULL;
7825 PyObject *__pyx_t_5 = NULL;
7826 PyObject *__pyx_t_6 = NULL;
7827 PyObject *__pyx_t_7 = NULL;
7828 PyObject *__pyx_t_8 = NULL;
7829 int __pyx_lineno = 0;
7830 const char *__pyx_filename = NULL;
7831 int __pyx_clineno = 0;
7832 __Pyx_RefNannySetupContext(
"import_array", 0);
7842 __Pyx_PyThreadState_declare
7843 __Pyx_PyThreadState_assign
7844 __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
7845 __Pyx_XGOTREF(__pyx_t_1);
7846 __Pyx_XGOTREF(__pyx_t_2);
7847 __Pyx_XGOTREF(__pyx_t_3);
7857 __pyx_t_4 = _import_array();
if (unlikely(__pyx_t_4 == ((
int)-1))) __PYX_ERR(1, 943, __pyx_L3_error)
7867 __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
7868 __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
7869 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
7870 goto __pyx_L8_try_end;
7880 __pyx_t_4 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0])));
7882 __Pyx_AddTraceback(
"numpy.import_array", __pyx_clineno, __pyx_lineno, __pyx_filename);
7883 if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(1, 944, __pyx_L5_except_error)
7884 __Pyx_GOTREF(__pyx_t_5);
7885 __Pyx_GOTREF(__pyx_t_6);
7886 __Pyx_GOTREF(__pyx_t_7);
7895 __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_ImportError, __pyx_tuple_, NULL);
if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 945, __pyx_L5_except_error)
7896 __Pyx_GOTREF(__pyx_t_8);
7897 __Pyx_Raise(__pyx_t_8, 0, 0, 0);
7898 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
7899 __PYX_ERR(1, 945, __pyx_L5_except_error)
7901 goto __pyx_L5_except_error;
7902 __pyx_L5_except_error:;
7911 __Pyx_XGIVEREF(__pyx_t_1);
7912 __Pyx_XGIVEREF(__pyx_t_2);
7913 __Pyx_XGIVEREF(__pyx_t_3);
7914 __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
7915 goto __pyx_L1_error;
7931 __Pyx_XDECREF(__pyx_t_5);
7932 __Pyx_XDECREF(__pyx_t_6);
7933 __Pyx_XDECREF(__pyx_t_7);
7934 __Pyx_XDECREF(__pyx_t_8);
7935 __Pyx_AddTraceback(
"numpy.import_array", __pyx_clineno, __pyx_lineno, __pyx_filename);
7938 __Pyx_RefNannyFinishContext();
7950 static CYTHON_INLINE
int __pyx_f_5numpy_import_umath(
void) {
7952 __Pyx_RefNannyDeclarations
7953 PyObject *__pyx_t_1 = NULL;
7954 PyObject *__pyx_t_2 = NULL;
7955 PyObject *__pyx_t_3 = NULL;
7957 PyObject *__pyx_t_5 = NULL;
7958 PyObject *__pyx_t_6 = NULL;
7959 PyObject *__pyx_t_7 = NULL;
7960 PyObject *__pyx_t_8 = NULL;
7961 int __pyx_lineno = 0;
7962 const char *__pyx_filename = NULL;
7963 int __pyx_clineno = 0;
7964 __Pyx_RefNannySetupContext(
"import_umath", 0);
7974 __Pyx_PyThreadState_declare
7975 __Pyx_PyThreadState_assign
7976 __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
7977 __Pyx_XGOTREF(__pyx_t_1);
7978 __Pyx_XGOTREF(__pyx_t_2);
7979 __Pyx_XGOTREF(__pyx_t_3);
7989 __pyx_t_4 = _import_umath();
if (unlikely(__pyx_t_4 == ((
int)-1))) __PYX_ERR(1, 949, __pyx_L3_error)
7999 __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
8000 __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
8001 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
8002 goto __pyx_L8_try_end;
8012 __pyx_t_4 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0])));
8014 __Pyx_AddTraceback(
"numpy.import_umath", __pyx_clineno, __pyx_lineno, __pyx_filename);
8015 if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(1, 950, __pyx_L5_except_error)
8016 __Pyx_GOTREF(__pyx_t_5);
8017 __Pyx_GOTREF(__pyx_t_6);
8018 __Pyx_GOTREF(__pyx_t_7);
8027 __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_ImportError, __pyx_tuple__2, NULL);
if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 951, __pyx_L5_except_error)
8028 __Pyx_GOTREF(__pyx_t_8);
8029 __Pyx_Raise(__pyx_t_8, 0, 0, 0);
8030 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
8031 __PYX_ERR(1, 951, __pyx_L5_except_error)
8033 goto __pyx_L5_except_error;
8034 __pyx_L5_except_error:;
8043 __Pyx_XGIVEREF(__pyx_t_1);
8044 __Pyx_XGIVEREF(__pyx_t_2);
8045 __Pyx_XGIVEREF(__pyx_t_3);
8046 __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
8047 goto __pyx_L1_error;
8063 __Pyx_XDECREF(__pyx_t_5);
8064 __Pyx_XDECREF(__pyx_t_6);
8065 __Pyx_XDECREF(__pyx_t_7);
8066 __Pyx_XDECREF(__pyx_t_8);
8067 __Pyx_AddTraceback(
"numpy.import_umath", __pyx_clineno, __pyx_lineno, __pyx_filename);
8070 __Pyx_RefNannyFinishContext();
8082 static CYTHON_INLINE
int __pyx_f_5numpy_import_ufunc(
void) {
8084 __Pyx_RefNannyDeclarations
8085 PyObject *__pyx_t_1 = NULL;
8086 PyObject *__pyx_t_2 = NULL;
8087 PyObject *__pyx_t_3 = NULL;
8089 PyObject *__pyx_t_5 = NULL;
8090 PyObject *__pyx_t_6 = NULL;
8091 PyObject *__pyx_t_7 = NULL;
8092 PyObject *__pyx_t_8 = NULL;
8093 int __pyx_lineno = 0;
8094 const char *__pyx_filename = NULL;
8095 int __pyx_clineno = 0;
8096 __Pyx_RefNannySetupContext(
"import_ufunc", 0);
8106 __Pyx_PyThreadState_declare
8107 __Pyx_PyThreadState_assign
8108 __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
8109 __Pyx_XGOTREF(__pyx_t_1);
8110 __Pyx_XGOTREF(__pyx_t_2);
8111 __Pyx_XGOTREF(__pyx_t_3);
8121 __pyx_t_4 = _import_umath();
if (unlikely(__pyx_t_4 == ((
int)-1))) __PYX_ERR(1, 955, __pyx_L3_error)
8131 __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
8132 __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
8133 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
8134 goto __pyx_L8_try_end;
8144 __pyx_t_4 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0])));
8146 __Pyx_AddTraceback(
"numpy.import_ufunc", __pyx_clineno, __pyx_lineno, __pyx_filename);
8147 if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(1, 956, __pyx_L5_except_error)
8148 __Pyx_GOTREF(__pyx_t_5);
8149 __Pyx_GOTREF(__pyx_t_6);
8150 __Pyx_GOTREF(__pyx_t_7);
8159 __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_ImportError, __pyx_tuple__2, NULL);
if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 957, __pyx_L5_except_error)
8160 __Pyx_GOTREF(__pyx_t_8);
8161 __Pyx_Raise(__pyx_t_8, 0, 0, 0);
8162 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
8163 __PYX_ERR(1, 957, __pyx_L5_except_error)
8165 goto __pyx_L5_except_error;
8166 __pyx_L5_except_error:;
8175 __Pyx_XGIVEREF(__pyx_t_1);
8176 __Pyx_XGIVEREF(__pyx_t_2);
8177 __Pyx_XGIVEREF(__pyx_t_3);
8178 __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
8179 goto __pyx_L1_error;
8195 __Pyx_XDECREF(__pyx_t_5);
8196 __Pyx_XDECREF(__pyx_t_6);
8197 __Pyx_XDECREF(__pyx_t_7);
8198 __Pyx_XDECREF(__pyx_t_8);
8199 __Pyx_AddTraceback(
"numpy.import_ufunc", __pyx_clineno, __pyx_lineno, __pyx_filename);
8202 __Pyx_RefNannyFinishContext();
8214 static CYTHON_INLINE
int __pyx_f_5numpy_is_timedelta64_object(PyObject *__pyx_v_obj) {
8216 __Pyx_RefNannyDeclarations
8217 __Pyx_RefNannySetupContext(
"is_timedelta64_object", 0);
8226 __pyx_r = PyObject_TypeCheck(__pyx_v_obj, (&PyTimedeltaArrType_Type));
8239 __Pyx_RefNannyFinishContext();
8251 static CYTHON_INLINE
int __pyx_f_5numpy_is_datetime64_object(PyObject *__pyx_v_obj) {
8253 __Pyx_RefNannyDeclarations
8254 __Pyx_RefNannySetupContext(
"is_datetime64_object", 0);
8263 __pyx_r = PyObject_TypeCheck(__pyx_v_obj, (&PyDatetimeArrType_Type));
8276 __Pyx_RefNannyFinishContext();
8288 static CYTHON_INLINE npy_datetime __pyx_f_5numpy_get_datetime64_value(PyObject *__pyx_v_obj) {
8289 npy_datetime __pyx_r;
8298 __pyx_r = ((PyDatetimeScalarObject *)__pyx_v_obj)->obval;
8322 static CYTHON_INLINE npy_timedelta __pyx_f_5numpy_get_timedelta64_value(PyObject *__pyx_v_obj) {
8323 npy_timedelta __pyx_r;
8332 __pyx_r = ((PyTimedeltaScalarObject *)__pyx_v_obj)->obval;
8356 static CYTHON_INLINE NPY_DATETIMEUNIT __pyx_f_5numpy_get_datetime64_unit(PyObject *__pyx_v_obj) {
8357 NPY_DATETIMEUNIT __pyx_r;
8364 __pyx_r = ((NPY_DATETIMEUNIT)((PyDatetimeScalarObject *)__pyx_v_obj)->obmeta.base);
8389 static int __pyx_array___cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
8390 static int __pyx_array___cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
8391 PyObject *__pyx_v_shape = 0;
8392 Py_ssize_t __pyx_v_itemsize;
8393 PyObject *__pyx_v_format = 0;
8394 PyObject *__pyx_v_mode = 0;
8395 int __pyx_v_allocate_buffer;
8396 int __pyx_lineno = 0;
8397 const char *__pyx_filename = NULL;
8398 int __pyx_clineno = 0;
8400 __Pyx_RefNannyDeclarations
8401 __Pyx_RefNannySetupContext(
"__cinit__ (wrapper)", 0);
8403 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};
8404 PyObject* values[5] = {0,0,0,0,0};
8405 values[3] = ((PyObject *)__pyx_n_s_c);
8406 if (unlikely(__pyx_kwds)) {
8408 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
8410 case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
8412 case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
8414 case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
8416 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
8418 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
8421 default:
goto __pyx_L5_argtuple_error;
8423 kw_args = PyDict_Size(__pyx_kwds);
8426 if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_shape)) != 0)) kw_args--;
8427 else goto __pyx_L5_argtuple_error;
8430 if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_itemsize)) != 0)) kw_args--;
8432 __Pyx_RaiseArgtupleInvalid(
"__cinit__", 0, 3, 5, 1); __PYX_ERR(2, 122, __pyx_L3_error)
8436 if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_format)) != 0)) kw_args--;
8438 __Pyx_RaiseArgtupleInvalid(
"__cinit__", 0, 3, 5, 2); __PYX_ERR(2, 122, __pyx_L3_error)
8443 PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_mode);
8444 if (value) { values[3] = value; kw_args--; }
8449 PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_allocate_buffer);
8450 if (value) { values[4] = value; kw_args--; }
8453 if (unlikely(kw_args > 0)) {
8454 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args,
"__cinit__") < 0)) __PYX_ERR(2, 122, __pyx_L3_error)
8457 switch (PyTuple_GET_SIZE(__pyx_args)) {
8458 case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
8460 case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
8462 case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
8463 values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
8464 values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
8466 default:
goto __pyx_L5_argtuple_error;
8469 __pyx_v_shape = ((PyObject*)values[0]);
8470 __pyx_v_itemsize = __Pyx_PyIndex_AsSsize_t(values[1]);
if (unlikely((__pyx_v_itemsize == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(2, 122, __pyx_L3_error)
8471 __pyx_v_format = values[2];
8472 __pyx_v_mode = values[3];
8474 __pyx_v_allocate_buffer = __Pyx_PyObject_IsTrue(values[4]);
if (unlikely((__pyx_v_allocate_buffer == (
int)-1) && PyErr_Occurred())) __PYX_ERR(2, 123, __pyx_L3_error)
8484 __pyx_v_allocate_buffer = ((int)1);
8487 goto __pyx_L4_argument_unpacking_done;
8488 __pyx_L5_argtuple_error:;
8489 __Pyx_RaiseArgtupleInvalid(
"__cinit__", 0, 3, 5, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(2, 122, __pyx_L3_error)
8491 __Pyx_AddTraceback(
"View.MemoryView.array.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
8492 __Pyx_RefNannyFinishContext();
8494 __pyx_L4_argument_unpacking_done:;
8495 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_shape), (&PyTuple_Type), 1,
"shape", 1))) __PYX_ERR(2, 122, __pyx_L1_error)
8496 if (unlikely(((PyObject *)__pyx_v_format) == Py_None)) {
8497 PyErr_Format(PyExc_TypeError,
"Argument '%.200s' must not be None",
"format"); __PYX_ERR(2, 122, __pyx_L1_error)
8499 __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);
8514 __Pyx_RefNannyFinishContext();
8518 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) {
8520 Py_ssize_t __pyx_v_i;
8521 Py_ssize_t __pyx_v_dim;
8522 PyObject **__pyx_v_p;
8525 __Pyx_RefNannyDeclarations
8526 Py_ssize_t __pyx_t_1;
8528 PyObject *__pyx_t_3 = NULL;
8530 PyObject *__pyx_t_5 = NULL;
8531 PyObject *__pyx_t_6 = NULL;
8534 Py_ssize_t __pyx_t_9;
8535 PyObject *__pyx_t_10 = NULL;
8536 Py_ssize_t __pyx_t_11;
8537 int __pyx_lineno = 0;
8538 const char *__pyx_filename = NULL;
8539 int __pyx_clineno = 0;
8540 __Pyx_RefNannySetupContext(
"__cinit__", 0);
8541 __Pyx_INCREF(__pyx_v_format);
8550 if (unlikely(__pyx_v_shape == Py_None)) {
8551 PyErr_SetString(PyExc_TypeError,
"object of type 'NoneType' has no len()");
8552 __PYX_ERR(2, 129, __pyx_L1_error)
8554 __pyx_t_1 = PyTuple_GET_SIZE(__pyx_v_shape);
if (unlikely(__pyx_t_1 == ((Py_ssize_t)-1))) __PYX_ERR(2, 129, __pyx_L1_error)
8555 __pyx_v_self->ndim = ((int)__pyx_t_1);
8564 __pyx_v_self->itemsize = __pyx_v_itemsize;
8573 __pyx_t_2 = ((!(__pyx_v_self->ndim != 0)) != 0);
8574 if (unlikely(__pyx_t_2)) {
8583 __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__3, NULL);
if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 133, __pyx_L1_error)
8584 __Pyx_GOTREF(__pyx_t_3);
8585 __Pyx_Raise(__pyx_t_3, 0, 0, 0);
8586 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
8587 __PYX_ERR(2, 133, __pyx_L1_error)
8605 __pyx_t_2 = ((__pyx_v_itemsize <= 0) != 0);
8606 if (unlikely(__pyx_t_2)) {
8615 __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__4, NULL);
if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 136, __pyx_L1_error)
8616 __Pyx_GOTREF(__pyx_t_3);
8617 __Pyx_Raise(__pyx_t_3, 0, 0, 0);
8618 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
8619 __PYX_ERR(2, 136, __pyx_L1_error)
8637 __pyx_t_2 = PyBytes_Check(__pyx_v_format);
8638 __pyx_t_4 = ((!(__pyx_t_2 != 0)) != 0);
8648 __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_format, __pyx_n_s_encode);
if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 139, __pyx_L1_error)
8649 __Pyx_GOTREF(__pyx_t_5);
8651 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) {
8652 __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5);
8653 if (likely(__pyx_t_6)) {
8654 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_5);
8655 __Pyx_INCREF(__pyx_t_6);
8656 __Pyx_INCREF(
function);
8657 __Pyx_DECREF_SET(__pyx_t_5,
function);
8660 __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);
8661 __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
8662 if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 139, __pyx_L1_error)
8663 __Pyx_GOTREF(__pyx_t_3);
8664 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
8665 __Pyx_DECREF_SET(__pyx_v_format, __pyx_t_3);
8684 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(2, 140, __pyx_L1_error)
8685 __pyx_t_3 = __pyx_v_format;
8686 __Pyx_INCREF(__pyx_t_3);
8687 __Pyx_GIVEREF(__pyx_t_3);
8688 __Pyx_GOTREF(__pyx_v_self->_format);
8689 __Pyx_DECREF(__pyx_v_self->_format);
8690 __pyx_v_self->_format = ((PyObject*)__pyx_t_3);
8700 if (unlikely(__pyx_v_self->_format == Py_None)) {
8701 PyErr_SetString(PyExc_TypeError,
"expected bytes, NoneType found");
8702 __PYX_ERR(2, 141, __pyx_L1_error)
8704 __pyx_t_7 = __Pyx_PyBytes_AsWritableString(__pyx_v_self->_format);
if (unlikely((!__pyx_t_7) && PyErr_Occurred())) __PYX_ERR(2, 141, __pyx_L1_error)
8705 __pyx_v_self->format = __pyx_t_7;
8714 __pyx_v_self->_shape = ((Py_ssize_t *)PyObject_Malloc((((
sizeof(Py_ssize_t)) * __pyx_v_self->ndim) * 2)));
8723 __pyx_v_self->_strides = (__pyx_v_self->_shape + __pyx_v_self->ndim);
8732 __pyx_t_4 = ((!(__pyx_v_self->_shape != 0)) != 0);
8733 if (unlikely(__pyx_t_4)) {
8742 __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_MemoryError, __pyx_tuple__5, NULL);
if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 148, __pyx_L1_error)
8743 __Pyx_GOTREF(__pyx_t_3);
8744 __Pyx_Raise(__pyx_t_3, 0, 0, 0);
8745 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
8746 __PYX_ERR(2, 148, __pyx_L1_error)
8765 __pyx_t_3 = __pyx_v_shape; __Pyx_INCREF(__pyx_t_3); __pyx_t_1 = 0;
8767 if (__pyx_t_1 >= PyTuple_GET_SIZE(__pyx_t_3))
break;
8768 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
8769 __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(2, 151, __pyx_L1_error)
8771 __pyx_t_5 = PySequence_ITEM(__pyx_t_3, __pyx_t_1); __pyx_t_1++;
if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 151, __pyx_L1_error)
8772 __Pyx_GOTREF(__pyx_t_5);
8774 __pyx_t_9 = __Pyx_PyIndex_AsSsize_t(__pyx_t_5);
if (unlikely((__pyx_t_9 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(2, 151, __pyx_L1_error)
8775 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
8776 __pyx_v_dim = __pyx_t_9;
8777 __pyx_v_idx = __pyx_t_8;
8778 __pyx_t_8 = (__pyx_t_8 + 1);
8787 __pyx_t_4 = ((__pyx_v_dim <= 0) != 0);
8788 if (unlikely(__pyx_t_4)) {
8797 __pyx_t_5 = __Pyx_PyInt_From_int(__pyx_v_idx);
if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 153, __pyx_L1_error)
8798 __Pyx_GOTREF(__pyx_t_5);
8799 __pyx_t_6 = PyInt_FromSsize_t(__pyx_v_dim);
if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 153, __pyx_L1_error)
8800 __Pyx_GOTREF(__pyx_t_6);
8801 __pyx_t_10 = PyTuple_New(2);
if (unlikely(!__pyx_t_10)) __PYX_ERR(2, 153, __pyx_L1_error)
8802 __Pyx_GOTREF(__pyx_t_10);
8803 __Pyx_GIVEREF(__pyx_t_5);
8804 PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_5);
8805 __Pyx_GIVEREF(__pyx_t_6);
8806 PyTuple_SET_ITEM(__pyx_t_10, 1, __pyx_t_6);
8809 __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(2, 153, __pyx_L1_error)
8810 __Pyx_GOTREF(__pyx_t_6);
8811 __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
8812 __pyx_t_10 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_6);
if (unlikely(!__pyx_t_10)) __PYX_ERR(2, 153, __pyx_L1_error)
8813 __Pyx_GOTREF(__pyx_t_10);
8814 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
8815 __Pyx_Raise(__pyx_t_10, 0, 0, 0);
8816 __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
8817 __PYX_ERR(2, 153, __pyx_L1_error)
8835 (__pyx_v_self->_shape[__pyx_v_idx]) = __pyx_v_dim;
8845 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
8854 __pyx_t_4 = (__Pyx_PyString_Equals(__pyx_v_mode, __pyx_n_s_fortran, Py_EQ));
if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(2, 157, __pyx_L1_error)
8864 __pyx_v_order =
'F';
8873 __Pyx_INCREF(__pyx_n_u_fortran);
8874 __Pyx_GIVEREF(__pyx_n_u_fortran);
8875 __Pyx_GOTREF(__pyx_v_self->mode);
8876 __Pyx_DECREF(__pyx_v_self->mode);
8877 __pyx_v_self->mode = __pyx_n_u_fortran;
8896 __pyx_t_4 = (__Pyx_PyString_Equals(__pyx_v_mode, __pyx_n_s_c, Py_EQ));
if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(2, 160, __pyx_L1_error)
8897 if (likely(__pyx_t_4)) {
8906 __pyx_v_order =
'C';
8915 __Pyx_INCREF(__pyx_n_u_c);
8916 __Pyx_GIVEREF(__pyx_n_u_c);
8917 __Pyx_GOTREF(__pyx_v_self->mode);
8918 __Pyx_DECREF(__pyx_v_self->mode);
8919 __pyx_v_self->mode = __pyx_n_u_c;
8939 __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(2, 164, __pyx_L1_error)
8940 __Pyx_GOTREF(__pyx_t_3);
8941 __pyx_t_10 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_3);
if (unlikely(!__pyx_t_10)) __PYX_ERR(2, 164, __pyx_L1_error)
8942 __Pyx_GOTREF(__pyx_t_10);
8943 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
8944 __Pyx_Raise(__pyx_t_10, 0, 0, 0);
8945 __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
8946 __PYX_ERR(2, 164, __pyx_L1_error)
8957 __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);
8966 __pyx_v_self->free_data = __pyx_v_allocate_buffer;
8975 __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(2, 170, __pyx_L1_error)
8976 __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_10);
if (unlikely((__pyx_t_4 == (
int)-1) && PyErr_Occurred())) __PYX_ERR(2, 170, __pyx_L1_error)
8977 __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
8978 __pyx_v_self->dtype_is_object = __pyx_t_4;
8987 __pyx_t_4 = (__pyx_v_allocate_buffer != 0);
8997 __pyx_v_self->data = ((
char *)malloc(__pyx_v_self->len));
9006 __pyx_t_4 = ((!(__pyx_v_self->data != 0)) != 0);
9007 if (unlikely(__pyx_t_4)) {
9016 __pyx_t_10 = __Pyx_PyObject_Call(__pyx_builtin_MemoryError, __pyx_tuple__6, NULL);
if (unlikely(!__pyx_t_10)) __PYX_ERR(2, 176, __pyx_L1_error)
9017 __Pyx_GOTREF(__pyx_t_10);
9018 __Pyx_Raise(__pyx_t_10, 0, 0, 0);
9019 __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
9020 __PYX_ERR(2, 176, __pyx_L1_error)
9038 __pyx_t_4 = (__pyx_v_self->dtype_is_object != 0);
9048 __pyx_v_p = ((PyObject **)__pyx_v_self->data);
9057 if (unlikely(__pyx_v_itemsize == 0)) {
9058 PyErr_SetString(PyExc_ZeroDivisionError,
"integer division or modulo by zero");
9059 __PYX_ERR(2, 180, __pyx_L1_error)
9061 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))) {
9062 PyErr_SetString(PyExc_OverflowError,
"value too large to perform division");
9063 __PYX_ERR(2, 180, __pyx_L1_error)
9065 __pyx_t_1 = __Pyx_div_Py_ssize_t(__pyx_v_self->len, __pyx_v_itemsize);
9066 __pyx_t_9 = __pyx_t_1;
9067 for (__pyx_t_11 = 0; __pyx_t_11 < __pyx_t_9; __pyx_t_11+=1) {
9068 __pyx_v_i = __pyx_t_11;
9077 (__pyx_v_p[__pyx_v_i]) = Py_None;
9119 __Pyx_XDECREF(__pyx_t_3);
9120 __Pyx_XDECREF(__pyx_t_5);
9121 __Pyx_XDECREF(__pyx_t_6);
9122 __Pyx_XDECREF(__pyx_t_10);
9123 __Pyx_AddTraceback(
"View.MemoryView.array.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
9126 __Pyx_XDECREF(__pyx_v_format);
9127 __Pyx_RefNannyFinishContext();
9140 static CYTHON_UNUSED
int __pyx_array_getbuffer(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info,
int __pyx_v_flags);
9141 static CYTHON_UNUSED
int __pyx_array_getbuffer(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info,
int __pyx_v_flags) {
9143 __Pyx_RefNannyDeclarations
9144 __Pyx_RefNannySetupContext(
"__getbuffer__ (wrapper)", 0);
9145 __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));
9148 __Pyx_RefNannyFinishContext();
9152 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) {
9153 int __pyx_v_bufmode;
9155 __Pyx_RefNannyDeclarations
9158 PyObject *__pyx_t_3 = NULL;
9160 Py_ssize_t __pyx_t_5;
9162 Py_ssize_t *__pyx_t_7;
9163 int __pyx_lineno = 0;
9164 const char *__pyx_filename = NULL;
9165 int __pyx_clineno = 0;
9166 if (__pyx_v_info == NULL) {
9167 PyErr_SetString(PyExc_BufferError,
"PyObject_GetBuffer: view==NULL argument is obsolete");
9170 __Pyx_RefNannySetupContext(
"__getbuffer__", 0);
9171 __pyx_v_info->obj = Py_None; __Pyx_INCREF(Py_None);
9172 __Pyx_GIVEREF(__pyx_v_info->obj);
9181 __pyx_v_bufmode = -1;
9190 __pyx_t_1 = (__Pyx_PyUnicode_Equals(__pyx_v_self->mode, __pyx_n_u_c, Py_EQ));
if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(2, 187, __pyx_L1_error)
9191 __pyx_t_2 = (__pyx_t_1 != 0);
9201 __pyx_v_bufmode = (PyBUF_C_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS);
9220 __pyx_t_2 = (__Pyx_PyUnicode_Equals(__pyx_v_self->mode, __pyx_n_u_fortran, Py_EQ));
if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(2, 189, __pyx_L1_error)
9221 __pyx_t_1 = (__pyx_t_2 != 0);
9231 __pyx_v_bufmode = (PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS);
9250 __pyx_t_1 = ((!((__pyx_v_flags & __pyx_v_bufmode) != 0)) != 0);
9251 if (unlikely(__pyx_t_1)) {
9260 __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__7, NULL);
if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 192, __pyx_L1_error)
9261 __Pyx_GOTREF(__pyx_t_3);
9262 __Pyx_Raise(__pyx_t_3, 0, 0, 0);
9263 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
9264 __PYX_ERR(2, 192, __pyx_L1_error)
9282 __pyx_t_4 = __pyx_v_self->data;
9283 __pyx_v_info->buf = __pyx_t_4;
9292 __pyx_t_5 = __pyx_v_self->len;
9293 __pyx_v_info->len = __pyx_t_5;
9302 __pyx_t_6 = __pyx_v_self->ndim;
9303 __pyx_v_info->ndim = __pyx_t_6;
9312 __pyx_t_7 = __pyx_v_self->_shape;
9313 __pyx_v_info->shape = __pyx_t_7;
9322 __pyx_t_7 = __pyx_v_self->_strides;
9323 __pyx_v_info->strides = __pyx_t_7;
9332 __pyx_v_info->suboffsets = NULL;
9341 __pyx_t_5 = __pyx_v_self->itemsize;
9342 __pyx_v_info->itemsize = __pyx_t_5;
9351 __pyx_v_info->readonly = 0;
9360 __pyx_t_1 = ((__pyx_v_flags & PyBUF_FORMAT) != 0);
9370 __pyx_t_4 = __pyx_v_self->format;
9371 __pyx_v_info->format = __pyx_t_4;
9391 __pyx_v_info->format = NULL;
9402 __Pyx_INCREF(((PyObject *)__pyx_v_self));
9403 __Pyx_GIVEREF(((PyObject *)__pyx_v_self));
9404 __Pyx_GOTREF(__pyx_v_info->obj);
9405 __Pyx_DECREF(__pyx_v_info->obj);
9406 __pyx_v_info->obj = ((PyObject *)__pyx_v_self);
9420 __Pyx_XDECREF(__pyx_t_3);
9421 __Pyx_AddTraceback(
"View.MemoryView.array.__getbuffer__", __pyx_clineno, __pyx_lineno, __pyx_filename);
9423 if (__pyx_v_info->obj != NULL) {
9424 __Pyx_GOTREF(__pyx_v_info->obj);
9425 __Pyx_DECREF(__pyx_v_info->obj); __pyx_v_info->obj = 0;
9429 if (__pyx_v_info->obj == Py_None) {
9430 __Pyx_GOTREF(__pyx_v_info->obj);
9431 __Pyx_DECREF(__pyx_v_info->obj); __pyx_v_info->obj = 0;
9434 __Pyx_RefNannyFinishContext();
9447 static void __pyx_array___dealloc__(PyObject *__pyx_v_self);
9448 static void __pyx_array___dealloc__(PyObject *__pyx_v_self) {
9449 __Pyx_RefNannyDeclarations
9450 __Pyx_RefNannySetupContext(
"__dealloc__ (wrapper)", 0);
9451 __pyx_array___pyx_pf_15View_dot_MemoryView_5array_4__dealloc__(((
struct __pyx_array_obj *)__pyx_v_self));
9454 __Pyx_RefNannyFinishContext();
9457 static void __pyx_array___pyx_pf_15View_dot_MemoryView_5array_4__dealloc__(
struct __pyx_array_obj *__pyx_v_self) {
9458 __Pyx_RefNannyDeclarations
9460 __Pyx_RefNannySetupContext(
"__dealloc__", 0);
9469 __pyx_t_1 = ((__pyx_v_self->callback_free_data != NULL) != 0);
9479 __pyx_v_self->callback_free_data(__pyx_v_self->data);
9498 __pyx_t_1 = (__pyx_v_self->free_data != 0);
9508 __pyx_t_1 = (__pyx_v_self->dtype_is_object != 0);
9518 __pyx_memoryview_refcount_objects_in_slice(__pyx_v_self->data, __pyx_v_self->_shape, __pyx_v_self->_strides, __pyx_v_self->ndim, 0);
9536 free(__pyx_v_self->data);
9555 PyObject_Free(__pyx_v_self->_shape);
9566 __Pyx_RefNannyFinishContext();
9578 static PyObject *__pyx_pw_15View_dot_MemoryView_5array_7memview_1__get__(PyObject *__pyx_v_self);
9579 static PyObject *__pyx_pw_15View_dot_MemoryView_5array_7memview_1__get__(PyObject *__pyx_v_self) {
9580 PyObject *__pyx_r = 0;
9581 __Pyx_RefNannyDeclarations
9582 __Pyx_RefNannySetupContext(
"__get__ (wrapper)", 0);
9583 __pyx_r = __pyx_pf_15View_dot_MemoryView_5array_7memview___get__(((
struct __pyx_array_obj *)__pyx_v_self));
9586 __Pyx_RefNannyFinishContext();
9590 static PyObject *__pyx_pf_15View_dot_MemoryView_5array_7memview___get__(
struct __pyx_array_obj *__pyx_v_self) {
9591 PyObject *__pyx_r = NULL;
9592 __Pyx_RefNannyDeclarations
9593 PyObject *__pyx_t_1 = NULL;
9594 int __pyx_lineno = 0;
9595 const char *__pyx_filename = NULL;
9596 int __pyx_clineno = 0;
9597 __Pyx_RefNannySetupContext(
"__get__", 0);
9606 __Pyx_XDECREF(__pyx_r);
9607 __pyx_t_1 = ((
struct __pyx_vtabstruct_array *)__pyx_v_self->__pyx_vtab)->get_memview(__pyx_v_self);
if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 223, __pyx_L1_error)
9608 __Pyx_GOTREF(__pyx_t_1);
9609 __pyx_r = __pyx_t_1;
9623 __Pyx_XDECREF(__pyx_t_1);
9624 __Pyx_AddTraceback(
"View.MemoryView.array.memview.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
9627 __Pyx_XGIVEREF(__pyx_r);
9628 __Pyx_RefNannyFinishContext();
9640 static PyObject *__pyx_array_get_memview(
struct __pyx_array_obj *__pyx_v_self) {
9642 PyObject *__pyx_r = NULL;
9643 __Pyx_RefNannyDeclarations
9644 PyObject *__pyx_t_1 = NULL;
9645 PyObject *__pyx_t_2 = NULL;
9646 PyObject *__pyx_t_3 = NULL;
9647 int __pyx_lineno = 0;
9648 const char *__pyx_filename = NULL;
9649 int __pyx_clineno = 0;
9650 __Pyx_RefNannySetupContext(
"get_memview", 0);
9659 __pyx_v_flags = ((PyBUF_ANY_CONTIGUOUS | PyBUF_FORMAT) | PyBUF_WRITABLE);
9668 __Pyx_XDECREF(__pyx_r);
9669 __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_flags);
if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 228, __pyx_L1_error)
9670 __Pyx_GOTREF(__pyx_t_1);
9671 __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_v_self->dtype_is_object);
if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 228, __pyx_L1_error)
9672 __Pyx_GOTREF(__pyx_t_2);
9673 __pyx_t_3 = PyTuple_New(3);
if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 228, __pyx_L1_error)
9674 __Pyx_GOTREF(__pyx_t_3);
9675 __Pyx_INCREF(((PyObject *)__pyx_v_self));
9676 __Pyx_GIVEREF(((PyObject *)__pyx_v_self));
9677 PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_v_self));
9678 __Pyx_GIVEREF(__pyx_t_1);
9679 PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_1);
9680 __Pyx_GIVEREF(__pyx_t_2);
9681 PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_t_2);
9684 __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_memoryview_type), __pyx_t_3, NULL);
if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 228, __pyx_L1_error)
9685 __Pyx_GOTREF(__pyx_t_2);
9686 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
9687 __pyx_r = __pyx_t_2;
9701 __Pyx_XDECREF(__pyx_t_1);
9702 __Pyx_XDECREF(__pyx_t_2);
9703 __Pyx_XDECREF(__pyx_t_3);
9704 __Pyx_AddTraceback(
"View.MemoryView.array.get_memview", __pyx_clineno, __pyx_lineno, __pyx_filename);
9707 __Pyx_XGIVEREF(__pyx_r);
9708 __Pyx_RefNannyFinishContext();
9721 static Py_ssize_t __pyx_array___len__(PyObject *__pyx_v_self);
9722 static Py_ssize_t __pyx_array___len__(PyObject *__pyx_v_self) {
9724 __Pyx_RefNannyDeclarations
9725 __Pyx_RefNannySetupContext(
"__len__ (wrapper)", 0);
9726 __pyx_r = __pyx_array___pyx_pf_15View_dot_MemoryView_5array_6__len__(((
struct __pyx_array_obj *)__pyx_v_self));
9729 __Pyx_RefNannyFinishContext();
9733 static Py_ssize_t __pyx_array___pyx_pf_15View_dot_MemoryView_5array_6__len__(
struct __pyx_array_obj *__pyx_v_self) {
9735 __Pyx_RefNannyDeclarations
9736 __Pyx_RefNannySetupContext(
"__len__", 0);
9745 __pyx_r = (__pyx_v_self->_shape[0]);
9758 __Pyx_RefNannyFinishContext();
9771 static PyObject *__pyx_array___getattr__(PyObject *__pyx_v_self, PyObject *__pyx_v_attr);
9772 static PyObject *__pyx_array___getattr__(PyObject *__pyx_v_self, PyObject *__pyx_v_attr) {
9773 PyObject *__pyx_r = 0;
9774 __Pyx_RefNannyDeclarations
9775 __Pyx_RefNannySetupContext(
"__getattr__ (wrapper)", 0);
9776 __pyx_r = __pyx_array___pyx_pf_15View_dot_MemoryView_5array_8__getattr__(((
struct __pyx_array_obj *)__pyx_v_self), ((PyObject *)__pyx_v_attr));
9779 __Pyx_RefNannyFinishContext();
9783 static PyObject *__pyx_array___pyx_pf_15View_dot_MemoryView_5array_8__getattr__(
struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_attr) {
9784 PyObject *__pyx_r = NULL;
9785 __Pyx_RefNannyDeclarations
9786 PyObject *__pyx_t_1 = NULL;
9787 PyObject *__pyx_t_2 = NULL;
9788 int __pyx_lineno = 0;
9789 const char *__pyx_filename = NULL;
9790 int __pyx_clineno = 0;
9791 __Pyx_RefNannySetupContext(
"__getattr__", 0);
9800 __Pyx_XDECREF(__pyx_r);
9801 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_memview);
if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 234, __pyx_L1_error)
9802 __Pyx_GOTREF(__pyx_t_1);
9803 __pyx_t_2 = __Pyx_GetAttr(__pyx_t_1, __pyx_v_attr);
if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 234, __pyx_L1_error)
9804 __Pyx_GOTREF(__pyx_t_2);
9805 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
9806 __pyx_r = __pyx_t_2;
9820 __Pyx_XDECREF(__pyx_t_1);
9821 __Pyx_XDECREF(__pyx_t_2);
9822 __Pyx_AddTraceback(
"View.MemoryView.array.__getattr__", __pyx_clineno, __pyx_lineno, __pyx_filename);
9825 __Pyx_XGIVEREF(__pyx_r);
9826 __Pyx_RefNannyFinishContext();
9839 static PyObject *__pyx_array___getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_item);
9840 static PyObject *__pyx_array___getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_item) {
9841 PyObject *__pyx_r = 0;
9842 __Pyx_RefNannyDeclarations
9843 __Pyx_RefNannySetupContext(
"__getitem__ (wrapper)", 0);
9844 __pyx_r = __pyx_array___pyx_pf_15View_dot_MemoryView_5array_10__getitem__(((
struct __pyx_array_obj *)__pyx_v_self), ((PyObject *)__pyx_v_item));
9847 __Pyx_RefNannyFinishContext();
9851 static PyObject *__pyx_array___pyx_pf_15View_dot_MemoryView_5array_10__getitem__(
struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_item) {
9852 PyObject *__pyx_r = NULL;
9853 __Pyx_RefNannyDeclarations
9854 PyObject *__pyx_t_1 = NULL;
9855 PyObject *__pyx_t_2 = NULL;
9856 int __pyx_lineno = 0;
9857 const char *__pyx_filename = NULL;
9858 int __pyx_clineno = 0;
9859 __Pyx_RefNannySetupContext(
"__getitem__", 0);
9868 __Pyx_XDECREF(__pyx_r);
9869 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_memview);
if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 237, __pyx_L1_error)
9870 __Pyx_GOTREF(__pyx_t_1);
9871 __pyx_t_2 = __Pyx_PyObject_GetItem(__pyx_t_1, __pyx_v_item);
if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 237, __pyx_L1_error)
9872 __Pyx_GOTREF(__pyx_t_2);
9873 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
9874 __pyx_r = __pyx_t_2;
9888 __Pyx_XDECREF(__pyx_t_1);
9889 __Pyx_XDECREF(__pyx_t_2);
9890 __Pyx_AddTraceback(
"View.MemoryView.array.__getitem__", __pyx_clineno, __pyx_lineno, __pyx_filename);
9893 __Pyx_XGIVEREF(__pyx_r);
9894 __Pyx_RefNannyFinishContext();
9907 static int __pyx_array___setitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_item, PyObject *__pyx_v_value);
9908 static int __pyx_array___setitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_item, PyObject *__pyx_v_value) {
9910 __Pyx_RefNannyDeclarations
9911 __Pyx_RefNannySetupContext(
"__setitem__ (wrapper)", 0);
9912 __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));
9915 __Pyx_RefNannyFinishContext();
9919 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) {
9921 __Pyx_RefNannyDeclarations
9922 PyObject *__pyx_t_1 = NULL;
9923 int __pyx_lineno = 0;
9924 const char *__pyx_filename = NULL;
9925 int __pyx_clineno = 0;
9926 __Pyx_RefNannySetupContext(
"__setitem__", 0);
9935 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_memview);
if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 240, __pyx_L1_error)
9936 __Pyx_GOTREF(__pyx_t_1);
9937 if (unlikely(PyObject_SetItem(__pyx_t_1, __pyx_v_item, __pyx_v_value) < 0)) __PYX_ERR(2, 240, __pyx_L1_error)
9938 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
9952 __Pyx_XDECREF(__pyx_t_1);
9953 __Pyx_AddTraceback(
"View.MemoryView.array.__setitem__", __pyx_clineno, __pyx_lineno, __pyx_filename);
9956 __Pyx_RefNannyFinishContext();
9967 static PyObject *__pyx_pw___pyx_array_1__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused);
9968 static PyObject *__pyx_pw___pyx_array_1__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
9969 PyObject *__pyx_r = 0;
9970 __Pyx_RefNannyDeclarations
9971 __Pyx_RefNannySetupContext(
"__reduce_cython__ (wrapper)", 0);
9972 __pyx_r = __pyx_pf___pyx_array___reduce_cython__(((
struct __pyx_array_obj *)__pyx_v_self));
9975 __Pyx_RefNannyFinishContext();
9979 static PyObject *__pyx_pf___pyx_array___reduce_cython__(CYTHON_UNUSED
struct __pyx_array_obj *__pyx_v_self) {
9980 PyObject *__pyx_r = NULL;
9981 __Pyx_RefNannyDeclarations
9982 PyObject *__pyx_t_1 = NULL;
9983 int __pyx_lineno = 0;
9984 const char *__pyx_filename = NULL;
9985 int __pyx_clineno = 0;
9986 __Pyx_RefNannySetupContext(
"__reduce_cython__", 0);
9994 __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__8, NULL);
if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 2, __pyx_L1_error)
9995 __Pyx_GOTREF(__pyx_t_1);
9996 __Pyx_Raise(__pyx_t_1, 0, 0, 0);
9997 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
9998 __PYX_ERR(2, 2, __pyx_L1_error)
10008 __Pyx_XDECREF(__pyx_t_1);
10009 __Pyx_AddTraceback(
"View.MemoryView.array.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
10011 __Pyx_XGIVEREF(__pyx_r);
10012 __Pyx_RefNannyFinishContext();
10024 static PyObject *__pyx_pw___pyx_array_3__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state);
10025 static PyObject *__pyx_pw___pyx_array_3__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
10026 PyObject *__pyx_r = 0;
10027 __Pyx_RefNannyDeclarations
10028 __Pyx_RefNannySetupContext(
"__setstate_cython__ (wrapper)", 0);
10029 __pyx_r = __pyx_pf___pyx_array_2__setstate_cython__(((
struct __pyx_array_obj *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state));
10032 __Pyx_RefNannyFinishContext();
10036 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) {
10037 PyObject *__pyx_r = NULL;
10038 __Pyx_RefNannyDeclarations
10039 PyObject *__pyx_t_1 = NULL;
10040 int __pyx_lineno = 0;
10041 const char *__pyx_filename = NULL;
10042 int __pyx_clineno = 0;
10043 __Pyx_RefNannySetupContext(
"__setstate_cython__", 0);
10050 __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__9, NULL);
if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 4, __pyx_L1_error)
10051 __Pyx_GOTREF(__pyx_t_1);
10052 __Pyx_Raise(__pyx_t_1, 0, 0, 0);
10053 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
10054 __PYX_ERR(2, 4, __pyx_L1_error)
10065 __Pyx_XDECREF(__pyx_t_1);
10066 __Pyx_AddTraceback(
"View.MemoryView.array.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
10068 __Pyx_XGIVEREF(__pyx_r);
10069 __Pyx_RefNannyFinishContext();
10081 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) {
10082 struct __pyx_array_obj *__pyx_v_result = 0;
10083 struct __pyx_array_obj *__pyx_r = NULL;
10084 __Pyx_RefNannyDeclarations
10086 PyObject *__pyx_t_2 = NULL;
10087 PyObject *__pyx_t_3 = NULL;
10088 PyObject *__pyx_t_4 = NULL;
10089 PyObject *__pyx_t_5 = NULL;
10090 int __pyx_lineno = 0;
10091 const char *__pyx_filename = NULL;
10092 int __pyx_clineno = 0;
10093 __Pyx_RefNannySetupContext(
"array_cwrapper", 0);
10102 __pyx_t_1 = ((__pyx_v_buf == NULL) != 0);
10112 __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_itemsize);
if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 249, __pyx_L1_error)
10113 __Pyx_GOTREF(__pyx_t_2);
10114 __pyx_t_3 = __Pyx_PyBytes_FromString(__pyx_v_format);
if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 249, __pyx_L1_error)
10115 __Pyx_GOTREF(__pyx_t_3);
10116 __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(2, 249, __pyx_L1_error)
10117 __Pyx_GOTREF(__pyx_t_4);
10118 __pyx_t_5 = PyTuple_New(4);
if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 249, __pyx_L1_error)
10119 __Pyx_GOTREF(__pyx_t_5);
10120 __Pyx_INCREF(__pyx_v_shape);
10121 __Pyx_GIVEREF(__pyx_v_shape);
10122 PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_v_shape);
10123 __Pyx_GIVEREF(__pyx_t_2);
10124 PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_2);
10125 __Pyx_GIVEREF(__pyx_t_3);
10126 PyTuple_SET_ITEM(__pyx_t_5, 2, __pyx_t_3);
10127 __Pyx_GIVEREF(__pyx_t_4);
10128 PyTuple_SET_ITEM(__pyx_t_5, 3, __pyx_t_4);
10132 __pyx_t_4 = __Pyx_PyObject_Call(((PyObject *)__pyx_array_type), __pyx_t_5, NULL);
if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 249, __pyx_L1_error)
10133 __Pyx_GOTREF(__pyx_t_4);
10134 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
10135 __pyx_v_result = ((
struct __pyx_array_obj *)__pyx_t_4);
10156 __pyx_t_4 = PyInt_FromSsize_t(__pyx_v_itemsize);
if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 251, __pyx_L1_error)
10157 __Pyx_GOTREF(__pyx_t_4);
10158 __pyx_t_5 = __Pyx_PyBytes_FromString(__pyx_v_format);
if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 251, __pyx_L1_error)
10159 __Pyx_GOTREF(__pyx_t_5);
10160 __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(2, 251, __pyx_L1_error)
10161 __Pyx_GOTREF(__pyx_t_3);
10162 __pyx_t_2 = PyTuple_New(4);
if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 251, __pyx_L1_error)
10163 __Pyx_GOTREF(__pyx_t_2);
10164 __Pyx_INCREF(__pyx_v_shape);
10165 __Pyx_GIVEREF(__pyx_v_shape);
10166 PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_shape);
10167 __Pyx_GIVEREF(__pyx_t_4);
10168 PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_4);
10169 __Pyx_GIVEREF(__pyx_t_5);
10170 PyTuple_SET_ITEM(__pyx_t_2, 2, __pyx_t_5);
10171 __Pyx_GIVEREF(__pyx_t_3);
10172 PyTuple_SET_ITEM(__pyx_t_2, 3, __pyx_t_3);
10184 __pyx_t_3 = __Pyx_PyDict_NewPresized(1);
if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 252, __pyx_L1_error)
10185 __Pyx_GOTREF(__pyx_t_3);
10186 if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_allocate_buffer, Py_False) < 0) __PYX_ERR(2, 252, __pyx_L1_error)
10195 __pyx_t_5 = __Pyx_PyObject_Call(((PyObject *)__pyx_array_type), __pyx_t_2, __pyx_t_3);
if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 251, __pyx_L1_error)
10196 __Pyx_GOTREF(__pyx_t_5);
10197 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
10198 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
10199 __pyx_v_result = ((
struct __pyx_array_obj *)__pyx_t_5);
10209 __pyx_v_result->data = __pyx_v_buf;
10220 __Pyx_XDECREF(((PyObject *)__pyx_r));
10221 __Pyx_INCREF(((PyObject *)__pyx_v_result));
10222 __pyx_r = __pyx_v_result;
10235 __Pyx_XDECREF(__pyx_t_2);
10236 __Pyx_XDECREF(__pyx_t_3);
10237 __Pyx_XDECREF(__pyx_t_4);
10238 __Pyx_XDECREF(__pyx_t_5);
10239 __Pyx_AddTraceback(
"View.MemoryView.array_cwrapper", __pyx_clineno, __pyx_lineno, __pyx_filename);
10242 __Pyx_XDECREF((PyObject *)__pyx_v_result);
10243 __Pyx_XGIVEREF((PyObject *)__pyx_r);
10244 __Pyx_RefNannyFinishContext();
10257 static int __pyx_MemviewEnum___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
10258 static int __pyx_MemviewEnum___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
10259 PyObject *__pyx_v_name = 0;
10260 int __pyx_lineno = 0;
10261 const char *__pyx_filename = NULL;
10262 int __pyx_clineno = 0;
10264 __Pyx_RefNannyDeclarations
10265 __Pyx_RefNannySetupContext(
"__init__ (wrapper)", 0);
10267 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_name,0};
10268 PyObject* values[1] = {0};
10269 if (unlikely(__pyx_kwds)) {
10270 Py_ssize_t kw_args;
10271 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
10272 switch (pos_args) {
10273 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
10274 CYTHON_FALLTHROUGH;
10276 default:
goto __pyx_L5_argtuple_error;
10278 kw_args = PyDict_Size(__pyx_kwds);
10279 switch (pos_args) {
10281 if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_name)) != 0)) kw_args--;
10282 else goto __pyx_L5_argtuple_error;
10284 if (unlikely(kw_args > 0)) {
10285 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args,
"__init__") < 0)) __PYX_ERR(2, 281, __pyx_L3_error)
10287 }
else if (PyTuple_GET_SIZE(__pyx_args) != 1) {
10288 goto __pyx_L5_argtuple_error;
10290 values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
10292 __pyx_v_name = values[0];
10294 goto __pyx_L4_argument_unpacking_done;
10295 __pyx_L5_argtuple_error:;
10296 __Pyx_RaiseArgtupleInvalid(
"__init__", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(2, 281, __pyx_L3_error)
10298 __Pyx_AddTraceback(
"View.MemoryView.Enum.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
10299 __Pyx_RefNannyFinishContext();
10301 __pyx_L4_argument_unpacking_done:;
10302 __pyx_r = __pyx_MemviewEnum___pyx_pf_15View_dot_MemoryView_4Enum___init__(((
struct __pyx_MemviewEnum_obj *)__pyx_v_self), __pyx_v_name);
10305 __Pyx_RefNannyFinishContext();
10309 static int __pyx_MemviewEnum___pyx_pf_15View_dot_MemoryView_4Enum___init__(
struct __pyx_MemviewEnum_obj *__pyx_v_self, PyObject *__pyx_v_name) {
10311 __Pyx_RefNannyDeclarations
10312 __Pyx_RefNannySetupContext(
"__init__", 0);
10321 __Pyx_INCREF(__pyx_v_name);
10322 __Pyx_GIVEREF(__pyx_v_name);
10323 __Pyx_GOTREF(__pyx_v_self->name);
10324 __Pyx_DECREF(__pyx_v_self->name);
10325 __pyx_v_self->name = __pyx_v_name;
10337 __Pyx_RefNannyFinishContext();
10350 static PyObject *__pyx_MemviewEnum___repr__(PyObject *__pyx_v_self);
10351 static PyObject *__pyx_MemviewEnum___repr__(PyObject *__pyx_v_self) {
10352 PyObject *__pyx_r = 0;
10353 __Pyx_RefNannyDeclarations
10354 __Pyx_RefNannySetupContext(
"__repr__ (wrapper)", 0);
10355 __pyx_r = __pyx_MemviewEnum___pyx_pf_15View_dot_MemoryView_4Enum_2__repr__(((
struct __pyx_MemviewEnum_obj *)__pyx_v_self));
10358 __Pyx_RefNannyFinishContext();
10362 static PyObject *__pyx_MemviewEnum___pyx_pf_15View_dot_MemoryView_4Enum_2__repr__(
struct __pyx_MemviewEnum_obj *__pyx_v_self) {
10363 PyObject *__pyx_r = NULL;
10364 __Pyx_RefNannyDeclarations
10365 __Pyx_RefNannySetupContext(
"__repr__", 0);
10374 __Pyx_XDECREF(__pyx_r);
10375 __Pyx_INCREF(__pyx_v_self->name);
10376 __pyx_r = __pyx_v_self->name;
10389 __Pyx_XGIVEREF(__pyx_r);
10390 __Pyx_RefNannyFinishContext();
10401 static PyObject *__pyx_pw___pyx_MemviewEnum_1__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused);
10402 static PyObject *__pyx_pw___pyx_MemviewEnum_1__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
10403 PyObject *__pyx_r = 0;
10404 __Pyx_RefNannyDeclarations
10405 __Pyx_RefNannySetupContext(
"__reduce_cython__ (wrapper)", 0);
10406 __pyx_r = __pyx_pf___pyx_MemviewEnum___reduce_cython__(((
struct __pyx_MemviewEnum_obj *)__pyx_v_self));
10409 __Pyx_RefNannyFinishContext();
10413 static PyObject *__pyx_pf___pyx_MemviewEnum___reduce_cython__(
struct __pyx_MemviewEnum_obj *__pyx_v_self) {
10414 PyObject *__pyx_v_state = 0;
10415 PyObject *__pyx_v__dict = 0;
10416 int __pyx_v_use_setstate;
10417 PyObject *__pyx_r = NULL;
10418 __Pyx_RefNannyDeclarations
10419 PyObject *__pyx_t_1 = NULL;
10422 PyObject *__pyx_t_4 = NULL;
10423 PyObject *__pyx_t_5 = NULL;
10424 int __pyx_lineno = 0;
10425 const char *__pyx_filename = NULL;
10426 int __pyx_clineno = 0;
10427 __Pyx_RefNannySetupContext(
"__reduce_cython__", 0);
10436 __pyx_t_1 = PyTuple_New(1);
if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 5, __pyx_L1_error)
10437 __Pyx_GOTREF(__pyx_t_1);
10438 __Pyx_INCREF(__pyx_v_self->name);
10439 __Pyx_GIVEREF(__pyx_v_self->name);
10440 PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_self->name);
10441 __pyx_v_state = ((PyObject*)__pyx_t_1);
10451 __pyx_t_1 = __Pyx_GetAttr3(((PyObject *)__pyx_v_self), __pyx_n_s_dict, Py_None);
if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 6, __pyx_L1_error)
10452 __Pyx_GOTREF(__pyx_t_1);
10453 __pyx_v__dict = __pyx_t_1;
10463 __pyx_t_2 = (__pyx_v__dict != Py_None);
10464 __pyx_t_3 = (__pyx_t_2 != 0);
10474 __pyx_t_1 = PyTuple_New(1);
if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 8, __pyx_L1_error)
10475 __Pyx_GOTREF(__pyx_t_1);
10476 __Pyx_INCREF(__pyx_v__dict);
10477 __Pyx_GIVEREF(__pyx_v__dict);
10478 PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v__dict);
10479 __pyx_t_4 = PyNumber_InPlaceAdd(__pyx_v_state, __pyx_t_1);
if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 8, __pyx_L1_error)
10480 __Pyx_GOTREF(__pyx_t_4);
10481 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
10482 __Pyx_DECREF_SET(__pyx_v_state, ((PyObject*)__pyx_t_4));
10492 __pyx_v_use_setstate = 1;
10512 __pyx_t_3 = (__pyx_v_self->name != Py_None);
10513 __pyx_v_use_setstate = __pyx_t_3;
10524 __pyx_t_3 = (__pyx_v_use_setstate != 0);
10534 __Pyx_XDECREF(__pyx_r);
10535 __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_pyx_unpickle_Enum);
if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 13, __pyx_L1_error)
10536 __Pyx_GOTREF(__pyx_t_4);
10537 __pyx_t_1 = PyTuple_New(3);
if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 13, __pyx_L1_error)
10538 __Pyx_GOTREF(__pyx_t_1);
10539 __Pyx_INCREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
10540 __Pyx_GIVEREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
10541 PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
10542 __Pyx_INCREF(__pyx_int_184977713);
10543 __Pyx_GIVEREF(__pyx_int_184977713);
10544 PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_int_184977713);
10545 __Pyx_INCREF(Py_None);
10546 __Pyx_GIVEREF(Py_None);
10547 PyTuple_SET_ITEM(__pyx_t_1, 2, Py_None);
10548 __pyx_t_5 = PyTuple_New(3);
if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 13, __pyx_L1_error)
10549 __Pyx_GOTREF(__pyx_t_5);
10550 __Pyx_GIVEREF(__pyx_t_4);
10551 PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4);
10552 __Pyx_GIVEREF(__pyx_t_1);
10553 PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_1);
10554 __Pyx_INCREF(__pyx_v_state);
10555 __Pyx_GIVEREF(__pyx_v_state);
10556 PyTuple_SET_ITEM(__pyx_t_5, 2, __pyx_v_state);
10559 __pyx_r = __pyx_t_5;
10580 __Pyx_XDECREF(__pyx_r);
10581 __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_pyx_unpickle_Enum);
if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 15, __pyx_L1_error)
10582 __Pyx_GOTREF(__pyx_t_5);
10583 __pyx_t_1 = PyTuple_New(3);
if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 15, __pyx_L1_error)
10584 __Pyx_GOTREF(__pyx_t_1);
10585 __Pyx_INCREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
10586 __Pyx_GIVEREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
10587 PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
10588 __Pyx_INCREF(__pyx_int_184977713);
10589 __Pyx_GIVEREF(__pyx_int_184977713);
10590 PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_int_184977713);
10591 __Pyx_INCREF(__pyx_v_state);
10592 __Pyx_GIVEREF(__pyx_v_state);
10593 PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_v_state);
10594 __pyx_t_4 = PyTuple_New(2);
if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 15, __pyx_L1_error)
10595 __Pyx_GOTREF(__pyx_t_4);
10596 __Pyx_GIVEREF(__pyx_t_5);
10597 PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_5);
10598 __Pyx_GIVEREF(__pyx_t_1);
10599 PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_1);
10602 __pyx_r = __pyx_t_4;
10615 __Pyx_XDECREF(__pyx_t_1);
10616 __Pyx_XDECREF(__pyx_t_4);
10617 __Pyx_XDECREF(__pyx_t_5);
10618 __Pyx_AddTraceback(
"View.MemoryView.Enum.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
10621 __Pyx_XDECREF(__pyx_v_state);
10622 __Pyx_XDECREF(__pyx_v__dict);
10623 __Pyx_XGIVEREF(__pyx_r);
10624 __Pyx_RefNannyFinishContext();
10636 static PyObject *__pyx_pw___pyx_MemviewEnum_3__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state);
10637 static PyObject *__pyx_pw___pyx_MemviewEnum_3__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
10638 PyObject *__pyx_r = 0;
10639 __Pyx_RefNannyDeclarations
10640 __Pyx_RefNannySetupContext(
"__setstate_cython__ (wrapper)", 0);
10641 __pyx_r = __pyx_pf___pyx_MemviewEnum_2__setstate_cython__(((
struct __pyx_MemviewEnum_obj *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state));
10644 __Pyx_RefNannyFinishContext();
10648 static PyObject *__pyx_pf___pyx_MemviewEnum_2__setstate_cython__(
struct __pyx_MemviewEnum_obj *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
10649 PyObject *__pyx_r = NULL;
10650 __Pyx_RefNannyDeclarations
10651 PyObject *__pyx_t_1 = NULL;
10652 int __pyx_lineno = 0;
10653 const char *__pyx_filename = NULL;
10654 int __pyx_clineno = 0;
10655 __Pyx_RefNannySetupContext(
"__setstate_cython__", 0);
10662 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(2, 17, __pyx_L1_error)
10663 __pyx_t_1 = __pyx_unpickle_Enum__set_state(__pyx_v_self, ((PyObject*)__pyx_v___pyx_state));
if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 17, __pyx_L1_error)
10664 __Pyx_GOTREF(__pyx_t_1);
10665 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
10675 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
10678 __Pyx_XDECREF(__pyx_t_1);
10679 __Pyx_AddTraceback(
"View.MemoryView.Enum.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
10682 __Pyx_XGIVEREF(__pyx_r);
10683 __Pyx_RefNannyFinishContext();
10695 static void *__pyx_align_pointer(
void *__pyx_v_memory,
size_t __pyx_v_alignment) {
10696 Py_intptr_t __pyx_v_aligned_p;
10697 size_t __pyx_v_offset;
10708 __pyx_v_aligned_p = ((Py_intptr_t)__pyx_v_memory);
10717 __pyx_v_offset = (__pyx_v_aligned_p % __pyx_v_alignment);
10726 __pyx_t_1 = ((__pyx_v_offset > 0) != 0);
10736 __pyx_v_aligned_p = (__pyx_v_aligned_p + (__pyx_v_alignment - __pyx_v_offset));
10754 __pyx_r = ((
void *)__pyx_v_aligned_p);
10779 static int __pyx_memoryview___cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
10780 static int __pyx_memoryview___cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
10781 PyObject *__pyx_v_obj = 0;
10783 int __pyx_v_dtype_is_object;
10784 int __pyx_lineno = 0;
10785 const char *__pyx_filename = NULL;
10786 int __pyx_clineno = 0;
10788 __Pyx_RefNannyDeclarations
10789 __Pyx_RefNannySetupContext(
"__cinit__ (wrapper)", 0);
10791 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_obj,&__pyx_n_s_flags,&__pyx_n_s_dtype_is_object,0};
10792 PyObject* values[3] = {0,0,0};
10793 if (unlikely(__pyx_kwds)) {
10794 Py_ssize_t kw_args;
10795 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
10796 switch (pos_args) {
10797 case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
10798 CYTHON_FALLTHROUGH;
10799 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
10800 CYTHON_FALLTHROUGH;
10801 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
10802 CYTHON_FALLTHROUGH;
10804 default:
goto __pyx_L5_argtuple_error;
10806 kw_args = PyDict_Size(__pyx_kwds);
10807 switch (pos_args) {
10809 if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_obj)) != 0)) kw_args--;
10810 else goto __pyx_L5_argtuple_error;
10811 CYTHON_FALLTHROUGH;
10813 if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_flags)) != 0)) kw_args--;
10815 __Pyx_RaiseArgtupleInvalid(
"__cinit__", 0, 2, 3, 1); __PYX_ERR(2, 345, __pyx_L3_error)
10817 CYTHON_FALLTHROUGH;
10820 PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_dtype_is_object);
10821 if (value) { values[2] = value; kw_args--; }
10824 if (unlikely(kw_args > 0)) {
10825 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args,
"__cinit__") < 0)) __PYX_ERR(2, 345, __pyx_L3_error)
10828 switch (PyTuple_GET_SIZE(__pyx_args)) {
10829 case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
10830 CYTHON_FALLTHROUGH;
10831 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
10832 values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
10834 default:
goto __pyx_L5_argtuple_error;
10837 __pyx_v_obj = values[0];
10838 __pyx_v_flags = __Pyx_PyInt_As_int(values[1]);
if (unlikely((__pyx_v_flags == (
int)-1) && PyErr_Occurred())) __PYX_ERR(2, 345, __pyx_L3_error)
10840 __pyx_v_dtype_is_object = __Pyx_PyObject_IsTrue(values[2]);
if (unlikely((__pyx_v_dtype_is_object == (
int)-1) && PyErr_Occurred())) __PYX_ERR(2, 345, __pyx_L3_error)
10842 __pyx_v_dtype_is_object = ((int)0);
10845 goto __pyx_L4_argument_unpacking_done;
10846 __pyx_L5_argtuple_error:;
10847 __Pyx_RaiseArgtupleInvalid(
"__cinit__", 0, 2, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(2, 345, __pyx_L3_error)
10849 __Pyx_AddTraceback(
"View.MemoryView.memoryview.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
10850 __Pyx_RefNannyFinishContext();
10852 __pyx_L4_argument_unpacking_done:;
10853 __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);
10856 __Pyx_RefNannyFinishContext();
10860 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) {
10862 __Pyx_RefNannyDeclarations
10867 int __pyx_lineno = 0;
10868 const char *__pyx_filename = NULL;
10869 int __pyx_clineno = 0;
10870 __Pyx_RefNannySetupContext(
"__cinit__", 0);
10879 __Pyx_INCREF(__pyx_v_obj);
10880 __Pyx_GIVEREF(__pyx_v_obj);
10881 __Pyx_GOTREF(__pyx_v_self->obj);
10882 __Pyx_DECREF(__pyx_v_self->obj);
10883 __pyx_v_self->obj = __pyx_v_obj;
10892 __pyx_v_self->flags = __pyx_v_flags;
10901 __pyx_t_2 = (((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))) == ((PyObject *)__pyx_memoryview_type));
10902 __pyx_t_3 = (__pyx_t_2 != 0);
10905 __pyx_t_1 = __pyx_t_3;
10906 goto __pyx_L4_bool_binop_done;
10908 __pyx_t_3 = (__pyx_v_obj != Py_None);
10909 __pyx_t_2 = (__pyx_t_3 != 0);
10910 __pyx_t_1 = __pyx_t_2;
10911 __pyx_L4_bool_binop_done:;
10921 __pyx_t_4 = __Pyx_GetBuffer(__pyx_v_obj, (&__pyx_v_self->view), __pyx_v_flags);
if (unlikely(__pyx_t_4 == ((
int)-1))) __PYX_ERR(2, 349, __pyx_L1_error)
10930 __pyx_t_1 = ((((PyObject *)__pyx_v_self->view.obj) == NULL) != 0);
10940 ((Py_buffer *)(&__pyx_v_self->view))->obj = Py_None;
10949 Py_INCREF(Py_None);
10976 __pyx_t_1 = ((__pyx_memoryview_thread_locks_used < 8) != 0);
10986 __pyx_v_self->lock = (__pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used]);
10995 __pyx_memoryview_thread_locks_used = (__pyx_memoryview_thread_locks_used + 1);
11013 __pyx_t_1 = ((__pyx_v_self->lock == NULL) != 0);
11023 __pyx_v_self->lock = PyThread_allocate_lock();
11032 __pyx_t_1 = ((__pyx_v_self->lock == NULL) != 0);
11033 if (unlikely(__pyx_t_1)) {
11042 PyErr_NoMemory(); __PYX_ERR(2, 361, __pyx_L1_error)
11069 __pyx_t_1 = ((__pyx_v_flags & PyBUF_FORMAT) != 0);
11079 __pyx_t_2 = (((__pyx_v_self->view.format[0]) ==
'O') != 0);
11082 __pyx_t_1 = __pyx_t_2;
11083 goto __pyx_L11_bool_binop_done;
11085 __pyx_t_2 = (((__pyx_v_self->view.format[1]) ==
'\x00') != 0);
11086 __pyx_t_1 = __pyx_t_2;
11087 __pyx_L11_bool_binop_done:;
11088 __pyx_v_self->dtype_is_object = __pyx_t_1;
11108 __pyx_v_self->dtype_is_object = __pyx_v_dtype_is_object;
11119 __pyx_v_self->acquisition_count_aligned_p = ((__pyx_atomic_int *)__pyx_align_pointer(((
void *)(&(__pyx_v_self->acquisition_count[0]))), (
sizeof(__pyx_atomic_int))));
11128 __pyx_v_self->typeinfo = NULL;
11142 __Pyx_AddTraceback(
"View.MemoryView.memoryview.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
11145 __Pyx_RefNannyFinishContext();
11158 static void __pyx_memoryview___dealloc__(PyObject *__pyx_v_self);
11159 static void __pyx_memoryview___dealloc__(PyObject *__pyx_v_self) {
11160 __Pyx_RefNannyDeclarations
11161 __Pyx_RefNannySetupContext(
"__dealloc__ (wrapper)", 0);
11162 __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_2__dealloc__(((
struct __pyx_memoryview_obj *)__pyx_v_self));
11165 __Pyx_RefNannyFinishContext();
11168 static void __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_2__dealloc__(
struct __pyx_memoryview_obj *__pyx_v_self) {
11170 __Pyx_RefNannyDeclarations
11176 PyThread_type_lock __pyx_t_6;
11177 PyThread_type_lock __pyx_t_7;
11178 __Pyx_RefNannySetupContext(
"__dealloc__", 0);
11187 __pyx_t_1 = (__pyx_v_self->obj != Py_None);
11188 __pyx_t_2 = (__pyx_t_1 != 0);
11198 __Pyx_ReleaseBuffer((&__pyx_v_self->view));
11217 __pyx_t_2 = ((((Py_buffer *)(&__pyx_v_self->view))->obj == Py_None) != 0);
11227 ((Py_buffer *)(&__pyx_v_self->view))->obj = NULL;
11236 Py_DECREF(Py_None);
11255 __pyx_t_2 = ((__pyx_v_self->lock != NULL) != 0);
11265 __pyx_t_3 = __pyx_memoryview_thread_locks_used;
11266 __pyx_t_4 = __pyx_t_3;
11267 for (__pyx_t_5 = 0; __pyx_t_5 < __pyx_t_4; __pyx_t_5+=1) {
11268 __pyx_v_i = __pyx_t_5;
11277 __pyx_t_2 = (((__pyx_memoryview_thread_locks[__pyx_v_i]) == __pyx_v_self->lock) != 0);
11287 __pyx_memoryview_thread_locks_used = (__pyx_memoryview_thread_locks_used - 1);
11296 __pyx_t_2 = ((__pyx_v_i != __pyx_memoryview_thread_locks_used) != 0);
11306 __pyx_t_6 = (__pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used]);
11307 __pyx_t_7 = (__pyx_memoryview_thread_locks[__pyx_v_i]);
11316 (__pyx_memoryview_thread_locks[__pyx_v_i]) = __pyx_t_6;
11317 (__pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used]) = __pyx_t_7;
11335 goto __pyx_L6_break;
11355 PyThread_free_lock(__pyx_v_self->lock);
11377 __Pyx_RefNannyFinishContext();
11388 static char *__pyx_memoryview_get_item_pointer(
struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index) {
11389 Py_ssize_t __pyx_v_dim;
11390 char *__pyx_v_itemp;
11391 PyObject *__pyx_v_idx = NULL;
11393 __Pyx_RefNannyDeclarations
11394 Py_ssize_t __pyx_t_1;
11395 PyObject *__pyx_t_2 = NULL;
11396 Py_ssize_t __pyx_t_3;
11397 PyObject *(*__pyx_t_4)(PyObject *);
11398 PyObject *__pyx_t_5 = NULL;
11399 Py_ssize_t __pyx_t_6;
11401 int __pyx_lineno = 0;
11402 const char *__pyx_filename = NULL;
11403 int __pyx_clineno = 0;
11404 __Pyx_RefNannySetupContext(
"get_item_pointer", 0);
11413 __pyx_v_itemp = ((
char *)__pyx_v_self->view.buf);
11423 if (likely(PyList_CheckExact(__pyx_v_index)) || PyTuple_CheckExact(__pyx_v_index)) {
11424 __pyx_t_2 = __pyx_v_index; __Pyx_INCREF(__pyx_t_2); __pyx_t_3 = 0;
11427 __pyx_t_3 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_v_index);
if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 397, __pyx_L1_error)
11428 __Pyx_GOTREF(__pyx_t_2);
11429 __pyx_t_4 = Py_TYPE(__pyx_t_2)->tp_iternext;
if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 397, __pyx_L1_error)
11432 if (likely(!__pyx_t_4)) {
11433 if (likely(PyList_CheckExact(__pyx_t_2))) {
11434 if (__pyx_t_3 >= PyList_GET_SIZE(__pyx_t_2))
break;
11435 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
11436 __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(2, 397, __pyx_L1_error)
11438 __pyx_t_5 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++;
if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 397, __pyx_L1_error)
11439 __Pyx_GOTREF(__pyx_t_5);
11442 if (__pyx_t_3 >= PyTuple_GET_SIZE(__pyx_t_2))
break;
11443 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
11444 __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(2, 397, __pyx_L1_error)
11446 __pyx_t_5 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++;
if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 397, __pyx_L1_error)
11447 __Pyx_GOTREF(__pyx_t_5);
11451 __pyx_t_5 = __pyx_t_4(__pyx_t_2);
11452 if (unlikely(!__pyx_t_5)) {
11453 PyObject* exc_type = PyErr_Occurred();
11455 if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
11456 else __PYX_ERR(2, 397, __pyx_L1_error)
11460 __Pyx_GOTREF(__pyx_t_5);
11462 __Pyx_XDECREF_SET(__pyx_v_idx, __pyx_t_5);
11464 __pyx_v_dim = __pyx_t_1;
11465 __pyx_t_1 = (__pyx_t_1 + 1);
11474 __pyx_t_6 = __Pyx_PyIndex_AsSsize_t(__pyx_v_idx);
if (unlikely((__pyx_t_6 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(2, 398, __pyx_L1_error)
11475 __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(2, 398, __pyx_L1_error)
11476 __pyx_v_itemp = __pyx_t_7;
11486 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
11495 __pyx_r = __pyx_v_itemp;
11508 __Pyx_XDECREF(__pyx_t_2);
11509 __Pyx_XDECREF(__pyx_t_5);
11510 __Pyx_AddTraceback(
"View.MemoryView.memoryview.get_item_pointer", __pyx_clineno, __pyx_lineno, __pyx_filename);
11513 __Pyx_XDECREF(__pyx_v_idx);
11514 __Pyx_RefNannyFinishContext();
11527 static PyObject *__pyx_memoryview___getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_index);
11528 static PyObject *__pyx_memoryview___getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_index) {
11529 PyObject *__pyx_r = 0;
11530 __Pyx_RefNannyDeclarations
11531 __Pyx_RefNannySetupContext(
"__getitem__ (wrapper)", 0);
11532 __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_4__getitem__(((
struct __pyx_memoryview_obj *)__pyx_v_self), ((PyObject *)__pyx_v_index));
11535 __Pyx_RefNannyFinishContext();
11539 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_4__getitem__(
struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index) {
11540 PyObject *__pyx_v_have_slices = NULL;
11541 PyObject *__pyx_v_indices = NULL;
11542 char *__pyx_v_itemp;
11543 PyObject *__pyx_r = NULL;
11544 __Pyx_RefNannyDeclarations
11547 PyObject *__pyx_t_3 = NULL;
11548 PyObject *__pyx_t_4 = NULL;
11549 PyObject *__pyx_t_5 = NULL;
11551 int __pyx_lineno = 0;
11552 const char *__pyx_filename = NULL;
11553 int __pyx_clineno = 0;
11554 __Pyx_RefNannySetupContext(
"__getitem__", 0);
11563 __pyx_t_1 = (__pyx_v_index == __pyx_builtin_Ellipsis);
11564 __pyx_t_2 = (__pyx_t_1 != 0);
11574 __Pyx_XDECREF(__pyx_r);
11575 __Pyx_INCREF(((PyObject *)__pyx_v_self));
11576 __pyx_r = ((PyObject *)__pyx_v_self);
11595 __pyx_t_3 = _unellipsify(__pyx_v_index, __pyx_v_self->view.ndim);
if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 407, __pyx_L1_error)
11596 __Pyx_GOTREF(__pyx_t_3);
11597 if (likely(__pyx_t_3 != Py_None)) {
11598 PyObject* sequence = __pyx_t_3;
11599 Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
11600 if (unlikely(size != 2)) {
11601 if (size > 2) __Pyx_RaiseTooManyValuesError(2);
11602 else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
11603 __PYX_ERR(2, 407, __pyx_L1_error)
11605 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
11606 __pyx_t_4 = PyTuple_GET_ITEM(sequence, 0);
11607 __pyx_t_5 = PyTuple_GET_ITEM(sequence, 1);
11608 __Pyx_INCREF(__pyx_t_4);
11609 __Pyx_INCREF(__pyx_t_5);
11611 __pyx_t_4 = PySequence_ITEM(sequence, 0);
if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 407, __pyx_L1_error)
11612 __Pyx_GOTREF(__pyx_t_4);
11613 __pyx_t_5 = PySequence_ITEM(sequence, 1);
if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 407, __pyx_L1_error)
11614 __Pyx_GOTREF(__pyx_t_5);
11616 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
11618 __Pyx_RaiseNoneNotIterableError(); __PYX_ERR(2, 407, __pyx_L1_error)
11620 __pyx_v_have_slices = __pyx_t_4;
11622 __pyx_v_indices = __pyx_t_5;
11632 __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_have_slices);
if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(2, 410, __pyx_L1_error)
11642 __Pyx_XDECREF(__pyx_r);
11643 __pyx_t_3 = ((PyObject *)__pyx_memview_slice(__pyx_v_self, __pyx_v_indices));
if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 411, __pyx_L1_error)
11644 __Pyx_GOTREF(__pyx_t_3);
11645 __pyx_r = __pyx_t_3;
11666 __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(2, 413, __pyx_L1_error)
11667 __pyx_v_itemp = __pyx_t_6;
11676 __Pyx_XDECREF(__pyx_r);
11677 __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(2, 414, __pyx_L1_error)
11678 __Pyx_GOTREF(__pyx_t_3);
11679 __pyx_r = __pyx_t_3;
11694 __Pyx_XDECREF(__pyx_t_3);
11695 __Pyx_XDECREF(__pyx_t_4);
11696 __Pyx_XDECREF(__pyx_t_5);
11697 __Pyx_AddTraceback(
"View.MemoryView.memoryview.__getitem__", __pyx_clineno, __pyx_lineno, __pyx_filename);
11700 __Pyx_XDECREF(__pyx_v_have_slices);
11701 __Pyx_XDECREF(__pyx_v_indices);
11702 __Pyx_XGIVEREF(__pyx_r);
11703 __Pyx_RefNannyFinishContext();
11716 static int __pyx_memoryview___setitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_index, PyObject *__pyx_v_value);
11717 static int __pyx_memoryview___setitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_index, PyObject *__pyx_v_value) {
11719 __Pyx_RefNannyDeclarations
11720 __Pyx_RefNannySetupContext(
"__setitem__ (wrapper)", 0);
11721 __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));
11724 __Pyx_RefNannyFinishContext();
11728 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) {
11729 PyObject *__pyx_v_have_slices = NULL;
11730 PyObject *__pyx_v_obj = NULL;
11732 __Pyx_RefNannyDeclarations
11734 PyObject *__pyx_t_2 = NULL;
11735 PyObject *__pyx_t_3 = NULL;
11736 PyObject *__pyx_t_4 = NULL;
11737 int __pyx_lineno = 0;
11738 const char *__pyx_filename = NULL;
11739 int __pyx_clineno = 0;
11740 __Pyx_RefNannySetupContext(
"__setitem__", 0);
11741 __Pyx_INCREF(__pyx_v_index);
11750 __pyx_t_1 = (__pyx_v_self->view.readonly != 0);
11751 if (unlikely(__pyx_t_1)) {
11760 __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__10, NULL);
if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 418, __pyx_L1_error)
11761 __Pyx_GOTREF(__pyx_t_2);
11762 __Pyx_Raise(__pyx_t_2, 0, 0, 0);
11763 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
11764 __PYX_ERR(2, 418, __pyx_L1_error)
11782 __pyx_t_2 = _unellipsify(__pyx_v_index, __pyx_v_self->view.ndim);
if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 420, __pyx_L1_error)
11783 __Pyx_GOTREF(__pyx_t_2);
11784 if (likely(__pyx_t_2 != Py_None)) {
11785 PyObject* sequence = __pyx_t_2;
11786 Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
11787 if (unlikely(size != 2)) {
11788 if (size > 2) __Pyx_RaiseTooManyValuesError(2);
11789 else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
11790 __PYX_ERR(2, 420, __pyx_L1_error)
11792 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
11793 __pyx_t_3 = PyTuple_GET_ITEM(sequence, 0);
11794 __pyx_t_4 = PyTuple_GET_ITEM(sequence, 1);
11795 __Pyx_INCREF(__pyx_t_3);
11796 __Pyx_INCREF(__pyx_t_4);
11798 __pyx_t_3 = PySequence_ITEM(sequence, 0);
if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 420, __pyx_L1_error)
11799 __Pyx_GOTREF(__pyx_t_3);
11800 __pyx_t_4 = PySequence_ITEM(sequence, 1);
if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 420, __pyx_L1_error)
11801 __Pyx_GOTREF(__pyx_t_4);
11803 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
11805 __Pyx_RaiseNoneNotIterableError(); __PYX_ERR(2, 420, __pyx_L1_error)
11807 __pyx_v_have_slices = __pyx_t_3;
11809 __Pyx_DECREF_SET(__pyx_v_index, __pyx_t_4);
11819 __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_have_slices);
if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(2, 422, __pyx_L1_error)
11829 __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(2, 423, __pyx_L1_error)
11830 __Pyx_GOTREF(__pyx_t_2);
11831 __pyx_v_obj = __pyx_t_2;
11841 __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_obj);
if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(2, 424, __pyx_L1_error)
11851 __pyx_t_2 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_self), __pyx_v_index);
if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 425, __pyx_L1_error)
11852 __Pyx_GOTREF(__pyx_t_2);
11853 __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(2, 425, __pyx_L1_error)
11854 __Pyx_GOTREF(__pyx_t_4);
11855 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
11856 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
11876 __pyx_t_4 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_self), __pyx_v_index);
if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 427, __pyx_L1_error)
11877 __Pyx_GOTREF(__pyx_t_4);
11878 if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_memoryview_type))))) __PYX_ERR(2, 427, __pyx_L1_error)
11879 __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(2, 427, __pyx_L1_error)
11880 __Pyx_GOTREF(__pyx_t_2);
11881 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
11882 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
11904 __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(2, 429, __pyx_L1_error)
11905 __Pyx_GOTREF(__pyx_t_2);
11906 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
11922 __Pyx_XDECREF(__pyx_t_2);
11923 __Pyx_XDECREF(__pyx_t_3);
11924 __Pyx_XDECREF(__pyx_t_4);
11925 __Pyx_AddTraceback(
"View.MemoryView.memoryview.__setitem__", __pyx_clineno, __pyx_lineno, __pyx_filename);
11928 __Pyx_XDECREF(__pyx_v_have_slices);
11929 __Pyx_XDECREF(__pyx_v_obj);
11930 __Pyx_XDECREF(__pyx_v_index);
11931 __Pyx_RefNannyFinishContext();
11943 static PyObject *__pyx_memoryview_is_slice(
struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_obj) {
11944 PyObject *__pyx_r = NULL;
11945 __Pyx_RefNannyDeclarations
11948 PyObject *__pyx_t_3 = NULL;
11949 PyObject *__pyx_t_4 = NULL;
11950 PyObject *__pyx_t_5 = NULL;
11951 PyObject *__pyx_t_6 = NULL;
11952 PyObject *__pyx_t_7 = NULL;
11953 PyObject *__pyx_t_8 = NULL;
11955 int __pyx_lineno = 0;
11956 const char *__pyx_filename = NULL;
11957 int __pyx_clineno = 0;
11958 __Pyx_RefNannySetupContext(
"is_slice", 0);
11959 __Pyx_INCREF(__pyx_v_obj);
11968 __pyx_t_1 = __Pyx_TypeCheck(__pyx_v_obj, __pyx_memoryview_type);
11969 __pyx_t_2 = ((!(__pyx_t_1 != 0)) != 0);
11980 __Pyx_PyThreadState_declare
11981 __Pyx_PyThreadState_assign
11982 __Pyx_ExceptionSave(&__pyx_t_3, &__pyx_t_4, &__pyx_t_5);
11983 __Pyx_XGOTREF(__pyx_t_3);
11984 __Pyx_XGOTREF(__pyx_t_4);
11985 __Pyx_XGOTREF(__pyx_t_5);
11995 __pyx_t_6 = __Pyx_PyInt_From_int(((__pyx_v_self->flags & (~PyBUF_WRITABLE)) | PyBUF_ANY_CONTIGUOUS));
if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 434, __pyx_L4_error)
11996 __Pyx_GOTREF(__pyx_t_6);
12005 __pyx_t_7 = __Pyx_PyBool_FromLong(__pyx_v_self->dtype_is_object);
if (unlikely(!__pyx_t_7)) __PYX_ERR(2, 435, __pyx_L4_error)
12006 __Pyx_GOTREF(__pyx_t_7);
12015 __pyx_t_8 = PyTuple_New(3);
if (unlikely(!__pyx_t_8)) __PYX_ERR(2, 434, __pyx_L4_error)
12016 __Pyx_GOTREF(__pyx_t_8);
12017 __Pyx_INCREF(__pyx_v_obj);
12018 __Pyx_GIVEREF(__pyx_v_obj);
12019 PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_v_obj);
12020 __Pyx_GIVEREF(__pyx_t_6);
12021 PyTuple_SET_ITEM(__pyx_t_8, 1, __pyx_t_6);
12022 __Pyx_GIVEREF(__pyx_t_7);
12023 PyTuple_SET_ITEM(__pyx_t_8, 2, __pyx_t_7);
12026 __pyx_t_7 = __Pyx_PyObject_Call(((PyObject *)__pyx_memoryview_type), __pyx_t_8, NULL);
if (unlikely(!__pyx_t_7)) __PYX_ERR(2, 434, __pyx_L4_error)
12027 __Pyx_GOTREF(__pyx_t_7);
12028 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
12029 __Pyx_DECREF_SET(__pyx_v_obj, __pyx_t_7);
12040 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
12041 __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
12042 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
12043 goto __pyx_L9_try_end;
12045 __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
12046 __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
12047 __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
12056 __pyx_t_9 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_TypeError);
12058 __Pyx_AddTraceback(
"View.MemoryView.memoryview.is_slice", __pyx_clineno, __pyx_lineno, __pyx_filename);
12059 if (__Pyx_GetException(&__pyx_t_7, &__pyx_t_8, &__pyx_t_6) < 0) __PYX_ERR(2, 436, __pyx_L6_except_error)
12060 __Pyx_GOTREF(__pyx_t_7);
12061 __Pyx_GOTREF(__pyx_t_8);
12062 __Pyx_GOTREF(__pyx_t_6);
12071 __Pyx_XDECREF(__pyx_r);
12072 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
12073 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
12074 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
12075 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
12076 goto __pyx_L7_except_return;
12078 goto __pyx_L6_except_error;
12079 __pyx_L6_except_error:;
12088 __Pyx_XGIVEREF(__pyx_t_3);
12089 __Pyx_XGIVEREF(__pyx_t_4);
12090 __Pyx_XGIVEREF(__pyx_t_5);
12091 __Pyx_ExceptionReset(__pyx_t_3, __pyx_t_4, __pyx_t_5);
12092 goto __pyx_L1_error;
12093 __pyx_L7_except_return:;
12094 __Pyx_XGIVEREF(__pyx_t_3);
12095 __Pyx_XGIVEREF(__pyx_t_4);
12096 __Pyx_XGIVEREF(__pyx_t_5);
12097 __Pyx_ExceptionReset(__pyx_t_3, __pyx_t_4, __pyx_t_5);
12118 __Pyx_XDECREF(__pyx_r);
12119 __Pyx_INCREF(__pyx_v_obj);
12120 __pyx_r = __pyx_v_obj;
12133 __Pyx_XDECREF(__pyx_t_6);
12134 __Pyx_XDECREF(__pyx_t_7);
12135 __Pyx_XDECREF(__pyx_t_8);
12136 __Pyx_AddTraceback(
"View.MemoryView.memoryview.is_slice", __pyx_clineno, __pyx_lineno, __pyx_filename);
12139 __Pyx_XDECREF(__pyx_v_obj);
12140 __Pyx_XGIVEREF(__pyx_r);
12141 __Pyx_RefNannyFinishContext();
12153 static PyObject *__pyx_memoryview_setitem_slice_assignment(
struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_dst, PyObject *__pyx_v_src) {
12154 __Pyx_memviewslice __pyx_v_dst_slice;
12155 __Pyx_memviewslice __pyx_v_src_slice;
12156 PyObject *__pyx_r = NULL;
12157 __Pyx_RefNannyDeclarations
12158 __Pyx_memviewslice *__pyx_t_1;
12159 __Pyx_memviewslice *__pyx_t_2;
12160 PyObject *__pyx_t_3 = NULL;
12164 int __pyx_lineno = 0;
12165 const char *__pyx_filename = NULL;
12166 int __pyx_clineno = 0;
12167 __Pyx_RefNannySetupContext(
"setitem_slice_assignment", 0);
12176 if (!(likely(((__pyx_v_src) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_src, __pyx_memoryview_type))))) __PYX_ERR(2, 445, __pyx_L1_error)
12177 __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(2, 445, __pyx_L1_error)
12186 if (!(likely(((__pyx_v_dst) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_dst, __pyx_memoryview_type))))) __PYX_ERR(2, 446, __pyx_L1_error)
12187 __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(2, 446, __pyx_L1_error)
12196 __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_src, __pyx_n_s_ndim);
if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 447, __pyx_L1_error)
12197 __Pyx_GOTREF(__pyx_t_3);
12198 __pyx_t_4 = __Pyx_PyInt_As_int(__pyx_t_3);
if (unlikely((__pyx_t_4 == (
int)-1) && PyErr_Occurred())) __PYX_ERR(2, 447, __pyx_L1_error)
12199 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
12200 __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_dst, __pyx_n_s_ndim);
if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 447, __pyx_L1_error)
12201 __Pyx_GOTREF(__pyx_t_3);
12202 __pyx_t_5 = __Pyx_PyInt_As_int(__pyx_t_3);
if (unlikely((__pyx_t_5 == (
int)-1) && PyErr_Occurred())) __PYX_ERR(2, 447, __pyx_L1_error)
12203 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
12212 __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(2, 445, __pyx_L1_error)
12223 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
12226 __Pyx_XDECREF(__pyx_t_3);
12227 __Pyx_AddTraceback(
"View.MemoryView.memoryview.setitem_slice_assignment", __pyx_clineno, __pyx_lineno, __pyx_filename);
12230 __Pyx_XGIVEREF(__pyx_r);
12231 __Pyx_RefNannyFinishContext();
12243 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) {
12244 int __pyx_v_array[0x80];
12246 void *__pyx_v_item;
12247 __Pyx_memviewslice *__pyx_v_dst_slice;
12248 __Pyx_memviewslice __pyx_v_tmp_slice;
12249 PyObject *__pyx_r = NULL;
12250 __Pyx_RefNannyDeclarations
12251 __Pyx_memviewslice *__pyx_t_1;
12253 PyObject *__pyx_t_3 = NULL;
12256 char const *__pyx_t_6;
12257 PyObject *__pyx_t_7 = NULL;
12258 PyObject *__pyx_t_8 = NULL;
12259 PyObject *__pyx_t_9 = NULL;
12260 PyObject *__pyx_t_10 = NULL;
12261 PyObject *__pyx_t_11 = NULL;
12262 PyObject *__pyx_t_12 = NULL;
12263 int __pyx_lineno = 0;
12264 const char *__pyx_filename = NULL;
12265 int __pyx_clineno = 0;
12266 __Pyx_RefNannySetupContext(
"setitem_slice_assign_scalar", 0);
12275 __pyx_v_tmp = NULL;
12284 __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(2, 456, __pyx_L1_error)
12285 __pyx_v_dst_slice = __pyx_t_1;
12294 __pyx_t_2 = ((((size_t)__pyx_v_self->view.itemsize) > (
sizeof(__pyx_v_array))) != 0);
12304 __pyx_v_tmp = PyMem_Malloc(__pyx_v_self->view.itemsize);
12313 __pyx_t_2 = ((__pyx_v_tmp == NULL) != 0);
12314 if (unlikely(__pyx_t_2)) {
12323 PyErr_NoMemory(); __PYX_ERR(2, 461, __pyx_L1_error)
12341 __pyx_v_item = __pyx_v_tmp;
12361 __pyx_v_item = ((
void *)__pyx_v_array);
12381 __pyx_t_2 = (__pyx_v_self->dtype_is_object != 0);
12391 (((PyObject **)__pyx_v_item)[0]) = ((PyObject *)__pyx_v_value);
12411 __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(2, 470, __pyx_L6_error)
12412 __Pyx_GOTREF(__pyx_t_3);
12413 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
12424 __pyx_t_2 = ((__pyx_v_self->view.suboffsets != NULL) != 0);
12434 __pyx_t_3 = assert_direct_dimensions(__pyx_v_self->view.suboffsets, __pyx_v_self->view.ndim);
if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 475, __pyx_L6_error)
12435 __Pyx_GOTREF(__pyx_t_3);
12436 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
12454 __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);
12466 PyMem_Free(__pyx_v_tmp);
12471 __Pyx_PyThreadState_declare
12472 __Pyx_PyThreadState_assign
12473 __pyx_t_7 = 0; __pyx_t_8 = 0; __pyx_t_9 = 0; __pyx_t_10 = 0; __pyx_t_11 = 0; __pyx_t_12 = 0;
12474 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
12475 if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_10, &__pyx_t_11, &__pyx_t_12);
12476 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);
12477 __Pyx_XGOTREF(__pyx_t_7);
12478 __Pyx_XGOTREF(__pyx_t_8);
12479 __Pyx_XGOTREF(__pyx_t_9);
12480 __Pyx_XGOTREF(__pyx_t_10);
12481 __Pyx_XGOTREF(__pyx_t_11);
12482 __Pyx_XGOTREF(__pyx_t_12);
12483 __pyx_t_4 = __pyx_lineno; __pyx_t_5 = __pyx_clineno; __pyx_t_6 = __pyx_filename;
12485 PyMem_Free(__pyx_v_tmp);
12487 if (PY_MAJOR_VERSION >= 3) {
12488 __Pyx_XGIVEREF(__pyx_t_10);
12489 __Pyx_XGIVEREF(__pyx_t_11);
12490 __Pyx_XGIVEREF(__pyx_t_12);
12491 __Pyx_ExceptionReset(__pyx_t_10, __pyx_t_11, __pyx_t_12);
12493 __Pyx_XGIVEREF(__pyx_t_7);
12494 __Pyx_XGIVEREF(__pyx_t_8);
12495 __Pyx_XGIVEREF(__pyx_t_9);
12496 __Pyx_ErrRestore(__pyx_t_7, __pyx_t_8, __pyx_t_9);
12497 __pyx_t_7 = 0; __pyx_t_8 = 0; __pyx_t_9 = 0; __pyx_t_10 = 0; __pyx_t_11 = 0; __pyx_t_12 = 0;
12498 __pyx_lineno = __pyx_t_4; __pyx_clineno = __pyx_t_5; __pyx_filename = __pyx_t_6;
12499 goto __pyx_L1_error;
12513 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
12516 __Pyx_XDECREF(__pyx_t_3);
12517 __Pyx_AddTraceback(
"View.MemoryView.memoryview.setitem_slice_assign_scalar", __pyx_clineno, __pyx_lineno, __pyx_filename);
12520 __Pyx_XGIVEREF(__pyx_r);
12521 __Pyx_RefNannyFinishContext();
12533 static PyObject *__pyx_memoryview_setitem_indexed(
struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index, PyObject *__pyx_v_value) {
12534 char *__pyx_v_itemp;
12535 PyObject *__pyx_r = NULL;
12536 __Pyx_RefNannyDeclarations
12538 PyObject *__pyx_t_2 = NULL;
12539 int __pyx_lineno = 0;
12540 const char *__pyx_filename = NULL;
12541 int __pyx_clineno = 0;
12542 __Pyx_RefNannySetupContext(
"setitem_indexed", 0);
12551 __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(2, 482, __pyx_L1_error)
12552 __pyx_v_itemp = __pyx_t_1;
12561 __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(2, 483, __pyx_L1_error)
12562 __Pyx_GOTREF(__pyx_t_2);
12563 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
12574 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
12577 __Pyx_XDECREF(__pyx_t_2);
12578 __Pyx_AddTraceback(
"View.MemoryView.memoryview.setitem_indexed", __pyx_clineno, __pyx_lineno, __pyx_filename);
12581 __Pyx_XGIVEREF(__pyx_r);
12582 __Pyx_RefNannyFinishContext();
12594 static PyObject *__pyx_memoryview_convert_item_to_object(
struct __pyx_memoryview_obj *__pyx_v_self,
char *__pyx_v_itemp) {
12595 PyObject *__pyx_v_struct = NULL;
12596 PyObject *__pyx_v_bytesitem = 0;
12597 PyObject *__pyx_v_result = NULL;
12598 PyObject *__pyx_r = NULL;
12599 __Pyx_RefNannyDeclarations
12600 PyObject *__pyx_t_1 = NULL;
12601 PyObject *__pyx_t_2 = NULL;
12602 PyObject *__pyx_t_3 = NULL;
12603 PyObject *__pyx_t_4 = NULL;
12604 PyObject *__pyx_t_5 = NULL;
12605 PyObject *__pyx_t_6 = NULL;
12606 PyObject *__pyx_t_7 = NULL;
12608 PyObject *__pyx_t_9 = NULL;
12611 int __pyx_lineno = 0;
12612 const char *__pyx_filename = NULL;
12613 int __pyx_clineno = 0;
12614 __Pyx_RefNannySetupContext(
"convert_item_to_object", 0);
12623 __pyx_t_1 = __Pyx_Import(__pyx_n_s_struct, 0, 0);
if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 488, __pyx_L1_error)
12624 __Pyx_GOTREF(__pyx_t_1);
12625 __pyx_v_struct = __pyx_t_1;
12635 __pyx_t_1 = __Pyx_PyBytes_FromStringAndSize(__pyx_v_itemp + 0, __pyx_v_self->view.itemsize - 0);
if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 491, __pyx_L1_error)
12636 __Pyx_GOTREF(__pyx_t_1);
12637 __pyx_v_bytesitem = ((PyObject*)__pyx_t_1);
12648 __Pyx_PyThreadState_declare
12649 __Pyx_PyThreadState_assign
12650 __Pyx_ExceptionSave(&__pyx_t_2, &__pyx_t_3, &__pyx_t_4);
12651 __Pyx_XGOTREF(__pyx_t_2);
12652 __Pyx_XGOTREF(__pyx_t_3);
12653 __Pyx_XGOTREF(__pyx_t_4);
12663 __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_struct, __pyx_n_s_unpack);
if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 493, __pyx_L3_error)
12664 __Pyx_GOTREF(__pyx_t_5);
12665 __pyx_t_6 = __Pyx_PyBytes_FromString(__pyx_v_self->view.format);
if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 493, __pyx_L3_error)
12666 __Pyx_GOTREF(__pyx_t_6);
12669 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) {
12670 __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_5);
12671 if (likely(__pyx_t_7)) {
12672 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_5);
12673 __Pyx_INCREF(__pyx_t_7);
12674 __Pyx_INCREF(
function);
12675 __Pyx_DECREF_SET(__pyx_t_5,
function);
12679 #if CYTHON_FAST_PYCALL
12680 if (PyFunction_Check(__pyx_t_5)) {
12681 PyObject *__pyx_temp[3] = {__pyx_t_7, __pyx_t_6, __pyx_v_bytesitem};
12682 __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(2, 493, __pyx_L3_error)
12683 __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
12684 __Pyx_GOTREF(__pyx_t_1);
12685 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
12688 #if CYTHON_FAST_PYCCALL
12689 if (__Pyx_PyFastCFunction_Check(__pyx_t_5)) {
12690 PyObject *__pyx_temp[3] = {__pyx_t_7, __pyx_t_6, __pyx_v_bytesitem};
12691 __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(2, 493, __pyx_L3_error)
12692 __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
12693 __Pyx_GOTREF(__pyx_t_1);
12694 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
12698 __pyx_t_9 = PyTuple_New(2+__pyx_t_8);
if (unlikely(!__pyx_t_9)) __PYX_ERR(2, 493, __pyx_L3_error)
12699 __Pyx_GOTREF(__pyx_t_9);
12701 __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_7); __pyx_t_7 = NULL;
12703 __Pyx_GIVEREF(__pyx_t_6);
12704 PyTuple_SET_ITEM(__pyx_t_9, 0+__pyx_t_8, __pyx_t_6);
12705 __Pyx_INCREF(__pyx_v_bytesitem);
12706 __Pyx_GIVEREF(__pyx_v_bytesitem);
12707 PyTuple_SET_ITEM(__pyx_t_9, 1+__pyx_t_8, __pyx_v_bytesitem);
12709 __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_9, NULL);
if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 493, __pyx_L3_error)
12710 __Pyx_GOTREF(__pyx_t_1);
12711 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
12713 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
12714 __pyx_v_result = __pyx_t_1;
12734 __pyx_t_10 = strlen(__pyx_v_self->view.format);
12735 __pyx_t_11 = ((__pyx_t_10 == 1) != 0);
12745 __Pyx_XDECREF(__pyx_r);
12746 __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(2, 498, __pyx_L5_except_error)
12747 __Pyx_GOTREF(__pyx_t_1);
12748 __pyx_r = __pyx_t_1;
12750 goto __pyx_L6_except_return;
12768 __Pyx_XDECREF(__pyx_r);
12769 __Pyx_INCREF(__pyx_v_result);
12770 __pyx_r = __pyx_v_result;
12771 goto __pyx_L6_except_return;
12774 __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
12775 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
12776 __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
12777 __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
12778 __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
12787 __Pyx_ErrFetch(&__pyx_t_1, &__pyx_t_5, &__pyx_t_9);
12788 __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_struct, __pyx_n_s_error);
if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 494, __pyx_L5_except_error)
12789 __Pyx_GOTREF(__pyx_t_6);
12790 __pyx_t_8 = __Pyx_PyErr_GivenExceptionMatches(__pyx_t_1, __pyx_t_6);
12791 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
12792 __Pyx_ErrRestore(__pyx_t_1, __pyx_t_5, __pyx_t_9);
12793 __pyx_t_1 = 0; __pyx_t_5 = 0; __pyx_t_9 = 0;
12795 __Pyx_AddTraceback(
"View.MemoryView.memoryview.convert_item_to_object", __pyx_clineno, __pyx_lineno, __pyx_filename);
12796 if (__Pyx_GetException(&__pyx_t_9, &__pyx_t_5, &__pyx_t_1) < 0) __PYX_ERR(2, 494, __pyx_L5_except_error)
12797 __Pyx_GOTREF(__pyx_t_9);
12798 __Pyx_GOTREF(__pyx_t_5);
12799 __Pyx_GOTREF(__pyx_t_1);
12808 __pyx_t_6 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__11, NULL);
if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 495, __pyx_L5_except_error)
12809 __Pyx_GOTREF(__pyx_t_6);
12810 __Pyx_Raise(__pyx_t_6, 0, 0, 0);
12811 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
12812 __PYX_ERR(2, 495, __pyx_L5_except_error)
12814 goto __pyx_L5_except_error;
12815 __pyx_L5_except_error:;
12824 __Pyx_XGIVEREF(__pyx_t_2);
12825 __Pyx_XGIVEREF(__pyx_t_3);
12826 __Pyx_XGIVEREF(__pyx_t_4);
12827 __Pyx_ExceptionReset(__pyx_t_2, __pyx_t_3, __pyx_t_4);
12828 goto __pyx_L1_error;
12829 __pyx_L6_except_return:;
12830 __Pyx_XGIVEREF(__pyx_t_2);
12831 __Pyx_XGIVEREF(__pyx_t_3);
12832 __Pyx_XGIVEREF(__pyx_t_4);
12833 __Pyx_ExceptionReset(__pyx_t_2, __pyx_t_3, __pyx_t_4);
12847 __Pyx_XDECREF(__pyx_t_1);
12848 __Pyx_XDECREF(__pyx_t_5);
12849 __Pyx_XDECREF(__pyx_t_6);
12850 __Pyx_XDECREF(__pyx_t_7);
12851 __Pyx_XDECREF(__pyx_t_9);
12852 __Pyx_AddTraceback(
"View.MemoryView.memoryview.convert_item_to_object", __pyx_clineno, __pyx_lineno, __pyx_filename);
12855 __Pyx_XDECREF(__pyx_v_struct);
12856 __Pyx_XDECREF(__pyx_v_bytesitem);
12857 __Pyx_XDECREF(__pyx_v_result);
12858 __Pyx_XGIVEREF(__pyx_r);
12859 __Pyx_RefNannyFinishContext();
12871 static PyObject *__pyx_memoryview_assign_item_from_object(
struct __pyx_memoryview_obj *__pyx_v_self,
char *__pyx_v_itemp, PyObject *__pyx_v_value) {
12872 PyObject *__pyx_v_struct = NULL;
12874 PyObject *__pyx_v_bytesvalue = 0;
12875 Py_ssize_t __pyx_v_i;
12876 PyObject *__pyx_r = NULL;
12877 __Pyx_RefNannyDeclarations
12878 PyObject *__pyx_t_1 = NULL;
12881 PyObject *__pyx_t_4 = NULL;
12882 PyObject *__pyx_t_5 = NULL;
12883 PyObject *__pyx_t_6 = NULL;
12885 PyObject *__pyx_t_8 = NULL;
12886 Py_ssize_t __pyx_t_9;
12887 PyObject *__pyx_t_10 = NULL;
12892 int __pyx_lineno = 0;
12893 const char *__pyx_filename = NULL;
12894 int __pyx_clineno = 0;
12895 __Pyx_RefNannySetupContext(
"assign_item_from_object", 0);
12904 __pyx_t_1 = __Pyx_Import(__pyx_n_s_struct, 0, 0);
if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 504, __pyx_L1_error)
12905 __Pyx_GOTREF(__pyx_t_1);
12906 __pyx_v_struct = __pyx_t_1;
12916 __pyx_t_2 = PyTuple_Check(__pyx_v_value);
12917 __pyx_t_3 = (__pyx_t_2 != 0);
12927 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_struct, __pyx_n_s_pack);
if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 510, __pyx_L1_error)
12928 __Pyx_GOTREF(__pyx_t_1);
12929 __pyx_t_4 = __Pyx_PyBytes_FromString(__pyx_v_self->view.format);
if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 510, __pyx_L1_error)
12930 __Pyx_GOTREF(__pyx_t_4);
12931 __pyx_t_5 = PyTuple_New(1);
if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 510, __pyx_L1_error)
12932 __Pyx_GOTREF(__pyx_t_5);
12933 __Pyx_GIVEREF(__pyx_t_4);
12934 PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4);
12936 __pyx_t_4 = __Pyx_PySequence_Tuple(__pyx_v_value);
if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 510, __pyx_L1_error)
12937 __Pyx_GOTREF(__pyx_t_4);
12938 __pyx_t_6 = PyNumber_Add(__pyx_t_5, __pyx_t_4);
if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 510, __pyx_L1_error)
12939 __Pyx_GOTREF(__pyx_t_6);
12940 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
12941 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
12942 __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_6, NULL);
if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 510, __pyx_L1_error)
12943 __Pyx_GOTREF(__pyx_t_4);
12944 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
12945 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
12946 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(2, 510, __pyx_L1_error)
12947 __pyx_v_bytesvalue = ((PyObject*)__pyx_t_4);
12968 __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_struct, __pyx_n_s_pack);
if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 512, __pyx_L1_error)
12969 __Pyx_GOTREF(__pyx_t_6);
12970 __pyx_t_1 = __Pyx_PyBytes_FromString(__pyx_v_self->view.format);
if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 512, __pyx_L1_error)
12971 __Pyx_GOTREF(__pyx_t_1);
12974 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_6))) {
12975 __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_6);
12976 if (likely(__pyx_t_5)) {
12977 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_6);
12978 __Pyx_INCREF(__pyx_t_5);
12979 __Pyx_INCREF(
function);
12980 __Pyx_DECREF_SET(__pyx_t_6,
function);
12984 #if CYTHON_FAST_PYCALL
12985 if (PyFunction_Check(__pyx_t_6)) {
12986 PyObject *__pyx_temp[3] = {__pyx_t_5, __pyx_t_1, __pyx_v_value};
12987 __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(2, 512, __pyx_L1_error)
12988 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
12989 __Pyx_GOTREF(__pyx_t_4);
12990 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
12993 #if CYTHON_FAST_PYCCALL
12994 if (__Pyx_PyFastCFunction_Check(__pyx_t_6)) {
12995 PyObject *__pyx_temp[3] = {__pyx_t_5, __pyx_t_1, __pyx_v_value};
12996 __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(2, 512, __pyx_L1_error)
12997 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
12998 __Pyx_GOTREF(__pyx_t_4);
12999 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
13003 __pyx_t_8 = PyTuple_New(2+__pyx_t_7);
if (unlikely(!__pyx_t_8)) __PYX_ERR(2, 512, __pyx_L1_error)
13004 __Pyx_GOTREF(__pyx_t_8);
13006 __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_5); __pyx_t_5 = NULL;
13008 __Pyx_GIVEREF(__pyx_t_1);
13009 PyTuple_SET_ITEM(__pyx_t_8, 0+__pyx_t_7, __pyx_t_1);
13010 __Pyx_INCREF(__pyx_v_value);
13011 __Pyx_GIVEREF(__pyx_v_value);
13012 PyTuple_SET_ITEM(__pyx_t_8, 1+__pyx_t_7, __pyx_v_value);
13014 __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_8, NULL);
if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 512, __pyx_L1_error)
13015 __Pyx_GOTREF(__pyx_t_4);
13016 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
13018 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
13019 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(2, 512, __pyx_L1_error)
13020 __pyx_v_bytesvalue = ((PyObject*)__pyx_t_4);
13033 if (unlikely(__pyx_v_bytesvalue == Py_None)) {
13034 PyErr_SetString(PyExc_TypeError,
"'NoneType' is not iterable");
13035 __PYX_ERR(2, 514, __pyx_L1_error)
13037 __Pyx_INCREF(__pyx_v_bytesvalue);
13038 __pyx_t_10 = __pyx_v_bytesvalue;
13039 __pyx_t_12 = PyBytes_AS_STRING(__pyx_t_10);
13040 __pyx_t_13 = (__pyx_t_12 + PyBytes_GET_SIZE(__pyx_t_10));
13041 for (__pyx_t_14 = __pyx_t_12; __pyx_t_14 < __pyx_t_13; __pyx_t_14++) {
13042 __pyx_t_11 = __pyx_t_14;
13043 __pyx_v_c = (__pyx_t_11[0]);
13052 __pyx_v_i = __pyx_t_9;
13061 __pyx_t_9 = (__pyx_t_9 + 1);
13070 (__pyx_v_itemp[__pyx_v_i]) = __pyx_v_c;
13072 __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
13083 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
13086 __Pyx_XDECREF(__pyx_t_1);
13087 __Pyx_XDECREF(__pyx_t_4);
13088 __Pyx_XDECREF(__pyx_t_5);
13089 __Pyx_XDECREF(__pyx_t_6);
13090 __Pyx_XDECREF(__pyx_t_8);
13091 __Pyx_XDECREF(__pyx_t_10);
13092 __Pyx_AddTraceback(
"View.MemoryView.memoryview.assign_item_from_object", __pyx_clineno, __pyx_lineno, __pyx_filename);
13095 __Pyx_XDECREF(__pyx_v_struct);
13096 __Pyx_XDECREF(__pyx_v_bytesvalue);
13097 __Pyx_XGIVEREF(__pyx_r);
13098 __Pyx_RefNannyFinishContext();
13111 static CYTHON_UNUSED
int __pyx_memoryview_getbuffer(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info,
int __pyx_v_flags);
13112 static CYTHON_UNUSED
int __pyx_memoryview_getbuffer(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info,
int __pyx_v_flags) {
13114 __Pyx_RefNannyDeclarations
13115 __Pyx_RefNannySetupContext(
"__getbuffer__ (wrapper)", 0);
13116 __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));
13119 __Pyx_RefNannyFinishContext();
13123 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) {
13125 __Pyx_RefNannyDeclarations
13128 PyObject *__pyx_t_3 = NULL;
13129 Py_ssize_t *__pyx_t_4;
13133 Py_ssize_t __pyx_t_8;
13134 int __pyx_lineno = 0;
13135 const char *__pyx_filename = NULL;
13136 int __pyx_clineno = 0;
13137 if (__pyx_v_info == NULL) {
13138 PyErr_SetString(PyExc_BufferError,
"PyObject_GetBuffer: view==NULL argument is obsolete");
13141 __Pyx_RefNannySetupContext(
"__getbuffer__", 0);
13142 __pyx_v_info->obj = Py_None; __Pyx_INCREF(Py_None);
13143 __Pyx_GIVEREF(__pyx_v_info->obj);
13152 __pyx_t_2 = ((__pyx_v_flags & PyBUF_WRITABLE) != 0);
13155 __pyx_t_1 = __pyx_t_2;
13156 goto __pyx_L4_bool_binop_done;
13158 __pyx_t_2 = (__pyx_v_self->view.readonly != 0);
13159 __pyx_t_1 = __pyx_t_2;
13160 __pyx_L4_bool_binop_done:;
13161 if (unlikely(__pyx_t_1)) {
13170 __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__12, NULL);
if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 520, __pyx_L1_error)
13171 __Pyx_GOTREF(__pyx_t_3);
13172 __Pyx_Raise(__pyx_t_3, 0, 0, 0);
13173 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
13174 __PYX_ERR(2, 520, __pyx_L1_error)
13192 __pyx_t_1 = ((__pyx_v_flags & PyBUF_ND) != 0);
13202 __pyx_t_4 = __pyx_v_self->view.shape;
13203 __pyx_v_info->shape = __pyx_t_4;
13223 __pyx_v_info->shape = NULL;
13234 __pyx_t_1 = ((__pyx_v_flags & PyBUF_STRIDES) != 0);
13244 __pyx_t_4 = __pyx_v_self->view.strides;
13245 __pyx_v_info->strides = __pyx_t_4;
13265 __pyx_v_info->strides = NULL;
13276 __pyx_t_1 = ((__pyx_v_flags & PyBUF_INDIRECT) != 0);
13286 __pyx_t_4 = __pyx_v_self->view.suboffsets;
13287 __pyx_v_info->suboffsets = __pyx_t_4;
13307 __pyx_v_info->suboffsets = NULL;
13318 __pyx_t_1 = ((__pyx_v_flags & PyBUF_FORMAT) != 0);
13328 __pyx_t_5 = __pyx_v_self->view.format;
13329 __pyx_v_info->format = __pyx_t_5;
13349 __pyx_v_info->format = NULL;
13360 __pyx_t_6 = __pyx_v_self->view.buf;
13361 __pyx_v_info->buf = __pyx_t_6;
13370 __pyx_t_7 = __pyx_v_self->view.ndim;
13371 __pyx_v_info->ndim = __pyx_t_7;
13380 __pyx_t_8 = __pyx_v_self->view.itemsize;
13381 __pyx_v_info->itemsize = __pyx_t_8;
13390 __pyx_t_8 = __pyx_v_self->view.len;
13391 __pyx_v_info->len = __pyx_t_8;
13400 __pyx_t_1 = __pyx_v_self->view.readonly;
13401 __pyx_v_info->readonly = __pyx_t_1;
13410 __Pyx_INCREF(((PyObject *)__pyx_v_self));
13411 __Pyx_GIVEREF(((PyObject *)__pyx_v_self));
13412 __Pyx_GOTREF(__pyx_v_info->obj);
13413 __Pyx_DECREF(__pyx_v_info->obj);
13414 __pyx_v_info->obj = ((PyObject *)__pyx_v_self);
13428 __Pyx_XDECREF(__pyx_t_3);
13429 __Pyx_AddTraceback(
"View.MemoryView.memoryview.__getbuffer__", __pyx_clineno, __pyx_lineno, __pyx_filename);
13431 if (__pyx_v_info->obj != NULL) {
13432 __Pyx_GOTREF(__pyx_v_info->obj);
13433 __Pyx_DECREF(__pyx_v_info->obj); __pyx_v_info->obj = 0;
13437 if (__pyx_v_info->obj == Py_None) {
13438 __Pyx_GOTREF(__pyx_v_info->obj);
13439 __Pyx_DECREF(__pyx_v_info->obj); __pyx_v_info->obj = 0;
13442 __Pyx_RefNannyFinishContext();
13455 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_1T_1__get__(PyObject *__pyx_v_self);
13456 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_1T_1__get__(PyObject *__pyx_v_self) {
13457 PyObject *__pyx_r = 0;
13458 __Pyx_RefNannyDeclarations
13459 __Pyx_RefNannySetupContext(
"__get__ (wrapper)", 0);
13460 __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_1T___get__(((
struct __pyx_memoryview_obj *)__pyx_v_self));
13463 __Pyx_RefNannyFinishContext();
13467 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_1T___get__(
struct __pyx_memoryview_obj *__pyx_v_self) {
13468 struct __pyx_memoryviewslice_obj *__pyx_v_result = 0;
13469 PyObject *__pyx_r = NULL;
13470 __Pyx_RefNannyDeclarations
13471 PyObject *__pyx_t_1 = NULL;
13473 int __pyx_lineno = 0;
13474 const char *__pyx_filename = NULL;
13475 int __pyx_clineno = 0;
13476 __Pyx_RefNannySetupContext(
"__get__", 0);
13485 __pyx_t_1 = __pyx_memoryview_copy_object(__pyx_v_self);
if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 554, __pyx_L1_error)
13486 __Pyx_GOTREF(__pyx_t_1);
13487 if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_memoryviewslice_type))))) __PYX_ERR(2, 554, __pyx_L1_error)
13488 __pyx_v_result = ((
struct __pyx_memoryviewslice_obj *)__pyx_t_1);
13498 __pyx_t_2 = __pyx_memslice_transpose((&__pyx_v_result->from_slice));
if (unlikely(__pyx_t_2 == ((
int)0))) __PYX_ERR(2, 555, __pyx_L1_error)
13507 __Pyx_XDECREF(__pyx_r);
13508 __Pyx_INCREF(((PyObject *)__pyx_v_result));
13509 __pyx_r = ((PyObject *)__pyx_v_result);
13522 __Pyx_XDECREF(__pyx_t_1);
13523 __Pyx_AddTraceback(
"View.MemoryView.memoryview.T.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
13526 __Pyx_XDECREF((PyObject *)__pyx_v_result);
13527 __Pyx_XGIVEREF(__pyx_r);
13528 __Pyx_RefNannyFinishContext();
13541 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_4base_1__get__(PyObject *__pyx_v_self);
13542 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_4base_1__get__(PyObject *__pyx_v_self) {
13543 PyObject *__pyx_r = 0;
13544 __Pyx_RefNannyDeclarations
13545 __Pyx_RefNannySetupContext(
"__get__ (wrapper)", 0);
13546 __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_4base___get__(((
struct __pyx_memoryview_obj *)__pyx_v_self));
13549 __Pyx_RefNannyFinishContext();
13553 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_4base___get__(
struct __pyx_memoryview_obj *__pyx_v_self) {
13554 PyObject *__pyx_r = NULL;
13555 __Pyx_RefNannyDeclarations
13556 __Pyx_RefNannySetupContext(
"__get__", 0);
13565 __Pyx_XDECREF(__pyx_r);
13566 __Pyx_INCREF(__pyx_v_self->obj);
13567 __pyx_r = __pyx_v_self->obj;
13580 __Pyx_XGIVEREF(__pyx_r);
13581 __Pyx_RefNannyFinishContext();
13594 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_5shape_1__get__(PyObject *__pyx_v_self);
13595 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_5shape_1__get__(PyObject *__pyx_v_self) {
13596 PyObject *__pyx_r = 0;
13597 __Pyx_RefNannyDeclarations
13598 __Pyx_RefNannySetupContext(
"__get__ (wrapper)", 0);
13599 __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_5shape___get__(((
struct __pyx_memoryview_obj *)__pyx_v_self));
13602 __Pyx_RefNannyFinishContext();
13606 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_5shape___get__(
struct __pyx_memoryview_obj *__pyx_v_self) {
13607 Py_ssize_t __pyx_v_length;
13608 PyObject *__pyx_r = NULL;
13609 __Pyx_RefNannyDeclarations
13610 PyObject *__pyx_t_1 = NULL;
13611 Py_ssize_t *__pyx_t_2;
13612 Py_ssize_t *__pyx_t_3;
13613 Py_ssize_t *__pyx_t_4;
13614 PyObject *__pyx_t_5 = NULL;
13615 int __pyx_lineno = 0;
13616 const char *__pyx_filename = NULL;
13617 int __pyx_clineno = 0;
13618 __Pyx_RefNannySetupContext(
"__get__", 0);
13627 __Pyx_XDECREF(__pyx_r);
13628 __pyx_t_1 = PyList_New(0);
if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 564, __pyx_L1_error)
13629 __Pyx_GOTREF(__pyx_t_1);
13630 __pyx_t_3 = (__pyx_v_self->view.shape + __pyx_v_self->view.ndim);
13631 for (__pyx_t_4 = __pyx_v_self->view.shape; __pyx_t_4 < __pyx_t_3; __pyx_t_4++) {
13632 __pyx_t_2 = __pyx_t_4;
13633 __pyx_v_length = (__pyx_t_2[0]);
13634 __pyx_t_5 = PyInt_FromSsize_t(__pyx_v_length);
if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 564, __pyx_L1_error)
13635 __Pyx_GOTREF(__pyx_t_5);
13636 if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_t_5))) __PYX_ERR(2, 564, __pyx_L1_error)
13637 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
13639 __pyx_t_5 = PyList_AsTuple(((PyObject*)__pyx_t_1));
if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 564, __pyx_L1_error)
13640 __Pyx_GOTREF(__pyx_t_5);
13641 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
13642 __pyx_r = __pyx_t_5;
13656 __Pyx_XDECREF(__pyx_t_1);
13657 __Pyx_XDECREF(__pyx_t_5);
13658 __Pyx_AddTraceback(
"View.MemoryView.memoryview.shape.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
13661 __Pyx_XGIVEREF(__pyx_r);
13662 __Pyx_RefNannyFinishContext();
13675 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_7strides_1__get__(PyObject *__pyx_v_self);
13676 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_7strides_1__get__(PyObject *__pyx_v_self) {
13677 PyObject *__pyx_r = 0;
13678 __Pyx_RefNannyDeclarations
13679 __Pyx_RefNannySetupContext(
"__get__ (wrapper)", 0);
13680 __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_7strides___get__(((
struct __pyx_memoryview_obj *)__pyx_v_self));
13683 __Pyx_RefNannyFinishContext();
13687 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_7strides___get__(
struct __pyx_memoryview_obj *__pyx_v_self) {
13688 Py_ssize_t __pyx_v_stride;
13689 PyObject *__pyx_r = NULL;
13690 __Pyx_RefNannyDeclarations
13692 PyObject *__pyx_t_2 = NULL;
13693 Py_ssize_t *__pyx_t_3;
13694 Py_ssize_t *__pyx_t_4;
13695 Py_ssize_t *__pyx_t_5;
13696 PyObject *__pyx_t_6 = NULL;
13697 int __pyx_lineno = 0;
13698 const char *__pyx_filename = NULL;
13699 int __pyx_clineno = 0;
13700 __Pyx_RefNannySetupContext(
"__get__", 0);
13709 __pyx_t_1 = ((__pyx_v_self->view.strides == NULL) != 0);
13710 if (unlikely(__pyx_t_1)) {
13719 __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__13, NULL);
if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 570, __pyx_L1_error)
13720 __Pyx_GOTREF(__pyx_t_2);
13721 __Pyx_Raise(__pyx_t_2, 0, 0, 0);
13722 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
13723 __PYX_ERR(2, 570, __pyx_L1_error)
13741 __Pyx_XDECREF(__pyx_r);
13742 __pyx_t_2 = PyList_New(0);
if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 572, __pyx_L1_error)
13743 __Pyx_GOTREF(__pyx_t_2);
13744 __pyx_t_4 = (__pyx_v_self->view.strides + __pyx_v_self->view.ndim);
13745 for (__pyx_t_5 = __pyx_v_self->view.strides; __pyx_t_5 < __pyx_t_4; __pyx_t_5++) {
13746 __pyx_t_3 = __pyx_t_5;
13747 __pyx_v_stride = (__pyx_t_3[0]);
13748 __pyx_t_6 = PyInt_FromSsize_t(__pyx_v_stride);
if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 572, __pyx_L1_error)
13749 __Pyx_GOTREF(__pyx_t_6);
13750 if (unlikely(__Pyx_ListComp_Append(__pyx_t_2, (PyObject*)__pyx_t_6))) __PYX_ERR(2, 572, __pyx_L1_error)
13751 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
13753 __pyx_t_6 = PyList_AsTuple(((PyObject*)__pyx_t_2));
if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 572, __pyx_L1_error)
13754 __Pyx_GOTREF(__pyx_t_6);
13755 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
13756 __pyx_r = __pyx_t_6;
13770 __Pyx_XDECREF(__pyx_t_2);
13771 __Pyx_XDECREF(__pyx_t_6);
13772 __Pyx_AddTraceback(
"View.MemoryView.memoryview.strides.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
13775 __Pyx_XGIVEREF(__pyx_r);
13776 __Pyx_RefNannyFinishContext();
13789 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_10suboffsets_1__get__(PyObject *__pyx_v_self);
13790 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_10suboffsets_1__get__(PyObject *__pyx_v_self) {
13791 PyObject *__pyx_r = 0;
13792 __Pyx_RefNannyDeclarations
13793 __Pyx_RefNannySetupContext(
"__get__ (wrapper)", 0);
13794 __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_10suboffsets___get__(((
struct __pyx_memoryview_obj *)__pyx_v_self));
13797 __Pyx_RefNannyFinishContext();
13801 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_10suboffsets___get__(
struct __pyx_memoryview_obj *__pyx_v_self) {
13802 Py_ssize_t __pyx_v_suboffset;
13803 PyObject *__pyx_r = NULL;
13804 __Pyx_RefNannyDeclarations
13806 PyObject *__pyx_t_2 = NULL;
13807 PyObject *__pyx_t_3 = NULL;
13808 Py_ssize_t *__pyx_t_4;
13809 Py_ssize_t *__pyx_t_5;
13810 Py_ssize_t *__pyx_t_6;
13811 int __pyx_lineno = 0;
13812 const char *__pyx_filename = NULL;
13813 int __pyx_clineno = 0;
13814 __Pyx_RefNannySetupContext(
"__get__", 0);
13823 __pyx_t_1 = ((__pyx_v_self->view.suboffsets == NULL) != 0);
13833 __Pyx_XDECREF(__pyx_r);
13834 __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_self->view.ndim);
if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 577, __pyx_L1_error)
13835 __Pyx_GOTREF(__pyx_t_2);
13836 __pyx_t_3 = PyNumber_Multiply(__pyx_tuple__14, __pyx_t_2);
if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 577, __pyx_L1_error)
13837 __Pyx_GOTREF(__pyx_t_3);
13838 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
13839 __pyx_r = __pyx_t_3;
13859 __Pyx_XDECREF(__pyx_r);
13860 __pyx_t_3 = PyList_New(0);
if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 579, __pyx_L1_error)
13861 __Pyx_GOTREF(__pyx_t_3);
13862 __pyx_t_5 = (__pyx_v_self->view.suboffsets + __pyx_v_self->view.ndim);
13863 for (__pyx_t_6 = __pyx_v_self->view.suboffsets; __pyx_t_6 < __pyx_t_5; __pyx_t_6++) {
13864 __pyx_t_4 = __pyx_t_6;
13865 __pyx_v_suboffset = (__pyx_t_4[0]);
13866 __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_suboffset);
if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 579, __pyx_L1_error)
13867 __Pyx_GOTREF(__pyx_t_2);
13868 if (unlikely(__Pyx_ListComp_Append(__pyx_t_3, (PyObject*)__pyx_t_2))) __PYX_ERR(2, 579, __pyx_L1_error)
13869 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
13871 __pyx_t_2 = PyList_AsTuple(((PyObject*)__pyx_t_3));
if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 579, __pyx_L1_error)
13872 __Pyx_GOTREF(__pyx_t_2);
13873 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
13874 __pyx_r = __pyx_t_2;
13888 __Pyx_XDECREF(__pyx_t_2);
13889 __Pyx_XDECREF(__pyx_t_3);
13890 __Pyx_AddTraceback(
"View.MemoryView.memoryview.suboffsets.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
13893 __Pyx_XGIVEREF(__pyx_r);
13894 __Pyx_RefNannyFinishContext();
13907 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_4ndim_1__get__(PyObject *__pyx_v_self);
13908 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_4ndim_1__get__(PyObject *__pyx_v_self) {
13909 PyObject *__pyx_r = 0;
13910 __Pyx_RefNannyDeclarations
13911 __Pyx_RefNannySetupContext(
"__get__ (wrapper)", 0);
13912 __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_4ndim___get__(((
struct __pyx_memoryview_obj *)__pyx_v_self));
13915 __Pyx_RefNannyFinishContext();
13919 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_4ndim___get__(
struct __pyx_memoryview_obj *__pyx_v_self) {
13920 PyObject *__pyx_r = NULL;
13921 __Pyx_RefNannyDeclarations
13922 PyObject *__pyx_t_1 = NULL;
13923 int __pyx_lineno = 0;
13924 const char *__pyx_filename = NULL;
13925 int __pyx_clineno = 0;
13926 __Pyx_RefNannySetupContext(
"__get__", 0);
13935 __Pyx_XDECREF(__pyx_r);
13936 __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->view.ndim);
if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 583, __pyx_L1_error)
13937 __Pyx_GOTREF(__pyx_t_1);
13938 __pyx_r = __pyx_t_1;
13952 __Pyx_XDECREF(__pyx_t_1);
13953 __Pyx_AddTraceback(
"View.MemoryView.memoryview.ndim.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
13956 __Pyx_XGIVEREF(__pyx_r);
13957 __Pyx_RefNannyFinishContext();
13970 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_8itemsize_1__get__(PyObject *__pyx_v_self);
13971 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_8itemsize_1__get__(PyObject *__pyx_v_self) {
13972 PyObject *__pyx_r = 0;
13973 __Pyx_RefNannyDeclarations
13974 __Pyx_RefNannySetupContext(
"__get__ (wrapper)", 0);
13975 __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_8itemsize___get__(((
struct __pyx_memoryview_obj *)__pyx_v_self));
13978 __Pyx_RefNannyFinishContext();
13982 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_8itemsize___get__(
struct __pyx_memoryview_obj *__pyx_v_self) {
13983 PyObject *__pyx_r = NULL;
13984 __Pyx_RefNannyDeclarations
13985 PyObject *__pyx_t_1 = NULL;
13986 int __pyx_lineno = 0;
13987 const char *__pyx_filename = NULL;
13988 int __pyx_clineno = 0;
13989 __Pyx_RefNannySetupContext(
"__get__", 0);
13998 __Pyx_XDECREF(__pyx_r);
13999 __pyx_t_1 = PyInt_FromSsize_t(__pyx_v_self->view.itemsize);
if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 587, __pyx_L1_error)
14000 __Pyx_GOTREF(__pyx_t_1);
14001 __pyx_r = __pyx_t_1;
14015 __Pyx_XDECREF(__pyx_t_1);
14016 __Pyx_AddTraceback(
"View.MemoryView.memoryview.itemsize.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
14019 __Pyx_XGIVEREF(__pyx_r);
14020 __Pyx_RefNannyFinishContext();
14033 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_6nbytes_1__get__(PyObject *__pyx_v_self);
14034 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_6nbytes_1__get__(PyObject *__pyx_v_self) {
14035 PyObject *__pyx_r = 0;
14036 __Pyx_RefNannyDeclarations
14037 __Pyx_RefNannySetupContext(
"__get__ (wrapper)", 0);
14038 __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_6nbytes___get__(((
struct __pyx_memoryview_obj *)__pyx_v_self));
14041 __Pyx_RefNannyFinishContext();
14045 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_6nbytes___get__(
struct __pyx_memoryview_obj *__pyx_v_self) {
14046 PyObject *__pyx_r = NULL;
14047 __Pyx_RefNannyDeclarations
14048 PyObject *__pyx_t_1 = NULL;
14049 PyObject *__pyx_t_2 = NULL;
14050 PyObject *__pyx_t_3 = NULL;
14051 int __pyx_lineno = 0;
14052 const char *__pyx_filename = NULL;
14053 int __pyx_clineno = 0;
14054 __Pyx_RefNannySetupContext(
"__get__", 0);
14063 __Pyx_XDECREF(__pyx_r);
14064 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_size);
if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 591, __pyx_L1_error)
14065 __Pyx_GOTREF(__pyx_t_1);
14066 __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_self->view.itemsize);
if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 591, __pyx_L1_error)
14067 __Pyx_GOTREF(__pyx_t_2);
14068 __pyx_t_3 = PyNumber_Multiply(__pyx_t_1, __pyx_t_2);
if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 591, __pyx_L1_error)
14069 __Pyx_GOTREF(__pyx_t_3);
14070 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
14071 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
14072 __pyx_r = __pyx_t_3;
14086 __Pyx_XDECREF(__pyx_t_1);
14087 __Pyx_XDECREF(__pyx_t_2);
14088 __Pyx_XDECREF(__pyx_t_3);
14089 __Pyx_AddTraceback(
"View.MemoryView.memoryview.nbytes.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
14092 __Pyx_XGIVEREF(__pyx_r);
14093 __Pyx_RefNannyFinishContext();
14106 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_4size_1__get__(PyObject *__pyx_v_self);
14107 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_4size_1__get__(PyObject *__pyx_v_self) {
14108 PyObject *__pyx_r = 0;
14109 __Pyx_RefNannyDeclarations
14110 __Pyx_RefNannySetupContext(
"__get__ (wrapper)", 0);
14111 __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_4size___get__(((
struct __pyx_memoryview_obj *)__pyx_v_self));
14114 __Pyx_RefNannyFinishContext();
14118 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_4size___get__(
struct __pyx_memoryview_obj *__pyx_v_self) {
14119 PyObject *__pyx_v_result = NULL;
14120 PyObject *__pyx_v_length = NULL;
14121 PyObject *__pyx_r = NULL;
14122 __Pyx_RefNannyDeclarations
14125 Py_ssize_t *__pyx_t_3;
14126 Py_ssize_t *__pyx_t_4;
14127 Py_ssize_t *__pyx_t_5;
14128 PyObject *__pyx_t_6 = NULL;
14129 int __pyx_lineno = 0;
14130 const char *__pyx_filename = NULL;
14131 int __pyx_clineno = 0;
14132 __Pyx_RefNannySetupContext(
"__get__", 0);
14141 __pyx_t_1 = (__pyx_v_self->_size == Py_None);
14142 __pyx_t_2 = (__pyx_t_1 != 0);
14152 __Pyx_INCREF(__pyx_int_1);
14153 __pyx_v_result = __pyx_int_1;
14162 __pyx_t_4 = (__pyx_v_self->view.shape + __pyx_v_self->view.ndim);
14163 for (__pyx_t_5 = __pyx_v_self->view.shape; __pyx_t_5 < __pyx_t_4; __pyx_t_5++) {
14164 __pyx_t_3 = __pyx_t_5;
14165 __pyx_t_6 = PyInt_FromSsize_t((__pyx_t_3[0]));
if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 598, __pyx_L1_error)
14166 __Pyx_GOTREF(__pyx_t_6);
14167 __Pyx_XDECREF_SET(__pyx_v_length, __pyx_t_6);
14177 __pyx_t_6 = PyNumber_InPlaceMultiply(__pyx_v_result, __pyx_v_length);
if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 599, __pyx_L1_error)
14178 __Pyx_GOTREF(__pyx_t_6);
14179 __Pyx_DECREF_SET(__pyx_v_result, __pyx_t_6);
14190 __Pyx_INCREF(__pyx_v_result);
14191 __Pyx_GIVEREF(__pyx_v_result);
14192 __Pyx_GOTREF(__pyx_v_self->_size);
14193 __Pyx_DECREF(__pyx_v_self->_size);
14194 __pyx_v_self->_size = __pyx_v_result;
14212 __Pyx_XDECREF(__pyx_r);
14213 __Pyx_INCREF(__pyx_v_self->_size);
14214 __pyx_r = __pyx_v_self->_size;
14227 __Pyx_XDECREF(__pyx_t_6);
14228 __Pyx_AddTraceback(
"View.MemoryView.memoryview.size.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
14231 __Pyx_XDECREF(__pyx_v_result);
14232 __Pyx_XDECREF(__pyx_v_length);
14233 __Pyx_XGIVEREF(__pyx_r);
14234 __Pyx_RefNannyFinishContext();
14247 static Py_ssize_t __pyx_memoryview___len__(PyObject *__pyx_v_self);
14248 static Py_ssize_t __pyx_memoryview___len__(PyObject *__pyx_v_self) {
14249 Py_ssize_t __pyx_r;
14250 __Pyx_RefNannyDeclarations
14251 __Pyx_RefNannySetupContext(
"__len__ (wrapper)", 0);
14252 __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_10__len__(((
struct __pyx_memoryview_obj *)__pyx_v_self));
14255 __Pyx_RefNannyFinishContext();
14259 static Py_ssize_t __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_10__len__(
struct __pyx_memoryview_obj *__pyx_v_self) {
14260 Py_ssize_t __pyx_r;
14261 __Pyx_RefNannyDeclarations
14263 __Pyx_RefNannySetupContext(
"__len__", 0);
14272 __pyx_t_1 = ((__pyx_v_self->view.ndim >= 1) != 0);
14282 __pyx_r = (__pyx_v_self->view.shape[0]);
14314 __Pyx_RefNannyFinishContext();
14327 static PyObject *__pyx_memoryview___repr__(PyObject *__pyx_v_self);
14328 static PyObject *__pyx_memoryview___repr__(PyObject *__pyx_v_self) {
14329 PyObject *__pyx_r = 0;
14330 __Pyx_RefNannyDeclarations
14331 __Pyx_RefNannySetupContext(
"__repr__ (wrapper)", 0);
14332 __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_12__repr__(((
struct __pyx_memoryview_obj *)__pyx_v_self));
14335 __Pyx_RefNannyFinishContext();
14339 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_12__repr__(
struct __pyx_memoryview_obj *__pyx_v_self) {
14340 PyObject *__pyx_r = NULL;
14341 __Pyx_RefNannyDeclarations
14342 PyObject *__pyx_t_1 = NULL;
14343 PyObject *__pyx_t_2 = NULL;
14344 PyObject *__pyx_t_3 = NULL;
14345 int __pyx_lineno = 0;
14346 const char *__pyx_filename = NULL;
14347 int __pyx_clineno = 0;
14348 __Pyx_RefNannySetupContext(
"__repr__", 0);
14357 __Pyx_XDECREF(__pyx_r);
14358 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_base);
if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 612, __pyx_L1_error)
14359 __Pyx_GOTREF(__pyx_t_1);
14360 __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_class);
if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 612, __pyx_L1_error)
14361 __Pyx_GOTREF(__pyx_t_2);
14362 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
14363 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_name_2);
if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 612, __pyx_L1_error)
14364 __Pyx_GOTREF(__pyx_t_1);
14365 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
14374 __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_builtin_id, ((PyObject *)__pyx_v_self));
if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 613, __pyx_L1_error)
14375 __Pyx_GOTREF(__pyx_t_2);
14384 __pyx_t_3 = PyTuple_New(2);
if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 612, __pyx_L1_error)
14385 __Pyx_GOTREF(__pyx_t_3);
14386 __Pyx_GIVEREF(__pyx_t_1);
14387 PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1);
14388 __Pyx_GIVEREF(__pyx_t_2);
14389 PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_2);
14392 __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(2, 612, __pyx_L1_error)
14393 __Pyx_GOTREF(__pyx_t_2);
14394 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
14395 __pyx_r = __pyx_t_2;
14409 __Pyx_XDECREF(__pyx_t_1);
14410 __Pyx_XDECREF(__pyx_t_2);
14411 __Pyx_XDECREF(__pyx_t_3);
14412 __Pyx_AddTraceback(
"View.MemoryView.memoryview.__repr__", __pyx_clineno, __pyx_lineno, __pyx_filename);
14415 __Pyx_XGIVEREF(__pyx_r);
14416 __Pyx_RefNannyFinishContext();
14429 static PyObject *__pyx_memoryview___str__(PyObject *__pyx_v_self);
14430 static PyObject *__pyx_memoryview___str__(PyObject *__pyx_v_self) {
14431 PyObject *__pyx_r = 0;
14432 __Pyx_RefNannyDeclarations
14433 __Pyx_RefNannySetupContext(
"__str__ (wrapper)", 0);
14434 __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_14__str__(((
struct __pyx_memoryview_obj *)__pyx_v_self));
14437 __Pyx_RefNannyFinishContext();
14441 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_14__str__(
struct __pyx_memoryview_obj *__pyx_v_self) {
14442 PyObject *__pyx_r = NULL;
14443 __Pyx_RefNannyDeclarations
14444 PyObject *__pyx_t_1 = NULL;
14445 PyObject *__pyx_t_2 = NULL;
14446 int __pyx_lineno = 0;
14447 const char *__pyx_filename = NULL;
14448 int __pyx_clineno = 0;
14449 __Pyx_RefNannySetupContext(
"__str__", 0);
14458 __Pyx_XDECREF(__pyx_r);
14459 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_base);
if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 616, __pyx_L1_error)
14460 __Pyx_GOTREF(__pyx_t_1);
14461 __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_class);
if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 616, __pyx_L1_error)
14462 __Pyx_GOTREF(__pyx_t_2);
14463 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
14464 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_name_2);
if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 616, __pyx_L1_error)
14465 __Pyx_GOTREF(__pyx_t_1);
14466 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
14467 __pyx_t_2 = PyTuple_New(1);
if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 616, __pyx_L1_error)
14468 __Pyx_GOTREF(__pyx_t_2);
14469 __Pyx_GIVEREF(__pyx_t_1);
14470 PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1);
14472 __pyx_t_1 = __Pyx_PyString_Format(__pyx_kp_s_MemoryView_of_r_object, __pyx_t_2);
if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 616, __pyx_L1_error)
14473 __Pyx_GOTREF(__pyx_t_1);
14474 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
14475 __pyx_r = __pyx_t_1;
14489 __Pyx_XDECREF(__pyx_t_1);
14490 __Pyx_XDECREF(__pyx_t_2);
14491 __Pyx_AddTraceback(
"View.MemoryView.memoryview.__str__", __pyx_clineno, __pyx_lineno, __pyx_filename);
14494 __Pyx_XGIVEREF(__pyx_r);
14495 __Pyx_RefNannyFinishContext();
14508 static PyObject *__pyx_memoryview_is_c_contig(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused);
14509 static PyObject *__pyx_memoryview_is_c_contig(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
14510 PyObject *__pyx_r = 0;
14511 __Pyx_RefNannyDeclarations
14512 __Pyx_RefNannySetupContext(
"is_c_contig (wrapper)", 0);
14513 __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_16is_c_contig(((
struct __pyx_memoryview_obj *)__pyx_v_self));
14516 __Pyx_RefNannyFinishContext();
14520 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_16is_c_contig(
struct __pyx_memoryview_obj *__pyx_v_self) {
14521 __Pyx_memviewslice *__pyx_v_mslice;
14522 __Pyx_memviewslice __pyx_v_tmp;
14523 PyObject *__pyx_r = NULL;
14524 __Pyx_RefNannyDeclarations
14525 __Pyx_memviewslice *__pyx_t_1;
14526 PyObject *__pyx_t_2 = NULL;
14527 int __pyx_lineno = 0;
14528 const char *__pyx_filename = NULL;
14529 int __pyx_clineno = 0;
14530 __Pyx_RefNannySetupContext(
"is_c_contig", 0);
14539 __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(2, 622, __pyx_L1_error)
14540 __pyx_v_mslice = __pyx_t_1;
14549 __Pyx_XDECREF(__pyx_r);
14550 __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(2, 623, __pyx_L1_error)
14551 __Pyx_GOTREF(__pyx_t_2);
14552 __pyx_r = __pyx_t_2;
14566 __Pyx_XDECREF(__pyx_t_2);
14567 __Pyx_AddTraceback(
"View.MemoryView.memoryview.is_c_contig", __pyx_clineno, __pyx_lineno, __pyx_filename);
14570 __Pyx_XGIVEREF(__pyx_r);
14571 __Pyx_RefNannyFinishContext();
14584 static PyObject *__pyx_memoryview_is_f_contig(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused);
14585 static PyObject *__pyx_memoryview_is_f_contig(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
14586 PyObject *__pyx_r = 0;
14587 __Pyx_RefNannyDeclarations
14588 __Pyx_RefNannySetupContext(
"is_f_contig (wrapper)", 0);
14589 __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_18is_f_contig(((
struct __pyx_memoryview_obj *)__pyx_v_self));
14592 __Pyx_RefNannyFinishContext();
14596 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_18is_f_contig(
struct __pyx_memoryview_obj *__pyx_v_self) {
14597 __Pyx_memviewslice *__pyx_v_mslice;
14598 __Pyx_memviewslice __pyx_v_tmp;
14599 PyObject *__pyx_r = NULL;
14600 __Pyx_RefNannyDeclarations
14601 __Pyx_memviewslice *__pyx_t_1;
14602 PyObject *__pyx_t_2 = NULL;
14603 int __pyx_lineno = 0;
14604 const char *__pyx_filename = NULL;
14605 int __pyx_clineno = 0;
14606 __Pyx_RefNannySetupContext(
"is_f_contig", 0);
14615 __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(2, 628, __pyx_L1_error)
14616 __pyx_v_mslice = __pyx_t_1;
14625 __Pyx_XDECREF(__pyx_r);
14626 __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(2, 629, __pyx_L1_error)
14627 __Pyx_GOTREF(__pyx_t_2);
14628 __pyx_r = __pyx_t_2;
14642 __Pyx_XDECREF(__pyx_t_2);
14643 __Pyx_AddTraceback(
"View.MemoryView.memoryview.is_f_contig", __pyx_clineno, __pyx_lineno, __pyx_filename);
14646 __Pyx_XGIVEREF(__pyx_r);
14647 __Pyx_RefNannyFinishContext();
14660 static PyObject *__pyx_memoryview_copy(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused);
14661 static PyObject *__pyx_memoryview_copy(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
14662 PyObject *__pyx_r = 0;
14663 __Pyx_RefNannyDeclarations
14664 __Pyx_RefNannySetupContext(
"copy (wrapper)", 0);
14665 __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_20copy(((
struct __pyx_memoryview_obj *)__pyx_v_self));
14668 __Pyx_RefNannyFinishContext();
14672 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_20copy(
struct __pyx_memoryview_obj *__pyx_v_self) {
14673 __Pyx_memviewslice __pyx_v_mslice;
14675 PyObject *__pyx_r = NULL;
14676 __Pyx_RefNannyDeclarations
14677 __Pyx_memviewslice __pyx_t_1;
14678 PyObject *__pyx_t_2 = NULL;
14679 int __pyx_lineno = 0;
14680 const char *__pyx_filename = NULL;
14681 int __pyx_clineno = 0;
14682 __Pyx_RefNannySetupContext(
"copy", 0);
14691 __pyx_v_flags = (__pyx_v_self->flags & (~PyBUF_F_CONTIGUOUS));
14700 __pyx_memoryview_slice_copy(__pyx_v_self, (&__pyx_v_mslice));
14709 __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(2, 636, __pyx_L1_error)
14710 __pyx_v_mslice = __pyx_t_1;
14719 __Pyx_XDECREF(__pyx_r);
14720 __pyx_t_2 = __pyx_memoryview_copy_object_from_slice(__pyx_v_self, (&__pyx_v_mslice));
if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 641, __pyx_L1_error)
14721 __Pyx_GOTREF(__pyx_t_2);
14722 __pyx_r = __pyx_t_2;
14736 __Pyx_XDECREF(__pyx_t_2);
14737 __Pyx_AddTraceback(
"View.MemoryView.memoryview.copy", __pyx_clineno, __pyx_lineno, __pyx_filename);
14740 __Pyx_XGIVEREF(__pyx_r);
14741 __Pyx_RefNannyFinishContext();
14754 static PyObject *__pyx_memoryview_copy_fortran(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused);
14755 static PyObject *__pyx_memoryview_copy_fortran(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
14756 PyObject *__pyx_r = 0;
14757 __Pyx_RefNannyDeclarations
14758 __Pyx_RefNannySetupContext(
"copy_fortran (wrapper)", 0);
14759 __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_22copy_fortran(((
struct __pyx_memoryview_obj *)__pyx_v_self));
14762 __Pyx_RefNannyFinishContext();
14766 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_22copy_fortran(
struct __pyx_memoryview_obj *__pyx_v_self) {
14767 __Pyx_memviewslice __pyx_v_src;
14768 __Pyx_memviewslice __pyx_v_dst;
14770 PyObject *__pyx_r = NULL;
14771 __Pyx_RefNannyDeclarations
14772 __Pyx_memviewslice __pyx_t_1;
14773 PyObject *__pyx_t_2 = NULL;
14774 int __pyx_lineno = 0;
14775 const char *__pyx_filename = NULL;
14776 int __pyx_clineno = 0;
14777 __Pyx_RefNannySetupContext(
"copy_fortran", 0);
14786 __pyx_v_flags = (__pyx_v_self->flags & (~PyBUF_C_CONTIGUOUS));
14795 __pyx_memoryview_slice_copy(__pyx_v_self, (&__pyx_v_src));
14804 __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(2, 648, __pyx_L1_error)
14805 __pyx_v_dst = __pyx_t_1;
14814 __Pyx_XDECREF(__pyx_r);
14815 __pyx_t_2 = __pyx_memoryview_copy_object_from_slice(__pyx_v_self, (&__pyx_v_dst));
if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 653, __pyx_L1_error)
14816 __Pyx_GOTREF(__pyx_t_2);
14817 __pyx_r = __pyx_t_2;
14831 __Pyx_XDECREF(__pyx_t_2);
14832 __Pyx_AddTraceback(
"View.MemoryView.memoryview.copy_fortran", __pyx_clineno, __pyx_lineno, __pyx_filename);
14835 __Pyx_XGIVEREF(__pyx_r);
14836 __Pyx_RefNannyFinishContext();
14847 static PyObject *__pyx_pw___pyx_memoryview_1__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused);
14848 static PyObject *__pyx_pw___pyx_memoryview_1__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
14849 PyObject *__pyx_r = 0;
14850 __Pyx_RefNannyDeclarations
14851 __Pyx_RefNannySetupContext(
"__reduce_cython__ (wrapper)", 0);
14852 __pyx_r = __pyx_pf___pyx_memoryview___reduce_cython__(((
struct __pyx_memoryview_obj *)__pyx_v_self));
14855 __Pyx_RefNannyFinishContext();
14859 static PyObject *__pyx_pf___pyx_memoryview___reduce_cython__(CYTHON_UNUSED
struct __pyx_memoryview_obj *__pyx_v_self) {
14860 PyObject *__pyx_r = NULL;
14861 __Pyx_RefNannyDeclarations
14862 PyObject *__pyx_t_1 = NULL;
14863 int __pyx_lineno = 0;
14864 const char *__pyx_filename = NULL;
14865 int __pyx_clineno = 0;
14866 __Pyx_RefNannySetupContext(
"__reduce_cython__", 0);
14874 __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__15, NULL);
if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 2, __pyx_L1_error)
14875 __Pyx_GOTREF(__pyx_t_1);
14876 __Pyx_Raise(__pyx_t_1, 0, 0, 0);
14877 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
14878 __PYX_ERR(2, 2, __pyx_L1_error)
14888 __Pyx_XDECREF(__pyx_t_1);
14889 __Pyx_AddTraceback(
"View.MemoryView.memoryview.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
14891 __Pyx_XGIVEREF(__pyx_r);
14892 __Pyx_RefNannyFinishContext();
14904 static PyObject *__pyx_pw___pyx_memoryview_3__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state);
14905 static PyObject *__pyx_pw___pyx_memoryview_3__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
14906 PyObject *__pyx_r = 0;
14907 __Pyx_RefNannyDeclarations
14908 __Pyx_RefNannySetupContext(
"__setstate_cython__ (wrapper)", 0);
14909 __pyx_r = __pyx_pf___pyx_memoryview_2__setstate_cython__(((
struct __pyx_memoryview_obj *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state));
14912 __Pyx_RefNannyFinishContext();
14916 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) {
14917 PyObject *__pyx_r = NULL;
14918 __Pyx_RefNannyDeclarations
14919 PyObject *__pyx_t_1 = NULL;
14920 int __pyx_lineno = 0;
14921 const char *__pyx_filename = NULL;
14922 int __pyx_clineno = 0;
14923 __Pyx_RefNannySetupContext(
"__setstate_cython__", 0);
14930 __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__16, NULL);
if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 4, __pyx_L1_error)
14931 __Pyx_GOTREF(__pyx_t_1);
14932 __Pyx_Raise(__pyx_t_1, 0, 0, 0);
14933 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
14934 __PYX_ERR(2, 4, __pyx_L1_error)
14945 __Pyx_XDECREF(__pyx_t_1);
14946 __Pyx_AddTraceback(
"View.MemoryView.memoryview.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
14948 __Pyx_XGIVEREF(__pyx_r);
14949 __Pyx_RefNannyFinishContext();
14961 static PyObject *__pyx_memoryview_new(PyObject *__pyx_v_o,
int __pyx_v_flags,
int __pyx_v_dtype_is_object, __Pyx_TypeInfo *__pyx_v_typeinfo) {
14962 struct __pyx_memoryview_obj *__pyx_v_result = 0;
14963 PyObject *__pyx_r = NULL;
14964 __Pyx_RefNannyDeclarations
14965 PyObject *__pyx_t_1 = NULL;
14966 PyObject *__pyx_t_2 = NULL;
14967 PyObject *__pyx_t_3 = NULL;
14968 int __pyx_lineno = 0;
14969 const char *__pyx_filename = NULL;
14970 int __pyx_clineno = 0;
14971 __Pyx_RefNannySetupContext(
"memoryview_cwrapper", 0);
14980 __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_flags);
if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 658, __pyx_L1_error)
14981 __Pyx_GOTREF(__pyx_t_1);
14982 __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_v_dtype_is_object);
if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 658, __pyx_L1_error)
14983 __Pyx_GOTREF(__pyx_t_2);
14984 __pyx_t_3 = PyTuple_New(3);
if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 658, __pyx_L1_error)
14985 __Pyx_GOTREF(__pyx_t_3);
14986 __Pyx_INCREF(__pyx_v_o);
14987 __Pyx_GIVEREF(__pyx_v_o);
14988 PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_o);
14989 __Pyx_GIVEREF(__pyx_t_1);
14990 PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_1);
14991 __Pyx_GIVEREF(__pyx_t_2);
14992 PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_t_2);
14995 __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_memoryview_type), __pyx_t_3, NULL);
if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 658, __pyx_L1_error)
14996 __Pyx_GOTREF(__pyx_t_2);
14997 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
14998 __pyx_v_result = ((
struct __pyx_memoryview_obj *)__pyx_t_2);
15008 __pyx_v_result->typeinfo = __pyx_v_typeinfo;
15017 __Pyx_XDECREF(__pyx_r);
15018 __Pyx_INCREF(((PyObject *)__pyx_v_result));
15019 __pyx_r = ((PyObject *)__pyx_v_result);
15032 __Pyx_XDECREF(__pyx_t_1);
15033 __Pyx_XDECREF(__pyx_t_2);
15034 __Pyx_XDECREF(__pyx_t_3);
15035 __Pyx_AddTraceback(
"View.MemoryView.memoryview_cwrapper", __pyx_clineno, __pyx_lineno, __pyx_filename);
15038 __Pyx_XDECREF((PyObject *)__pyx_v_result);
15039 __Pyx_XGIVEREF(__pyx_r);
15040 __Pyx_RefNannyFinishContext();
15052 static CYTHON_INLINE
int __pyx_memoryview_check(PyObject *__pyx_v_o) {
15054 __Pyx_RefNannyDeclarations
15056 __Pyx_RefNannySetupContext(
"memoryview_check", 0);
15065 __pyx_t_1 = __Pyx_TypeCheck(__pyx_v_o, __pyx_memoryview_type);
15066 __pyx_r = __pyx_t_1;
15079 __Pyx_RefNannyFinishContext();
15091 static PyObject *_unellipsify(PyObject *__pyx_v_index,
int __pyx_v_ndim) {
15092 PyObject *__pyx_v_tup = NULL;
15093 PyObject *__pyx_v_result = NULL;
15094 int __pyx_v_have_slices;
15095 int __pyx_v_seen_ellipsis;
15096 CYTHON_UNUSED PyObject *__pyx_v_idx = NULL;
15097 PyObject *__pyx_v_item = NULL;
15098 Py_ssize_t __pyx_v_nslices;
15099 PyObject *__pyx_r = NULL;
15100 __Pyx_RefNannyDeclarations
15103 PyObject *__pyx_t_3 = NULL;
15104 PyObject *__pyx_t_4 = NULL;
15105 Py_ssize_t __pyx_t_5;
15106 PyObject *(*__pyx_t_6)(PyObject *);
15107 PyObject *__pyx_t_7 = NULL;
15108 Py_ssize_t __pyx_t_8;
15111 PyObject *__pyx_t_11 = NULL;
15112 int __pyx_lineno = 0;
15113 const char *__pyx_filename = NULL;
15114 int __pyx_clineno = 0;
15115 __Pyx_RefNannySetupContext(
"_unellipsify", 0);
15124 __pyx_t_1 = PyTuple_Check(__pyx_v_index);
15125 __pyx_t_2 = ((!(__pyx_t_1 != 0)) != 0);
15135 __pyx_t_3 = PyTuple_New(1);
if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 672, __pyx_L1_error)
15136 __Pyx_GOTREF(__pyx_t_3);
15137 __Pyx_INCREF(__pyx_v_index);
15138 __Pyx_GIVEREF(__pyx_v_index);
15139 PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_index);
15140 __pyx_v_tup = __pyx_t_3;
15161 __Pyx_INCREF(__pyx_v_index);
15162 __pyx_v_tup = __pyx_v_index;
15173 __pyx_t_3 = PyList_New(0);
if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 676, __pyx_L1_error)
15174 __Pyx_GOTREF(__pyx_t_3);
15175 __pyx_v_result = ((PyObject*)__pyx_t_3);
15185 __pyx_v_have_slices = 0;
15194 __pyx_v_seen_ellipsis = 0;
15203 __Pyx_INCREF(__pyx_int_0);
15204 __pyx_t_3 = __pyx_int_0;
15205 if (likely(PyList_CheckExact(__pyx_v_tup)) || PyTuple_CheckExact(__pyx_v_tup)) {
15206 __pyx_t_4 = __pyx_v_tup; __Pyx_INCREF(__pyx_t_4); __pyx_t_5 = 0;
15209 __pyx_t_5 = -1; __pyx_t_4 = PyObject_GetIter(__pyx_v_tup);
if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 679, __pyx_L1_error)
15210 __Pyx_GOTREF(__pyx_t_4);
15211 __pyx_t_6 = Py_TYPE(__pyx_t_4)->tp_iternext;
if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 679, __pyx_L1_error)
15214 if (likely(!__pyx_t_6)) {
15215 if (likely(PyList_CheckExact(__pyx_t_4))) {
15216 if (__pyx_t_5 >= PyList_GET_SIZE(__pyx_t_4))
break;
15217 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
15218 __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(2, 679, __pyx_L1_error)
15220 __pyx_t_7 = PySequence_ITEM(__pyx_t_4, __pyx_t_5); __pyx_t_5++;
if (unlikely(!__pyx_t_7)) __PYX_ERR(2, 679, __pyx_L1_error)
15221 __Pyx_GOTREF(__pyx_t_7);
15224 if (__pyx_t_5 >= PyTuple_GET_SIZE(__pyx_t_4))
break;
15225 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
15226 __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(2, 679, __pyx_L1_error)
15228 __pyx_t_7 = PySequence_ITEM(__pyx_t_4, __pyx_t_5); __pyx_t_5++;
if (unlikely(!__pyx_t_7)) __PYX_ERR(2, 679, __pyx_L1_error)
15229 __Pyx_GOTREF(__pyx_t_7);
15233 __pyx_t_7 = __pyx_t_6(__pyx_t_4);
15234 if (unlikely(!__pyx_t_7)) {
15235 PyObject* exc_type = PyErr_Occurred();
15237 if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
15238 else __PYX_ERR(2, 679, __pyx_L1_error)
15242 __Pyx_GOTREF(__pyx_t_7);
15244 __Pyx_XDECREF_SET(__pyx_v_item, __pyx_t_7);
15246 __Pyx_INCREF(__pyx_t_3);
15247 __Pyx_XDECREF_SET(__pyx_v_idx, __pyx_t_3);
15248 __pyx_t_7 = __Pyx_PyInt_AddObjC(__pyx_t_3, __pyx_int_1, 1, 0, 0);
if (unlikely(!__pyx_t_7)) __PYX_ERR(2, 679, __pyx_L1_error)
15249 __Pyx_GOTREF(__pyx_t_7);
15250 __Pyx_DECREF(__pyx_t_3);
15251 __pyx_t_3 = __pyx_t_7;
15261 __pyx_t_2 = (__pyx_v_item == __pyx_builtin_Ellipsis);
15262 __pyx_t_1 = (__pyx_t_2 != 0);
15272 __pyx_t_1 = ((!(__pyx_v_seen_ellipsis != 0)) != 0);
15282 __pyx_t_8 = PyObject_Length(__pyx_v_tup);
if (unlikely(__pyx_t_8 == ((Py_ssize_t)-1))) __PYX_ERR(2, 682, __pyx_L1_error)
15283 __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(2, 682, __pyx_L1_error)
15284 __Pyx_GOTREF(__pyx_t_7);
15285 { Py_ssize_t __pyx_temp;
15286 for (__pyx_temp=0; __pyx_temp < ((__pyx_v_ndim - __pyx_t_8) + 1); __pyx_temp++) {
15287 __Pyx_INCREF(__pyx_slice__17);
15288 __Pyx_GIVEREF(__pyx_slice__17);
15289 PyList_SET_ITEM(__pyx_t_7, __pyx_temp, __pyx_slice__17);
15292 __pyx_t_9 = __Pyx_PyList_Extend(__pyx_v_result, __pyx_t_7);
if (unlikely(__pyx_t_9 == ((
int)-1))) __PYX_ERR(2, 682, __pyx_L1_error)
15293 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
15302 __pyx_v_seen_ellipsis = 1;
15322 __pyx_t_9 = __Pyx_PyList_Append(__pyx_v_result, __pyx_slice__17);
if (unlikely(__pyx_t_9 == ((
int)-1))) __PYX_ERR(2, 685, __pyx_L1_error)
15333 __pyx_v_have_slices = 1;
15353 __pyx_t_2 = PySlice_Check(__pyx_v_item);
15354 __pyx_t_10 = ((!(__pyx_t_2 != 0)) != 0);
15357 __pyx_t_1 = __pyx_t_10;
15358 goto __pyx_L9_bool_binop_done;
15360 __pyx_t_10 = ((!(PyIndex_Check(__pyx_v_item) != 0)) != 0);
15361 __pyx_t_1 = __pyx_t_10;
15362 __pyx_L9_bool_binop_done:;
15363 if (unlikely(__pyx_t_1)) {
15372 __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(2, 689, __pyx_L1_error)
15373 __Pyx_GOTREF(__pyx_t_7);
15374 __pyx_t_11 = __Pyx_PyObject_CallOneArg(__pyx_builtin_TypeError, __pyx_t_7);
if (unlikely(!__pyx_t_11)) __PYX_ERR(2, 689, __pyx_L1_error)
15375 __Pyx_GOTREF(__pyx_t_11);
15376 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
15377 __Pyx_Raise(__pyx_t_11, 0, 0, 0);
15378 __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
15379 __PYX_ERR(2, 689, __pyx_L1_error)
15397 __pyx_t_10 = (__pyx_v_have_slices != 0);
15400 __pyx_t_1 = __pyx_t_10;
15401 goto __pyx_L11_bool_binop_done;
15403 __pyx_t_10 = PySlice_Check(__pyx_v_item);
15404 __pyx_t_2 = (__pyx_t_10 != 0);
15405 __pyx_t_1 = __pyx_t_2;
15406 __pyx_L11_bool_binop_done:;
15407 __pyx_v_have_slices = __pyx_t_1;
15416 __pyx_t_9 = __Pyx_PyList_Append(__pyx_v_result, __pyx_v_item);
if (unlikely(__pyx_t_9 == ((
int)-1))) __PYX_ERR(2, 692, __pyx_L1_error)
15428 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
15429 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
15438 __pyx_t_5 = PyList_GET_SIZE(__pyx_v_result);
if (unlikely(__pyx_t_5 == ((Py_ssize_t)-1))) __PYX_ERR(2, 694, __pyx_L1_error)
15439 __pyx_v_nslices = (__pyx_v_ndim - __pyx_t_5);
15448 __pyx_t_1 = (__pyx_v_nslices != 0);
15458 __pyx_t_3 = PyList_New(1 * ((__pyx_v_nslices<0) ? 0:__pyx_v_nslices));
if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 696, __pyx_L1_error)
15459 __Pyx_GOTREF(__pyx_t_3);
15460 { Py_ssize_t __pyx_temp;
15461 for (__pyx_temp=0; __pyx_temp < __pyx_v_nslices; __pyx_temp++) {
15462 __Pyx_INCREF(__pyx_slice__17);
15463 __Pyx_GIVEREF(__pyx_slice__17);
15464 PyList_SET_ITEM(__pyx_t_3, __pyx_temp, __pyx_slice__17);
15467 __pyx_t_9 = __Pyx_PyList_Extend(__pyx_v_result, __pyx_t_3);
if (unlikely(__pyx_t_9 == ((
int)-1))) __PYX_ERR(2, 696, __pyx_L1_error)
15468 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
15486 __Pyx_XDECREF(__pyx_r);
15487 if (!__pyx_v_have_slices) {
15489 __pyx_t_4 = __Pyx_PyBool_FromLong(__pyx_v_have_slices);
if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 698, __pyx_L1_error)
15490 __Pyx_GOTREF(__pyx_t_4);
15491 __pyx_t_3 = __pyx_t_4;
15493 goto __pyx_L14_bool_binop_done;
15495 __pyx_t_4 = PyInt_FromSsize_t(__pyx_v_nslices);
if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 698, __pyx_L1_error)
15496 __Pyx_GOTREF(__pyx_t_4);
15497 __pyx_t_3 = __pyx_t_4;
15499 __pyx_L14_bool_binop_done:;
15500 __pyx_t_4 = PyList_AsTuple(__pyx_v_result);
if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 698, __pyx_L1_error)
15501 __Pyx_GOTREF(__pyx_t_4);
15502 __pyx_t_11 = PyTuple_New(2);
if (unlikely(!__pyx_t_11)) __PYX_ERR(2, 698, __pyx_L1_error)
15503 __Pyx_GOTREF(__pyx_t_11);
15504 __Pyx_GIVEREF(__pyx_t_3);
15505 PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_t_3);
15506 __Pyx_GIVEREF(__pyx_t_4);
15507 PyTuple_SET_ITEM(__pyx_t_11, 1, __pyx_t_4);
15510 __pyx_r = ((PyObject*)__pyx_t_11);
15524 __Pyx_XDECREF(__pyx_t_3);
15525 __Pyx_XDECREF(__pyx_t_4);
15526 __Pyx_XDECREF(__pyx_t_7);
15527 __Pyx_XDECREF(__pyx_t_11);
15528 __Pyx_AddTraceback(
"View.MemoryView._unellipsify", __pyx_clineno, __pyx_lineno, __pyx_filename);
15531 __Pyx_XDECREF(__pyx_v_tup);
15532 __Pyx_XDECREF(__pyx_v_result);
15533 __Pyx_XDECREF(__pyx_v_idx);
15534 __Pyx_XDECREF(__pyx_v_item);
15535 __Pyx_XGIVEREF(__pyx_r);
15536 __Pyx_RefNannyFinishContext();
15548 static PyObject *assert_direct_dimensions(Py_ssize_t *__pyx_v_suboffsets,
int __pyx_v_ndim) {
15549 Py_ssize_t __pyx_v_suboffset;
15550 PyObject *__pyx_r = NULL;
15551 __Pyx_RefNannyDeclarations
15552 Py_ssize_t *__pyx_t_1;
15553 Py_ssize_t *__pyx_t_2;
15554 Py_ssize_t *__pyx_t_3;
15556 PyObject *__pyx_t_5 = NULL;
15557 int __pyx_lineno = 0;
15558 const char *__pyx_filename = NULL;
15559 int __pyx_clineno = 0;
15560 __Pyx_RefNannySetupContext(
"assert_direct_dimensions", 0);
15569 __pyx_t_2 = (__pyx_v_suboffsets + __pyx_v_ndim);
15570 for (__pyx_t_3 = __pyx_v_suboffsets; __pyx_t_3 < __pyx_t_2; __pyx_t_3++) {
15571 __pyx_t_1 = __pyx_t_3;
15572 __pyx_v_suboffset = (__pyx_t_1[0]);
15581 __pyx_t_4 = ((__pyx_v_suboffset >= 0) != 0);
15582 if (unlikely(__pyx_t_4)) {
15591 __pyx_t_5 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__18, NULL);
if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 703, __pyx_L1_error)
15592 __Pyx_GOTREF(__pyx_t_5);
15593 __Pyx_Raise(__pyx_t_5, 0, 0, 0);
15594 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
15595 __PYX_ERR(2, 703, __pyx_L1_error)
15616 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
15619 __Pyx_XDECREF(__pyx_t_5);
15620 __Pyx_AddTraceback(
"View.MemoryView.assert_direct_dimensions", __pyx_clineno, __pyx_lineno, __pyx_filename);
15623 __Pyx_XGIVEREF(__pyx_r);
15624 __Pyx_RefNannyFinishContext();
15636 static struct __pyx_memoryview_obj *__pyx_memview_slice(
struct __pyx_memoryview_obj *__pyx_v_memview, PyObject *__pyx_v_indices) {
15637 int __pyx_v_new_ndim;
15638 int __pyx_v_suboffset_dim;
15640 __Pyx_memviewslice __pyx_v_src;
15641 __Pyx_memviewslice __pyx_v_dst;
15642 __Pyx_memviewslice *__pyx_v_p_src;
15643 struct __pyx_memoryviewslice_obj *__pyx_v_memviewsliceobj = 0;
15644 __Pyx_memviewslice *__pyx_v_p_dst;
15645 int *__pyx_v_p_suboffset_dim;
15646 Py_ssize_t __pyx_v_start;
15647 Py_ssize_t __pyx_v_stop;
15648 Py_ssize_t __pyx_v_step;
15649 int __pyx_v_have_start;
15650 int __pyx_v_have_stop;
15651 int __pyx_v_have_step;
15652 PyObject *__pyx_v_index = NULL;
15653 struct __pyx_memoryview_obj *__pyx_r = NULL;
15654 __Pyx_RefNannyDeclarations
15657 PyObject *__pyx_t_3 = NULL;
15658 struct __pyx_memoryview_obj *__pyx_t_4;
15661 Py_ssize_t __pyx_t_7;
15662 PyObject *(*__pyx_t_8)(PyObject *);
15663 PyObject *__pyx_t_9 = NULL;
15664 Py_ssize_t __pyx_t_10;
15666 Py_ssize_t __pyx_t_12;
15667 int __pyx_lineno = 0;
15668 const char *__pyx_filename = NULL;
15669 int __pyx_clineno = 0;
15670 __Pyx_RefNannySetupContext(
"memview_slice", 0);
15679 __pyx_v_new_ndim = 0;
15680 __pyx_v_suboffset_dim = -1;
15689 (void)(memset((&__pyx_v_dst), 0, (
sizeof(__pyx_v_dst))));
15698 #ifndef CYTHON_WITHOUT_ASSERTIONS
15699 if (unlikely(!Py_OptimizeFlag)) {
15700 if (unlikely(!((__pyx_v_memview->view.ndim > 0) != 0))) {
15701 PyErr_SetNone(PyExc_AssertionError);
15702 __PYX_ERR(2, 722, __pyx_L1_error)
15714 __pyx_t_1 = __Pyx_TypeCheck(((PyObject *)__pyx_v_memview), __pyx_memoryviewslice_type);
15715 __pyx_t_2 = (__pyx_t_1 != 0);
15725 if (!(likely(((((PyObject *)__pyx_v_memview)) == Py_None) || likely(__Pyx_TypeTest(((PyObject *)__pyx_v_memview), __pyx_memoryviewslice_type))))) __PYX_ERR(2, 725, __pyx_L1_error)
15726 __pyx_t_3 = ((PyObject *)__pyx_v_memview);
15727 __Pyx_INCREF(__pyx_t_3);
15728 __pyx_v_memviewsliceobj = ((
struct __pyx_memoryviewslice_obj *)__pyx_t_3);
15738 __pyx_v_p_src = (&__pyx_v_memviewsliceobj->from_slice);
15758 __pyx_memoryview_slice_copy(__pyx_v_memview, (&__pyx_v_src));
15767 __pyx_v_p_src = (&__pyx_v_src);
15778 __pyx_t_4 = __pyx_v_p_src->memview;
15779 __pyx_v_dst.memview = __pyx_t_4;
15788 __pyx_t_5 = __pyx_v_p_src->data;
15789 __pyx_v_dst.data = __pyx_t_5;
15798 __pyx_v_p_dst = (&__pyx_v_dst);
15807 __pyx_v_p_suboffset_dim = (&__pyx_v_suboffset_dim);
15817 if (likely(PyList_CheckExact(__pyx_v_indices)) || PyTuple_CheckExact(__pyx_v_indices)) {
15818 __pyx_t_3 = __pyx_v_indices; __Pyx_INCREF(__pyx_t_3); __pyx_t_7 = 0;
15821 __pyx_t_7 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_v_indices);
if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 746, __pyx_L1_error)
15822 __Pyx_GOTREF(__pyx_t_3);
15823 __pyx_t_8 = Py_TYPE(__pyx_t_3)->tp_iternext;
if (unlikely(!__pyx_t_8)) __PYX_ERR(2, 746, __pyx_L1_error)
15826 if (likely(!__pyx_t_8)) {
15827 if (likely(PyList_CheckExact(__pyx_t_3))) {
15828 if (__pyx_t_7 >= PyList_GET_SIZE(__pyx_t_3))
break;
15829 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
15830 __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(2, 746, __pyx_L1_error)
15832 __pyx_t_9 = PySequence_ITEM(__pyx_t_3, __pyx_t_7); __pyx_t_7++;
if (unlikely(!__pyx_t_9)) __PYX_ERR(2, 746, __pyx_L1_error)
15833 __Pyx_GOTREF(__pyx_t_9);
15836 if (__pyx_t_7 >= PyTuple_GET_SIZE(__pyx_t_3))
break;
15837 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
15838 __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(2, 746, __pyx_L1_error)
15840 __pyx_t_9 = PySequence_ITEM(__pyx_t_3, __pyx_t_7); __pyx_t_7++;
if (unlikely(!__pyx_t_9)) __PYX_ERR(2, 746, __pyx_L1_error)
15841 __Pyx_GOTREF(__pyx_t_9);
15845 __pyx_t_9 = __pyx_t_8(__pyx_t_3);
15846 if (unlikely(!__pyx_t_9)) {
15847 PyObject* exc_type = PyErr_Occurred();
15849 if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
15850 else __PYX_ERR(2, 746, __pyx_L1_error)
15854 __Pyx_GOTREF(__pyx_t_9);
15856 __Pyx_XDECREF_SET(__pyx_v_index, __pyx_t_9);
15858 __pyx_v_dim = __pyx_t_6;
15859 __pyx_t_6 = (__pyx_t_6 + 1);
15868 __pyx_t_2 = (PyIndex_Check(__pyx_v_index) != 0);
15878 __pyx_t_10 = __Pyx_PyIndex_AsSsize_t(__pyx_v_index);
if (unlikely((__pyx_t_10 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(2, 751, __pyx_L1_error)
15887 __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(2, 748, __pyx_L1_error)
15906 __pyx_t_2 = (__pyx_v_index == Py_None);
15907 __pyx_t_1 = (__pyx_t_2 != 0);
15917 (__pyx_v_p_dst->shape[__pyx_v_new_ndim]) = 1;
15926 (__pyx_v_p_dst->strides[__pyx_v_new_ndim]) = 0;
15935 (__pyx_v_p_dst->suboffsets[__pyx_v_new_ndim]) = -1
L;
15944 __pyx_v_new_ndim = (__pyx_v_new_ndim + 1);
15964 __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_start);
if (unlikely(!__pyx_t_9)) __PYX_ERR(2, 760, __pyx_L1_error)
15965 __Pyx_GOTREF(__pyx_t_9);
15966 __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_9);
if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(2, 760, __pyx_L1_error)
15968 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
15970 __pyx_t_12 = __Pyx_PyIndex_AsSsize_t(__pyx_t_9);
if (unlikely((__pyx_t_12 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(2, 760, __pyx_L1_error)
15971 __pyx_t_10 = __pyx_t_12;
15972 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
15973 goto __pyx_L7_bool_binop_done;
15976 __pyx_L7_bool_binop_done:;
15977 __pyx_v_start = __pyx_t_10;
15986 __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_stop);
if (unlikely(!__pyx_t_9)) __PYX_ERR(2, 761, __pyx_L1_error)
15987 __Pyx_GOTREF(__pyx_t_9);
15988 __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_9);
if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(2, 761, __pyx_L1_error)
15990 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
15992 __pyx_t_12 = __Pyx_PyIndex_AsSsize_t(__pyx_t_9);
if (unlikely((__pyx_t_12 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(2, 761, __pyx_L1_error)
15993 __pyx_t_10 = __pyx_t_12;
15994 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
15995 goto __pyx_L9_bool_binop_done;
15998 __pyx_L9_bool_binop_done:;
15999 __pyx_v_stop = __pyx_t_10;
16008 __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_step);
if (unlikely(!__pyx_t_9)) __PYX_ERR(2, 762, __pyx_L1_error)
16009 __Pyx_GOTREF(__pyx_t_9);
16010 __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_9);
if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(2, 762, __pyx_L1_error)
16012 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
16014 __pyx_t_12 = __Pyx_PyIndex_AsSsize_t(__pyx_t_9);
if (unlikely((__pyx_t_12 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(2, 762, __pyx_L1_error)
16015 __pyx_t_10 = __pyx_t_12;
16016 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
16017 goto __pyx_L11_bool_binop_done;
16020 __pyx_L11_bool_binop_done:;
16021 __pyx_v_step = __pyx_t_10;
16030 __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_start);
if (unlikely(!__pyx_t_9)) __PYX_ERR(2, 764, __pyx_L1_error)
16031 __Pyx_GOTREF(__pyx_t_9);
16032 __pyx_t_1 = (__pyx_t_9 != Py_None);
16033 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
16034 __pyx_v_have_start = __pyx_t_1;
16043 __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_stop);
if (unlikely(!__pyx_t_9)) __PYX_ERR(2, 765, __pyx_L1_error)
16044 __Pyx_GOTREF(__pyx_t_9);
16045 __pyx_t_1 = (__pyx_t_9 != Py_None);
16046 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
16047 __pyx_v_have_stop = __pyx_t_1;
16056 __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_step);
if (unlikely(!__pyx_t_9)) __PYX_ERR(2, 766, __pyx_L1_error)
16057 __Pyx_GOTREF(__pyx_t_9);
16058 __pyx_t_1 = (__pyx_t_9 != Py_None);
16059 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
16060 __pyx_v_have_step = __pyx_t_1;
16069 __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(2, 768, __pyx_L1_error)
16078 __pyx_v_new_ndim = (__pyx_v_new_ndim + 1);
16090 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
16099 __pyx_t_1 = __Pyx_TypeCheck(((PyObject *)__pyx_v_memview), __pyx_memoryviewslice_type);
16100 __pyx_t_2 = (__pyx_t_1 != 0);
16110 __Pyx_XDECREF(((PyObject *)__pyx_r));
16119 if (unlikely(!__pyx_v_memviewsliceobj)) { __Pyx_RaiseUnboundLocalError(
"memviewsliceobj"); __PYX_ERR(2, 778, __pyx_L1_error) }
16128 if (unlikely(!__pyx_v_memviewsliceobj)) { __Pyx_RaiseUnboundLocalError(
"memviewsliceobj"); __PYX_ERR(2, 779, __pyx_L1_error) }
16137 __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(2, 777, __pyx_L1_error)
16138 __Pyx_GOTREF(__pyx_t_3);
16139 if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_memoryview_type))))) __PYX_ERR(2, 777, __pyx_L1_error)
16140 __pyx_r = ((
struct __pyx_memoryview_obj *)__pyx_t_3);
16161 __Pyx_XDECREF(((PyObject *)__pyx_r));
16170 __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(2, 782, __pyx_L1_error)
16171 __Pyx_GOTREF(__pyx_t_3);
16180 if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_memoryview_type))))) __PYX_ERR(2, 782, __pyx_L1_error)
16181 __pyx_r = ((
struct __pyx_memoryview_obj *)__pyx_t_3);
16196 __Pyx_XDECREF(__pyx_t_3);
16197 __Pyx_XDECREF(__pyx_t_9);
16198 __Pyx_AddTraceback(
"View.MemoryView.memview_slice", __pyx_clineno, __pyx_lineno, __pyx_filename);
16201 __Pyx_XDECREF((PyObject *)__pyx_v_memviewsliceobj);
16202 __Pyx_XDECREF(__pyx_v_index);
16203 __Pyx_XGIVEREF((PyObject *)__pyx_r);
16204 __Pyx_RefNannyFinishContext();
16216 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) {
16217 Py_ssize_t __pyx_v_new_shape;
16218 int __pyx_v_negative_step;
16223 int __pyx_lineno = 0;
16224 const char *__pyx_filename = NULL;
16225 int __pyx_clineno = 0;
16234 __pyx_t_1 = ((!(__pyx_v_is_slice != 0)) != 0);
16244 __pyx_t_1 = ((__pyx_v_start < 0) != 0);
16254 __pyx_v_start = (__pyx_v_start + __pyx_v_shape);
16272 __pyx_t_1 = (0 <= __pyx_v_start);
16274 __pyx_t_1 = (__pyx_v_start < __pyx_v_shape);
16276 __pyx_t_2 = ((!(__pyx_t_1 != 0)) != 0);
16286 __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(2, 832, __pyx_L1_error)
16315 __pyx_t_1 = ((__pyx_v_have_step != 0) != 0);
16318 __pyx_t_2 = __pyx_t_1;
16319 goto __pyx_L6_bool_binop_done;
16321 __pyx_t_1 = ((__pyx_v_step < 0) != 0);
16322 __pyx_t_2 = __pyx_t_1;
16323 __pyx_L6_bool_binop_done:;
16324 __pyx_v_negative_step = __pyx_t_2;
16333 __pyx_t_1 = (__pyx_v_have_step != 0);
16336 __pyx_t_2 = __pyx_t_1;
16337 goto __pyx_L9_bool_binop_done;
16339 __pyx_t_1 = ((__pyx_v_step == 0) != 0);
16340 __pyx_t_2 = __pyx_t_1;
16341 __pyx_L9_bool_binop_done:;
16351 __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(2, 838, __pyx_L1_error)
16369 __pyx_t_2 = (__pyx_v_have_start != 0);
16379 __pyx_t_2 = ((__pyx_v_start < 0) != 0);
16389 __pyx_v_start = (__pyx_v_start + __pyx_v_shape);
16398 __pyx_t_2 = ((__pyx_v_start < 0) != 0);
16436 __pyx_t_2 = ((__pyx_v_start >= __pyx_v_shape) != 0);
16446 __pyx_t_2 = (__pyx_v_negative_step != 0);
16456 __pyx_v_start = (__pyx_v_shape - 1);
16476 __pyx_v_start = __pyx_v_shape;
16508 __pyx_t_2 = (__pyx_v_negative_step != 0);
16518 __pyx_v_start = (__pyx_v_shape - 1);
16551 __pyx_t_2 = (__pyx_v_have_stop != 0);
16561 __pyx_t_2 = ((__pyx_v_stop < 0) != 0);
16571 __pyx_v_stop = (__pyx_v_stop + __pyx_v_shape);
16580 __pyx_t_2 = ((__pyx_v_stop < 0) != 0);
16618 __pyx_t_2 = ((__pyx_v_stop > __pyx_v_shape) != 0);
16628 __pyx_v_stop = __pyx_v_shape;
16658 __pyx_t_2 = (__pyx_v_negative_step != 0);
16668 __pyx_v_stop = -1
L;
16688 __pyx_v_stop = __pyx_v_shape;
16701 __pyx_t_2 = ((!(__pyx_v_have_step != 0)) != 0);
16729 __pyx_v_new_shape = ((__pyx_v_stop - __pyx_v_start) / __pyx_v_step);
16738 __pyx_t_2 = (((__pyx_v_stop - __pyx_v_start) - (__pyx_v_step * __pyx_v_new_shape)) != 0);
16748 __pyx_v_new_shape = (__pyx_v_new_shape + 1);
16766 __pyx_t_2 = ((__pyx_v_new_shape < 0) != 0);
16776 __pyx_v_new_shape = 0;
16794 (__pyx_v_dst->strides[__pyx_v_new_ndim]) = (__pyx_v_stride * __pyx_v_step);
16803 (__pyx_v_dst->shape[__pyx_v_new_ndim]) = __pyx_v_new_shape;
16812 (__pyx_v_dst->suboffsets[__pyx_v_new_ndim]) = __pyx_v_suboffset;
16823 __pyx_t_2 = (((__pyx_v_suboffset_dim[0]) < 0) != 0);
16833 __pyx_v_dst->data = (__pyx_v_dst->data + (__pyx_v_start * __pyx_v_stride));
16853 __pyx_t_3 = (__pyx_v_suboffset_dim[0]);
16854 (__pyx_v_dst->suboffsets[__pyx_t_3]) = ((__pyx_v_dst->suboffsets[__pyx_t_3]) + (__pyx_v_start * __pyx_v_stride));
16865 __pyx_t_2 = ((__pyx_v_suboffset >= 0) != 0);
16875 __pyx_t_2 = ((!(__pyx_v_is_slice != 0)) != 0);
16885 __pyx_t_2 = ((__pyx_v_new_ndim == 0) != 0);
16895 __pyx_v_dst->data = ((((
char **)__pyx_v_dst->data)[0]) + __pyx_v_suboffset);
16923 __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(2, 899, __pyx_L1_error)
16945 (__pyx_v_suboffset_dim[0]) = __pyx_v_new_ndim;
16980 PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
16982 __Pyx_AddTraceback(
"View.MemoryView.slice_memviewslice", __pyx_clineno, __pyx_lineno, __pyx_filename);
16984 __Pyx_PyGILState_Release(__pyx_gilstate_save);
17000 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) {
17001 Py_ssize_t __pyx_v_shape;
17002 Py_ssize_t __pyx_v_stride;
17003 Py_ssize_t __pyx_v_suboffset;
17004 Py_ssize_t __pyx_v_itemsize;
17005 char *__pyx_v_resultp;
17007 __Pyx_RefNannyDeclarations
17008 Py_ssize_t __pyx_t_1;
17010 PyObject *__pyx_t_3 = NULL;
17011 PyObject *__pyx_t_4 = NULL;
17012 int __pyx_lineno = 0;
17013 const char *__pyx_filename = NULL;
17014 int __pyx_clineno = 0;
17015 __Pyx_RefNannySetupContext(
"pybuffer_index", 0);
17024 __pyx_v_suboffset = -1
L;
17033 __pyx_t_1 = __pyx_v_view->itemsize;
17034 __pyx_v_itemsize = __pyx_t_1;
17043 __pyx_t_2 = ((__pyx_v_view->ndim == 0) != 0);
17053 if (unlikely(__pyx_v_itemsize == 0)) {
17054 PyErr_SetString(PyExc_ZeroDivisionError,
"integer division or modulo by zero");
17055 __PYX_ERR(2, 917, __pyx_L1_error)
17057 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))) {
17058 PyErr_SetString(PyExc_OverflowError,
"value too large to perform division");
17059 __PYX_ERR(2, 917, __pyx_L1_error)
17061 __pyx_v_shape = __Pyx_div_Py_ssize_t(__pyx_v_view->len, __pyx_v_itemsize);
17070 __pyx_v_stride = __pyx_v_itemsize;
17090 __pyx_v_shape = (__pyx_v_view->shape[__pyx_v_dim]);
17099 __pyx_v_stride = (__pyx_v_view->strides[__pyx_v_dim]);
17108 __pyx_t_2 = ((__pyx_v_view->suboffsets != NULL) != 0);
17118 __pyx_v_suboffset = (__pyx_v_view->suboffsets[__pyx_v_dim]);
17138 __pyx_t_2 = ((__pyx_v_index < 0) != 0);
17148 __pyx_v_index = (__pyx_v_index + (__pyx_v_view->shape[__pyx_v_dim]));
17157 __pyx_t_2 = ((__pyx_v_index < 0) != 0);
17158 if (unlikely(__pyx_t_2)) {
17167 __pyx_t_3 = PyInt_FromSsize_t(__pyx_v_dim);
if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 928, __pyx_L1_error)
17168 __Pyx_GOTREF(__pyx_t_3);
17169 __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(2, 928, __pyx_L1_error)
17170 __Pyx_GOTREF(__pyx_t_4);
17171 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
17172 __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_builtin_IndexError, __pyx_t_4);
if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 928, __pyx_L1_error)
17173 __Pyx_GOTREF(__pyx_t_3);
17174 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
17175 __Pyx_Raise(__pyx_t_3, 0, 0, 0);
17176 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
17177 __PYX_ERR(2, 928, __pyx_L1_error)
17204 __pyx_t_2 = ((__pyx_v_index >= __pyx_v_shape) != 0);
17205 if (unlikely(__pyx_t_2)) {
17214 __pyx_t_3 = PyInt_FromSsize_t(__pyx_v_dim);
if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 931, __pyx_L1_error)
17215 __Pyx_GOTREF(__pyx_t_3);
17216 __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(2, 931, __pyx_L1_error)
17217 __Pyx_GOTREF(__pyx_t_4);
17218 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
17219 __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_builtin_IndexError, __pyx_t_4);
if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 931, __pyx_L1_error)
17220 __Pyx_GOTREF(__pyx_t_3);
17221 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
17222 __Pyx_Raise(__pyx_t_3, 0, 0, 0);
17223 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
17224 __PYX_ERR(2, 931, __pyx_L1_error)
17242 __pyx_v_resultp = (__pyx_v_bufp + (__pyx_v_index * __pyx_v_stride));
17251 __pyx_t_2 = ((__pyx_v_suboffset >= 0) != 0);
17261 __pyx_v_resultp = ((((
char **)__pyx_v_resultp)[0]) + __pyx_v_suboffset);
17279 __pyx_r = __pyx_v_resultp;
17292 __Pyx_XDECREF(__pyx_t_3);
17293 __Pyx_XDECREF(__pyx_t_4);
17294 __Pyx_AddTraceback(
"View.MemoryView.pybuffer_index", __pyx_clineno, __pyx_lineno, __pyx_filename);
17297 __Pyx_RefNannyFinishContext();
17309 static int __pyx_memslice_transpose(__Pyx_memviewslice *__pyx_v_memslice) {
17311 Py_ssize_t *__pyx_v_shape;
17312 Py_ssize_t *__pyx_v_strides;
17317 Py_ssize_t *__pyx_t_2;
17320 Py_ssize_t __pyx_t_5;
17321 Py_ssize_t __pyx_t_6;
17325 int __pyx_lineno = 0;
17326 const char *__pyx_filename = NULL;
17327 int __pyx_clineno = 0;
17336 __pyx_t_1 = __pyx_v_memslice->memview->view.ndim;
17337 __pyx_v_ndim = __pyx_t_1;
17346 __pyx_t_2 = __pyx_v_memslice->shape;
17347 __pyx_v_shape = __pyx_t_2;
17356 __pyx_t_2 = __pyx_v_memslice->strides;
17357 __pyx_v_strides = __pyx_t_2;
17366 __pyx_t_3 = __Pyx_div_long(__pyx_v_ndim, 2);
17367 __pyx_t_4 = __pyx_t_3;
17368 for (__pyx_t_1 = 0; __pyx_t_1 < __pyx_t_4; __pyx_t_1+=1) {
17369 __pyx_v_i = __pyx_t_1;
17378 __pyx_v_j = ((__pyx_v_ndim - 1) - __pyx_v_i);
17387 __pyx_t_5 = (__pyx_v_strides[__pyx_v_j]);
17388 __pyx_t_6 = (__pyx_v_strides[__pyx_v_i]);
17389 (__pyx_v_strides[__pyx_v_i]) = __pyx_t_5;
17390 (__pyx_v_strides[__pyx_v_j]) = __pyx_t_6;
17399 __pyx_t_6 = (__pyx_v_shape[__pyx_v_j]);
17400 __pyx_t_5 = (__pyx_v_shape[__pyx_v_i]);
17401 (__pyx_v_shape[__pyx_v_i]) = __pyx_t_6;
17402 (__pyx_v_shape[__pyx_v_j]) = __pyx_t_5;
17411 __pyx_t_8 = (((__pyx_v_memslice->suboffsets[__pyx_v_i]) >= 0) != 0);
17414 __pyx_t_7 = __pyx_t_8;
17415 goto __pyx_L6_bool_binop_done;
17417 __pyx_t_8 = (((__pyx_v_memslice->suboffsets[__pyx_v_j]) >= 0) != 0);
17418 __pyx_t_7 = __pyx_t_8;
17419 __pyx_L6_bool_binop_done:;
17429 __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(2, 957, __pyx_L1_error)
17463 PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
17465 __Pyx_AddTraceback(
"View.MemoryView.transpose_memslice", __pyx_clineno, __pyx_lineno, __pyx_filename);
17467 __Pyx_PyGILState_Release(__pyx_gilstate_save);
17484 static void __pyx_memoryviewslice___dealloc__(PyObject *__pyx_v_self);
17485 static void __pyx_memoryviewslice___dealloc__(PyObject *__pyx_v_self) {
17486 __Pyx_RefNannyDeclarations
17487 __Pyx_RefNannySetupContext(
"__dealloc__ (wrapper)", 0);
17488 __pyx_memoryviewslice___pyx_pf_15View_dot_MemoryView_16_memoryviewslice___dealloc__(((
struct __pyx_memoryviewslice_obj *)__pyx_v_self));
17491 __Pyx_RefNannyFinishContext();
17494 static void __pyx_memoryviewslice___pyx_pf_15View_dot_MemoryView_16_memoryviewslice___dealloc__(
struct __pyx_memoryviewslice_obj *__pyx_v_self) {
17495 __Pyx_RefNannyDeclarations
17496 __Pyx_RefNannySetupContext(
"__dealloc__", 0);
17505 __PYX_XDEC_MEMVIEW((&__pyx_v_self->from_slice), 1);
17516 __Pyx_RefNannyFinishContext();
17527 static PyObject *__pyx_memoryviewslice_convert_item_to_object(
struct __pyx_memoryviewslice_obj *__pyx_v_self,
char *__pyx_v_itemp) {
17528 PyObject *__pyx_r = NULL;
17529 __Pyx_RefNannyDeclarations
17531 PyObject *__pyx_t_2 = NULL;
17532 int __pyx_lineno = 0;
17533 const char *__pyx_filename = NULL;
17534 int __pyx_clineno = 0;
17535 __Pyx_RefNannySetupContext(
"convert_item_to_object", 0);
17544 __pyx_t_1 = ((__pyx_v_self->to_object_func != NULL) != 0);
17554 __Pyx_XDECREF(__pyx_r);
17555 __pyx_t_2 = __pyx_v_self->to_object_func(__pyx_v_itemp);
if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 981, __pyx_L1_error)
17556 __Pyx_GOTREF(__pyx_t_2);
17557 __pyx_r = __pyx_t_2;
17578 __Pyx_XDECREF(__pyx_r);
17579 __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(2, 983, __pyx_L1_error)
17580 __Pyx_GOTREF(__pyx_t_2);
17581 __pyx_r = __pyx_t_2;
17596 __Pyx_XDECREF(__pyx_t_2);
17597 __Pyx_AddTraceback(
"View.MemoryView._memoryviewslice.convert_item_to_object", __pyx_clineno, __pyx_lineno, __pyx_filename);
17600 __Pyx_XGIVEREF(__pyx_r);
17601 __Pyx_RefNannyFinishContext();
17613 static PyObject *__pyx_memoryviewslice_assign_item_from_object(
struct __pyx_memoryviewslice_obj *__pyx_v_self,
char *__pyx_v_itemp, PyObject *__pyx_v_value) {
17614 PyObject *__pyx_r = NULL;
17615 __Pyx_RefNannyDeclarations
17618 PyObject *__pyx_t_3 = NULL;
17619 int __pyx_lineno = 0;
17620 const char *__pyx_filename = NULL;
17621 int __pyx_clineno = 0;
17622 __Pyx_RefNannySetupContext(
"assign_item_from_object", 0);
17631 __pyx_t_1 = ((__pyx_v_self->to_dtype_func != NULL) != 0);
17641 __pyx_t_2 = __pyx_v_self->to_dtype_func(__pyx_v_itemp, __pyx_v_value);
if (unlikely(__pyx_t_2 == ((
int)0))) __PYX_ERR(2, 987, __pyx_L1_error)
17661 __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(2, 989, __pyx_L1_error)
17662 __Pyx_GOTREF(__pyx_t_3);
17663 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
17676 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
17679 __Pyx_XDECREF(__pyx_t_3);
17680 __Pyx_AddTraceback(
"View.MemoryView._memoryviewslice.assign_item_from_object", __pyx_clineno, __pyx_lineno, __pyx_filename);
17683 __Pyx_XGIVEREF(__pyx_r);
17684 __Pyx_RefNannyFinishContext();
17697 static PyObject *__pyx_pw_15View_dot_MemoryView_16_memoryviewslice_4base_1__get__(PyObject *__pyx_v_self);
17698 static PyObject *__pyx_pw_15View_dot_MemoryView_16_memoryviewslice_4base_1__get__(PyObject *__pyx_v_self) {
17699 PyObject *__pyx_r = 0;
17700 __Pyx_RefNannyDeclarations
17701 __Pyx_RefNannySetupContext(
"__get__ (wrapper)", 0);
17702 __pyx_r = __pyx_pf_15View_dot_MemoryView_16_memoryviewslice_4base___get__(((
struct __pyx_memoryviewslice_obj *)__pyx_v_self));
17705 __Pyx_RefNannyFinishContext();
17709 static PyObject *__pyx_pf_15View_dot_MemoryView_16_memoryviewslice_4base___get__(
struct __pyx_memoryviewslice_obj *__pyx_v_self) {
17710 PyObject *__pyx_r = NULL;
17711 __Pyx_RefNannyDeclarations
17712 __Pyx_RefNannySetupContext(
"__get__", 0);
17721 __Pyx_XDECREF(__pyx_r);
17722 __Pyx_INCREF(__pyx_v_self->from_object);
17723 __pyx_r = __pyx_v_self->from_object;
17736 __Pyx_XGIVEREF(__pyx_r);
17737 __Pyx_RefNannyFinishContext();
17748 static PyObject *__pyx_pw___pyx_memoryviewslice_1__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused);
17749 static PyObject *__pyx_pw___pyx_memoryviewslice_1__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
17750 PyObject *__pyx_r = 0;
17751 __Pyx_RefNannyDeclarations
17752 __Pyx_RefNannySetupContext(
"__reduce_cython__ (wrapper)", 0);
17753 __pyx_r = __pyx_pf___pyx_memoryviewslice___reduce_cython__(((
struct __pyx_memoryviewslice_obj *)__pyx_v_self));
17756 __Pyx_RefNannyFinishContext();
17760 static PyObject *__pyx_pf___pyx_memoryviewslice___reduce_cython__(CYTHON_UNUSED
struct __pyx_memoryviewslice_obj *__pyx_v_self) {
17761 PyObject *__pyx_r = NULL;
17762 __Pyx_RefNannyDeclarations
17763 PyObject *__pyx_t_1 = NULL;
17764 int __pyx_lineno = 0;
17765 const char *__pyx_filename = NULL;
17766 int __pyx_clineno = 0;
17767 __Pyx_RefNannySetupContext(
"__reduce_cython__", 0);
17775 __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__19, NULL);
if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 2, __pyx_L1_error)
17776 __Pyx_GOTREF(__pyx_t_1);
17777 __Pyx_Raise(__pyx_t_1, 0, 0, 0);
17778 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
17779 __PYX_ERR(2, 2, __pyx_L1_error)
17789 __Pyx_XDECREF(__pyx_t_1);
17790 __Pyx_AddTraceback(
"View.MemoryView._memoryviewslice.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
17792 __Pyx_XGIVEREF(__pyx_r);
17793 __Pyx_RefNannyFinishContext();
17805 static PyObject *__pyx_pw___pyx_memoryviewslice_3__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state);
17806 static PyObject *__pyx_pw___pyx_memoryviewslice_3__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
17807 PyObject *__pyx_r = 0;
17808 __Pyx_RefNannyDeclarations
17809 __Pyx_RefNannySetupContext(
"__setstate_cython__ (wrapper)", 0);
17810 __pyx_r = __pyx_pf___pyx_memoryviewslice_2__setstate_cython__(((
struct __pyx_memoryviewslice_obj *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state));
17813 __Pyx_RefNannyFinishContext();
17817 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) {
17818 PyObject *__pyx_r = NULL;
17819 __Pyx_RefNannyDeclarations
17820 PyObject *__pyx_t_1 = NULL;
17821 int __pyx_lineno = 0;
17822 const char *__pyx_filename = NULL;
17823 int __pyx_clineno = 0;
17824 __Pyx_RefNannySetupContext(
"__setstate_cython__", 0);
17831 __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__20, NULL);
if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 4, __pyx_L1_error)
17832 __Pyx_GOTREF(__pyx_t_1);
17833 __Pyx_Raise(__pyx_t_1, 0, 0, 0);
17834 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
17835 __PYX_ERR(2, 4, __pyx_L1_error)
17846 __Pyx_XDECREF(__pyx_t_1);
17847 __Pyx_AddTraceback(
"View.MemoryView._memoryviewslice.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
17849 __Pyx_XGIVEREF(__pyx_r);
17850 __Pyx_RefNannyFinishContext();
17862 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) {
17863 struct __pyx_memoryviewslice_obj *__pyx_v_result = 0;
17864 Py_ssize_t __pyx_v_suboffset;
17865 PyObject *__pyx_v_length = NULL;
17866 PyObject *__pyx_r = NULL;
17867 __Pyx_RefNannyDeclarations
17869 PyObject *__pyx_t_2 = NULL;
17870 PyObject *__pyx_t_3 = NULL;
17871 __Pyx_TypeInfo *__pyx_t_4;
17872 Py_buffer __pyx_t_5;
17873 Py_ssize_t *__pyx_t_6;
17874 Py_ssize_t *__pyx_t_7;
17875 Py_ssize_t *__pyx_t_8;
17876 Py_ssize_t __pyx_t_9;
17877 int __pyx_lineno = 0;
17878 const char *__pyx_filename = NULL;
17879 int __pyx_clineno = 0;
17880 __Pyx_RefNannySetupContext(
"memoryview_fromslice", 0);
17889 __pyx_t_1 = ((((PyObject *)__pyx_v_memviewslice.memview) == Py_None) != 0);
17899 __Pyx_XDECREF(__pyx_r);
17900 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
17919 __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_v_dtype_is_object);
if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 1013, __pyx_L1_error)
17920 __Pyx_GOTREF(__pyx_t_2);
17921 __pyx_t_3 = PyTuple_New(3);
if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 1013, __pyx_L1_error)
17922 __Pyx_GOTREF(__pyx_t_3);
17923 __Pyx_INCREF(Py_None);
17924 __Pyx_GIVEREF(Py_None);
17925 PyTuple_SET_ITEM(__pyx_t_3, 0, Py_None);
17926 __Pyx_INCREF(__pyx_int_0);
17927 __Pyx_GIVEREF(__pyx_int_0);
17928 PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_int_0);
17929 __Pyx_GIVEREF(__pyx_t_2);
17930 PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_t_2);
17932 __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_memoryviewslice_type), __pyx_t_3, NULL);
if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 1013, __pyx_L1_error)
17933 __Pyx_GOTREF(__pyx_t_2);
17934 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
17935 __pyx_v_result = ((
struct __pyx_memoryviewslice_obj *)__pyx_t_2);
17945 __pyx_v_result->from_slice = __pyx_v_memviewslice;
17954 __PYX_INC_MEMVIEW((&__pyx_v_memviewslice), 1);
17963 __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_memviewslice.memview), __pyx_n_s_base);
if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 1018, __pyx_L1_error)
17964 __Pyx_GOTREF(__pyx_t_2);
17965 __Pyx_GIVEREF(__pyx_t_2);
17966 __Pyx_GOTREF(__pyx_v_result->from_object);
17967 __Pyx_DECREF(__pyx_v_result->from_object);
17968 __pyx_v_result->from_object = __pyx_t_2;
17978 __pyx_t_4 = __pyx_v_memviewslice.memview->typeinfo;
17979 __pyx_v_result->__pyx_base.typeinfo = __pyx_t_4;
17988 __pyx_t_5 = __pyx_v_memviewslice.memview->view;
17989 __pyx_v_result->__pyx_base.view = __pyx_t_5;
17998 __pyx_v_result->__pyx_base.view.buf = ((
void *)__pyx_v_memviewslice.data);
18007 __pyx_v_result->__pyx_base.view.ndim = __pyx_v_ndim;
18016 ((Py_buffer *)(&__pyx_v_result->__pyx_base.view))->obj = Py_None;
18025 Py_INCREF(Py_None);
18034 __pyx_t_1 = ((((
struct __pyx_memoryview_obj *)__pyx_v_memviewslice.memview)->flags & PyBUF_WRITABLE) != 0);
18044 __pyx_v_result->__pyx_base.flags = PyBUF_RECORDS;
18064 __pyx_v_result->__pyx_base.flags = PyBUF_RECORDS_RO;
18075 __pyx_v_result->__pyx_base.view.shape = ((Py_ssize_t *)__pyx_v_result->from_slice.shape);
18084 __pyx_v_result->__pyx_base.view.strides = ((Py_ssize_t *)__pyx_v_result->from_slice.strides);
18093 __pyx_v_result->__pyx_base.view.suboffsets = NULL;
18102 __pyx_t_7 = (__pyx_v_result->from_slice.suboffsets + __pyx_v_ndim);
18103 for (__pyx_t_8 = __pyx_v_result->from_slice.suboffsets; __pyx_t_8 < __pyx_t_7; __pyx_t_8++) {
18104 __pyx_t_6 = __pyx_t_8;
18105 __pyx_v_suboffset = (__pyx_t_6[0]);
18114 __pyx_t_1 = ((__pyx_v_suboffset >= 0) != 0);
18124 __pyx_v_result->__pyx_base.view.suboffsets = ((Py_ssize_t *)__pyx_v_result->from_slice.suboffsets);
18133 goto __pyx_L6_break;
18153 __pyx_t_9 = __pyx_v_result->__pyx_base.view.itemsize;
18154 __pyx_v_result->__pyx_base.view.len = __pyx_t_9;
18163 __pyx_t_7 = (__pyx_v_result->__pyx_base.view.shape + __pyx_v_ndim);
18164 for (__pyx_t_8 = __pyx_v_result->__pyx_base.view.shape; __pyx_t_8 < __pyx_t_7; __pyx_t_8++) {
18165 __pyx_t_6 = __pyx_t_8;
18166 __pyx_t_2 = PyInt_FromSsize_t((__pyx_t_6[0]));
if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 1043, __pyx_L1_error)
18167 __Pyx_GOTREF(__pyx_t_2);
18168 __Pyx_XDECREF_SET(__pyx_v_length, __pyx_t_2);
18178 __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_result->__pyx_base.view.len);
if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 1044, __pyx_L1_error)
18179 __Pyx_GOTREF(__pyx_t_2);
18180 __pyx_t_3 = PyNumber_InPlaceMultiply(__pyx_t_2, __pyx_v_length);
if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 1044, __pyx_L1_error)
18181 __Pyx_GOTREF(__pyx_t_3);
18182 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
18183 __pyx_t_9 = __Pyx_PyIndex_AsSsize_t(__pyx_t_3);
if (unlikely((__pyx_t_9 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(2, 1044, __pyx_L1_error)
18184 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
18185 __pyx_v_result->__pyx_base.view.len = __pyx_t_9;
18195 __pyx_v_result->to_object_func = __pyx_v_to_object_func;
18204 __pyx_v_result->to_dtype_func = __pyx_v_to_dtype_func;
18213 __Pyx_XDECREF(__pyx_r);
18214 __Pyx_INCREF(((PyObject *)__pyx_v_result));
18215 __pyx_r = ((PyObject *)__pyx_v_result);
18228 __Pyx_XDECREF(__pyx_t_2);
18229 __Pyx_XDECREF(__pyx_t_3);
18230 __Pyx_AddTraceback(
"View.MemoryView.memoryview_fromslice", __pyx_clineno, __pyx_lineno, __pyx_filename);
18233 __Pyx_XDECREF((PyObject *)__pyx_v_result);
18234 __Pyx_XDECREF(__pyx_v_length);
18235 __Pyx_XGIVEREF(__pyx_r);
18236 __Pyx_RefNannyFinishContext();
18248 static __Pyx_memviewslice *__pyx_memoryview_get_slice_from_memoryview(
struct __pyx_memoryview_obj *__pyx_v_memview, __Pyx_memviewslice *__pyx_v_mslice) {
18249 struct __pyx_memoryviewslice_obj *__pyx_v_obj = 0;
18250 __Pyx_memviewslice *__pyx_r;
18251 __Pyx_RefNannyDeclarations
18254 PyObject *__pyx_t_3 = NULL;
18255 int __pyx_lineno = 0;
18256 const char *__pyx_filename = NULL;
18257 int __pyx_clineno = 0;
18258 __Pyx_RefNannySetupContext(
"get_slice_from_memview", 0);
18267 __pyx_t_1 = __Pyx_TypeCheck(((PyObject *)__pyx_v_memview), __pyx_memoryviewslice_type);
18268 __pyx_t_2 = (__pyx_t_1 != 0);
18278 if (!(likely(((((PyObject *)__pyx_v_memview)) == Py_None) || likely(__Pyx_TypeTest(((PyObject *)__pyx_v_memview), __pyx_memoryviewslice_type))))) __PYX_ERR(2, 1056, __pyx_L1_error)
18279 __pyx_t_3 = ((PyObject *)__pyx_v_memview);
18280 __Pyx_INCREF(__pyx_t_3);
18281 __pyx_v_obj = ((
struct __pyx_memoryviewslice_obj *)__pyx_t_3);
18291 __pyx_r = (&__pyx_v_obj->from_slice);
18311 __pyx_memoryview_slice_copy(__pyx_v_memview, __pyx_v_mslice);
18320 __pyx_r = __pyx_v_mslice;
18334 __Pyx_XDECREF(__pyx_t_3);
18335 __Pyx_AddTraceback(
"View.MemoryView.get_slice_from_memview", __pyx_clineno, __pyx_lineno, __pyx_filename);
18338 __Pyx_XDECREF((PyObject *)__pyx_v_obj);
18339 __Pyx_RefNannyFinishContext();
18351 static void __pyx_memoryview_slice_copy(
struct __pyx_memoryview_obj *__pyx_v_memview, __Pyx_memviewslice *__pyx_v_dst) {
18353 Py_ssize_t *__pyx_v_shape;
18354 Py_ssize_t *__pyx_v_strides;
18355 Py_ssize_t *__pyx_v_suboffsets;
18356 __Pyx_RefNannyDeclarations
18357 Py_ssize_t *__pyx_t_1;
18361 Py_ssize_t __pyx_t_5;
18362 __Pyx_RefNannySetupContext(
"slice_copy", 0);
18371 __pyx_t_1 = __pyx_v_memview->view.shape;
18372 __pyx_v_shape = __pyx_t_1;
18381 __pyx_t_1 = __pyx_v_memview->view.strides;
18382 __pyx_v_strides = __pyx_t_1;
18391 __pyx_t_1 = __pyx_v_memview->view.suboffsets;
18392 __pyx_v_suboffsets = __pyx_t_1;
18401 __pyx_v_dst->memview = ((
struct __pyx_memoryview_obj *)__pyx_v_memview);
18410 __pyx_v_dst->data = ((
char *)__pyx_v_memview->view.buf);
18419 __pyx_t_2 = __pyx_v_memview->view.ndim;
18420 __pyx_t_3 = __pyx_t_2;
18421 for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
18422 __pyx_v_dim = __pyx_t_4;
18431 (__pyx_v_dst->shape[__pyx_v_dim]) = (__pyx_v_shape[__pyx_v_dim]);
18440 (__pyx_v_dst->strides[__pyx_v_dim]) = (__pyx_v_strides[__pyx_v_dim]);
18449 if ((__pyx_v_suboffsets != 0)) {
18450 __pyx_t_5 = (__pyx_v_suboffsets[__pyx_v_dim]);
18454 (__pyx_v_dst->suboffsets[__pyx_v_dim]) = __pyx_t_5;
18466 __Pyx_RefNannyFinishContext();
18477 static PyObject *__pyx_memoryview_copy_object(
struct __pyx_memoryview_obj *__pyx_v_memview) {
18478 __Pyx_memviewslice __pyx_v_memviewslice;
18479 PyObject *__pyx_r = NULL;
18480 __Pyx_RefNannyDeclarations
18481 PyObject *__pyx_t_1 = NULL;
18482 int __pyx_lineno = 0;
18483 const char *__pyx_filename = NULL;
18484 int __pyx_clineno = 0;
18485 __Pyx_RefNannySetupContext(
"memoryview_copy", 0);
18494 __pyx_memoryview_slice_copy(__pyx_v_memview, (&__pyx_v_memviewslice));
18503 __Pyx_XDECREF(__pyx_r);
18504 __pyx_t_1 = __pyx_memoryview_copy_object_from_slice(__pyx_v_memview, (&__pyx_v_memviewslice));
if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 1084, __pyx_L1_error)
18505 __Pyx_GOTREF(__pyx_t_1);
18506 __pyx_r = __pyx_t_1;
18520 __Pyx_XDECREF(__pyx_t_1);
18521 __Pyx_AddTraceback(
"View.MemoryView.memoryview_copy", __pyx_clineno, __pyx_lineno, __pyx_filename);
18524 __Pyx_XGIVEREF(__pyx_r);
18525 __Pyx_RefNannyFinishContext();
18537 static PyObject *__pyx_memoryview_copy_object_from_slice(
struct __pyx_memoryview_obj *__pyx_v_memview, __Pyx_memviewslice *__pyx_v_memviewslice) {
18538 PyObject *(*__pyx_v_to_object_func)(
char *);
18539 int (*__pyx_v_to_dtype_func)(
char *, PyObject *);
18540 PyObject *__pyx_r = NULL;
18541 __Pyx_RefNannyDeclarations
18544 PyObject *(*__pyx_t_3)(
char *);
18545 int (*__pyx_t_4)(
char *, PyObject *);
18546 PyObject *__pyx_t_5 = NULL;
18547 int __pyx_lineno = 0;
18548 const char *__pyx_filename = NULL;
18549 int __pyx_clineno = 0;
18550 __Pyx_RefNannySetupContext(
"memoryview_copy_from_slice", 0);
18559 __pyx_t_1 = __Pyx_TypeCheck(((PyObject *)__pyx_v_memview), __pyx_memoryviewslice_type);
18560 __pyx_t_2 = (__pyx_t_1 != 0);
18570 __pyx_t_3 = ((
struct __pyx_memoryviewslice_obj *)__pyx_v_memview)->to_object_func;
18571 __pyx_v_to_object_func = __pyx_t_3;
18580 __pyx_t_4 = ((
struct __pyx_memoryviewslice_obj *)__pyx_v_memview)->to_dtype_func;
18581 __pyx_v_to_dtype_func = __pyx_t_4;
18601 __pyx_v_to_object_func = NULL;
18610 __pyx_v_to_dtype_func = NULL;
18621 __Pyx_XDECREF(__pyx_r);
18630 __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(2, 1101, __pyx_L1_error)
18631 __Pyx_GOTREF(__pyx_t_5);
18632 __pyx_r = __pyx_t_5;
18646 __Pyx_XDECREF(__pyx_t_5);
18647 __Pyx_AddTraceback(
"View.MemoryView.memoryview_copy_from_slice", __pyx_clineno, __pyx_lineno, __pyx_filename);
18650 __Pyx_XGIVEREF(__pyx_r);
18651 __Pyx_RefNannyFinishContext();
18663 static Py_ssize_t abs_py_ssize_t(Py_ssize_t __pyx_v_arg) {
18664 Py_ssize_t __pyx_r;
18674 __pyx_t_1 = ((__pyx_v_arg < 0) != 0);
18684 __pyx_r = (-__pyx_v_arg);
18704 __pyx_r = __pyx_v_arg;
18729 static char __pyx_get_best_slice_order(__Pyx_memviewslice *__pyx_v_mslice,
int __pyx_v_ndim) {
18731 Py_ssize_t __pyx_v_c_stride;
18732 Py_ssize_t __pyx_v_f_stride;
18746 __pyx_v_c_stride = 0;
18755 __pyx_v_f_stride = 0;
18764 for (__pyx_t_1 = (__pyx_v_ndim - 1); __pyx_t_1 > -1; __pyx_t_1-=1) {
18765 __pyx_v_i = __pyx_t_1;
18774 __pyx_t_2 = (((__pyx_v_mslice->shape[__pyx_v_i]) > 1) != 0);
18784 __pyx_v_c_stride = (__pyx_v_mslice->strides[__pyx_v_i]);
18793 goto __pyx_L4_break;
18813 __pyx_t_1 = __pyx_v_ndim;
18814 __pyx_t_3 = __pyx_t_1;
18815 for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
18816 __pyx_v_i = __pyx_t_4;
18825 __pyx_t_2 = (((__pyx_v_mslice->shape[__pyx_v_i]) > 1) != 0);
18835 __pyx_v_f_stride = (__pyx_v_mslice->strides[__pyx_v_i]);
18844 goto __pyx_L7_break;
18864 __pyx_t_2 = ((abs_py_ssize_t(__pyx_v_c_stride) <= abs_py_ssize_t(__pyx_v_f_stride)) != 0);
18919 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) {
18920 CYTHON_UNUSED Py_ssize_t __pyx_v_i;
18921 CYTHON_UNUSED Py_ssize_t __pyx_v_src_extent;
18922 Py_ssize_t __pyx_v_dst_extent;
18923 Py_ssize_t __pyx_v_src_stride;
18924 Py_ssize_t __pyx_v_dst_stride;
18928 Py_ssize_t __pyx_t_4;
18929 Py_ssize_t __pyx_t_5;
18930 Py_ssize_t __pyx_t_6;
18939 __pyx_v_src_extent = (__pyx_v_src_shape[0]);
18948 __pyx_v_dst_extent = (__pyx_v_dst_shape[0]);
18957 __pyx_v_src_stride = (__pyx_v_src_strides[0]);
18966 __pyx_v_dst_stride = (__pyx_v_dst_strides[0]);
18975 __pyx_t_1 = ((__pyx_v_ndim == 1) != 0);
18985 __pyx_t_2 = ((__pyx_v_src_stride > 0) != 0);
18988 __pyx_t_1 = __pyx_t_2;
18989 goto __pyx_L5_bool_binop_done;
18991 __pyx_t_2 = ((__pyx_v_dst_stride > 0) != 0);
18994 __pyx_t_1 = __pyx_t_2;
18995 goto __pyx_L5_bool_binop_done;
19005 __pyx_t_2 = (((size_t)__pyx_v_src_stride) == __pyx_v_itemsize);
19007 __pyx_t_2 = (__pyx_v_itemsize == ((size_t)__pyx_v_dst_stride));
19009 __pyx_t_3 = (__pyx_t_2 != 0);
19010 __pyx_t_1 = __pyx_t_3;
19011 __pyx_L5_bool_binop_done:;
19029 (void)(memcpy(__pyx_v_dst_data, __pyx_v_src_data, (__pyx_v_itemsize * __pyx_v_dst_extent)));
19049 __pyx_t_4 = __pyx_v_dst_extent;
19050 __pyx_t_5 = __pyx_t_4;
19051 for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) {
19052 __pyx_v_i = __pyx_t_6;
19061 (void)(memcpy(__pyx_v_dst_data, __pyx_v_src_data, __pyx_v_itemsize));
19070 __pyx_v_src_data = (__pyx_v_src_data + __pyx_v_src_stride);
19079 __pyx_v_dst_data = (__pyx_v_dst_data + __pyx_v_dst_stride);
19102 __pyx_t_4 = __pyx_v_dst_extent;
19103 __pyx_t_5 = __pyx_t_4;
19104 for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) {
19105 __pyx_v_i = __pyx_t_6;
19114 _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);
19123 __pyx_v_src_data = (__pyx_v_src_data + __pyx_v_src_stride);
19132 __pyx_v_dst_data = (__pyx_v_dst_data + __pyx_v_dst_stride);
19156 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) {
19165 _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);
19186 static Py_ssize_t __pyx_memoryview_slice_get_size(__Pyx_memviewslice *__pyx_v_src,
int __pyx_v_ndim) {
19187 Py_ssize_t __pyx_v_shape;
19188 Py_ssize_t __pyx_v_size;
19189 Py_ssize_t __pyx_r;
19190 Py_ssize_t __pyx_t_1;
19191 Py_ssize_t *__pyx_t_2;
19192 Py_ssize_t *__pyx_t_3;
19193 Py_ssize_t *__pyx_t_4;
19202 __pyx_t_1 = __pyx_v_src->memview->view.itemsize;
19203 __pyx_v_size = __pyx_t_1;
19212 __pyx_t_3 = (__pyx_v_src->shape + __pyx_v_ndim);
19213 for (__pyx_t_4 = __pyx_v_src->shape; __pyx_t_4 < __pyx_t_3; __pyx_t_4++) {
19214 __pyx_t_2 = __pyx_t_4;
19215 __pyx_v_shape = (__pyx_t_2[0]);
19224 __pyx_v_size = (__pyx_v_size * __pyx_v_shape);
19234 __pyx_r = __pyx_v_size;
19258 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) {
19260 Py_ssize_t __pyx_r;
19273 __pyx_t_1 = ((__pyx_v_order ==
'F') != 0);
19283 __pyx_t_2 = __pyx_v_ndim;
19284 __pyx_t_3 = __pyx_t_2;
19285 for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
19286 __pyx_v_idx = __pyx_t_4;
19295 (__pyx_v_strides[__pyx_v_idx]) = __pyx_v_stride;
19304 __pyx_v_stride = (__pyx_v_stride * (__pyx_v_shape[__pyx_v_idx]));
19325 for (__pyx_t_2 = (__pyx_v_ndim - 1); __pyx_t_2 > -1; __pyx_t_2-=1) {
19326 __pyx_v_idx = __pyx_t_2;
19335 (__pyx_v_strides[__pyx_v_idx]) = __pyx_v_stride;
19344 __pyx_v_stride = (__pyx_v_stride * (__pyx_v_shape[__pyx_v_idx]));
19356 __pyx_r = __pyx_v_stride;
19380 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) {
19382 void *__pyx_v_result;
19383 size_t __pyx_v_itemsize;
19384 size_t __pyx_v_size;
19386 Py_ssize_t __pyx_t_1;
19389 struct __pyx_memoryview_obj *__pyx_t_4;
19392 int __pyx_lineno = 0;
19393 const char *__pyx_filename = NULL;
19394 int __pyx_clineno = 0;
19403 __pyx_t_1 = __pyx_v_src->memview->view.itemsize;
19404 __pyx_v_itemsize = __pyx_t_1;
19413 __pyx_v_size = __pyx_memoryview_slice_get_size(__pyx_v_src, __pyx_v_ndim);
19422 __pyx_v_result = malloc(__pyx_v_size);
19431 __pyx_t_2 = ((!(__pyx_v_result != 0)) != 0);
19441 __pyx_t_3 = __pyx_memoryview_err(__pyx_builtin_MemoryError, NULL);
if (unlikely(__pyx_t_3 == ((
int)-1))) __PYX_ERR(2, 1224, __pyx_L1_error)
19459 __pyx_v_tmpslice->data = ((
char *)__pyx_v_result);
19468 __pyx_t_4 = __pyx_v_src->memview;
19469 __pyx_v_tmpslice->memview = __pyx_t_4;
19478 __pyx_t_3 = __pyx_v_ndim;
19479 __pyx_t_5 = __pyx_t_3;
19480 for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) {
19481 __pyx_v_i = __pyx_t_6;
19490 (__pyx_v_tmpslice->shape[__pyx_v_i]) = (__pyx_v_src->shape[__pyx_v_i]);
19499 (__pyx_v_tmpslice->suboffsets[__pyx_v_i]) = -1
L;
19509 (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));
19518 __pyx_t_3 = __pyx_v_ndim;
19519 __pyx_t_5 = __pyx_t_3;
19520 for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) {
19521 __pyx_v_i = __pyx_t_6;
19530 __pyx_t_2 = (((__pyx_v_tmpslice->shape[__pyx_v_i]) == 1) != 0);
19540 (__pyx_v_tmpslice->strides[__pyx_v_i]) = 0;
19559 __pyx_t_2 = (__pyx_memviewslice_is_contig((__pyx_v_src[0]), __pyx_v_order, __pyx_v_ndim) != 0);
19569 (void)(memcpy(__pyx_v_result, __pyx_v_src->data, __pyx_v_size));
19589 copy_strided_to_strided(__pyx_v_src, __pyx_v_tmpslice, __pyx_v_ndim, __pyx_v_itemsize);
19600 __pyx_r = __pyx_v_result;
19615 PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
19617 __Pyx_AddTraceback(
"View.MemoryView.copy_data_to_temp", __pyx_clineno, __pyx_lineno, __pyx_filename);
19619 __Pyx_PyGILState_Release(__pyx_gilstate_save);
19635 static int __pyx_memoryview_err_extents(
int __pyx_v_i, Py_ssize_t __pyx_v_extent1, Py_ssize_t __pyx_v_extent2) {
19637 __Pyx_RefNannyDeclarations
19638 PyObject *__pyx_t_1 = NULL;
19639 PyObject *__pyx_t_2 = NULL;
19640 PyObject *__pyx_t_3 = NULL;
19641 PyObject *__pyx_t_4 = NULL;
19642 int __pyx_lineno = 0;
19643 const char *__pyx_filename = NULL;
19644 int __pyx_clineno = 0;
19646 PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
19648 __Pyx_RefNannySetupContext(
"_err_extents", 0);
19657 __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_i);
if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 1254, __pyx_L1_error)
19658 __Pyx_GOTREF(__pyx_t_1);
19659 __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_extent1);
if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 1254, __pyx_L1_error)
19660 __Pyx_GOTREF(__pyx_t_2);
19661 __pyx_t_3 = PyInt_FromSsize_t(__pyx_v_extent2);
if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 1254, __pyx_L1_error)
19662 __Pyx_GOTREF(__pyx_t_3);
19663 __pyx_t_4 = PyTuple_New(3);
if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 1254, __pyx_L1_error)
19664 __Pyx_GOTREF(__pyx_t_4);
19665 __Pyx_GIVEREF(__pyx_t_1);
19666 PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_1);
19667 __Pyx_GIVEREF(__pyx_t_2);
19668 PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_2);
19669 __Pyx_GIVEREF(__pyx_t_3);
19670 PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_t_3);
19682 __pyx_t_3 = __Pyx_PyString_Format(__pyx_kp_s_got_differing_extents_in_dimensi, __pyx_t_4);
if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 1253, __pyx_L1_error)
19683 __Pyx_GOTREF(__pyx_t_3);
19684 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
19685 __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_3);
if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 1253, __pyx_L1_error)
19686 __Pyx_GOTREF(__pyx_t_4);
19687 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
19688 __Pyx_Raise(__pyx_t_4, 0, 0, 0);
19689 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
19690 __PYX_ERR(2, 1253, __pyx_L1_error)
19702 __Pyx_XDECREF(__pyx_t_1);
19703 __Pyx_XDECREF(__pyx_t_2);
19704 __Pyx_XDECREF(__pyx_t_3);
19705 __Pyx_XDECREF(__pyx_t_4);
19706 __Pyx_AddTraceback(
"View.MemoryView._err_extents", __pyx_clineno, __pyx_lineno, __pyx_filename);
19708 __Pyx_RefNannyFinishContext();
19710 __Pyx_PyGILState_Release(__pyx_gilstate_save);
19723 static int __pyx_memoryview_err_dim(PyObject *__pyx_v_error,
char *__pyx_v_msg,
int __pyx_v_dim) {
19725 __Pyx_RefNannyDeclarations
19726 PyObject *__pyx_t_1 = NULL;
19727 PyObject *__pyx_t_2 = NULL;
19728 PyObject *__pyx_t_3 = NULL;
19729 PyObject *__pyx_t_4 = NULL;
19730 int __pyx_lineno = 0;
19731 const char *__pyx_filename = NULL;
19732 int __pyx_clineno = 0;
19734 PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
19736 __Pyx_RefNannySetupContext(
"_err_dim", 0);
19737 __Pyx_INCREF(__pyx_v_error);
19746 __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(2, 1258, __pyx_L1_error)
19747 __Pyx_GOTREF(__pyx_t_2);
19748 __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_dim);
if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 1258, __pyx_L1_error)
19749 __Pyx_GOTREF(__pyx_t_3);
19750 __pyx_t_4 = PyUnicode_Format(__pyx_t_2, __pyx_t_3);
if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 1258, __pyx_L1_error)
19751 __Pyx_GOTREF(__pyx_t_4);
19752 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
19753 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
19754 __Pyx_INCREF(__pyx_v_error);
19755 __pyx_t_3 = __pyx_v_error; __pyx_t_2 = NULL;
19756 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
19757 __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
19758 if (likely(__pyx_t_2)) {
19759 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_3);
19760 __Pyx_INCREF(__pyx_t_2);
19761 __Pyx_INCREF(
function);
19762 __Pyx_DECREF_SET(__pyx_t_3,
function);
19765 __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);
19766 __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
19767 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
19768 if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 1258, __pyx_L1_error)
19769 __Pyx_GOTREF(__pyx_t_1);
19770 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
19771 __Pyx_Raise(__pyx_t_1, 0, 0, 0);
19772 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
19773 __PYX_ERR(2, 1258, __pyx_L1_error)
19785 __Pyx_XDECREF(__pyx_t_1);
19786 __Pyx_XDECREF(__pyx_t_2);
19787 __Pyx_XDECREF(__pyx_t_3);
19788 __Pyx_XDECREF(__pyx_t_4);
19789 __Pyx_AddTraceback(
"View.MemoryView._err_dim", __pyx_clineno, __pyx_lineno, __pyx_filename);
19791 __Pyx_XDECREF(__pyx_v_error);
19792 __Pyx_RefNannyFinishContext();
19794 __Pyx_PyGILState_Release(__pyx_gilstate_save);
19807 static int __pyx_memoryview_err(PyObject *__pyx_v_error,
char *__pyx_v_msg) {
19809 __Pyx_RefNannyDeclarations
19811 PyObject *__pyx_t_2 = NULL;
19812 PyObject *__pyx_t_3 = NULL;
19813 PyObject *__pyx_t_4 = NULL;
19814 PyObject *__pyx_t_5 = NULL;
19815 int __pyx_lineno = 0;
19816 const char *__pyx_filename = NULL;
19817 int __pyx_clineno = 0;
19819 PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
19821 __Pyx_RefNannySetupContext(
"_err", 0);
19822 __Pyx_INCREF(__pyx_v_error);
19831 __pyx_t_1 = ((__pyx_v_msg != NULL) != 0);
19832 if (unlikely(__pyx_t_1)) {
19841 __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(2, 1263, __pyx_L1_error)
19842 __Pyx_GOTREF(__pyx_t_3);
19843 __Pyx_INCREF(__pyx_v_error);
19844 __pyx_t_4 = __pyx_v_error; __pyx_t_5 = NULL;
19845 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
19846 __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
19847 if (likely(__pyx_t_5)) {
19848 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_4);
19849 __Pyx_INCREF(__pyx_t_5);
19850 __Pyx_INCREF(
function);
19851 __Pyx_DECREF_SET(__pyx_t_4,
function);
19854 __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);
19855 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
19856 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
19857 if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 1263, __pyx_L1_error)
19858 __Pyx_GOTREF(__pyx_t_2);
19859 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
19860 __Pyx_Raise(__pyx_t_2, 0, 0, 0);
19861 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
19862 __PYX_ERR(2, 1263, __pyx_L1_error)
19881 __Pyx_Raise(__pyx_v_error, 0, 0, 0);
19882 __PYX_ERR(2, 1265, __pyx_L1_error)
19895 __Pyx_XDECREF(__pyx_t_2);
19896 __Pyx_XDECREF(__pyx_t_3);
19897 __Pyx_XDECREF(__pyx_t_4);
19898 __Pyx_XDECREF(__pyx_t_5);
19899 __Pyx_AddTraceback(
"View.MemoryView._err", __pyx_clineno, __pyx_lineno, __pyx_filename);
19901 __Pyx_XDECREF(__pyx_v_error);
19902 __Pyx_RefNannyFinishContext();
19904 __Pyx_PyGILState_Release(__pyx_gilstate_save);
19917 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) {
19918 void *__pyx_v_tmpdata;
19919 size_t __pyx_v_itemsize;
19921 char __pyx_v_order;
19922 int __pyx_v_broadcasting;
19923 int __pyx_v_direct_copy;
19924 __Pyx_memviewslice __pyx_v_tmp;
19927 Py_ssize_t __pyx_t_1;
19935 int __pyx_lineno = 0;
19936 const char *__pyx_filename = NULL;
19937 int __pyx_clineno = 0;
19946 __pyx_v_tmpdata = NULL;
19955 __pyx_t_1 = __pyx_v_src.memview->view.itemsize;
19956 __pyx_v_itemsize = __pyx_t_1;
19965 __pyx_v_order = __pyx_get_best_slice_order((&__pyx_v_src), __pyx_v_src_ndim);
19974 __pyx_v_broadcasting = 0;
19983 __pyx_v_direct_copy = 0;
19992 __pyx_t_2 = ((__pyx_v_src_ndim < __pyx_v_dst_ndim) != 0);
20002 __pyx_memoryview_broadcast_leading((&__pyx_v_src), __pyx_v_src_ndim, __pyx_v_dst_ndim);
20021 __pyx_t_2 = ((__pyx_v_dst_ndim < __pyx_v_src_ndim) != 0);
20031 __pyx_memoryview_broadcast_leading((&__pyx_v_dst), __pyx_v_dst_ndim, __pyx_v_src_ndim);
20050 __pyx_t_3 = __pyx_v_dst_ndim;
20051 __pyx_t_4 = __pyx_v_src_ndim;
20052 if (((__pyx_t_3 > __pyx_t_4) != 0)) {
20053 __pyx_t_5 = __pyx_t_3;
20055 __pyx_t_5 = __pyx_t_4;
20057 __pyx_v_ndim = __pyx_t_5;
20066 __pyx_t_5 = __pyx_v_ndim;
20067 __pyx_t_3 = __pyx_t_5;
20068 for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
20069 __pyx_v_i = __pyx_t_4;
20078 __pyx_t_2 = (((__pyx_v_src.shape[__pyx_v_i]) != (__pyx_v_dst.shape[__pyx_v_i])) != 0);
20088 __pyx_t_2 = (((__pyx_v_src.shape[__pyx_v_i]) == 1) != 0);
20098 __pyx_v_broadcasting = 1;
20107 (__pyx_v_src.strides[__pyx_v_i]) = 0;
20127 __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(2, 1297, __pyx_L1_error)
20147 __pyx_t_2 = (((__pyx_v_src.suboffsets[__pyx_v_i]) >= 0) != 0);
20157 __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(2, 1300, __pyx_L1_error)
20176 __pyx_t_2 = (__pyx_slices_overlap((&__pyx_v_src), (&__pyx_v_dst), __pyx_v_ndim, __pyx_v_itemsize) != 0);
20186 __pyx_t_2 = ((!(__pyx_memviewslice_is_contig(__pyx_v_src, __pyx_v_order, __pyx_v_ndim) != 0)) != 0);
20196 __pyx_v_order = __pyx_get_best_slice_order((&__pyx_v_dst), __pyx_v_ndim);
20214 __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(2, 1307, __pyx_L1_error)
20215 __pyx_v_tmpdata = __pyx_t_7;
20224 __pyx_v_src = __pyx_v_tmp;
20242 __pyx_t_2 = ((!(__pyx_v_broadcasting != 0)) != 0);
20252 __pyx_t_2 = (__pyx_memviewslice_is_contig(__pyx_v_src,
'C', __pyx_v_ndim) != 0);
20262 __pyx_v_direct_copy = __pyx_memviewslice_is_contig(__pyx_v_dst,
'C', __pyx_v_ndim);
20281 __pyx_t_2 = (__pyx_memviewslice_is_contig(__pyx_v_src,
'F', __pyx_v_ndim) != 0);
20291 __pyx_v_direct_copy = __pyx_memviewslice_is_contig(__pyx_v_dst,
'F', __pyx_v_ndim);
20310 __pyx_t_2 = (__pyx_v_direct_copy != 0);
20320 __pyx_memoryview_refcount_copying((&__pyx_v_dst), __pyx_v_dtype_is_object, __pyx_v_ndim, 0);
20329 (void)(memcpy(__pyx_v_dst.data, __pyx_v_src.data, __pyx_memoryview_slice_get_size((&__pyx_v_src), __pyx_v_ndim)));
20338 __pyx_memoryview_refcount_copying((&__pyx_v_dst), __pyx_v_dtype_is_object, __pyx_v_ndim, 1);
20347 free(__pyx_v_tmpdata);
20384 __pyx_t_2 = (__pyx_v_order ==
'F');
20386 __pyx_t_2 = (
'F' == __pyx_get_best_slice_order((&__pyx_v_dst), __pyx_v_ndim));
20388 __pyx_t_8 = (__pyx_t_2 != 0);
20398 __pyx_t_5 = __pyx_memslice_transpose((&__pyx_v_src));
if (unlikely(__pyx_t_5 == ((
int)0))) __PYX_ERR(2, 1329, __pyx_L1_error)
20407 __pyx_t_5 = __pyx_memslice_transpose((&__pyx_v_dst));
if (unlikely(__pyx_t_5 == ((
int)0))) __PYX_ERR(2, 1330, __pyx_L1_error)
20425 __pyx_memoryview_refcount_copying((&__pyx_v_dst), __pyx_v_dtype_is_object, __pyx_v_ndim, 0);
20434 copy_strided_to_strided((&__pyx_v_src), (&__pyx_v_dst), __pyx_v_ndim, __pyx_v_itemsize);
20443 __pyx_memoryview_refcount_copying((&__pyx_v_dst), __pyx_v_dtype_is_object, __pyx_v_ndim, 1);
20452 free(__pyx_v_tmpdata);
20476 PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
20478 __Pyx_AddTraceback(
"View.MemoryView.memoryview_copy_contents", __pyx_clineno, __pyx_lineno, __pyx_filename);
20480 __Pyx_PyGILState_Release(__pyx_gilstate_save);
20496 static void __pyx_memoryview_broadcast_leading(__Pyx_memviewslice *__pyx_v_mslice,
int __pyx_v_ndim,
int __pyx_v_ndim_other) {
20498 int __pyx_v_offset;
20510 __pyx_v_offset = (__pyx_v_ndim_other - __pyx_v_ndim);
20519 for (__pyx_t_1 = (__pyx_v_ndim - 1); __pyx_t_1 > -1; __pyx_t_1-=1) {
20520 __pyx_v_i = __pyx_t_1;
20529 (__pyx_v_mslice->shape[(__pyx_v_i + __pyx_v_offset)]) = (__pyx_v_mslice->shape[__pyx_v_i]);
20538 (__pyx_v_mslice->strides[(__pyx_v_i + __pyx_v_offset)]) = (__pyx_v_mslice->strides[__pyx_v_i]);
20547 (__pyx_v_mslice->suboffsets[(__pyx_v_i + __pyx_v_offset)]) = (__pyx_v_mslice->suboffsets[__pyx_v_i]);
20557 __pyx_t_1 = __pyx_v_offset;
20558 __pyx_t_2 = __pyx_t_1;
20559 for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) {
20560 __pyx_v_i = __pyx_t_3;
20569 (__pyx_v_mslice->shape[__pyx_v_i]) = 1;
20578 (__pyx_v_mslice->strides[__pyx_v_i]) = (__pyx_v_mslice->strides[0]);
20587 (__pyx_v_mslice->suboffsets[__pyx_v_i]) = -1
L;
20609 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) {
20619 __pyx_t_1 = (__pyx_v_dtype_is_object != 0);
20629 __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);
20659 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) {
20660 __Pyx_RefNannyDeclarations
20662 PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
20664 __Pyx_RefNannySetupContext(
"refcount_objects_in_slice_with_gil", 0);
20673 __pyx_memoryview_refcount_objects_in_slice(__pyx_v_data, __pyx_v_shape, __pyx_v_strides, __pyx_v_ndim, __pyx_v_inc);
20684 __Pyx_RefNannyFinishContext();
20686 __Pyx_PyGILState_Release(__pyx_gilstate_save);
20698 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) {
20699 CYTHON_UNUSED Py_ssize_t __pyx_v_i;
20700 __Pyx_RefNannyDeclarations
20701 Py_ssize_t __pyx_t_1;
20702 Py_ssize_t __pyx_t_2;
20703 Py_ssize_t __pyx_t_3;
20705 __Pyx_RefNannySetupContext(
"refcount_objects_in_slice", 0);
20714 __pyx_t_1 = (__pyx_v_shape[0]);
20715 __pyx_t_2 = __pyx_t_1;
20716 for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) {
20717 __pyx_v_i = __pyx_t_3;
20726 __pyx_t_4 = ((__pyx_v_ndim == 1) != 0);
20736 __pyx_t_4 = (__pyx_v_inc != 0);
20746 Py_INCREF((((PyObject **)__pyx_v_data)[0]));
20766 Py_DECREF((((PyObject **)__pyx_v_data)[0]));
20796 __pyx_memoryview_refcount_objects_in_slice(__pyx_v_data, (__pyx_v_shape + 1), (__pyx_v_strides + 1), (__pyx_v_ndim - 1), __pyx_v_inc);
20807 __pyx_v_data = (__pyx_v_data + (__pyx_v_strides[0]));
20819 __Pyx_RefNannyFinishContext();
20830 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) {
20839 __pyx_memoryview_refcount_copying(__pyx_v_dst, __pyx_v_dtype_is_object, __pyx_v_ndim, 0);
20848 __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);
20857 __pyx_memoryview_refcount_copying(__pyx_v_dst, __pyx_v_dtype_is_object, __pyx_v_ndim, 1);
20878 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) {
20879 CYTHON_UNUSED Py_ssize_t __pyx_v_i;
20880 Py_ssize_t __pyx_v_stride;
20881 Py_ssize_t __pyx_v_extent;
20883 Py_ssize_t __pyx_t_2;
20884 Py_ssize_t __pyx_t_3;
20885 Py_ssize_t __pyx_t_4;
20894 __pyx_v_stride = (__pyx_v_strides[0]);
20903 __pyx_v_extent = (__pyx_v_shape[0]);
20912 __pyx_t_1 = ((__pyx_v_ndim == 1) != 0);
20922 __pyx_t_2 = __pyx_v_extent;
20923 __pyx_t_3 = __pyx_t_2;
20924 for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
20925 __pyx_v_i = __pyx_t_4;
20934 (void)(memcpy(__pyx_v_data, __pyx_v_item, __pyx_v_itemsize));
20943 __pyx_v_data = (__pyx_v_data + __pyx_v_stride);
20964 __pyx_t_2 = __pyx_v_extent;
20965 __pyx_t_3 = __pyx_t_2;
20966 for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
20967 __pyx_v_i = __pyx_t_4;
20976 __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);
20985 __pyx_v_data = (__pyx_v_data + __pyx_v_stride);
21008 static PyObject *__pyx_pw_15View_dot_MemoryView_1__pyx_unpickle_Enum(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
21009 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};
21010 static PyObject *__pyx_pw_15View_dot_MemoryView_1__pyx_unpickle_Enum(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
21011 PyObject *__pyx_v___pyx_type = 0;
21012 long __pyx_v___pyx_checksum;
21013 PyObject *__pyx_v___pyx_state = 0;
21014 int __pyx_lineno = 0;
21015 const char *__pyx_filename = NULL;
21016 int __pyx_clineno = 0;
21017 PyObject *__pyx_r = 0;
21018 __Pyx_RefNannyDeclarations
21019 __Pyx_RefNannySetupContext(
"__pyx_unpickle_Enum (wrapper)", 0);
21021 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_pyx_type,&__pyx_n_s_pyx_checksum,&__pyx_n_s_pyx_state,0};
21022 PyObject* values[3] = {0,0,0};
21023 if (unlikely(__pyx_kwds)) {
21024 Py_ssize_t kw_args;
21025 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
21026 switch (pos_args) {
21027 case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
21028 CYTHON_FALLTHROUGH;
21029 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
21030 CYTHON_FALLTHROUGH;
21031 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
21032 CYTHON_FALLTHROUGH;
21034 default:
goto __pyx_L5_argtuple_error;
21036 kw_args = PyDict_Size(__pyx_kwds);
21037 switch (pos_args) {
21039 if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pyx_type)) != 0)) kw_args--;
21040 else goto __pyx_L5_argtuple_error;
21041 CYTHON_FALLTHROUGH;
21043 if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pyx_checksum)) != 0)) kw_args--;
21045 __Pyx_RaiseArgtupleInvalid(
"__pyx_unpickle_Enum", 1, 3, 3, 1); __PYX_ERR(2, 1, __pyx_L3_error)
21047 CYTHON_FALLTHROUGH;
21049 if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pyx_state)) != 0)) kw_args--;
21051 __Pyx_RaiseArgtupleInvalid(
"__pyx_unpickle_Enum", 1, 3, 3, 2); __PYX_ERR(2, 1, __pyx_L3_error)
21054 if (unlikely(kw_args > 0)) {
21055 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args,
"__pyx_unpickle_Enum") < 0)) __PYX_ERR(2, 1, __pyx_L3_error)
21057 }
else if (PyTuple_GET_SIZE(__pyx_args) != 3) {
21058 goto __pyx_L5_argtuple_error;
21060 values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
21061 values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
21062 values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
21064 __pyx_v___pyx_type = values[0];
21065 __pyx_v___pyx_checksum = __Pyx_PyInt_As_long(values[1]);
if (unlikely((__pyx_v___pyx_checksum == (
long)-1) && PyErr_Occurred())) __PYX_ERR(2, 1, __pyx_L3_error)
21066 __pyx_v___pyx_state = values[2];
21068 goto __pyx_L4_argument_unpacking_done;
21069 __pyx_L5_argtuple_error:;
21070 __Pyx_RaiseArgtupleInvalid(
"__pyx_unpickle_Enum", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(2, 1, __pyx_L3_error)
21072 __Pyx_AddTraceback(
"View.MemoryView.__pyx_unpickle_Enum", __pyx_clineno, __pyx_lineno, __pyx_filename);
21073 __Pyx_RefNannyFinishContext();
21075 __pyx_L4_argument_unpacking_done:;
21076 __pyx_r = __pyx_pf_15View_dot_MemoryView___pyx_unpickle_Enum(__pyx_self, __pyx_v___pyx_type, __pyx_v___pyx_checksum, __pyx_v___pyx_state);
21079 __Pyx_RefNannyFinishContext();
21083 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) {
21084 PyObject *__pyx_v___pyx_PickleError = 0;
21085 PyObject *__pyx_v___pyx_result = 0;
21086 PyObject *__pyx_r = NULL;
21087 __Pyx_RefNannyDeclarations
21088 PyObject *__pyx_t_1 = NULL;
21091 PyObject *__pyx_t_4 = NULL;
21092 PyObject *__pyx_t_5 = NULL;
21093 PyObject *__pyx_t_6 = NULL;
21094 int __pyx_lineno = 0;
21095 const char *__pyx_filename = NULL;
21096 int __pyx_clineno = 0;
21097 __Pyx_RefNannySetupContext(
"__pyx_unpickle_Enum", 0);
21106 __pyx_t_1 = __Pyx_PyInt_From_long(__pyx_v___pyx_checksum);
if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 4, __pyx_L1_error)
21107 __Pyx_GOTREF(__pyx_t_1);
21108 __pyx_t_2 = (__Pyx_PySequence_ContainsTF(__pyx_t_1, __pyx_tuple__21, Py_NE));
if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(2, 4, __pyx_L1_error)
21109 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
21110 __pyx_t_3 = (__pyx_t_2 != 0);
21120 __pyx_t_1 = PyList_New(1);
if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 5, __pyx_L1_error)
21121 __Pyx_GOTREF(__pyx_t_1);
21122 __Pyx_INCREF(__pyx_n_s_PickleError);
21123 __Pyx_GIVEREF(__pyx_n_s_PickleError);
21124 PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_s_PickleError);
21125 __pyx_t_4 = __Pyx_Import(__pyx_n_s_pickle, __pyx_t_1, 0);
if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 5, __pyx_L1_error)
21126 __Pyx_GOTREF(__pyx_t_4);
21127 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
21128 __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_4, __pyx_n_s_PickleError);
if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 5, __pyx_L1_error)
21129 __Pyx_GOTREF(__pyx_t_1);
21130 __Pyx_INCREF(__pyx_t_1);
21131 __pyx_v___pyx_PickleError = __pyx_t_1;
21132 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
21133 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
21142 __pyx_t_1 = __Pyx_PyInt_From_long(__pyx_v___pyx_checksum);
if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 6, __pyx_L1_error)
21143 __Pyx_GOTREF(__pyx_t_1);
21144 __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(2, 6, __pyx_L1_error)
21145 __Pyx_GOTREF(__pyx_t_5);
21146 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
21147 __Pyx_INCREF(__pyx_v___pyx_PickleError);
21148 __pyx_t_1 = __pyx_v___pyx_PickleError; __pyx_t_6 = NULL;
21149 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_1))) {
21150 __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_1);
21151 if (likely(__pyx_t_6)) {
21152 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_1);
21153 __Pyx_INCREF(__pyx_t_6);
21154 __Pyx_INCREF(
function);
21155 __Pyx_DECREF_SET(__pyx_t_1,
function);
21158 __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);
21159 __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
21160 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
21161 if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 6, __pyx_L1_error)
21162 __Pyx_GOTREF(__pyx_t_4);
21163 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
21164 __Pyx_Raise(__pyx_t_4, 0, 0, 0);
21165 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
21166 __PYX_ERR(2, 6, __pyx_L1_error)
21184 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_MemviewEnum_type), __pyx_n_s_new);
if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 7, __pyx_L1_error)
21185 __Pyx_GOTREF(__pyx_t_1);
21187 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_1))) {
21188 __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_1);
21189 if (likely(__pyx_t_5)) {
21190 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_1);
21191 __Pyx_INCREF(__pyx_t_5);
21192 __Pyx_INCREF(
function);
21193 __Pyx_DECREF_SET(__pyx_t_1,
function);
21196 __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);
21197 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
21198 if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 7, __pyx_L1_error)
21199 __Pyx_GOTREF(__pyx_t_4);
21200 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
21201 __pyx_v___pyx_result = __pyx_t_4;
21211 __pyx_t_3 = (__pyx_v___pyx_state != Py_None);
21212 __pyx_t_2 = (__pyx_t_3 != 0);
21222 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(2, 9, __pyx_L1_error)
21223 __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(2, 9, __pyx_L1_error)
21224 __Pyx_GOTREF(__pyx_t_4);
21225 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
21243 __Pyx_XDECREF(__pyx_r);
21244 __Pyx_INCREF(__pyx_v___pyx_result);
21245 __pyx_r = __pyx_v___pyx_result;
21256 __Pyx_XDECREF(__pyx_t_1);
21257 __Pyx_XDECREF(__pyx_t_4);
21258 __Pyx_XDECREF(__pyx_t_5);
21259 __Pyx_XDECREF(__pyx_t_6);
21260 __Pyx_AddTraceback(
"View.MemoryView.__pyx_unpickle_Enum", __pyx_clineno, __pyx_lineno, __pyx_filename);
21263 __Pyx_XDECREF(__pyx_v___pyx_PickleError);
21264 __Pyx_XDECREF(__pyx_v___pyx_result);
21265 __Pyx_XGIVEREF(__pyx_r);
21266 __Pyx_RefNannyFinishContext();
21278 static PyObject *__pyx_unpickle_Enum__set_state(
struct __pyx_MemviewEnum_obj *__pyx_v___pyx_result, PyObject *__pyx_v___pyx_state) {
21279 PyObject *__pyx_r = NULL;
21280 __Pyx_RefNannyDeclarations
21281 PyObject *__pyx_t_1 = NULL;
21283 Py_ssize_t __pyx_t_3;
21286 PyObject *__pyx_t_6 = NULL;
21287 PyObject *__pyx_t_7 = NULL;
21288 PyObject *__pyx_t_8 = NULL;
21289 int __pyx_lineno = 0;
21290 const char *__pyx_filename = NULL;
21291 int __pyx_clineno = 0;
21292 __Pyx_RefNannySetupContext(
"__pyx_unpickle_Enum__set_state", 0);
21301 if (unlikely(__pyx_v___pyx_state == Py_None)) {
21302 PyErr_SetString(PyExc_TypeError,
"'NoneType' object is not subscriptable");
21303 __PYX_ERR(2, 12, __pyx_L1_error)
21305 __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(2, 12, __pyx_L1_error)
21306 __Pyx_GOTREF(__pyx_t_1);
21307 __Pyx_GIVEREF(__pyx_t_1);
21308 __Pyx_GOTREF(__pyx_v___pyx_result->name);
21309 __Pyx_DECREF(__pyx_v___pyx_result->name);
21310 __pyx_v___pyx_result->name = __pyx_t_1;
21319 if (unlikely(__pyx_v___pyx_state == Py_None)) {
21320 PyErr_SetString(PyExc_TypeError,
"object of type 'NoneType' has no len()");
21321 __PYX_ERR(2, 13, __pyx_L1_error)
21323 __pyx_t_3 = PyTuple_GET_SIZE(__pyx_v___pyx_state);
if (unlikely(__pyx_t_3 == ((Py_ssize_t)-1))) __PYX_ERR(2, 13, __pyx_L1_error)
21324 __pyx_t_4 = ((__pyx_t_3 > 1) != 0);
21327 __pyx_t_2 = __pyx_t_4;
21328 goto __pyx_L4_bool_binop_done;
21330 __pyx_t_4 = __Pyx_HasAttr(((PyObject *)__pyx_v___pyx_result), __pyx_n_s_dict);
if (unlikely(__pyx_t_4 == ((
int)-1))) __PYX_ERR(2, 13, __pyx_L1_error)
21331 __pyx_t_5 = (__pyx_t_4 != 0);
21332 __pyx_t_2 = __pyx_t_5;
21333 __pyx_L4_bool_binop_done:;
21341 __pyx_t_6 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v___pyx_result), __pyx_n_s_dict);
if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 14, __pyx_L1_error)
21342 __Pyx_GOTREF(__pyx_t_6);
21343 __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_update);
if (unlikely(!__pyx_t_7)) __PYX_ERR(2, 14, __pyx_L1_error)
21344 __Pyx_GOTREF(__pyx_t_7);
21345 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
21346 if (unlikely(__pyx_v___pyx_state == Py_None)) {
21347 PyErr_SetString(PyExc_TypeError,
"'NoneType' object is not subscriptable");
21348 __PYX_ERR(2, 14, __pyx_L1_error)
21350 __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(2, 14, __pyx_L1_error)
21351 __Pyx_GOTREF(__pyx_t_6);
21353 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_7))) {
21354 __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_7);
21355 if (likely(__pyx_t_8)) {
21356 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_7);
21357 __Pyx_INCREF(__pyx_t_8);
21358 __Pyx_INCREF(
function);
21359 __Pyx_DECREF_SET(__pyx_t_7,
function);
21362 __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);
21363 __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
21364 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
21365 if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 14, __pyx_L1_error)
21366 __Pyx_GOTREF(__pyx_t_1);
21367 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
21368 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
21387 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
21390 __Pyx_XDECREF(__pyx_t_1);
21391 __Pyx_XDECREF(__pyx_t_6);
21392 __Pyx_XDECREF(__pyx_t_7);
21393 __Pyx_XDECREF(__pyx_t_8);
21394 __Pyx_AddTraceback(
"View.MemoryView.__pyx_unpickle_Enum__set_state", __pyx_clineno, __pyx_lineno, __pyx_filename);
21397 __Pyx_XGIVEREF(__pyx_r);
21398 __Pyx_RefNannyFinishContext();
21410 static PyObject *__pyx_format_from_typeinfo(__Pyx_TypeInfo *__pyx_v_type) {
21411 __Pyx_StructField *__pyx_v_field;
21412 struct __pyx_typeinfo_string __pyx_v_fmt;
21413 PyObject *__pyx_v_part = 0;
21414 PyObject *__pyx_v_result = 0;
21415 PyObject *__pyx_v_alignment = NULL;
21416 PyObject *__pyx_v_parts = NULL;
21417 PyObject *__pyx_v_extents = NULL;
21419 PyObject *__pyx_r = NULL;
21420 __Pyx_RefNannyDeclarations
21422 PyObject *__pyx_t_2 = NULL;
21423 __Pyx_StructField *__pyx_t_3;
21424 PyObject *__pyx_t_4 = NULL;
21425 PyObject *__pyx_t_5 = NULL;
21430 int __pyx_lineno = 0;
21431 const char *__pyx_filename = NULL;
21432 int __pyx_clineno = 0;
21433 __Pyx_RefNannySetupContext(
"format_from_typeinfo", 0);
21442 __pyx_t_1 = ((__pyx_v_type->typegroup ==
'S') != 0);
21452 #ifndef CYTHON_WITHOUT_ASSERTIONS
21453 if (unlikely(!Py_OptimizeFlag)) {
21454 if (unlikely(!((__pyx_v_type->fields != NULL) != 0))) {
21455 PyErr_SetNone(PyExc_AssertionError);
21456 __PYX_ERR(2, 1469, __pyx_L1_error)
21468 #ifndef CYTHON_WITHOUT_ASSERTIONS
21469 if (unlikely(!Py_OptimizeFlag)) {
21470 if (unlikely(!((__pyx_v_type->fields->type != NULL) != 0))) {
21471 PyErr_SetNone(PyExc_AssertionError);
21472 __PYX_ERR(2, 1470, __pyx_L1_error)
21484 __pyx_t_1 = ((__pyx_v_type->flags & __PYX_BUF_FLAGS_PACKED_STRUCT) != 0);
21494 __Pyx_INCREF(__pyx_kp_b__22);
21495 __pyx_v_alignment = __pyx_kp_b__22;
21515 __Pyx_INCREF(__pyx_kp_b__23);
21516 __pyx_v_alignment = __pyx_kp_b__23;
21527 __pyx_t_2 = PyList_New(1);
if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 1477, __pyx_L1_error)
21528 __Pyx_GOTREF(__pyx_t_2);
21529 __Pyx_INCREF(__pyx_kp_b_T);
21530 __Pyx_GIVEREF(__pyx_kp_b_T);
21531 PyList_SET_ITEM(__pyx_t_2, 0, __pyx_kp_b_T);
21532 __pyx_v_parts = ((PyObject*)__pyx_t_2);
21542 __pyx_t_3 = __pyx_v_type->fields;
21543 __pyx_v_field = __pyx_t_3;
21553 __pyx_t_1 = (__pyx_v_field->type != 0);
21554 if (!__pyx_t_1)
break;
21563 __pyx_t_2 = __pyx_format_from_typeinfo(__pyx_v_field->type);
if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 1481, __pyx_L1_error)
21564 __Pyx_GOTREF(__pyx_t_2);
21565 __Pyx_XDECREF_SET(__pyx_v_part, ((PyObject*)__pyx_t_2));
21575 __pyx_t_2 = PyNumber_Add(__pyx_v_part, __pyx_kp_b__24);
if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 1482, __pyx_L1_error)
21576 __Pyx_GOTREF(__pyx_t_2);
21577 __pyx_t_4 = __Pyx_PyBytes_FromString(__pyx_v_field->name);
if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 1482, __pyx_L1_error)
21578 __Pyx_GOTREF(__pyx_t_4);
21579 __pyx_t_5 = PyNumber_Add(__pyx_t_2, __pyx_t_4);
if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 1482, __pyx_L1_error)
21580 __Pyx_GOTREF(__pyx_t_5);
21581 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
21582 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
21583 __pyx_t_4 = PyNumber_Add(__pyx_t_5, __pyx_kp_b__24);
if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 1482, __pyx_L1_error)
21584 __Pyx_GOTREF(__pyx_t_4);
21585 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
21586 __pyx_t_6 = __Pyx_PyList_Append(__pyx_v_parts, __pyx_t_4);
if (unlikely(__pyx_t_6 == ((
int)-1))) __PYX_ERR(2, 1482, __pyx_L1_error)
21587 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
21596 __pyx_v_field = (__pyx_v_field + 1);
21606 __pyx_t_4 = __Pyx_PyBytes_Join(__pyx_v_alignment, __pyx_v_parts);
if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 1485, __pyx_L1_error)
21607 __Pyx_GOTREF(__pyx_t_4);
21608 __pyx_t_5 = PyNumber_Add(__pyx_t_4, __pyx_kp_b__25);
if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 1485, __pyx_L1_error)
21609 __Pyx_GOTREF(__pyx_t_5);
21610 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
21611 if (!(likely(PyBytes_CheckExact(__pyx_t_5))||((__pyx_t_5) == Py_None)||(PyErr_Format(PyExc_TypeError,
"Expected %.16s, got %.200s",
"bytes", Py_TYPE(__pyx_t_5)->tp_name), 0))) __PYX_ERR(2, 1485, __pyx_L1_error)
21612 __pyx_v_result = ((PyObject*)__pyx_t_5);
21633 __pyx_v_fmt = __Pyx_TypeInfoToFormat(__pyx_v_type);
21642 __pyx_t_1 = ((__pyx_v_type->arraysize[0]) != 0);
21652 __pyx_t_5 = PyList_New(0);
if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 1489, __pyx_L1_error)
21653 __Pyx_GOTREF(__pyx_t_5);
21654 __pyx_t_7 = __pyx_v_type->ndim;
21655 __pyx_t_8 = __pyx_t_7;
21656 for (__pyx_t_9 = 0; __pyx_t_9 < __pyx_t_8; __pyx_t_9+=1) {
21657 __pyx_v_i = __pyx_t_9;
21658 __pyx_t_4 = __Pyx_PyInt_FromSize_t((__pyx_v_type->arraysize[__pyx_v_i]));
if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 1489, __pyx_L1_error)
21659 __Pyx_GOTREF(__pyx_t_4);
21660 __pyx_t_2 = __Pyx_PyObject_Unicode(__pyx_t_4);
if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 1489, __pyx_L1_error)
21661 __Pyx_GOTREF(__pyx_t_2);
21662 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
21663 if (unlikely(__Pyx_ListComp_Append(__pyx_t_5, (PyObject*)__pyx_t_2))) __PYX_ERR(2, 1489, __pyx_L1_error)
21664 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
21666 __pyx_v_extents = ((PyObject*)__pyx_t_5);
21676 __pyx_t_5 = PyUnicode_Join(__pyx_kp_u__26, __pyx_v_extents);
if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 1490, __pyx_L1_error)
21677 __Pyx_GOTREF(__pyx_t_5);
21678 __pyx_t_2 = PyUnicode_Format(__pyx_kp_u_s, __pyx_t_5);
if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 1490, __pyx_L1_error)
21679 __Pyx_GOTREF(__pyx_t_2);
21680 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
21681 __pyx_t_5 = PyUnicode_AsASCIIString(((PyObject*)__pyx_t_2));
if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 1490, __pyx_L1_error)
21682 __Pyx_GOTREF(__pyx_t_5);
21683 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
21684 __pyx_t_2 = __Pyx_PyObject_FromString(__pyx_v_fmt.string);
if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 1490, __pyx_L1_error)
21685 __Pyx_GOTREF(__pyx_t_2);
21686 __pyx_t_4 = PyNumber_Add(__pyx_t_5, __pyx_t_2);
if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 1490, __pyx_L1_error)
21687 __Pyx_GOTREF(__pyx_t_4);
21688 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
21689 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
21690 if (!(likely(PyBytes_CheckExact(__pyx_t_4))||(PyErr_Format(PyExc_TypeError,
"Expected %.16s, got %.200s",
"bytes", Py_TYPE(__pyx_t_4)->tp_name), 0))) __PYX_ERR(2, 1490, __pyx_L1_error)
21691 __pyx_v_result = ((PyObject*)__pyx_t_4);
21712 __pyx_t_4 = __Pyx_PyObject_FromString(__pyx_v_fmt.string);
if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 1492, __pyx_L1_error)
21713 __Pyx_GOTREF(__pyx_t_4);
21714 __pyx_v_result = ((PyObject*)__pyx_t_4);
21726 __Pyx_XDECREF(__pyx_r);
21727 __Pyx_INCREF(__pyx_v_result);
21728 __pyx_r = __pyx_v_result;
21741 __Pyx_XDECREF(__pyx_t_2);
21742 __Pyx_XDECREF(__pyx_t_4);
21743 __Pyx_XDECREF(__pyx_t_5);
21744 __Pyx_AddTraceback(
"BufferFormatFromTypeInfo.format_from_typeinfo", __pyx_clineno, __pyx_lineno, __pyx_filename);
21747 __Pyx_XDECREF(__pyx_v_part);
21748 __Pyx_XDECREF(__pyx_v_result);
21749 __Pyx_XDECREF(__pyx_v_alignment);
21750 __Pyx_XDECREF(__pyx_v_parts);
21751 __Pyx_XDECREF(__pyx_v_extents);
21752 __Pyx_XGIVEREF(__pyx_r);
21753 __Pyx_RefNannyFinishContext();
21756 static struct __pyx_vtabstruct_array __pyx_vtable_array;
21758 static PyObject *__pyx_tp_new_array(PyTypeObject *t, PyObject *a, PyObject *k) {
21759 struct __pyx_array_obj *p;
21761 if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) {
21762 o = (*t->tp_alloc)(t, 0);
21764 o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0);
21766 if (unlikely(!o))
return 0;
21767 p = ((
struct __pyx_array_obj *)o);
21768 p->__pyx_vtab = __pyx_vtabptr_array;
21769 p->mode = ((PyObject*)Py_None); Py_INCREF(Py_None);
21770 p->_format = ((PyObject*)Py_None); Py_INCREF(Py_None);
21771 if (unlikely(__pyx_array___cinit__(o, a, k) < 0))
goto bad;
21774 Py_DECREF(o); o = 0;
21778 static void __pyx_tp_dealloc_array(PyObject *o) {
21779 struct __pyx_array_obj *p = (
struct __pyx_array_obj *)o;
21780 #if CYTHON_USE_TP_FINALIZE
21781 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))) {
21782 if (PyObject_CallFinalizerFromDealloc(o))
return;
21786 PyObject *etype, *eval, *etb;
21787 PyErr_Fetch(&etype, &eval, &etb);
21788 __Pyx_SET_REFCNT(o, Py_REFCNT(o) + 1);
21789 __pyx_array___dealloc__(o);
21790 __Pyx_SET_REFCNT(o, Py_REFCNT(o) - 1);
21791 PyErr_Restore(etype, eval, etb);
21794 Py_CLEAR(p->_format);
21795 (*Py_TYPE(o)->tp_free)(o);
21797 static PyObject *__pyx_sq_item_array(PyObject *o, Py_ssize_t i) {
21799 PyObject *x = PyInt_FromSsize_t(i);
if(!x)
return 0;
21800 r = Py_TYPE(o)->tp_as_mapping->mp_subscript(o, x);
21805 static int __pyx_mp_ass_subscript_array(PyObject *o, PyObject *i, PyObject *
v) {
21807 return __pyx_array___setitem__(o, i,
v);
21810 PyErr_Format(PyExc_NotImplementedError,
21811 "Subscript deletion not supported by %.200s", Py_TYPE(o)->tp_name);
21816 static PyObject *__pyx_tp_getattro_array(PyObject *o, PyObject *
n) {
21817 PyObject *
v = __Pyx_PyObject_GenericGetAttr(o,
n);
21818 if (!
v && PyErr_ExceptionMatches(PyExc_AttributeError)) {
21820 v = __pyx_array___getattr__(o,
n);
21825 static PyObject *__pyx_getprop___pyx_array_memview(PyObject *o, CYTHON_UNUSED
void *x) {
21826 return __pyx_pw_15View_dot_MemoryView_5array_7memview_1__get__(o);
21829 static PyMethodDef __pyx_methods_array[] = {
21830 {
"__getattr__", (PyCFunction)__pyx_array___getattr__, METH_O|METH_COEXIST, 0},
21831 {
"__reduce_cython__", (PyCFunction)__pyx_pw___pyx_array_1__reduce_cython__, METH_NOARGS, 0},
21832 {
"__setstate_cython__", (PyCFunction)__pyx_pw___pyx_array_3__setstate_cython__, METH_O, 0},
21836 static struct PyGetSetDef __pyx_getsets_array[] = {
21837 {(
char *)
"memview", __pyx_getprop___pyx_array_memview, 0, (
char *)0, 0},
21841 static PySequenceMethods __pyx_tp_as_sequence_array = {
21842 __pyx_array___len__,
21845 __pyx_sq_item_array,
21854 static PyMappingMethods __pyx_tp_as_mapping_array = {
21855 __pyx_array___len__,
21856 __pyx_array___getitem__,
21857 __pyx_mp_ass_subscript_array,
21860 static PyBufferProcs __pyx_tp_as_buffer_array = {
21861 #if PY_MAJOR_VERSION < 3
21864 #if PY_MAJOR_VERSION < 3
21867 #if PY_MAJOR_VERSION < 3
21870 #if PY_MAJOR_VERSION < 3
21873 __pyx_array_getbuffer,
21877 static PyTypeObject __pyx_type___pyx_array = {
21878 PyVarObject_HEAD_INIT(0, 0)
21879 "cpartitioning.array",
21880 sizeof(
struct __pyx_array_obj),
21882 __pyx_tp_dealloc_array,
21883 #
if PY_VERSION_HEX < 0x030800b4
21886 #
if PY_VERSION_HEX >= 0x030800b4
21891 #
if PY_MAJOR_VERSION < 3
21894 #
if PY_MAJOR_VERSION >= 3
21899 &__pyx_tp_as_sequence_array,
21900 &__pyx_tp_as_mapping_array,
21904 __pyx_tp_getattro_array,
21906 &__pyx_tp_as_buffer_array,
21907 Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE,
21915 __pyx_methods_array,
21917 __pyx_getsets_array,
21925 __pyx_tp_new_array,
21935 #
if PY_VERSION_HEX >= 0x030400a1
21938 #
if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800)
21941 #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
21944 #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000
21949 static PyObject *__pyx_tp_new_Enum(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
21950 struct __pyx_MemviewEnum_obj *p;
21952 if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) {
21953 o = (*t->tp_alloc)(t, 0);
21955 o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0);
21957 if (unlikely(!o))
return 0;
21958 p = ((
struct __pyx_MemviewEnum_obj *)o);
21959 p->name = Py_None; Py_INCREF(Py_None);
21963 static void __pyx_tp_dealloc_Enum(PyObject *o) {
21964 struct __pyx_MemviewEnum_obj *p = (
struct __pyx_MemviewEnum_obj *)o;
21965 #if CYTHON_USE_TP_FINALIZE
21966 if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) {
21967 if (PyObject_CallFinalizerFromDealloc(o))
return;
21970 PyObject_GC_UnTrack(o);
21972 (*Py_TYPE(o)->tp_free)(o);
21975 static int __pyx_tp_traverse_Enum(PyObject *o, visitproc
v,
void *a) {
21977 struct __pyx_MemviewEnum_obj *p = (
struct __pyx_MemviewEnum_obj *)o;
21979 e = (*v)(p->name, a);
if (e)
return e;
21984 static int __pyx_tp_clear_Enum(PyObject *o) {
21986 struct __pyx_MemviewEnum_obj *p = (
struct __pyx_MemviewEnum_obj *)o;
21987 tmp = ((PyObject*)p->name);
21988 p->name = Py_None; Py_INCREF(Py_None);
21993 static PyMethodDef __pyx_methods_Enum[] = {
21994 {
"__reduce_cython__", (PyCFunction)__pyx_pw___pyx_MemviewEnum_1__reduce_cython__, METH_NOARGS, 0},
21995 {
"__setstate_cython__", (PyCFunction)__pyx_pw___pyx_MemviewEnum_3__setstate_cython__, METH_O, 0},
21999 static PyTypeObject __pyx_type___pyx_MemviewEnum = {
22000 PyVarObject_HEAD_INIT(0, 0)
22001 "cpartitioning.Enum",
22002 sizeof(
struct __pyx_MemviewEnum_obj),
22004 __pyx_tp_dealloc_Enum,
22005 #
if PY_VERSION_HEX < 0x030800b4
22008 #
if PY_VERSION_HEX >= 0x030800b4
22013 #
if PY_MAJOR_VERSION < 3
22016 #
if PY_MAJOR_VERSION >= 3
22019 __pyx_MemviewEnum___repr__,
22029 Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC,
22031 __pyx_tp_traverse_Enum,
22032 __pyx_tp_clear_Enum,
22037 __pyx_methods_Enum,
22045 __pyx_MemviewEnum___init__,
22057 #
if PY_VERSION_HEX >= 0x030400a1
22060 #
if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800)
22063 #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
22066 #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000
22070 static struct __pyx_vtabstruct_memoryview __pyx_vtable_memoryview;
22072 static PyObject *__pyx_tp_new_memoryview(PyTypeObject *t, PyObject *a, PyObject *k) {
22073 struct __pyx_memoryview_obj *p;
22075 if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) {
22076 o = (*t->tp_alloc)(t, 0);
22078 o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0);
22080 if (unlikely(!o))
return 0;
22081 p = ((
struct __pyx_memoryview_obj *)o);
22082 p->__pyx_vtab = __pyx_vtabptr_memoryview;
22083 p->obj = Py_None; Py_INCREF(Py_None);
22084 p->_size = Py_None; Py_INCREF(Py_None);
22085 p->_array_interface = Py_None; Py_INCREF(Py_None);
22086 p->view.obj = NULL;
22087 if (unlikely(__pyx_memoryview___cinit__(o, a, k) < 0))
goto bad;
22090 Py_DECREF(o); o = 0;
22094 static void __pyx_tp_dealloc_memoryview(PyObject *o) {
22095 struct __pyx_memoryview_obj *p = (
struct __pyx_memoryview_obj *)o;
22096 #if CYTHON_USE_TP_FINALIZE
22097 if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) {
22098 if (PyObject_CallFinalizerFromDealloc(o))
return;
22101 PyObject_GC_UnTrack(o);
22103 PyObject *etype, *eval, *etb;
22104 PyErr_Fetch(&etype, &eval, &etb);
22105 __Pyx_SET_REFCNT(o, Py_REFCNT(o) + 1);
22106 __pyx_memoryview___dealloc__(o);
22107 __Pyx_SET_REFCNT(o, Py_REFCNT(o) - 1);
22108 PyErr_Restore(etype, eval, etb);
22111 Py_CLEAR(p->_size);
22112 Py_CLEAR(p->_array_interface);
22113 (*Py_TYPE(o)->tp_free)(o);
22116 static int __pyx_tp_traverse_memoryview(PyObject *o, visitproc
v,
void *a) {
22118 struct __pyx_memoryview_obj *p = (
struct __pyx_memoryview_obj *)o;
22120 e = (*v)(p->obj, a);
if (e)
return e;
22123 e = (*v)(p->_size, a);
if (e)
return e;
22125 if (p->_array_interface) {
22126 e = (*v)(p->_array_interface, a);
if (e)
return e;
22129 e = (*v)(p->view.obj, a);
if (e)
return e;
22134 static int __pyx_tp_clear_memoryview(PyObject *o) {
22136 struct __pyx_memoryview_obj *p = (
struct __pyx_memoryview_obj *)o;
22137 tmp = ((PyObject*)p->obj);
22138 p->obj = Py_None; Py_INCREF(Py_None);
22140 tmp = ((PyObject*)p->_size);
22141 p->_size = Py_None; Py_INCREF(Py_None);
22143 tmp = ((PyObject*)p->_array_interface);
22144 p->_array_interface = Py_None; Py_INCREF(Py_None);
22146 Py_CLEAR(p->view.obj);
22149 static PyObject *__pyx_sq_item_memoryview(PyObject *o, Py_ssize_t i) {
22151 PyObject *x = PyInt_FromSsize_t(i);
if(!x)
return 0;
22152 r = Py_TYPE(o)->tp_as_mapping->mp_subscript(o, x);
22157 static int __pyx_mp_ass_subscript_memoryview(PyObject *o, PyObject *i, PyObject *
v) {
22159 return __pyx_memoryview___setitem__(o, i,
v);
22162 PyErr_Format(PyExc_NotImplementedError,
22163 "Subscript deletion not supported by %.200s", Py_TYPE(o)->tp_name);
22168 static PyObject *__pyx_getprop___pyx_memoryview_T(PyObject *o, CYTHON_UNUSED
void *x) {
22169 return __pyx_pw_15View_dot_MemoryView_10memoryview_1T_1__get__(o);
22172 static PyObject *__pyx_getprop___pyx_memoryview_base(PyObject *o, CYTHON_UNUSED
void *x) {
22173 return __pyx_pw_15View_dot_MemoryView_10memoryview_4base_1__get__(o);
22176 static PyObject *__pyx_getprop___pyx_memoryview_shape(PyObject *o, CYTHON_UNUSED
void *x) {
22177 return __pyx_pw_15View_dot_MemoryView_10memoryview_5shape_1__get__(o);
22180 static PyObject *__pyx_getprop___pyx_memoryview_strides(PyObject *o, CYTHON_UNUSED
void *x) {
22181 return __pyx_pw_15View_dot_MemoryView_10memoryview_7strides_1__get__(o);
22184 static PyObject *__pyx_getprop___pyx_memoryview_suboffsets(PyObject *o, CYTHON_UNUSED
void *x) {
22185 return __pyx_pw_15View_dot_MemoryView_10memoryview_10suboffsets_1__get__(o);
22188 static PyObject *__pyx_getprop___pyx_memoryview_ndim(PyObject *o, CYTHON_UNUSED
void *x) {
22189 return __pyx_pw_15View_dot_MemoryView_10memoryview_4ndim_1__get__(o);
22192 static PyObject *__pyx_getprop___pyx_memoryview_itemsize(PyObject *o, CYTHON_UNUSED
void *x) {
22193 return __pyx_pw_15View_dot_MemoryView_10memoryview_8itemsize_1__get__(o);
22196 static PyObject *__pyx_getprop___pyx_memoryview_nbytes(PyObject *o, CYTHON_UNUSED
void *x) {
22197 return __pyx_pw_15View_dot_MemoryView_10memoryview_6nbytes_1__get__(o);
22200 static PyObject *__pyx_getprop___pyx_memoryview_size(PyObject *o, CYTHON_UNUSED
void *x) {
22201 return __pyx_pw_15View_dot_MemoryView_10memoryview_4size_1__get__(o);
22204 static PyMethodDef __pyx_methods_memoryview[] = {
22205 {
"is_c_contig", (PyCFunction)__pyx_memoryview_is_c_contig, METH_NOARGS, 0},
22206 {
"is_f_contig", (PyCFunction)__pyx_memoryview_is_f_contig, METH_NOARGS, 0},
22207 {
"copy", (PyCFunction)__pyx_memoryview_copy, METH_NOARGS, 0},
22208 {
"copy_fortran", (PyCFunction)__pyx_memoryview_copy_fortran, METH_NOARGS, 0},
22209 {
"__reduce_cython__", (PyCFunction)__pyx_pw___pyx_memoryview_1__reduce_cython__, METH_NOARGS, 0},
22210 {
"__setstate_cython__", (PyCFunction)__pyx_pw___pyx_memoryview_3__setstate_cython__, METH_O, 0},
22214 static struct PyGetSetDef __pyx_getsets_memoryview[] = {
22215 {(
char *)
"T", __pyx_getprop___pyx_memoryview_T, 0, (
char *)0, 0},
22216 {(
char *)
"base", __pyx_getprop___pyx_memoryview_base, 0, (
char *)0, 0},
22217 {(
char *)
"shape", __pyx_getprop___pyx_memoryview_shape, 0, (
char *)0, 0},
22218 {(
char *)
"strides", __pyx_getprop___pyx_memoryview_strides, 0, (
char *)0, 0},
22219 {(
char *)
"suboffsets", __pyx_getprop___pyx_memoryview_suboffsets, 0, (
char *)0, 0},
22220 {(
char *)
"ndim", __pyx_getprop___pyx_memoryview_ndim, 0, (
char *)0, 0},
22221 {(
char *)
"itemsize", __pyx_getprop___pyx_memoryview_itemsize, 0, (
char *)0, 0},
22222 {(
char *)
"nbytes", __pyx_getprop___pyx_memoryview_nbytes, 0, (
char *)0, 0},
22223 {(
char *)
"size", __pyx_getprop___pyx_memoryview_size, 0, (
char *)0, 0},
22227 static PySequenceMethods __pyx_tp_as_sequence_memoryview = {
22228 __pyx_memoryview___len__,
22231 __pyx_sq_item_memoryview,
22240 static PyMappingMethods __pyx_tp_as_mapping_memoryview = {
22241 __pyx_memoryview___len__,
22242 __pyx_memoryview___getitem__,
22243 __pyx_mp_ass_subscript_memoryview,
22246 static PyBufferProcs __pyx_tp_as_buffer_memoryview = {
22247 #if PY_MAJOR_VERSION < 3
22250 #if PY_MAJOR_VERSION < 3
22253 #if PY_MAJOR_VERSION < 3
22256 #if PY_MAJOR_VERSION < 3
22259 __pyx_memoryview_getbuffer,
22263 static PyTypeObject __pyx_type___pyx_memoryview = {
22264 PyVarObject_HEAD_INIT(0, 0)
22265 "cpartitioning.memoryview",
22266 sizeof(
struct __pyx_memoryview_obj),
22268 __pyx_tp_dealloc_memoryview,
22269 #
if PY_VERSION_HEX < 0x030800b4
22272 #
if PY_VERSION_HEX >= 0x030800b4
22277 #
if PY_MAJOR_VERSION < 3
22280 #
if PY_MAJOR_VERSION >= 3
22283 __pyx_memoryview___repr__,
22285 &__pyx_tp_as_sequence_memoryview,
22286 &__pyx_tp_as_mapping_memoryview,
22289 __pyx_memoryview___str__,
22292 &__pyx_tp_as_buffer_memoryview,
22293 Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC,
22295 __pyx_tp_traverse_memoryview,
22296 __pyx_tp_clear_memoryview,
22301 __pyx_methods_memoryview,
22303 __pyx_getsets_memoryview,
22311 __pyx_tp_new_memoryview,
22321 #
if PY_VERSION_HEX >= 0x030400a1
22324 #
if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800)
22327 #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
22330 #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000
22334 static struct __pyx_vtabstruct__memoryviewslice __pyx_vtable__memoryviewslice;
22336 static PyObject *__pyx_tp_new__memoryviewslice(PyTypeObject *t, PyObject *a, PyObject *k) {
22337 struct __pyx_memoryviewslice_obj *p;
22338 PyObject *o = __pyx_tp_new_memoryview(t, a, k);
22339 if (unlikely(!o))
return 0;
22340 p = ((
struct __pyx_memoryviewslice_obj *)o);
22341 p->__pyx_base.__pyx_vtab = (
struct __pyx_vtabstruct_memoryview*)__pyx_vtabptr__memoryviewslice;
22342 p->from_object = Py_None; Py_INCREF(Py_None);
22343 p->from_slice.memview = NULL;
22347 static void __pyx_tp_dealloc__memoryviewslice(PyObject *o) {
22348 struct __pyx_memoryviewslice_obj *p = (
struct __pyx_memoryviewslice_obj *)o;
22349 #if CYTHON_USE_TP_FINALIZE
22350 if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) {
22351 if (PyObject_CallFinalizerFromDealloc(o))
return;
22354 PyObject_GC_UnTrack(o);
22356 PyObject *etype, *eval, *etb;
22357 PyErr_Fetch(&etype, &eval, &etb);
22358 __Pyx_SET_REFCNT(o, Py_REFCNT(o) + 1);
22359 __pyx_memoryviewslice___dealloc__(o);
22360 __Pyx_SET_REFCNT(o, Py_REFCNT(o) - 1);
22361 PyErr_Restore(etype, eval, etb);
22363 Py_CLEAR(p->from_object);
22364 PyObject_GC_Track(o);
22365 __pyx_tp_dealloc_memoryview(o);
22368 static int __pyx_tp_traverse__memoryviewslice(PyObject *o, visitproc
v,
void *a) {
22370 struct __pyx_memoryviewslice_obj *p = (
struct __pyx_memoryviewslice_obj *)o;
22371 e = __pyx_tp_traverse_memoryview(o,
v, a);
if (e)
return e;
22372 if (p->from_object) {
22373 e = (*v)(p->from_object, a);
if (e)
return e;
22378 static int __pyx_tp_clear__memoryviewslice(PyObject *o) {
22380 struct __pyx_memoryviewslice_obj *p = (
struct __pyx_memoryviewslice_obj *)o;
22381 __pyx_tp_clear_memoryview(o);
22382 tmp = ((PyObject*)p->from_object);
22383 p->from_object = Py_None; Py_INCREF(Py_None);
22385 __PYX_XDEC_MEMVIEW(&p->from_slice, 1);
22389 static PyObject *__pyx_getprop___pyx_memoryviewslice_base(PyObject *o, CYTHON_UNUSED
void *x) {
22390 return __pyx_pw_15View_dot_MemoryView_16_memoryviewslice_4base_1__get__(o);
22393 static PyMethodDef __pyx_methods__memoryviewslice[] = {
22394 {
"__reduce_cython__", (PyCFunction)__pyx_pw___pyx_memoryviewslice_1__reduce_cython__, METH_NOARGS, 0},
22395 {
"__setstate_cython__", (PyCFunction)__pyx_pw___pyx_memoryviewslice_3__setstate_cython__, METH_O, 0},
22399 static struct PyGetSetDef __pyx_getsets__memoryviewslice[] = {
22400 {(
char *)
"base", __pyx_getprop___pyx_memoryviewslice_base, 0, (
char *)0, 0},
22404 static PyTypeObject __pyx_type___pyx_memoryviewslice = {
22405 PyVarObject_HEAD_INIT(0, 0)
22406 "cpartitioning._memoryviewslice",
22407 sizeof(
struct __pyx_memoryviewslice_obj),
22409 __pyx_tp_dealloc__memoryviewslice,
22410 #
if PY_VERSION_HEX < 0x030800b4
22413 #
if PY_VERSION_HEX >= 0x030800b4
22418 #
if PY_MAJOR_VERSION < 3
22421 #
if PY_MAJOR_VERSION >= 3
22424 #
if CYTHON_COMPILING_IN_PYPY
22425 __pyx_memoryview___repr__,
22434 #
if CYTHON_COMPILING_IN_PYPY
22435 __pyx_memoryview___str__,
22442 Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC,
22443 "Internal class for passing memoryview slices to Python",
22444 __pyx_tp_traverse__memoryviewslice,
22445 __pyx_tp_clear__memoryviewslice,
22450 __pyx_methods__memoryviewslice,
22452 __pyx_getsets__memoryviewslice,
22460 __pyx_tp_new__memoryviewslice,
22470 #
if PY_VERSION_HEX >= 0x030400a1
22473 #
if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800)
22476 #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
22479 #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000
22484 static PyMethodDef __pyx_methods[] = {
22488 #if PY_MAJOR_VERSION >= 3
22489 #if CYTHON_PEP489_MULTI_PHASE_INIT
22490 static PyObject* __pyx_pymod_create(PyObject *spec, PyModuleDef *def);
22491 static int __pyx_pymod_exec_cpartitioning(PyObject* module);
22492 static PyModuleDef_Slot __pyx_moduledef_slots[] = {
22493 {Py_mod_create, (
void*)__pyx_pymod_create},
22494 {Py_mod_exec, (
void*)__pyx_pymod_exec_cpartitioning},
22499 static struct PyModuleDef __pyx_moduledef = {
22500 PyModuleDef_HEAD_INIT,
22503 #if CYTHON_PEP489_MULTI_PHASE_INIT
22509 #if CYTHON_PEP489_MULTI_PHASE_INIT
22510 __pyx_moduledef_slots,
22519 #ifndef CYTHON_SMALL_CODE
22520 #if defined(__clang__)
22521 #define CYTHON_SMALL_CODE
22522 #elif defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 3))
22523 #define CYTHON_SMALL_CODE __attribute__((cold))
22525 #define CYTHON_SMALL_CODE
22529 static __Pyx_StringTabEntry __pyx_string_tab[] = {
22530 {&__pyx_n_s_ASCII, __pyx_k_ASCII,
sizeof(__pyx_k_ASCII), 0, 0, 1, 1},
22531 {&__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},
22532 {&__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},
22533 {&__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},
22534 {&__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},
22535 {&__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},
22536 {&__pyx_n_s_Comm, __pyx_k_Comm,
sizeof(__pyx_k_Comm), 0, 0, 1, 1},
22537 {&__pyx_n_s_Ellipsis, __pyx_k_Ellipsis,
sizeof(__pyx_k_Ellipsis), 0, 0, 1, 1},
22538 {&__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},
22539 {&__pyx_n_s_ImportError, __pyx_k_ImportError,
sizeof(__pyx_k_ImportError), 0, 0, 1, 1},
22540 {&__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},
22541 {&__pyx_n_s_IndexError, __pyx_k_IndexError,
sizeof(__pyx_k_IndexError), 0, 0, 1, 1},
22542 {&__pyx_kp_s_Indirect_dimensions_not_supporte, __pyx_k_Indirect_dimensions_not_supporte,
sizeof(__pyx_k_Indirect_dimensions_not_supporte), 0, 0, 1, 0},
22543 {&__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},
22544 {&__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},
22545 {&__pyx_n_s_MemoryError, __pyx_k_MemoryError,
sizeof(__pyx_k_MemoryError), 0, 0, 1, 1},
22546 {&__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},
22547 {&__pyx_kp_s_MemoryView_of_r_object, __pyx_k_MemoryView_of_r_object,
sizeof(__pyx_k_MemoryView_of_r_object), 0, 0, 1, 0},
22548 {&__pyx_n_b_O, __pyx_k_O,
sizeof(__pyx_k_O), 0, 0, 0, 1},
22549 {&__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},
22550 {&__pyx_n_s_PickleError, __pyx_k_PickleError,
sizeof(__pyx_k_PickleError), 0, 0, 1, 1},
22551 {&__pyx_kp_b_T, __pyx_k_T,
sizeof(__pyx_k_T), 0, 0, 0, 0},
22552 {&__pyx_n_s_TypeError, __pyx_k_TypeError,
sizeof(__pyx_k_TypeError), 0, 0, 1, 1},
22553 {&__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},
22554 {&__pyx_n_s_ValueError, __pyx_k_ValueError,
sizeof(__pyx_k_ValueError), 0, 0, 1, 1},
22555 {&__pyx_n_s_View_MemoryView, __pyx_k_View_MemoryView,
sizeof(__pyx_k_View_MemoryView), 0, 0, 1, 1},
22556 {&__pyx_kp_b__22, __pyx_k__22,
sizeof(__pyx_k__22), 0, 0, 0, 0},
22557 {&__pyx_kp_b__23, __pyx_k__23,
sizeof(__pyx_k__23), 0, 0, 0, 0},
22558 {&__pyx_kp_b__24, __pyx_k__24,
sizeof(__pyx_k__24), 0, 0, 0, 0},
22559 {&__pyx_kp_b__25, __pyx_k__25,
sizeof(__pyx_k__25), 0, 0, 0, 0},
22560 {&__pyx_kp_u__26, __pyx_k__26,
sizeof(__pyx_k__26), 0, 1, 0, 0},
22561 {&__pyx_n_s_allocate_buffer, __pyx_k_allocate_buffer,
sizeof(__pyx_k_allocate_buffer), 0, 0, 1, 1},
22562 {&__pyx_n_s_asarray, __pyx_k_asarray,
sizeof(__pyx_k_asarray), 0, 0, 1, 1},
22563 {&__pyx_n_s_base, __pyx_k_base,
sizeof(__pyx_k_base), 0, 0, 1, 1},
22564 {&__pyx_n_s_buildDiscontinuousGalerkinLocal2, __pyx_k_buildDiscontinuousGalerkinLocal2,
sizeof(__pyx_k_buildDiscontinuousGalerkinLocal2), 0, 0, 1, 1},
22565 {&__pyx_n_s_buildQuadraticCubeLocal2GlobalMa, __pyx_k_buildQuadraticCubeLocal2GlobalMa,
sizeof(__pyx_k_buildQuadraticCubeLocal2GlobalMa), 0, 0, 1, 1},
22566 {&__pyx_kp_s_buildQuadraticCubeSubdomain2Glob, __pyx_k_buildQuadraticCubeSubdomain2Glob,
sizeof(__pyx_k_buildQuadraticCubeSubdomain2Glob), 0, 0, 1, 0},
22567 {&__pyx_kp_s_buildQuadraticCubeSubdomain2Glob_2, __pyx_k_buildQuadraticCubeSubdomain2Glob_2,
sizeof(__pyx_k_buildQuadraticCubeSubdomain2Glob_2), 0, 0, 1, 0},
22568 {&__pyx_n_s_buildQuadraticLocal2GlobalMappin, __pyx_k_buildQuadraticLocal2GlobalMappin,
sizeof(__pyx_k_buildQuadraticLocal2GlobalMappin), 0, 0, 1, 1},
22569 {&__pyx_n_s_c, __pyx_k_c,
sizeof(__pyx_k_c), 0, 0, 1, 1},
22570 {&__pyx_n_u_c, __pyx_k_c,
sizeof(__pyx_k_c), 0, 1, 0, 1},
22571 {&__pyx_n_s_class, __pyx_k_class,
sizeof(__pyx_k_class), 0, 0, 1, 1},
22572 {&__pyx_n_s_cline_in_traceback, __pyx_k_cline_in_traceback,
sizeof(__pyx_k_cline_in_traceback), 0, 0, 1, 1},
22573 {&__pyx_n_s_cmesh, __pyx_k_cmesh,
sizeof(__pyx_k_cmesh), 0, 0, 1, 1},
22574 {&__pyx_n_s_comm, __pyx_k_comm,
sizeof(__pyx_k_comm), 0, 0, 1, 1},
22575 {&__pyx_kp_s_contiguous_and_direct, __pyx_k_contiguous_and_direct,
sizeof(__pyx_k_contiguous_and_direct), 0, 0, 1, 0},
22576 {&__pyx_kp_s_contiguous_and_indirect, __pyx_k_contiguous_and_indirect,
sizeof(__pyx_k_contiguous_and_indirect), 0, 0, 1, 0},
22577 {&__pyx_n_s_convertPUMIPartitionToPython, __pyx_k_convertPUMIPartitionToPython,
sizeof(__pyx_k_convertPUMIPartitionToPython), 0, 0, 1, 1},
22578 {&__pyx_n_s_cpartitioning, __pyx_k_cpartitioning,
sizeof(__pyx_k_cpartitioning), 0, 0, 1, 1},
22579 {&__pyx_n_s_dgNumbering_subdomain2global, __pyx_k_dgNumbering_subdomain2global,
sizeof(__pyx_k_dgNumbering_subdomain2global), 0, 0, 1, 1},
22580 {&__pyx_n_s_dg_dof_offsets_subdomain_owned, __pyx_k_dg_dof_offsets_subdomain_owned,
sizeof(__pyx_k_dg_dof_offsets_subdomain_owned), 0, 0, 1, 1},
22581 {&__pyx_n_s_dg_subdomain_l2g, __pyx_k_dg_subdomain_l2g,
sizeof(__pyx_k_dg_subdomain_l2g), 0, 0, 1, 1},
22582 {&__pyx_n_s_dict, __pyx_k_dict,
sizeof(__pyx_k_dict), 0, 0, 1, 1},
22583 {&__pyx_n_s_dtype_is_object, __pyx_k_dtype_is_object,
sizeof(__pyx_k_dtype_is_object), 0, 0, 1, 1},
22584 {&__pyx_n_s_edgeNumbering_subdomain2global, __pyx_k_edgeNumbering_subdomain2global,
sizeof(__pyx_k_edgeNumbering_subdomain2global), 0, 0, 1, 1},
22585 {&__pyx_n_s_edgeOffsets_subdomain_owned, __pyx_k_edgeOffsets_subdomain_owned,
sizeof(__pyx_k_edgeOffsets_subdomain_owned), 0, 0, 1, 1},
22586 {&__pyx_n_s_elementBoundaryNumbering_subdoma, __pyx_k_elementBoundaryNumbering_subdoma,
sizeof(__pyx_k_elementBoundaryNumbering_subdoma), 0, 0, 1, 1},
22587 {&__pyx_n_s_elementBoundaryOffsets_subdomain, __pyx_k_elementBoundaryOffsets_subdomain,
sizeof(__pyx_k_elementBoundaryOffsets_subdomain), 0, 0, 1, 1},
22588 {&__pyx_n_s_elementNumbering_subdomain2globa, __pyx_k_elementNumbering_subdomain2globa,
sizeof(__pyx_k_elementNumbering_subdomain2globa), 0, 0, 1, 1},
22589 {&__pyx_n_s_elementOffsets_subdomain_owned, __pyx_k_elementOffsets_subdomain_owned,
sizeof(__pyx_k_elementOffsets_subdomain_owned), 0, 0, 1, 1},
22590 {&__pyx_n_s_encode, __pyx_k_encode,
sizeof(__pyx_k_encode), 0, 0, 1, 1},
22591 {&__pyx_n_s_enumerate, __pyx_k_enumerate,
sizeof(__pyx_k_enumerate), 0, 0, 1, 1},
22592 {&__pyx_n_s_error, __pyx_k_error,
sizeof(__pyx_k_error), 0, 0, 1, 1},
22593 {&__pyx_n_s_filebase, __pyx_k_filebase,
sizeof(__pyx_k_filebase), 0, 0, 1, 1},
22594 {&__pyx_n_s_flags, __pyx_k_flags,
sizeof(__pyx_k_flags), 0, 0, 1, 1},
22595 {&__pyx_n_s_format, __pyx_k_format,
sizeof(__pyx_k_format), 0, 0, 1, 1},
22596 {&__pyx_n_s_fortran, __pyx_k_fortran,
sizeof(__pyx_k_fortran), 0, 0, 1, 1},
22597 {&__pyx_n_u_fortran, __pyx_k_fortran,
sizeof(__pyx_k_fortran), 0, 1, 0, 1},
22598 {&__pyx_n_s_getstate, __pyx_k_getstate,
sizeof(__pyx_k_getstate), 0, 0, 1, 1},
22599 {&__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},
22600 {&__pyx_n_s_id, __pyx_k_id,
sizeof(__pyx_k_id), 0, 0, 1, 1},
22601 {&__pyx_n_s_import, __pyx_k_import,
sizeof(__pyx_k_import), 0, 0, 1, 1},
22602 {&__pyx_n_s_indexBase, __pyx_k_indexBase,
sizeof(__pyx_k_indexBase), 0, 0, 1, 1},
22603 {&__pyx_n_s_itemsize, __pyx_k_itemsize,
sizeof(__pyx_k_itemsize), 0, 0, 1, 1},
22604 {&__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},
22605 {&__pyx_n_s_join, __pyx_k_join,
sizeof(__pyx_k_join), 0, 0, 1, 1},
22606 {&__pyx_n_s_main, __pyx_k_main,
sizeof(__pyx_k_main), 0, 0, 1, 1},
22607 {&__pyx_n_s_max_dof_neighbors, __pyx_k_max_dof_neighbors,
sizeof(__pyx_k_max_dof_neighbors), 0, 0, 1, 1},
22608 {&__pyx_n_s_memview, __pyx_k_memview,
sizeof(__pyx_k_memview), 0, 0, 1, 1},
22609 {&__pyx_n_s_mode, __pyx_k_mode,
sizeof(__pyx_k_mode), 0, 0, 1, 1},
22610 {&__pyx_n_s_nDOF_all_processes, __pyx_k_nDOF_all_processes,
sizeof(__pyx_k_nDOF_all_processes), 0, 0, 1, 1},
22611 {&__pyx_n_s_nDOF_element, __pyx_k_nDOF_element,
sizeof(__pyx_k_nDOF_element), 0, 0, 1, 1},
22612 {&__pyx_n_s_nDOF_subdomain, __pyx_k_nDOF_subdomain,
sizeof(__pyx_k_nDOF_subdomain), 0, 0, 1, 1},
22613 {&__pyx_n_s_nLayersOfOverlap, __pyx_k_nLayersOfOverlap,
sizeof(__pyx_k_nLayersOfOverlap), 0, 0, 1, 1},
22614 {&__pyx_n_s_nSpace, __pyx_k_nSpace,
sizeof(__pyx_k_nSpace), 0, 0, 1, 1},
22615 {&__pyx_n_s_name, __pyx_k_name,
sizeof(__pyx_k_name), 0, 0, 1, 1},
22616 {&__pyx_n_s_name_2, __pyx_k_name_2,
sizeof(__pyx_k_name_2), 0, 0, 1, 1},
22617 {&__pyx_n_s_ndim, __pyx_k_ndim,
sizeof(__pyx_k_ndim), 0, 0, 1, 1},
22618 {&__pyx_n_s_new, __pyx_k_new,
sizeof(__pyx_k_new), 0, 0, 1, 1},
22619 {&__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},
22620 {&__pyx_n_s_nodeNumbering_subdomain2global, __pyx_k_nodeNumbering_subdomain2global,
sizeof(__pyx_k_nodeNumbering_subdomain2global), 0, 0, 1, 1},
22621 {&__pyx_n_s_nodeOffsets_subdomain_owned, __pyx_k_nodeOffsets_subdomain_owned,
sizeof(__pyx_k_nodeOffsets_subdomain_owned), 0, 0, 1, 1},
22622 {&__pyx_n_s_np, __pyx_k_np,
sizeof(__pyx_k_np), 0, 0, 1, 1},
22623 {&__pyx_n_s_numpy, __pyx_k_numpy,
sizeof(__pyx_k_numpy), 0, 0, 1, 1},
22624 {&__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},
22625 {&__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},
22626 {&__pyx_n_s_obj, __pyx_k_obj,
sizeof(__pyx_k_obj), 0, 0, 1, 1},
22627 {&__pyx_n_s_pack, __pyx_k_pack,
sizeof(__pyx_k_pack), 0, 0, 1, 1},
22628 {&__pyx_n_s_partitionElements, __pyx_k_partitionElements,
sizeof(__pyx_k_partitionElements), 0, 0, 1, 1},
22629 {&__pyx_n_s_partitionNodes, __pyx_k_partitionNodes,
sizeof(__pyx_k_partitionNodes), 0, 0, 1, 1},
22630 {&__pyx_n_s_partitionNodesFromTetgenFiles, __pyx_k_partitionNodesFromTetgenFiles,
sizeof(__pyx_k_partitionNodesFromTetgenFiles), 0, 0, 1, 1},
22631 {&__pyx_n_s_partitionNodesFromTriangleFiles, __pyx_k_partitionNodesFromTriangleFiles,
sizeof(__pyx_k_partitionNodesFromTriangleFiles), 0, 0, 1, 1},
22632 {&__pyx_n_s_pickle, __pyx_k_pickle,
sizeof(__pyx_k_pickle), 0, 0, 1, 1},
22633 {&__pyx_n_s_proteus, __pyx_k_proteus,
sizeof(__pyx_k_proteus), 0, 0, 1, 1},
22634 {&__pyx_n_s_proteus_Comm, __pyx_k_proteus_Comm,
sizeof(__pyx_k_proteus_Comm), 0, 0, 1, 1},
22635 {&__pyx_kp_s_proteus_cpartitioning_pyx, __pyx_k_proteus_cpartitioning_pyx,
sizeof(__pyx_k_proteus_cpartitioning_pyx), 0, 0, 1, 0},
22636 {&__pyx_n_s_pyx_PickleError, __pyx_k_pyx_PickleError,
sizeof(__pyx_k_pyx_PickleError), 0, 0, 1, 1},
22637 {&__pyx_n_s_pyx_checksum, __pyx_k_pyx_checksum,
sizeof(__pyx_k_pyx_checksum), 0, 0, 1, 1},
22638 {&__pyx_n_s_pyx_getbuffer, __pyx_k_pyx_getbuffer,
sizeof(__pyx_k_pyx_getbuffer), 0, 0, 1, 1},
22639 {&__pyx_n_s_pyx_result, __pyx_k_pyx_result,
sizeof(__pyx_k_pyx_result), 0, 0, 1, 1},
22640 {&__pyx_n_s_pyx_state, __pyx_k_pyx_state,
sizeof(__pyx_k_pyx_state), 0, 0, 1, 1},
22641 {&__pyx_n_s_pyx_type, __pyx_k_pyx_type,
sizeof(__pyx_k_pyx_type), 0, 0, 1, 1},
22642 {&__pyx_n_s_pyx_unpickle_Enum, __pyx_k_pyx_unpickle_Enum,
sizeof(__pyx_k_pyx_unpickle_Enum), 0, 0, 1, 1},
22643 {&__pyx_n_s_pyx_vtable, __pyx_k_pyx_vtable,
sizeof(__pyx_k_pyx_vtable), 0, 0, 1, 1},
22644 {&__pyx_n_s_quadraticNumbering_subdomain2glo, __pyx_k_quadraticNumbering_subdomain2glo,
sizeof(__pyx_k_quadraticNumbering_subdomain2glo), 0, 0, 1, 1},
22645 {&__pyx_n_s_quadratic_dof_offsets_subdomain, __pyx_k_quadratic_dof_offsets_subdomain,
sizeof(__pyx_k_quadratic_dof_offsets_subdomain), 0, 0, 1, 1},
22646 {&__pyx_n_s_quadratic_lagrangeNodes, __pyx_k_quadratic_lagrangeNodes,
sizeof(__pyx_k_quadratic_lagrangeNodes), 0, 0, 1, 1},
22647 {&__pyx_n_s_quadratic_subdomain_l2g, __pyx_k_quadratic_subdomain_l2g,
sizeof(__pyx_k_quadratic_subdomain_l2g), 0, 0, 1, 1},
22648 {&__pyx_n_s_range, __pyx_k_range,
sizeof(__pyx_k_range), 0, 0, 1, 1},
22649 {&__pyx_n_s_reduce, __pyx_k_reduce,
sizeof(__pyx_k_reduce), 0, 0, 1, 1},
22650 {&__pyx_n_s_reduce_cython, __pyx_k_reduce_cython,
sizeof(__pyx_k_reduce_cython), 0, 0, 1, 1},
22651 {&__pyx_n_s_reduce_ex, __pyx_k_reduce_ex,
sizeof(__pyx_k_reduce_ex), 0, 0, 1, 1},
22652 {&__pyx_kp_u_s, __pyx_k_s,
sizeof(__pyx_k_s), 0, 1, 0, 0},
22653 {&__pyx_n_s_setstate, __pyx_k_setstate,
sizeof(__pyx_k_setstate), 0, 0, 1, 1},
22654 {&__pyx_n_s_setstate_cython, __pyx_k_setstate_cython,
sizeof(__pyx_k_setstate_cython), 0, 0, 1, 1},
22655 {&__pyx_n_s_shape, __pyx_k_shape,
sizeof(__pyx_k_shape), 0, 0, 1, 1},
22656 {&__pyx_n_s_size, __pyx_k_size,
sizeof(__pyx_k_size), 0, 0, 1, 1},
22657 {&__pyx_n_s_start, __pyx_k_start,
sizeof(__pyx_k_start), 0, 0, 1, 1},
22658 {&__pyx_n_s_step, __pyx_k_step,
sizeof(__pyx_k_step), 0, 0, 1, 1},
22659 {&__pyx_n_s_stop, __pyx_k_stop,
sizeof(__pyx_k_stop), 0, 0, 1, 1},
22660 {&__pyx_kp_s_strided_and_direct, __pyx_k_strided_and_direct,
sizeof(__pyx_k_strided_and_direct), 0, 0, 1, 0},
22661 {&__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},
22662 {&__pyx_kp_s_strided_and_indirect, __pyx_k_strided_and_indirect,
sizeof(__pyx_k_strided_and_indirect), 0, 0, 1, 0},
22663 {&__pyx_kp_s_stringsource, __pyx_k_stringsource,
sizeof(__pyx_k_stringsource), 0, 0, 1, 0},
22664 {&__pyx_n_s_struct, __pyx_k_struct,
sizeof(__pyx_k_struct), 0, 0, 1, 1},
22665 {&__pyx_n_s_subdomain_cmesh, __pyx_k_subdomain_cmesh,
sizeof(__pyx_k_subdomain_cmesh), 0, 0, 1, 1},
22666 {&__pyx_n_s_test, __pyx_k_test,
sizeof(__pyx_k_test), 0, 0, 1, 1},
22667 {&__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},
22668 {&__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},
22669 {&__pyx_n_s_unpack, __pyx_k_unpack,
sizeof(__pyx_k_unpack), 0, 0, 1, 1},
22670 {&__pyx_n_s_update, __pyx_k_update,
sizeof(__pyx_k_update), 0, 0, 1, 1},
22671 {0, 0, 0, 0, 0, 0, 0}
22673 static CYTHON_SMALL_CODE
int __Pyx_InitCachedBuiltins(
void) {
22674 __pyx_builtin_ImportError = __Pyx_GetBuiltinName(__pyx_n_s_ImportError);
if (!__pyx_builtin_ImportError) __PYX_ERR(1, 945, __pyx_L1_error)
22675 __pyx_builtin_ValueError = __Pyx_GetBuiltinName(__pyx_n_s_ValueError);
if (!__pyx_builtin_ValueError) __PYX_ERR(2, 133, __pyx_L1_error)
22676 __pyx_builtin_MemoryError = __Pyx_GetBuiltinName(__pyx_n_s_MemoryError);
if (!__pyx_builtin_MemoryError) __PYX_ERR(2, 148, __pyx_L1_error)
22677 __pyx_builtin_enumerate = __Pyx_GetBuiltinName(__pyx_n_s_enumerate);
if (!__pyx_builtin_enumerate) __PYX_ERR(2, 151, __pyx_L1_error)
22678 __pyx_builtin_range = __Pyx_GetBuiltinName(__pyx_n_s_range);
if (!__pyx_builtin_range) __PYX_ERR(2, 180, __pyx_L1_error)
22679 __pyx_builtin_TypeError = __Pyx_GetBuiltinName(__pyx_n_s_TypeError);
if (!__pyx_builtin_TypeError) __PYX_ERR(2, 2, __pyx_L1_error)
22680 __pyx_builtin_Ellipsis = __Pyx_GetBuiltinName(__pyx_n_s_Ellipsis);
if (!__pyx_builtin_Ellipsis) __PYX_ERR(2, 404, __pyx_L1_error)
22681 __pyx_builtin_id = __Pyx_GetBuiltinName(__pyx_n_s_id);
if (!__pyx_builtin_id) __PYX_ERR(2, 613, __pyx_L1_error)
22682 __pyx_builtin_IndexError = __Pyx_GetBuiltinName(__pyx_n_s_IndexError);
if (!__pyx_builtin_IndexError) __PYX_ERR(2, 832, __pyx_L1_error)
22688 static CYTHON_SMALL_CODE
int __Pyx_InitCachedConstants(
void) {
22689 __Pyx_RefNannyDeclarations
22690 __Pyx_RefNannySetupContext(
"__Pyx_InitCachedConstants", 0);
22699 __pyx_tuple_ = PyTuple_Pack(1, __pyx_kp_s_numpy_core_multiarray_failed_to);
if (unlikely(!__pyx_tuple_)) __PYX_ERR(1, 945, __pyx_L1_error)
22700 __Pyx_GOTREF(__pyx_tuple_);
22701 __Pyx_GIVEREF(__pyx_tuple_);
22710 __pyx_tuple__2 = PyTuple_Pack(1, __pyx_kp_s_numpy_core_umath_failed_to_impor);
if (unlikely(!__pyx_tuple__2)) __PYX_ERR(1, 951, __pyx_L1_error)
22711 __Pyx_GOTREF(__pyx_tuple__2);
22712 __Pyx_GIVEREF(__pyx_tuple__2);
22721 __pyx_tuple__3 = PyTuple_Pack(1, __pyx_kp_s_Empty_shape_tuple_for_cython_arr);
if (unlikely(!__pyx_tuple__3)) __PYX_ERR(2, 133, __pyx_L1_error)
22722 __Pyx_GOTREF(__pyx_tuple__3);
22723 __Pyx_GIVEREF(__pyx_tuple__3);
22732 __pyx_tuple__4 = PyTuple_Pack(1, __pyx_kp_s_itemsize_0_for_cython_array);
if (unlikely(!__pyx_tuple__4)) __PYX_ERR(2, 136, __pyx_L1_error)
22733 __Pyx_GOTREF(__pyx_tuple__4);
22734 __Pyx_GIVEREF(__pyx_tuple__4);
22743 __pyx_tuple__5 = PyTuple_Pack(1, __pyx_kp_s_unable_to_allocate_shape_and_str);
if (unlikely(!__pyx_tuple__5)) __PYX_ERR(2, 148, __pyx_L1_error)
22744 __Pyx_GOTREF(__pyx_tuple__5);
22745 __Pyx_GIVEREF(__pyx_tuple__5);
22754 __pyx_tuple__6 = PyTuple_Pack(1, __pyx_kp_s_unable_to_allocate_array_data);
if (unlikely(!__pyx_tuple__6)) __PYX_ERR(2, 176, __pyx_L1_error)
22755 __Pyx_GOTREF(__pyx_tuple__6);
22756 __Pyx_GIVEREF(__pyx_tuple__6);
22765 __pyx_tuple__7 = PyTuple_Pack(1, __pyx_kp_s_Can_only_create_a_buffer_that_is);
if (unlikely(!__pyx_tuple__7)) __PYX_ERR(2, 192, __pyx_L1_error)
22766 __Pyx_GOTREF(__pyx_tuple__7);
22767 __Pyx_GIVEREF(__pyx_tuple__7);
22775 __pyx_tuple__8 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non);
if (unlikely(!__pyx_tuple__8)) __PYX_ERR(2, 2, __pyx_L1_error)
22776 __Pyx_GOTREF(__pyx_tuple__8);
22777 __Pyx_GIVEREF(__pyx_tuple__8);
22784 __pyx_tuple__9 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non);
if (unlikely(!__pyx_tuple__9)) __PYX_ERR(2, 4, __pyx_L1_error)
22785 __Pyx_GOTREF(__pyx_tuple__9);
22786 __Pyx_GIVEREF(__pyx_tuple__9);
22795 __pyx_tuple__10 = PyTuple_Pack(1, __pyx_kp_s_Cannot_assign_to_read_only_memor);
if (unlikely(!__pyx_tuple__10)) __PYX_ERR(2, 418, __pyx_L1_error)
22796 __Pyx_GOTREF(__pyx_tuple__10);
22797 __Pyx_GIVEREF(__pyx_tuple__10);
22806 __pyx_tuple__11 = PyTuple_Pack(1, __pyx_kp_s_Unable_to_convert_item_to_object);
if (unlikely(!__pyx_tuple__11)) __PYX_ERR(2, 495, __pyx_L1_error)
22807 __Pyx_GOTREF(__pyx_tuple__11);
22808 __Pyx_GIVEREF(__pyx_tuple__11);
22817 __pyx_tuple__12 = PyTuple_Pack(1, __pyx_kp_s_Cannot_create_writable_memory_vi);
if (unlikely(!__pyx_tuple__12)) __PYX_ERR(2, 520, __pyx_L1_error)
22818 __Pyx_GOTREF(__pyx_tuple__12);
22819 __Pyx_GIVEREF(__pyx_tuple__12);
22828 __pyx_tuple__13 = PyTuple_Pack(1, __pyx_kp_s_Buffer_view_does_not_expose_stri);
if (unlikely(!__pyx_tuple__13)) __PYX_ERR(2, 570, __pyx_L1_error)
22829 __Pyx_GOTREF(__pyx_tuple__13);
22830 __Pyx_GIVEREF(__pyx_tuple__13);
22839 __pyx_tuple__14 = PyTuple_New(1);
if (unlikely(!__pyx_tuple__14)) __PYX_ERR(2, 577, __pyx_L1_error)
22840 __Pyx_GOTREF(__pyx_tuple__14);
22841 __Pyx_INCREF(__pyx_int_neg_1);
22842 __Pyx_GIVEREF(__pyx_int_neg_1);
22843 PyTuple_SET_ITEM(__pyx_tuple__14, 0, __pyx_int_neg_1);
22844 __Pyx_GIVEREF(__pyx_tuple__14);
22852 __pyx_tuple__15 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non);
if (unlikely(!__pyx_tuple__15)) __PYX_ERR(2, 2, __pyx_L1_error)
22853 __Pyx_GOTREF(__pyx_tuple__15);
22854 __Pyx_GIVEREF(__pyx_tuple__15);
22861 __pyx_tuple__16 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non);
if (unlikely(!__pyx_tuple__16)) __PYX_ERR(2, 4, __pyx_L1_error)
22862 __Pyx_GOTREF(__pyx_tuple__16);
22863 __Pyx_GIVEREF(__pyx_tuple__16);
22872 __pyx_slice__17 = PySlice_New(Py_None, Py_None, Py_None);
if (unlikely(!__pyx_slice__17)) __PYX_ERR(2, 682, __pyx_L1_error)
22873 __Pyx_GOTREF(__pyx_slice__17);
22874 __Pyx_GIVEREF(__pyx_slice__17);
22883 __pyx_tuple__18 = PyTuple_Pack(1, __pyx_kp_s_Indirect_dimensions_not_supporte);
if (unlikely(!__pyx_tuple__18)) __PYX_ERR(2, 703, __pyx_L1_error)
22884 __Pyx_GOTREF(__pyx_tuple__18);
22885 __Pyx_GIVEREF(__pyx_tuple__18);
22893 __pyx_tuple__19 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non);
if (unlikely(!__pyx_tuple__19)) __PYX_ERR(2, 2, __pyx_L1_error)
22894 __Pyx_GOTREF(__pyx_tuple__19);
22895 __Pyx_GIVEREF(__pyx_tuple__19);
22902 __pyx_tuple__20 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non);
if (unlikely(!__pyx_tuple__20)) __PYX_ERR(2, 4, __pyx_L1_error)
22903 __Pyx_GOTREF(__pyx_tuple__20);
22904 __Pyx_GIVEREF(__pyx_tuple__20);
22905 __pyx_tuple__21 = PyTuple_Pack(3, __pyx_int_184977713, __pyx_int_136983863, __pyx_int_112105877);
if (unlikely(!__pyx_tuple__21)) __PYX_ERR(2, 4, __pyx_L1_error)
22906 __Pyx_GOTREF(__pyx_tuple__21);
22907 __Pyx_GIVEREF(__pyx_tuple__21);
22916 __pyx_tuple__27 = PyTuple_Pack(4, __pyx_n_s_comm, __pyx_n_s_nLayersOfOverlap, __pyx_n_s_cmesh, __pyx_n_s_subdomain_cmesh);
if (unlikely(!__pyx_tuple__27)) __PYX_ERR(0, 20, __pyx_L1_error)
22917 __Pyx_GOTREF(__pyx_tuple__27);
22918 __Pyx_GIVEREF(__pyx_tuple__27);
22919 __pyx_codeobj__28 = (PyObject*)__Pyx_PyCode_New(4, 0, 4, 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_cpartitioning_pyx, __pyx_n_s_partitionElements, 20, __pyx_empty_bytes);
if (unlikely(!__pyx_codeobj__28)) __PYX_ERR(0, 20, __pyx_L1_error)
22928 __pyx_tuple__29 = PyTuple_Pack(4, __pyx_n_s_comm, __pyx_n_s_nLayersOfOverlap, __pyx_n_s_cmesh, __pyx_n_s_subdomain_cmesh);
if (unlikely(!__pyx_tuple__29)) __PYX_ERR(0, 36, __pyx_L1_error)
22929 __Pyx_GOTREF(__pyx_tuple__29);
22930 __Pyx_GIVEREF(__pyx_tuple__29);
22931 __pyx_codeobj__30 = (PyObject*)__Pyx_PyCode_New(4, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__29, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_proteus_cpartitioning_pyx, __pyx_n_s_partitionNodes, 36, __pyx_empty_bytes);
if (unlikely(!__pyx_codeobj__30)) __PYX_ERR(0, 36, __pyx_L1_error)
22940 __pyx_tuple__31 = PyTuple_Pack(3, __pyx_n_s_comm, __pyx_n_s_cmesh, __pyx_n_s_subdomain_cmesh);
if (unlikely(!__pyx_tuple__31)) __PYX_ERR(0, 52, __pyx_L1_error)
22941 __Pyx_GOTREF(__pyx_tuple__31);
22942 __Pyx_GIVEREF(__pyx_tuple__31);
22943 __pyx_codeobj__32 = (PyObject*)__Pyx_PyCode_New(3, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__31, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_proteus_cpartitioning_pyx, __pyx_n_s_convertPUMIPartitionToPython, 52, __pyx_empty_bytes);
if (unlikely(!__pyx_codeobj__32)) __PYX_ERR(0, 52, __pyx_L1_error)
22952 __pyx_tuple__33 = PyTuple_Pack(6, __pyx_n_s_comm, __pyx_n_s_filebase, __pyx_n_s_indexBase, __pyx_n_s_nLayersOfOverlap, __pyx_n_s_cmesh, __pyx_n_s_subdomain_cmesh);
if (unlikely(!__pyx_tuple__33)) __PYX_ERR(0, 66, __pyx_L1_error)
22953 __Pyx_GOTREF(__pyx_tuple__33);
22954 __Pyx_GIVEREF(__pyx_tuple__33);
22955 __pyx_codeobj__34 = (PyObject*)__Pyx_PyCode_New(6, 0, 6, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__33, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_proteus_cpartitioning_pyx, __pyx_n_s_partitionNodesFromTetgenFiles, 66, __pyx_empty_bytes);
if (unlikely(!__pyx_codeobj__34)) __PYX_ERR(0, 66, __pyx_L1_error)
22964 __pyx_tuple__35 = PyTuple_Pack(6, __pyx_n_s_comm, __pyx_n_s_filebase, __pyx_n_s_indexBase, __pyx_n_s_nLayersOfOverlap, __pyx_n_s_cmesh, __pyx_n_s_subdomain_cmesh);
if (unlikely(!__pyx_tuple__35)) __PYX_ERR(0, 86, __pyx_L1_error)
22965 __Pyx_GOTREF(__pyx_tuple__35);
22966 __Pyx_GIVEREF(__pyx_tuple__35);
22967 __pyx_codeobj__36 = (PyObject*)__Pyx_PyCode_New(6, 0, 6, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__35, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_proteus_cpartitioning_pyx, __pyx_n_s_partitionNodesFromTriangleFiles, 86, __pyx_empty_bytes);
if (unlikely(!__pyx_codeobj__36)) __PYX_ERR(0, 86, __pyx_L1_error)
22976 __pyx_tuple__37 = PyTuple_Pack(19, __pyx_n_s_comm, __pyx_n_s_nSpace, __pyx_n_s_cmesh, __pyx_n_s_subdomain_cmesh, __pyx_n_s_elementOffsets_subdomain_owned, __pyx_n_s_nodeOffsets_subdomain_owned, __pyx_n_s_elementBoundaryOffsets_subdomain, __pyx_n_s_edgeOffsets_subdomain_owned, __pyx_n_s_elementNumbering_subdomain2globa, __pyx_n_s_nodeNumbering_subdomain2global, __pyx_n_s_elementBoundaryNumbering_subdoma, __pyx_n_s_edgeNumbering_subdomain2global, __pyx_n_s_quadratic_dof_offsets_subdomain, __pyx_n_s_quadratic_subdomain_l2g, __pyx_n_s_quadraticNumbering_subdomain2glo, __pyx_n_s_quadratic_lagrangeNodes, __pyx_n_s_nDOF_all_processes, __pyx_n_s_nDOF_subdomain, __pyx_n_s_max_dof_neighbors);
if (unlikely(!__pyx_tuple__37)) __PYX_ERR(0, 106, __pyx_L1_error)
22977 __Pyx_GOTREF(__pyx_tuple__37);
22978 __Pyx_GIVEREF(__pyx_tuple__37);
22979 __pyx_codeobj__38 = (PyObject*)__Pyx_PyCode_New(16, 0, 19, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__37, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_proteus_cpartitioning_pyx, __pyx_n_s_buildQuadraticLocal2GlobalMappin, 106, __pyx_empty_bytes);
if (unlikely(!__pyx_codeobj__38)) __PYX_ERR(0, 106, __pyx_L1_error)
22988 __pyx_tuple__39 = PyTuple_Pack(19, __pyx_n_s_comm, __pyx_n_s_nSpace, __pyx_n_s_cmesh, __pyx_n_s_subdomain_cmesh, __pyx_n_s_elementOffsets_subdomain_owned, __pyx_n_s_nodeOffsets_subdomain_owned, __pyx_n_s_elementBoundaryOffsets_subdomain, __pyx_n_s_edgeOffsets_subdomain_owned, __pyx_n_s_elementNumbering_subdomain2globa, __pyx_n_s_nodeNumbering_subdomain2global, __pyx_n_s_elementBoundaryNumbering_subdoma, __pyx_n_s_edgeNumbering_subdomain2global, __pyx_n_s_quadratic_dof_offsets_subdomain, __pyx_n_s_quadratic_subdomain_l2g, __pyx_n_s_quadraticNumbering_subdomain2glo, __pyx_n_s_quadratic_lagrangeNodes, __pyx_n_s_nDOF_all_processes, __pyx_n_s_nDOF_subdomain, __pyx_n_s_max_dof_neighbors);
if (unlikely(!__pyx_tuple__39)) __PYX_ERR(0, 171, __pyx_L1_error)
22989 __Pyx_GOTREF(__pyx_tuple__39);
22990 __Pyx_GIVEREF(__pyx_tuple__39);
22991 __pyx_codeobj__40 = (PyObject*)__Pyx_PyCode_New(16, 0, 19, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__39, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_proteus_cpartitioning_pyx, __pyx_n_s_buildQuadraticCubeLocal2GlobalMa, 171, __pyx_empty_bytes);
if (unlikely(!__pyx_codeobj__40)) __PYX_ERR(0, 171, __pyx_L1_error)
23000 __pyx_tuple__41 = PyTuple_Pack(12, __pyx_n_s_comm, __pyx_n_s_nDOF_element, __pyx_n_s_cmesh, __pyx_n_s_subdomain_cmesh, __pyx_n_s_elementOffsets_subdomain_owned, __pyx_n_s_elementNumbering_subdomain2globa, __pyx_n_s_dg_dof_offsets_subdomain_owned, __pyx_n_s_dg_subdomain_l2g, __pyx_n_s_dgNumbering_subdomain2global, __pyx_n_s_nDOF_all_processes, __pyx_n_s_nDOF_subdomain, __pyx_n_s_max_dof_neighbors);
if (unlikely(!__pyx_tuple__41)) __PYX_ERR(0, 212, __pyx_L1_error)
23001 __Pyx_GOTREF(__pyx_tuple__41);
23002 __Pyx_GIVEREF(__pyx_tuple__41);
23003 __pyx_codeobj__42 = (PyObject*)__Pyx_PyCode_New(9, 0, 12, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__41, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_proteus_cpartitioning_pyx, __pyx_n_s_buildDiscontinuousGalerkinLocal2, 212, __pyx_empty_bytes);
if (unlikely(!__pyx_codeobj__42)) __PYX_ERR(0, 212, __pyx_L1_error)
23012 __pyx_tuple__43 = PyTuple_Pack(1, __pyx_kp_s_strided_and_direct_or_indirect);
if (unlikely(!__pyx_tuple__43)) __PYX_ERR(2, 286, __pyx_L1_error)
23013 __Pyx_GOTREF(__pyx_tuple__43);
23014 __Pyx_GIVEREF(__pyx_tuple__43);
23023 __pyx_tuple__44 = PyTuple_Pack(1, __pyx_kp_s_strided_and_direct);
if (unlikely(!__pyx_tuple__44)) __PYX_ERR(2, 287, __pyx_L1_error)
23024 __Pyx_GOTREF(__pyx_tuple__44);
23025 __Pyx_GIVEREF(__pyx_tuple__44);
23034 __pyx_tuple__45 = PyTuple_Pack(1, __pyx_kp_s_strided_and_indirect);
if (unlikely(!__pyx_tuple__45)) __PYX_ERR(2, 288, __pyx_L1_error)
23035 __Pyx_GOTREF(__pyx_tuple__45);
23036 __Pyx_GIVEREF(__pyx_tuple__45);
23045 __pyx_tuple__46 = PyTuple_Pack(1, __pyx_kp_s_contiguous_and_direct);
if (unlikely(!__pyx_tuple__46)) __PYX_ERR(2, 291, __pyx_L1_error)
23046 __Pyx_GOTREF(__pyx_tuple__46);
23047 __Pyx_GIVEREF(__pyx_tuple__46);
23056 __pyx_tuple__47 = PyTuple_Pack(1, __pyx_kp_s_contiguous_and_indirect);
if (unlikely(!__pyx_tuple__47)) __PYX_ERR(2, 292, __pyx_L1_error)
23057 __Pyx_GOTREF(__pyx_tuple__47);
23058 __Pyx_GIVEREF(__pyx_tuple__47);
23065 __pyx_tuple__48 = 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__48)) __PYX_ERR(2, 1, __pyx_L1_error)
23066 __Pyx_GOTREF(__pyx_tuple__48);
23067 __Pyx_GIVEREF(__pyx_tuple__48);
23068 __pyx_codeobj__49 = (PyObject*)__Pyx_PyCode_New(3, 0, 5, 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_stringsource, __pyx_n_s_pyx_unpickle_Enum, 1, __pyx_empty_bytes);
if (unlikely(!__pyx_codeobj__49)) __PYX_ERR(2, 1, __pyx_L1_error)
23069 __Pyx_RefNannyFinishContext();
23072 __Pyx_RefNannyFinishContext();
23076 static CYTHON_SMALL_CODE
int __Pyx_InitGlobals(
void) {
23077 if (__Pyx_InitStrings(__pyx_string_tab) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
23078 __pyx_int_0 = PyInt_FromLong(0);
if (unlikely(!__pyx_int_0)) __PYX_ERR(0, 1, __pyx_L1_error)
23079 __pyx_int_1 = PyInt_FromLong(1);
if (unlikely(!__pyx_int_1)) __PYX_ERR(0, 1, __pyx_L1_error)
23080 __pyx_int_112105877 = PyInt_FromLong(112105877
L);
if (unlikely(!__pyx_int_112105877)) __PYX_ERR(0, 1, __pyx_L1_error)
23081 __pyx_int_136983863 = PyInt_FromLong(136983863
L);
if (unlikely(!__pyx_int_136983863)) __PYX_ERR(0, 1, __pyx_L1_error)
23082 __pyx_int_184977713 = PyInt_FromLong(184977713
L);
if (unlikely(!__pyx_int_184977713)) __PYX_ERR(0, 1, __pyx_L1_error)
23083 __pyx_int_neg_1 = PyInt_FromLong(-1);
if (unlikely(!__pyx_int_neg_1)) __PYX_ERR(0, 1, __pyx_L1_error)
23089 static CYTHON_SMALL_CODE
int __Pyx_modinit_global_init_code(
void);
23090 static CYTHON_SMALL_CODE
int __Pyx_modinit_variable_export_code(
void);
23091 static CYTHON_SMALL_CODE
int __Pyx_modinit_function_export_code(
void);
23092 static CYTHON_SMALL_CODE
int __Pyx_modinit_type_init_code(
void);
23093 static CYTHON_SMALL_CODE
int __Pyx_modinit_type_import_code(
void);
23094 static CYTHON_SMALL_CODE
int __Pyx_modinit_variable_import_code(
void);
23095 static CYTHON_SMALL_CODE
int __Pyx_modinit_function_import_code(
void);
23097 static int __Pyx_modinit_global_init_code(
void) {
23098 __Pyx_RefNannyDeclarations
23099 __Pyx_RefNannySetupContext(
"__Pyx_modinit_global_init_code", 0);
23101 generic = Py_None; Py_INCREF(Py_None);
23102 strided = Py_None; Py_INCREF(Py_None);
23103 indirect = Py_None; Py_INCREF(Py_None);
23104 contiguous = Py_None; Py_INCREF(Py_None);
23105 indirect_contiguous = Py_None; Py_INCREF(Py_None);
23106 __Pyx_RefNannyFinishContext();
23110 static int __Pyx_modinit_variable_export_code(
void) {
23111 __Pyx_RefNannyDeclarations
23112 __Pyx_RefNannySetupContext(
"__Pyx_modinit_variable_export_code", 0);
23114 __Pyx_RefNannyFinishContext();
23118 static int __Pyx_modinit_function_export_code(
void) {
23119 __Pyx_RefNannyDeclarations
23120 __Pyx_RefNannySetupContext(
"__Pyx_modinit_function_export_code", 0);
23122 __Pyx_RefNannyFinishContext();
23126 static int __Pyx_modinit_type_init_code(
void) {
23127 __Pyx_RefNannyDeclarations
23128 int __pyx_lineno = 0;
23129 const char *__pyx_filename = NULL;
23130 int __pyx_clineno = 0;
23131 __Pyx_RefNannySetupContext(
"__Pyx_modinit_type_init_code", 0);
23133 __pyx_vtabptr_array = &__pyx_vtable_array;
23134 __pyx_vtable_array.get_memview = (PyObject *(*)(
struct __pyx_array_obj *))__pyx_array_get_memview;
23135 if (PyType_Ready(&__pyx_type___pyx_array) < 0) __PYX_ERR(2, 105, __pyx_L1_error)
23136 #if PY_VERSION_HEX < 0x030800B1
23137 __pyx_type___pyx_array.tp_print = 0;
23139 if (__Pyx_SetVtable(__pyx_type___pyx_array.tp_dict, __pyx_vtabptr_array) < 0) __PYX_ERR(2, 105, __pyx_L1_error)
23140 if (__Pyx_setup_reduce((PyObject*)&__pyx_type___pyx_array) < 0) __PYX_ERR(2, 105, __pyx_L1_error)
23141 __pyx_array_type = &__pyx_type___pyx_array;
23142 if (PyType_Ready(&__pyx_type___pyx_MemviewEnum) < 0) __PYX_ERR(2, 279, __pyx_L1_error)
23143 #if PY_VERSION_HEX < 0x030800B1
23144 __pyx_type___pyx_MemviewEnum.tp_print = 0;
23146 if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type___pyx_MemviewEnum.tp_dictoffset && __pyx_type___pyx_MemviewEnum.tp_getattro == PyObject_GenericGetAttr)) {
23147 __pyx_type___pyx_MemviewEnum.tp_getattro = __Pyx_PyObject_GenericGetAttr;
23149 if (__Pyx_setup_reduce((PyObject*)&__pyx_type___pyx_MemviewEnum) < 0) __PYX_ERR(2, 279, __pyx_L1_error)
23150 __pyx_MemviewEnum_type = &__pyx_type___pyx_MemviewEnum;
23151 __pyx_vtabptr_memoryview = &__pyx_vtable_memoryview;
23152 __pyx_vtable_memoryview.get_item_pointer = (
char *(*)(
struct __pyx_memoryview_obj *, PyObject *))__pyx_memoryview_get_item_pointer;
23153 __pyx_vtable_memoryview.is_slice = (PyObject *(*)(
struct __pyx_memoryview_obj *, PyObject *))__pyx_memoryview_is_slice;
23154 __pyx_vtable_memoryview.setitem_slice_assignment = (PyObject *(*)(
struct __pyx_memoryview_obj *, PyObject *, PyObject *))__pyx_memoryview_setitem_slice_assignment;
23155 __pyx_vtable_memoryview.setitem_slice_assign_scalar = (PyObject *(*)(
struct __pyx_memoryview_obj *,
struct __pyx_memoryview_obj *, PyObject *))__pyx_memoryview_setitem_slice_assign_scalar;
23156 __pyx_vtable_memoryview.setitem_indexed = (PyObject *(*)(
struct __pyx_memoryview_obj *, PyObject *, PyObject *))__pyx_memoryview_setitem_indexed;
23157 __pyx_vtable_memoryview.convert_item_to_object = (PyObject *(*)(
struct __pyx_memoryview_obj *,
char *))__pyx_memoryview_convert_item_to_object;
23158 __pyx_vtable_memoryview.assign_item_from_object = (PyObject *(*)(
struct __pyx_memoryview_obj *,
char *, PyObject *))__pyx_memoryview_assign_item_from_object;
23159 if (PyType_Ready(&__pyx_type___pyx_memoryview) < 0) __PYX_ERR(2, 330, __pyx_L1_error)
23160 #if PY_VERSION_HEX < 0x030800B1
23161 __pyx_type___pyx_memoryview.tp_print = 0;
23163 if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type___pyx_memoryview.tp_dictoffset && __pyx_type___pyx_memoryview.tp_getattro == PyObject_GenericGetAttr)) {
23164 __pyx_type___pyx_memoryview.tp_getattro = __Pyx_PyObject_GenericGetAttr;
23166 if (__Pyx_SetVtable(__pyx_type___pyx_memoryview.tp_dict, __pyx_vtabptr_memoryview) < 0) __PYX_ERR(2, 330, __pyx_L1_error)
23167 if (__Pyx_setup_reduce((PyObject*)&__pyx_type___pyx_memoryview) < 0) __PYX_ERR(2, 330, __pyx_L1_error)
23168 __pyx_memoryview_type = &__pyx_type___pyx_memoryview;
23169 __pyx_vtabptr__memoryviewslice = &__pyx_vtable__memoryviewslice;
23170 __pyx_vtable__memoryviewslice.__pyx_base = *__pyx_vtabptr_memoryview;
23171 __pyx_vtable__memoryviewslice.__pyx_base.convert_item_to_object = (PyObject *(*)(
struct __pyx_memoryview_obj *,
char *))__pyx_memoryviewslice_convert_item_to_object;
23172 __pyx_vtable__memoryviewslice.__pyx_base.assign_item_from_object = (PyObject *(*)(
struct __pyx_memoryview_obj *,
char *, PyObject *))__pyx_memoryviewslice_assign_item_from_object;
23173 __pyx_type___pyx_memoryviewslice.tp_base = __pyx_memoryview_type;
23174 if (PyType_Ready(&__pyx_type___pyx_memoryviewslice) < 0) __PYX_ERR(2, 965, __pyx_L1_error)
23175 #if PY_VERSION_HEX < 0x030800B1
23176 __pyx_type___pyx_memoryviewslice.tp_print = 0;
23178 if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type___pyx_memoryviewslice.tp_dictoffset && __pyx_type___pyx_memoryviewslice.tp_getattro == PyObject_GenericGetAttr)) {
23179 __pyx_type___pyx_memoryviewslice.tp_getattro = __Pyx_PyObject_GenericGetAttr;
23181 if (__Pyx_SetVtable(__pyx_type___pyx_memoryviewslice.tp_dict, __pyx_vtabptr__memoryviewslice) < 0) __PYX_ERR(2, 965, __pyx_L1_error)
23182 if (__Pyx_setup_reduce((PyObject*)&__pyx_type___pyx_memoryviewslice) < 0) __PYX_ERR(2, 965, __pyx_L1_error)
23183 __pyx_memoryviewslice_type = &__pyx_type___pyx_memoryviewslice;
23184 __Pyx_RefNannyFinishContext();
23187 __Pyx_RefNannyFinishContext();
23191 static int __Pyx_modinit_type_import_code(
void) {
23192 __Pyx_RefNannyDeclarations
23193 PyObject *__pyx_t_1 = NULL;
23194 int __pyx_lineno = 0;
23195 const char *__pyx_filename = NULL;
23196 int __pyx_clineno = 0;
23197 __Pyx_RefNannySetupContext(
"__Pyx_modinit_type_import_code", 0);
23199 __pyx_t_1 = PyImport_ImportModule(__Pyx_BUILTIN_MODULE_NAME);
if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 9, __pyx_L1_error)
23200 __Pyx_GOTREF(__pyx_t_1);
23201 __pyx_ptype_7cpython_4type_type = __Pyx_ImportType(__pyx_t_1, __Pyx_BUILTIN_MODULE_NAME,
"type",
23202 #
if defined(PYPY_VERSION_NUM) && PYPY_VERSION_NUM < 0x050B0000
23203 sizeof(PyTypeObject),
23205 sizeof(PyHeapTypeObject),
23207 __Pyx_ImportType_CheckSize_Warn);
23208 if (!__pyx_ptype_7cpython_4type_type) __PYX_ERR(3, 9, __pyx_L1_error)
23209 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
23210 __pyx_t_1 = PyImport_ImportModule(
"numpy");
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 200, __pyx_L1_error)
23211 __Pyx_GOTREF(__pyx_t_1);
23212 __pyx_ptype_5numpy_dtype = __Pyx_ImportType(__pyx_t_1,
"numpy",
"dtype",
sizeof(PyArray_Descr), __Pyx_ImportType_CheckSize_Ignore);
23213 if (!__pyx_ptype_5numpy_dtype) __PYX_ERR(1, 200, __pyx_L1_error)
23214 __pyx_ptype_5numpy_flatiter = __Pyx_ImportType(__pyx_t_1,
"numpy",
"flatiter",
sizeof(PyArrayIterObject), __Pyx_ImportType_CheckSize_Ignore);
23215 if (!__pyx_ptype_5numpy_flatiter) __PYX_ERR(1, 223, __pyx_L1_error)
23216 __pyx_ptype_5numpy_broadcast = __Pyx_ImportType(__pyx_t_1,
"numpy",
"broadcast",
sizeof(PyArrayMultiIterObject), __Pyx_ImportType_CheckSize_Ignore);
23217 if (!__pyx_ptype_5numpy_broadcast) __PYX_ERR(1, 227, __pyx_L1_error)
23218 __pyx_ptype_5numpy_ndarray = __Pyx_ImportType(__pyx_t_1,
"numpy",
"ndarray",
sizeof(PyArrayObject), __Pyx_ImportType_CheckSize_Ignore);
23219 if (!__pyx_ptype_5numpy_ndarray) __PYX_ERR(1, 239, __pyx_L1_error)
23220 __pyx_ptype_5numpy_generic = __Pyx_ImportType(__pyx_t_1,
"numpy",
"generic",
sizeof(PyObject), __Pyx_ImportType_CheckSize_Warn);
23221 if (!__pyx_ptype_5numpy_generic) __PYX_ERR(1, 771, __pyx_L1_error)
23222 __pyx_ptype_5numpy_number = __Pyx_ImportType(__pyx_t_1,
"numpy",
"number",
sizeof(PyObject), __Pyx_ImportType_CheckSize_Warn);
23223 if (!__pyx_ptype_5numpy_number) __PYX_ERR(1, 773, __pyx_L1_error)
23224 __pyx_ptype_5numpy_integer = __Pyx_ImportType(__pyx_t_1,
"numpy",
"integer",
sizeof(PyObject), __Pyx_ImportType_CheckSize_Warn);
23225 if (!__pyx_ptype_5numpy_integer) __PYX_ERR(1, 775, __pyx_L1_error)
23226 __pyx_ptype_5numpy_signedinteger = __Pyx_ImportType(__pyx_t_1,
"numpy",
"signedinteger",
sizeof(PyObject), __Pyx_ImportType_CheckSize_Warn);
23227 if (!__pyx_ptype_5numpy_signedinteger) __PYX_ERR(1, 777, __pyx_L1_error)
23228 __pyx_ptype_5numpy_unsignedinteger = __Pyx_ImportType(__pyx_t_1,
"numpy",
"unsignedinteger",
sizeof(PyObject), __Pyx_ImportType_CheckSize_Warn);
23229 if (!__pyx_ptype_5numpy_unsignedinteger) __PYX_ERR(1, 779, __pyx_L1_error)
23230 __pyx_ptype_5numpy_inexact = __Pyx_ImportType(__pyx_t_1,
"numpy",
"inexact",
sizeof(PyObject), __Pyx_ImportType_CheckSize_Warn);
23231 if (!__pyx_ptype_5numpy_inexact) __PYX_ERR(1, 781, __pyx_L1_error)
23232 __pyx_ptype_5numpy_floating = __Pyx_ImportType(__pyx_t_1,
"numpy",
"floating",
sizeof(PyObject), __Pyx_ImportType_CheckSize_Warn);
23233 if (!__pyx_ptype_5numpy_floating) __PYX_ERR(1, 783, __pyx_L1_error)
23234 __pyx_ptype_5numpy_complexfloating = __Pyx_ImportType(__pyx_t_1,
"numpy",
"complexfloating",
sizeof(PyObject), __Pyx_ImportType_CheckSize_Warn);
23235 if (!__pyx_ptype_5numpy_complexfloating) __PYX_ERR(1, 785, __pyx_L1_error)
23236 __pyx_ptype_5numpy_flexible = __Pyx_ImportType(__pyx_t_1,
"numpy",
"flexible",
sizeof(PyObject), __Pyx_ImportType_CheckSize_Warn);
23237 if (!__pyx_ptype_5numpy_flexible) __PYX_ERR(1, 787, __pyx_L1_error)
23238 __pyx_ptype_5numpy_character = __Pyx_ImportType(__pyx_t_1,
"numpy",
"character",
sizeof(PyObject), __Pyx_ImportType_CheckSize_Warn);
23239 if (!__pyx_ptype_5numpy_character) __PYX_ERR(1, 789, __pyx_L1_error)
23240 __pyx_ptype_5numpy_ufunc = __Pyx_ImportType(__pyx_t_1,
"numpy",
"ufunc",
sizeof(PyUFuncObject), __Pyx_ImportType_CheckSize_Ignore);
23241 if (!__pyx_ptype_5numpy_ufunc) __PYX_ERR(1, 827, __pyx_L1_error)
23242 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
23243 __pyx_t_1 = PyImport_ImportModule(
"mpi4py.MPI");
if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 28, __pyx_L1_error)
23244 __Pyx_GOTREF(__pyx_t_1);
23245 __pyx_ptype_6mpi4py_3MPI_Datatype = __Pyx_ImportType(__pyx_t_1,
"mpi4py.MPI",
"Datatype",
sizeof(
struct PyMPIDatatypeObject), __Pyx_ImportType_CheckSize_Warn);
23246 if (!__pyx_ptype_6mpi4py_3MPI_Datatype) __PYX_ERR(4, 28, __pyx_L1_error)
23247 __pyx_ptype_6mpi4py_3MPI_Status = __Pyx_ImportType(__pyx_t_1,
"mpi4py.MPI",
"Status",
sizeof(
struct PyMPIStatusObject), __Pyx_ImportType_CheckSize_Warn);
23248 if (!__pyx_ptype_6mpi4py_3MPI_Status) __PYX_ERR(4, 36, __pyx_L1_error)
23249 __pyx_ptype_6mpi4py_3MPI_Request = __Pyx_ImportType(__pyx_t_1,
"mpi4py.MPI",
"Request",
sizeof(
struct PyMPIRequestObject), __Pyx_ImportType_CheckSize_Warn);
23250 if (!__pyx_ptype_6mpi4py_3MPI_Request) __PYX_ERR(4, 44, __pyx_L1_error)
23251 __pyx_ptype_6mpi4py_3MPI_Prequest = __Pyx_ImportType(__pyx_t_1,
"mpi4py.MPI",
"Prequest",
sizeof(
struct PyMPIPrequestObject), __Pyx_ImportType_CheckSize_Warn);
23252 if (!__pyx_ptype_6mpi4py_3MPI_Prequest) __PYX_ERR(4, 53, __pyx_L1_error)
23253 __pyx_ptype_6mpi4py_3MPI_Grequest = __Pyx_ImportType(__pyx_t_1,
"mpi4py.MPI",
"Grequest",
sizeof(
struct PyMPIGrequestObject), __Pyx_ImportType_CheckSize_Warn);
23254 if (!__pyx_ptype_6mpi4py_3MPI_Grequest) __PYX_ERR(4, 59, __pyx_L1_error)
23255 __pyx_ptype_6mpi4py_3MPI_Message = __Pyx_ImportType(__pyx_t_1,
"mpi4py.MPI",
"Message",
sizeof(
struct PyMPIMessageObject), __Pyx_ImportType_CheckSize_Warn);
23256 if (!__pyx_ptype_6mpi4py_3MPI_Message) __PYX_ERR(4, 65, __pyx_L1_error)
23257 __pyx_ptype_6mpi4py_3MPI_Op = __Pyx_ImportType(__pyx_t_1,
"mpi4py.MPI",
"Op",
sizeof(
struct PyMPIOpObject), __Pyx_ImportType_CheckSize_Warn);
23258 if (!__pyx_ptype_6mpi4py_3MPI_Op) __PYX_ERR(4, 74, __pyx_L1_error)
23259 __pyx_ptype_6mpi4py_3MPI_Group = __Pyx_ImportType(__pyx_t_1,
"mpi4py.MPI",
"Group",
sizeof(
struct PyMPIGroupObject), __Pyx_ImportType_CheckSize_Warn);
23260 if (!__pyx_ptype_6mpi4py_3MPI_Group) __PYX_ERR(4, 84, __pyx_L1_error)
23261 __pyx_ptype_6mpi4py_3MPI_Info = __Pyx_ImportType(__pyx_t_1,
"mpi4py.MPI",
"Info",
sizeof(
struct PyMPIInfoObject), __Pyx_ImportType_CheckSize_Warn);
23262 if (!__pyx_ptype_6mpi4py_3MPI_Info) __PYX_ERR(4, 92, __pyx_L1_error)
23263 __pyx_ptype_6mpi4py_3MPI_Errhandler = __Pyx_ImportType(__pyx_t_1,
"mpi4py.MPI",
"Errhandler",
sizeof(
struct PyMPIErrhandlerObject), __Pyx_ImportType_CheckSize_Warn);
23264 if (!__pyx_ptype_6mpi4py_3MPI_Errhandler) __PYX_ERR(4, 100, __pyx_L1_error)
23265 __pyx_ptype_6mpi4py_3MPI_Comm = __Pyx_ImportType(__pyx_t_1,
"mpi4py.MPI",
"Comm",
sizeof(
struct PyMPICommObject), __Pyx_ImportType_CheckSize_Warn);
23266 if (!__pyx_ptype_6mpi4py_3MPI_Comm) __PYX_ERR(4, 108, __pyx_L1_error)
23267 __pyx_ptype_6mpi4py_3MPI_Intracomm = __Pyx_ImportType(__pyx_t_1,
"mpi4py.MPI",
"Intracomm",
sizeof(
struct PyMPIIntracommObject), __Pyx_ImportType_CheckSize_Warn);
23268 if (!__pyx_ptype_6mpi4py_3MPI_Intracomm) __PYX_ERR(4, 116, __pyx_L1_error)
23269 __pyx_ptype_6mpi4py_3MPI_Topocomm = __Pyx_ImportType(__pyx_t_1,
"mpi4py.MPI",
"Topocomm",
sizeof(
struct PyMPITopocommObject), __Pyx_ImportType_CheckSize_Warn);
23270 if (!__pyx_ptype_6mpi4py_3MPI_Topocomm) __PYX_ERR(4, 122, __pyx_L1_error)
23271 __pyx_ptype_6mpi4py_3MPI_Cartcomm = __Pyx_ImportType(__pyx_t_1,
"mpi4py.MPI",
"Cartcomm",
sizeof(
struct PyMPICartcommObject), __Pyx_ImportType_CheckSize_Warn);
23272 if (!__pyx_ptype_6mpi4py_3MPI_Cartcomm) __PYX_ERR(4, 128, __pyx_L1_error)
23273 __pyx_ptype_6mpi4py_3MPI_Graphcomm = __Pyx_ImportType(__pyx_t_1,
"mpi4py.MPI",
"Graphcomm",
sizeof(
struct PyMPIGraphcommObject), __Pyx_ImportType_CheckSize_Warn);
23274 if (!__pyx_ptype_6mpi4py_3MPI_Graphcomm) __PYX_ERR(4, 134, __pyx_L1_error)
23275 __pyx_ptype_6mpi4py_3MPI_Distgraphcomm = __Pyx_ImportType(__pyx_t_1,
"mpi4py.MPI",
"Distgraphcomm",
sizeof(
struct PyMPIDistgraphcommObject), __Pyx_ImportType_CheckSize_Warn);
23276 if (!__pyx_ptype_6mpi4py_3MPI_Distgraphcomm) __PYX_ERR(4, 140, __pyx_L1_error)
23277 __pyx_ptype_6mpi4py_3MPI_Intercomm = __Pyx_ImportType(__pyx_t_1,
"mpi4py.MPI",
"Intercomm",
sizeof(
struct PyMPIIntercommObject), __Pyx_ImportType_CheckSize_Warn);
23278 if (!__pyx_ptype_6mpi4py_3MPI_Intercomm) __PYX_ERR(4, 146, __pyx_L1_error)
23279 __pyx_ptype_6mpi4py_3MPI_Win = __Pyx_ImportType(__pyx_t_1,
"mpi4py.MPI",
"Win",
sizeof(
struct PyMPIWinObject), __Pyx_ImportType_CheckSize_Warn);
23280 if (!__pyx_ptype_6mpi4py_3MPI_Win) __PYX_ERR(4, 152, __pyx_L1_error)
23281 __pyx_ptype_6mpi4py_3MPI_File = __Pyx_ImportType(__pyx_t_1,
"mpi4py.MPI",
"File",
sizeof(
struct PyMPIFileObject), __Pyx_ImportType_CheckSize_Warn);
23282 if (!__pyx_ptype_6mpi4py_3MPI_File) __PYX_ERR(4, 161, __pyx_L1_error)
23283 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
23284 __pyx_t_1 = PyImport_ImportModule(
"proteus.cmeshTools");
if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 5, __pyx_L1_error)
23285 __Pyx_GOTREF(__pyx_t_1);
23286 __pyx_ptype_7proteus_10cmeshTools_CMesh = __Pyx_ImportType(__pyx_t_1,
"proteus.cmeshTools",
"CMesh",
sizeof(
struct __pyx_obj_7proteus_10cmeshTools_CMesh), __Pyx_ImportType_CheckSize_Warn);
23287 if (!__pyx_ptype_7proteus_10cmeshTools_CMesh) __PYX_ERR(5, 5, __pyx_L1_error)
23288 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
23289 __Pyx_RefNannyFinishContext();
23292 __Pyx_XDECREF(__pyx_t_1);
23293 __Pyx_RefNannyFinishContext();
23297 static int __Pyx_modinit_variable_import_code(
void) {
23298 __Pyx_RefNannyDeclarations
23299 __Pyx_RefNannySetupContext(
"__Pyx_modinit_variable_import_code", 0);
23301 __Pyx_RefNannyFinishContext();
23305 static int __Pyx_modinit_function_import_code(
void) {
23306 __Pyx_RefNannyDeclarations
23307 __Pyx_RefNannySetupContext(
"__Pyx_modinit_function_import_code", 0);
23309 __Pyx_RefNannyFinishContext();
23314 #ifndef CYTHON_NO_PYINIT_EXPORT
23315 #define __Pyx_PyMODINIT_FUNC PyMODINIT_FUNC
23316 #elif PY_MAJOR_VERSION < 3
23318 #define __Pyx_PyMODINIT_FUNC extern "C" void
23320 #define __Pyx_PyMODINIT_FUNC void
23324 #define __Pyx_PyMODINIT_FUNC extern "C" PyObject *
23326 #define __Pyx_PyMODINIT_FUNC PyObject *
23331 #if PY_MAJOR_VERSION < 3
23332 __Pyx_PyMODINIT_FUNC initcpartitioning(
void) CYTHON_SMALL_CODE;
23333 __Pyx_PyMODINIT_FUNC initcpartitioning(
void)
23335 __Pyx_PyMODINIT_FUNC PyInit_cpartitioning(
void) CYTHON_SMALL_CODE;
23336 __Pyx_PyMODINIT_FUNC PyInit_cpartitioning(
void)
23337 #if CYTHON_PEP489_MULTI_PHASE_INIT
23339 return PyModuleDef_Init(&__pyx_moduledef);
23341 static CYTHON_SMALL_CODE
int __Pyx_check_single_interpreter(
void) {
23342 #if PY_VERSION_HEX >= 0x030700A1
23343 static PY_INT64_T main_interpreter_id = -1;
23344 PY_INT64_T current_id = PyInterpreterState_GetID(PyThreadState_Get()->interp);
23345 if (main_interpreter_id == -1) {
23346 main_interpreter_id = current_id;
23347 return (unlikely(current_id == -1)) ? -1 : 0;
23348 }
else if (unlikely(main_interpreter_id != current_id))
23350 static PyInterpreterState *main_interpreter = NULL;
23351 PyInterpreterState *current_interpreter = PyThreadState_Get()->interp;
23352 if (!main_interpreter) {
23353 main_interpreter = current_interpreter;
23354 }
else if (unlikely(main_interpreter != current_interpreter))
23359 "Interpreter change detected - this module can only be loaded into one interpreter per process.");
23364 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) {
23365 PyObject *value = PyObject_GetAttrString(spec, from_name);
23367 if (likely(value)) {
23368 if (allow_none || value != Py_None) {
23369 result = PyDict_SetItemString(moddict, to_name, value);
23372 }
else if (PyErr_ExceptionMatches(PyExc_AttributeError)) {
23379 static CYTHON_SMALL_CODE PyObject* __pyx_pymod_create(PyObject *spec, CYTHON_UNUSED PyModuleDef *def) {
23380 PyObject *module = NULL, *moddict, *modname;
23381 if (__Pyx_check_single_interpreter())
23384 return __Pyx_NewRef(__pyx_m);
23385 modname = PyObject_GetAttrString(spec,
"name");
23386 if (unlikely(!modname))
goto bad;
23387 module = PyModule_NewObject(modname);
23388 Py_DECREF(modname);
23389 if (unlikely(!module))
goto bad;
23390 moddict = PyModule_GetDict(module);
23391 if (unlikely(!moddict))
goto bad;
23392 if (unlikely(__Pyx_copy_spec_to_module(spec, moddict,
"loader",
"__loader__", 1) < 0))
goto bad;
23393 if (unlikely(__Pyx_copy_spec_to_module(spec, moddict,
"origin",
"__file__", 1) < 0))
goto bad;
23394 if (unlikely(__Pyx_copy_spec_to_module(spec, moddict,
"parent",
"__package__", 1) < 0))
goto bad;
23395 if (unlikely(__Pyx_copy_spec_to_module(spec, moddict,
"submodule_search_locations",
"__path__", 0) < 0))
goto bad;
23398 Py_XDECREF(module);
23403 static CYTHON_SMALL_CODE
int __pyx_pymod_exec_cpartitioning(PyObject *__pyx_pyinit_module)
23407 PyObject *__pyx_t_1 = NULL;
23408 PyObject *__pyx_t_2 = NULL;
23409 static PyThread_type_lock __pyx_t_3[8];
23410 int __pyx_lineno = 0;
23411 const char *__pyx_filename = NULL;
23412 int __pyx_clineno = 0;
23413 __Pyx_RefNannyDeclarations
23414 #if CYTHON_PEP489_MULTI_PHASE_INIT
23416 if (__pyx_m == __pyx_pyinit_module)
return 0;
23417 PyErr_SetString(PyExc_RuntimeError,
"Module 'cpartitioning' has already been imported. Re-initialisation is not supported.");
23420 #elif PY_MAJOR_VERSION >= 3
23421 if (__pyx_m)
return __Pyx_NewRef(__pyx_m);
23423 #if CYTHON_REFNANNY
23424 __Pyx_RefNanny = __Pyx_RefNannyImportAPI(
"refnanny");
23425 if (!__Pyx_RefNanny) {
23427 __Pyx_RefNanny = __Pyx_RefNannyImportAPI(
"Cython.Runtime.refnanny");
23428 if (!__Pyx_RefNanny)
23429 Py_FatalError(
"failed to import 'refnanny' module");
23432 __Pyx_RefNannySetupContext(
"__Pyx_PyMODINIT_FUNC PyInit_cpartitioning(void)", 0);
23433 if (__Pyx_check_binary_version() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
23434 #ifdef __Pxy_PyFrame_Initialize_Offsets
23435 __Pxy_PyFrame_Initialize_Offsets();
23437 __pyx_empty_tuple = PyTuple_New(0);
if (unlikely(!__pyx_empty_tuple)) __PYX_ERR(0, 1, __pyx_L1_error)
23438 __pyx_empty_bytes = PyBytes_FromStringAndSize(
"", 0);
if (unlikely(!__pyx_empty_bytes)) __PYX_ERR(0, 1, __pyx_L1_error)
23439 __pyx_empty_unicode = PyUnicode_FromStringAndSize(
"", 0);
if (unlikely(!__pyx_empty_unicode)) __PYX_ERR(0, 1, __pyx_L1_error)
23440 #ifdef __Pyx_CyFunction_USED
23441 if (__pyx_CyFunction_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
23443 #ifdef __Pyx_FusedFunction_USED
23444 if (__pyx_FusedFunction_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
23446 #ifdef __Pyx_Coroutine_USED
23447 if (__pyx_Coroutine_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
23449 #ifdef __Pyx_Generator_USED
23450 if (__pyx_Generator_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
23452 #ifdef __Pyx_AsyncGen_USED
23453 if (__pyx_AsyncGen_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
23455 #ifdef __Pyx_StopAsyncIteration_USED
23456 if (__pyx_StopAsyncIteration_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
23460 #if defined(WITH_THREAD) && PY_VERSION_HEX < 0x030700F0 && defined(__PYX_FORCE_INIT_THREADS) && __PYX_FORCE_INIT_THREADS
23461 PyEval_InitThreads();
23464 #if CYTHON_PEP489_MULTI_PHASE_INIT
23465 __pyx_m = __pyx_pyinit_module;
23466 Py_INCREF(__pyx_m);
23468 #if PY_MAJOR_VERSION < 3
23469 __pyx_m = Py_InitModule4(
"cpartitioning", __pyx_methods, 0, 0, PYTHON_API_VERSION); Py_XINCREF(__pyx_m);
23471 __pyx_m = PyModule_Create(&__pyx_moduledef);
23473 if (unlikely(!__pyx_m)) __PYX_ERR(0, 1, __pyx_L1_error)
23475 __pyx_d = PyModule_GetDict(__pyx_m);
if (unlikely(!__pyx_d)) __PYX_ERR(0, 1, __pyx_L1_error)
23476 Py_INCREF(__pyx_d);
23477 __pyx_b = PyImport_AddModule(__Pyx_BUILTIN_MODULE_NAME);
if (unlikely(!__pyx_b)) __PYX_ERR(0, 1, __pyx_L1_error)
23478 Py_INCREF(__pyx_b);
23479 __pyx_cython_runtime = PyImport_AddModule((
char *)
"cython_runtime");
if (unlikely(!__pyx_cython_runtime)) __PYX_ERR(0, 1, __pyx_L1_error)
23480 Py_INCREF(__pyx_cython_runtime);
23481 if (PyObject_SetAttrString(__pyx_m,
"__builtins__", __pyx_b) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
23483 if (__Pyx_InitGlobals() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
23484 #if PY_MAJOR_VERSION < 3 && (__PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT)
23485 if (__Pyx_init_sys_getdefaultencoding_params() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
23487 if (__pyx_module_is_main_cpartitioning) {
23488 if (PyObject_SetAttr(__pyx_m, __pyx_n_s_name_2, __pyx_n_s_main) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
23490 #if PY_MAJOR_VERSION >= 3
23492 PyObject *modules = PyImport_GetModuleDict();
if (unlikely(!modules)) __PYX_ERR(0, 1, __pyx_L1_error)
23493 if (!PyDict_GetItemString(modules,
"cpartitioning")) {
23494 if (unlikely(PyDict_SetItemString(modules,
"cpartitioning", __pyx_m) < 0)) __PYX_ERR(0, 1, __pyx_L1_error)
23499 if (__Pyx_InitCachedBuiltins() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
23501 if (__Pyx_InitCachedConstants() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
23503 (void)__Pyx_modinit_global_init_code();
23504 (void)__Pyx_modinit_variable_export_code();
23505 (void)__Pyx_modinit_function_export_code();
23506 if (unlikely(__Pyx_modinit_type_init_code() < 0)) __PYX_ERR(0, 1, __pyx_L1_error)
23507 if (unlikely(__Pyx_modinit_type_import_code() < 0)) __PYX_ERR(0, 1, __pyx_L1_error)
23508 (void)__Pyx_modinit_variable_import_code();
23509 (void)__Pyx_modinit_function_import_code();
23511 #if defined(__Pyx_Generator_USED) || defined(__Pyx_Coroutine_USED)
23512 if (__Pyx_patch_abc() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
23521 __pyx_t_1 = PyList_New(1);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2, __pyx_L1_error)
23522 __Pyx_GOTREF(__pyx_t_1);
23523 __Pyx_INCREF(__pyx_n_s_Comm);
23524 __Pyx_GIVEREF(__pyx_n_s_Comm);
23525 PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_s_Comm);
23526 __pyx_t_2 = __Pyx_Import(__pyx_n_s_proteus, __pyx_t_1, -1);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2, __pyx_L1_error)
23527 __Pyx_GOTREF(__pyx_t_2);
23528 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
23529 __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_Comm);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2, __pyx_L1_error)
23530 __Pyx_GOTREF(__pyx_t_1);
23531 if (PyDict_SetItem(__pyx_d, __pyx_n_s_proteus_Comm, __pyx_t_1) < 0) __PYX_ERR(0, 2, __pyx_L1_error)
23532 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
23533 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
23542 __pyx_t_2 = __Pyx_Import(__pyx_n_s_numpy, 0, -1);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3, __pyx_L1_error)
23543 __Pyx_GOTREF(__pyx_t_2);
23544 if (PyDict_SetItem(__pyx_d, __pyx_n_s_np, __pyx_t_2) < 0) __PYX_ERR(0, 3, __pyx_L1_error)
23545 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
23554 __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_13cpartitioning_1partitionElements, NULL, __pyx_n_s_cpartitioning);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 20, __pyx_L1_error)
23555 __Pyx_GOTREF(__pyx_t_2);
23556 if (PyDict_SetItem(__pyx_d, __pyx_n_s_partitionElements, __pyx_t_2) < 0) __PYX_ERR(0, 20, __pyx_L1_error)
23557 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
23566 __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_13cpartitioning_3partitionNodes, NULL, __pyx_n_s_cpartitioning);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 36, __pyx_L1_error)
23567 __Pyx_GOTREF(__pyx_t_2);
23568 if (PyDict_SetItem(__pyx_d, __pyx_n_s_partitionNodes, __pyx_t_2) < 0) __PYX_ERR(0, 36, __pyx_L1_error)
23569 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
23578 __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_13cpartitioning_5convertPUMIPartitionToPython, NULL, __pyx_n_s_cpartitioning);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 52, __pyx_L1_error)
23579 __Pyx_GOTREF(__pyx_t_2);
23580 if (PyDict_SetItem(__pyx_d, __pyx_n_s_convertPUMIPartitionToPython, __pyx_t_2) < 0) __PYX_ERR(0, 52, __pyx_L1_error)
23581 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
23590 __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_13cpartitioning_7partitionNodesFromTetgenFiles, NULL, __pyx_n_s_cpartitioning);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 66, __pyx_L1_error)
23591 __Pyx_GOTREF(__pyx_t_2);
23592 if (PyDict_SetItem(__pyx_d, __pyx_n_s_partitionNodesFromTetgenFiles, __pyx_t_2) < 0) __PYX_ERR(0, 66, __pyx_L1_error)
23593 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
23602 __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_13cpartitioning_9partitionNodesFromTriangleFiles, NULL, __pyx_n_s_cpartitioning);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 86, __pyx_L1_error)
23603 __Pyx_GOTREF(__pyx_t_2);
23604 if (PyDict_SetItem(__pyx_d, __pyx_n_s_partitionNodesFromTriangleFiles, __pyx_t_2) < 0) __PYX_ERR(0, 86, __pyx_L1_error)
23605 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
23614 __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_13cpartitioning_11buildQuadraticLocal2GlobalMappings, NULL, __pyx_n_s_cpartitioning);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 106, __pyx_L1_error)
23615 __Pyx_GOTREF(__pyx_t_2);
23616 if (PyDict_SetItem(__pyx_d, __pyx_n_s_buildQuadraticLocal2GlobalMappin, __pyx_t_2) < 0) __PYX_ERR(0, 106, __pyx_L1_error)
23617 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
23626 __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_13cpartitioning_13buildQuadraticCubeLocal2GlobalMappings, NULL, __pyx_n_s_cpartitioning);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 171, __pyx_L1_error)
23627 __Pyx_GOTREF(__pyx_t_2);
23628 if (PyDict_SetItem(__pyx_d, __pyx_n_s_buildQuadraticCubeLocal2GlobalMa, __pyx_t_2) < 0) __PYX_ERR(0, 171, __pyx_L1_error)
23629 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
23638 __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_13cpartitioning_15buildDiscontinuousGalerkinLocal2GlobalMappings, NULL, __pyx_n_s_cpartitioning);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 212, __pyx_L1_error)
23639 __Pyx_GOTREF(__pyx_t_2);
23640 if (PyDict_SetItem(__pyx_d, __pyx_n_s_buildDiscontinuousGalerkinLocal2, __pyx_t_2) < 0) __PYX_ERR(0, 212, __pyx_L1_error)
23641 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
23648 __pyx_t_2 = __Pyx_PyDict_NewPresized(0);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1, __pyx_L1_error)
23649 __Pyx_GOTREF(__pyx_t_2);
23650 if (PyDict_SetItem(__pyx_d, __pyx_n_s_test, __pyx_t_2) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
23651 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
23660 __pyx_t_2 = __pyx_capsule_create(((
void *)(&__pyx_array_getbuffer)), ((
char *)
"getbuffer(obj, view, flags)"));
if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 209, __pyx_L1_error)
23661 __Pyx_GOTREF(__pyx_t_2);
23662 if (PyDict_SetItem((PyObject *)__pyx_array_type->tp_dict, __pyx_n_s_pyx_getbuffer, __pyx_t_2) < 0) __PYX_ERR(2, 209, __pyx_L1_error)
23663 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
23664 PyType_Modified(__pyx_array_type);
23673 __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_MemviewEnum_type), __pyx_tuple__43, NULL);
if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 286, __pyx_L1_error)
23674 __Pyx_GOTREF(__pyx_t_2);
23675 __Pyx_XGOTREF(
generic);
23676 __Pyx_DECREF_SET(
generic, __pyx_t_2);
23677 __Pyx_GIVEREF(__pyx_t_2);
23687 __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_MemviewEnum_type), __pyx_tuple__44, NULL);
if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 287, __pyx_L1_error)
23688 __Pyx_GOTREF(__pyx_t_2);
23689 __Pyx_XGOTREF(strided);
23690 __Pyx_DECREF_SET(strided, __pyx_t_2);
23691 __Pyx_GIVEREF(__pyx_t_2);
23701 __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_MemviewEnum_type), __pyx_tuple__45, NULL);
if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 288, __pyx_L1_error)
23702 __Pyx_GOTREF(__pyx_t_2);
23703 __Pyx_XGOTREF(indirect);
23704 __Pyx_DECREF_SET(indirect, __pyx_t_2);
23705 __Pyx_GIVEREF(__pyx_t_2);
23715 __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_MemviewEnum_type), __pyx_tuple__46, NULL);
if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 291, __pyx_L1_error)
23716 __Pyx_GOTREF(__pyx_t_2);
23717 __Pyx_XGOTREF(contiguous);
23718 __Pyx_DECREF_SET(contiguous, __pyx_t_2);
23719 __Pyx_GIVEREF(__pyx_t_2);
23729 __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_MemviewEnum_type), __pyx_tuple__47, NULL);
if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 292, __pyx_L1_error)
23730 __Pyx_GOTREF(__pyx_t_2);
23731 __Pyx_XGOTREF(indirect_contiguous);
23732 __Pyx_DECREF_SET(indirect_contiguous, __pyx_t_2);
23733 __Pyx_GIVEREF(__pyx_t_2);
23743 __pyx_memoryview_thread_locks_used = 0;
23752 __pyx_t_3[0] = PyThread_allocate_lock();
23753 __pyx_t_3[1] = PyThread_allocate_lock();
23754 __pyx_t_3[2] = PyThread_allocate_lock();
23755 __pyx_t_3[3] = PyThread_allocate_lock();
23756 __pyx_t_3[4] = PyThread_allocate_lock();
23757 __pyx_t_3[5] = PyThread_allocate_lock();
23758 __pyx_t_3[6] = PyThread_allocate_lock();
23759 __pyx_t_3[7] = PyThread_allocate_lock();
23760 memcpy(&(__pyx_memoryview_thread_locks[0]), __pyx_t_3,
sizeof(__pyx_memoryview_thread_locks[0]) * (8));
23769 __pyx_t_2 = __pyx_capsule_create(((
void *)(&__pyx_memoryview_getbuffer)), ((
char *)
"getbuffer(obj, view, flags)"));
if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 549, __pyx_L1_error)
23770 __Pyx_GOTREF(__pyx_t_2);
23771 if (PyDict_SetItem((PyObject *)__pyx_memoryview_type->tp_dict, __pyx_n_s_pyx_getbuffer, __pyx_t_2) < 0) __PYX_ERR(2, 549, __pyx_L1_error)
23772 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
23773 PyType_Modified(__pyx_memoryview_type);
23782 __pyx_t_2 = __pyx_capsule_create(((
void *)(&__pyx_memoryview_getbuffer)), ((
char *)
"getbuffer(obj, view, flags)"));
if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 995, __pyx_L1_error)
23783 __Pyx_GOTREF(__pyx_t_2);
23784 if (PyDict_SetItem((PyObject *)__pyx_memoryviewslice_type->tp_dict, __pyx_n_s_pyx_getbuffer, __pyx_t_2) < 0) __PYX_ERR(2, 995, __pyx_L1_error)
23785 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
23786 PyType_Modified(__pyx_memoryviewslice_type);
23793 __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_15View_dot_MemoryView_1__pyx_unpickle_Enum, NULL, __pyx_n_s_View_MemoryView);
if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 1, __pyx_L1_error)
23794 __Pyx_GOTREF(__pyx_t_2);
23795 if (PyDict_SetItem(__pyx_d, __pyx_n_s_pyx_unpickle_Enum, __pyx_t_2) < 0) __PYX_ERR(2, 1, __pyx_L1_error)
23796 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
23810 __Pyx_XDECREF(__pyx_t_1);
23811 __Pyx_XDECREF(__pyx_t_2);
23814 __Pyx_AddTraceback(
"init cpartitioning", __pyx_clineno, __pyx_lineno, __pyx_filename);
23817 }
else if (!PyErr_Occurred()) {
23818 PyErr_SetString(PyExc_ImportError,
"init cpartitioning");
23821 __Pyx_RefNannyFinishContext();
23822 #if CYTHON_PEP489_MULTI_PHASE_INIT
23823 return (__pyx_m != NULL) ? 0 : -1;
23824 #elif PY_MAJOR_VERSION >= 3
23833 #if CYTHON_REFNANNY
23834 static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(
const char *modname) {
23835 PyObject *m = NULL, *p = NULL;
23837 m = PyImport_ImportModule(modname);
23839 p = PyObject_GetAttrString(m,
"RefNannyAPI");
23841 r = PyLong_AsVoidPtr(p);
23845 return (__Pyx_RefNannyAPIStruct *)
r;
23850 static void __Pyx_RaiseArgtupleInvalid(
23851 const char* func_name,
23853 Py_ssize_t num_min,
23854 Py_ssize_t num_max,
23855 Py_ssize_t num_found)
23857 Py_ssize_t num_expected;
23858 const char *more_or_less;
23859 if (num_found < num_min) {
23860 num_expected = num_min;
23861 more_or_less =
"at least";
23863 num_expected = num_max;
23864 more_or_less =
"at most";
23867 more_or_less =
"exactly";
23869 PyErr_Format(PyExc_TypeError,
23870 "%.200s() takes %.8s %" CYTHON_FORMAT_SSIZE_T
"d positional argument%.1s (%" CYTHON_FORMAT_SSIZE_T
"d given)",
23871 func_name, more_or_less, num_expected,
23872 (num_expected == 1) ?
"" :
"s", num_found);
23876 static void __Pyx_RaiseDoubleKeywordsError(
23877 const char* func_name,
23880 PyErr_Format(PyExc_TypeError,
23881 #
if PY_MAJOR_VERSION >= 3
23882 "%s() got multiple values for keyword argument '%U'", func_name, kw_name);
23884 "%s() got multiple values for keyword argument '%s'", func_name,
23885 PyString_AsString(kw_name));
23890 static int __Pyx_ParseOptionalKeywords(
23892 PyObject **argnames[],
23894 PyObject *values[],
23895 Py_ssize_t num_pos_args,
23896 const char* function_name)
23898 PyObject *key = 0, *value = 0;
23899 Py_ssize_t
pos = 0;
23901 PyObject*** first_kw_arg = argnames + num_pos_args;
23902 while (PyDict_Next(kwds, &
pos, &key, &value)) {
23903 name = first_kw_arg;
23904 while (*name && (**name != key)) name++;
23906 values[name-argnames] = value;
23909 name = first_kw_arg;
23910 #if PY_MAJOR_VERSION < 3
23911 if (likely(PyString_Check(key))) {
23913 if ((CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**name) == PyString_GET_SIZE(key))
23914 && _PyString_Eq(**name, key)) {
23915 values[name-argnames] = value;
23920 if (*name)
continue;
23922 PyObject*** argname = argnames;
23923 while (argname != first_kw_arg) {
23924 if ((**argname == key) || (
23925 (CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**argname) == PyString_GET_SIZE(key))
23926 && _PyString_Eq(**argname, key))) {
23927 goto arg_passed_twice;
23934 if (likely(PyUnicode_Check(key))) {
23936 int cmp = (**name == key) ? 0 :
23937 #
if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3
23938 (__Pyx_PyUnicode_GET_LENGTH(**name) != __Pyx_PyUnicode_GET_LENGTH(key)) ? 1 :
23940 PyUnicode_Compare(**name, key);
23941 if (cmp < 0 && unlikely(PyErr_Occurred()))
goto bad;
23943 values[name-argnames] = value;
23948 if (*name)
continue;
23950 PyObject*** argname = argnames;
23951 while (argname != first_kw_arg) {
23952 int cmp = (**argname == key) ? 0 :
23953 #
if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3
23954 (__Pyx_PyUnicode_GET_LENGTH(**argname) != __Pyx_PyUnicode_GET_LENGTH(key)) ? 1 :
23956 PyUnicode_Compare(**argname, key);
23957 if (cmp < 0 && unlikely(PyErr_Occurred()))
goto bad;
23958 if (cmp == 0)
goto arg_passed_twice;
23963 goto invalid_keyword_type;
23965 if (unlikely(PyDict_SetItem(kwds2, key, value)))
goto bad;
23967 goto invalid_keyword;
23972 __Pyx_RaiseDoubleKeywordsError(function_name, key);
23974 invalid_keyword_type:
23975 PyErr_Format(PyExc_TypeError,
23976 "%.200s() keywords must be strings", function_name);
23979 PyErr_Format(PyExc_TypeError,
23980 #
if PY_MAJOR_VERSION < 3
23981 "%.200s() got an unexpected keyword argument '%.200s'",
23982 function_name, PyString_AsString(key));
23984 "%s() got an unexpected keyword argument '%U'",
23985 function_name, key);
23992 static int __Pyx__ArgTypeTest(PyObject *obj, PyTypeObject *type,
const char *name,
int exact)
23994 if (unlikely(!type)) {
23995 PyErr_SetString(PyExc_SystemError,
"Missing type object");
23999 #if PY_MAJOR_VERSION == 2
24000 if ((type == &PyBaseString_Type) && likely(__Pyx_PyBaseString_CheckExact(obj)))
return 1;
24004 if (likely(__Pyx_TypeCheck(obj, type)))
return 1;
24006 PyErr_Format(PyExc_TypeError,
24007 "Argument '%.200s' has incorrect type (expected %.200s, got %.200s)",
24008 name, type->tp_name, Py_TYPE(obj)->tp_name);
24013 #if CYTHON_USE_TYPE_SLOTS
24014 static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name) {
24015 PyTypeObject* tp = Py_TYPE(obj);
24016 if (likely(tp->tp_getattro))
24017 return tp->tp_getattro(obj, attr_name);
24018 #if PY_MAJOR_VERSION < 3
24019 if (likely(tp->tp_getattr))
24020 return tp->tp_getattr(obj, PyString_AS_STRING(attr_name));
24022 return PyObject_GetAttr(obj, attr_name);
24027 static PyObject *__Pyx_GetBuiltinName(PyObject *name) {
24028 PyObject* result = __Pyx_PyObject_GetAttrStr(__pyx_b, name);
24029 if (unlikely(!result)) {
24030 PyErr_Format(PyExc_NameError,
24031 #
if PY_MAJOR_VERSION >= 3
24032 "name '%U' is not defined", name);
24034 "name '%.200s' is not defined", PyString_AS_STRING(name));
24041 #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_TYPE_SLOTS
24042 static CYTHON_INLINE PY_UINT64_T __Pyx_get_tp_dict_version(PyObject *obj) {
24043 PyObject *dict = Py_TYPE(obj)->tp_dict;
24044 return likely(dict) ? __PYX_GET_DICT_VERSION(dict) : 0;
24046 static CYTHON_INLINE PY_UINT64_T __Pyx_get_object_dict_version(PyObject *obj) {
24047 PyObject **dictptr = NULL;
24048 Py_ssize_t offset = Py_TYPE(obj)->tp_dictoffset;
24050 #if CYTHON_COMPILING_IN_CPYTHON
24051 dictptr = (likely(offset > 0)) ? (PyObject **) ((
char *)obj + offset) : _PyObject_GetDictPtr(obj);
24053 dictptr = _PyObject_GetDictPtr(obj);
24056 return (dictptr && *dictptr) ? __PYX_GET_DICT_VERSION(*dictptr) : 0;
24058 static CYTHON_INLINE
int __Pyx_object_dict_version_matches(PyObject* obj, PY_UINT64_T tp_dict_version, PY_UINT64_T obj_dict_version) {
24059 PyObject *dict = Py_TYPE(obj)->tp_dict;
24060 if (unlikely(!dict) || unlikely(tp_dict_version != __PYX_GET_DICT_VERSION(dict)))
24062 return obj_dict_version == __Pyx_get_object_dict_version(obj);
24067 #if CYTHON_USE_DICT_VERSIONS
24068 static PyObject *__Pyx__GetModuleGlobalName(PyObject *name, PY_UINT64_T *dict_version, PyObject **dict_cached_value)
24070 static CYTHON_INLINE PyObject *__Pyx__GetModuleGlobalName(PyObject *name)
24074 #if !CYTHON_AVOID_BORROWED_REFS
24075 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030500A1
24076 result = _PyDict_GetItem_KnownHash(__pyx_d, name, ((PyASCIIObject *) name)->hash);
24077 __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version)
24078 if (likely(result)) {
24079 return __Pyx_NewRef(result);
24080 }
else if (unlikely(PyErr_Occurred())) {
24084 result = PyDict_GetItem(__pyx_d, name);
24085 __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version)
24086 if (likely(result)) {
24087 return __Pyx_NewRef(result);
24091 result = PyObject_GetItem(__pyx_d, name);
24092 __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version)
24093 if (likely(result)) {
24094 return __Pyx_NewRef(result);
24098 return __Pyx_GetBuiltinName(name);
24102 #if !CYTHON_COMPILING_IN_PYPY
24103 static PyObject* __Pyx_PyInt_AddObjC(PyObject *op1, PyObject *op2, CYTHON_UNUSED
long intval,
int inplace,
int zerodivision_check) {
24105 (void)zerodivision_check;
24106 #if PY_MAJOR_VERSION < 3
24107 if (likely(PyInt_CheckExact(op1))) {
24108 const long b = intval;
24110 long a = PyInt_AS_LONG(op1);
24111 x = (long)((
unsigned long)a + b);
24112 if (likely((x^a) >= 0 || (x^b) >= 0))
24113 return PyInt_FromLong(x);
24114 return PyLong_Type.tp_as_number->nb_add(op1, op2);
24117 #if CYTHON_USE_PYLONG_INTERNALS
24118 if (likely(PyLong_CheckExact(op1))) {
24119 const long b = intval;
24121 #ifdef HAVE_LONG_LONG
24122 const PY_LONG_LONG llb = intval;
24123 PY_LONG_LONG lla, llx;
24125 const digit* digits = ((PyLongObject*)op1)->ob_digit;
24126 const Py_ssize_t size = Py_SIZE(op1);
24127 if (likely(__Pyx_sst_abs(size) <= 1)) {
24128 a = likely(size) ? digits[0] : 0;
24129 if (size == -1) a = -a;
24133 if (8 *
sizeof(
long) - 1 > 2 * PyLong_SHIFT) {
24134 a = -(long) (((((
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0]));
24136 #ifdef HAVE_LONG_LONG
24137 }
else if (8 *
sizeof(PY_LONG_LONG) - 1 > 2 * PyLong_SHIFT) {
24138 lla = -(PY_LONG_LONG) (((((
unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (
unsigned PY_LONG_LONG)digits[0]));
24142 CYTHON_FALLTHROUGH;
24144 if (8 *
sizeof(
long) - 1 > 2 * PyLong_SHIFT) {
24145 a = (long) (((((
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0]));
24147 #ifdef HAVE_LONG_LONG
24148 }
else if (8 *
sizeof(PY_LONG_LONG) - 1 > 2 * PyLong_SHIFT) {
24149 lla = (PY_LONG_LONG) (((((
unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (
unsigned PY_LONG_LONG)digits[0]));
24153 CYTHON_FALLTHROUGH;
24155 if (8 *
sizeof(
long) - 1 > 3 * PyLong_SHIFT) {
24156 a = -(long) (((((((
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0]));
24158 #ifdef HAVE_LONG_LONG
24159 }
else if (8 *
sizeof(PY_LONG_LONG) - 1 > 3 * PyLong_SHIFT) {
24160 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]));
24164 CYTHON_FALLTHROUGH;
24166 if (8 *
sizeof(
long) - 1 > 3 * PyLong_SHIFT) {
24167 a = (long) (((((((
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0]));
24169 #ifdef HAVE_LONG_LONG
24170 }
else if (8 *
sizeof(PY_LONG_LONG) - 1 > 3 * PyLong_SHIFT) {
24171 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]));
24175 CYTHON_FALLTHROUGH;
24177 if (8 *
sizeof(
long) - 1 > 4 * PyLong_SHIFT) {
24178 a = -(long) (((((((((
unsigned long)digits[3]) << PyLong_SHIFT) | (
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0]));
24180 #ifdef HAVE_LONG_LONG
24181 }
else if (8 *
sizeof(PY_LONG_LONG) - 1 > 4 * PyLong_SHIFT) {
24182 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]));
24186 CYTHON_FALLTHROUGH;
24188 if (8 *
sizeof(
long) - 1 > 4 * PyLong_SHIFT) {
24189 a = (long) (((((((((
unsigned long)digits[3]) << PyLong_SHIFT) | (
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0]));
24191 #ifdef HAVE_LONG_LONG
24192 }
else if (8 *
sizeof(PY_LONG_LONG) - 1 > 4 * PyLong_SHIFT) {
24193 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]));
24197 CYTHON_FALLTHROUGH;
24198 default:
return PyLong_Type.tp_as_number->nb_add(op1, op2);
24202 return PyLong_FromLong(x);
24203 #ifdef HAVE_LONG_LONG
24206 return PyLong_FromLongLong(llx);
24212 if (PyFloat_CheckExact(op1)) {
24213 const long b = intval;
24214 double a = PyFloat_AS_DOUBLE(op1);
24216 PyFPE_START_PROTECT(
"add",
return NULL)
24217 result = ((double)a) + (double)b;
24218 PyFPE_END_PROTECT(result)
24219 return PyFloat_FromDouble(result);
24221 return (inplace ? PyNumber_InPlaceAdd : PyNumber_Add)(op1, op2);
24226 #if CYTHON_FAST_PYCCALL
24227 static CYTHON_INLINE PyObject * __Pyx_PyCFunction_FastCall(PyObject *func_obj, PyObject **args, Py_ssize_t nargs) {
24228 PyCFunctionObject *func = (PyCFunctionObject*)func_obj;
24229 PyCFunction meth = PyCFunction_GET_FUNCTION(func);
24230 PyObject *
self = PyCFunction_GET_SELF(func);
24231 int flags = PyCFunction_GET_FLAGS(func);
24232 assert(PyCFunction_Check(func));
24233 assert(METH_FASTCALL == (flags & ~(METH_CLASS | METH_STATIC | METH_COEXIST | METH_KEYWORDS | METH_STACKLESS)));
24234 assert(nargs >= 0);
24235 assert(nargs == 0 || args != NULL);
24239 assert(!PyErr_Occurred());
24240 if ((PY_VERSION_HEX < 0x030700A0) || unlikely(flags & METH_KEYWORDS)) {
24241 return (*((__Pyx_PyCFunctionFastWithKeywords)(
void*)meth)) (
self, args, nargs, NULL);
24243 return (*((__Pyx_PyCFunctionFast)(
void*)meth)) (
self, args, nargs);
24249 #if CYTHON_FAST_PYCALL
24250 static PyObject* __Pyx_PyFunction_FastCallNoKw(PyCodeObject *co, PyObject **args, Py_ssize_t na,
24251 PyObject *globals) {
24253 PyThreadState *tstate = __Pyx_PyThreadState_Current;
24254 PyObject **fastlocals;
24257 assert(globals != NULL);
24262 assert(tstate != NULL);
24263 f = PyFrame_New(tstate, co, globals, NULL);
24267 fastlocals = __Pyx_PyFrame_GetLocalsplus(
f);
24268 for (i = 0; i < na; i++) {
24270 fastlocals[i] = *args++;
24272 result = PyEval_EvalFrameEx(
f,0);
24273 ++tstate->recursion_depth;
24275 --tstate->recursion_depth;
24278 #if 1 || PY_VERSION_HEX < 0x030600B1
24279 static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args, Py_ssize_t nargs, PyObject *kwargs) {
24280 PyCodeObject *co = (PyCodeObject *)PyFunction_GET_CODE(func);
24281 PyObject *globals = PyFunction_GET_GLOBALS(func);
24282 PyObject *argdefs = PyFunction_GET_DEFAULTS(func);
24284 #if PY_MAJOR_VERSION >= 3
24287 PyObject *kwtuple, **k;
24292 assert(kwargs == NULL || PyDict_Check(kwargs));
24293 nk = kwargs ? PyDict_Size(kwargs) : 0;
24294 if (Py_EnterRecursiveCall((
char*)
" while calling a Python object")) {
24298 #
if PY_MAJOR_VERSION >= 3
24299 co->co_kwonlyargcount == 0 &&
24301 likely(kwargs == NULL || nk == 0) &&
24302 co->co_flags == (CO_OPTIMIZED | CO_NEWLOCALS | CO_NOFREE)) {
24303 if (argdefs == NULL && co->co_argcount == nargs) {
24304 result = __Pyx_PyFunction_FastCallNoKw(co, args, nargs, globals);
24307 else if (nargs == 0 && argdefs != NULL
24308 && co->co_argcount == Py_SIZE(argdefs)) {
24311 args = &PyTuple_GET_ITEM(argdefs, 0);
24312 result =__Pyx_PyFunction_FastCallNoKw(co, args, Py_SIZE(argdefs), globals);
24316 if (kwargs != NULL) {
24318 kwtuple = PyTuple_New(2 * nk);
24319 if (kwtuple == NULL) {
24323 k = &PyTuple_GET_ITEM(kwtuple, 0);
24325 while (PyDict_Next(kwargs, &
pos, &k[i], &k[i+1])) {
24336 closure = PyFunction_GET_CLOSURE(func);
24337 #if PY_MAJOR_VERSION >= 3
24338 kwdefs = PyFunction_GET_KW_DEFAULTS(func);
24340 if (argdefs != NULL) {
24341 d = &PyTuple_GET_ITEM(argdefs, 0);
24342 nd = Py_SIZE(argdefs);
24348 #if PY_MAJOR_VERSION >= 3
24349 result = PyEval_EvalCodeEx((PyObject*)co, globals, (PyObject *)NULL,
24352 d, (
int)nd, kwdefs, closure);
24354 result = PyEval_EvalCodeEx(co, globals, (PyObject *)NULL,
24357 d, (
int)nd, closure);
24359 Py_XDECREF(kwtuple);
24361 Py_LeaveRecursiveCall();
24368 #if CYTHON_COMPILING_IN_CPYTHON
24369 static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw) {
24371 ternaryfunc call = Py_TYPE(func)->tp_call;
24372 if (unlikely(!call))
24373 return PyObject_Call(func, arg, kw);
24374 if (unlikely(Py_EnterRecursiveCall((
char*)
" while calling a Python object")))
24376 result = (*call)(func, arg, kw);
24377 Py_LeaveRecursiveCall();
24378 if (unlikely(!result) && unlikely(!PyErr_Occurred())) {
24381 "NULL result without error in PyObject_Call");
24388 static CYTHON_UNUSED PyObject* __Pyx_PyObject_Call2Args(PyObject*
function, PyObject* arg1, PyObject* arg2) {
24389 PyObject *args, *result = NULL;
24390 #if CYTHON_FAST_PYCALL
24391 if (PyFunction_Check(
function)) {
24392 PyObject *args[2] = {arg1, arg2};
24393 return __Pyx_PyFunction_FastCall(
function, args, 2);
24396 #if CYTHON_FAST_PYCCALL
24397 if (__Pyx_PyFastCFunction_Check(
function)) {
24398 PyObject *args[2] = {arg1, arg2};
24399 return __Pyx_PyCFunction_FastCall(
function, args, 2);
24402 args = PyTuple_New(2);
24403 if (unlikely(!args))
goto done;
24405 PyTuple_SET_ITEM(args, 0, arg1);
24407 PyTuple_SET_ITEM(args, 1, arg2);
24408 Py_INCREF(
function);
24409 result = __Pyx_PyObject_Call(
function, args, NULL);
24411 Py_DECREF(
function);
24417 #if CYTHON_COMPILING_IN_CPYTHON
24418 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg) {
24419 PyObject *
self, *result;
24421 cfunc = PyCFunction_GET_FUNCTION(func);
24422 self = PyCFunction_GET_SELF(func);
24423 if (unlikely(Py_EnterRecursiveCall((
char*)
" while calling a Python object")))
24425 result = cfunc(
self, arg);
24426 Py_LeaveRecursiveCall();
24427 if (unlikely(!result) && unlikely(!PyErr_Occurred())) {
24430 "NULL result without error in PyObject_Call");
24437 #if CYTHON_COMPILING_IN_CPYTHON
24438 static PyObject* __Pyx__PyObject_CallOneArg(PyObject *func, PyObject *arg) {
24440 PyObject *args = PyTuple_New(1);
24441 if (unlikely(!args))
return NULL;
24443 PyTuple_SET_ITEM(args, 0, arg);
24444 result = __Pyx_PyObject_Call(func, args, NULL);
24448 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg) {
24449 #if CYTHON_FAST_PYCALL
24450 if (PyFunction_Check(func)) {
24451 return __Pyx_PyFunction_FastCall(func, &arg, 1);
24454 if (likely(PyCFunction_Check(func))) {
24455 if (likely(PyCFunction_GET_FLAGS(func) & METH_O)) {
24456 return __Pyx_PyObject_CallMethO(func, arg);
24457 #if CYTHON_FAST_PYCCALL
24458 }
else if (__Pyx_PyFastCFunction_Check(func)) {
24459 return __Pyx_PyCFunction_FastCall(func, &arg, 1);
24463 return __Pyx__PyObject_CallOneArg(func, arg);
24466 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg) {
24468 PyObject *args = PyTuple_Pack(1, arg);
24469 if (unlikely(!args))
return NULL;
24470 result = __Pyx_PyObject_Call(func, args, NULL);
24477 #if CYTHON_COMPILING_IN_CPYTHON
24478 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallNoArg(PyObject *func) {
24479 #if CYTHON_FAST_PYCALL
24480 if (PyFunction_Check(func)) {
24481 return __Pyx_PyFunction_FastCall(func, NULL, 0);
24484 #ifdef __Pyx_CyFunction_USED
24485 if (likely(PyCFunction_Check(func) || __Pyx_CyFunction_Check(func)))
24487 if (likely(PyCFunction_Check(func)))
24490 if (likely(PyCFunction_GET_FLAGS(func) & METH_NOARGS)) {
24491 return __Pyx_PyObject_CallMethO(func, NULL);
24494 return __Pyx_PyObject_Call(func, __pyx_empty_tuple, NULL);
24499 #if CYTHON_USE_EXC_INFO_STACK
24500 static _PyErr_StackItem *
24501 __Pyx_PyErr_GetTopmostException(PyThreadState *tstate)
24503 _PyErr_StackItem *exc_info = tstate->exc_info;
24504 while ((exc_info->exc_type == NULL || exc_info->exc_type == Py_None) &&
24505 exc_info->previous_item != NULL)
24507 exc_info = exc_info->previous_item;
24514 #if CYTHON_FAST_THREAD_STATE
24515 static CYTHON_INLINE
void __Pyx__ExceptionSave(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) {
24516 #if CYTHON_USE_EXC_INFO_STACK
24517 _PyErr_StackItem *exc_info = __Pyx_PyErr_GetTopmostException(tstate);
24518 *type = exc_info->exc_type;
24519 *value = exc_info->exc_value;
24520 *tb = exc_info->exc_traceback;
24522 *type = tstate->exc_type;
24523 *value = tstate->exc_value;
24524 *tb = tstate->exc_traceback;
24527 Py_XINCREF(*value);
24530 static CYTHON_INLINE
void __Pyx__ExceptionReset(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb) {
24531 PyObject *tmp_type, *tmp_value, *tmp_tb;
24532 #if CYTHON_USE_EXC_INFO_STACK
24533 _PyErr_StackItem *exc_info = tstate->exc_info;
24534 tmp_type = exc_info->exc_type;
24535 tmp_value = exc_info->exc_value;
24536 tmp_tb = exc_info->exc_traceback;
24537 exc_info->exc_type = type;
24538 exc_info->exc_value = value;
24539 exc_info->exc_traceback = tb;
24541 tmp_type = tstate->exc_type;
24542 tmp_value = tstate->exc_value;
24543 tmp_tb = tstate->exc_traceback;
24544 tstate->exc_type = type;
24545 tstate->exc_value = value;
24546 tstate->exc_traceback = tb;
24548 Py_XDECREF(tmp_type);
24549 Py_XDECREF(tmp_value);
24550 Py_XDECREF(tmp_tb);
24555 #if CYTHON_FAST_THREAD_STATE
24556 static int __Pyx_PyErr_ExceptionMatchesTuple(PyObject *exc_type, PyObject *tuple) {
24558 n = PyTuple_GET_SIZE(tuple);
24559 #if PY_MAJOR_VERSION >= 3
24560 for (i=0; i<
n; i++) {
24561 if (exc_type == PyTuple_GET_ITEM(tuple, i))
return 1;
24564 for (i=0; i<
n; i++) {
24565 if (__Pyx_PyErr_GivenExceptionMatches(exc_type, PyTuple_GET_ITEM(tuple, i)))
return 1;
24569 static CYTHON_INLINE
int __Pyx_PyErr_ExceptionMatchesInState(PyThreadState* tstate, PyObject* err) {
24570 PyObject *exc_type = tstate->curexc_type;
24571 if (exc_type == err)
return 1;
24572 if (unlikely(!exc_type))
return 0;
24573 if (unlikely(PyTuple_Check(err)))
24574 return __Pyx_PyErr_ExceptionMatchesTuple(exc_type, err);
24575 return __Pyx_PyErr_GivenExceptionMatches(exc_type, err);
24580 #if CYTHON_FAST_THREAD_STATE
24581 static int __Pyx__GetException(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb)
24583 static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb)
24586 PyObject *local_type, *local_value, *local_tb;
24587 #if CYTHON_FAST_THREAD_STATE
24588 PyObject *tmp_type, *tmp_value, *tmp_tb;
24589 local_type = tstate->curexc_type;
24590 local_value = tstate->curexc_value;
24591 local_tb = tstate->curexc_traceback;
24592 tstate->curexc_type = 0;
24593 tstate->curexc_value = 0;
24594 tstate->curexc_traceback = 0;
24596 PyErr_Fetch(&local_type, &local_value, &local_tb);
24598 PyErr_NormalizeException(&local_type, &local_value, &local_tb);
24599 #if CYTHON_FAST_THREAD_STATE
24600 if (unlikely(tstate->curexc_type))
24602 if (unlikely(PyErr_Occurred()))
24605 #if PY_MAJOR_VERSION >= 3
24607 if (unlikely(PyException_SetTraceback(local_value, local_tb) < 0))
24611 Py_XINCREF(local_tb);
24612 Py_XINCREF(local_type);
24613 Py_XINCREF(local_value);
24614 *type = local_type;
24615 *value = local_value;
24617 #if CYTHON_FAST_THREAD_STATE
24618 #if CYTHON_USE_EXC_INFO_STACK
24620 _PyErr_StackItem *exc_info = tstate->exc_info;
24621 tmp_type = exc_info->exc_type;
24622 tmp_value = exc_info->exc_value;
24623 tmp_tb = exc_info->exc_traceback;
24624 exc_info->exc_type = local_type;
24625 exc_info->exc_value = local_value;
24626 exc_info->exc_traceback = local_tb;
24629 tmp_type = tstate->exc_type;
24630 tmp_value = tstate->exc_value;
24631 tmp_tb = tstate->exc_traceback;
24632 tstate->exc_type = local_type;
24633 tstate->exc_value = local_value;
24634 tstate->exc_traceback = local_tb;
24636 Py_XDECREF(tmp_type);
24637 Py_XDECREF(tmp_value);
24638 Py_XDECREF(tmp_tb);
24640 PyErr_SetExcInfo(local_type, local_value, local_tb);
24647 Py_XDECREF(local_type);
24648 Py_XDECREF(local_value);
24649 Py_XDECREF(local_tb);
24654 #if CYTHON_FAST_THREAD_STATE
24655 static CYTHON_INLINE
void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb) {
24656 PyObject *tmp_type, *tmp_value, *tmp_tb;
24657 tmp_type = tstate->curexc_type;
24658 tmp_value = tstate->curexc_value;
24659 tmp_tb = tstate->curexc_traceback;
24660 tstate->curexc_type = type;
24661 tstate->curexc_value = value;
24662 tstate->curexc_traceback = tb;
24663 Py_XDECREF(tmp_type);
24664 Py_XDECREF(tmp_value);
24665 Py_XDECREF(tmp_tb);
24667 static CYTHON_INLINE
void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) {
24668 *type = tstate->curexc_type;
24669 *value = tstate->curexc_value;
24670 *tb = tstate->curexc_traceback;
24671 tstate->curexc_type = 0;
24672 tstate->curexc_value = 0;
24673 tstate->curexc_traceback = 0;
24678 #if PY_MAJOR_VERSION < 3
24679 static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb,
24680 CYTHON_UNUSED PyObject *cause) {
24681 __Pyx_PyThreadState_declare
24683 if (!value || value == Py_None)
24687 if (!tb || tb == Py_None)
24691 if (!PyTraceBack_Check(tb)) {
24692 PyErr_SetString(PyExc_TypeError,
24693 "raise: arg 3 must be a traceback or None");
24697 if (PyType_Check(type)) {
24698 #if CYTHON_COMPILING_IN_PYPY
24700 Py_INCREF(Py_None);
24704 PyErr_NormalizeException(&type, &value, &tb);
24707 PyErr_SetString(PyExc_TypeError,
24708 "instance exception may not have a separate value");
24712 type = (PyObject*) Py_TYPE(type);
24714 if (!PyType_IsSubtype((PyTypeObject *)type, (PyTypeObject *)PyExc_BaseException)) {
24715 PyErr_SetString(PyExc_TypeError,
24716 "raise: exception class must be a subclass of BaseException");
24720 __Pyx_PyThreadState_assign
24721 __Pyx_ErrRestore(type, value, tb);
24730 static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause) {
24731 PyObject* owned_instance = NULL;
24732 if (tb == Py_None) {
24734 }
else if (tb && !PyTraceBack_Check(tb)) {
24735 PyErr_SetString(PyExc_TypeError,
24736 "raise: arg 3 must be a traceback or None");
24739 if (value == Py_None)
24741 if (PyExceptionInstance_Check(type)) {
24743 PyErr_SetString(PyExc_TypeError,
24744 "instance exception may not have a separate value");
24748 type = (PyObject*) Py_TYPE(value);
24749 }
else if (PyExceptionClass_Check(type)) {
24750 PyObject *instance_class = NULL;
24751 if (value && PyExceptionInstance_Check(value)) {
24752 instance_class = (PyObject*) Py_TYPE(value);
24753 if (instance_class != type) {
24754 int is_subclass = PyObject_IsSubclass(instance_class, type);
24755 if (!is_subclass) {
24756 instance_class = NULL;
24757 }
else if (unlikely(is_subclass == -1)) {
24760 type = instance_class;
24764 if (!instance_class) {
24767 args = PyTuple_New(0);
24768 else if (PyTuple_Check(value)) {
24772 args = PyTuple_Pack(1, value);
24775 owned_instance = PyObject_Call(type, args, NULL);
24777 if (!owned_instance)
24779 value = owned_instance;
24780 if (!PyExceptionInstance_Check(value)) {
24781 PyErr_Format(PyExc_TypeError,
24782 "calling %R should have returned an instance of "
24783 "BaseException, not %R",
24784 type, Py_TYPE(value));
24789 PyErr_SetString(PyExc_TypeError,
24790 "raise: exception class must be a subclass of BaseException");
24794 PyObject *fixed_cause;
24795 if (cause == Py_None) {
24796 fixed_cause = NULL;
24797 }
else if (PyExceptionClass_Check(cause)) {
24798 fixed_cause = PyObject_CallObject(cause, NULL);
24799 if (fixed_cause == NULL)
24801 }
else if (PyExceptionInstance_Check(cause)) {
24802 fixed_cause = cause;
24803 Py_INCREF(fixed_cause);
24805 PyErr_SetString(PyExc_TypeError,
24806 "exception causes must derive from "
24810 PyException_SetCause(value, fixed_cause);
24812 PyErr_SetObject(type, value);
24814 #if CYTHON_COMPILING_IN_PYPY
24815 PyObject *tmp_type, *tmp_value, *tmp_tb;
24816 PyErr_Fetch(&tmp_type, &tmp_value, &tmp_tb);
24818 PyErr_Restore(tmp_type, tmp_value, tb);
24819 Py_XDECREF(tmp_tb);
24821 PyThreadState *tstate = __Pyx_PyThreadState_Current;
24822 PyObject* tmp_tb = tstate->curexc_traceback;
24823 if (tb != tmp_tb) {
24825 tstate->curexc_traceback = tb;
24826 Py_XDECREF(tmp_tb);
24831 Py_XDECREF(owned_instance);
24837 static CYTHON_INLINE
int __Pyx_PyBytes_Equals(PyObject* s1, PyObject* s2,
int equals) {
24838 #if CYTHON_COMPILING_IN_PYPY
24839 return PyObject_RichCompareBool(s1, s2, equals);
24842 return (equals == Py_EQ);
24843 }
else if (PyBytes_CheckExact(s1) & PyBytes_CheckExact(s2)) {
24844 const char *ps1, *ps2;
24845 Py_ssize_t length = PyBytes_GET_SIZE(s1);
24846 if (length != PyBytes_GET_SIZE(s2))
24847 return (equals == Py_NE);
24848 ps1 = PyBytes_AS_STRING(s1);
24849 ps2 = PyBytes_AS_STRING(s2);
24850 if (ps1[0] != ps2[0]) {
24851 return (equals == Py_NE);
24852 }
else if (length == 1) {
24853 return (equals == Py_EQ);
24856 #if CYTHON_USE_UNICODE_INTERNALS && (PY_VERSION_HEX < 0x030B0000)
24857 Py_hash_t hash1, hash2;
24858 hash1 = ((PyBytesObject*)s1)->ob_shash;
24859 hash2 = ((PyBytesObject*)s2)->ob_shash;
24860 if (hash1 != hash2 && hash1 != -1 && hash2 != -1) {
24861 return (equals == Py_NE);
24864 result = memcmp(ps1, ps2, (
size_t)length);
24865 return (equals == Py_EQ) ? (result == 0) : (result != 0);
24867 }
else if ((s1 == Py_None) & PyBytes_CheckExact(s2)) {
24868 return (equals == Py_NE);
24869 }
else if ((s2 == Py_None) & PyBytes_CheckExact(s1)) {
24870 return (equals == Py_NE);
24873 PyObject* py_result = PyObject_RichCompare(s1, s2, equals);
24876 result = __Pyx_PyObject_IsTrue(py_result);
24877 Py_DECREF(py_result);
24884 static CYTHON_INLINE
int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2,
int equals) {
24885 #if CYTHON_COMPILING_IN_PYPY
24886 return PyObject_RichCompareBool(s1, s2, equals);
24888 #if PY_MAJOR_VERSION < 3
24889 PyObject* owned_ref = NULL;
24891 int s1_is_unicode, s2_is_unicode;
24895 s1_is_unicode = PyUnicode_CheckExact(s1);
24896 s2_is_unicode = PyUnicode_CheckExact(s2);
24897 #if PY_MAJOR_VERSION < 3
24898 if ((s1_is_unicode & (!s2_is_unicode)) && PyString_CheckExact(s2)) {
24899 owned_ref = PyUnicode_FromObject(s2);
24900 if (unlikely(!owned_ref))
24904 }
else if ((s2_is_unicode & (!s1_is_unicode)) && PyString_CheckExact(s1)) {
24905 owned_ref = PyUnicode_FromObject(s1);
24906 if (unlikely(!owned_ref))
24910 }
else if (((!s2_is_unicode) & (!s1_is_unicode))) {
24911 return __Pyx_PyBytes_Equals(s1, s2, equals);
24914 if (s1_is_unicode & s2_is_unicode) {
24917 void *data1, *data2;
24918 if (unlikely(__Pyx_PyUnicode_READY(s1) < 0) || unlikely(__Pyx_PyUnicode_READY(s2) < 0))
24920 length = __Pyx_PyUnicode_GET_LENGTH(s1);
24921 if (length != __Pyx_PyUnicode_GET_LENGTH(s2)) {
24924 #if CYTHON_USE_UNICODE_INTERNALS
24926 Py_hash_t hash1, hash2;
24927 #if CYTHON_PEP393_ENABLED
24928 hash1 = ((PyASCIIObject*)s1)->hash;
24929 hash2 = ((PyASCIIObject*)s2)->hash;
24931 hash1 = ((PyUnicodeObject*)s1)->hash;
24932 hash2 = ((PyUnicodeObject*)s2)->hash;
24934 if (hash1 != hash2 && hash1 != -1 && hash2 != -1) {
24939 kind = __Pyx_PyUnicode_KIND(s1);
24940 if (kind != __Pyx_PyUnicode_KIND(s2)) {
24943 data1 = __Pyx_PyUnicode_DATA(s1);
24944 data2 = __Pyx_PyUnicode_DATA(s2);
24945 if (__Pyx_PyUnicode_READ(kind, data1, 0) != __Pyx_PyUnicode_READ(kind, data2, 0)) {
24947 }
else if (length == 1) {
24950 int result = memcmp(data1, data2, (
size_t)(length * kind));
24951 #if PY_MAJOR_VERSION < 3
24952 Py_XDECREF(owned_ref);
24954 return (equals == Py_EQ) ? (result == 0) : (result != 0);
24956 }
else if ((s1 == Py_None) & s2_is_unicode) {
24958 }
else if ((s2 == Py_None) & s1_is_unicode) {
24962 PyObject* py_result = PyObject_RichCompare(s1, s2, equals);
24963 #if PY_MAJOR_VERSION < 3
24964 Py_XDECREF(owned_ref);
24968 result = __Pyx_PyObject_IsTrue(py_result);
24969 Py_DECREF(py_result);
24973 #if PY_MAJOR_VERSION < 3
24974 Py_XDECREF(owned_ref);
24976 return (equals == Py_EQ);
24978 #if PY_MAJOR_VERSION < 3
24979 Py_XDECREF(owned_ref);
24981 return (equals == Py_NE);
24986 static CYTHON_INLINE Py_ssize_t __Pyx_div_Py_ssize_t(Py_ssize_t a, Py_ssize_t b) {
24987 Py_ssize_t
q = a / b;
24988 Py_ssize_t
r = a -
q*b;
24989 q -= ((
r != 0) & ((
r ^ b) < 0));
24994 static CYTHON_INLINE PyObject *__Pyx_GetAttr(PyObject *o, PyObject *
n) {
24995 #if CYTHON_USE_TYPE_SLOTS
24996 #if PY_MAJOR_VERSION >= 3
24997 if (likely(PyUnicode_Check(
n)))
24999 if (likely(PyString_Check(
n)))
25001 return __Pyx_PyObject_GetAttrStr(o,
n);
25003 return PyObject_GetAttr(o,
n);
25007 static PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j) {
25009 if (!j)
return NULL;
25010 r = PyObject_GetItem(o, j);
25014 static CYTHON_INLINE PyObject *__Pyx_GetItemInt_List_Fast(PyObject *o, Py_ssize_t i,
25015 CYTHON_NCP_UNUSED
int wraparound,
25016 CYTHON_NCP_UNUSED
int boundscheck) {
25017 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
25018 Py_ssize_t wrapped_i = i;
25019 if (wraparound & unlikely(i < 0)) {
25020 wrapped_i += PyList_GET_SIZE(o);
25022 if ((!boundscheck) || likely(__Pyx_is_valid_index(wrapped_i, PyList_GET_SIZE(o)))) {
25023 PyObject *
r = PyList_GET_ITEM(o, wrapped_i);
25027 return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i));
25029 return PySequence_GetItem(o, i);
25032 static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize_t i,
25033 CYTHON_NCP_UNUSED
int wraparound,
25034 CYTHON_NCP_UNUSED
int boundscheck) {
25035 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
25036 Py_ssize_t wrapped_i = i;
25037 if (wraparound & unlikely(i < 0)) {
25038 wrapped_i += PyTuple_GET_SIZE(o);
25040 if ((!boundscheck) || likely(__Pyx_is_valid_index(wrapped_i, PyTuple_GET_SIZE(o)))) {
25041 PyObject *
r = PyTuple_GET_ITEM(o, wrapped_i);
25045 return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i));
25047 return PySequence_GetItem(o, i);
25050 static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i,
int is_list,
25051 CYTHON_NCP_UNUSED
int wraparound,
25052 CYTHON_NCP_UNUSED
int boundscheck) {
25053 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS && CYTHON_USE_TYPE_SLOTS
25054 if (is_list || PyList_CheckExact(o)) {
25055 Py_ssize_t
n = ((!wraparound) | likely(i >= 0)) ? i : i + PyList_GET_SIZE(o);
25056 if ((!boundscheck) || (likely(__Pyx_is_valid_index(
n, PyList_GET_SIZE(o))))) {
25057 PyObject *
r = PyList_GET_ITEM(o,
n);
25062 else if (PyTuple_CheckExact(o)) {
25063 Py_ssize_t
n = ((!wraparound) | likely(i >= 0)) ? i : i + PyTuple_GET_SIZE(o);
25064 if ((!boundscheck) || likely(__Pyx_is_valid_index(
n, PyTuple_GET_SIZE(o)))) {
25065 PyObject *
r = PyTuple_GET_ITEM(o,
n);
25070 PySequenceMethods *m = Py_TYPE(o)->tp_as_sequence;
25071 if (likely(m && m->sq_item)) {
25072 if (wraparound && unlikely(i < 0) && likely(m->sq_length)) {
25073 Py_ssize_t l = m->sq_length(o);
25074 if (likely(l >= 0)) {
25077 if (!PyErr_ExceptionMatches(PyExc_OverflowError))
25082 return m->sq_item(o, i);
25086 if (is_list || PySequence_Check(o)) {
25087 return PySequence_GetItem(o, i);
25090 return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i));
25094 #if CYTHON_USE_TYPE_SLOTS
25095 static PyObject *__Pyx_PyObject_GetIndex(PyObject *obj, PyObject* index) {
25097 Py_ssize_t key_value;
25098 PySequenceMethods *m = Py_TYPE(obj)->tp_as_sequence;
25099 if (unlikely(!(m && m->sq_item))) {
25100 PyErr_Format(PyExc_TypeError,
"'%.200s' object is not subscriptable", Py_TYPE(obj)->tp_name);
25103 key_value = __Pyx_PyIndex_AsSsize_t(index);
25104 if (likely(key_value != -1 || !(runerr = PyErr_Occurred()))) {
25105 return __Pyx_GetItemInt_Fast(obj, key_value, 0, 1, 1);
25107 if (PyErr_GivenExceptionMatches(runerr, PyExc_OverflowError)) {
25109 PyErr_Format(PyExc_IndexError,
"cannot fit '%.200s' into an index-sized integer", Py_TYPE(index)->tp_name);
25113 static PyObject *__Pyx_PyObject_GetItem(PyObject *obj, PyObject* key) {
25114 PyMappingMethods *m = Py_TYPE(obj)->tp_as_mapping;
25115 if (likely(m && m->mp_subscript)) {
25116 return m->mp_subscript(obj, key);
25118 return __Pyx_PyObject_GetIndex(obj, key);
25123 static CYTHON_INLINE PyObject* __Pyx_decode_c_string(
25124 const char* cstring, Py_ssize_t start, Py_ssize_t stop,
25125 const char* encoding,
const char* errors,
25126 PyObject* (*decode_func)(
const char *
s, Py_ssize_t size,
const char *errors)) {
25128 if (unlikely((start < 0) | (stop < 0))) {
25129 size_t slen = strlen(cstring);
25130 if (unlikely(slen > (
size_t) PY_SSIZE_T_MAX)) {
25131 PyErr_SetString(PyExc_OverflowError,
25132 "c-string too long to convert to Python");
25135 length = (Py_ssize_t) slen;
25144 if (unlikely(stop <= start))
25145 return __Pyx_NewRef(__pyx_empty_unicode);
25146 length = stop - start;
25149 return decode_func(cstring, length, errors);
25151 return PyUnicode_Decode(cstring, length, encoding, errors);
25156 static PyObject *__Pyx_GetAttr3Default(PyObject *d) {
25157 __Pyx_PyThreadState_declare
25158 __Pyx_PyThreadState_assign
25159 if (unlikely(!__Pyx_PyErr_ExceptionMatches(PyExc_AttributeError)))
25161 __Pyx_PyErr_Clear();
25165 static CYTHON_INLINE PyObject *__Pyx_GetAttr3(PyObject *o, PyObject *
n, PyObject *d) {
25166 PyObject *
r = __Pyx_GetAttr(o,
n);
25167 return (likely(
r)) ?
r : __Pyx_GetAttr3Default(d);
25171 static CYTHON_INLINE
void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected) {
25172 PyErr_Format(PyExc_ValueError,
25173 "too many values to unpack (expected %" CYTHON_FORMAT_SSIZE_T
"d)", expected);
25177 static CYTHON_INLINE
void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index) {
25178 PyErr_Format(PyExc_ValueError,
25179 "need more than %" CYTHON_FORMAT_SSIZE_T
"d value%.1s to unpack",
25180 index, (index == 1) ?
"" :
"s");
25184 static CYTHON_INLINE
void __Pyx_RaiseNoneNotIterableError(
void) {
25185 PyErr_SetString(PyExc_TypeError,
"'NoneType' object is not iterable");
25189 static CYTHON_INLINE
int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type) {
25190 if (unlikely(!type)) {
25191 PyErr_SetString(PyExc_SystemError,
"Missing type object");
25194 if (likely(__Pyx_TypeCheck(obj, type)))
25196 PyErr_Format(PyExc_TypeError,
"Cannot convert %.200s to %.200s",
25197 Py_TYPE(obj)->tp_name, type->tp_name);
25202 #if CYTHON_FAST_THREAD_STATE
25203 static CYTHON_INLINE
void __Pyx__ExceptionSwap(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) {
25204 PyObject *tmp_type, *tmp_value, *tmp_tb;
25205 #if CYTHON_USE_EXC_INFO_STACK
25206 _PyErr_StackItem *exc_info = tstate->exc_info;
25207 tmp_type = exc_info->exc_type;
25208 tmp_value = exc_info->exc_value;
25209 tmp_tb = exc_info->exc_traceback;
25210 exc_info->exc_type = *type;
25211 exc_info->exc_value = *value;
25212 exc_info->exc_traceback = *tb;
25214 tmp_type = tstate->exc_type;
25215 tmp_value = tstate->exc_value;
25216 tmp_tb = tstate->exc_traceback;
25217 tstate->exc_type = *type;
25218 tstate->exc_value = *value;
25219 tstate->exc_traceback = *tb;
25222 *value = tmp_value;
25226 static CYTHON_INLINE
void __Pyx_ExceptionSwap(PyObject **type, PyObject **value, PyObject **tb) {
25227 PyObject *tmp_type, *tmp_value, *tmp_tb;
25228 PyErr_GetExcInfo(&tmp_type, &tmp_value, &tmp_tb);
25229 PyErr_SetExcInfo(*type, *value, *tb);
25231 *value = tmp_value;
25237 static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list,
int level) {
25238 PyObject *empty_list = 0;
25239 PyObject *module = 0;
25240 PyObject *global_dict = 0;
25241 PyObject *empty_dict = 0;
25243 #if PY_MAJOR_VERSION < 3
25244 PyObject *py_import;
25245 py_import = __Pyx_PyObject_GetAttrStr(__pyx_b, __pyx_n_s_import);
25252 empty_list = PyList_New(0);
25257 global_dict = PyModule_GetDict(__pyx_m);
25260 empty_dict = PyDict_New();
25264 #if PY_MAJOR_VERSION >= 3
25266 if ((1) && (strchr(__Pyx_MODULE_NAME,
'.'))) {
25267 module = PyImport_ImportModuleLevelObject(
25268 name, global_dict, empty_dict, list, 1);
25270 if (!PyErr_ExceptionMatches(PyExc_ImportError))
25279 #if PY_MAJOR_VERSION < 3
25280 PyObject *py_level = PyInt_FromLong(level);
25283 module = PyObject_CallFunctionObjArgs(py_import,
25284 name, global_dict, empty_dict, list, py_level, (PyObject *)NULL);
25285 Py_DECREF(py_level);
25287 module = PyImport_ImportModuleLevelObject(
25288 name, global_dict, empty_dict, list, level);
25293 #if PY_MAJOR_VERSION < 3
25294 Py_XDECREF(py_import);
25296 Py_XDECREF(empty_list);
25297 Py_XDECREF(empty_dict);
25302 #if CYTHON_COMPILING_IN_CPYTHON
25303 static int __Pyx_InBases(PyTypeObject *a, PyTypeObject *b) {
25309 return b == &PyBaseObject_Type;
25311 static CYTHON_INLINE
int __Pyx_IsSubtype(PyTypeObject *a, PyTypeObject *b) {
25313 if (a == b)
return 1;
25317 n = PyTuple_GET_SIZE(mro);
25318 for (i = 0; i <
n; i++) {
25319 if (PyTuple_GET_ITEM(mro, i) == (PyObject *)b)
25324 return __Pyx_InBases(a, b);
25326 #if PY_MAJOR_VERSION == 2
25327 static int __Pyx_inner_PyErr_GivenExceptionMatches2(PyObject *err, PyObject* exc_type1, PyObject* exc_type2) {
25328 PyObject *exception, *value, *tb;
25330 __Pyx_PyThreadState_declare
25331 __Pyx_PyThreadState_assign
25332 __Pyx_ErrFetch(&exception, &value, &tb);
25333 res = exc_type1 ? PyObject_IsSubclass(err, exc_type1) : 0;
25334 if (unlikely(res == -1)) {
25335 PyErr_WriteUnraisable(err);
25339 res = PyObject_IsSubclass(err, exc_type2);
25340 if (unlikely(res == -1)) {
25341 PyErr_WriteUnraisable(err);
25345 __Pyx_ErrRestore(exception, value, tb);
25349 static CYTHON_INLINE
int __Pyx_inner_PyErr_GivenExceptionMatches2(PyObject *err, PyObject* exc_type1, PyObject *exc_type2) {
25350 int res = exc_type1 ? __Pyx_IsSubtype((PyTypeObject*)err, (PyTypeObject*)exc_type1) : 0;
25352 res = __Pyx_IsSubtype((PyTypeObject*)err, (PyTypeObject*)exc_type2);
25357 static int __Pyx_PyErr_GivenExceptionMatchesTuple(PyObject *exc_type, PyObject *tuple) {
25359 assert(PyExceptionClass_Check(exc_type));
25360 n = PyTuple_GET_SIZE(tuple);
25361 #if PY_MAJOR_VERSION >= 3
25362 for (i=0; i<
n; i++) {
25363 if (exc_type == PyTuple_GET_ITEM(tuple, i))
return 1;
25366 for (i=0; i<
n; i++) {
25367 PyObject *t = PyTuple_GET_ITEM(tuple, i);
25368 #if PY_MAJOR_VERSION < 3
25369 if (likely(exc_type == t))
return 1;
25371 if (likely(PyExceptionClass_Check(t))) {
25372 if (__Pyx_inner_PyErr_GivenExceptionMatches2(exc_type, NULL, t))
return 1;
25378 static CYTHON_INLINE
int __Pyx_PyErr_GivenExceptionMatches(PyObject *err, PyObject* exc_type) {
25379 if (likely(err == exc_type))
return 1;
25380 if (likely(PyExceptionClass_Check(err))) {
25381 if (likely(PyExceptionClass_Check(exc_type))) {
25382 return __Pyx_inner_PyErr_GivenExceptionMatches2(err, NULL, exc_type);
25383 }
else if (likely(PyTuple_Check(exc_type))) {
25384 return __Pyx_PyErr_GivenExceptionMatchesTuple(err, exc_type);
25388 return PyErr_GivenExceptionMatches(err, exc_type);
25390 static CYTHON_INLINE
int __Pyx_PyErr_GivenExceptionMatches2(PyObject *err, PyObject *exc_type1, PyObject *exc_type2) {
25391 assert(PyExceptionClass_Check(exc_type1));
25392 assert(PyExceptionClass_Check(exc_type2));
25393 if (likely(err == exc_type1 || err == exc_type2))
return 1;
25394 if (likely(PyExceptionClass_Check(err))) {
25395 return __Pyx_inner_PyErr_GivenExceptionMatches2(err, exc_type1, exc_type2);
25397 return (PyErr_GivenExceptionMatches(err, exc_type1) || PyErr_GivenExceptionMatches(err, exc_type2));
25402 static CYTHON_INLINE
void __Pyx_RaiseUnboundLocalError(
const char *varname) {
25403 PyErr_Format(PyExc_UnboundLocalError,
"local variable '%s' referenced before assignment", varname);
25407 static CYTHON_INLINE
long __Pyx_div_long(
long a,
long b) {
25410 q -= ((
r != 0) & ((
r ^ b) < 0));
25415 static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name) {
25416 PyObject* value = __Pyx_PyObject_GetAttrStr(module, name);
25417 if (unlikely(!value) && PyErr_ExceptionMatches(PyExc_AttributeError)) {
25418 PyErr_Format(PyExc_ImportError,
25419 #
if PY_MAJOR_VERSION < 3
25420 "cannot import name %.230s", PyString_AS_STRING(name));
25422 "cannot import name %S", name);
25429 static CYTHON_INLINE
int __Pyx_HasAttr(PyObject *o, PyObject *
n) {
25431 if (unlikely(!__Pyx_PyBaseString_Check(
n))) {
25432 PyErr_SetString(PyExc_TypeError,
25433 "hasattr(): attribute name must be string");
25436 r = __Pyx_GetAttr(o,
n);
25437 if (unlikely(!
r)) {
25447 #if !CYTHON_COMPILING_IN_CPYTHON
25448 static CYTHON_INLINE PyObject* __Pyx_PyBytes_Join(PyObject* sep, PyObject* values) {
25449 return PyObject_CallMethodObjArgs(sep, __pyx_n_s_join, values, NULL);
25454 #if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000
25455 static PyObject *__Pyx_RaiseGenericGetAttributeError(PyTypeObject *tp, PyObject *attr_name) {
25456 PyErr_Format(PyExc_AttributeError,
25457 #
if PY_MAJOR_VERSION >= 3
25458 "'%.50s' object has no attribute '%U'",
25459 tp->tp_name, attr_name);
25461 "'%.50s' object has no attribute '%.400s'",
25462 tp->tp_name, PyString_AS_STRING(attr_name));
25466 static CYTHON_INLINE PyObject* __Pyx_PyObject_GenericGetAttrNoDict(PyObject* obj, PyObject* attr_name) {
25468 PyTypeObject *tp = Py_TYPE(obj);
25469 if (unlikely(!PyString_Check(attr_name))) {
25470 return PyObject_GenericGetAttr(obj, attr_name);
25472 assert(!tp->tp_dictoffset);
25473 descr = _PyType_Lookup(tp, attr_name);
25474 if (unlikely(!descr)) {
25475 return __Pyx_RaiseGenericGetAttributeError(tp, attr_name);
25478 #if PY_MAJOR_VERSION < 3
25479 if (likely(PyType_HasFeature(Py_TYPE(descr), Py_TPFLAGS_HAVE_CLASS)))
25482 descrgetfunc
f = Py_TYPE(descr)->tp_descr_get;
25484 PyObject *res =
f(descr, obj, (PyObject *)tp);
25494 #if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000
25495 static PyObject* __Pyx_PyObject_GenericGetAttr(PyObject* obj, PyObject* attr_name) {
25496 if (unlikely(Py_TYPE(obj)->tp_dictoffset)) {
25497 return PyObject_GenericGetAttr(obj, attr_name);
25499 return __Pyx_PyObject_GenericGetAttrNoDict(obj, attr_name);
25504 static int __Pyx_SetVtable(PyObject *dict,
void *vtable) {
25505 #if PY_VERSION_HEX >= 0x02070000
25506 PyObject *ob = PyCapsule_New(vtable, 0, 0);
25508 PyObject *ob = PyCObject_FromVoidPtr(vtable, 0);
25512 if (PyDict_SetItem(dict, __pyx_n_s_pyx_vtable, ob) < 0)
25522 static void __Pyx_PyObject_GetAttrStr_ClearAttributeError(
void) {
25523 __Pyx_PyThreadState_declare
25524 __Pyx_PyThreadState_assign
25525 if (likely(__Pyx_PyErr_ExceptionMatches(PyExc_AttributeError)))
25526 __Pyx_PyErr_Clear();
25528 static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStrNoError(PyObject* obj, PyObject* attr_name) {
25530 #if CYTHON_COMPILING_IN_CPYTHON && CYTHON_USE_TYPE_SLOTS && PY_VERSION_HEX >= 0x030700B1
25531 PyTypeObject* tp = Py_TYPE(obj);
25532 if (likely(tp->tp_getattro == PyObject_GenericGetAttr)) {
25533 return _PyObject_GenericGetAttrWithDict(obj, attr_name, NULL, 1);
25536 result = __Pyx_PyObject_GetAttrStr(obj, attr_name);
25537 if (unlikely(!result)) {
25538 __Pyx_PyObject_GetAttrStr_ClearAttributeError();
25544 static int __Pyx_setup_reduce_is_named(PyObject* meth, PyObject* name) {
25546 PyObject *name_attr;
25547 name_attr = __Pyx_PyObject_GetAttrStr(meth, __pyx_n_s_name_2);
25548 if (likely(name_attr)) {
25549 ret = PyObject_RichCompareBool(name_attr, name, Py_EQ);
25553 if (unlikely(ret < 0)) {
25557 Py_XDECREF(name_attr);
25560 static int __Pyx_setup_reduce(PyObject* type_obj) {
25562 PyObject *object_reduce = NULL;
25563 PyObject *object_getstate = NULL;
25564 PyObject *object_reduce_ex = NULL;
25565 PyObject *reduce = NULL;
25566 PyObject *reduce_ex = NULL;
25567 PyObject *reduce_cython = NULL;
25568 PyObject *setstate = NULL;
25569 PyObject *setstate_cython = NULL;
25570 PyObject *getstate = NULL;
25571 #if CYTHON_USE_PYTYPE_LOOKUP
25572 getstate = _PyType_Lookup((PyTypeObject*)type_obj, __pyx_n_s_getstate);
25574 getstate = __Pyx_PyObject_GetAttrStrNoError(type_obj, __pyx_n_s_getstate);
25575 if (!getstate && PyErr_Occurred()) {
25580 #if CYTHON_USE_PYTYPE_LOOKUP
25581 object_getstate = _PyType_Lookup(&PyBaseObject_Type, __pyx_n_s_getstate);
25583 object_getstate = __Pyx_PyObject_GetAttrStrNoError((PyObject*)&PyBaseObject_Type, __pyx_n_s_getstate);
25584 if (!object_getstate && PyErr_Occurred()) {
25588 if (object_getstate != getstate) {
25592 #if CYTHON_USE_PYTYPE_LOOKUP
25593 object_reduce_ex = _PyType_Lookup(&PyBaseObject_Type, __pyx_n_s_reduce_ex);
if (!object_reduce_ex)
goto __PYX_BAD;
25595 object_reduce_ex = __Pyx_PyObject_GetAttrStr((PyObject*)&PyBaseObject_Type, __pyx_n_s_reduce_ex);
if (!object_reduce_ex)
goto __PYX_BAD;
25597 reduce_ex = __Pyx_PyObject_GetAttrStr(type_obj, __pyx_n_s_reduce_ex);
if (unlikely(!reduce_ex))
goto __PYX_BAD;
25598 if (reduce_ex == object_reduce_ex) {
25599 #if CYTHON_USE_PYTYPE_LOOKUP
25600 object_reduce = _PyType_Lookup(&PyBaseObject_Type, __pyx_n_s_reduce);
if (!object_reduce)
goto __PYX_BAD;
25602 object_reduce = __Pyx_PyObject_GetAttrStr((PyObject*)&PyBaseObject_Type, __pyx_n_s_reduce);
if (!object_reduce)
goto __PYX_BAD;
25604 reduce = __Pyx_PyObject_GetAttrStr(type_obj, __pyx_n_s_reduce);
if (unlikely(!reduce))
goto __PYX_BAD;
25605 if (reduce == object_reduce || __Pyx_setup_reduce_is_named(reduce, __pyx_n_s_reduce_cython)) {
25606 reduce_cython = __Pyx_PyObject_GetAttrStrNoError(type_obj, __pyx_n_s_reduce_cython);
25607 if (likely(reduce_cython)) {
25608 ret = PyDict_SetItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_reduce, reduce_cython);
if (unlikely(ret < 0))
goto __PYX_BAD;
25609 ret = PyDict_DelItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_reduce_cython);
if (unlikely(ret < 0))
goto __PYX_BAD;
25610 }
else if (reduce == object_reduce || PyErr_Occurred()) {
25613 setstate = __Pyx_PyObject_GetAttrStr(type_obj, __pyx_n_s_setstate);
25614 if (!setstate) PyErr_Clear();
25615 if (!setstate || __Pyx_setup_reduce_is_named(setstate, __pyx_n_s_setstate_cython)) {
25616 setstate_cython = __Pyx_PyObject_GetAttrStrNoError(type_obj, __pyx_n_s_setstate_cython);
25617 if (likely(setstate_cython)) {
25618 ret = PyDict_SetItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_setstate, setstate_cython);
if (unlikely(ret < 0))
goto __PYX_BAD;
25619 ret = PyDict_DelItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_setstate_cython);
if (unlikely(ret < 0))
goto __PYX_BAD;
25620 }
else if (!setstate || PyErr_Occurred()) {
25624 PyType_Modified((PyTypeObject*)type_obj);
25629 if (!PyErr_Occurred())
25630 PyErr_Format(PyExc_RuntimeError,
"Unable to initialize pickling for %s", ((PyTypeObject*)type_obj)->tp_name);
25633 #if !CYTHON_USE_PYTYPE_LOOKUP
25634 Py_XDECREF(object_reduce);
25635 Py_XDECREF(object_reduce_ex);
25636 Py_XDECREF(object_getstate);
25637 Py_XDECREF(getstate);
25639 Py_XDECREF(reduce);
25640 Py_XDECREF(reduce_ex);
25641 Py_XDECREF(reduce_cython);
25642 Py_XDECREF(setstate);
25643 Py_XDECREF(setstate_cython);
25648 #ifndef __PYX_HAVE_RT_ImportType
25649 #define __PYX_HAVE_RT_ImportType
25650 static PyTypeObject *__Pyx_ImportType(PyObject *module,
const char *module_name,
const char *class_name,
25651 size_t size,
enum __Pyx_ImportType_CheckSize check_size)
25653 PyObject *result = 0;
25655 Py_ssize_t basicsize;
25656 #ifdef Py_LIMITED_API
25657 PyObject *py_basicsize;
25659 result = PyObject_GetAttrString(module, class_name);
25662 if (!PyType_Check(result)) {
25663 PyErr_Format(PyExc_TypeError,
25664 "%.200s.%.200s is not a type object",
25665 module_name, class_name);
25668 #ifndef Py_LIMITED_API
25669 basicsize = ((PyTypeObject *)result)->tp_basicsize;
25671 py_basicsize = PyObject_GetAttrString(result,
"__basicsize__");
25674 basicsize = PyLong_AsSsize_t(py_basicsize);
25675 Py_DECREF(py_basicsize);
25677 if (basicsize == (Py_ssize_t)-1 && PyErr_Occurred())
25680 if ((
size_t)basicsize < size) {
25681 PyErr_Format(PyExc_ValueError,
25682 "%.200s.%.200s size changed, may indicate binary incompatibility. "
25683 "Expected %zd from C header, got %zd from PyObject",
25684 module_name, class_name, size, basicsize);
25687 if (check_size == __Pyx_ImportType_CheckSize_Error && (
size_t)basicsize != size) {
25688 PyErr_Format(PyExc_ValueError,
25689 "%.200s.%.200s size changed, may indicate binary incompatibility. "
25690 "Expected %zd from C header, got %zd from PyObject",
25691 module_name, class_name, size, basicsize);
25694 else if (check_size == __Pyx_ImportType_CheckSize_Warn && (
size_t)basicsize > size) {
25695 PyOS_snprintf(warning,
sizeof(warning),
25696 "%s.%s size changed, may indicate binary incompatibility. "
25697 "Expected %zd from C header, got %zd from PyObject",
25698 module_name, class_name, size, basicsize);
25699 if (PyErr_WarnEx(NULL, warning, 0) < 0)
goto bad;
25701 return (PyTypeObject *)result;
25703 Py_XDECREF(result);
25709 #ifndef CYTHON_CLINE_IN_TRACEBACK
25710 static int __Pyx_CLineForTraceback(CYTHON_NCP_UNUSED PyThreadState *tstate,
int c_line) {
25711 PyObject *use_cline;
25712 PyObject *ptype, *pvalue, *ptraceback;
25713 #if CYTHON_COMPILING_IN_CPYTHON
25714 PyObject **cython_runtime_dict;
25716 if (unlikely(!__pyx_cython_runtime)) {
25719 __Pyx_ErrFetchInState(tstate, &ptype, &pvalue, &ptraceback);
25720 #if CYTHON_COMPILING_IN_CPYTHON
25721 cython_runtime_dict = _PyObject_GetDictPtr(__pyx_cython_runtime);
25722 if (likely(cython_runtime_dict)) {
25723 __PYX_PY_DICT_LOOKUP_IF_MODIFIED(
25724 use_cline, *cython_runtime_dict,
25725 __Pyx_PyDict_GetItemStr(*cython_runtime_dict, __pyx_n_s_cline_in_traceback))
25729 PyObject *use_cline_obj = __Pyx_PyObject_GetAttrStr(__pyx_cython_runtime, __pyx_n_s_cline_in_traceback);
25730 if (use_cline_obj) {
25731 use_cline = PyObject_Not(use_cline_obj) ? Py_False : Py_True;
25732 Py_DECREF(use_cline_obj);
25740 (void) PyObject_SetAttr(__pyx_cython_runtime, __pyx_n_s_cline_in_traceback, Py_False);
25742 else if (use_cline == Py_False || (use_cline != Py_True && PyObject_Not(use_cline) != 0)) {
25745 __Pyx_ErrRestoreInState(tstate, ptype, pvalue, ptraceback);
25751 static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries,
int count,
int code_line) {
25752 int start = 0, mid = 0, end = count - 1;
25753 if (end >= 0 && code_line > entries[end].code_line) {
25756 while (start < end) {
25757 mid = start + (end - start) / 2;
25758 if (code_line < entries[mid].code_line) {
25760 }
else if (code_line > entries[mid].code_line) {
25766 if (code_line <= entries[mid].code_line) {
25772 static PyCodeObject *__pyx_find_code_object(
int code_line) {
25773 PyCodeObject* code_object;
25775 if (unlikely(!code_line) || unlikely(!__pyx_code_cache.entries)) {
25778 pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line);
25779 if (unlikely(
pos >= __pyx_code_cache.count) || unlikely(__pyx_code_cache.entries[
pos].code_line != code_line)) {
25782 code_object = __pyx_code_cache.entries[
pos].code_object;
25783 Py_INCREF(code_object);
25784 return code_object;
25786 static void __pyx_insert_code_object(
int code_line, PyCodeObject* code_object) {
25788 __Pyx_CodeObjectCacheEntry* entries = __pyx_code_cache.entries;
25789 if (unlikely(!code_line)) {
25792 if (unlikely(!entries)) {
25793 entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Malloc(64*
sizeof(__Pyx_CodeObjectCacheEntry));
25794 if (likely(entries)) {
25795 __pyx_code_cache.entries = entries;
25796 __pyx_code_cache.max_count = 64;
25797 __pyx_code_cache.count = 1;
25798 entries[0].code_line = code_line;
25799 entries[0].code_object = code_object;
25800 Py_INCREF(code_object);
25804 pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line);
25805 if ((
pos < __pyx_code_cache.count) && unlikely(__pyx_code_cache.entries[
pos].code_line == code_line)) {
25806 PyCodeObject* tmp = entries[
pos].code_object;
25807 entries[
pos].code_object = code_object;
25811 if (__pyx_code_cache.count == __pyx_code_cache.max_count) {
25812 int new_max = __pyx_code_cache.max_count + 64;
25813 entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Realloc(
25814 __pyx_code_cache.entries, ((
size_t)new_max) *
sizeof(__Pyx_CodeObjectCacheEntry));
25815 if (unlikely(!entries)) {
25818 __pyx_code_cache.entries = entries;
25819 __pyx_code_cache.max_count = new_max;
25821 for (i=__pyx_code_cache.count; i>
pos; i--) {
25822 entries[i] = entries[i-1];
25824 entries[
pos].code_line = code_line;
25825 entries[
pos].code_object = code_object;
25826 __pyx_code_cache.count++;
25827 Py_INCREF(code_object);
25831 #include "compile.h"
25832 #include "frameobject.h"
25833 #include "traceback.h"
25834 #if PY_VERSION_HEX >= 0x030b00a6
25835 #ifndef Py_BUILD_CORE
25836 #define Py_BUILD_CORE 1
25838 #include "internal/pycore_frame.h"
25840 static PyCodeObject* __Pyx_CreateCodeObjectForTraceback(
25841 const char *funcname,
int c_line,
25842 int py_line,
const char *filename) {
25843 PyCodeObject *py_code = NULL;
25844 PyObject *py_funcname = NULL;
25845 #if PY_MAJOR_VERSION < 3
25846 PyObject *py_srcfile = NULL;
25847 py_srcfile = PyString_FromString(filename);
25848 if (!py_srcfile)
goto bad;
25851 #if PY_MAJOR_VERSION < 3
25852 py_funcname = PyString_FromFormat(
"%s (%s:%d)", funcname, __pyx_cfilenm, c_line);
25853 if (!py_funcname)
goto bad;
25855 py_funcname = PyUnicode_FromFormat(
"%s (%s:%d)", funcname, __pyx_cfilenm, c_line);
25856 if (!py_funcname)
goto bad;
25857 funcname = PyUnicode_AsUTF8(py_funcname);
25858 if (!funcname)
goto bad;
25862 #if PY_MAJOR_VERSION < 3
25863 py_funcname = PyString_FromString(funcname);
25864 if (!py_funcname)
goto bad;
25867 #if PY_MAJOR_VERSION < 3
25868 py_code = __Pyx_PyCode_New(
25885 Py_DECREF(py_srcfile);
25887 py_code = PyCode_NewEmpty(filename, funcname, py_line);
25889 Py_XDECREF(py_funcname);
25892 Py_XDECREF(py_funcname);
25893 #if PY_MAJOR_VERSION < 3
25894 Py_XDECREF(py_srcfile);
25898 static void __Pyx_AddTraceback(
const char *funcname,
int c_line,
25899 int py_line,
const char *filename) {
25900 PyCodeObject *py_code = 0;
25901 PyFrameObject *py_frame = 0;
25902 PyThreadState *tstate = __Pyx_PyThreadState_Current;
25903 PyObject *ptype, *pvalue, *ptraceback;
25905 c_line = __Pyx_CLineForTraceback(tstate, c_line);
25907 py_code = __pyx_find_code_object(c_line ? -c_line : py_line);
25909 __Pyx_ErrFetchInState(tstate, &ptype, &pvalue, &ptraceback);
25910 py_code = __Pyx_CreateCodeObjectForTraceback(
25911 funcname, c_line, py_line, filename);
25916 Py_XDECREF(pvalue);
25917 Py_XDECREF(ptraceback);
25920 __Pyx_ErrRestoreInState(tstate, ptype, pvalue, ptraceback);
25921 __pyx_insert_code_object(c_line ? -c_line : py_line, py_code);
25923 py_frame = PyFrame_New(
25929 if (!py_frame)
goto bad;
25930 __Pyx_PyFrame_SetLineNumber(py_frame, py_line);
25931 PyTraceBack_Here(py_frame);
25933 Py_XDECREF(py_code);
25934 Py_XDECREF(py_frame);
25938 #define __PYX_VERIFY_RETURN_INT(target_type, func_type, func_value)\
25939 __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 0)
25940 #define __PYX_VERIFY_RETURN_INT_EXC(target_type, func_type, func_value)\
25941 __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 1)
25942 #define __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, exc)\
25944 func_type value = func_value;\
25945 if (sizeof(target_type) < sizeof(func_type)) {\
25946 if (unlikely(value != (func_type) (target_type) value)) {\
25947 func_type zero = 0;\
25948 if (exc && unlikely(value == (func_type)-1 && PyErr_Occurred()))\
25949 return (target_type) -1;\
25950 if (is_unsigned && unlikely(value < zero))\
25951 goto raise_neg_overflow;\
25953 goto raise_overflow;\
25956 return (target_type) value;\
25960 static CYTHON_INLINE PyObject *__pyx_memview_get_int(
const char *itemp) {
25961 return (PyObject *) __Pyx_PyInt_From_int(*(
int *) itemp);
25963 static CYTHON_INLINE
int __pyx_memview_set_int(
const char *itemp, PyObject *obj) {
25964 int value = __Pyx_PyInt_As_int(obj);
25965 if ((value == (
int)-1) && PyErr_Occurred())
25967 *(
int *) itemp = value;
25972 #if CYTHON_CCOMPLEX
25974 static CYTHON_INLINE __pyx_t_float_complex __pyx_t_float_complex_from_parts(
float x,
float y) {
25975 return ::std::complex< float >(x, y);
25978 static CYTHON_INLINE __pyx_t_float_complex __pyx_t_float_complex_from_parts(
float x,
float y) {
25979 return x + y*(__pyx_t_float_complex)_Complex_I;
25983 static CYTHON_INLINE __pyx_t_float_complex __pyx_t_float_complex_from_parts(
float x,
float y) {
25984 __pyx_t_float_complex
z;
25992 #if CYTHON_CCOMPLEX
25994 static CYTHON_INLINE
int __Pyx_c_eq_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
25995 return (a.real == b.real) && (a.imag == b.imag);
25997 static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_sum_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
25998 __pyx_t_float_complex
z;
25999 z.real = a.real + b.real;
26000 z.imag = a.imag + b.imag;
26003 static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_diff_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
26004 __pyx_t_float_complex
z;
26005 z.real = a.real - b.real;
26006 z.imag = a.imag - b.imag;
26009 static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_prod_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
26010 __pyx_t_float_complex
z;
26011 z.real = a.real * b.real - a.imag * b.imag;
26012 z.imag = a.real * b.imag + a.imag * b.real;
26016 static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_quot_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
26018 return __pyx_t_float_complex_from_parts(a.real / b.real, a.imag / b.real);
26019 }
else if (fabsf(b.real) >= fabsf(b.imag)) {
26020 if (b.real == 0 && b.imag == 0) {
26021 return __pyx_t_float_complex_from_parts(a.real / b.real, a.imag / b.imag);
26023 float r = b.imag / b.real;
26024 float s = (float)(1.0) / (b.real + b.imag *
r);
26025 return __pyx_t_float_complex_from_parts(
26026 (a.real + a.imag *
r) *
s, (a.imag - a.real *
r) *
s);
26029 float r = b.real / b.imag;
26030 float s = (float)(1.0) / (b.imag + b.real *
r);
26031 return __pyx_t_float_complex_from_parts(
26032 (a.real *
r + a.imag) *
s, (a.imag *
r - a.real) *
s);
26036 static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_quot_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
26038 return __pyx_t_float_complex_from_parts(a.real / b.real, a.imag / b.real);
26040 float denom = b.real * b.real + b.imag * b.imag;
26041 return __pyx_t_float_complex_from_parts(
26042 (a.real * b.real + a.imag * b.imag) / denom,
26043 (a.imag * b.real - a.real * b.imag) / denom);
26047 static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_neg_float(__pyx_t_float_complex a) {
26048 __pyx_t_float_complex
z;
26053 static CYTHON_INLINE
int __Pyx_c_is_zero_float(__pyx_t_float_complex a) {
26054 return (a.real == 0) && (a.imag == 0);
26056 static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_conj_float(__pyx_t_float_complex a) {
26057 __pyx_t_float_complex
z;
26063 static CYTHON_INLINE
float __Pyx_c_abs_float(__pyx_t_float_complex
z) {
26064 #if !defined(HAVE_HYPOT) || defined(_MSC_VER)
26065 return sqrtf(
z.real*
z.real +
z.imag*
z.imag);
26067 return hypotf(
z.real,
z.imag);
26070 static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_pow_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
26071 __pyx_t_float_complex
z;
26072 float r, lnr, theta, z_r, z_theta;
26073 if (b.imag == 0 && b.real == (
int)b.real) {
26075 float denom = a.real * a.real + a.imag * a.imag;
26076 a.real = a.real / denom;
26077 a.imag = -a.imag / denom;
26080 switch ((
int)b.real) {
26088 return __Pyx_c_prod_float(a, a);
26090 z = __Pyx_c_prod_float(a, a);
26091 return __Pyx_c_prod_float(
z, a);
26093 z = __Pyx_c_prod_float(a, a);
26094 return __Pyx_c_prod_float(
z,
z);
26100 }
else if (b.imag == 0) {
26101 z.real = powf(a.real, b.real);
26104 }
else if (a.real > 0) {
26109 theta = atan2f(0.0, -1.0);
26112 r = __Pyx_c_abs_float(a);
26113 theta = atan2f(a.imag, a.real);
26116 z_r = expf(lnr * b.real - theta * b.imag);
26117 z_theta = theta * b.real + lnr * b.imag;
26118 z.real = z_r * cosf(z_theta);
26119 z.imag = z_r * sinf(z_theta);
26126 #if CYTHON_CCOMPLEX
26128 static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(
double x,
double y) {
26129 return ::std::complex< double >(x, y);
26132 static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(
double x,
double y) {
26133 return x + y*(__pyx_t_double_complex)_Complex_I;
26137 static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(
double x,
double y) {
26138 __pyx_t_double_complex
z;
26146 #if CYTHON_CCOMPLEX
26148 static CYTHON_INLINE
int __Pyx_c_eq_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
26149 return (a.real == b.real) && (a.imag == b.imag);
26151 static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_sum_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
26152 __pyx_t_double_complex
z;
26153 z.real = a.real + b.real;
26154 z.imag = a.imag + b.imag;
26157 static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_diff_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
26158 __pyx_t_double_complex
z;
26159 z.real = a.real - b.real;
26160 z.imag = a.imag - b.imag;
26163 static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_prod_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
26164 __pyx_t_double_complex
z;
26165 z.real = a.real * b.real - a.imag * b.imag;
26166 z.imag = a.real * b.imag + a.imag * b.real;
26170 static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_quot_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
26172 return __pyx_t_double_complex_from_parts(a.real / b.real, a.imag / b.real);
26173 }
else if (fabs(b.real) >= fabs(b.imag)) {
26174 if (b.real == 0 && b.imag == 0) {
26175 return __pyx_t_double_complex_from_parts(a.real / b.real, a.imag / b.imag);
26177 double r = b.imag / b.real;
26178 double s = (double)(1.0) / (b.real + b.imag *
r);
26179 return __pyx_t_double_complex_from_parts(
26180 (a.real + a.imag *
r) *
s, (a.imag - a.real *
r) *
s);
26183 double r = b.real / b.imag;
26184 double s = (double)(1.0) / (b.imag + b.real *
r);
26185 return __pyx_t_double_complex_from_parts(
26186 (a.real *
r + a.imag) *
s, (a.imag *
r - a.real) *
s);
26190 static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_quot_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
26192 return __pyx_t_double_complex_from_parts(a.real / b.real, a.imag / b.real);
26194 double denom = b.real * b.real + b.imag * b.imag;
26195 return __pyx_t_double_complex_from_parts(
26196 (a.real * b.real + a.imag * b.imag) / denom,
26197 (a.imag * b.real - a.real * b.imag) / denom);
26201 static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_neg_double(__pyx_t_double_complex a) {
26202 __pyx_t_double_complex
z;
26207 static CYTHON_INLINE
int __Pyx_c_is_zero_double(__pyx_t_double_complex a) {
26208 return (a.real == 0) && (a.imag == 0);
26210 static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_conj_double(__pyx_t_double_complex a) {
26211 __pyx_t_double_complex
z;
26217 static CYTHON_INLINE
double __Pyx_c_abs_double(__pyx_t_double_complex
z) {
26218 #if !defined(HAVE_HYPOT) || defined(_MSC_VER)
26219 return sqrt(
z.real*
z.real +
z.imag*
z.imag);
26221 return hypot(
z.real,
z.imag);
26224 static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_pow_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
26225 __pyx_t_double_complex
z;
26226 double r, lnr, theta, z_r, z_theta;
26227 if (b.imag == 0 && b.real == (
int)b.real) {
26229 double denom = a.real * a.real + a.imag * a.imag;
26230 a.real = a.real / denom;
26231 a.imag = -a.imag / denom;
26234 switch ((
int)b.real) {
26242 return __Pyx_c_prod_double(a, a);
26244 z = __Pyx_c_prod_double(a, a);
26245 return __Pyx_c_prod_double(
z, a);
26247 z = __Pyx_c_prod_double(a, a);
26248 return __Pyx_c_prod_double(
z,
z);
26254 }
else if (b.imag == 0) {
26255 z.real = pow(a.real, b.real);
26258 }
else if (a.real > 0) {
26263 theta = atan2(0.0, -1.0);
26266 r = __Pyx_c_abs_double(a);
26267 theta = atan2(a.imag, a.real);
26270 z_r = exp(lnr * b.real - theta * b.imag);
26271 z_theta = theta * b.real + lnr * b.imag;
26272 z.real = z_r * cos(z_theta);
26273 z.imag = z_r * sin(z_theta);
26279 #if PY_MAJOR_VERSION < 3
26280 static int __Pyx_GetBuffer(PyObject *obj, Py_buffer *view,
int flags) {
26281 if (PyObject_CheckBuffer(obj))
return PyObject_GetBuffer(obj, view, flags);
26282 if (__Pyx_TypeCheck(obj, __pyx_array_type))
return __pyx_array_getbuffer(obj, view, flags);
26283 if (__Pyx_TypeCheck(obj, __pyx_memoryview_type))
return __pyx_memoryview_getbuffer(obj, view, flags);
26284 PyErr_Format(PyExc_TypeError,
"'%.200s' does not have the buffer interface", Py_TYPE(obj)->tp_name);
26287 static void __Pyx_ReleaseBuffer(Py_buffer *view) {
26288 PyObject *obj = view->obj;
26290 if (PyObject_CheckBuffer(obj)) {
26291 PyBuffer_Release(view);
26303 __pyx_memviewslice_is_contig(
const __Pyx_memviewslice mvs,
char order,
int ndim)
26305 int i, index, step, start;
26306 Py_ssize_t itemsize = mvs.memview->view.itemsize;
26307 if (order ==
'F') {
26314 for (i = 0; i < ndim; i++) {
26315 index = start + step * i;
26316 if (mvs.suboffsets[index] >= 0 || mvs.strides[index] != itemsize)
26318 itemsize *= mvs.shape[index];
26325 __pyx_get_array_memory_extents(__Pyx_memviewslice *slice,
26326 void **out_start,
void **out_end,
26327 int ndim,
size_t itemsize)
26331 start = end = slice->data;
26332 for (i = 0; i < ndim; i++) {
26333 Py_ssize_t stride = slice->strides[i];
26334 Py_ssize_t extent = slice->shape[i];
26336 *out_start = *out_end = start;
26340 end += stride * (extent - 1);
26342 start += stride * (extent - 1);
26345 *out_start = start;
26346 *out_end = end + itemsize;
26349 __pyx_slices_overlap(__Pyx_memviewslice *slice1,
26350 __Pyx_memviewslice *slice2,
26351 int ndim,
size_t itemsize)
26353 void *start1, *end1, *start2, *end2;
26354 __pyx_get_array_memory_extents(slice1, &start1, &end1, ndim, itemsize);
26355 __pyx_get_array_memory_extents(slice2, &start2, &end2, ndim, itemsize);
26356 return (start1 < end2) && (start2 < end1);
26360 static CYTHON_INLINE PyObject *
26361 __pyx_capsule_create(
void *p, CYTHON_UNUSED
const char *sig)
26364 #if PY_VERSION_HEX >= 0x02070000
26365 cobj = PyCapsule_New(p, sig, NULL);
26367 cobj = PyCObject_FromVoidPtr(p, NULL);
26373 static CYTHON_INLINE
int __Pyx_PyInt_As_int(PyObject *x) {
26374 #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
26375 #pragma GCC diagnostic push
26376 #pragma GCC diagnostic ignored "-Wconversion"
26378 const int neg_one = (int) -1, const_zero = (
int) 0;
26379 #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
26380 #pragma GCC diagnostic pop
26382 const int is_unsigned = neg_one > const_zero;
26383 #if PY_MAJOR_VERSION < 3
26384 if (likely(PyInt_Check(x))) {
26385 if (
sizeof(
int) <
sizeof(long)) {
26386 __PYX_VERIFY_RETURN_INT(
int,
long, PyInt_AS_LONG(x))
26388 long val = PyInt_AS_LONG(x);
26389 if (is_unsigned && unlikely(val < 0)) {
26390 goto raise_neg_overflow;
26396 if (likely(PyLong_Check(x))) {
26398 #if CYTHON_USE_PYLONG_INTERNALS
26399 const digit* digits = ((PyLongObject*)x)->ob_digit;
26400 switch (Py_SIZE(x)) {
26401 case 0:
return (
int) 0;
26402 case 1: __PYX_VERIFY_RETURN_INT(
int, digit, digits[0])
26404 if (8 *
sizeof(
int) > 1 * PyLong_SHIFT) {
26405 if (8 *
sizeof(
unsigned long) > 2 * PyLong_SHIFT) {
26406 __PYX_VERIFY_RETURN_INT(
int,
unsigned long, (((((
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
26407 }
else if (8 *
sizeof(
int) >= 2 * PyLong_SHIFT) {
26408 return (
int) (((((int)digits[1]) << PyLong_SHIFT) | (
int)digits[0]));
26413 if (8 *
sizeof(
int) > 2 * PyLong_SHIFT) {
26414 if (8 *
sizeof(
unsigned long) > 3 * PyLong_SHIFT) {
26415 __PYX_VERIFY_RETURN_INT(
int,
unsigned long, (((((((
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
26416 }
else if (8 *
sizeof(
int) >= 3 * PyLong_SHIFT) {
26417 return (
int) (((((((int)digits[2]) << PyLong_SHIFT) | (
int)digits[1]) << PyLong_SHIFT) | (int)digits[0]));
26422 if (8 *
sizeof(
int) > 3 * PyLong_SHIFT) {
26423 if (8 *
sizeof(
unsigned long) > 4 * PyLong_SHIFT) {
26424 __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])))
26425 }
else if (8 *
sizeof(
int) >= 4 * PyLong_SHIFT) {
26426 return (
int) (((((((((int)digits[3]) << PyLong_SHIFT) | (
int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (
int)digits[0]));
26432 #if CYTHON_COMPILING_IN_CPYTHON
26433 if (unlikely(Py_SIZE(x) < 0)) {
26434 goto raise_neg_overflow;
26438 int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
26439 if (unlikely(result < 0))
26441 if (unlikely(result == 1))
26442 goto raise_neg_overflow;
26445 if (
sizeof(
int) <=
sizeof(
unsigned long)) {
26446 __PYX_VERIFY_RETURN_INT_EXC(
int,
unsigned long, PyLong_AsUnsignedLong(x))
26447 #ifdef HAVE_LONG_LONG
26448 }
else if (
sizeof(
int) <=
sizeof(
unsigned PY_LONG_LONG)) {
26449 __PYX_VERIFY_RETURN_INT_EXC(
int,
unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
26453 #if CYTHON_USE_PYLONG_INTERNALS
26454 const digit* digits = ((PyLongObject*)x)->ob_digit;
26455 switch (Py_SIZE(x)) {
26456 case 0:
return (
int) 0;
26457 case -1: __PYX_VERIFY_RETURN_INT(
int, sdigit, (sdigit) (-(sdigit)digits[0]))
26458 case 1: __PYX_VERIFY_RETURN_INT(
int, digit, +digits[0])
26460 if (8 *
sizeof(
int) - 1 > 1 * PyLong_SHIFT) {
26461 if (8 *
sizeof(
unsigned long) > 2 * PyLong_SHIFT) {
26462 __PYX_VERIFY_RETURN_INT(
int,
long, -(
long) (((((
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
26463 }
else if (8 *
sizeof(
int) - 1 > 2 * PyLong_SHIFT) {
26464 return (
int) (((int)-1)*(((((int)digits[1]) << PyLong_SHIFT) | (
int)digits[0])));
26469 if (8 *
sizeof(
int) > 1 * PyLong_SHIFT) {
26470 if (8 *
sizeof(
unsigned long) > 2 * PyLong_SHIFT) {
26471 __PYX_VERIFY_RETURN_INT(
int,
unsigned long, (((((
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
26472 }
else if (8 *
sizeof(
int) - 1 > 2 * PyLong_SHIFT) {
26473 return (
int) ((((((int)digits[1]) << PyLong_SHIFT) | (
int)digits[0])));
26478 if (8 *
sizeof(
int) - 1 > 2 * PyLong_SHIFT) {
26479 if (8 *
sizeof(
unsigned long) > 3 * PyLong_SHIFT) {
26480 __PYX_VERIFY_RETURN_INT(
int,
long, -(
long) (((((((
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
26481 }
else if (8 *
sizeof(
int) - 1 > 3 * PyLong_SHIFT) {
26482 return (
int) (((int)-1)*(((((((int)digits[2]) << PyLong_SHIFT) | (
int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
26487 if (8 *
sizeof(
int) > 2 * PyLong_SHIFT) {
26488 if (8 *
sizeof(
unsigned long) > 3 * PyLong_SHIFT) {
26489 __PYX_VERIFY_RETURN_INT(
int,
unsigned long, (((((((
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
26490 }
else if (8 *
sizeof(
int) - 1 > 3 * PyLong_SHIFT) {
26491 return (
int) ((((((((int)digits[2]) << PyLong_SHIFT) | (
int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
26496 if (8 *
sizeof(
int) - 1 > 3 * PyLong_SHIFT) {
26497 if (8 *
sizeof(
unsigned long) > 4 * PyLong_SHIFT) {
26498 __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])))
26499 }
else if (8 *
sizeof(
int) - 1 > 4 * PyLong_SHIFT) {
26500 return (
int) (((int)-1)*(((((((((int)digits[3]) << PyLong_SHIFT) | (
int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (
int)digits[0])));
26505 if (8 *
sizeof(
int) > 3 * PyLong_SHIFT) {
26506 if (8 *
sizeof(
unsigned long) > 4 * PyLong_SHIFT) {
26507 __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])))
26508 }
else if (8 *
sizeof(
int) - 1 > 4 * PyLong_SHIFT) {
26509 return (
int) ((((((((((int)digits[3]) << PyLong_SHIFT) | (
int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (
int)digits[0])));
26515 if (
sizeof(
int) <=
sizeof(long)) {
26516 __PYX_VERIFY_RETURN_INT_EXC(
int,
long, PyLong_AsLong(x))
26517 #ifdef HAVE_LONG_LONG
26518 }
else if (
sizeof(
int) <=
sizeof(PY_LONG_LONG)) {
26519 __PYX_VERIFY_RETURN_INT_EXC(
int, PY_LONG_LONG, PyLong_AsLongLong(x))
26524 #if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray)
26525 PyErr_SetString(PyExc_RuntimeError,
26526 "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers");
26529 PyObject *
v = __Pyx_PyNumber_IntOrLong(x);
26530 #if PY_MAJOR_VERSION < 3
26531 if (likely(
v) && !PyLong_Check(
v)) {
26533 v = PyNumber_Long(tmp);
26538 int one = 1;
int is_little = (int)*(
unsigned char *)&one;
26539 unsigned char *bytes = (
unsigned char *)&val;
26540 int ret = _PyLong_AsByteArray((PyLongObject *)
v,
26541 bytes,
sizeof(val),
26542 is_little, !is_unsigned);
26552 PyObject *tmp = __Pyx_PyNumber_IntOrLong(x);
26553 if (!tmp)
return (
int) -1;
26554 val = __Pyx_PyInt_As_int(tmp);
26559 PyErr_SetString(PyExc_OverflowError,
26560 "value too large to convert to int");
26562 raise_neg_overflow:
26563 PyErr_SetString(PyExc_OverflowError,
26564 "can't convert negative value to int");
26569 static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(
int value) {
26570 #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
26571 #pragma GCC diagnostic push
26572 #pragma GCC diagnostic ignored "-Wconversion"
26574 const int neg_one = (int) -1, const_zero = (
int) 0;
26575 #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
26576 #pragma GCC diagnostic pop
26578 const int is_unsigned = neg_one > const_zero;
26580 if (
sizeof(
int) <
sizeof(long)) {
26581 return PyInt_FromLong((
long) value);
26582 }
else if (
sizeof(
int) <=
sizeof(
unsigned long)) {
26583 return PyLong_FromUnsignedLong((
unsigned long) value);
26584 #ifdef HAVE_LONG_LONG
26585 }
else if (
sizeof(
int) <=
sizeof(
unsigned PY_LONG_LONG)) {
26586 return PyLong_FromUnsignedLongLong((
unsigned PY_LONG_LONG) value);
26590 if (
sizeof(
int) <=
sizeof(
long)) {
26591 return PyInt_FromLong((
long) value);
26592 #ifdef HAVE_LONG_LONG
26593 }
else if (
sizeof(
int) <=
sizeof(PY_LONG_LONG)) {
26594 return PyLong_FromLongLong((PY_LONG_LONG) value);
26599 int one = 1;
int little = (int)*(
unsigned char *)&one;
26600 unsigned char *bytes = (
unsigned char *)&value;
26601 return _PyLong_FromByteArray(bytes,
sizeof(
int),
26602 little, !is_unsigned);
26607 static struct __pyx_typeinfo_string __Pyx_TypeInfoToFormat(__Pyx_TypeInfo *type) {
26608 struct __pyx_typeinfo_string result = { {0} };
26609 char *buf = (
char *) result.string;
26610 size_t size = type->size;
26611 switch (type->typegroup) {
26618 *buf = (type->is_unsigned) ?
'B' :
'b';
26619 else if (size == 2)
26620 *buf = (type->is_unsigned) ?
'H' :
'h';
26621 else if (size == 4)
26622 *buf = (type->is_unsigned) ?
'I' :
'i';
26623 else if (size == 8)
26624 *buf = (type->is_unsigned) ?
'Q' :
'q';
26631 __Pyx_TypeInfo complex_type = *type;
26632 complex_type.typegroup =
'R';
26633 complex_type.size /= 2;
26635 *buf = __Pyx_TypeInfoToFormat(&complex_type).string[0];
26641 else if (size == 8)
26651 static __Pyx_memviewslice
26652 __pyx_memoryview_copy_new_contig(
const __Pyx_memviewslice *from_mvs,
26653 const char *mode,
int ndim,
26654 size_t sizeof_dtype,
int contig_flag,
26655 int dtype_is_object)
26657 __Pyx_RefNannyDeclarations
26659 __Pyx_memviewslice new_mvs = { 0, 0, { 0 }, { 0 }, { 0 } };
26660 struct __pyx_memoryview_obj *from_memview = from_mvs->memview;
26661 Py_buffer *buf = &from_memview->view;
26662 PyObject *shape_tuple = NULL;
26663 PyObject *temp_int = NULL;
26664 struct __pyx_array_obj *array_obj = NULL;
26665 struct __pyx_memoryview_obj *memview_obj = NULL;
26666 __Pyx_RefNannySetupContext(
"__pyx_memoryview_copy_new_contig", 0);
26667 for (i = 0; i < ndim; i++) {
26668 if (unlikely(from_mvs->suboffsets[i] >= 0)) {
26669 PyErr_Format(PyExc_ValueError,
"Cannot copy memoryview slice with "
26670 "indirect dimensions (axis %d)", i);
26674 shape_tuple = PyTuple_New(ndim);
26675 if (unlikely(!shape_tuple)) {
26678 __Pyx_GOTREF(shape_tuple);
26679 for(i = 0; i < ndim; i++) {
26680 temp_int = PyInt_FromSsize_t(from_mvs->shape[i]);
26681 if(unlikely(!temp_int)) {
26684 PyTuple_SET_ITEM(shape_tuple, i, temp_int);
26688 array_obj = __pyx_array_new(shape_tuple, sizeof_dtype, buf->format, (
char *) mode, NULL);
26689 if (unlikely(!array_obj)) {
26692 __Pyx_GOTREF(array_obj);
26693 memview_obj = (
struct __pyx_memoryview_obj *) __pyx_memoryview_new(
26694 (PyObject *) array_obj, contig_flag,
26696 from_mvs->memview->typeinfo);
26697 if (unlikely(!memview_obj))
26699 if (unlikely(__Pyx_init_memviewslice(memview_obj, ndim, &new_mvs, 1) < 0))
26701 if (unlikely(__pyx_memoryview_copy_contents(*from_mvs, new_mvs, ndim, ndim,
26702 dtype_is_object) < 0))
26706 __Pyx_XDECREF(new_mvs.memview);
26707 new_mvs.memview = NULL;
26708 new_mvs.data = NULL;
26710 __Pyx_XDECREF(shape_tuple);
26711 __Pyx_XDECREF(temp_int);
26712 __Pyx_XDECREF(array_obj);
26713 __Pyx_RefNannyFinishContext();
26719 __Pyx_init_memviewslice(
struct __pyx_memoryview_obj *memview,
26721 __Pyx_memviewslice *memviewslice,
26722 int memview_is_new_reference)
26724 __Pyx_RefNannyDeclarations
26726 Py_buffer *buf = &memview->view;
26727 __Pyx_RefNannySetupContext(
"init_memviewslice", 0);
26728 if (unlikely(memviewslice->memview || memviewslice->data)) {
26729 PyErr_SetString(PyExc_ValueError,
26730 "memviewslice is already initialized!");
26733 if (buf->strides) {
26734 for (i = 0; i < ndim; i++) {
26735 memviewslice->strides[i] = buf->strides[i];
26738 Py_ssize_t stride = buf->itemsize;
26739 for (i = ndim - 1; i >= 0; i--) {
26740 memviewslice->strides[i] = stride;
26741 stride *= buf->shape[i];
26744 for (i = 0; i < ndim; i++) {
26745 memviewslice->shape[i] = buf->shape[i];
26746 if (buf->suboffsets) {
26747 memviewslice->suboffsets[i] = buf->suboffsets[i];
26749 memviewslice->suboffsets[i] = -1;
26752 memviewslice->memview = memview;
26753 memviewslice->data = (
char *)buf->buf;
26754 if (__pyx_add_acquisition_count(memview) == 0 && !memview_is_new_reference) {
26755 Py_INCREF(memview);
26760 memviewslice->memview = 0;
26761 memviewslice->data = 0;
26764 __Pyx_RefNannyFinishContext();
26767 #ifndef Py_NO_RETURN
26768 #define Py_NO_RETURN
26770 static void __pyx_fatalerror(
const char *fmt, ...) Py_NO_RETURN {
26773 #ifdef HAVE_STDARG_PROTOTYPES
26774 va_start(vargs, fmt);
26778 vsnprintf(msg, 200, fmt, vargs);
26780 Py_FatalError(msg);
26782 static CYTHON_INLINE
int
26783 __pyx_add_acquisition_count_locked(__pyx_atomic_int *acquisition_count,
26784 PyThread_type_lock lock)
26787 PyThread_acquire_lock(lock, 1);
26788 result = (*acquisition_count)++;
26789 PyThread_release_lock(lock);
26792 static CYTHON_INLINE
int
26793 __pyx_sub_acquisition_count_locked(__pyx_atomic_int *acquisition_count,
26794 PyThread_type_lock lock)
26797 PyThread_acquire_lock(lock, 1);
26798 result = (*acquisition_count)--;
26799 PyThread_release_lock(lock);
26802 static CYTHON_INLINE
void
26803 __Pyx_INC_MEMVIEW(__Pyx_memviewslice *memslice,
int have_gil,
int lineno)
26806 struct __pyx_memoryview_obj *memview = memslice->memview;
26807 if (unlikely(!memview || (PyObject *) memview == Py_None))
26809 if (unlikely(__pyx_get_slice_count(memview) < 0))
26810 __pyx_fatalerror(
"Acquisition count is %d (line %d)",
26811 __pyx_get_slice_count(memview), lineno);
26812 first_time = __pyx_add_acquisition_count(memview) == 0;
26813 if (unlikely(first_time)) {
26815 Py_INCREF((PyObject *) memview);
26817 PyGILState_STATE _gilstate = PyGILState_Ensure();
26818 Py_INCREF((PyObject *) memview);
26819 PyGILState_Release(_gilstate);
26823 static CYTHON_INLINE
void __Pyx_XDEC_MEMVIEW(__Pyx_memviewslice *memslice,
26824 int have_gil,
int lineno) {
26826 struct __pyx_memoryview_obj *memview = memslice->memview;
26827 if (unlikely(!memview || (PyObject *) memview == Py_None)) {
26828 memslice->memview = NULL;
26831 if (unlikely(__pyx_get_slice_count(memview) <= 0))
26832 __pyx_fatalerror(
"Acquisition count is %d (line %d)",
26833 __pyx_get_slice_count(memview), lineno);
26834 last_time = __pyx_sub_acquisition_count(memview) == 1;
26835 memslice->data = NULL;
26836 if (unlikely(last_time)) {
26838 Py_CLEAR(memslice->memview);
26840 PyGILState_STATE _gilstate = PyGILState_Ensure();
26841 Py_CLEAR(memslice->memview);
26842 PyGILState_Release(_gilstate);
26845 memslice->memview = NULL;
26850 static CYTHON_INLINE
long __Pyx_PyInt_As_long(PyObject *x) {
26851 #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
26852 #pragma GCC diagnostic push
26853 #pragma GCC diagnostic ignored "-Wconversion"
26855 const long neg_one = (long) -1, const_zero = (
long) 0;
26856 #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
26857 #pragma GCC diagnostic pop
26859 const int is_unsigned = neg_one > const_zero;
26860 #if PY_MAJOR_VERSION < 3
26861 if (likely(PyInt_Check(x))) {
26862 if (
sizeof(
long) <
sizeof(long)) {
26863 __PYX_VERIFY_RETURN_INT(
long,
long, PyInt_AS_LONG(x))
26865 long val = PyInt_AS_LONG(x);
26866 if (is_unsigned && unlikely(val < 0)) {
26867 goto raise_neg_overflow;
26873 if (likely(PyLong_Check(x))) {
26875 #if CYTHON_USE_PYLONG_INTERNALS
26876 const digit* digits = ((PyLongObject*)x)->ob_digit;
26877 switch (Py_SIZE(x)) {
26878 case 0:
return (
long) 0;
26879 case 1: __PYX_VERIFY_RETURN_INT(
long, digit, digits[0])
26881 if (8 *
sizeof(
long) > 1 * PyLong_SHIFT) {
26882 if (8 *
sizeof(
unsigned long) > 2 * PyLong_SHIFT) {
26883 __PYX_VERIFY_RETURN_INT(
long,
unsigned long, (((((
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
26884 }
else if (8 *
sizeof(
long) >= 2 * PyLong_SHIFT) {
26885 return (
long) (((((long)digits[1]) << PyLong_SHIFT) | (
long)digits[0]));
26890 if (8 *
sizeof(
long) > 2 * PyLong_SHIFT) {
26891 if (8 *
sizeof(
unsigned long) > 3 * PyLong_SHIFT) {
26892 __PYX_VERIFY_RETURN_INT(
long,
unsigned long, (((((((
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
26893 }
else if (8 *
sizeof(
long) >= 3 * PyLong_SHIFT) {
26894 return (
long) (((((((long)digits[2]) << PyLong_SHIFT) | (
long)digits[1]) << PyLong_SHIFT) | (long)digits[0]));
26899 if (8 *
sizeof(
long) > 3 * PyLong_SHIFT) {
26900 if (8 *
sizeof(
unsigned long) > 4 * PyLong_SHIFT) {
26901 __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])))
26902 }
else if (8 *
sizeof(
long) >= 4 * PyLong_SHIFT) {
26903 return (
long) (((((((((long)digits[3]) << PyLong_SHIFT) | (
long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (
long)digits[0]));
26909 #if CYTHON_COMPILING_IN_CPYTHON
26910 if (unlikely(Py_SIZE(x) < 0)) {
26911 goto raise_neg_overflow;
26915 int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
26916 if (unlikely(result < 0))
26918 if (unlikely(result == 1))
26919 goto raise_neg_overflow;
26922 if (
sizeof(
long) <=
sizeof(
unsigned long)) {
26923 __PYX_VERIFY_RETURN_INT_EXC(
long,
unsigned long, PyLong_AsUnsignedLong(x))
26924 #ifdef HAVE_LONG_LONG
26925 }
else if (
sizeof(
long) <=
sizeof(
unsigned PY_LONG_LONG)) {
26926 __PYX_VERIFY_RETURN_INT_EXC(
long,
unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
26930 #if CYTHON_USE_PYLONG_INTERNALS
26931 const digit* digits = ((PyLongObject*)x)->ob_digit;
26932 switch (Py_SIZE(x)) {
26933 case 0:
return (
long) 0;
26934 case -1: __PYX_VERIFY_RETURN_INT(
long, sdigit, (sdigit) (-(sdigit)digits[0]))
26935 case 1: __PYX_VERIFY_RETURN_INT(
long, digit, +digits[0])
26937 if (8 *
sizeof(
long) - 1 > 1 * PyLong_SHIFT) {
26938 if (8 *
sizeof(
unsigned long) > 2 * PyLong_SHIFT) {
26939 __PYX_VERIFY_RETURN_INT(
long,
long, -(
long) (((((
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
26940 }
else if (8 *
sizeof(
long) - 1 > 2 * PyLong_SHIFT) {
26941 return (
long) (((long)-1)*(((((long)digits[1]) << PyLong_SHIFT) | (
long)digits[0])));
26946 if (8 *
sizeof(
long) > 1 * PyLong_SHIFT) {
26947 if (8 *
sizeof(
unsigned long) > 2 * PyLong_SHIFT) {
26948 __PYX_VERIFY_RETURN_INT(
long,
unsigned long, (((((
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
26949 }
else if (8 *
sizeof(
long) - 1 > 2 * PyLong_SHIFT) {
26950 return (
long) ((((((long)digits[1]) << PyLong_SHIFT) | (
long)digits[0])));
26955 if (8 *
sizeof(
long) - 1 > 2 * PyLong_SHIFT) {
26956 if (8 *
sizeof(
unsigned long) > 3 * PyLong_SHIFT) {
26957 __PYX_VERIFY_RETURN_INT(
long,
long, -(
long) (((((((
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
26958 }
else if (8 *
sizeof(
long) - 1 > 3 * PyLong_SHIFT) {
26959 return (
long) (((long)-1)*(((((((long)digits[2]) << PyLong_SHIFT) | (
long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
26964 if (8 *
sizeof(
long) > 2 * PyLong_SHIFT) {
26965 if (8 *
sizeof(
unsigned long) > 3 * PyLong_SHIFT) {
26966 __PYX_VERIFY_RETURN_INT(
long,
unsigned long, (((((((
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
26967 }
else if (8 *
sizeof(
long) - 1 > 3 * PyLong_SHIFT) {
26968 return (
long) ((((((((long)digits[2]) << PyLong_SHIFT) | (
long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
26973 if (8 *
sizeof(
long) - 1 > 3 * PyLong_SHIFT) {
26974 if (8 *
sizeof(
unsigned long) > 4 * PyLong_SHIFT) {
26975 __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])))
26976 }
else if (8 *
sizeof(
long) - 1 > 4 * PyLong_SHIFT) {
26977 return (
long) (((long)-1)*(((((((((long)digits[3]) << PyLong_SHIFT) | (
long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (
long)digits[0])));
26982 if (8 *
sizeof(
long) > 3 * PyLong_SHIFT) {
26983 if (8 *
sizeof(
unsigned long) > 4 * PyLong_SHIFT) {
26984 __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])))
26985 }
else if (8 *
sizeof(
long) - 1 > 4 * PyLong_SHIFT) {
26986 return (
long) ((((((((((long)digits[3]) << PyLong_SHIFT) | (
long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (
long)digits[0])));
26992 if (
sizeof(
long) <=
sizeof(long)) {
26993 __PYX_VERIFY_RETURN_INT_EXC(
long,
long, PyLong_AsLong(x))
26994 #ifdef HAVE_LONG_LONG
26995 }
else if (
sizeof(
long) <=
sizeof(PY_LONG_LONG)) {
26996 __PYX_VERIFY_RETURN_INT_EXC(
long, PY_LONG_LONG, PyLong_AsLongLong(x))
27001 #if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray)
27002 PyErr_SetString(PyExc_RuntimeError,
27003 "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers");
27006 PyObject *
v = __Pyx_PyNumber_IntOrLong(x);
27007 #if PY_MAJOR_VERSION < 3
27008 if (likely(
v) && !PyLong_Check(
v)) {
27010 v = PyNumber_Long(tmp);
27015 int one = 1;
int is_little = (int)*(
unsigned char *)&one;
27016 unsigned char *bytes = (
unsigned char *)&val;
27017 int ret = _PyLong_AsByteArray((PyLongObject *)
v,
27018 bytes,
sizeof(val),
27019 is_little, !is_unsigned);
27029 PyObject *tmp = __Pyx_PyNumber_IntOrLong(x);
27030 if (!tmp)
return (
long) -1;
27031 val = __Pyx_PyInt_As_long(tmp);
27036 PyErr_SetString(PyExc_OverflowError,
27037 "value too large to convert to long");
27039 raise_neg_overflow:
27040 PyErr_SetString(PyExc_OverflowError,
27041 "can't convert negative value to long");
27046 static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(
long value) {
27047 #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
27048 #pragma GCC diagnostic push
27049 #pragma GCC diagnostic ignored "-Wconversion"
27051 const long neg_one = (long) -1, const_zero = (
long) 0;
27052 #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
27053 #pragma GCC diagnostic pop
27055 const int is_unsigned = neg_one > const_zero;
27057 if (
sizeof(
long) <
sizeof(long)) {
27058 return PyInt_FromLong((
long) value);
27059 }
else if (
sizeof(
long) <=
sizeof(
unsigned long)) {
27060 return PyLong_FromUnsignedLong((
unsigned long) value);
27061 #ifdef HAVE_LONG_LONG
27062 }
else if (
sizeof(
long) <=
sizeof(
unsigned PY_LONG_LONG)) {
27063 return PyLong_FromUnsignedLongLong((
unsigned PY_LONG_LONG) value);
27067 if (
sizeof(
long) <=
sizeof(
long)) {
27068 return PyInt_FromLong((
long) value);
27069 #ifdef HAVE_LONG_LONG
27070 }
else if (
sizeof(
long) <=
sizeof(PY_LONG_LONG)) {
27071 return PyLong_FromLongLong((PY_LONG_LONG) value);
27076 int one = 1;
int little = (int)*(
unsigned char *)&one;
27077 unsigned char *bytes = (
unsigned char *)&value;
27078 return _PyLong_FromByteArray(bytes,
sizeof(
long),
27079 little, !is_unsigned);
27084 static CYTHON_INLINE
char __Pyx_PyInt_As_char(PyObject *x) {
27085 #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
27086 #pragma GCC diagnostic push
27087 #pragma GCC diagnostic ignored "-Wconversion"
27089 const char neg_one = (char) -1, const_zero = (
char) 0;
27090 #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
27091 #pragma GCC diagnostic pop
27093 const int is_unsigned = neg_one > const_zero;
27094 #if PY_MAJOR_VERSION < 3
27095 if (likely(PyInt_Check(x))) {
27096 if (
sizeof(
char) <
sizeof(long)) {
27097 __PYX_VERIFY_RETURN_INT(
char,
long, PyInt_AS_LONG(x))
27099 long val = PyInt_AS_LONG(x);
27100 if (is_unsigned && unlikely(val < 0)) {
27101 goto raise_neg_overflow;
27107 if (likely(PyLong_Check(x))) {
27109 #if CYTHON_USE_PYLONG_INTERNALS
27110 const digit* digits = ((PyLongObject*)x)->ob_digit;
27111 switch (Py_SIZE(x)) {
27112 case 0:
return (
char) 0;
27113 case 1: __PYX_VERIFY_RETURN_INT(
char, digit, digits[0])
27115 if (8 *
sizeof(
char) > 1 * PyLong_SHIFT) {
27116 if (8 *
sizeof(
unsigned long) > 2 * PyLong_SHIFT) {
27117 __PYX_VERIFY_RETURN_INT(
char,
unsigned long, (((((
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
27118 }
else if (8 *
sizeof(
char) >= 2 * PyLong_SHIFT) {
27119 return (
char) (((((char)digits[1]) << PyLong_SHIFT) | (
char)digits[0]));
27124 if (8 *
sizeof(
char) > 2 * PyLong_SHIFT) {
27125 if (8 *
sizeof(
unsigned long) > 3 * PyLong_SHIFT) {
27126 __PYX_VERIFY_RETURN_INT(
char,
unsigned long, (((((((
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
27127 }
else if (8 *
sizeof(
char) >= 3 * PyLong_SHIFT) {
27128 return (
char) (((((((char)digits[2]) << PyLong_SHIFT) | (
char)digits[1]) << PyLong_SHIFT) | (char)digits[0]));
27133 if (8 *
sizeof(
char) > 3 * PyLong_SHIFT) {
27134 if (8 *
sizeof(
unsigned long) > 4 * PyLong_SHIFT) {
27135 __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])))
27136 }
else if (8 *
sizeof(
char) >= 4 * PyLong_SHIFT) {
27137 return (
char) (((((((((char)digits[3]) << PyLong_SHIFT) | (
char)digits[2]) << PyLong_SHIFT) | (char)digits[1]) << PyLong_SHIFT) | (
char)digits[0]));
27143 #if CYTHON_COMPILING_IN_CPYTHON
27144 if (unlikely(Py_SIZE(x) < 0)) {
27145 goto raise_neg_overflow;
27149 int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
27150 if (unlikely(result < 0))
27152 if (unlikely(result == 1))
27153 goto raise_neg_overflow;
27156 if (
sizeof(
char) <=
sizeof(
unsigned long)) {
27157 __PYX_VERIFY_RETURN_INT_EXC(
char,
unsigned long, PyLong_AsUnsignedLong(x))
27158 #ifdef HAVE_LONG_LONG
27159 }
else if (
sizeof(
char) <=
sizeof(
unsigned PY_LONG_LONG)) {
27160 __PYX_VERIFY_RETURN_INT_EXC(
char,
unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
27164 #if CYTHON_USE_PYLONG_INTERNALS
27165 const digit* digits = ((PyLongObject*)x)->ob_digit;
27166 switch (Py_SIZE(x)) {
27167 case 0:
return (
char) 0;
27168 case -1: __PYX_VERIFY_RETURN_INT(
char, sdigit, (sdigit) (-(sdigit)digits[0]))
27169 case 1: __PYX_VERIFY_RETURN_INT(
char, digit, +digits[0])
27171 if (8 *
sizeof(
char) - 1 > 1 * PyLong_SHIFT) {
27172 if (8 *
sizeof(
unsigned long) > 2 * PyLong_SHIFT) {
27173 __PYX_VERIFY_RETURN_INT(
char,
long, -(
long) (((((
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
27174 }
else if (8 *
sizeof(
char) - 1 > 2 * PyLong_SHIFT) {
27175 return (
char) (((char)-1)*(((((char)digits[1]) << PyLong_SHIFT) | (
char)digits[0])));
27180 if (8 *
sizeof(
char) > 1 * PyLong_SHIFT) {
27181 if (8 *
sizeof(
unsigned long) > 2 * PyLong_SHIFT) {
27182 __PYX_VERIFY_RETURN_INT(
char,
unsigned long, (((((
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
27183 }
else if (8 *
sizeof(
char) - 1 > 2 * PyLong_SHIFT) {
27184 return (
char) ((((((char)digits[1]) << PyLong_SHIFT) | (
char)digits[0])));
27189 if (8 *
sizeof(
char) - 1 > 2 * PyLong_SHIFT) {
27190 if (8 *
sizeof(
unsigned long) > 3 * PyLong_SHIFT) {
27191 __PYX_VERIFY_RETURN_INT(
char,
long, -(
long) (((((((
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
27192 }
else if (8 *
sizeof(
char) - 1 > 3 * PyLong_SHIFT) {
27193 return (
char) (((char)-1)*(((((((char)digits[2]) << PyLong_SHIFT) | (
char)digits[1]) << PyLong_SHIFT) | (char)digits[0])));
27198 if (8 *
sizeof(
char) > 2 * PyLong_SHIFT) {
27199 if (8 *
sizeof(
unsigned long) > 3 * PyLong_SHIFT) {
27200 __PYX_VERIFY_RETURN_INT(
char,
unsigned long, (((((((
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
27201 }
else if (8 *
sizeof(
char) - 1 > 3 * PyLong_SHIFT) {
27202 return (
char) ((((((((char)digits[2]) << PyLong_SHIFT) | (
char)digits[1]) << PyLong_SHIFT) | (char)digits[0])));
27207 if (8 *
sizeof(
char) - 1 > 3 * PyLong_SHIFT) {
27208 if (8 *
sizeof(
unsigned long) > 4 * PyLong_SHIFT) {
27209 __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])))
27210 }
else if (8 *
sizeof(
char) - 1 > 4 * PyLong_SHIFT) {
27211 return (
char) (((char)-1)*(((((((((char)digits[3]) << PyLong_SHIFT) | (
char)digits[2]) << PyLong_SHIFT) | (char)digits[1]) << PyLong_SHIFT) | (
char)digits[0])));
27216 if (8 *
sizeof(
char) > 3 * PyLong_SHIFT) {
27217 if (8 *
sizeof(
unsigned long) > 4 * PyLong_SHIFT) {
27218 __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])))
27219 }
else if (8 *
sizeof(
char) - 1 > 4 * PyLong_SHIFT) {
27220 return (
char) ((((((((((char)digits[3]) << PyLong_SHIFT) | (
char)digits[2]) << PyLong_SHIFT) | (char)digits[1]) << PyLong_SHIFT) | (
char)digits[0])));
27226 if (
sizeof(
char) <=
sizeof(long)) {
27227 __PYX_VERIFY_RETURN_INT_EXC(
char,
long, PyLong_AsLong(x))
27228 #ifdef HAVE_LONG_LONG
27229 }
else if (
sizeof(
char) <=
sizeof(PY_LONG_LONG)) {
27230 __PYX_VERIFY_RETURN_INT_EXC(
char, PY_LONG_LONG, PyLong_AsLongLong(x))
27235 #if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray)
27236 PyErr_SetString(PyExc_RuntimeError,
27237 "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers");
27240 PyObject *
v = __Pyx_PyNumber_IntOrLong(x);
27241 #if PY_MAJOR_VERSION < 3
27242 if (likely(
v) && !PyLong_Check(
v)) {
27244 v = PyNumber_Long(tmp);
27249 int one = 1;
int is_little = (int)*(
unsigned char *)&one;
27250 unsigned char *bytes = (
unsigned char *)&val;
27251 int ret = _PyLong_AsByteArray((PyLongObject *)
v,
27252 bytes,
sizeof(val),
27253 is_little, !is_unsigned);
27263 PyObject *tmp = __Pyx_PyNumber_IntOrLong(x);
27264 if (!tmp)
return (
char) -1;
27265 val = __Pyx_PyInt_As_char(tmp);
27270 PyErr_SetString(PyExc_OverflowError,
27271 "value too large to convert to char");
27273 raise_neg_overflow:
27274 PyErr_SetString(PyExc_OverflowError,
27275 "can't convert negative value to char");
27280 static int __Pyx_check_binary_version(
void) {
27282 int same=1, i, found_dot;
27283 const char* rt_from_call = Py_GetVersion();
27284 PyOS_snprintf(ctversion, 5,
"%d.%d", PY_MAJOR_VERSION, PY_MINOR_VERSION);
27286 for (i = 0; i < 4; i++) {
27287 if (!ctversion[i]) {
27288 same = (rt_from_call[i] <
'0' || rt_from_call[i] >
'9');
27291 if (rt_from_call[i] != ctversion[i]) {
27297 char rtversion[5] = {
'\0'};
27299 for (i=0; i<4; ++i) {
27300 if (rt_from_call[i] ==
'.') {
27301 if (found_dot)
break;
27303 }
else if (rt_from_call[i] <
'0' || rt_from_call[i] >
'9') {
27306 rtversion[i] = rt_from_call[i];
27308 PyOS_snprintf(message,
sizeof(message),
27309 "compiletime version %s of module '%.100s' "
27310 "does not match runtime version %s",
27311 ctversion, __Pyx_MODULE_NAME, rtversion);
27312 return PyErr_WarnEx(NULL, message, 1);
27318 static int __Pyx_InitStrings(__Pyx_StringTabEntry *t) {
27320 #if PY_MAJOR_VERSION < 3
27321 if (t->is_unicode) {
27322 *t->p = PyUnicode_DecodeUTF8(t->s, t->n - 1, NULL);
27323 }
else if (t->intern) {
27324 *t->p = PyString_InternFromString(t->s);
27326 *t->p = PyString_FromStringAndSize(t->s, t->n - 1);
27329 if (t->is_unicode | t->is_str) {
27331 *t->p = PyUnicode_InternFromString(t->s);
27332 }
else if (t->encoding) {
27333 *t->p = PyUnicode_Decode(t->s, t->n - 1, t->encoding, NULL);
27335 *t->p = PyUnicode_FromStringAndSize(t->s, t->n - 1);
27338 *t->p = PyBytes_FromStringAndSize(t->s, t->n - 1);
27343 if (PyObject_Hash(*t->p) == -1)
27350 static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(
const char* c_str) {
27351 return __Pyx_PyUnicode_FromStringAndSize(c_str, (Py_ssize_t)strlen(c_str));
27353 static CYTHON_INLINE
const char* __Pyx_PyObject_AsString(PyObject* o) {
27355 return __Pyx_PyObject_AsStringAndSize(o, &ignore);
27357 #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT
27358 #if !CYTHON_PEP393_ENABLED
27359 static const char* __Pyx_PyUnicode_AsStringAndSize(PyObject* o, Py_ssize_t *length) {
27361 PyObject* defenc = _PyUnicode_AsDefaultEncodedString(o, NULL);
27362 if (!defenc)
return NULL;
27363 defenc_c = PyBytes_AS_STRING(defenc);
27364 #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
27366 char* end = defenc_c + PyBytes_GET_SIZE(defenc);
27368 for (
c = defenc_c;
c < end;
c++) {
27369 if ((
unsigned char) (*
c) >= 128) {
27370 PyUnicode_AsASCIIString(o);
27376 *length = PyBytes_GET_SIZE(defenc);
27380 static CYTHON_INLINE
const char* __Pyx_PyUnicode_AsStringAndSize(PyObject* o, Py_ssize_t *length) {
27381 if (unlikely(__Pyx_PyUnicode_READY(o) == -1))
return NULL;
27382 #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
27383 if (likely(PyUnicode_IS_ASCII(o))) {
27384 *length = PyUnicode_GET_LENGTH(o);
27385 return PyUnicode_AsUTF8(o);
27387 PyUnicode_AsASCIIString(o);
27391 return PyUnicode_AsUTF8AndSize(o, length);
27396 static CYTHON_INLINE
const char* __Pyx_PyObject_AsStringAndSize(PyObject* o, Py_ssize_t *length) {
27397 #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT
27399 #
if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
27400 __Pyx_sys_getdefaultencoding_not_ascii &&
27402 PyUnicode_Check(o)) {
27403 return __Pyx_PyUnicode_AsStringAndSize(o, length);
27406 #if (!CYTHON_COMPILING_IN_PYPY) || (defined(PyByteArray_AS_STRING) && defined(PyByteArray_GET_SIZE))
27407 if (PyByteArray_Check(o)) {
27408 *length = PyByteArray_GET_SIZE(o);
27409 return PyByteArray_AS_STRING(o);
27414 int r = PyBytes_AsStringAndSize(o, &result, length);
27415 if (unlikely(
r < 0)) {
27422 static CYTHON_INLINE
int __Pyx_PyObject_IsTrue(PyObject* x) {
27423 int is_true = x == Py_True;
27424 if (is_true | (x == Py_False) | (x == Py_None))
return is_true;
27425 else return PyObject_IsTrue(x);
27427 static CYTHON_INLINE
int __Pyx_PyObject_IsTrueAndDecref(PyObject* x) {
27429 if (unlikely(!x))
return -1;
27430 retval = __Pyx_PyObject_IsTrue(x);
27434 static PyObject* __Pyx_PyNumber_IntOrLongWrongResultType(PyObject* result,
const char* type_name) {
27435 #if PY_MAJOR_VERSION >= 3
27436 if (PyLong_Check(result)) {
27437 if (PyErr_WarnFormat(PyExc_DeprecationWarning, 1,
27438 "__int__ returned non-int (type %.200s). "
27439 "The ability to return an instance of a strict subclass of int "
27440 "is deprecated, and may be removed in a future version of Python.",
27441 Py_TYPE(result)->tp_name)) {
27448 PyErr_Format(PyExc_TypeError,
27449 "__%.4s__ returned non-%.4s (type %.200s)",
27450 type_name, type_name, Py_TYPE(result)->tp_name);
27454 static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x) {
27455 #if CYTHON_USE_TYPE_SLOTS
27456 PyNumberMethods *m;
27458 const char *name = NULL;
27459 PyObject *res = NULL;
27460 #if PY_MAJOR_VERSION < 3
27461 if (likely(PyInt_Check(x) || PyLong_Check(x)))
27463 if (likely(PyLong_Check(x)))
27465 return __Pyx_NewRef(x);
27466 #if CYTHON_USE_TYPE_SLOTS
27467 m = Py_TYPE(x)->tp_as_number;
27468 #if PY_MAJOR_VERSION < 3
27469 if (m && m->nb_int) {
27471 res = m->nb_int(x);
27473 else if (m && m->nb_long) {
27475 res = m->nb_long(x);
27478 if (likely(m && m->nb_int)) {
27480 res = m->nb_int(x);
27484 if (!PyBytes_CheckExact(x) && !PyUnicode_CheckExact(x)) {
27485 res = PyNumber_Int(x);
27489 #if PY_MAJOR_VERSION < 3
27490 if (unlikely(!PyInt_Check(res) && !PyLong_Check(res))) {
27492 if (unlikely(!PyLong_CheckExact(res))) {
27494 return __Pyx_PyNumber_IntOrLongWrongResultType(res, name);
27497 else if (!PyErr_Occurred()) {
27498 PyErr_SetString(PyExc_TypeError,
27499 "an integer is required");
27503 static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject* b) {
27506 #if PY_MAJOR_VERSION < 3
27507 if (likely(PyInt_CheckExact(b))) {
27508 if (
sizeof(Py_ssize_t) >=
sizeof(
long))
27509 return PyInt_AS_LONG(b);
27511 return PyInt_AsSsize_t(b);
27514 if (likely(PyLong_CheckExact(b))) {
27515 #if CYTHON_USE_PYLONG_INTERNALS
27516 const digit* digits = ((PyLongObject*)b)->ob_digit;
27517 const Py_ssize_t size = Py_SIZE(b);
27518 if (likely(__Pyx_sst_abs(size) <= 1)) {
27519 ival = likely(size) ? digits[0] : 0;
27520 if (size == -1) ival = -ival;
27525 if (8 *
sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) {
27526 return (Py_ssize_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (
size_t)digits[0]));
27530 if (8 *
sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) {
27531 return -(Py_ssize_t) (((((
size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
27535 if (8 *
sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) {
27536 return (Py_ssize_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (
size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
27540 if (8 *
sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) {
27541 return -(Py_ssize_t) (((((((
size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (
size_t)digits[0]));
27545 if (8 *
sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) {
27546 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]));
27550 if (8 *
sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) {
27551 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]));
27557 return PyLong_AsSsize_t(b);
27559 x = PyNumber_Index(b);
27561 ival = PyInt_AsSsize_t(x);
27565 static CYTHON_INLINE Py_hash_t __Pyx_PyIndex_AsHash_t(PyObject* o) {
27566 if (
sizeof(Py_hash_t) ==
sizeof(Py_ssize_t)) {
27567 return (Py_hash_t) __Pyx_PyIndex_AsSsize_t(o);
27568 #if PY_MAJOR_VERSION < 3
27569 }
else if (likely(PyInt_CheckExact(o))) {
27570 return PyInt_AS_LONG(o);
27575 x = PyNumber_Index(o);
27577 ival = PyInt_AsLong(x);
27582 static CYTHON_INLINE PyObject * __Pyx_PyBool_FromLong(
long b) {
27583 return b ? __Pyx_NewRef(Py_True) : __Pyx_NewRef(Py_False);
27585 static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(
size_t ival) {
27586 return PyInt_FromSize_t(ival);