3 #ifndef PY_SSIZE_T_CLEAN
4 #define PY_SSIZE_T_CLEAN
8 #error Python headers needed to compile C extensions, please install development version of Python.
9 #elif PY_VERSION_HEX < 0x02060000 || (0x03000000 <= PY_VERSION_HEX && PY_VERSION_HEX < 0x03030000)
10 #error Cython requires Python 2.6+ or Python 3.3+.
12 #define CYTHON_ABI "0_29_30"
13 #define CYTHON_HEX_VERSION 0x001D1EF0
14 #define CYTHON_FUTURE_DIVISION 0
17 #define offsetof(type, member) ( (size_t) & ((type*)0) -> member )
19 #if !defined(WIN32) && !defined(MS_WINDOWS)
31 #define DL_IMPORT(t) t
34 #define DL_EXPORT(t) t
37 #ifndef HAVE_LONG_LONG
38 #if PY_VERSION_HEX >= 0x02070000
39 #define HAVE_LONG_LONG
43 #define PY_LONG_LONG LONG_LONG
46 #define Py_HUGE_VAL HUGE_VAL
49 #define CYTHON_COMPILING_IN_PYPY 1
50 #define CYTHON_COMPILING_IN_PYSTON 0
51 #define CYTHON_COMPILING_IN_CPYTHON 0
52 #undef CYTHON_USE_TYPE_SLOTS
53 #define CYTHON_USE_TYPE_SLOTS 0
54 #undef CYTHON_USE_PYTYPE_LOOKUP
55 #define CYTHON_USE_PYTYPE_LOOKUP 0
56 #if PY_VERSION_HEX < 0x03050000
57 #undef CYTHON_USE_ASYNC_SLOTS
58 #define CYTHON_USE_ASYNC_SLOTS 0
59 #elif !defined(CYTHON_USE_ASYNC_SLOTS)
60 #define CYTHON_USE_ASYNC_SLOTS 1
62 #undef CYTHON_USE_PYLIST_INTERNALS
63 #define CYTHON_USE_PYLIST_INTERNALS 0
64 #undef CYTHON_USE_UNICODE_INTERNALS
65 #define CYTHON_USE_UNICODE_INTERNALS 0
66 #undef CYTHON_USE_UNICODE_WRITER
67 #define CYTHON_USE_UNICODE_WRITER 0
68 #undef CYTHON_USE_PYLONG_INTERNALS
69 #define CYTHON_USE_PYLONG_INTERNALS 0
70 #undef CYTHON_AVOID_BORROWED_REFS
71 #define CYTHON_AVOID_BORROWED_REFS 1
72 #undef CYTHON_ASSUME_SAFE_MACROS
73 #define CYTHON_ASSUME_SAFE_MACROS 0
74 #undef CYTHON_UNPACK_METHODS
75 #define CYTHON_UNPACK_METHODS 0
76 #undef CYTHON_FAST_THREAD_STATE
77 #define CYTHON_FAST_THREAD_STATE 0
78 #undef CYTHON_FAST_PYCALL
79 #define CYTHON_FAST_PYCALL 0
80 #undef CYTHON_PEP489_MULTI_PHASE_INIT
81 #define CYTHON_PEP489_MULTI_PHASE_INIT 0
82 #undef CYTHON_USE_TP_FINALIZE
83 #define CYTHON_USE_TP_FINALIZE 0
84 #undef CYTHON_USE_DICT_VERSIONS
85 #define CYTHON_USE_DICT_VERSIONS 0
86 #undef CYTHON_USE_EXC_INFO_STACK
87 #define CYTHON_USE_EXC_INFO_STACK 0
88 #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC
89 #define CYTHON_UPDATE_DESCRIPTOR_DOC (PYPY_VERSION_HEX >= 0x07030900)
91 #elif defined(PYSTON_VERSION)
92 #define CYTHON_COMPILING_IN_PYPY 0
93 #define CYTHON_COMPILING_IN_PYSTON 1
94 #define CYTHON_COMPILING_IN_CPYTHON 0
95 #ifndef CYTHON_USE_TYPE_SLOTS
96 #define CYTHON_USE_TYPE_SLOTS 1
98 #undef CYTHON_USE_PYTYPE_LOOKUP
99 #define CYTHON_USE_PYTYPE_LOOKUP 0
100 #undef CYTHON_USE_ASYNC_SLOTS
101 #define CYTHON_USE_ASYNC_SLOTS 0
102 #undef CYTHON_USE_PYLIST_INTERNALS
103 #define CYTHON_USE_PYLIST_INTERNALS 0
104 #ifndef CYTHON_USE_UNICODE_INTERNALS
105 #define CYTHON_USE_UNICODE_INTERNALS 1
107 #undef CYTHON_USE_UNICODE_WRITER
108 #define CYTHON_USE_UNICODE_WRITER 0
109 #undef CYTHON_USE_PYLONG_INTERNALS
110 #define CYTHON_USE_PYLONG_INTERNALS 0
111 #ifndef CYTHON_AVOID_BORROWED_REFS
112 #define CYTHON_AVOID_BORROWED_REFS 0
114 #ifndef CYTHON_ASSUME_SAFE_MACROS
115 #define CYTHON_ASSUME_SAFE_MACROS 1
117 #ifndef CYTHON_UNPACK_METHODS
118 #define CYTHON_UNPACK_METHODS 1
120 #undef CYTHON_FAST_THREAD_STATE
121 #define CYTHON_FAST_THREAD_STATE 0
122 #undef CYTHON_FAST_PYCALL
123 #define CYTHON_FAST_PYCALL 0
124 #undef CYTHON_PEP489_MULTI_PHASE_INIT
125 #define CYTHON_PEP489_MULTI_PHASE_INIT 0
126 #undef CYTHON_USE_TP_FINALIZE
127 #define CYTHON_USE_TP_FINALIZE 0
128 #undef CYTHON_USE_DICT_VERSIONS
129 #define CYTHON_USE_DICT_VERSIONS 0
130 #undef CYTHON_USE_EXC_INFO_STACK
131 #define CYTHON_USE_EXC_INFO_STACK 0
132 #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC
133 #define CYTHON_UPDATE_DESCRIPTOR_DOC 0
136 #define CYTHON_COMPILING_IN_PYPY 0
137 #define CYTHON_COMPILING_IN_PYSTON 0
138 #define CYTHON_COMPILING_IN_CPYTHON 1
139 #ifndef CYTHON_USE_TYPE_SLOTS
140 #define CYTHON_USE_TYPE_SLOTS 1
142 #if PY_VERSION_HEX < 0x02070000
143 #undef CYTHON_USE_PYTYPE_LOOKUP
144 #define CYTHON_USE_PYTYPE_LOOKUP 0
145 #elif !defined(CYTHON_USE_PYTYPE_LOOKUP)
146 #define CYTHON_USE_PYTYPE_LOOKUP 1
148 #if PY_MAJOR_VERSION < 3
149 #undef CYTHON_USE_ASYNC_SLOTS
150 #define CYTHON_USE_ASYNC_SLOTS 0
151 #elif !defined(CYTHON_USE_ASYNC_SLOTS)
152 #define CYTHON_USE_ASYNC_SLOTS 1
154 #if PY_VERSION_HEX < 0x02070000
155 #undef CYTHON_USE_PYLONG_INTERNALS
156 #define CYTHON_USE_PYLONG_INTERNALS 0
157 #elif !defined(CYTHON_USE_PYLONG_INTERNALS)
158 #define CYTHON_USE_PYLONG_INTERNALS 1
160 #ifndef CYTHON_USE_PYLIST_INTERNALS
161 #define CYTHON_USE_PYLIST_INTERNALS 1
163 #ifndef CYTHON_USE_UNICODE_INTERNALS
164 #define CYTHON_USE_UNICODE_INTERNALS 1
166 #if PY_VERSION_HEX < 0x030300F0 || PY_VERSION_HEX >= 0x030B00A2
167 #undef CYTHON_USE_UNICODE_WRITER
168 #define CYTHON_USE_UNICODE_WRITER 0
169 #elif !defined(CYTHON_USE_UNICODE_WRITER)
170 #define CYTHON_USE_UNICODE_WRITER 1
172 #ifndef CYTHON_AVOID_BORROWED_REFS
173 #define CYTHON_AVOID_BORROWED_REFS 0
175 #ifndef CYTHON_ASSUME_SAFE_MACROS
176 #define CYTHON_ASSUME_SAFE_MACROS 1
178 #ifndef CYTHON_UNPACK_METHODS
179 #define CYTHON_UNPACK_METHODS 1
181 #if PY_VERSION_HEX >= 0x030B00A4
182 #undef CYTHON_FAST_THREAD_STATE
183 #define CYTHON_FAST_THREAD_STATE 0
184 #elif !defined(CYTHON_FAST_THREAD_STATE)
185 #define CYTHON_FAST_THREAD_STATE 1
187 #ifndef CYTHON_FAST_PYCALL
188 #define CYTHON_FAST_PYCALL (PY_VERSION_HEX < 0x030A0000)
190 #ifndef CYTHON_PEP489_MULTI_PHASE_INIT
191 #define CYTHON_PEP489_MULTI_PHASE_INIT (PY_VERSION_HEX >= 0x03050000)
193 #ifndef CYTHON_USE_TP_FINALIZE
194 #define CYTHON_USE_TP_FINALIZE (PY_VERSION_HEX >= 0x030400a1)
196 #ifndef CYTHON_USE_DICT_VERSIONS
197 #define CYTHON_USE_DICT_VERSIONS (PY_VERSION_HEX >= 0x030600B1)
199 #if PY_VERSION_HEX >= 0x030B00A4
200 #undef CYTHON_USE_EXC_INFO_STACK
201 #define CYTHON_USE_EXC_INFO_STACK 0
202 #elif !defined(CYTHON_USE_EXC_INFO_STACK)
203 #define CYTHON_USE_EXC_INFO_STACK (PY_VERSION_HEX >= 0x030700A3)
205 #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC
206 #define CYTHON_UPDATE_DESCRIPTOR_DOC 1
209 #if !defined(CYTHON_FAST_PYCCALL)
210 #define CYTHON_FAST_PYCCALL (CYTHON_FAST_PYCALL && PY_VERSION_HEX >= 0x030600B1)
212 #if CYTHON_USE_PYLONG_INTERNALS
213 #if PY_MAJOR_VERSION < 3
214 #include "longintrepr.h"
220 enum { __pyx_check_sizeof_voidp = 1 / (int)(SIZEOF_VOID_P ==
sizeof(
void*)) };
223 #ifndef __has_attribute
224 #define __has_attribute(x) 0
226 #ifndef __has_cpp_attribute
227 #define __has_cpp_attribute(x) 0
229 #ifndef CYTHON_RESTRICT
230 #if defined(__GNUC__)
231 #define CYTHON_RESTRICT __restrict__
232 #elif defined(_MSC_VER) && _MSC_VER >= 1400
233 #define CYTHON_RESTRICT __restrict
234 #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
235 #define CYTHON_RESTRICT restrict
237 #define CYTHON_RESTRICT
240 #ifndef CYTHON_UNUSED
241 # if defined(__GNUC__)
242 # if !(defined(__cplusplus)) || (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4))
243 # define CYTHON_UNUSED __attribute__ ((__unused__))
245 # define CYTHON_UNUSED
247 # elif defined(__ICC) || (defined(__INTEL_COMPILER) && !defined(_MSC_VER))
248 # define CYTHON_UNUSED __attribute__ ((__unused__))
250 # define CYTHON_UNUSED
253 #ifndef CYTHON_MAYBE_UNUSED_VAR
254 # if defined(__cplusplus)
255 template<
class T>
void CYTHON_MAYBE_UNUSED_VAR(
const T& ) { }
257 # define CYTHON_MAYBE_UNUSED_VAR(x) (void)(x)
260 #ifndef CYTHON_NCP_UNUSED
261 # if CYTHON_COMPILING_IN_CPYTHON
262 # define CYTHON_NCP_UNUSED
264 # define CYTHON_NCP_UNUSED CYTHON_UNUSED
267 #define __Pyx_void_to_None(void_result) ((void)(void_result), Py_INCREF(Py_None), Py_None)
269 #ifndef _MSC_STDINT_H_
271 typedef unsigned char uint8_t;
272 typedef unsigned int uint32_t;
274 typedef unsigned __int8 uint8_t;
275 typedef unsigned __int32 uint32_t;
281 #ifndef CYTHON_FALLTHROUGH
282 #if defined(__cplusplus) && __cplusplus >= 201103L
283 #if __has_cpp_attribute(fallthrough)
284 #define CYTHON_FALLTHROUGH [[fallthrough]]
285 #elif __has_cpp_attribute(clang::fallthrough)
286 #define CYTHON_FALLTHROUGH [[clang::fallthrough]]
287 #elif __has_cpp_attribute(gnu::fallthrough)
288 #define CYTHON_FALLTHROUGH [[gnu::fallthrough]]
291 #ifndef CYTHON_FALLTHROUGH
292 #if __has_attribute(fallthrough)
293 #define CYTHON_FALLTHROUGH __attribute__((fallthrough))
295 #define CYTHON_FALLTHROUGH
298 #if defined(__clang__ ) && defined(__apple_build_version__)
299 #if __apple_build_version__ < 7000000
300 #undef CYTHON_FALLTHROUGH
301 #define CYTHON_FALLTHROUGH
306 #ifndef CYTHON_INLINE
307 #if defined(__clang__)
308 #define CYTHON_INLINE __inline__ __attribute__ ((__unused__))
309 #elif defined(__GNUC__)
310 #define CYTHON_INLINE __inline__
311 #elif defined(_MSC_VER)
312 #define CYTHON_INLINE __inline
313 #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
314 #define CYTHON_INLINE inline
316 #define CYTHON_INLINE
320 #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x02070600 && !defined(Py_OptimizeFlag)
321 #define Py_OptimizeFlag 0
323 #define __PYX_BUILD_PY_SSIZE_T "n"
324 #define CYTHON_FORMAT_SSIZE_T "z"
325 #if PY_MAJOR_VERSION < 3
326 #define __Pyx_BUILTIN_MODULE_NAME "__builtin__"
327 #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\
328 PyCode_New(a+k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)
329 #define __Pyx_DefaultClassType PyClass_Type
331 #define __Pyx_BUILTIN_MODULE_NAME "builtins"
332 #define __Pyx_DefaultClassType PyType_Type
333 #if PY_VERSION_HEX >= 0x030B00A1
334 static CYTHON_INLINE PyCodeObject* __Pyx_PyCode_New(
int a,
int k,
int l,
int s,
int f,
335 PyObject *code, PyObject *
c, PyObject*
n, PyObject *
v,
336 PyObject *fv, PyObject *cell, PyObject* fn,
337 PyObject *name,
int fline, PyObject *lnos) {
338 PyObject *kwds=NULL, *argcount=NULL, *posonlyargcount=NULL, *kwonlyargcount=NULL;
339 PyObject *nlocals=NULL, *stacksize=NULL, *flags=NULL, *replace=NULL, *call_result=NULL, *empty=NULL;
340 const char *fn_cstr=NULL;
341 const char *name_cstr=NULL;
342 PyCodeObject* co=NULL;
343 PyObject *type, *value, *traceback;
344 PyErr_Fetch(&type, &value, &traceback);
345 if (!(kwds=PyDict_New()))
goto end;
346 if (!(argcount=PyLong_FromLong(a)))
goto end;
347 if (PyDict_SetItemString(kwds,
"co_argcount", argcount) != 0)
goto end;
348 if (!(posonlyargcount=PyLong_FromLong(0)))
goto end;
349 if (PyDict_SetItemString(kwds,
"co_posonlyargcount", posonlyargcount) != 0)
goto end;
350 if (!(kwonlyargcount=PyLong_FromLong(k)))
goto end;
351 if (PyDict_SetItemString(kwds,
"co_kwonlyargcount", kwonlyargcount) != 0)
goto end;
352 if (!(nlocals=PyLong_FromLong(l)))
goto end;
353 if (PyDict_SetItemString(kwds,
"co_nlocals", nlocals) != 0)
goto end;
354 if (!(stacksize=PyLong_FromLong(
s)))
goto end;
355 if (PyDict_SetItemString(kwds,
"co_stacksize", stacksize) != 0)
goto end;
356 if (!(flags=PyLong_FromLong(
f)))
goto end;
357 if (PyDict_SetItemString(kwds,
"co_flags", flags) != 0)
goto end;
358 if (PyDict_SetItemString(kwds,
"co_code", code) != 0)
goto end;
359 if (PyDict_SetItemString(kwds,
"co_consts",
c) != 0)
goto end;
360 if (PyDict_SetItemString(kwds,
"co_names",
n) != 0)
goto end;
361 if (PyDict_SetItemString(kwds,
"co_varnames",
v) != 0)
goto end;
362 if (PyDict_SetItemString(kwds,
"co_freevars", fv) != 0)
goto end;
363 if (PyDict_SetItemString(kwds,
"co_cellvars", cell) != 0)
goto end;
364 if (PyDict_SetItemString(kwds,
"co_linetable", lnos) != 0)
goto end;
365 if (!(fn_cstr=PyUnicode_AsUTF8AndSize(fn, NULL)))
goto end;
366 if (!(name_cstr=PyUnicode_AsUTF8AndSize(name, NULL)))
goto end;
367 if (!(co = PyCode_NewEmpty(fn_cstr, name_cstr, fline)))
goto end;
368 if (!(replace = PyObject_GetAttrString((PyObject*)co,
"replace")))
goto cleanup_code_too;
369 if (!(empty = PyTuple_New(0)))
goto cleanup_code_too;
370 if (!(call_result = PyObject_Call(replace, empty, kwds)))
goto cleanup_code_too;
371 Py_XDECREF((PyObject*)co);
372 co = (PyCodeObject*)call_result;
376 Py_XDECREF((PyObject*)co);
381 Py_XDECREF(argcount);
382 Py_XDECREF(posonlyargcount);
383 Py_XDECREF(kwonlyargcount);
385 Py_XDECREF(stacksize);
387 Py_XDECREF(call_result);
390 PyErr_Restore(type, value, traceback);
395 #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\
396 PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)
398 #define __Pyx_DefaultClassType PyType_Type
400 #ifndef Py_TPFLAGS_CHECKTYPES
401 #define Py_TPFLAGS_CHECKTYPES 0
403 #ifndef Py_TPFLAGS_HAVE_INDEX
404 #define Py_TPFLAGS_HAVE_INDEX 0
406 #ifndef Py_TPFLAGS_HAVE_NEWBUFFER
407 #define Py_TPFLAGS_HAVE_NEWBUFFER 0
409 #ifndef Py_TPFLAGS_HAVE_FINALIZE
410 #define Py_TPFLAGS_HAVE_FINALIZE 0
412 #ifndef METH_STACKLESS
413 #define METH_STACKLESS 0
415 #if PY_VERSION_HEX <= 0x030700A3 || !defined(METH_FASTCALL)
416 #ifndef METH_FASTCALL
417 #define METH_FASTCALL 0x80
419 typedef PyObject *(*__Pyx_PyCFunctionFast) (PyObject *
self, PyObject *
const *args, Py_ssize_t nargs);
420 typedef PyObject *(*__Pyx_PyCFunctionFastWithKeywords) (PyObject *
self, PyObject *
const *args,
421 Py_ssize_t nargs, PyObject *kwnames);
423 #define __Pyx_PyCFunctionFast _PyCFunctionFast
424 #define __Pyx_PyCFunctionFastWithKeywords _PyCFunctionFastWithKeywords
426 #if CYTHON_FAST_PYCCALL
427 #define __Pyx_PyFastCFunction_Check(func)\
428 ((PyCFunction_Check(func) && (METH_FASTCALL == (PyCFunction_GET_FLAGS(func) & ~(METH_CLASS | METH_STATIC | METH_COEXIST | METH_KEYWORDS | METH_STACKLESS)))))
430 #define __Pyx_PyFastCFunction_Check(func) 0
432 #if CYTHON_COMPILING_IN_PYPY && !defined(PyObject_Malloc)
433 #define PyObject_Malloc(s) PyMem_Malloc(s)
434 #define PyObject_Free(p) PyMem_Free(p)
435 #define PyObject_Realloc(p) PyMem_Realloc(p)
437 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030400A1
438 #define PyMem_RawMalloc(n) PyMem_Malloc(n)
439 #define PyMem_RawRealloc(p, n) PyMem_Realloc(p, n)
440 #define PyMem_RawFree(p) PyMem_Free(p)
442 #if CYTHON_COMPILING_IN_PYSTON
443 #define __Pyx_PyCode_HasFreeVars(co) PyCode_HasFreeVars(co)
444 #define __Pyx_PyFrame_SetLineNumber(frame, lineno) PyFrame_SetLineNumber(frame, lineno)
446 #define __Pyx_PyCode_HasFreeVars(co) (PyCode_GetNumFree(co) > 0)
447 #define __Pyx_PyFrame_SetLineNumber(frame, lineno) (frame)->f_lineno = (lineno)
449 #if !CYTHON_FAST_THREAD_STATE || PY_VERSION_HEX < 0x02070000
450 #define __Pyx_PyThreadState_Current PyThreadState_GET()
451 #elif PY_VERSION_HEX >= 0x03060000
452 #define __Pyx_PyThreadState_Current _PyThreadState_UncheckedGet()
453 #elif PY_VERSION_HEX >= 0x03000000
454 #define __Pyx_PyThreadState_Current PyThreadState_GET()
456 #define __Pyx_PyThreadState_Current _PyThreadState_Current
458 #if PY_VERSION_HEX < 0x030700A2 && !defined(PyThread_tss_create) && !defined(Py_tss_NEEDS_INIT)
459 #include "pythread.h"
460 #define Py_tss_NEEDS_INIT 0
461 typedef int Py_tss_t;
462 static CYTHON_INLINE
int PyThread_tss_create(Py_tss_t *key) {
463 *key = PyThread_create_key();
466 static CYTHON_INLINE Py_tss_t * PyThread_tss_alloc(
void) {
467 Py_tss_t *key = (Py_tss_t *)PyObject_Malloc(
sizeof(Py_tss_t));
468 *key = Py_tss_NEEDS_INIT;
471 static CYTHON_INLINE
void PyThread_tss_free(Py_tss_t *key) {
474 static CYTHON_INLINE
int PyThread_tss_is_created(Py_tss_t *key) {
475 return *key != Py_tss_NEEDS_INIT;
477 static CYTHON_INLINE
void PyThread_tss_delete(Py_tss_t *key) {
478 PyThread_delete_key(*key);
479 *key = Py_tss_NEEDS_INIT;
481 static CYTHON_INLINE
int PyThread_tss_set(Py_tss_t *key,
void *value) {
482 return PyThread_set_key_value(*key, value);
484 static CYTHON_INLINE
void * PyThread_tss_get(Py_tss_t *key) {
485 return PyThread_get_key_value(*key);
488 #if CYTHON_COMPILING_IN_CPYTHON || defined(_PyDict_NewPresized)
489 #define __Pyx_PyDict_NewPresized(n) ((n <= 8) ? PyDict_New() : _PyDict_NewPresized(n))
491 #define __Pyx_PyDict_NewPresized(n) PyDict_New()
493 #if PY_MAJOR_VERSION >= 3 || CYTHON_FUTURE_DIVISION
494 #define __Pyx_PyNumber_Divide(x,y) PyNumber_TrueDivide(x,y)
495 #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceTrueDivide(x,y)
497 #define __Pyx_PyNumber_Divide(x,y) PyNumber_Divide(x,y)
498 #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceDivide(x,y)
500 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030500A1 && CYTHON_USE_UNICODE_INTERNALS
501 #define __Pyx_PyDict_GetItemStr(dict, name) _PyDict_GetItem_KnownHash(dict, name, ((PyASCIIObject *) name)->hash)
503 #define __Pyx_PyDict_GetItemStr(dict, name) PyDict_GetItem(dict, name)
505 #if PY_VERSION_HEX > 0x03030000 && defined(PyUnicode_KIND)
506 #define CYTHON_PEP393_ENABLED 1
507 #if defined(PyUnicode_IS_READY)
508 #define __Pyx_PyUnicode_READY(op) (likely(PyUnicode_IS_READY(op)) ?\
509 0 : _PyUnicode_Ready((PyObject *)(op)))
511 #define __Pyx_PyUnicode_READY(op) (0)
513 #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_LENGTH(u)
514 #define __Pyx_PyUnicode_READ_CHAR(u, i) PyUnicode_READ_CHAR(u, i)
515 #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u) PyUnicode_MAX_CHAR_VALUE(u)
516 #define __Pyx_PyUnicode_KIND(u) PyUnicode_KIND(u)
517 #define __Pyx_PyUnicode_DATA(u) PyUnicode_DATA(u)
518 #define __Pyx_PyUnicode_READ(k, d, i) PyUnicode_READ(k, d, i)
519 #define __Pyx_PyUnicode_WRITE(k, d, i, ch) PyUnicode_WRITE(k, d, i, ch)
520 #if defined(PyUnicode_IS_READY) && defined(PyUnicode_GET_SIZE)
521 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x03090000
522 #define __Pyx_PyUnicode_IS_TRUE(u) (0 != (likely(PyUnicode_IS_READY(u)) ? PyUnicode_GET_LENGTH(u) : ((PyCompactUnicodeObject *)(u))->wstr_length))
524 #define __Pyx_PyUnicode_IS_TRUE(u) (0 != (likely(PyUnicode_IS_READY(u)) ? PyUnicode_GET_LENGTH(u) : PyUnicode_GET_SIZE(u)))
527 #define __Pyx_PyUnicode_IS_TRUE(u) (0 != PyUnicode_GET_LENGTH(u))
530 #define CYTHON_PEP393_ENABLED 0
531 #define PyUnicode_1BYTE_KIND 1
532 #define PyUnicode_2BYTE_KIND 2
533 #define PyUnicode_4BYTE_KIND 4
534 #define __Pyx_PyUnicode_READY(op) (0)
535 #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_SIZE(u)
536 #define __Pyx_PyUnicode_READ_CHAR(u, i) ((Py_UCS4)(PyUnicode_AS_UNICODE(u)[i]))
537 #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u) ((sizeof(Py_UNICODE) == 2) ? 65535 : 1114111)
538 #define __Pyx_PyUnicode_KIND(u) (sizeof(Py_UNICODE))
539 #define __Pyx_PyUnicode_DATA(u) ((void*)PyUnicode_AS_UNICODE(u))
540 #define __Pyx_PyUnicode_READ(k, d, i) ((void)(k), (Py_UCS4)(((Py_UNICODE*)d)[i]))
541 #define __Pyx_PyUnicode_WRITE(k, d, i, ch) (((void)(k)), ((Py_UNICODE*)d)[i] = ch)
542 #define __Pyx_PyUnicode_IS_TRUE(u) (0 != PyUnicode_GET_SIZE(u))
544 #if CYTHON_COMPILING_IN_PYPY
545 #define __Pyx_PyUnicode_Concat(a, b) PyNumber_Add(a, b)
546 #define __Pyx_PyUnicode_ConcatSafe(a, b) PyNumber_Add(a, b)
548 #define __Pyx_PyUnicode_Concat(a, b) PyUnicode_Concat(a, b)
549 #define __Pyx_PyUnicode_ConcatSafe(a, b) ((unlikely((a) == Py_None) || unlikely((b) == Py_None)) ?\
550 PyNumber_Add(a, b) : __Pyx_PyUnicode_Concat(a, b))
552 #if CYTHON_COMPILING_IN_PYPY && !defined(PyUnicode_Contains)
553 #define PyUnicode_Contains(u, s) PySequence_Contains(u, s)
555 #if CYTHON_COMPILING_IN_PYPY && !defined(PyByteArray_Check)
556 #define PyByteArray_Check(obj) PyObject_TypeCheck(obj, &PyByteArray_Type)
558 #if CYTHON_COMPILING_IN_PYPY && !defined(PyObject_Format)
559 #define PyObject_Format(obj, fmt) PyObject_CallMethod(obj, "__format__", "O", fmt)
561 #define __Pyx_PyString_FormatSafe(a, b) ((unlikely((a) == Py_None || (PyString_Check(b) && !PyString_CheckExact(b)))) ? PyNumber_Remainder(a, b) : __Pyx_PyString_Format(a, b))
562 #define __Pyx_PyUnicode_FormatSafe(a, b) ((unlikely((a) == Py_None || (PyUnicode_Check(b) && !PyUnicode_CheckExact(b)))) ? PyNumber_Remainder(a, b) : PyUnicode_Format(a, b))
563 #if PY_MAJOR_VERSION >= 3
564 #define __Pyx_PyString_Format(a, b) PyUnicode_Format(a, b)
566 #define __Pyx_PyString_Format(a, b) PyString_Format(a, b)
568 #if PY_MAJOR_VERSION < 3 && !defined(PyObject_ASCII)
569 #define PyObject_ASCII(o) PyObject_Repr(o)
571 #if PY_MAJOR_VERSION >= 3
572 #define PyBaseString_Type PyUnicode_Type
573 #define PyStringObject PyUnicodeObject
574 #define PyString_Type PyUnicode_Type
575 #define PyString_Check PyUnicode_Check
576 #define PyString_CheckExact PyUnicode_CheckExact
577 #ifndef PyObject_Unicode
578 #define PyObject_Unicode PyObject_Str
581 #if PY_MAJOR_VERSION >= 3
582 #define __Pyx_PyBaseString_Check(obj) PyUnicode_Check(obj)
583 #define __Pyx_PyBaseString_CheckExact(obj) PyUnicode_CheckExact(obj)
585 #define __Pyx_PyBaseString_Check(obj) (PyString_Check(obj) || PyUnicode_Check(obj))
586 #define __Pyx_PyBaseString_CheckExact(obj) (PyString_CheckExact(obj) || PyUnicode_CheckExact(obj))
588 #ifndef PySet_CheckExact
589 #define PySet_CheckExact(obj) (Py_TYPE(obj) == &PySet_Type)
591 #if PY_VERSION_HEX >= 0x030900A4
592 #define __Pyx_SET_REFCNT(obj, refcnt) Py_SET_REFCNT(obj, refcnt)
593 #define __Pyx_SET_SIZE(obj, size) Py_SET_SIZE(obj, size)
595 #define __Pyx_SET_REFCNT(obj, refcnt) Py_REFCNT(obj) = (refcnt)
596 #define __Pyx_SET_SIZE(obj, size) Py_SIZE(obj) = (size)
598 #if CYTHON_ASSUME_SAFE_MACROS
599 #define __Pyx_PySequence_SIZE(seq) Py_SIZE(seq)
601 #define __Pyx_PySequence_SIZE(seq) PySequence_Size(seq)
603 #if PY_MAJOR_VERSION >= 3
604 #define PyIntObject PyLongObject
605 #define PyInt_Type PyLong_Type
606 #define PyInt_Check(op) PyLong_Check(op)
607 #define PyInt_CheckExact(op) PyLong_CheckExact(op)
608 #define PyInt_FromString PyLong_FromString
609 #define PyInt_FromUnicode PyLong_FromUnicode
610 #define PyInt_FromLong PyLong_FromLong
611 #define PyInt_FromSize_t PyLong_FromSize_t
612 #define PyInt_FromSsize_t PyLong_FromSsize_t
613 #define PyInt_AsLong PyLong_AsLong
614 #define PyInt_AS_LONG PyLong_AS_LONG
615 #define PyInt_AsSsize_t PyLong_AsSsize_t
616 #define PyInt_AsUnsignedLongMask PyLong_AsUnsignedLongMask
617 #define PyInt_AsUnsignedLongLongMask PyLong_AsUnsignedLongLongMask
618 #define PyNumber_Int PyNumber_Long
620 #if PY_MAJOR_VERSION >= 3
621 #define PyBoolObject PyLongObject
623 #if PY_MAJOR_VERSION >= 3 && CYTHON_COMPILING_IN_PYPY
624 #ifndef PyUnicode_InternFromString
625 #define PyUnicode_InternFromString(s) PyUnicode_FromString(s)
628 #if PY_VERSION_HEX < 0x030200A4
629 typedef long Py_hash_t;
630 #define __Pyx_PyInt_FromHash_t PyInt_FromLong
631 #define __Pyx_PyInt_AsHash_t __Pyx_PyIndex_AsHash_t
633 #define __Pyx_PyInt_FromHash_t PyInt_FromSsize_t
634 #define __Pyx_PyInt_AsHash_t __Pyx_PyIndex_AsSsize_t
636 #if PY_MAJOR_VERSION >= 3
637 #define __Pyx_PyMethod_New(func, self, klass) ((self) ? ((void)(klass), PyMethod_New(func, self)) : __Pyx_NewRef(func))
639 #define __Pyx_PyMethod_New(func, self, klass) PyMethod_New(func, self, klass)
641 #if CYTHON_USE_ASYNC_SLOTS
642 #if PY_VERSION_HEX >= 0x030500B1
643 #define __Pyx_PyAsyncMethodsStruct PyAsyncMethods
644 #define __Pyx_PyType_AsAsync(obj) (Py_TYPE(obj)->tp_as_async)
646 #define __Pyx_PyType_AsAsync(obj) ((__Pyx_PyAsyncMethodsStruct*) (Py_TYPE(obj)->tp_reserved))
649 #define __Pyx_PyType_AsAsync(obj) NULL
651 #ifndef __Pyx_PyAsyncMethodsStruct
656 } __Pyx_PyAsyncMethodsStruct;
659 #if defined(_WIN32) || defined(WIN32) || defined(MS_WINDOWS)
660 #if !defined(_USE_MATH_DEFINES)
661 #define _USE_MATH_DEFINES
666 #define __PYX_NAN() ((float) NAN)
668 static CYTHON_INLINE
float __PYX_NAN() {
670 memset(&value, 0xFF,
sizeof(value));
674 #if defined(__CYGWIN__) && defined(_LDBL_EQ_DBL)
675 #define __Pyx_truncl trunc
677 #define __Pyx_truncl truncl
680 #define __PYX_MARK_ERR_POS(f_index, lineno) \
681 { __pyx_filename = __pyx_f[f_index]; (void)__pyx_filename; __pyx_lineno = lineno; (void)__pyx_lineno; __pyx_clineno = __LINE__; (void)__pyx_clineno; }
682 #define __PYX_ERR(f_index, lineno, Ln_error) \
683 { __PYX_MARK_ERR_POS(f_index, lineno) goto Ln_error; }
685 #ifndef __PYX_EXTERN_C
687 #define __PYX_EXTERN_C extern "C"
689 #define __PYX_EXTERN_C extern
693 #define __PYX_HAVE__ctimeIntegration
694 #define __PYX_HAVE_API__ctimeIntegration
698 #include "numpy/arrayobject.h"
699 #include "numpy/ndarrayobject.h"
700 #include "numpy/ndarraytypes.h"
701 #include "numpy/arrayscalars.h"
702 #include "numpy/ufuncobject.h"
711 #if defined(PYREX_WITHOUT_ASSERTIONS) && !defined(CYTHON_WITHOUT_ASSERTIONS)
712 #define CYTHON_WITHOUT_ASSERTIONS
715 typedef struct {PyObject **p;
const char *
s;
const Py_ssize_t
n;
const char* encoding;
716 const char is_unicode;
const char is_str;
const char intern; } __Pyx_StringTabEntry;
718 #define __PYX_DEFAULT_STRING_ENCODING_IS_ASCII 0
719 #define __PYX_DEFAULT_STRING_ENCODING_IS_UTF8 0
720 #define __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT (PY_MAJOR_VERSION >= 3 && __PYX_DEFAULT_STRING_ENCODING_IS_UTF8)
721 #define __PYX_DEFAULT_STRING_ENCODING ""
722 #define __Pyx_PyObject_FromString __Pyx_PyBytes_FromString
723 #define __Pyx_PyObject_FromStringAndSize __Pyx_PyBytes_FromStringAndSize
724 #define __Pyx_uchar_cast(c) ((unsigned char)c)
725 #define __Pyx_long_cast(x) ((long)x)
726 #define __Pyx_fits_Py_ssize_t(v, type, is_signed) (\
727 (sizeof(type) < sizeof(Py_ssize_t)) ||\
728 (sizeof(type) > sizeof(Py_ssize_t) &&\
729 likely(v < (type)PY_SSIZE_T_MAX ||\
730 v == (type)PY_SSIZE_T_MAX) &&\
731 (!is_signed || likely(v > (type)PY_SSIZE_T_MIN ||\
732 v == (type)PY_SSIZE_T_MIN))) ||\
733 (sizeof(type) == sizeof(Py_ssize_t) &&\
734 (is_signed || likely(v < (type)PY_SSIZE_T_MAX ||\
735 v == (type)PY_SSIZE_T_MAX))) )
736 static CYTHON_INLINE
int __Pyx_is_valid_index(Py_ssize_t i, Py_ssize_t limit) {
737 return (
size_t) i < (size_t) limit;
739 #if defined (__cplusplus) && __cplusplus >= 201103L
741 #define __Pyx_sst_abs(value) std::abs(value)
742 #elif SIZEOF_INT >= SIZEOF_SIZE_T
743 #define __Pyx_sst_abs(value) abs(value)
744 #elif SIZEOF_LONG >= SIZEOF_SIZE_T
745 #define __Pyx_sst_abs(value) labs(value)
746 #elif defined (_MSC_VER)
747 #define __Pyx_sst_abs(value) ((Py_ssize_t)_abs64(value))
748 #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
749 #define __Pyx_sst_abs(value) llabs(value)
750 #elif defined (__GNUC__)
751 #define __Pyx_sst_abs(value) __builtin_llabs(value)
753 #define __Pyx_sst_abs(value) ((value<0) ? -value : value)
755 static CYTHON_INLINE
const char* __Pyx_PyObject_AsString(PyObject*);
756 static CYTHON_INLINE
const char* __Pyx_PyObject_AsStringAndSize(PyObject*, Py_ssize_t* length);
757 #define __Pyx_PyByteArray_FromString(s) PyByteArray_FromStringAndSize((const char*)s, strlen((const char*)s))
758 #define __Pyx_PyByteArray_FromStringAndSize(s, l) PyByteArray_FromStringAndSize((const char*)s, l)
759 #define __Pyx_PyBytes_FromString PyBytes_FromString
760 #define __Pyx_PyBytes_FromStringAndSize PyBytes_FromStringAndSize
761 static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(
const char*);
762 #if PY_MAJOR_VERSION < 3
763 #define __Pyx_PyStr_FromString __Pyx_PyBytes_FromString
764 #define __Pyx_PyStr_FromStringAndSize __Pyx_PyBytes_FromStringAndSize
766 #define __Pyx_PyStr_FromString __Pyx_PyUnicode_FromString
767 #define __Pyx_PyStr_FromStringAndSize __Pyx_PyUnicode_FromStringAndSize
769 #define __Pyx_PyBytes_AsWritableString(s) ((char*) PyBytes_AS_STRING(s))
770 #define __Pyx_PyBytes_AsWritableSString(s) ((signed char*) PyBytes_AS_STRING(s))
771 #define __Pyx_PyBytes_AsWritableUString(s) ((unsigned char*) PyBytes_AS_STRING(s))
772 #define __Pyx_PyBytes_AsString(s) ((const char*) PyBytes_AS_STRING(s))
773 #define __Pyx_PyBytes_AsSString(s) ((const signed char*) PyBytes_AS_STRING(s))
774 #define __Pyx_PyBytes_AsUString(s) ((const unsigned char*) PyBytes_AS_STRING(s))
775 #define __Pyx_PyObject_AsWritableString(s) ((char*) __Pyx_PyObject_AsString(s))
776 #define __Pyx_PyObject_AsWritableSString(s) ((signed char*) __Pyx_PyObject_AsString(s))
777 #define __Pyx_PyObject_AsWritableUString(s) ((unsigned char*) __Pyx_PyObject_AsString(s))
778 #define __Pyx_PyObject_AsSString(s) ((const signed char*) __Pyx_PyObject_AsString(s))
779 #define __Pyx_PyObject_AsUString(s) ((const unsigned char*) __Pyx_PyObject_AsString(s))
780 #define __Pyx_PyObject_FromCString(s) __Pyx_PyObject_FromString((const char*)s)
781 #define __Pyx_PyBytes_FromCString(s) __Pyx_PyBytes_FromString((const char*)s)
782 #define __Pyx_PyByteArray_FromCString(s) __Pyx_PyByteArray_FromString((const char*)s)
783 #define __Pyx_PyStr_FromCString(s) __Pyx_PyStr_FromString((const char*)s)
784 #define __Pyx_PyUnicode_FromCString(s) __Pyx_PyUnicode_FromString((const char*)s)
785 static CYTHON_INLINE
size_t __Pyx_Py_UNICODE_strlen(
const Py_UNICODE *
u) {
786 const Py_UNICODE *u_end =
u;
788 return (
size_t)(u_end -
u - 1);
790 #define __Pyx_PyUnicode_FromUnicode(u) PyUnicode_FromUnicode(u, __Pyx_Py_UNICODE_strlen(u))
791 #define __Pyx_PyUnicode_FromUnicodeAndLength PyUnicode_FromUnicode
792 #define __Pyx_PyUnicode_AsUnicode PyUnicode_AsUnicode
793 #define __Pyx_NewRef(obj) (Py_INCREF(obj), obj)
794 #define __Pyx_Owned_Py_None(b) __Pyx_NewRef(Py_None)
795 static CYTHON_INLINE PyObject * __Pyx_PyBool_FromLong(
long b);
796 static CYTHON_INLINE
int __Pyx_PyObject_IsTrue(PyObject*);
797 static CYTHON_INLINE
int __Pyx_PyObject_IsTrueAndDecref(PyObject*);
798 static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x);
799 #define __Pyx_PySequence_Tuple(obj)\
800 (likely(PyTuple_CheckExact(obj)) ? __Pyx_NewRef(obj) : PySequence_Tuple(obj))
801 static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject*);
802 static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(
size_t);
803 static CYTHON_INLINE Py_hash_t __Pyx_PyIndex_AsHash_t(PyObject*);
804 #if CYTHON_ASSUME_SAFE_MACROS
805 #define __pyx_PyFloat_AsDouble(x) (PyFloat_CheckExact(x) ? PyFloat_AS_DOUBLE(x) : PyFloat_AsDouble(x))
807 #define __pyx_PyFloat_AsDouble(x) PyFloat_AsDouble(x)
809 #define __pyx_PyFloat_AsFloat(x) ((float) __pyx_PyFloat_AsDouble(x))
810 #if PY_MAJOR_VERSION >= 3
811 #define __Pyx_PyNumber_Int(x) (PyLong_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Long(x))
813 #define __Pyx_PyNumber_Int(x) (PyInt_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Int(x))
815 #define __Pyx_PyNumber_Float(x) (PyFloat_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Float(x))
816 #if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
817 static int __Pyx_sys_getdefaultencoding_not_ascii;
818 static int __Pyx_init_sys_getdefaultencoding_params(
void) {
820 PyObject* default_encoding = NULL;
821 PyObject* ascii_chars_u = NULL;
822 PyObject* ascii_chars_b = NULL;
823 const char* default_encoding_c;
824 sys = PyImport_ImportModule(
"sys");
826 default_encoding = PyObject_CallMethod(sys, (
char*)
"getdefaultencoding", NULL);
828 if (!default_encoding)
goto bad;
829 default_encoding_c = PyBytes_AsString(default_encoding);
830 if (!default_encoding_c)
goto bad;
831 if (strcmp(default_encoding_c,
"ascii") == 0) {
832 __Pyx_sys_getdefaultencoding_not_ascii = 0;
834 char ascii_chars[128];
836 for (
c = 0;
c < 128;
c++) {
839 __Pyx_sys_getdefaultencoding_not_ascii = 1;
840 ascii_chars_u = PyUnicode_DecodeASCII(ascii_chars, 128, NULL);
841 if (!ascii_chars_u)
goto bad;
842 ascii_chars_b = PyUnicode_AsEncodedString(ascii_chars_u, default_encoding_c, NULL);
843 if (!ascii_chars_b || !PyBytes_Check(ascii_chars_b) || memcmp(ascii_chars, PyBytes_AS_STRING(ascii_chars_b), 128) != 0) {
846 "This module compiled with c_string_encoding=ascii, but default encoding '%.200s' is not a superset of ascii.",
850 Py_DECREF(ascii_chars_u);
851 Py_DECREF(ascii_chars_b);
853 Py_DECREF(default_encoding);
856 Py_XDECREF(default_encoding);
857 Py_XDECREF(ascii_chars_u);
858 Py_XDECREF(ascii_chars_b);
862 #if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT && PY_MAJOR_VERSION >= 3
863 #define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_DecodeUTF8(c_str, size, NULL)
865 #define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_Decode(c_str, size, __PYX_DEFAULT_STRING_ENCODING, NULL)
866 #if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT
867 static char* __PYX_DEFAULT_STRING_ENCODING;
868 static int __Pyx_init_sys_getdefaultencoding_params(
void) {
870 PyObject* default_encoding = NULL;
871 char* default_encoding_c;
872 sys = PyImport_ImportModule(
"sys");
874 default_encoding = PyObject_CallMethod(sys, (
char*) (
const char*)
"getdefaultencoding", NULL);
876 if (!default_encoding)
goto bad;
877 default_encoding_c = PyBytes_AsString(default_encoding);
878 if (!default_encoding_c)
goto bad;
879 __PYX_DEFAULT_STRING_ENCODING = (
char*) malloc(strlen(default_encoding_c) + 1);
880 if (!__PYX_DEFAULT_STRING_ENCODING)
goto bad;
881 strcpy(__PYX_DEFAULT_STRING_ENCODING, default_encoding_c);
882 Py_DECREF(default_encoding);
885 Py_XDECREF(default_encoding);
893 #if defined(__GNUC__) && (__GNUC__ > 2 || (__GNUC__ == 2 && (__GNUC_MINOR__ > 95)))
894 #define likely(x) __builtin_expect(!!(x), 1)
895 #define unlikely(x) __builtin_expect(!!(x), 0)
897 #define likely(x) (x)
898 #define unlikely(x) (x)
900 static CYTHON_INLINE
void __Pyx_pretend_to_initialize(
void* ptr) { (void)ptr; }
902 static PyObject *__pyx_m = NULL;
903 static PyObject *__pyx_d;
904 static PyObject *__pyx_b;
905 static PyObject *__pyx_cython_runtime = NULL;
906 static PyObject *__pyx_empty_tuple;
907 static PyObject *__pyx_empty_bytes;
908 static PyObject *__pyx_empty_unicode;
909 static int __pyx_lineno;
910 static int __pyx_clineno = 0;
911 static const char * __pyx_cfilenm= __FILE__;
912 static const char *__pyx_filename;
915 #if !defined(CYTHON_CCOMPLEX)
916 #if defined(__cplusplus)
917 #define CYTHON_CCOMPLEX 1
918 #elif defined(_Complex_I)
919 #define CYTHON_CCOMPLEX 1
921 #define CYTHON_CCOMPLEX 0
931 #if CYTHON_CCOMPLEX && !defined(__cplusplus) && defined(__sun__) && defined(__GNUC__)
933 #define _Complex_I 1.0fj
937 static const char *__pyx_f[] = {
938 "proteus/ctimeIntegration.pyx",
950 typedef npy_int8 __pyx_t_5numpy_int8_t;
959 typedef npy_int16 __pyx_t_5numpy_int16_t;
968 typedef npy_int32 __pyx_t_5numpy_int32_t;
977 typedef npy_int64 __pyx_t_5numpy_int64_t;
986 typedef npy_uint8 __pyx_t_5numpy_uint8_t;
995 typedef npy_uint16 __pyx_t_5numpy_uint16_t;
1004 typedef npy_uint32 __pyx_t_5numpy_uint32_t;
1013 typedef npy_uint64 __pyx_t_5numpy_uint64_t;
1022 typedef npy_float32 __pyx_t_5numpy_float32_t;
1031 typedef npy_float64 __pyx_t_5numpy_float64_t;
1040 typedef npy_long __pyx_t_5numpy_int_t;
1049 typedef npy_longlong __pyx_t_5numpy_long_t;
1058 typedef npy_longlong __pyx_t_5numpy_longlong_t;
1067 typedef npy_ulong __pyx_t_5numpy_uint_t;
1076 typedef npy_ulonglong __pyx_t_5numpy_ulong_t;
1085 typedef npy_ulonglong __pyx_t_5numpy_ulonglong_t;
1094 typedef npy_intp __pyx_t_5numpy_intp_t;
1103 typedef npy_uintp __pyx_t_5numpy_uintp_t;
1112 typedef npy_double __pyx_t_5numpy_float_t;
1121 typedef npy_double __pyx_t_5numpy_double_t;
1130 typedef npy_longdouble __pyx_t_5numpy_longdouble_t;
1134 typedef ::std::complex< float > __pyx_t_float_complex;
1136 typedef float _Complex __pyx_t_float_complex;
1139 typedef struct {
float real, imag; } __pyx_t_float_complex;
1141 static CYTHON_INLINE __pyx_t_float_complex __pyx_t_float_complex_from_parts(
float,
float);
1146 typedef ::std::complex< double > __pyx_t_double_complex;
1148 typedef double _Complex __pyx_t_double_complex;
1151 typedef struct {
double real, imag; } __pyx_t_double_complex;
1153 static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(
double,
double);
1165 typedef npy_cfloat __pyx_t_5numpy_cfloat_t;
1174 typedef npy_cdouble __pyx_t_5numpy_cdouble_t;
1183 typedef npy_clongdouble __pyx_t_5numpy_clongdouble_t;
1192 typedef npy_cdouble __pyx_t_5numpy_complex_t;
1196 #ifndef CYTHON_REFNANNY
1197 #define CYTHON_REFNANNY 0
1201 void (*INCREF)(
void*, PyObject*, int);
1202 void (*DECREF)(
void*, PyObject*, int);
1203 void (*GOTREF)(
void*, PyObject*, int);
1204 void (*GIVEREF)(
void*, PyObject*, int);
1205 void* (*SetupContext)(
const char*, int,
const char*);
1206 void (*FinishContext)(
void**);
1207 } __Pyx_RefNannyAPIStruct;
1208 static __Pyx_RefNannyAPIStruct *__Pyx_RefNanny = NULL;
1209 static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(
const char *modname);
1210 #define __Pyx_RefNannyDeclarations void *__pyx_refnanny = NULL;
1212 #define __Pyx_RefNannySetupContext(name, acquire_gil)\
1214 PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();\
1215 __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__);\
1216 PyGILState_Release(__pyx_gilstate_save);\
1218 __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__);\
1221 #define __Pyx_RefNannySetupContext(name, acquire_gil)\
1222 __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__)
1224 #define __Pyx_RefNannyFinishContext()\
1225 __Pyx_RefNanny->FinishContext(&__pyx_refnanny)
1226 #define __Pyx_INCREF(r) __Pyx_RefNanny->INCREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
1227 #define __Pyx_DECREF(r) __Pyx_RefNanny->DECREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
1228 #define __Pyx_GOTREF(r) __Pyx_RefNanny->GOTREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
1229 #define __Pyx_GIVEREF(r) __Pyx_RefNanny->GIVEREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
1230 #define __Pyx_XINCREF(r) do { if((r) != NULL) {__Pyx_INCREF(r); }} while(0)
1231 #define __Pyx_XDECREF(r) do { if((r) != NULL) {__Pyx_DECREF(r); }} while(0)
1232 #define __Pyx_XGOTREF(r) do { if((r) != NULL) {__Pyx_GOTREF(r); }} while(0)
1233 #define __Pyx_XGIVEREF(r) do { if((r) != NULL) {__Pyx_GIVEREF(r);}} while(0)
1235 #define __Pyx_RefNannyDeclarations
1236 #define __Pyx_RefNannySetupContext(name, acquire_gil)
1237 #define __Pyx_RefNannyFinishContext()
1238 #define __Pyx_INCREF(r) Py_INCREF(r)
1239 #define __Pyx_DECREF(r) Py_DECREF(r)
1240 #define __Pyx_GOTREF(r)
1241 #define __Pyx_GIVEREF(r)
1242 #define __Pyx_XINCREF(r) Py_XINCREF(r)
1243 #define __Pyx_XDECREF(r) Py_XDECREF(r)
1244 #define __Pyx_XGOTREF(r)
1245 #define __Pyx_XGIVEREF(r)
1247 #define __Pyx_XDECREF_SET(r, v) do {\
1248 PyObject *tmp = (PyObject *) r;\
1249 r = v; __Pyx_XDECREF(tmp);\
1251 #define __Pyx_DECREF_SET(r, v) do {\
1252 PyObject *tmp = (PyObject *) r;\
1253 r = v; __Pyx_DECREF(tmp);\
1255 #define __Pyx_CLEAR(r) do { PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);} while(0)
1256 #define __Pyx_XCLEAR(r) do { if((r) != NULL) {PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);}} while(0)
1259 static void __Pyx_RaiseArgtupleInvalid(
const char* func_name,
int exact,
1260 Py_ssize_t num_min, Py_ssize_t num_max, Py_ssize_t num_found);
1263 static void __Pyx_RaiseDoubleKeywordsError(
const char* func_name, PyObject* kw_name);
1266 static int __Pyx_ParseOptionalKeywords(PyObject *kwds, PyObject **argnames[],\
1267 PyObject *kwds2, PyObject *values[], Py_ssize_t num_pos_args,\
1268 const char* function_name);
1271 #define __Pyx_ArgTypeTest(obj, type, none_allowed, name, exact)\
1272 ((likely((Py_TYPE(obj) == type) | (none_allowed && (obj == Py_None)))) ? 1 :\
1273 __Pyx__ArgTypeTest(obj, type, name, exact))
1274 static int __Pyx__ArgTypeTest(PyObject *obj, PyTypeObject *type,
const char *name,
int exact);
1277 #if CYTHON_USE_TYPE_SLOTS
1278 static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name);
1280 #define __Pyx_PyObject_GetAttrStr(o,n) PyObject_GetAttr(o,n)
1284 static PyObject *__Pyx_GetBuiltinName(PyObject *name);
1287 #if CYTHON_USE_EXC_INFO_STACK
1288 static _PyErr_StackItem * __Pyx_PyErr_GetTopmostException(PyThreadState *tstate);
1292 #if CYTHON_FAST_THREAD_STATE
1293 #define __Pyx_PyThreadState_declare PyThreadState *__pyx_tstate;
1294 #define __Pyx_PyThreadState_assign __pyx_tstate = __Pyx_PyThreadState_Current;
1295 #define __Pyx_PyErr_Occurred() __pyx_tstate->curexc_type
1297 #define __Pyx_PyThreadState_declare
1298 #define __Pyx_PyThreadState_assign
1299 #define __Pyx_PyErr_Occurred() PyErr_Occurred()
1303 #if CYTHON_FAST_THREAD_STATE
1304 #define __Pyx_ExceptionSave(type, value, tb) __Pyx__ExceptionSave(__pyx_tstate, type, value, tb)
1305 static CYTHON_INLINE
void __Pyx__ExceptionSave(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb);
1306 #define __Pyx_ExceptionReset(type, value, tb) __Pyx__ExceptionReset(__pyx_tstate, type, value, tb)
1307 static CYTHON_INLINE
void __Pyx__ExceptionReset(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb);
1309 #define __Pyx_ExceptionSave(type, value, tb) PyErr_GetExcInfo(type, value, tb)
1310 #define __Pyx_ExceptionReset(type, value, tb) PyErr_SetExcInfo(type, value, tb)
1314 #if CYTHON_FAST_THREAD_STATE
1315 #define __Pyx_PyErr_ExceptionMatches(err) __Pyx_PyErr_ExceptionMatchesInState(__pyx_tstate, err)
1316 static CYTHON_INLINE
int __Pyx_PyErr_ExceptionMatchesInState(PyThreadState* tstate, PyObject* err);
1318 #define __Pyx_PyErr_ExceptionMatches(err) PyErr_ExceptionMatches(err)
1322 #if CYTHON_FAST_THREAD_STATE
1323 #define __Pyx_GetException(type, value, tb) __Pyx__GetException(__pyx_tstate, type, value, tb)
1324 static int __Pyx__GetException(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb);
1326 static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb);
1330 #if CYTHON_COMPILING_IN_CPYTHON
1331 static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw);
1333 #define __Pyx_PyObject_Call(func, arg, kw) PyObject_Call(func, arg, kw)
1337 #if CYTHON_FAST_THREAD_STATE
1338 #define __Pyx_PyErr_Clear() __Pyx_ErrRestore(NULL, NULL, NULL)
1339 #define __Pyx_ErrRestoreWithState(type, value, tb) __Pyx_ErrRestoreInState(PyThreadState_GET(), type, value, tb)
1340 #define __Pyx_ErrFetchWithState(type, value, tb) __Pyx_ErrFetchInState(PyThreadState_GET(), type, value, tb)
1341 #define __Pyx_ErrRestore(type, value, tb) __Pyx_ErrRestoreInState(__pyx_tstate, type, value, tb)
1342 #define __Pyx_ErrFetch(type, value, tb) __Pyx_ErrFetchInState(__pyx_tstate, type, value, tb)
1343 static CYTHON_INLINE
void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb);
1344 static CYTHON_INLINE
void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb);
1345 #if CYTHON_COMPILING_IN_CPYTHON
1346 #define __Pyx_PyErr_SetNone(exc) (Py_INCREF(exc), __Pyx_ErrRestore((exc), NULL, NULL))
1348 #define __Pyx_PyErr_SetNone(exc) PyErr_SetNone(exc)
1351 #define __Pyx_PyErr_Clear() PyErr_Clear()
1352 #define __Pyx_PyErr_SetNone(exc) PyErr_SetNone(exc)
1353 #define __Pyx_ErrRestoreWithState(type, value, tb) PyErr_Restore(type, value, tb)
1354 #define __Pyx_ErrFetchWithState(type, value, tb) PyErr_Fetch(type, value, tb)
1355 #define __Pyx_ErrRestoreInState(tstate, type, value, tb) PyErr_Restore(type, value, tb)
1356 #define __Pyx_ErrFetchInState(tstate, type, value, tb) PyErr_Fetch(type, value, tb)
1357 #define __Pyx_ErrRestore(type, value, tb) PyErr_Restore(type, value, tb)
1358 #define __Pyx_ErrFetch(type, value, tb) PyErr_Fetch(type, value, tb)
1362 static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause);
1365 #ifndef __PYX_HAVE_RT_ImportType_proto
1366 #define __PYX_HAVE_RT_ImportType_proto
1367 enum __Pyx_ImportType_CheckSize {
1368 __Pyx_ImportType_CheckSize_Error = 0,
1369 __Pyx_ImportType_CheckSize_Warn = 1,
1370 __Pyx_ImportType_CheckSize_Ignore = 2
1372 static PyTypeObject *__Pyx_ImportType(PyObject* module,
const char *module_name,
const char *class_name,
size_t size,
enum __Pyx_ImportType_CheckSize check_size);
1376 static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list,
int level);
1379 #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_TYPE_SLOTS
1380 #define __PYX_DICT_VERSION_INIT ((PY_UINT64_T) -1)
1381 #define __PYX_GET_DICT_VERSION(dict) (((PyDictObject*)(dict))->ma_version_tag)
1382 #define __PYX_UPDATE_DICT_CACHE(dict, value, cache_var, version_var)\
1383 (version_var) = __PYX_GET_DICT_VERSION(dict);\
1384 (cache_var) = (value);
1385 #define __PYX_PY_DICT_LOOKUP_IF_MODIFIED(VAR, DICT, LOOKUP) {\
1386 static PY_UINT64_T __pyx_dict_version = 0;\
1387 static PyObject *__pyx_dict_cached_value = NULL;\
1388 if (likely(__PYX_GET_DICT_VERSION(DICT) == __pyx_dict_version)) {\
1389 (VAR) = __pyx_dict_cached_value;\
1391 (VAR) = __pyx_dict_cached_value = (LOOKUP);\
1392 __pyx_dict_version = __PYX_GET_DICT_VERSION(DICT);\
1395 static CYTHON_INLINE PY_UINT64_T __Pyx_get_tp_dict_version(PyObject *obj);
1396 static CYTHON_INLINE PY_UINT64_T __Pyx_get_object_dict_version(PyObject *obj);
1397 static CYTHON_INLINE
int __Pyx_object_dict_version_matches(PyObject* obj, PY_UINT64_T tp_dict_version, PY_UINT64_T obj_dict_version);
1399 #define __PYX_GET_DICT_VERSION(dict) (0)
1400 #define __PYX_UPDATE_DICT_CACHE(dict, value, cache_var, version_var)
1401 #define __PYX_PY_DICT_LOOKUP_IF_MODIFIED(VAR, DICT, LOOKUP) (VAR) = (LOOKUP);
1405 #ifdef CYTHON_CLINE_IN_TRACEBACK
1406 #define __Pyx_CLineForTraceback(tstate, c_line) (((CYTHON_CLINE_IN_TRACEBACK)) ? c_line : 0)
1408 static int __Pyx_CLineForTraceback(PyThreadState *tstate,
int c_line);
1413 PyCodeObject* code_object;
1415 } __Pyx_CodeObjectCacheEntry;
1416 struct __Pyx_CodeObjectCache {
1419 __Pyx_CodeObjectCacheEntry* entries;
1421 static struct __Pyx_CodeObjectCache __pyx_code_cache = {0,0,NULL};
1422 static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries,
int count,
int code_line);
1423 static PyCodeObject *__pyx_find_code_object(
int code_line);
1424 static void __pyx_insert_code_object(
int code_line, PyCodeObject* code_object);
1427 static void __Pyx_AddTraceback(
const char *funcname,
int c_line,
1428 int py_line,
const char *filename);
1431 #if defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 6))
1432 #define __Pyx_HAS_GCC_DIAGNOSTIC
1438 #define __Pyx_CREAL(z) ((z).real())
1439 #define __Pyx_CIMAG(z) ((z).imag())
1441 #define __Pyx_CREAL(z) (__real__(z))
1442 #define __Pyx_CIMAG(z) (__imag__(z))
1445 #define __Pyx_CREAL(z) ((z).real)
1446 #define __Pyx_CIMAG(z) ((z).imag)
1448 #if defined(__cplusplus) && CYTHON_CCOMPLEX\
1449 && (defined(_WIN32) || defined(__clang__) || (defined(__GNUC__) && (__GNUC__ >= 5 || __GNUC__ == 4 && __GNUC_MINOR__ >= 4 )) || __cplusplus >= 201103)
1450 #define __Pyx_SET_CREAL(z,x) ((z).real(x))
1451 #define __Pyx_SET_CIMAG(z,y) ((z).imag(y))
1453 #define __Pyx_SET_CREAL(z,x) __Pyx_CREAL(z) = (x)
1454 #define __Pyx_SET_CIMAG(z,y) __Pyx_CIMAG(z) = (y)
1459 #define __Pyx_c_eq_float(a, b) ((a)==(b))
1460 #define __Pyx_c_sum_float(a, b) ((a)+(b))
1461 #define __Pyx_c_diff_float(a, b) ((a)-(b))
1462 #define __Pyx_c_prod_float(a, b) ((a)*(b))
1463 #define __Pyx_c_quot_float(a, b) ((a)/(b))
1464 #define __Pyx_c_neg_float(a) (-(a))
1466 #define __Pyx_c_is_zero_float(z) ((z)==(float)0)
1467 #define __Pyx_c_conj_float(z) (::std::conj(z))
1469 #define __Pyx_c_abs_float(z) (::std::abs(z))
1470 #define __Pyx_c_pow_float(a, b) (::std::pow(a, b))
1473 #define __Pyx_c_is_zero_float(z) ((z)==0)
1474 #define __Pyx_c_conj_float(z) (conjf(z))
1476 #define __Pyx_c_abs_float(z) (cabsf(z))
1477 #define __Pyx_c_pow_float(a, b) (cpowf(a, b))
1481 static CYTHON_INLINE
int __Pyx_c_eq_float(__pyx_t_float_complex, __pyx_t_float_complex);
1482 static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_sum_float(__pyx_t_float_complex, __pyx_t_float_complex);
1483 static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_diff_float(__pyx_t_float_complex, __pyx_t_float_complex);
1484 static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_prod_float(__pyx_t_float_complex, __pyx_t_float_complex);
1485 static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_quot_float(__pyx_t_float_complex, __pyx_t_float_complex);
1486 static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_neg_float(__pyx_t_float_complex);
1487 static CYTHON_INLINE
int __Pyx_c_is_zero_float(__pyx_t_float_complex);
1488 static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_conj_float(__pyx_t_float_complex);
1490 static CYTHON_INLINE
float __Pyx_c_abs_float(__pyx_t_float_complex);
1491 static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_pow_float(__pyx_t_float_complex, __pyx_t_float_complex);
1497 #define __Pyx_c_eq_double(a, b) ((a)==(b))
1498 #define __Pyx_c_sum_double(a, b) ((a)+(b))
1499 #define __Pyx_c_diff_double(a, b) ((a)-(b))
1500 #define __Pyx_c_prod_double(a, b) ((a)*(b))
1501 #define __Pyx_c_quot_double(a, b) ((a)/(b))
1502 #define __Pyx_c_neg_double(a) (-(a))
1504 #define __Pyx_c_is_zero_double(z) ((z)==(double)0)
1505 #define __Pyx_c_conj_double(z) (::std::conj(z))
1507 #define __Pyx_c_abs_double(z) (::std::abs(z))
1508 #define __Pyx_c_pow_double(a, b) (::std::pow(a, b))
1511 #define __Pyx_c_is_zero_double(z) ((z)==0)
1512 #define __Pyx_c_conj_double(z) (conj(z))
1514 #define __Pyx_c_abs_double(z) (cabs(z))
1515 #define __Pyx_c_pow_double(a, b) (cpow(a, b))
1519 static CYTHON_INLINE
int __Pyx_c_eq_double(__pyx_t_double_complex, __pyx_t_double_complex);
1520 static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_sum_double(__pyx_t_double_complex, __pyx_t_double_complex);
1521 static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_diff_double(__pyx_t_double_complex, __pyx_t_double_complex);
1522 static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_prod_double(__pyx_t_double_complex, __pyx_t_double_complex);
1523 static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_quot_double(__pyx_t_double_complex, __pyx_t_double_complex);
1524 static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_neg_double(__pyx_t_double_complex);
1525 static CYTHON_INLINE
int __Pyx_c_is_zero_double(__pyx_t_double_complex);
1526 static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_conj_double(__pyx_t_double_complex);
1528 static CYTHON_INLINE
double __Pyx_c_abs_double(__pyx_t_double_complex);
1529 static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_pow_double(__pyx_t_double_complex, __pyx_t_double_complex);
1534 static CYTHON_INLINE
int __Pyx_PyInt_As_int(PyObject *);
1537 static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(
long value);
1540 static CYTHON_INLINE
long __Pyx_PyInt_As_long(PyObject *);
1543 #if CYTHON_COMPILING_IN_CPYTHON
1544 #define __Pyx_TypeCheck(obj, type) __Pyx_IsSubtype(Py_TYPE(obj), (PyTypeObject *)type)
1545 static CYTHON_INLINE
int __Pyx_IsSubtype(PyTypeObject *a, PyTypeObject *b);
1546 static CYTHON_INLINE
int __Pyx_PyErr_GivenExceptionMatches(PyObject *err, PyObject *type);
1547 static CYTHON_INLINE
int __Pyx_PyErr_GivenExceptionMatches2(PyObject *err, PyObject *type1, PyObject *type2);
1549 #define __Pyx_TypeCheck(obj, type) PyObject_TypeCheck(obj, (PyTypeObject *)type)
1550 #define __Pyx_PyErr_GivenExceptionMatches(err, type) PyErr_GivenExceptionMatches(err, type)
1551 #define __Pyx_PyErr_GivenExceptionMatches2(err, type1, type2) (PyErr_GivenExceptionMatches(err, type1) || PyErr_GivenExceptionMatches(err, type2))
1553 #define __Pyx_PyException_Check(obj) __Pyx_TypeCheck(obj, PyExc_Exception)
1556 static int __Pyx_check_binary_version(
void);
1559 static int __Pyx_InitStrings(__Pyx_StringTabEntry *t);
1571 static PyTypeObject *__pyx_ptype_7cpython_4type_type = 0;
1584 static PyTypeObject *__pyx_ptype_5numpy_dtype = 0;
1585 static PyTypeObject *__pyx_ptype_5numpy_flatiter = 0;
1586 static PyTypeObject *__pyx_ptype_5numpy_broadcast = 0;
1587 static PyTypeObject *__pyx_ptype_5numpy_ndarray = 0;
1588 static PyTypeObject *__pyx_ptype_5numpy_generic = 0;
1589 static PyTypeObject *__pyx_ptype_5numpy_number = 0;
1590 static PyTypeObject *__pyx_ptype_5numpy_integer = 0;
1591 static PyTypeObject *__pyx_ptype_5numpy_signedinteger = 0;
1592 static PyTypeObject *__pyx_ptype_5numpy_unsignedinteger = 0;
1593 static PyTypeObject *__pyx_ptype_5numpy_inexact = 0;
1594 static PyTypeObject *__pyx_ptype_5numpy_floating = 0;
1595 static PyTypeObject *__pyx_ptype_5numpy_complexfloating = 0;
1596 static PyTypeObject *__pyx_ptype_5numpy_flexible = 0;
1597 static PyTypeObject *__pyx_ptype_5numpy_character = 0;
1598 static PyTypeObject *__pyx_ptype_5numpy_ufunc = 0;
1601 #define __Pyx_MODULE_NAME "ctimeIntegration"
1602 extern int __pyx_module_is_main_ctimeIntegration;
1603 int __pyx_module_is_main_ctimeIntegration = 0;
1606 static PyObject *__pyx_builtin_ImportError;
1607 static const char __pyx_k_np[] =
"np";
1608 static const char __pyx_k_nu[] =
"nu";
1609 static const char __pyx_k_yn[] =
"yn";
1610 static const char __pyx_k_Mh2[] =
"Mh2";
1611 static const char __pyx_k_Uin[] =
"Uin";
1612 static const char __pyx_k_dtn[] =
"dtn";
1613 static const char __pyx_k_l2g[] =
"l2g";
1614 static const char __pyx_k_tag[] =
"tag";
1615 static const char __pyx_k_tau[] =
"tau";
1616 static const char __pyx_k_ypn[] =
"ypn";
1617 static const char __pyx_k_Uout[] =
"Uout";
1618 static const char __pyx_k_main[] =
"__main__";
1619 static const char __pyx_k_name[] =
"__name__";
1620 static const char __pyx_k_test[] =
"__test__";
1621 static const char __pyx_k_dtnm1[] =
"dtnm1";
1622 static const char __pyx_k_dtnp1[] =
"dtnp1";
1623 static const char __pyx_k_numpy[] =
"numpy";
1624 static const char __pyx_k_ypnm1[] =
"ypnm1";
1625 static const char __pyx_k_alphas[] =
"alphas";
1626 static const char __pyx_k_import[] =
"__import__";
1627 static const char __pyx_k_nSpace[] =
"nSpace";
1628 static const char __pyx_k_grad_v0[] =
"grad_v0";
1629 static const char __pyx_k_nPoints[] =
"nPoints";
1630 static const char __pyx_k_nodeArray[] =
"nodeArray";
1631 static const char __pyx_k_vacuumTol[] =
"vacuumTol";
1632 static const char __pyx_k_psiTCtteDT[] =
"psiTCtteDT";
1633 static const char __pyx_k_ImportError[] =
"ImportError";
1634 static const char __pyx_k_killExtrema[] =
"killExtrema";
1635 static const char __pyx_k_limiterFlag[] =
"limiterFlag";
1636 static const char __pyx_k_nDOF_element[] =
"nDOF_element";
1637 static const char __pyx_k_alphaNeighbors[] =
"alphaNeighbors";
1638 static const char __pyx_k_nNodes_element[] =
"nNodes_element";
1639 static const char __pyx_k_elementAverages[] =
"elementAverages";
1640 static const char __pyx_k_ctimeIntegration[] =
"ctimeIntegration";
1641 static const char __pyx_k_nElements_global[] =
"nElements_global";
1642 static const char __pyx_k_elementNodesArray[] =
"elementNodesArray";
1643 static const char __pyx_k_enforcePositivity[] =
"enforcePositivity";
1644 static const char __pyx_k_cline_in_traceback[] =
"cline_in_traceback";
1645 static const char __pyx_k_elementNeighborsArray[] =
"elementNeighborsArray";
1646 static const char __pyx_k_allowMinWithUndershoot[] =
"allowMinWithUndershoot";
1647 static const char __pyx_k_elementBoundariesArray[] =
"elementBoundariesArray";
1648 static const char __pyx_k_elementBarycentersArray[] =
"elementBarycentersArray";
1649 static const char __pyx_k_nElementBoundaries_element[] =
"nElementBoundaries_element";
1650 static const char __pyx_k_applyDGlimitingP1Lagrange1d[] =
"applyDGlimitingP1Lagrange1d";
1651 static const char __pyx_k_proteus_ctimeIntegration_pyx[] =
"proteus/ctimeIntegration.pyx";
1652 static const char __pyx_k_elementNeighborShapeGradients[] =
"elementNeighborShapeGradients";
1653 static const char __pyx_k_elementBoundaryBarycentersArray[] =
"elementBoundaryBarycentersArray";
1654 static const char __pyx_k_numpy_core_multiarray_failed_to[] =
"numpy.core.multiarray failed to import";
1655 static const char __pyx_k_applyCockburnDGlimiterP1Lagrange[] =
"applyCockburnDGlimiterP1Lagrange2d";
1656 static const char __pyx_k_applyDGlimitingP1Lagrange1d_with[] =
"applyDGlimitingP1Lagrange1d_withVacuumTol";
1657 static const char __pyx_k_applyDurlofskyDGlimiterP1Lagrang[] =
"applyDurlofskyDGlimiterP1Lagrange2d";
1658 static const char __pyx_k_computeCockburnDGlimiterArrays2d[] =
"computeCockburnDGlimiterArrays2d";
1659 static const char __pyx_k_computeElementNeighborShapeGradi[] =
"computeElementNeighborShapeGradients";
1660 static const char __pyx_k_numpy_core_umath_failed_to_impor[] =
"numpy.core.umath failed to import";
1661 static const char __pyx_k_applyDurlofskyDGlimiterP1Lagrang_2[] =
"applyDurlofskyDGlimiterP1Lagrange3d";
1662 static const char __pyx_k_applyDurlofskyDGlimiterP1Lagrang_3[] =
"applyDurlofskyDGlimiterP1Lagrange2d_withVacuumTol";
1663 static PyObject *__pyx_n_s_ImportError;
1664 static PyObject *__pyx_n_s_Mh2;
1665 static PyObject *__pyx_n_s_Uin;
1666 static PyObject *__pyx_n_s_Uout;
1667 static PyObject *__pyx_n_s_allowMinWithUndershoot;
1668 static PyObject *__pyx_n_s_alphaNeighbors;
1669 static PyObject *__pyx_n_s_alphas;
1670 static PyObject *__pyx_n_s_applyCockburnDGlimiterP1Lagrange;
1671 static PyObject *__pyx_n_s_applyDGlimitingP1Lagrange1d;
1672 static PyObject *__pyx_n_s_applyDGlimitingP1Lagrange1d_with;
1673 static PyObject *__pyx_n_s_applyDurlofskyDGlimiterP1Lagrang;
1674 static PyObject *__pyx_n_s_applyDurlofskyDGlimiterP1Lagrang_2;
1675 static PyObject *__pyx_n_s_applyDurlofskyDGlimiterP1Lagrang_3;
1676 static PyObject *__pyx_n_s_cline_in_traceback;
1677 static PyObject *__pyx_n_s_computeCockburnDGlimiterArrays2d;
1678 static PyObject *__pyx_n_s_computeElementNeighborShapeGradi;
1679 static PyObject *__pyx_n_s_ctimeIntegration;
1680 static PyObject *__pyx_n_s_dtn;
1681 static PyObject *__pyx_n_s_dtnm1;
1682 static PyObject *__pyx_n_s_dtnp1;
1683 static PyObject *__pyx_n_s_elementAverages;
1684 static PyObject *__pyx_n_s_elementBarycentersArray;
1685 static PyObject *__pyx_n_s_elementBoundariesArray;
1686 static PyObject *__pyx_n_s_elementBoundaryBarycentersArray;
1687 static PyObject *__pyx_n_s_elementNeighborShapeGradients;
1688 static PyObject *__pyx_n_s_elementNeighborsArray;
1689 static PyObject *__pyx_n_s_elementNodesArray;
1690 static PyObject *__pyx_n_s_enforcePositivity;
1691 static PyObject *__pyx_n_s_grad_v0;
1692 static PyObject *__pyx_n_s_import;
1693 static PyObject *__pyx_n_s_killExtrema;
1694 static PyObject *__pyx_n_s_l2g;
1695 static PyObject *__pyx_n_s_limiterFlag;
1696 static PyObject *__pyx_n_s_main;
1697 static PyObject *__pyx_n_s_nDOF_element;
1698 static PyObject *__pyx_n_s_nElementBoundaries_element;
1699 static PyObject *__pyx_n_s_nElements_global;
1700 static PyObject *__pyx_n_s_nNodes_element;
1701 static PyObject *__pyx_n_s_nPoints;
1702 static PyObject *__pyx_n_s_nSpace;
1703 static PyObject *__pyx_n_s_name;
1704 static PyObject *__pyx_n_s_nodeArray;
1705 static PyObject *__pyx_n_s_np;
1706 static PyObject *__pyx_n_s_nu;
1707 static PyObject *__pyx_n_s_numpy;
1708 static PyObject *__pyx_kp_s_numpy_core_multiarray_failed_to;
1709 static PyObject *__pyx_kp_s_numpy_core_umath_failed_to_impor;
1710 static PyObject *__pyx_kp_s_proteus_ctimeIntegration_pyx;
1711 static PyObject *__pyx_n_s_psiTCtteDT;
1712 static PyObject *__pyx_n_s_tag;
1713 static PyObject *__pyx_n_s_tau;
1714 static PyObject *__pyx_n_s_test;
1715 static PyObject *__pyx_n_s_vacuumTol;
1716 static PyObject *__pyx_n_s_yn;
1717 static PyObject *__pyx_n_s_ypn;
1718 static PyObject *__pyx_n_s_ypnm1;
1719 static PyObject *__pyx_pf_16ctimeIntegration_psiTCtteDT(CYTHON_UNUSED PyObject *__pyx_self,
int __pyx_v_nPoints,
double __pyx_v_tau,
double __pyx_v_dtn,
double __pyx_v_dtnm1, PyArrayObject *__pyx_v_yn, PyArrayObject *__pyx_v_ypn, PyArrayObject *__pyx_v_ypnm1, PyArrayObject *__pyx_v_dtnp1);
1720 static PyObject *__pyx_pf_16ctimeIntegration_2applyDGlimitingP1Lagrange1d(CYTHON_UNUSED PyObject *__pyx_self,
int __pyx_v_limiterFlag,
int __pyx_v_nElements_global,
int __pyx_v_nNodes_element,
int __pyx_v_nElementBoundaries_element,
int __pyx_v_nDOF_element, PyArrayObject *__pyx_v_elementNodesArray, PyArrayObject *__pyx_v_elementNeighborsArray, PyArrayObject *__pyx_v_nodeArray, PyArrayObject *__pyx_v_elementBarycentersArray, PyArrayObject *__pyx_v_l2g, PyArrayObject *__pyx_v_tag, PyArrayObject *__pyx_v_Uin, PyArrayObject *__pyx_v_Uout);
1721 static PyObject *__pyx_pf_16ctimeIntegration_4applyDGlimitingP1Lagrange1d_withVacuumTol(CYTHON_UNUSED PyObject *__pyx_self,
int __pyx_v_enforcePositivity,
double __pyx_v_vacuumTol,
int __pyx_v_nElements_global,
int __pyx_v_nNodes_element,
int __pyx_v_nElementBoundaries_element,
int __pyx_v_nDOF_element, PyArrayObject *__pyx_v_elementNodesArray, PyArrayObject *__pyx_v_elementNeighborsArray, PyArrayObject *__pyx_v_nodeArray, PyArrayObject *__pyx_v_elementBarycentersArray, PyArrayObject *__pyx_v_l2g, PyArrayObject *__pyx_v_tag, PyArrayObject *__pyx_v_Uin, PyArrayObject *__pyx_v_Uout);
1722 static PyObject *__pyx_pf_16ctimeIntegration_6computeElementNeighborShapeGradients(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_elementBoundariesArray, PyArrayObject *__pyx_v_elementNeighborsArray, PyArrayObject *__pyx_v_elementBarycentersArray, PyArrayObject *__pyx_v_elementBoundaryBarycentersArray, PyArrayObject *__pyx_v_elementNeighborShapeGradients);
1723 static PyObject *__pyx_pf_16ctimeIntegration_8computeCockburnDGlimiterArrays2d(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_elementBoundariesArray, PyArrayObject *__pyx_v_elementNeighborsArray, PyArrayObject *__pyx_v_elementBarycentersArray, PyArrayObject *__pyx_v_elementBoundaryBarycentersArray, PyArrayObject *__pyx_v_elementNeighborShapeGradients, PyArrayObject *__pyx_v_alphas, PyArrayObject *__pyx_v_alphaNeighbors);
1724 static PyObject *__pyx_pf_16ctimeIntegration_10applyCockburnDGlimiterP1Lagrange2d(CYTHON_UNUSED PyObject *__pyx_self,
double __pyx_v_nu,
double __pyx_v_Mh2, PyArrayObject *__pyx_v_elementNeighborsArray, PyArrayObject *__pyx_v_l2g, PyArrayObject *__pyx_v_tag, PyArrayObject *__pyx_v_alphas, PyArrayObject *__pyx_v_alphaNeighbors, PyArrayObject *__pyx_v_Uin, PyArrayObject *__pyx_v_Uout);
1725 static PyObject *__pyx_pf_16ctimeIntegration_12applyDurlofskyDGlimiterP1Lagrange2d(CYTHON_UNUSED PyObject *__pyx_self,
int __pyx_v_killExtrema,
int __pyx_v_allowMinWithUndershoot,
int __pyx_v_nElements_global,
int __pyx_v_nElementBoundaries_element,
int __pyx_v_nNodes_element,
int __pyx_v_nSpace,
int __pyx_v_nDOF_element, PyArrayObject *__pyx_v_elementNeighborsArray, PyArrayObject *__pyx_v_elementBoundariesArray, PyArrayObject *__pyx_v_elementNodesArray, PyArrayObject *__pyx_v_nodeArray, PyArrayObject *__pyx_v_elementBarycentersArray, PyArrayObject *__pyx_v_elementBoundaryBarycentersArray, PyArrayObject *__pyx_v_elementNeighborShapeGradients, PyArrayObject *__pyx_v_l2g, PyArrayObject *__pyx_v_grad_v0, PyArrayObject *__pyx_v_elementAverages, PyArrayObject *__pyx_v_tag, PyArrayObject *__pyx_v_Uin, PyArrayObject *__pyx_v_Uout);
1726 static PyObject *__pyx_pf_16ctimeIntegration_14applyDurlofskyDGlimiterP1Lagrange3d(CYTHON_UNUSED PyObject *__pyx_self,
int __pyx_v_killExtrema,
int __pyx_v_allowMinWithUndershoot,
int __pyx_v_nElements_global,
int __pyx_v_nElementBoundaries_element,
int __pyx_v_nNodes_element,
int __pyx_v_nSpace,
int __pyx_v_nDOF_element, PyArrayObject *__pyx_v_elementNeighborsArray, PyArrayObject *__pyx_v_elementBoundariesArray, PyArrayObject *__pyx_v_elementNodesArray, PyArrayObject *__pyx_v_nodeArray, PyArrayObject *__pyx_v_elementBarycentersArray, PyArrayObject *__pyx_v_elementBoundaryBarycentersArray, PyArrayObject *__pyx_v_elementNeighborShapeGradients, PyArrayObject *__pyx_v_l2g, PyArrayObject *__pyx_v_grad_v0, PyArrayObject *__pyx_v_elementAverages, PyArrayObject *__pyx_v_tag, PyArrayObject *__pyx_v_Uin, PyArrayObject *__pyx_v_Uout);
1727 static PyObject *__pyx_pf_16ctimeIntegration_16applyDurlofskyDGlimiterP1Lagrange2d_withVacuumTol(CYTHON_UNUSED PyObject *__pyx_self,
int __pyx_v_killExtrema,
int __pyx_v_allowMinWithUndershoot,
int __pyx_v_enforcePositivity,
double __pyx_v_vacuumTol,
int __pyx_v_nElements_global,
int __pyx_v_nElementBoundaries_element,
int __pyx_v_nNodes_element,
int __pyx_v_nSpace,
int __pyx_v_nDOF_element, PyArrayObject *__pyx_v_elementNeighborsArray, PyArrayObject *__pyx_v_elementBoundariesArray, PyArrayObject *__pyx_v_elementNodesArray, PyArrayObject *__pyx_v_nodeArray, PyArrayObject *__pyx_v_elementBarycentersArray, PyArrayObject *__pyx_v_elementBoundaryBarycentersArray, PyArrayObject *__pyx_v_elementNeighborShapeGradients, PyArrayObject *__pyx_v_l2g, PyArrayObject *__pyx_v_grad_v0, PyArrayObject *__pyx_v_elementAverages, PyArrayObject *__pyx_v_tag, PyArrayObject *__pyx_v_Uin, PyArrayObject *__pyx_v_Uout);
1728 static PyObject *__pyx_tuple_;
1729 static PyObject *__pyx_tuple__2;
1730 static PyObject *__pyx_tuple__3;
1731 static PyObject *__pyx_tuple__5;
1732 static PyObject *__pyx_tuple__7;
1733 static PyObject *__pyx_tuple__9;
1734 static PyObject *__pyx_tuple__11;
1735 static PyObject *__pyx_tuple__13;
1736 static PyObject *__pyx_tuple__15;
1737 static PyObject *__pyx_tuple__17;
1738 static PyObject *__pyx_tuple__19;
1739 static PyObject *__pyx_codeobj__4;
1740 static PyObject *__pyx_codeobj__6;
1741 static PyObject *__pyx_codeobj__8;
1742 static PyObject *__pyx_codeobj__10;
1743 static PyObject *__pyx_codeobj__12;
1744 static PyObject *__pyx_codeobj__14;
1745 static PyObject *__pyx_codeobj__16;
1746 static PyObject *__pyx_codeobj__18;
1747 static PyObject *__pyx_codeobj__20;
1759 static PyObject *__pyx_pw_16ctimeIntegration_1psiTCtteDT(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
1760 static PyMethodDef __pyx_mdef_16ctimeIntegration_1psiTCtteDT = {
"psiTCtteDT", (PyCFunction)(
void*)(PyCFunctionWithKeywords)__pyx_pw_16ctimeIntegration_1psiTCtteDT, METH_VARARGS|METH_KEYWORDS, 0};
1761 static PyObject *__pyx_pw_16ctimeIntegration_1psiTCtteDT(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
1762 int __pyx_v_nPoints;
1765 double __pyx_v_dtnm1;
1766 PyArrayObject *__pyx_v_yn = 0;
1767 PyArrayObject *__pyx_v_ypn = 0;
1768 PyArrayObject *__pyx_v_ypnm1 = 0;
1769 PyArrayObject *__pyx_v_dtnp1 = 0;
1770 int __pyx_lineno = 0;
1771 const char *__pyx_filename = NULL;
1772 int __pyx_clineno = 0;
1773 PyObject *__pyx_r = 0;
1774 __Pyx_RefNannyDeclarations
1775 __Pyx_RefNannySetupContext(
"psiTCtteDT (wrapper)", 0);
1777 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_nPoints,&__pyx_n_s_tau,&__pyx_n_s_dtn,&__pyx_n_s_dtnm1,&__pyx_n_s_yn,&__pyx_n_s_ypn,&__pyx_n_s_ypnm1,&__pyx_n_s_dtnp1,0};
1778 PyObject* values[8] = {0,0,0,0,0,0,0,0};
1779 if (unlikely(__pyx_kwds)) {
1781 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
1783 case 8: values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
1785 case 7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
1787 case 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
1789 case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
1791 case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
1793 case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
1795 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
1797 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
1800 default:
goto __pyx_L5_argtuple_error;
1802 kw_args = PyDict_Size(__pyx_kwds);
1805 if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_nPoints)) != 0)) kw_args--;
1806 else goto __pyx_L5_argtuple_error;
1809 if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_tau)) != 0)) kw_args--;
1811 __Pyx_RaiseArgtupleInvalid(
"psiTCtteDT", 1, 8, 8, 1); __PYX_ERR(0, 143, __pyx_L3_error)
1815 if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_dtn)) != 0)) kw_args--;
1817 __Pyx_RaiseArgtupleInvalid(
"psiTCtteDT", 1, 8, 8, 2); __PYX_ERR(0, 143, __pyx_L3_error)
1821 if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_dtnm1)) != 0)) kw_args--;
1823 __Pyx_RaiseArgtupleInvalid(
"psiTCtteDT", 1, 8, 8, 3); __PYX_ERR(0, 143, __pyx_L3_error)
1827 if (likely((values[4] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_yn)) != 0)) kw_args--;
1829 __Pyx_RaiseArgtupleInvalid(
"psiTCtteDT", 1, 8, 8, 4); __PYX_ERR(0, 143, __pyx_L3_error)
1833 if (likely((values[5] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_ypn)) != 0)) kw_args--;
1835 __Pyx_RaiseArgtupleInvalid(
"psiTCtteDT", 1, 8, 8, 5); __PYX_ERR(0, 143, __pyx_L3_error)
1839 if (likely((values[6] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_ypnm1)) != 0)) kw_args--;
1841 __Pyx_RaiseArgtupleInvalid(
"psiTCtteDT", 1, 8, 8, 6); __PYX_ERR(0, 143, __pyx_L3_error)
1845 if (likely((values[7] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_dtnp1)) != 0)) kw_args--;
1847 __Pyx_RaiseArgtupleInvalid(
"psiTCtteDT", 1, 8, 8, 7); __PYX_ERR(0, 143, __pyx_L3_error)
1850 if (unlikely(kw_args > 0)) {
1851 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args,
"psiTCtteDT") < 0)) __PYX_ERR(0, 143, __pyx_L3_error)
1853 }
else if (PyTuple_GET_SIZE(__pyx_args) != 8) {
1854 goto __pyx_L5_argtuple_error;
1856 values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
1857 values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
1858 values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
1859 values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
1860 values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
1861 values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
1862 values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
1863 values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
1865 __pyx_v_nPoints = __Pyx_PyInt_As_int(values[0]);
if (unlikely((__pyx_v_nPoints == (
int)-1) && PyErr_Occurred())) __PYX_ERR(0, 143, __pyx_L3_error)
1866 __pyx_v_tau = __pyx_PyFloat_AsDouble(values[1]);
if (unlikely((__pyx_v_tau == (
double)-1) && PyErr_Occurred())) __PYX_ERR(0, 144, __pyx_L3_error)
1867 __pyx_v_dtn = __pyx_PyFloat_AsDouble(values[2]);
if (unlikely((__pyx_v_dtn == (
double)-1) && PyErr_Occurred())) __PYX_ERR(0, 145, __pyx_L3_error)
1868 __pyx_v_dtnm1 = __pyx_PyFloat_AsDouble(values[3]);
if (unlikely((__pyx_v_dtnm1 == (
double)-1) && PyErr_Occurred())) __PYX_ERR(0, 146, __pyx_L3_error)
1869 __pyx_v_yn = ((PyArrayObject *)values[4]);
1870 __pyx_v_ypn = ((PyArrayObject *)values[5]);
1871 __pyx_v_ypnm1 = ((PyArrayObject *)values[6]);
1872 __pyx_v_dtnp1 = ((PyArrayObject *)values[7]);
1874 goto __pyx_L4_argument_unpacking_done;
1875 __pyx_L5_argtuple_error:;
1876 __Pyx_RaiseArgtupleInvalid(
"psiTCtteDT", 1, 8, 8, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 143, __pyx_L3_error)
1878 __Pyx_AddTraceback(
"ctimeIntegration.psiTCtteDT", __pyx_clineno, __pyx_lineno, __pyx_filename);
1879 __Pyx_RefNannyFinishContext();
1881 __pyx_L4_argument_unpacking_done:;
1882 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_yn), __pyx_ptype_5numpy_ndarray, 1,
"yn", 0))) __PYX_ERR(0, 147, __pyx_L1_error)
1883 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_ypn), __pyx_ptype_5numpy_ndarray, 1,
"ypn", 0))) __PYX_ERR(0, 148, __pyx_L1_error)
1884 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_ypnm1), __pyx_ptype_5numpy_ndarray, 1,
"ypnm1", 0))) __PYX_ERR(0, 149, __pyx_L1_error)
1885 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_dtnp1), __pyx_ptype_5numpy_ndarray, 1,
"dtnp1", 0))) __PYX_ERR(0, 150, __pyx_L1_error)
1886 __pyx_r = __pyx_pf_16ctimeIntegration_psiTCtteDT(__pyx_self, __pyx_v_nPoints, __pyx_v_tau, __pyx_v_dtn, __pyx_v_dtnm1, __pyx_v_yn, __pyx_v_ypn, __pyx_v_ypnm1, __pyx_v_dtnp1);
1893 __Pyx_RefNannyFinishContext();
1897 static PyObject *__pyx_pf_16ctimeIntegration_psiTCtteDT(CYTHON_UNUSED PyObject *__pyx_self,
int __pyx_v_nPoints,
double __pyx_v_tau,
double __pyx_v_dtn,
double __pyx_v_dtnm1, PyArrayObject *__pyx_v_yn, PyArrayObject *__pyx_v_ypn, PyArrayObject *__pyx_v_ypnm1, PyArrayObject *__pyx_v_dtnp1) {
1898 PyObject *__pyx_r = NULL;
1899 __Pyx_RefNannyDeclarations
1900 __Pyx_RefNannySetupContext(
"psiTCtteDT", 0);
1909 psiTCtteDT(__pyx_v_nPoints, __pyx_v_tau, __pyx_v_dtn, __pyx_v_dtnm1, ((
double *)__pyx_v_yn->data), ((
double *)__pyx_v_ypn->data), ((
double *)__pyx_v_ypnm1->data), ((
double *)__pyx_v_dtnp1->data));
1920 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
1921 __Pyx_XGIVEREF(__pyx_r);
1922 __Pyx_RefNannyFinishContext();
1935 static PyObject *__pyx_pw_16ctimeIntegration_3applyDGlimitingP1Lagrange1d(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
1936 static PyMethodDef __pyx_mdef_16ctimeIntegration_3applyDGlimitingP1Lagrange1d = {
"applyDGlimitingP1Lagrange1d", (PyCFunction)(
void*)(PyCFunctionWithKeywords)__pyx_pw_16ctimeIntegration_3applyDGlimitingP1Lagrange1d, METH_VARARGS|METH_KEYWORDS, 0};
1937 static PyObject *__pyx_pw_16ctimeIntegration_3applyDGlimitingP1Lagrange1d(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
1938 int __pyx_v_limiterFlag;
1939 int __pyx_v_nElements_global;
1940 int __pyx_v_nNodes_element;
1941 int __pyx_v_nElementBoundaries_element;
1942 int __pyx_v_nDOF_element;
1943 PyArrayObject *__pyx_v_elementNodesArray = 0;
1944 PyArrayObject *__pyx_v_elementNeighborsArray = 0;
1945 PyArrayObject *__pyx_v_nodeArray = 0;
1946 PyArrayObject *__pyx_v_elementBarycentersArray = 0;
1947 PyArrayObject *__pyx_v_l2g = 0;
1948 PyArrayObject *__pyx_v_tag = 0;
1949 PyArrayObject *__pyx_v_Uin = 0;
1950 PyArrayObject *__pyx_v_Uout = 0;
1951 int __pyx_lineno = 0;
1952 const char *__pyx_filename = NULL;
1953 int __pyx_clineno = 0;
1954 PyObject *__pyx_r = 0;
1955 __Pyx_RefNannyDeclarations
1956 __Pyx_RefNannySetupContext(
"applyDGlimitingP1Lagrange1d (wrapper)", 0);
1958 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_limiterFlag,&__pyx_n_s_nElements_global,&__pyx_n_s_nNodes_element,&__pyx_n_s_nElementBoundaries_element,&__pyx_n_s_nDOF_element,&__pyx_n_s_elementNodesArray,&__pyx_n_s_elementNeighborsArray,&__pyx_n_s_nodeArray,&__pyx_n_s_elementBarycentersArray,&__pyx_n_s_l2g,&__pyx_n_s_tag,&__pyx_n_s_Uin,&__pyx_n_s_Uout,0};
1959 PyObject* values[13] = {0,0,0,0,0,0,0,0,0,0,0,0,0};
1960 if (unlikely(__pyx_kwds)) {
1962 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
1964 case 13: values[12] = PyTuple_GET_ITEM(__pyx_args, 12);
1966 case 12: values[11] = PyTuple_GET_ITEM(__pyx_args, 11);
1968 case 11: values[10] = PyTuple_GET_ITEM(__pyx_args, 10);
1970 case 10: values[9] = PyTuple_GET_ITEM(__pyx_args, 9);
1972 case 9: values[8] = PyTuple_GET_ITEM(__pyx_args, 8);
1974 case 8: values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
1976 case 7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
1978 case 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
1980 case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
1982 case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
1984 case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
1986 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
1988 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
1991 default:
goto __pyx_L5_argtuple_error;
1993 kw_args = PyDict_Size(__pyx_kwds);
1996 if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_limiterFlag)) != 0)) kw_args--;
1997 else goto __pyx_L5_argtuple_error;
2000 if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_nElements_global)) != 0)) kw_args--;
2002 __Pyx_RaiseArgtupleInvalid(
"applyDGlimitingP1Lagrange1d", 1, 13, 13, 1); __PYX_ERR(0, 160, __pyx_L3_error)
2006 if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_nNodes_element)) != 0)) kw_args--;
2008 __Pyx_RaiseArgtupleInvalid(
"applyDGlimitingP1Lagrange1d", 1, 13, 13, 2); __PYX_ERR(0, 160, __pyx_L3_error)
2012 if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_nElementBoundaries_element)) != 0)) kw_args--;
2014 __Pyx_RaiseArgtupleInvalid(
"applyDGlimitingP1Lagrange1d", 1, 13, 13, 3); __PYX_ERR(0, 160, __pyx_L3_error)
2018 if (likely((values[4] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_nDOF_element)) != 0)) kw_args--;
2020 __Pyx_RaiseArgtupleInvalid(
"applyDGlimitingP1Lagrange1d", 1, 13, 13, 4); __PYX_ERR(0, 160, __pyx_L3_error)
2024 if (likely((values[5] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_elementNodesArray)) != 0)) kw_args--;
2026 __Pyx_RaiseArgtupleInvalid(
"applyDGlimitingP1Lagrange1d", 1, 13, 13, 5); __PYX_ERR(0, 160, __pyx_L3_error)
2030 if (likely((values[6] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_elementNeighborsArray)) != 0)) kw_args--;
2032 __Pyx_RaiseArgtupleInvalid(
"applyDGlimitingP1Lagrange1d", 1, 13, 13, 6); __PYX_ERR(0, 160, __pyx_L3_error)
2036 if (likely((values[7] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_nodeArray)) != 0)) kw_args--;
2038 __Pyx_RaiseArgtupleInvalid(
"applyDGlimitingP1Lagrange1d", 1, 13, 13, 7); __PYX_ERR(0, 160, __pyx_L3_error)
2042 if (likely((values[8] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_elementBarycentersArray)) != 0)) kw_args--;
2044 __Pyx_RaiseArgtupleInvalid(
"applyDGlimitingP1Lagrange1d", 1, 13, 13, 8); __PYX_ERR(0, 160, __pyx_L3_error)
2048 if (likely((values[9] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_l2g)) != 0)) kw_args--;
2050 __Pyx_RaiseArgtupleInvalid(
"applyDGlimitingP1Lagrange1d", 1, 13, 13, 9); __PYX_ERR(0, 160, __pyx_L3_error)
2054 if (likely((values[10] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_tag)) != 0)) kw_args--;
2056 __Pyx_RaiseArgtupleInvalid(
"applyDGlimitingP1Lagrange1d", 1, 13, 13, 10); __PYX_ERR(0, 160, __pyx_L3_error)
2060 if (likely((values[11] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_Uin)) != 0)) kw_args--;
2062 __Pyx_RaiseArgtupleInvalid(
"applyDGlimitingP1Lagrange1d", 1, 13, 13, 11); __PYX_ERR(0, 160, __pyx_L3_error)
2066 if (likely((values[12] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_Uout)) != 0)) kw_args--;
2068 __Pyx_RaiseArgtupleInvalid(
"applyDGlimitingP1Lagrange1d", 1, 13, 13, 12); __PYX_ERR(0, 160, __pyx_L3_error)
2071 if (unlikely(kw_args > 0)) {
2072 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args,
"applyDGlimitingP1Lagrange1d") < 0)) __PYX_ERR(0, 160, __pyx_L3_error)
2074 }
else if (PyTuple_GET_SIZE(__pyx_args) != 13) {
2075 goto __pyx_L5_argtuple_error;
2077 values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
2078 values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
2079 values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
2080 values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
2081 values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
2082 values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
2083 values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
2084 values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
2085 values[8] = PyTuple_GET_ITEM(__pyx_args, 8);
2086 values[9] = PyTuple_GET_ITEM(__pyx_args, 9);
2087 values[10] = PyTuple_GET_ITEM(__pyx_args, 10);
2088 values[11] = PyTuple_GET_ITEM(__pyx_args, 11);
2089 values[12] = PyTuple_GET_ITEM(__pyx_args, 12);
2091 __pyx_v_limiterFlag = __Pyx_PyInt_As_int(values[0]);
if (unlikely((__pyx_v_limiterFlag == (
int)-1) && PyErr_Occurred())) __PYX_ERR(0, 160, __pyx_L3_error)
2092 __pyx_v_nElements_global = __Pyx_PyInt_As_int(values[1]);
if (unlikely((__pyx_v_nElements_global == (
int)-1) && PyErr_Occurred())) __PYX_ERR(0, 161, __pyx_L3_error)
2093 __pyx_v_nNodes_element = __Pyx_PyInt_As_int(values[2]);
if (unlikely((__pyx_v_nNodes_element == (
int)-1) && PyErr_Occurred())) __PYX_ERR(0, 162, __pyx_L3_error)
2094 __pyx_v_nElementBoundaries_element = __Pyx_PyInt_As_int(values[3]);
if (unlikely((__pyx_v_nElementBoundaries_element == (
int)-1) && PyErr_Occurred())) __PYX_ERR(0, 163, __pyx_L3_error)
2095 __pyx_v_nDOF_element = __Pyx_PyInt_As_int(values[4]);
if (unlikely((__pyx_v_nDOF_element == (
int)-1) && PyErr_Occurred())) __PYX_ERR(0, 164, __pyx_L3_error)
2096 __pyx_v_elementNodesArray = ((PyArrayObject *)values[5]);
2097 __pyx_v_elementNeighborsArray = ((PyArrayObject *)values[6]);
2098 __pyx_v_nodeArray = ((PyArrayObject *)values[7]);
2099 __pyx_v_elementBarycentersArray = ((PyArrayObject *)values[8]);
2100 __pyx_v_l2g = ((PyArrayObject *)values[9]);
2101 __pyx_v_tag = ((PyArrayObject *)values[10]);
2102 __pyx_v_Uin = ((PyArrayObject *)values[11]);
2103 __pyx_v_Uout = ((PyArrayObject *)values[12]);
2105 goto __pyx_L4_argument_unpacking_done;
2106 __pyx_L5_argtuple_error:;
2107 __Pyx_RaiseArgtupleInvalid(
"applyDGlimitingP1Lagrange1d", 1, 13, 13, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 160, __pyx_L3_error)
2109 __Pyx_AddTraceback(
"ctimeIntegration.applyDGlimitingP1Lagrange1d", __pyx_clineno, __pyx_lineno, __pyx_filename);
2110 __Pyx_RefNannyFinishContext();
2112 __pyx_L4_argument_unpacking_done:;
2113 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_elementNodesArray), __pyx_ptype_5numpy_ndarray, 1,
"elementNodesArray", 0))) __PYX_ERR(0, 165, __pyx_L1_error)
2114 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_elementNeighborsArray), __pyx_ptype_5numpy_ndarray, 1,
"elementNeighborsArray", 0))) __PYX_ERR(0, 166, __pyx_L1_error)
2115 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_nodeArray), __pyx_ptype_5numpy_ndarray, 1,
"nodeArray", 0))) __PYX_ERR(0, 167, __pyx_L1_error)
2116 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_elementBarycentersArray), __pyx_ptype_5numpy_ndarray, 1,
"elementBarycentersArray", 0))) __PYX_ERR(0, 168, __pyx_L1_error)
2117 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_l2g), __pyx_ptype_5numpy_ndarray, 1,
"l2g", 0))) __PYX_ERR(0, 169, __pyx_L1_error)
2118 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_tag), __pyx_ptype_5numpy_ndarray, 1,
"tag", 0))) __PYX_ERR(0, 170, __pyx_L1_error)
2119 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_Uin), __pyx_ptype_5numpy_ndarray, 1,
"Uin", 0))) __PYX_ERR(0, 171, __pyx_L1_error)
2120 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_Uout), __pyx_ptype_5numpy_ndarray, 1,
"Uout", 0))) __PYX_ERR(0, 172, __pyx_L1_error)
2121 __pyx_r = __pyx_pf_16ctimeIntegration_2applyDGlimitingP1Lagrange1d(__pyx_self, __pyx_v_limiterFlag, __pyx_v_nElements_global, __pyx_v_nNodes_element, __pyx_v_nElementBoundaries_element, __pyx_v_nDOF_element, __pyx_v_elementNodesArray, __pyx_v_elementNeighborsArray, __pyx_v_nodeArray, __pyx_v_elementBarycentersArray, __pyx_v_l2g, __pyx_v_tag, __pyx_v_Uin, __pyx_v_Uout);
2128 __Pyx_RefNannyFinishContext();
2132 static PyObject *__pyx_pf_16ctimeIntegration_2applyDGlimitingP1Lagrange1d(CYTHON_UNUSED PyObject *__pyx_self,
int __pyx_v_limiterFlag,
int __pyx_v_nElements_global,
int __pyx_v_nNodes_element,
int __pyx_v_nElementBoundaries_element,
int __pyx_v_nDOF_element, PyArrayObject *__pyx_v_elementNodesArray, PyArrayObject *__pyx_v_elementNeighborsArray, PyArrayObject *__pyx_v_nodeArray, PyArrayObject *__pyx_v_elementBarycentersArray, PyArrayObject *__pyx_v_l2g, PyArrayObject *__pyx_v_tag, PyArrayObject *__pyx_v_Uin, PyArrayObject *__pyx_v_Uout) {
2133 PyObject *__pyx_r = NULL;
2134 __Pyx_RefNannyDeclarations
2135 __Pyx_RefNannySetupContext(
"applyDGlimitingP1Lagrange1d", 0);
2144 applyDGlimitingP1Lagrange1d(__pyx_v_limiterFlag, __pyx_v_nElements_global, __pyx_v_nNodes_element, __pyx_v_nElementBoundaries_element, __pyx_v_nDOF_element, ((
int *)__pyx_v_elementNodesArray->data), ((
int *)__pyx_v_elementNeighborsArray->data), ((
double *)__pyx_v_nodeArray->data), ((
double *)__pyx_v_elementBarycentersArray->data), ((
int *)__pyx_v_l2g->data), ((
int *)__pyx_v_tag->data), ((
double *)__pyx_v_Uin->data), ((
double *)__pyx_v_Uout->data));
2155 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
2156 __Pyx_XGIVEREF(__pyx_r);
2157 __Pyx_RefNannyFinishContext();
2170 static PyObject *__pyx_pw_16ctimeIntegration_5applyDGlimitingP1Lagrange1d_withVacuumTol(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
2171 static PyMethodDef __pyx_mdef_16ctimeIntegration_5applyDGlimitingP1Lagrange1d_withVacuumTol = {
"applyDGlimitingP1Lagrange1d_withVacuumTol", (PyCFunction)(
void*)(PyCFunctionWithKeywords)__pyx_pw_16ctimeIntegration_5applyDGlimitingP1Lagrange1d_withVacuumTol, METH_VARARGS|METH_KEYWORDS, 0};
2172 static PyObject *__pyx_pw_16ctimeIntegration_5applyDGlimitingP1Lagrange1d_withVacuumTol(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
2173 int __pyx_v_enforcePositivity;
2174 double __pyx_v_vacuumTol;
2175 int __pyx_v_nElements_global;
2176 int __pyx_v_nNodes_element;
2177 int __pyx_v_nElementBoundaries_element;
2178 int __pyx_v_nDOF_element;
2179 PyArrayObject *__pyx_v_elementNodesArray = 0;
2180 PyArrayObject *__pyx_v_elementNeighborsArray = 0;
2181 PyArrayObject *__pyx_v_nodeArray = 0;
2182 PyArrayObject *__pyx_v_elementBarycentersArray = 0;
2183 PyArrayObject *__pyx_v_l2g = 0;
2184 PyArrayObject *__pyx_v_tag = 0;
2185 PyArrayObject *__pyx_v_Uin = 0;
2186 PyArrayObject *__pyx_v_Uout = 0;
2187 int __pyx_lineno = 0;
2188 const char *__pyx_filename = NULL;
2189 int __pyx_clineno = 0;
2190 PyObject *__pyx_r = 0;
2191 __Pyx_RefNannyDeclarations
2192 __Pyx_RefNannySetupContext(
"applyDGlimitingP1Lagrange1d_withVacuumTol (wrapper)", 0);
2194 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_enforcePositivity,&__pyx_n_s_vacuumTol,&__pyx_n_s_nElements_global,&__pyx_n_s_nNodes_element,&__pyx_n_s_nElementBoundaries_element,&__pyx_n_s_nDOF_element,&__pyx_n_s_elementNodesArray,&__pyx_n_s_elementNeighborsArray,&__pyx_n_s_nodeArray,&__pyx_n_s_elementBarycentersArray,&__pyx_n_s_l2g,&__pyx_n_s_tag,&__pyx_n_s_Uin,&__pyx_n_s_Uout,0};
2195 PyObject* values[14] = {0,0,0,0,0,0,0,0,0,0,0,0,0,0};
2196 if (unlikely(__pyx_kwds)) {
2198 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
2200 case 14: values[13] = PyTuple_GET_ITEM(__pyx_args, 13);
2202 case 13: values[12] = PyTuple_GET_ITEM(__pyx_args, 12);
2204 case 12: values[11] = PyTuple_GET_ITEM(__pyx_args, 11);
2206 case 11: values[10] = PyTuple_GET_ITEM(__pyx_args, 10);
2208 case 10: values[9] = PyTuple_GET_ITEM(__pyx_args, 9);
2210 case 9: values[8] = PyTuple_GET_ITEM(__pyx_args, 8);
2212 case 8: values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
2214 case 7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
2216 case 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
2218 case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
2220 case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
2222 case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
2224 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
2226 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
2229 default:
goto __pyx_L5_argtuple_error;
2231 kw_args = PyDict_Size(__pyx_kwds);
2234 if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_enforcePositivity)) != 0)) kw_args--;
2235 else goto __pyx_L5_argtuple_error;
2238 if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_vacuumTol)) != 0)) kw_args--;
2240 __Pyx_RaiseArgtupleInvalid(
"applyDGlimitingP1Lagrange1d_withVacuumTol", 1, 14, 14, 1); __PYX_ERR(0, 187, __pyx_L3_error)
2244 if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_nElements_global)) != 0)) kw_args--;
2246 __Pyx_RaiseArgtupleInvalid(
"applyDGlimitingP1Lagrange1d_withVacuumTol", 1, 14, 14, 2); __PYX_ERR(0, 187, __pyx_L3_error)
2250 if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_nNodes_element)) != 0)) kw_args--;
2252 __Pyx_RaiseArgtupleInvalid(
"applyDGlimitingP1Lagrange1d_withVacuumTol", 1, 14, 14, 3); __PYX_ERR(0, 187, __pyx_L3_error)
2256 if (likely((values[4] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_nElementBoundaries_element)) != 0)) kw_args--;
2258 __Pyx_RaiseArgtupleInvalid(
"applyDGlimitingP1Lagrange1d_withVacuumTol", 1, 14, 14, 4); __PYX_ERR(0, 187, __pyx_L3_error)
2262 if (likely((values[5] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_nDOF_element)) != 0)) kw_args--;
2264 __Pyx_RaiseArgtupleInvalid(
"applyDGlimitingP1Lagrange1d_withVacuumTol", 1, 14, 14, 5); __PYX_ERR(0, 187, __pyx_L3_error)
2268 if (likely((values[6] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_elementNodesArray)) != 0)) kw_args--;
2270 __Pyx_RaiseArgtupleInvalid(
"applyDGlimitingP1Lagrange1d_withVacuumTol", 1, 14, 14, 6); __PYX_ERR(0, 187, __pyx_L3_error)
2274 if (likely((values[7] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_elementNeighborsArray)) != 0)) kw_args--;
2276 __Pyx_RaiseArgtupleInvalid(
"applyDGlimitingP1Lagrange1d_withVacuumTol", 1, 14, 14, 7); __PYX_ERR(0, 187, __pyx_L3_error)
2280 if (likely((values[8] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_nodeArray)) != 0)) kw_args--;
2282 __Pyx_RaiseArgtupleInvalid(
"applyDGlimitingP1Lagrange1d_withVacuumTol", 1, 14, 14, 8); __PYX_ERR(0, 187, __pyx_L3_error)
2286 if (likely((values[9] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_elementBarycentersArray)) != 0)) kw_args--;
2288 __Pyx_RaiseArgtupleInvalid(
"applyDGlimitingP1Lagrange1d_withVacuumTol", 1, 14, 14, 9); __PYX_ERR(0, 187, __pyx_L3_error)
2292 if (likely((values[10] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_l2g)) != 0)) kw_args--;
2294 __Pyx_RaiseArgtupleInvalid(
"applyDGlimitingP1Lagrange1d_withVacuumTol", 1, 14, 14, 10); __PYX_ERR(0, 187, __pyx_L3_error)
2298 if (likely((values[11] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_tag)) != 0)) kw_args--;
2300 __Pyx_RaiseArgtupleInvalid(
"applyDGlimitingP1Lagrange1d_withVacuumTol", 1, 14, 14, 11); __PYX_ERR(0, 187, __pyx_L3_error)
2304 if (likely((values[12] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_Uin)) != 0)) kw_args--;
2306 __Pyx_RaiseArgtupleInvalid(
"applyDGlimitingP1Lagrange1d_withVacuumTol", 1, 14, 14, 12); __PYX_ERR(0, 187, __pyx_L3_error)
2310 if (likely((values[13] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_Uout)) != 0)) kw_args--;
2312 __Pyx_RaiseArgtupleInvalid(
"applyDGlimitingP1Lagrange1d_withVacuumTol", 1, 14, 14, 13); __PYX_ERR(0, 187, __pyx_L3_error)
2315 if (unlikely(kw_args > 0)) {
2316 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args,
"applyDGlimitingP1Lagrange1d_withVacuumTol") < 0)) __PYX_ERR(0, 187, __pyx_L3_error)
2318 }
else if (PyTuple_GET_SIZE(__pyx_args) != 14) {
2319 goto __pyx_L5_argtuple_error;
2321 values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
2322 values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
2323 values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
2324 values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
2325 values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
2326 values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
2327 values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
2328 values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
2329 values[8] = PyTuple_GET_ITEM(__pyx_args, 8);
2330 values[9] = PyTuple_GET_ITEM(__pyx_args, 9);
2331 values[10] = PyTuple_GET_ITEM(__pyx_args, 10);
2332 values[11] = PyTuple_GET_ITEM(__pyx_args, 11);
2333 values[12] = PyTuple_GET_ITEM(__pyx_args, 12);
2334 values[13] = PyTuple_GET_ITEM(__pyx_args, 13);
2336 __pyx_v_enforcePositivity = __Pyx_PyInt_As_int(values[0]);
if (unlikely((__pyx_v_enforcePositivity == (
int)-1) && PyErr_Occurred())) __PYX_ERR(0, 187, __pyx_L3_error)
2337 __pyx_v_vacuumTol = __pyx_PyFloat_AsDouble(values[1]);
if (unlikely((__pyx_v_vacuumTol == (
double)-1) && PyErr_Occurred())) __PYX_ERR(0, 188, __pyx_L3_error)
2338 __pyx_v_nElements_global = __Pyx_PyInt_As_int(values[2]);
if (unlikely((__pyx_v_nElements_global == (
int)-1) && PyErr_Occurred())) __PYX_ERR(0, 189, __pyx_L3_error)
2339 __pyx_v_nNodes_element = __Pyx_PyInt_As_int(values[3]);
if (unlikely((__pyx_v_nNodes_element == (
int)-1) && PyErr_Occurred())) __PYX_ERR(0, 190, __pyx_L3_error)
2340 __pyx_v_nElementBoundaries_element = __Pyx_PyInt_As_int(values[4]);
if (unlikely((__pyx_v_nElementBoundaries_element == (
int)-1) && PyErr_Occurred())) __PYX_ERR(0, 191, __pyx_L3_error)
2341 __pyx_v_nDOF_element = __Pyx_PyInt_As_int(values[5]);
if (unlikely((__pyx_v_nDOF_element == (
int)-1) && PyErr_Occurred())) __PYX_ERR(0, 192, __pyx_L3_error)
2342 __pyx_v_elementNodesArray = ((PyArrayObject *)values[6]);
2343 __pyx_v_elementNeighborsArray = ((PyArrayObject *)values[7]);
2344 __pyx_v_nodeArray = ((PyArrayObject *)values[8]);
2345 __pyx_v_elementBarycentersArray = ((PyArrayObject *)values[9]);
2346 __pyx_v_l2g = ((PyArrayObject *)values[10]);
2347 __pyx_v_tag = ((PyArrayObject *)values[11]);
2348 __pyx_v_Uin = ((PyArrayObject *)values[12]);
2349 __pyx_v_Uout = ((PyArrayObject *)values[13]);
2351 goto __pyx_L4_argument_unpacking_done;
2352 __pyx_L5_argtuple_error:;
2353 __Pyx_RaiseArgtupleInvalid(
"applyDGlimitingP1Lagrange1d_withVacuumTol", 1, 14, 14, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 187, __pyx_L3_error)
2355 __Pyx_AddTraceback(
"ctimeIntegration.applyDGlimitingP1Lagrange1d_withVacuumTol", __pyx_clineno, __pyx_lineno, __pyx_filename);
2356 __Pyx_RefNannyFinishContext();
2358 __pyx_L4_argument_unpacking_done:;
2359 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_elementNodesArray), __pyx_ptype_5numpy_ndarray, 1,
"elementNodesArray", 0))) __PYX_ERR(0, 193, __pyx_L1_error)
2360 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_elementNeighborsArray), __pyx_ptype_5numpy_ndarray, 1,
"elementNeighborsArray", 0))) __PYX_ERR(0, 194, __pyx_L1_error)
2361 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_nodeArray), __pyx_ptype_5numpy_ndarray, 1,
"nodeArray", 0))) __PYX_ERR(0, 195, __pyx_L1_error)
2362 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_elementBarycentersArray), __pyx_ptype_5numpy_ndarray, 1,
"elementBarycentersArray", 0))) __PYX_ERR(0, 196, __pyx_L1_error)
2363 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_l2g), __pyx_ptype_5numpy_ndarray, 1,
"l2g", 0))) __PYX_ERR(0, 197, __pyx_L1_error)
2364 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_tag), __pyx_ptype_5numpy_ndarray, 1,
"tag", 0))) __PYX_ERR(0, 198, __pyx_L1_error)
2365 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_Uin), __pyx_ptype_5numpy_ndarray, 1,
"Uin", 0))) __PYX_ERR(0, 199, __pyx_L1_error)
2366 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_Uout), __pyx_ptype_5numpy_ndarray, 1,
"Uout", 0))) __PYX_ERR(0, 200, __pyx_L1_error)
2367 __pyx_r = __pyx_pf_16ctimeIntegration_4applyDGlimitingP1Lagrange1d_withVacuumTol(__pyx_self, __pyx_v_enforcePositivity, __pyx_v_vacuumTol, __pyx_v_nElements_global, __pyx_v_nNodes_element, __pyx_v_nElementBoundaries_element, __pyx_v_nDOF_element, __pyx_v_elementNodesArray, __pyx_v_elementNeighborsArray, __pyx_v_nodeArray, __pyx_v_elementBarycentersArray, __pyx_v_l2g, __pyx_v_tag, __pyx_v_Uin, __pyx_v_Uout);
2374 __Pyx_RefNannyFinishContext();
2378 static PyObject *__pyx_pf_16ctimeIntegration_4applyDGlimitingP1Lagrange1d_withVacuumTol(CYTHON_UNUSED PyObject *__pyx_self,
int __pyx_v_enforcePositivity,
double __pyx_v_vacuumTol,
int __pyx_v_nElements_global,
int __pyx_v_nNodes_element,
int __pyx_v_nElementBoundaries_element,
int __pyx_v_nDOF_element, PyArrayObject *__pyx_v_elementNodesArray, PyArrayObject *__pyx_v_elementNeighborsArray, PyArrayObject *__pyx_v_nodeArray, PyArrayObject *__pyx_v_elementBarycentersArray, PyArrayObject *__pyx_v_l2g, PyArrayObject *__pyx_v_tag, PyArrayObject *__pyx_v_Uin, PyArrayObject *__pyx_v_Uout) {
2379 PyObject *__pyx_r = NULL;
2380 __Pyx_RefNannyDeclarations
2381 __Pyx_RefNannySetupContext(
"applyDGlimitingP1Lagrange1d_withVacuumTol", 0);
2390 applyDGlimitingP1Lagrange1d_withVacuumTol(__pyx_v_enforcePositivity, __pyx_v_vacuumTol, __pyx_v_nElements_global, __pyx_v_nNodes_element, __pyx_v_nElementBoundaries_element, __pyx_v_nDOF_element, ((
int *)__pyx_v_elementNodesArray->data), ((
int *)__pyx_v_elementNeighborsArray->data), ((
double *)__pyx_v_nodeArray->data), ((
double *)__pyx_v_elementBarycentersArray->data), ((
int *)__pyx_v_l2g->data), ((
int *)__pyx_v_tag->data), ((
double *)__pyx_v_Uin->data), ((
double *)__pyx_v_Uout->data));
2401 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
2402 __Pyx_XGIVEREF(__pyx_r);
2403 __Pyx_RefNannyFinishContext();
2416 static PyObject *__pyx_pw_16ctimeIntegration_7computeElementNeighborShapeGradients(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
2417 static PyMethodDef __pyx_mdef_16ctimeIntegration_7computeElementNeighborShapeGradients = {
"computeElementNeighborShapeGradients", (PyCFunction)(
void*)(PyCFunctionWithKeywords)__pyx_pw_16ctimeIntegration_7computeElementNeighborShapeGradients, METH_VARARGS|METH_KEYWORDS, 0};
2418 static PyObject *__pyx_pw_16ctimeIntegration_7computeElementNeighborShapeGradients(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
2419 PyArrayObject *__pyx_v_elementBoundariesArray = 0;
2420 PyArrayObject *__pyx_v_elementNeighborsArray = 0;
2421 PyArrayObject *__pyx_v_elementBarycentersArray = 0;
2422 PyArrayObject *__pyx_v_elementBoundaryBarycentersArray = 0;
2423 PyArrayObject *__pyx_v_elementNeighborShapeGradients = 0;
2424 int __pyx_lineno = 0;
2425 const char *__pyx_filename = NULL;
2426 int __pyx_clineno = 0;
2427 PyObject *__pyx_r = 0;
2428 __Pyx_RefNannyDeclarations
2429 __Pyx_RefNannySetupContext(
"computeElementNeighborShapeGradients (wrapper)", 0);
2431 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_elementBoundariesArray,&__pyx_n_s_elementNeighborsArray,&__pyx_n_s_elementBarycentersArray,&__pyx_n_s_elementBoundaryBarycentersArray,&__pyx_n_s_elementNeighborShapeGradients,0};
2432 PyObject* values[5] = {0,0,0,0,0};
2433 if (unlikely(__pyx_kwds)) {
2435 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
2437 case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
2439 case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
2441 case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
2443 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
2445 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
2448 default:
goto __pyx_L5_argtuple_error;
2450 kw_args = PyDict_Size(__pyx_kwds);
2453 if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_elementBoundariesArray)) != 0)) kw_args--;
2454 else goto __pyx_L5_argtuple_error;
2457 if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_elementNeighborsArray)) != 0)) kw_args--;
2459 __Pyx_RaiseArgtupleInvalid(
"computeElementNeighborShapeGradients", 1, 5, 5, 1); __PYX_ERR(0, 217, __pyx_L3_error)
2463 if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_elementBarycentersArray)) != 0)) kw_args--;
2465 __Pyx_RaiseArgtupleInvalid(
"computeElementNeighborShapeGradients", 1, 5, 5, 2); __PYX_ERR(0, 217, __pyx_L3_error)
2469 if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_elementBoundaryBarycentersArray)) != 0)) kw_args--;
2471 __Pyx_RaiseArgtupleInvalid(
"computeElementNeighborShapeGradients", 1, 5, 5, 3); __PYX_ERR(0, 217, __pyx_L3_error)
2475 if (likely((values[4] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_elementNeighborShapeGradients)) != 0)) kw_args--;
2477 __Pyx_RaiseArgtupleInvalid(
"computeElementNeighborShapeGradients", 1, 5, 5, 4); __PYX_ERR(0, 217, __pyx_L3_error)
2480 if (unlikely(kw_args > 0)) {
2481 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args,
"computeElementNeighborShapeGradients") < 0)) __PYX_ERR(0, 217, __pyx_L3_error)
2483 }
else if (PyTuple_GET_SIZE(__pyx_args) != 5) {
2484 goto __pyx_L5_argtuple_error;
2486 values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
2487 values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
2488 values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
2489 values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
2490 values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
2492 __pyx_v_elementBoundariesArray = ((PyArrayObject *)values[0]);
2493 __pyx_v_elementNeighborsArray = ((PyArrayObject *)values[1]);
2494 __pyx_v_elementBarycentersArray = ((PyArrayObject *)values[2]);
2495 __pyx_v_elementBoundaryBarycentersArray = ((PyArrayObject *)values[3]);
2496 __pyx_v_elementNeighborShapeGradients = ((PyArrayObject *)values[4]);
2498 goto __pyx_L4_argument_unpacking_done;
2499 __pyx_L5_argtuple_error:;
2500 __Pyx_RaiseArgtupleInvalid(
"computeElementNeighborShapeGradients", 1, 5, 5, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 217, __pyx_L3_error)
2502 __Pyx_AddTraceback(
"ctimeIntegration.computeElementNeighborShapeGradients", __pyx_clineno, __pyx_lineno, __pyx_filename);
2503 __Pyx_RefNannyFinishContext();
2505 __pyx_L4_argument_unpacking_done:;
2506 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_elementBoundariesArray), __pyx_ptype_5numpy_ndarray, 1,
"elementBoundariesArray", 0))) __PYX_ERR(0, 217, __pyx_L1_error)
2507 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_elementNeighborsArray), __pyx_ptype_5numpy_ndarray, 1,
"elementNeighborsArray", 0))) __PYX_ERR(0, 218, __pyx_L1_error)
2508 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_elementBarycentersArray), __pyx_ptype_5numpy_ndarray, 1,
"elementBarycentersArray", 0))) __PYX_ERR(0, 219, __pyx_L1_error)
2509 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_elementBoundaryBarycentersArray), __pyx_ptype_5numpy_ndarray, 1,
"elementBoundaryBarycentersArray", 0))) __PYX_ERR(0, 220, __pyx_L1_error)
2510 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_elementNeighborShapeGradients), __pyx_ptype_5numpy_ndarray, 1,
"elementNeighborShapeGradients", 0))) __PYX_ERR(0, 221, __pyx_L1_error)
2511 __pyx_r = __pyx_pf_16ctimeIntegration_6computeElementNeighborShapeGradients(__pyx_self, __pyx_v_elementBoundariesArray, __pyx_v_elementNeighborsArray, __pyx_v_elementBarycentersArray, __pyx_v_elementBoundaryBarycentersArray, __pyx_v_elementNeighborShapeGradients);
2518 __Pyx_RefNannyFinishContext();
2522 static PyObject *__pyx_pf_16ctimeIntegration_6computeElementNeighborShapeGradients(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_elementBoundariesArray, PyArrayObject *__pyx_v_elementNeighborsArray, PyArrayObject *__pyx_v_elementBarycentersArray, PyArrayObject *__pyx_v_elementBoundaryBarycentersArray, PyArrayObject *__pyx_v_elementNeighborShapeGradients) {
2523 PyObject *__pyx_r = NULL;
2524 __Pyx_RefNannyDeclarations
2525 __Pyx_RefNannySetupContext(
"computeElementNeighborShapeGradients", 0);
2534 computeElementNeighborShapeGradients((__pyx_v_elementNeighborsArray->dimensions[0]), (__pyx_v_elementNeighborsArray->dimensions[1]), ((__pyx_v_elementNeighborsArray->dimensions[1]) - 1), ((
int *)__pyx_v_elementBoundariesArray->data), ((
int *)__pyx_v_elementNeighborsArray->data), ((
double *)__pyx_v_elementBarycentersArray->data), ((
double *)__pyx_v_elementBoundaryBarycentersArray->data), ((
double *)__pyx_v_elementNeighborShapeGradients->data));
2545 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
2546 __Pyx_XGIVEREF(__pyx_r);
2547 __Pyx_RefNannyFinishContext();
2560 static PyObject *__pyx_pw_16ctimeIntegration_9computeCockburnDGlimiterArrays2d(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
2561 static PyMethodDef __pyx_mdef_16ctimeIntegration_9computeCockburnDGlimiterArrays2d = {
"computeCockburnDGlimiterArrays2d", (PyCFunction)(
void*)(PyCFunctionWithKeywords)__pyx_pw_16ctimeIntegration_9computeCockburnDGlimiterArrays2d, METH_VARARGS|METH_KEYWORDS, 0};
2562 static PyObject *__pyx_pw_16ctimeIntegration_9computeCockburnDGlimiterArrays2d(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
2563 PyArrayObject *__pyx_v_elementBoundariesArray = 0;
2564 PyArrayObject *__pyx_v_elementNeighborsArray = 0;
2565 PyArrayObject *__pyx_v_elementBarycentersArray = 0;
2566 PyArrayObject *__pyx_v_elementBoundaryBarycentersArray = 0;
2567 PyArrayObject *__pyx_v_elementNeighborShapeGradients = 0;
2568 PyArrayObject *__pyx_v_alphas = 0;
2569 PyArrayObject *__pyx_v_alphaNeighbors = 0;
2570 int __pyx_lineno = 0;
2571 const char *__pyx_filename = NULL;
2572 int __pyx_clineno = 0;
2573 PyObject *__pyx_r = 0;
2574 __Pyx_RefNannyDeclarations
2575 __Pyx_RefNannySetupContext(
"computeCockburnDGlimiterArrays2d (wrapper)", 0);
2577 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_elementBoundariesArray,&__pyx_n_s_elementNeighborsArray,&__pyx_n_s_elementBarycentersArray,&__pyx_n_s_elementBoundaryBarycentersArray,&__pyx_n_s_elementNeighborShapeGradients,&__pyx_n_s_alphas,&__pyx_n_s_alphaNeighbors,0};
2578 PyObject* values[7] = {0,0,0,0,0,0,0};
2579 if (unlikely(__pyx_kwds)) {
2581 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
2583 case 7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
2585 case 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
2587 case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
2589 case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
2591 case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
2593 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
2595 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
2598 default:
goto __pyx_L5_argtuple_error;
2600 kw_args = PyDict_Size(__pyx_kwds);
2603 if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_elementBoundariesArray)) != 0)) kw_args--;
2604 else goto __pyx_L5_argtuple_error;
2607 if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_elementNeighborsArray)) != 0)) kw_args--;
2609 __Pyx_RaiseArgtupleInvalid(
"computeCockburnDGlimiterArrays2d", 1, 7, 7, 1); __PYX_ERR(0, 231, __pyx_L3_error)
2613 if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_elementBarycentersArray)) != 0)) kw_args--;
2615 __Pyx_RaiseArgtupleInvalid(
"computeCockburnDGlimiterArrays2d", 1, 7, 7, 2); __PYX_ERR(0, 231, __pyx_L3_error)
2619 if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_elementBoundaryBarycentersArray)) != 0)) kw_args--;
2621 __Pyx_RaiseArgtupleInvalid(
"computeCockburnDGlimiterArrays2d", 1, 7, 7, 3); __PYX_ERR(0, 231, __pyx_L3_error)
2625 if (likely((values[4] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_elementNeighborShapeGradients)) != 0)) kw_args--;
2627 __Pyx_RaiseArgtupleInvalid(
"computeCockburnDGlimiterArrays2d", 1, 7, 7, 4); __PYX_ERR(0, 231, __pyx_L3_error)
2631 if (likely((values[5] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_alphas)) != 0)) kw_args--;
2633 __Pyx_RaiseArgtupleInvalid(
"computeCockburnDGlimiterArrays2d", 1, 7, 7, 5); __PYX_ERR(0, 231, __pyx_L3_error)
2637 if (likely((values[6] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_alphaNeighbors)) != 0)) kw_args--;
2639 __Pyx_RaiseArgtupleInvalid(
"computeCockburnDGlimiterArrays2d", 1, 7, 7, 6); __PYX_ERR(0, 231, __pyx_L3_error)
2642 if (unlikely(kw_args > 0)) {
2643 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args,
"computeCockburnDGlimiterArrays2d") < 0)) __PYX_ERR(0, 231, __pyx_L3_error)
2645 }
else if (PyTuple_GET_SIZE(__pyx_args) != 7) {
2646 goto __pyx_L5_argtuple_error;
2648 values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
2649 values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
2650 values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
2651 values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
2652 values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
2653 values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
2654 values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
2656 __pyx_v_elementBoundariesArray = ((PyArrayObject *)values[0]);
2657 __pyx_v_elementNeighborsArray = ((PyArrayObject *)values[1]);
2658 __pyx_v_elementBarycentersArray = ((PyArrayObject *)values[2]);
2659 __pyx_v_elementBoundaryBarycentersArray = ((PyArrayObject *)values[3]);
2660 __pyx_v_elementNeighborShapeGradients = ((PyArrayObject *)values[4]);
2661 __pyx_v_alphas = ((PyArrayObject *)values[5]);
2662 __pyx_v_alphaNeighbors = ((PyArrayObject *)values[6]);
2664 goto __pyx_L4_argument_unpacking_done;
2665 __pyx_L5_argtuple_error:;
2666 __Pyx_RaiseArgtupleInvalid(
"computeCockburnDGlimiterArrays2d", 1, 7, 7, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 231, __pyx_L3_error)
2668 __Pyx_AddTraceback(
"ctimeIntegration.computeCockburnDGlimiterArrays2d", __pyx_clineno, __pyx_lineno, __pyx_filename);
2669 __Pyx_RefNannyFinishContext();
2671 __pyx_L4_argument_unpacking_done:;
2672 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_elementBoundariesArray), __pyx_ptype_5numpy_ndarray, 1,
"elementBoundariesArray", 0))) __PYX_ERR(0, 231, __pyx_L1_error)
2673 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_elementNeighborsArray), __pyx_ptype_5numpy_ndarray, 1,
"elementNeighborsArray", 0))) __PYX_ERR(0, 232, __pyx_L1_error)
2674 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_elementBarycentersArray), __pyx_ptype_5numpy_ndarray, 1,
"elementBarycentersArray", 0))) __PYX_ERR(0, 233, __pyx_L1_error)
2675 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_elementBoundaryBarycentersArray), __pyx_ptype_5numpy_ndarray, 1,
"elementBoundaryBarycentersArray", 0))) __PYX_ERR(0, 234, __pyx_L1_error)
2676 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_elementNeighborShapeGradients), __pyx_ptype_5numpy_ndarray, 1,
"elementNeighborShapeGradients", 0))) __PYX_ERR(0, 235, __pyx_L1_error)
2677 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_alphas), __pyx_ptype_5numpy_ndarray, 1,
"alphas", 0))) __PYX_ERR(0, 236, __pyx_L1_error)
2678 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_alphaNeighbors), __pyx_ptype_5numpy_ndarray, 1,
"alphaNeighbors", 0))) __PYX_ERR(0, 237, __pyx_L1_error)
2679 __pyx_r = __pyx_pf_16ctimeIntegration_8computeCockburnDGlimiterArrays2d(__pyx_self, __pyx_v_elementBoundariesArray, __pyx_v_elementNeighborsArray, __pyx_v_elementBarycentersArray, __pyx_v_elementBoundaryBarycentersArray, __pyx_v_elementNeighborShapeGradients, __pyx_v_alphas, __pyx_v_alphaNeighbors);
2686 __Pyx_RefNannyFinishContext();
2690 static PyObject *__pyx_pf_16ctimeIntegration_8computeCockburnDGlimiterArrays2d(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_elementBoundariesArray, PyArrayObject *__pyx_v_elementNeighborsArray, PyArrayObject *__pyx_v_elementBarycentersArray, PyArrayObject *__pyx_v_elementBoundaryBarycentersArray, PyArrayObject *__pyx_v_elementNeighborShapeGradients, PyArrayObject *__pyx_v_alphas, PyArrayObject *__pyx_v_alphaNeighbors) {
2691 PyObject *__pyx_r = NULL;
2692 __Pyx_RefNannyDeclarations
2693 __Pyx_RefNannySetupContext(
"computeCockburnDGlimiterArrays2d", 0);
2702 computeCockburnDGlimiterArrays2d((__pyx_v_elementNeighborsArray->dimensions[0]), (__pyx_v_elementNeighborsArray->dimensions[1]), ((__pyx_v_elementNeighborsArray->dimensions[1]) - 1), ((
int *)__pyx_v_elementBoundariesArray->data), ((
int *)__pyx_v_elementNeighborsArray->data), ((
double *)__pyx_v_elementBarycentersArray->data), ((
double *)__pyx_v_elementBoundaryBarycentersArray->data), ((
double *)__pyx_v_elementNeighborShapeGradients->data), ((
double *)__pyx_v_alphas->data), ((
int *)__pyx_v_alphaNeighbors->data));
2713 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
2714 __Pyx_XGIVEREF(__pyx_r);
2715 __Pyx_RefNannyFinishContext();
2728 static PyObject *__pyx_pw_16ctimeIntegration_11applyCockburnDGlimiterP1Lagrange2d(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
2729 static PyMethodDef __pyx_mdef_16ctimeIntegration_11applyCockburnDGlimiterP1Lagrange2d = {
"applyCockburnDGlimiterP1Lagrange2d", (PyCFunction)(
void*)(PyCFunctionWithKeywords)__pyx_pw_16ctimeIntegration_11applyCockburnDGlimiterP1Lagrange2d, METH_VARARGS|METH_KEYWORDS, 0};
2730 static PyObject *__pyx_pw_16ctimeIntegration_11applyCockburnDGlimiterP1Lagrange2d(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
2733 PyArrayObject *__pyx_v_elementNeighborsArray = 0;
2734 PyArrayObject *__pyx_v_l2g = 0;
2735 PyArrayObject *__pyx_v_tag = 0;
2736 PyArrayObject *__pyx_v_alphas = 0;
2737 PyArrayObject *__pyx_v_alphaNeighbors = 0;
2738 PyArrayObject *__pyx_v_Uin = 0;
2739 PyArrayObject *__pyx_v_Uout = 0;
2740 int __pyx_lineno = 0;
2741 const char *__pyx_filename = NULL;
2742 int __pyx_clineno = 0;
2743 PyObject *__pyx_r = 0;
2744 __Pyx_RefNannyDeclarations
2745 __Pyx_RefNannySetupContext(
"applyCockburnDGlimiterP1Lagrange2d (wrapper)", 0);
2747 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_nu,&__pyx_n_s_Mh2,&__pyx_n_s_elementNeighborsArray,&__pyx_n_s_l2g,&__pyx_n_s_tag,&__pyx_n_s_alphas,&__pyx_n_s_alphaNeighbors,&__pyx_n_s_Uin,&__pyx_n_s_Uout,0};
2748 PyObject* values[9] = {0,0,0,0,0,0,0,0,0};
2749 if (unlikely(__pyx_kwds)) {
2751 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
2753 case 9: values[8] = PyTuple_GET_ITEM(__pyx_args, 8);
2755 case 8: values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
2757 case 7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
2759 case 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
2761 case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
2763 case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
2765 case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
2767 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
2769 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
2772 default:
goto __pyx_L5_argtuple_error;
2774 kw_args = PyDict_Size(__pyx_kwds);
2777 if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_nu)) != 0)) kw_args--;
2778 else goto __pyx_L5_argtuple_error;
2781 if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_Mh2)) != 0)) kw_args--;
2783 __Pyx_RaiseArgtupleInvalid(
"applyCockburnDGlimiterP1Lagrange2d", 1, 9, 9, 1); __PYX_ERR(0, 249, __pyx_L3_error)
2787 if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_elementNeighborsArray)) != 0)) kw_args--;
2789 __Pyx_RaiseArgtupleInvalid(
"applyCockburnDGlimiterP1Lagrange2d", 1, 9, 9, 2); __PYX_ERR(0, 249, __pyx_L3_error)
2793 if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_l2g)) != 0)) kw_args--;
2795 __Pyx_RaiseArgtupleInvalid(
"applyCockburnDGlimiterP1Lagrange2d", 1, 9, 9, 3); __PYX_ERR(0, 249, __pyx_L3_error)
2799 if (likely((values[4] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_tag)) != 0)) kw_args--;
2801 __Pyx_RaiseArgtupleInvalid(
"applyCockburnDGlimiterP1Lagrange2d", 1, 9, 9, 4); __PYX_ERR(0, 249, __pyx_L3_error)
2805 if (likely((values[5] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_alphas)) != 0)) kw_args--;
2807 __Pyx_RaiseArgtupleInvalid(
"applyCockburnDGlimiterP1Lagrange2d", 1, 9, 9, 5); __PYX_ERR(0, 249, __pyx_L3_error)
2811 if (likely((values[6] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_alphaNeighbors)) != 0)) kw_args--;
2813 __Pyx_RaiseArgtupleInvalid(
"applyCockburnDGlimiterP1Lagrange2d", 1, 9, 9, 6); __PYX_ERR(0, 249, __pyx_L3_error)
2817 if (likely((values[7] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_Uin)) != 0)) kw_args--;
2819 __Pyx_RaiseArgtupleInvalid(
"applyCockburnDGlimiterP1Lagrange2d", 1, 9, 9, 7); __PYX_ERR(0, 249, __pyx_L3_error)
2823 if (likely((values[8] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_Uout)) != 0)) kw_args--;
2825 __Pyx_RaiseArgtupleInvalid(
"applyCockburnDGlimiterP1Lagrange2d", 1, 9, 9, 8); __PYX_ERR(0, 249, __pyx_L3_error)
2828 if (unlikely(kw_args > 0)) {
2829 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args,
"applyCockburnDGlimiterP1Lagrange2d") < 0)) __PYX_ERR(0, 249, __pyx_L3_error)
2831 }
else if (PyTuple_GET_SIZE(__pyx_args) != 9) {
2832 goto __pyx_L5_argtuple_error;
2834 values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
2835 values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
2836 values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
2837 values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
2838 values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
2839 values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
2840 values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
2841 values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
2842 values[8] = PyTuple_GET_ITEM(__pyx_args, 8);
2844 __pyx_v_nu = __pyx_PyFloat_AsDouble(values[0]);
if (unlikely((__pyx_v_nu == (
double)-1) && PyErr_Occurred())) __PYX_ERR(0, 249, __pyx_L3_error)
2845 __pyx_v_Mh2 = __pyx_PyFloat_AsDouble(values[1]);
if (unlikely((__pyx_v_Mh2 == (
double)-1) && PyErr_Occurred())) __PYX_ERR(0, 250, __pyx_L3_error)
2846 __pyx_v_elementNeighborsArray = ((PyArrayObject *)values[2]);
2847 __pyx_v_l2g = ((PyArrayObject *)values[3]);
2848 __pyx_v_tag = ((PyArrayObject *)values[4]);
2849 __pyx_v_alphas = ((PyArrayObject *)values[5]);
2850 __pyx_v_alphaNeighbors = ((PyArrayObject *)values[6]);
2851 __pyx_v_Uin = ((PyArrayObject *)values[7]);
2852 __pyx_v_Uout = ((PyArrayObject *)values[8]);
2854 goto __pyx_L4_argument_unpacking_done;
2855 __pyx_L5_argtuple_error:;
2856 __Pyx_RaiseArgtupleInvalid(
"applyCockburnDGlimiterP1Lagrange2d", 1, 9, 9, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 249, __pyx_L3_error)
2858 __Pyx_AddTraceback(
"ctimeIntegration.applyCockburnDGlimiterP1Lagrange2d", __pyx_clineno, __pyx_lineno, __pyx_filename);
2859 __Pyx_RefNannyFinishContext();
2861 __pyx_L4_argument_unpacking_done:;
2862 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_elementNeighborsArray), __pyx_ptype_5numpy_ndarray, 1,
"elementNeighborsArray", 0))) __PYX_ERR(0, 251, __pyx_L1_error)
2863 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_l2g), __pyx_ptype_5numpy_ndarray, 1,
"l2g", 0))) __PYX_ERR(0, 252, __pyx_L1_error)
2864 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_tag), __pyx_ptype_5numpy_ndarray, 1,
"tag", 0))) __PYX_ERR(0, 253, __pyx_L1_error)
2865 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_alphas), __pyx_ptype_5numpy_ndarray, 1,
"alphas", 0))) __PYX_ERR(0, 254, __pyx_L1_error)
2866 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_alphaNeighbors), __pyx_ptype_5numpy_ndarray, 1,
"alphaNeighbors", 0))) __PYX_ERR(0, 255, __pyx_L1_error)
2867 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_Uin), __pyx_ptype_5numpy_ndarray, 1,
"Uin", 0))) __PYX_ERR(0, 256, __pyx_L1_error)
2868 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_Uout), __pyx_ptype_5numpy_ndarray, 1,
"Uout", 0))) __PYX_ERR(0, 257, __pyx_L1_error)
2869 __pyx_r = __pyx_pf_16ctimeIntegration_10applyCockburnDGlimiterP1Lagrange2d(__pyx_self, __pyx_v_nu, __pyx_v_Mh2, __pyx_v_elementNeighborsArray, __pyx_v_l2g, __pyx_v_tag, __pyx_v_alphas, __pyx_v_alphaNeighbors, __pyx_v_Uin, __pyx_v_Uout);
2876 __Pyx_RefNannyFinishContext();
2880 static PyObject *__pyx_pf_16ctimeIntegration_10applyCockburnDGlimiterP1Lagrange2d(CYTHON_UNUSED PyObject *__pyx_self,
double __pyx_v_nu,
double __pyx_v_Mh2, PyArrayObject *__pyx_v_elementNeighborsArray, PyArrayObject *__pyx_v_l2g, PyArrayObject *__pyx_v_tag, PyArrayObject *__pyx_v_alphas, PyArrayObject *__pyx_v_alphaNeighbors, PyArrayObject *__pyx_v_Uin, PyArrayObject *__pyx_v_Uout) {
2881 PyObject *__pyx_r = NULL;
2882 __Pyx_RefNannyDeclarations
2883 __Pyx_RefNannySetupContext(
"applyCockburnDGlimiterP1Lagrange2d", 0);
2892 applyCockburnDGlimiterP1Lagrange2d(__pyx_v_nu, __pyx_v_Mh2, (__pyx_v_elementNeighborsArray->dimensions[0]), (__pyx_v_elementNeighborsArray->dimensions[1]), ((__pyx_v_elementNeighborsArray->dimensions[1]) - 1), (__pyx_v_l2g->dimensions[1]), ((
int *)__pyx_v_elementNeighborsArray->data), ((
int *)__pyx_v_l2g->data), ((
int *)__pyx_v_tag->data), ((
double *)__pyx_v_alphas->data), ((
int *)__pyx_v_alphaNeighbors->data), ((
double *)__pyx_v_Uin->data), ((
double *)__pyx_v_Uout->data));
2903 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
2904 __Pyx_XGIVEREF(__pyx_r);
2905 __Pyx_RefNannyFinishContext();
2918 static PyObject *__pyx_pw_16ctimeIntegration_13applyDurlofskyDGlimiterP1Lagrange2d(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
2919 static PyMethodDef __pyx_mdef_16ctimeIntegration_13applyDurlofskyDGlimiterP1Lagrange2d = {
"applyDurlofskyDGlimiterP1Lagrange2d", (PyCFunction)(
void*)(PyCFunctionWithKeywords)__pyx_pw_16ctimeIntegration_13applyDurlofskyDGlimiterP1Lagrange2d, METH_VARARGS|METH_KEYWORDS, 0};
2920 static PyObject *__pyx_pw_16ctimeIntegration_13applyDurlofskyDGlimiterP1Lagrange2d(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
2921 int __pyx_v_killExtrema;
2922 int __pyx_v_allowMinWithUndershoot;
2923 int __pyx_v_nElements_global;
2924 int __pyx_v_nElementBoundaries_element;
2925 int __pyx_v_nNodes_element;
2927 int __pyx_v_nDOF_element;
2928 PyArrayObject *__pyx_v_elementNeighborsArray = 0;
2929 PyArrayObject *__pyx_v_elementBoundariesArray = 0;
2930 PyArrayObject *__pyx_v_elementNodesArray = 0;
2931 PyArrayObject *__pyx_v_nodeArray = 0;
2932 PyArrayObject *__pyx_v_elementBarycentersArray = 0;
2933 PyArrayObject *__pyx_v_elementBoundaryBarycentersArray = 0;
2934 PyArrayObject *__pyx_v_elementNeighborShapeGradients = 0;
2935 PyArrayObject *__pyx_v_l2g = 0;
2936 PyArrayObject *__pyx_v_grad_v0 = 0;
2937 PyArrayObject *__pyx_v_elementAverages = 0;
2938 PyArrayObject *__pyx_v_tag = 0;
2939 PyArrayObject *__pyx_v_Uin = 0;
2940 PyArrayObject *__pyx_v_Uout = 0;
2941 int __pyx_lineno = 0;
2942 const char *__pyx_filename = NULL;
2943 int __pyx_clineno = 0;
2944 PyObject *__pyx_r = 0;
2945 __Pyx_RefNannyDeclarations
2946 __Pyx_RefNannySetupContext(
"applyDurlofskyDGlimiterP1Lagrange2d (wrapper)", 0);
2948 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_killExtrema,&__pyx_n_s_allowMinWithUndershoot,&__pyx_n_s_nElements_global,&__pyx_n_s_nElementBoundaries_element,&__pyx_n_s_nNodes_element,&__pyx_n_s_nSpace,&__pyx_n_s_nDOF_element,&__pyx_n_s_elementNeighborsArray,&__pyx_n_s_elementBoundariesArray,&__pyx_n_s_elementNodesArray,&__pyx_n_s_nodeArray,&__pyx_n_s_elementBarycentersArray,&__pyx_n_s_elementBoundaryBarycentersArray,&__pyx_n_s_elementNeighborShapeGradients,&__pyx_n_s_l2g,&__pyx_n_s_grad_v0,&__pyx_n_s_elementAverages,&__pyx_n_s_tag,&__pyx_n_s_Uin,&__pyx_n_s_Uout,0};
2949 PyObject* values[20] = {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0};
2950 if (unlikely(__pyx_kwds)) {
2952 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
2954 case 20: values[19] = PyTuple_GET_ITEM(__pyx_args, 19);
2956 case 19: values[18] = PyTuple_GET_ITEM(__pyx_args, 18);
2958 case 18: values[17] = PyTuple_GET_ITEM(__pyx_args, 17);
2960 case 17: values[16] = PyTuple_GET_ITEM(__pyx_args, 16);
2962 case 16: values[15] = PyTuple_GET_ITEM(__pyx_args, 15);
2964 case 15: values[14] = PyTuple_GET_ITEM(__pyx_args, 14);
2966 case 14: values[13] = PyTuple_GET_ITEM(__pyx_args, 13);
2968 case 13: values[12] = PyTuple_GET_ITEM(__pyx_args, 12);
2970 case 12: values[11] = PyTuple_GET_ITEM(__pyx_args, 11);
2972 case 11: values[10] = PyTuple_GET_ITEM(__pyx_args, 10);
2974 case 10: values[9] = PyTuple_GET_ITEM(__pyx_args, 9);
2976 case 9: values[8] = PyTuple_GET_ITEM(__pyx_args, 8);
2978 case 8: values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
2980 case 7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
2982 case 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
2984 case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
2986 case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
2988 case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
2990 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
2992 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
2995 default:
goto __pyx_L5_argtuple_error;
2997 kw_args = PyDict_Size(__pyx_kwds);
3000 if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_killExtrema)) != 0)) kw_args--;
3001 else goto __pyx_L5_argtuple_error;
3004 if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_allowMinWithUndershoot)) != 0)) kw_args--;
3006 __Pyx_RaiseArgtupleInvalid(
"applyDurlofskyDGlimiterP1Lagrange2d", 1, 20, 20, 1); __PYX_ERR(0, 272, __pyx_L3_error)
3010 if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_nElements_global)) != 0)) kw_args--;
3012 __Pyx_RaiseArgtupleInvalid(
"applyDurlofskyDGlimiterP1Lagrange2d", 1, 20, 20, 2); __PYX_ERR(0, 272, __pyx_L3_error)
3016 if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_nElementBoundaries_element)) != 0)) kw_args--;
3018 __Pyx_RaiseArgtupleInvalid(
"applyDurlofskyDGlimiterP1Lagrange2d", 1, 20, 20, 3); __PYX_ERR(0, 272, __pyx_L3_error)
3022 if (likely((values[4] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_nNodes_element)) != 0)) kw_args--;
3024 __Pyx_RaiseArgtupleInvalid(
"applyDurlofskyDGlimiterP1Lagrange2d", 1, 20, 20, 4); __PYX_ERR(0, 272, __pyx_L3_error)
3028 if (likely((values[5] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_nSpace)) != 0)) kw_args--;
3030 __Pyx_RaiseArgtupleInvalid(
"applyDurlofskyDGlimiterP1Lagrange2d", 1, 20, 20, 5); __PYX_ERR(0, 272, __pyx_L3_error)
3034 if (likely((values[6] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_nDOF_element)) != 0)) kw_args--;
3036 __Pyx_RaiseArgtupleInvalid(
"applyDurlofskyDGlimiterP1Lagrange2d", 1, 20, 20, 6); __PYX_ERR(0, 272, __pyx_L3_error)
3040 if (likely((values[7] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_elementNeighborsArray)) != 0)) kw_args--;
3042 __Pyx_RaiseArgtupleInvalid(
"applyDurlofskyDGlimiterP1Lagrange2d", 1, 20, 20, 7); __PYX_ERR(0, 272, __pyx_L3_error)
3046 if (likely((values[8] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_elementBoundariesArray)) != 0)) kw_args--;
3048 __Pyx_RaiseArgtupleInvalid(
"applyDurlofskyDGlimiterP1Lagrange2d", 1, 20, 20, 8); __PYX_ERR(0, 272, __pyx_L3_error)
3052 if (likely((values[9] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_elementNodesArray)) != 0)) kw_args--;
3054 __Pyx_RaiseArgtupleInvalid(
"applyDurlofskyDGlimiterP1Lagrange2d", 1, 20, 20, 9); __PYX_ERR(0, 272, __pyx_L3_error)
3058 if (likely((values[10] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_nodeArray)) != 0)) kw_args--;
3060 __Pyx_RaiseArgtupleInvalid(
"applyDurlofskyDGlimiterP1Lagrange2d", 1, 20, 20, 10); __PYX_ERR(0, 272, __pyx_L3_error)
3064 if (likely((values[11] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_elementBarycentersArray)) != 0)) kw_args--;
3066 __Pyx_RaiseArgtupleInvalid(
"applyDurlofskyDGlimiterP1Lagrange2d", 1, 20, 20, 11); __PYX_ERR(0, 272, __pyx_L3_error)
3070 if (likely((values[12] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_elementBoundaryBarycentersArray)) != 0)) kw_args--;
3072 __Pyx_RaiseArgtupleInvalid(
"applyDurlofskyDGlimiterP1Lagrange2d", 1, 20, 20, 12); __PYX_ERR(0, 272, __pyx_L3_error)
3076 if (likely((values[13] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_elementNeighborShapeGradients)) != 0)) kw_args--;
3078 __Pyx_RaiseArgtupleInvalid(
"applyDurlofskyDGlimiterP1Lagrange2d", 1, 20, 20, 13); __PYX_ERR(0, 272, __pyx_L3_error)
3082 if (likely((values[14] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_l2g)) != 0)) kw_args--;
3084 __Pyx_RaiseArgtupleInvalid(
"applyDurlofskyDGlimiterP1Lagrange2d", 1, 20, 20, 14); __PYX_ERR(0, 272, __pyx_L3_error)
3088 if (likely((values[15] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_grad_v0)) != 0)) kw_args--;
3090 __Pyx_RaiseArgtupleInvalid(
"applyDurlofskyDGlimiterP1Lagrange2d", 1, 20, 20, 15); __PYX_ERR(0, 272, __pyx_L3_error)
3094 if (likely((values[16] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_elementAverages)) != 0)) kw_args--;
3096 __Pyx_RaiseArgtupleInvalid(
"applyDurlofskyDGlimiterP1Lagrange2d", 1, 20, 20, 16); __PYX_ERR(0, 272, __pyx_L3_error)
3100 if (likely((values[17] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_tag)) != 0)) kw_args--;
3102 __Pyx_RaiseArgtupleInvalid(
"applyDurlofskyDGlimiterP1Lagrange2d", 1, 20, 20, 17); __PYX_ERR(0, 272, __pyx_L3_error)
3106 if (likely((values[18] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_Uin)) != 0)) kw_args--;
3108 __Pyx_RaiseArgtupleInvalid(
"applyDurlofskyDGlimiterP1Lagrange2d", 1, 20, 20, 18); __PYX_ERR(0, 272, __pyx_L3_error)
3112 if (likely((values[19] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_Uout)) != 0)) kw_args--;
3114 __Pyx_RaiseArgtupleInvalid(
"applyDurlofskyDGlimiterP1Lagrange2d", 1, 20, 20, 19); __PYX_ERR(0, 272, __pyx_L3_error)
3117 if (unlikely(kw_args > 0)) {
3118 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args,
"applyDurlofskyDGlimiterP1Lagrange2d") < 0)) __PYX_ERR(0, 272, __pyx_L3_error)
3120 }
else if (PyTuple_GET_SIZE(__pyx_args) != 20) {
3121 goto __pyx_L5_argtuple_error;
3123 values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
3124 values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
3125 values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
3126 values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
3127 values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
3128 values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
3129 values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
3130 values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
3131 values[8] = PyTuple_GET_ITEM(__pyx_args, 8);
3132 values[9] = PyTuple_GET_ITEM(__pyx_args, 9);
3133 values[10] = PyTuple_GET_ITEM(__pyx_args, 10);
3134 values[11] = PyTuple_GET_ITEM(__pyx_args, 11);
3135 values[12] = PyTuple_GET_ITEM(__pyx_args, 12);
3136 values[13] = PyTuple_GET_ITEM(__pyx_args, 13);
3137 values[14] = PyTuple_GET_ITEM(__pyx_args, 14);
3138 values[15] = PyTuple_GET_ITEM(__pyx_args, 15);
3139 values[16] = PyTuple_GET_ITEM(__pyx_args, 16);
3140 values[17] = PyTuple_GET_ITEM(__pyx_args, 17);
3141 values[18] = PyTuple_GET_ITEM(__pyx_args, 18);
3142 values[19] = PyTuple_GET_ITEM(__pyx_args, 19);
3144 __pyx_v_killExtrema = __Pyx_PyInt_As_int(values[0]);
if (unlikely((__pyx_v_killExtrema == (
int)-1) && PyErr_Occurred())) __PYX_ERR(0, 272, __pyx_L3_error)
3145 __pyx_v_allowMinWithUndershoot = __Pyx_PyInt_As_int(values[1]);
if (unlikely((__pyx_v_allowMinWithUndershoot == (
int)-1) && PyErr_Occurred())) __PYX_ERR(0, 273, __pyx_L3_error)
3146 __pyx_v_nElements_global = __Pyx_PyInt_As_int(values[2]);
if (unlikely((__pyx_v_nElements_global == (
int)-1) && PyErr_Occurred())) __PYX_ERR(0, 274, __pyx_L3_error)
3147 __pyx_v_nElementBoundaries_element = __Pyx_PyInt_As_int(values[3]);
if (unlikely((__pyx_v_nElementBoundaries_element == (
int)-1) && PyErr_Occurred())) __PYX_ERR(0, 275, __pyx_L3_error)
3148 __pyx_v_nNodes_element = __Pyx_PyInt_As_int(values[4]);
if (unlikely((__pyx_v_nNodes_element == (
int)-1) && PyErr_Occurred())) __PYX_ERR(0, 276, __pyx_L3_error)
3149 __pyx_v_nSpace = __Pyx_PyInt_As_int(values[5]);
if (unlikely((__pyx_v_nSpace == (
int)-1) && PyErr_Occurred())) __PYX_ERR(0, 277, __pyx_L3_error)
3150 __pyx_v_nDOF_element = __Pyx_PyInt_As_int(values[6]);
if (unlikely((__pyx_v_nDOF_element == (
int)-1) && PyErr_Occurred())) __PYX_ERR(0, 278, __pyx_L3_error)
3151 __pyx_v_elementNeighborsArray = ((PyArrayObject *)values[7]);
3152 __pyx_v_elementBoundariesArray = ((PyArrayObject *)values[8]);
3153 __pyx_v_elementNodesArray = ((PyArrayObject *)values[9]);
3154 __pyx_v_nodeArray = ((PyArrayObject *)values[10]);
3155 __pyx_v_elementBarycentersArray = ((PyArrayObject *)values[11]);
3156 __pyx_v_elementBoundaryBarycentersArray = ((PyArrayObject *)values[12]);
3157 __pyx_v_elementNeighborShapeGradients = ((PyArrayObject *)values[13]);
3158 __pyx_v_l2g = ((PyArrayObject *)values[14]);
3159 __pyx_v_grad_v0 = ((PyArrayObject *)values[15]);
3160 __pyx_v_elementAverages = ((PyArrayObject *)values[16]);
3161 __pyx_v_tag = ((PyArrayObject *)values[17]);
3162 __pyx_v_Uin = ((PyArrayObject *)values[18]);
3163 __pyx_v_Uout = ((PyArrayObject *)values[19]);
3165 goto __pyx_L4_argument_unpacking_done;
3166 __pyx_L5_argtuple_error:;
3167 __Pyx_RaiseArgtupleInvalid(
"applyDurlofskyDGlimiterP1Lagrange2d", 1, 20, 20, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 272, __pyx_L3_error)
3169 __Pyx_AddTraceback(
"ctimeIntegration.applyDurlofskyDGlimiterP1Lagrange2d", __pyx_clineno, __pyx_lineno, __pyx_filename);
3170 __Pyx_RefNannyFinishContext();
3172 __pyx_L4_argument_unpacking_done:;
3173 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_elementNeighborsArray), __pyx_ptype_5numpy_ndarray, 1,
"elementNeighborsArray", 0))) __PYX_ERR(0, 279, __pyx_L1_error)
3174 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_elementBoundariesArray), __pyx_ptype_5numpy_ndarray, 1,
"elementBoundariesArray", 0))) __PYX_ERR(0, 280, __pyx_L1_error)
3175 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_elementNodesArray), __pyx_ptype_5numpy_ndarray, 1,
"elementNodesArray", 0))) __PYX_ERR(0, 281, __pyx_L1_error)
3176 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_nodeArray), __pyx_ptype_5numpy_ndarray, 1,
"nodeArray", 0))) __PYX_ERR(0, 282, __pyx_L1_error)
3177 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_elementBarycentersArray), __pyx_ptype_5numpy_ndarray, 1,
"elementBarycentersArray", 0))) __PYX_ERR(0, 283, __pyx_L1_error)
3178 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_elementBoundaryBarycentersArray), __pyx_ptype_5numpy_ndarray, 1,
"elementBoundaryBarycentersArray", 0))) __PYX_ERR(0, 284, __pyx_L1_error)
3179 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_elementNeighborShapeGradients), __pyx_ptype_5numpy_ndarray, 1,
"elementNeighborShapeGradients", 0))) __PYX_ERR(0, 285, __pyx_L1_error)
3180 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_l2g), __pyx_ptype_5numpy_ndarray, 1,
"l2g", 0))) __PYX_ERR(0, 286, __pyx_L1_error)
3181 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_grad_v0), __pyx_ptype_5numpy_ndarray, 1,
"grad_v0", 0))) __PYX_ERR(0, 287, __pyx_L1_error)
3182 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_elementAverages), __pyx_ptype_5numpy_ndarray, 1,
"elementAverages", 0))) __PYX_ERR(0, 288, __pyx_L1_error)
3183 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_tag), __pyx_ptype_5numpy_ndarray, 1,
"tag", 0))) __PYX_ERR(0, 289, __pyx_L1_error)
3184 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_Uin), __pyx_ptype_5numpy_ndarray, 1,
"Uin", 0))) __PYX_ERR(0, 290, __pyx_L1_error)
3185 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_Uout), __pyx_ptype_5numpy_ndarray, 1,
"Uout", 0))) __PYX_ERR(0, 291, __pyx_L1_error)
3186 __pyx_r = __pyx_pf_16ctimeIntegration_12applyDurlofskyDGlimiterP1Lagrange2d(__pyx_self, __pyx_v_killExtrema, __pyx_v_allowMinWithUndershoot, __pyx_v_nElements_global, __pyx_v_nElementBoundaries_element, __pyx_v_nNodes_element, __pyx_v_nSpace, __pyx_v_nDOF_element, __pyx_v_elementNeighborsArray, __pyx_v_elementBoundariesArray, __pyx_v_elementNodesArray, __pyx_v_nodeArray, __pyx_v_elementBarycentersArray, __pyx_v_elementBoundaryBarycentersArray, __pyx_v_elementNeighborShapeGradients, __pyx_v_l2g, __pyx_v_grad_v0, __pyx_v_elementAverages, __pyx_v_tag, __pyx_v_Uin, __pyx_v_Uout);
3193 __Pyx_RefNannyFinishContext();
3197 static PyObject *__pyx_pf_16ctimeIntegration_12applyDurlofskyDGlimiterP1Lagrange2d(CYTHON_UNUSED PyObject *__pyx_self,
int __pyx_v_killExtrema,
int __pyx_v_allowMinWithUndershoot,
int __pyx_v_nElements_global,
int __pyx_v_nElementBoundaries_element,
int __pyx_v_nNodes_element,
int __pyx_v_nSpace,
int __pyx_v_nDOF_element, PyArrayObject *__pyx_v_elementNeighborsArray, PyArrayObject *__pyx_v_elementBoundariesArray, PyArrayObject *__pyx_v_elementNodesArray, PyArrayObject *__pyx_v_nodeArray, PyArrayObject *__pyx_v_elementBarycentersArray, PyArrayObject *__pyx_v_elementBoundaryBarycentersArray, PyArrayObject *__pyx_v_elementNeighborShapeGradients, PyArrayObject *__pyx_v_l2g, PyArrayObject *__pyx_v_grad_v0, PyArrayObject *__pyx_v_elementAverages, PyArrayObject *__pyx_v_tag, PyArrayObject *__pyx_v_Uin, PyArrayObject *__pyx_v_Uout) {
3198 PyObject *__pyx_r = NULL;
3199 __Pyx_RefNannyDeclarations
3200 __Pyx_RefNannySetupContext(
"applyDurlofskyDGlimiterP1Lagrange2d", 0);
3209 applyDurlofskyDGlimiterP1Lagrange2d(__pyx_v_killExtrema, __pyx_v_allowMinWithUndershoot, __pyx_v_nElements_global, __pyx_v_nElementBoundaries_element, __pyx_v_nNodes_element, __pyx_v_nSpace, __pyx_v_nDOF_element, ((
int *)__pyx_v_elementNeighborsArray->data), ((
int *)__pyx_v_elementBoundariesArray->data), ((
int *)__pyx_v_elementNodesArray->data), ((
double *)__pyx_v_nodeArray->data), ((
double *)__pyx_v_elementBarycentersArray->data), ((
double *)__pyx_v_elementBoundaryBarycentersArray->data), ((
double *)__pyx_v_elementNeighborShapeGradients->data), ((
int *)__pyx_v_l2g->data), ((
double *)__pyx_v_grad_v0->data), ((
double *)__pyx_v_elementAverages->data), ((
int *)__pyx_v_tag->data), ((
double *)__pyx_v_Uin->data), ((
double *)__pyx_v_Uout->data));
3220 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
3221 __Pyx_XGIVEREF(__pyx_r);
3222 __Pyx_RefNannyFinishContext();
3235 static PyObject *__pyx_pw_16ctimeIntegration_15applyDurlofskyDGlimiterP1Lagrange3d(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
3236 static PyMethodDef __pyx_mdef_16ctimeIntegration_15applyDurlofskyDGlimiterP1Lagrange3d = {
"applyDurlofskyDGlimiterP1Lagrange3d", (PyCFunction)(
void*)(PyCFunctionWithKeywords)__pyx_pw_16ctimeIntegration_15applyDurlofskyDGlimiterP1Lagrange3d, METH_VARARGS|METH_KEYWORDS, 0};
3237 static PyObject *__pyx_pw_16ctimeIntegration_15applyDurlofskyDGlimiterP1Lagrange3d(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
3238 int __pyx_v_killExtrema;
3239 int __pyx_v_allowMinWithUndershoot;
3240 int __pyx_v_nElements_global;
3241 int __pyx_v_nElementBoundaries_element;
3242 int __pyx_v_nNodes_element;
3244 int __pyx_v_nDOF_element;
3245 PyArrayObject *__pyx_v_elementNeighborsArray = 0;
3246 PyArrayObject *__pyx_v_elementBoundariesArray = 0;
3247 PyArrayObject *__pyx_v_elementNodesArray = 0;
3248 PyArrayObject *__pyx_v_nodeArray = 0;
3249 PyArrayObject *__pyx_v_elementBarycentersArray = 0;
3250 PyArrayObject *__pyx_v_elementBoundaryBarycentersArray = 0;
3251 PyArrayObject *__pyx_v_elementNeighborShapeGradients = 0;
3252 PyArrayObject *__pyx_v_l2g = 0;
3253 PyArrayObject *__pyx_v_grad_v0 = 0;
3254 PyArrayObject *__pyx_v_elementAverages = 0;
3255 PyArrayObject *__pyx_v_tag = 0;
3256 PyArrayObject *__pyx_v_Uin = 0;
3257 PyArrayObject *__pyx_v_Uout = 0;
3258 int __pyx_lineno = 0;
3259 const char *__pyx_filename = NULL;
3260 int __pyx_clineno = 0;
3261 PyObject *__pyx_r = 0;
3262 __Pyx_RefNannyDeclarations
3263 __Pyx_RefNannySetupContext(
"applyDurlofskyDGlimiterP1Lagrange3d (wrapper)", 0);
3265 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_killExtrema,&__pyx_n_s_allowMinWithUndershoot,&__pyx_n_s_nElements_global,&__pyx_n_s_nElementBoundaries_element,&__pyx_n_s_nNodes_element,&__pyx_n_s_nSpace,&__pyx_n_s_nDOF_element,&__pyx_n_s_elementNeighborsArray,&__pyx_n_s_elementBoundariesArray,&__pyx_n_s_elementNodesArray,&__pyx_n_s_nodeArray,&__pyx_n_s_elementBarycentersArray,&__pyx_n_s_elementBoundaryBarycentersArray,&__pyx_n_s_elementNeighborShapeGradients,&__pyx_n_s_l2g,&__pyx_n_s_grad_v0,&__pyx_n_s_elementAverages,&__pyx_n_s_tag,&__pyx_n_s_Uin,&__pyx_n_s_Uout,0};
3266 PyObject* values[20] = {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0};
3267 if (unlikely(__pyx_kwds)) {
3269 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
3271 case 20: values[19] = PyTuple_GET_ITEM(__pyx_args, 19);
3273 case 19: values[18] = PyTuple_GET_ITEM(__pyx_args, 18);
3275 case 18: values[17] = PyTuple_GET_ITEM(__pyx_args, 17);
3277 case 17: values[16] = PyTuple_GET_ITEM(__pyx_args, 16);
3279 case 16: values[15] = PyTuple_GET_ITEM(__pyx_args, 15);
3281 case 15: values[14] = PyTuple_GET_ITEM(__pyx_args, 14);
3283 case 14: values[13] = PyTuple_GET_ITEM(__pyx_args, 13);
3285 case 13: values[12] = PyTuple_GET_ITEM(__pyx_args, 12);
3287 case 12: values[11] = PyTuple_GET_ITEM(__pyx_args, 11);
3289 case 11: values[10] = PyTuple_GET_ITEM(__pyx_args, 10);
3291 case 10: values[9] = PyTuple_GET_ITEM(__pyx_args, 9);
3293 case 9: values[8] = PyTuple_GET_ITEM(__pyx_args, 8);
3295 case 8: values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
3297 case 7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
3299 case 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
3301 case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
3303 case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
3305 case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
3307 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
3309 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
3312 default:
goto __pyx_L5_argtuple_error;
3314 kw_args = PyDict_Size(__pyx_kwds);
3317 if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_killExtrema)) != 0)) kw_args--;
3318 else goto __pyx_L5_argtuple_error;
3321 if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_allowMinWithUndershoot)) != 0)) kw_args--;
3323 __Pyx_RaiseArgtupleInvalid(
"applyDurlofskyDGlimiterP1Lagrange3d", 1, 20, 20, 1); __PYX_ERR(0, 313, __pyx_L3_error)
3327 if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_nElements_global)) != 0)) kw_args--;
3329 __Pyx_RaiseArgtupleInvalid(
"applyDurlofskyDGlimiterP1Lagrange3d", 1, 20, 20, 2); __PYX_ERR(0, 313, __pyx_L3_error)
3333 if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_nElementBoundaries_element)) != 0)) kw_args--;
3335 __Pyx_RaiseArgtupleInvalid(
"applyDurlofskyDGlimiterP1Lagrange3d", 1, 20, 20, 3); __PYX_ERR(0, 313, __pyx_L3_error)
3339 if (likely((values[4] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_nNodes_element)) != 0)) kw_args--;
3341 __Pyx_RaiseArgtupleInvalid(
"applyDurlofskyDGlimiterP1Lagrange3d", 1, 20, 20, 4); __PYX_ERR(0, 313, __pyx_L3_error)
3345 if (likely((values[5] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_nSpace)) != 0)) kw_args--;
3347 __Pyx_RaiseArgtupleInvalid(
"applyDurlofskyDGlimiterP1Lagrange3d", 1, 20, 20, 5); __PYX_ERR(0, 313, __pyx_L3_error)
3351 if (likely((values[6] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_nDOF_element)) != 0)) kw_args--;
3353 __Pyx_RaiseArgtupleInvalid(
"applyDurlofskyDGlimiterP1Lagrange3d", 1, 20, 20, 6); __PYX_ERR(0, 313, __pyx_L3_error)
3357 if (likely((values[7] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_elementNeighborsArray)) != 0)) kw_args--;
3359 __Pyx_RaiseArgtupleInvalid(
"applyDurlofskyDGlimiterP1Lagrange3d", 1, 20, 20, 7); __PYX_ERR(0, 313, __pyx_L3_error)
3363 if (likely((values[8] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_elementBoundariesArray)) != 0)) kw_args--;
3365 __Pyx_RaiseArgtupleInvalid(
"applyDurlofskyDGlimiterP1Lagrange3d", 1, 20, 20, 8); __PYX_ERR(0, 313, __pyx_L3_error)
3369 if (likely((values[9] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_elementNodesArray)) != 0)) kw_args--;
3371 __Pyx_RaiseArgtupleInvalid(
"applyDurlofskyDGlimiterP1Lagrange3d", 1, 20, 20, 9); __PYX_ERR(0, 313, __pyx_L3_error)
3375 if (likely((values[10] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_nodeArray)) != 0)) kw_args--;
3377 __Pyx_RaiseArgtupleInvalid(
"applyDurlofskyDGlimiterP1Lagrange3d", 1, 20, 20, 10); __PYX_ERR(0, 313, __pyx_L3_error)
3381 if (likely((values[11] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_elementBarycentersArray)) != 0)) kw_args--;
3383 __Pyx_RaiseArgtupleInvalid(
"applyDurlofskyDGlimiterP1Lagrange3d", 1, 20, 20, 11); __PYX_ERR(0, 313, __pyx_L3_error)
3387 if (likely((values[12] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_elementBoundaryBarycentersArray)) != 0)) kw_args--;
3389 __Pyx_RaiseArgtupleInvalid(
"applyDurlofskyDGlimiterP1Lagrange3d", 1, 20, 20, 12); __PYX_ERR(0, 313, __pyx_L3_error)
3393 if (likely((values[13] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_elementNeighborShapeGradients)) != 0)) kw_args--;
3395 __Pyx_RaiseArgtupleInvalid(
"applyDurlofskyDGlimiterP1Lagrange3d", 1, 20, 20, 13); __PYX_ERR(0, 313, __pyx_L3_error)
3399 if (likely((values[14] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_l2g)) != 0)) kw_args--;
3401 __Pyx_RaiseArgtupleInvalid(
"applyDurlofskyDGlimiterP1Lagrange3d", 1, 20, 20, 14); __PYX_ERR(0, 313, __pyx_L3_error)
3405 if (likely((values[15] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_grad_v0)) != 0)) kw_args--;
3407 __Pyx_RaiseArgtupleInvalid(
"applyDurlofskyDGlimiterP1Lagrange3d", 1, 20, 20, 15); __PYX_ERR(0, 313, __pyx_L3_error)
3411 if (likely((values[16] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_elementAverages)) != 0)) kw_args--;
3413 __Pyx_RaiseArgtupleInvalid(
"applyDurlofskyDGlimiterP1Lagrange3d", 1, 20, 20, 16); __PYX_ERR(0, 313, __pyx_L3_error)
3417 if (likely((values[17] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_tag)) != 0)) kw_args--;
3419 __Pyx_RaiseArgtupleInvalid(
"applyDurlofskyDGlimiterP1Lagrange3d", 1, 20, 20, 17); __PYX_ERR(0, 313, __pyx_L3_error)
3423 if (likely((values[18] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_Uin)) != 0)) kw_args--;
3425 __Pyx_RaiseArgtupleInvalid(
"applyDurlofskyDGlimiterP1Lagrange3d", 1, 20, 20, 18); __PYX_ERR(0, 313, __pyx_L3_error)
3429 if (likely((values[19] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_Uout)) != 0)) kw_args--;
3431 __Pyx_RaiseArgtupleInvalid(
"applyDurlofskyDGlimiterP1Lagrange3d", 1, 20, 20, 19); __PYX_ERR(0, 313, __pyx_L3_error)
3434 if (unlikely(kw_args > 0)) {
3435 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args,
"applyDurlofskyDGlimiterP1Lagrange3d") < 0)) __PYX_ERR(0, 313, __pyx_L3_error)
3437 }
else if (PyTuple_GET_SIZE(__pyx_args) != 20) {
3438 goto __pyx_L5_argtuple_error;
3440 values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
3441 values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
3442 values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
3443 values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
3444 values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
3445 values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
3446 values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
3447 values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
3448 values[8] = PyTuple_GET_ITEM(__pyx_args, 8);
3449 values[9] = PyTuple_GET_ITEM(__pyx_args, 9);
3450 values[10] = PyTuple_GET_ITEM(__pyx_args, 10);
3451 values[11] = PyTuple_GET_ITEM(__pyx_args, 11);
3452 values[12] = PyTuple_GET_ITEM(__pyx_args, 12);
3453 values[13] = PyTuple_GET_ITEM(__pyx_args, 13);
3454 values[14] = PyTuple_GET_ITEM(__pyx_args, 14);
3455 values[15] = PyTuple_GET_ITEM(__pyx_args, 15);
3456 values[16] = PyTuple_GET_ITEM(__pyx_args, 16);
3457 values[17] = PyTuple_GET_ITEM(__pyx_args, 17);
3458 values[18] = PyTuple_GET_ITEM(__pyx_args, 18);
3459 values[19] = PyTuple_GET_ITEM(__pyx_args, 19);
3461 __pyx_v_killExtrema = __Pyx_PyInt_As_int(values[0]);
if (unlikely((__pyx_v_killExtrema == (
int)-1) && PyErr_Occurred())) __PYX_ERR(0, 313, __pyx_L3_error)
3462 __pyx_v_allowMinWithUndershoot = __Pyx_PyInt_As_int(values[1]);
if (unlikely((__pyx_v_allowMinWithUndershoot == (
int)-1) && PyErr_Occurred())) __PYX_ERR(0, 314, __pyx_L3_error)
3463 __pyx_v_nElements_global = __Pyx_PyInt_As_int(values[2]);
if (unlikely((__pyx_v_nElements_global == (
int)-1) && PyErr_Occurred())) __PYX_ERR(0, 315, __pyx_L3_error)
3464 __pyx_v_nElementBoundaries_element = __Pyx_PyInt_As_int(values[3]);
if (unlikely((__pyx_v_nElementBoundaries_element == (
int)-1) && PyErr_Occurred())) __PYX_ERR(0, 316, __pyx_L3_error)
3465 __pyx_v_nNodes_element = __Pyx_PyInt_As_int(values[4]);
if (unlikely((__pyx_v_nNodes_element == (
int)-1) && PyErr_Occurred())) __PYX_ERR(0, 317, __pyx_L3_error)
3466 __pyx_v_nSpace = __Pyx_PyInt_As_int(values[5]);
if (unlikely((__pyx_v_nSpace == (
int)-1) && PyErr_Occurred())) __PYX_ERR(0, 318, __pyx_L3_error)
3467 __pyx_v_nDOF_element = __Pyx_PyInt_As_int(values[6]);
if (unlikely((__pyx_v_nDOF_element == (
int)-1) && PyErr_Occurred())) __PYX_ERR(0, 319, __pyx_L3_error)
3468 __pyx_v_elementNeighborsArray = ((PyArrayObject *)values[7]);
3469 __pyx_v_elementBoundariesArray = ((PyArrayObject *)values[8]);
3470 __pyx_v_elementNodesArray = ((PyArrayObject *)values[9]);
3471 __pyx_v_nodeArray = ((PyArrayObject *)values[10]);
3472 __pyx_v_elementBarycentersArray = ((PyArrayObject *)values[11]);
3473 __pyx_v_elementBoundaryBarycentersArray = ((PyArrayObject *)values[12]);
3474 __pyx_v_elementNeighborShapeGradients = ((PyArrayObject *)values[13]);
3475 __pyx_v_l2g = ((PyArrayObject *)values[14]);
3476 __pyx_v_grad_v0 = ((PyArrayObject *)values[15]);
3477 __pyx_v_elementAverages = ((PyArrayObject *)values[16]);
3478 __pyx_v_tag = ((PyArrayObject *)values[17]);
3479 __pyx_v_Uin = ((PyArrayObject *)values[18]);
3480 __pyx_v_Uout = ((PyArrayObject *)values[19]);
3482 goto __pyx_L4_argument_unpacking_done;
3483 __pyx_L5_argtuple_error:;
3484 __Pyx_RaiseArgtupleInvalid(
"applyDurlofskyDGlimiterP1Lagrange3d", 1, 20, 20, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 313, __pyx_L3_error)
3486 __Pyx_AddTraceback(
"ctimeIntegration.applyDurlofskyDGlimiterP1Lagrange3d", __pyx_clineno, __pyx_lineno, __pyx_filename);
3487 __Pyx_RefNannyFinishContext();
3489 __pyx_L4_argument_unpacking_done:;
3490 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_elementNeighborsArray), __pyx_ptype_5numpy_ndarray, 1,
"elementNeighborsArray", 0))) __PYX_ERR(0, 320, __pyx_L1_error)
3491 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_elementBoundariesArray), __pyx_ptype_5numpy_ndarray, 1,
"elementBoundariesArray", 0))) __PYX_ERR(0, 321, __pyx_L1_error)
3492 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_elementNodesArray), __pyx_ptype_5numpy_ndarray, 1,
"elementNodesArray", 0))) __PYX_ERR(0, 322, __pyx_L1_error)
3493 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_nodeArray), __pyx_ptype_5numpy_ndarray, 1,
"nodeArray", 0))) __PYX_ERR(0, 323, __pyx_L1_error)
3494 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_elementBarycentersArray), __pyx_ptype_5numpy_ndarray, 1,
"elementBarycentersArray", 0))) __PYX_ERR(0, 324, __pyx_L1_error)
3495 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_elementBoundaryBarycentersArray), __pyx_ptype_5numpy_ndarray, 1,
"elementBoundaryBarycentersArray", 0))) __PYX_ERR(0, 325, __pyx_L1_error)
3496 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_elementNeighborShapeGradients), __pyx_ptype_5numpy_ndarray, 1,
"elementNeighborShapeGradients", 0))) __PYX_ERR(0, 326, __pyx_L1_error)
3497 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_l2g), __pyx_ptype_5numpy_ndarray, 1,
"l2g", 0))) __PYX_ERR(0, 327, __pyx_L1_error)
3498 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_grad_v0), __pyx_ptype_5numpy_ndarray, 1,
"grad_v0", 0))) __PYX_ERR(0, 328, __pyx_L1_error)
3499 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_elementAverages), __pyx_ptype_5numpy_ndarray, 1,
"elementAverages", 0))) __PYX_ERR(0, 329, __pyx_L1_error)
3500 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_tag), __pyx_ptype_5numpy_ndarray, 1,
"tag", 0))) __PYX_ERR(0, 330, __pyx_L1_error)
3501 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_Uin), __pyx_ptype_5numpy_ndarray, 1,
"Uin", 0))) __PYX_ERR(0, 331, __pyx_L1_error)
3502 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_Uout), __pyx_ptype_5numpy_ndarray, 1,
"Uout", 0))) __PYX_ERR(0, 332, __pyx_L1_error)
3503 __pyx_r = __pyx_pf_16ctimeIntegration_14applyDurlofskyDGlimiterP1Lagrange3d(__pyx_self, __pyx_v_killExtrema, __pyx_v_allowMinWithUndershoot, __pyx_v_nElements_global, __pyx_v_nElementBoundaries_element, __pyx_v_nNodes_element, __pyx_v_nSpace, __pyx_v_nDOF_element, __pyx_v_elementNeighborsArray, __pyx_v_elementBoundariesArray, __pyx_v_elementNodesArray, __pyx_v_nodeArray, __pyx_v_elementBarycentersArray, __pyx_v_elementBoundaryBarycentersArray, __pyx_v_elementNeighborShapeGradients, __pyx_v_l2g, __pyx_v_grad_v0, __pyx_v_elementAverages, __pyx_v_tag, __pyx_v_Uin, __pyx_v_Uout);
3510 __Pyx_RefNannyFinishContext();
3514 static PyObject *__pyx_pf_16ctimeIntegration_14applyDurlofskyDGlimiterP1Lagrange3d(CYTHON_UNUSED PyObject *__pyx_self,
int __pyx_v_killExtrema,
int __pyx_v_allowMinWithUndershoot,
int __pyx_v_nElements_global,
int __pyx_v_nElementBoundaries_element,
int __pyx_v_nNodes_element,
int __pyx_v_nSpace,
int __pyx_v_nDOF_element, PyArrayObject *__pyx_v_elementNeighborsArray, PyArrayObject *__pyx_v_elementBoundariesArray, PyArrayObject *__pyx_v_elementNodesArray, PyArrayObject *__pyx_v_nodeArray, PyArrayObject *__pyx_v_elementBarycentersArray, PyArrayObject *__pyx_v_elementBoundaryBarycentersArray, PyArrayObject *__pyx_v_elementNeighborShapeGradients, PyArrayObject *__pyx_v_l2g, PyArrayObject *__pyx_v_grad_v0, PyArrayObject *__pyx_v_elementAverages, PyArrayObject *__pyx_v_tag, PyArrayObject *__pyx_v_Uin, PyArrayObject *__pyx_v_Uout) {
3515 PyObject *__pyx_r = NULL;
3516 __Pyx_RefNannyDeclarations
3517 __Pyx_RefNannySetupContext(
"applyDurlofskyDGlimiterP1Lagrange3d", 0);
3526 applyDurlofskyDGlimiterP1Lagrange3d(__pyx_v_killExtrema, __pyx_v_allowMinWithUndershoot, __pyx_v_nElements_global, __pyx_v_nElementBoundaries_element, __pyx_v_nNodes_element, __pyx_v_nSpace, __pyx_v_nDOF_element, ((
int *)__pyx_v_elementNeighborsArray->data), ((
int *)__pyx_v_elementBoundariesArray->data), ((
int *)__pyx_v_elementNodesArray->data), ((
double *)__pyx_v_nodeArray->data), ((
double *)__pyx_v_elementBarycentersArray->data), ((
double *)__pyx_v_elementBoundaryBarycentersArray->data), ((
double *)__pyx_v_elementNeighborShapeGradients->data), ((
int *)__pyx_v_l2g->data), ((
double *)__pyx_v_grad_v0->data), ((
double *)__pyx_v_elementAverages->data), ((
int *)__pyx_v_tag->data), ((
double *)__pyx_v_Uin->data), ((
double *)__pyx_v_Uout->data));
3537 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
3538 __Pyx_XGIVEREF(__pyx_r);
3539 __Pyx_RefNannyFinishContext();
3552 static PyObject *__pyx_pw_16ctimeIntegration_17applyDurlofskyDGlimiterP1Lagrange2d_withVacuumTol(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
3553 static PyMethodDef __pyx_mdef_16ctimeIntegration_17applyDurlofskyDGlimiterP1Lagrange2d_withVacuumTol = {
"applyDurlofskyDGlimiterP1Lagrange2d_withVacuumTol", (PyCFunction)(
void*)(PyCFunctionWithKeywords)__pyx_pw_16ctimeIntegration_17applyDurlofskyDGlimiterP1Lagrange2d_withVacuumTol, METH_VARARGS|METH_KEYWORDS, 0};
3554 static PyObject *__pyx_pw_16ctimeIntegration_17applyDurlofskyDGlimiterP1Lagrange2d_withVacuumTol(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
3555 int __pyx_v_killExtrema;
3556 int __pyx_v_allowMinWithUndershoot;
3557 int __pyx_v_enforcePositivity;
3558 double __pyx_v_vacuumTol;
3559 int __pyx_v_nElements_global;
3560 int __pyx_v_nElementBoundaries_element;
3561 int __pyx_v_nNodes_element;
3563 int __pyx_v_nDOF_element;
3564 PyArrayObject *__pyx_v_elementNeighborsArray = 0;
3565 PyArrayObject *__pyx_v_elementBoundariesArray = 0;
3566 PyArrayObject *__pyx_v_elementNodesArray = 0;
3567 PyArrayObject *__pyx_v_nodeArray = 0;
3568 PyArrayObject *__pyx_v_elementBarycentersArray = 0;
3569 PyArrayObject *__pyx_v_elementBoundaryBarycentersArray = 0;
3570 PyArrayObject *__pyx_v_elementNeighborShapeGradients = 0;
3571 PyArrayObject *__pyx_v_l2g = 0;
3572 PyArrayObject *__pyx_v_grad_v0 = 0;
3573 PyArrayObject *__pyx_v_elementAverages = 0;
3574 PyArrayObject *__pyx_v_tag = 0;
3575 PyArrayObject *__pyx_v_Uin = 0;
3576 PyArrayObject *__pyx_v_Uout = 0;
3577 int __pyx_lineno = 0;
3578 const char *__pyx_filename = NULL;
3579 int __pyx_clineno = 0;
3580 PyObject *__pyx_r = 0;
3581 __Pyx_RefNannyDeclarations
3582 __Pyx_RefNannySetupContext(
"applyDurlofskyDGlimiterP1Lagrange2d_withVacuumTol (wrapper)", 0);
3584 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_killExtrema,&__pyx_n_s_allowMinWithUndershoot,&__pyx_n_s_enforcePositivity,&__pyx_n_s_vacuumTol,&__pyx_n_s_nElements_global,&__pyx_n_s_nElementBoundaries_element,&__pyx_n_s_nNodes_element,&__pyx_n_s_nSpace,&__pyx_n_s_nDOF_element,&__pyx_n_s_elementNeighborsArray,&__pyx_n_s_elementBoundariesArray,&__pyx_n_s_elementNodesArray,&__pyx_n_s_nodeArray,&__pyx_n_s_elementBarycentersArray,&__pyx_n_s_elementBoundaryBarycentersArray,&__pyx_n_s_elementNeighborShapeGradients,&__pyx_n_s_l2g,&__pyx_n_s_grad_v0,&__pyx_n_s_elementAverages,&__pyx_n_s_tag,&__pyx_n_s_Uin,&__pyx_n_s_Uout,0};
3585 PyObject* values[22] = {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0};
3586 if (unlikely(__pyx_kwds)) {
3588 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
3590 case 22: values[21] = PyTuple_GET_ITEM(__pyx_args, 21);
3592 case 21: values[20] = PyTuple_GET_ITEM(__pyx_args, 20);
3594 case 20: values[19] = PyTuple_GET_ITEM(__pyx_args, 19);
3596 case 19: values[18] = PyTuple_GET_ITEM(__pyx_args, 18);
3598 case 18: values[17] = PyTuple_GET_ITEM(__pyx_args, 17);
3600 case 17: values[16] = PyTuple_GET_ITEM(__pyx_args, 16);
3602 case 16: values[15] = PyTuple_GET_ITEM(__pyx_args, 15);
3604 case 15: values[14] = PyTuple_GET_ITEM(__pyx_args, 14);
3606 case 14: values[13] = PyTuple_GET_ITEM(__pyx_args, 13);
3608 case 13: values[12] = PyTuple_GET_ITEM(__pyx_args, 12);
3610 case 12: values[11] = PyTuple_GET_ITEM(__pyx_args, 11);
3612 case 11: values[10] = PyTuple_GET_ITEM(__pyx_args, 10);
3614 case 10: values[9] = PyTuple_GET_ITEM(__pyx_args, 9);
3616 case 9: values[8] = PyTuple_GET_ITEM(__pyx_args, 8);
3618 case 8: values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
3620 case 7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
3622 case 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
3624 case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
3626 case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
3628 case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
3630 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
3632 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
3635 default:
goto __pyx_L5_argtuple_error;
3637 kw_args = PyDict_Size(__pyx_kwds);
3640 if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_killExtrema)) != 0)) kw_args--;
3641 else goto __pyx_L5_argtuple_error;
3644 if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_allowMinWithUndershoot)) != 0)) kw_args--;
3646 __Pyx_RaiseArgtupleInvalid(
"applyDurlofskyDGlimiterP1Lagrange2d_withVacuumTol", 1, 22, 22, 1); __PYX_ERR(0, 354, __pyx_L3_error)
3650 if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_enforcePositivity)) != 0)) kw_args--;
3652 __Pyx_RaiseArgtupleInvalid(
"applyDurlofskyDGlimiterP1Lagrange2d_withVacuumTol", 1, 22, 22, 2); __PYX_ERR(0, 354, __pyx_L3_error)
3656 if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_vacuumTol)) != 0)) kw_args--;
3658 __Pyx_RaiseArgtupleInvalid(
"applyDurlofskyDGlimiterP1Lagrange2d_withVacuumTol", 1, 22, 22, 3); __PYX_ERR(0, 354, __pyx_L3_error)
3662 if (likely((values[4] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_nElements_global)) != 0)) kw_args--;
3664 __Pyx_RaiseArgtupleInvalid(
"applyDurlofskyDGlimiterP1Lagrange2d_withVacuumTol", 1, 22, 22, 4); __PYX_ERR(0, 354, __pyx_L3_error)
3668 if (likely((values[5] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_nElementBoundaries_element)) != 0)) kw_args--;
3670 __Pyx_RaiseArgtupleInvalid(
"applyDurlofskyDGlimiterP1Lagrange2d_withVacuumTol", 1, 22, 22, 5); __PYX_ERR(0, 354, __pyx_L3_error)
3674 if (likely((values[6] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_nNodes_element)) != 0)) kw_args--;
3676 __Pyx_RaiseArgtupleInvalid(
"applyDurlofskyDGlimiterP1Lagrange2d_withVacuumTol", 1, 22, 22, 6); __PYX_ERR(0, 354, __pyx_L3_error)
3680 if (likely((values[7] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_nSpace)) != 0)) kw_args--;
3682 __Pyx_RaiseArgtupleInvalid(
"applyDurlofskyDGlimiterP1Lagrange2d_withVacuumTol", 1, 22, 22, 7); __PYX_ERR(0, 354, __pyx_L3_error)
3686 if (likely((values[8] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_nDOF_element)) != 0)) kw_args--;
3688 __Pyx_RaiseArgtupleInvalid(
"applyDurlofskyDGlimiterP1Lagrange2d_withVacuumTol", 1, 22, 22, 8); __PYX_ERR(0, 354, __pyx_L3_error)
3692 if (likely((values[9] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_elementNeighborsArray)) != 0)) kw_args--;
3694 __Pyx_RaiseArgtupleInvalid(
"applyDurlofskyDGlimiterP1Lagrange2d_withVacuumTol", 1, 22, 22, 9); __PYX_ERR(0, 354, __pyx_L3_error)
3698 if (likely((values[10] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_elementBoundariesArray)) != 0)) kw_args--;
3700 __Pyx_RaiseArgtupleInvalid(
"applyDurlofskyDGlimiterP1Lagrange2d_withVacuumTol", 1, 22, 22, 10); __PYX_ERR(0, 354, __pyx_L3_error)
3704 if (likely((values[11] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_elementNodesArray)) != 0)) kw_args--;
3706 __Pyx_RaiseArgtupleInvalid(
"applyDurlofskyDGlimiterP1Lagrange2d_withVacuumTol", 1, 22, 22, 11); __PYX_ERR(0, 354, __pyx_L3_error)
3710 if (likely((values[12] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_nodeArray)) != 0)) kw_args--;
3712 __Pyx_RaiseArgtupleInvalid(
"applyDurlofskyDGlimiterP1Lagrange2d_withVacuumTol", 1, 22, 22, 12); __PYX_ERR(0, 354, __pyx_L3_error)
3716 if (likely((values[13] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_elementBarycentersArray)) != 0)) kw_args--;
3718 __Pyx_RaiseArgtupleInvalid(
"applyDurlofskyDGlimiterP1Lagrange2d_withVacuumTol", 1, 22, 22, 13); __PYX_ERR(0, 354, __pyx_L3_error)
3722 if (likely((values[14] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_elementBoundaryBarycentersArray)) != 0)) kw_args--;
3724 __Pyx_RaiseArgtupleInvalid(
"applyDurlofskyDGlimiterP1Lagrange2d_withVacuumTol", 1, 22, 22, 14); __PYX_ERR(0, 354, __pyx_L3_error)
3728 if (likely((values[15] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_elementNeighborShapeGradients)) != 0)) kw_args--;
3730 __Pyx_RaiseArgtupleInvalid(
"applyDurlofskyDGlimiterP1Lagrange2d_withVacuumTol", 1, 22, 22, 15); __PYX_ERR(0, 354, __pyx_L3_error)
3734 if (likely((values[16] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_l2g)) != 0)) kw_args--;
3736 __Pyx_RaiseArgtupleInvalid(
"applyDurlofskyDGlimiterP1Lagrange2d_withVacuumTol", 1, 22, 22, 16); __PYX_ERR(0, 354, __pyx_L3_error)
3740 if (likely((values[17] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_grad_v0)) != 0)) kw_args--;
3742 __Pyx_RaiseArgtupleInvalid(
"applyDurlofskyDGlimiterP1Lagrange2d_withVacuumTol", 1, 22, 22, 17); __PYX_ERR(0, 354, __pyx_L3_error)
3746 if (likely((values[18] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_elementAverages)) != 0)) kw_args--;
3748 __Pyx_RaiseArgtupleInvalid(
"applyDurlofskyDGlimiterP1Lagrange2d_withVacuumTol", 1, 22, 22, 18); __PYX_ERR(0, 354, __pyx_L3_error)
3752 if (likely((values[19] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_tag)) != 0)) kw_args--;
3754 __Pyx_RaiseArgtupleInvalid(
"applyDurlofskyDGlimiterP1Lagrange2d_withVacuumTol", 1, 22, 22, 19); __PYX_ERR(0, 354, __pyx_L3_error)
3758 if (likely((values[20] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_Uin)) != 0)) kw_args--;
3760 __Pyx_RaiseArgtupleInvalid(
"applyDurlofskyDGlimiterP1Lagrange2d_withVacuumTol", 1, 22, 22, 20); __PYX_ERR(0, 354, __pyx_L3_error)
3764 if (likely((values[21] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_Uout)) != 0)) kw_args--;
3766 __Pyx_RaiseArgtupleInvalid(
"applyDurlofskyDGlimiterP1Lagrange2d_withVacuumTol", 1, 22, 22, 21); __PYX_ERR(0, 354, __pyx_L3_error)
3769 if (unlikely(kw_args > 0)) {
3770 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args,
"applyDurlofskyDGlimiterP1Lagrange2d_withVacuumTol") < 0)) __PYX_ERR(0, 354, __pyx_L3_error)
3772 }
else if (PyTuple_GET_SIZE(__pyx_args) != 22) {
3773 goto __pyx_L5_argtuple_error;
3775 values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
3776 values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
3777 values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
3778 values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
3779 values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
3780 values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
3781 values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
3782 values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
3783 values[8] = PyTuple_GET_ITEM(__pyx_args, 8);
3784 values[9] = PyTuple_GET_ITEM(__pyx_args, 9);
3785 values[10] = PyTuple_GET_ITEM(__pyx_args, 10);
3786 values[11] = PyTuple_GET_ITEM(__pyx_args, 11);
3787 values[12] = PyTuple_GET_ITEM(__pyx_args, 12);
3788 values[13] = PyTuple_GET_ITEM(__pyx_args, 13);
3789 values[14] = PyTuple_GET_ITEM(__pyx_args, 14);
3790 values[15] = PyTuple_GET_ITEM(__pyx_args, 15);
3791 values[16] = PyTuple_GET_ITEM(__pyx_args, 16);
3792 values[17] = PyTuple_GET_ITEM(__pyx_args, 17);
3793 values[18] = PyTuple_GET_ITEM(__pyx_args, 18);
3794 values[19] = PyTuple_GET_ITEM(__pyx_args, 19);
3795 values[20] = PyTuple_GET_ITEM(__pyx_args, 20);
3796 values[21] = PyTuple_GET_ITEM(__pyx_args, 21);
3798 __pyx_v_killExtrema = __Pyx_PyInt_As_int(values[0]);
if (unlikely((__pyx_v_killExtrema == (
int)-1) && PyErr_Occurred())) __PYX_ERR(0, 354, __pyx_L3_error)
3799 __pyx_v_allowMinWithUndershoot = __Pyx_PyInt_As_int(values[1]);
if (unlikely((__pyx_v_allowMinWithUndershoot == (
int)-1) && PyErr_Occurred())) __PYX_ERR(0, 355, __pyx_L3_error)
3800 __pyx_v_enforcePositivity = __Pyx_PyInt_As_int(values[2]);
if (unlikely((__pyx_v_enforcePositivity == (
int)-1) && PyErr_Occurred())) __PYX_ERR(0, 356, __pyx_L3_error)
3801 __pyx_v_vacuumTol = __pyx_PyFloat_AsDouble(values[3]);
if (unlikely((__pyx_v_vacuumTol == (
double)-1) && PyErr_Occurred())) __PYX_ERR(0, 357, __pyx_L3_error)
3802 __pyx_v_nElements_global = __Pyx_PyInt_As_int(values[4]);
if (unlikely((__pyx_v_nElements_global == (
int)-1) && PyErr_Occurred())) __PYX_ERR(0, 358, __pyx_L3_error)
3803 __pyx_v_nElementBoundaries_element = __Pyx_PyInt_As_int(values[5]);
if (unlikely((__pyx_v_nElementBoundaries_element == (
int)-1) && PyErr_Occurred())) __PYX_ERR(0, 359, __pyx_L3_error)
3804 __pyx_v_nNodes_element = __Pyx_PyInt_As_int(values[6]);
if (unlikely((__pyx_v_nNodes_element == (
int)-1) && PyErr_Occurred())) __PYX_ERR(0, 360, __pyx_L3_error)
3805 __pyx_v_nSpace = __Pyx_PyInt_As_int(values[7]);
if (unlikely((__pyx_v_nSpace == (
int)-1) && PyErr_Occurred())) __PYX_ERR(0, 361, __pyx_L3_error)
3806 __pyx_v_nDOF_element = __Pyx_PyInt_As_int(values[8]);
if (unlikely((__pyx_v_nDOF_element == (
int)-1) && PyErr_Occurred())) __PYX_ERR(0, 362, __pyx_L3_error)
3807 __pyx_v_elementNeighborsArray = ((PyArrayObject *)values[9]);
3808 __pyx_v_elementBoundariesArray = ((PyArrayObject *)values[10]);
3809 __pyx_v_elementNodesArray = ((PyArrayObject *)values[11]);
3810 __pyx_v_nodeArray = ((PyArrayObject *)values[12]);
3811 __pyx_v_elementBarycentersArray = ((PyArrayObject *)values[13]);
3812 __pyx_v_elementBoundaryBarycentersArray = ((PyArrayObject *)values[14]);
3813 __pyx_v_elementNeighborShapeGradients = ((PyArrayObject *)values[15]);
3814 __pyx_v_l2g = ((PyArrayObject *)values[16]);
3815 __pyx_v_grad_v0 = ((PyArrayObject *)values[17]);
3816 __pyx_v_elementAverages = ((PyArrayObject *)values[18]);
3817 __pyx_v_tag = ((PyArrayObject *)values[19]);
3818 __pyx_v_Uin = ((PyArrayObject *)values[20]);
3819 __pyx_v_Uout = ((PyArrayObject *)values[21]);
3821 goto __pyx_L4_argument_unpacking_done;
3822 __pyx_L5_argtuple_error:;
3823 __Pyx_RaiseArgtupleInvalid(
"applyDurlofskyDGlimiterP1Lagrange2d_withVacuumTol", 1, 22, 22, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 354, __pyx_L3_error)
3825 __Pyx_AddTraceback(
"ctimeIntegration.applyDurlofskyDGlimiterP1Lagrange2d_withVacuumTol", __pyx_clineno, __pyx_lineno, __pyx_filename);
3826 __Pyx_RefNannyFinishContext();
3828 __pyx_L4_argument_unpacking_done:;
3829 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_elementNeighborsArray), __pyx_ptype_5numpy_ndarray, 1,
"elementNeighborsArray", 0))) __PYX_ERR(0, 363, __pyx_L1_error)
3830 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_elementBoundariesArray), __pyx_ptype_5numpy_ndarray, 1,
"elementBoundariesArray", 0))) __PYX_ERR(0, 364, __pyx_L1_error)
3831 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_elementNodesArray), __pyx_ptype_5numpy_ndarray, 1,
"elementNodesArray", 0))) __PYX_ERR(0, 365, __pyx_L1_error)
3832 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_nodeArray), __pyx_ptype_5numpy_ndarray, 1,
"nodeArray", 0))) __PYX_ERR(0, 366, __pyx_L1_error)
3833 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_elementBarycentersArray), __pyx_ptype_5numpy_ndarray, 1,
"elementBarycentersArray", 0))) __PYX_ERR(0, 367, __pyx_L1_error)
3834 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_elementBoundaryBarycentersArray), __pyx_ptype_5numpy_ndarray, 1,
"elementBoundaryBarycentersArray", 0))) __PYX_ERR(0, 368, __pyx_L1_error)
3835 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_elementNeighborShapeGradients), __pyx_ptype_5numpy_ndarray, 1,
"elementNeighborShapeGradients", 0))) __PYX_ERR(0, 369, __pyx_L1_error)
3836 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_l2g), __pyx_ptype_5numpy_ndarray, 1,
"l2g", 0))) __PYX_ERR(0, 370, __pyx_L1_error)
3837 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_grad_v0), __pyx_ptype_5numpy_ndarray, 1,
"grad_v0", 0))) __PYX_ERR(0, 371, __pyx_L1_error)
3838 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_elementAverages), __pyx_ptype_5numpy_ndarray, 1,
"elementAverages", 0))) __PYX_ERR(0, 372, __pyx_L1_error)
3839 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_tag), __pyx_ptype_5numpy_ndarray, 1,
"tag", 0))) __PYX_ERR(0, 373, __pyx_L1_error)
3840 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_Uin), __pyx_ptype_5numpy_ndarray, 1,
"Uin", 0))) __PYX_ERR(0, 374, __pyx_L1_error)
3841 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_Uout), __pyx_ptype_5numpy_ndarray, 1,
"Uout", 0))) __PYX_ERR(0, 375, __pyx_L1_error)
3842 __pyx_r = __pyx_pf_16ctimeIntegration_16applyDurlofskyDGlimiterP1Lagrange2d_withVacuumTol(__pyx_self, __pyx_v_killExtrema, __pyx_v_allowMinWithUndershoot, __pyx_v_enforcePositivity, __pyx_v_vacuumTol, __pyx_v_nElements_global, __pyx_v_nElementBoundaries_element, __pyx_v_nNodes_element, __pyx_v_nSpace, __pyx_v_nDOF_element, __pyx_v_elementNeighborsArray, __pyx_v_elementBoundariesArray, __pyx_v_elementNodesArray, __pyx_v_nodeArray, __pyx_v_elementBarycentersArray, __pyx_v_elementBoundaryBarycentersArray, __pyx_v_elementNeighborShapeGradients, __pyx_v_l2g, __pyx_v_grad_v0, __pyx_v_elementAverages, __pyx_v_tag, __pyx_v_Uin, __pyx_v_Uout);
3849 __Pyx_RefNannyFinishContext();
3853 static PyObject *__pyx_pf_16ctimeIntegration_16applyDurlofskyDGlimiterP1Lagrange2d_withVacuumTol(CYTHON_UNUSED PyObject *__pyx_self,
int __pyx_v_killExtrema,
int __pyx_v_allowMinWithUndershoot,
int __pyx_v_enforcePositivity,
double __pyx_v_vacuumTol,
int __pyx_v_nElements_global,
int __pyx_v_nElementBoundaries_element,
int __pyx_v_nNodes_element,
int __pyx_v_nSpace,
int __pyx_v_nDOF_element, PyArrayObject *__pyx_v_elementNeighborsArray, PyArrayObject *__pyx_v_elementBoundariesArray, PyArrayObject *__pyx_v_elementNodesArray, PyArrayObject *__pyx_v_nodeArray, PyArrayObject *__pyx_v_elementBarycentersArray, PyArrayObject *__pyx_v_elementBoundaryBarycentersArray, PyArrayObject *__pyx_v_elementNeighborShapeGradients, PyArrayObject *__pyx_v_l2g, PyArrayObject *__pyx_v_grad_v0, PyArrayObject *__pyx_v_elementAverages, PyArrayObject *__pyx_v_tag, PyArrayObject *__pyx_v_Uin, PyArrayObject *__pyx_v_Uout) {
3854 PyObject *__pyx_r = NULL;
3855 __Pyx_RefNannyDeclarations
3856 __Pyx_RefNannySetupContext(
"applyDurlofskyDGlimiterP1Lagrange2d_withVacuumTol", 0);
3865 applyDurlofskyDGlimiterP1Lagrange2d_withVacuumTol(__pyx_v_killExtrema, __pyx_v_allowMinWithUndershoot, __pyx_v_enforcePositivity, __pyx_v_vacuumTol, __pyx_v_nElements_global, __pyx_v_nElementBoundaries_element, __pyx_v_nNodes_element, __pyx_v_nSpace, __pyx_v_nDOF_element, ((
int *)__pyx_v_elementNeighborsArray->data), ((
int *)__pyx_v_elementBoundariesArray->data), ((
int *)__pyx_v_elementNodesArray->data), ((
double *)__pyx_v_nodeArray->data), ((
double *)__pyx_v_elementBarycentersArray->data), ((
double *)__pyx_v_elementBoundaryBarycentersArray->data), ((
double *)__pyx_v_elementNeighborShapeGradients->data), ((
int *)__pyx_v_l2g->data), ((
double *)__pyx_v_grad_v0->data), ((
double *)__pyx_v_elementAverages->data), ((
int *)__pyx_v_tag->data), ((
double *)__pyx_v_Uin->data), ((
double *)__pyx_v_Uout->data));
3876 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
3877 __Pyx_XGIVEREF(__pyx_r);
3878 __Pyx_RefNannyFinishContext();
3890 static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew1(PyObject *__pyx_v_a) {
3891 PyObject *__pyx_r = NULL;
3892 __Pyx_RefNannyDeclarations
3893 PyObject *__pyx_t_1 = NULL;
3894 int __pyx_lineno = 0;
3895 const char *__pyx_filename = NULL;
3896 int __pyx_clineno = 0;
3897 __Pyx_RefNannySetupContext(
"PyArray_MultiIterNew1", 0);
3906 __Pyx_XDECREF(__pyx_r);
3907 __pyx_t_1 = PyArray_MultiIterNew(1, ((
void *)__pyx_v_a));
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 736, __pyx_L1_error)
3908 __Pyx_GOTREF(__pyx_t_1);
3909 __pyx_r = __pyx_t_1;
3923 __Pyx_XDECREF(__pyx_t_1);
3924 __Pyx_AddTraceback(
"numpy.PyArray_MultiIterNew1", __pyx_clineno, __pyx_lineno, __pyx_filename);
3927 __Pyx_XGIVEREF(__pyx_r);
3928 __Pyx_RefNannyFinishContext();
3940 static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew2(PyObject *__pyx_v_a, PyObject *__pyx_v_b) {
3941 PyObject *__pyx_r = NULL;
3942 __Pyx_RefNannyDeclarations
3943 PyObject *__pyx_t_1 = NULL;
3944 int __pyx_lineno = 0;
3945 const char *__pyx_filename = NULL;
3946 int __pyx_clineno = 0;
3947 __Pyx_RefNannySetupContext(
"PyArray_MultiIterNew2", 0);
3956 __Pyx_XDECREF(__pyx_r);
3957 __pyx_t_1 = PyArray_MultiIterNew(2, ((
void *)__pyx_v_a), ((
void *)__pyx_v_b));
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 739, __pyx_L1_error)
3958 __Pyx_GOTREF(__pyx_t_1);
3959 __pyx_r = __pyx_t_1;
3973 __Pyx_XDECREF(__pyx_t_1);
3974 __Pyx_AddTraceback(
"numpy.PyArray_MultiIterNew2", __pyx_clineno, __pyx_lineno, __pyx_filename);
3977 __Pyx_XGIVEREF(__pyx_r);
3978 __Pyx_RefNannyFinishContext();
3990 static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew3(PyObject *__pyx_v_a, PyObject *__pyx_v_b, PyObject *__pyx_v_c) {
3991 PyObject *__pyx_r = NULL;
3992 __Pyx_RefNannyDeclarations
3993 PyObject *__pyx_t_1 = NULL;
3994 int __pyx_lineno = 0;
3995 const char *__pyx_filename = NULL;
3996 int __pyx_clineno = 0;
3997 __Pyx_RefNannySetupContext(
"PyArray_MultiIterNew3", 0);
4006 __Pyx_XDECREF(__pyx_r);
4007 __pyx_t_1 = PyArray_MultiIterNew(3, ((
void *)__pyx_v_a), ((
void *)__pyx_v_b), ((
void *)__pyx_v_c));
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 742, __pyx_L1_error)
4008 __Pyx_GOTREF(__pyx_t_1);
4009 __pyx_r = __pyx_t_1;
4023 __Pyx_XDECREF(__pyx_t_1);
4024 __Pyx_AddTraceback(
"numpy.PyArray_MultiIterNew3", __pyx_clineno, __pyx_lineno, __pyx_filename);
4027 __Pyx_XGIVEREF(__pyx_r);
4028 __Pyx_RefNannyFinishContext();
4040 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) {
4041 PyObject *__pyx_r = NULL;
4042 __Pyx_RefNannyDeclarations
4043 PyObject *__pyx_t_1 = NULL;
4044 int __pyx_lineno = 0;
4045 const char *__pyx_filename = NULL;
4046 int __pyx_clineno = 0;
4047 __Pyx_RefNannySetupContext(
"PyArray_MultiIterNew4", 0);
4056 __Pyx_XDECREF(__pyx_r);
4057 __pyx_t_1 = PyArray_MultiIterNew(4, ((
void *)__pyx_v_a), ((
void *)__pyx_v_b), ((
void *)__pyx_v_c), ((
void *)__pyx_v_d));
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 745, __pyx_L1_error)
4058 __Pyx_GOTREF(__pyx_t_1);
4059 __pyx_r = __pyx_t_1;
4073 __Pyx_XDECREF(__pyx_t_1);
4074 __Pyx_AddTraceback(
"numpy.PyArray_MultiIterNew4", __pyx_clineno, __pyx_lineno, __pyx_filename);
4077 __Pyx_XGIVEREF(__pyx_r);
4078 __Pyx_RefNannyFinishContext();
4090 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) {
4091 PyObject *__pyx_r = NULL;
4092 __Pyx_RefNannyDeclarations
4093 PyObject *__pyx_t_1 = NULL;
4094 int __pyx_lineno = 0;
4095 const char *__pyx_filename = NULL;
4096 int __pyx_clineno = 0;
4097 __Pyx_RefNannySetupContext(
"PyArray_MultiIterNew5", 0);
4106 __Pyx_XDECREF(__pyx_r);
4107 __pyx_t_1 = PyArray_MultiIterNew(5, ((
void *)__pyx_v_a), ((
void *)__pyx_v_b), ((
void *)__pyx_v_c), ((
void *)__pyx_v_d), ((
void *)__pyx_v_e));
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 748, __pyx_L1_error)
4108 __Pyx_GOTREF(__pyx_t_1);
4109 __pyx_r = __pyx_t_1;
4123 __Pyx_XDECREF(__pyx_t_1);
4124 __Pyx_AddTraceback(
"numpy.PyArray_MultiIterNew5", __pyx_clineno, __pyx_lineno, __pyx_filename);
4127 __Pyx_XGIVEREF(__pyx_r);
4128 __Pyx_RefNannyFinishContext();
4140 static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyDataType_SHAPE(PyArray_Descr *__pyx_v_d) {
4141 PyObject *__pyx_r = NULL;
4142 __Pyx_RefNannyDeclarations
4144 __Pyx_RefNannySetupContext(
"PyDataType_SHAPE", 0);
4153 __pyx_t_1 = (PyDataType_HASSUBARRAY(__pyx_v_d) != 0);
4163 __Pyx_XDECREF(__pyx_r);
4164 __Pyx_INCREF(((PyObject*)__pyx_v_d->subarray->shape));
4165 __pyx_r = ((PyObject*)__pyx_v_d->subarray->shape);
4185 __Pyx_XDECREF(__pyx_r);
4186 __Pyx_INCREF(__pyx_empty_tuple);
4187 __pyx_r = __pyx_empty_tuple;
4201 __Pyx_XGIVEREF(__pyx_r);
4202 __Pyx_RefNannyFinishContext();
4214 static CYTHON_INLINE
void __pyx_f_5numpy_set_array_base(PyArrayObject *__pyx_v_arr, PyObject *__pyx_v_base) {
4215 __Pyx_RefNannyDeclarations
4216 __Pyx_RefNannySetupContext(
"set_array_base", 0);
4225 Py_INCREF(__pyx_v_base);
4234 (void)(PyArray_SetBaseObject(__pyx_v_arr, __pyx_v_base));
4245 __Pyx_RefNannyFinishContext();
4256 static CYTHON_INLINE PyObject *__pyx_f_5numpy_get_array_base(PyArrayObject *__pyx_v_arr) {
4257 PyObject *__pyx_v_base;
4258 PyObject *__pyx_r = NULL;
4259 __Pyx_RefNannyDeclarations
4261 __Pyx_RefNannySetupContext(
"get_array_base", 0);
4270 __pyx_v_base = PyArray_BASE(__pyx_v_arr);
4279 __pyx_t_1 = ((__pyx_v_base == NULL) != 0);
4289 __Pyx_XDECREF(__pyx_r);
4290 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
4309 __Pyx_XDECREF(__pyx_r);
4310 __Pyx_INCREF(((PyObject *)__pyx_v_base));
4311 __pyx_r = ((PyObject *)__pyx_v_base);
4324 __Pyx_XGIVEREF(__pyx_r);
4325 __Pyx_RefNannyFinishContext();
4337 static CYTHON_INLINE
int __pyx_f_5numpy_import_array(
void) {
4339 __Pyx_RefNannyDeclarations
4340 PyObject *__pyx_t_1 = NULL;
4341 PyObject *__pyx_t_2 = NULL;
4342 PyObject *__pyx_t_3 = NULL;
4344 PyObject *__pyx_t_5 = NULL;
4345 PyObject *__pyx_t_6 = NULL;
4346 PyObject *__pyx_t_7 = NULL;
4347 PyObject *__pyx_t_8 = NULL;
4348 int __pyx_lineno = 0;
4349 const char *__pyx_filename = NULL;
4350 int __pyx_clineno = 0;
4351 __Pyx_RefNannySetupContext(
"import_array", 0);
4361 __Pyx_PyThreadState_declare
4362 __Pyx_PyThreadState_assign
4363 __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
4364 __Pyx_XGOTREF(__pyx_t_1);
4365 __Pyx_XGOTREF(__pyx_t_2);
4366 __Pyx_XGOTREF(__pyx_t_3);
4376 __pyx_t_4 = _import_array();
if (unlikely(__pyx_t_4 == ((
int)-1))) __PYX_ERR(1, 943, __pyx_L3_error)
4386 __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
4387 __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
4388 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
4389 goto __pyx_L8_try_end;
4399 __pyx_t_4 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0])));
4401 __Pyx_AddTraceback(
"numpy.import_array", __pyx_clineno, __pyx_lineno, __pyx_filename);
4402 if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(1, 944, __pyx_L5_except_error)
4403 __Pyx_GOTREF(__pyx_t_5);
4404 __Pyx_GOTREF(__pyx_t_6);
4405 __Pyx_GOTREF(__pyx_t_7);
4414 __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_ImportError, __pyx_tuple_, NULL);
if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 945, __pyx_L5_except_error)
4415 __Pyx_GOTREF(__pyx_t_8);
4416 __Pyx_Raise(__pyx_t_8, 0, 0, 0);
4417 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
4418 __PYX_ERR(1, 945, __pyx_L5_except_error)
4420 goto __pyx_L5_except_error;
4421 __pyx_L5_except_error:;
4430 __Pyx_XGIVEREF(__pyx_t_1);
4431 __Pyx_XGIVEREF(__pyx_t_2);
4432 __Pyx_XGIVEREF(__pyx_t_3);
4433 __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
4434 goto __pyx_L1_error;
4450 __Pyx_XDECREF(__pyx_t_5);
4451 __Pyx_XDECREF(__pyx_t_6);
4452 __Pyx_XDECREF(__pyx_t_7);
4453 __Pyx_XDECREF(__pyx_t_8);
4454 __Pyx_AddTraceback(
"numpy.import_array", __pyx_clineno, __pyx_lineno, __pyx_filename);
4457 __Pyx_RefNannyFinishContext();
4469 static CYTHON_INLINE
int __pyx_f_5numpy_import_umath(
void) {
4471 __Pyx_RefNannyDeclarations
4472 PyObject *__pyx_t_1 = NULL;
4473 PyObject *__pyx_t_2 = NULL;
4474 PyObject *__pyx_t_3 = NULL;
4476 PyObject *__pyx_t_5 = NULL;
4477 PyObject *__pyx_t_6 = NULL;
4478 PyObject *__pyx_t_7 = NULL;
4479 PyObject *__pyx_t_8 = NULL;
4480 int __pyx_lineno = 0;
4481 const char *__pyx_filename = NULL;
4482 int __pyx_clineno = 0;
4483 __Pyx_RefNannySetupContext(
"import_umath", 0);
4493 __Pyx_PyThreadState_declare
4494 __Pyx_PyThreadState_assign
4495 __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
4496 __Pyx_XGOTREF(__pyx_t_1);
4497 __Pyx_XGOTREF(__pyx_t_2);
4498 __Pyx_XGOTREF(__pyx_t_3);
4508 __pyx_t_4 = _import_umath();
if (unlikely(__pyx_t_4 == ((
int)-1))) __PYX_ERR(1, 949, __pyx_L3_error)
4518 __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
4519 __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
4520 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
4521 goto __pyx_L8_try_end;
4531 __pyx_t_4 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0])));
4533 __Pyx_AddTraceback(
"numpy.import_umath", __pyx_clineno, __pyx_lineno, __pyx_filename);
4534 if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(1, 950, __pyx_L5_except_error)
4535 __Pyx_GOTREF(__pyx_t_5);
4536 __Pyx_GOTREF(__pyx_t_6);
4537 __Pyx_GOTREF(__pyx_t_7);
4546 __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_ImportError, __pyx_tuple__2, NULL);
if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 951, __pyx_L5_except_error)
4547 __Pyx_GOTREF(__pyx_t_8);
4548 __Pyx_Raise(__pyx_t_8, 0, 0, 0);
4549 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
4550 __PYX_ERR(1, 951, __pyx_L5_except_error)
4552 goto __pyx_L5_except_error;
4553 __pyx_L5_except_error:;
4562 __Pyx_XGIVEREF(__pyx_t_1);
4563 __Pyx_XGIVEREF(__pyx_t_2);
4564 __Pyx_XGIVEREF(__pyx_t_3);
4565 __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
4566 goto __pyx_L1_error;
4582 __Pyx_XDECREF(__pyx_t_5);
4583 __Pyx_XDECREF(__pyx_t_6);
4584 __Pyx_XDECREF(__pyx_t_7);
4585 __Pyx_XDECREF(__pyx_t_8);
4586 __Pyx_AddTraceback(
"numpy.import_umath", __pyx_clineno, __pyx_lineno, __pyx_filename);
4589 __Pyx_RefNannyFinishContext();
4601 static CYTHON_INLINE
int __pyx_f_5numpy_import_ufunc(
void) {
4603 __Pyx_RefNannyDeclarations
4604 PyObject *__pyx_t_1 = NULL;
4605 PyObject *__pyx_t_2 = NULL;
4606 PyObject *__pyx_t_3 = NULL;
4608 PyObject *__pyx_t_5 = NULL;
4609 PyObject *__pyx_t_6 = NULL;
4610 PyObject *__pyx_t_7 = NULL;
4611 PyObject *__pyx_t_8 = NULL;
4612 int __pyx_lineno = 0;
4613 const char *__pyx_filename = NULL;
4614 int __pyx_clineno = 0;
4615 __Pyx_RefNannySetupContext(
"import_ufunc", 0);
4625 __Pyx_PyThreadState_declare
4626 __Pyx_PyThreadState_assign
4627 __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
4628 __Pyx_XGOTREF(__pyx_t_1);
4629 __Pyx_XGOTREF(__pyx_t_2);
4630 __Pyx_XGOTREF(__pyx_t_3);
4640 __pyx_t_4 = _import_umath();
if (unlikely(__pyx_t_4 == ((
int)-1))) __PYX_ERR(1, 955, __pyx_L3_error)
4650 __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
4651 __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
4652 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
4653 goto __pyx_L8_try_end;
4663 __pyx_t_4 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0])));
4665 __Pyx_AddTraceback(
"numpy.import_ufunc", __pyx_clineno, __pyx_lineno, __pyx_filename);
4666 if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(1, 956, __pyx_L5_except_error)
4667 __Pyx_GOTREF(__pyx_t_5);
4668 __Pyx_GOTREF(__pyx_t_6);
4669 __Pyx_GOTREF(__pyx_t_7);
4678 __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_ImportError, __pyx_tuple__2, NULL);
if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 957, __pyx_L5_except_error)
4679 __Pyx_GOTREF(__pyx_t_8);
4680 __Pyx_Raise(__pyx_t_8, 0, 0, 0);
4681 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
4682 __PYX_ERR(1, 957, __pyx_L5_except_error)
4684 goto __pyx_L5_except_error;
4685 __pyx_L5_except_error:;
4694 __Pyx_XGIVEREF(__pyx_t_1);
4695 __Pyx_XGIVEREF(__pyx_t_2);
4696 __Pyx_XGIVEREF(__pyx_t_3);
4697 __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
4698 goto __pyx_L1_error;
4714 __Pyx_XDECREF(__pyx_t_5);
4715 __Pyx_XDECREF(__pyx_t_6);
4716 __Pyx_XDECREF(__pyx_t_7);
4717 __Pyx_XDECREF(__pyx_t_8);
4718 __Pyx_AddTraceback(
"numpy.import_ufunc", __pyx_clineno, __pyx_lineno, __pyx_filename);
4721 __Pyx_RefNannyFinishContext();
4733 static CYTHON_INLINE
int __pyx_f_5numpy_is_timedelta64_object(PyObject *__pyx_v_obj) {
4735 __Pyx_RefNannyDeclarations
4736 __Pyx_RefNannySetupContext(
"is_timedelta64_object", 0);
4745 __pyx_r = PyObject_TypeCheck(__pyx_v_obj, (&PyTimedeltaArrType_Type));
4758 __Pyx_RefNannyFinishContext();
4770 static CYTHON_INLINE
int __pyx_f_5numpy_is_datetime64_object(PyObject *__pyx_v_obj) {
4772 __Pyx_RefNannyDeclarations
4773 __Pyx_RefNannySetupContext(
"is_datetime64_object", 0);
4782 __pyx_r = PyObject_TypeCheck(__pyx_v_obj, (&PyDatetimeArrType_Type));
4795 __Pyx_RefNannyFinishContext();
4807 static CYTHON_INLINE npy_datetime __pyx_f_5numpy_get_datetime64_value(PyObject *__pyx_v_obj) {
4808 npy_datetime __pyx_r;
4817 __pyx_r = ((PyDatetimeScalarObject *)__pyx_v_obj)->obval;
4841 static CYTHON_INLINE npy_timedelta __pyx_f_5numpy_get_timedelta64_value(PyObject *__pyx_v_obj) {
4842 npy_timedelta __pyx_r;
4851 __pyx_r = ((PyTimedeltaScalarObject *)__pyx_v_obj)->obval;
4875 static CYTHON_INLINE NPY_DATETIMEUNIT __pyx_f_5numpy_get_datetime64_unit(PyObject *__pyx_v_obj) {
4876 NPY_DATETIMEUNIT __pyx_r;
4883 __pyx_r = ((NPY_DATETIMEUNIT)((PyDatetimeScalarObject *)__pyx_v_obj)->obmeta.base);
4899 static PyMethodDef __pyx_methods[] = {
4903 #if PY_MAJOR_VERSION >= 3
4904 #if CYTHON_PEP489_MULTI_PHASE_INIT
4905 static PyObject* __pyx_pymod_create(PyObject *spec, PyModuleDef *def);
4906 static int __pyx_pymod_exec_ctimeIntegration(PyObject* module);
4907 static PyModuleDef_Slot __pyx_moduledef_slots[] = {
4908 {Py_mod_create, (
void*)__pyx_pymod_create},
4909 {Py_mod_exec, (
void*)__pyx_pymod_exec_ctimeIntegration},
4914 static struct PyModuleDef __pyx_moduledef = {
4915 PyModuleDef_HEAD_INIT,
4918 #if CYTHON_PEP489_MULTI_PHASE_INIT
4924 #if CYTHON_PEP489_MULTI_PHASE_INIT
4925 __pyx_moduledef_slots,
4934 #ifndef CYTHON_SMALL_CODE
4935 #if defined(__clang__)
4936 #define CYTHON_SMALL_CODE
4937 #elif defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 3))
4938 #define CYTHON_SMALL_CODE __attribute__((cold))
4940 #define CYTHON_SMALL_CODE
4944 static __Pyx_StringTabEntry __pyx_string_tab[] = {
4945 {&__pyx_n_s_ImportError, __pyx_k_ImportError,
sizeof(__pyx_k_ImportError), 0, 0, 1, 1},
4946 {&__pyx_n_s_Mh2, __pyx_k_Mh2,
sizeof(__pyx_k_Mh2), 0, 0, 1, 1},
4947 {&__pyx_n_s_Uin, __pyx_k_Uin,
sizeof(__pyx_k_Uin), 0, 0, 1, 1},
4948 {&__pyx_n_s_Uout, __pyx_k_Uout,
sizeof(__pyx_k_Uout), 0, 0, 1, 1},
4949 {&__pyx_n_s_allowMinWithUndershoot, __pyx_k_allowMinWithUndershoot,
sizeof(__pyx_k_allowMinWithUndershoot), 0, 0, 1, 1},
4950 {&__pyx_n_s_alphaNeighbors, __pyx_k_alphaNeighbors,
sizeof(__pyx_k_alphaNeighbors), 0, 0, 1, 1},
4951 {&__pyx_n_s_alphas, __pyx_k_alphas,
sizeof(__pyx_k_alphas), 0, 0, 1, 1},
4952 {&__pyx_n_s_applyCockburnDGlimiterP1Lagrange, __pyx_k_applyCockburnDGlimiterP1Lagrange,
sizeof(__pyx_k_applyCockburnDGlimiterP1Lagrange), 0, 0, 1, 1},
4953 {&__pyx_n_s_applyDGlimitingP1Lagrange1d, __pyx_k_applyDGlimitingP1Lagrange1d,
sizeof(__pyx_k_applyDGlimitingP1Lagrange1d), 0, 0, 1, 1},
4954 {&__pyx_n_s_applyDGlimitingP1Lagrange1d_with, __pyx_k_applyDGlimitingP1Lagrange1d_with,
sizeof(__pyx_k_applyDGlimitingP1Lagrange1d_with), 0, 0, 1, 1},
4955 {&__pyx_n_s_applyDurlofskyDGlimiterP1Lagrang, __pyx_k_applyDurlofskyDGlimiterP1Lagrang,
sizeof(__pyx_k_applyDurlofskyDGlimiterP1Lagrang), 0, 0, 1, 1},
4956 {&__pyx_n_s_applyDurlofskyDGlimiterP1Lagrang_2, __pyx_k_applyDurlofskyDGlimiterP1Lagrang_2,
sizeof(__pyx_k_applyDurlofskyDGlimiterP1Lagrang_2), 0, 0, 1, 1},
4957 {&__pyx_n_s_applyDurlofskyDGlimiterP1Lagrang_3, __pyx_k_applyDurlofskyDGlimiterP1Lagrang_3,
sizeof(__pyx_k_applyDurlofskyDGlimiterP1Lagrang_3), 0, 0, 1, 1},
4958 {&__pyx_n_s_cline_in_traceback, __pyx_k_cline_in_traceback,
sizeof(__pyx_k_cline_in_traceback), 0, 0, 1, 1},
4959 {&__pyx_n_s_computeCockburnDGlimiterArrays2d, __pyx_k_computeCockburnDGlimiterArrays2d,
sizeof(__pyx_k_computeCockburnDGlimiterArrays2d), 0, 0, 1, 1},
4960 {&__pyx_n_s_computeElementNeighborShapeGradi, __pyx_k_computeElementNeighborShapeGradi,
sizeof(__pyx_k_computeElementNeighborShapeGradi), 0, 0, 1, 1},
4961 {&__pyx_n_s_ctimeIntegration, __pyx_k_ctimeIntegration,
sizeof(__pyx_k_ctimeIntegration), 0, 0, 1, 1},
4962 {&__pyx_n_s_dtn, __pyx_k_dtn,
sizeof(__pyx_k_dtn), 0, 0, 1, 1},
4963 {&__pyx_n_s_dtnm1, __pyx_k_dtnm1,
sizeof(__pyx_k_dtnm1), 0, 0, 1, 1},
4964 {&__pyx_n_s_dtnp1, __pyx_k_dtnp1,
sizeof(__pyx_k_dtnp1), 0, 0, 1, 1},
4965 {&__pyx_n_s_elementAverages, __pyx_k_elementAverages,
sizeof(__pyx_k_elementAverages), 0, 0, 1, 1},
4966 {&__pyx_n_s_elementBarycentersArray, __pyx_k_elementBarycentersArray,
sizeof(__pyx_k_elementBarycentersArray), 0, 0, 1, 1},
4967 {&__pyx_n_s_elementBoundariesArray, __pyx_k_elementBoundariesArray,
sizeof(__pyx_k_elementBoundariesArray), 0, 0, 1, 1},
4968 {&__pyx_n_s_elementBoundaryBarycentersArray, __pyx_k_elementBoundaryBarycentersArray,
sizeof(__pyx_k_elementBoundaryBarycentersArray), 0, 0, 1, 1},
4969 {&__pyx_n_s_elementNeighborShapeGradients, __pyx_k_elementNeighborShapeGradients,
sizeof(__pyx_k_elementNeighborShapeGradients), 0, 0, 1, 1},
4970 {&__pyx_n_s_elementNeighborsArray, __pyx_k_elementNeighborsArray,
sizeof(__pyx_k_elementNeighborsArray), 0, 0, 1, 1},
4971 {&__pyx_n_s_elementNodesArray, __pyx_k_elementNodesArray,
sizeof(__pyx_k_elementNodesArray), 0, 0, 1, 1},
4972 {&__pyx_n_s_enforcePositivity, __pyx_k_enforcePositivity,
sizeof(__pyx_k_enforcePositivity), 0, 0, 1, 1},
4973 {&__pyx_n_s_grad_v0, __pyx_k_grad_v0,
sizeof(__pyx_k_grad_v0), 0, 0, 1, 1},
4974 {&__pyx_n_s_import, __pyx_k_import,
sizeof(__pyx_k_import), 0, 0, 1, 1},
4975 {&__pyx_n_s_killExtrema, __pyx_k_killExtrema,
sizeof(__pyx_k_killExtrema), 0, 0, 1, 1},
4976 {&__pyx_n_s_l2g, __pyx_k_l2g,
sizeof(__pyx_k_l2g), 0, 0, 1, 1},
4977 {&__pyx_n_s_limiterFlag, __pyx_k_limiterFlag,
sizeof(__pyx_k_limiterFlag), 0, 0, 1, 1},
4978 {&__pyx_n_s_main, __pyx_k_main,
sizeof(__pyx_k_main), 0, 0, 1, 1},
4979 {&__pyx_n_s_nDOF_element, __pyx_k_nDOF_element,
sizeof(__pyx_k_nDOF_element), 0, 0, 1, 1},
4980 {&__pyx_n_s_nElementBoundaries_element, __pyx_k_nElementBoundaries_element,
sizeof(__pyx_k_nElementBoundaries_element), 0, 0, 1, 1},
4981 {&__pyx_n_s_nElements_global, __pyx_k_nElements_global,
sizeof(__pyx_k_nElements_global), 0, 0, 1, 1},
4982 {&__pyx_n_s_nNodes_element, __pyx_k_nNodes_element,
sizeof(__pyx_k_nNodes_element), 0, 0, 1, 1},
4983 {&__pyx_n_s_nPoints, __pyx_k_nPoints,
sizeof(__pyx_k_nPoints), 0, 0, 1, 1},
4984 {&__pyx_n_s_nSpace, __pyx_k_nSpace,
sizeof(__pyx_k_nSpace), 0, 0, 1, 1},
4985 {&__pyx_n_s_name, __pyx_k_name,
sizeof(__pyx_k_name), 0, 0, 1, 1},
4986 {&__pyx_n_s_nodeArray, __pyx_k_nodeArray,
sizeof(__pyx_k_nodeArray), 0, 0, 1, 1},
4987 {&__pyx_n_s_np, __pyx_k_np,
sizeof(__pyx_k_np), 0, 0, 1, 1},
4988 {&__pyx_n_s_nu, __pyx_k_nu,
sizeof(__pyx_k_nu), 0, 0, 1, 1},
4989 {&__pyx_n_s_numpy, __pyx_k_numpy,
sizeof(__pyx_k_numpy), 0, 0, 1, 1},
4990 {&__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},
4991 {&__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},
4992 {&__pyx_kp_s_proteus_ctimeIntegration_pyx, __pyx_k_proteus_ctimeIntegration_pyx,
sizeof(__pyx_k_proteus_ctimeIntegration_pyx), 0, 0, 1, 0},
4993 {&__pyx_n_s_psiTCtteDT, __pyx_k_psiTCtteDT,
sizeof(__pyx_k_psiTCtteDT), 0, 0, 1, 1},
4994 {&__pyx_n_s_tag, __pyx_k_tag,
sizeof(__pyx_k_tag), 0, 0, 1, 1},
4995 {&__pyx_n_s_tau, __pyx_k_tau,
sizeof(__pyx_k_tau), 0, 0, 1, 1},
4996 {&__pyx_n_s_test, __pyx_k_test,
sizeof(__pyx_k_test), 0, 0, 1, 1},
4997 {&__pyx_n_s_vacuumTol, __pyx_k_vacuumTol,
sizeof(__pyx_k_vacuumTol), 0, 0, 1, 1},
4998 {&__pyx_n_s_yn, __pyx_k_yn,
sizeof(__pyx_k_yn), 0, 0, 1, 1},
4999 {&__pyx_n_s_ypn, __pyx_k_ypn,
sizeof(__pyx_k_ypn), 0, 0, 1, 1},
5000 {&__pyx_n_s_ypnm1, __pyx_k_ypnm1,
sizeof(__pyx_k_ypnm1), 0, 0, 1, 1},
5001 {0, 0, 0, 0, 0, 0, 0}
5003 static CYTHON_SMALL_CODE
int __Pyx_InitCachedBuiltins(
void) {
5004 __pyx_builtin_ImportError = __Pyx_GetBuiltinName(__pyx_n_s_ImportError);
if (!__pyx_builtin_ImportError) __PYX_ERR(1, 945, __pyx_L1_error)
5010 static CYTHON_SMALL_CODE
int __Pyx_InitCachedConstants(
void) {
5011 __Pyx_RefNannyDeclarations
5012 __Pyx_RefNannySetupContext(
"__Pyx_InitCachedConstants", 0);
5021 __pyx_tuple_ = PyTuple_Pack(1, __pyx_kp_s_numpy_core_multiarray_failed_to);
if (unlikely(!__pyx_tuple_)) __PYX_ERR(1, 945, __pyx_L1_error)
5022 __Pyx_GOTREF(__pyx_tuple_);
5023 __Pyx_GIVEREF(__pyx_tuple_);
5032 __pyx_tuple__2 = PyTuple_Pack(1, __pyx_kp_s_numpy_core_umath_failed_to_impor);
if (unlikely(!__pyx_tuple__2)) __PYX_ERR(1, 951, __pyx_L1_error)
5033 __Pyx_GOTREF(__pyx_tuple__2);
5034 __Pyx_GIVEREF(__pyx_tuple__2);
5043 __pyx_tuple__3 = PyTuple_Pack(8, __pyx_n_s_nPoints, __pyx_n_s_tau, __pyx_n_s_dtn, __pyx_n_s_dtnm1, __pyx_n_s_yn, __pyx_n_s_ypn, __pyx_n_s_ypnm1, __pyx_n_s_dtnp1);
if (unlikely(!__pyx_tuple__3)) __PYX_ERR(0, 143, __pyx_L1_error)
5044 __Pyx_GOTREF(__pyx_tuple__3);
5045 __Pyx_GIVEREF(__pyx_tuple__3);
5046 __pyx_codeobj__4 = (PyObject*)__Pyx_PyCode_New(8, 0, 8, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__3, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_proteus_ctimeIntegration_pyx, __pyx_n_s_psiTCtteDT, 143, __pyx_empty_bytes);
if (unlikely(!__pyx_codeobj__4)) __PYX_ERR(0, 143, __pyx_L1_error)
5055 __pyx_tuple__5 = PyTuple_Pack(13, __pyx_n_s_limiterFlag, __pyx_n_s_nElements_global, __pyx_n_s_nNodes_element, __pyx_n_s_nElementBoundaries_element, __pyx_n_s_nDOF_element, __pyx_n_s_elementNodesArray, __pyx_n_s_elementNeighborsArray, __pyx_n_s_nodeArray, __pyx_n_s_elementBarycentersArray, __pyx_n_s_l2g, __pyx_n_s_tag, __pyx_n_s_Uin, __pyx_n_s_Uout);
if (unlikely(!__pyx_tuple__5)) __PYX_ERR(0, 160, __pyx_L1_error)
5056 __Pyx_GOTREF(__pyx_tuple__5);
5057 __Pyx_GIVEREF(__pyx_tuple__5);
5058 __pyx_codeobj__6 = (PyObject*)__Pyx_PyCode_New(13, 0, 13, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__5, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_proteus_ctimeIntegration_pyx, __pyx_n_s_applyDGlimitingP1Lagrange1d, 160, __pyx_empty_bytes);
if (unlikely(!__pyx_codeobj__6)) __PYX_ERR(0, 160, __pyx_L1_error)
5067 __pyx_tuple__7 = PyTuple_Pack(14, __pyx_n_s_enforcePositivity, __pyx_n_s_vacuumTol, __pyx_n_s_nElements_global, __pyx_n_s_nNodes_element, __pyx_n_s_nElementBoundaries_element, __pyx_n_s_nDOF_element, __pyx_n_s_elementNodesArray, __pyx_n_s_elementNeighborsArray, __pyx_n_s_nodeArray, __pyx_n_s_elementBarycentersArray, __pyx_n_s_l2g, __pyx_n_s_tag, __pyx_n_s_Uin, __pyx_n_s_Uout);
if (unlikely(!__pyx_tuple__7)) __PYX_ERR(0, 187, __pyx_L1_error)
5068 __Pyx_GOTREF(__pyx_tuple__7);
5069 __Pyx_GIVEREF(__pyx_tuple__7);
5070 __pyx_codeobj__8 = (PyObject*)__Pyx_PyCode_New(14, 0, 14, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__7, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_proteus_ctimeIntegration_pyx, __pyx_n_s_applyDGlimitingP1Lagrange1d_with, 187, __pyx_empty_bytes);
if (unlikely(!__pyx_codeobj__8)) __PYX_ERR(0, 187, __pyx_L1_error)
5079 __pyx_tuple__9 = PyTuple_Pack(5, __pyx_n_s_elementBoundariesArray, __pyx_n_s_elementNeighborsArray, __pyx_n_s_elementBarycentersArray, __pyx_n_s_elementBoundaryBarycentersArray, __pyx_n_s_elementNeighborShapeGradients);
if (unlikely(!__pyx_tuple__9)) __PYX_ERR(0, 217, __pyx_L1_error)
5080 __Pyx_GOTREF(__pyx_tuple__9);
5081 __Pyx_GIVEREF(__pyx_tuple__9);
5082 __pyx_codeobj__10 = (PyObject*)__Pyx_PyCode_New(5, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__9, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_proteus_ctimeIntegration_pyx, __pyx_n_s_computeElementNeighborShapeGradi, 217, __pyx_empty_bytes);
if (unlikely(!__pyx_codeobj__10)) __PYX_ERR(0, 217, __pyx_L1_error)
5091 __pyx_tuple__11 = PyTuple_Pack(7, __pyx_n_s_elementBoundariesArray, __pyx_n_s_elementNeighborsArray, __pyx_n_s_elementBarycentersArray, __pyx_n_s_elementBoundaryBarycentersArray, __pyx_n_s_elementNeighborShapeGradients, __pyx_n_s_alphas, __pyx_n_s_alphaNeighbors);
if (unlikely(!__pyx_tuple__11)) __PYX_ERR(0, 231, __pyx_L1_error)
5092 __Pyx_GOTREF(__pyx_tuple__11);
5093 __Pyx_GIVEREF(__pyx_tuple__11);
5094 __pyx_codeobj__12 = (PyObject*)__Pyx_PyCode_New(7, 0, 7, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__11, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_proteus_ctimeIntegration_pyx, __pyx_n_s_computeCockburnDGlimiterArrays2d, 231, __pyx_empty_bytes);
if (unlikely(!__pyx_codeobj__12)) __PYX_ERR(0, 231, __pyx_L1_error)
5103 __pyx_tuple__13 = PyTuple_Pack(9, __pyx_n_s_nu, __pyx_n_s_Mh2, __pyx_n_s_elementNeighborsArray, __pyx_n_s_l2g, __pyx_n_s_tag, __pyx_n_s_alphas, __pyx_n_s_alphaNeighbors, __pyx_n_s_Uin, __pyx_n_s_Uout);
if (unlikely(!__pyx_tuple__13)) __PYX_ERR(0, 249, __pyx_L1_error)
5104 __Pyx_GOTREF(__pyx_tuple__13);
5105 __Pyx_GIVEREF(__pyx_tuple__13);
5106 __pyx_codeobj__14 = (PyObject*)__Pyx_PyCode_New(9, 0, 9, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__13, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_proteus_ctimeIntegration_pyx, __pyx_n_s_applyCockburnDGlimiterP1Lagrange, 249, __pyx_empty_bytes);
if (unlikely(!__pyx_codeobj__14)) __PYX_ERR(0, 249, __pyx_L1_error)
5115 __pyx_tuple__15 = PyTuple_Pack(20, __pyx_n_s_killExtrema, __pyx_n_s_allowMinWithUndershoot, __pyx_n_s_nElements_global, __pyx_n_s_nElementBoundaries_element, __pyx_n_s_nNodes_element, __pyx_n_s_nSpace, __pyx_n_s_nDOF_element, __pyx_n_s_elementNeighborsArray, __pyx_n_s_elementBoundariesArray, __pyx_n_s_elementNodesArray, __pyx_n_s_nodeArray, __pyx_n_s_elementBarycentersArray, __pyx_n_s_elementBoundaryBarycentersArray, __pyx_n_s_elementNeighborShapeGradients, __pyx_n_s_l2g, __pyx_n_s_grad_v0, __pyx_n_s_elementAverages, __pyx_n_s_tag, __pyx_n_s_Uin, __pyx_n_s_Uout);
if (unlikely(!__pyx_tuple__15)) __PYX_ERR(0, 272, __pyx_L1_error)
5116 __Pyx_GOTREF(__pyx_tuple__15);
5117 __Pyx_GIVEREF(__pyx_tuple__15);
5118 __pyx_codeobj__16 = (PyObject*)__Pyx_PyCode_New(20, 0, 20, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__15, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_proteus_ctimeIntegration_pyx, __pyx_n_s_applyDurlofskyDGlimiterP1Lagrang, 272, __pyx_empty_bytes);
if (unlikely(!__pyx_codeobj__16)) __PYX_ERR(0, 272, __pyx_L1_error)
5127 __pyx_tuple__17 = PyTuple_Pack(20, __pyx_n_s_killExtrema, __pyx_n_s_allowMinWithUndershoot, __pyx_n_s_nElements_global, __pyx_n_s_nElementBoundaries_element, __pyx_n_s_nNodes_element, __pyx_n_s_nSpace, __pyx_n_s_nDOF_element, __pyx_n_s_elementNeighborsArray, __pyx_n_s_elementBoundariesArray, __pyx_n_s_elementNodesArray, __pyx_n_s_nodeArray, __pyx_n_s_elementBarycentersArray, __pyx_n_s_elementBoundaryBarycentersArray, __pyx_n_s_elementNeighborShapeGradients, __pyx_n_s_l2g, __pyx_n_s_grad_v0, __pyx_n_s_elementAverages, __pyx_n_s_tag, __pyx_n_s_Uin, __pyx_n_s_Uout);
if (unlikely(!__pyx_tuple__17)) __PYX_ERR(0, 313, __pyx_L1_error)
5128 __Pyx_GOTREF(__pyx_tuple__17);
5129 __Pyx_GIVEREF(__pyx_tuple__17);
5130 __pyx_codeobj__18 = (PyObject*)__Pyx_PyCode_New(20, 0, 20, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__17, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_proteus_ctimeIntegration_pyx, __pyx_n_s_applyDurlofskyDGlimiterP1Lagrang_2, 313, __pyx_empty_bytes);
if (unlikely(!__pyx_codeobj__18)) __PYX_ERR(0, 313, __pyx_L1_error)
5139 __pyx_tuple__19 = PyTuple_Pack(22, __pyx_n_s_killExtrema, __pyx_n_s_allowMinWithUndershoot, __pyx_n_s_enforcePositivity, __pyx_n_s_vacuumTol, __pyx_n_s_nElements_global, __pyx_n_s_nElementBoundaries_element, __pyx_n_s_nNodes_element, __pyx_n_s_nSpace, __pyx_n_s_nDOF_element, __pyx_n_s_elementNeighborsArray, __pyx_n_s_elementBoundariesArray, __pyx_n_s_elementNodesArray, __pyx_n_s_nodeArray, __pyx_n_s_elementBarycentersArray, __pyx_n_s_elementBoundaryBarycentersArray, __pyx_n_s_elementNeighborShapeGradients, __pyx_n_s_l2g, __pyx_n_s_grad_v0, __pyx_n_s_elementAverages, __pyx_n_s_tag, __pyx_n_s_Uin, __pyx_n_s_Uout);
if (unlikely(!__pyx_tuple__19)) __PYX_ERR(0, 354, __pyx_L1_error)
5140 __Pyx_GOTREF(__pyx_tuple__19);
5141 __Pyx_GIVEREF(__pyx_tuple__19);
5142 __pyx_codeobj__20 = (PyObject*)__Pyx_PyCode_New(22, 0, 22, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__19, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_proteus_ctimeIntegration_pyx, __pyx_n_s_applyDurlofskyDGlimiterP1Lagrang_3, 354, __pyx_empty_bytes);
if (unlikely(!__pyx_codeobj__20)) __PYX_ERR(0, 354, __pyx_L1_error)
5143 __Pyx_RefNannyFinishContext();
5146 __Pyx_RefNannyFinishContext();
5150 static CYTHON_SMALL_CODE
int __Pyx_InitGlobals(
void) {
5151 if (__Pyx_InitStrings(__pyx_string_tab) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
5157 static CYTHON_SMALL_CODE
int __Pyx_modinit_global_init_code(
void);
5158 static CYTHON_SMALL_CODE
int __Pyx_modinit_variable_export_code(
void);
5159 static CYTHON_SMALL_CODE
int __Pyx_modinit_function_export_code(
void);
5160 static CYTHON_SMALL_CODE
int __Pyx_modinit_type_init_code(
void);
5161 static CYTHON_SMALL_CODE
int __Pyx_modinit_type_import_code(
void);
5162 static CYTHON_SMALL_CODE
int __Pyx_modinit_variable_import_code(
void);
5163 static CYTHON_SMALL_CODE
int __Pyx_modinit_function_import_code(
void);
5165 static int __Pyx_modinit_global_init_code(
void) {
5166 __Pyx_RefNannyDeclarations
5167 __Pyx_RefNannySetupContext(
"__Pyx_modinit_global_init_code", 0);
5169 __Pyx_RefNannyFinishContext();
5173 static int __Pyx_modinit_variable_export_code(
void) {
5174 __Pyx_RefNannyDeclarations
5175 __Pyx_RefNannySetupContext(
"__Pyx_modinit_variable_export_code", 0);
5177 __Pyx_RefNannyFinishContext();
5181 static int __Pyx_modinit_function_export_code(
void) {
5182 __Pyx_RefNannyDeclarations
5183 __Pyx_RefNannySetupContext(
"__Pyx_modinit_function_export_code", 0);
5185 __Pyx_RefNannyFinishContext();
5189 static int __Pyx_modinit_type_init_code(
void) {
5190 __Pyx_RefNannyDeclarations
5191 __Pyx_RefNannySetupContext(
"__Pyx_modinit_type_init_code", 0);
5193 __Pyx_RefNannyFinishContext();
5197 static int __Pyx_modinit_type_import_code(
void) {
5198 __Pyx_RefNannyDeclarations
5199 PyObject *__pyx_t_1 = NULL;
5200 int __pyx_lineno = 0;
5201 const char *__pyx_filename = NULL;
5202 int __pyx_clineno = 0;
5203 __Pyx_RefNannySetupContext(
"__Pyx_modinit_type_import_code", 0);
5205 __pyx_t_1 = PyImport_ImportModule(__Pyx_BUILTIN_MODULE_NAME);
if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 9, __pyx_L1_error)
5206 __Pyx_GOTREF(__pyx_t_1);
5207 __pyx_ptype_7cpython_4type_type = __Pyx_ImportType(__pyx_t_1, __Pyx_BUILTIN_MODULE_NAME,
"type",
5208 #
if defined(PYPY_VERSION_NUM) && PYPY_VERSION_NUM < 0x050B0000
5209 sizeof(PyTypeObject),
5211 sizeof(PyHeapTypeObject),
5213 __Pyx_ImportType_CheckSize_Warn);
5214 if (!__pyx_ptype_7cpython_4type_type) __PYX_ERR(2, 9, __pyx_L1_error)
5215 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
5216 __pyx_t_1 = PyImport_ImportModule(
"numpy");
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 200, __pyx_L1_error)
5217 __Pyx_GOTREF(__pyx_t_1);
5218 __pyx_ptype_5numpy_dtype = __Pyx_ImportType(__pyx_t_1,
"numpy",
"dtype",
sizeof(PyArray_Descr), __Pyx_ImportType_CheckSize_Ignore);
5219 if (!__pyx_ptype_5numpy_dtype) __PYX_ERR(1, 200, __pyx_L1_error)
5220 __pyx_ptype_5numpy_flatiter = __Pyx_ImportType(__pyx_t_1,
"numpy",
"flatiter",
sizeof(PyArrayIterObject), __Pyx_ImportType_CheckSize_Ignore);
5221 if (!__pyx_ptype_5numpy_flatiter) __PYX_ERR(1, 223, __pyx_L1_error)
5222 __pyx_ptype_5numpy_broadcast = __Pyx_ImportType(__pyx_t_1,
"numpy",
"broadcast",
sizeof(PyArrayMultiIterObject), __Pyx_ImportType_CheckSize_Ignore);
5223 if (!__pyx_ptype_5numpy_broadcast) __PYX_ERR(1, 227, __pyx_L1_error)
5224 __pyx_ptype_5numpy_ndarray = __Pyx_ImportType(__pyx_t_1,
"numpy",
"ndarray",
sizeof(PyArrayObject), __Pyx_ImportType_CheckSize_Ignore);
5225 if (!__pyx_ptype_5numpy_ndarray) __PYX_ERR(1, 239, __pyx_L1_error)
5226 __pyx_ptype_5numpy_generic = __Pyx_ImportType(__pyx_t_1,
"numpy",
"generic",
sizeof(PyObject), __Pyx_ImportType_CheckSize_Warn);
5227 if (!__pyx_ptype_5numpy_generic) __PYX_ERR(1, 771, __pyx_L1_error)
5228 __pyx_ptype_5numpy_number = __Pyx_ImportType(__pyx_t_1,
"numpy",
"number",
sizeof(PyObject), __Pyx_ImportType_CheckSize_Warn);
5229 if (!__pyx_ptype_5numpy_number) __PYX_ERR(1, 773, __pyx_L1_error)
5230 __pyx_ptype_5numpy_integer = __Pyx_ImportType(__pyx_t_1,
"numpy",
"integer",
sizeof(PyObject), __Pyx_ImportType_CheckSize_Warn);
5231 if (!__pyx_ptype_5numpy_integer) __PYX_ERR(1, 775, __pyx_L1_error)
5232 __pyx_ptype_5numpy_signedinteger = __Pyx_ImportType(__pyx_t_1,
"numpy",
"signedinteger",
sizeof(PyObject), __Pyx_ImportType_CheckSize_Warn);
5233 if (!__pyx_ptype_5numpy_signedinteger) __PYX_ERR(1, 777, __pyx_L1_error)
5234 __pyx_ptype_5numpy_unsignedinteger = __Pyx_ImportType(__pyx_t_1,
"numpy",
"unsignedinteger",
sizeof(PyObject), __Pyx_ImportType_CheckSize_Warn);
5235 if (!__pyx_ptype_5numpy_unsignedinteger) __PYX_ERR(1, 779, __pyx_L1_error)
5236 __pyx_ptype_5numpy_inexact = __Pyx_ImportType(__pyx_t_1,
"numpy",
"inexact",
sizeof(PyObject), __Pyx_ImportType_CheckSize_Warn);
5237 if (!__pyx_ptype_5numpy_inexact) __PYX_ERR(1, 781, __pyx_L1_error)
5238 __pyx_ptype_5numpy_floating = __Pyx_ImportType(__pyx_t_1,
"numpy",
"floating",
sizeof(PyObject), __Pyx_ImportType_CheckSize_Warn);
5239 if (!__pyx_ptype_5numpy_floating) __PYX_ERR(1, 783, __pyx_L1_error)
5240 __pyx_ptype_5numpy_complexfloating = __Pyx_ImportType(__pyx_t_1,
"numpy",
"complexfloating",
sizeof(PyObject), __Pyx_ImportType_CheckSize_Warn);
5241 if (!__pyx_ptype_5numpy_complexfloating) __PYX_ERR(1, 785, __pyx_L1_error)
5242 __pyx_ptype_5numpy_flexible = __Pyx_ImportType(__pyx_t_1,
"numpy",
"flexible",
sizeof(PyObject), __Pyx_ImportType_CheckSize_Warn);
5243 if (!__pyx_ptype_5numpy_flexible) __PYX_ERR(1, 787, __pyx_L1_error)
5244 __pyx_ptype_5numpy_character = __Pyx_ImportType(__pyx_t_1,
"numpy",
"character",
sizeof(PyObject), __Pyx_ImportType_CheckSize_Warn);
5245 if (!__pyx_ptype_5numpy_character) __PYX_ERR(1, 789, __pyx_L1_error)
5246 __pyx_ptype_5numpy_ufunc = __Pyx_ImportType(__pyx_t_1,
"numpy",
"ufunc",
sizeof(PyUFuncObject), __Pyx_ImportType_CheckSize_Ignore);
5247 if (!__pyx_ptype_5numpy_ufunc) __PYX_ERR(1, 827, __pyx_L1_error)
5248 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
5249 __Pyx_RefNannyFinishContext();
5252 __Pyx_XDECREF(__pyx_t_1);
5253 __Pyx_RefNannyFinishContext();
5257 static int __Pyx_modinit_variable_import_code(
void) {
5258 __Pyx_RefNannyDeclarations
5259 __Pyx_RefNannySetupContext(
"__Pyx_modinit_variable_import_code", 0);
5261 __Pyx_RefNannyFinishContext();
5265 static int __Pyx_modinit_function_import_code(
void) {
5266 __Pyx_RefNannyDeclarations
5267 __Pyx_RefNannySetupContext(
"__Pyx_modinit_function_import_code", 0);
5269 __Pyx_RefNannyFinishContext();
5274 #ifndef CYTHON_NO_PYINIT_EXPORT
5275 #define __Pyx_PyMODINIT_FUNC PyMODINIT_FUNC
5276 #elif PY_MAJOR_VERSION < 3
5278 #define __Pyx_PyMODINIT_FUNC extern "C" void
5280 #define __Pyx_PyMODINIT_FUNC void
5284 #define __Pyx_PyMODINIT_FUNC extern "C" PyObject *
5286 #define __Pyx_PyMODINIT_FUNC PyObject *
5291 #if PY_MAJOR_VERSION < 3
5292 __Pyx_PyMODINIT_FUNC initctimeIntegration(
void) CYTHON_SMALL_CODE;
5293 __Pyx_PyMODINIT_FUNC initctimeIntegration(
void)
5295 __Pyx_PyMODINIT_FUNC PyInit_ctimeIntegration(
void) CYTHON_SMALL_CODE;
5296 __Pyx_PyMODINIT_FUNC PyInit_ctimeIntegration(
void)
5297 #if CYTHON_PEP489_MULTI_PHASE_INIT
5299 return PyModuleDef_Init(&__pyx_moduledef);
5301 static CYTHON_SMALL_CODE
int __Pyx_check_single_interpreter(
void) {
5302 #if PY_VERSION_HEX >= 0x030700A1
5303 static PY_INT64_T main_interpreter_id = -1;
5304 PY_INT64_T current_id = PyInterpreterState_GetID(PyThreadState_Get()->interp);
5305 if (main_interpreter_id == -1) {
5306 main_interpreter_id = current_id;
5307 return (unlikely(current_id == -1)) ? -1 : 0;
5308 }
else if (unlikely(main_interpreter_id != current_id))
5310 static PyInterpreterState *main_interpreter = NULL;
5311 PyInterpreterState *current_interpreter = PyThreadState_Get()->interp;
5312 if (!main_interpreter) {
5313 main_interpreter = current_interpreter;
5314 }
else if (unlikely(main_interpreter != current_interpreter))
5319 "Interpreter change detected - this module can only be loaded into one interpreter per process.");
5324 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) {
5325 PyObject *value = PyObject_GetAttrString(spec, from_name);
5327 if (likely(value)) {
5328 if (allow_none || value != Py_None) {
5329 result = PyDict_SetItemString(moddict, to_name, value);
5332 }
else if (PyErr_ExceptionMatches(PyExc_AttributeError)) {
5339 static CYTHON_SMALL_CODE PyObject* __pyx_pymod_create(PyObject *spec, CYTHON_UNUSED PyModuleDef *def) {
5340 PyObject *module = NULL, *moddict, *modname;
5341 if (__Pyx_check_single_interpreter())
5344 return __Pyx_NewRef(__pyx_m);
5345 modname = PyObject_GetAttrString(spec,
"name");
5346 if (unlikely(!modname))
goto bad;
5347 module = PyModule_NewObject(modname);
5349 if (unlikely(!module))
goto bad;
5350 moddict = PyModule_GetDict(module);
5351 if (unlikely(!moddict))
goto bad;
5352 if (unlikely(__Pyx_copy_spec_to_module(spec, moddict,
"loader",
"__loader__", 1) < 0))
goto bad;
5353 if (unlikely(__Pyx_copy_spec_to_module(spec, moddict,
"origin",
"__file__", 1) < 0))
goto bad;
5354 if (unlikely(__Pyx_copy_spec_to_module(spec, moddict,
"parent",
"__package__", 1) < 0))
goto bad;
5355 if (unlikely(__Pyx_copy_spec_to_module(spec, moddict,
"submodule_search_locations",
"__path__", 0) < 0))
goto bad;
5363 static CYTHON_SMALL_CODE
int __pyx_pymod_exec_ctimeIntegration(PyObject *__pyx_pyinit_module)
5367 PyObject *__pyx_t_1 = NULL;
5368 int __pyx_lineno = 0;
5369 const char *__pyx_filename = NULL;
5370 int __pyx_clineno = 0;
5371 __Pyx_RefNannyDeclarations
5372 #if CYTHON_PEP489_MULTI_PHASE_INIT
5374 if (__pyx_m == __pyx_pyinit_module)
return 0;
5375 PyErr_SetString(PyExc_RuntimeError,
"Module 'ctimeIntegration' has already been imported. Re-initialisation is not supported.");
5378 #elif PY_MAJOR_VERSION >= 3
5379 if (__pyx_m)
return __Pyx_NewRef(__pyx_m);
5382 __Pyx_RefNanny = __Pyx_RefNannyImportAPI(
"refnanny");
5383 if (!__Pyx_RefNanny) {
5385 __Pyx_RefNanny = __Pyx_RefNannyImportAPI(
"Cython.Runtime.refnanny");
5386 if (!__Pyx_RefNanny)
5387 Py_FatalError(
"failed to import 'refnanny' module");
5390 __Pyx_RefNannySetupContext(
"__Pyx_PyMODINIT_FUNC PyInit_ctimeIntegration(void)", 0);
5391 if (__Pyx_check_binary_version() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
5392 #ifdef __Pxy_PyFrame_Initialize_Offsets
5393 __Pxy_PyFrame_Initialize_Offsets();
5395 __pyx_empty_tuple = PyTuple_New(0);
if (unlikely(!__pyx_empty_tuple)) __PYX_ERR(0, 1, __pyx_L1_error)
5396 __pyx_empty_bytes = PyBytes_FromStringAndSize(
"", 0);
if (unlikely(!__pyx_empty_bytes)) __PYX_ERR(0, 1, __pyx_L1_error)
5397 __pyx_empty_unicode = PyUnicode_FromStringAndSize(
"", 0);
if (unlikely(!__pyx_empty_unicode)) __PYX_ERR(0, 1, __pyx_L1_error)
5398 #ifdef __Pyx_CyFunction_USED
5399 if (__pyx_CyFunction_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
5401 #ifdef __Pyx_FusedFunction_USED
5402 if (__pyx_FusedFunction_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
5404 #ifdef __Pyx_Coroutine_USED
5405 if (__pyx_Coroutine_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
5407 #ifdef __Pyx_Generator_USED
5408 if (__pyx_Generator_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
5410 #ifdef __Pyx_AsyncGen_USED
5411 if (__pyx_AsyncGen_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
5413 #ifdef __Pyx_StopAsyncIteration_USED
5414 if (__pyx_StopAsyncIteration_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
5418 #if defined(WITH_THREAD) && PY_VERSION_HEX < 0x030700F0 && defined(__PYX_FORCE_INIT_THREADS) && __PYX_FORCE_INIT_THREADS
5419 PyEval_InitThreads();
5422 #if CYTHON_PEP489_MULTI_PHASE_INIT
5423 __pyx_m = __pyx_pyinit_module;
5426 #if PY_MAJOR_VERSION < 3
5427 __pyx_m = Py_InitModule4(
"ctimeIntegration", __pyx_methods, 0, 0, PYTHON_API_VERSION); Py_XINCREF(__pyx_m);
5429 __pyx_m = PyModule_Create(&__pyx_moduledef);
5431 if (unlikely(!__pyx_m)) __PYX_ERR(0, 1, __pyx_L1_error)
5433 __pyx_d = PyModule_GetDict(__pyx_m);
if (unlikely(!__pyx_d)) __PYX_ERR(0, 1, __pyx_L1_error)
5435 __pyx_b = PyImport_AddModule(__Pyx_BUILTIN_MODULE_NAME);
if (unlikely(!__pyx_b)) __PYX_ERR(0, 1, __pyx_L1_error)
5437 __pyx_cython_runtime = PyImport_AddModule((
char *)
"cython_runtime");
if (unlikely(!__pyx_cython_runtime)) __PYX_ERR(0, 1, __pyx_L1_error)
5438 Py_INCREF(__pyx_cython_runtime);
5439 if (PyObject_SetAttrString(__pyx_m,
"__builtins__", __pyx_b) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
5441 if (__Pyx_InitGlobals() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
5442 #if PY_MAJOR_VERSION < 3 && (__PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT)
5443 if (__Pyx_init_sys_getdefaultencoding_params() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
5445 if (__pyx_module_is_main_ctimeIntegration) {
5446 if (PyObject_SetAttr(__pyx_m, __pyx_n_s_name, __pyx_n_s_main) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
5448 #if PY_MAJOR_VERSION >= 3
5450 PyObject *modules = PyImport_GetModuleDict();
if (unlikely(!modules)) __PYX_ERR(0, 1, __pyx_L1_error)
5451 if (!PyDict_GetItemString(modules,
"ctimeIntegration")) {
5452 if (unlikely(PyDict_SetItemString(modules,
"ctimeIntegration", __pyx_m) < 0)) __PYX_ERR(0, 1, __pyx_L1_error)
5457 if (__Pyx_InitCachedBuiltins() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
5459 if (__Pyx_InitCachedConstants() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
5461 (void)__Pyx_modinit_global_init_code();
5462 (void)__Pyx_modinit_variable_export_code();
5463 (void)__Pyx_modinit_function_export_code();
5464 (void)__Pyx_modinit_type_init_code();
5465 if (unlikely(__Pyx_modinit_type_import_code() < 0)) __PYX_ERR(0, 1, __pyx_L1_error)
5466 (void)__Pyx_modinit_variable_import_code();
5467 (void)__Pyx_modinit_function_import_code();
5469 #if defined(__Pyx_Generator_USED) || defined(__Pyx_Coroutine_USED)
5470 if (__Pyx_patch_abc() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
5479 __pyx_t_1 = __Pyx_Import(__pyx_n_s_numpy, 0, -1);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2, __pyx_L1_error)
5480 __Pyx_GOTREF(__pyx_t_1);
5481 if (PyDict_SetItem(__pyx_d, __pyx_n_s_np, __pyx_t_1) < 0) __PYX_ERR(0, 2, __pyx_L1_error)
5482 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
5491 __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_16ctimeIntegration_1psiTCtteDT, NULL, __pyx_n_s_ctimeIntegration);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 143, __pyx_L1_error)
5492 __Pyx_GOTREF(__pyx_t_1);
5493 if (PyDict_SetItem(__pyx_d, __pyx_n_s_psiTCtteDT, __pyx_t_1) < 0) __PYX_ERR(0, 143, __pyx_L1_error)
5494 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
5503 __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_16ctimeIntegration_3applyDGlimitingP1Lagrange1d, NULL, __pyx_n_s_ctimeIntegration);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 160, __pyx_L1_error)
5504 __Pyx_GOTREF(__pyx_t_1);
5505 if (PyDict_SetItem(__pyx_d, __pyx_n_s_applyDGlimitingP1Lagrange1d, __pyx_t_1) < 0) __PYX_ERR(0, 160, __pyx_L1_error)
5506 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
5515 __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_16ctimeIntegration_5applyDGlimitingP1Lagrange1d_withVacuumTol, NULL, __pyx_n_s_ctimeIntegration);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 187, __pyx_L1_error)
5516 __Pyx_GOTREF(__pyx_t_1);
5517 if (PyDict_SetItem(__pyx_d, __pyx_n_s_applyDGlimitingP1Lagrange1d_with, __pyx_t_1) < 0) __PYX_ERR(0, 187, __pyx_L1_error)
5518 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
5527 __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_16ctimeIntegration_7computeElementNeighborShapeGradients, NULL, __pyx_n_s_ctimeIntegration);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 217, __pyx_L1_error)
5528 __Pyx_GOTREF(__pyx_t_1);
5529 if (PyDict_SetItem(__pyx_d, __pyx_n_s_computeElementNeighborShapeGradi, __pyx_t_1) < 0) __PYX_ERR(0, 217, __pyx_L1_error)
5530 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
5539 __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_16ctimeIntegration_9computeCockburnDGlimiterArrays2d, NULL, __pyx_n_s_ctimeIntegration);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 231, __pyx_L1_error)
5540 __Pyx_GOTREF(__pyx_t_1);
5541 if (PyDict_SetItem(__pyx_d, __pyx_n_s_computeCockburnDGlimiterArrays2d, __pyx_t_1) < 0) __PYX_ERR(0, 231, __pyx_L1_error)
5542 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
5551 __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_16ctimeIntegration_11applyCockburnDGlimiterP1Lagrange2d, NULL, __pyx_n_s_ctimeIntegration);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 249, __pyx_L1_error)
5552 __Pyx_GOTREF(__pyx_t_1);
5553 if (PyDict_SetItem(__pyx_d, __pyx_n_s_applyCockburnDGlimiterP1Lagrange, __pyx_t_1) < 0) __PYX_ERR(0, 249, __pyx_L1_error)
5554 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
5563 __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_16ctimeIntegration_13applyDurlofskyDGlimiterP1Lagrange2d, NULL, __pyx_n_s_ctimeIntegration);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 272, __pyx_L1_error)
5564 __Pyx_GOTREF(__pyx_t_1);
5565 if (PyDict_SetItem(__pyx_d, __pyx_n_s_applyDurlofskyDGlimiterP1Lagrang, __pyx_t_1) < 0) __PYX_ERR(0, 272, __pyx_L1_error)
5566 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
5575 __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_16ctimeIntegration_15applyDurlofskyDGlimiterP1Lagrange3d, NULL, __pyx_n_s_ctimeIntegration);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 313, __pyx_L1_error)
5576 __Pyx_GOTREF(__pyx_t_1);
5577 if (PyDict_SetItem(__pyx_d, __pyx_n_s_applyDurlofskyDGlimiterP1Lagrang_2, __pyx_t_1) < 0) __PYX_ERR(0, 313, __pyx_L1_error)
5578 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
5587 __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_16ctimeIntegration_17applyDurlofskyDGlimiterP1Lagrange2d_withVacuumTol, NULL, __pyx_n_s_ctimeIntegration);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 354, __pyx_L1_error)
5588 __Pyx_GOTREF(__pyx_t_1);
5589 if (PyDict_SetItem(__pyx_d, __pyx_n_s_applyDurlofskyDGlimiterP1Lagrang_3, __pyx_t_1) < 0) __PYX_ERR(0, 354, __pyx_L1_error)
5590 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
5597 __pyx_t_1 = __Pyx_PyDict_NewPresized(0);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1, __pyx_L1_error)
5598 __Pyx_GOTREF(__pyx_t_1);
5599 if (PyDict_SetItem(__pyx_d, __pyx_n_s_test, __pyx_t_1) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
5600 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
5614 __Pyx_XDECREF(__pyx_t_1);
5617 __Pyx_AddTraceback(
"init ctimeIntegration", __pyx_clineno, __pyx_lineno, __pyx_filename);
5620 }
else if (!PyErr_Occurred()) {
5621 PyErr_SetString(PyExc_ImportError,
"init ctimeIntegration");
5624 __Pyx_RefNannyFinishContext();
5625 #if CYTHON_PEP489_MULTI_PHASE_INIT
5626 return (__pyx_m != NULL) ? 0 : -1;
5627 #elif PY_MAJOR_VERSION >= 3
5637 static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(
const char *modname) {
5638 PyObject *m = NULL, *p = NULL;
5640 m = PyImport_ImportModule(modname);
5642 p = PyObject_GetAttrString(m,
"RefNannyAPI");
5644 r = PyLong_AsVoidPtr(p);
5648 return (__Pyx_RefNannyAPIStruct *)
r;
5653 static void __Pyx_RaiseArgtupleInvalid(
5654 const char* func_name,
5658 Py_ssize_t num_found)
5660 Py_ssize_t num_expected;
5661 const char *more_or_less;
5662 if (num_found < num_min) {
5663 num_expected = num_min;
5664 more_or_less =
"at least";
5666 num_expected = num_max;
5667 more_or_less =
"at most";
5670 more_or_less =
"exactly";
5672 PyErr_Format(PyExc_TypeError,
5673 "%.200s() takes %.8s %" CYTHON_FORMAT_SSIZE_T
"d positional argument%.1s (%" CYTHON_FORMAT_SSIZE_T
"d given)",
5674 func_name, more_or_less, num_expected,
5675 (num_expected == 1) ?
"" :
"s", num_found);
5679 static void __Pyx_RaiseDoubleKeywordsError(
5680 const char* func_name,
5683 PyErr_Format(PyExc_TypeError,
5684 #
if PY_MAJOR_VERSION >= 3
5685 "%s() got multiple values for keyword argument '%U'", func_name, kw_name);
5687 "%s() got multiple values for keyword argument '%s'", func_name,
5688 PyString_AsString(kw_name));
5693 static int __Pyx_ParseOptionalKeywords(
5695 PyObject **argnames[],
5698 Py_ssize_t num_pos_args,
5699 const char* function_name)
5701 PyObject *key = 0, *value = 0;
5704 PyObject*** first_kw_arg = argnames + num_pos_args;
5705 while (PyDict_Next(kwds, &
pos, &key, &value)) {
5706 name = first_kw_arg;
5707 while (*name && (**name != key)) name++;
5709 values[name-argnames] = value;
5712 name = first_kw_arg;
5713 #if PY_MAJOR_VERSION < 3
5714 if (likely(PyString_Check(key))) {
5716 if ((CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**name) == PyString_GET_SIZE(key))
5717 && _PyString_Eq(**name, key)) {
5718 values[name-argnames] = value;
5723 if (*name)
continue;
5725 PyObject*** argname = argnames;
5726 while (argname != first_kw_arg) {
5727 if ((**argname == key) || (
5728 (CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**argname) == PyString_GET_SIZE(key))
5729 && _PyString_Eq(**argname, key))) {
5730 goto arg_passed_twice;
5737 if (likely(PyUnicode_Check(key))) {
5739 int cmp = (**name == key) ? 0 :
5740 #
if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3
5741 (__Pyx_PyUnicode_GET_LENGTH(**name) != __Pyx_PyUnicode_GET_LENGTH(key)) ? 1 :
5743 PyUnicode_Compare(**name, key);
5744 if (cmp < 0 && unlikely(PyErr_Occurred()))
goto bad;
5746 values[name-argnames] = value;
5751 if (*name)
continue;
5753 PyObject*** argname = argnames;
5754 while (argname != first_kw_arg) {
5755 int cmp = (**argname == key) ? 0 :
5756 #
if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3
5757 (__Pyx_PyUnicode_GET_LENGTH(**argname) != __Pyx_PyUnicode_GET_LENGTH(key)) ? 1 :
5759 PyUnicode_Compare(**argname, key);
5760 if (cmp < 0 && unlikely(PyErr_Occurred()))
goto bad;
5761 if (cmp == 0)
goto arg_passed_twice;
5766 goto invalid_keyword_type;
5768 if (unlikely(PyDict_SetItem(kwds2, key, value)))
goto bad;
5770 goto invalid_keyword;
5775 __Pyx_RaiseDoubleKeywordsError(function_name, key);
5777 invalid_keyword_type:
5778 PyErr_Format(PyExc_TypeError,
5779 "%.200s() keywords must be strings", function_name);
5782 PyErr_Format(PyExc_TypeError,
5783 #
if PY_MAJOR_VERSION < 3
5784 "%.200s() got an unexpected keyword argument '%.200s'",
5785 function_name, PyString_AsString(key));
5787 "%s() got an unexpected keyword argument '%U'",
5788 function_name, key);
5795 static int __Pyx__ArgTypeTest(PyObject *obj, PyTypeObject *type,
const char *name,
int exact)
5797 if (unlikely(!type)) {
5798 PyErr_SetString(PyExc_SystemError,
"Missing type object");
5802 #if PY_MAJOR_VERSION == 2
5803 if ((type == &PyBaseString_Type) && likely(__Pyx_PyBaseString_CheckExact(obj)))
return 1;
5807 if (likely(__Pyx_TypeCheck(obj, type)))
return 1;
5809 PyErr_Format(PyExc_TypeError,
5810 "Argument '%.200s' has incorrect type (expected %.200s, got %.200s)",
5811 name, type->tp_name, Py_TYPE(obj)->tp_name);
5816 #if CYTHON_USE_TYPE_SLOTS
5817 static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name) {
5818 PyTypeObject* tp = Py_TYPE(obj);
5819 if (likely(tp->tp_getattro))
5820 return tp->tp_getattro(obj, attr_name);
5821 #if PY_MAJOR_VERSION < 3
5822 if (likely(tp->tp_getattr))
5823 return tp->tp_getattr(obj, PyString_AS_STRING(attr_name));
5825 return PyObject_GetAttr(obj, attr_name);
5830 static PyObject *__Pyx_GetBuiltinName(PyObject *name) {
5831 PyObject* result = __Pyx_PyObject_GetAttrStr(__pyx_b, name);
5832 if (unlikely(!result)) {
5833 PyErr_Format(PyExc_NameError,
5834 #
if PY_MAJOR_VERSION >= 3
5835 "name '%U' is not defined", name);
5837 "name '%.200s' is not defined", PyString_AS_STRING(name));
5844 #if CYTHON_USE_EXC_INFO_STACK
5845 static _PyErr_StackItem *
5846 __Pyx_PyErr_GetTopmostException(PyThreadState *tstate)
5848 _PyErr_StackItem *exc_info = tstate->exc_info;
5849 while ((exc_info->exc_type == NULL || exc_info->exc_type == Py_None) &&
5850 exc_info->previous_item != NULL)
5852 exc_info = exc_info->previous_item;
5859 #if CYTHON_FAST_THREAD_STATE
5860 static CYTHON_INLINE
void __Pyx__ExceptionSave(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) {
5861 #if CYTHON_USE_EXC_INFO_STACK
5862 _PyErr_StackItem *exc_info = __Pyx_PyErr_GetTopmostException(tstate);
5863 *type = exc_info->exc_type;
5864 *value = exc_info->exc_value;
5865 *tb = exc_info->exc_traceback;
5867 *type = tstate->exc_type;
5868 *value = tstate->exc_value;
5869 *tb = tstate->exc_traceback;
5875 static CYTHON_INLINE
void __Pyx__ExceptionReset(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb) {
5876 PyObject *tmp_type, *tmp_value, *tmp_tb;
5877 #if CYTHON_USE_EXC_INFO_STACK
5878 _PyErr_StackItem *exc_info = tstate->exc_info;
5879 tmp_type = exc_info->exc_type;
5880 tmp_value = exc_info->exc_value;
5881 tmp_tb = exc_info->exc_traceback;
5882 exc_info->exc_type = type;
5883 exc_info->exc_value = value;
5884 exc_info->exc_traceback = tb;
5886 tmp_type = tstate->exc_type;
5887 tmp_value = tstate->exc_value;
5888 tmp_tb = tstate->exc_traceback;
5889 tstate->exc_type = type;
5890 tstate->exc_value = value;
5891 tstate->exc_traceback = tb;
5893 Py_XDECREF(tmp_type);
5894 Py_XDECREF(tmp_value);
5900 #if CYTHON_FAST_THREAD_STATE
5901 static int __Pyx_PyErr_ExceptionMatchesTuple(PyObject *exc_type, PyObject *tuple) {
5903 n = PyTuple_GET_SIZE(tuple);
5904 #if PY_MAJOR_VERSION >= 3
5905 for (i=0; i<
n; i++) {
5906 if (exc_type == PyTuple_GET_ITEM(tuple, i))
return 1;
5909 for (i=0; i<
n; i++) {
5910 if (__Pyx_PyErr_GivenExceptionMatches(exc_type, PyTuple_GET_ITEM(tuple, i)))
return 1;
5914 static CYTHON_INLINE
int __Pyx_PyErr_ExceptionMatchesInState(PyThreadState* tstate, PyObject* err) {
5915 PyObject *exc_type = tstate->curexc_type;
5916 if (exc_type == err)
return 1;
5917 if (unlikely(!exc_type))
return 0;
5918 if (unlikely(PyTuple_Check(err)))
5919 return __Pyx_PyErr_ExceptionMatchesTuple(exc_type, err);
5920 return __Pyx_PyErr_GivenExceptionMatches(exc_type, err);
5925 #if CYTHON_FAST_THREAD_STATE
5926 static int __Pyx__GetException(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb)
5928 static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb)
5931 PyObject *local_type, *local_value, *local_tb;
5932 #if CYTHON_FAST_THREAD_STATE
5933 PyObject *tmp_type, *tmp_value, *tmp_tb;
5934 local_type = tstate->curexc_type;
5935 local_value = tstate->curexc_value;
5936 local_tb = tstate->curexc_traceback;
5937 tstate->curexc_type = 0;
5938 tstate->curexc_value = 0;
5939 tstate->curexc_traceback = 0;
5941 PyErr_Fetch(&local_type, &local_value, &local_tb);
5943 PyErr_NormalizeException(&local_type, &local_value, &local_tb);
5944 #if CYTHON_FAST_THREAD_STATE
5945 if (unlikely(tstate->curexc_type))
5947 if (unlikely(PyErr_Occurred()))
5950 #if PY_MAJOR_VERSION >= 3
5952 if (unlikely(PyException_SetTraceback(local_value, local_tb) < 0))
5956 Py_XINCREF(local_tb);
5957 Py_XINCREF(local_type);
5958 Py_XINCREF(local_value);
5960 *value = local_value;
5962 #if CYTHON_FAST_THREAD_STATE
5963 #if CYTHON_USE_EXC_INFO_STACK
5965 _PyErr_StackItem *exc_info = tstate->exc_info;
5966 tmp_type = exc_info->exc_type;
5967 tmp_value = exc_info->exc_value;
5968 tmp_tb = exc_info->exc_traceback;
5969 exc_info->exc_type = local_type;
5970 exc_info->exc_value = local_value;
5971 exc_info->exc_traceback = local_tb;
5974 tmp_type = tstate->exc_type;
5975 tmp_value = tstate->exc_value;
5976 tmp_tb = tstate->exc_traceback;
5977 tstate->exc_type = local_type;
5978 tstate->exc_value = local_value;
5979 tstate->exc_traceback = local_tb;
5981 Py_XDECREF(tmp_type);
5982 Py_XDECREF(tmp_value);
5985 PyErr_SetExcInfo(local_type, local_value, local_tb);
5992 Py_XDECREF(local_type);
5993 Py_XDECREF(local_value);
5994 Py_XDECREF(local_tb);
5999 #if CYTHON_COMPILING_IN_CPYTHON
6000 static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw) {
6002 ternaryfunc call = Py_TYPE(func)->tp_call;
6003 if (unlikely(!call))
6004 return PyObject_Call(func, arg, kw);
6005 if (unlikely(Py_EnterRecursiveCall((
char*)
" while calling a Python object")))
6007 result = (*call)(func, arg, kw);
6008 Py_LeaveRecursiveCall();
6009 if (unlikely(!result) && unlikely(!PyErr_Occurred())) {
6012 "NULL result without error in PyObject_Call");
6019 #if CYTHON_FAST_THREAD_STATE
6020 static CYTHON_INLINE
void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb) {
6021 PyObject *tmp_type, *tmp_value, *tmp_tb;
6022 tmp_type = tstate->curexc_type;
6023 tmp_value = tstate->curexc_value;
6024 tmp_tb = tstate->curexc_traceback;
6025 tstate->curexc_type = type;
6026 tstate->curexc_value = value;
6027 tstate->curexc_traceback = tb;
6028 Py_XDECREF(tmp_type);
6029 Py_XDECREF(tmp_value);
6032 static CYTHON_INLINE
void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) {
6033 *type = tstate->curexc_type;
6034 *value = tstate->curexc_value;
6035 *tb = tstate->curexc_traceback;
6036 tstate->curexc_type = 0;
6037 tstate->curexc_value = 0;
6038 tstate->curexc_traceback = 0;
6043 #if PY_MAJOR_VERSION < 3
6044 static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb,
6045 CYTHON_UNUSED PyObject *cause) {
6046 __Pyx_PyThreadState_declare
6048 if (!value || value == Py_None)
6052 if (!tb || tb == Py_None)
6056 if (!PyTraceBack_Check(tb)) {
6057 PyErr_SetString(PyExc_TypeError,
6058 "raise: arg 3 must be a traceback or None");
6062 if (PyType_Check(type)) {
6063 #if CYTHON_COMPILING_IN_PYPY
6069 PyErr_NormalizeException(&type, &value, &tb);
6072 PyErr_SetString(PyExc_TypeError,
6073 "instance exception may not have a separate value");
6077 type = (PyObject*) Py_TYPE(type);
6079 if (!PyType_IsSubtype((PyTypeObject *)type, (PyTypeObject *)PyExc_BaseException)) {
6080 PyErr_SetString(PyExc_TypeError,
6081 "raise: exception class must be a subclass of BaseException");
6085 __Pyx_PyThreadState_assign
6086 __Pyx_ErrRestore(type, value, tb);
6095 static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause) {
6096 PyObject* owned_instance = NULL;
6097 if (tb == Py_None) {
6099 }
else if (tb && !PyTraceBack_Check(tb)) {
6100 PyErr_SetString(PyExc_TypeError,
6101 "raise: arg 3 must be a traceback or None");
6104 if (value == Py_None)
6106 if (PyExceptionInstance_Check(type)) {
6108 PyErr_SetString(PyExc_TypeError,
6109 "instance exception may not have a separate value");
6113 type = (PyObject*) Py_TYPE(value);
6114 }
else if (PyExceptionClass_Check(type)) {
6115 PyObject *instance_class = NULL;
6116 if (value && PyExceptionInstance_Check(value)) {
6117 instance_class = (PyObject*) Py_TYPE(value);
6118 if (instance_class != type) {
6119 int is_subclass = PyObject_IsSubclass(instance_class, type);
6121 instance_class = NULL;
6122 }
else if (unlikely(is_subclass == -1)) {
6125 type = instance_class;
6129 if (!instance_class) {
6132 args = PyTuple_New(0);
6133 else if (PyTuple_Check(value)) {
6137 args = PyTuple_Pack(1, value);
6140 owned_instance = PyObject_Call(type, args, NULL);
6142 if (!owned_instance)
6144 value = owned_instance;
6145 if (!PyExceptionInstance_Check(value)) {
6146 PyErr_Format(PyExc_TypeError,
6147 "calling %R should have returned an instance of "
6148 "BaseException, not %R",
6149 type, Py_TYPE(value));
6154 PyErr_SetString(PyExc_TypeError,
6155 "raise: exception class must be a subclass of BaseException");
6159 PyObject *fixed_cause;
6160 if (cause == Py_None) {
6162 }
else if (PyExceptionClass_Check(cause)) {
6163 fixed_cause = PyObject_CallObject(cause, NULL);
6164 if (fixed_cause == NULL)
6166 }
else if (PyExceptionInstance_Check(cause)) {
6167 fixed_cause = cause;
6168 Py_INCREF(fixed_cause);
6170 PyErr_SetString(PyExc_TypeError,
6171 "exception causes must derive from "
6175 PyException_SetCause(value, fixed_cause);
6177 PyErr_SetObject(type, value);
6179 #if CYTHON_COMPILING_IN_PYPY
6180 PyObject *tmp_type, *tmp_value, *tmp_tb;
6181 PyErr_Fetch(&tmp_type, &tmp_value, &tmp_tb);
6183 PyErr_Restore(tmp_type, tmp_value, tb);
6186 PyThreadState *tstate = __Pyx_PyThreadState_Current;
6187 PyObject* tmp_tb = tstate->curexc_traceback;
6190 tstate->curexc_traceback = tb;
6196 Py_XDECREF(owned_instance);
6202 #ifndef __PYX_HAVE_RT_ImportType
6203 #define __PYX_HAVE_RT_ImportType
6204 static PyTypeObject *__Pyx_ImportType(PyObject *module,
const char *module_name,
const char *class_name,
6205 size_t size,
enum __Pyx_ImportType_CheckSize check_size)
6207 PyObject *result = 0;
6209 Py_ssize_t basicsize;
6210 #ifdef Py_LIMITED_API
6211 PyObject *py_basicsize;
6213 result = PyObject_GetAttrString(module, class_name);
6216 if (!PyType_Check(result)) {
6217 PyErr_Format(PyExc_TypeError,
6218 "%.200s.%.200s is not a type object",
6219 module_name, class_name);
6222 #ifndef Py_LIMITED_API
6223 basicsize = ((PyTypeObject *)result)->tp_basicsize;
6225 py_basicsize = PyObject_GetAttrString(result,
"__basicsize__");
6228 basicsize = PyLong_AsSsize_t(py_basicsize);
6229 Py_DECREF(py_basicsize);
6231 if (basicsize == (Py_ssize_t)-1 && PyErr_Occurred())
6234 if ((
size_t)basicsize < size) {
6235 PyErr_Format(PyExc_ValueError,
6236 "%.200s.%.200s size changed, may indicate binary incompatibility. "
6237 "Expected %zd from C header, got %zd from PyObject",
6238 module_name, class_name, size, basicsize);
6241 if (check_size == __Pyx_ImportType_CheckSize_Error && (
size_t)basicsize != size) {
6242 PyErr_Format(PyExc_ValueError,
6243 "%.200s.%.200s size changed, may indicate binary incompatibility. "
6244 "Expected %zd from C header, got %zd from PyObject",
6245 module_name, class_name, size, basicsize);
6248 else if (check_size == __Pyx_ImportType_CheckSize_Warn && (
size_t)basicsize > size) {
6249 PyOS_snprintf(warning,
sizeof(warning),
6250 "%s.%s size changed, may indicate binary incompatibility. "
6251 "Expected %zd from C header, got %zd from PyObject",
6252 module_name, class_name, size, basicsize);
6253 if (PyErr_WarnEx(NULL, warning, 0) < 0)
goto bad;
6255 return (PyTypeObject *)result;
6263 static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list,
int level) {
6264 PyObject *empty_list = 0;
6265 PyObject *module = 0;
6266 PyObject *global_dict = 0;
6267 PyObject *empty_dict = 0;
6269 #if PY_MAJOR_VERSION < 3
6270 PyObject *py_import;
6271 py_import = __Pyx_PyObject_GetAttrStr(__pyx_b, __pyx_n_s_import);
6278 empty_list = PyList_New(0);
6283 global_dict = PyModule_GetDict(__pyx_m);
6286 empty_dict = PyDict_New();
6290 #if PY_MAJOR_VERSION >= 3
6292 if ((1) && (strchr(__Pyx_MODULE_NAME,
'.'))) {
6293 module = PyImport_ImportModuleLevelObject(
6294 name, global_dict, empty_dict, list, 1);
6296 if (!PyErr_ExceptionMatches(PyExc_ImportError))
6305 #if PY_MAJOR_VERSION < 3
6306 PyObject *py_level = PyInt_FromLong(level);
6309 module = PyObject_CallFunctionObjArgs(py_import,
6310 name, global_dict, empty_dict, list, py_level, (PyObject *)NULL);
6311 Py_DECREF(py_level);
6313 module = PyImport_ImportModuleLevelObject(
6314 name, global_dict, empty_dict, list, level);
6319 #if PY_MAJOR_VERSION < 3
6320 Py_XDECREF(py_import);
6322 Py_XDECREF(empty_list);
6323 Py_XDECREF(empty_dict);
6328 #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_TYPE_SLOTS
6329 static CYTHON_INLINE PY_UINT64_T __Pyx_get_tp_dict_version(PyObject *obj) {
6330 PyObject *dict = Py_TYPE(obj)->tp_dict;
6331 return likely(dict) ? __PYX_GET_DICT_VERSION(dict) : 0;
6333 static CYTHON_INLINE PY_UINT64_T __Pyx_get_object_dict_version(PyObject *obj) {
6334 PyObject **dictptr = NULL;
6335 Py_ssize_t offset = Py_TYPE(obj)->tp_dictoffset;
6337 #if CYTHON_COMPILING_IN_CPYTHON
6338 dictptr = (likely(offset > 0)) ? (PyObject **) ((
char *)obj + offset) : _PyObject_GetDictPtr(obj);
6340 dictptr = _PyObject_GetDictPtr(obj);
6343 return (dictptr && *dictptr) ? __PYX_GET_DICT_VERSION(*dictptr) : 0;
6345 static CYTHON_INLINE
int __Pyx_object_dict_version_matches(PyObject* obj, PY_UINT64_T tp_dict_version, PY_UINT64_T obj_dict_version) {
6346 PyObject *dict = Py_TYPE(obj)->tp_dict;
6347 if (unlikely(!dict) || unlikely(tp_dict_version != __PYX_GET_DICT_VERSION(dict)))
6349 return obj_dict_version == __Pyx_get_object_dict_version(obj);
6354 #ifndef CYTHON_CLINE_IN_TRACEBACK
6355 static int __Pyx_CLineForTraceback(CYTHON_NCP_UNUSED PyThreadState *tstate,
int c_line) {
6356 PyObject *use_cline;
6357 PyObject *ptype, *pvalue, *ptraceback;
6358 #if CYTHON_COMPILING_IN_CPYTHON
6359 PyObject **cython_runtime_dict;
6361 if (unlikely(!__pyx_cython_runtime)) {
6364 __Pyx_ErrFetchInState(tstate, &ptype, &pvalue, &ptraceback);
6365 #if CYTHON_COMPILING_IN_CPYTHON
6366 cython_runtime_dict = _PyObject_GetDictPtr(__pyx_cython_runtime);
6367 if (likely(cython_runtime_dict)) {
6368 __PYX_PY_DICT_LOOKUP_IF_MODIFIED(
6369 use_cline, *cython_runtime_dict,
6370 __Pyx_PyDict_GetItemStr(*cython_runtime_dict, __pyx_n_s_cline_in_traceback))
6374 PyObject *use_cline_obj = __Pyx_PyObject_GetAttrStr(__pyx_cython_runtime, __pyx_n_s_cline_in_traceback);
6375 if (use_cline_obj) {
6376 use_cline = PyObject_Not(use_cline_obj) ? Py_False : Py_True;
6377 Py_DECREF(use_cline_obj);
6385 (void) PyObject_SetAttr(__pyx_cython_runtime, __pyx_n_s_cline_in_traceback, Py_False);
6387 else if (use_cline == Py_False || (use_cline != Py_True && PyObject_Not(use_cline) != 0)) {
6390 __Pyx_ErrRestoreInState(tstate, ptype, pvalue, ptraceback);
6396 static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries,
int count,
int code_line) {
6397 int start = 0, mid = 0, end = count - 1;
6398 if (end >= 0 && code_line > entries[end].code_line) {
6401 while (start < end) {
6402 mid = start + (end - start) / 2;
6403 if (code_line < entries[mid].code_line) {
6405 }
else if (code_line > entries[mid].code_line) {
6411 if (code_line <= entries[mid].code_line) {
6417 static PyCodeObject *__pyx_find_code_object(
int code_line) {
6418 PyCodeObject* code_object;
6420 if (unlikely(!code_line) || unlikely(!__pyx_code_cache.entries)) {
6423 pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line);
6424 if (unlikely(
pos >= __pyx_code_cache.count) || unlikely(__pyx_code_cache.entries[
pos].code_line != code_line)) {
6427 code_object = __pyx_code_cache.entries[
pos].code_object;
6428 Py_INCREF(code_object);
6431 static void __pyx_insert_code_object(
int code_line, PyCodeObject* code_object) {
6433 __Pyx_CodeObjectCacheEntry* entries = __pyx_code_cache.entries;
6434 if (unlikely(!code_line)) {
6437 if (unlikely(!entries)) {
6438 entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Malloc(64*
sizeof(__Pyx_CodeObjectCacheEntry));
6439 if (likely(entries)) {
6440 __pyx_code_cache.entries = entries;
6441 __pyx_code_cache.max_count = 64;
6442 __pyx_code_cache.count = 1;
6443 entries[0].code_line = code_line;
6444 entries[0].code_object = code_object;
6445 Py_INCREF(code_object);
6449 pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line);
6450 if ((
pos < __pyx_code_cache.count) && unlikely(__pyx_code_cache.entries[
pos].code_line == code_line)) {
6451 PyCodeObject* tmp = entries[
pos].code_object;
6452 entries[
pos].code_object = code_object;
6456 if (__pyx_code_cache.count == __pyx_code_cache.max_count) {
6457 int new_max = __pyx_code_cache.max_count + 64;
6458 entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Realloc(
6459 __pyx_code_cache.entries, ((
size_t)new_max) *
sizeof(__Pyx_CodeObjectCacheEntry));
6460 if (unlikely(!entries)) {
6463 __pyx_code_cache.entries = entries;
6464 __pyx_code_cache.max_count = new_max;
6466 for (i=__pyx_code_cache.count; i>
pos; i--) {
6467 entries[i] = entries[i-1];
6469 entries[
pos].code_line = code_line;
6470 entries[
pos].code_object = code_object;
6471 __pyx_code_cache.count++;
6472 Py_INCREF(code_object);
6476 #include "compile.h"
6477 #include "frameobject.h"
6478 #include "traceback.h"
6479 #if PY_VERSION_HEX >= 0x030b00a6
6480 #ifndef Py_BUILD_CORE
6481 #define Py_BUILD_CORE 1
6483 #include "internal/pycore_frame.h"
6485 static PyCodeObject* __Pyx_CreateCodeObjectForTraceback(
6486 const char *funcname,
int c_line,
6487 int py_line,
const char *filename) {
6488 PyCodeObject *py_code = NULL;
6489 PyObject *py_funcname = NULL;
6490 #if PY_MAJOR_VERSION < 3
6491 PyObject *py_srcfile = NULL;
6492 py_srcfile = PyString_FromString(filename);
6493 if (!py_srcfile)
goto bad;
6496 #if PY_MAJOR_VERSION < 3
6497 py_funcname = PyString_FromFormat(
"%s (%s:%d)", funcname, __pyx_cfilenm, c_line);
6498 if (!py_funcname)
goto bad;
6500 py_funcname = PyUnicode_FromFormat(
"%s (%s:%d)", funcname, __pyx_cfilenm, c_line);
6501 if (!py_funcname)
goto bad;
6502 funcname = PyUnicode_AsUTF8(py_funcname);
6503 if (!funcname)
goto bad;
6507 #if PY_MAJOR_VERSION < 3
6508 py_funcname = PyString_FromString(funcname);
6509 if (!py_funcname)
goto bad;
6512 #if PY_MAJOR_VERSION < 3
6513 py_code = __Pyx_PyCode_New(
6530 Py_DECREF(py_srcfile);
6532 py_code = PyCode_NewEmpty(filename, funcname, py_line);
6534 Py_XDECREF(py_funcname);
6537 Py_XDECREF(py_funcname);
6538 #if PY_MAJOR_VERSION < 3
6539 Py_XDECREF(py_srcfile);
6543 static void __Pyx_AddTraceback(
const char *funcname,
int c_line,
6544 int py_line,
const char *filename) {
6545 PyCodeObject *py_code = 0;
6546 PyFrameObject *py_frame = 0;
6547 PyThreadState *tstate = __Pyx_PyThreadState_Current;
6548 PyObject *ptype, *pvalue, *ptraceback;
6550 c_line = __Pyx_CLineForTraceback(tstate, c_line);
6552 py_code = __pyx_find_code_object(c_line ? -c_line : py_line);
6554 __Pyx_ErrFetchInState(tstate, &ptype, &pvalue, &ptraceback);
6555 py_code = __Pyx_CreateCodeObjectForTraceback(
6556 funcname, c_line, py_line, filename);
6562 Py_XDECREF(ptraceback);
6565 __Pyx_ErrRestoreInState(tstate, ptype, pvalue, ptraceback);
6566 __pyx_insert_code_object(c_line ? -c_line : py_line, py_code);
6568 py_frame = PyFrame_New(
6574 if (!py_frame)
goto bad;
6575 __Pyx_PyFrame_SetLineNumber(py_frame, py_line);
6576 PyTraceBack_Here(py_frame);
6578 Py_XDECREF(py_code);
6579 Py_XDECREF(py_frame);
6583 #define __PYX_VERIFY_RETURN_INT(target_type, func_type, func_value)\
6584 __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 0)
6585 #define __PYX_VERIFY_RETURN_INT_EXC(target_type, func_type, func_value)\
6586 __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 1)
6587 #define __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, exc)\
6589 func_type value = func_value;\
6590 if (sizeof(target_type) < sizeof(func_type)) {\
6591 if (unlikely(value != (func_type) (target_type) value)) {\
6592 func_type zero = 0;\
6593 if (exc && unlikely(value == (func_type)-1 && PyErr_Occurred()))\
6594 return (target_type) -1;\
6595 if (is_unsigned && unlikely(value < zero))\
6596 goto raise_neg_overflow;\
6598 goto raise_overflow;\
6601 return (target_type) value;\
6607 static CYTHON_INLINE __pyx_t_float_complex __pyx_t_float_complex_from_parts(
float x,
float y) {
6608 return ::std::complex< float >(x, y);
6611 static CYTHON_INLINE __pyx_t_float_complex __pyx_t_float_complex_from_parts(
float x,
float y) {
6612 return x + y*(__pyx_t_float_complex)_Complex_I;
6616 static CYTHON_INLINE __pyx_t_float_complex __pyx_t_float_complex_from_parts(
float x,
float y) {
6617 __pyx_t_float_complex
z;
6627 static CYTHON_INLINE
int __Pyx_c_eq_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
6628 return (a.real == b.real) && (a.imag == b.imag);
6630 static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_sum_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
6631 __pyx_t_float_complex
z;
6632 z.real = a.real + b.real;
6633 z.imag = a.imag + b.imag;
6636 static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_diff_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
6637 __pyx_t_float_complex
z;
6638 z.real = a.real - b.real;
6639 z.imag = a.imag - b.imag;
6642 static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_prod_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
6643 __pyx_t_float_complex
z;
6644 z.real = a.real * b.real - a.imag * b.imag;
6645 z.imag = a.real * b.imag + a.imag * b.real;
6649 static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_quot_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
6651 return __pyx_t_float_complex_from_parts(a.real / b.real, a.imag / b.real);
6652 }
else if (fabsf(b.real) >= fabsf(b.imag)) {
6653 if (b.real == 0 && b.imag == 0) {
6654 return __pyx_t_float_complex_from_parts(a.real / b.real, a.imag / b.imag);
6656 float r = b.imag / b.real;
6657 float s = (float)(1.0) / (b.real + b.imag *
r);
6658 return __pyx_t_float_complex_from_parts(
6659 (a.real + a.imag *
r) *
s, (a.imag - a.real *
r) *
s);
6662 float r = b.real / b.imag;
6663 float s = (float)(1.0) / (b.imag + b.real *
r);
6664 return __pyx_t_float_complex_from_parts(
6665 (a.real *
r + a.imag) *
s, (a.imag *
r - a.real) *
s);
6669 static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_quot_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
6671 return __pyx_t_float_complex_from_parts(a.real / b.real, a.imag / b.real);
6673 float denom = b.real * b.real + b.imag * b.imag;
6674 return __pyx_t_float_complex_from_parts(
6675 (a.real * b.real + a.imag * b.imag) / denom,
6676 (a.imag * b.real - a.real * b.imag) / denom);
6680 static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_neg_float(__pyx_t_float_complex a) {
6681 __pyx_t_float_complex
z;
6686 static CYTHON_INLINE
int __Pyx_c_is_zero_float(__pyx_t_float_complex a) {
6687 return (a.real == 0) && (a.imag == 0);
6689 static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_conj_float(__pyx_t_float_complex a) {
6690 __pyx_t_float_complex
z;
6696 static CYTHON_INLINE
float __Pyx_c_abs_float(__pyx_t_float_complex
z) {
6697 #if !defined(HAVE_HYPOT) || defined(_MSC_VER)
6698 return sqrtf(
z.real*
z.real +
z.imag*
z.imag);
6700 return hypotf(
z.real,
z.imag);
6703 static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_pow_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
6704 __pyx_t_float_complex
z;
6705 float r, lnr, theta, z_r, z_theta;
6706 if (b.imag == 0 && b.real == (
int)b.real) {
6708 float denom = a.real * a.real + a.imag * a.imag;
6709 a.real = a.real / denom;
6710 a.imag = -a.imag / denom;
6713 switch ((
int)b.real) {
6721 return __Pyx_c_prod_float(a, a);
6723 z = __Pyx_c_prod_float(a, a);
6724 return __Pyx_c_prod_float(
z, a);
6726 z = __Pyx_c_prod_float(a, a);
6727 return __Pyx_c_prod_float(
z,
z);
6733 }
else if (b.imag == 0) {
6734 z.real = powf(a.real, b.real);
6737 }
else if (a.real > 0) {
6742 theta = atan2f(0.0, -1.0);
6745 r = __Pyx_c_abs_float(a);
6746 theta = atan2f(a.imag, a.real);
6749 z_r = expf(lnr * b.real - theta * b.imag);
6750 z_theta = theta * b.real + lnr * b.imag;
6751 z.real = z_r * cosf(z_theta);
6752 z.imag = z_r * sinf(z_theta);
6761 static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(
double x,
double y) {
6762 return ::std::complex< double >(x, y);
6765 static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(
double x,
double y) {
6766 return x + y*(__pyx_t_double_complex)_Complex_I;
6770 static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(
double x,
double y) {
6771 __pyx_t_double_complex
z;
6781 static CYTHON_INLINE
int __Pyx_c_eq_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
6782 return (a.real == b.real) && (a.imag == b.imag);
6784 static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_sum_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
6785 __pyx_t_double_complex
z;
6786 z.real = a.real + b.real;
6787 z.imag = a.imag + b.imag;
6790 static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_diff_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
6791 __pyx_t_double_complex
z;
6792 z.real = a.real - b.real;
6793 z.imag = a.imag - b.imag;
6796 static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_prod_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
6797 __pyx_t_double_complex
z;
6798 z.real = a.real * b.real - a.imag * b.imag;
6799 z.imag = a.real * b.imag + a.imag * b.real;
6803 static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_quot_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
6805 return __pyx_t_double_complex_from_parts(a.real / b.real, a.imag / b.real);
6806 }
else if (fabs(b.real) >= fabs(b.imag)) {
6807 if (b.real == 0 && b.imag == 0) {
6808 return __pyx_t_double_complex_from_parts(a.real / b.real, a.imag / b.imag);
6810 double r = b.imag / b.real;
6811 double s = (double)(1.0) / (b.real + b.imag *
r);
6812 return __pyx_t_double_complex_from_parts(
6813 (a.real + a.imag *
r) *
s, (a.imag - a.real *
r) *
s);
6816 double r = b.real / b.imag;
6817 double s = (double)(1.0) / (b.imag + b.real *
r);
6818 return __pyx_t_double_complex_from_parts(
6819 (a.real *
r + a.imag) *
s, (a.imag *
r - a.real) *
s);
6823 static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_quot_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
6825 return __pyx_t_double_complex_from_parts(a.real / b.real, a.imag / b.real);
6827 double denom = b.real * b.real + b.imag * b.imag;
6828 return __pyx_t_double_complex_from_parts(
6829 (a.real * b.real + a.imag * b.imag) / denom,
6830 (a.imag * b.real - a.real * b.imag) / denom);
6834 static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_neg_double(__pyx_t_double_complex a) {
6835 __pyx_t_double_complex
z;
6840 static CYTHON_INLINE
int __Pyx_c_is_zero_double(__pyx_t_double_complex a) {
6841 return (a.real == 0) && (a.imag == 0);
6843 static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_conj_double(__pyx_t_double_complex a) {
6844 __pyx_t_double_complex
z;
6850 static CYTHON_INLINE
double __Pyx_c_abs_double(__pyx_t_double_complex
z) {
6851 #if !defined(HAVE_HYPOT) || defined(_MSC_VER)
6852 return sqrt(
z.real*
z.real +
z.imag*
z.imag);
6854 return hypot(
z.real,
z.imag);
6857 static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_pow_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
6858 __pyx_t_double_complex
z;
6859 double r, lnr, theta, z_r, z_theta;
6860 if (b.imag == 0 && b.real == (
int)b.real) {
6862 double denom = a.real * a.real + a.imag * a.imag;
6863 a.real = a.real / denom;
6864 a.imag = -a.imag / denom;
6867 switch ((
int)b.real) {
6875 return __Pyx_c_prod_double(a, a);
6877 z = __Pyx_c_prod_double(a, a);
6878 return __Pyx_c_prod_double(
z, a);
6880 z = __Pyx_c_prod_double(a, a);
6881 return __Pyx_c_prod_double(
z,
z);
6887 }
else if (b.imag == 0) {
6888 z.real = pow(a.real, b.real);
6891 }
else if (a.real > 0) {
6896 theta = atan2(0.0, -1.0);
6899 r = __Pyx_c_abs_double(a);
6900 theta = atan2(a.imag, a.real);
6903 z_r = exp(lnr * b.real - theta * b.imag);
6904 z_theta = theta * b.real + lnr * b.imag;
6905 z.real = z_r * cos(z_theta);
6906 z.imag = z_r * sin(z_theta);
6913 static CYTHON_INLINE
int __Pyx_PyInt_As_int(PyObject *x) {
6914 #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
6915 #pragma GCC diagnostic push
6916 #pragma GCC diagnostic ignored "-Wconversion"
6918 const int neg_one = (int) -1, const_zero = (
int) 0;
6919 #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
6920 #pragma GCC diagnostic pop
6922 const int is_unsigned = neg_one > const_zero;
6923 #if PY_MAJOR_VERSION < 3
6924 if (likely(PyInt_Check(x))) {
6925 if (
sizeof(
int) <
sizeof(long)) {
6926 __PYX_VERIFY_RETURN_INT(
int,
long, PyInt_AS_LONG(x))
6928 long val = PyInt_AS_LONG(x);
6929 if (is_unsigned && unlikely(val < 0)) {
6930 goto raise_neg_overflow;
6936 if (likely(PyLong_Check(x))) {
6938 #if CYTHON_USE_PYLONG_INTERNALS
6939 const digit* digits = ((PyLongObject*)x)->ob_digit;
6940 switch (Py_SIZE(x)) {
6941 case 0:
return (
int) 0;
6942 case 1: __PYX_VERIFY_RETURN_INT(
int, digit, digits[0])
6944 if (8 *
sizeof(
int) > 1 * PyLong_SHIFT) {
6945 if (8 *
sizeof(
unsigned long) > 2 * PyLong_SHIFT) {
6946 __PYX_VERIFY_RETURN_INT(
int,
unsigned long, (((((
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
6947 }
else if (8 *
sizeof(
int) >= 2 * PyLong_SHIFT) {
6948 return (
int) (((((int)digits[1]) << PyLong_SHIFT) | (
int)digits[0]));
6953 if (8 *
sizeof(
int) > 2 * PyLong_SHIFT) {
6954 if (8 *
sizeof(
unsigned long) > 3 * PyLong_SHIFT) {
6955 __PYX_VERIFY_RETURN_INT(
int,
unsigned long, (((((((
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
6956 }
else if (8 *
sizeof(
int) >= 3 * PyLong_SHIFT) {
6957 return (
int) (((((((int)digits[2]) << PyLong_SHIFT) | (
int)digits[1]) << PyLong_SHIFT) | (int)digits[0]));
6962 if (8 *
sizeof(
int) > 3 * PyLong_SHIFT) {
6963 if (8 *
sizeof(
unsigned long) > 4 * PyLong_SHIFT) {
6964 __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])))
6965 }
else if (8 *
sizeof(
int) >= 4 * PyLong_SHIFT) {
6966 return (
int) (((((((((int)digits[3]) << PyLong_SHIFT) | (
int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (
int)digits[0]));
6972 #if CYTHON_COMPILING_IN_CPYTHON
6973 if (unlikely(Py_SIZE(x) < 0)) {
6974 goto raise_neg_overflow;
6978 int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
6979 if (unlikely(result < 0))
6981 if (unlikely(result == 1))
6982 goto raise_neg_overflow;
6985 if (
sizeof(
int) <=
sizeof(
unsigned long)) {
6986 __PYX_VERIFY_RETURN_INT_EXC(
int,
unsigned long, PyLong_AsUnsignedLong(x))
6987 #ifdef HAVE_LONG_LONG
6988 }
else if (
sizeof(
int) <=
sizeof(
unsigned PY_LONG_LONG)) {
6989 __PYX_VERIFY_RETURN_INT_EXC(
int,
unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
6993 #if CYTHON_USE_PYLONG_INTERNALS
6994 const digit* digits = ((PyLongObject*)x)->ob_digit;
6995 switch (Py_SIZE(x)) {
6996 case 0:
return (
int) 0;
6997 case -1: __PYX_VERIFY_RETURN_INT(
int, sdigit, (sdigit) (-(sdigit)digits[0]))
6998 case 1: __PYX_VERIFY_RETURN_INT(
int, digit, +digits[0])
7000 if (8 *
sizeof(
int) - 1 > 1 * PyLong_SHIFT) {
7001 if (8 *
sizeof(
unsigned long) > 2 * PyLong_SHIFT) {
7002 __PYX_VERIFY_RETURN_INT(
int,
long, -(
long) (((((
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
7003 }
else if (8 *
sizeof(
int) - 1 > 2 * PyLong_SHIFT) {
7004 return (
int) (((int)-1)*(((((int)digits[1]) << PyLong_SHIFT) | (
int)digits[0])));
7009 if (8 *
sizeof(
int) > 1 * PyLong_SHIFT) {
7010 if (8 *
sizeof(
unsigned long) > 2 * PyLong_SHIFT) {
7011 __PYX_VERIFY_RETURN_INT(
int,
unsigned long, (((((
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
7012 }
else if (8 *
sizeof(
int) - 1 > 2 * PyLong_SHIFT) {
7013 return (
int) ((((((int)digits[1]) << PyLong_SHIFT) | (
int)digits[0])));
7018 if (8 *
sizeof(
int) - 1 > 2 * PyLong_SHIFT) {
7019 if (8 *
sizeof(
unsigned long) > 3 * PyLong_SHIFT) {
7020 __PYX_VERIFY_RETURN_INT(
int,
long, -(
long) (((((((
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
7021 }
else if (8 *
sizeof(
int) - 1 > 3 * PyLong_SHIFT) {
7022 return (
int) (((int)-1)*(((((((int)digits[2]) << PyLong_SHIFT) | (
int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
7027 if (8 *
sizeof(
int) > 2 * PyLong_SHIFT) {
7028 if (8 *
sizeof(
unsigned long) > 3 * PyLong_SHIFT) {
7029 __PYX_VERIFY_RETURN_INT(
int,
unsigned long, (((((((
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
7030 }
else if (8 *
sizeof(
int) - 1 > 3 * PyLong_SHIFT) {
7031 return (
int) ((((((((int)digits[2]) << PyLong_SHIFT) | (
int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
7036 if (8 *
sizeof(
int) - 1 > 3 * PyLong_SHIFT) {
7037 if (8 *
sizeof(
unsigned long) > 4 * PyLong_SHIFT) {
7038 __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])))
7039 }
else if (8 *
sizeof(
int) - 1 > 4 * PyLong_SHIFT) {
7040 return (
int) (((int)-1)*(((((((((int)digits[3]) << PyLong_SHIFT) | (
int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (
int)digits[0])));
7045 if (8 *
sizeof(
int) > 3 * PyLong_SHIFT) {
7046 if (8 *
sizeof(
unsigned long) > 4 * PyLong_SHIFT) {
7047 __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])))
7048 }
else if (8 *
sizeof(
int) - 1 > 4 * PyLong_SHIFT) {
7049 return (
int) ((((((((((int)digits[3]) << PyLong_SHIFT) | (
int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (
int)digits[0])));
7055 if (
sizeof(
int) <=
sizeof(long)) {
7056 __PYX_VERIFY_RETURN_INT_EXC(
int,
long, PyLong_AsLong(x))
7057 #ifdef HAVE_LONG_LONG
7058 }
else if (
sizeof(
int) <=
sizeof(PY_LONG_LONG)) {
7059 __PYX_VERIFY_RETURN_INT_EXC(
int, PY_LONG_LONG, PyLong_AsLongLong(x))
7064 #if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray)
7065 PyErr_SetString(PyExc_RuntimeError,
7066 "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers");
7069 PyObject *
v = __Pyx_PyNumber_IntOrLong(x);
7070 #if PY_MAJOR_VERSION < 3
7071 if (likely(
v) && !PyLong_Check(
v)) {
7073 v = PyNumber_Long(tmp);
7078 int one = 1;
int is_little = (int)*(
unsigned char *)&one;
7079 unsigned char *bytes = (
unsigned char *)&val;
7080 int ret = _PyLong_AsByteArray((PyLongObject *)
v,
7082 is_little, !is_unsigned);
7092 PyObject *tmp = __Pyx_PyNumber_IntOrLong(x);
7093 if (!tmp)
return (
int) -1;
7094 val = __Pyx_PyInt_As_int(tmp);
7099 PyErr_SetString(PyExc_OverflowError,
7100 "value too large to convert to int");
7103 PyErr_SetString(PyExc_OverflowError,
7104 "can't convert negative value to int");
7109 static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(
long value) {
7110 #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
7111 #pragma GCC diagnostic push
7112 #pragma GCC diagnostic ignored "-Wconversion"
7114 const long neg_one = (long) -1, const_zero = (
long) 0;
7115 #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
7116 #pragma GCC diagnostic pop
7118 const int is_unsigned = neg_one > const_zero;
7120 if (
sizeof(
long) <
sizeof(long)) {
7121 return PyInt_FromLong((
long) value);
7122 }
else if (
sizeof(
long) <=
sizeof(
unsigned long)) {
7123 return PyLong_FromUnsignedLong((
unsigned long) value);
7124 #ifdef HAVE_LONG_LONG
7125 }
else if (
sizeof(
long) <=
sizeof(
unsigned PY_LONG_LONG)) {
7126 return PyLong_FromUnsignedLongLong((
unsigned PY_LONG_LONG) value);
7130 if (
sizeof(
long) <=
sizeof(
long)) {
7131 return PyInt_FromLong((
long) value);
7132 #ifdef HAVE_LONG_LONG
7133 }
else if (
sizeof(
long) <=
sizeof(PY_LONG_LONG)) {
7134 return PyLong_FromLongLong((PY_LONG_LONG) value);
7139 int one = 1;
int little = (int)*(
unsigned char *)&one;
7140 unsigned char *bytes = (
unsigned char *)&value;
7141 return _PyLong_FromByteArray(bytes,
sizeof(
long),
7142 little, !is_unsigned);
7147 static CYTHON_INLINE
long __Pyx_PyInt_As_long(PyObject *x) {
7148 #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
7149 #pragma GCC diagnostic push
7150 #pragma GCC diagnostic ignored "-Wconversion"
7152 const long neg_one = (long) -1, const_zero = (
long) 0;
7153 #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
7154 #pragma GCC diagnostic pop
7156 const int is_unsigned = neg_one > const_zero;
7157 #if PY_MAJOR_VERSION < 3
7158 if (likely(PyInt_Check(x))) {
7159 if (
sizeof(
long) <
sizeof(long)) {
7160 __PYX_VERIFY_RETURN_INT(
long,
long, PyInt_AS_LONG(x))
7162 long val = PyInt_AS_LONG(x);
7163 if (is_unsigned && unlikely(val < 0)) {
7164 goto raise_neg_overflow;
7170 if (likely(PyLong_Check(x))) {
7172 #if CYTHON_USE_PYLONG_INTERNALS
7173 const digit* digits = ((PyLongObject*)x)->ob_digit;
7174 switch (Py_SIZE(x)) {
7175 case 0:
return (
long) 0;
7176 case 1: __PYX_VERIFY_RETURN_INT(
long, digit, digits[0])
7178 if (8 *
sizeof(
long) > 1 * PyLong_SHIFT) {
7179 if (8 *
sizeof(
unsigned long) > 2 * PyLong_SHIFT) {
7180 __PYX_VERIFY_RETURN_INT(
long,
unsigned long, (((((
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
7181 }
else if (8 *
sizeof(
long) >= 2 * PyLong_SHIFT) {
7182 return (
long) (((((long)digits[1]) << PyLong_SHIFT) | (
long)digits[0]));
7187 if (8 *
sizeof(
long) > 2 * PyLong_SHIFT) {
7188 if (8 *
sizeof(
unsigned long) > 3 * PyLong_SHIFT) {
7189 __PYX_VERIFY_RETURN_INT(
long,
unsigned long, (((((((
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
7190 }
else if (8 *
sizeof(
long) >= 3 * PyLong_SHIFT) {
7191 return (
long) (((((((long)digits[2]) << PyLong_SHIFT) | (
long)digits[1]) << PyLong_SHIFT) | (long)digits[0]));
7196 if (8 *
sizeof(
long) > 3 * PyLong_SHIFT) {
7197 if (8 *
sizeof(
unsigned long) > 4 * PyLong_SHIFT) {
7198 __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])))
7199 }
else if (8 *
sizeof(
long) >= 4 * PyLong_SHIFT) {
7200 return (
long) (((((((((long)digits[3]) << PyLong_SHIFT) | (
long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (
long)digits[0]));
7206 #if CYTHON_COMPILING_IN_CPYTHON
7207 if (unlikely(Py_SIZE(x) < 0)) {
7208 goto raise_neg_overflow;
7212 int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
7213 if (unlikely(result < 0))
7215 if (unlikely(result == 1))
7216 goto raise_neg_overflow;
7219 if (
sizeof(
long) <=
sizeof(
unsigned long)) {
7220 __PYX_VERIFY_RETURN_INT_EXC(
long,
unsigned long, PyLong_AsUnsignedLong(x))
7221 #ifdef HAVE_LONG_LONG
7222 }
else if (
sizeof(
long) <=
sizeof(
unsigned PY_LONG_LONG)) {
7223 __PYX_VERIFY_RETURN_INT_EXC(
long,
unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
7227 #if CYTHON_USE_PYLONG_INTERNALS
7228 const digit* digits = ((PyLongObject*)x)->ob_digit;
7229 switch (Py_SIZE(x)) {
7230 case 0:
return (
long) 0;
7231 case -1: __PYX_VERIFY_RETURN_INT(
long, sdigit, (sdigit) (-(sdigit)digits[0]))
7232 case 1: __PYX_VERIFY_RETURN_INT(
long, digit, +digits[0])
7234 if (8 *
sizeof(
long) - 1 > 1 * PyLong_SHIFT) {
7235 if (8 *
sizeof(
unsigned long) > 2 * PyLong_SHIFT) {
7236 __PYX_VERIFY_RETURN_INT(
long,
long, -(
long) (((((
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
7237 }
else if (8 *
sizeof(
long) - 1 > 2 * PyLong_SHIFT) {
7238 return (
long) (((long)-1)*(((((long)digits[1]) << PyLong_SHIFT) | (
long)digits[0])));
7243 if (8 *
sizeof(
long) > 1 * PyLong_SHIFT) {
7244 if (8 *
sizeof(
unsigned long) > 2 * PyLong_SHIFT) {
7245 __PYX_VERIFY_RETURN_INT(
long,
unsigned long, (((((
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
7246 }
else if (8 *
sizeof(
long) - 1 > 2 * PyLong_SHIFT) {
7247 return (
long) ((((((long)digits[1]) << PyLong_SHIFT) | (
long)digits[0])));
7252 if (8 *
sizeof(
long) - 1 > 2 * PyLong_SHIFT) {
7253 if (8 *
sizeof(
unsigned long) > 3 * PyLong_SHIFT) {
7254 __PYX_VERIFY_RETURN_INT(
long,
long, -(
long) (((((((
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
7255 }
else if (8 *
sizeof(
long) - 1 > 3 * PyLong_SHIFT) {
7256 return (
long) (((long)-1)*(((((((long)digits[2]) << PyLong_SHIFT) | (
long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
7261 if (8 *
sizeof(
long) > 2 * PyLong_SHIFT) {
7262 if (8 *
sizeof(
unsigned long) > 3 * PyLong_SHIFT) {
7263 __PYX_VERIFY_RETURN_INT(
long,
unsigned long, (((((((
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
7264 }
else if (8 *
sizeof(
long) - 1 > 3 * PyLong_SHIFT) {
7265 return (
long) ((((((((long)digits[2]) << PyLong_SHIFT) | (
long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
7270 if (8 *
sizeof(
long) - 1 > 3 * PyLong_SHIFT) {
7271 if (8 *
sizeof(
unsigned long) > 4 * PyLong_SHIFT) {
7272 __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])))
7273 }
else if (8 *
sizeof(
long) - 1 > 4 * PyLong_SHIFT) {
7274 return (
long) (((long)-1)*(((((((((long)digits[3]) << PyLong_SHIFT) | (
long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (
long)digits[0])));
7279 if (8 *
sizeof(
long) > 3 * PyLong_SHIFT) {
7280 if (8 *
sizeof(
unsigned long) > 4 * PyLong_SHIFT) {
7281 __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])))
7282 }
else if (8 *
sizeof(
long) - 1 > 4 * PyLong_SHIFT) {
7283 return (
long) ((((((((((long)digits[3]) << PyLong_SHIFT) | (
long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (
long)digits[0])));
7289 if (
sizeof(
long) <=
sizeof(long)) {
7290 __PYX_VERIFY_RETURN_INT_EXC(
long,
long, PyLong_AsLong(x))
7291 #ifdef HAVE_LONG_LONG
7292 }
else if (
sizeof(
long) <=
sizeof(PY_LONG_LONG)) {
7293 __PYX_VERIFY_RETURN_INT_EXC(
long, PY_LONG_LONG, PyLong_AsLongLong(x))
7298 #if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray)
7299 PyErr_SetString(PyExc_RuntimeError,
7300 "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers");
7303 PyObject *
v = __Pyx_PyNumber_IntOrLong(x);
7304 #if PY_MAJOR_VERSION < 3
7305 if (likely(
v) && !PyLong_Check(
v)) {
7307 v = PyNumber_Long(tmp);
7312 int one = 1;
int is_little = (int)*(
unsigned char *)&one;
7313 unsigned char *bytes = (
unsigned char *)&val;
7314 int ret = _PyLong_AsByteArray((PyLongObject *)
v,
7316 is_little, !is_unsigned);
7326 PyObject *tmp = __Pyx_PyNumber_IntOrLong(x);
7327 if (!tmp)
return (
long) -1;
7328 val = __Pyx_PyInt_As_long(tmp);
7333 PyErr_SetString(PyExc_OverflowError,
7334 "value too large to convert to long");
7337 PyErr_SetString(PyExc_OverflowError,
7338 "can't convert negative value to long");
7343 #if CYTHON_COMPILING_IN_CPYTHON
7344 static int __Pyx_InBases(PyTypeObject *a, PyTypeObject *b) {
7350 return b == &PyBaseObject_Type;
7352 static CYTHON_INLINE
int __Pyx_IsSubtype(PyTypeObject *a, PyTypeObject *b) {
7354 if (a == b)
return 1;
7358 n = PyTuple_GET_SIZE(mro);
7359 for (i = 0; i <
n; i++) {
7360 if (PyTuple_GET_ITEM(mro, i) == (PyObject *)b)
7365 return __Pyx_InBases(a, b);
7367 #if PY_MAJOR_VERSION == 2
7368 static int __Pyx_inner_PyErr_GivenExceptionMatches2(PyObject *err, PyObject* exc_type1, PyObject* exc_type2) {
7369 PyObject *exception, *value, *tb;
7371 __Pyx_PyThreadState_declare
7372 __Pyx_PyThreadState_assign
7373 __Pyx_ErrFetch(&exception, &value, &tb);
7374 res = exc_type1 ? PyObject_IsSubclass(err, exc_type1) : 0;
7375 if (unlikely(res == -1)) {
7376 PyErr_WriteUnraisable(err);
7380 res = PyObject_IsSubclass(err, exc_type2);
7381 if (unlikely(res == -1)) {
7382 PyErr_WriteUnraisable(err);
7386 __Pyx_ErrRestore(exception, value, tb);
7390 static CYTHON_INLINE
int __Pyx_inner_PyErr_GivenExceptionMatches2(PyObject *err, PyObject* exc_type1, PyObject *exc_type2) {
7391 int res = exc_type1 ? __Pyx_IsSubtype((PyTypeObject*)err, (PyTypeObject*)exc_type1) : 0;
7393 res = __Pyx_IsSubtype((PyTypeObject*)err, (PyTypeObject*)exc_type2);
7398 static int __Pyx_PyErr_GivenExceptionMatchesTuple(PyObject *exc_type, PyObject *tuple) {
7400 assert(PyExceptionClass_Check(exc_type));
7401 n = PyTuple_GET_SIZE(tuple);
7402 #if PY_MAJOR_VERSION >= 3
7403 for (i=0; i<
n; i++) {
7404 if (exc_type == PyTuple_GET_ITEM(tuple, i))
return 1;
7407 for (i=0; i<
n; i++) {
7408 PyObject *t = PyTuple_GET_ITEM(tuple, i);
7409 #if PY_MAJOR_VERSION < 3
7410 if (likely(exc_type == t))
return 1;
7412 if (likely(PyExceptionClass_Check(t))) {
7413 if (__Pyx_inner_PyErr_GivenExceptionMatches2(exc_type, NULL, t))
return 1;
7419 static CYTHON_INLINE
int __Pyx_PyErr_GivenExceptionMatches(PyObject *err, PyObject* exc_type) {
7420 if (likely(err == exc_type))
return 1;
7421 if (likely(PyExceptionClass_Check(err))) {
7422 if (likely(PyExceptionClass_Check(exc_type))) {
7423 return __Pyx_inner_PyErr_GivenExceptionMatches2(err, NULL, exc_type);
7424 }
else if (likely(PyTuple_Check(exc_type))) {
7425 return __Pyx_PyErr_GivenExceptionMatchesTuple(err, exc_type);
7429 return PyErr_GivenExceptionMatches(err, exc_type);
7431 static CYTHON_INLINE
int __Pyx_PyErr_GivenExceptionMatches2(PyObject *err, PyObject *exc_type1, PyObject *exc_type2) {
7432 assert(PyExceptionClass_Check(exc_type1));
7433 assert(PyExceptionClass_Check(exc_type2));
7434 if (likely(err == exc_type1 || err == exc_type2))
return 1;
7435 if (likely(PyExceptionClass_Check(err))) {
7436 return __Pyx_inner_PyErr_GivenExceptionMatches2(err, exc_type1, exc_type2);
7438 return (PyErr_GivenExceptionMatches(err, exc_type1) || PyErr_GivenExceptionMatches(err, exc_type2));
7443 static int __Pyx_check_binary_version(
void) {
7445 int same=1, i, found_dot;
7446 const char* rt_from_call = Py_GetVersion();
7447 PyOS_snprintf(ctversion, 5,
"%d.%d", PY_MAJOR_VERSION, PY_MINOR_VERSION);
7449 for (i = 0; i < 4; i++) {
7450 if (!ctversion[i]) {
7451 same = (rt_from_call[i] <
'0' || rt_from_call[i] >
'9');
7454 if (rt_from_call[i] != ctversion[i]) {
7460 char rtversion[5] = {
'\0'};
7462 for (i=0; i<4; ++i) {
7463 if (rt_from_call[i] ==
'.') {
7464 if (found_dot)
break;
7466 }
else if (rt_from_call[i] <
'0' || rt_from_call[i] >
'9') {
7469 rtversion[i] = rt_from_call[i];
7471 PyOS_snprintf(message,
sizeof(message),
7472 "compiletime version %s of module '%.100s' "
7473 "does not match runtime version %s",
7474 ctversion, __Pyx_MODULE_NAME, rtversion);
7475 return PyErr_WarnEx(NULL, message, 1);
7481 static int __Pyx_InitStrings(__Pyx_StringTabEntry *t) {
7483 #if PY_MAJOR_VERSION < 3
7484 if (t->is_unicode) {
7485 *t->p = PyUnicode_DecodeUTF8(t->s, t->n - 1, NULL);
7486 }
else if (t->intern) {
7487 *t->p = PyString_InternFromString(t->s);
7489 *t->p = PyString_FromStringAndSize(t->s, t->n - 1);
7492 if (t->is_unicode | t->is_str) {
7494 *t->p = PyUnicode_InternFromString(t->s);
7495 }
else if (t->encoding) {
7496 *t->p = PyUnicode_Decode(t->s, t->n - 1, t->encoding, NULL);
7498 *t->p = PyUnicode_FromStringAndSize(t->s, t->n - 1);
7501 *t->p = PyBytes_FromStringAndSize(t->s, t->n - 1);
7506 if (PyObject_Hash(*t->p) == -1)
7513 static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(
const char* c_str) {
7514 return __Pyx_PyUnicode_FromStringAndSize(c_str, (Py_ssize_t)strlen(c_str));
7516 static CYTHON_INLINE
const char* __Pyx_PyObject_AsString(PyObject* o) {
7518 return __Pyx_PyObject_AsStringAndSize(o, &ignore);
7520 #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT
7521 #if !CYTHON_PEP393_ENABLED
7522 static const char* __Pyx_PyUnicode_AsStringAndSize(PyObject* o, Py_ssize_t *length) {
7524 PyObject* defenc = _PyUnicode_AsDefaultEncodedString(o, NULL);
7525 if (!defenc)
return NULL;
7526 defenc_c = PyBytes_AS_STRING(defenc);
7527 #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
7529 char* end = defenc_c + PyBytes_GET_SIZE(defenc);
7531 for (
c = defenc_c;
c < end;
c++) {
7532 if ((
unsigned char) (*
c) >= 128) {
7533 PyUnicode_AsASCIIString(o);
7539 *length = PyBytes_GET_SIZE(defenc);
7543 static CYTHON_INLINE
const char* __Pyx_PyUnicode_AsStringAndSize(PyObject* o, Py_ssize_t *length) {
7544 if (unlikely(__Pyx_PyUnicode_READY(o) == -1))
return NULL;
7545 #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
7546 if (likely(PyUnicode_IS_ASCII(o))) {
7547 *length = PyUnicode_GET_LENGTH(o);
7548 return PyUnicode_AsUTF8(o);
7550 PyUnicode_AsASCIIString(o);
7554 return PyUnicode_AsUTF8AndSize(o, length);
7559 static CYTHON_INLINE
const char* __Pyx_PyObject_AsStringAndSize(PyObject* o, Py_ssize_t *length) {
7560 #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT
7562 #
if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
7563 __Pyx_sys_getdefaultencoding_not_ascii &&
7565 PyUnicode_Check(o)) {
7566 return __Pyx_PyUnicode_AsStringAndSize(o, length);
7569 #if (!CYTHON_COMPILING_IN_PYPY) || (defined(PyByteArray_AS_STRING) && defined(PyByteArray_GET_SIZE))
7570 if (PyByteArray_Check(o)) {
7571 *length = PyByteArray_GET_SIZE(o);
7572 return PyByteArray_AS_STRING(o);
7577 int r = PyBytes_AsStringAndSize(o, &result, length);
7578 if (unlikely(
r < 0)) {
7585 static CYTHON_INLINE
int __Pyx_PyObject_IsTrue(PyObject* x) {
7586 int is_true = x == Py_True;
7587 if (is_true | (x == Py_False) | (x == Py_None))
return is_true;
7588 else return PyObject_IsTrue(x);
7590 static CYTHON_INLINE
int __Pyx_PyObject_IsTrueAndDecref(PyObject* x) {
7592 if (unlikely(!x))
return -1;
7593 retval = __Pyx_PyObject_IsTrue(x);
7597 static PyObject* __Pyx_PyNumber_IntOrLongWrongResultType(PyObject* result,
const char* type_name) {
7598 #if PY_MAJOR_VERSION >= 3
7599 if (PyLong_Check(result)) {
7600 if (PyErr_WarnFormat(PyExc_DeprecationWarning, 1,
7601 "__int__ returned non-int (type %.200s). "
7602 "The ability to return an instance of a strict subclass of int "
7603 "is deprecated, and may be removed in a future version of Python.",
7604 Py_TYPE(result)->tp_name)) {
7611 PyErr_Format(PyExc_TypeError,
7612 "__%.4s__ returned non-%.4s (type %.200s)",
7613 type_name, type_name, Py_TYPE(result)->tp_name);
7617 static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x) {
7618 #if CYTHON_USE_TYPE_SLOTS
7621 const char *name = NULL;
7622 PyObject *res = NULL;
7623 #if PY_MAJOR_VERSION < 3
7624 if (likely(PyInt_Check(x) || PyLong_Check(x)))
7626 if (likely(PyLong_Check(x)))
7628 return __Pyx_NewRef(x);
7629 #if CYTHON_USE_TYPE_SLOTS
7630 m = Py_TYPE(x)->tp_as_number;
7631 #if PY_MAJOR_VERSION < 3
7632 if (m && m->nb_int) {
7636 else if (m && m->nb_long) {
7638 res = m->nb_long(x);
7641 if (likely(m && m->nb_int)) {
7647 if (!PyBytes_CheckExact(x) && !PyUnicode_CheckExact(x)) {
7648 res = PyNumber_Int(x);
7652 #if PY_MAJOR_VERSION < 3
7653 if (unlikely(!PyInt_Check(res) && !PyLong_Check(res))) {
7655 if (unlikely(!PyLong_CheckExact(res))) {
7657 return __Pyx_PyNumber_IntOrLongWrongResultType(res, name);
7660 else if (!PyErr_Occurred()) {
7661 PyErr_SetString(PyExc_TypeError,
7662 "an integer is required");
7666 static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject* b) {
7669 #if PY_MAJOR_VERSION < 3
7670 if (likely(PyInt_CheckExact(b))) {
7671 if (
sizeof(Py_ssize_t) >=
sizeof(
long))
7672 return PyInt_AS_LONG(b);
7674 return PyInt_AsSsize_t(b);
7677 if (likely(PyLong_CheckExact(b))) {
7678 #if CYTHON_USE_PYLONG_INTERNALS
7679 const digit* digits = ((PyLongObject*)b)->ob_digit;
7680 const Py_ssize_t size = Py_SIZE(b);
7681 if (likely(__Pyx_sst_abs(size) <= 1)) {
7682 ival = likely(size) ? digits[0] : 0;
7683 if (size == -1) ival = -ival;
7688 if (8 *
sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) {
7689 return (Py_ssize_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (
size_t)digits[0]));
7693 if (8 *
sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) {
7694 return -(Py_ssize_t) (((((
size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
7698 if (8 *
sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) {
7699 return (Py_ssize_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (
size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
7703 if (8 *
sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) {
7704 return -(Py_ssize_t) (((((((
size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (
size_t)digits[0]));
7708 if (8 *
sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) {
7709 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]));
7713 if (8 *
sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) {
7714 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]));
7720 return PyLong_AsSsize_t(b);
7722 x = PyNumber_Index(b);
7724 ival = PyInt_AsSsize_t(x);
7728 static CYTHON_INLINE Py_hash_t __Pyx_PyIndex_AsHash_t(PyObject* o) {
7729 if (
sizeof(Py_hash_t) ==
sizeof(Py_ssize_t)) {
7730 return (Py_hash_t) __Pyx_PyIndex_AsSsize_t(o);
7731 #if PY_MAJOR_VERSION < 3
7732 }
else if (likely(PyInt_CheckExact(o))) {
7733 return PyInt_AS_LONG(o);
7738 x = PyNumber_Index(o);
7740 ival = PyInt_AsLong(x);
7745 static CYTHON_INLINE PyObject * __Pyx_PyBool_FromLong(
long b) {
7746 return b ? __Pyx_NewRef(Py_True) : __Pyx_NewRef(Py_False);
7748 static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(
size_t ival) {
7749 return PyInt_FromSize_t(ival);