3 #ifndef PY_SSIZE_T_CLEAN
4 #define PY_SSIZE_T_CLEAN
8 #error Python headers needed to compile C extensions, please install development version of Python.
9 #elif PY_VERSION_HEX < 0x02060000 || (0x03000000 <= PY_VERSION_HEX && PY_VERSION_HEX < 0x03030000)
10 #error Cython requires Python 2.6+ or Python 3.3+.
12 #define CYTHON_ABI "0_29_30"
13 #define CYTHON_HEX_VERSION 0x001D1EF0
14 #define CYTHON_FUTURE_DIVISION 0
17 #define offsetof(type, member) ( (size_t) & ((type*)0) -> member )
19 #if !defined(WIN32) && !defined(MS_WINDOWS)
31 #define DL_IMPORT(t) t
34 #define DL_EXPORT(t) t
37 #ifndef HAVE_LONG_LONG
38 #if PY_VERSION_HEX >= 0x02070000
39 #define HAVE_LONG_LONG
43 #define PY_LONG_LONG LONG_LONG
46 #define Py_HUGE_VAL HUGE_VAL
49 #define CYTHON_COMPILING_IN_PYPY 1
50 #define CYTHON_COMPILING_IN_PYSTON 0
51 #define CYTHON_COMPILING_IN_CPYTHON 0
52 #undef CYTHON_USE_TYPE_SLOTS
53 #define CYTHON_USE_TYPE_SLOTS 0
54 #undef CYTHON_USE_PYTYPE_LOOKUP
55 #define CYTHON_USE_PYTYPE_LOOKUP 0
56 #if PY_VERSION_HEX < 0x03050000
57 #undef CYTHON_USE_ASYNC_SLOTS
58 #define CYTHON_USE_ASYNC_SLOTS 0
59 #elif !defined(CYTHON_USE_ASYNC_SLOTS)
60 #define CYTHON_USE_ASYNC_SLOTS 1
62 #undef CYTHON_USE_PYLIST_INTERNALS
63 #define CYTHON_USE_PYLIST_INTERNALS 0
64 #undef CYTHON_USE_UNICODE_INTERNALS
65 #define CYTHON_USE_UNICODE_INTERNALS 0
66 #undef CYTHON_USE_UNICODE_WRITER
67 #define CYTHON_USE_UNICODE_WRITER 0
68 #undef CYTHON_USE_PYLONG_INTERNALS
69 #define CYTHON_USE_PYLONG_INTERNALS 0
70 #undef CYTHON_AVOID_BORROWED_REFS
71 #define CYTHON_AVOID_BORROWED_REFS 1
72 #undef CYTHON_ASSUME_SAFE_MACROS
73 #define CYTHON_ASSUME_SAFE_MACROS 0
74 #undef CYTHON_UNPACK_METHODS
75 #define CYTHON_UNPACK_METHODS 0
76 #undef CYTHON_FAST_THREAD_STATE
77 #define CYTHON_FAST_THREAD_STATE 0
78 #undef CYTHON_FAST_PYCALL
79 #define CYTHON_FAST_PYCALL 0
80 #undef CYTHON_PEP489_MULTI_PHASE_INIT
81 #define CYTHON_PEP489_MULTI_PHASE_INIT 0
82 #undef CYTHON_USE_TP_FINALIZE
83 #define CYTHON_USE_TP_FINALIZE 0
84 #undef CYTHON_USE_DICT_VERSIONS
85 #define CYTHON_USE_DICT_VERSIONS 0
86 #undef CYTHON_USE_EXC_INFO_STACK
87 #define CYTHON_USE_EXC_INFO_STACK 0
88 #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC
89 #define CYTHON_UPDATE_DESCRIPTOR_DOC (PYPY_VERSION_HEX >= 0x07030900)
91 #elif defined(PYSTON_VERSION)
92 #define CYTHON_COMPILING_IN_PYPY 0
93 #define CYTHON_COMPILING_IN_PYSTON 1
94 #define CYTHON_COMPILING_IN_CPYTHON 0
95 #ifndef CYTHON_USE_TYPE_SLOTS
96 #define CYTHON_USE_TYPE_SLOTS 1
98 #undef CYTHON_USE_PYTYPE_LOOKUP
99 #define CYTHON_USE_PYTYPE_LOOKUP 0
100 #undef CYTHON_USE_ASYNC_SLOTS
101 #define CYTHON_USE_ASYNC_SLOTS 0
102 #undef CYTHON_USE_PYLIST_INTERNALS
103 #define CYTHON_USE_PYLIST_INTERNALS 0
104 #ifndef CYTHON_USE_UNICODE_INTERNALS
105 #define CYTHON_USE_UNICODE_INTERNALS 1
107 #undef CYTHON_USE_UNICODE_WRITER
108 #define CYTHON_USE_UNICODE_WRITER 0
109 #undef CYTHON_USE_PYLONG_INTERNALS
110 #define CYTHON_USE_PYLONG_INTERNALS 0
111 #ifndef CYTHON_AVOID_BORROWED_REFS
112 #define CYTHON_AVOID_BORROWED_REFS 0
114 #ifndef CYTHON_ASSUME_SAFE_MACROS
115 #define CYTHON_ASSUME_SAFE_MACROS 1
117 #ifndef CYTHON_UNPACK_METHODS
118 #define CYTHON_UNPACK_METHODS 1
120 #undef CYTHON_FAST_THREAD_STATE
121 #define CYTHON_FAST_THREAD_STATE 0
122 #undef CYTHON_FAST_PYCALL
123 #define CYTHON_FAST_PYCALL 0
124 #undef CYTHON_PEP489_MULTI_PHASE_INIT
125 #define CYTHON_PEP489_MULTI_PHASE_INIT 0
126 #undef CYTHON_USE_TP_FINALIZE
127 #define CYTHON_USE_TP_FINALIZE 0
128 #undef CYTHON_USE_DICT_VERSIONS
129 #define CYTHON_USE_DICT_VERSIONS 0
130 #undef CYTHON_USE_EXC_INFO_STACK
131 #define CYTHON_USE_EXC_INFO_STACK 0
132 #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC
133 #define CYTHON_UPDATE_DESCRIPTOR_DOC 0
136 #define CYTHON_COMPILING_IN_PYPY 0
137 #define CYTHON_COMPILING_IN_PYSTON 0
138 #define CYTHON_COMPILING_IN_CPYTHON 1
139 #ifndef CYTHON_USE_TYPE_SLOTS
140 #define CYTHON_USE_TYPE_SLOTS 1
142 #if PY_VERSION_HEX < 0x02070000
143 #undef CYTHON_USE_PYTYPE_LOOKUP
144 #define CYTHON_USE_PYTYPE_LOOKUP 0
145 #elif !defined(CYTHON_USE_PYTYPE_LOOKUP)
146 #define CYTHON_USE_PYTYPE_LOOKUP 1
148 #if PY_MAJOR_VERSION < 3
149 #undef CYTHON_USE_ASYNC_SLOTS
150 #define CYTHON_USE_ASYNC_SLOTS 0
151 #elif !defined(CYTHON_USE_ASYNC_SLOTS)
152 #define CYTHON_USE_ASYNC_SLOTS 1
154 #if PY_VERSION_HEX < 0x02070000
155 #undef CYTHON_USE_PYLONG_INTERNALS
156 #define CYTHON_USE_PYLONG_INTERNALS 0
157 #elif !defined(CYTHON_USE_PYLONG_INTERNALS)
158 #define CYTHON_USE_PYLONG_INTERNALS 1
160 #ifndef CYTHON_USE_PYLIST_INTERNALS
161 #define CYTHON_USE_PYLIST_INTERNALS 1
163 #ifndef CYTHON_USE_UNICODE_INTERNALS
164 #define CYTHON_USE_UNICODE_INTERNALS 1
166 #if PY_VERSION_HEX < 0x030300F0 || PY_VERSION_HEX >= 0x030B00A2
167 #undef CYTHON_USE_UNICODE_WRITER
168 #define CYTHON_USE_UNICODE_WRITER 0
169 #elif !defined(CYTHON_USE_UNICODE_WRITER)
170 #define CYTHON_USE_UNICODE_WRITER 1
172 #ifndef CYTHON_AVOID_BORROWED_REFS
173 #define CYTHON_AVOID_BORROWED_REFS 0
175 #ifndef CYTHON_ASSUME_SAFE_MACROS
176 #define CYTHON_ASSUME_SAFE_MACROS 1
178 #ifndef CYTHON_UNPACK_METHODS
179 #define CYTHON_UNPACK_METHODS 1
181 #if PY_VERSION_HEX >= 0x030B00A4
182 #undef CYTHON_FAST_THREAD_STATE
183 #define CYTHON_FAST_THREAD_STATE 0
184 #elif !defined(CYTHON_FAST_THREAD_STATE)
185 #define CYTHON_FAST_THREAD_STATE 1
187 #ifndef CYTHON_FAST_PYCALL
188 #define CYTHON_FAST_PYCALL (PY_VERSION_HEX < 0x030A0000)
190 #ifndef CYTHON_PEP489_MULTI_PHASE_INIT
191 #define CYTHON_PEP489_MULTI_PHASE_INIT (PY_VERSION_HEX >= 0x03050000)
193 #ifndef CYTHON_USE_TP_FINALIZE
194 #define CYTHON_USE_TP_FINALIZE (PY_VERSION_HEX >= 0x030400a1)
196 #ifndef CYTHON_USE_DICT_VERSIONS
197 #define CYTHON_USE_DICT_VERSIONS (PY_VERSION_HEX >= 0x030600B1)
199 #if PY_VERSION_HEX >= 0x030B00A4
200 #undef CYTHON_USE_EXC_INFO_STACK
201 #define CYTHON_USE_EXC_INFO_STACK 0
202 #elif !defined(CYTHON_USE_EXC_INFO_STACK)
203 #define CYTHON_USE_EXC_INFO_STACK (PY_VERSION_HEX >= 0x030700A3)
205 #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC
206 #define CYTHON_UPDATE_DESCRIPTOR_DOC 1
209 #if !defined(CYTHON_FAST_PYCCALL)
210 #define CYTHON_FAST_PYCCALL (CYTHON_FAST_PYCALL && PY_VERSION_HEX >= 0x030600B1)
212 #if CYTHON_USE_PYLONG_INTERNALS
213 #if PY_MAJOR_VERSION < 3
214 #include "longintrepr.h"
220 enum { __pyx_check_sizeof_voidp = 1 / (int)(SIZEOF_VOID_P ==
sizeof(
void*)) };
223 #ifndef __has_attribute
224 #define __has_attribute(x) 0
226 #ifndef __has_cpp_attribute
227 #define __has_cpp_attribute(x) 0
229 #ifndef CYTHON_RESTRICT
230 #if defined(__GNUC__)
231 #define CYTHON_RESTRICT __restrict__
232 #elif defined(_MSC_VER) && _MSC_VER >= 1400
233 #define CYTHON_RESTRICT __restrict
234 #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
235 #define CYTHON_RESTRICT restrict
237 #define CYTHON_RESTRICT
240 #ifndef CYTHON_UNUSED
241 # if defined(__GNUC__)
242 # if !(defined(__cplusplus)) || (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4))
243 # define CYTHON_UNUSED __attribute__ ((__unused__))
245 # define CYTHON_UNUSED
247 # elif defined(__ICC) || (defined(__INTEL_COMPILER) && !defined(_MSC_VER))
248 # define CYTHON_UNUSED __attribute__ ((__unused__))
250 # define CYTHON_UNUSED
253 #ifndef CYTHON_MAYBE_UNUSED_VAR
254 # if defined(__cplusplus)
255 template<
class T>
void CYTHON_MAYBE_UNUSED_VAR(
const T& ) { }
257 # define CYTHON_MAYBE_UNUSED_VAR(x) (void)(x)
260 #ifndef CYTHON_NCP_UNUSED
261 # if CYTHON_COMPILING_IN_CPYTHON
262 # define CYTHON_NCP_UNUSED
264 # define CYTHON_NCP_UNUSED CYTHON_UNUSED
267 #define __Pyx_void_to_None(void_result) ((void)(void_result), Py_INCREF(Py_None), Py_None)
269 #ifndef _MSC_STDINT_H_
271 typedef unsigned char uint8_t;
272 typedef unsigned int uint32_t;
274 typedef unsigned __int8 uint8_t;
275 typedef unsigned __int32 uint32_t;
281 #ifndef CYTHON_FALLTHROUGH
282 #if defined(__cplusplus) && __cplusplus >= 201103L
283 #if __has_cpp_attribute(fallthrough)
284 #define CYTHON_FALLTHROUGH [[fallthrough]]
285 #elif __has_cpp_attribute(clang::fallthrough)
286 #define CYTHON_FALLTHROUGH [[clang::fallthrough]]
287 #elif __has_cpp_attribute(gnu::fallthrough)
288 #define CYTHON_FALLTHROUGH [[gnu::fallthrough]]
291 #ifndef CYTHON_FALLTHROUGH
292 #if __has_attribute(fallthrough)
293 #define CYTHON_FALLTHROUGH __attribute__((fallthrough))
295 #define CYTHON_FALLTHROUGH
298 #if defined(__clang__ ) && defined(__apple_build_version__)
299 #if __apple_build_version__ < 7000000
300 #undef CYTHON_FALLTHROUGH
301 #define CYTHON_FALLTHROUGH
307 #error "Cython files generated with the C++ option must be compiled with a C++ compiler."
309 #ifndef CYTHON_INLINE
310 #if defined(__clang__)
311 #define CYTHON_INLINE __inline__ __attribute__ ((__unused__))
313 #define CYTHON_INLINE inline
317 void __Pyx_call_destructor(
T& x) {
321 class __Pyx_FakeReference {
323 __Pyx_FakeReference() : ptr(NULL) { }
324 __Pyx_FakeReference(
const T& ref) : ptr(const_cast<
T*>(&ref)) { }
325 T *operator->() {
return ptr; }
326 T *operator&() {
return ptr; }
327 operator T&() {
return *ptr; }
328 template<
typename U>
bool operator ==(
U other) {
return *ptr == other; }
329 template<
typename U>
bool operator !=(
U other) {
return *ptr != other; }
334 #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x02070600 && !defined(Py_OptimizeFlag)
335 #define Py_OptimizeFlag 0
337 #define __PYX_BUILD_PY_SSIZE_T "n"
338 #define CYTHON_FORMAT_SSIZE_T "z"
339 #if PY_MAJOR_VERSION < 3
340 #define __Pyx_BUILTIN_MODULE_NAME "__builtin__"
341 #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\
342 PyCode_New(a+k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)
343 #define __Pyx_DefaultClassType PyClass_Type
345 #define __Pyx_BUILTIN_MODULE_NAME "builtins"
346 #define __Pyx_DefaultClassType PyType_Type
347 #if PY_VERSION_HEX >= 0x030B00A1
348 static CYTHON_INLINE PyCodeObject* __Pyx_PyCode_New(
int a,
int k,
int l,
int s,
int f,
349 PyObject *code, PyObject *
c, PyObject*
n, PyObject *
v,
350 PyObject *fv, PyObject *cell, PyObject* fn,
351 PyObject *name,
int fline, PyObject *lnos) {
352 PyObject *kwds=NULL, *argcount=NULL, *posonlyargcount=NULL, *kwonlyargcount=NULL;
353 PyObject *nlocals=NULL, *stacksize=NULL, *flags=NULL, *replace=NULL, *call_result=NULL, *empty=NULL;
354 const char *fn_cstr=NULL;
355 const char *name_cstr=NULL;
356 PyCodeObject* co=NULL;
357 PyObject *type, *value, *traceback;
358 PyErr_Fetch(&type, &value, &traceback);
359 if (!(kwds=PyDict_New()))
goto end;
360 if (!(argcount=PyLong_FromLong(a)))
goto end;
361 if (PyDict_SetItemString(kwds,
"co_argcount", argcount) != 0)
goto end;
362 if (!(posonlyargcount=PyLong_FromLong(0)))
goto end;
363 if (PyDict_SetItemString(kwds,
"co_posonlyargcount", posonlyargcount) != 0)
goto end;
364 if (!(kwonlyargcount=PyLong_FromLong(k)))
goto end;
365 if (PyDict_SetItemString(kwds,
"co_kwonlyargcount", kwonlyargcount) != 0)
goto end;
366 if (!(nlocals=PyLong_FromLong(l)))
goto end;
367 if (PyDict_SetItemString(kwds,
"co_nlocals", nlocals) != 0)
goto end;
368 if (!(stacksize=PyLong_FromLong(
s)))
goto end;
369 if (PyDict_SetItemString(kwds,
"co_stacksize", stacksize) != 0)
goto end;
370 if (!(flags=PyLong_FromLong(
f)))
goto end;
371 if (PyDict_SetItemString(kwds,
"co_flags", flags) != 0)
goto end;
372 if (PyDict_SetItemString(kwds,
"co_code", code) != 0)
goto end;
373 if (PyDict_SetItemString(kwds,
"co_consts",
c) != 0)
goto end;
374 if (PyDict_SetItemString(kwds,
"co_names",
n) != 0)
goto end;
375 if (PyDict_SetItemString(kwds,
"co_varnames",
v) != 0)
goto end;
376 if (PyDict_SetItemString(kwds,
"co_freevars", fv) != 0)
goto end;
377 if (PyDict_SetItemString(kwds,
"co_cellvars", cell) != 0)
goto end;
378 if (PyDict_SetItemString(kwds,
"co_linetable", lnos) != 0)
goto end;
379 if (!(fn_cstr=PyUnicode_AsUTF8AndSize(fn, NULL)))
goto end;
380 if (!(name_cstr=PyUnicode_AsUTF8AndSize(name, NULL)))
goto end;
381 if (!(co = PyCode_NewEmpty(fn_cstr, name_cstr, fline)))
goto end;
382 if (!(replace = PyObject_GetAttrString((PyObject*)co,
"replace")))
goto cleanup_code_too;
383 if (!(empty = PyTuple_New(0)))
goto cleanup_code_too;
384 if (!(call_result = PyObject_Call(replace, empty, kwds)))
goto cleanup_code_too;
385 Py_XDECREF((PyObject*)co);
386 co = (PyCodeObject*)call_result;
390 Py_XDECREF((PyObject*)co);
395 Py_XDECREF(argcount);
396 Py_XDECREF(posonlyargcount);
397 Py_XDECREF(kwonlyargcount);
399 Py_XDECREF(stacksize);
401 Py_XDECREF(call_result);
404 PyErr_Restore(type, value, traceback);
409 #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\
410 PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)
412 #define __Pyx_DefaultClassType PyType_Type
414 #ifndef Py_TPFLAGS_CHECKTYPES
415 #define Py_TPFLAGS_CHECKTYPES 0
417 #ifndef Py_TPFLAGS_HAVE_INDEX
418 #define Py_TPFLAGS_HAVE_INDEX 0
420 #ifndef Py_TPFLAGS_HAVE_NEWBUFFER
421 #define Py_TPFLAGS_HAVE_NEWBUFFER 0
423 #ifndef Py_TPFLAGS_HAVE_FINALIZE
424 #define Py_TPFLAGS_HAVE_FINALIZE 0
426 #ifndef METH_STACKLESS
427 #define METH_STACKLESS 0
429 #if PY_VERSION_HEX <= 0x030700A3 || !defined(METH_FASTCALL)
430 #ifndef METH_FASTCALL
431 #define METH_FASTCALL 0x80
433 typedef PyObject *(*__Pyx_PyCFunctionFast) (PyObject *
self, PyObject *
const *args, Py_ssize_t nargs);
434 typedef PyObject *(*__Pyx_PyCFunctionFastWithKeywords) (PyObject *
self, PyObject *
const *args,
435 Py_ssize_t nargs, PyObject *kwnames);
437 #define __Pyx_PyCFunctionFast _PyCFunctionFast
438 #define __Pyx_PyCFunctionFastWithKeywords _PyCFunctionFastWithKeywords
440 #if CYTHON_FAST_PYCCALL
441 #define __Pyx_PyFastCFunction_Check(func)\
442 ((PyCFunction_Check(func) && (METH_FASTCALL == (PyCFunction_GET_FLAGS(func) & ~(METH_CLASS | METH_STATIC | METH_COEXIST | METH_KEYWORDS | METH_STACKLESS)))))
444 #define __Pyx_PyFastCFunction_Check(func) 0
446 #if CYTHON_COMPILING_IN_PYPY && !defined(PyObject_Malloc)
447 #define PyObject_Malloc(s) PyMem_Malloc(s)
448 #define PyObject_Free(p) PyMem_Free(p)
449 #define PyObject_Realloc(p) PyMem_Realloc(p)
451 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030400A1
452 #define PyMem_RawMalloc(n) PyMem_Malloc(n)
453 #define PyMem_RawRealloc(p, n) PyMem_Realloc(p, n)
454 #define PyMem_RawFree(p) PyMem_Free(p)
456 #if CYTHON_COMPILING_IN_PYSTON
457 #define __Pyx_PyCode_HasFreeVars(co) PyCode_HasFreeVars(co)
458 #define __Pyx_PyFrame_SetLineNumber(frame, lineno) PyFrame_SetLineNumber(frame, lineno)
460 #define __Pyx_PyCode_HasFreeVars(co) (PyCode_GetNumFree(co) > 0)
461 #define __Pyx_PyFrame_SetLineNumber(frame, lineno) (frame)->f_lineno = (lineno)
463 #if !CYTHON_FAST_THREAD_STATE || PY_VERSION_HEX < 0x02070000
464 #define __Pyx_PyThreadState_Current PyThreadState_GET()
465 #elif PY_VERSION_HEX >= 0x03060000
466 #define __Pyx_PyThreadState_Current _PyThreadState_UncheckedGet()
467 #elif PY_VERSION_HEX >= 0x03000000
468 #define __Pyx_PyThreadState_Current PyThreadState_GET()
470 #define __Pyx_PyThreadState_Current _PyThreadState_Current
472 #if PY_VERSION_HEX < 0x030700A2 && !defined(PyThread_tss_create) && !defined(Py_tss_NEEDS_INIT)
473 #include "pythread.h"
474 #define Py_tss_NEEDS_INIT 0
475 typedef int Py_tss_t;
476 static CYTHON_INLINE
int PyThread_tss_create(Py_tss_t *key) {
477 *key = PyThread_create_key();
480 static CYTHON_INLINE Py_tss_t * PyThread_tss_alloc(
void) {
481 Py_tss_t *key = (Py_tss_t *)PyObject_Malloc(
sizeof(Py_tss_t));
482 *key = Py_tss_NEEDS_INIT;
485 static CYTHON_INLINE
void PyThread_tss_free(Py_tss_t *key) {
488 static CYTHON_INLINE
int PyThread_tss_is_created(Py_tss_t *key) {
489 return *key != Py_tss_NEEDS_INIT;
491 static CYTHON_INLINE
void PyThread_tss_delete(Py_tss_t *key) {
492 PyThread_delete_key(*key);
493 *key = Py_tss_NEEDS_INIT;
495 static CYTHON_INLINE
int PyThread_tss_set(Py_tss_t *key,
void *value) {
496 return PyThread_set_key_value(*key, value);
498 static CYTHON_INLINE
void * PyThread_tss_get(Py_tss_t *key) {
499 return PyThread_get_key_value(*key);
502 #if CYTHON_COMPILING_IN_CPYTHON || defined(_PyDict_NewPresized)
503 #define __Pyx_PyDict_NewPresized(n) ((n <= 8) ? PyDict_New() : _PyDict_NewPresized(n))
505 #define __Pyx_PyDict_NewPresized(n) PyDict_New()
507 #if PY_MAJOR_VERSION >= 3 || CYTHON_FUTURE_DIVISION
508 #define __Pyx_PyNumber_Divide(x,y) PyNumber_TrueDivide(x,y)
509 #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceTrueDivide(x,y)
511 #define __Pyx_PyNumber_Divide(x,y) PyNumber_Divide(x,y)
512 #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceDivide(x,y)
514 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030500A1 && CYTHON_USE_UNICODE_INTERNALS
515 #define __Pyx_PyDict_GetItemStr(dict, name) _PyDict_GetItem_KnownHash(dict, name, ((PyASCIIObject *) name)->hash)
517 #define __Pyx_PyDict_GetItemStr(dict, name) PyDict_GetItem(dict, name)
519 #if PY_VERSION_HEX > 0x03030000 && defined(PyUnicode_KIND)
520 #define CYTHON_PEP393_ENABLED 1
521 #if defined(PyUnicode_IS_READY)
522 #define __Pyx_PyUnicode_READY(op) (likely(PyUnicode_IS_READY(op)) ?\
523 0 : _PyUnicode_Ready((PyObject *)(op)))
525 #define __Pyx_PyUnicode_READY(op) (0)
527 #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_LENGTH(u)
528 #define __Pyx_PyUnicode_READ_CHAR(u, i) PyUnicode_READ_CHAR(u, i)
529 #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u) PyUnicode_MAX_CHAR_VALUE(u)
530 #define __Pyx_PyUnicode_KIND(u) PyUnicode_KIND(u)
531 #define __Pyx_PyUnicode_DATA(u) PyUnicode_DATA(u)
532 #define __Pyx_PyUnicode_READ(k, d, i) PyUnicode_READ(k, d, i)
533 #define __Pyx_PyUnicode_WRITE(k, d, i, ch) PyUnicode_WRITE(k, d, i, ch)
534 #if defined(PyUnicode_IS_READY) && defined(PyUnicode_GET_SIZE)
535 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x03090000
536 #define __Pyx_PyUnicode_IS_TRUE(u) (0 != (likely(PyUnicode_IS_READY(u)) ? PyUnicode_GET_LENGTH(u) : ((PyCompactUnicodeObject *)(u))->wstr_length))
538 #define __Pyx_PyUnicode_IS_TRUE(u) (0 != (likely(PyUnicode_IS_READY(u)) ? PyUnicode_GET_LENGTH(u) : PyUnicode_GET_SIZE(u)))
541 #define __Pyx_PyUnicode_IS_TRUE(u) (0 != PyUnicode_GET_LENGTH(u))
544 #define CYTHON_PEP393_ENABLED 0
545 #define PyUnicode_1BYTE_KIND 1
546 #define PyUnicode_2BYTE_KIND 2
547 #define PyUnicode_4BYTE_KIND 4
548 #define __Pyx_PyUnicode_READY(op) (0)
549 #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_SIZE(u)
550 #define __Pyx_PyUnicode_READ_CHAR(u, i) ((Py_UCS4)(PyUnicode_AS_UNICODE(u)[i]))
551 #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u) ((sizeof(Py_UNICODE) == 2) ? 65535 : 1114111)
552 #define __Pyx_PyUnicode_KIND(u) (sizeof(Py_UNICODE))
553 #define __Pyx_PyUnicode_DATA(u) ((void*)PyUnicode_AS_UNICODE(u))
554 #define __Pyx_PyUnicode_READ(k, d, i) ((void)(k), (Py_UCS4)(((Py_UNICODE*)d)[i]))
555 #define __Pyx_PyUnicode_WRITE(k, d, i, ch) (((void)(k)), ((Py_UNICODE*)d)[i] = ch)
556 #define __Pyx_PyUnicode_IS_TRUE(u) (0 != PyUnicode_GET_SIZE(u))
558 #if CYTHON_COMPILING_IN_PYPY
559 #define __Pyx_PyUnicode_Concat(a, b) PyNumber_Add(a, b)
560 #define __Pyx_PyUnicode_ConcatSafe(a, b) PyNumber_Add(a, b)
562 #define __Pyx_PyUnicode_Concat(a, b) PyUnicode_Concat(a, b)
563 #define __Pyx_PyUnicode_ConcatSafe(a, b) ((unlikely((a) == Py_None) || unlikely((b) == Py_None)) ?\
564 PyNumber_Add(a, b) : __Pyx_PyUnicode_Concat(a, b))
566 #if CYTHON_COMPILING_IN_PYPY && !defined(PyUnicode_Contains)
567 #define PyUnicode_Contains(u, s) PySequence_Contains(u, s)
569 #if CYTHON_COMPILING_IN_PYPY && !defined(PyByteArray_Check)
570 #define PyByteArray_Check(obj) PyObject_TypeCheck(obj, &PyByteArray_Type)
572 #if CYTHON_COMPILING_IN_PYPY && !defined(PyObject_Format)
573 #define PyObject_Format(obj, fmt) PyObject_CallMethod(obj, "__format__", "O", fmt)
575 #define __Pyx_PyString_FormatSafe(a, b) ((unlikely((a) == Py_None || (PyString_Check(b) && !PyString_CheckExact(b)))) ? PyNumber_Remainder(a, b) : __Pyx_PyString_Format(a, b))
576 #define __Pyx_PyUnicode_FormatSafe(a, b) ((unlikely((a) == Py_None || (PyUnicode_Check(b) && !PyUnicode_CheckExact(b)))) ? PyNumber_Remainder(a, b) : PyUnicode_Format(a, b))
577 #if PY_MAJOR_VERSION >= 3
578 #define __Pyx_PyString_Format(a, b) PyUnicode_Format(a, b)
580 #define __Pyx_PyString_Format(a, b) PyString_Format(a, b)
582 #if PY_MAJOR_VERSION < 3 && !defined(PyObject_ASCII)
583 #define PyObject_ASCII(o) PyObject_Repr(o)
585 #if PY_MAJOR_VERSION >= 3
586 #define PyBaseString_Type PyUnicode_Type
587 #define PyStringObject PyUnicodeObject
588 #define PyString_Type PyUnicode_Type
589 #define PyString_Check PyUnicode_Check
590 #define PyString_CheckExact PyUnicode_CheckExact
591 #ifndef PyObject_Unicode
592 #define PyObject_Unicode PyObject_Str
595 #if PY_MAJOR_VERSION >= 3
596 #define __Pyx_PyBaseString_Check(obj) PyUnicode_Check(obj)
597 #define __Pyx_PyBaseString_CheckExact(obj) PyUnicode_CheckExact(obj)
599 #define __Pyx_PyBaseString_Check(obj) (PyString_Check(obj) || PyUnicode_Check(obj))
600 #define __Pyx_PyBaseString_CheckExact(obj) (PyString_CheckExact(obj) || PyUnicode_CheckExact(obj))
602 #ifndef PySet_CheckExact
603 #define PySet_CheckExact(obj) (Py_TYPE(obj) == &PySet_Type)
605 #if PY_VERSION_HEX >= 0x030900A4
606 #define __Pyx_SET_REFCNT(obj, refcnt) Py_SET_REFCNT(obj, refcnt)
607 #define __Pyx_SET_SIZE(obj, size) Py_SET_SIZE(obj, size)
609 #define __Pyx_SET_REFCNT(obj, refcnt) Py_REFCNT(obj) = (refcnt)
610 #define __Pyx_SET_SIZE(obj, size) Py_SIZE(obj) = (size)
612 #if CYTHON_ASSUME_SAFE_MACROS
613 #define __Pyx_PySequence_SIZE(seq) Py_SIZE(seq)
615 #define __Pyx_PySequence_SIZE(seq) PySequence_Size(seq)
617 #if PY_MAJOR_VERSION >= 3
618 #define PyIntObject PyLongObject
619 #define PyInt_Type PyLong_Type
620 #define PyInt_Check(op) PyLong_Check(op)
621 #define PyInt_CheckExact(op) PyLong_CheckExact(op)
622 #define PyInt_FromString PyLong_FromString
623 #define PyInt_FromUnicode PyLong_FromUnicode
624 #define PyInt_FromLong PyLong_FromLong
625 #define PyInt_FromSize_t PyLong_FromSize_t
626 #define PyInt_FromSsize_t PyLong_FromSsize_t
627 #define PyInt_AsLong PyLong_AsLong
628 #define PyInt_AS_LONG PyLong_AS_LONG
629 #define PyInt_AsSsize_t PyLong_AsSsize_t
630 #define PyInt_AsUnsignedLongMask PyLong_AsUnsignedLongMask
631 #define PyInt_AsUnsignedLongLongMask PyLong_AsUnsignedLongLongMask
632 #define PyNumber_Int PyNumber_Long
634 #if PY_MAJOR_VERSION >= 3
635 #define PyBoolObject PyLongObject
637 #if PY_MAJOR_VERSION >= 3 && CYTHON_COMPILING_IN_PYPY
638 #ifndef PyUnicode_InternFromString
639 #define PyUnicode_InternFromString(s) PyUnicode_FromString(s)
642 #if PY_VERSION_HEX < 0x030200A4
643 typedef long Py_hash_t;
644 #define __Pyx_PyInt_FromHash_t PyInt_FromLong
645 #define __Pyx_PyInt_AsHash_t __Pyx_PyIndex_AsHash_t
647 #define __Pyx_PyInt_FromHash_t PyInt_FromSsize_t
648 #define __Pyx_PyInt_AsHash_t __Pyx_PyIndex_AsSsize_t
650 #if PY_MAJOR_VERSION >= 3
651 #define __Pyx_PyMethod_New(func, self, klass) ((self) ? ((void)(klass), PyMethod_New(func, self)) : __Pyx_NewRef(func))
653 #define __Pyx_PyMethod_New(func, self, klass) PyMethod_New(func, self, klass)
655 #if CYTHON_USE_ASYNC_SLOTS
656 #if PY_VERSION_HEX >= 0x030500B1
657 #define __Pyx_PyAsyncMethodsStruct PyAsyncMethods
658 #define __Pyx_PyType_AsAsync(obj) (Py_TYPE(obj)->tp_as_async)
660 #define __Pyx_PyType_AsAsync(obj) ((__Pyx_PyAsyncMethodsStruct*) (Py_TYPE(obj)->tp_reserved))
663 #define __Pyx_PyType_AsAsync(obj) NULL
665 #ifndef __Pyx_PyAsyncMethodsStruct
670 } __Pyx_PyAsyncMethodsStruct;
673 #if defined(_WIN32) || defined(WIN32) || defined(MS_WINDOWS)
674 #if !defined(_USE_MATH_DEFINES)
675 #define _USE_MATH_DEFINES
680 #define __PYX_NAN() ((float) NAN)
682 static CYTHON_INLINE
float __PYX_NAN() {
684 memset(&value, 0xFF,
sizeof(value));
688 #if defined(__CYGWIN__) && defined(_LDBL_EQ_DBL)
689 #define __Pyx_truncl trunc
691 #define __Pyx_truncl truncl
694 #define __PYX_MARK_ERR_POS(f_index, lineno) \
695 { __pyx_filename = __pyx_f[f_index]; (void)__pyx_filename; __pyx_lineno = lineno; (void)__pyx_lineno; __pyx_clineno = __LINE__; (void)__pyx_clineno; }
696 #define __PYX_ERR(f_index, lineno, Ln_error) \
697 { __PYX_MARK_ERR_POS(f_index, lineno) goto Ln_error; }
699 #ifndef __PYX_EXTERN_C
701 #define __PYX_EXTERN_C extern "C"
703 #define __PYX_EXTERN_C extern
707 #define __PYX_HAVE__cSubsurfaceTransportCoefficients
708 #define __PYX_HAVE_API__cSubsurfaceTransportCoefficients
712 #include "numpy/arrayobject.h"
713 #include "numpy/ndarrayobject.h"
714 #include "numpy/ndarraytypes.h"
715 #include "numpy/arrayscalars.h"
716 #include "numpy/ufuncobject.h"
725 #if defined(PYREX_WITHOUT_ASSERTIONS) && !defined(CYTHON_WITHOUT_ASSERTIONS)
726 #define CYTHON_WITHOUT_ASSERTIONS
729 typedef struct {PyObject **p;
const char *
s;
const Py_ssize_t
n;
const char* encoding;
730 const char is_unicode;
const char is_str;
const char intern; } __Pyx_StringTabEntry;
732 #define __PYX_DEFAULT_STRING_ENCODING_IS_ASCII 0
733 #define __PYX_DEFAULT_STRING_ENCODING_IS_UTF8 0
734 #define __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT (PY_MAJOR_VERSION >= 3 && __PYX_DEFAULT_STRING_ENCODING_IS_UTF8)
735 #define __PYX_DEFAULT_STRING_ENCODING ""
736 #define __Pyx_PyObject_FromString __Pyx_PyBytes_FromString
737 #define __Pyx_PyObject_FromStringAndSize __Pyx_PyBytes_FromStringAndSize
738 #define __Pyx_uchar_cast(c) ((unsigned char)c)
739 #define __Pyx_long_cast(x) ((long)x)
740 #define __Pyx_fits_Py_ssize_t(v, type, is_signed) (\
741 (sizeof(type) < sizeof(Py_ssize_t)) ||\
742 (sizeof(type) > sizeof(Py_ssize_t) &&\
743 likely(v < (type)PY_SSIZE_T_MAX ||\
744 v == (type)PY_SSIZE_T_MAX) &&\
745 (!is_signed || likely(v > (type)PY_SSIZE_T_MIN ||\
746 v == (type)PY_SSIZE_T_MIN))) ||\
747 (sizeof(type) == sizeof(Py_ssize_t) &&\
748 (is_signed || likely(v < (type)PY_SSIZE_T_MAX ||\
749 v == (type)PY_SSIZE_T_MAX))) )
750 static CYTHON_INLINE
int __Pyx_is_valid_index(Py_ssize_t i, Py_ssize_t limit) {
751 return (
size_t) i < (size_t) limit;
753 #if defined (__cplusplus) && __cplusplus >= 201103L
755 #define __Pyx_sst_abs(value) std::abs(value)
756 #elif SIZEOF_INT >= SIZEOF_SIZE_T
757 #define __Pyx_sst_abs(value) abs(value)
758 #elif SIZEOF_LONG >= SIZEOF_SIZE_T
759 #define __Pyx_sst_abs(value) labs(value)
760 #elif defined (_MSC_VER)
761 #define __Pyx_sst_abs(value) ((Py_ssize_t)_abs64(value))
762 #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
763 #define __Pyx_sst_abs(value) llabs(value)
764 #elif defined (__GNUC__)
765 #define __Pyx_sst_abs(value) __builtin_llabs(value)
767 #define __Pyx_sst_abs(value) ((value<0) ? -value : value)
769 static CYTHON_INLINE
const char* __Pyx_PyObject_AsString(PyObject*);
770 static CYTHON_INLINE
const char* __Pyx_PyObject_AsStringAndSize(PyObject*, Py_ssize_t* length);
771 #define __Pyx_PyByteArray_FromString(s) PyByteArray_FromStringAndSize((const char*)s, strlen((const char*)s))
772 #define __Pyx_PyByteArray_FromStringAndSize(s, l) PyByteArray_FromStringAndSize((const char*)s, l)
773 #define __Pyx_PyBytes_FromString PyBytes_FromString
774 #define __Pyx_PyBytes_FromStringAndSize PyBytes_FromStringAndSize
775 static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(
const char*);
776 #if PY_MAJOR_VERSION < 3
777 #define __Pyx_PyStr_FromString __Pyx_PyBytes_FromString
778 #define __Pyx_PyStr_FromStringAndSize __Pyx_PyBytes_FromStringAndSize
780 #define __Pyx_PyStr_FromString __Pyx_PyUnicode_FromString
781 #define __Pyx_PyStr_FromStringAndSize __Pyx_PyUnicode_FromStringAndSize
783 #define __Pyx_PyBytes_AsWritableString(s) ((char*) PyBytes_AS_STRING(s))
784 #define __Pyx_PyBytes_AsWritableSString(s) ((signed char*) PyBytes_AS_STRING(s))
785 #define __Pyx_PyBytes_AsWritableUString(s) ((unsigned char*) PyBytes_AS_STRING(s))
786 #define __Pyx_PyBytes_AsString(s) ((const char*) PyBytes_AS_STRING(s))
787 #define __Pyx_PyBytes_AsSString(s) ((const signed char*) PyBytes_AS_STRING(s))
788 #define __Pyx_PyBytes_AsUString(s) ((const unsigned char*) PyBytes_AS_STRING(s))
789 #define __Pyx_PyObject_AsWritableString(s) ((char*) __Pyx_PyObject_AsString(s))
790 #define __Pyx_PyObject_AsWritableSString(s) ((signed char*) __Pyx_PyObject_AsString(s))
791 #define __Pyx_PyObject_AsWritableUString(s) ((unsigned char*) __Pyx_PyObject_AsString(s))
792 #define __Pyx_PyObject_AsSString(s) ((const signed char*) __Pyx_PyObject_AsString(s))
793 #define __Pyx_PyObject_AsUString(s) ((const unsigned char*) __Pyx_PyObject_AsString(s))
794 #define __Pyx_PyObject_FromCString(s) __Pyx_PyObject_FromString((const char*)s)
795 #define __Pyx_PyBytes_FromCString(s) __Pyx_PyBytes_FromString((const char*)s)
796 #define __Pyx_PyByteArray_FromCString(s) __Pyx_PyByteArray_FromString((const char*)s)
797 #define __Pyx_PyStr_FromCString(s) __Pyx_PyStr_FromString((const char*)s)
798 #define __Pyx_PyUnicode_FromCString(s) __Pyx_PyUnicode_FromString((const char*)s)
799 static CYTHON_INLINE
size_t __Pyx_Py_UNICODE_strlen(
const Py_UNICODE *
u) {
800 const Py_UNICODE *u_end =
u;
802 return (
size_t)(u_end -
u - 1);
804 #define __Pyx_PyUnicode_FromUnicode(u) PyUnicode_FromUnicode(u, __Pyx_Py_UNICODE_strlen(u))
805 #define __Pyx_PyUnicode_FromUnicodeAndLength PyUnicode_FromUnicode
806 #define __Pyx_PyUnicode_AsUnicode PyUnicode_AsUnicode
807 #define __Pyx_NewRef(obj) (Py_INCREF(obj), obj)
808 #define __Pyx_Owned_Py_None(b) __Pyx_NewRef(Py_None)
809 static CYTHON_INLINE PyObject * __Pyx_PyBool_FromLong(
long b);
810 static CYTHON_INLINE
int __Pyx_PyObject_IsTrue(PyObject*);
811 static CYTHON_INLINE
int __Pyx_PyObject_IsTrueAndDecref(PyObject*);
812 static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x);
813 #define __Pyx_PySequence_Tuple(obj)\
814 (likely(PyTuple_CheckExact(obj)) ? __Pyx_NewRef(obj) : PySequence_Tuple(obj))
815 static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject*);
816 static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(
size_t);
817 static CYTHON_INLINE Py_hash_t __Pyx_PyIndex_AsHash_t(PyObject*);
818 #if CYTHON_ASSUME_SAFE_MACROS
819 #define __pyx_PyFloat_AsDouble(x) (PyFloat_CheckExact(x) ? PyFloat_AS_DOUBLE(x) : PyFloat_AsDouble(x))
821 #define __pyx_PyFloat_AsDouble(x) PyFloat_AsDouble(x)
823 #define __pyx_PyFloat_AsFloat(x) ((float) __pyx_PyFloat_AsDouble(x))
824 #if PY_MAJOR_VERSION >= 3
825 #define __Pyx_PyNumber_Int(x) (PyLong_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Long(x))
827 #define __Pyx_PyNumber_Int(x) (PyInt_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Int(x))
829 #define __Pyx_PyNumber_Float(x) (PyFloat_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Float(x))
830 #if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
831 static int __Pyx_sys_getdefaultencoding_not_ascii;
832 static int __Pyx_init_sys_getdefaultencoding_params(
void) {
834 PyObject* default_encoding = NULL;
835 PyObject* ascii_chars_u = NULL;
836 PyObject* ascii_chars_b = NULL;
837 const char* default_encoding_c;
838 sys = PyImport_ImportModule(
"sys");
840 default_encoding = PyObject_CallMethod(sys, (
char*)
"getdefaultencoding", NULL);
842 if (!default_encoding)
goto bad;
843 default_encoding_c = PyBytes_AsString(default_encoding);
844 if (!default_encoding_c)
goto bad;
845 if (strcmp(default_encoding_c,
"ascii") == 0) {
846 __Pyx_sys_getdefaultencoding_not_ascii = 0;
848 char ascii_chars[128];
850 for (
c = 0;
c < 128;
c++) {
853 __Pyx_sys_getdefaultencoding_not_ascii = 1;
854 ascii_chars_u = PyUnicode_DecodeASCII(ascii_chars, 128, NULL);
855 if (!ascii_chars_u)
goto bad;
856 ascii_chars_b = PyUnicode_AsEncodedString(ascii_chars_u, default_encoding_c, NULL);
857 if (!ascii_chars_b || !PyBytes_Check(ascii_chars_b) || memcmp(ascii_chars, PyBytes_AS_STRING(ascii_chars_b), 128) != 0) {
860 "This module compiled with c_string_encoding=ascii, but default encoding '%.200s' is not a superset of ascii.",
864 Py_DECREF(ascii_chars_u);
865 Py_DECREF(ascii_chars_b);
867 Py_DECREF(default_encoding);
870 Py_XDECREF(default_encoding);
871 Py_XDECREF(ascii_chars_u);
872 Py_XDECREF(ascii_chars_b);
876 #if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT && PY_MAJOR_VERSION >= 3
877 #define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_DecodeUTF8(c_str, size, NULL)
879 #define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_Decode(c_str, size, __PYX_DEFAULT_STRING_ENCODING, NULL)
880 #if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT
881 static char* __PYX_DEFAULT_STRING_ENCODING;
882 static int __Pyx_init_sys_getdefaultencoding_params(
void) {
884 PyObject* default_encoding = NULL;
885 char* default_encoding_c;
886 sys = PyImport_ImportModule(
"sys");
888 default_encoding = PyObject_CallMethod(sys, (
char*) (
const char*)
"getdefaultencoding", NULL);
890 if (!default_encoding)
goto bad;
891 default_encoding_c = PyBytes_AsString(default_encoding);
892 if (!default_encoding_c)
goto bad;
893 __PYX_DEFAULT_STRING_ENCODING = (
char*) malloc(strlen(default_encoding_c) + 1);
894 if (!__PYX_DEFAULT_STRING_ENCODING)
goto bad;
895 strcpy(__PYX_DEFAULT_STRING_ENCODING, default_encoding_c);
896 Py_DECREF(default_encoding);
899 Py_XDECREF(default_encoding);
907 #if defined(__GNUC__) && (__GNUC__ > 2 || (__GNUC__ == 2 && (__GNUC_MINOR__ > 95)))
908 #define likely(x) __builtin_expect(!!(x), 1)
909 #define unlikely(x) __builtin_expect(!!(x), 0)
911 #define likely(x) (x)
912 #define unlikely(x) (x)
914 static CYTHON_INLINE
void __Pyx_pretend_to_initialize(
void* ptr) { (void)ptr; }
916 static PyObject *__pyx_m = NULL;
917 static PyObject *__pyx_d;
918 static PyObject *__pyx_b;
919 static PyObject *__pyx_cython_runtime = NULL;
920 static PyObject *__pyx_empty_tuple;
921 static PyObject *__pyx_empty_bytes;
922 static PyObject *__pyx_empty_unicode;
923 static int __pyx_lineno;
924 static int __pyx_clineno = 0;
925 static const char * __pyx_cfilenm= __FILE__;
926 static const char *__pyx_filename;
929 #if !defined(CYTHON_CCOMPLEX)
930 #if defined(__cplusplus)
931 #define CYTHON_CCOMPLEX 1
932 #elif defined(_Complex_I)
933 #define CYTHON_CCOMPLEX 1
935 #define CYTHON_CCOMPLEX 0
945 #if CYTHON_CCOMPLEX && !defined(__cplusplus) && defined(__sun__) && defined(__GNUC__)
947 #define _Complex_I 1.0fj
951 static const char *__pyx_f[] = {
952 "proteus/cSubsurfaceTransportCoefficients.pyx",
964 typedef npy_int8 __pyx_t_5numpy_int8_t;
973 typedef npy_int16 __pyx_t_5numpy_int16_t;
982 typedef npy_int32 __pyx_t_5numpy_int32_t;
991 typedef npy_int64 __pyx_t_5numpy_int64_t;
1000 typedef npy_uint8 __pyx_t_5numpy_uint8_t;
1009 typedef npy_uint16 __pyx_t_5numpy_uint16_t;
1018 typedef npy_uint32 __pyx_t_5numpy_uint32_t;
1027 typedef npy_uint64 __pyx_t_5numpy_uint64_t;
1036 typedef npy_float32 __pyx_t_5numpy_float32_t;
1045 typedef npy_float64 __pyx_t_5numpy_float64_t;
1054 typedef npy_long __pyx_t_5numpy_int_t;
1063 typedef npy_longlong __pyx_t_5numpy_long_t;
1072 typedef npy_longlong __pyx_t_5numpy_longlong_t;
1081 typedef npy_ulong __pyx_t_5numpy_uint_t;
1090 typedef npy_ulonglong __pyx_t_5numpy_ulong_t;
1099 typedef npy_ulonglong __pyx_t_5numpy_ulonglong_t;
1108 typedef npy_intp __pyx_t_5numpy_intp_t;
1117 typedef npy_uintp __pyx_t_5numpy_uintp_t;
1126 typedef npy_double __pyx_t_5numpy_float_t;
1135 typedef npy_double __pyx_t_5numpy_double_t;
1144 typedef npy_longdouble __pyx_t_5numpy_longdouble_t;
1148 typedef ::std::complex< float > __pyx_t_float_complex;
1150 typedef float _Complex __pyx_t_float_complex;
1153 typedef struct {
float real, imag; } __pyx_t_float_complex;
1155 static CYTHON_INLINE __pyx_t_float_complex __pyx_t_float_complex_from_parts(
float,
float);
1160 typedef ::std::complex< double > __pyx_t_double_complex;
1162 typedef double _Complex __pyx_t_double_complex;
1165 typedef struct {
double real, imag; } __pyx_t_double_complex;
1167 static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(
double,
double);
1179 typedef npy_cfloat __pyx_t_5numpy_cfloat_t;
1188 typedef npy_cdouble __pyx_t_5numpy_cdouble_t;
1197 typedef npy_clongdouble __pyx_t_5numpy_clongdouble_t;
1206 typedef npy_cdouble __pyx_t_5numpy_complex_t;
1210 #ifndef CYTHON_REFNANNY
1211 #define CYTHON_REFNANNY 0
1215 void (*INCREF)(
void*, PyObject*, int);
1216 void (*DECREF)(
void*, PyObject*, int);
1217 void (*GOTREF)(
void*, PyObject*, int);
1218 void (*GIVEREF)(
void*, PyObject*, int);
1219 void* (*SetupContext)(
const char*, int,
const char*);
1220 void (*FinishContext)(
void**);
1221 } __Pyx_RefNannyAPIStruct;
1222 static __Pyx_RefNannyAPIStruct *__Pyx_RefNanny = NULL;
1223 static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(
const char *modname);
1224 #define __Pyx_RefNannyDeclarations void *__pyx_refnanny = NULL;
1226 #define __Pyx_RefNannySetupContext(name, acquire_gil)\
1228 PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();\
1229 __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__);\
1230 PyGILState_Release(__pyx_gilstate_save);\
1232 __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__);\
1235 #define __Pyx_RefNannySetupContext(name, acquire_gil)\
1236 __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__)
1238 #define __Pyx_RefNannyFinishContext()\
1239 __Pyx_RefNanny->FinishContext(&__pyx_refnanny)
1240 #define __Pyx_INCREF(r) __Pyx_RefNanny->INCREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
1241 #define __Pyx_DECREF(r) __Pyx_RefNanny->DECREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
1242 #define __Pyx_GOTREF(r) __Pyx_RefNanny->GOTREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
1243 #define __Pyx_GIVEREF(r) __Pyx_RefNanny->GIVEREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
1244 #define __Pyx_XINCREF(r) do { if((r) != NULL) {__Pyx_INCREF(r); }} while(0)
1245 #define __Pyx_XDECREF(r) do { if((r) != NULL) {__Pyx_DECREF(r); }} while(0)
1246 #define __Pyx_XGOTREF(r) do { if((r) != NULL) {__Pyx_GOTREF(r); }} while(0)
1247 #define __Pyx_XGIVEREF(r) do { if((r) != NULL) {__Pyx_GIVEREF(r);}} while(0)
1249 #define __Pyx_RefNannyDeclarations
1250 #define __Pyx_RefNannySetupContext(name, acquire_gil)
1251 #define __Pyx_RefNannyFinishContext()
1252 #define __Pyx_INCREF(r) Py_INCREF(r)
1253 #define __Pyx_DECREF(r) Py_DECREF(r)
1254 #define __Pyx_GOTREF(r)
1255 #define __Pyx_GIVEREF(r)
1256 #define __Pyx_XINCREF(r) Py_XINCREF(r)
1257 #define __Pyx_XDECREF(r) Py_XDECREF(r)
1258 #define __Pyx_XGOTREF(r)
1259 #define __Pyx_XGIVEREF(r)
1261 #define __Pyx_XDECREF_SET(r, v) do {\
1262 PyObject *tmp = (PyObject *) r;\
1263 r = v; __Pyx_XDECREF(tmp);\
1265 #define __Pyx_DECREF_SET(r, v) do {\
1266 PyObject *tmp = (PyObject *) r;\
1267 r = v; __Pyx_DECREF(tmp);\
1269 #define __Pyx_CLEAR(r) do { PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);} while(0)
1270 #define __Pyx_XCLEAR(r) do { if((r) != NULL) {PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);}} while(0)
1273 static void __Pyx_RaiseArgtupleInvalid(
const char* func_name,
int exact,
1274 Py_ssize_t num_min, Py_ssize_t num_max, Py_ssize_t num_found);
1277 static void __Pyx_RaiseDoubleKeywordsError(
const char* func_name, PyObject* kw_name);
1280 static int __Pyx_ParseOptionalKeywords(PyObject *kwds, PyObject **argnames[],\
1281 PyObject *kwds2, PyObject *values[], Py_ssize_t num_pos_args,\
1282 const char* function_name);
1285 #define __Pyx_ArgTypeTest(obj, type, none_allowed, name, exact)\
1286 ((likely((Py_TYPE(obj) == type) | (none_allowed && (obj == Py_None)))) ? 1 :\
1287 __Pyx__ArgTypeTest(obj, type, name, exact))
1288 static int __Pyx__ArgTypeTest(PyObject *obj, PyTypeObject *type,
const char *name,
int exact);
1291 #if CYTHON_USE_TYPE_SLOTS
1292 static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name);
1294 #define __Pyx_PyObject_GetAttrStr(o,n) PyObject_GetAttr(o,n)
1298 static PyObject *__Pyx_GetBuiltinName(PyObject *name);
1301 #if CYTHON_USE_EXC_INFO_STACK
1302 static _PyErr_StackItem * __Pyx_PyErr_GetTopmostException(PyThreadState *tstate);
1306 #if CYTHON_FAST_THREAD_STATE
1307 #define __Pyx_PyThreadState_declare PyThreadState *__pyx_tstate;
1308 #define __Pyx_PyThreadState_assign __pyx_tstate = __Pyx_PyThreadState_Current;
1309 #define __Pyx_PyErr_Occurred() __pyx_tstate->curexc_type
1311 #define __Pyx_PyThreadState_declare
1312 #define __Pyx_PyThreadState_assign
1313 #define __Pyx_PyErr_Occurred() PyErr_Occurred()
1317 #if CYTHON_FAST_THREAD_STATE
1318 #define __Pyx_ExceptionSave(type, value, tb) __Pyx__ExceptionSave(__pyx_tstate, type, value, tb)
1319 static CYTHON_INLINE
void __Pyx__ExceptionSave(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb);
1320 #define __Pyx_ExceptionReset(type, value, tb) __Pyx__ExceptionReset(__pyx_tstate, type, value, tb)
1321 static CYTHON_INLINE
void __Pyx__ExceptionReset(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb);
1323 #define __Pyx_ExceptionSave(type, value, tb) PyErr_GetExcInfo(type, value, tb)
1324 #define __Pyx_ExceptionReset(type, value, tb) PyErr_SetExcInfo(type, value, tb)
1328 #if CYTHON_FAST_THREAD_STATE
1329 #define __Pyx_PyErr_ExceptionMatches(err) __Pyx_PyErr_ExceptionMatchesInState(__pyx_tstate, err)
1330 static CYTHON_INLINE
int __Pyx_PyErr_ExceptionMatchesInState(PyThreadState* tstate, PyObject* err);
1332 #define __Pyx_PyErr_ExceptionMatches(err) PyErr_ExceptionMatches(err)
1336 #if CYTHON_FAST_THREAD_STATE
1337 #define __Pyx_GetException(type, value, tb) __Pyx__GetException(__pyx_tstate, type, value, tb)
1338 static int __Pyx__GetException(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb);
1340 static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb);
1344 #if CYTHON_COMPILING_IN_CPYTHON
1345 static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw);
1347 #define __Pyx_PyObject_Call(func, arg, kw) PyObject_Call(func, arg, kw)
1351 #if CYTHON_FAST_THREAD_STATE
1352 #define __Pyx_PyErr_Clear() __Pyx_ErrRestore(NULL, NULL, NULL)
1353 #define __Pyx_ErrRestoreWithState(type, value, tb) __Pyx_ErrRestoreInState(PyThreadState_GET(), type, value, tb)
1354 #define __Pyx_ErrFetchWithState(type, value, tb) __Pyx_ErrFetchInState(PyThreadState_GET(), type, value, tb)
1355 #define __Pyx_ErrRestore(type, value, tb) __Pyx_ErrRestoreInState(__pyx_tstate, type, value, tb)
1356 #define __Pyx_ErrFetch(type, value, tb) __Pyx_ErrFetchInState(__pyx_tstate, type, value, tb)
1357 static CYTHON_INLINE
void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb);
1358 static CYTHON_INLINE
void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb);
1359 #if CYTHON_COMPILING_IN_CPYTHON
1360 #define __Pyx_PyErr_SetNone(exc) (Py_INCREF(exc), __Pyx_ErrRestore((exc), NULL, NULL))
1362 #define __Pyx_PyErr_SetNone(exc) PyErr_SetNone(exc)
1365 #define __Pyx_PyErr_Clear() PyErr_Clear()
1366 #define __Pyx_PyErr_SetNone(exc) PyErr_SetNone(exc)
1367 #define __Pyx_ErrRestoreWithState(type, value, tb) PyErr_Restore(type, value, tb)
1368 #define __Pyx_ErrFetchWithState(type, value, tb) PyErr_Fetch(type, value, tb)
1369 #define __Pyx_ErrRestoreInState(tstate, type, value, tb) PyErr_Restore(type, value, tb)
1370 #define __Pyx_ErrFetchInState(tstate, type, value, tb) PyErr_Fetch(type, value, tb)
1371 #define __Pyx_ErrRestore(type, value, tb) PyErr_Restore(type, value, tb)
1372 #define __Pyx_ErrFetch(type, value, tb) PyErr_Fetch(type, value, tb)
1376 static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause);
1379 #ifndef __PYX_HAVE_RT_ImportType_proto
1380 #define __PYX_HAVE_RT_ImportType_proto
1381 enum __Pyx_ImportType_CheckSize {
1382 __Pyx_ImportType_CheckSize_Error = 0,
1383 __Pyx_ImportType_CheckSize_Warn = 1,
1384 __Pyx_ImportType_CheckSize_Ignore = 2
1386 static PyTypeObject *__Pyx_ImportType(PyObject* module,
const char *module_name,
const char *class_name,
size_t size,
enum __Pyx_ImportType_CheckSize check_size);
1390 static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list,
int level);
1393 #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_TYPE_SLOTS
1394 #define __PYX_DICT_VERSION_INIT ((PY_UINT64_T) -1)
1395 #define __PYX_GET_DICT_VERSION(dict) (((PyDictObject*)(dict))->ma_version_tag)
1396 #define __PYX_UPDATE_DICT_CACHE(dict, value, cache_var, version_var)\
1397 (version_var) = __PYX_GET_DICT_VERSION(dict);\
1398 (cache_var) = (value);
1399 #define __PYX_PY_DICT_LOOKUP_IF_MODIFIED(VAR, DICT, LOOKUP) {\
1400 static PY_UINT64_T __pyx_dict_version = 0;\
1401 static PyObject *__pyx_dict_cached_value = NULL;\
1402 if (likely(__PYX_GET_DICT_VERSION(DICT) == __pyx_dict_version)) {\
1403 (VAR) = __pyx_dict_cached_value;\
1405 (VAR) = __pyx_dict_cached_value = (LOOKUP);\
1406 __pyx_dict_version = __PYX_GET_DICT_VERSION(DICT);\
1409 static CYTHON_INLINE PY_UINT64_T __Pyx_get_tp_dict_version(PyObject *obj);
1410 static CYTHON_INLINE PY_UINT64_T __Pyx_get_object_dict_version(PyObject *obj);
1411 static CYTHON_INLINE
int __Pyx_object_dict_version_matches(PyObject* obj, PY_UINT64_T tp_dict_version, PY_UINT64_T obj_dict_version);
1413 #define __PYX_GET_DICT_VERSION(dict) (0)
1414 #define __PYX_UPDATE_DICT_CACHE(dict, value, cache_var, version_var)
1415 #define __PYX_PY_DICT_LOOKUP_IF_MODIFIED(VAR, DICT, LOOKUP) (VAR) = (LOOKUP);
1419 #ifdef CYTHON_CLINE_IN_TRACEBACK
1420 #define __Pyx_CLineForTraceback(tstate, c_line) (((CYTHON_CLINE_IN_TRACEBACK)) ? c_line : 0)
1422 static int __Pyx_CLineForTraceback(PyThreadState *tstate,
int c_line);
1427 PyCodeObject* code_object;
1429 } __Pyx_CodeObjectCacheEntry;
1430 struct __Pyx_CodeObjectCache {
1433 __Pyx_CodeObjectCacheEntry* entries;
1435 static struct __Pyx_CodeObjectCache __pyx_code_cache = {0,0,NULL};
1436 static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries,
int count,
int code_line);
1437 static PyCodeObject *__pyx_find_code_object(
int code_line);
1438 static void __pyx_insert_code_object(
int code_line, PyCodeObject* code_object);
1441 static void __Pyx_AddTraceback(
const char *funcname,
int c_line,
1442 int py_line,
const char *filename);
1445 #if defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 6))
1446 #define __Pyx_HAS_GCC_DIAGNOSTIC
1452 #define __Pyx_CREAL(z) ((z).real())
1453 #define __Pyx_CIMAG(z) ((z).imag())
1455 #define __Pyx_CREAL(z) (__real__(z))
1456 #define __Pyx_CIMAG(z) (__imag__(z))
1459 #define __Pyx_CREAL(z) ((z).real)
1460 #define __Pyx_CIMAG(z) ((z).imag)
1462 #if defined(__cplusplus) && CYTHON_CCOMPLEX\
1463 && (defined(_WIN32) || defined(__clang__) || (defined(__GNUC__) && (__GNUC__ >= 5 || __GNUC__ == 4 && __GNUC_MINOR__ >= 4 )) || __cplusplus >= 201103)
1464 #define __Pyx_SET_CREAL(z,x) ((z).real(x))
1465 #define __Pyx_SET_CIMAG(z,y) ((z).imag(y))
1467 #define __Pyx_SET_CREAL(z,x) __Pyx_CREAL(z) = (x)
1468 #define __Pyx_SET_CIMAG(z,y) __Pyx_CIMAG(z) = (y)
1473 #define __Pyx_c_eq_float(a, b) ((a)==(b))
1474 #define __Pyx_c_sum_float(a, b) ((a)+(b))
1475 #define __Pyx_c_diff_float(a, b) ((a)-(b))
1476 #define __Pyx_c_prod_float(a, b) ((a)*(b))
1477 #define __Pyx_c_quot_float(a, b) ((a)/(b))
1478 #define __Pyx_c_neg_float(a) (-(a))
1480 #define __Pyx_c_is_zero_float(z) ((z)==(float)0)
1481 #define __Pyx_c_conj_float(z) (::std::conj(z))
1483 #define __Pyx_c_abs_float(z) (::std::abs(z))
1484 #define __Pyx_c_pow_float(a, b) (::std::pow(a, b))
1487 #define __Pyx_c_is_zero_float(z) ((z)==0)
1488 #define __Pyx_c_conj_float(z) (conjf(z))
1490 #define __Pyx_c_abs_float(z) (cabsf(z))
1491 #define __Pyx_c_pow_float(a, b) (cpowf(a, b))
1495 static CYTHON_INLINE
int __Pyx_c_eq_float(__pyx_t_float_complex, __pyx_t_float_complex);
1496 static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_sum_float(__pyx_t_float_complex, __pyx_t_float_complex);
1497 static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_diff_float(__pyx_t_float_complex, __pyx_t_float_complex);
1498 static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_prod_float(__pyx_t_float_complex, __pyx_t_float_complex);
1499 static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_quot_float(__pyx_t_float_complex, __pyx_t_float_complex);
1500 static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_neg_float(__pyx_t_float_complex);
1501 static CYTHON_INLINE
int __Pyx_c_is_zero_float(__pyx_t_float_complex);
1502 static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_conj_float(__pyx_t_float_complex);
1504 static CYTHON_INLINE
float __Pyx_c_abs_float(__pyx_t_float_complex);
1505 static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_pow_float(__pyx_t_float_complex, __pyx_t_float_complex);
1511 #define __Pyx_c_eq_double(a, b) ((a)==(b))
1512 #define __Pyx_c_sum_double(a, b) ((a)+(b))
1513 #define __Pyx_c_diff_double(a, b) ((a)-(b))
1514 #define __Pyx_c_prod_double(a, b) ((a)*(b))
1515 #define __Pyx_c_quot_double(a, b) ((a)/(b))
1516 #define __Pyx_c_neg_double(a) (-(a))
1518 #define __Pyx_c_is_zero_double(z) ((z)==(double)0)
1519 #define __Pyx_c_conj_double(z) (::std::conj(z))
1521 #define __Pyx_c_abs_double(z) (::std::abs(z))
1522 #define __Pyx_c_pow_double(a, b) (::std::pow(a, b))
1525 #define __Pyx_c_is_zero_double(z) ((z)==0)
1526 #define __Pyx_c_conj_double(z) (conj(z))
1528 #define __Pyx_c_abs_double(z) (cabs(z))
1529 #define __Pyx_c_pow_double(a, b) (cpow(a, b))
1533 static CYTHON_INLINE
int __Pyx_c_eq_double(__pyx_t_double_complex, __pyx_t_double_complex);
1534 static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_sum_double(__pyx_t_double_complex, __pyx_t_double_complex);
1535 static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_diff_double(__pyx_t_double_complex, __pyx_t_double_complex);
1536 static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_prod_double(__pyx_t_double_complex, __pyx_t_double_complex);
1537 static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_quot_double(__pyx_t_double_complex, __pyx_t_double_complex);
1538 static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_neg_double(__pyx_t_double_complex);
1539 static CYTHON_INLINE
int __Pyx_c_is_zero_double(__pyx_t_double_complex);
1540 static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_conj_double(__pyx_t_double_complex);
1542 static CYTHON_INLINE
double __Pyx_c_abs_double(__pyx_t_double_complex);
1543 static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_pow_double(__pyx_t_double_complex, __pyx_t_double_complex);
1548 static CYTHON_INLINE
int __Pyx_PyInt_As_int(PyObject *);
1551 static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(
int value);
1554 static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(
long value);
1557 static CYTHON_INLINE
long __Pyx_PyInt_As_long(PyObject *);
1560 #if CYTHON_COMPILING_IN_CPYTHON
1561 #define __Pyx_TypeCheck(obj, type) __Pyx_IsSubtype(Py_TYPE(obj), (PyTypeObject *)type)
1562 static CYTHON_INLINE
int __Pyx_IsSubtype(PyTypeObject *a, PyTypeObject *b);
1563 static CYTHON_INLINE
int __Pyx_PyErr_GivenExceptionMatches(PyObject *err, PyObject *type);
1564 static CYTHON_INLINE
int __Pyx_PyErr_GivenExceptionMatches2(PyObject *err, PyObject *type1, PyObject *type2);
1566 #define __Pyx_TypeCheck(obj, type) PyObject_TypeCheck(obj, (PyTypeObject *)type)
1567 #define __Pyx_PyErr_GivenExceptionMatches(err, type) PyErr_GivenExceptionMatches(err, type)
1568 #define __Pyx_PyErr_GivenExceptionMatches2(err, type1, type2) (PyErr_GivenExceptionMatches(err, type1) || PyErr_GivenExceptionMatches(err, type2))
1570 #define __Pyx_PyException_Check(obj) __Pyx_TypeCheck(obj, PyExc_Exception)
1573 static int __Pyx_check_binary_version(
void);
1576 static int __Pyx_InitStrings(__Pyx_StringTabEntry *t);
1588 static PyTypeObject *__pyx_ptype_7cpython_4type_type = 0;
1601 static PyTypeObject *__pyx_ptype_5numpy_dtype = 0;
1602 static PyTypeObject *__pyx_ptype_5numpy_flatiter = 0;
1603 static PyTypeObject *__pyx_ptype_5numpy_broadcast = 0;
1604 static PyTypeObject *__pyx_ptype_5numpy_ndarray = 0;
1605 static PyTypeObject *__pyx_ptype_5numpy_generic = 0;
1606 static PyTypeObject *__pyx_ptype_5numpy_number = 0;
1607 static PyTypeObject *__pyx_ptype_5numpy_integer = 0;
1608 static PyTypeObject *__pyx_ptype_5numpy_signedinteger = 0;
1609 static PyTypeObject *__pyx_ptype_5numpy_unsignedinteger = 0;
1610 static PyTypeObject *__pyx_ptype_5numpy_inexact = 0;
1611 static PyTypeObject *__pyx_ptype_5numpy_floating = 0;
1612 static PyTypeObject *__pyx_ptype_5numpy_complexfloating = 0;
1613 static PyTypeObject *__pyx_ptype_5numpy_flexible = 0;
1614 static PyTypeObject *__pyx_ptype_5numpy_character = 0;
1615 static PyTypeObject *__pyx_ptype_5numpy_ufunc = 0;
1620 #define __Pyx_MODULE_NAME "cSubsurfaceTransportCoefficients"
1621 extern int __pyx_module_is_main_cSubsurfaceTransportCoefficients;
1622 int __pyx_module_is_main_cSubsurfaceTransportCoefficients = 0;
1625 static PyObject *__pyx_builtin_ImportError;
1626 static const char __pyx_k_b[] =
"b";
1627 static const char __pyx_k_g[] =
"g";
1628 static const char __pyx_k_n[] =
"n";
1629 static const char __pyx_k_x[] =
"x";
1630 static const char __pyx_k_y[] =
"y";
1631 static const char __pyx_k_dy[] =
"dy";
1632 static const char __pyx_k_np[] =
"np";
1633 static const char __pyx_k_xv[] =
"xv";
1634 static const char __pyx_k_yv[] =
"yv";
1635 static const char __pyx_k_mun[] =
"mun";
1636 static const char __pyx_k_muw[] =
"muw";
1637 static const char __pyx_k_q_u[] =
"q_u";
1638 static const char __pyx_k_Kbar[] =
"Kbar";
1639 static const char __pyx_k_bc_u[] =
"bc_u";
1640 static const char __pyx_k_flux[] =
"flux";
1641 static const char __pyx_k_main[] =
"__main__";
1642 static const char __pyx_k_name[] =
"__name__";
1643 static const char __pyx_k_q_dV[] =
"q_dV";
1644 static const char __pyx_k_test[] =
"__test__";
1645 static const char __pyx_k_numpy[] =
"numpy";
1646 static const char __pyx_k_omega[] =
"omega";
1647 static const char __pyx_k_start[] =
"start";
1648 static const char __pyx_k_colind[] =
"colind";
1649 static const char __pyx_k_failed[] =
"failed";
1650 static const char __pyx_k_import[] =
"__import__";
1651 static const char __pyx_k_nSpace[] =
"nSpace";
1652 static const char __pyx_k_rowptr[] =
"rowptr";
1653 static const char __pyx_k_nParams[] =
"nParams";
1654 static const char __pyx_k_rwork_psk[] =
"rwork_psk";
1655 static const char __pyx_k_ImportError[] =
"ImportError";
1656 static const char __pyx_k_pskModelFlag[] =
"pskModelFlag";
1657 static const char __pyx_k_q_lambda_bar[] =
"q_lambda_bar";
1658 static const char __pyx_k_safetyFactor[] =
"safetyFactor";
1659 static const char __pyx_k_ebq_global_qt[] =
"ebq_global_qt";
1660 static const char __pyx_k_isDOFBoundary[] =
"isDOFBoundary";
1661 static const char __pyx_k_materialTypes[] =
"materialTypes";
1662 static const char __pyx_k_rwork_psk_tol[] =
"rwork_psk_tol";
1663 static const char __pyx_k_rwork_density_n[] =
"rwork_density_n";
1664 static const char __pyx_k_rwork_density_w[] =
"rwork_density_w";
1665 static const char __pyx_k_nElements_global[] =
"nElements_global";
1666 static const char __pyx_k_cline_in_traceback[] =
"cline_in_traceback";
1667 static const char __pyx_k_elementBoundaryElements[] =
"elementBoundaryElements";
1668 static const char __pyx_k_exteriorElementBoundaries[] =
"exteriorElementBoundaries";
1669 static const char __pyx_k_interiorElementBoundaries[] =
"interiorElementBoundaries";
1670 static const char __pyx_k_nQuadraturePoints_element[] =
"nQuadraturePoints_element";
1671 static const char __pyx_k_nElementBoundaries_element[] =
"nElementBoundaries_element";
1672 static const char __pyx_k_piecewiseLinearTableLookup[] =
"piecewiseLinearTableLookup";
1673 static const char __pyx_k_numpy_core_multiarray_failed_to[] =
"numpy.core.multiarray failed to import";
1674 static const char __pyx_k_cSubsurfaceTransportCoefficients[] =
"cSubsurfaceTransportCoefficients";
1675 static const char __pyx_k_calculateRusanovFluxSaturationEq[] =
"calculateRusanovFluxSaturationEquationIncomp_PWC";
1676 static const char __pyx_k_elementBoundaryLocalElementBound[] =
"elementBoundaryLocalElementBoundaries";
1677 static const char __pyx_k_nExteriorElementBoundaries_globa[] =
"nExteriorElementBoundaries_global";
1678 static const char __pyx_k_nInteriorElementBoundaries_globa[] =
"nInteriorElementBoundaries_global";
1679 static const char __pyx_k_nQuadraturePoints_elementBoundar[] =
"nQuadraturePoints_elementBoundary";
1680 static const char __pyx_k_numpy_core_umath_failed_to_impor[] =
"numpy.core.umath failed to import";
1681 static const char __pyx_k_proteus_cSubsurfaceTransportCoef[] =
"proteus/cSubsurfaceTransportCoefficients.pyx";
1682 static PyObject *__pyx_n_s_ImportError;
1683 static PyObject *__pyx_n_s_Kbar;
1684 static PyObject *__pyx_n_s_b;
1685 static PyObject *__pyx_n_s_bc_u;
1686 static PyObject *__pyx_n_s_cSubsurfaceTransportCoefficients;
1687 static PyObject *__pyx_n_s_calculateRusanovFluxSaturationEq;
1688 static PyObject *__pyx_n_s_cline_in_traceback;
1689 static PyObject *__pyx_n_s_colind;
1690 static PyObject *__pyx_n_s_dy;
1691 static PyObject *__pyx_n_s_ebq_global_qt;
1692 static PyObject *__pyx_n_s_elementBoundaryElements;
1693 static PyObject *__pyx_n_s_elementBoundaryLocalElementBound;
1694 static PyObject *__pyx_n_s_exteriorElementBoundaries;
1695 static PyObject *__pyx_n_s_failed;
1696 static PyObject *__pyx_n_s_flux;
1697 static PyObject *__pyx_n_s_g;
1698 static PyObject *__pyx_n_s_import;
1699 static PyObject *__pyx_n_s_interiorElementBoundaries;
1700 static PyObject *__pyx_n_s_isDOFBoundary;
1701 static PyObject *__pyx_n_s_main;
1702 static PyObject *__pyx_n_s_materialTypes;
1703 static PyObject *__pyx_n_s_mun;
1704 static PyObject *__pyx_n_s_muw;
1705 static PyObject *__pyx_n_s_n;
1706 static PyObject *__pyx_n_s_nElementBoundaries_element;
1707 static PyObject *__pyx_n_s_nElements_global;
1708 static PyObject *__pyx_n_s_nExteriorElementBoundaries_globa;
1709 static PyObject *__pyx_n_s_nInteriorElementBoundaries_globa;
1710 static PyObject *__pyx_n_s_nParams;
1711 static PyObject *__pyx_n_s_nQuadraturePoints_element;
1712 static PyObject *__pyx_n_s_nQuadraturePoints_elementBoundar;
1713 static PyObject *__pyx_n_s_nSpace;
1714 static PyObject *__pyx_n_s_name;
1715 static PyObject *__pyx_n_s_np;
1716 static PyObject *__pyx_n_s_numpy;
1717 static PyObject *__pyx_kp_s_numpy_core_multiarray_failed_to;
1718 static PyObject *__pyx_kp_s_numpy_core_umath_failed_to_impor;
1719 static PyObject *__pyx_n_s_omega;
1720 static PyObject *__pyx_n_s_piecewiseLinearTableLookup;
1721 static PyObject *__pyx_kp_s_proteus_cSubsurfaceTransportCoef;
1722 static PyObject *__pyx_n_s_pskModelFlag;
1723 static PyObject *__pyx_n_s_q_dV;
1724 static PyObject *__pyx_n_s_q_lambda_bar;
1725 static PyObject *__pyx_n_s_q_u;
1726 static PyObject *__pyx_n_s_rowptr;
1727 static PyObject *__pyx_n_s_rwork_density_n;
1728 static PyObject *__pyx_n_s_rwork_density_w;
1729 static PyObject *__pyx_n_s_rwork_psk;
1730 static PyObject *__pyx_n_s_rwork_psk_tol;
1731 static PyObject *__pyx_n_s_safetyFactor;
1732 static PyObject *__pyx_n_s_start;
1733 static PyObject *__pyx_n_s_test;
1734 static PyObject *__pyx_n_s_x;
1735 static PyObject *__pyx_n_s_xv;
1736 static PyObject *__pyx_n_s_y;
1737 static PyObject *__pyx_n_s_yv;
1738 static PyObject *__pyx_pf_32cSubsurfaceTransportCoefficients_calculateRusanovFluxSaturationEquationIncomp_PWC(CYTHON_UNUSED PyObject *__pyx_self,
double __pyx_v_safetyFactor,
int __pyx_v_nSpace,
int __pyx_v_pskModelFlag,
int __pyx_v_nParams, PyArrayObject *__pyx_v_rowptr, PyArrayObject *__pyx_v_colind, PyArrayObject *__pyx_v_materialTypes,
double __pyx_v_muw,
double __pyx_v_mun, PyArrayObject *__pyx_v_omega, PyArrayObject *__pyx_v_Kbar,
double __pyx_v_b, PyArrayObject *__pyx_v_rwork_psk, PyArrayObject *__pyx_v_rwork_psk_tol, PyArrayObject *__pyx_v_rwork_density_w, PyArrayObject *__pyx_v_rwork_density_n, PyArrayObject *__pyx_v_g, PyArrayObject *__pyx_v_ebq_global_qt, PyArrayObject *__pyx_v_q_lambda_bar,
int __pyx_v_nElements_global,
int __pyx_v_nElementBoundaries_element,
int __pyx_v_nInteriorElementBoundaries_global,
int __pyx_v_nExteriorElementBoundaries_global,
int __pyx_v_nQuadraturePoints_element,
int __pyx_v_nQuadraturePoints_elementBoundary, PyArrayObject *__pyx_v_interiorElementBoundaries, PyArrayObject *__pyx_v_exteriorElementBoundaries, PyArrayObject *__pyx_v_elementBoundaryElements, PyArrayObject *__pyx_v_elementBoundaryLocalElementBoundaries, PyArrayObject *__pyx_v_n, PyArrayObject *__pyx_v_q_u, PyArrayObject *__pyx_v_q_dV, PyArrayObject *__pyx_v_isDOFBoundary, PyArrayObject *__pyx_v_bc_u, PyArrayObject *__pyx_v_flux);
1739 static PyObject *__pyx_pf_32cSubsurfaceTransportCoefficients_2piecewiseLinearTableLookup(CYTHON_UNUSED PyObject *__pyx_self,
double __pyx_v_x, PyArrayObject *__pyx_v_xv, PyArrayObject *__pyx_v_yv,
int __pyx_v_start);
1740 static PyObject *__pyx_tuple_;
1741 static PyObject *__pyx_tuple__2;
1742 static PyObject *__pyx_tuple__3;
1743 static PyObject *__pyx_tuple__5;
1744 static PyObject *__pyx_codeobj__4;
1745 static PyObject *__pyx_codeobj__6;
1757 static PyObject *__pyx_pw_32cSubsurfaceTransportCoefficients_1calculateRusanovFluxSaturationEquationIncomp_PWC(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
1758 static PyMethodDef __pyx_mdef_32cSubsurfaceTransportCoefficients_1calculateRusanovFluxSaturationEquationIncomp_PWC = {
"calculateRusanovFluxSaturationEquationIncomp_PWC", (PyCFunction)(
void*)(PyCFunctionWithKeywords)__pyx_pw_32cSubsurfaceTransportCoefficients_1calculateRusanovFluxSaturationEquationIncomp_PWC, METH_VARARGS|METH_KEYWORDS, 0};
1759 static PyObject *__pyx_pw_32cSubsurfaceTransportCoefficients_1calculateRusanovFluxSaturationEquationIncomp_PWC(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
1760 double __pyx_v_safetyFactor;
1762 int __pyx_v_pskModelFlag;
1763 int __pyx_v_nParams;
1764 PyArrayObject *__pyx_v_rowptr = 0;
1765 PyArrayObject *__pyx_v_colind = 0;
1766 PyArrayObject *__pyx_v_materialTypes = 0;
1769 PyArrayObject *__pyx_v_omega = 0;
1770 PyArrayObject *__pyx_v_Kbar = 0;
1772 PyArrayObject *__pyx_v_rwork_psk = 0;
1773 PyArrayObject *__pyx_v_rwork_psk_tol = 0;
1774 PyArrayObject *__pyx_v_rwork_density_w = 0;
1775 PyArrayObject *__pyx_v_rwork_density_n = 0;
1776 PyArrayObject *__pyx_v_g = 0;
1777 PyArrayObject *__pyx_v_ebq_global_qt = 0;
1778 PyArrayObject *__pyx_v_q_lambda_bar = 0;
1779 int __pyx_v_nElements_global;
1780 int __pyx_v_nElementBoundaries_element;
1781 int __pyx_v_nInteriorElementBoundaries_global;
1782 int __pyx_v_nExteriorElementBoundaries_global;
1783 int __pyx_v_nQuadraturePoints_element;
1784 int __pyx_v_nQuadraturePoints_elementBoundary;
1785 PyArrayObject *__pyx_v_interiorElementBoundaries = 0;
1786 PyArrayObject *__pyx_v_exteriorElementBoundaries = 0;
1787 PyArrayObject *__pyx_v_elementBoundaryElements = 0;
1788 PyArrayObject *__pyx_v_elementBoundaryLocalElementBoundaries = 0;
1789 PyArrayObject *__pyx_v_n = 0;
1790 PyArrayObject *__pyx_v_q_u = 0;
1791 PyArrayObject *__pyx_v_q_dV = 0;
1792 PyArrayObject *__pyx_v_isDOFBoundary = 0;
1793 PyArrayObject *__pyx_v_bc_u = 0;
1794 PyArrayObject *__pyx_v_flux = 0;
1795 int __pyx_lineno = 0;
1796 const char *__pyx_filename = NULL;
1797 int __pyx_clineno = 0;
1798 PyObject *__pyx_r = 0;
1799 __Pyx_RefNannyDeclarations
1800 __Pyx_RefNannySetupContext(
"calculateRusanovFluxSaturationEquationIncomp_PWC (wrapper)", 0);
1802 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_safetyFactor,&__pyx_n_s_nSpace,&__pyx_n_s_pskModelFlag,&__pyx_n_s_nParams,&__pyx_n_s_rowptr,&__pyx_n_s_colind,&__pyx_n_s_materialTypes,&__pyx_n_s_muw,&__pyx_n_s_mun,&__pyx_n_s_omega,&__pyx_n_s_Kbar,&__pyx_n_s_b,&__pyx_n_s_rwork_psk,&__pyx_n_s_rwork_psk_tol,&__pyx_n_s_rwork_density_w,&__pyx_n_s_rwork_density_n,&__pyx_n_s_g,&__pyx_n_s_ebq_global_qt,&__pyx_n_s_q_lambda_bar,&__pyx_n_s_nElements_global,&__pyx_n_s_nElementBoundaries_element,&__pyx_n_s_nInteriorElementBoundaries_globa,&__pyx_n_s_nExteriorElementBoundaries_globa,&__pyx_n_s_nQuadraturePoints_element,&__pyx_n_s_nQuadraturePoints_elementBoundar,&__pyx_n_s_interiorElementBoundaries,&__pyx_n_s_exteriorElementBoundaries,&__pyx_n_s_elementBoundaryElements,&__pyx_n_s_elementBoundaryLocalElementBound,&__pyx_n_s_n,&__pyx_n_s_q_u,&__pyx_n_s_q_dV,&__pyx_n_s_isDOFBoundary,&__pyx_n_s_bc_u,&__pyx_n_s_flux,0};
1803 PyObject* values[35] = {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0};
1804 if (unlikely(__pyx_kwds)) {
1806 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
1808 case 35: values[34] = PyTuple_GET_ITEM(__pyx_args, 34);
1810 case 34: values[33] = PyTuple_GET_ITEM(__pyx_args, 33);
1812 case 33: values[32] = PyTuple_GET_ITEM(__pyx_args, 32);
1814 case 32: values[31] = PyTuple_GET_ITEM(__pyx_args, 31);
1816 case 31: values[30] = PyTuple_GET_ITEM(__pyx_args, 30);
1818 case 30: values[29] = PyTuple_GET_ITEM(__pyx_args, 29);
1820 case 29: values[28] = PyTuple_GET_ITEM(__pyx_args, 28);
1822 case 28: values[27] = PyTuple_GET_ITEM(__pyx_args, 27);
1824 case 27: values[26] = PyTuple_GET_ITEM(__pyx_args, 26);
1826 case 26: values[25] = PyTuple_GET_ITEM(__pyx_args, 25);
1828 case 25: values[24] = PyTuple_GET_ITEM(__pyx_args, 24);
1830 case 24: values[23] = PyTuple_GET_ITEM(__pyx_args, 23);
1832 case 23: values[22] = PyTuple_GET_ITEM(__pyx_args, 22);
1834 case 22: values[21] = PyTuple_GET_ITEM(__pyx_args, 21);
1836 case 21: values[20] = PyTuple_GET_ITEM(__pyx_args, 20);
1838 case 20: values[19] = PyTuple_GET_ITEM(__pyx_args, 19);
1840 case 19: values[18] = PyTuple_GET_ITEM(__pyx_args, 18);
1842 case 18: values[17] = PyTuple_GET_ITEM(__pyx_args, 17);
1844 case 17: values[16] = PyTuple_GET_ITEM(__pyx_args, 16);
1846 case 16: values[15] = PyTuple_GET_ITEM(__pyx_args, 15);
1848 case 15: values[14] = PyTuple_GET_ITEM(__pyx_args, 14);
1850 case 14: values[13] = PyTuple_GET_ITEM(__pyx_args, 13);
1852 case 13: values[12] = PyTuple_GET_ITEM(__pyx_args, 12);
1854 case 12: values[11] = PyTuple_GET_ITEM(__pyx_args, 11);
1856 case 11: values[10] = PyTuple_GET_ITEM(__pyx_args, 10);
1858 case 10: values[9] = PyTuple_GET_ITEM(__pyx_args, 9);
1860 case 9: values[8] = PyTuple_GET_ITEM(__pyx_args, 8);
1862 case 8: values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
1864 case 7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
1866 case 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
1868 case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
1870 case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
1872 case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
1874 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
1876 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
1879 default:
goto __pyx_L5_argtuple_error;
1881 kw_args = PyDict_Size(__pyx_kwds);
1884 if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_safetyFactor)) != 0)) kw_args--;
1885 else goto __pyx_L5_argtuple_error;
1888 if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_nSpace)) != 0)) kw_args--;
1890 __Pyx_RaiseArgtupleInvalid(
"calculateRusanovFluxSaturationEquationIncomp_PWC", 1, 35, 35, 1); __PYX_ERR(0, 6, __pyx_L3_error)
1894 if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pskModelFlag)) != 0)) kw_args--;
1896 __Pyx_RaiseArgtupleInvalid(
"calculateRusanovFluxSaturationEquationIncomp_PWC", 1, 35, 35, 2); __PYX_ERR(0, 6, __pyx_L3_error)
1900 if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_nParams)) != 0)) kw_args--;
1902 __Pyx_RaiseArgtupleInvalid(
"calculateRusanovFluxSaturationEquationIncomp_PWC", 1, 35, 35, 3); __PYX_ERR(0, 6, __pyx_L3_error)
1906 if (likely((values[4] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_rowptr)) != 0)) kw_args--;
1908 __Pyx_RaiseArgtupleInvalid(
"calculateRusanovFluxSaturationEquationIncomp_PWC", 1, 35, 35, 4); __PYX_ERR(0, 6, __pyx_L3_error)
1912 if (likely((values[5] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_colind)) != 0)) kw_args--;
1914 __Pyx_RaiseArgtupleInvalid(
"calculateRusanovFluxSaturationEquationIncomp_PWC", 1, 35, 35, 5); __PYX_ERR(0, 6, __pyx_L3_error)
1918 if (likely((values[6] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_materialTypes)) != 0)) kw_args--;
1920 __Pyx_RaiseArgtupleInvalid(
"calculateRusanovFluxSaturationEquationIncomp_PWC", 1, 35, 35, 6); __PYX_ERR(0, 6, __pyx_L3_error)
1924 if (likely((values[7] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_muw)) != 0)) kw_args--;
1926 __Pyx_RaiseArgtupleInvalid(
"calculateRusanovFluxSaturationEquationIncomp_PWC", 1, 35, 35, 7); __PYX_ERR(0, 6, __pyx_L3_error)
1930 if (likely((values[8] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_mun)) != 0)) kw_args--;
1932 __Pyx_RaiseArgtupleInvalid(
"calculateRusanovFluxSaturationEquationIncomp_PWC", 1, 35, 35, 8); __PYX_ERR(0, 6, __pyx_L3_error)
1936 if (likely((values[9] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_omega)) != 0)) kw_args--;
1938 __Pyx_RaiseArgtupleInvalid(
"calculateRusanovFluxSaturationEquationIncomp_PWC", 1, 35, 35, 9); __PYX_ERR(0, 6, __pyx_L3_error)
1942 if (likely((values[10] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_Kbar)) != 0)) kw_args--;
1944 __Pyx_RaiseArgtupleInvalid(
"calculateRusanovFluxSaturationEquationIncomp_PWC", 1, 35, 35, 10); __PYX_ERR(0, 6, __pyx_L3_error)
1948 if (likely((values[11] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_b)) != 0)) kw_args--;
1950 __Pyx_RaiseArgtupleInvalid(
"calculateRusanovFluxSaturationEquationIncomp_PWC", 1, 35, 35, 11); __PYX_ERR(0, 6, __pyx_L3_error)
1954 if (likely((values[12] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_rwork_psk)) != 0)) kw_args--;
1956 __Pyx_RaiseArgtupleInvalid(
"calculateRusanovFluxSaturationEquationIncomp_PWC", 1, 35, 35, 12); __PYX_ERR(0, 6, __pyx_L3_error)
1960 if (likely((values[13] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_rwork_psk_tol)) != 0)) kw_args--;
1962 __Pyx_RaiseArgtupleInvalid(
"calculateRusanovFluxSaturationEquationIncomp_PWC", 1, 35, 35, 13); __PYX_ERR(0, 6, __pyx_L3_error)
1966 if (likely((values[14] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_rwork_density_w)) != 0)) kw_args--;
1968 __Pyx_RaiseArgtupleInvalid(
"calculateRusanovFluxSaturationEquationIncomp_PWC", 1, 35, 35, 14); __PYX_ERR(0, 6, __pyx_L3_error)
1972 if (likely((values[15] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_rwork_density_n)) != 0)) kw_args--;
1974 __Pyx_RaiseArgtupleInvalid(
"calculateRusanovFluxSaturationEquationIncomp_PWC", 1, 35, 35, 15); __PYX_ERR(0, 6, __pyx_L3_error)
1978 if (likely((values[16] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_g)) != 0)) kw_args--;
1980 __Pyx_RaiseArgtupleInvalid(
"calculateRusanovFluxSaturationEquationIncomp_PWC", 1, 35, 35, 16); __PYX_ERR(0, 6, __pyx_L3_error)
1984 if (likely((values[17] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_ebq_global_qt)) != 0)) kw_args--;
1986 __Pyx_RaiseArgtupleInvalid(
"calculateRusanovFluxSaturationEquationIncomp_PWC", 1, 35, 35, 17); __PYX_ERR(0, 6, __pyx_L3_error)
1990 if (likely((values[18] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_q_lambda_bar)) != 0)) kw_args--;
1992 __Pyx_RaiseArgtupleInvalid(
"calculateRusanovFluxSaturationEquationIncomp_PWC", 1, 35, 35, 18); __PYX_ERR(0, 6, __pyx_L3_error)
1996 if (likely((values[19] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_nElements_global)) != 0)) kw_args--;
1998 __Pyx_RaiseArgtupleInvalid(
"calculateRusanovFluxSaturationEquationIncomp_PWC", 1, 35, 35, 19); __PYX_ERR(0, 6, __pyx_L3_error)
2002 if (likely((values[20] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_nElementBoundaries_element)) != 0)) kw_args--;
2004 __Pyx_RaiseArgtupleInvalid(
"calculateRusanovFluxSaturationEquationIncomp_PWC", 1, 35, 35, 20); __PYX_ERR(0, 6, __pyx_L3_error)
2008 if (likely((values[21] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_nInteriorElementBoundaries_globa)) != 0)) kw_args--;
2010 __Pyx_RaiseArgtupleInvalid(
"calculateRusanovFluxSaturationEquationIncomp_PWC", 1, 35, 35, 21); __PYX_ERR(0, 6, __pyx_L3_error)
2014 if (likely((values[22] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_nExteriorElementBoundaries_globa)) != 0)) kw_args--;
2016 __Pyx_RaiseArgtupleInvalid(
"calculateRusanovFluxSaturationEquationIncomp_PWC", 1, 35, 35, 22); __PYX_ERR(0, 6, __pyx_L3_error)
2020 if (likely((values[23] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_nQuadraturePoints_element)) != 0)) kw_args--;
2022 __Pyx_RaiseArgtupleInvalid(
"calculateRusanovFluxSaturationEquationIncomp_PWC", 1, 35, 35, 23); __PYX_ERR(0, 6, __pyx_L3_error)
2026 if (likely((values[24] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_nQuadraturePoints_elementBoundar)) != 0)) kw_args--;
2028 __Pyx_RaiseArgtupleInvalid(
"calculateRusanovFluxSaturationEquationIncomp_PWC", 1, 35, 35, 24); __PYX_ERR(0, 6, __pyx_L3_error)
2032 if (likely((values[25] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_interiorElementBoundaries)) != 0)) kw_args--;
2034 __Pyx_RaiseArgtupleInvalid(
"calculateRusanovFluxSaturationEquationIncomp_PWC", 1, 35, 35, 25); __PYX_ERR(0, 6, __pyx_L3_error)
2038 if (likely((values[26] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_exteriorElementBoundaries)) != 0)) kw_args--;
2040 __Pyx_RaiseArgtupleInvalid(
"calculateRusanovFluxSaturationEquationIncomp_PWC", 1, 35, 35, 26); __PYX_ERR(0, 6, __pyx_L3_error)
2044 if (likely((values[27] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_elementBoundaryElements)) != 0)) kw_args--;
2046 __Pyx_RaiseArgtupleInvalid(
"calculateRusanovFluxSaturationEquationIncomp_PWC", 1, 35, 35, 27); __PYX_ERR(0, 6, __pyx_L3_error)
2050 if (likely((values[28] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_elementBoundaryLocalElementBound)) != 0)) kw_args--;
2052 __Pyx_RaiseArgtupleInvalid(
"calculateRusanovFluxSaturationEquationIncomp_PWC", 1, 35, 35, 28); __PYX_ERR(0, 6, __pyx_L3_error)
2056 if (likely((values[29] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_n)) != 0)) kw_args--;
2058 __Pyx_RaiseArgtupleInvalid(
"calculateRusanovFluxSaturationEquationIncomp_PWC", 1, 35, 35, 29); __PYX_ERR(0, 6, __pyx_L3_error)
2062 if (likely((values[30] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_q_u)) != 0)) kw_args--;
2064 __Pyx_RaiseArgtupleInvalid(
"calculateRusanovFluxSaturationEquationIncomp_PWC", 1, 35, 35, 30); __PYX_ERR(0, 6, __pyx_L3_error)
2068 if (likely((values[31] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_q_dV)) != 0)) kw_args--;
2070 __Pyx_RaiseArgtupleInvalid(
"calculateRusanovFluxSaturationEquationIncomp_PWC", 1, 35, 35, 31); __PYX_ERR(0, 6, __pyx_L3_error)
2074 if (likely((values[32] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_isDOFBoundary)) != 0)) kw_args--;
2076 __Pyx_RaiseArgtupleInvalid(
"calculateRusanovFluxSaturationEquationIncomp_PWC", 1, 35, 35, 32); __PYX_ERR(0, 6, __pyx_L3_error)
2080 if (likely((values[33] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_bc_u)) != 0)) kw_args--;
2082 __Pyx_RaiseArgtupleInvalid(
"calculateRusanovFluxSaturationEquationIncomp_PWC", 1, 35, 35, 33); __PYX_ERR(0, 6, __pyx_L3_error)
2086 if (likely((values[34] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_flux)) != 0)) kw_args--;
2088 __Pyx_RaiseArgtupleInvalid(
"calculateRusanovFluxSaturationEquationIncomp_PWC", 1, 35, 35, 34); __PYX_ERR(0, 6, __pyx_L3_error)
2091 if (unlikely(kw_args > 0)) {
2092 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args,
"calculateRusanovFluxSaturationEquationIncomp_PWC") < 0)) __PYX_ERR(0, 6, __pyx_L3_error)
2094 }
else if (PyTuple_GET_SIZE(__pyx_args) != 35) {
2095 goto __pyx_L5_argtuple_error;
2097 values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
2098 values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
2099 values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
2100 values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
2101 values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
2102 values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
2103 values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
2104 values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
2105 values[8] = PyTuple_GET_ITEM(__pyx_args, 8);
2106 values[9] = PyTuple_GET_ITEM(__pyx_args, 9);
2107 values[10] = PyTuple_GET_ITEM(__pyx_args, 10);
2108 values[11] = PyTuple_GET_ITEM(__pyx_args, 11);
2109 values[12] = PyTuple_GET_ITEM(__pyx_args, 12);
2110 values[13] = PyTuple_GET_ITEM(__pyx_args, 13);
2111 values[14] = PyTuple_GET_ITEM(__pyx_args, 14);
2112 values[15] = PyTuple_GET_ITEM(__pyx_args, 15);
2113 values[16] = PyTuple_GET_ITEM(__pyx_args, 16);
2114 values[17] = PyTuple_GET_ITEM(__pyx_args, 17);
2115 values[18] = PyTuple_GET_ITEM(__pyx_args, 18);
2116 values[19] = PyTuple_GET_ITEM(__pyx_args, 19);
2117 values[20] = PyTuple_GET_ITEM(__pyx_args, 20);
2118 values[21] = PyTuple_GET_ITEM(__pyx_args, 21);
2119 values[22] = PyTuple_GET_ITEM(__pyx_args, 22);
2120 values[23] = PyTuple_GET_ITEM(__pyx_args, 23);
2121 values[24] = PyTuple_GET_ITEM(__pyx_args, 24);
2122 values[25] = PyTuple_GET_ITEM(__pyx_args, 25);
2123 values[26] = PyTuple_GET_ITEM(__pyx_args, 26);
2124 values[27] = PyTuple_GET_ITEM(__pyx_args, 27);
2125 values[28] = PyTuple_GET_ITEM(__pyx_args, 28);
2126 values[29] = PyTuple_GET_ITEM(__pyx_args, 29);
2127 values[30] = PyTuple_GET_ITEM(__pyx_args, 30);
2128 values[31] = PyTuple_GET_ITEM(__pyx_args, 31);
2129 values[32] = PyTuple_GET_ITEM(__pyx_args, 32);
2130 values[33] = PyTuple_GET_ITEM(__pyx_args, 33);
2131 values[34] = PyTuple_GET_ITEM(__pyx_args, 34);
2133 __pyx_v_safetyFactor = __pyx_PyFloat_AsDouble(values[0]);
if (unlikely((__pyx_v_safetyFactor == (
double)-1) && PyErr_Occurred())) __PYX_ERR(0, 7, __pyx_L3_error)
2134 __pyx_v_nSpace = __Pyx_PyInt_As_int(values[1]);
if (unlikely((__pyx_v_nSpace == (
int)-1) && PyErr_Occurred())) __PYX_ERR(0, 8, __pyx_L3_error)
2135 __pyx_v_pskModelFlag = __Pyx_PyInt_As_int(values[2]);
if (unlikely((__pyx_v_pskModelFlag == (
int)-1) && PyErr_Occurred())) __PYX_ERR(0, 9, __pyx_L3_error)
2136 __pyx_v_nParams = __Pyx_PyInt_As_int(values[3]);
if (unlikely((__pyx_v_nParams == (
int)-1) && PyErr_Occurred())) __PYX_ERR(0, 10, __pyx_L3_error)
2137 __pyx_v_rowptr = ((PyArrayObject *)values[4]);
2138 __pyx_v_colind = ((PyArrayObject *)values[5]);
2139 __pyx_v_materialTypes = ((PyArrayObject *)values[6]);
2140 __pyx_v_muw = __pyx_PyFloat_AsDouble(values[7]);
if (unlikely((__pyx_v_muw == (
double)-1) && PyErr_Occurred())) __PYX_ERR(0, 14, __pyx_L3_error)
2141 __pyx_v_mun = __pyx_PyFloat_AsDouble(values[8]);
if (unlikely((__pyx_v_mun == (
double)-1) && PyErr_Occurred())) __PYX_ERR(0, 15, __pyx_L3_error)
2142 __pyx_v_omega = ((PyArrayObject *)values[9]);
2143 __pyx_v_Kbar = ((PyArrayObject *)values[10]);
2144 __pyx_v_b = __pyx_PyFloat_AsDouble(values[11]);
if (unlikely((__pyx_v_b == (
double)-1) && PyErr_Occurred())) __PYX_ERR(0, 18, __pyx_L3_error)
2145 __pyx_v_rwork_psk = ((PyArrayObject *)values[12]);
2146 __pyx_v_rwork_psk_tol = ((PyArrayObject *)values[13]);
2147 __pyx_v_rwork_density_w = ((PyArrayObject *)values[14]);
2148 __pyx_v_rwork_density_n = ((PyArrayObject *)values[15]);
2149 __pyx_v_g = ((PyArrayObject *)values[16]);
2150 __pyx_v_ebq_global_qt = ((PyArrayObject *)values[17]);
2151 __pyx_v_q_lambda_bar = ((PyArrayObject *)values[18]);
2152 __pyx_v_nElements_global = __Pyx_PyInt_As_int(values[19]);
if (unlikely((__pyx_v_nElements_global == (
int)-1) && PyErr_Occurred())) __PYX_ERR(0, 26, __pyx_L3_error)
2153 __pyx_v_nElementBoundaries_element = __Pyx_PyInt_As_int(values[20]);
if (unlikely((__pyx_v_nElementBoundaries_element == (
int)-1) && PyErr_Occurred())) __PYX_ERR(0, 27, __pyx_L3_error)
2154 __pyx_v_nInteriorElementBoundaries_global = __Pyx_PyInt_As_int(values[21]);
if (unlikely((__pyx_v_nInteriorElementBoundaries_global == (
int)-1) && PyErr_Occurred())) __PYX_ERR(0, 28, __pyx_L3_error)
2155 __pyx_v_nExteriorElementBoundaries_global = __Pyx_PyInt_As_int(values[22]);
if (unlikely((__pyx_v_nExteriorElementBoundaries_global == (
int)-1) && PyErr_Occurred())) __PYX_ERR(0, 29, __pyx_L3_error)
2156 __pyx_v_nQuadraturePoints_element = __Pyx_PyInt_As_int(values[23]);
if (unlikely((__pyx_v_nQuadraturePoints_element == (
int)-1) && PyErr_Occurred())) __PYX_ERR(0, 30, __pyx_L3_error)
2157 __pyx_v_nQuadraturePoints_elementBoundary = __Pyx_PyInt_As_int(values[24]);
if (unlikely((__pyx_v_nQuadraturePoints_elementBoundary == (
int)-1) && PyErr_Occurred())) __PYX_ERR(0, 31, __pyx_L3_error)
2158 __pyx_v_interiorElementBoundaries = ((PyArrayObject *)values[25]);
2159 __pyx_v_exteriorElementBoundaries = ((PyArrayObject *)values[26]);
2160 __pyx_v_elementBoundaryElements = ((PyArrayObject *)values[27]);
2161 __pyx_v_elementBoundaryLocalElementBoundaries = ((PyArrayObject *)values[28]);
2162 __pyx_v_n = ((PyArrayObject *)values[29]);
2163 __pyx_v_q_u = ((PyArrayObject *)values[30]);
2164 __pyx_v_q_dV = ((PyArrayObject *)values[31]);
2165 __pyx_v_isDOFBoundary = ((PyArrayObject *)values[32]);
2166 __pyx_v_bc_u = ((PyArrayObject *)values[33]);
2167 __pyx_v_flux = ((PyArrayObject *)values[34]);
2169 goto __pyx_L4_argument_unpacking_done;
2170 __pyx_L5_argtuple_error:;
2171 __Pyx_RaiseArgtupleInvalid(
"calculateRusanovFluxSaturationEquationIncomp_PWC", 1, 35, 35, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 6, __pyx_L3_error)
2173 __Pyx_AddTraceback(
"cSubsurfaceTransportCoefficients.calculateRusanovFluxSaturationEquationIncomp_PWC", __pyx_clineno, __pyx_lineno, __pyx_filename);
2174 __Pyx_RefNannyFinishContext();
2176 __pyx_L4_argument_unpacking_done:;
2177 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_rowptr), __pyx_ptype_5numpy_ndarray, 1,
"rowptr", 0))) __PYX_ERR(0, 11, __pyx_L1_error)
2178 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_colind), __pyx_ptype_5numpy_ndarray, 1,
"colind", 0))) __PYX_ERR(0, 12, __pyx_L1_error)
2179 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_materialTypes), __pyx_ptype_5numpy_ndarray, 1,
"materialTypes", 0))) __PYX_ERR(0, 13, __pyx_L1_error)
2180 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_omega), __pyx_ptype_5numpy_ndarray, 1,
"omega", 0))) __PYX_ERR(0, 16, __pyx_L1_error)
2181 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_Kbar), __pyx_ptype_5numpy_ndarray, 1,
"Kbar", 0))) __PYX_ERR(0, 17, __pyx_L1_error)
2182 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_rwork_psk), __pyx_ptype_5numpy_ndarray, 1,
"rwork_psk", 0))) __PYX_ERR(0, 19, __pyx_L1_error)
2183 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_rwork_psk_tol), __pyx_ptype_5numpy_ndarray, 1,
"rwork_psk_tol", 0))) __PYX_ERR(0, 20, __pyx_L1_error)
2184 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_rwork_density_w), __pyx_ptype_5numpy_ndarray, 1,
"rwork_density_w", 0))) __PYX_ERR(0, 21, __pyx_L1_error)
2185 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_rwork_density_n), __pyx_ptype_5numpy_ndarray, 1,
"rwork_density_n", 0))) __PYX_ERR(0, 22, __pyx_L1_error)
2186 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_g), __pyx_ptype_5numpy_ndarray, 1,
"g", 0))) __PYX_ERR(0, 23, __pyx_L1_error)
2187 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_ebq_global_qt), __pyx_ptype_5numpy_ndarray, 1,
"ebq_global_qt", 0))) __PYX_ERR(0, 24, __pyx_L1_error)
2188 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_q_lambda_bar), __pyx_ptype_5numpy_ndarray, 1,
"q_lambda_bar", 0))) __PYX_ERR(0, 25, __pyx_L1_error)
2189 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_interiorElementBoundaries), __pyx_ptype_5numpy_ndarray, 1,
"interiorElementBoundaries", 0))) __PYX_ERR(0, 32, __pyx_L1_error)
2190 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_exteriorElementBoundaries), __pyx_ptype_5numpy_ndarray, 1,
"exteriorElementBoundaries", 0))) __PYX_ERR(0, 33, __pyx_L1_error)
2191 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_elementBoundaryElements), __pyx_ptype_5numpy_ndarray, 1,
"elementBoundaryElements", 0))) __PYX_ERR(0, 34, __pyx_L1_error)
2192 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_elementBoundaryLocalElementBoundaries), __pyx_ptype_5numpy_ndarray, 1,
"elementBoundaryLocalElementBoundaries", 0))) __PYX_ERR(0, 35, __pyx_L1_error)
2193 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_n), __pyx_ptype_5numpy_ndarray, 1,
"n", 0))) __PYX_ERR(0, 36, __pyx_L1_error)
2194 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_q_u), __pyx_ptype_5numpy_ndarray, 1,
"q_u", 0))) __PYX_ERR(0, 37, __pyx_L1_error)
2195 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_q_dV), __pyx_ptype_5numpy_ndarray, 1,
"q_dV", 0))) __PYX_ERR(0, 38, __pyx_L1_error)
2196 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_isDOFBoundary), __pyx_ptype_5numpy_ndarray, 1,
"isDOFBoundary", 0))) __PYX_ERR(0, 39, __pyx_L1_error)
2197 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_bc_u), __pyx_ptype_5numpy_ndarray, 1,
"bc_u", 0))) __PYX_ERR(0, 40, __pyx_L1_error)
2198 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_flux), __pyx_ptype_5numpy_ndarray, 1,
"flux", 0))) __PYX_ERR(0, 41, __pyx_L1_error)
2199 __pyx_r = __pyx_pf_32cSubsurfaceTransportCoefficients_calculateRusanovFluxSaturationEquationIncomp_PWC(__pyx_self, __pyx_v_safetyFactor, __pyx_v_nSpace, __pyx_v_pskModelFlag, __pyx_v_nParams, __pyx_v_rowptr, __pyx_v_colind, __pyx_v_materialTypes, __pyx_v_muw, __pyx_v_mun, __pyx_v_omega, __pyx_v_Kbar, __pyx_v_b, __pyx_v_rwork_psk, __pyx_v_rwork_psk_tol, __pyx_v_rwork_density_w, __pyx_v_rwork_density_n, __pyx_v_g, __pyx_v_ebq_global_qt, __pyx_v_q_lambda_bar, __pyx_v_nElements_global, __pyx_v_nElementBoundaries_element, __pyx_v_nInteriorElementBoundaries_global, __pyx_v_nExteriorElementBoundaries_global, __pyx_v_nQuadraturePoints_element, __pyx_v_nQuadraturePoints_elementBoundary, __pyx_v_interiorElementBoundaries, __pyx_v_exteriorElementBoundaries, __pyx_v_elementBoundaryElements, __pyx_v_elementBoundaryLocalElementBoundaries, __pyx_v_n, __pyx_v_q_u, __pyx_v_q_dV, __pyx_v_isDOFBoundary, __pyx_v_bc_u, __pyx_v_flux);
2206 __Pyx_RefNannyFinishContext();
2210 static PyObject *__pyx_pf_32cSubsurfaceTransportCoefficients_calculateRusanovFluxSaturationEquationIncomp_PWC(CYTHON_UNUSED PyObject *__pyx_self,
double __pyx_v_safetyFactor,
int __pyx_v_nSpace,
int __pyx_v_pskModelFlag,
int __pyx_v_nParams, PyArrayObject *__pyx_v_rowptr, PyArrayObject *__pyx_v_colind, PyArrayObject *__pyx_v_materialTypes,
double __pyx_v_muw,
double __pyx_v_mun, PyArrayObject *__pyx_v_omega, PyArrayObject *__pyx_v_Kbar,
double __pyx_v_b, PyArrayObject *__pyx_v_rwork_psk, PyArrayObject *__pyx_v_rwork_psk_tol, PyArrayObject *__pyx_v_rwork_density_w, PyArrayObject *__pyx_v_rwork_density_n, PyArrayObject *__pyx_v_g, PyArrayObject *__pyx_v_ebq_global_qt, PyArrayObject *__pyx_v_q_lambda_bar,
int __pyx_v_nElements_global,
int __pyx_v_nElementBoundaries_element,
int __pyx_v_nInteriorElementBoundaries_global,
int __pyx_v_nExteriorElementBoundaries_global,
int __pyx_v_nQuadraturePoints_element,
int __pyx_v_nQuadraturePoints_elementBoundary, PyArrayObject *__pyx_v_interiorElementBoundaries, PyArrayObject *__pyx_v_exteriorElementBoundaries, PyArrayObject *__pyx_v_elementBoundaryElements, PyArrayObject *__pyx_v_elementBoundaryLocalElementBoundaries, PyArrayObject *__pyx_v_n, PyArrayObject *__pyx_v_q_u, PyArrayObject *__pyx_v_q_dV, PyArrayObject *__pyx_v_isDOFBoundary, PyArrayObject *__pyx_v_bc_u, PyArrayObject *__pyx_v_flux) {
2212 PyObject *__pyx_r = NULL;
2213 __Pyx_RefNannyDeclarations
2214 int __pyx_lineno = 0;
2215 const char *__pyx_filename = NULL;
2216 int __pyx_clineno = 0;
2217 __Pyx_RefNannySetupContext(
"calculateRusanovFluxSaturationEquationIncomp_PWC", 0);
2226 __pyx_v_failed =
calculateRusanovFluxSaturationEquationIncomp_PWC(__pyx_v_safetyFactor, __pyx_v_nSpace, __pyx_v_pskModelFlag, __pyx_v_nParams, ((
int *)__pyx_v_rowptr->data), ((
int *)__pyx_v_colind->data), ((
int *)__pyx_v_materialTypes->data), __pyx_v_muw, __pyx_v_mun, ((
double *)__pyx_v_omega->data), ((
double *)__pyx_v_Kbar->data), __pyx_v_b, ((
double *)__pyx_v_rwork_psk->data), ((
double *)__pyx_v_rwork_psk_tol->data), ((
double *)__pyx_v_rwork_density_w->data), ((
double *)__pyx_v_rwork_density_n->data), ((
double *)__pyx_v_g->data), ((
double *)__pyx_v_ebq_global_qt->data), ((
double *)__pyx_v_q_lambda_bar->data), __pyx_v_nElements_global, __pyx_v_nElementBoundaries_element, __pyx_v_nInteriorElementBoundaries_global, __pyx_v_nExteriorElementBoundaries_global, __pyx_v_nQuadraturePoints_element, __pyx_v_nQuadraturePoints_elementBoundary, ((
int *)__pyx_v_interiorElementBoundaries->data), ((
int *)__pyx_v_exteriorElementBoundaries->data), ((
int *)__pyx_v_elementBoundaryElements->data), ((
int *)__pyx_v_elementBoundaryLocalElementBoundaries->data), ((
double *)__pyx_v_n->data), ((
double *)__pyx_v_q_u->data), ((
double *)__pyx_v_q_dV->data), ((
int *)__pyx_v_isDOFBoundary->data), ((
double *)__pyx_v_bc_u->data), ((
double *)__pyx_v_flux->data));
2235 #ifndef CYTHON_WITHOUT_ASSERTIONS
2236 if (unlikely(!Py_OptimizeFlag)) {
2237 if (unlikely(!((__pyx_v_failed == 0) != 0))) {
2238 PyErr_SetNone(PyExc_AssertionError);
2239 __PYX_ERR(0, 78, __pyx_L1_error)
2253 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
2256 __Pyx_AddTraceback(
"cSubsurfaceTransportCoefficients.calculateRusanovFluxSaturationEquationIncomp_PWC", __pyx_clineno, __pyx_lineno, __pyx_filename);
2259 __Pyx_XGIVEREF(__pyx_r);
2260 __Pyx_RefNannyFinishContext();
2273 static PyObject *__pyx_pw_32cSubsurfaceTransportCoefficients_3piecewiseLinearTableLookup(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
2274 static PyMethodDef __pyx_mdef_32cSubsurfaceTransportCoefficients_3piecewiseLinearTableLookup = {
"piecewiseLinearTableLookup", (PyCFunction)(
void*)(PyCFunctionWithKeywords)__pyx_pw_32cSubsurfaceTransportCoefficients_3piecewiseLinearTableLookup, METH_VARARGS|METH_KEYWORDS, 0};
2275 static PyObject *__pyx_pw_32cSubsurfaceTransportCoefficients_3piecewiseLinearTableLookup(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
2277 PyArrayObject *__pyx_v_xv = 0;
2278 PyArrayObject *__pyx_v_yv = 0;
2280 int __pyx_lineno = 0;
2281 const char *__pyx_filename = NULL;
2282 int __pyx_clineno = 0;
2283 PyObject *__pyx_r = 0;
2284 __Pyx_RefNannyDeclarations
2285 __Pyx_RefNannySetupContext(
"piecewiseLinearTableLookup (wrapper)", 0);
2287 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_x,&__pyx_n_s_xv,&__pyx_n_s_yv,&__pyx_n_s_start,0};
2288 PyObject* values[4] = {0,0,0,0};
2289 if (unlikely(__pyx_kwds)) {
2291 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
2293 case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
2295 case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
2297 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
2299 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
2302 default:
goto __pyx_L5_argtuple_error;
2304 kw_args = PyDict_Size(__pyx_kwds);
2307 if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_x)) != 0)) kw_args--;
2308 else goto __pyx_L5_argtuple_error;
2311 if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_xv)) != 0)) kw_args--;
2313 __Pyx_RaiseArgtupleInvalid(
"piecewiseLinearTableLookup", 0, 3, 4, 1); __PYX_ERR(0, 80, __pyx_L3_error)
2317 if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_yv)) != 0)) kw_args--;
2319 __Pyx_RaiseArgtupleInvalid(
"piecewiseLinearTableLookup", 0, 3, 4, 2); __PYX_ERR(0, 80, __pyx_L3_error)
2324 PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_start);
2325 if (value) { values[3] = value; kw_args--; }
2328 if (unlikely(kw_args > 0)) {
2329 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args,
"piecewiseLinearTableLookup") < 0)) __PYX_ERR(0, 80, __pyx_L3_error)
2332 switch (PyTuple_GET_SIZE(__pyx_args)) {
2333 case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
2335 case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
2336 values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
2337 values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
2339 default:
goto __pyx_L5_argtuple_error;
2342 __pyx_v_x = __pyx_PyFloat_AsDouble(values[0]);
if (unlikely((__pyx_v_x == (
double)-1) && PyErr_Occurred())) __PYX_ERR(0, 80, __pyx_L3_error)
2343 __pyx_v_xv = ((PyArrayObject *)values[1]);
2344 __pyx_v_yv = ((PyArrayObject *)values[2]);
2346 __pyx_v_start = __Pyx_PyInt_As_int(values[3]);
if (unlikely((__pyx_v_start == (
int)-1) && PyErr_Occurred())) __PYX_ERR(0, 83, __pyx_L3_error)
2348 __pyx_v_start = ((int)0);
2351 goto __pyx_L4_argument_unpacking_done;
2352 __pyx_L5_argtuple_error:;
2353 __Pyx_RaiseArgtupleInvalid(
"piecewiseLinearTableLookup", 0, 3, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 80, __pyx_L3_error)
2355 __Pyx_AddTraceback(
"cSubsurfaceTransportCoefficients.piecewiseLinearTableLookup", __pyx_clineno, __pyx_lineno, __pyx_filename);
2356 __Pyx_RefNannyFinishContext();
2358 __pyx_L4_argument_unpacking_done:;
2359 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_xv), __pyx_ptype_5numpy_ndarray, 1,
"xv", 0))) __PYX_ERR(0, 81, __pyx_L1_error)
2360 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_yv), __pyx_ptype_5numpy_ndarray, 1,
"yv", 0))) __PYX_ERR(0, 82, __pyx_L1_error)
2361 __pyx_r = __pyx_pf_32cSubsurfaceTransportCoefficients_2piecewiseLinearTableLookup(__pyx_self, __pyx_v_x, __pyx_v_xv, __pyx_v_yv, __pyx_v_start);
2368 __Pyx_RefNannyFinishContext();
2372 static PyObject *__pyx_pf_32cSubsurfaceTransportCoefficients_2piecewiseLinearTableLookup(CYTHON_UNUSED PyObject *__pyx_self,
double __pyx_v_x, PyArrayObject *__pyx_v_xv, PyArrayObject *__pyx_v_yv,
int __pyx_v_start) {
2375 PyObject *__pyx_r = NULL;
2376 __Pyx_RefNannyDeclarations
2377 PyObject *__pyx_t_1 = NULL;
2378 PyObject *__pyx_t_2 = NULL;
2379 PyObject *__pyx_t_3 = NULL;
2380 PyObject *__pyx_t_4 = NULL;
2381 int __pyx_lineno = 0;
2382 const char *__pyx_filename = NULL;
2383 int __pyx_clineno = 0;
2384 __Pyx_RefNannySetupContext(
"piecewiseLinearTableLookup", 0);
2411 piecewiseLinearTableLookup(__pyx_v_x, (__pyx_v_xv->dimensions[0]), (&__pyx_v_start), (&__pyx_v_y), (&__pyx_v_dy), ((
double *)__pyx_v_xv->data), ((
double *)__pyx_v_yv->data));
2418 __Pyx_XDECREF(__pyx_r);
2419 __pyx_t_1 = PyFloat_FromDouble(__pyx_v_y);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 93, __pyx_L1_error)
2420 __Pyx_GOTREF(__pyx_t_1);
2421 __pyx_t_2 = PyFloat_FromDouble(__pyx_v_dy);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 93, __pyx_L1_error)
2422 __Pyx_GOTREF(__pyx_t_2);
2423 __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_start);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 93, __pyx_L1_error)
2424 __Pyx_GOTREF(__pyx_t_3);
2425 __pyx_t_4 = PyTuple_New(3);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 93, __pyx_L1_error)
2426 __Pyx_GOTREF(__pyx_t_4);
2427 __Pyx_GIVEREF(__pyx_t_1);
2428 PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_1);
2429 __Pyx_GIVEREF(__pyx_t_2);
2430 PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_2);
2431 __Pyx_GIVEREF(__pyx_t_3);
2432 PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_t_3);
2436 __pyx_r = __pyx_t_4;
2450 __Pyx_XDECREF(__pyx_t_1);
2451 __Pyx_XDECREF(__pyx_t_2);
2452 __Pyx_XDECREF(__pyx_t_3);
2453 __Pyx_XDECREF(__pyx_t_4);
2454 __Pyx_AddTraceback(
"cSubsurfaceTransportCoefficients.piecewiseLinearTableLookup", __pyx_clineno, __pyx_lineno, __pyx_filename);
2457 __Pyx_XGIVEREF(__pyx_r);
2458 __Pyx_RefNannyFinishContext();
2470 static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew1(PyObject *__pyx_v_a) {
2471 PyObject *__pyx_r = NULL;
2472 __Pyx_RefNannyDeclarations
2473 PyObject *__pyx_t_1 = NULL;
2474 int __pyx_lineno = 0;
2475 const char *__pyx_filename = NULL;
2476 int __pyx_clineno = 0;
2477 __Pyx_RefNannySetupContext(
"PyArray_MultiIterNew1", 0);
2486 __Pyx_XDECREF(__pyx_r);
2487 __pyx_t_1 = PyArray_MultiIterNew(1, ((
void *)__pyx_v_a));
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 736, __pyx_L1_error)
2488 __Pyx_GOTREF(__pyx_t_1);
2489 __pyx_r = __pyx_t_1;
2503 __Pyx_XDECREF(__pyx_t_1);
2504 __Pyx_AddTraceback(
"numpy.PyArray_MultiIterNew1", __pyx_clineno, __pyx_lineno, __pyx_filename);
2507 __Pyx_XGIVEREF(__pyx_r);
2508 __Pyx_RefNannyFinishContext();
2520 static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew2(PyObject *__pyx_v_a, PyObject *__pyx_v_b) {
2521 PyObject *__pyx_r = NULL;
2522 __Pyx_RefNannyDeclarations
2523 PyObject *__pyx_t_1 = NULL;
2524 int __pyx_lineno = 0;
2525 const char *__pyx_filename = NULL;
2526 int __pyx_clineno = 0;
2527 __Pyx_RefNannySetupContext(
"PyArray_MultiIterNew2", 0);
2536 __Pyx_XDECREF(__pyx_r);
2537 __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)
2538 __Pyx_GOTREF(__pyx_t_1);
2539 __pyx_r = __pyx_t_1;
2553 __Pyx_XDECREF(__pyx_t_1);
2554 __Pyx_AddTraceback(
"numpy.PyArray_MultiIterNew2", __pyx_clineno, __pyx_lineno, __pyx_filename);
2557 __Pyx_XGIVEREF(__pyx_r);
2558 __Pyx_RefNannyFinishContext();
2570 static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew3(PyObject *__pyx_v_a, PyObject *__pyx_v_b, PyObject *__pyx_v_c) {
2571 PyObject *__pyx_r = NULL;
2572 __Pyx_RefNannyDeclarations
2573 PyObject *__pyx_t_1 = NULL;
2574 int __pyx_lineno = 0;
2575 const char *__pyx_filename = NULL;
2576 int __pyx_clineno = 0;
2577 __Pyx_RefNannySetupContext(
"PyArray_MultiIterNew3", 0);
2586 __Pyx_XDECREF(__pyx_r);
2587 __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)
2588 __Pyx_GOTREF(__pyx_t_1);
2589 __pyx_r = __pyx_t_1;
2603 __Pyx_XDECREF(__pyx_t_1);
2604 __Pyx_AddTraceback(
"numpy.PyArray_MultiIterNew3", __pyx_clineno, __pyx_lineno, __pyx_filename);
2607 __Pyx_XGIVEREF(__pyx_r);
2608 __Pyx_RefNannyFinishContext();
2620 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) {
2621 PyObject *__pyx_r = NULL;
2622 __Pyx_RefNannyDeclarations
2623 PyObject *__pyx_t_1 = NULL;
2624 int __pyx_lineno = 0;
2625 const char *__pyx_filename = NULL;
2626 int __pyx_clineno = 0;
2627 __Pyx_RefNannySetupContext(
"PyArray_MultiIterNew4", 0);
2636 __Pyx_XDECREF(__pyx_r);
2637 __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)
2638 __Pyx_GOTREF(__pyx_t_1);
2639 __pyx_r = __pyx_t_1;
2653 __Pyx_XDECREF(__pyx_t_1);
2654 __Pyx_AddTraceback(
"numpy.PyArray_MultiIterNew4", __pyx_clineno, __pyx_lineno, __pyx_filename);
2657 __Pyx_XGIVEREF(__pyx_r);
2658 __Pyx_RefNannyFinishContext();
2670 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) {
2671 PyObject *__pyx_r = NULL;
2672 __Pyx_RefNannyDeclarations
2673 PyObject *__pyx_t_1 = NULL;
2674 int __pyx_lineno = 0;
2675 const char *__pyx_filename = NULL;
2676 int __pyx_clineno = 0;
2677 __Pyx_RefNannySetupContext(
"PyArray_MultiIterNew5", 0);
2686 __Pyx_XDECREF(__pyx_r);
2687 __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)
2688 __Pyx_GOTREF(__pyx_t_1);
2689 __pyx_r = __pyx_t_1;
2703 __Pyx_XDECREF(__pyx_t_1);
2704 __Pyx_AddTraceback(
"numpy.PyArray_MultiIterNew5", __pyx_clineno, __pyx_lineno, __pyx_filename);
2707 __Pyx_XGIVEREF(__pyx_r);
2708 __Pyx_RefNannyFinishContext();
2720 static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyDataType_SHAPE(PyArray_Descr *__pyx_v_d) {
2721 PyObject *__pyx_r = NULL;
2722 __Pyx_RefNannyDeclarations
2724 __Pyx_RefNannySetupContext(
"PyDataType_SHAPE", 0);
2733 __pyx_t_1 = (PyDataType_HASSUBARRAY(__pyx_v_d) != 0);
2743 __Pyx_XDECREF(__pyx_r);
2744 __Pyx_INCREF(((PyObject*)__pyx_v_d->subarray->shape));
2745 __pyx_r = ((PyObject*)__pyx_v_d->subarray->shape);
2765 __Pyx_XDECREF(__pyx_r);
2766 __Pyx_INCREF(__pyx_empty_tuple);
2767 __pyx_r = __pyx_empty_tuple;
2781 __Pyx_XGIVEREF(__pyx_r);
2782 __Pyx_RefNannyFinishContext();
2794 static CYTHON_INLINE
void __pyx_f_5numpy_set_array_base(PyArrayObject *__pyx_v_arr, PyObject *__pyx_v_base) {
2795 __Pyx_RefNannyDeclarations
2796 __Pyx_RefNannySetupContext(
"set_array_base", 0);
2805 Py_INCREF(__pyx_v_base);
2814 (void)(PyArray_SetBaseObject(__pyx_v_arr, __pyx_v_base));
2825 __Pyx_RefNannyFinishContext();
2836 static CYTHON_INLINE PyObject *__pyx_f_5numpy_get_array_base(PyArrayObject *__pyx_v_arr) {
2837 PyObject *__pyx_v_base;
2838 PyObject *__pyx_r = NULL;
2839 __Pyx_RefNannyDeclarations
2841 __Pyx_RefNannySetupContext(
"get_array_base", 0);
2850 __pyx_v_base = PyArray_BASE(__pyx_v_arr);
2859 __pyx_t_1 = ((__pyx_v_base == NULL) != 0);
2869 __Pyx_XDECREF(__pyx_r);
2870 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
2889 __Pyx_XDECREF(__pyx_r);
2890 __Pyx_INCREF(((PyObject *)__pyx_v_base));
2891 __pyx_r = ((PyObject *)__pyx_v_base);
2904 __Pyx_XGIVEREF(__pyx_r);
2905 __Pyx_RefNannyFinishContext();
2917 static CYTHON_INLINE
int __pyx_f_5numpy_import_array(
void) {
2919 __Pyx_RefNannyDeclarations
2920 PyObject *__pyx_t_1 = NULL;
2921 PyObject *__pyx_t_2 = NULL;
2922 PyObject *__pyx_t_3 = NULL;
2924 PyObject *__pyx_t_5 = NULL;
2925 PyObject *__pyx_t_6 = NULL;
2926 PyObject *__pyx_t_7 = NULL;
2927 PyObject *__pyx_t_8 = NULL;
2928 int __pyx_lineno = 0;
2929 const char *__pyx_filename = NULL;
2930 int __pyx_clineno = 0;
2931 __Pyx_RefNannySetupContext(
"import_array", 0);
2941 __Pyx_PyThreadState_declare
2942 __Pyx_PyThreadState_assign
2943 __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
2944 __Pyx_XGOTREF(__pyx_t_1);
2945 __Pyx_XGOTREF(__pyx_t_2);
2946 __Pyx_XGOTREF(__pyx_t_3);
2956 __pyx_t_4 = _import_array();
if (unlikely(__pyx_t_4 == ((
int)-1))) __PYX_ERR(1, 943, __pyx_L3_error)
2966 __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
2967 __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
2968 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
2969 goto __pyx_L8_try_end;
2979 __pyx_t_4 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0])));
2981 __Pyx_AddTraceback(
"numpy.import_array", __pyx_clineno, __pyx_lineno, __pyx_filename);
2982 if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(1, 944, __pyx_L5_except_error)
2983 __Pyx_GOTREF(__pyx_t_5);
2984 __Pyx_GOTREF(__pyx_t_6);
2985 __Pyx_GOTREF(__pyx_t_7);
2994 __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)
2995 __Pyx_GOTREF(__pyx_t_8);
2996 __Pyx_Raise(__pyx_t_8, 0, 0, 0);
2997 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
2998 __PYX_ERR(1, 945, __pyx_L5_except_error)
3000 goto __pyx_L5_except_error;
3001 __pyx_L5_except_error:;
3010 __Pyx_XGIVEREF(__pyx_t_1);
3011 __Pyx_XGIVEREF(__pyx_t_2);
3012 __Pyx_XGIVEREF(__pyx_t_3);
3013 __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
3014 goto __pyx_L1_error;
3030 __Pyx_XDECREF(__pyx_t_5);
3031 __Pyx_XDECREF(__pyx_t_6);
3032 __Pyx_XDECREF(__pyx_t_7);
3033 __Pyx_XDECREF(__pyx_t_8);
3034 __Pyx_AddTraceback(
"numpy.import_array", __pyx_clineno, __pyx_lineno, __pyx_filename);
3037 __Pyx_RefNannyFinishContext();
3049 static CYTHON_INLINE
int __pyx_f_5numpy_import_umath(
void) {
3051 __Pyx_RefNannyDeclarations
3052 PyObject *__pyx_t_1 = NULL;
3053 PyObject *__pyx_t_2 = NULL;
3054 PyObject *__pyx_t_3 = NULL;
3056 PyObject *__pyx_t_5 = NULL;
3057 PyObject *__pyx_t_6 = NULL;
3058 PyObject *__pyx_t_7 = NULL;
3059 PyObject *__pyx_t_8 = NULL;
3060 int __pyx_lineno = 0;
3061 const char *__pyx_filename = NULL;
3062 int __pyx_clineno = 0;
3063 __Pyx_RefNannySetupContext(
"import_umath", 0);
3073 __Pyx_PyThreadState_declare
3074 __Pyx_PyThreadState_assign
3075 __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
3076 __Pyx_XGOTREF(__pyx_t_1);
3077 __Pyx_XGOTREF(__pyx_t_2);
3078 __Pyx_XGOTREF(__pyx_t_3);
3088 __pyx_t_4 = _import_umath();
if (unlikely(__pyx_t_4 == ((
int)-1))) __PYX_ERR(1, 949, __pyx_L3_error)
3098 __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
3099 __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
3100 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
3101 goto __pyx_L8_try_end;
3111 __pyx_t_4 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0])));
3113 __Pyx_AddTraceback(
"numpy.import_umath", __pyx_clineno, __pyx_lineno, __pyx_filename);
3114 if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(1, 950, __pyx_L5_except_error)
3115 __Pyx_GOTREF(__pyx_t_5);
3116 __Pyx_GOTREF(__pyx_t_6);
3117 __Pyx_GOTREF(__pyx_t_7);
3126 __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)
3127 __Pyx_GOTREF(__pyx_t_8);
3128 __Pyx_Raise(__pyx_t_8, 0, 0, 0);
3129 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
3130 __PYX_ERR(1, 951, __pyx_L5_except_error)
3132 goto __pyx_L5_except_error;
3133 __pyx_L5_except_error:;
3142 __Pyx_XGIVEREF(__pyx_t_1);
3143 __Pyx_XGIVEREF(__pyx_t_2);
3144 __Pyx_XGIVEREF(__pyx_t_3);
3145 __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
3146 goto __pyx_L1_error;
3162 __Pyx_XDECREF(__pyx_t_5);
3163 __Pyx_XDECREF(__pyx_t_6);
3164 __Pyx_XDECREF(__pyx_t_7);
3165 __Pyx_XDECREF(__pyx_t_8);
3166 __Pyx_AddTraceback(
"numpy.import_umath", __pyx_clineno, __pyx_lineno, __pyx_filename);
3169 __Pyx_RefNannyFinishContext();
3181 static CYTHON_INLINE
int __pyx_f_5numpy_import_ufunc(
void) {
3183 __Pyx_RefNannyDeclarations
3184 PyObject *__pyx_t_1 = NULL;
3185 PyObject *__pyx_t_2 = NULL;
3186 PyObject *__pyx_t_3 = NULL;
3188 PyObject *__pyx_t_5 = NULL;
3189 PyObject *__pyx_t_6 = NULL;
3190 PyObject *__pyx_t_7 = NULL;
3191 PyObject *__pyx_t_8 = NULL;
3192 int __pyx_lineno = 0;
3193 const char *__pyx_filename = NULL;
3194 int __pyx_clineno = 0;
3195 __Pyx_RefNannySetupContext(
"import_ufunc", 0);
3205 __Pyx_PyThreadState_declare
3206 __Pyx_PyThreadState_assign
3207 __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
3208 __Pyx_XGOTREF(__pyx_t_1);
3209 __Pyx_XGOTREF(__pyx_t_2);
3210 __Pyx_XGOTREF(__pyx_t_3);
3220 __pyx_t_4 = _import_umath();
if (unlikely(__pyx_t_4 == ((
int)-1))) __PYX_ERR(1, 955, __pyx_L3_error)
3230 __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
3231 __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
3232 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
3233 goto __pyx_L8_try_end;
3243 __pyx_t_4 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0])));
3245 __Pyx_AddTraceback(
"numpy.import_ufunc", __pyx_clineno, __pyx_lineno, __pyx_filename);
3246 if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(1, 956, __pyx_L5_except_error)
3247 __Pyx_GOTREF(__pyx_t_5);
3248 __Pyx_GOTREF(__pyx_t_6);
3249 __Pyx_GOTREF(__pyx_t_7);
3258 __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)
3259 __Pyx_GOTREF(__pyx_t_8);
3260 __Pyx_Raise(__pyx_t_8, 0, 0, 0);
3261 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
3262 __PYX_ERR(1, 957, __pyx_L5_except_error)
3264 goto __pyx_L5_except_error;
3265 __pyx_L5_except_error:;
3274 __Pyx_XGIVEREF(__pyx_t_1);
3275 __Pyx_XGIVEREF(__pyx_t_2);
3276 __Pyx_XGIVEREF(__pyx_t_3);
3277 __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
3278 goto __pyx_L1_error;
3294 __Pyx_XDECREF(__pyx_t_5);
3295 __Pyx_XDECREF(__pyx_t_6);
3296 __Pyx_XDECREF(__pyx_t_7);
3297 __Pyx_XDECREF(__pyx_t_8);
3298 __Pyx_AddTraceback(
"numpy.import_ufunc", __pyx_clineno, __pyx_lineno, __pyx_filename);
3301 __Pyx_RefNannyFinishContext();
3313 static CYTHON_INLINE
int __pyx_f_5numpy_is_timedelta64_object(PyObject *__pyx_v_obj) {
3315 __Pyx_RefNannyDeclarations
3316 __Pyx_RefNannySetupContext(
"is_timedelta64_object", 0);
3325 __pyx_r = PyObject_TypeCheck(__pyx_v_obj, (&PyTimedeltaArrType_Type));
3338 __Pyx_RefNannyFinishContext();
3350 static CYTHON_INLINE
int __pyx_f_5numpy_is_datetime64_object(PyObject *__pyx_v_obj) {
3352 __Pyx_RefNannyDeclarations
3353 __Pyx_RefNannySetupContext(
"is_datetime64_object", 0);
3362 __pyx_r = PyObject_TypeCheck(__pyx_v_obj, (&PyDatetimeArrType_Type));
3375 __Pyx_RefNannyFinishContext();
3387 static CYTHON_INLINE npy_datetime __pyx_f_5numpy_get_datetime64_value(PyObject *__pyx_v_obj) {
3388 npy_datetime __pyx_r;
3397 __pyx_r = ((PyDatetimeScalarObject *)__pyx_v_obj)->obval;
3421 static CYTHON_INLINE npy_timedelta __pyx_f_5numpy_get_timedelta64_value(PyObject *__pyx_v_obj) {
3422 npy_timedelta __pyx_r;
3431 __pyx_r = ((PyTimedeltaScalarObject *)__pyx_v_obj)->obval;
3455 static CYTHON_INLINE NPY_DATETIMEUNIT __pyx_f_5numpy_get_datetime64_unit(PyObject *__pyx_v_obj) {
3456 NPY_DATETIMEUNIT __pyx_r;
3463 __pyx_r = ((NPY_DATETIMEUNIT)((PyDatetimeScalarObject *)__pyx_v_obj)->obmeta.base);
3479 static PyMethodDef __pyx_methods[] = {
3483 #if PY_MAJOR_VERSION >= 3
3484 #if CYTHON_PEP489_MULTI_PHASE_INIT
3485 static PyObject* __pyx_pymod_create(PyObject *spec, PyModuleDef *def);
3486 static int __pyx_pymod_exec_cSubsurfaceTransportCoefficients(PyObject* module);
3487 static PyModuleDef_Slot __pyx_moduledef_slots[] = {
3488 {Py_mod_create, (
void*)__pyx_pymod_create},
3489 {Py_mod_exec, (
void*)__pyx_pymod_exec_cSubsurfaceTransportCoefficients},
3494 static struct PyModuleDef __pyx_moduledef = {
3495 PyModuleDef_HEAD_INIT,
3496 "cSubsurfaceTransportCoefficients",
3498 #if CYTHON_PEP489_MULTI_PHASE_INIT
3504 #if CYTHON_PEP489_MULTI_PHASE_INIT
3505 __pyx_moduledef_slots,
3514 #ifndef CYTHON_SMALL_CODE
3515 #if defined(__clang__)
3516 #define CYTHON_SMALL_CODE
3517 #elif defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 3))
3518 #define CYTHON_SMALL_CODE __attribute__((cold))
3520 #define CYTHON_SMALL_CODE
3524 static __Pyx_StringTabEntry __pyx_string_tab[] = {
3525 {&__pyx_n_s_ImportError, __pyx_k_ImportError,
sizeof(__pyx_k_ImportError), 0, 0, 1, 1},
3526 {&__pyx_n_s_Kbar, __pyx_k_Kbar,
sizeof(__pyx_k_Kbar), 0, 0, 1, 1},
3527 {&__pyx_n_s_b, __pyx_k_b,
sizeof(__pyx_k_b), 0, 0, 1, 1},
3528 {&__pyx_n_s_bc_u, __pyx_k_bc_u,
sizeof(__pyx_k_bc_u), 0, 0, 1, 1},
3529 {&__pyx_n_s_cSubsurfaceTransportCoefficients, __pyx_k_cSubsurfaceTransportCoefficients,
sizeof(__pyx_k_cSubsurfaceTransportCoefficients), 0, 0, 1, 1},
3530 {&__pyx_n_s_calculateRusanovFluxSaturationEq, __pyx_k_calculateRusanovFluxSaturationEq,
sizeof(__pyx_k_calculateRusanovFluxSaturationEq), 0, 0, 1, 1},
3531 {&__pyx_n_s_cline_in_traceback, __pyx_k_cline_in_traceback,
sizeof(__pyx_k_cline_in_traceback), 0, 0, 1, 1},
3532 {&__pyx_n_s_colind, __pyx_k_colind,
sizeof(__pyx_k_colind), 0, 0, 1, 1},
3533 {&__pyx_n_s_dy, __pyx_k_dy,
sizeof(__pyx_k_dy), 0, 0, 1, 1},
3534 {&__pyx_n_s_ebq_global_qt, __pyx_k_ebq_global_qt,
sizeof(__pyx_k_ebq_global_qt), 0, 0, 1, 1},
3535 {&__pyx_n_s_elementBoundaryElements, __pyx_k_elementBoundaryElements,
sizeof(__pyx_k_elementBoundaryElements), 0, 0, 1, 1},
3536 {&__pyx_n_s_elementBoundaryLocalElementBound, __pyx_k_elementBoundaryLocalElementBound,
sizeof(__pyx_k_elementBoundaryLocalElementBound), 0, 0, 1, 1},
3537 {&__pyx_n_s_exteriorElementBoundaries, __pyx_k_exteriorElementBoundaries,
sizeof(__pyx_k_exteriorElementBoundaries), 0, 0, 1, 1},
3538 {&__pyx_n_s_failed, __pyx_k_failed,
sizeof(__pyx_k_failed), 0, 0, 1, 1},
3539 {&__pyx_n_s_flux, __pyx_k_flux,
sizeof(__pyx_k_flux), 0, 0, 1, 1},
3540 {&__pyx_n_s_g, __pyx_k_g,
sizeof(__pyx_k_g), 0, 0, 1, 1},
3541 {&__pyx_n_s_import, __pyx_k_import,
sizeof(__pyx_k_import), 0, 0, 1, 1},
3542 {&__pyx_n_s_interiorElementBoundaries, __pyx_k_interiorElementBoundaries,
sizeof(__pyx_k_interiorElementBoundaries), 0, 0, 1, 1},
3543 {&__pyx_n_s_isDOFBoundary, __pyx_k_isDOFBoundary,
sizeof(__pyx_k_isDOFBoundary), 0, 0, 1, 1},
3544 {&__pyx_n_s_main, __pyx_k_main,
sizeof(__pyx_k_main), 0, 0, 1, 1},
3545 {&__pyx_n_s_materialTypes, __pyx_k_materialTypes,
sizeof(__pyx_k_materialTypes), 0, 0, 1, 1},
3546 {&__pyx_n_s_mun, __pyx_k_mun,
sizeof(__pyx_k_mun), 0, 0, 1, 1},
3547 {&__pyx_n_s_muw, __pyx_k_muw,
sizeof(__pyx_k_muw), 0, 0, 1, 1},
3548 {&__pyx_n_s_n, __pyx_k_n,
sizeof(__pyx_k_n), 0, 0, 1, 1},
3549 {&__pyx_n_s_nElementBoundaries_element, __pyx_k_nElementBoundaries_element,
sizeof(__pyx_k_nElementBoundaries_element), 0, 0, 1, 1},
3550 {&__pyx_n_s_nElements_global, __pyx_k_nElements_global,
sizeof(__pyx_k_nElements_global), 0, 0, 1, 1},
3551 {&__pyx_n_s_nExteriorElementBoundaries_globa, __pyx_k_nExteriorElementBoundaries_globa,
sizeof(__pyx_k_nExteriorElementBoundaries_globa), 0, 0, 1, 1},
3552 {&__pyx_n_s_nInteriorElementBoundaries_globa, __pyx_k_nInteriorElementBoundaries_globa,
sizeof(__pyx_k_nInteriorElementBoundaries_globa), 0, 0, 1, 1},
3553 {&__pyx_n_s_nParams, __pyx_k_nParams,
sizeof(__pyx_k_nParams), 0, 0, 1, 1},
3554 {&__pyx_n_s_nQuadraturePoints_element, __pyx_k_nQuadraturePoints_element,
sizeof(__pyx_k_nQuadraturePoints_element), 0, 0, 1, 1},
3555 {&__pyx_n_s_nQuadraturePoints_elementBoundar, __pyx_k_nQuadraturePoints_elementBoundar,
sizeof(__pyx_k_nQuadraturePoints_elementBoundar), 0, 0, 1, 1},
3556 {&__pyx_n_s_nSpace, __pyx_k_nSpace,
sizeof(__pyx_k_nSpace), 0, 0, 1, 1},
3557 {&__pyx_n_s_name, __pyx_k_name,
sizeof(__pyx_k_name), 0, 0, 1, 1},
3558 {&__pyx_n_s_np, __pyx_k_np,
sizeof(__pyx_k_np), 0, 0, 1, 1},
3559 {&__pyx_n_s_numpy, __pyx_k_numpy,
sizeof(__pyx_k_numpy), 0, 0, 1, 1},
3560 {&__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},
3561 {&__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},
3562 {&__pyx_n_s_omega, __pyx_k_omega,
sizeof(__pyx_k_omega), 0, 0, 1, 1},
3563 {&__pyx_n_s_piecewiseLinearTableLookup, __pyx_k_piecewiseLinearTableLookup,
sizeof(__pyx_k_piecewiseLinearTableLookup), 0, 0, 1, 1},
3564 {&__pyx_kp_s_proteus_cSubsurfaceTransportCoef, __pyx_k_proteus_cSubsurfaceTransportCoef,
sizeof(__pyx_k_proteus_cSubsurfaceTransportCoef), 0, 0, 1, 0},
3565 {&__pyx_n_s_pskModelFlag, __pyx_k_pskModelFlag,
sizeof(__pyx_k_pskModelFlag), 0, 0, 1, 1},
3566 {&__pyx_n_s_q_dV, __pyx_k_q_dV,
sizeof(__pyx_k_q_dV), 0, 0, 1, 1},
3567 {&__pyx_n_s_q_lambda_bar, __pyx_k_q_lambda_bar,
sizeof(__pyx_k_q_lambda_bar), 0, 0, 1, 1},
3568 {&__pyx_n_s_q_u, __pyx_k_q_u,
sizeof(__pyx_k_q_u), 0, 0, 1, 1},
3569 {&__pyx_n_s_rowptr, __pyx_k_rowptr,
sizeof(__pyx_k_rowptr), 0, 0, 1, 1},
3570 {&__pyx_n_s_rwork_density_n, __pyx_k_rwork_density_n,
sizeof(__pyx_k_rwork_density_n), 0, 0, 1, 1},
3571 {&__pyx_n_s_rwork_density_w, __pyx_k_rwork_density_w,
sizeof(__pyx_k_rwork_density_w), 0, 0, 1, 1},
3572 {&__pyx_n_s_rwork_psk, __pyx_k_rwork_psk,
sizeof(__pyx_k_rwork_psk), 0, 0, 1, 1},
3573 {&__pyx_n_s_rwork_psk_tol, __pyx_k_rwork_psk_tol,
sizeof(__pyx_k_rwork_psk_tol), 0, 0, 1, 1},
3574 {&__pyx_n_s_safetyFactor, __pyx_k_safetyFactor,
sizeof(__pyx_k_safetyFactor), 0, 0, 1, 1},
3575 {&__pyx_n_s_start, __pyx_k_start,
sizeof(__pyx_k_start), 0, 0, 1, 1},
3576 {&__pyx_n_s_test, __pyx_k_test,
sizeof(__pyx_k_test), 0, 0, 1, 1},
3577 {&__pyx_n_s_x, __pyx_k_x,
sizeof(__pyx_k_x), 0, 0, 1, 1},
3578 {&__pyx_n_s_xv, __pyx_k_xv,
sizeof(__pyx_k_xv), 0, 0, 1, 1},
3579 {&__pyx_n_s_y, __pyx_k_y,
sizeof(__pyx_k_y), 0, 0, 1, 1},
3580 {&__pyx_n_s_yv, __pyx_k_yv,
sizeof(__pyx_k_yv), 0, 0, 1, 1},
3581 {0, 0, 0, 0, 0, 0, 0}
3583 static CYTHON_SMALL_CODE
int __Pyx_InitCachedBuiltins(
void) {
3584 __pyx_builtin_ImportError = __Pyx_GetBuiltinName(__pyx_n_s_ImportError);
if (!__pyx_builtin_ImportError) __PYX_ERR(1, 945, __pyx_L1_error)
3590 static CYTHON_SMALL_CODE
int __Pyx_InitCachedConstants(
void) {
3591 __Pyx_RefNannyDeclarations
3592 __Pyx_RefNannySetupContext(
"__Pyx_InitCachedConstants", 0);
3601 __pyx_tuple_ = PyTuple_Pack(1, __pyx_kp_s_numpy_core_multiarray_failed_to);
if (unlikely(!__pyx_tuple_)) __PYX_ERR(1, 945, __pyx_L1_error)
3602 __Pyx_GOTREF(__pyx_tuple_);
3603 __Pyx_GIVEREF(__pyx_tuple_);
3612 __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)
3613 __Pyx_GOTREF(__pyx_tuple__2);
3614 __Pyx_GIVEREF(__pyx_tuple__2);
3623 __pyx_tuple__3 = PyTuple_Pack(36, __pyx_n_s_safetyFactor, __pyx_n_s_nSpace, __pyx_n_s_pskModelFlag, __pyx_n_s_nParams, __pyx_n_s_rowptr, __pyx_n_s_colind, __pyx_n_s_materialTypes, __pyx_n_s_muw, __pyx_n_s_mun, __pyx_n_s_omega, __pyx_n_s_Kbar, __pyx_n_s_b, __pyx_n_s_rwork_psk, __pyx_n_s_rwork_psk_tol, __pyx_n_s_rwork_density_w, __pyx_n_s_rwork_density_n, __pyx_n_s_g, __pyx_n_s_ebq_global_qt, __pyx_n_s_q_lambda_bar, __pyx_n_s_nElements_global, __pyx_n_s_nElementBoundaries_element, __pyx_n_s_nInteriorElementBoundaries_globa, __pyx_n_s_nExteriorElementBoundaries_globa, __pyx_n_s_nQuadraturePoints_element, __pyx_n_s_nQuadraturePoints_elementBoundar, __pyx_n_s_interiorElementBoundaries, __pyx_n_s_exteriorElementBoundaries, __pyx_n_s_elementBoundaryElements, __pyx_n_s_elementBoundaryLocalElementBound, __pyx_n_s_n, __pyx_n_s_q_u, __pyx_n_s_q_dV, __pyx_n_s_isDOFBoundary, __pyx_n_s_bc_u, __pyx_n_s_flux, __pyx_n_s_failed);
if (unlikely(!__pyx_tuple__3)) __PYX_ERR(0, 6, __pyx_L1_error)
3624 __Pyx_GOTREF(__pyx_tuple__3);
3625 __Pyx_GIVEREF(__pyx_tuple__3);
3626 __pyx_codeobj__4 = (PyObject*)__Pyx_PyCode_New(35, 0, 36, 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_cSubsurfaceTransportCoef, __pyx_n_s_calculateRusanovFluxSaturationEq, 6, __pyx_empty_bytes);
if (unlikely(!__pyx_codeobj__4)) __PYX_ERR(0, 6, __pyx_L1_error)
3635 __pyx_tuple__5 = PyTuple_Pack(6, __pyx_n_s_x, __pyx_n_s_xv, __pyx_n_s_yv, __pyx_n_s_start, __pyx_n_s_y, __pyx_n_s_dy);
if (unlikely(!__pyx_tuple__5)) __PYX_ERR(0, 80, __pyx_L1_error)
3636 __Pyx_GOTREF(__pyx_tuple__5);
3637 __Pyx_GIVEREF(__pyx_tuple__5);
3638 __pyx_codeobj__6 = (PyObject*)__Pyx_PyCode_New(4, 0, 6, 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_cSubsurfaceTransportCoef, __pyx_n_s_piecewiseLinearTableLookup, 80, __pyx_empty_bytes);
if (unlikely(!__pyx_codeobj__6)) __PYX_ERR(0, 80, __pyx_L1_error)
3639 __Pyx_RefNannyFinishContext();
3642 __Pyx_RefNannyFinishContext();
3646 static CYTHON_SMALL_CODE
int __Pyx_InitGlobals(
void) {
3647 if (__Pyx_InitStrings(__pyx_string_tab) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
3653 static CYTHON_SMALL_CODE
int __Pyx_modinit_global_init_code(
void);
3654 static CYTHON_SMALL_CODE
int __Pyx_modinit_variable_export_code(
void);
3655 static CYTHON_SMALL_CODE
int __Pyx_modinit_function_export_code(
void);
3656 static CYTHON_SMALL_CODE
int __Pyx_modinit_type_init_code(
void);
3657 static CYTHON_SMALL_CODE
int __Pyx_modinit_type_import_code(
void);
3658 static CYTHON_SMALL_CODE
int __Pyx_modinit_variable_import_code(
void);
3659 static CYTHON_SMALL_CODE
int __Pyx_modinit_function_import_code(
void);
3661 static int __Pyx_modinit_global_init_code(
void) {
3662 __Pyx_RefNannyDeclarations
3663 __Pyx_RefNannySetupContext(
"__Pyx_modinit_global_init_code", 0);
3665 __Pyx_RefNannyFinishContext();
3669 static int __Pyx_modinit_variable_export_code(
void) {
3670 __Pyx_RefNannyDeclarations
3671 __Pyx_RefNannySetupContext(
"__Pyx_modinit_variable_export_code", 0);
3673 __Pyx_RefNannyFinishContext();
3677 static int __Pyx_modinit_function_export_code(
void) {
3678 __Pyx_RefNannyDeclarations
3679 __Pyx_RefNannySetupContext(
"__Pyx_modinit_function_export_code", 0);
3681 __Pyx_RefNannyFinishContext();
3685 static int __Pyx_modinit_type_init_code(
void) {
3686 __Pyx_RefNannyDeclarations
3687 __Pyx_RefNannySetupContext(
"__Pyx_modinit_type_init_code", 0);
3689 __Pyx_RefNannyFinishContext();
3693 static int __Pyx_modinit_type_import_code(
void) {
3694 __Pyx_RefNannyDeclarations
3695 PyObject *__pyx_t_1 = NULL;
3696 int __pyx_lineno = 0;
3697 const char *__pyx_filename = NULL;
3698 int __pyx_clineno = 0;
3699 __Pyx_RefNannySetupContext(
"__Pyx_modinit_type_import_code", 0);
3701 __pyx_t_1 = PyImport_ImportModule(__Pyx_BUILTIN_MODULE_NAME);
if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 9, __pyx_L1_error)
3702 __Pyx_GOTREF(__pyx_t_1);
3703 __pyx_ptype_7cpython_4type_type = __Pyx_ImportType(__pyx_t_1, __Pyx_BUILTIN_MODULE_NAME,
"type",
3704 #
if defined(PYPY_VERSION_NUM) && PYPY_VERSION_NUM < 0x050B0000
3705 sizeof(PyTypeObject),
3707 sizeof(PyHeapTypeObject),
3709 __Pyx_ImportType_CheckSize_Warn);
3710 if (!__pyx_ptype_7cpython_4type_type) __PYX_ERR(2, 9, __pyx_L1_error)
3711 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
3712 __pyx_t_1 = PyImport_ImportModule(
"numpy");
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 200, __pyx_L1_error)
3713 __Pyx_GOTREF(__pyx_t_1);
3714 __pyx_ptype_5numpy_dtype = __Pyx_ImportType(__pyx_t_1,
"numpy",
"dtype",
sizeof(PyArray_Descr), __Pyx_ImportType_CheckSize_Ignore);
3715 if (!__pyx_ptype_5numpy_dtype) __PYX_ERR(1, 200, __pyx_L1_error)
3716 __pyx_ptype_5numpy_flatiter = __Pyx_ImportType(__pyx_t_1,
"numpy",
"flatiter",
sizeof(PyArrayIterObject), __Pyx_ImportType_CheckSize_Ignore);
3717 if (!__pyx_ptype_5numpy_flatiter) __PYX_ERR(1, 223, __pyx_L1_error)
3718 __pyx_ptype_5numpy_broadcast = __Pyx_ImportType(__pyx_t_1,
"numpy",
"broadcast",
sizeof(PyArrayMultiIterObject), __Pyx_ImportType_CheckSize_Ignore);
3719 if (!__pyx_ptype_5numpy_broadcast) __PYX_ERR(1, 227, __pyx_L1_error)
3720 __pyx_ptype_5numpy_ndarray = __Pyx_ImportType(__pyx_t_1,
"numpy",
"ndarray",
sizeof(PyArrayObject), __Pyx_ImportType_CheckSize_Ignore);
3721 if (!__pyx_ptype_5numpy_ndarray) __PYX_ERR(1, 239, __pyx_L1_error)
3722 __pyx_ptype_5numpy_generic = __Pyx_ImportType(__pyx_t_1,
"numpy",
"generic",
sizeof(PyObject), __Pyx_ImportType_CheckSize_Warn);
3723 if (!__pyx_ptype_5numpy_generic) __PYX_ERR(1, 771, __pyx_L1_error)
3724 __pyx_ptype_5numpy_number = __Pyx_ImportType(__pyx_t_1,
"numpy",
"number",
sizeof(PyObject), __Pyx_ImportType_CheckSize_Warn);
3725 if (!__pyx_ptype_5numpy_number) __PYX_ERR(1, 773, __pyx_L1_error)
3726 __pyx_ptype_5numpy_integer = __Pyx_ImportType(__pyx_t_1,
"numpy",
"integer",
sizeof(PyObject), __Pyx_ImportType_CheckSize_Warn);
3727 if (!__pyx_ptype_5numpy_integer) __PYX_ERR(1, 775, __pyx_L1_error)
3728 __pyx_ptype_5numpy_signedinteger = __Pyx_ImportType(__pyx_t_1,
"numpy",
"signedinteger",
sizeof(PyObject), __Pyx_ImportType_CheckSize_Warn);
3729 if (!__pyx_ptype_5numpy_signedinteger) __PYX_ERR(1, 777, __pyx_L1_error)
3730 __pyx_ptype_5numpy_unsignedinteger = __Pyx_ImportType(__pyx_t_1,
"numpy",
"unsignedinteger",
sizeof(PyObject), __Pyx_ImportType_CheckSize_Warn);
3731 if (!__pyx_ptype_5numpy_unsignedinteger) __PYX_ERR(1, 779, __pyx_L1_error)
3732 __pyx_ptype_5numpy_inexact = __Pyx_ImportType(__pyx_t_1,
"numpy",
"inexact",
sizeof(PyObject), __Pyx_ImportType_CheckSize_Warn);
3733 if (!__pyx_ptype_5numpy_inexact) __PYX_ERR(1, 781, __pyx_L1_error)
3734 __pyx_ptype_5numpy_floating = __Pyx_ImportType(__pyx_t_1,
"numpy",
"floating",
sizeof(PyObject), __Pyx_ImportType_CheckSize_Warn);
3735 if (!__pyx_ptype_5numpy_floating) __PYX_ERR(1, 783, __pyx_L1_error)
3736 __pyx_ptype_5numpy_complexfloating = __Pyx_ImportType(__pyx_t_1,
"numpy",
"complexfloating",
sizeof(PyObject), __Pyx_ImportType_CheckSize_Warn);
3737 if (!__pyx_ptype_5numpy_complexfloating) __PYX_ERR(1, 785, __pyx_L1_error)
3738 __pyx_ptype_5numpy_flexible = __Pyx_ImportType(__pyx_t_1,
"numpy",
"flexible",
sizeof(PyObject), __Pyx_ImportType_CheckSize_Warn);
3739 if (!__pyx_ptype_5numpy_flexible) __PYX_ERR(1, 787, __pyx_L1_error)
3740 __pyx_ptype_5numpy_character = __Pyx_ImportType(__pyx_t_1,
"numpy",
"character",
sizeof(PyObject), __Pyx_ImportType_CheckSize_Warn);
3741 if (!__pyx_ptype_5numpy_character) __PYX_ERR(1, 789, __pyx_L1_error)
3742 __pyx_ptype_5numpy_ufunc = __Pyx_ImportType(__pyx_t_1,
"numpy",
"ufunc",
sizeof(PyUFuncObject), __Pyx_ImportType_CheckSize_Ignore);
3743 if (!__pyx_ptype_5numpy_ufunc) __PYX_ERR(1, 827, __pyx_L1_error)
3744 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
3745 __Pyx_RefNannyFinishContext();
3748 __Pyx_XDECREF(__pyx_t_1);
3749 __Pyx_RefNannyFinishContext();
3753 static int __Pyx_modinit_variable_import_code(
void) {
3754 __Pyx_RefNannyDeclarations
3755 __Pyx_RefNannySetupContext(
"__Pyx_modinit_variable_import_code", 0);
3757 __Pyx_RefNannyFinishContext();
3761 static int __Pyx_modinit_function_import_code(
void) {
3762 __Pyx_RefNannyDeclarations
3763 __Pyx_RefNannySetupContext(
"__Pyx_modinit_function_import_code", 0);
3765 __Pyx_RefNannyFinishContext();
3770 #ifndef CYTHON_NO_PYINIT_EXPORT
3771 #define __Pyx_PyMODINIT_FUNC PyMODINIT_FUNC
3772 #elif PY_MAJOR_VERSION < 3
3774 #define __Pyx_PyMODINIT_FUNC extern "C" void
3776 #define __Pyx_PyMODINIT_FUNC void
3780 #define __Pyx_PyMODINIT_FUNC extern "C" PyObject *
3782 #define __Pyx_PyMODINIT_FUNC PyObject *
3787 #if PY_MAJOR_VERSION < 3
3788 __Pyx_PyMODINIT_FUNC initcSubsurfaceTransportCoefficients(
void) CYTHON_SMALL_CODE;
3789 __Pyx_PyMODINIT_FUNC initcSubsurfaceTransportCoefficients(
void)
3791 __Pyx_PyMODINIT_FUNC PyInit_cSubsurfaceTransportCoefficients(
void) CYTHON_SMALL_CODE;
3792 __Pyx_PyMODINIT_FUNC PyInit_cSubsurfaceTransportCoefficients(
void)
3793 #if CYTHON_PEP489_MULTI_PHASE_INIT
3795 return PyModuleDef_Init(&__pyx_moduledef);
3797 static CYTHON_SMALL_CODE
int __Pyx_check_single_interpreter(
void) {
3798 #if PY_VERSION_HEX >= 0x030700A1
3799 static PY_INT64_T main_interpreter_id = -1;
3800 PY_INT64_T current_id = PyInterpreterState_GetID(PyThreadState_Get()->interp);
3801 if (main_interpreter_id == -1) {
3802 main_interpreter_id = current_id;
3803 return (unlikely(current_id == -1)) ? -1 : 0;
3804 }
else if (unlikely(main_interpreter_id != current_id))
3806 static PyInterpreterState *main_interpreter = NULL;
3807 PyInterpreterState *current_interpreter = PyThreadState_Get()->interp;
3808 if (!main_interpreter) {
3809 main_interpreter = current_interpreter;
3810 }
else if (unlikely(main_interpreter != current_interpreter))
3815 "Interpreter change detected - this module can only be loaded into one interpreter per process.");
3820 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) {
3821 PyObject *value = PyObject_GetAttrString(spec, from_name);
3823 if (likely(value)) {
3824 if (allow_none || value != Py_None) {
3825 result = PyDict_SetItemString(moddict, to_name, value);
3828 }
else if (PyErr_ExceptionMatches(PyExc_AttributeError)) {
3835 static CYTHON_SMALL_CODE PyObject* __pyx_pymod_create(PyObject *spec, CYTHON_UNUSED PyModuleDef *def) {
3836 PyObject *module = NULL, *moddict, *modname;
3837 if (__Pyx_check_single_interpreter())
3840 return __Pyx_NewRef(__pyx_m);
3841 modname = PyObject_GetAttrString(spec,
"name");
3842 if (unlikely(!modname))
goto bad;
3843 module = PyModule_NewObject(modname);
3845 if (unlikely(!module))
goto bad;
3846 moddict = PyModule_GetDict(module);
3847 if (unlikely(!moddict))
goto bad;
3848 if (unlikely(__Pyx_copy_spec_to_module(spec, moddict,
"loader",
"__loader__", 1) < 0))
goto bad;
3849 if (unlikely(__Pyx_copy_spec_to_module(spec, moddict,
"origin",
"__file__", 1) < 0))
goto bad;
3850 if (unlikely(__Pyx_copy_spec_to_module(spec, moddict,
"parent",
"__package__", 1) < 0))
goto bad;
3851 if (unlikely(__Pyx_copy_spec_to_module(spec, moddict,
"submodule_search_locations",
"__path__", 0) < 0))
goto bad;
3859 static CYTHON_SMALL_CODE
int __pyx_pymod_exec_cSubsurfaceTransportCoefficients(PyObject *__pyx_pyinit_module)
3863 PyObject *__pyx_t_1 = NULL;
3864 int __pyx_lineno = 0;
3865 const char *__pyx_filename = NULL;
3866 int __pyx_clineno = 0;
3867 __Pyx_RefNannyDeclarations
3868 #if CYTHON_PEP489_MULTI_PHASE_INIT
3870 if (__pyx_m == __pyx_pyinit_module)
return 0;
3871 PyErr_SetString(PyExc_RuntimeError,
"Module 'cSubsurfaceTransportCoefficients' has already been imported. Re-initialisation is not supported.");
3874 #elif PY_MAJOR_VERSION >= 3
3875 if (__pyx_m)
return __Pyx_NewRef(__pyx_m);
3878 __Pyx_RefNanny = __Pyx_RefNannyImportAPI(
"refnanny");
3879 if (!__Pyx_RefNanny) {
3881 __Pyx_RefNanny = __Pyx_RefNannyImportAPI(
"Cython.Runtime.refnanny");
3882 if (!__Pyx_RefNanny)
3883 Py_FatalError(
"failed to import 'refnanny' module");
3886 __Pyx_RefNannySetupContext(
"__Pyx_PyMODINIT_FUNC PyInit_cSubsurfaceTransportCoefficients(void)", 0);
3887 if (__Pyx_check_binary_version() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
3888 #ifdef __Pxy_PyFrame_Initialize_Offsets
3889 __Pxy_PyFrame_Initialize_Offsets();
3891 __pyx_empty_tuple = PyTuple_New(0);
if (unlikely(!__pyx_empty_tuple)) __PYX_ERR(0, 1, __pyx_L1_error)
3892 __pyx_empty_bytes = PyBytes_FromStringAndSize(
"", 0);
if (unlikely(!__pyx_empty_bytes)) __PYX_ERR(0, 1, __pyx_L1_error)
3893 __pyx_empty_unicode = PyUnicode_FromStringAndSize(
"", 0);
if (unlikely(!__pyx_empty_unicode)) __PYX_ERR(0, 1, __pyx_L1_error)
3894 #ifdef __Pyx_CyFunction_USED
3895 if (__pyx_CyFunction_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
3897 #ifdef __Pyx_FusedFunction_USED
3898 if (__pyx_FusedFunction_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
3900 #ifdef __Pyx_Coroutine_USED
3901 if (__pyx_Coroutine_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
3903 #ifdef __Pyx_Generator_USED
3904 if (__pyx_Generator_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
3906 #ifdef __Pyx_AsyncGen_USED
3907 if (__pyx_AsyncGen_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
3909 #ifdef __Pyx_StopAsyncIteration_USED
3910 if (__pyx_StopAsyncIteration_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
3914 #if defined(WITH_THREAD) && PY_VERSION_HEX < 0x030700F0 && defined(__PYX_FORCE_INIT_THREADS) && __PYX_FORCE_INIT_THREADS
3915 PyEval_InitThreads();
3918 #if CYTHON_PEP489_MULTI_PHASE_INIT
3919 __pyx_m = __pyx_pyinit_module;
3922 #if PY_MAJOR_VERSION < 3
3923 __pyx_m = Py_InitModule4(
"cSubsurfaceTransportCoefficients", __pyx_methods, 0, 0, PYTHON_API_VERSION); Py_XINCREF(__pyx_m);
3925 __pyx_m = PyModule_Create(&__pyx_moduledef);
3927 if (unlikely(!__pyx_m)) __PYX_ERR(0, 1, __pyx_L1_error)
3929 __pyx_d = PyModule_GetDict(__pyx_m);
if (unlikely(!__pyx_d)) __PYX_ERR(0, 1, __pyx_L1_error)
3931 __pyx_b = PyImport_AddModule(__Pyx_BUILTIN_MODULE_NAME);
if (unlikely(!__pyx_b)) __PYX_ERR(0, 1, __pyx_L1_error)
3933 __pyx_cython_runtime = PyImport_AddModule((
char *)
"cython_runtime");
if (unlikely(!__pyx_cython_runtime)) __PYX_ERR(0, 1, __pyx_L1_error)
3934 Py_INCREF(__pyx_cython_runtime);
3935 if (PyObject_SetAttrString(__pyx_m,
"__builtins__", __pyx_b) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
3937 if (__Pyx_InitGlobals() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
3938 #if PY_MAJOR_VERSION < 3 && (__PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT)
3939 if (__Pyx_init_sys_getdefaultencoding_params() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
3941 if (__pyx_module_is_main_cSubsurfaceTransportCoefficients) {
3942 if (PyObject_SetAttr(__pyx_m, __pyx_n_s_name, __pyx_n_s_main) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
3944 #if PY_MAJOR_VERSION >= 3
3946 PyObject *modules = PyImport_GetModuleDict();
if (unlikely(!modules)) __PYX_ERR(0, 1, __pyx_L1_error)
3947 if (!PyDict_GetItemString(modules,
"cSubsurfaceTransportCoefficients")) {
3948 if (unlikely(PyDict_SetItemString(modules,
"cSubsurfaceTransportCoefficients", __pyx_m) < 0)) __PYX_ERR(0, 1, __pyx_L1_error)
3953 if (__Pyx_InitCachedBuiltins() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
3955 if (__Pyx_InitCachedConstants() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
3957 (void)__Pyx_modinit_global_init_code();
3958 (void)__Pyx_modinit_variable_export_code();
3959 (void)__Pyx_modinit_function_export_code();
3960 (void)__Pyx_modinit_type_init_code();
3961 if (unlikely(__Pyx_modinit_type_import_code() < 0)) __PYX_ERR(0, 1, __pyx_L1_error)
3962 (void)__Pyx_modinit_variable_import_code();
3963 (void)__Pyx_modinit_function_import_code();
3965 #if defined(__Pyx_Generator_USED) || defined(__Pyx_Coroutine_USED)
3966 if (__Pyx_patch_abc() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
3975 __pyx_t_1 = __Pyx_Import(__pyx_n_s_numpy, 0, -1);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2, __pyx_L1_error)
3976 __Pyx_GOTREF(__pyx_t_1);
3977 if (PyDict_SetItem(__pyx_d, __pyx_n_s_np, __pyx_t_1) < 0) __PYX_ERR(0, 2, __pyx_L1_error)
3978 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
3987 __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_32cSubsurfaceTransportCoefficients_1calculateRusanovFluxSaturationEquationIncomp_PWC, NULL, __pyx_n_s_cSubsurfaceTransportCoefficients);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 6, __pyx_L1_error)
3988 __Pyx_GOTREF(__pyx_t_1);
3989 if (PyDict_SetItem(__pyx_d, __pyx_n_s_calculateRusanovFluxSaturationEq, __pyx_t_1) < 0) __PYX_ERR(0, 6, __pyx_L1_error)
3990 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
3999 __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_32cSubsurfaceTransportCoefficients_3piecewiseLinearTableLookup, NULL, __pyx_n_s_cSubsurfaceTransportCoefficients);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 80, __pyx_L1_error)
4000 __Pyx_GOTREF(__pyx_t_1);
4001 if (PyDict_SetItem(__pyx_d, __pyx_n_s_piecewiseLinearTableLookup, __pyx_t_1) < 0) __PYX_ERR(0, 80, __pyx_L1_error)
4002 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
4009 __pyx_t_1 = __Pyx_PyDict_NewPresized(0);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1, __pyx_L1_error)
4010 __Pyx_GOTREF(__pyx_t_1);
4011 if (PyDict_SetItem(__pyx_d, __pyx_n_s_test, __pyx_t_1) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
4012 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
4026 __Pyx_XDECREF(__pyx_t_1);
4029 __Pyx_AddTraceback(
"init cSubsurfaceTransportCoefficients", __pyx_clineno, __pyx_lineno, __pyx_filename);
4032 }
else if (!PyErr_Occurred()) {
4033 PyErr_SetString(PyExc_ImportError,
"init cSubsurfaceTransportCoefficients");
4036 __Pyx_RefNannyFinishContext();
4037 #if CYTHON_PEP489_MULTI_PHASE_INIT
4038 return (__pyx_m != NULL) ? 0 : -1;
4039 #elif PY_MAJOR_VERSION >= 3
4049 static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(
const char *modname) {
4050 PyObject *m = NULL, *p = NULL;
4052 m = PyImport_ImportModule(modname);
4054 p = PyObject_GetAttrString(m,
"RefNannyAPI");
4056 r = PyLong_AsVoidPtr(p);
4060 return (__Pyx_RefNannyAPIStruct *)
r;
4065 static void __Pyx_RaiseArgtupleInvalid(
4066 const char* func_name,
4070 Py_ssize_t num_found)
4072 Py_ssize_t num_expected;
4073 const char *more_or_less;
4074 if (num_found < num_min) {
4075 num_expected = num_min;
4076 more_or_less =
"at least";
4078 num_expected = num_max;
4079 more_or_less =
"at most";
4082 more_or_less =
"exactly";
4084 PyErr_Format(PyExc_TypeError,
4085 "%.200s() takes %.8s %" CYTHON_FORMAT_SSIZE_T
"d positional argument%.1s (%" CYTHON_FORMAT_SSIZE_T
"d given)",
4086 func_name, more_or_less, num_expected,
4087 (num_expected == 1) ?
"" :
"s", num_found);
4091 static void __Pyx_RaiseDoubleKeywordsError(
4092 const char* func_name,
4095 PyErr_Format(PyExc_TypeError,
4096 #
if PY_MAJOR_VERSION >= 3
4097 "%s() got multiple values for keyword argument '%U'", func_name, kw_name);
4099 "%s() got multiple values for keyword argument '%s'", func_name,
4100 PyString_AsString(kw_name));
4105 static int __Pyx_ParseOptionalKeywords(
4107 PyObject **argnames[],
4110 Py_ssize_t num_pos_args,
4111 const char* function_name)
4113 PyObject *key = 0, *value = 0;
4116 PyObject*** first_kw_arg = argnames + num_pos_args;
4117 while (PyDict_Next(kwds, &
pos, &key, &value)) {
4118 name = first_kw_arg;
4119 while (*name && (**name != key)) name++;
4121 values[name-argnames] = value;
4124 name = first_kw_arg;
4125 #if PY_MAJOR_VERSION < 3
4126 if (likely(PyString_Check(key))) {
4128 if ((CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**name) == PyString_GET_SIZE(key))
4129 && _PyString_Eq(**name, key)) {
4130 values[name-argnames] = value;
4135 if (*name)
continue;
4137 PyObject*** argname = argnames;
4138 while (argname != first_kw_arg) {
4139 if ((**argname == key) || (
4140 (CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**argname) == PyString_GET_SIZE(key))
4141 && _PyString_Eq(**argname, key))) {
4142 goto arg_passed_twice;
4149 if (likely(PyUnicode_Check(key))) {
4151 int cmp = (**name == key) ? 0 :
4152 #
if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3
4153 (__Pyx_PyUnicode_GET_LENGTH(**name) != __Pyx_PyUnicode_GET_LENGTH(key)) ? 1 :
4155 PyUnicode_Compare(**name, key);
4156 if (cmp < 0 && unlikely(PyErr_Occurred()))
goto bad;
4158 values[name-argnames] = value;
4163 if (*name)
continue;
4165 PyObject*** argname = argnames;
4166 while (argname != first_kw_arg) {
4167 int cmp = (**argname == key) ? 0 :
4168 #
if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3
4169 (__Pyx_PyUnicode_GET_LENGTH(**argname) != __Pyx_PyUnicode_GET_LENGTH(key)) ? 1 :
4171 PyUnicode_Compare(**argname, key);
4172 if (cmp < 0 && unlikely(PyErr_Occurred()))
goto bad;
4173 if (cmp == 0)
goto arg_passed_twice;
4178 goto invalid_keyword_type;
4180 if (unlikely(PyDict_SetItem(kwds2, key, value)))
goto bad;
4182 goto invalid_keyword;
4187 __Pyx_RaiseDoubleKeywordsError(function_name, key);
4189 invalid_keyword_type:
4190 PyErr_Format(PyExc_TypeError,
4191 "%.200s() keywords must be strings", function_name);
4194 PyErr_Format(PyExc_TypeError,
4195 #
if PY_MAJOR_VERSION < 3
4196 "%.200s() got an unexpected keyword argument '%.200s'",
4197 function_name, PyString_AsString(key));
4199 "%s() got an unexpected keyword argument '%U'",
4200 function_name, key);
4207 static int __Pyx__ArgTypeTest(PyObject *obj, PyTypeObject *type,
const char *name,
int exact)
4209 if (unlikely(!type)) {
4210 PyErr_SetString(PyExc_SystemError,
"Missing type object");
4214 #if PY_MAJOR_VERSION == 2
4215 if ((type == &PyBaseString_Type) && likely(__Pyx_PyBaseString_CheckExact(obj)))
return 1;
4219 if (likely(__Pyx_TypeCheck(obj, type)))
return 1;
4221 PyErr_Format(PyExc_TypeError,
4222 "Argument '%.200s' has incorrect type (expected %.200s, got %.200s)",
4223 name, type->tp_name, Py_TYPE(obj)->tp_name);
4228 #if CYTHON_USE_TYPE_SLOTS
4229 static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name) {
4230 PyTypeObject* tp = Py_TYPE(obj);
4231 if (likely(tp->tp_getattro))
4232 return tp->tp_getattro(obj, attr_name);
4233 #if PY_MAJOR_VERSION < 3
4234 if (likely(tp->tp_getattr))
4235 return tp->tp_getattr(obj, PyString_AS_STRING(attr_name));
4237 return PyObject_GetAttr(obj, attr_name);
4242 static PyObject *__Pyx_GetBuiltinName(PyObject *name) {
4243 PyObject* result = __Pyx_PyObject_GetAttrStr(__pyx_b, name);
4244 if (unlikely(!result)) {
4245 PyErr_Format(PyExc_NameError,
4246 #
if PY_MAJOR_VERSION >= 3
4247 "name '%U' is not defined", name);
4249 "name '%.200s' is not defined", PyString_AS_STRING(name));
4256 #if CYTHON_USE_EXC_INFO_STACK
4257 static _PyErr_StackItem *
4258 __Pyx_PyErr_GetTopmostException(PyThreadState *tstate)
4260 _PyErr_StackItem *exc_info = tstate->exc_info;
4261 while ((exc_info->exc_type == NULL || exc_info->exc_type == Py_None) &&
4262 exc_info->previous_item != NULL)
4264 exc_info = exc_info->previous_item;
4271 #if CYTHON_FAST_THREAD_STATE
4272 static CYTHON_INLINE
void __Pyx__ExceptionSave(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) {
4273 #if CYTHON_USE_EXC_INFO_STACK
4274 _PyErr_StackItem *exc_info = __Pyx_PyErr_GetTopmostException(tstate);
4275 *type = exc_info->exc_type;
4276 *value = exc_info->exc_value;
4277 *tb = exc_info->exc_traceback;
4279 *type = tstate->exc_type;
4280 *value = tstate->exc_value;
4281 *tb = tstate->exc_traceback;
4287 static CYTHON_INLINE
void __Pyx__ExceptionReset(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb) {
4288 PyObject *tmp_type, *tmp_value, *tmp_tb;
4289 #if CYTHON_USE_EXC_INFO_STACK
4290 _PyErr_StackItem *exc_info = tstate->exc_info;
4291 tmp_type = exc_info->exc_type;
4292 tmp_value = exc_info->exc_value;
4293 tmp_tb = exc_info->exc_traceback;
4294 exc_info->exc_type = type;
4295 exc_info->exc_value = value;
4296 exc_info->exc_traceback = tb;
4298 tmp_type = tstate->exc_type;
4299 tmp_value = tstate->exc_value;
4300 tmp_tb = tstate->exc_traceback;
4301 tstate->exc_type = type;
4302 tstate->exc_value = value;
4303 tstate->exc_traceback = tb;
4305 Py_XDECREF(tmp_type);
4306 Py_XDECREF(tmp_value);
4312 #if CYTHON_FAST_THREAD_STATE
4313 static int __Pyx_PyErr_ExceptionMatchesTuple(PyObject *exc_type, PyObject *tuple) {
4315 n = PyTuple_GET_SIZE(tuple);
4316 #if PY_MAJOR_VERSION >= 3
4317 for (i=0; i<
n; i++) {
4318 if (exc_type == PyTuple_GET_ITEM(tuple, i))
return 1;
4321 for (i=0; i<
n; i++) {
4322 if (__Pyx_PyErr_GivenExceptionMatches(exc_type, PyTuple_GET_ITEM(tuple, i)))
return 1;
4326 static CYTHON_INLINE
int __Pyx_PyErr_ExceptionMatchesInState(PyThreadState* tstate, PyObject* err) {
4327 PyObject *exc_type = tstate->curexc_type;
4328 if (exc_type == err)
return 1;
4329 if (unlikely(!exc_type))
return 0;
4330 if (unlikely(PyTuple_Check(err)))
4331 return __Pyx_PyErr_ExceptionMatchesTuple(exc_type, err);
4332 return __Pyx_PyErr_GivenExceptionMatches(exc_type, err);
4337 #if CYTHON_FAST_THREAD_STATE
4338 static int __Pyx__GetException(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb)
4340 static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb)
4343 PyObject *local_type, *local_value, *local_tb;
4344 #if CYTHON_FAST_THREAD_STATE
4345 PyObject *tmp_type, *tmp_value, *tmp_tb;
4346 local_type = tstate->curexc_type;
4347 local_value = tstate->curexc_value;
4348 local_tb = tstate->curexc_traceback;
4349 tstate->curexc_type = 0;
4350 tstate->curexc_value = 0;
4351 tstate->curexc_traceback = 0;
4353 PyErr_Fetch(&local_type, &local_value, &local_tb);
4355 PyErr_NormalizeException(&local_type, &local_value, &local_tb);
4356 #if CYTHON_FAST_THREAD_STATE
4357 if (unlikely(tstate->curexc_type))
4359 if (unlikely(PyErr_Occurred()))
4362 #if PY_MAJOR_VERSION >= 3
4364 if (unlikely(PyException_SetTraceback(local_value, local_tb) < 0))
4368 Py_XINCREF(local_tb);
4369 Py_XINCREF(local_type);
4370 Py_XINCREF(local_value);
4372 *value = local_value;
4374 #if CYTHON_FAST_THREAD_STATE
4375 #if CYTHON_USE_EXC_INFO_STACK
4377 _PyErr_StackItem *exc_info = tstate->exc_info;
4378 tmp_type = exc_info->exc_type;
4379 tmp_value = exc_info->exc_value;
4380 tmp_tb = exc_info->exc_traceback;
4381 exc_info->exc_type = local_type;
4382 exc_info->exc_value = local_value;
4383 exc_info->exc_traceback = local_tb;
4386 tmp_type = tstate->exc_type;
4387 tmp_value = tstate->exc_value;
4388 tmp_tb = tstate->exc_traceback;
4389 tstate->exc_type = local_type;
4390 tstate->exc_value = local_value;
4391 tstate->exc_traceback = local_tb;
4393 Py_XDECREF(tmp_type);
4394 Py_XDECREF(tmp_value);
4397 PyErr_SetExcInfo(local_type, local_value, local_tb);
4404 Py_XDECREF(local_type);
4405 Py_XDECREF(local_value);
4406 Py_XDECREF(local_tb);
4411 #if CYTHON_COMPILING_IN_CPYTHON
4412 static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw) {
4414 ternaryfunc call = Py_TYPE(func)->tp_call;
4415 if (unlikely(!call))
4416 return PyObject_Call(func, arg, kw);
4417 if (unlikely(Py_EnterRecursiveCall((
char*)
" while calling a Python object")))
4419 result = (*call)(func, arg, kw);
4420 Py_LeaveRecursiveCall();
4421 if (unlikely(!result) && unlikely(!PyErr_Occurred())) {
4424 "NULL result without error in PyObject_Call");
4431 #if CYTHON_FAST_THREAD_STATE
4432 static CYTHON_INLINE
void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb) {
4433 PyObject *tmp_type, *tmp_value, *tmp_tb;
4434 tmp_type = tstate->curexc_type;
4435 tmp_value = tstate->curexc_value;
4436 tmp_tb = tstate->curexc_traceback;
4437 tstate->curexc_type = type;
4438 tstate->curexc_value = value;
4439 tstate->curexc_traceback = tb;
4440 Py_XDECREF(tmp_type);
4441 Py_XDECREF(tmp_value);
4444 static CYTHON_INLINE
void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) {
4445 *type = tstate->curexc_type;
4446 *value = tstate->curexc_value;
4447 *tb = tstate->curexc_traceback;
4448 tstate->curexc_type = 0;
4449 tstate->curexc_value = 0;
4450 tstate->curexc_traceback = 0;
4455 #if PY_MAJOR_VERSION < 3
4456 static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb,
4457 CYTHON_UNUSED PyObject *cause) {
4458 __Pyx_PyThreadState_declare
4460 if (!value || value == Py_None)
4464 if (!tb || tb == Py_None)
4468 if (!PyTraceBack_Check(tb)) {
4469 PyErr_SetString(PyExc_TypeError,
4470 "raise: arg 3 must be a traceback or None");
4474 if (PyType_Check(type)) {
4475 #if CYTHON_COMPILING_IN_PYPY
4481 PyErr_NormalizeException(&type, &value, &tb);
4484 PyErr_SetString(PyExc_TypeError,
4485 "instance exception may not have a separate value");
4489 type = (PyObject*) Py_TYPE(type);
4491 if (!PyType_IsSubtype((PyTypeObject *)type, (PyTypeObject *)PyExc_BaseException)) {
4492 PyErr_SetString(PyExc_TypeError,
4493 "raise: exception class must be a subclass of BaseException");
4497 __Pyx_PyThreadState_assign
4498 __Pyx_ErrRestore(type, value, tb);
4507 static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause) {
4508 PyObject* owned_instance = NULL;
4509 if (tb == Py_None) {
4511 }
else if (tb && !PyTraceBack_Check(tb)) {
4512 PyErr_SetString(PyExc_TypeError,
4513 "raise: arg 3 must be a traceback or None");
4516 if (value == Py_None)
4518 if (PyExceptionInstance_Check(type)) {
4520 PyErr_SetString(PyExc_TypeError,
4521 "instance exception may not have a separate value");
4525 type = (PyObject*) Py_TYPE(value);
4526 }
else if (PyExceptionClass_Check(type)) {
4527 PyObject *instance_class = NULL;
4528 if (value && PyExceptionInstance_Check(value)) {
4529 instance_class = (PyObject*) Py_TYPE(value);
4530 if (instance_class != type) {
4531 int is_subclass = PyObject_IsSubclass(instance_class, type);
4533 instance_class = NULL;
4534 }
else if (unlikely(is_subclass == -1)) {
4537 type = instance_class;
4541 if (!instance_class) {
4544 args = PyTuple_New(0);
4545 else if (PyTuple_Check(value)) {
4549 args = PyTuple_Pack(1, value);
4552 owned_instance = PyObject_Call(type, args, NULL);
4554 if (!owned_instance)
4556 value = owned_instance;
4557 if (!PyExceptionInstance_Check(value)) {
4558 PyErr_Format(PyExc_TypeError,
4559 "calling %R should have returned an instance of "
4560 "BaseException, not %R",
4561 type, Py_TYPE(value));
4566 PyErr_SetString(PyExc_TypeError,
4567 "raise: exception class must be a subclass of BaseException");
4571 PyObject *fixed_cause;
4572 if (cause == Py_None) {
4574 }
else if (PyExceptionClass_Check(cause)) {
4575 fixed_cause = PyObject_CallObject(cause, NULL);
4576 if (fixed_cause == NULL)
4578 }
else if (PyExceptionInstance_Check(cause)) {
4579 fixed_cause = cause;
4580 Py_INCREF(fixed_cause);
4582 PyErr_SetString(PyExc_TypeError,
4583 "exception causes must derive from "
4587 PyException_SetCause(value, fixed_cause);
4589 PyErr_SetObject(type, value);
4591 #if CYTHON_COMPILING_IN_PYPY
4592 PyObject *tmp_type, *tmp_value, *tmp_tb;
4593 PyErr_Fetch(&tmp_type, &tmp_value, &tmp_tb);
4595 PyErr_Restore(tmp_type, tmp_value, tb);
4598 PyThreadState *tstate = __Pyx_PyThreadState_Current;
4599 PyObject* tmp_tb = tstate->curexc_traceback;
4602 tstate->curexc_traceback = tb;
4608 Py_XDECREF(owned_instance);
4614 #ifndef __PYX_HAVE_RT_ImportType
4615 #define __PYX_HAVE_RT_ImportType
4616 static PyTypeObject *__Pyx_ImportType(PyObject *module,
const char *module_name,
const char *class_name,
4617 size_t size,
enum __Pyx_ImportType_CheckSize check_size)
4619 PyObject *result = 0;
4621 Py_ssize_t basicsize;
4622 #ifdef Py_LIMITED_API
4623 PyObject *py_basicsize;
4625 result = PyObject_GetAttrString(module, class_name);
4628 if (!PyType_Check(result)) {
4629 PyErr_Format(PyExc_TypeError,
4630 "%.200s.%.200s is not a type object",
4631 module_name, class_name);
4634 #ifndef Py_LIMITED_API
4635 basicsize = ((PyTypeObject *)result)->tp_basicsize;
4637 py_basicsize = PyObject_GetAttrString(result,
"__basicsize__");
4640 basicsize = PyLong_AsSsize_t(py_basicsize);
4641 Py_DECREF(py_basicsize);
4643 if (basicsize == (Py_ssize_t)-1 && PyErr_Occurred())
4646 if ((
size_t)basicsize < size) {
4647 PyErr_Format(PyExc_ValueError,
4648 "%.200s.%.200s size changed, may indicate binary incompatibility. "
4649 "Expected %zd from C header, got %zd from PyObject",
4650 module_name, class_name, size, basicsize);
4653 if (check_size == __Pyx_ImportType_CheckSize_Error && (
size_t)basicsize != size) {
4654 PyErr_Format(PyExc_ValueError,
4655 "%.200s.%.200s size changed, may indicate binary incompatibility. "
4656 "Expected %zd from C header, got %zd from PyObject",
4657 module_name, class_name, size, basicsize);
4660 else if (check_size == __Pyx_ImportType_CheckSize_Warn && (
size_t)basicsize > size) {
4661 PyOS_snprintf(warning,
sizeof(warning),
4662 "%s.%s size changed, may indicate binary incompatibility. "
4663 "Expected %zd from C header, got %zd from PyObject",
4664 module_name, class_name, size, basicsize);
4665 if (PyErr_WarnEx(NULL, warning, 0) < 0)
goto bad;
4667 return (PyTypeObject *)result;
4675 static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list,
int level) {
4676 PyObject *empty_list = 0;
4677 PyObject *module = 0;
4678 PyObject *global_dict = 0;
4679 PyObject *empty_dict = 0;
4681 #if PY_MAJOR_VERSION < 3
4682 PyObject *py_import;
4683 py_import = __Pyx_PyObject_GetAttrStr(__pyx_b, __pyx_n_s_import);
4690 empty_list = PyList_New(0);
4695 global_dict = PyModule_GetDict(__pyx_m);
4698 empty_dict = PyDict_New();
4702 #if PY_MAJOR_VERSION >= 3
4704 if ((1) && (strchr(__Pyx_MODULE_NAME,
'.'))) {
4705 module = PyImport_ImportModuleLevelObject(
4706 name, global_dict, empty_dict, list, 1);
4708 if (!PyErr_ExceptionMatches(PyExc_ImportError))
4717 #if PY_MAJOR_VERSION < 3
4718 PyObject *py_level = PyInt_FromLong(level);
4721 module = PyObject_CallFunctionObjArgs(py_import,
4722 name, global_dict, empty_dict, list, py_level, (PyObject *)NULL);
4723 Py_DECREF(py_level);
4725 module = PyImport_ImportModuleLevelObject(
4726 name, global_dict, empty_dict, list, level);
4731 #if PY_MAJOR_VERSION < 3
4732 Py_XDECREF(py_import);
4734 Py_XDECREF(empty_list);
4735 Py_XDECREF(empty_dict);
4740 #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_TYPE_SLOTS
4741 static CYTHON_INLINE PY_UINT64_T __Pyx_get_tp_dict_version(PyObject *obj) {
4742 PyObject *dict = Py_TYPE(obj)->tp_dict;
4743 return likely(dict) ? __PYX_GET_DICT_VERSION(dict) : 0;
4745 static CYTHON_INLINE PY_UINT64_T __Pyx_get_object_dict_version(PyObject *obj) {
4746 PyObject **dictptr = NULL;
4747 Py_ssize_t offset = Py_TYPE(obj)->tp_dictoffset;
4749 #if CYTHON_COMPILING_IN_CPYTHON
4750 dictptr = (likely(offset > 0)) ? (PyObject **) ((
char *)obj + offset) : _PyObject_GetDictPtr(obj);
4752 dictptr = _PyObject_GetDictPtr(obj);
4755 return (dictptr && *dictptr) ? __PYX_GET_DICT_VERSION(*dictptr) : 0;
4757 static CYTHON_INLINE
int __Pyx_object_dict_version_matches(PyObject* obj, PY_UINT64_T tp_dict_version, PY_UINT64_T obj_dict_version) {
4758 PyObject *dict = Py_TYPE(obj)->tp_dict;
4759 if (unlikely(!dict) || unlikely(tp_dict_version != __PYX_GET_DICT_VERSION(dict)))
4761 return obj_dict_version == __Pyx_get_object_dict_version(obj);
4766 #ifndef CYTHON_CLINE_IN_TRACEBACK
4767 static int __Pyx_CLineForTraceback(CYTHON_NCP_UNUSED PyThreadState *tstate,
int c_line) {
4768 PyObject *use_cline;
4769 PyObject *ptype, *pvalue, *ptraceback;
4770 #if CYTHON_COMPILING_IN_CPYTHON
4771 PyObject **cython_runtime_dict;
4773 if (unlikely(!__pyx_cython_runtime)) {
4776 __Pyx_ErrFetchInState(tstate, &ptype, &pvalue, &ptraceback);
4777 #if CYTHON_COMPILING_IN_CPYTHON
4778 cython_runtime_dict = _PyObject_GetDictPtr(__pyx_cython_runtime);
4779 if (likely(cython_runtime_dict)) {
4780 __PYX_PY_DICT_LOOKUP_IF_MODIFIED(
4781 use_cline, *cython_runtime_dict,
4782 __Pyx_PyDict_GetItemStr(*cython_runtime_dict, __pyx_n_s_cline_in_traceback))
4786 PyObject *use_cline_obj = __Pyx_PyObject_GetAttrStr(__pyx_cython_runtime, __pyx_n_s_cline_in_traceback);
4787 if (use_cline_obj) {
4788 use_cline = PyObject_Not(use_cline_obj) ? Py_False : Py_True;
4789 Py_DECREF(use_cline_obj);
4797 (void) PyObject_SetAttr(__pyx_cython_runtime, __pyx_n_s_cline_in_traceback, Py_False);
4799 else if (use_cline == Py_False || (use_cline != Py_True && PyObject_Not(use_cline) != 0)) {
4802 __Pyx_ErrRestoreInState(tstate, ptype, pvalue, ptraceback);
4808 static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries,
int count,
int code_line) {
4809 int start = 0, mid = 0, end = count - 1;
4810 if (end >= 0 && code_line > entries[end].code_line) {
4813 while (start < end) {
4814 mid = start + (end - start) / 2;
4815 if (code_line < entries[mid].code_line) {
4817 }
else if (code_line > entries[mid].code_line) {
4823 if (code_line <= entries[mid].code_line) {
4829 static PyCodeObject *__pyx_find_code_object(
int code_line) {
4830 PyCodeObject* code_object;
4832 if (unlikely(!code_line) || unlikely(!__pyx_code_cache.entries)) {
4835 pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line);
4836 if (unlikely(
pos >= __pyx_code_cache.count) || unlikely(__pyx_code_cache.entries[
pos].code_line != code_line)) {
4839 code_object = __pyx_code_cache.entries[
pos].code_object;
4840 Py_INCREF(code_object);
4843 static void __pyx_insert_code_object(
int code_line, PyCodeObject* code_object) {
4845 __Pyx_CodeObjectCacheEntry* entries = __pyx_code_cache.entries;
4846 if (unlikely(!code_line)) {
4849 if (unlikely(!entries)) {
4850 entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Malloc(64*
sizeof(__Pyx_CodeObjectCacheEntry));
4851 if (likely(entries)) {
4852 __pyx_code_cache.entries = entries;
4853 __pyx_code_cache.max_count = 64;
4854 __pyx_code_cache.count = 1;
4855 entries[0].code_line = code_line;
4856 entries[0].code_object = code_object;
4857 Py_INCREF(code_object);
4861 pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line);
4862 if ((
pos < __pyx_code_cache.count) && unlikely(__pyx_code_cache.entries[
pos].code_line == code_line)) {
4863 PyCodeObject* tmp = entries[
pos].code_object;
4864 entries[
pos].code_object = code_object;
4868 if (__pyx_code_cache.count == __pyx_code_cache.max_count) {
4869 int new_max = __pyx_code_cache.max_count + 64;
4870 entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Realloc(
4871 __pyx_code_cache.entries, ((
size_t)new_max) *
sizeof(__Pyx_CodeObjectCacheEntry));
4872 if (unlikely(!entries)) {
4875 __pyx_code_cache.entries = entries;
4876 __pyx_code_cache.max_count = new_max;
4878 for (i=__pyx_code_cache.count; i>
pos; i--) {
4879 entries[i] = entries[i-1];
4881 entries[
pos].code_line = code_line;
4882 entries[
pos].code_object = code_object;
4883 __pyx_code_cache.count++;
4884 Py_INCREF(code_object);
4888 #include "compile.h"
4889 #include "frameobject.h"
4890 #include "traceback.h"
4891 #if PY_VERSION_HEX >= 0x030b00a6
4892 #ifndef Py_BUILD_CORE
4893 #define Py_BUILD_CORE 1
4895 #include "internal/pycore_frame.h"
4897 static PyCodeObject* __Pyx_CreateCodeObjectForTraceback(
4898 const char *funcname,
int c_line,
4899 int py_line,
const char *filename) {
4900 PyCodeObject *py_code = NULL;
4901 PyObject *py_funcname = NULL;
4902 #if PY_MAJOR_VERSION < 3
4903 PyObject *py_srcfile = NULL;
4904 py_srcfile = PyString_FromString(filename);
4905 if (!py_srcfile)
goto bad;
4908 #if PY_MAJOR_VERSION < 3
4909 py_funcname = PyString_FromFormat(
"%s (%s:%d)", funcname, __pyx_cfilenm, c_line);
4910 if (!py_funcname)
goto bad;
4912 py_funcname = PyUnicode_FromFormat(
"%s (%s:%d)", funcname, __pyx_cfilenm, c_line);
4913 if (!py_funcname)
goto bad;
4914 funcname = PyUnicode_AsUTF8(py_funcname);
4915 if (!funcname)
goto bad;
4919 #if PY_MAJOR_VERSION < 3
4920 py_funcname = PyString_FromString(funcname);
4921 if (!py_funcname)
goto bad;
4924 #if PY_MAJOR_VERSION < 3
4925 py_code = __Pyx_PyCode_New(
4942 Py_DECREF(py_srcfile);
4944 py_code = PyCode_NewEmpty(filename, funcname, py_line);
4946 Py_XDECREF(py_funcname);
4949 Py_XDECREF(py_funcname);
4950 #if PY_MAJOR_VERSION < 3
4951 Py_XDECREF(py_srcfile);
4955 static void __Pyx_AddTraceback(
const char *funcname,
int c_line,
4956 int py_line,
const char *filename) {
4957 PyCodeObject *py_code = 0;
4958 PyFrameObject *py_frame = 0;
4959 PyThreadState *tstate = __Pyx_PyThreadState_Current;
4960 PyObject *ptype, *pvalue, *ptraceback;
4962 c_line = __Pyx_CLineForTraceback(tstate, c_line);
4964 py_code = __pyx_find_code_object(c_line ? -c_line : py_line);
4966 __Pyx_ErrFetchInState(tstate, &ptype, &pvalue, &ptraceback);
4967 py_code = __Pyx_CreateCodeObjectForTraceback(
4968 funcname, c_line, py_line, filename);
4974 Py_XDECREF(ptraceback);
4977 __Pyx_ErrRestoreInState(tstate, ptype, pvalue, ptraceback);
4978 __pyx_insert_code_object(c_line ? -c_line : py_line, py_code);
4980 py_frame = PyFrame_New(
4986 if (!py_frame)
goto bad;
4987 __Pyx_PyFrame_SetLineNumber(py_frame, py_line);
4988 PyTraceBack_Here(py_frame);
4990 Py_XDECREF(py_code);
4991 Py_XDECREF(py_frame);
4995 #define __PYX_VERIFY_RETURN_INT(target_type, func_type, func_value)\
4996 __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 0)
4997 #define __PYX_VERIFY_RETURN_INT_EXC(target_type, func_type, func_value)\
4998 __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 1)
4999 #define __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, exc)\
5001 func_type value = func_value;\
5002 if (sizeof(target_type) < sizeof(func_type)) {\
5003 if (unlikely(value != (func_type) (target_type) value)) {\
5004 func_type zero = 0;\
5005 if (exc && unlikely(value == (func_type)-1 && PyErr_Occurred()))\
5006 return (target_type) -1;\
5007 if (is_unsigned && unlikely(value < zero))\
5008 goto raise_neg_overflow;\
5010 goto raise_overflow;\
5013 return (target_type) value;\
5019 static CYTHON_INLINE __pyx_t_float_complex __pyx_t_float_complex_from_parts(
float x,
float y) {
5020 return ::std::complex< float >(x, y);
5023 static CYTHON_INLINE __pyx_t_float_complex __pyx_t_float_complex_from_parts(
float x,
float y) {
5024 return x + y*(__pyx_t_float_complex)_Complex_I;
5028 static CYTHON_INLINE __pyx_t_float_complex __pyx_t_float_complex_from_parts(
float x,
float y) {
5029 __pyx_t_float_complex
z;
5039 static CYTHON_INLINE
int __Pyx_c_eq_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
5040 return (a.real == b.real) && (a.imag == b.imag);
5042 static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_sum_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
5043 __pyx_t_float_complex
z;
5044 z.real = a.real + b.real;
5045 z.imag = a.imag + b.imag;
5048 static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_diff_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
5049 __pyx_t_float_complex
z;
5050 z.real = a.real - b.real;
5051 z.imag = a.imag - b.imag;
5054 static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_prod_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
5055 __pyx_t_float_complex
z;
5056 z.real = a.real * b.real - a.imag * b.imag;
5057 z.imag = a.real * b.imag + a.imag * b.real;
5061 static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_quot_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
5063 return __pyx_t_float_complex_from_parts(a.real / b.real, a.imag / b.real);
5064 }
else if (fabsf(b.real) >= fabsf(b.imag)) {
5065 if (b.real == 0 && b.imag == 0) {
5066 return __pyx_t_float_complex_from_parts(a.real / b.real, a.imag / b.imag);
5068 float r = b.imag / b.real;
5069 float s = (float)(1.0) / (b.real + b.imag *
r);
5070 return __pyx_t_float_complex_from_parts(
5071 (a.real + a.imag *
r) *
s, (a.imag - a.real *
r) *
s);
5074 float r = b.real / b.imag;
5075 float s = (float)(1.0) / (b.imag + b.real *
r);
5076 return __pyx_t_float_complex_from_parts(
5077 (a.real *
r + a.imag) *
s, (a.imag *
r - a.real) *
s);
5081 static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_quot_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
5083 return __pyx_t_float_complex_from_parts(a.real / b.real, a.imag / b.real);
5085 float denom = b.real * b.real + b.imag * b.imag;
5086 return __pyx_t_float_complex_from_parts(
5087 (a.real * b.real + a.imag * b.imag) / denom,
5088 (a.imag * b.real - a.real * b.imag) / denom);
5092 static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_neg_float(__pyx_t_float_complex a) {
5093 __pyx_t_float_complex
z;
5098 static CYTHON_INLINE
int __Pyx_c_is_zero_float(__pyx_t_float_complex a) {
5099 return (a.real == 0) && (a.imag == 0);
5101 static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_conj_float(__pyx_t_float_complex a) {
5102 __pyx_t_float_complex
z;
5108 static CYTHON_INLINE
float __Pyx_c_abs_float(__pyx_t_float_complex
z) {
5109 #if !defined(HAVE_HYPOT) || defined(_MSC_VER)
5110 return sqrtf(
z.real*
z.real +
z.imag*
z.imag);
5112 return hypotf(
z.real,
z.imag);
5115 static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_pow_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
5116 __pyx_t_float_complex
z;
5117 float r, lnr, theta, z_r, z_theta;
5118 if (b.imag == 0 && b.real == (
int)b.real) {
5120 float denom = a.real * a.real + a.imag * a.imag;
5121 a.real = a.real / denom;
5122 a.imag = -a.imag / denom;
5125 switch ((
int)b.real) {
5133 return __Pyx_c_prod_float(a, a);
5135 z = __Pyx_c_prod_float(a, a);
5136 return __Pyx_c_prod_float(
z, a);
5138 z = __Pyx_c_prod_float(a, a);
5139 return __Pyx_c_prod_float(
z,
z);
5145 }
else if (b.imag == 0) {
5146 z.real = powf(a.real, b.real);
5149 }
else if (a.real > 0) {
5154 theta = atan2f(0.0, -1.0);
5157 r = __Pyx_c_abs_float(a);
5158 theta = atan2f(a.imag, a.real);
5161 z_r = expf(lnr * b.real - theta * b.imag);
5162 z_theta = theta * b.real + lnr * b.imag;
5163 z.real = z_r * cosf(z_theta);
5164 z.imag = z_r * sinf(z_theta);
5173 static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(
double x,
double y) {
5174 return ::std::complex< double >(x, y);
5177 static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(
double x,
double y) {
5178 return x + y*(__pyx_t_double_complex)_Complex_I;
5182 static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(
double x,
double y) {
5183 __pyx_t_double_complex
z;
5193 static CYTHON_INLINE
int __Pyx_c_eq_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
5194 return (a.real == b.real) && (a.imag == b.imag);
5196 static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_sum_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
5197 __pyx_t_double_complex
z;
5198 z.real = a.real + b.real;
5199 z.imag = a.imag + b.imag;
5202 static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_diff_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
5203 __pyx_t_double_complex
z;
5204 z.real = a.real - b.real;
5205 z.imag = a.imag - b.imag;
5208 static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_prod_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
5209 __pyx_t_double_complex
z;
5210 z.real = a.real * b.real - a.imag * b.imag;
5211 z.imag = a.real * b.imag + a.imag * b.real;
5215 static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_quot_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
5217 return __pyx_t_double_complex_from_parts(a.real / b.real, a.imag / b.real);
5218 }
else if (fabs(b.real) >= fabs(b.imag)) {
5219 if (b.real == 0 && b.imag == 0) {
5220 return __pyx_t_double_complex_from_parts(a.real / b.real, a.imag / b.imag);
5222 double r = b.imag / b.real;
5223 double s = (double)(1.0) / (b.real + b.imag *
r);
5224 return __pyx_t_double_complex_from_parts(
5225 (a.real + a.imag *
r) *
s, (a.imag - a.real *
r) *
s);
5228 double r = b.real / b.imag;
5229 double s = (double)(1.0) / (b.imag + b.real *
r);
5230 return __pyx_t_double_complex_from_parts(
5231 (a.real *
r + a.imag) *
s, (a.imag *
r - a.real) *
s);
5235 static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_quot_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
5237 return __pyx_t_double_complex_from_parts(a.real / b.real, a.imag / b.real);
5239 double denom = b.real * b.real + b.imag * b.imag;
5240 return __pyx_t_double_complex_from_parts(
5241 (a.real * b.real + a.imag * b.imag) / denom,
5242 (a.imag * b.real - a.real * b.imag) / denom);
5246 static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_neg_double(__pyx_t_double_complex a) {
5247 __pyx_t_double_complex
z;
5252 static CYTHON_INLINE
int __Pyx_c_is_zero_double(__pyx_t_double_complex a) {
5253 return (a.real == 0) && (a.imag == 0);
5255 static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_conj_double(__pyx_t_double_complex a) {
5256 __pyx_t_double_complex
z;
5262 static CYTHON_INLINE
double __Pyx_c_abs_double(__pyx_t_double_complex
z) {
5263 #if !defined(HAVE_HYPOT) || defined(_MSC_VER)
5264 return sqrt(
z.real*
z.real +
z.imag*
z.imag);
5266 return hypot(
z.real,
z.imag);
5269 static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_pow_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
5270 __pyx_t_double_complex
z;
5271 double r, lnr, theta, z_r, z_theta;
5272 if (b.imag == 0 && b.real == (
int)b.real) {
5274 double denom = a.real * a.real + a.imag * a.imag;
5275 a.real = a.real / denom;
5276 a.imag = -a.imag / denom;
5279 switch ((
int)b.real) {
5287 return __Pyx_c_prod_double(a, a);
5289 z = __Pyx_c_prod_double(a, a);
5290 return __Pyx_c_prod_double(
z, a);
5292 z = __Pyx_c_prod_double(a, a);
5293 return __Pyx_c_prod_double(
z,
z);
5299 }
else if (b.imag == 0) {
5300 z.real = pow(a.real, b.real);
5303 }
else if (a.real > 0) {
5308 theta = atan2(0.0, -1.0);
5311 r = __Pyx_c_abs_double(a);
5312 theta = atan2(a.imag, a.real);
5315 z_r = exp(lnr * b.real - theta * b.imag);
5316 z_theta = theta * b.real + lnr * b.imag;
5317 z.real = z_r * cos(z_theta);
5318 z.imag = z_r * sin(z_theta);
5325 static CYTHON_INLINE
int __Pyx_PyInt_As_int(PyObject *x) {
5326 #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
5327 #pragma GCC diagnostic push
5328 #pragma GCC diagnostic ignored "-Wconversion"
5330 const int neg_one = (int) -1, const_zero = (
int) 0;
5331 #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
5332 #pragma GCC diagnostic pop
5334 const int is_unsigned = neg_one > const_zero;
5335 #if PY_MAJOR_VERSION < 3
5336 if (likely(PyInt_Check(x))) {
5337 if (
sizeof(
int) <
sizeof(long)) {
5338 __PYX_VERIFY_RETURN_INT(
int,
long, PyInt_AS_LONG(x))
5340 long val = PyInt_AS_LONG(x);
5341 if (is_unsigned && unlikely(val < 0)) {
5342 goto raise_neg_overflow;
5348 if (likely(PyLong_Check(x))) {
5350 #if CYTHON_USE_PYLONG_INTERNALS
5351 const digit* digits = ((PyLongObject*)x)->ob_digit;
5352 switch (Py_SIZE(x)) {
5353 case 0:
return (
int) 0;
5354 case 1: __PYX_VERIFY_RETURN_INT(
int, digit, digits[0])
5356 if (8 *
sizeof(
int) > 1 * PyLong_SHIFT) {
5357 if (8 *
sizeof(
unsigned long) > 2 * PyLong_SHIFT) {
5358 __PYX_VERIFY_RETURN_INT(
int,
unsigned long, (((((
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
5359 }
else if (8 *
sizeof(
int) >= 2 * PyLong_SHIFT) {
5360 return (
int) (((((int)digits[1]) << PyLong_SHIFT) | (
int)digits[0]));
5365 if (8 *
sizeof(
int) > 2 * PyLong_SHIFT) {
5366 if (8 *
sizeof(
unsigned long) > 3 * PyLong_SHIFT) {
5367 __PYX_VERIFY_RETURN_INT(
int,
unsigned long, (((((((
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
5368 }
else if (8 *
sizeof(
int) >= 3 * PyLong_SHIFT) {
5369 return (
int) (((((((int)digits[2]) << PyLong_SHIFT) | (
int)digits[1]) << PyLong_SHIFT) | (int)digits[0]));
5374 if (8 *
sizeof(
int) > 3 * PyLong_SHIFT) {
5375 if (8 *
sizeof(
unsigned long) > 4 * PyLong_SHIFT) {
5376 __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])))
5377 }
else if (8 *
sizeof(
int) >= 4 * PyLong_SHIFT) {
5378 return (
int) (((((((((int)digits[3]) << PyLong_SHIFT) | (
int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (
int)digits[0]));
5384 #if CYTHON_COMPILING_IN_CPYTHON
5385 if (unlikely(Py_SIZE(x) < 0)) {
5386 goto raise_neg_overflow;
5390 int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
5391 if (unlikely(result < 0))
5393 if (unlikely(result == 1))
5394 goto raise_neg_overflow;
5397 if (
sizeof(
int) <=
sizeof(
unsigned long)) {
5398 __PYX_VERIFY_RETURN_INT_EXC(
int,
unsigned long, PyLong_AsUnsignedLong(x))
5399 #ifdef HAVE_LONG_LONG
5400 }
else if (
sizeof(
int) <=
sizeof(
unsigned PY_LONG_LONG)) {
5401 __PYX_VERIFY_RETURN_INT_EXC(
int,
unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
5405 #if CYTHON_USE_PYLONG_INTERNALS
5406 const digit* digits = ((PyLongObject*)x)->ob_digit;
5407 switch (Py_SIZE(x)) {
5408 case 0:
return (
int) 0;
5409 case -1: __PYX_VERIFY_RETURN_INT(
int, sdigit, (sdigit) (-(sdigit)digits[0]))
5410 case 1: __PYX_VERIFY_RETURN_INT(
int, digit, +digits[0])
5412 if (8 *
sizeof(
int) - 1 > 1 * PyLong_SHIFT) {
5413 if (8 *
sizeof(
unsigned long) > 2 * PyLong_SHIFT) {
5414 __PYX_VERIFY_RETURN_INT(
int,
long, -(
long) (((((
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
5415 }
else if (8 *
sizeof(
int) - 1 > 2 * PyLong_SHIFT) {
5416 return (
int) (((int)-1)*(((((int)digits[1]) << PyLong_SHIFT) | (
int)digits[0])));
5421 if (8 *
sizeof(
int) > 1 * PyLong_SHIFT) {
5422 if (8 *
sizeof(
unsigned long) > 2 * PyLong_SHIFT) {
5423 __PYX_VERIFY_RETURN_INT(
int,
unsigned long, (((((
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
5424 }
else if (8 *
sizeof(
int) - 1 > 2 * PyLong_SHIFT) {
5425 return (
int) ((((((int)digits[1]) << PyLong_SHIFT) | (
int)digits[0])));
5430 if (8 *
sizeof(
int) - 1 > 2 * PyLong_SHIFT) {
5431 if (8 *
sizeof(
unsigned long) > 3 * PyLong_SHIFT) {
5432 __PYX_VERIFY_RETURN_INT(
int,
long, -(
long) (((((((
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
5433 }
else if (8 *
sizeof(
int) - 1 > 3 * PyLong_SHIFT) {
5434 return (
int) (((int)-1)*(((((((int)digits[2]) << PyLong_SHIFT) | (
int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
5439 if (8 *
sizeof(
int) > 2 * PyLong_SHIFT) {
5440 if (8 *
sizeof(
unsigned long) > 3 * PyLong_SHIFT) {
5441 __PYX_VERIFY_RETURN_INT(
int,
unsigned long, (((((((
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
5442 }
else if (8 *
sizeof(
int) - 1 > 3 * PyLong_SHIFT) {
5443 return (
int) ((((((((int)digits[2]) << PyLong_SHIFT) | (
int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
5448 if (8 *
sizeof(
int) - 1 > 3 * PyLong_SHIFT) {
5449 if (8 *
sizeof(
unsigned long) > 4 * PyLong_SHIFT) {
5450 __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])))
5451 }
else if (8 *
sizeof(
int) - 1 > 4 * PyLong_SHIFT) {
5452 return (
int) (((int)-1)*(((((((((int)digits[3]) << PyLong_SHIFT) | (
int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (
int)digits[0])));
5457 if (8 *
sizeof(
int) > 3 * PyLong_SHIFT) {
5458 if (8 *
sizeof(
unsigned long) > 4 * PyLong_SHIFT) {
5459 __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])))
5460 }
else if (8 *
sizeof(
int) - 1 > 4 * PyLong_SHIFT) {
5461 return (
int) ((((((((((int)digits[3]) << PyLong_SHIFT) | (
int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (
int)digits[0])));
5467 if (
sizeof(
int) <=
sizeof(long)) {
5468 __PYX_VERIFY_RETURN_INT_EXC(
int,
long, PyLong_AsLong(x))
5469 #ifdef HAVE_LONG_LONG
5470 }
else if (
sizeof(
int) <=
sizeof(PY_LONG_LONG)) {
5471 __PYX_VERIFY_RETURN_INT_EXC(
int, PY_LONG_LONG, PyLong_AsLongLong(x))
5476 #if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray)
5477 PyErr_SetString(PyExc_RuntimeError,
5478 "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers");
5481 PyObject *
v = __Pyx_PyNumber_IntOrLong(x);
5482 #if PY_MAJOR_VERSION < 3
5483 if (likely(
v) && !PyLong_Check(
v)) {
5485 v = PyNumber_Long(tmp);
5490 int one = 1;
int is_little = (int)*(
unsigned char *)&one;
5491 unsigned char *bytes = (
unsigned char *)&val;
5492 int ret = _PyLong_AsByteArray((PyLongObject *)
v,
5494 is_little, !is_unsigned);
5504 PyObject *tmp = __Pyx_PyNumber_IntOrLong(x);
5505 if (!tmp)
return (
int) -1;
5506 val = __Pyx_PyInt_As_int(tmp);
5511 PyErr_SetString(PyExc_OverflowError,
5512 "value too large to convert to int");
5515 PyErr_SetString(PyExc_OverflowError,
5516 "can't convert negative value to int");
5521 static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(
int value) {
5522 #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
5523 #pragma GCC diagnostic push
5524 #pragma GCC diagnostic ignored "-Wconversion"
5526 const int neg_one = (int) -1, const_zero = (
int) 0;
5527 #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
5528 #pragma GCC diagnostic pop
5530 const int is_unsigned = neg_one > const_zero;
5532 if (
sizeof(
int) <
sizeof(long)) {
5533 return PyInt_FromLong((
long) value);
5534 }
else if (
sizeof(
int) <=
sizeof(
unsigned long)) {
5535 return PyLong_FromUnsignedLong((
unsigned long) value);
5536 #ifdef HAVE_LONG_LONG
5537 }
else if (
sizeof(
int) <=
sizeof(
unsigned PY_LONG_LONG)) {
5538 return PyLong_FromUnsignedLongLong((
unsigned PY_LONG_LONG) value);
5542 if (
sizeof(
int) <=
sizeof(
long)) {
5543 return PyInt_FromLong((
long) value);
5544 #ifdef HAVE_LONG_LONG
5545 }
else if (
sizeof(
int) <=
sizeof(PY_LONG_LONG)) {
5546 return PyLong_FromLongLong((PY_LONG_LONG) value);
5551 int one = 1;
int little = (int)*(
unsigned char *)&one;
5552 unsigned char *bytes = (
unsigned char *)&value;
5553 return _PyLong_FromByteArray(bytes,
sizeof(
int),
5554 little, !is_unsigned);
5559 static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(
long value) {
5560 #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
5561 #pragma GCC diagnostic push
5562 #pragma GCC diagnostic ignored "-Wconversion"
5564 const long neg_one = (long) -1, const_zero = (
long) 0;
5565 #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
5566 #pragma GCC diagnostic pop
5568 const int is_unsigned = neg_one > const_zero;
5570 if (
sizeof(
long) <
sizeof(long)) {
5571 return PyInt_FromLong((
long) value);
5572 }
else if (
sizeof(
long) <=
sizeof(
unsigned long)) {
5573 return PyLong_FromUnsignedLong((
unsigned long) value);
5574 #ifdef HAVE_LONG_LONG
5575 }
else if (
sizeof(
long) <=
sizeof(
unsigned PY_LONG_LONG)) {
5576 return PyLong_FromUnsignedLongLong((
unsigned PY_LONG_LONG) value);
5580 if (
sizeof(
long) <=
sizeof(
long)) {
5581 return PyInt_FromLong((
long) value);
5582 #ifdef HAVE_LONG_LONG
5583 }
else if (
sizeof(
long) <=
sizeof(PY_LONG_LONG)) {
5584 return PyLong_FromLongLong((PY_LONG_LONG) value);
5589 int one = 1;
int little = (int)*(
unsigned char *)&one;
5590 unsigned char *bytes = (
unsigned char *)&value;
5591 return _PyLong_FromByteArray(bytes,
sizeof(
long),
5592 little, !is_unsigned);
5597 static CYTHON_INLINE
long __Pyx_PyInt_As_long(PyObject *x) {
5598 #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
5599 #pragma GCC diagnostic push
5600 #pragma GCC diagnostic ignored "-Wconversion"
5602 const long neg_one = (long) -1, const_zero = (
long) 0;
5603 #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
5604 #pragma GCC diagnostic pop
5606 const int is_unsigned = neg_one > const_zero;
5607 #if PY_MAJOR_VERSION < 3
5608 if (likely(PyInt_Check(x))) {
5609 if (
sizeof(
long) <
sizeof(long)) {
5610 __PYX_VERIFY_RETURN_INT(
long,
long, PyInt_AS_LONG(x))
5612 long val = PyInt_AS_LONG(x);
5613 if (is_unsigned && unlikely(val < 0)) {
5614 goto raise_neg_overflow;
5620 if (likely(PyLong_Check(x))) {
5622 #if CYTHON_USE_PYLONG_INTERNALS
5623 const digit* digits = ((PyLongObject*)x)->ob_digit;
5624 switch (Py_SIZE(x)) {
5625 case 0:
return (
long) 0;
5626 case 1: __PYX_VERIFY_RETURN_INT(
long, digit, digits[0])
5628 if (8 *
sizeof(
long) > 1 * PyLong_SHIFT) {
5629 if (8 *
sizeof(
unsigned long) > 2 * PyLong_SHIFT) {
5630 __PYX_VERIFY_RETURN_INT(
long,
unsigned long, (((((
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
5631 }
else if (8 *
sizeof(
long) >= 2 * PyLong_SHIFT) {
5632 return (
long) (((((long)digits[1]) << PyLong_SHIFT) | (
long)digits[0]));
5637 if (8 *
sizeof(
long) > 2 * PyLong_SHIFT) {
5638 if (8 *
sizeof(
unsigned long) > 3 * PyLong_SHIFT) {
5639 __PYX_VERIFY_RETURN_INT(
long,
unsigned long, (((((((
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
5640 }
else if (8 *
sizeof(
long) >= 3 * PyLong_SHIFT) {
5641 return (
long) (((((((long)digits[2]) << PyLong_SHIFT) | (
long)digits[1]) << PyLong_SHIFT) | (long)digits[0]));
5646 if (8 *
sizeof(
long) > 3 * PyLong_SHIFT) {
5647 if (8 *
sizeof(
unsigned long) > 4 * PyLong_SHIFT) {
5648 __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])))
5649 }
else if (8 *
sizeof(
long) >= 4 * PyLong_SHIFT) {
5650 return (
long) (((((((((long)digits[3]) << PyLong_SHIFT) | (
long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (
long)digits[0]));
5656 #if CYTHON_COMPILING_IN_CPYTHON
5657 if (unlikely(Py_SIZE(x) < 0)) {
5658 goto raise_neg_overflow;
5662 int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
5663 if (unlikely(result < 0))
5665 if (unlikely(result == 1))
5666 goto raise_neg_overflow;
5669 if (
sizeof(
long) <=
sizeof(
unsigned long)) {
5670 __PYX_VERIFY_RETURN_INT_EXC(
long,
unsigned long, PyLong_AsUnsignedLong(x))
5671 #ifdef HAVE_LONG_LONG
5672 }
else if (
sizeof(
long) <=
sizeof(
unsigned PY_LONG_LONG)) {
5673 __PYX_VERIFY_RETURN_INT_EXC(
long,
unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
5677 #if CYTHON_USE_PYLONG_INTERNALS
5678 const digit* digits = ((PyLongObject*)x)->ob_digit;
5679 switch (Py_SIZE(x)) {
5680 case 0:
return (
long) 0;
5681 case -1: __PYX_VERIFY_RETURN_INT(
long, sdigit, (sdigit) (-(sdigit)digits[0]))
5682 case 1: __PYX_VERIFY_RETURN_INT(
long, digit, +digits[0])
5684 if (8 *
sizeof(
long) - 1 > 1 * PyLong_SHIFT) {
5685 if (8 *
sizeof(
unsigned long) > 2 * PyLong_SHIFT) {
5686 __PYX_VERIFY_RETURN_INT(
long,
long, -(
long) (((((
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
5687 }
else if (8 *
sizeof(
long) - 1 > 2 * PyLong_SHIFT) {
5688 return (
long) (((long)-1)*(((((long)digits[1]) << PyLong_SHIFT) | (
long)digits[0])));
5693 if (8 *
sizeof(
long) > 1 * PyLong_SHIFT) {
5694 if (8 *
sizeof(
unsigned long) > 2 * PyLong_SHIFT) {
5695 __PYX_VERIFY_RETURN_INT(
long,
unsigned long, (((((
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
5696 }
else if (8 *
sizeof(
long) - 1 > 2 * PyLong_SHIFT) {
5697 return (
long) ((((((long)digits[1]) << PyLong_SHIFT) | (
long)digits[0])));
5702 if (8 *
sizeof(
long) - 1 > 2 * PyLong_SHIFT) {
5703 if (8 *
sizeof(
unsigned long) > 3 * PyLong_SHIFT) {
5704 __PYX_VERIFY_RETURN_INT(
long,
long, -(
long) (((((((
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
5705 }
else if (8 *
sizeof(
long) - 1 > 3 * PyLong_SHIFT) {
5706 return (
long) (((long)-1)*(((((((long)digits[2]) << PyLong_SHIFT) | (
long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
5711 if (8 *
sizeof(
long) > 2 * PyLong_SHIFT) {
5712 if (8 *
sizeof(
unsigned long) > 3 * PyLong_SHIFT) {
5713 __PYX_VERIFY_RETURN_INT(
long,
unsigned long, (((((((
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
5714 }
else if (8 *
sizeof(
long) - 1 > 3 * PyLong_SHIFT) {
5715 return (
long) ((((((((long)digits[2]) << PyLong_SHIFT) | (
long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
5720 if (8 *
sizeof(
long) - 1 > 3 * PyLong_SHIFT) {
5721 if (8 *
sizeof(
unsigned long) > 4 * PyLong_SHIFT) {
5722 __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])))
5723 }
else if (8 *
sizeof(
long) - 1 > 4 * PyLong_SHIFT) {
5724 return (
long) (((long)-1)*(((((((((long)digits[3]) << PyLong_SHIFT) | (
long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (
long)digits[0])));
5729 if (8 *
sizeof(
long) > 3 * PyLong_SHIFT) {
5730 if (8 *
sizeof(
unsigned long) > 4 * PyLong_SHIFT) {
5731 __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])))
5732 }
else if (8 *
sizeof(
long) - 1 > 4 * PyLong_SHIFT) {
5733 return (
long) ((((((((((long)digits[3]) << PyLong_SHIFT) | (
long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (
long)digits[0])));
5739 if (
sizeof(
long) <=
sizeof(long)) {
5740 __PYX_VERIFY_RETURN_INT_EXC(
long,
long, PyLong_AsLong(x))
5741 #ifdef HAVE_LONG_LONG
5742 }
else if (
sizeof(
long) <=
sizeof(PY_LONG_LONG)) {
5743 __PYX_VERIFY_RETURN_INT_EXC(
long, PY_LONG_LONG, PyLong_AsLongLong(x))
5748 #if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray)
5749 PyErr_SetString(PyExc_RuntimeError,
5750 "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers");
5753 PyObject *
v = __Pyx_PyNumber_IntOrLong(x);
5754 #if PY_MAJOR_VERSION < 3
5755 if (likely(
v) && !PyLong_Check(
v)) {
5757 v = PyNumber_Long(tmp);
5762 int one = 1;
int is_little = (int)*(
unsigned char *)&one;
5763 unsigned char *bytes = (
unsigned char *)&val;
5764 int ret = _PyLong_AsByteArray((PyLongObject *)
v,
5766 is_little, !is_unsigned);
5776 PyObject *tmp = __Pyx_PyNumber_IntOrLong(x);
5777 if (!tmp)
return (
long) -1;
5778 val = __Pyx_PyInt_As_long(tmp);
5783 PyErr_SetString(PyExc_OverflowError,
5784 "value too large to convert to long");
5787 PyErr_SetString(PyExc_OverflowError,
5788 "can't convert negative value to long");
5793 #if CYTHON_COMPILING_IN_CPYTHON
5794 static int __Pyx_InBases(PyTypeObject *a, PyTypeObject *b) {
5800 return b == &PyBaseObject_Type;
5802 static CYTHON_INLINE
int __Pyx_IsSubtype(PyTypeObject *a, PyTypeObject *b) {
5804 if (a == b)
return 1;
5808 n = PyTuple_GET_SIZE(mro);
5809 for (i = 0; i <
n; i++) {
5810 if (PyTuple_GET_ITEM(mro, i) == (PyObject *)b)
5815 return __Pyx_InBases(a, b);
5817 #if PY_MAJOR_VERSION == 2
5818 static int __Pyx_inner_PyErr_GivenExceptionMatches2(PyObject *err, PyObject* exc_type1, PyObject* exc_type2) {
5819 PyObject *exception, *value, *tb;
5821 __Pyx_PyThreadState_declare
5822 __Pyx_PyThreadState_assign
5823 __Pyx_ErrFetch(&exception, &value, &tb);
5824 res = exc_type1 ? PyObject_IsSubclass(err, exc_type1) : 0;
5825 if (unlikely(res == -1)) {
5826 PyErr_WriteUnraisable(err);
5830 res = PyObject_IsSubclass(err, exc_type2);
5831 if (unlikely(res == -1)) {
5832 PyErr_WriteUnraisable(err);
5836 __Pyx_ErrRestore(exception, value, tb);
5840 static CYTHON_INLINE
int __Pyx_inner_PyErr_GivenExceptionMatches2(PyObject *err, PyObject* exc_type1, PyObject *exc_type2) {
5841 int res = exc_type1 ? __Pyx_IsSubtype((PyTypeObject*)err, (PyTypeObject*)exc_type1) : 0;
5843 res = __Pyx_IsSubtype((PyTypeObject*)err, (PyTypeObject*)exc_type2);
5848 static int __Pyx_PyErr_GivenExceptionMatchesTuple(PyObject *exc_type, PyObject *tuple) {
5850 assert(PyExceptionClass_Check(exc_type));
5851 n = PyTuple_GET_SIZE(tuple);
5852 #if PY_MAJOR_VERSION >= 3
5853 for (i=0; i<
n; i++) {
5854 if (exc_type == PyTuple_GET_ITEM(tuple, i))
return 1;
5857 for (i=0; i<
n; i++) {
5858 PyObject *t = PyTuple_GET_ITEM(tuple, i);
5859 #if PY_MAJOR_VERSION < 3
5860 if (likely(exc_type == t))
return 1;
5862 if (likely(PyExceptionClass_Check(t))) {
5863 if (__Pyx_inner_PyErr_GivenExceptionMatches2(exc_type, NULL, t))
return 1;
5869 static CYTHON_INLINE
int __Pyx_PyErr_GivenExceptionMatches(PyObject *err, PyObject* exc_type) {
5870 if (likely(err == exc_type))
return 1;
5871 if (likely(PyExceptionClass_Check(err))) {
5872 if (likely(PyExceptionClass_Check(exc_type))) {
5873 return __Pyx_inner_PyErr_GivenExceptionMatches2(err, NULL, exc_type);
5874 }
else if (likely(PyTuple_Check(exc_type))) {
5875 return __Pyx_PyErr_GivenExceptionMatchesTuple(err, exc_type);
5879 return PyErr_GivenExceptionMatches(err, exc_type);
5881 static CYTHON_INLINE
int __Pyx_PyErr_GivenExceptionMatches2(PyObject *err, PyObject *exc_type1, PyObject *exc_type2) {
5882 assert(PyExceptionClass_Check(exc_type1));
5883 assert(PyExceptionClass_Check(exc_type2));
5884 if (likely(err == exc_type1 || err == exc_type2))
return 1;
5885 if (likely(PyExceptionClass_Check(err))) {
5886 return __Pyx_inner_PyErr_GivenExceptionMatches2(err, exc_type1, exc_type2);
5888 return (PyErr_GivenExceptionMatches(err, exc_type1) || PyErr_GivenExceptionMatches(err, exc_type2));
5893 static int __Pyx_check_binary_version(
void) {
5895 int same=1, i, found_dot;
5896 const char* rt_from_call = Py_GetVersion();
5897 PyOS_snprintf(ctversion, 5,
"%d.%d", PY_MAJOR_VERSION, PY_MINOR_VERSION);
5899 for (i = 0; i < 4; i++) {
5900 if (!ctversion[i]) {
5901 same = (rt_from_call[i] <
'0' || rt_from_call[i] >
'9');
5904 if (rt_from_call[i] != ctversion[i]) {
5910 char rtversion[5] = {
'\0'};
5912 for (i=0; i<4; ++i) {
5913 if (rt_from_call[i] ==
'.') {
5914 if (found_dot)
break;
5916 }
else if (rt_from_call[i] <
'0' || rt_from_call[i] >
'9') {
5919 rtversion[i] = rt_from_call[i];
5921 PyOS_snprintf(message,
sizeof(message),
5922 "compiletime version %s of module '%.100s' "
5923 "does not match runtime version %s",
5924 ctversion, __Pyx_MODULE_NAME, rtversion);
5925 return PyErr_WarnEx(NULL, message, 1);
5931 static int __Pyx_InitStrings(__Pyx_StringTabEntry *t) {
5933 #if PY_MAJOR_VERSION < 3
5934 if (t->is_unicode) {
5935 *t->p = PyUnicode_DecodeUTF8(t->s, t->n - 1, NULL);
5936 }
else if (t->intern) {
5937 *t->p = PyString_InternFromString(t->s);
5939 *t->p = PyString_FromStringAndSize(t->s, t->n - 1);
5942 if (t->is_unicode | t->is_str) {
5944 *t->p = PyUnicode_InternFromString(t->s);
5945 }
else if (t->encoding) {
5946 *t->p = PyUnicode_Decode(t->s, t->n - 1, t->encoding, NULL);
5948 *t->p = PyUnicode_FromStringAndSize(t->s, t->n - 1);
5951 *t->p = PyBytes_FromStringAndSize(t->s, t->n - 1);
5956 if (PyObject_Hash(*t->p) == -1)
5963 static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(
const char* c_str) {
5964 return __Pyx_PyUnicode_FromStringAndSize(c_str, (Py_ssize_t)strlen(c_str));
5966 static CYTHON_INLINE
const char* __Pyx_PyObject_AsString(PyObject* o) {
5968 return __Pyx_PyObject_AsStringAndSize(o, &ignore);
5970 #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT
5971 #if !CYTHON_PEP393_ENABLED
5972 static const char* __Pyx_PyUnicode_AsStringAndSize(PyObject* o, Py_ssize_t *length) {
5974 PyObject* defenc = _PyUnicode_AsDefaultEncodedString(o, NULL);
5975 if (!defenc)
return NULL;
5976 defenc_c = PyBytes_AS_STRING(defenc);
5977 #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
5979 char* end = defenc_c + PyBytes_GET_SIZE(defenc);
5981 for (
c = defenc_c;
c < end;
c++) {
5982 if ((
unsigned char) (*
c) >= 128) {
5983 PyUnicode_AsASCIIString(o);
5989 *length = PyBytes_GET_SIZE(defenc);
5993 static CYTHON_INLINE
const char* __Pyx_PyUnicode_AsStringAndSize(PyObject* o, Py_ssize_t *length) {
5994 if (unlikely(__Pyx_PyUnicode_READY(o) == -1))
return NULL;
5995 #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
5996 if (likely(PyUnicode_IS_ASCII(o))) {
5997 *length = PyUnicode_GET_LENGTH(o);
5998 return PyUnicode_AsUTF8(o);
6000 PyUnicode_AsASCIIString(o);
6004 return PyUnicode_AsUTF8AndSize(o, length);
6009 static CYTHON_INLINE
const char* __Pyx_PyObject_AsStringAndSize(PyObject* o, Py_ssize_t *length) {
6010 #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT
6012 #
if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
6013 __Pyx_sys_getdefaultencoding_not_ascii &&
6015 PyUnicode_Check(o)) {
6016 return __Pyx_PyUnicode_AsStringAndSize(o, length);
6019 #if (!CYTHON_COMPILING_IN_PYPY) || (defined(PyByteArray_AS_STRING) && defined(PyByteArray_GET_SIZE))
6020 if (PyByteArray_Check(o)) {
6021 *length = PyByteArray_GET_SIZE(o);
6022 return PyByteArray_AS_STRING(o);
6027 int r = PyBytes_AsStringAndSize(o, &result, length);
6028 if (unlikely(
r < 0)) {
6035 static CYTHON_INLINE
int __Pyx_PyObject_IsTrue(PyObject* x) {
6036 int is_true = x == Py_True;
6037 if (is_true | (x == Py_False) | (x == Py_None))
return is_true;
6038 else return PyObject_IsTrue(x);
6040 static CYTHON_INLINE
int __Pyx_PyObject_IsTrueAndDecref(PyObject* x) {
6042 if (unlikely(!x))
return -1;
6043 retval = __Pyx_PyObject_IsTrue(x);
6047 static PyObject* __Pyx_PyNumber_IntOrLongWrongResultType(PyObject* result,
const char* type_name) {
6048 #if PY_MAJOR_VERSION >= 3
6049 if (PyLong_Check(result)) {
6050 if (PyErr_WarnFormat(PyExc_DeprecationWarning, 1,
6051 "__int__ returned non-int (type %.200s). "
6052 "The ability to return an instance of a strict subclass of int "
6053 "is deprecated, and may be removed in a future version of Python.",
6054 Py_TYPE(result)->tp_name)) {
6061 PyErr_Format(PyExc_TypeError,
6062 "__%.4s__ returned non-%.4s (type %.200s)",
6063 type_name, type_name, Py_TYPE(result)->tp_name);
6067 static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x) {
6068 #if CYTHON_USE_TYPE_SLOTS
6071 const char *name = NULL;
6072 PyObject *res = NULL;
6073 #if PY_MAJOR_VERSION < 3
6074 if (likely(PyInt_Check(x) || PyLong_Check(x)))
6076 if (likely(PyLong_Check(x)))
6078 return __Pyx_NewRef(x);
6079 #if CYTHON_USE_TYPE_SLOTS
6080 m = Py_TYPE(x)->tp_as_number;
6081 #if PY_MAJOR_VERSION < 3
6082 if (m && m->nb_int) {
6086 else if (m && m->nb_long) {
6088 res = m->nb_long(x);
6091 if (likely(m && m->nb_int)) {
6097 if (!PyBytes_CheckExact(x) && !PyUnicode_CheckExact(x)) {
6098 res = PyNumber_Int(x);
6102 #if PY_MAJOR_VERSION < 3
6103 if (unlikely(!PyInt_Check(res) && !PyLong_Check(res))) {
6105 if (unlikely(!PyLong_CheckExact(res))) {
6107 return __Pyx_PyNumber_IntOrLongWrongResultType(res, name);
6110 else if (!PyErr_Occurred()) {
6111 PyErr_SetString(PyExc_TypeError,
6112 "an integer is required");
6116 static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject* b) {
6119 #if PY_MAJOR_VERSION < 3
6120 if (likely(PyInt_CheckExact(b))) {
6121 if (
sizeof(Py_ssize_t) >=
sizeof(
long))
6122 return PyInt_AS_LONG(b);
6124 return PyInt_AsSsize_t(b);
6127 if (likely(PyLong_CheckExact(b))) {
6128 #if CYTHON_USE_PYLONG_INTERNALS
6129 const digit* digits = ((PyLongObject*)b)->ob_digit;
6130 const Py_ssize_t size = Py_SIZE(b);
6131 if (likely(__Pyx_sst_abs(size) <= 1)) {
6132 ival = likely(size) ? digits[0] : 0;
6133 if (size == -1) ival = -ival;
6138 if (8 *
sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) {
6139 return (Py_ssize_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (
size_t)digits[0]));
6143 if (8 *
sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) {
6144 return -(Py_ssize_t) (((((
size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
6148 if (8 *
sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) {
6149 return (Py_ssize_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (
size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
6153 if (8 *
sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) {
6154 return -(Py_ssize_t) (((((((
size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (
size_t)digits[0]));
6158 if (8 *
sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) {
6159 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]));
6163 if (8 *
sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) {
6164 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]));
6170 return PyLong_AsSsize_t(b);
6172 x = PyNumber_Index(b);
6174 ival = PyInt_AsSsize_t(x);
6178 static CYTHON_INLINE Py_hash_t __Pyx_PyIndex_AsHash_t(PyObject* o) {
6179 if (
sizeof(Py_hash_t) ==
sizeof(Py_ssize_t)) {
6180 return (Py_hash_t) __Pyx_PyIndex_AsSsize_t(o);
6181 #if PY_MAJOR_VERSION < 3
6182 }
else if (likely(PyInt_CheckExact(o))) {
6183 return PyInt_AS_LONG(o);
6188 x = PyNumber_Index(o);
6190 ival = PyInt_AsLong(x);
6195 static CYTHON_INLINE PyObject * __Pyx_PyBool_FromLong(
long b) {
6196 return b ? __Pyx_NewRef(Py_True) : __Pyx_NewRef(Py_False);
6198 static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(
size_t ival) {
6199 return PyInt_FromSize_t(ival);