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__mprans__cMoveMeshMonitor
708 #define __PYX_HAVE_API__mprans__cMoveMeshMonitor
712 #include "numpy/arrayobject.h"
713 #include "numpy/ndarrayobject.h"
714 #include "numpy/ndarraytypes.h"
715 #include "numpy/arrayscalars.h"
716 #include "numpy/ufuncobject.h"
720 #include "pythread.h"
727 #if defined(PYREX_WITHOUT_ASSERTIONS) && !defined(CYTHON_WITHOUT_ASSERTIONS)
728 #define CYTHON_WITHOUT_ASSERTIONS
731 typedef struct {PyObject **p;
const char *
s;
const Py_ssize_t
n;
const char* encoding;
732 const char is_unicode;
const char is_str;
const char intern; } __Pyx_StringTabEntry;
734 #define __PYX_DEFAULT_STRING_ENCODING_IS_ASCII 0
735 #define __PYX_DEFAULT_STRING_ENCODING_IS_UTF8 0
736 #define __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT (PY_MAJOR_VERSION >= 3 && __PYX_DEFAULT_STRING_ENCODING_IS_UTF8)
737 #define __PYX_DEFAULT_STRING_ENCODING ""
738 #define __Pyx_PyObject_FromString __Pyx_PyBytes_FromString
739 #define __Pyx_PyObject_FromStringAndSize __Pyx_PyBytes_FromStringAndSize
740 #define __Pyx_uchar_cast(c) ((unsigned char)c)
741 #define __Pyx_long_cast(x) ((long)x)
742 #define __Pyx_fits_Py_ssize_t(v, type, is_signed) (\
743 (sizeof(type) < sizeof(Py_ssize_t)) ||\
744 (sizeof(type) > sizeof(Py_ssize_t) &&\
745 likely(v < (type)PY_SSIZE_T_MAX ||\
746 v == (type)PY_SSIZE_T_MAX) &&\
747 (!is_signed || likely(v > (type)PY_SSIZE_T_MIN ||\
748 v == (type)PY_SSIZE_T_MIN))) ||\
749 (sizeof(type) == sizeof(Py_ssize_t) &&\
750 (is_signed || likely(v < (type)PY_SSIZE_T_MAX ||\
751 v == (type)PY_SSIZE_T_MAX))) )
752 static CYTHON_INLINE
int __Pyx_is_valid_index(Py_ssize_t i, Py_ssize_t limit) {
753 return (
size_t) i < (size_t) limit;
755 #if defined (__cplusplus) && __cplusplus >= 201103L
757 #define __Pyx_sst_abs(value) std::abs(value)
758 #elif SIZEOF_INT >= SIZEOF_SIZE_T
759 #define __Pyx_sst_abs(value) abs(value)
760 #elif SIZEOF_LONG >= SIZEOF_SIZE_T
761 #define __Pyx_sst_abs(value) labs(value)
762 #elif defined (_MSC_VER)
763 #define __Pyx_sst_abs(value) ((Py_ssize_t)_abs64(value))
764 #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
765 #define __Pyx_sst_abs(value) llabs(value)
766 #elif defined (__GNUC__)
767 #define __Pyx_sst_abs(value) __builtin_llabs(value)
769 #define __Pyx_sst_abs(value) ((value<0) ? -value : value)
771 static CYTHON_INLINE
const char* __Pyx_PyObject_AsString(PyObject*);
772 static CYTHON_INLINE
const char* __Pyx_PyObject_AsStringAndSize(PyObject*, Py_ssize_t* length);
773 #define __Pyx_PyByteArray_FromString(s) PyByteArray_FromStringAndSize((const char*)s, strlen((const char*)s))
774 #define __Pyx_PyByteArray_FromStringAndSize(s, l) PyByteArray_FromStringAndSize((const char*)s, l)
775 #define __Pyx_PyBytes_FromString PyBytes_FromString
776 #define __Pyx_PyBytes_FromStringAndSize PyBytes_FromStringAndSize
777 static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(
const char*);
778 #if PY_MAJOR_VERSION < 3
779 #define __Pyx_PyStr_FromString __Pyx_PyBytes_FromString
780 #define __Pyx_PyStr_FromStringAndSize __Pyx_PyBytes_FromStringAndSize
782 #define __Pyx_PyStr_FromString __Pyx_PyUnicode_FromString
783 #define __Pyx_PyStr_FromStringAndSize __Pyx_PyUnicode_FromStringAndSize
785 #define __Pyx_PyBytes_AsWritableString(s) ((char*) PyBytes_AS_STRING(s))
786 #define __Pyx_PyBytes_AsWritableSString(s) ((signed char*) PyBytes_AS_STRING(s))
787 #define __Pyx_PyBytes_AsWritableUString(s) ((unsigned char*) PyBytes_AS_STRING(s))
788 #define __Pyx_PyBytes_AsString(s) ((const char*) PyBytes_AS_STRING(s))
789 #define __Pyx_PyBytes_AsSString(s) ((const signed char*) PyBytes_AS_STRING(s))
790 #define __Pyx_PyBytes_AsUString(s) ((const unsigned char*) PyBytes_AS_STRING(s))
791 #define __Pyx_PyObject_AsWritableString(s) ((char*) __Pyx_PyObject_AsString(s))
792 #define __Pyx_PyObject_AsWritableSString(s) ((signed char*) __Pyx_PyObject_AsString(s))
793 #define __Pyx_PyObject_AsWritableUString(s) ((unsigned char*) __Pyx_PyObject_AsString(s))
794 #define __Pyx_PyObject_AsSString(s) ((const signed char*) __Pyx_PyObject_AsString(s))
795 #define __Pyx_PyObject_AsUString(s) ((const unsigned char*) __Pyx_PyObject_AsString(s))
796 #define __Pyx_PyObject_FromCString(s) __Pyx_PyObject_FromString((const char*)s)
797 #define __Pyx_PyBytes_FromCString(s) __Pyx_PyBytes_FromString((const char*)s)
798 #define __Pyx_PyByteArray_FromCString(s) __Pyx_PyByteArray_FromString((const char*)s)
799 #define __Pyx_PyStr_FromCString(s) __Pyx_PyStr_FromString((const char*)s)
800 #define __Pyx_PyUnicode_FromCString(s) __Pyx_PyUnicode_FromString((const char*)s)
801 static CYTHON_INLINE
size_t __Pyx_Py_UNICODE_strlen(
const Py_UNICODE *
u) {
802 const Py_UNICODE *u_end =
u;
804 return (
size_t)(u_end -
u - 1);
806 #define __Pyx_PyUnicode_FromUnicode(u) PyUnicode_FromUnicode(u, __Pyx_Py_UNICODE_strlen(u))
807 #define __Pyx_PyUnicode_FromUnicodeAndLength PyUnicode_FromUnicode
808 #define __Pyx_PyUnicode_AsUnicode PyUnicode_AsUnicode
809 #define __Pyx_NewRef(obj) (Py_INCREF(obj), obj)
810 #define __Pyx_Owned_Py_None(b) __Pyx_NewRef(Py_None)
811 static CYTHON_INLINE PyObject * __Pyx_PyBool_FromLong(
long b);
812 static CYTHON_INLINE
int __Pyx_PyObject_IsTrue(PyObject*);
813 static CYTHON_INLINE
int __Pyx_PyObject_IsTrueAndDecref(PyObject*);
814 static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x);
815 #define __Pyx_PySequence_Tuple(obj)\
816 (likely(PyTuple_CheckExact(obj)) ? __Pyx_NewRef(obj) : PySequence_Tuple(obj))
817 static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject*);
818 static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(
size_t);
819 static CYTHON_INLINE Py_hash_t __Pyx_PyIndex_AsHash_t(PyObject*);
820 #if CYTHON_ASSUME_SAFE_MACROS
821 #define __pyx_PyFloat_AsDouble(x) (PyFloat_CheckExact(x) ? PyFloat_AS_DOUBLE(x) : PyFloat_AsDouble(x))
823 #define __pyx_PyFloat_AsDouble(x) PyFloat_AsDouble(x)
825 #define __pyx_PyFloat_AsFloat(x) ((float) __pyx_PyFloat_AsDouble(x))
826 #if PY_MAJOR_VERSION >= 3
827 #define __Pyx_PyNumber_Int(x) (PyLong_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Long(x))
829 #define __Pyx_PyNumber_Int(x) (PyInt_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Int(x))
831 #define __Pyx_PyNumber_Float(x) (PyFloat_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Float(x))
832 #if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
833 static int __Pyx_sys_getdefaultencoding_not_ascii;
834 static int __Pyx_init_sys_getdefaultencoding_params(
void) {
836 PyObject* default_encoding = NULL;
837 PyObject* ascii_chars_u = NULL;
838 PyObject* ascii_chars_b = NULL;
839 const char* default_encoding_c;
840 sys = PyImport_ImportModule(
"sys");
842 default_encoding = PyObject_CallMethod(sys, (
char*)
"getdefaultencoding", NULL);
844 if (!default_encoding)
goto bad;
845 default_encoding_c = PyBytes_AsString(default_encoding);
846 if (!default_encoding_c)
goto bad;
847 if (strcmp(default_encoding_c,
"ascii") == 0) {
848 __Pyx_sys_getdefaultencoding_not_ascii = 0;
850 char ascii_chars[128];
852 for (
c = 0;
c < 128;
c++) {
855 __Pyx_sys_getdefaultencoding_not_ascii = 1;
856 ascii_chars_u = PyUnicode_DecodeASCII(ascii_chars, 128, NULL);
857 if (!ascii_chars_u)
goto bad;
858 ascii_chars_b = PyUnicode_AsEncodedString(ascii_chars_u, default_encoding_c, NULL);
859 if (!ascii_chars_b || !PyBytes_Check(ascii_chars_b) || memcmp(ascii_chars, PyBytes_AS_STRING(ascii_chars_b), 128) != 0) {
862 "This module compiled with c_string_encoding=ascii, but default encoding '%.200s' is not a superset of ascii.",
866 Py_DECREF(ascii_chars_u);
867 Py_DECREF(ascii_chars_b);
869 Py_DECREF(default_encoding);
872 Py_XDECREF(default_encoding);
873 Py_XDECREF(ascii_chars_u);
874 Py_XDECREF(ascii_chars_b);
878 #if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT && PY_MAJOR_VERSION >= 3
879 #define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_DecodeUTF8(c_str, size, NULL)
881 #define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_Decode(c_str, size, __PYX_DEFAULT_STRING_ENCODING, NULL)
882 #if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT
883 static char* __PYX_DEFAULT_STRING_ENCODING;
884 static int __Pyx_init_sys_getdefaultencoding_params(
void) {
886 PyObject* default_encoding = NULL;
887 char* default_encoding_c;
888 sys = PyImport_ImportModule(
"sys");
890 default_encoding = PyObject_CallMethod(sys, (
char*) (
const char*)
"getdefaultencoding", NULL);
892 if (!default_encoding)
goto bad;
893 default_encoding_c = PyBytes_AsString(default_encoding);
894 if (!default_encoding_c)
goto bad;
895 __PYX_DEFAULT_STRING_ENCODING = (
char*) malloc(strlen(default_encoding_c) + 1);
896 if (!__PYX_DEFAULT_STRING_ENCODING)
goto bad;
897 strcpy(__PYX_DEFAULT_STRING_ENCODING, default_encoding_c);
898 Py_DECREF(default_encoding);
901 Py_XDECREF(default_encoding);
909 #if defined(__GNUC__) && (__GNUC__ > 2 || (__GNUC__ == 2 && (__GNUC_MINOR__ > 95)))
910 #define likely(x) __builtin_expect(!!(x), 1)
911 #define unlikely(x) __builtin_expect(!!(x), 0)
913 #define likely(x) (x)
914 #define unlikely(x) (x)
916 static CYTHON_INLINE
void __Pyx_pretend_to_initialize(
void* ptr) { (void)ptr; }
918 static PyObject *__pyx_m = NULL;
919 static PyObject *__pyx_d;
920 static PyObject *__pyx_b;
921 static PyObject *__pyx_cython_runtime = NULL;
922 static PyObject *__pyx_empty_tuple;
923 static PyObject *__pyx_empty_bytes;
924 static PyObject *__pyx_empty_unicode;
925 static int __pyx_lineno;
926 static int __pyx_clineno = 0;
927 static const char * __pyx_cfilenm= __FILE__;
928 static const char *__pyx_filename;
931 #if !defined(CYTHON_CCOMPLEX)
932 #if defined(__cplusplus)
933 #define CYTHON_CCOMPLEX 1
934 #elif defined(_Complex_I)
935 #define CYTHON_CCOMPLEX 1
937 #define CYTHON_CCOMPLEX 0
947 #if CYTHON_CCOMPLEX && !defined(__cplusplus) && defined(__sun__) && defined(__GNUC__)
949 #define _Complex_I 1.0fj
953 static const char *__pyx_f[] = {
954 "proteus/mprans/cMoveMeshMonitor.pyx",
960 struct __pyx_memoryview_obj;
962 struct __pyx_memoryview_obj *memview;
965 Py_ssize_t strides[8];
966 Py_ssize_t suboffsets[8];
967 } __Pyx_memviewslice;
968 #define __Pyx_MemoryView_Len(m) (m.shape[0])
971 #include <pythread.h>
972 #ifndef CYTHON_ATOMICS
973 #define CYTHON_ATOMICS 1
975 #define __pyx_atomic_int_type int
976 #if CYTHON_ATOMICS && __GNUC__ >= 4 && (__GNUC_MINOR__ > 1 ||\
977 (__GNUC_MINOR__ == 1 && __GNUC_PATCHLEVEL >= 2)) &&\
979 #define __pyx_atomic_incr_aligned(value, lock) __sync_fetch_and_add(value, 1)
980 #define __pyx_atomic_decr_aligned(value, lock) __sync_fetch_and_sub(value, 1)
981 #ifdef __PYX_DEBUG_ATOMICS
982 #warning "Using GNU atomics"
984 #elif CYTHON_ATOMICS && defined(_MSC_VER) && 0
986 #undef __pyx_atomic_int_type
987 #define __pyx_atomic_int_type LONG
988 #define __pyx_atomic_incr_aligned(value, lock) InterlockedIncrement(value)
989 #define __pyx_atomic_decr_aligned(value, lock) InterlockedDecrement(value)
990 #ifdef __PYX_DEBUG_ATOMICS
991 #pragma message ("Using MSVC atomics")
993 #elif CYTHON_ATOMICS && (defined(__ICC) || defined(__INTEL_COMPILER)) && 0
994 #define __pyx_atomic_incr_aligned(value, lock) _InterlockedIncrement(value)
995 #define __pyx_atomic_decr_aligned(value, lock) _InterlockedDecrement(value)
996 #ifdef __PYX_DEBUG_ATOMICS
997 #warning "Using Intel atomics"
1000 #undef CYTHON_ATOMICS
1001 #define CYTHON_ATOMICS 0
1002 #ifdef __PYX_DEBUG_ATOMICS
1003 #warning "Not using atomics"
1006 typedef volatile __pyx_atomic_int_type __pyx_atomic_int;
1008 #define __pyx_add_acquisition_count(memview)\
1009 __pyx_atomic_incr_aligned(__pyx_get_slice_count_pointer(memview), memview->lock)
1010 #define __pyx_sub_acquisition_count(memview)\
1011 __pyx_atomic_decr_aligned(__pyx_get_slice_count_pointer(memview), memview->lock)
1013 #define __pyx_add_acquisition_count(memview)\
1014 __pyx_add_acquisition_count_locked(__pyx_get_slice_count_pointer(memview), memview->lock)
1015 #define __pyx_sub_acquisition_count(memview)\
1016 __pyx_sub_acquisition_count_locked(__pyx_get_slice_count_pointer(memview), memview->lock)
1020 #ifndef __PYX_FORCE_INIT_THREADS
1021 #define __PYX_FORCE_INIT_THREADS 0
1025 #define __Pyx_PyGILState_Ensure PyGILState_Ensure
1026 #define __Pyx_PyGILState_Release PyGILState_Release
1027 #define __Pyx_FastGIL_Remember()
1028 #define __Pyx_FastGIL_Forget()
1029 #define __Pyx_FastGilFuncInit()
1032 #define IS_UNSIGNED(type) (((type) -1) > 0)
1033 struct __Pyx_StructField_;
1034 #define __PYX_BUF_FLAGS_PACKED_STRUCT (1 << 0)
1037 struct __Pyx_StructField_* fields;
1039 size_t arraysize[8];
1045 typedef struct __Pyx_StructField_ {
1046 __Pyx_TypeInfo* type;
1049 } __Pyx_StructField;
1051 __Pyx_StructField* field;
1052 size_t parent_offset;
1053 } __Pyx_BufFmt_StackElem;
1055 __Pyx_StructField root;
1056 __Pyx_BufFmt_StackElem* head;
1058 size_t new_count, enc_count;
1059 size_t struct_alignment;
1064 char is_valid_array;
1065 } __Pyx_BufFmt_Context;
1075 typedef npy_int8 __pyx_t_5numpy_int8_t;
1084 typedef npy_int16 __pyx_t_5numpy_int16_t;
1093 typedef npy_int32 __pyx_t_5numpy_int32_t;
1102 typedef npy_int64 __pyx_t_5numpy_int64_t;
1111 typedef npy_uint8 __pyx_t_5numpy_uint8_t;
1120 typedef npy_uint16 __pyx_t_5numpy_uint16_t;
1129 typedef npy_uint32 __pyx_t_5numpy_uint32_t;
1138 typedef npy_uint64 __pyx_t_5numpy_uint64_t;
1147 typedef npy_float32 __pyx_t_5numpy_float32_t;
1156 typedef npy_float64 __pyx_t_5numpy_float64_t;
1165 typedef npy_long __pyx_t_5numpy_int_t;
1174 typedef npy_longlong __pyx_t_5numpy_long_t;
1183 typedef npy_longlong __pyx_t_5numpy_longlong_t;
1192 typedef npy_ulong __pyx_t_5numpy_uint_t;
1201 typedef npy_ulonglong __pyx_t_5numpy_ulong_t;
1210 typedef npy_ulonglong __pyx_t_5numpy_ulonglong_t;
1219 typedef npy_intp __pyx_t_5numpy_intp_t;
1228 typedef npy_uintp __pyx_t_5numpy_uintp_t;
1237 typedef npy_double __pyx_t_5numpy_float_t;
1246 typedef npy_double __pyx_t_5numpy_double_t;
1255 typedef npy_longdouble __pyx_t_5numpy_longdouble_t;
1259 typedef ::std::complex< float > __pyx_t_float_complex;
1261 typedef float _Complex __pyx_t_float_complex;
1264 typedef struct {
float real, imag; } __pyx_t_float_complex;
1266 static CYTHON_INLINE __pyx_t_float_complex __pyx_t_float_complex_from_parts(
float,
float);
1271 typedef ::std::complex< double > __pyx_t_double_complex;
1273 typedef double _Complex __pyx_t_double_complex;
1276 typedef struct {
double real, imag; } __pyx_t_double_complex;
1278 static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(
double,
double);
1282 struct __pyx_obj_6mprans_16cMoveMeshMonitor_cCoefficients;
1283 struct __pyx_obj_6mprans_16cMoveMeshMonitor___pyx_scope_struct__cppPseudoTimeSteppingParallel;
1284 struct __pyx_obj_6mprans_16cMoveMeshMonitor___pyx_scope_struct_1_genexpr;
1285 struct __pyx_obj_6mprans_16cMoveMeshMonitor___pyx_scope_struct_2_genexpr;
1286 struct __pyx_obj_6mprans_16cMoveMeshMonitor___pyx_scope_struct_3_genexpr;
1287 struct __pyx_obj_6mprans_16cMoveMeshMonitor___pyx_scope_struct_4_genexpr;
1288 struct __pyx_array_obj;
1289 struct __pyx_MemviewEnum_obj;
1290 struct __pyx_memoryview_obj;
1291 struct __pyx_memoryviewslice_obj;
1300 typedef npy_cfloat __pyx_t_5numpy_cfloat_t;
1309 typedef npy_cdouble __pyx_t_5numpy_cdouble_t;
1318 typedef npy_clongdouble __pyx_t_5numpy_clongdouble_t;
1327 typedef npy_cdouble __pyx_t_5numpy_complex_t;
1328 struct __pyx_opt_args_7proteus_6mprans_13MeshSmoothing_cySmoothNodesLaplace;
1329 struct __pyx_opt_args_7proteus_6mprans_13MeshSmoothing_cySmoothNodesCentroid;
1330 struct __pyx_opt_args_7proteus_6mprans_13MeshSmoothing_cyUpdateInverseMeanRatioTriangleNodes;
1331 struct __pyx_opt_args_7proteus_6mprans_13MeshSmoothing_cyGetInverseMeanRatioSingleTriangle;
1332 struct __pyx_opt_args_7proteus_6mprans_13MeshSmoothing_cySmoothNodesQuality;
1341 struct __pyx_opt_args_7proteus_6mprans_13MeshSmoothing_cySmoothNodesLaplace {
1344 bool smoothBoundaries;
1345 __Pyx_memviewslice fixedNodesBoolArray;
1356 struct __pyx_opt_args_7proteus_6mprans_13MeshSmoothing_cySmoothNodesCentroid {
1359 bool smoothBoundaries;
1370 struct __pyx_opt_args_7proteus_6mprans_13MeshSmoothing_cyUpdateInverseMeanRatioTriangleNodes {
1382 struct __pyx_opt_args_7proteus_6mprans_13MeshSmoothing_cyGetInverseMeanRatioSingleTriangle {
1394 struct __pyx_opt_args_7proteus_6mprans_13MeshSmoothing_cySmoothNodesQuality {
1396 bool apply_directly;
1406 struct __pyx_obj_6mprans_16cMoveMeshMonitor_cCoefficients {
1408 struct __pyx_vtabstruct_6mprans_16cMoveMeshMonitor_cCoefficients *__pyx_vtab;
1409 PyObject *pyCoefficients;
1421 struct __pyx_obj_6mprans_16cMoveMeshMonitor___pyx_scope_struct__cppPseudoTimeSteppingParallel {
1423 int __pyx_v_comm_size;
1424 __Pyx_memviewslice __pyx_v_coords_2doArray;
1425 __Pyx_memviewslice __pyx_v_counts_in;
1426 __Pyx_memviewslice __pyx_v_displacements_in;
1437 struct __pyx_obj_6mprans_16cMoveMeshMonitor___pyx_scope_struct_1_genexpr {
1439 struct __pyx_obj_6mprans_16cMoveMeshMonitor___pyx_scope_struct__cppPseudoTimeSteppingParallel *__pyx_outer_scope;
1454 struct __pyx_obj_6mprans_16cMoveMeshMonitor___pyx_scope_struct_2_genexpr {
1456 struct __pyx_obj_6mprans_16cMoveMeshMonitor___pyx_scope_struct__cppPseudoTimeSteppingParallel *__pyx_outer_scope;
1471 struct __pyx_obj_6mprans_16cMoveMeshMonitor___pyx_scope_struct_3_genexpr {
1473 struct __pyx_obj_6mprans_16cMoveMeshMonitor___pyx_scope_struct__cppPseudoTimeSteppingParallel *__pyx_outer_scope;
1488 struct __pyx_obj_6mprans_16cMoveMeshMonitor___pyx_scope_struct_4_genexpr {
1490 struct __pyx_obj_6mprans_16cMoveMeshMonitor___pyx_scope_struct__cppPseudoTimeSteppingParallel *__pyx_outer_scope;
1505 struct __pyx_array_obj {
1507 struct __pyx_vtabstruct_array *__pyx_vtab;
1513 Py_ssize_t *_strides;
1514 Py_ssize_t itemsize;
1517 void (*callback_free_data)(
void *);
1519 int dtype_is_object;
1530 struct __pyx_MemviewEnum_obj {
1543 struct __pyx_memoryview_obj {
1545 struct __pyx_vtabstruct_memoryview *__pyx_vtab;
1548 PyObject *_array_interface;
1549 PyThread_type_lock lock;
1550 __pyx_atomic_int acquisition_count[2];
1551 __pyx_atomic_int *acquisition_count_aligned_p;
1554 int dtype_is_object;
1555 __Pyx_TypeInfo *typeinfo;
1566 struct __pyx_memoryviewslice_obj {
1567 struct __pyx_memoryview_obj __pyx_base;
1568 __Pyx_memviewslice from_slice;
1569 PyObject *from_object;
1570 PyObject *(*to_object_func)(
char *);
1571 int (*to_dtype_func)(
char *, PyObject *);
1584 struct __pyx_vtabstruct_6mprans_16cMoveMeshMonitor_cCoefficients {
1585 PyObject *(*cppPreStep)(
struct __pyx_obj_6mprans_16cMoveMeshMonitor_cCoefficients *, __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, int);
1586 PyObject *(*cppPostStep)(
struct __pyx_obj_6mprans_16cMoveMeshMonitor_cCoefficients *);
1587 PyObject *(*cppPseudoTimeSteppingParallel)(
struct __pyx_obj_6mprans_16cMoveMeshMonitor_cCoefficients *, __Pyx_memviewslice, double);
1589 static struct __pyx_vtabstruct_6mprans_16cMoveMeshMonitor_cCoefficients *__pyx_vtabptr_6mprans_16cMoveMeshMonitor_cCoefficients;
1600 struct __pyx_vtabstruct_array {
1601 PyObject *(*get_memview)(
struct __pyx_array_obj *);
1603 static struct __pyx_vtabstruct_array *__pyx_vtabptr_array;
1614 struct __pyx_vtabstruct_memoryview {
1615 char *(*get_item_pointer)(
struct __pyx_memoryview_obj *, PyObject *);
1616 PyObject *(*is_slice)(
struct __pyx_memoryview_obj *, PyObject *);
1617 PyObject *(*setitem_slice_assignment)(
struct __pyx_memoryview_obj *, PyObject *, PyObject *);
1618 PyObject *(*setitem_slice_assign_scalar)(
struct __pyx_memoryview_obj *,
struct __pyx_memoryview_obj *, PyObject *);
1619 PyObject *(*setitem_indexed)(
struct __pyx_memoryview_obj *, PyObject *, PyObject *);
1620 PyObject *(*convert_item_to_object)(
struct __pyx_memoryview_obj *,
char *);
1621 PyObject *(*assign_item_from_object)(
struct __pyx_memoryview_obj *,
char *, PyObject *);
1623 static struct __pyx_vtabstruct_memoryview *__pyx_vtabptr_memoryview;
1634 struct __pyx_vtabstruct__memoryviewslice {
1635 struct __pyx_vtabstruct_memoryview __pyx_base;
1637 static struct __pyx_vtabstruct__memoryviewslice *__pyx_vtabptr__memoryviewslice;
1641 #ifndef CYTHON_REFNANNY
1642 #define CYTHON_REFNANNY 0
1646 void (*INCREF)(
void*, PyObject*, int);
1647 void (*DECREF)(
void*, PyObject*, int);
1648 void (*GOTREF)(
void*, PyObject*, int);
1649 void (*GIVEREF)(
void*, PyObject*, int);
1650 void* (*SetupContext)(
const char*, int,
const char*);
1651 void (*FinishContext)(
void**);
1652 } __Pyx_RefNannyAPIStruct;
1653 static __Pyx_RefNannyAPIStruct *__Pyx_RefNanny = NULL;
1654 static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(
const char *modname);
1655 #define __Pyx_RefNannyDeclarations void *__pyx_refnanny = NULL;
1657 #define __Pyx_RefNannySetupContext(name, acquire_gil)\
1659 PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();\
1660 __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__);\
1661 PyGILState_Release(__pyx_gilstate_save);\
1663 __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__);\
1666 #define __Pyx_RefNannySetupContext(name, acquire_gil)\
1667 __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__)
1669 #define __Pyx_RefNannyFinishContext()\
1670 __Pyx_RefNanny->FinishContext(&__pyx_refnanny)
1671 #define __Pyx_INCREF(r) __Pyx_RefNanny->INCREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
1672 #define __Pyx_DECREF(r) __Pyx_RefNanny->DECREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
1673 #define __Pyx_GOTREF(r) __Pyx_RefNanny->GOTREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
1674 #define __Pyx_GIVEREF(r) __Pyx_RefNanny->GIVEREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
1675 #define __Pyx_XINCREF(r) do { if((r) != NULL) {__Pyx_INCREF(r); }} while(0)
1676 #define __Pyx_XDECREF(r) do { if((r) != NULL) {__Pyx_DECREF(r); }} while(0)
1677 #define __Pyx_XGOTREF(r) do { if((r) != NULL) {__Pyx_GOTREF(r); }} while(0)
1678 #define __Pyx_XGIVEREF(r) do { if((r) != NULL) {__Pyx_GIVEREF(r);}} while(0)
1680 #define __Pyx_RefNannyDeclarations
1681 #define __Pyx_RefNannySetupContext(name, acquire_gil)
1682 #define __Pyx_RefNannyFinishContext()
1683 #define __Pyx_INCREF(r) Py_INCREF(r)
1684 #define __Pyx_DECREF(r) Py_DECREF(r)
1685 #define __Pyx_GOTREF(r)
1686 #define __Pyx_GIVEREF(r)
1687 #define __Pyx_XINCREF(r) Py_XINCREF(r)
1688 #define __Pyx_XDECREF(r) Py_XDECREF(r)
1689 #define __Pyx_XGOTREF(r)
1690 #define __Pyx_XGIVEREF(r)
1692 #define __Pyx_XDECREF_SET(r, v) do {\
1693 PyObject *tmp = (PyObject *) r;\
1694 r = v; __Pyx_XDECREF(tmp);\
1696 #define __Pyx_DECREF_SET(r, v) do {\
1697 PyObject *tmp = (PyObject *) r;\
1698 r = v; __Pyx_DECREF(tmp);\
1700 #define __Pyx_CLEAR(r) do { PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);} while(0)
1701 #define __Pyx_XCLEAR(r) do { if((r) != NULL) {PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);}} while(0)
1704 #if CYTHON_USE_TYPE_SLOTS
1705 static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name);
1707 #define __Pyx_PyObject_GetAttrStr(o,n) PyObject_GetAttr(o,n)
1711 static PyObject *__Pyx_GetBuiltinName(PyObject *name);
1714 static void __Pyx_RaiseArgtupleInvalid(
const char* func_name,
int exact,
1715 Py_ssize_t num_min, Py_ssize_t num_max, Py_ssize_t num_found);
1718 static int __Pyx_CheckKeywordStrings(PyObject *kwdict,
const char* function_name,
int kw_allowed);
1721 #if PY_MAJOR_VERSION >= 3 && !CYTHON_COMPILING_IN_PYPY
1722 static PyObject *__Pyx_PyDict_GetItem(PyObject *d, PyObject* key);
1723 #define __Pyx_PyObject_Dict_GetItem(obj, name)\
1724 (likely(PyDict_CheckExact(obj)) ?\
1725 __Pyx_PyDict_GetItem(obj, name) : PyObject_GetItem(obj, name))
1727 #define __Pyx_PyDict_GetItem(d, key) PyObject_GetItem(d, key)
1728 #define __Pyx_PyObject_Dict_GetItem(obj, name) PyObject_GetItem(obj, name)
1732 #define __Pyx_GetItemInt(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\
1733 (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\
1734 __Pyx_GetItemInt_Fast(o, (Py_ssize_t)i, is_list, wraparound, boundscheck) :\
1735 (is_list ? (PyErr_SetString(PyExc_IndexError, "list index out of range"), (PyObject*)NULL) :\
1736 __Pyx_GetItemInt_Generic(o, to_py_func(i))))
1737 #define __Pyx_GetItemInt_List(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\
1738 (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\
1739 __Pyx_GetItemInt_List_Fast(o, (Py_ssize_t)i, wraparound, boundscheck) :\
1740 (PyErr_SetString(PyExc_IndexError, "list index out of range"), (PyObject*)NULL))
1741 static CYTHON_INLINE PyObject *__Pyx_GetItemInt_List_Fast(PyObject *o, Py_ssize_t i,
1742 int wraparound,
int boundscheck);
1743 #define __Pyx_GetItemInt_Tuple(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\
1744 (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\
1745 __Pyx_GetItemInt_Tuple_Fast(o, (Py_ssize_t)i, wraparound, boundscheck) :\
1746 (PyErr_SetString(PyExc_IndexError, "tuple index out of range"), (PyObject*)NULL))
1747 static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize_t i,
1748 int wraparound,
int boundscheck);
1749 static PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j);
1750 static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i,
1751 int is_list,
int wraparound,
int boundscheck);
1754 #if CYTHON_USE_TYPE_SLOTS
1755 static CYTHON_INLINE PyObject *__Pyx_PyObject_GetItem(PyObject *obj, PyObject* key);
1757 #define __Pyx_PyObject_GetItem(obj, key) PyObject_GetItem(obj, key)
1761 #define __Pyx_BUF_MAX_NDIMS %(BUF_MAX_NDIMS)d
1762 #define __Pyx_MEMVIEW_DIRECT 1
1763 #define __Pyx_MEMVIEW_PTR 2
1764 #define __Pyx_MEMVIEW_FULL 4
1765 #define __Pyx_MEMVIEW_CONTIG 8
1766 #define __Pyx_MEMVIEW_STRIDED 16
1767 #define __Pyx_MEMVIEW_FOLLOW 32
1768 #define __Pyx_IS_C_CONTIG 1
1769 #define __Pyx_IS_F_CONTIG 2
1770 static int __Pyx_init_memviewslice(
1771 struct __pyx_memoryview_obj *memview,
1773 __Pyx_memviewslice *memviewslice,
1774 int memview_is_new_reference);
1775 static CYTHON_INLINE
int __pyx_add_acquisition_count_locked(
1776 __pyx_atomic_int *acquisition_count, PyThread_type_lock lock);
1777 static CYTHON_INLINE
int __pyx_sub_acquisition_count_locked(
1778 __pyx_atomic_int *acquisition_count, PyThread_type_lock lock);
1779 #define __pyx_get_slice_count_pointer(memview) (memview->acquisition_count_aligned_p)
1780 #define __pyx_get_slice_count(memview) (*__pyx_get_slice_count_pointer(memview))
1781 #define __PYX_INC_MEMVIEW(slice, have_gil) __Pyx_INC_MEMVIEW(slice, have_gil, __LINE__)
1782 #define __PYX_XDEC_MEMVIEW(slice, have_gil) __Pyx_XDEC_MEMVIEW(slice, have_gil, __LINE__)
1783 static CYTHON_INLINE
void __Pyx_INC_MEMVIEW(__Pyx_memviewslice *,
int,
int);
1784 static CYTHON_INLINE
void __Pyx_XDEC_MEMVIEW(__Pyx_memviewslice *,
int,
int);
1787 #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_TYPE_SLOTS
1788 #define __PYX_DICT_VERSION_INIT ((PY_UINT64_T) -1)
1789 #define __PYX_GET_DICT_VERSION(dict) (((PyDictObject*)(dict))->ma_version_tag)
1790 #define __PYX_UPDATE_DICT_CACHE(dict, value, cache_var, version_var)\
1791 (version_var) = __PYX_GET_DICT_VERSION(dict);\
1792 (cache_var) = (value);
1793 #define __PYX_PY_DICT_LOOKUP_IF_MODIFIED(VAR, DICT, LOOKUP) {\
1794 static PY_UINT64_T __pyx_dict_version = 0;\
1795 static PyObject *__pyx_dict_cached_value = NULL;\
1796 if (likely(__PYX_GET_DICT_VERSION(DICT) == __pyx_dict_version)) {\
1797 (VAR) = __pyx_dict_cached_value;\
1799 (VAR) = __pyx_dict_cached_value = (LOOKUP);\
1800 __pyx_dict_version = __PYX_GET_DICT_VERSION(DICT);\
1803 static CYTHON_INLINE PY_UINT64_T __Pyx_get_tp_dict_version(PyObject *obj);
1804 static CYTHON_INLINE PY_UINT64_T __Pyx_get_object_dict_version(PyObject *obj);
1805 static CYTHON_INLINE
int __Pyx_object_dict_version_matches(PyObject* obj, PY_UINT64_T tp_dict_version, PY_UINT64_T obj_dict_version);
1807 #define __PYX_GET_DICT_VERSION(dict) (0)
1808 #define __PYX_UPDATE_DICT_CACHE(dict, value, cache_var, version_var)
1809 #define __PYX_PY_DICT_LOOKUP_IF_MODIFIED(VAR, DICT, LOOKUP) (VAR) = (LOOKUP);
1813 #if CYTHON_USE_DICT_VERSIONS
1814 #define __Pyx_GetModuleGlobalName(var, name) {\
1815 static PY_UINT64_T __pyx_dict_version = 0;\
1816 static PyObject *__pyx_dict_cached_value = NULL;\
1817 (var) = (likely(__pyx_dict_version == __PYX_GET_DICT_VERSION(__pyx_d))) ?\
1818 (likely(__pyx_dict_cached_value) ? __Pyx_NewRef(__pyx_dict_cached_value) : __Pyx_GetBuiltinName(name)) :\
1819 __Pyx__GetModuleGlobalName(name, &__pyx_dict_version, &__pyx_dict_cached_value);\
1821 #define __Pyx_GetModuleGlobalNameUncached(var, name) {\
1822 PY_UINT64_T __pyx_dict_version;\
1823 PyObject *__pyx_dict_cached_value;\
1824 (var) = __Pyx__GetModuleGlobalName(name, &__pyx_dict_version, &__pyx_dict_cached_value);\
1826 static PyObject *__Pyx__GetModuleGlobalName(PyObject *name, PY_UINT64_T *dict_version, PyObject **dict_cached_value);
1828 #define __Pyx_GetModuleGlobalName(var, name) (var) = __Pyx__GetModuleGlobalName(name)
1829 #define __Pyx_GetModuleGlobalNameUncached(var, name) (var) = __Pyx__GetModuleGlobalName(name)
1830 static CYTHON_INLINE PyObject *__Pyx__GetModuleGlobalName(PyObject *name);
1834 #if CYTHON_FAST_PYCALL
1835 #define __Pyx_PyFunction_FastCall(func, args, nargs)\
1836 __Pyx_PyFunction_FastCallDict((func), (args), (nargs), NULL)
1837 #if 1 || PY_VERSION_HEX < 0x030600B1
1838 static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args, Py_ssize_t nargs, PyObject *kwargs);
1840 #define __Pyx_PyFunction_FastCallDict(func, args, nargs, kwargs) _PyFunction_FastCallDict(func, args, nargs, kwargs)
1842 #define __Pyx_BUILD_ASSERT_EXPR(cond)\
1843 (sizeof(char [1 - 2*!(cond)]) - 1)
1844 #ifndef Py_MEMBER_SIZE
1845 #define Py_MEMBER_SIZE(type, member) sizeof(((type *)0)->member)
1847 #if CYTHON_FAST_PYCALL
1848 static size_t __pyx_pyframe_localsplus_offset = 0;
1849 #include "frameobject.h"
1850 #if PY_VERSION_HEX >= 0x030b00a6
1851 #ifndef Py_BUILD_CORE
1852 #define Py_BUILD_CORE 1
1854 #include "internal/pycore_frame.h"
1856 #define __Pxy_PyFrame_Initialize_Offsets()\
1857 ((void)__Pyx_BUILD_ASSERT_EXPR(sizeof(PyFrameObject) == offsetof(PyFrameObject, f_localsplus) + Py_MEMBER_SIZE(PyFrameObject, f_localsplus)),\
1858 (void)(__pyx_pyframe_localsplus_offset = ((size_t)PyFrame_Type.tp_basicsize) - Py_MEMBER_SIZE(PyFrameObject, f_localsplus)))
1859 #define __Pyx_PyFrame_GetLocalsplus(frame)\
1860 (assert(__pyx_pyframe_localsplus_offset), (PyObject **)(((char *)(frame)) + __pyx_pyframe_localsplus_offset))
1861 #endif // CYTHON_FAST_PYCALL
1865 #if CYTHON_COMPILING_IN_CPYTHON
1866 static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw);
1868 #define __Pyx_PyObject_Call(func, arg, kw) PyObject_Call(func, arg, kw)
1872 #if CYTHON_COMPILING_IN_CPYTHON
1873 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg);
1877 #if CYTHON_COMPILING_IN_CPYTHON
1878 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallNoArg(PyObject *func);
1880 #define __Pyx_PyObject_CallNoArg(func) __Pyx_PyObject_Call(func, __pyx_empty_tuple, NULL)
1884 #if CYTHON_FAST_PYCCALL
1885 static CYTHON_INLINE PyObject *__Pyx_PyCFunction_FastCall(PyObject *func, PyObject **args, Py_ssize_t nargs);
1887 #define __Pyx_PyCFunction_FastCall(func, args, nargs) (assert(0), NULL)
1891 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg);
1894 static void __Pyx_RaiseDoubleKeywordsError(
const char* func_name, PyObject* kw_name);
1897 static int __Pyx_ParseOptionalKeywords(PyObject *kwds, PyObject **argnames[],\
1898 PyObject *kwds2, PyObject *values[], Py_ssize_t num_pos_args,\
1899 const char* function_name);
1902 #if PY_MAJOR_VERSION < 3
1903 static CYTHON_INLINE PyObject* __Pyx_PyInt_FromDouble(
double value);
1905 #define __Pyx_PyInt_FromDouble(value) PyLong_FromDouble(value)
1909 static CYTHON_INLINE PyObject* __Pyx_PyObject_GetSlice(
1910 PyObject* obj, Py_ssize_t cstart, Py_ssize_t cstop,
1911 PyObject** py_start, PyObject** py_stop, PyObject** py_slice,
1912 int has_cstart,
int has_cstop,
int wraparound);
1915 static CYTHON_UNUSED PyObject* __Pyx_PyObject_Call2Args(PyObject*
function, PyObject* arg1, PyObject* arg2);
1918 #if CYTHON_USE_PYLIST_INTERNALS && CYTHON_ASSUME_SAFE_MACROS
1919 static CYTHON_INLINE
int __Pyx_ListComp_Append(PyObject* list, PyObject* x) {
1920 PyListObject*
L = (PyListObject*) list;
1921 Py_ssize_t len = Py_SIZE(list);
1922 if (likely(
L->allocated > len)) {
1924 PyList_SET_ITEM(list, len, x);
1925 __Pyx_SET_SIZE(list, len + 1);
1928 return PyList_Append(list, x);
1931 #define __Pyx_ListComp_Append(L,x) PyList_Append(L,x)
1935 #if CYTHON_FAST_THREAD_STATE
1936 #define __Pyx_PyThreadState_declare PyThreadState *__pyx_tstate;
1937 #define __Pyx_PyThreadState_assign __pyx_tstate = __Pyx_PyThreadState_Current;
1938 #define __Pyx_PyErr_Occurred() __pyx_tstate->curexc_type
1940 #define __Pyx_PyThreadState_declare
1941 #define __Pyx_PyThreadState_assign
1942 #define __Pyx_PyErr_Occurred() PyErr_Occurred()
1946 #if CYTHON_FAST_THREAD_STATE
1947 #define __Pyx_PyErr_Clear() __Pyx_ErrRestore(NULL, NULL, NULL)
1948 #define __Pyx_ErrRestoreWithState(type, value, tb) __Pyx_ErrRestoreInState(PyThreadState_GET(), type, value, tb)
1949 #define __Pyx_ErrFetchWithState(type, value, tb) __Pyx_ErrFetchInState(PyThreadState_GET(), type, value, tb)
1950 #define __Pyx_ErrRestore(type, value, tb) __Pyx_ErrRestoreInState(__pyx_tstate, type, value, tb)
1951 #define __Pyx_ErrFetch(type, value, tb) __Pyx_ErrFetchInState(__pyx_tstate, type, value, tb)
1952 static CYTHON_INLINE
void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb);
1953 static CYTHON_INLINE
void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb);
1954 #if CYTHON_COMPILING_IN_CPYTHON
1955 #define __Pyx_PyErr_SetNone(exc) (Py_INCREF(exc), __Pyx_ErrRestore((exc), NULL, NULL))
1957 #define __Pyx_PyErr_SetNone(exc) PyErr_SetNone(exc)
1960 #define __Pyx_PyErr_Clear() PyErr_Clear()
1961 #define __Pyx_PyErr_SetNone(exc) PyErr_SetNone(exc)
1962 #define __Pyx_ErrRestoreWithState(type, value, tb) PyErr_Restore(type, value, tb)
1963 #define __Pyx_ErrFetchWithState(type, value, tb) PyErr_Fetch(type, value, tb)
1964 #define __Pyx_ErrRestoreInState(tstate, type, value, tb) PyErr_Restore(type, value, tb)
1965 #define __Pyx_ErrFetchInState(tstate, type, value, tb) PyErr_Fetch(type, value, tb)
1966 #define __Pyx_ErrRestore(type, value, tb) PyErr_Restore(type, value, tb)
1967 #define __Pyx_ErrFetch(type, value, tb) PyErr_Fetch(type, value, tb)
1971 static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause);
1974 #if CYTHON_USE_EXC_INFO_STACK
1975 static _PyErr_StackItem * __Pyx_PyErr_GetTopmostException(PyThreadState *tstate);
1979 #if CYTHON_FAST_THREAD_STATE
1980 #define __Pyx_ExceptionSave(type, value, tb) __Pyx__ExceptionSave(__pyx_tstate, type, value, tb)
1981 static CYTHON_INLINE
void __Pyx__ExceptionSave(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb);
1982 #define __Pyx_ExceptionReset(type, value, tb) __Pyx__ExceptionReset(__pyx_tstate, type, value, tb)
1983 static CYTHON_INLINE
void __Pyx__ExceptionReset(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb);
1985 #define __Pyx_ExceptionSave(type, value, tb) PyErr_GetExcInfo(type, value, tb)
1986 #define __Pyx_ExceptionReset(type, value, tb) PyErr_SetExcInfo(type, value, tb)
1990 #if CYTHON_FAST_THREAD_STATE
1991 #define __Pyx_PyErr_ExceptionMatches(err) __Pyx_PyErr_ExceptionMatchesInState(__pyx_tstate, err)
1992 static CYTHON_INLINE
int __Pyx_PyErr_ExceptionMatchesInState(PyThreadState* tstate, PyObject* err);
1994 #define __Pyx_PyErr_ExceptionMatches(err) PyErr_ExceptionMatches(err)
1998 #if CYTHON_FAST_THREAD_STATE
1999 #define __Pyx_GetException(type, value, tb) __Pyx__GetException(__pyx_tstate, type, value, tb)
2000 static int __Pyx__GetException(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb);
2002 static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb);
2006 #if !CYTHON_COMPILING_IN_PYPY
2007 static PyObject* __Pyx_PyInt_SubtractObjC(PyObject *op1, PyObject *op2,
long intval,
int inplace,
int zerodivision_check);
2009 #define __Pyx_PyInt_SubtractObjC(op1, op2, intval, inplace, zerodivision_check)\
2010 (inplace ? PyNumber_InPlaceSubtract(op1, op2) : PyNumber_Subtract(op1, op2))
2014 #define __Pyx_PyObject_DelSlice(obj, cstart, cstop, py_start, py_stop, py_slice, has_cstart, has_cstop, wraparound)\
2015 __Pyx_PyObject_SetSlice(obj, (PyObject*)NULL, cstart, cstop, py_start, py_stop, py_slice, has_cstart, has_cstop, wraparound)
2016 static CYTHON_INLINE
int __Pyx_PyObject_SetSlice(
2017 PyObject* obj, PyObject* value, Py_ssize_t cstart, Py_ssize_t cstop,
2018 PyObject** py_start, PyObject** py_stop, PyObject** py_slice,
2019 int has_cstart,
int has_cstop,
int wraparound);
2022 static CYTHON_INLINE PyObject* __Pyx_PyInt_EqObjC(PyObject *op1, PyObject *op2,
long intval,
long inplace);
2025 static CYTHON_INLINE
void __Pyx_RaiseUnboundLocalError(
const char *varname);
2028 #if !CYTHON_COMPILING_IN_PYPY
2029 static PyObject* __Pyx_PyInt_AddObjC(PyObject *op1, PyObject *op2,
long intval,
int inplace,
int zerodivision_check);
2031 #define __Pyx_PyInt_AddObjC(op1, op2, intval, inplace, zerodivision_check)\
2032 (inplace ? PyNumber_InPlaceAdd(op1, op2) : PyNumber_Add(op1, op2))
2036 #define __Pyx_SetItemInt(o, i, v, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\
2037 (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\
2038 __Pyx_SetItemInt_Fast(o, (Py_ssize_t)i, v, is_list, wraparound, boundscheck) :\
2039 (is_list ? (PyErr_SetString(PyExc_IndexError, "list assignment index out of range"), -1) :\
2040 __Pyx_SetItemInt_Generic(o, to_py_func(i), v)))
2041 static int __Pyx_SetItemInt_Generic(PyObject *o, PyObject *j, PyObject *
v);
2042 static CYTHON_INLINE
int __Pyx_SetItemInt_Fast(PyObject *o, Py_ssize_t i, PyObject *
v,
2043 int is_list,
int wraparound,
int boundscheck);
2046 #define __Pyx_ArgTypeTest(obj, type, none_allowed, name, exact)\
2047 ((likely((Py_TYPE(obj) == type) | (none_allowed && (obj == Py_None)))) ? 1 :\
2048 __Pyx__ArgTypeTest(obj, type, name, exact))
2049 static int __Pyx__ArgTypeTest(PyObject *obj, PyTypeObject *type,
const char *name,
int exact);
2055 static CYTHON_INLINE
int __Pyx_PyBytes_Equals(PyObject* s1, PyObject* s2,
int equals);
2058 static CYTHON_INLINE
int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2,
int equals);
2061 #if PY_MAJOR_VERSION >= 3
2062 #define __Pyx_PyString_Equals __Pyx_PyUnicode_Equals
2064 #define __Pyx_PyString_Equals __Pyx_PyBytes_Equals
2068 #define UNARY_NEG_WOULD_OVERFLOW(x)\
2069 (((x) < 0) & ((unsigned long)(x) == 0-(unsigned long)(x)))
2071 static CYTHON_UNUSED
int __pyx_array_getbuffer(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info,
int __pyx_v_flags);
2072 static PyObject *__pyx_array_get_memview(
struct __pyx_array_obj *);
2074 static CYTHON_INLINE PyObject *__Pyx_GetAttr(PyObject *, PyObject *);
2077 static CYTHON_INLINE PyObject *__Pyx_PyUnicode_DecodeUTF16(
const char *
s, Py_ssize_t size,
const char *errors) {
2079 return PyUnicode_DecodeUTF16(
s, size, errors, &byteorder);
2081 static CYTHON_INLINE PyObject *__Pyx_PyUnicode_DecodeUTF16LE(
const char *
s, Py_ssize_t size,
const char *errors) {
2083 return PyUnicode_DecodeUTF16(
s, size, errors, &byteorder);
2085 static CYTHON_INLINE PyObject *__Pyx_PyUnicode_DecodeUTF16BE(
const char *
s, Py_ssize_t size,
const char *errors) {
2087 return PyUnicode_DecodeUTF16(
s, size, errors, &byteorder);
2091 static CYTHON_INLINE PyObject* __Pyx_decode_c_string(
2092 const char* cstring, Py_ssize_t start, Py_ssize_t stop,
2093 const char* encoding,
const char* errors,
2094 PyObject* (*decode_func)(
const char *
s, Py_ssize_t size,
const char *errors));
2097 static CYTHON_INLINE PyObject *__Pyx_GetAttr3(PyObject *, PyObject *, PyObject *);
2100 static CYTHON_INLINE
void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected);
2103 static CYTHON_INLINE
void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index);
2106 static CYTHON_INLINE
void __Pyx_RaiseNoneNotIterableError(
void);
2109 static CYTHON_INLINE
int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type);
2112 #if CYTHON_FAST_THREAD_STATE
2113 #define __Pyx_ExceptionSwap(type, value, tb) __Pyx__ExceptionSwap(__pyx_tstate, type, value, tb)
2114 static CYTHON_INLINE
void __Pyx__ExceptionSwap(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb);
2116 static CYTHON_INLINE
void __Pyx_ExceptionSwap(PyObject **type, PyObject **value, PyObject **tb);
2120 static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list,
int level);
2123 #if CYTHON_COMPILING_IN_CPYTHON
2124 #define __Pyx_TypeCheck(obj, type) __Pyx_IsSubtype(Py_TYPE(obj), (PyTypeObject *)type)
2125 static CYTHON_INLINE
int __Pyx_IsSubtype(PyTypeObject *a, PyTypeObject *b);
2126 static CYTHON_INLINE
int __Pyx_PyErr_GivenExceptionMatches(PyObject *err, PyObject *type);
2127 static CYTHON_INLINE
int __Pyx_PyErr_GivenExceptionMatches2(PyObject *err, PyObject *type1, PyObject *type2);
2129 #define __Pyx_TypeCheck(obj, type) PyObject_TypeCheck(obj, (PyTypeObject *)type)
2130 #define __Pyx_PyErr_GivenExceptionMatches(err, type) PyErr_GivenExceptionMatches(err, type)
2131 #define __Pyx_PyErr_GivenExceptionMatches2(err, type1, type2) (PyErr_GivenExceptionMatches(err, type1) || PyErr_GivenExceptionMatches(err, type2))
2133 #define __Pyx_PyException_Check(obj) __Pyx_TypeCheck(obj, PyExc_Exception)
2135 static CYTHON_UNUSED
int __pyx_memoryview_getbuffer(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info,
int __pyx_v_flags);
2137 static CYTHON_INLINE
int __Pyx_PyList_Extend(PyObject*
L, PyObject*
v) {
2138 #if CYTHON_COMPILING_IN_CPYTHON
2139 PyObject* none = _PyList_Extend((PyListObject*)
L,
v);
2140 if (unlikely(!none))
2145 return PyList_SetSlice(
L, PY_SSIZE_T_MAX, PY_SSIZE_T_MAX,
v);
2150 #if CYTHON_USE_PYLIST_INTERNALS && CYTHON_ASSUME_SAFE_MACROS
2151 static CYTHON_INLINE
int __Pyx_PyList_Append(PyObject* list, PyObject* x) {
2152 PyListObject*
L = (PyListObject*) list;
2153 Py_ssize_t len = Py_SIZE(list);
2154 if (likely(
L->allocated > len) & likely(len > (
L->allocated >> 1))) {
2156 PyList_SET_ITEM(list, len, x);
2157 __Pyx_SET_SIZE(list, len + 1);
2160 return PyList_Append(list, x);
2163 #define __Pyx_PyList_Append(L,x) PyList_Append(L,x)
2167 static CYTHON_INLINE
int __Pyx_PySequence_ContainsTF(PyObject* item, PyObject* seq,
int eq) {
2168 int result = PySequence_Contains(seq, item);
2169 return unlikely(result < 0) ? result : (result == (eq == Py_EQ));
2173 static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name);
2176 static CYTHON_INLINE
int __Pyx_HasAttr(PyObject *, PyObject *);
2179 #if PY_MAJOR_VERSION < 3
2180 #define __Pyx_PyString_Join __Pyx_PyBytes_Join
2181 #define __Pyx_PyBaseString_Join(s, v) (PyUnicode_CheckExact(s) ? PyUnicode_Join(s, v) : __Pyx_PyBytes_Join(s, v))
2183 #define __Pyx_PyString_Join PyUnicode_Join
2184 #define __Pyx_PyBaseString_Join PyUnicode_Join
2186 #if CYTHON_COMPILING_IN_CPYTHON
2187 #if PY_MAJOR_VERSION < 3
2188 #define __Pyx_PyBytes_Join _PyString_Join
2190 #define __Pyx_PyBytes_Join _PyBytes_Join
2193 static CYTHON_INLINE PyObject* __Pyx_PyBytes_Join(PyObject* sep, PyObject* values);
2197 #if PY_MAJOR_VERSION >= 3
2198 #define __Pyx_PyObject_Unicode(obj)\
2199 (likely(PyUnicode_CheckExact(obj)) ? __Pyx_NewRef(obj) : PyObject_Str(obj))
2201 #define __Pyx_PyObject_Unicode(obj)\
2202 (likely(PyUnicode_CheckExact(obj)) ? __Pyx_NewRef(obj) : PyObject_Unicode(obj))
2206 #if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000
2207 static CYTHON_INLINE PyObject* __Pyx_PyObject_GenericGetAttrNoDict(PyObject* obj, PyObject* attr_name);
2209 #define __Pyx_PyObject_GenericGetAttrNoDict PyObject_GenericGetAttr
2213 #if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000
2214 static PyObject* __Pyx_PyObject_GenericGetAttr(PyObject* obj, PyObject* attr_name);
2216 #define __Pyx_PyObject_GenericGetAttr PyObject_GenericGetAttr
2220 static int __Pyx_SetVtable(PyObject *dict,
void *vtable);
2223 static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStrNoError(PyObject* obj, PyObject* attr_name);
2226 static int __Pyx_setup_reduce(PyObject* type_obj);
2229 #ifndef __PYX_HAVE_RT_ImportType_proto
2230 #define __PYX_HAVE_RT_ImportType_proto
2231 enum __Pyx_ImportType_CheckSize {
2232 __Pyx_ImportType_CheckSize_Error = 0,
2233 __Pyx_ImportType_CheckSize_Warn = 1,
2234 __Pyx_ImportType_CheckSize_Ignore = 2
2236 static PyTypeObject *__Pyx_ImportType(PyObject* module,
const char *module_name,
const char *class_name,
size_t size,
enum __Pyx_ImportType_CheckSize check_size);
2240 #ifdef CYTHON_CLINE_IN_TRACEBACK
2241 #define __Pyx_CLineForTraceback(tstate, c_line) (((CYTHON_CLINE_IN_TRACEBACK)) ? c_line : 0)
2243 static int __Pyx_CLineForTraceback(PyThreadState *tstate,
int c_line);
2248 PyCodeObject* code_object;
2250 } __Pyx_CodeObjectCacheEntry;
2251 struct __Pyx_CodeObjectCache {
2254 __Pyx_CodeObjectCacheEntry* entries;
2256 static struct __Pyx_CodeObjectCache __pyx_code_cache = {0,0,NULL};
2257 static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries,
int count,
int code_line);
2258 static PyCodeObject *__pyx_find_code_object(
int code_line);
2259 static void __pyx_insert_code_object(
int code_line, PyCodeObject* code_object);
2262 static void __Pyx_AddTraceback(
const char *funcname,
int c_line,
2263 int py_line,
const char *filename);
2265 #if PY_MAJOR_VERSION < 3
2266 static int __Pyx_GetBuffer(PyObject *obj, Py_buffer *view,
int flags);
2267 static void __Pyx_ReleaseBuffer(Py_buffer *view);
2269 #define __Pyx_GetBuffer PyObject_GetBuffer
2270 #define __Pyx_ReleaseBuffer PyBuffer_Release
2276 Py_ssize_t shape, strides, suboffsets;
2277 } __Pyx_Buf_DimInfo;
2283 __Pyx_Buffer *rcbuffer;
2285 __Pyx_Buf_DimInfo diminfo[8];
2286 } __Pyx_LocalBuf_ND;
2289 static int __pyx_memviewslice_is_contig(
const __Pyx_memviewslice mvs,
char order,
int ndim);
2292 static int __pyx_slices_overlap(__Pyx_memviewslice *slice1,
2293 __Pyx_memviewslice *slice2,
2294 int ndim,
size_t itemsize);
2297 static CYTHON_INLINE PyObject *__pyx_capsule_create(
void *p,
const char *sig);
2300 static CYTHON_INLINE
int __Pyx_Is_Little_Endian(
void);
2303 static const char* __Pyx_BufFmt_CheckString(__Pyx_BufFmt_Context* ctx,
const char* ts);
2304 static void __Pyx_BufFmt_Init(__Pyx_BufFmt_Context* ctx,
2305 __Pyx_BufFmt_StackElem* stack,
2306 __Pyx_TypeInfo* type);
2309 static int __pyx_typeinfo_cmp(__Pyx_TypeInfo *a, __Pyx_TypeInfo *b);
2312 static int __Pyx_ValidateAndInit_memviewslice(
2317 __Pyx_TypeInfo *dtype,
2318 __Pyx_BufFmt_StackElem stack[],
2319 __Pyx_memviewslice *memviewslice,
2320 PyObject *original_obj);
2323 static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_ds_double(PyObject *,
int writable_flag);
2326 static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_ds_int(PyObject *,
int writable_flag);
2329 #if defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 6))
2330 #define __Pyx_HAS_GCC_DIAGNOSTIC
2334 static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_dsdsds_double(PyObject *,
int writable_flag);
2337 static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_dsds_double(PyObject *,
int writable_flag);
2340 static CYTHON_INLINE PyObject *__pyx_memview_get_double(
const char *itemp);
2341 static CYTHON_INLINE
int __pyx_memview_set_double(
const char *itemp, PyObject *obj);
2344 static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_dsds_int(PyObject *,
int writable_flag);
2347 static int __Pyx_Print(PyObject*, PyObject *,
int);
2348 #if CYTHON_COMPILING_IN_PYPY || PY_MAJOR_VERSION >= 3
2349 static PyObject* __pyx_print = 0;
2350 static PyObject* __pyx_print_kwargs = 0;
2354 static CYTHON_INLINE PyObject *__pyx_memview_get_int(
const char *itemp);
2355 static CYTHON_INLINE
int __pyx_memview_set_int(
const char *itemp, PyObject *obj);
2360 #define __Pyx_CREAL(z) ((z).real())
2361 #define __Pyx_CIMAG(z) ((z).imag())
2363 #define __Pyx_CREAL(z) (__real__(z))
2364 #define __Pyx_CIMAG(z) (__imag__(z))
2367 #define __Pyx_CREAL(z) ((z).real)
2368 #define __Pyx_CIMAG(z) ((z).imag)
2370 #if defined(__cplusplus) && CYTHON_CCOMPLEX\
2371 && (defined(_WIN32) || defined(__clang__) || (defined(__GNUC__) && (__GNUC__ >= 5 || __GNUC__ == 4 && __GNUC_MINOR__ >= 4 )) || __cplusplus >= 201103)
2372 #define __Pyx_SET_CREAL(z,x) ((z).real(x))
2373 #define __Pyx_SET_CIMAG(z,y) ((z).imag(y))
2375 #define __Pyx_SET_CREAL(z,x) __Pyx_CREAL(z) = (x)
2376 #define __Pyx_SET_CIMAG(z,y) __Pyx_CIMAG(z) = (y)
2381 #define __Pyx_c_eq_float(a, b) ((a)==(b))
2382 #define __Pyx_c_sum_float(a, b) ((a)+(b))
2383 #define __Pyx_c_diff_float(a, b) ((a)-(b))
2384 #define __Pyx_c_prod_float(a, b) ((a)*(b))
2385 #define __Pyx_c_quot_float(a, b) ((a)/(b))
2386 #define __Pyx_c_neg_float(a) (-(a))
2388 #define __Pyx_c_is_zero_float(z) ((z)==(float)0)
2389 #define __Pyx_c_conj_float(z) (::std::conj(z))
2391 #define __Pyx_c_abs_float(z) (::std::abs(z))
2392 #define __Pyx_c_pow_float(a, b) (::std::pow(a, b))
2395 #define __Pyx_c_is_zero_float(z) ((z)==0)
2396 #define __Pyx_c_conj_float(z) (conjf(z))
2398 #define __Pyx_c_abs_float(z) (cabsf(z))
2399 #define __Pyx_c_pow_float(a, b) (cpowf(a, b))
2403 static CYTHON_INLINE
int __Pyx_c_eq_float(__pyx_t_float_complex, __pyx_t_float_complex);
2404 static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_sum_float(__pyx_t_float_complex, __pyx_t_float_complex);
2405 static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_diff_float(__pyx_t_float_complex, __pyx_t_float_complex);
2406 static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_prod_float(__pyx_t_float_complex, __pyx_t_float_complex);
2407 static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_quot_float(__pyx_t_float_complex, __pyx_t_float_complex);
2408 static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_neg_float(__pyx_t_float_complex);
2409 static CYTHON_INLINE
int __Pyx_c_is_zero_float(__pyx_t_float_complex);
2410 static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_conj_float(__pyx_t_float_complex);
2412 static CYTHON_INLINE
float __Pyx_c_abs_float(__pyx_t_float_complex);
2413 static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_pow_float(__pyx_t_float_complex, __pyx_t_float_complex);
2419 #define __Pyx_c_eq_double(a, b) ((a)==(b))
2420 #define __Pyx_c_sum_double(a, b) ((a)+(b))
2421 #define __Pyx_c_diff_double(a, b) ((a)-(b))
2422 #define __Pyx_c_prod_double(a, b) ((a)*(b))
2423 #define __Pyx_c_quot_double(a, b) ((a)/(b))
2424 #define __Pyx_c_neg_double(a) (-(a))
2426 #define __Pyx_c_is_zero_double(z) ((z)==(double)0)
2427 #define __Pyx_c_conj_double(z) (::std::conj(z))
2429 #define __Pyx_c_abs_double(z) (::std::abs(z))
2430 #define __Pyx_c_pow_double(a, b) (::std::pow(a, b))
2433 #define __Pyx_c_is_zero_double(z) ((z)==0)
2434 #define __Pyx_c_conj_double(z) (conj(z))
2436 #define __Pyx_c_abs_double(z) (cabs(z))
2437 #define __Pyx_c_pow_double(a, b) (cpow(a, b))
2441 static CYTHON_INLINE
int __Pyx_c_eq_double(__pyx_t_double_complex, __pyx_t_double_complex);
2442 static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_sum_double(__pyx_t_double_complex, __pyx_t_double_complex);
2443 static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_diff_double(__pyx_t_double_complex, __pyx_t_double_complex);
2444 static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_prod_double(__pyx_t_double_complex, __pyx_t_double_complex);
2445 static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_quot_double(__pyx_t_double_complex, __pyx_t_double_complex);
2446 static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_neg_double(__pyx_t_double_complex);
2447 static CYTHON_INLINE
int __Pyx_c_is_zero_double(__pyx_t_double_complex);
2448 static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_conj_double(__pyx_t_double_complex);
2450 static CYTHON_INLINE
double __Pyx_c_abs_double(__pyx_t_double_complex);
2451 static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_pow_double(__pyx_t_double_complex, __pyx_t_double_complex);
2456 static __Pyx_memviewslice
2457 __pyx_memoryview_copy_new_contig(
const __Pyx_memviewslice *from_mvs,
2458 const char *mode,
int ndim,
2459 size_t sizeof_dtype,
int contig_flag,
2460 int dtype_is_object);
2463 static CYTHON_INLINE
int __Pyx_PyInt_As_int(PyObject *);
2466 static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(
int value);
2469 static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(
long value);
2472 struct __pyx_typeinfo_string {
2475 static struct __pyx_typeinfo_string __Pyx_TypeInfoToFormat(__Pyx_TypeInfo *type);
2478 static int __Pyx_PrintOne(PyObject* stream, PyObject *o);
2481 static CYTHON_INLINE
long __Pyx_PyInt_As_long(PyObject *);
2484 static CYTHON_INLINE
char __Pyx_PyInt_As_char(PyObject *);
2487 static PyTypeObject* __Pyx_FetchCommonType(PyTypeObject* type);
2490 static int __Pyx_PyObject_GetMethod(PyObject *obj, PyObject *name, PyObject **method);
2493 static PyObject* __Pyx_PyObject_CallMethod1(PyObject* obj, PyObject* method_name, PyObject* arg);
2496 typedef PyObject *(*__pyx_coroutine_body_t)(PyObject *, PyThreadState *, PyObject *);
2497 #if CYTHON_USE_EXC_INFO_STACK
2498 #define __Pyx_ExcInfoStruct _PyErr_StackItem
2502 PyObject *exc_value;
2503 PyObject *exc_traceback;
2504 } __Pyx_ExcInfoStruct;
2508 __pyx_coroutine_body_t body;
2510 __Pyx_ExcInfoStruct gi_exc_state;
2511 PyObject *gi_weakreflist;
2513 PyObject *yieldfrom;
2515 PyObject *gi_qualname;
2516 PyObject *gi_modulename;
2521 } __pyx_CoroutineObject;
2522 static __pyx_CoroutineObject *__Pyx__Coroutine_New(
2523 PyTypeObject *type, __pyx_coroutine_body_t body, PyObject *code, PyObject *closure,
2524 PyObject *name, PyObject *qualname, PyObject *module_name);
2525 static __pyx_CoroutineObject *__Pyx__Coroutine_NewInit(
2526 __pyx_CoroutineObject *gen, __pyx_coroutine_body_t body, PyObject *code, PyObject *closure,
2527 PyObject *name, PyObject *qualname, PyObject *module_name);
2528 static CYTHON_INLINE
void __Pyx_Coroutine_ExceptionClear(__Pyx_ExcInfoStruct *
self);
2529 static int __Pyx_Coroutine_clear(PyObject *
self);
2530 static PyObject *__Pyx_Coroutine_Send(PyObject *
self, PyObject *value);
2531 static PyObject *__Pyx_Coroutine_Close(PyObject *
self);
2532 static PyObject *__Pyx_Coroutine_Throw(PyObject *gen, PyObject *args);
2533 #if CYTHON_USE_EXC_INFO_STACK
2534 #define __Pyx_Coroutine_SwapException(self)
2535 #define __Pyx_Coroutine_ResetAndClearException(self) __Pyx_Coroutine_ExceptionClear(&(self)->gi_exc_state)
2537 #define __Pyx_Coroutine_SwapException(self) {\
2538 __Pyx_ExceptionSwap(&(self)->gi_exc_state.exc_type, &(self)->gi_exc_state.exc_value, &(self)->gi_exc_state.exc_traceback);\
2539 __Pyx_Coroutine_ResetFrameBackpointer(&(self)->gi_exc_state);\
2541 #define __Pyx_Coroutine_ResetAndClearException(self) {\
2542 __Pyx_ExceptionReset((self)->gi_exc_state.exc_type, (self)->gi_exc_state.exc_value, (self)->gi_exc_state.exc_traceback);\
2543 (self)->gi_exc_state.exc_type = (self)->gi_exc_state.exc_value = (self)->gi_exc_state.exc_traceback = NULL;\
2546 #if CYTHON_FAST_THREAD_STATE
2547 #define __Pyx_PyGen_FetchStopIterationValue(pvalue)\
2548 __Pyx_PyGen__FetchStopIterationValue(__pyx_tstate, pvalue)
2550 #define __Pyx_PyGen_FetchStopIterationValue(pvalue)\
2551 __Pyx_PyGen__FetchStopIterationValue(__Pyx_PyThreadState_Current, pvalue)
2553 static int __Pyx_PyGen__FetchStopIterationValue(PyThreadState *tstate, PyObject **pvalue);
2554 static CYTHON_INLINE
void __Pyx_Coroutine_ResetFrameBackpointer(__Pyx_ExcInfoStruct *exc_state);
2557 static PyObject* __Pyx_Coroutine_patch_module(PyObject* module,
const char* py_code);
2560 static int __Pyx_patch_abc(
void);
2563 #define __Pyx_Generator_USED
2564 static PyTypeObject *__pyx_GeneratorType = 0;
2565 #define __Pyx_Generator_CheckExact(obj) (Py_TYPE(obj) == __pyx_GeneratorType)
2566 #define __Pyx_Generator_New(body, code, closure, name, qualname, module_name)\
2567 __Pyx__Coroutine_New(__pyx_GeneratorType, body, code, closure, name, qualname, module_name)
2568 static PyObject *__Pyx_Generator_Next(PyObject *
self);
2569 static int __pyx_Generator_init(
void);
2572 static int __Pyx_check_binary_version(
void);
2575 static int __Pyx_ImportFunction(PyObject *module,
const char *funcname,
void (**
f)(
void),
const char *sig);
2578 static int __Pyx_InitStrings(__Pyx_StringTabEntry *t);
2580 static PyObject *__pyx_f_6mprans_16cMoveMeshMonitor_13cCoefficients_cppPreStep(
struct __pyx_obj_6mprans_16cMoveMeshMonitor_cCoefficients *__pyx_v_self, __Pyx_memviewslice __pyx_v_q_uOfX, __Pyx_memviewslice __pyx_v_q_J, __Pyx_memviewslice __pyx_v_q_weights, __Pyx_memviewslice __pyx_v_areas_, __Pyx_memviewslice __pyx_v_q_rci, __Pyx_memviewslice __pyx_v_q_fci,
int __pyx_v_nElements_owned);
2581 static PyObject *__pyx_f_6mprans_16cMoveMeshMonitor_13cCoefficients_cppPostStep(
struct __pyx_obj_6mprans_16cMoveMeshMonitor_cCoefficients *__pyx_v_self);
2582 static PyObject *__pyx_f_6mprans_16cMoveMeshMonitor_13cCoefficients_cppPseudoTimeSteppingParallel(
struct __pyx_obj_6mprans_16cMoveMeshMonitor_cCoefficients *__pyx_v_self, __Pyx_memviewslice __pyx_v_xx,
double __pyx_v_eps);
2583 static PyObject *__pyx_array_get_memview(
struct __pyx_array_obj *__pyx_v_self);
2584 static char *__pyx_memoryview_get_item_pointer(
struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index);
2585 static PyObject *__pyx_memoryview_is_slice(
struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_obj);
2586 static PyObject *__pyx_memoryview_setitem_slice_assignment(
struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_dst, PyObject *__pyx_v_src);
2587 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);
2588 static PyObject *__pyx_memoryview_setitem_indexed(
struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index, PyObject *__pyx_v_value);
2589 static PyObject *__pyx_memoryview_convert_item_to_object(
struct __pyx_memoryview_obj *__pyx_v_self,
char *__pyx_v_itemp);
2590 static PyObject *__pyx_memoryview_assign_item_from_object(
struct __pyx_memoryview_obj *__pyx_v_self,
char *__pyx_v_itemp, PyObject *__pyx_v_value);
2591 static PyObject *__pyx_memoryviewslice_convert_item_to_object(
struct __pyx_memoryviewslice_obj *__pyx_v_self,
char *__pyx_v_itemp);
2592 static PyObject *__pyx_memoryviewslice_assign_item_from_object(
struct __pyx_memoryviewslice_obj *__pyx_v_self,
char *__pyx_v_itemp, PyObject *__pyx_v_value);
2595 static struct __pyx_array_obj *__pyx_array_new(PyObject *, Py_ssize_t,
char *,
char *,
char *);
2608 static PyTypeObject *__pyx_ptype_7cpython_4type_type = 0;
2621 static PyTypeObject *__pyx_ptype_5numpy_dtype = 0;
2622 static PyTypeObject *__pyx_ptype_5numpy_flatiter = 0;
2623 static PyTypeObject *__pyx_ptype_5numpy_broadcast = 0;
2624 static PyTypeObject *__pyx_ptype_5numpy_ndarray = 0;
2625 static PyTypeObject *__pyx_ptype_5numpy_generic = 0;
2626 static PyTypeObject *__pyx_ptype_5numpy_number = 0;
2627 static PyTypeObject *__pyx_ptype_5numpy_integer = 0;
2628 static PyTypeObject *__pyx_ptype_5numpy_signedinteger = 0;
2629 static PyTypeObject *__pyx_ptype_5numpy_unsignedinteger = 0;
2630 static PyTypeObject *__pyx_ptype_5numpy_inexact = 0;
2631 static PyTypeObject *__pyx_ptype_5numpy_floating = 0;
2632 static PyTypeObject *__pyx_ptype_5numpy_complexfloating = 0;
2633 static PyTypeObject *__pyx_ptype_5numpy_flexible = 0;
2634 static PyTypeObject *__pyx_ptype_5numpy_character = 0;
2635 static PyTypeObject *__pyx_ptype_5numpy_ufunc = 0;
2642 static int (*__pyx_f_7proteus_6mprans_13MeshSmoothing_pyxGetLocalNearestNode)(__Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, int);
2643 static __Pyx_memviewslice (*__pyx_f_7proteus_6mprans_13MeshSmoothing_pyxGetLocalNearestElementIntersection)(__Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, int);
2644 static int (*__pyx_f_7proteus_6mprans_13MeshSmoothing_pyxGetLocalNearestElementAroundNode)(__Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, int);
2645 static void (*__pyx_f_7proteus_6mprans_13MeshSmoothing_pyxUpdateElementBoundaryNormalsTetra)(__Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, int);
2646 static void (*__pyx_f_7proteus_6mprans_13MeshSmoothing_pyxUpdateElementBoundaryNormalsTriangle)(__Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, int);
2647 static __Pyx_memviewslice (*__pyx_f_7proteus_6mprans_13MeshSmoothing_cyCheckOwnedVariable)(int, int, int, __Pyx_memviewslice, __Pyx_memviewslice);
2648 static __Pyx_memviewslice (*__pyx_f_7proteus_6mprans_13MeshSmoothing_cyGetGlobalVariable)(int, int, __Pyx_memviewslice, __Pyx_memviewslice);
2649 static int (*__pyx_f_7proteus_6mprans_13MeshSmoothing_cyGetLocalVariable)(int, int, int, __Pyx_memviewslice, __Pyx_memviewslice);
2650 static void (*__pyx_f_7proteus_6mprans_13MeshSmoothing_cyFindBoundaryDirectionTriangle)(__Pyx_memviewslice, int, __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice);
2653 static PyTypeObject *__pyx_ptype_6mprans_16cMoveMeshMonitor_cCoefficients = 0;
2654 static PyTypeObject *__pyx_ptype_6mprans_16cMoveMeshMonitor___pyx_scope_struct__cppPseudoTimeSteppingParallel = 0;
2655 static PyTypeObject *__pyx_ptype_6mprans_16cMoveMeshMonitor___pyx_scope_struct_1_genexpr = 0;
2656 static PyTypeObject *__pyx_ptype_6mprans_16cMoveMeshMonitor___pyx_scope_struct_2_genexpr = 0;
2657 static PyTypeObject *__pyx_ptype_6mprans_16cMoveMeshMonitor___pyx_scope_struct_3_genexpr = 0;
2658 static PyTypeObject *__pyx_ptype_6mprans_16cMoveMeshMonitor___pyx_scope_struct_4_genexpr = 0;
2659 static PyTypeObject *__pyx_array_type = 0;
2660 static PyTypeObject *__pyx_MemviewEnum_type = 0;
2661 static PyTypeObject *__pyx_memoryview_type = 0;
2662 static PyTypeObject *__pyx_memoryviewslice_type = 0;
2663 static PyObject *
generic = 0;
2664 static PyObject *strided = 0;
2665 static PyObject *indirect = 0;
2666 static PyObject *contiguous = 0;
2667 static PyObject *indirect_contiguous = 0;
2668 static int __pyx_memoryview_thread_locks_used;
2669 static PyThread_type_lock __pyx_memoryview_thread_locks[8];
2670 static __Pyx_memviewslice __pyx_f_6mprans_16cMoveMeshMonitor_cppRecoveryAtNodes(__Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice);
2671 static __Pyx_memviewslice __pyx_f_6mprans_16cMoveMeshMonitor_cppRecoveryAtNodesWeighted(__Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice,
int);
2672 static __Pyx_memviewslice __pyx_f_6mprans_16cMoveMeshMonitor_cppGradientRecoveryAtNodes(__Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice,
int);
2673 static __Pyx_memviewslice __pyx_f_6mprans_16cMoveMeshMonitor_cppGradientRecoveryAtNodesWeighted(__Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice,
int);
2674 static PyObject *__pyx_f_6mprans_16cMoveMeshMonitor_checkOwnedVariable(
int,
int,
int, __Pyx_memviewslice, __Pyx_memviewslice);
2675 static __Pyx_memviewslice __pyx_f_6mprans_16cMoveMeshMonitor_findN(__Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice,
int,
int,
int,
int, __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice,
int, __Pyx_memviewslice, __Pyx_memviewslice,
int, __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice,
int);
2676 static struct __pyx_array_obj *__pyx_array_new(PyObject *, Py_ssize_t,
char *,
char *,
char *);
2677 static void *__pyx_align_pointer(
void *,
size_t);
2678 static PyObject *__pyx_memoryview_new(PyObject *,
int,
int, __Pyx_TypeInfo *);
2679 static CYTHON_INLINE
int __pyx_memoryview_check(PyObject *);
2680 static PyObject *_unellipsify(PyObject *,
int);
2681 static PyObject *assert_direct_dimensions(Py_ssize_t *,
int);
2682 static struct __pyx_memoryview_obj *__pyx_memview_slice(
struct __pyx_memoryview_obj *, PyObject *);
2683 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);
2684 static char *__pyx_pybuffer_index(Py_buffer *,
char *, Py_ssize_t, Py_ssize_t);
2685 static int __pyx_memslice_transpose(__Pyx_memviewslice *);
2686 static PyObject *__pyx_memoryview_fromslice(__Pyx_memviewslice,
int, PyObject *(*)(
char *),
int (*)(
char *, PyObject *),
int);
2687 static __Pyx_memviewslice *__pyx_memoryview_get_slice_from_memoryview(
struct __pyx_memoryview_obj *, __Pyx_memviewslice *);
2688 static void __pyx_memoryview_slice_copy(
struct __pyx_memoryview_obj *, __Pyx_memviewslice *);
2689 static PyObject *__pyx_memoryview_copy_object(
struct __pyx_memoryview_obj *);
2690 static PyObject *__pyx_memoryview_copy_object_from_slice(
struct __pyx_memoryview_obj *, __Pyx_memviewslice *);
2691 static Py_ssize_t abs_py_ssize_t(Py_ssize_t);
2692 static char __pyx_get_best_slice_order(__Pyx_memviewslice *,
int);
2693 static void _copy_strided_to_strided(
char *, Py_ssize_t *,
char *, Py_ssize_t *, Py_ssize_t *, Py_ssize_t *,
int,
size_t);
2694 static void copy_strided_to_strided(__Pyx_memviewslice *, __Pyx_memviewslice *,
int,
size_t);
2695 static Py_ssize_t __pyx_memoryview_slice_get_size(__Pyx_memviewslice *,
int);
2696 static Py_ssize_t __pyx_fill_contig_strides_array(Py_ssize_t *, Py_ssize_t *, Py_ssize_t,
int,
char);
2697 static void *__pyx_memoryview_copy_data_to_temp(__Pyx_memviewslice *, __Pyx_memviewslice *,
char,
int);
2698 static int __pyx_memoryview_err_extents(
int, Py_ssize_t, Py_ssize_t);
2699 static int __pyx_memoryview_err_dim(PyObject *,
char *,
int);
2700 static int __pyx_memoryview_err(PyObject *,
char *);
2701 static int __pyx_memoryview_copy_contents(__Pyx_memviewslice, __Pyx_memviewslice,
int,
int,
int);
2702 static void __pyx_memoryview_broadcast_leading(__Pyx_memviewslice *,
int,
int);
2703 static void __pyx_memoryview_refcount_copying(__Pyx_memviewslice *,
int,
int,
int);
2704 static void __pyx_memoryview_refcount_objects_in_slice_with_gil(
char *, Py_ssize_t *, Py_ssize_t *,
int,
int);
2705 static void __pyx_memoryview_refcount_objects_in_slice(
char *, Py_ssize_t *, Py_ssize_t *,
int,
int);
2706 static void __pyx_memoryview_slice_assign_scalar(__Pyx_memviewslice *,
int,
size_t,
void *,
int);
2707 static void __pyx_memoryview__slice_assign_scalar(
char *, Py_ssize_t *, Py_ssize_t *,
int,
size_t,
void *);
2708 static PyObject *__pyx_unpickle_Enum__set_state(
struct __pyx_MemviewEnum_obj *, PyObject *);
2709 static PyObject *__pyx_format_from_typeinfo(__Pyx_TypeInfo *);
2710 static __Pyx_TypeInfo __Pyx_TypeInfo_int = {
"int", NULL,
sizeof(int), { 0 }, 0, IS_UNSIGNED(
int) ?
'U' :
'I', IS_UNSIGNED(
int), 0 };
2711 static __Pyx_TypeInfo __Pyx_TypeInfo_double = {
"double", NULL,
sizeof(double), { 0 }, 0,
'R', 0, 0 };
2712 #define __Pyx_MODULE_NAME "mprans.cMoveMeshMonitor"
2713 extern int __pyx_module_is_main_mprans__cMoveMeshMonitor;
2714 int __pyx_module_is_main_mprans__cMoveMeshMonitor = 0;
2717 static PyObject *__pyx_builtin_xrange;
2718 static PyObject *__pyx_builtin_range;
2719 static PyObject *__pyx_builtin_AssertionError;
2720 static PyObject *__pyx_builtin_TypeError;
2721 static PyObject *__pyx_builtin_ImportError;
2722 static PyObject *__pyx_builtin_ValueError;
2723 static PyObject *__pyx_builtin_MemoryError;
2724 static PyObject *__pyx_builtin_enumerate;
2725 static PyObject *__pyx_builtin_Ellipsis;
2726 static PyObject *__pyx_builtin_id;
2727 static PyObject *__pyx_builtin_IndexError;
2728 static const char __pyx_k_C[] =
"C";
2729 static const char __pyx_k_O[] =
"O";
2730 static const char __pyx_k_T[] =
"T{";
2731 static const char __pyx_k_c[] =
"c";
2732 static const char __pyx_k_f[] =
"f";
2733 static const char __pyx_k_q[] =
"q";
2734 static const char __pyx_k_r[] =
"r";
2735 static const char __pyx_k_s[] =
"(%s)";
2736 static const char __pyx_k_t[] =
"t";
2737 static const char __pyx_k_u[] =
"u";
2738 static const char __pyx_k_x[] =
"x";
2739 static const char __pyx_k_id[] =
"id";
2740 static const char __pyx_k_ms[] =
"ms";
2741 static const char __pyx_k_nd[] =
"nd";
2742 static const char __pyx_k_np[] =
"np";
2743 static const char __pyx_k_op[] =
"op";
2744 static const char __pyx_k_xx[] =
"xx";
2745 static const char __pyx_k_INT[] =
"INT";
2746 static const char __pyx_k_MPI[] =
"MPI";
2747 static const char __pyx_k_SUM[] =
"SUM";
2748 static const char __pyx_k__31[] =
"^";
2749 static const char __pyx_k__32[] =
"";
2750 static const char __pyx_k__33[] =
":";
2751 static const char __pyx_k__34[] =
"}";
2752 static const char __pyx_k__35[] =
",";
2753 static const char __pyx_k_dot[] =
"dot: ";
2754 static const char __pyx_k_end[] =
"end";
2755 static const char __pyx_k_eps[] =
"eps";
2756 static const char __pyx_k_get[] =
"get";
2757 static const char __pyx_k_new[] =
"__new__";
2758 static const char __pyx_k_obj[] =
"obj";
2759 static const char __pyx_k_Comm[] =
"Comm";
2760 static const char __pyx_k_args[] =
"args";
2761 static const char __pyx_k_axis[] =
"axis";
2762 static const char __pyx_k_base[] =
"base";
2763 static const char __pyx_k_comm[] =
"comm";
2764 static const char __pyx_k_dict[] =
"__dict__";
2765 static const char __pyx_k_file[] =
"file";
2766 static const char __pyx_k_join[] =
"join";
2767 static const char __pyx_k_main[] =
"__main__";
2768 static const char __pyx_k_mesh[] =
"mesh";
2769 static const char __pyx_k_mode[] =
"mode";
2770 static const char __pyx_k_name[] =
"name";
2771 static const char __pyx_k_ndim[] =
"ndim";
2772 static const char __pyx_k_ones[] =
"ones";
2773 static const char __pyx_k_pack[] =
"pack";
2774 static const char __pyx_k_rank[] =
"rank";
2775 static const char __pyx_k_root[] =
"root";
2776 static const char __pyx_k_send[] =
"send";
2777 static const char __pyx_k_size[] =
"size";
2778 static const char __pyx_k_step[] =
"step";
2779 static const char __pyx_k_stop[] =
"stop";
2780 static const char __pyx_k_test[] =
"__test__";
2781 static const char __pyx_k_ASCII[] =
"ASCII";
2782 static const char __pyx_k_Abort[] =
"Abort";
2783 static const char __pyx_k_Error[] =
"Error: ";
2784 static const char __pyx_k_alpha[] =
"alpha";
2785 static const char __pyx_k_areas[] =
"areas";
2786 static const char __pyx_k_array[] =
"array";
2787 static const char __pyx_k_class[] =
"__class__";
2788 static const char __pyx_k_close[] =
"close";
2789 static const char __pyx_k_dtype[] =
"dtype";
2790 static const char __pyx_k_error[] =
"error";
2791 static const char __pyx_k_flags[] =
"flags";
2792 static const char __pyx_k_grads[] =
"grads";
2793 static const char __pyx_k_int32[] =
"int32";
2794 static const char __pyx_k_level[] =
"level";
2795 static const char __pyx_k_model[] =
"model";
2796 static const char __pyx_k_numpy[] =
"numpy";
2797 static const char __pyx_k_print[] =
"print";
2798 static const char __pyx_k_range[] =
"range";
2799 static const char __pyx_k_shape[] =
"shape";
2800 static const char __pyx_k_start[] =
"start";
2801 static const char __pyx_k_t_max[] =
"t_max";
2802 static const char __pyx_k_t_min[] =
"t_min";
2803 static const char __pyx_k_throw[] =
"throw";
2804 static const char __pyx_k_u_phi[] =
"u_phi";
2805 static const char __pyx_k_zeros[] =
"zeros";
2806 static const char __pyx_k_Commit[] =
"Commit";
2807 static const char __pyx_k_DOUBLE[] =
"DOUBLE";
2808 static const char __pyx_k_append[] =
"append";
2809 static const char __pyx_k_encode[] =
"encode";
2810 static const char __pyx_k_format[] =
"format";
2811 static const char __pyx_k_import[] =
"__import__";
2812 static const char __pyx_k_ls_phi[] =
"ls_phi";
2813 static const char __pyx_k_mpi4py[] =
"mpi4py";
2814 static const char __pyx_k_nNodes[] =
"nNodes";
2815 static const char __pyx_k_name_2[] =
"__name__";
2816 static const char __pyx_k_pickle[] =
"pickle";
2817 static const char __pyx_k_reduce[] =
"__reduce__";
2818 static const char __pyx_k_struct[] =
"struct";
2819 static const char __pyx_k_unpack[] =
"unpack";
2820 static const char __pyx_k_update[] =
"update";
2821 static const char __pyx_k_xrange[] =
"xrange";
2822 static const char __pyx_k_Gatherv[] =
"Gatherv";
2823 static const char __pyx_k_barrier[] =
"barrier";
2824 static const char __pyx_k_fortran[] =
"fortran";
2825 static const char __pyx_k_genexpr[] =
"genexpr";
2826 static const char __pyx_k_memview[] =
"memview";
2827 static const char __pyx_k_proteus[] =
"proteus";
2828 static const char __pyx_k_scalars[] =
"scalars";
2829 static const char __pyx_k_Ellipsis[] =
"Ellipsis";
2830 static const char __pyx_k_femSpace[] =
"femSpace";
2831 static const char __pyx_k_getstate[] =
"__getstate__";
2832 static const char __pyx_k_itemsize[] =
"itemsize";
2833 static const char __pyx_k_linspace[] =
"linspace";
2834 static const char __pyx_k_logEvent[] =
"logEvent";
2835 static const char __pyx_k_ntimes_i[] =
"ntimes_i";
2836 static const char __pyx_k_pyx_type[] =
"__pyx_type";
2837 static const char __pyx_k_setstate[] =
"__setstate__";
2838 static const char __pyx_k_tompi4py[] =
"tompi4py";
2839 static const char __pyx_k_TypeError[] =
"TypeError";
2840 static const char __pyx_k_abs_det_J[] =
"abs(det(J))";
2841 static const char __pyx_k_allreduce[] =
"allreduce";
2842 static const char __pyx_k_enumerate[] =
"enumerate";
2843 static const char __pyx_k_fixed_dir[] =
"fixed_dir: ";
2844 static const char __pyx_k_nSmoothIn[] =
"nSmoothIn";
2845 static const char __pyx_k_nodeArray[] =
"nodeArray";
2846 static const char __pyx_k_pyx_state[] =
"__pyx_state";
2847 static const char __pyx_k_reduce_ex[] =
"__reduce_ex__";
2848 static const char __pyx_k_Allgatherv[] =
"Allgatherv";
2849 static const char __pyx_k_IndexError[] =
"IndexError";
2850 static const char __pyx_k_ValueError[] =
"ValueError";
2851 static const char __pyx_k_detJ_array[] =
"detJ_array";
2852 static const char __pyx_k_globalMesh[] =
"globalMesh";
2853 static const char __pyx_k_nSmoothOut[] =
"nSmoothOut";
2854 static const char __pyx_k_pyx_result[] =
"__pyx_result";
2855 static const char __pyx_k_pyx_vtable[] =
"__pyx_vtable__";
2856 static const char __pyx_k_ImportError[] =
"ImportError";
2857 static const char __pyx_k_MemoryError[] =
"MemoryError";
2858 static const char __pyx_k_PickleError[] =
"PickleError";
2859 static const char __pyx_k_areas_nodes[] =
"areas_nodes";
2860 static const char __pyx_k_elementMaps[] =
"elementMaps";
2861 static const char __pyx_k_nodeArray_2[] =
"nodeArray_";
2862 static const char __pyx_k_node_number[] =
"node number";
2863 static const char __pyx_k_element_node[] =
"element node: ";
2864 static const char __pyx_k_getAreaValue[] =
"getAreaValue";
2865 static const char __pyx_k_nNodes_owned[] =
"nNodes_owned";
2866 static const char __pyx_k_pyx_checksum[] =
"__pyx_checksum";
2867 static const char __pyx_k_simultaneous[] =
"simultaneous";
2868 static const char __pyx_k_stringsource[] =
"stringsource";
2869 static const char __pyx_k_MeshSmoothing[] =
"MeshSmoothing";
2870 static const char __pyx_k_cCoefficients[] =
"cCoefficients";
2871 static const char __pyx_k_nNodes_global[] =
"nNodes_global";
2872 static const char __pyx_k_nodeStarArray[] =
"nodeStarArray";
2873 static const char __pyx_k_ntimes_solved[] =
"ntimes_solved";
2874 static const char __pyx_k_pyx_getbuffer[] =
"__pyx_getbuffer";
2875 static const char __pyx_k_reduce_cython[] =
"__reduce_cython__";
2876 static const char __pyx_k_AssertionError[] =
"AssertionError";
2877 static const char __pyx_k_Done_smoothing[] =
"Done smoothing";
2878 static const char __pyx_k_evaluateFunAtX[] =
"evaluateFunAtX";
2879 static const char __pyx_k_nNodes_element[] =
"nNodes_element";
2880 static const char __pyx_k_proteus_mprans[] =
"proteus.mprans";
2881 static const char __pyx_k_View_MemoryView[] =
"View.MemoryView";
2882 static const char __pyx_k_allocate_buffer[] =
"allocate_buffer";
2883 static const char __pyx_k_dtype_is_object[] =
"dtype_is_object";
2884 static const char __pyx_k_getInverseValue[] =
"getInverseValue";
2885 static const char __pyx_k_nElements_owned[] =
"nElements_owned";
2886 static const char __pyx_k_nodeStarOffsets[] =
"nodeStarOffsets";
2887 static const char __pyx_k_pyx_PickleError[] =
"__pyx_PickleError";
2888 static const char __pyx_k_recoveryAtNodes[] =
"recoveryAtNodes";
2889 static const char __pyx_k_setstate_cython[] =
"__setstate_cython__";
2890 static const char __pyx_k_getGradientValue[] =
"getGradientValue";
2891 static const char __pyx_k_getLevelSetValue[] =
"getLevelSetValue";
2892 static const char __pyx_k_nElements_global[] =
"nElements_global";
2893 static const char __pyx_k_nVariables_owned[] =
"nVariables_owned";
2894 static const char __pyx_k_nearestN_element[] =
"nearestN (element): ";
2895 static const char __pyx_k_smoothBoundaries[] =
"smoothBoundaries";
2896 static const char __pyx_k_type_should_be_1[] =
"type (should be 1): ";
2897 static const char __pyx_k_Create_contiguous[] =
"Create_contiguous";
2898 static const char __pyx_k_elementNodesArray[] =
"elementNodesArray";
2899 static const char __pyx_k_nodeElementsArray[] =
"nodeElementsArray";
2900 static const char __pyx_k_nodeMaterialTypes[] =
"nodeMaterialTypes";
2901 static const char __pyx_k_node_materialType[] =
"node materialType: ";
2902 static const char __pyx_k_proteus_Profiling[] =
"proteus.Profiling";
2903 static const char __pyx_k_pyx_unpickle_Enum[] =
"__pyx_unpickle_Enum";
2904 static const char __pyx_k_uOfXTatQuadrature[] =
"uOfXTatQuadrature";
2905 static const char __pyx_k_variable_nb_local[] =
"variable_nb_local";
2906 static const char __pyx_k_cline_in_traceback[] =
"cline_in_traceback";
2907 static const char __pyx_k_element_barycenter[] =
"element barycenter: ";
2908 static const char __pyx_k_nodeElementOffsets[] =
"nodeElementOffsets";
2909 static const char __pyx_k_smoothNodesLaplace[] =
"smoothNodesLaplace";
2910 static const char __pyx_k_strided_and_direct[] =
"<strided and direct>";
2911 static const char __pyx_k_fixedNodesBoolArray[] =
"fixedNodesBoolArray";
2912 static const char __pyx_k_node_new_coordinates[] =
"node new coordinates: ";
2913 static const char __pyx_k_node_old_coordinates[] =
"node old coordinates: ";
2914 static const char __pyx_k_pyCheckOwnedVariable[] =
"pyCheckOwnedVariable";
2915 static const char __pyx_k_strided_and_indirect[] =
"<strided and indirect>";
2916 static const char __pyx_k_contiguous_and_direct[] =
"<contiguous and direct>";
2917 static const char __pyx_k_elementNeighborsArray[] =
"elementNeighborsArray";
2918 static const char __pyx_k_getNonOwnedNodeValues[] =
"getNonOwnedNodeValues";
2919 static const char __pyx_k_MemoryView_of_r_object[] =
"<MemoryView of %r object>";
2920 static const char __pyx_k_elementBoundariesArray[] =
"elementBoundariesArray";
2921 static const char __pyx_k_nNodes_elementBoundary[] =
"nNodes_elementBoundary";
2922 static const char __pyx_k_MemoryView_of_r_at_0x_x[] =
"<MemoryView of %r at 0x%x>";
2923 static const char __pyx_k_contiguous_and_indirect[] =
"<contiguous and indirect>";
2924 static const char __pyx_k_elementBarycentersArray[] =
"elementBarycentersArray";
2925 static const char __pyx_k_gradientRecoveryAtNodes[] =
"gradientRecoveryAtNodes";
2926 static const char __pyx_k_mprans_cMoveMeshMonitor[] =
"mprans.cMoveMeshMonitor";
2927 static const char __pyx_k_recoveryAtNodesWeighted[] =
"recoveryAtNodesWeighted";
2928 static const char __pyx_k_Cannot_index_with_type_s[] =
"Cannot index with type '%s'";
2929 static const char __pyx_k_Done_pseudo_timestepping[] =
"Done pseudo-timestepping";
2930 static const char __pyx_k_Pseudo_time_stepping_t_t[] =
"Pseudo-time stepping t={t}";
2931 static const char __pyx_k_elementQuadratureWeights[] =
"elementQuadratureWeights";
2932 static const char __pyx_k_nElementBoundaries_owned[] =
"nElementBoundaries_owned";
2933 static const char __pyx_k_Invalid_shape_in_axis_d_d[] =
"Invalid shape in axis %d: %d.";
2934 static const char __pyx_k_elementBoundaryNodesArray[] =
"elementBoundaryNodesArray";
2935 static const char __pyx_k_nElementBoundaries_global[] =
"nElementBoundaries_global";
2936 static const char __pyx_k_elementBoundaryNormalsArray[] =
"elementBoundaryNormalsArray";
2937 static const char __pyx_k_itemsize_0_for_cython_array[] =
"itemsize <= 0 for cython.array";
2938 static const char __pyx_k_nodeOffsets_subdomain_owned[] =
"nodeOffsets_subdomain_owned";
2939 static const char __pyx_k_elementBoundaryElementsArray[] =
"elementBoundaryElementsArray";
2940 static const char __pyx_k_unable_to_allocate_array_data[] =
"unable to allocate array data.";
2941 static const char __pyx_k_elementOffsets_subdomain_owned[] =
"elementOffsets_subdomain_owned";
2942 static const char __pyx_k_exteriorElementBoundariesArray[] =
"exteriorElementBoundariesArray";
2943 static const char __pyx_k_nodeNumbering_subdomain2global[] =
"nodeNumbering_subdomain2global";
2944 static const char __pyx_k_strided_and_direct_or_indirect[] =
"<strided and direct or indirect>";
2945 static const char __pyx_k_b_i_and_nearestN_cannot_be_both[] =
"b_i and nearestN cannot be both -1";
2946 static const char __pyx_k_did_not_find_containing_element[] =
"did not find containing element! coords outside domain?";
2947 static const char __pyx_k_elementBoundaryBarycentersArray[] =
"elementBoundaryBarycentersArray";
2948 static const char __pyx_k_gradientRecoveryAtNodesWeighted[] =
"gradientRecoveryAtNodesWeighted";
2949 static const char __pyx_k_numpy_core_multiarray_failed_to[] =
"numpy.core.multiarray failed to import";
2950 static const char __pyx_k_proteus_mprans_cMoveMeshMonitor[] =
"proteus/mprans/cMoveMeshMonitor.pyx";
2951 static const char __pyx_k_variableOffsets_subdomain_owned[] =
"variableOffsets_subdomain_owned";
2952 static const char __pyx_k_Buffer_view_does_not_expose_stri[] =
"Buffer view does not expose strides";
2953 static const char __pyx_k_Can_only_create_a_buffer_that_is[] =
"Can only create a buffer that is contiguous in memory.";
2954 static const char __pyx_k_Cannot_assign_to_read_only_memor[] =
"Cannot assign to read-only memoryview";
2955 static const char __pyx_k_Cannot_create_writable_memory_vi[] =
"Cannot create writable memory view from read-only memoryview";
2956 static const char __pyx_k_Empty_shape_tuple_for_cython_arr[] =
"Empty shape tuple for cython.array";
2957 static const char __pyx_k_Incompatible_checksums_0x_x_vs_0[] =
"Incompatible checksums (0x%x vs (0xb068931, 0x82a3537, 0x6ae9995) = (name))";
2958 static const char __pyx_k_Indirect_dimensions_not_supporte[] =
"Indirect dimensions not supported";
2959 static const char __pyx_k_Invalid_mode_expected_c_or_fortr[] =
"Invalid mode, expected 'c' or 'fortran', got %s";
2960 static const char __pyx_k_Out_of_bounds_on_buffer_access_a[] =
"Out of bounds on buffer access (axis %d)";
2961 static const char __pyx_k_Pseudo_time_stepping_with_dt_eps[] =
"Pseudo-time stepping with dt={eps} ({t_min}<t<{t_max})";
2962 static const char __pyx_k_Smoothing_Mesh_with_Laplace_Smoo[] =
"Smoothing Mesh with Laplace Smoothing - ";
2963 static const char __pyx_k_Unable_to_convert_item_to_object[] =
"Unable to convert item to object";
2964 static const char __pyx_k_cCoefficients_cppPseudoTimeStepp[] =
"cCoefficients.cppPseudoTimeSteppingParallel.<locals>.genexpr";
2965 static const char __pyx_k_elementBoundaryNumbering_subdoma[] =
"elementBoundaryNumbering_subdomain2global";
2966 static const char __pyx_k_elementBoundaryOffsets_subdomain[] =
"elementBoundaryOffsets_subdomain_owned";
2967 static const char __pyx_k_elementNumbering_subdomain2globa[] =
"elementNumbering_subdomain2global";
2968 static const char __pyx_k_got_differing_extents_in_dimensi[] =
"got differing extents in dimension %d (got %d and %d)";
2969 static const char __pyx_k_no_default___reduce___due_to_non[] =
"no default __reduce__ due to non-trivial __cinit__";
2970 static const char __pyx_k_numpy_core_umath_failed_to_impor[] =
"numpy.core.umath failed to import";
2971 static const char __pyx_k_unable_to_allocate_shape_and_str[] =
"unable to allocate shape and strides.";
2972 static const char __pyx_k_variableNumbering_subdomain2glob[] =
"variableNumbering_subdomain2global";
2973 static const char __pyx_k_did_not_find_containing_element_2[] =
"did not find containing element! coords outside domain\077\077";
2974 static PyObject *__pyx_n_s_ASCII;
2975 static PyObject *__pyx_n_s_Abort;
2976 static PyObject *__pyx_n_s_Allgatherv;
2977 static PyObject *__pyx_n_s_AssertionError;
2978 static PyObject *__pyx_kp_s_Buffer_view_does_not_expose_stri;
2979 static PyObject *__pyx_n_s_C;
2980 static PyObject *__pyx_kp_s_Can_only_create_a_buffer_that_is;
2981 static PyObject *__pyx_kp_s_Cannot_assign_to_read_only_memor;
2982 static PyObject *__pyx_kp_s_Cannot_create_writable_memory_vi;
2983 static PyObject *__pyx_kp_s_Cannot_index_with_type_s;
2984 static PyObject *__pyx_n_s_Comm;
2985 static PyObject *__pyx_n_s_Commit;
2986 static PyObject *__pyx_n_s_Create_contiguous;
2987 static PyObject *__pyx_n_s_DOUBLE;
2988 static PyObject *__pyx_kp_s_Done_pseudo_timestepping;
2989 static PyObject *__pyx_kp_s_Done_smoothing;
2990 static PyObject *__pyx_n_s_Ellipsis;
2991 static PyObject *__pyx_kp_s_Empty_shape_tuple_for_cython_arr;
2992 static PyObject *__pyx_kp_s_Error;
2993 static PyObject *__pyx_n_s_Gatherv;
2994 static PyObject *__pyx_n_s_INT;
2995 static PyObject *__pyx_n_s_ImportError;
2996 static PyObject *__pyx_kp_s_Incompatible_checksums_0x_x_vs_0;
2997 static PyObject *__pyx_n_s_IndexError;
2998 static PyObject *__pyx_kp_s_Indirect_dimensions_not_supporte;
2999 static PyObject *__pyx_kp_s_Invalid_mode_expected_c_or_fortr;
3000 static PyObject *__pyx_kp_s_Invalid_shape_in_axis_d_d;
3001 static PyObject *__pyx_n_s_MPI;
3002 static PyObject *__pyx_n_s_MemoryError;
3003 static PyObject *__pyx_kp_s_MemoryView_of_r_at_0x_x;
3004 static PyObject *__pyx_kp_s_MemoryView_of_r_object;
3005 static PyObject *__pyx_n_s_MeshSmoothing;
3006 static PyObject *__pyx_n_b_O;
3007 static PyObject *__pyx_kp_s_Out_of_bounds_on_buffer_access_a;
3008 static PyObject *__pyx_n_s_PickleError;
3009 static PyObject *__pyx_kp_s_Pseudo_time_stepping_t_t;
3010 static PyObject *__pyx_kp_s_Pseudo_time_stepping_with_dt_eps;
3011 static PyObject *__pyx_n_s_SUM;
3012 static PyObject *__pyx_kp_s_Smoothing_Mesh_with_Laplace_Smoo;
3013 static PyObject *__pyx_kp_b_T;
3014 static PyObject *__pyx_n_s_TypeError;
3015 static PyObject *__pyx_kp_s_Unable_to_convert_item_to_object;
3016 static PyObject *__pyx_n_s_ValueError;
3017 static PyObject *__pyx_n_s_View_MemoryView;
3018 static PyObject *__pyx_kp_b__31;
3019 static PyObject *__pyx_kp_b__32;
3020 static PyObject *__pyx_kp_b__33;
3021 static PyObject *__pyx_kp_b__34;
3022 static PyObject *__pyx_kp_u__35;
3023 static PyObject *__pyx_kp_s_abs_det_J;
3024 static PyObject *__pyx_n_s_allocate_buffer;
3025 static PyObject *__pyx_n_s_allreduce;
3026 static PyObject *__pyx_n_s_alpha;
3027 static PyObject *__pyx_n_s_append;
3028 static PyObject *__pyx_n_s_areas;
3029 static PyObject *__pyx_n_s_areas_nodes;
3030 static PyObject *__pyx_n_s_args;
3031 static PyObject *__pyx_n_s_array;
3032 static PyObject *__pyx_n_s_axis;
3033 static PyObject *__pyx_kp_s_b_i_and_nearestN_cannot_be_both;
3034 static PyObject *__pyx_n_s_barrier;
3035 static PyObject *__pyx_n_s_base;
3036 static PyObject *__pyx_n_s_c;
3037 static PyObject *__pyx_n_u_c;
3038 static PyObject *__pyx_n_s_cCoefficients;
3039 static PyObject *__pyx_n_s_cCoefficients_cppPseudoTimeStepp;
3040 static PyObject *__pyx_n_s_class;
3041 static PyObject *__pyx_n_s_cline_in_traceback;
3042 static PyObject *__pyx_n_s_close;
3043 static PyObject *__pyx_n_s_comm;
3044 static PyObject *__pyx_kp_s_contiguous_and_direct;
3045 static PyObject *__pyx_kp_s_contiguous_and_indirect;
3046 static PyObject *__pyx_n_s_detJ_array;
3047 static PyObject *__pyx_n_s_dict;
3048 static PyObject *__pyx_kp_s_did_not_find_containing_element;
3049 static PyObject *__pyx_kp_s_did_not_find_containing_element_2;
3050 static PyObject *__pyx_kp_s_dot;
3051 static PyObject *__pyx_n_s_dtype;
3052 static PyObject *__pyx_n_s_dtype_is_object;
3053 static PyObject *__pyx_n_s_elementBarycentersArray;
3054 static PyObject *__pyx_n_s_elementBoundariesArray;
3055 static PyObject *__pyx_n_s_elementBoundaryBarycentersArray;
3056 static PyObject *__pyx_n_s_elementBoundaryElementsArray;
3057 static PyObject *__pyx_n_s_elementBoundaryNodesArray;
3058 static PyObject *__pyx_n_s_elementBoundaryNormalsArray;
3059 static PyObject *__pyx_n_s_elementBoundaryNumbering_subdoma;
3060 static PyObject *__pyx_n_s_elementBoundaryOffsets_subdomain;
3061 static PyObject *__pyx_n_s_elementMaps;
3062 static PyObject *__pyx_n_s_elementNeighborsArray;
3063 static PyObject *__pyx_n_s_elementNodesArray;
3064 static PyObject *__pyx_n_s_elementNumbering_subdomain2globa;
3065 static PyObject *__pyx_n_s_elementOffsets_subdomain_owned;
3066 static PyObject *__pyx_n_s_elementQuadratureWeights;
3067 static PyObject *__pyx_kp_s_element_barycenter;
3068 static PyObject *__pyx_kp_s_element_node;
3069 static PyObject *__pyx_n_s_encode;
3070 static PyObject *__pyx_n_s_end;
3071 static PyObject *__pyx_n_s_enumerate;
3072 static PyObject *__pyx_n_s_eps;
3073 static PyObject *__pyx_n_s_error;
3074 static PyObject *__pyx_n_s_evaluateFunAtX;
3075 static PyObject *__pyx_n_s_exteriorElementBoundariesArray;
3076 static PyObject *__pyx_n_s_f;
3077 static PyObject *__pyx_n_s_femSpace;
3078 static PyObject *__pyx_n_s_file;
3079 static PyObject *__pyx_n_s_fixedNodesBoolArray;
3080 static PyObject *__pyx_kp_s_fixed_dir;
3081 static PyObject *__pyx_n_s_flags;
3082 static PyObject *__pyx_n_s_format;
3083 static PyObject *__pyx_n_s_fortran;
3084 static PyObject *__pyx_n_u_fortran;
3085 static PyObject *__pyx_n_s_genexpr;
3086 static PyObject *__pyx_n_s_get;
3087 static PyObject *__pyx_n_s_getAreaValue;
3088 static PyObject *__pyx_n_s_getGradientValue;
3089 static PyObject *__pyx_n_s_getInverseValue;
3090 static PyObject *__pyx_n_s_getLevelSetValue;
3091 static PyObject *__pyx_n_s_getNonOwnedNodeValues;
3092 static PyObject *__pyx_n_s_getstate;
3093 static PyObject *__pyx_n_s_globalMesh;
3094 static PyObject *__pyx_kp_s_got_differing_extents_in_dimensi;
3095 static PyObject *__pyx_n_s_gradientRecoveryAtNodes;
3096 static PyObject *__pyx_n_s_gradientRecoveryAtNodesWeighted;
3097 static PyObject *__pyx_n_s_grads;
3098 static PyObject *__pyx_n_s_id;
3099 static PyObject *__pyx_n_s_import;
3100 static PyObject *__pyx_n_s_int32;
3101 static PyObject *__pyx_n_s_itemsize;
3102 static PyObject *__pyx_kp_s_itemsize_0_for_cython_array;
3103 static PyObject *__pyx_n_s_join;
3104 static PyObject *__pyx_n_s_level;
3105 static PyObject *__pyx_n_s_linspace;
3106 static PyObject *__pyx_n_s_logEvent;
3107 static PyObject *__pyx_n_s_ls_phi;
3108 static PyObject *__pyx_n_s_main;
3109 static PyObject *__pyx_n_s_memview;
3110 static PyObject *__pyx_n_s_mesh;
3111 static PyObject *__pyx_n_s_mode;
3112 static PyObject *__pyx_n_s_model;
3113 static PyObject *__pyx_n_s_mpi4py;
3114 static PyObject *__pyx_n_s_mprans_cMoveMeshMonitor;
3115 static PyObject *__pyx_n_s_ms;
3116 static PyObject *__pyx_n_s_nElementBoundaries_global;
3117 static PyObject *__pyx_n_s_nElementBoundaries_owned;
3118 static PyObject *__pyx_n_s_nElements_global;
3119 static PyObject *__pyx_n_s_nElements_owned;
3120 static PyObject *__pyx_n_s_nNodes;
3121 static PyObject *__pyx_n_s_nNodes_element;
3122 static PyObject *__pyx_n_s_nNodes_elementBoundary;
3123 static PyObject *__pyx_n_s_nNodes_global;
3124 static PyObject *__pyx_n_s_nNodes_owned;
3125 static PyObject *__pyx_n_s_nSmoothIn;
3126 static PyObject *__pyx_n_s_nSmoothOut;
3127 static PyObject *__pyx_n_s_nVariables_owned;
3128 static PyObject *__pyx_n_s_name;
3129 static PyObject *__pyx_n_s_name_2;
3130 static PyObject *__pyx_n_s_nd;
3131 static PyObject *__pyx_n_s_ndim;
3132 static PyObject *__pyx_kp_s_nearestN_element;
3133 static PyObject *__pyx_n_s_new;
3134 static PyObject *__pyx_kp_s_no_default___reduce___due_to_non;
3135 static PyObject *__pyx_n_s_nodeArray;
3136 static PyObject *__pyx_n_s_nodeArray_2;
3137 static PyObject *__pyx_n_s_nodeElementOffsets;
3138 static PyObject *__pyx_n_s_nodeElementsArray;
3139 static PyObject *__pyx_n_s_nodeMaterialTypes;
3140 static PyObject *__pyx_n_s_nodeNumbering_subdomain2global;
3141 static PyObject *__pyx_n_s_nodeOffsets_subdomain_owned;
3142 static PyObject *__pyx_n_s_nodeStarArray;
3143 static PyObject *__pyx_n_s_nodeStarOffsets;
3144 static PyObject *__pyx_kp_s_node_materialType;
3145 static PyObject *__pyx_kp_s_node_new_coordinates;
3146 static PyObject *__pyx_kp_s_node_number;
3147 static PyObject *__pyx_kp_s_node_old_coordinates;
3148 static PyObject *__pyx_n_s_np;
3149 static PyObject *__pyx_n_s_ntimes_i;
3150 static PyObject *__pyx_n_s_ntimes_solved;
3151 static PyObject *__pyx_n_s_numpy;
3152 static PyObject *__pyx_kp_s_numpy_core_multiarray_failed_to;
3153 static PyObject *__pyx_kp_s_numpy_core_umath_failed_to_impor;
3154 static PyObject *__pyx_n_s_obj;
3155 static PyObject *__pyx_n_s_ones;
3156 static PyObject *__pyx_n_s_op;
3157 static PyObject *__pyx_n_s_pack;
3158 static PyObject *__pyx_n_s_pickle;
3159 static PyObject *__pyx_n_s_print;
3160 static PyObject *__pyx_n_s_proteus;
3161 static PyObject *__pyx_n_s_proteus_Profiling;
3162 static PyObject *__pyx_n_s_proteus_mprans;
3163 static PyObject *__pyx_kp_s_proteus_mprans_cMoveMeshMonitor;
3164 static PyObject *__pyx_n_s_pyCheckOwnedVariable;
3165 static PyObject *__pyx_n_s_pyx_PickleError;
3166 static PyObject *__pyx_n_s_pyx_checksum;
3167 static PyObject *__pyx_n_s_pyx_getbuffer;
3168 static PyObject *__pyx_n_s_pyx_result;
3169 static PyObject *__pyx_n_s_pyx_state;
3170 static PyObject *__pyx_n_s_pyx_type;
3171 static PyObject *__pyx_n_s_pyx_unpickle_Enum;
3172 static PyObject *__pyx_n_s_pyx_vtable;
3173 static PyObject *__pyx_n_s_q;
3174 static PyObject *__pyx_n_s_r;
3175 static PyObject *__pyx_n_s_range;
3176 static PyObject *__pyx_n_s_rank;
3177 static PyObject *__pyx_n_s_recoveryAtNodes;
3178 static PyObject *__pyx_n_s_recoveryAtNodesWeighted;
3179 static PyObject *__pyx_n_s_reduce;
3180 static PyObject *__pyx_n_s_reduce_cython;
3181 static PyObject *__pyx_n_s_reduce_ex;
3182 static PyObject *__pyx_n_s_root;
3183 static PyObject *__pyx_kp_u_s;
3184 static PyObject *__pyx_n_s_scalars;
3185 static PyObject *__pyx_n_s_send;
3186 static PyObject *__pyx_n_s_setstate;
3187 static PyObject *__pyx_n_s_setstate_cython;
3188 static PyObject *__pyx_n_s_shape;
3189 static PyObject *__pyx_n_s_simultaneous;
3190 static PyObject *__pyx_n_s_size;
3191 static PyObject *__pyx_n_s_smoothBoundaries;
3192 static PyObject *__pyx_n_s_smoothNodesLaplace;
3193 static PyObject *__pyx_n_s_start;
3194 static PyObject *__pyx_n_s_step;
3195 static PyObject *__pyx_n_s_stop;
3196 static PyObject *__pyx_kp_s_strided_and_direct;
3197 static PyObject *__pyx_kp_s_strided_and_direct_or_indirect;
3198 static PyObject *__pyx_kp_s_strided_and_indirect;
3199 static PyObject *__pyx_kp_s_stringsource;
3200 static PyObject *__pyx_n_s_struct;
3201 static PyObject *__pyx_n_s_t;
3202 static PyObject *__pyx_n_s_t_max;
3203 static PyObject *__pyx_n_s_t_min;
3204 static PyObject *__pyx_n_s_test;
3205 static PyObject *__pyx_n_s_throw;
3206 static PyObject *__pyx_n_s_tompi4py;
3207 static PyObject *__pyx_kp_s_type_should_be_1;
3208 static PyObject *__pyx_n_s_u;
3209 static PyObject *__pyx_n_s_uOfXTatQuadrature;
3210 static PyObject *__pyx_n_s_u_phi;
3211 static PyObject *__pyx_kp_s_unable_to_allocate_array_data;
3212 static PyObject *__pyx_kp_s_unable_to_allocate_shape_and_str;
3213 static PyObject *__pyx_n_s_unpack;
3214 static PyObject *__pyx_n_s_update;
3215 static PyObject *__pyx_n_s_variableNumbering_subdomain2glob;
3216 static PyObject *__pyx_n_s_variableOffsets_subdomain_owned;
3217 static PyObject *__pyx_n_s_variable_nb_local;
3218 static PyObject *__pyx_n_s_x;
3219 static PyObject *__pyx_n_s_xrange;
3220 static PyObject *__pyx_n_s_xx;
3221 static PyObject *__pyx_n_s_zeros;
3222 static int __pyx_pf_6mprans_16cMoveMeshMonitor_13cCoefficients___cinit__(
struct __pyx_obj_6mprans_16cMoveMeshMonitor_cCoefficients *__pyx_v_self);
3223 static PyObject *__pyx_pf_6mprans_16cMoveMeshMonitor_13cCoefficients_2attachPyCoefficients(
struct __pyx_obj_6mprans_16cMoveMeshMonitor_cCoefficients *__pyx_v_self, PyObject *__pyx_v_pyCoefficients);
3224 static PyObject *__pyx_pf_6mprans_16cMoveMeshMonitor_13cCoefficients_4preStep(
struct __pyx_obj_6mprans_16cMoveMeshMonitor_cCoefficients *__pyx_v_self);
3225 static PyObject *__pyx_pf_6mprans_16cMoveMeshMonitor_13cCoefficients_6postStep(
struct __pyx_obj_6mprans_16cMoveMeshMonitor_cCoefficients *__pyx_v_self);
3226 static PyObject *__pyx_pf_6mprans_16cMoveMeshMonitor_13cCoefficients_8pseudoTimeStepping(
struct __pyx_obj_6mprans_16cMoveMeshMonitor_cCoefficients *__pyx_v_self, PyObject *__pyx_v_xx, PyObject *__pyx_v_eps);
3227 static PyObject *__pyx_pf_6mprans_16cMoveMeshMonitor_13cCoefficients_29cppPseudoTimeSteppingParallel_genexpr(PyObject *__pyx_self);
3228 static PyObject *__pyx_pf_6mprans_16cMoveMeshMonitor_13cCoefficients_29cppPseudoTimeSteppingParallel_3genexpr(PyObject *__pyx_self);
3229 static PyObject *__pyx_pf_6mprans_16cMoveMeshMonitor_13cCoefficients_29cppPseudoTimeSteppingParallel_6genexpr(PyObject *__pyx_self);
3230 static PyObject *__pyx_pf_6mprans_16cMoveMeshMonitor_13cCoefficients_29cppPseudoTimeSteppingParallel_9genexpr(PyObject *__pyx_self);
3231 static PyObject *__pyx_pf_6mprans_16cMoveMeshMonitor_13cCoefficients_14pyCoefficients___get__(
struct __pyx_obj_6mprans_16cMoveMeshMonitor_cCoefficients *__pyx_v_self);
3232 static int __pyx_pf_6mprans_16cMoveMeshMonitor_13cCoefficients_14pyCoefficients_2__set__(
struct __pyx_obj_6mprans_16cMoveMeshMonitor_cCoefficients *__pyx_v_self, PyObject *__pyx_v_value);
3233 static int __pyx_pf_6mprans_16cMoveMeshMonitor_13cCoefficients_14pyCoefficients_4__del__(
struct __pyx_obj_6mprans_16cMoveMeshMonitor_cCoefficients *__pyx_v_self);
3234 static PyObject *__pyx_pf_6mprans_16cMoveMeshMonitor_13cCoefficients_1C___get__(
struct __pyx_obj_6mprans_16cMoveMeshMonitor_cCoefficients *__pyx_v_self);
3235 static int __pyx_pf_6mprans_16cMoveMeshMonitor_13cCoefficients_1C_2__set__(
struct __pyx_obj_6mprans_16cMoveMeshMonitor_cCoefficients *__pyx_v_self, PyObject *__pyx_v_value);
3236 static PyObject *__pyx_pf_6mprans_16cMoveMeshMonitor_13cCoefficients_10__reduce_cython__(CYTHON_UNUSED
struct __pyx_obj_6mprans_16cMoveMeshMonitor_cCoefficients *__pyx_v_self);
3237 static PyObject *__pyx_pf_6mprans_16cMoveMeshMonitor_13cCoefficients_12__setstate_cython__(CYTHON_UNUSED
struct __pyx_obj_6mprans_16cMoveMeshMonitor_cCoefficients *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state);
3238 static PyObject *__pyx_pf_6mprans_16cMoveMeshMonitor_recoveryAtNodes(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_scalars, __Pyx_memviewslice __pyx_v_nodeElementsArray, __Pyx_memviewslice __pyx_v_nodeElementOffsets);
3239 static PyObject *__pyx_pf_6mprans_16cMoveMeshMonitor_2recoveryAtNodesWeighted(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_scalars, __Pyx_memviewslice __pyx_v_nodeElementsArray, __Pyx_memviewslice __pyx_v_nodeElementOffsets, __Pyx_memviewslice __pyx_v_detJ_array,
int __pyx_v_nNodes);
3240 static PyObject *__pyx_pf_6mprans_16cMoveMeshMonitor_4gradientRecoveryAtNodes(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_grads, PyObject *__pyx_v_nodeElementsArray, PyObject *__pyx_v_nodeElementOffsets, PyObject *__pyx_v_nd);
3241 static PyObject *__pyx_pf_6mprans_16cMoveMeshMonitor_6gradientRecoveryAtNodesWeighted(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_grads, __Pyx_memviewslice __pyx_v_nodeElementsArray, __Pyx_memviewslice __pyx_v_nodeElementOffsets, __Pyx_memviewslice __pyx_v_detJ_array,
int __pyx_v_nd);
3242 static PyObject *__pyx_pf_6mprans_16cMoveMeshMonitor_8pyCheckOwnedVariable(CYTHON_UNUSED PyObject *__pyx_self,
int __pyx_v_variable_nb_local,
int __pyx_v_rank,
int __pyx_v_nVariables_owned, __Pyx_memviewslice __pyx_v_variableNumbering_subdomain2global, __Pyx_memviewslice __pyx_v_variableOffsets_subdomain_owned);
3243 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);
3244 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);
3245 static void __pyx_array___pyx_pf_15View_dot_MemoryView_5array_4__dealloc__(
struct __pyx_array_obj *__pyx_v_self);
3246 static PyObject *__pyx_pf_15View_dot_MemoryView_5array_7memview___get__(
struct __pyx_array_obj *__pyx_v_self);
3247 static Py_ssize_t __pyx_array___pyx_pf_15View_dot_MemoryView_5array_6__len__(
struct __pyx_array_obj *__pyx_v_self);
3248 static PyObject *__pyx_array___pyx_pf_15View_dot_MemoryView_5array_8__getattr__(
struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_attr);
3249 static PyObject *__pyx_array___pyx_pf_15View_dot_MemoryView_5array_10__getitem__(
struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_item);
3250 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);
3251 static PyObject *__pyx_pf___pyx_array___reduce_cython__(CYTHON_UNUSED
struct __pyx_array_obj *__pyx_v_self);
3252 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);
3253 static int __pyx_MemviewEnum___pyx_pf_15View_dot_MemoryView_4Enum___init__(
struct __pyx_MemviewEnum_obj *__pyx_v_self, PyObject *__pyx_v_name);
3254 static PyObject *__pyx_MemviewEnum___pyx_pf_15View_dot_MemoryView_4Enum_2__repr__(
struct __pyx_MemviewEnum_obj *__pyx_v_self);
3255 static PyObject *__pyx_pf___pyx_MemviewEnum___reduce_cython__(
struct __pyx_MemviewEnum_obj *__pyx_v_self);
3256 static PyObject *__pyx_pf___pyx_MemviewEnum_2__setstate_cython__(
struct __pyx_MemviewEnum_obj *__pyx_v_self, PyObject *__pyx_v___pyx_state);
3257 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);
3258 static void __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_2__dealloc__(
struct __pyx_memoryview_obj *__pyx_v_self);
3259 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_4__getitem__(
struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index);
3260 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);
3261 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);
3262 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_1T___get__(
struct __pyx_memoryview_obj *__pyx_v_self);
3263 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_4base___get__(
struct __pyx_memoryview_obj *__pyx_v_self);
3264 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_5shape___get__(
struct __pyx_memoryview_obj *__pyx_v_self);
3265 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_7strides___get__(
struct __pyx_memoryview_obj *__pyx_v_self);
3266 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_10suboffsets___get__(
struct __pyx_memoryview_obj *__pyx_v_self);
3267 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_4ndim___get__(
struct __pyx_memoryview_obj *__pyx_v_self);
3268 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_8itemsize___get__(
struct __pyx_memoryview_obj *__pyx_v_self);
3269 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_6nbytes___get__(
struct __pyx_memoryview_obj *__pyx_v_self);
3270 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_4size___get__(
struct __pyx_memoryview_obj *__pyx_v_self);
3271 static Py_ssize_t __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_10__len__(
struct __pyx_memoryview_obj *__pyx_v_self);
3272 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_12__repr__(
struct __pyx_memoryview_obj *__pyx_v_self);
3273 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_14__str__(
struct __pyx_memoryview_obj *__pyx_v_self);
3274 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_16is_c_contig(
struct __pyx_memoryview_obj *__pyx_v_self);
3275 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_18is_f_contig(
struct __pyx_memoryview_obj *__pyx_v_self);
3276 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_20copy(
struct __pyx_memoryview_obj *__pyx_v_self);
3277 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_22copy_fortran(
struct __pyx_memoryview_obj *__pyx_v_self);
3278 static PyObject *__pyx_pf___pyx_memoryview___reduce_cython__(CYTHON_UNUSED
struct __pyx_memoryview_obj *__pyx_v_self);
3279 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);
3280 static void __pyx_memoryviewslice___pyx_pf_15View_dot_MemoryView_16_memoryviewslice___dealloc__(
struct __pyx_memoryviewslice_obj *__pyx_v_self);
3281 static PyObject *__pyx_pf_15View_dot_MemoryView_16_memoryviewslice_4base___get__(
struct __pyx_memoryviewslice_obj *__pyx_v_self);
3282 static PyObject *__pyx_pf___pyx_memoryviewslice___reduce_cython__(CYTHON_UNUSED
struct __pyx_memoryviewslice_obj *__pyx_v_self);
3283 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);
3284 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);
3285 static PyObject *__pyx_tp_new_6mprans_16cMoveMeshMonitor_cCoefficients(PyTypeObject *t, PyObject *a, PyObject *k);
3286 static PyObject *__pyx_tp_new_6mprans_16cMoveMeshMonitor___pyx_scope_struct__cppPseudoTimeSteppingParallel(PyTypeObject *t, PyObject *a, PyObject *k);
3287 static PyObject *__pyx_tp_new_6mprans_16cMoveMeshMonitor___pyx_scope_struct_1_genexpr(PyTypeObject *t, PyObject *a, PyObject *k);
3288 static PyObject *__pyx_tp_new_6mprans_16cMoveMeshMonitor___pyx_scope_struct_2_genexpr(PyTypeObject *t, PyObject *a, PyObject *k);
3289 static PyObject *__pyx_tp_new_6mprans_16cMoveMeshMonitor___pyx_scope_struct_3_genexpr(PyTypeObject *t, PyObject *a, PyObject *k);
3290 static PyObject *__pyx_tp_new_6mprans_16cMoveMeshMonitor___pyx_scope_struct_4_genexpr(PyTypeObject *t, PyObject *a, PyObject *k);
3291 static PyObject *__pyx_tp_new_array(PyTypeObject *t, PyObject *a, PyObject *k);
3292 static PyObject *__pyx_tp_new_Enum(PyTypeObject *t, PyObject *a, PyObject *k);
3293 static PyObject *__pyx_tp_new_memoryview(PyTypeObject *t, PyObject *a, PyObject *k);
3294 static PyObject *__pyx_tp_new__memoryviewslice(PyTypeObject *t, PyObject *a, PyObject *k);
3295 static PyObject *__pyx_float_0_;
3296 static PyObject *__pyx_float_1_;
3297 static PyObject *__pyx_int_0;
3298 static PyObject *__pyx_int_1;
3299 static PyObject *__pyx_int_3;
3300 static PyObject *__pyx_int_15;
3301 static PyObject *__pyx_int_112105877;
3302 static PyObject *__pyx_int_136983863;
3303 static PyObject *__pyx_int_184977713;
3304 static PyObject *__pyx_int_neg_1;
3305 static PyObject *__pyx_tuple_;
3306 static PyObject *__pyx_slice__4;
3307 static PyObject *__pyx_tuple__2;
3308 static PyObject *__pyx_tuple__3;
3309 static PyObject *__pyx_tuple__5;
3310 static PyObject *__pyx_tuple__6;
3311 static PyObject *__pyx_tuple__7;
3312 static PyObject *__pyx_tuple__8;
3313 static PyObject *__pyx_tuple__9;
3314 static PyObject *__pyx_slice__26;
3315 static PyObject *__pyx_tuple__10;
3316 static PyObject *__pyx_tuple__11;
3317 static PyObject *__pyx_tuple__12;
3318 static PyObject *__pyx_tuple__13;
3319 static PyObject *__pyx_tuple__14;
3320 static PyObject *__pyx_tuple__15;
3321 static PyObject *__pyx_tuple__16;
3322 static PyObject *__pyx_tuple__17;
3323 static PyObject *__pyx_tuple__18;
3324 static PyObject *__pyx_tuple__19;
3325 static PyObject *__pyx_tuple__20;
3326 static PyObject *__pyx_tuple__21;
3327 static PyObject *__pyx_tuple__22;
3328 static PyObject *__pyx_tuple__23;
3329 static PyObject *__pyx_tuple__24;
3330 static PyObject *__pyx_tuple__25;
3331 static PyObject *__pyx_tuple__27;
3332 static PyObject *__pyx_tuple__28;
3333 static PyObject *__pyx_tuple__29;
3334 static PyObject *__pyx_tuple__30;
3335 static PyObject *__pyx_tuple__36;
3336 static PyObject *__pyx_tuple__38;
3337 static PyObject *__pyx_tuple__40;
3338 static PyObject *__pyx_tuple__42;
3339 static PyObject *__pyx_tuple__44;
3340 static PyObject *__pyx_tuple__46;
3341 static PyObject *__pyx_tuple__47;
3342 static PyObject *__pyx_tuple__48;
3343 static PyObject *__pyx_tuple__49;
3344 static PyObject *__pyx_tuple__50;
3345 static PyObject *__pyx_tuple__51;
3346 static PyObject *__pyx_codeobj__37;
3347 static PyObject *__pyx_codeobj__39;
3348 static PyObject *__pyx_codeobj__41;
3349 static PyObject *__pyx_codeobj__43;
3350 static PyObject *__pyx_codeobj__45;
3351 static PyObject *__pyx_codeobj__52;
3363 static int __pyx_pw_6mprans_16cMoveMeshMonitor_13cCoefficients_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
3364 static int __pyx_pw_6mprans_16cMoveMeshMonitor_13cCoefficients_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
3366 __Pyx_RefNannyDeclarations
3367 __Pyx_RefNannySetupContext(
"__cinit__ (wrapper)", 0);
3368 if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) {
3369 __Pyx_RaiseArgtupleInvalid(
"__cinit__", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args));
return -1;}
3370 if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds,
"__cinit__", 0)))
return -1;
3371 __pyx_r = __pyx_pf_6mprans_16cMoveMeshMonitor_13cCoefficients___cinit__(((
struct __pyx_obj_6mprans_16cMoveMeshMonitor_cCoefficients *)__pyx_v_self));
3374 __Pyx_RefNannyFinishContext();
3378 static int __pyx_pf_6mprans_16cMoveMeshMonitor_13cCoefficients___cinit__(
struct __pyx_obj_6mprans_16cMoveMeshMonitor_cCoefficients *__pyx_v_self) {
3380 __Pyx_RefNannyDeclarations
3381 __Pyx_RefNannySetupContext(
"__cinit__", 0);
3390 __pyx_v_self->C = 1.;
3402 __Pyx_RefNannyFinishContext();
3415 static PyObject *__pyx_pw_6mprans_16cMoveMeshMonitor_13cCoefficients_3attachPyCoefficients(PyObject *__pyx_v_self, PyObject *__pyx_v_pyCoefficients);
3416 static PyObject *__pyx_pw_6mprans_16cMoveMeshMonitor_13cCoefficients_3attachPyCoefficients(PyObject *__pyx_v_self, PyObject *__pyx_v_pyCoefficients) {
3417 PyObject *__pyx_r = 0;
3418 __Pyx_RefNannyDeclarations
3419 __Pyx_RefNannySetupContext(
"attachPyCoefficients (wrapper)", 0);
3420 __pyx_r = __pyx_pf_6mprans_16cMoveMeshMonitor_13cCoefficients_2attachPyCoefficients(((
struct __pyx_obj_6mprans_16cMoveMeshMonitor_cCoefficients *)__pyx_v_self), ((PyObject *)__pyx_v_pyCoefficients));
3423 __Pyx_RefNannyFinishContext();
3427 static PyObject *__pyx_pf_6mprans_16cMoveMeshMonitor_13cCoefficients_2attachPyCoefficients(
struct __pyx_obj_6mprans_16cMoveMeshMonitor_cCoefficients *__pyx_v_self, PyObject *__pyx_v_pyCoefficients) {
3428 PyObject *__pyx_r = NULL;
3429 __Pyx_RefNannyDeclarations
3430 __Pyx_RefNannySetupContext(
"attachPyCoefficients", 0);
3439 __Pyx_INCREF(__pyx_v_pyCoefficients);
3440 __Pyx_GIVEREF(__pyx_v_pyCoefficients);
3441 __Pyx_GOTREF(__pyx_v_self->pyCoefficients);
3442 __Pyx_DECREF(__pyx_v_self->pyCoefficients);
3443 __pyx_v_self->pyCoefficients = __pyx_v_pyCoefficients;
3454 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
3455 __Pyx_XGIVEREF(__pyx_r);
3456 __Pyx_RefNannyFinishContext();
3469 static PyObject *__pyx_pw_6mprans_16cMoveMeshMonitor_13cCoefficients_5preStep(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused);
3470 static PyObject *__pyx_pw_6mprans_16cMoveMeshMonitor_13cCoefficients_5preStep(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
3471 PyObject *__pyx_r = 0;
3472 __Pyx_RefNannyDeclarations
3473 __Pyx_RefNannySetupContext(
"preStep (wrapper)", 0);
3474 __pyx_r = __pyx_pf_6mprans_16cMoveMeshMonitor_13cCoefficients_4preStep(((
struct __pyx_obj_6mprans_16cMoveMeshMonitor_cCoefficients *)__pyx_v_self));
3477 __Pyx_RefNannyFinishContext();
3481 static PyObject *__pyx_pf_6mprans_16cMoveMeshMonitor_13cCoefficients_4preStep(
struct __pyx_obj_6mprans_16cMoveMeshMonitor_cCoefficients *__pyx_v_self) {
3482 PyObject *__pyx_v_pc = NULL;
3483 PyObject *__pyx_r = NULL;
3484 __Pyx_RefNannyDeclarations
3485 PyObject *__pyx_t_1 = NULL;
3486 __Pyx_memviewslice __pyx_t_2 = { 0, 0, { 0 }, { 0 }, { 0 } };
3487 PyObject *__pyx_t_3 = NULL;
3488 __Pyx_memviewslice __pyx_t_4 = { 0, 0, { 0 }, { 0 }, { 0 } };
3489 __Pyx_memviewslice __pyx_t_5 = { 0, 0, { 0 }, { 0 }, { 0 } };
3490 __Pyx_memviewslice __pyx_t_6 = { 0, 0, { 0 }, { 0 }, { 0 } };
3491 __Pyx_memviewslice __pyx_t_7 = { 0, 0, { 0 }, { 0 }, { 0 } };
3492 __Pyx_memviewslice __pyx_t_8 = { 0, 0, { 0 }, { 0 }, { 0 } };
3494 int __pyx_lineno = 0;
3495 const char *__pyx_filename = NULL;
3496 int __pyx_clineno = 0;
3497 __Pyx_RefNannySetupContext(
"preStep", 0);
3506 __pyx_t_1 = __pyx_v_self->pyCoefficients;
3507 __Pyx_INCREF(__pyx_t_1);
3508 __pyx_v_pc = __pyx_t_1;
3518 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_pc, __pyx_n_s_uOfXTatQuadrature);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 29, __pyx_L1_error)
3519 __Pyx_GOTREF(__pyx_t_1);
3520 __pyx_t_2 = __Pyx_PyObject_to_MemoryviewSlice_dsds_double(__pyx_t_1, PyBUF_WRITABLE);
if (unlikely(!__pyx_t_2.memview)) __PYX_ERR(0, 29, __pyx_L1_error)
3521 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
3530 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_pc, __pyx_n_s_model);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 30, __pyx_L1_error)
3531 __Pyx_GOTREF(__pyx_t_1);
3532 __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_q);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 30, __pyx_L1_error)
3533 __Pyx_GOTREF(__pyx_t_3);
3534 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
3535 __pyx_t_1 = __Pyx_PyObject_Dict_GetItem(__pyx_t_3, __pyx_kp_s_abs_det_J);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 30, __pyx_L1_error)
3536 __Pyx_GOTREF(__pyx_t_1);
3537 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
3538 __pyx_t_4 = __Pyx_PyObject_to_MemoryviewSlice_dsds_double(__pyx_t_1, PyBUF_WRITABLE);
if (unlikely(!__pyx_t_4.memview)) __PYX_ERR(0, 30, __pyx_L1_error)
3539 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
3548 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_pc, __pyx_n_s_model);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 31, __pyx_L1_error)
3549 __Pyx_GOTREF(__pyx_t_1);
3550 __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_elementQuadratureWeights);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 31, __pyx_L1_error)
3551 __Pyx_GOTREF(__pyx_t_3);
3552 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
3553 __pyx_t_1 = __Pyx_PyObject_GetItem(__pyx_t_3, __pyx_tuple_);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 31, __pyx_L1_error)
3554 __Pyx_GOTREF(__pyx_t_1);
3555 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
3556 __pyx_t_5 = __Pyx_PyObject_to_MemoryviewSlice_ds_double(__pyx_t_1, PyBUF_WRITABLE);
if (unlikely(!__pyx_t_5.memview)) __PYX_ERR(0, 31, __pyx_L1_error)
3557 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
3566 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_pc, __pyx_n_s_areas);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 32, __pyx_L1_error)
3567 __Pyx_GOTREF(__pyx_t_1);
3568 __pyx_t_6 = __Pyx_PyObject_to_MemoryviewSlice_ds_double(__pyx_t_1, PyBUF_WRITABLE);
if (unlikely(!__pyx_t_6.memview)) __PYX_ERR(0, 32, __pyx_L1_error)
3569 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
3578 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_pc, __pyx_n_s_model);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 33, __pyx_L1_error)
3579 __Pyx_GOTREF(__pyx_t_1);
3580 __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_q);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 33, __pyx_L1_error)
3581 __Pyx_GOTREF(__pyx_t_3);
3582 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
3583 __pyx_t_1 = __Pyx_PyObject_GetItem(__pyx_t_3, __pyx_tuple__2);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 33, __pyx_L1_error)
3584 __Pyx_GOTREF(__pyx_t_1);
3585 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
3586 __pyx_t_7 = __Pyx_PyObject_to_MemoryviewSlice_dsds_double(__pyx_t_1, PyBUF_WRITABLE);
if (unlikely(!__pyx_t_7.memview)) __PYX_ERR(0, 33, __pyx_L1_error)
3587 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
3596 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_pc, __pyx_n_s_model);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 34, __pyx_L1_error)
3597 __Pyx_GOTREF(__pyx_t_1);
3598 __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_q);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 34, __pyx_L1_error)
3599 __Pyx_GOTREF(__pyx_t_3);
3600 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
3601 __pyx_t_1 = __Pyx_PyObject_GetItem(__pyx_t_3, __pyx_tuple__3);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 34, __pyx_L1_error)
3602 __Pyx_GOTREF(__pyx_t_1);
3603 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
3604 __pyx_t_8 = __Pyx_PyObject_to_MemoryviewSlice_dsdsds_double(__pyx_t_1, PyBUF_WRITABLE);
if (unlikely(!__pyx_t_8.memview)) __PYX_ERR(0, 34, __pyx_L1_error)
3605 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
3614 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_pc, __pyx_n_s_mesh);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 35, __pyx_L1_error)
3615 __Pyx_GOTREF(__pyx_t_1);
3616 __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_nElements_owned);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 35, __pyx_L1_error)
3617 __Pyx_GOTREF(__pyx_t_3);
3618 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
3619 __pyx_t_9 = __Pyx_PyInt_As_int(__pyx_t_3);
if (unlikely((__pyx_t_9 == (
int)-1) && PyErr_Occurred())) __PYX_ERR(0, 35, __pyx_L1_error)
3620 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
3629 __pyx_t_3 = ((
struct __pyx_vtabstruct_6mprans_16cMoveMeshMonitor_cCoefficients *)__pyx_v_self->__pyx_vtab)->cppPreStep(__pyx_v_self, __pyx_t_2, __pyx_t_4, __pyx_t_5, __pyx_t_6, __pyx_t_7, __pyx_t_8, __pyx_t_9);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 29, __pyx_L1_error)
3630 __Pyx_GOTREF(__pyx_t_3);
3631 __PYX_XDEC_MEMVIEW(&__pyx_t_2, 1);
3632 __pyx_t_2.memview = NULL;
3633 __pyx_t_2.data = NULL;
3634 __PYX_XDEC_MEMVIEW(&__pyx_t_4, 1);
3635 __pyx_t_4.memview = NULL;
3636 __pyx_t_4.data = NULL;
3637 __PYX_XDEC_MEMVIEW(&__pyx_t_5, 1);
3638 __pyx_t_5.memview = NULL;
3639 __pyx_t_5.data = NULL;
3640 __PYX_XDEC_MEMVIEW(&__pyx_t_6, 1);
3641 __pyx_t_6.memview = NULL;
3642 __pyx_t_6.data = NULL;
3643 __PYX_XDEC_MEMVIEW(&__pyx_t_7, 1);
3644 __pyx_t_7.memview = NULL;
3645 __pyx_t_7.data = NULL;
3646 __PYX_XDEC_MEMVIEW(&__pyx_t_8, 1);
3647 __pyx_t_8.memview = NULL;
3648 __pyx_t_8.data = NULL;
3649 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
3660 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
3663 __Pyx_XDECREF(__pyx_t_1);
3664 __PYX_XDEC_MEMVIEW(&__pyx_t_2, 1);
3665 __Pyx_XDECREF(__pyx_t_3);
3666 __PYX_XDEC_MEMVIEW(&__pyx_t_4, 1);
3667 __PYX_XDEC_MEMVIEW(&__pyx_t_5, 1);
3668 __PYX_XDEC_MEMVIEW(&__pyx_t_6, 1);
3669 __PYX_XDEC_MEMVIEW(&__pyx_t_7, 1);
3670 __PYX_XDEC_MEMVIEW(&__pyx_t_8, 1);
3671 __Pyx_AddTraceback(
"mprans.cMoveMeshMonitor.cCoefficients.preStep", __pyx_clineno, __pyx_lineno, __pyx_filename);
3674 __Pyx_XDECREF(__pyx_v_pc);
3675 __Pyx_XGIVEREF(__pyx_r);
3676 __Pyx_RefNannyFinishContext();
3688 static PyObject *__pyx_f_6mprans_16cMoveMeshMonitor_13cCoefficients_cppPreStep(
struct __pyx_obj_6mprans_16cMoveMeshMonitor_cCoefficients *__pyx_v_self, __Pyx_memviewslice __pyx_v_q_uOfX, __Pyx_memviewslice __pyx_v_q_J, __Pyx_memviewslice __pyx_v_q_weights, __Pyx_memviewslice __pyx_v_areas_, __Pyx_memviewslice __pyx_v_q_rci, __Pyx_memviewslice __pyx_v_q_fci,
int __pyx_v_nElements_owned) {
3689 double __pyx_v_integral_1_over_f;
3690 CYTHON_UNUSED
int __pyx_v_N_eN;
3692 double __pyx_v_area;
3697 PyObject *__pyx_v_comm = NULL;
3700 PyObject *__pyx_v_pc = 0;
3701 PyObject *__pyx_v_mesh = 0;
3703 __Pyx_memviewslice __pyx_v_elementBoundaryBarycentersArray = { 0, 0, { 0 }, { 0 }, { 0 } };
3704 __Pyx_memviewslice __pyx_v_elementBarycentersArray = { 0, 0, { 0 }, { 0 }, { 0 } };
3705 __Pyx_memviewslice __pyx_v_nodeArray = { 0, 0, { 0 }, { 0 }, { 0 } };
3706 __Pyx_memviewslice __pyx_v_elementBoundaryNodesArray = { 0, 0, { 0 }, { 0 }, { 0 } };
3707 __Pyx_memviewslice __pyx_v_elementNodesArray = { 0, 0, { 0 }, { 0 }, { 0 } };
3708 __Pyx_memviewslice __pyx_v_elementBoundariesArray = { 0, 0, { 0 }, { 0 }, { 0 } };
3709 int __pyx_v_nElementBoundaries_global;
3710 int __pyx_v_nNodes_elementBoundary;
3711 int __pyx_v_nElements_global;
3712 int __pyx_v_nNodes_element;
3713 __Pyx_memviewslice __pyx_v_elementBoundaryNormalsArray = { 0, 0, { 0 }, { 0 }, { 0 } };
3716 PyObject *__pyx_r = NULL;
3717 __Pyx_RefNannyDeclarations
3725 Py_ssize_t __pyx_t_8;
3726 Py_ssize_t __pyx_t_9;
3727 Py_ssize_t __pyx_t_10;
3729 Py_ssize_t __pyx_t_12;
3730 Py_ssize_t __pyx_t_13;
3731 PyObject *__pyx_t_14 = NULL;
3732 PyObject *__pyx_t_15 = NULL;
3733 PyObject *__pyx_t_16 = NULL;
3734 PyObject *__pyx_t_17 = NULL;
3735 PyObject *__pyx_t_18 = NULL;
3737 __Pyx_memviewslice __pyx_t_20 = { 0, 0, { 0 }, { 0 }, { 0 } };
3738 __Pyx_memviewslice __pyx_t_21 = { 0, 0, { 0 }, { 0 }, { 0 } };
3739 __Pyx_memviewslice __pyx_t_22 = { 0, 0, { 0 }, { 0 }, { 0 } };
3740 __Pyx_memviewslice __pyx_t_23 = { 0, 0, { 0 }, { 0 }, { 0 } };
3741 Py_ssize_t __pyx_t_24;
3742 int __pyx_lineno = 0;
3743 const char *__pyx_filename = NULL;
3744 int __pyx_clineno = 0;
3745 __Pyx_RefNannySetupContext(
"cppPreStep", 0);
3754 __pyx_v_integral_1_over_f = 0.;
3763 __pyx_v_N_eN = (__pyx_v_q_J.shape[0]);
3790 __pyx_t_1 = __Pyx_MemoryView_Len(__pyx_v_q_J);
3791 __pyx_v_nJ = __pyx_t_1;
3800 __pyx_t_1 = __Pyx_MemoryView_Len(__pyx_v_q_weights);
3801 __pyx_v_nk = __pyx_t_1;
3810 __pyx_t_2 = __pyx_v_nJ;
3811 __pyx_t_3 = __pyx_t_2;
3812 for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
3813 __pyx_v_eN = __pyx_t_4;
3831 __pyx_t_5 = __pyx_v_nk;
3832 __pyx_t_6 = __pyx_t_5;
3833 for (__pyx_t_7 = 0; __pyx_t_7 < __pyx_t_6; __pyx_t_7+=1) {
3834 __pyx_v_k = __pyx_t_7;
3843 __pyx_t_8 = __pyx_v_eN;
3844 __pyx_t_9 = __pyx_v_k;
3845 if (__pyx_t_8 < 0) __pyx_t_8 += __pyx_v_q_J.shape[0];
3846 if (__pyx_t_9 < 0) __pyx_t_9 += __pyx_v_q_J.shape[1];
3847 __pyx_t_10 = __pyx_v_k;
3848 if (__pyx_t_10 < 0) __pyx_t_10 += __pyx_v_q_weights.shape[0];
3849 __pyx_v_area = (__pyx_v_area + ((*((
double *) ( (( (__pyx_v_q_J.data + __pyx_t_8 * __pyx_v_q_J.strides[0]) ) + __pyx_t_9 * __pyx_v_q_J.strides[1]) ))) * (*((
double *) ( (__pyx_v_q_weights.data + __pyx_t_10 * __pyx_v_q_weights.strides[0]) )))));
3858 __pyx_t_11 = ((__pyx_v_eN < __pyx_v_nElements_owned) != 0);
3868 __pyx_t_10 = __pyx_v_eN;
3869 __pyx_t_9 = __pyx_v_k;
3870 if (__pyx_t_10 < 0) __pyx_t_10 += __pyx_v_q_J.shape[0];
3871 if (__pyx_t_9 < 0) __pyx_t_9 += __pyx_v_q_J.shape[1];
3872 __pyx_t_8 = __pyx_v_k;
3873 if (__pyx_t_8 < 0) __pyx_t_8 += __pyx_v_q_weights.shape[0];
3874 __pyx_t_12 = __pyx_v_eN;
3875 __pyx_t_13 = __pyx_v_k;
3876 if (__pyx_t_12 < 0) __pyx_t_12 += __pyx_v_q_uOfX.shape[0];
3877 if (__pyx_t_13 < 0) __pyx_t_13 += __pyx_v_q_uOfX.shape[1];
3878 __pyx_v_integral_1_over_f = (__pyx_v_integral_1_over_f + (((*((
double *) ( (( (__pyx_v_q_J.data + __pyx_t_10 * __pyx_v_q_J.strides[0]) ) + __pyx_t_9 * __pyx_v_q_J.strides[1]) ))) * (*((
double *) ( (__pyx_v_q_weights.data + __pyx_t_8 * __pyx_v_q_weights.strides[0]) )))) / (*((
double *) ( (( (__pyx_v_q_uOfX.data + __pyx_t_12 * __pyx_v_q_uOfX.strides[0]) ) + __pyx_t_13 * __pyx_v_q_uOfX.strides[1]) )))));
3897 __pyx_t_13 = __pyx_v_eN;
3898 if (__pyx_t_13 < 0) __pyx_t_13 += __pyx_v_areas_.shape[0];
3899 *((
double *) ( (__pyx_v_areas_.data + __pyx_t_13 * __pyx_v_areas_.strides[0]) )) = __pyx_v_area;
3908 __pyx_t_11 = ((__pyx_v_eN < __pyx_v_nElements_owned) != 0);
3918 __pyx_v_nE = (__pyx_v_nE + 1);
3937 __Pyx_GetModuleGlobalName(__pyx_t_16, __pyx_n_s_Comm);
if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 60, __pyx_L1_error)
3938 __Pyx_GOTREF(__pyx_t_16);
3939 __pyx_t_17 = __Pyx_PyObject_GetAttrStr(__pyx_t_16, __pyx_n_s_get);
if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 60, __pyx_L1_error)
3940 __Pyx_GOTREF(__pyx_t_17);
3941 __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
3943 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_17))) {
3944 __pyx_t_16 = PyMethod_GET_SELF(__pyx_t_17);
3945 if (likely(__pyx_t_16)) {
3946 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_17);
3947 __Pyx_INCREF(__pyx_t_16);
3948 __Pyx_INCREF(
function);
3949 __Pyx_DECREF_SET(__pyx_t_17,
function);
3952 __pyx_t_15 = (__pyx_t_16) ? __Pyx_PyObject_CallOneArg(__pyx_t_17, __pyx_t_16) : __Pyx_PyObject_CallNoArg(__pyx_t_17);
3953 __Pyx_XDECREF(__pyx_t_16); __pyx_t_16 = 0;
3954 if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 60, __pyx_L1_error)
3955 __Pyx_GOTREF(__pyx_t_15);
3956 __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
3957 __pyx_t_17 = __Pyx_PyObject_GetAttrStr(__pyx_t_15, __pyx_n_s_comm);
if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 60, __pyx_L1_error)
3958 __Pyx_GOTREF(__pyx_t_17);
3959 __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
3960 __pyx_t_15 = __Pyx_PyObject_GetAttrStr(__pyx_t_17, __pyx_n_s_tompi4py);
if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 60, __pyx_L1_error)
3961 __Pyx_GOTREF(__pyx_t_15);
3962 __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
3964 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_15))) {
3965 __pyx_t_17 = PyMethod_GET_SELF(__pyx_t_15);
3966 if (likely(__pyx_t_17)) {
3967 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_15);
3968 __Pyx_INCREF(__pyx_t_17);
3969 __Pyx_INCREF(
function);
3970 __Pyx_DECREF_SET(__pyx_t_15,
function);
3973 __pyx_t_14 = (__pyx_t_17) ? __Pyx_PyObject_CallOneArg(__pyx_t_15, __pyx_t_17) : __Pyx_PyObject_CallNoArg(__pyx_t_15);
3974 __Pyx_XDECREF(__pyx_t_17); __pyx_t_17 = 0;
3975 if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 60, __pyx_L1_error)
3976 __Pyx_GOTREF(__pyx_t_14);
3977 __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
3978 __pyx_v_comm = __pyx_t_14;
3988 __pyx_t_14 = __Pyx_PyObject_GetAttrStr(__pyx_v_comm, __pyx_n_s_size);
if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 61, __pyx_L1_error)
3989 __Pyx_GOTREF(__pyx_t_14);
3990 __pyx_t_15 = PyObject_RichCompare(__pyx_t_14, __pyx_int_1, Py_GT); __Pyx_XGOTREF(__pyx_t_15);
if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 61, __pyx_L1_error)
3991 __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
3992 __pyx_t_11 = __Pyx_PyObject_IsTrue(__pyx_t_15);
if (unlikely(__pyx_t_11 < 0)) __PYX_ERR(0, 61, __pyx_L1_error)
3993 __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
4003 __pyx_t_15 = __Pyx_PyObject_GetAttrStr(__pyx_v_comm, __pyx_n_s_allreduce);
if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 62, __pyx_L1_error)
4004 __Pyx_GOTREF(__pyx_t_15);
4005 __pyx_t_14 = PyFloat_FromDouble(__pyx_v_integral_1_over_f);
if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 62, __pyx_L1_error)
4006 __Pyx_GOTREF(__pyx_t_14);
4007 __pyx_t_17 = PyTuple_New(1);
if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 62, __pyx_L1_error)
4008 __Pyx_GOTREF(__pyx_t_17);
4009 __Pyx_GIVEREF(__pyx_t_14);
4010 PyTuple_SET_ITEM(__pyx_t_17, 0, __pyx_t_14);
4012 __pyx_t_14 = __Pyx_PyDict_NewPresized(1);
if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 62, __pyx_L1_error)
4013 __Pyx_GOTREF(__pyx_t_14);
4014 __Pyx_GetModuleGlobalName(__pyx_t_16, __pyx_n_s_MPI);
if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 62, __pyx_L1_error)
4015 __Pyx_GOTREF(__pyx_t_16);
4016 __pyx_t_18 = __Pyx_PyObject_GetAttrStr(__pyx_t_16, __pyx_n_s_SUM);
if (unlikely(!__pyx_t_18)) __PYX_ERR(0, 62, __pyx_L1_error)
4017 __Pyx_GOTREF(__pyx_t_18);
4018 __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
4019 if (PyDict_SetItem(__pyx_t_14, __pyx_n_s_op, __pyx_t_18) < 0) __PYX_ERR(0, 62, __pyx_L1_error)
4020 __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
4021 __pyx_t_18 = __Pyx_PyObject_Call(__pyx_t_15, __pyx_t_17, __pyx_t_14);
if (unlikely(!__pyx_t_18)) __PYX_ERR(0, 62, __pyx_L1_error)
4022 __Pyx_GOTREF(__pyx_t_18);
4023 __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
4024 __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
4025 __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
4026 __pyx_t_19 = __pyx_PyFloat_AsDouble(__pyx_t_18);
if (unlikely((__pyx_t_19 == (
double)-1) && PyErr_Occurred())) __PYX_ERR(0, 62, __pyx_L1_error)
4027 __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
4028 __pyx_v_integral_1_over_f = __pyx_t_19;
4037 __pyx_t_18 = __Pyx_PyObject_GetAttrStr(__pyx_v_comm, __pyx_n_s_allreduce);
if (unlikely(!__pyx_t_18)) __PYX_ERR(0, 63, __pyx_L1_error)
4038 __Pyx_GOTREF(__pyx_t_18);
4039 __pyx_t_14 = __Pyx_PyInt_From_int(__pyx_v_nE);
if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 63, __pyx_L1_error)
4040 __Pyx_GOTREF(__pyx_t_14);
4041 __pyx_t_17 = PyTuple_New(1);
if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 63, __pyx_L1_error)
4042 __Pyx_GOTREF(__pyx_t_17);
4043 __Pyx_GIVEREF(__pyx_t_14);
4044 PyTuple_SET_ITEM(__pyx_t_17, 0, __pyx_t_14);
4046 __pyx_t_14 = __Pyx_PyDict_NewPresized(1);
if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 63, __pyx_L1_error)
4047 __Pyx_GOTREF(__pyx_t_14);
4048 __Pyx_GetModuleGlobalName(__pyx_t_15, __pyx_n_s_MPI);
if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 63, __pyx_L1_error)
4049 __Pyx_GOTREF(__pyx_t_15);
4050 __pyx_t_16 = __Pyx_PyObject_GetAttrStr(__pyx_t_15, __pyx_n_s_SUM);
if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 63, __pyx_L1_error)
4051 __Pyx_GOTREF(__pyx_t_16);
4052 __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
4053 if (PyDict_SetItem(__pyx_t_14, __pyx_n_s_op, __pyx_t_16) < 0) __PYX_ERR(0, 63, __pyx_L1_error)
4054 __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
4055 __pyx_t_16 = __Pyx_PyObject_Call(__pyx_t_18, __pyx_t_17, __pyx_t_14);
if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 63, __pyx_L1_error)
4056 __Pyx_GOTREF(__pyx_t_16);
4057 __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
4058 __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
4059 __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
4060 __pyx_t_2 = __Pyx_PyInt_As_int(__pyx_t_16);
if (unlikely((__pyx_t_2 == (
int)-1) && PyErr_Occurred())) __PYX_ERR(0, 63, __pyx_L1_error)
4061 __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
4062 __pyx_v_nE = __pyx_t_2;
4080 __pyx_v_C = (__pyx_v_integral_1_over_f / __pyx_v_nE);
4089 __pyx_v_self->C = __pyx_v_C;
4098 __pyx_t_1 = __Pyx_MemoryView_Len(__pyx_v_q_rci);
4099 __pyx_v_nrci = __pyx_t_1;
4108 __pyx_t_2 = __pyx_v_nrci;
4109 __pyx_t_3 = __pyx_t_2;
4110 for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
4111 __pyx_v_eN = __pyx_t_4;
4120 __pyx_t_5 = __pyx_v_nk;
4121 __pyx_t_6 = __pyx_t_5;
4122 for (__pyx_t_7 = 0; __pyx_t_7 < __pyx_t_6; __pyx_t_7+=1) {
4123 __pyx_v_k = __pyx_t_7;
4132 __pyx_t_20.data = __pyx_v_q_fci.data;
4133 __pyx_t_20.memview = __pyx_v_q_fci.memview;
4134 __PYX_INC_MEMVIEW(&__pyx_t_20, 0);
4136 Py_ssize_t __pyx_tmp_idx = __pyx_v_eN;
4137 Py_ssize_t __pyx_tmp_shape = __pyx_v_q_fci.shape[0];
4138 Py_ssize_t __pyx_tmp_stride = __pyx_v_q_fci.strides[0];
4139 if (__pyx_tmp_idx < 0)
4140 __pyx_tmp_idx += __pyx_tmp_shape;
4141 __pyx_t_20.data += __pyx_tmp_idx * __pyx_tmp_stride;
4145 Py_ssize_t __pyx_tmp_idx = __pyx_v_k;
4146 Py_ssize_t __pyx_tmp_shape = __pyx_v_q_fci.shape[1];
4147 Py_ssize_t __pyx_tmp_stride = __pyx_v_q_fci.strides[1];
4148 if (__pyx_tmp_idx < 0)
4149 __pyx_tmp_idx += __pyx_tmp_shape;
4150 __pyx_t_20.data += __pyx_tmp_idx * __pyx_tmp_stride;
4153 __pyx_t_20.shape[0] = __pyx_v_q_fci.shape[2];
4154 __pyx_t_20.strides[0] = __pyx_v_q_fci.strides[2];
4155 __pyx_t_20.suboffsets[0] = -1;
4158 double __pyx_temp_scalar = 0.0;
4160 Py_ssize_t __pyx_temp_extent_0 = __pyx_t_20.shape[0];
4161 Py_ssize_t __pyx_temp_stride_0 = __pyx_t_20.strides[0];
4162 char *__pyx_temp_pointer_0;
4163 Py_ssize_t __pyx_temp_idx_0;
4164 __pyx_temp_pointer_0 = __pyx_t_20.data;
4165 for (__pyx_temp_idx_0 = 0; __pyx_temp_idx_0 < __pyx_temp_extent_0; __pyx_temp_idx_0++) {
4166 *((
double *) __pyx_temp_pointer_0) = __pyx_temp_scalar;
4167 __pyx_temp_pointer_0 += __pyx_temp_stride_0;
4171 __PYX_XDEC_MEMVIEW(&__pyx_t_20, 1);
4172 __pyx_t_20.memview = NULL;
4173 __pyx_t_20.data = NULL;
4182 __pyx_t_13 = __pyx_v_eN;
4183 __pyx_t_12 = __pyx_v_k;
4184 if (__pyx_t_13 < 0) __pyx_t_13 += __pyx_v_q_uOfX.shape[0];
4185 if (__pyx_t_12 < 0) __pyx_t_12 += __pyx_v_q_uOfX.shape[1];
4186 __pyx_t_8 = __pyx_v_eN;
4187 if (__pyx_t_8 < 0) __pyx_t_8 += __pyx_v_areas_.shape[0];
4188 __pyx_t_9 = __pyx_v_eN;
4189 __pyx_t_10 = __pyx_v_k;
4190 if (__pyx_t_9 < 0) __pyx_t_9 += __pyx_v_q_rci.shape[0];
4191 if (__pyx_t_10 < 0) __pyx_t_10 += __pyx_v_q_rci.shape[1];
4192 *((
double *) ( (( (__pyx_v_q_rci.data + __pyx_t_9 * __pyx_v_q_rci.strides[0]) ) + __pyx_t_10 * __pyx_v_q_rci.strides[1]) )) = (-((1. / ((*((
double *) ( (( (__pyx_v_q_uOfX.data + __pyx_t_13 * __pyx_v_q_uOfX.strides[0]) ) + __pyx_t_12 * __pyx_v_q_uOfX.strides[1]) ))) * __pyx_v_C)) - (1. / (*((
double *) ( (__pyx_v_areas_.data + __pyx_t_8 * __pyx_v_areas_.strides[0]) ))))));
4203 __pyx_t_16 = __pyx_v_self->pyCoefficients;
4204 __Pyx_INCREF(__pyx_t_16);
4205 __pyx_v_pc = __pyx_t_16;
4215 __pyx_t_16 = __Pyx_PyObject_GetAttrStr(__pyx_v_pc, __pyx_n_s_mesh);
if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 74, __pyx_L1_error)
4216 __Pyx_GOTREF(__pyx_t_16);
4217 __pyx_v_mesh = __pyx_t_16;
4227 __pyx_t_16 = __Pyx_PyObject_GetAttrStr(__pyx_v_pc, __pyx_n_s_nd);
if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 75, __pyx_L1_error)
4228 __Pyx_GOTREF(__pyx_t_16);
4229 __pyx_t_2 = __Pyx_PyInt_As_int(__pyx_t_16);
if (unlikely((__pyx_t_2 == (
int)-1) && PyErr_Occurred())) __PYX_ERR(0, 75, __pyx_L1_error)
4230 __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
4231 __pyx_v_nd = __pyx_t_2;
4240 __pyx_t_16 = __Pyx_PyObject_GetAttrStr(__pyx_v_mesh, __pyx_n_s_elementBoundaryBarycentersArray);
if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 76, __pyx_L1_error)
4241 __Pyx_GOTREF(__pyx_t_16);
4242 __pyx_t_21 = __Pyx_PyObject_to_MemoryviewSlice_dsds_double(__pyx_t_16, PyBUF_WRITABLE);
if (unlikely(!__pyx_t_21.memview)) __PYX_ERR(0, 76, __pyx_L1_error)
4243 __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
4244 __pyx_v_elementBoundaryBarycentersArray = __pyx_t_21;
4245 __pyx_t_21.memview = NULL;
4246 __pyx_t_21.data = NULL;
4255 __pyx_t_16 = __Pyx_PyObject_GetAttrStr(__pyx_v_mesh, __pyx_n_s_elementBarycentersArray);
if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 77, __pyx_L1_error)
4256 __Pyx_GOTREF(__pyx_t_16);
4257 __pyx_t_21 = __Pyx_PyObject_to_MemoryviewSlice_dsds_double(__pyx_t_16, PyBUF_WRITABLE);
if (unlikely(!__pyx_t_21.memview)) __PYX_ERR(0, 77, __pyx_L1_error)
4258 __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
4259 __pyx_v_elementBarycentersArray = __pyx_t_21;
4260 __pyx_t_21.memview = NULL;
4261 __pyx_t_21.data = NULL;
4270 __pyx_t_16 = __Pyx_PyObject_GetAttrStr(__pyx_v_mesh, __pyx_n_s_nodeArray);
if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 78, __pyx_L1_error)
4271 __Pyx_GOTREF(__pyx_t_16);
4272 __pyx_t_21 = __Pyx_PyObject_to_MemoryviewSlice_dsds_double(__pyx_t_16, PyBUF_WRITABLE);
if (unlikely(!__pyx_t_21.memview)) __PYX_ERR(0, 78, __pyx_L1_error)
4273 __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
4274 __pyx_v_nodeArray = __pyx_t_21;
4275 __pyx_t_21.memview = NULL;
4276 __pyx_t_21.data = NULL;
4285 __pyx_t_16 = __Pyx_PyObject_GetAttrStr(__pyx_v_mesh, __pyx_n_s_elementBoundaryNodesArray);
if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 79, __pyx_L1_error)
4286 __Pyx_GOTREF(__pyx_t_16);
4287 __pyx_t_22 = __Pyx_PyObject_to_MemoryviewSlice_dsds_int(__pyx_t_16, PyBUF_WRITABLE);
if (unlikely(!__pyx_t_22.memview)) __PYX_ERR(0, 79, __pyx_L1_error)
4288 __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
4289 __pyx_v_elementBoundaryNodesArray = __pyx_t_22;
4290 __pyx_t_22.memview = NULL;
4291 __pyx_t_22.data = NULL;
4300 __pyx_t_16 = __Pyx_PyObject_GetAttrStr(__pyx_v_mesh, __pyx_n_s_elementNodesArray);
if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 80, __pyx_L1_error)
4301 __Pyx_GOTREF(__pyx_t_16);
4302 __pyx_t_22 = __Pyx_PyObject_to_MemoryviewSlice_dsds_int(__pyx_t_16, PyBUF_WRITABLE);
if (unlikely(!__pyx_t_22.memview)) __PYX_ERR(0, 80, __pyx_L1_error)
4303 __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
4304 __pyx_v_elementNodesArray = __pyx_t_22;
4305 __pyx_t_22.memview = NULL;
4306 __pyx_t_22.data = NULL;
4315 __pyx_t_16 = __Pyx_PyObject_GetAttrStr(__pyx_v_mesh, __pyx_n_s_elementBoundariesArray);
if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 81, __pyx_L1_error)
4316 __Pyx_GOTREF(__pyx_t_16);
4317 __pyx_t_22 = __Pyx_PyObject_to_MemoryviewSlice_dsds_int(__pyx_t_16, PyBUF_WRITABLE);
if (unlikely(!__pyx_t_22.memview)) __PYX_ERR(0, 81, __pyx_L1_error)
4318 __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
4319 __pyx_v_elementBoundariesArray = __pyx_t_22;
4320 __pyx_t_22.memview = NULL;
4321 __pyx_t_22.data = NULL;
4330 __pyx_t_16 = __Pyx_PyObject_GetAttrStr(__pyx_v_mesh, __pyx_n_s_nElementBoundaries_global);
if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 82, __pyx_L1_error)
4331 __Pyx_GOTREF(__pyx_t_16);
4332 __pyx_t_2 = __Pyx_PyInt_As_int(__pyx_t_16);
if (unlikely((__pyx_t_2 == (
int)-1) && PyErr_Occurred())) __PYX_ERR(0, 82, __pyx_L1_error)
4333 __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
4334 __pyx_v_nElementBoundaries_global = __pyx_t_2;
4343 __pyx_t_16 = __Pyx_PyObject_GetAttrStr(__pyx_v_mesh, __pyx_n_s_nNodes_elementBoundary);
if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 83, __pyx_L1_error)
4344 __Pyx_GOTREF(__pyx_t_16);
4345 __pyx_t_2 = __Pyx_PyInt_As_int(__pyx_t_16);
if (unlikely((__pyx_t_2 == (
int)-1) && PyErr_Occurred())) __PYX_ERR(0, 83, __pyx_L1_error)
4346 __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
4347 __pyx_v_nNodes_elementBoundary = __pyx_t_2;
4356 __pyx_t_16 = __Pyx_PyObject_GetAttrStr(__pyx_v_mesh, __pyx_n_s_nElements_global);
if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 84, __pyx_L1_error)
4357 __Pyx_GOTREF(__pyx_t_16);
4358 __pyx_t_2 = __Pyx_PyInt_As_int(__pyx_t_16);
if (unlikely((__pyx_t_2 == (
int)-1) && PyErr_Occurred())) __PYX_ERR(0, 84, __pyx_L1_error)
4359 __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
4360 __pyx_v_nElements_global = __pyx_t_2;
4369 __pyx_t_16 = __Pyx_PyObject_GetAttrStr(__pyx_v_mesh, __pyx_n_s_nNodes_element);
if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 85, __pyx_L1_error)
4370 __Pyx_GOTREF(__pyx_t_16);
4371 __pyx_t_2 = __Pyx_PyInt_As_int(__pyx_t_16);
if (unlikely((__pyx_t_2 == (
int)-1) && PyErr_Occurred())) __PYX_ERR(0, 85, __pyx_L1_error)
4372 __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
4373 __pyx_v_nNodes_element = __pyx_t_2;
4382 __pyx_t_16 = __Pyx_PyObject_GetAttrStr(__pyx_v_pc, __pyx_n_s_mesh);
if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 86, __pyx_L1_error)
4383 __Pyx_GOTREF(__pyx_t_16);
4384 __pyx_t_14 = __Pyx_PyObject_GetAttrStr(__pyx_t_16, __pyx_n_s_elementBoundaryNormalsArray);
if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 86, __pyx_L1_error)
4385 __Pyx_GOTREF(__pyx_t_14);
4386 __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
4387 __pyx_t_23 = __Pyx_PyObject_to_MemoryviewSlice_dsdsds_double(__pyx_t_14, PyBUF_WRITABLE);
if (unlikely(!__pyx_t_23.memview)) __PYX_ERR(0, 86, __pyx_L1_error)
4388 __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
4389 __pyx_v_elementBoundaryNormalsArray = __pyx_t_23;
4390 __pyx_t_23.memview = NULL;
4391 __pyx_t_23.data = NULL;
4400 __pyx_t_2 = __pyx_v_nElementBoundaries_global;
4401 __pyx_t_3 = __pyx_t_2;
4402 for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
4403 __pyx_v_ebN = __pyx_t_4;
4412 __pyx_t_8 = __pyx_v_ebN;
4414 if (__pyx_t_8 < 0) __pyx_t_8 += __pyx_v_elementBoundaryBarycentersArray.shape[0];
4415 if (__pyx_t_12 < 0) __pyx_t_12 += __pyx_v_elementBoundaryBarycentersArray.shape[1];
4416 *((
double *) ( (( (__pyx_v_elementBoundaryBarycentersArray.data + __pyx_t_8 * __pyx_v_elementBoundaryBarycentersArray.strides[0]) ) + __pyx_t_12 * __pyx_v_elementBoundaryBarycentersArray.strides[1]) )) = 0.;
4425 __pyx_t_12 = __pyx_v_ebN;
4427 if (__pyx_t_12 < 0) __pyx_t_12 += __pyx_v_elementBoundaryBarycentersArray.shape[0];
4428 if (__pyx_t_8 < 0) __pyx_t_8 += __pyx_v_elementBoundaryBarycentersArray.shape[1];
4429 *((
double *) ( (( (__pyx_v_elementBoundaryBarycentersArray.data + __pyx_t_12 * __pyx_v_elementBoundaryBarycentersArray.strides[0]) ) + __pyx_t_8 * __pyx_v_elementBoundaryBarycentersArray.strides[1]) )) = 0.;
4438 __pyx_t_8 = __pyx_v_ebN;
4440 if (__pyx_t_8 < 0) __pyx_t_8 += __pyx_v_elementBoundaryBarycentersArray.shape[0];
4441 if (__pyx_t_12 < 0) __pyx_t_12 += __pyx_v_elementBoundaryBarycentersArray.shape[1];
4442 *((
double *) ( (( (__pyx_v_elementBoundaryBarycentersArray.data + __pyx_t_8 * __pyx_v_elementBoundaryBarycentersArray.strides[0]) ) + __pyx_t_12 * __pyx_v_elementBoundaryBarycentersArray.strides[1]) )) = 0.;
4451 __pyx_t_5 = __pyx_v_nNodes_elementBoundary;
4452 __pyx_t_6 = __pyx_t_5;
4453 for (__pyx_t_7 = 0; __pyx_t_7 < __pyx_t_6; __pyx_t_7+=1) {
4454 __pyx_v_nN = __pyx_t_7;
4463 __pyx_t_12 = __pyx_v_ebN;
4464 __pyx_t_8 = __pyx_v_nN;
4465 if (__pyx_t_12 < 0) __pyx_t_12 += __pyx_v_elementBoundaryNodesArray.shape[0];
4466 if (__pyx_t_8 < 0) __pyx_t_8 += __pyx_v_elementBoundaryNodesArray.shape[1];
4467 __pyx_t_13 = (*((
int *) ( (( (__pyx_v_elementBoundaryNodesArray.data + __pyx_t_12 * __pyx_v_elementBoundaryNodesArray.strides[0]) ) + __pyx_t_8 * __pyx_v_elementBoundaryNodesArray.strides[1]) )));
4469 if (__pyx_t_13 < 0) __pyx_t_13 += __pyx_v_nodeArray.shape[0];
4470 if (__pyx_t_10 < 0) __pyx_t_10 += __pyx_v_nodeArray.shape[1];
4471 __pyx_t_9 = __pyx_v_ebN;
4473 if (__pyx_t_9 < 0) __pyx_t_9 += __pyx_v_elementBoundaryBarycentersArray.shape[0];
4474 if (__pyx_t_24 < 0) __pyx_t_24 += __pyx_v_elementBoundaryBarycentersArray.shape[1];
4475 *((
double *) ( (( (__pyx_v_elementBoundaryBarycentersArray.data + __pyx_t_9 * __pyx_v_elementBoundaryBarycentersArray.strides[0]) ) + __pyx_t_24 * __pyx_v_elementBoundaryBarycentersArray.strides[1]) )) += (*((
double *) ( (( (__pyx_v_nodeArray.data + __pyx_t_13 * __pyx_v_nodeArray.strides[0]) ) + __pyx_t_10 * __pyx_v_nodeArray.strides[1]) )));
4484 __pyx_t_8 = __pyx_v_ebN;
4485 __pyx_t_12 = __pyx_v_nN;
4486 if (__pyx_t_8 < 0) __pyx_t_8 += __pyx_v_elementBoundaryNodesArray.shape[0];
4487 if (__pyx_t_12 < 0) __pyx_t_12 += __pyx_v_elementBoundaryNodesArray.shape[1];
4488 __pyx_t_10 = (*((
int *) ( (( (__pyx_v_elementBoundaryNodesArray.data + __pyx_t_8 * __pyx_v_elementBoundaryNodesArray.strides[0]) ) + __pyx_t_12 * __pyx_v_elementBoundaryNodesArray.strides[1]) )));
4490 if (__pyx_t_10 < 0) __pyx_t_10 += __pyx_v_nodeArray.shape[0];
4491 if (__pyx_t_13 < 0) __pyx_t_13 += __pyx_v_nodeArray.shape[1];
4492 __pyx_t_24 = __pyx_v_ebN;
4494 if (__pyx_t_24 < 0) __pyx_t_24 += __pyx_v_elementBoundaryBarycentersArray.shape[0];
4495 if (__pyx_t_9 < 0) __pyx_t_9 += __pyx_v_elementBoundaryBarycentersArray.shape[1];
4496 *((
double *) ( (( (__pyx_v_elementBoundaryBarycentersArray.data + __pyx_t_24 * __pyx_v_elementBoundaryBarycentersArray.strides[0]) ) + __pyx_t_9 * __pyx_v_elementBoundaryBarycentersArray.strides[1]) )) += (*((
double *) ( (( (__pyx_v_nodeArray.data + __pyx_t_10 * __pyx_v_nodeArray.strides[0]) ) + __pyx_t_13 * __pyx_v_nodeArray.strides[1]) )));
4505 __pyx_t_12 = __pyx_v_ebN;
4506 __pyx_t_8 = __pyx_v_nN;
4507 if (__pyx_t_12 < 0) __pyx_t_12 += __pyx_v_elementBoundaryNodesArray.shape[0];
4508 if (__pyx_t_8 < 0) __pyx_t_8 += __pyx_v_elementBoundaryNodesArray.shape[1];
4509 __pyx_t_13 = (*((
int *) ( (( (__pyx_v_elementBoundaryNodesArray.data + __pyx_t_12 * __pyx_v_elementBoundaryNodesArray.strides[0]) ) + __pyx_t_8 * __pyx_v_elementBoundaryNodesArray.strides[1]) )));
4511 if (__pyx_t_13 < 0) __pyx_t_13 += __pyx_v_nodeArray.shape[0];
4512 if (__pyx_t_10 < 0) __pyx_t_10 += __pyx_v_nodeArray.shape[1];
4513 __pyx_t_9 = __pyx_v_ebN;
4515 if (__pyx_t_9 < 0) __pyx_t_9 += __pyx_v_elementBoundaryBarycentersArray.shape[0];
4516 if (__pyx_t_24 < 0) __pyx_t_24 += __pyx_v_elementBoundaryBarycentersArray.shape[1];
4517 *((
double *) ( (( (__pyx_v_elementBoundaryBarycentersArray.data + __pyx_t_9 * __pyx_v_elementBoundaryBarycentersArray.strides[0]) ) + __pyx_t_24 * __pyx_v_elementBoundaryBarycentersArray.strides[1]) )) += (*((
double *) ( (( (__pyx_v_nodeArray.data + __pyx_t_13 * __pyx_v_nodeArray.strides[0]) ) + __pyx_t_10 * __pyx_v_nodeArray.strides[1]) )));
4527 __pyx_t_8 = __pyx_v_ebN;
4529 if (__pyx_t_8 < 0) __pyx_t_8 += __pyx_v_elementBoundaryBarycentersArray.shape[0];
4530 if (__pyx_t_12 < 0) __pyx_t_12 += __pyx_v_elementBoundaryBarycentersArray.shape[1];
4531 *((
double *) ( (( (__pyx_v_elementBoundaryBarycentersArray.data + __pyx_t_8 * __pyx_v_elementBoundaryBarycentersArray.strides[0]) ) + __pyx_t_12 * __pyx_v_elementBoundaryBarycentersArray.strides[1]) )) /= __pyx_v_nNodes_elementBoundary;
4540 __pyx_t_12 = __pyx_v_ebN;
4542 if (__pyx_t_12 < 0) __pyx_t_12 += __pyx_v_elementBoundaryBarycentersArray.shape[0];
4543 if (__pyx_t_8 < 0) __pyx_t_8 += __pyx_v_elementBoundaryBarycentersArray.shape[1];
4544 *((
double *) ( (( (__pyx_v_elementBoundaryBarycentersArray.data + __pyx_t_12 * __pyx_v_elementBoundaryBarycentersArray.strides[0]) ) + __pyx_t_8 * __pyx_v_elementBoundaryBarycentersArray.strides[1]) )) /= __pyx_v_nNodes_elementBoundary;
4553 __pyx_t_8 = __pyx_v_ebN;
4555 if (__pyx_t_8 < 0) __pyx_t_8 += __pyx_v_elementBoundaryBarycentersArray.shape[0];
4556 if (__pyx_t_12 < 0) __pyx_t_12 += __pyx_v_elementBoundaryBarycentersArray.shape[1];
4557 *((
double *) ( (( (__pyx_v_elementBoundaryBarycentersArray.data + __pyx_t_8 * __pyx_v_elementBoundaryBarycentersArray.strides[0]) ) + __pyx_t_12 * __pyx_v_elementBoundaryBarycentersArray.strides[1]) )) /= __pyx_v_nNodes_elementBoundary;
4567 __pyx_t_2 = __pyx_v_nElements_global;
4568 __pyx_t_3 = __pyx_t_2;
4569 for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
4570 __pyx_v_eN = __pyx_t_4;
4579 __pyx_t_12 = __pyx_v_eN;
4581 if (__pyx_t_12 < 0) __pyx_t_12 += __pyx_v_elementBarycentersArray.shape[0];
4582 if (__pyx_t_8 < 0) __pyx_t_8 += __pyx_v_elementBarycentersArray.shape[1];
4583 *((
double *) ( (( (__pyx_v_elementBarycentersArray.data + __pyx_t_12 * __pyx_v_elementBarycentersArray.strides[0]) ) + __pyx_t_8 * __pyx_v_elementBarycentersArray.strides[1]) )) = 0.;
4592 __pyx_t_8 = __pyx_v_eN;
4594 if (__pyx_t_8 < 0) __pyx_t_8 += __pyx_v_elementBarycentersArray.shape[0];
4595 if (__pyx_t_12 < 0) __pyx_t_12 += __pyx_v_elementBarycentersArray.shape[1];
4596 *((
double *) ( (( (__pyx_v_elementBarycentersArray.data + __pyx_t_8 * __pyx_v_elementBarycentersArray.strides[0]) ) + __pyx_t_12 * __pyx_v_elementBarycentersArray.strides[1]) )) = 0.;
4605 __pyx_t_12 = __pyx_v_eN;
4607 if (__pyx_t_12 < 0) __pyx_t_12 += __pyx_v_elementBarycentersArray.shape[0];
4608 if (__pyx_t_8 < 0) __pyx_t_8 += __pyx_v_elementBarycentersArray.shape[1];
4609 *((
double *) ( (( (__pyx_v_elementBarycentersArray.data + __pyx_t_12 * __pyx_v_elementBarycentersArray.strides[0]) ) + __pyx_t_8 * __pyx_v_elementBarycentersArray.strides[1]) )) = 0.;
4618 __pyx_t_5 = __pyx_v_nNodes_element;
4619 __pyx_t_6 = __pyx_t_5;
4620 for (__pyx_t_7 = 0; __pyx_t_7 < __pyx_t_6; __pyx_t_7+=1) {
4621 __pyx_v_ebN = __pyx_t_7;
4630 __pyx_t_8 = __pyx_v_eN;
4631 __pyx_t_12 = __pyx_v_ebN;
4632 if (__pyx_t_8 < 0) __pyx_t_8 += __pyx_v_elementNodesArray.shape[0];
4633 if (__pyx_t_12 < 0) __pyx_t_12 += __pyx_v_elementNodesArray.shape[1];
4634 __pyx_t_10 = (*((
int *) ( (( (__pyx_v_elementNodesArray.data + __pyx_t_8 * __pyx_v_elementNodesArray.strides[0]) ) + __pyx_t_12 * __pyx_v_elementNodesArray.strides[1]) )));
4636 if (__pyx_t_10 < 0) __pyx_t_10 += __pyx_v_nodeArray.shape[0];
4637 if (__pyx_t_13 < 0) __pyx_t_13 += __pyx_v_nodeArray.shape[1];
4638 __pyx_t_24 = __pyx_v_eN;
4640 if (__pyx_t_24 < 0) __pyx_t_24 += __pyx_v_elementBarycentersArray.shape[0];
4641 if (__pyx_t_9 < 0) __pyx_t_9 += __pyx_v_elementBarycentersArray.shape[1];
4642 *((
double *) ( (( (__pyx_v_elementBarycentersArray.data + __pyx_t_24 * __pyx_v_elementBarycentersArray.strides[0]) ) + __pyx_t_9 * __pyx_v_elementBarycentersArray.strides[1]) )) += (*((
double *) ( (( (__pyx_v_nodeArray.data + __pyx_t_10 * __pyx_v_nodeArray.strides[0]) ) + __pyx_t_13 * __pyx_v_nodeArray.strides[1]) )));
4651 __pyx_t_12 = __pyx_v_eN;
4652 __pyx_t_8 = __pyx_v_ebN;
4653 if (__pyx_t_12 < 0) __pyx_t_12 += __pyx_v_elementNodesArray.shape[0];
4654 if (__pyx_t_8 < 0) __pyx_t_8 += __pyx_v_elementNodesArray.shape[1];
4655 __pyx_t_13 = (*((
int *) ( (( (__pyx_v_elementNodesArray.data + __pyx_t_12 * __pyx_v_elementNodesArray.strides[0]) ) + __pyx_t_8 * __pyx_v_elementNodesArray.strides[1]) )));
4657 if (__pyx_t_13 < 0) __pyx_t_13 += __pyx_v_nodeArray.shape[0];
4658 if (__pyx_t_10 < 0) __pyx_t_10 += __pyx_v_nodeArray.shape[1];
4659 __pyx_t_9 = __pyx_v_eN;
4661 if (__pyx_t_9 < 0) __pyx_t_9 += __pyx_v_elementBarycentersArray.shape[0];
4662 if (__pyx_t_24 < 0) __pyx_t_24 += __pyx_v_elementBarycentersArray.shape[1];
4663 *((
double *) ( (( (__pyx_v_elementBarycentersArray.data + __pyx_t_9 * __pyx_v_elementBarycentersArray.strides[0]) ) + __pyx_t_24 * __pyx_v_elementBarycentersArray.strides[1]) )) += (*((
double *) ( (( (__pyx_v_nodeArray.data + __pyx_t_13 * __pyx_v_nodeArray.strides[0]) ) + __pyx_t_10 * __pyx_v_nodeArray.strides[1]) )));
4672 __pyx_t_8 = __pyx_v_eN;
4673 __pyx_t_12 = __pyx_v_ebN;
4674 if (__pyx_t_8 < 0) __pyx_t_8 += __pyx_v_elementNodesArray.shape[0];
4675 if (__pyx_t_12 < 0) __pyx_t_12 += __pyx_v_elementNodesArray.shape[1];
4676 __pyx_t_10 = (*((
int *) ( (( (__pyx_v_elementNodesArray.data + __pyx_t_8 * __pyx_v_elementNodesArray.strides[0]) ) + __pyx_t_12 * __pyx_v_elementNodesArray.strides[1]) )));
4678 if (__pyx_t_10 < 0) __pyx_t_10 += __pyx_v_nodeArray.shape[0];
4679 if (__pyx_t_13 < 0) __pyx_t_13 += __pyx_v_nodeArray.shape[1];
4680 __pyx_t_24 = __pyx_v_eN;
4682 if (__pyx_t_24 < 0) __pyx_t_24 += __pyx_v_elementBarycentersArray.shape[0];
4683 if (__pyx_t_9 < 0) __pyx_t_9 += __pyx_v_elementBarycentersArray.shape[1];
4684 *((
double *) ( (( (__pyx_v_elementBarycentersArray.data + __pyx_t_24 * __pyx_v_elementBarycentersArray.strides[0]) ) + __pyx_t_9 * __pyx_v_elementBarycentersArray.strides[1]) )) += (*((
double *) ( (( (__pyx_v_nodeArray.data + __pyx_t_10 * __pyx_v_nodeArray.strides[0]) ) + __pyx_t_13 * __pyx_v_nodeArray.strides[1]) )));
4694 __pyx_t_12 = __pyx_v_eN;
4696 if (__pyx_t_12 < 0) __pyx_t_12 += __pyx_v_elementBarycentersArray.shape[0];
4697 if (__pyx_t_8 < 0) __pyx_t_8 += __pyx_v_elementBarycentersArray.shape[1];
4698 *((
double *) ( (( (__pyx_v_elementBarycentersArray.data + __pyx_t_12 * __pyx_v_elementBarycentersArray.strides[0]) ) + __pyx_t_8 * __pyx_v_elementBarycentersArray.strides[1]) )) /= __pyx_v_nNodes_element;
4707 __pyx_t_8 = __pyx_v_eN;
4709 if (__pyx_t_8 < 0) __pyx_t_8 += __pyx_v_elementBarycentersArray.shape[0];
4710 if (__pyx_t_12 < 0) __pyx_t_12 += __pyx_v_elementBarycentersArray.shape[1];
4711 *((
double *) ( (( (__pyx_v_elementBarycentersArray.data + __pyx_t_8 * __pyx_v_elementBarycentersArray.strides[0]) ) + __pyx_t_12 * __pyx_v_elementBarycentersArray.strides[1]) )) /= __pyx_v_nNodes_element;
4720 __pyx_t_12 = __pyx_v_eN;
4722 if (__pyx_t_12 < 0) __pyx_t_12 += __pyx_v_elementBarycentersArray.shape[0];
4723 if (__pyx_t_8 < 0) __pyx_t_8 += __pyx_v_elementBarycentersArray.shape[1];
4724 *((
double *) ( (( (__pyx_v_elementBarycentersArray.data + __pyx_t_12 * __pyx_v_elementBarycentersArray.strides[0]) ) + __pyx_t_8 * __pyx_v_elementBarycentersArray.strides[1]) )) /= __pyx_v_nNodes_element;
4734 switch (__pyx_v_nd) {
4744 __pyx_f_7proteus_6mprans_13MeshSmoothing_pyxUpdateElementBoundaryNormalsTriangle(__pyx_v_elementBoundaryNormalsArray, __pyx_v_nodeArray, __pyx_v_elementBoundariesArray, __pyx_v_elementBoundaryNodesArray, __pyx_v_elementBoundaryBarycentersArray, __pyx_v_elementBarycentersArray, __pyx_v_nElements_global);
4763 __pyx_f_7proteus_6mprans_13MeshSmoothing_pyxUpdateElementBoundaryNormalsTetra(__pyx_v_elementBoundaryNormalsArray, __pyx_v_nodeArray, __pyx_v_elementBoundariesArray, __pyx_v_elementBoundaryNodesArray, __pyx_v_elementBoundaryBarycentersArray, __pyx_v_elementBarycentersArray, __pyx_v_nElements_global);
4785 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
4788 __Pyx_XDECREF(__pyx_t_14);
4789 __Pyx_XDECREF(__pyx_t_15);
4790 __Pyx_XDECREF(__pyx_t_16);
4791 __Pyx_XDECREF(__pyx_t_17);
4792 __Pyx_XDECREF(__pyx_t_18);
4793 __PYX_XDEC_MEMVIEW(&__pyx_t_20, 1);
4794 __PYX_XDEC_MEMVIEW(&__pyx_t_21, 1);
4795 __PYX_XDEC_MEMVIEW(&__pyx_t_22, 1);
4796 __PYX_XDEC_MEMVIEW(&__pyx_t_23, 1);
4797 __Pyx_AddTraceback(
"mprans.cMoveMeshMonitor.cCoefficients.cppPreStep", __pyx_clineno, __pyx_lineno, __pyx_filename);
4800 __Pyx_XDECREF(__pyx_v_comm);
4801 __Pyx_XDECREF(__pyx_v_pc);
4802 __Pyx_XDECREF(__pyx_v_mesh);
4803 __PYX_XDEC_MEMVIEW(&__pyx_v_elementBoundaryBarycentersArray, 1);
4804 __PYX_XDEC_MEMVIEW(&__pyx_v_elementBarycentersArray, 1);
4805 __PYX_XDEC_MEMVIEW(&__pyx_v_nodeArray, 1);
4806 __PYX_XDEC_MEMVIEW(&__pyx_v_elementBoundaryNodesArray, 1);
4807 __PYX_XDEC_MEMVIEW(&__pyx_v_elementNodesArray, 1);
4808 __PYX_XDEC_MEMVIEW(&__pyx_v_elementBoundariesArray, 1);
4809 __PYX_XDEC_MEMVIEW(&__pyx_v_elementBoundaryNormalsArray, 1);
4810 __Pyx_XGIVEREF(__pyx_r);
4811 __Pyx_RefNannyFinishContext();
4824 static PyObject *__pyx_pw_6mprans_16cMoveMeshMonitor_13cCoefficients_7postStep(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused);
4825 static PyObject *__pyx_pw_6mprans_16cMoveMeshMonitor_13cCoefficients_7postStep(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
4826 PyObject *__pyx_r = 0;
4827 __Pyx_RefNannyDeclarations
4828 __Pyx_RefNannySetupContext(
"postStep (wrapper)", 0);
4829 __pyx_r = __pyx_pf_6mprans_16cMoveMeshMonitor_13cCoefficients_6postStep(((
struct __pyx_obj_6mprans_16cMoveMeshMonitor_cCoefficients *)__pyx_v_self));
4832 __Pyx_RefNannyFinishContext();
4836 static PyObject *__pyx_pf_6mprans_16cMoveMeshMonitor_13cCoefficients_6postStep(
struct __pyx_obj_6mprans_16cMoveMeshMonitor_cCoefficients *__pyx_v_self) {
4837 CYTHON_UNUSED PyObject *__pyx_v_pc = NULL;
4838 PyObject *__pyx_r = NULL;
4839 __Pyx_RefNannyDeclarations
4840 PyObject *__pyx_t_1 = NULL;
4841 int __pyx_lineno = 0;
4842 const char *__pyx_filename = NULL;
4843 int __pyx_clineno = 0;
4844 __Pyx_RefNannySetupContext(
"postStep", 0);
4853 __pyx_t_1 = __pyx_v_self->pyCoefficients;
4854 __Pyx_INCREF(__pyx_t_1);
4855 __pyx_v_pc = __pyx_t_1;
4865 __pyx_t_1 = ((
struct __pyx_vtabstruct_6mprans_16cMoveMeshMonitor_cCoefficients *)__pyx_v_self->__pyx_vtab)->cppPostStep(__pyx_v_self);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 134, __pyx_L1_error)
4866 __Pyx_GOTREF(__pyx_t_1);
4867 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
4878 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
4881 __Pyx_XDECREF(__pyx_t_1);
4882 __Pyx_AddTraceback(
"mprans.cMoveMeshMonitor.cCoefficients.postStep", __pyx_clineno, __pyx_lineno, __pyx_filename);
4885 __Pyx_XDECREF(__pyx_v_pc);
4886 __Pyx_XGIVEREF(__pyx_r);
4887 __Pyx_RefNannyFinishContext();
4899 static PyObject *__pyx_f_6mprans_16cMoveMeshMonitor_13cCoefficients_cppPostStep(
struct __pyx_obj_6mprans_16cMoveMeshMonitor_cCoefficients *__pyx_v_self) {
4900 PyObject *__pyx_v_pc = 0;
4901 PyObject *__pyx_v_mesh = 0;
4903 __Pyx_memviewslice __pyx_v_elementBoundaryBarycentersArray = { 0, 0, { 0 }, { 0 }, { 0 } };
4904 __Pyx_memviewslice __pyx_v_elementBarycentersArray = { 0, 0, { 0 }, { 0 }, { 0 } };
4905 __Pyx_memviewslice __pyx_v_nodeArray = { 0, 0, { 0 }, { 0 }, { 0 } };
4906 __Pyx_memviewslice __pyx_v_elementBoundaryNodesArray = { 0, 0, { 0 }, { 0 }, { 0 } };
4907 __Pyx_memviewslice __pyx_v_elementNodesArray = { 0, 0, { 0 }, { 0 }, { 0 } };
4908 __Pyx_memviewslice __pyx_v_elementBoundariesArray = { 0, 0, { 0 }, { 0 }, { 0 } };
4909 int __pyx_v_nElementBoundaries_global;
4910 int __pyx_v_nNodes_elementBoundary;
4911 int __pyx_v_nElements_global;
4912 int __pyx_v_nNodes_element;
4913 __Pyx_memviewslice __pyx_v_elementBoundaryNormalsArray = { 0, 0, { 0 }, { 0 }, { 0 } };
4917 PyObject *__pyx_r = NULL;
4918 __Pyx_RefNannyDeclarations
4919 PyObject *__pyx_t_1 = NULL;
4921 __Pyx_memviewslice __pyx_t_3 = { 0, 0, { 0 }, { 0 }, { 0 } };
4922 __Pyx_memviewslice __pyx_t_4 = { 0, 0, { 0 }, { 0 }, { 0 } };
4923 PyObject *__pyx_t_5 = NULL;
4924 __Pyx_memviewslice __pyx_t_6 = { 0, 0, { 0 }, { 0 }, { 0 } };
4927 Py_ssize_t __pyx_t_9;
4928 Py_ssize_t __pyx_t_10;
4932 Py_ssize_t __pyx_t_14;
4933 Py_ssize_t __pyx_t_15;
4934 Py_ssize_t __pyx_t_16;
4935 Py_ssize_t __pyx_t_17;
4936 int __pyx_lineno = 0;
4937 const char *__pyx_filename = NULL;
4938 int __pyx_clineno = 0;
4939 __Pyx_RefNannySetupContext(
"cppPostStep", 0);
4948 __pyx_t_1 = __pyx_v_self->pyCoefficients;
4949 __Pyx_INCREF(__pyx_t_1);
4950 __pyx_v_pc = __pyx_t_1;
4960 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_pc, __pyx_n_s_mesh);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 138, __pyx_L1_error)
4961 __Pyx_GOTREF(__pyx_t_1);
4962 __pyx_v_mesh = __pyx_t_1;
4972 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_pc, __pyx_n_s_nd);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 139, __pyx_L1_error)
4973 __Pyx_GOTREF(__pyx_t_1);
4974 __pyx_t_2 = __Pyx_PyInt_As_int(__pyx_t_1);
if (unlikely((__pyx_t_2 == (
int)-1) && PyErr_Occurred())) __PYX_ERR(0, 139, __pyx_L1_error)
4975 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
4976 __pyx_v_nd = __pyx_t_2;
4985 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_mesh, __pyx_n_s_elementBoundaryBarycentersArray);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 140, __pyx_L1_error)
4986 __Pyx_GOTREF(__pyx_t_1);
4987 __pyx_t_3 = __Pyx_PyObject_to_MemoryviewSlice_dsds_double(__pyx_t_1, PyBUF_WRITABLE);
if (unlikely(!__pyx_t_3.memview)) __PYX_ERR(0, 140, __pyx_L1_error)
4988 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
4989 __pyx_v_elementBoundaryBarycentersArray = __pyx_t_3;
4990 __pyx_t_3.memview = NULL;
4991 __pyx_t_3.data = NULL;
5000 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_mesh, __pyx_n_s_elementBarycentersArray);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 141, __pyx_L1_error)
5001 __Pyx_GOTREF(__pyx_t_1);
5002 __pyx_t_3 = __Pyx_PyObject_to_MemoryviewSlice_dsds_double(__pyx_t_1, PyBUF_WRITABLE);
if (unlikely(!__pyx_t_3.memview)) __PYX_ERR(0, 141, __pyx_L1_error)
5003 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
5004 __pyx_v_elementBarycentersArray = __pyx_t_3;
5005 __pyx_t_3.memview = NULL;
5006 __pyx_t_3.data = NULL;
5015 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_mesh, __pyx_n_s_nodeArray);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 142, __pyx_L1_error)
5016 __Pyx_GOTREF(__pyx_t_1);
5017 __pyx_t_3 = __Pyx_PyObject_to_MemoryviewSlice_dsds_double(__pyx_t_1, PyBUF_WRITABLE);
if (unlikely(!__pyx_t_3.memview)) __PYX_ERR(0, 142, __pyx_L1_error)
5018 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
5019 __pyx_v_nodeArray = __pyx_t_3;
5020 __pyx_t_3.memview = NULL;
5021 __pyx_t_3.data = NULL;
5030 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_mesh, __pyx_n_s_elementBoundaryNodesArray);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 143, __pyx_L1_error)
5031 __Pyx_GOTREF(__pyx_t_1);
5032 __pyx_t_4 = __Pyx_PyObject_to_MemoryviewSlice_dsds_int(__pyx_t_1, PyBUF_WRITABLE);
if (unlikely(!__pyx_t_4.memview)) __PYX_ERR(0, 143, __pyx_L1_error)
5033 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
5034 __pyx_v_elementBoundaryNodesArray = __pyx_t_4;
5035 __pyx_t_4.memview = NULL;
5036 __pyx_t_4.data = NULL;
5045 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_mesh, __pyx_n_s_elementNodesArray);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 144, __pyx_L1_error)
5046 __Pyx_GOTREF(__pyx_t_1);
5047 __pyx_t_4 = __Pyx_PyObject_to_MemoryviewSlice_dsds_int(__pyx_t_1, PyBUF_WRITABLE);
if (unlikely(!__pyx_t_4.memview)) __PYX_ERR(0, 144, __pyx_L1_error)
5048 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
5049 __pyx_v_elementNodesArray = __pyx_t_4;
5050 __pyx_t_4.memview = NULL;
5051 __pyx_t_4.data = NULL;
5060 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_mesh, __pyx_n_s_elementBoundariesArray);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 145, __pyx_L1_error)
5061 __Pyx_GOTREF(__pyx_t_1);
5062 __pyx_t_4 = __Pyx_PyObject_to_MemoryviewSlice_dsds_int(__pyx_t_1, PyBUF_WRITABLE);
if (unlikely(!__pyx_t_4.memview)) __PYX_ERR(0, 145, __pyx_L1_error)
5063 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
5064 __pyx_v_elementBoundariesArray = __pyx_t_4;
5065 __pyx_t_4.memview = NULL;
5066 __pyx_t_4.data = NULL;
5075 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_mesh, __pyx_n_s_nElementBoundaries_global);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 146, __pyx_L1_error)
5076 __Pyx_GOTREF(__pyx_t_1);
5077 __pyx_t_2 = __Pyx_PyInt_As_int(__pyx_t_1);
if (unlikely((__pyx_t_2 == (
int)-1) && PyErr_Occurred())) __PYX_ERR(0, 146, __pyx_L1_error)
5078 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
5079 __pyx_v_nElementBoundaries_global = __pyx_t_2;
5088 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_mesh, __pyx_n_s_nNodes_elementBoundary);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 147, __pyx_L1_error)
5089 __Pyx_GOTREF(__pyx_t_1);
5090 __pyx_t_2 = __Pyx_PyInt_As_int(__pyx_t_1);
if (unlikely((__pyx_t_2 == (
int)-1) && PyErr_Occurred())) __PYX_ERR(0, 147, __pyx_L1_error)
5091 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
5092 __pyx_v_nNodes_elementBoundary = __pyx_t_2;
5101 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_mesh, __pyx_n_s_nElements_global);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 148, __pyx_L1_error)
5102 __Pyx_GOTREF(__pyx_t_1);
5103 __pyx_t_2 = __Pyx_PyInt_As_int(__pyx_t_1);
if (unlikely((__pyx_t_2 == (
int)-1) && PyErr_Occurred())) __PYX_ERR(0, 148, __pyx_L1_error)
5104 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
5105 __pyx_v_nElements_global = __pyx_t_2;
5114 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_mesh, __pyx_n_s_nNodes_element);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 149, __pyx_L1_error)
5115 __Pyx_GOTREF(__pyx_t_1);
5116 __pyx_t_2 = __Pyx_PyInt_As_int(__pyx_t_1);
if (unlikely((__pyx_t_2 == (
int)-1) && PyErr_Occurred())) __PYX_ERR(0, 149, __pyx_L1_error)
5117 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
5118 __pyx_v_nNodes_element = __pyx_t_2;
5127 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_pc, __pyx_n_s_mesh);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 150, __pyx_L1_error)
5128 __Pyx_GOTREF(__pyx_t_1);
5129 __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_elementBoundaryNormalsArray);
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 150, __pyx_L1_error)
5130 __Pyx_GOTREF(__pyx_t_5);
5131 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
5132 __pyx_t_6 = __Pyx_PyObject_to_MemoryviewSlice_dsdsds_double(__pyx_t_5, PyBUF_WRITABLE);
if (unlikely(!__pyx_t_6.memview)) __PYX_ERR(0, 150, __pyx_L1_error)
5133 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
5134 __pyx_v_elementBoundaryNormalsArray = __pyx_t_6;
5135 __pyx_t_6.memview = NULL;
5136 __pyx_t_6.data = NULL;
5145 __pyx_t_2 = __pyx_v_nElementBoundaries_global;
5146 __pyx_t_7 = __pyx_t_2;
5147 for (__pyx_t_8 = 0; __pyx_t_8 < __pyx_t_7; __pyx_t_8+=1) {
5148 __pyx_v_ebN = __pyx_t_8;
5157 __pyx_t_9 = __pyx_v_ebN;
5159 if (__pyx_t_9 < 0) __pyx_t_9 += __pyx_v_elementBoundaryBarycentersArray.shape[0];
5160 if (__pyx_t_10 < 0) __pyx_t_10 += __pyx_v_elementBoundaryBarycentersArray.shape[1];
5161 *((
double *) ( (( (__pyx_v_elementBoundaryBarycentersArray.data + __pyx_t_9 * __pyx_v_elementBoundaryBarycentersArray.strides[0]) ) + __pyx_t_10 * __pyx_v_elementBoundaryBarycentersArray.strides[1]) )) = 0.;
5170 __pyx_t_10 = __pyx_v_ebN;
5172 if (__pyx_t_10 < 0) __pyx_t_10 += __pyx_v_elementBoundaryBarycentersArray.shape[0];
5173 if (__pyx_t_9 < 0) __pyx_t_9 += __pyx_v_elementBoundaryBarycentersArray.shape[1];
5174 *((
double *) ( (( (__pyx_v_elementBoundaryBarycentersArray.data + __pyx_t_10 * __pyx_v_elementBoundaryBarycentersArray.strides[0]) ) + __pyx_t_9 * __pyx_v_elementBoundaryBarycentersArray.strides[1]) )) = 0.;
5183 __pyx_t_9 = __pyx_v_ebN;
5185 if (__pyx_t_9 < 0) __pyx_t_9 += __pyx_v_elementBoundaryBarycentersArray.shape[0];
5186 if (__pyx_t_10 < 0) __pyx_t_10 += __pyx_v_elementBoundaryBarycentersArray.shape[1];
5187 *((
double *) ( (( (__pyx_v_elementBoundaryBarycentersArray.data + __pyx_t_9 * __pyx_v_elementBoundaryBarycentersArray.strides[0]) ) + __pyx_t_10 * __pyx_v_elementBoundaryBarycentersArray.strides[1]) )) = 0.;
5196 __pyx_t_11 = __pyx_v_nNodes_elementBoundary;
5197 __pyx_t_12 = __pyx_t_11;
5198 for (__pyx_t_13 = 0; __pyx_t_13 < __pyx_t_12; __pyx_t_13+=1) {
5199 __pyx_v_nN = __pyx_t_13;
5208 __pyx_t_10 = __pyx_v_ebN;
5209 __pyx_t_9 = __pyx_v_nN;
5210 if (__pyx_t_10 < 0) __pyx_t_10 += __pyx_v_elementBoundaryNodesArray.shape[0];
5211 if (__pyx_t_9 < 0) __pyx_t_9 += __pyx_v_elementBoundaryNodesArray.shape[1];
5212 __pyx_t_14 = (*((
int *) ( (( (__pyx_v_elementBoundaryNodesArray.data + __pyx_t_10 * __pyx_v_elementBoundaryNodesArray.strides[0]) ) + __pyx_t_9 * __pyx_v_elementBoundaryNodesArray.strides[1]) )));
5214 if (__pyx_t_14 < 0) __pyx_t_14 += __pyx_v_nodeArray.shape[0];
5215 if (__pyx_t_15 < 0) __pyx_t_15 += __pyx_v_nodeArray.shape[1];
5216 __pyx_t_16 = __pyx_v_ebN;
5218 if (__pyx_t_16 < 0) __pyx_t_16 += __pyx_v_elementBoundaryBarycentersArray.shape[0];
5219 if (__pyx_t_17 < 0) __pyx_t_17 += __pyx_v_elementBoundaryBarycentersArray.shape[1];
5220 *((
double *) ( (( (__pyx_v_elementBoundaryBarycentersArray.data + __pyx_t_16 * __pyx_v_elementBoundaryBarycentersArray.strides[0]) ) + __pyx_t_17 * __pyx_v_elementBoundaryBarycentersArray.strides[1]) )) += (*((
double *) ( (( (__pyx_v_nodeArray.data + __pyx_t_14 * __pyx_v_nodeArray.strides[0]) ) + __pyx_t_15 * __pyx_v_nodeArray.strides[1]) )));
5229 __pyx_t_9 = __pyx_v_ebN;
5230 __pyx_t_10 = __pyx_v_nN;
5231 if (__pyx_t_9 < 0) __pyx_t_9 += __pyx_v_elementBoundaryNodesArray.shape[0];
5232 if (__pyx_t_10 < 0) __pyx_t_10 += __pyx_v_elementBoundaryNodesArray.shape[1];
5233 __pyx_t_15 = (*((
int *) ( (( (__pyx_v_elementBoundaryNodesArray.data + __pyx_t_9 * __pyx_v_elementBoundaryNodesArray.strides[0]) ) + __pyx_t_10 * __pyx_v_elementBoundaryNodesArray.strides[1]) )));
5235 if (__pyx_t_15 < 0) __pyx_t_15 += __pyx_v_nodeArray.shape[0];
5236 if (__pyx_t_14 < 0) __pyx_t_14 += __pyx_v_nodeArray.shape[1];
5237 __pyx_t_17 = __pyx_v_ebN;
5239 if (__pyx_t_17 < 0) __pyx_t_17 += __pyx_v_elementBoundaryBarycentersArray.shape[0];
5240 if (__pyx_t_16 < 0) __pyx_t_16 += __pyx_v_elementBoundaryBarycentersArray.shape[1];
5241 *((
double *) ( (( (__pyx_v_elementBoundaryBarycentersArray.data + __pyx_t_17 * __pyx_v_elementBoundaryBarycentersArray.strides[0]) ) + __pyx_t_16 * __pyx_v_elementBoundaryBarycentersArray.strides[1]) )) += (*((
double *) ( (( (__pyx_v_nodeArray.data + __pyx_t_15 * __pyx_v_nodeArray.strides[0]) ) + __pyx_t_14 * __pyx_v_nodeArray.strides[1]) )));
5250 __pyx_t_10 = __pyx_v_ebN;
5251 __pyx_t_9 = __pyx_v_nN;
5252 if (__pyx_t_10 < 0) __pyx_t_10 += __pyx_v_elementBoundaryNodesArray.shape[0];
5253 if (__pyx_t_9 < 0) __pyx_t_9 += __pyx_v_elementBoundaryNodesArray.shape[1];
5254 __pyx_t_14 = (*((
int *) ( (( (__pyx_v_elementBoundaryNodesArray.data + __pyx_t_10 * __pyx_v_elementBoundaryNodesArray.strides[0]) ) + __pyx_t_9 * __pyx_v_elementBoundaryNodesArray.strides[1]) )));
5256 if (__pyx_t_14 < 0) __pyx_t_14 += __pyx_v_nodeArray.shape[0];
5257 if (__pyx_t_15 < 0) __pyx_t_15 += __pyx_v_nodeArray.shape[1];
5258 __pyx_t_16 = __pyx_v_ebN;
5260 if (__pyx_t_16 < 0) __pyx_t_16 += __pyx_v_elementBoundaryBarycentersArray.shape[0];
5261 if (__pyx_t_17 < 0) __pyx_t_17 += __pyx_v_elementBoundaryBarycentersArray.shape[1];
5262 *((
double *) ( (( (__pyx_v_elementBoundaryBarycentersArray.data + __pyx_t_16 * __pyx_v_elementBoundaryBarycentersArray.strides[0]) ) + __pyx_t_17 * __pyx_v_elementBoundaryBarycentersArray.strides[1]) )) += (*((
double *) ( (( (__pyx_v_nodeArray.data + __pyx_t_14 * __pyx_v_nodeArray.strides[0]) ) + __pyx_t_15 * __pyx_v_nodeArray.strides[1]) )));
5272 __pyx_t_9 = __pyx_v_ebN;
5274 if (__pyx_t_9 < 0) __pyx_t_9 += __pyx_v_elementBoundaryBarycentersArray.shape[0];
5275 if (__pyx_t_10 < 0) __pyx_t_10 += __pyx_v_elementBoundaryBarycentersArray.shape[1];
5276 *((
double *) ( (( (__pyx_v_elementBoundaryBarycentersArray.data + __pyx_t_9 * __pyx_v_elementBoundaryBarycentersArray.strides[0]) ) + __pyx_t_10 * __pyx_v_elementBoundaryBarycentersArray.strides[1]) )) /= __pyx_v_nNodes_elementBoundary;
5285 __pyx_t_10 = __pyx_v_ebN;
5287 if (__pyx_t_10 < 0) __pyx_t_10 += __pyx_v_elementBoundaryBarycentersArray.shape[0];
5288 if (__pyx_t_9 < 0) __pyx_t_9 += __pyx_v_elementBoundaryBarycentersArray.shape[1];
5289 *((
double *) ( (( (__pyx_v_elementBoundaryBarycentersArray.data + __pyx_t_10 * __pyx_v_elementBoundaryBarycentersArray.strides[0]) ) + __pyx_t_9 * __pyx_v_elementBoundaryBarycentersArray.strides[1]) )) /= __pyx_v_nNodes_elementBoundary;
5298 __pyx_t_9 = __pyx_v_ebN;
5300 if (__pyx_t_9 < 0) __pyx_t_9 += __pyx_v_elementBoundaryBarycentersArray.shape[0];
5301 if (__pyx_t_10 < 0) __pyx_t_10 += __pyx_v_elementBoundaryBarycentersArray.shape[1];
5302 *((
double *) ( (( (__pyx_v_elementBoundaryBarycentersArray.data + __pyx_t_9 * __pyx_v_elementBoundaryBarycentersArray.strides[0]) ) + __pyx_t_10 * __pyx_v_elementBoundaryBarycentersArray.strides[1]) )) /= __pyx_v_nNodes_elementBoundary;
5312 __pyx_t_2 = __pyx_v_nElements_global;
5313 __pyx_t_7 = __pyx_t_2;
5314 for (__pyx_t_8 = 0; __pyx_t_8 < __pyx_t_7; __pyx_t_8+=1) {
5315 __pyx_v_eN = __pyx_t_8;
5324 __pyx_t_10 = __pyx_v_eN;
5326 if (__pyx_t_10 < 0) __pyx_t_10 += __pyx_v_elementBarycentersArray.shape[0];
5327 if (__pyx_t_9 < 0) __pyx_t_9 += __pyx_v_elementBarycentersArray.shape[1];
5328 *((
double *) ( (( (__pyx_v_elementBarycentersArray.data + __pyx_t_10 * __pyx_v_elementBarycentersArray.strides[0]) ) + __pyx_t_9 * __pyx_v_elementBarycentersArray.strides[1]) )) = 0.;
5337 __pyx_t_9 = __pyx_v_eN;
5339 if (__pyx_t_9 < 0) __pyx_t_9 += __pyx_v_elementBarycentersArray.shape[0];
5340 if (__pyx_t_10 < 0) __pyx_t_10 += __pyx_v_elementBarycentersArray.shape[1];
5341 *((
double *) ( (( (__pyx_v_elementBarycentersArray.data + __pyx_t_9 * __pyx_v_elementBarycentersArray.strides[0]) ) + __pyx_t_10 * __pyx_v_elementBarycentersArray.strides[1]) )) = 0.;
5350 __pyx_t_10 = __pyx_v_eN;
5352 if (__pyx_t_10 < 0) __pyx_t_10 += __pyx_v_elementBarycentersArray.shape[0];
5353 if (__pyx_t_9 < 0) __pyx_t_9 += __pyx_v_elementBarycentersArray.shape[1];
5354 *((
double *) ( (( (__pyx_v_elementBarycentersArray.data + __pyx_t_10 * __pyx_v_elementBarycentersArray.strides[0]) ) + __pyx_t_9 * __pyx_v_elementBarycentersArray.strides[1]) )) = 0.;
5363 __pyx_t_11 = __pyx_v_nNodes_element;
5364 __pyx_t_12 = __pyx_t_11;
5365 for (__pyx_t_13 = 0; __pyx_t_13 < __pyx_t_12; __pyx_t_13+=1) {
5366 __pyx_v_ebN = __pyx_t_13;
5375 __pyx_t_9 = __pyx_v_eN;
5376 __pyx_t_10 = __pyx_v_ebN;
5377 if (__pyx_t_9 < 0) __pyx_t_9 += __pyx_v_elementNodesArray.shape[0];
5378 if (__pyx_t_10 < 0) __pyx_t_10 += __pyx_v_elementNodesArray.shape[1];
5379 __pyx_t_15 = (*((
int *) ( (( (__pyx_v_elementNodesArray.data + __pyx_t_9 * __pyx_v_elementNodesArray.strides[0]) ) + __pyx_t_10 * __pyx_v_elementNodesArray.strides[1]) )));
5381 if (__pyx_t_15 < 0) __pyx_t_15 += __pyx_v_nodeArray.shape[0];
5382 if (__pyx_t_14 < 0) __pyx_t_14 += __pyx_v_nodeArray.shape[1];
5383 __pyx_t_17 = __pyx_v_eN;
5385 if (__pyx_t_17 < 0) __pyx_t_17 += __pyx_v_elementBarycentersArray.shape[0];
5386 if (__pyx_t_16 < 0) __pyx_t_16 += __pyx_v_elementBarycentersArray.shape[1];
5387 *((
double *) ( (( (__pyx_v_elementBarycentersArray.data + __pyx_t_17 * __pyx_v_elementBarycentersArray.strides[0]) ) + __pyx_t_16 * __pyx_v_elementBarycentersArray.strides[1]) )) += (*((
double *) ( (( (__pyx_v_nodeArray.data + __pyx_t_15 * __pyx_v_nodeArray.strides[0]) ) + __pyx_t_14 * __pyx_v_nodeArray.strides[1]) )));
5396 __pyx_t_10 = __pyx_v_eN;
5397 __pyx_t_9 = __pyx_v_ebN;
5398 if (__pyx_t_10 < 0) __pyx_t_10 += __pyx_v_elementNodesArray.shape[0];
5399 if (__pyx_t_9 < 0) __pyx_t_9 += __pyx_v_elementNodesArray.shape[1];
5400 __pyx_t_14 = (*((
int *) ( (( (__pyx_v_elementNodesArray.data + __pyx_t_10 * __pyx_v_elementNodesArray.strides[0]) ) + __pyx_t_9 * __pyx_v_elementNodesArray.strides[1]) )));
5402 if (__pyx_t_14 < 0) __pyx_t_14 += __pyx_v_nodeArray.shape[0];
5403 if (__pyx_t_15 < 0) __pyx_t_15 += __pyx_v_nodeArray.shape[1];
5404 __pyx_t_16 = __pyx_v_eN;
5406 if (__pyx_t_16 < 0) __pyx_t_16 += __pyx_v_elementBarycentersArray.shape[0];
5407 if (__pyx_t_17 < 0) __pyx_t_17 += __pyx_v_elementBarycentersArray.shape[1];
5408 *((
double *) ( (( (__pyx_v_elementBarycentersArray.data + __pyx_t_16 * __pyx_v_elementBarycentersArray.strides[0]) ) + __pyx_t_17 * __pyx_v_elementBarycentersArray.strides[1]) )) += (*((
double *) ( (( (__pyx_v_nodeArray.data + __pyx_t_14 * __pyx_v_nodeArray.strides[0]) ) + __pyx_t_15 * __pyx_v_nodeArray.strides[1]) )));
5417 __pyx_t_9 = __pyx_v_eN;
5418 __pyx_t_10 = __pyx_v_ebN;
5419 if (__pyx_t_9 < 0) __pyx_t_9 += __pyx_v_elementNodesArray.shape[0];
5420 if (__pyx_t_10 < 0) __pyx_t_10 += __pyx_v_elementNodesArray.shape[1];
5421 __pyx_t_15 = (*((
int *) ( (( (__pyx_v_elementNodesArray.data + __pyx_t_9 * __pyx_v_elementNodesArray.strides[0]) ) + __pyx_t_10 * __pyx_v_elementNodesArray.strides[1]) )));
5423 if (__pyx_t_15 < 0) __pyx_t_15 += __pyx_v_nodeArray.shape[0];
5424 if (__pyx_t_14 < 0) __pyx_t_14 += __pyx_v_nodeArray.shape[1];
5425 __pyx_t_17 = __pyx_v_eN;
5427 if (__pyx_t_17 < 0) __pyx_t_17 += __pyx_v_elementBarycentersArray.shape[0];
5428 if (__pyx_t_16 < 0) __pyx_t_16 += __pyx_v_elementBarycentersArray.shape[1];
5429 *((
double *) ( (( (__pyx_v_elementBarycentersArray.data + __pyx_t_17 * __pyx_v_elementBarycentersArray.strides[0]) ) + __pyx_t_16 * __pyx_v_elementBarycentersArray.strides[1]) )) += (*((
double *) ( (( (__pyx_v_nodeArray.data + __pyx_t_15 * __pyx_v_nodeArray.strides[0]) ) + __pyx_t_14 * __pyx_v_nodeArray.strides[1]) )));
5439 __pyx_t_10 = __pyx_v_eN;
5441 if (__pyx_t_10 < 0) __pyx_t_10 += __pyx_v_elementBarycentersArray.shape[0];
5442 if (__pyx_t_9 < 0) __pyx_t_9 += __pyx_v_elementBarycentersArray.shape[1];
5443 *((
double *) ( (( (__pyx_v_elementBarycentersArray.data + __pyx_t_10 * __pyx_v_elementBarycentersArray.strides[0]) ) + __pyx_t_9 * __pyx_v_elementBarycentersArray.strides[1]) )) /= __pyx_v_nNodes_element;
5452 __pyx_t_9 = __pyx_v_eN;
5454 if (__pyx_t_9 < 0) __pyx_t_9 += __pyx_v_elementBarycentersArray.shape[0];
5455 if (__pyx_t_10 < 0) __pyx_t_10 += __pyx_v_elementBarycentersArray.shape[1];
5456 *((
double *) ( (( (__pyx_v_elementBarycentersArray.data + __pyx_t_9 * __pyx_v_elementBarycentersArray.strides[0]) ) + __pyx_t_10 * __pyx_v_elementBarycentersArray.strides[1]) )) /= __pyx_v_nNodes_element;
5465 __pyx_t_10 = __pyx_v_eN;
5467 if (__pyx_t_10 < 0) __pyx_t_10 += __pyx_v_elementBarycentersArray.shape[0];
5468 if (__pyx_t_9 < 0) __pyx_t_9 += __pyx_v_elementBarycentersArray.shape[1];
5469 *((
double *) ( (( (__pyx_v_elementBarycentersArray.data + __pyx_t_10 * __pyx_v_elementBarycentersArray.strides[0]) ) + __pyx_t_9 * __pyx_v_elementBarycentersArray.strides[1]) )) /= __pyx_v_nNodes_element;
5479 switch (__pyx_v_nd) {
5489 __pyx_f_7proteus_6mprans_13MeshSmoothing_pyxUpdateElementBoundaryNormalsTriangle(__pyx_v_elementBoundaryNormalsArray, __pyx_v_nodeArray, __pyx_v_elementBoundariesArray, __pyx_v_elementBoundaryNodesArray, __pyx_v_elementBoundaryBarycentersArray, __pyx_v_elementBarycentersArray, __pyx_v_nElements_global);
5508 __pyx_f_7proteus_6mprans_13MeshSmoothing_pyxUpdateElementBoundaryNormalsTetra(__pyx_v_elementBoundaryNormalsArray, __pyx_v_nodeArray, __pyx_v_elementBoundariesArray, __pyx_v_elementBoundaryNodesArray, __pyx_v_elementBoundaryBarycentersArray, __pyx_v_elementBarycentersArray, __pyx_v_nElements_global);
5530 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
5533 __Pyx_XDECREF(__pyx_t_1);
5534 __PYX_XDEC_MEMVIEW(&__pyx_t_3, 1);
5535 __PYX_XDEC_MEMVIEW(&__pyx_t_4, 1);
5536 __Pyx_XDECREF(__pyx_t_5);
5537 __PYX_XDEC_MEMVIEW(&__pyx_t_6, 1);
5538 __Pyx_AddTraceback(
"mprans.cMoveMeshMonitor.cCoefficients.cppPostStep", __pyx_clineno, __pyx_lineno, __pyx_filename);
5541 __Pyx_XDECREF(__pyx_v_pc);
5542 __Pyx_XDECREF(__pyx_v_mesh);
5543 __PYX_XDEC_MEMVIEW(&__pyx_v_elementBoundaryBarycentersArray, 1);
5544 __PYX_XDEC_MEMVIEW(&__pyx_v_elementBarycentersArray, 1);
5545 __PYX_XDEC_MEMVIEW(&__pyx_v_nodeArray, 1);
5546 __PYX_XDEC_MEMVIEW(&__pyx_v_elementBoundaryNodesArray, 1);
5547 __PYX_XDEC_MEMVIEW(&__pyx_v_elementNodesArray, 1);
5548 __PYX_XDEC_MEMVIEW(&__pyx_v_elementBoundariesArray, 1);
5549 __PYX_XDEC_MEMVIEW(&__pyx_v_elementBoundaryNormalsArray, 1);
5550 __Pyx_XGIVEREF(__pyx_r);
5551 __Pyx_RefNannyFinishContext();
5564 static PyObject *__pyx_pw_6mprans_16cMoveMeshMonitor_13cCoefficients_9pseudoTimeStepping(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
5565 static PyObject *__pyx_pw_6mprans_16cMoveMeshMonitor_13cCoefficients_9pseudoTimeStepping(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
5566 PyObject *__pyx_v_xx = 0;
5567 PyObject *__pyx_v_eps = 0;
5568 int __pyx_lineno = 0;
5569 const char *__pyx_filename = NULL;
5570 int __pyx_clineno = 0;
5571 PyObject *__pyx_r = 0;
5572 __Pyx_RefNannyDeclarations
5573 __Pyx_RefNannySetupContext(
"pseudoTimeStepping (wrapper)", 0);
5575 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_xx,&__pyx_n_s_eps,0};
5576 PyObject* values[2] = {0,0};
5577 values[1] = ((PyObject *)__pyx_float_1_);
5578 if (unlikely(__pyx_kwds)) {
5580 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
5582 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
5584 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
5587 default:
goto __pyx_L5_argtuple_error;
5589 kw_args = PyDict_Size(__pyx_kwds);
5592 if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_xx)) != 0)) kw_args--;
5593 else goto __pyx_L5_argtuple_error;
5597 PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_eps);
5598 if (value) { values[1] = value; kw_args--; }
5601 if (unlikely(kw_args > 0)) {
5602 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args,
"pseudoTimeStepping") < 0)) __PYX_ERR(0, 195, __pyx_L3_error)
5605 switch (PyTuple_GET_SIZE(__pyx_args)) {
5606 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
5608 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
5610 default:
goto __pyx_L5_argtuple_error;
5613 __pyx_v_xx = values[0];
5614 __pyx_v_eps = values[1];
5616 goto __pyx_L4_argument_unpacking_done;
5617 __pyx_L5_argtuple_error:;
5618 __Pyx_RaiseArgtupleInvalid(
"pseudoTimeStepping", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 195, __pyx_L3_error)
5620 __Pyx_AddTraceback(
"mprans.cMoveMeshMonitor.cCoefficients.pseudoTimeStepping", __pyx_clineno, __pyx_lineno, __pyx_filename);
5621 __Pyx_RefNannyFinishContext();
5623 __pyx_L4_argument_unpacking_done:;
5624 __pyx_r = __pyx_pf_6mprans_16cMoveMeshMonitor_13cCoefficients_8pseudoTimeStepping(((
struct __pyx_obj_6mprans_16cMoveMeshMonitor_cCoefficients *)__pyx_v_self), __pyx_v_xx, __pyx_v_eps);
5627 __Pyx_RefNannyFinishContext();
5631 static PyObject *__pyx_pf_6mprans_16cMoveMeshMonitor_13cCoefficients_8pseudoTimeStepping(
struct __pyx_obj_6mprans_16cMoveMeshMonitor_cCoefficients *__pyx_v_self, PyObject *__pyx_v_xx, PyObject *__pyx_v_eps) {
5632 CYTHON_UNUSED PyObject *__pyx_v_pc = NULL;
5633 PyObject *__pyx_r = NULL;
5634 __Pyx_RefNannyDeclarations
5635 PyObject *__pyx_t_1 = NULL;
5636 __Pyx_memviewslice __pyx_t_2 = { 0, 0, { 0 }, { 0 }, { 0 } };
5638 int __pyx_lineno = 0;
5639 const char *__pyx_filename = NULL;
5640 int __pyx_clineno = 0;
5641 __Pyx_RefNannySetupContext(
"pseudoTimeStepping", 0);
5650 __pyx_t_1 = __pyx_v_self->pyCoefficients;
5651 __Pyx_INCREF(__pyx_t_1);
5652 __pyx_v_pc = __pyx_t_1;
5662 __Pyx_XDECREF(__pyx_r);
5663 __pyx_t_2 = __Pyx_PyObject_to_MemoryviewSlice_dsds_double(__pyx_v_xx, PyBUF_WRITABLE);
if (unlikely(!__pyx_t_2.memview)) __PYX_ERR(0, 199, __pyx_L1_error)
5672 __pyx_t_3 = __pyx_PyFloat_AsDouble(__pyx_v_eps);
if (unlikely((__pyx_t_3 == (
double)-1) && PyErr_Occurred())) __PYX_ERR(0, 200, __pyx_L1_error)
5681 __pyx_t_1 = ((
struct __pyx_vtabstruct_6mprans_16cMoveMeshMonitor_cCoefficients *)__pyx_v_self->__pyx_vtab)->cppPseudoTimeSteppingParallel(__pyx_v_self, __pyx_t_2, __pyx_t_3);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 199, __pyx_L1_error)
5682 __Pyx_GOTREF(__pyx_t_1);
5683 __PYX_XDEC_MEMVIEW(&__pyx_t_2, 1);
5684 __pyx_t_2.memview = NULL;
5685 __pyx_t_2.data = NULL;
5686 __pyx_r = __pyx_t_1;
5700 __Pyx_XDECREF(__pyx_t_1);
5701 __PYX_XDEC_MEMVIEW(&__pyx_t_2, 1);
5702 __Pyx_AddTraceback(
"mprans.cMoveMeshMonitor.cCoefficients.pseudoTimeStepping", __pyx_clineno, __pyx_lineno, __pyx_filename);
5705 __Pyx_XDECREF(__pyx_v_pc);
5706 __Pyx_XGIVEREF(__pyx_r);
5707 __Pyx_RefNannyFinishContext();
5710 static PyObject *__pyx_gb_6mprans_16cMoveMeshMonitor_13cCoefficients_29cppPseudoTimeSteppingParallel_2generator(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value);
5720 static PyObject *__pyx_pf_6mprans_16cMoveMeshMonitor_13cCoefficients_29cppPseudoTimeSteppingParallel_genexpr(PyObject *__pyx_self) {
5721 struct __pyx_obj_6mprans_16cMoveMeshMonitor___pyx_scope_struct_1_genexpr *__pyx_cur_scope;
5722 PyObject *__pyx_r = NULL;
5723 __Pyx_RefNannyDeclarations
5724 int __pyx_lineno = 0;
5725 const char *__pyx_filename = NULL;
5726 int __pyx_clineno = 0;
5727 __Pyx_RefNannySetupContext(
"genexpr", 0);
5728 __pyx_cur_scope = (
struct __pyx_obj_6mprans_16cMoveMeshMonitor___pyx_scope_struct_1_genexpr *)__pyx_tp_new_6mprans_16cMoveMeshMonitor___pyx_scope_struct_1_genexpr(__pyx_ptype_6mprans_16cMoveMeshMonitor___pyx_scope_struct_1_genexpr, __pyx_empty_tuple, NULL);
5729 if (unlikely(!__pyx_cur_scope)) {
5730 __pyx_cur_scope = ((
struct __pyx_obj_6mprans_16cMoveMeshMonitor___pyx_scope_struct_1_genexpr *)Py_None);
5731 __Pyx_INCREF(Py_None);
5732 __PYX_ERR(0, 597, __pyx_L1_error)
5734 __Pyx_GOTREF(__pyx_cur_scope);
5736 __pyx_cur_scope->__pyx_outer_scope = (
struct __pyx_obj_6mprans_16cMoveMeshMonitor___pyx_scope_struct__cppPseudoTimeSteppingParallel *) __pyx_self;
5737 __Pyx_INCREF(((PyObject *)__pyx_cur_scope->__pyx_outer_scope));
5738 __Pyx_GIVEREF(__pyx_cur_scope->__pyx_outer_scope);
5740 __pyx_CoroutineObject *gen = __Pyx_Generator_New((__pyx_coroutine_body_t) __pyx_gb_6mprans_16cMoveMeshMonitor_13cCoefficients_29cppPseudoTimeSteppingParallel_2generator, NULL, (PyObject *) __pyx_cur_scope, __pyx_n_s_genexpr, __pyx_n_s_cCoefficients_cppPseudoTimeStepp, __pyx_n_s_mprans_cMoveMeshMonitor);
if (unlikely(!gen)) __PYX_ERR(0, 597, __pyx_L1_error)
5741 __Pyx_DECREF(__pyx_cur_scope);
5742 __Pyx_RefNannyFinishContext();
5743 return (PyObject *) gen;
5748 __Pyx_AddTraceback(
"mprans.cMoveMeshMonitor.cCoefficients.cppPseudoTimeSteppingParallel.genexpr", __pyx_clineno, __pyx_lineno, __pyx_filename);
5750 __Pyx_DECREF(((PyObject *)__pyx_cur_scope));
5751 __Pyx_XGIVEREF(__pyx_r);
5752 __Pyx_RefNannyFinishContext();
5756 static PyObject *__pyx_gb_6mprans_16cMoveMeshMonitor_13cCoefficients_29cppPseudoTimeSteppingParallel_2generator(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value)
5758 struct __pyx_obj_6mprans_16cMoveMeshMonitor___pyx_scope_struct_1_genexpr *__pyx_cur_scope = ((
struct __pyx_obj_6mprans_16cMoveMeshMonitor___pyx_scope_struct_1_genexpr *)__pyx_generator->closure);
5759 PyObject *__pyx_r = NULL;
5763 Py_ssize_t __pyx_t_4;
5764 PyObject *__pyx_t_5 = NULL;
5765 int __pyx_lineno = 0;
5766 const char *__pyx_filename = NULL;
5767 int __pyx_clineno = 0;
5768 __Pyx_RefNannyDeclarations
5769 __Pyx_RefNannySetupContext(
"genexpr", 0);
5770 switch (__pyx_generator->resume_label) {
5771 case 0:
goto __pyx_L3_first_run;
5772 case 1:
goto __pyx_L6_resume_from_yield;
5774 __Pyx_RefNannyFinishContext();
5777 __pyx_L3_first_run:;
5778 if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 597, __pyx_L1_error)
5779 __pyx_t_1 = __pyx_cur_scope->__pyx_outer_scope->__pyx_v_comm_size;
5780 __pyx_t_2 = __pyx_t_1;
5781 for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) {
5782 __pyx_cur_scope->__pyx_v_i = __pyx_t_3;
5783 __pyx_t_4 = __pyx_cur_scope->__pyx_v_i;
5784 if (__pyx_t_4 < 0) __pyx_t_4 += __pyx_cur_scope->__pyx_outer_scope->__pyx_v_counts_in.shape[0];
5785 __pyx_t_5 = PyInt_FromSsize_t(((*((
int *) ( (__pyx_cur_scope->__pyx_outer_scope->__pyx_v_counts_in.data + __pyx_t_4 * __pyx_cur_scope->__pyx_outer_scope->__pyx_v_counts_in.strides[0]) ))) * (__pyx_cur_scope->__pyx_outer_scope->__pyx_v_coords_2doArray.shape[1])));
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 597, __pyx_L1_error)
5786 __Pyx_GOTREF(__pyx_t_5);
5787 __pyx_r = __pyx_t_5;
5789 __pyx_cur_scope->__pyx_t_0 = __pyx_t_1;
5790 __pyx_cur_scope->__pyx_t_1 = __pyx_t_2;
5791 __pyx_cur_scope->__pyx_t_2 = __pyx_t_3;
5792 __Pyx_XGIVEREF(__pyx_r);
5793 __Pyx_RefNannyFinishContext();
5794 __Pyx_Coroutine_ResetAndClearException(__pyx_generator);
5796 __pyx_generator->resume_label = 1;
5798 __pyx_L6_resume_from_yield:;
5799 __pyx_t_1 = __pyx_cur_scope->__pyx_t_0;
5800 __pyx_t_2 = __pyx_cur_scope->__pyx_t_1;
5801 __pyx_t_3 = __pyx_cur_scope->__pyx_t_2;
5802 if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 597, __pyx_L1_error)
5804 CYTHON_MAYBE_UNUSED_VAR(__pyx_cur_scope);
5807 PyErr_SetNone(PyExc_StopIteration);
5810 __Pyx_XDECREF(__pyx_t_5);
5811 __Pyx_AddTraceback(
"genexpr", __pyx_clineno, __pyx_lineno, __pyx_filename);
5813 __Pyx_XDECREF(__pyx_r); __pyx_r = 0;
5814 #if !CYTHON_USE_EXC_INFO_STACK
5815 __Pyx_Coroutine_ResetAndClearException(__pyx_generator);
5817 __pyx_generator->resume_label = -1;
5818 __Pyx_Coroutine_clear((PyObject*)__pyx_generator);
5819 __Pyx_RefNannyFinishContext();
5822 static PyObject *__pyx_gb_6mprans_16cMoveMeshMonitor_13cCoefficients_29cppPseudoTimeSteppingParallel_5generator1(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value);
5832 static PyObject *__pyx_pf_6mprans_16cMoveMeshMonitor_13cCoefficients_29cppPseudoTimeSteppingParallel_3genexpr(PyObject *__pyx_self) {
5833 struct __pyx_obj_6mprans_16cMoveMeshMonitor___pyx_scope_struct_2_genexpr *__pyx_cur_scope;
5834 PyObject *__pyx_r = NULL;
5835 __Pyx_RefNannyDeclarations
5836 int __pyx_lineno = 0;
5837 const char *__pyx_filename = NULL;
5838 int __pyx_clineno = 0;
5839 __Pyx_RefNannySetupContext(
"genexpr", 0);
5840 __pyx_cur_scope = (
struct __pyx_obj_6mprans_16cMoveMeshMonitor___pyx_scope_struct_2_genexpr *)__pyx_tp_new_6mprans_16cMoveMeshMonitor___pyx_scope_struct_2_genexpr(__pyx_ptype_6mprans_16cMoveMeshMonitor___pyx_scope_struct_2_genexpr, __pyx_empty_tuple, NULL);
5841 if (unlikely(!__pyx_cur_scope)) {
5842 __pyx_cur_scope = ((
struct __pyx_obj_6mprans_16cMoveMeshMonitor___pyx_scope_struct_2_genexpr *)Py_None);
5843 __Pyx_INCREF(Py_None);
5844 __PYX_ERR(0, 598, __pyx_L1_error)
5846 __Pyx_GOTREF(__pyx_cur_scope);
5848 __pyx_cur_scope->__pyx_outer_scope = (
struct __pyx_obj_6mprans_16cMoveMeshMonitor___pyx_scope_struct__cppPseudoTimeSteppingParallel *) __pyx_self;
5849 __Pyx_INCREF(((PyObject *)__pyx_cur_scope->__pyx_outer_scope));
5850 __Pyx_GIVEREF(__pyx_cur_scope->__pyx_outer_scope);
5852 __pyx_CoroutineObject *gen = __Pyx_Generator_New((__pyx_coroutine_body_t) __pyx_gb_6mprans_16cMoveMeshMonitor_13cCoefficients_29cppPseudoTimeSteppingParallel_5generator1, NULL, (PyObject *) __pyx_cur_scope, __pyx_n_s_genexpr, __pyx_n_s_cCoefficients_cppPseudoTimeStepp, __pyx_n_s_mprans_cMoveMeshMonitor);
if (unlikely(!gen)) __PYX_ERR(0, 598, __pyx_L1_error)
5853 __Pyx_DECREF(__pyx_cur_scope);
5854 __Pyx_RefNannyFinishContext();
5855 return (PyObject *) gen;
5860 __Pyx_AddTraceback(
"mprans.cMoveMeshMonitor.cCoefficients.cppPseudoTimeSteppingParallel.genexpr", __pyx_clineno, __pyx_lineno, __pyx_filename);
5862 __Pyx_DECREF(((PyObject *)__pyx_cur_scope));
5863 __Pyx_XGIVEREF(__pyx_r);
5864 __Pyx_RefNannyFinishContext();
5868 static PyObject *__pyx_gb_6mprans_16cMoveMeshMonitor_13cCoefficients_29cppPseudoTimeSteppingParallel_5generator1(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value)
5870 struct __pyx_obj_6mprans_16cMoveMeshMonitor___pyx_scope_struct_2_genexpr *__pyx_cur_scope = ((
struct __pyx_obj_6mprans_16cMoveMeshMonitor___pyx_scope_struct_2_genexpr *)__pyx_generator->closure);
5871 PyObject *__pyx_r = NULL;
5875 Py_ssize_t __pyx_t_4;
5876 PyObject *__pyx_t_5 = NULL;
5877 int __pyx_lineno = 0;
5878 const char *__pyx_filename = NULL;
5879 int __pyx_clineno = 0;
5880 __Pyx_RefNannyDeclarations
5881 __Pyx_RefNannySetupContext(
"genexpr", 0);
5882 switch (__pyx_generator->resume_label) {
5883 case 0:
goto __pyx_L3_first_run;
5884 case 1:
goto __pyx_L6_resume_from_yield;
5886 __Pyx_RefNannyFinishContext();
5889 __pyx_L3_first_run:;
5890 if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 598, __pyx_L1_error)
5891 __pyx_t_1 = __pyx_cur_scope->__pyx_outer_scope->__pyx_v_comm_size;
5892 __pyx_t_2 = __pyx_t_1;
5893 for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) {
5894 __pyx_cur_scope->__pyx_v_i = __pyx_t_3;
5895 __pyx_t_4 = __pyx_cur_scope->__pyx_v_i;
5896 if (__pyx_t_4 < 0) __pyx_t_4 += __pyx_cur_scope->__pyx_outer_scope->__pyx_v_displacements_in.shape[0];
5897 __pyx_t_5 = PyInt_FromSsize_t(((*((
int *) ( (__pyx_cur_scope->__pyx_outer_scope->__pyx_v_displacements_in.data + __pyx_t_4 * __pyx_cur_scope->__pyx_outer_scope->__pyx_v_displacements_in.strides[0]) ))) * (__pyx_cur_scope->__pyx_outer_scope->__pyx_v_coords_2doArray.shape[1])));
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 598, __pyx_L1_error)
5898 __Pyx_GOTREF(__pyx_t_5);
5899 __pyx_r = __pyx_t_5;
5901 __pyx_cur_scope->__pyx_t_0 = __pyx_t_1;
5902 __pyx_cur_scope->__pyx_t_1 = __pyx_t_2;
5903 __pyx_cur_scope->__pyx_t_2 = __pyx_t_3;
5904 __Pyx_XGIVEREF(__pyx_r);
5905 __Pyx_RefNannyFinishContext();
5906 __Pyx_Coroutine_ResetAndClearException(__pyx_generator);
5908 __pyx_generator->resume_label = 1;
5910 __pyx_L6_resume_from_yield:;
5911 __pyx_t_1 = __pyx_cur_scope->__pyx_t_0;
5912 __pyx_t_2 = __pyx_cur_scope->__pyx_t_1;
5913 __pyx_t_3 = __pyx_cur_scope->__pyx_t_2;
5914 if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 598, __pyx_L1_error)
5916 CYTHON_MAYBE_UNUSED_VAR(__pyx_cur_scope);
5919 PyErr_SetNone(PyExc_StopIteration);
5922 __Pyx_XDECREF(__pyx_t_5);
5923 __Pyx_AddTraceback(
"genexpr", __pyx_clineno, __pyx_lineno, __pyx_filename);
5925 __Pyx_XDECREF(__pyx_r); __pyx_r = 0;
5926 #if !CYTHON_USE_EXC_INFO_STACK
5927 __Pyx_Coroutine_ResetAndClearException(__pyx_generator);
5929 __pyx_generator->resume_label = -1;
5930 __Pyx_Coroutine_clear((PyObject*)__pyx_generator);
5931 __Pyx_RefNannyFinishContext();
5934 static PyObject *__pyx_gb_6mprans_16cMoveMeshMonitor_13cCoefficients_29cppPseudoTimeSteppingParallel_8generator2(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value);
5944 static PyObject *__pyx_pf_6mprans_16cMoveMeshMonitor_13cCoefficients_29cppPseudoTimeSteppingParallel_6genexpr(PyObject *__pyx_self) {
5945 struct __pyx_obj_6mprans_16cMoveMeshMonitor___pyx_scope_struct_3_genexpr *__pyx_cur_scope;
5946 PyObject *__pyx_r = NULL;
5947 __Pyx_RefNannyDeclarations
5948 int __pyx_lineno = 0;
5949 const char *__pyx_filename = NULL;
5950 int __pyx_clineno = 0;
5951 __Pyx_RefNannySetupContext(
"genexpr", 0);
5952 __pyx_cur_scope = (
struct __pyx_obj_6mprans_16cMoveMeshMonitor___pyx_scope_struct_3_genexpr *)__pyx_tp_new_6mprans_16cMoveMeshMonitor___pyx_scope_struct_3_genexpr(__pyx_ptype_6mprans_16cMoveMeshMonitor___pyx_scope_struct_3_genexpr, __pyx_empty_tuple, NULL);
5953 if (unlikely(!__pyx_cur_scope)) {
5954 __pyx_cur_scope = ((
struct __pyx_obj_6mprans_16cMoveMeshMonitor___pyx_scope_struct_3_genexpr *)Py_None);
5955 __Pyx_INCREF(Py_None);
5956 __PYX_ERR(0, 793, __pyx_L1_error)
5958 __Pyx_GOTREF(__pyx_cur_scope);
5960 __pyx_cur_scope->__pyx_outer_scope = (
struct __pyx_obj_6mprans_16cMoveMeshMonitor___pyx_scope_struct__cppPseudoTimeSteppingParallel *) __pyx_self;
5961 __Pyx_INCREF(((PyObject *)__pyx_cur_scope->__pyx_outer_scope));
5962 __Pyx_GIVEREF(__pyx_cur_scope->__pyx_outer_scope);
5964 __pyx_CoroutineObject *gen = __Pyx_Generator_New((__pyx_coroutine_body_t) __pyx_gb_6mprans_16cMoveMeshMonitor_13cCoefficients_29cppPseudoTimeSteppingParallel_8generator2, NULL, (PyObject *) __pyx_cur_scope, __pyx_n_s_genexpr, __pyx_n_s_cCoefficients_cppPseudoTimeStepp, __pyx_n_s_mprans_cMoveMeshMonitor);
if (unlikely(!gen)) __PYX_ERR(0, 793, __pyx_L1_error)
5965 __Pyx_DECREF(__pyx_cur_scope);
5966 __Pyx_RefNannyFinishContext();
5967 return (PyObject *) gen;
5972 __Pyx_AddTraceback(
"mprans.cMoveMeshMonitor.cCoefficients.cppPseudoTimeSteppingParallel.genexpr", __pyx_clineno, __pyx_lineno, __pyx_filename);
5974 __Pyx_DECREF(((PyObject *)__pyx_cur_scope));
5975 __Pyx_XGIVEREF(__pyx_r);
5976 __Pyx_RefNannyFinishContext();
5980 static PyObject *__pyx_gb_6mprans_16cMoveMeshMonitor_13cCoefficients_29cppPseudoTimeSteppingParallel_8generator2(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value)
5982 struct __pyx_obj_6mprans_16cMoveMeshMonitor___pyx_scope_struct_3_genexpr *__pyx_cur_scope = ((
struct __pyx_obj_6mprans_16cMoveMeshMonitor___pyx_scope_struct_3_genexpr *)__pyx_generator->closure);
5983 PyObject *__pyx_r = NULL;
5987 Py_ssize_t __pyx_t_4;
5988 PyObject *__pyx_t_5 = NULL;
5989 int __pyx_lineno = 0;
5990 const char *__pyx_filename = NULL;
5991 int __pyx_clineno = 0;
5992 __Pyx_RefNannyDeclarations
5993 __Pyx_RefNannySetupContext(
"genexpr", 0);
5994 switch (__pyx_generator->resume_label) {
5995 case 0:
goto __pyx_L3_first_run;
5996 case 1:
goto __pyx_L6_resume_from_yield;
5998 __Pyx_RefNannyFinishContext();
6001 __pyx_L3_first_run:;
6002 if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 793, __pyx_L1_error)
6003 __pyx_t_1 = __pyx_cur_scope->__pyx_outer_scope->__pyx_v_comm_size;
6004 __pyx_t_2 = __pyx_t_1;
6005 for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) {
6006 __pyx_cur_scope->__pyx_v_i = __pyx_t_3;
6007 __pyx_t_4 = __pyx_cur_scope->__pyx_v_i;
6008 if (__pyx_t_4 < 0) __pyx_t_4 += __pyx_cur_scope->__pyx_outer_scope->__pyx_v_counts_in.shape[0];
6009 __pyx_t_5 = PyInt_FromSsize_t(((*((
int *) ( (__pyx_cur_scope->__pyx_outer_scope->__pyx_v_counts_in.data + __pyx_t_4 * __pyx_cur_scope->__pyx_outer_scope->__pyx_v_counts_in.strides[0]) ))) * (__pyx_cur_scope->__pyx_outer_scope->__pyx_v_coords_2doArray.shape[1])));
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 793, __pyx_L1_error)
6010 __Pyx_GOTREF(__pyx_t_5);
6011 __pyx_r = __pyx_t_5;
6013 __pyx_cur_scope->__pyx_t_0 = __pyx_t_1;
6014 __pyx_cur_scope->__pyx_t_1 = __pyx_t_2;
6015 __pyx_cur_scope->__pyx_t_2 = __pyx_t_3;
6016 __Pyx_XGIVEREF(__pyx_r);
6017 __Pyx_RefNannyFinishContext();
6018 __Pyx_Coroutine_ResetAndClearException(__pyx_generator);
6020 __pyx_generator->resume_label = 1;
6022 __pyx_L6_resume_from_yield:;
6023 __pyx_t_1 = __pyx_cur_scope->__pyx_t_0;
6024 __pyx_t_2 = __pyx_cur_scope->__pyx_t_1;
6025 __pyx_t_3 = __pyx_cur_scope->__pyx_t_2;
6026 if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 793, __pyx_L1_error)
6028 CYTHON_MAYBE_UNUSED_VAR(__pyx_cur_scope);
6031 PyErr_SetNone(PyExc_StopIteration);
6034 __Pyx_XDECREF(__pyx_t_5);
6035 __Pyx_AddTraceback(
"genexpr", __pyx_clineno, __pyx_lineno, __pyx_filename);
6037 __Pyx_XDECREF(__pyx_r); __pyx_r = 0;
6038 #if !CYTHON_USE_EXC_INFO_STACK
6039 __Pyx_Coroutine_ResetAndClearException(__pyx_generator);
6041 __pyx_generator->resume_label = -1;
6042 __Pyx_Coroutine_clear((PyObject*)__pyx_generator);
6043 __Pyx_RefNannyFinishContext();
6046 static PyObject *__pyx_gb_6mprans_16cMoveMeshMonitor_13cCoefficients_29cppPseudoTimeSteppingParallel_11generator3(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value);
6056 static PyObject *__pyx_pf_6mprans_16cMoveMeshMonitor_13cCoefficients_29cppPseudoTimeSteppingParallel_9genexpr(PyObject *__pyx_self) {
6057 struct __pyx_obj_6mprans_16cMoveMeshMonitor___pyx_scope_struct_4_genexpr *__pyx_cur_scope;
6058 PyObject *__pyx_r = NULL;
6059 __Pyx_RefNannyDeclarations
6060 int __pyx_lineno = 0;
6061 const char *__pyx_filename = NULL;
6062 int __pyx_clineno = 0;
6063 __Pyx_RefNannySetupContext(
"genexpr", 0);
6064 __pyx_cur_scope = (
struct __pyx_obj_6mprans_16cMoveMeshMonitor___pyx_scope_struct_4_genexpr *)__pyx_tp_new_6mprans_16cMoveMeshMonitor___pyx_scope_struct_4_genexpr(__pyx_ptype_6mprans_16cMoveMeshMonitor___pyx_scope_struct_4_genexpr, __pyx_empty_tuple, NULL);
6065 if (unlikely(!__pyx_cur_scope)) {
6066 __pyx_cur_scope = ((
struct __pyx_obj_6mprans_16cMoveMeshMonitor___pyx_scope_struct_4_genexpr *)Py_None);
6067 __Pyx_INCREF(Py_None);
6068 __PYX_ERR(0, 794, __pyx_L1_error)
6070 __Pyx_GOTREF(__pyx_cur_scope);
6072 __pyx_cur_scope->__pyx_outer_scope = (
struct __pyx_obj_6mprans_16cMoveMeshMonitor___pyx_scope_struct__cppPseudoTimeSteppingParallel *) __pyx_self;
6073 __Pyx_INCREF(((PyObject *)__pyx_cur_scope->__pyx_outer_scope));
6074 __Pyx_GIVEREF(__pyx_cur_scope->__pyx_outer_scope);
6076 __pyx_CoroutineObject *gen = __Pyx_Generator_New((__pyx_coroutine_body_t) __pyx_gb_6mprans_16cMoveMeshMonitor_13cCoefficients_29cppPseudoTimeSteppingParallel_11generator3, NULL, (PyObject *) __pyx_cur_scope, __pyx_n_s_genexpr, __pyx_n_s_cCoefficients_cppPseudoTimeStepp, __pyx_n_s_mprans_cMoveMeshMonitor);
if (unlikely(!gen)) __PYX_ERR(0, 794, __pyx_L1_error)
6077 __Pyx_DECREF(__pyx_cur_scope);
6078 __Pyx_RefNannyFinishContext();
6079 return (PyObject *) gen;
6084 __Pyx_AddTraceback(
"mprans.cMoveMeshMonitor.cCoefficients.cppPseudoTimeSteppingParallel.genexpr", __pyx_clineno, __pyx_lineno, __pyx_filename);
6086 __Pyx_DECREF(((PyObject *)__pyx_cur_scope));
6087 __Pyx_XGIVEREF(__pyx_r);
6088 __Pyx_RefNannyFinishContext();
6092 static PyObject *__pyx_gb_6mprans_16cMoveMeshMonitor_13cCoefficients_29cppPseudoTimeSteppingParallel_11generator3(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value)
6094 struct __pyx_obj_6mprans_16cMoveMeshMonitor___pyx_scope_struct_4_genexpr *__pyx_cur_scope = ((
struct __pyx_obj_6mprans_16cMoveMeshMonitor___pyx_scope_struct_4_genexpr *)__pyx_generator->closure);
6095 PyObject *__pyx_r = NULL;
6099 Py_ssize_t __pyx_t_4;
6100 PyObject *__pyx_t_5 = NULL;
6101 int __pyx_lineno = 0;
6102 const char *__pyx_filename = NULL;
6103 int __pyx_clineno = 0;
6104 __Pyx_RefNannyDeclarations
6105 __Pyx_RefNannySetupContext(
"genexpr", 0);
6106 switch (__pyx_generator->resume_label) {
6107 case 0:
goto __pyx_L3_first_run;
6108 case 1:
goto __pyx_L6_resume_from_yield;
6110 __Pyx_RefNannyFinishContext();
6113 __pyx_L3_first_run:;
6114 if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 794, __pyx_L1_error)
6115 __pyx_t_1 = __pyx_cur_scope->__pyx_outer_scope->__pyx_v_comm_size;
6116 __pyx_t_2 = __pyx_t_1;
6117 for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) {
6118 __pyx_cur_scope->__pyx_v_i = __pyx_t_3;
6119 __pyx_t_4 = __pyx_cur_scope->__pyx_v_i;
6120 if (__pyx_t_4 < 0) __pyx_t_4 += __pyx_cur_scope->__pyx_outer_scope->__pyx_v_displacements_in.shape[0];
6121 __pyx_t_5 = PyInt_FromSsize_t(((*((
int *) ( (__pyx_cur_scope->__pyx_outer_scope->__pyx_v_displacements_in.data + __pyx_t_4 * __pyx_cur_scope->__pyx_outer_scope->__pyx_v_displacements_in.strides[0]) ))) * (__pyx_cur_scope->__pyx_outer_scope->__pyx_v_coords_2doArray.shape[1])));
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 794, __pyx_L1_error)
6122 __Pyx_GOTREF(__pyx_t_5);
6123 __pyx_r = __pyx_t_5;
6125 __pyx_cur_scope->__pyx_t_0 = __pyx_t_1;
6126 __pyx_cur_scope->__pyx_t_1 = __pyx_t_2;
6127 __pyx_cur_scope->__pyx_t_2 = __pyx_t_3;
6128 __Pyx_XGIVEREF(__pyx_r);
6129 __Pyx_RefNannyFinishContext();
6130 __Pyx_Coroutine_ResetAndClearException(__pyx_generator);
6132 __pyx_generator->resume_label = 1;
6134 __pyx_L6_resume_from_yield:;
6135 __pyx_t_1 = __pyx_cur_scope->__pyx_t_0;
6136 __pyx_t_2 = __pyx_cur_scope->__pyx_t_1;
6137 __pyx_t_3 = __pyx_cur_scope->__pyx_t_2;
6138 if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 794, __pyx_L1_error)
6140 CYTHON_MAYBE_UNUSED_VAR(__pyx_cur_scope);
6143 PyErr_SetNone(PyExc_StopIteration);
6146 __Pyx_XDECREF(__pyx_t_5);
6147 __Pyx_AddTraceback(
"genexpr", __pyx_clineno, __pyx_lineno, __pyx_filename);
6149 __Pyx_XDECREF(__pyx_r); __pyx_r = 0;
6150 #if !CYTHON_USE_EXC_INFO_STACK
6151 __Pyx_Coroutine_ResetAndClearException(__pyx_generator);
6153 __pyx_generator->resume_label = -1;
6154 __Pyx_Coroutine_clear((PyObject*)__pyx_generator);
6155 __Pyx_RefNannyFinishContext();
6167 static PyObject *__pyx_f_6mprans_16cMoveMeshMonitor_13cCoefficients_cppPseudoTimeSteppingParallel(
struct __pyx_obj_6mprans_16cMoveMeshMonitor_cCoefficients *__pyx_v_self, __Pyx_memviewslice __pyx_v_xx,
double __pyx_v_eps) {
6168 struct __pyx_obj_6mprans_16cMoveMeshMonitor___pyx_scope_struct__cppPseudoTimeSteppingParallel *__pyx_cur_scope;
6169 PyObject *__pyx_v_pc = NULL;
6170 int __pyx_v_ntimes_solved;
6171 int __pyx_v_ntimes_i;
6172 double __pyx_v_t_min;
6173 double __pyx_v_t_max;
6174 __Pyx_memviewslice __pyx_v_t_range = { 0, 0, { 0 }, { 0 }, { 0 } };
6175 int __pyx_v_ntimesteps;
6176 __Pyx_memviewslice __pyx_v_eN_phi = { 0, 0, { 0 }, { 0 }, { 0 } };
6177 __Pyx_memviewslice __pyx_v_normal = { 0, 0, { 0 }, { 0 }, { 0 } };
6178 double __pyx_v_t_last;
6182 double __pyx_v_area;
6184 double __pyx_v_ls_phi;
6186 double __pyx_v_Ccoeff;
6188 __Pyx_memviewslice __pyx_v_dphi = { 0, 0, { 0 }, { 0 }, { 0 } };
6189 __Pyx_memviewslice __pyx_v_grads = { 0, 0, { 0 }, { 0 }, { 0 } };
6190 __Pyx_memviewslice __pyx_v_v_grad = { 0, 0, { 0 }, { 0 }, { 0 } };
6191 __Pyx_memviewslice __pyx_v_areas_nodes = { 0, 0, { 0 }, { 0 }, { 0 } };
6192 CYTHON_UNUSED __Pyx_memviewslice __pyx_v_areas = { 0, 0, { 0 }, { 0 }, { 0 } };
6193 __Pyx_memviewslice __pyx_v_u_phi = { 0, 0, { 0 }, { 0 }, { 0 } };
6197 PyObject *__pyx_v_femSpace = 0;
6198 __Pyx_memviewslice __pyx_v_nodeArray = { 0, 0, { 0 }, { 0 }, { 0 } };
6199 __Pyx_memviewslice __pyx_v_nodeStarOffsets = { 0, 0, { 0 }, { 0 }, { 0 } };
6200 __Pyx_memviewslice __pyx_v_nodeStarArray = { 0, 0, { 0 }, { 0 }, { 0 } };
6201 __Pyx_memviewslice __pyx_v_nodeElementOffsets = { 0, 0, { 0 }, { 0 }, { 0 } };
6202 __Pyx_memviewslice __pyx_v_nodeElementsArray = { 0, 0, { 0 }, { 0 }, { 0 } };
6203 __Pyx_memviewslice __pyx_v_nodeMaterialTypes = { 0, 0, { 0 }, { 0 }, { 0 } };
6204 __Pyx_memviewslice __pyx_v_elementBarycentersArray = { 0, 0, { 0 }, { 0 }, { 0 } };
6205 __Pyx_memviewslice __pyx_v_elementBoundaryElementsArray = { 0, 0, { 0 }, { 0 }, { 0 } };
6206 __Pyx_memviewslice __pyx_v_elementBoundariesArray = { 0, 0, { 0 }, { 0 }, { 0 } };
6207 __Pyx_memviewslice __pyx_v_elementNodesArray = { 0, 0, { 0 }, { 0 }, { 0 } };
6208 __Pyx_memviewslice __pyx_v_elementBoundaryBarycentersArray = { 0, 0, { 0 }, { 0 }, { 0 } };
6209 __Pyx_memviewslice __pyx_v_exteriorElementBoundariesBoolArray = { 0, 0, { 0 }, { 0 }, { 0 } };
6211 __Pyx_memviewslice __pyx_v_elementBoundaryNormalsArray = { 0, 0, { 0 }, { 0 }, { 0 } };
6212 int __pyx_v_nNodes_owned;
6213 int __pyx_v_nNodes_global;
6214 int __pyx_v_nElements_owned;
6215 CYTHON_UNUSED
int __pyx_v_nElements_global;
6216 __Pyx_memviewslice __pyx_v_nodeNumbering_subdomain2global = { 0, 0, { 0 }, { 0 }, { 0 } };
6217 __Pyx_memviewslice __pyx_v_elementNumbering_subdomain2global = { 0, 0, { 0 }, { 0 }, { 0 } };
6218 __Pyx_memviewslice __pyx_v_nodeOffsets_subdomain_owned = { 0, 0, { 0 }, { 0 }, { 0 } };
6219 __Pyx_memviewslice __pyx_v_elementOffsets_subdomain_owned = { 0, 0, { 0 }, { 0 }, { 0 } };
6220 __Pyx_memviewslice __pyx_v_nearestNArray = { 0, 0, { 0 }, { 0 }, { 0 } };
6221 __Pyx_memviewslice __pyx_v_typeNArray = { 0, 0, { 0 }, { 0 }, { 0 } };
6222 CYTHON_UNUSED __Pyx_memviewslice __pyx_v_elementNeighborsArray = { 0, 0, { 0 }, { 0 }, { 0 } };
6223 int __pyx_v_nElementBoundaries_owned;
6224 __Pyx_memviewslice __pyx_v_elementBoundaryNumbering_subdomain2global = { 0, 0, { 0 }, { 0 }, { 0 } };
6225 __Pyx_memviewslice __pyx_v_elementBoundaryOffsets_subdomain_owned = { 0, 0, { 0 }, { 0 }, { 0 } };
6226 CYTHON_UNUSED __Pyx_memviewslice __pyx_v_elementBoundaryNodesArray = { 0, 0, { 0 }, { 0 }, { 0 } };
6227 __Pyx_memviewslice __pyx_v_fixedNodesBoolArray = { 0, 0, { 0 }, { 0 }, { 0 } };
6228 int __pyx_v_nSmoothOut;
6229 int __pyx_v_nSmoothIn;
6230 int __pyx_v_nSmooth;
6231 bool __pyx_v_inside_eN;
6232 CYTHON_UNUSED __Pyx_memviewslice __pyx_v_vec = { 0, 0, { 0 }, { 0 }, { 0 } };
6233 CYTHON_UNUSED __Pyx_memviewslice __pyx_v_vec2 = { 0, 0, { 0 }, { 0 }, { 0 } };
6234 __Pyx_memviewslice __pyx_v_fixed_dir = { 0, 0, { 0 }, { 0 }, { 0 } };
6235 int __pyx_v_nearestN;
6237 PyObject *__pyx_v_comm = NULL;
6238 int __pyx_v_my_rank;
6239 __Pyx_memviewslice __pyx_v_counts_local = { 0, 0, { 0 }, { 0 }, { 0 } };
6240 __Pyx_memviewslice __pyx_v_counts_total = { 0, 0, { 0 }, { 0 }, { 0 } };
6241 CYTHON_UNUSED __Pyx_memviewslice __pyx_v_counts_out = { 0, 0, { 0 }, { 0 }, { 0 } };
6242 CYTHON_UNUSED __Pyx_memviewslice __pyx_v_displacements_out = { 0, 0, { 0 }, { 0 }, { 0 } };
6244 PyObject *__pyx_v_coords_2rank = 0;
6245 CYTHON_UNUSED PyObject *__pyx_v_nodes0_2rank = 0;
6246 CYTHON_UNUSED PyObject *__pyx_v_rank0_2rank = 0;
6247 CYTHON_UNUSED PyObject *__pyx_v_nearestN_2rank = 0;
6248 CYTHON_UNUSED PyObject *__pyx_v_typeN_2rank = 0;
6249 CYTHON_UNUSED PyObject *__pyx_v_dir_2rank = 0;
6250 CYTHON_UNUSED PyObject *__pyx_v_b_i_2rank = 0;
6251 bool __pyx_v_sendBack;
6252 int __pyx_v_nPending_disp;
6253 int __pyx_v_nPending_disp_total;
6261 int __pyx_v_parallel_steps;
6262 int __pyx_v_new_rank;
6263 __Pyx_memviewslice __pyx_v_coords = { 0, 0, { 0 }, { 0 }, { 0 } };
6264 CYTHON_UNUSED
int __pyx_v_b_i_global;
6265 __Pyx_memviewslice __pyx_v_bound_bar = { 0, 0, { 0 }, { 0 }, { 0 } };
6266 __Pyx_memviewslice __pyx_v_result = { 0, 0, { 0 }, { 0 }, { 0 } };
6267 CYTHON_UNUSED
double __pyx_v_array_size_local;
6268 PyObject *__pyx_v_rank = NULL;
6269 __Pyx_memviewslice __pyx_v_nodesSentBoolArray = { 0, 0, { 0 }, { 0 }, { 0 } };
6270 CYTHON_UNUSED
bool __pyx_v_pending;
6271 CYTHON_UNUSED __Pyx_memviewslice __pyx_v_starting_coords = { 0, 0, { 0 }, { 0 }, { 0 } };
6275 PyObject *__pyx_v_exc = NULL;
6276 PyObject *__pyx_v_xi = NULL;
6277 int __pyx_v_rank_recv;
6278 PyObject *__pyx_v_array_size = NULL;
6279 CYTHON_UNUSED PyObject *__pyx_v_datatype = NULL;
6280 PyObject *__pyx_v_solFound_2doArray = NULL;
6281 PyObject *__pyx_v_rank0 = NULL;
6283 CYTHON_UNUSED
int __pyx_v_iS;
6284 int __pyx_v_simultaneous;
6285 PyObject *__pyx_gb_6mprans_16cMoveMeshMonitor_13cCoefficients_29cppPseudoTimeSteppingParallel_2generator = 0;
6286 PyObject *__pyx_gb_6mprans_16cMoveMeshMonitor_13cCoefficients_29cppPseudoTimeSteppingParallel_5generator1 = 0;
6287 PyObject *__pyx_gb_6mprans_16cMoveMeshMonitor_13cCoefficients_29cppPseudoTimeSteppingParallel_8generator2 = 0;
6288 PyObject *__pyx_gb_6mprans_16cMoveMeshMonitor_13cCoefficients_29cppPseudoTimeSteppingParallel_11generator3 = 0;
6289 PyObject *__pyx_r = NULL;
6290 __Pyx_RefNannyDeclarations
6291 PyObject *__pyx_t_1 = NULL;
6293 PyObject *__pyx_t_3 = NULL;
6294 PyObject *__pyx_t_4 = NULL;
6295 PyObject *__pyx_t_5 = NULL;
6296 PyObject *__pyx_t_6 = NULL;
6297 PyObject *__pyx_t_7 = NULL;
6298 PyObject *__pyx_t_8 = NULL;
6299 __Pyx_memviewslice __pyx_t_9 = { 0, 0, { 0 }, { 0 }, { 0 } };
6301 __Pyx_memviewslice __pyx_t_11 = { 0, 0, { 0 }, { 0 }, { 0 } };
6303 __Pyx_memviewslice __pyx_t_13 = { 0, 0, { 0 }, { 0 }, { 0 } };
6304 __Pyx_memviewslice __pyx_t_14 = { 0, 0, { 0 }, { 0 }, { 0 } };
6305 Py_ssize_t __pyx_t_15;
6306 PyObject *(*__pyx_t_16)(PyObject *);
6307 Py_ssize_t __pyx_t_17;
6308 __Pyx_memviewslice __pyx_t_18 = { 0, 0, { 0 }, { 0 }, { 0 } };
6315 Py_ssize_t __pyx_t_25;
6316 Py_ssize_t __pyx_t_26;
6321 Py_ssize_t __pyx_t_31;
6322 Py_ssize_t __pyx_t_32;
6323 Py_ssize_t __pyx_t_33;
6324 Py_ssize_t __pyx_t_34;
6325 Py_ssize_t __pyx_t_35;
6326 Py_ssize_t __pyx_t_36;
6327 PyObject *__pyx_t_37 = NULL;
6328 PyObject *__pyx_t_38 = NULL;
6329 PyObject *__pyx_t_39 = NULL;
6331 Py_ssize_t __pyx_t_41;
6332 PyObject *__pyx_t_42 = NULL;
6333 PyObject *__pyx_t_43 = NULL;
6334 PyObject *__pyx_t_44 = NULL;
6335 PyObject *__pyx_t_45 = NULL;
6336 PyObject *__pyx_t_46 = NULL;
6337 PyObject *__pyx_t_47 = NULL;
6338 Py_ssize_t __pyx_t_48;
6339 Py_ssize_t __pyx_t_49;
6340 PyObject *__pyx_t_50 = NULL;
6341 PyObject *__pyx_t_51 = NULL;
6342 PyObject *__pyx_t_52 = NULL;
6343 PyObject *__pyx_t_53 = NULL;
6344 int __pyx_lineno = 0;
6345 const char *__pyx_filename = NULL;
6346 int __pyx_clineno = 0;
6347 __Pyx_RefNannySetupContext(
"cppPseudoTimeSteppingParallel", 0);
6348 __pyx_cur_scope = (
struct __pyx_obj_6mprans_16cMoveMeshMonitor___pyx_scope_struct__cppPseudoTimeSteppingParallel *)__pyx_tp_new_6mprans_16cMoveMeshMonitor___pyx_scope_struct__cppPseudoTimeSteppingParallel(__pyx_ptype_6mprans_16cMoveMeshMonitor___pyx_scope_struct__cppPseudoTimeSteppingParallel, __pyx_empty_tuple, NULL);
6349 if (unlikely(!__pyx_cur_scope)) {
6350 __pyx_cur_scope = ((
struct __pyx_obj_6mprans_16cMoveMeshMonitor___pyx_scope_struct__cppPseudoTimeSteppingParallel *)Py_None);
6351 __Pyx_INCREF(Py_None);
6352 __PYX_ERR(0, 202, __pyx_L1_error)
6354 __Pyx_GOTREF(__pyx_cur_scope);
6364 __pyx_t_1 = __pyx_v_self->pyCoefficients;
6365 __Pyx_INCREF(__pyx_t_1);
6366 __pyx_v_pc = __pyx_t_1;
6376 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_pc, __pyx_n_s_ntimes_solved);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 206, __pyx_L1_error)
6377 __Pyx_GOTREF(__pyx_t_1);
6378 __pyx_t_2 = __Pyx_PyInt_As_int(__pyx_t_1);
if (unlikely((__pyx_t_2 == (
int)-1) && PyErr_Occurred())) __PYX_ERR(0, 206, __pyx_L1_error)
6379 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
6380 __pyx_v_ntimes_solved = __pyx_t_2;
6389 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_pc, __pyx_n_s_ntimes_i);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 207, __pyx_L1_error)
6390 __Pyx_GOTREF(__pyx_t_1);
6391 __pyx_t_2 = __Pyx_PyInt_As_int(__pyx_t_1);
if (unlikely((__pyx_t_2 == (
int)-1) && PyErr_Occurred())) __PYX_ERR(0, 207, __pyx_L1_error)
6392 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
6393 __pyx_v_ntimes_i = __pyx_t_2;
6402 __pyx_v_t_min = ((1. / __pyx_v_ntimes_solved) * __pyx_v_ntimes_i);
6411 __pyx_v_t_max = (__pyx_v_t_min + (1. / __pyx_v_ntimes_solved));
6420 __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_logEvent);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 210, __pyx_L1_error)
6421 __Pyx_GOTREF(__pyx_t_1);
6422 __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_kp_s_Pseudo_time_stepping_with_dt_eps, __pyx_n_s_format);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 210, __pyx_L1_error)
6423 __Pyx_GOTREF(__pyx_t_3);
6424 __pyx_t_4 = __Pyx_PyDict_NewPresized(3);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 210, __pyx_L1_error)
6425 __Pyx_GOTREF(__pyx_t_4);
6426 __pyx_t_5 = PyFloat_FromDouble(__pyx_v_eps);
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 210, __pyx_L1_error)
6427 __Pyx_GOTREF(__pyx_t_5);
6428 if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_eps, __pyx_t_5) < 0) __PYX_ERR(0, 210, __pyx_L1_error)
6429 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
6430 __pyx_t_5 = PyFloat_FromDouble(__pyx_v_t_max);
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 210, __pyx_L1_error)
6431 __Pyx_GOTREF(__pyx_t_5);
6432 if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_t_max, __pyx_t_5) < 0) __PYX_ERR(0, 210, __pyx_L1_error)
6433 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
6434 __pyx_t_5 = PyFloat_FromDouble(__pyx_v_t_min);
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 210, __pyx_L1_error)
6435 __Pyx_GOTREF(__pyx_t_5);
6436 if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_t_min, __pyx_t_5) < 0) __PYX_ERR(0, 210, __pyx_L1_error)
6437 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
6438 __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_empty_tuple, __pyx_t_4);
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 210, __pyx_L1_error)
6439 __Pyx_GOTREF(__pyx_t_5);
6440 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
6441 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
6442 __pyx_t_4 = PyTuple_New(1);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 210, __pyx_L1_error)
6443 __Pyx_GOTREF(__pyx_t_4);
6444 __Pyx_GIVEREF(__pyx_t_5);
6445 PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_5);
6455 __pyx_t_5 = __Pyx_PyDict_NewPresized(1);
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 211, __pyx_L1_error)
6456 __Pyx_GOTREF(__pyx_t_5);
6457 if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_level, __pyx_int_3) < 0) __PYX_ERR(0, 211, __pyx_L1_error)
6466 __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_4, __pyx_t_5);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 210, __pyx_L1_error)
6467 __Pyx_GOTREF(__pyx_t_3);
6468 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
6469 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
6470 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
6471 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
6480 __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_np);
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 212, __pyx_L1_error)
6481 __Pyx_GOTREF(__pyx_t_5);
6482 __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_linspace);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 212, __pyx_L1_error)
6483 __Pyx_GOTREF(__pyx_t_4);
6484 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
6485 __pyx_t_5 = PyFloat_FromDouble(__pyx_v_t_min);
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 212, __pyx_L1_error)
6486 __Pyx_GOTREF(__pyx_t_5);
6487 __pyx_t_1 = PyFloat_FromDouble(__pyx_v_t_max);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 212, __pyx_L1_error)
6488 __Pyx_GOTREF(__pyx_t_1);
6489 __pyx_t_6 = __Pyx_PyInt_FromDouble((((__pyx_v_t_max - __pyx_v_t_min) / __pyx_v_eps) + 1.0));
if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 212, __pyx_L1_error)
6490 __Pyx_GOTREF(__pyx_t_6);
6493 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
6494 __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_4);
6495 if (likely(__pyx_t_7)) {
6496 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_4);
6497 __Pyx_INCREF(__pyx_t_7);
6498 __Pyx_INCREF(
function);
6499 __Pyx_DECREF_SET(__pyx_t_4,
function);
6503 #if CYTHON_FAST_PYCALL
6504 if (PyFunction_Check(__pyx_t_4)) {
6505 PyObject *__pyx_temp[4] = {__pyx_t_7, __pyx_t_5, __pyx_t_1, __pyx_t_6};
6506 __pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_2, 3+__pyx_t_2);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 212, __pyx_L1_error)
6507 __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
6508 __Pyx_GOTREF(__pyx_t_3);
6509 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
6510 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
6511 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
6514 #if CYTHON_FAST_PYCCALL
6515 if (__Pyx_PyFastCFunction_Check(__pyx_t_4)) {
6516 PyObject *__pyx_temp[4] = {__pyx_t_7, __pyx_t_5, __pyx_t_1, __pyx_t_6};
6517 __pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_2, 3+__pyx_t_2);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 212, __pyx_L1_error)
6518 __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
6519 __Pyx_GOTREF(__pyx_t_3);
6520 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
6521 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
6522 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
6526 __pyx_t_8 = PyTuple_New(3+__pyx_t_2);
if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 212, __pyx_L1_error)
6527 __Pyx_GOTREF(__pyx_t_8);
6529 __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_7); __pyx_t_7 = NULL;
6531 __Pyx_GIVEREF(__pyx_t_5);
6532 PyTuple_SET_ITEM(__pyx_t_8, 0+__pyx_t_2, __pyx_t_5);
6533 __Pyx_GIVEREF(__pyx_t_1);
6534 PyTuple_SET_ITEM(__pyx_t_8, 1+__pyx_t_2, __pyx_t_1);
6535 __Pyx_GIVEREF(__pyx_t_6);
6536 PyTuple_SET_ITEM(__pyx_t_8, 2+__pyx_t_2, __pyx_t_6);
6540 __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_8, NULL);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 212, __pyx_L1_error)
6541 __Pyx_GOTREF(__pyx_t_3);
6542 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
6544 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
6545 __pyx_t_4 = __Pyx_PyObject_GetSlice(__pyx_t_3, 1, 0, NULL, NULL, &__pyx_slice__4, 1, 0, 1);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 212, __pyx_L1_error)
6546 __Pyx_GOTREF(__pyx_t_4);
6547 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
6548 __pyx_t_9 = __Pyx_PyObject_to_MemoryviewSlice_ds_double(__pyx_t_4, PyBUF_WRITABLE);
if (unlikely(!__pyx_t_9.memview)) __PYX_ERR(0, 212, __pyx_L1_error)
6549 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
6550 __pyx_v_t_range = __pyx_t_9;
6551 __pyx_t_9.memview = NULL;
6552 __pyx_t_9.data = NULL;
6561 __pyx_t_10 = __Pyx_MemoryView_Len(__pyx_v_t_range);
6562 __pyx_v_ntimesteps = __pyx_t_10;
6571 __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_np);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 214, __pyx_L1_error)
6572 __Pyx_GOTREF(__pyx_t_4);
6573 __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_zeros);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 214, __pyx_L1_error)
6574 __Pyx_GOTREF(__pyx_t_3);
6575 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
6576 __pyx_t_10 = __Pyx_MemoryView_Len(__pyx_v_xx);
6577 __pyx_t_4 = __Pyx_PyInt_FromSize_t(__pyx_t_10);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 214, __pyx_L1_error)
6578 __Pyx_GOTREF(__pyx_t_4);
6579 __pyx_t_8 = PyTuple_New(1);
if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 214, __pyx_L1_error)
6580 __Pyx_GOTREF(__pyx_t_8);
6581 __Pyx_GIVEREF(__pyx_t_4);
6582 PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_4);
6584 __pyx_t_4 = __Pyx_PyDict_NewPresized(1);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 214, __pyx_L1_error)
6585 __Pyx_GOTREF(__pyx_t_4);
6586 __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_np);
if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 214, __pyx_L1_error)
6587 __Pyx_GOTREF(__pyx_t_6);
6588 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_int32);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 214, __pyx_L1_error)
6589 __Pyx_GOTREF(__pyx_t_1);
6590 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
6591 if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_dtype, __pyx_t_1) < 0) __PYX_ERR(0, 214, __pyx_L1_error)
6592 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
6593 __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_8, __pyx_t_4);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 214, __pyx_L1_error)
6594 __Pyx_GOTREF(__pyx_t_1);
6595 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
6596 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
6597 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
6598 __pyx_t_11 = __Pyx_PyObject_to_MemoryviewSlice_ds_int(__pyx_t_1, PyBUF_WRITABLE);
if (unlikely(!__pyx_t_11.memview)) __PYX_ERR(0, 214, __pyx_L1_error)
6599 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
6600 __pyx_v_eN_phi = __pyx_t_11;
6601 __pyx_t_11.memview = NULL;
6602 __pyx_t_11.data = NULL;
6611 __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_np);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 215, __pyx_L1_error)
6612 __Pyx_GOTREF(__pyx_t_4);
6613 __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_zeros);
if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 215, __pyx_L1_error)
6614 __Pyx_GOTREF(__pyx_t_8);
6615 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
6617 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_8))) {
6618 __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_8);
6619 if (likely(__pyx_t_4)) {
6620 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_8);
6621 __Pyx_INCREF(__pyx_t_4);
6622 __Pyx_INCREF(
function);
6623 __Pyx_DECREF_SET(__pyx_t_8,
function);
6626 __pyx_t_1 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_8, __pyx_t_4, __pyx_int_3) : __Pyx_PyObject_CallOneArg(__pyx_t_8, __pyx_int_3);
6627 __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
6628 if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 215, __pyx_L1_error)
6629 __Pyx_GOTREF(__pyx_t_1);
6630 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
6631 __pyx_t_9 = __Pyx_PyObject_to_MemoryviewSlice_ds_double(__pyx_t_1, PyBUF_WRITABLE);
if (unlikely(!__pyx_t_9.memview)) __PYX_ERR(0, 215, __pyx_L1_error)
6632 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
6633 __pyx_v_normal = __pyx_t_9;
6634 __pyx_t_9.memview = NULL;
6635 __pyx_t_9.data = NULL;
6644 __pyx_v_t_last = __pyx_v_t_min;
6671 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_pc, __pyx_n_s_C);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 224, __pyx_L1_error)
6672 __Pyx_GOTREF(__pyx_t_1);
6673 __pyx_t_12 = __pyx_PyFloat_AsDouble(__pyx_t_1);
if (unlikely((__pyx_t_12 == (
double)-1) && PyErr_Occurred())) __PYX_ERR(0, 224, __pyx_L1_error)
6674 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
6675 __pyx_v_Ccoeff = __pyx_t_12;
6684 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_pc, __pyx_n_s_nd);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 225, __pyx_L1_error)
6685 __Pyx_GOTREF(__pyx_t_1);
6686 __pyx_t_2 = __Pyx_PyInt_As_int(__pyx_t_1);
if (unlikely((__pyx_t_2 == (
int)-1) && PyErr_Occurred())) __PYX_ERR(0, 225, __pyx_L1_error)
6687 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
6688 __pyx_v_nd = __pyx_t_2;
6697 __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_n_s_np);
if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 226, __pyx_L1_error)
6698 __Pyx_GOTREF(__pyx_t_8);
6699 __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_zeros);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 226, __pyx_L1_error)
6700 __Pyx_GOTREF(__pyx_t_4);
6701 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
6702 __pyx_t_8 = __Pyx_PyInt_From_int(__pyx_v_nd);
if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 226, __pyx_L1_error)
6703 __Pyx_GOTREF(__pyx_t_8);
6705 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
6706 __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_4);
6707 if (likely(__pyx_t_3)) {
6708 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_4);
6709 __Pyx_INCREF(__pyx_t_3);
6710 __Pyx_INCREF(
function);
6711 __Pyx_DECREF_SET(__pyx_t_4,
function);
6714 __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_3, __pyx_t_8) : __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_8);
6715 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
6716 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
6717 if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 226, __pyx_L1_error)
6718 __Pyx_GOTREF(__pyx_t_1);
6719 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
6720 __pyx_t_9 = __Pyx_PyObject_to_MemoryviewSlice_ds_double(__pyx_t_1, PyBUF_WRITABLE);
if (unlikely(!__pyx_t_9.memview)) __PYX_ERR(0, 226, __pyx_L1_error)
6721 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
6722 __pyx_v_dphi = __pyx_t_9;
6723 __pyx_t_9.memview = NULL;
6724 __pyx_t_9.data = NULL;
6733 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_pc, __pyx_n_s_grads);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 227, __pyx_L1_error)
6734 __Pyx_GOTREF(__pyx_t_1);
6735 __pyx_t_13 = __Pyx_PyObject_to_MemoryviewSlice_dsds_double(__pyx_t_1, PyBUF_WRITABLE);
if (unlikely(!__pyx_t_13.memview)) __PYX_ERR(0, 227, __pyx_L1_error)
6736 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
6737 __pyx_v_grads = __pyx_t_13;
6738 __pyx_t_13.memview = NULL;
6739 __pyx_t_13.data = NULL;
6748 __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_np);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 228, __pyx_L1_error)
6749 __Pyx_GOTREF(__pyx_t_4);
6750 __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_zeros);
if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 228, __pyx_L1_error)
6751 __Pyx_GOTREF(__pyx_t_8);
6752 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
6754 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_8))) {
6755 __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_8);
6756 if (likely(__pyx_t_4)) {
6757 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_8);
6758 __Pyx_INCREF(__pyx_t_4);
6759 __Pyx_INCREF(
function);
6760 __Pyx_DECREF_SET(__pyx_t_8,
function);
6763 __pyx_t_1 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_8, __pyx_t_4, __pyx_int_3) : __Pyx_PyObject_CallOneArg(__pyx_t_8, __pyx_int_3);
6764 __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
6765 if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 228, __pyx_L1_error)
6766 __Pyx_GOTREF(__pyx_t_1);
6767 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
6768 __pyx_t_9 = __Pyx_PyObject_to_MemoryviewSlice_ds_double(__pyx_t_1, PyBUF_WRITABLE);
if (unlikely(!__pyx_t_9.memview)) __PYX_ERR(0, 228, __pyx_L1_error)
6769 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
6770 __pyx_v_v_grad = __pyx_t_9;
6771 __pyx_t_9.memview = NULL;
6772 __pyx_t_9.data = NULL;
6781 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_pc, __pyx_n_s_areas_nodes);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 229, __pyx_L1_error)
6782 __Pyx_GOTREF(__pyx_t_1);
6783 __pyx_t_9 = __Pyx_PyObject_to_MemoryviewSlice_ds_double(__pyx_t_1, PyBUF_WRITABLE);
if (unlikely(!__pyx_t_9.memview)) __PYX_ERR(0, 229, __pyx_L1_error)
6784 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
6785 __pyx_v_areas_nodes = __pyx_t_9;
6786 __pyx_t_9.memview = NULL;
6787 __pyx_t_9.data = NULL;
6796 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_pc, __pyx_n_s_areas);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 230, __pyx_L1_error)
6797 __Pyx_GOTREF(__pyx_t_1);
6798 __pyx_t_9 = __Pyx_PyObject_to_MemoryviewSlice_ds_double(__pyx_t_1, PyBUF_WRITABLE);
if (unlikely(!__pyx_t_9.memview)) __PYX_ERR(0, 230, __pyx_L1_error)
6799 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
6800 __pyx_v_areas = __pyx_t_9;
6801 __pyx_t_9.memview = NULL;
6802 __pyx_t_9.data = NULL;
6811 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_pc, __pyx_n_s_u_phi);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 231, __pyx_L1_error)
6812 __Pyx_GOTREF(__pyx_t_1);
6813 __pyx_t_9 = __Pyx_PyObject_to_MemoryviewSlice_ds_double(__pyx_t_1, PyBUF_WRITABLE);
if (unlikely(!__pyx_t_9.memview)) __PYX_ERR(0, 231, __pyx_L1_error)
6814 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
6815 __pyx_v_u_phi = __pyx_t_9;
6816 __pyx_t_9.memview = NULL;
6817 __pyx_t_9.data = NULL;
6826 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_pc, __pyx_n_s_model);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 234, __pyx_L1_error)
6827 __Pyx_GOTREF(__pyx_t_1);
6828 __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_u);
if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 234, __pyx_L1_error)
6829 __Pyx_GOTREF(__pyx_t_8);
6830 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
6831 __pyx_t_1 = __Pyx_GetItemInt(__pyx_t_8, 0,
long, 1, __Pyx_PyInt_From_long, 0, 0, 0);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 234, __pyx_L1_error)
6832 __Pyx_GOTREF(__pyx_t_1);
6833 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
6834 __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_femSpace);
if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 234, __pyx_L1_error)
6835 __Pyx_GOTREF(__pyx_t_8);
6836 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
6837 __pyx_v_femSpace = __pyx_t_8;
6847 __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_pc, __pyx_n_s_mesh);
if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 237, __pyx_L1_error)
6848 __Pyx_GOTREF(__pyx_t_8);
6849 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_nodeArray);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 237, __pyx_L1_error)
6850 __Pyx_GOTREF(__pyx_t_1);
6851 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
6852 __pyx_t_13 = __Pyx_PyObject_to_MemoryviewSlice_dsds_double(__pyx_t_1, PyBUF_WRITABLE);
if (unlikely(!__pyx_t_13.memview)) __PYX_ERR(0, 237, __pyx_L1_error)
6853 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
6854 __pyx_v_nodeArray = __pyx_t_13;
6855 __pyx_t_13.memview = NULL;
6856 __pyx_t_13.data = NULL;
6865 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_pc, __pyx_n_s_mesh);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 238, __pyx_L1_error)
6866 __Pyx_GOTREF(__pyx_t_1);
6867 __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_nodeStarOffsets);
if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 238, __pyx_L1_error)
6868 __Pyx_GOTREF(__pyx_t_8);
6869 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
6870 __pyx_t_11 = __Pyx_PyObject_to_MemoryviewSlice_ds_int(__pyx_t_8, PyBUF_WRITABLE);
if (unlikely(!__pyx_t_11.memview)) __PYX_ERR(0, 238, __pyx_L1_error)
6871 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
6872 __pyx_v_nodeStarOffsets = __pyx_t_11;
6873 __pyx_t_11.memview = NULL;
6874 __pyx_t_11.data = NULL;
6883 __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_pc, __pyx_n_s_mesh);
if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 239, __pyx_L1_error)
6884 __Pyx_GOTREF(__pyx_t_8);
6885 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_nodeStarArray);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 239, __pyx_L1_error)
6886 __Pyx_GOTREF(__pyx_t_1);
6887 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
6888 __pyx_t_11 = __Pyx_PyObject_to_MemoryviewSlice_ds_int(__pyx_t_1, PyBUF_WRITABLE);
if (unlikely(!__pyx_t_11.memview)) __PYX_ERR(0, 239, __pyx_L1_error)
6889 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
6890 __pyx_v_nodeStarArray = __pyx_t_11;
6891 __pyx_t_11.memview = NULL;
6892 __pyx_t_11.data = NULL;
6901 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_pc, __pyx_n_s_mesh);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 240, __pyx_L1_error)
6902 __Pyx_GOTREF(__pyx_t_1);
6903 __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_nodeElementOffsets);
if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 240, __pyx_L1_error)
6904 __Pyx_GOTREF(__pyx_t_8);
6905 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
6906 __pyx_t_11 = __Pyx_PyObject_to_MemoryviewSlice_ds_int(__pyx_t_8, PyBUF_WRITABLE);
if (unlikely(!__pyx_t_11.memview)) __PYX_ERR(0, 240, __pyx_L1_error)
6907 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
6908 __pyx_v_nodeElementOffsets = __pyx_t_11;
6909 __pyx_t_11.memview = NULL;
6910 __pyx_t_11.data = NULL;
6919 __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_pc, __pyx_n_s_mesh);
if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 241, __pyx_L1_error)
6920 __Pyx_GOTREF(__pyx_t_8);
6921 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_nodeElementsArray);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 241, __pyx_L1_error)
6922 __Pyx_GOTREF(__pyx_t_1);
6923 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
6924 __pyx_t_11 = __Pyx_PyObject_to_MemoryviewSlice_ds_int(__pyx_t_1, PyBUF_WRITABLE);
if (unlikely(!__pyx_t_11.memview)) __PYX_ERR(0, 241, __pyx_L1_error)
6925 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
6926 __pyx_v_nodeElementsArray = __pyx_t_11;
6927 __pyx_t_11.memview = NULL;
6928 __pyx_t_11.data = NULL;
6937 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_pc, __pyx_n_s_mesh);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 242, __pyx_L1_error)
6938 __Pyx_GOTREF(__pyx_t_1);
6939 __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_nodeMaterialTypes);
if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 242, __pyx_L1_error)
6940 __Pyx_GOTREF(__pyx_t_8);
6941 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
6942 __pyx_t_11 = __Pyx_PyObject_to_MemoryviewSlice_ds_int(__pyx_t_8, PyBUF_WRITABLE);
if (unlikely(!__pyx_t_11.memview)) __PYX_ERR(0, 242, __pyx_L1_error)
6943 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
6944 __pyx_v_nodeMaterialTypes = __pyx_t_11;
6945 __pyx_t_11.memview = NULL;
6946 __pyx_t_11.data = NULL;
6955 __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_pc, __pyx_n_s_mesh);
if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 243, __pyx_L1_error)
6956 __Pyx_GOTREF(__pyx_t_8);
6957 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_elementBarycentersArray);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 243, __pyx_L1_error)
6958 __Pyx_GOTREF(__pyx_t_1);
6959 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
6960 __pyx_t_13 = __Pyx_PyObject_to_MemoryviewSlice_dsds_double(__pyx_t_1, PyBUF_WRITABLE);
if (unlikely(!__pyx_t_13.memview)) __PYX_ERR(0, 243, __pyx_L1_error)
6961 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
6962 __pyx_v_elementBarycentersArray = __pyx_t_13;
6963 __pyx_t_13.memview = NULL;
6964 __pyx_t_13.data = NULL;
6973 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_pc, __pyx_n_s_mesh);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 244, __pyx_L1_error)
6974 __Pyx_GOTREF(__pyx_t_1);
6975 __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_elementBoundaryElementsArray);
if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 244, __pyx_L1_error)
6976 __Pyx_GOTREF(__pyx_t_8);
6977 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
6978 __pyx_t_14 = __Pyx_PyObject_to_MemoryviewSlice_dsds_int(__pyx_t_8, PyBUF_WRITABLE);
if (unlikely(!__pyx_t_14.memview)) __PYX_ERR(0, 244, __pyx_L1_error)
6979 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
6980 __pyx_v_elementBoundaryElementsArray = __pyx_t_14;
6981 __pyx_t_14.memview = NULL;
6982 __pyx_t_14.data = NULL;
6991 __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_pc, __pyx_n_s_mesh);
if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 245, __pyx_L1_error)
6992 __Pyx_GOTREF(__pyx_t_8);
6993 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_elementBoundariesArray);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 245, __pyx_L1_error)
6994 __Pyx_GOTREF(__pyx_t_1);
6995 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
6996 __pyx_t_14 = __Pyx_PyObject_to_MemoryviewSlice_dsds_int(__pyx_t_1, PyBUF_WRITABLE);
if (unlikely(!__pyx_t_14.memview)) __PYX_ERR(0, 245, __pyx_L1_error)
6997 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
6998 __pyx_v_elementBoundariesArray = __pyx_t_14;
6999 __pyx_t_14.memview = NULL;
7000 __pyx_t_14.data = NULL;
7009 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_pc, __pyx_n_s_mesh);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 246, __pyx_L1_error)
7010 __Pyx_GOTREF(__pyx_t_1);
7011 __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_elementNodesArray);
if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 246, __pyx_L1_error)
7012 __Pyx_GOTREF(__pyx_t_8);
7013 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
7014 __pyx_t_14 = __Pyx_PyObject_to_MemoryviewSlice_dsds_int(__pyx_t_8, PyBUF_WRITABLE);
if (unlikely(!__pyx_t_14.memview)) __PYX_ERR(0, 246, __pyx_L1_error)
7015 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
7016 __pyx_v_elementNodesArray = __pyx_t_14;
7017 __pyx_t_14.memview = NULL;
7018 __pyx_t_14.data = NULL;
7027 __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_pc, __pyx_n_s_mesh);
if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 247, __pyx_L1_error)
7028 __Pyx_GOTREF(__pyx_t_8);
7029 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_elementBoundaryBarycentersArray);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 247, __pyx_L1_error)
7030 __Pyx_GOTREF(__pyx_t_1);
7031 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
7032 __pyx_t_13 = __Pyx_PyObject_to_MemoryviewSlice_dsds_double(__pyx_t_1, PyBUF_WRITABLE);
if (unlikely(!__pyx_t_13.memview)) __PYX_ERR(0, 247, __pyx_L1_error)
7033 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
7034 __pyx_v_elementBoundaryBarycentersArray = __pyx_t_13;
7035 __pyx_t_13.memview = NULL;
7036 __pyx_t_13.data = NULL;
7045 __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_np);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 248, __pyx_L1_error)
7046 __Pyx_GOTREF(__pyx_t_1);
7047 __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_zeros);
if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 248, __pyx_L1_error)
7048 __Pyx_GOTREF(__pyx_t_8);
7049 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
7050 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_pc, __pyx_n_s_mesh);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 248, __pyx_L1_error)
7051 __Pyx_GOTREF(__pyx_t_1);
7052 __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_nElementBoundaries_global);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 248, __pyx_L1_error)
7053 __Pyx_GOTREF(__pyx_t_4);
7054 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
7055 __pyx_t_1 = PyTuple_New(1);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 248, __pyx_L1_error)
7056 __Pyx_GOTREF(__pyx_t_1);
7057 __Pyx_GIVEREF(__pyx_t_4);
7058 PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_4);
7060 __pyx_t_4 = __Pyx_PyDict_NewPresized(1);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 248, __pyx_L1_error)
7061 __Pyx_GOTREF(__pyx_t_4);
7062 __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_np);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 248, __pyx_L1_error)
7063 __Pyx_GOTREF(__pyx_t_3);
7064 __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_int32);
if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 248, __pyx_L1_error)
7065 __Pyx_GOTREF(__pyx_t_6);
7066 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
7067 if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_dtype, __pyx_t_6) < 0) __PYX_ERR(0, 248, __pyx_L1_error)
7068 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
7069 __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_8, __pyx_t_1, __pyx_t_4);
if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 248, __pyx_L1_error)
7070 __Pyx_GOTREF(__pyx_t_6);
7071 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
7072 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
7073 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
7074 __pyx_t_11 = __Pyx_PyObject_to_MemoryviewSlice_ds_int(__pyx_t_6, PyBUF_WRITABLE);
if (unlikely(!__pyx_t_11.memview)) __PYX_ERR(0, 248, __pyx_L1_error)
7075 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
7076 __pyx_v_exteriorElementBoundariesBoolArray = __pyx_t_11;
7077 __pyx_t_11.memview = NULL;
7078 __pyx_t_11.data = NULL;
7087 __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_pc, __pyx_n_s_mesh);
if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 250, __pyx_L1_error)
7088 __Pyx_GOTREF(__pyx_t_6);
7089 __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_exteriorElementBoundariesArray);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 250, __pyx_L1_error)
7090 __Pyx_GOTREF(__pyx_t_4);
7091 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
7092 if (likely(PyList_CheckExact(__pyx_t_4)) || PyTuple_CheckExact(__pyx_t_4)) {
7093 __pyx_t_6 = __pyx_t_4; __Pyx_INCREF(__pyx_t_6); __pyx_t_15 = 0;
7096 __pyx_t_15 = -1; __pyx_t_6 = PyObject_GetIter(__pyx_t_4);
if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 250, __pyx_L1_error)
7097 __Pyx_GOTREF(__pyx_t_6);
7098 __pyx_t_16 = Py_TYPE(__pyx_t_6)->tp_iternext;
if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 250, __pyx_L1_error)
7100 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
7102 if (likely(!__pyx_t_16)) {
7103 if (likely(PyList_CheckExact(__pyx_t_6))) {
7104 if (__pyx_t_15 >= PyList_GET_SIZE(__pyx_t_6))
break;
7105 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
7106 __pyx_t_4 = PyList_GET_ITEM(__pyx_t_6, __pyx_t_15); __Pyx_INCREF(__pyx_t_4); __pyx_t_15++;
if (unlikely(0 < 0)) __PYX_ERR(0, 250, __pyx_L1_error)
7108 __pyx_t_4 = PySequence_ITEM(__pyx_t_6, __pyx_t_15); __pyx_t_15++;
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 250, __pyx_L1_error)
7109 __Pyx_GOTREF(__pyx_t_4);
7112 if (__pyx_t_15 >= PyTuple_GET_SIZE(__pyx_t_6))
break;
7113 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
7114 __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_6, __pyx_t_15); __Pyx_INCREF(__pyx_t_4); __pyx_t_15++;
if (unlikely(0 < 0)) __PYX_ERR(0, 250, __pyx_L1_error)
7116 __pyx_t_4 = PySequence_ITEM(__pyx_t_6, __pyx_t_15); __pyx_t_15++;
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 250, __pyx_L1_error)
7117 __Pyx_GOTREF(__pyx_t_4);
7121 __pyx_t_4 = __pyx_t_16(__pyx_t_6);
7122 if (unlikely(!__pyx_t_4)) {
7123 PyObject* exc_type = PyErr_Occurred();
7125 if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
7126 else __PYX_ERR(0, 250, __pyx_L1_error)
7130 __Pyx_GOTREF(__pyx_t_4);
7132 __pyx_t_2 = __Pyx_PyInt_As_int(__pyx_t_4);
if (unlikely((__pyx_t_2 == (
int)-1) && PyErr_Occurred())) __PYX_ERR(0, 250, __pyx_L1_error)
7133 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
7134 __pyx_v_bb_i = __pyx_t_2;
7143 __pyx_t_17 = __pyx_v_bb_i;
7144 if (__pyx_t_17 < 0) __pyx_t_17 += __pyx_v_exteriorElementBoundariesBoolArray.shape[0];
7145 *((
int *) ( (__pyx_v_exteriorElementBoundariesBoolArray.data + __pyx_t_17 * __pyx_v_exteriorElementBoundariesBoolArray.strides[0]) )) = 1;
7155 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
7164 __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_pc, __pyx_n_s_mesh);
if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 252, __pyx_L1_error)
7165 __Pyx_GOTREF(__pyx_t_6);
7166 __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_elementBoundaryNormalsArray);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 252, __pyx_L1_error)
7167 __Pyx_GOTREF(__pyx_t_4);
7168 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
7169 __pyx_t_18 = __Pyx_PyObject_to_MemoryviewSlice_dsdsds_double(__pyx_t_4, PyBUF_WRITABLE);
if (unlikely(!__pyx_t_18.memview)) __PYX_ERR(0, 252, __pyx_L1_error)
7170 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
7171 __pyx_v_elementBoundaryNormalsArray = __pyx_t_18;
7172 __pyx_t_18.memview = NULL;
7173 __pyx_t_18.data = NULL;
7182 __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_pc, __pyx_n_s_mesh);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 253, __pyx_L1_error)
7183 __Pyx_GOTREF(__pyx_t_4);
7184 __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_nNodes_owned);
if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 253, __pyx_L1_error)
7185 __Pyx_GOTREF(__pyx_t_6);
7186 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
7187 __pyx_t_2 = __Pyx_PyInt_As_int(__pyx_t_6);
if (unlikely((__pyx_t_2 == (
int)-1) && PyErr_Occurred())) __PYX_ERR(0, 253, __pyx_L1_error)
7188 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
7189 __pyx_v_nNodes_owned = __pyx_t_2;
7198 __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_pc, __pyx_n_s_mesh);
if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 254, __pyx_L1_error)
7199 __Pyx_GOTREF(__pyx_t_6);
7200 __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_nNodes_global);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 254, __pyx_L1_error)
7201 __Pyx_GOTREF(__pyx_t_4);
7202 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
7203 __pyx_t_2 = __Pyx_PyInt_As_int(__pyx_t_4);
if (unlikely((__pyx_t_2 == (
int)-1) && PyErr_Occurred())) __PYX_ERR(0, 254, __pyx_L1_error)
7204 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
7205 __pyx_v_nNodes_global = __pyx_t_2;
7214 __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_pc, __pyx_n_s_mesh);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 255, __pyx_L1_error)
7215 __Pyx_GOTREF(__pyx_t_4);
7216 __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_nElements_owned);
if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 255, __pyx_L1_error)
7217 __Pyx_GOTREF(__pyx_t_6);
7218 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
7219 __pyx_t_2 = __Pyx_PyInt_As_int(__pyx_t_6);
if (unlikely((__pyx_t_2 == (
int)-1) && PyErr_Occurred())) __PYX_ERR(0, 255, __pyx_L1_error)
7220 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
7221 __pyx_v_nElements_owned = __pyx_t_2;
7230 __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_pc, __pyx_n_s_mesh);
if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 256, __pyx_L1_error)
7231 __Pyx_GOTREF(__pyx_t_6);
7232 __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_nElements_global);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 256, __pyx_L1_error)
7233 __Pyx_GOTREF(__pyx_t_4);
7234 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
7235 __pyx_t_2 = __Pyx_PyInt_As_int(__pyx_t_4);
if (unlikely((__pyx_t_2 == (
int)-1) && PyErr_Occurred())) __PYX_ERR(0, 256, __pyx_L1_error)
7236 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
7237 __pyx_v_nElements_global = __pyx_t_2;
7246 __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_pc, __pyx_n_s_mesh);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 257, __pyx_L1_error)
7247 __Pyx_GOTREF(__pyx_t_4);
7248 __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_globalMesh);
if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 257, __pyx_L1_error)
7249 __Pyx_GOTREF(__pyx_t_6);
7250 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
7251 __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_nodeNumbering_subdomain2global);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 257, __pyx_L1_error)
7252 __Pyx_GOTREF(__pyx_t_4);
7253 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
7254 __pyx_t_11 = __Pyx_PyObject_to_MemoryviewSlice_ds_int(__pyx_t_4, PyBUF_WRITABLE);
if (unlikely(!__pyx_t_11.memview)) __PYX_ERR(0, 257, __pyx_L1_error)
7255 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
7256 __pyx_v_nodeNumbering_subdomain2global = __pyx_t_11;
7257 __pyx_t_11.memview = NULL;
7258 __pyx_t_11.data = NULL;
7267 __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_pc, __pyx_n_s_mesh);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 258, __pyx_L1_error)
7268 __Pyx_GOTREF(__pyx_t_4);
7269 __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_globalMesh);
if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 258, __pyx_L1_error)
7270 __Pyx_GOTREF(__pyx_t_6);
7271 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
7272 __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_elementNumbering_subdomain2globa);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 258, __pyx_L1_error)
7273 __Pyx_GOTREF(__pyx_t_4);
7274 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
7275 __pyx_t_11 = __Pyx_PyObject_to_MemoryviewSlice_ds_int(__pyx_t_4, PyBUF_WRITABLE);
if (unlikely(!__pyx_t_11.memview)) __PYX_ERR(0, 258, __pyx_L1_error)
7276 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
7277 __pyx_v_elementNumbering_subdomain2global = __pyx_t_11;
7278 __pyx_t_11.memview = NULL;
7279 __pyx_t_11.data = NULL;
7288 __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_pc, __pyx_n_s_mesh);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 259, __pyx_L1_error)
7289 __Pyx_GOTREF(__pyx_t_4);
7290 __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_globalMesh);
if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 259, __pyx_L1_error)
7291 __Pyx_GOTREF(__pyx_t_6);
7292 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
7293 __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_nodeOffsets_subdomain_owned);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 259, __pyx_L1_error)
7294 __Pyx_GOTREF(__pyx_t_4);
7295 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
7296 __pyx_t_11 = __Pyx_PyObject_to_MemoryviewSlice_ds_int(__pyx_t_4, PyBUF_WRITABLE);
if (unlikely(!__pyx_t_11.memview)) __PYX_ERR(0, 259, __pyx_L1_error)
7297 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
7298 __pyx_v_nodeOffsets_subdomain_owned = __pyx_t_11;
7299 __pyx_t_11.memview = NULL;
7300 __pyx_t_11.data = NULL;
7309 __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_pc, __pyx_n_s_mesh);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 260, __pyx_L1_error)
7310 __Pyx_GOTREF(__pyx_t_4);
7311 __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_globalMesh);
if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 260, __pyx_L1_error)
7312 __Pyx_GOTREF(__pyx_t_6);
7313 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
7314 __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_elementOffsets_subdomain_owned);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 260, __pyx_L1_error)
7315 __Pyx_GOTREF(__pyx_t_4);
7316 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
7317 __pyx_t_11 = __Pyx_PyObject_to_MemoryviewSlice_ds_int(__pyx_t_4, PyBUF_WRITABLE);
if (unlikely(!__pyx_t_11.memview)) __PYX_ERR(0, 260, __pyx_L1_error)
7318 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
7319 __pyx_v_elementOffsets_subdomain_owned = __pyx_t_11;
7320 __pyx_t_11.memview = NULL;
7321 __pyx_t_11.data = NULL;
7330 __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_np);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 261, __pyx_L1_error)
7331 __Pyx_GOTREF(__pyx_t_4);
7332 __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_array);
if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 261, __pyx_L1_error)
7333 __Pyx_GOTREF(__pyx_t_6);
7334 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
7335 __pyx_t_4 = PyList_New(0);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 261, __pyx_L1_error)
7336 __Pyx_GOTREF(__pyx_t_4);
7337 __pyx_t_10 = __Pyx_MemoryView_Len(__pyx_v_xx);
7338 __pyx_t_15 = __pyx_t_10;
7339 for (__pyx_t_2 = 0; __pyx_t_2 < __pyx_t_15; __pyx_t_2+=1) {
7340 __pyx_v_i = __pyx_t_2;
7341 __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_i);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 261, __pyx_L1_error)
7342 __Pyx_GOTREF(__pyx_t_1);
7343 if (unlikely(__Pyx_ListComp_Append(__pyx_t_4, (PyObject*)__pyx_t_1))) __PYX_ERR(0, 261, __pyx_L1_error)
7344 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
7346 __pyx_t_1 = PyTuple_New(1);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 261, __pyx_L1_error)
7347 __Pyx_GOTREF(__pyx_t_1);
7348 __Pyx_GIVEREF(__pyx_t_4);
7349 PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_4);
7351 __pyx_t_4 = __Pyx_PyDict_NewPresized(1);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 261, __pyx_L1_error)
7352 __Pyx_GOTREF(__pyx_t_4);
7353 __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_n_s_np);
if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 261, __pyx_L1_error)
7354 __Pyx_GOTREF(__pyx_t_8);
7355 __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_int32);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 261, __pyx_L1_error)
7356 __Pyx_GOTREF(__pyx_t_3);
7357 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
7358 if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_dtype, __pyx_t_3) < 0) __PYX_ERR(0, 261, __pyx_L1_error)
7359 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
7360 __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_1, __pyx_t_4);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 261, __pyx_L1_error)
7361 __Pyx_GOTREF(__pyx_t_3);
7362 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
7363 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
7364 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
7365 __pyx_t_11 = __Pyx_PyObject_to_MemoryviewSlice_ds_int(__pyx_t_3, PyBUF_WRITABLE);
if (unlikely(!__pyx_t_11.memview)) __PYX_ERR(0, 261, __pyx_L1_error)
7366 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
7367 __pyx_v_nearestNArray = __pyx_t_11;
7368 __pyx_t_11.memview = NULL;
7369 __pyx_t_11.data = NULL;
7378 __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_np);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 262, __pyx_L1_error)
7379 __Pyx_GOTREF(__pyx_t_3);
7380 __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_zeros);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 262, __pyx_L1_error)
7381 __Pyx_GOTREF(__pyx_t_4);
7382 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
7383 __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_nNodes_global);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 262, __pyx_L1_error)
7384 __Pyx_GOTREF(__pyx_t_3);
7385 __pyx_t_1 = PyTuple_New(1);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 262, __pyx_L1_error)
7386 __Pyx_GOTREF(__pyx_t_1);
7387 __Pyx_GIVEREF(__pyx_t_3);
7388 PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_3);
7390 __pyx_t_3 = __Pyx_PyDict_NewPresized(1);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 262, __pyx_L1_error)
7391 __Pyx_GOTREF(__pyx_t_3);
7392 __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_np);
if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 262, __pyx_L1_error)
7393 __Pyx_GOTREF(__pyx_t_6);
7394 __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_int32);
if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 262, __pyx_L1_error)
7395 __Pyx_GOTREF(__pyx_t_8);
7396 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
7397 if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_dtype, __pyx_t_8) < 0) __PYX_ERR(0, 262, __pyx_L1_error)
7398 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
7399 __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_1, __pyx_t_3);
if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 262, __pyx_L1_error)
7400 __Pyx_GOTREF(__pyx_t_8);
7401 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
7402 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
7403 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
7404 __pyx_t_11 = __Pyx_PyObject_to_MemoryviewSlice_ds_int(__pyx_t_8, PyBUF_WRITABLE);
if (unlikely(!__pyx_t_11.memview)) __PYX_ERR(0, 262, __pyx_L1_error)
7405 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
7406 __pyx_v_typeNArray = __pyx_t_11;
7407 __pyx_t_11.memview = NULL;
7408 __pyx_t_11.data = NULL;
7417 __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_pc, __pyx_n_s_mesh);
if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 263, __pyx_L1_error)
7418 __Pyx_GOTREF(__pyx_t_8);
7419 __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_elementNeighborsArray);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 263, __pyx_L1_error)
7420 __Pyx_GOTREF(__pyx_t_3);
7421 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
7422 __pyx_t_14 = __Pyx_PyObject_to_MemoryviewSlice_dsds_int(__pyx_t_3, PyBUF_WRITABLE);
if (unlikely(!__pyx_t_14.memview)) __PYX_ERR(0, 263, __pyx_L1_error)
7423 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
7424 __pyx_v_elementNeighborsArray = __pyx_t_14;
7425 __pyx_t_14.memview = NULL;
7426 __pyx_t_14.data = NULL;
7435 __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_pc, __pyx_n_s_mesh);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 264, __pyx_L1_error)
7436 __Pyx_GOTREF(__pyx_t_3);
7437 __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_nElementBoundaries_owned);
if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 264, __pyx_L1_error)
7438 __Pyx_GOTREF(__pyx_t_8);
7439 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
7440 __pyx_t_2 = __Pyx_PyInt_As_int(__pyx_t_8);
if (unlikely((__pyx_t_2 == (
int)-1) && PyErr_Occurred())) __PYX_ERR(0, 264, __pyx_L1_error)
7441 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
7442 __pyx_v_nElementBoundaries_owned = __pyx_t_2;
7451 __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_pc, __pyx_n_s_mesh);
if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 265, __pyx_L1_error)
7452 __Pyx_GOTREF(__pyx_t_8);
7453 __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_globalMesh);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 265, __pyx_L1_error)
7454 __Pyx_GOTREF(__pyx_t_3);
7455 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
7456 __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_elementBoundaryNumbering_subdoma);
if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 265, __pyx_L1_error)
7457 __Pyx_GOTREF(__pyx_t_8);
7458 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
7459 __pyx_t_11 = __Pyx_PyObject_to_MemoryviewSlice_ds_int(__pyx_t_8, PyBUF_WRITABLE);
if (unlikely(!__pyx_t_11.memview)) __PYX_ERR(0, 265, __pyx_L1_error)
7460 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
7461 __pyx_v_elementBoundaryNumbering_subdomain2global = __pyx_t_11;
7462 __pyx_t_11.memview = NULL;
7463 __pyx_t_11.data = NULL;
7472 __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_pc, __pyx_n_s_mesh);
if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 266, __pyx_L1_error)
7473 __Pyx_GOTREF(__pyx_t_8);
7474 __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_globalMesh);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 266, __pyx_L1_error)
7475 __Pyx_GOTREF(__pyx_t_3);
7476 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
7477 __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_elementBoundaryOffsets_subdomain);
if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 266, __pyx_L1_error)
7478 __Pyx_GOTREF(__pyx_t_8);
7479 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
7480 __pyx_t_11 = __Pyx_PyObject_to_MemoryviewSlice_ds_int(__pyx_t_8, PyBUF_WRITABLE);
if (unlikely(!__pyx_t_11.memview)) __PYX_ERR(0, 266, __pyx_L1_error)
7481 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
7482 __pyx_v_elementBoundaryOffsets_subdomain_owned = __pyx_t_11;
7483 __pyx_t_11.memview = NULL;
7484 __pyx_t_11.data = NULL;
7493 __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_pc, __pyx_n_s_mesh);
if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 267, __pyx_L1_error)
7494 __Pyx_GOTREF(__pyx_t_8);
7495 __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_elementBoundaryNodesArray);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 267, __pyx_L1_error)
7496 __Pyx_GOTREF(__pyx_t_3);
7497 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
7498 __pyx_t_14 = __Pyx_PyObject_to_MemoryviewSlice_dsds_int(__pyx_t_3, PyBUF_WRITABLE);
if (unlikely(!__pyx_t_14.memview)) __PYX_ERR(0, 267, __pyx_L1_error)
7499 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
7500 __pyx_v_elementBoundaryNodesArray = __pyx_t_14;
7501 __pyx_t_14.memview = NULL;
7502 __pyx_t_14.data = NULL;
7511 __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_pc, __pyx_n_s_mesh);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 268, __pyx_L1_error)
7512 __Pyx_GOTREF(__pyx_t_3);
7513 __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_fixedNodesBoolArray);
if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 268, __pyx_L1_error)
7514 __Pyx_GOTREF(__pyx_t_8);
7515 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
7516 __pyx_t_11 = __Pyx_PyObject_to_MemoryviewSlice_ds_int(__pyx_t_8, PyBUF_WRITABLE);
if (unlikely(!__pyx_t_11.memview)) __PYX_ERR(0, 268, __pyx_L1_error)
7517 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
7518 __pyx_v_fixedNodesBoolArray = __pyx_t_11;
7519 __pyx_t_11.memview = NULL;
7520 __pyx_t_11.data = NULL;
7529 __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_pc, __pyx_n_s_nSmoothOut);
if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 269, __pyx_L1_error)
7530 __Pyx_GOTREF(__pyx_t_8);
7531 __pyx_t_2 = __Pyx_PyInt_As_int(__pyx_t_8);
if (unlikely((__pyx_t_2 == (
int)-1) && PyErr_Occurred())) __PYX_ERR(0, 269, __pyx_L1_error)
7532 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
7533 __pyx_v_nSmoothOut = __pyx_t_2;
7542 __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_pc, __pyx_n_s_nSmoothIn);
if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 270, __pyx_L1_error)
7543 __Pyx_GOTREF(__pyx_t_8);
7544 __pyx_t_2 = __Pyx_PyInt_As_int(__pyx_t_8);
if (unlikely((__pyx_t_2 == (
int)-1) && PyErr_Occurred())) __PYX_ERR(0, 270, __pyx_L1_error)
7545 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
7546 __pyx_v_nSmoothIn = __pyx_t_2;
7555 __pyx_v_nSmooth = 0;
7564 __pyx_v_inside_eN = 0;
7573 __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_np);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 273, __pyx_L1_error)
7574 __Pyx_GOTREF(__pyx_t_3);
7575 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_zeros);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 273, __pyx_L1_error)
7576 __Pyx_GOTREF(__pyx_t_1);
7577 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
7579 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_1))) {
7580 __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_1);
7581 if (likely(__pyx_t_3)) {
7582 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_1);
7583 __Pyx_INCREF(__pyx_t_3);
7584 __Pyx_INCREF(
function);
7585 __Pyx_DECREF_SET(__pyx_t_1,
function);
7588 __pyx_t_8 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_1, __pyx_t_3, __pyx_int_3) : __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_int_3);
7589 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
7590 if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 273, __pyx_L1_error)
7591 __Pyx_GOTREF(__pyx_t_8);
7592 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
7593 __pyx_t_9 = __Pyx_PyObject_to_MemoryviewSlice_ds_double(__pyx_t_8, PyBUF_WRITABLE);
if (unlikely(!__pyx_t_9.memview)) __PYX_ERR(0, 273, __pyx_L1_error)
7594 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
7595 __pyx_v_vec = __pyx_t_9;
7596 __pyx_t_9.memview = NULL;
7597 __pyx_t_9.data = NULL;
7606 __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_np);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 274, __pyx_L1_error)
7607 __Pyx_GOTREF(__pyx_t_1);
7608 __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_zeros);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 274, __pyx_L1_error)
7609 __Pyx_GOTREF(__pyx_t_3);
7610 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
7612 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
7613 __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_3);
7614 if (likely(__pyx_t_1)) {
7615 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_3);
7616 __Pyx_INCREF(__pyx_t_1);
7617 __Pyx_INCREF(
function);
7618 __Pyx_DECREF_SET(__pyx_t_3,
function);
7621 __pyx_t_8 = (__pyx_t_1) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_1, __pyx_int_3) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_int_3);
7622 __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
7623 if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 274, __pyx_L1_error)
7624 __Pyx_GOTREF(__pyx_t_8);
7625 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
7626 __pyx_t_9 = __Pyx_PyObject_to_MemoryviewSlice_ds_double(__pyx_t_8, PyBUF_WRITABLE);
if (unlikely(!__pyx_t_9.memview)) __PYX_ERR(0, 274, __pyx_L1_error)
7627 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
7628 __pyx_v_vec2 = __pyx_t_9;
7629 __pyx_t_9.memview = NULL;
7630 __pyx_t_9.data = NULL;
7639 __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_np);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 276, __pyx_L1_error)
7640 __Pyx_GOTREF(__pyx_t_3);
7641 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_ones);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 276, __pyx_L1_error)
7642 __Pyx_GOTREF(__pyx_t_1);
7643 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
7645 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_1))) {
7646 __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_1);
7647 if (likely(__pyx_t_3)) {
7648 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_1);
7649 __Pyx_INCREF(__pyx_t_3);
7650 __Pyx_INCREF(
function);
7651 __Pyx_DECREF_SET(__pyx_t_1,
function);
7654 __pyx_t_8 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_1, __pyx_t_3, __pyx_int_3) : __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_int_3);
7655 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
7656 if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 276, __pyx_L1_error)
7657 __Pyx_GOTREF(__pyx_t_8);
7658 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
7659 __pyx_t_9 = __Pyx_PyObject_to_MemoryviewSlice_ds_double(__pyx_t_8, PyBUF_WRITABLE);
if (unlikely(!__pyx_t_9.memview)) __PYX_ERR(0, 276, __pyx_L1_error)
7660 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
7661 __pyx_v_fixed_dir = __pyx_t_9;
7662 __pyx_t_9.memview = NULL;
7663 __pyx_t_9.data = NULL;
7672 __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_Comm);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 279, __pyx_L1_error)
7673 __Pyx_GOTREF(__pyx_t_3);
7674 __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_get);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 279, __pyx_L1_error)
7675 __Pyx_GOTREF(__pyx_t_4);
7676 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
7678 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
7679 __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_4);
7680 if (likely(__pyx_t_3)) {
7681 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_4);
7682 __Pyx_INCREF(__pyx_t_3);
7683 __Pyx_INCREF(
function);
7684 __Pyx_DECREF_SET(__pyx_t_4,
function);
7687 __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_4);
7688 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
7689 if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 279, __pyx_L1_error)
7690 __Pyx_GOTREF(__pyx_t_1);
7691 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
7692 __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_comm);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 279, __pyx_L1_error)
7693 __Pyx_GOTREF(__pyx_t_4);
7694 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
7695 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_tompi4py);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 279, __pyx_L1_error)
7696 __Pyx_GOTREF(__pyx_t_1);
7697 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
7699 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_1))) {
7700 __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_1);
7701 if (likely(__pyx_t_4)) {
7702 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_1);
7703 __Pyx_INCREF(__pyx_t_4);
7704 __Pyx_INCREF(
function);
7705 __Pyx_DECREF_SET(__pyx_t_1,
function);
7708 __pyx_t_8 = (__pyx_t_4) ? __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_t_4) : __Pyx_PyObject_CallNoArg(__pyx_t_1);
7709 __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
7710 if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 279, __pyx_L1_error)
7711 __Pyx_GOTREF(__pyx_t_8);
7712 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
7713 __pyx_v_comm = __pyx_t_8;
7723 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_comm, __pyx_n_s_barrier);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 280, __pyx_L1_error)
7724 __Pyx_GOTREF(__pyx_t_1);
7726 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_1))) {
7727 __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_1);
7728 if (likely(__pyx_t_4)) {
7729 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_1);
7730 __Pyx_INCREF(__pyx_t_4);
7731 __Pyx_INCREF(
function);
7732 __Pyx_DECREF_SET(__pyx_t_1,
function);
7735 __pyx_t_8 = (__pyx_t_4) ? __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_t_4) : __Pyx_PyObject_CallNoArg(__pyx_t_1);
7736 __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
7737 if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 280, __pyx_L1_error)
7738 __Pyx_GOTREF(__pyx_t_8);
7739 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
7740 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
7749 __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_comm, __pyx_n_s_rank);
if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 281, __pyx_L1_error)
7750 __Pyx_GOTREF(__pyx_t_8);
7751 __pyx_t_2 = __Pyx_PyInt_As_int(__pyx_t_8);
if (unlikely((__pyx_t_2 == (
int)-1) && PyErr_Occurred())) __PYX_ERR(0, 281, __pyx_L1_error)
7752 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
7753 __pyx_v_my_rank = __pyx_t_2;
7762 __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_comm, __pyx_n_s_size);
if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 282, __pyx_L1_error)
7763 __Pyx_GOTREF(__pyx_t_8);
7764 __pyx_t_2 = __Pyx_PyInt_As_int(__pyx_t_8);
if (unlikely((__pyx_t_2 == (
int)-1) && PyErr_Occurred())) __PYX_ERR(0, 282, __pyx_L1_error)
7765 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
7766 __pyx_cur_scope->__pyx_v_comm_size = __pyx_t_2;
7775 __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_n_s_np);
if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 283, __pyx_L1_error)
7776 __Pyx_GOTREF(__pyx_t_8);
7777 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_zeros);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 283, __pyx_L1_error)
7778 __Pyx_GOTREF(__pyx_t_1);
7779 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
7780 __pyx_t_8 = __Pyx_PyInt_From_int(__pyx_cur_scope->__pyx_v_comm_size);
if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 283, __pyx_L1_error)
7781 __Pyx_GOTREF(__pyx_t_8);
7782 __pyx_t_4 = PyTuple_New(1);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 283, __pyx_L1_error)
7783 __Pyx_GOTREF(__pyx_t_4);
7784 __Pyx_GIVEREF(__pyx_t_8);
7785 PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_8);
7787 __pyx_t_8 = __Pyx_PyDict_NewPresized(1);
if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 283, __pyx_L1_error)
7788 __Pyx_GOTREF(__pyx_t_8);
7789 __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_np);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 283, __pyx_L1_error)
7790 __Pyx_GOTREF(__pyx_t_3);
7791 __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_int32);
if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 283, __pyx_L1_error)
7792 __Pyx_GOTREF(__pyx_t_6);
7793 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
7794 if (PyDict_SetItem(__pyx_t_8, __pyx_n_s_dtype, __pyx_t_6) < 0) __PYX_ERR(0, 283, __pyx_L1_error)
7795 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
7796 __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_4, __pyx_t_8);
if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 283, __pyx_L1_error)
7797 __Pyx_GOTREF(__pyx_t_6);
7798 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
7799 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
7800 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
7801 __pyx_t_11 = __Pyx_PyObject_to_MemoryviewSlice_ds_int(__pyx_t_6, PyBUF_WRITABLE);
if (unlikely(!__pyx_t_11.memview)) __PYX_ERR(0, 283, __pyx_L1_error)
7802 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
7803 __pyx_v_counts_local = __pyx_t_11;
7804 __pyx_t_11.memview = NULL;
7805 __pyx_t_11.data = NULL;
7814 __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_np);
if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 284, __pyx_L1_error)
7815 __Pyx_GOTREF(__pyx_t_6);
7816 __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_zeros);
if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 284, __pyx_L1_error)
7817 __Pyx_GOTREF(__pyx_t_8);
7818 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
7819 __pyx_t_6 = __Pyx_PyInt_From_int(__pyx_cur_scope->__pyx_v_comm_size);
if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 284, __pyx_L1_error)
7820 __Pyx_GOTREF(__pyx_t_6);
7821 __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_cur_scope->__pyx_v_comm_size);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 284, __pyx_L1_error)
7822 __Pyx_GOTREF(__pyx_t_4);
7823 __pyx_t_1 = PyTuple_New(2);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 284, __pyx_L1_error)
7824 __Pyx_GOTREF(__pyx_t_1);
7825 __Pyx_GIVEREF(__pyx_t_6);
7826 PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_6);
7827 __Pyx_GIVEREF(__pyx_t_4);
7828 PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_4);
7831 __pyx_t_4 = PyTuple_New(1);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 284, __pyx_L1_error)
7832 __Pyx_GOTREF(__pyx_t_4);
7833 __Pyx_GIVEREF(__pyx_t_1);
7834 PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_1);
7836 __pyx_t_1 = __Pyx_PyDict_NewPresized(1);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 284, __pyx_L1_error)
7837 __Pyx_GOTREF(__pyx_t_1);
7838 __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_np);
if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 284, __pyx_L1_error)
7839 __Pyx_GOTREF(__pyx_t_6);
7840 __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_int32);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 284, __pyx_L1_error)
7841 __Pyx_GOTREF(__pyx_t_3);
7842 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
7843 if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_dtype, __pyx_t_3) < 0) __PYX_ERR(0, 284, __pyx_L1_error)
7844 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
7845 __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_8, __pyx_t_4, __pyx_t_1);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 284, __pyx_L1_error)
7846 __Pyx_GOTREF(__pyx_t_3);
7847 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
7848 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
7849 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
7850 __pyx_t_14 = __Pyx_PyObject_to_MemoryviewSlice_dsds_int(__pyx_t_3, PyBUF_WRITABLE);
if (unlikely(!__pyx_t_14.memview)) __PYX_ERR(0, 284, __pyx_L1_error)
7851 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
7852 __pyx_v_counts_total = __pyx_t_14;
7853 __pyx_t_14.memview = NULL;
7854 __pyx_t_14.data = NULL;
7863 __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_np);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 287, __pyx_L1_error)
7864 __Pyx_GOTREF(__pyx_t_3);
7865 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_zeros);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 287, __pyx_L1_error)
7866 __Pyx_GOTREF(__pyx_t_1);
7867 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
7868 __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_cur_scope->__pyx_v_comm_size);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 287, __pyx_L1_error)
7869 __Pyx_GOTREF(__pyx_t_3);
7870 __pyx_t_4 = PyTuple_New(1);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 287, __pyx_L1_error)
7871 __Pyx_GOTREF(__pyx_t_4);
7872 __Pyx_GIVEREF(__pyx_t_3);
7873 PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3);
7875 __pyx_t_3 = __Pyx_PyDict_NewPresized(1);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 287, __pyx_L1_error)
7876 __Pyx_GOTREF(__pyx_t_3);
7877 __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_n_s_np);
if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 287, __pyx_L1_error)
7878 __Pyx_GOTREF(__pyx_t_8);
7879 __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_int32);
if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 287, __pyx_L1_error)
7880 __Pyx_GOTREF(__pyx_t_6);
7881 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
7882 if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_dtype, __pyx_t_6) < 0) __PYX_ERR(0, 287, __pyx_L1_error)
7883 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
7884 __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_4, __pyx_t_3);
if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 287, __pyx_L1_error)
7885 __Pyx_GOTREF(__pyx_t_6);
7886 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
7887 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
7888 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
7889 __pyx_t_11 = __Pyx_PyObject_to_MemoryviewSlice_ds_int(__pyx_t_6, PyBUF_WRITABLE);
if (unlikely(!__pyx_t_11.memview)) __PYX_ERR(0, 287, __pyx_L1_error)
7890 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
7891 __pyx_cur_scope->__pyx_v_counts_in = __pyx_t_11;
7892 __pyx_t_11.memview = NULL;
7893 __pyx_t_11.data = NULL;
7902 __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_np);
if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 288, __pyx_L1_error)
7903 __Pyx_GOTREF(__pyx_t_6);
7904 __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_zeros);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 288, __pyx_L1_error)
7905 __Pyx_GOTREF(__pyx_t_3);
7906 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
7907 __pyx_t_6 = __Pyx_PyInt_From_int(__pyx_cur_scope->__pyx_v_comm_size);
if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 288, __pyx_L1_error)
7908 __Pyx_GOTREF(__pyx_t_6);
7909 __pyx_t_4 = PyTuple_New(1);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 288, __pyx_L1_error)
7910 __Pyx_GOTREF(__pyx_t_4);
7911 __Pyx_GIVEREF(__pyx_t_6);
7912 PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_6);
7914 __pyx_t_6 = __Pyx_PyDict_NewPresized(1);
if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 288, __pyx_L1_error)
7915 __Pyx_GOTREF(__pyx_t_6);
7916 __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_np);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 288, __pyx_L1_error)
7917 __Pyx_GOTREF(__pyx_t_1);
7918 __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_int32);
if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 288, __pyx_L1_error)
7919 __Pyx_GOTREF(__pyx_t_8);
7920 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
7921 if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_dtype, __pyx_t_8) < 0) __PYX_ERR(0, 288, __pyx_L1_error)
7922 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
7923 __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_4, __pyx_t_6);
if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 288, __pyx_L1_error)
7924 __Pyx_GOTREF(__pyx_t_8);
7925 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
7926 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
7927 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
7928 __pyx_t_11 = __Pyx_PyObject_to_MemoryviewSlice_ds_int(__pyx_t_8, PyBUF_WRITABLE);
if (unlikely(!__pyx_t_11.memview)) __PYX_ERR(0, 288, __pyx_L1_error)
7929 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
7930 __pyx_cur_scope->__pyx_v_displacements_in = __pyx_t_11;
7931 __pyx_t_11.memview = NULL;
7932 __pyx_t_11.data = NULL;
7941 __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_n_s_np);
if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 290, __pyx_L1_error)
7942 __Pyx_GOTREF(__pyx_t_8);
7943 __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_zeros);
if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 290, __pyx_L1_error)
7944 __Pyx_GOTREF(__pyx_t_6);
7945 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
7946 __pyx_t_8 = __Pyx_PyInt_From_int(__pyx_cur_scope->__pyx_v_comm_size);
if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 290, __pyx_L1_error)
7947 __Pyx_GOTREF(__pyx_t_8);
7948 __pyx_t_4 = PyTuple_New(1);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 290, __pyx_L1_error)
7949 __Pyx_GOTREF(__pyx_t_4);
7950 __Pyx_GIVEREF(__pyx_t_8);
7951 PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_8);
7953 __pyx_t_8 = __Pyx_PyDict_NewPresized(1);
if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 290, __pyx_L1_error)
7954 __Pyx_GOTREF(__pyx_t_8);
7955 __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_np);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 290, __pyx_L1_error)
7956 __Pyx_GOTREF(__pyx_t_3);
7957 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_int32);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 290, __pyx_L1_error)
7958 __Pyx_GOTREF(__pyx_t_1);
7959 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
7960 if (PyDict_SetItem(__pyx_t_8, __pyx_n_s_dtype, __pyx_t_1) < 0) __PYX_ERR(0, 290, __pyx_L1_error)
7961 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
7962 __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_4, __pyx_t_8);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 290, __pyx_L1_error)
7963 __Pyx_GOTREF(__pyx_t_1);
7964 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
7965 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
7966 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
7967 __pyx_t_11 = __Pyx_PyObject_to_MemoryviewSlice_ds_int(__pyx_t_1, PyBUF_WRITABLE);
if (unlikely(!__pyx_t_11.memview)) __PYX_ERR(0, 290, __pyx_L1_error)
7968 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
7969 __pyx_v_counts_out = __pyx_t_11;
7970 __pyx_t_11.memview = NULL;
7971 __pyx_t_11.data = NULL;
7980 __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_np);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 291, __pyx_L1_error)
7981 __Pyx_GOTREF(__pyx_t_1);
7982 __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_zeros);
if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 291, __pyx_L1_error)
7983 __Pyx_GOTREF(__pyx_t_8);
7984 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
7985 __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_cur_scope->__pyx_v_comm_size);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 291, __pyx_L1_error)
7986 __Pyx_GOTREF(__pyx_t_1);
7987 __pyx_t_4 = PyTuple_New(1);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 291, __pyx_L1_error)
7988 __Pyx_GOTREF(__pyx_t_4);
7989 __Pyx_GIVEREF(__pyx_t_1);
7990 PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_1);
7992 __pyx_t_1 = __Pyx_PyDict_NewPresized(1);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 291, __pyx_L1_error)
7993 __Pyx_GOTREF(__pyx_t_1);
7994 __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_np);
if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 291, __pyx_L1_error)
7995 __Pyx_GOTREF(__pyx_t_6);
7996 __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_int32);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 291, __pyx_L1_error)
7997 __Pyx_GOTREF(__pyx_t_3);
7998 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
7999 if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_dtype, __pyx_t_3) < 0) __PYX_ERR(0, 291, __pyx_L1_error)
8000 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
8001 __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_8, __pyx_t_4, __pyx_t_1);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 291, __pyx_L1_error)
8002 __Pyx_GOTREF(__pyx_t_3);
8003 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
8004 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
8005 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
8006 __pyx_t_11 = __Pyx_PyObject_to_MemoryviewSlice_ds_int(__pyx_t_3, PyBUF_WRITABLE);
if (unlikely(!__pyx_t_11.memview)) __PYX_ERR(0, 291, __pyx_L1_error)
8007 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
8008 __pyx_v_displacements_out = __pyx_t_11;
8009 __pyx_t_11.memview = NULL;
8010 __pyx_t_11.data = NULL;
8028 __pyx_t_3 = __Pyx_PyDict_NewPresized(0);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 295, __pyx_L1_error)
8029 __Pyx_GOTREF(__pyx_t_3);
8030 __pyx_v_coords_2rank = ((PyObject*)__pyx_t_3);
8040 __pyx_t_3 = __Pyx_PyDict_NewPresized(0);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 297, __pyx_L1_error)
8041 __Pyx_GOTREF(__pyx_t_3);
8042 __pyx_v_nodes0_2rank = ((PyObject*)__pyx_t_3);
8052 __pyx_t_3 = __Pyx_PyDict_NewPresized(0);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 299, __pyx_L1_error)
8053 __Pyx_GOTREF(__pyx_t_3);
8054 __pyx_v_rank0_2rank = ((PyObject*)__pyx_t_3);
8064 __pyx_t_3 = __Pyx_PyDict_NewPresized(0);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 301, __pyx_L1_error)
8065 __Pyx_GOTREF(__pyx_t_3);
8066 __pyx_v_nearestN_2rank = ((PyObject*)__pyx_t_3);
8076 __pyx_t_3 = __Pyx_PyDict_NewPresized(0);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 303, __pyx_L1_error)
8077 __Pyx_GOTREF(__pyx_t_3);
8078 __pyx_v_typeN_2rank = ((PyObject*)__pyx_t_3);
8088 __pyx_t_3 = __Pyx_PyDict_NewPresized(0);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 305, __pyx_L1_error)
8089 __Pyx_GOTREF(__pyx_t_3);
8090 __pyx_v_dir_2rank = ((PyObject*)__pyx_t_3);
8100 __pyx_t_3 = __Pyx_PyDict_NewPresized(0);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 306, __pyx_L1_error)
8101 __Pyx_GOTREF(__pyx_t_3);
8102 __pyx_v_b_i_2rank = ((PyObject*)__pyx_t_3);
8112 __pyx_v_sendBack = 0;
8121 __pyx_v_nPending_disp = 0;
8130 __pyx_v_nPending_disp_total = 0;
8139 __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_np);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 324, __pyx_L1_error)
8140 __Pyx_GOTREF(__pyx_t_1);
8141 __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_zeros);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 324, __pyx_L1_error)
8142 __Pyx_GOTREF(__pyx_t_4);
8143 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
8145 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
8146 __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_4);
8147 if (likely(__pyx_t_1)) {
8148 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_4);
8149 __Pyx_INCREF(__pyx_t_1);
8150 __Pyx_INCREF(
function);
8151 __Pyx_DECREF_SET(__pyx_t_4,
function);
8154 __pyx_t_3 = (__pyx_t_1) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_1, __pyx_int_3) : __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_int_3);
8155 __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
8156 if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 324, __pyx_L1_error)
8157 __Pyx_GOTREF(__pyx_t_3);
8158 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
8159 __pyx_t_9 = __Pyx_PyObject_to_MemoryviewSlice_ds_double(__pyx_t_3, PyBUF_WRITABLE);
if (unlikely(!__pyx_t_9.memview)) __PYX_ERR(0, 324, __pyx_L1_error)
8160 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
8161 __pyx_v_coords = __pyx_t_9;
8162 __pyx_t_9.memview = NULL;
8163 __pyx_t_9.data = NULL;
8172 __pyx_v_array_size_local = 0.0;
8181 __pyx_t_19 = ((__pyx_cur_scope->__pyx_v_comm_size > 1) != 0);
8191 __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_cur_scope->__pyx_v_comm_size);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 332, __pyx_L1_error)
8192 __Pyx_GOTREF(__pyx_t_3);
8193 __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_builtin_range, __pyx_t_3);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 332, __pyx_L1_error)
8194 __Pyx_GOTREF(__pyx_t_4);
8195 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
8196 if (likely(PyList_CheckExact(__pyx_t_4)) || PyTuple_CheckExact(__pyx_t_4)) {
8197 __pyx_t_3 = __pyx_t_4; __Pyx_INCREF(__pyx_t_3); __pyx_t_15 = 0;
8200 __pyx_t_15 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_t_4);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 332, __pyx_L1_error)
8201 __Pyx_GOTREF(__pyx_t_3);
8202 __pyx_t_16 = Py_TYPE(__pyx_t_3)->tp_iternext;
if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 332, __pyx_L1_error)
8204 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
8206 if (likely(!__pyx_t_16)) {
8207 if (likely(PyList_CheckExact(__pyx_t_3))) {
8208 if (__pyx_t_15 >= PyList_GET_SIZE(__pyx_t_3))
break;
8209 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
8210 __pyx_t_4 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_15); __Pyx_INCREF(__pyx_t_4); __pyx_t_15++;
if (unlikely(0 < 0)) __PYX_ERR(0, 332, __pyx_L1_error)
8212 __pyx_t_4 = PySequence_ITEM(__pyx_t_3, __pyx_t_15); __pyx_t_15++;
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 332, __pyx_L1_error)
8213 __Pyx_GOTREF(__pyx_t_4);
8216 if (__pyx_t_15 >= PyTuple_GET_SIZE(__pyx_t_3))
break;
8217 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
8218 __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_15); __Pyx_INCREF(__pyx_t_4); __pyx_t_15++;
if (unlikely(0 < 0)) __PYX_ERR(0, 332, __pyx_L1_error)
8220 __pyx_t_4 = PySequence_ITEM(__pyx_t_3, __pyx_t_15); __pyx_t_15++;
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 332, __pyx_L1_error)
8221 __Pyx_GOTREF(__pyx_t_4);
8225 __pyx_t_4 = __pyx_t_16(__pyx_t_3);
8226 if (unlikely(!__pyx_t_4)) {
8227 PyObject* exc_type = PyErr_Occurred();
8229 if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
8230 else __PYX_ERR(0, 332, __pyx_L1_error)
8234 __Pyx_GOTREF(__pyx_t_4);
8236 __Pyx_XDECREF_SET(__pyx_v_rank, __pyx_t_4);
8246 __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_np);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 351, __pyx_L1_error)
8247 __Pyx_GOTREF(__pyx_t_1);
8248 __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_zeros);
if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 351, __pyx_L1_error)
8249 __Pyx_GOTREF(__pyx_t_8);
8250 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
8252 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_8))) {
8253 __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_8);
8254 if (likely(__pyx_t_1)) {
8255 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_8);
8256 __Pyx_INCREF(__pyx_t_1);
8257 __Pyx_INCREF(
function);
8258 __Pyx_DECREF_SET(__pyx_t_8,
function);
8261 __pyx_t_4 = (__pyx_t_1) ? __Pyx_PyObject_Call2Args(__pyx_t_8, __pyx_t_1, __pyx_tuple__5) : __Pyx_PyObject_CallOneArg(__pyx_t_8, __pyx_tuple__5);
8262 __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
8263 if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 351, __pyx_L1_error)
8264 __Pyx_GOTREF(__pyx_t_4);
8265 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
8266 if (unlikely(PyDict_SetItem(__pyx_v_coords_2rank, __pyx_v_rank, __pyx_t_4) < 0)) __PYX_ERR(0, 351, __pyx_L1_error)
8267 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
8277 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
8295 __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_np);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 352, __pyx_L1_error)
8296 __Pyx_GOTREF(__pyx_t_4);
8297 __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_zeros);
if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 352, __pyx_L1_error)
8298 __Pyx_GOTREF(__pyx_t_8);
8299 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
8301 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_8))) {
8302 __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_8);
8303 if (likely(__pyx_t_4)) {
8304 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_8);
8305 __Pyx_INCREF(__pyx_t_4);
8306 __Pyx_INCREF(
function);
8307 __Pyx_DECREF_SET(__pyx_t_8,
function);
8310 __pyx_t_3 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_8, __pyx_t_4, __pyx_tuple__5) : __Pyx_PyObject_CallOneArg(__pyx_t_8, __pyx_tuple__5);
8311 __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
8312 if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 352, __pyx_L1_error)
8313 __Pyx_GOTREF(__pyx_t_3);
8314 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
8315 __pyx_t_13 = __Pyx_PyObject_to_MemoryviewSlice_dsds_double(__pyx_t_3, PyBUF_WRITABLE);
if (unlikely(!__pyx_t_13.memview)) __PYX_ERR(0, 352, __pyx_L1_error)
8316 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
8317 __pyx_cur_scope->__pyx_v_coords_2doArray = __pyx_t_13;
8318 __pyx_t_13.memview = NULL;
8319 __pyx_t_13.data = NULL;
8328 __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_n_s_np);
if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 355, __pyx_L1_error)
8329 __Pyx_GOTREF(__pyx_t_8);
8330 __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_zeros);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 355, __pyx_L1_error)
8331 __Pyx_GOTREF(__pyx_t_4);
8332 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
8333 __pyx_t_10 = __Pyx_MemoryView_Len(__pyx_v_xx);
8334 __pyx_t_8 = __Pyx_PyInt_FromSize_t(__pyx_t_10);
if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 355, __pyx_L1_error)
8335 __Pyx_GOTREF(__pyx_t_8);
8337 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
8338 __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_4);
8339 if (likely(__pyx_t_1)) {
8340 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_4);
8341 __Pyx_INCREF(__pyx_t_1);
8342 __Pyx_INCREF(
function);
8343 __Pyx_DECREF_SET(__pyx_t_4,
function);
8346 __pyx_t_3 = (__pyx_t_1) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_1, __pyx_t_8) : __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_8);
8347 __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
8348 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
8349 if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 355, __pyx_L1_error)
8350 __Pyx_GOTREF(__pyx_t_3);
8351 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
8352 __pyx_t_9 = __Pyx_PyObject_to_MemoryviewSlice_ds_double(__pyx_t_3, PyBUF_WRITABLE);
if (unlikely(!__pyx_t_9.memview)) __PYX_ERR(0, 355, __pyx_L1_error)
8353 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
8354 __pyx_v_nodesSentBoolArray = __pyx_t_9;
8355 __pyx_t_9.memview = NULL;
8356 __pyx_t_9.data = NULL;
8365 __pyx_v_pending = 0;
8374 __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_np);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 357, __pyx_L1_error)
8375 __Pyx_GOTREF(__pyx_t_4);
8376 __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_zeros);
if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 357, __pyx_L1_error)
8377 __Pyx_GOTREF(__pyx_t_8);
8378 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
8380 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_8))) {
8381 __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_8);
8382 if (likely(__pyx_t_4)) {
8383 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_8);
8384 __Pyx_INCREF(__pyx_t_4);
8385 __Pyx_INCREF(
function);
8386 __Pyx_DECREF_SET(__pyx_t_8,
function);
8389 __pyx_t_3 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_8, __pyx_t_4, __pyx_int_3) : __Pyx_PyObject_CallOneArg(__pyx_t_8, __pyx_int_3);
8390 __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
8391 if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 357, __pyx_L1_error)
8392 __Pyx_GOTREF(__pyx_t_3);
8393 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
8394 __pyx_t_9 = __Pyx_PyObject_to_MemoryviewSlice_ds_double(__pyx_t_3, PyBUF_WRITABLE);
if (unlikely(!__pyx_t_9.memview)) __PYX_ERR(0, 357, __pyx_L1_error)
8395 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
8396 __pyx_v_starting_coords = __pyx_t_9;
8397 __pyx_t_9.memview = NULL;
8398 __pyx_t_9.data = NULL;
8407 switch (__pyx_v_nd) {
8456 switch (__pyx_v_nd) {
8505 __pyx_t_2 = __pyx_v_ntimesteps;
8506 __pyx_t_20 = __pyx_t_2;
8507 for (__pyx_t_21 = 0; __pyx_t_21 < __pyx_t_20; __pyx_t_21+=1) {
8508 __pyx_v_i_time = __pyx_t_21;
8517 __pyx_t_17 = __pyx_v_i_time;
8518 if (__pyx_t_17 < 0) __pyx_t_17 += __pyx_v_t_range.shape[0];
8519 __pyx_v_t = (*((
double *) ( (__pyx_v_t_range.data + __pyx_t_17 * __pyx_v_t_range.strides[0]) )));
8528 __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_logEvent);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 371, __pyx_L1_error)
8529 __Pyx_GOTREF(__pyx_t_3);
8530 __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_kp_s_Pseudo_time_stepping_t_t, __pyx_n_s_format);
if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 371, __pyx_L1_error)
8531 __Pyx_GOTREF(__pyx_t_8);
8532 __pyx_t_4 = __Pyx_PyDict_NewPresized(1);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 371, __pyx_L1_error)
8533 __Pyx_GOTREF(__pyx_t_4);
8534 __pyx_t_1 = PyFloat_FromDouble(__pyx_v_t);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 371, __pyx_L1_error)
8535 __Pyx_GOTREF(__pyx_t_1);
8536 if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_t, __pyx_t_1) < 0) __PYX_ERR(0, 371, __pyx_L1_error)
8537 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
8538 __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_8, __pyx_empty_tuple, __pyx_t_4);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 371, __pyx_L1_error)
8539 __Pyx_GOTREF(__pyx_t_1);
8540 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
8541 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
8542 __pyx_t_4 = PyTuple_New(1);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 371, __pyx_L1_error)
8543 __Pyx_GOTREF(__pyx_t_4);
8544 __Pyx_GIVEREF(__pyx_t_1);
8545 PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_1);
8547 __pyx_t_1 = __Pyx_PyDict_NewPresized(1);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 371, __pyx_L1_error)
8548 __Pyx_GOTREF(__pyx_t_1);
8549 if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_level, __pyx_int_3) < 0) __PYX_ERR(0, 371, __pyx_L1_error)
8550 __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_4, __pyx_t_1);
if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 371, __pyx_L1_error)
8551 __Pyx_GOTREF(__pyx_t_8);
8552 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
8553 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
8554 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
8555 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
8564 __pyx_v_nPending_disp = 0;
8573 __pyx_v_dt = (__pyx_v_t - __pyx_v_t_last);
8582 __pyx_v_t_last = __pyx_v_t;
8591 __pyx_t_22 = __pyx_v_nNodes_owned;
8592 __pyx_t_23 = __pyx_t_22;
8593 for (__pyx_t_24 = 0; __pyx_t_24 < __pyx_t_23; __pyx_t_24+=1) {
8594 __pyx_v_node = __pyx_t_24;
8603 __pyx_v_new_rank = __pyx_v_my_rank;
8612 __pyx_t_17 = __pyx_v_node;
8614 if (__pyx_t_17 < 0) __pyx_t_17 += __pyx_v_xx.shape[0];
8615 if (__pyx_t_25 < 0) __pyx_t_25 += __pyx_v_xx.shape[1];
8617 if (__pyx_t_26 < 0) __pyx_t_26 += __pyx_v_coords.shape[0];
8618 *((
double *) ( (__pyx_v_coords.data + __pyx_t_26 * __pyx_v_coords.strides[0]) )) = (*((
double *) ( (( (__pyx_v_xx.data + __pyx_t_17 * __pyx_v_xx.strides[0]) ) + __pyx_t_25 * __pyx_v_xx.strides[1]) )));
8627 __pyx_t_25 = __pyx_v_node;
8629 if (__pyx_t_25 < 0) __pyx_t_25 += __pyx_v_xx.shape[0];
8630 if (__pyx_t_17 < 0) __pyx_t_17 += __pyx_v_xx.shape[1];
8632 if (__pyx_t_26 < 0) __pyx_t_26 += __pyx_v_coords.shape[0];
8633 *((
double *) ( (__pyx_v_coords.data + __pyx_t_26 * __pyx_v_coords.strides[0]) )) = (*((
double *) ( (( (__pyx_v_xx.data + __pyx_t_25 * __pyx_v_xx.strides[0]) ) + __pyx_t_17 * __pyx_v_xx.strides[1]) )));
8642 __pyx_t_17 = __pyx_v_node;
8644 if (__pyx_t_17 < 0) __pyx_t_17 += __pyx_v_xx.shape[0];
8645 if (__pyx_t_25 < 0) __pyx_t_25 += __pyx_v_xx.shape[1];
8647 if (__pyx_t_26 < 0) __pyx_t_26 += __pyx_v_coords.shape[0];
8648 *((
double *) ( (__pyx_v_coords.data + __pyx_t_26 * __pyx_v_coords.strides[0]) )) = (*((
double *) ( (( (__pyx_v_xx.data + __pyx_t_17 * __pyx_v_xx.strides[0]) ) + __pyx_t_25 * __pyx_v_xx.strides[1]) )));
8666 __pyx_v_pending = 0;
8684 __pyx_t_25 = __pyx_v_node;
8685 if (__pyx_t_25 < 0) __pyx_t_25 += __pyx_v_nodeMaterialTypes.shape[0];
8686 __pyx_v_flag = (*((
int *) ( (__pyx_v_nodeMaterialTypes.data + __pyx_t_25 * __pyx_v_nodeMaterialTypes.strides[0]) )));
8696 if (__pyx_t_25 < 0) __pyx_t_25 += __pyx_v_fixed_dir.shape[0];
8697 *((
double *) ( (__pyx_v_fixed_dir.data + __pyx_t_25 * __pyx_v_fixed_dir.strides[0]) )) = 1.;
8707 if (__pyx_t_25 < 0) __pyx_t_25 += __pyx_v_fixed_dir.shape[0];
8708 *((
double *) ( (__pyx_v_fixed_dir.data + __pyx_t_25 * __pyx_v_fixed_dir.strides[0]) )) = 1.;
8718 if (__pyx_t_25 < 0) __pyx_t_25 += __pyx_v_fixed_dir.shape[0];
8719 *((
double *) ( (__pyx_v_fixed_dir.data + __pyx_t_25 * __pyx_v_fixed_dir.strides[0]) )) = 1.;
8728 __pyx_v_b_i_global = -1;
8737 __pyx_t_25 = __pyx_v_node;
8738 if (__pyx_t_25 < 0) __pyx_t_25 += __pyx_v_nearestNArray.shape[0];
8739 __pyx_v_nearestN = (*((
int *) ( (__pyx_v_nearestNArray.data + __pyx_t_25 * __pyx_v_nearestNArray.strides[0]) )));
8748 __pyx_t_25 = __pyx_v_node;
8749 if (__pyx_t_25 < 0) __pyx_t_25 += __pyx_v_typeNArray.shape[0];
8750 __pyx_v_typeN = (*((
int *) ( (__pyx_v_typeNArray.data + __pyx_t_25 * __pyx_v_typeNArray.strides[0]) )));
8759 __pyx_t_27 = __pyx_v_nd;
8760 __pyx_t_28 = __pyx_t_27;
8761 for (__pyx_t_29 = 0; __pyx_t_29 < __pyx_t_28; __pyx_t_29+=1) {
8762 __pyx_v_ndi = __pyx_t_29;
8771 __pyx_t_25 = __pyx_v_ndi;
8772 if (__pyx_t_25 < 0) __pyx_t_25 += __pyx_v_v_grad.shape[0];
8773 *((
double *) ( (__pyx_v_v_grad.data + __pyx_t_25 * __pyx_v_v_grad.strides[0]) )) = 0.;
8782 __pyx_t_25 = __pyx_v_ndi;
8783 if (__pyx_t_25 < 0) __pyx_t_25 += __pyx_v_dphi.shape[0];
8784 *((
double *) ( (__pyx_v_dphi.data + __pyx_t_25 * __pyx_v_dphi.strides[0]) )) = 0.;
8794 __pyx_t_25 = __pyx_v_node;
8795 if (__pyx_t_25 < 0) __pyx_t_25 += __pyx_v_nodesSentBoolArray.shape[0];
8796 __pyx_t_19 = (((*((
double *) ( (__pyx_v_nodesSentBoolArray.data + __pyx_t_25 * __pyx_v_nodesSentBoolArray.strides[0]) ))) == 1.0) != 0);
8806 __pyx_v_pending = 1;
8815 __pyx_v_nPending_disp = (__pyx_v_nPending_disp + 1);
8834 __pyx_t_25 = __pyx_v_node;
8835 if (__pyx_t_25 < 0) __pyx_t_25 += __pyx_v_nodesSentBoolArray.shape[0];
8836 __pyx_t_19 = (((*((
double *) ( (__pyx_v_nodesSentBoolArray.data + __pyx_t_25 * __pyx_v_nodesSentBoolArray.strides[0]) ))) == 0.0) != 0);
8846 __pyx_t_19 = ((__pyx_v_flag != 0) != 0);
8856 __pyx_t_25 = __pyx_v_node;
8857 if (__pyx_t_25 < 0) __pyx_t_25 += __pyx_v_fixedNodesBoolArray.shape[0];
8858 __pyx_t_19 = (((*((
int *) ( (__pyx_v_fixedNodesBoolArray.data + __pyx_t_25 * __pyx_v_fixedNodesBoolArray.strides[0]) ))) == 1) != 0);
8896 __pyx_f_7proteus_6mprans_13MeshSmoothing_cyFindBoundaryDirectionTriangle(__pyx_v_fixed_dir, __pyx_v_node, __pyx_v_nodeArray, __pyx_v_nodeStarOffsets, __pyx_v_nodeStarArray, __pyx_v_nodeMaterialTypes);
8916 __pyx_t_19 = ((!(__pyx_v_fixed != 0)) != 0);
8927 if (__pyx_t_25 < 0) __pyx_t_25 += __pyx_v_coords.shape[0];
8928 __pyx_t_17 = __pyx_v_node;
8930 if (__pyx_t_17 < 0) __pyx_t_17 += __pyx_v_nodeArray.shape[0];
8931 if (__pyx_t_26 < 0) __pyx_t_26 += __pyx_v_nodeArray.shape[1];
8932 __pyx_t_30 = (((*((
double *) ( (__pyx_v_coords.data + __pyx_t_25 * __pyx_v_coords.strides[0]) ))) == (*((
double *) ( (( (__pyx_v_nodeArray.data + __pyx_t_17 * __pyx_v_nodeArray.strides[0]) ) + __pyx_t_26 * __pyx_v_nodeArray.strides[1]) )))) != 0);
8935 __pyx_t_19 = __pyx_t_30;
8936 goto __pyx_L21_bool_binop_done;
8939 if (__pyx_t_26 < 0) __pyx_t_26 += __pyx_v_coords.shape[0];
8940 __pyx_t_17 = __pyx_v_node;
8942 if (__pyx_t_17 < 0) __pyx_t_17 += __pyx_v_nodeArray.shape[0];
8943 if (__pyx_t_25 < 0) __pyx_t_25 += __pyx_v_nodeArray.shape[1];
8944 __pyx_t_30 = (((*((
double *) ( (__pyx_v_coords.data + __pyx_t_26 * __pyx_v_coords.strides[0]) ))) == (*((
double *) ( (( (__pyx_v_nodeArray.data + __pyx_t_17 * __pyx_v_nodeArray.strides[0]) ) + __pyx_t_25 * __pyx_v_nodeArray.strides[1]) )))) != 0);
8947 __pyx_t_19 = __pyx_t_30;
8948 goto __pyx_L21_bool_binop_done;
8951 if (__pyx_t_25 < 0) __pyx_t_25 += __pyx_v_coords.shape[0];
8952 __pyx_t_17 = __pyx_v_node;
8954 if (__pyx_t_17 < 0) __pyx_t_17 += __pyx_v_nodeArray.shape[0];
8955 if (__pyx_t_26 < 0) __pyx_t_26 += __pyx_v_nodeArray.shape[1];
8956 __pyx_t_30 = (((*((
double *) ( (__pyx_v_coords.data + __pyx_t_25 * __pyx_v_coords.strides[0]) ))) == (*((
double *) ( (( (__pyx_v_nodeArray.data + __pyx_t_17 * __pyx_v_nodeArray.strides[0]) ) + __pyx_t_26 * __pyx_v_nodeArray.strides[1]) )))) != 0);
8957 __pyx_t_19 = __pyx_t_30;
8958 __pyx_L21_bool_binop_done:;
8968 __pyx_t_27 = __pyx_v_nd;
8969 __pyx_t_28 = __pyx_t_27;
8970 for (__pyx_t_29 = 0; __pyx_t_29 < __pyx_t_28; __pyx_t_29+=1) {
8971 __pyx_v_ndi = __pyx_t_29;
8980 __pyx_t_26 = __pyx_v_node;
8981 __pyx_t_17 = __pyx_v_ndi;
8982 if (__pyx_t_26 < 0) __pyx_t_26 += __pyx_v_grads.shape[0];
8983 if (__pyx_t_17 < 0) __pyx_t_17 += __pyx_v_grads.shape[1];
8984 __pyx_t_25 = __pyx_v_ndi;
8985 if (__pyx_t_25 < 0) __pyx_t_25 += __pyx_v_v_grad.shape[0];
8986 *((
double *) ( (__pyx_v_v_grad.data + __pyx_t_25 * __pyx_v_v_grad.strides[0]) )) = (*((
double *) ( (( (__pyx_v_grads.data + __pyx_t_26 * __pyx_v_grads.strides[0]) ) + __pyx_t_17 * __pyx_v_grads.strides[1]) )));
8996 __pyx_t_17 = __pyx_v_node;
8997 if (__pyx_t_17 < 0) __pyx_t_17 += __pyx_v_areas_nodes.shape[0];
8998 __pyx_v_area = (*((
double *) ( (__pyx_v_areas_nodes.data + __pyx_t_17 * __pyx_v_areas_nodes.strides[0]) )));
9016 __pyx_t_17 = __pyx_v_node;
9017 if (__pyx_t_17 < 0) __pyx_t_17 += __pyx_v_eN_phi.shape[0];
9018 *((
int *) ( (__pyx_v_eN_phi.data + __pyx_t_17 * __pyx_v_eN_phi.strides[0]) )) = __pyx_v_eN;
9027 __pyx_t_19 = ((((PyObject *) __pyx_v_u_phi.memview) != Py_None) != 0);
9037 __pyx_t_17 = __pyx_v_node;
9038 if (__pyx_t_17 < 0) __pyx_t_17 += __pyx_v_u_phi.shape[0];
9039 __pyx_v_ls_phi = (*((
double *) ( (__pyx_v_u_phi.data + __pyx_t_17 * __pyx_v_u_phi.strides[0]) )));
9059 __pyx_v_ls_phi = 1e12;
9070 __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_pc, __pyx_n_s_evaluateFunAtX);
if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 423, __pyx_L1_error)
9071 __Pyx_GOTREF(__pyx_t_8);
9072 __pyx_t_1 = __Pyx_PyDict_NewPresized(2);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 423, __pyx_L1_error)
9073 __Pyx_GOTREF(__pyx_t_1);
9074 __pyx_t_4 = __pyx_memoryview_fromslice(__pyx_v_coords, 1, (PyObject *(*)(
char *)) __pyx_memview_get_double, (
int (*)(
char *, PyObject *)) __pyx_memview_set_double, 0);;
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 423, __pyx_L1_error)
9075 __Pyx_GOTREF(__pyx_t_4);
9076 if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_x, __pyx_t_4) < 0) __PYX_ERR(0, 423, __pyx_L1_error)
9077 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
9078 __pyx_t_4 = PyFloat_FromDouble(__pyx_v_ls_phi);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 423, __pyx_L1_error)
9079 __Pyx_GOTREF(__pyx_t_4);
9080 if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_ls_phi, __pyx_t_4) < 0) __PYX_ERR(0, 423, __pyx_L1_error)
9081 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
9082 __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_8, __pyx_empty_tuple, __pyx_t_1);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 423, __pyx_L1_error)
9083 __Pyx_GOTREF(__pyx_t_4);
9084 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
9085 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
9086 __pyx_t_12 = __pyx_PyFloat_AsDouble(__pyx_t_4);
if (unlikely((__pyx_t_12 == (
double)-1) && PyErr_Occurred())) __PYX_ERR(0, 423, __pyx_L1_error)
9087 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
9088 __pyx_v_f = __pyx_t_12;
9097 __pyx_t_27 = __pyx_v_nd;
9098 __pyx_t_28 = __pyx_t_27;
9099 for (__pyx_t_29 = 0; __pyx_t_29 < __pyx_t_28; __pyx_t_29+=1) {
9100 __pyx_v_ndi = __pyx_t_29;
9109 __pyx_t_17 = __pyx_v_ndi;
9110 if (__pyx_t_17 < 0) __pyx_t_17 += __pyx_v_v_grad.shape[0];
9111 __pyx_t_26 = __pyx_v_ndi;
9112 if (__pyx_t_26 < 0) __pyx_t_26 += __pyx_v_dphi.shape[0];
9113 *((
double *) ( (__pyx_v_dphi.data + __pyx_t_26 * __pyx_v_dphi.strides[0]) )) = ((*((
double *) ( (__pyx_v_v_grad.data + __pyx_t_17 * __pyx_v_v_grad.strides[0]) ))) / (((__pyx_v_t * 1.) / (__pyx_v_f * __pyx_v_Ccoeff)) + (((1.0 - __pyx_v_t) * 1.) / __pyx_v_area)));
9122 __pyx_t_17 = __pyx_v_ndi;
9123 if (__pyx_t_17 < 0) __pyx_t_17 += __pyx_v_dphi.shape[0];
9124 __pyx_t_26 = __pyx_v_ndi;
9125 if (__pyx_t_26 < 0) __pyx_t_26 += __pyx_v_fixed_dir.shape[0];
9126 __pyx_t_25 = __pyx_v_ndi;
9127 if (__pyx_t_25 < 0) __pyx_t_25 += __pyx_v_coords.shape[0];
9128 *((
double *) ( (__pyx_v_coords.data + __pyx_t_25 * __pyx_v_coords.strides[0]) )) += (((*((
double *) ( (__pyx_v_dphi.data + __pyx_t_17 * __pyx_v_dphi.strides[0]) ))) * __pyx_v_dt) * (*((
double *) ( (__pyx_v_fixed_dir.data + __pyx_t_26 * __pyx_v_fixed_dir.strides[0]) ))));
9137 __pyx_t_26 = __pyx_v_ndi;
9138 if (__pyx_t_26 < 0) __pyx_t_26 += __pyx_v_coords.shape[0];
9139 __pyx_t_17 = __pyx_v_node;
9140 __pyx_t_25 = __pyx_v_ndi;
9141 if (__pyx_t_17 < 0) __pyx_t_17 += __pyx_v_xx.shape[0];
9142 if (__pyx_t_25 < 0) __pyx_t_25 += __pyx_v_xx.shape[1];
9143 *((
double *) ( (( (__pyx_v_xx.data + __pyx_t_17 * __pyx_v_xx.strides[0]) ) + __pyx_t_25 * __pyx_v_xx.strides[1]) )) = (*((
double *) ( (__pyx_v_coords.data + __pyx_t_26 * __pyx_v_coords.strides[0]) )));
9172 __pyx_t_26 = __pyx_v_node;
9173 if (__pyx_t_26 < 0) __pyx_t_26 += __pyx_v_nearestNArray.shape[0];
9182 __pyx_t_25 = __pyx_v_node;
9183 if (__pyx_t_25 < 0) __pyx_t_25 += __pyx_v_typeNArray.shape[0];
9192 __pyx_t_11 = __pyx_f_6mprans_16cMoveMeshMonitor_findN(__pyx_v_coords, __pyx_v_nodeArray, __pyx_v_nodeStarOffsets, __pyx_v_nodeStarArray, (*((
int *) ( (__pyx_v_nearestNArray.data + __pyx_t_26 * __pyx_v_nearestNArray.strides[0]) ))), (*((
int *) ( (__pyx_v_typeNArray.data + __pyx_t_25 * __pyx_v_typeNArray.strides[0]) ))), __pyx_v_my_rank, __pyx_v_nNodes_owned, __pyx_v_nodeNumbering_subdomain2global, __pyx_v_nodeOffsets_subdomain_owned, __pyx_v_nodeElementOffsets, __pyx_v_nodeElementsArray, __pyx_v_elementBarycentersArray, __pyx_v_elementBoundaryNormalsArray, __pyx_v_elementBoundariesArray, __pyx_v_elementBoundaryBarycentersArray, __pyx_v_elementBoundaryElementsArray, __pyx_v_exteriorElementBoundariesBoolArray, __pyx_v_nElements_owned, __pyx_v_elementNumbering_subdomain2global, __pyx_v_elementOffsets_subdomain_owned, __pyx_v_nElementBoundaries_owned, __pyx_v_elementBoundaryNumbering_subdomain2global, __pyx_v_elementBoundaryOffsets_subdomain_owned, __pyx_v_elementNodesArray, __pyx_v_nodeMaterialTypes, __pyx_v_nNel);
if (unlikely(!__pyx_t_11.memview)) __PYX_ERR(0, 429, __pyx_L1_error)
9193 __PYX_XDEC_MEMVIEW(&__pyx_v_result, 1);
9194 __pyx_v_result = __pyx_t_11;
9195 __pyx_t_11.memview = NULL;
9196 __pyx_t_11.data = NULL;
9206 if (__pyx_t_25 < 0) __pyx_t_25 += __pyx_v_result.shape[0];
9207 __pyx_v_nearestN = (*((
int *) ( (__pyx_v_result.data + __pyx_t_25 * __pyx_v_result.strides[0]) )));
9217 if (__pyx_t_25 < 0) __pyx_t_25 += __pyx_v_result.shape[0];
9218 __pyx_v_typeN = (*((
int *) ( (__pyx_v_result.data + __pyx_t_25 * __pyx_v_result.strides[0]) )));
9228 if (__pyx_t_25 < 0) __pyx_t_25 += __pyx_v_result.shape[0];
9229 __pyx_v_new_rank = (*((
int *) ( (__pyx_v_result.data + __pyx_t_25 * __pyx_v_result.strides[0]) )));
9238 __pyx_t_19 = ((__pyx_v_new_rank == __pyx_v_my_rank) != 0);
9248 __pyx_v_inside_eN = 1;
9257 __pyx_t_25 = __pyx_v_node;
9258 if (__pyx_t_25 < 0) __pyx_t_25 += __pyx_v_nearestNArray.shape[0];
9259 *((
int *) ( (__pyx_v_nearestNArray.data + __pyx_t_25 * __pyx_v_nearestNArray.strides[0]) )) = __pyx_v_nearestN;
9268 __pyx_t_25 = __pyx_v_node;
9269 if (__pyx_t_25 < 0) __pyx_t_25 += __pyx_v_typeNArray.shape[0];
9270 *((
int *) ( (__pyx_v_typeNArray.data + __pyx_t_25 * __pyx_v_typeNArray.strides[0]) )) = __pyx_v_typeN;
9279 __pyx_t_30 = ((__pyx_v_typeN == 2) != 0);
9282 __pyx_t_19 = __pyx_t_30;
9283 goto __pyx_L31_bool_binop_done;
9285 __pyx_t_30 = ((__pyx_v_flag != 0) != 0);
9286 __pyx_t_19 = __pyx_t_30;
9287 __pyx_L31_bool_binop_done:;
9297 __pyx_t_25 = __pyx_v_nearestN;
9299 if (__pyx_t_25 < 0) __pyx_t_25 += __pyx_v_elementBoundaryElementsArray.shape[0];
9300 if (__pyx_t_26 < 0) __pyx_t_26 += __pyx_v_elementBoundaryElementsArray.shape[1];
9301 __pyx_t_30 = (((*((
int *) ( (( (__pyx_v_elementBoundaryElementsArray.data + __pyx_t_25 * __pyx_v_elementBoundaryElementsArray.strides[0]) ) + __pyx_t_26 * __pyx_v_elementBoundaryElementsArray.strides[1]) ))) == -1
L) != 0);
9304 __pyx_t_19 = __pyx_t_30;
9305 goto __pyx_L34_bool_binop_done;
9307 __pyx_t_26 = __pyx_v_nearestN;
9309 if (__pyx_t_26 < 0) __pyx_t_26 += __pyx_v_elementBoundaryElementsArray.shape[0];
9310 if (__pyx_t_25 < 0) __pyx_t_25 += __pyx_v_elementBoundaryElementsArray.shape[1];
9311 __pyx_t_30 = (((*((
int *) ( (( (__pyx_v_elementBoundaryElementsArray.data + __pyx_t_26 * __pyx_v_elementBoundaryElementsArray.strides[0]) ) + __pyx_t_25 * __pyx_v_elementBoundaryElementsArray.strides[1]) ))) > __pyx_v_nElements_owned) != 0);
9312 __pyx_t_19 = __pyx_t_30;
9313 __pyx_L34_bool_binop_done:;
9323 __pyx_t_25 = __pyx_v_nearestN;
9325 if (__pyx_t_25 < 0) __pyx_t_25 += __pyx_v_elementBoundaryElementsArray.shape[0];
9326 if (__pyx_t_26 < 0) __pyx_t_26 += __pyx_v_elementBoundaryElementsArray.shape[1];
9327 __pyx_v_nearestN = (*((
int *) ( (( (__pyx_v_elementBoundaryElementsArray.data + __pyx_t_25 * __pyx_v_elementBoundaryElementsArray.strides[0]) ) + __pyx_t_26 * __pyx_v_elementBoundaryElementsArray.strides[1]) )));
9355 __pyx_t_26 = __pyx_v_nearestN;
9357 if (__pyx_t_26 < 0) __pyx_t_26 += __pyx_v_elementBoundaryElementsArray.shape[0];
9358 if (__pyx_t_25 < 0) __pyx_t_25 += __pyx_v_elementBoundaryElementsArray.shape[1];
9359 __pyx_t_30 = (((*((
int *) ( (( (__pyx_v_elementBoundaryElementsArray.data + __pyx_t_26 * __pyx_v_elementBoundaryElementsArray.strides[0]) ) + __pyx_t_25 * __pyx_v_elementBoundaryElementsArray.strides[1]) ))) == -1
L) != 0);
9362 __pyx_t_19 = __pyx_t_30;
9363 goto __pyx_L36_bool_binop_done;
9365 __pyx_t_25 = __pyx_v_nearestN;
9367 if (__pyx_t_25 < 0) __pyx_t_25 += __pyx_v_elementBoundaryElementsArray.shape[0];
9368 if (__pyx_t_26 < 0) __pyx_t_26 += __pyx_v_elementBoundaryElementsArray.shape[1];
9369 __pyx_t_30 = (((*((
int *) ( (( (__pyx_v_elementBoundaryElementsArray.data + __pyx_t_25 * __pyx_v_elementBoundaryElementsArray.strides[0]) ) + __pyx_t_26 * __pyx_v_elementBoundaryElementsArray.strides[1]) ))) > __pyx_v_nElements_owned) != 0);
9370 __pyx_t_19 = __pyx_t_30;
9371 __pyx_L36_bool_binop_done:;
9381 __pyx_t_26 = __pyx_v_nearestN;
9383 if (__pyx_t_26 < 0) __pyx_t_26 += __pyx_v_elementBoundaryElementsArray.shape[0];
9384 if (__pyx_t_25 < 0) __pyx_t_25 += __pyx_v_elementBoundaryElementsArray.shape[1];
9385 __pyx_v_nearestN = (*((
int *) ( (( (__pyx_v_elementBoundaryElementsArray.data + __pyx_t_26 * __pyx_v_elementBoundaryElementsArray.strides[0]) ) + __pyx_t_25 * __pyx_v_elementBoundaryElementsArray.strides[1]) )));
9414 __pyx_t_25 = __pyx_v_nearestN;
9416 if (__pyx_t_25 < 0) __pyx_t_25 += __pyx_v_elementBoundaryElementsArray.shape[0];
9417 if (__pyx_t_26 < 0) __pyx_t_26 += __pyx_v_elementBoundaryElementsArray.shape[1];
9418 __pyx_v_nearestN = (*((
int *) ( (( (__pyx_v_elementBoundaryElementsArray.data + __pyx_t_25 * __pyx_v_elementBoundaryElementsArray.strides[0]) ) + __pyx_t_26 * __pyx_v_elementBoundaryElementsArray.strides[1]) )));
9447 __pyx_t_27 = __pyx_v_nEbn;
9448 __pyx_t_28 = __pyx_t_27;
9449 for (__pyx_t_29 = 0; __pyx_t_29 < __pyx_t_28; __pyx_t_29+=1) {
9450 __pyx_v_j = __pyx_t_29;
9459 __pyx_t_26 = __pyx_v_nearestN;
9460 __pyx_t_25 = __pyx_v_j;
9461 if (__pyx_t_26 < 0) __pyx_t_26 += __pyx_v_elementBoundariesArray.shape[0];
9462 if (__pyx_t_25 < 0) __pyx_t_25 += __pyx_v_elementBoundariesArray.shape[1];
9463 __pyx_v_bb_i = (*((
int *) ( (( (__pyx_v_elementBoundariesArray.data + __pyx_t_26 * __pyx_v_elementBoundariesArray.strides[0]) ) + __pyx_t_25 * __pyx_v_elementBoundariesArray.strides[1]) )));
9472 __pyx_t_25 = __pyx_v_nearestN;
9473 __pyx_t_26 = __pyx_v_j;
9475 if (__pyx_t_25 < 0) __pyx_t_25 += __pyx_v_elementBoundaryNormalsArray.shape[0];
9476 if (__pyx_t_26 < 0) __pyx_t_26 += __pyx_v_elementBoundaryNormalsArray.shape[1];
9477 if (__pyx_t_17 < 0) __pyx_t_17 += __pyx_v_elementBoundaryNormalsArray.shape[2];
9479 if (__pyx_t_31 < 0) __pyx_t_31 += __pyx_v_normal.shape[0];
9480 *((
double *) ( (__pyx_v_normal.data + __pyx_t_31 * __pyx_v_normal.strides[0]) )) = (*((
double *) ( (( (( (__pyx_v_elementBoundaryNormalsArray.data + __pyx_t_25 * __pyx_v_elementBoundaryNormalsArray.strides[0]) ) + __pyx_t_26 * __pyx_v_elementBoundaryNormalsArray.strides[1]) ) + __pyx_t_17 * __pyx_v_elementBoundaryNormalsArray.strides[2]) )));
9489 __pyx_t_17 = __pyx_v_nearestN;
9490 __pyx_t_26 = __pyx_v_j;
9492 if (__pyx_t_17 < 0) __pyx_t_17 += __pyx_v_elementBoundaryNormalsArray.shape[0];
9493 if (__pyx_t_26 < 0) __pyx_t_26 += __pyx_v_elementBoundaryNormalsArray.shape[1];
9494 if (__pyx_t_25 < 0) __pyx_t_25 += __pyx_v_elementBoundaryNormalsArray.shape[2];
9496 if (__pyx_t_31 < 0) __pyx_t_31 += __pyx_v_normal.shape[0];
9497 *((
double *) ( (__pyx_v_normal.data + __pyx_t_31 * __pyx_v_normal.strides[0]) )) = (*((
double *) ( (( (( (__pyx_v_elementBoundaryNormalsArray.data + __pyx_t_17 * __pyx_v_elementBoundaryNormalsArray.strides[0]) ) + __pyx_t_26 * __pyx_v_elementBoundaryNormalsArray.strides[1]) ) + __pyx_t_25 * __pyx_v_elementBoundaryNormalsArray.strides[2]) )));
9506 __pyx_t_25 = __pyx_v_nearestN;
9507 __pyx_t_26 = __pyx_v_j;
9509 if (__pyx_t_25 < 0) __pyx_t_25 += __pyx_v_elementBoundaryNormalsArray.shape[0];
9510 if (__pyx_t_26 < 0) __pyx_t_26 += __pyx_v_elementBoundaryNormalsArray.shape[1];
9511 if (__pyx_t_17 < 0) __pyx_t_17 += __pyx_v_elementBoundaryNormalsArray.shape[2];
9513 if (__pyx_t_31 < 0) __pyx_t_31 += __pyx_v_normal.shape[0];
9514 *((
double *) ( (__pyx_v_normal.data + __pyx_t_31 * __pyx_v_normal.strides[0]) )) = (*((
double *) ( (( (( (__pyx_v_elementBoundaryNormalsArray.data + __pyx_t_25 * __pyx_v_elementBoundaryNormalsArray.strides[0]) ) + __pyx_t_26 * __pyx_v_elementBoundaryNormalsArray.strides[1]) ) + __pyx_t_17 * __pyx_v_elementBoundaryNormalsArray.strides[2]) )));
9523 __pyx_t_9.data = __pyx_v_elementBoundaryBarycentersArray.data;
9524 __pyx_t_9.memview = __pyx_v_elementBoundaryBarycentersArray.memview;
9525 __PYX_INC_MEMVIEW(&__pyx_t_9, 0);
9527 Py_ssize_t __pyx_tmp_idx = __pyx_v_bb_i;
9528 Py_ssize_t __pyx_tmp_shape = __pyx_v_elementBoundaryBarycentersArray.shape[0];
9529 Py_ssize_t __pyx_tmp_stride = __pyx_v_elementBoundaryBarycentersArray.strides[0];
9530 if (__pyx_tmp_idx < 0)
9531 __pyx_tmp_idx += __pyx_tmp_shape;
9532 __pyx_t_9.data += __pyx_tmp_idx * __pyx_tmp_stride;
9535 __pyx_t_9.shape[0] = __pyx_v_elementBoundaryBarycentersArray.shape[1];
9536 __pyx_t_9.strides[0] = __pyx_v_elementBoundaryBarycentersArray.strides[1];
9537 __pyx_t_9.suboffsets[0] = -1;
9539 __PYX_XDEC_MEMVIEW(&__pyx_v_bound_bar, 1);
9540 __pyx_v_bound_bar = __pyx_t_9;
9541 __pyx_t_9.memview = NULL;
9542 __pyx_t_9.data = NULL;
9552 if (__pyx_t_17 < 0) __pyx_t_17 += __pyx_v_bound_bar.shape[0];
9554 if (__pyx_t_26 < 0) __pyx_t_26 += __pyx_v_coords.shape[0];
9556 if (__pyx_t_25 < 0) __pyx_t_25 += __pyx_v_normal.shape[0];
9558 if (__pyx_t_31 < 0) __pyx_t_31 += __pyx_v_bound_bar.shape[0];
9560 if (__pyx_t_32 < 0) __pyx_t_32 += __pyx_v_coords.shape[0];
9562 if (__pyx_t_33 < 0) __pyx_t_33 += __pyx_v_normal.shape[0];
9564 if (__pyx_t_34 < 0) __pyx_t_34 += __pyx_v_bound_bar.shape[0];
9566 if (__pyx_t_35 < 0) __pyx_t_35 += __pyx_v_coords.shape[0];
9568 if (__pyx_t_36 < 0) __pyx_t_36 += __pyx_v_normal.shape[0];
9569 __pyx_v_dot = (((((*((
double *) ( (__pyx_v_bound_bar.data + __pyx_t_17 * __pyx_v_bound_bar.strides[0]) ))) - (*((
double *) ( (__pyx_v_coords.data + __pyx_t_26 * __pyx_v_coords.strides[0]) )))) * (*((
double *) ( (__pyx_v_normal.data + __pyx_t_25 * __pyx_v_normal.strides[0]) )))) + (((*((
double *) ( (__pyx_v_bound_bar.data + __pyx_t_31 * __pyx_v_bound_bar.strides[0]) ))) - (*((
double *) ( (__pyx_v_coords.data + __pyx_t_32 * __pyx_v_coords.strides[0]) )))) * (*((
double *) ( (__pyx_v_normal.data + __pyx_t_33 * __pyx_v_normal.strides[0]) ))))) + (((*((
double *) ( (__pyx_v_bound_bar.data + __pyx_t_34 * __pyx_v_bound_bar.strides[0]) ))) - (*((
double *) ( (__pyx_v_coords.data + __pyx_t_35 * __pyx_v_coords.strides[0]) )))) * (*((
double *) ( (__pyx_v_normal.data + __pyx_t_36 * __pyx_v_normal.strides[0]) )))));
9578 __pyx_t_19 = ((__pyx_v_dot < 0.) != 0);
9588 __pyx_v_inside_eN = 0;
9598 __Pyx_PyThreadState_declare
9599 __Pyx_PyThreadState_assign
9600 __Pyx_ExceptionSave(&__pyx_t_37, &__pyx_t_38, &__pyx_t_39);
9601 __Pyx_XGOTREF(__pyx_t_37);
9602 __Pyx_XGOTREF(__pyx_t_38);
9603 __Pyx_XGOTREF(__pyx_t_39);
9613 __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_AssertionError, __pyx_tuple__6, NULL);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 489, __pyx_L41_error)
9614 __Pyx_GOTREF(__pyx_t_4);
9615 __Pyx_Raise(__pyx_t_4, 0, 0, 0);
9616 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
9617 __PYX_ERR(0, 489, __pyx_L41_error)
9628 __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
9629 __PYX_XDEC_MEMVIEW(&__pyx_t_11, 1);
9630 __PYX_XDEC_MEMVIEW(&__pyx_t_13, 1);
9631 __PYX_XDEC_MEMVIEW(&__pyx_t_14, 1);
9632 __PYX_XDEC_MEMVIEW(&__pyx_t_18, 1);
9633 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
9634 __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
9635 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
9636 __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
9637 __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
9638 __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
9639 __PYX_XDEC_MEMVIEW(&__pyx_t_9, 1);
9648 __pyx_t_40 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_AssertionError);
9650 __Pyx_AddTraceback(
"mprans.cMoveMeshMonitor.cCoefficients.cppPseudoTimeSteppingParallel", __pyx_clineno, __pyx_lineno, __pyx_filename);
9651 if (__Pyx_GetException(&__pyx_t_4, &__pyx_t_1, &__pyx_t_8) < 0) __PYX_ERR(0, 490, __pyx_L43_except_error)
9652 __Pyx_GOTREF(__pyx_t_4);
9653 __Pyx_GOTREF(__pyx_t_1);
9654 __Pyx_GOTREF(__pyx_t_8);
9655 __Pyx_INCREF(__pyx_t_1);
9656 __Pyx_XDECREF_SET(__pyx_v_exc, __pyx_t_1);
9665 __pyx_t_3 = PyTuple_New(2);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 491, __pyx_L43_except_error)
9666 __Pyx_GOTREF(__pyx_t_3);
9667 __Pyx_INCREF(__pyx_kp_s_Error);
9668 __Pyx_GIVEREF(__pyx_kp_s_Error);
9669 PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_kp_s_Error);
9670 __Pyx_INCREF(__pyx_v_exc);
9671 __Pyx_GIVEREF(__pyx_v_exc);
9672 PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_v_exc);
9673 if (__Pyx_PrintOne(0, __pyx_t_3) < 0) __PYX_ERR(0, 491, __pyx_L43_except_error)
9674 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
9683 __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_node);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 492, __pyx_L43_except_error)
9684 __Pyx_GOTREF(__pyx_t_3);
9685 __pyx_t_6 = PyTuple_New(2);
if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 492, __pyx_L43_except_error)
9686 __Pyx_GOTREF(__pyx_t_6);
9687 __Pyx_INCREF(__pyx_kp_s_node_number);
9688 __Pyx_GIVEREF(__pyx_kp_s_node_number);
9689 PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_kp_s_node_number);
9690 __Pyx_GIVEREF(__pyx_t_3);
9691 PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_t_3);
9693 if (__Pyx_PrintOne(0, __pyx_t_6) < 0) __PYX_ERR(0, 492, __pyx_L43_except_error)
9694 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
9703 __pyx_t_36 = __pyx_v_node;
9704 if (__pyx_t_36 < 0) __pyx_t_36 += __pyx_v_nodeMaterialTypes.shape[0];
9705 __pyx_t_6 = __Pyx_PyInt_From_int((*((
int *) ( (__pyx_v_nodeMaterialTypes.data + __pyx_t_36 * __pyx_v_nodeMaterialTypes.strides[0]) ))));
if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 494, __pyx_L43_except_error)
9706 __Pyx_GOTREF(__pyx_t_6);
9715 __pyx_t_3 = PyTuple_New(2);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 493, __pyx_L43_except_error)
9716 __Pyx_GOTREF(__pyx_t_3);
9717 __Pyx_INCREF(__pyx_kp_s_node_materialType);
9718 __Pyx_GIVEREF(__pyx_kp_s_node_materialType);
9719 PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_kp_s_node_materialType);
9720 __Pyx_GIVEREF(__pyx_t_6);
9721 PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_6);
9723 if (__Pyx_PrintOne(0, __pyx_t_3) < 0) __PYX_ERR(0, 493, __pyx_L43_except_error)
9724 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
9733 __pyx_t_36 = __pyx_v_node;
9735 if (__pyx_t_36 < 0) __pyx_t_36 += __pyx_v_nodeArray.shape[0];
9736 if (__pyx_t_35 < 0) __pyx_t_35 += __pyx_v_nodeArray.shape[1];
9737 __pyx_t_3 = PyFloat_FromDouble((*((
double *) ( (( (__pyx_v_nodeArray.data + __pyx_t_36 * __pyx_v_nodeArray.strides[0]) ) + __pyx_t_35 * __pyx_v_nodeArray.strides[1]) ))));
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 496, __pyx_L43_except_error)
9738 __Pyx_GOTREF(__pyx_t_3);
9747 __pyx_t_35 = __pyx_v_node;
9749 if (__pyx_t_35 < 0) __pyx_t_35 += __pyx_v_nodeArray.shape[0];
9750 if (__pyx_t_36 < 0) __pyx_t_36 += __pyx_v_nodeArray.shape[1];
9751 __pyx_t_6 = PyFloat_FromDouble((*((
double *) ( (( (__pyx_v_nodeArray.data + __pyx_t_35 * __pyx_v_nodeArray.strides[0]) ) + __pyx_t_36 * __pyx_v_nodeArray.strides[1]) ))));
if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 497, __pyx_L43_except_error)
9752 __Pyx_GOTREF(__pyx_t_6);
9761 __pyx_t_36 = __pyx_v_node;
9763 if (__pyx_t_36 < 0) __pyx_t_36 += __pyx_v_nodeArray.shape[0];
9764 if (__pyx_t_35 < 0) __pyx_t_35 += __pyx_v_nodeArray.shape[1];
9765 __pyx_t_5 = PyFloat_FromDouble((*((
double *) ( (( (__pyx_v_nodeArray.data + __pyx_t_36 * __pyx_v_nodeArray.strides[0]) ) + __pyx_t_35 * __pyx_v_nodeArray.strides[1]) ))));
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 498, __pyx_L43_except_error)
9766 __Pyx_GOTREF(__pyx_t_5);
9775 __pyx_t_7 = PyTuple_New(4);
if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 495, __pyx_L43_except_error)
9776 __Pyx_GOTREF(__pyx_t_7);
9777 __Pyx_INCREF(__pyx_kp_s_node_old_coordinates);
9778 __Pyx_GIVEREF(__pyx_kp_s_node_old_coordinates);
9779 PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_kp_s_node_old_coordinates);
9780 __Pyx_GIVEREF(__pyx_t_3);
9781 PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_t_3);
9782 __Pyx_GIVEREF(__pyx_t_6);
9783 PyTuple_SET_ITEM(__pyx_t_7, 2, __pyx_t_6);
9784 __Pyx_GIVEREF(__pyx_t_5);
9785 PyTuple_SET_ITEM(__pyx_t_7, 3, __pyx_t_5);
9789 if (__Pyx_PrintOne(0, __pyx_t_7) < 0) __PYX_ERR(0, 495, __pyx_L43_except_error)
9790 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
9800 if (__pyx_t_35 < 0) __pyx_t_35 += __pyx_v_coords.shape[0];
9801 __pyx_t_7 = PyFloat_FromDouble((*((
double *) ( (__pyx_v_coords.data + __pyx_t_35 * __pyx_v_coords.strides[0]) ))));
if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 500, __pyx_L43_except_error)
9802 __Pyx_GOTREF(__pyx_t_7);
9812 if (__pyx_t_35 < 0) __pyx_t_35 += __pyx_v_coords.shape[0];
9813 __pyx_t_5 = PyFloat_FromDouble((*((
double *) ( (__pyx_v_coords.data + __pyx_t_35 * __pyx_v_coords.strides[0]) ))));
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 501, __pyx_L43_except_error)
9814 __Pyx_GOTREF(__pyx_t_5);
9824 if (__pyx_t_35 < 0) __pyx_t_35 += __pyx_v_coords.shape[0];
9825 __pyx_t_6 = PyFloat_FromDouble((*((
double *) ( (__pyx_v_coords.data + __pyx_t_35 * __pyx_v_coords.strides[0]) ))));
if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 502, __pyx_L43_except_error)
9826 __Pyx_GOTREF(__pyx_t_6);
9835 __pyx_t_3 = PyTuple_New(4);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 499, __pyx_L43_except_error)
9836 __Pyx_GOTREF(__pyx_t_3);
9837 __Pyx_INCREF(__pyx_kp_s_node_new_coordinates);
9838 __Pyx_GIVEREF(__pyx_kp_s_node_new_coordinates);
9839 PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_kp_s_node_new_coordinates);
9840 __Pyx_GIVEREF(__pyx_t_7);
9841 PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_7);
9842 __Pyx_GIVEREF(__pyx_t_5);
9843 PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_t_5);
9844 __Pyx_GIVEREF(__pyx_t_6);
9845 PyTuple_SET_ITEM(__pyx_t_3, 3, __pyx_t_6);
9849 if (__Pyx_PrintOne(0, __pyx_t_3) < 0) __PYX_ERR(0, 499, __pyx_L43_except_error)
9850 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
9859 __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_nearestN);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 504, __pyx_L43_except_error)
9860 __Pyx_GOTREF(__pyx_t_3);
9869 __pyx_t_6 = __Pyx_PyInt_From_int(__pyx_v_typeN);
if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 506, __pyx_L43_except_error)
9870 __Pyx_GOTREF(__pyx_t_6);
9879 __pyx_t_5 = PyTuple_New(4);
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 503, __pyx_L43_except_error)
9880 __Pyx_GOTREF(__pyx_t_5);
9881 __Pyx_INCREF(__pyx_kp_s_nearestN_element);
9882 __Pyx_GIVEREF(__pyx_kp_s_nearestN_element);
9883 PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_kp_s_nearestN_element);
9884 __Pyx_GIVEREF(__pyx_t_3);
9885 PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_3);
9886 __Pyx_INCREF(__pyx_kp_s_type_should_be_1);
9887 __Pyx_GIVEREF(__pyx_kp_s_type_should_be_1);
9888 PyTuple_SET_ITEM(__pyx_t_5, 2, __pyx_kp_s_type_should_be_1);
9889 __Pyx_GIVEREF(__pyx_t_6);
9890 PyTuple_SET_ITEM(__pyx_t_5, 3, __pyx_t_6);
9893 if (__Pyx_PrintOne(0, __pyx_t_5) < 0) __PYX_ERR(0, 503, __pyx_L43_except_error)
9894 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
9903 __pyx_t_35 = __pyx_v_nearestN;
9905 if (__pyx_t_35 < 0) __pyx_t_35 += __pyx_v_elementBarycentersArray.shape[0];
9906 if (__pyx_t_36 < 0) __pyx_t_36 += __pyx_v_elementBarycentersArray.shape[1];
9907 __pyx_t_5 = PyFloat_FromDouble((*((
double *) ( (( (__pyx_v_elementBarycentersArray.data + __pyx_t_35 * __pyx_v_elementBarycentersArray.strides[0]) ) + __pyx_t_36 * __pyx_v_elementBarycentersArray.strides[1]) ))));
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 508, __pyx_L43_except_error)
9908 __Pyx_GOTREF(__pyx_t_5);
9917 __pyx_t_36 = __pyx_v_nearestN;
9919 if (__pyx_t_36 < 0) __pyx_t_36 += __pyx_v_elementBarycentersArray.shape[0];
9920 if (__pyx_t_35 < 0) __pyx_t_35 += __pyx_v_elementBarycentersArray.shape[1];
9921 __pyx_t_6 = PyFloat_FromDouble((*((
double *) ( (( (__pyx_v_elementBarycentersArray.data + __pyx_t_36 * __pyx_v_elementBarycentersArray.strides[0]) ) + __pyx_t_35 * __pyx_v_elementBarycentersArray.strides[1]) ))));
if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 509, __pyx_L43_except_error)
9922 __Pyx_GOTREF(__pyx_t_6);
9931 __pyx_t_35 = __pyx_v_nearestN;
9933 if (__pyx_t_35 < 0) __pyx_t_35 += __pyx_v_elementBarycentersArray.shape[0];
9934 if (__pyx_t_36 < 0) __pyx_t_36 += __pyx_v_elementBarycentersArray.shape[1];
9935 __pyx_t_3 = PyFloat_FromDouble((*((
double *) ( (( (__pyx_v_elementBarycentersArray.data + __pyx_t_35 * __pyx_v_elementBarycentersArray.strides[0]) ) + __pyx_t_36 * __pyx_v_elementBarycentersArray.strides[1]) ))));
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 510, __pyx_L43_except_error)
9936 __Pyx_GOTREF(__pyx_t_3);
9945 __pyx_t_7 = PyTuple_New(4);
if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 507, __pyx_L43_except_error)
9946 __Pyx_GOTREF(__pyx_t_7);
9947 __Pyx_INCREF(__pyx_kp_s_element_barycenter);
9948 __Pyx_GIVEREF(__pyx_kp_s_element_barycenter);
9949 PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_kp_s_element_barycenter);
9950 __Pyx_GIVEREF(__pyx_t_5);
9951 PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_t_5);
9952 __Pyx_GIVEREF(__pyx_t_6);
9953 PyTuple_SET_ITEM(__pyx_t_7, 2, __pyx_t_6);
9954 __Pyx_GIVEREF(__pyx_t_3);
9955 PyTuple_SET_ITEM(__pyx_t_7, 3, __pyx_t_3);
9959 if (__Pyx_PrintOne(0, __pyx_t_7) < 0) __PYX_ERR(0, 507, __pyx_L43_except_error)
9960 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
9969 __pyx_t_15 = (__pyx_v_elementNodesArray.shape[1]);
9970 __pyx_t_41 = __pyx_t_15;
9971 for (__pyx_t_40 = 0; __pyx_t_40 < __pyx_t_41; __pyx_t_40+=1) {
9972 __pyx_v_ii = __pyx_t_40;
9981 __pyx_t_36 = __pyx_v_nearestN;
9982 __pyx_t_35 = __pyx_v_ii;
9983 if (__pyx_t_36 < 0) __pyx_t_36 += __pyx_v_elementNodesArray.shape[0];
9984 if (__pyx_t_35 < 0) __pyx_t_35 += __pyx_v_elementNodesArray.shape[1];
9985 __pyx_t_7 = __Pyx_PyInt_From_int((*((
int *) ( (( (__pyx_v_elementNodesArray.data + __pyx_t_36 * __pyx_v_elementNodesArray.strides[0]) ) + __pyx_t_35 * __pyx_v_elementNodesArray.strides[1]) ))));
if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 513, __pyx_L43_except_error)
9986 __Pyx_GOTREF(__pyx_t_7);
9995 __pyx_t_35 = __pyx_v_nearestN;
9996 __pyx_t_36 = __pyx_v_ii;
9997 if (__pyx_t_35 < 0) __pyx_t_35 += __pyx_v_elementNodesArray.shape[0];
9998 if (__pyx_t_36 < 0) __pyx_t_36 += __pyx_v_elementNodesArray.shape[1];
9999 __pyx_t_34 = (*((
int *) ( (( (__pyx_v_elementNodesArray.data + __pyx_t_35 * __pyx_v_elementNodesArray.strides[0]) ) + __pyx_t_36 * __pyx_v_elementNodesArray.strides[1]) )));
10001 if (__pyx_t_34 < 0) __pyx_t_34 += __pyx_v_nodeArray.shape[0];
10002 if (__pyx_t_33 < 0) __pyx_t_33 += __pyx_v_nodeArray.shape[1];
10003 __pyx_t_3 = PyFloat_FromDouble((*((
double *) ( (( (__pyx_v_nodeArray.data + __pyx_t_34 * __pyx_v_nodeArray.strides[0]) ) + __pyx_t_33 * __pyx_v_nodeArray.strides[1]) ))));
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 514, __pyx_L43_except_error)
10004 __Pyx_GOTREF(__pyx_t_3);
10013 __pyx_t_36 = __pyx_v_nearestN;
10014 __pyx_t_35 = __pyx_v_ii;
10015 if (__pyx_t_36 < 0) __pyx_t_36 += __pyx_v_elementNodesArray.shape[0];
10016 if (__pyx_t_35 < 0) __pyx_t_35 += __pyx_v_elementNodesArray.shape[1];
10017 __pyx_t_33 = (*((
int *) ( (( (__pyx_v_elementNodesArray.data + __pyx_t_36 * __pyx_v_elementNodesArray.strides[0]) ) + __pyx_t_35 * __pyx_v_elementNodesArray.strides[1]) )));
10019 if (__pyx_t_33 < 0) __pyx_t_33 += __pyx_v_nodeArray.shape[0];
10020 if (__pyx_t_34 < 0) __pyx_t_34 += __pyx_v_nodeArray.shape[1];
10021 __pyx_t_6 = PyFloat_FromDouble((*((
double *) ( (( (__pyx_v_nodeArray.data + __pyx_t_33 * __pyx_v_nodeArray.strides[0]) ) + __pyx_t_34 * __pyx_v_nodeArray.strides[1]) ))));
if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 515, __pyx_L43_except_error)
10022 __Pyx_GOTREF(__pyx_t_6);
10031 __pyx_t_35 = __pyx_v_nearestN;
10032 __pyx_t_36 = __pyx_v_ii;
10033 if (__pyx_t_35 < 0) __pyx_t_35 += __pyx_v_elementNodesArray.shape[0];
10034 if (__pyx_t_36 < 0) __pyx_t_36 += __pyx_v_elementNodesArray.shape[1];
10035 __pyx_t_34 = (*((
int *) ( (( (__pyx_v_elementNodesArray.data + __pyx_t_35 * __pyx_v_elementNodesArray.strides[0]) ) + __pyx_t_36 * __pyx_v_elementNodesArray.strides[1]) )));
10037 if (__pyx_t_34 < 0) __pyx_t_34 += __pyx_v_nodeArray.shape[0];
10038 if (__pyx_t_33 < 0) __pyx_t_33 += __pyx_v_nodeArray.shape[1];
10039 __pyx_t_5 = PyFloat_FromDouble((*((
double *) ( (( (__pyx_v_nodeArray.data + __pyx_t_34 * __pyx_v_nodeArray.strides[0]) ) + __pyx_t_33 * __pyx_v_nodeArray.strides[1]) ))));
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 516, __pyx_L43_except_error)
10040 __Pyx_GOTREF(__pyx_t_5);
10049 __pyx_t_42 = PyTuple_New(5);
if (unlikely(!__pyx_t_42)) __PYX_ERR(0, 512, __pyx_L43_except_error)
10050 __Pyx_GOTREF(__pyx_t_42);
10051 __Pyx_INCREF(__pyx_kp_s_element_node);
10052 __Pyx_GIVEREF(__pyx_kp_s_element_node);
10053 PyTuple_SET_ITEM(__pyx_t_42, 0, __pyx_kp_s_element_node);
10054 __Pyx_GIVEREF(__pyx_t_7);
10055 PyTuple_SET_ITEM(__pyx_t_42, 1, __pyx_t_7);
10056 __Pyx_GIVEREF(__pyx_t_3);
10057 PyTuple_SET_ITEM(__pyx_t_42, 2, __pyx_t_3);
10058 __Pyx_GIVEREF(__pyx_t_6);
10059 PyTuple_SET_ITEM(__pyx_t_42, 3, __pyx_t_6);
10060 __Pyx_GIVEREF(__pyx_t_5);
10061 PyTuple_SET_ITEM(__pyx_t_42, 4, __pyx_t_5);
10066 if (__Pyx_PrintOne(0, __pyx_t_42) < 0) __PYX_ERR(0, 512, __pyx_L43_except_error)
10067 __Pyx_DECREF(__pyx_t_42); __pyx_t_42 = 0;
10078 if (__pyx_t_36 < 0) __pyx_t_36 += __pyx_v_fixed_dir.shape[0];
10079 __pyx_t_42 = PyFloat_FromDouble((*((
double *) ( (__pyx_v_fixed_dir.data + __pyx_t_36 * __pyx_v_fixed_dir.strides[0]) ))));
if (unlikely(!__pyx_t_42)) __PYX_ERR(0, 518, __pyx_L43_except_error)
10080 __Pyx_GOTREF(__pyx_t_42);
10090 if (__pyx_t_36 < 0) __pyx_t_36 += __pyx_v_fixed_dir.shape[0];
10091 __pyx_t_5 = PyFloat_FromDouble((*((
double *) ( (__pyx_v_fixed_dir.data + __pyx_t_36 * __pyx_v_fixed_dir.strides[0]) ))));
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 519, __pyx_L43_except_error)
10092 __Pyx_GOTREF(__pyx_t_5);
10102 if (__pyx_t_36 < 0) __pyx_t_36 += __pyx_v_fixed_dir.shape[0];
10103 __pyx_t_6 = PyFloat_FromDouble((*((
double *) ( (__pyx_v_fixed_dir.data + __pyx_t_36 * __pyx_v_fixed_dir.strides[0]) ))));
if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 520, __pyx_L43_except_error)
10104 __Pyx_GOTREF(__pyx_t_6);
10113 __pyx_t_3 = PyTuple_New(4);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 517, __pyx_L43_except_error)
10114 __Pyx_GOTREF(__pyx_t_3);
10115 __Pyx_INCREF(__pyx_kp_s_fixed_dir);
10116 __Pyx_GIVEREF(__pyx_kp_s_fixed_dir);
10117 PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_kp_s_fixed_dir);
10118 __Pyx_GIVEREF(__pyx_t_42);
10119 PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_42);
10120 __Pyx_GIVEREF(__pyx_t_5);
10121 PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_t_5);
10122 __Pyx_GIVEREF(__pyx_t_6);
10123 PyTuple_SET_ITEM(__pyx_t_3, 3, __pyx_t_6);
10127 if (__Pyx_PrintOne(0, __pyx_t_3) < 0) __PYX_ERR(0, 517, __pyx_L43_except_error)
10128 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
10137 __pyx_t_3 = PyFloat_FromDouble(__pyx_v_dot);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 521, __pyx_L43_except_error)
10138 __Pyx_GOTREF(__pyx_t_3);
10139 __pyx_t_6 = PyTuple_New(2);
if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 521, __pyx_L43_except_error)
10140 __Pyx_GOTREF(__pyx_t_6);
10141 __Pyx_INCREF(__pyx_kp_s_dot);
10142 __Pyx_GIVEREF(__pyx_kp_s_dot);
10143 PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_kp_s_dot);
10144 __Pyx_GIVEREF(__pyx_t_3);
10145 PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_t_3);
10147 if (__Pyx_PrintOne(0, __pyx_t_6) < 0) __PYX_ERR(0, 521, __pyx_L43_except_error)
10148 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
10157 __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_comm, __pyx_n_s_Abort);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 522, __pyx_L43_except_error)
10158 __Pyx_GOTREF(__pyx_t_3);
10160 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
10161 __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_3);
10162 if (likely(__pyx_t_5)) {
10163 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_3);
10164 __Pyx_INCREF(__pyx_t_5);
10165 __Pyx_INCREF(
function);
10166 __Pyx_DECREF_SET(__pyx_t_3,
function);
10169 __pyx_t_6 = (__pyx_t_5) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_5) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
10170 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
10171 if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 522, __pyx_L43_except_error)
10172 __Pyx_GOTREF(__pyx_t_6);
10173 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
10174 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
10175 __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
10176 __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
10177 __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
10178 goto __pyx_L42_exception_handled;
10180 goto __pyx_L43_except_error;
10181 __pyx_L43_except_error:;
10190 __Pyx_XGIVEREF(__pyx_t_37);
10191 __Pyx_XGIVEREF(__pyx_t_38);
10192 __Pyx_XGIVEREF(__pyx_t_39);
10193 __Pyx_ExceptionReset(__pyx_t_37, __pyx_t_38, __pyx_t_39);
10194 goto __pyx_L1_error;
10195 __pyx_L42_exception_handled:;
10196 __Pyx_XGIVEREF(__pyx_t_37);
10197 __Pyx_XGIVEREF(__pyx_t_38);
10198 __Pyx_XGIVEREF(__pyx_t_39);
10199 __Pyx_ExceptionReset(__pyx_t_37, __pyx_t_38, __pyx_t_39);
10219 __pyx_t_19 = (__pyx_v_inside_eN != 0);
10229 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_femSpace, __pyx_n_s_elementMaps);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 524, __pyx_L1_error)
10230 __Pyx_GOTREF(__pyx_t_1);
10231 __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_getInverseValue);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 524, __pyx_L1_error)
10232 __Pyx_GOTREF(__pyx_t_4);
10233 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
10234 __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_nearestN);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 524, __pyx_L1_error)
10235 __Pyx_GOTREF(__pyx_t_1);
10236 __pyx_t_6 = __pyx_memoryview_fromslice(__pyx_v_coords, 1, (PyObject *(*)(
char *)) __pyx_memview_get_double, (
int (*)(
char *, PyObject *)) __pyx_memview_set_double, 0);;
if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 524, __pyx_L1_error)
10237 __Pyx_GOTREF(__pyx_t_6);
10240 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) {
10241 __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_4);
10242 if (likely(__pyx_t_3)) {
10243 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_4);
10244 __Pyx_INCREF(__pyx_t_3);
10245 __Pyx_INCREF(
function);
10246 __Pyx_DECREF_SET(__pyx_t_4,
function);
10250 #if CYTHON_FAST_PYCALL
10251 if (PyFunction_Check(__pyx_t_4)) {
10252 PyObject *__pyx_temp[3] = {__pyx_t_3, __pyx_t_1, __pyx_t_6};
10253 __pyx_t_8 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_27, 2+__pyx_t_27);
if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 524, __pyx_L1_error)
10254 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
10255 __Pyx_GOTREF(__pyx_t_8);
10256 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
10257 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
10260 #if CYTHON_FAST_PYCCALL
10261 if (__Pyx_PyFastCFunction_Check(__pyx_t_4)) {
10262 PyObject *__pyx_temp[3] = {__pyx_t_3, __pyx_t_1, __pyx_t_6};
10263 __pyx_t_8 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_27, 2+__pyx_t_27);
if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 524, __pyx_L1_error)
10264 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
10265 __Pyx_GOTREF(__pyx_t_8);
10266 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
10267 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
10271 __pyx_t_5 = PyTuple_New(2+__pyx_t_27);
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 524, __pyx_L1_error)
10272 __Pyx_GOTREF(__pyx_t_5);
10274 __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_3); __pyx_t_3 = NULL;
10276 __Pyx_GIVEREF(__pyx_t_1);
10277 PyTuple_SET_ITEM(__pyx_t_5, 0+__pyx_t_27, __pyx_t_1);
10278 __Pyx_GIVEREF(__pyx_t_6);
10279 PyTuple_SET_ITEM(__pyx_t_5, 1+__pyx_t_27, __pyx_t_6);
10282 __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_5, NULL);
if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 524, __pyx_L1_error)
10283 __Pyx_GOTREF(__pyx_t_8);
10284 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
10286 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
10287 __Pyx_XDECREF_SET(__pyx_v_xi, __pyx_t_8);
10297 __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_pc, __pyx_n_s_getGradientValue);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 526, __pyx_L1_error)
10298 __Pyx_GOTREF(__pyx_t_4);
10299 __pyx_t_5 = __Pyx_PyInt_From_int(__pyx_v_nearestN);
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 526, __pyx_L1_error)
10300 __Pyx_GOTREF(__pyx_t_5);
10303 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) {
10304 __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_4);
10305 if (likely(__pyx_t_6)) {
10306 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_4);
10307 __Pyx_INCREF(__pyx_t_6);
10308 __Pyx_INCREF(
function);
10309 __Pyx_DECREF_SET(__pyx_t_4,
function);
10313 #if CYTHON_FAST_PYCALL
10314 if (PyFunction_Check(__pyx_t_4)) {
10315 PyObject *__pyx_temp[3] = {__pyx_t_6, __pyx_t_5, __pyx_v_xi};
10316 __pyx_t_8 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_27, 2+__pyx_t_27);
if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 526, __pyx_L1_error)
10317 __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
10318 __Pyx_GOTREF(__pyx_t_8);
10319 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
10322 #if CYTHON_FAST_PYCCALL
10323 if (__Pyx_PyFastCFunction_Check(__pyx_t_4)) {
10324 PyObject *__pyx_temp[3] = {__pyx_t_6, __pyx_t_5, __pyx_v_xi};
10325 __pyx_t_8 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_27, 2+__pyx_t_27);
if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 526, __pyx_L1_error)
10326 __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
10327 __Pyx_GOTREF(__pyx_t_8);
10328 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
10332 __pyx_t_1 = PyTuple_New(2+__pyx_t_27);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 526, __pyx_L1_error)
10333 __Pyx_GOTREF(__pyx_t_1);
10335 __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_6); __pyx_t_6 = NULL;
10337 __Pyx_GIVEREF(__pyx_t_5);
10338 PyTuple_SET_ITEM(__pyx_t_1, 0+__pyx_t_27, __pyx_t_5);
10339 __Pyx_INCREF(__pyx_v_xi);
10340 __Pyx_GIVEREF(__pyx_v_xi);
10341 PyTuple_SET_ITEM(__pyx_t_1, 1+__pyx_t_27, __pyx_v_xi);
10343 __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_1, NULL);
if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 526, __pyx_L1_error)
10344 __Pyx_GOTREF(__pyx_t_8);
10345 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
10347 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
10348 __pyx_t_9 = __Pyx_PyObject_to_MemoryviewSlice_ds_double(__pyx_t_8, PyBUF_WRITABLE);
if (unlikely(!__pyx_t_9.memview)) __PYX_ERR(0, 526, __pyx_L1_error)
10349 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
10350 __PYX_XDEC_MEMVIEW(&__pyx_v_v_grad, 1);
10351 __pyx_v_v_grad = __pyx_t_9;
10352 __pyx_t_9.memview = NULL;
10353 __pyx_t_9.data = NULL;
10362 __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_pc, __pyx_n_s_getAreaValue);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 527, __pyx_L1_error)
10363 __Pyx_GOTREF(__pyx_t_4);
10364 __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_nearestN);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 527, __pyx_L1_error)
10365 __Pyx_GOTREF(__pyx_t_1);
10368 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) {
10369 __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
10370 if (likely(__pyx_t_5)) {
10371 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_4);
10372 __Pyx_INCREF(__pyx_t_5);
10373 __Pyx_INCREF(
function);
10374 __Pyx_DECREF_SET(__pyx_t_4,
function);
10378 #if CYTHON_FAST_PYCALL
10379 if (PyFunction_Check(__pyx_t_4)) {
10380 PyObject *__pyx_temp[3] = {__pyx_t_5, __pyx_t_1, __pyx_v_xi};
10381 __pyx_t_8 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_27, 2+__pyx_t_27);
if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 527, __pyx_L1_error)
10382 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
10383 __Pyx_GOTREF(__pyx_t_8);
10384 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
10387 #if CYTHON_FAST_PYCCALL
10388 if (__Pyx_PyFastCFunction_Check(__pyx_t_4)) {
10389 PyObject *__pyx_temp[3] = {__pyx_t_5, __pyx_t_1, __pyx_v_xi};
10390 __pyx_t_8 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_27, 2+__pyx_t_27);
if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 527, __pyx_L1_error)
10391 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
10392 __Pyx_GOTREF(__pyx_t_8);
10393 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
10397 __pyx_t_6 = PyTuple_New(2+__pyx_t_27);
if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 527, __pyx_L1_error)
10398 __Pyx_GOTREF(__pyx_t_6);
10400 __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_5); __pyx_t_5 = NULL;
10402 __Pyx_GIVEREF(__pyx_t_1);
10403 PyTuple_SET_ITEM(__pyx_t_6, 0+__pyx_t_27, __pyx_t_1);
10404 __Pyx_INCREF(__pyx_v_xi);
10405 __Pyx_GIVEREF(__pyx_v_xi);
10406 PyTuple_SET_ITEM(__pyx_t_6, 1+__pyx_t_27, __pyx_v_xi);
10408 __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_6, NULL);
if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 527, __pyx_L1_error)
10409 __Pyx_GOTREF(__pyx_t_8);
10410 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
10412 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
10413 __pyx_t_12 = __pyx_PyFloat_AsDouble(__pyx_t_8);
if (unlikely((__pyx_t_12 == (
double)-1) && PyErr_Occurred())) __PYX_ERR(0, 527, __pyx_L1_error)
10414 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
10415 __pyx_v_area = __pyx_t_12;
10424 __pyx_t_19 = ((((PyObject *) __pyx_v_u_phi.memview) != Py_None) != 0);
10434 __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_pc, __pyx_n_s_getLevelSetValue);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 530, __pyx_L1_error)
10435 __Pyx_GOTREF(__pyx_t_4);
10436 __pyx_t_6 = __Pyx_PyInt_From_int(__pyx_v_nearestN);
if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 530, __pyx_L1_error)
10437 __Pyx_GOTREF(__pyx_t_6);
10438 __pyx_t_1 = __pyx_memoryview_fromslice(__pyx_v_coords, 1, (PyObject *(*)(
char *)) __pyx_memview_get_double, (
int (*)(
char *, PyObject *)) __pyx_memview_set_double, 0);;
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 530, __pyx_L1_error)
10439 __Pyx_GOTREF(__pyx_t_1);
10442 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) {
10443 __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
10444 if (likely(__pyx_t_5)) {
10445 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_4);
10446 __Pyx_INCREF(__pyx_t_5);
10447 __Pyx_INCREF(
function);
10448 __Pyx_DECREF_SET(__pyx_t_4,
function);
10452 #if CYTHON_FAST_PYCALL
10453 if (PyFunction_Check(__pyx_t_4)) {
10454 PyObject *__pyx_temp[3] = {__pyx_t_5, __pyx_t_6, __pyx_t_1};
10455 __pyx_t_8 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_27, 2+__pyx_t_27);
if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 530, __pyx_L1_error)
10456 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
10457 __Pyx_GOTREF(__pyx_t_8);
10458 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
10459 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
10462 #if CYTHON_FAST_PYCCALL
10463 if (__Pyx_PyFastCFunction_Check(__pyx_t_4)) {
10464 PyObject *__pyx_temp[3] = {__pyx_t_5, __pyx_t_6, __pyx_t_1};
10465 __pyx_t_8 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_27, 2+__pyx_t_27);
if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 530, __pyx_L1_error)
10466 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
10467 __Pyx_GOTREF(__pyx_t_8);
10468 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
10469 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
10473 __pyx_t_3 = PyTuple_New(2+__pyx_t_27);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 530, __pyx_L1_error)
10474 __Pyx_GOTREF(__pyx_t_3);
10476 __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_5); __pyx_t_5 = NULL;
10478 __Pyx_GIVEREF(__pyx_t_6);
10479 PyTuple_SET_ITEM(__pyx_t_3, 0+__pyx_t_27, __pyx_t_6);
10480 __Pyx_GIVEREF(__pyx_t_1);
10481 PyTuple_SET_ITEM(__pyx_t_3, 1+__pyx_t_27, __pyx_t_1);
10484 __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_3, NULL);
if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 530, __pyx_L1_error)
10485 __Pyx_GOTREF(__pyx_t_8);
10486 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
10488 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
10489 __pyx_t_12 = __pyx_PyFloat_AsDouble(__pyx_t_8);
if (unlikely((__pyx_t_12 == (
double)-1) && PyErr_Occurred())) __PYX_ERR(0, 530, __pyx_L1_error)
10490 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
10491 __pyx_v_ls_phi = __pyx_t_12;
10511 __pyx_v_ls_phi = 1e12;
10522 __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_pc, __pyx_n_s_evaluateFunAtX);
if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 533, __pyx_L1_error)
10523 __Pyx_GOTREF(__pyx_t_8);
10524 __pyx_t_4 = __Pyx_PyDict_NewPresized(2);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 533, __pyx_L1_error)
10525 __Pyx_GOTREF(__pyx_t_4);
10526 __pyx_t_3 = __pyx_memoryview_fromslice(__pyx_v_coords, 1, (PyObject *(*)(
char *)) __pyx_memview_get_double, (
int (*)(
char *, PyObject *)) __pyx_memview_set_double, 0);;
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 533, __pyx_L1_error)
10527 __Pyx_GOTREF(__pyx_t_3);
10528 if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_x, __pyx_t_3) < 0) __PYX_ERR(0, 533, __pyx_L1_error)
10529 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
10530 __pyx_t_3 = PyFloat_FromDouble(__pyx_v_ls_phi);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 533, __pyx_L1_error)
10531 __Pyx_GOTREF(__pyx_t_3);
10532 if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_ls_phi, __pyx_t_3) < 0) __PYX_ERR(0, 533, __pyx_L1_error)
10533 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
10534 __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_8, __pyx_empty_tuple, __pyx_t_4);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 533, __pyx_L1_error)
10535 __Pyx_GOTREF(__pyx_t_3);
10536 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
10537 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
10538 __pyx_t_12 = __pyx_PyFloat_AsDouble(__pyx_t_3);
if (unlikely((__pyx_t_12 == (
double)-1) && PyErr_Occurred())) __PYX_ERR(0, 533, __pyx_L1_error)
10539 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
10540 __pyx_v_f = __pyx_t_12;
10549 __pyx_t_27 = __pyx_v_nd;
10550 __pyx_t_28 = __pyx_t_27;
10551 for (__pyx_t_29 = 0; __pyx_t_29 < __pyx_t_28; __pyx_t_29+=1) {
10552 __pyx_v_ndi = __pyx_t_29;
10561 __pyx_t_36 = __pyx_v_ndi;
10562 if (__pyx_t_36 < 0) __pyx_t_36 += __pyx_v_v_grad.shape[0];
10563 __pyx_t_35 = __pyx_v_ndi;
10564 if (__pyx_t_35 < 0) __pyx_t_35 += __pyx_v_dphi.shape[0];
10565 *((
double *) ( (__pyx_v_dphi.data + __pyx_t_35 * __pyx_v_dphi.strides[0]) )) = ((*((
double *) ( (__pyx_v_v_grad.data + __pyx_t_36 * __pyx_v_v_grad.strides[0]) ))) / (((__pyx_v_t * 1.) / (__pyx_v_f * __pyx_v_Ccoeff)) + (((1.0 - __pyx_v_t) * 1.) / __pyx_v_area)));
10574 __pyx_t_36 = __pyx_v_ndi;
10575 if (__pyx_t_36 < 0) __pyx_t_36 += __pyx_v_dphi.shape[0];
10576 __pyx_t_35 = __pyx_v_ndi;
10577 if (__pyx_t_35 < 0) __pyx_t_35 += __pyx_v_fixed_dir.shape[0];
10578 __pyx_t_33 = __pyx_v_ndi;
10579 if (__pyx_t_33 < 0) __pyx_t_33 += __pyx_v_coords.shape[0];
10580 *((
double *) ( (__pyx_v_coords.data + __pyx_t_33 * __pyx_v_coords.strides[0]) )) += (((*((
double *) ( (__pyx_v_dphi.data + __pyx_t_36 * __pyx_v_dphi.strides[0]) ))) * __pyx_v_dt) * (*((
double *) ( (__pyx_v_fixed_dir.data + __pyx_t_35 * __pyx_v_fixed_dir.strides[0]) ))));
10589 __pyx_t_35 = __pyx_v_ndi;
10590 if (__pyx_t_35 < 0) __pyx_t_35 += __pyx_v_coords.shape[0];
10591 __pyx_t_36 = __pyx_v_node;
10592 __pyx_t_33 = __pyx_v_ndi;
10593 if (__pyx_t_36 < 0) __pyx_t_36 += __pyx_v_xx.shape[0];
10594 if (__pyx_t_33 < 0) __pyx_t_33 += __pyx_v_xx.shape[1];
10595 *((
double *) ( (( (__pyx_v_xx.data + __pyx_t_36 * __pyx_v_xx.strides[0]) ) + __pyx_t_33 * __pyx_v_xx.strides[1]) )) = (*((
double *) ( (__pyx_v_coords.data + __pyx_t_35 * __pyx_v_coords.strides[0]) )));
10625 __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_np);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 539, __pyx_L1_error)
10626 __Pyx_GOTREF(__pyx_t_3);
10627 __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_append);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 539, __pyx_L1_error)
10628 __Pyx_GOTREF(__pyx_t_4);
10629 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
10630 __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_new_rank);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 539, __pyx_L1_error)
10631 __Pyx_GOTREF(__pyx_t_3);
10632 __pyx_t_8 = __Pyx_PyDict_GetItem(__pyx_v_coords_2rank, __pyx_t_3);
if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 539, __pyx_L1_error)
10633 __Pyx_GOTREF(__pyx_t_8);
10634 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
10644 if (__pyx_t_35 < 0) __pyx_t_35 += __pyx_v_coords.shape[0];
10645 __pyx_t_3 = PyFloat_FromDouble((*((
double *) ( (__pyx_v_coords.data + __pyx_t_35 * __pyx_v_coords.strides[0]) ))));
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 540, __pyx_L1_error)
10646 __Pyx_GOTREF(__pyx_t_3);
10656 if (__pyx_t_35 < 0) __pyx_t_35 += __pyx_v_coords.shape[0];
10657 __pyx_t_1 = PyFloat_FromDouble((*((
double *) ( (__pyx_v_coords.data + __pyx_t_35 * __pyx_v_coords.strides[0]) ))));
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 541, __pyx_L1_error)
10658 __Pyx_GOTREF(__pyx_t_1);
10668 if (__pyx_t_35 < 0) __pyx_t_35 += __pyx_v_coords.shape[0];
10669 __pyx_t_6 = PyFloat_FromDouble((*((
double *) ( (__pyx_v_coords.data + __pyx_t_35 * __pyx_v_coords.strides[0]) ))));
if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 542, __pyx_L1_error)
10670 __Pyx_GOTREF(__pyx_t_6);
10679 __pyx_t_5 = __Pyx_PyInt_From_int(__pyx_v_nearestN);
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 543, __pyx_L1_error)
10680 __Pyx_GOTREF(__pyx_t_5);
10689 __pyx_t_42 = __Pyx_PyInt_From_int(__pyx_v_typeN);
if (unlikely(!__pyx_t_42)) __PYX_ERR(0, 544, __pyx_L1_error)
10690 __Pyx_GOTREF(__pyx_t_42);
10699 __pyx_t_7 = __Pyx_PyInt_From_int(__pyx_v_node);
if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 550, __pyx_L1_error)
10700 __Pyx_GOTREF(__pyx_t_7);
10709 __pyx_t_43 = __Pyx_PyInt_From_int(__pyx_v_my_rank);
if (unlikely(!__pyx_t_43)) __PYX_ERR(0, 551, __pyx_L1_error)
10710 __Pyx_GOTREF(__pyx_t_43);
10720 if (__pyx_t_35 < 0) __pyx_t_35 += __pyx_v_fixed_dir.shape[0];
10721 __pyx_t_44 = PyFloat_FromDouble((*((
double *) ( (__pyx_v_fixed_dir.data + __pyx_t_35 * __pyx_v_fixed_dir.strides[0]) ))));
if (unlikely(!__pyx_t_44)) __PYX_ERR(0, 552, __pyx_L1_error)
10722 __Pyx_GOTREF(__pyx_t_44);
10732 if (__pyx_t_35 < 0) __pyx_t_35 += __pyx_v_fixed_dir.shape[0];
10733 __pyx_t_45 = PyFloat_FromDouble((*((
double *) ( (__pyx_v_fixed_dir.data + __pyx_t_35 * __pyx_v_fixed_dir.strides[0]) ))));
if (unlikely(!__pyx_t_45)) __PYX_ERR(0, 553, __pyx_L1_error)
10734 __Pyx_GOTREF(__pyx_t_45);
10744 if (__pyx_t_35 < 0) __pyx_t_35 += __pyx_v_fixed_dir.shape[0];
10745 __pyx_t_46 = PyFloat_FromDouble((*((
double *) ( (__pyx_v_fixed_dir.data + __pyx_t_35 * __pyx_v_fixed_dir.strides[0]) ))));
if (unlikely(!__pyx_t_46)) __PYX_ERR(0, 554, __pyx_L1_error)
10746 __Pyx_GOTREF(__pyx_t_46);
10755 __pyx_t_47 = PyList_New(15);
if (unlikely(!__pyx_t_47)) __PYX_ERR(0, 540, __pyx_L1_error)
10756 __Pyx_GOTREF(__pyx_t_47);
10757 __Pyx_GIVEREF(__pyx_t_3);
10758 PyList_SET_ITEM(__pyx_t_47, 0, __pyx_t_3);
10759 __Pyx_GIVEREF(__pyx_t_1);
10760 PyList_SET_ITEM(__pyx_t_47, 1, __pyx_t_1);
10761 __Pyx_GIVEREF(__pyx_t_6);
10762 PyList_SET_ITEM(__pyx_t_47, 2, __pyx_t_6);
10763 __Pyx_GIVEREF(__pyx_t_5);
10764 PyList_SET_ITEM(__pyx_t_47, 3, __pyx_t_5);
10765 __Pyx_GIVEREF(__pyx_t_42);
10766 PyList_SET_ITEM(__pyx_t_47, 4, __pyx_t_42);
10767 __Pyx_INCREF(__pyx_int_0);
10768 __Pyx_GIVEREF(__pyx_int_0);
10769 PyList_SET_ITEM(__pyx_t_47, 5, __pyx_int_0);
10770 __Pyx_INCREF(__pyx_int_0);
10771 __Pyx_GIVEREF(__pyx_int_0);
10772 PyList_SET_ITEM(__pyx_t_47, 6, __pyx_int_0);
10773 __Pyx_INCREF(__pyx_int_0);
10774 __Pyx_GIVEREF(__pyx_int_0);
10775 PyList_SET_ITEM(__pyx_t_47, 7, __pyx_int_0);
10776 __Pyx_INCREF(__pyx_int_0);
10777 __Pyx_GIVEREF(__pyx_int_0);
10778 PyList_SET_ITEM(__pyx_t_47, 8, __pyx_int_0);
10779 __Pyx_INCREF(__pyx_int_0);
10780 __Pyx_GIVEREF(__pyx_int_0);
10781 PyList_SET_ITEM(__pyx_t_47, 9, __pyx_int_0);
10782 __Pyx_GIVEREF(__pyx_t_7);
10783 PyList_SET_ITEM(__pyx_t_47, 10, __pyx_t_7);
10784 __Pyx_GIVEREF(__pyx_t_43);
10785 PyList_SET_ITEM(__pyx_t_47, 11, __pyx_t_43);
10786 __Pyx_GIVEREF(__pyx_t_44);
10787 PyList_SET_ITEM(__pyx_t_47, 12, __pyx_t_44);
10788 __Pyx_GIVEREF(__pyx_t_45);
10789 PyList_SET_ITEM(__pyx_t_47, 13, __pyx_t_45);
10790 __Pyx_GIVEREF(__pyx_t_46);
10791 PyList_SET_ITEM(__pyx_t_47, 14, __pyx_t_46);
10802 __pyx_t_46 = PyList_New(1);
if (unlikely(!__pyx_t_46)) __PYX_ERR(0, 540, __pyx_L1_error)
10803 __Pyx_GOTREF(__pyx_t_46);
10804 __Pyx_GIVEREF(__pyx_t_47);
10805 PyList_SET_ITEM(__pyx_t_46, 0, __pyx_t_47);
10815 __pyx_t_47 = PyTuple_New(2);
if (unlikely(!__pyx_t_47)) __PYX_ERR(0, 539, __pyx_L1_error)
10816 __Pyx_GOTREF(__pyx_t_47);
10817 __Pyx_GIVEREF(__pyx_t_8);
10818 PyTuple_SET_ITEM(__pyx_t_47, 0, __pyx_t_8);
10819 __Pyx_GIVEREF(__pyx_t_46);
10820 PyTuple_SET_ITEM(__pyx_t_47, 1, __pyx_t_46);
10831 __pyx_t_46 = __Pyx_PyDict_NewPresized(1);
if (unlikely(!__pyx_t_46)) __PYX_ERR(0, 555, __pyx_L1_error)
10832 __Pyx_GOTREF(__pyx_t_46);
10833 if (PyDict_SetItem(__pyx_t_46, __pyx_n_s_axis, __pyx_int_0) < 0) __PYX_ERR(0, 555, __pyx_L1_error)
10842 __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_47, __pyx_t_46);
if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 539, __pyx_L1_error)
10843 __Pyx_GOTREF(__pyx_t_8);
10844 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
10845 __Pyx_DECREF(__pyx_t_47); __pyx_t_47 = 0;
10846 __Pyx_DECREF(__pyx_t_46); __pyx_t_46 = 0;
10847 __pyx_t_46 = __Pyx_PyInt_From_int(__pyx_v_new_rank);
if (unlikely(!__pyx_t_46)) __PYX_ERR(0, 539, __pyx_L1_error)
10848 __Pyx_GOTREF(__pyx_t_46);
10849 if (unlikely(PyDict_SetItem(__pyx_v_coords_2rank, __pyx_t_46, __pyx_t_8) < 0)) __PYX_ERR(0, 539, __pyx_L1_error)
10850 __Pyx_DECREF(__pyx_t_46); __pyx_t_46 = 0;
10851 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
10860 __pyx_t_35 = __pyx_v_node;
10861 if (__pyx_t_35 < 0) __pyx_t_35 += __pyx_v_nodesSentBoolArray.shape[0];
10862 *((
double *) ( (__pyx_v_nodesSentBoolArray.data + __pyx_t_35 * __pyx_v_nodesSentBoolArray.strides[0]) )) = 1.0;
10871 __pyx_v_nPending_disp = (__pyx_v_nPending_disp + 1);
10904 __pyx_t_46 = __Pyx_PyObject_GetAttrStr(__pyx_v_comm, __pyx_n_s_barrier);
if (unlikely(!__pyx_t_46)) __PYX_ERR(0, 559, __pyx_L1_error)
10905 __Pyx_GOTREF(__pyx_t_46);
10907 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_46))) {
10908 __pyx_t_47 = PyMethod_GET_SELF(__pyx_t_46);
10909 if (likely(__pyx_t_47)) {
10910 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_46);
10911 __Pyx_INCREF(__pyx_t_47);
10912 __Pyx_INCREF(
function);
10913 __Pyx_DECREF_SET(__pyx_t_46,
function);
10916 __pyx_t_8 = (__pyx_t_47) ? __Pyx_PyObject_CallOneArg(__pyx_t_46, __pyx_t_47) : __Pyx_PyObject_CallNoArg(__pyx_t_46);
10917 __Pyx_XDECREF(__pyx_t_47); __pyx_t_47 = 0;
10918 if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 559, __pyx_L1_error)
10919 __Pyx_GOTREF(__pyx_t_8);
10920 __Pyx_DECREF(__pyx_t_46); __pyx_t_46 = 0;
10921 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
10930 __pyx_t_19 = ((__pyx_cur_scope->__pyx_v_comm_size > 1) != 0);
10940 __pyx_t_46 = __Pyx_PyObject_GetAttrStr(__pyx_v_comm, __pyx_n_s_allreduce);
if (unlikely(!__pyx_t_46)) __PYX_ERR(0, 562, __pyx_L1_error)
10941 __Pyx_GOTREF(__pyx_t_46);
10942 __pyx_t_47 = __Pyx_PyInt_From_int(__pyx_v_nPending_disp);
if (unlikely(!__pyx_t_47)) __PYX_ERR(0, 562, __pyx_L1_error)
10943 __Pyx_GOTREF(__pyx_t_47);
10945 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_46))) {
10946 __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_46);
10947 if (likely(__pyx_t_4)) {
10948 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_46);
10949 __Pyx_INCREF(__pyx_t_4);
10950 __Pyx_INCREF(
function);
10951 __Pyx_DECREF_SET(__pyx_t_46,
function);
10954 __pyx_t_8 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_46, __pyx_t_4, __pyx_t_47) : __Pyx_PyObject_CallOneArg(__pyx_t_46, __pyx_t_47);
10955 __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
10956 __Pyx_DECREF(__pyx_t_47); __pyx_t_47 = 0;
10957 if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 562, __pyx_L1_error)
10958 __Pyx_GOTREF(__pyx_t_8);
10959 __Pyx_DECREF(__pyx_t_46); __pyx_t_46 = 0;
10960 __pyx_t_22 = __Pyx_PyInt_As_int(__pyx_t_8);
if (unlikely((__pyx_t_22 == (
int)-1) && PyErr_Occurred())) __PYX_ERR(0, 562, __pyx_L1_error)
10961 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
10962 __pyx_v_nPending_disp_total = __pyx_t_22;
10971 __pyx_v_parallel_steps = -1;
10981 __pyx_t_19 = ((__pyx_v_nPending_disp_total > 0) != 0);
10982 if (!__pyx_t_19)
break;
10991 __pyx_v_parallel_steps = (__pyx_v_parallel_steps + 1);
11000 __pyx_v_nPending_disp = 0;
11009 __pyx_v_sendBack = 1;
11018 __pyx_t_8 = __Pyx_PyInt_From_int(__pyx_cur_scope->__pyx_v_comm_size);
if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 571, __pyx_L1_error)
11019 __Pyx_GOTREF(__pyx_t_8);
11020 __pyx_t_46 = __Pyx_PyObject_CallOneArg(__pyx_builtin_range, __pyx_t_8);
if (unlikely(!__pyx_t_46)) __PYX_ERR(0, 571, __pyx_L1_error)
11021 __Pyx_GOTREF(__pyx_t_46);
11022 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
11023 if (likely(PyList_CheckExact(__pyx_t_46)) || PyTuple_CheckExact(__pyx_t_46)) {
11024 __pyx_t_8 = __pyx_t_46; __Pyx_INCREF(__pyx_t_8); __pyx_t_15 = 0;
11027 __pyx_t_15 = -1; __pyx_t_8 = PyObject_GetIter(__pyx_t_46);
if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 571, __pyx_L1_error)
11028 __Pyx_GOTREF(__pyx_t_8);
11029 __pyx_t_16 = Py_TYPE(__pyx_t_8)->tp_iternext;
if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 571, __pyx_L1_error)
11031 __Pyx_DECREF(__pyx_t_46); __pyx_t_46 = 0;
11033 if (likely(!__pyx_t_16)) {
11034 if (likely(PyList_CheckExact(__pyx_t_8))) {
11035 if (__pyx_t_15 >= PyList_GET_SIZE(__pyx_t_8))
break;
11036 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
11037 __pyx_t_46 = PyList_GET_ITEM(__pyx_t_8, __pyx_t_15); __Pyx_INCREF(__pyx_t_46); __pyx_t_15++;
if (unlikely(0 < 0)) __PYX_ERR(0, 571, __pyx_L1_error)
11039 __pyx_t_46 = PySequence_ITEM(__pyx_t_8, __pyx_t_15); __pyx_t_15++;
if (unlikely(!__pyx_t_46)) __PYX_ERR(0, 571, __pyx_L1_error)
11040 __Pyx_GOTREF(__pyx_t_46);
11043 if (__pyx_t_15 >= PyTuple_GET_SIZE(__pyx_t_8))
break;
11044 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
11045 __pyx_t_46 = PyTuple_GET_ITEM(__pyx_t_8, __pyx_t_15); __Pyx_INCREF(__pyx_t_46); __pyx_t_15++;
if (unlikely(0 < 0)) __PYX_ERR(0, 571, __pyx_L1_error)
11047 __pyx_t_46 = PySequence_ITEM(__pyx_t_8, __pyx_t_15); __pyx_t_15++;
if (unlikely(!__pyx_t_46)) __PYX_ERR(0, 571, __pyx_L1_error)
11048 __Pyx_GOTREF(__pyx_t_46);
11052 __pyx_t_46 = __pyx_t_16(__pyx_t_8);
11053 if (unlikely(!__pyx_t_46)) {
11054 PyObject* exc_type = PyErr_Occurred();
11056 if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
11057 else __PYX_ERR(0, 571, __pyx_L1_error)
11061 __Pyx_GOTREF(__pyx_t_46);
11063 __Pyx_XDECREF_SET(__pyx_v_rank, __pyx_t_46);
11073 __pyx_t_46 = __Pyx_PyDict_GetItem(__pyx_v_coords_2rank, __pyx_v_rank);
if (unlikely(!__pyx_t_46)) __PYX_ERR(0, 572, __pyx_L1_error)
11074 __Pyx_GOTREF(__pyx_t_46);
11075 __pyx_t_41 = PyObject_Length(__pyx_t_46);
if (unlikely(__pyx_t_41 == ((Py_ssize_t)-1))) __PYX_ERR(0, 572, __pyx_L1_error)
11076 __Pyx_DECREF(__pyx_t_46); __pyx_t_46 = 0;
11077 __pyx_t_48 = __Pyx_PyIndex_AsSsize_t(__pyx_v_rank);
if (unlikely((__pyx_t_48 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 572, __pyx_L1_error)
11078 __pyx_t_35 = __pyx_t_48;
11079 if (__pyx_t_35 < 0) __pyx_t_35 += __pyx_v_counts_local.shape[0];
11080 *((
int *) ( (__pyx_v_counts_local.data + __pyx_t_35 * __pyx_v_counts_local.strides[0]) )) = __pyx_t_41;
11090 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
11099 __pyx_t_46 = __Pyx_PyObject_GetAttrStr(__pyx_v_comm, __pyx_n_s_Allgatherv);
if (unlikely(!__pyx_t_46)) __PYX_ERR(0, 573, __pyx_L1_error)
11100 __Pyx_GOTREF(__pyx_t_46);
11101 __pyx_t_47 = __pyx_memoryview_fromslice(__pyx_v_counts_local, 1, (PyObject *(*)(
char *)) __pyx_memview_get_int, (
int (*)(
char *, PyObject *)) __pyx_memview_set_int, 0);;
if (unlikely(!__pyx_t_47)) __PYX_ERR(0, 573, __pyx_L1_error)
11102 __Pyx_GOTREF(__pyx_t_47);
11103 __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_MPI);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 573, __pyx_L1_error)
11104 __Pyx_GOTREF(__pyx_t_4);
11105 __pyx_t_45 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_INT);
if (unlikely(!__pyx_t_45)) __PYX_ERR(0, 573, __pyx_L1_error)
11106 __Pyx_GOTREF(__pyx_t_45);
11107 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
11108 __pyx_t_4 = PyList_New(2);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 573, __pyx_L1_error)
11109 __Pyx_GOTREF(__pyx_t_4);
11110 __Pyx_GIVEREF(__pyx_t_47);
11111 PyList_SET_ITEM(__pyx_t_4, 0, __pyx_t_47);
11112 __Pyx_GIVEREF(__pyx_t_45);
11113 PyList_SET_ITEM(__pyx_t_4, 1, __pyx_t_45);
11124 __pyx_t_45 = __pyx_memoryview_fromslice(__pyx_v_counts_total, 2, (PyObject *(*)(
char *)) __pyx_memview_get_int, (
int (*)(
char *, PyObject *)) __pyx_memview_set_int, 0);;
if (unlikely(!__pyx_t_45)) __PYX_ERR(0, 574, __pyx_L1_error)
11125 __Pyx_GOTREF(__pyx_t_45);
11134 __pyx_t_47 = PyList_New(0);
if (unlikely(!__pyx_t_47)) __PYX_ERR(0, 575, __pyx_L1_error)
11135 __Pyx_GOTREF(__pyx_t_47);
11136 __pyx_t_22 = __pyx_cur_scope->__pyx_v_comm_size;
11137 __pyx_t_23 = __pyx_t_22;
11138 for (__pyx_t_24 = 0; __pyx_t_24 < __pyx_t_23; __pyx_t_24+=1) {
11139 __pyx_v_i = __pyx_t_24;
11140 __pyx_t_44 = __Pyx_PyInt_From_int(__pyx_cur_scope->__pyx_v_comm_size);
if (unlikely(!__pyx_t_44)) __PYX_ERR(0, 575, __pyx_L1_error)
11141 __Pyx_GOTREF(__pyx_t_44);
11142 if (unlikely(__Pyx_ListComp_Append(__pyx_t_47, (PyObject*)__pyx_t_44))) __PYX_ERR(0, 575, __pyx_L1_error)
11143 __Pyx_DECREF(__pyx_t_44); __pyx_t_44 = 0;
11153 __pyx_t_44 = PyList_New(0);
if (unlikely(!__pyx_t_44)) __PYX_ERR(0, 576, __pyx_L1_error)
11154 __Pyx_GOTREF(__pyx_t_44);
11155 __pyx_t_22 = __pyx_cur_scope->__pyx_v_comm_size;
11156 __pyx_t_23 = __pyx_t_22;
11157 for (__pyx_t_24 = 0; __pyx_t_24 < __pyx_t_23; __pyx_t_24+=1) {
11158 __pyx_v_i = __pyx_t_24;
11159 __pyx_t_43 = __Pyx_PyInt_From_int((__pyx_cur_scope->__pyx_v_comm_size * __pyx_v_i));
if (unlikely(!__pyx_t_43)) __PYX_ERR(0, 576, __pyx_L1_error)
11160 __Pyx_GOTREF(__pyx_t_43);
11161 if (unlikely(__Pyx_ListComp_Append(__pyx_t_44, (PyObject*)__pyx_t_43))) __PYX_ERR(0, 576, __pyx_L1_error)
11162 __Pyx_DECREF(__pyx_t_43); __pyx_t_43 = 0;
11172 __Pyx_GetModuleGlobalName(__pyx_t_43, __pyx_n_s_MPI);
if (unlikely(!__pyx_t_43)) __PYX_ERR(0, 577, __pyx_L1_error)
11173 __Pyx_GOTREF(__pyx_t_43);
11174 __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_43, __pyx_n_s_INT);
if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 577, __pyx_L1_error)
11175 __Pyx_GOTREF(__pyx_t_7);
11176 __Pyx_DECREF(__pyx_t_43); __pyx_t_43 = 0;
11185 __pyx_t_43 = PyList_New(4);
if (unlikely(!__pyx_t_43)) __PYX_ERR(0, 574, __pyx_L1_error)
11186 __Pyx_GOTREF(__pyx_t_43);
11187 __Pyx_GIVEREF(__pyx_t_45);
11188 PyList_SET_ITEM(__pyx_t_43, 0, __pyx_t_45);
11189 __Pyx_GIVEREF(__pyx_t_47);
11190 PyList_SET_ITEM(__pyx_t_43, 1, __pyx_t_47);
11191 __Pyx_GIVEREF(__pyx_t_44);
11192 PyList_SET_ITEM(__pyx_t_43, 2, __pyx_t_44);
11193 __Pyx_GIVEREF(__pyx_t_7);
11194 PyList_SET_ITEM(__pyx_t_43, 3, __pyx_t_7);
11201 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_46))) {
11202 __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_46);
11203 if (likely(__pyx_t_7)) {
11204 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_46);
11205 __Pyx_INCREF(__pyx_t_7);
11206 __Pyx_INCREF(
function);
11207 __Pyx_DECREF_SET(__pyx_t_46,
function);
11211 #if CYTHON_FAST_PYCALL
11212 if (PyFunction_Check(__pyx_t_46)) {
11213 PyObject *__pyx_temp[3] = {__pyx_t_7, __pyx_t_4, __pyx_t_43};
11214 __pyx_t_8 = __Pyx_PyFunction_FastCall(__pyx_t_46, __pyx_temp+1-__pyx_t_22, 2+__pyx_t_22);
if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 573, __pyx_L1_error)
11215 __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
11216 __Pyx_GOTREF(__pyx_t_8);
11217 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
11218 __Pyx_DECREF(__pyx_t_43); __pyx_t_43 = 0;
11221 #if CYTHON_FAST_PYCCALL
11222 if (__Pyx_PyFastCFunction_Check(__pyx_t_46)) {
11223 PyObject *__pyx_temp[3] = {__pyx_t_7, __pyx_t_4, __pyx_t_43};
11224 __pyx_t_8 = __Pyx_PyCFunction_FastCall(__pyx_t_46, __pyx_temp+1-__pyx_t_22, 2+__pyx_t_22);
if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 573, __pyx_L1_error)
11225 __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
11226 __Pyx_GOTREF(__pyx_t_8);
11227 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
11228 __Pyx_DECREF(__pyx_t_43); __pyx_t_43 = 0;
11232 __pyx_t_44 = PyTuple_New(2+__pyx_t_22);
if (unlikely(!__pyx_t_44)) __PYX_ERR(0, 573, __pyx_L1_error)
11233 __Pyx_GOTREF(__pyx_t_44);
11235 __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_44, 0, __pyx_t_7); __pyx_t_7 = NULL;
11237 __Pyx_GIVEREF(__pyx_t_4);
11238 PyTuple_SET_ITEM(__pyx_t_44, 0+__pyx_t_22, __pyx_t_4);
11239 __Pyx_GIVEREF(__pyx_t_43);
11240 PyTuple_SET_ITEM(__pyx_t_44, 1+__pyx_t_22, __pyx_t_43);
11243 __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_46, __pyx_t_44, NULL);
if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 573, __pyx_L1_error)
11244 __Pyx_GOTREF(__pyx_t_8);
11245 __Pyx_DECREF(__pyx_t_44); __pyx_t_44 = 0;
11247 __Pyx_DECREF(__pyx_t_46); __pyx_t_46 = 0;
11248 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
11257 __pyx_t_46 = __Pyx_PyObject_GetAttrStr(__pyx_v_comm, __pyx_n_s_barrier);
if (unlikely(!__pyx_t_46)) __PYX_ERR(0, 578, __pyx_L1_error)
11258 __Pyx_GOTREF(__pyx_t_46);
11260 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_46))) {
11261 __pyx_t_44 = PyMethod_GET_SELF(__pyx_t_46);
11262 if (likely(__pyx_t_44)) {
11263 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_46);
11264 __Pyx_INCREF(__pyx_t_44);
11265 __Pyx_INCREF(
function);
11266 __Pyx_DECREF_SET(__pyx_t_46,
function);
11269 __pyx_t_8 = (__pyx_t_44) ? __Pyx_PyObject_CallOneArg(__pyx_t_46, __pyx_t_44) : __Pyx_PyObject_CallNoArg(__pyx_t_46);
11270 __Pyx_XDECREF(__pyx_t_44); __pyx_t_44 = 0;
11271 if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 578, __pyx_L1_error)
11272 __Pyx_GOTREF(__pyx_t_8);
11273 __Pyx_DECREF(__pyx_t_46); __pyx_t_46 = 0;
11274 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
11283 __pyx_t_22 = __pyx_cur_scope->__pyx_v_comm_size;
11284 __pyx_t_23 = __pyx_t_22;
11285 for (__pyx_t_24 = 0; __pyx_t_24 < __pyx_t_23; __pyx_t_24+=1) {
11286 __pyx_v_rank_recv = __pyx_t_24;
11295 __Pyx_INCREF(__pyx_int_0);
11296 __Pyx_XDECREF_SET(__pyx_v_array_size, __pyx_int_0);
11305 __pyx_t_8 = __Pyx_PyInt_From_int(__pyx_cur_scope->__pyx_v_comm_size);
if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 582, __pyx_L1_error)
11306 __Pyx_GOTREF(__pyx_t_8);
11307 __pyx_t_46 = __Pyx_PyObject_CallOneArg(__pyx_builtin_range, __pyx_t_8);
if (unlikely(!__pyx_t_46)) __PYX_ERR(0, 582, __pyx_L1_error)
11308 __Pyx_GOTREF(__pyx_t_46);
11309 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
11310 if (likely(PyList_CheckExact(__pyx_t_46)) || PyTuple_CheckExact(__pyx_t_46)) {
11311 __pyx_t_8 = __pyx_t_46; __Pyx_INCREF(__pyx_t_8); __pyx_t_15 = 0;
11314 __pyx_t_15 = -1; __pyx_t_8 = PyObject_GetIter(__pyx_t_46);
if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 582, __pyx_L1_error)
11315 __Pyx_GOTREF(__pyx_t_8);
11316 __pyx_t_16 = Py_TYPE(__pyx_t_8)->tp_iternext;
if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 582, __pyx_L1_error)
11318 __Pyx_DECREF(__pyx_t_46); __pyx_t_46 = 0;
11320 if (likely(!__pyx_t_16)) {
11321 if (likely(PyList_CheckExact(__pyx_t_8))) {
11322 if (__pyx_t_15 >= PyList_GET_SIZE(__pyx_t_8))
break;
11323 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
11324 __pyx_t_46 = PyList_GET_ITEM(__pyx_t_8, __pyx_t_15); __Pyx_INCREF(__pyx_t_46); __pyx_t_15++;
if (unlikely(0 < 0)) __PYX_ERR(0, 582, __pyx_L1_error)
11326 __pyx_t_46 = PySequence_ITEM(__pyx_t_8, __pyx_t_15); __pyx_t_15++;
if (unlikely(!__pyx_t_46)) __PYX_ERR(0, 582, __pyx_L1_error)
11327 __Pyx_GOTREF(__pyx_t_46);
11330 if (__pyx_t_15 >= PyTuple_GET_SIZE(__pyx_t_8))
break;
11331 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
11332 __pyx_t_46 = PyTuple_GET_ITEM(__pyx_t_8, __pyx_t_15); __Pyx_INCREF(__pyx_t_46); __pyx_t_15++;
if (unlikely(0 < 0)) __PYX_ERR(0, 582, __pyx_L1_error)
11334 __pyx_t_46 = PySequence_ITEM(__pyx_t_8, __pyx_t_15); __pyx_t_15++;
if (unlikely(!__pyx_t_46)) __PYX_ERR(0, 582, __pyx_L1_error)
11335 __Pyx_GOTREF(__pyx_t_46);
11339 __pyx_t_46 = __pyx_t_16(__pyx_t_8);
11340 if (unlikely(!__pyx_t_46)) {
11341 PyObject* exc_type = PyErr_Occurred();
11343 if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
11344 else __PYX_ERR(0, 582, __pyx_L1_error)
11348 __Pyx_GOTREF(__pyx_t_46);
11350 __Pyx_XDECREF_SET(__pyx_v_rank, __pyx_t_46);
11360 __pyx_t_41 = __Pyx_PyIndex_AsSsize_t(__pyx_v_rank);
if (unlikely((__pyx_t_41 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 583, __pyx_L1_error)
11361 __pyx_t_35 = __pyx_t_41;
11362 __pyx_t_33 = __pyx_v_rank_recv;
11363 if (__pyx_t_35 < 0) __pyx_t_35 += __pyx_v_counts_total.shape[0];
11364 if (__pyx_t_33 < 0) __pyx_t_33 += __pyx_v_counts_total.shape[1];
11365 __pyx_t_46 = __Pyx_PyInt_From_int((*((
int *) ( (( (__pyx_v_counts_total.data + __pyx_t_35 * __pyx_v_counts_total.strides[0]) ) + __pyx_t_33 * __pyx_v_counts_total.strides[1]) ))));
if (unlikely(!__pyx_t_46)) __PYX_ERR(0, 583, __pyx_L1_error)
11366 __Pyx_GOTREF(__pyx_t_46);
11367 __pyx_t_44 = PyNumber_InPlaceAdd(__pyx_v_array_size, __pyx_t_46);
if (unlikely(!__pyx_t_44)) __PYX_ERR(0, 583, __pyx_L1_error)
11368 __Pyx_GOTREF(__pyx_t_44);
11369 __Pyx_DECREF(__pyx_t_46); __pyx_t_46 = 0;
11370 __Pyx_DECREF_SET(__pyx_v_array_size, __pyx_t_44);
11380 __pyx_t_41 = __Pyx_PyIndex_AsSsize_t(__pyx_v_rank);
if (unlikely((__pyx_t_41 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 584, __pyx_L1_error)
11381 __pyx_t_33 = __pyx_t_41;
11382 __pyx_t_35 = __pyx_v_rank_recv;
11383 if (__pyx_t_33 < 0) __pyx_t_33 += __pyx_v_counts_total.shape[0];
11384 if (__pyx_t_35 < 0) __pyx_t_35 += __pyx_v_counts_total.shape[1];
11385 __pyx_t_48 = __Pyx_PyIndex_AsSsize_t(__pyx_v_rank);
if (unlikely((__pyx_t_48 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 584, __pyx_L1_error)
11386 __pyx_t_36 = __pyx_t_48;
11387 if (__pyx_t_36 < 0) __pyx_t_36 += __pyx_cur_scope->__pyx_v_counts_in.shape[0];
11388 *((
int *) ( (__pyx_cur_scope->__pyx_v_counts_in.data + __pyx_t_36 * __pyx_cur_scope->__pyx_v_counts_in.strides[0]) )) = (*((
int *) ( (( (__pyx_v_counts_total.data + __pyx_t_33 * __pyx_v_counts_total.strides[0]) ) + __pyx_t_35 * __pyx_v_counts_total.strides[1]) )));
11397 __pyx_t_44 = PyObject_RichCompare(__pyx_v_rank, __pyx_int_0, Py_GT); __Pyx_XGOTREF(__pyx_t_44);
if (unlikely(!__pyx_t_44)) __PYX_ERR(0, 585, __pyx_L1_error)
11398 __pyx_t_19 = __Pyx_PyObject_IsTrue(__pyx_t_44);
if (unlikely(__pyx_t_19 < 0)) __PYX_ERR(0, 585, __pyx_L1_error)
11399 __Pyx_DECREF(__pyx_t_44); __pyx_t_44 = 0;
11409 __pyx_t_44 = __Pyx_PyInt_SubtractObjC(__pyx_v_rank, __pyx_int_1, 1, 0, 0);
if (unlikely(!__pyx_t_44)) __PYX_ERR(0, 586, __pyx_L1_error)
11410 __Pyx_GOTREF(__pyx_t_44);
11411 __pyx_t_41 = __Pyx_PyIndex_AsSsize_t(__pyx_t_44);
if (unlikely((__pyx_t_41 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 586, __pyx_L1_error)
11412 __Pyx_DECREF(__pyx_t_44); __pyx_t_44 = 0;
11413 __pyx_t_35 = __pyx_t_41;
11414 if (__pyx_t_35 < 0) __pyx_t_35 += __pyx_cur_scope->__pyx_v_displacements_in.shape[0];
11415 __pyx_t_44 = __Pyx_PyInt_SubtractObjC(__pyx_v_rank, __pyx_int_1, 1, 0, 0);
if (unlikely(!__pyx_t_44)) __PYX_ERR(0, 586, __pyx_L1_error)
11416 __Pyx_GOTREF(__pyx_t_44);
11417 __pyx_t_48 = __Pyx_PyIndex_AsSsize_t(__pyx_t_44);
if (unlikely((__pyx_t_48 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 586, __pyx_L1_error)
11418 __Pyx_DECREF(__pyx_t_44); __pyx_t_44 = 0;
11419 __pyx_t_33 = __pyx_t_48;
11420 if (__pyx_t_33 < 0) __pyx_t_33 += __pyx_cur_scope->__pyx_v_counts_in.shape[0];
11421 __pyx_t_49 = __Pyx_PyIndex_AsSsize_t(__pyx_v_rank);
if (unlikely((__pyx_t_49 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 586, __pyx_L1_error)
11422 __pyx_t_36 = __pyx_t_49;
11423 if (__pyx_t_36 < 0) __pyx_t_36 += __pyx_cur_scope->__pyx_v_displacements_in.shape[0];
11424 *((
int *) ( (__pyx_cur_scope->__pyx_v_displacements_in.data + __pyx_t_36 * __pyx_cur_scope->__pyx_v_displacements_in.strides[0]) )) = ((*((
int *) ( (__pyx_cur_scope->__pyx_v_displacements_in.data + __pyx_t_35 * __pyx_cur_scope->__pyx_v_displacements_in.strides[0]) ))) + (*((
int *) ( (__pyx_cur_scope->__pyx_v_counts_in.data + __pyx_t_33 * __pyx_cur_scope->__pyx_v_counts_in.strides[0]) ))));
11443 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
11452 __pyx_t_33 = __pyx_v_rank_recv;
11453 __pyx_t_35 = __pyx_v_rank_recv;
11454 if (__pyx_t_33 < 0) __pyx_t_33 += __pyx_v_counts_total.shape[0];
11455 if (__pyx_t_35 < 0) __pyx_t_35 += __pyx_v_counts_total.shape[1];
11456 __pyx_t_8 = __Pyx_PyInt_From_int((*((
int *) ( (( (__pyx_v_counts_total.data + __pyx_t_33 * __pyx_v_counts_total.strides[0]) ) + __pyx_t_35 * __pyx_v_counts_total.strides[1]) ))));
if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 588, __pyx_L1_error)
11457 __Pyx_GOTREF(__pyx_t_8);
11458 __pyx_t_44 = PyNumber_Subtract(__pyx_v_array_size, __pyx_t_8);
if (unlikely(!__pyx_t_44)) __PYX_ERR(0, 588, __pyx_L1_error)
11459 __Pyx_GOTREF(__pyx_t_44);
11460 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
11461 __pyx_t_8 = PyObject_RichCompare(__pyx_t_44, __pyx_int_0, Py_GT); __Pyx_XGOTREF(__pyx_t_8);
if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 588, __pyx_L1_error)
11462 __Pyx_DECREF(__pyx_t_44); __pyx_t_44 = 0;
11463 __pyx_t_19 = __Pyx_PyObject_IsTrue(__pyx_t_8);
if (unlikely(__pyx_t_19 < 0)) __PYX_ERR(0, 588, __pyx_L1_error)
11464 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
11474 __pyx_t_19 = ((__pyx_v_my_rank == __pyx_v_rank_recv) != 0);
11484 __Pyx_GetModuleGlobalName(__pyx_t_44, __pyx_n_s_np);
if (unlikely(!__pyx_t_44)) __PYX_ERR(0, 591, __pyx_L1_error)
11485 __Pyx_GOTREF(__pyx_t_44);
11486 __pyx_t_46 = __Pyx_PyObject_GetAttrStr(__pyx_t_44, __pyx_n_s_zeros);
if (unlikely(!__pyx_t_46)) __PYX_ERR(0, 591, __pyx_L1_error)
11487 __Pyx_GOTREF(__pyx_t_46);
11488 __Pyx_DECREF(__pyx_t_44); __pyx_t_44 = 0;
11489 __pyx_t_44 = PyTuple_New(2);
if (unlikely(!__pyx_t_44)) __PYX_ERR(0, 591, __pyx_L1_error)
11490 __Pyx_GOTREF(__pyx_t_44);
11491 __Pyx_INCREF(__pyx_v_array_size);
11492 __Pyx_GIVEREF(__pyx_v_array_size);
11493 PyTuple_SET_ITEM(__pyx_t_44, 0, __pyx_v_array_size);
11494 __Pyx_INCREF(__pyx_int_15);
11495 __Pyx_GIVEREF(__pyx_int_15);
11496 PyTuple_SET_ITEM(__pyx_t_44, 1, __pyx_int_15);
11498 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_46))) {
11499 __pyx_t_43 = PyMethod_GET_SELF(__pyx_t_46);
11500 if (likely(__pyx_t_43)) {
11501 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_46);
11502 __Pyx_INCREF(__pyx_t_43);
11503 __Pyx_INCREF(
function);
11504 __Pyx_DECREF_SET(__pyx_t_46,
function);
11507 __pyx_t_8 = (__pyx_t_43) ? __Pyx_PyObject_Call2Args(__pyx_t_46, __pyx_t_43, __pyx_t_44) : __Pyx_PyObject_CallOneArg(__pyx_t_46, __pyx_t_44);
11508 __Pyx_XDECREF(__pyx_t_43); __pyx_t_43 = 0;
11509 __Pyx_DECREF(__pyx_t_44); __pyx_t_44 = 0;
11510 if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 591, __pyx_L1_error)
11511 __Pyx_GOTREF(__pyx_t_8);
11512 __Pyx_DECREF(__pyx_t_46); __pyx_t_46 = 0;
11513 __pyx_t_13 = __Pyx_PyObject_to_MemoryviewSlice_dsds_double(__pyx_t_8, PyBUF_WRITABLE);
if (unlikely(!__pyx_t_13.memview)) __PYX_ERR(0, 591, __pyx_L1_error)
11514 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
11515 __PYX_XDEC_MEMVIEW(&__pyx_cur_scope->__pyx_v_coords_2doArray, 1);
11516 __pyx_cur_scope->__pyx_v_coords_2doArray = __pyx_t_13;
11517 __pyx_t_13.memview = NULL;
11518 __pyx_t_13.data = NULL;
11536 __Pyx_GetModuleGlobalName(__pyx_t_44, __pyx_n_s_MPI);
if (unlikely(!__pyx_t_44)) __PYX_ERR(0, 594, __pyx_L1_error)
11537 __Pyx_GOTREF(__pyx_t_44);
11538 __pyx_t_43 = __Pyx_PyObject_GetAttrStr(__pyx_t_44, __pyx_n_s_DOUBLE);
if (unlikely(!__pyx_t_43)) __PYX_ERR(0, 594, __pyx_L1_error)
11539 __Pyx_GOTREF(__pyx_t_43);
11540 __Pyx_DECREF(__pyx_t_44); __pyx_t_44 = 0;
11541 __pyx_t_44 = __Pyx_PyObject_GetAttrStr(__pyx_t_43, __pyx_n_s_Create_contiguous);
if (unlikely(!__pyx_t_44)) __PYX_ERR(0, 594, __pyx_L1_error)
11542 __Pyx_GOTREF(__pyx_t_44);
11543 __Pyx_DECREF(__pyx_t_43); __pyx_t_43 = 0;
11545 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_44))) {
11546 __pyx_t_43 = PyMethod_GET_SELF(__pyx_t_44);
11547 if (likely(__pyx_t_43)) {
11548 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_44);
11549 __Pyx_INCREF(__pyx_t_43);
11550 __Pyx_INCREF(
function);
11551 __Pyx_DECREF_SET(__pyx_t_44,
function);
11554 __pyx_t_46 = (__pyx_t_43) ? __Pyx_PyObject_Call2Args(__pyx_t_44, __pyx_t_43, __pyx_int_15) : __Pyx_PyObject_CallOneArg(__pyx_t_44, __pyx_int_15);
11555 __Pyx_XDECREF(__pyx_t_43); __pyx_t_43 = 0;
11556 if (unlikely(!__pyx_t_46)) __PYX_ERR(0, 594, __pyx_L1_error)
11557 __Pyx_GOTREF(__pyx_t_46);
11558 __Pyx_DECREF(__pyx_t_44); __pyx_t_44 = 0;
11559 __pyx_t_44 = __Pyx_PyObject_GetAttrStr(__pyx_t_46, __pyx_n_s_Commit);
if (unlikely(!__pyx_t_44)) __PYX_ERR(0, 594, __pyx_L1_error)
11560 __Pyx_GOTREF(__pyx_t_44);
11561 __Pyx_DECREF(__pyx_t_46); __pyx_t_46 = 0;
11563 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_44))) {
11564 __pyx_t_46 = PyMethod_GET_SELF(__pyx_t_44);
11565 if (likely(__pyx_t_46)) {
11566 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_44);
11567 __Pyx_INCREF(__pyx_t_46);
11568 __Pyx_INCREF(
function);
11569 __Pyx_DECREF_SET(__pyx_t_44,
function);
11572 __pyx_t_8 = (__pyx_t_46) ? __Pyx_PyObject_CallOneArg(__pyx_t_44, __pyx_t_46) : __Pyx_PyObject_CallNoArg(__pyx_t_44);
11573 __Pyx_XDECREF(__pyx_t_46); __pyx_t_46 = 0;
11574 if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 594, __pyx_L1_error)
11575 __Pyx_GOTREF(__pyx_t_8);
11576 __Pyx_DECREF(__pyx_t_44); __pyx_t_44 = 0;
11577 __Pyx_XDECREF_SET(__pyx_v_datatype, __pyx_t_8);
11587 __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_comm, __pyx_n_s_Gatherv);
if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 595, __pyx_L1_error)
11588 __Pyx_GOTREF(__pyx_t_8);
11589 __pyx_t_44 = __Pyx_PyInt_From_int(__pyx_v_rank_recv);
if (unlikely(!__pyx_t_44)) __PYX_ERR(0, 595, __pyx_L1_error)
11590 __Pyx_GOTREF(__pyx_t_44);
11591 __pyx_t_46 = __Pyx_PyDict_GetItem(__pyx_v_coords_2rank, __pyx_t_44);
if (unlikely(!__pyx_t_46)) __PYX_ERR(0, 595, __pyx_L1_error)
11592 __Pyx_GOTREF(__pyx_t_46);
11593 __Pyx_DECREF(__pyx_t_44); __pyx_t_44 = 0;
11602 __pyx_t_44 = __pyx_memoryview_fromslice(__pyx_cur_scope->__pyx_v_coords_2doArray, 2, (PyObject *(*)(
char *)) __pyx_memview_get_double, (int (*)(
char *, PyObject *)) __pyx_memview_set_double, 0);;
if (unlikely(!__pyx_t_44)) __PYX_ERR(0, 596, __pyx_L1_error)
11603 __Pyx_GOTREF(__pyx_t_44);
11612 __pyx_t_43 = __pyx_pf_6mprans_16cMoveMeshMonitor_13cCoefficients_29cppPseudoTimeSteppingParallel_genexpr(((PyObject*)__pyx_cur_scope));
if (unlikely(!__pyx_t_43)) __PYX_ERR(0, 597, __pyx_L1_error)
11613 __Pyx_GOTREF(__pyx_t_43);
11614 __pyx_t_4 = __Pyx_PySequence_Tuple(__pyx_t_43);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 597, __pyx_L1_error)
11615 __Pyx_GOTREF(__pyx_t_4);
11616 __Pyx_DECREF(__pyx_t_43); __pyx_t_43 = 0;
11625 __pyx_t_43 = __pyx_pf_6mprans_16cMoveMeshMonitor_13cCoefficients_29cppPseudoTimeSteppingParallel_3genexpr(((PyObject*)__pyx_cur_scope));
if (unlikely(!__pyx_t_43)) __PYX_ERR(0, 598, __pyx_L1_error)
11626 __Pyx_GOTREF(__pyx_t_43);
11627 __pyx_t_7 = __Pyx_PySequence_Tuple(__pyx_t_43);
if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 598, __pyx_L1_error)
11628 __Pyx_GOTREF(__pyx_t_7);
11629 __Pyx_DECREF(__pyx_t_43); __pyx_t_43 = 0;
11638 __Pyx_GetModuleGlobalName(__pyx_t_43, __pyx_n_s_MPI);
if (unlikely(!__pyx_t_43)) __PYX_ERR(0, 599, __pyx_L1_error)
11639 __Pyx_GOTREF(__pyx_t_43);
11640 __pyx_t_47 = __Pyx_PyObject_GetAttrStr(__pyx_t_43, __pyx_n_s_DOUBLE);
if (unlikely(!__pyx_t_47)) __PYX_ERR(0, 599, __pyx_L1_error)
11641 __Pyx_GOTREF(__pyx_t_47);
11642 __Pyx_DECREF(__pyx_t_43); __pyx_t_43 = 0;
11651 __pyx_t_43 = PyList_New(4);
if (unlikely(!__pyx_t_43)) __PYX_ERR(0, 596, __pyx_L1_error)
11652 __Pyx_GOTREF(__pyx_t_43);
11653 __Pyx_GIVEREF(__pyx_t_44);
11654 PyList_SET_ITEM(__pyx_t_43, 0, __pyx_t_44);
11655 __Pyx_GIVEREF(__pyx_t_4);
11656 PyList_SET_ITEM(__pyx_t_43, 1, __pyx_t_4);
11657 __Pyx_GIVEREF(__pyx_t_7);
11658 PyList_SET_ITEM(__pyx_t_43, 2, __pyx_t_7);
11659 __Pyx_GIVEREF(__pyx_t_47);
11660 PyList_SET_ITEM(__pyx_t_43, 3, __pyx_t_47);
11673 __pyx_t_47 = PyTuple_New(2);
if (unlikely(!__pyx_t_47)) __PYX_ERR(0, 595, __pyx_L1_error)
11674 __Pyx_GOTREF(__pyx_t_47);
11675 __Pyx_GIVEREF(__pyx_t_46);
11676 PyTuple_SET_ITEM(__pyx_t_47, 0, __pyx_t_46);
11677 __Pyx_GIVEREF(__pyx_t_43);
11678 PyTuple_SET_ITEM(__pyx_t_47, 1, __pyx_t_43);
11689 __pyx_t_43 = __Pyx_PyDict_NewPresized(1);
if (unlikely(!__pyx_t_43)) __PYX_ERR(0, 600, __pyx_L1_error)
11690 __Pyx_GOTREF(__pyx_t_43);
11691 __pyx_t_46 = __Pyx_PyInt_From_int(__pyx_v_rank_recv);
if (unlikely(!__pyx_t_46)) __PYX_ERR(0, 600, __pyx_L1_error)
11692 __Pyx_GOTREF(__pyx_t_46);
11693 if (PyDict_SetItem(__pyx_t_43, __pyx_n_s_root, __pyx_t_46) < 0) __PYX_ERR(0, 600, __pyx_L1_error)
11694 __Pyx_DECREF(__pyx_t_46); __pyx_t_46 = 0;
11703 __pyx_t_46 = __Pyx_PyObject_Call(__pyx_t_8, __pyx_t_47, __pyx_t_43);
if (unlikely(!__pyx_t_46)) __PYX_ERR(0, 595, __pyx_L1_error)
11704 __Pyx_GOTREF(__pyx_t_46);
11705 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
11706 __Pyx_DECREF(__pyx_t_47); __pyx_t_47 = 0;
11707 __Pyx_DECREF(__pyx_t_43); __pyx_t_43 = 0;
11708 __Pyx_DECREF(__pyx_t_46); __pyx_t_46 = 0;
11717 __pyx_v_ncomm = (__pyx_v_ncomm + 1);
11726 __pyx_t_43 = __Pyx_PyObject_GetAttrStr(__pyx_v_comm, __pyx_n_s_barrier);
if (unlikely(!__pyx_t_43)) __PYX_ERR(0, 602, __pyx_L1_error)
11727 __Pyx_GOTREF(__pyx_t_43);
11729 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_43))) {
11730 __pyx_t_47 = PyMethod_GET_SELF(__pyx_t_43);
11731 if (likely(__pyx_t_47)) {
11732 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_43);
11733 __Pyx_INCREF(__pyx_t_47);
11734 __Pyx_INCREF(
function);
11735 __Pyx_DECREF_SET(__pyx_t_43,
function);
11738 __pyx_t_46 = (__pyx_t_47) ? __Pyx_PyObject_CallOneArg(__pyx_t_43, __pyx_t_47) : __Pyx_PyObject_CallNoArg(__pyx_t_43);
11739 __Pyx_XDECREF(__pyx_t_47); __pyx_t_47 = 0;
11740 if (unlikely(!__pyx_t_46)) __PYX_ERR(0, 602, __pyx_L1_error)
11741 __Pyx_GOTREF(__pyx_t_46);
11742 __Pyx_DECREF(__pyx_t_43); __pyx_t_43 = 0;
11743 __Pyx_DECREF(__pyx_t_46); __pyx_t_46 = 0;
11763 __pyx_t_43 = __Pyx_PyObject_GetAttrStr(__pyx_v_comm, __pyx_n_s_barrier);
if (unlikely(!__pyx_t_43)) __PYX_ERR(0, 604, __pyx_L1_error)
11764 __Pyx_GOTREF(__pyx_t_43);
11766 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_43))) {
11767 __pyx_t_47 = PyMethod_GET_SELF(__pyx_t_43);
11768 if (likely(__pyx_t_47)) {
11769 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_43);
11770 __Pyx_INCREF(__pyx_t_47);
11771 __Pyx_INCREF(
function);
11772 __Pyx_DECREF_SET(__pyx_t_43,
function);
11775 __pyx_t_46 = (__pyx_t_47) ? __Pyx_PyObject_CallOneArg(__pyx_t_43, __pyx_t_47) : __Pyx_PyObject_CallNoArg(__pyx_t_43);
11776 __Pyx_XDECREF(__pyx_t_47); __pyx_t_47 = 0;
11777 if (unlikely(!__pyx_t_46)) __PYX_ERR(0, 604, __pyx_L1_error)
11778 __Pyx_GOTREF(__pyx_t_46);
11779 __Pyx_DECREF(__pyx_t_43); __pyx_t_43 = 0;
11780 __Pyx_DECREF(__pyx_t_46); __pyx_t_46 = 0;
11789 __pyx_t_19 = ((__pyx_v_rank_recv == __pyx_v_my_rank) != 0);
11799 __pyx_t_46 = __Pyx_PyInt_From_int(__pyx_v_my_rank);
if (unlikely(!__pyx_t_46)) __PYX_ERR(0, 606, __pyx_L1_error)
11800 __Pyx_GOTREF(__pyx_t_46);
11801 __pyx_t_43 = __Pyx_PyDict_GetItem(__pyx_v_coords_2rank, __pyx_t_46);
if (unlikely(!__pyx_t_43)) __PYX_ERR(0, 606, __pyx_L1_error)
11802 __Pyx_GOTREF(__pyx_t_43);
11803 __Pyx_DECREF(__pyx_t_46); __pyx_t_46 = 0;
11804 __pyx_t_13 = __Pyx_PyObject_to_MemoryviewSlice_dsds_double(__pyx_t_43, PyBUF_WRITABLE);
if (unlikely(!__pyx_t_13.memview)) __PYX_ERR(0, 606, __pyx_L1_error)
11805 __Pyx_DECREF(__pyx_t_43); __pyx_t_43 = 0;
11806 __PYX_XDEC_MEMVIEW(&__pyx_cur_scope->__pyx_v_coords_2doArray, 1);
11807 __pyx_cur_scope->__pyx_v_coords_2doArray = __pyx_t_13;
11808 __pyx_t_13.memview = NULL;
11809 __pyx_t_13.data = NULL;
11827 __pyx_t_46 = __Pyx_PyObject_GetAttrStr(__pyx_v_comm, __pyx_n_s_barrier);
if (unlikely(!__pyx_t_46)) __PYX_ERR(0, 607, __pyx_L1_error)
11828 __Pyx_GOTREF(__pyx_t_46);
11830 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_46))) {
11831 __pyx_t_47 = PyMethod_GET_SELF(__pyx_t_46);
11832 if (likely(__pyx_t_47)) {
11833 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_46);
11834 __Pyx_INCREF(__pyx_t_47);
11835 __Pyx_INCREF(
function);
11836 __Pyx_DECREF_SET(__pyx_t_46,
function);
11839 __pyx_t_43 = (__pyx_t_47) ? __Pyx_PyObject_CallOneArg(__pyx_t_46, __pyx_t_47) : __Pyx_PyObject_CallNoArg(__pyx_t_46);
11840 __Pyx_XDECREF(__pyx_t_47); __pyx_t_47 = 0;
11841 if (unlikely(!__pyx_t_43)) __PYX_ERR(0, 607, __pyx_L1_error)
11842 __Pyx_GOTREF(__pyx_t_43);
11843 __Pyx_DECREF(__pyx_t_46); __pyx_t_46 = 0;
11844 __Pyx_DECREF(__pyx_t_43); __pyx_t_43 = 0;
11855 __pyx_t_19 = ((__pyx_v_my_rank == __pyx_v_rank_recv) != 0);
11865 __Pyx_GetModuleGlobalName(__pyx_t_43, __pyx_n_s_np);
if (unlikely(!__pyx_t_43)) __PYX_ERR(0, 609, __pyx_L1_error)
11866 __Pyx_GOTREF(__pyx_t_43);
11867 __pyx_t_46 = __Pyx_PyObject_GetAttrStr(__pyx_t_43, __pyx_n_s_zeros);
if (unlikely(!__pyx_t_46)) __PYX_ERR(0, 609, __pyx_L1_error)
11868 __Pyx_GOTREF(__pyx_t_46);
11869 __Pyx_DECREF(__pyx_t_43); __pyx_t_43 = 0;
11870 __pyx_t_43 = PyTuple_New(1);
if (unlikely(!__pyx_t_43)) __PYX_ERR(0, 609, __pyx_L1_error)
11871 __Pyx_GOTREF(__pyx_t_43);
11872 __Pyx_INCREF(__pyx_v_array_size);
11873 __Pyx_GIVEREF(__pyx_v_array_size);
11874 PyTuple_SET_ITEM(__pyx_t_43, 0, __pyx_v_array_size);
11875 __pyx_t_47 = __Pyx_PyDict_NewPresized(1);
if (unlikely(!__pyx_t_47)) __PYX_ERR(0, 609, __pyx_L1_error)
11876 __Pyx_GOTREF(__pyx_t_47);
11877 __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_n_s_np);
if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 609, __pyx_L1_error)
11878 __Pyx_GOTREF(__pyx_t_8);
11879 __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_int32);
if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 609, __pyx_L1_error)
11880 __Pyx_GOTREF(__pyx_t_7);
11881 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
11882 if (PyDict_SetItem(__pyx_t_47, __pyx_n_s_dtype, __pyx_t_7) < 0) __PYX_ERR(0, 609, __pyx_L1_error)
11883 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
11884 __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_46, __pyx_t_43, __pyx_t_47);
if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 609, __pyx_L1_error)
11885 __Pyx_GOTREF(__pyx_t_7);
11886 __Pyx_DECREF(__pyx_t_46); __pyx_t_46 = 0;
11887 __Pyx_DECREF(__pyx_t_43); __pyx_t_43 = 0;
11888 __Pyx_DECREF(__pyx_t_47); __pyx_t_47 = 0;
11889 __Pyx_XDECREF_SET(__pyx_v_solFound_2doArray, __pyx_t_7);
11899 __pyx_t_19 = ((__pyx_v_parallel_steps > 0) != 0);
11909 __pyx_t_35 = __pyx_v_my_rank;
11910 if (__pyx_t_35 < 0) __pyx_t_35 += __pyx_cur_scope->__pyx_v_displacements_in.shape[0];
11911 __pyx_t_33 = __pyx_v_my_rank;
11912 if (__pyx_t_33 < 0) __pyx_t_33 += __pyx_cur_scope->__pyx_v_displacements_in.shape[0];
11913 __pyx_t_36 = __pyx_v_my_rank;
11914 if (__pyx_t_36 < 0) __pyx_t_36 += __pyx_cur_scope->__pyx_v_counts_in.shape[0];
11915 if (__Pyx_PyObject_SetSlice(__pyx_v_solFound_2doArray, __pyx_int_1, (*((
int *) ( (__pyx_cur_scope->__pyx_v_displacements_in.data + __pyx_t_35 * __pyx_cur_scope->__pyx_v_displacements_in.strides[0]) ))), ((*((
int *) ( (__pyx_cur_scope->__pyx_v_displacements_in.data + __pyx_t_33 * __pyx_cur_scope->__pyx_v_displacements_in.strides[0]) ))) + (*((
int *) ( (__pyx_cur_scope->__pyx_v_counts_in.data + __pyx_t_36 * __pyx_cur_scope->__pyx_v_counts_in.strides[0]) )))), NULL, NULL, NULL, 1, 1, 1) < 0) __PYX_ERR(0, 612, __pyx_L1_error)
11943 __pyx_t_7 = __Pyx_PyInt_From_int(__pyx_cur_scope->__pyx_v_comm_size);
if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 615, __pyx_L1_error)
11944 __Pyx_GOTREF(__pyx_t_7);
11945 __pyx_t_47 = __Pyx_PyObject_CallOneArg(__pyx_builtin_range, __pyx_t_7);
if (unlikely(!__pyx_t_47)) __PYX_ERR(0, 615, __pyx_L1_error)
11946 __Pyx_GOTREF(__pyx_t_47);
11947 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
11948 if (likely(PyList_CheckExact(__pyx_t_47)) || PyTuple_CheckExact(__pyx_t_47)) {
11949 __pyx_t_7 = __pyx_t_47; __Pyx_INCREF(__pyx_t_7); __pyx_t_15 = 0;
11952 __pyx_t_15 = -1; __pyx_t_7 = PyObject_GetIter(__pyx_t_47);
if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 615, __pyx_L1_error)
11953 __Pyx_GOTREF(__pyx_t_7);
11954 __pyx_t_16 = Py_TYPE(__pyx_t_7)->tp_iternext;
if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 615, __pyx_L1_error)
11956 __Pyx_DECREF(__pyx_t_47); __pyx_t_47 = 0;
11958 if (likely(!__pyx_t_16)) {
11959 if (likely(PyList_CheckExact(__pyx_t_7))) {
11960 if (__pyx_t_15 >= PyList_GET_SIZE(__pyx_t_7))
break;
11961 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
11962 __pyx_t_47 = PyList_GET_ITEM(__pyx_t_7, __pyx_t_15); __Pyx_INCREF(__pyx_t_47); __pyx_t_15++;
if (unlikely(0 < 0)) __PYX_ERR(0, 615, __pyx_L1_error)
11964 __pyx_t_47 = PySequence_ITEM(__pyx_t_7, __pyx_t_15); __pyx_t_15++;
if (unlikely(!__pyx_t_47)) __PYX_ERR(0, 615, __pyx_L1_error)
11965 __Pyx_GOTREF(__pyx_t_47);
11968 if (__pyx_t_15 >= PyTuple_GET_SIZE(__pyx_t_7))
break;
11969 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
11970 __pyx_t_47 = PyTuple_GET_ITEM(__pyx_t_7, __pyx_t_15); __Pyx_INCREF(__pyx_t_47); __pyx_t_15++;
if (unlikely(0 < 0)) __PYX_ERR(0, 615, __pyx_L1_error)
11972 __pyx_t_47 = PySequence_ITEM(__pyx_t_7, __pyx_t_15); __pyx_t_15++;
if (unlikely(!__pyx_t_47)) __PYX_ERR(0, 615, __pyx_L1_error)
11973 __Pyx_GOTREF(__pyx_t_47);
11977 __pyx_t_47 = __pyx_t_16(__pyx_t_7);
11978 if (unlikely(!__pyx_t_47)) {
11979 PyObject* exc_type = PyErr_Occurred();
11981 if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
11982 else __PYX_ERR(0, 615, __pyx_L1_error)
11986 __Pyx_GOTREF(__pyx_t_47);
11988 __Pyx_XDECREF_SET(__pyx_v_rank, __pyx_t_47);
11998 __Pyx_GetModuleGlobalName(__pyx_t_43, __pyx_n_s_np);
if (unlikely(!__pyx_t_43)) __PYX_ERR(0, 616, __pyx_L1_error)
11999 __Pyx_GOTREF(__pyx_t_43);
12000 __pyx_t_46 = __Pyx_PyObject_GetAttrStr(__pyx_t_43, __pyx_n_s_zeros);
if (unlikely(!__pyx_t_46)) __PYX_ERR(0, 616, __pyx_L1_error)
12001 __Pyx_GOTREF(__pyx_t_46);
12002 __Pyx_DECREF(__pyx_t_43); __pyx_t_43 = 0;
12004 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_46))) {
12005 __pyx_t_43 = PyMethod_GET_SELF(__pyx_t_46);
12006 if (likely(__pyx_t_43)) {
12007 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_46);
12008 __Pyx_INCREF(__pyx_t_43);
12009 __Pyx_INCREF(
function);
12010 __Pyx_DECREF_SET(__pyx_t_46,
function);
12013 __pyx_t_47 = (__pyx_t_43) ? __Pyx_PyObject_Call2Args(__pyx_t_46, __pyx_t_43, __pyx_tuple__5) : __Pyx_PyObject_CallOneArg(__pyx_t_46, __pyx_tuple__5);
12014 __Pyx_XDECREF(__pyx_t_43); __pyx_t_43 = 0;
12015 if (unlikely(!__pyx_t_47)) __PYX_ERR(0, 616, __pyx_L1_error)
12016 __Pyx_GOTREF(__pyx_t_47);
12017 __Pyx_DECREF(__pyx_t_46); __pyx_t_46 = 0;
12018 if (unlikely(PyDict_SetItem(__pyx_v_coords_2rank, __pyx_v_rank, __pyx_t_47) < 0)) __PYX_ERR(0, 616, __pyx_L1_error)
12019 __Pyx_DECREF(__pyx_t_47); __pyx_t_47 = 0;
12029 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
12038 __pyx_t_10 = __Pyx_MemoryView_Len(__pyx_cur_scope->__pyx_v_coords_2doArray);
12039 __pyx_v_nNodes = __pyx_t_10;
12048 __pyx_t_22 = __pyx_v_nNodes;
12049 __pyx_t_23 = __pyx_t_22;
12050 for (__pyx_t_24 = 0; __pyx_t_24 < __pyx_t_23; __pyx_t_24+=1) {
12051 __pyx_v_iN = __pyx_t_24;
12060 __pyx_t_36 = __pyx_v_iN;
12062 if (__pyx_t_36 < 0) __pyx_t_36 += __pyx_cur_scope->__pyx_v_coords_2doArray.shape[0];
12063 if (__pyx_t_33 < 0) __pyx_t_33 += __pyx_cur_scope->__pyx_v_coords_2doArray.shape[1];
12065 if (__pyx_t_35 < 0) __pyx_t_35 += __pyx_v_coords.shape[0];
12066 *((
double *) ( (__pyx_v_coords.data + __pyx_t_35 * __pyx_v_coords.strides[0]) )) = (*((
double *) ( (( (__pyx_cur_scope->__pyx_v_coords_2doArray.data + __pyx_t_36 * __pyx_cur_scope->__pyx_v_coords_2doArray.strides[0]) ) + __pyx_t_33 * __pyx_cur_scope->__pyx_v_coords_2doArray.strides[1]) )));
12075 __pyx_t_33 = __pyx_v_iN;
12077 if (__pyx_t_33 < 0) __pyx_t_33 += __pyx_cur_scope->__pyx_v_coords_2doArray.shape[0];
12078 if (__pyx_t_36 < 0) __pyx_t_36 += __pyx_cur_scope->__pyx_v_coords_2doArray.shape[1];
12080 if (__pyx_t_35 < 0) __pyx_t_35 += __pyx_v_coords.shape[0];
12081 *((
double *) ( (__pyx_v_coords.data + __pyx_t_35 * __pyx_v_coords.strides[0]) )) = (*((
double *) ( (( (__pyx_cur_scope->__pyx_v_coords_2doArray.data + __pyx_t_33 * __pyx_cur_scope->__pyx_v_coords_2doArray.strides[0]) ) + __pyx_t_36 * __pyx_cur_scope->__pyx_v_coords_2doArray.strides[1]) )));
12090 __pyx_t_36 = __pyx_v_iN;
12092 if (__pyx_t_36 < 0) __pyx_t_36 += __pyx_cur_scope->__pyx_v_coords_2doArray.shape[0];
12093 if (__pyx_t_33 < 0) __pyx_t_33 += __pyx_cur_scope->__pyx_v_coords_2doArray.shape[1];
12095 if (__pyx_t_35 < 0) __pyx_t_35 += __pyx_v_coords.shape[0];
12096 *((
double *) ( (__pyx_v_coords.data + __pyx_t_35 * __pyx_v_coords.strides[0]) )) = (*((
double *) ( (( (__pyx_cur_scope->__pyx_v_coords_2doArray.data + __pyx_t_36 * __pyx_cur_scope->__pyx_v_coords_2doArray.strides[0]) ) + __pyx_t_33 * __pyx_cur_scope->__pyx_v_coords_2doArray.strides[1]) )));
12105 __pyx_t_33 = __pyx_v_iN;
12107 if (__pyx_t_33 < 0) __pyx_t_33 += __pyx_cur_scope->__pyx_v_coords_2doArray.shape[0];
12108 if (__pyx_t_36 < 0) __pyx_t_36 += __pyx_cur_scope->__pyx_v_coords_2doArray.shape[1];
12109 __pyx_v_nearestN = ((int)(*((
double *) ( (( (__pyx_cur_scope->__pyx_v_coords_2doArray.data + __pyx_t_33 * __pyx_cur_scope->__pyx_v_coords_2doArray.strides[0]) ) + __pyx_t_36 * __pyx_cur_scope->__pyx_v_coords_2doArray.strides[1]) ))));
12118 __pyx_t_36 = __pyx_v_iN;
12120 if (__pyx_t_36 < 0) __pyx_t_36 += __pyx_cur_scope->__pyx_v_coords_2doArray.shape[0];
12121 if (__pyx_t_33 < 0) __pyx_t_33 += __pyx_cur_scope->__pyx_v_coords_2doArray.shape[1];
12122 __pyx_v_typeN = ((int)(*((
double *) ( (( (__pyx_cur_scope->__pyx_v_coords_2doArray.data + __pyx_t_36 * __pyx_cur_scope->__pyx_v_coords_2doArray.strides[0]) ) + __pyx_t_33 * __pyx_cur_scope->__pyx_v_coords_2doArray.strides[1]) ))));
12131 __pyx_t_33 = __pyx_v_iN;
12133 if (__pyx_t_33 < 0) __pyx_t_33 += __pyx_cur_scope->__pyx_v_coords_2doArray.shape[0];
12134 if (__pyx_t_36 < 0) __pyx_t_36 += __pyx_cur_scope->__pyx_v_coords_2doArray.shape[1];
12136 if (__pyx_t_35 < 0) __pyx_t_35 += __pyx_v_v_grad.shape[0];
12137 *((
double *) ( (__pyx_v_v_grad.data + __pyx_t_35 * __pyx_v_v_grad.strides[0]) )) = (*((
double *) ( (( (__pyx_cur_scope->__pyx_v_coords_2doArray.data + __pyx_t_33 * __pyx_cur_scope->__pyx_v_coords_2doArray.strides[0]) ) + __pyx_t_36 * __pyx_cur_scope->__pyx_v_coords_2doArray.strides[1]) )));
12146 __pyx_t_36 = __pyx_v_iN;
12148 if (__pyx_t_36 < 0) __pyx_t_36 += __pyx_cur_scope->__pyx_v_coords_2doArray.shape[0];
12149 if (__pyx_t_33 < 0) __pyx_t_33 += __pyx_cur_scope->__pyx_v_coords_2doArray.shape[1];
12151 if (__pyx_t_35 < 0) __pyx_t_35 += __pyx_v_v_grad.shape[0];
12152 *((
double *) ( (__pyx_v_v_grad.data + __pyx_t_35 * __pyx_v_v_grad.strides[0]) )) = (*((
double *) ( (( (__pyx_cur_scope->__pyx_v_coords_2doArray.data + __pyx_t_36 * __pyx_cur_scope->__pyx_v_coords_2doArray.strides[0]) ) + __pyx_t_33 * __pyx_cur_scope->__pyx_v_coords_2doArray.strides[1]) )));
12161 __pyx_t_33 = __pyx_v_iN;
12163 if (__pyx_t_33 < 0) __pyx_t_33 += __pyx_cur_scope->__pyx_v_coords_2doArray.shape[0];
12164 if (__pyx_t_36 < 0) __pyx_t_36 += __pyx_cur_scope->__pyx_v_coords_2doArray.shape[1];
12166 if (__pyx_t_35 < 0) __pyx_t_35 += __pyx_v_v_grad.shape[0];
12167 *((
double *) ( (__pyx_v_v_grad.data + __pyx_t_35 * __pyx_v_v_grad.strides[0]) )) = (*((
double *) ( (( (__pyx_cur_scope->__pyx_v_coords_2doArray.data + __pyx_t_33 * __pyx_cur_scope->__pyx_v_coords_2doArray.strides[0]) ) + __pyx_t_36 * __pyx_cur_scope->__pyx_v_coords_2doArray.strides[1]) )));
12176 __pyx_t_36 = __pyx_v_iN;
12178 if (__pyx_t_36 < 0) __pyx_t_36 += __pyx_cur_scope->__pyx_v_coords_2doArray.shape[0];
12179 if (__pyx_t_33 < 0) __pyx_t_33 += __pyx_cur_scope->__pyx_v_coords_2doArray.shape[1];
12180 __pyx_v_area = (*((
double *) ( (( (__pyx_cur_scope->__pyx_v_coords_2doArray.data + __pyx_t_36 * __pyx_cur_scope->__pyx_v_coords_2doArray.strides[0]) ) + __pyx_t_33 * __pyx_cur_scope->__pyx_v_coords_2doArray.strides[1]) )));
12189 __pyx_t_33 = __pyx_v_iN;
12191 if (__pyx_t_33 < 0) __pyx_t_33 += __pyx_cur_scope->__pyx_v_coords_2doArray.shape[0];
12192 if (__pyx_t_36 < 0) __pyx_t_36 += __pyx_cur_scope->__pyx_v_coords_2doArray.shape[1];
12193 __pyx_v_ls_phi = (*((
double *) ( (( (__pyx_cur_scope->__pyx_v_coords_2doArray.data + __pyx_t_33 * __pyx_cur_scope->__pyx_v_coords_2doArray.strides[0]) ) + __pyx_t_36 * __pyx_cur_scope->__pyx_v_coords_2doArray.strides[1]) )));
12202 __pyx_t_36 = __pyx_v_iN;
12204 if (__pyx_t_36 < 0) __pyx_t_36 += __pyx_cur_scope->__pyx_v_coords_2doArray.shape[0];
12205 if (__pyx_t_33 < 0) __pyx_t_33 += __pyx_cur_scope->__pyx_v_coords_2doArray.shape[1];
12206 __pyx_v_node0 = ((int)(*((
double *) ( (( (__pyx_cur_scope->__pyx_v_coords_2doArray.data + __pyx_t_36 * __pyx_cur_scope->__pyx_v_coords_2doArray.strides[0]) ) + __pyx_t_33 * __pyx_cur_scope->__pyx_v_coords_2doArray.strides[1]) ))));
12215 __pyx_t_33 = __pyx_v_iN;
12217 if (__pyx_t_33 < 0) __pyx_t_33 += __pyx_cur_scope->__pyx_v_coords_2doArray.shape[0];
12218 if (__pyx_t_36 < 0) __pyx_t_36 += __pyx_cur_scope->__pyx_v_coords_2doArray.shape[1];
12219 __pyx_t_7 = __Pyx_PyInt_FromDouble((*((
double *) ( (( (__pyx_cur_scope->__pyx_v_coords_2doArray.data + __pyx_t_33 * __pyx_cur_scope->__pyx_v_coords_2doArray.strides[0]) ) + __pyx_t_36 * __pyx_cur_scope->__pyx_v_coords_2doArray.strides[1]) ))));
if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 630, __pyx_L1_error)
12220 __Pyx_GOTREF(__pyx_t_7);
12221 __Pyx_XDECREF_SET(__pyx_v_rank0, __pyx_t_7);
12231 __pyx_v_new_rank = __pyx_v_my_rank;
12240 __pyx_t_36 = __pyx_v_iN;
12242 if (__pyx_t_36 < 0) __pyx_t_36 += __pyx_cur_scope->__pyx_v_coords_2doArray.shape[0];
12243 if (__pyx_t_33 < 0) __pyx_t_33 += __pyx_cur_scope->__pyx_v_coords_2doArray.shape[1];
12245 if (__pyx_t_35 < 0) __pyx_t_35 += __pyx_v_fixed_dir.shape[0];
12246 *((
double *) ( (__pyx_v_fixed_dir.data + __pyx_t_35 * __pyx_v_fixed_dir.strides[0]) )) = (*((
double *) ( (( (__pyx_cur_scope->__pyx_v_coords_2doArray.data + __pyx_t_36 * __pyx_cur_scope->__pyx_v_coords_2doArray.strides[0]) ) + __pyx_t_33 * __pyx_cur_scope->__pyx_v_coords_2doArray.strides[1]) )));
12255 __pyx_t_33 = __pyx_v_iN;
12257 if (__pyx_t_33 < 0) __pyx_t_33 += __pyx_cur_scope->__pyx_v_coords_2doArray.shape[0];
12258 if (__pyx_t_36 < 0) __pyx_t_36 += __pyx_cur_scope->__pyx_v_coords_2doArray.shape[1];
12260 if (__pyx_t_35 < 0) __pyx_t_35 += __pyx_v_fixed_dir.shape[0];
12261 *((
double *) ( (__pyx_v_fixed_dir.data + __pyx_t_35 * __pyx_v_fixed_dir.strides[0]) )) = (*((
double *) ( (( (__pyx_cur_scope->__pyx_v_coords_2doArray.data + __pyx_t_33 * __pyx_cur_scope->__pyx_v_coords_2doArray.strides[0]) ) + __pyx_t_36 * __pyx_cur_scope->__pyx_v_coords_2doArray.strides[1]) )));
12270 __pyx_t_36 = __pyx_v_iN;
12272 if (__pyx_t_36 < 0) __pyx_t_36 += __pyx_cur_scope->__pyx_v_coords_2doArray.shape[0];
12273 if (__pyx_t_33 < 0) __pyx_t_33 += __pyx_cur_scope->__pyx_v_coords_2doArray.shape[1];
12275 if (__pyx_t_35 < 0) __pyx_t_35 += __pyx_v_fixed_dir.shape[0];
12276 *((
double *) ( (__pyx_v_fixed_dir.data + __pyx_t_35 * __pyx_v_fixed_dir.strides[0]) )) = (*((
double *) ( (( (__pyx_cur_scope->__pyx_v_coords_2doArray.data + __pyx_t_36 * __pyx_cur_scope->__pyx_v_coords_2doArray.strides[0]) ) + __pyx_t_33 * __pyx_cur_scope->__pyx_v_coords_2doArray.strides[1]) )));
12285 if (unlikely(!__pyx_v_solFound_2doArray)) { __Pyx_RaiseUnboundLocalError(
"solFound_2doArray"); __PYX_ERR(0, 635, __pyx_L1_error) }
12286 __pyx_t_7 = __Pyx_GetItemInt(__pyx_v_solFound_2doArray, __pyx_v_iN,
int, 1, __Pyx_PyInt_From_int, 0, 1, 0);
if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 635, __pyx_L1_error)
12287 __Pyx_GOTREF(__pyx_t_7);
12288 __pyx_t_47 = __Pyx_PyInt_EqObjC(__pyx_t_7, __pyx_int_0, 0, 0);
if (unlikely(!__pyx_t_47)) __PYX_ERR(0, 635, __pyx_L1_error)
12289 __Pyx_GOTREF(__pyx_t_47);
12290 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
12291 __pyx_t_19 = __Pyx_PyObject_IsTrue(__pyx_t_47);
if (unlikely(__pyx_t_19 < 0)) __PYX_ERR(0, 635, __pyx_L1_error)
12292 __Pyx_DECREF(__pyx_t_47); __pyx_t_47 = 0;
12302 __pyx_t_11 = __pyx_f_6mprans_16cMoveMeshMonitor_findN(__pyx_v_coords, __pyx_v_nodeArray, __pyx_v_nodeStarOffsets, __pyx_v_nodeStarArray, __pyx_v_nearestN, __pyx_v_typeN, __pyx_v_my_rank, __pyx_v_nNodes_owned, __pyx_v_nodeNumbering_subdomain2global, __pyx_v_nodeOffsets_subdomain_owned, __pyx_v_nodeElementOffsets, __pyx_v_nodeElementsArray, __pyx_v_elementBarycentersArray, __pyx_v_elementBoundaryNormalsArray, __pyx_v_elementBoundariesArray, __pyx_v_elementBoundaryBarycentersArray, __pyx_v_elementBoundaryElementsArray, __pyx_v_exteriorElementBoundariesBoolArray, __pyx_v_nElements_owned, __pyx_v_elementNumbering_subdomain2global, __pyx_v_elementOffsets_subdomain_owned, __pyx_v_nElementBoundaries_owned, __pyx_v_elementBoundaryNumbering_subdomain2global, __pyx_v_elementBoundaryOffsets_subdomain_owned, __pyx_v_elementNodesArray, __pyx_v_nodeMaterialTypes, __pyx_v_nNel);
if (unlikely(!__pyx_t_11.memview)) __PYX_ERR(0, 636, __pyx_L1_error)
12303 __PYX_XDEC_MEMVIEW(&__pyx_v_result, 1);
12304 __pyx_v_result = __pyx_t_11;
12305 __pyx_t_11.memview = NULL;
12306 __pyx_t_11.data = NULL;
12316 if (__pyx_t_33 < 0) __pyx_t_33 += __pyx_v_result.shape[0];
12317 __pyx_v_nearestN = (*((
int *) ( (__pyx_v_result.data + __pyx_t_33 * __pyx_v_result.strides[0]) )));
12327 if (__pyx_t_33 < 0) __pyx_t_33 += __pyx_v_result.shape[0];
12328 __pyx_v_typeN = (*((
int *) ( (__pyx_v_result.data + __pyx_t_33 * __pyx_v_result.strides[0]) )));
12338 if (__pyx_t_33 < 0) __pyx_t_33 += __pyx_v_result.shape[0];
12339 __pyx_v_new_rank = (*((
int *) ( (__pyx_v_result.data + __pyx_t_33 * __pyx_v_result.strides[0]) )));
12348 __pyx_t_19 = ((__pyx_v_my_rank != __pyx_v_new_rank) != 0);
12358 __pyx_v_nPending_disp = (__pyx_v_nPending_disp + 1);
12378 __pyx_t_27 = __pyx_v_iN;
12379 if (unlikely(!__pyx_v_solFound_2doArray)) { __Pyx_RaiseUnboundLocalError(
"solFound_2doArray"); __PYX_ERR(0, 669, __pyx_L1_error) }
12380 __pyx_t_47 = __Pyx_GetItemInt(__pyx_v_solFound_2doArray, __pyx_t_27,
int, 1, __Pyx_PyInt_From_int, 0, 1, 0);
if (unlikely(!__pyx_t_47)) __PYX_ERR(0, 669, __pyx_L1_error)
12381 __Pyx_GOTREF(__pyx_t_47);
12382 __pyx_t_7 = __Pyx_PyInt_AddObjC(__pyx_t_47, __pyx_int_1, 1, 1, 0);
if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 669, __pyx_L1_error)
12383 __Pyx_GOTREF(__pyx_t_7);
12384 __Pyx_DECREF(__pyx_t_47); __pyx_t_47 = 0;
12385 if (unlikely(!__pyx_v_solFound_2doArray)) { __Pyx_RaiseUnboundLocalError(
"solFound_2doArray"); __PYX_ERR(0, 669, __pyx_L1_error) }
12386 if (unlikely(__Pyx_SetItemInt(__pyx_v_solFound_2doArray, __pyx_t_27, __pyx_t_7,
int, 1, __Pyx_PyInt_From_int, 0, 1, 0) < 0)) __PYX_ERR(0, 669, __pyx_L1_error)
12387 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
12396 __pyx_v_inside_eN = 1;
12405 __pyx_t_19 = ((__pyx_v_typeN == 2) != 0);
12415 __pyx_t_33 = __pyx_v_nearestN;
12417 if (__pyx_t_33 < 0) __pyx_t_33 += __pyx_v_elementBoundaryElementsArray.shape[0];
12418 if (__pyx_t_36 < 0) __pyx_t_36 += __pyx_v_elementBoundaryElementsArray.shape[1];
12419 __pyx_t_19 = (((*((
int *) ( (( (__pyx_v_elementBoundaryElementsArray.data + __pyx_t_33 * __pyx_v_elementBoundaryElementsArray.strides[0]) ) + __pyx_t_36 * __pyx_v_elementBoundaryElementsArray.strides[1]) ))) == -1
L) != 0);
12429 __pyx_t_36 = __pyx_v_nearestN;
12431 if (__pyx_t_36 < 0) __pyx_t_36 += __pyx_v_elementBoundaryElementsArray.shape[0];
12432 if (__pyx_t_33 < 0) __pyx_t_33 += __pyx_v_elementBoundaryElementsArray.shape[1];
12433 __pyx_v_nearestN = (*((
int *) ( (( (__pyx_v_elementBoundaryElementsArray.data + __pyx_t_36 * __pyx_v_elementBoundaryElementsArray.strides[0]) ) + __pyx_t_33 * __pyx_v_elementBoundaryElementsArray.strides[1]) )));
12461 __pyx_t_33 = __pyx_v_nearestN;
12463 if (__pyx_t_33 < 0) __pyx_t_33 += __pyx_v_elementBoundaryElementsArray.shape[0];
12464 if (__pyx_t_36 < 0) __pyx_t_36 += __pyx_v_elementBoundaryElementsArray.shape[1];
12465 __pyx_t_19 = (((*((
int *) ( (( (__pyx_v_elementBoundaryElementsArray.data + __pyx_t_33 * __pyx_v_elementBoundaryElementsArray.strides[0]) ) + __pyx_t_36 * __pyx_v_elementBoundaryElementsArray.strides[1]) ))) == -1
L) != 0);
12475 __pyx_t_36 = __pyx_v_nearestN;
12477 if (__pyx_t_36 < 0) __pyx_t_36 += __pyx_v_elementBoundaryElementsArray.shape[0];
12478 if (__pyx_t_33 < 0) __pyx_t_33 += __pyx_v_elementBoundaryElementsArray.shape[1];
12479 __pyx_v_nearestN = (*((
int *) ( (( (__pyx_v_elementBoundaryElementsArray.data + __pyx_t_36 * __pyx_v_elementBoundaryElementsArray.strides[0]) ) + __pyx_t_33 * __pyx_v_elementBoundaryElementsArray.strides[1]) )));
12516 __pyx_t_27 = __pyx_v_nEbn;
12517 __pyx_t_28 = __pyx_t_27;
12518 for (__pyx_t_29 = 0; __pyx_t_29 < __pyx_t_28; __pyx_t_29+=1) {
12519 __pyx_v_ii = __pyx_t_29;
12528 __pyx_t_33 = __pyx_v_nearestN;
12529 __pyx_t_36 = __pyx_v_ii;
12530 if (__pyx_t_33 < 0) __pyx_t_33 += __pyx_v_elementBoundariesArray.shape[0];
12531 if (__pyx_t_36 < 0) __pyx_t_36 += __pyx_v_elementBoundariesArray.shape[1];
12532 __pyx_v_bb_i = (*((
int *) ( (( (__pyx_v_elementBoundariesArray.data + __pyx_t_33 * __pyx_v_elementBoundariesArray.strides[0]) ) + __pyx_t_36 * __pyx_v_elementBoundariesArray.strides[1]) )));
12541 __pyx_t_36 = __pyx_v_nearestN;
12542 __pyx_t_33 = __pyx_v_ii;
12544 if (__pyx_t_36 < 0) __pyx_t_36 += __pyx_v_elementBoundaryNormalsArray.shape[0];
12545 if (__pyx_t_33 < 0) __pyx_t_33 += __pyx_v_elementBoundaryNormalsArray.shape[1];
12546 if (__pyx_t_35 < 0) __pyx_t_35 += __pyx_v_elementBoundaryNormalsArray.shape[2];
12548 if (__pyx_t_34 < 0) __pyx_t_34 += __pyx_v_normal.shape[0];
12549 *((
double *) ( (__pyx_v_normal.data + __pyx_t_34 * __pyx_v_normal.strides[0]) )) = (*((
double *) ( (( (( (__pyx_v_elementBoundaryNormalsArray.data + __pyx_t_36 * __pyx_v_elementBoundaryNormalsArray.strides[0]) ) + __pyx_t_33 * __pyx_v_elementBoundaryNormalsArray.strides[1]) ) + __pyx_t_35 * __pyx_v_elementBoundaryNormalsArray.strides[2]) )));
12558 __pyx_t_35 = __pyx_v_nearestN;
12559 __pyx_t_33 = __pyx_v_ii;
12561 if (__pyx_t_35 < 0) __pyx_t_35 += __pyx_v_elementBoundaryNormalsArray.shape[0];
12562 if (__pyx_t_33 < 0) __pyx_t_33 += __pyx_v_elementBoundaryNormalsArray.shape[1];
12563 if (__pyx_t_36 < 0) __pyx_t_36 += __pyx_v_elementBoundaryNormalsArray.shape[2];
12565 if (__pyx_t_34 < 0) __pyx_t_34 += __pyx_v_normal.shape[0];
12566 *((
double *) ( (__pyx_v_normal.data + __pyx_t_34 * __pyx_v_normal.strides[0]) )) = (*((
double *) ( (( (( (__pyx_v_elementBoundaryNormalsArray.data + __pyx_t_35 * __pyx_v_elementBoundaryNormalsArray.strides[0]) ) + __pyx_t_33 * __pyx_v_elementBoundaryNormalsArray.strides[1]) ) + __pyx_t_36 * __pyx_v_elementBoundaryNormalsArray.strides[2]) )));
12575 __pyx_t_36 = __pyx_v_nearestN;
12576 __pyx_t_33 = __pyx_v_ii;
12578 if (__pyx_t_36 < 0) __pyx_t_36 += __pyx_v_elementBoundaryNormalsArray.shape[0];
12579 if (__pyx_t_33 < 0) __pyx_t_33 += __pyx_v_elementBoundaryNormalsArray.shape[1];
12580 if (__pyx_t_35 < 0) __pyx_t_35 += __pyx_v_elementBoundaryNormalsArray.shape[2];
12582 if (__pyx_t_34 < 0) __pyx_t_34 += __pyx_v_normal.shape[0];
12583 *((
double *) ( (__pyx_v_normal.data + __pyx_t_34 * __pyx_v_normal.strides[0]) )) = (*((
double *) ( (( (( (__pyx_v_elementBoundaryNormalsArray.data + __pyx_t_36 * __pyx_v_elementBoundaryNormalsArray.strides[0]) ) + __pyx_t_33 * __pyx_v_elementBoundaryNormalsArray.strides[1]) ) + __pyx_t_35 * __pyx_v_elementBoundaryNormalsArray.strides[2]) )));
12592 __pyx_t_9.data = __pyx_v_elementBoundaryBarycentersArray.data;
12593 __pyx_t_9.memview = __pyx_v_elementBoundaryBarycentersArray.memview;
12594 __PYX_INC_MEMVIEW(&__pyx_t_9, 0);
12596 Py_ssize_t __pyx_tmp_idx = __pyx_v_bb_i;
12597 Py_ssize_t __pyx_tmp_shape = __pyx_v_elementBoundaryBarycentersArray.shape[0];
12598 Py_ssize_t __pyx_tmp_stride = __pyx_v_elementBoundaryBarycentersArray.strides[0];
12599 if (__pyx_tmp_idx < 0)
12600 __pyx_tmp_idx += __pyx_tmp_shape;
12601 __pyx_t_9.data += __pyx_tmp_idx * __pyx_tmp_stride;
12604 __pyx_t_9.shape[0] = __pyx_v_elementBoundaryBarycentersArray.shape[1];
12605 __pyx_t_9.strides[0] = __pyx_v_elementBoundaryBarycentersArray.strides[1];
12606 __pyx_t_9.suboffsets[0] = -1;
12608 __PYX_XDEC_MEMVIEW(&__pyx_v_bound_bar, 1);
12609 __pyx_v_bound_bar = __pyx_t_9;
12610 __pyx_t_9.memview = NULL;
12611 __pyx_t_9.data = NULL;
12621 if (__pyx_t_35 < 0) __pyx_t_35 += __pyx_v_bound_bar.shape[0];
12623 if (__pyx_t_33 < 0) __pyx_t_33 += __pyx_v_coords.shape[0];
12625 if (__pyx_t_36 < 0) __pyx_t_36 += __pyx_v_normal.shape[0];
12627 if (__pyx_t_34 < 0) __pyx_t_34 += __pyx_v_bound_bar.shape[0];
12629 if (__pyx_t_32 < 0) __pyx_t_32 += __pyx_v_coords.shape[0];
12631 if (__pyx_t_31 < 0) __pyx_t_31 += __pyx_v_normal.shape[0];
12633 if (__pyx_t_25 < 0) __pyx_t_25 += __pyx_v_bound_bar.shape[0];
12635 if (__pyx_t_26 < 0) __pyx_t_26 += __pyx_v_coords.shape[0];
12637 if (__pyx_t_17 < 0) __pyx_t_17 += __pyx_v_normal.shape[0];
12638 __pyx_v_dot = (((((*((
double *) ( (__pyx_v_bound_bar.data + __pyx_t_35 * __pyx_v_bound_bar.strides[0]) ))) - (*((
double *) ( (__pyx_v_coords.data + __pyx_t_33 * __pyx_v_coords.strides[0]) )))) * (*((
double *) ( (__pyx_v_normal.data + __pyx_t_36 * __pyx_v_normal.strides[0]) )))) + (((*((
double *) ( (__pyx_v_bound_bar.data + __pyx_t_34 * __pyx_v_bound_bar.strides[0]) ))) - (*((
double *) ( (__pyx_v_coords.data + __pyx_t_32 * __pyx_v_coords.strides[0]) )))) * (*((
double *) ( (__pyx_v_normal.data + __pyx_t_31 * __pyx_v_normal.strides[0]) ))))) + (((*((
double *) ( (__pyx_v_bound_bar.data + __pyx_t_25 * __pyx_v_bound_bar.strides[0]) ))) - (*((
double *) ( (__pyx_v_coords.data + __pyx_t_26 * __pyx_v_coords.strides[0]) )))) * (*((
double *) ( (__pyx_v_normal.data + __pyx_t_17 * __pyx_v_normal.strides[0]) )))));
12647 __pyx_t_19 = ((__pyx_v_dot < 0.) != 0);
12657 __pyx_v_inside_eN = 0;
12667 __Pyx_PyThreadState_declare
12668 __Pyx_PyThreadState_assign
12669 __Pyx_ExceptionSave(&__pyx_t_39, &__pyx_t_38, &__pyx_t_37);
12670 __Pyx_XGOTREF(__pyx_t_39);
12671 __Pyx_XGOTREF(__pyx_t_38);
12672 __Pyx_XGOTREF(__pyx_t_37);
12682 __pyx_t_7 = __Pyx_PyObject_Call(__pyx_builtin_AssertionError, __pyx_tuple__7, NULL);
if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 689, __pyx_L87_error)
12683 __Pyx_GOTREF(__pyx_t_7);
12684 __Pyx_Raise(__pyx_t_7, 0, 0, 0);
12685 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
12686 __PYX_ERR(0, 689, __pyx_L87_error)
12697 __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
12698 __PYX_XDEC_MEMVIEW(&__pyx_t_11, 1);
12699 __PYX_XDEC_MEMVIEW(&__pyx_t_13, 1);
12700 __PYX_XDEC_MEMVIEW(&__pyx_t_14, 1);
12701 __PYX_XDEC_MEMVIEW(&__pyx_t_18, 1);
12702 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
12703 __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
12704 __Pyx_XDECREF(__pyx_t_42); __pyx_t_42 = 0;
12705 __Pyx_XDECREF(__pyx_t_43); __pyx_t_43 = 0;
12706 __Pyx_XDECREF(__pyx_t_44); __pyx_t_44 = 0;
12707 __Pyx_XDECREF(__pyx_t_45); __pyx_t_45 = 0;
12708 __Pyx_XDECREF(__pyx_t_46); __pyx_t_46 = 0;
12709 __Pyx_XDECREF(__pyx_t_47); __pyx_t_47 = 0;
12710 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
12711 __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
12712 __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
12713 __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
12714 __PYX_XDEC_MEMVIEW(&__pyx_t_9, 1);
12723 __pyx_t_40 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_AssertionError);
12725 __Pyx_AddTraceback(
"mprans.cMoveMeshMonitor.cCoefficients.cppPseudoTimeSteppingParallel", __pyx_clineno, __pyx_lineno, __pyx_filename);
12726 if (__Pyx_GetException(&__pyx_t_7, &__pyx_t_47, &__pyx_t_46) < 0) __PYX_ERR(0, 690, __pyx_L89_except_error)
12727 __Pyx_GOTREF(__pyx_t_7);
12728 __Pyx_GOTREF(__pyx_t_47);
12729 __Pyx_GOTREF(__pyx_t_46);
12730 __Pyx_INCREF(__pyx_t_47);
12731 __Pyx_XDECREF_SET(__pyx_v_exc, __pyx_t_47);
12740 __pyx_t_43 = PyTuple_New(2);
if (unlikely(!__pyx_t_43)) __PYX_ERR(0, 691, __pyx_L89_except_error)
12741 __Pyx_GOTREF(__pyx_t_43);
12742 __Pyx_INCREF(__pyx_kp_s_Error);
12743 __Pyx_GIVEREF(__pyx_kp_s_Error);
12744 PyTuple_SET_ITEM(__pyx_t_43, 0, __pyx_kp_s_Error);
12745 __Pyx_INCREF(__pyx_v_exc);
12746 __Pyx_GIVEREF(__pyx_v_exc);
12747 PyTuple_SET_ITEM(__pyx_t_43, 1, __pyx_v_exc);
12748 if (__Pyx_PrintOne(0, __pyx_t_43) < 0) __PYX_ERR(0, 691, __pyx_L89_except_error)
12749 __Pyx_DECREF(__pyx_t_43); __pyx_t_43 = 0;
12758 __pyx_t_43 = __Pyx_PyInt_From_int(__pyx_v_node);
if (unlikely(!__pyx_t_43)) __PYX_ERR(0, 692, __pyx_L89_except_error)
12759 __Pyx_GOTREF(__pyx_t_43);
12760 __pyx_t_8 = PyTuple_New(2);
if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 692, __pyx_L89_except_error)
12761 __Pyx_GOTREF(__pyx_t_8);
12762 __Pyx_INCREF(__pyx_kp_s_node_number);
12763 __Pyx_GIVEREF(__pyx_kp_s_node_number);
12764 PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_kp_s_node_number);
12765 __Pyx_GIVEREF(__pyx_t_43);
12766 PyTuple_SET_ITEM(__pyx_t_8, 1, __pyx_t_43);
12768 if (__Pyx_PrintOne(0, __pyx_t_8) < 0) __PYX_ERR(0, 692, __pyx_L89_except_error)
12769 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
12778 __pyx_t_17 = __pyx_v_node;
12779 if (__pyx_t_17 < 0) __pyx_t_17 += __pyx_v_nodeMaterialTypes.shape[0];
12780 __pyx_t_8 = __Pyx_PyInt_From_int((*((
int *) ( (__pyx_v_nodeMaterialTypes.data + __pyx_t_17 * __pyx_v_nodeMaterialTypes.strides[0]) ))));
if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 694, __pyx_L89_except_error)
12781 __Pyx_GOTREF(__pyx_t_8);
12790 __pyx_t_43 = PyTuple_New(2);
if (unlikely(!__pyx_t_43)) __PYX_ERR(0, 693, __pyx_L89_except_error)
12791 __Pyx_GOTREF(__pyx_t_43);
12792 __Pyx_INCREF(__pyx_kp_s_node_materialType);
12793 __Pyx_GIVEREF(__pyx_kp_s_node_materialType);
12794 PyTuple_SET_ITEM(__pyx_t_43, 0, __pyx_kp_s_node_materialType);
12795 __Pyx_GIVEREF(__pyx_t_8);
12796 PyTuple_SET_ITEM(__pyx_t_43, 1, __pyx_t_8);
12798 if (__Pyx_PrintOne(0, __pyx_t_43) < 0) __PYX_ERR(0, 693, __pyx_L89_except_error)
12799 __Pyx_DECREF(__pyx_t_43); __pyx_t_43 = 0;
12808 __pyx_t_17 = __pyx_v_node;
12810 if (__pyx_t_17 < 0) __pyx_t_17 += __pyx_v_nodeArray.shape[0];
12811 if (__pyx_t_26 < 0) __pyx_t_26 += __pyx_v_nodeArray.shape[1];
12812 __pyx_t_43 = PyFloat_FromDouble((*((
double *) ( (( (__pyx_v_nodeArray.data + __pyx_t_17 * __pyx_v_nodeArray.strides[0]) ) + __pyx_t_26 * __pyx_v_nodeArray.strides[1]) ))));
if (unlikely(!__pyx_t_43)) __PYX_ERR(0, 696, __pyx_L89_except_error)
12813 __Pyx_GOTREF(__pyx_t_43);
12822 __pyx_t_26 = __pyx_v_node;
12824 if (__pyx_t_26 < 0) __pyx_t_26 += __pyx_v_nodeArray.shape[0];
12825 if (__pyx_t_17 < 0) __pyx_t_17 += __pyx_v_nodeArray.shape[1];
12826 __pyx_t_8 = PyFloat_FromDouble((*((
double *) ( (( (__pyx_v_nodeArray.data + __pyx_t_26 * __pyx_v_nodeArray.strides[0]) ) + __pyx_t_17 * __pyx_v_nodeArray.strides[1]) ))));
if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 697, __pyx_L89_except_error)
12827 __Pyx_GOTREF(__pyx_t_8);
12836 __pyx_t_17 = __pyx_v_node;
12838 if (__pyx_t_17 < 0) __pyx_t_17 += __pyx_v_nodeArray.shape[0];
12839 if (__pyx_t_26 < 0) __pyx_t_26 += __pyx_v_nodeArray.shape[1];
12840 __pyx_t_4 = PyFloat_FromDouble((*((
double *) ( (( (__pyx_v_nodeArray.data + __pyx_t_17 * __pyx_v_nodeArray.strides[0]) ) + __pyx_t_26 * __pyx_v_nodeArray.strides[1]) ))));
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 698, __pyx_L89_except_error)
12841 __Pyx_GOTREF(__pyx_t_4);
12850 __pyx_t_44 = PyTuple_New(4);
if (unlikely(!__pyx_t_44)) __PYX_ERR(0, 695, __pyx_L89_except_error)
12851 __Pyx_GOTREF(__pyx_t_44);
12852 __Pyx_INCREF(__pyx_kp_s_node_old_coordinates);
12853 __Pyx_GIVEREF(__pyx_kp_s_node_old_coordinates);
12854 PyTuple_SET_ITEM(__pyx_t_44, 0, __pyx_kp_s_node_old_coordinates);
12855 __Pyx_GIVEREF(__pyx_t_43);
12856 PyTuple_SET_ITEM(__pyx_t_44, 1, __pyx_t_43);
12857 __Pyx_GIVEREF(__pyx_t_8);
12858 PyTuple_SET_ITEM(__pyx_t_44, 2, __pyx_t_8);
12859 __Pyx_GIVEREF(__pyx_t_4);
12860 PyTuple_SET_ITEM(__pyx_t_44, 3, __pyx_t_4);
12864 if (__Pyx_PrintOne(0, __pyx_t_44) < 0) __PYX_ERR(0, 695, __pyx_L89_except_error)
12865 __Pyx_DECREF(__pyx_t_44); __pyx_t_44 = 0;
12875 if (__pyx_t_26 < 0) __pyx_t_26 += __pyx_v_coords.shape[0];
12876 __pyx_t_44 = PyFloat_FromDouble((*((
double *) ( (__pyx_v_coords.data + __pyx_t_26 * __pyx_v_coords.strides[0]) ))));
if (unlikely(!__pyx_t_44)) __PYX_ERR(0, 700, __pyx_L89_except_error)
12877 __Pyx_GOTREF(__pyx_t_44);
12887 if (__pyx_t_26 < 0) __pyx_t_26 += __pyx_v_coords.shape[0];
12888 __pyx_t_4 = PyFloat_FromDouble((*((
double *) ( (__pyx_v_coords.data + __pyx_t_26 * __pyx_v_coords.strides[0]) ))));
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 701, __pyx_L89_except_error)
12889 __Pyx_GOTREF(__pyx_t_4);
12899 if (__pyx_t_26 < 0) __pyx_t_26 += __pyx_v_coords.shape[0];
12900 __pyx_t_8 = PyFloat_FromDouble((*((
double *) ( (__pyx_v_coords.data + __pyx_t_26 * __pyx_v_coords.strides[0]) ))));
if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 702, __pyx_L89_except_error)
12901 __Pyx_GOTREF(__pyx_t_8);
12910 __pyx_t_43 = PyTuple_New(4);
if (unlikely(!__pyx_t_43)) __PYX_ERR(0, 699, __pyx_L89_except_error)
12911 __Pyx_GOTREF(__pyx_t_43);
12912 __Pyx_INCREF(__pyx_kp_s_node_new_coordinates);
12913 __Pyx_GIVEREF(__pyx_kp_s_node_new_coordinates);
12914 PyTuple_SET_ITEM(__pyx_t_43, 0, __pyx_kp_s_node_new_coordinates);
12915 __Pyx_GIVEREF(__pyx_t_44);
12916 PyTuple_SET_ITEM(__pyx_t_43, 1, __pyx_t_44);
12917 __Pyx_GIVEREF(__pyx_t_4);
12918 PyTuple_SET_ITEM(__pyx_t_43, 2, __pyx_t_4);
12919 __Pyx_GIVEREF(__pyx_t_8);
12920 PyTuple_SET_ITEM(__pyx_t_43, 3, __pyx_t_8);
12924 if (__Pyx_PrintOne(0, __pyx_t_43) < 0) __PYX_ERR(0, 699, __pyx_L89_except_error)
12925 __Pyx_DECREF(__pyx_t_43); __pyx_t_43 = 0;
12934 __pyx_t_43 = __Pyx_PyInt_From_int(__pyx_v_nearestN);
if (unlikely(!__pyx_t_43)) __PYX_ERR(0, 704, __pyx_L89_except_error)
12935 __Pyx_GOTREF(__pyx_t_43);
12944 __pyx_t_8 = __Pyx_PyInt_From_int(__pyx_v_typeN);
if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 706, __pyx_L89_except_error)
12945 __Pyx_GOTREF(__pyx_t_8);
12954 __pyx_t_4 = PyTuple_New(4);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 703, __pyx_L89_except_error)
12955 __Pyx_GOTREF(__pyx_t_4);
12956 __Pyx_INCREF(__pyx_kp_s_nearestN_element);
12957 __Pyx_GIVEREF(__pyx_kp_s_nearestN_element);
12958 PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_kp_s_nearestN_element);
12959 __Pyx_GIVEREF(__pyx_t_43);
12960 PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_43);
12961 __Pyx_INCREF(__pyx_kp_s_type_should_be_1);
12962 __Pyx_GIVEREF(__pyx_kp_s_type_should_be_1);
12963 PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_kp_s_type_should_be_1);
12964 __Pyx_GIVEREF(__pyx_t_8);
12965 PyTuple_SET_ITEM(__pyx_t_4, 3, __pyx_t_8);
12968 if (__Pyx_PrintOne(0, __pyx_t_4) < 0) __PYX_ERR(0, 703, __pyx_L89_except_error)
12969 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
12978 __pyx_t_26 = __pyx_v_nearestN;
12980 if (__pyx_t_26 < 0) __pyx_t_26 += __pyx_v_elementBarycentersArray.shape[0];
12981 if (__pyx_t_17 < 0) __pyx_t_17 += __pyx_v_elementBarycentersArray.shape[1];
12982 __pyx_t_4 = PyFloat_FromDouble((*((
double *) ( (( (__pyx_v_elementBarycentersArray.data + __pyx_t_26 * __pyx_v_elementBarycentersArray.strides[0]) ) + __pyx_t_17 * __pyx_v_elementBarycentersArray.strides[1]) ))));
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 708, __pyx_L89_except_error)
12983 __Pyx_GOTREF(__pyx_t_4);
12992 __pyx_t_17 = __pyx_v_nearestN;
12994 if (__pyx_t_17 < 0) __pyx_t_17 += __pyx_v_elementBarycentersArray.shape[0];
12995 if (__pyx_t_26 < 0) __pyx_t_26 += __pyx_v_elementBarycentersArray.shape[1];
12996 __pyx_t_8 = PyFloat_FromDouble((*((
double *) ( (( (__pyx_v_elementBarycentersArray.data + __pyx_t_17 * __pyx_v_elementBarycentersArray.strides[0]) ) + __pyx_t_26 * __pyx_v_elementBarycentersArray.strides[1]) ))));
if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 709, __pyx_L89_except_error)
12997 __Pyx_GOTREF(__pyx_t_8);
13006 __pyx_t_26 = __pyx_v_nearestN;
13008 if (__pyx_t_26 < 0) __pyx_t_26 += __pyx_v_elementBarycentersArray.shape[0];
13009 if (__pyx_t_17 < 0) __pyx_t_17 += __pyx_v_elementBarycentersArray.shape[1];
13010 __pyx_t_43 = PyFloat_FromDouble((*((
double *) ( (( (__pyx_v_elementBarycentersArray.data + __pyx_t_26 * __pyx_v_elementBarycentersArray.strides[0]) ) + __pyx_t_17 * __pyx_v_elementBarycentersArray.strides[1]) ))));
if (unlikely(!__pyx_t_43)) __PYX_ERR(0, 710, __pyx_L89_except_error)
13011 __Pyx_GOTREF(__pyx_t_43);
13020 __pyx_t_44 = PyTuple_New(4);
if (unlikely(!__pyx_t_44)) __PYX_ERR(0, 707, __pyx_L89_except_error)
13021 __Pyx_GOTREF(__pyx_t_44);
13022 __Pyx_INCREF(__pyx_kp_s_element_barycenter);
13023 __Pyx_GIVEREF(__pyx_kp_s_element_barycenter);
13024 PyTuple_SET_ITEM(__pyx_t_44, 0, __pyx_kp_s_element_barycenter);
13025 __Pyx_GIVEREF(__pyx_t_4);
13026 PyTuple_SET_ITEM(__pyx_t_44, 1, __pyx_t_4);
13027 __Pyx_GIVEREF(__pyx_t_8);
13028 PyTuple_SET_ITEM(__pyx_t_44, 2, __pyx_t_8);
13029 __Pyx_GIVEREF(__pyx_t_43);
13030 PyTuple_SET_ITEM(__pyx_t_44, 3, __pyx_t_43);
13034 if (__Pyx_PrintOne(0, __pyx_t_44) < 0) __PYX_ERR(0, 707, __pyx_L89_except_error)
13035 __Pyx_DECREF(__pyx_t_44); __pyx_t_44 = 0;
13044 __pyx_t_15 = (__pyx_v_elementNodesArray.shape[1]);
13045 __pyx_t_48 = __pyx_t_15;
13046 for (__pyx_t_40 = 0; __pyx_t_40 < __pyx_t_48; __pyx_t_40+=1) {
13047 __pyx_v_ii = __pyx_t_40;
13056 __pyx_t_17 = __pyx_v_nearestN;
13057 __pyx_t_26 = __pyx_v_ii;
13058 if (__pyx_t_17 < 0) __pyx_t_17 += __pyx_v_elementNodesArray.shape[0];
13059 if (__pyx_t_26 < 0) __pyx_t_26 += __pyx_v_elementNodesArray.shape[1];
13060 __pyx_t_44 = __Pyx_PyInt_From_int((*((
int *) ( (( (__pyx_v_elementNodesArray.data + __pyx_t_17 * __pyx_v_elementNodesArray.strides[0]) ) + __pyx_t_26 * __pyx_v_elementNodesArray.strides[1]) ))));
if (unlikely(!__pyx_t_44)) __PYX_ERR(0, 713, __pyx_L89_except_error)
13061 __Pyx_GOTREF(__pyx_t_44);
13070 __pyx_t_26 = __pyx_v_nearestN;
13071 __pyx_t_17 = __pyx_v_ii;
13072 if (__pyx_t_26 < 0) __pyx_t_26 += __pyx_v_elementNodesArray.shape[0];
13073 if (__pyx_t_17 < 0) __pyx_t_17 += __pyx_v_elementNodesArray.shape[1];
13074 __pyx_t_25 = (*((
int *) ( (( (__pyx_v_elementNodesArray.data + __pyx_t_26 * __pyx_v_elementNodesArray.strides[0]) ) + __pyx_t_17 * __pyx_v_elementNodesArray.strides[1]) )));
13076 if (__pyx_t_25 < 0) __pyx_t_25 += __pyx_v_nodeArray.shape[0];
13077 if (__pyx_t_31 < 0) __pyx_t_31 += __pyx_v_nodeArray.shape[1];
13078 __pyx_t_43 = PyFloat_FromDouble((*((
double *) ( (( (__pyx_v_nodeArray.data + __pyx_t_25 * __pyx_v_nodeArray.strides[0]) ) + __pyx_t_31 * __pyx_v_nodeArray.strides[1]) ))));
if (unlikely(!__pyx_t_43)) __PYX_ERR(0, 714, __pyx_L89_except_error)
13079 __Pyx_GOTREF(__pyx_t_43);
13088 __pyx_t_17 = __pyx_v_nearestN;
13089 __pyx_t_26 = __pyx_v_ii;
13090 if (__pyx_t_17 < 0) __pyx_t_17 += __pyx_v_elementNodesArray.shape[0];
13091 if (__pyx_t_26 < 0) __pyx_t_26 += __pyx_v_elementNodesArray.shape[1];
13092 __pyx_t_31 = (*((
int *) ( (( (__pyx_v_elementNodesArray.data + __pyx_t_17 * __pyx_v_elementNodesArray.strides[0]) ) + __pyx_t_26 * __pyx_v_elementNodesArray.strides[1]) )));
13094 if (__pyx_t_31 < 0) __pyx_t_31 += __pyx_v_nodeArray.shape[0];
13095 if (__pyx_t_25 < 0) __pyx_t_25 += __pyx_v_nodeArray.shape[1];
13096 __pyx_t_8 = PyFloat_FromDouble((*((
double *) ( (( (__pyx_v_nodeArray.data + __pyx_t_31 * __pyx_v_nodeArray.strides[0]) ) + __pyx_t_25 * __pyx_v_nodeArray.strides[1]) ))));
if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 715, __pyx_L89_except_error)
13097 __Pyx_GOTREF(__pyx_t_8);
13106 __pyx_t_26 = __pyx_v_nearestN;
13107 __pyx_t_17 = __pyx_v_ii;
13108 if (__pyx_t_26 < 0) __pyx_t_26 += __pyx_v_elementNodesArray.shape[0];
13109 if (__pyx_t_17 < 0) __pyx_t_17 += __pyx_v_elementNodesArray.shape[1];
13110 __pyx_t_25 = (*((
int *) ( (( (__pyx_v_elementNodesArray.data + __pyx_t_26 * __pyx_v_elementNodesArray.strides[0]) ) + __pyx_t_17 * __pyx_v_elementNodesArray.strides[1]) )));
13112 if (__pyx_t_25 < 0) __pyx_t_25 += __pyx_v_nodeArray.shape[0];
13113 if (__pyx_t_31 < 0) __pyx_t_31 += __pyx_v_nodeArray.shape[1];
13114 __pyx_t_4 = PyFloat_FromDouble((*((
double *) ( (( (__pyx_v_nodeArray.data + __pyx_t_25 * __pyx_v_nodeArray.strides[0]) ) + __pyx_t_31 * __pyx_v_nodeArray.strides[1]) ))));
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 716, __pyx_L89_except_error)
13115 __Pyx_GOTREF(__pyx_t_4);
13124 __pyx_t_45 = PyTuple_New(5);
if (unlikely(!__pyx_t_45)) __PYX_ERR(0, 712, __pyx_L89_except_error)
13125 __Pyx_GOTREF(__pyx_t_45);
13126 __Pyx_INCREF(__pyx_kp_s_element_node);
13127 __Pyx_GIVEREF(__pyx_kp_s_element_node);
13128 PyTuple_SET_ITEM(__pyx_t_45, 0, __pyx_kp_s_element_node);
13129 __Pyx_GIVEREF(__pyx_t_44);
13130 PyTuple_SET_ITEM(__pyx_t_45, 1, __pyx_t_44);
13131 __Pyx_GIVEREF(__pyx_t_43);
13132 PyTuple_SET_ITEM(__pyx_t_45, 2, __pyx_t_43);
13133 __Pyx_GIVEREF(__pyx_t_8);
13134 PyTuple_SET_ITEM(__pyx_t_45, 3, __pyx_t_8);
13135 __Pyx_GIVEREF(__pyx_t_4);
13136 PyTuple_SET_ITEM(__pyx_t_45, 4, __pyx_t_4);
13141 if (__Pyx_PrintOne(0, __pyx_t_45) < 0) __PYX_ERR(0, 712, __pyx_L89_except_error)
13142 __Pyx_DECREF(__pyx_t_45); __pyx_t_45 = 0;
13153 if (__pyx_t_17 < 0) __pyx_t_17 += __pyx_v_fixed_dir.shape[0];
13154 __pyx_t_45 = PyFloat_FromDouble((*((
double *) ( (__pyx_v_fixed_dir.data + __pyx_t_17 * __pyx_v_fixed_dir.strides[0]) ))));
if (unlikely(!__pyx_t_45)) __PYX_ERR(0, 718, __pyx_L89_except_error)
13155 __Pyx_GOTREF(__pyx_t_45);
13165 if (__pyx_t_17 < 0) __pyx_t_17 += __pyx_v_fixed_dir.shape[0];
13166 __pyx_t_4 = PyFloat_FromDouble((*((
double *) ( (__pyx_v_fixed_dir.data + __pyx_t_17 * __pyx_v_fixed_dir.strides[0]) ))));
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 719, __pyx_L89_except_error)
13167 __Pyx_GOTREF(__pyx_t_4);
13177 if (__pyx_t_17 < 0) __pyx_t_17 += __pyx_v_fixed_dir.shape[0];
13178 __pyx_t_8 = PyFloat_FromDouble((*((
double *) ( (__pyx_v_fixed_dir.data + __pyx_t_17 * __pyx_v_fixed_dir.strides[0]) ))));
if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 720, __pyx_L89_except_error)
13179 __Pyx_GOTREF(__pyx_t_8);
13188 __pyx_t_43 = PyTuple_New(4);
if (unlikely(!__pyx_t_43)) __PYX_ERR(0, 717, __pyx_L89_except_error)
13189 __Pyx_GOTREF(__pyx_t_43);
13190 __Pyx_INCREF(__pyx_kp_s_fixed_dir);
13191 __Pyx_GIVEREF(__pyx_kp_s_fixed_dir);
13192 PyTuple_SET_ITEM(__pyx_t_43, 0, __pyx_kp_s_fixed_dir);
13193 __Pyx_GIVEREF(__pyx_t_45);
13194 PyTuple_SET_ITEM(__pyx_t_43, 1, __pyx_t_45);
13195 __Pyx_GIVEREF(__pyx_t_4);
13196 PyTuple_SET_ITEM(__pyx_t_43, 2, __pyx_t_4);
13197 __Pyx_GIVEREF(__pyx_t_8);
13198 PyTuple_SET_ITEM(__pyx_t_43, 3, __pyx_t_8);
13202 if (__Pyx_PrintOne(0, __pyx_t_43) < 0) __PYX_ERR(0, 717, __pyx_L89_except_error)
13203 __Pyx_DECREF(__pyx_t_43); __pyx_t_43 = 0;
13212 __pyx_t_43 = PyFloat_FromDouble(__pyx_v_dot);
if (unlikely(!__pyx_t_43)) __PYX_ERR(0, 721, __pyx_L89_except_error)
13213 __Pyx_GOTREF(__pyx_t_43);
13214 __pyx_t_8 = PyTuple_New(2);
if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 721, __pyx_L89_except_error)
13215 __Pyx_GOTREF(__pyx_t_8);
13216 __Pyx_INCREF(__pyx_kp_s_dot);
13217 __Pyx_GIVEREF(__pyx_kp_s_dot);
13218 PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_kp_s_dot);
13219 __Pyx_GIVEREF(__pyx_t_43);
13220 PyTuple_SET_ITEM(__pyx_t_8, 1, __pyx_t_43);
13222 if (__Pyx_PrintOne(0, __pyx_t_8) < 0) __PYX_ERR(0, 721, __pyx_L89_except_error)
13223 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
13232 __pyx_t_43 = __Pyx_PyObject_GetAttrStr(__pyx_v_comm, __pyx_n_s_Abort);
if (unlikely(!__pyx_t_43)) __PYX_ERR(0, 722, __pyx_L89_except_error)
13233 __Pyx_GOTREF(__pyx_t_43);
13235 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_43))) {
13236 __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_43);
13237 if (likely(__pyx_t_4)) {
13238 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_43);
13239 __Pyx_INCREF(__pyx_t_4);
13240 __Pyx_INCREF(
function);
13241 __Pyx_DECREF_SET(__pyx_t_43,
function);
13244 __pyx_t_8 = (__pyx_t_4) ? __Pyx_PyObject_CallOneArg(__pyx_t_43, __pyx_t_4) : __Pyx_PyObject_CallNoArg(__pyx_t_43);
13245 __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
13246 if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 722, __pyx_L89_except_error)
13247 __Pyx_GOTREF(__pyx_t_8);
13248 __Pyx_DECREF(__pyx_t_43); __pyx_t_43 = 0;
13249 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
13250 __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
13251 __Pyx_XDECREF(__pyx_t_47); __pyx_t_47 = 0;
13252 __Pyx_XDECREF(__pyx_t_46); __pyx_t_46 = 0;
13253 goto __pyx_L88_exception_handled;
13255 goto __pyx_L89_except_error;
13256 __pyx_L89_except_error:;
13265 __Pyx_XGIVEREF(__pyx_t_39);
13266 __Pyx_XGIVEREF(__pyx_t_38);
13267 __Pyx_XGIVEREF(__pyx_t_37);
13268 __Pyx_ExceptionReset(__pyx_t_39, __pyx_t_38, __pyx_t_37);
13269 goto __pyx_L1_error;
13270 __pyx_L88_exception_handled:;
13271 __Pyx_XGIVEREF(__pyx_t_39);
13272 __Pyx_XGIVEREF(__pyx_t_38);
13273 __Pyx_XGIVEREF(__pyx_t_37);
13274 __Pyx_ExceptionReset(__pyx_t_39, __pyx_t_38, __pyx_t_37);
13294 __pyx_t_19 = (__pyx_v_inside_eN != 0);
13304 __pyx_t_47 = __Pyx_PyObject_GetAttrStr(__pyx_v_femSpace, __pyx_n_s_elementMaps);
if (unlikely(!__pyx_t_47)) __PYX_ERR(0, 724, __pyx_L1_error)
13305 __Pyx_GOTREF(__pyx_t_47);
13306 __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_47, __pyx_n_s_getInverseValue);
if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 724, __pyx_L1_error)
13307 __Pyx_GOTREF(__pyx_t_7);
13308 __Pyx_DECREF(__pyx_t_47); __pyx_t_47 = 0;
13309 __pyx_t_47 = __Pyx_PyInt_From_int(__pyx_v_nearestN);
if (unlikely(!__pyx_t_47)) __PYX_ERR(0, 724, __pyx_L1_error)
13310 __Pyx_GOTREF(__pyx_t_47);
13311 __pyx_t_8 = __pyx_memoryview_fromslice(__pyx_v_coords, 1, (PyObject *(*)(
char *)) __pyx_memview_get_double, (
int (*)(
char *, PyObject *)) __pyx_memview_set_double, 0);;
if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 724, __pyx_L1_error)
13312 __Pyx_GOTREF(__pyx_t_8);
13315 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_7))) {
13316 __pyx_t_43 = PyMethod_GET_SELF(__pyx_t_7);
13317 if (likely(__pyx_t_43)) {
13318 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_7);
13319 __Pyx_INCREF(__pyx_t_43);
13320 __Pyx_INCREF(
function);
13321 __Pyx_DECREF_SET(__pyx_t_7,
function);
13325 #if CYTHON_FAST_PYCALL
13326 if (PyFunction_Check(__pyx_t_7)) {
13327 PyObject *__pyx_temp[3] = {__pyx_t_43, __pyx_t_47, __pyx_t_8};
13328 __pyx_t_46 = __Pyx_PyFunction_FastCall(__pyx_t_7, __pyx_temp+1-__pyx_t_27, 2+__pyx_t_27);
if (unlikely(!__pyx_t_46)) __PYX_ERR(0, 724, __pyx_L1_error)
13329 __Pyx_XDECREF(__pyx_t_43); __pyx_t_43 = 0;
13330 __Pyx_GOTREF(__pyx_t_46);
13331 __Pyx_DECREF(__pyx_t_47); __pyx_t_47 = 0;
13332 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
13335 #if CYTHON_FAST_PYCCALL
13336 if (__Pyx_PyFastCFunction_Check(__pyx_t_7)) {
13337 PyObject *__pyx_temp[3] = {__pyx_t_43, __pyx_t_47, __pyx_t_8};
13338 __pyx_t_46 = __Pyx_PyCFunction_FastCall(__pyx_t_7, __pyx_temp+1-__pyx_t_27, 2+__pyx_t_27);
if (unlikely(!__pyx_t_46)) __PYX_ERR(0, 724, __pyx_L1_error)
13339 __Pyx_XDECREF(__pyx_t_43); __pyx_t_43 = 0;
13340 __Pyx_GOTREF(__pyx_t_46);
13341 __Pyx_DECREF(__pyx_t_47); __pyx_t_47 = 0;
13342 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
13346 __pyx_t_4 = PyTuple_New(2+__pyx_t_27);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 724, __pyx_L1_error)
13347 __Pyx_GOTREF(__pyx_t_4);
13349 __Pyx_GIVEREF(__pyx_t_43); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_43); __pyx_t_43 = NULL;
13351 __Pyx_GIVEREF(__pyx_t_47);
13352 PyTuple_SET_ITEM(__pyx_t_4, 0+__pyx_t_27, __pyx_t_47);
13353 __Pyx_GIVEREF(__pyx_t_8);
13354 PyTuple_SET_ITEM(__pyx_t_4, 1+__pyx_t_27, __pyx_t_8);
13357 __pyx_t_46 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_4, NULL);
if (unlikely(!__pyx_t_46)) __PYX_ERR(0, 724, __pyx_L1_error)
13358 __Pyx_GOTREF(__pyx_t_46);
13359 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
13361 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
13362 __Pyx_XDECREF_SET(__pyx_v_xi, __pyx_t_46);
13372 __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_pc, __pyx_n_s_getGradientValue);
if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 726, __pyx_L1_error)
13373 __Pyx_GOTREF(__pyx_t_7);
13374 __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_nearestN);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 726, __pyx_L1_error)
13375 __Pyx_GOTREF(__pyx_t_4);
13378 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_7))) {
13379 __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_7);
13380 if (likely(__pyx_t_8)) {
13381 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_7);
13382 __Pyx_INCREF(__pyx_t_8);
13383 __Pyx_INCREF(
function);
13384 __Pyx_DECREF_SET(__pyx_t_7,
function);
13388 #if CYTHON_FAST_PYCALL
13389 if (PyFunction_Check(__pyx_t_7)) {
13390 PyObject *__pyx_temp[3] = {__pyx_t_8, __pyx_t_4, __pyx_v_xi};
13391 __pyx_t_46 = __Pyx_PyFunction_FastCall(__pyx_t_7, __pyx_temp+1-__pyx_t_27, 2+__pyx_t_27);
if (unlikely(!__pyx_t_46)) __PYX_ERR(0, 726, __pyx_L1_error)
13392 __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
13393 __Pyx_GOTREF(__pyx_t_46);
13394 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
13397 #if CYTHON_FAST_PYCCALL
13398 if (__Pyx_PyFastCFunction_Check(__pyx_t_7)) {
13399 PyObject *__pyx_temp[3] = {__pyx_t_8, __pyx_t_4, __pyx_v_xi};
13400 __pyx_t_46 = __Pyx_PyCFunction_FastCall(__pyx_t_7, __pyx_temp+1-__pyx_t_27, 2+__pyx_t_27);
if (unlikely(!__pyx_t_46)) __PYX_ERR(0, 726, __pyx_L1_error)
13401 __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
13402 __Pyx_GOTREF(__pyx_t_46);
13403 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
13407 __pyx_t_47 = PyTuple_New(2+__pyx_t_27);
if (unlikely(!__pyx_t_47)) __PYX_ERR(0, 726, __pyx_L1_error)
13408 __Pyx_GOTREF(__pyx_t_47);
13410 __Pyx_GIVEREF(__pyx_t_8); PyTuple_SET_ITEM(__pyx_t_47, 0, __pyx_t_8); __pyx_t_8 = NULL;
13412 __Pyx_GIVEREF(__pyx_t_4);
13413 PyTuple_SET_ITEM(__pyx_t_47, 0+__pyx_t_27, __pyx_t_4);
13414 __Pyx_INCREF(__pyx_v_xi);
13415 __Pyx_GIVEREF(__pyx_v_xi);
13416 PyTuple_SET_ITEM(__pyx_t_47, 1+__pyx_t_27, __pyx_v_xi);
13418 __pyx_t_46 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_47, NULL);
if (unlikely(!__pyx_t_46)) __PYX_ERR(0, 726, __pyx_L1_error)
13419 __Pyx_GOTREF(__pyx_t_46);
13420 __Pyx_DECREF(__pyx_t_47); __pyx_t_47 = 0;
13422 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
13423 __pyx_t_9 = __Pyx_PyObject_to_MemoryviewSlice_ds_double(__pyx_t_46, PyBUF_WRITABLE);
if (unlikely(!__pyx_t_9.memview)) __PYX_ERR(0, 726, __pyx_L1_error)
13424 __Pyx_DECREF(__pyx_t_46); __pyx_t_46 = 0;
13425 __PYX_XDEC_MEMVIEW(&__pyx_v_v_grad, 1);
13426 __pyx_v_v_grad = __pyx_t_9;
13427 __pyx_t_9.memview = NULL;
13428 __pyx_t_9.data = NULL;
13437 __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_pc, __pyx_n_s_getAreaValue);
if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 727, __pyx_L1_error)
13438 __Pyx_GOTREF(__pyx_t_7);
13439 __pyx_t_47 = __Pyx_PyInt_From_int(__pyx_v_nearestN);
if (unlikely(!__pyx_t_47)) __PYX_ERR(0, 727, __pyx_L1_error)
13440 __Pyx_GOTREF(__pyx_t_47);
13443 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_7))) {
13444 __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_7);
13445 if (likely(__pyx_t_4)) {
13446 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_7);
13447 __Pyx_INCREF(__pyx_t_4);
13448 __Pyx_INCREF(
function);
13449 __Pyx_DECREF_SET(__pyx_t_7,
function);
13453 #if CYTHON_FAST_PYCALL
13454 if (PyFunction_Check(__pyx_t_7)) {
13455 PyObject *__pyx_temp[3] = {__pyx_t_4, __pyx_t_47, __pyx_v_xi};
13456 __pyx_t_46 = __Pyx_PyFunction_FastCall(__pyx_t_7, __pyx_temp+1-__pyx_t_27, 2+__pyx_t_27);
if (unlikely(!__pyx_t_46)) __PYX_ERR(0, 727, __pyx_L1_error)
13457 __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
13458 __Pyx_GOTREF(__pyx_t_46);
13459 __Pyx_DECREF(__pyx_t_47); __pyx_t_47 = 0;
13462 #if CYTHON_FAST_PYCCALL
13463 if (__Pyx_PyFastCFunction_Check(__pyx_t_7)) {
13464 PyObject *__pyx_temp[3] = {__pyx_t_4, __pyx_t_47, __pyx_v_xi};
13465 __pyx_t_46 = __Pyx_PyCFunction_FastCall(__pyx_t_7, __pyx_temp+1-__pyx_t_27, 2+__pyx_t_27);
if (unlikely(!__pyx_t_46)) __PYX_ERR(0, 727, __pyx_L1_error)
13466 __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
13467 __Pyx_GOTREF(__pyx_t_46);
13468 __Pyx_DECREF(__pyx_t_47); __pyx_t_47 = 0;
13472 __pyx_t_8 = PyTuple_New(2+__pyx_t_27);
if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 727, __pyx_L1_error)
13473 __Pyx_GOTREF(__pyx_t_8);
13475 __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_4); __pyx_t_4 = NULL;
13477 __Pyx_GIVEREF(__pyx_t_47);
13478 PyTuple_SET_ITEM(__pyx_t_8, 0+__pyx_t_27, __pyx_t_47);
13479 __Pyx_INCREF(__pyx_v_xi);
13480 __Pyx_GIVEREF(__pyx_v_xi);
13481 PyTuple_SET_ITEM(__pyx_t_8, 1+__pyx_t_27, __pyx_v_xi);
13483 __pyx_t_46 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_8, NULL);
if (unlikely(!__pyx_t_46)) __PYX_ERR(0, 727, __pyx_L1_error)
13484 __Pyx_GOTREF(__pyx_t_46);
13485 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
13487 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
13488 __pyx_t_12 = __pyx_PyFloat_AsDouble(__pyx_t_46);
if (unlikely((__pyx_t_12 == (
double)-1) && PyErr_Occurred())) __PYX_ERR(0, 727, __pyx_L1_error)
13489 __Pyx_DECREF(__pyx_t_46); __pyx_t_46 = 0;
13490 __pyx_v_area = __pyx_t_12;
13499 __pyx_t_19 = ((((PyObject *) __pyx_v_u_phi.memview) != Py_None) != 0);
13509 __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_pc, __pyx_n_s_getLevelSetValue);
if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 730, __pyx_L1_error)
13510 __Pyx_GOTREF(__pyx_t_7);
13511 __pyx_t_8 = __Pyx_PyInt_From_int(__pyx_v_nearestN);
if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 730, __pyx_L1_error)
13512 __Pyx_GOTREF(__pyx_t_8);
13513 __pyx_t_47 = __pyx_memoryview_fromslice(__pyx_v_coords, 1, (PyObject *(*)(
char *)) __pyx_memview_get_double, (
int (*)(
char *, PyObject *)) __pyx_memview_set_double, 0);;
if (unlikely(!__pyx_t_47)) __PYX_ERR(0, 730, __pyx_L1_error)
13514 __Pyx_GOTREF(__pyx_t_47);
13517 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_7))) {
13518 __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_7);
13519 if (likely(__pyx_t_4)) {
13520 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_7);
13521 __Pyx_INCREF(__pyx_t_4);
13522 __Pyx_INCREF(
function);
13523 __Pyx_DECREF_SET(__pyx_t_7,
function);
13527 #if CYTHON_FAST_PYCALL
13528 if (PyFunction_Check(__pyx_t_7)) {
13529 PyObject *__pyx_temp[3] = {__pyx_t_4, __pyx_t_8, __pyx_t_47};
13530 __pyx_t_46 = __Pyx_PyFunction_FastCall(__pyx_t_7, __pyx_temp+1-__pyx_t_27, 2+__pyx_t_27);
if (unlikely(!__pyx_t_46)) __PYX_ERR(0, 730, __pyx_L1_error)
13531 __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
13532 __Pyx_GOTREF(__pyx_t_46);
13533 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
13534 __Pyx_DECREF(__pyx_t_47); __pyx_t_47 = 0;
13537 #if CYTHON_FAST_PYCCALL
13538 if (__Pyx_PyFastCFunction_Check(__pyx_t_7)) {
13539 PyObject *__pyx_temp[3] = {__pyx_t_4, __pyx_t_8, __pyx_t_47};
13540 __pyx_t_46 = __Pyx_PyCFunction_FastCall(__pyx_t_7, __pyx_temp+1-__pyx_t_27, 2+__pyx_t_27);
if (unlikely(!__pyx_t_46)) __PYX_ERR(0, 730, __pyx_L1_error)
13541 __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
13542 __Pyx_GOTREF(__pyx_t_46);
13543 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
13544 __Pyx_DECREF(__pyx_t_47); __pyx_t_47 = 0;
13548 __pyx_t_43 = PyTuple_New(2+__pyx_t_27);
if (unlikely(!__pyx_t_43)) __PYX_ERR(0, 730, __pyx_L1_error)
13549 __Pyx_GOTREF(__pyx_t_43);
13551 __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_43, 0, __pyx_t_4); __pyx_t_4 = NULL;
13553 __Pyx_GIVEREF(__pyx_t_8);
13554 PyTuple_SET_ITEM(__pyx_t_43, 0+__pyx_t_27, __pyx_t_8);
13555 __Pyx_GIVEREF(__pyx_t_47);
13556 PyTuple_SET_ITEM(__pyx_t_43, 1+__pyx_t_27, __pyx_t_47);
13559 __pyx_t_46 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_43, NULL);
if (unlikely(!__pyx_t_46)) __PYX_ERR(0, 730, __pyx_L1_error)
13560 __Pyx_GOTREF(__pyx_t_46);
13561 __Pyx_DECREF(__pyx_t_43); __pyx_t_43 = 0;
13563 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
13564 __pyx_t_12 = __pyx_PyFloat_AsDouble(__pyx_t_46);
if (unlikely((__pyx_t_12 == (
double)-1) && PyErr_Occurred())) __PYX_ERR(0, 730, __pyx_L1_error)
13565 __Pyx_DECREF(__pyx_t_46); __pyx_t_46 = 0;
13566 __pyx_v_ls_phi = __pyx_t_12;
13586 __pyx_v_ls_phi = 1e12;
13597 __pyx_t_46 = __Pyx_PyObject_GetAttrStr(__pyx_v_pc, __pyx_n_s_evaluateFunAtX);
if (unlikely(!__pyx_t_46)) __PYX_ERR(0, 733, __pyx_L1_error)
13598 __Pyx_GOTREF(__pyx_t_46);
13599 __pyx_t_7 = __Pyx_PyDict_NewPresized(2);
if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 733, __pyx_L1_error)
13600 __Pyx_GOTREF(__pyx_t_7);
13601 __pyx_t_43 = __pyx_memoryview_fromslice(__pyx_v_coords, 1, (PyObject *(*)(
char *)) __pyx_memview_get_double, (
int (*)(
char *, PyObject *)) __pyx_memview_set_double, 0);;
if (unlikely(!__pyx_t_43)) __PYX_ERR(0, 733, __pyx_L1_error)
13602 __Pyx_GOTREF(__pyx_t_43);
13603 if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_x, __pyx_t_43) < 0) __PYX_ERR(0, 733, __pyx_L1_error)
13604 __Pyx_DECREF(__pyx_t_43); __pyx_t_43 = 0;
13605 __pyx_t_43 = PyFloat_FromDouble(__pyx_v_ls_phi);
if (unlikely(!__pyx_t_43)) __PYX_ERR(0, 733, __pyx_L1_error)
13606 __Pyx_GOTREF(__pyx_t_43);
13607 if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_ls_phi, __pyx_t_43) < 0) __PYX_ERR(0, 733, __pyx_L1_error)
13608 __Pyx_DECREF(__pyx_t_43); __pyx_t_43 = 0;
13609 __pyx_t_43 = __Pyx_PyObject_Call(__pyx_t_46, __pyx_empty_tuple, __pyx_t_7);
if (unlikely(!__pyx_t_43)) __PYX_ERR(0, 733, __pyx_L1_error)
13610 __Pyx_GOTREF(__pyx_t_43);
13611 __Pyx_DECREF(__pyx_t_46); __pyx_t_46 = 0;
13612 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
13613 __pyx_t_12 = __pyx_PyFloat_AsDouble(__pyx_t_43);
if (unlikely((__pyx_t_12 == (
double)-1) && PyErr_Occurred())) __PYX_ERR(0, 733, __pyx_L1_error)
13614 __Pyx_DECREF(__pyx_t_43); __pyx_t_43 = 0;
13615 __pyx_v_f = __pyx_t_12;
13624 __pyx_t_27 = __pyx_v_nd;
13625 __pyx_t_28 = __pyx_t_27;
13626 for (__pyx_t_29 = 0; __pyx_t_29 < __pyx_t_28; __pyx_t_29+=1) {
13627 __pyx_v_ndi = __pyx_t_29;
13636 __pyx_t_17 = __pyx_v_ndi;
13637 if (__pyx_t_17 < 0) __pyx_t_17 += __pyx_v_v_grad.shape[0];
13638 __pyx_t_26 = __pyx_v_ndi;
13639 if (__pyx_t_26 < 0) __pyx_t_26 += __pyx_v_dphi.shape[0];
13640 *((
double *) ( (__pyx_v_dphi.data + __pyx_t_26 * __pyx_v_dphi.strides[0]) )) = ((*((
double *) ( (__pyx_v_v_grad.data + __pyx_t_17 * __pyx_v_v_grad.strides[0]) ))) / (((__pyx_v_t * 1.) / (__pyx_v_f * __pyx_v_Ccoeff)) + (((1.0 - __pyx_v_t) * 1.) / __pyx_v_area)));
13649 __pyx_t_17 = __pyx_v_ndi;
13650 if (__pyx_t_17 < 0) __pyx_t_17 += __pyx_v_dphi.shape[0];
13651 __pyx_t_26 = __pyx_v_ndi;
13652 if (__pyx_t_26 < 0) __pyx_t_26 += __pyx_v_fixed_dir.shape[0];
13653 __pyx_t_31 = __pyx_v_ndi;
13654 if (__pyx_t_31 < 0) __pyx_t_31 += __pyx_v_coords.shape[0];
13655 *((
double *) ( (__pyx_v_coords.data + __pyx_t_31 * __pyx_v_coords.strides[0]) )) += (((*((
double *) ( (__pyx_v_dphi.data + __pyx_t_17 * __pyx_v_dphi.strides[0]) ))) * (*((
double *) ( (__pyx_v_fixed_dir.data + __pyx_t_26 * __pyx_v_fixed_dir.strides[0]) )))) * __pyx_v_dt);
13685 __Pyx_GetModuleGlobalName(__pyx_t_43, __pyx_n_s_np);
if (unlikely(!__pyx_t_43)) __PYX_ERR(0, 737, __pyx_L1_error)
13686 __Pyx_GOTREF(__pyx_t_43);
13687 __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_43, __pyx_n_s_append);
if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 737, __pyx_L1_error)
13688 __Pyx_GOTREF(__pyx_t_7);
13689 __Pyx_DECREF(__pyx_t_43); __pyx_t_43 = 0;
13690 __pyx_t_43 = __Pyx_PyInt_From_int(__pyx_v_new_rank);
if (unlikely(!__pyx_t_43)) __PYX_ERR(0, 737, __pyx_L1_error)
13691 __Pyx_GOTREF(__pyx_t_43);
13692 __pyx_t_46 = __Pyx_PyDict_GetItem(__pyx_v_coords_2rank, __pyx_t_43);
if (unlikely(!__pyx_t_46)) __PYX_ERR(0, 737, __pyx_L1_error)
13693 __Pyx_GOTREF(__pyx_t_46);
13694 __Pyx_DECREF(__pyx_t_43); __pyx_t_43 = 0;
13704 if (__pyx_t_26 < 0) __pyx_t_26 += __pyx_v_coords.shape[0];
13705 __pyx_t_43 = PyFloat_FromDouble((*((
double *) ( (__pyx_v_coords.data + __pyx_t_26 * __pyx_v_coords.strides[0]) ))));
if (unlikely(!__pyx_t_43)) __PYX_ERR(0, 738, __pyx_L1_error)
13706 __Pyx_GOTREF(__pyx_t_43);
13716 if (__pyx_t_26 < 0) __pyx_t_26 += __pyx_v_coords.shape[0];
13717 __pyx_t_47 = PyFloat_FromDouble((*((
double *) ( (__pyx_v_coords.data + __pyx_t_26 * __pyx_v_coords.strides[0]) ))));
if (unlikely(!__pyx_t_47)) __PYX_ERR(0, 739, __pyx_L1_error)
13718 __Pyx_GOTREF(__pyx_t_47);
13728 if (__pyx_t_26 < 0) __pyx_t_26 += __pyx_v_coords.shape[0];
13729 __pyx_t_8 = PyFloat_FromDouble((*((
double *) ( (__pyx_v_coords.data + __pyx_t_26 * __pyx_v_coords.strides[0]) ))));
if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 740, __pyx_L1_error)
13730 __Pyx_GOTREF(__pyx_t_8);
13739 __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_nearestN);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 741, __pyx_L1_error)
13740 __Pyx_GOTREF(__pyx_t_4);
13749 __pyx_t_45 = __Pyx_PyInt_From_int(__pyx_v_typeN);
if (unlikely(!__pyx_t_45)) __PYX_ERR(0, 742, __pyx_L1_error)
13750 __Pyx_GOTREF(__pyx_t_45);
13760 if (__pyx_t_26 < 0) __pyx_t_26 += __pyx_v_v_grad.shape[0];
13761 __pyx_t_44 = PyFloat_FromDouble((*((
double *) ( (__pyx_v_v_grad.data + __pyx_t_26 * __pyx_v_v_grad.strides[0]) ))));
if (unlikely(!__pyx_t_44)) __PYX_ERR(0, 743, __pyx_L1_error)
13762 __Pyx_GOTREF(__pyx_t_44);
13772 if (__pyx_t_26 < 0) __pyx_t_26 += __pyx_v_v_grad.shape[0];
13773 __pyx_t_42 = PyFloat_FromDouble((*((
double *) ( (__pyx_v_v_grad.data + __pyx_t_26 * __pyx_v_v_grad.strides[0]) ))));
if (unlikely(!__pyx_t_42)) __PYX_ERR(0, 744, __pyx_L1_error)
13774 __Pyx_GOTREF(__pyx_t_42);
13784 if (__pyx_t_26 < 0) __pyx_t_26 += __pyx_v_v_grad.shape[0];
13785 __pyx_t_5 = PyFloat_FromDouble((*((
double *) ( (__pyx_v_v_grad.data + __pyx_t_26 * __pyx_v_v_grad.strides[0]) ))));
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 745, __pyx_L1_error)
13786 __Pyx_GOTREF(__pyx_t_5);
13795 __pyx_t_6 = PyFloat_FromDouble(__pyx_v_area);
if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 746, __pyx_L1_error)
13796 __Pyx_GOTREF(__pyx_t_6);
13805 __pyx_t_1 = PyFloat_FromDouble(__pyx_v_ls_phi);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 747, __pyx_L1_error)
13806 __Pyx_GOTREF(__pyx_t_1);
13815 __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_node0);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 748, __pyx_L1_error)
13816 __Pyx_GOTREF(__pyx_t_3);
13826 if (__pyx_t_26 < 0) __pyx_t_26 += __pyx_v_fixed_dir.shape[0];
13827 __pyx_t_50 = PyFloat_FromDouble((*((
double *) ( (__pyx_v_fixed_dir.data + __pyx_t_26 * __pyx_v_fixed_dir.strides[0]) ))));
if (unlikely(!__pyx_t_50)) __PYX_ERR(0, 750, __pyx_L1_error)
13828 __Pyx_GOTREF(__pyx_t_50);
13838 if (__pyx_t_26 < 0) __pyx_t_26 += __pyx_v_fixed_dir.shape[0];
13839 __pyx_t_51 = PyFloat_FromDouble((*((
double *) ( (__pyx_v_fixed_dir.data + __pyx_t_26 * __pyx_v_fixed_dir.strides[0]) ))));
if (unlikely(!__pyx_t_51)) __PYX_ERR(0, 751, __pyx_L1_error)
13840 __Pyx_GOTREF(__pyx_t_51);
13850 if (__pyx_t_26 < 0) __pyx_t_26 += __pyx_v_fixed_dir.shape[0];
13851 __pyx_t_52 = PyFloat_FromDouble((*((
double *) ( (__pyx_v_fixed_dir.data + __pyx_t_26 * __pyx_v_fixed_dir.strides[0]) ))));
if (unlikely(!__pyx_t_52)) __PYX_ERR(0, 752, __pyx_L1_error)
13852 __Pyx_GOTREF(__pyx_t_52);
13861 __pyx_t_53 = PyList_New(15);
if (unlikely(!__pyx_t_53)) __PYX_ERR(0, 738, __pyx_L1_error)
13862 __Pyx_GOTREF(__pyx_t_53);
13863 __Pyx_GIVEREF(__pyx_t_43);
13864 PyList_SET_ITEM(__pyx_t_53, 0, __pyx_t_43);
13865 __Pyx_GIVEREF(__pyx_t_47);
13866 PyList_SET_ITEM(__pyx_t_53, 1, __pyx_t_47);
13867 __Pyx_GIVEREF(__pyx_t_8);
13868 PyList_SET_ITEM(__pyx_t_53, 2, __pyx_t_8);
13869 __Pyx_GIVEREF(__pyx_t_4);
13870 PyList_SET_ITEM(__pyx_t_53, 3, __pyx_t_4);
13871 __Pyx_GIVEREF(__pyx_t_45);
13872 PyList_SET_ITEM(__pyx_t_53, 4, __pyx_t_45);
13873 __Pyx_GIVEREF(__pyx_t_44);
13874 PyList_SET_ITEM(__pyx_t_53, 5, __pyx_t_44);
13875 __Pyx_GIVEREF(__pyx_t_42);
13876 PyList_SET_ITEM(__pyx_t_53, 6, __pyx_t_42);
13877 __Pyx_GIVEREF(__pyx_t_5);
13878 PyList_SET_ITEM(__pyx_t_53, 7, __pyx_t_5);
13879 __Pyx_GIVEREF(__pyx_t_6);
13880 PyList_SET_ITEM(__pyx_t_53, 8, __pyx_t_6);
13881 __Pyx_GIVEREF(__pyx_t_1);
13882 PyList_SET_ITEM(__pyx_t_53, 9, __pyx_t_1);
13883 __Pyx_GIVEREF(__pyx_t_3);
13884 PyList_SET_ITEM(__pyx_t_53, 10, __pyx_t_3);
13885 __Pyx_INCREF(__pyx_v_rank0);
13886 __Pyx_GIVEREF(__pyx_v_rank0);
13887 PyList_SET_ITEM(__pyx_t_53, 11, __pyx_v_rank0);
13888 __Pyx_GIVEREF(__pyx_t_50);
13889 PyList_SET_ITEM(__pyx_t_53, 12, __pyx_t_50);
13890 __Pyx_GIVEREF(__pyx_t_51);
13891 PyList_SET_ITEM(__pyx_t_53, 13, __pyx_t_51);
13892 __Pyx_GIVEREF(__pyx_t_52);
13893 PyList_SET_ITEM(__pyx_t_53, 14, __pyx_t_52);
13908 __pyx_t_52 = PyList_New(1);
if (unlikely(!__pyx_t_52)) __PYX_ERR(0, 738, __pyx_L1_error)
13909 __Pyx_GOTREF(__pyx_t_52);
13910 __Pyx_GIVEREF(__pyx_t_53);
13911 PyList_SET_ITEM(__pyx_t_52, 0, __pyx_t_53);
13921 __pyx_t_53 = PyTuple_New(2);
if (unlikely(!__pyx_t_53)) __PYX_ERR(0, 737, __pyx_L1_error)
13922 __Pyx_GOTREF(__pyx_t_53);
13923 __Pyx_GIVEREF(__pyx_t_46);
13924 PyTuple_SET_ITEM(__pyx_t_53, 0, __pyx_t_46);
13925 __Pyx_GIVEREF(__pyx_t_52);
13926 PyTuple_SET_ITEM(__pyx_t_53, 1, __pyx_t_52);
13937 __pyx_t_52 = __Pyx_PyDict_NewPresized(1);
if (unlikely(!__pyx_t_52)) __PYX_ERR(0, 753, __pyx_L1_error)
13938 __Pyx_GOTREF(__pyx_t_52);
13939 if (PyDict_SetItem(__pyx_t_52, __pyx_n_s_axis, __pyx_int_0) < 0) __PYX_ERR(0, 753, __pyx_L1_error)
13948 __pyx_t_46 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_53, __pyx_t_52);
if (unlikely(!__pyx_t_46)) __PYX_ERR(0, 737, __pyx_L1_error)
13949 __Pyx_GOTREF(__pyx_t_46);
13950 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
13951 __Pyx_DECREF(__pyx_t_53); __pyx_t_53 = 0;
13952 __Pyx_DECREF(__pyx_t_52); __pyx_t_52 = 0;
13953 __pyx_t_52 = __Pyx_PyInt_From_int(__pyx_v_new_rank);
if (unlikely(!__pyx_t_52)) __PYX_ERR(0, 737, __pyx_L1_error)
13954 __Pyx_GOTREF(__pyx_t_52);
13955 if (unlikely(PyDict_SetItem(__pyx_v_coords_2rank, __pyx_t_52, __pyx_t_46) < 0)) __PYX_ERR(0, 737, __pyx_L1_error)
13956 __Pyx_DECREF(__pyx_t_52); __pyx_t_52 = 0;
13957 __Pyx_DECREF(__pyx_t_46); __pyx_t_46 = 0;
13967 __pyx_t_52 = __Pyx_PyObject_GetAttrStr(__pyx_v_comm, __pyx_n_s_allreduce);
if (unlikely(!__pyx_t_52)) __PYX_ERR(0, 754, __pyx_L1_error)
13968 __Pyx_GOTREF(__pyx_t_52);
13969 __pyx_t_53 = __Pyx_PyInt_From_int(__pyx_v_nPending_disp);
if (unlikely(!__pyx_t_53)) __PYX_ERR(0, 754, __pyx_L1_error)
13970 __Pyx_GOTREF(__pyx_t_53);
13972 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_52))) {
13973 __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_52);
13974 if (likely(__pyx_t_7)) {
13975 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_52);
13976 __Pyx_INCREF(__pyx_t_7);
13977 __Pyx_INCREF(
function);
13978 __Pyx_DECREF_SET(__pyx_t_52,
function);
13981 __pyx_t_46 = (__pyx_t_7) ? __Pyx_PyObject_Call2Args(__pyx_t_52, __pyx_t_7, __pyx_t_53) : __Pyx_PyObject_CallOneArg(__pyx_t_52, __pyx_t_53);
13982 __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
13983 __Pyx_DECREF(__pyx_t_53); __pyx_t_53 = 0;
13984 if (unlikely(!__pyx_t_46)) __PYX_ERR(0, 754, __pyx_L1_error)
13985 __Pyx_GOTREF(__pyx_t_46);
13986 __Pyx_DECREF(__pyx_t_52); __pyx_t_52 = 0;
13987 __pyx_t_22 = __Pyx_PyInt_As_int(__pyx_t_46);
if (unlikely((__pyx_t_22 == (
int)-1) && PyErr_Occurred())) __PYX_ERR(0, 754, __pyx_L1_error)
13988 __Pyx_DECREF(__pyx_t_46); __pyx_t_46 = 0;
13989 __pyx_v_nPending_disp_total = __pyx_t_22;
14009 __pyx_t_52 = __Pyx_PyObject_GetAttrStr(__pyx_v_comm, __pyx_n_s_barrier);
if (unlikely(!__pyx_t_52)) __PYX_ERR(0, 756, __pyx_L1_error)
14010 __Pyx_GOTREF(__pyx_t_52);
14012 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_52))) {
14013 __pyx_t_53 = PyMethod_GET_SELF(__pyx_t_52);
14014 if (likely(__pyx_t_53)) {
14015 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_52);
14016 __Pyx_INCREF(__pyx_t_53);
14017 __Pyx_INCREF(
function);
14018 __Pyx_DECREF_SET(__pyx_t_52,
function);
14021 __pyx_t_46 = (__pyx_t_53) ? __Pyx_PyObject_CallOneArg(__pyx_t_52, __pyx_t_53) : __Pyx_PyObject_CallNoArg(__pyx_t_52);
14022 __Pyx_XDECREF(__pyx_t_53); __pyx_t_53 = 0;
14023 if (unlikely(!__pyx_t_46)) __PYX_ERR(0, 756, __pyx_L1_error)
14024 __Pyx_GOTREF(__pyx_t_46);
14025 __Pyx_DECREF(__pyx_t_52); __pyx_t_52 = 0;
14026 __Pyx_DECREF(__pyx_t_46); __pyx_t_46 = 0;
14035 __pyx_t_19 = ((__pyx_v_sendBack == 1) != 0);
14045 __pyx_t_46 = __Pyx_PyInt_From_int(__pyx_v_my_rank);
if (unlikely(!__pyx_t_46)) __PYX_ERR(0, 759, __pyx_L1_error)
14046 __Pyx_GOTREF(__pyx_t_46);
14047 __pyx_t_52 = __Pyx_PyDict_GetItem(__pyx_v_coords_2rank, __pyx_t_46);
if (unlikely(!__pyx_t_52)) __PYX_ERR(0, 759, __pyx_L1_error)
14048 __Pyx_GOTREF(__pyx_t_52);
14049 __Pyx_DECREF(__pyx_t_46); __pyx_t_46 = 0;
14050 __pyx_t_13 = __Pyx_PyObject_to_MemoryviewSlice_dsds_double(__pyx_t_52, PyBUF_WRITABLE);
if (unlikely(!__pyx_t_13.memview)) __PYX_ERR(0, 759, __pyx_L1_error)
14051 __Pyx_DECREF(__pyx_t_52); __pyx_t_52 = 0;
14052 __PYX_XDEC_MEMVIEW(&__pyx_cur_scope->__pyx_v_coords_2doArray, 1);
14053 __pyx_cur_scope->__pyx_v_coords_2doArray = __pyx_t_13;
14054 __pyx_t_13.memview = NULL;
14055 __pyx_t_13.data = NULL;
14064 __pyx_t_52 = __Pyx_PyObject_GetAttrStr(__pyx_v_comm, __pyx_n_s_size);
if (unlikely(!__pyx_t_52)) __PYX_ERR(0, 760, __pyx_L1_error)
14065 __Pyx_GOTREF(__pyx_t_52);
14066 __pyx_t_46 = __Pyx_PyObject_CallOneArg(__pyx_builtin_range, __pyx_t_52);
if (unlikely(!__pyx_t_46)) __PYX_ERR(0, 760, __pyx_L1_error)
14067 __Pyx_GOTREF(__pyx_t_46);
14068 __Pyx_DECREF(__pyx_t_52); __pyx_t_52 = 0;
14069 if (likely(PyList_CheckExact(__pyx_t_46)) || PyTuple_CheckExact(__pyx_t_46)) {
14070 __pyx_t_52 = __pyx_t_46; __Pyx_INCREF(__pyx_t_52); __pyx_t_15 = 0;
14073 __pyx_t_15 = -1; __pyx_t_52 = PyObject_GetIter(__pyx_t_46);
if (unlikely(!__pyx_t_52)) __PYX_ERR(0, 760, __pyx_L1_error)
14074 __Pyx_GOTREF(__pyx_t_52);
14075 __pyx_t_16 = Py_TYPE(__pyx_t_52)->tp_iternext;
if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 760, __pyx_L1_error)
14077 __Pyx_DECREF(__pyx_t_46); __pyx_t_46 = 0;
14079 if (likely(!__pyx_t_16)) {
14080 if (likely(PyList_CheckExact(__pyx_t_52))) {
14081 if (__pyx_t_15 >= PyList_GET_SIZE(__pyx_t_52))
break;
14082 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
14083 __pyx_t_46 = PyList_GET_ITEM(__pyx_t_52, __pyx_t_15); __Pyx_INCREF(__pyx_t_46); __pyx_t_15++;
if (unlikely(0 < 0)) __PYX_ERR(0, 760, __pyx_L1_error)
14085 __pyx_t_46 = PySequence_ITEM(__pyx_t_52, __pyx_t_15); __pyx_t_15++;
if (unlikely(!__pyx_t_46)) __PYX_ERR(0, 760, __pyx_L1_error)
14086 __Pyx_GOTREF(__pyx_t_46);
14089 if (__pyx_t_15 >= PyTuple_GET_SIZE(__pyx_t_52))
break;
14090 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
14091 __pyx_t_46 = PyTuple_GET_ITEM(__pyx_t_52, __pyx_t_15); __Pyx_INCREF(__pyx_t_46); __pyx_t_15++;
if (unlikely(0 < 0)) __PYX_ERR(0, 760, __pyx_L1_error)
14093 __pyx_t_46 = PySequence_ITEM(__pyx_t_52, __pyx_t_15); __pyx_t_15++;
if (unlikely(!__pyx_t_46)) __PYX_ERR(0, 760, __pyx_L1_error)
14094 __Pyx_GOTREF(__pyx_t_46);
14098 __pyx_t_46 = __pyx_t_16(__pyx_t_52);
14099 if (unlikely(!__pyx_t_46)) {
14100 PyObject* exc_type = PyErr_Occurred();
14102 if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
14103 else __PYX_ERR(0, 760, __pyx_L1_error)
14107 __Pyx_GOTREF(__pyx_t_46);
14109 __Pyx_XDECREF_SET(__pyx_v_rank, __pyx_t_46);
14119 __Pyx_GetModuleGlobalName(__pyx_t_53, __pyx_n_s_np);
if (unlikely(!__pyx_t_53)) __PYX_ERR(0, 762, __pyx_L1_error)
14120 __Pyx_GOTREF(__pyx_t_53);
14121 __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_53, __pyx_n_s_zeros);
if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 762, __pyx_L1_error)
14122 __Pyx_GOTREF(__pyx_t_7);
14123 __Pyx_DECREF(__pyx_t_53); __pyx_t_53 = 0;
14125 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_7))) {
14126 __pyx_t_53 = PyMethod_GET_SELF(__pyx_t_7);
14127 if (likely(__pyx_t_53)) {
14128 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_7);
14129 __Pyx_INCREF(__pyx_t_53);
14130 __Pyx_INCREF(
function);
14131 __Pyx_DECREF_SET(__pyx_t_7,
function);
14134 __pyx_t_46 = (__pyx_t_53) ? __Pyx_PyObject_Call2Args(__pyx_t_7, __pyx_t_53, __pyx_tuple__5) : __Pyx_PyObject_CallOneArg(__pyx_t_7, __pyx_tuple__5);
14135 __Pyx_XDECREF(__pyx_t_53); __pyx_t_53 = 0;
14136 if (unlikely(!__pyx_t_46)) __PYX_ERR(0, 762, __pyx_L1_error)
14137 __Pyx_GOTREF(__pyx_t_46);
14138 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
14139 if (unlikely(PyDict_SetItem(__pyx_v_coords_2rank, __pyx_v_rank, __pyx_t_46) < 0)) __PYX_ERR(0, 762, __pyx_L1_error)
14140 __Pyx_DECREF(__pyx_t_46); __pyx_t_46 = 0;
14150 __Pyx_DECREF(__pyx_t_52); __pyx_t_52 = 0;
14159 __pyx_t_10 = __Pyx_MemoryView_Len(__pyx_cur_scope->__pyx_v_coords_2doArray);
14160 __pyx_v_nNodes = __pyx_t_10;
14169 __pyx_t_2 = __pyx_v_nNodes;
14170 __pyx_t_20 = __pyx_t_2;
14171 for (__pyx_t_21 = 0; __pyx_t_21 < __pyx_t_20; __pyx_t_21+=1) {
14172 __pyx_v_iN = __pyx_t_21;
14181 __pyx_t_26 = __pyx_v_iN;
14183 if (__pyx_t_26 < 0) __pyx_t_26 += __pyx_cur_scope->__pyx_v_coords_2doArray.shape[0];
14184 if (__pyx_t_17 < 0) __pyx_t_17 += __pyx_cur_scope->__pyx_v_coords_2doArray.shape[1];
14185 __pyx_t_52 = PyFloat_FromDouble((*((
double *) ( (( (__pyx_cur_scope->__pyx_v_coords_2doArray.data + __pyx_t_26 * __pyx_cur_scope->__pyx_v_coords_2doArray.strides[0]) ) + __pyx_t_17 * __pyx_cur_scope->__pyx_v_coords_2doArray.strides[1]) ))));
if (unlikely(!__pyx_t_52)) __PYX_ERR(0, 765, __pyx_L1_error)
14186 __Pyx_GOTREF(__pyx_t_52);
14187 __Pyx_XDECREF_SET(__pyx_v_rank0, __pyx_t_52);
14197 __Pyx_GetModuleGlobalName(__pyx_t_52, __pyx_n_s_np);
if (unlikely(!__pyx_t_52)) __PYX_ERR(0, 766, __pyx_L1_error)
14198 __Pyx_GOTREF(__pyx_t_52);
14199 __pyx_t_46 = __Pyx_PyObject_GetAttrStr(__pyx_t_52, __pyx_n_s_append);
if (unlikely(!__pyx_t_46)) __PYX_ERR(0, 766, __pyx_L1_error)
14200 __Pyx_GOTREF(__pyx_t_46);
14201 __Pyx_DECREF(__pyx_t_52); __pyx_t_52 = 0;
14202 __pyx_t_52 = __Pyx_PyDict_GetItem(__pyx_v_coords_2rank, __pyx_v_rank0);
if (unlikely(!__pyx_t_52)) __PYX_ERR(0, 766, __pyx_L1_error)
14203 __Pyx_GOTREF(__pyx_t_52);
14204 __pyx_t_9.data = __pyx_cur_scope->__pyx_v_coords_2doArray.data;
14205 __pyx_t_9.memview = __pyx_cur_scope->__pyx_v_coords_2doArray.memview;
14206 __PYX_INC_MEMVIEW(&__pyx_t_9, 0);
14208 Py_ssize_t __pyx_tmp_idx = __pyx_v_iN;
14209 Py_ssize_t __pyx_tmp_shape = __pyx_cur_scope->__pyx_v_coords_2doArray.shape[0];
14210 Py_ssize_t __pyx_tmp_stride = __pyx_cur_scope->__pyx_v_coords_2doArray.strides[0];
14211 if (__pyx_tmp_idx < 0)
14212 __pyx_tmp_idx += __pyx_tmp_shape;
14213 __pyx_t_9.data += __pyx_tmp_idx * __pyx_tmp_stride;
14216 __pyx_t_9.shape[0] = __pyx_cur_scope->__pyx_v_coords_2doArray.shape[1];
14217 __pyx_t_9.strides[0] = __pyx_cur_scope->__pyx_v_coords_2doArray.strides[1];
14218 __pyx_t_9.suboffsets[0] = -1;
14220 __pyx_t_7 = __pyx_memoryview_fromslice(__pyx_t_9, 1, (PyObject *(*)(
char *)) __pyx_memview_get_double, (
int (*)(
char *, PyObject *)) __pyx_memview_set_double, 0);;
if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 766, __pyx_L1_error)
14221 __Pyx_GOTREF(__pyx_t_7);
14222 __PYX_XDEC_MEMVIEW(&__pyx_t_9, 1);
14223 __pyx_t_9.memview = NULL;
14224 __pyx_t_9.data = NULL;
14225 __pyx_t_53 = PyList_New(1);
if (unlikely(!__pyx_t_53)) __PYX_ERR(0, 766, __pyx_L1_error)
14226 __Pyx_GOTREF(__pyx_t_53);
14227 __Pyx_GIVEREF(__pyx_t_7);
14228 PyList_SET_ITEM(__pyx_t_53, 0, __pyx_t_7);
14230 __pyx_t_7 = PyTuple_New(2);
if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 766, __pyx_L1_error)
14231 __Pyx_GOTREF(__pyx_t_7);
14232 __Pyx_GIVEREF(__pyx_t_52);
14233 PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_52);
14234 __Pyx_GIVEREF(__pyx_t_53);
14235 PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_t_53);
14238 __pyx_t_53 = __Pyx_PyDict_NewPresized(1);
if (unlikely(!__pyx_t_53)) __PYX_ERR(0, 766, __pyx_L1_error)
14239 __Pyx_GOTREF(__pyx_t_53);
14240 if (PyDict_SetItem(__pyx_t_53, __pyx_n_s_axis, __pyx_int_0) < 0) __PYX_ERR(0, 766, __pyx_L1_error)
14241 __pyx_t_52 = __Pyx_PyObject_Call(__pyx_t_46, __pyx_t_7, __pyx_t_53);
if (unlikely(!__pyx_t_52)) __PYX_ERR(0, 766, __pyx_L1_error)
14242 __Pyx_GOTREF(__pyx_t_52);
14243 __Pyx_DECREF(__pyx_t_46); __pyx_t_46 = 0;
14244 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
14245 __Pyx_DECREF(__pyx_t_53); __pyx_t_53 = 0;
14246 if (unlikely(PyDict_SetItem(__pyx_v_coords_2rank, __pyx_v_rank0, __pyx_t_52) < 0)) __PYX_ERR(0, 766, __pyx_L1_error)
14247 __Pyx_DECREF(__pyx_t_52); __pyx_t_52 = 0;
14257 __pyx_t_52 = __Pyx_PyInt_From_int(__pyx_cur_scope->__pyx_v_comm_size);
if (unlikely(!__pyx_t_52)) __PYX_ERR(0, 768, __pyx_L1_error)
14258 __Pyx_GOTREF(__pyx_t_52);
14259 __pyx_t_53 = __Pyx_PyObject_CallOneArg(__pyx_builtin_range, __pyx_t_52);
if (unlikely(!__pyx_t_53)) __PYX_ERR(0, 768, __pyx_L1_error)
14260 __Pyx_GOTREF(__pyx_t_53);
14261 __Pyx_DECREF(__pyx_t_52); __pyx_t_52 = 0;
14262 if (likely(PyList_CheckExact(__pyx_t_53)) || PyTuple_CheckExact(__pyx_t_53)) {
14263 __pyx_t_52 = __pyx_t_53; __Pyx_INCREF(__pyx_t_52); __pyx_t_15 = 0;
14266 __pyx_t_15 = -1; __pyx_t_52 = PyObject_GetIter(__pyx_t_53);
if (unlikely(!__pyx_t_52)) __PYX_ERR(0, 768, __pyx_L1_error)
14267 __Pyx_GOTREF(__pyx_t_52);
14268 __pyx_t_16 = Py_TYPE(__pyx_t_52)->tp_iternext;
if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 768, __pyx_L1_error)
14270 __Pyx_DECREF(__pyx_t_53); __pyx_t_53 = 0;
14272 if (likely(!__pyx_t_16)) {
14273 if (likely(PyList_CheckExact(__pyx_t_52))) {
14274 if (__pyx_t_15 >= PyList_GET_SIZE(__pyx_t_52))
break;
14275 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
14276 __pyx_t_53 = PyList_GET_ITEM(__pyx_t_52, __pyx_t_15); __Pyx_INCREF(__pyx_t_53); __pyx_t_15++;
if (unlikely(0 < 0)) __PYX_ERR(0, 768, __pyx_L1_error)
14278 __pyx_t_53 = PySequence_ITEM(__pyx_t_52, __pyx_t_15); __pyx_t_15++;
if (unlikely(!__pyx_t_53)) __PYX_ERR(0, 768, __pyx_L1_error)
14279 __Pyx_GOTREF(__pyx_t_53);
14282 if (__pyx_t_15 >= PyTuple_GET_SIZE(__pyx_t_52))
break;
14283 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
14284 __pyx_t_53 = PyTuple_GET_ITEM(__pyx_t_52, __pyx_t_15); __Pyx_INCREF(__pyx_t_53); __pyx_t_15++;
if (unlikely(0 < 0)) __PYX_ERR(0, 768, __pyx_L1_error)
14286 __pyx_t_53 = PySequence_ITEM(__pyx_t_52, __pyx_t_15); __pyx_t_15++;
if (unlikely(!__pyx_t_53)) __PYX_ERR(0, 768, __pyx_L1_error)
14287 __Pyx_GOTREF(__pyx_t_53);
14291 __pyx_t_53 = __pyx_t_16(__pyx_t_52);
14292 if (unlikely(!__pyx_t_53)) {
14293 PyObject* exc_type = PyErr_Occurred();
14295 if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
14296 else __PYX_ERR(0, 768, __pyx_L1_error)
14300 __Pyx_GOTREF(__pyx_t_53);
14302 __Pyx_XDECREF_SET(__pyx_v_rank, __pyx_t_53);
14312 __pyx_t_53 = __Pyx_PyDict_GetItem(__pyx_v_coords_2rank, __pyx_v_rank);
if (unlikely(!__pyx_t_53)) __PYX_ERR(0, 769, __pyx_L1_error)
14313 __Pyx_GOTREF(__pyx_t_53);
14314 __pyx_t_48 = PyObject_Length(__pyx_t_53);
if (unlikely(__pyx_t_48 == ((Py_ssize_t)-1))) __PYX_ERR(0, 769, __pyx_L1_error)
14315 __Pyx_DECREF(__pyx_t_53); __pyx_t_53 = 0;
14316 __pyx_t_41 = __Pyx_PyIndex_AsSsize_t(__pyx_v_rank);
if (unlikely((__pyx_t_41 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 769, __pyx_L1_error)
14317 __pyx_t_17 = __pyx_t_41;
14318 if (__pyx_t_17 < 0) __pyx_t_17 += __pyx_v_counts_local.shape[0];
14319 *((
int *) ( (__pyx_v_counts_local.data + __pyx_t_17 * __pyx_v_counts_local.strides[0]) )) = __pyx_t_48;
14329 __Pyx_DECREF(__pyx_t_52); __pyx_t_52 = 0;
14338 __pyx_t_53 = __Pyx_PyObject_GetAttrStr(__pyx_v_comm, __pyx_n_s_Allgatherv);
if (unlikely(!__pyx_t_53)) __PYX_ERR(0, 770, __pyx_L1_error)
14339 __Pyx_GOTREF(__pyx_t_53);
14340 __pyx_t_7 = __pyx_memoryview_fromslice(__pyx_v_counts_local, 1, (PyObject *(*)(
char *)) __pyx_memview_get_int, (
int (*)(
char *, PyObject *)) __pyx_memview_set_int, 0);;
if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 770, __pyx_L1_error)
14341 __Pyx_GOTREF(__pyx_t_7);
14342 __Pyx_GetModuleGlobalName(__pyx_t_46, __pyx_n_s_MPI);
if (unlikely(!__pyx_t_46)) __PYX_ERR(0, 770, __pyx_L1_error)
14343 __Pyx_GOTREF(__pyx_t_46);
14344 __pyx_t_51 = __Pyx_PyObject_GetAttrStr(__pyx_t_46, __pyx_n_s_INT);
if (unlikely(!__pyx_t_51)) __PYX_ERR(0, 770, __pyx_L1_error)
14345 __Pyx_GOTREF(__pyx_t_51);
14346 __Pyx_DECREF(__pyx_t_46); __pyx_t_46 = 0;
14347 __pyx_t_46 = PyList_New(2);
if (unlikely(!__pyx_t_46)) __PYX_ERR(0, 770, __pyx_L1_error)
14348 __Pyx_GOTREF(__pyx_t_46);
14349 __Pyx_GIVEREF(__pyx_t_7);
14350 PyList_SET_ITEM(__pyx_t_46, 0, __pyx_t_7);
14351 __Pyx_GIVEREF(__pyx_t_51);
14352 PyList_SET_ITEM(__pyx_t_46, 1, __pyx_t_51);
14363 __pyx_t_51 = __pyx_memoryview_fromslice(__pyx_v_counts_total, 2, (PyObject *(*)(
char *)) __pyx_memview_get_int, (
int (*)(
char *, PyObject *)) __pyx_memview_set_int, 0);;
if (unlikely(!__pyx_t_51)) __PYX_ERR(0, 771, __pyx_L1_error)
14364 __Pyx_GOTREF(__pyx_t_51);
14373 __pyx_t_7 = PyList_New(0);
if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 772, __pyx_L1_error)
14374 __Pyx_GOTREF(__pyx_t_7);
14375 __pyx_t_2 = __pyx_cur_scope->__pyx_v_comm_size;
14376 __pyx_t_20 = __pyx_t_2;
14377 for (__pyx_t_21 = 0; __pyx_t_21 < __pyx_t_20; __pyx_t_21+=1) {
14378 __pyx_v_i = __pyx_t_21;
14379 __pyx_t_50 = __Pyx_PyInt_From_int(__pyx_cur_scope->__pyx_v_comm_size);
if (unlikely(!__pyx_t_50)) __PYX_ERR(0, 772, __pyx_L1_error)
14380 __Pyx_GOTREF(__pyx_t_50);
14381 if (unlikely(__Pyx_ListComp_Append(__pyx_t_7, (PyObject*)__pyx_t_50))) __PYX_ERR(0, 772, __pyx_L1_error)
14382 __Pyx_DECREF(__pyx_t_50); __pyx_t_50 = 0;
14392 __pyx_t_50 = PyList_New(0);
if (unlikely(!__pyx_t_50)) __PYX_ERR(0, 773, __pyx_L1_error)
14393 __Pyx_GOTREF(__pyx_t_50);
14394 __pyx_t_2 = __pyx_cur_scope->__pyx_v_comm_size;
14395 __pyx_t_20 = __pyx_t_2;
14396 for (__pyx_t_21 = 0; __pyx_t_21 < __pyx_t_20; __pyx_t_21+=1) {
14397 __pyx_v_i = __pyx_t_21;
14398 __pyx_t_3 = __Pyx_PyInt_From_int((__pyx_cur_scope->__pyx_v_comm_size * __pyx_v_i));
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 773, __pyx_L1_error)
14399 __Pyx_GOTREF(__pyx_t_3);
14400 if (unlikely(__Pyx_ListComp_Append(__pyx_t_50, (PyObject*)__pyx_t_3))) __PYX_ERR(0, 773, __pyx_L1_error)
14401 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
14411 __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_MPI);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 774, __pyx_L1_error)
14412 __Pyx_GOTREF(__pyx_t_3);
14413 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_INT);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 774, __pyx_L1_error)
14414 __Pyx_GOTREF(__pyx_t_1);
14415 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
14424 __pyx_t_3 = PyList_New(4);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 771, __pyx_L1_error)
14425 __Pyx_GOTREF(__pyx_t_3);
14426 __Pyx_GIVEREF(__pyx_t_51);
14427 PyList_SET_ITEM(__pyx_t_3, 0, __pyx_t_51);
14428 __Pyx_GIVEREF(__pyx_t_7);
14429 PyList_SET_ITEM(__pyx_t_3, 1, __pyx_t_7);
14430 __Pyx_GIVEREF(__pyx_t_50);
14431 PyList_SET_ITEM(__pyx_t_3, 2, __pyx_t_50);
14432 __Pyx_GIVEREF(__pyx_t_1);
14433 PyList_SET_ITEM(__pyx_t_3, 3, __pyx_t_1);
14440 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_53))) {
14441 __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_53);
14442 if (likely(__pyx_t_1)) {
14443 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_53);
14444 __Pyx_INCREF(__pyx_t_1);
14445 __Pyx_INCREF(
function);
14446 __Pyx_DECREF_SET(__pyx_t_53,
function);
14450 #if CYTHON_FAST_PYCALL
14451 if (PyFunction_Check(__pyx_t_53)) {
14452 PyObject *__pyx_temp[3] = {__pyx_t_1, __pyx_t_46, __pyx_t_3};
14453 __pyx_t_52 = __Pyx_PyFunction_FastCall(__pyx_t_53, __pyx_temp+1-__pyx_t_2, 2+__pyx_t_2);
if (unlikely(!__pyx_t_52)) __PYX_ERR(0, 770, __pyx_L1_error)
14454 __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
14455 __Pyx_GOTREF(__pyx_t_52);
14456 __Pyx_DECREF(__pyx_t_46); __pyx_t_46 = 0;
14457 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
14460 #if CYTHON_FAST_PYCCALL
14461 if (__Pyx_PyFastCFunction_Check(__pyx_t_53)) {
14462 PyObject *__pyx_temp[3] = {__pyx_t_1, __pyx_t_46, __pyx_t_3};
14463 __pyx_t_52 = __Pyx_PyCFunction_FastCall(__pyx_t_53, __pyx_temp+1-__pyx_t_2, 2+__pyx_t_2);
if (unlikely(!__pyx_t_52)) __PYX_ERR(0, 770, __pyx_L1_error)
14464 __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
14465 __Pyx_GOTREF(__pyx_t_52);
14466 __Pyx_DECREF(__pyx_t_46); __pyx_t_46 = 0;
14467 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
14471 __pyx_t_50 = PyTuple_New(2+__pyx_t_2);
if (unlikely(!__pyx_t_50)) __PYX_ERR(0, 770, __pyx_L1_error)
14472 __Pyx_GOTREF(__pyx_t_50);
14474 __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_50, 0, __pyx_t_1); __pyx_t_1 = NULL;
14476 __Pyx_GIVEREF(__pyx_t_46);
14477 PyTuple_SET_ITEM(__pyx_t_50, 0+__pyx_t_2, __pyx_t_46);
14478 __Pyx_GIVEREF(__pyx_t_3);
14479 PyTuple_SET_ITEM(__pyx_t_50, 1+__pyx_t_2, __pyx_t_3);
14482 __pyx_t_52 = __Pyx_PyObject_Call(__pyx_t_53, __pyx_t_50, NULL);
if (unlikely(!__pyx_t_52)) __PYX_ERR(0, 770, __pyx_L1_error)
14483 __Pyx_GOTREF(__pyx_t_52);
14484 __Pyx_DECREF(__pyx_t_50); __pyx_t_50 = 0;
14486 __Pyx_DECREF(__pyx_t_53); __pyx_t_53 = 0;
14487 __Pyx_DECREF(__pyx_t_52); __pyx_t_52 = 0;
14496 __pyx_t_2 = __pyx_cur_scope->__pyx_v_comm_size;
14497 __pyx_t_20 = __pyx_t_2;
14498 for (__pyx_t_21 = 0; __pyx_t_21 < __pyx_t_20; __pyx_t_21+=1) {
14499 __pyx_v_rank_recv = __pyx_t_21;
14508 __Pyx_INCREF(__pyx_int_0);
14509 __Pyx_XDECREF_SET(__pyx_v_array_size, __pyx_int_0);
14518 __pyx_t_52 = __Pyx_PyInt_From_int(__pyx_cur_scope->__pyx_v_comm_size);
if (unlikely(!__pyx_t_52)) __PYX_ERR(0, 778, __pyx_L1_error)
14519 __Pyx_GOTREF(__pyx_t_52);
14520 __pyx_t_53 = __Pyx_PyObject_CallOneArg(__pyx_builtin_range, __pyx_t_52);
if (unlikely(!__pyx_t_53)) __PYX_ERR(0, 778, __pyx_L1_error)
14521 __Pyx_GOTREF(__pyx_t_53);
14522 __Pyx_DECREF(__pyx_t_52); __pyx_t_52 = 0;
14523 if (likely(PyList_CheckExact(__pyx_t_53)) || PyTuple_CheckExact(__pyx_t_53)) {
14524 __pyx_t_52 = __pyx_t_53; __Pyx_INCREF(__pyx_t_52); __pyx_t_15 = 0;
14527 __pyx_t_15 = -1; __pyx_t_52 = PyObject_GetIter(__pyx_t_53);
if (unlikely(!__pyx_t_52)) __PYX_ERR(0, 778, __pyx_L1_error)
14528 __Pyx_GOTREF(__pyx_t_52);
14529 __pyx_t_16 = Py_TYPE(__pyx_t_52)->tp_iternext;
if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 778, __pyx_L1_error)
14531 __Pyx_DECREF(__pyx_t_53); __pyx_t_53 = 0;
14533 if (likely(!__pyx_t_16)) {
14534 if (likely(PyList_CheckExact(__pyx_t_52))) {
14535 if (__pyx_t_15 >= PyList_GET_SIZE(__pyx_t_52))
break;
14536 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
14537 __pyx_t_53 = PyList_GET_ITEM(__pyx_t_52, __pyx_t_15); __Pyx_INCREF(__pyx_t_53); __pyx_t_15++;
if (unlikely(0 < 0)) __PYX_ERR(0, 778, __pyx_L1_error)
14539 __pyx_t_53 = PySequence_ITEM(__pyx_t_52, __pyx_t_15); __pyx_t_15++;
if (unlikely(!__pyx_t_53)) __PYX_ERR(0, 778, __pyx_L1_error)
14540 __Pyx_GOTREF(__pyx_t_53);
14543 if (__pyx_t_15 >= PyTuple_GET_SIZE(__pyx_t_52))
break;
14544 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
14545 __pyx_t_53 = PyTuple_GET_ITEM(__pyx_t_52, __pyx_t_15); __Pyx_INCREF(__pyx_t_53); __pyx_t_15++;
if (unlikely(0 < 0)) __PYX_ERR(0, 778, __pyx_L1_error)
14547 __pyx_t_53 = PySequence_ITEM(__pyx_t_52, __pyx_t_15); __pyx_t_15++;
if (unlikely(!__pyx_t_53)) __PYX_ERR(0, 778, __pyx_L1_error)
14548 __Pyx_GOTREF(__pyx_t_53);
14552 __pyx_t_53 = __pyx_t_16(__pyx_t_52);
14553 if (unlikely(!__pyx_t_53)) {
14554 PyObject* exc_type = PyErr_Occurred();
14556 if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
14557 else __PYX_ERR(0, 778, __pyx_L1_error)
14561 __Pyx_GOTREF(__pyx_t_53);
14563 __Pyx_XDECREF_SET(__pyx_v_rank, __pyx_t_53);
14573 __pyx_t_48 = __Pyx_PyIndex_AsSsize_t(__pyx_v_rank);
if (unlikely((__pyx_t_48 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 779, __pyx_L1_error)
14574 __pyx_t_17 = __pyx_t_48;
14575 __pyx_t_26 = __pyx_v_rank_recv;
14576 if (__pyx_t_17 < 0) __pyx_t_17 += __pyx_v_counts_total.shape[0];
14577 if (__pyx_t_26 < 0) __pyx_t_26 += __pyx_v_counts_total.shape[1];
14578 __pyx_t_53 = __Pyx_PyInt_From_int((*((
int *) ( (( (__pyx_v_counts_total.data + __pyx_t_17 * __pyx_v_counts_total.strides[0]) ) + __pyx_t_26 * __pyx_v_counts_total.strides[1]) ))));
if (unlikely(!__pyx_t_53)) __PYX_ERR(0, 779, __pyx_L1_error)
14579 __Pyx_GOTREF(__pyx_t_53);
14580 __pyx_t_50 = PyNumber_InPlaceAdd(__pyx_v_array_size, __pyx_t_53);
if (unlikely(!__pyx_t_50)) __PYX_ERR(0, 779, __pyx_L1_error)
14581 __Pyx_GOTREF(__pyx_t_50);
14582 __Pyx_DECREF(__pyx_t_53); __pyx_t_53 = 0;
14583 __Pyx_DECREF_SET(__pyx_v_array_size, __pyx_t_50);
14593 __pyx_t_48 = __Pyx_PyIndex_AsSsize_t(__pyx_v_rank);
if (unlikely((__pyx_t_48 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 780, __pyx_L1_error)
14594 __pyx_t_26 = __pyx_t_48;
14595 __pyx_t_17 = __pyx_v_rank_recv;
14596 if (__pyx_t_26 < 0) __pyx_t_26 += __pyx_v_counts_total.shape[0];
14597 if (__pyx_t_17 < 0) __pyx_t_17 += __pyx_v_counts_total.shape[1];
14598 __pyx_t_41 = __Pyx_PyIndex_AsSsize_t(__pyx_v_rank);
if (unlikely((__pyx_t_41 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 780, __pyx_L1_error)
14599 __pyx_t_31 = __pyx_t_41;
14600 if (__pyx_t_31 < 0) __pyx_t_31 += __pyx_cur_scope->__pyx_v_counts_in.shape[0];
14601 *((
int *) ( (__pyx_cur_scope->__pyx_v_counts_in.data + __pyx_t_31 * __pyx_cur_scope->__pyx_v_counts_in.strides[0]) )) = (*((
int *) ( (( (__pyx_v_counts_total.data + __pyx_t_26 * __pyx_v_counts_total.strides[0]) ) + __pyx_t_17 * __pyx_v_counts_total.strides[1]) )));
14610 __pyx_t_50 = PyObject_RichCompare(__pyx_v_rank, __pyx_int_0, Py_GT); __Pyx_XGOTREF(__pyx_t_50);
if (unlikely(!__pyx_t_50)) __PYX_ERR(0, 781, __pyx_L1_error)
14611 __pyx_t_19 = __Pyx_PyObject_IsTrue(__pyx_t_50);
if (unlikely(__pyx_t_19 < 0)) __PYX_ERR(0, 781, __pyx_L1_error)
14612 __Pyx_DECREF(__pyx_t_50); __pyx_t_50 = 0;
14622 __pyx_t_50 = __Pyx_PyInt_SubtractObjC(__pyx_v_rank, __pyx_int_1, 1, 0, 0);
if (unlikely(!__pyx_t_50)) __PYX_ERR(0, 782, __pyx_L1_error)
14623 __Pyx_GOTREF(__pyx_t_50);
14624 __pyx_t_48 = __Pyx_PyIndex_AsSsize_t(__pyx_t_50);
if (unlikely((__pyx_t_48 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 782, __pyx_L1_error)
14625 __Pyx_DECREF(__pyx_t_50); __pyx_t_50 = 0;
14626 __pyx_t_17 = __pyx_t_48;
14627 if (__pyx_t_17 < 0) __pyx_t_17 += __pyx_cur_scope->__pyx_v_displacements_in.shape[0];
14628 __pyx_t_50 = __Pyx_PyInt_SubtractObjC(__pyx_v_rank, __pyx_int_1, 1, 0, 0);
if (unlikely(!__pyx_t_50)) __PYX_ERR(0, 782, __pyx_L1_error)
14629 __Pyx_GOTREF(__pyx_t_50);
14630 __pyx_t_41 = __Pyx_PyIndex_AsSsize_t(__pyx_t_50);
if (unlikely((__pyx_t_41 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 782, __pyx_L1_error)
14631 __Pyx_DECREF(__pyx_t_50); __pyx_t_50 = 0;
14632 __pyx_t_26 = __pyx_t_41;
14633 if (__pyx_t_26 < 0) __pyx_t_26 += __pyx_cur_scope->__pyx_v_counts_in.shape[0];
14634 __pyx_t_49 = __Pyx_PyIndex_AsSsize_t(__pyx_v_rank);
if (unlikely((__pyx_t_49 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 782, __pyx_L1_error)
14635 __pyx_t_31 = __pyx_t_49;
14636 if (__pyx_t_31 < 0) __pyx_t_31 += __pyx_cur_scope->__pyx_v_displacements_in.shape[0];
14637 *((
int *) ( (__pyx_cur_scope->__pyx_v_displacements_in.data + __pyx_t_31 * __pyx_cur_scope->__pyx_v_displacements_in.strides[0]) )) = ((*((
int *) ( (__pyx_cur_scope->__pyx_v_displacements_in.data + __pyx_t_17 * __pyx_cur_scope->__pyx_v_displacements_in.strides[0]) ))) + (*((
int *) ( (__pyx_cur_scope->__pyx_v_counts_in.data + __pyx_t_26 * __pyx_cur_scope->__pyx_v_counts_in.strides[0]) ))));
14656 __Pyx_DECREF(__pyx_t_52); __pyx_t_52 = 0;
14665 __pyx_t_26 = __pyx_v_rank_recv;
14666 __pyx_t_17 = __pyx_v_rank_recv;
14667 if (__pyx_t_26 < 0) __pyx_t_26 += __pyx_v_counts_total.shape[0];
14668 if (__pyx_t_17 < 0) __pyx_t_17 += __pyx_v_counts_total.shape[1];
14669 __pyx_t_52 = __Pyx_PyInt_From_int((*((
int *) ( (( (__pyx_v_counts_total.data + __pyx_t_26 * __pyx_v_counts_total.strides[0]) ) + __pyx_t_17 * __pyx_v_counts_total.strides[1]) ))));
if (unlikely(!__pyx_t_52)) __PYX_ERR(0, 784, __pyx_L1_error)
14670 __Pyx_GOTREF(__pyx_t_52);
14671 __pyx_t_50 = PyNumber_Subtract(__pyx_v_array_size, __pyx_t_52);
if (unlikely(!__pyx_t_50)) __PYX_ERR(0, 784, __pyx_L1_error)
14672 __Pyx_GOTREF(__pyx_t_50);
14673 __Pyx_DECREF(__pyx_t_52); __pyx_t_52 = 0;
14674 __pyx_t_52 = PyObject_RichCompare(__pyx_t_50, __pyx_int_0, Py_GT); __Pyx_XGOTREF(__pyx_t_52);
if (unlikely(!__pyx_t_52)) __PYX_ERR(0, 784, __pyx_L1_error)
14675 __Pyx_DECREF(__pyx_t_50); __pyx_t_50 = 0;
14676 __pyx_t_19 = __Pyx_PyObject_IsTrue(__pyx_t_52);
if (unlikely(__pyx_t_19 < 0)) __PYX_ERR(0, 784, __pyx_L1_error)
14677 __Pyx_DECREF(__pyx_t_52); __pyx_t_52 = 0;
14687 __pyx_t_19 = ((__pyx_v_my_rank == __pyx_v_rank_recv) != 0);
14697 __Pyx_GetModuleGlobalName(__pyx_t_50, __pyx_n_s_np);
if (unlikely(!__pyx_t_50)) __PYX_ERR(0, 787, __pyx_L1_error)
14698 __Pyx_GOTREF(__pyx_t_50);
14699 __pyx_t_53 = __Pyx_PyObject_GetAttrStr(__pyx_t_50, __pyx_n_s_zeros);
if (unlikely(!__pyx_t_53)) __PYX_ERR(0, 787, __pyx_L1_error)
14700 __Pyx_GOTREF(__pyx_t_53);
14701 __Pyx_DECREF(__pyx_t_50); __pyx_t_50 = 0;
14702 __pyx_t_50 = PyTuple_New(2);
if (unlikely(!__pyx_t_50)) __PYX_ERR(0, 787, __pyx_L1_error)
14703 __Pyx_GOTREF(__pyx_t_50);
14704 __Pyx_INCREF(__pyx_v_array_size);
14705 __Pyx_GIVEREF(__pyx_v_array_size);
14706 PyTuple_SET_ITEM(__pyx_t_50, 0, __pyx_v_array_size);
14707 __Pyx_INCREF(__pyx_int_15);
14708 __Pyx_GIVEREF(__pyx_int_15);
14709 PyTuple_SET_ITEM(__pyx_t_50, 1, __pyx_int_15);
14711 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_53))) {
14712 __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_53);
14713 if (likely(__pyx_t_3)) {
14714 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_53);
14715 __Pyx_INCREF(__pyx_t_3);
14716 __Pyx_INCREF(
function);
14717 __Pyx_DECREF_SET(__pyx_t_53,
function);
14720 __pyx_t_52 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_53, __pyx_t_3, __pyx_t_50) : __Pyx_PyObject_CallOneArg(__pyx_t_53, __pyx_t_50);
14721 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
14722 __Pyx_DECREF(__pyx_t_50); __pyx_t_50 = 0;
14723 if (unlikely(!__pyx_t_52)) __PYX_ERR(0, 787, __pyx_L1_error)
14724 __Pyx_GOTREF(__pyx_t_52);
14725 __Pyx_DECREF(__pyx_t_53); __pyx_t_53 = 0;
14726 __pyx_t_13 = __Pyx_PyObject_to_MemoryviewSlice_dsds_double(__pyx_t_52, PyBUF_WRITABLE);
if (unlikely(!__pyx_t_13.memview)) __PYX_ERR(0, 787, __pyx_L1_error)
14727 __Pyx_DECREF(__pyx_t_52); __pyx_t_52 = 0;
14728 __PYX_XDEC_MEMVIEW(&__pyx_cur_scope->__pyx_v_coords_2doArray, 1);
14729 __pyx_cur_scope->__pyx_v_coords_2doArray = __pyx_t_13;
14730 __pyx_t_13.memview = NULL;
14731 __pyx_t_13.data = NULL;
14749 __Pyx_GetModuleGlobalName(__pyx_t_50, __pyx_n_s_MPI);
if (unlikely(!__pyx_t_50)) __PYX_ERR(0, 790, __pyx_L1_error)
14750 __Pyx_GOTREF(__pyx_t_50);
14751 __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_50, __pyx_n_s_DOUBLE);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 790, __pyx_L1_error)
14752 __Pyx_GOTREF(__pyx_t_3);
14753 __Pyx_DECREF(__pyx_t_50); __pyx_t_50 = 0;
14754 __pyx_t_50 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_Create_contiguous);
if (unlikely(!__pyx_t_50)) __PYX_ERR(0, 790, __pyx_L1_error)
14755 __Pyx_GOTREF(__pyx_t_50);
14756 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
14758 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_50))) {
14759 __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_50);
14760 if (likely(__pyx_t_3)) {
14761 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_50);
14762 __Pyx_INCREF(__pyx_t_3);
14763 __Pyx_INCREF(
function);
14764 __Pyx_DECREF_SET(__pyx_t_50,
function);
14767 __pyx_t_53 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_50, __pyx_t_3, __pyx_int_15) : __Pyx_PyObject_CallOneArg(__pyx_t_50, __pyx_int_15);
14768 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
14769 if (unlikely(!__pyx_t_53)) __PYX_ERR(0, 790, __pyx_L1_error)
14770 __Pyx_GOTREF(__pyx_t_53);
14771 __Pyx_DECREF(__pyx_t_50); __pyx_t_50 = 0;
14772 __pyx_t_50 = __Pyx_PyObject_GetAttrStr(__pyx_t_53, __pyx_n_s_Commit);
if (unlikely(!__pyx_t_50)) __PYX_ERR(0, 790, __pyx_L1_error)
14773 __Pyx_GOTREF(__pyx_t_50);
14774 __Pyx_DECREF(__pyx_t_53); __pyx_t_53 = 0;
14776 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_50))) {
14777 __pyx_t_53 = PyMethod_GET_SELF(__pyx_t_50);
14778 if (likely(__pyx_t_53)) {
14779 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_50);
14780 __Pyx_INCREF(__pyx_t_53);
14781 __Pyx_INCREF(
function);
14782 __Pyx_DECREF_SET(__pyx_t_50,
function);
14785 __pyx_t_52 = (__pyx_t_53) ? __Pyx_PyObject_CallOneArg(__pyx_t_50, __pyx_t_53) : __Pyx_PyObject_CallNoArg(__pyx_t_50);
14786 __Pyx_XDECREF(__pyx_t_53); __pyx_t_53 = 0;
14787 if (unlikely(!__pyx_t_52)) __PYX_ERR(0, 790, __pyx_L1_error)
14788 __Pyx_GOTREF(__pyx_t_52);
14789 __Pyx_DECREF(__pyx_t_50); __pyx_t_50 = 0;
14790 __Pyx_XDECREF_SET(__pyx_v_datatype, __pyx_t_52);
14800 __pyx_t_52 = __Pyx_PyObject_GetAttrStr(__pyx_v_comm, __pyx_n_s_Gatherv);
if (unlikely(!__pyx_t_52)) __PYX_ERR(0, 791, __pyx_L1_error)
14801 __Pyx_GOTREF(__pyx_t_52);
14802 __pyx_t_50 = __Pyx_PyInt_From_int(__pyx_v_rank_recv);
if (unlikely(!__pyx_t_50)) __PYX_ERR(0, 791, __pyx_L1_error)
14803 __Pyx_GOTREF(__pyx_t_50);
14804 __pyx_t_53 = __Pyx_PyDict_GetItem(__pyx_v_coords_2rank, __pyx_t_50);
if (unlikely(!__pyx_t_53)) __PYX_ERR(0, 791, __pyx_L1_error)
14805 __Pyx_GOTREF(__pyx_t_53);
14806 __Pyx_DECREF(__pyx_t_50); __pyx_t_50 = 0;
14815 __pyx_t_50 = __pyx_memoryview_fromslice(__pyx_cur_scope->__pyx_v_coords_2doArray, 2, (PyObject *(*)(
char *)) __pyx_memview_get_double, (int (*)(
char *, PyObject *)) __pyx_memview_set_double, 0);;
if (unlikely(!__pyx_t_50)) __PYX_ERR(0, 792, __pyx_L1_error)
14816 __Pyx_GOTREF(__pyx_t_50);
14825 __pyx_t_3 = __pyx_pf_6mprans_16cMoveMeshMonitor_13cCoefficients_29cppPseudoTimeSteppingParallel_6genexpr(((PyObject*)__pyx_cur_scope));
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 793, __pyx_L1_error)
14826 __Pyx_GOTREF(__pyx_t_3);
14827 __pyx_t_46 = __Pyx_PySequence_Tuple(__pyx_t_3);
if (unlikely(!__pyx_t_46)) __PYX_ERR(0, 793, __pyx_L1_error)
14828 __Pyx_GOTREF(__pyx_t_46);
14829 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
14838 __pyx_t_3 = __pyx_pf_6mprans_16cMoveMeshMonitor_13cCoefficients_29cppPseudoTimeSteppingParallel_9genexpr(((PyObject*)__pyx_cur_scope));
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 794, __pyx_L1_error)
14839 __Pyx_GOTREF(__pyx_t_3);
14840 __pyx_t_1 = __Pyx_PySequence_Tuple(__pyx_t_3);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 794, __pyx_L1_error)
14841 __Pyx_GOTREF(__pyx_t_1);
14842 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
14851 __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_MPI);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 795, __pyx_L1_error)
14852 __Pyx_GOTREF(__pyx_t_3);
14853 __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_DOUBLE);
if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 795, __pyx_L1_error)
14854 __Pyx_GOTREF(__pyx_t_7);
14855 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
14864 __pyx_t_3 = PyList_New(4);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 792, __pyx_L1_error)
14865 __Pyx_GOTREF(__pyx_t_3);
14866 __Pyx_GIVEREF(__pyx_t_50);
14867 PyList_SET_ITEM(__pyx_t_3, 0, __pyx_t_50);
14868 __Pyx_GIVEREF(__pyx_t_46);
14869 PyList_SET_ITEM(__pyx_t_3, 1, __pyx_t_46);
14870 __Pyx_GIVEREF(__pyx_t_1);
14871 PyList_SET_ITEM(__pyx_t_3, 2, __pyx_t_1);
14872 __Pyx_GIVEREF(__pyx_t_7);
14873 PyList_SET_ITEM(__pyx_t_3, 3, __pyx_t_7);
14886 __pyx_t_7 = PyTuple_New(2);
if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 791, __pyx_L1_error)
14887 __Pyx_GOTREF(__pyx_t_7);
14888 __Pyx_GIVEREF(__pyx_t_53);
14889 PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_53);
14890 __Pyx_GIVEREF(__pyx_t_3);
14891 PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_t_3);
14902 __pyx_t_3 = __Pyx_PyDict_NewPresized(1);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 796, __pyx_L1_error)
14903 __Pyx_GOTREF(__pyx_t_3);
14904 __pyx_t_53 = __Pyx_PyInt_From_int(__pyx_v_rank_recv);
if (unlikely(!__pyx_t_53)) __PYX_ERR(0, 796, __pyx_L1_error)
14905 __Pyx_GOTREF(__pyx_t_53);
14906 if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_root, __pyx_t_53) < 0) __PYX_ERR(0, 796, __pyx_L1_error)
14907 __Pyx_DECREF(__pyx_t_53); __pyx_t_53 = 0;
14916 __pyx_t_53 = __Pyx_PyObject_Call(__pyx_t_52, __pyx_t_7, __pyx_t_3);
if (unlikely(!__pyx_t_53)) __PYX_ERR(0, 791, __pyx_L1_error)
14917 __Pyx_GOTREF(__pyx_t_53);
14918 __Pyx_DECREF(__pyx_t_52); __pyx_t_52 = 0;
14919 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
14920 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
14921 __Pyx_DECREF(__pyx_t_53); __pyx_t_53 = 0;
14930 __pyx_v_ncomm = (__pyx_v_ncomm + 1);
14950 __pyx_t_19 = ((__pyx_v_rank_recv == __pyx_v_my_rank) != 0);
14960 __pyx_t_53 = __Pyx_PyInt_From_int(__pyx_v_my_rank);
if (unlikely(!__pyx_t_53)) __PYX_ERR(0, 800, __pyx_L1_error)
14961 __Pyx_GOTREF(__pyx_t_53);
14962 __pyx_t_3 = __Pyx_PyDict_GetItem(__pyx_v_coords_2rank, __pyx_t_53);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 800, __pyx_L1_error)
14963 __Pyx_GOTREF(__pyx_t_3);
14964 __Pyx_DECREF(__pyx_t_53); __pyx_t_53 = 0;
14965 __pyx_t_13 = __Pyx_PyObject_to_MemoryviewSlice_dsds_double(__pyx_t_3, PyBUF_WRITABLE);
if (unlikely(!__pyx_t_13.memview)) __PYX_ERR(0, 800, __pyx_L1_error)
14966 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
14967 __PYX_XDEC_MEMVIEW(&__pyx_cur_scope->__pyx_v_coords_2doArray, 1);
14968 __pyx_cur_scope->__pyx_v_coords_2doArray = __pyx_t_13;
14969 __pyx_t_13.memview = NULL;
14970 __pyx_t_13.data = NULL;
14991 __pyx_t_10 = __Pyx_MemoryView_Len(__pyx_cur_scope->__pyx_v_coords_2doArray);
14992 __pyx_v_nNodes = __pyx_t_10;
15001 __pyx_t_2 = __pyx_v_nNodes;
15002 __pyx_t_20 = __pyx_t_2;
15003 for (__pyx_t_21 = 0; __pyx_t_21 < __pyx_t_20; __pyx_t_21+=1) {
15004 __pyx_v_iN = __pyx_t_21;
15013 __pyx_t_17 = __pyx_v_iN;
15015 if (__pyx_t_17 < 0) __pyx_t_17 += __pyx_cur_scope->__pyx_v_coords_2doArray.shape[0];
15016 if (__pyx_t_26 < 0) __pyx_t_26 += __pyx_cur_scope->__pyx_v_coords_2doArray.shape[1];
15017 __pyx_v_node0 = ((int)(*((
double *) ( (( (__pyx_cur_scope->__pyx_v_coords_2doArray.data + __pyx_t_17 * __pyx_cur_scope->__pyx_v_coords_2doArray.strides[0]) ) + __pyx_t_26 * __pyx_cur_scope->__pyx_v_coords_2doArray.strides[1]) ))));
15026 __pyx_t_26 = __pyx_v_iN;
15028 if (__pyx_t_26 < 0) __pyx_t_26 += __pyx_cur_scope->__pyx_v_coords_2doArray.shape[0];
15029 if (__pyx_t_17 < 0) __pyx_t_17 += __pyx_cur_scope->__pyx_v_coords_2doArray.shape[1];
15031 if (__pyx_t_31 < 0) __pyx_t_31 += __pyx_v_coords.shape[0];
15032 *((
double *) ( (__pyx_v_coords.data + __pyx_t_31 * __pyx_v_coords.strides[0]) )) = (*((
double *) ( (( (__pyx_cur_scope->__pyx_v_coords_2doArray.data + __pyx_t_26 * __pyx_cur_scope->__pyx_v_coords_2doArray.strides[0]) ) + __pyx_t_17 * __pyx_cur_scope->__pyx_v_coords_2doArray.strides[1]) )));
15041 __pyx_t_17 = __pyx_v_iN;
15043 if (__pyx_t_17 < 0) __pyx_t_17 += __pyx_cur_scope->__pyx_v_coords_2doArray.shape[0];
15044 if (__pyx_t_26 < 0) __pyx_t_26 += __pyx_cur_scope->__pyx_v_coords_2doArray.shape[1];
15046 if (__pyx_t_31 < 0) __pyx_t_31 += __pyx_v_coords.shape[0];
15047 *((
double *) ( (__pyx_v_coords.data + __pyx_t_31 * __pyx_v_coords.strides[0]) )) = (*((
double *) ( (( (__pyx_cur_scope->__pyx_v_coords_2doArray.data + __pyx_t_17 * __pyx_cur_scope->__pyx_v_coords_2doArray.strides[0]) ) + __pyx_t_26 * __pyx_cur_scope->__pyx_v_coords_2doArray.strides[1]) )));
15056 __pyx_t_26 = __pyx_v_iN;
15058 if (__pyx_t_26 < 0) __pyx_t_26 += __pyx_cur_scope->__pyx_v_coords_2doArray.shape[0];
15059 if (__pyx_t_17 < 0) __pyx_t_17 += __pyx_cur_scope->__pyx_v_coords_2doArray.shape[1];
15061 if (__pyx_t_31 < 0) __pyx_t_31 += __pyx_v_coords.shape[0];
15062 *((
double *) ( (__pyx_v_coords.data + __pyx_t_31 * __pyx_v_coords.strides[0]) )) = (*((
double *) ( (( (__pyx_cur_scope->__pyx_v_coords_2doArray.data + __pyx_t_26 * __pyx_cur_scope->__pyx_v_coords_2doArray.strides[0]) ) + __pyx_t_17 * __pyx_cur_scope->__pyx_v_coords_2doArray.strides[1]) )));
15071 __pyx_t_22 = __pyx_v_nd;
15072 __pyx_t_23 = __pyx_t_22;
15073 for (__pyx_t_24 = 0; __pyx_t_24 < __pyx_t_23; __pyx_t_24+=1) {
15074 __pyx_v_ind = __pyx_t_24;
15083 __pyx_t_17 = __pyx_v_ind;
15084 if (__pyx_t_17 < 0) __pyx_t_17 += __pyx_v_coords.shape[0];
15085 __pyx_t_26 = __pyx_v_node0;
15086 __pyx_t_31 = __pyx_v_ind;
15087 if (__pyx_t_26 < 0) __pyx_t_26 += __pyx_v_xx.shape[0];
15088 if (__pyx_t_31 < 0) __pyx_t_31 += __pyx_v_xx.shape[1];
15089 *((
double *) ( (( (__pyx_v_xx.data + __pyx_t_26 * __pyx_v_xx.strides[0]) ) + __pyx_t_31 * __pyx_v_xx.strides[1]) )) = (*((
double *) ( (__pyx_v_coords.data + __pyx_t_17 * __pyx_v_coords.strides[0]) )));
15109 __pyx_t_53 = __Pyx_PyObject_GetAttrStr(__pyx_v_comm, __pyx_n_s_barrier);
if (unlikely(!__pyx_t_53)) __PYX_ERR(0, 810, __pyx_L1_error)
15110 __Pyx_GOTREF(__pyx_t_53);
15112 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_53))) {
15113 __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_53);
15114 if (likely(__pyx_t_7)) {
15115 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_53);
15116 __Pyx_INCREF(__pyx_t_7);
15117 __Pyx_INCREF(
function);
15118 __Pyx_DECREF_SET(__pyx_t_53,
function);
15121 __pyx_t_3 = (__pyx_t_7) ? __Pyx_PyObject_CallOneArg(__pyx_t_53, __pyx_t_7) : __Pyx_PyObject_CallNoArg(__pyx_t_53);
15122 __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
15123 if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 810, __pyx_L1_error)
15124 __Pyx_GOTREF(__pyx_t_3);
15125 __Pyx_DECREF(__pyx_t_53); __pyx_t_53 = 0;
15126 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
15135 __Pyx_GetModuleGlobalName(__pyx_t_53, __pyx_n_s_ms);
if (unlikely(!__pyx_t_53)) __PYX_ERR(0, 813, __pyx_L1_error)
15136 __Pyx_GOTREF(__pyx_t_53);
15137 __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_53, __pyx_n_s_getNonOwnedNodeValues);
if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 813, __pyx_L1_error)
15138 __Pyx_GOTREF(__pyx_t_7);
15139 __Pyx_DECREF(__pyx_t_53); __pyx_t_53 = 0;
15140 __pyx_t_53 = __pyx_memoryview_fromslice(__pyx_v_xx, 2, (PyObject *(*)(
char *)) __pyx_memview_get_double, (
int (*)(
char *, PyObject *)) __pyx_memview_set_double, 0);;
if (unlikely(!__pyx_t_53)) __PYX_ERR(0, 813, __pyx_L1_error)
15141 __Pyx_GOTREF(__pyx_t_53);
15150 __pyx_t_52 = __Pyx_PyInt_From_int(__pyx_v_nNodes_owned);
if (unlikely(!__pyx_t_52)) __PYX_ERR(0, 814, __pyx_L1_error)
15151 __Pyx_GOTREF(__pyx_t_52);
15160 __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_nNodes_global);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 815, __pyx_L1_error)
15161 __Pyx_GOTREF(__pyx_t_1);
15170 __pyx_t_46 = __pyx_memoryview_fromslice(__pyx_v_nodeNumbering_subdomain2global, 1, (PyObject *(*)(
char *)) __pyx_memview_get_int, (
int (*)(
char *, PyObject *)) __pyx_memview_set_int, 0);;
if (unlikely(!__pyx_t_46)) __PYX_ERR(0, 816, __pyx_L1_error)
15171 __Pyx_GOTREF(__pyx_t_46);
15180 __pyx_t_50 = __pyx_memoryview_fromslice(__pyx_v_nodeOffsets_subdomain_owned, 1, (PyObject *(*)(
char *)) __pyx_memview_get_int, (
int (*)(
char *, PyObject *)) __pyx_memview_set_int, 0);;
if (unlikely(!__pyx_t_50)) __PYX_ERR(0, 817, __pyx_L1_error)
15181 __Pyx_GOTREF(__pyx_t_50);
15184 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_7))) {
15185 __pyx_t_51 = PyMethod_GET_SELF(__pyx_t_7);
15186 if (likely(__pyx_t_51)) {
15187 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_7);
15188 __Pyx_INCREF(__pyx_t_51);
15189 __Pyx_INCREF(
function);
15190 __Pyx_DECREF_SET(__pyx_t_7,
function);
15194 #if CYTHON_FAST_PYCALL
15195 if (PyFunction_Check(__pyx_t_7)) {
15196 PyObject *__pyx_temp[6] = {__pyx_t_51, __pyx_t_53, __pyx_t_52, __pyx_t_1, __pyx_t_46, __pyx_t_50};
15197 __pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_7, __pyx_temp+1-__pyx_t_2, 5+__pyx_t_2);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 813, __pyx_L1_error)
15198 __Pyx_XDECREF(__pyx_t_51); __pyx_t_51 = 0;
15199 __Pyx_GOTREF(__pyx_t_3);
15200 __Pyx_DECREF(__pyx_t_53); __pyx_t_53 = 0;
15201 __Pyx_DECREF(__pyx_t_52); __pyx_t_52 = 0;
15202 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
15203 __Pyx_DECREF(__pyx_t_46); __pyx_t_46 = 0;
15204 __Pyx_DECREF(__pyx_t_50); __pyx_t_50 = 0;
15207 #if CYTHON_FAST_PYCCALL
15208 if (__Pyx_PyFastCFunction_Check(__pyx_t_7)) {
15209 PyObject *__pyx_temp[6] = {__pyx_t_51, __pyx_t_53, __pyx_t_52, __pyx_t_1, __pyx_t_46, __pyx_t_50};
15210 __pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_7, __pyx_temp+1-__pyx_t_2, 5+__pyx_t_2);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 813, __pyx_L1_error)
15211 __Pyx_XDECREF(__pyx_t_51); __pyx_t_51 = 0;
15212 __Pyx_GOTREF(__pyx_t_3);
15213 __Pyx_DECREF(__pyx_t_53); __pyx_t_53 = 0;
15214 __Pyx_DECREF(__pyx_t_52); __pyx_t_52 = 0;
15215 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
15216 __Pyx_DECREF(__pyx_t_46); __pyx_t_46 = 0;
15217 __Pyx_DECREF(__pyx_t_50); __pyx_t_50 = 0;
15221 __pyx_t_6 = PyTuple_New(5+__pyx_t_2);
if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 813, __pyx_L1_error)
15222 __Pyx_GOTREF(__pyx_t_6);
15224 __Pyx_GIVEREF(__pyx_t_51); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_51); __pyx_t_51 = NULL;
15226 __Pyx_GIVEREF(__pyx_t_53);
15227 PyTuple_SET_ITEM(__pyx_t_6, 0+__pyx_t_2, __pyx_t_53);
15228 __Pyx_GIVEREF(__pyx_t_52);
15229 PyTuple_SET_ITEM(__pyx_t_6, 1+__pyx_t_2, __pyx_t_52);
15230 __Pyx_GIVEREF(__pyx_t_1);
15231 PyTuple_SET_ITEM(__pyx_t_6, 2+__pyx_t_2, __pyx_t_1);
15232 __Pyx_GIVEREF(__pyx_t_46);
15233 PyTuple_SET_ITEM(__pyx_t_6, 3+__pyx_t_2, __pyx_t_46);
15234 __Pyx_GIVEREF(__pyx_t_50);
15235 PyTuple_SET_ITEM(__pyx_t_6, 4+__pyx_t_2, __pyx_t_50);
15241 __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_6, NULL);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 813, __pyx_L1_error)
15242 __Pyx_GOTREF(__pyx_t_3);
15243 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
15245 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
15246 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
15255 __pyx_t_19 = ((__pyx_v_nSmoothIn > 0) != 0);
15265 __pyx_v_nSmooth = __pyx_v_nSmoothIn;
15284 __pyx_t_30 = ((__pyx_v_nSmoothOut > 0) != 0);
15287 __pyx_t_19 = __pyx_t_30;
15288 goto __pyx_L127_bool_binop_done;
15290 __pyx_t_30 = ((__pyx_v_ntimes_i == (__pyx_v_ntimes_solved - 1)) != 0);
15291 __pyx_t_19 = __pyx_t_30;
15292 __pyx_L127_bool_binop_done:;
15302 __pyx_v_nSmooth = __pyx_v_nSmoothOut;
15321 __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_comm, __pyx_n_s_barrier);
if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 824, __pyx_L1_error)
15322 __Pyx_GOTREF(__pyx_t_7);
15324 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_7))) {
15325 __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_7);
15326 if (likely(__pyx_t_6)) {
15327 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_7);
15328 __Pyx_INCREF(__pyx_t_6);
15329 __Pyx_INCREF(
function);
15330 __Pyx_DECREF_SET(__pyx_t_7,
function);
15333 __pyx_t_3 = (__pyx_t_6) ? __Pyx_PyObject_CallOneArg(__pyx_t_7, __pyx_t_6) : __Pyx_PyObject_CallNoArg(__pyx_t_7);
15334 __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
15335 if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 824, __pyx_L1_error)
15336 __Pyx_GOTREF(__pyx_t_3);
15337 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
15338 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
15347 __pyx_t_19 = ((__pyx_v_nSmooth > 0) != 0);
15357 __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_logEvent);
if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 826, __pyx_L1_error)
15358 __Pyx_GOTREF(__pyx_t_7);
15359 __pyx_t_6 = __Pyx_PyInt_From_int(__pyx_v_nSmooth);
if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 826, __pyx_L1_error)
15360 __Pyx_GOTREF(__pyx_t_6);
15361 __pyx_t_50 = __Pyx_PyObject_CallOneArg(((PyObject *)(&PyString_Type)), __pyx_t_6);
if (unlikely(!__pyx_t_50)) __PYX_ERR(0, 826, __pyx_L1_error)
15362 __Pyx_GOTREF(__pyx_t_50);
15363 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
15364 __pyx_t_6 = PyNumber_Add(__pyx_kp_s_Smoothing_Mesh_with_Laplace_Smoo, __pyx_t_50);
if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 826, __pyx_L1_error)
15365 __Pyx_GOTREF(__pyx_t_6);
15366 __Pyx_DECREF(__pyx_t_50); __pyx_t_50 = 0;
15368 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_7))) {
15369 __pyx_t_50 = PyMethod_GET_SELF(__pyx_t_7);
15370 if (likely(__pyx_t_50)) {
15371 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_7);
15372 __Pyx_INCREF(__pyx_t_50);
15373 __Pyx_INCREF(
function);
15374 __Pyx_DECREF_SET(__pyx_t_7,
function);
15377 __pyx_t_3 = (__pyx_t_50) ? __Pyx_PyObject_Call2Args(__pyx_t_7, __pyx_t_50, __pyx_t_6) : __Pyx_PyObject_CallOneArg(__pyx_t_7, __pyx_t_6);
15378 __Pyx_XDECREF(__pyx_t_50); __pyx_t_50 = 0;
15379 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
15380 if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 826, __pyx_L1_error)
15381 __Pyx_GOTREF(__pyx_t_3);
15382 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
15383 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
15392 __pyx_t_2 = __pyx_v_nSmooth;
15393 __pyx_t_20 = __pyx_t_2;
15394 for (__pyx_t_21 = 0; __pyx_t_21 < __pyx_t_20; __pyx_t_21+=1) {
15395 __pyx_v_iS = __pyx_t_21;
15404 __pyx_v_simultaneous = 1;
15413 __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_ms);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 837, __pyx_L1_error)
15414 __Pyx_GOTREF(__pyx_t_3);
15415 __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_smoothNodesLaplace);
if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 837, __pyx_L1_error)
15416 __Pyx_GOTREF(__pyx_t_7);
15417 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
15418 __pyx_t_3 = __Pyx_PyDict_NewPresized(10);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 837, __pyx_L1_error)
15419 __Pyx_GOTREF(__pyx_t_3);
15420 __pyx_t_6 = __pyx_memoryview_fromslice(__pyx_v_xx, 2, (PyObject *(*)(
char *)) __pyx_memview_get_double, (
int (*)(
char *, PyObject *)) __pyx_memview_set_double, 0);;
if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 837, __pyx_L1_error)
15421 __Pyx_GOTREF(__pyx_t_6);
15422 if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_nodeArray_2, __pyx_t_6) < 0) __PYX_ERR(0, 837, __pyx_L1_error)
15423 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
15432 __pyx_t_6 = __pyx_memoryview_fromslice(__pyx_v_nodeStarOffsets, 1, (PyObject *(*)(
char *)) __pyx_memview_get_int, (
int (*)(
char *, PyObject *)) __pyx_memview_set_int, 0);;
if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 838, __pyx_L1_error)
15433 __Pyx_GOTREF(__pyx_t_6);
15434 if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_nodeStarOffsets, __pyx_t_6) < 0) __PYX_ERR(0, 837, __pyx_L1_error)
15435 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
15444 __pyx_t_6 = __pyx_memoryview_fromslice(__pyx_v_nodeStarArray, 1, (PyObject *(*)(
char *)) __pyx_memview_get_int, (
int (*)(
char *, PyObject *)) __pyx_memview_set_int, 0);;
if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 839, __pyx_L1_error)
15445 __Pyx_GOTREF(__pyx_t_6);
15446 if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_nodeStarArray, __pyx_t_6) < 0) __PYX_ERR(0, 837, __pyx_L1_error)
15447 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
15456 __pyx_t_6 = __pyx_memoryview_fromslice(__pyx_v_nodeMaterialTypes, 1, (PyObject *(*)(
char *)) __pyx_memview_get_int, (
int (*)(
char *, PyObject *)) __pyx_memview_set_int, 0);;
if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 840, __pyx_L1_error)
15457 __Pyx_GOTREF(__pyx_t_6);
15458 if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_nodeMaterialTypes, __pyx_t_6) < 0) __PYX_ERR(0, 837, __pyx_L1_error)
15459 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
15468 __pyx_t_6 = __Pyx_PyInt_From_int(__pyx_v_nNodes_owned);
if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 841, __pyx_L1_error)
15469 __Pyx_GOTREF(__pyx_t_6);
15470 if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_nNodes_owned, __pyx_t_6) < 0) __PYX_ERR(0, 837, __pyx_L1_error)
15471 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
15480 __pyx_t_6 = __Pyx_PyInt_From_int(__pyx_v_nd);
if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 842, __pyx_L1_error)
15481 __Pyx_GOTREF(__pyx_t_6);
15482 if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_nd, __pyx_t_6) < 0) __PYX_ERR(0, 837, __pyx_L1_error)
15483 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
15492 __pyx_t_6 = __Pyx_PyBool_FromLong(__pyx_v_simultaneous);
if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 843, __pyx_L1_error)
15493 __Pyx_GOTREF(__pyx_t_6);
15494 if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_simultaneous, __pyx_t_6) < 0) __PYX_ERR(0, 837, __pyx_L1_error)
15495 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
15504 if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_smoothBoundaries, Py_True) < 0) __PYX_ERR(0, 837, __pyx_L1_error)
15513 __pyx_t_6 = __pyx_memoryview_fromslice(__pyx_v_fixedNodesBoolArray, 1, (PyObject *(*)(
char *)) __pyx_memview_get_int, (
int (*)(
char *, PyObject *)) __pyx_memview_set_int, 0);;
if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 845, __pyx_L1_error)
15514 __Pyx_GOTREF(__pyx_t_6);
15515 if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_fixedNodesBoolArray, __pyx_t_6) < 0) __PYX_ERR(0, 837, __pyx_L1_error)
15516 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
15517 if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_alpha, __pyx_float_0_) < 0) __PYX_ERR(0, 837, __pyx_L1_error)
15526 __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_empty_tuple, __pyx_t_3);
if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 837, __pyx_L1_error)
15527 __Pyx_GOTREF(__pyx_t_6);
15528 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
15529 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
15530 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
15539 __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_comm, __pyx_n_s_barrier);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 847, __pyx_L1_error)
15540 __Pyx_GOTREF(__pyx_t_3);
15542 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
15543 __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_3);
15544 if (likely(__pyx_t_7)) {
15545 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_3);
15546 __Pyx_INCREF(__pyx_t_7);
15547 __Pyx_INCREF(
function);
15548 __Pyx_DECREF_SET(__pyx_t_3,
function);
15551 __pyx_t_6 = (__pyx_t_7) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_7) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
15552 __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
15553 if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 847, __pyx_L1_error)
15554 __Pyx_GOTREF(__pyx_t_6);
15555 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
15556 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
15565 __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_ms);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 848, __pyx_L1_error)
15566 __Pyx_GOTREF(__pyx_t_3);
15567 __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_getNonOwnedNodeValues);
if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 848, __pyx_L1_error)
15568 __Pyx_GOTREF(__pyx_t_7);
15569 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
15570 __pyx_t_3 = __pyx_memoryview_fromslice(__pyx_v_xx, 2, (PyObject *(*)(
char *)) __pyx_memview_get_double, (
int (*)(
char *, PyObject *)) __pyx_memview_set_double, 0);;
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 848, __pyx_L1_error)
15571 __Pyx_GOTREF(__pyx_t_3);
15580 __pyx_t_50 = __Pyx_PyInt_From_int(__pyx_v_nNodes_owned);
if (unlikely(!__pyx_t_50)) __PYX_ERR(0, 849, __pyx_L1_error)
15581 __Pyx_GOTREF(__pyx_t_50);
15590 __pyx_t_46 = __Pyx_PyInt_From_int(__pyx_v_nNodes_global);
if (unlikely(!__pyx_t_46)) __PYX_ERR(0, 850, __pyx_L1_error)
15591 __Pyx_GOTREF(__pyx_t_46);
15600 __pyx_t_1 = __pyx_memoryview_fromslice(__pyx_v_nodeNumbering_subdomain2global, 1, (PyObject *(*)(
char *)) __pyx_memview_get_int, (
int (*)(
char *, PyObject *)) __pyx_memview_set_int, 0);;
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 851, __pyx_L1_error)
15601 __Pyx_GOTREF(__pyx_t_1);
15610 __pyx_t_52 = __pyx_memoryview_fromslice(__pyx_v_nodeOffsets_subdomain_owned, 1, (PyObject *(*)(
char *)) __pyx_memview_get_int, (
int (*)(
char *, PyObject *)) __pyx_memview_set_int, 0);;
if (unlikely(!__pyx_t_52)) __PYX_ERR(0, 852, __pyx_L1_error)
15611 __Pyx_GOTREF(__pyx_t_52);
15614 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_7))) {
15615 __pyx_t_53 = PyMethod_GET_SELF(__pyx_t_7);
15616 if (likely(__pyx_t_53)) {
15617 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_7);
15618 __Pyx_INCREF(__pyx_t_53);
15619 __Pyx_INCREF(
function);
15620 __Pyx_DECREF_SET(__pyx_t_7,
function);
15624 #if CYTHON_FAST_PYCALL
15625 if (PyFunction_Check(__pyx_t_7)) {
15626 PyObject *__pyx_temp[6] = {__pyx_t_53, __pyx_t_3, __pyx_t_50, __pyx_t_46, __pyx_t_1, __pyx_t_52};
15627 __pyx_t_6 = __Pyx_PyFunction_FastCall(__pyx_t_7, __pyx_temp+1-__pyx_t_22, 5+__pyx_t_22);
if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 848, __pyx_L1_error)
15628 __Pyx_XDECREF(__pyx_t_53); __pyx_t_53 = 0;
15629 __Pyx_GOTREF(__pyx_t_6);
15630 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
15631 __Pyx_DECREF(__pyx_t_50); __pyx_t_50 = 0;
15632 __Pyx_DECREF(__pyx_t_46); __pyx_t_46 = 0;
15633 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
15634 __Pyx_DECREF(__pyx_t_52); __pyx_t_52 = 0;
15637 #if CYTHON_FAST_PYCCALL
15638 if (__Pyx_PyFastCFunction_Check(__pyx_t_7)) {
15639 PyObject *__pyx_temp[6] = {__pyx_t_53, __pyx_t_3, __pyx_t_50, __pyx_t_46, __pyx_t_1, __pyx_t_52};
15640 __pyx_t_6 = __Pyx_PyCFunction_FastCall(__pyx_t_7, __pyx_temp+1-__pyx_t_22, 5+__pyx_t_22);
if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 848, __pyx_L1_error)
15641 __Pyx_XDECREF(__pyx_t_53); __pyx_t_53 = 0;
15642 __Pyx_GOTREF(__pyx_t_6);
15643 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
15644 __Pyx_DECREF(__pyx_t_50); __pyx_t_50 = 0;
15645 __Pyx_DECREF(__pyx_t_46); __pyx_t_46 = 0;
15646 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
15647 __Pyx_DECREF(__pyx_t_52); __pyx_t_52 = 0;
15651 __pyx_t_51 = PyTuple_New(5+__pyx_t_22);
if (unlikely(!__pyx_t_51)) __PYX_ERR(0, 848, __pyx_L1_error)
15652 __Pyx_GOTREF(__pyx_t_51);
15654 __Pyx_GIVEREF(__pyx_t_53); PyTuple_SET_ITEM(__pyx_t_51, 0, __pyx_t_53); __pyx_t_53 = NULL;
15656 __Pyx_GIVEREF(__pyx_t_3);
15657 PyTuple_SET_ITEM(__pyx_t_51, 0+__pyx_t_22, __pyx_t_3);
15658 __Pyx_GIVEREF(__pyx_t_50);
15659 PyTuple_SET_ITEM(__pyx_t_51, 1+__pyx_t_22, __pyx_t_50);
15660 __Pyx_GIVEREF(__pyx_t_46);
15661 PyTuple_SET_ITEM(__pyx_t_51, 2+__pyx_t_22, __pyx_t_46);
15662 __Pyx_GIVEREF(__pyx_t_1);
15663 PyTuple_SET_ITEM(__pyx_t_51, 3+__pyx_t_22, __pyx_t_1);
15664 __Pyx_GIVEREF(__pyx_t_52);
15665 PyTuple_SET_ITEM(__pyx_t_51, 4+__pyx_t_22, __pyx_t_52);
15671 __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_51, NULL);
if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 848, __pyx_L1_error)
15672 __Pyx_GOTREF(__pyx_t_6);
15673 __Pyx_DECREF(__pyx_t_51); __pyx_t_51 = 0;
15675 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
15676 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
15686 __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_logEvent);
if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 853, __pyx_L1_error)
15687 __Pyx_GOTREF(__pyx_t_7);
15689 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_7))) {
15690 __pyx_t_51 = PyMethod_GET_SELF(__pyx_t_7);
15691 if (likely(__pyx_t_51)) {
15692 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_7);
15693 __Pyx_INCREF(__pyx_t_51);
15694 __Pyx_INCREF(
function);
15695 __Pyx_DECREF_SET(__pyx_t_7,
function);
15698 __pyx_t_6 = (__pyx_t_51) ? __Pyx_PyObject_Call2Args(__pyx_t_7, __pyx_t_51, __pyx_kp_s_Done_smoothing) : __Pyx_PyObject_CallOneArg(__pyx_t_7, __pyx_kp_s_Done_smoothing);
15699 __Pyx_XDECREF(__pyx_t_51); __pyx_t_51 = 0;
15700 if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 853, __pyx_L1_error)
15701 __Pyx_GOTREF(__pyx_t_6);
15702 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
15703 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
15721 __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_logEvent);
if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 855, __pyx_L1_error)
15722 __Pyx_GOTREF(__pyx_t_7);
15724 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_7))) {
15725 __pyx_t_51 = PyMethod_GET_SELF(__pyx_t_7);
15726 if (likely(__pyx_t_51)) {
15727 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_7);
15728 __Pyx_INCREF(__pyx_t_51);
15729 __Pyx_INCREF(
function);
15730 __Pyx_DECREF_SET(__pyx_t_7,
function);
15733 __pyx_t_6 = (__pyx_t_51) ? __Pyx_PyObject_Call2Args(__pyx_t_7, __pyx_t_51, __pyx_kp_s_Done_pseudo_timestepping) : __Pyx_PyObject_CallOneArg(__pyx_t_7, __pyx_kp_s_Done_pseudo_timestepping);
15734 __Pyx_XDECREF(__pyx_t_51); __pyx_t_51 = 0;
15735 if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 855, __pyx_L1_error)
15736 __Pyx_GOTREF(__pyx_t_6);
15737 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
15738 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
15749 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
15752 __Pyx_XDECREF(__pyx_t_1);
15753 __Pyx_XDECREF(__pyx_t_3);
15754 __Pyx_XDECREF(__pyx_t_4);
15755 __Pyx_XDECREF(__pyx_t_5);
15756 __Pyx_XDECREF(__pyx_t_6);
15757 __Pyx_XDECREF(__pyx_t_7);
15758 __Pyx_XDECREF(__pyx_t_8);
15759 __PYX_XDEC_MEMVIEW(&__pyx_t_9, 1);
15760 __PYX_XDEC_MEMVIEW(&__pyx_t_11, 1);
15761 __PYX_XDEC_MEMVIEW(&__pyx_t_13, 1);
15762 __PYX_XDEC_MEMVIEW(&__pyx_t_14, 1);
15763 __PYX_XDEC_MEMVIEW(&__pyx_t_18, 1);
15764 __Pyx_XDECREF(__pyx_t_42);
15765 __Pyx_XDECREF(__pyx_t_43);
15766 __Pyx_XDECREF(__pyx_t_44);
15767 __Pyx_XDECREF(__pyx_t_45);
15768 __Pyx_XDECREF(__pyx_t_46);
15769 __Pyx_XDECREF(__pyx_t_47);
15770 __Pyx_XDECREF(__pyx_t_50);
15771 __Pyx_XDECREF(__pyx_t_51);
15772 __Pyx_XDECREF(__pyx_t_52);
15773 __Pyx_XDECREF(__pyx_t_53);
15774 __Pyx_AddTraceback(
"mprans.cMoveMeshMonitor.cCoefficients.cppPseudoTimeSteppingParallel", __pyx_clineno, __pyx_lineno, __pyx_filename);
15777 __Pyx_XDECREF(__pyx_v_pc);
15778 __PYX_XDEC_MEMVIEW(&__pyx_v_t_range, 1);
15779 __PYX_XDEC_MEMVIEW(&__pyx_v_eN_phi, 1);
15780 __PYX_XDEC_MEMVIEW(&__pyx_v_normal, 1);
15781 __PYX_XDEC_MEMVIEW(&__pyx_v_dphi, 1);
15782 __PYX_XDEC_MEMVIEW(&__pyx_v_grads, 1);
15783 __PYX_XDEC_MEMVIEW(&__pyx_v_v_grad, 1);
15784 __PYX_XDEC_MEMVIEW(&__pyx_v_areas_nodes, 1);
15785 __PYX_XDEC_MEMVIEW(&__pyx_v_areas, 1);
15786 __PYX_XDEC_MEMVIEW(&__pyx_v_u_phi, 1);
15787 __Pyx_XDECREF(__pyx_v_femSpace);
15788 __PYX_XDEC_MEMVIEW(&__pyx_v_nodeArray, 1);
15789 __PYX_XDEC_MEMVIEW(&__pyx_v_nodeStarOffsets, 1);
15790 __PYX_XDEC_MEMVIEW(&__pyx_v_nodeStarArray, 1);
15791 __PYX_XDEC_MEMVIEW(&__pyx_v_nodeElementOffsets, 1);
15792 __PYX_XDEC_MEMVIEW(&__pyx_v_nodeElementsArray, 1);
15793 __PYX_XDEC_MEMVIEW(&__pyx_v_nodeMaterialTypes, 1);
15794 __PYX_XDEC_MEMVIEW(&__pyx_v_elementBarycentersArray, 1);
15795 __PYX_XDEC_MEMVIEW(&__pyx_v_elementBoundaryElementsArray, 1);
15796 __PYX_XDEC_MEMVIEW(&__pyx_v_elementBoundariesArray, 1);
15797 __PYX_XDEC_MEMVIEW(&__pyx_v_elementNodesArray, 1);
15798 __PYX_XDEC_MEMVIEW(&__pyx_v_elementBoundaryBarycentersArray, 1);
15799 __PYX_XDEC_MEMVIEW(&__pyx_v_exteriorElementBoundariesBoolArray, 1);
15800 __PYX_XDEC_MEMVIEW(&__pyx_v_elementBoundaryNormalsArray, 1);
15801 __PYX_XDEC_MEMVIEW(&__pyx_v_nodeNumbering_subdomain2global, 1);
15802 __PYX_XDEC_MEMVIEW(&__pyx_v_elementNumbering_subdomain2global, 1);
15803 __PYX_XDEC_MEMVIEW(&__pyx_v_nodeOffsets_subdomain_owned, 1);
15804 __PYX_XDEC_MEMVIEW(&__pyx_v_elementOffsets_subdomain_owned, 1);
15805 __PYX_XDEC_MEMVIEW(&__pyx_v_nearestNArray, 1);
15806 __PYX_XDEC_MEMVIEW(&__pyx_v_typeNArray, 1);
15807 __PYX_XDEC_MEMVIEW(&__pyx_v_elementNeighborsArray, 1);
15808 __PYX_XDEC_MEMVIEW(&__pyx_v_elementBoundaryNumbering_subdomain2global, 1);
15809 __PYX_XDEC_MEMVIEW(&__pyx_v_elementBoundaryOffsets_subdomain_owned, 1);
15810 __PYX_XDEC_MEMVIEW(&__pyx_v_elementBoundaryNodesArray, 1);
15811 __PYX_XDEC_MEMVIEW(&__pyx_v_fixedNodesBoolArray, 1);
15812 __PYX_XDEC_MEMVIEW(&__pyx_v_vec, 1);
15813 __PYX_XDEC_MEMVIEW(&__pyx_v_vec2, 1);
15814 __PYX_XDEC_MEMVIEW(&__pyx_v_fixed_dir, 1);
15815 __Pyx_XDECREF(__pyx_v_comm);
15816 __PYX_XDEC_MEMVIEW(&__pyx_v_counts_local, 1);
15817 __PYX_XDEC_MEMVIEW(&__pyx_v_counts_total, 1);
15818 __PYX_XDEC_MEMVIEW(&__pyx_v_counts_out, 1);
15819 __PYX_XDEC_MEMVIEW(&__pyx_v_displacements_out, 1);
15820 __Pyx_XDECREF(__pyx_v_coords_2rank);
15821 __Pyx_XDECREF(__pyx_v_nodes0_2rank);
15822 __Pyx_XDECREF(__pyx_v_rank0_2rank);
15823 __Pyx_XDECREF(__pyx_v_nearestN_2rank);
15824 __Pyx_XDECREF(__pyx_v_typeN_2rank);
15825 __Pyx_XDECREF(__pyx_v_dir_2rank);
15826 __Pyx_XDECREF(__pyx_v_b_i_2rank);
15827 __PYX_XDEC_MEMVIEW(&__pyx_v_coords, 1);
15828 __PYX_XDEC_MEMVIEW(&__pyx_v_bound_bar, 1);
15829 __PYX_XDEC_MEMVIEW(&__pyx_v_result, 1);
15830 __Pyx_XDECREF(__pyx_v_rank);
15831 __PYX_XDEC_MEMVIEW(&__pyx_v_nodesSentBoolArray, 1);
15832 __PYX_XDEC_MEMVIEW(&__pyx_v_starting_coords, 1);
15833 __Pyx_XDECREF(__pyx_v_exc);
15834 __Pyx_XDECREF(__pyx_v_xi);
15835 __Pyx_XDECREF(__pyx_v_array_size);
15836 __Pyx_XDECREF(__pyx_v_datatype);
15837 __Pyx_XDECREF(__pyx_v_solFound_2doArray);
15838 __Pyx_XDECREF(__pyx_v_rank0);
15839 __Pyx_XDECREF(__pyx_gb_6mprans_16cMoveMeshMonitor_13cCoefficients_29cppPseudoTimeSteppingParallel_2generator);
15840 __Pyx_XDECREF(__pyx_gb_6mprans_16cMoveMeshMonitor_13cCoefficients_29cppPseudoTimeSteppingParallel_5generator1);
15841 __Pyx_XDECREF(__pyx_gb_6mprans_16cMoveMeshMonitor_13cCoefficients_29cppPseudoTimeSteppingParallel_8generator2);
15842 __Pyx_XDECREF(__pyx_gb_6mprans_16cMoveMeshMonitor_13cCoefficients_29cppPseudoTimeSteppingParallel_11generator3);
15843 __Pyx_DECREF(((PyObject *)__pyx_cur_scope));
15844 __Pyx_XGIVEREF(__pyx_r);
15845 __Pyx_RefNannyFinishContext();
15858 static PyObject *__pyx_pw_6mprans_16cMoveMeshMonitor_13cCoefficients_14pyCoefficients_1__get__(PyObject *__pyx_v_self);
15859 static PyObject *__pyx_pw_6mprans_16cMoveMeshMonitor_13cCoefficients_14pyCoefficients_1__get__(PyObject *__pyx_v_self) {
15860 PyObject *__pyx_r = 0;
15861 __Pyx_RefNannyDeclarations
15862 __Pyx_RefNannySetupContext(
"__get__ (wrapper)", 0);
15863 __pyx_r = __pyx_pf_6mprans_16cMoveMeshMonitor_13cCoefficients_14pyCoefficients___get__(((
struct __pyx_obj_6mprans_16cMoveMeshMonitor_cCoefficients *)__pyx_v_self));
15866 __Pyx_RefNannyFinishContext();
15870 static PyObject *__pyx_pf_6mprans_16cMoveMeshMonitor_13cCoefficients_14pyCoefficients___get__(
struct __pyx_obj_6mprans_16cMoveMeshMonitor_cCoefficients *__pyx_v_self) {
15871 PyObject *__pyx_r = NULL;
15872 __Pyx_RefNannyDeclarations
15873 __Pyx_RefNannySetupContext(
"__get__", 0);
15874 __Pyx_XDECREF(__pyx_r);
15875 __Pyx_INCREF(__pyx_v_self->pyCoefficients);
15876 __pyx_r = __pyx_v_self->pyCoefficients;
15881 __Pyx_XGIVEREF(__pyx_r);
15882 __Pyx_RefNannyFinishContext();
15887 static int __pyx_pw_6mprans_16cMoveMeshMonitor_13cCoefficients_14pyCoefficients_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value);
15888 static int __pyx_pw_6mprans_16cMoveMeshMonitor_13cCoefficients_14pyCoefficients_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
15890 __Pyx_RefNannyDeclarations
15891 __Pyx_RefNannySetupContext(
"__set__ (wrapper)", 0);
15892 __pyx_r = __pyx_pf_6mprans_16cMoveMeshMonitor_13cCoefficients_14pyCoefficients_2__set__(((
struct __pyx_obj_6mprans_16cMoveMeshMonitor_cCoefficients *)__pyx_v_self), ((PyObject *)__pyx_v_value));
15895 __Pyx_RefNannyFinishContext();
15899 static int __pyx_pf_6mprans_16cMoveMeshMonitor_13cCoefficients_14pyCoefficients_2__set__(
struct __pyx_obj_6mprans_16cMoveMeshMonitor_cCoefficients *__pyx_v_self, PyObject *__pyx_v_value) {
15901 __Pyx_RefNannyDeclarations
15902 __Pyx_RefNannySetupContext(
"__set__", 0);
15903 __Pyx_INCREF(__pyx_v_value);
15904 __Pyx_GIVEREF(__pyx_v_value);
15905 __Pyx_GOTREF(__pyx_v_self->pyCoefficients);
15906 __Pyx_DECREF(__pyx_v_self->pyCoefficients);
15907 __pyx_v_self->pyCoefficients = __pyx_v_value;
15911 __Pyx_RefNannyFinishContext();
15916 static int __pyx_pw_6mprans_16cMoveMeshMonitor_13cCoefficients_14pyCoefficients_5__del__(PyObject *__pyx_v_self);
15917 static int __pyx_pw_6mprans_16cMoveMeshMonitor_13cCoefficients_14pyCoefficients_5__del__(PyObject *__pyx_v_self) {
15919 __Pyx_RefNannyDeclarations
15920 __Pyx_RefNannySetupContext(
"__del__ (wrapper)", 0);
15921 __pyx_r = __pyx_pf_6mprans_16cMoveMeshMonitor_13cCoefficients_14pyCoefficients_4__del__(((
struct __pyx_obj_6mprans_16cMoveMeshMonitor_cCoefficients *)__pyx_v_self));
15924 __Pyx_RefNannyFinishContext();
15928 static int __pyx_pf_6mprans_16cMoveMeshMonitor_13cCoefficients_14pyCoefficients_4__del__(
struct __pyx_obj_6mprans_16cMoveMeshMonitor_cCoefficients *__pyx_v_self) {
15930 __Pyx_RefNannyDeclarations
15931 __Pyx_RefNannySetupContext(
"__del__", 0);
15932 __Pyx_INCREF(Py_None);
15933 __Pyx_GIVEREF(Py_None);
15934 __Pyx_GOTREF(__pyx_v_self->pyCoefficients);
15935 __Pyx_DECREF(__pyx_v_self->pyCoefficients);
15936 __pyx_v_self->pyCoefficients = Py_None;
15940 __Pyx_RefNannyFinishContext();
15953 static PyObject *__pyx_pw_6mprans_16cMoveMeshMonitor_13cCoefficients_1C_1__get__(PyObject *__pyx_v_self);
15954 static PyObject *__pyx_pw_6mprans_16cMoveMeshMonitor_13cCoefficients_1C_1__get__(PyObject *__pyx_v_self) {
15955 PyObject *__pyx_r = 0;
15956 __Pyx_RefNannyDeclarations
15957 __Pyx_RefNannySetupContext(
"__get__ (wrapper)", 0);
15958 __pyx_r = __pyx_pf_6mprans_16cMoveMeshMonitor_13cCoefficients_1C___get__(((
struct __pyx_obj_6mprans_16cMoveMeshMonitor_cCoefficients *)__pyx_v_self));
15961 __Pyx_RefNannyFinishContext();
15965 static PyObject *__pyx_pf_6mprans_16cMoveMeshMonitor_13cCoefficients_1C___get__(
struct __pyx_obj_6mprans_16cMoveMeshMonitor_cCoefficients *__pyx_v_self) {
15966 PyObject *__pyx_r = NULL;
15967 __Pyx_RefNannyDeclarations
15968 PyObject *__pyx_t_1 = NULL;
15969 int __pyx_lineno = 0;
15970 const char *__pyx_filename = NULL;
15971 int __pyx_clineno = 0;
15972 __Pyx_RefNannySetupContext(
"__get__", 0);
15973 __Pyx_XDECREF(__pyx_r);
15974 __pyx_t_1 = PyFloat_FromDouble(__pyx_v_self->C);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 18, __pyx_L1_error)
15975 __Pyx_GOTREF(__pyx_t_1);
15976 __pyx_r = __pyx_t_1;
15982 __Pyx_XDECREF(__pyx_t_1);
15983 __Pyx_AddTraceback(
"mprans.cMoveMeshMonitor.cCoefficients.C.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
15986 __Pyx_XGIVEREF(__pyx_r);
15987 __Pyx_RefNannyFinishContext();
15992 static int __pyx_pw_6mprans_16cMoveMeshMonitor_13cCoefficients_1C_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value);
15993 static int __pyx_pw_6mprans_16cMoveMeshMonitor_13cCoefficients_1C_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
15995 __Pyx_RefNannyDeclarations
15996 __Pyx_RefNannySetupContext(
"__set__ (wrapper)", 0);
15997 __pyx_r = __pyx_pf_6mprans_16cMoveMeshMonitor_13cCoefficients_1C_2__set__(((
struct __pyx_obj_6mprans_16cMoveMeshMonitor_cCoefficients *)__pyx_v_self), ((PyObject *)__pyx_v_value));
16000 __Pyx_RefNannyFinishContext();
16004 static int __pyx_pf_6mprans_16cMoveMeshMonitor_13cCoefficients_1C_2__set__(
struct __pyx_obj_6mprans_16cMoveMeshMonitor_cCoefficients *__pyx_v_self, PyObject *__pyx_v_value) {
16006 __Pyx_RefNannyDeclarations
16008 int __pyx_lineno = 0;
16009 const char *__pyx_filename = NULL;
16010 int __pyx_clineno = 0;
16011 __Pyx_RefNannySetupContext(
"__set__", 0);
16012 __pyx_t_1 = __pyx_PyFloat_AsDouble(__pyx_v_value);
if (unlikely((__pyx_t_1 == (
double)-1) && PyErr_Occurred())) __PYX_ERR(0, 18, __pyx_L1_error)
16013 __pyx_v_self->C = __pyx_t_1;
16019 __Pyx_AddTraceback(
"mprans.cMoveMeshMonitor.cCoefficients.C.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
16022 __Pyx_RefNannyFinishContext();
16033 static PyObject *__pyx_pw_6mprans_16cMoveMeshMonitor_13cCoefficients_11__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused);
16034 static PyObject *__pyx_pw_6mprans_16cMoveMeshMonitor_13cCoefficients_11__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
16035 PyObject *__pyx_r = 0;
16036 __Pyx_RefNannyDeclarations
16037 __Pyx_RefNannySetupContext(
"__reduce_cython__ (wrapper)", 0);
16038 __pyx_r = __pyx_pf_6mprans_16cMoveMeshMonitor_13cCoefficients_10__reduce_cython__(((
struct __pyx_obj_6mprans_16cMoveMeshMonitor_cCoefficients *)__pyx_v_self));
16041 __Pyx_RefNannyFinishContext();
16045 static PyObject *__pyx_pf_6mprans_16cMoveMeshMonitor_13cCoefficients_10__reduce_cython__(CYTHON_UNUSED
struct __pyx_obj_6mprans_16cMoveMeshMonitor_cCoefficients *__pyx_v_self) {
16046 PyObject *__pyx_r = NULL;
16047 __Pyx_RefNannyDeclarations
16048 PyObject *__pyx_t_1 = NULL;
16049 int __pyx_lineno = 0;
16050 const char *__pyx_filename = NULL;
16051 int __pyx_clineno = 0;
16052 __Pyx_RefNannySetupContext(
"__reduce_cython__", 0);
16060 __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__8, NULL);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 2, __pyx_L1_error)
16061 __Pyx_GOTREF(__pyx_t_1);
16062 __Pyx_Raise(__pyx_t_1, 0, 0, 0);
16063 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
16064 __PYX_ERR(1, 2, __pyx_L1_error)
16074 __Pyx_XDECREF(__pyx_t_1);
16075 __Pyx_AddTraceback(
"mprans.cMoveMeshMonitor.cCoefficients.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
16077 __Pyx_XGIVEREF(__pyx_r);
16078 __Pyx_RefNannyFinishContext();
16090 static PyObject *__pyx_pw_6mprans_16cMoveMeshMonitor_13cCoefficients_13__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state);
16091 static PyObject *__pyx_pw_6mprans_16cMoveMeshMonitor_13cCoefficients_13__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
16092 PyObject *__pyx_r = 0;
16093 __Pyx_RefNannyDeclarations
16094 __Pyx_RefNannySetupContext(
"__setstate_cython__ (wrapper)", 0);
16095 __pyx_r = __pyx_pf_6mprans_16cMoveMeshMonitor_13cCoefficients_12__setstate_cython__(((
struct __pyx_obj_6mprans_16cMoveMeshMonitor_cCoefficients *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state));
16098 __Pyx_RefNannyFinishContext();
16102 static PyObject *__pyx_pf_6mprans_16cMoveMeshMonitor_13cCoefficients_12__setstate_cython__(CYTHON_UNUSED
struct __pyx_obj_6mprans_16cMoveMeshMonitor_cCoefficients *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) {
16103 PyObject *__pyx_r = NULL;
16104 __Pyx_RefNannyDeclarations
16105 PyObject *__pyx_t_1 = NULL;
16106 int __pyx_lineno = 0;
16107 const char *__pyx_filename = NULL;
16108 int __pyx_clineno = 0;
16109 __Pyx_RefNannySetupContext(
"__setstate_cython__", 0);
16116 __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__9, NULL);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 4, __pyx_L1_error)
16117 __Pyx_GOTREF(__pyx_t_1);
16118 __Pyx_Raise(__pyx_t_1, 0, 0, 0);
16119 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
16120 __PYX_ERR(1, 4, __pyx_L1_error)
16131 __Pyx_XDECREF(__pyx_t_1);
16132 __Pyx_AddTraceback(
"mprans.cMoveMeshMonitor.cCoefficients.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
16134 __Pyx_XGIVEREF(__pyx_r);
16135 __Pyx_RefNannyFinishContext();
16148 static PyObject *__pyx_pw_6mprans_16cMoveMeshMonitor_1recoveryAtNodes(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
16149 static PyMethodDef __pyx_mdef_6mprans_16cMoveMeshMonitor_1recoveryAtNodes = {
"recoveryAtNodes", (PyCFunction)(
void*)(PyCFunctionWithKeywords)__pyx_pw_6mprans_16cMoveMeshMonitor_1recoveryAtNodes, METH_VARARGS|METH_KEYWORDS, 0};
16150 static PyObject *__pyx_pw_6mprans_16cMoveMeshMonitor_1recoveryAtNodes(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
16151 __Pyx_memviewslice __pyx_v_scalars = { 0, 0, { 0 }, { 0 }, { 0 } };
16152 __Pyx_memviewslice __pyx_v_nodeElementsArray = { 0, 0, { 0 }, { 0 }, { 0 } };
16153 __Pyx_memviewslice __pyx_v_nodeElementOffsets = { 0, 0, { 0 }, { 0 }, { 0 } };
16154 int __pyx_lineno = 0;
16155 const char *__pyx_filename = NULL;
16156 int __pyx_clineno = 0;
16157 PyObject *__pyx_r = 0;
16158 __Pyx_RefNannyDeclarations
16159 __Pyx_RefNannySetupContext(
"recoveryAtNodes (wrapper)", 0);
16161 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_scalars,&__pyx_n_s_nodeElementsArray,&__pyx_n_s_nodeElementOffsets,0};
16162 PyObject* values[3] = {0,0,0};
16163 if (unlikely(__pyx_kwds)) {
16164 Py_ssize_t kw_args;
16165 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
16166 switch (pos_args) {
16167 case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
16168 CYTHON_FALLTHROUGH;
16169 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
16170 CYTHON_FALLTHROUGH;
16171 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
16172 CYTHON_FALLTHROUGH;
16174 default:
goto __pyx_L5_argtuple_error;
16176 kw_args = PyDict_Size(__pyx_kwds);
16177 switch (pos_args) {
16179 if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_scalars)) != 0)) kw_args--;
16180 else goto __pyx_L5_argtuple_error;
16181 CYTHON_FALLTHROUGH;
16183 if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_nodeElementsArray)) != 0)) kw_args--;
16185 __Pyx_RaiseArgtupleInvalid(
"recoveryAtNodes", 1, 3, 3, 1); __PYX_ERR(0, 944, __pyx_L3_error)
16187 CYTHON_FALLTHROUGH;
16189 if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_nodeElementOffsets)) != 0)) kw_args--;
16191 __Pyx_RaiseArgtupleInvalid(
"recoveryAtNodes", 1, 3, 3, 2); __PYX_ERR(0, 944, __pyx_L3_error)
16194 if (unlikely(kw_args > 0)) {
16195 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args,
"recoveryAtNodes") < 0)) __PYX_ERR(0, 944, __pyx_L3_error)
16197 }
else if (PyTuple_GET_SIZE(__pyx_args) != 3) {
16198 goto __pyx_L5_argtuple_error;
16200 values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
16201 values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
16202 values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
16204 __pyx_v_scalars = __Pyx_PyObject_to_MemoryviewSlice_ds_double(values[0], PyBUF_WRITABLE);
if (unlikely(!__pyx_v_scalars.memview)) __PYX_ERR(0, 944, __pyx_L3_error)
16205 __pyx_v_nodeElementsArray = __Pyx_PyObject_to_MemoryviewSlice_ds_int(values[1], PyBUF_WRITABLE);
if (unlikely(!__pyx_v_nodeElementsArray.memview)) __PYX_ERR(0, 945, __pyx_L3_error)
16206 __pyx_v_nodeElementOffsets = __Pyx_PyObject_to_MemoryviewSlice_ds_int(values[2], PyBUF_WRITABLE);
if (unlikely(!__pyx_v_nodeElementOffsets.memview)) __PYX_ERR(0, 946, __pyx_L3_error)
16208 goto __pyx_L4_argument_unpacking_done;
16209 __pyx_L5_argtuple_error:;
16210 __Pyx_RaiseArgtupleInvalid(
"recoveryAtNodes", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 944, __pyx_L3_error)
16212 __Pyx_AddTraceback(
"mprans.cMoveMeshMonitor.recoveryAtNodes", __pyx_clineno, __pyx_lineno, __pyx_filename);
16213 __Pyx_RefNannyFinishContext();
16215 __pyx_L4_argument_unpacking_done:;
16216 __pyx_r = __pyx_pf_6mprans_16cMoveMeshMonitor_recoveryAtNodes(__pyx_self, __pyx_v_scalars, __pyx_v_nodeElementsArray, __pyx_v_nodeElementOffsets);
16219 __Pyx_RefNannyFinishContext();
16223 static PyObject *__pyx_pf_6mprans_16cMoveMeshMonitor_recoveryAtNodes(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_scalars, __Pyx_memviewslice __pyx_v_nodeElementsArray, __Pyx_memviewslice __pyx_v_nodeElementOffsets) {
16224 PyObject *__pyx_r = NULL;
16225 __Pyx_RefNannyDeclarations
16226 __Pyx_memviewslice __pyx_t_1 = { 0, 0, { 0 }, { 0 }, { 0 } };
16227 PyObject *__pyx_t_2 = NULL;
16228 int __pyx_lineno = 0;
16229 const char *__pyx_filename = NULL;
16230 int __pyx_clineno = 0;
16231 __Pyx_RefNannySetupContext(
"recoveryAtNodes", 0);
16240 __Pyx_XDECREF(__pyx_r);
16249 __pyx_t_1 = __pyx_f_6mprans_16cMoveMeshMonitor_cppRecoveryAtNodes(__pyx_v_scalars, __pyx_v_nodeElementsArray, __pyx_v_nodeElementOffsets);
if (unlikely(!__pyx_t_1.memview)) __PYX_ERR(0, 947, __pyx_L1_error)
16258 __pyx_t_2 = __pyx_memoryview_fromslice(__pyx_t_1, 1, (PyObject *(*)(
char *)) __pyx_memview_get_double, (
int (*)(
char *, PyObject *)) __pyx_memview_set_double, 0);;
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 947, __pyx_L1_error)
16259 __Pyx_GOTREF(__pyx_t_2);
16260 __PYX_XDEC_MEMVIEW(&__pyx_t_1, 1);
16261 __pyx_t_1.memview = NULL;
16262 __pyx_t_1.data = NULL;
16263 __pyx_r = __pyx_t_2;
16277 __PYX_XDEC_MEMVIEW(&__pyx_t_1, 1);
16278 __Pyx_XDECREF(__pyx_t_2);
16279 __Pyx_AddTraceback(
"mprans.cMoveMeshMonitor.recoveryAtNodes", __pyx_clineno, __pyx_lineno, __pyx_filename);
16282 __PYX_XDEC_MEMVIEW(&__pyx_v_scalars, 1);
16283 __PYX_XDEC_MEMVIEW(&__pyx_v_nodeElementsArray, 1);
16284 __PYX_XDEC_MEMVIEW(&__pyx_v_nodeElementOffsets, 1);
16285 __Pyx_XGIVEREF(__pyx_r);
16286 __Pyx_RefNannyFinishContext();
16298 static __Pyx_memviewslice __pyx_f_6mprans_16cMoveMeshMonitor_cppRecoveryAtNodes(__Pyx_memviewslice __pyx_v_scalars, __Pyx_memviewslice __pyx_v_nodeElementsArray, __Pyx_memviewslice __pyx_v_nodeElementOffsets) {
16299 __Pyx_memviewslice __pyx_v_recovered_scalars = { 0, 0, { 0 }, { 0 }, { 0 } };
16301 double __pyx_v_var_sum;
16302 PyObject *__pyx_v_node = NULL;
16303 PyObject *__pyx_v_eOffset = NULL;
16304 __Pyx_memviewslice __pyx_r = { 0, 0, { 0 }, { 0 }, { 0 } };
16305 __Pyx_RefNannyDeclarations
16306 PyObject *__pyx_t_1 = NULL;
16307 PyObject *__pyx_t_2 = NULL;
16308 PyObject *__pyx_t_3 = NULL;
16310 PyObject *__pyx_t_5 = NULL;
16311 __Pyx_memviewslice __pyx_t_6 = { 0, 0, { 0 }, { 0 }, { 0 } };
16312 Py_ssize_t __pyx_t_7;
16313 PyObject *(*__pyx_t_8)(PyObject *);
16314 Py_ssize_t __pyx_t_9;
16315 Py_ssize_t __pyx_t_10;
16316 PyObject *(*__pyx_t_11)(PyObject *);
16317 Py_ssize_t __pyx_t_12;
16318 Py_ssize_t __pyx_t_13;
16319 int __pyx_lineno = 0;
16320 const char *__pyx_filename = NULL;
16321 int __pyx_clineno = 0;
16322 __Pyx_RefNannySetupContext(
"cppRecoveryAtNodes", 0);
16331 __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_np);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 958, __pyx_L1_error)
16332 __Pyx_GOTREF(__pyx_t_2);
16333 __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_zeros);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 958, __pyx_L1_error)
16334 __Pyx_GOTREF(__pyx_t_3);
16335 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
16336 __pyx_t_4 = __Pyx_MemoryView_Len(__pyx_v_nodeElementOffsets);
16337 __pyx_t_2 = PyInt_FromSsize_t((__pyx_t_4 - 1));
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 958, __pyx_L1_error)
16338 __Pyx_GOTREF(__pyx_t_2);
16340 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
16341 __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_3);
16342 if (likely(__pyx_t_5)) {
16343 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_3);
16344 __Pyx_INCREF(__pyx_t_5);
16345 __Pyx_INCREF(
function);
16346 __Pyx_DECREF_SET(__pyx_t_3,
function);
16349 __pyx_t_1 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_5, __pyx_t_2) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_2);
16350 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
16351 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
16352 if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 958, __pyx_L1_error)
16353 __Pyx_GOTREF(__pyx_t_1);
16354 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
16355 __pyx_t_6 = __Pyx_PyObject_to_MemoryviewSlice_ds_double(__pyx_t_1, PyBUF_WRITABLE);
if (unlikely(!__pyx_t_6.memview)) __PYX_ERR(0, 958, __pyx_L1_error)
16356 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
16357 __pyx_v_recovered_scalars = __pyx_t_6;
16358 __pyx_t_6.memview = NULL;
16359 __pyx_t_6.data = NULL;
16368 __pyx_t_4 = __Pyx_MemoryView_Len(__pyx_v_nodeElementOffsets);
16369 __pyx_t_1 = PyInt_FromSsize_t((__pyx_t_4 - 1));
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 961, __pyx_L1_error)
16370 __Pyx_GOTREF(__pyx_t_1);
16371 __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_builtin_range, __pyx_t_1);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 961, __pyx_L1_error)
16372 __Pyx_GOTREF(__pyx_t_3);
16373 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
16374 if (likely(PyList_CheckExact(__pyx_t_3)) || PyTuple_CheckExact(__pyx_t_3)) {
16375 __pyx_t_1 = __pyx_t_3; __Pyx_INCREF(__pyx_t_1); __pyx_t_7 = 0;
16378 __pyx_t_7 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_t_3);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 961, __pyx_L1_error)
16379 __Pyx_GOTREF(__pyx_t_1);
16380 __pyx_t_8 = Py_TYPE(__pyx_t_1)->tp_iternext;
if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 961, __pyx_L1_error)
16382 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
16384 if (likely(!__pyx_t_8)) {
16385 if (likely(PyList_CheckExact(__pyx_t_1))) {
16386 if (__pyx_t_7 >= PyList_GET_SIZE(__pyx_t_1))
break;
16387 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
16388 __pyx_t_3 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_7); __Pyx_INCREF(__pyx_t_3); __pyx_t_7++;
if (unlikely(0 < 0)) __PYX_ERR(0, 961, __pyx_L1_error)
16390 __pyx_t_3 = PySequence_ITEM(__pyx_t_1, __pyx_t_7); __pyx_t_7++;
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 961, __pyx_L1_error)
16391 __Pyx_GOTREF(__pyx_t_3);
16394 if (__pyx_t_7 >= PyTuple_GET_SIZE(__pyx_t_1))
break;
16395 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
16396 __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_7); __Pyx_INCREF(__pyx_t_3); __pyx_t_7++;
if (unlikely(0 < 0)) __PYX_ERR(0, 961, __pyx_L1_error)
16398 __pyx_t_3 = PySequence_ITEM(__pyx_t_1, __pyx_t_7); __pyx_t_7++;
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 961, __pyx_L1_error)
16399 __Pyx_GOTREF(__pyx_t_3);
16403 __pyx_t_3 = __pyx_t_8(__pyx_t_1);
16404 if (unlikely(!__pyx_t_3)) {
16405 PyObject* exc_type = PyErr_Occurred();
16407 if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
16408 else __PYX_ERR(0, 961, __pyx_L1_error)
16412 __Pyx_GOTREF(__pyx_t_3);
16414 __Pyx_XDECREF_SET(__pyx_v_node, __pyx_t_3);
16433 __pyx_v_var_sum = 0.0;
16442 __pyx_t_9 = __Pyx_PyIndex_AsSsize_t(__pyx_v_node);
if (unlikely((__pyx_t_9 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 964, __pyx_L1_error)
16443 __pyx_t_10 = __pyx_t_9;
16444 if (__pyx_t_10 < 0) __pyx_t_10 += __pyx_v_nodeElementOffsets.shape[0];
16445 __pyx_t_3 = __Pyx_PyInt_From_int((*((
int *) ( (__pyx_v_nodeElementOffsets.data + __pyx_t_10 * __pyx_v_nodeElementOffsets.strides[0]) ))));
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 964, __pyx_L1_error)
16446 __Pyx_GOTREF(__pyx_t_3);
16455 __pyx_t_2 = __Pyx_PyInt_AddObjC(__pyx_v_node, __pyx_int_1, 1, 0, 0);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 965, __pyx_L1_error)
16456 __Pyx_GOTREF(__pyx_t_2);
16457 __pyx_t_9 = __Pyx_PyIndex_AsSsize_t(__pyx_t_2);
if (unlikely((__pyx_t_9 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 965, __pyx_L1_error)
16458 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
16459 __pyx_t_10 = __pyx_t_9;
16460 if (__pyx_t_10 < 0) __pyx_t_10 += __pyx_v_nodeElementOffsets.shape[0];
16461 __pyx_t_2 = __Pyx_PyInt_From_int((*((
int *) ( (__pyx_v_nodeElementOffsets.data + __pyx_t_10 * __pyx_v_nodeElementOffsets.strides[0]) ))));
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 965, __pyx_L1_error)
16462 __Pyx_GOTREF(__pyx_t_2);
16471 __pyx_t_5 = PyTuple_New(2);
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 964, __pyx_L1_error)
16472 __Pyx_GOTREF(__pyx_t_5);
16473 __Pyx_GIVEREF(__pyx_t_3);
16474 PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_3);
16475 __Pyx_GIVEREF(__pyx_t_2);
16476 PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_2);
16479 __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_range, __pyx_t_5, NULL);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 964, __pyx_L1_error)
16480 __Pyx_GOTREF(__pyx_t_2);
16481 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
16482 if (likely(PyList_CheckExact(__pyx_t_2)) || PyTuple_CheckExact(__pyx_t_2)) {
16483 __pyx_t_5 = __pyx_t_2; __Pyx_INCREF(__pyx_t_5); __pyx_t_9 = 0;
16486 __pyx_t_9 = -1; __pyx_t_5 = PyObject_GetIter(__pyx_t_2);
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 964, __pyx_L1_error)
16487 __Pyx_GOTREF(__pyx_t_5);
16488 __pyx_t_11 = Py_TYPE(__pyx_t_5)->tp_iternext;
if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 964, __pyx_L1_error)
16490 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
16492 if (likely(!__pyx_t_11)) {
16493 if (likely(PyList_CheckExact(__pyx_t_5))) {
16494 if (__pyx_t_9 >= PyList_GET_SIZE(__pyx_t_5))
break;
16495 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
16496 __pyx_t_2 = PyList_GET_ITEM(__pyx_t_5, __pyx_t_9); __Pyx_INCREF(__pyx_t_2); __pyx_t_9++;
if (unlikely(0 < 0)) __PYX_ERR(0, 964, __pyx_L1_error)
16498 __pyx_t_2 = PySequence_ITEM(__pyx_t_5, __pyx_t_9); __pyx_t_9++;
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 964, __pyx_L1_error)
16499 __Pyx_GOTREF(__pyx_t_2);
16502 if (__pyx_t_9 >= PyTuple_GET_SIZE(__pyx_t_5))
break;
16503 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
16504 __pyx_t_2 = PyTuple_GET_ITEM(__pyx_t_5, __pyx_t_9); __Pyx_INCREF(__pyx_t_2); __pyx_t_9++;
if (unlikely(0 < 0)) __PYX_ERR(0, 964, __pyx_L1_error)
16506 __pyx_t_2 = PySequence_ITEM(__pyx_t_5, __pyx_t_9); __pyx_t_9++;
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 964, __pyx_L1_error)
16507 __Pyx_GOTREF(__pyx_t_2);
16511 __pyx_t_2 = __pyx_t_11(__pyx_t_5);
16512 if (unlikely(!__pyx_t_2)) {
16513 PyObject* exc_type = PyErr_Occurred();
16515 if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
16516 else __PYX_ERR(0, 964, __pyx_L1_error)
16520 __Pyx_GOTREF(__pyx_t_2);
16522 __Pyx_XDECREF_SET(__pyx_v_eOffset, __pyx_t_2);
16532 __pyx_v_nb_el = (__pyx_v_nb_el + 1);
16541 __pyx_t_12 = __Pyx_PyIndex_AsSsize_t(__pyx_v_eOffset);
if (unlikely((__pyx_t_12 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 967, __pyx_L1_error)
16542 __pyx_t_10 = __pyx_t_12;
16543 if (__pyx_t_10 < 0) __pyx_t_10 += __pyx_v_nodeElementsArray.shape[0];
16544 __pyx_t_13 = (*((
int *) ( (__pyx_v_nodeElementsArray.data + __pyx_t_10 * __pyx_v_nodeElementsArray.strides[0]) )));
16545 if (__pyx_t_13 < 0) __pyx_t_13 += __pyx_v_scalars.shape[0];
16546 __pyx_v_var_sum = (__pyx_v_var_sum + (*((
double *) ( (__pyx_v_scalars.data + __pyx_t_13 * __pyx_v_scalars.strides[0]) ))));
16556 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
16565 __pyx_t_9 = __Pyx_PyIndex_AsSsize_t(__pyx_v_node);
if (unlikely((__pyx_t_9 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 968, __pyx_L1_error)
16566 __pyx_t_10 = __pyx_t_9;
16567 if (__pyx_t_10 < 0) __pyx_t_10 += __pyx_v_recovered_scalars.shape[0];
16568 *((
double *) ( (__pyx_v_recovered_scalars.data + __pyx_t_10 * __pyx_v_recovered_scalars.strides[0]) )) = (__pyx_v_var_sum / __pyx_v_nb_el);
16578 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
16587 __PYX_INC_MEMVIEW(&__pyx_v_recovered_scalars, 0);
16588 __pyx_r = __pyx_v_recovered_scalars;
16601 __Pyx_XDECREF(__pyx_t_1);
16602 __Pyx_XDECREF(__pyx_t_2);
16603 __Pyx_XDECREF(__pyx_t_3);
16604 __Pyx_XDECREF(__pyx_t_5);
16605 __PYX_XDEC_MEMVIEW(&__pyx_t_6, 1);
16606 __pyx_r.data = NULL;
16607 __pyx_r.memview = NULL;
16608 __Pyx_AddTraceback(
"mprans.cMoveMeshMonitor.cppRecoveryAtNodes", __pyx_clineno, __pyx_lineno, __pyx_filename);
16611 if (unlikely(!__pyx_r.memview)) {
16612 PyErr_SetString(PyExc_TypeError,
"Memoryview return value is not initialized");
16615 __PYX_XDEC_MEMVIEW(&__pyx_v_recovered_scalars, 1);
16616 __Pyx_XDECREF(__pyx_v_node);
16617 __Pyx_XDECREF(__pyx_v_eOffset);
16618 __Pyx_RefNannyFinishContext();
16631 static PyObject *__pyx_pw_6mprans_16cMoveMeshMonitor_3recoveryAtNodesWeighted(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
16632 static PyMethodDef __pyx_mdef_6mprans_16cMoveMeshMonitor_3recoveryAtNodesWeighted = {
"recoveryAtNodesWeighted", (PyCFunction)(
void*)(PyCFunctionWithKeywords)__pyx_pw_6mprans_16cMoveMeshMonitor_3recoveryAtNodesWeighted, METH_VARARGS|METH_KEYWORDS, 0};
16633 static PyObject *__pyx_pw_6mprans_16cMoveMeshMonitor_3recoveryAtNodesWeighted(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
16634 __Pyx_memviewslice __pyx_v_scalars = { 0, 0, { 0 }, { 0 }, { 0 } };
16635 __Pyx_memviewslice __pyx_v_nodeElementsArray = { 0, 0, { 0 }, { 0 }, { 0 } };
16636 __Pyx_memviewslice __pyx_v_nodeElementOffsets = { 0, 0, { 0 }, { 0 }, { 0 } };
16637 __Pyx_memviewslice __pyx_v_detJ_array = { 0, 0, { 0 }, { 0 }, { 0 } };
16638 int __pyx_v_nNodes;
16639 int __pyx_lineno = 0;
16640 const char *__pyx_filename = NULL;
16641 int __pyx_clineno = 0;
16642 PyObject *__pyx_r = 0;
16643 __Pyx_RefNannyDeclarations
16644 __Pyx_RefNannySetupContext(
"recoveryAtNodesWeighted (wrapper)", 0);
16646 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_scalars,&__pyx_n_s_nodeElementsArray,&__pyx_n_s_nodeElementOffsets,&__pyx_n_s_detJ_array,&__pyx_n_s_nNodes,0};
16647 PyObject* values[5] = {0,0,0,0,0};
16648 if (unlikely(__pyx_kwds)) {
16649 Py_ssize_t kw_args;
16650 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
16651 switch (pos_args) {
16652 case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
16653 CYTHON_FALLTHROUGH;
16654 case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
16655 CYTHON_FALLTHROUGH;
16656 case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
16657 CYTHON_FALLTHROUGH;
16658 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
16659 CYTHON_FALLTHROUGH;
16660 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
16661 CYTHON_FALLTHROUGH;
16663 default:
goto __pyx_L5_argtuple_error;
16665 kw_args = PyDict_Size(__pyx_kwds);
16666 switch (pos_args) {
16668 if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_scalars)) != 0)) kw_args--;
16669 else goto __pyx_L5_argtuple_error;
16670 CYTHON_FALLTHROUGH;
16672 if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_nodeElementsArray)) != 0)) kw_args--;
16674 __Pyx_RaiseArgtupleInvalid(
"recoveryAtNodesWeighted", 1, 5, 5, 1); __PYX_ERR(0, 971, __pyx_L3_error)
16676 CYTHON_FALLTHROUGH;
16678 if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_nodeElementOffsets)) != 0)) kw_args--;
16680 __Pyx_RaiseArgtupleInvalid(
"recoveryAtNodesWeighted", 1, 5, 5, 2); __PYX_ERR(0, 971, __pyx_L3_error)
16682 CYTHON_FALLTHROUGH;
16684 if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_detJ_array)) != 0)) kw_args--;
16686 __Pyx_RaiseArgtupleInvalid(
"recoveryAtNodesWeighted", 1, 5, 5, 3); __PYX_ERR(0, 971, __pyx_L3_error)
16688 CYTHON_FALLTHROUGH;
16690 if (likely((values[4] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_nNodes)) != 0)) kw_args--;
16692 __Pyx_RaiseArgtupleInvalid(
"recoveryAtNodesWeighted", 1, 5, 5, 4); __PYX_ERR(0, 971, __pyx_L3_error)
16695 if (unlikely(kw_args > 0)) {
16696 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args,
"recoveryAtNodesWeighted") < 0)) __PYX_ERR(0, 971, __pyx_L3_error)
16698 }
else if (PyTuple_GET_SIZE(__pyx_args) != 5) {
16699 goto __pyx_L5_argtuple_error;
16701 values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
16702 values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
16703 values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
16704 values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
16705 values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
16707 __pyx_v_scalars = __Pyx_PyObject_to_MemoryviewSlice_ds_double(values[0], PyBUF_WRITABLE);
if (unlikely(!__pyx_v_scalars.memview)) __PYX_ERR(0, 971, __pyx_L3_error)
16708 __pyx_v_nodeElementsArray = __Pyx_PyObject_to_MemoryviewSlice_ds_int(values[1], PyBUF_WRITABLE);
if (unlikely(!__pyx_v_nodeElementsArray.memview)) __PYX_ERR(0, 972, __pyx_L3_error)
16709 __pyx_v_nodeElementOffsets = __Pyx_PyObject_to_MemoryviewSlice_ds_int(values[2], PyBUF_WRITABLE);
if (unlikely(!__pyx_v_nodeElementOffsets.memview)) __PYX_ERR(0, 973, __pyx_L3_error)
16710 __pyx_v_detJ_array = __Pyx_PyObject_to_MemoryviewSlice_ds_double(values[3], PyBUF_WRITABLE);
if (unlikely(!__pyx_v_detJ_array.memview)) __PYX_ERR(0, 974, __pyx_L3_error)
16711 __pyx_v_nNodes = __Pyx_PyInt_As_int(values[4]);
if (unlikely((__pyx_v_nNodes == (
int)-1) && PyErr_Occurred())) __PYX_ERR(0, 975, __pyx_L3_error)
16713 goto __pyx_L4_argument_unpacking_done;
16714 __pyx_L5_argtuple_error:;
16715 __Pyx_RaiseArgtupleInvalid(
"recoveryAtNodesWeighted", 1, 5, 5, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 971, __pyx_L3_error)
16717 __Pyx_AddTraceback(
"mprans.cMoveMeshMonitor.recoveryAtNodesWeighted", __pyx_clineno, __pyx_lineno, __pyx_filename);
16718 __Pyx_RefNannyFinishContext();
16720 __pyx_L4_argument_unpacking_done:;
16721 __pyx_r = __pyx_pf_6mprans_16cMoveMeshMonitor_2recoveryAtNodesWeighted(__pyx_self, __pyx_v_scalars, __pyx_v_nodeElementsArray, __pyx_v_nodeElementOffsets, __pyx_v_detJ_array, __pyx_v_nNodes);
16724 __Pyx_RefNannyFinishContext();
16728 static PyObject *__pyx_pf_6mprans_16cMoveMeshMonitor_2recoveryAtNodesWeighted(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_scalars, __Pyx_memviewslice __pyx_v_nodeElementsArray, __Pyx_memviewslice __pyx_v_nodeElementOffsets, __Pyx_memviewslice __pyx_v_detJ_array,
int __pyx_v_nNodes) {
16729 PyObject *__pyx_r = NULL;
16730 __Pyx_RefNannyDeclarations
16731 __Pyx_memviewslice __pyx_t_1 = { 0, 0, { 0 }, { 0 }, { 0 } };
16732 PyObject *__pyx_t_2 = NULL;
16733 int __pyx_lineno = 0;
16734 const char *__pyx_filename = NULL;
16735 int __pyx_clineno = 0;
16736 __Pyx_RefNannySetupContext(
"recoveryAtNodesWeighted", 0);
16745 __Pyx_XDECREF(__pyx_r);
16754 __pyx_t_1 = __pyx_f_6mprans_16cMoveMeshMonitor_cppRecoveryAtNodesWeighted(__pyx_v_scalars, __pyx_v_nodeElementsArray, __pyx_v_nodeElementOffsets, __pyx_v_detJ_array, __pyx_v_nNodes);
if (unlikely(!__pyx_t_1.memview)) __PYX_ERR(0, 976, __pyx_L1_error)
16763 __pyx_t_2 = __pyx_memoryview_fromslice(__pyx_t_1, 1, (PyObject *(*)(
char *)) __pyx_memview_get_double, (
int (*)(
char *, PyObject *)) __pyx_memview_set_double, 0);;
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 976, __pyx_L1_error)
16764 __Pyx_GOTREF(__pyx_t_2);
16765 __PYX_XDEC_MEMVIEW(&__pyx_t_1, 1);
16766 __pyx_t_1.memview = NULL;
16767 __pyx_t_1.data = NULL;
16768 __pyx_r = __pyx_t_2;
16782 __PYX_XDEC_MEMVIEW(&__pyx_t_1, 1);
16783 __Pyx_XDECREF(__pyx_t_2);
16784 __Pyx_AddTraceback(
"mprans.cMoveMeshMonitor.recoveryAtNodesWeighted", __pyx_clineno, __pyx_lineno, __pyx_filename);
16787 __PYX_XDEC_MEMVIEW(&__pyx_v_scalars, 1);
16788 __PYX_XDEC_MEMVIEW(&__pyx_v_nodeElementsArray, 1);
16789 __PYX_XDEC_MEMVIEW(&__pyx_v_nodeElementOffsets, 1);
16790 __PYX_XDEC_MEMVIEW(&__pyx_v_detJ_array, 1);
16791 __Pyx_XGIVEREF(__pyx_r);
16792 __Pyx_RefNannyFinishContext();
16804 static __Pyx_memviewslice __pyx_f_6mprans_16cMoveMeshMonitor_cppRecoveryAtNodesWeighted(__Pyx_memviewslice __pyx_v_scalars, __Pyx_memviewslice __pyx_v_nodeElementsArray, __Pyx_memviewslice __pyx_v_nodeElementOffsets, __Pyx_memviewslice __pyx_v_detJ_array,
int __pyx_v_nNodes) {
16805 __Pyx_memviewslice __pyx_v_recovered_scalars = { 0, 0, { 0 }, { 0 }, { 0 } };
16807 double __pyx_v_detJ_patch;
16808 double __pyx_v_scalar_sum;
16810 int __pyx_v_eOffset;
16812 __Pyx_memviewslice __pyx_r = { 0, 0, { 0 }, { 0 }, { 0 } };
16813 __Pyx_RefNannyDeclarations
16814 PyObject *__pyx_t_1 = NULL;
16815 PyObject *__pyx_t_2 = NULL;
16816 PyObject *__pyx_t_3 = NULL;
16817 PyObject *__pyx_t_4 = NULL;
16818 __Pyx_memviewslice __pyx_t_5 = { 0, 0, { 0 }, { 0 }, { 0 } };
16822 Py_ssize_t __pyx_t_9;
16826 Py_ssize_t __pyx_t_13;
16827 Py_ssize_t __pyx_t_14;
16828 int __pyx_lineno = 0;
16829 const char *__pyx_filename = NULL;
16830 int __pyx_clineno = 0;
16831 __Pyx_RefNannySetupContext(
"cppRecoveryAtNodesWeighted", 0);
16840 __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_np);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 987, __pyx_L1_error)
16841 __Pyx_GOTREF(__pyx_t_2);
16842 __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_zeros);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 987, __pyx_L1_error)
16843 __Pyx_GOTREF(__pyx_t_3);
16844 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
16845 __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_nNodes);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 987, __pyx_L1_error)
16846 __Pyx_GOTREF(__pyx_t_2);
16848 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
16849 __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
16850 if (likely(__pyx_t_4)) {
16851 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_3);
16852 __Pyx_INCREF(__pyx_t_4);
16853 __Pyx_INCREF(
function);
16854 __Pyx_DECREF_SET(__pyx_t_3,
function);
16857 __pyx_t_1 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_4, __pyx_t_2) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_2);
16858 __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
16859 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
16860 if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 987, __pyx_L1_error)
16861 __Pyx_GOTREF(__pyx_t_1);
16862 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
16863 __pyx_t_5 = __Pyx_PyObject_to_MemoryviewSlice_ds_double(__pyx_t_1, PyBUF_WRITABLE);
if (unlikely(!__pyx_t_5.memview)) __PYX_ERR(0, 987, __pyx_L1_error)
16864 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
16865 __pyx_v_recovered_scalars = __pyx_t_5;
16866 __pyx_t_5.memview = NULL;
16867 __pyx_t_5.data = NULL;
16876 __pyx_v_detJ_patch = 0.;
16885 __pyx_v_scalar_sum = 0.;
16894 __pyx_t_6 = __pyx_v_nNodes;
16895 __pyx_t_7 = __pyx_t_6;
16896 for (__pyx_t_8 = 0; __pyx_t_8 < __pyx_t_7; __pyx_t_8+=1) {
16897 __pyx_v_node = __pyx_t_8;
16915 __pyx_v_detJ_patch = 0.;
16924 __pyx_v_scalar_sum = 0.;
16933 __pyx_t_9 = (__pyx_v_node + 1);
16934 if (__pyx_t_9 < 0) __pyx_t_9 += __pyx_v_nodeElementOffsets.shape[0];
16935 __pyx_t_10 = (*((
int *) ( (__pyx_v_nodeElementOffsets.data + __pyx_t_9 * __pyx_v_nodeElementOffsets.strides[0]) )));
16944 __pyx_t_9 = __pyx_v_node;
16945 if (__pyx_t_9 < 0) __pyx_t_9 += __pyx_v_nodeElementOffsets.shape[0];
16954 __pyx_t_11 = __pyx_t_10;
16955 for (__pyx_t_12 = (*((
int *) ( (__pyx_v_nodeElementOffsets.data + __pyx_t_9 * __pyx_v_nodeElementOffsets.strides[0]) ))); __pyx_t_12 < __pyx_t_11; __pyx_t_12+=1) {
16964 __pyx_v_eOffset = __pyx_t_12;
16973 __pyx_v_nb_el = (__pyx_v_nb_el + 1);
16982 __pyx_t_13 = __pyx_v_eOffset;
16983 if (__pyx_t_13 < 0) __pyx_t_13 += __pyx_v_nodeElementsArray.shape[0];
16984 __pyx_v_eN = (*((
int *) ( (__pyx_v_nodeElementsArray.data + __pyx_t_13 * __pyx_v_nodeElementsArray.strides[0]) )));
16993 __pyx_t_13 = __pyx_v_eN;
16994 if (__pyx_t_13 < 0) __pyx_t_13 += __pyx_v_detJ_array.shape[0];
16995 __pyx_v_detJ_patch = (__pyx_v_detJ_patch + (*((
double *) ( (__pyx_v_detJ_array.data + __pyx_t_13 * __pyx_v_detJ_array.strides[0]) ))));
17004 __pyx_t_13 = __pyx_v_eN;
17005 if (__pyx_t_13 < 0) __pyx_t_13 += __pyx_v_detJ_array.shape[0];
17006 __pyx_t_14 = __pyx_v_eN;
17007 if (__pyx_t_14 < 0) __pyx_t_14 += __pyx_v_scalars.shape[0];
17008 __pyx_v_scalar_sum = (__pyx_v_scalar_sum + ((*((
double *) ( (__pyx_v_detJ_array.data + __pyx_t_13 * __pyx_v_detJ_array.strides[0]) ))) * (*((
double *) ( (__pyx_v_scalars.data + __pyx_t_14 * __pyx_v_scalars.strides[0]) )))));
17018 __pyx_t_9 = __pyx_v_node;
17019 if (__pyx_t_9 < 0) __pyx_t_9 += __pyx_v_recovered_scalars.shape[0];
17020 *((
double *) ( (__pyx_v_recovered_scalars.data + __pyx_t_9 * __pyx_v_recovered_scalars.strides[0]) )) = (__pyx_v_scalar_sum / __pyx_v_detJ_patch);
17030 __PYX_INC_MEMVIEW(&__pyx_v_recovered_scalars, 0);
17031 __pyx_r = __pyx_v_recovered_scalars;
17044 __Pyx_XDECREF(__pyx_t_1);
17045 __Pyx_XDECREF(__pyx_t_2);
17046 __Pyx_XDECREF(__pyx_t_3);
17047 __Pyx_XDECREF(__pyx_t_4);
17048 __PYX_XDEC_MEMVIEW(&__pyx_t_5, 1);
17049 __pyx_r.data = NULL;
17050 __pyx_r.memview = NULL;
17051 __Pyx_AddTraceback(
"mprans.cMoveMeshMonitor.cppRecoveryAtNodesWeighted", __pyx_clineno, __pyx_lineno, __pyx_filename);
17054 if (unlikely(!__pyx_r.memview)) {
17055 PyErr_SetString(PyExc_TypeError,
"Memoryview return value is not initialized");
17058 __PYX_XDEC_MEMVIEW(&__pyx_v_recovered_scalars, 1);
17059 __Pyx_RefNannyFinishContext();
17072 static PyObject *__pyx_pw_6mprans_16cMoveMeshMonitor_5gradientRecoveryAtNodes(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
17073 static PyMethodDef __pyx_mdef_6mprans_16cMoveMeshMonitor_5gradientRecoveryAtNodes = {
"gradientRecoveryAtNodes", (PyCFunction)(
void*)(PyCFunctionWithKeywords)__pyx_pw_6mprans_16cMoveMeshMonitor_5gradientRecoveryAtNodes, METH_VARARGS|METH_KEYWORDS, 0};
17074 static PyObject *__pyx_pw_6mprans_16cMoveMeshMonitor_5gradientRecoveryAtNodes(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
17075 PyObject *__pyx_v_grads = 0;
17076 PyObject *__pyx_v_nodeElementsArray = 0;
17077 PyObject *__pyx_v_nodeElementOffsets = 0;
17078 PyObject *__pyx_v_nd = 0;
17079 int __pyx_lineno = 0;
17080 const char *__pyx_filename = NULL;
17081 int __pyx_clineno = 0;
17082 PyObject *__pyx_r = 0;
17083 __Pyx_RefNannyDeclarations
17084 __Pyx_RefNannySetupContext(
"gradientRecoveryAtNodes (wrapper)", 0);
17086 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_grads,&__pyx_n_s_nodeElementsArray,&__pyx_n_s_nodeElementOffsets,&__pyx_n_s_nd,0};
17087 PyObject* values[4] = {0,0,0,0};
17088 if (unlikely(__pyx_kwds)) {
17089 Py_ssize_t kw_args;
17090 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
17091 switch (pos_args) {
17092 case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
17093 CYTHON_FALLTHROUGH;
17094 case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
17095 CYTHON_FALLTHROUGH;
17096 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
17097 CYTHON_FALLTHROUGH;
17098 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
17099 CYTHON_FALLTHROUGH;
17101 default:
goto __pyx_L5_argtuple_error;
17103 kw_args = PyDict_Size(__pyx_kwds);
17104 switch (pos_args) {
17106 if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_grads)) != 0)) kw_args--;
17107 else goto __pyx_L5_argtuple_error;
17108 CYTHON_FALLTHROUGH;
17110 if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_nodeElementsArray)) != 0)) kw_args--;
17112 __Pyx_RaiseArgtupleInvalid(
"gradientRecoveryAtNodes", 1, 4, 4, 1); __PYX_ERR(0, 1012, __pyx_L3_error)
17114 CYTHON_FALLTHROUGH;
17116 if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_nodeElementOffsets)) != 0)) kw_args--;
17118 __Pyx_RaiseArgtupleInvalid(
"gradientRecoveryAtNodes", 1, 4, 4, 2); __PYX_ERR(0, 1012, __pyx_L3_error)
17120 CYTHON_FALLTHROUGH;
17122 if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_nd)) != 0)) kw_args--;
17124 __Pyx_RaiseArgtupleInvalid(
"gradientRecoveryAtNodes", 1, 4, 4, 3); __PYX_ERR(0, 1012, __pyx_L3_error)
17127 if (unlikely(kw_args > 0)) {
17128 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args,
"gradientRecoveryAtNodes") < 0)) __PYX_ERR(0, 1012, __pyx_L3_error)
17130 }
else if (PyTuple_GET_SIZE(__pyx_args) != 4) {
17131 goto __pyx_L5_argtuple_error;
17133 values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
17134 values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
17135 values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
17136 values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
17138 __pyx_v_grads = values[0];
17139 __pyx_v_nodeElementsArray = values[1];
17140 __pyx_v_nodeElementOffsets = values[2];
17141 __pyx_v_nd = values[3];
17143 goto __pyx_L4_argument_unpacking_done;
17144 __pyx_L5_argtuple_error:;
17145 __Pyx_RaiseArgtupleInvalid(
"gradientRecoveryAtNodes", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1012, __pyx_L3_error)
17147 __Pyx_AddTraceback(
"mprans.cMoveMeshMonitor.gradientRecoveryAtNodes", __pyx_clineno, __pyx_lineno, __pyx_filename);
17148 __Pyx_RefNannyFinishContext();
17150 __pyx_L4_argument_unpacking_done:;
17151 __pyx_r = __pyx_pf_6mprans_16cMoveMeshMonitor_4gradientRecoveryAtNodes(__pyx_self, __pyx_v_grads, __pyx_v_nodeElementsArray, __pyx_v_nodeElementOffsets, __pyx_v_nd);
17154 __Pyx_RefNannyFinishContext();
17158 static PyObject *__pyx_pf_6mprans_16cMoveMeshMonitor_4gradientRecoveryAtNodes(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_grads, PyObject *__pyx_v_nodeElementsArray, PyObject *__pyx_v_nodeElementOffsets, PyObject *__pyx_v_nd) {
17159 PyObject *__pyx_r = NULL;
17160 __Pyx_RefNannyDeclarations
17161 __Pyx_memviewslice __pyx_t_1 = { 0, 0, { 0 }, { 0 }, { 0 } };
17162 __Pyx_memviewslice __pyx_t_2 = { 0, 0, { 0 }, { 0 }, { 0 } };
17163 __Pyx_memviewslice __pyx_t_3 = { 0, 0, { 0 }, { 0 }, { 0 } };
17165 __Pyx_memviewslice __pyx_t_5 = { 0, 0, { 0 }, { 0 }, { 0 } };
17166 PyObject *__pyx_t_6 = NULL;
17167 int __pyx_lineno = 0;
17168 const char *__pyx_filename = NULL;
17169 int __pyx_clineno = 0;
17170 __Pyx_RefNannySetupContext(
"gradientRecoveryAtNodes", 0);
17179 __Pyx_XDECREF(__pyx_r);
17180 __pyx_t_1 = __Pyx_PyObject_to_MemoryviewSlice_dsdsds_double(__pyx_v_grads, PyBUF_WRITABLE);
if (unlikely(!__pyx_t_1.memview)) __PYX_ERR(0, 1016, __pyx_L1_error)
17189 __pyx_t_2 = __Pyx_PyObject_to_MemoryviewSlice_ds_int(__pyx_v_nodeElementsArray, PyBUF_WRITABLE);
if (unlikely(!__pyx_t_2.memview)) __PYX_ERR(0, 1017, __pyx_L1_error)
17198 __pyx_t_3 = __Pyx_PyObject_to_MemoryviewSlice_ds_int(__pyx_v_nodeElementOffsets, PyBUF_WRITABLE);
if (unlikely(!__pyx_t_3.memview)) __PYX_ERR(0, 1018, __pyx_L1_error)
17207 __pyx_t_4 = __Pyx_PyInt_As_int(__pyx_v_nd);
if (unlikely((__pyx_t_4 == (
int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1019, __pyx_L1_error)
17216 __pyx_t_5 = __pyx_f_6mprans_16cMoveMeshMonitor_cppGradientRecoveryAtNodes(__pyx_t_1, __pyx_t_2, __pyx_t_3, __pyx_t_4);
if (unlikely(!__pyx_t_5.memview)) __PYX_ERR(0, 1016, __pyx_L1_error)
17217 __PYX_XDEC_MEMVIEW(&__pyx_t_1, 1);
17218 __pyx_t_1.memview = NULL;
17219 __pyx_t_1.data = NULL;
17220 __PYX_XDEC_MEMVIEW(&__pyx_t_2, 1);
17221 __pyx_t_2.memview = NULL;
17222 __pyx_t_2.data = NULL;
17223 __PYX_XDEC_MEMVIEW(&__pyx_t_3, 1);
17224 __pyx_t_3.memview = NULL;
17225 __pyx_t_3.data = NULL;
17226 __pyx_t_6 = __pyx_memoryview_fromslice(__pyx_t_5, 2, (PyObject *(*)(
char *)) __pyx_memview_get_double, (
int (*)(
char *, PyObject *)) __pyx_memview_set_double, 0);;
if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1016, __pyx_L1_error)
17227 __Pyx_GOTREF(__pyx_t_6);
17228 __PYX_XDEC_MEMVIEW(&__pyx_t_5, 1);
17229 __pyx_t_5.memview = NULL;
17230 __pyx_t_5.data = NULL;
17231 __pyx_r = __pyx_t_6;
17245 __PYX_XDEC_MEMVIEW(&__pyx_t_1, 1);
17246 __PYX_XDEC_MEMVIEW(&__pyx_t_2, 1);
17247 __PYX_XDEC_MEMVIEW(&__pyx_t_3, 1);
17248 __PYX_XDEC_MEMVIEW(&__pyx_t_5, 1);
17249 __Pyx_XDECREF(__pyx_t_6);
17250 __Pyx_AddTraceback(
"mprans.cMoveMeshMonitor.gradientRecoveryAtNodes", __pyx_clineno, __pyx_lineno, __pyx_filename);
17253 __Pyx_XGIVEREF(__pyx_r);
17254 __Pyx_RefNannyFinishContext();
17266 static __Pyx_memviewslice __pyx_f_6mprans_16cMoveMeshMonitor_cppGradientRecoveryAtNodes(__Pyx_memviewslice __pyx_v_grads, __Pyx_memviewslice __pyx_v_nodeElementsArray, __Pyx_memviewslice __pyx_v_nodeElementOffsets,
int __pyx_v_nd) {
17267 __Pyx_memviewslice __pyx_v_recovered_grads = { 0, 0, { 0 }, { 0 }, { 0 } };
17269 __Pyx_memviewslice __pyx_v_grad_sum = { 0, 0, { 0 }, { 0 }, { 0 } };
17270 PyObject *__pyx_v_node = NULL;
17272 PyObject *__pyx_v_eOffset = NULL;
17273 PyObject *__pyx_v_eN = NULL;
17274 __Pyx_memviewslice __pyx_r = { 0, 0, { 0 }, { 0 }, { 0 } };
17275 __Pyx_RefNannyDeclarations
17276 PyObject *__pyx_t_1 = NULL;
17277 PyObject *__pyx_t_2 = NULL;
17278 PyObject *__pyx_t_3 = NULL;
17280 PyObject *__pyx_t_5 = NULL;
17281 PyObject *__pyx_t_6 = NULL;
17282 __Pyx_memviewslice __pyx_t_7 = { 0, 0, { 0 }, { 0 }, { 0 } };
17283 __Pyx_memviewslice __pyx_t_8 = { 0, 0, { 0 }, { 0 }, { 0 } };
17284 Py_ssize_t __pyx_t_9;
17285 PyObject *(*__pyx_t_10)(PyObject *);
17289 Py_ssize_t __pyx_t_14;
17290 Py_ssize_t __pyx_t_15;
17291 PyObject *(*__pyx_t_16)(PyObject *);
17292 Py_ssize_t __pyx_t_17;
17293 Py_ssize_t __pyx_t_18;
17294 Py_ssize_t __pyx_t_19;
17295 Py_ssize_t __pyx_t_20;
17296 int __pyx_lineno = 0;
17297 const char *__pyx_filename = NULL;
17298 int __pyx_clineno = 0;
17299 __Pyx_RefNannySetupContext(
"cppGradientRecoveryAtNodes", 0);
17308 __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_np);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1025, __pyx_L1_error)
17309 __Pyx_GOTREF(__pyx_t_2);
17310 __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_zeros);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1025, __pyx_L1_error)
17311 __Pyx_GOTREF(__pyx_t_3);
17312 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
17313 __pyx_t_4 = __Pyx_MemoryView_Len(__pyx_v_nodeElementOffsets);
17314 __pyx_t_2 = PyInt_FromSsize_t((__pyx_t_4 - 1));
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1025, __pyx_L1_error)
17315 __Pyx_GOTREF(__pyx_t_2);
17316 __pyx_t_5 = __Pyx_PyInt_From_int(__pyx_v_nd);
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1025, __pyx_L1_error)
17317 __Pyx_GOTREF(__pyx_t_5);
17318 __pyx_t_6 = PyTuple_New(2);
if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1025, __pyx_L1_error)
17319 __Pyx_GOTREF(__pyx_t_6);
17320 __Pyx_GIVEREF(__pyx_t_2);
17321 PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_2);
17322 __Pyx_GIVEREF(__pyx_t_5);
17323 PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_t_5);
17327 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
17328 __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_3);
17329 if (likely(__pyx_t_5)) {
17330 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_3);
17331 __Pyx_INCREF(__pyx_t_5);
17332 __Pyx_INCREF(
function);
17333 __Pyx_DECREF_SET(__pyx_t_3,
function);
17336 __pyx_t_1 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_5, __pyx_t_6) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_6);
17337 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
17338 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
17339 if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1025, __pyx_L1_error)
17340 __Pyx_GOTREF(__pyx_t_1);
17341 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
17342 __pyx_t_7 = __Pyx_PyObject_to_MemoryviewSlice_dsds_double(__pyx_t_1, PyBUF_WRITABLE);
if (unlikely(!__pyx_t_7.memview)) __PYX_ERR(0, 1025, __pyx_L1_error)
17343 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
17344 __pyx_v_recovered_grads = __pyx_t_7;
17345 __pyx_t_7.memview = NULL;
17346 __pyx_t_7.data = NULL;
17355 __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_np);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1027, __pyx_L1_error)
17356 __Pyx_GOTREF(__pyx_t_3);
17357 __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_zeros);
if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1027, __pyx_L1_error)
17358 __Pyx_GOTREF(__pyx_t_6);
17359 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
17360 __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_nd);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1027, __pyx_L1_error)
17361 __Pyx_GOTREF(__pyx_t_3);
17363 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_6))) {
17364 __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_6);
17365 if (likely(__pyx_t_5)) {
17366 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_6);
17367 __Pyx_INCREF(__pyx_t_5);
17368 __Pyx_INCREF(
function);
17369 __Pyx_DECREF_SET(__pyx_t_6,
function);
17372 __pyx_t_1 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_6, __pyx_t_5, __pyx_t_3) : __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_t_3);
17373 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
17374 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
17375 if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1027, __pyx_L1_error)
17376 __Pyx_GOTREF(__pyx_t_1);
17377 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
17378 __pyx_t_8 = __Pyx_PyObject_to_MemoryviewSlice_ds_double(__pyx_t_1, PyBUF_WRITABLE);
if (unlikely(!__pyx_t_8.memview)) __PYX_ERR(0, 1027, __pyx_L1_error)
17379 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
17380 __pyx_v_grad_sum = __pyx_t_8;
17381 __pyx_t_8.memview = NULL;
17382 __pyx_t_8.data = NULL;
17391 __pyx_t_4 = __Pyx_MemoryView_Len(__pyx_v_nodeElementOffsets);
17392 __pyx_t_1 = PyInt_FromSsize_t((__pyx_t_4 - 1));
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1028, __pyx_L1_error)
17393 __Pyx_GOTREF(__pyx_t_1);
17394 __pyx_t_6 = __Pyx_PyObject_CallOneArg(__pyx_builtin_range, __pyx_t_1);
if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1028, __pyx_L1_error)
17395 __Pyx_GOTREF(__pyx_t_6);
17396 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
17397 if (likely(PyList_CheckExact(__pyx_t_6)) || PyTuple_CheckExact(__pyx_t_6)) {
17398 __pyx_t_1 = __pyx_t_6; __Pyx_INCREF(__pyx_t_1); __pyx_t_9 = 0;
17401 __pyx_t_9 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_t_6);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1028, __pyx_L1_error)
17402 __Pyx_GOTREF(__pyx_t_1);
17403 __pyx_t_10 = Py_TYPE(__pyx_t_1)->tp_iternext;
if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1028, __pyx_L1_error)
17405 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
17407 if (likely(!__pyx_t_10)) {
17408 if (likely(PyList_CheckExact(__pyx_t_1))) {
17409 if (__pyx_t_9 >= PyList_GET_SIZE(__pyx_t_1))
break;
17410 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
17411 __pyx_t_6 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_9); __Pyx_INCREF(__pyx_t_6); __pyx_t_9++;
if (unlikely(0 < 0)) __PYX_ERR(0, 1028, __pyx_L1_error)
17413 __pyx_t_6 = PySequence_ITEM(__pyx_t_1, __pyx_t_9); __pyx_t_9++;
if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1028, __pyx_L1_error)
17414 __Pyx_GOTREF(__pyx_t_6);
17417 if (__pyx_t_9 >= PyTuple_GET_SIZE(__pyx_t_1))
break;
17418 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
17419 __pyx_t_6 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_9); __Pyx_INCREF(__pyx_t_6); __pyx_t_9++;
if (unlikely(0 < 0)) __PYX_ERR(0, 1028, __pyx_L1_error)
17421 __pyx_t_6 = PySequence_ITEM(__pyx_t_1, __pyx_t_9); __pyx_t_9++;
if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1028, __pyx_L1_error)
17422 __Pyx_GOTREF(__pyx_t_6);
17426 __pyx_t_6 = __pyx_t_10(__pyx_t_1);
17427 if (unlikely(!__pyx_t_6)) {
17428 PyObject* exc_type = PyErr_Occurred();
17430 if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
17431 else __PYX_ERR(0, 1028, __pyx_L1_error)
17435 __Pyx_GOTREF(__pyx_t_6);
17437 __Pyx_XDECREF_SET(__pyx_v_node, __pyx_t_6);
17456 __pyx_t_11 = __pyx_v_nd;
17457 __pyx_t_12 = __pyx_t_11;
17458 for (__pyx_t_13 = 0; __pyx_t_13 < __pyx_t_12; __pyx_t_13+=1) {
17459 __pyx_v_ndi = __pyx_t_13;
17468 __pyx_t_14 = __pyx_v_ndi;
17469 if (__pyx_t_14 < 0) __pyx_t_14 += __pyx_v_grad_sum.shape[0];
17470 *((
double *) ( (__pyx_v_grad_sum.data + __pyx_t_14 * __pyx_v_grad_sum.strides[0]) )) = 0.;
17480 __pyx_t_15 = __Pyx_PyIndex_AsSsize_t(__pyx_v_node);
if (unlikely((__pyx_t_15 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1032, __pyx_L1_error)
17481 __pyx_t_14 = __pyx_t_15;
17482 if (__pyx_t_14 < 0) __pyx_t_14 += __pyx_v_nodeElementOffsets.shape[0];
17483 __pyx_t_6 = __Pyx_PyInt_From_int((*((
int *) ( (__pyx_v_nodeElementOffsets.data + __pyx_t_14 * __pyx_v_nodeElementOffsets.strides[0]) ))));
if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1032, __pyx_L1_error)
17484 __Pyx_GOTREF(__pyx_t_6);
17493 __pyx_t_3 = __Pyx_PyInt_AddObjC(__pyx_v_node, __pyx_int_1, 1, 0, 0);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1033, __pyx_L1_error)
17494 __Pyx_GOTREF(__pyx_t_3);
17495 __pyx_t_15 = __Pyx_PyIndex_AsSsize_t(__pyx_t_3);
if (unlikely((__pyx_t_15 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1033, __pyx_L1_error)
17496 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
17497 __pyx_t_14 = __pyx_t_15;
17498 if (__pyx_t_14 < 0) __pyx_t_14 += __pyx_v_nodeElementOffsets.shape[0];
17499 __pyx_t_3 = __Pyx_PyInt_From_int((*((
int *) ( (__pyx_v_nodeElementOffsets.data + __pyx_t_14 * __pyx_v_nodeElementOffsets.strides[0]) ))));
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1033, __pyx_L1_error)
17500 __Pyx_GOTREF(__pyx_t_3);
17509 __pyx_t_5 = PyTuple_New(2);
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1032, __pyx_L1_error)
17510 __Pyx_GOTREF(__pyx_t_5);
17511 __Pyx_GIVEREF(__pyx_t_6);
17512 PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_6);
17513 __Pyx_GIVEREF(__pyx_t_3);
17514 PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_3);
17517 __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_range, __pyx_t_5, NULL);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1032, __pyx_L1_error)
17518 __Pyx_GOTREF(__pyx_t_3);
17519 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
17520 if (likely(PyList_CheckExact(__pyx_t_3)) || PyTuple_CheckExact(__pyx_t_3)) {
17521 __pyx_t_5 = __pyx_t_3; __Pyx_INCREF(__pyx_t_5); __pyx_t_15 = 0;
17524 __pyx_t_15 = -1; __pyx_t_5 = PyObject_GetIter(__pyx_t_3);
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1032, __pyx_L1_error)
17525 __Pyx_GOTREF(__pyx_t_5);
17526 __pyx_t_16 = Py_TYPE(__pyx_t_5)->tp_iternext;
if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 1032, __pyx_L1_error)
17528 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
17530 if (likely(!__pyx_t_16)) {
17531 if (likely(PyList_CheckExact(__pyx_t_5))) {
17532 if (__pyx_t_15 >= PyList_GET_SIZE(__pyx_t_5))
break;
17533 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
17534 __pyx_t_3 = PyList_GET_ITEM(__pyx_t_5, __pyx_t_15); __Pyx_INCREF(__pyx_t_3); __pyx_t_15++;
if (unlikely(0 < 0)) __PYX_ERR(0, 1032, __pyx_L1_error)
17536 __pyx_t_3 = PySequence_ITEM(__pyx_t_5, __pyx_t_15); __pyx_t_15++;
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1032, __pyx_L1_error)
17537 __Pyx_GOTREF(__pyx_t_3);
17540 if (__pyx_t_15 >= PyTuple_GET_SIZE(__pyx_t_5))
break;
17541 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
17542 __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_5, __pyx_t_15); __Pyx_INCREF(__pyx_t_3); __pyx_t_15++;
if (unlikely(0 < 0)) __PYX_ERR(0, 1032, __pyx_L1_error)
17544 __pyx_t_3 = PySequence_ITEM(__pyx_t_5, __pyx_t_15); __pyx_t_15++;
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1032, __pyx_L1_error)
17545 __Pyx_GOTREF(__pyx_t_3);
17549 __pyx_t_3 = __pyx_t_16(__pyx_t_5);
17550 if (unlikely(!__pyx_t_3)) {
17551 PyObject* exc_type = PyErr_Occurred();
17553 if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
17554 else __PYX_ERR(0, 1032, __pyx_L1_error)
17558 __Pyx_GOTREF(__pyx_t_3);
17560 __Pyx_XDECREF_SET(__pyx_v_eOffset, __pyx_t_3);
17570 __pyx_v_nb_el = (__pyx_v_nb_el + 1);
17579 __pyx_t_17 = __Pyx_PyIndex_AsSsize_t(__pyx_v_eOffset);
if (unlikely((__pyx_t_17 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1035, __pyx_L1_error)
17580 __pyx_t_14 = __pyx_t_17;
17581 if (__pyx_t_14 < 0) __pyx_t_14 += __pyx_v_nodeElementsArray.shape[0];
17582 __pyx_t_3 = __Pyx_PyInt_From_int((*((
int *) ( (__pyx_v_nodeElementsArray.data + __pyx_t_14 * __pyx_v_nodeElementsArray.strides[0]) ))));
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1035, __pyx_L1_error)
17583 __Pyx_GOTREF(__pyx_t_3);
17584 __Pyx_XDECREF_SET(__pyx_v_eN, __pyx_t_3);
17594 __pyx_t_11 = __pyx_v_nd;
17595 __pyx_t_12 = __pyx_t_11;
17596 for (__pyx_t_13 = 0; __pyx_t_13 < __pyx_t_12; __pyx_t_13+=1) {
17597 __pyx_v_ndi = __pyx_t_13;
17606 __pyx_t_17 = __Pyx_PyIndex_AsSsize_t(__pyx_v_eN);
if (unlikely((__pyx_t_17 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1041, __pyx_L1_error)
17607 __pyx_t_14 = __pyx_t_17;
17609 __pyx_t_19 = __pyx_v_ndi;
17610 if (__pyx_t_14 < 0) __pyx_t_14 += __pyx_v_grads.shape[0];
17611 if (__pyx_t_18 < 0) __pyx_t_18 += __pyx_v_grads.shape[1];
17612 if (__pyx_t_19 < 0) __pyx_t_19 += __pyx_v_grads.shape[2];
17613 __pyx_t_20 = __pyx_v_ndi;
17614 if (__pyx_t_20 < 0) __pyx_t_20 += __pyx_v_grad_sum.shape[0];
17615 *((
double *) ( (__pyx_v_grad_sum.data + __pyx_t_20 * __pyx_v_grad_sum.strides[0]) )) += (*((
double *) ( (( (( (__pyx_v_grads.data + __pyx_t_14 * __pyx_v_grads.strides[0]) ) + __pyx_t_18 * __pyx_v_grads.strides[1]) ) + __pyx_t_19 * __pyx_v_grads.strides[2]) )));
17626 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
17635 __pyx_t_11 = __pyx_v_nd;
17636 __pyx_t_12 = __pyx_t_11;
17637 for (__pyx_t_13 = 0; __pyx_t_13 < __pyx_t_12; __pyx_t_13+=1) {
17638 __pyx_v_ndi = __pyx_t_13;
17647 __pyx_t_19 = __pyx_v_ndi;
17648 if (__pyx_t_19 < 0) __pyx_t_19 += __pyx_v_grad_sum.shape[0];
17649 __pyx_t_15 = __Pyx_PyIndex_AsSsize_t(__pyx_v_node);
if (unlikely((__pyx_t_15 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1043, __pyx_L1_error)
17650 __pyx_t_18 = __pyx_t_15;
17651 __pyx_t_14 = __pyx_v_ndi;
17652 if (__pyx_t_18 < 0) __pyx_t_18 += __pyx_v_recovered_grads.shape[0];
17653 if (__pyx_t_14 < 0) __pyx_t_14 += __pyx_v_recovered_grads.shape[1];
17654 *((
double *) ( (( (__pyx_v_recovered_grads.data + __pyx_t_18 * __pyx_v_recovered_grads.strides[0]) ) + __pyx_t_14 * __pyx_v_recovered_grads.strides[1]) )) = ((*((
double *) ( (__pyx_v_grad_sum.data + __pyx_t_19 * __pyx_v_grad_sum.strides[0]) ))) / __pyx_v_nb_el);
17665 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
17674 __PYX_INC_MEMVIEW(&__pyx_v_recovered_grads, 0);
17675 __pyx_r = __pyx_v_recovered_grads;
17688 __Pyx_XDECREF(__pyx_t_1);
17689 __Pyx_XDECREF(__pyx_t_2);
17690 __Pyx_XDECREF(__pyx_t_3);
17691 __Pyx_XDECREF(__pyx_t_5);
17692 __Pyx_XDECREF(__pyx_t_6);
17693 __PYX_XDEC_MEMVIEW(&__pyx_t_7, 1);
17694 __PYX_XDEC_MEMVIEW(&__pyx_t_8, 1);
17695 __pyx_r.data = NULL;
17696 __pyx_r.memview = NULL;
17697 __Pyx_AddTraceback(
"mprans.cMoveMeshMonitor.cppGradientRecoveryAtNodes", __pyx_clineno, __pyx_lineno, __pyx_filename);
17700 if (unlikely(!__pyx_r.memview)) {
17701 PyErr_SetString(PyExc_TypeError,
"Memoryview return value is not initialized");
17704 __PYX_XDEC_MEMVIEW(&__pyx_v_recovered_grads, 1);
17705 __PYX_XDEC_MEMVIEW(&__pyx_v_grad_sum, 1);
17706 __Pyx_XDECREF(__pyx_v_node);
17707 __Pyx_XDECREF(__pyx_v_eOffset);
17708 __Pyx_XDECREF(__pyx_v_eN);
17709 __Pyx_RefNannyFinishContext();
17722 static PyObject *__pyx_pw_6mprans_16cMoveMeshMonitor_7gradientRecoveryAtNodesWeighted(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
17723 static PyMethodDef __pyx_mdef_6mprans_16cMoveMeshMonitor_7gradientRecoveryAtNodesWeighted = {
"gradientRecoveryAtNodesWeighted", (PyCFunction)(
void*)(PyCFunctionWithKeywords)__pyx_pw_6mprans_16cMoveMeshMonitor_7gradientRecoveryAtNodesWeighted, METH_VARARGS|METH_KEYWORDS, 0};
17724 static PyObject *__pyx_pw_6mprans_16cMoveMeshMonitor_7gradientRecoveryAtNodesWeighted(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
17725 __Pyx_memviewslice __pyx_v_grads = { 0, 0, { 0 }, { 0 }, { 0 } };
17726 __Pyx_memviewslice __pyx_v_nodeElementsArray = { 0, 0, { 0 }, { 0 }, { 0 } };
17727 __Pyx_memviewslice __pyx_v_nodeElementOffsets = { 0, 0, { 0 }, { 0 }, { 0 } };
17728 __Pyx_memviewslice __pyx_v_detJ_array = { 0, 0, { 0 }, { 0 }, { 0 } };
17730 int __pyx_lineno = 0;
17731 const char *__pyx_filename = NULL;
17732 int __pyx_clineno = 0;
17733 PyObject *__pyx_r = 0;
17734 __Pyx_RefNannyDeclarations
17735 __Pyx_RefNannySetupContext(
"gradientRecoveryAtNodesWeighted (wrapper)", 0);
17737 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_grads,&__pyx_n_s_nodeElementsArray,&__pyx_n_s_nodeElementOffsets,&__pyx_n_s_detJ_array,&__pyx_n_s_nd,0};
17738 PyObject* values[5] = {0,0,0,0,0};
17739 if (unlikely(__pyx_kwds)) {
17740 Py_ssize_t kw_args;
17741 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
17742 switch (pos_args) {
17743 case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
17744 CYTHON_FALLTHROUGH;
17745 case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
17746 CYTHON_FALLTHROUGH;
17747 case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
17748 CYTHON_FALLTHROUGH;
17749 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
17750 CYTHON_FALLTHROUGH;
17751 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
17752 CYTHON_FALLTHROUGH;
17754 default:
goto __pyx_L5_argtuple_error;
17756 kw_args = PyDict_Size(__pyx_kwds);
17757 switch (pos_args) {
17759 if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_grads)) != 0)) kw_args--;
17760 else goto __pyx_L5_argtuple_error;
17761 CYTHON_FALLTHROUGH;
17763 if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_nodeElementsArray)) != 0)) kw_args--;
17765 __Pyx_RaiseArgtupleInvalid(
"gradientRecoveryAtNodesWeighted", 1, 5, 5, 1); __PYX_ERR(0, 1046, __pyx_L3_error)
17767 CYTHON_FALLTHROUGH;
17769 if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_nodeElementOffsets)) != 0)) kw_args--;
17771 __Pyx_RaiseArgtupleInvalid(
"gradientRecoveryAtNodesWeighted", 1, 5, 5, 2); __PYX_ERR(0, 1046, __pyx_L3_error)
17773 CYTHON_FALLTHROUGH;
17775 if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_detJ_array)) != 0)) kw_args--;
17777 __Pyx_RaiseArgtupleInvalid(
"gradientRecoveryAtNodesWeighted", 1, 5, 5, 3); __PYX_ERR(0, 1046, __pyx_L3_error)
17779 CYTHON_FALLTHROUGH;
17781 if (likely((values[4] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_nd)) != 0)) kw_args--;
17783 __Pyx_RaiseArgtupleInvalid(
"gradientRecoveryAtNodesWeighted", 1, 5, 5, 4); __PYX_ERR(0, 1046, __pyx_L3_error)
17786 if (unlikely(kw_args > 0)) {
17787 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args,
"gradientRecoveryAtNodesWeighted") < 0)) __PYX_ERR(0, 1046, __pyx_L3_error)
17789 }
else if (PyTuple_GET_SIZE(__pyx_args) != 5) {
17790 goto __pyx_L5_argtuple_error;
17792 values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
17793 values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
17794 values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
17795 values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
17796 values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
17798 __pyx_v_grads = __Pyx_PyObject_to_MemoryviewSlice_dsdsds_double(values[0], PyBUF_WRITABLE);
if (unlikely(!__pyx_v_grads.memview)) __PYX_ERR(0, 1046, __pyx_L3_error)
17799 __pyx_v_nodeElementsArray = __Pyx_PyObject_to_MemoryviewSlice_ds_int(values[1], PyBUF_WRITABLE);
if (unlikely(!__pyx_v_nodeElementsArray.memview)) __PYX_ERR(0, 1047, __pyx_L3_error)
17800 __pyx_v_nodeElementOffsets = __Pyx_PyObject_to_MemoryviewSlice_ds_int(values[2], PyBUF_WRITABLE);
if (unlikely(!__pyx_v_nodeElementOffsets.memview)) __PYX_ERR(0, 1048, __pyx_L3_error)
17801 __pyx_v_detJ_array = __Pyx_PyObject_to_MemoryviewSlice_dsds_double(values[3], PyBUF_WRITABLE);
if (unlikely(!__pyx_v_detJ_array.memview)) __PYX_ERR(0, 1049, __pyx_L3_error)
17802 __pyx_v_nd = __Pyx_PyInt_As_int(values[4]);
if (unlikely((__pyx_v_nd == (
int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1050, __pyx_L3_error)
17804 goto __pyx_L4_argument_unpacking_done;
17805 __pyx_L5_argtuple_error:;
17806 __Pyx_RaiseArgtupleInvalid(
"gradientRecoveryAtNodesWeighted", 1, 5, 5, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1046, __pyx_L3_error)
17808 __Pyx_AddTraceback(
"mprans.cMoveMeshMonitor.gradientRecoveryAtNodesWeighted", __pyx_clineno, __pyx_lineno, __pyx_filename);
17809 __Pyx_RefNannyFinishContext();
17811 __pyx_L4_argument_unpacking_done:;
17812 __pyx_r = __pyx_pf_6mprans_16cMoveMeshMonitor_6gradientRecoveryAtNodesWeighted(__pyx_self, __pyx_v_grads, __pyx_v_nodeElementsArray, __pyx_v_nodeElementOffsets, __pyx_v_detJ_array, __pyx_v_nd);
17815 __Pyx_RefNannyFinishContext();
17819 static PyObject *__pyx_pf_6mprans_16cMoveMeshMonitor_6gradientRecoveryAtNodesWeighted(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_grads, __Pyx_memviewslice __pyx_v_nodeElementsArray, __Pyx_memviewslice __pyx_v_nodeElementOffsets, __Pyx_memviewslice __pyx_v_detJ_array,
int __pyx_v_nd) {
17820 PyObject *__pyx_r = NULL;
17821 __Pyx_RefNannyDeclarations
17822 __Pyx_memviewslice __pyx_t_1 = { 0, 0, { 0 }, { 0 }, { 0 } };
17823 PyObject *__pyx_t_2 = NULL;
17824 int __pyx_lineno = 0;
17825 const char *__pyx_filename = NULL;
17826 int __pyx_clineno = 0;
17827 __Pyx_RefNannySetupContext(
"gradientRecoveryAtNodesWeighted", 0);
17836 __Pyx_XDECREF(__pyx_r);
17845 __pyx_t_1 = __pyx_f_6mprans_16cMoveMeshMonitor_cppGradientRecoveryAtNodesWeighted(__pyx_v_grads, __pyx_v_nodeElementsArray, __pyx_v_nodeElementOffsets, __pyx_v_detJ_array, __pyx_v_nd);
if (unlikely(!__pyx_t_1.memview)) __PYX_ERR(0, 1051, __pyx_L1_error)
17854 __pyx_t_2 = __pyx_memoryview_fromslice(__pyx_t_1, 2, (PyObject *(*)(
char *)) __pyx_memview_get_double, (
int (*)(
char *, PyObject *)) __pyx_memview_set_double, 0);;
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1051, __pyx_L1_error)
17855 __Pyx_GOTREF(__pyx_t_2);
17856 __PYX_XDEC_MEMVIEW(&__pyx_t_1, 1);
17857 __pyx_t_1.memview = NULL;
17858 __pyx_t_1.data = NULL;
17859 __pyx_r = __pyx_t_2;
17873 __PYX_XDEC_MEMVIEW(&__pyx_t_1, 1);
17874 __Pyx_XDECREF(__pyx_t_2);
17875 __Pyx_AddTraceback(
"mprans.cMoveMeshMonitor.gradientRecoveryAtNodesWeighted", __pyx_clineno, __pyx_lineno, __pyx_filename);
17878 __PYX_XDEC_MEMVIEW(&__pyx_v_grads, 1);
17879 __PYX_XDEC_MEMVIEW(&__pyx_v_nodeElementsArray, 1);
17880 __PYX_XDEC_MEMVIEW(&__pyx_v_nodeElementOffsets, 1);
17881 __PYX_XDEC_MEMVIEW(&__pyx_v_detJ_array, 1);
17882 __Pyx_XGIVEREF(__pyx_r);
17883 __Pyx_RefNannyFinishContext();
17895 static __Pyx_memviewslice __pyx_f_6mprans_16cMoveMeshMonitor_cppGradientRecoveryAtNodesWeighted(__Pyx_memviewslice __pyx_v_grads, __Pyx_memviewslice __pyx_v_nodeElementsArray, __Pyx_memviewslice __pyx_v_nodeElementOffsets, __Pyx_memviewslice __pyx_v_detJ_array,
int __pyx_v_nd) {
17896 __Pyx_memviewslice __pyx_v_recovered_grads = { 0, 0, { 0 }, { 0 }, { 0 } };
17898 double __pyx_v_detJ_patch;
17899 __Pyx_memviewslice __pyx_v_grad_sum = { 0, 0, { 0 }, { 0 }, { 0 } };
17900 PyObject *__pyx_v_node = NULL;
17902 PyObject *__pyx_v_eOffset = NULL;
17903 PyObject *__pyx_v_eN = NULL;
17904 __Pyx_memviewslice __pyx_r = { 0, 0, { 0 }, { 0 }, { 0 } };
17905 __Pyx_RefNannyDeclarations
17906 PyObject *__pyx_t_1 = NULL;
17907 PyObject *__pyx_t_2 = NULL;
17908 PyObject *__pyx_t_3 = NULL;
17910 PyObject *__pyx_t_5 = NULL;
17911 PyObject *__pyx_t_6 = NULL;
17912 __Pyx_memviewslice __pyx_t_7 = { 0, 0, { 0 }, { 0 }, { 0 } };
17913 __Pyx_memviewslice __pyx_t_8 = { 0, 0, { 0 }, { 0 }, { 0 } };
17914 Py_ssize_t __pyx_t_9;
17915 PyObject *(*__pyx_t_10)(PyObject *);
17919 Py_ssize_t __pyx_t_14;
17920 Py_ssize_t __pyx_t_15;
17921 PyObject *(*__pyx_t_16)(PyObject *);
17922 Py_ssize_t __pyx_t_17;
17923 Py_ssize_t __pyx_t_18;
17924 Py_ssize_t __pyx_t_19;
17925 Py_ssize_t __pyx_t_20;
17926 Py_ssize_t __pyx_t_21;
17927 Py_ssize_t __pyx_t_22;
17928 Py_ssize_t __pyx_t_23;
17929 int __pyx_lineno = 0;
17930 const char *__pyx_filename = NULL;
17931 int __pyx_clineno = 0;
17932 __Pyx_RefNannySetupContext(
"cppGradientRecoveryAtNodesWeighted", 0);
17941 __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_np);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1062, __pyx_L1_error)
17942 __Pyx_GOTREF(__pyx_t_2);
17943 __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_zeros);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1062, __pyx_L1_error)
17944 __Pyx_GOTREF(__pyx_t_3);
17945 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
17946 __pyx_t_4 = __Pyx_MemoryView_Len(__pyx_v_nodeElementOffsets);
17947 __pyx_t_2 = PyInt_FromSsize_t((__pyx_t_4 - 1));
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1062, __pyx_L1_error)
17948 __Pyx_GOTREF(__pyx_t_2);
17949 __pyx_t_5 = __Pyx_PyInt_From_int(__pyx_v_nd);
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1062, __pyx_L1_error)
17950 __Pyx_GOTREF(__pyx_t_5);
17951 __pyx_t_6 = PyTuple_New(2);
if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1062, __pyx_L1_error)
17952 __Pyx_GOTREF(__pyx_t_6);
17953 __Pyx_GIVEREF(__pyx_t_2);
17954 PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_2);
17955 __Pyx_GIVEREF(__pyx_t_5);
17956 PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_t_5);
17960 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
17961 __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_3);
17962 if (likely(__pyx_t_5)) {
17963 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_3);
17964 __Pyx_INCREF(__pyx_t_5);
17965 __Pyx_INCREF(
function);
17966 __Pyx_DECREF_SET(__pyx_t_3,
function);
17969 __pyx_t_1 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_5, __pyx_t_6) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_6);
17970 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
17971 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
17972 if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1062, __pyx_L1_error)
17973 __Pyx_GOTREF(__pyx_t_1);
17974 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
17975 __pyx_t_7 = __Pyx_PyObject_to_MemoryviewSlice_dsds_double(__pyx_t_1, PyBUF_WRITABLE);
if (unlikely(!__pyx_t_7.memview)) __PYX_ERR(0, 1062, __pyx_L1_error)
17976 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
17977 __pyx_v_recovered_grads = __pyx_t_7;
17978 __pyx_t_7.memview = NULL;
17979 __pyx_t_7.data = NULL;
17988 __pyx_v_detJ_patch = 0.;
17997 __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_np);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1065, __pyx_L1_error)
17998 __Pyx_GOTREF(__pyx_t_3);
17999 __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_zeros);
if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1065, __pyx_L1_error)
18000 __Pyx_GOTREF(__pyx_t_6);
18001 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
18002 __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_nd);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1065, __pyx_L1_error)
18003 __Pyx_GOTREF(__pyx_t_3);
18005 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_6))) {
18006 __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_6);
18007 if (likely(__pyx_t_5)) {
18008 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_6);
18009 __Pyx_INCREF(__pyx_t_5);
18010 __Pyx_INCREF(
function);
18011 __Pyx_DECREF_SET(__pyx_t_6,
function);
18014 __pyx_t_1 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_6, __pyx_t_5, __pyx_t_3) : __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_t_3);
18015 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
18016 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
18017 if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1065, __pyx_L1_error)
18018 __Pyx_GOTREF(__pyx_t_1);
18019 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
18020 __pyx_t_8 = __Pyx_PyObject_to_MemoryviewSlice_ds_double(__pyx_t_1, PyBUF_WRITABLE);
if (unlikely(!__pyx_t_8.memview)) __PYX_ERR(0, 1065, __pyx_L1_error)
18021 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
18022 __pyx_v_grad_sum = __pyx_t_8;
18023 __pyx_t_8.memview = NULL;
18024 __pyx_t_8.data = NULL;
18033 __pyx_t_4 = __Pyx_MemoryView_Len(__pyx_v_nodeElementOffsets);
18034 __pyx_t_1 = PyInt_FromSsize_t((__pyx_t_4 - 1));
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1066, __pyx_L1_error)
18035 __Pyx_GOTREF(__pyx_t_1);
18036 __pyx_t_6 = __Pyx_PyObject_CallOneArg(__pyx_builtin_range, __pyx_t_1);
if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1066, __pyx_L1_error)
18037 __Pyx_GOTREF(__pyx_t_6);
18038 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
18039 if (likely(PyList_CheckExact(__pyx_t_6)) || PyTuple_CheckExact(__pyx_t_6)) {
18040 __pyx_t_1 = __pyx_t_6; __Pyx_INCREF(__pyx_t_1); __pyx_t_9 = 0;
18043 __pyx_t_9 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_t_6);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1066, __pyx_L1_error)
18044 __Pyx_GOTREF(__pyx_t_1);
18045 __pyx_t_10 = Py_TYPE(__pyx_t_1)->tp_iternext;
if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1066, __pyx_L1_error)
18047 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
18049 if (likely(!__pyx_t_10)) {
18050 if (likely(PyList_CheckExact(__pyx_t_1))) {
18051 if (__pyx_t_9 >= PyList_GET_SIZE(__pyx_t_1))
break;
18052 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
18053 __pyx_t_6 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_9); __Pyx_INCREF(__pyx_t_6); __pyx_t_9++;
if (unlikely(0 < 0)) __PYX_ERR(0, 1066, __pyx_L1_error)
18055 __pyx_t_6 = PySequence_ITEM(__pyx_t_1, __pyx_t_9); __pyx_t_9++;
if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1066, __pyx_L1_error)
18056 __Pyx_GOTREF(__pyx_t_6);
18059 if (__pyx_t_9 >= PyTuple_GET_SIZE(__pyx_t_1))
break;
18060 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
18061 __pyx_t_6 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_9); __Pyx_INCREF(__pyx_t_6); __pyx_t_9++;
if (unlikely(0 < 0)) __PYX_ERR(0, 1066, __pyx_L1_error)
18063 __pyx_t_6 = PySequence_ITEM(__pyx_t_1, __pyx_t_9); __pyx_t_9++;
if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1066, __pyx_L1_error)
18064 __Pyx_GOTREF(__pyx_t_6);
18068 __pyx_t_6 = __pyx_t_10(__pyx_t_1);
18069 if (unlikely(!__pyx_t_6)) {
18070 PyObject* exc_type = PyErr_Occurred();
18072 if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
18073 else __PYX_ERR(0, 1066, __pyx_L1_error)
18077 __Pyx_GOTREF(__pyx_t_6);
18079 __Pyx_XDECREF_SET(__pyx_v_node, __pyx_t_6);
18098 __pyx_v_detJ_patch = 0.;
18107 __pyx_t_11 = __pyx_v_nd;
18108 __pyx_t_12 = __pyx_t_11;
18109 for (__pyx_t_13 = 0; __pyx_t_13 < __pyx_t_12; __pyx_t_13+=1) {
18110 __pyx_v_ndi = __pyx_t_13;
18119 __pyx_t_14 = __pyx_v_ndi;
18120 if (__pyx_t_14 < 0) __pyx_t_14 += __pyx_v_grad_sum.shape[0];
18121 *((
double *) ( (__pyx_v_grad_sum.data + __pyx_t_14 * __pyx_v_grad_sum.strides[0]) )) = 0.;
18131 __pyx_t_15 = __Pyx_PyIndex_AsSsize_t(__pyx_v_node);
if (unlikely((__pyx_t_15 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1071, __pyx_L1_error)
18132 __pyx_t_14 = __pyx_t_15;
18133 if (__pyx_t_14 < 0) __pyx_t_14 += __pyx_v_nodeElementOffsets.shape[0];
18134 __pyx_t_6 = __Pyx_PyInt_From_int((*((
int *) ( (__pyx_v_nodeElementOffsets.data + __pyx_t_14 * __pyx_v_nodeElementOffsets.strides[0]) ))));
if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1071, __pyx_L1_error)
18135 __Pyx_GOTREF(__pyx_t_6);
18144 __pyx_t_3 = __Pyx_PyInt_AddObjC(__pyx_v_node, __pyx_int_1, 1, 0, 0);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1072, __pyx_L1_error)
18145 __Pyx_GOTREF(__pyx_t_3);
18146 __pyx_t_15 = __Pyx_PyIndex_AsSsize_t(__pyx_t_3);
if (unlikely((__pyx_t_15 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1072, __pyx_L1_error)
18147 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
18148 __pyx_t_14 = __pyx_t_15;
18149 if (__pyx_t_14 < 0) __pyx_t_14 += __pyx_v_nodeElementOffsets.shape[0];
18150 __pyx_t_3 = __Pyx_PyInt_From_int((*((
int *) ( (__pyx_v_nodeElementOffsets.data + __pyx_t_14 * __pyx_v_nodeElementOffsets.strides[0]) ))));
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1072, __pyx_L1_error)
18151 __Pyx_GOTREF(__pyx_t_3);
18160 __pyx_t_5 = PyTuple_New(2);
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1071, __pyx_L1_error)
18161 __Pyx_GOTREF(__pyx_t_5);
18162 __Pyx_GIVEREF(__pyx_t_6);
18163 PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_6);
18164 __Pyx_GIVEREF(__pyx_t_3);
18165 PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_3);
18168 __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_range, __pyx_t_5, NULL);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1071, __pyx_L1_error)
18169 __Pyx_GOTREF(__pyx_t_3);
18170 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
18171 if (likely(PyList_CheckExact(__pyx_t_3)) || PyTuple_CheckExact(__pyx_t_3)) {
18172 __pyx_t_5 = __pyx_t_3; __Pyx_INCREF(__pyx_t_5); __pyx_t_15 = 0;
18175 __pyx_t_15 = -1; __pyx_t_5 = PyObject_GetIter(__pyx_t_3);
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1071, __pyx_L1_error)
18176 __Pyx_GOTREF(__pyx_t_5);
18177 __pyx_t_16 = Py_TYPE(__pyx_t_5)->tp_iternext;
if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 1071, __pyx_L1_error)
18179 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
18181 if (likely(!__pyx_t_16)) {
18182 if (likely(PyList_CheckExact(__pyx_t_5))) {
18183 if (__pyx_t_15 >= PyList_GET_SIZE(__pyx_t_5))
break;
18184 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
18185 __pyx_t_3 = PyList_GET_ITEM(__pyx_t_5, __pyx_t_15); __Pyx_INCREF(__pyx_t_3); __pyx_t_15++;
if (unlikely(0 < 0)) __PYX_ERR(0, 1071, __pyx_L1_error)
18187 __pyx_t_3 = PySequence_ITEM(__pyx_t_5, __pyx_t_15); __pyx_t_15++;
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1071, __pyx_L1_error)
18188 __Pyx_GOTREF(__pyx_t_3);
18191 if (__pyx_t_15 >= PyTuple_GET_SIZE(__pyx_t_5))
break;
18192 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
18193 __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_5, __pyx_t_15); __Pyx_INCREF(__pyx_t_3); __pyx_t_15++;
if (unlikely(0 < 0)) __PYX_ERR(0, 1071, __pyx_L1_error)
18195 __pyx_t_3 = PySequence_ITEM(__pyx_t_5, __pyx_t_15); __pyx_t_15++;
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1071, __pyx_L1_error)
18196 __Pyx_GOTREF(__pyx_t_3);
18200 __pyx_t_3 = __pyx_t_16(__pyx_t_5);
18201 if (unlikely(!__pyx_t_3)) {
18202 PyObject* exc_type = PyErr_Occurred();
18204 if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
18205 else __PYX_ERR(0, 1071, __pyx_L1_error)
18209 __Pyx_GOTREF(__pyx_t_3);
18211 __Pyx_XDECREF_SET(__pyx_v_eOffset, __pyx_t_3);
18221 __pyx_v_nb_el = (__pyx_v_nb_el + 1);
18230 __pyx_t_17 = __Pyx_PyIndex_AsSsize_t(__pyx_v_eOffset);
if (unlikely((__pyx_t_17 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1074, __pyx_L1_error)
18231 __pyx_t_14 = __pyx_t_17;
18232 if (__pyx_t_14 < 0) __pyx_t_14 += __pyx_v_nodeElementsArray.shape[0];
18233 __pyx_t_3 = __Pyx_PyInt_From_int((*((
int *) ( (__pyx_v_nodeElementsArray.data + __pyx_t_14 * __pyx_v_nodeElementsArray.strides[0]) ))));
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1074, __pyx_L1_error)
18234 __Pyx_GOTREF(__pyx_t_3);
18235 __Pyx_XDECREF_SET(__pyx_v_eN, __pyx_t_3);
18245 __pyx_t_17 = __Pyx_PyIndex_AsSsize_t(__pyx_v_eN);
if (unlikely((__pyx_t_17 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1079, __pyx_L1_error)
18246 __pyx_t_14 = __pyx_t_17;
18248 if (__pyx_t_14 < 0) __pyx_t_14 += __pyx_v_detJ_array.shape[0];
18249 if (__pyx_t_18 < 0) __pyx_t_18 += __pyx_v_detJ_array.shape[1];
18250 __pyx_v_detJ_patch = (__pyx_v_detJ_patch + (*((
double *) ( (( (__pyx_v_detJ_array.data + __pyx_t_14 * __pyx_v_detJ_array.strides[0]) ) + __pyx_t_18 * __pyx_v_detJ_array.strides[1]) ))));
18259 __pyx_t_11 = __pyx_v_nd;
18260 __pyx_t_12 = __pyx_t_11;
18261 for (__pyx_t_13 = 0; __pyx_t_13 < __pyx_t_12; __pyx_t_13+=1) {
18262 __pyx_v_ndi = __pyx_t_13;
18271 __pyx_t_17 = __Pyx_PyIndex_AsSsize_t(__pyx_v_eN);
if (unlikely((__pyx_t_17 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1081, __pyx_L1_error)
18272 __pyx_t_18 = __pyx_t_17;
18274 if (__pyx_t_18 < 0) __pyx_t_18 += __pyx_v_detJ_array.shape[0];
18275 if (__pyx_t_14 < 0) __pyx_t_14 += __pyx_v_detJ_array.shape[1];
18276 __pyx_t_19 = __Pyx_PyIndex_AsSsize_t(__pyx_v_eN);
if (unlikely((__pyx_t_19 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1081, __pyx_L1_error)
18277 __pyx_t_20 = __pyx_t_19;
18279 __pyx_t_22 = __pyx_v_ndi;
18280 if (__pyx_t_20 < 0) __pyx_t_20 += __pyx_v_grads.shape[0];
18281 if (__pyx_t_21 < 0) __pyx_t_21 += __pyx_v_grads.shape[1];
18282 if (__pyx_t_22 < 0) __pyx_t_22 += __pyx_v_grads.shape[2];
18283 __pyx_t_23 = __pyx_v_ndi;
18284 if (__pyx_t_23 < 0) __pyx_t_23 += __pyx_v_grad_sum.shape[0];
18285 *((
double *) ( (__pyx_v_grad_sum.data + __pyx_t_23 * __pyx_v_grad_sum.strides[0]) )) += ((*((
double *) ( (( (__pyx_v_detJ_array.data + __pyx_t_18 * __pyx_v_detJ_array.strides[0]) ) + __pyx_t_14 * __pyx_v_detJ_array.strides[1]) ))) * (*((
double *) ( (( (( (__pyx_v_grads.data + __pyx_t_20 * __pyx_v_grads.strides[0]) ) + __pyx_t_21 * __pyx_v_grads.strides[1]) ) + __pyx_t_22 * __pyx_v_grads.strides[2]) ))));
18296 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
18305 __pyx_t_11 = __pyx_v_nd;
18306 __pyx_t_12 = __pyx_t_11;
18307 for (__pyx_t_13 = 0; __pyx_t_13 < __pyx_t_12; __pyx_t_13+=1) {
18308 __pyx_v_ndi = __pyx_t_13;
18317 __pyx_t_22 = __pyx_v_ndi;
18318 if (__pyx_t_22 < 0) __pyx_t_22 += __pyx_v_grad_sum.shape[0];
18319 __pyx_t_15 = __Pyx_PyIndex_AsSsize_t(__pyx_v_node);
if (unlikely((__pyx_t_15 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1083, __pyx_L1_error)
18320 __pyx_t_21 = __pyx_t_15;
18321 __pyx_t_20 = __pyx_v_ndi;
18322 if (__pyx_t_21 < 0) __pyx_t_21 += __pyx_v_recovered_grads.shape[0];
18323 if (__pyx_t_20 < 0) __pyx_t_20 += __pyx_v_recovered_grads.shape[1];
18324 *((
double *) ( (( (__pyx_v_recovered_grads.data + __pyx_t_21 * __pyx_v_recovered_grads.strides[0]) ) + __pyx_t_20 * __pyx_v_recovered_grads.strides[1]) )) = ((*((
double *) ( (__pyx_v_grad_sum.data + __pyx_t_22 * __pyx_v_grad_sum.strides[0]) ))) / __pyx_v_detJ_patch);
18335 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
18344 __PYX_INC_MEMVIEW(&__pyx_v_recovered_grads, 0);
18345 __pyx_r = __pyx_v_recovered_grads;
18358 __Pyx_XDECREF(__pyx_t_1);
18359 __Pyx_XDECREF(__pyx_t_2);
18360 __Pyx_XDECREF(__pyx_t_3);
18361 __Pyx_XDECREF(__pyx_t_5);
18362 __Pyx_XDECREF(__pyx_t_6);
18363 __PYX_XDEC_MEMVIEW(&__pyx_t_7, 1);
18364 __PYX_XDEC_MEMVIEW(&__pyx_t_8, 1);
18365 __pyx_r.data = NULL;
18366 __pyx_r.memview = NULL;
18367 __Pyx_AddTraceback(
"mprans.cMoveMeshMonitor.cppGradientRecoveryAtNodesWeighted", __pyx_clineno, __pyx_lineno, __pyx_filename);
18370 if (unlikely(!__pyx_r.memview)) {
18371 PyErr_SetString(PyExc_TypeError,
"Memoryview return value is not initialized");
18374 __PYX_XDEC_MEMVIEW(&__pyx_v_recovered_grads, 1);
18375 __PYX_XDEC_MEMVIEW(&__pyx_v_grad_sum, 1);
18376 __Pyx_XDECREF(__pyx_v_node);
18377 __Pyx_XDECREF(__pyx_v_eOffset);
18378 __Pyx_XDECREF(__pyx_v_eN);
18379 __Pyx_RefNannyFinishContext();
18392 static PyObject *__pyx_pw_6mprans_16cMoveMeshMonitor_9pyCheckOwnedVariable(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
18393 static PyMethodDef __pyx_mdef_6mprans_16cMoveMeshMonitor_9pyCheckOwnedVariable = {
"pyCheckOwnedVariable", (PyCFunction)(
void*)(PyCFunctionWithKeywords)__pyx_pw_6mprans_16cMoveMeshMonitor_9pyCheckOwnedVariable, METH_VARARGS|METH_KEYWORDS, 0};
18394 static PyObject *__pyx_pw_6mprans_16cMoveMeshMonitor_9pyCheckOwnedVariable(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
18395 int __pyx_v_variable_nb_local;
18397 int __pyx_v_nVariables_owned;
18398 __Pyx_memviewslice __pyx_v_variableNumbering_subdomain2global = { 0, 0, { 0 }, { 0 }, { 0 } };
18399 __Pyx_memviewslice __pyx_v_variableOffsets_subdomain_owned = { 0, 0, { 0 }, { 0 }, { 0 } };
18400 int __pyx_lineno = 0;
18401 const char *__pyx_filename = NULL;
18402 int __pyx_clineno = 0;
18403 PyObject *__pyx_r = 0;
18404 __Pyx_RefNannyDeclarations
18405 __Pyx_RefNannySetupContext(
"pyCheckOwnedVariable (wrapper)", 0);
18407 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_variable_nb_local,&__pyx_n_s_rank,&__pyx_n_s_nVariables_owned,&__pyx_n_s_variableNumbering_subdomain2glob,&__pyx_n_s_variableOffsets_subdomain_owned,0};
18408 PyObject* values[5] = {0,0,0,0,0};
18409 if (unlikely(__pyx_kwds)) {
18410 Py_ssize_t kw_args;
18411 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
18412 switch (pos_args) {
18413 case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
18414 CYTHON_FALLTHROUGH;
18415 case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
18416 CYTHON_FALLTHROUGH;
18417 case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
18418 CYTHON_FALLTHROUGH;
18419 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
18420 CYTHON_FALLTHROUGH;
18421 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
18422 CYTHON_FALLTHROUGH;
18424 default:
goto __pyx_L5_argtuple_error;
18426 kw_args = PyDict_Size(__pyx_kwds);
18427 switch (pos_args) {
18429 if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_variable_nb_local)) != 0)) kw_args--;
18430 else goto __pyx_L5_argtuple_error;
18431 CYTHON_FALLTHROUGH;
18433 if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_rank)) != 0)) kw_args--;
18435 __Pyx_RaiseArgtupleInvalid(
"pyCheckOwnedVariable", 1, 5, 5, 1); __PYX_ERR(0, 1171, __pyx_L3_error)
18437 CYTHON_FALLTHROUGH;
18439 if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_nVariables_owned)) != 0)) kw_args--;
18441 __Pyx_RaiseArgtupleInvalid(
"pyCheckOwnedVariable", 1, 5, 5, 2); __PYX_ERR(0, 1171, __pyx_L3_error)
18443 CYTHON_FALLTHROUGH;
18445 if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_variableNumbering_subdomain2glob)) != 0)) kw_args--;
18447 __Pyx_RaiseArgtupleInvalid(
"pyCheckOwnedVariable", 1, 5, 5, 3); __PYX_ERR(0, 1171, __pyx_L3_error)
18449 CYTHON_FALLTHROUGH;
18451 if (likely((values[4] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_variableOffsets_subdomain_owned)) != 0)) kw_args--;
18453 __Pyx_RaiseArgtupleInvalid(
"pyCheckOwnedVariable", 1, 5, 5, 4); __PYX_ERR(0, 1171, __pyx_L3_error)
18456 if (unlikely(kw_args > 0)) {
18457 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args,
"pyCheckOwnedVariable") < 0)) __PYX_ERR(0, 1171, __pyx_L3_error)
18459 }
else if (PyTuple_GET_SIZE(__pyx_args) != 5) {
18460 goto __pyx_L5_argtuple_error;
18462 values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
18463 values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
18464 values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
18465 values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
18466 values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
18468 __pyx_v_variable_nb_local = __Pyx_PyInt_As_int(values[0]);
if (unlikely((__pyx_v_variable_nb_local == (
int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1171, __pyx_L3_error)
18469 __pyx_v_rank = __Pyx_PyInt_As_int(values[1]);
if (unlikely((__pyx_v_rank == (
int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1172, __pyx_L3_error)
18470 __pyx_v_nVariables_owned = __Pyx_PyInt_As_int(values[2]);
if (unlikely((__pyx_v_nVariables_owned == (
int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1173, __pyx_L3_error)
18471 __pyx_v_variableNumbering_subdomain2global = __Pyx_PyObject_to_MemoryviewSlice_ds_int(values[3], PyBUF_WRITABLE);
if (unlikely(!__pyx_v_variableNumbering_subdomain2global.memview)) __PYX_ERR(0, 1174, __pyx_L3_error)
18472 __pyx_v_variableOffsets_subdomain_owned = __Pyx_PyObject_to_MemoryviewSlice_ds_int(values[4], PyBUF_WRITABLE);
if (unlikely(!__pyx_v_variableOffsets_subdomain_owned.memview)) __PYX_ERR(0, 1175, __pyx_L3_error)
18474 goto __pyx_L4_argument_unpacking_done;
18475 __pyx_L5_argtuple_error:;
18476 __Pyx_RaiseArgtupleInvalid(
"pyCheckOwnedVariable", 1, 5, 5, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1171, __pyx_L3_error)
18478 __Pyx_AddTraceback(
"mprans.cMoveMeshMonitor.pyCheckOwnedVariable", __pyx_clineno, __pyx_lineno, __pyx_filename);
18479 __Pyx_RefNannyFinishContext();
18481 __pyx_L4_argument_unpacking_done:;
18482 __pyx_r = __pyx_pf_6mprans_16cMoveMeshMonitor_8pyCheckOwnedVariable(__pyx_self, __pyx_v_variable_nb_local, __pyx_v_rank, __pyx_v_nVariables_owned, __pyx_v_variableNumbering_subdomain2global, __pyx_v_variableOffsets_subdomain_owned);
18485 __Pyx_RefNannyFinishContext();
18489 static PyObject *__pyx_pf_6mprans_16cMoveMeshMonitor_8pyCheckOwnedVariable(CYTHON_UNUSED PyObject *__pyx_self,
int __pyx_v_variable_nb_local,
int __pyx_v_rank,
int __pyx_v_nVariables_owned, __Pyx_memviewslice __pyx_v_variableNumbering_subdomain2global, __Pyx_memviewslice __pyx_v_variableOffsets_subdomain_owned) {
18490 PyObject *__pyx_r = NULL;
18491 __Pyx_RefNannyDeclarations
18492 PyObject *__pyx_t_1 = NULL;
18493 int __pyx_lineno = 0;
18494 const char *__pyx_filename = NULL;
18495 int __pyx_clineno = 0;
18496 __Pyx_RefNannySetupContext(
"pyCheckOwnedVariable", 0);
18505 __Pyx_XDECREF(__pyx_r);
18514 __pyx_t_1 = __pyx_f_6mprans_16cMoveMeshMonitor_checkOwnedVariable(__pyx_v_variable_nb_local, __pyx_v_rank, __pyx_v_nVariables_owned, __pyx_v_variableNumbering_subdomain2global, __pyx_v_variableOffsets_subdomain_owned);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1176, __pyx_L1_error)
18515 __Pyx_GOTREF(__pyx_t_1);
18516 __pyx_r = __pyx_t_1;
18530 __Pyx_XDECREF(__pyx_t_1);
18531 __Pyx_AddTraceback(
"mprans.cMoveMeshMonitor.pyCheckOwnedVariable", __pyx_clineno, __pyx_lineno, __pyx_filename);
18534 __PYX_XDEC_MEMVIEW(&__pyx_v_variableNumbering_subdomain2global, 1);
18535 __PYX_XDEC_MEMVIEW(&__pyx_v_variableOffsets_subdomain_owned, 1);
18536 __Pyx_XGIVEREF(__pyx_r);
18537 __Pyx_RefNannyFinishContext();
18549 static PyObject *__pyx_f_6mprans_16cMoveMeshMonitor_checkOwnedVariable(
int __pyx_v_variable_nb_local,
int __pyx_v_rank,
int __pyx_v_nVariables_owned, __Pyx_memviewslice __pyx_v_variableNumbering_subdomain2global, __Pyx_memviewslice __pyx_v_variableOffsets_subdomain_owned) {
18550 int __pyx_v_nSubdomains;
18551 int __pyx_v_variable_nb_global;
18552 int __pyx_v_new_variable_nb_local;
18553 int __pyx_v_new_rank;
18554 PyObject *__pyx_v_i = NULL;
18555 PyObject *__pyx_r = NULL;
18556 __Pyx_RefNannyDeclarations
18559 Py_ssize_t __pyx_t_3;
18560 Py_ssize_t __pyx_t_4;
18562 PyObject *__pyx_t_6 = NULL;
18563 PyObject *__pyx_t_7 = NULL;
18564 Py_ssize_t __pyx_t_8;
18565 PyObject *(*__pyx_t_9)(PyObject *);
18566 Py_ssize_t __pyx_t_10;
18568 PyObject *__pyx_t_12 = NULL;
18569 int __pyx_lineno = 0;
18570 const char *__pyx_filename = NULL;
18571 int __pyx_clineno = 0;
18572 __Pyx_RefNannySetupContext(
"checkOwnedVariable", 0);
18581 __pyx_t_1 = __Pyx_MemoryView_Len(__pyx_v_variableOffsets_subdomain_owned);
18582 __pyx_v_nSubdomains = (__pyx_t_1 - 1);
18591 __pyx_v_new_rank = -2;
18600 __pyx_t_2 = ((__pyx_v_variable_nb_local >= __pyx_v_nVariables_owned) != 0);
18610 __pyx_t_3 = __pyx_v_variable_nb_local;
18611 if (__pyx_t_3 < 0) __pyx_t_3 += __pyx_v_variableNumbering_subdomain2global.shape[0];
18612 __pyx_v_variable_nb_global = (*((
int *) ( (__pyx_v_variableNumbering_subdomain2global.data + __pyx_t_3 * __pyx_v_variableNumbering_subdomain2global.strides[0]) )));
18621 __pyx_t_3 = __pyx_v_rank;
18622 if (__pyx_t_3 < 0) __pyx_t_3 += __pyx_v_variableOffsets_subdomain_owned.shape[0];
18623 __pyx_t_2 = ((*((
int *) ( (__pyx_v_variableOffsets_subdomain_owned.data + __pyx_t_3 * __pyx_v_variableOffsets_subdomain_owned.strides[0]) ))) <= __pyx_v_variable_nb_global);
18625 __pyx_t_4 = (__pyx_v_rank + 1);
18626 if (__pyx_t_4 < 0) __pyx_t_4 += __pyx_v_variableOffsets_subdomain_owned.shape[0];
18627 __pyx_t_2 = (__pyx_v_variable_nb_global < (*((
int *) ( (__pyx_v_variableOffsets_subdomain_owned.data + __pyx_t_4 * __pyx_v_variableOffsets_subdomain_owned.strides[0]) ))));
18629 __pyx_t_5 = ((!(__pyx_t_2 != 0)) != 0);
18639 __pyx_t_6 = __Pyx_PyInt_From_long((__pyx_v_nSubdomains + 1));
if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1195, __pyx_L1_error)
18640 __Pyx_GOTREF(__pyx_t_6);
18641 __pyx_t_7 = __Pyx_PyObject_CallOneArg(__pyx_builtin_range, __pyx_t_6);
if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1195, __pyx_L1_error)
18642 __Pyx_GOTREF(__pyx_t_7);
18643 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
18644 if (likely(PyList_CheckExact(__pyx_t_7)) || PyTuple_CheckExact(__pyx_t_7)) {
18645 __pyx_t_6 = __pyx_t_7; __Pyx_INCREF(__pyx_t_6); __pyx_t_8 = 0;
18648 __pyx_t_8 = -1; __pyx_t_6 = PyObject_GetIter(__pyx_t_7);
if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1195, __pyx_L1_error)
18649 __Pyx_GOTREF(__pyx_t_6);
18650 __pyx_t_9 = Py_TYPE(__pyx_t_6)->tp_iternext;
if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1195, __pyx_L1_error)
18652 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
18654 if (likely(!__pyx_t_9)) {
18655 if (likely(PyList_CheckExact(__pyx_t_6))) {
18656 if (__pyx_t_8 >= PyList_GET_SIZE(__pyx_t_6))
break;
18657 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
18658 __pyx_t_7 = PyList_GET_ITEM(__pyx_t_6, __pyx_t_8); __Pyx_INCREF(__pyx_t_7); __pyx_t_8++;
if (unlikely(0 < 0)) __PYX_ERR(0, 1195, __pyx_L1_error)
18660 __pyx_t_7 = PySequence_ITEM(__pyx_t_6, __pyx_t_8); __pyx_t_8++;
if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1195, __pyx_L1_error)
18661 __Pyx_GOTREF(__pyx_t_7);
18664 if (__pyx_t_8 >= PyTuple_GET_SIZE(__pyx_t_6))
break;
18665 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
18666 __pyx_t_7 = PyTuple_GET_ITEM(__pyx_t_6, __pyx_t_8); __Pyx_INCREF(__pyx_t_7); __pyx_t_8++;
if (unlikely(0 < 0)) __PYX_ERR(0, 1195, __pyx_L1_error)
18668 __pyx_t_7 = PySequence_ITEM(__pyx_t_6, __pyx_t_8); __pyx_t_8++;
if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1195, __pyx_L1_error)
18669 __Pyx_GOTREF(__pyx_t_7);
18673 __pyx_t_7 = __pyx_t_9(__pyx_t_6);
18674 if (unlikely(!__pyx_t_7)) {
18675 PyObject* exc_type = PyErr_Occurred();
18677 if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
18678 else __PYX_ERR(0, 1195, __pyx_L1_error)
18682 __Pyx_GOTREF(__pyx_t_7);
18684 __Pyx_XDECREF_SET(__pyx_v_i, __pyx_t_7);
18694 __pyx_t_10 = __Pyx_PyIndex_AsSsize_t(__pyx_v_i);
if (unlikely((__pyx_t_10 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1196, __pyx_L1_error)
18695 __pyx_t_3 = __pyx_t_10;
18696 if (__pyx_t_3 < 0) __pyx_t_3 += __pyx_v_variableOffsets_subdomain_owned.shape[0];
18697 __pyx_t_5 = (((*((
int *) ( (__pyx_v_variableOffsets_subdomain_owned.data + __pyx_t_3 * __pyx_v_variableOffsets_subdomain_owned.strides[0]) ))) > __pyx_v_variable_nb_global) != 0);
18707 __pyx_t_5 = ((__pyx_v_new_rank == -2
L) != 0);
18717 __pyx_t_7 = __Pyx_PyInt_SubtractObjC(__pyx_v_i, __pyx_int_1, 1, 0, 0);
if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1199, __pyx_L1_error)
18718 __Pyx_GOTREF(__pyx_t_7);
18719 __pyx_t_11 = __Pyx_PyInt_As_int(__pyx_t_7);
if (unlikely((__pyx_t_11 == (
int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1199, __pyx_L1_error)
18720 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
18721 __pyx_v_new_rank = __pyx_t_11;
18749 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
18776 __pyx_t_5 = ((__pyx_v_new_rank >= 0) != 0);
18786 __pyx_t_3 = __pyx_v_new_rank;
18787 if (__pyx_t_3 < 0) __pyx_t_3 += __pyx_v_variableOffsets_subdomain_owned.shape[0];
18788 __pyx_v_new_variable_nb_local = (__pyx_v_variable_nb_global - (*((
int *) ( (__pyx_v_variableOffsets_subdomain_owned.data + __pyx_t_3 * __pyx_v_variableOffsets_subdomain_owned.strides[0]) ))));
18808 __pyx_v_new_rank = __pyx_v_rank;
18817 __pyx_v_new_variable_nb_local = __pyx_v_variable_nb_local;
18828 __Pyx_XDECREF(__pyx_r);
18829 __pyx_t_6 = __Pyx_PyInt_From_int(__pyx_v_new_variable_nb_local);
if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1206, __pyx_L1_error)
18830 __Pyx_GOTREF(__pyx_t_6);
18831 __pyx_t_7 = __Pyx_PyInt_From_int(__pyx_v_new_rank);
if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1206, __pyx_L1_error)
18832 __Pyx_GOTREF(__pyx_t_7);
18833 __pyx_t_12 = PyTuple_New(2);
if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1206, __pyx_L1_error)
18834 __Pyx_GOTREF(__pyx_t_12);
18835 __Pyx_GIVEREF(__pyx_t_6);
18836 PyTuple_SET_ITEM(__pyx_t_12, 0, __pyx_t_6);
18837 __Pyx_GIVEREF(__pyx_t_7);
18838 PyTuple_SET_ITEM(__pyx_t_12, 1, __pyx_t_7);
18841 __pyx_r = ((PyObject*)__pyx_t_12);
18855 __Pyx_XDECREF(__pyx_t_6);
18856 __Pyx_XDECREF(__pyx_t_7);
18857 __Pyx_XDECREF(__pyx_t_12);
18858 __Pyx_AddTraceback(
"mprans.cMoveMeshMonitor.checkOwnedVariable", __pyx_clineno, __pyx_lineno, __pyx_filename);
18861 __Pyx_XDECREF(__pyx_v_i);
18862 __Pyx_XGIVEREF(__pyx_r);
18863 __Pyx_RefNannyFinishContext();
18875 static __Pyx_memviewslice __pyx_f_6mprans_16cMoveMeshMonitor_findN(__Pyx_memviewslice __pyx_v_coords, __Pyx_memviewslice __pyx_v_nodeArray, __Pyx_memviewslice __pyx_v_nodeStarOffsets, __Pyx_memviewslice __pyx_v_nodeStarArray,
int __pyx_v_nearestN,
int __pyx_v_typeN,
int __pyx_v_my_rank,
int __pyx_v_nNodes_owned, __Pyx_memviewslice __pyx_v_nodeNumbering_subdomain2global, __Pyx_memviewslice __pyx_v_nodeOffsets_subdomain_owned, __Pyx_memviewslice __pyx_v_nodeElementOffsets, __Pyx_memviewslice __pyx_v_nodeElementsArray, __Pyx_memviewslice __pyx_v_elementBarycentersArray, __Pyx_memviewslice __pyx_v_elementBoundaryNormalsArray, __Pyx_memviewslice __pyx_v_elementBoundariesArray, __Pyx_memviewslice __pyx_v_elementBoundaryBarycentersArray, __Pyx_memviewslice __pyx_v_elementBoundaryElementsArray, __Pyx_memviewslice __pyx_v_exteriorElementBoundariesBoolArray,
int __pyx_v_nElements_owned, __Pyx_memviewslice __pyx_v_elementNumbering_subdomain2global, __Pyx_memviewslice __pyx_v_elementOffsets_subdomain_owned,
int __pyx_v_nElementBoundaries_owned, __Pyx_memviewslice __pyx_v_elementBoundaryNumbering_subdomain2global, __Pyx_memviewslice __pyx_v_elementBoundaryOffsets_subdomain_owned, CYTHON_UNUSED __Pyx_memviewslice __pyx_v_elementNodesArray, CYTHON_UNUSED __Pyx_memviewslice __pyx_v_nodeMaterialTypes, CYTHON_UNUSED
int __pyx_v_nNel) {
18876 __Pyx_memviewslice __pyx_v_result_in = { 0, 0, { 0 }, { 0 }, { 0 } };
18877 int __pyx_v_result_out[3];
18878 __Pyx_memviewslice __pyx_v_starting_coords = { 0, 0, { 0 }, { 0 }, { 0 } };
18880 CYTHON_UNUSED
bool __pyx_v_stop;
18881 __Pyx_memviewslice __pyx_r = { 0, 0, { 0 }, { 0 }, { 0 } };
18882 __Pyx_RefNannyDeclarations
18883 PyObject *__pyx_t_1 = NULL;
18884 PyObject *__pyx_t_2 = NULL;
18885 PyObject *__pyx_t_3 = NULL;
18886 __Pyx_memviewslice __pyx_t_4 = { 0, 0, { 0 }, { 0 }, { 0 } };
18888 __Pyx_memviewslice __pyx_t_6 = { 0, 0, { 0 }, { 0 }, { 0 } };
18889 Py_ssize_t __pyx_t_7;
18890 Py_ssize_t __pyx_t_8;
18892 Py_ssize_t __pyx_t_10;
18893 struct __pyx_array_obj *__pyx_t_11 = NULL;
18894 int __pyx_lineno = 0;
18895 const char *__pyx_filename = NULL;
18896 int __pyx_clineno = 0;
18897 __Pyx_RefNannySetupContext(
"findN", 0);
18906 __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_np);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1659, __pyx_L1_error)
18907 __Pyx_GOTREF(__pyx_t_2);
18908 __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_zeros);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1659, __pyx_L1_error)
18909 __Pyx_GOTREF(__pyx_t_3);
18910 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
18912 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
18913 __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
18914 if (likely(__pyx_t_2)) {
18915 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_3);
18916 __Pyx_INCREF(__pyx_t_2);
18917 __Pyx_INCREF(
function);
18918 __Pyx_DECREF_SET(__pyx_t_3,
function);
18921 __pyx_t_1 = (__pyx_t_2) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_2, __pyx_int_3) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_int_3);
18922 __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
18923 if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1659, __pyx_L1_error)
18924 __Pyx_GOTREF(__pyx_t_1);
18925 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
18926 __pyx_t_4 = __Pyx_PyObject_to_MemoryviewSlice_ds_double(__pyx_t_1, PyBUF_WRITABLE);
if (unlikely(!__pyx_t_4.memview)) __PYX_ERR(0, 1659, __pyx_L1_error)
18927 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
18928 __pyx_v_starting_coords = __pyx_t_4;
18929 __pyx_t_4.memview = NULL;
18930 __pyx_t_4.data = NULL;
18939 __pyx_v_rank = __pyx_v_my_rank;
18957 __pyx_t_5 = ((__pyx_v_typeN == 0) != 0);
18967 __pyx_v_nearestN = __pyx_f_7proteus_6mprans_13MeshSmoothing_pyxGetLocalNearestNode(__pyx_v_coords, __pyx_v_nodeArray, __pyx_v_nodeStarOffsets, __pyx_v_nodeStarArray, __pyx_v_nearestN);
18976 __pyx_t_5 = ((__pyx_v_nearestN >= __pyx_v_nNodes_owned) != 0);
18986 __pyx_t_6 = __pyx_f_7proteus_6mprans_13MeshSmoothing_cyCheckOwnedVariable(__pyx_v_nearestN, __pyx_v_my_rank, __pyx_v_nNodes_owned, __pyx_v_nodeNumbering_subdomain2global, __pyx_v_nodeOffsets_subdomain_owned);
if (unlikely(!__pyx_t_6.memview)) __PYX_ERR(0, 1671, __pyx_L1_error)
18987 __pyx_v_result_in = __pyx_t_6;
18988 __pyx_t_6.memview = NULL;
18989 __pyx_t_6.data = NULL;
18999 if (__pyx_t_7 < 0) __pyx_t_7 += __pyx_v_result_in.shape[0];
19000 __pyx_v_nearestN = (*((
int *) ( (__pyx_v_result_in.data + __pyx_t_7 * __pyx_v_result_in.strides[0]) )));
19010 if (__pyx_t_7 < 0) __pyx_t_7 += __pyx_v_result_in.shape[0];
19011 __pyx_v_rank = (*((
int *) ( (__pyx_v_result_in.data + __pyx_t_7 * __pyx_v_result_in.strides[0]) )));
19039 __pyx_v_nearestN = __pyx_f_7proteus_6mprans_13MeshSmoothing_pyxGetLocalNearestElementAroundNode(__pyx_v_coords, __pyx_v_nodeElementOffsets, __pyx_v_nodeElementsArray, __pyx_v_elementBarycentersArray, __pyx_v_nearestN);
19068 __pyx_t_5 = ((__pyx_v_typeN == 2) != 0);
19078 __pyx_v_nearestN = __pyx_f_7proteus_6mprans_13MeshSmoothing_cyGetLocalVariable(__pyx_v_nearestN, __pyx_v_my_rank, __pyx_v_nElementBoundaries_owned, __pyx_v_elementBoundaryNumbering_subdomain2global, __pyx_v_elementBoundaryOffsets_subdomain_owned);
19087 __pyx_t_7 = __pyx_v_nearestN;
19089 if (__pyx_t_7 < 0) __pyx_t_7 += __pyx_v_elementBoundaryElementsArray.shape[0];
19090 if (__pyx_t_8 < 0) __pyx_t_8 += __pyx_v_elementBoundaryElementsArray.shape[1];
19091 __pyx_t_9 = (((*((
int *) ( (( (__pyx_v_elementBoundaryElementsArray.data + __pyx_t_7 * __pyx_v_elementBoundaryElementsArray.strides[0]) ) + __pyx_t_8 * __pyx_v_elementBoundaryElementsArray.strides[1]) ))) == -1
L) != 0);
19094 __pyx_t_5 = __pyx_t_9;
19095 goto __pyx_L7_bool_binop_done;
19097 __pyx_t_8 = __pyx_v_nearestN;
19099 if (__pyx_t_8 < 0) __pyx_t_8 += __pyx_v_elementBoundaryElementsArray.shape[0];
19100 if (__pyx_t_7 < 0) __pyx_t_7 += __pyx_v_elementBoundaryElementsArray.shape[1];
19101 __pyx_t_9 = (((*((
int *) ( (( (__pyx_v_elementBoundaryElementsArray.data + __pyx_t_8 * __pyx_v_elementBoundaryElementsArray.strides[0]) ) + __pyx_t_7 * __pyx_v_elementBoundaryElementsArray.strides[1]) ))) >= __pyx_v_nElements_owned) != 0);
19102 __pyx_t_5 = __pyx_t_9;
19103 __pyx_L7_bool_binop_done:;
19113 __pyx_t_7 = __pyx_v_nearestN;
19115 if (__pyx_t_7 < 0) __pyx_t_7 += __pyx_v_elementBoundaryElementsArray.shape[0];
19116 if (__pyx_t_8 < 0) __pyx_t_8 += __pyx_v_elementBoundaryElementsArray.shape[1];
19117 __pyx_v_nearestN = (*((
int *) ( (( (__pyx_v_elementBoundaryElementsArray.data + __pyx_t_7 * __pyx_v_elementBoundaryElementsArray.strides[0]) ) + __pyx_t_8 * __pyx_v_elementBoundaryElementsArray.strides[1]) )));
19145 __pyx_t_8 = __pyx_v_nearestN;
19147 if (__pyx_t_8 < 0) __pyx_t_8 += __pyx_v_elementBoundaryElementsArray.shape[0];
19148 if (__pyx_t_7 < 0) __pyx_t_7 += __pyx_v_elementBoundaryElementsArray.shape[1];
19149 __pyx_t_9 = (((*((
int *) ( (( (__pyx_v_elementBoundaryElementsArray.data + __pyx_t_8 * __pyx_v_elementBoundaryElementsArray.strides[0]) ) + __pyx_t_7 * __pyx_v_elementBoundaryElementsArray.strides[1]) ))) == -1
L) != 0);
19152 __pyx_t_5 = __pyx_t_9;
19153 goto __pyx_L9_bool_binop_done;
19155 __pyx_t_7 = __pyx_v_nearestN;
19157 if (__pyx_t_7 < 0) __pyx_t_7 += __pyx_v_elementBoundaryElementsArray.shape[0];
19158 if (__pyx_t_8 < 0) __pyx_t_8 += __pyx_v_elementBoundaryElementsArray.shape[1];
19159 __pyx_t_9 = (((*((
int *) ( (( (__pyx_v_elementBoundaryElementsArray.data + __pyx_t_7 * __pyx_v_elementBoundaryElementsArray.strides[0]) ) + __pyx_t_8 * __pyx_v_elementBoundaryElementsArray.strides[1]) ))) >= __pyx_v_nElements_owned) != 0);
19160 __pyx_t_5 = __pyx_t_9;
19161 __pyx_L9_bool_binop_done:;
19171 __pyx_t_8 = __pyx_v_nearestN;
19173 if (__pyx_t_8 < 0) __pyx_t_8 += __pyx_v_elementBoundaryElementsArray.shape[0];
19174 if (__pyx_t_7 < 0) __pyx_t_7 += __pyx_v_elementBoundaryElementsArray.shape[1];
19175 __pyx_v_nearestN = (*((
int *) ( (( (__pyx_v_elementBoundaryElementsArray.data + __pyx_t_8 * __pyx_v_elementBoundaryElementsArray.strides[0]) ) + __pyx_t_7 * __pyx_v_elementBoundaryElementsArray.strides[1]) )));
19204 __pyx_t_7 = __pyx_v_nearestN;
19206 if (__pyx_t_7 < 0) __pyx_t_7 += __pyx_v_elementBoundaryElementsArray.shape[0];
19207 if (__pyx_t_8 < 0) __pyx_t_8 += __pyx_v_elementBoundaryElementsArray.shape[1];
19208 __pyx_v_nearestN = (*((
int *) ( (( (__pyx_v_elementBoundaryElementsArray.data + __pyx_t_7 * __pyx_v_elementBoundaryElementsArray.strides[0]) ) + __pyx_t_8 * __pyx_v_elementBoundaryElementsArray.strides[1]) )));
19228 __pyx_t_5 = ((__pyx_v_nearestN >= __pyx_v_nElements_owned) != 0);
19238 __pyx_t_6 = __pyx_f_7proteus_6mprans_13MeshSmoothing_cyCheckOwnedVariable(__pyx_v_nearestN, __pyx_v_my_rank, __pyx_v_nElements_owned, __pyx_v_elementNumbering_subdomain2global, __pyx_v_elementOffsets_subdomain_owned);
if (unlikely(!__pyx_t_6.memview)) __PYX_ERR(0, 1708, __pyx_L1_error)
19239 __PYX_XDEC_MEMVIEW(&__pyx_v_result_in, 1);
19240 __pyx_v_result_in = __pyx_t_6;
19241 __pyx_t_6.memview = NULL;
19242 __pyx_t_6.data = NULL;
19252 if (__pyx_t_8 < 0) __pyx_t_8 += __pyx_v_result_in.shape[0];
19253 __pyx_v_nearestN = (*((
int *) ( (__pyx_v_result_in.data + __pyx_t_8 * __pyx_v_result_in.strides[0]) )));
19263 if (__pyx_t_8 < 0) __pyx_t_8 += __pyx_v_result_in.shape[0];
19264 __pyx_v_rank = (*((
int *) ( (__pyx_v_result_in.data + __pyx_t_8 * __pyx_v_result_in.strides[0]) )));
19291 __pyx_t_5 = ((__pyx_v_typeN == 1) != 0);
19301 __pyx_t_8 = __pyx_v_nearestN;
19303 if (__pyx_t_8 < 0) __pyx_t_8 += __pyx_v_elementBarycentersArray.shape[0];
19304 if (__pyx_t_7 < 0) __pyx_t_7 += __pyx_v_elementBarycentersArray.shape[1];
19306 if (__pyx_t_10 < 0) __pyx_t_10 += __pyx_v_starting_coords.shape[0];
19307 *((
double *) ( (__pyx_v_starting_coords.data + __pyx_t_10 * __pyx_v_starting_coords.strides[0]) )) = (*((
double *) ( (( (__pyx_v_elementBarycentersArray.data + __pyx_t_8 * __pyx_v_elementBarycentersArray.strides[0]) ) + __pyx_t_7 * __pyx_v_elementBarycentersArray.strides[1]) )));
19316 __pyx_t_7 = __pyx_v_nearestN;
19318 if (__pyx_t_7 < 0) __pyx_t_7 += __pyx_v_elementBarycentersArray.shape[0];
19319 if (__pyx_t_8 < 0) __pyx_t_8 += __pyx_v_elementBarycentersArray.shape[1];
19321 if (__pyx_t_10 < 0) __pyx_t_10 += __pyx_v_starting_coords.shape[0];
19322 *((
double *) ( (__pyx_v_starting_coords.data + __pyx_t_10 * __pyx_v_starting_coords.strides[0]) )) = (*((
double *) ( (( (__pyx_v_elementBarycentersArray.data + __pyx_t_7 * __pyx_v_elementBarycentersArray.strides[0]) ) + __pyx_t_8 * __pyx_v_elementBarycentersArray.strides[1]) )));
19331 __pyx_t_8 = __pyx_v_nearestN;
19333 if (__pyx_t_8 < 0) __pyx_t_8 += __pyx_v_elementBarycentersArray.shape[0];
19334 if (__pyx_t_7 < 0) __pyx_t_7 += __pyx_v_elementBarycentersArray.shape[1];
19336 if (__pyx_t_10 < 0) __pyx_t_10 += __pyx_v_starting_coords.shape[0];
19337 *((
double *) ( (__pyx_v_starting_coords.data + __pyx_t_10 * __pyx_v_starting_coords.strides[0]) )) = (*((
double *) ( (( (__pyx_v_elementBarycentersArray.data + __pyx_t_8 * __pyx_v_elementBarycentersArray.strides[0]) ) + __pyx_t_7 * __pyx_v_elementBarycentersArray.strides[1]) )));
19346 __pyx_t_6 = __pyx_f_7proteus_6mprans_13MeshSmoothing_pyxGetLocalNearestElementIntersection(__pyx_v_coords, __pyx_v_starting_coords, __pyx_v_elementBoundaryNormalsArray, __pyx_v_elementBoundariesArray, __pyx_v_elementBoundaryBarycentersArray, __pyx_v_elementBoundaryElementsArray, __pyx_v_exteriorElementBoundariesBoolArray, __pyx_v_nearestN);
if (unlikely(!__pyx_t_6.memview)) __PYX_ERR(0, 1720, __pyx_L1_error)
19347 __PYX_XDEC_MEMVIEW(&__pyx_v_result_in, 1);
19348 __pyx_v_result_in = __pyx_t_6;
19349 __pyx_t_6.memview = NULL;
19350 __pyx_t_6.data = NULL;
19360 if (__pyx_t_7 < 0) __pyx_t_7 += __pyx_v_result_in.shape[0];
19361 __pyx_v_nearestN = (*((
int *) ( (__pyx_v_result_in.data + __pyx_t_7 * __pyx_v_result_in.strides[0]) )));
19370 __pyx_t_5 = ((__pyx_v_nearestN >= __pyx_v_nElements_owned) != 0);
19380 __pyx_t_6 = __pyx_f_7proteus_6mprans_13MeshSmoothing_cyCheckOwnedVariable(__pyx_v_nearestN, __pyx_v_my_rank, __pyx_v_nElements_owned, __pyx_v_elementNumbering_subdomain2global, __pyx_v_elementOffsets_subdomain_owned);
if (unlikely(!__pyx_t_6.memview)) __PYX_ERR(0, 1731, __pyx_L1_error)
19381 __PYX_XDEC_MEMVIEW(&__pyx_v_result_in, 1);
19382 __pyx_v_result_in = __pyx_t_6;
19383 __pyx_t_6.memview = NULL;
19384 __pyx_t_6.data = NULL;
19394 if (__pyx_t_7 < 0) __pyx_t_7 += __pyx_v_result_in.shape[0];
19395 __pyx_v_nearestN = (*((
int *) ( (__pyx_v_result_in.data + __pyx_t_7 * __pyx_v_result_in.strides[0]) )));
19405 if (__pyx_t_7 < 0) __pyx_t_7 += __pyx_v_result_in.shape[0];
19406 __pyx_v_rank = (*((
int *) ( (__pyx_v_result_in.data + __pyx_t_7 * __pyx_v_result_in.strides[0]) )));
19425 __pyx_t_5 = ((__pyx_v_nearestN == -1
L) != 0);
19435 #ifndef CYTHON_WITHOUT_ASSERTIONS
19436 if (unlikely(!Py_OptimizeFlag)) {
19438 if (__pyx_t_7 < 0) __pyx_t_7 += __pyx_v_result_in.shape[0];
19439 if (unlikely(!(((*((
int *) ( (__pyx_v_result_in.data + __pyx_t_7 * __pyx_v_result_in.strides[0]) ))) != -1
L) != 0))) {
19440 PyErr_SetObject(PyExc_AssertionError, __pyx_kp_s_b_i_and_nearestN_cannot_be_both);
19441 __PYX_ERR(0, 1740, __pyx_L1_error)
19454 if (__pyx_t_7 < 0) __pyx_t_7 += __pyx_v_result_in.shape[0];
19455 __pyx_v_nearestN = (*((
int *) ( (__pyx_v_result_in.data + __pyx_t_7 * __pyx_v_result_in.strides[0]) )));
19473 __pyx_t_5 = ((__pyx_v_nearestN >= __pyx_v_nElementBoundaries_owned) != 0);
19483 __pyx_t_6 = __pyx_f_7proteus_6mprans_13MeshSmoothing_cyGetGlobalVariable(__pyx_v_nearestN, __pyx_v_nElementBoundaries_owned, __pyx_v_elementBoundaryNumbering_subdomain2global, __pyx_v_elementBoundaryOffsets_subdomain_owned);
if (unlikely(!__pyx_t_6.memview)) __PYX_ERR(0, 1744, __pyx_L1_error)
19484 __PYX_XDEC_MEMVIEW(&__pyx_v_result_in, 1);
19485 __pyx_v_result_in = __pyx_t_6;
19486 __pyx_t_6.memview = NULL;
19487 __pyx_t_6.data = NULL;
19497 if (__pyx_t_7 < 0) __pyx_t_7 += __pyx_v_result_in.shape[0];
19498 __pyx_v_nearestN = (*((
int *) ( (__pyx_v_result_in.data + __pyx_t_7 * __pyx_v_result_in.strides[0]) )));
19508 if (__pyx_t_7 < 0) __pyx_t_7 += __pyx_v_result_in.shape[0];
19509 __pyx_v_rank = (*((
int *) ( (__pyx_v_result_in.data + __pyx_t_7 * __pyx_v_result_in.strides[0]) )));
19546 (__pyx_v_result_out[0]) = __pyx_v_nearestN;
19555 (__pyx_v_result_out[1]) = __pyx_v_typeN;
19564 (__pyx_v_result_out[2]) = __pyx_v_rank;
19573 __pyx_t_3 = __pyx_format_from_typeinfo(&__Pyx_TypeInfo_int);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1754, __pyx_L1_error)
19574 __Pyx_GOTREF(__pyx_t_3);
19575 __pyx_t_1 = Py_BuildValue((
char*)
"(" __PYX_BUILD_PY_SSIZE_T
")", ((Py_ssize_t)3));
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1754, __pyx_L1_error)
19576 __Pyx_GOTREF(__pyx_t_1);
19577 __pyx_t_11 = __pyx_array_new(__pyx_t_1,
sizeof(
int), PyBytes_AS_STRING(__pyx_t_3), (
char *)
"fortran", (
char *) __pyx_v_result_out);
19578 if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1754, __pyx_L1_error)
19579 __Pyx_GOTREF(__pyx_t_11);
19580 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
19581 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
19582 __pyx_t_6 = __Pyx_PyObject_to_MemoryviewSlice_ds_int(((PyObject *)__pyx_t_11), PyBUF_WRITABLE);
if (unlikely(!__pyx_t_6.memview)) __PYX_ERR(0, 1754, __pyx_L1_error)
19583 __Pyx_DECREF(((PyObject *)__pyx_t_11)); __pyx_t_11 = 0;
19584 __pyx_r = __pyx_t_6;
19585 __pyx_t_6.memview = NULL;
19586 __pyx_t_6.data = NULL;
19599 __Pyx_XDECREF(__pyx_t_1);
19600 __Pyx_XDECREF(__pyx_t_2);
19601 __Pyx_XDECREF(__pyx_t_3);
19602 __PYX_XDEC_MEMVIEW(&__pyx_t_4, 1);
19603 __PYX_XDEC_MEMVIEW(&__pyx_t_6, 1);
19604 __Pyx_XDECREF(((PyObject *)__pyx_t_11));
19605 __pyx_r.data = NULL;
19606 __pyx_r.memview = NULL;
19607 __Pyx_AddTraceback(
"mprans.cMoveMeshMonitor.findN", __pyx_clineno, __pyx_lineno, __pyx_filename);
19610 if (unlikely(!__pyx_r.memview)) {
19611 PyErr_SetString(PyExc_TypeError,
"Memoryview return value is not initialized");
19614 __PYX_XDEC_MEMVIEW(&__pyx_v_result_in, 1);
19615 __PYX_XDEC_MEMVIEW(&__pyx_v_starting_coords, 1);
19616 __Pyx_RefNannyFinishContext();
19628 static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew1(PyObject *__pyx_v_a) {
19629 PyObject *__pyx_r = NULL;
19630 __Pyx_RefNannyDeclarations
19631 PyObject *__pyx_t_1 = NULL;
19632 int __pyx_lineno = 0;
19633 const char *__pyx_filename = NULL;
19634 int __pyx_clineno = 0;
19635 __Pyx_RefNannySetupContext(
"PyArray_MultiIterNew1", 0);
19644 __Pyx_XDECREF(__pyx_r);
19645 __pyx_t_1 = PyArray_MultiIterNew(1, ((
void *)__pyx_v_a));
if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 736, __pyx_L1_error)
19646 __Pyx_GOTREF(__pyx_t_1);
19647 __pyx_r = __pyx_t_1;
19661 __Pyx_XDECREF(__pyx_t_1);
19662 __Pyx_AddTraceback(
"numpy.PyArray_MultiIterNew1", __pyx_clineno, __pyx_lineno, __pyx_filename);
19665 __Pyx_XGIVEREF(__pyx_r);
19666 __Pyx_RefNannyFinishContext();
19678 static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew2(PyObject *__pyx_v_a, PyObject *__pyx_v_b) {
19679 PyObject *__pyx_r = NULL;
19680 __Pyx_RefNannyDeclarations
19681 PyObject *__pyx_t_1 = NULL;
19682 int __pyx_lineno = 0;
19683 const char *__pyx_filename = NULL;
19684 int __pyx_clineno = 0;
19685 __Pyx_RefNannySetupContext(
"PyArray_MultiIterNew2", 0);
19694 __Pyx_XDECREF(__pyx_r);
19695 __pyx_t_1 = PyArray_MultiIterNew(2, ((
void *)__pyx_v_a), ((
void *)__pyx_v_b));
if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 739, __pyx_L1_error)
19696 __Pyx_GOTREF(__pyx_t_1);
19697 __pyx_r = __pyx_t_1;
19711 __Pyx_XDECREF(__pyx_t_1);
19712 __Pyx_AddTraceback(
"numpy.PyArray_MultiIterNew2", __pyx_clineno, __pyx_lineno, __pyx_filename);
19715 __Pyx_XGIVEREF(__pyx_r);
19716 __Pyx_RefNannyFinishContext();
19728 static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew3(PyObject *__pyx_v_a, PyObject *__pyx_v_b, PyObject *__pyx_v_c) {
19729 PyObject *__pyx_r = NULL;
19730 __Pyx_RefNannyDeclarations
19731 PyObject *__pyx_t_1 = NULL;
19732 int __pyx_lineno = 0;
19733 const char *__pyx_filename = NULL;
19734 int __pyx_clineno = 0;
19735 __Pyx_RefNannySetupContext(
"PyArray_MultiIterNew3", 0);
19744 __Pyx_XDECREF(__pyx_r);
19745 __pyx_t_1 = PyArray_MultiIterNew(3, ((
void *)__pyx_v_a), ((
void *)__pyx_v_b), ((
void *)__pyx_v_c));
if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 742, __pyx_L1_error)
19746 __Pyx_GOTREF(__pyx_t_1);
19747 __pyx_r = __pyx_t_1;
19761 __Pyx_XDECREF(__pyx_t_1);
19762 __Pyx_AddTraceback(
"numpy.PyArray_MultiIterNew3", __pyx_clineno, __pyx_lineno, __pyx_filename);
19765 __Pyx_XGIVEREF(__pyx_r);
19766 __Pyx_RefNannyFinishContext();
19778 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) {
19779 PyObject *__pyx_r = NULL;
19780 __Pyx_RefNannyDeclarations
19781 PyObject *__pyx_t_1 = NULL;
19782 int __pyx_lineno = 0;
19783 const char *__pyx_filename = NULL;
19784 int __pyx_clineno = 0;
19785 __Pyx_RefNannySetupContext(
"PyArray_MultiIterNew4", 0);
19794 __Pyx_XDECREF(__pyx_r);
19795 __pyx_t_1 = PyArray_MultiIterNew(4, ((
void *)__pyx_v_a), ((
void *)__pyx_v_b), ((
void *)__pyx_v_c), ((
void *)__pyx_v_d));
if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 745, __pyx_L1_error)
19796 __Pyx_GOTREF(__pyx_t_1);
19797 __pyx_r = __pyx_t_1;
19811 __Pyx_XDECREF(__pyx_t_1);
19812 __Pyx_AddTraceback(
"numpy.PyArray_MultiIterNew4", __pyx_clineno, __pyx_lineno, __pyx_filename);
19815 __Pyx_XGIVEREF(__pyx_r);
19816 __Pyx_RefNannyFinishContext();
19828 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) {
19829 PyObject *__pyx_r = NULL;
19830 __Pyx_RefNannyDeclarations
19831 PyObject *__pyx_t_1 = NULL;
19832 int __pyx_lineno = 0;
19833 const char *__pyx_filename = NULL;
19834 int __pyx_clineno = 0;
19835 __Pyx_RefNannySetupContext(
"PyArray_MultiIterNew5", 0);
19844 __Pyx_XDECREF(__pyx_r);
19845 __pyx_t_1 = PyArray_MultiIterNew(5, ((
void *)__pyx_v_a), ((
void *)__pyx_v_b), ((
void *)__pyx_v_c), ((
void *)__pyx_v_d), ((
void *)__pyx_v_e));
if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 748, __pyx_L1_error)
19846 __Pyx_GOTREF(__pyx_t_1);
19847 __pyx_r = __pyx_t_1;
19861 __Pyx_XDECREF(__pyx_t_1);
19862 __Pyx_AddTraceback(
"numpy.PyArray_MultiIterNew5", __pyx_clineno, __pyx_lineno, __pyx_filename);
19865 __Pyx_XGIVEREF(__pyx_r);
19866 __Pyx_RefNannyFinishContext();
19878 static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyDataType_SHAPE(PyArray_Descr *__pyx_v_d) {
19879 PyObject *__pyx_r = NULL;
19880 __Pyx_RefNannyDeclarations
19882 __Pyx_RefNannySetupContext(
"PyDataType_SHAPE", 0);
19891 __pyx_t_1 = (PyDataType_HASSUBARRAY(__pyx_v_d) != 0);
19901 __Pyx_XDECREF(__pyx_r);
19902 __Pyx_INCREF(((PyObject*)__pyx_v_d->subarray->shape));
19903 __pyx_r = ((PyObject*)__pyx_v_d->subarray->shape);
19923 __Pyx_XDECREF(__pyx_r);
19924 __Pyx_INCREF(__pyx_empty_tuple);
19925 __pyx_r = __pyx_empty_tuple;
19939 __Pyx_XGIVEREF(__pyx_r);
19940 __Pyx_RefNannyFinishContext();
19952 static CYTHON_INLINE
void __pyx_f_5numpy_set_array_base(PyArrayObject *__pyx_v_arr, PyObject *__pyx_v_base) {
19953 __Pyx_RefNannyDeclarations
19954 __Pyx_RefNannySetupContext(
"set_array_base", 0);
19963 Py_INCREF(__pyx_v_base);
19972 (void)(PyArray_SetBaseObject(__pyx_v_arr, __pyx_v_base));
19983 __Pyx_RefNannyFinishContext();
19994 static CYTHON_INLINE PyObject *__pyx_f_5numpy_get_array_base(PyArrayObject *__pyx_v_arr) {
19995 PyObject *__pyx_v_base;
19996 PyObject *__pyx_r = NULL;
19997 __Pyx_RefNannyDeclarations
19999 __Pyx_RefNannySetupContext(
"get_array_base", 0);
20008 __pyx_v_base = PyArray_BASE(__pyx_v_arr);
20017 __pyx_t_1 = ((__pyx_v_base == NULL) != 0);
20027 __Pyx_XDECREF(__pyx_r);
20028 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
20047 __Pyx_XDECREF(__pyx_r);
20048 __Pyx_INCREF(((PyObject *)__pyx_v_base));
20049 __pyx_r = ((PyObject *)__pyx_v_base);
20062 __Pyx_XGIVEREF(__pyx_r);
20063 __Pyx_RefNannyFinishContext();
20075 static CYTHON_INLINE
int __pyx_f_5numpy_import_array(
void) {
20077 __Pyx_RefNannyDeclarations
20078 PyObject *__pyx_t_1 = NULL;
20079 PyObject *__pyx_t_2 = NULL;
20080 PyObject *__pyx_t_3 = NULL;
20082 PyObject *__pyx_t_5 = NULL;
20083 PyObject *__pyx_t_6 = NULL;
20084 PyObject *__pyx_t_7 = NULL;
20085 PyObject *__pyx_t_8 = NULL;
20086 int __pyx_lineno = 0;
20087 const char *__pyx_filename = NULL;
20088 int __pyx_clineno = 0;
20089 __Pyx_RefNannySetupContext(
"import_array", 0);
20099 __Pyx_PyThreadState_declare
20100 __Pyx_PyThreadState_assign
20101 __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
20102 __Pyx_XGOTREF(__pyx_t_1);
20103 __Pyx_XGOTREF(__pyx_t_2);
20104 __Pyx_XGOTREF(__pyx_t_3);
20114 __pyx_t_4 = _import_array();
if (unlikely(__pyx_t_4 == ((
int)-1))) __PYX_ERR(2, 943, __pyx_L3_error)
20124 __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
20125 __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
20126 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
20127 goto __pyx_L8_try_end;
20137 __pyx_t_4 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0])));
20139 __Pyx_AddTraceback(
"numpy.import_array", __pyx_clineno, __pyx_lineno, __pyx_filename);
20140 if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(2, 944, __pyx_L5_except_error)
20141 __Pyx_GOTREF(__pyx_t_5);
20142 __Pyx_GOTREF(__pyx_t_6);
20143 __Pyx_GOTREF(__pyx_t_7);
20152 __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_ImportError, __pyx_tuple__10, NULL);
if (unlikely(!__pyx_t_8)) __PYX_ERR(2, 945, __pyx_L5_except_error)
20153 __Pyx_GOTREF(__pyx_t_8);
20154 __Pyx_Raise(__pyx_t_8, 0, 0, 0);
20155 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
20156 __PYX_ERR(2, 945, __pyx_L5_except_error)
20158 goto __pyx_L5_except_error;
20159 __pyx_L5_except_error:;
20168 __Pyx_XGIVEREF(__pyx_t_1);
20169 __Pyx_XGIVEREF(__pyx_t_2);
20170 __Pyx_XGIVEREF(__pyx_t_3);
20171 __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
20172 goto __pyx_L1_error;
20188 __Pyx_XDECREF(__pyx_t_5);
20189 __Pyx_XDECREF(__pyx_t_6);
20190 __Pyx_XDECREF(__pyx_t_7);
20191 __Pyx_XDECREF(__pyx_t_8);
20192 __Pyx_AddTraceback(
"numpy.import_array", __pyx_clineno, __pyx_lineno, __pyx_filename);
20195 __Pyx_RefNannyFinishContext();
20207 static CYTHON_INLINE
int __pyx_f_5numpy_import_umath(
void) {
20209 __Pyx_RefNannyDeclarations
20210 PyObject *__pyx_t_1 = NULL;
20211 PyObject *__pyx_t_2 = NULL;
20212 PyObject *__pyx_t_3 = NULL;
20214 PyObject *__pyx_t_5 = NULL;
20215 PyObject *__pyx_t_6 = NULL;
20216 PyObject *__pyx_t_7 = NULL;
20217 PyObject *__pyx_t_8 = NULL;
20218 int __pyx_lineno = 0;
20219 const char *__pyx_filename = NULL;
20220 int __pyx_clineno = 0;
20221 __Pyx_RefNannySetupContext(
"import_umath", 0);
20231 __Pyx_PyThreadState_declare
20232 __Pyx_PyThreadState_assign
20233 __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
20234 __Pyx_XGOTREF(__pyx_t_1);
20235 __Pyx_XGOTREF(__pyx_t_2);
20236 __Pyx_XGOTREF(__pyx_t_3);
20246 __pyx_t_4 = _import_umath();
if (unlikely(__pyx_t_4 == ((
int)-1))) __PYX_ERR(2, 949, __pyx_L3_error)
20256 __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
20257 __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
20258 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
20259 goto __pyx_L8_try_end;
20269 __pyx_t_4 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0])));
20271 __Pyx_AddTraceback(
"numpy.import_umath", __pyx_clineno, __pyx_lineno, __pyx_filename);
20272 if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(2, 950, __pyx_L5_except_error)
20273 __Pyx_GOTREF(__pyx_t_5);
20274 __Pyx_GOTREF(__pyx_t_6);
20275 __Pyx_GOTREF(__pyx_t_7);
20284 __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_ImportError, __pyx_tuple__11, NULL);
if (unlikely(!__pyx_t_8)) __PYX_ERR(2, 951, __pyx_L5_except_error)
20285 __Pyx_GOTREF(__pyx_t_8);
20286 __Pyx_Raise(__pyx_t_8, 0, 0, 0);
20287 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
20288 __PYX_ERR(2, 951, __pyx_L5_except_error)
20290 goto __pyx_L5_except_error;
20291 __pyx_L5_except_error:;
20300 __Pyx_XGIVEREF(__pyx_t_1);
20301 __Pyx_XGIVEREF(__pyx_t_2);
20302 __Pyx_XGIVEREF(__pyx_t_3);
20303 __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
20304 goto __pyx_L1_error;
20320 __Pyx_XDECREF(__pyx_t_5);
20321 __Pyx_XDECREF(__pyx_t_6);
20322 __Pyx_XDECREF(__pyx_t_7);
20323 __Pyx_XDECREF(__pyx_t_8);
20324 __Pyx_AddTraceback(
"numpy.import_umath", __pyx_clineno, __pyx_lineno, __pyx_filename);
20327 __Pyx_RefNannyFinishContext();
20339 static CYTHON_INLINE
int __pyx_f_5numpy_import_ufunc(
void) {
20341 __Pyx_RefNannyDeclarations
20342 PyObject *__pyx_t_1 = NULL;
20343 PyObject *__pyx_t_2 = NULL;
20344 PyObject *__pyx_t_3 = NULL;
20346 PyObject *__pyx_t_5 = NULL;
20347 PyObject *__pyx_t_6 = NULL;
20348 PyObject *__pyx_t_7 = NULL;
20349 PyObject *__pyx_t_8 = NULL;
20350 int __pyx_lineno = 0;
20351 const char *__pyx_filename = NULL;
20352 int __pyx_clineno = 0;
20353 __Pyx_RefNannySetupContext(
"import_ufunc", 0);
20363 __Pyx_PyThreadState_declare
20364 __Pyx_PyThreadState_assign
20365 __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
20366 __Pyx_XGOTREF(__pyx_t_1);
20367 __Pyx_XGOTREF(__pyx_t_2);
20368 __Pyx_XGOTREF(__pyx_t_3);
20378 __pyx_t_4 = _import_umath();
if (unlikely(__pyx_t_4 == ((
int)-1))) __PYX_ERR(2, 955, __pyx_L3_error)
20388 __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
20389 __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
20390 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
20391 goto __pyx_L8_try_end;
20401 __pyx_t_4 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0])));
20403 __Pyx_AddTraceback(
"numpy.import_ufunc", __pyx_clineno, __pyx_lineno, __pyx_filename);
20404 if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(2, 956, __pyx_L5_except_error)
20405 __Pyx_GOTREF(__pyx_t_5);
20406 __Pyx_GOTREF(__pyx_t_6);
20407 __Pyx_GOTREF(__pyx_t_7);
20416 __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_ImportError, __pyx_tuple__11, NULL);
if (unlikely(!__pyx_t_8)) __PYX_ERR(2, 957, __pyx_L5_except_error)
20417 __Pyx_GOTREF(__pyx_t_8);
20418 __Pyx_Raise(__pyx_t_8, 0, 0, 0);
20419 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
20420 __PYX_ERR(2, 957, __pyx_L5_except_error)
20422 goto __pyx_L5_except_error;
20423 __pyx_L5_except_error:;
20432 __Pyx_XGIVEREF(__pyx_t_1);
20433 __Pyx_XGIVEREF(__pyx_t_2);
20434 __Pyx_XGIVEREF(__pyx_t_3);
20435 __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
20436 goto __pyx_L1_error;
20452 __Pyx_XDECREF(__pyx_t_5);
20453 __Pyx_XDECREF(__pyx_t_6);
20454 __Pyx_XDECREF(__pyx_t_7);
20455 __Pyx_XDECREF(__pyx_t_8);
20456 __Pyx_AddTraceback(
"numpy.import_ufunc", __pyx_clineno, __pyx_lineno, __pyx_filename);
20459 __Pyx_RefNannyFinishContext();
20471 static CYTHON_INLINE
int __pyx_f_5numpy_is_timedelta64_object(PyObject *__pyx_v_obj) {
20473 __Pyx_RefNannyDeclarations
20474 __Pyx_RefNannySetupContext(
"is_timedelta64_object", 0);
20483 __pyx_r = PyObject_TypeCheck(__pyx_v_obj, (&PyTimedeltaArrType_Type));
20496 __Pyx_RefNannyFinishContext();
20508 static CYTHON_INLINE
int __pyx_f_5numpy_is_datetime64_object(PyObject *__pyx_v_obj) {
20510 __Pyx_RefNannyDeclarations
20511 __Pyx_RefNannySetupContext(
"is_datetime64_object", 0);
20520 __pyx_r = PyObject_TypeCheck(__pyx_v_obj, (&PyDatetimeArrType_Type));
20533 __Pyx_RefNannyFinishContext();
20545 static CYTHON_INLINE npy_datetime __pyx_f_5numpy_get_datetime64_value(PyObject *__pyx_v_obj) {
20546 npy_datetime __pyx_r;
20555 __pyx_r = ((PyDatetimeScalarObject *)__pyx_v_obj)->obval;
20579 static CYTHON_INLINE npy_timedelta __pyx_f_5numpy_get_timedelta64_value(PyObject *__pyx_v_obj) {
20580 npy_timedelta __pyx_r;
20589 __pyx_r = ((PyTimedeltaScalarObject *)__pyx_v_obj)->obval;
20613 static CYTHON_INLINE NPY_DATETIMEUNIT __pyx_f_5numpy_get_datetime64_unit(PyObject *__pyx_v_obj) {
20614 NPY_DATETIMEUNIT __pyx_r;
20621 __pyx_r = ((NPY_DATETIMEUNIT)((PyDatetimeScalarObject *)__pyx_v_obj)->obmeta.base);
20646 static int __pyx_array___cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
20647 static int __pyx_array___cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
20648 PyObject *__pyx_v_shape = 0;
20649 Py_ssize_t __pyx_v_itemsize;
20650 PyObject *__pyx_v_format = 0;
20651 PyObject *__pyx_v_mode = 0;
20652 int __pyx_v_allocate_buffer;
20653 int __pyx_lineno = 0;
20654 const char *__pyx_filename = NULL;
20655 int __pyx_clineno = 0;
20657 __Pyx_RefNannyDeclarations
20658 __Pyx_RefNannySetupContext(
"__cinit__ (wrapper)", 0);
20660 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};
20661 PyObject* values[5] = {0,0,0,0,0};
20662 values[3] = ((PyObject *)__pyx_n_s_c);
20663 if (unlikely(__pyx_kwds)) {
20664 Py_ssize_t kw_args;
20665 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
20666 switch (pos_args) {
20667 case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
20668 CYTHON_FALLTHROUGH;
20669 case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
20670 CYTHON_FALLTHROUGH;
20671 case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
20672 CYTHON_FALLTHROUGH;
20673 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
20674 CYTHON_FALLTHROUGH;
20675 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
20676 CYTHON_FALLTHROUGH;
20678 default:
goto __pyx_L5_argtuple_error;
20680 kw_args = PyDict_Size(__pyx_kwds);
20681 switch (pos_args) {
20683 if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_shape)) != 0)) kw_args--;
20684 else goto __pyx_L5_argtuple_error;
20685 CYTHON_FALLTHROUGH;
20687 if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_itemsize)) != 0)) kw_args--;
20689 __Pyx_RaiseArgtupleInvalid(
"__cinit__", 0, 3, 5, 1); __PYX_ERR(1, 122, __pyx_L3_error)
20691 CYTHON_FALLTHROUGH;
20693 if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_format)) != 0)) kw_args--;
20695 __Pyx_RaiseArgtupleInvalid(
"__cinit__", 0, 3, 5, 2); __PYX_ERR(1, 122, __pyx_L3_error)
20697 CYTHON_FALLTHROUGH;
20700 PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_mode);
20701 if (value) { values[3] = value; kw_args--; }
20703 CYTHON_FALLTHROUGH;
20706 PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_allocate_buffer);
20707 if (value) { values[4] = value; kw_args--; }
20710 if (unlikely(kw_args > 0)) {
20711 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args,
"__cinit__") < 0)) __PYX_ERR(1, 122, __pyx_L3_error)
20714 switch (PyTuple_GET_SIZE(__pyx_args)) {
20715 case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
20716 CYTHON_FALLTHROUGH;
20717 case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
20718 CYTHON_FALLTHROUGH;
20719 case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
20720 values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
20721 values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
20723 default:
goto __pyx_L5_argtuple_error;
20726 __pyx_v_shape = ((PyObject*)values[0]);
20727 __pyx_v_itemsize = __Pyx_PyIndex_AsSsize_t(values[1]);
if (unlikely((__pyx_v_itemsize == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(1, 122, __pyx_L3_error)
20728 __pyx_v_format = values[2];
20729 __pyx_v_mode = values[3];
20731 __pyx_v_allocate_buffer = __Pyx_PyObject_IsTrue(values[4]);
if (unlikely((__pyx_v_allocate_buffer == (
int)-1) && PyErr_Occurred())) __PYX_ERR(1, 123, __pyx_L3_error)
20741 __pyx_v_allocate_buffer = ((int)1);
20744 goto __pyx_L4_argument_unpacking_done;
20745 __pyx_L5_argtuple_error:;
20746 __Pyx_RaiseArgtupleInvalid(
"__cinit__", 0, 3, 5, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(1, 122, __pyx_L3_error)
20748 __Pyx_AddTraceback(
"View.MemoryView.array.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
20749 __Pyx_RefNannyFinishContext();
20751 __pyx_L4_argument_unpacking_done:;
20752 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_shape), (&PyTuple_Type), 1,
"shape", 1))) __PYX_ERR(1, 122, __pyx_L1_error)
20753 if (unlikely(((PyObject *)__pyx_v_format) == Py_None)) {
20754 PyErr_Format(PyExc_TypeError,
"Argument '%.200s' must not be None",
"format"); __PYX_ERR(1, 122, __pyx_L1_error)
20756 __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);
20771 __Pyx_RefNannyFinishContext();
20775 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) {
20777 Py_ssize_t __pyx_v_i;
20778 Py_ssize_t __pyx_v_dim;
20779 PyObject **__pyx_v_p;
20780 char __pyx_v_order;
20782 __Pyx_RefNannyDeclarations
20783 Py_ssize_t __pyx_t_1;
20785 PyObject *__pyx_t_3 = NULL;
20787 PyObject *__pyx_t_5 = NULL;
20788 PyObject *__pyx_t_6 = NULL;
20791 Py_ssize_t __pyx_t_9;
20792 PyObject *__pyx_t_10 = NULL;
20793 Py_ssize_t __pyx_t_11;
20794 int __pyx_lineno = 0;
20795 const char *__pyx_filename = NULL;
20796 int __pyx_clineno = 0;
20797 __Pyx_RefNannySetupContext(
"__cinit__", 0);
20798 __Pyx_INCREF(__pyx_v_format);
20807 if (unlikely(__pyx_v_shape == Py_None)) {
20808 PyErr_SetString(PyExc_TypeError,
"object of type 'NoneType' has no len()");
20809 __PYX_ERR(1, 129, __pyx_L1_error)
20811 __pyx_t_1 = PyTuple_GET_SIZE(__pyx_v_shape);
if (unlikely(__pyx_t_1 == ((Py_ssize_t)-1))) __PYX_ERR(1, 129, __pyx_L1_error)
20812 __pyx_v_self->ndim = ((int)__pyx_t_1);
20821 __pyx_v_self->itemsize = __pyx_v_itemsize;
20830 __pyx_t_2 = ((!(__pyx_v_self->ndim != 0)) != 0);
20831 if (unlikely(__pyx_t_2)) {
20840 __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__12, NULL);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 133, __pyx_L1_error)
20841 __Pyx_GOTREF(__pyx_t_3);
20842 __Pyx_Raise(__pyx_t_3, 0, 0, 0);
20843 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
20844 __PYX_ERR(1, 133, __pyx_L1_error)
20862 __pyx_t_2 = ((__pyx_v_itemsize <= 0) != 0);
20863 if (unlikely(__pyx_t_2)) {
20872 __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__13, NULL);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 136, __pyx_L1_error)
20873 __Pyx_GOTREF(__pyx_t_3);
20874 __Pyx_Raise(__pyx_t_3, 0, 0, 0);
20875 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
20876 __PYX_ERR(1, 136, __pyx_L1_error)
20894 __pyx_t_2 = PyBytes_Check(__pyx_v_format);
20895 __pyx_t_4 = ((!(__pyx_t_2 != 0)) != 0);
20905 __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_format, __pyx_n_s_encode);
if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 139, __pyx_L1_error)
20906 __Pyx_GOTREF(__pyx_t_5);
20908 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) {
20909 __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5);
20910 if (likely(__pyx_t_6)) {
20911 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_5);
20912 __Pyx_INCREF(__pyx_t_6);
20913 __Pyx_INCREF(
function);
20914 __Pyx_DECREF_SET(__pyx_t_5,
function);
20917 __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);
20918 __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
20919 if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 139, __pyx_L1_error)
20920 __Pyx_GOTREF(__pyx_t_3);
20921 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
20922 __Pyx_DECREF_SET(__pyx_v_format, __pyx_t_3);
20941 if (!(likely(PyBytes_CheckExact(__pyx_v_format))||((__pyx_v_format) == Py_None)||(PyErr_Format(PyExc_TypeError,
"Expected %.16s, got %.200s",
"bytes", Py_TYPE(__pyx_v_format)->tp_name), 0))) __PYX_ERR(1, 140, __pyx_L1_error)
20942 __pyx_t_3 = __pyx_v_format;
20943 __Pyx_INCREF(__pyx_t_3);
20944 __Pyx_GIVEREF(__pyx_t_3);
20945 __Pyx_GOTREF(__pyx_v_self->_format);
20946 __Pyx_DECREF(__pyx_v_self->_format);
20947 __pyx_v_self->_format = ((PyObject*)__pyx_t_3);
20957 if (unlikely(__pyx_v_self->_format == Py_None)) {
20958 PyErr_SetString(PyExc_TypeError,
"expected bytes, NoneType found");
20959 __PYX_ERR(1, 141, __pyx_L1_error)
20961 __pyx_t_7 = __Pyx_PyBytes_AsWritableString(__pyx_v_self->_format);
if (unlikely((!__pyx_t_7) && PyErr_Occurred())) __PYX_ERR(1, 141, __pyx_L1_error)
20962 __pyx_v_self->format = __pyx_t_7;
20971 __pyx_v_self->_shape = ((Py_ssize_t *)PyObject_Malloc((((
sizeof(Py_ssize_t)) * __pyx_v_self->ndim) * 2)));
20980 __pyx_v_self->_strides = (__pyx_v_self->_shape + __pyx_v_self->ndim);
20989 __pyx_t_4 = ((!(__pyx_v_self->_shape != 0)) != 0);
20990 if (unlikely(__pyx_t_4)) {
20999 __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_MemoryError, __pyx_tuple__14, NULL);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 148, __pyx_L1_error)
21000 __Pyx_GOTREF(__pyx_t_3);
21001 __Pyx_Raise(__pyx_t_3, 0, 0, 0);
21002 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
21003 __PYX_ERR(1, 148, __pyx_L1_error)
21022 __pyx_t_3 = __pyx_v_shape; __Pyx_INCREF(__pyx_t_3); __pyx_t_1 = 0;
21024 if (__pyx_t_1 >= PyTuple_GET_SIZE(__pyx_t_3))
break;
21025 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
21026 __pyx_t_5 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_1); __Pyx_INCREF(__pyx_t_5); __pyx_t_1++;
if (unlikely(0 < 0)) __PYX_ERR(1, 151, __pyx_L1_error)
21028 __pyx_t_5 = PySequence_ITEM(__pyx_t_3, __pyx_t_1); __pyx_t_1++;
if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 151, __pyx_L1_error)
21029 __Pyx_GOTREF(__pyx_t_5);
21031 __pyx_t_9 = __Pyx_PyIndex_AsSsize_t(__pyx_t_5);
if (unlikely((__pyx_t_9 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(1, 151, __pyx_L1_error)
21032 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
21033 __pyx_v_dim = __pyx_t_9;
21034 __pyx_v_idx = __pyx_t_8;
21035 __pyx_t_8 = (__pyx_t_8 + 1);
21044 __pyx_t_4 = ((__pyx_v_dim <= 0) != 0);
21045 if (unlikely(__pyx_t_4)) {
21054 __pyx_t_5 = __Pyx_PyInt_From_int(__pyx_v_idx);
if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 153, __pyx_L1_error)
21055 __Pyx_GOTREF(__pyx_t_5);
21056 __pyx_t_6 = PyInt_FromSsize_t(__pyx_v_dim);
if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 153, __pyx_L1_error)
21057 __Pyx_GOTREF(__pyx_t_6);
21058 __pyx_t_10 = PyTuple_New(2);
if (unlikely(!__pyx_t_10)) __PYX_ERR(1, 153, __pyx_L1_error)
21059 __Pyx_GOTREF(__pyx_t_10);
21060 __Pyx_GIVEREF(__pyx_t_5);
21061 PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_5);
21062 __Pyx_GIVEREF(__pyx_t_6);
21063 PyTuple_SET_ITEM(__pyx_t_10, 1, __pyx_t_6);
21066 __pyx_t_6 = __Pyx_PyString_Format(__pyx_kp_s_Invalid_shape_in_axis_d_d, __pyx_t_10);
if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 153, __pyx_L1_error)
21067 __Pyx_GOTREF(__pyx_t_6);
21068 __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
21069 __pyx_t_10 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_6);
if (unlikely(!__pyx_t_10)) __PYX_ERR(1, 153, __pyx_L1_error)
21070 __Pyx_GOTREF(__pyx_t_10);
21071 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
21072 __Pyx_Raise(__pyx_t_10, 0, 0, 0);
21073 __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
21074 __PYX_ERR(1, 153, __pyx_L1_error)
21092 (__pyx_v_self->_shape[__pyx_v_idx]) = __pyx_v_dim;
21102 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
21111 __pyx_t_4 = (__Pyx_PyString_Equals(__pyx_v_mode, __pyx_n_s_fortran, Py_EQ));
if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(1, 157, __pyx_L1_error)
21121 __pyx_v_order =
'F';
21130 __Pyx_INCREF(__pyx_n_u_fortran);
21131 __Pyx_GIVEREF(__pyx_n_u_fortran);
21132 __Pyx_GOTREF(__pyx_v_self->mode);
21133 __Pyx_DECREF(__pyx_v_self->mode);
21134 __pyx_v_self->mode = __pyx_n_u_fortran;
21153 __pyx_t_4 = (__Pyx_PyString_Equals(__pyx_v_mode, __pyx_n_s_c, Py_EQ));
if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(1, 160, __pyx_L1_error)
21154 if (likely(__pyx_t_4)) {
21163 __pyx_v_order =
'C';
21172 __Pyx_INCREF(__pyx_n_u_c);
21173 __Pyx_GIVEREF(__pyx_n_u_c);
21174 __Pyx_GOTREF(__pyx_v_self->mode);
21175 __Pyx_DECREF(__pyx_v_self->mode);
21176 __pyx_v_self->mode = __pyx_n_u_c;
21196 __pyx_t_3 = __Pyx_PyString_FormatSafe(__pyx_kp_s_Invalid_mode_expected_c_or_fortr, __pyx_v_mode);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 164, __pyx_L1_error)
21197 __Pyx_GOTREF(__pyx_t_3);
21198 __pyx_t_10 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_3);
if (unlikely(!__pyx_t_10)) __PYX_ERR(1, 164, __pyx_L1_error)
21199 __Pyx_GOTREF(__pyx_t_10);
21200 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
21201 __Pyx_Raise(__pyx_t_10, 0, 0, 0);
21202 __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
21203 __PYX_ERR(1, 164, __pyx_L1_error)
21214 __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);
21223 __pyx_v_self->free_data = __pyx_v_allocate_buffer;
21232 __pyx_t_10 = PyObject_RichCompare(__pyx_v_format, __pyx_n_b_O, Py_EQ); __Pyx_XGOTREF(__pyx_t_10);
if (unlikely(!__pyx_t_10)) __PYX_ERR(1, 170, __pyx_L1_error)
21233 __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_10);
if (unlikely((__pyx_t_4 == (
int)-1) && PyErr_Occurred())) __PYX_ERR(1, 170, __pyx_L1_error)
21234 __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
21235 __pyx_v_self->dtype_is_object = __pyx_t_4;
21244 __pyx_t_4 = (__pyx_v_allocate_buffer != 0);
21254 __pyx_v_self->data = ((
char *)malloc(__pyx_v_self->len));
21263 __pyx_t_4 = ((!(__pyx_v_self->data != 0)) != 0);
21264 if (unlikely(__pyx_t_4)) {
21273 __pyx_t_10 = __Pyx_PyObject_Call(__pyx_builtin_MemoryError, __pyx_tuple__15, NULL);
if (unlikely(!__pyx_t_10)) __PYX_ERR(1, 176, __pyx_L1_error)
21274 __Pyx_GOTREF(__pyx_t_10);
21275 __Pyx_Raise(__pyx_t_10, 0, 0, 0);
21276 __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
21277 __PYX_ERR(1, 176, __pyx_L1_error)
21295 __pyx_t_4 = (__pyx_v_self->dtype_is_object != 0);
21305 __pyx_v_p = ((PyObject **)__pyx_v_self->data);
21314 if (unlikely(__pyx_v_itemsize == 0)) {
21315 PyErr_SetString(PyExc_ZeroDivisionError,
"integer division or modulo by zero");
21316 __PYX_ERR(1, 180, __pyx_L1_error)
21318 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))) {
21319 PyErr_SetString(PyExc_OverflowError,
"value too large to perform division");
21320 __PYX_ERR(1, 180, __pyx_L1_error)
21322 __pyx_t_1 = (__pyx_v_self->len / __pyx_v_itemsize);
21323 __pyx_t_9 = __pyx_t_1;
21324 for (__pyx_t_11 = 0; __pyx_t_11 < __pyx_t_9; __pyx_t_11+=1) {
21325 __pyx_v_i = __pyx_t_11;
21334 (__pyx_v_p[__pyx_v_i]) = Py_None;
21343 Py_INCREF(Py_None);
21376 __Pyx_XDECREF(__pyx_t_3);
21377 __Pyx_XDECREF(__pyx_t_5);
21378 __Pyx_XDECREF(__pyx_t_6);
21379 __Pyx_XDECREF(__pyx_t_10);
21380 __Pyx_AddTraceback(
"View.MemoryView.array.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
21383 __Pyx_XDECREF(__pyx_v_format);
21384 __Pyx_RefNannyFinishContext();
21397 static CYTHON_UNUSED
int __pyx_array_getbuffer(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info,
int __pyx_v_flags);
21398 static CYTHON_UNUSED
int __pyx_array_getbuffer(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info,
int __pyx_v_flags) {
21400 __Pyx_RefNannyDeclarations
21401 __Pyx_RefNannySetupContext(
"__getbuffer__ (wrapper)", 0);
21402 __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));
21405 __Pyx_RefNannyFinishContext();
21409 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) {
21410 int __pyx_v_bufmode;
21412 __Pyx_RefNannyDeclarations
21415 PyObject *__pyx_t_3 = NULL;
21417 Py_ssize_t __pyx_t_5;
21419 Py_ssize_t *__pyx_t_7;
21420 int __pyx_lineno = 0;
21421 const char *__pyx_filename = NULL;
21422 int __pyx_clineno = 0;
21423 if (__pyx_v_info == NULL) {
21424 PyErr_SetString(PyExc_BufferError,
"PyObject_GetBuffer: view==NULL argument is obsolete");
21427 __Pyx_RefNannySetupContext(
"__getbuffer__", 0);
21428 __pyx_v_info->obj = Py_None; __Pyx_INCREF(Py_None);
21429 __Pyx_GIVEREF(__pyx_v_info->obj);
21438 __pyx_v_bufmode = -1;
21447 __pyx_t_1 = (__Pyx_PyUnicode_Equals(__pyx_v_self->mode, __pyx_n_u_c, Py_EQ));
if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(1, 187, __pyx_L1_error)
21448 __pyx_t_2 = (__pyx_t_1 != 0);
21458 __pyx_v_bufmode = (PyBUF_C_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS);
21477 __pyx_t_2 = (__Pyx_PyUnicode_Equals(__pyx_v_self->mode, __pyx_n_u_fortran, Py_EQ));
if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(1, 189, __pyx_L1_error)
21478 __pyx_t_1 = (__pyx_t_2 != 0);
21488 __pyx_v_bufmode = (PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS);
21507 __pyx_t_1 = ((!((__pyx_v_flags & __pyx_v_bufmode) != 0)) != 0);
21508 if (unlikely(__pyx_t_1)) {
21517 __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__16, NULL);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 192, __pyx_L1_error)
21518 __Pyx_GOTREF(__pyx_t_3);
21519 __Pyx_Raise(__pyx_t_3, 0, 0, 0);
21520 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
21521 __PYX_ERR(1, 192, __pyx_L1_error)
21539 __pyx_t_4 = __pyx_v_self->data;
21540 __pyx_v_info->buf = __pyx_t_4;
21549 __pyx_t_5 = __pyx_v_self->len;
21550 __pyx_v_info->len = __pyx_t_5;
21559 __pyx_t_6 = __pyx_v_self->ndim;
21560 __pyx_v_info->ndim = __pyx_t_6;
21569 __pyx_t_7 = __pyx_v_self->_shape;
21570 __pyx_v_info->shape = __pyx_t_7;
21579 __pyx_t_7 = __pyx_v_self->_strides;
21580 __pyx_v_info->strides = __pyx_t_7;
21589 __pyx_v_info->suboffsets = NULL;
21598 __pyx_t_5 = __pyx_v_self->itemsize;
21599 __pyx_v_info->itemsize = __pyx_t_5;
21608 __pyx_v_info->readonly = 0;
21617 __pyx_t_1 = ((__pyx_v_flags & PyBUF_FORMAT) != 0);
21627 __pyx_t_4 = __pyx_v_self->format;
21628 __pyx_v_info->format = __pyx_t_4;
21648 __pyx_v_info->format = NULL;
21659 __Pyx_INCREF(((PyObject *)__pyx_v_self));
21660 __Pyx_GIVEREF(((PyObject *)__pyx_v_self));
21661 __Pyx_GOTREF(__pyx_v_info->obj);
21662 __Pyx_DECREF(__pyx_v_info->obj);
21663 __pyx_v_info->obj = ((PyObject *)__pyx_v_self);
21677 __Pyx_XDECREF(__pyx_t_3);
21678 __Pyx_AddTraceback(
"View.MemoryView.array.__getbuffer__", __pyx_clineno, __pyx_lineno, __pyx_filename);
21680 if (__pyx_v_info->obj != NULL) {
21681 __Pyx_GOTREF(__pyx_v_info->obj);
21682 __Pyx_DECREF(__pyx_v_info->obj); __pyx_v_info->obj = 0;
21686 if (__pyx_v_info->obj == Py_None) {
21687 __Pyx_GOTREF(__pyx_v_info->obj);
21688 __Pyx_DECREF(__pyx_v_info->obj); __pyx_v_info->obj = 0;
21691 __Pyx_RefNannyFinishContext();
21704 static void __pyx_array___dealloc__(PyObject *__pyx_v_self);
21705 static void __pyx_array___dealloc__(PyObject *__pyx_v_self) {
21706 __Pyx_RefNannyDeclarations
21707 __Pyx_RefNannySetupContext(
"__dealloc__ (wrapper)", 0);
21708 __pyx_array___pyx_pf_15View_dot_MemoryView_5array_4__dealloc__(((
struct __pyx_array_obj *)__pyx_v_self));
21711 __Pyx_RefNannyFinishContext();
21714 static void __pyx_array___pyx_pf_15View_dot_MemoryView_5array_4__dealloc__(
struct __pyx_array_obj *__pyx_v_self) {
21715 __Pyx_RefNannyDeclarations
21717 __Pyx_RefNannySetupContext(
"__dealloc__", 0);
21726 __pyx_t_1 = ((__pyx_v_self->callback_free_data != NULL) != 0);
21736 __pyx_v_self->callback_free_data(__pyx_v_self->data);
21755 __pyx_t_1 = (__pyx_v_self->free_data != 0);
21765 __pyx_t_1 = (__pyx_v_self->dtype_is_object != 0);
21775 __pyx_memoryview_refcount_objects_in_slice(__pyx_v_self->data, __pyx_v_self->_shape, __pyx_v_self->_strides, __pyx_v_self->ndim, 0);
21793 free(__pyx_v_self->data);
21812 PyObject_Free(__pyx_v_self->_shape);
21823 __Pyx_RefNannyFinishContext();
21835 static PyObject *__pyx_pw_15View_dot_MemoryView_5array_7memview_1__get__(PyObject *__pyx_v_self);
21836 static PyObject *__pyx_pw_15View_dot_MemoryView_5array_7memview_1__get__(PyObject *__pyx_v_self) {
21837 PyObject *__pyx_r = 0;
21838 __Pyx_RefNannyDeclarations
21839 __Pyx_RefNannySetupContext(
"__get__ (wrapper)", 0);
21840 __pyx_r = __pyx_pf_15View_dot_MemoryView_5array_7memview___get__(((
struct __pyx_array_obj *)__pyx_v_self));
21843 __Pyx_RefNannyFinishContext();
21847 static PyObject *__pyx_pf_15View_dot_MemoryView_5array_7memview___get__(
struct __pyx_array_obj *__pyx_v_self) {
21848 PyObject *__pyx_r = NULL;
21849 __Pyx_RefNannyDeclarations
21850 PyObject *__pyx_t_1 = NULL;
21851 int __pyx_lineno = 0;
21852 const char *__pyx_filename = NULL;
21853 int __pyx_clineno = 0;
21854 __Pyx_RefNannySetupContext(
"__get__", 0);
21863 __Pyx_XDECREF(__pyx_r);
21864 __pyx_t_1 = ((
struct __pyx_vtabstruct_array *)__pyx_v_self->__pyx_vtab)->get_memview(__pyx_v_self);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 223, __pyx_L1_error)
21865 __Pyx_GOTREF(__pyx_t_1);
21866 __pyx_r = __pyx_t_1;
21880 __Pyx_XDECREF(__pyx_t_1);
21881 __Pyx_AddTraceback(
"View.MemoryView.array.memview.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
21884 __Pyx_XGIVEREF(__pyx_r);
21885 __Pyx_RefNannyFinishContext();
21897 static PyObject *__pyx_array_get_memview(
struct __pyx_array_obj *__pyx_v_self) {
21899 PyObject *__pyx_r = NULL;
21900 __Pyx_RefNannyDeclarations
21901 PyObject *__pyx_t_1 = NULL;
21902 PyObject *__pyx_t_2 = NULL;
21903 PyObject *__pyx_t_3 = NULL;
21904 int __pyx_lineno = 0;
21905 const char *__pyx_filename = NULL;
21906 int __pyx_clineno = 0;
21907 __Pyx_RefNannySetupContext(
"get_memview", 0);
21916 __pyx_v_flags = ((PyBUF_ANY_CONTIGUOUS | PyBUF_FORMAT) | PyBUF_WRITABLE);
21925 __Pyx_XDECREF(__pyx_r);
21926 __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_flags);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 228, __pyx_L1_error)
21927 __Pyx_GOTREF(__pyx_t_1);
21928 __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_v_self->dtype_is_object);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 228, __pyx_L1_error)
21929 __Pyx_GOTREF(__pyx_t_2);
21930 __pyx_t_3 = PyTuple_New(3);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 228, __pyx_L1_error)
21931 __Pyx_GOTREF(__pyx_t_3);
21932 __Pyx_INCREF(((PyObject *)__pyx_v_self));
21933 __Pyx_GIVEREF(((PyObject *)__pyx_v_self));
21934 PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_v_self));
21935 __Pyx_GIVEREF(__pyx_t_1);
21936 PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_1);
21937 __Pyx_GIVEREF(__pyx_t_2);
21938 PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_t_2);
21941 __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_memoryview_type), __pyx_t_3, NULL);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 228, __pyx_L1_error)
21942 __Pyx_GOTREF(__pyx_t_2);
21943 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
21944 __pyx_r = __pyx_t_2;
21958 __Pyx_XDECREF(__pyx_t_1);
21959 __Pyx_XDECREF(__pyx_t_2);
21960 __Pyx_XDECREF(__pyx_t_3);
21961 __Pyx_AddTraceback(
"View.MemoryView.array.get_memview", __pyx_clineno, __pyx_lineno, __pyx_filename);
21964 __Pyx_XGIVEREF(__pyx_r);
21965 __Pyx_RefNannyFinishContext();
21978 static Py_ssize_t __pyx_array___len__(PyObject *__pyx_v_self);
21979 static Py_ssize_t __pyx_array___len__(PyObject *__pyx_v_self) {
21980 Py_ssize_t __pyx_r;
21981 __Pyx_RefNannyDeclarations
21982 __Pyx_RefNannySetupContext(
"__len__ (wrapper)", 0);
21983 __pyx_r = __pyx_array___pyx_pf_15View_dot_MemoryView_5array_6__len__(((
struct __pyx_array_obj *)__pyx_v_self));
21986 __Pyx_RefNannyFinishContext();
21990 static Py_ssize_t __pyx_array___pyx_pf_15View_dot_MemoryView_5array_6__len__(
struct __pyx_array_obj *__pyx_v_self) {
21991 Py_ssize_t __pyx_r;
21992 __Pyx_RefNannyDeclarations
21993 __Pyx_RefNannySetupContext(
"__len__", 0);
22002 __pyx_r = (__pyx_v_self->_shape[0]);
22015 __Pyx_RefNannyFinishContext();
22028 static PyObject *__pyx_array___getattr__(PyObject *__pyx_v_self, PyObject *__pyx_v_attr);
22029 static PyObject *__pyx_array___getattr__(PyObject *__pyx_v_self, PyObject *__pyx_v_attr) {
22030 PyObject *__pyx_r = 0;
22031 __Pyx_RefNannyDeclarations
22032 __Pyx_RefNannySetupContext(
"__getattr__ (wrapper)", 0);
22033 __pyx_r = __pyx_array___pyx_pf_15View_dot_MemoryView_5array_8__getattr__(((
struct __pyx_array_obj *)__pyx_v_self), ((PyObject *)__pyx_v_attr));
22036 __Pyx_RefNannyFinishContext();
22040 static PyObject *__pyx_array___pyx_pf_15View_dot_MemoryView_5array_8__getattr__(
struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_attr) {
22041 PyObject *__pyx_r = NULL;
22042 __Pyx_RefNannyDeclarations
22043 PyObject *__pyx_t_1 = NULL;
22044 PyObject *__pyx_t_2 = NULL;
22045 int __pyx_lineno = 0;
22046 const char *__pyx_filename = NULL;
22047 int __pyx_clineno = 0;
22048 __Pyx_RefNannySetupContext(
"__getattr__", 0);
22057 __Pyx_XDECREF(__pyx_r);
22058 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_memview);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 234, __pyx_L1_error)
22059 __Pyx_GOTREF(__pyx_t_1);
22060 __pyx_t_2 = __Pyx_GetAttr(__pyx_t_1, __pyx_v_attr);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 234, __pyx_L1_error)
22061 __Pyx_GOTREF(__pyx_t_2);
22062 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
22063 __pyx_r = __pyx_t_2;
22077 __Pyx_XDECREF(__pyx_t_1);
22078 __Pyx_XDECREF(__pyx_t_2);
22079 __Pyx_AddTraceback(
"View.MemoryView.array.__getattr__", __pyx_clineno, __pyx_lineno, __pyx_filename);
22082 __Pyx_XGIVEREF(__pyx_r);
22083 __Pyx_RefNannyFinishContext();
22096 static PyObject *__pyx_array___getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_item);
22097 static PyObject *__pyx_array___getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_item) {
22098 PyObject *__pyx_r = 0;
22099 __Pyx_RefNannyDeclarations
22100 __Pyx_RefNannySetupContext(
"__getitem__ (wrapper)", 0);
22101 __pyx_r = __pyx_array___pyx_pf_15View_dot_MemoryView_5array_10__getitem__(((
struct __pyx_array_obj *)__pyx_v_self), ((PyObject *)__pyx_v_item));
22104 __Pyx_RefNannyFinishContext();
22108 static PyObject *__pyx_array___pyx_pf_15View_dot_MemoryView_5array_10__getitem__(
struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_item) {
22109 PyObject *__pyx_r = NULL;
22110 __Pyx_RefNannyDeclarations
22111 PyObject *__pyx_t_1 = NULL;
22112 PyObject *__pyx_t_2 = NULL;
22113 int __pyx_lineno = 0;
22114 const char *__pyx_filename = NULL;
22115 int __pyx_clineno = 0;
22116 __Pyx_RefNannySetupContext(
"__getitem__", 0);
22125 __Pyx_XDECREF(__pyx_r);
22126 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_memview);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 237, __pyx_L1_error)
22127 __Pyx_GOTREF(__pyx_t_1);
22128 __pyx_t_2 = __Pyx_PyObject_GetItem(__pyx_t_1, __pyx_v_item);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 237, __pyx_L1_error)
22129 __Pyx_GOTREF(__pyx_t_2);
22130 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
22131 __pyx_r = __pyx_t_2;
22145 __Pyx_XDECREF(__pyx_t_1);
22146 __Pyx_XDECREF(__pyx_t_2);
22147 __Pyx_AddTraceback(
"View.MemoryView.array.__getitem__", __pyx_clineno, __pyx_lineno, __pyx_filename);
22150 __Pyx_XGIVEREF(__pyx_r);
22151 __Pyx_RefNannyFinishContext();
22164 static int __pyx_array___setitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_item, PyObject *__pyx_v_value);
22165 static int __pyx_array___setitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_item, PyObject *__pyx_v_value) {
22167 __Pyx_RefNannyDeclarations
22168 __Pyx_RefNannySetupContext(
"__setitem__ (wrapper)", 0);
22169 __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));
22172 __Pyx_RefNannyFinishContext();
22176 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) {
22178 __Pyx_RefNannyDeclarations
22179 PyObject *__pyx_t_1 = NULL;
22180 int __pyx_lineno = 0;
22181 const char *__pyx_filename = NULL;
22182 int __pyx_clineno = 0;
22183 __Pyx_RefNannySetupContext(
"__setitem__", 0);
22192 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_memview);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 240, __pyx_L1_error)
22193 __Pyx_GOTREF(__pyx_t_1);
22194 if (unlikely(PyObject_SetItem(__pyx_t_1, __pyx_v_item, __pyx_v_value) < 0)) __PYX_ERR(1, 240, __pyx_L1_error)
22195 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
22209 __Pyx_XDECREF(__pyx_t_1);
22210 __Pyx_AddTraceback(
"View.MemoryView.array.__setitem__", __pyx_clineno, __pyx_lineno, __pyx_filename);
22213 __Pyx_RefNannyFinishContext();
22224 static PyObject *__pyx_pw___pyx_array_1__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused);
22225 static PyObject *__pyx_pw___pyx_array_1__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
22226 PyObject *__pyx_r = 0;
22227 __Pyx_RefNannyDeclarations
22228 __Pyx_RefNannySetupContext(
"__reduce_cython__ (wrapper)", 0);
22229 __pyx_r = __pyx_pf___pyx_array___reduce_cython__(((
struct __pyx_array_obj *)__pyx_v_self));
22232 __Pyx_RefNannyFinishContext();
22236 static PyObject *__pyx_pf___pyx_array___reduce_cython__(CYTHON_UNUSED
struct __pyx_array_obj *__pyx_v_self) {
22237 PyObject *__pyx_r = NULL;
22238 __Pyx_RefNannyDeclarations
22239 PyObject *__pyx_t_1 = NULL;
22240 int __pyx_lineno = 0;
22241 const char *__pyx_filename = NULL;
22242 int __pyx_clineno = 0;
22243 __Pyx_RefNannySetupContext(
"__reduce_cython__", 0);
22251 __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__17, NULL);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 2, __pyx_L1_error)
22252 __Pyx_GOTREF(__pyx_t_1);
22253 __Pyx_Raise(__pyx_t_1, 0, 0, 0);
22254 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
22255 __PYX_ERR(1, 2, __pyx_L1_error)
22265 __Pyx_XDECREF(__pyx_t_1);
22266 __Pyx_AddTraceback(
"View.MemoryView.array.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
22268 __Pyx_XGIVEREF(__pyx_r);
22269 __Pyx_RefNannyFinishContext();
22281 static PyObject *__pyx_pw___pyx_array_3__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state);
22282 static PyObject *__pyx_pw___pyx_array_3__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
22283 PyObject *__pyx_r = 0;
22284 __Pyx_RefNannyDeclarations
22285 __Pyx_RefNannySetupContext(
"__setstate_cython__ (wrapper)", 0);
22286 __pyx_r = __pyx_pf___pyx_array_2__setstate_cython__(((
struct __pyx_array_obj *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state));
22289 __Pyx_RefNannyFinishContext();
22293 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) {
22294 PyObject *__pyx_r = NULL;
22295 __Pyx_RefNannyDeclarations
22296 PyObject *__pyx_t_1 = NULL;
22297 int __pyx_lineno = 0;
22298 const char *__pyx_filename = NULL;
22299 int __pyx_clineno = 0;
22300 __Pyx_RefNannySetupContext(
"__setstate_cython__", 0);
22307 __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__18, NULL);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 4, __pyx_L1_error)
22308 __Pyx_GOTREF(__pyx_t_1);
22309 __Pyx_Raise(__pyx_t_1, 0, 0, 0);
22310 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
22311 __PYX_ERR(1, 4, __pyx_L1_error)
22322 __Pyx_XDECREF(__pyx_t_1);
22323 __Pyx_AddTraceback(
"View.MemoryView.array.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
22325 __Pyx_XGIVEREF(__pyx_r);
22326 __Pyx_RefNannyFinishContext();
22338 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) {
22339 struct __pyx_array_obj *__pyx_v_result = 0;
22340 struct __pyx_array_obj *__pyx_r = NULL;
22341 __Pyx_RefNannyDeclarations
22343 PyObject *__pyx_t_2 = NULL;
22344 PyObject *__pyx_t_3 = NULL;
22345 PyObject *__pyx_t_4 = NULL;
22346 PyObject *__pyx_t_5 = NULL;
22347 int __pyx_lineno = 0;
22348 const char *__pyx_filename = NULL;
22349 int __pyx_clineno = 0;
22350 __Pyx_RefNannySetupContext(
"array_cwrapper", 0);
22359 __pyx_t_1 = ((__pyx_v_buf == NULL) != 0);
22369 __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_itemsize);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 249, __pyx_L1_error)
22370 __Pyx_GOTREF(__pyx_t_2);
22371 __pyx_t_3 = __Pyx_PyBytes_FromString(__pyx_v_format);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 249, __pyx_L1_error)
22372 __Pyx_GOTREF(__pyx_t_3);
22373 __pyx_t_4 = __Pyx_decode_c_string(__pyx_v_mode, 0, strlen(__pyx_v_mode), NULL, NULL, PyUnicode_DecodeASCII);
if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 249, __pyx_L1_error)
22374 __Pyx_GOTREF(__pyx_t_4);
22375 __pyx_t_5 = PyTuple_New(4);
if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 249, __pyx_L1_error)
22376 __Pyx_GOTREF(__pyx_t_5);
22377 __Pyx_INCREF(__pyx_v_shape);
22378 __Pyx_GIVEREF(__pyx_v_shape);
22379 PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_v_shape);
22380 __Pyx_GIVEREF(__pyx_t_2);
22381 PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_2);
22382 __Pyx_GIVEREF(__pyx_t_3);
22383 PyTuple_SET_ITEM(__pyx_t_5, 2, __pyx_t_3);
22384 __Pyx_GIVEREF(__pyx_t_4);
22385 PyTuple_SET_ITEM(__pyx_t_5, 3, __pyx_t_4);
22389 __pyx_t_4 = __Pyx_PyObject_Call(((PyObject *)__pyx_array_type), __pyx_t_5, NULL);
if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 249, __pyx_L1_error)
22390 __Pyx_GOTREF(__pyx_t_4);
22391 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
22392 __pyx_v_result = ((
struct __pyx_array_obj *)__pyx_t_4);
22413 __pyx_t_4 = PyInt_FromSsize_t(__pyx_v_itemsize);
if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 251, __pyx_L1_error)
22414 __Pyx_GOTREF(__pyx_t_4);
22415 __pyx_t_5 = __Pyx_PyBytes_FromString(__pyx_v_format);
if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 251, __pyx_L1_error)
22416 __Pyx_GOTREF(__pyx_t_5);
22417 __pyx_t_3 = __Pyx_decode_c_string(__pyx_v_mode, 0, strlen(__pyx_v_mode), NULL, NULL, PyUnicode_DecodeASCII);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 251, __pyx_L1_error)
22418 __Pyx_GOTREF(__pyx_t_3);
22419 __pyx_t_2 = PyTuple_New(4);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 251, __pyx_L1_error)
22420 __Pyx_GOTREF(__pyx_t_2);
22421 __Pyx_INCREF(__pyx_v_shape);
22422 __Pyx_GIVEREF(__pyx_v_shape);
22423 PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_shape);
22424 __Pyx_GIVEREF(__pyx_t_4);
22425 PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_4);
22426 __Pyx_GIVEREF(__pyx_t_5);
22427 PyTuple_SET_ITEM(__pyx_t_2, 2, __pyx_t_5);
22428 __Pyx_GIVEREF(__pyx_t_3);
22429 PyTuple_SET_ITEM(__pyx_t_2, 3, __pyx_t_3);
22441 __pyx_t_3 = __Pyx_PyDict_NewPresized(1);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 252, __pyx_L1_error)
22442 __Pyx_GOTREF(__pyx_t_3);
22443 if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_allocate_buffer, Py_False) < 0) __PYX_ERR(1, 252, __pyx_L1_error)
22452 __pyx_t_5 = __Pyx_PyObject_Call(((PyObject *)__pyx_array_type), __pyx_t_2, __pyx_t_3);
if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 251, __pyx_L1_error)
22453 __Pyx_GOTREF(__pyx_t_5);
22454 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
22455 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
22456 __pyx_v_result = ((
struct __pyx_array_obj *)__pyx_t_5);
22466 __pyx_v_result->data = __pyx_v_buf;
22477 __Pyx_XDECREF(((PyObject *)__pyx_r));
22478 __Pyx_INCREF(((PyObject *)__pyx_v_result));
22479 __pyx_r = __pyx_v_result;
22492 __Pyx_XDECREF(__pyx_t_2);
22493 __Pyx_XDECREF(__pyx_t_3);
22494 __Pyx_XDECREF(__pyx_t_4);
22495 __Pyx_XDECREF(__pyx_t_5);
22496 __Pyx_AddTraceback(
"View.MemoryView.array_cwrapper", __pyx_clineno, __pyx_lineno, __pyx_filename);
22499 __Pyx_XDECREF((PyObject *)__pyx_v_result);
22500 __Pyx_XGIVEREF((PyObject *)__pyx_r);
22501 __Pyx_RefNannyFinishContext();
22514 static int __pyx_MemviewEnum___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
22515 static int __pyx_MemviewEnum___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
22516 PyObject *__pyx_v_name = 0;
22517 int __pyx_lineno = 0;
22518 const char *__pyx_filename = NULL;
22519 int __pyx_clineno = 0;
22521 __Pyx_RefNannyDeclarations
22522 __Pyx_RefNannySetupContext(
"__init__ (wrapper)", 0);
22524 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_name,0};
22525 PyObject* values[1] = {0};
22526 if (unlikely(__pyx_kwds)) {
22527 Py_ssize_t kw_args;
22528 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
22529 switch (pos_args) {
22530 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
22531 CYTHON_FALLTHROUGH;
22533 default:
goto __pyx_L5_argtuple_error;
22535 kw_args = PyDict_Size(__pyx_kwds);
22536 switch (pos_args) {
22538 if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_name)) != 0)) kw_args--;
22539 else goto __pyx_L5_argtuple_error;
22541 if (unlikely(kw_args > 0)) {
22542 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args,
"__init__") < 0)) __PYX_ERR(1, 281, __pyx_L3_error)
22544 }
else if (PyTuple_GET_SIZE(__pyx_args) != 1) {
22545 goto __pyx_L5_argtuple_error;
22547 values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
22549 __pyx_v_name = values[0];
22551 goto __pyx_L4_argument_unpacking_done;
22552 __pyx_L5_argtuple_error:;
22553 __Pyx_RaiseArgtupleInvalid(
"__init__", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(1, 281, __pyx_L3_error)
22555 __Pyx_AddTraceback(
"View.MemoryView.Enum.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
22556 __Pyx_RefNannyFinishContext();
22558 __pyx_L4_argument_unpacking_done:;
22559 __pyx_r = __pyx_MemviewEnum___pyx_pf_15View_dot_MemoryView_4Enum___init__(((
struct __pyx_MemviewEnum_obj *)__pyx_v_self), __pyx_v_name);
22562 __Pyx_RefNannyFinishContext();
22566 static int __pyx_MemviewEnum___pyx_pf_15View_dot_MemoryView_4Enum___init__(
struct __pyx_MemviewEnum_obj *__pyx_v_self, PyObject *__pyx_v_name) {
22568 __Pyx_RefNannyDeclarations
22569 __Pyx_RefNannySetupContext(
"__init__", 0);
22578 __Pyx_INCREF(__pyx_v_name);
22579 __Pyx_GIVEREF(__pyx_v_name);
22580 __Pyx_GOTREF(__pyx_v_self->name);
22581 __Pyx_DECREF(__pyx_v_self->name);
22582 __pyx_v_self->name = __pyx_v_name;
22594 __Pyx_RefNannyFinishContext();
22607 static PyObject *__pyx_MemviewEnum___repr__(PyObject *__pyx_v_self);
22608 static PyObject *__pyx_MemviewEnum___repr__(PyObject *__pyx_v_self) {
22609 PyObject *__pyx_r = 0;
22610 __Pyx_RefNannyDeclarations
22611 __Pyx_RefNannySetupContext(
"__repr__ (wrapper)", 0);
22612 __pyx_r = __pyx_MemviewEnum___pyx_pf_15View_dot_MemoryView_4Enum_2__repr__(((
struct __pyx_MemviewEnum_obj *)__pyx_v_self));
22615 __Pyx_RefNannyFinishContext();
22619 static PyObject *__pyx_MemviewEnum___pyx_pf_15View_dot_MemoryView_4Enum_2__repr__(
struct __pyx_MemviewEnum_obj *__pyx_v_self) {
22620 PyObject *__pyx_r = NULL;
22621 __Pyx_RefNannyDeclarations
22622 __Pyx_RefNannySetupContext(
"__repr__", 0);
22631 __Pyx_XDECREF(__pyx_r);
22632 __Pyx_INCREF(__pyx_v_self->name);
22633 __pyx_r = __pyx_v_self->name;
22646 __Pyx_XGIVEREF(__pyx_r);
22647 __Pyx_RefNannyFinishContext();
22658 static PyObject *__pyx_pw___pyx_MemviewEnum_1__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused);
22659 static PyObject *__pyx_pw___pyx_MemviewEnum_1__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
22660 PyObject *__pyx_r = 0;
22661 __Pyx_RefNannyDeclarations
22662 __Pyx_RefNannySetupContext(
"__reduce_cython__ (wrapper)", 0);
22663 __pyx_r = __pyx_pf___pyx_MemviewEnum___reduce_cython__(((
struct __pyx_MemviewEnum_obj *)__pyx_v_self));
22666 __Pyx_RefNannyFinishContext();
22670 static PyObject *__pyx_pf___pyx_MemviewEnum___reduce_cython__(
struct __pyx_MemviewEnum_obj *__pyx_v_self) {
22671 PyObject *__pyx_v_state = 0;
22672 PyObject *__pyx_v__dict = 0;
22673 int __pyx_v_use_setstate;
22674 PyObject *__pyx_r = NULL;
22675 __Pyx_RefNannyDeclarations
22676 PyObject *__pyx_t_1 = NULL;
22679 PyObject *__pyx_t_4 = NULL;
22680 PyObject *__pyx_t_5 = NULL;
22681 int __pyx_lineno = 0;
22682 const char *__pyx_filename = NULL;
22683 int __pyx_clineno = 0;
22684 __Pyx_RefNannySetupContext(
"__reduce_cython__", 0);
22693 __pyx_t_1 = PyTuple_New(1);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 5, __pyx_L1_error)
22694 __Pyx_GOTREF(__pyx_t_1);
22695 __Pyx_INCREF(__pyx_v_self->name);
22696 __Pyx_GIVEREF(__pyx_v_self->name);
22697 PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_self->name);
22698 __pyx_v_state = ((PyObject*)__pyx_t_1);
22708 __pyx_t_1 = __Pyx_GetAttr3(((PyObject *)__pyx_v_self), __pyx_n_s_dict, Py_None);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 6, __pyx_L1_error)
22709 __Pyx_GOTREF(__pyx_t_1);
22710 __pyx_v__dict = __pyx_t_1;
22720 __pyx_t_2 = (__pyx_v__dict != Py_None);
22721 __pyx_t_3 = (__pyx_t_2 != 0);
22731 __pyx_t_1 = PyTuple_New(1);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 8, __pyx_L1_error)
22732 __Pyx_GOTREF(__pyx_t_1);
22733 __Pyx_INCREF(__pyx_v__dict);
22734 __Pyx_GIVEREF(__pyx_v__dict);
22735 PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v__dict);
22736 __pyx_t_4 = PyNumber_InPlaceAdd(__pyx_v_state, __pyx_t_1);
if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 8, __pyx_L1_error)
22737 __Pyx_GOTREF(__pyx_t_4);
22738 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
22739 __Pyx_DECREF_SET(__pyx_v_state, ((PyObject*)__pyx_t_4));
22749 __pyx_v_use_setstate = 1;
22769 __pyx_t_3 = (__pyx_v_self->name != Py_None);
22770 __pyx_v_use_setstate = __pyx_t_3;
22781 __pyx_t_3 = (__pyx_v_use_setstate != 0);
22791 __Pyx_XDECREF(__pyx_r);
22792 __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_pyx_unpickle_Enum);
if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 13, __pyx_L1_error)
22793 __Pyx_GOTREF(__pyx_t_4);
22794 __pyx_t_1 = PyTuple_New(3);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 13, __pyx_L1_error)
22795 __Pyx_GOTREF(__pyx_t_1);
22796 __Pyx_INCREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
22797 __Pyx_GIVEREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
22798 PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
22799 __Pyx_INCREF(__pyx_int_184977713);
22800 __Pyx_GIVEREF(__pyx_int_184977713);
22801 PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_int_184977713);
22802 __Pyx_INCREF(Py_None);
22803 __Pyx_GIVEREF(Py_None);
22804 PyTuple_SET_ITEM(__pyx_t_1, 2, Py_None);
22805 __pyx_t_5 = PyTuple_New(3);
if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 13, __pyx_L1_error)
22806 __Pyx_GOTREF(__pyx_t_5);
22807 __Pyx_GIVEREF(__pyx_t_4);
22808 PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4);
22809 __Pyx_GIVEREF(__pyx_t_1);
22810 PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_1);
22811 __Pyx_INCREF(__pyx_v_state);
22812 __Pyx_GIVEREF(__pyx_v_state);
22813 PyTuple_SET_ITEM(__pyx_t_5, 2, __pyx_v_state);
22816 __pyx_r = __pyx_t_5;
22837 __Pyx_XDECREF(__pyx_r);
22838 __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_pyx_unpickle_Enum);
if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 15, __pyx_L1_error)
22839 __Pyx_GOTREF(__pyx_t_5);
22840 __pyx_t_1 = PyTuple_New(3);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 15, __pyx_L1_error)
22841 __Pyx_GOTREF(__pyx_t_1);
22842 __Pyx_INCREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
22843 __Pyx_GIVEREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
22844 PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
22845 __Pyx_INCREF(__pyx_int_184977713);
22846 __Pyx_GIVEREF(__pyx_int_184977713);
22847 PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_int_184977713);
22848 __Pyx_INCREF(__pyx_v_state);
22849 __Pyx_GIVEREF(__pyx_v_state);
22850 PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_v_state);
22851 __pyx_t_4 = PyTuple_New(2);
if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 15, __pyx_L1_error)
22852 __Pyx_GOTREF(__pyx_t_4);
22853 __Pyx_GIVEREF(__pyx_t_5);
22854 PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_5);
22855 __Pyx_GIVEREF(__pyx_t_1);
22856 PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_1);
22859 __pyx_r = __pyx_t_4;
22872 __Pyx_XDECREF(__pyx_t_1);
22873 __Pyx_XDECREF(__pyx_t_4);
22874 __Pyx_XDECREF(__pyx_t_5);
22875 __Pyx_AddTraceback(
"View.MemoryView.Enum.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
22878 __Pyx_XDECREF(__pyx_v_state);
22879 __Pyx_XDECREF(__pyx_v__dict);
22880 __Pyx_XGIVEREF(__pyx_r);
22881 __Pyx_RefNannyFinishContext();
22893 static PyObject *__pyx_pw___pyx_MemviewEnum_3__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state);
22894 static PyObject *__pyx_pw___pyx_MemviewEnum_3__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
22895 PyObject *__pyx_r = 0;
22896 __Pyx_RefNannyDeclarations
22897 __Pyx_RefNannySetupContext(
"__setstate_cython__ (wrapper)", 0);
22898 __pyx_r = __pyx_pf___pyx_MemviewEnum_2__setstate_cython__(((
struct __pyx_MemviewEnum_obj *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state));
22901 __Pyx_RefNannyFinishContext();
22905 static PyObject *__pyx_pf___pyx_MemviewEnum_2__setstate_cython__(
struct __pyx_MemviewEnum_obj *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
22906 PyObject *__pyx_r = NULL;
22907 __Pyx_RefNannyDeclarations
22908 PyObject *__pyx_t_1 = NULL;
22909 int __pyx_lineno = 0;
22910 const char *__pyx_filename = NULL;
22911 int __pyx_clineno = 0;
22912 __Pyx_RefNannySetupContext(
"__setstate_cython__", 0);
22919 if (!(likely(PyTuple_CheckExact(__pyx_v___pyx_state))||((__pyx_v___pyx_state) == Py_None)||(PyErr_Format(PyExc_TypeError,
"Expected %.16s, got %.200s",
"tuple", Py_TYPE(__pyx_v___pyx_state)->tp_name), 0))) __PYX_ERR(1, 17, __pyx_L1_error)
22920 __pyx_t_1 = __pyx_unpickle_Enum__set_state(__pyx_v_self, ((PyObject*)__pyx_v___pyx_state));
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 17, __pyx_L1_error)
22921 __Pyx_GOTREF(__pyx_t_1);
22922 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
22932 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
22935 __Pyx_XDECREF(__pyx_t_1);
22936 __Pyx_AddTraceback(
"View.MemoryView.Enum.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
22939 __Pyx_XGIVEREF(__pyx_r);
22940 __Pyx_RefNannyFinishContext();
22952 static void *__pyx_align_pointer(
void *__pyx_v_memory,
size_t __pyx_v_alignment) {
22953 Py_intptr_t __pyx_v_aligned_p;
22954 size_t __pyx_v_offset;
22965 __pyx_v_aligned_p = ((Py_intptr_t)__pyx_v_memory);
22974 __pyx_v_offset = (__pyx_v_aligned_p % __pyx_v_alignment);
22983 __pyx_t_1 = ((__pyx_v_offset > 0) != 0);
22993 __pyx_v_aligned_p = (__pyx_v_aligned_p + (__pyx_v_alignment - __pyx_v_offset));
23011 __pyx_r = ((
void *)__pyx_v_aligned_p);
23036 static int __pyx_memoryview___cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
23037 static int __pyx_memoryview___cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
23038 PyObject *__pyx_v_obj = 0;
23040 int __pyx_v_dtype_is_object;
23041 int __pyx_lineno = 0;
23042 const char *__pyx_filename = NULL;
23043 int __pyx_clineno = 0;
23045 __Pyx_RefNannyDeclarations
23046 __Pyx_RefNannySetupContext(
"__cinit__ (wrapper)", 0);
23048 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_obj,&__pyx_n_s_flags,&__pyx_n_s_dtype_is_object,0};
23049 PyObject* values[3] = {0,0,0};
23050 if (unlikely(__pyx_kwds)) {
23051 Py_ssize_t kw_args;
23052 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
23053 switch (pos_args) {
23054 case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
23055 CYTHON_FALLTHROUGH;
23056 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
23057 CYTHON_FALLTHROUGH;
23058 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
23059 CYTHON_FALLTHROUGH;
23061 default:
goto __pyx_L5_argtuple_error;
23063 kw_args = PyDict_Size(__pyx_kwds);
23064 switch (pos_args) {
23066 if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_obj)) != 0)) kw_args--;
23067 else goto __pyx_L5_argtuple_error;
23068 CYTHON_FALLTHROUGH;
23070 if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_flags)) != 0)) kw_args--;
23072 __Pyx_RaiseArgtupleInvalid(
"__cinit__", 0, 2, 3, 1); __PYX_ERR(1, 345, __pyx_L3_error)
23074 CYTHON_FALLTHROUGH;
23077 PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_dtype_is_object);
23078 if (value) { values[2] = value; kw_args--; }
23081 if (unlikely(kw_args > 0)) {
23082 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args,
"__cinit__") < 0)) __PYX_ERR(1, 345, __pyx_L3_error)
23085 switch (PyTuple_GET_SIZE(__pyx_args)) {
23086 case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
23087 CYTHON_FALLTHROUGH;
23088 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
23089 values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
23091 default:
goto __pyx_L5_argtuple_error;
23094 __pyx_v_obj = values[0];
23095 __pyx_v_flags = __Pyx_PyInt_As_int(values[1]);
if (unlikely((__pyx_v_flags == (
int)-1) && PyErr_Occurred())) __PYX_ERR(1, 345, __pyx_L3_error)
23097 __pyx_v_dtype_is_object = __Pyx_PyObject_IsTrue(values[2]);
if (unlikely((__pyx_v_dtype_is_object == (
int)-1) && PyErr_Occurred())) __PYX_ERR(1, 345, __pyx_L3_error)
23099 __pyx_v_dtype_is_object = ((int)0);
23102 goto __pyx_L4_argument_unpacking_done;
23103 __pyx_L5_argtuple_error:;
23104 __Pyx_RaiseArgtupleInvalid(
"__cinit__", 0, 2, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(1, 345, __pyx_L3_error)
23106 __Pyx_AddTraceback(
"View.MemoryView.memoryview.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
23107 __Pyx_RefNannyFinishContext();
23109 __pyx_L4_argument_unpacking_done:;
23110 __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);
23113 __Pyx_RefNannyFinishContext();
23117 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) {
23119 __Pyx_RefNannyDeclarations
23124 int __pyx_lineno = 0;
23125 const char *__pyx_filename = NULL;
23126 int __pyx_clineno = 0;
23127 __Pyx_RefNannySetupContext(
"__cinit__", 0);
23136 __Pyx_INCREF(__pyx_v_obj);
23137 __Pyx_GIVEREF(__pyx_v_obj);
23138 __Pyx_GOTREF(__pyx_v_self->obj);
23139 __Pyx_DECREF(__pyx_v_self->obj);
23140 __pyx_v_self->obj = __pyx_v_obj;
23149 __pyx_v_self->flags = __pyx_v_flags;
23158 __pyx_t_2 = (((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))) == ((PyObject *)__pyx_memoryview_type));
23159 __pyx_t_3 = (__pyx_t_2 != 0);
23162 __pyx_t_1 = __pyx_t_3;
23163 goto __pyx_L4_bool_binop_done;
23165 __pyx_t_3 = (__pyx_v_obj != Py_None);
23166 __pyx_t_2 = (__pyx_t_3 != 0);
23167 __pyx_t_1 = __pyx_t_2;
23168 __pyx_L4_bool_binop_done:;
23178 __pyx_t_4 = __Pyx_GetBuffer(__pyx_v_obj, (&__pyx_v_self->view), __pyx_v_flags);
if (unlikely(__pyx_t_4 == ((
int)-1))) __PYX_ERR(1, 349, __pyx_L1_error)
23187 __pyx_t_1 = ((((PyObject *)__pyx_v_self->view.obj) == NULL) != 0);
23197 ((Py_buffer *)(&__pyx_v_self->view))->obj = Py_None;
23206 Py_INCREF(Py_None);
23233 __pyx_t_1 = ((__pyx_memoryview_thread_locks_used < 8) != 0);
23243 __pyx_v_self->lock = (__pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used]);
23252 __pyx_memoryview_thread_locks_used = (__pyx_memoryview_thread_locks_used + 1);
23270 __pyx_t_1 = ((__pyx_v_self->lock == NULL) != 0);
23280 __pyx_v_self->lock = PyThread_allocate_lock();
23289 __pyx_t_1 = ((__pyx_v_self->lock == NULL) != 0);
23290 if (unlikely(__pyx_t_1)) {
23299 PyErr_NoMemory(); __PYX_ERR(1, 361, __pyx_L1_error)
23326 __pyx_t_1 = ((__pyx_v_flags & PyBUF_FORMAT) != 0);
23336 __pyx_t_2 = (((__pyx_v_self->view.format[0]) ==
'O') != 0);
23339 __pyx_t_1 = __pyx_t_2;
23340 goto __pyx_L11_bool_binop_done;
23342 __pyx_t_2 = (((__pyx_v_self->view.format[1]) ==
'\x00') != 0);
23343 __pyx_t_1 = __pyx_t_2;
23344 __pyx_L11_bool_binop_done:;
23345 __pyx_v_self->dtype_is_object = __pyx_t_1;
23365 __pyx_v_self->dtype_is_object = __pyx_v_dtype_is_object;
23376 __pyx_v_self->acquisition_count_aligned_p = ((__pyx_atomic_int *)__pyx_align_pointer(((
void *)(&(__pyx_v_self->acquisition_count[0]))), (
sizeof(__pyx_atomic_int))));
23385 __pyx_v_self->typeinfo = NULL;
23399 __Pyx_AddTraceback(
"View.MemoryView.memoryview.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
23402 __Pyx_RefNannyFinishContext();
23415 static void __pyx_memoryview___dealloc__(PyObject *__pyx_v_self);
23416 static void __pyx_memoryview___dealloc__(PyObject *__pyx_v_self) {
23417 __Pyx_RefNannyDeclarations
23418 __Pyx_RefNannySetupContext(
"__dealloc__ (wrapper)", 0);
23419 __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_2__dealloc__(((
struct __pyx_memoryview_obj *)__pyx_v_self));
23422 __Pyx_RefNannyFinishContext();
23425 static void __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_2__dealloc__(
struct __pyx_memoryview_obj *__pyx_v_self) {
23427 __Pyx_RefNannyDeclarations
23433 PyThread_type_lock __pyx_t_6;
23434 PyThread_type_lock __pyx_t_7;
23435 __Pyx_RefNannySetupContext(
"__dealloc__", 0);
23444 __pyx_t_1 = (__pyx_v_self->obj != Py_None);
23445 __pyx_t_2 = (__pyx_t_1 != 0);
23455 __Pyx_ReleaseBuffer((&__pyx_v_self->view));
23474 __pyx_t_2 = ((((Py_buffer *)(&__pyx_v_self->view))->obj == Py_None) != 0);
23484 ((Py_buffer *)(&__pyx_v_self->view))->obj = NULL;
23493 Py_DECREF(Py_None);
23512 __pyx_t_2 = ((__pyx_v_self->lock != NULL) != 0);
23522 __pyx_t_3 = __pyx_memoryview_thread_locks_used;
23523 __pyx_t_4 = __pyx_t_3;
23524 for (__pyx_t_5 = 0; __pyx_t_5 < __pyx_t_4; __pyx_t_5+=1) {
23525 __pyx_v_i = __pyx_t_5;
23534 __pyx_t_2 = (((__pyx_memoryview_thread_locks[__pyx_v_i]) == __pyx_v_self->lock) != 0);
23544 __pyx_memoryview_thread_locks_used = (__pyx_memoryview_thread_locks_used - 1);
23553 __pyx_t_2 = ((__pyx_v_i != __pyx_memoryview_thread_locks_used) != 0);
23563 __pyx_t_6 = (__pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used]);
23564 __pyx_t_7 = (__pyx_memoryview_thread_locks[__pyx_v_i]);
23573 (__pyx_memoryview_thread_locks[__pyx_v_i]) = __pyx_t_6;
23574 (__pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used]) = __pyx_t_7;
23592 goto __pyx_L6_break;
23612 PyThread_free_lock(__pyx_v_self->lock);
23634 __Pyx_RefNannyFinishContext();
23645 static char *__pyx_memoryview_get_item_pointer(
struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index) {
23646 Py_ssize_t __pyx_v_dim;
23647 char *__pyx_v_itemp;
23648 PyObject *__pyx_v_idx = NULL;
23650 __Pyx_RefNannyDeclarations
23651 Py_ssize_t __pyx_t_1;
23652 PyObject *__pyx_t_2 = NULL;
23653 Py_ssize_t __pyx_t_3;
23654 PyObject *(*__pyx_t_4)(PyObject *);
23655 PyObject *__pyx_t_5 = NULL;
23656 Py_ssize_t __pyx_t_6;
23658 int __pyx_lineno = 0;
23659 const char *__pyx_filename = NULL;
23660 int __pyx_clineno = 0;
23661 __Pyx_RefNannySetupContext(
"get_item_pointer", 0);
23670 __pyx_v_itemp = ((
char *)__pyx_v_self->view.buf);
23680 if (likely(PyList_CheckExact(__pyx_v_index)) || PyTuple_CheckExact(__pyx_v_index)) {
23681 __pyx_t_2 = __pyx_v_index; __Pyx_INCREF(__pyx_t_2); __pyx_t_3 = 0;
23684 __pyx_t_3 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_v_index);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 397, __pyx_L1_error)
23685 __Pyx_GOTREF(__pyx_t_2);
23686 __pyx_t_4 = Py_TYPE(__pyx_t_2)->tp_iternext;
if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 397, __pyx_L1_error)
23689 if (likely(!__pyx_t_4)) {
23690 if (likely(PyList_CheckExact(__pyx_t_2))) {
23691 if (__pyx_t_3 >= PyList_GET_SIZE(__pyx_t_2))
break;
23692 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
23693 __pyx_t_5 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_5); __pyx_t_3++;
if (unlikely(0 < 0)) __PYX_ERR(1, 397, __pyx_L1_error)
23695 __pyx_t_5 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++;
if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 397, __pyx_L1_error)
23696 __Pyx_GOTREF(__pyx_t_5);
23699 if (__pyx_t_3 >= PyTuple_GET_SIZE(__pyx_t_2))
break;
23700 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
23701 __pyx_t_5 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_5); __pyx_t_3++;
if (unlikely(0 < 0)) __PYX_ERR(1, 397, __pyx_L1_error)
23703 __pyx_t_5 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++;
if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 397, __pyx_L1_error)
23704 __Pyx_GOTREF(__pyx_t_5);
23708 __pyx_t_5 = __pyx_t_4(__pyx_t_2);
23709 if (unlikely(!__pyx_t_5)) {
23710 PyObject* exc_type = PyErr_Occurred();
23712 if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
23713 else __PYX_ERR(1, 397, __pyx_L1_error)
23717 __Pyx_GOTREF(__pyx_t_5);
23719 __Pyx_XDECREF_SET(__pyx_v_idx, __pyx_t_5);
23721 __pyx_v_dim = __pyx_t_1;
23722 __pyx_t_1 = (__pyx_t_1 + 1);
23731 __pyx_t_6 = __Pyx_PyIndex_AsSsize_t(__pyx_v_idx);
if (unlikely((__pyx_t_6 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(1, 398, __pyx_L1_error)
23732 __pyx_t_7 = __pyx_pybuffer_index((&__pyx_v_self->view), __pyx_v_itemp, __pyx_t_6, __pyx_v_dim);
if (unlikely(__pyx_t_7 == ((
char *)NULL))) __PYX_ERR(1, 398, __pyx_L1_error)
23733 __pyx_v_itemp = __pyx_t_7;
23743 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
23752 __pyx_r = __pyx_v_itemp;
23765 __Pyx_XDECREF(__pyx_t_2);
23766 __Pyx_XDECREF(__pyx_t_5);
23767 __Pyx_AddTraceback(
"View.MemoryView.memoryview.get_item_pointer", __pyx_clineno, __pyx_lineno, __pyx_filename);
23770 __Pyx_XDECREF(__pyx_v_idx);
23771 __Pyx_RefNannyFinishContext();
23784 static PyObject *__pyx_memoryview___getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_index);
23785 static PyObject *__pyx_memoryview___getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_index) {
23786 PyObject *__pyx_r = 0;
23787 __Pyx_RefNannyDeclarations
23788 __Pyx_RefNannySetupContext(
"__getitem__ (wrapper)", 0);
23789 __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_4__getitem__(((
struct __pyx_memoryview_obj *)__pyx_v_self), ((PyObject *)__pyx_v_index));
23792 __Pyx_RefNannyFinishContext();
23796 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_4__getitem__(
struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index) {
23797 PyObject *__pyx_v_have_slices = NULL;
23798 PyObject *__pyx_v_indices = NULL;
23799 char *__pyx_v_itemp;
23800 PyObject *__pyx_r = NULL;
23801 __Pyx_RefNannyDeclarations
23804 PyObject *__pyx_t_3 = NULL;
23805 PyObject *__pyx_t_4 = NULL;
23806 PyObject *__pyx_t_5 = NULL;
23808 int __pyx_lineno = 0;
23809 const char *__pyx_filename = NULL;
23810 int __pyx_clineno = 0;
23811 __Pyx_RefNannySetupContext(
"__getitem__", 0);
23820 __pyx_t_1 = (__pyx_v_index == __pyx_builtin_Ellipsis);
23821 __pyx_t_2 = (__pyx_t_1 != 0);
23831 __Pyx_XDECREF(__pyx_r);
23832 __Pyx_INCREF(((PyObject *)__pyx_v_self));
23833 __pyx_r = ((PyObject *)__pyx_v_self);
23852 __pyx_t_3 = _unellipsify(__pyx_v_index, __pyx_v_self->view.ndim);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 407, __pyx_L1_error)
23853 __Pyx_GOTREF(__pyx_t_3);
23854 if (likely(__pyx_t_3 != Py_None)) {
23855 PyObject* sequence = __pyx_t_3;
23856 Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
23857 if (unlikely(size != 2)) {
23858 if (size > 2) __Pyx_RaiseTooManyValuesError(2);
23859 else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
23860 __PYX_ERR(1, 407, __pyx_L1_error)
23862 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
23863 __pyx_t_4 = PyTuple_GET_ITEM(sequence, 0);
23864 __pyx_t_5 = PyTuple_GET_ITEM(sequence, 1);
23865 __Pyx_INCREF(__pyx_t_4);
23866 __Pyx_INCREF(__pyx_t_5);
23868 __pyx_t_4 = PySequence_ITEM(sequence, 0);
if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 407, __pyx_L1_error)
23869 __Pyx_GOTREF(__pyx_t_4);
23870 __pyx_t_5 = PySequence_ITEM(sequence, 1);
if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 407, __pyx_L1_error)
23871 __Pyx_GOTREF(__pyx_t_5);
23873 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
23875 __Pyx_RaiseNoneNotIterableError(); __PYX_ERR(1, 407, __pyx_L1_error)
23877 __pyx_v_have_slices = __pyx_t_4;
23879 __pyx_v_indices = __pyx_t_5;
23889 __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_have_slices);
if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(1, 410, __pyx_L1_error)
23899 __Pyx_XDECREF(__pyx_r);
23900 __pyx_t_3 = ((PyObject *)__pyx_memview_slice(__pyx_v_self, __pyx_v_indices));
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 411, __pyx_L1_error)
23901 __Pyx_GOTREF(__pyx_t_3);
23902 __pyx_r = __pyx_t_3;
23923 __pyx_t_6 = ((
struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->get_item_pointer(__pyx_v_self, __pyx_v_indices);
if (unlikely(__pyx_t_6 == ((
char *)NULL))) __PYX_ERR(1, 413, __pyx_L1_error)
23924 __pyx_v_itemp = __pyx_t_6;
23933 __Pyx_XDECREF(__pyx_r);
23934 __pyx_t_3 = ((
struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->convert_item_to_object(__pyx_v_self, __pyx_v_itemp);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 414, __pyx_L1_error)
23935 __Pyx_GOTREF(__pyx_t_3);
23936 __pyx_r = __pyx_t_3;
23951 __Pyx_XDECREF(__pyx_t_3);
23952 __Pyx_XDECREF(__pyx_t_4);
23953 __Pyx_XDECREF(__pyx_t_5);
23954 __Pyx_AddTraceback(
"View.MemoryView.memoryview.__getitem__", __pyx_clineno, __pyx_lineno, __pyx_filename);
23957 __Pyx_XDECREF(__pyx_v_have_slices);
23958 __Pyx_XDECREF(__pyx_v_indices);
23959 __Pyx_XGIVEREF(__pyx_r);
23960 __Pyx_RefNannyFinishContext();
23973 static int __pyx_memoryview___setitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_index, PyObject *__pyx_v_value);
23974 static int __pyx_memoryview___setitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_index, PyObject *__pyx_v_value) {
23976 __Pyx_RefNannyDeclarations
23977 __Pyx_RefNannySetupContext(
"__setitem__ (wrapper)", 0);
23978 __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));
23981 __Pyx_RefNannyFinishContext();
23985 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) {
23986 PyObject *__pyx_v_have_slices = NULL;
23987 PyObject *__pyx_v_obj = NULL;
23989 __Pyx_RefNannyDeclarations
23991 PyObject *__pyx_t_2 = NULL;
23992 PyObject *__pyx_t_3 = NULL;
23993 PyObject *__pyx_t_4 = NULL;
23994 int __pyx_lineno = 0;
23995 const char *__pyx_filename = NULL;
23996 int __pyx_clineno = 0;
23997 __Pyx_RefNannySetupContext(
"__setitem__", 0);
23998 __Pyx_INCREF(__pyx_v_index);
24007 __pyx_t_1 = (__pyx_v_self->view.readonly != 0);
24008 if (unlikely(__pyx_t_1)) {
24017 __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__19, NULL);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 418, __pyx_L1_error)
24018 __Pyx_GOTREF(__pyx_t_2);
24019 __Pyx_Raise(__pyx_t_2, 0, 0, 0);
24020 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
24021 __PYX_ERR(1, 418, __pyx_L1_error)
24039 __pyx_t_2 = _unellipsify(__pyx_v_index, __pyx_v_self->view.ndim);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 420, __pyx_L1_error)
24040 __Pyx_GOTREF(__pyx_t_2);
24041 if (likely(__pyx_t_2 != Py_None)) {
24042 PyObject* sequence = __pyx_t_2;
24043 Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
24044 if (unlikely(size != 2)) {
24045 if (size > 2) __Pyx_RaiseTooManyValuesError(2);
24046 else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
24047 __PYX_ERR(1, 420, __pyx_L1_error)
24049 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
24050 __pyx_t_3 = PyTuple_GET_ITEM(sequence, 0);
24051 __pyx_t_4 = PyTuple_GET_ITEM(sequence, 1);
24052 __Pyx_INCREF(__pyx_t_3);
24053 __Pyx_INCREF(__pyx_t_4);
24055 __pyx_t_3 = PySequence_ITEM(sequence, 0);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 420, __pyx_L1_error)
24056 __Pyx_GOTREF(__pyx_t_3);
24057 __pyx_t_4 = PySequence_ITEM(sequence, 1);
if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 420, __pyx_L1_error)
24058 __Pyx_GOTREF(__pyx_t_4);
24060 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
24062 __Pyx_RaiseNoneNotIterableError(); __PYX_ERR(1, 420, __pyx_L1_error)
24064 __pyx_v_have_slices = __pyx_t_3;
24066 __Pyx_DECREF_SET(__pyx_v_index, __pyx_t_4);
24076 __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_have_slices);
if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(1, 422, __pyx_L1_error)
24086 __pyx_t_2 = ((
struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->is_slice(__pyx_v_self, __pyx_v_value);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 423, __pyx_L1_error)
24087 __Pyx_GOTREF(__pyx_t_2);
24088 __pyx_v_obj = __pyx_t_2;
24098 __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_obj);
if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(1, 424, __pyx_L1_error)
24108 __pyx_t_2 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_self), __pyx_v_index);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 425, __pyx_L1_error)
24109 __Pyx_GOTREF(__pyx_t_2);
24110 __pyx_t_4 = ((
struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->setitem_slice_assignment(__pyx_v_self, __pyx_t_2, __pyx_v_obj);
if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 425, __pyx_L1_error)
24111 __Pyx_GOTREF(__pyx_t_4);
24112 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
24113 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
24133 __pyx_t_4 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_self), __pyx_v_index);
if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 427, __pyx_L1_error)
24134 __Pyx_GOTREF(__pyx_t_4);
24135 if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_memoryview_type))))) __PYX_ERR(1, 427, __pyx_L1_error)
24136 __pyx_t_2 = ((
struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->setitem_slice_assign_scalar(__pyx_v_self, ((
struct __pyx_memoryview_obj *)__pyx_t_4), __pyx_v_value);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 427, __pyx_L1_error)
24137 __Pyx_GOTREF(__pyx_t_2);
24138 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
24139 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
24161 __pyx_t_2 = ((
struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->setitem_indexed(__pyx_v_self, __pyx_v_index, __pyx_v_value);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 429, __pyx_L1_error)
24162 __Pyx_GOTREF(__pyx_t_2);
24163 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
24179 __Pyx_XDECREF(__pyx_t_2);
24180 __Pyx_XDECREF(__pyx_t_3);
24181 __Pyx_XDECREF(__pyx_t_4);
24182 __Pyx_AddTraceback(
"View.MemoryView.memoryview.__setitem__", __pyx_clineno, __pyx_lineno, __pyx_filename);
24185 __Pyx_XDECREF(__pyx_v_have_slices);
24186 __Pyx_XDECREF(__pyx_v_obj);
24187 __Pyx_XDECREF(__pyx_v_index);
24188 __Pyx_RefNannyFinishContext();
24200 static PyObject *__pyx_memoryview_is_slice(
struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_obj) {
24201 PyObject *__pyx_r = NULL;
24202 __Pyx_RefNannyDeclarations
24205 PyObject *__pyx_t_3 = NULL;
24206 PyObject *__pyx_t_4 = NULL;
24207 PyObject *__pyx_t_5 = NULL;
24208 PyObject *__pyx_t_6 = NULL;
24209 PyObject *__pyx_t_7 = NULL;
24210 PyObject *__pyx_t_8 = NULL;
24212 int __pyx_lineno = 0;
24213 const char *__pyx_filename = NULL;
24214 int __pyx_clineno = 0;
24215 __Pyx_RefNannySetupContext(
"is_slice", 0);
24216 __Pyx_INCREF(__pyx_v_obj);
24225 __pyx_t_1 = __Pyx_TypeCheck(__pyx_v_obj, __pyx_memoryview_type);
24226 __pyx_t_2 = ((!(__pyx_t_1 != 0)) != 0);
24237 __Pyx_PyThreadState_declare
24238 __Pyx_PyThreadState_assign
24239 __Pyx_ExceptionSave(&__pyx_t_3, &__pyx_t_4, &__pyx_t_5);
24240 __Pyx_XGOTREF(__pyx_t_3);
24241 __Pyx_XGOTREF(__pyx_t_4);
24242 __Pyx_XGOTREF(__pyx_t_5);
24252 __pyx_t_6 = __Pyx_PyInt_From_int(((__pyx_v_self->flags & (~PyBUF_WRITABLE)) | PyBUF_ANY_CONTIGUOUS));
if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 434, __pyx_L4_error)
24253 __Pyx_GOTREF(__pyx_t_6);
24262 __pyx_t_7 = __Pyx_PyBool_FromLong(__pyx_v_self->dtype_is_object);
if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 435, __pyx_L4_error)
24263 __Pyx_GOTREF(__pyx_t_7);
24272 __pyx_t_8 = PyTuple_New(3);
if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 434, __pyx_L4_error)
24273 __Pyx_GOTREF(__pyx_t_8);
24274 __Pyx_INCREF(__pyx_v_obj);
24275 __Pyx_GIVEREF(__pyx_v_obj);
24276 PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_v_obj);
24277 __Pyx_GIVEREF(__pyx_t_6);
24278 PyTuple_SET_ITEM(__pyx_t_8, 1, __pyx_t_6);
24279 __Pyx_GIVEREF(__pyx_t_7);
24280 PyTuple_SET_ITEM(__pyx_t_8, 2, __pyx_t_7);
24283 __pyx_t_7 = __Pyx_PyObject_Call(((PyObject *)__pyx_memoryview_type), __pyx_t_8, NULL);
if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 434, __pyx_L4_error)
24284 __Pyx_GOTREF(__pyx_t_7);
24285 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
24286 __Pyx_DECREF_SET(__pyx_v_obj, __pyx_t_7);
24297 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
24298 __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
24299 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
24300 goto __pyx_L9_try_end;
24302 __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
24303 __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
24304 __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
24313 __pyx_t_9 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_TypeError);
24315 __Pyx_AddTraceback(
"View.MemoryView.memoryview.is_slice", __pyx_clineno, __pyx_lineno, __pyx_filename);
24316 if (__Pyx_GetException(&__pyx_t_7, &__pyx_t_8, &__pyx_t_6) < 0) __PYX_ERR(1, 436, __pyx_L6_except_error)
24317 __Pyx_GOTREF(__pyx_t_7);
24318 __Pyx_GOTREF(__pyx_t_8);
24319 __Pyx_GOTREF(__pyx_t_6);
24328 __Pyx_XDECREF(__pyx_r);
24329 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
24330 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
24331 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
24332 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
24333 goto __pyx_L7_except_return;
24335 goto __pyx_L6_except_error;
24336 __pyx_L6_except_error:;
24345 __Pyx_XGIVEREF(__pyx_t_3);
24346 __Pyx_XGIVEREF(__pyx_t_4);
24347 __Pyx_XGIVEREF(__pyx_t_5);
24348 __Pyx_ExceptionReset(__pyx_t_3, __pyx_t_4, __pyx_t_5);
24349 goto __pyx_L1_error;
24350 __pyx_L7_except_return:;
24351 __Pyx_XGIVEREF(__pyx_t_3);
24352 __Pyx_XGIVEREF(__pyx_t_4);
24353 __Pyx_XGIVEREF(__pyx_t_5);
24354 __Pyx_ExceptionReset(__pyx_t_3, __pyx_t_4, __pyx_t_5);
24375 __Pyx_XDECREF(__pyx_r);
24376 __Pyx_INCREF(__pyx_v_obj);
24377 __pyx_r = __pyx_v_obj;
24390 __Pyx_XDECREF(__pyx_t_6);
24391 __Pyx_XDECREF(__pyx_t_7);
24392 __Pyx_XDECREF(__pyx_t_8);
24393 __Pyx_AddTraceback(
"View.MemoryView.memoryview.is_slice", __pyx_clineno, __pyx_lineno, __pyx_filename);
24396 __Pyx_XDECREF(__pyx_v_obj);
24397 __Pyx_XGIVEREF(__pyx_r);
24398 __Pyx_RefNannyFinishContext();
24410 static PyObject *__pyx_memoryview_setitem_slice_assignment(
struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_dst, PyObject *__pyx_v_src) {
24411 __Pyx_memviewslice __pyx_v_dst_slice;
24412 __Pyx_memviewslice __pyx_v_src_slice;
24413 PyObject *__pyx_r = NULL;
24414 __Pyx_RefNannyDeclarations
24415 __Pyx_memviewslice *__pyx_t_1;
24416 __Pyx_memviewslice *__pyx_t_2;
24417 PyObject *__pyx_t_3 = NULL;
24421 int __pyx_lineno = 0;
24422 const char *__pyx_filename = NULL;
24423 int __pyx_clineno = 0;
24424 __Pyx_RefNannySetupContext(
"setitem_slice_assignment", 0);
24433 if (!(likely(((__pyx_v_src) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_src, __pyx_memoryview_type))))) __PYX_ERR(1, 445, __pyx_L1_error)
24434 __pyx_t_1 = __pyx_memoryview_get_slice_from_memoryview(((
struct __pyx_memoryview_obj *)__pyx_v_src), (&__pyx_v_src_slice));
if (unlikely(__pyx_t_1 == ((__Pyx_memviewslice *)NULL))) __PYX_ERR(1, 445, __pyx_L1_error)
24443 if (!(likely(((__pyx_v_dst) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_dst, __pyx_memoryview_type))))) __PYX_ERR(1, 446, __pyx_L1_error)
24444 __pyx_t_2 = __pyx_memoryview_get_slice_from_memoryview(((
struct __pyx_memoryview_obj *)__pyx_v_dst), (&__pyx_v_dst_slice));
if (unlikely(__pyx_t_2 == ((__Pyx_memviewslice *)NULL))) __PYX_ERR(1, 446, __pyx_L1_error)
24453 __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_src, __pyx_n_s_ndim);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 447, __pyx_L1_error)
24454 __Pyx_GOTREF(__pyx_t_3);
24455 __pyx_t_4 = __Pyx_PyInt_As_int(__pyx_t_3);
if (unlikely((__pyx_t_4 == (
int)-1) && PyErr_Occurred())) __PYX_ERR(1, 447, __pyx_L1_error)
24456 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
24457 __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_dst, __pyx_n_s_ndim);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 447, __pyx_L1_error)
24458 __Pyx_GOTREF(__pyx_t_3);
24459 __pyx_t_5 = __Pyx_PyInt_As_int(__pyx_t_3);
if (unlikely((__pyx_t_5 == (
int)-1) && PyErr_Occurred())) __PYX_ERR(1, 447, __pyx_L1_error)
24460 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
24469 __pyx_t_6 = __pyx_memoryview_copy_contents((__pyx_t_1[0]), (__pyx_t_2[0]), __pyx_t_4, __pyx_t_5, __pyx_v_self->dtype_is_object);
if (unlikely(__pyx_t_6 == ((
int)-1))) __PYX_ERR(1, 445, __pyx_L1_error)
24480 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
24483 __Pyx_XDECREF(__pyx_t_3);
24484 __Pyx_AddTraceback(
"View.MemoryView.memoryview.setitem_slice_assignment", __pyx_clineno, __pyx_lineno, __pyx_filename);
24487 __Pyx_XGIVEREF(__pyx_r);
24488 __Pyx_RefNannyFinishContext();
24500 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) {
24501 int __pyx_v_array[0x80];
24503 void *__pyx_v_item;
24504 __Pyx_memviewslice *__pyx_v_dst_slice;
24505 __Pyx_memviewslice __pyx_v_tmp_slice;
24506 PyObject *__pyx_r = NULL;
24507 __Pyx_RefNannyDeclarations
24508 __Pyx_memviewslice *__pyx_t_1;
24510 PyObject *__pyx_t_3 = NULL;
24513 char const *__pyx_t_6;
24514 PyObject *__pyx_t_7 = NULL;
24515 PyObject *__pyx_t_8 = NULL;
24516 PyObject *__pyx_t_9 = NULL;
24517 PyObject *__pyx_t_10 = NULL;
24518 PyObject *__pyx_t_11 = NULL;
24519 PyObject *__pyx_t_12 = NULL;
24520 int __pyx_lineno = 0;
24521 const char *__pyx_filename = NULL;
24522 int __pyx_clineno = 0;
24523 __Pyx_RefNannySetupContext(
"setitem_slice_assign_scalar", 0);
24532 __pyx_v_tmp = NULL;
24541 __pyx_t_1 = __pyx_memoryview_get_slice_from_memoryview(__pyx_v_dst, (&__pyx_v_tmp_slice));
if (unlikely(__pyx_t_1 == ((__Pyx_memviewslice *)NULL))) __PYX_ERR(1, 456, __pyx_L1_error)
24542 __pyx_v_dst_slice = __pyx_t_1;
24551 __pyx_t_2 = ((((size_t)__pyx_v_self->view.itemsize) > (
sizeof(__pyx_v_array))) != 0);
24561 __pyx_v_tmp = PyMem_Malloc(__pyx_v_self->view.itemsize);
24570 __pyx_t_2 = ((__pyx_v_tmp == NULL) != 0);
24571 if (unlikely(__pyx_t_2)) {
24580 PyErr_NoMemory(); __PYX_ERR(1, 461, __pyx_L1_error)
24598 __pyx_v_item = __pyx_v_tmp;
24618 __pyx_v_item = ((
void *)__pyx_v_array);
24638 __pyx_t_2 = (__pyx_v_self->dtype_is_object != 0);
24648 (((PyObject **)__pyx_v_item)[0]) = ((PyObject *)__pyx_v_value);
24668 __pyx_t_3 = ((
struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->assign_item_from_object(__pyx_v_self, ((
char *)__pyx_v_item), __pyx_v_value);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 470, __pyx_L6_error)
24669 __Pyx_GOTREF(__pyx_t_3);
24670 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
24681 __pyx_t_2 = ((__pyx_v_self->view.suboffsets != NULL) != 0);
24691 __pyx_t_3 = assert_direct_dimensions(__pyx_v_self->view.suboffsets, __pyx_v_self->view.ndim);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 475, __pyx_L6_error)
24692 __Pyx_GOTREF(__pyx_t_3);
24693 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
24711 __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);
24723 PyMem_Free(__pyx_v_tmp);
24728 __Pyx_PyThreadState_declare
24729 __Pyx_PyThreadState_assign
24730 __pyx_t_7 = 0; __pyx_t_8 = 0; __pyx_t_9 = 0; __pyx_t_10 = 0; __pyx_t_11 = 0; __pyx_t_12 = 0;
24731 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
24732 if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_10, &__pyx_t_11, &__pyx_t_12);
24733 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);
24734 __Pyx_XGOTREF(__pyx_t_7);
24735 __Pyx_XGOTREF(__pyx_t_8);
24736 __Pyx_XGOTREF(__pyx_t_9);
24737 __Pyx_XGOTREF(__pyx_t_10);
24738 __Pyx_XGOTREF(__pyx_t_11);
24739 __Pyx_XGOTREF(__pyx_t_12);
24740 __pyx_t_4 = __pyx_lineno; __pyx_t_5 = __pyx_clineno; __pyx_t_6 = __pyx_filename;
24742 PyMem_Free(__pyx_v_tmp);
24744 if (PY_MAJOR_VERSION >= 3) {
24745 __Pyx_XGIVEREF(__pyx_t_10);
24746 __Pyx_XGIVEREF(__pyx_t_11);
24747 __Pyx_XGIVEREF(__pyx_t_12);
24748 __Pyx_ExceptionReset(__pyx_t_10, __pyx_t_11, __pyx_t_12);
24750 __Pyx_XGIVEREF(__pyx_t_7);
24751 __Pyx_XGIVEREF(__pyx_t_8);
24752 __Pyx_XGIVEREF(__pyx_t_9);
24753 __Pyx_ErrRestore(__pyx_t_7, __pyx_t_8, __pyx_t_9);
24754 __pyx_t_7 = 0; __pyx_t_8 = 0; __pyx_t_9 = 0; __pyx_t_10 = 0; __pyx_t_11 = 0; __pyx_t_12 = 0;
24755 __pyx_lineno = __pyx_t_4; __pyx_clineno = __pyx_t_5; __pyx_filename = __pyx_t_6;
24756 goto __pyx_L1_error;
24770 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
24773 __Pyx_XDECREF(__pyx_t_3);
24774 __Pyx_AddTraceback(
"View.MemoryView.memoryview.setitem_slice_assign_scalar", __pyx_clineno, __pyx_lineno, __pyx_filename);
24777 __Pyx_XGIVEREF(__pyx_r);
24778 __Pyx_RefNannyFinishContext();
24790 static PyObject *__pyx_memoryview_setitem_indexed(
struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index, PyObject *__pyx_v_value) {
24791 char *__pyx_v_itemp;
24792 PyObject *__pyx_r = NULL;
24793 __Pyx_RefNannyDeclarations
24795 PyObject *__pyx_t_2 = NULL;
24796 int __pyx_lineno = 0;
24797 const char *__pyx_filename = NULL;
24798 int __pyx_clineno = 0;
24799 __Pyx_RefNannySetupContext(
"setitem_indexed", 0);
24808 __pyx_t_1 = ((
struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->get_item_pointer(__pyx_v_self, __pyx_v_index);
if (unlikely(__pyx_t_1 == ((
char *)NULL))) __PYX_ERR(1, 482, __pyx_L1_error)
24809 __pyx_v_itemp = __pyx_t_1;
24818 __pyx_t_2 = ((
struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->assign_item_from_object(__pyx_v_self, __pyx_v_itemp, __pyx_v_value);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 483, __pyx_L1_error)
24819 __Pyx_GOTREF(__pyx_t_2);
24820 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
24831 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
24834 __Pyx_XDECREF(__pyx_t_2);
24835 __Pyx_AddTraceback(
"View.MemoryView.memoryview.setitem_indexed", __pyx_clineno, __pyx_lineno, __pyx_filename);
24838 __Pyx_XGIVEREF(__pyx_r);
24839 __Pyx_RefNannyFinishContext();
24851 static PyObject *__pyx_memoryview_convert_item_to_object(
struct __pyx_memoryview_obj *__pyx_v_self,
char *__pyx_v_itemp) {
24852 PyObject *__pyx_v_struct = NULL;
24853 PyObject *__pyx_v_bytesitem = 0;
24854 PyObject *__pyx_v_result = NULL;
24855 PyObject *__pyx_r = NULL;
24856 __Pyx_RefNannyDeclarations
24857 PyObject *__pyx_t_1 = NULL;
24858 PyObject *__pyx_t_2 = NULL;
24859 PyObject *__pyx_t_3 = NULL;
24860 PyObject *__pyx_t_4 = NULL;
24861 PyObject *__pyx_t_5 = NULL;
24862 PyObject *__pyx_t_6 = NULL;
24863 PyObject *__pyx_t_7 = NULL;
24865 PyObject *__pyx_t_9 = NULL;
24868 int __pyx_lineno = 0;
24869 const char *__pyx_filename = NULL;
24870 int __pyx_clineno = 0;
24871 __Pyx_RefNannySetupContext(
"convert_item_to_object", 0);
24880 __pyx_t_1 = __Pyx_Import(__pyx_n_s_struct, 0, 0);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 488, __pyx_L1_error)
24881 __Pyx_GOTREF(__pyx_t_1);
24882 __pyx_v_struct = __pyx_t_1;
24892 __pyx_t_1 = __Pyx_PyBytes_FromStringAndSize(__pyx_v_itemp + 0, __pyx_v_self->view.itemsize - 0);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 491, __pyx_L1_error)
24893 __Pyx_GOTREF(__pyx_t_1);
24894 __pyx_v_bytesitem = ((PyObject*)__pyx_t_1);
24905 __Pyx_PyThreadState_declare
24906 __Pyx_PyThreadState_assign
24907 __Pyx_ExceptionSave(&__pyx_t_2, &__pyx_t_3, &__pyx_t_4);
24908 __Pyx_XGOTREF(__pyx_t_2);
24909 __Pyx_XGOTREF(__pyx_t_3);
24910 __Pyx_XGOTREF(__pyx_t_4);
24920 __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_struct, __pyx_n_s_unpack);
if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 493, __pyx_L3_error)
24921 __Pyx_GOTREF(__pyx_t_5);
24922 __pyx_t_6 = __Pyx_PyBytes_FromString(__pyx_v_self->view.format);
if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 493, __pyx_L3_error)
24923 __Pyx_GOTREF(__pyx_t_6);
24926 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) {
24927 __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_5);
24928 if (likely(__pyx_t_7)) {
24929 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_5);
24930 __Pyx_INCREF(__pyx_t_7);
24931 __Pyx_INCREF(
function);
24932 __Pyx_DECREF_SET(__pyx_t_5,
function);
24936 #if CYTHON_FAST_PYCALL
24937 if (PyFunction_Check(__pyx_t_5)) {
24938 PyObject *__pyx_temp[3] = {__pyx_t_7, __pyx_t_6, __pyx_v_bytesitem};
24939 __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 493, __pyx_L3_error)
24940 __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
24941 __Pyx_GOTREF(__pyx_t_1);
24942 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
24945 #if CYTHON_FAST_PYCCALL
24946 if (__Pyx_PyFastCFunction_Check(__pyx_t_5)) {
24947 PyObject *__pyx_temp[3] = {__pyx_t_7, __pyx_t_6, __pyx_v_bytesitem};
24948 __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 493, __pyx_L3_error)
24949 __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
24950 __Pyx_GOTREF(__pyx_t_1);
24951 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
24955 __pyx_t_9 = PyTuple_New(2+__pyx_t_8);
if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 493, __pyx_L3_error)
24956 __Pyx_GOTREF(__pyx_t_9);
24958 __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_7); __pyx_t_7 = NULL;
24960 __Pyx_GIVEREF(__pyx_t_6);
24961 PyTuple_SET_ITEM(__pyx_t_9, 0+__pyx_t_8, __pyx_t_6);
24962 __Pyx_INCREF(__pyx_v_bytesitem);
24963 __Pyx_GIVEREF(__pyx_v_bytesitem);
24964 PyTuple_SET_ITEM(__pyx_t_9, 1+__pyx_t_8, __pyx_v_bytesitem);
24966 __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_9, NULL);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 493, __pyx_L3_error)
24967 __Pyx_GOTREF(__pyx_t_1);
24968 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
24970 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
24971 __pyx_v_result = __pyx_t_1;
24991 __pyx_t_10 = strlen(__pyx_v_self->view.format);
24992 __pyx_t_11 = ((__pyx_t_10 == 1) != 0);
25002 __Pyx_XDECREF(__pyx_r);
25003 __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_result, 0,
long, 1, __Pyx_PyInt_From_long, 0, 0, 0);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 498, __pyx_L5_except_error)
25004 __Pyx_GOTREF(__pyx_t_1);
25005 __pyx_r = __pyx_t_1;
25007 goto __pyx_L6_except_return;
25025 __Pyx_XDECREF(__pyx_r);
25026 __Pyx_INCREF(__pyx_v_result);
25027 __pyx_r = __pyx_v_result;
25028 goto __pyx_L6_except_return;
25031 __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
25032 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
25033 __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
25034 __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
25035 __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
25044 __Pyx_ErrFetch(&__pyx_t_1, &__pyx_t_5, &__pyx_t_9);
25045 __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_struct, __pyx_n_s_error);
if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 494, __pyx_L5_except_error)
25046 __Pyx_GOTREF(__pyx_t_6);
25047 __pyx_t_8 = __Pyx_PyErr_GivenExceptionMatches(__pyx_t_1, __pyx_t_6);
25048 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
25049 __Pyx_ErrRestore(__pyx_t_1, __pyx_t_5, __pyx_t_9);
25050 __pyx_t_1 = 0; __pyx_t_5 = 0; __pyx_t_9 = 0;
25052 __Pyx_AddTraceback(
"View.MemoryView.memoryview.convert_item_to_object", __pyx_clineno, __pyx_lineno, __pyx_filename);
25053 if (__Pyx_GetException(&__pyx_t_9, &__pyx_t_5, &__pyx_t_1) < 0) __PYX_ERR(1, 494, __pyx_L5_except_error)
25054 __Pyx_GOTREF(__pyx_t_9);
25055 __Pyx_GOTREF(__pyx_t_5);
25056 __Pyx_GOTREF(__pyx_t_1);
25065 __pyx_t_6 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__20, NULL);
if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 495, __pyx_L5_except_error)
25066 __Pyx_GOTREF(__pyx_t_6);
25067 __Pyx_Raise(__pyx_t_6, 0, 0, 0);
25068 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
25069 __PYX_ERR(1, 495, __pyx_L5_except_error)
25071 goto __pyx_L5_except_error;
25072 __pyx_L5_except_error:;
25081 __Pyx_XGIVEREF(__pyx_t_2);
25082 __Pyx_XGIVEREF(__pyx_t_3);
25083 __Pyx_XGIVEREF(__pyx_t_4);
25084 __Pyx_ExceptionReset(__pyx_t_2, __pyx_t_3, __pyx_t_4);
25085 goto __pyx_L1_error;
25086 __pyx_L6_except_return:;
25087 __Pyx_XGIVEREF(__pyx_t_2);
25088 __Pyx_XGIVEREF(__pyx_t_3);
25089 __Pyx_XGIVEREF(__pyx_t_4);
25090 __Pyx_ExceptionReset(__pyx_t_2, __pyx_t_3, __pyx_t_4);
25104 __Pyx_XDECREF(__pyx_t_1);
25105 __Pyx_XDECREF(__pyx_t_5);
25106 __Pyx_XDECREF(__pyx_t_6);
25107 __Pyx_XDECREF(__pyx_t_7);
25108 __Pyx_XDECREF(__pyx_t_9);
25109 __Pyx_AddTraceback(
"View.MemoryView.memoryview.convert_item_to_object", __pyx_clineno, __pyx_lineno, __pyx_filename);
25112 __Pyx_XDECREF(__pyx_v_struct);
25113 __Pyx_XDECREF(__pyx_v_bytesitem);
25114 __Pyx_XDECREF(__pyx_v_result);
25115 __Pyx_XGIVEREF(__pyx_r);
25116 __Pyx_RefNannyFinishContext();
25128 static PyObject *__pyx_memoryview_assign_item_from_object(
struct __pyx_memoryview_obj *__pyx_v_self,
char *__pyx_v_itemp, PyObject *__pyx_v_value) {
25129 PyObject *__pyx_v_struct = NULL;
25131 PyObject *__pyx_v_bytesvalue = 0;
25132 Py_ssize_t __pyx_v_i;
25133 PyObject *__pyx_r = NULL;
25134 __Pyx_RefNannyDeclarations
25135 PyObject *__pyx_t_1 = NULL;
25138 PyObject *__pyx_t_4 = NULL;
25139 PyObject *__pyx_t_5 = NULL;
25140 PyObject *__pyx_t_6 = NULL;
25142 PyObject *__pyx_t_8 = NULL;
25143 Py_ssize_t __pyx_t_9;
25144 PyObject *__pyx_t_10 = NULL;
25149 int __pyx_lineno = 0;
25150 const char *__pyx_filename = NULL;
25151 int __pyx_clineno = 0;
25152 __Pyx_RefNannySetupContext(
"assign_item_from_object", 0);
25161 __pyx_t_1 = __Pyx_Import(__pyx_n_s_struct, 0, 0);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 504, __pyx_L1_error)
25162 __Pyx_GOTREF(__pyx_t_1);
25163 __pyx_v_struct = __pyx_t_1;
25173 __pyx_t_2 = PyTuple_Check(__pyx_v_value);
25174 __pyx_t_3 = (__pyx_t_2 != 0);
25184 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_struct, __pyx_n_s_pack);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 510, __pyx_L1_error)
25185 __Pyx_GOTREF(__pyx_t_1);
25186 __pyx_t_4 = __Pyx_PyBytes_FromString(__pyx_v_self->view.format);
if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 510, __pyx_L1_error)
25187 __Pyx_GOTREF(__pyx_t_4);
25188 __pyx_t_5 = PyTuple_New(1);
if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 510, __pyx_L1_error)
25189 __Pyx_GOTREF(__pyx_t_5);
25190 __Pyx_GIVEREF(__pyx_t_4);
25191 PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4);
25193 __pyx_t_4 = __Pyx_PySequence_Tuple(__pyx_v_value);
if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 510, __pyx_L1_error)
25194 __Pyx_GOTREF(__pyx_t_4);
25195 __pyx_t_6 = PyNumber_Add(__pyx_t_5, __pyx_t_4);
if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 510, __pyx_L1_error)
25196 __Pyx_GOTREF(__pyx_t_6);
25197 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
25198 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
25199 __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_6, NULL);
if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 510, __pyx_L1_error)
25200 __Pyx_GOTREF(__pyx_t_4);
25201 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
25202 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
25203 if (!(likely(PyBytes_CheckExact(__pyx_t_4))||((__pyx_t_4) == Py_None)||(PyErr_Format(PyExc_TypeError,
"Expected %.16s, got %.200s",
"bytes", Py_TYPE(__pyx_t_4)->tp_name), 0))) __PYX_ERR(1, 510, __pyx_L1_error)
25204 __pyx_v_bytesvalue = ((PyObject*)__pyx_t_4);
25225 __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_struct, __pyx_n_s_pack);
if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 512, __pyx_L1_error)
25226 __Pyx_GOTREF(__pyx_t_6);
25227 __pyx_t_1 = __Pyx_PyBytes_FromString(__pyx_v_self->view.format);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 512, __pyx_L1_error)
25228 __Pyx_GOTREF(__pyx_t_1);
25231 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_6))) {
25232 __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_6);
25233 if (likely(__pyx_t_5)) {
25234 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_6);
25235 __Pyx_INCREF(__pyx_t_5);
25236 __Pyx_INCREF(
function);
25237 __Pyx_DECREF_SET(__pyx_t_6,
function);
25241 #if CYTHON_FAST_PYCALL
25242 if (PyFunction_Check(__pyx_t_6)) {
25243 PyObject *__pyx_temp[3] = {__pyx_t_5, __pyx_t_1, __pyx_v_value};
25244 __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7);
if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 512, __pyx_L1_error)
25245 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
25246 __Pyx_GOTREF(__pyx_t_4);
25247 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
25250 #if CYTHON_FAST_PYCCALL
25251 if (__Pyx_PyFastCFunction_Check(__pyx_t_6)) {
25252 PyObject *__pyx_temp[3] = {__pyx_t_5, __pyx_t_1, __pyx_v_value};
25253 __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7);
if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 512, __pyx_L1_error)
25254 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
25255 __Pyx_GOTREF(__pyx_t_4);
25256 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
25260 __pyx_t_8 = PyTuple_New(2+__pyx_t_7);
if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 512, __pyx_L1_error)
25261 __Pyx_GOTREF(__pyx_t_8);
25263 __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_5); __pyx_t_5 = NULL;
25265 __Pyx_GIVEREF(__pyx_t_1);
25266 PyTuple_SET_ITEM(__pyx_t_8, 0+__pyx_t_7, __pyx_t_1);
25267 __Pyx_INCREF(__pyx_v_value);
25268 __Pyx_GIVEREF(__pyx_v_value);
25269 PyTuple_SET_ITEM(__pyx_t_8, 1+__pyx_t_7, __pyx_v_value);
25271 __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_8, NULL);
if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 512, __pyx_L1_error)
25272 __Pyx_GOTREF(__pyx_t_4);
25273 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
25275 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
25276 if (!(likely(PyBytes_CheckExact(__pyx_t_4))||((__pyx_t_4) == Py_None)||(PyErr_Format(PyExc_TypeError,
"Expected %.16s, got %.200s",
"bytes", Py_TYPE(__pyx_t_4)->tp_name), 0))) __PYX_ERR(1, 512, __pyx_L1_error)
25277 __pyx_v_bytesvalue = ((PyObject*)__pyx_t_4);
25290 if (unlikely(__pyx_v_bytesvalue == Py_None)) {
25291 PyErr_SetString(PyExc_TypeError,
"'NoneType' is not iterable");
25292 __PYX_ERR(1, 514, __pyx_L1_error)
25294 __Pyx_INCREF(__pyx_v_bytesvalue);
25295 __pyx_t_10 = __pyx_v_bytesvalue;
25296 __pyx_t_12 = PyBytes_AS_STRING(__pyx_t_10);
25297 __pyx_t_13 = (__pyx_t_12 + PyBytes_GET_SIZE(__pyx_t_10));
25298 for (__pyx_t_14 = __pyx_t_12; __pyx_t_14 < __pyx_t_13; __pyx_t_14++) {
25299 __pyx_t_11 = __pyx_t_14;
25300 __pyx_v_c = (__pyx_t_11[0]);
25309 __pyx_v_i = __pyx_t_9;
25318 __pyx_t_9 = (__pyx_t_9 + 1);
25327 (__pyx_v_itemp[__pyx_v_i]) = __pyx_v_c;
25329 __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
25340 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
25343 __Pyx_XDECREF(__pyx_t_1);
25344 __Pyx_XDECREF(__pyx_t_4);
25345 __Pyx_XDECREF(__pyx_t_5);
25346 __Pyx_XDECREF(__pyx_t_6);
25347 __Pyx_XDECREF(__pyx_t_8);
25348 __Pyx_XDECREF(__pyx_t_10);
25349 __Pyx_AddTraceback(
"View.MemoryView.memoryview.assign_item_from_object", __pyx_clineno, __pyx_lineno, __pyx_filename);
25352 __Pyx_XDECREF(__pyx_v_struct);
25353 __Pyx_XDECREF(__pyx_v_bytesvalue);
25354 __Pyx_XGIVEREF(__pyx_r);
25355 __Pyx_RefNannyFinishContext();
25368 static CYTHON_UNUSED
int __pyx_memoryview_getbuffer(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info,
int __pyx_v_flags);
25369 static CYTHON_UNUSED
int __pyx_memoryview_getbuffer(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info,
int __pyx_v_flags) {
25371 __Pyx_RefNannyDeclarations
25372 __Pyx_RefNannySetupContext(
"__getbuffer__ (wrapper)", 0);
25373 __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));
25376 __Pyx_RefNannyFinishContext();
25380 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) {
25382 __Pyx_RefNannyDeclarations
25385 PyObject *__pyx_t_3 = NULL;
25386 Py_ssize_t *__pyx_t_4;
25390 Py_ssize_t __pyx_t_8;
25391 int __pyx_lineno = 0;
25392 const char *__pyx_filename = NULL;
25393 int __pyx_clineno = 0;
25394 if (__pyx_v_info == NULL) {
25395 PyErr_SetString(PyExc_BufferError,
"PyObject_GetBuffer: view==NULL argument is obsolete");
25398 __Pyx_RefNannySetupContext(
"__getbuffer__", 0);
25399 __pyx_v_info->obj = Py_None; __Pyx_INCREF(Py_None);
25400 __Pyx_GIVEREF(__pyx_v_info->obj);
25409 __pyx_t_2 = ((__pyx_v_flags & PyBUF_WRITABLE) != 0);
25412 __pyx_t_1 = __pyx_t_2;
25413 goto __pyx_L4_bool_binop_done;
25415 __pyx_t_2 = (__pyx_v_self->view.readonly != 0);
25416 __pyx_t_1 = __pyx_t_2;
25417 __pyx_L4_bool_binop_done:;
25418 if (unlikely(__pyx_t_1)) {
25427 __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__21, NULL);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 520, __pyx_L1_error)
25428 __Pyx_GOTREF(__pyx_t_3);
25429 __Pyx_Raise(__pyx_t_3, 0, 0, 0);
25430 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
25431 __PYX_ERR(1, 520, __pyx_L1_error)
25449 __pyx_t_1 = ((__pyx_v_flags & PyBUF_ND) != 0);
25459 __pyx_t_4 = __pyx_v_self->view.shape;
25460 __pyx_v_info->shape = __pyx_t_4;
25480 __pyx_v_info->shape = NULL;
25491 __pyx_t_1 = ((__pyx_v_flags & PyBUF_STRIDES) != 0);
25501 __pyx_t_4 = __pyx_v_self->view.strides;
25502 __pyx_v_info->strides = __pyx_t_4;
25522 __pyx_v_info->strides = NULL;
25533 __pyx_t_1 = ((__pyx_v_flags & PyBUF_INDIRECT) != 0);
25543 __pyx_t_4 = __pyx_v_self->view.suboffsets;
25544 __pyx_v_info->suboffsets = __pyx_t_4;
25564 __pyx_v_info->suboffsets = NULL;
25575 __pyx_t_1 = ((__pyx_v_flags & PyBUF_FORMAT) != 0);
25585 __pyx_t_5 = __pyx_v_self->view.format;
25586 __pyx_v_info->format = __pyx_t_5;
25606 __pyx_v_info->format = NULL;
25617 __pyx_t_6 = __pyx_v_self->view.buf;
25618 __pyx_v_info->buf = __pyx_t_6;
25627 __pyx_t_7 = __pyx_v_self->view.ndim;
25628 __pyx_v_info->ndim = __pyx_t_7;
25637 __pyx_t_8 = __pyx_v_self->view.itemsize;
25638 __pyx_v_info->itemsize = __pyx_t_8;
25647 __pyx_t_8 = __pyx_v_self->view.len;
25648 __pyx_v_info->len = __pyx_t_8;
25657 __pyx_t_1 = __pyx_v_self->view.readonly;
25658 __pyx_v_info->readonly = __pyx_t_1;
25667 __Pyx_INCREF(((PyObject *)__pyx_v_self));
25668 __Pyx_GIVEREF(((PyObject *)__pyx_v_self));
25669 __Pyx_GOTREF(__pyx_v_info->obj);
25670 __Pyx_DECREF(__pyx_v_info->obj);
25671 __pyx_v_info->obj = ((PyObject *)__pyx_v_self);
25685 __Pyx_XDECREF(__pyx_t_3);
25686 __Pyx_AddTraceback(
"View.MemoryView.memoryview.__getbuffer__", __pyx_clineno, __pyx_lineno, __pyx_filename);
25688 if (__pyx_v_info->obj != NULL) {
25689 __Pyx_GOTREF(__pyx_v_info->obj);
25690 __Pyx_DECREF(__pyx_v_info->obj); __pyx_v_info->obj = 0;
25694 if (__pyx_v_info->obj == Py_None) {
25695 __Pyx_GOTREF(__pyx_v_info->obj);
25696 __Pyx_DECREF(__pyx_v_info->obj); __pyx_v_info->obj = 0;
25699 __Pyx_RefNannyFinishContext();
25712 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_1T_1__get__(PyObject *__pyx_v_self);
25713 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_1T_1__get__(PyObject *__pyx_v_self) {
25714 PyObject *__pyx_r = 0;
25715 __Pyx_RefNannyDeclarations
25716 __Pyx_RefNannySetupContext(
"__get__ (wrapper)", 0);
25717 __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_1T___get__(((
struct __pyx_memoryview_obj *)__pyx_v_self));
25720 __Pyx_RefNannyFinishContext();
25724 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_1T___get__(
struct __pyx_memoryview_obj *__pyx_v_self) {
25725 struct __pyx_memoryviewslice_obj *__pyx_v_result = 0;
25726 PyObject *__pyx_r = NULL;
25727 __Pyx_RefNannyDeclarations
25728 PyObject *__pyx_t_1 = NULL;
25730 int __pyx_lineno = 0;
25731 const char *__pyx_filename = NULL;
25732 int __pyx_clineno = 0;
25733 __Pyx_RefNannySetupContext(
"__get__", 0);
25742 __pyx_t_1 = __pyx_memoryview_copy_object(__pyx_v_self);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 554, __pyx_L1_error)
25743 __Pyx_GOTREF(__pyx_t_1);
25744 if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_memoryviewslice_type))))) __PYX_ERR(1, 554, __pyx_L1_error)
25745 __pyx_v_result = ((
struct __pyx_memoryviewslice_obj *)__pyx_t_1);
25755 __pyx_t_2 = __pyx_memslice_transpose((&__pyx_v_result->from_slice));
if (unlikely(__pyx_t_2 == ((
int)0))) __PYX_ERR(1, 555, __pyx_L1_error)
25764 __Pyx_XDECREF(__pyx_r);
25765 __Pyx_INCREF(((PyObject *)__pyx_v_result));
25766 __pyx_r = ((PyObject *)__pyx_v_result);
25779 __Pyx_XDECREF(__pyx_t_1);
25780 __Pyx_AddTraceback(
"View.MemoryView.memoryview.T.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
25783 __Pyx_XDECREF((PyObject *)__pyx_v_result);
25784 __Pyx_XGIVEREF(__pyx_r);
25785 __Pyx_RefNannyFinishContext();
25798 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_4base_1__get__(PyObject *__pyx_v_self);
25799 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_4base_1__get__(PyObject *__pyx_v_self) {
25800 PyObject *__pyx_r = 0;
25801 __Pyx_RefNannyDeclarations
25802 __Pyx_RefNannySetupContext(
"__get__ (wrapper)", 0);
25803 __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_4base___get__(((
struct __pyx_memoryview_obj *)__pyx_v_self));
25806 __Pyx_RefNannyFinishContext();
25810 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_4base___get__(
struct __pyx_memoryview_obj *__pyx_v_self) {
25811 PyObject *__pyx_r = NULL;
25812 __Pyx_RefNannyDeclarations
25813 __Pyx_RefNannySetupContext(
"__get__", 0);
25822 __Pyx_XDECREF(__pyx_r);
25823 __Pyx_INCREF(__pyx_v_self->obj);
25824 __pyx_r = __pyx_v_self->obj;
25837 __Pyx_XGIVEREF(__pyx_r);
25838 __Pyx_RefNannyFinishContext();
25851 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_5shape_1__get__(PyObject *__pyx_v_self);
25852 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_5shape_1__get__(PyObject *__pyx_v_self) {
25853 PyObject *__pyx_r = 0;
25854 __Pyx_RefNannyDeclarations
25855 __Pyx_RefNannySetupContext(
"__get__ (wrapper)", 0);
25856 __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_5shape___get__(((
struct __pyx_memoryview_obj *)__pyx_v_self));
25859 __Pyx_RefNannyFinishContext();
25863 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_5shape___get__(
struct __pyx_memoryview_obj *__pyx_v_self) {
25864 Py_ssize_t __pyx_v_length;
25865 PyObject *__pyx_r = NULL;
25866 __Pyx_RefNannyDeclarations
25867 PyObject *__pyx_t_1 = NULL;
25868 Py_ssize_t *__pyx_t_2;
25869 Py_ssize_t *__pyx_t_3;
25870 Py_ssize_t *__pyx_t_4;
25871 PyObject *__pyx_t_5 = NULL;
25872 int __pyx_lineno = 0;
25873 const char *__pyx_filename = NULL;
25874 int __pyx_clineno = 0;
25875 __Pyx_RefNannySetupContext(
"__get__", 0);
25884 __Pyx_XDECREF(__pyx_r);
25885 __pyx_t_1 = PyList_New(0);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 564, __pyx_L1_error)
25886 __Pyx_GOTREF(__pyx_t_1);
25887 __pyx_t_3 = (__pyx_v_self->view.shape + __pyx_v_self->view.ndim);
25888 for (__pyx_t_4 = __pyx_v_self->view.shape; __pyx_t_4 < __pyx_t_3; __pyx_t_4++) {
25889 __pyx_t_2 = __pyx_t_4;
25890 __pyx_v_length = (__pyx_t_2[0]);
25891 __pyx_t_5 = PyInt_FromSsize_t(__pyx_v_length);
if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 564, __pyx_L1_error)
25892 __Pyx_GOTREF(__pyx_t_5);
25893 if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_t_5))) __PYX_ERR(1, 564, __pyx_L1_error)
25894 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
25896 __pyx_t_5 = PyList_AsTuple(((PyObject*)__pyx_t_1));
if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 564, __pyx_L1_error)
25897 __Pyx_GOTREF(__pyx_t_5);
25898 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
25899 __pyx_r = __pyx_t_5;
25913 __Pyx_XDECREF(__pyx_t_1);
25914 __Pyx_XDECREF(__pyx_t_5);
25915 __Pyx_AddTraceback(
"View.MemoryView.memoryview.shape.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
25918 __Pyx_XGIVEREF(__pyx_r);
25919 __Pyx_RefNannyFinishContext();
25932 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_7strides_1__get__(PyObject *__pyx_v_self);
25933 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_7strides_1__get__(PyObject *__pyx_v_self) {
25934 PyObject *__pyx_r = 0;
25935 __Pyx_RefNannyDeclarations
25936 __Pyx_RefNannySetupContext(
"__get__ (wrapper)", 0);
25937 __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_7strides___get__(((
struct __pyx_memoryview_obj *)__pyx_v_self));
25940 __Pyx_RefNannyFinishContext();
25944 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_7strides___get__(
struct __pyx_memoryview_obj *__pyx_v_self) {
25945 Py_ssize_t __pyx_v_stride;
25946 PyObject *__pyx_r = NULL;
25947 __Pyx_RefNannyDeclarations
25949 PyObject *__pyx_t_2 = NULL;
25950 Py_ssize_t *__pyx_t_3;
25951 Py_ssize_t *__pyx_t_4;
25952 Py_ssize_t *__pyx_t_5;
25953 PyObject *__pyx_t_6 = NULL;
25954 int __pyx_lineno = 0;
25955 const char *__pyx_filename = NULL;
25956 int __pyx_clineno = 0;
25957 __Pyx_RefNannySetupContext(
"__get__", 0);
25966 __pyx_t_1 = ((__pyx_v_self->view.strides == NULL) != 0);
25967 if (unlikely(__pyx_t_1)) {
25976 __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__22, NULL);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 570, __pyx_L1_error)
25977 __Pyx_GOTREF(__pyx_t_2);
25978 __Pyx_Raise(__pyx_t_2, 0, 0, 0);
25979 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
25980 __PYX_ERR(1, 570, __pyx_L1_error)
25998 __Pyx_XDECREF(__pyx_r);
25999 __pyx_t_2 = PyList_New(0);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 572, __pyx_L1_error)
26000 __Pyx_GOTREF(__pyx_t_2);
26001 __pyx_t_4 = (__pyx_v_self->view.strides + __pyx_v_self->view.ndim);
26002 for (__pyx_t_5 = __pyx_v_self->view.strides; __pyx_t_5 < __pyx_t_4; __pyx_t_5++) {
26003 __pyx_t_3 = __pyx_t_5;
26004 __pyx_v_stride = (__pyx_t_3[0]);
26005 __pyx_t_6 = PyInt_FromSsize_t(__pyx_v_stride);
if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 572, __pyx_L1_error)
26006 __Pyx_GOTREF(__pyx_t_6);
26007 if (unlikely(__Pyx_ListComp_Append(__pyx_t_2, (PyObject*)__pyx_t_6))) __PYX_ERR(1, 572, __pyx_L1_error)
26008 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
26010 __pyx_t_6 = PyList_AsTuple(((PyObject*)__pyx_t_2));
if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 572, __pyx_L1_error)
26011 __Pyx_GOTREF(__pyx_t_6);
26012 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
26013 __pyx_r = __pyx_t_6;
26027 __Pyx_XDECREF(__pyx_t_2);
26028 __Pyx_XDECREF(__pyx_t_6);
26029 __Pyx_AddTraceback(
"View.MemoryView.memoryview.strides.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
26032 __Pyx_XGIVEREF(__pyx_r);
26033 __Pyx_RefNannyFinishContext();
26046 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_10suboffsets_1__get__(PyObject *__pyx_v_self);
26047 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_10suboffsets_1__get__(PyObject *__pyx_v_self) {
26048 PyObject *__pyx_r = 0;
26049 __Pyx_RefNannyDeclarations
26050 __Pyx_RefNannySetupContext(
"__get__ (wrapper)", 0);
26051 __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_10suboffsets___get__(((
struct __pyx_memoryview_obj *)__pyx_v_self));
26054 __Pyx_RefNannyFinishContext();
26058 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_10suboffsets___get__(
struct __pyx_memoryview_obj *__pyx_v_self) {
26059 Py_ssize_t __pyx_v_suboffset;
26060 PyObject *__pyx_r = NULL;
26061 __Pyx_RefNannyDeclarations
26063 PyObject *__pyx_t_2 = NULL;
26064 PyObject *__pyx_t_3 = NULL;
26065 Py_ssize_t *__pyx_t_4;
26066 Py_ssize_t *__pyx_t_5;
26067 Py_ssize_t *__pyx_t_6;
26068 int __pyx_lineno = 0;
26069 const char *__pyx_filename = NULL;
26070 int __pyx_clineno = 0;
26071 __Pyx_RefNannySetupContext(
"__get__", 0);
26080 __pyx_t_1 = ((__pyx_v_self->view.suboffsets == NULL) != 0);
26090 __Pyx_XDECREF(__pyx_r);
26091 __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_self->view.ndim);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 577, __pyx_L1_error)
26092 __Pyx_GOTREF(__pyx_t_2);
26093 __pyx_t_3 = PyNumber_Multiply(__pyx_tuple__23, __pyx_t_2);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 577, __pyx_L1_error)
26094 __Pyx_GOTREF(__pyx_t_3);
26095 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
26096 __pyx_r = __pyx_t_3;
26116 __Pyx_XDECREF(__pyx_r);
26117 __pyx_t_3 = PyList_New(0);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 579, __pyx_L1_error)
26118 __Pyx_GOTREF(__pyx_t_3);
26119 __pyx_t_5 = (__pyx_v_self->view.suboffsets + __pyx_v_self->view.ndim);
26120 for (__pyx_t_6 = __pyx_v_self->view.suboffsets; __pyx_t_6 < __pyx_t_5; __pyx_t_6++) {
26121 __pyx_t_4 = __pyx_t_6;
26122 __pyx_v_suboffset = (__pyx_t_4[0]);
26123 __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_suboffset);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 579, __pyx_L1_error)
26124 __Pyx_GOTREF(__pyx_t_2);
26125 if (unlikely(__Pyx_ListComp_Append(__pyx_t_3, (PyObject*)__pyx_t_2))) __PYX_ERR(1, 579, __pyx_L1_error)
26126 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
26128 __pyx_t_2 = PyList_AsTuple(((PyObject*)__pyx_t_3));
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 579, __pyx_L1_error)
26129 __Pyx_GOTREF(__pyx_t_2);
26130 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
26131 __pyx_r = __pyx_t_2;
26145 __Pyx_XDECREF(__pyx_t_2);
26146 __Pyx_XDECREF(__pyx_t_3);
26147 __Pyx_AddTraceback(
"View.MemoryView.memoryview.suboffsets.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
26150 __Pyx_XGIVEREF(__pyx_r);
26151 __Pyx_RefNannyFinishContext();
26164 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_4ndim_1__get__(PyObject *__pyx_v_self);
26165 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_4ndim_1__get__(PyObject *__pyx_v_self) {
26166 PyObject *__pyx_r = 0;
26167 __Pyx_RefNannyDeclarations
26168 __Pyx_RefNannySetupContext(
"__get__ (wrapper)", 0);
26169 __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_4ndim___get__(((
struct __pyx_memoryview_obj *)__pyx_v_self));
26172 __Pyx_RefNannyFinishContext();
26176 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_4ndim___get__(
struct __pyx_memoryview_obj *__pyx_v_self) {
26177 PyObject *__pyx_r = NULL;
26178 __Pyx_RefNannyDeclarations
26179 PyObject *__pyx_t_1 = NULL;
26180 int __pyx_lineno = 0;
26181 const char *__pyx_filename = NULL;
26182 int __pyx_clineno = 0;
26183 __Pyx_RefNannySetupContext(
"__get__", 0);
26192 __Pyx_XDECREF(__pyx_r);
26193 __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->view.ndim);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 583, __pyx_L1_error)
26194 __Pyx_GOTREF(__pyx_t_1);
26195 __pyx_r = __pyx_t_1;
26209 __Pyx_XDECREF(__pyx_t_1);
26210 __Pyx_AddTraceback(
"View.MemoryView.memoryview.ndim.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
26213 __Pyx_XGIVEREF(__pyx_r);
26214 __Pyx_RefNannyFinishContext();
26227 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_8itemsize_1__get__(PyObject *__pyx_v_self);
26228 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_8itemsize_1__get__(PyObject *__pyx_v_self) {
26229 PyObject *__pyx_r = 0;
26230 __Pyx_RefNannyDeclarations
26231 __Pyx_RefNannySetupContext(
"__get__ (wrapper)", 0);
26232 __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_8itemsize___get__(((
struct __pyx_memoryview_obj *)__pyx_v_self));
26235 __Pyx_RefNannyFinishContext();
26239 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_8itemsize___get__(
struct __pyx_memoryview_obj *__pyx_v_self) {
26240 PyObject *__pyx_r = NULL;
26241 __Pyx_RefNannyDeclarations
26242 PyObject *__pyx_t_1 = NULL;
26243 int __pyx_lineno = 0;
26244 const char *__pyx_filename = NULL;
26245 int __pyx_clineno = 0;
26246 __Pyx_RefNannySetupContext(
"__get__", 0);
26255 __Pyx_XDECREF(__pyx_r);
26256 __pyx_t_1 = PyInt_FromSsize_t(__pyx_v_self->view.itemsize);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 587, __pyx_L1_error)
26257 __Pyx_GOTREF(__pyx_t_1);
26258 __pyx_r = __pyx_t_1;
26272 __Pyx_XDECREF(__pyx_t_1);
26273 __Pyx_AddTraceback(
"View.MemoryView.memoryview.itemsize.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
26276 __Pyx_XGIVEREF(__pyx_r);
26277 __Pyx_RefNannyFinishContext();
26290 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_6nbytes_1__get__(PyObject *__pyx_v_self);
26291 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_6nbytes_1__get__(PyObject *__pyx_v_self) {
26292 PyObject *__pyx_r = 0;
26293 __Pyx_RefNannyDeclarations
26294 __Pyx_RefNannySetupContext(
"__get__ (wrapper)", 0);
26295 __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_6nbytes___get__(((
struct __pyx_memoryview_obj *)__pyx_v_self));
26298 __Pyx_RefNannyFinishContext();
26302 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_6nbytes___get__(
struct __pyx_memoryview_obj *__pyx_v_self) {
26303 PyObject *__pyx_r = NULL;
26304 __Pyx_RefNannyDeclarations
26305 PyObject *__pyx_t_1 = NULL;
26306 PyObject *__pyx_t_2 = NULL;
26307 PyObject *__pyx_t_3 = NULL;
26308 int __pyx_lineno = 0;
26309 const char *__pyx_filename = NULL;
26310 int __pyx_clineno = 0;
26311 __Pyx_RefNannySetupContext(
"__get__", 0);
26320 __Pyx_XDECREF(__pyx_r);
26321 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_size);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 591, __pyx_L1_error)
26322 __Pyx_GOTREF(__pyx_t_1);
26323 __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_self->view.itemsize);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 591, __pyx_L1_error)
26324 __Pyx_GOTREF(__pyx_t_2);
26325 __pyx_t_3 = PyNumber_Multiply(__pyx_t_1, __pyx_t_2);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 591, __pyx_L1_error)
26326 __Pyx_GOTREF(__pyx_t_3);
26327 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
26328 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
26329 __pyx_r = __pyx_t_3;
26343 __Pyx_XDECREF(__pyx_t_1);
26344 __Pyx_XDECREF(__pyx_t_2);
26345 __Pyx_XDECREF(__pyx_t_3);
26346 __Pyx_AddTraceback(
"View.MemoryView.memoryview.nbytes.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
26349 __Pyx_XGIVEREF(__pyx_r);
26350 __Pyx_RefNannyFinishContext();
26363 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_4size_1__get__(PyObject *__pyx_v_self);
26364 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_4size_1__get__(PyObject *__pyx_v_self) {
26365 PyObject *__pyx_r = 0;
26366 __Pyx_RefNannyDeclarations
26367 __Pyx_RefNannySetupContext(
"__get__ (wrapper)", 0);
26368 __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_4size___get__(((
struct __pyx_memoryview_obj *)__pyx_v_self));
26371 __Pyx_RefNannyFinishContext();
26375 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_4size___get__(
struct __pyx_memoryview_obj *__pyx_v_self) {
26376 PyObject *__pyx_v_result = NULL;
26377 PyObject *__pyx_v_length = NULL;
26378 PyObject *__pyx_r = NULL;
26379 __Pyx_RefNannyDeclarations
26382 Py_ssize_t *__pyx_t_3;
26383 Py_ssize_t *__pyx_t_4;
26384 Py_ssize_t *__pyx_t_5;
26385 PyObject *__pyx_t_6 = NULL;
26386 int __pyx_lineno = 0;
26387 const char *__pyx_filename = NULL;
26388 int __pyx_clineno = 0;
26389 __Pyx_RefNannySetupContext(
"__get__", 0);
26398 __pyx_t_1 = (__pyx_v_self->_size == Py_None);
26399 __pyx_t_2 = (__pyx_t_1 != 0);
26409 __Pyx_INCREF(__pyx_int_1);
26410 __pyx_v_result = __pyx_int_1;
26419 __pyx_t_4 = (__pyx_v_self->view.shape + __pyx_v_self->view.ndim);
26420 for (__pyx_t_5 = __pyx_v_self->view.shape; __pyx_t_5 < __pyx_t_4; __pyx_t_5++) {
26421 __pyx_t_3 = __pyx_t_5;
26422 __pyx_t_6 = PyInt_FromSsize_t((__pyx_t_3[0]));
if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 598, __pyx_L1_error)
26423 __Pyx_GOTREF(__pyx_t_6);
26424 __Pyx_XDECREF_SET(__pyx_v_length, __pyx_t_6);
26434 __pyx_t_6 = PyNumber_InPlaceMultiply(__pyx_v_result, __pyx_v_length);
if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 599, __pyx_L1_error)
26435 __Pyx_GOTREF(__pyx_t_6);
26436 __Pyx_DECREF_SET(__pyx_v_result, __pyx_t_6);
26447 __Pyx_INCREF(__pyx_v_result);
26448 __Pyx_GIVEREF(__pyx_v_result);
26449 __Pyx_GOTREF(__pyx_v_self->_size);
26450 __Pyx_DECREF(__pyx_v_self->_size);
26451 __pyx_v_self->_size = __pyx_v_result;
26469 __Pyx_XDECREF(__pyx_r);
26470 __Pyx_INCREF(__pyx_v_self->_size);
26471 __pyx_r = __pyx_v_self->_size;
26484 __Pyx_XDECREF(__pyx_t_6);
26485 __Pyx_AddTraceback(
"View.MemoryView.memoryview.size.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
26488 __Pyx_XDECREF(__pyx_v_result);
26489 __Pyx_XDECREF(__pyx_v_length);
26490 __Pyx_XGIVEREF(__pyx_r);
26491 __Pyx_RefNannyFinishContext();
26504 static Py_ssize_t __pyx_memoryview___len__(PyObject *__pyx_v_self);
26505 static Py_ssize_t __pyx_memoryview___len__(PyObject *__pyx_v_self) {
26506 Py_ssize_t __pyx_r;
26507 __Pyx_RefNannyDeclarations
26508 __Pyx_RefNannySetupContext(
"__len__ (wrapper)", 0);
26509 __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_10__len__(((
struct __pyx_memoryview_obj *)__pyx_v_self));
26512 __Pyx_RefNannyFinishContext();
26516 static Py_ssize_t __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_10__len__(
struct __pyx_memoryview_obj *__pyx_v_self) {
26517 Py_ssize_t __pyx_r;
26518 __Pyx_RefNannyDeclarations
26520 __Pyx_RefNannySetupContext(
"__len__", 0);
26529 __pyx_t_1 = ((__pyx_v_self->view.ndim >= 1) != 0);
26539 __pyx_r = (__pyx_v_self->view.shape[0]);
26571 __Pyx_RefNannyFinishContext();
26584 static PyObject *__pyx_memoryview___repr__(PyObject *__pyx_v_self);
26585 static PyObject *__pyx_memoryview___repr__(PyObject *__pyx_v_self) {
26586 PyObject *__pyx_r = 0;
26587 __Pyx_RefNannyDeclarations
26588 __Pyx_RefNannySetupContext(
"__repr__ (wrapper)", 0);
26589 __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_12__repr__(((
struct __pyx_memoryview_obj *)__pyx_v_self));
26592 __Pyx_RefNannyFinishContext();
26596 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_12__repr__(
struct __pyx_memoryview_obj *__pyx_v_self) {
26597 PyObject *__pyx_r = NULL;
26598 __Pyx_RefNannyDeclarations
26599 PyObject *__pyx_t_1 = NULL;
26600 PyObject *__pyx_t_2 = NULL;
26601 PyObject *__pyx_t_3 = NULL;
26602 int __pyx_lineno = 0;
26603 const char *__pyx_filename = NULL;
26604 int __pyx_clineno = 0;
26605 __Pyx_RefNannySetupContext(
"__repr__", 0);
26614 __Pyx_XDECREF(__pyx_r);
26615 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_base);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 612, __pyx_L1_error)
26616 __Pyx_GOTREF(__pyx_t_1);
26617 __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_class);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 612, __pyx_L1_error)
26618 __Pyx_GOTREF(__pyx_t_2);
26619 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
26620 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_name_2);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 612, __pyx_L1_error)
26621 __Pyx_GOTREF(__pyx_t_1);
26622 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
26631 __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_builtin_id, ((PyObject *)__pyx_v_self));
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 613, __pyx_L1_error)
26632 __Pyx_GOTREF(__pyx_t_2);
26641 __pyx_t_3 = PyTuple_New(2);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 612, __pyx_L1_error)
26642 __Pyx_GOTREF(__pyx_t_3);
26643 __Pyx_GIVEREF(__pyx_t_1);
26644 PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1);
26645 __Pyx_GIVEREF(__pyx_t_2);
26646 PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_2);
26649 __pyx_t_2 = __Pyx_PyString_Format(__pyx_kp_s_MemoryView_of_r_at_0x_x, __pyx_t_3);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 612, __pyx_L1_error)
26650 __Pyx_GOTREF(__pyx_t_2);
26651 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
26652 __pyx_r = __pyx_t_2;
26666 __Pyx_XDECREF(__pyx_t_1);
26667 __Pyx_XDECREF(__pyx_t_2);
26668 __Pyx_XDECREF(__pyx_t_3);
26669 __Pyx_AddTraceback(
"View.MemoryView.memoryview.__repr__", __pyx_clineno, __pyx_lineno, __pyx_filename);
26672 __Pyx_XGIVEREF(__pyx_r);
26673 __Pyx_RefNannyFinishContext();
26686 static PyObject *__pyx_memoryview___str__(PyObject *__pyx_v_self);
26687 static PyObject *__pyx_memoryview___str__(PyObject *__pyx_v_self) {
26688 PyObject *__pyx_r = 0;
26689 __Pyx_RefNannyDeclarations
26690 __Pyx_RefNannySetupContext(
"__str__ (wrapper)", 0);
26691 __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_14__str__(((
struct __pyx_memoryview_obj *)__pyx_v_self));
26694 __Pyx_RefNannyFinishContext();
26698 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_14__str__(
struct __pyx_memoryview_obj *__pyx_v_self) {
26699 PyObject *__pyx_r = NULL;
26700 __Pyx_RefNannyDeclarations
26701 PyObject *__pyx_t_1 = NULL;
26702 PyObject *__pyx_t_2 = NULL;
26703 int __pyx_lineno = 0;
26704 const char *__pyx_filename = NULL;
26705 int __pyx_clineno = 0;
26706 __Pyx_RefNannySetupContext(
"__str__", 0);
26715 __Pyx_XDECREF(__pyx_r);
26716 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_base);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 616, __pyx_L1_error)
26717 __Pyx_GOTREF(__pyx_t_1);
26718 __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_class);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 616, __pyx_L1_error)
26719 __Pyx_GOTREF(__pyx_t_2);
26720 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
26721 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_name_2);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 616, __pyx_L1_error)
26722 __Pyx_GOTREF(__pyx_t_1);
26723 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
26724 __pyx_t_2 = PyTuple_New(1);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 616, __pyx_L1_error)
26725 __Pyx_GOTREF(__pyx_t_2);
26726 __Pyx_GIVEREF(__pyx_t_1);
26727 PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1);
26729 __pyx_t_1 = __Pyx_PyString_Format(__pyx_kp_s_MemoryView_of_r_object, __pyx_t_2);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 616, __pyx_L1_error)
26730 __Pyx_GOTREF(__pyx_t_1);
26731 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
26732 __pyx_r = __pyx_t_1;
26746 __Pyx_XDECREF(__pyx_t_1);
26747 __Pyx_XDECREF(__pyx_t_2);
26748 __Pyx_AddTraceback(
"View.MemoryView.memoryview.__str__", __pyx_clineno, __pyx_lineno, __pyx_filename);
26751 __Pyx_XGIVEREF(__pyx_r);
26752 __Pyx_RefNannyFinishContext();
26765 static PyObject *__pyx_memoryview_is_c_contig(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused);
26766 static PyObject *__pyx_memoryview_is_c_contig(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
26767 PyObject *__pyx_r = 0;
26768 __Pyx_RefNannyDeclarations
26769 __Pyx_RefNannySetupContext(
"is_c_contig (wrapper)", 0);
26770 __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_16is_c_contig(((
struct __pyx_memoryview_obj *)__pyx_v_self));
26773 __Pyx_RefNannyFinishContext();
26777 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_16is_c_contig(
struct __pyx_memoryview_obj *__pyx_v_self) {
26778 __Pyx_memviewslice *__pyx_v_mslice;
26779 __Pyx_memviewslice __pyx_v_tmp;
26780 PyObject *__pyx_r = NULL;
26781 __Pyx_RefNannyDeclarations
26782 __Pyx_memviewslice *__pyx_t_1;
26783 PyObject *__pyx_t_2 = NULL;
26784 int __pyx_lineno = 0;
26785 const char *__pyx_filename = NULL;
26786 int __pyx_clineno = 0;
26787 __Pyx_RefNannySetupContext(
"is_c_contig", 0);
26796 __pyx_t_1 = __pyx_memoryview_get_slice_from_memoryview(__pyx_v_self, (&__pyx_v_tmp));
if (unlikely(__pyx_t_1 == ((__Pyx_memviewslice *)NULL))) __PYX_ERR(1, 622, __pyx_L1_error)
26797 __pyx_v_mslice = __pyx_t_1;
26806 __Pyx_XDECREF(__pyx_r);
26807 __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_memviewslice_is_contig((__pyx_v_mslice[0]),
'C', __pyx_v_self->view.ndim));
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 623, __pyx_L1_error)
26808 __Pyx_GOTREF(__pyx_t_2);
26809 __pyx_r = __pyx_t_2;
26823 __Pyx_XDECREF(__pyx_t_2);
26824 __Pyx_AddTraceback(
"View.MemoryView.memoryview.is_c_contig", __pyx_clineno, __pyx_lineno, __pyx_filename);
26827 __Pyx_XGIVEREF(__pyx_r);
26828 __Pyx_RefNannyFinishContext();
26841 static PyObject *__pyx_memoryview_is_f_contig(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused);
26842 static PyObject *__pyx_memoryview_is_f_contig(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
26843 PyObject *__pyx_r = 0;
26844 __Pyx_RefNannyDeclarations
26845 __Pyx_RefNannySetupContext(
"is_f_contig (wrapper)", 0);
26846 __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_18is_f_contig(((
struct __pyx_memoryview_obj *)__pyx_v_self));
26849 __Pyx_RefNannyFinishContext();
26853 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_18is_f_contig(
struct __pyx_memoryview_obj *__pyx_v_self) {
26854 __Pyx_memviewslice *__pyx_v_mslice;
26855 __Pyx_memviewslice __pyx_v_tmp;
26856 PyObject *__pyx_r = NULL;
26857 __Pyx_RefNannyDeclarations
26858 __Pyx_memviewslice *__pyx_t_1;
26859 PyObject *__pyx_t_2 = NULL;
26860 int __pyx_lineno = 0;
26861 const char *__pyx_filename = NULL;
26862 int __pyx_clineno = 0;
26863 __Pyx_RefNannySetupContext(
"is_f_contig", 0);
26872 __pyx_t_1 = __pyx_memoryview_get_slice_from_memoryview(__pyx_v_self, (&__pyx_v_tmp));
if (unlikely(__pyx_t_1 == ((__Pyx_memviewslice *)NULL))) __PYX_ERR(1, 628, __pyx_L1_error)
26873 __pyx_v_mslice = __pyx_t_1;
26882 __Pyx_XDECREF(__pyx_r);
26883 __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_memviewslice_is_contig((__pyx_v_mslice[0]),
'F', __pyx_v_self->view.ndim));
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 629, __pyx_L1_error)
26884 __Pyx_GOTREF(__pyx_t_2);
26885 __pyx_r = __pyx_t_2;
26899 __Pyx_XDECREF(__pyx_t_2);
26900 __Pyx_AddTraceback(
"View.MemoryView.memoryview.is_f_contig", __pyx_clineno, __pyx_lineno, __pyx_filename);
26903 __Pyx_XGIVEREF(__pyx_r);
26904 __Pyx_RefNannyFinishContext();
26917 static PyObject *__pyx_memoryview_copy(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused);
26918 static PyObject *__pyx_memoryview_copy(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
26919 PyObject *__pyx_r = 0;
26920 __Pyx_RefNannyDeclarations
26921 __Pyx_RefNannySetupContext(
"copy (wrapper)", 0);
26922 __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_20copy(((
struct __pyx_memoryview_obj *)__pyx_v_self));
26925 __Pyx_RefNannyFinishContext();
26929 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_20copy(
struct __pyx_memoryview_obj *__pyx_v_self) {
26930 __Pyx_memviewslice __pyx_v_mslice;
26932 PyObject *__pyx_r = NULL;
26933 __Pyx_RefNannyDeclarations
26934 __Pyx_memviewslice __pyx_t_1;
26935 PyObject *__pyx_t_2 = NULL;
26936 int __pyx_lineno = 0;
26937 const char *__pyx_filename = NULL;
26938 int __pyx_clineno = 0;
26939 __Pyx_RefNannySetupContext(
"copy", 0);
26948 __pyx_v_flags = (__pyx_v_self->flags & (~PyBUF_F_CONTIGUOUS));
26957 __pyx_memoryview_slice_copy(__pyx_v_self, (&__pyx_v_mslice));
26966 __pyx_t_1 = __pyx_memoryview_copy_new_contig((&__pyx_v_mslice), ((
char *)
"c"), __pyx_v_self->view.ndim, __pyx_v_self->view.itemsize, (__pyx_v_flags | PyBUF_C_CONTIGUOUS), __pyx_v_self->dtype_is_object);
if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 636, __pyx_L1_error)
26967 __pyx_v_mslice = __pyx_t_1;
26976 __Pyx_XDECREF(__pyx_r);
26977 __pyx_t_2 = __pyx_memoryview_copy_object_from_slice(__pyx_v_self, (&__pyx_v_mslice));
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 641, __pyx_L1_error)
26978 __Pyx_GOTREF(__pyx_t_2);
26979 __pyx_r = __pyx_t_2;
26993 __Pyx_XDECREF(__pyx_t_2);
26994 __Pyx_AddTraceback(
"View.MemoryView.memoryview.copy", __pyx_clineno, __pyx_lineno, __pyx_filename);
26997 __Pyx_XGIVEREF(__pyx_r);
26998 __Pyx_RefNannyFinishContext();
27011 static PyObject *__pyx_memoryview_copy_fortran(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused);
27012 static PyObject *__pyx_memoryview_copy_fortran(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
27013 PyObject *__pyx_r = 0;
27014 __Pyx_RefNannyDeclarations
27015 __Pyx_RefNannySetupContext(
"copy_fortran (wrapper)", 0);
27016 __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_22copy_fortran(((
struct __pyx_memoryview_obj *)__pyx_v_self));
27019 __Pyx_RefNannyFinishContext();
27023 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_22copy_fortran(
struct __pyx_memoryview_obj *__pyx_v_self) {
27024 __Pyx_memviewslice __pyx_v_src;
27025 __Pyx_memviewslice __pyx_v_dst;
27027 PyObject *__pyx_r = NULL;
27028 __Pyx_RefNannyDeclarations
27029 __Pyx_memviewslice __pyx_t_1;
27030 PyObject *__pyx_t_2 = NULL;
27031 int __pyx_lineno = 0;
27032 const char *__pyx_filename = NULL;
27033 int __pyx_clineno = 0;
27034 __Pyx_RefNannySetupContext(
"copy_fortran", 0);
27043 __pyx_v_flags = (__pyx_v_self->flags & (~PyBUF_C_CONTIGUOUS));
27052 __pyx_memoryview_slice_copy(__pyx_v_self, (&__pyx_v_src));
27061 __pyx_t_1 = __pyx_memoryview_copy_new_contig((&__pyx_v_src), ((
char *)
"fortran"), __pyx_v_self->view.ndim, __pyx_v_self->view.itemsize, (__pyx_v_flags | PyBUF_F_CONTIGUOUS), __pyx_v_self->dtype_is_object);
if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 648, __pyx_L1_error)
27062 __pyx_v_dst = __pyx_t_1;
27071 __Pyx_XDECREF(__pyx_r);
27072 __pyx_t_2 = __pyx_memoryview_copy_object_from_slice(__pyx_v_self, (&__pyx_v_dst));
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 653, __pyx_L1_error)
27073 __Pyx_GOTREF(__pyx_t_2);
27074 __pyx_r = __pyx_t_2;
27088 __Pyx_XDECREF(__pyx_t_2);
27089 __Pyx_AddTraceback(
"View.MemoryView.memoryview.copy_fortran", __pyx_clineno, __pyx_lineno, __pyx_filename);
27092 __Pyx_XGIVEREF(__pyx_r);
27093 __Pyx_RefNannyFinishContext();
27104 static PyObject *__pyx_pw___pyx_memoryview_1__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused);
27105 static PyObject *__pyx_pw___pyx_memoryview_1__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
27106 PyObject *__pyx_r = 0;
27107 __Pyx_RefNannyDeclarations
27108 __Pyx_RefNannySetupContext(
"__reduce_cython__ (wrapper)", 0);
27109 __pyx_r = __pyx_pf___pyx_memoryview___reduce_cython__(((
struct __pyx_memoryview_obj *)__pyx_v_self));
27112 __Pyx_RefNannyFinishContext();
27116 static PyObject *__pyx_pf___pyx_memoryview___reduce_cython__(CYTHON_UNUSED
struct __pyx_memoryview_obj *__pyx_v_self) {
27117 PyObject *__pyx_r = NULL;
27118 __Pyx_RefNannyDeclarations
27119 PyObject *__pyx_t_1 = NULL;
27120 int __pyx_lineno = 0;
27121 const char *__pyx_filename = NULL;
27122 int __pyx_clineno = 0;
27123 __Pyx_RefNannySetupContext(
"__reduce_cython__", 0);
27131 __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__24, NULL);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 2, __pyx_L1_error)
27132 __Pyx_GOTREF(__pyx_t_1);
27133 __Pyx_Raise(__pyx_t_1, 0, 0, 0);
27134 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
27135 __PYX_ERR(1, 2, __pyx_L1_error)
27145 __Pyx_XDECREF(__pyx_t_1);
27146 __Pyx_AddTraceback(
"View.MemoryView.memoryview.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
27148 __Pyx_XGIVEREF(__pyx_r);
27149 __Pyx_RefNannyFinishContext();
27161 static PyObject *__pyx_pw___pyx_memoryview_3__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state);
27162 static PyObject *__pyx_pw___pyx_memoryview_3__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
27163 PyObject *__pyx_r = 0;
27164 __Pyx_RefNannyDeclarations
27165 __Pyx_RefNannySetupContext(
"__setstate_cython__ (wrapper)", 0);
27166 __pyx_r = __pyx_pf___pyx_memoryview_2__setstate_cython__(((
struct __pyx_memoryview_obj *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state));
27169 __Pyx_RefNannyFinishContext();
27173 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) {
27174 PyObject *__pyx_r = NULL;
27175 __Pyx_RefNannyDeclarations
27176 PyObject *__pyx_t_1 = NULL;
27177 int __pyx_lineno = 0;
27178 const char *__pyx_filename = NULL;
27179 int __pyx_clineno = 0;
27180 __Pyx_RefNannySetupContext(
"__setstate_cython__", 0);
27187 __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__25, NULL);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 4, __pyx_L1_error)
27188 __Pyx_GOTREF(__pyx_t_1);
27189 __Pyx_Raise(__pyx_t_1, 0, 0, 0);
27190 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
27191 __PYX_ERR(1, 4, __pyx_L1_error)
27202 __Pyx_XDECREF(__pyx_t_1);
27203 __Pyx_AddTraceback(
"View.MemoryView.memoryview.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
27205 __Pyx_XGIVEREF(__pyx_r);
27206 __Pyx_RefNannyFinishContext();
27218 static PyObject *__pyx_memoryview_new(PyObject *__pyx_v_o,
int __pyx_v_flags,
int __pyx_v_dtype_is_object, __Pyx_TypeInfo *__pyx_v_typeinfo) {
27219 struct __pyx_memoryview_obj *__pyx_v_result = 0;
27220 PyObject *__pyx_r = NULL;
27221 __Pyx_RefNannyDeclarations
27222 PyObject *__pyx_t_1 = NULL;
27223 PyObject *__pyx_t_2 = NULL;
27224 PyObject *__pyx_t_3 = NULL;
27225 int __pyx_lineno = 0;
27226 const char *__pyx_filename = NULL;
27227 int __pyx_clineno = 0;
27228 __Pyx_RefNannySetupContext(
"memoryview_cwrapper", 0);
27237 __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_flags);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 658, __pyx_L1_error)
27238 __Pyx_GOTREF(__pyx_t_1);
27239 __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_v_dtype_is_object);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 658, __pyx_L1_error)
27240 __Pyx_GOTREF(__pyx_t_2);
27241 __pyx_t_3 = PyTuple_New(3);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 658, __pyx_L1_error)
27242 __Pyx_GOTREF(__pyx_t_3);
27243 __Pyx_INCREF(__pyx_v_o);
27244 __Pyx_GIVEREF(__pyx_v_o);
27245 PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_o);
27246 __Pyx_GIVEREF(__pyx_t_1);
27247 PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_1);
27248 __Pyx_GIVEREF(__pyx_t_2);
27249 PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_t_2);
27252 __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_memoryview_type), __pyx_t_3, NULL);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 658, __pyx_L1_error)
27253 __Pyx_GOTREF(__pyx_t_2);
27254 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
27255 __pyx_v_result = ((
struct __pyx_memoryview_obj *)__pyx_t_2);
27265 __pyx_v_result->typeinfo = __pyx_v_typeinfo;
27274 __Pyx_XDECREF(__pyx_r);
27275 __Pyx_INCREF(((PyObject *)__pyx_v_result));
27276 __pyx_r = ((PyObject *)__pyx_v_result);
27289 __Pyx_XDECREF(__pyx_t_1);
27290 __Pyx_XDECREF(__pyx_t_2);
27291 __Pyx_XDECREF(__pyx_t_3);
27292 __Pyx_AddTraceback(
"View.MemoryView.memoryview_cwrapper", __pyx_clineno, __pyx_lineno, __pyx_filename);
27295 __Pyx_XDECREF((PyObject *)__pyx_v_result);
27296 __Pyx_XGIVEREF(__pyx_r);
27297 __Pyx_RefNannyFinishContext();
27309 static CYTHON_INLINE
int __pyx_memoryview_check(PyObject *__pyx_v_o) {
27311 __Pyx_RefNannyDeclarations
27313 __Pyx_RefNannySetupContext(
"memoryview_check", 0);
27322 __pyx_t_1 = __Pyx_TypeCheck(__pyx_v_o, __pyx_memoryview_type);
27323 __pyx_r = __pyx_t_1;
27336 __Pyx_RefNannyFinishContext();
27348 static PyObject *_unellipsify(PyObject *__pyx_v_index,
int __pyx_v_ndim) {
27349 PyObject *__pyx_v_tup = NULL;
27350 PyObject *__pyx_v_result = NULL;
27351 int __pyx_v_have_slices;
27352 int __pyx_v_seen_ellipsis;
27353 CYTHON_UNUSED PyObject *__pyx_v_idx = NULL;
27354 PyObject *__pyx_v_item = NULL;
27355 Py_ssize_t __pyx_v_nslices;
27356 PyObject *__pyx_r = NULL;
27357 __Pyx_RefNannyDeclarations
27360 PyObject *__pyx_t_3 = NULL;
27361 PyObject *__pyx_t_4 = NULL;
27362 Py_ssize_t __pyx_t_5;
27363 PyObject *(*__pyx_t_6)(PyObject *);
27364 PyObject *__pyx_t_7 = NULL;
27365 Py_ssize_t __pyx_t_8;
27368 PyObject *__pyx_t_11 = NULL;
27369 int __pyx_lineno = 0;
27370 const char *__pyx_filename = NULL;
27371 int __pyx_clineno = 0;
27372 __Pyx_RefNannySetupContext(
"_unellipsify", 0);
27381 __pyx_t_1 = PyTuple_Check(__pyx_v_index);
27382 __pyx_t_2 = ((!(__pyx_t_1 != 0)) != 0);
27392 __pyx_t_3 = PyTuple_New(1);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 672, __pyx_L1_error)
27393 __Pyx_GOTREF(__pyx_t_3);
27394 __Pyx_INCREF(__pyx_v_index);
27395 __Pyx_GIVEREF(__pyx_v_index);
27396 PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_index);
27397 __pyx_v_tup = __pyx_t_3;
27418 __Pyx_INCREF(__pyx_v_index);
27419 __pyx_v_tup = __pyx_v_index;
27430 __pyx_t_3 = PyList_New(0);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 676, __pyx_L1_error)
27431 __Pyx_GOTREF(__pyx_t_3);
27432 __pyx_v_result = ((PyObject*)__pyx_t_3);
27442 __pyx_v_have_slices = 0;
27451 __pyx_v_seen_ellipsis = 0;
27460 __Pyx_INCREF(__pyx_int_0);
27461 __pyx_t_3 = __pyx_int_0;
27462 if (likely(PyList_CheckExact(__pyx_v_tup)) || PyTuple_CheckExact(__pyx_v_tup)) {
27463 __pyx_t_4 = __pyx_v_tup; __Pyx_INCREF(__pyx_t_4); __pyx_t_5 = 0;
27466 __pyx_t_5 = -1; __pyx_t_4 = PyObject_GetIter(__pyx_v_tup);
if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 679, __pyx_L1_error)
27467 __Pyx_GOTREF(__pyx_t_4);
27468 __pyx_t_6 = Py_TYPE(__pyx_t_4)->tp_iternext;
if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 679, __pyx_L1_error)
27471 if (likely(!__pyx_t_6)) {
27472 if (likely(PyList_CheckExact(__pyx_t_4))) {
27473 if (__pyx_t_5 >= PyList_GET_SIZE(__pyx_t_4))
break;
27474 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
27475 __pyx_t_7 = PyList_GET_ITEM(__pyx_t_4, __pyx_t_5); __Pyx_INCREF(__pyx_t_7); __pyx_t_5++;
if (unlikely(0 < 0)) __PYX_ERR(1, 679, __pyx_L1_error)
27477 __pyx_t_7 = PySequence_ITEM(__pyx_t_4, __pyx_t_5); __pyx_t_5++;
if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 679, __pyx_L1_error)
27478 __Pyx_GOTREF(__pyx_t_7);
27481 if (__pyx_t_5 >= PyTuple_GET_SIZE(__pyx_t_4))
break;
27482 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
27483 __pyx_t_7 = PyTuple_GET_ITEM(__pyx_t_4, __pyx_t_5); __Pyx_INCREF(__pyx_t_7); __pyx_t_5++;
if (unlikely(0 < 0)) __PYX_ERR(1, 679, __pyx_L1_error)
27485 __pyx_t_7 = PySequence_ITEM(__pyx_t_4, __pyx_t_5); __pyx_t_5++;
if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 679, __pyx_L1_error)
27486 __Pyx_GOTREF(__pyx_t_7);
27490 __pyx_t_7 = __pyx_t_6(__pyx_t_4);
27491 if (unlikely(!__pyx_t_7)) {
27492 PyObject* exc_type = PyErr_Occurred();
27494 if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
27495 else __PYX_ERR(1, 679, __pyx_L1_error)
27499 __Pyx_GOTREF(__pyx_t_7);
27501 __Pyx_XDECREF_SET(__pyx_v_item, __pyx_t_7);
27503 __Pyx_INCREF(__pyx_t_3);
27504 __Pyx_XDECREF_SET(__pyx_v_idx, __pyx_t_3);
27505 __pyx_t_7 = __Pyx_PyInt_AddObjC(__pyx_t_3, __pyx_int_1, 1, 0, 0);
if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 679, __pyx_L1_error)
27506 __Pyx_GOTREF(__pyx_t_7);
27507 __Pyx_DECREF(__pyx_t_3);
27508 __pyx_t_3 = __pyx_t_7;
27518 __pyx_t_2 = (__pyx_v_item == __pyx_builtin_Ellipsis);
27519 __pyx_t_1 = (__pyx_t_2 != 0);
27529 __pyx_t_1 = ((!(__pyx_v_seen_ellipsis != 0)) != 0);
27539 __pyx_t_8 = PyObject_Length(__pyx_v_tup);
if (unlikely(__pyx_t_8 == ((Py_ssize_t)-1))) __PYX_ERR(1, 682, __pyx_L1_error)
27540 __pyx_t_7 = PyList_New(1 * ((((__pyx_v_ndim - __pyx_t_8) + 1)<0) ? 0:((__pyx_v_ndim - __pyx_t_8) + 1)));
if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 682, __pyx_L1_error)
27541 __Pyx_GOTREF(__pyx_t_7);
27542 { Py_ssize_t __pyx_temp;
27543 for (__pyx_temp=0; __pyx_temp < ((__pyx_v_ndim - __pyx_t_8) + 1); __pyx_temp++) {
27544 __Pyx_INCREF(__pyx_slice__26);
27545 __Pyx_GIVEREF(__pyx_slice__26);
27546 PyList_SET_ITEM(__pyx_t_7, __pyx_temp, __pyx_slice__26);
27549 __pyx_t_9 = __Pyx_PyList_Extend(__pyx_v_result, __pyx_t_7);
if (unlikely(__pyx_t_9 == ((
int)-1))) __PYX_ERR(1, 682, __pyx_L1_error)
27550 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
27559 __pyx_v_seen_ellipsis = 1;
27579 __pyx_t_9 = __Pyx_PyList_Append(__pyx_v_result, __pyx_slice__26);
if (unlikely(__pyx_t_9 == ((
int)-1))) __PYX_ERR(1, 685, __pyx_L1_error)
27590 __pyx_v_have_slices = 1;
27610 __pyx_t_2 = PySlice_Check(__pyx_v_item);
27611 __pyx_t_10 = ((!(__pyx_t_2 != 0)) != 0);
27614 __pyx_t_1 = __pyx_t_10;
27615 goto __pyx_L9_bool_binop_done;
27617 __pyx_t_10 = ((!(PyIndex_Check(__pyx_v_item) != 0)) != 0);
27618 __pyx_t_1 = __pyx_t_10;
27619 __pyx_L9_bool_binop_done:;
27620 if (unlikely(__pyx_t_1)) {
27629 __pyx_t_7 = __Pyx_PyString_FormatSafe(__pyx_kp_s_Cannot_index_with_type_s, ((PyObject *)Py_TYPE(__pyx_v_item)));
if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 689, __pyx_L1_error)
27630 __Pyx_GOTREF(__pyx_t_7);
27631 __pyx_t_11 = __Pyx_PyObject_CallOneArg(__pyx_builtin_TypeError, __pyx_t_7);
if (unlikely(!__pyx_t_11)) __PYX_ERR(1, 689, __pyx_L1_error)
27632 __Pyx_GOTREF(__pyx_t_11);
27633 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
27634 __Pyx_Raise(__pyx_t_11, 0, 0, 0);
27635 __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
27636 __PYX_ERR(1, 689, __pyx_L1_error)
27654 __pyx_t_10 = (__pyx_v_have_slices != 0);
27657 __pyx_t_1 = __pyx_t_10;
27658 goto __pyx_L11_bool_binop_done;
27660 __pyx_t_10 = PySlice_Check(__pyx_v_item);
27661 __pyx_t_2 = (__pyx_t_10 != 0);
27662 __pyx_t_1 = __pyx_t_2;
27663 __pyx_L11_bool_binop_done:;
27664 __pyx_v_have_slices = __pyx_t_1;
27673 __pyx_t_9 = __Pyx_PyList_Append(__pyx_v_result, __pyx_v_item);
if (unlikely(__pyx_t_9 == ((
int)-1))) __PYX_ERR(1, 692, __pyx_L1_error)
27685 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
27686 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
27695 __pyx_t_5 = PyList_GET_SIZE(__pyx_v_result);
if (unlikely(__pyx_t_5 == ((Py_ssize_t)-1))) __PYX_ERR(1, 694, __pyx_L1_error)
27696 __pyx_v_nslices = (__pyx_v_ndim - __pyx_t_5);
27705 __pyx_t_1 = (__pyx_v_nslices != 0);
27715 __pyx_t_3 = PyList_New(1 * ((__pyx_v_nslices<0) ? 0:__pyx_v_nslices));
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 696, __pyx_L1_error)
27716 __Pyx_GOTREF(__pyx_t_3);
27717 { Py_ssize_t __pyx_temp;
27718 for (__pyx_temp=0; __pyx_temp < __pyx_v_nslices; __pyx_temp++) {
27719 __Pyx_INCREF(__pyx_slice__26);
27720 __Pyx_GIVEREF(__pyx_slice__26);
27721 PyList_SET_ITEM(__pyx_t_3, __pyx_temp, __pyx_slice__26);
27724 __pyx_t_9 = __Pyx_PyList_Extend(__pyx_v_result, __pyx_t_3);
if (unlikely(__pyx_t_9 == ((
int)-1))) __PYX_ERR(1, 696, __pyx_L1_error)
27725 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
27743 __Pyx_XDECREF(__pyx_r);
27744 if (!__pyx_v_have_slices) {
27746 __pyx_t_4 = __Pyx_PyBool_FromLong(__pyx_v_have_slices);
if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 698, __pyx_L1_error)
27747 __Pyx_GOTREF(__pyx_t_4);
27748 __pyx_t_3 = __pyx_t_4;
27750 goto __pyx_L14_bool_binop_done;
27752 __pyx_t_4 = PyInt_FromSsize_t(__pyx_v_nslices);
if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 698, __pyx_L1_error)
27753 __Pyx_GOTREF(__pyx_t_4);
27754 __pyx_t_3 = __pyx_t_4;
27756 __pyx_L14_bool_binop_done:;
27757 __pyx_t_4 = PyList_AsTuple(__pyx_v_result);
if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 698, __pyx_L1_error)
27758 __Pyx_GOTREF(__pyx_t_4);
27759 __pyx_t_11 = PyTuple_New(2);
if (unlikely(!__pyx_t_11)) __PYX_ERR(1, 698, __pyx_L1_error)
27760 __Pyx_GOTREF(__pyx_t_11);
27761 __Pyx_GIVEREF(__pyx_t_3);
27762 PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_t_3);
27763 __Pyx_GIVEREF(__pyx_t_4);
27764 PyTuple_SET_ITEM(__pyx_t_11, 1, __pyx_t_4);
27767 __pyx_r = ((PyObject*)__pyx_t_11);
27781 __Pyx_XDECREF(__pyx_t_3);
27782 __Pyx_XDECREF(__pyx_t_4);
27783 __Pyx_XDECREF(__pyx_t_7);
27784 __Pyx_XDECREF(__pyx_t_11);
27785 __Pyx_AddTraceback(
"View.MemoryView._unellipsify", __pyx_clineno, __pyx_lineno, __pyx_filename);
27788 __Pyx_XDECREF(__pyx_v_tup);
27789 __Pyx_XDECREF(__pyx_v_result);
27790 __Pyx_XDECREF(__pyx_v_idx);
27791 __Pyx_XDECREF(__pyx_v_item);
27792 __Pyx_XGIVEREF(__pyx_r);
27793 __Pyx_RefNannyFinishContext();
27805 static PyObject *assert_direct_dimensions(Py_ssize_t *__pyx_v_suboffsets,
int __pyx_v_ndim) {
27806 Py_ssize_t __pyx_v_suboffset;
27807 PyObject *__pyx_r = NULL;
27808 __Pyx_RefNannyDeclarations
27809 Py_ssize_t *__pyx_t_1;
27810 Py_ssize_t *__pyx_t_2;
27811 Py_ssize_t *__pyx_t_3;
27813 PyObject *__pyx_t_5 = NULL;
27814 int __pyx_lineno = 0;
27815 const char *__pyx_filename = NULL;
27816 int __pyx_clineno = 0;
27817 __Pyx_RefNannySetupContext(
"assert_direct_dimensions", 0);
27826 __pyx_t_2 = (__pyx_v_suboffsets + __pyx_v_ndim);
27827 for (__pyx_t_3 = __pyx_v_suboffsets; __pyx_t_3 < __pyx_t_2; __pyx_t_3++) {
27828 __pyx_t_1 = __pyx_t_3;
27829 __pyx_v_suboffset = (__pyx_t_1[0]);
27838 __pyx_t_4 = ((__pyx_v_suboffset >= 0) != 0);
27839 if (unlikely(__pyx_t_4)) {
27848 __pyx_t_5 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__27, NULL);
if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 703, __pyx_L1_error)
27849 __Pyx_GOTREF(__pyx_t_5);
27850 __Pyx_Raise(__pyx_t_5, 0, 0, 0);
27851 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
27852 __PYX_ERR(1, 703, __pyx_L1_error)
27873 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
27876 __Pyx_XDECREF(__pyx_t_5);
27877 __Pyx_AddTraceback(
"View.MemoryView.assert_direct_dimensions", __pyx_clineno, __pyx_lineno, __pyx_filename);
27880 __Pyx_XGIVEREF(__pyx_r);
27881 __Pyx_RefNannyFinishContext();
27893 static struct __pyx_memoryview_obj *__pyx_memview_slice(
struct __pyx_memoryview_obj *__pyx_v_memview, PyObject *__pyx_v_indices) {
27894 int __pyx_v_new_ndim;
27895 int __pyx_v_suboffset_dim;
27897 __Pyx_memviewslice __pyx_v_src;
27898 __Pyx_memviewslice __pyx_v_dst;
27899 __Pyx_memviewslice *__pyx_v_p_src;
27900 struct __pyx_memoryviewslice_obj *__pyx_v_memviewsliceobj = 0;
27901 __Pyx_memviewslice *__pyx_v_p_dst;
27902 int *__pyx_v_p_suboffset_dim;
27903 Py_ssize_t __pyx_v_start;
27904 Py_ssize_t __pyx_v_stop;
27905 Py_ssize_t __pyx_v_step;
27906 int __pyx_v_have_start;
27907 int __pyx_v_have_stop;
27908 int __pyx_v_have_step;
27909 PyObject *__pyx_v_index = NULL;
27910 struct __pyx_memoryview_obj *__pyx_r = NULL;
27911 __Pyx_RefNannyDeclarations
27914 PyObject *__pyx_t_3 = NULL;
27915 struct __pyx_memoryview_obj *__pyx_t_4;
27918 Py_ssize_t __pyx_t_7;
27919 PyObject *(*__pyx_t_8)(PyObject *);
27920 PyObject *__pyx_t_9 = NULL;
27921 Py_ssize_t __pyx_t_10;
27923 Py_ssize_t __pyx_t_12;
27924 int __pyx_lineno = 0;
27925 const char *__pyx_filename = NULL;
27926 int __pyx_clineno = 0;
27927 __Pyx_RefNannySetupContext(
"memview_slice", 0);
27936 __pyx_v_new_ndim = 0;
27937 __pyx_v_suboffset_dim = -1;
27946 (void)(memset((&__pyx_v_dst), 0, (
sizeof(__pyx_v_dst))));
27955 #ifndef CYTHON_WITHOUT_ASSERTIONS
27956 if (unlikely(!Py_OptimizeFlag)) {
27957 if (unlikely(!((__pyx_v_memview->view.ndim > 0) != 0))) {
27958 PyErr_SetNone(PyExc_AssertionError);
27959 __PYX_ERR(1, 722, __pyx_L1_error)
27971 __pyx_t_1 = __Pyx_TypeCheck(((PyObject *)__pyx_v_memview), __pyx_memoryviewslice_type);
27972 __pyx_t_2 = (__pyx_t_1 != 0);
27982 if (!(likely(((((PyObject *)__pyx_v_memview)) == Py_None) || likely(__Pyx_TypeTest(((PyObject *)__pyx_v_memview), __pyx_memoryviewslice_type))))) __PYX_ERR(1, 725, __pyx_L1_error)
27983 __pyx_t_3 = ((PyObject *)__pyx_v_memview);
27984 __Pyx_INCREF(__pyx_t_3);
27985 __pyx_v_memviewsliceobj = ((
struct __pyx_memoryviewslice_obj *)__pyx_t_3);
27995 __pyx_v_p_src = (&__pyx_v_memviewsliceobj->from_slice);
28015 __pyx_memoryview_slice_copy(__pyx_v_memview, (&__pyx_v_src));
28024 __pyx_v_p_src = (&__pyx_v_src);
28035 __pyx_t_4 = __pyx_v_p_src->memview;
28036 __pyx_v_dst.memview = __pyx_t_4;
28045 __pyx_t_5 = __pyx_v_p_src->data;
28046 __pyx_v_dst.data = __pyx_t_5;
28055 __pyx_v_p_dst = (&__pyx_v_dst);
28064 __pyx_v_p_suboffset_dim = (&__pyx_v_suboffset_dim);
28074 if (likely(PyList_CheckExact(__pyx_v_indices)) || PyTuple_CheckExact(__pyx_v_indices)) {
28075 __pyx_t_3 = __pyx_v_indices; __Pyx_INCREF(__pyx_t_3); __pyx_t_7 = 0;
28078 __pyx_t_7 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_v_indices);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 746, __pyx_L1_error)
28079 __Pyx_GOTREF(__pyx_t_3);
28080 __pyx_t_8 = Py_TYPE(__pyx_t_3)->tp_iternext;
if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 746, __pyx_L1_error)
28083 if (likely(!__pyx_t_8)) {
28084 if (likely(PyList_CheckExact(__pyx_t_3))) {
28085 if (__pyx_t_7 >= PyList_GET_SIZE(__pyx_t_3))
break;
28086 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
28087 __pyx_t_9 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_7); __Pyx_INCREF(__pyx_t_9); __pyx_t_7++;
if (unlikely(0 < 0)) __PYX_ERR(1, 746, __pyx_L1_error)
28089 __pyx_t_9 = PySequence_ITEM(__pyx_t_3, __pyx_t_7); __pyx_t_7++;
if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 746, __pyx_L1_error)
28090 __Pyx_GOTREF(__pyx_t_9);
28093 if (__pyx_t_7 >= PyTuple_GET_SIZE(__pyx_t_3))
break;
28094 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
28095 __pyx_t_9 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_7); __Pyx_INCREF(__pyx_t_9); __pyx_t_7++;
if (unlikely(0 < 0)) __PYX_ERR(1, 746, __pyx_L1_error)
28097 __pyx_t_9 = PySequence_ITEM(__pyx_t_3, __pyx_t_7); __pyx_t_7++;
if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 746, __pyx_L1_error)
28098 __Pyx_GOTREF(__pyx_t_9);
28102 __pyx_t_9 = __pyx_t_8(__pyx_t_3);
28103 if (unlikely(!__pyx_t_9)) {
28104 PyObject* exc_type = PyErr_Occurred();
28106 if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
28107 else __PYX_ERR(1, 746, __pyx_L1_error)
28111 __Pyx_GOTREF(__pyx_t_9);
28113 __Pyx_XDECREF_SET(__pyx_v_index, __pyx_t_9);
28115 __pyx_v_dim = __pyx_t_6;
28116 __pyx_t_6 = (__pyx_t_6 + 1);
28125 __pyx_t_2 = (PyIndex_Check(__pyx_v_index) != 0);
28135 __pyx_t_10 = __Pyx_PyIndex_AsSsize_t(__pyx_v_index);
if (unlikely((__pyx_t_10 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(1, 751, __pyx_L1_error)
28144 __pyx_t_11 = __pyx_memoryview_slice_memviewslice(__pyx_v_p_dst, (__pyx_v_p_src->shape[__pyx_v_dim]), (__pyx_v_p_src->strides[__pyx_v_dim]), (__pyx_v_p_src->suboffsets[__pyx_v_dim]), __pyx_v_dim, __pyx_v_new_ndim, __pyx_v_p_suboffset_dim, __pyx_t_10, 0, 0, 0, 0, 0, 0);
if (unlikely(__pyx_t_11 == ((
int)-1))) __PYX_ERR(1, 748, __pyx_L1_error)
28163 __pyx_t_2 = (__pyx_v_index == Py_None);
28164 __pyx_t_1 = (__pyx_t_2 != 0);
28174 (__pyx_v_p_dst->shape[__pyx_v_new_ndim]) = 1;
28183 (__pyx_v_p_dst->strides[__pyx_v_new_ndim]) = 0;
28192 (__pyx_v_p_dst->suboffsets[__pyx_v_new_ndim]) = -1
L;
28201 __pyx_v_new_ndim = (__pyx_v_new_ndim + 1);
28221 __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_start);
if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 760, __pyx_L1_error)
28222 __Pyx_GOTREF(__pyx_t_9);
28223 __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_9);
if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(1, 760, __pyx_L1_error)
28225 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
28227 __pyx_t_12 = __Pyx_PyIndex_AsSsize_t(__pyx_t_9);
if (unlikely((__pyx_t_12 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(1, 760, __pyx_L1_error)
28228 __pyx_t_10 = __pyx_t_12;
28229 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
28230 goto __pyx_L7_bool_binop_done;
28233 __pyx_L7_bool_binop_done:;
28234 __pyx_v_start = __pyx_t_10;
28243 __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_stop);
if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 761, __pyx_L1_error)
28244 __Pyx_GOTREF(__pyx_t_9);
28245 __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_9);
if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(1, 761, __pyx_L1_error)
28247 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
28249 __pyx_t_12 = __Pyx_PyIndex_AsSsize_t(__pyx_t_9);
if (unlikely((__pyx_t_12 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(1, 761, __pyx_L1_error)
28250 __pyx_t_10 = __pyx_t_12;
28251 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
28252 goto __pyx_L9_bool_binop_done;
28255 __pyx_L9_bool_binop_done:;
28256 __pyx_v_stop = __pyx_t_10;
28265 __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_step);
if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 762, __pyx_L1_error)
28266 __Pyx_GOTREF(__pyx_t_9);
28267 __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_9);
if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(1, 762, __pyx_L1_error)
28269 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
28271 __pyx_t_12 = __Pyx_PyIndex_AsSsize_t(__pyx_t_9);
if (unlikely((__pyx_t_12 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(1, 762, __pyx_L1_error)
28272 __pyx_t_10 = __pyx_t_12;
28273 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
28274 goto __pyx_L11_bool_binop_done;
28277 __pyx_L11_bool_binop_done:;
28278 __pyx_v_step = __pyx_t_10;
28287 __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_start);
if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 764, __pyx_L1_error)
28288 __Pyx_GOTREF(__pyx_t_9);
28289 __pyx_t_1 = (__pyx_t_9 != Py_None);
28290 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
28291 __pyx_v_have_start = __pyx_t_1;
28300 __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_stop);
if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 765, __pyx_L1_error)
28301 __Pyx_GOTREF(__pyx_t_9);
28302 __pyx_t_1 = (__pyx_t_9 != Py_None);
28303 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
28304 __pyx_v_have_stop = __pyx_t_1;
28313 __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_step);
if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 766, __pyx_L1_error)
28314 __Pyx_GOTREF(__pyx_t_9);
28315 __pyx_t_1 = (__pyx_t_9 != Py_None);
28316 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
28317 __pyx_v_have_step = __pyx_t_1;
28326 __pyx_t_11 = __pyx_memoryview_slice_memviewslice(__pyx_v_p_dst, (__pyx_v_p_src->shape[__pyx_v_dim]), (__pyx_v_p_src->strides[__pyx_v_dim]), (__pyx_v_p_src->suboffsets[__pyx_v_dim]), __pyx_v_dim, __pyx_v_new_ndim, __pyx_v_p_suboffset_dim, __pyx_v_start, __pyx_v_stop, __pyx_v_step, __pyx_v_have_start, __pyx_v_have_stop, __pyx_v_have_step, 1);
if (unlikely(__pyx_t_11 == ((
int)-1))) __PYX_ERR(1, 768, __pyx_L1_error)
28335 __pyx_v_new_ndim = (__pyx_v_new_ndim + 1);
28347 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
28356 __pyx_t_1 = __Pyx_TypeCheck(((PyObject *)__pyx_v_memview), __pyx_memoryviewslice_type);
28357 __pyx_t_2 = (__pyx_t_1 != 0);
28367 __Pyx_XDECREF(((PyObject *)__pyx_r));
28376 if (unlikely(!__pyx_v_memviewsliceobj)) { __Pyx_RaiseUnboundLocalError(
"memviewsliceobj"); __PYX_ERR(1, 778, __pyx_L1_error) }
28385 if (unlikely(!__pyx_v_memviewsliceobj)) { __Pyx_RaiseUnboundLocalError(
"memviewsliceobj"); __PYX_ERR(1, 779, __pyx_L1_error) }
28394 __pyx_t_3 = __pyx_memoryview_fromslice(__pyx_v_dst, __pyx_v_new_ndim, __pyx_v_memviewsliceobj->to_object_func, __pyx_v_memviewsliceobj->to_dtype_func, __pyx_v_memview->dtype_is_object);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 777, __pyx_L1_error)
28395 __Pyx_GOTREF(__pyx_t_3);
28396 if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_memoryview_type))))) __PYX_ERR(1, 777, __pyx_L1_error)
28397 __pyx_r = ((
struct __pyx_memoryview_obj *)__pyx_t_3);
28418 __Pyx_XDECREF(((PyObject *)__pyx_r));
28427 __pyx_t_3 = __pyx_memoryview_fromslice(__pyx_v_dst, __pyx_v_new_ndim, NULL, NULL, __pyx_v_memview->dtype_is_object);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 782, __pyx_L1_error)
28428 __Pyx_GOTREF(__pyx_t_3);
28437 if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_memoryview_type))))) __PYX_ERR(1, 782, __pyx_L1_error)
28438 __pyx_r = ((
struct __pyx_memoryview_obj *)__pyx_t_3);
28453 __Pyx_XDECREF(__pyx_t_3);
28454 __Pyx_XDECREF(__pyx_t_9);
28455 __Pyx_AddTraceback(
"View.MemoryView.memview_slice", __pyx_clineno, __pyx_lineno, __pyx_filename);
28458 __Pyx_XDECREF((PyObject *)__pyx_v_memviewsliceobj);
28459 __Pyx_XDECREF(__pyx_v_index);
28460 __Pyx_XGIVEREF((PyObject *)__pyx_r);
28461 __Pyx_RefNannyFinishContext();
28473 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) {
28474 Py_ssize_t __pyx_v_new_shape;
28475 int __pyx_v_negative_step;
28480 int __pyx_lineno = 0;
28481 const char *__pyx_filename = NULL;
28482 int __pyx_clineno = 0;
28491 __pyx_t_1 = ((!(__pyx_v_is_slice != 0)) != 0);
28501 __pyx_t_1 = ((__pyx_v_start < 0) != 0);
28511 __pyx_v_start = (__pyx_v_start + __pyx_v_shape);
28529 __pyx_t_1 = (0 <= __pyx_v_start);
28531 __pyx_t_1 = (__pyx_v_start < __pyx_v_shape);
28533 __pyx_t_2 = ((!(__pyx_t_1 != 0)) != 0);
28543 __pyx_t_3 = __pyx_memoryview_err_dim(__pyx_builtin_IndexError, ((
char *)
"Index out of bounds (axis %d)"), __pyx_v_dim);
if (unlikely(__pyx_t_3 == ((
int)-1))) __PYX_ERR(1, 832, __pyx_L1_error)
28572 __pyx_t_1 = ((__pyx_v_have_step != 0) != 0);
28575 __pyx_t_2 = __pyx_t_1;
28576 goto __pyx_L6_bool_binop_done;
28578 __pyx_t_1 = ((__pyx_v_step < 0) != 0);
28579 __pyx_t_2 = __pyx_t_1;
28580 __pyx_L6_bool_binop_done:;
28581 __pyx_v_negative_step = __pyx_t_2;
28590 __pyx_t_1 = (__pyx_v_have_step != 0);
28593 __pyx_t_2 = __pyx_t_1;
28594 goto __pyx_L9_bool_binop_done;
28596 __pyx_t_1 = ((__pyx_v_step == 0) != 0);
28597 __pyx_t_2 = __pyx_t_1;
28598 __pyx_L9_bool_binop_done:;
28608 __pyx_t_3 = __pyx_memoryview_err_dim(__pyx_builtin_ValueError, ((
char *)
"Step may not be zero (axis %d)"), __pyx_v_dim);
if (unlikely(__pyx_t_3 == ((
int)-1))) __PYX_ERR(1, 838, __pyx_L1_error)
28626 __pyx_t_2 = (__pyx_v_have_start != 0);
28636 __pyx_t_2 = ((__pyx_v_start < 0) != 0);
28646 __pyx_v_start = (__pyx_v_start + __pyx_v_shape);
28655 __pyx_t_2 = ((__pyx_v_start < 0) != 0);
28693 __pyx_t_2 = ((__pyx_v_start >= __pyx_v_shape) != 0);
28703 __pyx_t_2 = (__pyx_v_negative_step != 0);
28713 __pyx_v_start = (__pyx_v_shape - 1);
28733 __pyx_v_start = __pyx_v_shape;
28765 __pyx_t_2 = (__pyx_v_negative_step != 0);
28775 __pyx_v_start = (__pyx_v_shape - 1);
28808 __pyx_t_2 = (__pyx_v_have_stop != 0);
28818 __pyx_t_2 = ((__pyx_v_stop < 0) != 0);
28828 __pyx_v_stop = (__pyx_v_stop + __pyx_v_shape);
28837 __pyx_t_2 = ((__pyx_v_stop < 0) != 0);
28875 __pyx_t_2 = ((__pyx_v_stop > __pyx_v_shape) != 0);
28885 __pyx_v_stop = __pyx_v_shape;
28915 __pyx_t_2 = (__pyx_v_negative_step != 0);
28925 __pyx_v_stop = -1
L;
28945 __pyx_v_stop = __pyx_v_shape;
28958 __pyx_t_2 = ((!(__pyx_v_have_step != 0)) != 0);
28986 __pyx_v_new_shape = ((__pyx_v_stop - __pyx_v_start) / __pyx_v_step);
28995 __pyx_t_2 = (((__pyx_v_stop - __pyx_v_start) - (__pyx_v_step * __pyx_v_new_shape)) != 0);
29005 __pyx_v_new_shape = (__pyx_v_new_shape + 1);
29023 __pyx_t_2 = ((__pyx_v_new_shape < 0) != 0);
29033 __pyx_v_new_shape = 0;
29051 (__pyx_v_dst->strides[__pyx_v_new_ndim]) = (__pyx_v_stride * __pyx_v_step);
29060 (__pyx_v_dst->shape[__pyx_v_new_ndim]) = __pyx_v_new_shape;
29069 (__pyx_v_dst->suboffsets[__pyx_v_new_ndim]) = __pyx_v_suboffset;
29080 __pyx_t_2 = (((__pyx_v_suboffset_dim[0]) < 0) != 0);
29090 __pyx_v_dst->data = (__pyx_v_dst->data + (__pyx_v_start * __pyx_v_stride));
29110 __pyx_t_3 = (__pyx_v_suboffset_dim[0]);
29111 (__pyx_v_dst->suboffsets[__pyx_t_3]) = ((__pyx_v_dst->suboffsets[__pyx_t_3]) + (__pyx_v_start * __pyx_v_stride));
29122 __pyx_t_2 = ((__pyx_v_suboffset >= 0) != 0);
29132 __pyx_t_2 = ((!(__pyx_v_is_slice != 0)) != 0);
29142 __pyx_t_2 = ((__pyx_v_new_ndim == 0) != 0);
29152 __pyx_v_dst->data = ((((
char **)__pyx_v_dst->data)[0]) + __pyx_v_suboffset);
29180 __pyx_t_3 = __pyx_memoryview_err_dim(__pyx_builtin_IndexError, ((
char *)
"All dimensions preceding dimension %d must be indexed and not sliced"), __pyx_v_dim);
if (unlikely(__pyx_t_3 == ((
int)-1))) __PYX_ERR(1, 899, __pyx_L1_error)
29202 (__pyx_v_suboffset_dim[0]) = __pyx_v_new_ndim;
29237 PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
29239 __Pyx_AddTraceback(
"View.MemoryView.slice_memviewslice", __pyx_clineno, __pyx_lineno, __pyx_filename);
29241 __Pyx_PyGILState_Release(__pyx_gilstate_save);
29257 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) {
29258 Py_ssize_t __pyx_v_shape;
29259 Py_ssize_t __pyx_v_stride;
29260 Py_ssize_t __pyx_v_suboffset;
29261 Py_ssize_t __pyx_v_itemsize;
29262 char *__pyx_v_resultp;
29264 __Pyx_RefNannyDeclarations
29265 Py_ssize_t __pyx_t_1;
29267 PyObject *__pyx_t_3 = NULL;
29268 PyObject *__pyx_t_4 = NULL;
29269 int __pyx_lineno = 0;
29270 const char *__pyx_filename = NULL;
29271 int __pyx_clineno = 0;
29272 __Pyx_RefNannySetupContext(
"pybuffer_index", 0);
29281 __pyx_v_suboffset = -1
L;
29290 __pyx_t_1 = __pyx_v_view->itemsize;
29291 __pyx_v_itemsize = __pyx_t_1;
29300 __pyx_t_2 = ((__pyx_v_view->ndim == 0) != 0);
29310 if (unlikely(__pyx_v_itemsize == 0)) {
29311 PyErr_SetString(PyExc_ZeroDivisionError,
"integer division or modulo by zero");
29312 __PYX_ERR(1, 917, __pyx_L1_error)
29314 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))) {
29315 PyErr_SetString(PyExc_OverflowError,
"value too large to perform division");
29316 __PYX_ERR(1, 917, __pyx_L1_error)
29318 __pyx_v_shape = (__pyx_v_view->len / __pyx_v_itemsize);
29327 __pyx_v_stride = __pyx_v_itemsize;
29347 __pyx_v_shape = (__pyx_v_view->shape[__pyx_v_dim]);
29356 __pyx_v_stride = (__pyx_v_view->strides[__pyx_v_dim]);
29365 __pyx_t_2 = ((__pyx_v_view->suboffsets != NULL) != 0);
29375 __pyx_v_suboffset = (__pyx_v_view->suboffsets[__pyx_v_dim]);
29395 __pyx_t_2 = ((__pyx_v_index < 0) != 0);
29405 __pyx_v_index = (__pyx_v_index + (__pyx_v_view->shape[__pyx_v_dim]));
29414 __pyx_t_2 = ((__pyx_v_index < 0) != 0);
29415 if (unlikely(__pyx_t_2)) {
29424 __pyx_t_3 = PyInt_FromSsize_t(__pyx_v_dim);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 928, __pyx_L1_error)
29425 __Pyx_GOTREF(__pyx_t_3);
29426 __pyx_t_4 = __Pyx_PyString_Format(__pyx_kp_s_Out_of_bounds_on_buffer_access_a, __pyx_t_3);
if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 928, __pyx_L1_error)
29427 __Pyx_GOTREF(__pyx_t_4);
29428 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
29429 __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_builtin_IndexError, __pyx_t_4);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 928, __pyx_L1_error)
29430 __Pyx_GOTREF(__pyx_t_3);
29431 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
29432 __Pyx_Raise(__pyx_t_3, 0, 0, 0);
29433 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
29434 __PYX_ERR(1, 928, __pyx_L1_error)
29461 __pyx_t_2 = ((__pyx_v_index >= __pyx_v_shape) != 0);
29462 if (unlikely(__pyx_t_2)) {
29471 __pyx_t_3 = PyInt_FromSsize_t(__pyx_v_dim);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 931, __pyx_L1_error)
29472 __Pyx_GOTREF(__pyx_t_3);
29473 __pyx_t_4 = __Pyx_PyString_Format(__pyx_kp_s_Out_of_bounds_on_buffer_access_a, __pyx_t_3);
if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 931, __pyx_L1_error)
29474 __Pyx_GOTREF(__pyx_t_4);
29475 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
29476 __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_builtin_IndexError, __pyx_t_4);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 931, __pyx_L1_error)
29477 __Pyx_GOTREF(__pyx_t_3);
29478 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
29479 __Pyx_Raise(__pyx_t_3, 0, 0, 0);
29480 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
29481 __PYX_ERR(1, 931, __pyx_L1_error)
29499 __pyx_v_resultp = (__pyx_v_bufp + (__pyx_v_index * __pyx_v_stride));
29508 __pyx_t_2 = ((__pyx_v_suboffset >= 0) != 0);
29518 __pyx_v_resultp = ((((
char **)__pyx_v_resultp)[0]) + __pyx_v_suboffset);
29536 __pyx_r = __pyx_v_resultp;
29549 __Pyx_XDECREF(__pyx_t_3);
29550 __Pyx_XDECREF(__pyx_t_4);
29551 __Pyx_AddTraceback(
"View.MemoryView.pybuffer_index", __pyx_clineno, __pyx_lineno, __pyx_filename);
29554 __Pyx_RefNannyFinishContext();
29566 static int __pyx_memslice_transpose(__Pyx_memviewslice *__pyx_v_memslice) {
29568 Py_ssize_t *__pyx_v_shape;
29569 Py_ssize_t *__pyx_v_strides;
29574 Py_ssize_t *__pyx_t_2;
29577 Py_ssize_t __pyx_t_5;
29578 Py_ssize_t __pyx_t_6;
29582 int __pyx_lineno = 0;
29583 const char *__pyx_filename = NULL;
29584 int __pyx_clineno = 0;
29593 __pyx_t_1 = __pyx_v_memslice->memview->view.ndim;
29594 __pyx_v_ndim = __pyx_t_1;
29603 __pyx_t_2 = __pyx_v_memslice->shape;
29604 __pyx_v_shape = __pyx_t_2;
29613 __pyx_t_2 = __pyx_v_memslice->strides;
29614 __pyx_v_strides = __pyx_t_2;
29623 __pyx_t_3 = (__pyx_v_ndim / 2);
29624 __pyx_t_4 = __pyx_t_3;
29625 for (__pyx_t_1 = 0; __pyx_t_1 < __pyx_t_4; __pyx_t_1+=1) {
29626 __pyx_v_i = __pyx_t_1;
29635 __pyx_v_j = ((__pyx_v_ndim - 1) - __pyx_v_i);
29644 __pyx_t_5 = (__pyx_v_strides[__pyx_v_j]);
29645 __pyx_t_6 = (__pyx_v_strides[__pyx_v_i]);
29646 (__pyx_v_strides[__pyx_v_i]) = __pyx_t_5;
29647 (__pyx_v_strides[__pyx_v_j]) = __pyx_t_6;
29656 __pyx_t_6 = (__pyx_v_shape[__pyx_v_j]);
29657 __pyx_t_5 = (__pyx_v_shape[__pyx_v_i]);
29658 (__pyx_v_shape[__pyx_v_i]) = __pyx_t_6;
29659 (__pyx_v_shape[__pyx_v_j]) = __pyx_t_5;
29668 __pyx_t_8 = (((__pyx_v_memslice->suboffsets[__pyx_v_i]) >= 0) != 0);
29671 __pyx_t_7 = __pyx_t_8;
29672 goto __pyx_L6_bool_binop_done;
29674 __pyx_t_8 = (((__pyx_v_memslice->suboffsets[__pyx_v_j]) >= 0) != 0);
29675 __pyx_t_7 = __pyx_t_8;
29676 __pyx_L6_bool_binop_done:;
29686 __pyx_t_9 = __pyx_memoryview_err(__pyx_builtin_ValueError, ((
char *)
"Cannot transpose memoryview with indirect dimensions"));
if (unlikely(__pyx_t_9 == ((
int)-1))) __PYX_ERR(1, 957, __pyx_L1_error)
29720 PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
29722 __Pyx_AddTraceback(
"View.MemoryView.transpose_memslice", __pyx_clineno, __pyx_lineno, __pyx_filename);
29724 __Pyx_PyGILState_Release(__pyx_gilstate_save);
29741 static void __pyx_memoryviewslice___dealloc__(PyObject *__pyx_v_self);
29742 static void __pyx_memoryviewslice___dealloc__(PyObject *__pyx_v_self) {
29743 __Pyx_RefNannyDeclarations
29744 __Pyx_RefNannySetupContext(
"__dealloc__ (wrapper)", 0);
29745 __pyx_memoryviewslice___pyx_pf_15View_dot_MemoryView_16_memoryviewslice___dealloc__(((
struct __pyx_memoryviewslice_obj *)__pyx_v_self));
29748 __Pyx_RefNannyFinishContext();
29751 static void __pyx_memoryviewslice___pyx_pf_15View_dot_MemoryView_16_memoryviewslice___dealloc__(
struct __pyx_memoryviewslice_obj *__pyx_v_self) {
29752 __Pyx_RefNannyDeclarations
29753 __Pyx_RefNannySetupContext(
"__dealloc__", 0);
29762 __PYX_XDEC_MEMVIEW((&__pyx_v_self->from_slice), 1);
29773 __Pyx_RefNannyFinishContext();
29784 static PyObject *__pyx_memoryviewslice_convert_item_to_object(
struct __pyx_memoryviewslice_obj *__pyx_v_self,
char *__pyx_v_itemp) {
29785 PyObject *__pyx_r = NULL;
29786 __Pyx_RefNannyDeclarations
29788 PyObject *__pyx_t_2 = NULL;
29789 int __pyx_lineno = 0;
29790 const char *__pyx_filename = NULL;
29791 int __pyx_clineno = 0;
29792 __Pyx_RefNannySetupContext(
"convert_item_to_object", 0);
29801 __pyx_t_1 = ((__pyx_v_self->to_object_func != NULL) != 0);
29811 __Pyx_XDECREF(__pyx_r);
29812 __pyx_t_2 = __pyx_v_self->to_object_func(__pyx_v_itemp);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 981, __pyx_L1_error)
29813 __Pyx_GOTREF(__pyx_t_2);
29814 __pyx_r = __pyx_t_2;
29835 __Pyx_XDECREF(__pyx_r);
29836 __pyx_t_2 = __pyx_memoryview_convert_item_to_object(((
struct __pyx_memoryview_obj *)__pyx_v_self), __pyx_v_itemp);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 983, __pyx_L1_error)
29837 __Pyx_GOTREF(__pyx_t_2);
29838 __pyx_r = __pyx_t_2;
29853 __Pyx_XDECREF(__pyx_t_2);
29854 __Pyx_AddTraceback(
"View.MemoryView._memoryviewslice.convert_item_to_object", __pyx_clineno, __pyx_lineno, __pyx_filename);
29857 __Pyx_XGIVEREF(__pyx_r);
29858 __Pyx_RefNannyFinishContext();
29870 static PyObject *__pyx_memoryviewslice_assign_item_from_object(
struct __pyx_memoryviewslice_obj *__pyx_v_self,
char *__pyx_v_itemp, PyObject *__pyx_v_value) {
29871 PyObject *__pyx_r = NULL;
29872 __Pyx_RefNannyDeclarations
29875 PyObject *__pyx_t_3 = NULL;
29876 int __pyx_lineno = 0;
29877 const char *__pyx_filename = NULL;
29878 int __pyx_clineno = 0;
29879 __Pyx_RefNannySetupContext(
"assign_item_from_object", 0);
29888 __pyx_t_1 = ((__pyx_v_self->to_dtype_func != NULL) != 0);
29898 __pyx_t_2 = __pyx_v_self->to_dtype_func(__pyx_v_itemp, __pyx_v_value);
if (unlikely(__pyx_t_2 == ((
int)0))) __PYX_ERR(1, 987, __pyx_L1_error)
29918 __pyx_t_3 = __pyx_memoryview_assign_item_from_object(((
struct __pyx_memoryview_obj *)__pyx_v_self), __pyx_v_itemp, __pyx_v_value);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 989, __pyx_L1_error)
29919 __Pyx_GOTREF(__pyx_t_3);
29920 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
29933 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
29936 __Pyx_XDECREF(__pyx_t_3);
29937 __Pyx_AddTraceback(
"View.MemoryView._memoryviewslice.assign_item_from_object", __pyx_clineno, __pyx_lineno, __pyx_filename);
29940 __Pyx_XGIVEREF(__pyx_r);
29941 __Pyx_RefNannyFinishContext();
29954 static PyObject *__pyx_pw_15View_dot_MemoryView_16_memoryviewslice_4base_1__get__(PyObject *__pyx_v_self);
29955 static PyObject *__pyx_pw_15View_dot_MemoryView_16_memoryviewslice_4base_1__get__(PyObject *__pyx_v_self) {
29956 PyObject *__pyx_r = 0;
29957 __Pyx_RefNannyDeclarations
29958 __Pyx_RefNannySetupContext(
"__get__ (wrapper)", 0);
29959 __pyx_r = __pyx_pf_15View_dot_MemoryView_16_memoryviewslice_4base___get__(((
struct __pyx_memoryviewslice_obj *)__pyx_v_self));
29962 __Pyx_RefNannyFinishContext();
29966 static PyObject *__pyx_pf_15View_dot_MemoryView_16_memoryviewslice_4base___get__(
struct __pyx_memoryviewslice_obj *__pyx_v_self) {
29967 PyObject *__pyx_r = NULL;
29968 __Pyx_RefNannyDeclarations
29969 __Pyx_RefNannySetupContext(
"__get__", 0);
29978 __Pyx_XDECREF(__pyx_r);
29979 __Pyx_INCREF(__pyx_v_self->from_object);
29980 __pyx_r = __pyx_v_self->from_object;
29993 __Pyx_XGIVEREF(__pyx_r);
29994 __Pyx_RefNannyFinishContext();
30005 static PyObject *__pyx_pw___pyx_memoryviewslice_1__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused);
30006 static PyObject *__pyx_pw___pyx_memoryviewslice_1__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
30007 PyObject *__pyx_r = 0;
30008 __Pyx_RefNannyDeclarations
30009 __Pyx_RefNannySetupContext(
"__reduce_cython__ (wrapper)", 0);
30010 __pyx_r = __pyx_pf___pyx_memoryviewslice___reduce_cython__(((
struct __pyx_memoryviewslice_obj *)__pyx_v_self));
30013 __Pyx_RefNannyFinishContext();
30017 static PyObject *__pyx_pf___pyx_memoryviewslice___reduce_cython__(CYTHON_UNUSED
struct __pyx_memoryviewslice_obj *__pyx_v_self) {
30018 PyObject *__pyx_r = NULL;
30019 __Pyx_RefNannyDeclarations
30020 PyObject *__pyx_t_1 = NULL;
30021 int __pyx_lineno = 0;
30022 const char *__pyx_filename = NULL;
30023 int __pyx_clineno = 0;
30024 __Pyx_RefNannySetupContext(
"__reduce_cython__", 0);
30032 __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__28, NULL);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 2, __pyx_L1_error)
30033 __Pyx_GOTREF(__pyx_t_1);
30034 __Pyx_Raise(__pyx_t_1, 0, 0, 0);
30035 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
30036 __PYX_ERR(1, 2, __pyx_L1_error)
30046 __Pyx_XDECREF(__pyx_t_1);
30047 __Pyx_AddTraceback(
"View.MemoryView._memoryviewslice.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
30049 __Pyx_XGIVEREF(__pyx_r);
30050 __Pyx_RefNannyFinishContext();
30062 static PyObject *__pyx_pw___pyx_memoryviewslice_3__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state);
30063 static PyObject *__pyx_pw___pyx_memoryviewslice_3__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
30064 PyObject *__pyx_r = 0;
30065 __Pyx_RefNannyDeclarations
30066 __Pyx_RefNannySetupContext(
"__setstate_cython__ (wrapper)", 0);
30067 __pyx_r = __pyx_pf___pyx_memoryviewslice_2__setstate_cython__(((
struct __pyx_memoryviewslice_obj *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state));
30070 __Pyx_RefNannyFinishContext();
30074 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) {
30075 PyObject *__pyx_r = NULL;
30076 __Pyx_RefNannyDeclarations
30077 PyObject *__pyx_t_1 = NULL;
30078 int __pyx_lineno = 0;
30079 const char *__pyx_filename = NULL;
30080 int __pyx_clineno = 0;
30081 __Pyx_RefNannySetupContext(
"__setstate_cython__", 0);
30088 __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__29, NULL);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 4, __pyx_L1_error)
30089 __Pyx_GOTREF(__pyx_t_1);
30090 __Pyx_Raise(__pyx_t_1, 0, 0, 0);
30091 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
30092 __PYX_ERR(1, 4, __pyx_L1_error)
30103 __Pyx_XDECREF(__pyx_t_1);
30104 __Pyx_AddTraceback(
"View.MemoryView._memoryviewslice.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
30106 __Pyx_XGIVEREF(__pyx_r);
30107 __Pyx_RefNannyFinishContext();
30119 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) {
30120 struct __pyx_memoryviewslice_obj *__pyx_v_result = 0;
30121 Py_ssize_t __pyx_v_suboffset;
30122 PyObject *__pyx_v_length = NULL;
30123 PyObject *__pyx_r = NULL;
30124 __Pyx_RefNannyDeclarations
30126 PyObject *__pyx_t_2 = NULL;
30127 PyObject *__pyx_t_3 = NULL;
30128 __Pyx_TypeInfo *__pyx_t_4;
30129 Py_buffer __pyx_t_5;
30130 Py_ssize_t *__pyx_t_6;
30131 Py_ssize_t *__pyx_t_7;
30132 Py_ssize_t *__pyx_t_8;
30133 Py_ssize_t __pyx_t_9;
30134 int __pyx_lineno = 0;
30135 const char *__pyx_filename = NULL;
30136 int __pyx_clineno = 0;
30137 __Pyx_RefNannySetupContext(
"memoryview_fromslice", 0);
30146 __pyx_t_1 = ((((PyObject *)__pyx_v_memviewslice.memview) == Py_None) != 0);
30156 __Pyx_XDECREF(__pyx_r);
30157 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
30176 __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_v_dtype_is_object);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1013, __pyx_L1_error)
30177 __Pyx_GOTREF(__pyx_t_2);
30178 __pyx_t_3 = PyTuple_New(3);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1013, __pyx_L1_error)
30179 __Pyx_GOTREF(__pyx_t_3);
30180 __Pyx_INCREF(Py_None);
30181 __Pyx_GIVEREF(Py_None);
30182 PyTuple_SET_ITEM(__pyx_t_3, 0, Py_None);
30183 __Pyx_INCREF(__pyx_int_0);
30184 __Pyx_GIVEREF(__pyx_int_0);
30185 PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_int_0);
30186 __Pyx_GIVEREF(__pyx_t_2);
30187 PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_t_2);
30189 __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_memoryviewslice_type), __pyx_t_3, NULL);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1013, __pyx_L1_error)
30190 __Pyx_GOTREF(__pyx_t_2);
30191 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
30192 __pyx_v_result = ((
struct __pyx_memoryviewslice_obj *)__pyx_t_2);
30202 __pyx_v_result->from_slice = __pyx_v_memviewslice;
30211 __PYX_INC_MEMVIEW((&__pyx_v_memviewslice), 1);
30220 __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_memviewslice.memview), __pyx_n_s_base);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1018, __pyx_L1_error)
30221 __Pyx_GOTREF(__pyx_t_2);
30222 __Pyx_GIVEREF(__pyx_t_2);
30223 __Pyx_GOTREF(__pyx_v_result->from_object);
30224 __Pyx_DECREF(__pyx_v_result->from_object);
30225 __pyx_v_result->from_object = __pyx_t_2;
30235 __pyx_t_4 = __pyx_v_memviewslice.memview->typeinfo;
30236 __pyx_v_result->__pyx_base.typeinfo = __pyx_t_4;
30245 __pyx_t_5 = __pyx_v_memviewslice.memview->view;
30246 __pyx_v_result->__pyx_base.view = __pyx_t_5;
30255 __pyx_v_result->__pyx_base.view.buf = ((
void *)__pyx_v_memviewslice.data);
30264 __pyx_v_result->__pyx_base.view.ndim = __pyx_v_ndim;
30273 ((Py_buffer *)(&__pyx_v_result->__pyx_base.view))->obj = Py_None;
30282 Py_INCREF(Py_None);
30291 __pyx_t_1 = ((((
struct __pyx_memoryview_obj *)__pyx_v_memviewslice.memview)->flags & PyBUF_WRITABLE) != 0);
30301 __pyx_v_result->__pyx_base.flags = PyBUF_RECORDS;
30321 __pyx_v_result->__pyx_base.flags = PyBUF_RECORDS_RO;
30332 __pyx_v_result->__pyx_base.view.shape = ((Py_ssize_t *)__pyx_v_result->from_slice.shape);
30341 __pyx_v_result->__pyx_base.view.strides = ((Py_ssize_t *)__pyx_v_result->from_slice.strides);
30350 __pyx_v_result->__pyx_base.view.suboffsets = NULL;
30359 __pyx_t_7 = (__pyx_v_result->from_slice.suboffsets + __pyx_v_ndim);
30360 for (__pyx_t_8 = __pyx_v_result->from_slice.suboffsets; __pyx_t_8 < __pyx_t_7; __pyx_t_8++) {
30361 __pyx_t_6 = __pyx_t_8;
30362 __pyx_v_suboffset = (__pyx_t_6[0]);
30371 __pyx_t_1 = ((__pyx_v_suboffset >= 0) != 0);
30381 __pyx_v_result->__pyx_base.view.suboffsets = ((Py_ssize_t *)__pyx_v_result->from_slice.suboffsets);
30390 goto __pyx_L6_break;
30410 __pyx_t_9 = __pyx_v_result->__pyx_base.view.itemsize;
30411 __pyx_v_result->__pyx_base.view.len = __pyx_t_9;
30420 __pyx_t_7 = (__pyx_v_result->__pyx_base.view.shape + __pyx_v_ndim);
30421 for (__pyx_t_8 = __pyx_v_result->__pyx_base.view.shape; __pyx_t_8 < __pyx_t_7; __pyx_t_8++) {
30422 __pyx_t_6 = __pyx_t_8;
30423 __pyx_t_2 = PyInt_FromSsize_t((__pyx_t_6[0]));
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1043, __pyx_L1_error)
30424 __Pyx_GOTREF(__pyx_t_2);
30425 __Pyx_XDECREF_SET(__pyx_v_length, __pyx_t_2);
30435 __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_result->__pyx_base.view.len);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1044, __pyx_L1_error)
30436 __Pyx_GOTREF(__pyx_t_2);
30437 __pyx_t_3 = PyNumber_InPlaceMultiply(__pyx_t_2, __pyx_v_length);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1044, __pyx_L1_error)
30438 __Pyx_GOTREF(__pyx_t_3);
30439 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
30440 __pyx_t_9 = __Pyx_PyIndex_AsSsize_t(__pyx_t_3);
if (unlikely((__pyx_t_9 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(1, 1044, __pyx_L1_error)
30441 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
30442 __pyx_v_result->__pyx_base.view.len = __pyx_t_9;
30452 __pyx_v_result->to_object_func = __pyx_v_to_object_func;
30461 __pyx_v_result->to_dtype_func = __pyx_v_to_dtype_func;
30470 __Pyx_XDECREF(__pyx_r);
30471 __Pyx_INCREF(((PyObject *)__pyx_v_result));
30472 __pyx_r = ((PyObject *)__pyx_v_result);
30485 __Pyx_XDECREF(__pyx_t_2);
30486 __Pyx_XDECREF(__pyx_t_3);
30487 __Pyx_AddTraceback(
"View.MemoryView.memoryview_fromslice", __pyx_clineno, __pyx_lineno, __pyx_filename);
30490 __Pyx_XDECREF((PyObject *)__pyx_v_result);
30491 __Pyx_XDECREF(__pyx_v_length);
30492 __Pyx_XGIVEREF(__pyx_r);
30493 __Pyx_RefNannyFinishContext();
30505 static __Pyx_memviewslice *__pyx_memoryview_get_slice_from_memoryview(
struct __pyx_memoryview_obj *__pyx_v_memview, __Pyx_memviewslice *__pyx_v_mslice) {
30506 struct __pyx_memoryviewslice_obj *__pyx_v_obj = 0;
30507 __Pyx_memviewslice *__pyx_r;
30508 __Pyx_RefNannyDeclarations
30511 PyObject *__pyx_t_3 = NULL;
30512 int __pyx_lineno = 0;
30513 const char *__pyx_filename = NULL;
30514 int __pyx_clineno = 0;
30515 __Pyx_RefNannySetupContext(
"get_slice_from_memview", 0);
30524 __pyx_t_1 = __Pyx_TypeCheck(((PyObject *)__pyx_v_memview), __pyx_memoryviewslice_type);
30525 __pyx_t_2 = (__pyx_t_1 != 0);
30535 if (!(likely(((((PyObject *)__pyx_v_memview)) == Py_None) || likely(__Pyx_TypeTest(((PyObject *)__pyx_v_memview), __pyx_memoryviewslice_type))))) __PYX_ERR(1, 1056, __pyx_L1_error)
30536 __pyx_t_3 = ((PyObject *)__pyx_v_memview);
30537 __Pyx_INCREF(__pyx_t_3);
30538 __pyx_v_obj = ((
struct __pyx_memoryviewslice_obj *)__pyx_t_3);
30548 __pyx_r = (&__pyx_v_obj->from_slice);
30568 __pyx_memoryview_slice_copy(__pyx_v_memview, __pyx_v_mslice);
30577 __pyx_r = __pyx_v_mslice;
30591 __Pyx_XDECREF(__pyx_t_3);
30592 __Pyx_AddTraceback(
"View.MemoryView.get_slice_from_memview", __pyx_clineno, __pyx_lineno, __pyx_filename);
30595 __Pyx_XDECREF((PyObject *)__pyx_v_obj);
30596 __Pyx_RefNannyFinishContext();
30608 static void __pyx_memoryview_slice_copy(
struct __pyx_memoryview_obj *__pyx_v_memview, __Pyx_memviewslice *__pyx_v_dst) {
30610 Py_ssize_t *__pyx_v_shape;
30611 Py_ssize_t *__pyx_v_strides;
30612 Py_ssize_t *__pyx_v_suboffsets;
30613 __Pyx_RefNannyDeclarations
30614 Py_ssize_t *__pyx_t_1;
30618 Py_ssize_t __pyx_t_5;
30619 __Pyx_RefNannySetupContext(
"slice_copy", 0);
30628 __pyx_t_1 = __pyx_v_memview->view.shape;
30629 __pyx_v_shape = __pyx_t_1;
30638 __pyx_t_1 = __pyx_v_memview->view.strides;
30639 __pyx_v_strides = __pyx_t_1;
30648 __pyx_t_1 = __pyx_v_memview->view.suboffsets;
30649 __pyx_v_suboffsets = __pyx_t_1;
30658 __pyx_v_dst->memview = ((
struct __pyx_memoryview_obj *)__pyx_v_memview);
30667 __pyx_v_dst->data = ((
char *)__pyx_v_memview->view.buf);
30676 __pyx_t_2 = __pyx_v_memview->view.ndim;
30677 __pyx_t_3 = __pyx_t_2;
30678 for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
30679 __pyx_v_dim = __pyx_t_4;
30688 (__pyx_v_dst->shape[__pyx_v_dim]) = (__pyx_v_shape[__pyx_v_dim]);
30697 (__pyx_v_dst->strides[__pyx_v_dim]) = (__pyx_v_strides[__pyx_v_dim]);
30706 if ((__pyx_v_suboffsets != 0)) {
30707 __pyx_t_5 = (__pyx_v_suboffsets[__pyx_v_dim]);
30711 (__pyx_v_dst->suboffsets[__pyx_v_dim]) = __pyx_t_5;
30723 __Pyx_RefNannyFinishContext();
30734 static PyObject *__pyx_memoryview_copy_object(
struct __pyx_memoryview_obj *__pyx_v_memview) {
30735 __Pyx_memviewslice __pyx_v_memviewslice;
30736 PyObject *__pyx_r = NULL;
30737 __Pyx_RefNannyDeclarations
30738 PyObject *__pyx_t_1 = NULL;
30739 int __pyx_lineno = 0;
30740 const char *__pyx_filename = NULL;
30741 int __pyx_clineno = 0;
30742 __Pyx_RefNannySetupContext(
"memoryview_copy", 0);
30751 __pyx_memoryview_slice_copy(__pyx_v_memview, (&__pyx_v_memviewslice));
30760 __Pyx_XDECREF(__pyx_r);
30761 __pyx_t_1 = __pyx_memoryview_copy_object_from_slice(__pyx_v_memview, (&__pyx_v_memviewslice));
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1084, __pyx_L1_error)
30762 __Pyx_GOTREF(__pyx_t_1);
30763 __pyx_r = __pyx_t_1;
30777 __Pyx_XDECREF(__pyx_t_1);
30778 __Pyx_AddTraceback(
"View.MemoryView.memoryview_copy", __pyx_clineno, __pyx_lineno, __pyx_filename);
30781 __Pyx_XGIVEREF(__pyx_r);
30782 __Pyx_RefNannyFinishContext();
30794 static PyObject *__pyx_memoryview_copy_object_from_slice(
struct __pyx_memoryview_obj *__pyx_v_memview, __Pyx_memviewslice *__pyx_v_memviewslice) {
30795 PyObject *(*__pyx_v_to_object_func)(
char *);
30796 int (*__pyx_v_to_dtype_func)(
char *, PyObject *);
30797 PyObject *__pyx_r = NULL;
30798 __Pyx_RefNannyDeclarations
30801 PyObject *(*__pyx_t_3)(
char *);
30802 int (*__pyx_t_4)(
char *, PyObject *);
30803 PyObject *__pyx_t_5 = NULL;
30804 int __pyx_lineno = 0;
30805 const char *__pyx_filename = NULL;
30806 int __pyx_clineno = 0;
30807 __Pyx_RefNannySetupContext(
"memoryview_copy_from_slice", 0);
30816 __pyx_t_1 = __Pyx_TypeCheck(((PyObject *)__pyx_v_memview), __pyx_memoryviewslice_type);
30817 __pyx_t_2 = (__pyx_t_1 != 0);
30827 __pyx_t_3 = ((
struct __pyx_memoryviewslice_obj *)__pyx_v_memview)->to_object_func;
30828 __pyx_v_to_object_func = __pyx_t_3;
30837 __pyx_t_4 = ((
struct __pyx_memoryviewslice_obj *)__pyx_v_memview)->to_dtype_func;
30838 __pyx_v_to_dtype_func = __pyx_t_4;
30858 __pyx_v_to_object_func = NULL;
30867 __pyx_v_to_dtype_func = NULL;
30878 __Pyx_XDECREF(__pyx_r);
30887 __pyx_t_5 = __pyx_memoryview_fromslice((__pyx_v_memviewslice[0]), __pyx_v_memview->view.ndim, __pyx_v_to_object_func, __pyx_v_to_dtype_func, __pyx_v_memview->dtype_is_object);
if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 1101, __pyx_L1_error)
30888 __Pyx_GOTREF(__pyx_t_5);
30889 __pyx_r = __pyx_t_5;
30903 __Pyx_XDECREF(__pyx_t_5);
30904 __Pyx_AddTraceback(
"View.MemoryView.memoryview_copy_from_slice", __pyx_clineno, __pyx_lineno, __pyx_filename);
30907 __Pyx_XGIVEREF(__pyx_r);
30908 __Pyx_RefNannyFinishContext();
30920 static Py_ssize_t abs_py_ssize_t(Py_ssize_t __pyx_v_arg) {
30921 Py_ssize_t __pyx_r;
30931 __pyx_t_1 = ((__pyx_v_arg < 0) != 0);
30941 __pyx_r = (-__pyx_v_arg);
30961 __pyx_r = __pyx_v_arg;
30986 static char __pyx_get_best_slice_order(__Pyx_memviewslice *__pyx_v_mslice,
int __pyx_v_ndim) {
30988 Py_ssize_t __pyx_v_c_stride;
30989 Py_ssize_t __pyx_v_f_stride;
31003 __pyx_v_c_stride = 0;
31012 __pyx_v_f_stride = 0;
31021 for (__pyx_t_1 = (__pyx_v_ndim - 1); __pyx_t_1 > -1; __pyx_t_1-=1) {
31022 __pyx_v_i = __pyx_t_1;
31031 __pyx_t_2 = (((__pyx_v_mslice->shape[__pyx_v_i]) > 1) != 0);
31041 __pyx_v_c_stride = (__pyx_v_mslice->strides[__pyx_v_i]);
31050 goto __pyx_L4_break;
31070 __pyx_t_1 = __pyx_v_ndim;
31071 __pyx_t_3 = __pyx_t_1;
31072 for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
31073 __pyx_v_i = __pyx_t_4;
31082 __pyx_t_2 = (((__pyx_v_mslice->shape[__pyx_v_i]) > 1) != 0);
31092 __pyx_v_f_stride = (__pyx_v_mslice->strides[__pyx_v_i]);
31101 goto __pyx_L7_break;
31121 __pyx_t_2 = ((abs_py_ssize_t(__pyx_v_c_stride) <= abs_py_ssize_t(__pyx_v_f_stride)) != 0);
31176 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) {
31177 CYTHON_UNUSED Py_ssize_t __pyx_v_i;
31178 CYTHON_UNUSED Py_ssize_t __pyx_v_src_extent;
31179 Py_ssize_t __pyx_v_dst_extent;
31180 Py_ssize_t __pyx_v_src_stride;
31181 Py_ssize_t __pyx_v_dst_stride;
31185 Py_ssize_t __pyx_t_4;
31186 Py_ssize_t __pyx_t_5;
31187 Py_ssize_t __pyx_t_6;
31196 __pyx_v_src_extent = (__pyx_v_src_shape[0]);
31205 __pyx_v_dst_extent = (__pyx_v_dst_shape[0]);
31214 __pyx_v_src_stride = (__pyx_v_src_strides[0]);
31223 __pyx_v_dst_stride = (__pyx_v_dst_strides[0]);
31232 __pyx_t_1 = ((__pyx_v_ndim == 1) != 0);
31242 __pyx_t_2 = ((__pyx_v_src_stride > 0) != 0);
31245 __pyx_t_1 = __pyx_t_2;
31246 goto __pyx_L5_bool_binop_done;
31248 __pyx_t_2 = ((__pyx_v_dst_stride > 0) != 0);
31251 __pyx_t_1 = __pyx_t_2;
31252 goto __pyx_L5_bool_binop_done;
31262 __pyx_t_2 = (((size_t)__pyx_v_src_stride) == __pyx_v_itemsize);
31264 __pyx_t_2 = (__pyx_v_itemsize == ((size_t)__pyx_v_dst_stride));
31266 __pyx_t_3 = (__pyx_t_2 != 0);
31267 __pyx_t_1 = __pyx_t_3;
31268 __pyx_L5_bool_binop_done:;
31286 (void)(memcpy(__pyx_v_dst_data, __pyx_v_src_data, (__pyx_v_itemsize * __pyx_v_dst_extent)));
31306 __pyx_t_4 = __pyx_v_dst_extent;
31307 __pyx_t_5 = __pyx_t_4;
31308 for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) {
31309 __pyx_v_i = __pyx_t_6;
31318 (void)(memcpy(__pyx_v_dst_data, __pyx_v_src_data, __pyx_v_itemsize));
31327 __pyx_v_src_data = (__pyx_v_src_data + __pyx_v_src_stride);
31336 __pyx_v_dst_data = (__pyx_v_dst_data + __pyx_v_dst_stride);
31359 __pyx_t_4 = __pyx_v_dst_extent;
31360 __pyx_t_5 = __pyx_t_4;
31361 for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) {
31362 __pyx_v_i = __pyx_t_6;
31371 _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);
31380 __pyx_v_src_data = (__pyx_v_src_data + __pyx_v_src_stride);
31389 __pyx_v_dst_data = (__pyx_v_dst_data + __pyx_v_dst_stride);
31413 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) {
31422 _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);
31443 static Py_ssize_t __pyx_memoryview_slice_get_size(__Pyx_memviewslice *__pyx_v_src,
int __pyx_v_ndim) {
31444 Py_ssize_t __pyx_v_shape;
31445 Py_ssize_t __pyx_v_size;
31446 Py_ssize_t __pyx_r;
31447 Py_ssize_t __pyx_t_1;
31448 Py_ssize_t *__pyx_t_2;
31449 Py_ssize_t *__pyx_t_3;
31450 Py_ssize_t *__pyx_t_4;
31459 __pyx_t_1 = __pyx_v_src->memview->view.itemsize;
31460 __pyx_v_size = __pyx_t_1;
31469 __pyx_t_3 = (__pyx_v_src->shape + __pyx_v_ndim);
31470 for (__pyx_t_4 = __pyx_v_src->shape; __pyx_t_4 < __pyx_t_3; __pyx_t_4++) {
31471 __pyx_t_2 = __pyx_t_4;
31472 __pyx_v_shape = (__pyx_t_2[0]);
31481 __pyx_v_size = (__pyx_v_size * __pyx_v_shape);
31491 __pyx_r = __pyx_v_size;
31515 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) {
31517 Py_ssize_t __pyx_r;
31530 __pyx_t_1 = ((__pyx_v_order ==
'F') != 0);
31540 __pyx_t_2 = __pyx_v_ndim;
31541 __pyx_t_3 = __pyx_t_2;
31542 for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
31543 __pyx_v_idx = __pyx_t_4;
31552 (__pyx_v_strides[__pyx_v_idx]) = __pyx_v_stride;
31561 __pyx_v_stride = (__pyx_v_stride * (__pyx_v_shape[__pyx_v_idx]));
31582 for (__pyx_t_2 = (__pyx_v_ndim - 1); __pyx_t_2 > -1; __pyx_t_2-=1) {
31583 __pyx_v_idx = __pyx_t_2;
31592 (__pyx_v_strides[__pyx_v_idx]) = __pyx_v_stride;
31601 __pyx_v_stride = (__pyx_v_stride * (__pyx_v_shape[__pyx_v_idx]));
31613 __pyx_r = __pyx_v_stride;
31637 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) {
31639 void *__pyx_v_result;
31640 size_t __pyx_v_itemsize;
31641 size_t __pyx_v_size;
31643 Py_ssize_t __pyx_t_1;
31646 struct __pyx_memoryview_obj *__pyx_t_4;
31649 int __pyx_lineno = 0;
31650 const char *__pyx_filename = NULL;
31651 int __pyx_clineno = 0;
31660 __pyx_t_1 = __pyx_v_src->memview->view.itemsize;
31661 __pyx_v_itemsize = __pyx_t_1;
31670 __pyx_v_size = __pyx_memoryview_slice_get_size(__pyx_v_src, __pyx_v_ndim);
31679 __pyx_v_result = malloc(__pyx_v_size);
31688 __pyx_t_2 = ((!(__pyx_v_result != 0)) != 0);
31698 __pyx_t_3 = __pyx_memoryview_err(__pyx_builtin_MemoryError, NULL);
if (unlikely(__pyx_t_3 == ((
int)-1))) __PYX_ERR(1, 1224, __pyx_L1_error)
31716 __pyx_v_tmpslice->data = ((
char *)__pyx_v_result);
31725 __pyx_t_4 = __pyx_v_src->memview;
31726 __pyx_v_tmpslice->memview = __pyx_t_4;
31735 __pyx_t_3 = __pyx_v_ndim;
31736 __pyx_t_5 = __pyx_t_3;
31737 for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) {
31738 __pyx_v_i = __pyx_t_6;
31747 (__pyx_v_tmpslice->shape[__pyx_v_i]) = (__pyx_v_src->shape[__pyx_v_i]);
31756 (__pyx_v_tmpslice->suboffsets[__pyx_v_i]) = -1
L;
31766 (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));
31775 __pyx_t_3 = __pyx_v_ndim;
31776 __pyx_t_5 = __pyx_t_3;
31777 for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) {
31778 __pyx_v_i = __pyx_t_6;
31787 __pyx_t_2 = (((__pyx_v_tmpslice->shape[__pyx_v_i]) == 1) != 0);
31797 (__pyx_v_tmpslice->strides[__pyx_v_i]) = 0;
31816 __pyx_t_2 = (__pyx_memviewslice_is_contig((__pyx_v_src[0]), __pyx_v_order, __pyx_v_ndim) != 0);
31826 (void)(memcpy(__pyx_v_result, __pyx_v_src->data, __pyx_v_size));
31846 copy_strided_to_strided(__pyx_v_src, __pyx_v_tmpslice, __pyx_v_ndim, __pyx_v_itemsize);
31857 __pyx_r = __pyx_v_result;
31872 PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
31874 __Pyx_AddTraceback(
"View.MemoryView.copy_data_to_temp", __pyx_clineno, __pyx_lineno, __pyx_filename);
31876 __Pyx_PyGILState_Release(__pyx_gilstate_save);
31892 static int __pyx_memoryview_err_extents(
int __pyx_v_i, Py_ssize_t __pyx_v_extent1, Py_ssize_t __pyx_v_extent2) {
31894 __Pyx_RefNannyDeclarations
31895 PyObject *__pyx_t_1 = NULL;
31896 PyObject *__pyx_t_2 = NULL;
31897 PyObject *__pyx_t_3 = NULL;
31898 PyObject *__pyx_t_4 = NULL;
31899 int __pyx_lineno = 0;
31900 const char *__pyx_filename = NULL;
31901 int __pyx_clineno = 0;
31903 PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
31905 __Pyx_RefNannySetupContext(
"_err_extents", 0);
31914 __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_i);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1254, __pyx_L1_error)
31915 __Pyx_GOTREF(__pyx_t_1);
31916 __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_extent1);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1254, __pyx_L1_error)
31917 __Pyx_GOTREF(__pyx_t_2);
31918 __pyx_t_3 = PyInt_FromSsize_t(__pyx_v_extent2);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1254, __pyx_L1_error)
31919 __Pyx_GOTREF(__pyx_t_3);
31920 __pyx_t_4 = PyTuple_New(3);
if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 1254, __pyx_L1_error)
31921 __Pyx_GOTREF(__pyx_t_4);
31922 __Pyx_GIVEREF(__pyx_t_1);
31923 PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_1);
31924 __Pyx_GIVEREF(__pyx_t_2);
31925 PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_2);
31926 __Pyx_GIVEREF(__pyx_t_3);
31927 PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_t_3);
31939 __pyx_t_3 = __Pyx_PyString_Format(__pyx_kp_s_got_differing_extents_in_dimensi, __pyx_t_4);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1253, __pyx_L1_error)
31940 __Pyx_GOTREF(__pyx_t_3);
31941 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
31942 __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_3);
if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 1253, __pyx_L1_error)
31943 __Pyx_GOTREF(__pyx_t_4);
31944 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
31945 __Pyx_Raise(__pyx_t_4, 0, 0, 0);
31946 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
31947 __PYX_ERR(1, 1253, __pyx_L1_error)
31959 __Pyx_XDECREF(__pyx_t_1);
31960 __Pyx_XDECREF(__pyx_t_2);
31961 __Pyx_XDECREF(__pyx_t_3);
31962 __Pyx_XDECREF(__pyx_t_4);
31963 __Pyx_AddTraceback(
"View.MemoryView._err_extents", __pyx_clineno, __pyx_lineno, __pyx_filename);
31965 __Pyx_RefNannyFinishContext();
31967 __Pyx_PyGILState_Release(__pyx_gilstate_save);
31980 static int __pyx_memoryview_err_dim(PyObject *__pyx_v_error,
char *__pyx_v_msg,
int __pyx_v_dim) {
31982 __Pyx_RefNannyDeclarations
31983 PyObject *__pyx_t_1 = NULL;
31984 PyObject *__pyx_t_2 = NULL;
31985 PyObject *__pyx_t_3 = NULL;
31986 PyObject *__pyx_t_4 = NULL;
31987 int __pyx_lineno = 0;
31988 const char *__pyx_filename = NULL;
31989 int __pyx_clineno = 0;
31991 PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
31993 __Pyx_RefNannySetupContext(
"_err_dim", 0);
31994 __Pyx_INCREF(__pyx_v_error);
32003 __pyx_t_2 = __Pyx_decode_c_string(__pyx_v_msg, 0, strlen(__pyx_v_msg), NULL, NULL, PyUnicode_DecodeASCII);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1258, __pyx_L1_error)
32004 __Pyx_GOTREF(__pyx_t_2);
32005 __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_dim);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1258, __pyx_L1_error)
32006 __Pyx_GOTREF(__pyx_t_3);
32007 __pyx_t_4 = PyUnicode_Format(__pyx_t_2, __pyx_t_3);
if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 1258, __pyx_L1_error)
32008 __Pyx_GOTREF(__pyx_t_4);
32009 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
32010 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
32011 __Pyx_INCREF(__pyx_v_error);
32012 __pyx_t_3 = __pyx_v_error; __pyx_t_2 = NULL;
32013 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
32014 __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
32015 if (likely(__pyx_t_2)) {
32016 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_3);
32017 __Pyx_INCREF(__pyx_t_2);
32018 __Pyx_INCREF(
function);
32019 __Pyx_DECREF_SET(__pyx_t_3,
function);
32022 __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);
32023 __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
32024 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
32025 if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1258, __pyx_L1_error)
32026 __Pyx_GOTREF(__pyx_t_1);
32027 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
32028 __Pyx_Raise(__pyx_t_1, 0, 0, 0);
32029 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
32030 __PYX_ERR(1, 1258, __pyx_L1_error)
32042 __Pyx_XDECREF(__pyx_t_1);
32043 __Pyx_XDECREF(__pyx_t_2);
32044 __Pyx_XDECREF(__pyx_t_3);
32045 __Pyx_XDECREF(__pyx_t_4);
32046 __Pyx_AddTraceback(
"View.MemoryView._err_dim", __pyx_clineno, __pyx_lineno, __pyx_filename);
32048 __Pyx_XDECREF(__pyx_v_error);
32049 __Pyx_RefNannyFinishContext();
32051 __Pyx_PyGILState_Release(__pyx_gilstate_save);
32064 static int __pyx_memoryview_err(PyObject *__pyx_v_error,
char *__pyx_v_msg) {
32066 __Pyx_RefNannyDeclarations
32068 PyObject *__pyx_t_2 = NULL;
32069 PyObject *__pyx_t_3 = NULL;
32070 PyObject *__pyx_t_4 = NULL;
32071 PyObject *__pyx_t_5 = NULL;
32072 int __pyx_lineno = 0;
32073 const char *__pyx_filename = NULL;
32074 int __pyx_clineno = 0;
32076 PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
32078 __Pyx_RefNannySetupContext(
"_err", 0);
32079 __Pyx_INCREF(__pyx_v_error);
32088 __pyx_t_1 = ((__pyx_v_msg != NULL) != 0);
32089 if (unlikely(__pyx_t_1)) {
32098 __pyx_t_3 = __Pyx_decode_c_string(__pyx_v_msg, 0, strlen(__pyx_v_msg), NULL, NULL, PyUnicode_DecodeASCII);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1263, __pyx_L1_error)
32099 __Pyx_GOTREF(__pyx_t_3);
32100 __Pyx_INCREF(__pyx_v_error);
32101 __pyx_t_4 = __pyx_v_error; __pyx_t_5 = NULL;
32102 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
32103 __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
32104 if (likely(__pyx_t_5)) {
32105 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_4);
32106 __Pyx_INCREF(__pyx_t_5);
32107 __Pyx_INCREF(
function);
32108 __Pyx_DECREF_SET(__pyx_t_4,
function);
32111 __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);
32112 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
32113 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
32114 if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1263, __pyx_L1_error)
32115 __Pyx_GOTREF(__pyx_t_2);
32116 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
32117 __Pyx_Raise(__pyx_t_2, 0, 0, 0);
32118 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
32119 __PYX_ERR(1, 1263, __pyx_L1_error)
32138 __Pyx_Raise(__pyx_v_error, 0, 0, 0);
32139 __PYX_ERR(1, 1265, __pyx_L1_error)
32152 __Pyx_XDECREF(__pyx_t_2);
32153 __Pyx_XDECREF(__pyx_t_3);
32154 __Pyx_XDECREF(__pyx_t_4);
32155 __Pyx_XDECREF(__pyx_t_5);
32156 __Pyx_AddTraceback(
"View.MemoryView._err", __pyx_clineno, __pyx_lineno, __pyx_filename);
32158 __Pyx_XDECREF(__pyx_v_error);
32159 __Pyx_RefNannyFinishContext();
32161 __Pyx_PyGILState_Release(__pyx_gilstate_save);
32174 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) {
32175 void *__pyx_v_tmpdata;
32176 size_t __pyx_v_itemsize;
32178 char __pyx_v_order;
32179 int __pyx_v_broadcasting;
32180 int __pyx_v_direct_copy;
32181 __Pyx_memviewslice __pyx_v_tmp;
32184 Py_ssize_t __pyx_t_1;
32192 int __pyx_lineno = 0;
32193 const char *__pyx_filename = NULL;
32194 int __pyx_clineno = 0;
32203 __pyx_v_tmpdata = NULL;
32212 __pyx_t_1 = __pyx_v_src.memview->view.itemsize;
32213 __pyx_v_itemsize = __pyx_t_1;
32222 __pyx_v_order = __pyx_get_best_slice_order((&__pyx_v_src), __pyx_v_src_ndim);
32231 __pyx_v_broadcasting = 0;
32240 __pyx_v_direct_copy = 0;
32249 __pyx_t_2 = ((__pyx_v_src_ndim < __pyx_v_dst_ndim) != 0);
32259 __pyx_memoryview_broadcast_leading((&__pyx_v_src), __pyx_v_src_ndim, __pyx_v_dst_ndim);
32278 __pyx_t_2 = ((__pyx_v_dst_ndim < __pyx_v_src_ndim) != 0);
32288 __pyx_memoryview_broadcast_leading((&__pyx_v_dst), __pyx_v_dst_ndim, __pyx_v_src_ndim);
32307 __pyx_t_3 = __pyx_v_dst_ndim;
32308 __pyx_t_4 = __pyx_v_src_ndim;
32309 if (((__pyx_t_3 > __pyx_t_4) != 0)) {
32310 __pyx_t_5 = __pyx_t_3;
32312 __pyx_t_5 = __pyx_t_4;
32314 __pyx_v_ndim = __pyx_t_5;
32323 __pyx_t_5 = __pyx_v_ndim;
32324 __pyx_t_3 = __pyx_t_5;
32325 for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
32326 __pyx_v_i = __pyx_t_4;
32335 __pyx_t_2 = (((__pyx_v_src.shape[__pyx_v_i]) != (__pyx_v_dst.shape[__pyx_v_i])) != 0);
32345 __pyx_t_2 = (((__pyx_v_src.shape[__pyx_v_i]) == 1) != 0);
32355 __pyx_v_broadcasting = 1;
32364 (__pyx_v_src.strides[__pyx_v_i]) = 0;
32384 __pyx_t_6 = __pyx_memoryview_err_extents(__pyx_v_i, (__pyx_v_dst.shape[__pyx_v_i]), (__pyx_v_src.shape[__pyx_v_i]));
if (unlikely(__pyx_t_6 == ((
int)-1))) __PYX_ERR(1, 1297, __pyx_L1_error)
32404 __pyx_t_2 = (((__pyx_v_src.suboffsets[__pyx_v_i]) >= 0) != 0);
32414 __pyx_t_6 = __pyx_memoryview_err_dim(__pyx_builtin_ValueError, ((
char *)
"Dimension %d is not direct"), __pyx_v_i);
if (unlikely(__pyx_t_6 == ((
int)-1))) __PYX_ERR(1, 1300, __pyx_L1_error)
32433 __pyx_t_2 = (__pyx_slices_overlap((&__pyx_v_src), (&__pyx_v_dst), __pyx_v_ndim, __pyx_v_itemsize) != 0);
32443 __pyx_t_2 = ((!(__pyx_memviewslice_is_contig(__pyx_v_src, __pyx_v_order, __pyx_v_ndim) != 0)) != 0);
32453 __pyx_v_order = __pyx_get_best_slice_order((&__pyx_v_dst), __pyx_v_ndim);
32471 __pyx_t_7 = __pyx_memoryview_copy_data_to_temp((&__pyx_v_src), (&__pyx_v_tmp), __pyx_v_order, __pyx_v_ndim);
if (unlikely(__pyx_t_7 == ((
void *)NULL))) __PYX_ERR(1, 1307, __pyx_L1_error)
32472 __pyx_v_tmpdata = __pyx_t_7;
32481 __pyx_v_src = __pyx_v_tmp;
32499 __pyx_t_2 = ((!(__pyx_v_broadcasting != 0)) != 0);
32509 __pyx_t_2 = (__pyx_memviewslice_is_contig(__pyx_v_src,
'C', __pyx_v_ndim) != 0);
32519 __pyx_v_direct_copy = __pyx_memviewslice_is_contig(__pyx_v_dst,
'C', __pyx_v_ndim);
32538 __pyx_t_2 = (__pyx_memviewslice_is_contig(__pyx_v_src,
'F', __pyx_v_ndim) != 0);
32548 __pyx_v_direct_copy = __pyx_memviewslice_is_contig(__pyx_v_dst,
'F', __pyx_v_ndim);
32567 __pyx_t_2 = (__pyx_v_direct_copy != 0);
32577 __pyx_memoryview_refcount_copying((&__pyx_v_dst), __pyx_v_dtype_is_object, __pyx_v_ndim, 0);
32586 (void)(memcpy(__pyx_v_dst.data, __pyx_v_src.data, __pyx_memoryview_slice_get_size((&__pyx_v_src), __pyx_v_ndim)));
32595 __pyx_memoryview_refcount_copying((&__pyx_v_dst), __pyx_v_dtype_is_object, __pyx_v_ndim, 1);
32604 free(__pyx_v_tmpdata);
32641 __pyx_t_2 = (__pyx_v_order ==
'F');
32643 __pyx_t_2 = (
'F' == __pyx_get_best_slice_order((&__pyx_v_dst), __pyx_v_ndim));
32645 __pyx_t_8 = (__pyx_t_2 != 0);
32655 __pyx_t_5 = __pyx_memslice_transpose((&__pyx_v_src));
if (unlikely(__pyx_t_5 == ((
int)0))) __PYX_ERR(1, 1329, __pyx_L1_error)
32664 __pyx_t_5 = __pyx_memslice_transpose((&__pyx_v_dst));
if (unlikely(__pyx_t_5 == ((
int)0))) __PYX_ERR(1, 1330, __pyx_L1_error)
32682 __pyx_memoryview_refcount_copying((&__pyx_v_dst), __pyx_v_dtype_is_object, __pyx_v_ndim, 0);
32691 copy_strided_to_strided((&__pyx_v_src), (&__pyx_v_dst), __pyx_v_ndim, __pyx_v_itemsize);
32700 __pyx_memoryview_refcount_copying((&__pyx_v_dst), __pyx_v_dtype_is_object, __pyx_v_ndim, 1);
32709 free(__pyx_v_tmpdata);
32733 PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
32735 __Pyx_AddTraceback(
"View.MemoryView.memoryview_copy_contents", __pyx_clineno, __pyx_lineno, __pyx_filename);
32737 __Pyx_PyGILState_Release(__pyx_gilstate_save);
32753 static void __pyx_memoryview_broadcast_leading(__Pyx_memviewslice *__pyx_v_mslice,
int __pyx_v_ndim,
int __pyx_v_ndim_other) {
32755 int __pyx_v_offset;
32767 __pyx_v_offset = (__pyx_v_ndim_other - __pyx_v_ndim);
32776 for (__pyx_t_1 = (__pyx_v_ndim - 1); __pyx_t_1 > -1; __pyx_t_1-=1) {
32777 __pyx_v_i = __pyx_t_1;
32786 (__pyx_v_mslice->shape[(__pyx_v_i + __pyx_v_offset)]) = (__pyx_v_mslice->shape[__pyx_v_i]);
32795 (__pyx_v_mslice->strides[(__pyx_v_i + __pyx_v_offset)]) = (__pyx_v_mslice->strides[__pyx_v_i]);
32804 (__pyx_v_mslice->suboffsets[(__pyx_v_i + __pyx_v_offset)]) = (__pyx_v_mslice->suboffsets[__pyx_v_i]);
32814 __pyx_t_1 = __pyx_v_offset;
32815 __pyx_t_2 = __pyx_t_1;
32816 for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) {
32817 __pyx_v_i = __pyx_t_3;
32826 (__pyx_v_mslice->shape[__pyx_v_i]) = 1;
32835 (__pyx_v_mslice->strides[__pyx_v_i]) = (__pyx_v_mslice->strides[0]);
32844 (__pyx_v_mslice->suboffsets[__pyx_v_i]) = -1
L;
32866 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) {
32876 __pyx_t_1 = (__pyx_v_dtype_is_object != 0);
32886 __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);
32916 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) {
32917 __Pyx_RefNannyDeclarations
32919 PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
32921 __Pyx_RefNannySetupContext(
"refcount_objects_in_slice_with_gil", 0);
32930 __pyx_memoryview_refcount_objects_in_slice(__pyx_v_data, __pyx_v_shape, __pyx_v_strides, __pyx_v_ndim, __pyx_v_inc);
32941 __Pyx_RefNannyFinishContext();
32943 __Pyx_PyGILState_Release(__pyx_gilstate_save);
32955 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) {
32956 CYTHON_UNUSED Py_ssize_t __pyx_v_i;
32957 __Pyx_RefNannyDeclarations
32958 Py_ssize_t __pyx_t_1;
32959 Py_ssize_t __pyx_t_2;
32960 Py_ssize_t __pyx_t_3;
32962 __Pyx_RefNannySetupContext(
"refcount_objects_in_slice", 0);
32971 __pyx_t_1 = (__pyx_v_shape[0]);
32972 __pyx_t_2 = __pyx_t_1;
32973 for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) {
32974 __pyx_v_i = __pyx_t_3;
32983 __pyx_t_4 = ((__pyx_v_ndim == 1) != 0);
32993 __pyx_t_4 = (__pyx_v_inc != 0);
33003 Py_INCREF((((PyObject **)__pyx_v_data)[0]));
33023 Py_DECREF((((PyObject **)__pyx_v_data)[0]));
33053 __pyx_memoryview_refcount_objects_in_slice(__pyx_v_data, (__pyx_v_shape + 1), (__pyx_v_strides + 1), (__pyx_v_ndim - 1), __pyx_v_inc);
33064 __pyx_v_data = (__pyx_v_data + (__pyx_v_strides[0]));
33076 __Pyx_RefNannyFinishContext();
33087 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) {
33096 __pyx_memoryview_refcount_copying(__pyx_v_dst, __pyx_v_dtype_is_object, __pyx_v_ndim, 0);
33105 __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);
33114 __pyx_memoryview_refcount_copying(__pyx_v_dst, __pyx_v_dtype_is_object, __pyx_v_ndim, 1);
33135 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) {
33136 CYTHON_UNUSED Py_ssize_t __pyx_v_i;
33137 Py_ssize_t __pyx_v_stride;
33138 Py_ssize_t __pyx_v_extent;
33140 Py_ssize_t __pyx_t_2;
33141 Py_ssize_t __pyx_t_3;
33142 Py_ssize_t __pyx_t_4;
33151 __pyx_v_stride = (__pyx_v_strides[0]);
33160 __pyx_v_extent = (__pyx_v_shape[0]);
33169 __pyx_t_1 = ((__pyx_v_ndim == 1) != 0);
33179 __pyx_t_2 = __pyx_v_extent;
33180 __pyx_t_3 = __pyx_t_2;
33181 for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
33182 __pyx_v_i = __pyx_t_4;
33191 (void)(memcpy(__pyx_v_data, __pyx_v_item, __pyx_v_itemsize));
33200 __pyx_v_data = (__pyx_v_data + __pyx_v_stride);
33221 __pyx_t_2 = __pyx_v_extent;
33222 __pyx_t_3 = __pyx_t_2;
33223 for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
33224 __pyx_v_i = __pyx_t_4;
33233 __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);
33242 __pyx_v_data = (__pyx_v_data + __pyx_v_stride);
33265 static PyObject *__pyx_pw_15View_dot_MemoryView_1__pyx_unpickle_Enum(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
33266 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};
33267 static PyObject *__pyx_pw_15View_dot_MemoryView_1__pyx_unpickle_Enum(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
33268 PyObject *__pyx_v___pyx_type = 0;
33269 long __pyx_v___pyx_checksum;
33270 PyObject *__pyx_v___pyx_state = 0;
33271 int __pyx_lineno = 0;
33272 const char *__pyx_filename = NULL;
33273 int __pyx_clineno = 0;
33274 PyObject *__pyx_r = 0;
33275 __Pyx_RefNannyDeclarations
33276 __Pyx_RefNannySetupContext(
"__pyx_unpickle_Enum (wrapper)", 0);
33278 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_pyx_type,&__pyx_n_s_pyx_checksum,&__pyx_n_s_pyx_state,0};
33279 PyObject* values[3] = {0,0,0};
33280 if (unlikely(__pyx_kwds)) {
33281 Py_ssize_t kw_args;
33282 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
33283 switch (pos_args) {
33284 case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
33285 CYTHON_FALLTHROUGH;
33286 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
33287 CYTHON_FALLTHROUGH;
33288 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
33289 CYTHON_FALLTHROUGH;
33291 default:
goto __pyx_L5_argtuple_error;
33293 kw_args = PyDict_Size(__pyx_kwds);
33294 switch (pos_args) {
33296 if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pyx_type)) != 0)) kw_args--;
33297 else goto __pyx_L5_argtuple_error;
33298 CYTHON_FALLTHROUGH;
33300 if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pyx_checksum)) != 0)) kw_args--;
33302 __Pyx_RaiseArgtupleInvalid(
"__pyx_unpickle_Enum", 1, 3, 3, 1); __PYX_ERR(1, 1, __pyx_L3_error)
33304 CYTHON_FALLTHROUGH;
33306 if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pyx_state)) != 0)) kw_args--;
33308 __Pyx_RaiseArgtupleInvalid(
"__pyx_unpickle_Enum", 1, 3, 3, 2); __PYX_ERR(1, 1, __pyx_L3_error)
33311 if (unlikely(kw_args > 0)) {
33312 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args,
"__pyx_unpickle_Enum") < 0)) __PYX_ERR(1, 1, __pyx_L3_error)
33314 }
else if (PyTuple_GET_SIZE(__pyx_args) != 3) {
33315 goto __pyx_L5_argtuple_error;
33317 values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
33318 values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
33319 values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
33321 __pyx_v___pyx_type = values[0];
33322 __pyx_v___pyx_checksum = __Pyx_PyInt_As_long(values[1]);
if (unlikely((__pyx_v___pyx_checksum == (
long)-1) && PyErr_Occurred())) __PYX_ERR(1, 1, __pyx_L3_error)
33323 __pyx_v___pyx_state = values[2];
33325 goto __pyx_L4_argument_unpacking_done;
33326 __pyx_L5_argtuple_error:;
33327 __Pyx_RaiseArgtupleInvalid(
"__pyx_unpickle_Enum", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(1, 1, __pyx_L3_error)
33329 __Pyx_AddTraceback(
"View.MemoryView.__pyx_unpickle_Enum", __pyx_clineno, __pyx_lineno, __pyx_filename);
33330 __Pyx_RefNannyFinishContext();
33332 __pyx_L4_argument_unpacking_done:;
33333 __pyx_r = __pyx_pf_15View_dot_MemoryView___pyx_unpickle_Enum(__pyx_self, __pyx_v___pyx_type, __pyx_v___pyx_checksum, __pyx_v___pyx_state);
33336 __Pyx_RefNannyFinishContext();
33340 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) {
33341 PyObject *__pyx_v___pyx_PickleError = 0;
33342 PyObject *__pyx_v___pyx_result = 0;
33343 PyObject *__pyx_r = NULL;
33344 __Pyx_RefNannyDeclarations
33345 PyObject *__pyx_t_1 = NULL;
33348 PyObject *__pyx_t_4 = NULL;
33349 PyObject *__pyx_t_5 = NULL;
33350 PyObject *__pyx_t_6 = NULL;
33351 int __pyx_lineno = 0;
33352 const char *__pyx_filename = NULL;
33353 int __pyx_clineno = 0;
33354 __Pyx_RefNannySetupContext(
"__pyx_unpickle_Enum", 0);
33363 __pyx_t_1 = __Pyx_PyInt_From_long(__pyx_v___pyx_checksum);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 4, __pyx_L1_error)
33364 __Pyx_GOTREF(__pyx_t_1);
33365 __pyx_t_2 = (__Pyx_PySequence_ContainsTF(__pyx_t_1, __pyx_tuple__30, Py_NE));
if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(1, 4, __pyx_L1_error)
33366 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
33367 __pyx_t_3 = (__pyx_t_2 != 0);
33377 __pyx_t_1 = PyList_New(1);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 5, __pyx_L1_error)
33378 __Pyx_GOTREF(__pyx_t_1);
33379 __Pyx_INCREF(__pyx_n_s_PickleError);
33380 __Pyx_GIVEREF(__pyx_n_s_PickleError);
33381 PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_s_PickleError);
33382 __pyx_t_4 = __Pyx_Import(__pyx_n_s_pickle, __pyx_t_1, 0);
if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 5, __pyx_L1_error)
33383 __Pyx_GOTREF(__pyx_t_4);
33384 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
33385 __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_4, __pyx_n_s_PickleError);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 5, __pyx_L1_error)
33386 __Pyx_GOTREF(__pyx_t_1);
33387 __Pyx_INCREF(__pyx_t_1);
33388 __pyx_v___pyx_PickleError = __pyx_t_1;
33389 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
33390 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
33399 __pyx_t_1 = __Pyx_PyInt_From_long(__pyx_v___pyx_checksum);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 6, __pyx_L1_error)
33400 __Pyx_GOTREF(__pyx_t_1);
33401 __pyx_t_5 = __Pyx_PyString_Format(__pyx_kp_s_Incompatible_checksums_0x_x_vs_0, __pyx_t_1);
if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 6, __pyx_L1_error)
33402 __Pyx_GOTREF(__pyx_t_5);
33403 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
33404 __Pyx_INCREF(__pyx_v___pyx_PickleError);
33405 __pyx_t_1 = __pyx_v___pyx_PickleError; __pyx_t_6 = NULL;
33406 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_1))) {
33407 __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_1);
33408 if (likely(__pyx_t_6)) {
33409 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_1);
33410 __Pyx_INCREF(__pyx_t_6);
33411 __Pyx_INCREF(
function);
33412 __Pyx_DECREF_SET(__pyx_t_1,
function);
33415 __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);
33416 __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
33417 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
33418 if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 6, __pyx_L1_error)
33419 __Pyx_GOTREF(__pyx_t_4);
33420 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
33421 __Pyx_Raise(__pyx_t_4, 0, 0, 0);
33422 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
33423 __PYX_ERR(1, 6, __pyx_L1_error)
33441 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_MemviewEnum_type), __pyx_n_s_new);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 7, __pyx_L1_error)
33442 __Pyx_GOTREF(__pyx_t_1);
33444 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_1))) {
33445 __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_1);
33446 if (likely(__pyx_t_5)) {
33447 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_1);
33448 __Pyx_INCREF(__pyx_t_5);
33449 __Pyx_INCREF(
function);
33450 __Pyx_DECREF_SET(__pyx_t_1,
function);
33453 __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);
33454 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
33455 if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 7, __pyx_L1_error)
33456 __Pyx_GOTREF(__pyx_t_4);
33457 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
33458 __pyx_v___pyx_result = __pyx_t_4;
33468 __pyx_t_3 = (__pyx_v___pyx_state != Py_None);
33469 __pyx_t_2 = (__pyx_t_3 != 0);
33479 if (!(likely(PyTuple_CheckExact(__pyx_v___pyx_state))||((__pyx_v___pyx_state) == Py_None)||(PyErr_Format(PyExc_TypeError,
"Expected %.16s, got %.200s",
"tuple", Py_TYPE(__pyx_v___pyx_state)->tp_name), 0))) __PYX_ERR(1, 9, __pyx_L1_error)
33480 __pyx_t_4 = __pyx_unpickle_Enum__set_state(((
struct __pyx_MemviewEnum_obj *)__pyx_v___pyx_result), ((PyObject*)__pyx_v___pyx_state));
if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 9, __pyx_L1_error)
33481 __Pyx_GOTREF(__pyx_t_4);
33482 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
33500 __Pyx_XDECREF(__pyx_r);
33501 __Pyx_INCREF(__pyx_v___pyx_result);
33502 __pyx_r = __pyx_v___pyx_result;
33513 __Pyx_XDECREF(__pyx_t_1);
33514 __Pyx_XDECREF(__pyx_t_4);
33515 __Pyx_XDECREF(__pyx_t_5);
33516 __Pyx_XDECREF(__pyx_t_6);
33517 __Pyx_AddTraceback(
"View.MemoryView.__pyx_unpickle_Enum", __pyx_clineno, __pyx_lineno, __pyx_filename);
33520 __Pyx_XDECREF(__pyx_v___pyx_PickleError);
33521 __Pyx_XDECREF(__pyx_v___pyx_result);
33522 __Pyx_XGIVEREF(__pyx_r);
33523 __Pyx_RefNannyFinishContext();
33535 static PyObject *__pyx_unpickle_Enum__set_state(
struct __pyx_MemviewEnum_obj *__pyx_v___pyx_result, PyObject *__pyx_v___pyx_state) {
33536 PyObject *__pyx_r = NULL;
33537 __Pyx_RefNannyDeclarations
33538 PyObject *__pyx_t_1 = NULL;
33540 Py_ssize_t __pyx_t_3;
33543 PyObject *__pyx_t_6 = NULL;
33544 PyObject *__pyx_t_7 = NULL;
33545 PyObject *__pyx_t_8 = NULL;
33546 int __pyx_lineno = 0;
33547 const char *__pyx_filename = NULL;
33548 int __pyx_clineno = 0;
33549 __Pyx_RefNannySetupContext(
"__pyx_unpickle_Enum__set_state", 0);
33558 if (unlikely(__pyx_v___pyx_state == Py_None)) {
33559 PyErr_SetString(PyExc_TypeError,
"'NoneType' object is not subscriptable");
33560 __PYX_ERR(1, 12, __pyx_L1_error)
33562 __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 0,
long, 1, __Pyx_PyInt_From_long, 0, 0, 0);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 12, __pyx_L1_error)
33563 __Pyx_GOTREF(__pyx_t_1);
33564 __Pyx_GIVEREF(__pyx_t_1);
33565 __Pyx_GOTREF(__pyx_v___pyx_result->name);
33566 __Pyx_DECREF(__pyx_v___pyx_result->name);
33567 __pyx_v___pyx_result->name = __pyx_t_1;
33576 if (unlikely(__pyx_v___pyx_state == Py_None)) {
33577 PyErr_SetString(PyExc_TypeError,
"object of type 'NoneType' has no len()");
33578 __PYX_ERR(1, 13, __pyx_L1_error)
33580 __pyx_t_3 = PyTuple_GET_SIZE(__pyx_v___pyx_state);
if (unlikely(__pyx_t_3 == ((Py_ssize_t)-1))) __PYX_ERR(1, 13, __pyx_L1_error)
33581 __pyx_t_4 = ((__pyx_t_3 > 1) != 0);
33584 __pyx_t_2 = __pyx_t_4;
33585 goto __pyx_L4_bool_binop_done;
33587 __pyx_t_4 = __Pyx_HasAttr(((PyObject *)__pyx_v___pyx_result), __pyx_n_s_dict);
if (unlikely(__pyx_t_4 == ((
int)-1))) __PYX_ERR(1, 13, __pyx_L1_error)
33588 __pyx_t_5 = (__pyx_t_4 != 0);
33589 __pyx_t_2 = __pyx_t_5;
33590 __pyx_L4_bool_binop_done:;
33598 __pyx_t_6 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v___pyx_result), __pyx_n_s_dict);
if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 14, __pyx_L1_error)
33599 __Pyx_GOTREF(__pyx_t_6);
33600 __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_update);
if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 14, __pyx_L1_error)
33601 __Pyx_GOTREF(__pyx_t_7);
33602 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
33603 if (unlikely(__pyx_v___pyx_state == Py_None)) {
33604 PyErr_SetString(PyExc_TypeError,
"'NoneType' object is not subscriptable");
33605 __PYX_ERR(1, 14, __pyx_L1_error)
33607 __pyx_t_6 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 1,
long, 1, __Pyx_PyInt_From_long, 0, 0, 0);
if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 14, __pyx_L1_error)
33608 __Pyx_GOTREF(__pyx_t_6);
33610 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_7))) {
33611 __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_7);
33612 if (likely(__pyx_t_8)) {
33613 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_7);
33614 __Pyx_INCREF(__pyx_t_8);
33615 __Pyx_INCREF(
function);
33616 __Pyx_DECREF_SET(__pyx_t_7,
function);
33619 __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);
33620 __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
33621 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
33622 if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 14, __pyx_L1_error)
33623 __Pyx_GOTREF(__pyx_t_1);
33624 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
33625 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
33644 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
33647 __Pyx_XDECREF(__pyx_t_1);
33648 __Pyx_XDECREF(__pyx_t_6);
33649 __Pyx_XDECREF(__pyx_t_7);
33650 __Pyx_XDECREF(__pyx_t_8);
33651 __Pyx_AddTraceback(
"View.MemoryView.__pyx_unpickle_Enum__set_state", __pyx_clineno, __pyx_lineno, __pyx_filename);
33654 __Pyx_XGIVEREF(__pyx_r);
33655 __Pyx_RefNannyFinishContext();
33667 static PyObject *__pyx_format_from_typeinfo(__Pyx_TypeInfo *__pyx_v_type) {
33668 __Pyx_StructField *__pyx_v_field;
33669 struct __pyx_typeinfo_string __pyx_v_fmt;
33670 PyObject *__pyx_v_part = 0;
33671 PyObject *__pyx_v_result = 0;
33672 PyObject *__pyx_v_alignment = NULL;
33673 PyObject *__pyx_v_parts = NULL;
33674 PyObject *__pyx_v_extents = NULL;
33676 PyObject *__pyx_r = NULL;
33677 __Pyx_RefNannyDeclarations
33679 PyObject *__pyx_t_2 = NULL;
33680 __Pyx_StructField *__pyx_t_3;
33681 PyObject *__pyx_t_4 = NULL;
33682 PyObject *__pyx_t_5 = NULL;
33687 int __pyx_lineno = 0;
33688 const char *__pyx_filename = NULL;
33689 int __pyx_clineno = 0;
33690 __Pyx_RefNannySetupContext(
"format_from_typeinfo", 0);
33699 __pyx_t_1 = ((__pyx_v_type->typegroup ==
'S') != 0);
33709 #ifndef CYTHON_WITHOUT_ASSERTIONS
33710 if (unlikely(!Py_OptimizeFlag)) {
33711 if (unlikely(!((__pyx_v_type->fields != NULL) != 0))) {
33712 PyErr_SetNone(PyExc_AssertionError);
33713 __PYX_ERR(1, 1469, __pyx_L1_error)
33725 #ifndef CYTHON_WITHOUT_ASSERTIONS
33726 if (unlikely(!Py_OptimizeFlag)) {
33727 if (unlikely(!((__pyx_v_type->fields->type != NULL) != 0))) {
33728 PyErr_SetNone(PyExc_AssertionError);
33729 __PYX_ERR(1, 1470, __pyx_L1_error)
33741 __pyx_t_1 = ((__pyx_v_type->flags & __PYX_BUF_FLAGS_PACKED_STRUCT) != 0);
33751 __Pyx_INCREF(__pyx_kp_b__31);
33752 __pyx_v_alignment = __pyx_kp_b__31;
33772 __Pyx_INCREF(__pyx_kp_b__32);
33773 __pyx_v_alignment = __pyx_kp_b__32;
33784 __pyx_t_2 = PyList_New(1);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1477, __pyx_L1_error)
33785 __Pyx_GOTREF(__pyx_t_2);
33786 __Pyx_INCREF(__pyx_kp_b_T);
33787 __Pyx_GIVEREF(__pyx_kp_b_T);
33788 PyList_SET_ITEM(__pyx_t_2, 0, __pyx_kp_b_T);
33789 __pyx_v_parts = ((PyObject*)__pyx_t_2);
33799 __pyx_t_3 = __pyx_v_type->fields;
33800 __pyx_v_field = __pyx_t_3;
33810 __pyx_t_1 = (__pyx_v_field->type != 0);
33811 if (!__pyx_t_1)
break;
33820 __pyx_t_2 = __pyx_format_from_typeinfo(__pyx_v_field->type);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1481, __pyx_L1_error)
33821 __Pyx_GOTREF(__pyx_t_2);
33822 __Pyx_XDECREF_SET(__pyx_v_part, ((PyObject*)__pyx_t_2));
33832 __pyx_t_2 = PyNumber_Add(__pyx_v_part, __pyx_kp_b__33);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1482, __pyx_L1_error)
33833 __Pyx_GOTREF(__pyx_t_2);
33834 __pyx_t_4 = __Pyx_PyBytes_FromString(__pyx_v_field->name);
if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 1482, __pyx_L1_error)
33835 __Pyx_GOTREF(__pyx_t_4);
33836 __pyx_t_5 = PyNumber_Add(__pyx_t_2, __pyx_t_4);
if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 1482, __pyx_L1_error)
33837 __Pyx_GOTREF(__pyx_t_5);
33838 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
33839 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
33840 __pyx_t_4 = PyNumber_Add(__pyx_t_5, __pyx_kp_b__33);
if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 1482, __pyx_L1_error)
33841 __Pyx_GOTREF(__pyx_t_4);
33842 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
33843 __pyx_t_6 = __Pyx_PyList_Append(__pyx_v_parts, __pyx_t_4);
if (unlikely(__pyx_t_6 == ((
int)-1))) __PYX_ERR(1, 1482, __pyx_L1_error)
33844 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
33853 __pyx_v_field = (__pyx_v_field + 1);
33863 __pyx_t_4 = __Pyx_PyBytes_Join(__pyx_v_alignment, __pyx_v_parts);
if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 1485, __pyx_L1_error)
33864 __Pyx_GOTREF(__pyx_t_4);
33865 __pyx_t_5 = PyNumber_Add(__pyx_t_4, __pyx_kp_b__34);
if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 1485, __pyx_L1_error)
33866 __Pyx_GOTREF(__pyx_t_5);
33867 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
33868 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(1, 1485, __pyx_L1_error)
33869 __pyx_v_result = ((PyObject*)__pyx_t_5);
33890 __pyx_v_fmt = __Pyx_TypeInfoToFormat(__pyx_v_type);
33899 __pyx_t_1 = ((__pyx_v_type->arraysize[0]) != 0);
33909 __pyx_t_5 = PyList_New(0);
if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 1489, __pyx_L1_error)
33910 __Pyx_GOTREF(__pyx_t_5);
33911 __pyx_t_7 = __pyx_v_type->ndim;
33912 __pyx_t_8 = __pyx_t_7;
33913 for (__pyx_t_9 = 0; __pyx_t_9 < __pyx_t_8; __pyx_t_9+=1) {
33914 __pyx_v_i = __pyx_t_9;
33915 __pyx_t_4 = __Pyx_PyInt_FromSize_t((__pyx_v_type->arraysize[__pyx_v_i]));
if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 1489, __pyx_L1_error)
33916 __Pyx_GOTREF(__pyx_t_4);
33917 __pyx_t_2 = __Pyx_PyObject_Unicode(__pyx_t_4);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1489, __pyx_L1_error)
33918 __Pyx_GOTREF(__pyx_t_2);
33919 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
33920 if (unlikely(__Pyx_ListComp_Append(__pyx_t_5, (PyObject*)__pyx_t_2))) __PYX_ERR(1, 1489, __pyx_L1_error)
33921 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
33923 __pyx_v_extents = ((PyObject*)__pyx_t_5);
33933 __pyx_t_5 = PyUnicode_Join(__pyx_kp_u__35, __pyx_v_extents);
if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 1490, __pyx_L1_error)
33934 __Pyx_GOTREF(__pyx_t_5);
33935 __pyx_t_2 = PyUnicode_Format(__pyx_kp_u_s, __pyx_t_5);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1490, __pyx_L1_error)
33936 __Pyx_GOTREF(__pyx_t_2);
33937 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
33938 __pyx_t_5 = PyUnicode_AsASCIIString(((PyObject*)__pyx_t_2));
if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 1490, __pyx_L1_error)
33939 __Pyx_GOTREF(__pyx_t_5);
33940 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
33941 __pyx_t_2 = __Pyx_PyObject_FromString(__pyx_v_fmt.string);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1490, __pyx_L1_error)
33942 __Pyx_GOTREF(__pyx_t_2);
33943 __pyx_t_4 = PyNumber_Add(__pyx_t_5, __pyx_t_2);
if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 1490, __pyx_L1_error)
33944 __Pyx_GOTREF(__pyx_t_4);
33945 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
33946 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
33947 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(1, 1490, __pyx_L1_error)
33948 __pyx_v_result = ((PyObject*)__pyx_t_4);
33969 __pyx_t_4 = __Pyx_PyObject_FromString(__pyx_v_fmt.string);
if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 1492, __pyx_L1_error)
33970 __Pyx_GOTREF(__pyx_t_4);
33971 __pyx_v_result = ((PyObject*)__pyx_t_4);
33983 __Pyx_XDECREF(__pyx_r);
33984 __Pyx_INCREF(__pyx_v_result);
33985 __pyx_r = __pyx_v_result;
33998 __Pyx_XDECREF(__pyx_t_2);
33999 __Pyx_XDECREF(__pyx_t_4);
34000 __Pyx_XDECREF(__pyx_t_5);
34001 __Pyx_AddTraceback(
"BufferFormatFromTypeInfo.format_from_typeinfo", __pyx_clineno, __pyx_lineno, __pyx_filename);
34004 __Pyx_XDECREF(__pyx_v_part);
34005 __Pyx_XDECREF(__pyx_v_result);
34006 __Pyx_XDECREF(__pyx_v_alignment);
34007 __Pyx_XDECREF(__pyx_v_parts);
34008 __Pyx_XDECREF(__pyx_v_extents);
34009 __Pyx_XGIVEREF(__pyx_r);
34010 __Pyx_RefNannyFinishContext();
34013 static struct __pyx_vtabstruct_6mprans_16cMoveMeshMonitor_cCoefficients __pyx_vtable_6mprans_16cMoveMeshMonitor_cCoefficients;
34015 static PyObject *__pyx_tp_new_6mprans_16cMoveMeshMonitor_cCoefficients(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
34016 struct __pyx_obj_6mprans_16cMoveMeshMonitor_cCoefficients *p;
34018 if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) {
34019 o = (*t->tp_alloc)(t, 0);
34021 o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0);
34023 if (unlikely(!o))
return 0;
34024 p = ((
struct __pyx_obj_6mprans_16cMoveMeshMonitor_cCoefficients *)o);
34025 p->__pyx_vtab = __pyx_vtabptr_6mprans_16cMoveMeshMonitor_cCoefficients;
34026 p->pyCoefficients = Py_None; Py_INCREF(Py_None);
34027 if (unlikely(__pyx_pw_6mprans_16cMoveMeshMonitor_13cCoefficients_1__cinit__(o, __pyx_empty_tuple, NULL) < 0))
goto bad;
34030 Py_DECREF(o); o = 0;
34034 static void __pyx_tp_dealloc_6mprans_16cMoveMeshMonitor_cCoefficients(PyObject *o) {
34035 struct __pyx_obj_6mprans_16cMoveMeshMonitor_cCoefficients *p = (
struct __pyx_obj_6mprans_16cMoveMeshMonitor_cCoefficients *)o;
34036 #if CYTHON_USE_TP_FINALIZE
34037 if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) {
34038 if (PyObject_CallFinalizerFromDealloc(o))
return;
34041 PyObject_GC_UnTrack(o);
34042 Py_CLEAR(p->pyCoefficients);
34043 (*Py_TYPE(o)->tp_free)(o);
34046 static int __pyx_tp_traverse_6mprans_16cMoveMeshMonitor_cCoefficients(PyObject *o, visitproc
v,
void *a) {
34048 struct __pyx_obj_6mprans_16cMoveMeshMonitor_cCoefficients *p = (
struct __pyx_obj_6mprans_16cMoveMeshMonitor_cCoefficients *)o;
34049 if (p->pyCoefficients) {
34050 e = (*v)(p->pyCoefficients, a);
if (e)
return e;
34055 static int __pyx_tp_clear_6mprans_16cMoveMeshMonitor_cCoefficients(PyObject *o) {
34057 struct __pyx_obj_6mprans_16cMoveMeshMonitor_cCoefficients *p = (
struct __pyx_obj_6mprans_16cMoveMeshMonitor_cCoefficients *)o;
34058 tmp = ((PyObject*)p->pyCoefficients);
34059 p->pyCoefficients = Py_None; Py_INCREF(Py_None);
34064 static PyObject *__pyx_getprop_6mprans_16cMoveMeshMonitor_13cCoefficients_pyCoefficients(PyObject *o, CYTHON_UNUSED
void *x) {
34065 return __pyx_pw_6mprans_16cMoveMeshMonitor_13cCoefficients_14pyCoefficients_1__get__(o);
34068 static int __pyx_setprop_6mprans_16cMoveMeshMonitor_13cCoefficients_pyCoefficients(PyObject *o, PyObject *
v, CYTHON_UNUSED
void *x) {
34070 return __pyx_pw_6mprans_16cMoveMeshMonitor_13cCoefficients_14pyCoefficients_3__set__(o,
v);
34073 return __pyx_pw_6mprans_16cMoveMeshMonitor_13cCoefficients_14pyCoefficients_5__del__(o);
34077 static PyObject *__pyx_getprop_6mprans_16cMoveMeshMonitor_13cCoefficients_C(PyObject *o, CYTHON_UNUSED
void *x) {
34078 return __pyx_pw_6mprans_16cMoveMeshMonitor_13cCoefficients_1C_1__get__(o);
34081 static int __pyx_setprop_6mprans_16cMoveMeshMonitor_13cCoefficients_C(PyObject *o, PyObject *
v, CYTHON_UNUSED
void *x) {
34083 return __pyx_pw_6mprans_16cMoveMeshMonitor_13cCoefficients_1C_3__set__(o,
v);
34086 PyErr_SetString(PyExc_NotImplementedError,
"__del__");
34091 static PyMethodDef __pyx_methods_6mprans_16cMoveMeshMonitor_cCoefficients[] = {
34092 {
"attachPyCoefficients", (PyCFunction)__pyx_pw_6mprans_16cMoveMeshMonitor_13cCoefficients_3attachPyCoefficients, METH_O, 0},
34093 {
"preStep", (PyCFunction)__pyx_pw_6mprans_16cMoveMeshMonitor_13cCoefficients_5preStep, METH_NOARGS, 0},
34094 {
"postStep", (PyCFunction)__pyx_pw_6mprans_16cMoveMeshMonitor_13cCoefficients_7postStep, METH_NOARGS, 0},
34095 {
"pseudoTimeStepping", (PyCFunction)(
void*)(PyCFunctionWithKeywords)__pyx_pw_6mprans_16cMoveMeshMonitor_13cCoefficients_9pseudoTimeStepping, METH_VARARGS|METH_KEYWORDS, 0},
34096 {
"__reduce_cython__", (PyCFunction)__pyx_pw_6mprans_16cMoveMeshMonitor_13cCoefficients_11__reduce_cython__, METH_NOARGS, 0},
34097 {
"__setstate_cython__", (PyCFunction)__pyx_pw_6mprans_16cMoveMeshMonitor_13cCoefficients_13__setstate_cython__, METH_O, 0},
34101 static struct PyGetSetDef __pyx_getsets_6mprans_16cMoveMeshMonitor_cCoefficients[] = {
34102 {(
char *)
"pyCoefficients", __pyx_getprop_6mprans_16cMoveMeshMonitor_13cCoefficients_pyCoefficients, __pyx_setprop_6mprans_16cMoveMeshMonitor_13cCoefficients_pyCoefficients, (
char *)0, 0},
34103 {(
char *)
"C", __pyx_getprop_6mprans_16cMoveMeshMonitor_13cCoefficients_C, __pyx_setprop_6mprans_16cMoveMeshMonitor_13cCoefficients_C, (
char *)0, 0},
34107 static PyTypeObject __pyx_type_6mprans_16cMoveMeshMonitor_cCoefficients = {
34108 PyVarObject_HEAD_INIT(0, 0)
34109 "mprans.cMoveMeshMonitor.cCoefficients",
34110 sizeof(
struct __pyx_obj_6mprans_16cMoveMeshMonitor_cCoefficients),
34112 __pyx_tp_dealloc_6mprans_16cMoveMeshMonitor_cCoefficients,
34113 #
if PY_VERSION_HEX < 0x030800b4
34116 #
if PY_VERSION_HEX >= 0x030800b4
34121 #
if PY_MAJOR_VERSION < 3
34124 #
if PY_MAJOR_VERSION >= 3
34137 Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC,
34139 __pyx_tp_traverse_6mprans_16cMoveMeshMonitor_cCoefficients,
34140 __pyx_tp_clear_6mprans_16cMoveMeshMonitor_cCoefficients,
34145 __pyx_methods_6mprans_16cMoveMeshMonitor_cCoefficients,
34147 __pyx_getsets_6mprans_16cMoveMeshMonitor_cCoefficients,
34155 __pyx_tp_new_6mprans_16cMoveMeshMonitor_cCoefficients,
34165 #
if PY_VERSION_HEX >= 0x030400a1
34168 #
if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800)
34171 #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
34174 #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000
34179 static struct __pyx_obj_6mprans_16cMoveMeshMonitor___pyx_scope_struct__cppPseudoTimeSteppingParallel *__pyx_freelist_6mprans_16cMoveMeshMonitor___pyx_scope_struct__cppPseudoTimeSteppingParallel[8];
34180 static int __pyx_freecount_6mprans_16cMoveMeshMonitor___pyx_scope_struct__cppPseudoTimeSteppingParallel = 0;
34182 static PyObject *__pyx_tp_new_6mprans_16cMoveMeshMonitor___pyx_scope_struct__cppPseudoTimeSteppingParallel(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
34183 struct __pyx_obj_6mprans_16cMoveMeshMonitor___pyx_scope_struct__cppPseudoTimeSteppingParallel *p;
34185 if (CYTHON_COMPILING_IN_CPYTHON && likely((__pyx_freecount_6mprans_16cMoveMeshMonitor___pyx_scope_struct__cppPseudoTimeSteppingParallel > 0) & (t->tp_basicsize ==
sizeof(
struct __pyx_obj_6mprans_16cMoveMeshMonitor___pyx_scope_struct__cppPseudoTimeSteppingParallel)))) {
34186 o = (PyObject*)__pyx_freelist_6mprans_16cMoveMeshMonitor___pyx_scope_struct__cppPseudoTimeSteppingParallel[--__pyx_freecount_6mprans_16cMoveMeshMonitor___pyx_scope_struct__cppPseudoTimeSteppingParallel];
34187 memset(o, 0,
sizeof(
struct __pyx_obj_6mprans_16cMoveMeshMonitor___pyx_scope_struct__cppPseudoTimeSteppingParallel));
34188 (void) PyObject_INIT(o, t);
34190 o = (*t->tp_alloc)(t, 0);
34191 if (unlikely(!o))
return 0;
34193 p = ((
struct __pyx_obj_6mprans_16cMoveMeshMonitor___pyx_scope_struct__cppPseudoTimeSteppingParallel *)o);
34194 p->__pyx_v_coords_2doArray.data = NULL;
34195 p->__pyx_v_coords_2doArray.memview = NULL;
34196 p->__pyx_v_counts_in.data = NULL;
34197 p->__pyx_v_counts_in.memview = NULL;
34198 p->__pyx_v_displacements_in.data = NULL;
34199 p->__pyx_v_displacements_in.memview = NULL;
34203 static void __pyx_tp_dealloc_6mprans_16cMoveMeshMonitor___pyx_scope_struct__cppPseudoTimeSteppingParallel(PyObject *o) {
34204 struct __pyx_obj_6mprans_16cMoveMeshMonitor___pyx_scope_struct__cppPseudoTimeSteppingParallel *p = (
struct __pyx_obj_6mprans_16cMoveMeshMonitor___pyx_scope_struct__cppPseudoTimeSteppingParallel *)o;
34205 __PYX_XDEC_MEMVIEW(&p->__pyx_v_coords_2doArray, 1);
34206 __PYX_XDEC_MEMVIEW(&p->__pyx_v_counts_in, 1);
34207 __PYX_XDEC_MEMVIEW(&p->__pyx_v_displacements_in, 1);
34208 if (CYTHON_COMPILING_IN_CPYTHON && ((__pyx_freecount_6mprans_16cMoveMeshMonitor___pyx_scope_struct__cppPseudoTimeSteppingParallel < 8) & (Py_TYPE(o)->tp_basicsize ==
sizeof(
struct __pyx_obj_6mprans_16cMoveMeshMonitor___pyx_scope_struct__cppPseudoTimeSteppingParallel)))) {
34209 __pyx_freelist_6mprans_16cMoveMeshMonitor___pyx_scope_struct__cppPseudoTimeSteppingParallel[__pyx_freecount_6mprans_16cMoveMeshMonitor___pyx_scope_struct__cppPseudoTimeSteppingParallel++] = ((
struct __pyx_obj_6mprans_16cMoveMeshMonitor___pyx_scope_struct__cppPseudoTimeSteppingParallel *)o);
34211 (*Py_TYPE(o)->tp_free)(o);
34215 static PyTypeObject __pyx_type_6mprans_16cMoveMeshMonitor___pyx_scope_struct__cppPseudoTimeSteppingParallel = {
34216 PyVarObject_HEAD_INIT(0, 0)
34217 "mprans.cMoveMeshMonitor.__pyx_scope_struct__cppPseudoTimeSteppingParallel",
34218 sizeof(
struct __pyx_obj_6mprans_16cMoveMeshMonitor___pyx_scope_struct__cppPseudoTimeSteppingParallel),
34220 __pyx_tp_dealloc_6mprans_16cMoveMeshMonitor___pyx_scope_struct__cppPseudoTimeSteppingParallel,
34221 #
if PY_VERSION_HEX < 0x030800b4
34224 #
if PY_VERSION_HEX >= 0x030800b4
34229 #
if PY_MAJOR_VERSION < 3
34232 #
if PY_MAJOR_VERSION >= 3
34245 Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER,
34263 __pyx_tp_new_6mprans_16cMoveMeshMonitor___pyx_scope_struct__cppPseudoTimeSteppingParallel,
34273 #
if PY_VERSION_HEX >= 0x030400a1
34276 #
if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800)
34279 #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
34282 #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000
34287 static struct __pyx_obj_6mprans_16cMoveMeshMonitor___pyx_scope_struct_1_genexpr *__pyx_freelist_6mprans_16cMoveMeshMonitor___pyx_scope_struct_1_genexpr[8];
34288 static int __pyx_freecount_6mprans_16cMoveMeshMonitor___pyx_scope_struct_1_genexpr = 0;
34290 static PyObject *__pyx_tp_new_6mprans_16cMoveMeshMonitor___pyx_scope_struct_1_genexpr(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
34292 if (CYTHON_COMPILING_IN_CPYTHON && likely((__pyx_freecount_6mprans_16cMoveMeshMonitor___pyx_scope_struct_1_genexpr > 0) & (t->tp_basicsize ==
sizeof(
struct __pyx_obj_6mprans_16cMoveMeshMonitor___pyx_scope_struct_1_genexpr)))) {
34293 o = (PyObject*)__pyx_freelist_6mprans_16cMoveMeshMonitor___pyx_scope_struct_1_genexpr[--__pyx_freecount_6mprans_16cMoveMeshMonitor___pyx_scope_struct_1_genexpr];
34294 memset(o, 0,
sizeof(
struct __pyx_obj_6mprans_16cMoveMeshMonitor___pyx_scope_struct_1_genexpr));
34295 (void) PyObject_INIT(o, t);
34296 PyObject_GC_Track(o);
34298 o = (*t->tp_alloc)(t, 0);
34299 if (unlikely(!o))
return 0;
34304 static void __pyx_tp_dealloc_6mprans_16cMoveMeshMonitor___pyx_scope_struct_1_genexpr(PyObject *o) {
34305 struct __pyx_obj_6mprans_16cMoveMeshMonitor___pyx_scope_struct_1_genexpr *p = (
struct __pyx_obj_6mprans_16cMoveMeshMonitor___pyx_scope_struct_1_genexpr *)o;
34306 PyObject_GC_UnTrack(o);
34307 Py_CLEAR(p->__pyx_outer_scope);
34308 if (CYTHON_COMPILING_IN_CPYTHON && ((__pyx_freecount_6mprans_16cMoveMeshMonitor___pyx_scope_struct_1_genexpr < 8) & (Py_TYPE(o)->tp_basicsize ==
sizeof(
struct __pyx_obj_6mprans_16cMoveMeshMonitor___pyx_scope_struct_1_genexpr)))) {
34309 __pyx_freelist_6mprans_16cMoveMeshMonitor___pyx_scope_struct_1_genexpr[__pyx_freecount_6mprans_16cMoveMeshMonitor___pyx_scope_struct_1_genexpr++] = ((
struct __pyx_obj_6mprans_16cMoveMeshMonitor___pyx_scope_struct_1_genexpr *)o);
34311 (*Py_TYPE(o)->tp_free)(o);
34315 static int __pyx_tp_traverse_6mprans_16cMoveMeshMonitor___pyx_scope_struct_1_genexpr(PyObject *o, visitproc
v,
void *a) {
34317 struct __pyx_obj_6mprans_16cMoveMeshMonitor___pyx_scope_struct_1_genexpr *p = (
struct __pyx_obj_6mprans_16cMoveMeshMonitor___pyx_scope_struct_1_genexpr *)o;
34318 if (p->__pyx_outer_scope) {
34319 e = (*v)(((PyObject *)p->__pyx_outer_scope), a);
if (e)
return e;
34324 static PyTypeObject __pyx_type_6mprans_16cMoveMeshMonitor___pyx_scope_struct_1_genexpr = {
34325 PyVarObject_HEAD_INIT(0, 0)
34326 "mprans.cMoveMeshMonitor.__pyx_scope_struct_1_genexpr",
34327 sizeof(
struct __pyx_obj_6mprans_16cMoveMeshMonitor___pyx_scope_struct_1_genexpr),
34329 __pyx_tp_dealloc_6mprans_16cMoveMeshMonitor___pyx_scope_struct_1_genexpr,
34330 #
if PY_VERSION_HEX < 0x030800b4
34333 #
if PY_VERSION_HEX >= 0x030800b4
34338 #
if PY_MAJOR_VERSION < 3
34341 #
if PY_MAJOR_VERSION >= 3
34354 Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC,
34356 __pyx_tp_traverse_6mprans_16cMoveMeshMonitor___pyx_scope_struct_1_genexpr,
34372 __pyx_tp_new_6mprans_16cMoveMeshMonitor___pyx_scope_struct_1_genexpr,
34382 #
if PY_VERSION_HEX >= 0x030400a1
34385 #
if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800)
34388 #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
34391 #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000
34396 static struct __pyx_obj_6mprans_16cMoveMeshMonitor___pyx_scope_struct_2_genexpr *__pyx_freelist_6mprans_16cMoveMeshMonitor___pyx_scope_struct_2_genexpr[8];
34397 static int __pyx_freecount_6mprans_16cMoveMeshMonitor___pyx_scope_struct_2_genexpr = 0;
34399 static PyObject *__pyx_tp_new_6mprans_16cMoveMeshMonitor___pyx_scope_struct_2_genexpr(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
34401 if (CYTHON_COMPILING_IN_CPYTHON && likely((__pyx_freecount_6mprans_16cMoveMeshMonitor___pyx_scope_struct_2_genexpr > 0) & (t->tp_basicsize ==
sizeof(
struct __pyx_obj_6mprans_16cMoveMeshMonitor___pyx_scope_struct_2_genexpr)))) {
34402 o = (PyObject*)__pyx_freelist_6mprans_16cMoveMeshMonitor___pyx_scope_struct_2_genexpr[--__pyx_freecount_6mprans_16cMoveMeshMonitor___pyx_scope_struct_2_genexpr];
34403 memset(o, 0,
sizeof(
struct __pyx_obj_6mprans_16cMoveMeshMonitor___pyx_scope_struct_2_genexpr));
34404 (void) PyObject_INIT(o, t);
34405 PyObject_GC_Track(o);
34407 o = (*t->tp_alloc)(t, 0);
34408 if (unlikely(!o))
return 0;
34413 static void __pyx_tp_dealloc_6mprans_16cMoveMeshMonitor___pyx_scope_struct_2_genexpr(PyObject *o) {
34414 struct __pyx_obj_6mprans_16cMoveMeshMonitor___pyx_scope_struct_2_genexpr *p = (
struct __pyx_obj_6mprans_16cMoveMeshMonitor___pyx_scope_struct_2_genexpr *)o;
34415 PyObject_GC_UnTrack(o);
34416 Py_CLEAR(p->__pyx_outer_scope);
34417 if (CYTHON_COMPILING_IN_CPYTHON && ((__pyx_freecount_6mprans_16cMoveMeshMonitor___pyx_scope_struct_2_genexpr < 8) & (Py_TYPE(o)->tp_basicsize ==
sizeof(
struct __pyx_obj_6mprans_16cMoveMeshMonitor___pyx_scope_struct_2_genexpr)))) {
34418 __pyx_freelist_6mprans_16cMoveMeshMonitor___pyx_scope_struct_2_genexpr[__pyx_freecount_6mprans_16cMoveMeshMonitor___pyx_scope_struct_2_genexpr++] = ((
struct __pyx_obj_6mprans_16cMoveMeshMonitor___pyx_scope_struct_2_genexpr *)o);
34420 (*Py_TYPE(o)->tp_free)(o);
34424 static int __pyx_tp_traverse_6mprans_16cMoveMeshMonitor___pyx_scope_struct_2_genexpr(PyObject *o, visitproc
v,
void *a) {
34426 struct __pyx_obj_6mprans_16cMoveMeshMonitor___pyx_scope_struct_2_genexpr *p = (
struct __pyx_obj_6mprans_16cMoveMeshMonitor___pyx_scope_struct_2_genexpr *)o;
34427 if (p->__pyx_outer_scope) {
34428 e = (*v)(((PyObject *)p->__pyx_outer_scope), a);
if (e)
return e;
34433 static PyTypeObject __pyx_type_6mprans_16cMoveMeshMonitor___pyx_scope_struct_2_genexpr = {
34434 PyVarObject_HEAD_INIT(0, 0)
34435 "mprans.cMoveMeshMonitor.__pyx_scope_struct_2_genexpr",
34436 sizeof(
struct __pyx_obj_6mprans_16cMoveMeshMonitor___pyx_scope_struct_2_genexpr),
34438 __pyx_tp_dealloc_6mprans_16cMoveMeshMonitor___pyx_scope_struct_2_genexpr,
34439 #
if PY_VERSION_HEX < 0x030800b4
34442 #
if PY_VERSION_HEX >= 0x030800b4
34447 #
if PY_MAJOR_VERSION < 3
34450 #
if PY_MAJOR_VERSION >= 3
34463 Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC,
34465 __pyx_tp_traverse_6mprans_16cMoveMeshMonitor___pyx_scope_struct_2_genexpr,
34481 __pyx_tp_new_6mprans_16cMoveMeshMonitor___pyx_scope_struct_2_genexpr,
34491 #
if PY_VERSION_HEX >= 0x030400a1
34494 #
if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800)
34497 #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
34500 #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000
34505 static struct __pyx_obj_6mprans_16cMoveMeshMonitor___pyx_scope_struct_3_genexpr *__pyx_freelist_6mprans_16cMoveMeshMonitor___pyx_scope_struct_3_genexpr[8];
34506 static int __pyx_freecount_6mprans_16cMoveMeshMonitor___pyx_scope_struct_3_genexpr = 0;
34508 static PyObject *__pyx_tp_new_6mprans_16cMoveMeshMonitor___pyx_scope_struct_3_genexpr(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
34510 if (CYTHON_COMPILING_IN_CPYTHON && likely((__pyx_freecount_6mprans_16cMoveMeshMonitor___pyx_scope_struct_3_genexpr > 0) & (t->tp_basicsize ==
sizeof(
struct __pyx_obj_6mprans_16cMoveMeshMonitor___pyx_scope_struct_3_genexpr)))) {
34511 o = (PyObject*)__pyx_freelist_6mprans_16cMoveMeshMonitor___pyx_scope_struct_3_genexpr[--__pyx_freecount_6mprans_16cMoveMeshMonitor___pyx_scope_struct_3_genexpr];
34512 memset(o, 0,
sizeof(
struct __pyx_obj_6mprans_16cMoveMeshMonitor___pyx_scope_struct_3_genexpr));
34513 (void) PyObject_INIT(o, t);
34514 PyObject_GC_Track(o);
34516 o = (*t->tp_alloc)(t, 0);
34517 if (unlikely(!o))
return 0;
34522 static void __pyx_tp_dealloc_6mprans_16cMoveMeshMonitor___pyx_scope_struct_3_genexpr(PyObject *o) {
34523 struct __pyx_obj_6mprans_16cMoveMeshMonitor___pyx_scope_struct_3_genexpr *p = (
struct __pyx_obj_6mprans_16cMoveMeshMonitor___pyx_scope_struct_3_genexpr *)o;
34524 PyObject_GC_UnTrack(o);
34525 Py_CLEAR(p->__pyx_outer_scope);
34526 if (CYTHON_COMPILING_IN_CPYTHON && ((__pyx_freecount_6mprans_16cMoveMeshMonitor___pyx_scope_struct_3_genexpr < 8) & (Py_TYPE(o)->tp_basicsize ==
sizeof(
struct __pyx_obj_6mprans_16cMoveMeshMonitor___pyx_scope_struct_3_genexpr)))) {
34527 __pyx_freelist_6mprans_16cMoveMeshMonitor___pyx_scope_struct_3_genexpr[__pyx_freecount_6mprans_16cMoveMeshMonitor___pyx_scope_struct_3_genexpr++] = ((
struct __pyx_obj_6mprans_16cMoveMeshMonitor___pyx_scope_struct_3_genexpr *)o);
34529 (*Py_TYPE(o)->tp_free)(o);
34533 static int __pyx_tp_traverse_6mprans_16cMoveMeshMonitor___pyx_scope_struct_3_genexpr(PyObject *o, visitproc
v,
void *a) {
34535 struct __pyx_obj_6mprans_16cMoveMeshMonitor___pyx_scope_struct_3_genexpr *p = (
struct __pyx_obj_6mprans_16cMoveMeshMonitor___pyx_scope_struct_3_genexpr *)o;
34536 if (p->__pyx_outer_scope) {
34537 e = (*v)(((PyObject *)p->__pyx_outer_scope), a);
if (e)
return e;
34542 static PyTypeObject __pyx_type_6mprans_16cMoveMeshMonitor___pyx_scope_struct_3_genexpr = {
34543 PyVarObject_HEAD_INIT(0, 0)
34544 "mprans.cMoveMeshMonitor.__pyx_scope_struct_3_genexpr",
34545 sizeof(
struct __pyx_obj_6mprans_16cMoveMeshMonitor___pyx_scope_struct_3_genexpr),
34547 __pyx_tp_dealloc_6mprans_16cMoveMeshMonitor___pyx_scope_struct_3_genexpr,
34548 #
if PY_VERSION_HEX < 0x030800b4
34551 #
if PY_VERSION_HEX >= 0x030800b4
34556 #
if PY_MAJOR_VERSION < 3
34559 #
if PY_MAJOR_VERSION >= 3
34572 Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC,
34574 __pyx_tp_traverse_6mprans_16cMoveMeshMonitor___pyx_scope_struct_3_genexpr,
34590 __pyx_tp_new_6mprans_16cMoveMeshMonitor___pyx_scope_struct_3_genexpr,
34600 #
if PY_VERSION_HEX >= 0x030400a1
34603 #
if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800)
34606 #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
34609 #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000
34614 static struct __pyx_obj_6mprans_16cMoveMeshMonitor___pyx_scope_struct_4_genexpr *__pyx_freelist_6mprans_16cMoveMeshMonitor___pyx_scope_struct_4_genexpr[8];
34615 static int __pyx_freecount_6mprans_16cMoveMeshMonitor___pyx_scope_struct_4_genexpr = 0;
34617 static PyObject *__pyx_tp_new_6mprans_16cMoveMeshMonitor___pyx_scope_struct_4_genexpr(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
34619 if (CYTHON_COMPILING_IN_CPYTHON && likely((__pyx_freecount_6mprans_16cMoveMeshMonitor___pyx_scope_struct_4_genexpr > 0) & (t->tp_basicsize ==
sizeof(
struct __pyx_obj_6mprans_16cMoveMeshMonitor___pyx_scope_struct_4_genexpr)))) {
34620 o = (PyObject*)__pyx_freelist_6mprans_16cMoveMeshMonitor___pyx_scope_struct_4_genexpr[--__pyx_freecount_6mprans_16cMoveMeshMonitor___pyx_scope_struct_4_genexpr];
34621 memset(o, 0,
sizeof(
struct __pyx_obj_6mprans_16cMoveMeshMonitor___pyx_scope_struct_4_genexpr));
34622 (void) PyObject_INIT(o, t);
34623 PyObject_GC_Track(o);
34625 o = (*t->tp_alloc)(t, 0);
34626 if (unlikely(!o))
return 0;
34631 static void __pyx_tp_dealloc_6mprans_16cMoveMeshMonitor___pyx_scope_struct_4_genexpr(PyObject *o) {
34632 struct __pyx_obj_6mprans_16cMoveMeshMonitor___pyx_scope_struct_4_genexpr *p = (
struct __pyx_obj_6mprans_16cMoveMeshMonitor___pyx_scope_struct_4_genexpr *)o;
34633 PyObject_GC_UnTrack(o);
34634 Py_CLEAR(p->__pyx_outer_scope);
34635 if (CYTHON_COMPILING_IN_CPYTHON && ((__pyx_freecount_6mprans_16cMoveMeshMonitor___pyx_scope_struct_4_genexpr < 8) & (Py_TYPE(o)->tp_basicsize ==
sizeof(
struct __pyx_obj_6mprans_16cMoveMeshMonitor___pyx_scope_struct_4_genexpr)))) {
34636 __pyx_freelist_6mprans_16cMoveMeshMonitor___pyx_scope_struct_4_genexpr[__pyx_freecount_6mprans_16cMoveMeshMonitor___pyx_scope_struct_4_genexpr++] = ((
struct __pyx_obj_6mprans_16cMoveMeshMonitor___pyx_scope_struct_4_genexpr *)o);
34638 (*Py_TYPE(o)->tp_free)(o);
34642 static int __pyx_tp_traverse_6mprans_16cMoveMeshMonitor___pyx_scope_struct_4_genexpr(PyObject *o, visitproc
v,
void *a) {
34644 struct __pyx_obj_6mprans_16cMoveMeshMonitor___pyx_scope_struct_4_genexpr *p = (
struct __pyx_obj_6mprans_16cMoveMeshMonitor___pyx_scope_struct_4_genexpr *)o;
34645 if (p->__pyx_outer_scope) {
34646 e = (*v)(((PyObject *)p->__pyx_outer_scope), a);
if (e)
return e;
34651 static PyTypeObject __pyx_type_6mprans_16cMoveMeshMonitor___pyx_scope_struct_4_genexpr = {
34652 PyVarObject_HEAD_INIT(0, 0)
34653 "mprans.cMoveMeshMonitor.__pyx_scope_struct_4_genexpr",
34654 sizeof(
struct __pyx_obj_6mprans_16cMoveMeshMonitor___pyx_scope_struct_4_genexpr),
34656 __pyx_tp_dealloc_6mprans_16cMoveMeshMonitor___pyx_scope_struct_4_genexpr,
34657 #
if PY_VERSION_HEX < 0x030800b4
34660 #
if PY_VERSION_HEX >= 0x030800b4
34665 #
if PY_MAJOR_VERSION < 3
34668 #
if PY_MAJOR_VERSION >= 3
34681 Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC,
34683 __pyx_tp_traverse_6mprans_16cMoveMeshMonitor___pyx_scope_struct_4_genexpr,
34699 __pyx_tp_new_6mprans_16cMoveMeshMonitor___pyx_scope_struct_4_genexpr,
34709 #
if PY_VERSION_HEX >= 0x030400a1
34712 #
if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800)
34715 #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
34718 #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000
34722 static struct __pyx_vtabstruct_array __pyx_vtable_array;
34724 static PyObject *__pyx_tp_new_array(PyTypeObject *t, PyObject *a, PyObject *k) {
34725 struct __pyx_array_obj *p;
34727 if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) {
34728 o = (*t->tp_alloc)(t, 0);
34730 o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0);
34732 if (unlikely(!o))
return 0;
34733 p = ((
struct __pyx_array_obj *)o);
34734 p->__pyx_vtab = __pyx_vtabptr_array;
34735 p->mode = ((PyObject*)Py_None); Py_INCREF(Py_None);
34736 p->_format = ((PyObject*)Py_None); Py_INCREF(Py_None);
34737 if (unlikely(__pyx_array___cinit__(o, a, k) < 0))
goto bad;
34740 Py_DECREF(o); o = 0;
34744 static void __pyx_tp_dealloc_array(PyObject *o) {
34745 struct __pyx_array_obj *p = (
struct __pyx_array_obj *)o;
34746 #if CYTHON_USE_TP_FINALIZE
34747 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))) {
34748 if (PyObject_CallFinalizerFromDealloc(o))
return;
34752 PyObject *etype, *eval, *etb;
34753 PyErr_Fetch(&etype, &eval, &etb);
34754 __Pyx_SET_REFCNT(o, Py_REFCNT(o) + 1);
34755 __pyx_array___dealloc__(o);
34756 __Pyx_SET_REFCNT(o, Py_REFCNT(o) - 1);
34757 PyErr_Restore(etype, eval, etb);
34760 Py_CLEAR(p->_format);
34761 (*Py_TYPE(o)->tp_free)(o);
34763 static PyObject *__pyx_sq_item_array(PyObject *o, Py_ssize_t i) {
34765 PyObject *x = PyInt_FromSsize_t(i);
if(!x)
return 0;
34766 r = Py_TYPE(o)->tp_as_mapping->mp_subscript(o, x);
34771 static int __pyx_mp_ass_subscript_array(PyObject *o, PyObject *i, PyObject *
v) {
34773 return __pyx_array___setitem__(o, i,
v);
34776 PyErr_Format(PyExc_NotImplementedError,
34777 "Subscript deletion not supported by %.200s", Py_TYPE(o)->tp_name);
34782 static PyObject *__pyx_tp_getattro_array(PyObject *o, PyObject *
n) {
34783 PyObject *
v = __Pyx_PyObject_GenericGetAttr(o,
n);
34784 if (!
v && PyErr_ExceptionMatches(PyExc_AttributeError)) {
34786 v = __pyx_array___getattr__(o,
n);
34791 static PyObject *__pyx_getprop___pyx_array_memview(PyObject *o, CYTHON_UNUSED
void *x) {
34792 return __pyx_pw_15View_dot_MemoryView_5array_7memview_1__get__(o);
34795 static PyMethodDef __pyx_methods_array[] = {
34796 {
"__getattr__", (PyCFunction)__pyx_array___getattr__, METH_O|METH_COEXIST, 0},
34797 {
"__reduce_cython__", (PyCFunction)__pyx_pw___pyx_array_1__reduce_cython__, METH_NOARGS, 0},
34798 {
"__setstate_cython__", (PyCFunction)__pyx_pw___pyx_array_3__setstate_cython__, METH_O, 0},
34802 static struct PyGetSetDef __pyx_getsets_array[] = {
34803 {(
char *)
"memview", __pyx_getprop___pyx_array_memview, 0, (
char *)0, 0},
34807 static PySequenceMethods __pyx_tp_as_sequence_array = {
34808 __pyx_array___len__,
34811 __pyx_sq_item_array,
34820 static PyMappingMethods __pyx_tp_as_mapping_array = {
34821 __pyx_array___len__,
34822 __pyx_array___getitem__,
34823 __pyx_mp_ass_subscript_array,
34826 static PyBufferProcs __pyx_tp_as_buffer_array = {
34827 #if PY_MAJOR_VERSION < 3
34830 #if PY_MAJOR_VERSION < 3
34833 #if PY_MAJOR_VERSION < 3
34836 #if PY_MAJOR_VERSION < 3
34839 __pyx_array_getbuffer,
34843 static PyTypeObject __pyx_type___pyx_array = {
34844 PyVarObject_HEAD_INIT(0, 0)
34845 "mprans.cMoveMeshMonitor.array",
34846 sizeof(
struct __pyx_array_obj),
34848 __pyx_tp_dealloc_array,
34849 #
if PY_VERSION_HEX < 0x030800b4
34852 #
if PY_VERSION_HEX >= 0x030800b4
34857 #
if PY_MAJOR_VERSION < 3
34860 #
if PY_MAJOR_VERSION >= 3
34865 &__pyx_tp_as_sequence_array,
34866 &__pyx_tp_as_mapping_array,
34870 __pyx_tp_getattro_array,
34872 &__pyx_tp_as_buffer_array,
34873 Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE,
34881 __pyx_methods_array,
34883 __pyx_getsets_array,
34891 __pyx_tp_new_array,
34901 #
if PY_VERSION_HEX >= 0x030400a1
34904 #
if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800)
34907 #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
34910 #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000
34915 static PyObject *__pyx_tp_new_Enum(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
34916 struct __pyx_MemviewEnum_obj *p;
34918 if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) {
34919 o = (*t->tp_alloc)(t, 0);
34921 o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0);
34923 if (unlikely(!o))
return 0;
34924 p = ((
struct __pyx_MemviewEnum_obj *)o);
34925 p->name = Py_None; Py_INCREF(Py_None);
34929 static void __pyx_tp_dealloc_Enum(PyObject *o) {
34930 struct __pyx_MemviewEnum_obj *p = (
struct __pyx_MemviewEnum_obj *)o;
34931 #if CYTHON_USE_TP_FINALIZE
34932 if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) {
34933 if (PyObject_CallFinalizerFromDealloc(o))
return;
34936 PyObject_GC_UnTrack(o);
34938 (*Py_TYPE(o)->tp_free)(o);
34941 static int __pyx_tp_traverse_Enum(PyObject *o, visitproc
v,
void *a) {
34943 struct __pyx_MemviewEnum_obj *p = (
struct __pyx_MemviewEnum_obj *)o;
34945 e = (*v)(p->name, a);
if (e)
return e;
34950 static int __pyx_tp_clear_Enum(PyObject *o) {
34952 struct __pyx_MemviewEnum_obj *p = (
struct __pyx_MemviewEnum_obj *)o;
34953 tmp = ((PyObject*)p->name);
34954 p->name = Py_None; Py_INCREF(Py_None);
34959 static PyMethodDef __pyx_methods_Enum[] = {
34960 {
"__reduce_cython__", (PyCFunction)__pyx_pw___pyx_MemviewEnum_1__reduce_cython__, METH_NOARGS, 0},
34961 {
"__setstate_cython__", (PyCFunction)__pyx_pw___pyx_MemviewEnum_3__setstate_cython__, METH_O, 0},
34965 static PyTypeObject __pyx_type___pyx_MemviewEnum = {
34966 PyVarObject_HEAD_INIT(0, 0)
34967 "mprans.cMoveMeshMonitor.Enum",
34968 sizeof(
struct __pyx_MemviewEnum_obj),
34970 __pyx_tp_dealloc_Enum,
34971 #
if PY_VERSION_HEX < 0x030800b4
34974 #
if PY_VERSION_HEX >= 0x030800b4
34979 #
if PY_MAJOR_VERSION < 3
34982 #
if PY_MAJOR_VERSION >= 3
34985 __pyx_MemviewEnum___repr__,
34995 Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC,
34997 __pyx_tp_traverse_Enum,
34998 __pyx_tp_clear_Enum,
35003 __pyx_methods_Enum,
35011 __pyx_MemviewEnum___init__,
35023 #
if PY_VERSION_HEX >= 0x030400a1
35026 #
if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800)
35029 #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
35032 #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000
35036 static struct __pyx_vtabstruct_memoryview __pyx_vtable_memoryview;
35038 static PyObject *__pyx_tp_new_memoryview(PyTypeObject *t, PyObject *a, PyObject *k) {
35039 struct __pyx_memoryview_obj *p;
35041 if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) {
35042 o = (*t->tp_alloc)(t, 0);
35044 o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0);
35046 if (unlikely(!o))
return 0;
35047 p = ((
struct __pyx_memoryview_obj *)o);
35048 p->__pyx_vtab = __pyx_vtabptr_memoryview;
35049 p->obj = Py_None; Py_INCREF(Py_None);
35050 p->_size = Py_None; Py_INCREF(Py_None);
35051 p->_array_interface = Py_None; Py_INCREF(Py_None);
35052 p->view.obj = NULL;
35053 if (unlikely(__pyx_memoryview___cinit__(o, a, k) < 0))
goto bad;
35056 Py_DECREF(o); o = 0;
35060 static void __pyx_tp_dealloc_memoryview(PyObject *o) {
35061 struct __pyx_memoryview_obj *p = (
struct __pyx_memoryview_obj *)o;
35062 #if CYTHON_USE_TP_FINALIZE
35063 if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) {
35064 if (PyObject_CallFinalizerFromDealloc(o))
return;
35067 PyObject_GC_UnTrack(o);
35069 PyObject *etype, *eval, *etb;
35070 PyErr_Fetch(&etype, &eval, &etb);
35071 __Pyx_SET_REFCNT(o, Py_REFCNT(o) + 1);
35072 __pyx_memoryview___dealloc__(o);
35073 __Pyx_SET_REFCNT(o, Py_REFCNT(o) - 1);
35074 PyErr_Restore(etype, eval, etb);
35077 Py_CLEAR(p->_size);
35078 Py_CLEAR(p->_array_interface);
35079 (*Py_TYPE(o)->tp_free)(o);
35082 static int __pyx_tp_traverse_memoryview(PyObject *o, visitproc
v,
void *a) {
35084 struct __pyx_memoryview_obj *p = (
struct __pyx_memoryview_obj *)o;
35086 e = (*v)(p->obj, a);
if (e)
return e;
35089 e = (*v)(p->_size, a);
if (e)
return e;
35091 if (p->_array_interface) {
35092 e = (*v)(p->_array_interface, a);
if (e)
return e;
35095 e = (*v)(p->view.obj, a);
if (e)
return e;
35100 static int __pyx_tp_clear_memoryview(PyObject *o) {
35102 struct __pyx_memoryview_obj *p = (
struct __pyx_memoryview_obj *)o;
35103 tmp = ((PyObject*)p->obj);
35104 p->obj = Py_None; Py_INCREF(Py_None);
35106 tmp = ((PyObject*)p->_size);
35107 p->_size = Py_None; Py_INCREF(Py_None);
35109 tmp = ((PyObject*)p->_array_interface);
35110 p->_array_interface = Py_None; Py_INCREF(Py_None);
35112 Py_CLEAR(p->view.obj);
35115 static PyObject *__pyx_sq_item_memoryview(PyObject *o, Py_ssize_t i) {
35117 PyObject *x = PyInt_FromSsize_t(i);
if(!x)
return 0;
35118 r = Py_TYPE(o)->tp_as_mapping->mp_subscript(o, x);
35123 static int __pyx_mp_ass_subscript_memoryview(PyObject *o, PyObject *i, PyObject *
v) {
35125 return __pyx_memoryview___setitem__(o, i,
v);
35128 PyErr_Format(PyExc_NotImplementedError,
35129 "Subscript deletion not supported by %.200s", Py_TYPE(o)->tp_name);
35134 static PyObject *__pyx_getprop___pyx_memoryview_T(PyObject *o, CYTHON_UNUSED
void *x) {
35135 return __pyx_pw_15View_dot_MemoryView_10memoryview_1T_1__get__(o);
35138 static PyObject *__pyx_getprop___pyx_memoryview_base(PyObject *o, CYTHON_UNUSED
void *x) {
35139 return __pyx_pw_15View_dot_MemoryView_10memoryview_4base_1__get__(o);
35142 static PyObject *__pyx_getprop___pyx_memoryview_shape(PyObject *o, CYTHON_UNUSED
void *x) {
35143 return __pyx_pw_15View_dot_MemoryView_10memoryview_5shape_1__get__(o);
35146 static PyObject *__pyx_getprop___pyx_memoryview_strides(PyObject *o, CYTHON_UNUSED
void *x) {
35147 return __pyx_pw_15View_dot_MemoryView_10memoryview_7strides_1__get__(o);
35150 static PyObject *__pyx_getprop___pyx_memoryview_suboffsets(PyObject *o, CYTHON_UNUSED
void *x) {
35151 return __pyx_pw_15View_dot_MemoryView_10memoryview_10suboffsets_1__get__(o);
35154 static PyObject *__pyx_getprop___pyx_memoryview_ndim(PyObject *o, CYTHON_UNUSED
void *x) {
35155 return __pyx_pw_15View_dot_MemoryView_10memoryview_4ndim_1__get__(o);
35158 static PyObject *__pyx_getprop___pyx_memoryview_itemsize(PyObject *o, CYTHON_UNUSED
void *x) {
35159 return __pyx_pw_15View_dot_MemoryView_10memoryview_8itemsize_1__get__(o);
35162 static PyObject *__pyx_getprop___pyx_memoryview_nbytes(PyObject *o, CYTHON_UNUSED
void *x) {
35163 return __pyx_pw_15View_dot_MemoryView_10memoryview_6nbytes_1__get__(o);
35166 static PyObject *__pyx_getprop___pyx_memoryview_size(PyObject *o, CYTHON_UNUSED
void *x) {
35167 return __pyx_pw_15View_dot_MemoryView_10memoryview_4size_1__get__(o);
35170 static PyMethodDef __pyx_methods_memoryview[] = {
35171 {
"is_c_contig", (PyCFunction)__pyx_memoryview_is_c_contig, METH_NOARGS, 0},
35172 {
"is_f_contig", (PyCFunction)__pyx_memoryview_is_f_contig, METH_NOARGS, 0},
35173 {
"copy", (PyCFunction)__pyx_memoryview_copy, METH_NOARGS, 0},
35174 {
"copy_fortran", (PyCFunction)__pyx_memoryview_copy_fortran, METH_NOARGS, 0},
35175 {
"__reduce_cython__", (PyCFunction)__pyx_pw___pyx_memoryview_1__reduce_cython__, METH_NOARGS, 0},
35176 {
"__setstate_cython__", (PyCFunction)__pyx_pw___pyx_memoryview_3__setstate_cython__, METH_O, 0},
35180 static struct PyGetSetDef __pyx_getsets_memoryview[] = {
35181 {(
char *)
"T", __pyx_getprop___pyx_memoryview_T, 0, (
char *)0, 0},
35182 {(
char *)
"base", __pyx_getprop___pyx_memoryview_base, 0, (
char *)0, 0},
35183 {(
char *)
"shape", __pyx_getprop___pyx_memoryview_shape, 0, (
char *)0, 0},
35184 {(
char *)
"strides", __pyx_getprop___pyx_memoryview_strides, 0, (
char *)0, 0},
35185 {(
char *)
"suboffsets", __pyx_getprop___pyx_memoryview_suboffsets, 0, (
char *)0, 0},
35186 {(
char *)
"ndim", __pyx_getprop___pyx_memoryview_ndim, 0, (
char *)0, 0},
35187 {(
char *)
"itemsize", __pyx_getprop___pyx_memoryview_itemsize, 0, (
char *)0, 0},
35188 {(
char *)
"nbytes", __pyx_getprop___pyx_memoryview_nbytes, 0, (
char *)0, 0},
35189 {(
char *)
"size", __pyx_getprop___pyx_memoryview_size, 0, (
char *)0, 0},
35193 static PySequenceMethods __pyx_tp_as_sequence_memoryview = {
35194 __pyx_memoryview___len__,
35197 __pyx_sq_item_memoryview,
35206 static PyMappingMethods __pyx_tp_as_mapping_memoryview = {
35207 __pyx_memoryview___len__,
35208 __pyx_memoryview___getitem__,
35209 __pyx_mp_ass_subscript_memoryview,
35212 static PyBufferProcs __pyx_tp_as_buffer_memoryview = {
35213 #if PY_MAJOR_VERSION < 3
35216 #if PY_MAJOR_VERSION < 3
35219 #if PY_MAJOR_VERSION < 3
35222 #if PY_MAJOR_VERSION < 3
35225 __pyx_memoryview_getbuffer,
35229 static PyTypeObject __pyx_type___pyx_memoryview = {
35230 PyVarObject_HEAD_INIT(0, 0)
35231 "mprans.cMoveMeshMonitor.memoryview",
35232 sizeof(
struct __pyx_memoryview_obj),
35234 __pyx_tp_dealloc_memoryview,
35235 #
if PY_VERSION_HEX < 0x030800b4
35238 #
if PY_VERSION_HEX >= 0x030800b4
35243 #
if PY_MAJOR_VERSION < 3
35246 #
if PY_MAJOR_VERSION >= 3
35249 __pyx_memoryview___repr__,
35251 &__pyx_tp_as_sequence_memoryview,
35252 &__pyx_tp_as_mapping_memoryview,
35255 __pyx_memoryview___str__,
35258 &__pyx_tp_as_buffer_memoryview,
35259 Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC,
35261 __pyx_tp_traverse_memoryview,
35262 __pyx_tp_clear_memoryview,
35267 __pyx_methods_memoryview,
35269 __pyx_getsets_memoryview,
35277 __pyx_tp_new_memoryview,
35287 #
if PY_VERSION_HEX >= 0x030400a1
35290 #
if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800)
35293 #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
35296 #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000
35300 static struct __pyx_vtabstruct__memoryviewslice __pyx_vtable__memoryviewslice;
35302 static PyObject *__pyx_tp_new__memoryviewslice(PyTypeObject *t, PyObject *a, PyObject *k) {
35303 struct __pyx_memoryviewslice_obj *p;
35304 PyObject *o = __pyx_tp_new_memoryview(t, a, k);
35305 if (unlikely(!o))
return 0;
35306 p = ((
struct __pyx_memoryviewslice_obj *)o);
35307 p->__pyx_base.__pyx_vtab = (
struct __pyx_vtabstruct_memoryview*)__pyx_vtabptr__memoryviewslice;
35308 p->from_object = Py_None; Py_INCREF(Py_None);
35309 p->from_slice.memview = NULL;
35313 static void __pyx_tp_dealloc__memoryviewslice(PyObject *o) {
35314 struct __pyx_memoryviewslice_obj *p = (
struct __pyx_memoryviewslice_obj *)o;
35315 #if CYTHON_USE_TP_FINALIZE
35316 if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) {
35317 if (PyObject_CallFinalizerFromDealloc(o))
return;
35320 PyObject_GC_UnTrack(o);
35322 PyObject *etype, *eval, *etb;
35323 PyErr_Fetch(&etype, &eval, &etb);
35324 __Pyx_SET_REFCNT(o, Py_REFCNT(o) + 1);
35325 __pyx_memoryviewslice___dealloc__(o);
35326 __Pyx_SET_REFCNT(o, Py_REFCNT(o) - 1);
35327 PyErr_Restore(etype, eval, etb);
35329 Py_CLEAR(p->from_object);
35330 PyObject_GC_Track(o);
35331 __pyx_tp_dealloc_memoryview(o);
35334 static int __pyx_tp_traverse__memoryviewslice(PyObject *o, visitproc
v,
void *a) {
35336 struct __pyx_memoryviewslice_obj *p = (
struct __pyx_memoryviewslice_obj *)o;
35337 e = __pyx_tp_traverse_memoryview(o,
v, a);
if (e)
return e;
35338 if (p->from_object) {
35339 e = (*v)(p->from_object, a);
if (e)
return e;
35344 static int __pyx_tp_clear__memoryviewslice(PyObject *o) {
35346 struct __pyx_memoryviewslice_obj *p = (
struct __pyx_memoryviewslice_obj *)o;
35347 __pyx_tp_clear_memoryview(o);
35348 tmp = ((PyObject*)p->from_object);
35349 p->from_object = Py_None; Py_INCREF(Py_None);
35351 __PYX_XDEC_MEMVIEW(&p->from_slice, 1);
35355 static PyObject *__pyx_getprop___pyx_memoryviewslice_base(PyObject *o, CYTHON_UNUSED
void *x) {
35356 return __pyx_pw_15View_dot_MemoryView_16_memoryviewslice_4base_1__get__(o);
35359 static PyMethodDef __pyx_methods__memoryviewslice[] = {
35360 {
"__reduce_cython__", (PyCFunction)__pyx_pw___pyx_memoryviewslice_1__reduce_cython__, METH_NOARGS, 0},
35361 {
"__setstate_cython__", (PyCFunction)__pyx_pw___pyx_memoryviewslice_3__setstate_cython__, METH_O, 0},
35365 static struct PyGetSetDef __pyx_getsets__memoryviewslice[] = {
35366 {(
char *)
"base", __pyx_getprop___pyx_memoryviewslice_base, 0, (
char *)0, 0},
35370 static PyTypeObject __pyx_type___pyx_memoryviewslice = {
35371 PyVarObject_HEAD_INIT(0, 0)
35372 "mprans.cMoveMeshMonitor._memoryviewslice",
35373 sizeof(
struct __pyx_memoryviewslice_obj),
35375 __pyx_tp_dealloc__memoryviewslice,
35376 #
if PY_VERSION_HEX < 0x030800b4
35379 #
if PY_VERSION_HEX >= 0x030800b4
35384 #
if PY_MAJOR_VERSION < 3
35387 #
if PY_MAJOR_VERSION >= 3
35390 #
if CYTHON_COMPILING_IN_PYPY
35391 __pyx_memoryview___repr__,
35400 #
if CYTHON_COMPILING_IN_PYPY
35401 __pyx_memoryview___str__,
35408 Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC,
35409 "Internal class for passing memoryview slices to Python",
35410 __pyx_tp_traverse__memoryviewslice,
35411 __pyx_tp_clear__memoryviewslice,
35416 __pyx_methods__memoryviewslice,
35418 __pyx_getsets__memoryviewslice,
35426 __pyx_tp_new__memoryviewslice,
35436 #
if PY_VERSION_HEX >= 0x030400a1
35439 #
if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800)
35442 #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
35445 #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000
35450 static PyMethodDef __pyx_methods[] = {
35454 #if PY_MAJOR_VERSION >= 3
35455 #if CYTHON_PEP489_MULTI_PHASE_INIT
35456 static PyObject* __pyx_pymod_create(PyObject *spec, PyModuleDef *def);
35457 static int __pyx_pymod_exec_cMoveMeshMonitor(PyObject* module);
35458 static PyModuleDef_Slot __pyx_moduledef_slots[] = {
35459 {Py_mod_create, (
void*)__pyx_pymod_create},
35460 {Py_mod_exec, (
void*)__pyx_pymod_exec_cMoveMeshMonitor},
35465 static struct PyModuleDef __pyx_moduledef = {
35466 PyModuleDef_HEAD_INIT,
35467 "cMoveMeshMonitor",
35469 #if CYTHON_PEP489_MULTI_PHASE_INIT
35475 #if CYTHON_PEP489_MULTI_PHASE_INIT
35476 __pyx_moduledef_slots,
35485 #ifndef CYTHON_SMALL_CODE
35486 #if defined(__clang__)
35487 #define CYTHON_SMALL_CODE
35488 #elif defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 3))
35489 #define CYTHON_SMALL_CODE __attribute__((cold))
35491 #define CYTHON_SMALL_CODE
35495 static __Pyx_StringTabEntry __pyx_string_tab[] = {
35496 {&__pyx_n_s_ASCII, __pyx_k_ASCII,
sizeof(__pyx_k_ASCII), 0, 0, 1, 1},
35497 {&__pyx_n_s_Abort, __pyx_k_Abort,
sizeof(__pyx_k_Abort), 0, 0, 1, 1},
35498 {&__pyx_n_s_Allgatherv, __pyx_k_Allgatherv,
sizeof(__pyx_k_Allgatherv), 0, 0, 1, 1},
35499 {&__pyx_n_s_AssertionError, __pyx_k_AssertionError,
sizeof(__pyx_k_AssertionError), 0, 0, 1, 1},
35500 {&__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},
35501 {&__pyx_n_s_C, __pyx_k_C,
sizeof(__pyx_k_C), 0, 0, 1, 1},
35502 {&__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},
35503 {&__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},
35504 {&__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},
35505 {&__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},
35506 {&__pyx_n_s_Comm, __pyx_k_Comm,
sizeof(__pyx_k_Comm), 0, 0, 1, 1},
35507 {&__pyx_n_s_Commit, __pyx_k_Commit,
sizeof(__pyx_k_Commit), 0, 0, 1, 1},
35508 {&__pyx_n_s_Create_contiguous, __pyx_k_Create_contiguous,
sizeof(__pyx_k_Create_contiguous), 0, 0, 1, 1},
35509 {&__pyx_n_s_DOUBLE, __pyx_k_DOUBLE,
sizeof(__pyx_k_DOUBLE), 0, 0, 1, 1},
35510 {&__pyx_kp_s_Done_pseudo_timestepping, __pyx_k_Done_pseudo_timestepping,
sizeof(__pyx_k_Done_pseudo_timestepping), 0, 0, 1, 0},
35511 {&__pyx_kp_s_Done_smoothing, __pyx_k_Done_smoothing,
sizeof(__pyx_k_Done_smoothing), 0, 0, 1, 0},
35512 {&__pyx_n_s_Ellipsis, __pyx_k_Ellipsis,
sizeof(__pyx_k_Ellipsis), 0, 0, 1, 1},
35513 {&__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},
35514 {&__pyx_kp_s_Error, __pyx_k_Error,
sizeof(__pyx_k_Error), 0, 0, 1, 0},
35515 {&__pyx_n_s_Gatherv, __pyx_k_Gatherv,
sizeof(__pyx_k_Gatherv), 0, 0, 1, 1},
35516 {&__pyx_n_s_INT, __pyx_k_INT,
sizeof(__pyx_k_INT), 0, 0, 1, 1},
35517 {&__pyx_n_s_ImportError, __pyx_k_ImportError,
sizeof(__pyx_k_ImportError), 0, 0, 1, 1},
35518 {&__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},
35519 {&__pyx_n_s_IndexError, __pyx_k_IndexError,
sizeof(__pyx_k_IndexError), 0, 0, 1, 1},
35520 {&__pyx_kp_s_Indirect_dimensions_not_supporte, __pyx_k_Indirect_dimensions_not_supporte,
sizeof(__pyx_k_Indirect_dimensions_not_supporte), 0, 0, 1, 0},
35521 {&__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},
35522 {&__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},
35523 {&__pyx_n_s_MPI, __pyx_k_MPI,
sizeof(__pyx_k_MPI), 0, 0, 1, 1},
35524 {&__pyx_n_s_MemoryError, __pyx_k_MemoryError,
sizeof(__pyx_k_MemoryError), 0, 0, 1, 1},
35525 {&__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},
35526 {&__pyx_kp_s_MemoryView_of_r_object, __pyx_k_MemoryView_of_r_object,
sizeof(__pyx_k_MemoryView_of_r_object), 0, 0, 1, 0},
35527 {&__pyx_n_s_MeshSmoothing, __pyx_k_MeshSmoothing,
sizeof(__pyx_k_MeshSmoothing), 0, 0, 1, 1},
35528 {&__pyx_n_b_O, __pyx_k_O,
sizeof(__pyx_k_O), 0, 0, 0, 1},
35529 {&__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},
35530 {&__pyx_n_s_PickleError, __pyx_k_PickleError,
sizeof(__pyx_k_PickleError), 0, 0, 1, 1},
35531 {&__pyx_kp_s_Pseudo_time_stepping_t_t, __pyx_k_Pseudo_time_stepping_t_t,
sizeof(__pyx_k_Pseudo_time_stepping_t_t), 0, 0, 1, 0},
35532 {&__pyx_kp_s_Pseudo_time_stepping_with_dt_eps, __pyx_k_Pseudo_time_stepping_with_dt_eps,
sizeof(__pyx_k_Pseudo_time_stepping_with_dt_eps), 0, 0, 1, 0},
35533 {&__pyx_n_s_SUM, __pyx_k_SUM,
sizeof(__pyx_k_SUM), 0, 0, 1, 1},
35534 {&__pyx_kp_s_Smoothing_Mesh_with_Laplace_Smoo, __pyx_k_Smoothing_Mesh_with_Laplace_Smoo,
sizeof(__pyx_k_Smoothing_Mesh_with_Laplace_Smoo), 0, 0, 1, 0},
35535 {&__pyx_kp_b_T, __pyx_k_T,
sizeof(__pyx_k_T), 0, 0, 0, 0},
35536 {&__pyx_n_s_TypeError, __pyx_k_TypeError,
sizeof(__pyx_k_TypeError), 0, 0, 1, 1},
35537 {&__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},
35538 {&__pyx_n_s_ValueError, __pyx_k_ValueError,
sizeof(__pyx_k_ValueError), 0, 0, 1, 1},
35539 {&__pyx_n_s_View_MemoryView, __pyx_k_View_MemoryView,
sizeof(__pyx_k_View_MemoryView), 0, 0, 1, 1},
35540 {&__pyx_kp_b__31, __pyx_k__31,
sizeof(__pyx_k__31), 0, 0, 0, 0},
35541 {&__pyx_kp_b__32, __pyx_k__32,
sizeof(__pyx_k__32), 0, 0, 0, 0},
35542 {&__pyx_kp_b__33, __pyx_k__33,
sizeof(__pyx_k__33), 0, 0, 0, 0},
35543 {&__pyx_kp_b__34, __pyx_k__34,
sizeof(__pyx_k__34), 0, 0, 0, 0},
35544 {&__pyx_kp_u__35, __pyx_k__35,
sizeof(__pyx_k__35), 0, 1, 0, 0},
35545 {&__pyx_kp_s_abs_det_J, __pyx_k_abs_det_J,
sizeof(__pyx_k_abs_det_J), 0, 0, 1, 0},
35546 {&__pyx_n_s_allocate_buffer, __pyx_k_allocate_buffer,
sizeof(__pyx_k_allocate_buffer), 0, 0, 1, 1},
35547 {&__pyx_n_s_allreduce, __pyx_k_allreduce,
sizeof(__pyx_k_allreduce), 0, 0, 1, 1},
35548 {&__pyx_n_s_alpha, __pyx_k_alpha,
sizeof(__pyx_k_alpha), 0, 0, 1, 1},
35549 {&__pyx_n_s_append, __pyx_k_append,
sizeof(__pyx_k_append), 0, 0, 1, 1},
35550 {&__pyx_n_s_areas, __pyx_k_areas,
sizeof(__pyx_k_areas), 0, 0, 1, 1},
35551 {&__pyx_n_s_areas_nodes, __pyx_k_areas_nodes,
sizeof(__pyx_k_areas_nodes), 0, 0, 1, 1},
35552 {&__pyx_n_s_args, __pyx_k_args,
sizeof(__pyx_k_args), 0, 0, 1, 1},
35553 {&__pyx_n_s_array, __pyx_k_array,
sizeof(__pyx_k_array), 0, 0, 1, 1},
35554 {&__pyx_n_s_axis, __pyx_k_axis,
sizeof(__pyx_k_axis), 0, 0, 1, 1},
35555 {&__pyx_kp_s_b_i_and_nearestN_cannot_be_both, __pyx_k_b_i_and_nearestN_cannot_be_both,
sizeof(__pyx_k_b_i_and_nearestN_cannot_be_both), 0, 0, 1, 0},
35556 {&__pyx_n_s_barrier, __pyx_k_barrier,
sizeof(__pyx_k_barrier), 0, 0, 1, 1},
35557 {&__pyx_n_s_base, __pyx_k_base,
sizeof(__pyx_k_base), 0, 0, 1, 1},
35558 {&__pyx_n_s_c, __pyx_k_c,
sizeof(__pyx_k_c), 0, 0, 1, 1},
35559 {&__pyx_n_u_c, __pyx_k_c,
sizeof(__pyx_k_c), 0, 1, 0, 1},
35560 {&__pyx_n_s_cCoefficients, __pyx_k_cCoefficients,
sizeof(__pyx_k_cCoefficients), 0, 0, 1, 1},
35561 {&__pyx_n_s_cCoefficients_cppPseudoTimeStepp, __pyx_k_cCoefficients_cppPseudoTimeStepp,
sizeof(__pyx_k_cCoefficients_cppPseudoTimeStepp), 0, 0, 1, 1},
35562 {&__pyx_n_s_class, __pyx_k_class,
sizeof(__pyx_k_class), 0, 0, 1, 1},
35563 {&__pyx_n_s_cline_in_traceback, __pyx_k_cline_in_traceback,
sizeof(__pyx_k_cline_in_traceback), 0, 0, 1, 1},
35564 {&__pyx_n_s_close, __pyx_k_close,
sizeof(__pyx_k_close), 0, 0, 1, 1},
35565 {&__pyx_n_s_comm, __pyx_k_comm,
sizeof(__pyx_k_comm), 0, 0, 1, 1},
35566 {&__pyx_kp_s_contiguous_and_direct, __pyx_k_contiguous_and_direct,
sizeof(__pyx_k_contiguous_and_direct), 0, 0, 1, 0},
35567 {&__pyx_kp_s_contiguous_and_indirect, __pyx_k_contiguous_and_indirect,
sizeof(__pyx_k_contiguous_and_indirect), 0, 0, 1, 0},
35568 {&__pyx_n_s_detJ_array, __pyx_k_detJ_array,
sizeof(__pyx_k_detJ_array), 0, 0, 1, 1},
35569 {&__pyx_n_s_dict, __pyx_k_dict,
sizeof(__pyx_k_dict), 0, 0, 1, 1},
35570 {&__pyx_kp_s_did_not_find_containing_element, __pyx_k_did_not_find_containing_element,
sizeof(__pyx_k_did_not_find_containing_element), 0, 0, 1, 0},
35571 {&__pyx_kp_s_did_not_find_containing_element_2, __pyx_k_did_not_find_containing_element_2,
sizeof(__pyx_k_did_not_find_containing_element_2), 0, 0, 1, 0},
35572 {&__pyx_kp_s_dot, __pyx_k_dot,
sizeof(__pyx_k_dot), 0, 0, 1, 0},
35573 {&__pyx_n_s_dtype, __pyx_k_dtype,
sizeof(__pyx_k_dtype), 0, 0, 1, 1},
35574 {&__pyx_n_s_dtype_is_object, __pyx_k_dtype_is_object,
sizeof(__pyx_k_dtype_is_object), 0, 0, 1, 1},
35575 {&__pyx_n_s_elementBarycentersArray, __pyx_k_elementBarycentersArray,
sizeof(__pyx_k_elementBarycentersArray), 0, 0, 1, 1},
35576 {&__pyx_n_s_elementBoundariesArray, __pyx_k_elementBoundariesArray,
sizeof(__pyx_k_elementBoundariesArray), 0, 0, 1, 1},
35577 {&__pyx_n_s_elementBoundaryBarycentersArray, __pyx_k_elementBoundaryBarycentersArray,
sizeof(__pyx_k_elementBoundaryBarycentersArray), 0, 0, 1, 1},
35578 {&__pyx_n_s_elementBoundaryElementsArray, __pyx_k_elementBoundaryElementsArray,
sizeof(__pyx_k_elementBoundaryElementsArray), 0, 0, 1, 1},
35579 {&__pyx_n_s_elementBoundaryNodesArray, __pyx_k_elementBoundaryNodesArray,
sizeof(__pyx_k_elementBoundaryNodesArray), 0, 0, 1, 1},
35580 {&__pyx_n_s_elementBoundaryNormalsArray, __pyx_k_elementBoundaryNormalsArray,
sizeof(__pyx_k_elementBoundaryNormalsArray), 0, 0, 1, 1},
35581 {&__pyx_n_s_elementBoundaryNumbering_subdoma, __pyx_k_elementBoundaryNumbering_subdoma,
sizeof(__pyx_k_elementBoundaryNumbering_subdoma), 0, 0, 1, 1},
35582 {&__pyx_n_s_elementBoundaryOffsets_subdomain, __pyx_k_elementBoundaryOffsets_subdomain,
sizeof(__pyx_k_elementBoundaryOffsets_subdomain), 0, 0, 1, 1},
35583 {&__pyx_n_s_elementMaps, __pyx_k_elementMaps,
sizeof(__pyx_k_elementMaps), 0, 0, 1, 1},
35584 {&__pyx_n_s_elementNeighborsArray, __pyx_k_elementNeighborsArray,
sizeof(__pyx_k_elementNeighborsArray), 0, 0, 1, 1},
35585 {&__pyx_n_s_elementNodesArray, __pyx_k_elementNodesArray,
sizeof(__pyx_k_elementNodesArray), 0, 0, 1, 1},
35586 {&__pyx_n_s_elementNumbering_subdomain2globa, __pyx_k_elementNumbering_subdomain2globa,
sizeof(__pyx_k_elementNumbering_subdomain2globa), 0, 0, 1, 1},
35587 {&__pyx_n_s_elementOffsets_subdomain_owned, __pyx_k_elementOffsets_subdomain_owned,
sizeof(__pyx_k_elementOffsets_subdomain_owned), 0, 0, 1, 1},
35588 {&__pyx_n_s_elementQuadratureWeights, __pyx_k_elementQuadratureWeights,
sizeof(__pyx_k_elementQuadratureWeights), 0, 0, 1, 1},
35589 {&__pyx_kp_s_element_barycenter, __pyx_k_element_barycenter,
sizeof(__pyx_k_element_barycenter), 0, 0, 1, 0},
35590 {&__pyx_kp_s_element_node, __pyx_k_element_node,
sizeof(__pyx_k_element_node), 0, 0, 1, 0},
35591 {&__pyx_n_s_encode, __pyx_k_encode,
sizeof(__pyx_k_encode), 0, 0, 1, 1},
35592 {&__pyx_n_s_end, __pyx_k_end,
sizeof(__pyx_k_end), 0, 0, 1, 1},
35593 {&__pyx_n_s_enumerate, __pyx_k_enumerate,
sizeof(__pyx_k_enumerate), 0, 0, 1, 1},
35594 {&__pyx_n_s_eps, __pyx_k_eps,
sizeof(__pyx_k_eps), 0, 0, 1, 1},
35595 {&__pyx_n_s_error, __pyx_k_error,
sizeof(__pyx_k_error), 0, 0, 1, 1},
35596 {&__pyx_n_s_evaluateFunAtX, __pyx_k_evaluateFunAtX,
sizeof(__pyx_k_evaluateFunAtX), 0, 0, 1, 1},
35597 {&__pyx_n_s_exteriorElementBoundariesArray, __pyx_k_exteriorElementBoundariesArray,
sizeof(__pyx_k_exteriorElementBoundariesArray), 0, 0, 1, 1},
35598 {&__pyx_n_s_f, __pyx_k_f,
sizeof(__pyx_k_f), 0, 0, 1, 1},
35599 {&__pyx_n_s_femSpace, __pyx_k_femSpace,
sizeof(__pyx_k_femSpace), 0, 0, 1, 1},
35600 {&__pyx_n_s_file, __pyx_k_file,
sizeof(__pyx_k_file), 0, 0, 1, 1},
35601 {&__pyx_n_s_fixedNodesBoolArray, __pyx_k_fixedNodesBoolArray,
sizeof(__pyx_k_fixedNodesBoolArray), 0, 0, 1, 1},
35602 {&__pyx_kp_s_fixed_dir, __pyx_k_fixed_dir,
sizeof(__pyx_k_fixed_dir), 0, 0, 1, 0},
35603 {&__pyx_n_s_flags, __pyx_k_flags,
sizeof(__pyx_k_flags), 0, 0, 1, 1},
35604 {&__pyx_n_s_format, __pyx_k_format,
sizeof(__pyx_k_format), 0, 0, 1, 1},
35605 {&__pyx_n_s_fortran, __pyx_k_fortran,
sizeof(__pyx_k_fortran), 0, 0, 1, 1},
35606 {&__pyx_n_u_fortran, __pyx_k_fortran,
sizeof(__pyx_k_fortran), 0, 1, 0, 1},
35607 {&__pyx_n_s_genexpr, __pyx_k_genexpr,
sizeof(__pyx_k_genexpr), 0, 0, 1, 1},
35608 {&__pyx_n_s_get, __pyx_k_get,
sizeof(__pyx_k_get), 0, 0, 1, 1},
35609 {&__pyx_n_s_getAreaValue, __pyx_k_getAreaValue,
sizeof(__pyx_k_getAreaValue), 0, 0, 1, 1},
35610 {&__pyx_n_s_getGradientValue, __pyx_k_getGradientValue,
sizeof(__pyx_k_getGradientValue), 0, 0, 1, 1},
35611 {&__pyx_n_s_getInverseValue, __pyx_k_getInverseValue,
sizeof(__pyx_k_getInverseValue), 0, 0, 1, 1},
35612 {&__pyx_n_s_getLevelSetValue, __pyx_k_getLevelSetValue,
sizeof(__pyx_k_getLevelSetValue), 0, 0, 1, 1},
35613 {&__pyx_n_s_getNonOwnedNodeValues, __pyx_k_getNonOwnedNodeValues,
sizeof(__pyx_k_getNonOwnedNodeValues), 0, 0, 1, 1},
35614 {&__pyx_n_s_getstate, __pyx_k_getstate,
sizeof(__pyx_k_getstate), 0, 0, 1, 1},
35615 {&__pyx_n_s_globalMesh, __pyx_k_globalMesh,
sizeof(__pyx_k_globalMesh), 0, 0, 1, 1},
35616 {&__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},
35617 {&__pyx_n_s_gradientRecoveryAtNodes, __pyx_k_gradientRecoveryAtNodes,
sizeof(__pyx_k_gradientRecoveryAtNodes), 0, 0, 1, 1},
35618 {&__pyx_n_s_gradientRecoveryAtNodesWeighted, __pyx_k_gradientRecoveryAtNodesWeighted,
sizeof(__pyx_k_gradientRecoveryAtNodesWeighted), 0, 0, 1, 1},
35619 {&__pyx_n_s_grads, __pyx_k_grads,
sizeof(__pyx_k_grads), 0, 0, 1, 1},
35620 {&__pyx_n_s_id, __pyx_k_id,
sizeof(__pyx_k_id), 0, 0, 1, 1},
35621 {&__pyx_n_s_import, __pyx_k_import,
sizeof(__pyx_k_import), 0, 0, 1, 1},
35622 {&__pyx_n_s_int32, __pyx_k_int32,
sizeof(__pyx_k_int32), 0, 0, 1, 1},
35623 {&__pyx_n_s_itemsize, __pyx_k_itemsize,
sizeof(__pyx_k_itemsize), 0, 0, 1, 1},
35624 {&__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},
35625 {&__pyx_n_s_join, __pyx_k_join,
sizeof(__pyx_k_join), 0, 0, 1, 1},
35626 {&__pyx_n_s_level, __pyx_k_level,
sizeof(__pyx_k_level), 0, 0, 1, 1},
35627 {&__pyx_n_s_linspace, __pyx_k_linspace,
sizeof(__pyx_k_linspace), 0, 0, 1, 1},
35628 {&__pyx_n_s_logEvent, __pyx_k_logEvent,
sizeof(__pyx_k_logEvent), 0, 0, 1, 1},
35629 {&__pyx_n_s_ls_phi, __pyx_k_ls_phi,
sizeof(__pyx_k_ls_phi), 0, 0, 1, 1},
35630 {&__pyx_n_s_main, __pyx_k_main,
sizeof(__pyx_k_main), 0, 0, 1, 1},
35631 {&__pyx_n_s_memview, __pyx_k_memview,
sizeof(__pyx_k_memview), 0, 0, 1, 1},
35632 {&__pyx_n_s_mesh, __pyx_k_mesh,
sizeof(__pyx_k_mesh), 0, 0, 1, 1},
35633 {&__pyx_n_s_mode, __pyx_k_mode,
sizeof(__pyx_k_mode), 0, 0, 1, 1},
35634 {&__pyx_n_s_model, __pyx_k_model,
sizeof(__pyx_k_model), 0, 0, 1, 1},
35635 {&__pyx_n_s_mpi4py, __pyx_k_mpi4py,
sizeof(__pyx_k_mpi4py), 0, 0, 1, 1},
35636 {&__pyx_n_s_mprans_cMoveMeshMonitor, __pyx_k_mprans_cMoveMeshMonitor,
sizeof(__pyx_k_mprans_cMoveMeshMonitor), 0, 0, 1, 1},
35637 {&__pyx_n_s_ms, __pyx_k_ms,
sizeof(__pyx_k_ms), 0, 0, 1, 1},
35638 {&__pyx_n_s_nElementBoundaries_global, __pyx_k_nElementBoundaries_global,
sizeof(__pyx_k_nElementBoundaries_global), 0, 0, 1, 1},
35639 {&__pyx_n_s_nElementBoundaries_owned, __pyx_k_nElementBoundaries_owned,
sizeof(__pyx_k_nElementBoundaries_owned), 0, 0, 1, 1},
35640 {&__pyx_n_s_nElements_global, __pyx_k_nElements_global,
sizeof(__pyx_k_nElements_global), 0, 0, 1, 1},
35641 {&__pyx_n_s_nElements_owned, __pyx_k_nElements_owned,
sizeof(__pyx_k_nElements_owned), 0, 0, 1, 1},
35642 {&__pyx_n_s_nNodes, __pyx_k_nNodes,
sizeof(__pyx_k_nNodes), 0, 0, 1, 1},
35643 {&__pyx_n_s_nNodes_element, __pyx_k_nNodes_element,
sizeof(__pyx_k_nNodes_element), 0, 0, 1, 1},
35644 {&__pyx_n_s_nNodes_elementBoundary, __pyx_k_nNodes_elementBoundary,
sizeof(__pyx_k_nNodes_elementBoundary), 0, 0, 1, 1},
35645 {&__pyx_n_s_nNodes_global, __pyx_k_nNodes_global,
sizeof(__pyx_k_nNodes_global), 0, 0, 1, 1},
35646 {&__pyx_n_s_nNodes_owned, __pyx_k_nNodes_owned,
sizeof(__pyx_k_nNodes_owned), 0, 0, 1, 1},
35647 {&__pyx_n_s_nSmoothIn, __pyx_k_nSmoothIn,
sizeof(__pyx_k_nSmoothIn), 0, 0, 1, 1},
35648 {&__pyx_n_s_nSmoothOut, __pyx_k_nSmoothOut,
sizeof(__pyx_k_nSmoothOut), 0, 0, 1, 1},
35649 {&__pyx_n_s_nVariables_owned, __pyx_k_nVariables_owned,
sizeof(__pyx_k_nVariables_owned), 0, 0, 1, 1},
35650 {&__pyx_n_s_name, __pyx_k_name,
sizeof(__pyx_k_name), 0, 0, 1, 1},
35651 {&__pyx_n_s_name_2, __pyx_k_name_2,
sizeof(__pyx_k_name_2), 0, 0, 1, 1},
35652 {&__pyx_n_s_nd, __pyx_k_nd,
sizeof(__pyx_k_nd), 0, 0, 1, 1},
35653 {&__pyx_n_s_ndim, __pyx_k_ndim,
sizeof(__pyx_k_ndim), 0, 0, 1, 1},
35654 {&__pyx_kp_s_nearestN_element, __pyx_k_nearestN_element,
sizeof(__pyx_k_nearestN_element), 0, 0, 1, 0},
35655 {&__pyx_n_s_new, __pyx_k_new,
sizeof(__pyx_k_new), 0, 0, 1, 1},
35656 {&__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},
35657 {&__pyx_n_s_nodeArray, __pyx_k_nodeArray,
sizeof(__pyx_k_nodeArray), 0, 0, 1, 1},
35658 {&__pyx_n_s_nodeArray_2, __pyx_k_nodeArray_2,
sizeof(__pyx_k_nodeArray_2), 0, 0, 1, 1},
35659 {&__pyx_n_s_nodeElementOffsets, __pyx_k_nodeElementOffsets,
sizeof(__pyx_k_nodeElementOffsets), 0, 0, 1, 1},
35660 {&__pyx_n_s_nodeElementsArray, __pyx_k_nodeElementsArray,
sizeof(__pyx_k_nodeElementsArray), 0, 0, 1, 1},
35661 {&__pyx_n_s_nodeMaterialTypes, __pyx_k_nodeMaterialTypes,
sizeof(__pyx_k_nodeMaterialTypes), 0, 0, 1, 1},
35662 {&__pyx_n_s_nodeNumbering_subdomain2global, __pyx_k_nodeNumbering_subdomain2global,
sizeof(__pyx_k_nodeNumbering_subdomain2global), 0, 0, 1, 1},
35663 {&__pyx_n_s_nodeOffsets_subdomain_owned, __pyx_k_nodeOffsets_subdomain_owned,
sizeof(__pyx_k_nodeOffsets_subdomain_owned), 0, 0, 1, 1},
35664 {&__pyx_n_s_nodeStarArray, __pyx_k_nodeStarArray,
sizeof(__pyx_k_nodeStarArray), 0, 0, 1, 1},
35665 {&__pyx_n_s_nodeStarOffsets, __pyx_k_nodeStarOffsets,
sizeof(__pyx_k_nodeStarOffsets), 0, 0, 1, 1},
35666 {&__pyx_kp_s_node_materialType, __pyx_k_node_materialType,
sizeof(__pyx_k_node_materialType), 0, 0, 1, 0},
35667 {&__pyx_kp_s_node_new_coordinates, __pyx_k_node_new_coordinates,
sizeof(__pyx_k_node_new_coordinates), 0, 0, 1, 0},
35668 {&__pyx_kp_s_node_number, __pyx_k_node_number,
sizeof(__pyx_k_node_number), 0, 0, 1, 0},
35669 {&__pyx_kp_s_node_old_coordinates, __pyx_k_node_old_coordinates,
sizeof(__pyx_k_node_old_coordinates), 0, 0, 1, 0},
35670 {&__pyx_n_s_np, __pyx_k_np,
sizeof(__pyx_k_np), 0, 0, 1, 1},
35671 {&__pyx_n_s_ntimes_i, __pyx_k_ntimes_i,
sizeof(__pyx_k_ntimes_i), 0, 0, 1, 1},
35672 {&__pyx_n_s_ntimes_solved, __pyx_k_ntimes_solved,
sizeof(__pyx_k_ntimes_solved), 0, 0, 1, 1},
35673 {&__pyx_n_s_numpy, __pyx_k_numpy,
sizeof(__pyx_k_numpy), 0, 0, 1, 1},
35674 {&__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},
35675 {&__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},
35676 {&__pyx_n_s_obj, __pyx_k_obj,
sizeof(__pyx_k_obj), 0, 0, 1, 1},
35677 {&__pyx_n_s_ones, __pyx_k_ones,
sizeof(__pyx_k_ones), 0, 0, 1, 1},
35678 {&__pyx_n_s_op, __pyx_k_op,
sizeof(__pyx_k_op), 0, 0, 1, 1},
35679 {&__pyx_n_s_pack, __pyx_k_pack,
sizeof(__pyx_k_pack), 0, 0, 1, 1},
35680 {&__pyx_n_s_pickle, __pyx_k_pickle,
sizeof(__pyx_k_pickle), 0, 0, 1, 1},
35681 {&__pyx_n_s_print, __pyx_k_print,
sizeof(__pyx_k_print), 0, 0, 1, 1},
35682 {&__pyx_n_s_proteus, __pyx_k_proteus,
sizeof(__pyx_k_proteus), 0, 0, 1, 1},
35683 {&__pyx_n_s_proteus_Profiling, __pyx_k_proteus_Profiling,
sizeof(__pyx_k_proteus_Profiling), 0, 0, 1, 1},
35684 {&__pyx_n_s_proteus_mprans, __pyx_k_proteus_mprans,
sizeof(__pyx_k_proteus_mprans), 0, 0, 1, 1},
35685 {&__pyx_kp_s_proteus_mprans_cMoveMeshMonitor, __pyx_k_proteus_mprans_cMoveMeshMonitor,
sizeof(__pyx_k_proteus_mprans_cMoveMeshMonitor), 0, 0, 1, 0},
35686 {&__pyx_n_s_pyCheckOwnedVariable, __pyx_k_pyCheckOwnedVariable,
sizeof(__pyx_k_pyCheckOwnedVariable), 0, 0, 1, 1},
35687 {&__pyx_n_s_pyx_PickleError, __pyx_k_pyx_PickleError,
sizeof(__pyx_k_pyx_PickleError), 0, 0, 1, 1},
35688 {&__pyx_n_s_pyx_checksum, __pyx_k_pyx_checksum,
sizeof(__pyx_k_pyx_checksum), 0, 0, 1, 1},
35689 {&__pyx_n_s_pyx_getbuffer, __pyx_k_pyx_getbuffer,
sizeof(__pyx_k_pyx_getbuffer), 0, 0, 1, 1},
35690 {&__pyx_n_s_pyx_result, __pyx_k_pyx_result,
sizeof(__pyx_k_pyx_result), 0, 0, 1, 1},
35691 {&__pyx_n_s_pyx_state, __pyx_k_pyx_state,
sizeof(__pyx_k_pyx_state), 0, 0, 1, 1},
35692 {&__pyx_n_s_pyx_type, __pyx_k_pyx_type,
sizeof(__pyx_k_pyx_type), 0, 0, 1, 1},
35693 {&__pyx_n_s_pyx_unpickle_Enum, __pyx_k_pyx_unpickle_Enum,
sizeof(__pyx_k_pyx_unpickle_Enum), 0, 0, 1, 1},
35694 {&__pyx_n_s_pyx_vtable, __pyx_k_pyx_vtable,
sizeof(__pyx_k_pyx_vtable), 0, 0, 1, 1},
35695 {&__pyx_n_s_q, __pyx_k_q,
sizeof(__pyx_k_q), 0, 0, 1, 1},
35696 {&__pyx_n_s_r, __pyx_k_r,
sizeof(__pyx_k_r), 0, 0, 1, 1},
35697 {&__pyx_n_s_range, __pyx_k_range,
sizeof(__pyx_k_range), 0, 0, 1, 1},
35698 {&__pyx_n_s_rank, __pyx_k_rank,
sizeof(__pyx_k_rank), 0, 0, 1, 1},
35699 {&__pyx_n_s_recoveryAtNodes, __pyx_k_recoveryAtNodes,
sizeof(__pyx_k_recoveryAtNodes), 0, 0, 1, 1},
35700 {&__pyx_n_s_recoveryAtNodesWeighted, __pyx_k_recoveryAtNodesWeighted,
sizeof(__pyx_k_recoveryAtNodesWeighted), 0, 0, 1, 1},
35701 {&__pyx_n_s_reduce, __pyx_k_reduce,
sizeof(__pyx_k_reduce), 0, 0, 1, 1},
35702 {&__pyx_n_s_reduce_cython, __pyx_k_reduce_cython,
sizeof(__pyx_k_reduce_cython), 0, 0, 1, 1},
35703 {&__pyx_n_s_reduce_ex, __pyx_k_reduce_ex,
sizeof(__pyx_k_reduce_ex), 0, 0, 1, 1},
35704 {&__pyx_n_s_root, __pyx_k_root,
sizeof(__pyx_k_root), 0, 0, 1, 1},
35705 {&__pyx_kp_u_s, __pyx_k_s,
sizeof(__pyx_k_s), 0, 1, 0, 0},
35706 {&__pyx_n_s_scalars, __pyx_k_scalars,
sizeof(__pyx_k_scalars), 0, 0, 1, 1},
35707 {&__pyx_n_s_send, __pyx_k_send,
sizeof(__pyx_k_send), 0, 0, 1, 1},
35708 {&__pyx_n_s_setstate, __pyx_k_setstate,
sizeof(__pyx_k_setstate), 0, 0, 1, 1},
35709 {&__pyx_n_s_setstate_cython, __pyx_k_setstate_cython,
sizeof(__pyx_k_setstate_cython), 0, 0, 1, 1},
35710 {&__pyx_n_s_shape, __pyx_k_shape,
sizeof(__pyx_k_shape), 0, 0, 1, 1},
35711 {&__pyx_n_s_simultaneous, __pyx_k_simultaneous,
sizeof(__pyx_k_simultaneous), 0, 0, 1, 1},
35712 {&__pyx_n_s_size, __pyx_k_size,
sizeof(__pyx_k_size), 0, 0, 1, 1},
35713 {&__pyx_n_s_smoothBoundaries, __pyx_k_smoothBoundaries,
sizeof(__pyx_k_smoothBoundaries), 0, 0, 1, 1},
35714 {&__pyx_n_s_smoothNodesLaplace, __pyx_k_smoothNodesLaplace,
sizeof(__pyx_k_smoothNodesLaplace), 0, 0, 1, 1},
35715 {&__pyx_n_s_start, __pyx_k_start,
sizeof(__pyx_k_start), 0, 0, 1, 1},
35716 {&__pyx_n_s_step, __pyx_k_step,
sizeof(__pyx_k_step), 0, 0, 1, 1},
35717 {&__pyx_n_s_stop, __pyx_k_stop,
sizeof(__pyx_k_stop), 0, 0, 1, 1},
35718 {&__pyx_kp_s_strided_and_direct, __pyx_k_strided_and_direct,
sizeof(__pyx_k_strided_and_direct), 0, 0, 1, 0},
35719 {&__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},
35720 {&__pyx_kp_s_strided_and_indirect, __pyx_k_strided_and_indirect,
sizeof(__pyx_k_strided_and_indirect), 0, 0, 1, 0},
35721 {&__pyx_kp_s_stringsource, __pyx_k_stringsource,
sizeof(__pyx_k_stringsource), 0, 0, 1, 0},
35722 {&__pyx_n_s_struct, __pyx_k_struct,
sizeof(__pyx_k_struct), 0, 0, 1, 1},
35723 {&__pyx_n_s_t, __pyx_k_t,
sizeof(__pyx_k_t), 0, 0, 1, 1},
35724 {&__pyx_n_s_t_max, __pyx_k_t_max,
sizeof(__pyx_k_t_max), 0, 0, 1, 1},
35725 {&__pyx_n_s_t_min, __pyx_k_t_min,
sizeof(__pyx_k_t_min), 0, 0, 1, 1},
35726 {&__pyx_n_s_test, __pyx_k_test,
sizeof(__pyx_k_test), 0, 0, 1, 1},
35727 {&__pyx_n_s_throw, __pyx_k_throw,
sizeof(__pyx_k_throw), 0, 0, 1, 1},
35728 {&__pyx_n_s_tompi4py, __pyx_k_tompi4py,
sizeof(__pyx_k_tompi4py), 0, 0, 1, 1},
35729 {&__pyx_kp_s_type_should_be_1, __pyx_k_type_should_be_1,
sizeof(__pyx_k_type_should_be_1), 0, 0, 1, 0},
35730 {&__pyx_n_s_u, __pyx_k_u,
sizeof(__pyx_k_u), 0, 0, 1, 1},
35731 {&__pyx_n_s_uOfXTatQuadrature, __pyx_k_uOfXTatQuadrature,
sizeof(__pyx_k_uOfXTatQuadrature), 0, 0, 1, 1},
35732 {&__pyx_n_s_u_phi, __pyx_k_u_phi,
sizeof(__pyx_k_u_phi), 0, 0, 1, 1},
35733 {&__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},
35734 {&__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},
35735 {&__pyx_n_s_unpack, __pyx_k_unpack,
sizeof(__pyx_k_unpack), 0, 0, 1, 1},
35736 {&__pyx_n_s_update, __pyx_k_update,
sizeof(__pyx_k_update), 0, 0, 1, 1},
35737 {&__pyx_n_s_variableNumbering_subdomain2glob, __pyx_k_variableNumbering_subdomain2glob,
sizeof(__pyx_k_variableNumbering_subdomain2glob), 0, 0, 1, 1},
35738 {&__pyx_n_s_variableOffsets_subdomain_owned, __pyx_k_variableOffsets_subdomain_owned,
sizeof(__pyx_k_variableOffsets_subdomain_owned), 0, 0, 1, 1},
35739 {&__pyx_n_s_variable_nb_local, __pyx_k_variable_nb_local,
sizeof(__pyx_k_variable_nb_local), 0, 0, 1, 1},
35740 {&__pyx_n_s_x, __pyx_k_x,
sizeof(__pyx_k_x), 0, 0, 1, 1},
35741 {&__pyx_n_s_xrange, __pyx_k_xrange,
sizeof(__pyx_k_xrange), 0, 0, 1, 1},
35742 {&__pyx_n_s_xx, __pyx_k_xx,
sizeof(__pyx_k_xx), 0, 0, 1, 1},
35743 {&__pyx_n_s_zeros, __pyx_k_zeros,
sizeof(__pyx_k_zeros), 0, 0, 1, 1},
35744 {0, 0, 0, 0, 0, 0, 0}
35746 static CYTHON_SMALL_CODE
int __Pyx_InitCachedBuiltins(
void) {
35747 #if PY_MAJOR_VERSION >= 3
35748 __pyx_builtin_xrange = __Pyx_GetBuiltinName(__pyx_n_s_range);
if (!__pyx_builtin_xrange) __PYX_ERR(0, 51, __pyx_L1_error)
35750 __pyx_builtin_xrange = __Pyx_GetBuiltinName(__pyx_n_s_xrange);
if (!__pyx_builtin_xrange) __PYX_ERR(0, 51, __pyx_L1_error)
35752 __pyx_builtin_range = __Pyx_GetBuiltinName(__pyx_n_s_range);
if (!__pyx_builtin_range) __PYX_ERR(0, 67, __pyx_L1_error)
35753 __pyx_builtin_AssertionError = __Pyx_GetBuiltinName(__pyx_n_s_AssertionError);
if (!__pyx_builtin_AssertionError) __PYX_ERR(0, 489, __pyx_L1_error)
35754 __pyx_builtin_TypeError = __Pyx_GetBuiltinName(__pyx_n_s_TypeError);
if (!__pyx_builtin_TypeError) __PYX_ERR(1, 2, __pyx_L1_error)
35755 __pyx_builtin_ImportError = __Pyx_GetBuiltinName(__pyx_n_s_ImportError);
if (!__pyx_builtin_ImportError) __PYX_ERR(2, 945, __pyx_L1_error)
35756 __pyx_builtin_ValueError = __Pyx_GetBuiltinName(__pyx_n_s_ValueError);
if (!__pyx_builtin_ValueError) __PYX_ERR(1, 133, __pyx_L1_error)
35757 __pyx_builtin_MemoryError = __Pyx_GetBuiltinName(__pyx_n_s_MemoryError);
if (!__pyx_builtin_MemoryError) __PYX_ERR(1, 148, __pyx_L1_error)
35758 __pyx_builtin_enumerate = __Pyx_GetBuiltinName(__pyx_n_s_enumerate);
if (!__pyx_builtin_enumerate) __PYX_ERR(1, 151, __pyx_L1_error)
35759 __pyx_builtin_Ellipsis = __Pyx_GetBuiltinName(__pyx_n_s_Ellipsis);
if (!__pyx_builtin_Ellipsis) __PYX_ERR(1, 404, __pyx_L1_error)
35760 __pyx_builtin_id = __Pyx_GetBuiltinName(__pyx_n_s_id);
if (!__pyx_builtin_id) __PYX_ERR(1, 613, __pyx_L1_error)
35761 __pyx_builtin_IndexError = __Pyx_GetBuiltinName(__pyx_n_s_IndexError);
if (!__pyx_builtin_IndexError) __PYX_ERR(1, 832, __pyx_L1_error)
35767 static CYTHON_SMALL_CODE
int __Pyx_InitCachedConstants(
void) {
35768 __Pyx_RefNannyDeclarations
35769 __Pyx_RefNannySetupContext(
"__Pyx_InitCachedConstants", 0);
35778 __pyx_tuple_ = PyTuple_Pack(2, __pyx_n_s_u, __pyx_int_0);
if (unlikely(!__pyx_tuple_)) __PYX_ERR(0, 31, __pyx_L1_error)
35779 __Pyx_GOTREF(__pyx_tuple_);
35780 __Pyx_GIVEREF(__pyx_tuple_);
35789 __pyx_tuple__2 = PyTuple_Pack(2, __pyx_n_s_r, __pyx_int_0);
if (unlikely(!__pyx_tuple__2)) __PYX_ERR(0, 33, __pyx_L1_error)
35790 __Pyx_GOTREF(__pyx_tuple__2);
35791 __Pyx_GIVEREF(__pyx_tuple__2);
35800 __pyx_tuple__3 = PyTuple_Pack(2, __pyx_n_s_f, __pyx_int_0);
if (unlikely(!__pyx_tuple__3)) __PYX_ERR(0, 34, __pyx_L1_error)
35801 __Pyx_GOTREF(__pyx_tuple__3);
35802 __Pyx_GIVEREF(__pyx_tuple__3);
35811 __pyx_slice__4 = PySlice_New(__pyx_int_1, Py_None, Py_None);
if (unlikely(!__pyx_slice__4)) __PYX_ERR(0, 212, __pyx_L1_error)
35812 __Pyx_GOTREF(__pyx_slice__4);
35813 __Pyx_GIVEREF(__pyx_slice__4);
35822 __pyx_tuple__5 = PyTuple_Pack(2, __pyx_int_0, __pyx_int_15);
if (unlikely(!__pyx_tuple__5)) __PYX_ERR(0, 351, __pyx_L1_error)
35823 __Pyx_GOTREF(__pyx_tuple__5);
35824 __Pyx_GIVEREF(__pyx_tuple__5);
35833 __pyx_tuple__6 = PyTuple_Pack(1, __pyx_kp_s_did_not_find_containing_element);
if (unlikely(!__pyx_tuple__6)) __PYX_ERR(0, 489, __pyx_L1_error)
35834 __Pyx_GOTREF(__pyx_tuple__6);
35835 __Pyx_GIVEREF(__pyx_tuple__6);
35844 __pyx_tuple__7 = PyTuple_Pack(1, __pyx_kp_s_did_not_find_containing_element_2);
if (unlikely(!__pyx_tuple__7)) __PYX_ERR(0, 689, __pyx_L1_error)
35845 __Pyx_GOTREF(__pyx_tuple__7);
35846 __Pyx_GIVEREF(__pyx_tuple__7);
35854 __pyx_tuple__8 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non);
if (unlikely(!__pyx_tuple__8)) __PYX_ERR(1, 2, __pyx_L1_error)
35855 __Pyx_GOTREF(__pyx_tuple__8);
35856 __Pyx_GIVEREF(__pyx_tuple__8);
35863 __pyx_tuple__9 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non);
if (unlikely(!__pyx_tuple__9)) __PYX_ERR(1, 4, __pyx_L1_error)
35864 __Pyx_GOTREF(__pyx_tuple__9);
35865 __Pyx_GIVEREF(__pyx_tuple__9);
35874 __pyx_tuple__10 = PyTuple_Pack(1, __pyx_kp_s_numpy_core_multiarray_failed_to);
if (unlikely(!__pyx_tuple__10)) __PYX_ERR(2, 945, __pyx_L1_error)
35875 __Pyx_GOTREF(__pyx_tuple__10);
35876 __Pyx_GIVEREF(__pyx_tuple__10);
35885 __pyx_tuple__11 = PyTuple_Pack(1, __pyx_kp_s_numpy_core_umath_failed_to_impor);
if (unlikely(!__pyx_tuple__11)) __PYX_ERR(2, 951, __pyx_L1_error)
35886 __Pyx_GOTREF(__pyx_tuple__11);
35887 __Pyx_GIVEREF(__pyx_tuple__11);
35896 __pyx_tuple__12 = PyTuple_Pack(1, __pyx_kp_s_Empty_shape_tuple_for_cython_arr);
if (unlikely(!__pyx_tuple__12)) __PYX_ERR(1, 133, __pyx_L1_error)
35897 __Pyx_GOTREF(__pyx_tuple__12);
35898 __Pyx_GIVEREF(__pyx_tuple__12);
35907 __pyx_tuple__13 = PyTuple_Pack(1, __pyx_kp_s_itemsize_0_for_cython_array);
if (unlikely(!__pyx_tuple__13)) __PYX_ERR(1, 136, __pyx_L1_error)
35908 __Pyx_GOTREF(__pyx_tuple__13);
35909 __Pyx_GIVEREF(__pyx_tuple__13);
35918 __pyx_tuple__14 = PyTuple_Pack(1, __pyx_kp_s_unable_to_allocate_shape_and_str);
if (unlikely(!__pyx_tuple__14)) __PYX_ERR(1, 148, __pyx_L1_error)
35919 __Pyx_GOTREF(__pyx_tuple__14);
35920 __Pyx_GIVEREF(__pyx_tuple__14);
35929 __pyx_tuple__15 = PyTuple_Pack(1, __pyx_kp_s_unable_to_allocate_array_data);
if (unlikely(!__pyx_tuple__15)) __PYX_ERR(1, 176, __pyx_L1_error)
35930 __Pyx_GOTREF(__pyx_tuple__15);
35931 __Pyx_GIVEREF(__pyx_tuple__15);
35940 __pyx_tuple__16 = PyTuple_Pack(1, __pyx_kp_s_Can_only_create_a_buffer_that_is);
if (unlikely(!__pyx_tuple__16)) __PYX_ERR(1, 192, __pyx_L1_error)
35941 __Pyx_GOTREF(__pyx_tuple__16);
35942 __Pyx_GIVEREF(__pyx_tuple__16);
35950 __pyx_tuple__17 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non);
if (unlikely(!__pyx_tuple__17)) __PYX_ERR(1, 2, __pyx_L1_error)
35951 __Pyx_GOTREF(__pyx_tuple__17);
35952 __Pyx_GIVEREF(__pyx_tuple__17);
35959 __pyx_tuple__18 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non);
if (unlikely(!__pyx_tuple__18)) __PYX_ERR(1, 4, __pyx_L1_error)
35960 __Pyx_GOTREF(__pyx_tuple__18);
35961 __Pyx_GIVEREF(__pyx_tuple__18);
35970 __pyx_tuple__19 = PyTuple_Pack(1, __pyx_kp_s_Cannot_assign_to_read_only_memor);
if (unlikely(!__pyx_tuple__19)) __PYX_ERR(1, 418, __pyx_L1_error)
35971 __Pyx_GOTREF(__pyx_tuple__19);
35972 __Pyx_GIVEREF(__pyx_tuple__19);
35981 __pyx_tuple__20 = PyTuple_Pack(1, __pyx_kp_s_Unable_to_convert_item_to_object);
if (unlikely(!__pyx_tuple__20)) __PYX_ERR(1, 495, __pyx_L1_error)
35982 __Pyx_GOTREF(__pyx_tuple__20);
35983 __Pyx_GIVEREF(__pyx_tuple__20);
35992 __pyx_tuple__21 = PyTuple_Pack(1, __pyx_kp_s_Cannot_create_writable_memory_vi);
if (unlikely(!__pyx_tuple__21)) __PYX_ERR(1, 520, __pyx_L1_error)
35993 __Pyx_GOTREF(__pyx_tuple__21);
35994 __Pyx_GIVEREF(__pyx_tuple__21);
36003 __pyx_tuple__22 = PyTuple_Pack(1, __pyx_kp_s_Buffer_view_does_not_expose_stri);
if (unlikely(!__pyx_tuple__22)) __PYX_ERR(1, 570, __pyx_L1_error)
36004 __Pyx_GOTREF(__pyx_tuple__22);
36005 __Pyx_GIVEREF(__pyx_tuple__22);
36014 __pyx_tuple__23 = PyTuple_New(1);
if (unlikely(!__pyx_tuple__23)) __PYX_ERR(1, 577, __pyx_L1_error)
36015 __Pyx_GOTREF(__pyx_tuple__23);
36016 __Pyx_INCREF(__pyx_int_neg_1);
36017 __Pyx_GIVEREF(__pyx_int_neg_1);
36018 PyTuple_SET_ITEM(__pyx_tuple__23, 0, __pyx_int_neg_1);
36019 __Pyx_GIVEREF(__pyx_tuple__23);
36027 __pyx_tuple__24 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non);
if (unlikely(!__pyx_tuple__24)) __PYX_ERR(1, 2, __pyx_L1_error)
36028 __Pyx_GOTREF(__pyx_tuple__24);
36029 __Pyx_GIVEREF(__pyx_tuple__24);
36036 __pyx_tuple__25 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non);
if (unlikely(!__pyx_tuple__25)) __PYX_ERR(1, 4, __pyx_L1_error)
36037 __Pyx_GOTREF(__pyx_tuple__25);
36038 __Pyx_GIVEREF(__pyx_tuple__25);
36047 __pyx_slice__26 = PySlice_New(Py_None, Py_None, Py_None);
if (unlikely(!__pyx_slice__26)) __PYX_ERR(1, 682, __pyx_L1_error)
36048 __Pyx_GOTREF(__pyx_slice__26);
36049 __Pyx_GIVEREF(__pyx_slice__26);
36058 __pyx_tuple__27 = PyTuple_Pack(1, __pyx_kp_s_Indirect_dimensions_not_supporte);
if (unlikely(!__pyx_tuple__27)) __PYX_ERR(1, 703, __pyx_L1_error)
36059 __Pyx_GOTREF(__pyx_tuple__27);
36060 __Pyx_GIVEREF(__pyx_tuple__27);
36068 __pyx_tuple__28 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non);
if (unlikely(!__pyx_tuple__28)) __PYX_ERR(1, 2, __pyx_L1_error)
36069 __Pyx_GOTREF(__pyx_tuple__28);
36070 __Pyx_GIVEREF(__pyx_tuple__28);
36077 __pyx_tuple__29 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non);
if (unlikely(!__pyx_tuple__29)) __PYX_ERR(1, 4, __pyx_L1_error)
36078 __Pyx_GOTREF(__pyx_tuple__29);
36079 __Pyx_GIVEREF(__pyx_tuple__29);
36080 __pyx_tuple__30 = PyTuple_Pack(3, __pyx_int_184977713, __pyx_int_136983863, __pyx_int_112105877);
if (unlikely(!__pyx_tuple__30)) __PYX_ERR(1, 4, __pyx_L1_error)
36081 __Pyx_GOTREF(__pyx_tuple__30);
36082 __Pyx_GIVEREF(__pyx_tuple__30);
36091 __pyx_tuple__36 = PyTuple_Pack(3, __pyx_n_s_scalars, __pyx_n_s_nodeElementsArray, __pyx_n_s_nodeElementOffsets);
if (unlikely(!__pyx_tuple__36)) __PYX_ERR(0, 944, __pyx_L1_error)
36092 __Pyx_GOTREF(__pyx_tuple__36);
36093 __Pyx_GIVEREF(__pyx_tuple__36);
36094 __pyx_codeobj__37 = (PyObject*)__Pyx_PyCode_New(3, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__36, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_proteus_mprans_cMoveMeshMonitor, __pyx_n_s_recoveryAtNodes, 944, __pyx_empty_bytes);
if (unlikely(!__pyx_codeobj__37)) __PYX_ERR(0, 944, __pyx_L1_error)
36103 __pyx_tuple__38 = PyTuple_Pack(5, __pyx_n_s_scalars, __pyx_n_s_nodeElementsArray, __pyx_n_s_nodeElementOffsets, __pyx_n_s_detJ_array, __pyx_n_s_nNodes);
if (unlikely(!__pyx_tuple__38)) __PYX_ERR(0, 971, __pyx_L1_error)
36104 __Pyx_GOTREF(__pyx_tuple__38);
36105 __Pyx_GIVEREF(__pyx_tuple__38);
36106 __pyx_codeobj__39 = (PyObject*)__Pyx_PyCode_New(5, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__38, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_proteus_mprans_cMoveMeshMonitor, __pyx_n_s_recoveryAtNodesWeighted, 971, __pyx_empty_bytes);
if (unlikely(!__pyx_codeobj__39)) __PYX_ERR(0, 971, __pyx_L1_error)
36115 __pyx_tuple__40 = PyTuple_Pack(4, __pyx_n_s_grads, __pyx_n_s_nodeElementsArray, __pyx_n_s_nodeElementOffsets, __pyx_n_s_nd);
if (unlikely(!__pyx_tuple__40)) __PYX_ERR(0, 1012, __pyx_L1_error)
36116 __Pyx_GOTREF(__pyx_tuple__40);
36117 __Pyx_GIVEREF(__pyx_tuple__40);
36118 __pyx_codeobj__41 = (PyObject*)__Pyx_PyCode_New(4, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__40, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_proteus_mprans_cMoveMeshMonitor, __pyx_n_s_gradientRecoveryAtNodes, 1012, __pyx_empty_bytes);
if (unlikely(!__pyx_codeobj__41)) __PYX_ERR(0, 1012, __pyx_L1_error)
36127 __pyx_tuple__42 = PyTuple_Pack(5, __pyx_n_s_grads, __pyx_n_s_nodeElementsArray, __pyx_n_s_nodeElementOffsets, __pyx_n_s_detJ_array, __pyx_n_s_nd);
if (unlikely(!__pyx_tuple__42)) __PYX_ERR(0, 1046, __pyx_L1_error)
36128 __Pyx_GOTREF(__pyx_tuple__42);
36129 __Pyx_GIVEREF(__pyx_tuple__42);
36130 __pyx_codeobj__43 = (PyObject*)__Pyx_PyCode_New(5, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__42, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_proteus_mprans_cMoveMeshMonitor, __pyx_n_s_gradientRecoveryAtNodesWeighted, 1046, __pyx_empty_bytes);
if (unlikely(!__pyx_codeobj__43)) __PYX_ERR(0, 1046, __pyx_L1_error)
36139 __pyx_tuple__44 = PyTuple_Pack(5, __pyx_n_s_variable_nb_local, __pyx_n_s_rank, __pyx_n_s_nVariables_owned, __pyx_n_s_variableNumbering_subdomain2glob, __pyx_n_s_variableOffsets_subdomain_owned);
if (unlikely(!__pyx_tuple__44)) __PYX_ERR(0, 1171, __pyx_L1_error)
36140 __Pyx_GOTREF(__pyx_tuple__44);
36141 __Pyx_GIVEREF(__pyx_tuple__44);
36142 __pyx_codeobj__45 = (PyObject*)__Pyx_PyCode_New(5, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__44, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_proteus_mprans_cMoveMeshMonitor, __pyx_n_s_pyCheckOwnedVariable, 1171, __pyx_empty_bytes);
if (unlikely(!__pyx_codeobj__45)) __PYX_ERR(0, 1171, __pyx_L1_error)
36151 __pyx_tuple__46 = PyTuple_Pack(1, __pyx_kp_s_strided_and_direct_or_indirect);
if (unlikely(!__pyx_tuple__46)) __PYX_ERR(1, 286, __pyx_L1_error)
36152 __Pyx_GOTREF(__pyx_tuple__46);
36153 __Pyx_GIVEREF(__pyx_tuple__46);
36162 __pyx_tuple__47 = PyTuple_Pack(1, __pyx_kp_s_strided_and_direct);
if (unlikely(!__pyx_tuple__47)) __PYX_ERR(1, 287, __pyx_L1_error)
36163 __Pyx_GOTREF(__pyx_tuple__47);
36164 __Pyx_GIVEREF(__pyx_tuple__47);
36173 __pyx_tuple__48 = PyTuple_Pack(1, __pyx_kp_s_strided_and_indirect);
if (unlikely(!__pyx_tuple__48)) __PYX_ERR(1, 288, __pyx_L1_error)
36174 __Pyx_GOTREF(__pyx_tuple__48);
36175 __Pyx_GIVEREF(__pyx_tuple__48);
36184 __pyx_tuple__49 = PyTuple_Pack(1, __pyx_kp_s_contiguous_and_direct);
if (unlikely(!__pyx_tuple__49)) __PYX_ERR(1, 291, __pyx_L1_error)
36185 __Pyx_GOTREF(__pyx_tuple__49);
36186 __Pyx_GIVEREF(__pyx_tuple__49);
36195 __pyx_tuple__50 = PyTuple_Pack(1, __pyx_kp_s_contiguous_and_indirect);
if (unlikely(!__pyx_tuple__50)) __PYX_ERR(1, 292, __pyx_L1_error)
36196 __Pyx_GOTREF(__pyx_tuple__50);
36197 __Pyx_GIVEREF(__pyx_tuple__50);
36204 __pyx_tuple__51 = 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__51)) __PYX_ERR(1, 1, __pyx_L1_error)
36205 __Pyx_GOTREF(__pyx_tuple__51);
36206 __Pyx_GIVEREF(__pyx_tuple__51);
36207 __pyx_codeobj__52 = (PyObject*)__Pyx_PyCode_New(3, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__51, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_pyx_unpickle_Enum, 1, __pyx_empty_bytes);
if (unlikely(!__pyx_codeobj__52)) __PYX_ERR(1, 1, __pyx_L1_error)
36208 __Pyx_RefNannyFinishContext();
36211 __Pyx_RefNannyFinishContext();
36215 static CYTHON_SMALL_CODE
int __Pyx_InitGlobals(
void) {
36216 if (__Pyx_InitStrings(__pyx_string_tab) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
36217 __pyx_float_0_ = PyFloat_FromDouble(0.);
if (unlikely(!__pyx_float_0_)) __PYX_ERR(0, 1, __pyx_L1_error)
36218 __pyx_float_1_ = PyFloat_FromDouble(1.);
if (unlikely(!__pyx_float_1_)) __PYX_ERR(0, 1, __pyx_L1_error)
36219 __pyx_int_0 = PyInt_FromLong(0);
if (unlikely(!__pyx_int_0)) __PYX_ERR(0, 1, __pyx_L1_error)
36220 __pyx_int_1 = PyInt_FromLong(1);
if (unlikely(!__pyx_int_1)) __PYX_ERR(0, 1, __pyx_L1_error)
36221 __pyx_int_3 = PyInt_FromLong(3);
if (unlikely(!__pyx_int_3)) __PYX_ERR(0, 1, __pyx_L1_error)
36222 __pyx_int_15 = PyInt_FromLong(15);
if (unlikely(!__pyx_int_15)) __PYX_ERR(0, 1, __pyx_L1_error)
36223 __pyx_int_112105877 = PyInt_FromLong(112105877
L);
if (unlikely(!__pyx_int_112105877)) __PYX_ERR(0, 1, __pyx_L1_error)
36224 __pyx_int_136983863 = PyInt_FromLong(136983863
L);
if (unlikely(!__pyx_int_136983863)) __PYX_ERR(0, 1, __pyx_L1_error)
36225 __pyx_int_184977713 = PyInt_FromLong(184977713
L);
if (unlikely(!__pyx_int_184977713)) __PYX_ERR(0, 1, __pyx_L1_error)
36226 __pyx_int_neg_1 = PyInt_FromLong(-1);
if (unlikely(!__pyx_int_neg_1)) __PYX_ERR(0, 1, __pyx_L1_error)
36232 static CYTHON_SMALL_CODE
int __Pyx_modinit_global_init_code(
void);
36233 static CYTHON_SMALL_CODE
int __Pyx_modinit_variable_export_code(
void);
36234 static CYTHON_SMALL_CODE
int __Pyx_modinit_function_export_code(
void);
36235 static CYTHON_SMALL_CODE
int __Pyx_modinit_type_init_code(
void);
36236 static CYTHON_SMALL_CODE
int __Pyx_modinit_type_import_code(
void);
36237 static CYTHON_SMALL_CODE
int __Pyx_modinit_variable_import_code(
void);
36238 static CYTHON_SMALL_CODE
int __Pyx_modinit_function_import_code(
void);
36240 static int __Pyx_modinit_global_init_code(
void) {
36241 __Pyx_RefNannyDeclarations
36242 __Pyx_RefNannySetupContext(
"__Pyx_modinit_global_init_code", 0);
36244 generic = Py_None; Py_INCREF(Py_None);
36245 strided = Py_None; Py_INCREF(Py_None);
36246 indirect = Py_None; Py_INCREF(Py_None);
36247 contiguous = Py_None; Py_INCREF(Py_None);
36248 indirect_contiguous = Py_None; Py_INCREF(Py_None);
36249 __Pyx_RefNannyFinishContext();
36253 static int __Pyx_modinit_variable_export_code(
void) {
36254 __Pyx_RefNannyDeclarations
36255 __Pyx_RefNannySetupContext(
"__Pyx_modinit_variable_export_code", 0);
36257 __Pyx_RefNannyFinishContext();
36261 static int __Pyx_modinit_function_export_code(
void) {
36262 __Pyx_RefNannyDeclarations
36263 __Pyx_RefNannySetupContext(
"__Pyx_modinit_function_export_code", 0);
36265 __Pyx_RefNannyFinishContext();
36269 static int __Pyx_modinit_type_init_code(
void) {
36270 __Pyx_RefNannyDeclarations
36271 int __pyx_lineno = 0;
36272 const char *__pyx_filename = NULL;
36273 int __pyx_clineno = 0;
36274 __Pyx_RefNannySetupContext(
"__Pyx_modinit_type_init_code", 0);
36276 __pyx_vtabptr_6mprans_16cMoveMeshMonitor_cCoefficients = &__pyx_vtable_6mprans_16cMoveMeshMonitor_cCoefficients;
36277 __pyx_vtable_6mprans_16cMoveMeshMonitor_cCoefficients.cppPreStep = (PyObject *(*)(
struct __pyx_obj_6mprans_16cMoveMeshMonitor_cCoefficients *, __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice,
int))__pyx_f_6mprans_16cMoveMeshMonitor_13cCoefficients_cppPreStep;
36278 __pyx_vtable_6mprans_16cMoveMeshMonitor_cCoefficients.cppPostStep = (PyObject *(*)(
struct __pyx_obj_6mprans_16cMoveMeshMonitor_cCoefficients *))__pyx_f_6mprans_16cMoveMeshMonitor_13cCoefficients_cppPostStep;
36279 __pyx_vtable_6mprans_16cMoveMeshMonitor_cCoefficients.cppPseudoTimeSteppingParallel = (PyObject *(*)(
struct __pyx_obj_6mprans_16cMoveMeshMonitor_cCoefficients *, __Pyx_memviewslice,
double))__pyx_f_6mprans_16cMoveMeshMonitor_13cCoefficients_cppPseudoTimeSteppingParallel;
36280 if (PyType_Ready(&__pyx_type_6mprans_16cMoveMeshMonitor_cCoefficients) < 0) __PYX_ERR(0, 15, __pyx_L1_error)
36281 #if PY_VERSION_HEX < 0x030800B1
36282 __pyx_type_6mprans_16cMoveMeshMonitor_cCoefficients.tp_print = 0;
36284 if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_6mprans_16cMoveMeshMonitor_cCoefficients.tp_dictoffset && __pyx_type_6mprans_16cMoveMeshMonitor_cCoefficients.tp_getattro == PyObject_GenericGetAttr)) {
36285 __pyx_type_6mprans_16cMoveMeshMonitor_cCoefficients.tp_getattro = __Pyx_PyObject_GenericGetAttr;
36287 if (__Pyx_SetVtable(__pyx_type_6mprans_16cMoveMeshMonitor_cCoefficients.tp_dict, __pyx_vtabptr_6mprans_16cMoveMeshMonitor_cCoefficients) < 0) __PYX_ERR(0, 15, __pyx_L1_error)
36288 if (PyObject_SetAttr(__pyx_m, __pyx_n_s_cCoefficients, (PyObject *)&__pyx_type_6mprans_16cMoveMeshMonitor_cCoefficients) < 0) __PYX_ERR(0, 15, __pyx_L1_error)
36289 if (__Pyx_setup_reduce((PyObject*)&__pyx_type_6mprans_16cMoveMeshMonitor_cCoefficients) < 0) __PYX_ERR(0, 15, __pyx_L1_error)
36290 __pyx_ptype_6mprans_16cMoveMeshMonitor_cCoefficients = &__pyx_type_6mprans_16cMoveMeshMonitor_cCoefficients;
36291 if (PyType_Ready(&__pyx_type_6mprans_16cMoveMeshMonitor___pyx_scope_struct__cppPseudoTimeSteppingParallel) < 0) __PYX_ERR(0, 202, __pyx_L1_error)
36292 #if PY_VERSION_HEX < 0x030800B1
36293 __pyx_type_6mprans_16cMoveMeshMonitor___pyx_scope_struct__cppPseudoTimeSteppingParallel.tp_print = 0;
36295 if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_6mprans_16cMoveMeshMonitor___pyx_scope_struct__cppPseudoTimeSteppingParallel.tp_dictoffset && __pyx_type_6mprans_16cMoveMeshMonitor___pyx_scope_struct__cppPseudoTimeSteppingParallel.tp_getattro == PyObject_GenericGetAttr)) {
36296 __pyx_type_6mprans_16cMoveMeshMonitor___pyx_scope_struct__cppPseudoTimeSteppingParallel.tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict;
36298 __pyx_ptype_6mprans_16cMoveMeshMonitor___pyx_scope_struct__cppPseudoTimeSteppingParallel = &__pyx_type_6mprans_16cMoveMeshMonitor___pyx_scope_struct__cppPseudoTimeSteppingParallel;
36299 if (PyType_Ready(&__pyx_type_6mprans_16cMoveMeshMonitor___pyx_scope_struct_1_genexpr) < 0) __PYX_ERR(0, 597, __pyx_L1_error)
36300 #if PY_VERSION_HEX < 0x030800B1
36301 __pyx_type_6mprans_16cMoveMeshMonitor___pyx_scope_struct_1_genexpr.tp_print = 0;
36303 if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_6mprans_16cMoveMeshMonitor___pyx_scope_struct_1_genexpr.tp_dictoffset && __pyx_type_6mprans_16cMoveMeshMonitor___pyx_scope_struct_1_genexpr.tp_getattro == PyObject_GenericGetAttr)) {
36304 __pyx_type_6mprans_16cMoveMeshMonitor___pyx_scope_struct_1_genexpr.tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict;
36306 __pyx_ptype_6mprans_16cMoveMeshMonitor___pyx_scope_struct_1_genexpr = &__pyx_type_6mprans_16cMoveMeshMonitor___pyx_scope_struct_1_genexpr;
36307 if (PyType_Ready(&__pyx_type_6mprans_16cMoveMeshMonitor___pyx_scope_struct_2_genexpr) < 0) __PYX_ERR(0, 598, __pyx_L1_error)
36308 #if PY_VERSION_HEX < 0x030800B1
36309 __pyx_type_6mprans_16cMoveMeshMonitor___pyx_scope_struct_2_genexpr.tp_print = 0;
36311 if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_6mprans_16cMoveMeshMonitor___pyx_scope_struct_2_genexpr.tp_dictoffset && __pyx_type_6mprans_16cMoveMeshMonitor___pyx_scope_struct_2_genexpr.tp_getattro == PyObject_GenericGetAttr)) {
36312 __pyx_type_6mprans_16cMoveMeshMonitor___pyx_scope_struct_2_genexpr.tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict;
36314 __pyx_ptype_6mprans_16cMoveMeshMonitor___pyx_scope_struct_2_genexpr = &__pyx_type_6mprans_16cMoveMeshMonitor___pyx_scope_struct_2_genexpr;
36315 if (PyType_Ready(&__pyx_type_6mprans_16cMoveMeshMonitor___pyx_scope_struct_3_genexpr) < 0) __PYX_ERR(0, 793, __pyx_L1_error)
36316 #if PY_VERSION_HEX < 0x030800B1
36317 __pyx_type_6mprans_16cMoveMeshMonitor___pyx_scope_struct_3_genexpr.tp_print = 0;
36319 if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_6mprans_16cMoveMeshMonitor___pyx_scope_struct_3_genexpr.tp_dictoffset && __pyx_type_6mprans_16cMoveMeshMonitor___pyx_scope_struct_3_genexpr.tp_getattro == PyObject_GenericGetAttr)) {
36320 __pyx_type_6mprans_16cMoveMeshMonitor___pyx_scope_struct_3_genexpr.tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict;
36322 __pyx_ptype_6mprans_16cMoveMeshMonitor___pyx_scope_struct_3_genexpr = &__pyx_type_6mprans_16cMoveMeshMonitor___pyx_scope_struct_3_genexpr;
36323 if (PyType_Ready(&__pyx_type_6mprans_16cMoveMeshMonitor___pyx_scope_struct_4_genexpr) < 0) __PYX_ERR(0, 794, __pyx_L1_error)
36324 #if PY_VERSION_HEX < 0x030800B1
36325 __pyx_type_6mprans_16cMoveMeshMonitor___pyx_scope_struct_4_genexpr.tp_print = 0;
36327 if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_6mprans_16cMoveMeshMonitor___pyx_scope_struct_4_genexpr.tp_dictoffset && __pyx_type_6mprans_16cMoveMeshMonitor___pyx_scope_struct_4_genexpr.tp_getattro == PyObject_GenericGetAttr)) {
36328 __pyx_type_6mprans_16cMoveMeshMonitor___pyx_scope_struct_4_genexpr.tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict;
36330 __pyx_ptype_6mprans_16cMoveMeshMonitor___pyx_scope_struct_4_genexpr = &__pyx_type_6mprans_16cMoveMeshMonitor___pyx_scope_struct_4_genexpr;
36331 __pyx_vtabptr_array = &__pyx_vtable_array;
36332 __pyx_vtable_array.get_memview = (PyObject *(*)(
struct __pyx_array_obj *))__pyx_array_get_memview;
36333 if (PyType_Ready(&__pyx_type___pyx_array) < 0) __PYX_ERR(1, 105, __pyx_L1_error)
36334 #if PY_VERSION_HEX < 0x030800B1
36335 __pyx_type___pyx_array.tp_print = 0;
36337 if (__Pyx_SetVtable(__pyx_type___pyx_array.tp_dict, __pyx_vtabptr_array) < 0) __PYX_ERR(1, 105, __pyx_L1_error)
36338 if (__Pyx_setup_reduce((PyObject*)&__pyx_type___pyx_array) < 0) __PYX_ERR(1, 105, __pyx_L1_error)
36339 __pyx_array_type = &__pyx_type___pyx_array;
36340 if (PyType_Ready(&__pyx_type___pyx_MemviewEnum) < 0) __PYX_ERR(1, 279, __pyx_L1_error)
36341 #if PY_VERSION_HEX < 0x030800B1
36342 __pyx_type___pyx_MemviewEnum.tp_print = 0;
36344 if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type___pyx_MemviewEnum.tp_dictoffset && __pyx_type___pyx_MemviewEnum.tp_getattro == PyObject_GenericGetAttr)) {
36345 __pyx_type___pyx_MemviewEnum.tp_getattro = __Pyx_PyObject_GenericGetAttr;
36347 if (__Pyx_setup_reduce((PyObject*)&__pyx_type___pyx_MemviewEnum) < 0) __PYX_ERR(1, 279, __pyx_L1_error)
36348 __pyx_MemviewEnum_type = &__pyx_type___pyx_MemviewEnum;
36349 __pyx_vtabptr_memoryview = &__pyx_vtable_memoryview;
36350 __pyx_vtable_memoryview.get_item_pointer = (
char *(*)(
struct __pyx_memoryview_obj *, PyObject *))__pyx_memoryview_get_item_pointer;
36351 __pyx_vtable_memoryview.is_slice = (PyObject *(*)(
struct __pyx_memoryview_obj *, PyObject *))__pyx_memoryview_is_slice;
36352 __pyx_vtable_memoryview.setitem_slice_assignment = (PyObject *(*)(
struct __pyx_memoryview_obj *, PyObject *, PyObject *))__pyx_memoryview_setitem_slice_assignment;
36353 __pyx_vtable_memoryview.setitem_slice_assign_scalar = (PyObject *(*)(
struct __pyx_memoryview_obj *,
struct __pyx_memoryview_obj *, PyObject *))__pyx_memoryview_setitem_slice_assign_scalar;
36354 __pyx_vtable_memoryview.setitem_indexed = (PyObject *(*)(
struct __pyx_memoryview_obj *, PyObject *, PyObject *))__pyx_memoryview_setitem_indexed;
36355 __pyx_vtable_memoryview.convert_item_to_object = (PyObject *(*)(
struct __pyx_memoryview_obj *,
char *))__pyx_memoryview_convert_item_to_object;
36356 __pyx_vtable_memoryview.assign_item_from_object = (PyObject *(*)(
struct __pyx_memoryview_obj *,
char *, PyObject *))__pyx_memoryview_assign_item_from_object;
36357 if (PyType_Ready(&__pyx_type___pyx_memoryview) < 0) __PYX_ERR(1, 330, __pyx_L1_error)
36358 #if PY_VERSION_HEX < 0x030800B1
36359 __pyx_type___pyx_memoryview.tp_print = 0;
36361 if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type___pyx_memoryview.tp_dictoffset && __pyx_type___pyx_memoryview.tp_getattro == PyObject_GenericGetAttr)) {
36362 __pyx_type___pyx_memoryview.tp_getattro = __Pyx_PyObject_GenericGetAttr;
36364 if (__Pyx_SetVtable(__pyx_type___pyx_memoryview.tp_dict, __pyx_vtabptr_memoryview) < 0) __PYX_ERR(1, 330, __pyx_L1_error)
36365 if (__Pyx_setup_reduce((PyObject*)&__pyx_type___pyx_memoryview) < 0) __PYX_ERR(1, 330, __pyx_L1_error)
36366 __pyx_memoryview_type = &__pyx_type___pyx_memoryview;
36367 __pyx_vtabptr__memoryviewslice = &__pyx_vtable__memoryviewslice;
36368 __pyx_vtable__memoryviewslice.__pyx_base = *__pyx_vtabptr_memoryview;
36369 __pyx_vtable__memoryviewslice.__pyx_base.convert_item_to_object = (PyObject *(*)(
struct __pyx_memoryview_obj *,
char *))__pyx_memoryviewslice_convert_item_to_object;
36370 __pyx_vtable__memoryviewslice.__pyx_base.assign_item_from_object = (PyObject *(*)(
struct __pyx_memoryview_obj *,
char *, PyObject *))__pyx_memoryviewslice_assign_item_from_object;
36371 __pyx_type___pyx_memoryviewslice.tp_base = __pyx_memoryview_type;
36372 if (PyType_Ready(&__pyx_type___pyx_memoryviewslice) < 0) __PYX_ERR(1, 965, __pyx_L1_error)
36373 #if PY_VERSION_HEX < 0x030800B1
36374 __pyx_type___pyx_memoryviewslice.tp_print = 0;
36376 if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type___pyx_memoryviewslice.tp_dictoffset && __pyx_type___pyx_memoryviewslice.tp_getattro == PyObject_GenericGetAttr)) {
36377 __pyx_type___pyx_memoryviewslice.tp_getattro = __Pyx_PyObject_GenericGetAttr;
36379 if (__Pyx_SetVtable(__pyx_type___pyx_memoryviewslice.tp_dict, __pyx_vtabptr__memoryviewslice) < 0) __PYX_ERR(1, 965, __pyx_L1_error)
36380 if (__Pyx_setup_reduce((PyObject*)&__pyx_type___pyx_memoryviewslice) < 0) __PYX_ERR(1, 965, __pyx_L1_error)
36381 __pyx_memoryviewslice_type = &__pyx_type___pyx_memoryviewslice;
36382 __Pyx_RefNannyFinishContext();
36385 __Pyx_RefNannyFinishContext();
36389 static int __Pyx_modinit_type_import_code(
void) {
36390 __Pyx_RefNannyDeclarations
36391 PyObject *__pyx_t_1 = NULL;
36392 int __pyx_lineno = 0;
36393 const char *__pyx_filename = NULL;
36394 int __pyx_clineno = 0;
36395 __Pyx_RefNannySetupContext(
"__Pyx_modinit_type_import_code", 0);
36397 __pyx_t_1 = PyImport_ImportModule(__Pyx_BUILTIN_MODULE_NAME);
if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 9, __pyx_L1_error)
36398 __Pyx_GOTREF(__pyx_t_1);
36399 __pyx_ptype_7cpython_4type_type = __Pyx_ImportType(__pyx_t_1, __Pyx_BUILTIN_MODULE_NAME,
"type",
36400 #
if defined(PYPY_VERSION_NUM) && PYPY_VERSION_NUM < 0x050B0000
36401 sizeof(PyTypeObject),
36403 sizeof(PyHeapTypeObject),
36405 __Pyx_ImportType_CheckSize_Warn);
36406 if (!__pyx_ptype_7cpython_4type_type) __PYX_ERR(3, 9, __pyx_L1_error)
36407 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
36408 __pyx_t_1 = PyImport_ImportModule(
"numpy");
if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 200, __pyx_L1_error)
36409 __Pyx_GOTREF(__pyx_t_1);
36410 __pyx_ptype_5numpy_dtype = __Pyx_ImportType(__pyx_t_1,
"numpy",
"dtype",
sizeof(PyArray_Descr), __Pyx_ImportType_CheckSize_Ignore);
36411 if (!__pyx_ptype_5numpy_dtype) __PYX_ERR(2, 200, __pyx_L1_error)
36412 __pyx_ptype_5numpy_flatiter = __Pyx_ImportType(__pyx_t_1,
"numpy",
"flatiter",
sizeof(PyArrayIterObject), __Pyx_ImportType_CheckSize_Ignore);
36413 if (!__pyx_ptype_5numpy_flatiter) __PYX_ERR(2, 223, __pyx_L1_error)
36414 __pyx_ptype_5numpy_broadcast = __Pyx_ImportType(__pyx_t_1,
"numpy",
"broadcast",
sizeof(PyArrayMultiIterObject), __Pyx_ImportType_CheckSize_Ignore);
36415 if (!__pyx_ptype_5numpy_broadcast) __PYX_ERR(2, 227, __pyx_L1_error)
36416 __pyx_ptype_5numpy_ndarray = __Pyx_ImportType(__pyx_t_1,
"numpy",
"ndarray",
sizeof(PyArrayObject), __Pyx_ImportType_CheckSize_Ignore);
36417 if (!__pyx_ptype_5numpy_ndarray) __PYX_ERR(2, 239, __pyx_L1_error)
36418 __pyx_ptype_5numpy_generic = __Pyx_ImportType(__pyx_t_1,
"numpy",
"generic",
sizeof(PyObject), __Pyx_ImportType_CheckSize_Warn);
36419 if (!__pyx_ptype_5numpy_generic) __PYX_ERR(2, 771, __pyx_L1_error)
36420 __pyx_ptype_5numpy_number = __Pyx_ImportType(__pyx_t_1,
"numpy",
"number",
sizeof(PyObject), __Pyx_ImportType_CheckSize_Warn);
36421 if (!__pyx_ptype_5numpy_number) __PYX_ERR(2, 773, __pyx_L1_error)
36422 __pyx_ptype_5numpy_integer = __Pyx_ImportType(__pyx_t_1,
"numpy",
"integer",
sizeof(PyObject), __Pyx_ImportType_CheckSize_Warn);
36423 if (!__pyx_ptype_5numpy_integer) __PYX_ERR(2, 775, __pyx_L1_error)
36424 __pyx_ptype_5numpy_signedinteger = __Pyx_ImportType(__pyx_t_1,
"numpy",
"signedinteger",
sizeof(PyObject), __Pyx_ImportType_CheckSize_Warn);
36425 if (!__pyx_ptype_5numpy_signedinteger) __PYX_ERR(2, 777, __pyx_L1_error)
36426 __pyx_ptype_5numpy_unsignedinteger = __Pyx_ImportType(__pyx_t_1,
"numpy",
"unsignedinteger",
sizeof(PyObject), __Pyx_ImportType_CheckSize_Warn);
36427 if (!__pyx_ptype_5numpy_unsignedinteger) __PYX_ERR(2, 779, __pyx_L1_error)
36428 __pyx_ptype_5numpy_inexact = __Pyx_ImportType(__pyx_t_1,
"numpy",
"inexact",
sizeof(PyObject), __Pyx_ImportType_CheckSize_Warn);
36429 if (!__pyx_ptype_5numpy_inexact) __PYX_ERR(2, 781, __pyx_L1_error)
36430 __pyx_ptype_5numpy_floating = __Pyx_ImportType(__pyx_t_1,
"numpy",
"floating",
sizeof(PyObject), __Pyx_ImportType_CheckSize_Warn);
36431 if (!__pyx_ptype_5numpy_floating) __PYX_ERR(2, 783, __pyx_L1_error)
36432 __pyx_ptype_5numpy_complexfloating = __Pyx_ImportType(__pyx_t_1,
"numpy",
"complexfloating",
sizeof(PyObject), __Pyx_ImportType_CheckSize_Warn);
36433 if (!__pyx_ptype_5numpy_complexfloating) __PYX_ERR(2, 785, __pyx_L1_error)
36434 __pyx_ptype_5numpy_flexible = __Pyx_ImportType(__pyx_t_1,
"numpy",
"flexible",
sizeof(PyObject), __Pyx_ImportType_CheckSize_Warn);
36435 if (!__pyx_ptype_5numpy_flexible) __PYX_ERR(2, 787, __pyx_L1_error)
36436 __pyx_ptype_5numpy_character = __Pyx_ImportType(__pyx_t_1,
"numpy",
"character",
sizeof(PyObject), __Pyx_ImportType_CheckSize_Warn);
36437 if (!__pyx_ptype_5numpy_character) __PYX_ERR(2, 789, __pyx_L1_error)
36438 __pyx_ptype_5numpy_ufunc = __Pyx_ImportType(__pyx_t_1,
"numpy",
"ufunc",
sizeof(PyUFuncObject), __Pyx_ImportType_CheckSize_Ignore);
36439 if (!__pyx_ptype_5numpy_ufunc) __PYX_ERR(2, 827, __pyx_L1_error)
36440 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
36441 __Pyx_RefNannyFinishContext();
36444 __Pyx_XDECREF(__pyx_t_1);
36445 __Pyx_RefNannyFinishContext();
36449 static int __Pyx_modinit_variable_import_code(
void) {
36450 __Pyx_RefNannyDeclarations
36451 __Pyx_RefNannySetupContext(
"__Pyx_modinit_variable_import_code", 0);
36453 __Pyx_RefNannyFinishContext();
36457 static int __Pyx_modinit_function_import_code(
void) {
36458 __Pyx_RefNannyDeclarations
36459 PyObject *__pyx_t_1 = NULL;
36460 int __pyx_lineno = 0;
36461 const char *__pyx_filename = NULL;
36462 int __pyx_clineno = 0;
36463 __Pyx_RefNannySetupContext(
"__Pyx_modinit_function_import_code", 0);
36465 __pyx_t_1 = PyImport_ImportModule(
"proteus.mprans.MeshSmoothing");
if (!__pyx_t_1) __PYX_ERR(0, 1, __pyx_L1_error)
36466 __Pyx_GOTREF(__pyx_t_1);
36467 if (__Pyx_ImportFunction(__pyx_t_1,
"pyxGetLocalNearestNode", (
void (**)(
void))&__pyx_f_7proteus_6mprans_13MeshSmoothing_pyxGetLocalNearestNode,
"int (__Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, int)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
36468 if (__Pyx_ImportFunction(__pyx_t_1,
"pyxGetLocalNearestElementIntersection", (
void (**)(
void))&__pyx_f_7proteus_6mprans_13MeshSmoothing_pyxGetLocalNearestElementIntersection,
"__Pyx_memviewslice (__Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, int)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
36469 if (__Pyx_ImportFunction(__pyx_t_1,
"pyxGetLocalNearestElementAroundNode", (
void (**)(
void))&__pyx_f_7proteus_6mprans_13MeshSmoothing_pyxGetLocalNearestElementAroundNode,
"int (__Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, int)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
36470 if (__Pyx_ImportFunction(__pyx_t_1,
"pyxUpdateElementBoundaryNormalsTetra", (
void (**)(
void))&__pyx_f_7proteus_6mprans_13MeshSmoothing_pyxUpdateElementBoundaryNormalsTetra,
"void (__Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, int)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
36471 if (__Pyx_ImportFunction(__pyx_t_1,
"pyxUpdateElementBoundaryNormalsTriangle", (
void (**)(
void))&__pyx_f_7proteus_6mprans_13MeshSmoothing_pyxUpdateElementBoundaryNormalsTriangle,
"void (__Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, int)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
36472 if (__Pyx_ImportFunction(__pyx_t_1,
"cyCheckOwnedVariable", (
void (**)(
void))&__pyx_f_7proteus_6mprans_13MeshSmoothing_cyCheckOwnedVariable,
"__Pyx_memviewslice (int, int, int, __Pyx_memviewslice, __Pyx_memviewslice)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
36473 if (__Pyx_ImportFunction(__pyx_t_1,
"cyGetGlobalVariable", (
void (**)(
void))&__pyx_f_7proteus_6mprans_13MeshSmoothing_cyGetGlobalVariable,
"__Pyx_memviewslice (int, int, __Pyx_memviewslice, __Pyx_memviewslice)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
36474 if (__Pyx_ImportFunction(__pyx_t_1,
"cyGetLocalVariable", (
void (**)(
void))&__pyx_f_7proteus_6mprans_13MeshSmoothing_cyGetLocalVariable,
"int (int, int, int, __Pyx_memviewslice, __Pyx_memviewslice)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
36475 if (__Pyx_ImportFunction(__pyx_t_1,
"cyFindBoundaryDirectionTriangle", (
void (**)(
void))&__pyx_f_7proteus_6mprans_13MeshSmoothing_cyFindBoundaryDirectionTriangle,
"void (__Pyx_memviewslice, int, __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
36476 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
36477 __Pyx_RefNannyFinishContext();
36480 __Pyx_XDECREF(__pyx_t_1);
36481 __Pyx_RefNannyFinishContext();
36486 #ifndef CYTHON_NO_PYINIT_EXPORT
36487 #define __Pyx_PyMODINIT_FUNC PyMODINIT_FUNC
36488 #elif PY_MAJOR_VERSION < 3
36490 #define __Pyx_PyMODINIT_FUNC extern "C" void
36492 #define __Pyx_PyMODINIT_FUNC void
36496 #define __Pyx_PyMODINIT_FUNC extern "C" PyObject *
36498 #define __Pyx_PyMODINIT_FUNC PyObject *
36503 #if PY_MAJOR_VERSION < 3
36504 __Pyx_PyMODINIT_FUNC initcMoveMeshMonitor(
void) CYTHON_SMALL_CODE;
36505 __Pyx_PyMODINIT_FUNC initcMoveMeshMonitor(
void)
36507 __Pyx_PyMODINIT_FUNC PyInit_cMoveMeshMonitor(
void) CYTHON_SMALL_CODE;
36508 __Pyx_PyMODINIT_FUNC PyInit_cMoveMeshMonitor(
void)
36509 #if CYTHON_PEP489_MULTI_PHASE_INIT
36511 return PyModuleDef_Init(&__pyx_moduledef);
36513 static CYTHON_SMALL_CODE
int __Pyx_check_single_interpreter(
void) {
36514 #if PY_VERSION_HEX >= 0x030700A1
36515 static PY_INT64_T main_interpreter_id = -1;
36516 PY_INT64_T current_id = PyInterpreterState_GetID(PyThreadState_Get()->interp);
36517 if (main_interpreter_id == -1) {
36518 main_interpreter_id = current_id;
36519 return (unlikely(current_id == -1)) ? -1 : 0;
36520 }
else if (unlikely(main_interpreter_id != current_id))
36522 static PyInterpreterState *main_interpreter = NULL;
36523 PyInterpreterState *current_interpreter = PyThreadState_Get()->interp;
36524 if (!main_interpreter) {
36525 main_interpreter = current_interpreter;
36526 }
else if (unlikely(main_interpreter != current_interpreter))
36531 "Interpreter change detected - this module can only be loaded into one interpreter per process.");
36536 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) {
36537 PyObject *value = PyObject_GetAttrString(spec, from_name);
36539 if (likely(value)) {
36540 if (allow_none || value != Py_None) {
36541 result = PyDict_SetItemString(moddict, to_name, value);
36544 }
else if (PyErr_ExceptionMatches(PyExc_AttributeError)) {
36551 static CYTHON_SMALL_CODE PyObject* __pyx_pymod_create(PyObject *spec, CYTHON_UNUSED PyModuleDef *def) {
36552 PyObject *module = NULL, *moddict, *modname;
36553 if (__Pyx_check_single_interpreter())
36556 return __Pyx_NewRef(__pyx_m);
36557 modname = PyObject_GetAttrString(spec,
"name");
36558 if (unlikely(!modname))
goto bad;
36559 module = PyModule_NewObject(modname);
36560 Py_DECREF(modname);
36561 if (unlikely(!module))
goto bad;
36562 moddict = PyModule_GetDict(module);
36563 if (unlikely(!moddict))
goto bad;
36564 if (unlikely(__Pyx_copy_spec_to_module(spec, moddict,
"loader",
"__loader__", 1) < 0))
goto bad;
36565 if (unlikely(__Pyx_copy_spec_to_module(spec, moddict,
"origin",
"__file__", 1) < 0))
goto bad;
36566 if (unlikely(__Pyx_copy_spec_to_module(spec, moddict,
"parent",
"__package__", 1) < 0))
goto bad;
36567 if (unlikely(__Pyx_copy_spec_to_module(spec, moddict,
"submodule_search_locations",
"__path__", 0) < 0))
goto bad;
36570 Py_XDECREF(module);
36575 static CYTHON_SMALL_CODE
int __pyx_pymod_exec_cMoveMeshMonitor(PyObject *__pyx_pyinit_module)
36579 PyObject *__pyx_t_1 = NULL;
36580 PyObject *__pyx_t_2 = NULL;
36581 static PyThread_type_lock __pyx_t_3[8];
36582 int __pyx_lineno = 0;
36583 const char *__pyx_filename = NULL;
36584 int __pyx_clineno = 0;
36585 __Pyx_RefNannyDeclarations
36586 #if CYTHON_PEP489_MULTI_PHASE_INIT
36588 if (__pyx_m == __pyx_pyinit_module)
return 0;
36589 PyErr_SetString(PyExc_RuntimeError,
"Module 'cMoveMeshMonitor' has already been imported. Re-initialisation is not supported.");
36592 #elif PY_MAJOR_VERSION >= 3
36593 if (__pyx_m)
return __Pyx_NewRef(__pyx_m);
36595 #if CYTHON_REFNANNY
36596 __Pyx_RefNanny = __Pyx_RefNannyImportAPI(
"refnanny");
36597 if (!__Pyx_RefNanny) {
36599 __Pyx_RefNanny = __Pyx_RefNannyImportAPI(
"Cython.Runtime.refnanny");
36600 if (!__Pyx_RefNanny)
36601 Py_FatalError(
"failed to import 'refnanny' module");
36604 __Pyx_RefNannySetupContext(
"__Pyx_PyMODINIT_FUNC PyInit_cMoveMeshMonitor(void)", 0);
36605 if (__Pyx_check_binary_version() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
36606 #ifdef __Pxy_PyFrame_Initialize_Offsets
36607 __Pxy_PyFrame_Initialize_Offsets();
36609 __pyx_empty_tuple = PyTuple_New(0);
if (unlikely(!__pyx_empty_tuple)) __PYX_ERR(0, 1, __pyx_L1_error)
36610 __pyx_empty_bytes = PyBytes_FromStringAndSize(
"", 0);
if (unlikely(!__pyx_empty_bytes)) __PYX_ERR(0, 1, __pyx_L1_error)
36611 __pyx_empty_unicode = PyUnicode_FromStringAndSize(
"", 0);
if (unlikely(!__pyx_empty_unicode)) __PYX_ERR(0, 1, __pyx_L1_error)
36612 #ifdef __Pyx_CyFunction_USED
36613 if (__pyx_CyFunction_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
36615 #ifdef __Pyx_FusedFunction_USED
36616 if (__pyx_FusedFunction_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
36618 #ifdef __Pyx_Coroutine_USED
36619 if (__pyx_Coroutine_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
36621 #ifdef __Pyx_Generator_USED
36622 if (__pyx_Generator_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
36624 #ifdef __Pyx_AsyncGen_USED
36625 if (__pyx_AsyncGen_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
36627 #ifdef __Pyx_StopAsyncIteration_USED
36628 if (__pyx_StopAsyncIteration_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
36632 #if defined(WITH_THREAD) && PY_VERSION_HEX < 0x030700F0 && defined(__PYX_FORCE_INIT_THREADS) && __PYX_FORCE_INIT_THREADS
36633 PyEval_InitThreads();
36636 #if CYTHON_PEP489_MULTI_PHASE_INIT
36637 __pyx_m = __pyx_pyinit_module;
36638 Py_INCREF(__pyx_m);
36640 #if PY_MAJOR_VERSION < 3
36641 __pyx_m = Py_InitModule4(
"cMoveMeshMonitor", __pyx_methods, 0, 0, PYTHON_API_VERSION); Py_XINCREF(__pyx_m);
36643 __pyx_m = PyModule_Create(&__pyx_moduledef);
36645 if (unlikely(!__pyx_m)) __PYX_ERR(0, 1, __pyx_L1_error)
36647 __pyx_d = PyModule_GetDict(__pyx_m);
if (unlikely(!__pyx_d)) __PYX_ERR(0, 1, __pyx_L1_error)
36648 Py_INCREF(__pyx_d);
36649 __pyx_b = PyImport_AddModule(__Pyx_BUILTIN_MODULE_NAME);
if (unlikely(!__pyx_b)) __PYX_ERR(0, 1, __pyx_L1_error)
36650 Py_INCREF(__pyx_b);
36651 __pyx_cython_runtime = PyImport_AddModule((
char *)
"cython_runtime");
if (unlikely(!__pyx_cython_runtime)) __PYX_ERR(0, 1, __pyx_L1_error)
36652 Py_INCREF(__pyx_cython_runtime);
36653 if (PyObject_SetAttrString(__pyx_m,
"__builtins__", __pyx_b) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
36655 if (__Pyx_InitGlobals() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
36656 #if PY_MAJOR_VERSION < 3 && (__PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT)
36657 if (__Pyx_init_sys_getdefaultencoding_params() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
36659 if (__pyx_module_is_main_mprans__cMoveMeshMonitor) {
36660 if (PyObject_SetAttr(__pyx_m, __pyx_n_s_name_2, __pyx_n_s_main) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
36662 #if PY_MAJOR_VERSION >= 3
36664 PyObject *modules = PyImport_GetModuleDict();
if (unlikely(!modules)) __PYX_ERR(0, 1, __pyx_L1_error)
36665 if (!PyDict_GetItemString(modules,
"mprans.cMoveMeshMonitor")) {
36666 if (unlikely(PyDict_SetItemString(modules,
"mprans.cMoveMeshMonitor", __pyx_m) < 0)) __PYX_ERR(0, 1, __pyx_L1_error)
36671 if (__Pyx_InitCachedBuiltins() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
36673 if (__Pyx_InitCachedConstants() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
36675 (void)__Pyx_modinit_global_init_code();
36676 (void)__Pyx_modinit_variable_export_code();
36677 (void)__Pyx_modinit_function_export_code();
36678 if (unlikely(__Pyx_modinit_type_init_code() < 0)) __PYX_ERR(0, 1, __pyx_L1_error)
36679 if (unlikely(__Pyx_modinit_type_import_code() < 0)) __PYX_ERR(0, 1, __pyx_L1_error)
36680 (void)__Pyx_modinit_variable_import_code();
36681 if (unlikely(__Pyx_modinit_function_import_code() < 0)) __PYX_ERR(0, 1, __pyx_L1_error)
36683 #if defined(__Pyx_Generator_USED) || defined(__Pyx_Coroutine_USED)
36684 if (__Pyx_patch_abc() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
36694 __pyx_t_1 = __Pyx_Import(__pyx_n_s_numpy, 0, -1);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 5, __pyx_L1_error)
36695 __Pyx_GOTREF(__pyx_t_1);
36696 if (PyDict_SetItem(__pyx_d, __pyx_n_s_np, __pyx_t_1) < 0) __PYX_ERR(0, 5, __pyx_L1_error)
36697 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
36706 __pyx_t_1 = PyList_New(1);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 8, __pyx_L1_error)
36707 __Pyx_GOTREF(__pyx_t_1);
36708 __Pyx_INCREF(__pyx_n_s_logEvent);
36709 __Pyx_GIVEREF(__pyx_n_s_logEvent);
36710 PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_s_logEvent);
36711 __pyx_t_2 = __Pyx_Import(__pyx_n_s_proteus_Profiling, __pyx_t_1, -1);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 8, __pyx_L1_error)
36712 __Pyx_GOTREF(__pyx_t_2);
36713 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
36714 __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_logEvent);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 8, __pyx_L1_error)
36715 __Pyx_GOTREF(__pyx_t_1);
36716 if (PyDict_SetItem(__pyx_d, __pyx_n_s_logEvent, __pyx_t_1) < 0) __PYX_ERR(0, 8, __pyx_L1_error)
36717 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
36718 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
36727 __pyx_t_2 = PyList_New(1);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 9, __pyx_L1_error)
36728 __Pyx_GOTREF(__pyx_t_2);
36729 __Pyx_INCREF(__pyx_n_s_MeshSmoothing);
36730 __Pyx_GIVEREF(__pyx_n_s_MeshSmoothing);
36731 PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_MeshSmoothing);
36732 __pyx_t_1 = __Pyx_Import(__pyx_n_s_proteus_mprans, __pyx_t_2, -1);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 9, __pyx_L1_error)
36733 __Pyx_GOTREF(__pyx_t_1);
36734 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
36735 __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_1, __pyx_n_s_MeshSmoothing);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 9, __pyx_L1_error)
36736 __Pyx_GOTREF(__pyx_t_2);
36737 if (PyDict_SetItem(__pyx_d, __pyx_n_s_ms, __pyx_t_2) < 0) __PYX_ERR(0, 9, __pyx_L1_error)
36738 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
36739 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
36748 __pyx_t_1 = PyList_New(1);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 11, __pyx_L1_error)
36749 __Pyx_GOTREF(__pyx_t_1);
36750 __Pyx_INCREF(__pyx_n_s_Comm);
36751 __Pyx_GIVEREF(__pyx_n_s_Comm);
36752 PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_s_Comm);
36753 __pyx_t_2 = __Pyx_Import(__pyx_n_s_proteus, __pyx_t_1, -1);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 11, __pyx_L1_error)
36754 __Pyx_GOTREF(__pyx_t_2);
36755 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
36756 __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_Comm);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 11, __pyx_L1_error)
36757 __Pyx_GOTREF(__pyx_t_1);
36758 if (PyDict_SetItem(__pyx_d, __pyx_n_s_Comm, __pyx_t_1) < 0) __PYX_ERR(0, 11, __pyx_L1_error)
36759 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
36760 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
36769 __pyx_t_2 = PyList_New(1);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 12, __pyx_L1_error)
36770 __Pyx_GOTREF(__pyx_t_2);
36771 __Pyx_INCREF(__pyx_n_s_MPI);
36772 __Pyx_GIVEREF(__pyx_n_s_MPI);
36773 PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_MPI);
36774 __pyx_t_1 = __Pyx_Import(__pyx_n_s_mpi4py, __pyx_t_2, -1);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 12, __pyx_L1_error)
36775 __Pyx_GOTREF(__pyx_t_1);
36776 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
36777 __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_1, __pyx_n_s_MPI);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 12, __pyx_L1_error)
36778 __Pyx_GOTREF(__pyx_t_2);
36779 if (PyDict_SetItem(__pyx_d, __pyx_n_s_MPI, __pyx_t_2) < 0) __PYX_ERR(0, 12, __pyx_L1_error)
36780 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
36781 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
36790 __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_6mprans_16cMoveMeshMonitor_1recoveryAtNodes, NULL, __pyx_n_s_mprans_cMoveMeshMonitor);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 944, __pyx_L1_error)
36791 __Pyx_GOTREF(__pyx_t_1);
36792 if (PyDict_SetItem(__pyx_d, __pyx_n_s_recoveryAtNodes, __pyx_t_1) < 0) __PYX_ERR(0, 944, __pyx_L1_error)
36793 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
36802 __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_6mprans_16cMoveMeshMonitor_3recoveryAtNodesWeighted, NULL, __pyx_n_s_mprans_cMoveMeshMonitor);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 971, __pyx_L1_error)
36803 __Pyx_GOTREF(__pyx_t_1);
36804 if (PyDict_SetItem(__pyx_d, __pyx_n_s_recoveryAtNodesWeighted, __pyx_t_1) < 0) __PYX_ERR(0, 971, __pyx_L1_error)
36805 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
36814 __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_6mprans_16cMoveMeshMonitor_5gradientRecoveryAtNodes, NULL, __pyx_n_s_mprans_cMoveMeshMonitor);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1012, __pyx_L1_error)
36815 __Pyx_GOTREF(__pyx_t_1);
36816 if (PyDict_SetItem(__pyx_d, __pyx_n_s_gradientRecoveryAtNodes, __pyx_t_1) < 0) __PYX_ERR(0, 1012, __pyx_L1_error)
36817 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
36826 __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_6mprans_16cMoveMeshMonitor_7gradientRecoveryAtNodesWeighted, NULL, __pyx_n_s_mprans_cMoveMeshMonitor);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1046, __pyx_L1_error)
36827 __Pyx_GOTREF(__pyx_t_1);
36828 if (PyDict_SetItem(__pyx_d, __pyx_n_s_gradientRecoveryAtNodesWeighted, __pyx_t_1) < 0) __PYX_ERR(0, 1046, __pyx_L1_error)
36829 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
36838 __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_6mprans_16cMoveMeshMonitor_9pyCheckOwnedVariable, NULL, __pyx_n_s_mprans_cMoveMeshMonitor);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1171, __pyx_L1_error)
36839 __Pyx_GOTREF(__pyx_t_1);
36840 if (PyDict_SetItem(__pyx_d, __pyx_n_s_pyCheckOwnedVariable, __pyx_t_1) < 0) __PYX_ERR(0, 1171, __pyx_L1_error)
36841 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
36848 __pyx_t_1 = __Pyx_PyDict_NewPresized(0);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1, __pyx_L1_error)
36849 __Pyx_GOTREF(__pyx_t_1);
36850 if (PyDict_SetItem(__pyx_d, __pyx_n_s_test, __pyx_t_1) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
36851 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
36860 __pyx_t_1 = __pyx_capsule_create(((
void *)(&__pyx_array_getbuffer)), ((
char *)
"getbuffer(obj, view, flags)"));
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 209, __pyx_L1_error)
36861 __Pyx_GOTREF(__pyx_t_1);
36862 if (PyDict_SetItem((PyObject *)__pyx_array_type->tp_dict, __pyx_n_s_pyx_getbuffer, __pyx_t_1) < 0) __PYX_ERR(1, 209, __pyx_L1_error)
36863 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
36864 PyType_Modified(__pyx_array_type);
36873 __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)__pyx_MemviewEnum_type), __pyx_tuple__46, NULL);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 286, __pyx_L1_error)
36874 __Pyx_GOTREF(__pyx_t_1);
36875 __Pyx_XGOTREF(
generic);
36876 __Pyx_DECREF_SET(
generic, __pyx_t_1);
36877 __Pyx_GIVEREF(__pyx_t_1);
36887 __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)__pyx_MemviewEnum_type), __pyx_tuple__47, NULL);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 287, __pyx_L1_error)
36888 __Pyx_GOTREF(__pyx_t_1);
36889 __Pyx_XGOTREF(strided);
36890 __Pyx_DECREF_SET(strided, __pyx_t_1);
36891 __Pyx_GIVEREF(__pyx_t_1);
36901 __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)__pyx_MemviewEnum_type), __pyx_tuple__48, NULL);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 288, __pyx_L1_error)
36902 __Pyx_GOTREF(__pyx_t_1);
36903 __Pyx_XGOTREF(indirect);
36904 __Pyx_DECREF_SET(indirect, __pyx_t_1);
36905 __Pyx_GIVEREF(__pyx_t_1);
36915 __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)__pyx_MemviewEnum_type), __pyx_tuple__49, NULL);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 291, __pyx_L1_error)
36916 __Pyx_GOTREF(__pyx_t_1);
36917 __Pyx_XGOTREF(contiguous);
36918 __Pyx_DECREF_SET(contiguous, __pyx_t_1);
36919 __Pyx_GIVEREF(__pyx_t_1);
36929 __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)__pyx_MemviewEnum_type), __pyx_tuple__50, NULL);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 292, __pyx_L1_error)
36930 __Pyx_GOTREF(__pyx_t_1);
36931 __Pyx_XGOTREF(indirect_contiguous);
36932 __Pyx_DECREF_SET(indirect_contiguous, __pyx_t_1);
36933 __Pyx_GIVEREF(__pyx_t_1);
36943 __pyx_memoryview_thread_locks_used = 0;
36952 __pyx_t_3[0] = PyThread_allocate_lock();
36953 __pyx_t_3[1] = PyThread_allocate_lock();
36954 __pyx_t_3[2] = PyThread_allocate_lock();
36955 __pyx_t_3[3] = PyThread_allocate_lock();
36956 __pyx_t_3[4] = PyThread_allocate_lock();
36957 __pyx_t_3[5] = PyThread_allocate_lock();
36958 __pyx_t_3[6] = PyThread_allocate_lock();
36959 __pyx_t_3[7] = PyThread_allocate_lock();
36960 memcpy(&(__pyx_memoryview_thread_locks[0]), __pyx_t_3,
sizeof(__pyx_memoryview_thread_locks[0]) * (8));
36969 __pyx_t_1 = __pyx_capsule_create(((
void *)(&__pyx_memoryview_getbuffer)), ((
char *)
"getbuffer(obj, view, flags)"));
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 549, __pyx_L1_error)
36970 __Pyx_GOTREF(__pyx_t_1);
36971 if (PyDict_SetItem((PyObject *)__pyx_memoryview_type->tp_dict, __pyx_n_s_pyx_getbuffer, __pyx_t_1) < 0) __PYX_ERR(1, 549, __pyx_L1_error)
36972 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
36973 PyType_Modified(__pyx_memoryview_type);
36982 __pyx_t_1 = __pyx_capsule_create(((
void *)(&__pyx_memoryview_getbuffer)), ((
char *)
"getbuffer(obj, view, flags)"));
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 995, __pyx_L1_error)
36983 __Pyx_GOTREF(__pyx_t_1);
36984 if (PyDict_SetItem((PyObject *)__pyx_memoryviewslice_type->tp_dict, __pyx_n_s_pyx_getbuffer, __pyx_t_1) < 0) __PYX_ERR(1, 995, __pyx_L1_error)
36985 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
36986 PyType_Modified(__pyx_memoryviewslice_type);
36993 __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_15View_dot_MemoryView_1__pyx_unpickle_Enum, NULL, __pyx_n_s_View_MemoryView);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1, __pyx_L1_error)
36994 __Pyx_GOTREF(__pyx_t_1);
36995 if (PyDict_SetItem(__pyx_d, __pyx_n_s_pyx_unpickle_Enum, __pyx_t_1) < 0) __PYX_ERR(1, 1, __pyx_L1_error)
36996 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
37010 __Pyx_XDECREF(__pyx_t_1);
37011 __Pyx_XDECREF(__pyx_t_2);
37014 __Pyx_AddTraceback(
"init mprans.cMoveMeshMonitor", __pyx_clineno, __pyx_lineno, __pyx_filename);
37017 }
else if (!PyErr_Occurred()) {
37018 PyErr_SetString(PyExc_ImportError,
"init mprans.cMoveMeshMonitor");
37021 __Pyx_RefNannyFinishContext();
37022 #if CYTHON_PEP489_MULTI_PHASE_INIT
37023 return (__pyx_m != NULL) ? 0 : -1;
37024 #elif PY_MAJOR_VERSION >= 3
37033 #if CYTHON_REFNANNY
37034 static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(
const char *modname) {
37035 PyObject *m = NULL, *p = NULL;
37037 m = PyImport_ImportModule(modname);
37039 p = PyObject_GetAttrString(m,
"RefNannyAPI");
37041 r = PyLong_AsVoidPtr(p);
37045 return (__Pyx_RefNannyAPIStruct *)
r;
37050 #if CYTHON_USE_TYPE_SLOTS
37051 static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name) {
37052 PyTypeObject* tp = Py_TYPE(obj);
37053 if (likely(tp->tp_getattro))
37054 return tp->tp_getattro(obj, attr_name);
37055 #if PY_MAJOR_VERSION < 3
37056 if (likely(tp->tp_getattr))
37057 return tp->tp_getattr(obj, PyString_AS_STRING(attr_name));
37059 return PyObject_GetAttr(obj, attr_name);
37064 static PyObject *__Pyx_GetBuiltinName(PyObject *name) {
37065 PyObject* result = __Pyx_PyObject_GetAttrStr(__pyx_b, name);
37066 if (unlikely(!result)) {
37067 PyErr_Format(PyExc_NameError,
37068 #
if PY_MAJOR_VERSION >= 3
37069 "name '%U' is not defined", name);
37071 "name '%.200s' is not defined", PyString_AS_STRING(name));
37078 static void __Pyx_RaiseArgtupleInvalid(
37079 const char* func_name,
37081 Py_ssize_t num_min,
37082 Py_ssize_t num_max,
37083 Py_ssize_t num_found)
37085 Py_ssize_t num_expected;
37086 const char *more_or_less;
37087 if (num_found < num_min) {
37088 num_expected = num_min;
37089 more_or_less =
"at least";
37091 num_expected = num_max;
37092 more_or_less =
"at most";
37095 more_or_less =
"exactly";
37097 PyErr_Format(PyExc_TypeError,
37098 "%.200s() takes %.8s %" CYTHON_FORMAT_SSIZE_T
"d positional argument%.1s (%" CYTHON_FORMAT_SSIZE_T
"d given)",
37099 func_name, more_or_less, num_expected,
37100 (num_expected == 1) ?
"" :
"s", num_found);
37104 static int __Pyx_CheckKeywordStrings(
37106 const char* function_name,
37110 Py_ssize_t
pos = 0;
37111 #if CYTHON_COMPILING_IN_PYPY
37112 if (!kw_allowed && PyDict_Next(kwdict, &
pos, &key, 0))
37113 goto invalid_keyword;
37116 while (PyDict_Next(kwdict, &
pos, &key, 0)) {
37117 #if PY_MAJOR_VERSION < 3
37118 if (unlikely(!PyString_Check(key)))
37120 if (unlikely(!PyUnicode_Check(key)))
37121 goto invalid_keyword_type;
37123 if ((!kw_allowed) && unlikely(key))
37124 goto invalid_keyword;
37126 invalid_keyword_type:
37127 PyErr_Format(PyExc_TypeError,
37128 "%.200s() keywords must be strings", function_name);
37132 PyErr_Format(PyExc_TypeError,
37133 #
if PY_MAJOR_VERSION < 3
37134 "%.200s() got an unexpected keyword argument '%.200s'",
37135 function_name, PyString_AsString(key));
37137 "%s() got an unexpected keyword argument '%U'",
37138 function_name, key);
37144 #if PY_MAJOR_VERSION >= 3 && !CYTHON_COMPILING_IN_PYPY
37145 static PyObject *__Pyx_PyDict_GetItem(PyObject *d, PyObject* key) {
37147 value = PyDict_GetItemWithError(d, key);
37148 if (unlikely(!value)) {
37149 if (!PyErr_Occurred()) {
37150 if (unlikely(PyTuple_Check(key))) {
37151 PyObject* args = PyTuple_Pack(1, key);
37152 if (likely(args)) {
37153 PyErr_SetObject(PyExc_KeyError, args);
37157 PyErr_SetObject(PyExc_KeyError, key);
37168 static PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j) {
37170 if (!j)
return NULL;
37171 r = PyObject_GetItem(o, j);
37175 static CYTHON_INLINE PyObject *__Pyx_GetItemInt_List_Fast(PyObject *o, Py_ssize_t i,
37176 CYTHON_NCP_UNUSED
int wraparound,
37177 CYTHON_NCP_UNUSED
int boundscheck) {
37178 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
37179 Py_ssize_t wrapped_i = i;
37180 if (wraparound & unlikely(i < 0)) {
37181 wrapped_i += PyList_GET_SIZE(o);
37183 if ((!boundscheck) || likely(__Pyx_is_valid_index(wrapped_i, PyList_GET_SIZE(o)))) {
37184 PyObject *
r = PyList_GET_ITEM(o, wrapped_i);
37188 return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i));
37190 return PySequence_GetItem(o, i);
37193 static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize_t i,
37194 CYTHON_NCP_UNUSED
int wraparound,
37195 CYTHON_NCP_UNUSED
int boundscheck) {
37196 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
37197 Py_ssize_t wrapped_i = i;
37198 if (wraparound & unlikely(i < 0)) {
37199 wrapped_i += PyTuple_GET_SIZE(o);
37201 if ((!boundscheck) || likely(__Pyx_is_valid_index(wrapped_i, PyTuple_GET_SIZE(o)))) {
37202 PyObject *
r = PyTuple_GET_ITEM(o, wrapped_i);
37206 return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i));
37208 return PySequence_GetItem(o, i);
37211 static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i,
int is_list,
37212 CYTHON_NCP_UNUSED
int wraparound,
37213 CYTHON_NCP_UNUSED
int boundscheck) {
37214 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS && CYTHON_USE_TYPE_SLOTS
37215 if (is_list || PyList_CheckExact(o)) {
37216 Py_ssize_t
n = ((!wraparound) | likely(i >= 0)) ? i : i + PyList_GET_SIZE(o);
37217 if ((!boundscheck) || (likely(__Pyx_is_valid_index(
n, PyList_GET_SIZE(o))))) {
37218 PyObject *
r = PyList_GET_ITEM(o,
n);
37223 else if (PyTuple_CheckExact(o)) {
37224 Py_ssize_t
n = ((!wraparound) | likely(i >= 0)) ? i : i + PyTuple_GET_SIZE(o);
37225 if ((!boundscheck) || likely(__Pyx_is_valid_index(
n, PyTuple_GET_SIZE(o)))) {
37226 PyObject *
r = PyTuple_GET_ITEM(o,
n);
37231 PySequenceMethods *m = Py_TYPE(o)->tp_as_sequence;
37232 if (likely(m && m->sq_item)) {
37233 if (wraparound && unlikely(i < 0) && likely(m->sq_length)) {
37234 Py_ssize_t l = m->sq_length(o);
37235 if (likely(l >= 0)) {
37238 if (!PyErr_ExceptionMatches(PyExc_OverflowError))
37243 return m->sq_item(o, i);
37247 if (is_list || PySequence_Check(o)) {
37248 return PySequence_GetItem(o, i);
37251 return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i));
37255 #if CYTHON_USE_TYPE_SLOTS
37256 static PyObject *__Pyx_PyObject_GetIndex(PyObject *obj, PyObject* index) {
37258 Py_ssize_t key_value;
37259 PySequenceMethods *m = Py_TYPE(obj)->tp_as_sequence;
37260 if (unlikely(!(m && m->sq_item))) {
37261 PyErr_Format(PyExc_TypeError,
"'%.200s' object is not subscriptable", Py_TYPE(obj)->tp_name);
37264 key_value = __Pyx_PyIndex_AsSsize_t(index);
37265 if (likely(key_value != -1 || !(runerr = PyErr_Occurred()))) {
37266 return __Pyx_GetItemInt_Fast(obj, key_value, 0, 1, 1);
37268 if (PyErr_GivenExceptionMatches(runerr, PyExc_OverflowError)) {
37270 PyErr_Format(PyExc_IndexError,
"cannot fit '%.200s' into an index-sized integer", Py_TYPE(index)->tp_name);
37274 static PyObject *__Pyx_PyObject_GetItem(PyObject *obj, PyObject* key) {
37275 PyMappingMethods *m = Py_TYPE(obj)->tp_as_mapping;
37276 if (likely(m && m->mp_subscript)) {
37277 return m->mp_subscript(obj, key);
37279 return __Pyx_PyObject_GetIndex(obj, key);
37285 __Pyx_init_memviewslice(
struct __pyx_memoryview_obj *memview,
37287 __Pyx_memviewslice *memviewslice,
37288 int memview_is_new_reference)
37290 __Pyx_RefNannyDeclarations
37292 Py_buffer *buf = &memview->view;
37293 __Pyx_RefNannySetupContext(
"init_memviewslice", 0);
37294 if (unlikely(memviewslice->memview || memviewslice->data)) {
37295 PyErr_SetString(PyExc_ValueError,
37296 "memviewslice is already initialized!");
37299 if (buf->strides) {
37300 for (i = 0; i < ndim; i++) {
37301 memviewslice->strides[i] = buf->strides[i];
37304 Py_ssize_t stride = buf->itemsize;
37305 for (i = ndim - 1; i >= 0; i--) {
37306 memviewslice->strides[i] = stride;
37307 stride *= buf->shape[i];
37310 for (i = 0; i < ndim; i++) {
37311 memviewslice->shape[i] = buf->shape[i];
37312 if (buf->suboffsets) {
37313 memviewslice->suboffsets[i] = buf->suboffsets[i];
37315 memviewslice->suboffsets[i] = -1;
37318 memviewslice->memview = memview;
37319 memviewslice->data = (
char *)buf->buf;
37320 if (__pyx_add_acquisition_count(memview) == 0 && !memview_is_new_reference) {
37321 Py_INCREF(memview);
37326 memviewslice->memview = 0;
37327 memviewslice->data = 0;
37330 __Pyx_RefNannyFinishContext();
37333 #ifndef Py_NO_RETURN
37334 #define Py_NO_RETURN
37336 static void __pyx_fatalerror(
const char *fmt, ...) Py_NO_RETURN {
37339 #ifdef HAVE_STDARG_PROTOTYPES
37340 va_start(vargs, fmt);
37344 vsnprintf(msg, 200, fmt, vargs);
37346 Py_FatalError(msg);
37348 static CYTHON_INLINE
int
37349 __pyx_add_acquisition_count_locked(__pyx_atomic_int *acquisition_count,
37350 PyThread_type_lock lock)
37353 PyThread_acquire_lock(lock, 1);
37354 result = (*acquisition_count)++;
37355 PyThread_release_lock(lock);
37358 static CYTHON_INLINE
int
37359 __pyx_sub_acquisition_count_locked(__pyx_atomic_int *acquisition_count,
37360 PyThread_type_lock lock)
37363 PyThread_acquire_lock(lock, 1);
37364 result = (*acquisition_count)--;
37365 PyThread_release_lock(lock);
37368 static CYTHON_INLINE
void
37369 __Pyx_INC_MEMVIEW(__Pyx_memviewslice *memslice,
int have_gil,
int lineno)
37372 struct __pyx_memoryview_obj *memview = memslice->memview;
37373 if (unlikely(!memview || (PyObject *) memview == Py_None))
37375 if (unlikely(__pyx_get_slice_count(memview) < 0))
37376 __pyx_fatalerror(
"Acquisition count is %d (line %d)",
37377 __pyx_get_slice_count(memview), lineno);
37378 first_time = __pyx_add_acquisition_count(memview) == 0;
37379 if (unlikely(first_time)) {
37381 Py_INCREF((PyObject *) memview);
37383 PyGILState_STATE _gilstate = PyGILState_Ensure();
37384 Py_INCREF((PyObject *) memview);
37385 PyGILState_Release(_gilstate);
37389 static CYTHON_INLINE
void __Pyx_XDEC_MEMVIEW(__Pyx_memviewslice *memslice,
37390 int have_gil,
int lineno) {
37392 struct __pyx_memoryview_obj *memview = memslice->memview;
37393 if (unlikely(!memview || (PyObject *) memview == Py_None)) {
37394 memslice->memview = NULL;
37397 if (unlikely(__pyx_get_slice_count(memview) <= 0))
37398 __pyx_fatalerror(
"Acquisition count is %d (line %d)",
37399 __pyx_get_slice_count(memview), lineno);
37400 last_time = __pyx_sub_acquisition_count(memview) == 1;
37401 memslice->data = NULL;
37402 if (unlikely(last_time)) {
37404 Py_CLEAR(memslice->memview);
37406 PyGILState_STATE _gilstate = PyGILState_Ensure();
37407 Py_CLEAR(memslice->memview);
37408 PyGILState_Release(_gilstate);
37411 memslice->memview = NULL;
37416 #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_TYPE_SLOTS
37417 static CYTHON_INLINE PY_UINT64_T __Pyx_get_tp_dict_version(PyObject *obj) {
37418 PyObject *dict = Py_TYPE(obj)->tp_dict;
37419 return likely(dict) ? __PYX_GET_DICT_VERSION(dict) : 0;
37421 static CYTHON_INLINE PY_UINT64_T __Pyx_get_object_dict_version(PyObject *obj) {
37422 PyObject **dictptr = NULL;
37423 Py_ssize_t offset = Py_TYPE(obj)->tp_dictoffset;
37425 #if CYTHON_COMPILING_IN_CPYTHON
37426 dictptr = (likely(offset > 0)) ? (PyObject **) ((
char *)obj + offset) : _PyObject_GetDictPtr(obj);
37428 dictptr = _PyObject_GetDictPtr(obj);
37431 return (dictptr && *dictptr) ? __PYX_GET_DICT_VERSION(*dictptr) : 0;
37433 static CYTHON_INLINE
int __Pyx_object_dict_version_matches(PyObject* obj, PY_UINT64_T tp_dict_version, PY_UINT64_T obj_dict_version) {
37434 PyObject *dict = Py_TYPE(obj)->tp_dict;
37435 if (unlikely(!dict) || unlikely(tp_dict_version != __PYX_GET_DICT_VERSION(dict)))
37437 return obj_dict_version == __Pyx_get_object_dict_version(obj);
37442 #if CYTHON_USE_DICT_VERSIONS
37443 static PyObject *__Pyx__GetModuleGlobalName(PyObject *name, PY_UINT64_T *dict_version, PyObject **dict_cached_value)
37445 static CYTHON_INLINE PyObject *__Pyx__GetModuleGlobalName(PyObject *name)
37449 #if !CYTHON_AVOID_BORROWED_REFS
37450 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030500A1
37451 result = _PyDict_GetItem_KnownHash(__pyx_d, name, ((PyASCIIObject *) name)->hash);
37452 __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version)
37453 if (likely(result)) {
37454 return __Pyx_NewRef(result);
37455 }
else if (unlikely(PyErr_Occurred())) {
37459 result = PyDict_GetItem(__pyx_d, name);
37460 __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version)
37461 if (likely(result)) {
37462 return __Pyx_NewRef(result);
37466 result = PyObject_GetItem(__pyx_d, name);
37467 __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version)
37468 if (likely(result)) {
37469 return __Pyx_NewRef(result);
37473 return __Pyx_GetBuiltinName(name);
37477 #if CYTHON_FAST_PYCALL
37478 static PyObject* __Pyx_PyFunction_FastCallNoKw(PyCodeObject *co, PyObject **args, Py_ssize_t na,
37479 PyObject *globals) {
37481 PyThreadState *tstate = __Pyx_PyThreadState_Current;
37482 PyObject **fastlocals;
37485 assert(globals != NULL);
37490 assert(tstate != NULL);
37491 f = PyFrame_New(tstate, co, globals, NULL);
37495 fastlocals = __Pyx_PyFrame_GetLocalsplus(
f);
37496 for (i = 0; i < na; i++) {
37498 fastlocals[i] = *args++;
37500 result = PyEval_EvalFrameEx(
f,0);
37501 ++tstate->recursion_depth;
37503 --tstate->recursion_depth;
37506 #if 1 || PY_VERSION_HEX < 0x030600B1
37507 static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args, Py_ssize_t nargs, PyObject *kwargs) {
37508 PyCodeObject *co = (PyCodeObject *)PyFunction_GET_CODE(func);
37509 PyObject *globals = PyFunction_GET_GLOBALS(func);
37510 PyObject *argdefs = PyFunction_GET_DEFAULTS(func);
37512 #if PY_MAJOR_VERSION >= 3
37515 PyObject *kwtuple, **k;
37520 assert(kwargs == NULL || PyDict_Check(kwargs));
37521 nk = kwargs ? PyDict_Size(kwargs) : 0;
37522 if (Py_EnterRecursiveCall((
char*)
" while calling a Python object")) {
37526 #
if PY_MAJOR_VERSION >= 3
37527 co->co_kwonlyargcount == 0 &&
37529 likely(kwargs == NULL || nk == 0) &&
37530 co->co_flags == (CO_OPTIMIZED | CO_NEWLOCALS | CO_NOFREE)) {
37531 if (argdefs == NULL && co->co_argcount == nargs) {
37532 result = __Pyx_PyFunction_FastCallNoKw(co, args, nargs, globals);
37535 else if (nargs == 0 && argdefs != NULL
37536 && co->co_argcount == Py_SIZE(argdefs)) {
37539 args = &PyTuple_GET_ITEM(argdefs, 0);
37540 result =__Pyx_PyFunction_FastCallNoKw(co, args, Py_SIZE(argdefs), globals);
37544 if (kwargs != NULL) {
37546 kwtuple = PyTuple_New(2 * nk);
37547 if (kwtuple == NULL) {
37551 k = &PyTuple_GET_ITEM(kwtuple, 0);
37553 while (PyDict_Next(kwargs, &
pos, &k[i], &k[i+1])) {
37564 closure = PyFunction_GET_CLOSURE(func);
37565 #if PY_MAJOR_VERSION >= 3
37566 kwdefs = PyFunction_GET_KW_DEFAULTS(func);
37568 if (argdefs != NULL) {
37569 d = &PyTuple_GET_ITEM(argdefs, 0);
37570 nd = Py_SIZE(argdefs);
37576 #if PY_MAJOR_VERSION >= 3
37577 result = PyEval_EvalCodeEx((PyObject*)co, globals, (PyObject *)NULL,
37580 d, (
int)nd, kwdefs, closure);
37582 result = PyEval_EvalCodeEx(co, globals, (PyObject *)NULL,
37585 d, (
int)nd, closure);
37587 Py_XDECREF(kwtuple);
37589 Py_LeaveRecursiveCall();
37596 #if CYTHON_COMPILING_IN_CPYTHON
37597 static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw) {
37599 ternaryfunc call = Py_TYPE(func)->tp_call;
37600 if (unlikely(!call))
37601 return PyObject_Call(func, arg, kw);
37602 if (unlikely(Py_EnterRecursiveCall((
char*)
" while calling a Python object")))
37604 result = (*call)(func, arg, kw);
37605 Py_LeaveRecursiveCall();
37606 if (unlikely(!result) && unlikely(!PyErr_Occurred())) {
37609 "NULL result without error in PyObject_Call");
37616 #if CYTHON_COMPILING_IN_CPYTHON
37617 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg) {
37618 PyObject *
self, *result;
37620 cfunc = PyCFunction_GET_FUNCTION(func);
37621 self = PyCFunction_GET_SELF(func);
37622 if (unlikely(Py_EnterRecursiveCall((
char*)
" while calling a Python object")))
37624 result = cfunc(
self, arg);
37625 Py_LeaveRecursiveCall();
37626 if (unlikely(!result) && unlikely(!PyErr_Occurred())) {
37629 "NULL result without error in PyObject_Call");
37636 #if CYTHON_COMPILING_IN_CPYTHON
37637 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallNoArg(PyObject *func) {
37638 #if CYTHON_FAST_PYCALL
37639 if (PyFunction_Check(func)) {
37640 return __Pyx_PyFunction_FastCall(func, NULL, 0);
37643 #ifdef __Pyx_CyFunction_USED
37644 if (likely(PyCFunction_Check(func) || __Pyx_CyFunction_Check(func)))
37646 if (likely(PyCFunction_Check(func)))
37649 if (likely(PyCFunction_GET_FLAGS(func) & METH_NOARGS)) {
37650 return __Pyx_PyObject_CallMethO(func, NULL);
37653 return __Pyx_PyObject_Call(func, __pyx_empty_tuple, NULL);
37658 #if CYTHON_FAST_PYCCALL
37659 static CYTHON_INLINE PyObject * __Pyx_PyCFunction_FastCall(PyObject *func_obj, PyObject **args, Py_ssize_t nargs) {
37660 PyCFunctionObject *func = (PyCFunctionObject*)func_obj;
37661 PyCFunction meth = PyCFunction_GET_FUNCTION(func);
37662 PyObject *
self = PyCFunction_GET_SELF(func);
37663 int flags = PyCFunction_GET_FLAGS(func);
37664 assert(PyCFunction_Check(func));
37665 assert(METH_FASTCALL == (flags & ~(METH_CLASS | METH_STATIC | METH_COEXIST | METH_KEYWORDS | METH_STACKLESS)));
37666 assert(nargs >= 0);
37667 assert(nargs == 0 || args != NULL);
37671 assert(!PyErr_Occurred());
37672 if ((PY_VERSION_HEX < 0x030700A0) || unlikely(flags & METH_KEYWORDS)) {
37673 return (*((__Pyx_PyCFunctionFastWithKeywords)(
void*)meth)) (
self, args, nargs, NULL);
37675 return (*((__Pyx_PyCFunctionFast)(
void*)meth)) (
self, args, nargs);
37681 #if CYTHON_COMPILING_IN_CPYTHON
37682 static PyObject* __Pyx__PyObject_CallOneArg(PyObject *func, PyObject *arg) {
37684 PyObject *args = PyTuple_New(1);
37685 if (unlikely(!args))
return NULL;
37687 PyTuple_SET_ITEM(args, 0, arg);
37688 result = __Pyx_PyObject_Call(func, args, NULL);
37692 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg) {
37693 #if CYTHON_FAST_PYCALL
37694 if (PyFunction_Check(func)) {
37695 return __Pyx_PyFunction_FastCall(func, &arg, 1);
37698 if (likely(PyCFunction_Check(func))) {
37699 if (likely(PyCFunction_GET_FLAGS(func) & METH_O)) {
37700 return __Pyx_PyObject_CallMethO(func, arg);
37701 #if CYTHON_FAST_PYCCALL
37702 }
else if (__Pyx_PyFastCFunction_Check(func)) {
37703 return __Pyx_PyCFunction_FastCall(func, &arg, 1);
37707 return __Pyx__PyObject_CallOneArg(func, arg);
37710 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg) {
37712 PyObject *args = PyTuple_Pack(1, arg);
37713 if (unlikely(!args))
return NULL;
37714 result = __Pyx_PyObject_Call(func, args, NULL);
37721 static void __Pyx_RaiseDoubleKeywordsError(
37722 const char* func_name,
37725 PyErr_Format(PyExc_TypeError,
37726 #
if PY_MAJOR_VERSION >= 3
37727 "%s() got multiple values for keyword argument '%U'", func_name, kw_name);
37729 "%s() got multiple values for keyword argument '%s'", func_name,
37730 PyString_AsString(kw_name));
37735 static int __Pyx_ParseOptionalKeywords(
37737 PyObject **argnames[],
37739 PyObject *values[],
37740 Py_ssize_t num_pos_args,
37741 const char* function_name)
37743 PyObject *key = 0, *value = 0;
37744 Py_ssize_t
pos = 0;
37746 PyObject*** first_kw_arg = argnames + num_pos_args;
37747 while (PyDict_Next(kwds, &
pos, &key, &value)) {
37748 name = first_kw_arg;
37749 while (*name && (**name != key)) name++;
37751 values[name-argnames] = value;
37754 name = first_kw_arg;
37755 #if PY_MAJOR_VERSION < 3
37756 if (likely(PyString_Check(key))) {
37758 if ((CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**name) == PyString_GET_SIZE(key))
37759 && _PyString_Eq(**name, key)) {
37760 values[name-argnames] = value;
37765 if (*name)
continue;
37767 PyObject*** argname = argnames;
37768 while (argname != first_kw_arg) {
37769 if ((**argname == key) || (
37770 (CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**argname) == PyString_GET_SIZE(key))
37771 && _PyString_Eq(**argname, key))) {
37772 goto arg_passed_twice;
37779 if (likely(PyUnicode_Check(key))) {
37781 int cmp = (**name == key) ? 0 :
37782 #
if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3
37783 (__Pyx_PyUnicode_GET_LENGTH(**name) != __Pyx_PyUnicode_GET_LENGTH(key)) ? 1 :
37785 PyUnicode_Compare(**name, key);
37786 if (cmp < 0 && unlikely(PyErr_Occurred()))
goto bad;
37788 values[name-argnames] = value;
37793 if (*name)
continue;
37795 PyObject*** argname = argnames;
37796 while (argname != first_kw_arg) {
37797 int cmp = (**argname == key) ? 0 :
37798 #
if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3
37799 (__Pyx_PyUnicode_GET_LENGTH(**argname) != __Pyx_PyUnicode_GET_LENGTH(key)) ? 1 :
37801 PyUnicode_Compare(**argname, key);
37802 if (cmp < 0 && unlikely(PyErr_Occurred()))
goto bad;
37803 if (cmp == 0)
goto arg_passed_twice;
37808 goto invalid_keyword_type;
37810 if (unlikely(PyDict_SetItem(kwds2, key, value)))
goto bad;
37812 goto invalid_keyword;
37817 __Pyx_RaiseDoubleKeywordsError(function_name, key);
37819 invalid_keyword_type:
37820 PyErr_Format(PyExc_TypeError,
37821 "%.200s() keywords must be strings", function_name);
37824 PyErr_Format(PyExc_TypeError,
37825 #
if PY_MAJOR_VERSION < 3
37826 "%.200s() got an unexpected keyword argument '%.200s'",
37827 function_name, PyString_AsString(key));
37829 "%s() got an unexpected keyword argument '%U'",
37830 function_name, key);
37837 #if PY_MAJOR_VERSION < 3
37838 static CYTHON_INLINE PyObject* __Pyx_PyInt_FromDouble(
double value) {
37839 if (value >= (
double)LONG_MIN && value <= (
double)LONG_MAX) {
37840 return PyInt_FromLong((
long)value);
37842 return PyLong_FromDouble(value);
37847 static CYTHON_INLINE PyObject* __Pyx_PyObject_GetSlice(PyObject* obj,
37848 Py_ssize_t cstart, Py_ssize_t cstop,
37849 PyObject** _py_start, PyObject** _py_stop, PyObject** _py_slice,
37850 int has_cstart,
int has_cstop, CYTHON_UNUSED
int wraparound) {
37851 #if CYTHON_USE_TYPE_SLOTS
37852 PyMappingMethods* mp;
37853 #if PY_MAJOR_VERSION < 3
37854 PySequenceMethods* ms = Py_TYPE(obj)->tp_as_sequence;
37855 if (likely(ms && ms->sq_slice)) {
37857 if (_py_start && (*_py_start != Py_None)) {
37858 cstart = __Pyx_PyIndex_AsSsize_t(*_py_start);
37859 if ((cstart == (Py_ssize_t)-1) && PyErr_Occurred())
goto bad;
37864 if (_py_stop && (*_py_stop != Py_None)) {
37865 cstop = __Pyx_PyIndex_AsSsize_t(*_py_stop);
37866 if ((cstop == (Py_ssize_t)-1) && PyErr_Occurred())
goto bad;
37868 cstop = PY_SSIZE_T_MAX;
37870 if (wraparound && unlikely((cstart < 0) | (cstop < 0)) && likely(ms->sq_length)) {
37871 Py_ssize_t l = ms->sq_length(obj);
37872 if (likely(l >= 0)) {
37875 if (cstop < 0) cstop = 0;
37879 if (cstart < 0) cstart = 0;
37882 if (!PyErr_ExceptionMatches(PyExc_OverflowError))
37887 return ms->sq_slice(obj, cstart, cstop);
37890 mp = Py_TYPE(obj)->tp_as_mapping;
37891 if (likely(mp && mp->mp_subscript))
37895 PyObject *py_slice, *py_start, *py_stop;
37897 py_slice = *_py_slice;
37899 PyObject* owned_start = NULL;
37900 PyObject* owned_stop = NULL;
37902 py_start = *_py_start;
37905 owned_start = py_start = PyInt_FromSsize_t(cstart);
37906 if (unlikely(!py_start))
goto bad;
37908 py_start = Py_None;
37911 py_stop = *_py_stop;
37914 owned_stop = py_stop = PyInt_FromSsize_t(cstop);
37915 if (unlikely(!py_stop)) {
37916 Py_XDECREF(owned_start);
37922 py_slice = PySlice_New(py_start, py_stop, Py_None);
37923 Py_XDECREF(owned_start);
37924 Py_XDECREF(owned_stop);
37925 if (unlikely(!py_slice))
goto bad;
37927 #if CYTHON_USE_TYPE_SLOTS
37928 result = mp->mp_subscript(obj, py_slice);
37930 result = PyObject_GetItem(obj, py_slice);
37933 Py_DECREF(py_slice);
37937 PyErr_Format(PyExc_TypeError,
37938 "'%.200s' object is unsliceable", Py_TYPE(obj)->tp_name);
37944 static CYTHON_UNUSED PyObject* __Pyx_PyObject_Call2Args(PyObject*
function, PyObject* arg1, PyObject* arg2) {
37945 PyObject *args, *result = NULL;
37946 #if CYTHON_FAST_PYCALL
37947 if (PyFunction_Check(
function)) {
37948 PyObject *args[2] = {arg1, arg2};
37949 return __Pyx_PyFunction_FastCall(
function, args, 2);
37952 #if CYTHON_FAST_PYCCALL
37953 if (__Pyx_PyFastCFunction_Check(
function)) {
37954 PyObject *args[2] = {arg1, arg2};
37955 return __Pyx_PyCFunction_FastCall(
function, args, 2);
37958 args = PyTuple_New(2);
37959 if (unlikely(!args))
goto done;
37961 PyTuple_SET_ITEM(args, 0, arg1);
37963 PyTuple_SET_ITEM(args, 1, arg2);
37964 Py_INCREF(
function);
37965 result = __Pyx_PyObject_Call(
function, args, NULL);
37967 Py_DECREF(
function);
37973 #if CYTHON_FAST_THREAD_STATE
37974 static CYTHON_INLINE
void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb) {
37975 PyObject *tmp_type, *tmp_value, *tmp_tb;
37976 tmp_type = tstate->curexc_type;
37977 tmp_value = tstate->curexc_value;
37978 tmp_tb = tstate->curexc_traceback;
37979 tstate->curexc_type = type;
37980 tstate->curexc_value = value;
37981 tstate->curexc_traceback = tb;
37982 Py_XDECREF(tmp_type);
37983 Py_XDECREF(tmp_value);
37984 Py_XDECREF(tmp_tb);
37986 static CYTHON_INLINE
void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) {
37987 *type = tstate->curexc_type;
37988 *value = tstate->curexc_value;
37989 *tb = tstate->curexc_traceback;
37990 tstate->curexc_type = 0;
37991 tstate->curexc_value = 0;
37992 tstate->curexc_traceback = 0;
37997 #if PY_MAJOR_VERSION < 3
37998 static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb,
37999 CYTHON_UNUSED PyObject *cause) {
38000 __Pyx_PyThreadState_declare
38002 if (!value || value == Py_None)
38006 if (!tb || tb == Py_None)
38010 if (!PyTraceBack_Check(tb)) {
38011 PyErr_SetString(PyExc_TypeError,
38012 "raise: arg 3 must be a traceback or None");
38016 if (PyType_Check(type)) {
38017 #if CYTHON_COMPILING_IN_PYPY
38019 Py_INCREF(Py_None);
38023 PyErr_NormalizeException(&type, &value, &tb);
38026 PyErr_SetString(PyExc_TypeError,
38027 "instance exception may not have a separate value");
38031 type = (PyObject*) Py_TYPE(type);
38033 if (!PyType_IsSubtype((PyTypeObject *)type, (PyTypeObject *)PyExc_BaseException)) {
38034 PyErr_SetString(PyExc_TypeError,
38035 "raise: exception class must be a subclass of BaseException");
38039 __Pyx_PyThreadState_assign
38040 __Pyx_ErrRestore(type, value, tb);
38049 static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause) {
38050 PyObject* owned_instance = NULL;
38051 if (tb == Py_None) {
38053 }
else if (tb && !PyTraceBack_Check(tb)) {
38054 PyErr_SetString(PyExc_TypeError,
38055 "raise: arg 3 must be a traceback or None");
38058 if (value == Py_None)
38060 if (PyExceptionInstance_Check(type)) {
38062 PyErr_SetString(PyExc_TypeError,
38063 "instance exception may not have a separate value");
38067 type = (PyObject*) Py_TYPE(value);
38068 }
else if (PyExceptionClass_Check(type)) {
38069 PyObject *instance_class = NULL;
38070 if (value && PyExceptionInstance_Check(value)) {
38071 instance_class = (PyObject*) Py_TYPE(value);
38072 if (instance_class != type) {
38073 int is_subclass = PyObject_IsSubclass(instance_class, type);
38074 if (!is_subclass) {
38075 instance_class = NULL;
38076 }
else if (unlikely(is_subclass == -1)) {
38079 type = instance_class;
38083 if (!instance_class) {
38086 args = PyTuple_New(0);
38087 else if (PyTuple_Check(value)) {
38091 args = PyTuple_Pack(1, value);
38094 owned_instance = PyObject_Call(type, args, NULL);
38096 if (!owned_instance)
38098 value = owned_instance;
38099 if (!PyExceptionInstance_Check(value)) {
38100 PyErr_Format(PyExc_TypeError,
38101 "calling %R should have returned an instance of "
38102 "BaseException, not %R",
38103 type, Py_TYPE(value));
38108 PyErr_SetString(PyExc_TypeError,
38109 "raise: exception class must be a subclass of BaseException");
38113 PyObject *fixed_cause;
38114 if (cause == Py_None) {
38115 fixed_cause = NULL;
38116 }
else if (PyExceptionClass_Check(cause)) {
38117 fixed_cause = PyObject_CallObject(cause, NULL);
38118 if (fixed_cause == NULL)
38120 }
else if (PyExceptionInstance_Check(cause)) {
38121 fixed_cause = cause;
38122 Py_INCREF(fixed_cause);
38124 PyErr_SetString(PyExc_TypeError,
38125 "exception causes must derive from "
38129 PyException_SetCause(value, fixed_cause);
38131 PyErr_SetObject(type, value);
38133 #if CYTHON_COMPILING_IN_PYPY
38134 PyObject *tmp_type, *tmp_value, *tmp_tb;
38135 PyErr_Fetch(&tmp_type, &tmp_value, &tmp_tb);
38137 PyErr_Restore(tmp_type, tmp_value, tb);
38138 Py_XDECREF(tmp_tb);
38140 PyThreadState *tstate = __Pyx_PyThreadState_Current;
38141 PyObject* tmp_tb = tstate->curexc_traceback;
38142 if (tb != tmp_tb) {
38144 tstate->curexc_traceback = tb;
38145 Py_XDECREF(tmp_tb);
38150 Py_XDECREF(owned_instance);
38156 #if CYTHON_USE_EXC_INFO_STACK
38157 static _PyErr_StackItem *
38158 __Pyx_PyErr_GetTopmostException(PyThreadState *tstate)
38160 _PyErr_StackItem *exc_info = tstate->exc_info;
38161 while ((exc_info->exc_type == NULL || exc_info->exc_type == Py_None) &&
38162 exc_info->previous_item != NULL)
38164 exc_info = exc_info->previous_item;
38171 #if CYTHON_FAST_THREAD_STATE
38172 static CYTHON_INLINE
void __Pyx__ExceptionSave(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) {
38173 #if CYTHON_USE_EXC_INFO_STACK
38174 _PyErr_StackItem *exc_info = __Pyx_PyErr_GetTopmostException(tstate);
38175 *type = exc_info->exc_type;
38176 *value = exc_info->exc_value;
38177 *tb = exc_info->exc_traceback;
38179 *type = tstate->exc_type;
38180 *value = tstate->exc_value;
38181 *tb = tstate->exc_traceback;
38184 Py_XINCREF(*value);
38187 static CYTHON_INLINE
void __Pyx__ExceptionReset(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb) {
38188 PyObject *tmp_type, *tmp_value, *tmp_tb;
38189 #if CYTHON_USE_EXC_INFO_STACK
38190 _PyErr_StackItem *exc_info = tstate->exc_info;
38191 tmp_type = exc_info->exc_type;
38192 tmp_value = exc_info->exc_value;
38193 tmp_tb = exc_info->exc_traceback;
38194 exc_info->exc_type = type;
38195 exc_info->exc_value = value;
38196 exc_info->exc_traceback = tb;
38198 tmp_type = tstate->exc_type;
38199 tmp_value = tstate->exc_value;
38200 tmp_tb = tstate->exc_traceback;
38201 tstate->exc_type = type;
38202 tstate->exc_value = value;
38203 tstate->exc_traceback = tb;
38205 Py_XDECREF(tmp_type);
38206 Py_XDECREF(tmp_value);
38207 Py_XDECREF(tmp_tb);
38212 #if CYTHON_FAST_THREAD_STATE
38213 static int __Pyx_PyErr_ExceptionMatchesTuple(PyObject *exc_type, PyObject *tuple) {
38215 n = PyTuple_GET_SIZE(tuple);
38216 #if PY_MAJOR_VERSION >= 3
38217 for (i=0; i<
n; i++) {
38218 if (exc_type == PyTuple_GET_ITEM(tuple, i))
return 1;
38221 for (i=0; i<
n; i++) {
38222 if (__Pyx_PyErr_GivenExceptionMatches(exc_type, PyTuple_GET_ITEM(tuple, i)))
return 1;
38226 static CYTHON_INLINE
int __Pyx_PyErr_ExceptionMatchesInState(PyThreadState* tstate, PyObject* err) {
38227 PyObject *exc_type = tstate->curexc_type;
38228 if (exc_type == err)
return 1;
38229 if (unlikely(!exc_type))
return 0;
38230 if (unlikely(PyTuple_Check(err)))
38231 return __Pyx_PyErr_ExceptionMatchesTuple(exc_type, err);
38232 return __Pyx_PyErr_GivenExceptionMatches(exc_type, err);
38237 #if CYTHON_FAST_THREAD_STATE
38238 static int __Pyx__GetException(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb)
38240 static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb)
38243 PyObject *local_type, *local_value, *local_tb;
38244 #if CYTHON_FAST_THREAD_STATE
38245 PyObject *tmp_type, *tmp_value, *tmp_tb;
38246 local_type = tstate->curexc_type;
38247 local_value = tstate->curexc_value;
38248 local_tb = tstate->curexc_traceback;
38249 tstate->curexc_type = 0;
38250 tstate->curexc_value = 0;
38251 tstate->curexc_traceback = 0;
38253 PyErr_Fetch(&local_type, &local_value, &local_tb);
38255 PyErr_NormalizeException(&local_type, &local_value, &local_tb);
38256 #if CYTHON_FAST_THREAD_STATE
38257 if (unlikely(tstate->curexc_type))
38259 if (unlikely(PyErr_Occurred()))
38262 #if PY_MAJOR_VERSION >= 3
38264 if (unlikely(PyException_SetTraceback(local_value, local_tb) < 0))
38268 Py_XINCREF(local_tb);
38269 Py_XINCREF(local_type);
38270 Py_XINCREF(local_value);
38271 *type = local_type;
38272 *value = local_value;
38274 #if CYTHON_FAST_THREAD_STATE
38275 #if CYTHON_USE_EXC_INFO_STACK
38277 _PyErr_StackItem *exc_info = tstate->exc_info;
38278 tmp_type = exc_info->exc_type;
38279 tmp_value = exc_info->exc_value;
38280 tmp_tb = exc_info->exc_traceback;
38281 exc_info->exc_type = local_type;
38282 exc_info->exc_value = local_value;
38283 exc_info->exc_traceback = local_tb;
38286 tmp_type = tstate->exc_type;
38287 tmp_value = tstate->exc_value;
38288 tmp_tb = tstate->exc_traceback;
38289 tstate->exc_type = local_type;
38290 tstate->exc_value = local_value;
38291 tstate->exc_traceback = local_tb;
38293 Py_XDECREF(tmp_type);
38294 Py_XDECREF(tmp_value);
38295 Py_XDECREF(tmp_tb);
38297 PyErr_SetExcInfo(local_type, local_value, local_tb);
38304 Py_XDECREF(local_type);
38305 Py_XDECREF(local_value);
38306 Py_XDECREF(local_tb);
38311 #if !CYTHON_COMPILING_IN_PYPY
38312 static PyObject* __Pyx_PyInt_SubtractObjC(PyObject *op1, PyObject *op2, CYTHON_UNUSED
long intval,
int inplace,
int zerodivision_check) {
38314 (void)zerodivision_check;
38315 #if PY_MAJOR_VERSION < 3
38316 if (likely(PyInt_CheckExact(op1))) {
38317 const long b = intval;
38319 long a = PyInt_AS_LONG(op1);
38320 x = (long)((
unsigned long)a - b);
38321 if (likely((x^a) >= 0 || (x^~b) >= 0))
38322 return PyInt_FromLong(x);
38323 return PyLong_Type.tp_as_number->nb_subtract(op1, op2);
38326 #if CYTHON_USE_PYLONG_INTERNALS
38327 if (likely(PyLong_CheckExact(op1))) {
38328 const long b = intval;
38330 #ifdef HAVE_LONG_LONG
38331 const PY_LONG_LONG llb = intval;
38332 PY_LONG_LONG lla, llx;
38334 const digit* digits = ((PyLongObject*)op1)->ob_digit;
38335 const Py_ssize_t size = Py_SIZE(op1);
38336 if (likely(__Pyx_sst_abs(size) <= 1)) {
38337 a = likely(size) ? digits[0] : 0;
38338 if (size == -1) a = -a;
38342 if (8 *
sizeof(
long) - 1 > 2 * PyLong_SHIFT) {
38343 a = -(long) (((((
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0]));
38345 #ifdef HAVE_LONG_LONG
38346 }
else if (8 *
sizeof(PY_LONG_LONG) - 1 > 2 * PyLong_SHIFT) {
38347 lla = -(PY_LONG_LONG) (((((
unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (
unsigned PY_LONG_LONG)digits[0]));
38351 CYTHON_FALLTHROUGH;
38353 if (8 *
sizeof(
long) - 1 > 2 * PyLong_SHIFT) {
38354 a = (long) (((((
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0]));
38356 #ifdef HAVE_LONG_LONG
38357 }
else if (8 *
sizeof(PY_LONG_LONG) - 1 > 2 * PyLong_SHIFT) {
38358 lla = (PY_LONG_LONG) (((((
unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (
unsigned PY_LONG_LONG)digits[0]));
38362 CYTHON_FALLTHROUGH;
38364 if (8 *
sizeof(
long) - 1 > 3 * PyLong_SHIFT) {
38365 a = -(long) (((((((
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0]));
38367 #ifdef HAVE_LONG_LONG
38368 }
else if (8 *
sizeof(PY_LONG_LONG) - 1 > 3 * PyLong_SHIFT) {
38369 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]));
38373 CYTHON_FALLTHROUGH;
38375 if (8 *
sizeof(
long) - 1 > 3 * PyLong_SHIFT) {
38376 a = (long) (((((((
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0]));
38378 #ifdef HAVE_LONG_LONG
38379 }
else if (8 *
sizeof(PY_LONG_LONG) - 1 > 3 * PyLong_SHIFT) {
38380 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]));
38384 CYTHON_FALLTHROUGH;
38386 if (8 *
sizeof(
long) - 1 > 4 * PyLong_SHIFT) {
38387 a = -(long) (((((((((
unsigned long)digits[3]) << PyLong_SHIFT) | (
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0]));
38389 #ifdef HAVE_LONG_LONG
38390 }
else if (8 *
sizeof(PY_LONG_LONG) - 1 > 4 * PyLong_SHIFT) {
38391 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]));
38395 CYTHON_FALLTHROUGH;
38397 if (8 *
sizeof(
long) - 1 > 4 * PyLong_SHIFT) {
38398 a = (long) (((((((((
unsigned long)digits[3]) << PyLong_SHIFT) | (
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0]));
38400 #ifdef HAVE_LONG_LONG
38401 }
else if (8 *
sizeof(PY_LONG_LONG) - 1 > 4 * PyLong_SHIFT) {
38402 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]));
38406 CYTHON_FALLTHROUGH;
38407 default:
return PyLong_Type.tp_as_number->nb_subtract(op1, op2);
38411 return PyLong_FromLong(x);
38412 #ifdef HAVE_LONG_LONG
38415 return PyLong_FromLongLong(llx);
38421 if (PyFloat_CheckExact(op1)) {
38422 const long b = intval;
38423 double a = PyFloat_AS_DOUBLE(op1);
38425 PyFPE_START_PROTECT(
"subtract",
return NULL)
38426 result = ((double)a) - (double)b;
38427 PyFPE_END_PROTECT(result)
38428 return PyFloat_FromDouble(result);
38430 return (inplace ? PyNumber_InPlaceSubtract : PyNumber_Subtract)(op1, op2);
38435 static CYTHON_INLINE
int __Pyx_PyObject_SetSlice(PyObject* obj, PyObject* value,
38436 Py_ssize_t cstart, Py_ssize_t cstop,
38437 PyObject** _py_start, PyObject** _py_stop, PyObject** _py_slice,
38438 int has_cstart,
int has_cstop, CYTHON_UNUSED
int wraparound) {
38439 #if CYTHON_USE_TYPE_SLOTS
38440 PyMappingMethods* mp;
38441 #if PY_MAJOR_VERSION < 3
38442 PySequenceMethods* ms = Py_TYPE(obj)->tp_as_sequence;
38443 if (likely(ms && ms->sq_ass_slice)) {
38445 if (_py_start && (*_py_start != Py_None)) {
38446 cstart = __Pyx_PyIndex_AsSsize_t(*_py_start);
38447 if ((cstart == (Py_ssize_t)-1) && PyErr_Occurred())
goto bad;
38452 if (_py_stop && (*_py_stop != Py_None)) {
38453 cstop = __Pyx_PyIndex_AsSsize_t(*_py_stop);
38454 if ((cstop == (Py_ssize_t)-1) && PyErr_Occurred())
goto bad;
38456 cstop = PY_SSIZE_T_MAX;
38458 if (wraparound && unlikely((cstart < 0) | (cstop < 0)) && likely(ms->sq_length)) {
38459 Py_ssize_t l = ms->sq_length(obj);
38460 if (likely(l >= 0)) {
38463 if (cstop < 0) cstop = 0;
38467 if (cstart < 0) cstart = 0;
38470 if (!PyErr_ExceptionMatches(PyExc_OverflowError))
38475 return ms->sq_ass_slice(obj, cstart, cstop, value);
38478 mp = Py_TYPE(obj)->tp_as_mapping;
38479 if (likely(mp && mp->mp_ass_subscript))
38483 PyObject *py_slice, *py_start, *py_stop;
38485 py_slice = *_py_slice;
38487 PyObject* owned_start = NULL;
38488 PyObject* owned_stop = NULL;
38490 py_start = *_py_start;
38493 owned_start = py_start = PyInt_FromSsize_t(cstart);
38494 if (unlikely(!py_start))
goto bad;
38496 py_start = Py_None;
38499 py_stop = *_py_stop;
38502 owned_stop = py_stop = PyInt_FromSsize_t(cstop);
38503 if (unlikely(!py_stop)) {
38504 Py_XDECREF(owned_start);
38510 py_slice = PySlice_New(py_start, py_stop, Py_None);
38511 Py_XDECREF(owned_start);
38512 Py_XDECREF(owned_stop);
38513 if (unlikely(!py_slice))
goto bad;
38515 #if CYTHON_USE_TYPE_SLOTS
38516 result = mp->mp_ass_subscript(obj, py_slice, value);
38518 result = value ? PyObject_SetItem(obj, py_slice, value) : PyObject_DelItem(obj, py_slice);
38521 Py_DECREF(py_slice);
38525 PyErr_Format(PyExc_TypeError,
38526 "'%.200s' object does not support slice %.10s",
38527 Py_TYPE(obj)->tp_name, value ?
"assignment" :
"deletion");
38533 static CYTHON_INLINE PyObject* __Pyx_PyInt_EqObjC(PyObject *op1, PyObject *op2, CYTHON_UNUSED
long intval, CYTHON_UNUSED
long inplace) {
38537 #if PY_MAJOR_VERSION < 3
38538 if (likely(PyInt_CheckExact(op1))) {
38539 const long b = intval;
38540 long a = PyInt_AS_LONG(op1);
38541 if (a == b) Py_RETURN_TRUE;
else Py_RETURN_FALSE;
38544 #if CYTHON_USE_PYLONG_INTERNALS
38545 if (likely(PyLong_CheckExact(op1))) {
38547 unsigned long uintval;
38548 Py_ssize_t size = Py_SIZE(op1);
38549 const digit* digits = ((PyLongObject*)op1)->ob_digit;
38551 if (size == 0) Py_RETURN_TRUE;
else Py_RETURN_FALSE;
38552 }
else if (intval < 0) {
38561 uintval = (
unsigned long) intval;
38562 #if PyLong_SHIFT * 4 < SIZEOF_LONG*8
38563 if (uintval >> (PyLong_SHIFT * 4)) {
38564 unequal = (size != 5) || (digits[0] != (uintval & (
unsigned long) PyLong_MASK))
38565 | (digits[1] != ((uintval >> (1 * PyLong_SHIFT)) & (
unsigned long) PyLong_MASK)) | (digits[2] != ((uintval >> (2 * PyLong_SHIFT)) & (
unsigned long) PyLong_MASK)) | (digits[3] != ((uintval >> (3 * PyLong_SHIFT)) & (
unsigned long) PyLong_MASK)) | (digits[4] != ((uintval >> (4 * PyLong_SHIFT)) & (
unsigned long) PyLong_MASK));
38568 #if PyLong_SHIFT * 3 < SIZEOF_LONG*8
38569 if (uintval >> (PyLong_SHIFT * 3)) {
38570 unequal = (size != 4) || (digits[0] != (uintval & (
unsigned long) PyLong_MASK))
38571 | (digits[1] != ((uintval >> (1 * PyLong_SHIFT)) & (
unsigned long) PyLong_MASK)) | (digits[2] != ((uintval >> (2 * PyLong_SHIFT)) & (
unsigned long) PyLong_MASK)) | (digits[3] != ((uintval >> (3 * PyLong_SHIFT)) & (
unsigned long) PyLong_MASK));
38574 #if PyLong_SHIFT * 2 < SIZEOF_LONG*8
38575 if (uintval >> (PyLong_SHIFT * 2)) {
38576 unequal = (size != 3) || (digits[0] != (uintval & (
unsigned long) PyLong_MASK))
38577 | (digits[1] != ((uintval >> (1 * PyLong_SHIFT)) & (
unsigned long) PyLong_MASK)) | (digits[2] != ((uintval >> (2 * PyLong_SHIFT)) & (
unsigned long) PyLong_MASK));
38580 #if PyLong_SHIFT * 1 < SIZEOF_LONG*8
38581 if (uintval >> (PyLong_SHIFT * 1)) {
38582 unequal = (size != 2) || (digits[0] != (uintval & (
unsigned long) PyLong_MASK))
38583 | (digits[1] != ((uintval >> (1 * PyLong_SHIFT)) & (
unsigned long) PyLong_MASK));
38586 unequal = (size != 1) || (((
unsigned long) digits[0]) != (uintval & (
unsigned long) PyLong_MASK));
38587 if (unequal == 0) Py_RETURN_TRUE;
else Py_RETURN_FALSE;
38590 if (PyFloat_CheckExact(op1)) {
38591 const long b = intval;
38592 double a = PyFloat_AS_DOUBLE(op1);
38593 if ((
double)a == (
double)b) Py_RETURN_TRUE;
else Py_RETURN_FALSE;
38596 PyObject_RichCompare(op1, op2, Py_EQ));
38600 static CYTHON_INLINE
void __Pyx_RaiseUnboundLocalError(
const char *varname) {
38601 PyErr_Format(PyExc_UnboundLocalError,
"local variable '%s' referenced before assignment", varname);
38605 #if !CYTHON_COMPILING_IN_PYPY
38606 static PyObject* __Pyx_PyInt_AddObjC(PyObject *op1, PyObject *op2, CYTHON_UNUSED
long intval,
int inplace,
int zerodivision_check) {
38608 (void)zerodivision_check;
38609 #if PY_MAJOR_VERSION < 3
38610 if (likely(PyInt_CheckExact(op1))) {
38611 const long b = intval;
38613 long a = PyInt_AS_LONG(op1);
38614 x = (long)((
unsigned long)a + b);
38615 if (likely((x^a) >= 0 || (x^b) >= 0))
38616 return PyInt_FromLong(x);
38617 return PyLong_Type.tp_as_number->nb_add(op1, op2);
38620 #if CYTHON_USE_PYLONG_INTERNALS
38621 if (likely(PyLong_CheckExact(op1))) {
38622 const long b = intval;
38624 #ifdef HAVE_LONG_LONG
38625 const PY_LONG_LONG llb = intval;
38626 PY_LONG_LONG lla, llx;
38628 const digit* digits = ((PyLongObject*)op1)->ob_digit;
38629 const Py_ssize_t size = Py_SIZE(op1);
38630 if (likely(__Pyx_sst_abs(size) <= 1)) {
38631 a = likely(size) ? digits[0] : 0;
38632 if (size == -1) a = -a;
38636 if (8 *
sizeof(
long) - 1 > 2 * PyLong_SHIFT) {
38637 a = -(long) (((((
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0]));
38639 #ifdef HAVE_LONG_LONG
38640 }
else if (8 *
sizeof(PY_LONG_LONG) - 1 > 2 * PyLong_SHIFT) {
38641 lla = -(PY_LONG_LONG) (((((
unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (
unsigned PY_LONG_LONG)digits[0]));
38645 CYTHON_FALLTHROUGH;
38647 if (8 *
sizeof(
long) - 1 > 2 * PyLong_SHIFT) {
38648 a = (long) (((((
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0]));
38650 #ifdef HAVE_LONG_LONG
38651 }
else if (8 *
sizeof(PY_LONG_LONG) - 1 > 2 * PyLong_SHIFT) {
38652 lla = (PY_LONG_LONG) (((((
unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (
unsigned PY_LONG_LONG)digits[0]));
38656 CYTHON_FALLTHROUGH;
38658 if (8 *
sizeof(
long) - 1 > 3 * PyLong_SHIFT) {
38659 a = -(long) (((((((
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0]));
38661 #ifdef HAVE_LONG_LONG
38662 }
else if (8 *
sizeof(PY_LONG_LONG) - 1 > 3 * PyLong_SHIFT) {
38663 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]));
38667 CYTHON_FALLTHROUGH;
38669 if (8 *
sizeof(
long) - 1 > 3 * PyLong_SHIFT) {
38670 a = (long) (((((((
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0]));
38672 #ifdef HAVE_LONG_LONG
38673 }
else if (8 *
sizeof(PY_LONG_LONG) - 1 > 3 * PyLong_SHIFT) {
38674 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]));
38678 CYTHON_FALLTHROUGH;
38680 if (8 *
sizeof(
long) - 1 > 4 * PyLong_SHIFT) {
38681 a = -(long) (((((((((
unsigned long)digits[3]) << PyLong_SHIFT) | (
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0]));
38683 #ifdef HAVE_LONG_LONG
38684 }
else if (8 *
sizeof(PY_LONG_LONG) - 1 > 4 * PyLong_SHIFT) {
38685 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]));
38689 CYTHON_FALLTHROUGH;
38691 if (8 *
sizeof(
long) - 1 > 4 * PyLong_SHIFT) {
38692 a = (long) (((((((((
unsigned long)digits[3]) << PyLong_SHIFT) | (
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0]));
38694 #ifdef HAVE_LONG_LONG
38695 }
else if (8 *
sizeof(PY_LONG_LONG) - 1 > 4 * PyLong_SHIFT) {
38696 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]));
38700 CYTHON_FALLTHROUGH;
38701 default:
return PyLong_Type.tp_as_number->nb_add(op1, op2);
38705 return PyLong_FromLong(x);
38706 #ifdef HAVE_LONG_LONG
38709 return PyLong_FromLongLong(llx);
38715 if (PyFloat_CheckExact(op1)) {
38716 const long b = intval;
38717 double a = PyFloat_AS_DOUBLE(op1);
38719 PyFPE_START_PROTECT(
"add",
return NULL)
38720 result = ((double)a) + (double)b;
38721 PyFPE_END_PROTECT(result)
38722 return PyFloat_FromDouble(result);
38724 return (inplace ? PyNumber_InPlaceAdd : PyNumber_Add)(op1, op2);
38729 static int __Pyx_SetItemInt_Generic(PyObject *o, PyObject *j, PyObject *
v) {
38732 r = PyObject_SetItem(o, j,
v);
38736 static CYTHON_INLINE
int __Pyx_SetItemInt_Fast(PyObject *o, Py_ssize_t i, PyObject *
v,
int is_list,
38737 CYTHON_NCP_UNUSED
int wraparound, CYTHON_NCP_UNUSED
int boundscheck) {
38738 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS && CYTHON_USE_TYPE_SLOTS
38739 if (is_list || PyList_CheckExact(o)) {
38740 Py_ssize_t
n = (!wraparound) ? i : ((likely(i >= 0)) ? i : i + PyList_GET_SIZE(o));
38741 if ((!boundscheck) || likely(__Pyx_is_valid_index(
n, PyList_GET_SIZE(o)))) {
38742 PyObject* old = PyList_GET_ITEM(o,
n);
38744 PyList_SET_ITEM(o,
n,
v);
38749 PySequenceMethods *m = Py_TYPE(o)->tp_as_sequence;
38750 if (likely(m && m->sq_ass_item)) {
38751 if (wraparound && unlikely(i < 0) && likely(m->sq_length)) {
38752 Py_ssize_t l = m->sq_length(o);
38753 if (likely(l >= 0)) {
38756 if (!PyErr_ExceptionMatches(PyExc_OverflowError))
38761 return m->sq_ass_item(o, i,
v);
38765 #if CYTHON_COMPILING_IN_PYPY
38766 if (is_list || (PySequence_Check(o) && !PyDict_Check(o)))
38768 if (is_list || PySequence_Check(o))
38771 return PySequence_SetItem(o, i,
v);
38774 return __Pyx_SetItemInt_Generic(o, PyInt_FromSsize_t(i),
v);
38778 static int __Pyx__ArgTypeTest(PyObject *obj, PyTypeObject *type,
const char *name,
int exact)
38780 if (unlikely(!type)) {
38781 PyErr_SetString(PyExc_SystemError,
"Missing type object");
38785 #if PY_MAJOR_VERSION == 2
38786 if ((type == &PyBaseString_Type) && likely(__Pyx_PyBaseString_CheckExact(obj)))
return 1;
38790 if (likely(__Pyx_TypeCheck(obj, type)))
return 1;
38792 PyErr_Format(PyExc_TypeError,
38793 "Argument '%.200s' has incorrect type (expected %.200s, got %.200s)",
38794 name, type->tp_name, Py_TYPE(obj)->tp_name);
38799 static CYTHON_INLINE
int __Pyx_PyBytes_Equals(PyObject* s1, PyObject* s2,
int equals) {
38800 #if CYTHON_COMPILING_IN_PYPY
38801 return PyObject_RichCompareBool(s1, s2, equals);
38804 return (equals == Py_EQ);
38805 }
else if (PyBytes_CheckExact(s1) & PyBytes_CheckExact(s2)) {
38806 const char *ps1, *ps2;
38807 Py_ssize_t length = PyBytes_GET_SIZE(s1);
38808 if (length != PyBytes_GET_SIZE(s2))
38809 return (equals == Py_NE);
38810 ps1 = PyBytes_AS_STRING(s1);
38811 ps2 = PyBytes_AS_STRING(s2);
38812 if (ps1[0] != ps2[0]) {
38813 return (equals == Py_NE);
38814 }
else if (length == 1) {
38815 return (equals == Py_EQ);
38818 #if CYTHON_USE_UNICODE_INTERNALS && (PY_VERSION_HEX < 0x030B0000)
38819 Py_hash_t hash1, hash2;
38820 hash1 = ((PyBytesObject*)s1)->ob_shash;
38821 hash2 = ((PyBytesObject*)s2)->ob_shash;
38822 if (hash1 != hash2 && hash1 != -1 && hash2 != -1) {
38823 return (equals == Py_NE);
38826 result = memcmp(ps1, ps2, (
size_t)length);
38827 return (equals == Py_EQ) ? (result == 0) : (result != 0);
38829 }
else if ((s1 == Py_None) & PyBytes_CheckExact(s2)) {
38830 return (equals == Py_NE);
38831 }
else if ((s2 == Py_None) & PyBytes_CheckExact(s1)) {
38832 return (equals == Py_NE);
38835 PyObject* py_result = PyObject_RichCompare(s1, s2, equals);
38838 result = __Pyx_PyObject_IsTrue(py_result);
38839 Py_DECREF(py_result);
38846 static CYTHON_INLINE
int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2,
int equals) {
38847 #if CYTHON_COMPILING_IN_PYPY
38848 return PyObject_RichCompareBool(s1, s2, equals);
38850 #if PY_MAJOR_VERSION < 3
38851 PyObject* owned_ref = NULL;
38853 int s1_is_unicode, s2_is_unicode;
38857 s1_is_unicode = PyUnicode_CheckExact(s1);
38858 s2_is_unicode = PyUnicode_CheckExact(s2);
38859 #if PY_MAJOR_VERSION < 3
38860 if ((s1_is_unicode & (!s2_is_unicode)) && PyString_CheckExact(s2)) {
38861 owned_ref = PyUnicode_FromObject(s2);
38862 if (unlikely(!owned_ref))
38866 }
else if ((s2_is_unicode & (!s1_is_unicode)) && PyString_CheckExact(s1)) {
38867 owned_ref = PyUnicode_FromObject(s1);
38868 if (unlikely(!owned_ref))
38872 }
else if (((!s2_is_unicode) & (!s1_is_unicode))) {
38873 return __Pyx_PyBytes_Equals(s1, s2, equals);
38876 if (s1_is_unicode & s2_is_unicode) {
38879 void *data1, *data2;
38880 if (unlikely(__Pyx_PyUnicode_READY(s1) < 0) || unlikely(__Pyx_PyUnicode_READY(s2) < 0))
38882 length = __Pyx_PyUnicode_GET_LENGTH(s1);
38883 if (length != __Pyx_PyUnicode_GET_LENGTH(s2)) {
38886 #if CYTHON_USE_UNICODE_INTERNALS
38888 Py_hash_t hash1, hash2;
38889 #if CYTHON_PEP393_ENABLED
38890 hash1 = ((PyASCIIObject*)s1)->hash;
38891 hash2 = ((PyASCIIObject*)s2)->hash;
38893 hash1 = ((PyUnicodeObject*)s1)->hash;
38894 hash2 = ((PyUnicodeObject*)s2)->hash;
38896 if (hash1 != hash2 && hash1 != -1 && hash2 != -1) {
38901 kind = __Pyx_PyUnicode_KIND(s1);
38902 if (kind != __Pyx_PyUnicode_KIND(s2)) {
38905 data1 = __Pyx_PyUnicode_DATA(s1);
38906 data2 = __Pyx_PyUnicode_DATA(s2);
38907 if (__Pyx_PyUnicode_READ(kind, data1, 0) != __Pyx_PyUnicode_READ(kind, data2, 0)) {
38909 }
else if (length == 1) {
38912 int result = memcmp(data1, data2, (
size_t)(length * kind));
38913 #if PY_MAJOR_VERSION < 3
38914 Py_XDECREF(owned_ref);
38916 return (equals == Py_EQ) ? (result == 0) : (result != 0);
38918 }
else if ((s1 == Py_None) & s2_is_unicode) {
38920 }
else if ((s2 == Py_None) & s1_is_unicode) {
38924 PyObject* py_result = PyObject_RichCompare(s1, s2, equals);
38925 #if PY_MAJOR_VERSION < 3
38926 Py_XDECREF(owned_ref);
38930 result = __Pyx_PyObject_IsTrue(py_result);
38931 Py_DECREF(py_result);
38935 #if PY_MAJOR_VERSION < 3
38936 Py_XDECREF(owned_ref);
38938 return (equals == Py_EQ);
38940 #if PY_MAJOR_VERSION < 3
38941 Py_XDECREF(owned_ref);
38943 return (equals == Py_NE);
38948 static CYTHON_INLINE PyObject *__Pyx_GetAttr(PyObject *o, PyObject *
n) {
38949 #if CYTHON_USE_TYPE_SLOTS
38950 #if PY_MAJOR_VERSION >= 3
38951 if (likely(PyUnicode_Check(
n)))
38953 if (likely(PyString_Check(
n)))
38955 return __Pyx_PyObject_GetAttrStr(o,
n);
38957 return PyObject_GetAttr(o,
n);
38961 static CYTHON_INLINE PyObject* __Pyx_decode_c_string(
38962 const char* cstring, Py_ssize_t start, Py_ssize_t stop,
38963 const char* encoding,
const char* errors,
38964 PyObject* (*decode_func)(
const char *
s, Py_ssize_t size,
const char *errors)) {
38966 if (unlikely((start < 0) | (stop < 0))) {
38967 size_t slen = strlen(cstring);
38968 if (unlikely(slen > (
size_t) PY_SSIZE_T_MAX)) {
38969 PyErr_SetString(PyExc_OverflowError,
38970 "c-string too long to convert to Python");
38973 length = (Py_ssize_t) slen;
38982 if (unlikely(stop <= start))
38983 return __Pyx_NewRef(__pyx_empty_unicode);
38984 length = stop - start;
38987 return decode_func(cstring, length, errors);
38989 return PyUnicode_Decode(cstring, length, encoding, errors);
38994 static PyObject *__Pyx_GetAttr3Default(PyObject *d) {
38995 __Pyx_PyThreadState_declare
38996 __Pyx_PyThreadState_assign
38997 if (unlikely(!__Pyx_PyErr_ExceptionMatches(PyExc_AttributeError)))
38999 __Pyx_PyErr_Clear();
39003 static CYTHON_INLINE PyObject *__Pyx_GetAttr3(PyObject *o, PyObject *
n, PyObject *d) {
39004 PyObject *
r = __Pyx_GetAttr(o,
n);
39005 return (likely(
r)) ?
r : __Pyx_GetAttr3Default(d);
39009 static CYTHON_INLINE
void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected) {
39010 PyErr_Format(PyExc_ValueError,
39011 "too many values to unpack (expected %" CYTHON_FORMAT_SSIZE_T
"d)", expected);
39015 static CYTHON_INLINE
void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index) {
39016 PyErr_Format(PyExc_ValueError,
39017 "need more than %" CYTHON_FORMAT_SSIZE_T
"d value%.1s to unpack",
39018 index, (index == 1) ?
"" :
"s");
39022 static CYTHON_INLINE
void __Pyx_RaiseNoneNotIterableError(
void) {
39023 PyErr_SetString(PyExc_TypeError,
"'NoneType' object is not iterable");
39027 static CYTHON_INLINE
int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type) {
39028 if (unlikely(!type)) {
39029 PyErr_SetString(PyExc_SystemError,
"Missing type object");
39032 if (likely(__Pyx_TypeCheck(obj, type)))
39034 PyErr_Format(PyExc_TypeError,
"Cannot convert %.200s to %.200s",
39035 Py_TYPE(obj)->tp_name, type->tp_name);
39040 #if CYTHON_FAST_THREAD_STATE
39041 static CYTHON_INLINE
void __Pyx__ExceptionSwap(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) {
39042 PyObject *tmp_type, *tmp_value, *tmp_tb;
39043 #if CYTHON_USE_EXC_INFO_STACK
39044 _PyErr_StackItem *exc_info = tstate->exc_info;
39045 tmp_type = exc_info->exc_type;
39046 tmp_value = exc_info->exc_value;
39047 tmp_tb = exc_info->exc_traceback;
39048 exc_info->exc_type = *type;
39049 exc_info->exc_value = *value;
39050 exc_info->exc_traceback = *tb;
39052 tmp_type = tstate->exc_type;
39053 tmp_value = tstate->exc_value;
39054 tmp_tb = tstate->exc_traceback;
39055 tstate->exc_type = *type;
39056 tstate->exc_value = *value;
39057 tstate->exc_traceback = *tb;
39060 *value = tmp_value;
39064 static CYTHON_INLINE
void __Pyx_ExceptionSwap(PyObject **type, PyObject **value, PyObject **tb) {
39065 PyObject *tmp_type, *tmp_value, *tmp_tb;
39066 PyErr_GetExcInfo(&tmp_type, &tmp_value, &tmp_tb);
39067 PyErr_SetExcInfo(*type, *value, *tb);
39069 *value = tmp_value;
39075 static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list,
int level) {
39076 PyObject *empty_list = 0;
39077 PyObject *module = 0;
39078 PyObject *global_dict = 0;
39079 PyObject *empty_dict = 0;
39081 #if PY_MAJOR_VERSION < 3
39082 PyObject *py_import;
39083 py_import = __Pyx_PyObject_GetAttrStr(__pyx_b, __pyx_n_s_import);
39090 empty_list = PyList_New(0);
39095 global_dict = PyModule_GetDict(__pyx_m);
39098 empty_dict = PyDict_New();
39102 #if PY_MAJOR_VERSION >= 3
39104 if ((1) && (strchr(__Pyx_MODULE_NAME,
'.'))) {
39105 module = PyImport_ImportModuleLevelObject(
39106 name, global_dict, empty_dict, list, 1);
39108 if (!PyErr_ExceptionMatches(PyExc_ImportError))
39117 #if PY_MAJOR_VERSION < 3
39118 PyObject *py_level = PyInt_FromLong(level);
39121 module = PyObject_CallFunctionObjArgs(py_import,
39122 name, global_dict, empty_dict, list, py_level, (PyObject *)NULL);
39123 Py_DECREF(py_level);
39125 module = PyImport_ImportModuleLevelObject(
39126 name, global_dict, empty_dict, list, level);
39131 #if PY_MAJOR_VERSION < 3
39132 Py_XDECREF(py_import);
39134 Py_XDECREF(empty_list);
39135 Py_XDECREF(empty_dict);
39140 #if CYTHON_COMPILING_IN_CPYTHON
39141 static int __Pyx_InBases(PyTypeObject *a, PyTypeObject *b) {
39147 return b == &PyBaseObject_Type;
39149 static CYTHON_INLINE
int __Pyx_IsSubtype(PyTypeObject *a, PyTypeObject *b) {
39151 if (a == b)
return 1;
39155 n = PyTuple_GET_SIZE(mro);
39156 for (i = 0; i <
n; i++) {
39157 if (PyTuple_GET_ITEM(mro, i) == (PyObject *)b)
39162 return __Pyx_InBases(a, b);
39164 #if PY_MAJOR_VERSION == 2
39165 static int __Pyx_inner_PyErr_GivenExceptionMatches2(PyObject *err, PyObject* exc_type1, PyObject* exc_type2) {
39166 PyObject *exception, *value, *tb;
39168 __Pyx_PyThreadState_declare
39169 __Pyx_PyThreadState_assign
39170 __Pyx_ErrFetch(&exception, &value, &tb);
39171 res = exc_type1 ? PyObject_IsSubclass(err, exc_type1) : 0;
39172 if (unlikely(res == -1)) {
39173 PyErr_WriteUnraisable(err);
39177 res = PyObject_IsSubclass(err, exc_type2);
39178 if (unlikely(res == -1)) {
39179 PyErr_WriteUnraisable(err);
39183 __Pyx_ErrRestore(exception, value, tb);
39187 static CYTHON_INLINE
int __Pyx_inner_PyErr_GivenExceptionMatches2(PyObject *err, PyObject* exc_type1, PyObject *exc_type2) {
39188 int res = exc_type1 ? __Pyx_IsSubtype((PyTypeObject*)err, (PyTypeObject*)exc_type1) : 0;
39190 res = __Pyx_IsSubtype((PyTypeObject*)err, (PyTypeObject*)exc_type2);
39195 static int __Pyx_PyErr_GivenExceptionMatchesTuple(PyObject *exc_type, PyObject *tuple) {
39197 assert(PyExceptionClass_Check(exc_type));
39198 n = PyTuple_GET_SIZE(tuple);
39199 #if PY_MAJOR_VERSION >= 3
39200 for (i=0; i<
n; i++) {
39201 if (exc_type == PyTuple_GET_ITEM(tuple, i))
return 1;
39204 for (i=0; i<
n; i++) {
39205 PyObject *t = PyTuple_GET_ITEM(tuple, i);
39206 #if PY_MAJOR_VERSION < 3
39207 if (likely(exc_type == t))
return 1;
39209 if (likely(PyExceptionClass_Check(t))) {
39210 if (__Pyx_inner_PyErr_GivenExceptionMatches2(exc_type, NULL, t))
return 1;
39216 static CYTHON_INLINE
int __Pyx_PyErr_GivenExceptionMatches(PyObject *err, PyObject* exc_type) {
39217 if (likely(err == exc_type))
return 1;
39218 if (likely(PyExceptionClass_Check(err))) {
39219 if (likely(PyExceptionClass_Check(exc_type))) {
39220 return __Pyx_inner_PyErr_GivenExceptionMatches2(err, NULL, exc_type);
39221 }
else if (likely(PyTuple_Check(exc_type))) {
39222 return __Pyx_PyErr_GivenExceptionMatchesTuple(err, exc_type);
39226 return PyErr_GivenExceptionMatches(err, exc_type);
39228 static CYTHON_INLINE
int __Pyx_PyErr_GivenExceptionMatches2(PyObject *err, PyObject *exc_type1, PyObject *exc_type2) {
39229 assert(PyExceptionClass_Check(exc_type1));
39230 assert(PyExceptionClass_Check(exc_type2));
39231 if (likely(err == exc_type1 || err == exc_type2))
return 1;
39232 if (likely(PyExceptionClass_Check(err))) {
39233 return __Pyx_inner_PyErr_GivenExceptionMatches2(err, exc_type1, exc_type2);
39235 return (PyErr_GivenExceptionMatches(err, exc_type1) || PyErr_GivenExceptionMatches(err, exc_type2));
39240 static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name) {
39241 PyObject* value = __Pyx_PyObject_GetAttrStr(module, name);
39242 if (unlikely(!value) && PyErr_ExceptionMatches(PyExc_AttributeError)) {
39243 PyErr_Format(PyExc_ImportError,
39244 #
if PY_MAJOR_VERSION < 3
39245 "cannot import name %.230s", PyString_AS_STRING(name));
39247 "cannot import name %S", name);
39254 static CYTHON_INLINE
int __Pyx_HasAttr(PyObject *o, PyObject *
n) {
39256 if (unlikely(!__Pyx_PyBaseString_Check(
n))) {
39257 PyErr_SetString(PyExc_TypeError,
39258 "hasattr(): attribute name must be string");
39261 r = __Pyx_GetAttr(o,
n);
39262 if (unlikely(!
r)) {
39272 #if !CYTHON_COMPILING_IN_CPYTHON
39273 static CYTHON_INLINE PyObject* __Pyx_PyBytes_Join(PyObject* sep, PyObject* values) {
39274 return PyObject_CallMethodObjArgs(sep, __pyx_n_s_join, values, NULL);
39279 #if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000
39280 static PyObject *__Pyx_RaiseGenericGetAttributeError(PyTypeObject *tp, PyObject *attr_name) {
39281 PyErr_Format(PyExc_AttributeError,
39282 #
if PY_MAJOR_VERSION >= 3
39283 "'%.50s' object has no attribute '%U'",
39284 tp->tp_name, attr_name);
39286 "'%.50s' object has no attribute '%.400s'",
39287 tp->tp_name, PyString_AS_STRING(attr_name));
39291 static CYTHON_INLINE PyObject* __Pyx_PyObject_GenericGetAttrNoDict(PyObject* obj, PyObject* attr_name) {
39293 PyTypeObject *tp = Py_TYPE(obj);
39294 if (unlikely(!PyString_Check(attr_name))) {
39295 return PyObject_GenericGetAttr(obj, attr_name);
39297 assert(!tp->tp_dictoffset);
39298 descr = _PyType_Lookup(tp, attr_name);
39299 if (unlikely(!descr)) {
39300 return __Pyx_RaiseGenericGetAttributeError(tp, attr_name);
39303 #if PY_MAJOR_VERSION < 3
39304 if (likely(PyType_HasFeature(Py_TYPE(descr), Py_TPFLAGS_HAVE_CLASS)))
39307 descrgetfunc
f = Py_TYPE(descr)->tp_descr_get;
39309 PyObject *res =
f(descr, obj, (PyObject *)tp);
39319 #if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000
39320 static PyObject* __Pyx_PyObject_GenericGetAttr(PyObject* obj, PyObject* attr_name) {
39321 if (unlikely(Py_TYPE(obj)->tp_dictoffset)) {
39322 return PyObject_GenericGetAttr(obj, attr_name);
39324 return __Pyx_PyObject_GenericGetAttrNoDict(obj, attr_name);
39329 static int __Pyx_SetVtable(PyObject *dict,
void *vtable) {
39330 #if PY_VERSION_HEX >= 0x02070000
39331 PyObject *ob = PyCapsule_New(vtable, 0, 0);
39333 PyObject *ob = PyCObject_FromVoidPtr(vtable, 0);
39337 if (PyDict_SetItem(dict, __pyx_n_s_pyx_vtable, ob) < 0)
39347 static void __Pyx_PyObject_GetAttrStr_ClearAttributeError(
void) {
39348 __Pyx_PyThreadState_declare
39349 __Pyx_PyThreadState_assign
39350 if (likely(__Pyx_PyErr_ExceptionMatches(PyExc_AttributeError)))
39351 __Pyx_PyErr_Clear();
39353 static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStrNoError(PyObject* obj, PyObject* attr_name) {
39355 #if CYTHON_COMPILING_IN_CPYTHON && CYTHON_USE_TYPE_SLOTS && PY_VERSION_HEX >= 0x030700B1
39356 PyTypeObject* tp = Py_TYPE(obj);
39357 if (likely(tp->tp_getattro == PyObject_GenericGetAttr)) {
39358 return _PyObject_GenericGetAttrWithDict(obj, attr_name, NULL, 1);
39361 result = __Pyx_PyObject_GetAttrStr(obj, attr_name);
39362 if (unlikely(!result)) {
39363 __Pyx_PyObject_GetAttrStr_ClearAttributeError();
39369 static int __Pyx_setup_reduce_is_named(PyObject* meth, PyObject* name) {
39371 PyObject *name_attr;
39372 name_attr = __Pyx_PyObject_GetAttrStr(meth, __pyx_n_s_name_2);
39373 if (likely(name_attr)) {
39374 ret = PyObject_RichCompareBool(name_attr, name, Py_EQ);
39378 if (unlikely(ret < 0)) {
39382 Py_XDECREF(name_attr);
39385 static int __Pyx_setup_reduce(PyObject* type_obj) {
39387 PyObject *object_reduce = NULL;
39388 PyObject *object_getstate = NULL;
39389 PyObject *object_reduce_ex = NULL;
39390 PyObject *reduce = NULL;
39391 PyObject *reduce_ex = NULL;
39392 PyObject *reduce_cython = NULL;
39393 PyObject *setstate = NULL;
39394 PyObject *setstate_cython = NULL;
39395 PyObject *getstate = NULL;
39396 #if CYTHON_USE_PYTYPE_LOOKUP
39397 getstate = _PyType_Lookup((PyTypeObject*)type_obj, __pyx_n_s_getstate);
39399 getstate = __Pyx_PyObject_GetAttrStrNoError(type_obj, __pyx_n_s_getstate);
39400 if (!getstate && PyErr_Occurred()) {
39405 #if CYTHON_USE_PYTYPE_LOOKUP
39406 object_getstate = _PyType_Lookup(&PyBaseObject_Type, __pyx_n_s_getstate);
39408 object_getstate = __Pyx_PyObject_GetAttrStrNoError((PyObject*)&PyBaseObject_Type, __pyx_n_s_getstate);
39409 if (!object_getstate && PyErr_Occurred()) {
39413 if (object_getstate != getstate) {
39417 #if CYTHON_USE_PYTYPE_LOOKUP
39418 object_reduce_ex = _PyType_Lookup(&PyBaseObject_Type, __pyx_n_s_reduce_ex);
if (!object_reduce_ex)
goto __PYX_BAD;
39420 object_reduce_ex = __Pyx_PyObject_GetAttrStr((PyObject*)&PyBaseObject_Type, __pyx_n_s_reduce_ex);
if (!object_reduce_ex)
goto __PYX_BAD;
39422 reduce_ex = __Pyx_PyObject_GetAttrStr(type_obj, __pyx_n_s_reduce_ex);
if (unlikely(!reduce_ex))
goto __PYX_BAD;
39423 if (reduce_ex == object_reduce_ex) {
39424 #if CYTHON_USE_PYTYPE_LOOKUP
39425 object_reduce = _PyType_Lookup(&PyBaseObject_Type, __pyx_n_s_reduce);
if (!object_reduce)
goto __PYX_BAD;
39427 object_reduce = __Pyx_PyObject_GetAttrStr((PyObject*)&PyBaseObject_Type, __pyx_n_s_reduce);
if (!object_reduce)
goto __PYX_BAD;
39429 reduce = __Pyx_PyObject_GetAttrStr(type_obj, __pyx_n_s_reduce);
if (unlikely(!reduce))
goto __PYX_BAD;
39430 if (reduce == object_reduce || __Pyx_setup_reduce_is_named(reduce, __pyx_n_s_reduce_cython)) {
39431 reduce_cython = __Pyx_PyObject_GetAttrStrNoError(type_obj, __pyx_n_s_reduce_cython);
39432 if (likely(reduce_cython)) {
39433 ret = PyDict_SetItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_reduce, reduce_cython);
if (unlikely(ret < 0))
goto __PYX_BAD;
39434 ret = PyDict_DelItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_reduce_cython);
if (unlikely(ret < 0))
goto __PYX_BAD;
39435 }
else if (reduce == object_reduce || PyErr_Occurred()) {
39438 setstate = __Pyx_PyObject_GetAttrStr(type_obj, __pyx_n_s_setstate);
39439 if (!setstate) PyErr_Clear();
39440 if (!setstate || __Pyx_setup_reduce_is_named(setstate, __pyx_n_s_setstate_cython)) {
39441 setstate_cython = __Pyx_PyObject_GetAttrStrNoError(type_obj, __pyx_n_s_setstate_cython);
39442 if (likely(setstate_cython)) {
39443 ret = PyDict_SetItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_setstate, setstate_cython);
if (unlikely(ret < 0))
goto __PYX_BAD;
39444 ret = PyDict_DelItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_setstate_cython);
if (unlikely(ret < 0))
goto __PYX_BAD;
39445 }
else if (!setstate || PyErr_Occurred()) {
39449 PyType_Modified((PyTypeObject*)type_obj);
39454 if (!PyErr_Occurred())
39455 PyErr_Format(PyExc_RuntimeError,
"Unable to initialize pickling for %s", ((PyTypeObject*)type_obj)->tp_name);
39458 #if !CYTHON_USE_PYTYPE_LOOKUP
39459 Py_XDECREF(object_reduce);
39460 Py_XDECREF(object_reduce_ex);
39461 Py_XDECREF(object_getstate);
39462 Py_XDECREF(getstate);
39464 Py_XDECREF(reduce);
39465 Py_XDECREF(reduce_ex);
39466 Py_XDECREF(reduce_cython);
39467 Py_XDECREF(setstate);
39468 Py_XDECREF(setstate_cython);
39473 #ifndef __PYX_HAVE_RT_ImportType
39474 #define __PYX_HAVE_RT_ImportType
39475 static PyTypeObject *__Pyx_ImportType(PyObject *module,
const char *module_name,
const char *class_name,
39476 size_t size,
enum __Pyx_ImportType_CheckSize check_size)
39478 PyObject *result = 0;
39480 Py_ssize_t basicsize;
39481 #ifdef Py_LIMITED_API
39482 PyObject *py_basicsize;
39484 result = PyObject_GetAttrString(module, class_name);
39487 if (!PyType_Check(result)) {
39488 PyErr_Format(PyExc_TypeError,
39489 "%.200s.%.200s is not a type object",
39490 module_name, class_name);
39493 #ifndef Py_LIMITED_API
39494 basicsize = ((PyTypeObject *)result)->tp_basicsize;
39496 py_basicsize = PyObject_GetAttrString(result,
"__basicsize__");
39499 basicsize = PyLong_AsSsize_t(py_basicsize);
39500 Py_DECREF(py_basicsize);
39502 if (basicsize == (Py_ssize_t)-1 && PyErr_Occurred())
39505 if ((
size_t)basicsize < size) {
39506 PyErr_Format(PyExc_ValueError,
39507 "%.200s.%.200s size changed, may indicate binary incompatibility. "
39508 "Expected %zd from C header, got %zd from PyObject",
39509 module_name, class_name, size, basicsize);
39512 if (check_size == __Pyx_ImportType_CheckSize_Error && (
size_t)basicsize != size) {
39513 PyErr_Format(PyExc_ValueError,
39514 "%.200s.%.200s size changed, may indicate binary incompatibility. "
39515 "Expected %zd from C header, got %zd from PyObject",
39516 module_name, class_name, size, basicsize);
39519 else if (check_size == __Pyx_ImportType_CheckSize_Warn && (
size_t)basicsize > size) {
39520 PyOS_snprintf(warning,
sizeof(warning),
39521 "%s.%s size changed, may indicate binary incompatibility. "
39522 "Expected %zd from C header, got %zd from PyObject",
39523 module_name, class_name, size, basicsize);
39524 if (PyErr_WarnEx(NULL, warning, 0) < 0)
goto bad;
39526 return (PyTypeObject *)result;
39528 Py_XDECREF(result);
39534 #ifndef CYTHON_CLINE_IN_TRACEBACK
39535 static int __Pyx_CLineForTraceback(CYTHON_NCP_UNUSED PyThreadState *tstate,
int c_line) {
39536 PyObject *use_cline;
39537 PyObject *ptype, *pvalue, *ptraceback;
39538 #if CYTHON_COMPILING_IN_CPYTHON
39539 PyObject **cython_runtime_dict;
39541 if (unlikely(!__pyx_cython_runtime)) {
39544 __Pyx_ErrFetchInState(tstate, &ptype, &pvalue, &ptraceback);
39545 #if CYTHON_COMPILING_IN_CPYTHON
39546 cython_runtime_dict = _PyObject_GetDictPtr(__pyx_cython_runtime);
39547 if (likely(cython_runtime_dict)) {
39548 __PYX_PY_DICT_LOOKUP_IF_MODIFIED(
39549 use_cline, *cython_runtime_dict,
39550 __Pyx_PyDict_GetItemStr(*cython_runtime_dict, __pyx_n_s_cline_in_traceback))
39554 PyObject *use_cline_obj = __Pyx_PyObject_GetAttrStr(__pyx_cython_runtime, __pyx_n_s_cline_in_traceback);
39555 if (use_cline_obj) {
39556 use_cline = PyObject_Not(use_cline_obj) ? Py_False : Py_True;
39557 Py_DECREF(use_cline_obj);
39565 (void) PyObject_SetAttr(__pyx_cython_runtime, __pyx_n_s_cline_in_traceback, Py_False);
39567 else if (use_cline == Py_False || (use_cline != Py_True && PyObject_Not(use_cline) != 0)) {
39570 __Pyx_ErrRestoreInState(tstate, ptype, pvalue, ptraceback);
39576 static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries,
int count,
int code_line) {
39577 int start = 0, mid = 0, end = count - 1;
39578 if (end >= 0 && code_line > entries[end].code_line) {
39581 while (start < end) {
39582 mid = start + (end - start) / 2;
39583 if (code_line < entries[mid].code_line) {
39585 }
else if (code_line > entries[mid].code_line) {
39591 if (code_line <= entries[mid].code_line) {
39597 static PyCodeObject *__pyx_find_code_object(
int code_line) {
39598 PyCodeObject* code_object;
39600 if (unlikely(!code_line) || unlikely(!__pyx_code_cache.entries)) {
39603 pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line);
39604 if (unlikely(
pos >= __pyx_code_cache.count) || unlikely(__pyx_code_cache.entries[
pos].code_line != code_line)) {
39607 code_object = __pyx_code_cache.entries[
pos].code_object;
39608 Py_INCREF(code_object);
39609 return code_object;
39611 static void __pyx_insert_code_object(
int code_line, PyCodeObject* code_object) {
39613 __Pyx_CodeObjectCacheEntry* entries = __pyx_code_cache.entries;
39614 if (unlikely(!code_line)) {
39617 if (unlikely(!entries)) {
39618 entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Malloc(64*
sizeof(__Pyx_CodeObjectCacheEntry));
39619 if (likely(entries)) {
39620 __pyx_code_cache.entries = entries;
39621 __pyx_code_cache.max_count = 64;
39622 __pyx_code_cache.count = 1;
39623 entries[0].code_line = code_line;
39624 entries[0].code_object = code_object;
39625 Py_INCREF(code_object);
39629 pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line);
39630 if ((
pos < __pyx_code_cache.count) && unlikely(__pyx_code_cache.entries[
pos].code_line == code_line)) {
39631 PyCodeObject* tmp = entries[
pos].code_object;
39632 entries[
pos].code_object = code_object;
39636 if (__pyx_code_cache.count == __pyx_code_cache.max_count) {
39637 int new_max = __pyx_code_cache.max_count + 64;
39638 entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Realloc(
39639 __pyx_code_cache.entries, ((
size_t)new_max) *
sizeof(__Pyx_CodeObjectCacheEntry));
39640 if (unlikely(!entries)) {
39643 __pyx_code_cache.entries = entries;
39644 __pyx_code_cache.max_count = new_max;
39646 for (i=__pyx_code_cache.count; i>
pos; i--) {
39647 entries[i] = entries[i-1];
39649 entries[
pos].code_line = code_line;
39650 entries[
pos].code_object = code_object;
39651 __pyx_code_cache.count++;
39652 Py_INCREF(code_object);
39656 #include "compile.h"
39657 #include "frameobject.h"
39658 #include "traceback.h"
39659 #if PY_VERSION_HEX >= 0x030b00a6
39660 #ifndef Py_BUILD_CORE
39661 #define Py_BUILD_CORE 1
39663 #include "internal/pycore_frame.h"
39665 static PyCodeObject* __Pyx_CreateCodeObjectForTraceback(
39666 const char *funcname,
int c_line,
39667 int py_line,
const char *filename) {
39668 PyCodeObject *py_code = NULL;
39669 PyObject *py_funcname = NULL;
39670 #if PY_MAJOR_VERSION < 3
39671 PyObject *py_srcfile = NULL;
39672 py_srcfile = PyString_FromString(filename);
39673 if (!py_srcfile)
goto bad;
39676 #if PY_MAJOR_VERSION < 3
39677 py_funcname = PyString_FromFormat(
"%s (%s:%d)", funcname, __pyx_cfilenm, c_line);
39678 if (!py_funcname)
goto bad;
39680 py_funcname = PyUnicode_FromFormat(
"%s (%s:%d)", funcname, __pyx_cfilenm, c_line);
39681 if (!py_funcname)
goto bad;
39682 funcname = PyUnicode_AsUTF8(py_funcname);
39683 if (!funcname)
goto bad;
39687 #if PY_MAJOR_VERSION < 3
39688 py_funcname = PyString_FromString(funcname);
39689 if (!py_funcname)
goto bad;
39692 #if PY_MAJOR_VERSION < 3
39693 py_code = __Pyx_PyCode_New(
39710 Py_DECREF(py_srcfile);
39712 py_code = PyCode_NewEmpty(filename, funcname, py_line);
39714 Py_XDECREF(py_funcname);
39717 Py_XDECREF(py_funcname);
39718 #if PY_MAJOR_VERSION < 3
39719 Py_XDECREF(py_srcfile);
39723 static void __Pyx_AddTraceback(
const char *funcname,
int c_line,
39724 int py_line,
const char *filename) {
39725 PyCodeObject *py_code = 0;
39726 PyFrameObject *py_frame = 0;
39727 PyThreadState *tstate = __Pyx_PyThreadState_Current;
39728 PyObject *ptype, *pvalue, *ptraceback;
39730 c_line = __Pyx_CLineForTraceback(tstate, c_line);
39732 py_code = __pyx_find_code_object(c_line ? -c_line : py_line);
39734 __Pyx_ErrFetchInState(tstate, &ptype, &pvalue, &ptraceback);
39735 py_code = __Pyx_CreateCodeObjectForTraceback(
39736 funcname, c_line, py_line, filename);
39741 Py_XDECREF(pvalue);
39742 Py_XDECREF(ptraceback);
39745 __Pyx_ErrRestoreInState(tstate, ptype, pvalue, ptraceback);
39746 __pyx_insert_code_object(c_line ? -c_line : py_line, py_code);
39748 py_frame = PyFrame_New(
39754 if (!py_frame)
goto bad;
39755 __Pyx_PyFrame_SetLineNumber(py_frame, py_line);
39756 PyTraceBack_Here(py_frame);
39758 Py_XDECREF(py_code);
39759 Py_XDECREF(py_frame);
39762 #if PY_MAJOR_VERSION < 3
39763 static int __Pyx_GetBuffer(PyObject *obj, Py_buffer *view,
int flags) {
39764 if (PyObject_CheckBuffer(obj))
return PyObject_GetBuffer(obj, view, flags);
39765 if (__Pyx_TypeCheck(obj, __pyx_array_type))
return __pyx_array_getbuffer(obj, view, flags);
39766 if (__Pyx_TypeCheck(obj, __pyx_memoryview_type))
return __pyx_memoryview_getbuffer(obj, view, flags);
39767 PyErr_Format(PyExc_TypeError,
"'%.200s' does not have the buffer interface", Py_TYPE(obj)->tp_name);
39770 static void __Pyx_ReleaseBuffer(Py_buffer *view) {
39771 PyObject *obj = view->obj;
39773 if (PyObject_CheckBuffer(obj)) {
39774 PyBuffer_Release(view);
39786 __pyx_memviewslice_is_contig(
const __Pyx_memviewslice mvs,
char order,
int ndim)
39788 int i, index, step, start;
39789 Py_ssize_t itemsize = mvs.memview->view.itemsize;
39790 if (order ==
'F') {
39797 for (i = 0; i < ndim; i++) {
39798 index = start + step * i;
39799 if (mvs.suboffsets[index] >= 0 || mvs.strides[index] != itemsize)
39801 itemsize *= mvs.shape[index];
39808 __pyx_get_array_memory_extents(__Pyx_memviewslice *slice,
39809 void **out_start,
void **out_end,
39810 int ndim,
size_t itemsize)
39814 start = end = slice->data;
39815 for (i = 0; i < ndim; i++) {
39816 Py_ssize_t stride = slice->strides[i];
39817 Py_ssize_t extent = slice->shape[i];
39819 *out_start = *out_end = start;
39823 end += stride * (extent - 1);
39825 start += stride * (extent - 1);
39828 *out_start = start;
39829 *out_end = end + itemsize;
39832 __pyx_slices_overlap(__Pyx_memviewslice *slice1,
39833 __Pyx_memviewslice *slice2,
39834 int ndim,
size_t itemsize)
39836 void *start1, *end1, *start2, *end2;
39837 __pyx_get_array_memory_extents(slice1, &start1, &end1, ndim, itemsize);
39838 __pyx_get_array_memory_extents(slice2, &start2, &end2, ndim, itemsize);
39839 return (start1 < end2) && (start2 < end1);
39843 static CYTHON_INLINE PyObject *
39844 __pyx_capsule_create(
void *p, CYTHON_UNUSED
const char *sig)
39847 #if PY_VERSION_HEX >= 0x02070000
39848 cobj = PyCapsule_New(p, sig, NULL);
39850 cobj = PyCObject_FromVoidPtr(p, NULL);
39856 static CYTHON_INLINE
int __Pyx_Is_Little_Endian(
void)
39862 S.u32 = 0x01020304;
39863 return S.u8[0] == 4;
39867 static void __Pyx_BufFmt_Init(__Pyx_BufFmt_Context* ctx,
39868 __Pyx_BufFmt_StackElem* stack,
39869 __Pyx_TypeInfo* type) {
39870 stack[0].field = &ctx->root;
39871 stack[0].parent_offset = 0;
39872 ctx->root.type = type;
39873 ctx->root.name =
"buffer dtype";
39874 ctx->root.offset = 0;
39876 ctx->head->field = &ctx->root;
39877 ctx->fmt_offset = 0;
39878 ctx->head->parent_offset = 0;
39879 ctx->new_packmode =
'@';
39880 ctx->enc_packmode =
'@';
39881 ctx->new_count = 1;
39882 ctx->enc_count = 0;
39884 ctx->is_complex = 0;
39885 ctx->is_valid_array = 0;
39886 ctx->struct_alignment = 0;
39887 while (type->typegroup ==
'S') {
39889 ctx->head->field = type->fields;
39890 ctx->head->parent_offset = 0;
39891 type = type->fields->type;
39894 static int __Pyx_BufFmt_ParseNumber(
const char** ts) {
39896 const char* t = *ts;
39897 if (*t < '0' || *t >
'9') {
39900 count = *t++ -
'0';
39901 while (*t >=
'0' && *t <=
'9') {
39903 count += *t++ -
'0';
39909 static int __Pyx_BufFmt_ExpectNumber(
const char **ts) {
39910 int number = __Pyx_BufFmt_ParseNumber(ts);
39912 PyErr_Format(PyExc_ValueError,\
39913 "Does not understand character buffer dtype format string ('%c')", **ts);
39916 static void __Pyx_BufFmt_RaiseUnexpectedChar(
char ch) {
39917 PyErr_Format(PyExc_ValueError,
39918 "Unexpected format string character: '%c'", ch);
39920 static const char* __Pyx_BufFmt_DescribeTypeChar(
char ch,
int is_complex) {
39922 case '?':
return "'bool'";
39923 case 'c':
return "'char'";
39924 case 'b':
return "'signed char'";
39925 case 'B':
return "'unsigned char'";
39926 case 'h':
return "'short'";
39927 case 'H':
return "'unsigned short'";
39928 case 'i':
return "'int'";
39929 case 'I':
return "'unsigned int'";
39930 case 'l':
return "'long'";
39931 case 'L':
return "'unsigned long'";
39932 case 'q':
return "'long long'";
39933 case 'Q':
return "'unsigned long long'";
39934 case 'f':
return (is_complex ?
"'complex float'" :
"'float'");
39935 case 'd':
return (is_complex ?
"'complex double'" :
"'double'");
39936 case 'g':
return (is_complex ?
"'complex long double'" :
"'long double'");
39937 case 'T':
return "a struct";
39938 case 'O':
return "Python object";
39939 case 'P':
return "a pointer";
39940 case 's':
case 'p':
return "a string";
39941 case 0:
return "end";
39942 default:
return "unparseable format string";
39945 static size_t __Pyx_BufFmt_TypeCharToStandardSize(
char ch,
int is_complex) {
39947 case '?':
case 'c':
case 'b':
case 'B':
case 's':
case 'p':
return 1;
39948 case 'h':
case 'H':
return 2;
39949 case 'i':
case 'I':
case 'l':
case 'L':
return 4;
39950 case 'q':
case 'Q':
return 8;
39951 case 'f':
return (is_complex ? 8 : 4);
39952 case 'd':
return (is_complex ? 16 : 8);
39954 PyErr_SetString(PyExc_ValueError,
"Python does not define a standard format string size for long double ('g')..");
39957 case 'O':
case 'P':
return sizeof(
void*);
39959 __Pyx_BufFmt_RaiseUnexpectedChar(ch);
39963 static size_t __Pyx_BufFmt_TypeCharToNativeSize(
char ch,
int is_complex) {
39965 case '?':
case 'c':
case 'b':
case 'B':
case 's':
case 'p':
return 1;
39966 case 'h':
case 'H':
return sizeof(short);
39967 case 'i':
case 'I':
return sizeof(int);
39968 case 'l':
case 'L':
return sizeof(long);
39969 #ifdef HAVE_LONG_LONG
39970 case 'q':
case 'Q':
return sizeof(PY_LONG_LONG);
39972 case 'f':
return sizeof(float) * (is_complex ? 2 : 1);
39973 case 'd':
return sizeof(double) * (is_complex ? 2 : 1);
39974 case 'g':
return sizeof(
long double) * (is_complex ? 2 : 1);
39975 case 'O':
case 'P':
return sizeof(
void*);
39977 __Pyx_BufFmt_RaiseUnexpectedChar(ch);
39982 typedef struct {
char c;
short x; } __Pyx_st_short;
39983 typedef struct {
char c;
int x; } __Pyx_st_int;
39984 typedef struct {
char c;
long x; } __Pyx_st_long;
39985 typedef struct {
char c;
float x; } __Pyx_st_float;
39986 typedef struct {
char c;
double x; } __Pyx_st_double;
39987 typedef struct {
char c;
long double x; } __Pyx_st_longdouble;
39988 typedef struct {
char c;
void *x; } __Pyx_st_void_p;
39989 #ifdef HAVE_LONG_LONG
39990 typedef struct {
char c; PY_LONG_LONG x; } __Pyx_st_longlong;
39992 static size_t __Pyx_BufFmt_TypeCharToAlignment(
char ch, CYTHON_UNUSED
int is_complex) {
39994 case '?':
case 'c':
case 'b':
case 'B':
case 's':
case 'p':
return 1;
39995 case 'h':
case 'H':
return sizeof(__Pyx_st_short) -
sizeof(
short);
39996 case 'i':
case 'I':
return sizeof(__Pyx_st_int) -
sizeof(
int);
39997 case 'l':
case 'L':
return sizeof(__Pyx_st_long) -
sizeof(
long);
39998 #ifdef HAVE_LONG_LONG
39999 case 'q':
case 'Q':
return sizeof(__Pyx_st_longlong) -
sizeof(PY_LONG_LONG);
40001 case 'f':
return sizeof(__Pyx_st_float) -
sizeof(
float);
40002 case 'd':
return sizeof(__Pyx_st_double) -
sizeof(
double);
40003 case 'g':
return sizeof(__Pyx_st_longdouble) -
sizeof(
long double);
40004 case 'P':
case 'O':
return sizeof(__Pyx_st_void_p) -
sizeof(
void*);
40006 __Pyx_BufFmt_RaiseUnexpectedChar(ch);
40014 typedef struct {
short x;
char c; } __Pyx_pad_short;
40015 typedef struct {
int x;
char c; } __Pyx_pad_int;
40016 typedef struct {
long x;
char c; } __Pyx_pad_long;
40017 typedef struct {
float x;
char c; } __Pyx_pad_float;
40018 typedef struct {
double x;
char c; } __Pyx_pad_double;
40019 typedef struct {
long double x;
char c; } __Pyx_pad_longdouble;
40020 typedef struct {
void *x;
char c; } __Pyx_pad_void_p;
40021 #ifdef HAVE_LONG_LONG
40022 typedef struct { PY_LONG_LONG x;
char c; } __Pyx_pad_longlong;
40024 static size_t __Pyx_BufFmt_TypeCharToPadding(
char ch, CYTHON_UNUSED
int is_complex) {
40026 case '?':
case 'c':
case 'b':
case 'B':
case 's':
case 'p':
return 1;
40027 case 'h':
case 'H':
return sizeof(__Pyx_pad_short) -
sizeof(
short);
40028 case 'i':
case 'I':
return sizeof(__Pyx_pad_int) -
sizeof(
int);
40029 case 'l':
case 'L':
return sizeof(__Pyx_pad_long) -
sizeof(
long);
40030 #ifdef HAVE_LONG_LONG
40031 case 'q':
case 'Q':
return sizeof(__Pyx_pad_longlong) -
sizeof(PY_LONG_LONG);
40033 case 'f':
return sizeof(__Pyx_pad_float) -
sizeof(
float);
40034 case 'd':
return sizeof(__Pyx_pad_double) -
sizeof(
double);
40035 case 'g':
return sizeof(__Pyx_pad_longdouble) -
sizeof(
long double);
40036 case 'P':
case 'O':
return sizeof(__Pyx_pad_void_p) -
sizeof(
void*);
40038 __Pyx_BufFmt_RaiseUnexpectedChar(ch);
40042 static char __Pyx_BufFmt_TypeCharToGroup(
char ch,
int is_complex) {
40046 case 'b':
case 'h':
case 'i':
40047 case 'l':
case 'q':
case 's':
case 'p':
40049 case '?':
case 'B':
case 'H':
case 'I':
case 'L':
case 'Q':
40051 case 'f':
case 'd':
case 'g':
40052 return (is_complex ?
'C' :
'R');
40058 __Pyx_BufFmt_RaiseUnexpectedChar(ch);
40063 static void __Pyx_BufFmt_RaiseExpected(__Pyx_BufFmt_Context* ctx) {
40064 if (ctx->head == NULL || ctx->head->field == &ctx->root) {
40065 const char* expected;
40067 if (ctx->head == NULL) {
40071 expected = ctx->head->field->type->name;
40074 PyErr_Format(PyExc_ValueError,
40075 "Buffer dtype mismatch, expected %s%s%s but got %s",
40076 quote, expected, quote,
40077 __Pyx_BufFmt_DescribeTypeChar(ctx->enc_type, ctx->is_complex));
40079 __Pyx_StructField* field = ctx->head->field;
40080 __Pyx_StructField* parent = (ctx->head - 1)->field;
40081 PyErr_Format(PyExc_ValueError,
40082 "Buffer dtype mismatch, expected '%s' but got %s in '%s.%s'",
40083 field->type->name, __Pyx_BufFmt_DescribeTypeChar(ctx->enc_type, ctx->is_complex),
40084 parent->type->name, field->name);
40087 static int __Pyx_BufFmt_ProcessTypeChunk(__Pyx_BufFmt_Context* ctx) {
40089 size_t size, offset, arraysize = 1;
40090 if (ctx->enc_type == 0)
return 0;
40091 if (ctx->head->field->type->arraysize[0]) {
40093 if (ctx->enc_type ==
's' || ctx->enc_type ==
'p') {
40094 ctx->is_valid_array = ctx->head->field->type->ndim == 1;
40096 if (ctx->enc_count != ctx->head->field->type->arraysize[0]) {
40097 PyErr_Format(PyExc_ValueError,
40098 "Expected a dimension of size %zu, got %zu",
40099 ctx->head->field->type->arraysize[0], ctx->enc_count);
40103 if (!ctx->is_valid_array) {
40104 PyErr_Format(PyExc_ValueError,
"Expected %d dimensions, got %d",
40105 ctx->head->field->type->ndim, ndim);
40108 for (i = 0; i < ctx->head->field->type->ndim; i++) {
40109 arraysize *= ctx->head->field->type->arraysize[i];
40111 ctx->is_valid_array = 0;
40112 ctx->enc_count = 1;
40114 group = __Pyx_BufFmt_TypeCharToGroup(ctx->enc_type, ctx->is_complex);
40116 __Pyx_StructField* field = ctx->head->field;
40117 __Pyx_TypeInfo* type = field->type;
40118 if (ctx->enc_packmode ==
'@' || ctx->enc_packmode ==
'^') {
40119 size = __Pyx_BufFmt_TypeCharToNativeSize(ctx->enc_type, ctx->is_complex);
40121 size = __Pyx_BufFmt_TypeCharToStandardSize(ctx->enc_type, ctx->is_complex);
40123 if (ctx->enc_packmode ==
'@') {
40124 size_t align_at = __Pyx_BufFmt_TypeCharToAlignment(ctx->enc_type, ctx->is_complex);
40125 size_t align_mod_offset;
40126 if (align_at == 0)
return -1;
40127 align_mod_offset = ctx->fmt_offset % align_at;
40128 if (align_mod_offset > 0) ctx->fmt_offset += align_at - align_mod_offset;
40129 if (ctx->struct_alignment == 0)
40130 ctx->struct_alignment = __Pyx_BufFmt_TypeCharToPadding(ctx->enc_type,
40133 if (type->size != size || type->typegroup != group) {
40134 if (type->typegroup ==
'C' && type->fields != NULL) {
40135 size_t parent_offset = ctx->head->parent_offset + field->offset;
40137 ctx->head->field = type->fields;
40138 ctx->head->parent_offset = parent_offset;
40141 if ((type->typegroup ==
'H' || group ==
'H') && type->size == size) {
40143 __Pyx_BufFmt_RaiseExpected(ctx);
40147 offset = ctx->head->parent_offset + field->offset;
40148 if (ctx->fmt_offset != offset) {
40149 PyErr_Format(PyExc_ValueError,
40150 "Buffer dtype mismatch; next field is at offset %" CYTHON_FORMAT_SSIZE_T
"d but %" CYTHON_FORMAT_SSIZE_T
"d expected",
40151 (Py_ssize_t)ctx->fmt_offset, (Py_ssize_t)offset);
40154 ctx->fmt_offset += size;
40156 ctx->fmt_offset += (arraysize - 1) * size;
40159 if (field == &ctx->root) {
40161 if (ctx->enc_count != 0) {
40162 __Pyx_BufFmt_RaiseExpected(ctx);
40167 ctx->head->field = ++field;
40168 if (field->type == NULL) {
40170 field = ctx->head->field;
40172 }
else if (field->type->typegroup ==
'S') {
40173 size_t parent_offset = ctx->head->parent_offset + field->offset;
40174 if (field->type->fields->type == NULL)
continue;
40175 field = field->type->fields;
40177 ctx->head->field = field;
40178 ctx->head->parent_offset = parent_offset;
40184 }
while (ctx->enc_count);
40186 ctx->is_complex = 0;
40190 __pyx_buffmt_parse_array(__Pyx_BufFmt_Context* ctx,
const char** tsp)
40192 const char *ts = *tsp;
40193 int i = 0,
number, ndim;
40195 if (ctx->new_count != 1) {
40196 PyErr_SetString(PyExc_ValueError,
40197 "Cannot handle repeated arrays in format string");
40200 if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1)
return NULL;
40201 ndim = ctx->head->field->type->ndim;
40202 while (*ts && *ts !=
')') {
40204 case ' ':
case '\f':
case '\r':
case '\n':
case '\t':
case '\v':
continue;
40207 number = __Pyx_BufFmt_ExpectNumber(&ts);
40208 if (
number == -1)
return NULL;
40209 if (i < ndim && (
size_t)
number != ctx->head->field->type->arraysize[i])
40210 return PyErr_Format(PyExc_ValueError,
40211 "Expected a dimension of size %zu, got %d",
40212 ctx->head->field->type->arraysize[i],
number);
40213 if (*ts !=
',' && *ts !=
')')
40214 return PyErr_Format(PyExc_ValueError,
40215 "Expected a comma in format string, got '%c'", *ts);
40216 if (*ts ==
',') ts++;
40220 return PyErr_Format(PyExc_ValueError,
"Expected %d dimension(s), got %d",
40221 ctx->head->field->type->ndim, i);
40223 PyErr_SetString(PyExc_ValueError,
40224 "Unexpected end of format string, expected ')'");
40227 ctx->is_valid_array = 1;
40228 ctx->new_count = 1;
40232 static const char* __Pyx_BufFmt_CheckString(__Pyx_BufFmt_Context* ctx,
const char* ts) {
40237 if (ctx->enc_type != 0 && ctx->head == NULL) {
40238 __Pyx_BufFmt_RaiseExpected(ctx);
40241 if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1)
return NULL;
40242 if (ctx->head != NULL) {
40243 __Pyx_BufFmt_RaiseExpected(ctx);
40253 if (!__Pyx_Is_Little_Endian()) {
40254 PyErr_SetString(PyExc_ValueError,
"Little-endian buffer not supported on big-endian compiler");
40257 ctx->new_packmode =
'=';
40262 if (__Pyx_Is_Little_Endian()) {
40263 PyErr_SetString(PyExc_ValueError,
"Big-endian buffer not supported on little-endian compiler");
40266 ctx->new_packmode =
'=';
40272 ctx->new_packmode = *ts++;
40276 const char* ts_after_sub;
40277 size_t i, struct_count = ctx->new_count;
40278 size_t struct_alignment = ctx->struct_alignment;
40279 ctx->new_count = 1;
40282 PyErr_SetString(PyExc_ValueError,
"Buffer acquisition: Expected '{' after 'T'");
40285 if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1)
return NULL;
40287 ctx->enc_count = 0;
40288 ctx->struct_alignment = 0;
40291 for (i = 0; i != struct_count; ++i) {
40292 ts_after_sub = __Pyx_BufFmt_CheckString(ctx, ts);
40293 if (!ts_after_sub)
return NULL;
40296 if (struct_alignment) ctx->struct_alignment = struct_alignment;
40301 size_t alignment = ctx->struct_alignment;
40303 if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1)
return NULL;
40305 if (alignment && ctx->fmt_offset % alignment) {
40306 ctx->fmt_offset += alignment - (ctx->fmt_offset % alignment);
40311 if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1)
return NULL;
40312 ctx->fmt_offset += ctx->new_count;
40313 ctx->new_count = 1;
40314 ctx->enc_count = 0;
40316 ctx->enc_packmode = ctx->new_packmode;
40322 if (*ts !=
'f' && *ts !=
'd' && *ts !=
'g') {
40323 __Pyx_BufFmt_RaiseUnexpectedChar(
'Z');
40326 CYTHON_FALLTHROUGH;
40327 case '?':
case 'c':
case 'b':
case 'B':
case 'h':
case 'H':
case 'i':
case 'I':
40328 case 'l':
case 'L':
case 'q':
case 'Q':
40329 case 'f':
case 'd':
case 'g':
40330 case 'O':
case 'p':
40331 if ((ctx->enc_type == *ts) && (got_Z == ctx->is_complex) &&
40332 (ctx->enc_packmode == ctx->new_packmode) && (!ctx->is_valid_array)) {
40333 ctx->enc_count += ctx->new_count;
40334 ctx->new_count = 1;
40339 CYTHON_FALLTHROUGH;
40341 if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1)
return NULL;
40342 ctx->enc_count = ctx->new_count;
40343 ctx->enc_packmode = ctx->new_packmode;
40344 ctx->enc_type = *ts;
40345 ctx->is_complex = got_Z;
40347 ctx->new_count = 1;
40352 while(*ts !=
':') ++ts;
40356 if (!__pyx_buffmt_parse_array(ctx, &ts))
return NULL;
40360 int number = __Pyx_BufFmt_ExpectNumber(&ts);
40361 if (
number == -1)
return NULL;
40362 ctx->new_count = (size_t)
number;
40370 __pyx_typeinfo_cmp(__Pyx_TypeInfo *a, __Pyx_TypeInfo *b)
40377 if (a->size != b->size || a->typegroup != b->typegroup ||
40378 a->is_unsigned != b->is_unsigned || a->ndim != b->ndim) {
40379 if (a->typegroup ==
'H' || b->typegroup ==
'H') {
40380 return a->size == b->size;
40386 for (i = 0; i < a->ndim; i++)
40387 if (a->arraysize[i] != b->arraysize[i])
40390 if (a->typegroup ==
'S') {
40391 if (a->flags != b->flags)
40393 if (a->fields || b->fields) {
40394 if (!(a->fields && b->fields))
40396 for (i = 0; a->fields[i].type && b->fields[i].type; i++) {
40397 __Pyx_StructField *field_a = a->fields + i;
40398 __Pyx_StructField *field_b = b->fields + i;
40399 if (field_a->offset != field_b->offset ||
40400 !__pyx_typeinfo_cmp(field_a->type, field_b->type))
40403 return !a->fields[i].type && !b->fields[i].type;
40411 __pyx_check_strides(Py_buffer *buf,
int dim,
int ndim,
int spec)
40413 if (buf->shape[dim] <= 1)
40415 if (buf->strides) {
40416 if (spec & __Pyx_MEMVIEW_CONTIG) {
40417 if (spec & (__Pyx_MEMVIEW_PTR|__Pyx_MEMVIEW_FULL)) {
40418 if (unlikely(buf->strides[dim] !=
sizeof(
void *))) {
40419 PyErr_Format(PyExc_ValueError,
40420 "Buffer is not indirectly contiguous "
40421 "in dimension %d.", dim);
40424 }
else if (unlikely(buf->strides[dim] != buf->itemsize)) {
40425 PyErr_SetString(PyExc_ValueError,
40426 "Buffer and memoryview are not contiguous "
40427 "in the same dimension.");
40431 if (spec & __Pyx_MEMVIEW_FOLLOW) {
40432 Py_ssize_t stride = buf->strides[dim];
40435 if (unlikely(stride < buf->itemsize)) {
40436 PyErr_SetString(PyExc_ValueError,
40437 "Buffer and memoryview are not contiguous "
40438 "in the same dimension.");
40443 if (unlikely(spec & __Pyx_MEMVIEW_CONTIG && dim != ndim - 1)) {
40444 PyErr_Format(PyExc_ValueError,
40445 "C-contiguous buffer is not contiguous in "
40446 "dimension %d", dim);
40448 }
else if (unlikely(spec & (__Pyx_MEMVIEW_PTR))) {
40449 PyErr_Format(PyExc_ValueError,
40450 "C-contiguous buffer is not indirect in "
40451 "dimension %d", dim);
40453 }
else if (unlikely(buf->suboffsets)) {
40454 PyErr_SetString(PyExc_ValueError,
40455 "Buffer exposes suboffsets but no strides");
40464 __pyx_check_suboffsets(Py_buffer *buf,
int dim, CYTHON_UNUSED
int ndim,
int spec)
40466 if (spec & __Pyx_MEMVIEW_DIRECT) {
40467 if (unlikely(buf->suboffsets && buf->suboffsets[dim] >= 0)) {
40468 PyErr_Format(PyExc_ValueError,
40469 "Buffer not compatible with direct access "
40470 "in dimension %d.", dim);
40474 if (spec & __Pyx_MEMVIEW_PTR) {
40475 if (unlikely(!buf->suboffsets || (buf->suboffsets[dim] < 0))) {
40476 PyErr_Format(PyExc_ValueError,
40477 "Buffer is not indirectly accessible "
40478 "in dimension %d.", dim);
40487 __pyx_verify_contig(Py_buffer *buf,
int ndim,
int c_or_f_flag)
40490 if (c_or_f_flag & __Pyx_IS_F_CONTIG) {
40491 Py_ssize_t stride = 1;
40492 for (i = 0; i < ndim; i++) {
40493 if (unlikely(stride * buf->itemsize != buf->strides[i] && buf->shape[i] > 1)) {
40494 PyErr_SetString(PyExc_ValueError,
40495 "Buffer not fortran contiguous.");
40498 stride = stride * buf->shape[i];
40500 }
else if (c_or_f_flag & __Pyx_IS_C_CONTIG) {
40501 Py_ssize_t stride = 1;
40502 for (i = ndim - 1; i >- 1; i--) {
40503 if (unlikely(stride * buf->itemsize != buf->strides[i] && buf->shape[i] > 1)) {
40504 PyErr_SetString(PyExc_ValueError,
40505 "Buffer not C contiguous.");
40508 stride = stride * buf->shape[i];
40515 static int __Pyx_ValidateAndInit_memviewslice(
40520 __Pyx_TypeInfo *dtype,
40521 __Pyx_BufFmt_StackElem stack[],
40522 __Pyx_memviewslice *memviewslice,
40523 PyObject *original_obj)
40525 struct __pyx_memoryview_obj *memview, *new_memview;
40526 __Pyx_RefNannyDeclarations
40528 int i, spec = 0, retval = -1;
40529 __Pyx_BufFmt_Context ctx;
40530 int from_memoryview = __pyx_memoryview_check(original_obj);
40531 __Pyx_RefNannySetupContext(
"ValidateAndInit_memviewslice", 0);
40532 if (from_memoryview && __pyx_typeinfo_cmp(dtype, ((
struct __pyx_memoryview_obj *)
40533 original_obj)->typeinfo)) {
40534 memview = (
struct __pyx_memoryview_obj *) original_obj;
40535 new_memview = NULL;
40537 memview = (
struct __pyx_memoryview_obj *) __pyx_memoryview_new(
40538 original_obj, buf_flags, 0, dtype);
40539 new_memview = memview;
40540 if (unlikely(!memview))
40543 buf = &memview->view;
40544 if (unlikely(buf->ndim != ndim)) {
40545 PyErr_Format(PyExc_ValueError,
40546 "Buffer has wrong number of dimensions (expected %d, got %d)",
40551 __Pyx_BufFmt_Init(&ctx, stack, dtype);
40552 if (unlikely(!__Pyx_BufFmt_CheckString(&ctx, buf->format)))
goto fail;
40554 if (unlikely((
unsigned) buf->itemsize != dtype->size)) {
40555 PyErr_Format(PyExc_ValueError,
40556 "Item size of buffer (%" CYTHON_FORMAT_SSIZE_T
"u byte%s) "
40557 "does not match size of '%s' (%" CYTHON_FORMAT_SSIZE_T
"u byte%s)",
40559 (buf->itemsize > 1) ?
"s" :
"",
40562 (dtype->size > 1) ?
"s" :
"");
40565 if (buf->len > 0) {
40566 for (i = 0; i < ndim; i++) {
40567 spec = axes_specs[i];
40568 if (unlikely(!__pyx_check_strides(buf, i, ndim, spec)))
40570 if (unlikely(!__pyx_check_suboffsets(buf, i, ndim, spec)))
40573 if (unlikely(buf->strides && !__pyx_verify_contig(buf, ndim, c_or_f_flag)))
40576 if (unlikely(__Pyx_init_memviewslice(memview, ndim, memviewslice,
40577 new_memview != NULL) == -1)) {
40583 Py_XDECREF(new_memview);
40586 __Pyx_RefNannyFinishContext();
40591 static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_ds_double(PyObject *obj,
int writable_flag) {
40592 __Pyx_memviewslice result = { 0, 0, { 0 }, { 0 }, { 0 } };
40593 __Pyx_BufFmt_StackElem stack[1];
40594 int axes_specs[] = { (__Pyx_MEMVIEW_DIRECT | __Pyx_MEMVIEW_STRIDED) };
40596 if (obj == Py_None) {
40597 result.memview = (
struct __pyx_memoryview_obj *) Py_None;
40600 retcode = __Pyx_ValidateAndInit_memviewslice(axes_specs, 0,
40601 PyBUF_RECORDS_RO | writable_flag, 1,
40602 &__Pyx_TypeInfo_double, stack,
40604 if (unlikely(retcode == -1))
40608 result.memview = NULL;
40609 result.data = NULL;
40614 static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_ds_int(PyObject *obj,
int writable_flag) {
40615 __Pyx_memviewslice result = { 0, 0, { 0 }, { 0 }, { 0 } };
40616 __Pyx_BufFmt_StackElem stack[1];
40617 int axes_specs[] = { (__Pyx_MEMVIEW_DIRECT | __Pyx_MEMVIEW_STRIDED) };
40619 if (obj == Py_None) {
40620 result.memview = (
struct __pyx_memoryview_obj *) Py_None;
40623 retcode = __Pyx_ValidateAndInit_memviewslice(axes_specs, 0,
40624 PyBUF_RECORDS_RO | writable_flag, 1,
40625 &__Pyx_TypeInfo_int, stack,
40627 if (unlikely(retcode == -1))
40631 result.memview = NULL;
40632 result.data = NULL;
40637 #define __PYX_VERIFY_RETURN_INT(target_type, func_type, func_value)\
40638 __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 0)
40639 #define __PYX_VERIFY_RETURN_INT_EXC(target_type, func_type, func_value)\
40640 __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 1)
40641 #define __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, exc)\
40643 func_type value = func_value;\
40644 if (sizeof(target_type) < sizeof(func_type)) {\
40645 if (unlikely(value != (func_type) (target_type) value)) {\
40646 func_type zero = 0;\
40647 if (exc && unlikely(value == (func_type)-1 && PyErr_Occurred()))\
40648 return (target_type) -1;\
40649 if (is_unsigned && unlikely(value < zero))\
40650 goto raise_neg_overflow;\
40652 goto raise_overflow;\
40655 return (target_type) value;\
40659 static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_dsdsds_double(PyObject *obj,
int writable_flag) {
40660 __Pyx_memviewslice result = { 0, 0, { 0 }, { 0 }, { 0 } };
40661 __Pyx_BufFmt_StackElem stack[1];
40662 int axes_specs[] = { (__Pyx_MEMVIEW_DIRECT | __Pyx_MEMVIEW_STRIDED), (__Pyx_MEMVIEW_DIRECT | __Pyx_MEMVIEW_STRIDED), (__Pyx_MEMVIEW_DIRECT | __Pyx_MEMVIEW_STRIDED) };
40664 if (obj == Py_None) {
40665 result.memview = (
struct __pyx_memoryview_obj *) Py_None;
40668 retcode = __Pyx_ValidateAndInit_memviewslice(axes_specs, 0,
40669 PyBUF_RECORDS_RO | writable_flag, 3,
40670 &__Pyx_TypeInfo_double, stack,
40672 if (unlikely(retcode == -1))
40676 result.memview = NULL;
40677 result.data = NULL;
40682 static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_dsds_double(PyObject *obj,
int writable_flag) {
40683 __Pyx_memviewslice result = { 0, 0, { 0 }, { 0 }, { 0 } };
40684 __Pyx_BufFmt_StackElem stack[1];
40685 int axes_specs[] = { (__Pyx_MEMVIEW_DIRECT | __Pyx_MEMVIEW_STRIDED), (__Pyx_MEMVIEW_DIRECT | __Pyx_MEMVIEW_STRIDED) };
40687 if (obj == Py_None) {
40688 result.memview = (
struct __pyx_memoryview_obj *) Py_None;
40691 retcode = __Pyx_ValidateAndInit_memviewslice(axes_specs, 0,
40692 PyBUF_RECORDS_RO | writable_flag, 2,
40693 &__Pyx_TypeInfo_double, stack,
40695 if (unlikely(retcode == -1))
40699 result.memview = NULL;
40700 result.data = NULL;
40705 static CYTHON_INLINE PyObject *__pyx_memview_get_double(
const char *itemp) {
40706 return (PyObject *) PyFloat_FromDouble(*(
double *) itemp);
40708 static CYTHON_INLINE
int __pyx_memview_set_double(
const char *itemp, PyObject *obj) {
40709 double value = __pyx_PyFloat_AsDouble(obj);
40710 if ((value == (
double)-1) && PyErr_Occurred())
40712 *(
double *) itemp = value;
40717 static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_dsds_int(PyObject *obj,
int writable_flag) {
40718 __Pyx_memviewslice result = { 0, 0, { 0 }, { 0 }, { 0 } };
40719 __Pyx_BufFmt_StackElem stack[1];
40720 int axes_specs[] = { (__Pyx_MEMVIEW_DIRECT | __Pyx_MEMVIEW_STRIDED), (__Pyx_MEMVIEW_DIRECT | __Pyx_MEMVIEW_STRIDED) };
40722 if (obj == Py_None) {
40723 result.memview = (
struct __pyx_memoryview_obj *) Py_None;
40726 retcode = __Pyx_ValidateAndInit_memviewslice(axes_specs, 0,
40727 PyBUF_RECORDS_RO | writable_flag, 2,
40728 &__Pyx_TypeInfo_int, stack,
40730 if (unlikely(retcode == -1))
40734 result.memview = NULL;
40735 result.data = NULL;
40740 #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION < 3
40741 static PyObject *__Pyx_GetStdout(
void) {
40742 PyObject *
f = PySys_GetObject((
char *)
"stdout");
40744 PyErr_SetString(PyExc_RuntimeError,
"lost sys.stdout");
40748 static int __Pyx_Print(PyObject*
f, PyObject *arg_tuple,
int newline) {
40751 if (!(
f = __Pyx_GetStdout()))
40755 for (i=0; i < PyTuple_GET_SIZE(arg_tuple); i++) {
40757 if (PyFile_SoftSpace(
f, 1)) {
40758 if (PyFile_WriteString(
" ",
f) < 0)
40761 v = PyTuple_GET_ITEM(arg_tuple, i);
40762 if (PyFile_WriteObject(
v,
f, Py_PRINT_RAW) < 0)
40764 if (PyString_Check(
v)) {
40765 char *
s = PyString_AsString(
v);
40766 Py_ssize_t len = PyString_Size(
v);
40768 switch (
s[len-1]) {
40770 case '\f':
case '\r':
case '\n':
case '\t':
case '\v':
40771 PyFile_SoftSpace(
f, 0);
40779 if (PyFile_WriteString(
"\n",
f) < 0)
40781 PyFile_SoftSpace(
f, 0);
40790 static int __Pyx_Print(PyObject* stream, PyObject *arg_tuple,
int newline) {
40791 PyObject* kwargs = 0;
40792 PyObject* result = 0;
40793 PyObject* end_string;
40794 if (unlikely(!__pyx_print)) {
40795 __pyx_print = PyObject_GetAttr(__pyx_b, __pyx_n_s_print);
40800 kwargs = PyDict_New();
40801 if (unlikely(!kwargs))
40803 if (unlikely(PyDict_SetItem(kwargs, __pyx_n_s_file, stream) < 0))
40806 end_string = PyUnicode_FromStringAndSize(
" ", 1);
40807 if (unlikely(!end_string))
40809 if (PyDict_SetItem(kwargs, __pyx_n_s_end, end_string) < 0) {
40810 Py_DECREF(end_string);
40813 Py_DECREF(end_string);
40815 }
else if (!newline) {
40816 if (unlikely(!__pyx_print_kwargs)) {
40817 __pyx_print_kwargs = PyDict_New();
40818 if (unlikely(!__pyx_print_kwargs))
40820 end_string = PyUnicode_FromStringAndSize(
" ", 1);
40821 if (unlikely(!end_string))
40823 if (PyDict_SetItem(__pyx_print_kwargs, __pyx_n_s_end, end_string) < 0) {
40824 Py_DECREF(end_string);
40827 Py_DECREF(end_string);
40829 kwargs = __pyx_print_kwargs;
40831 result = PyObject_Call(__pyx_print, arg_tuple, kwargs);
40832 if (unlikely(kwargs) && (kwargs != __pyx_print_kwargs))
40839 if (kwargs != __pyx_print_kwargs)
40840 Py_XDECREF(kwargs);
40846 static CYTHON_INLINE PyObject *__pyx_memview_get_int(
const char *itemp) {
40847 return (PyObject *) __Pyx_PyInt_From_int(*(
int *) itemp);
40849 static CYTHON_INLINE
int __pyx_memview_set_int(
const char *itemp, PyObject *obj) {
40850 int value = __Pyx_PyInt_As_int(obj);
40851 if ((value == (
int)-1) && PyErr_Occurred())
40853 *(
int *) itemp = value;
40858 #if CYTHON_CCOMPLEX
40860 static CYTHON_INLINE __pyx_t_float_complex __pyx_t_float_complex_from_parts(
float x,
float y) {
40861 return ::std::complex< float >(x, y);
40864 static CYTHON_INLINE __pyx_t_float_complex __pyx_t_float_complex_from_parts(
float x,
float y) {
40865 return x + y*(__pyx_t_float_complex)_Complex_I;
40869 static CYTHON_INLINE __pyx_t_float_complex __pyx_t_float_complex_from_parts(
float x,
float y) {
40870 __pyx_t_float_complex
z;
40878 #if CYTHON_CCOMPLEX
40880 static CYTHON_INLINE
int __Pyx_c_eq_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
40881 return (a.real == b.real) && (a.imag == b.imag);
40883 static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_sum_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
40884 __pyx_t_float_complex
z;
40885 z.real = a.real + b.real;
40886 z.imag = a.imag + b.imag;
40889 static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_diff_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
40890 __pyx_t_float_complex
z;
40891 z.real = a.real - b.real;
40892 z.imag = a.imag - b.imag;
40895 static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_prod_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
40896 __pyx_t_float_complex
z;
40897 z.real = a.real * b.real - a.imag * b.imag;
40898 z.imag = a.real * b.imag + a.imag * b.real;
40902 static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_quot_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
40904 return __pyx_t_float_complex_from_parts(a.real / b.real, a.imag / b.real);
40905 }
else if (fabsf(b.real) >= fabsf(b.imag)) {
40906 if (b.real == 0 && b.imag == 0) {
40907 return __pyx_t_float_complex_from_parts(a.real / b.real, a.imag / b.imag);
40909 float r = b.imag / b.real;
40910 float s = (float)(1.0) / (b.real + b.imag *
r);
40911 return __pyx_t_float_complex_from_parts(
40912 (a.real + a.imag *
r) *
s, (a.imag - a.real *
r) *
s);
40915 float r = b.real / b.imag;
40916 float s = (float)(1.0) / (b.imag + b.real *
r);
40917 return __pyx_t_float_complex_from_parts(
40918 (a.real *
r + a.imag) *
s, (a.imag *
r - a.real) *
s);
40922 static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_quot_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
40924 return __pyx_t_float_complex_from_parts(a.real / b.real, a.imag / b.real);
40926 float denom = b.real * b.real + b.imag * b.imag;
40927 return __pyx_t_float_complex_from_parts(
40928 (a.real * b.real + a.imag * b.imag) / denom,
40929 (a.imag * b.real - a.real * b.imag) / denom);
40933 static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_neg_float(__pyx_t_float_complex a) {
40934 __pyx_t_float_complex
z;
40939 static CYTHON_INLINE
int __Pyx_c_is_zero_float(__pyx_t_float_complex a) {
40940 return (a.real == 0) && (a.imag == 0);
40942 static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_conj_float(__pyx_t_float_complex a) {
40943 __pyx_t_float_complex
z;
40949 static CYTHON_INLINE
float __Pyx_c_abs_float(__pyx_t_float_complex
z) {
40950 #if !defined(HAVE_HYPOT) || defined(_MSC_VER)
40951 return sqrtf(
z.real*
z.real +
z.imag*
z.imag);
40953 return hypotf(
z.real,
z.imag);
40956 static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_pow_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
40957 __pyx_t_float_complex
z;
40958 float r, lnr, theta, z_r, z_theta;
40959 if (b.imag == 0 && b.real == (
int)b.real) {
40961 float denom = a.real * a.real + a.imag * a.imag;
40962 a.real = a.real / denom;
40963 a.imag = -a.imag / denom;
40966 switch ((
int)b.real) {
40974 return __Pyx_c_prod_float(a, a);
40976 z = __Pyx_c_prod_float(a, a);
40977 return __Pyx_c_prod_float(
z, a);
40979 z = __Pyx_c_prod_float(a, a);
40980 return __Pyx_c_prod_float(
z,
z);
40986 }
else if (b.imag == 0) {
40987 z.real = powf(a.real, b.real);
40990 }
else if (a.real > 0) {
40995 theta = atan2f(0.0, -1.0);
40998 r = __Pyx_c_abs_float(a);
40999 theta = atan2f(a.imag, a.real);
41002 z_r = expf(lnr * b.real - theta * b.imag);
41003 z_theta = theta * b.real + lnr * b.imag;
41004 z.real = z_r * cosf(z_theta);
41005 z.imag = z_r * sinf(z_theta);
41012 #if CYTHON_CCOMPLEX
41014 static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(
double x,
double y) {
41015 return ::std::complex< double >(x, y);
41018 static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(
double x,
double y) {
41019 return x + y*(__pyx_t_double_complex)_Complex_I;
41023 static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(
double x,
double y) {
41024 __pyx_t_double_complex
z;
41032 #if CYTHON_CCOMPLEX
41034 static CYTHON_INLINE
int __Pyx_c_eq_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
41035 return (a.real == b.real) && (a.imag == b.imag);
41037 static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_sum_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
41038 __pyx_t_double_complex
z;
41039 z.real = a.real + b.real;
41040 z.imag = a.imag + b.imag;
41043 static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_diff_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
41044 __pyx_t_double_complex
z;
41045 z.real = a.real - b.real;
41046 z.imag = a.imag - b.imag;
41049 static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_prod_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
41050 __pyx_t_double_complex
z;
41051 z.real = a.real * b.real - a.imag * b.imag;
41052 z.imag = a.real * b.imag + a.imag * b.real;
41056 static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_quot_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
41058 return __pyx_t_double_complex_from_parts(a.real / b.real, a.imag / b.real);
41059 }
else if (fabs(b.real) >= fabs(b.imag)) {
41060 if (b.real == 0 && b.imag == 0) {
41061 return __pyx_t_double_complex_from_parts(a.real / b.real, a.imag / b.imag);
41063 double r = b.imag / b.real;
41064 double s = (double)(1.0) / (b.real + b.imag *
r);
41065 return __pyx_t_double_complex_from_parts(
41066 (a.real + a.imag *
r) *
s, (a.imag - a.real *
r) *
s);
41069 double r = b.real / b.imag;
41070 double s = (double)(1.0) / (b.imag + b.real *
r);
41071 return __pyx_t_double_complex_from_parts(
41072 (a.real *
r + a.imag) *
s, (a.imag *
r - a.real) *
s);
41076 static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_quot_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
41078 return __pyx_t_double_complex_from_parts(a.real / b.real, a.imag / b.real);
41080 double denom = b.real * b.real + b.imag * b.imag;
41081 return __pyx_t_double_complex_from_parts(
41082 (a.real * b.real + a.imag * b.imag) / denom,
41083 (a.imag * b.real - a.real * b.imag) / denom);
41087 static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_neg_double(__pyx_t_double_complex a) {
41088 __pyx_t_double_complex
z;
41093 static CYTHON_INLINE
int __Pyx_c_is_zero_double(__pyx_t_double_complex a) {
41094 return (a.real == 0) && (a.imag == 0);
41096 static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_conj_double(__pyx_t_double_complex a) {
41097 __pyx_t_double_complex
z;
41103 static CYTHON_INLINE
double __Pyx_c_abs_double(__pyx_t_double_complex
z) {
41104 #if !defined(HAVE_HYPOT) || defined(_MSC_VER)
41105 return sqrt(
z.real*
z.real +
z.imag*
z.imag);
41107 return hypot(
z.real,
z.imag);
41110 static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_pow_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
41111 __pyx_t_double_complex
z;
41112 double r, lnr, theta, z_r, z_theta;
41113 if (b.imag == 0 && b.real == (
int)b.real) {
41115 double denom = a.real * a.real + a.imag * a.imag;
41116 a.real = a.real / denom;
41117 a.imag = -a.imag / denom;
41120 switch ((
int)b.real) {
41128 return __Pyx_c_prod_double(a, a);
41130 z = __Pyx_c_prod_double(a, a);
41131 return __Pyx_c_prod_double(
z, a);
41133 z = __Pyx_c_prod_double(a, a);
41134 return __Pyx_c_prod_double(
z,
z);
41140 }
else if (b.imag == 0) {
41141 z.real = pow(a.real, b.real);
41144 }
else if (a.real > 0) {
41149 theta = atan2(0.0, -1.0);
41152 r = __Pyx_c_abs_double(a);
41153 theta = atan2(a.imag, a.real);
41156 z_r = exp(lnr * b.real - theta * b.imag);
41157 z_theta = theta * b.real + lnr * b.imag;
41158 z.real = z_r * cos(z_theta);
41159 z.imag = z_r * sin(z_theta);
41166 static __Pyx_memviewslice
41167 __pyx_memoryview_copy_new_contig(
const __Pyx_memviewslice *from_mvs,
41168 const char *mode,
int ndim,
41169 size_t sizeof_dtype,
int contig_flag,
41170 int dtype_is_object)
41172 __Pyx_RefNannyDeclarations
41174 __Pyx_memviewslice new_mvs = { 0, 0, { 0 }, { 0 }, { 0 } };
41175 struct __pyx_memoryview_obj *from_memview = from_mvs->memview;
41176 Py_buffer *buf = &from_memview->view;
41177 PyObject *shape_tuple = NULL;
41178 PyObject *temp_int = NULL;
41179 struct __pyx_array_obj *array_obj = NULL;
41180 struct __pyx_memoryview_obj *memview_obj = NULL;
41181 __Pyx_RefNannySetupContext(
"__pyx_memoryview_copy_new_contig", 0);
41182 for (i = 0; i < ndim; i++) {
41183 if (unlikely(from_mvs->suboffsets[i] >= 0)) {
41184 PyErr_Format(PyExc_ValueError,
"Cannot copy memoryview slice with "
41185 "indirect dimensions (axis %d)", i);
41189 shape_tuple = PyTuple_New(ndim);
41190 if (unlikely(!shape_tuple)) {
41193 __Pyx_GOTREF(shape_tuple);
41194 for(i = 0; i < ndim; i++) {
41195 temp_int = PyInt_FromSsize_t(from_mvs->shape[i]);
41196 if(unlikely(!temp_int)) {
41199 PyTuple_SET_ITEM(shape_tuple, i, temp_int);
41203 array_obj = __pyx_array_new(shape_tuple, sizeof_dtype, buf->format, (
char *) mode, NULL);
41204 if (unlikely(!array_obj)) {
41207 __Pyx_GOTREF(array_obj);
41208 memview_obj = (
struct __pyx_memoryview_obj *) __pyx_memoryview_new(
41209 (PyObject *) array_obj, contig_flag,
41211 from_mvs->memview->typeinfo);
41212 if (unlikely(!memview_obj))
41214 if (unlikely(__Pyx_init_memviewslice(memview_obj, ndim, &new_mvs, 1) < 0))
41216 if (unlikely(__pyx_memoryview_copy_contents(*from_mvs, new_mvs, ndim, ndim,
41217 dtype_is_object) < 0))
41221 __Pyx_XDECREF(new_mvs.memview);
41222 new_mvs.memview = NULL;
41223 new_mvs.data = NULL;
41225 __Pyx_XDECREF(shape_tuple);
41226 __Pyx_XDECREF(temp_int);
41227 __Pyx_XDECREF(array_obj);
41228 __Pyx_RefNannyFinishContext();
41233 static CYTHON_INLINE
int __Pyx_PyInt_As_int(PyObject *x) {
41234 #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
41235 #pragma GCC diagnostic push
41236 #pragma GCC diagnostic ignored "-Wconversion"
41238 const int neg_one = (int) -1, const_zero = (
int) 0;
41239 #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
41240 #pragma GCC diagnostic pop
41242 const int is_unsigned = neg_one > const_zero;
41243 #if PY_MAJOR_VERSION < 3
41244 if (likely(PyInt_Check(x))) {
41245 if (
sizeof(
int) <
sizeof(long)) {
41246 __PYX_VERIFY_RETURN_INT(
int,
long, PyInt_AS_LONG(x))
41248 long val = PyInt_AS_LONG(x);
41249 if (is_unsigned && unlikely(val < 0)) {
41250 goto raise_neg_overflow;
41256 if (likely(PyLong_Check(x))) {
41258 #if CYTHON_USE_PYLONG_INTERNALS
41259 const digit* digits = ((PyLongObject*)x)->ob_digit;
41260 switch (Py_SIZE(x)) {
41261 case 0:
return (
int) 0;
41262 case 1: __PYX_VERIFY_RETURN_INT(
int, digit, digits[0])
41264 if (8 *
sizeof(
int) > 1 * PyLong_SHIFT) {
41265 if (8 *
sizeof(
unsigned long) > 2 * PyLong_SHIFT) {
41266 __PYX_VERIFY_RETURN_INT(
int,
unsigned long, (((((
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
41267 }
else if (8 *
sizeof(
int) >= 2 * PyLong_SHIFT) {
41268 return (
int) (((((int)digits[1]) << PyLong_SHIFT) | (
int)digits[0]));
41273 if (8 *
sizeof(
int) > 2 * PyLong_SHIFT) {
41274 if (8 *
sizeof(
unsigned long) > 3 * PyLong_SHIFT) {
41275 __PYX_VERIFY_RETURN_INT(
int,
unsigned long, (((((((
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
41276 }
else if (8 *
sizeof(
int) >= 3 * PyLong_SHIFT) {
41277 return (
int) (((((((int)digits[2]) << PyLong_SHIFT) | (
int)digits[1]) << PyLong_SHIFT) | (int)digits[0]));
41282 if (8 *
sizeof(
int) > 3 * PyLong_SHIFT) {
41283 if (8 *
sizeof(
unsigned long) > 4 * PyLong_SHIFT) {
41284 __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])))
41285 }
else if (8 *
sizeof(
int) >= 4 * PyLong_SHIFT) {
41286 return (
int) (((((((((int)digits[3]) << PyLong_SHIFT) | (
int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (
int)digits[0]));
41292 #if CYTHON_COMPILING_IN_CPYTHON
41293 if (unlikely(Py_SIZE(x) < 0)) {
41294 goto raise_neg_overflow;
41298 int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
41299 if (unlikely(result < 0))
41301 if (unlikely(result == 1))
41302 goto raise_neg_overflow;
41305 if (
sizeof(
int) <=
sizeof(
unsigned long)) {
41306 __PYX_VERIFY_RETURN_INT_EXC(
int,
unsigned long, PyLong_AsUnsignedLong(x))
41307 #ifdef HAVE_LONG_LONG
41308 }
else if (
sizeof(
int) <=
sizeof(
unsigned PY_LONG_LONG)) {
41309 __PYX_VERIFY_RETURN_INT_EXC(
int,
unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
41313 #if CYTHON_USE_PYLONG_INTERNALS
41314 const digit* digits = ((PyLongObject*)x)->ob_digit;
41315 switch (Py_SIZE(x)) {
41316 case 0:
return (
int) 0;
41317 case -1: __PYX_VERIFY_RETURN_INT(
int, sdigit, (sdigit) (-(sdigit)digits[0]))
41318 case 1: __PYX_VERIFY_RETURN_INT(
int, digit, +digits[0])
41320 if (8 *
sizeof(
int) - 1 > 1 * PyLong_SHIFT) {
41321 if (8 *
sizeof(
unsigned long) > 2 * PyLong_SHIFT) {
41322 __PYX_VERIFY_RETURN_INT(
int,
long, -(
long) (((((
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
41323 }
else if (8 *
sizeof(
int) - 1 > 2 * PyLong_SHIFT) {
41324 return (
int) (((int)-1)*(((((int)digits[1]) << PyLong_SHIFT) | (
int)digits[0])));
41329 if (8 *
sizeof(
int) > 1 * PyLong_SHIFT) {
41330 if (8 *
sizeof(
unsigned long) > 2 * PyLong_SHIFT) {
41331 __PYX_VERIFY_RETURN_INT(
int,
unsigned long, (((((
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
41332 }
else if (8 *
sizeof(
int) - 1 > 2 * PyLong_SHIFT) {
41333 return (
int) ((((((int)digits[1]) << PyLong_SHIFT) | (
int)digits[0])));
41338 if (8 *
sizeof(
int) - 1 > 2 * PyLong_SHIFT) {
41339 if (8 *
sizeof(
unsigned long) > 3 * PyLong_SHIFT) {
41340 __PYX_VERIFY_RETURN_INT(
int,
long, -(
long) (((((((
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
41341 }
else if (8 *
sizeof(
int) - 1 > 3 * PyLong_SHIFT) {
41342 return (
int) (((int)-1)*(((((((int)digits[2]) << PyLong_SHIFT) | (
int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
41347 if (8 *
sizeof(
int) > 2 * PyLong_SHIFT) {
41348 if (8 *
sizeof(
unsigned long) > 3 * PyLong_SHIFT) {
41349 __PYX_VERIFY_RETURN_INT(
int,
unsigned long, (((((((
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
41350 }
else if (8 *
sizeof(
int) - 1 > 3 * PyLong_SHIFT) {
41351 return (
int) ((((((((int)digits[2]) << PyLong_SHIFT) | (
int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
41356 if (8 *
sizeof(
int) - 1 > 3 * PyLong_SHIFT) {
41357 if (8 *
sizeof(
unsigned long) > 4 * PyLong_SHIFT) {
41358 __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])))
41359 }
else if (8 *
sizeof(
int) - 1 > 4 * PyLong_SHIFT) {
41360 return (
int) (((int)-1)*(((((((((int)digits[3]) << PyLong_SHIFT) | (
int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (
int)digits[0])));
41365 if (8 *
sizeof(
int) > 3 * PyLong_SHIFT) {
41366 if (8 *
sizeof(
unsigned long) > 4 * PyLong_SHIFT) {
41367 __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])))
41368 }
else if (8 *
sizeof(
int) - 1 > 4 * PyLong_SHIFT) {
41369 return (
int) ((((((((((int)digits[3]) << PyLong_SHIFT) | (
int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (
int)digits[0])));
41375 if (
sizeof(
int) <=
sizeof(long)) {
41376 __PYX_VERIFY_RETURN_INT_EXC(
int,
long, PyLong_AsLong(x))
41377 #ifdef HAVE_LONG_LONG
41378 }
else if (
sizeof(
int) <=
sizeof(PY_LONG_LONG)) {
41379 __PYX_VERIFY_RETURN_INT_EXC(
int, PY_LONG_LONG, PyLong_AsLongLong(x))
41384 #if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray)
41385 PyErr_SetString(PyExc_RuntimeError,
41386 "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers");
41389 PyObject *
v = __Pyx_PyNumber_IntOrLong(x);
41390 #if PY_MAJOR_VERSION < 3
41391 if (likely(
v) && !PyLong_Check(
v)) {
41393 v = PyNumber_Long(tmp);
41398 int one = 1;
int is_little = (int)*(
unsigned char *)&one;
41399 unsigned char *bytes = (
unsigned char *)&val;
41400 int ret = _PyLong_AsByteArray((PyLongObject *)
v,
41401 bytes,
sizeof(val),
41402 is_little, !is_unsigned);
41412 PyObject *tmp = __Pyx_PyNumber_IntOrLong(x);
41413 if (!tmp)
return (
int) -1;
41414 val = __Pyx_PyInt_As_int(tmp);
41419 PyErr_SetString(PyExc_OverflowError,
41420 "value too large to convert to int");
41422 raise_neg_overflow:
41423 PyErr_SetString(PyExc_OverflowError,
41424 "can't convert negative value to int");
41429 static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(
int value) {
41430 #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
41431 #pragma GCC diagnostic push
41432 #pragma GCC diagnostic ignored "-Wconversion"
41434 const int neg_one = (int) -1, const_zero = (
int) 0;
41435 #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
41436 #pragma GCC diagnostic pop
41438 const int is_unsigned = neg_one > const_zero;
41440 if (
sizeof(
int) <
sizeof(long)) {
41441 return PyInt_FromLong((
long) value);
41442 }
else if (
sizeof(
int) <=
sizeof(
unsigned long)) {
41443 return PyLong_FromUnsignedLong((
unsigned long) value);
41444 #ifdef HAVE_LONG_LONG
41445 }
else if (
sizeof(
int) <=
sizeof(
unsigned PY_LONG_LONG)) {
41446 return PyLong_FromUnsignedLongLong((
unsigned PY_LONG_LONG) value);
41450 if (
sizeof(
int) <=
sizeof(
long)) {
41451 return PyInt_FromLong((
long) value);
41452 #ifdef HAVE_LONG_LONG
41453 }
else if (
sizeof(
int) <=
sizeof(PY_LONG_LONG)) {
41454 return PyLong_FromLongLong((PY_LONG_LONG) value);
41459 int one = 1;
int little = (int)*(
unsigned char *)&one;
41460 unsigned char *bytes = (
unsigned char *)&value;
41461 return _PyLong_FromByteArray(bytes,
sizeof(
int),
41462 little, !is_unsigned);
41467 static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(
long value) {
41468 #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
41469 #pragma GCC diagnostic push
41470 #pragma GCC diagnostic ignored "-Wconversion"
41472 const long neg_one = (long) -1, const_zero = (
long) 0;
41473 #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
41474 #pragma GCC diagnostic pop
41476 const int is_unsigned = neg_one > const_zero;
41478 if (
sizeof(
long) <
sizeof(long)) {
41479 return PyInt_FromLong((
long) value);
41480 }
else if (
sizeof(
long) <=
sizeof(
unsigned long)) {
41481 return PyLong_FromUnsignedLong((
unsigned long) value);
41482 #ifdef HAVE_LONG_LONG
41483 }
else if (
sizeof(
long) <=
sizeof(
unsigned PY_LONG_LONG)) {
41484 return PyLong_FromUnsignedLongLong((
unsigned PY_LONG_LONG) value);
41488 if (
sizeof(
long) <=
sizeof(
long)) {
41489 return PyInt_FromLong((
long) value);
41490 #ifdef HAVE_LONG_LONG
41491 }
else if (
sizeof(
long) <=
sizeof(PY_LONG_LONG)) {
41492 return PyLong_FromLongLong((PY_LONG_LONG) value);
41497 int one = 1;
int little = (int)*(
unsigned char *)&one;
41498 unsigned char *bytes = (
unsigned char *)&value;
41499 return _PyLong_FromByteArray(bytes,
sizeof(
long),
41500 little, !is_unsigned);
41505 static struct __pyx_typeinfo_string __Pyx_TypeInfoToFormat(__Pyx_TypeInfo *type) {
41506 struct __pyx_typeinfo_string result = { {0} };
41507 char *buf = (
char *) result.string;
41508 size_t size = type->size;
41509 switch (type->typegroup) {
41516 *buf = (type->is_unsigned) ?
'B' :
'b';
41517 else if (size == 2)
41518 *buf = (type->is_unsigned) ?
'H' :
'h';
41519 else if (size == 4)
41520 *buf = (type->is_unsigned) ?
'I' :
'i';
41521 else if (size == 8)
41522 *buf = (type->is_unsigned) ?
'Q' :
'q';
41529 __Pyx_TypeInfo complex_type = *type;
41530 complex_type.typegroup =
'R';
41531 complex_type.size /= 2;
41533 *buf = __Pyx_TypeInfoToFormat(&complex_type).string[0];
41539 else if (size == 8)
41549 #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION < 3
41550 static int __Pyx_PrintOne(PyObject*
f, PyObject *o) {
41552 if (!(
f = __Pyx_GetStdout()))
41556 if (PyFile_SoftSpace(
f, 0)) {
41557 if (PyFile_WriteString(
" ",
f) < 0)
41560 if (PyFile_WriteObject(o,
f, Py_PRINT_RAW) < 0)
41562 if (PyFile_WriteString(
"\n",
f) < 0)
41571 return __Pyx_Print(
f, NULL, 0);
41574 static int __Pyx_PrintOne(PyObject* stream, PyObject *o) {
41576 PyObject* arg_tuple = PyTuple_Pack(1, o);
41577 if (unlikely(!arg_tuple))
41579 res = __Pyx_Print(stream, arg_tuple, 1);
41580 Py_DECREF(arg_tuple);
41586 static CYTHON_INLINE
long __Pyx_PyInt_As_long(PyObject *x) {
41587 #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
41588 #pragma GCC diagnostic push
41589 #pragma GCC diagnostic ignored "-Wconversion"
41591 const long neg_one = (long) -1, const_zero = (
long) 0;
41592 #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
41593 #pragma GCC diagnostic pop
41595 const int is_unsigned = neg_one > const_zero;
41596 #if PY_MAJOR_VERSION < 3
41597 if (likely(PyInt_Check(x))) {
41598 if (
sizeof(
long) <
sizeof(long)) {
41599 __PYX_VERIFY_RETURN_INT(
long,
long, PyInt_AS_LONG(x))
41601 long val = PyInt_AS_LONG(x);
41602 if (is_unsigned && unlikely(val < 0)) {
41603 goto raise_neg_overflow;
41609 if (likely(PyLong_Check(x))) {
41611 #if CYTHON_USE_PYLONG_INTERNALS
41612 const digit* digits = ((PyLongObject*)x)->ob_digit;
41613 switch (Py_SIZE(x)) {
41614 case 0:
return (
long) 0;
41615 case 1: __PYX_VERIFY_RETURN_INT(
long, digit, digits[0])
41617 if (8 *
sizeof(
long) > 1 * PyLong_SHIFT) {
41618 if (8 *
sizeof(
unsigned long) > 2 * PyLong_SHIFT) {
41619 __PYX_VERIFY_RETURN_INT(
long,
unsigned long, (((((
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
41620 }
else if (8 *
sizeof(
long) >= 2 * PyLong_SHIFT) {
41621 return (
long) (((((long)digits[1]) << PyLong_SHIFT) | (
long)digits[0]));
41626 if (8 *
sizeof(
long) > 2 * PyLong_SHIFT) {
41627 if (8 *
sizeof(
unsigned long) > 3 * PyLong_SHIFT) {
41628 __PYX_VERIFY_RETURN_INT(
long,
unsigned long, (((((((
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
41629 }
else if (8 *
sizeof(
long) >= 3 * PyLong_SHIFT) {
41630 return (
long) (((((((long)digits[2]) << PyLong_SHIFT) | (
long)digits[1]) << PyLong_SHIFT) | (long)digits[0]));
41635 if (8 *
sizeof(
long) > 3 * PyLong_SHIFT) {
41636 if (8 *
sizeof(
unsigned long) > 4 * PyLong_SHIFT) {
41637 __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])))
41638 }
else if (8 *
sizeof(
long) >= 4 * PyLong_SHIFT) {
41639 return (
long) (((((((((long)digits[3]) << PyLong_SHIFT) | (
long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (
long)digits[0]));
41645 #if CYTHON_COMPILING_IN_CPYTHON
41646 if (unlikely(Py_SIZE(x) < 0)) {
41647 goto raise_neg_overflow;
41651 int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
41652 if (unlikely(result < 0))
41654 if (unlikely(result == 1))
41655 goto raise_neg_overflow;
41658 if (
sizeof(
long) <=
sizeof(
unsigned long)) {
41659 __PYX_VERIFY_RETURN_INT_EXC(
long,
unsigned long, PyLong_AsUnsignedLong(x))
41660 #ifdef HAVE_LONG_LONG
41661 }
else if (
sizeof(
long) <=
sizeof(
unsigned PY_LONG_LONG)) {
41662 __PYX_VERIFY_RETURN_INT_EXC(
long,
unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
41666 #if CYTHON_USE_PYLONG_INTERNALS
41667 const digit* digits = ((PyLongObject*)x)->ob_digit;
41668 switch (Py_SIZE(x)) {
41669 case 0:
return (
long) 0;
41670 case -1: __PYX_VERIFY_RETURN_INT(
long, sdigit, (sdigit) (-(sdigit)digits[0]))
41671 case 1: __PYX_VERIFY_RETURN_INT(
long, digit, +digits[0])
41673 if (8 *
sizeof(
long) - 1 > 1 * PyLong_SHIFT) {
41674 if (8 *
sizeof(
unsigned long) > 2 * PyLong_SHIFT) {
41675 __PYX_VERIFY_RETURN_INT(
long,
long, -(
long) (((((
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
41676 }
else if (8 *
sizeof(
long) - 1 > 2 * PyLong_SHIFT) {
41677 return (
long) (((long)-1)*(((((long)digits[1]) << PyLong_SHIFT) | (
long)digits[0])));
41682 if (8 *
sizeof(
long) > 1 * PyLong_SHIFT) {
41683 if (8 *
sizeof(
unsigned long) > 2 * PyLong_SHIFT) {
41684 __PYX_VERIFY_RETURN_INT(
long,
unsigned long, (((((
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
41685 }
else if (8 *
sizeof(
long) - 1 > 2 * PyLong_SHIFT) {
41686 return (
long) ((((((long)digits[1]) << PyLong_SHIFT) | (
long)digits[0])));
41691 if (8 *
sizeof(
long) - 1 > 2 * PyLong_SHIFT) {
41692 if (8 *
sizeof(
unsigned long) > 3 * PyLong_SHIFT) {
41693 __PYX_VERIFY_RETURN_INT(
long,
long, -(
long) (((((((
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
41694 }
else if (8 *
sizeof(
long) - 1 > 3 * PyLong_SHIFT) {
41695 return (
long) (((long)-1)*(((((((long)digits[2]) << PyLong_SHIFT) | (
long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
41700 if (8 *
sizeof(
long) > 2 * PyLong_SHIFT) {
41701 if (8 *
sizeof(
unsigned long) > 3 * PyLong_SHIFT) {
41702 __PYX_VERIFY_RETURN_INT(
long,
unsigned long, (((((((
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
41703 }
else if (8 *
sizeof(
long) - 1 > 3 * PyLong_SHIFT) {
41704 return (
long) ((((((((long)digits[2]) << PyLong_SHIFT) | (
long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
41709 if (8 *
sizeof(
long) - 1 > 3 * PyLong_SHIFT) {
41710 if (8 *
sizeof(
unsigned long) > 4 * PyLong_SHIFT) {
41711 __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])))
41712 }
else if (8 *
sizeof(
long) - 1 > 4 * PyLong_SHIFT) {
41713 return (
long) (((long)-1)*(((((((((long)digits[3]) << PyLong_SHIFT) | (
long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (
long)digits[0])));
41718 if (8 *
sizeof(
long) > 3 * PyLong_SHIFT) {
41719 if (8 *
sizeof(
unsigned long) > 4 * PyLong_SHIFT) {
41720 __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])))
41721 }
else if (8 *
sizeof(
long) - 1 > 4 * PyLong_SHIFT) {
41722 return (
long) ((((((((((long)digits[3]) << PyLong_SHIFT) | (
long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (
long)digits[0])));
41728 if (
sizeof(
long) <=
sizeof(long)) {
41729 __PYX_VERIFY_RETURN_INT_EXC(
long,
long, PyLong_AsLong(x))
41730 #ifdef HAVE_LONG_LONG
41731 }
else if (
sizeof(
long) <=
sizeof(PY_LONG_LONG)) {
41732 __PYX_VERIFY_RETURN_INT_EXC(
long, PY_LONG_LONG, PyLong_AsLongLong(x))
41737 #if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray)
41738 PyErr_SetString(PyExc_RuntimeError,
41739 "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers");
41742 PyObject *
v = __Pyx_PyNumber_IntOrLong(x);
41743 #if PY_MAJOR_VERSION < 3
41744 if (likely(
v) && !PyLong_Check(
v)) {
41746 v = PyNumber_Long(tmp);
41751 int one = 1;
int is_little = (int)*(
unsigned char *)&one;
41752 unsigned char *bytes = (
unsigned char *)&val;
41753 int ret = _PyLong_AsByteArray((PyLongObject *)
v,
41754 bytes,
sizeof(val),
41755 is_little, !is_unsigned);
41765 PyObject *tmp = __Pyx_PyNumber_IntOrLong(x);
41766 if (!tmp)
return (
long) -1;
41767 val = __Pyx_PyInt_As_long(tmp);
41772 PyErr_SetString(PyExc_OverflowError,
41773 "value too large to convert to long");
41775 raise_neg_overflow:
41776 PyErr_SetString(PyExc_OverflowError,
41777 "can't convert negative value to long");
41782 static CYTHON_INLINE
char __Pyx_PyInt_As_char(PyObject *x) {
41783 #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
41784 #pragma GCC diagnostic push
41785 #pragma GCC diagnostic ignored "-Wconversion"
41787 const char neg_one = (char) -1, const_zero = (
char) 0;
41788 #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
41789 #pragma GCC diagnostic pop
41791 const int is_unsigned = neg_one > const_zero;
41792 #if PY_MAJOR_VERSION < 3
41793 if (likely(PyInt_Check(x))) {
41794 if (
sizeof(
char) <
sizeof(long)) {
41795 __PYX_VERIFY_RETURN_INT(
char,
long, PyInt_AS_LONG(x))
41797 long val = PyInt_AS_LONG(x);
41798 if (is_unsigned && unlikely(val < 0)) {
41799 goto raise_neg_overflow;
41805 if (likely(PyLong_Check(x))) {
41807 #if CYTHON_USE_PYLONG_INTERNALS
41808 const digit* digits = ((PyLongObject*)x)->ob_digit;
41809 switch (Py_SIZE(x)) {
41810 case 0:
return (
char) 0;
41811 case 1: __PYX_VERIFY_RETURN_INT(
char, digit, digits[0])
41813 if (8 *
sizeof(
char) > 1 * PyLong_SHIFT) {
41814 if (8 *
sizeof(
unsigned long) > 2 * PyLong_SHIFT) {
41815 __PYX_VERIFY_RETURN_INT(
char,
unsigned long, (((((
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
41816 }
else if (8 *
sizeof(
char) >= 2 * PyLong_SHIFT) {
41817 return (
char) (((((char)digits[1]) << PyLong_SHIFT) | (
char)digits[0]));
41822 if (8 *
sizeof(
char) > 2 * PyLong_SHIFT) {
41823 if (8 *
sizeof(
unsigned long) > 3 * PyLong_SHIFT) {
41824 __PYX_VERIFY_RETURN_INT(
char,
unsigned long, (((((((
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
41825 }
else if (8 *
sizeof(
char) >= 3 * PyLong_SHIFT) {
41826 return (
char) (((((((char)digits[2]) << PyLong_SHIFT) | (
char)digits[1]) << PyLong_SHIFT) | (char)digits[0]));
41831 if (8 *
sizeof(
char) > 3 * PyLong_SHIFT) {
41832 if (8 *
sizeof(
unsigned long) > 4 * PyLong_SHIFT) {
41833 __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])))
41834 }
else if (8 *
sizeof(
char) >= 4 * PyLong_SHIFT) {
41835 return (
char) (((((((((char)digits[3]) << PyLong_SHIFT) | (
char)digits[2]) << PyLong_SHIFT) | (char)digits[1]) << PyLong_SHIFT) | (
char)digits[0]));
41841 #if CYTHON_COMPILING_IN_CPYTHON
41842 if (unlikely(Py_SIZE(x) < 0)) {
41843 goto raise_neg_overflow;
41847 int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
41848 if (unlikely(result < 0))
41850 if (unlikely(result == 1))
41851 goto raise_neg_overflow;
41854 if (
sizeof(
char) <=
sizeof(
unsigned long)) {
41855 __PYX_VERIFY_RETURN_INT_EXC(
char,
unsigned long, PyLong_AsUnsignedLong(x))
41856 #ifdef HAVE_LONG_LONG
41857 }
else if (
sizeof(
char) <=
sizeof(
unsigned PY_LONG_LONG)) {
41858 __PYX_VERIFY_RETURN_INT_EXC(
char,
unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
41862 #if CYTHON_USE_PYLONG_INTERNALS
41863 const digit* digits = ((PyLongObject*)x)->ob_digit;
41864 switch (Py_SIZE(x)) {
41865 case 0:
return (
char) 0;
41866 case -1: __PYX_VERIFY_RETURN_INT(
char, sdigit, (sdigit) (-(sdigit)digits[0]))
41867 case 1: __PYX_VERIFY_RETURN_INT(
char, digit, +digits[0])
41869 if (8 *
sizeof(
char) - 1 > 1 * PyLong_SHIFT) {
41870 if (8 *
sizeof(
unsigned long) > 2 * PyLong_SHIFT) {
41871 __PYX_VERIFY_RETURN_INT(
char,
long, -(
long) (((((
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
41872 }
else if (8 *
sizeof(
char) - 1 > 2 * PyLong_SHIFT) {
41873 return (
char) (((char)-1)*(((((char)digits[1]) << PyLong_SHIFT) | (
char)digits[0])));
41878 if (8 *
sizeof(
char) > 1 * PyLong_SHIFT) {
41879 if (8 *
sizeof(
unsigned long) > 2 * PyLong_SHIFT) {
41880 __PYX_VERIFY_RETURN_INT(
char,
unsigned long, (((((
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
41881 }
else if (8 *
sizeof(
char) - 1 > 2 * PyLong_SHIFT) {
41882 return (
char) ((((((char)digits[1]) << PyLong_SHIFT) | (
char)digits[0])));
41887 if (8 *
sizeof(
char) - 1 > 2 * PyLong_SHIFT) {
41888 if (8 *
sizeof(
unsigned long) > 3 * PyLong_SHIFT) {
41889 __PYX_VERIFY_RETURN_INT(
char,
long, -(
long) (((((((
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
41890 }
else if (8 *
sizeof(
char) - 1 > 3 * PyLong_SHIFT) {
41891 return (
char) (((char)-1)*(((((((char)digits[2]) << PyLong_SHIFT) | (
char)digits[1]) << PyLong_SHIFT) | (char)digits[0])));
41896 if (8 *
sizeof(
char) > 2 * PyLong_SHIFT) {
41897 if (8 *
sizeof(
unsigned long) > 3 * PyLong_SHIFT) {
41898 __PYX_VERIFY_RETURN_INT(
char,
unsigned long, (((((((
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
41899 }
else if (8 *
sizeof(
char) - 1 > 3 * PyLong_SHIFT) {
41900 return (
char) ((((((((char)digits[2]) << PyLong_SHIFT) | (
char)digits[1]) << PyLong_SHIFT) | (char)digits[0])));
41905 if (8 *
sizeof(
char) - 1 > 3 * PyLong_SHIFT) {
41906 if (8 *
sizeof(
unsigned long) > 4 * PyLong_SHIFT) {
41907 __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])))
41908 }
else if (8 *
sizeof(
char) - 1 > 4 * PyLong_SHIFT) {
41909 return (
char) (((char)-1)*(((((((((char)digits[3]) << PyLong_SHIFT) | (
char)digits[2]) << PyLong_SHIFT) | (char)digits[1]) << PyLong_SHIFT) | (
char)digits[0])));
41914 if (8 *
sizeof(
char) > 3 * PyLong_SHIFT) {
41915 if (8 *
sizeof(
unsigned long) > 4 * PyLong_SHIFT) {
41916 __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])))
41917 }
else if (8 *
sizeof(
char) - 1 > 4 * PyLong_SHIFT) {
41918 return (
char) ((((((((((char)digits[3]) << PyLong_SHIFT) | (
char)digits[2]) << PyLong_SHIFT) | (char)digits[1]) << PyLong_SHIFT) | (
char)digits[0])));
41924 if (
sizeof(
char) <=
sizeof(long)) {
41925 __PYX_VERIFY_RETURN_INT_EXC(
char,
long, PyLong_AsLong(x))
41926 #ifdef HAVE_LONG_LONG
41927 }
else if (
sizeof(
char) <=
sizeof(PY_LONG_LONG)) {
41928 __PYX_VERIFY_RETURN_INT_EXC(
char, PY_LONG_LONG, PyLong_AsLongLong(x))
41933 #if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray)
41934 PyErr_SetString(PyExc_RuntimeError,
41935 "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers");
41938 PyObject *
v = __Pyx_PyNumber_IntOrLong(x);
41939 #if PY_MAJOR_VERSION < 3
41940 if (likely(
v) && !PyLong_Check(
v)) {
41942 v = PyNumber_Long(tmp);
41947 int one = 1;
int is_little = (int)*(
unsigned char *)&one;
41948 unsigned char *bytes = (
unsigned char *)&val;
41949 int ret = _PyLong_AsByteArray((PyLongObject *)
v,
41950 bytes,
sizeof(val),
41951 is_little, !is_unsigned);
41961 PyObject *tmp = __Pyx_PyNumber_IntOrLong(x);
41962 if (!tmp)
return (
char) -1;
41963 val = __Pyx_PyInt_As_char(tmp);
41968 PyErr_SetString(PyExc_OverflowError,
41969 "value too large to convert to char");
41971 raise_neg_overflow:
41972 PyErr_SetString(PyExc_OverflowError,
41973 "can't convert negative value to char");
41978 static PyTypeObject* __Pyx_FetchCommonType(PyTypeObject* type) {
41979 PyObject* fake_module;
41980 PyTypeObject* cached_type = NULL;
41981 fake_module = PyImport_AddModule((
char*)
"_cython_" CYTHON_ABI);
41982 if (!fake_module)
return NULL;
41983 Py_INCREF(fake_module);
41984 cached_type = (PyTypeObject*) PyObject_GetAttrString(fake_module, type->tp_name);
41986 if (!PyType_Check((PyObject*)cached_type)) {
41987 PyErr_Format(PyExc_TypeError,
41988 "Shared Cython type %.200s is not a type object",
41992 if (cached_type->tp_basicsize != type->tp_basicsize) {
41993 PyErr_Format(PyExc_TypeError,
41994 "Shared Cython type %.200s has the wrong size, try recompiling",
41999 if (!PyErr_ExceptionMatches(PyExc_AttributeError))
goto bad;
42001 if (PyType_Ready(type) < 0)
goto bad;
42002 if (PyObject_SetAttrString(fake_module, type->tp_name, (PyObject*) type) < 0)
42005 cached_type = type;
42008 Py_DECREF(fake_module);
42009 return cached_type;
42011 Py_XDECREF(cached_type);
42012 cached_type = NULL;
42017 static int __Pyx_PyObject_GetMethod(PyObject *obj, PyObject *name, PyObject **method) {
42019 #if CYTHON_UNPACK_METHODS && CYTHON_COMPILING_IN_CPYTHON && CYTHON_USE_PYTYPE_LOOKUP
42020 PyTypeObject *tp = Py_TYPE(obj);
42022 descrgetfunc
f = NULL;
42023 PyObject **dictptr, *dict;
42024 int meth_found = 0;
42025 assert (*method == NULL);
42026 if (unlikely(tp->tp_getattro != PyObject_GenericGetAttr)) {
42027 attr = __Pyx_PyObject_GetAttrStr(obj, name);
42030 if (unlikely(tp->tp_dict == NULL) && unlikely(PyType_Ready(tp) < 0)) {
42033 descr = _PyType_Lookup(tp, name);
42034 if (likely(descr != NULL)) {
42036 #if PY_MAJOR_VERSION >= 3
42037 #ifdef __Pyx_CyFunction_USED
42038 if (likely(PyFunction_Check(descr) || (Py_TYPE(descr) == &PyMethodDescr_Type) || __Pyx_CyFunction_Check(descr)))
42040 if (likely(PyFunction_Check(descr) || (Py_TYPE(descr) == &PyMethodDescr_Type)))
42043 #ifdef __Pyx_CyFunction_USED
42044 if (likely(PyFunction_Check(descr) || __Pyx_CyFunction_Check(descr)))
42046 if (likely(PyFunction_Check(descr)))
42052 f = Py_TYPE(descr)->tp_descr_get;
42053 if (
f != NULL && PyDescr_IsData(descr)) {
42054 attr =
f(descr, obj, (PyObject *)Py_TYPE(obj));
42060 dictptr = _PyObject_GetDictPtr(obj);
42061 if (dictptr != NULL && (dict = *dictptr) != NULL) {
42063 attr = __Pyx_PyDict_GetItemStr(dict, name);
42064 if (attr != NULL) {
42077 attr =
f(descr, obj, (PyObject *)Py_TYPE(obj));
42081 if (descr != NULL) {
42085 PyErr_Format(PyExc_AttributeError,
42086 #
if PY_MAJOR_VERSION >= 3
42087 "'%.50s' object has no attribute '%U'",
42088 tp->tp_name, name);
42090 "'%.50s' object has no attribute '%.400s'",
42091 tp->tp_name, PyString_AS_STRING(name));
42095 attr = __Pyx_PyObject_GetAttrStr(obj, name);
42099 #if CYTHON_UNPACK_METHODS
42100 if (likely(attr) && PyMethod_Check(attr) && likely(PyMethod_GET_SELF(attr) == obj)) {
42101 PyObject *
function = PyMethod_GET_FUNCTION(attr);
42102 Py_INCREF(
function);
42104 *method =
function;
42113 static PyObject* __Pyx__PyObject_CallMethod1(PyObject* method, PyObject* arg) {
42114 PyObject *result = __Pyx_PyObject_CallOneArg(method, arg);
42118 static PyObject* __Pyx_PyObject_CallMethod1(PyObject* obj, PyObject* method_name, PyObject* arg) {
42119 PyObject *method = NULL, *result;
42120 int is_method = __Pyx_PyObject_GetMethod(obj, method_name, &method);
42121 if (likely(is_method)) {
42122 result = __Pyx_PyObject_Call2Args(method, obj, arg);
42126 if (unlikely(!method))
return NULL;
42127 return __Pyx__PyObject_CallMethod1(method, arg);
42131 #include <structmember.h>
42132 #include <frameobject.h>
42133 #if PY_VERSION_HEX >= 0x030b00a6
42134 #ifndef Py_BUILD_CORE
42135 #define Py_BUILD_CORE 1
42137 #include "internal/pycore_frame.h"
42139 #define __Pyx_Coroutine_Undelegate(gen) Py_CLEAR((gen)->yieldfrom)
42140 static int __Pyx_PyGen__FetchStopIterationValue(CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject **pvalue) {
42141 PyObject *et, *ev, *tb;
42142 PyObject *value = NULL;
42143 __Pyx_ErrFetch(&et, &ev, &tb);
42147 Py_INCREF(Py_None);
42151 if (likely(et == PyExc_StopIteration)) {
42153 Py_INCREF(Py_None);
42156 #if PY_VERSION_HEX >= 0x030300A0
42157 else if (Py_TYPE(ev) == (PyTypeObject*)PyExc_StopIteration) {
42158 value = ((PyStopIterationObject *)ev)->value;
42163 else if (unlikely(PyTuple_Check(ev))) {
42164 if (PyTuple_GET_SIZE(ev) >= 1) {
42165 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
42166 value = PyTuple_GET_ITEM(ev, 0);
42169 value = PySequence_ITEM(ev, 0);
42172 Py_INCREF(Py_None);
42177 else if (!__Pyx_TypeCheck(ev, (PyTypeObject*)PyExc_StopIteration)) {
42180 if (likely(value)) {
42186 }
else if (!__Pyx_PyErr_GivenExceptionMatches(et, PyExc_StopIteration)) {
42187 __Pyx_ErrRestore(et, ev, tb);
42190 PyErr_NormalizeException(&et, &ev, &tb);
42191 if (unlikely(!PyObject_TypeCheck(ev, (PyTypeObject*)PyExc_StopIteration))) {
42192 __Pyx_ErrRestore(et, ev, tb);
42197 #if PY_VERSION_HEX >= 0x030300A0
42198 value = ((PyStopIterationObject *)ev)->value;
42203 PyObject* args = __Pyx_PyObject_GetAttrStr(ev, __pyx_n_s_args);
42205 if (likely(args)) {
42206 value = PySequence_GetItem(args, 0);
42209 if (unlikely(!value)) {
42210 __Pyx_ErrRestore(NULL, NULL, NULL);
42211 Py_INCREF(Py_None);
42219 static CYTHON_INLINE
42220 void __Pyx_Coroutine_ExceptionClear(__Pyx_ExcInfoStruct *exc_state) {
42221 PyObject *t, *
v, *tb;
42222 t = exc_state->exc_type;
42223 v = exc_state->exc_value;
42224 tb = exc_state->exc_traceback;
42225 exc_state->exc_type = NULL;
42226 exc_state->exc_value = NULL;
42227 exc_state->exc_traceback = NULL;
42232 #define __Pyx_Coroutine_AlreadyRunningError(gen) (__Pyx__Coroutine_AlreadyRunningError(gen), (PyObject*)NULL)
42233 static void __Pyx__Coroutine_AlreadyRunningError(CYTHON_UNUSED __pyx_CoroutineObject *gen) {
42236 #ifdef __Pyx_Coroutine_USED
42237 }
else if (__Pyx_Coroutine_Check((PyObject*)gen)) {
42238 msg =
"coroutine already executing";
42240 #ifdef __Pyx_AsyncGen_USED
42241 }
else if (__Pyx_AsyncGen_CheckExact((PyObject*)gen)) {
42242 msg =
"async generator already executing";
42245 msg =
"generator already executing";
42247 PyErr_SetString(PyExc_ValueError, msg);
42249 #define __Pyx_Coroutine_NotStartedError(gen) (__Pyx__Coroutine_NotStartedError(gen), (PyObject*)NULL)
42250 static void __Pyx__Coroutine_NotStartedError(CYTHON_UNUSED PyObject *gen) {
42253 #ifdef __Pyx_Coroutine_USED
42254 }
else if (__Pyx_Coroutine_Check(gen)) {
42255 msg =
"can't send non-None value to a just-started coroutine";
42257 #ifdef __Pyx_AsyncGen_USED
42258 }
else if (__Pyx_AsyncGen_CheckExact(gen)) {
42259 msg =
"can't send non-None value to a just-started async generator";
42262 msg =
"can't send non-None value to a just-started generator";
42264 PyErr_SetString(PyExc_TypeError, msg);
42266 #define __Pyx_Coroutine_AlreadyTerminatedError(gen, value, closing) (__Pyx__Coroutine_AlreadyTerminatedError(gen, value, closing), (PyObject*)NULL)
42267 static void __Pyx__Coroutine_AlreadyTerminatedError(CYTHON_UNUSED PyObject *gen, PyObject *value, CYTHON_UNUSED
int closing) {
42268 #ifdef __Pyx_Coroutine_USED
42269 if (!closing && __Pyx_Coroutine_Check(gen)) {
42270 PyErr_SetString(PyExc_RuntimeError,
"cannot reuse already awaited coroutine");
42274 #ifdef __Pyx_AsyncGen_USED
42275 if (__Pyx_AsyncGen_CheckExact(gen))
42276 PyErr_SetNone(__Pyx_PyExc_StopAsyncIteration);
42279 PyErr_SetNone(PyExc_StopIteration);
42283 PyObject *__Pyx_Coroutine_SendEx(__pyx_CoroutineObject *
self, PyObject *value,
int closing) {
42284 __Pyx_PyThreadState_declare
42285 PyThreadState *tstate;
42286 __Pyx_ExcInfoStruct *exc_state;
42288 assert(!self->is_running);
42289 if (unlikely(self->resume_label == 0)) {
42290 if (unlikely(value && value != Py_None)) {
42291 return __Pyx_Coroutine_NotStartedError((PyObject*)
self);
42294 if (unlikely(self->resume_label == -1)) {
42295 return __Pyx_Coroutine_AlreadyTerminatedError((PyObject*)
self, value, closing);
42297 #if CYTHON_FAST_THREAD_STATE
42298 __Pyx_PyThreadState_assign
42299 tstate = __pyx_tstate;
42301 tstate = __Pyx_PyThreadState_Current;
42303 exc_state = &
self->gi_exc_state;
42304 if (exc_state->exc_type) {
42305 #if CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_PYSTON
42307 if (exc_state->exc_traceback) {
42308 PyTracebackObject *tb = (PyTracebackObject *) exc_state->exc_traceback;
42309 PyFrameObject *
f = tb->tb_frame;
42310 assert(
f->f_back == NULL);
42311 #if PY_VERSION_HEX >= 0x030B00A1
42312 f->f_back = PyThreadState_GetFrame(tstate);
42314 Py_XINCREF(tstate->frame);
42315 f->f_back = tstate->frame;
42320 #if CYTHON_USE_EXC_INFO_STACK
42321 exc_state->previous_item = tstate->exc_info;
42322 tstate->exc_info = exc_state;
42324 if (exc_state->exc_type) {
42325 __Pyx_ExceptionSwap(&exc_state->exc_type, &exc_state->exc_value, &exc_state->exc_traceback);
42327 __Pyx_Coroutine_ExceptionClear(exc_state);
42328 __Pyx_ExceptionSave(&exc_state->exc_type, &exc_state->exc_value, &exc_state->exc_traceback);
42331 self->is_running = 1;
42332 retval =
self->body((PyObject *)
self, tstate, value);
42333 self->is_running = 0;
42334 #if CYTHON_USE_EXC_INFO_STACK
42335 exc_state = &
self->gi_exc_state;
42336 tstate->exc_info = exc_state->previous_item;
42337 exc_state->previous_item = NULL;
42338 __Pyx_Coroutine_ResetFrameBackpointer(exc_state);
42342 static CYTHON_INLINE
void __Pyx_Coroutine_ResetFrameBackpointer(__Pyx_ExcInfoStruct *exc_state) {
42343 PyObject *exc_tb = exc_state->exc_traceback;
42344 if (likely(exc_tb)) {
42345 #if CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_PYSTON
42347 PyTracebackObject *tb = (PyTracebackObject *) exc_tb;
42348 PyFrameObject *
f = tb->tb_frame;
42349 Py_CLEAR(
f->f_back);
42353 static CYTHON_INLINE
42354 PyObject *__Pyx_Coroutine_MethodReturn(CYTHON_UNUSED PyObject* gen, PyObject *retval) {
42355 if (unlikely(!retval)) {
42356 __Pyx_PyThreadState_declare
42357 __Pyx_PyThreadState_assign
42358 if (!__Pyx_PyErr_Occurred()) {
42359 PyObject *exc = PyExc_StopIteration;
42360 #ifdef __Pyx_AsyncGen_USED
42361 if (__Pyx_AsyncGen_CheckExact(gen))
42362 exc = __Pyx_PyExc_StopAsyncIteration;
42364 __Pyx_PyErr_SetNone(exc);
42369 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x03030000 && (defined(__linux__) || PY_VERSION_HEX >= 0x030600B3)
42370 static CYTHON_INLINE
42371 PyObject *__Pyx_PyGen_Send(PyGenObject *gen, PyObject *arg) {
42372 #if PY_VERSION_HEX <= 0x030A00A1
42373 return _PyGen_Send(gen, arg);
42376 if (PyIter_Send((PyObject*)gen, arg ? arg : Py_None, &result) == PYGEN_RETURN) {
42377 if (PyAsyncGen_CheckExact(gen)) {
42378 assert(result == Py_None);
42379 PyErr_SetNone(PyExc_StopAsyncIteration);
42381 else if (result == Py_None) {
42382 PyErr_SetNone(PyExc_StopIteration);
42385 _PyGen_SetStopIterationValue(result);
42393 static CYTHON_INLINE
42394 PyObject *__Pyx_Coroutine_FinishDelegation(__pyx_CoroutineObject *gen) {
42396 PyObject *val = NULL;
42397 __Pyx_Coroutine_Undelegate(gen);
42398 __Pyx_PyGen__FetchStopIterationValue(__Pyx_PyThreadState_Current, &val);
42399 ret = __Pyx_Coroutine_SendEx(gen, val, 0);
42403 static PyObject *__Pyx_Coroutine_Send(PyObject *
self, PyObject *value) {
42405 __pyx_CoroutineObject *gen = (__pyx_CoroutineObject*)
self;
42406 PyObject *yf = gen->yieldfrom;
42407 if (unlikely(gen->is_running))
42408 return __Pyx_Coroutine_AlreadyRunningError(gen);
42411 gen->is_running = 1;
42412 #ifdef __Pyx_Generator_USED
42413 if (__Pyx_Generator_CheckExact(yf)) {
42414 ret = __Pyx_Coroutine_Send(yf, value);
42417 #ifdef __Pyx_Coroutine_USED
42418 if (__Pyx_Coroutine_Check(yf)) {
42419 ret = __Pyx_Coroutine_Send(yf, value);
42422 #ifdef __Pyx_AsyncGen_USED
42423 if (__pyx_PyAsyncGenASend_CheckExact(yf)) {
42424 ret = __Pyx_async_gen_asend_send(yf, value);
42427 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x03030000 && (defined(__linux__) || PY_VERSION_HEX >= 0x030600B3)
42428 if (PyGen_CheckExact(yf)) {
42429 ret = __Pyx_PyGen_Send((PyGenObject*)yf, value == Py_None ? NULL : value);
42432 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x03050000 && defined(PyCoro_CheckExact) && (defined(__linux__) || PY_VERSION_HEX >= 0x030600B3)
42433 if (PyCoro_CheckExact(yf)) {
42434 ret = __Pyx_PyGen_Send((PyGenObject*)yf, value == Py_None ? NULL : value);
42438 if (value == Py_None)
42439 ret = Py_TYPE(yf)->tp_iternext(yf);
42441 ret = __Pyx_PyObject_CallMethod1(yf, __pyx_n_s_send, value);
42443 gen->is_running = 0;
42447 retval = __Pyx_Coroutine_FinishDelegation(gen);
42449 retval = __Pyx_Coroutine_SendEx(gen, value, 0);
42451 return __Pyx_Coroutine_MethodReturn(
self, retval);
42453 static int __Pyx_Coroutine_CloseIter(__pyx_CoroutineObject *gen, PyObject *yf) {
42454 PyObject *retval = NULL;
42456 #ifdef __Pyx_Generator_USED
42457 if (__Pyx_Generator_CheckExact(yf)) {
42458 retval = __Pyx_Coroutine_Close(yf);
42463 #ifdef __Pyx_Coroutine_USED
42464 if (__Pyx_Coroutine_Check(yf)) {
42465 retval = __Pyx_Coroutine_Close(yf);
42469 if (__Pyx_CoroutineAwait_CheckExact(yf)) {
42470 retval = __Pyx_CoroutineAwait_Close((__pyx_CoroutineAwaitObject*)yf, NULL);
42475 #ifdef __Pyx_AsyncGen_USED
42476 if (__pyx_PyAsyncGenASend_CheckExact(yf)) {
42477 retval = __Pyx_async_gen_asend_close(yf, NULL);
42479 if (__pyx_PyAsyncGenAThrow_CheckExact(yf)) {
42480 retval = __Pyx_async_gen_athrow_close(yf, NULL);
42485 gen->is_running = 1;
42486 meth = __Pyx_PyObject_GetAttrStr(yf, __pyx_n_s_close);
42487 if (unlikely(!meth)) {
42488 if (!PyErr_ExceptionMatches(PyExc_AttributeError)) {
42489 PyErr_WriteUnraisable(yf);
42493 retval = PyObject_CallFunction(meth, NULL);
42498 gen->is_running = 0;
42500 Py_XDECREF(retval);
42503 static PyObject *__Pyx_Generator_Next(PyObject *
self) {
42504 __pyx_CoroutineObject *gen = (__pyx_CoroutineObject*)
self;
42505 PyObject *yf = gen->yieldfrom;
42506 if (unlikely(gen->is_running))
42507 return __Pyx_Coroutine_AlreadyRunningError(gen);
42510 gen->is_running = 1;
42511 #ifdef __Pyx_Generator_USED
42512 if (__Pyx_Generator_CheckExact(yf)) {
42513 ret = __Pyx_Generator_Next(yf);
42516 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x03030000 && (defined(__linux__) || PY_VERSION_HEX >= 0x030600B3)
42517 if (PyGen_CheckExact(yf)) {
42518 ret = __Pyx_PyGen_Send((PyGenObject*)yf, NULL);
42521 #ifdef __Pyx_Coroutine_USED
42522 if (__Pyx_Coroutine_Check(yf)) {
42523 ret = __Pyx_Coroutine_Send(yf, Py_None);
42526 ret = Py_TYPE(yf)->tp_iternext(yf);
42527 gen->is_running = 0;
42531 return __Pyx_Coroutine_FinishDelegation(gen);
42533 return __Pyx_Coroutine_SendEx(gen, Py_None, 0);
42535 static PyObject *__Pyx_Coroutine_Close_Method(PyObject *
self, CYTHON_UNUSED PyObject *arg) {
42536 return __Pyx_Coroutine_Close(
self);
42538 static PyObject *__Pyx_Coroutine_Close(PyObject *
self) {
42539 __pyx_CoroutineObject *gen = (__pyx_CoroutineObject *)
self;
42540 PyObject *retval, *raised_exception;
42541 PyObject *yf = gen->yieldfrom;
42543 if (unlikely(gen->is_running))
42544 return __Pyx_Coroutine_AlreadyRunningError(gen);
42547 err = __Pyx_Coroutine_CloseIter(gen, yf);
42548 __Pyx_Coroutine_Undelegate(gen);
42552 PyErr_SetNone(PyExc_GeneratorExit);
42553 retval = __Pyx_Coroutine_SendEx(gen, NULL, 1);
42554 if (unlikely(retval)) {
42558 #ifdef __Pyx_Coroutine_USED
42559 }
else if (__Pyx_Coroutine_Check(
self)) {
42560 msg =
"coroutine ignored GeneratorExit";
42562 #ifdef __Pyx_AsyncGen_USED
42563 }
else if (__Pyx_AsyncGen_CheckExact(
self)) {
42564 #if PY_VERSION_HEX < 0x03060000
42565 msg =
"async generator ignored GeneratorExit - might require Python 3.6+ finalisation (PEP 525)";
42567 msg =
"async generator ignored GeneratorExit";
42571 msg =
"generator ignored GeneratorExit";
42573 PyErr_SetString(PyExc_RuntimeError, msg);
42576 raised_exception = PyErr_Occurred();
42577 if (likely(!raised_exception || __Pyx_PyErr_GivenExceptionMatches2(raised_exception, PyExc_GeneratorExit, PyExc_StopIteration))) {
42578 if (raised_exception) PyErr_Clear();
42579 Py_INCREF(Py_None);
42584 static PyObject *__Pyx__Coroutine_Throw(PyObject *
self, PyObject *typ, PyObject *val, PyObject *tb,
42585 PyObject *args,
int close_on_genexit) {
42586 __pyx_CoroutineObject *gen = (__pyx_CoroutineObject *)
self;
42587 PyObject *yf = gen->yieldfrom;
42588 if (unlikely(gen->is_running))
42589 return __Pyx_Coroutine_AlreadyRunningError(gen);
42593 if (__Pyx_PyErr_GivenExceptionMatches(typ, PyExc_GeneratorExit) && close_on_genexit) {
42594 int err = __Pyx_Coroutine_CloseIter(gen, yf);
42596 __Pyx_Coroutine_Undelegate(gen);
42598 return __Pyx_Coroutine_MethodReturn(
self, __Pyx_Coroutine_SendEx(gen, NULL, 0));
42601 gen->is_running = 1;
42603 #ifdef __Pyx_Generator_USED
42604 || __Pyx_Generator_CheckExact(yf)
42606 #ifdef __Pyx_Coroutine_USED
42607 || __Pyx_Coroutine_Check(yf)
42610 ret = __Pyx__Coroutine_Throw(yf, typ, val, tb, args, close_on_genexit);
42611 #ifdef __Pyx_Coroutine_USED
42612 }
else if (__Pyx_CoroutineAwait_CheckExact(yf)) {
42613 ret = __Pyx__Coroutine_Throw(((__pyx_CoroutineAwaitObject*)yf)->coroutine, typ, val, tb, args, close_on_genexit);
42616 PyObject *meth = __Pyx_PyObject_GetAttrStr(yf, __pyx_n_s_throw);
42617 if (unlikely(!meth)) {
42619 if (!PyErr_ExceptionMatches(PyExc_AttributeError)) {
42620 gen->is_running = 0;
42624 __Pyx_Coroutine_Undelegate(gen);
42625 gen->is_running = 0;
42628 if (likely(args)) {
42629 ret = PyObject_CallObject(meth, args);
42631 ret = PyObject_CallFunctionObjArgs(meth, typ, val, tb, NULL);
42635 gen->is_running = 0;
42638 ret = __Pyx_Coroutine_FinishDelegation(gen);
42640 return __Pyx_Coroutine_MethodReturn(
self, ret);
42643 __Pyx_Raise(typ, val, tb, NULL);
42644 return __Pyx_Coroutine_MethodReturn(
self, __Pyx_Coroutine_SendEx(gen, NULL, 0));
42646 static PyObject *__Pyx_Coroutine_Throw(PyObject *
self, PyObject *args) {
42648 PyObject *val = NULL;
42649 PyObject *tb = NULL;
42650 if (!PyArg_UnpackTuple(args, (
char *)
"throw", 1, 3, &typ, &val, &tb))
42652 return __Pyx__Coroutine_Throw(
self, typ, val, tb, args, 1);
42654 static CYTHON_INLINE
int __Pyx_Coroutine_traverse_excstate(__Pyx_ExcInfoStruct *exc_state, visitproc visit,
void *arg) {
42655 Py_VISIT(exc_state->exc_type);
42656 Py_VISIT(exc_state->exc_value);
42657 Py_VISIT(exc_state->exc_traceback);
42660 static int __Pyx_Coroutine_traverse(__pyx_CoroutineObject *gen, visitproc visit,
void *arg) {
42661 Py_VISIT(gen->closure);
42662 Py_VISIT(gen->classobj);
42663 Py_VISIT(gen->yieldfrom);
42664 return __Pyx_Coroutine_traverse_excstate(&gen->gi_exc_state, visit, arg);
42666 static int __Pyx_Coroutine_clear(PyObject *
self) {
42667 __pyx_CoroutineObject *gen = (__pyx_CoroutineObject *)
self;
42668 Py_CLEAR(gen->closure);
42669 Py_CLEAR(gen->classobj);
42670 Py_CLEAR(gen->yieldfrom);
42671 __Pyx_Coroutine_ExceptionClear(&gen->gi_exc_state);
42672 #ifdef __Pyx_AsyncGen_USED
42673 if (__Pyx_AsyncGen_CheckExact(
self)) {
42674 Py_CLEAR(((__pyx_PyAsyncGenObject*)gen)->ag_finalizer);
42677 Py_CLEAR(gen->gi_code);
42678 Py_CLEAR(gen->gi_frame);
42679 Py_CLEAR(gen->gi_name);
42680 Py_CLEAR(gen->gi_qualname);
42681 Py_CLEAR(gen->gi_modulename);
42684 static void __Pyx_Coroutine_dealloc(PyObject *
self) {
42685 __pyx_CoroutineObject *gen = (__pyx_CoroutineObject *)
self;
42686 PyObject_GC_UnTrack(gen);
42687 if (gen->gi_weakreflist != NULL)
42688 PyObject_ClearWeakRefs(
self);
42689 if (gen->resume_label >= 0) {
42690 PyObject_GC_Track(
self);
42691 #if PY_VERSION_HEX >= 0x030400a1 && CYTHON_USE_TP_FINALIZE
42692 if (PyObject_CallFinalizerFromDealloc(
self))
42694 Py_TYPE(gen)->tp_del(
self);
42695 if (Py_REFCNT(
self) > 0)
42700 PyObject_GC_UnTrack(
self);
42702 #ifdef __Pyx_AsyncGen_USED
42703 if (__Pyx_AsyncGen_CheckExact(
self)) {
42707 Py_CLEAR(((__pyx_PyAsyncGenObject*)
self)->ag_finalizer);
42710 __Pyx_Coroutine_clear(
self);
42711 PyObject_GC_Del(gen);
42713 static void __Pyx_Coroutine_del(PyObject *
self) {
42714 PyObject *error_type, *error_value, *error_traceback;
42715 __pyx_CoroutineObject *gen = (__pyx_CoroutineObject *)
self;
42716 __Pyx_PyThreadState_declare
42717 if (gen->resume_label < 0) {
42720 #if !CYTHON_USE_TP_FINALIZE
42721 assert(self->ob_refcnt == 0);
42722 __Pyx_SET_REFCNT(
self, 1);
42724 __Pyx_PyThreadState_assign
42725 __Pyx_ErrFetch(&error_type, &error_value, &error_traceback);
42726 #ifdef __Pyx_AsyncGen_USED
42727 if (__Pyx_AsyncGen_CheckExact(
self)) {
42728 __pyx_PyAsyncGenObject *agen = (__pyx_PyAsyncGenObject*)
self;
42729 PyObject *finalizer = agen->ag_finalizer;
42730 if (finalizer && !agen->ag_closed) {
42731 PyObject *res = __Pyx_PyObject_CallOneArg(finalizer,
self);
42732 if (unlikely(!res)) {
42733 PyErr_WriteUnraisable(
self);
42737 __Pyx_ErrRestore(error_type, error_value, error_traceback);
42742 if (unlikely(gen->resume_label == 0 && !error_value)) {
42743 #ifdef __Pyx_Coroutine_USED
42744 #ifdef __Pyx_Generator_USED
42745 if (!__Pyx_Generator_CheckExact(
self))
42748 PyObject_GC_UnTrack(
self);
42749 #if PY_MAJOR_VERSION >= 3 || defined(PyErr_WarnFormat)
42750 if (unlikely(PyErr_WarnFormat(PyExc_RuntimeWarning, 1,
"coroutine '%.50S' was never awaited", gen->gi_qualname) < 0))
42751 PyErr_WriteUnraisable(
self);
42755 #if CYTHON_COMPILING_IN_PYPY
42757 cmsg = (
char*)
"coroutine was never awaited";
42760 PyObject *qualname;
42761 qualname = gen->gi_qualname;
42762 cname = PyString_AS_STRING(qualname);
42763 msg = PyString_FromFormat(
"coroutine '%.50s' was never awaited", cname);
42764 if (unlikely(!msg)) {
42766 cmsg = (
char*)
"coroutine was never awaited";
42768 cmsg = PyString_AS_STRING(msg);
42771 if (unlikely(PyErr_WarnEx(PyExc_RuntimeWarning, cmsg, 1) < 0))
42772 PyErr_WriteUnraisable(
self);
42775 PyObject_GC_Track(
self);
42779 PyObject *res = __Pyx_Coroutine_Close(
self);
42780 if (unlikely(!res)) {
42781 if (PyErr_Occurred())
42782 PyErr_WriteUnraisable(
self);
42787 __Pyx_ErrRestore(error_type, error_value, error_traceback);
42788 #if !CYTHON_USE_TP_FINALIZE
42789 assert(Py_REFCNT(
self) > 0);
42790 if (--self->ob_refcnt == 0) {
42794 Py_ssize_t refcnt = Py_REFCNT(
self);
42795 _Py_NewReference(
self);
42796 __Pyx_SET_REFCNT(
self, refcnt);
42798 #if CYTHON_COMPILING_IN_CPYTHON
42799 assert(PyType_IS_GC(Py_TYPE(
self)) &&
42800 _Py_AS_GC(
self)->gc.gc_refs != _PyGC_REFS_UNTRACKED);
42803 #ifdef COUNT_ALLOCS
42804 --Py_TYPE(
self)->tp_frees;
42805 --Py_TYPE(
self)->tp_allocs;
42810 __Pyx_Coroutine_get_name(__pyx_CoroutineObject *
self, CYTHON_UNUSED
void *context)
42812 PyObject *name =
self->gi_name;
42813 if (unlikely(!name)) name = Py_None;
42818 __Pyx_Coroutine_set_name(__pyx_CoroutineObject *
self, PyObject *value, CYTHON_UNUSED
void *context)
42821 #if PY_MAJOR_VERSION >= 3
42822 if (unlikely(value == NULL || !PyUnicode_Check(value)))
42824 if (unlikely(value == NULL || !PyString_Check(value)))
42827 PyErr_SetString(PyExc_TypeError,
42828 "__name__ must be set to a string object");
42831 tmp =
self->gi_name;
42833 self->gi_name = value;
42838 __Pyx_Coroutine_get_qualname(__pyx_CoroutineObject *
self, CYTHON_UNUSED
void *context)
42840 PyObject *name =
self->gi_qualname;
42841 if (unlikely(!name)) name = Py_None;
42846 __Pyx_Coroutine_set_qualname(__pyx_CoroutineObject *
self, PyObject *value, CYTHON_UNUSED
void *context)
42849 #if PY_MAJOR_VERSION >= 3
42850 if (unlikely(value == NULL || !PyUnicode_Check(value)))
42852 if (unlikely(value == NULL || !PyString_Check(value)))
42855 PyErr_SetString(PyExc_TypeError,
42856 "__qualname__ must be set to a string object");
42859 tmp =
self->gi_qualname;
42861 self->gi_qualname = value;
42866 __Pyx_Coroutine_get_frame(__pyx_CoroutineObject *
self, CYTHON_UNUSED
void *context)
42868 PyObject *frame =
self->gi_frame;
42870 if (unlikely(!self->gi_code)) {
42873 frame = (PyObject *) PyFrame_New(
42874 PyThreadState_Get(),
42875 (PyCodeObject*) self->gi_code,
42879 if (unlikely(!frame))
42881 self->gi_frame = frame;
42886 static __pyx_CoroutineObject *__Pyx__Coroutine_New(
42887 PyTypeObject* type, __pyx_coroutine_body_t body, PyObject *code, PyObject *closure,
42888 PyObject *name, PyObject *qualname, PyObject *module_name) {
42889 __pyx_CoroutineObject *gen = PyObject_GC_New(__pyx_CoroutineObject, type);
42890 if (unlikely(!gen))
42892 return __Pyx__Coroutine_NewInit(gen, body, code, closure, name, qualname, module_name);
42894 static __pyx_CoroutineObject *__Pyx__Coroutine_NewInit(
42895 __pyx_CoroutineObject *gen, __pyx_coroutine_body_t body, PyObject *code, PyObject *closure,
42896 PyObject *name, PyObject *qualname, PyObject *module_name) {
42898 gen->closure = closure;
42899 Py_XINCREF(closure);
42900 gen->is_running = 0;
42901 gen->resume_label = 0;
42902 gen->classobj = NULL;
42903 gen->yieldfrom = NULL;
42904 gen->gi_exc_state.exc_type = NULL;
42905 gen->gi_exc_state.exc_value = NULL;
42906 gen->gi_exc_state.exc_traceback = NULL;
42907 #if CYTHON_USE_EXC_INFO_STACK
42908 gen->gi_exc_state.previous_item = NULL;
42910 gen->gi_weakreflist = NULL;
42911 Py_XINCREF(qualname);
42912 gen->gi_qualname = qualname;
42914 gen->gi_name = name;
42915 Py_XINCREF(module_name);
42916 gen->gi_modulename = module_name;
42918 gen->gi_code = code;
42919 gen->gi_frame = NULL;
42920 PyObject_GC_Track(gen);
42925 static PyObject* __Pyx_Coroutine_patch_module(PyObject* module,
const char* py_code) {
42926 #if defined(__Pyx_Generator_USED) || defined(__Pyx_Coroutine_USED)
42928 PyObject *globals, *result_obj;
42929 globals = PyDict_New();
if (unlikely(!globals))
goto ignore;
42930 result = PyDict_SetItemString(globals,
"_cython_coroutine_type",
42931 #ifdef __Pyx_Coroutine_USED
42932 (PyObject*)__pyx_CoroutineType);
42936 if (unlikely(result < 0))
goto ignore;
42937 result = PyDict_SetItemString(globals,
"_cython_generator_type",
42938 #ifdef __Pyx_Generator_USED
42939 (PyObject*)__pyx_GeneratorType);
42943 if (unlikely(result < 0))
goto ignore;
42944 if (unlikely(PyDict_SetItemString(globals,
"_module", module) < 0))
goto ignore;
42945 if (unlikely(PyDict_SetItemString(globals,
"__builtins__", __pyx_b) < 0))
goto ignore;
42946 result_obj = PyRun_String(py_code, Py_file_input, globals, globals);
42947 if (unlikely(!result_obj))
goto ignore;
42948 Py_DECREF(result_obj);
42949 Py_DECREF(globals);
42952 Py_XDECREF(globals);
42953 PyErr_WriteUnraisable(module);
42954 if (unlikely(PyErr_WarnEx(PyExc_RuntimeWarning,
"Cython module failed to patch module with custom type", 1) < 0)) {
42965 #ifndef CYTHON_REGISTER_ABCS
42966 #define CYTHON_REGISTER_ABCS 1
42968 #if defined(__Pyx_Generator_USED) || defined(__Pyx_Coroutine_USED)
42969 static PyObject* __Pyx_patch_abc_module(PyObject *module);
42970 static PyObject* __Pyx_patch_abc_module(PyObject *module) {
42971 module = __Pyx_Coroutine_patch_module(
42973 "if _cython_generator_type is not None:\n"
42974 " try: Generator = _module.Generator\n"
42975 " except AttributeError: pass\n"
42976 " else: Generator.register(_cython_generator_type)\n"
42977 "if _cython_coroutine_type is not None:\n"
42978 " try: Coroutine = _module.Coroutine\n"
42979 " except AttributeError: pass\n"
42980 " else: Coroutine.register(_cython_coroutine_type)\n"
42985 static int __Pyx_patch_abc(
void) {
42986 #if defined(__Pyx_Generator_USED) || defined(__Pyx_Coroutine_USED)
42987 static int abc_patched = 0;
42988 if (CYTHON_REGISTER_ABCS && !abc_patched) {
42990 module = PyImport_ImportModule((PY_MAJOR_VERSION >= 3) ?
"collections.abc" :
"collections");
42992 PyErr_WriteUnraisable(NULL);
42993 if (unlikely(PyErr_WarnEx(PyExc_RuntimeWarning,
42994 ((PY_MAJOR_VERSION >= 3) ?
42995 "Cython module failed to register with collections.abc module" :
42996 "Cython module failed to register with collections module"), 1) < 0)) {
43000 module = __Pyx_patch_abc_module(module);
43002 if (unlikely(!module))
43006 module = PyImport_ImportModule(
"backports_abc");
43008 module = __Pyx_patch_abc_module(module);
43009 Py_XDECREF(module);
43016 if ((0)) __Pyx_Coroutine_patch_module(NULL, NULL);
43022 static PyMethodDef __pyx_Generator_methods[] = {
43023 {
"send", (PyCFunction) __Pyx_Coroutine_Send, METH_O,
43024 (
char*) PyDoc_STR(
"send(arg) -> send 'arg' into generator,\nreturn next yielded value or raise StopIteration.")},
43025 {
"throw", (PyCFunction) __Pyx_Coroutine_Throw, METH_VARARGS,
43026 (
char*) PyDoc_STR(
"throw(typ[,val[,tb]]) -> raise exception in generator,\nreturn next yielded value or raise StopIteration.")},
43027 {
"close", (PyCFunction) __Pyx_Coroutine_Close_Method, METH_NOARGS,
43028 (
char*) PyDoc_STR(
"close() -> raise GeneratorExit inside generator.")},
43031 static PyMemberDef __pyx_Generator_memberlist[] = {
43032 {(
char *)
"gi_running", T_BOOL, offsetof(__pyx_CoroutineObject, is_running), READONLY, NULL},
43033 {(
char*)
"gi_yieldfrom", T_OBJECT, offsetof(__pyx_CoroutineObject, yieldfrom), READONLY,
43034 (
char*) PyDoc_STR(
"object being iterated by 'yield from', or None")},
43035 {(
char*)
"gi_code", T_OBJECT, offsetof(__pyx_CoroutineObject, gi_code), READONLY, NULL},
43038 static PyGetSetDef __pyx_Generator_getsets[] = {
43039 {(
char *)
"__name__", (getter)__Pyx_Coroutine_get_name, (setter)__Pyx_Coroutine_set_name,
43040 (
char*) PyDoc_STR(
"name of the generator"), 0},
43041 {(
char *)
"__qualname__", (getter)__Pyx_Coroutine_get_qualname, (setter)__Pyx_Coroutine_set_qualname,
43042 (
char*) PyDoc_STR(
"qualified name of the generator"), 0},
43043 {(
char *)
"gi_frame", (getter)__Pyx_Coroutine_get_frame, NULL,
43044 (
char*) PyDoc_STR(
"Frame of the generator"), 0},
43047 static PyTypeObject __pyx_GeneratorType_type = {
43048 PyVarObject_HEAD_INIT(0, 0)
43050 sizeof(__pyx_CoroutineObject),
43052 (destructor) __Pyx_Coroutine_dealloc,
43067 Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC | Py_TPFLAGS_HAVE_FINALIZE,
43069 (traverseproc) __Pyx_Coroutine_traverse,
43072 offsetof(__pyx_CoroutineObject, gi_weakreflist),
43074 (iternextfunc) __Pyx_Generator_Next,
43075 __pyx_Generator_methods,
43076 __pyx_Generator_memberlist,
43077 __pyx_Generator_getsets,
43093 #
if CYTHON_USE_TP_FINALIZE
43096 __Pyx_Coroutine_del,
43099 #
if CYTHON_USE_TP_FINALIZE
43100 __Pyx_Coroutine_del,
43101 #elif PY_VERSION_HEX >= 0x030400a1
43104 #
if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800)
43107 #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
43110 #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000
43114 static int __pyx_Generator_init(
void) {
43115 __pyx_GeneratorType_type.tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict;
43116 __pyx_GeneratorType_type.tp_iter = PyObject_SelfIter;
43117 __pyx_GeneratorType = __Pyx_FetchCommonType(&__pyx_GeneratorType_type);
43118 if (unlikely(!__pyx_GeneratorType)) {
43125 static int __Pyx_check_binary_version(
void) {
43127 int same=1, i, found_dot;
43128 const char* rt_from_call = Py_GetVersion();
43129 PyOS_snprintf(ctversion, 5,
"%d.%d", PY_MAJOR_VERSION, PY_MINOR_VERSION);
43131 for (i = 0; i < 4; i++) {
43132 if (!ctversion[i]) {
43133 same = (rt_from_call[i] <
'0' || rt_from_call[i] >
'9');
43136 if (rt_from_call[i] != ctversion[i]) {
43142 char rtversion[5] = {
'\0'};
43144 for (i=0; i<4; ++i) {
43145 if (rt_from_call[i] ==
'.') {
43146 if (found_dot)
break;
43148 }
else if (rt_from_call[i] <
'0' || rt_from_call[i] >
'9') {
43151 rtversion[i] = rt_from_call[i];
43153 PyOS_snprintf(message,
sizeof(message),
43154 "compiletime version %s of module '%.100s' "
43155 "does not match runtime version %s",
43156 ctversion, __Pyx_MODULE_NAME, rtversion);
43157 return PyErr_WarnEx(NULL, message, 1);
43163 #ifndef __PYX_HAVE_RT_ImportFunction
43164 #define __PYX_HAVE_RT_ImportFunction
43165 static int __Pyx_ImportFunction(PyObject *module,
const char *funcname,
void (**
f)(
void),
const char *sig) {
43167 PyObject *cobj = 0;
43172 d = PyObject_GetAttrString(module, (
char *)
"__pyx_capi__");
43175 cobj = PyDict_GetItemString(d, funcname);
43177 PyErr_Format(PyExc_ImportError,
43178 "%.200s does not export expected C function %.200s",
43179 PyModule_GetName(module), funcname);
43182 #if PY_VERSION_HEX >= 0x02070000
43183 if (!PyCapsule_IsValid(cobj, sig)) {
43184 PyErr_Format(PyExc_TypeError,
43185 "C function %.200s.%.200s has wrong signature (expected %.500s, got %.500s)",
43186 PyModule_GetName(module), funcname, sig, PyCapsule_GetName(cobj));
43189 tmp.p = PyCapsule_GetPointer(cobj, sig);
43191 {
const char *desc, *s1, *s2;
43192 desc = (
const char *)PyCObject_GetDesc(cobj);
43195 s1 = desc; s2 = sig;
43196 while (*s1 !=
'\0' && *s1 == *s2) { s1++; s2++; }
43198 PyErr_Format(PyExc_TypeError,
43199 "C function %.200s.%.200s has wrong signature (expected %.500s, got %.500s)",
43200 PyModule_GetName(module), funcname, sig, desc);
43203 tmp.p = PyCObject_AsVoidPtr(cobj);}
43217 static int __Pyx_InitStrings(__Pyx_StringTabEntry *t) {
43219 #if PY_MAJOR_VERSION < 3
43220 if (t->is_unicode) {
43221 *t->p = PyUnicode_DecodeUTF8(t->s, t->n - 1, NULL);
43222 }
else if (t->intern) {
43223 *t->p = PyString_InternFromString(t->s);
43225 *t->p = PyString_FromStringAndSize(t->s, t->n - 1);
43228 if (t->is_unicode | t->is_str) {
43230 *t->p = PyUnicode_InternFromString(t->s);
43231 }
else if (t->encoding) {
43232 *t->p = PyUnicode_Decode(t->s, t->n - 1, t->encoding, NULL);
43234 *t->p = PyUnicode_FromStringAndSize(t->s, t->n - 1);
43237 *t->p = PyBytes_FromStringAndSize(t->s, t->n - 1);
43242 if (PyObject_Hash(*t->p) == -1)
43249 static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(
const char* c_str) {
43250 return __Pyx_PyUnicode_FromStringAndSize(c_str, (Py_ssize_t)strlen(c_str));
43252 static CYTHON_INLINE
const char* __Pyx_PyObject_AsString(PyObject* o) {
43254 return __Pyx_PyObject_AsStringAndSize(o, &ignore);
43256 #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT
43257 #if !CYTHON_PEP393_ENABLED
43258 static const char* __Pyx_PyUnicode_AsStringAndSize(PyObject* o, Py_ssize_t *length) {
43260 PyObject* defenc = _PyUnicode_AsDefaultEncodedString(o, NULL);
43261 if (!defenc)
return NULL;
43262 defenc_c = PyBytes_AS_STRING(defenc);
43263 #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
43265 char* end = defenc_c + PyBytes_GET_SIZE(defenc);
43267 for (
c = defenc_c;
c < end;
c++) {
43268 if ((
unsigned char) (*
c) >= 128) {
43269 PyUnicode_AsASCIIString(o);
43275 *length = PyBytes_GET_SIZE(defenc);
43279 static CYTHON_INLINE
const char* __Pyx_PyUnicode_AsStringAndSize(PyObject* o, Py_ssize_t *length) {
43280 if (unlikely(__Pyx_PyUnicode_READY(o) == -1))
return NULL;
43281 #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
43282 if (likely(PyUnicode_IS_ASCII(o))) {
43283 *length = PyUnicode_GET_LENGTH(o);
43284 return PyUnicode_AsUTF8(o);
43286 PyUnicode_AsASCIIString(o);
43290 return PyUnicode_AsUTF8AndSize(o, length);
43295 static CYTHON_INLINE
const char* __Pyx_PyObject_AsStringAndSize(PyObject* o, Py_ssize_t *length) {
43296 #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT
43298 #
if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
43299 __Pyx_sys_getdefaultencoding_not_ascii &&
43301 PyUnicode_Check(o)) {
43302 return __Pyx_PyUnicode_AsStringAndSize(o, length);
43305 #if (!CYTHON_COMPILING_IN_PYPY) || (defined(PyByteArray_AS_STRING) && defined(PyByteArray_GET_SIZE))
43306 if (PyByteArray_Check(o)) {
43307 *length = PyByteArray_GET_SIZE(o);
43308 return PyByteArray_AS_STRING(o);
43313 int r = PyBytes_AsStringAndSize(o, &result, length);
43314 if (unlikely(
r < 0)) {
43321 static CYTHON_INLINE
int __Pyx_PyObject_IsTrue(PyObject* x) {
43322 int is_true = x == Py_True;
43323 if (is_true | (x == Py_False) | (x == Py_None))
return is_true;
43324 else return PyObject_IsTrue(x);
43326 static CYTHON_INLINE
int __Pyx_PyObject_IsTrueAndDecref(PyObject* x) {
43328 if (unlikely(!x))
return -1;
43329 retval = __Pyx_PyObject_IsTrue(x);
43333 static PyObject* __Pyx_PyNumber_IntOrLongWrongResultType(PyObject* result,
const char* type_name) {
43334 #if PY_MAJOR_VERSION >= 3
43335 if (PyLong_Check(result)) {
43336 if (PyErr_WarnFormat(PyExc_DeprecationWarning, 1,
43337 "__int__ returned non-int (type %.200s). "
43338 "The ability to return an instance of a strict subclass of int "
43339 "is deprecated, and may be removed in a future version of Python.",
43340 Py_TYPE(result)->tp_name)) {
43347 PyErr_Format(PyExc_TypeError,
43348 "__%.4s__ returned non-%.4s (type %.200s)",
43349 type_name, type_name, Py_TYPE(result)->tp_name);
43353 static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x) {
43354 #if CYTHON_USE_TYPE_SLOTS
43355 PyNumberMethods *m;
43357 const char *name = NULL;
43358 PyObject *res = NULL;
43359 #if PY_MAJOR_VERSION < 3
43360 if (likely(PyInt_Check(x) || PyLong_Check(x)))
43362 if (likely(PyLong_Check(x)))
43364 return __Pyx_NewRef(x);
43365 #if CYTHON_USE_TYPE_SLOTS
43366 m = Py_TYPE(x)->tp_as_number;
43367 #if PY_MAJOR_VERSION < 3
43368 if (m && m->nb_int) {
43370 res = m->nb_int(x);
43372 else if (m && m->nb_long) {
43374 res = m->nb_long(x);
43377 if (likely(m && m->nb_int)) {
43379 res = m->nb_int(x);
43383 if (!PyBytes_CheckExact(x) && !PyUnicode_CheckExact(x)) {
43384 res = PyNumber_Int(x);
43388 #if PY_MAJOR_VERSION < 3
43389 if (unlikely(!PyInt_Check(res) && !PyLong_Check(res))) {
43391 if (unlikely(!PyLong_CheckExact(res))) {
43393 return __Pyx_PyNumber_IntOrLongWrongResultType(res, name);
43396 else if (!PyErr_Occurred()) {
43397 PyErr_SetString(PyExc_TypeError,
43398 "an integer is required");
43402 static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject* b) {
43405 #if PY_MAJOR_VERSION < 3
43406 if (likely(PyInt_CheckExact(b))) {
43407 if (
sizeof(Py_ssize_t) >=
sizeof(
long))
43408 return PyInt_AS_LONG(b);
43410 return PyInt_AsSsize_t(b);
43413 if (likely(PyLong_CheckExact(b))) {
43414 #if CYTHON_USE_PYLONG_INTERNALS
43415 const digit* digits = ((PyLongObject*)b)->ob_digit;
43416 const Py_ssize_t size = Py_SIZE(b);
43417 if (likely(__Pyx_sst_abs(size) <= 1)) {
43418 ival = likely(size) ? digits[0] : 0;
43419 if (size == -1) ival = -ival;
43424 if (8 *
sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) {
43425 return (Py_ssize_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (
size_t)digits[0]));
43429 if (8 *
sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) {
43430 return -(Py_ssize_t) (((((
size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
43434 if (8 *
sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) {
43435 return (Py_ssize_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (
size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
43439 if (8 *
sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) {
43440 return -(Py_ssize_t) (((((((
size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (
size_t)digits[0]));
43444 if (8 *
sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) {
43445 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]));
43449 if (8 *
sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) {
43450 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]));
43456 return PyLong_AsSsize_t(b);
43458 x = PyNumber_Index(b);
43460 ival = PyInt_AsSsize_t(x);
43464 static CYTHON_INLINE Py_hash_t __Pyx_PyIndex_AsHash_t(PyObject* o) {
43465 if (
sizeof(Py_hash_t) ==
sizeof(Py_ssize_t)) {
43466 return (Py_hash_t) __Pyx_PyIndex_AsSsize_t(o);
43467 #if PY_MAJOR_VERSION < 3
43468 }
else if (likely(PyInt_CheckExact(o))) {
43469 return PyInt_AS_LONG(o);
43474 x = PyNumber_Index(o);
43476 ival = PyInt_AsLong(x);
43481 static CYTHON_INLINE PyObject * __Pyx_PyBool_FromLong(
long b) {
43482 return b ? __Pyx_NewRef(Py_True) : __Pyx_NewRef(Py_False);
43484 static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(
size_t ival) {
43485 return PyInt_FromSize_t(ival);