90#ifndef PY_SSIZE_T_CLEAN
91#define PY_SSIZE_T_CLEAN
94#if defined(Py_LIMITED_API)
95 #if !defined(CYTHON_LIMITED_API)
96 #define CYTHON_LIMITED_API 1
98#elif defined(CYTHON_LIMITED_API)
100 #pragma message ("Limited API usage is enabled with 'CYTHON_LIMITED_API' but 'Py_LIMITED_API' does not define a Python target version. Consider setting 'Py_LIMITED_API' instead.")
102 #warning Limited API usage is enabled with 'CYTHON_LIMITED_API' but 'Py_LIMITED_API' does not define a Python target version. Consider setting 'Py_LIMITED_API' instead.
108 #error Python headers needed to compile C extensions, please install development version of Python.
109#elif PY_VERSION_HEX < 0x03090000
110 #error Cython requires Python 3.9+.
111#elif defined(Py_LIMITED_API) && (Py_LIMITED_API & 0xFFFF0000) > (PY_VERSION_HEX & 0xFFFF0000)
112 #error 'Py_LIMITED_API' can only select past Python X.Y versions, not future ones.
114#define __PYX_ABI_VERSION "3_3_0"
115#define CYTHON_HEX_VERSION 0x030300F0
116#define CYTHON_FUTURE_DIVISION 1
120 #define offsetof(type, member) ( (size_t) & ((type*)0) -> member )
122#if !defined(_WIN32) && !defined(WIN32) && !defined(MS_WINDOWS)
134 #define __Pyx_has_cbuiltin(name) __has_builtin(name)
136 #define __Pyx_has_cbuiltin(name) (0)
139 #define DL_IMPORT(t) t
142 #define DL_EXPORT(t) t
146 #define PY_LONG_LONG LONG_LONG
149 #define Py_HUGE_VAL HUGE_VAL
151#define __PYX_LIMITED_VERSION_HEX PY_VERSION_HEX
152#if defined(CYTHON_LIMITED_API)
153 #ifdef Py_LIMITED_API
154 #undef __PYX_LIMITED_VERSION_HEX
155 #define __PYX_LIMITED_VERSION_HEX Py_LIMITED_API
156 #if Py_LIMITED_API < 0x03090000
157 #error "Cython 3.3 requires the Python Limited API version to be 3.9 or greater."
160 #if defined(GRAALVM_PYTHON) || defined(PYPY_VERSION)
162 #pragma message ("Py_LIMITED_API is defined on PyPy or GraalPy. This takes precedence over Cython's specialized\
163 code for PyPy and GraalPy and is unlikely to work.")
165 #warning "Py_LIMITED_API is defined on PyPy or GraalPy. This takes precedence over Cython's specialized\
166 code for PyPy and GraalPy and is unlikely to work."
169 #define CYTHON_COMPILING_IN_PYPY 0
170 #define CYTHON_COMPILING_IN_CPYTHON 0
171 #define CYTHON_COMPILING_IN_LIMITED_API 1
172 #define CYTHON_COMPILING_IN_GRAAL 0
173 #define CYTHON_COMPILING_IN_CPYTHON_FREETHREADING 0
174 #undef CYTHON_USE_TYPE_SLOTS
175 #define CYTHON_USE_TYPE_SLOTS 0
176 #undef CYTHON_USE_TYPE_SPECS
177 #define CYTHON_USE_TYPE_SPECS 1
178 #undef CYTHON_USE_PYTYPE_LOOKUP
179 #define CYTHON_USE_PYTYPE_LOOKUP 0
180 #undef CYTHON_USE_PYLIST_INTERNALS
181 #define CYTHON_USE_PYLIST_INTERNALS 0
182 #undef CYTHON_USE_UNICODE_INTERNALS
183 #define CYTHON_USE_UNICODE_INTERNALS 0
184 #ifndef CYTHON_USE_UNICODE_WRITER
185 #define CYTHON_USE_UNICODE_WRITER 0
187 #undef CYTHON_USE_PYLONG_INTERNALS
188 #define CYTHON_USE_PYLONG_INTERNALS 0
189 #ifndef CYTHON_AVOID_BORROWED_REFS
190 #define CYTHON_AVOID_BORROWED_REFS 0
192 #ifndef CYTHON_AVOID_THREAD_UNSAFE_BORROWED_REFS
193 #define CYTHON_AVOID_THREAD_UNSAFE_BORROWED_REFS 0
195 #undef CYTHON_ASSUME_SAFE_MACROS
196 #define CYTHON_ASSUME_SAFE_MACROS 0
197 #undef CYTHON_ASSUME_SAFE_SIZE
198 #define CYTHON_ASSUME_SAFE_SIZE 0
199 #undef CYTHON_UNPACK_METHODS
200 #define CYTHON_UNPACK_METHODS 0
201 #undef CYTHON_FAST_THREAD_STATE
202 #define CYTHON_FAST_THREAD_STATE 0
203 #undef CYTHON_FAST_GIL
204 #define CYTHON_FAST_GIL 0
205 #undef CYTHON_VECTORCALL
206 #define CYTHON_VECTORCALL (__PYX_LIMITED_VERSION_HEX >= 0x030C0000)
207 #ifndef CYTHON_VECTORCALL_TPNEW
208 #define CYTHON_VECTORCALL_TPNEW (CYTHON_VECTORCALL && __PYX_LIMITED_VERSION_HEX >= 0x030E0000)
210 #ifndef CYTHON_PEP487_INIT_SUBCLASS
211 #define CYTHON_PEP487_INIT_SUBCLASS 1
213 #ifndef CYTHON_PEP489_MULTI_PHASE_INIT
214 #define CYTHON_PEP489_MULTI_PHASE_INIT 1
216 #ifndef CYTHON_USE_MODULE_STATE
217 #define CYTHON_USE_MODULE_STATE 0
219 #undef CYTHON_USE_SYS_MONITORING
220 #define CYTHON_USE_SYS_MONITORING 0
221 #ifndef CYTHON_USE_TP_FINALIZE
222 #define CYTHON_USE_TP_FINALIZE (__PYX_LIMITED_VERSION_HEX >= 0x030F0000 && PY_VERSION_HEX > 0x030F00A8)
224 #ifndef CYTHON_USE_AM_SEND
225 #define CYTHON_USE_AM_SEND (__PYX_LIMITED_VERSION_HEX >= 0x030A0000)
227 #undef CYTHON_USE_DICT_VERSIONS
228 #define CYTHON_USE_DICT_VERSIONS 0
229 #undef CYTHON_USE_EXC_INFO_STACK
230 #define CYTHON_USE_EXC_INFO_STACK 0
231 #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC
232 #define CYTHON_UPDATE_DESCRIPTOR_DOC 0
234 #ifndef CYTHON_USE_OWN_PREP_RERAISE_STAR
235 #define CYTHON_USE_OWN_PREP_RERAISE_STAR 1
237 #ifndef CYTHON_USE_FREELISTS
238 #define CYTHON_USE_FREELISTS 1
240 #undef CYTHON_IMMORTAL_CONSTANTS
241 #define CYTHON_IMMORTAL_CONSTANTS 0
242 #if __PYX_LIMITED_VERSION_HEX < 0x030E0000
243 #undef CYTHON_OPAQUE_OBJECTS
244 #define CYTHON_OPAQUE_OBJECTS 0
245 #elif !defined(CYTHON_OPAQUE_OBJECTS)
246 #define CYTHON_OPAQUE_OBJECTS (__PYX_LIMITED_VERSION_HEX >= 0x030F0000)
248#elif defined(GRAALVM_PYTHON)
251 #define CYTHON_COMPILING_IN_PYPY 0
252 #define CYTHON_COMPILING_IN_CPYTHON 0
253 #define CYTHON_COMPILING_IN_LIMITED_API 0
254 #define CYTHON_COMPILING_IN_GRAAL 1
255 #define CYTHON_COMPILING_IN_CPYTHON_FREETHREADING 0
256 #ifndef CYTHON_USE_TYPE_SLOTS
257 #define CYTHON_USE_TYPE_SLOTS 0
259 #undef CYTHON_USE_TYPE_SPECS
260 #define CYTHON_USE_TYPE_SPECS 0
261 #undef CYTHON_USE_PYTYPE_LOOKUP
262 #define CYTHON_USE_PYTYPE_LOOKUP 0
263 #undef CYTHON_USE_PYLIST_INTERNALS
264 #define CYTHON_USE_PYLIST_INTERNALS 0
265 #undef CYTHON_USE_UNICODE_INTERNALS
266 #define CYTHON_USE_UNICODE_INTERNALS 0
267 #undef CYTHON_USE_UNICODE_WRITER
268 #define CYTHON_USE_UNICODE_WRITER 0
269 #undef CYTHON_USE_PYLONG_INTERNALS
270 #define CYTHON_USE_PYLONG_INTERNALS 0
271 #undef CYTHON_AVOID_BORROWED_REFS
272 #define CYTHON_AVOID_BORROWED_REFS 1
273 #undef CYTHON_AVOID_THREAD_UNSAFE_BORROWED_REFS
274 #define CYTHON_AVOID_THREAD_UNSAFE_BORROWED_REFS 0
275 #undef CYTHON_ASSUME_SAFE_MACROS
276 #define CYTHON_ASSUME_SAFE_MACROS 0
277 #undef CYTHON_ASSUME_SAFE_SIZE
278 #define CYTHON_ASSUME_SAFE_SIZE 0
279 #undef CYTHON_UNPACK_METHODS
280 #define CYTHON_UNPACK_METHODS 0
281 #undef CYTHON_FAST_THREAD_STATE
282 #define CYTHON_FAST_THREAD_STATE 0
283 #undef CYTHON_FAST_GIL
284 #define CYTHON_FAST_GIL 0
285 #ifndef CYTHON_VECTORCALL
286 #define CYTHON_VECTORCALL 1
288 #if CYTHON_USE_TYPE_SPECS && PY_VERSION_HEX < 0x030E0000
289 #undef CYTHON_VECTORCALL_TPNEW
290 #define CYTHON_VECTORCALL_TPNEW 0
291 #elif !defined(CYTHON_VECTORCALL_TPNEW)
292 #define CYTHON_VECTORCALL_TPNEW CYTHON_VECTORCALL
294 #ifndef CYTHON_PEP487_INIT_SUBCLASS
295 #define CYTHON_PEP487_INIT_SUBCLASS 1
297 #undef CYTHON_PEP489_MULTI_PHASE_INIT
298 #define CYTHON_PEP489_MULTI_PHASE_INIT 1
299 #undef CYTHON_USE_MODULE_STATE
300 #define CYTHON_USE_MODULE_STATE 0
301 #undef CYTHON_USE_SYS_MONITORING
302 #define CYTHON_USE_SYS_MONITORING 0
303 #undef CYTHON_USE_TP_FINALIZE
304 #define CYTHON_USE_TP_FINALIZE 0
305 #undef CYTHON_USE_AM_SEND
306 #define CYTHON_USE_AM_SEND 0
307 #undef CYTHON_USE_DICT_VERSIONS
308 #define CYTHON_USE_DICT_VERSIONS 0
309 #undef CYTHON_USE_EXC_INFO_STACK
310 #define CYTHON_USE_EXC_INFO_STACK 1
311 #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC
312 #define CYTHON_UPDATE_DESCRIPTOR_DOC 0
314 #ifndef CYTHON_USE_OWN_PREP_RERAISE_STAR
315 #define CYTHON_USE_OWN_PREP_RERAISE_STAR 1
317 #undef CYTHON_USE_FREELISTS
318 #define CYTHON_USE_FREELISTS 0
319 #undef CYTHON_IMMORTAL_CONSTANTS
320 #define CYTHON_IMMORTAL_CONSTANTS 0
321 #undef CYTHON_OPAQUE_OBJECTS
322 #define CYTHON_OPAQUE_OBJECTS 0
323#elif defined(PYPY_VERSION)
324 #define CYTHON_COMPILING_IN_PYPY 1
325 #define CYTHON_COMPILING_IN_CPYTHON 0
326 #define CYTHON_COMPILING_IN_LIMITED_API 0
327 #define CYTHON_COMPILING_IN_GRAAL 0
328 #define CYTHON_COMPILING_IN_CPYTHON_FREETHREADING 0
329 #undef CYTHON_USE_TYPE_SLOTS
330 #define CYTHON_USE_TYPE_SLOTS 1
331 #ifndef CYTHON_USE_TYPE_SPECS
332 #define CYTHON_USE_TYPE_SPECS 0
334 #undef CYTHON_USE_PYTYPE_LOOKUP
335 #define CYTHON_USE_PYTYPE_LOOKUP 0
336 #undef CYTHON_USE_PYLIST_INTERNALS
337 #define CYTHON_USE_PYLIST_INTERNALS 0
338 #undef CYTHON_USE_UNICODE_INTERNALS
339 #define CYTHON_USE_UNICODE_INTERNALS 0
340 #undef CYTHON_USE_UNICODE_WRITER
341 #define CYTHON_USE_UNICODE_WRITER 0
342 #undef CYTHON_USE_PYLONG_INTERNALS
343 #define CYTHON_USE_PYLONG_INTERNALS 0
344 #undef CYTHON_AVOID_BORROWED_REFS
345 #define CYTHON_AVOID_BORROWED_REFS 1
346 #undef CYTHON_AVOID_THREAD_UNSAFE_BORROWED_REFS
347 #define CYTHON_AVOID_THREAD_UNSAFE_BORROWED_REFS 1
348 #undef CYTHON_ASSUME_SAFE_MACROS
349 #define CYTHON_ASSUME_SAFE_MACROS 0
350 #ifndef CYTHON_ASSUME_SAFE_SIZE
351 #define CYTHON_ASSUME_SAFE_SIZE 1
353 #undef CYTHON_UNPACK_METHODS
354 #define CYTHON_UNPACK_METHODS 0
355 #undef CYTHON_FAST_THREAD_STATE
356 #define CYTHON_FAST_THREAD_STATE 0
357 #undef CYTHON_FAST_GIL
358 #define CYTHON_FAST_GIL 0
359 #ifndef CYTHON_VECTORCALL
360 #define CYTHON_VECTORCALL 1
362 #if CYTHON_USE_TYPE_SPECS && PY_VERSION_HEX < 0x030E0000
363 #undef CYTHON_VECTORCALL_TPNEW
364 #define CYTHON_VECTORCALL_TPNEW 0
365 #elif !defined(CYTHON_VECTORCALL_TPNEW)
366 #define CYTHON_VECTORCALL_TPNEW (PYPY_VERSION_NUM >= 0x07030800 && CYTHON_VECTORCALL)
368 #ifndef CYTHON_PEP487_INIT_SUBCLASS
369 #define CYTHON_PEP487_INIT_SUBCLASS 1
371 #ifndef CYTHON_PEP489_MULTI_PHASE_INIT
372 #define CYTHON_PEP489_MULTI_PHASE_INIT 1
374 #undef CYTHON_USE_MODULE_STATE
375 #define CYTHON_USE_MODULE_STATE 0
376 #undef CYTHON_USE_SYS_MONITORING
377 #define CYTHON_USE_SYS_MONITORING 0
378 #ifndef CYTHON_USE_TP_FINALIZE
379 #define CYTHON_USE_TP_FINALIZE (PYPY_VERSION_NUM >= 0x07030C00)
381 #undef CYTHON_USE_AM_SEND
382 #define CYTHON_USE_AM_SEND 0
383 #undef CYTHON_USE_DICT_VERSIONS
384 #define CYTHON_USE_DICT_VERSIONS 0
385 #undef CYTHON_USE_EXC_INFO_STACK
386 #define CYTHON_USE_EXC_INFO_STACK 0
387 #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC
388 #define CYTHON_UPDATE_DESCRIPTOR_DOC (PYPY_VERSION_NUM >= 0x07031100)
390 #ifndef CYTHON_USE_OWN_PREP_RERAISE_STAR
391 #define CYTHON_USE_OWN_PREP_RERAISE_STAR 1
393 #undef CYTHON_USE_FREELISTS
394 #define CYTHON_USE_FREELISTS 0
395 #undef CYTHON_IMMORTAL_CONSTANTS
396 #define CYTHON_IMMORTAL_CONSTANTS 0
397 #undef CYTHON_OPAQUE_OBJECTS
398 #define CYTHON_OPAQUE_OBJECTS 0
400 #define CYTHON_COMPILING_IN_PYPY 0
401 #define CYTHON_COMPILING_IN_CPYTHON 1
402 #define CYTHON_COMPILING_IN_LIMITED_API 0
403 #define CYTHON_COMPILING_IN_GRAAL 0
404 #ifdef Py_GIL_DISABLED
405 #define CYTHON_COMPILING_IN_CPYTHON_FREETHREADING 1
407 #define CYTHON_COMPILING_IN_CPYTHON_FREETHREADING 0
409 #if PY_VERSION_HEX < 0x030A0000
410 #undef CYTHON_USE_TYPE_SLOTS
411 #define CYTHON_USE_TYPE_SLOTS 1
412 #elif !defined(CYTHON_USE_TYPE_SLOTS)
413 #define CYTHON_USE_TYPE_SLOTS 1
415 #ifndef CYTHON_USE_TYPE_SPECS
416 #define CYTHON_USE_TYPE_SPECS 0
418 #ifndef CYTHON_USE_PYTYPE_LOOKUP
419 #define CYTHON_USE_PYTYPE_LOOKUP 1
421 #ifndef CYTHON_USE_PYLONG_INTERNALS
422 #define CYTHON_USE_PYLONG_INTERNALS 1
424 #if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING
425 #undef CYTHON_USE_PYLIST_INTERNALS
426 #define CYTHON_USE_PYLIST_INTERNALS 0
427 #elif !defined(CYTHON_USE_PYLIST_INTERNALS)
428 #define CYTHON_USE_PYLIST_INTERNALS 1
430 #ifndef CYTHON_USE_UNICODE_INTERNALS
431 #define CYTHON_USE_UNICODE_INTERNALS 1
433 #if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING || PY_VERSION_HEX >= 0x030B00A2
434 #undef CYTHON_USE_UNICODE_WRITER
435 #define CYTHON_USE_UNICODE_WRITER 0
436 #elif !defined(CYTHON_USE_UNICODE_WRITER)
437 #define CYTHON_USE_UNICODE_WRITER 1
439 #ifndef CYTHON_AVOID_BORROWED_REFS
440 #define CYTHON_AVOID_BORROWED_REFS 0
442 #if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING
443 #undef CYTHON_AVOID_THREAD_UNSAFE_BORROWED_REFS
444 #define CYTHON_AVOID_THREAD_UNSAFE_BORROWED_REFS 1
445 #elif !defined(CYTHON_AVOID_THREAD_UNSAFE_BORROWED_REFS)
446 #define CYTHON_AVOID_THREAD_UNSAFE_BORROWED_REFS 0
448 #ifndef CYTHON_ASSUME_SAFE_MACROS
449 #define CYTHON_ASSUME_SAFE_MACROS 1
451 #ifndef CYTHON_ASSUME_SAFE_SIZE
452 #define CYTHON_ASSUME_SAFE_SIZE 1
454 #ifndef CYTHON_UNPACK_METHODS
455 #define CYTHON_UNPACK_METHODS 1
457 #ifndef CYTHON_FAST_THREAD_STATE
458 #define CYTHON_FAST_THREAD_STATE 1
460 #if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING
461 #undef CYTHON_FAST_GIL
462 #define CYTHON_FAST_GIL 0
463 #elif !defined(CYTHON_FAST_GIL)
464 #define CYTHON_FAST_GIL (PY_VERSION_HEX < 0x030C00A6)
466 #ifndef CYTHON_VECTORCALL
467 #define CYTHON_VECTORCALL 1
469 #if CYTHON_USE_TYPE_SPECS && PY_VERSION_HEX < 0x030E0000
470 #undef CYTHON_VECTORCALL_TPNEW
471 #define CYTHON_VECTORCALL_TPNEW 0
472 #elif !defined(CYTHON_VECTORCALL_TPNEW)
473 #define CYTHON_VECTORCALL_TPNEW CYTHON_VECTORCALL
475 #ifndef CYTHON_PEP487_INIT_SUBCLASS
476 #define CYTHON_PEP487_INIT_SUBCLASS 1
478 #ifndef CYTHON_PEP489_MULTI_PHASE_INIT
479 #define CYTHON_PEP489_MULTI_PHASE_INIT 1
481 #ifndef CYTHON_USE_MODULE_STATE
482 #define CYTHON_USE_MODULE_STATE 0
484 #ifndef CYTHON_USE_SYS_MONITORING
485 #define CYTHON_USE_SYS_MONITORING (PY_VERSION_HEX >= 0x030d00B1)
487 #ifndef CYTHON_USE_TP_FINALIZE
488 #define CYTHON_USE_TP_FINALIZE 1
490 #ifndef CYTHON_USE_AM_SEND
491 #define CYTHON_USE_AM_SEND 1
493 #if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING
494 #undef CYTHON_USE_DICT_VERSIONS
495 #define CYTHON_USE_DICT_VERSIONS 0
496 #elif !defined(CYTHON_USE_DICT_VERSIONS)
497 #define CYTHON_USE_DICT_VERSIONS (PY_VERSION_HEX < 0x030C00A5 && !CYTHON_USE_MODULE_STATE)
499 #ifndef CYTHON_USE_EXC_INFO_STACK
500 #define CYTHON_USE_EXC_INFO_STACK 1
502 #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC
503 #define CYTHON_UPDATE_DESCRIPTOR_DOC 1
505 #ifndef CYTHON_USE_OWN_PREP_RERAISE_STAR
506 #define CYTHON_USE_OWN_PREP_RERAISE_STAR (PY_VERSION_HEX < 0x030C00B2)
508 #ifndef CYTHON_USE_FREELISTS
509 #define CYTHON_USE_FREELISTS (!CYTHON_COMPILING_IN_CPYTHON_FREETHREADING)
511 #if defined(CYTHON_IMMORTAL_CONSTANTS) && PY_VERSION_HEX < 0x030C0000
512 #undef CYTHON_IMMORTAL_CONSTANTS
513 #define CYTHON_IMMORTAL_CONSTANTS 0
514 #elif !defined(CYTHON_IMMORTAL_CONSTANTS)
515 #define CYTHON_IMMORTAL_CONSTANTS (PY_VERSION_HEX >= 0x030C0000 && !CYTHON_USE_MODULE_STATE && CYTHON_COMPILING_IN_CPYTHON_FREETHREADING)
517 #ifndef CYTHON_OPAQUE_OBJECTS
518 #define CYTHON_OPAQUE_OBJECTS 0
521#if CYTHON_USE_PYLONG_INTERNALS
526 enum { __pyx_check_sizeof_voidp = 1 / (int)(SIZEOF_VOID_P ==
sizeof(
void*)) };
529#ifndef __has_attribute
530 #define __has_attribute(x) 0
532#ifndef __has_cpp_attribute
533 #define __has_cpp_attribute(x) 0
535#ifndef CYTHON_RESTRICT
536 #if defined(__GNUC__)
537 #define CYTHON_RESTRICT __restrict__
538 #elif defined(_MSC_VER) && _MSC_VER >= 1400
539 #define CYTHON_RESTRICT __restrict
540 #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
541 #define CYTHON_RESTRICT restrict
543 #define CYTHON_RESTRICT
547 #if defined(__cplusplus)
550 #if ((defined(_MSVC_LANG) && _MSVC_LANG >= 201703L) || __cplusplus >= 201703L)
551 #if __has_cpp_attribute(maybe_unused)
552 #define CYTHON_UNUSED [[maybe_unused]]
555 #elif defined(__STDC_VERSION__) && __STDC_VERSION__ >= 202311L
556 #define CYTHON_UNUSED [[maybe_unused]]
560# if defined(__GNUC__)
561# if !(defined(__cplusplus)) || (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4))
562# define CYTHON_UNUSED __attribute__ ((__unused__))
564# define CYTHON_UNUSED
566# elif defined(__ICC) || (defined(__INTEL_COMPILER) && !defined(_MSC_VER))
567# define CYTHON_UNUSED __attribute__ ((__unused__))
569# define CYTHON_UNUSED
572#ifndef CYTHON_UNUSED_VAR
573# if defined(__cplusplus)
574 template<
class T>
void CYTHON_UNUSED_VAR(
const T& ) { }
576# define CYTHON_UNUSED_VAR(x) (void)(x)
579#ifndef CYTHON_MAYBE_UNUSED_VAR
580 #define CYTHON_MAYBE_UNUSED_VAR(x) CYTHON_UNUSED_VAR(x)
582#ifndef CYTHON_NCP_UNUSED
583# if CYTHON_COMPILING_IN_CPYTHON && !CYTHON_COMPILING_IN_CPYTHON_FREETHREADING
584# define CYTHON_NCP_UNUSED
586# define CYTHON_NCP_UNUSED CYTHON_UNUSED
589#ifndef CYTHON_USE_CPP_STD_MOVE
590 #if defined(__cplusplus) && (\
591 __cplusplus >= 201103L || (defined(_MSC_VER) && _MSC_VER >= 1600))
592 #define CYTHON_USE_CPP_STD_MOVE 1
594 #define CYTHON_USE_CPP_STD_MOVE 0
597#define __Pyx_void_to_None(void_result) ((void)(void_result), Py_INCREF(Py_None), Py_None)
599typedef uintptr_t __pyx_uintptr_t;
600#ifndef CYTHON_FALLTHROUGH
601 #if defined(__cplusplus)
604 #if ((defined(_MSVC_LANG) && _MSVC_LANG >= 201703L) || __cplusplus >= 201703L)
605 #if __has_cpp_attribute(fallthrough)
606 #define CYTHON_FALLTHROUGH [[fallthrough]]
609 #ifndef CYTHON_FALLTHROUGH
610 #if __has_cpp_attribute(clang::fallthrough)
611 #define CYTHON_FALLTHROUGH [[clang::fallthrough]]
612 #elif __has_cpp_attribute(gnu::fallthrough)
613 #define CYTHON_FALLTHROUGH [[gnu::fallthrough]]
617 #ifndef CYTHON_FALLTHROUGH
618 #if __has_attribute(fallthrough)
619 #define CYTHON_FALLTHROUGH __attribute__((fallthrough))
621 #define CYTHON_FALLTHROUGH
624 #if defined(__clang__) && defined(__apple_build_version__)
625 #if __apple_build_version__ < 7000000
626 #undef CYTHON_FALLTHROUGH
627 #define CYTHON_FALLTHROUGH
632 #define __Pyx_UNREACHABLE() Py_UNREACHABLE()
633#elif __Pyx_has_cbuiltin(__builtin_unreachable)
634 #define __Pyx_UNREACHABLE() __builtin_unreachable()
635#elif defined(__clang__) || defined(__INTEL_COMPILER) || (defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 5)))
636 #define __Pyx_UNREACHABLE() __builtin_unreachable()
637#elif defined(_MSC_VER)
638 #define __Pyx_UNREACHABLE() __assume(0)
640 #define __Pyx_UNREACHABLE() Py_FatalError("Unreachable C code path reached")
642#ifndef Py_UNREACHABLE
643 #define Py_UNREACHABLE() __Pyx_UNREACHABLE()
646 template <
typename T>
647 struct __PYX_IS_UNSIGNED_IMPL {
static const bool value =
T(0) <
T(-1);};
648 #define __PYX_IS_UNSIGNED(type) (__PYX_IS_UNSIGNED_IMPL<type>::value)
650 #define __PYX_IS_UNSIGNED(type) (((type)-1) > 0)
652#if CYTHON_COMPILING_IN_PYPY == 1
653 #define __PYX_NEED_TP_PRINT_SLOT (PY_VERSION_HEX < 0x030A0000)
655 #define __PYX_NEED_TP_PRINT_SLOT 0
657#define __PYX_REINTERPRET_FUNCION(func_pointer, other_pointer) ((func_pointer)(void(*)(void))(other_pointer))
658#if __PYX_LIMITED_VERSION_HEX < 0x030C0000
659#define __Pyx_PyErr_FetchException(petype, peval, petb) PyErr_Fetch(petype, peval, petb)
660#define __Pyx_PyErr_RestoreException(etype, eval, etb) PyErr_Restore(etype, eval, etb)
662#define __Pyx_PyErr_FetchException(petype, peval, petb) *(petype)=NULL; *(peval)=PyErr_GetRaisedException(); *(petb)=NULL
663#define __Pyx_PyErr_RestoreException(etype, eval, etb) PyErr_SetRaisedException(eval)
668 #error "Cython files generated with the C++ option must be compiled with a C++ compiler."
671 #if defined(__clang__)
672 #define CYTHON_INLINE __inline__ __attribute__ ((__unused__))
674 #define CYTHON_INLINE inline
678void __Pyx_call_destructor(
T& x) {
682class __Pyx_FakeReference {
684 __Pyx_FakeReference() : ptr(NULL) { }
685 __Pyx_FakeReference(
const T& ref) : ptr(const_cast<
T*>(&ref)) { }
686 T *operator->() {
return ptr; }
687 T *operator&() {
return ptr; }
688 operator T&() {
return *ptr; }
689 template<
typename U>
bool operator ==(
const U& other)
const {
return *ptr == other; }
690 template<
typename U>
bool operator !=(
const U& other)
const {
return *ptr != other; }
691 template<
typename U>
bool operator==(
const __Pyx_FakeReference<U>& other)
const {
return *ptr == *other.ptr; }
692 template<
typename U>
bool operator!=(
const __Pyx_FakeReference<U>& other)
const {
return *ptr != *other.ptr; }
698#define __PYX_BUILD_PY_SSIZE_T "n"
699#define CYTHON_FORMAT_SSIZE_T "z"
700#define __Pyx_BUILTIN_MODULE_NAME "builtins"
701#define __Pyx_DefaultClassType PyType_Type
702#if CYTHON_COMPILING_IN_LIMITED_API
704 static int CO_OPTIMIZED;
707 static int CO_NEWLOCALS;
710 static int CO_VARARGS;
712 #ifndef CO_VARKEYWORDS
713 static int CO_VARKEYWORDS;
715 #ifndef CO_ASYNC_GENERATOR
716 static int CO_ASYNC_GENERATOR;
719 static int CO_GENERATOR;
722 static int CO_COROUTINE;
726 #define CO_COROUTINE 0x80
728 #ifndef CO_ASYNC_GENERATOR
729 #define CO_ASYNC_GENERATOR 0x200
732static int __Pyx_init_co_variables(
void);
733#if PY_VERSION_HEX >= 0x030A00B1 || defined(Py_Is)
734 #define __Pyx_Py_Is(x, y) Py_Is(x, y)
736 #define __Pyx_Py_Is(x, y) ((x) == (y))
738#if PY_VERSION_HEX >= 0x030A00B1 || defined(Py_IsNone)
739 #define __Pyx_Py_IsNone(ob) Py_IsNone(ob)
741 #define __Pyx_Py_IsNone(ob) __Pyx_Py_Is((ob), Py_None)
743#if PY_VERSION_HEX >= 0x030A00B1 || defined(Py_IsTrue)
744 #define __Pyx_Py_IsTrue(ob) Py_IsTrue(ob)
746 #define __Pyx_Py_IsTrue(ob) __Pyx_Py_Is((ob), Py_True)
748#if PY_VERSION_HEX >= 0x030A00B1 || defined(Py_IsFalse)
749 #define __Pyx_Py_IsFalse(ob) Py_IsFalse(ob)
751 #define __Pyx_Py_IsFalse(ob) __Pyx_Py_Is((ob), Py_False)
753#define __Pyx_NoneAsNull(obj) (__Pyx_Py_IsNone(obj) ? NULL : (obj))
754#if CYTHON_COMPILING_IN_PYPY
755 #define __Pyx_PyObject_GC_IsFinalized(o) _PyGC_FINALIZED(o)
757 #define __Pyx_PyObject_GC_IsFinalized(o) PyObject_GC_IsFinalized(o)
759#if CYTHON_COMPILING_IN_LIMITED_API
760static unsigned long __Pyx_Runtime_TPFLAGS_SEQUENCE;
761static unsigned long __Pyx_Runtime_TPFLAGS_MAPPING;
763#define __Pyx_Runtime_TPFLAGS_SEQUENCE Py_TPFLAGS_SEQUENCE
764#define __Pyx_Runtime_TPFLAGS_MAPPING Py_TPFLAGS_MAPPING
766static int __Pyx_init_tpflags_variables(
void);
767#ifndef Py_TPFLAGS_HAVE_FINALIZE
768 #define Py_TPFLAGS_HAVE_FINALIZE 0
770#ifndef Py_TPFLAGS_SEQUENCE
771 #define Py_TPFLAGS_SEQUENCE (CYTHON_COMPILING_IN_LIMITED_API ? 0 : 1 << 5)
773#ifndef Py_TPFLAGS_MAPPING
774 #define Py_TPFLAGS_MAPPING (CYTHON_COMPILING_IN_LIMITED_API ? 0 : 1 << 6)
776#ifndef Py_TPFLAGS_IMMUTABLETYPE
777 #define Py_TPFLAGS_IMMUTABLETYPE (1UL << 8)
779#ifndef Py_TPFLAGS_DISALLOW_INSTANTIATION
780 #define Py_TPFLAGS_DISALLOW_INSTANTIATION (1UL << 7)
782#ifndef METH_STACKLESS
783 #define METH_STACKLESS 0
785#if !defined(METH_FASTCALL) || CYTHON_COMPILING_IN_PYPY
786 #ifndef METH_FASTCALL
787 #define METH_FASTCALL 0x80
789 typedef PyObject *(*__Pyx_PyCFunctionFast) (PyObject *self, PyObject *
const *args, Py_ssize_t nargs);
790 typedef PyObject *(*__Pyx_PyCFunctionFastWithKeywords) (PyObject *self, PyObject *
const *args,
791 Py_ssize_t nargs, PyObject *kwnames);
793 #if PY_VERSION_HEX >= 0x030d00A4
794 # define __Pyx_PyCFunctionFast PyCFunctionFast
795 # define __Pyx_PyCFunctionFastWithKeywords PyCFunctionFastWithKeywords
797 # define __Pyx_PyCFunctionFast _PyCFunctionFast
798 # define __Pyx_PyCFunctionFastWithKeywords _PyCFunctionFastWithKeywords
802 #define __Pyx_METH_FASTCALL METH_FASTCALL
803 #define __Pyx_PyCFunction_FastCall __Pyx_PyCFunctionFast
804 #define __Pyx_PyCFunction_FastCallWithKeywords __Pyx_PyCFunctionFastWithKeywords
806 #define __Pyx_METH_FASTCALL METH_VARARGS
807 #define __Pyx_PyCFunction_FastCall PyCFunction
808 #define __Pyx_PyCFunction_FastCallWithKeywords PyCFunctionWithKeywords
811 #define __pyx_vectorcallfunc vectorcallfunc
812 #define __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET PY_VECTORCALL_ARGUMENTS_OFFSET
813 #define __Pyx_PyVectorcall_NARGS(n) PyVectorcall_NARGS((size_t)(n))
815 #define __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET 0
816 #define __Pyx_PyVectorcall_NARGS(n) ((Py_ssize_t)(n))
818#define __Pyx_PyCFunction_CheckExact(func) PyCFunction_CheckExact(func)
819#define __Pyx_CyOrPyCFunction_Check(func) PyCFunction_Check(func)
820#if CYTHON_COMPILING_IN_CPYTHON
821#define __Pyx_CyOrPyCFunction_GET_FUNCTION(func) (((PyCFunctionObject*)(func))->m_ml->ml_meth)
822#elif !CYTHON_COMPILING_IN_LIMITED_API
823#define __Pyx_CyOrPyCFunction_GET_FUNCTION(func) PyCFunction_GET_FUNCTION(func)
825#if CYTHON_COMPILING_IN_CPYTHON
826#define __Pyx_CyOrPyCFunction_GET_FLAGS(func) (((PyCFunctionObject*)(func))->m_ml->ml_flags)
827static CYTHON_INLINE PyObject* __Pyx_CyOrPyCFunction_GET_SELF(PyObject *func) {
828 return (__Pyx_CyOrPyCFunction_GET_FLAGS(func) & METH_STATIC) ? NULL : ((PyCFunctionObject*)func)->m_self;
831static CYTHON_INLINE
int __Pyx__IsSameCFunction(PyObject *func,
void (*cfunc)(
void)) {
832#if CYTHON_COMPILING_IN_LIMITED_API
833 return PyCFunction_Check(func) && PyCFunction_GetFunction(func) == (PyCFunction) cfunc;
835 return PyCFunction_Check(func) && PyCFunction_GET_FUNCTION(func) == (PyCFunction) cfunc;
838#define __Pyx_IsSameCFunction(func, cfunc) __Pyx__IsSameCFunction(func, cfunc)
839#if CYTHON_COMPILING_IN_LIMITED_API && __PYX_LIMITED_VERSION_HEX < 0x030A0000
840 #define __Pyx_PyType_FromModuleAndSpec(m, s, b) ((void)m, PyType_FromSpecWithBases(s, b))
842 #define __Pyx_PyType_FromModuleAndSpec(m, s, b) PyType_FromModuleAndSpec(m, s, b)
844#if CYTHON_COMPILING_IN_PYPY
845 typedef PyObject *(*__Pyx_PyCMethod)(PyObject *, PyTypeObject *, PyObject *
const *, size_t, PyObject *);
847 #define __Pyx_PyCMethod PyCMethod
850 #define METH_METHOD 0x200
852#if CYTHON_COMPILING_IN_PYPY && !defined(PyObject_Malloc)
853 #define PyObject_Malloc(s) PyMem_Malloc(s)
854 #define PyObject_Free(p) PyMem_Free(p)
855 #define PyObject_Realloc(p) PyMem_Realloc(p)
857#if CYTHON_COMPILING_IN_LIMITED_API
858 #define __Pyx_PyFrame_SetLineNumber(frame, lineno)
859#elif CYTHON_COMPILING_IN_GRAAL && defined(GRAALPY_VERSION_NUM) && GRAALPY_VERSION_NUM > 0x19000000
860 #define __Pyx_PyCode_HasFreeVars(co) (PyCode_GetNumFree(co) > 0)
861 #define __Pyx_PyFrame_SetLineNumber(frame, lineno) GraalPyFrame_SetLineNumber((frame), (lineno))
862#elif CYTHON_COMPILING_IN_GRAAL
863 #define __Pyx_PyCode_HasFreeVars(co) (PyCode_GetNumFree(co) > 0)
864 #define __Pyx_PyFrame_SetLineNumber(frame, lineno) _PyFrame_SetLineNumber((frame), (lineno))
866 #define __Pyx_PyCode_HasFreeVars(co) (PyCode_GetNumFree(co) > 0)
867 #define __Pyx_PyFrame_SetLineNumber(frame, lineno) (frame)->f_lineno = (lineno)
869#if CYTHON_COMPILING_IN_LIMITED_API
870 #define __Pyx_PyThreadState_Current PyThreadState_Get()
871#elif !CYTHON_FAST_THREAD_STATE
872 #define __Pyx_PyThreadState_Current PyThreadState_GET()
873#elif PY_VERSION_HEX >= 0x030d00A1
874 #define __Pyx_PyThreadState_Current PyThreadState_GetUnchecked()
876 #define __Pyx_PyThreadState_Current _PyThreadState_UncheckedGet()
878#if CYTHON_OPAQUE_OBJECTS && CYTHON_COMPILING_IN_LIMITED_API
879 #define __PYX_SHARED_SIZEOF(T) -((int)sizeof(T))
880 #define __PYX_SHARED_RELATIVE_OFFSET Py_RELATIVE_OFFSET
881 #define CYTHON_OPAQUE_SHARED_TYPES 1
883 #define __PYX_SHARED_SIZEOF(T) sizeof(T)
884 #define __PYX_SHARED_RELATIVE_OFFSET 0
885 #define CYTHON_OPAQUE_SHARED_TYPES 0
887#if CYTHON_USE_MODULE_STATE
888static CYTHON_INLINE
void *__Pyx__PyModule_GetState(PyObject *op)
891 result = PyModule_GetState(op);
893 Py_FatalError(
"Couldn't find the module state");
896#define __Pyx_PyModule_GetState(o) (__pyx_mstatetype *)__Pyx__PyModule_GetState(o)
898#define __Pyx_PyModule_GetState(op) ((void)op,__pyx_mstate_global)
900#define __Pyx_PyObject_GetSlot(obj, name, func_ctype) __Pyx_PyType_GetSlot(Py_TYPE((PyObject *) obj), name, func_ctype)
901#define __Pyx_PyObject_TryGetSlot(obj, name, func_ctype) __Pyx_PyType_TryGetSlot(Py_TYPE(obj), name, func_ctype)
902#define __Pyx_PyObject_GetSubSlot(obj, sub, name, func_ctype) __Pyx_PyType_GetSubSlot(Py_TYPE(obj), sub, name, func_ctype)
903#define __Pyx_PyObject_TryGetSubSlot(obj, sub, name, func_ctype) __Pyx_PyType_TryGetSubSlot(Py_TYPE(obj), sub, name, func_ctype)
904#if CYTHON_USE_TYPE_SLOTS
905 #define __Pyx_PyType_GetSlot(type, name, func_ctype) ((type)->name)
906 #define __Pyx_PyType_TryGetSlot(type, name, func_ctype) __Pyx_PyType_GetSlot(type, name, func_ctype)
907 #define __Pyx_PyType_GetSubSlot(type, sub, name, func_ctype) (((type)->sub) ? ((type)->sub->name) : NULL)
908 #define __Pyx_PyType_TryGetSubSlot(type, sub, name, func_ctype) __Pyx_PyType_GetSubSlot(type, sub, name, func_ctype)
910 #define __Pyx_PyType_GetSlot(type, name, func_ctype) ((func_ctype) PyType_GetSlot((type), Py_##name))
911 #define __Pyx_PyType_TryGetSlot(type, name, func_ctype)\
912 ((__PYX_LIMITED_VERSION_HEX >= 0x030A0000 ||\
913 (PyType_GetFlags(type) & Py_TPFLAGS_HEAPTYPE) || __Pyx_get_runtime_version() >= 0x030A0000) ?\
914 __Pyx_PyType_GetSlot(type, name, func_ctype) : NULL)
915 #define __Pyx_PyType_GetSubSlot(obj, sub, name, func_ctype) __Pyx_PyType_GetSlot(obj, name, func_ctype)
916 #define __Pyx_PyType_TryGetSubSlot(obj, sub, name, func_ctype) __Pyx_PyType_TryGetSlot(obj, name, func_ctype)
918#if CYTHON_COMPILING_IN_CPYTHON || defined(_PyDict_NewPresized)
919#define __Pyx_PyDict_NewPresized(n) ((n <= 8) ? PyDict_New() : _PyDict_NewPresized(n))
921#define __Pyx_PyDict_NewPresized(n) PyDict_New()
923#define __Pyx_PyNumber_Divide(x,y) PyNumber_TrueDivide(x,y)
924#define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceTrueDivide(x,y)
925#if CYTHON_COMPILING_IN_CPYTHON && CYTHON_USE_UNICODE_INTERNALS
926#define __Pyx_PyDict_GetItemStrWithError(dict, name) _PyDict_GetItem_KnownHash(dict, name, ((PyASCIIObject *) name)->hash)
927static CYTHON_INLINE PyObject * __Pyx_PyDict_GetItemStr(PyObject *dict, PyObject *name) {
928 PyObject *res = __Pyx_PyDict_GetItemStrWithError(dict, name);
929 if (res == NULL && PyErr_Occurred()) {
930 PyErr_WriteUnraisable(NULL);
934#elif !CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07020000
935#define __Pyx_PyDict_GetItemStrWithError PyDict_GetItemWithError
936#define __Pyx_PyDict_GetItemStr PyDict_GetItem
938static CYTHON_INLINE PyObject * __Pyx_PyDict_GetItemStrWithError(PyObject *dict, PyObject *name) {
939#if CYTHON_COMPILING_IN_PYPY
940 return PyDict_GetItem(dict, name);
943 PyDictObject *mp = (PyDictObject*) dict;
944 long hash = ((PyStringObject *) name)->ob_shash;
946 ep = (mp->ma_lookup)(mp, name, hash);
953#define __Pyx_PyDict_GetItemStr PyDict_GetItem
955#if CYTHON_USE_TYPE_SLOTS
956 #define __Pyx_PyType_GetFlags(tp) (((PyTypeObject *)tp)->tp_flags)
957 #define __Pyx_PyType_HasFeature(type, feature) ((__Pyx_PyType_GetFlags(type) & (feature)) != 0)
959 #define __Pyx_PyType_GetFlags(tp) (PyType_GetFlags((PyTypeObject *)tp))
960 #define __Pyx_PyType_HasFeature(type, feature) PyType_HasFeature(type, feature)
962#define __Pyx_PyObject_GetIterNextFunc(iterator) __Pyx_PyObject_GetSlot(iterator, tp_iternext, iternextfunc)
963#if CYTHON_USE_TYPE_SPECS
964#define __Pyx_PyHeapTypeObject_GC_Del(obj) {\
965 PyTypeObject *type = Py_TYPE((PyObject*)obj);\
966 assert(__Pyx_PyType_HasFeature(type, Py_TPFLAGS_HEAPTYPE));\
967 PyObject_GC_Del(obj);\
971#define __Pyx_PyHeapTypeObject_GC_Del(obj) PyObject_GC_Del(obj)
973#if CYTHON_COMPILING_IN_LIMITED_API
974 #define __Pyx_PyUnicode_READY(op) (0)
975 #define __Pyx_PyUnicode_READ_CHAR(u, i) PyUnicode_ReadChar(u, i)
976 #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u) ((void)u, 1114111U)
977 #define __Pyx_PyUnicode_KIND(u) ((void)u, (0))
978 #define __Pyx_PyUnicode_KIND_04(u) __Pyx_PyUnicode_KIND(u)
979 #define __Pyx_PyUnicode_DATA(u) ((void*)u)
980 #define __Pyx_PyUnicode_READ(k, d, i) ((void)k, PyUnicode_ReadChar((PyObject*)(d), i))
981 #define __Pyx_PyUnicode_IS_TRUE(u) (0 != PyUnicode_GetLength(u))
983 #if PY_VERSION_HEX >= 0x030C0000
984 #define __Pyx_PyUnicode_READY(op) (0)
986 #define __Pyx_PyUnicode_READY(op) (likely(PyUnicode_IS_READY(op)) ?\
987 0 : _PyUnicode_Ready((PyObject *)(op)))
989 #define __Pyx_PyUnicode_READ_CHAR(u, i) PyUnicode_READ_CHAR(u, i)
990 #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u) PyUnicode_MAX_CHAR_VALUE(u)
991 #define __Pyx_PyUnicode_KIND(u) ((int)PyUnicode_KIND(u))
992 #define __Pyx_PyUnicode_DATA(u) PyUnicode_DATA(u)
993 #define __Pyx_PyUnicode_READ(k, d, i) PyUnicode_READ(k, d, i)
994 #define __Pyx_PyUnicode_WRITE(k, d, i, ch) PyUnicode_WRITE(k, d, i, (Py_UCS4) ch)
995 #if PY_VERSION_HEX >= 0x030C0000
996 #define __Pyx_PyUnicode_IS_TRUE(u) (0 != PyUnicode_GET_LENGTH(u))
998 #if CYTHON_COMPILING_IN_CPYTHON
999 #define __Pyx_PyUnicode_IS_TRUE(u) (0 != (likely(PyUnicode_IS_READY(u)) ? PyUnicode_GET_LENGTH(u) : ((PyCompactUnicodeObject *)(u))->wstr_length))
1001 #define __Pyx_PyUnicode_IS_TRUE(u) (0 != (likely(PyUnicode_IS_READY(u)) ? PyUnicode_GET_LENGTH(u) : PyUnicode_GET_SIZE(u)))
1004 static CYTHON_INLINE
int __Pyx_PyUnicode_KIND_04(PyObject *o) {
1005 return __Pyx_PyUnicode_KIND(o) - (int) !!PyUnicode_IS_ASCII(o);
1008#if CYTHON_COMPILING_IN_PYPY
1009 #define __Pyx_PyUnicode_Concat(a, b) PyNumber_Add(a, b)
1010 #define __Pyx_PyUnicode_ConcatSafe(a, b) PyNumber_Add(a, b)
1012 #define __Pyx_PyUnicode_Concat(a, b) PyUnicode_Concat(a, b)
1013 #define __Pyx_PyUnicode_ConcatSafe(a, b) ((unlikely((a) == Py_None) || unlikely((b) == Py_None)) ?\
1014 PyNumber_Add(a, b) : __Pyx_PyUnicode_Concat(a, b))
1016#if CYTHON_COMPILING_IN_PYPY
1017 #if !defined(PyUnicode_DecodeUnicodeEscape)
1018 #define PyUnicode_DecodeUnicodeEscape(s, size, errors) PyUnicode_Decode(s, size, "unicode_escape", errors)
1020 #if !defined(PyUnicode_Contains)
1021 #define PyUnicode_Contains(u, s) PySequence_Contains(u, s)
1023 #if !defined(PyByteArray_Check)
1024 #define PyByteArray_Check(obj) PyObject_TypeCheck(obj, &PyByteArray_Type)
1026 #if !defined(PyObject_Format)
1027 #define PyObject_Format(obj, fmt) PyObject_CallMethod(obj, "__format__", "O", fmt)
1030#define __Pyx_PyUnicode_FormatSafe(a, b) ((unlikely((a) == Py_None || (PyUnicode_Check(b) && !PyUnicode_CheckExact(b)))) ? PyNumber_Remainder(a, b) : PyUnicode_Format(a, b))
1031#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
1032 #define __Pyx_PySequence_ListKeepNew(obj)\
1033 (likely(PyList_CheckExact(obj) && PyUnstable_Object_IsUniquelyReferenced(obj)) ? __Pyx_NewRef(obj) : PySequence_List(obj))
1034#elif CYTHON_COMPILING_IN_CPYTHON
1035 #define __Pyx_PySequence_ListKeepNew(obj)\
1036 (likely(PyList_CheckExact(obj) && Py_REFCNT(obj) == 1) ? __Pyx_NewRef(obj) : PySequence_List(obj))
1038 #define __Pyx_PySequence_ListKeepNew(obj) PySequence_List(obj)
1040#ifndef PySet_CheckExact
1041 #define PySet_CheckExact(obj) Py_IS_TYPE(obj, &PySet_Type)
1043enum __Pyx_ReferenceSharing {
1044 __Pyx_ReferenceSharing_DefinitelyUnique,
1045 __Pyx_ReferenceSharing_OwnStrongReference,
1046 __Pyx_ReferenceSharing_FunctionArgument,
1047 __Pyx_ReferenceSharing_SharedReference,
1049#if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING && PY_VERSION_HEX >= 0x030E0000
1050#define __Pyx_IS_UNIQUELY_REFERENCED(o, sharing)\
1051 (sharing == __Pyx_ReferenceSharing_DefinitelyUnique ? 1 :\
1052 (sharing == __Pyx_ReferenceSharing_FunctionArgument ? PyUnstable_Object_IsUniqueReferencedTemporary(o) :\
1053 (sharing == __Pyx_ReferenceSharing_OwnStrongReference ? PyUnstable_Object_IsUniquelyReferenced(o) : 0)))
1054#elif (CYTHON_COMPILING_IN_CPYTHON && !CYTHON_COMPILING_IN_CPYTHON_FREETHREADING) || CYTHON_COMPILING_IN_LIMITED_API
1055#define __Pyx_IS_UNIQUELY_REFERENCED(o, sharing) (((void)sharing), Py_REFCNT(o) == 1)
1057#define __Pyx_IS_UNIQUELY_REFERENCED(o, sharing) (((void)o), ((void)sharing), 0)
1059#if __PYX_LIMITED_VERSION_HEX >= 0x030d0000
1060 #define __Pyx_PyList_GetItemRef(o, i) PyList_GetItemRef(o, i)
1061#elif CYTHON_AVOID_BORROWED_REFS || CYTHON_AVOID_THREAD_UNSAFE_BORROWED_REFS
1062 #if CYTHON_COMPILING_IN_LIMITED_API || !CYTHON_ASSUME_SAFE_MACROS
1063 #define __Pyx_PyList_GetItemRef(o, i) (likely((i) >= 0) ? PySequence_GetItem(o, i) : (PyErr_SetString(PyExc_IndexError, "list index out of range"), (PyObject*)NULL))
1065 #define __Pyx_PyList_GetItemRef(o, i) PySequence_ITEM(o, i)
1067#elif CYTHON_COMPILING_IN_LIMITED_API || !(CYTHON_ASSUME_SAFE_MACROS && CYTHON_ASSUME_SAFE_SIZE)
1068 #define __Pyx_PyList_GetItemRef(o, i) __Pyx_XNewRef(PyList_GetItem(o, i))
1070 #define __Pyx_PyList_GetItemRef(o, i) (likely(__Pyx_is_valid_index(i, PyList_GET_SIZE(o))) ?\
1071 __Pyx_NewRef(PyList_GET_ITEM(o, i)) : (PyErr_SetString(PyExc_IndexError, "list index out of range"), (PyObject*)NULL))
1073#if CYTHON_AVOID_BORROWED_REFS || CYTHON_COMPILING_IN_LIMITED_API
1074 #define __Pyx_PyList_GET_ITEM_REF(o, i, unsafe_shared) ((void)(unsafe_shared),\
1075 __Pyx_PyList_GetItemRef(o, i))
1076#elif CYTHON_AVOID_THREAD_UNSAFE_BORROWED_REFS
1077 #if CYTHON_ASSUME_SAFE_MACROS
1078 #define __Pyx_PyList_GET_ITEM_REF(o, i, unsafe_shared) (\
1079 __Pyx_IS_UNIQUELY_REFERENCED(o, unsafe_shared) ?\
1080 __Pyx_NewRef(PyList_GET_ITEM(o, i)) : __Pyx_PyList_GetItemRef(o, i))
1082 #define __Pyx_PyList_GET_ITEM_REF(o, i, unsafe_shared) (\
1083 __Pyx_IS_UNIQUELY_REFERENCED(o, unsafe_shared) ?\
1084 __Pyx_XNewRef(PyList_GetItem(o, i)) : __Pyx_PyList_GetItemRef(o, i))
1086#elif CYTHON_ASSUME_SAFE_MACROS
1087 #define __Pyx_PyList_GET_ITEM_REF(o, i, unsafe_shared) ((void)(unsafe_shared),\
1088 __Pyx_NewRef(PyList_GET_ITEM(o, i)))
1090 #define __Pyx_PyList_GET_ITEM_REF(o, i, unsafe_shared) ((void)(unsafe_shared),\
1091 __Pyx_XNewRef(PyList_GetItem(o, i)))
1093#if __PYX_LIMITED_VERSION_HEX >= 0x030d0000
1094#define __Pyx_PyDict_GetItemRef(dict, key, result) PyDict_GetItemRef(dict, key, result)
1095#elif CYTHON_AVOID_BORROWED_REFS || CYTHON_AVOID_THREAD_UNSAFE_BORROWED_REFS
1096static CYTHON_INLINE
int __Pyx_PyDict_GetItemRef(PyObject *dict, PyObject *key, PyObject **result) {
1097 *result = PyObject_GetItem(dict, key);
1098 if (*result == NULL) {
1099 if (PyErr_ExceptionMatches(PyExc_KeyError)) {
1108static CYTHON_INLINE
int __Pyx_PyDict_GetItemRef(PyObject *dict, PyObject *key, PyObject **result) {
1109 *result = PyDict_GetItemWithError(dict, key);
1110 if (*result == NULL) {
1111 return PyErr_Occurred() ? -1 : 0;
1117#if defined(CYTHON_DEBUG_VISIT_CONST) && CYTHON_DEBUG_VISIT_CONST
1118 #define __Pyx_VISIT_CONST(obj) Py_VISIT(obj)
1120 #define __Pyx_VISIT_CONST(obj)
1122#if CYTHON_ASSUME_SAFE_MACROS
1123 #define __Pyx_PySequence_ITEM(o, i) PySequence_ITEM(o, i)
1124 #define __Pyx_PySequence_SIZE(seq) Py_SIZE(seq)
1125 #define __Pyx_PyTuple_SET_ITEM(o, i, v) (PyTuple_SET_ITEM(o, i, v), (0))
1126 #define __Pyx_PyTuple_GET_ITEM(o, i) PyTuple_GET_ITEM(o, i)
1127 #define __Pyx_PyList_SET_ITEM(o, i, v) (PyList_SET_ITEM(o, i, v), (0))
1128 #define __Pyx_PyList_GET_ITEM(o, i) PyList_GET_ITEM(o, i)
1130 #define __Pyx_PySequence_ITEM(o, i) PySequence_GetItem(o, i)
1131 #define __Pyx_PySequence_SIZE(seq) PySequence_Size(seq)
1132 #define __Pyx_PyTuple_SET_ITEM(o, i, v) PyTuple_SetItem(o, i, v)
1133 #define __Pyx_PyTuple_GET_ITEM(o, i) PyTuple_GetItem(o, i)
1134 #define __Pyx_PyList_SET_ITEM(o, i, v) PyList_SetItem(o, i, v)
1135 #define __Pyx_PyList_GET_ITEM(o, i) PyList_GetItem(o, i)
1137#if CYTHON_ASSUME_SAFE_SIZE
1138 #define __Pyx_PyTuple_GET_SIZE(o) PyTuple_GET_SIZE(o)
1139 #define __Pyx_PyList_GET_SIZE(o) PyList_GET_SIZE(o)
1140 #define __Pyx_PySet_GET_SIZE(o) PySet_GET_SIZE(o)
1141 #define __Pyx_PyDict_GET_SIZE(o) PyDict_GET_SIZE(o)
1142 #define __Pyx_PyBytes_GET_SIZE(o) PyBytes_GET_SIZE(o)
1143 #define __Pyx_PyByteArray_GET_SIZE(o) PyByteArray_GET_SIZE(o)
1144 #define __Pyx_PyUnicode_GET_LENGTH(o) PyUnicode_GET_LENGTH(o)
1146 #define __Pyx_PyTuple_GET_SIZE(o) PyTuple_Size(o)
1147 #define __Pyx_PyList_GET_SIZE(o) PyList_Size(o)
1148 #define __Pyx_PySet_GET_SIZE(o) PySet_Size(o)
1149 #define __Pyx_PyDict_GET_SIZE(o) PyDict_Size(o)
1150 #define __Pyx_PyBytes_GET_SIZE(o) PyBytes_Size(o)
1151 #define __Pyx_PyByteArray_GET_SIZE(o) PyByteArray_Size(o)
1152 #define __Pyx_PyUnicode_GET_LENGTH(o) PyUnicode_GetLength(o)
1154#if CYTHON_COMPILING_IN_PYPY && !defined(PyUnicode_InternFromString)
1155 #define PyUnicode_InternFromString(s) PyUnicode_FromString(s)
1157#define __Pyx_PyLong_FromHash_t PyLong_FromSsize_t
1158#define __Pyx_PyLong_AsHash_t __Pyx_PyIndex_AsSsize_t
1159#if __PYX_LIMITED_VERSION_HEX >= 0x030A0000
1160 #define __Pyx_PySendResult PySendResult
1166 } __Pyx_PySendResult;
1168#if CYTHON_COMPILING_IN_LIMITED_API || PY_VERSION_HEX < 0x030A00A3
1169 typedef __Pyx_PySendResult (*__Pyx_pyiter_sendfunc)(PyObject *iter, PyObject *value, PyObject **result);
1171 #define __Pyx_pyiter_sendfunc sendfunc
1173#if !CYTHON_USE_AM_SEND
1174#define __PYX_HAS_PY_AM_SEND 0
1175#elif __PYX_LIMITED_VERSION_HEX >= 0x030A0000
1176#define __PYX_HAS_PY_AM_SEND 1
1178#define __PYX_HAS_PY_AM_SEND 2
1180#if __PYX_HAS_PY_AM_SEND < 2
1181 #define __Pyx_PyAsyncMethodsStruct PyAsyncMethods
1187 __Pyx_pyiter_sendfunc am_send;
1188 } __Pyx_PyAsyncMethodsStruct;
1189 #define __Pyx_SlotTpAsAsync(s) ((PyAsyncMethods*)(s))
1191#if CYTHON_USE_AM_SEND && PY_VERSION_HEX < 0x030A00F0
1192 #define __Pyx_TPFLAGS_HAVE_AM_SEND (1UL << 21)
1194 #define __Pyx_TPFLAGS_HAVE_AM_SEND (0)
1196#if CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030A0000
1200PyAPI_FUNC(
void *) PyMem_Calloc(
size_t nelem,
size_t elsize);
1202#if CYTHON_COMPILING_IN_LIMITED_API
1203static int __Pyx_init_co_variable(PyObject *inspect,
const char* name,
int *write_to) {
1205 PyObject *py_value = PyObject_GetAttrString(inspect, name);
1206 if (!py_value)
return 0;
1207 value = (int) PyLong_AsLong(py_value);
1208 Py_DECREF(py_value);
1210 return value != -1 || !PyErr_Occurred();
1212static int __Pyx_init_co_variables(
void) {
1215 inspect = PyImport_ImportModule(
"inspect");
1217#if !defined(CO_OPTIMIZED)
1218 __Pyx_init_co_variable(inspect,
"CO_OPTIMIZED", &CO_OPTIMIZED) &&
1220#if !defined(CO_NEWLOCALS)
1221 __Pyx_init_co_variable(inspect,
"CO_NEWLOCALS", &CO_NEWLOCALS) &&
1223#if !defined(CO_VARARGS)
1224 __Pyx_init_co_variable(inspect,
"CO_VARARGS", &CO_VARARGS) &&
1226#if !defined(CO_VARKEYWORDS)
1227 __Pyx_init_co_variable(inspect,
"CO_VARKEYWORDS", &CO_VARKEYWORDS) &&
1229#if !defined(CO_ASYNC_GENERATOR)
1230 __Pyx_init_co_variable(inspect,
"CO_ASYNC_GENERATOR", &CO_ASYNC_GENERATOR) &&
1232#if !defined(CO_GENERATOR)
1233 __Pyx_init_co_variable(inspect,
"CO_GENERATOR", &CO_GENERATOR) &&
1235#if !defined(CO_COROUTINE)
1236 __Pyx_init_co_variable(inspect,
"CO_COROUTINE", &CO_COROUTINE) &&
1240 return result ? 0 : -1;
1242static int __Pyx_init_tpflags_bitcount(
unsigned long flag) {
1245 count += (int) (flag & 1);
1250static int __Pyx_init_tpflags_variables(
void) {
1251 if (__Pyx_Runtime_TPFLAGS_SEQUENCE != 0 && __Pyx_Runtime_TPFLAGS_MAPPING != 0) {
1254 PyObject *collections_abc = PyImport_ImportModule(
"collections.abc");
1255 if (!collections_abc)
return -1;
1257 PyObject *sequence = NULL, *mapping = NULL;
1258#if __PYX_LIMITED_VERSION_HEX >= 0x030D0000
1259 if (PyObject_GetOptionalAttrString(collections_abc,
"Sequence", &sequence) != 1)
goto fail;
1260 if (PyObject_GetOptionalAttrString(collections_abc,
"Mapping", &mapping) != 1)
goto fail;
1262 sequence = PyObject_GetAttrString(collections_abc,
"Sequence");
1263 if (!sequence)
goto fail_attr_lookup;
1264 mapping = PyObject_GetAttrString(collections_abc,
"Mapping");
1265 if (!mapping)
goto fail_attr_lookup;
1267 if (!PyType_Check(sequence) || !PyType_Check(mapping))
goto fail;
1269 unsigned long sequence_flags = PyType_GetFlags((PyTypeObject*)sequence);
1270 unsigned long mapping_flags = PyType_GetFlags((PyTypeObject*)mapping);
1271 unsigned long mutual_flags = sequence_flags & mapping_flags;
1272 sequence_flags = sequence_flags ^ mutual_flags;
1273 mapping_flags = mapping_flags ^ mutual_flags;
1274 if (__Pyx_Runtime_TPFLAGS_SEQUENCE == 0 && __Pyx_init_tpflags_bitcount(sequence_flags) == 1) {
1275 __Pyx_Runtime_TPFLAGS_SEQUENCE = sequence_flags;
1277 if (__Pyx_Runtime_TPFLAGS_MAPPING == 0 && __Pyx_init_tpflags_bitcount(mapping_flags) == 1) {
1278 __Pyx_Runtime_TPFLAGS_MAPPING = mapping_flags;
1282 Py_XDECREF(mapping);
1283 Py_XDECREF(sequence);
1284 Py_DECREF(collections_abc);
1286#if __PYX_LIMITED_VERSION_HEX < 0x030D0000
1288 if (PyErr_ExceptionMatches(PyExc_AttributeError)) {
1293 result = PyErr_Occurred() ? -1 : 0;
1297static int __Pyx_init_co_variables(
void) {
1300static int __Pyx_init_tpflags_variables(
void) {
1306#if defined(_WIN32) || defined(WIN32) || defined(MS_WINDOWS)
1307 #ifndef _USE_MATH_DEFINES
1308 #define _USE_MATH_DEFINES
1312#if defined(__CYGWIN__) && defined(_LDBL_EQ_DBL)
1313#define __Pyx_truncl trunc
1315#define __Pyx_truncl truncl
1318#ifndef CYTHON_CLINE_IN_TRACEBACK_RUNTIME
1319#define CYTHON_CLINE_IN_TRACEBACK_RUNTIME 1
1321#ifndef CYTHON_CLINE_IN_TRACEBACK
1322#define CYTHON_CLINE_IN_TRACEBACK CYTHON_CLINE_IN_TRACEBACK_RUNTIME
1324#if CYTHON_CLINE_IN_TRACEBACK
1325#define __PYX_MARK_ERR_POS(f_index, lineno) { __pyx_filename = __pyx_f[f_index]; (void) __pyx_filename; __pyx_lineno = lineno; (void) __pyx_lineno; __pyx_clineno = __LINE__; (void) __pyx_clineno; }
1327#define __PYX_MARK_ERR_POS(f_index, lineno) { __pyx_filename = __pyx_f[f_index]; (void) __pyx_filename; __pyx_lineno = lineno; (void) __pyx_lineno; (void) __pyx_clineno; }
1329#define __PYX_ERR(f_index, lineno, Ln_error) \
1330 { __PYX_MARK_ERR_POS(f_index, lineno) goto Ln_error; }
1332#ifdef CYTHON_EXTERN_C
1333 #undef __PYX_EXTERN_C
1334 #define __PYX_EXTERN_C CYTHON_EXTERN_C
1335#elif defined(__PYX_EXTERN_C)
1337 #pragma message ("Please do not define the '__PYX_EXTERN_C' macro externally. Use 'CYTHON_EXTERN_C' instead.")
1339 #warning Please do not define the '__PYX_EXTERN_C' macro externally. Use 'CYTHON_EXTERN_C' instead.
1342 #define __PYX_EXTERN_C extern "C++"
1345#define __PYX_HAVE__cSubsurfaceTransportCoefficients
1346#define __PYX_HAVE_API__cSubsurfaceTransportCoefficients
1353#include "numpy/arrayobject.h"
1354#include "numpy/ndarrayobject.h"
1355#include "numpy/ndarraytypes.h"
1356#include "numpy/arrayscalars.h"
1357#include "numpy/ufuncobject.h"
1363#if defined(PYREX_WITHOUT_ASSERTIONS) && !defined(CYTHON_WITHOUT_ASSERTIONS)
1364#define CYTHON_WITHOUT_ASSERTIONS
1367#ifdef CYTHON_FREETHREADING_COMPATIBLE
1368#if CYTHON_FREETHREADING_COMPATIBLE
1369#define __Pyx_FREETHREADING_COMPATIBLE Py_MOD_GIL_NOT_USED
1371#define __Pyx_FREETHREADING_COMPATIBLE Py_MOD_GIL_USED
1374#define __Pyx_FREETHREADING_COMPATIBLE Py_MOD_GIL_USED
1376#define __PYX_DEFAULT_STRING_ENCODING_IS_ASCII 0
1377#define __PYX_DEFAULT_STRING_ENCODING_IS_UTF8 0
1378#define __PYX_DEFAULT_STRING_ENCODING ""
1379#define __Pyx_PyObject_FromString __Pyx_PyBytes_FromString
1380#define __Pyx_PyObject_FromStringAndSize __Pyx_PyBytes_FromStringAndSize
1381#define __Pyx_uchar_cast(c) ((unsigned char)c)
1382#define __Pyx_long_cast(x) ((long)x)
1383#define __Pyx_fits_Py_ssize_t(v, type, is_signed) (\
1384 (sizeof(type) < sizeof(Py_ssize_t)) ||\
1385 (sizeof(type) > sizeof(Py_ssize_t) &&\
1386 likely(v < (type)PY_SSIZE_T_MAX ||\
1387 v == (type)PY_SSIZE_T_MAX) &&\
1388 (!is_signed || likely(v > (type)PY_SSIZE_T_MIN ||\
1389 v == (type)PY_SSIZE_T_MIN))) ||\
1390 (sizeof(type) == sizeof(Py_ssize_t) &&\
1391 (is_signed || likely(v < (type)PY_SSIZE_T_MAX ||\
1392 v == (type)PY_SSIZE_T_MAX))) )
1393static CYTHON_INLINE
int __Pyx_is_valid_index(Py_ssize_t i, Py_ssize_t limit) {
1394 return (
size_t) i < (size_t) limit;
1396#if defined (__cplusplus) && __cplusplus >= 201103L
1398 #define __Pyx_sst_abs(value) std::abs(value)
1399#elif SIZEOF_INT >= SIZEOF_SIZE_T
1400 #define __Pyx_sst_abs(value) abs(value)
1401#elif SIZEOF_LONG >= SIZEOF_SIZE_T
1402 #define __Pyx_sst_abs(value) labs(value)
1403#elif defined (_MSC_VER)
1404 #define __Pyx_sst_abs(value) ((Py_ssize_t)_abs64(value))
1405#elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
1406 #define __Pyx_sst_abs(value) llabs(value)
1407#elif defined (__GNUC__)
1408 #define __Pyx_sst_abs(value) __builtin_llabs(value)
1410 #define __Pyx_sst_abs(value) ((value<0) ? -value : value)
1412static CYTHON_INLINE Py_ssize_t __Pyx_ssize_strlen(
const char *
s);
1413static CYTHON_INLINE
const char* __Pyx_PyObject_AsString(PyObject*);
1414static CYTHON_INLINE
const char* __Pyx_PyObject_AsStringAndSize(PyObject*, Py_ssize_t* length);
1415static CYTHON_INLINE PyObject* __Pyx_PyByteArray_FromString(
const char*);
1416#define __Pyx_PyByteArray_FromStringAndSize(s, l) PyByteArray_FromStringAndSize((const char*)s, l)
1417#define __Pyx_PyBytes_FromString PyBytes_FromString
1418#define __Pyx_PyBytes_FromStringAndSize PyBytes_FromStringAndSize
1419static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(
const char*);
1420#if CYTHON_ASSUME_SAFE_MACROS
1421 #define __Pyx_PyBytes_AsWritableString(s) ((char*) PyBytes_AS_STRING(s))
1422 #define __Pyx_PyBytes_AsWritableSString(s) ((signed char*) PyBytes_AS_STRING(s))
1423 #define __Pyx_PyBytes_AsWritableUString(s) ((unsigned char*) PyBytes_AS_STRING(s))
1424 #define __Pyx_PyBytes_AsString(s) ((const char*) PyBytes_AS_STRING(s))
1425 #define __Pyx_PyBytes_AsSString(s) ((const signed char*) PyBytes_AS_STRING(s))
1426 #define __Pyx_PyBytes_AsUString(s) ((const unsigned char*) PyBytes_AS_STRING(s))
1427 #define __Pyx_PyByteArray_AsString(s) PyByteArray_AS_STRING(s)
1429 #define __Pyx_PyBytes_AsWritableString(s) ((char*) PyBytes_AsString(s))
1430 #define __Pyx_PyBytes_AsWritableSString(s) ((signed char*) PyBytes_AsString(s))
1431 #define __Pyx_PyBytes_AsWritableUString(s) ((unsigned char*) PyBytes_AsString(s))
1432 #define __Pyx_PyBytes_AsString(s) ((const char*) PyBytes_AsString(s))
1433 #define __Pyx_PyBytes_AsSString(s) ((const signed char*) PyBytes_AsString(s))
1434 #define __Pyx_PyBytes_AsUString(s) ((const unsigned char*) PyBytes_AsString(s))
1435 #define __Pyx_PyByteArray_AsString(s) PyByteArray_AsString(s)
1437#define __Pyx_PyObject_AsWritableString(s) ((char*)(__pyx_uintptr_t) __Pyx_PyObject_AsString(s))
1438#define __Pyx_PyObject_AsWritableSString(s) ((signed char*)(__pyx_uintptr_t) __Pyx_PyObject_AsString(s))
1439#define __Pyx_PyObject_AsWritableUString(s) ((unsigned char*)(__pyx_uintptr_t) __Pyx_PyObject_AsString(s))
1440#define __Pyx_PyObject_AsSString(s) ((const signed char*) __Pyx_PyObject_AsString(s))
1441#define __Pyx_PyObject_AsUString(s) ((const unsigned char*) __Pyx_PyObject_AsString(s))
1442#define __Pyx_PyObject_FromCString(s) __Pyx_PyObject_FromString((const char*)s)
1443#define __Pyx_PyBytes_FromCString(s) __Pyx_PyBytes_FromString((const char*)s)
1444#define __Pyx_PyByteArray_FromCString(s) __Pyx_PyByteArray_FromString((const char*)s)
1445#define __Pyx_PyUnicode_FromCString(s) __Pyx_PyUnicode_FromString((const char*)s)
1446#define __Pyx_PyUnicode_FromOrdinal(o) PyUnicode_FromOrdinal((int)o)
1447#define __Pyx_PyUnicode_AsUnicode PyUnicode_AsUnicode
1448static CYTHON_INLINE PyObject *__Pyx_NewRef(PyObject *obj) {
1449#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030a0000 || defined(Py_NewRef)
1450 return Py_NewRef(obj);
1456static CYTHON_INLINE PyObject *__Pyx_XNewRef(PyObject *obj) {
1457#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030a0000 || defined(Py_XNewRef)
1458 return Py_XNewRef(obj);
1464static CYTHON_INLINE PyObject *__Pyx_Owned_Py_None(
int b);
1465static CYTHON_INLINE PyObject * __Pyx_PyBool_FromLong(
long b);
1466static CYTHON_INLINE
int __Pyx_PyObject_IsTrue(PyObject*);
1467static CYTHON_INLINE
int __Pyx_PyObject_IsTrueAndDecref(PyObject*);
1468static CYTHON_INLINE PyObject* __Pyx_PyNumber_Long(PyObject* x);
1469#define __Pyx_PyObject_RichCompareBool(a,b,cmp) __Pyx_PyObject_IsTrueAndDecref(PyObject_RichCompare((a),(b),(cmp)))
1470#define __Pyx_PySequence_Tuple(obj)\
1471 (likely(PyTuple_CheckExact(obj)) ? __Pyx_NewRef(obj) : PySequence_Tuple(obj))
1472static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject*);
1473static CYTHON_INLINE PyObject * __Pyx_PyLong_FromSize_t(
size_t);
1474static CYTHON_INLINE Py_hash_t __Pyx_PyIndex_AsHash_t(PyObject*);
1475#if CYTHON_ASSUME_SAFE_MACROS
1476#define __Pyx_PyFloat_AsDouble(x) (PyFloat_CheckExact(x) ? PyFloat_AS_DOUBLE(x) : PyFloat_AsDouble(x))
1477#define __Pyx_PyFloat_AS_DOUBLE(x) PyFloat_AS_DOUBLE(x)
1478#define __Pyx_PyFloat_IsNonZero(x) (PyFloat_AS_DOUBLE(x) != 0.0)
1480#define __Pyx_PyFloat_AsDouble(x) PyFloat_AsDouble(x)
1481#define __Pyx_PyFloat_AS_DOUBLE(x) PyFloat_AsDouble(x)
1482#define __Pyx_PyFloat_IsNonZero(x) PyObject_IsTrue(x)
1484#define __Pyx_PyFloat_AsFloat(x) ((float) __Pyx_PyFloat_AsDouble(x))
1485#define __Pyx_PyNumber_Int(x) (PyLong_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Long(x))
1486#if CYTHON_USE_PYLONG_INTERNALS
1487 #if PY_VERSION_HEX >= 0x030C00A7
1488 #ifndef _PyLong_SIGN_MASK
1489 #define _PyLong_SIGN_MASK 3
1491 #ifndef _PyLong_NON_SIZE_BITS
1492 #define _PyLong_NON_SIZE_BITS 3
1494 #define __Pyx_PyLong_SignBits(x) ((int) (((PyLongObject*)x)->long_value.lv_tag & _PyLong_SIGN_MASK))
1495 #define __Pyx_PyLong_Sign(x) (1 - __Pyx_PyLong_SignBits(x))
1496 #define __Pyx_PyLong_IsNeg(x) ((__Pyx_PyLong_SignBits(x) & 2) != 0)
1497 #define __Pyx_PyLong_IsNonNeg(x) (!__Pyx_PyLong_IsNeg(x))
1498 #define __Pyx_PyLong_IsZero(x) (__Pyx_PyLong_SignBits(x) & 1)
1499 #define __Pyx_PyLong_IsPos(x) (__Pyx_PyLong_SignBits(x) == 0)
1500 #define __Pyx_PyLong_CompactValueUnsigned(x) (__Pyx_PyLong_Digits(x)[0])
1501 #define __Pyx_PyLong_DigitCount(x) ((Py_ssize_t) (((PyLongObject*)x)->long_value.lv_tag >> _PyLong_NON_SIZE_BITS))
1502 #define __Pyx_PyLong_SignedDigitCount(x)\
1503 (((Py_ssize_t) __Pyx_PyLong_Sign(x)) * __Pyx_PyLong_DigitCount(x))
1504 #if defined(PyUnstable_Long_IsCompact) && defined(PyUnstable_Long_CompactValue)
1505 #define __Pyx_PyLong_IsCompact(x) PyUnstable_Long_IsCompact((PyLongObject*) x)
1506 #define __Pyx_PyLong_CompactValue(x) PyUnstable_Long_CompactValue((PyLongObject*) x)
1508 #define __Pyx_PyLong_IsCompact(x) (((PyLongObject*)x)->long_value.lv_tag < (2 << _PyLong_NON_SIZE_BITS))
1509 #define __Pyx_PyLong_CompactValue(x) (((Py_ssize_t) __Pyx_PyLong_Sign(x)) * (Py_ssize_t) __Pyx_PyLong_Digits(x)[0])
1511 static CYTHON_INLINE Py_ssize_t __Pyx_PyLong_CompareSignAndSize(PyObject *a, PyObject *b) {
1512 uintptr_t tag_a = ((PyLongObject*)a)->long_value.lv_tag;
1513 uintptr_t tag_b = ((PyLongObject*)b)->long_value.lv_tag;
1514 if (tag_a == tag_b)
return 0;
1515 int sign_a = (int) (tag_a & _PyLong_SIGN_MASK);
1516 int sign_b = (int) (tag_b & _PyLong_SIGN_MASK);
1517 if (sign_a > sign_b)
return -1;
1518 if (sign_a < sign_b)
return 1;
1519 Py_ssize_t size_a = (Py_ssize_t) (tag_a >> _PyLong_NON_SIZE_BITS);
1520 Py_ssize_t size_b = (Py_ssize_t) (tag_b >> _PyLong_NON_SIZE_BITS);
1521 return (1 - sign_a) * (size_a - size_b);
1523 typedef Py_ssize_t __Pyx_compact_pylong;
1524 typedef size_t __Pyx_compact_upylong;
1526 #define __Pyx_PyLong_Sign(x) ((int) ((Py_SIZE(x) == 0) ? 0 : (Py_SIZE(x) < 0) ? -1 : 1))
1527 #define __Pyx_PyLong_IsNeg(x) (Py_SIZE(x) < 0)
1528 #define __Pyx_PyLong_IsNonNeg(x) (Py_SIZE(x) >= 0)
1529 #define __Pyx_PyLong_IsZero(x) (Py_SIZE(x) == 0)
1530 #define __Pyx_PyLong_IsPos(x) (Py_SIZE(x) > 0)
1531 #define __Pyx_PyLong_CompactValueUnsigned(x) ((Py_SIZE(x) == 0) ? 0 : __Pyx_PyLong_Digits(x)[0])
1532 #define __Pyx_PyLong_DigitCount(x) __Pyx_sst_abs(Py_SIZE(x))
1533 #define __Pyx_PyLong_SignedDigitCount(x) Py_SIZE(x)
1534 #define __Pyx_PyLong_IsCompact(x) (Py_SIZE(x) == 0 || Py_SIZE(x) == 1 || Py_SIZE(x) == -1)
1535 #define __Pyx_PyLong_CompactValue(x)\
1536 ((Py_SIZE(x) == 0) ? (sdigit) 0 : ((Py_SIZE(x) < 0) ? -(sdigit)__Pyx_PyLong_Digits(x)[0] : (sdigit)__Pyx_PyLong_Digits(x)[0]))
1537 #define __Pyx_PyLong_CompareSignAndSize(a, b) (Py_SIZE(a) - Py_SIZE(b))
1538 typedef sdigit __Pyx_compact_pylong;
1539 typedef digit __Pyx_compact_upylong;
1541 #if PY_VERSION_HEX >= 0x030C00A5
1542 #define __Pyx_PyLong_Digits(x) (((PyLongObject*)x)->long_value.ob_digit)
1544 #define __Pyx_PyLong_Digits(x) (((PyLongObject*)x)->ob_digit)
1546 #define __Pyx_PyLong_IsNonZero(x) (!__Pyx_PyLong_IsZero(x))
1548 #define __Pyx_PyLong_IsNonZero(x) PyObject_IsTrue(x)
1550#if __PYX_DEFAULT_STRING_ENCODING_IS_UTF8
1551 #define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_DecodeUTF8(c_str, size, NULL)
1552#elif __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
1553 #define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_DecodeASCII(c_str, size, NULL)
1555 #define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_Decode(c_str, size, __PYX_DEFAULT_STRING_ENCODING, NULL)
1560#if defined(__GNUC__) && (__GNUC__ > 2 || (__GNUC__ == 2 && (__GNUC_MINOR__ > 95)))
1561 #define likely(x) __builtin_expect(!!(x), 1)
1562 #define unlikely(x) __builtin_expect(!!(x), 0)
1564 #define likely(x) (x)
1565 #define unlikely(x) (x)
1569#if __cplusplus > 201103L
1570#include <type_traits>
1572template <
typename T>
1573static void __Pyx_pretend_to_initialize(
T* ptr) {
1574#if __cplusplus > 201103L
1575 if ((std::is_trivially_default_constructible<T>::value))
1581static CYTHON_INLINE
void __Pyx_pretend_to_initialize(
void* ptr) { (void)ptr; }
1585#if !CYTHON_USE_MODULE_STATE
1586static PyObject *__pyx_m = NULL;
1588static const char *
const __pyx_cfilenm = __FILE__;
1591#if !defined(CYTHON_CCOMPLEX)
1592 #if defined(__cplusplus)
1593 #define CYTHON_CCOMPLEX 1
1594 #elif (defined(_Complex_I) && !defined(_MSC_VER)) || ((defined (__STDC_VERSION__) && __STDC_VERSION__ >= 201112L) && !defined(__STDC_NO_COMPLEX__) && !defined(_MSC_VER))
1595 #define CYTHON_CCOMPLEX 1
1597 #define CYTHON_CCOMPLEX 0
1604 #include <complex.h>
1607#if CYTHON_CCOMPLEX && !defined(__cplusplus) && defined(__sun__) && defined(__GNUC__)
1609 #define _Complex_I 1.0fj
1614static const char*
const __pyx_f[] = {
1615 "proteus/cSubsurfaceTransportCoefficients.pyx",
1616 "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd",
1621#include <pythread.h>
1622#ifndef CYTHON_ATOMICS
1623 #define CYTHON_ATOMICS 1
1625#define __PYX_CYTHON_ATOMICS_ENABLED() CYTHON_ATOMICS
1626#define __PYX_GET_CYTHON_COMPILING_IN_CPYTHON_FREETHREADING() CYTHON_COMPILING_IN_CPYTHON_FREETHREADING
1627#define __pyx_atomic_int_type int
1628#define __pyx_nonatomic_int_type int
1629#if CYTHON_ATOMICS && (defined(__STDC_VERSION__) &&\
1630 (__STDC_VERSION__ >= 201112L) &&\
1631 !defined(__STDC_NO_ATOMICS__))
1632 #include <stdatomic.h>
1633#elif CYTHON_ATOMICS && (defined(__cplusplus) && (\
1634 (__cplusplus >= 201103L) ||\
1635 (defined(_MSC_VER) && _MSC_VER >= 1700)))
1638#if CYTHON_ATOMICS && (defined(__STDC_VERSION__) &&\
1639 (__STDC_VERSION__ >= 201112L) &&\
1640 !defined(__STDC_NO_ATOMICS__) &&\
1641 ATOMIC_INT_LOCK_FREE == 2)
1642 #undef __pyx_atomic_int_type
1643 #define __pyx_atomic_int_type atomic_int
1644 #define __pyx_atomic_ptr_type atomic_uintptr_t
1645 #define __pyx_nonatomic_ptr_type uintptr_t
1646 #define __pyx_atomic_incr_relaxed(value) atomic_fetch_add_explicit(value, 1, memory_order_relaxed)
1647 #define __pyx_atomic_incr_acq_rel(value) atomic_fetch_add_explicit(value, 1, memory_order_acq_rel)
1648 #define __pyx_atomic_decr_acq_rel(value) atomic_fetch_sub_explicit(value, 1, memory_order_acq_rel)
1649 #define __pyx_atomic_sub(value, arg) atomic_fetch_sub(value, arg)
1650 #define __pyx_atomic_int_cmp_exchange(value, expected, desired) atomic_compare_exchange_strong(value, expected, desired)
1651 #define __pyx_atomic_load(value) atomic_load(value)
1652 #define __pyx_atomic_store(value, new_value) atomic_store(value, new_value)
1653 #define __pyx_atomic_pointer_load_relaxed(value) atomic_load_explicit(value, memory_order_relaxed)
1654 #define __pyx_atomic_pointer_load_acquire(value) atomic_load_explicit(value, memory_order_acquire)
1655 #define __pyx_atomic_pointer_exchange(value, new_value) atomic_exchange(value, (__pyx_nonatomic_ptr_type)new_value)
1656 #define __pyx_atomic_pointer_cmp_exchange(value, expected, desired) atomic_compare_exchange_strong(value, expected, desired)
1657 #if defined(__PYX_DEBUG_ATOMICS) && defined(_MSC_VER)
1658 #pragma message ("Using standard C atomics")
1659 #elif defined(__PYX_DEBUG_ATOMICS)
1660 #warning "Using standard C atomics"
1662#elif CYTHON_ATOMICS && (defined(__cplusplus) && (\
1663 (__cplusplus >= 201103L) ||\
1665 (defined(_MSC_VER) && _MSC_VER >= 1700)) &&\
1666 ATOMIC_INT_LOCK_FREE == 2)
1667 #undef __pyx_atomic_int_type
1668 #define __pyx_atomic_int_type std::atomic_int
1669 #define __pyx_atomic_ptr_type std::atomic_uintptr_t
1670 #define __pyx_nonatomic_ptr_type uintptr_t
1671 #define __pyx_atomic_incr_relaxed(value) std::atomic_fetch_add_explicit(value, 1, std::memory_order_relaxed)
1672 #define __pyx_atomic_incr_acq_rel(value) std::atomic_fetch_add_explicit(value, 1, std::memory_order_acq_rel)
1673 #define __pyx_atomic_decr_acq_rel(value) std::atomic_fetch_sub_explicit(value, 1, std::memory_order_acq_rel)
1674 #define __pyx_atomic_sub(value, arg) std::atomic_fetch_sub(value, arg)
1675 #define __pyx_atomic_int_cmp_exchange(value, expected, desired) std::atomic_compare_exchange_strong(value, expected, desired)
1676 #define __pyx_atomic_load(value) std::atomic_load(value)
1677 #define __pyx_atomic_store(value, new_value) std::atomic_store(value, new_value)
1678 #define __pyx_atomic_pointer_load_relaxed(value) std::atomic_load_explicit(value, std::memory_order_relaxed)
1679 #define __pyx_atomic_pointer_load_acquire(value) std::atomic_load_explicit(value, std::memory_order_acquire)
1680 #define __pyx_atomic_pointer_exchange(value, new_value) std::atomic_exchange(value, (__pyx_nonatomic_ptr_type)new_value)
1681 #define __pyx_atomic_pointer_cmp_exchange(value, expected, desired) std::atomic_compare_exchange_strong(value, expected, desired)
1682 #if defined(__PYX_DEBUG_ATOMICS) && defined(_MSC_VER)
1683 #pragma message ("Using standard C++ atomics")
1684 #elif defined(__PYX_DEBUG_ATOMICS)
1685 #warning "Using standard C++ atomics"
1687#elif CYTHON_ATOMICS && (__GNUC__ >= 5 || (__GNUC__ == 4 &&\
1688 (__GNUC_MINOR__ > 1 ||\
1689 (__GNUC_MINOR__ == 1 && __GNUC_PATCHLEVEL__ >= 2))))
1690 #define __pyx_atomic_ptr_type void*
1691 #define __pyx_nonatomic_ptr_type void*
1692 #define __pyx_atomic_incr_relaxed(value) __sync_fetch_and_add(value, 1)
1693 #define __pyx_atomic_incr_acq_rel(value) __sync_fetch_and_add(value, 1)
1694 #define __pyx_atomic_decr_acq_rel(value) __sync_fetch_and_sub(value, 1)
1695 #define __pyx_atomic_sub(value, arg) __sync_fetch_and_sub(value, arg)
1696 static CYTHON_INLINE
int __pyx_atomic_int_cmp_exchange(__pyx_atomic_int_type* value, __pyx_nonatomic_int_type* expected, __pyx_nonatomic_int_type desired) {
1697 __pyx_nonatomic_int_type old = __sync_val_compare_and_swap(value, *expected, desired);
1698 int result = old == *expected;
1702 #define __pyx_atomic_load(value) __sync_fetch_and_add(value, 0)
1703 #define __pyx_atomic_store(value, new_value) __sync_lock_test_and_set(value, new_value)
1704 #define __pyx_atomic_pointer_load_relaxed(value) __sync_fetch_and_add(value, 0)
1705 #define __pyx_atomic_pointer_load_acquire(value) __sync_fetch_and_add(value, 0)
1706 #define __pyx_atomic_pointer_exchange(value, new_value) __sync_lock_test_and_set(value, (__pyx_atomic_ptr_type)new_value)
1707 static CYTHON_INLINE
int __pyx_atomic_pointer_cmp_exchange(__pyx_atomic_ptr_type* value, __pyx_nonatomic_ptr_type* expected, __pyx_nonatomic_ptr_type desired) {
1708 __pyx_nonatomic_ptr_type old = __sync_val_compare_and_swap(value, *expected, desired);
1709 int result = old == *expected;
1713 #ifdef __PYX_DEBUG_ATOMICS
1714 #warning "Using GNU atomics"
1716#elif CYTHON_ATOMICS && defined(_MSC_VER)
1718 #undef __pyx_atomic_int_type
1719 #define __pyx_atomic_int_type long
1720 #define __pyx_atomic_ptr_type void*
1721 #undef __pyx_nonatomic_int_type
1722 #define __pyx_nonatomic_int_type long
1723 #define __pyx_nonatomic_ptr_type void*
1724 #pragma intrinsic (_InterlockedExchangeAdd, _InterlockedExchange, _InterlockedCompareExchange, _InterlockedCompareExchangePointer, _InterlockedExchangePointer)
1725 #define __pyx_atomic_incr_relaxed(value) _InterlockedExchangeAdd(value, 1)
1726 #define __pyx_atomic_incr_acq_rel(value) _InterlockedExchangeAdd(value, 1)
1727 #define __pyx_atomic_decr_acq_rel(value) _InterlockedExchangeAdd(value, -1)
1728 #define __pyx_atomic_sub(value, arg) _InterlockedExchangeAdd(value, -arg)
1729 static CYTHON_INLINE
int __pyx_atomic_int_cmp_exchange(__pyx_atomic_int_type* value, __pyx_nonatomic_int_type* expected, __pyx_nonatomic_int_type desired) {
1730 __pyx_nonatomic_int_type old = _InterlockedCompareExchange(value, desired, *expected);
1731 int result = old == *expected;
1735 #define __pyx_atomic_load(value) _InterlockedExchangeAdd(value, 0)
1736 #define __pyx_atomic_store(value, new_value) _InterlockedExchange(value, new_value)
1737 #define __pyx_atomic_pointer_load_relaxed(value) *(void * volatile *)value
1738 #define __pyx_atomic_pointer_load_acquire(value) _InterlockedCompareExchangePointer(value, 0, 0)
1739 #define __pyx_atomic_pointer_exchange(value, new_value) _InterlockedExchangePointer(value, (__pyx_atomic_ptr_type)new_value)
1740 static CYTHON_INLINE
int __pyx_atomic_pointer_cmp_exchange(__pyx_atomic_ptr_type* value, __pyx_nonatomic_ptr_type* expected, __pyx_nonatomic_ptr_type desired) {
1741 __pyx_atomic_ptr_type old = _InterlockedCompareExchangePointer(value, desired, *expected);
1742 int result = old == *expected;
1746 #ifdef __PYX_DEBUG_ATOMICS
1747 #pragma message ("Using MSVC atomics")
1750 #undef CYTHON_ATOMICS
1751 #define CYTHON_ATOMICS 0
1752 #ifdef __PYX_DEBUG_ATOMICS
1753 #warning "Not using atomics"
1758#if !CYTHON_COMPILING_IN_CPYTHON_FREETHREADING
1759#define __Pyx_PyCriticalSection void*
1760#define __Pyx_PyCriticalSection2 void*
1761#define __Pyx_PyCriticalSection_End(cs)
1762#define __Pyx_PyCriticalSection2_End(cs)
1764#define __Pyx_PyCriticalSection PyCriticalSection
1765#define __Pyx_PyCriticalSection2 PyCriticalSection2
1766#define __Pyx_PyCriticalSection_End PyCriticalSection_End
1767#define __Pyx_PyCriticalSection2_End PyCriticalSection2_End
1771#if !CYTHON_COMPILING_IN_CPYTHON_FREETHREADING
1772#define __Pyx_PyCriticalSection_Begin(cs, arg) (void)(cs)
1773#define __Pyx_PyCriticalSection2_Begin(cs, arg1, arg2) (void)(cs)
1775#define __Pyx_PyCriticalSection_Begin PyCriticalSection_Begin
1776#define __Pyx_PyCriticalSection2_Begin PyCriticalSection2_Begin
1778#if PY_VERSION_HEX < 0x030d0000 || CYTHON_COMPILING_IN_LIMITED_API
1779#define __Pyx_BEGIN_CRITICAL_SECTION(o) {
1780#define __Pyx_END_CRITICAL_SECTION() }
1782#define __Pyx_BEGIN_CRITICAL_SECTION Py_BEGIN_CRITICAL_SECTION
1783#define __Pyx_END_CRITICAL_SECTION Py_END_CRITICAL_SECTION
1787#include <structmember.h>
1798typedef npy_int8 __pyx_t_5numpy_int8_t;
1807typedef npy_int16 __pyx_t_5numpy_int16_t;
1816typedef npy_int32 __pyx_t_5numpy_int32_t;
1825typedef npy_int64 __pyx_t_5numpy_int64_t;
1834typedef npy_uint8 __pyx_t_5numpy_uint8_t;
1843typedef npy_uint16 __pyx_t_5numpy_uint16_t;
1852typedef npy_uint32 __pyx_t_5numpy_uint32_t;
1861typedef npy_uint64 __pyx_t_5numpy_uint64_t;
1870typedef npy_float32 __pyx_t_5numpy_float32_t;
1879typedef npy_float64 __pyx_t_5numpy_float64_t;
1888typedef npy_longlong __pyx_t_5numpy_longlong_t;
1897typedef npy_ulonglong __pyx_t_5numpy_ulonglong_t;
1906typedef npy_intp __pyx_t_5numpy_intp_t;
1915typedef npy_uintp __pyx_t_5numpy_uintp_t;
1924typedef npy_double __pyx_t_5numpy_float_t;
1933typedef npy_double __pyx_t_5numpy_double_t;
1942typedef npy_longdouble __pyx_t_5numpy_longdouble_t;
1945#if CYTHON_CCOMPLEX && (1) && (!0 || __cplusplus)
1947 typedef ::std::complex< float > __pyx_t_float_complex;
1949 typedef float _Complex __pyx_t_float_complex;
1952 typedef struct {
float real, imag; } __pyx_t_float_complex;
1954static CYTHON_INLINE __pyx_t_float_complex __pyx_t_float_complex_from_parts(
float,
float);
1957#if CYTHON_CCOMPLEX && (1) && (!0 || __cplusplus)
1959 typedef ::std::complex< double > __pyx_t_double_complex;
1961 typedef double _Complex __pyx_t_double_complex;
1964 typedef struct {
double real, imag; } __pyx_t_double_complex;
1966static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(
double,
double);
1969#if CYTHON_CCOMPLEX && (1) && (!0 || __cplusplus)
1971 typedef ::std::complex< long double > __pyx_t_long_double_complex;
1973 typedef long double _Complex __pyx_t_long_double_complex;
1976 typedef struct {
long double real, imag; } __pyx_t_long_double_complex;
1978static CYTHON_INLINE __pyx_t_long_double_complex __pyx_t_long_double_complex_from_parts(
long double,
long double);
1987#ifndef CYTHON_REFNANNY
1988 #define CYTHON_REFNANNY 0
1992 void (*INCREF)(
void*, PyObject*, Py_ssize_t);
1993 void (*DECREF)(
void*, PyObject*, Py_ssize_t);
1994 void (*GOTREF)(
void*, PyObject*, Py_ssize_t);
1995 void (*GIVEREF)(
void*, PyObject*, Py_ssize_t);
1996 void* (*SetupContext)(
const char*, Py_ssize_t,
const char*);
1997 void (*FinishContext)(
void**);
1998 } __Pyx_RefNannyAPIStruct;
1999 static __Pyx_RefNannyAPIStruct *__Pyx_RefNanny = NULL;
2000 static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(
const char *modname);
2001 #define __Pyx_RefNannyDeclarations void *__pyx_refnanny = NULL;
2002 #define __Pyx_RefNannySetupContext(name, acquire_gil)\
2004 PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();\
2005 __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), (__LINE__), (__FILE__));\
2006 PyGILState_Release(__pyx_gilstate_save);\
2008 __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), (__LINE__), (__FILE__));\
2010 #define __Pyx_RefNannyFinishContextNogil() {\
2011 PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();\
2012 __Pyx_RefNannyFinishContext();\
2013 PyGILState_Release(__pyx_gilstate_save);\
2015 #define __Pyx_RefNannyFinishContextNogil() {\
2016 PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();\
2017 __Pyx_RefNannyFinishContext();\
2018 PyGILState_Release(__pyx_gilstate_save);\
2020 #define __Pyx_RefNannyFinishContext()\
2021 __Pyx_RefNanny->FinishContext(&__pyx_refnanny)
2022 #define __Pyx_INCREF(r) __Pyx_RefNanny->INCREF(__pyx_refnanny, (PyObject *)(r), (__LINE__))
2023 #define __Pyx_DECREF(r) __Pyx_RefNanny->DECREF(__pyx_refnanny, (PyObject *)(r), (__LINE__))
2024 #define __Pyx_GOTREF(r) __Pyx_RefNanny->GOTREF(__pyx_refnanny, (PyObject *)(r), (__LINE__))
2025 #define __Pyx_GIVEREF(r) __Pyx_RefNanny->GIVEREF(__pyx_refnanny, (PyObject *)(r), (__LINE__))
2026 #define __Pyx_XINCREF(r) do { if((r) == NULL); else {__Pyx_INCREF(r); }} while(0)
2027 #define __Pyx_XDECREF(r) do { if((r) == NULL); else {__Pyx_DECREF(r); }} while(0)
2028 #define __Pyx_XGOTREF(r) do { if((r) == NULL); else {__Pyx_GOTREF(r); }} while(0)
2029 #define __Pyx_XGIVEREF(r) do { if((r) == NULL); else {__Pyx_GIVEREF(r);}} while(0)
2031 #define __Pyx_RefNannyDeclarations
2032 #define __Pyx_RefNannySetupContext(name, acquire_gil)
2033 #define __Pyx_RefNannyFinishContextNogil()
2034 #define __Pyx_RefNannyFinishContext()
2035 #define __Pyx_INCREF(r) Py_INCREF(r)
2036 #define __Pyx_DECREF(r) Py_DECREF(r)
2037 #define __Pyx_GOTREF(r)
2038 #define __Pyx_GIVEREF(r)
2039 #define __Pyx_XINCREF(r) Py_XINCREF(r)
2040 #define __Pyx_XDECREF(r) Py_XDECREF(r)
2041 #define __Pyx_XGOTREF(r)
2042 #define __Pyx_XGIVEREF(r)
2044#define __Pyx_Py_XDECREF_SET(r, v) do {\
2045 PyObject *tmp = (PyObject *) r;\
2046 r = v; Py_XDECREF(tmp);\
2048#define __Pyx_XDECREF_SET(r, v) do {\
2049 PyObject *tmp = (PyObject *) r;\
2050 r = v; __Pyx_XDECREF(tmp);\
2052#define __Pyx_DECREF_SET(r, v) do {\
2053 PyObject *tmp = (PyObject *) r;\
2054 r = v; __Pyx_DECREF(tmp);\
2056#define __Pyx_CLEAR(r) do { PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);} while(0)
2057#define __Pyx_XCLEAR(r) do { if((r) != NULL) {PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);}} while(0)
2060#if CYTHON_USE_EXC_INFO_STACK && CYTHON_FAST_THREAD_STATE
2061static _PyErr_StackItem * __Pyx_PyErr_GetTopmostException(PyThreadState *tstate);
2065#if CYTHON_FAST_THREAD_STATE
2066#define __Pyx_PyThreadState_declare PyThreadState *__pyx_tstate;
2067#define __Pyx_PyThreadState_assign __pyx_tstate = __Pyx_PyThreadState_Current;
2068#if PY_VERSION_HEX >= 0x030C00A6
2069#define __Pyx_PyErr_Occurred() (__pyx_tstate->current_exception != NULL)
2070#define __Pyx_PyErr_CurrentExceptionType() (__pyx_tstate->current_exception ? (PyObject*) Py_TYPE(__pyx_tstate->current_exception) : (PyObject*) NULL)
2072#define __Pyx_PyErr_Occurred() (__pyx_tstate->curexc_type != NULL)
2073#define __Pyx_PyErr_CurrentExceptionType() (__pyx_tstate->curexc_type)
2076#define __Pyx_PyThreadState_declare
2077#define __Pyx_PyThreadState_assign
2078#define __Pyx_PyErr_Occurred() (PyErr_Occurred() != NULL)
2079#define __Pyx_PyErr_CurrentExceptionType() PyErr_Occurred()
2083#if CYTHON_FAST_THREAD_STATE
2084#define __Pyx_ExceptionSave(type, value, tb) __Pyx__ExceptionSave(__pyx_tstate, type, value, tb)
2085static CYTHON_INLINE
void __Pyx__ExceptionSave(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb);
2086#define __Pyx_ExceptionReset(type, value, tb) __Pyx__ExceptionReset(__pyx_tstate, type, value, tb)
2087static CYTHON_INLINE
void __Pyx__ExceptionReset(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb);
2089#define __Pyx_ExceptionSave(type, value, tb) PyErr_GetExcInfo(type, value, tb)
2090#define __Pyx_ExceptionReset(type, value, tb) PyErr_SetExcInfo(type, value, tb)
2094#if CYTHON_COMPILING_IN_CPYTHON
2095#define __Pyx_TypeCheck(obj, type) __Pyx_IsSubtype(Py_TYPE(obj), (PyTypeObject *)type)
2096#define __Pyx_TypeCheck2(obj, type1, type2) __Pyx_IsAnySubtype2(Py_TYPE(obj), (PyTypeObject *)type1, (PyTypeObject *)type2)
2097static CYTHON_INLINE
int __Pyx_IsSubtype(PyTypeObject *a, PyTypeObject *b);
2098static CYTHON_INLINE
int __Pyx_IsAnySubtype2(PyTypeObject *cls, PyTypeObject *a, PyTypeObject *b);
2099#define __Pyx_PyAnySet_Check(obj) __Pyx_TypeCheck2(obj, &PySet_Type, &PyFrozenSet_Type)
2101#define __Pyx_TypeCheck(obj, type) PyObject_TypeCheck(obj, (PyTypeObject *)type)
2102#define __Pyx_TypeCheck2(obj, type1, type2) (PyObject_TypeCheck(obj, (PyTypeObject *)type1) || PyObject_TypeCheck(obj, (PyTypeObject *)type2))
2103#define __Pyx_PyAnySet_Check(obj) PyAnySet_Check(obj)
2107#define __Pyx_PyExc_Exception_Check(obj) __Pyx_TypeCheck(obj, PyExc_Exception)
2110#if CYTHON_FAST_THREAD_STATE
2111#define __Pyx_PyErr_Clear() __Pyx_ErrRestore(NULL, NULL, NULL)
2112#define __Pyx_ErrRestoreWithState(type, value, tb) __Pyx_ErrRestoreInState(PyThreadState_GET(), type, value, tb)
2113#define __Pyx_ErrFetchWithState(type, value, tb) __Pyx_ErrFetchInState(PyThreadState_GET(), type, value, tb)
2114#define __Pyx_ErrRestore(type, value, tb) __Pyx_ErrRestoreInState(__pyx_tstate, type, value, tb)
2115#define __Pyx_ErrFetch(type, value, tb) __Pyx_ErrFetchInState(__pyx_tstate, type, value, tb)
2116static CYTHON_INLINE
void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb);
2117static CYTHON_INLINE
void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb);
2118#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030C00A6
2119#define __Pyx_PyErr_SetNone(exc) (Py_INCREF(exc), __Pyx_ErrRestore((exc), NULL, NULL))
2121#define __Pyx_PyErr_SetNone(exc) PyErr_SetNone(exc)
2124#define __Pyx_PyErr_Clear() PyErr_Clear()
2125#define __Pyx_PyErr_SetNone(exc) PyErr_SetNone(exc)
2126#define __Pyx_ErrRestoreWithState(type, value, tb) PyErr_Restore(type, value, tb)
2127#define __Pyx_ErrFetchWithState(type, value, tb) PyErr_Fetch(type, value, tb)
2128#define __Pyx_ErrRestoreInState(tstate, type, value, tb) PyErr_Restore(type, value, tb)
2129#define __Pyx_ErrFetchInState(tstate, type, value, tb) PyErr_Fetch(type, value, tb)
2130#define __Pyx_ErrRestore(type, value, tb) PyErr_Restore(type, value, tb)
2131#define __Pyx_ErrFetch(type, value, tb) PyErr_Fetch(type, value, tb)
2135#if CYTHON_COMPILING_IN_CPYTHON
2136static CYTHON_INLINE
int __Pyx_PyErr_GivenExceptionMatches(PyObject *err, PyObject *type);
2137static CYTHON_INLINE
int __Pyx_PyErr_GivenExceptionMatches2(PyObject *err, PyObject *type1, PyObject *type2);
2139#define __Pyx_PyErr_GivenExceptionMatches(err, type) PyErr_GivenExceptionMatches(err, type)
2140static CYTHON_INLINE
int __Pyx_PyErr_GivenExceptionMatches2(PyObject *err, PyObject *type1, PyObject *type2) {
2141 return PyErr_GivenExceptionMatches(err, type1) || PyErr_GivenExceptionMatches(err, type2);
2144#define __Pyx_PyErr_ExceptionMatches2(err1, err2) __Pyx_PyErr_GivenExceptionMatches2(__Pyx_PyErr_CurrentExceptionType(), err1, err2)
2147#if CYTHON_FAST_THREAD_STATE
2148#define __Pyx_PyErr_ExceptionMatches(err) __Pyx_PyErr_ExceptionMatchesInState(__pyx_tstate, err)
2149static CYTHON_INLINE
int __Pyx_PyErr_ExceptionMatchesInState(PyThreadState* tstate, PyObject* err);
2151#define __Pyx_PyErr_ExceptionMatches(err) PyErr_ExceptionMatches(err)
2155#if CYTHON_FAST_THREAD_STATE
2156#define __Pyx_GetException(type, value, tb) __Pyx__GetException(__pyx_tstate, type, value, tb)
2157static int __Pyx__GetException(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb);
2159static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb);
2163#define __Pyx_PyExc_ImportError_Check(obj) __Pyx_TypeCheck(obj, PyExc_ImportError)
2166#if CYTHON_COMPILING_IN_CPYTHON
2167static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw);
2169#define __Pyx_PyObject_Call(func, arg, kw) PyObject_Call(func, arg, kw)
2173#if CYTHON_COMPILING_IN_CPYTHON
2174static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg);
2178#define __Pyx_PyObject_FastCall(func, args, nargs) __Pyx_PyObject_FastCallDict(func, args, (size_t)(nargs), NULL)
2179static CYTHON_INLINE PyObject* __Pyx_PyObject_FastCallDict(PyObject *func, PyObject *
const*args,
size_t nargsf, PyObject *kwargs);
2182static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause);
2185#if CYTHON_COMPILING_IN_CPYTHON
2186static CYTHON_INLINE
void __Pyx_copy_object_array(PyObject *
const *CYTHON_RESTRICT src, PyObject** CYTHON_RESTRICT dest, Py_ssize_t length);
2190#if PY_VERSION_HEX >= 0x030F0000 && !CYTHON_COMPILING_IN_LIMITED_API
2191#define __Pyx_PyTuple_FromArray(src, n) PyTuple_FromArray(src, ((n)<0) ? 0 : (n))
2193CYTHON_UNUSED
static PyObject *
2194__Pyx_PyTuple_FromArray(PyObject *
const *src, Py_ssize_t
n);
2204static CYTHON_INLINE
int __Pyx_PyObject_CompareBoolEq_str_str(PyObject *op1, PyObject *op2,
int pyop);
2207#define __Pyx_PyUnicode_Equals(s1, s2) __Pyx_PyObject_CompareBoolEq_str_str(s1, s2, Py_EQ)
2210#if CYTHON_AVOID_BORROWED_REFS
2211 #define __Pyx_ArgRef_VARARGS(args, i) __Pyx_PySequence_ITEM(args, i)
2212#elif CYTHON_ASSUME_SAFE_MACROS
2213 #define __Pyx_ArgRef_VARARGS(args, i) __Pyx_NewRef(__Pyx_PyTuple_GET_ITEM(args, i))
2215 #define __Pyx_ArgRef_VARARGS(args, i) __Pyx_XNewRef(PyTuple_GetItem(args, i))
2217#define __Pyx_NumKwargs_VARARGS(kwds) PyDict_Size(kwds)
2218#define __Pyx_KwValues_VARARGS(args, nargs) NULL
2219#define __Pyx_GetKwValue_VARARGS(kw, kwvalues, s) __Pyx_PyDict_GetItemStrWithError(kw, s)
2220#define __Pyx_KwargsAsDict_VARARGS(kw, kwvalues) PyDict_Copy(kw)
2221#if CYTHON_VECTORCALL
2222 #define __Pyx_ArgRef_FASTCALL(args, i) __Pyx_NewRef(args[i])
2223 #define __Pyx_NumKwargs_FASTCALL(kwds) __Pyx_PyTuple_GET_SIZE(kwds)
2224 #define __Pyx_KwValues_FASTCALL(args, nargs) ((args) + (nargs))
2225 static CYTHON_INLINE PyObject * __Pyx_GetKwValue_FASTCALL(PyObject *kwnames, PyObject *
const *kwvalues, PyObject *
s);
2226 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030d0000 || CYTHON_COMPILING_IN_LIMITED_API || CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_GRAAL
2227 CYTHON_UNUSED
static PyObject *__Pyx_KwargsAsDict_FASTCALL(PyObject *kwnames, PyObject *
const *kwvalues);
2229 #define __Pyx_KwargsAsDict_FASTCALL(kw, kwvalues) _PyStack_AsDict(kwvalues, kw)
2232 #define __Pyx_ArgRef_FASTCALL __Pyx_ArgRef_VARARGS
2233 #define __Pyx_NumKwargs_FASTCALL __Pyx_NumKwargs_VARARGS
2234 #define __Pyx_KwValues_FASTCALL __Pyx_KwValues_VARARGS
2235 #define __Pyx_GetKwValue_FASTCALL __Pyx_GetKwValue_VARARGS
2236 #define __Pyx_KwargsAsDict_FASTCALL __Pyx_KwargsAsDict_VARARGS
2238#if CYTHON_VECTORCALL_TPNEW
2239 #if !CYTHON_VECTORCALL
2240 #error Enabling CYTHON_VECTORCALL_TPNEW without CYTHON_VECTORCALL is not supported
2242 #define __Pyx_ArgRef_FASTCALL_TPNEW __Pyx_ArgRef_FASTCALL
2243 #define __Pyx_NumKwargs_FASTCALL_TPNEW __Pyx_NumKwargs_FASTCALL
2244 #define __Pyx_KwValues_FASTCALL_TPNEW __Pyx_KwValues_FASTCALL
2245 #define __Pyx_GetKwValue_FASTCALL_TPNEW __Pyx_GetKwValue_FASTCALL
2246 #define __Pyx_KwargsAsDict_FASTCALL_TPNEW __Pyx_KwargsAsDict_FASTCALL
2248 #define __Pyx_ArgRef_FASTCALL_TPNEW __Pyx_ArgRef_VARARGS
2249 #define __Pyx_NumKwargs_FASTCALL_TPNEW __Pyx_NumKwargs_VARARGS
2250 #define __Pyx_KwValues_FASTCALL_TPNEW __Pyx_KwValues_VARARGS
2251 #define __Pyx_GetKwValue_FASTCALL_TPNEW __Pyx_GetKwValue_VARARGS
2252 #define __Pyx_KwargsAsDict_FASTCALL_TPNEW __Pyx_KwargsAsDict_VARARGS
2254#define __Pyx_ArgsSlice_VARARGS(args, start, stop) PyTuple_GetSlice(args, start, stop)
2255#if CYTHON_VECTORCALL
2256#define __Pyx_ArgsSlice_FASTCALL(args, start, stop) __Pyx_PyTuple_FromArray(args + start, stop - start)
2258#define __Pyx_ArgsSlice_FASTCALL __Pyx_ArgsSlice_VARARGS
2262#define __Pyx_PyDict_items_TypePtr (&PyDictKeys_Type)
2263#define __Pyx_PyDict_items_Check(obj) PyObject_TypeCheck((obj), __Pyx_PyDictItems_TypePtr)
2264#define __Pyx_PyDict_items_CheckExact(obj) Py_IS_TYPE((obj), __Pyx_PyDictItems_TypePtr)
2265static CYTHON_INLINE PyObject* __Pyx_PyDict_Items(PyObject* d);
2268#define __Pyx_CallCFunction(cfunc, self, args)\
2269 ((PyCFunction)(void(*)(void))(cfunc)->func)(self, args)
2270#define __Pyx_CallCFunctionWithKeywords(cfunc, self, args, kwargs)\
2271 ((PyCFunctionWithKeywords)(void(*)(void))(cfunc)->func)(self, args, kwargs)
2272#define __Pyx_CallCFunctionFast(cfunc, self, args, nargs)\
2273 ((__Pyx_PyCFunctionFast)(void(*)(void))(PyCFunction)(cfunc)->func)(self, args, nargs)
2274#define __Pyx_CallCFunctionFastWithKeywords(cfunc, self, args, nargs, kwnames)\
2275 ((__Pyx_PyCFunctionFastWithKeywords)(void(*)(void))(PyCFunction)(cfunc)->func)(self, args, nargs, kwnames)
2278static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg);
2283 PyObject **method_name;
2287#if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING && CYTHON_ATOMICS
2288 __pyx_atomic_int_type initialized;
2290} __Pyx_CachedCFunction;
2293static CYTHON_INLINE
int __Pyx_IgnoreGivenException(PyObject *given_exception, PyObject *ignorable_exception);
2294#define __Pyx_IgnoreException(ignorable_exception) __Pyx_IgnoreGivenException(NULL, ignorable_exception)
2297#if CYTHON_USE_TYPE_SLOTS
2298static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name);
2300#define __Pyx_PyObject_GetAttrStr(o,n) PyObject_GetAttr(o,n)
2304static int __Pyx_TryUnpackUnboundCMethod(__Pyx_CachedCFunction* target);
2307#if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING
2308static CYTHON_INLINE
int __Pyx_CachedCFunction_GetAndSetInitializing(__Pyx_CachedCFunction *cfunc) {
2312 __pyx_nonatomic_int_type expected = 0;
2313 if (__pyx_atomic_int_cmp_exchange(&cfunc->initialized, &expected, 1)) {
2319static CYTHON_INLINE
void __Pyx_CachedCFunction_SetFinishedInitializing(__Pyx_CachedCFunction *cfunc) {
2321 __pyx_atomic_store(&cfunc->initialized, 2);
2325#define __Pyx_CachedCFunction_GetAndSetInitializing(cfunc) 2
2326#define __Pyx_CachedCFunction_SetFinishedInitializing(cfunc)
2331static PyObject* __Pyx__CallUnboundCMethod0(__Pyx_CachedCFunction* cfunc, PyObject* self);
2332#if CYTHON_COMPILING_IN_CPYTHON
2333static CYTHON_INLINE PyObject* __Pyx_CallUnboundCMethod0(__Pyx_CachedCFunction* cfunc, PyObject* self);
2335#define __Pyx_CallUnboundCMethod0(cfunc, self) __Pyx__CallUnboundCMethod0(cfunc, self)
2339#define __Pyx_PyDict_values_TypePtr (&PyDictKeys_Type)
2340#define __Pyx_PyDict_values_Check(obj) PyObject_TypeCheck((obj), __Pyx_PyDictValues_TypePtr)
2341#define __Pyx_PyDict_values_CheckExact(obj) Py_IS_TYPE((obj), __Pyx_PyDictValues_TypePtr)
2342static CYTHON_INLINE PyObject* __Pyx_PyDict_Values(PyObject* d);
2345#if CYTHON_AVOID_BORROWED_REFS
2346static int __Pyx_PyDict_NextRef(PyObject *p, PyObject **ppos, PyObject **pkey, PyObject **pvalue);
2349static int __Pyx_PyDict_NextRef(PyObject *p, Py_ssize_t *ppos, PyObject **pkey, PyObject **pvalue);
2353static void __Pyx_RaiseDoubleKeywordsError(
const char* func_name, PyObject* kw_name);
2356static int __Pyx_ParseKeywordsTuple(
2358 PyObject *
const *kwvalues,
2359 PyObject **
const argnames[],
2362 Py_ssize_t num_pos_args,
2363 Py_ssize_t num_kwargs,
2364 const char* function_name,
2365 int ignore_unknown_kwargs
2367static int __Pyx_ParseKeywordDictToDict(
2369 PyObject **
const argnames[],
2372 Py_ssize_t num_pos_args,
2373 const char* function_name
2375static int __Pyx_ParseKeywordDict(
2377 PyObject **
const argnames[],
2379 Py_ssize_t num_pos_args,
2380 Py_ssize_t num_kwargs,
2381 const char* function_name,
2382 int ignore_unknown_kwargs
2387static PyObject* __Pyx__CallUnboundCMethod2(__Pyx_CachedCFunction* cfunc, PyObject* self, PyObject* arg1, PyObject* arg2);
2388#if CYTHON_COMPILING_IN_CPYTHON
2389static CYTHON_INLINE PyObject *__Pyx_CallUnboundCMethod2(__Pyx_CachedCFunction *cfunc, PyObject *self, PyObject *arg1, PyObject *arg2);
2391#define __Pyx_CallUnboundCMethod2(cfunc, self, arg1, arg2) __Pyx__CallUnboundCMethod2(cfunc, self, arg1, arg2)
2395static CYTHON_INLINE
int __Pyx_ParseKeywords(
2396 PyObject *kwds, PyObject *
const *kwvalues, PyObject **
const argnames[],
2397 PyObject *kwds2, PyObject *values[],
2398 Py_ssize_t num_pos_args, Py_ssize_t num_kwargs,
2399 const char* function_name,
2400 int ignore_unknown_kwargs
2404static void __Pyx_RaiseArgtupleInvalid(
const char* func_name,
int exact,
2405 Py_ssize_t num_min, Py_ssize_t num_max, Py_ssize_t num_found);
2408static void __Pyx_ArgTypeError(PyObject *obj, PyTypeObject *type,
const char *name,
int exact);
2411static CYTHON_INLINE
int __Pyx_ArgTypeTest(PyObject *obj, PyTypeObject *type,
int none_allowed,
const char *name,
int exact);
2414#if CYTHON_COMPILING_IN_LIMITED_API || PY_VERSION_HEX >= 0x030C0000
2415 static int __pyx_assertions_enabled_flag;
2416 #define __pyx_assertions_enabled() (__pyx_assertions_enabled_flag)
2417 #if __clang__ || __GNUC__
2418 __attribute__((no_sanitize(
"thread")))
2420 static int __Pyx_init_assertions_enabled(
void) {
2421 PyObject *builtins, *debug, *debug_str;
2423 builtins = PyEval_GetBuiltins();
2424 if (!builtins)
goto bad;
2425 debug_str = PyUnicode_FromStringAndSize(
"__debug__", 9);
2426 if (!debug_str)
goto bad;
2427 debug = PyObject_GetItem(builtins, debug_str);
2428 Py_DECREF(debug_str);
2429 if (!debug)
goto bad;
2430 flag = PyObject_IsTrue(debug);
2432 if (flag == -1)
goto bad;
2433 __pyx_assertions_enabled_flag = flag;
2436 __pyx_assertions_enabled_flag = 1;
2440 #define __Pyx_init_assertions_enabled() (0)
2441 #define __pyx_assertions_enabled() (!Py_OptimizeFlag)
2445#define __Pyx_PyExc_AssertionError_Check(obj) __Pyx_TypeCheck(obj, PyExc_AssertionError)
2448#ifndef __PYX_HAVE_RT_ImportType_proto_3_3_0
2449#define __PYX_HAVE_RT_ImportType_proto_3_3_0
2450#if defined (__STDC_VERSION__) && __STDC_VERSION__ >= 201112L
2451#include <stdalign.h>
2453#if (defined (__STDC_VERSION__) && __STDC_VERSION__ >= 201112L) || __cplusplus >= 201103L
2454#define __PYX_GET_STRUCT_ALIGNMENT_3_3_0(s) alignof(s)
2456#define __PYX_GET_STRUCT_ALIGNMENT_3_3_0(s) sizeof(void*)
2458enum __Pyx_ImportType_CheckSize_3_3_0 {
2459 __Pyx_ImportType_CheckSize_Error_3_3_0 = 0,
2460 __Pyx_ImportType_CheckSize_Warn_3_3_0 = 1,
2461 __Pyx_ImportType_CheckSize_Ignore_3_3_0 = 2
2463static PyTypeObject *__Pyx_ImportType_3_3_0(PyObject* module,
const char *module_name,
const char *class_name,
size_t size,
size_t alignment,
enum __Pyx_ImportType_CheckSize_3_3_0 check_size);
2467static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStrNoError(PyObject* obj, PyObject* attr_name);
2470#if __PYX_LIMITED_VERSION_HEX >= 0x030d0000
2471#define __Pyx_HasAttr(o, n) PyObject_HasAttrWithError(o, n)
2473static CYTHON_INLINE
int __Pyx_HasAttr(PyObject *, PyObject *);
2477CYTHON_UNUSED
static PyObject *
2478__Pyx_PyList_FromArray(PyObject *
const *src, Py_ssize_t
n);
2484static PyObject *__Pyx__Import(PyObject *name, PyObject *
const *imported_names, Py_ssize_t len_imported_names, PyObject *qualname, PyObject *moddict,
int level);
2487static CYTHON_INLINE PyObject *__Pyx_Import(PyObject *name, PyObject *
const *imported_names, Py_ssize_t len_imported_names, PyObject *qualname,
int level);
2490static CYTHON_INLINE PyObject *__Pyx_PyDict_SetDefault(PyObject *d, PyObject *key, PyObject *default_value);
2493#if ((CYTHON_COMPILING_IN_CPYTHON_FREETHREADING && PY_VERSION_HEX < 0x030F00a3) ||\
2494 __PYX_LIMITED_VERSION_HEX < 0x030d0000)
2495 static PyObject *__Pyx_PyImport_AddModuleRef(
const char *name);
2497 #define __Pyx_PyImport_AddModuleRef(name) PyImport_AddModuleRef(name)
2501static PyObject *__Pyx_FetchSharedCythonABIModule(
void);
2504static int __Pyx_VerifyCachedType(PyObject *cached_type,
2506 Py_ssize_t expected_basicsize);
2509static PyTypeObject* __Pyx_FetchCommonTypeFromSpec(PyTypeObject *metaclass, PyObject *module, PyType_Spec *spec, PyObject *bases);
2512static int __pyx_CommonTypesMetaclass_init(PyObject *module);
2513#define __Pyx_CommonTypesMetaclass_USED
2516#define __Pyx_CyFunction_USED
2517#if CYTHON_OPAQUE_SHARED_TYPES
2518#define __Pyx_as_CyFunctionObject(o) ((__pyx_CyFunctionObject *)PyObject_GetTypeData((o), __pyx_mstate_global->__pyx_CyFunctionType))
2520#define __Pyx_as_CyFunctionObject(o) ((__pyx_CyFunctionObject *)o)
2522#define __Pyx_CYFUNCTION_STATICMETHOD 0x01
2523#define __Pyx_CYFUNCTION_CLASSMETHOD 0x02
2524#define __Pyx_CYFUNCTION_CCLASS 0x04
2525#define __Pyx_CYFUNCTION_COROUTINE 0x08
2526#define __Pyx_CyFunction_GetClosure(f)\
2527 ((__Pyx_as_CyFunctionObject(f))->func_closure)
2528#if CYTHON_COMPILING_IN_LIMITED_API
2529 #define __Pyx__CyFunction_GetClassObj(f)\
2530 ((f)->func_classobj)
2532 #define __Pyx__CyFunction_GetClassObj(f)\
2533 ((PyObject*) ((PyCMethodObject *) (f))->mm_class)
2535#define __Pyx_CyFunction_GetClassObj(f)\
2536 __Pyx__CyFunction_GetClassObj(__Pyx_as_CyFunctionObject(f))
2537#define __Pyx_CyFunction_SetClassObj(f, classobj)\
2538 __Pyx__CyFunction_SetClassObj(__Pyx_as_CyFunctionObject(f), (classobj))
2539#define __Pyx_CyFunction_Defaults(type, f)\
2540 ((type *)((__Pyx_as_CyFunctionObject(f))->defaults))
2541#define __Pyx_CyFunction_SetDefaultsGetter(f, g)\
2542 (__Pyx_as_CyFunctionObject(f))->defaults_getter = (g)
2544#if CYTHON_COMPILING_IN_LIMITED_API
2545#if !CYTHON_OPAQUE_OBJECTS
2548 PyMethodDef *func_methoddef;
2549 PyObject *func_module;
2551 PyCMethodObject func;
2553#if (CYTHON_COMPILING_IN_LIMITED_API || CYTHON_COMPILING_IN_PYPY) && CYTHON_VECTORCALL
2554 __pyx_vectorcallfunc func_vectorcall;
2556#if CYTHON_COMPILING_IN_LIMITED_API
2557 PyObject *func_weakreflist;
2559#if PY_VERSION_HEX < 0x030C0000 || CYTHON_COMPILING_IN_LIMITED_API
2560 PyObject *func_dict;
2562 PyObject *func_name;
2563 PyObject *func_qualname;
2565 PyObject *func_globals;
2566 PyObject *func_code;
2567 PyObject *func_closure;
2568#if CYTHON_COMPILING_IN_LIMITED_API
2569 PyObject *func_classobj;
2573 PyObject *defaults_tuple;
2574 PyObject *defaults_kwdict;
2575 PyObject *(*defaults_getter)(PyObject *);
2576 PyObject *func_annotations;
2577#if __PYX_LIMITED_VERSION_HEX < 0x030B0000
2578 PyObject *func_is_coroutine;
2580} __pyx_CyFunctionObject;
2581#undef __Pyx_CyOrPyCFunction_Check
2582#define __Pyx_CyFunction_Check(obj) __Pyx_TypeCheck(obj, __pyx_mstate_global->__pyx_CyFunctionType)
2583#define __Pyx_CyOrPyCFunction_Check(obj) __Pyx_TypeCheck2(obj, __pyx_mstate_global->__pyx_CyFunctionType, &PyCFunction_Type)
2584#define __Pyx_CyFunction_CheckExact(obj) Py_IS_TYPE(obj, __pyx_mstate_global->__pyx_CyFunctionType)
2585static CYTHON_INLINE
int __Pyx__IsSameCyOrCFunction(PyObject *func,
void (*cfunc)(
void));
2586#undef __Pyx_IsSameCFunction
2587#define __Pyx_IsSameCFunction(func, cfunc) __Pyx__IsSameCyOrCFunction(func, cfunc)
2588static CYTHON_INLINE
void __Pyx__CyFunction_SetClassObj(__pyx_CyFunctionObject*
f, PyObject* classobj);
2589static CYTHON_INLINE PyObject *__Pyx_CyFunction_InitDefaults(PyObject *func,
2590 PyTypeObject *defaults_type);
2591static CYTHON_INLINE
void __Pyx_CyFunction_SetDefaultsTuple(PyObject *m,
2593static CYTHON_INLINE
void __Pyx_CyFunction_SetDefaultsKwDict(PyObject *m,
2595static CYTHON_INLINE
void __Pyx_CyFunction_SetAnnotationsDict(PyObject *m,
2597static int __pyx_CyFunction_init(PyObject *module);
2598#if CYTHON_VECTORCALL
2599#if CYTHON_COMPILING_IN_LIMITED_API || CYTHON_COMPILING_IN_PYPY
2600#define __Pyx_CyFunction_func_vectorcall(f) ((f)->func_vectorcall)
2602#define __Pyx_CyFunction_func_vectorcall(f) (((PyCFunctionObject*)f)->vectorcall)
2607#if !CYTHON_USE_TYPE_SPECS
2608#define __Pyx_call_type_traverse(o, always_call, visit, arg) 0
2610static int __Pyx_call_type_traverse(PyObject *o,
int always_call, visitproc visit,
void *arg);
2614static PyObject *__Pyx_PyMethod_New(PyObject *func, PyObject *self, PyObject *typ);
2617#if CYTHON_VECTORCALL
2618static CYTHON_INLINE PyObject *__Pyx_PyVectorcall_FastCallDict(PyObject *func, __pyx_vectorcallfunc vc, PyObject *
const *args,
size_t nargs, PyObject *kw);
2622static PyObject *__Pyx_CyFunction_Init(PyObject *op_in, PyMethodDef *ml,
2623 int flags, PyObject* qualname,
2625 PyObject *module, PyObject *globals,
2627#if CYTHON_VECTORCALL
2628static PyObject * __Pyx_CyFunction_Vectorcall_NOARGS(PyObject *func, PyObject *
const *args,
size_t nargsf, PyObject *kwnames);
2629static PyObject * __Pyx_CyFunction_Vectorcall_O(PyObject *func, PyObject *
const *args,
size_t nargsf, PyObject *kwnames);
2630static PyObject * __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS(PyObject *func, PyObject *
const *args,
size_t nargsf, PyObject *kwnames);
2631static PyObject * __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS_METHOD(PyObject *func, PyObject *
const *args,
size_t nargsf, PyObject *kwnames);
2635static PyObject *__Pyx_CyFunction_New(PyMethodDef *ml,
2636 int flags, PyObject* qualname,
2638 PyObject *module, PyObject *globals,
2640static PyTypeObject *__Pyx_Get_CyFunction_Type(
void);
2643#if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_TYPE_SLOTS
2644#define __PYX_DICT_VERSION_INIT ((PY_UINT64_T) -1)
2645#define __PYX_GET_DICT_VERSION(dict) (((PyDictObject*)(dict))->ma_version_tag)
2646#define __PYX_UPDATE_DICT_CACHE(dict, value, cache_var, version_var)\
2647 (version_var) = __PYX_GET_DICT_VERSION(dict);\
2648 (cache_var) = (value);
2649#define __PYX_PY_DICT_LOOKUP_IF_MODIFIED(VAR, DICT, LOOKUP) {\
2650 static PY_UINT64_T __pyx_dict_version = 0;\
2651 static PyObject *__pyx_dict_cached_value = NULL;\
2652 if (likely(__PYX_GET_DICT_VERSION(DICT) == __pyx_dict_version)) {\
2653 (VAR) = __Pyx_XNewRef(__pyx_dict_cached_value);\
2655 (VAR) = __pyx_dict_cached_value = (LOOKUP);\
2656 __pyx_dict_version = __PYX_GET_DICT_VERSION(DICT);\
2659static CYTHON_INLINE PY_UINT64_T __Pyx_get_tp_dict_version(PyObject *obj);
2660static CYTHON_INLINE PY_UINT64_T __Pyx_get_object_dict_version(PyObject *obj);
2661static CYTHON_INLINE
int __Pyx_object_dict_version_matches(PyObject* obj, PY_UINT64_T tp_dict_version, PY_UINT64_T obj_dict_version);
2663#define __PYX_GET_DICT_VERSION(dict) (0)
2664#define __PYX_UPDATE_DICT_CACHE(dict, value, cache_var, version_var)
2665#define __PYX_PY_DICT_LOOKUP_IF_MODIFIED(VAR, DICT, LOOKUP) (VAR) = (LOOKUP);
2669#if CYTHON_CLINE_IN_TRACEBACK && CYTHON_CLINE_IN_TRACEBACK_RUNTIME
2670static int __Pyx_CLineForTraceback(PyThreadState *tstate,
int c_line);
2672#define __Pyx_CLineForTraceback(tstate, c_line) (((CYTHON_CLINE_IN_TRACEBACK)) ? c_line : 0)
2676#if CYTHON_COMPILING_IN_LIMITED_API
2677typedef PyObject __Pyx_CachedCodeObjectType;
2679typedef PyCodeObject __Pyx_CachedCodeObjectType;
2682 __Pyx_CachedCodeObjectType* code_object;
2684} __Pyx_CodeObjectCacheEntry;
2685struct __Pyx_CodeObjectCache {
2688 __Pyx_CodeObjectCacheEntry* entries;
2689 #if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING
2690 __pyx_atomic_int_type accessor_count;
2693static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries,
int count,
int code_line);
2694static __Pyx_CachedCodeObjectType *__pyx_find_code_object(
int code_line);
2695static void __pyx_insert_code_object(
int code_line, __Pyx_CachedCodeObjectType* code_object);
2698static void __Pyx_AddTraceback(
const char *funcname,
int c_line,
2699 int py_line,
const char *filename);
2702#if !defined(__INTEL_COMPILER) && defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 6))
2703#define __Pyx_HAS_GCC_DIAGNOSTIC
2709 #define __Pyx_CREAL(z) ((z).real())
2710 #define __Pyx_CIMAG(z) ((z).imag())
2712 #define __Pyx_CREAL(z) (__real__(z))
2713 #define __Pyx_CIMAG(z) (__imag__(z))
2716 #define __Pyx_CREAL(z) ((z).real)
2717 #define __Pyx_CIMAG(z) ((z).imag)
2719#if defined(__cplusplus) && CYTHON_CCOMPLEX\
2720 && (defined(_WIN32) || defined(__clang__) || (defined(__GNUC__) && (__GNUC__ >= 5 || __GNUC__ == 4 && __GNUC_MINOR__ >= 4 )) || __cplusplus >= 201103)
2721 #define __Pyx_SET_CREAL(z,x) ((z).real(x))
2722 #define __Pyx_SET_CIMAG(z,y) ((z).imag(y))
2724 #define __Pyx_SET_CREAL(z,x) __Pyx_CREAL(z) = (x)
2725 #define __Pyx_SET_CIMAG(z,y) __Pyx_CIMAG(z) = (y)
2729#if CYTHON_CCOMPLEX && (1) && (!0 || __cplusplus)
2730 #define __Pyx_c_eq_float(a, b) ((a)==(b))
2731 #define __Pyx_c_sum_float(a, b) ((a)+(b))
2732 #define __Pyx_c_diff_float(a, b) ((a)-(b))
2733 #define __Pyx_c_prod_float(a, b) ((a)*(b))
2734 #define __Pyx_c_quot_float(a, b) ((a)/(b))
2735 #define __Pyx_c_neg_float(a) (-(a))
2737 #define __Pyx_c_is_zero_float(z) ((z)==(float)0)
2738 #define __Pyx_c_conj_float(z) (::std::conj(z))
2740 #define __Pyx_c_abs_float(z) (::std::abs(z))
2741 #define __Pyx_c_pow_float(a, b) (::std::pow(a, b))
2744 #define __Pyx_c_is_zero_float(z) ((z)==0)
2745 #define __Pyx_c_conj_float(z) (conjf(z))
2747 #define __Pyx_c_abs_float(z) (cabsf(z))
2748 #define __Pyx_c_pow_float(a, b) (cpowf(a, b))
2752 static CYTHON_INLINE
int __Pyx_c_eq_float(__pyx_t_float_complex, __pyx_t_float_complex);
2753 static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_sum_float(__pyx_t_float_complex, __pyx_t_float_complex);
2754 static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_diff_float(__pyx_t_float_complex, __pyx_t_float_complex);
2755 static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_prod_float(__pyx_t_float_complex, __pyx_t_float_complex);
2756 static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_quot_float(__pyx_t_float_complex, __pyx_t_float_complex);
2757 static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_neg_float(__pyx_t_float_complex);
2758 static CYTHON_INLINE
int __Pyx_c_is_zero_float(__pyx_t_float_complex);
2759 static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_conj_float(__pyx_t_float_complex);
2761 static CYTHON_INLINE
float __Pyx_c_abs_float(__pyx_t_float_complex);
2762 static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_pow_float(__pyx_t_float_complex, __pyx_t_float_complex);
2767#if CYTHON_CCOMPLEX && (1) && (!0 || __cplusplus)
2768 #define __Pyx_c_eq_double(a, b) ((a)==(b))
2769 #define __Pyx_c_sum_double(a, b) ((a)+(b))
2770 #define __Pyx_c_diff_double(a, b) ((a)-(b))
2771 #define __Pyx_c_prod_double(a, b) ((a)*(b))
2772 #define __Pyx_c_quot_double(a, b) ((a)/(b))
2773 #define __Pyx_c_neg_double(a) (-(a))
2775 #define __Pyx_c_is_zero_double(z) ((z)==(double)0)
2776 #define __Pyx_c_conj_double(z) (::std::conj(z))
2778 #define __Pyx_c_abs_double(z) (::std::abs(z))
2779 #define __Pyx_c_pow_double(a, b) (::std::pow(a, b))
2782 #define __Pyx_c_is_zero_double(z) ((z)==0)
2783 #define __Pyx_c_conj_double(z) (conj(z))
2785 #define __Pyx_c_abs_double(z) (cabs(z))
2786 #define __Pyx_c_pow_double(a, b) (cpow(a, b))
2790 static CYTHON_INLINE
int __Pyx_c_eq_double(__pyx_t_double_complex, __pyx_t_double_complex);
2791 static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_sum_double(__pyx_t_double_complex, __pyx_t_double_complex);
2792 static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_diff_double(__pyx_t_double_complex, __pyx_t_double_complex);
2793 static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_prod_double(__pyx_t_double_complex, __pyx_t_double_complex);
2794 static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_quot_double(__pyx_t_double_complex, __pyx_t_double_complex);
2795 static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_neg_double(__pyx_t_double_complex);
2796 static CYTHON_INLINE
int __Pyx_c_is_zero_double(__pyx_t_double_complex);
2797 static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_conj_double(__pyx_t_double_complex);
2799 static CYTHON_INLINE
double __Pyx_c_abs_double(__pyx_t_double_complex);
2800 static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_pow_double(__pyx_t_double_complex, __pyx_t_double_complex);
2805#if CYTHON_CCOMPLEX && (1) && (!0 || __cplusplus)
2806 #define __Pyx_c_eq_long__double(a, b) ((a)==(b))
2807 #define __Pyx_c_sum_long__double(a, b) ((a)+(b))
2808 #define __Pyx_c_diff_long__double(a, b) ((a)-(b))
2809 #define __Pyx_c_prod_long__double(a, b) ((a)*(b))
2810 #define __Pyx_c_quot_long__double(a, b) ((a)/(b))
2811 #define __Pyx_c_neg_long__double(a) (-(a))
2813 #define __Pyx_c_is_zero_long__double(z) ((z)==(long double)0)
2814 #define __Pyx_c_conj_long__double(z) (::std::conj(z))
2816 #define __Pyx_c_abs_long__double(z) (::std::abs(z))
2817 #define __Pyx_c_pow_long__double(a, b) (::std::pow(a, b))
2820 #define __Pyx_c_is_zero_long__double(z) ((z)==0)
2821 #define __Pyx_c_conj_long__double(z) (conjl(z))
2823 #define __Pyx_c_abs_long__double(z) (cabsl(z))
2824 #define __Pyx_c_pow_long__double(a, b) (cpowl(a, b))
2828 static CYTHON_INLINE
int __Pyx_c_eq_long__double(__pyx_t_long_double_complex, __pyx_t_long_double_complex);
2829 static CYTHON_INLINE __pyx_t_long_double_complex __Pyx_c_sum_long__double(__pyx_t_long_double_complex, __pyx_t_long_double_complex);
2830 static CYTHON_INLINE __pyx_t_long_double_complex __Pyx_c_diff_long__double(__pyx_t_long_double_complex, __pyx_t_long_double_complex);
2831 static CYTHON_INLINE __pyx_t_long_double_complex __Pyx_c_prod_long__double(__pyx_t_long_double_complex, __pyx_t_long_double_complex);
2832 static CYTHON_INLINE __pyx_t_long_double_complex __Pyx_c_quot_long__double(__pyx_t_long_double_complex, __pyx_t_long_double_complex);
2833 static CYTHON_INLINE __pyx_t_long_double_complex __Pyx_c_neg_long__double(__pyx_t_long_double_complex);
2834 static CYTHON_INLINE
int __Pyx_c_is_zero_long__double(__pyx_t_long_double_complex);
2835 static CYTHON_INLINE __pyx_t_long_double_complex __Pyx_c_conj_long__double(__pyx_t_long_double_complex);
2837 static CYTHON_INLINE
long double __Pyx_c_abs_long__double(__pyx_t_long_double_complex);
2838 static CYTHON_INLINE __pyx_t_long_double_complex __Pyx_c_pow_long__double(__pyx_t_long_double_complex, __pyx_t_long_double_complex);
2843static CYTHON_INLINE
int __Pyx_PyLong_As_int(PyObject *);
2846#if CYTHON_VECTORCALL
2847#define __Pyx_Object_VectorcallKwds PyObject_Vectorcall
2848CYTHON_UNUSED
static int __Pyx_CheckVectorcallKwarg(PyObject *kwnames, Py_ssize_t i);
2850#define __Pyx_Object_VectorcallKwds __Pyx_PyObject_FastCallDict
2851CYTHON_UNUSED
static PyObject *__Pyx_MakeKwargDict(PyObject **keys, PyObject **values, Py_ssize_t
n);
2852CYTHON_UNUSED
static int __Pyx_CheckVectorcallKwarg(PyObject **kwnames, Py_ssize_t i);
2856#if CYTHON_VECTORCALL
2857#define __Pyx_Object_VectorcallMethodKwds PyObject_VectorcallMethod
2859static PyObject *__Pyx_Object_VectorcallMethodKwds(PyObject *name, PyObject *
const *args,
size_t nargsf, PyObject *kwnames);
2863static CYTHON_INLINE PyObject* __Pyx_PyLong_From_int(
int value);
2866#if CYTHON_COMPILING_IN_LIMITED_API && __PYX_LIMITED_VERSION_HEX >= 0x030d0000
2867typedef PyObject *__Pyx_TypeName;
2868#define __Pyx_FMT_TYPENAME "%N"
2869#define __Pyx_PyType_GetFullyQualifiedName(tp) Py_NewRef((PyObject*)tp)
2870#define __Pyx_DECREF_TypeName(obj) Py_DECREF(obj)
2871#elif CYTHON_COMPILING_IN_LIMITED_API
2872typedef PyObject *__Pyx_TypeName;
2873#define __Pyx_FMT_TYPENAME "%U"
2874#define __Pyx_DECREF_TypeName(obj) Py_XDECREF(obj)
2875static __Pyx_TypeName __Pyx_PyType_GetFullyQualifiedName(PyTypeObject* tp);
2877typedef const char *__Pyx_TypeName;
2878#define __Pyx_FMT_TYPENAME "%.200s"
2879#define __Pyx_PyType_GetFullyQualifiedName(tp) ((tp)->tp_name)
2880#define __Pyx_DECREF_TypeName(obj)
2884static CYTHON_INLINE PyObject* __Pyx_PyLong_From_long(
long value);
2887static CYTHON_INLINE
long __Pyx_PyLong_As_long(PyObject *);
2890#if __PYX_LIMITED_VERSION_HEX < 0x030b0000
2891static unsigned long __Pyx_cached_runtime_version = 0;
2892static void __Pyx_init_runtime_version(
void);
2894#define __Pyx_init_runtime_version()
2896static unsigned long __Pyx_get_runtime_version(
void);
2899static int __Pyx_check_binary_version(
unsigned long ct_version,
unsigned long rt_version,
int allow_newer);
2902static PyObject *__Pyx_DecompressString(
const char *
s, Py_ssize_t length,
int algo);
2905static PyObject *__Pyx_DecompressString_LZSS(
const char *
s,
size_t compressed_length,
size_t uncompressed_length);
2908#if CYTHON_PEP489_MULTI_PHASE_INIT && CYTHON_USE_MODULE_STATE
2910static PyObject *__Pyx_State_FindModule(
void*);
2911static int __Pyx_State_AddModule(PyObject* module,
void*);
2912static int __Pyx_State_RemoveModule(
void*);
2913#elif CYTHON_USE_MODULE_STATE
2914#define __Pyx_State_FindModule PyState_FindModule
2915#define __Pyx_State_AddModule PyState_AddModule
2916#define __Pyx_State_RemoveModule PyState_RemoveModule
2921#if CYTHON_COMPILING_IN_LIMITED_API
2922 #if CYTHON_VECTORCALL
2923 #define __PYX_VECTORCALL_ABI_SUFFIX "_vectorcall"
2925 #define __PYX_VECTORCALL_ABI_SUFFIX
2927 #define __PYX_LIMITED_ABI_SUFFIX "limited" __PYX_VECTORCALL_ABI_SUFFIX __PYX_AM_SEND_ABI_SUFFIX
2929 #define __PYX_LIMITED_ABI_SUFFIX
2931#if __PYX_HAS_PY_AM_SEND == 1
2932 #define __PYX_AM_SEND_ABI_SUFFIX
2933#elif __PYX_HAS_PY_AM_SEND == 2
2934 #define __PYX_AM_SEND_ABI_SUFFIX "amsendbackport"
2936 #define __PYX_AM_SEND_ABI_SUFFIX "noamsend"
2938#ifndef __PYX_MONITORING_ABI_SUFFIX
2939 #define __PYX_MONITORING_ABI_SUFFIX
2941#if CYTHON_USE_TP_FINALIZE
2942 #define __PYX_TP_FINALIZE_ABI_SUFFIX
2944 #define __PYX_TP_FINALIZE_ABI_SUFFIX "nofinalize"
2946#if CYTHON_USE_FREELISTS || !defined(__Pyx_AsyncGen_USED)
2947 #define __PYX_FREELISTS_ABI_SUFFIX
2949 #define __PYX_FREELISTS_ABI_SUFFIX "nofreelists"
2951#if CYTHON_OPAQUE_OBJECTS && CYTHON_COMPILING_IN_LIMITED_API
2952 #define __PYX_OPAQUE_OBJECTS_ABI_SUFFIX "opaque"
2954 #define __PYX_OPAQUE_OBJECTS_ABI_SUFFIX
2956#define CYTHON_ABI __PYX_ABI_VERSION __PYX_LIMITED_ABI_SUFFIX __PYX_MONITORING_ABI_SUFFIX __PYX_TP_FINALIZE_ABI_SUFFIX __PYX_FREELISTS_ABI_SUFFIX __PYX_AM_SEND_ABI_SUFFIX __PYX_OPAQUE_OBJECTS_ABI_SUFFIX
2957#define __PYX_ABI_MODULE_NAME "_cython_" CYTHON_ABI
2958#define __PYX_TYPE_MODULE_PREFIX __PYX_ABI_MODULE_NAME "."
2960static CYTHON_INLINE PyTypeObject *__pyx_f_5numpy_5dtype_7typeobj___get__(PyArray_Descr *__pyx_v_self);
2961static CYTHON_INLINE
char __pyx_f_5numpy_5dtype_4kind___get__(PyArray_Descr *__pyx_v_self);
2962static CYTHON_INLINE
char __pyx_f_5numpy_5dtype_4type___get__(PyArray_Descr *__pyx_v_self);
2963static CYTHON_INLINE
char __pyx_f_5numpy_5dtype_9byteorder___get__(PyArray_Descr *__pyx_v_self);
2964static CYTHON_INLINE
int __pyx_f_5numpy_5dtype_8type_num___get__(PyArray_Descr *__pyx_v_self);
2965static CYTHON_INLINE npy_intp __pyx_f_5numpy_5dtype_8itemsize___get__(PyArray_Descr *__pyx_v_self);
2966static CYTHON_INLINE npy_intp __pyx_f_5numpy_5dtype_9alignment___get__(PyArray_Descr *__pyx_v_self);
2967static CYTHON_INLINE PyObject *__pyx_f_5numpy_5dtype_6fields___get__(PyArray_Descr *__pyx_v_self);
2968static CYTHON_INLINE PyObject *__pyx_f_5numpy_5dtype_5names___get__(PyArray_Descr *__pyx_v_self);
2969static CYTHON_INLINE PyArray_ArrayDescr *__pyx_f_5numpy_5dtype_8subarray___get__(PyArray_Descr *__pyx_v_self);
2970static CYTHON_INLINE npy_uint64 __pyx_f_5numpy_5dtype_5flags___get__(PyArray_Descr *__pyx_v_self);
2971static CYTHON_INLINE
int __pyx_f_5numpy_9broadcast_7numiter___get__(PyArrayMultiIterObject *__pyx_v_self);
2972static CYTHON_INLINE npy_intp __pyx_f_5numpy_9broadcast_4size___get__(PyArrayMultiIterObject *__pyx_v_self);
2973static CYTHON_INLINE npy_intp __pyx_f_5numpy_9broadcast_5index___get__(PyArrayMultiIterObject *__pyx_v_self);
2974static CYTHON_INLINE
int __pyx_f_5numpy_9broadcast_2nd___get__(PyArrayMultiIterObject *__pyx_v_self);
2975static CYTHON_INLINE npy_intp *__pyx_f_5numpy_9broadcast_10dimensions___get__(PyArrayMultiIterObject *__pyx_v_self);
2976static CYTHON_INLINE
void **__pyx_f_5numpy_9broadcast_5iters___get__(PyArrayMultiIterObject *__pyx_v_self);
2977static CYTHON_INLINE PyObject *__pyx_f_5numpy_7ndarray_4base___get__(PyArrayObject *__pyx_v_self);
2978static CYTHON_INLINE PyArray_Descr *__pyx_f_5numpy_7ndarray_5descr___get__(PyArrayObject *__pyx_v_self);
2979static CYTHON_INLINE
int __pyx_f_5numpy_7ndarray_4ndim___get__(PyArrayObject *__pyx_v_self);
2980static CYTHON_INLINE npy_intp *__pyx_f_5numpy_7ndarray_5shape___get__(PyArrayObject *__pyx_v_self);
2981static CYTHON_INLINE npy_intp *__pyx_f_5numpy_7ndarray_7strides___get__(PyArrayObject *__pyx_v_self);
2982static CYTHON_INLINE npy_intp __pyx_f_5numpy_7ndarray_4size___get__(PyArrayObject *__pyx_v_self);
2983static CYTHON_INLINE
char *__pyx_f_5numpy_7ndarray_4data___get__(PyArrayObject *__pyx_v_self);
2984static CYTHON_INLINE
int __pyx_f_5numpy_5ufunc_3nin___get__(PyUFuncObject *__pyx_v_self);
2985static CYTHON_INLINE
int __pyx_f_5numpy_5ufunc_4nout___get__(PyUFuncObject *__pyx_v_self);
2986static CYTHON_INLINE
int __pyx_f_5numpy_5ufunc_5nargs___get__(PyUFuncObject *__pyx_v_self);
2987static CYTHON_INLINE PyUFuncGenericFunction *__pyx_f_5numpy_5ufunc_9functions___get__(PyUFuncObject *__pyx_v_self);
2988static CYTHON_INLINE
void **__pyx_f_5numpy_5ufunc_4data___get__(PyUFuncObject *__pyx_v_self);
2989static CYTHON_INLINE
int __pyx_f_5numpy_5ufunc_6ntypes___get__(PyUFuncObject *__pyx_v_self);
2990static CYTHON_INLINE
char const *__pyx_f_5numpy_5ufunc_4name___get__(PyUFuncObject *__pyx_v_self);
2991static CYTHON_INLINE
char const *__pyx_f_5numpy_5ufunc_3doc___get__(PyUFuncObject *__pyx_v_self);
2992static CYTHON_INLINE
void *__pyx_f_5numpy_5ufunc_3ptr___get__(PyUFuncObject *__pyx_v_self);
2993static CYTHON_INLINE PyObject *__pyx_f_5numpy_5ufunc_3obj___get__(PyUFuncObject *__pyx_v_self);
2994static CYTHON_INLINE PyObject *__pyx_f_5numpy_5ufunc_9userloops___get__(PyUFuncObject *__pyx_v_self);
3019#define __Pyx_MODULE_NAME "cSubsurfaceTransportCoefficients"
3020extern int __pyx_module_is_main_cSubsurfaceTransportCoefficients;
3021int __pyx_module_is_main_cSubsurfaceTransportCoefficients = 0;
3027static 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);
3028static 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);
3032#ifndef CYTHON_SMALL_CODE
3033#if defined(__clang__)
3034 #define CYTHON_SMALL_CODE
3035#elif defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 3))
3036 #define CYTHON_SMALL_CODE __attribute__((cold))
3038 #define CYTHON_SMALL_CODE
3048 PyObject *__pyx_cython_runtime;
3049 PyObject *__pyx_empty_tuple;
3050 PyObject *__pyx_empty_bytes;
3051 PyObject *__pyx_empty_unicode;
3052 PyTypeObject *__pyx_ptype_7cpython_4type_type;
3053 PyTypeObject *__pyx_ptype_5numpy_dtype;
3054 PyTypeObject *__pyx_ptype_5numpy_flatiter;
3055 PyTypeObject *__pyx_ptype_5numpy_broadcast;
3056 PyTypeObject *__pyx_ptype_5numpy_ndarray;
3057 PyTypeObject *__pyx_ptype_5numpy_generic;
3058 PyTypeObject *__pyx_ptype_5numpy_number;
3059 PyTypeObject *__pyx_ptype_5numpy_integer;
3060 PyTypeObject *__pyx_ptype_5numpy_signedinteger;
3061 PyTypeObject *__pyx_ptype_5numpy_unsignedinteger;
3062 PyTypeObject *__pyx_ptype_5numpy_inexact;
3063 PyTypeObject *__pyx_ptype_5numpy_floating;
3064 PyTypeObject *__pyx_ptype_5numpy_complexfloating;
3065 PyTypeObject *__pyx_ptype_5numpy_flexible;
3066 PyTypeObject *__pyx_ptype_5numpy_character;
3067 PyTypeObject *__pyx_ptype_5numpy_ufunc;
3068 __Pyx_CachedCFunction __pyx_umethod_PyDict_Type_items;
3069 __Pyx_CachedCFunction __pyx_umethod_PyDict_Type_pop;
3070 __Pyx_CachedCFunction __pyx_umethod_PyDict_Type_values;
3071 PyObject *__pyx_codeobj_tab[2];
3072 PyObject *__pyx_string_tab[70];
3075PyTypeObject *__pyx_CommonTypesMetaclassType;
3078#if CYTHON_COMPILING_IN_LIMITED_API
3079PyObject *__Pyx_CachedMethodType;
3083PyTypeObject *__pyx_CyFunctionType;
3086struct __Pyx_CodeObjectCache __pyx_code_cache;
3094#if CYTHON_USE_MODULE_STATE
3097extern struct PyModuleDef __pyx_moduledef;
3100static struct PyModuleDef __pyx_moduledef;
3103#define __pyx_mstate_global (__Pyx_PyModule_GetState(__Pyx_State_FindModule(&__pyx_moduledef)))
3105#define __pyx_m (__Pyx_State_FindModule(&__pyx_moduledef))
3107static __pyx_mstatetype __pyx_mstate_global_static =
3113static __pyx_mstatetype *
const __pyx_mstate_global = &__pyx_mstate_global_static;
3116#define __pyx_kp_u_ __pyx_string_tab[0]
3117#define __pyx_kp_u_Note_that_Cython_is_deliberately __pyx_string_tab[1]
3118#define __pyx_kp_u_add_note __pyx_string_tab[2]
3119#define __pyx_kp_u_numpy__core_multiarray_failed_to __pyx_string_tab[3]
3120#define __pyx_kp_u_numpy__core_umath_failed_to_impo __pyx_string_tab[4]
3121#define __pyx_kp_u_proteus_cSubsurfaceTransportCoef __pyx_string_tab[5]
3122#define __pyx_n_u_Kbar __pyx_string_tab[6]
3123#define __pyx_n_u_Pyx_PyDict_NextRef __pyx_string_tab[7]
3124#define __pyx_n_u_annotate __pyx_string_tab[8]
3125#define __pyx_n_u_func __pyx_string_tab[9]
3126#define __pyx_n_u_main __pyx_string_tab[10]
3127#define __pyx_n_u_module __pyx_string_tab[11]
3128#define __pyx_n_u_name __pyx_string_tab[12]
3129#define __pyx_n_u_qualname __pyx_string_tab[13]
3130#define __pyx_n_u_test __pyx_string_tab[14]
3131#define __pyx_n_u_is_coroutine __pyx_string_tab[15]
3132#define __pyx_n_u_asyncio_coroutines __pyx_string_tab[16]
3133#define __pyx_n_u_b __pyx_string_tab[17]
3134#define __pyx_n_u_bc_u __pyx_string_tab[18]
3135#define __pyx_n_u_cSubsurfaceTransportCoefficients __pyx_string_tab[19]
3136#define __pyx_n_u_calculateRusanovFluxSaturationEq __pyx_string_tab[20]
3137#define __pyx_n_u_cline_in_traceback __pyx_string_tab[21]
3138#define __pyx_n_u_colind __pyx_string_tab[22]
3139#define __pyx_n_u_dy __pyx_string_tab[23]
3140#define __pyx_n_u_ebq_global_qt __pyx_string_tab[24]
3141#define __pyx_n_u_elementBoundaryElements __pyx_string_tab[25]
3142#define __pyx_n_u_elementBoundaryLocalElementBound __pyx_string_tab[26]
3143#define __pyx_n_u_exteriorElementBoundaries __pyx_string_tab[27]
3144#define __pyx_n_u_failed __pyx_string_tab[28]
3145#define __pyx_n_u_flux __pyx_string_tab[29]
3146#define __pyx_n_u_g __pyx_string_tab[30]
3147#define __pyx_n_u_interiorElementBoundaries __pyx_string_tab[31]
3148#define __pyx_n_u_isDOFBoundary __pyx_string_tab[32]
3149#define __pyx_n_u_items __pyx_string_tab[33]
3150#define __pyx_n_u_materialTypes __pyx_string_tab[34]
3151#define __pyx_n_u_mun __pyx_string_tab[35]
3152#define __pyx_n_u_muw __pyx_string_tab[36]
3153#define __pyx_n_u_n __pyx_string_tab[37]
3154#define __pyx_n_u_nElementBoundaries_element __pyx_string_tab[38]
3155#define __pyx_n_u_nElements_global __pyx_string_tab[39]
3156#define __pyx_n_u_nExteriorElementBoundaries_globa __pyx_string_tab[40]
3157#define __pyx_n_u_nInteriorElementBoundaries_globa __pyx_string_tab[41]
3158#define __pyx_n_u_nParams __pyx_string_tab[42]
3159#define __pyx_n_u_nQuadraturePoints_element __pyx_string_tab[43]
3160#define __pyx_n_u_nQuadraturePoints_elementBoundar __pyx_string_tab[44]
3161#define __pyx_n_u_nSpace __pyx_string_tab[45]
3162#define __pyx_n_u_np __pyx_string_tab[46]
3163#define __pyx_n_u_numpy __pyx_string_tab[47]
3164#define __pyx_n_u_omega __pyx_string_tab[48]
3165#define __pyx_n_u_piecewiseLinearTableLookup __pyx_string_tab[49]
3166#define __pyx_n_u_pop __pyx_string_tab[50]
3167#define __pyx_n_u_pskModelFlag __pyx_string_tab[51]
3168#define __pyx_n_u_q_dV __pyx_string_tab[52]
3169#define __pyx_n_u_q_lambda_bar __pyx_string_tab[53]
3170#define __pyx_n_u_q_u __pyx_string_tab[54]
3171#define __pyx_n_u_rowptr __pyx_string_tab[55]
3172#define __pyx_n_u_rwork_density_n __pyx_string_tab[56]
3173#define __pyx_n_u_rwork_density_w __pyx_string_tab[57]
3174#define __pyx_n_u_rwork_psk __pyx_string_tab[58]
3175#define __pyx_n_u_rwork_psk_tol __pyx_string_tab[59]
3176#define __pyx_n_u_safetyFactor __pyx_string_tab[60]
3177#define __pyx_n_u_setdefault __pyx_string_tab[61]
3178#define __pyx_n_u_start __pyx_string_tab[62]
3179#define __pyx_n_u_values __pyx_string_tab[63]
3180#define __pyx_n_u_x __pyx_string_tab[64]
3181#define __pyx_n_u_xv __pyx_string_tab[65]
3182#define __pyx_n_u_y __pyx_string_tab[66]
3183#define __pyx_n_u_yv __pyx_string_tab[67]
3184#define __pyx_kp_b_iso88591_1_aq_q_1_1_1_1_Ct1 __pyx_string_tab[68]
3185#define __pyx_kp_b_iso88591_H_Na_vQ_vQ_A_q_a_1_q_1_q_a_a_5Q __pyx_string_tab[69]
3187#if CYTHON_USE_MODULE_STATE
3188static CYTHON_SMALL_CODE
int __pyx_m_clear(PyObject *m) {
3189 __pyx_mstatetype *clear_module_state = __Pyx_PyModule_GetState(m);
3190 if (!clear_module_state)
return 0;
3191 Py_CLEAR(clear_module_state->__pyx_d);
3192 Py_CLEAR(clear_module_state->__pyx_b);
3193 Py_CLEAR(clear_module_state->__pyx_cython_runtime);
3194 Py_CLEAR(clear_module_state->__pyx_empty_tuple);
3195 Py_CLEAR(clear_module_state->__pyx_empty_bytes);
3196 Py_CLEAR(clear_module_state->__pyx_empty_unicode);
3197 #if CYTHON_PEP489_MULTI_PHASE_INIT
3198 __Pyx_State_RemoveModule(NULL);
3200 Py_CLEAR(clear_module_state->__pyx_ptype_7cpython_4type_type);
3201 Py_CLEAR(clear_module_state->__pyx_ptype_5numpy_dtype);
3202 Py_CLEAR(clear_module_state->__pyx_ptype_5numpy_flatiter);
3203 Py_CLEAR(clear_module_state->__pyx_ptype_5numpy_broadcast);
3204 Py_CLEAR(clear_module_state->__pyx_ptype_5numpy_ndarray);
3205 Py_CLEAR(clear_module_state->__pyx_ptype_5numpy_generic);
3206 Py_CLEAR(clear_module_state->__pyx_ptype_5numpy_number);
3207 Py_CLEAR(clear_module_state->__pyx_ptype_5numpy_integer);
3208 Py_CLEAR(clear_module_state->__pyx_ptype_5numpy_signedinteger);
3209 Py_CLEAR(clear_module_state->__pyx_ptype_5numpy_unsignedinteger);
3210 Py_CLEAR(clear_module_state->__pyx_ptype_5numpy_inexact);
3211 Py_CLEAR(clear_module_state->__pyx_ptype_5numpy_floating);
3212 Py_CLEAR(clear_module_state->__pyx_ptype_5numpy_complexfloating);
3213 Py_CLEAR(clear_module_state->__pyx_ptype_5numpy_flexible);
3214 Py_CLEAR(clear_module_state->__pyx_ptype_5numpy_character);
3215 Py_CLEAR(clear_module_state->__pyx_ptype_5numpy_ufunc);
3216 Py_CLEAR(clear_module_state->__pyx_umethod_PyDict_Type_items.method);
3217 Py_CLEAR(clear_module_state->__pyx_umethod_PyDict_Type_pop.method);
3218 Py_CLEAR(clear_module_state->__pyx_umethod_PyDict_Type_values.method);
3219 for (
int i=0; i<2; ++i) { Py_CLEAR(clear_module_state->__pyx_codeobj_tab[i]); }
3220 for (
int i=0; i<70; ++i) { Py_CLEAR(clear_module_state->__pyx_string_tab[i]); }
3223Py_CLEAR(clear_module_state->__pyx_CommonTypesMetaclassType);
3226Py_CLEAR(clear_module_state->__pyx_CyFunctionType);
3233#if CYTHON_USE_MODULE_STATE
3234static CYTHON_SMALL_CODE
int __pyx_m_traverse(PyObject *m, visitproc visit,
void *arg) {
3235 __pyx_mstatetype *traverse_module_state = __Pyx_PyModule_GetState(m);
3236 if (!traverse_module_state)
return 0;
3237 Py_VISIT(traverse_module_state->__pyx_d);
3238 Py_VISIT(traverse_module_state->__pyx_b);
3239 Py_VISIT(traverse_module_state->__pyx_cython_runtime);
3240 __Pyx_VISIT_CONST(traverse_module_state->__pyx_empty_tuple);
3241 __Pyx_VISIT_CONST(traverse_module_state->__pyx_empty_bytes);
3242 __Pyx_VISIT_CONST(traverse_module_state->__pyx_empty_unicode);
3243 Py_VISIT(traverse_module_state->__pyx_ptype_7cpython_4type_type);
3244 Py_VISIT(traverse_module_state->__pyx_ptype_5numpy_dtype);
3245 Py_VISIT(traverse_module_state->__pyx_ptype_5numpy_flatiter);
3246 Py_VISIT(traverse_module_state->__pyx_ptype_5numpy_broadcast);
3247 Py_VISIT(traverse_module_state->__pyx_ptype_5numpy_ndarray);
3248 Py_VISIT(traverse_module_state->__pyx_ptype_5numpy_generic);
3249 Py_VISIT(traverse_module_state->__pyx_ptype_5numpy_number);
3250 Py_VISIT(traverse_module_state->__pyx_ptype_5numpy_integer);
3251 Py_VISIT(traverse_module_state->__pyx_ptype_5numpy_signedinteger);
3252 Py_VISIT(traverse_module_state->__pyx_ptype_5numpy_unsignedinteger);
3253 Py_VISIT(traverse_module_state->__pyx_ptype_5numpy_inexact);
3254 Py_VISIT(traverse_module_state->__pyx_ptype_5numpy_floating);
3255 Py_VISIT(traverse_module_state->__pyx_ptype_5numpy_complexfloating);
3256 Py_VISIT(traverse_module_state->__pyx_ptype_5numpy_flexible);
3257 Py_VISIT(traverse_module_state->__pyx_ptype_5numpy_character);
3258 Py_VISIT(traverse_module_state->__pyx_ptype_5numpy_ufunc);
3259 Py_VISIT(traverse_module_state->__pyx_umethod_PyDict_Type_items.method);
3260 Py_VISIT(traverse_module_state->__pyx_umethod_PyDict_Type_pop.method);
3261 Py_VISIT(traverse_module_state->__pyx_umethod_PyDict_Type_values.method);
3262 for (
int i=0; i<2; ++i) { __Pyx_VISIT_CONST(traverse_module_state->__pyx_codeobj_tab[i]); }
3263 for (
int i=0; i<70; ++i) { __Pyx_VISIT_CONST(traverse_module_state->__pyx_string_tab[i]); }
3266Py_VISIT(traverse_module_state->__pyx_CommonTypesMetaclassType);
3269Py_VISIT(traverse_module_state->__pyx_CyFunctionType);
3285static CYTHON_INLINE PyTypeObject *__pyx_f_5numpy_5dtype_7typeobj___get__(PyArray_Descr *__pyx_v_self) {
3286 PyTypeObject *__pyx_r;
3297 __pyx_r = PyDataType_TYPEOBJ(__pyx_v_self);
3322static CYTHON_INLINE
char __pyx_f_5numpy_5dtype_4kind___get__(PyArray_Descr *__pyx_v_self) {
3334 __pyx_r = PyDataType_KIND(__pyx_v_self);
3359static CYTHON_INLINE
char __pyx_f_5numpy_5dtype_4type___get__(PyArray_Descr *__pyx_v_self) {
3371 __pyx_r = PyDataType_TYPE(__pyx_v_self);
3396static CYTHON_INLINE
char __pyx_f_5numpy_5dtype_9byteorder___get__(PyArray_Descr *__pyx_v_self) {
3408 __pyx_r = PyDataType_BYTEORDER(__pyx_v_self);
3433static CYTHON_INLINE
int __pyx_f_5numpy_5dtype_8type_num___get__(PyArray_Descr *__pyx_v_self) {
3445 __pyx_r = PyDataType_TYPENUM(__pyx_v_self);
3470static CYTHON_INLINE npy_intp __pyx_f_5numpy_5dtype_8itemsize___get__(PyArray_Descr *__pyx_v_self) {
3482 __pyx_r = PyDataType_ELSIZE(__pyx_v_self);
3507static CYTHON_INLINE npy_intp __pyx_f_5numpy_5dtype_9alignment___get__(PyArray_Descr *__pyx_v_self) {
3519 __pyx_r = PyDataType_ALIGNMENT(__pyx_v_self);
3544static CYTHON_INLINE PyObject *__pyx_f_5numpy_5dtype_6fields___get__(PyArray_Descr *__pyx_v_self) {
3545 PyObject *__pyx_r = NULL;
3546 __Pyx_RefNannyDeclarations
3547 PyObject *__pyx_t_1;
3548 __Pyx_RefNannySetupContext(
"__get__", 0);
3557 __pyx_t_1 = PyDataType_FIELDS(__pyx_v_self);
3560 PyObject *__pyx_temp;
3562 __pyx_temp = __pyx_r;
3563 __Pyx_INCREF(((PyObject *)__pyx_t_1));
3564 __pyx_r = ((PyObject *)__pyx_t_1);
3566 __Pyx_XDECREF(__pyx_temp);
3581 __Pyx_XGIVEREF(__pyx_r);
3582 __Pyx_RefNannyFinishContext();
3594static CYTHON_INLINE PyObject *__pyx_f_5numpy_5dtype_5names___get__(PyArray_Descr *__pyx_v_self) {
3595 PyObject *__pyx_r = NULL;
3596 __Pyx_RefNannyDeclarations
3597 PyObject *__pyx_t_1;
3598 __Pyx_RefNannySetupContext(
"__get__", 0);
3607 __pyx_t_1 = PyDataType_NAMES(__pyx_v_self);
3610 PyObject *__pyx_temp;
3612 __pyx_temp = __pyx_r;
3613 __Pyx_INCREF(((PyObject*)__pyx_t_1));
3614 __pyx_r = ((PyObject*)__pyx_t_1);
3616 __Pyx_XDECREF(__pyx_temp);
3631 __Pyx_XGIVEREF(__pyx_r);
3632 __Pyx_RefNannyFinishContext();
3644static CYTHON_INLINE PyArray_ArrayDescr *__pyx_f_5numpy_5dtype_8subarray___get__(PyArray_Descr *__pyx_v_self) {
3645 PyArray_ArrayDescr *__pyx_r;
3656 __pyx_r = PyDataType_SUBARRAY(__pyx_v_self);
3681static CYTHON_INLINE npy_uint64 __pyx_f_5numpy_5dtype_5flags___get__(PyArray_Descr *__pyx_v_self) {
3693 __pyx_r = PyDataType_FLAGS(__pyx_v_self);
3718static CYTHON_INLINE
int __pyx_f_5numpy_9broadcast_7numiter___get__(PyArrayMultiIterObject *__pyx_v_self) {
3730 __pyx_r = PyArray_MultiIter_NUMITER(__pyx_v_self);
3755static CYTHON_INLINE npy_intp __pyx_f_5numpy_9broadcast_4size___get__(PyArrayMultiIterObject *__pyx_v_self) {
3767 __pyx_r = PyArray_MultiIter_SIZE(__pyx_v_self);
3792static CYTHON_INLINE npy_intp __pyx_f_5numpy_9broadcast_5index___get__(PyArrayMultiIterObject *__pyx_v_self) {
3804 __pyx_r = PyArray_MultiIter_INDEX(__pyx_v_self);
3829static CYTHON_INLINE
int __pyx_f_5numpy_9broadcast_2nd___get__(PyArrayMultiIterObject *__pyx_v_self) {
3841 __pyx_r = PyArray_MultiIter_NDIM(__pyx_v_self);
3866static CYTHON_INLINE npy_intp *__pyx_f_5numpy_9broadcast_10dimensions___get__(PyArrayMultiIterObject *__pyx_v_self) {
3878 __pyx_r = PyArray_MultiIter_DIMS(__pyx_v_self);
3903static CYTHON_INLINE
void **__pyx_f_5numpy_9broadcast_5iters___get__(PyArrayMultiIterObject *__pyx_v_self) {
3915 __pyx_r = PyArray_MultiIter_ITERS(__pyx_v_self);
3940static CYTHON_INLINE PyObject *__pyx_f_5numpy_7ndarray_4base___get__(PyArrayObject *__pyx_v_self) {
3952 __pyx_r = PyArray_BASE(__pyx_v_self);
3977static CYTHON_INLINE PyArray_Descr *__pyx_f_5numpy_7ndarray_5descr___get__(PyArrayObject *__pyx_v_self) {
3978 PyArray_Descr *__pyx_r = NULL;
3979 __Pyx_RefNannyDeclarations
3980 PyArray_Descr *__pyx_t_1;
3981 __Pyx_RefNannySetupContext(
"__get__", 0);
3990 __pyx_t_1 = PyArray_DESCR(__pyx_v_self);
3993 PyArray_Descr *__pyx_temp;
3995 __pyx_temp = __pyx_r;
3996 __Pyx_INCREF((PyObject *)((PyArray_Descr *)__pyx_t_1));
3997 __pyx_r = ((PyArray_Descr *)__pyx_t_1);
3999 __Pyx_XDECREF((PyObject *)__pyx_temp);
4014 __Pyx_XGIVEREF((PyObject *)__pyx_r);
4015 __Pyx_RefNannyFinishContext();
4027static CYTHON_INLINE
int __pyx_f_5numpy_7ndarray_4ndim___get__(PyArrayObject *__pyx_v_self) {
4039 __pyx_r = PyArray_NDIM(__pyx_v_self);
4064static CYTHON_INLINE npy_intp *__pyx_f_5numpy_7ndarray_5shape___get__(PyArrayObject *__pyx_v_self) {
4076 __pyx_r = PyArray_DIMS(__pyx_v_self);
4101static CYTHON_INLINE npy_intp *__pyx_f_5numpy_7ndarray_7strides___get__(PyArrayObject *__pyx_v_self) {
4113 __pyx_r = PyArray_STRIDES(__pyx_v_self);
4138static CYTHON_INLINE npy_intp __pyx_f_5numpy_7ndarray_4size___get__(PyArrayObject *__pyx_v_self) {
4150 __pyx_r = PyArray_SIZE(__pyx_v_self);
4175static CYTHON_INLINE
char *__pyx_f_5numpy_7ndarray_4data___get__(PyArrayObject *__pyx_v_self) {
4187 __pyx_r = PyArray_BYTES(__pyx_v_self);
4212static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew1(PyObject *__pyx_v_a) {
4213 PyObject *__pyx_r = NULL;
4214 __Pyx_RefNannyDeclarations
4215 PyObject *__pyx_t_1 = NULL;
4216 int __pyx_lineno = 0;
4217 const char *__pyx_filename = NULL;
4218 int __pyx_clineno = 0;
4219 __Pyx_RefNannySetupContext(
"PyArray_MultiIterNew1", 0);
4228 __pyx_t_1 = PyArray_MultiIterNew(1, ((
void *)__pyx_v_a));
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 795, __pyx_L1_error)
4229 __Pyx_GOTREF(__pyx_t_1);
4231 PyObject *__pyx_temp;
4233 __pyx_temp = __pyx_r;
4234 __pyx_r = __pyx_t_1;
4236 __Pyx_XDECREF(__pyx_temp);
4251 __Pyx_XDECREF(__pyx_t_1);
4252 __Pyx_AddTraceback(
"numpy.PyArray_MultiIterNew1", __pyx_clineno, __pyx_lineno, __pyx_filename);
4255 __Pyx_XGIVEREF(__pyx_r);
4256 __Pyx_RefNannyFinishContext();
4268static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew2(PyObject *__pyx_v_a, PyObject *__pyx_v_b) {
4269 PyObject *__pyx_r = NULL;
4270 __Pyx_RefNannyDeclarations
4271 PyObject *__pyx_t_1 = NULL;
4272 int __pyx_lineno = 0;
4273 const char *__pyx_filename = NULL;
4274 int __pyx_clineno = 0;
4275 __Pyx_RefNannySetupContext(
"PyArray_MultiIterNew2", 0);
4284 __pyx_t_1 = PyArray_MultiIterNew(2, ((
void *)__pyx_v_a), ((
void *)__pyx_v_b));
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 798, __pyx_L1_error)
4285 __Pyx_GOTREF(__pyx_t_1);
4287 PyObject *__pyx_temp;
4289 __pyx_temp = __pyx_r;
4290 __pyx_r = __pyx_t_1;
4292 __Pyx_XDECREF(__pyx_temp);
4307 __Pyx_XDECREF(__pyx_t_1);
4308 __Pyx_AddTraceback(
"numpy.PyArray_MultiIterNew2", __pyx_clineno, __pyx_lineno, __pyx_filename);
4311 __Pyx_XGIVEREF(__pyx_r);
4312 __Pyx_RefNannyFinishContext();
4324static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew3(PyObject *__pyx_v_a, PyObject *__pyx_v_b, PyObject *__pyx_v_c) {
4325 PyObject *__pyx_r = NULL;
4326 __Pyx_RefNannyDeclarations
4327 PyObject *__pyx_t_1 = NULL;
4328 int __pyx_lineno = 0;
4329 const char *__pyx_filename = NULL;
4330 int __pyx_clineno = 0;
4331 __Pyx_RefNannySetupContext(
"PyArray_MultiIterNew3", 0);
4340 __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, 801, __pyx_L1_error)
4341 __Pyx_GOTREF(__pyx_t_1);
4343 PyObject *__pyx_temp;
4345 __pyx_temp = __pyx_r;
4346 __pyx_r = __pyx_t_1;
4348 __Pyx_XDECREF(__pyx_temp);
4363 __Pyx_XDECREF(__pyx_t_1);
4364 __Pyx_AddTraceback(
"numpy.PyArray_MultiIterNew3", __pyx_clineno, __pyx_lineno, __pyx_filename);
4367 __Pyx_XGIVEREF(__pyx_r);
4368 __Pyx_RefNannyFinishContext();
4380static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew4(PyObject *__pyx_v_a, PyObject *__pyx_v_b, PyObject *__pyx_v_c, PyObject *__pyx_v_d) {
4381 PyObject *__pyx_r = NULL;
4382 __Pyx_RefNannyDeclarations
4383 PyObject *__pyx_t_1 = NULL;
4384 int __pyx_lineno = 0;
4385 const char *__pyx_filename = NULL;
4386 int __pyx_clineno = 0;
4387 __Pyx_RefNannySetupContext(
"PyArray_MultiIterNew4", 0);
4396 __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, 804, __pyx_L1_error)
4397 __Pyx_GOTREF(__pyx_t_1);
4399 PyObject *__pyx_temp;
4401 __pyx_temp = __pyx_r;
4402 __pyx_r = __pyx_t_1;
4404 __Pyx_XDECREF(__pyx_temp);
4419 __Pyx_XDECREF(__pyx_t_1);
4420 __Pyx_AddTraceback(
"numpy.PyArray_MultiIterNew4", __pyx_clineno, __pyx_lineno, __pyx_filename);
4423 __Pyx_XGIVEREF(__pyx_r);
4424 __Pyx_RefNannyFinishContext();
4436static 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) {
4437 PyObject *__pyx_r = NULL;
4438 __Pyx_RefNannyDeclarations
4439 PyObject *__pyx_t_1 = NULL;
4440 int __pyx_lineno = 0;
4441 const char *__pyx_filename = NULL;
4442 int __pyx_clineno = 0;
4443 __Pyx_RefNannySetupContext(
"PyArray_MultiIterNew5", 0);
4452 __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, 807, __pyx_L1_error)
4453 __Pyx_GOTREF(__pyx_t_1);
4455 PyObject *__pyx_temp;
4457 __pyx_temp = __pyx_r;
4458 __pyx_r = __pyx_t_1;
4460 __Pyx_XDECREF(__pyx_temp);
4475 __Pyx_XDECREF(__pyx_t_1);
4476 __Pyx_AddTraceback(
"numpy.PyArray_MultiIterNew5", __pyx_clineno, __pyx_lineno, __pyx_filename);
4479 __Pyx_XGIVEREF(__pyx_r);
4480 __Pyx_RefNannyFinishContext();
4492static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyDataType_SHAPE(PyArray_Descr *__pyx_v_d) {
4493 PyObject *__pyx_r = NULL;
4494 __Pyx_RefNannyDeclarations
4496 PyObject *__pyx_t_2;
4497 __Pyx_RefNannySetupContext(
"PyDataType_SHAPE", 0);
4506 __pyx_t_1 = PyDataType_HASSUBARRAY(__pyx_v_d);
4518 __pyx_t_2 = __pyx_f_5numpy_5dtype_8subarray___get__(__pyx_v_d)->shape;
4521 PyObject *__pyx_temp;
4523 __pyx_temp = __pyx_r;
4524 __Pyx_INCREF(((PyObject*)__pyx_t_2));
4525 __pyx_r = ((PyObject*)__pyx_t_2);
4527 __Pyx_XDECREF(__pyx_temp);
4550 PyObject *__pyx_temp;
4552 __pyx_temp = __pyx_r;
4553 __Pyx_INCREF(__pyx_mstate_global->__pyx_empty_tuple);
4554 __pyx_r = __pyx_mstate_global->__pyx_empty_tuple;
4556 __Pyx_XDECREF(__pyx_temp);
4571 __Pyx_XGIVEREF(__pyx_r);
4572 __Pyx_RefNannyFinishContext();
4584static CYTHON_INLINE
int __pyx_f_5numpy_5ufunc_3nin___get__(PyUFuncObject *__pyx_v_self) {
4596 __pyx_r = _PyUFuncObject_GET_ITEM_DATA(__pyx_v_self)->nin;
4621static CYTHON_INLINE
int __pyx_f_5numpy_5ufunc_4nout___get__(PyUFuncObject *__pyx_v_self) {
4633 __pyx_r = _PyUFuncObject_GET_ITEM_DATA(__pyx_v_self)->nout;
4658static CYTHON_INLINE
int __pyx_f_5numpy_5ufunc_5nargs___get__(PyUFuncObject *__pyx_v_self) {
4670 __pyx_r = _PyUFuncObject_GET_ITEM_DATA(__pyx_v_self)->nargs;
4695static CYTHON_INLINE PyUFuncGenericFunction *__pyx_f_5numpy_5ufunc_9functions___get__(PyUFuncObject *__pyx_v_self) {
4696 PyUFuncGenericFunction *__pyx_r;
4707 __pyx_r = _PyUFuncObject_GET_ITEM_DATA(__pyx_v_self)->functions;
4732static CYTHON_INLINE
void **__pyx_f_5numpy_5ufunc_4data___get__(PyUFuncObject *__pyx_v_self) {
4744 __pyx_r = ((
void **)_PyUFuncObject_GET_ITEM_DATA(__pyx_v_self)->data);
4769static CYTHON_INLINE
int __pyx_f_5numpy_5ufunc_6ntypes___get__(PyUFuncObject *__pyx_v_self) {
4781 __pyx_r = _PyUFuncObject_GET_ITEM_DATA(__pyx_v_self)->ntypes;
4806static CYTHON_INLINE
char const *__pyx_f_5numpy_5ufunc_4name___get__(PyUFuncObject *__pyx_v_self) {
4807 char const *__pyx_r;
4818 __pyx_r = _PyUFuncObject_GET_ITEM_DATA(__pyx_v_self)->name;
4843static CYTHON_INLINE
char const *__pyx_f_5numpy_5ufunc_3doc___get__(PyUFuncObject *__pyx_v_self) {
4844 char const *__pyx_r;
4855 __pyx_r = _PyUFuncObject_GET_ITEM_DATA(__pyx_v_self)->doc;
4880static CYTHON_INLINE
void *__pyx_f_5numpy_5ufunc_3ptr___get__(PyUFuncObject *__pyx_v_self) {
4892 __pyx_r = _PyUFuncObject_GET_ITEM_DATA(__pyx_v_self)->ptr;
4917static CYTHON_INLINE PyObject *__pyx_f_5numpy_5ufunc_3obj___get__(PyUFuncObject *__pyx_v_self) {
4929 __pyx_r = _PyUFuncObject_GET_ITEM_DATA(__pyx_v_self)->obj;
4954static CYTHON_INLINE PyObject *__pyx_f_5numpy_5ufunc_9userloops___get__(PyUFuncObject *__pyx_v_self) {
4966 __pyx_r = _PyUFuncObject_GET_ITEM_DATA(__pyx_v_self)->userloops;
4991static CYTHON_INLINE
void __pyx_f_5numpy_set_array_base(PyArrayObject *__pyx_v_arr, PyObject *__pyx_v_base) {
4993 int __pyx_lineno = 0;
4994 const char *__pyx_filename = NULL;
4995 int __pyx_clineno = 0;
5004 Py_INCREF(__pyx_v_base);
5013 __pyx_t_1 = PyArray_SetBaseObject(__pyx_v_arr, __pyx_v_base);
if (unlikely(__pyx_t_1 == ((
int)-1))) __PYX_ERR(1, 1067, __pyx_L1_error)
5027 __Pyx_AddTraceback(
"numpy.set_array_base", __pyx_clineno, __pyx_lineno, __pyx_filename);
5040static CYTHON_INLINE PyObject *__pyx_f_5numpy_get_array_base(PyArrayObject *__pyx_v_arr) {
5041 PyObject *__pyx_v_base;
5042 PyObject *__pyx_r = NULL;
5043 __Pyx_RefNannyDeclarations
5045 __Pyx_RefNannySetupContext(
"get_array_base", 0);
5054 __pyx_v_base = PyArray_BASE(__pyx_v_arr);
5063 __pyx_t_1 = (__pyx_v_base == NULL);
5076 PyObject *__pyx_temp;
5078 __pyx_temp = __pyx_r;
5079 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
5081 __Pyx_XDECREF(__pyx_temp);
5102 PyObject *__pyx_temp;
5104 __pyx_temp = __pyx_r;
5105 __Pyx_INCREF(((PyObject *)__pyx_v_base));
5106 __pyx_r = ((PyObject *)__pyx_v_base);
5108 __Pyx_XDECREF(__pyx_temp);
5123 __Pyx_XGIVEREF(__pyx_r);
5124 __Pyx_RefNannyFinishContext();
5136static CYTHON_INLINE
int __pyx_f_5numpy_import_array(
void) {
5138 __Pyx_RefNannyDeclarations
5139 PyObject *__pyx_t_1 = NULL;
5140 PyObject *__pyx_t_2 = NULL;
5141 PyObject *__pyx_t_3 = NULL;
5143 PyObject *__pyx_t_5 = NULL;
5144 PyObject *__pyx_t_6 = NULL;
5145 PyObject *__pyx_t_7 = NULL;
5146 PyObject *__pyx_t_8 = NULL;
5147 PyObject *__pyx_t_9 = NULL;
5149 int __pyx_lineno = 0;
5150 const char *__pyx_filename = NULL;
5151 int __pyx_clineno = 0;
5152 __Pyx_RefNannySetupContext(
"import_array", 0);
5162 __Pyx_PyThreadState_declare
5163 __Pyx_PyThreadState_assign
5164 __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
5165 __Pyx_XGOTREF(__pyx_t_1);
5166 __Pyx_XGOTREF(__pyx_t_2);
5167 __Pyx_XGOTREF(__pyx_t_3);
5177 __pyx_t_4 = _import_array();
if (unlikely(__pyx_t_4 == ((
int)-1))) __PYX_ERR(1, 1079, __pyx_L3_error)
5188 __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
5189 __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
5190 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
5191 goto __pyx_L8_try_end;
5201 __pyx_t_4 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(((PyTypeObject*)PyExc_Exception))));
5203 __Pyx_AddTraceback(
"numpy.import_array", __pyx_clineno, __pyx_lineno, __pyx_filename);
5204 if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(1, 1080, __pyx_L5_except_error)
5205 __Pyx_XGOTREF(__pyx_t_5);
5206 __Pyx_XGOTREF(__pyx_t_6);
5207 __Pyx_XGOTREF(__pyx_t_7);
5219 PyObject *__pyx_callargs[2] = {__pyx_t_9, __pyx_mstate_global->__pyx_kp_u_numpy__core_multiarray_failed_to};
5220 __pyx_t_8 = __Pyx_PyObject_FastCall((PyObject*)(((PyTypeObject*)PyExc_ImportError)), __pyx_callargs+__pyx_t_10, (2-__pyx_t_10) | (__pyx_t_10*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
5221 __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
5222 if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 1081, __pyx_L5_except_error)
5223 __Pyx_GOTREF(__pyx_t_8);
5225 __Pyx_Raise(__pyx_t_8, 0, 0, 0);
5226 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
5227 __PYX_ERR(1, 1081, __pyx_L5_except_error)
5229 goto __pyx_L5_except_error;
5238 __pyx_L5_except_error:;
5239 __Pyx_XGIVEREF(__pyx_t_1);
5240 __Pyx_XGIVEREF(__pyx_t_2);
5241 __Pyx_XGIVEREF(__pyx_t_3);
5242 __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
5243 goto __pyx_L1_error;
5259 __Pyx_XDECREF(__pyx_t_5);
5260 __Pyx_XDECREF(__pyx_t_6);
5261 __Pyx_XDECREF(__pyx_t_7);
5262 __Pyx_XDECREF(__pyx_t_8);
5263 __Pyx_XDECREF(__pyx_t_9);
5264 __Pyx_AddTraceback(
"numpy.import_array", __pyx_clineno, __pyx_lineno, __pyx_filename);
5268 __Pyx_RefNannyFinishContext();
5280static CYTHON_INLINE
int __pyx_f_5numpy_import_umath(
void) {
5282 __Pyx_RefNannyDeclarations
5283 PyObject *__pyx_t_1 = NULL;
5284 PyObject *__pyx_t_2 = NULL;
5285 PyObject *__pyx_t_3 = NULL;
5287 PyObject *__pyx_t_5 = NULL;
5288 PyObject *__pyx_t_6 = NULL;
5289 PyObject *__pyx_t_7 = NULL;
5290 PyObject *__pyx_t_8 = NULL;
5291 PyObject *__pyx_t_9 = NULL;
5293 int __pyx_lineno = 0;
5294 const char *__pyx_filename = NULL;
5295 int __pyx_clineno = 0;
5296 __Pyx_RefNannySetupContext(
"import_umath", 0);
5306 __Pyx_PyThreadState_declare
5307 __Pyx_PyThreadState_assign
5308 __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
5309 __Pyx_XGOTREF(__pyx_t_1);
5310 __Pyx_XGOTREF(__pyx_t_2);
5311 __Pyx_XGOTREF(__pyx_t_3);
5321 __pyx_t_4 = _import_umath();
if (unlikely(__pyx_t_4 == ((
int)-1))) __PYX_ERR(1, 1085, __pyx_L3_error)
5332 __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
5333 __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
5334 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
5335 goto __pyx_L8_try_end;
5345 __pyx_t_4 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(((PyTypeObject*)PyExc_Exception))));
5347 __Pyx_AddTraceback(
"numpy.import_umath", __pyx_clineno, __pyx_lineno, __pyx_filename);
5348 if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(1, 1086, __pyx_L5_except_error)
5349 __Pyx_XGOTREF(__pyx_t_5);
5350 __Pyx_XGOTREF(__pyx_t_6);
5351 __Pyx_XGOTREF(__pyx_t_7);
5363 PyObject *__pyx_callargs[2] = {__pyx_t_9, __pyx_mstate_global->__pyx_kp_u_numpy__core_umath_failed_to_impo};
5364 __pyx_t_8 = __Pyx_PyObject_FastCall((PyObject*)(((PyTypeObject*)PyExc_ImportError)), __pyx_callargs+__pyx_t_10, (2-__pyx_t_10) | (__pyx_t_10*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
5365 __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
5366 if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 1087, __pyx_L5_except_error)
5367 __Pyx_GOTREF(__pyx_t_8);
5369 __Pyx_Raise(__pyx_t_8, 0, 0, 0);
5370 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
5371 __PYX_ERR(1, 1087, __pyx_L5_except_error)
5373 goto __pyx_L5_except_error;
5382 __pyx_L5_except_error:;
5383 __Pyx_XGIVEREF(__pyx_t_1);
5384 __Pyx_XGIVEREF(__pyx_t_2);
5385 __Pyx_XGIVEREF(__pyx_t_3);
5386 __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
5387 goto __pyx_L1_error;
5403 __Pyx_XDECREF(__pyx_t_5);
5404 __Pyx_XDECREF(__pyx_t_6);
5405 __Pyx_XDECREF(__pyx_t_7);
5406 __Pyx_XDECREF(__pyx_t_8);
5407 __Pyx_XDECREF(__pyx_t_9);
5408 __Pyx_AddTraceback(
"numpy.import_umath", __pyx_clineno, __pyx_lineno, __pyx_filename);
5412 __Pyx_RefNannyFinishContext();
5424static CYTHON_INLINE
int __pyx_f_5numpy_import_ufunc(
void) {
5426 __Pyx_RefNannyDeclarations
5427 PyObject *__pyx_t_1 = NULL;
5428 PyObject *__pyx_t_2 = NULL;
5429 PyObject *__pyx_t_3 = NULL;
5431 PyObject *__pyx_t_5 = NULL;
5432 PyObject *__pyx_t_6 = NULL;
5433 PyObject *__pyx_t_7 = NULL;
5434 PyObject *__pyx_t_8 = NULL;
5435 PyObject *__pyx_t_9 = NULL;
5437 int __pyx_lineno = 0;
5438 const char *__pyx_filename = NULL;
5439 int __pyx_clineno = 0;
5440 __Pyx_RefNannySetupContext(
"import_ufunc", 0);
5450 __Pyx_PyThreadState_declare
5451 __Pyx_PyThreadState_assign
5452 __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
5453 __Pyx_XGOTREF(__pyx_t_1);
5454 __Pyx_XGOTREF(__pyx_t_2);
5455 __Pyx_XGOTREF(__pyx_t_3);
5465 __pyx_t_4 = _import_umath();
if (unlikely(__pyx_t_4 == ((
int)-1))) __PYX_ERR(1, 1091, __pyx_L3_error)
5476 __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
5477 __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
5478 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
5479 goto __pyx_L8_try_end;
5489 __pyx_t_4 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(((PyTypeObject*)PyExc_Exception))));
5491 __Pyx_AddTraceback(
"numpy.import_ufunc", __pyx_clineno, __pyx_lineno, __pyx_filename);
5492 if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(1, 1092, __pyx_L5_except_error)
5493 __Pyx_XGOTREF(__pyx_t_5);
5494 __Pyx_XGOTREF(__pyx_t_6);
5495 __Pyx_XGOTREF(__pyx_t_7);
5507 PyObject *__pyx_callargs[2] = {__pyx_t_9, __pyx_mstate_global->__pyx_kp_u_numpy__core_umath_failed_to_impo};
5508 __pyx_t_8 = __Pyx_PyObject_FastCall((PyObject*)(((PyTypeObject*)PyExc_ImportError)), __pyx_callargs+__pyx_t_10, (2-__pyx_t_10) | (__pyx_t_10*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
5509 __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
5510 if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 1093, __pyx_L5_except_error)
5511 __Pyx_GOTREF(__pyx_t_8);
5513 __Pyx_Raise(__pyx_t_8, 0, 0, 0);
5514 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
5515 __PYX_ERR(1, 1093, __pyx_L5_except_error)
5517 goto __pyx_L5_except_error;
5526 __pyx_L5_except_error:;
5527 __Pyx_XGIVEREF(__pyx_t_1);
5528 __Pyx_XGIVEREF(__pyx_t_2);
5529 __Pyx_XGIVEREF(__pyx_t_3);
5530 __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
5531 goto __pyx_L1_error;
5547 __Pyx_XDECREF(__pyx_t_5);
5548 __Pyx_XDECREF(__pyx_t_6);
5549 __Pyx_XDECREF(__pyx_t_7);
5550 __Pyx_XDECREF(__pyx_t_8);
5551 __Pyx_XDECREF(__pyx_t_9);
5552 __Pyx_AddTraceback(
"numpy.import_ufunc", __pyx_clineno, __pyx_lineno, __pyx_filename);
5556 __Pyx_RefNannyFinishContext();
5568static CYTHON_INLINE
int __pyx_f_5numpy_is_timedelta64_object(PyObject *__pyx_v_obj) {
5580 __pyx_r = PyObject_TypeCheck(__pyx_v_obj, (&PyTimedeltaArrType_Type));
5606static CYTHON_INLINE
int __pyx_f_5numpy_is_datetime64_object(PyObject *__pyx_v_obj) {
5618 __pyx_r = PyObject_TypeCheck(__pyx_v_obj, (&PyDatetimeArrType_Type));
5644static CYTHON_INLINE npy_datetime __pyx_f_5numpy_get_datetime64_value(PyObject *__pyx_v_obj) {
5645 npy_datetime __pyx_r;
5656 __pyx_r = _PyDatetimeScalarObject_GetValue(__pyx_v_obj);
5681static CYTHON_INLINE npy_timedelta __pyx_f_5numpy_get_timedelta64_value(PyObject *__pyx_v_obj) {
5682 npy_timedelta __pyx_r;
5693 __pyx_r = _PyTimedeltaScalarObject_GetValue(__pyx_v_obj);
5718static CYTHON_INLINE NPY_DATETIMEUNIT __pyx_f_5numpy_get_datetime64_unit(PyObject *__pyx_v_obj) {
5719 NPY_DATETIMEUNIT __pyx_r;
5730 __pyx_r = _PyDatetimeScalarObject_GetMetadata(__pyx_v_obj).base;
5756static PyObject *__pyx_pw_32cSubsurfaceTransportCoefficients_1calculateRusanovFluxSaturationEquationIncomp_PWC(PyObject *__pyx_self,
5757#
if CYTHON_VECTORCALL
5758PyObject *
const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
5760PyObject *__pyx_args, PyObject *__pyx_kwds
5763static PyMethodDef __pyx_mdef_32cSubsurfaceTransportCoefficients_1calculateRusanovFluxSaturationEquationIncomp_PWC = {
"calculateRusanovFluxSaturationEquationIncomp_PWC", (PyCFunction)(
void(*)(
void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_32cSubsurfaceTransportCoefficients_1calculateRusanovFluxSaturationEquationIncomp_PWC, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
5764static PyObject *__pyx_pw_32cSubsurfaceTransportCoefficients_1calculateRusanovFluxSaturationEquationIncomp_PWC(PyObject *__pyx_self,
5765#
if CYTHON_VECTORCALL
5766PyObject *
const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
5768PyObject *__pyx_args, PyObject *__pyx_kwds
5771 double __pyx_v_safetyFactor;
5773 int __pyx_v_pskModelFlag;
5774 int __pyx_v_nParams;
5775 PyArrayObject *__pyx_v_rowptr = 0;
5776 PyArrayObject *__pyx_v_colind = 0;
5777 PyArrayObject *__pyx_v_materialTypes = 0;
5780 PyArrayObject *__pyx_v_omega = 0;
5781 PyArrayObject *__pyx_v_Kbar = 0;
5783 PyArrayObject *__pyx_v_rwork_psk = 0;
5784 PyArrayObject *__pyx_v_rwork_psk_tol = 0;
5785 PyArrayObject *__pyx_v_rwork_density_w = 0;
5786 PyArrayObject *__pyx_v_rwork_density_n = 0;
5787 PyArrayObject *__pyx_v_g = 0;
5788 PyArrayObject *__pyx_v_ebq_global_qt = 0;
5789 PyArrayObject *__pyx_v_q_lambda_bar = 0;
5790 int __pyx_v_nElements_global;
5791 int __pyx_v_nElementBoundaries_element;
5792 int __pyx_v_nInteriorElementBoundaries_global;
5793 int __pyx_v_nExteriorElementBoundaries_global;
5794 int __pyx_v_nQuadraturePoints_element;
5795 int __pyx_v_nQuadraturePoints_elementBoundary;
5796 PyArrayObject *__pyx_v_interiorElementBoundaries = 0;
5797 PyArrayObject *__pyx_v_exteriorElementBoundaries = 0;
5798 PyArrayObject *__pyx_v_elementBoundaryElements = 0;
5799 PyArrayObject *__pyx_v_elementBoundaryLocalElementBoundaries = 0;
5800 PyArrayObject *__pyx_v_n = 0;
5801 PyArrayObject *__pyx_v_q_u = 0;
5802 PyArrayObject *__pyx_v_q_dV = 0;
5803 PyArrayObject *__pyx_v_isDOFBoundary = 0;
5804 PyArrayObject *__pyx_v_bc_u = 0;
5805 PyArrayObject *__pyx_v_flux = 0;
5806 #if !CYTHON_VECTORCALL
5807 CYTHON_UNUSED Py_ssize_t __pyx_nargs;
5809 CYTHON_UNUSED PyObject *
const *__pyx_kwvalues;
5810 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};
5811 int __pyx_lineno = 0;
5812 const char *__pyx_filename = NULL;
5813 int __pyx_clineno = 0;
5814 PyObject *__pyx_r = 0;
5815 __Pyx_RefNannyDeclarations
5816 __Pyx_RefNannySetupContext(
"calculateRusanovFluxSaturationEquationIncomp_PWC (wrapper)", 0);
5817 #if !CYTHON_VECTORCALL
5818 #if CYTHON_ASSUME_SAFE_SIZE
5819 __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
5821 __pyx_nargs = PyTuple_Size(__pyx_args);
if (unlikely(__pyx_nargs < 0))
return NULL;
5824 __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
5826 PyObject **
const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_safetyFactor,&__pyx_mstate_global->__pyx_n_u_nSpace,&__pyx_mstate_global->__pyx_n_u_pskModelFlag,&__pyx_mstate_global->__pyx_n_u_nParams,&__pyx_mstate_global->__pyx_n_u_rowptr,&__pyx_mstate_global->__pyx_n_u_colind,&__pyx_mstate_global->__pyx_n_u_materialTypes,&__pyx_mstate_global->__pyx_n_u_muw,&__pyx_mstate_global->__pyx_n_u_mun,&__pyx_mstate_global->__pyx_n_u_omega,&__pyx_mstate_global->__pyx_n_u_Kbar,&__pyx_mstate_global->__pyx_n_u_b,&__pyx_mstate_global->__pyx_n_u_rwork_psk,&__pyx_mstate_global->__pyx_n_u_rwork_psk_tol,&__pyx_mstate_global->__pyx_n_u_rwork_density_w,&__pyx_mstate_global->__pyx_n_u_rwork_density_n,&__pyx_mstate_global->__pyx_n_u_g,&__pyx_mstate_global->__pyx_n_u_ebq_global_qt,&__pyx_mstate_global->__pyx_n_u_q_lambda_bar,&__pyx_mstate_global->__pyx_n_u_nElements_global,&__pyx_mstate_global->__pyx_n_u_nElementBoundaries_element,&__pyx_mstate_global->__pyx_n_u_nInteriorElementBoundaries_globa,&__pyx_mstate_global->__pyx_n_u_nExteriorElementBoundaries_globa,&__pyx_mstate_global->__pyx_n_u_nQuadraturePoints_element,&__pyx_mstate_global->__pyx_n_u_nQuadraturePoints_elementBoundar,&__pyx_mstate_global->__pyx_n_u_interiorElementBoundaries,&__pyx_mstate_global->__pyx_n_u_exteriorElementBoundaries,&__pyx_mstate_global->__pyx_n_u_elementBoundaryElements,&__pyx_mstate_global->__pyx_n_u_elementBoundaryLocalElementBound,&__pyx_mstate_global->__pyx_n_u_n,&__pyx_mstate_global->__pyx_n_u_q_u,&__pyx_mstate_global->__pyx_n_u_q_dV,&__pyx_mstate_global->__pyx_n_u_isDOFBoundary,&__pyx_mstate_global->__pyx_n_u_bc_u,&__pyx_mstate_global->__pyx_n_u_flux,0};
5827 const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
5828 if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(0, 7, __pyx_L3_error)
5829 if (__pyx_kwds_len > 0) {
5830 switch (__pyx_nargs) {
5832 values[34] = __Pyx_ArgRef_FASTCALL(__pyx_args, 34);
5833 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[34])) __PYX_ERR(0, 7, __pyx_L3_error)
5836 values[33] = __Pyx_ArgRef_FASTCALL(__pyx_args, 33);
5837 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[33])) __PYX_ERR(0, 7, __pyx_L3_error)
5840 values[32] = __Pyx_ArgRef_FASTCALL(__pyx_args, 32);
5841 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[32])) __PYX_ERR(0, 7, __pyx_L3_error)
5844 values[31] = __Pyx_ArgRef_FASTCALL(__pyx_args, 31);
5845 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[31])) __PYX_ERR(0, 7, __pyx_L3_error)
5848 values[30] = __Pyx_ArgRef_FASTCALL(__pyx_args, 30);
5849 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[30])) __PYX_ERR(0, 7, __pyx_L3_error)
5852 values[29] = __Pyx_ArgRef_FASTCALL(__pyx_args, 29);
5853 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[29])) __PYX_ERR(0, 7, __pyx_L3_error)
5856 values[28] = __Pyx_ArgRef_FASTCALL(__pyx_args, 28);
5857 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[28])) __PYX_ERR(0, 7, __pyx_L3_error)
5860 values[27] = __Pyx_ArgRef_FASTCALL(__pyx_args, 27);
5861 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[27])) __PYX_ERR(0, 7, __pyx_L3_error)
5864 values[26] = __Pyx_ArgRef_FASTCALL(__pyx_args, 26);
5865 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[26])) __PYX_ERR(0, 7, __pyx_L3_error)
5868 values[25] = __Pyx_ArgRef_FASTCALL(__pyx_args, 25);
5869 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[25])) __PYX_ERR(0, 7, __pyx_L3_error)
5872 values[24] = __Pyx_ArgRef_FASTCALL(__pyx_args, 24);
5873 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[24])) __PYX_ERR(0, 7, __pyx_L3_error)
5876 values[23] = __Pyx_ArgRef_FASTCALL(__pyx_args, 23);
5877 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[23])) __PYX_ERR(0, 7, __pyx_L3_error)
5880 values[22] = __Pyx_ArgRef_FASTCALL(__pyx_args, 22);
5881 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[22])) __PYX_ERR(0, 7, __pyx_L3_error)
5884 values[21] = __Pyx_ArgRef_FASTCALL(__pyx_args, 21);
5885 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[21])) __PYX_ERR(0, 7, __pyx_L3_error)
5888 values[20] = __Pyx_ArgRef_FASTCALL(__pyx_args, 20);
5889 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[20])) __PYX_ERR(0, 7, __pyx_L3_error)
5892 values[19] = __Pyx_ArgRef_FASTCALL(__pyx_args, 19);
5893 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[19])) __PYX_ERR(0, 7, __pyx_L3_error)
5896 values[18] = __Pyx_ArgRef_FASTCALL(__pyx_args, 18);
5897 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[18])) __PYX_ERR(0, 7, __pyx_L3_error)
5900 values[17] = __Pyx_ArgRef_FASTCALL(__pyx_args, 17);
5901 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[17])) __PYX_ERR(0, 7, __pyx_L3_error)
5904 values[16] = __Pyx_ArgRef_FASTCALL(__pyx_args, 16);
5905 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[16])) __PYX_ERR(0, 7, __pyx_L3_error)
5908 values[15] = __Pyx_ArgRef_FASTCALL(__pyx_args, 15);
5909 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[15])) __PYX_ERR(0, 7, __pyx_L3_error)
5912 values[14] = __Pyx_ArgRef_FASTCALL(__pyx_args, 14);
5913 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[14])) __PYX_ERR(0, 7, __pyx_L3_error)
5916 values[13] = __Pyx_ArgRef_FASTCALL(__pyx_args, 13);
5917 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[13])) __PYX_ERR(0, 7, __pyx_L3_error)
5920 values[12] = __Pyx_ArgRef_FASTCALL(__pyx_args, 12);
5921 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[12])) __PYX_ERR(0, 7, __pyx_L3_error)
5924 values[11] = __Pyx_ArgRef_FASTCALL(__pyx_args, 11);
5925 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[11])) __PYX_ERR(0, 7, __pyx_L3_error)
5928 values[10] = __Pyx_ArgRef_FASTCALL(__pyx_args, 10);
5929 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[10])) __PYX_ERR(0, 7, __pyx_L3_error)
5932 values[9] = __Pyx_ArgRef_FASTCALL(__pyx_args, 9);
5933 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[9])) __PYX_ERR(0, 7, __pyx_L3_error)
5936 values[8] = __Pyx_ArgRef_FASTCALL(__pyx_args, 8);
5937 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[8])) __PYX_ERR(0, 7, __pyx_L3_error)
5940 values[7] = __Pyx_ArgRef_FASTCALL(__pyx_args, 7);
5941 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[7])) __PYX_ERR(0, 7, __pyx_L3_error)
5944 values[6] = __Pyx_ArgRef_FASTCALL(__pyx_args, 6);
5945 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[6])) __PYX_ERR(0, 7, __pyx_L3_error)
5948 values[5] = __Pyx_ArgRef_FASTCALL(__pyx_args, 5);
5949 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[5])) __PYX_ERR(0, 7, __pyx_L3_error)
5952 values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
5953 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 7, __pyx_L3_error)
5956 values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
5957 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 7, __pyx_L3_error)
5960 values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
5961 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 7, __pyx_L3_error)
5964 values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
5965 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 7, __pyx_L3_error)
5968 values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
5969 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 7, __pyx_L3_error)
5972 default:
goto __pyx_L5_argtuple_error;
5974 const Py_ssize_t kwd_pos_args = __pyx_nargs;
5975 if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len,
"calculateRusanovFluxSaturationEquationIncomp_PWC", 0) < (0)) __PYX_ERR(0, 7, __pyx_L3_error)
5976 for (Py_ssize_t i = __pyx_nargs; i < 35; i++) {
5977 if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid(
"calculateRusanovFluxSaturationEquationIncomp_PWC", 1, 35, 35, i); __PYX_ERR(0, 7, __pyx_L3_error) }
5979 }
else if (unlikely(__pyx_nargs != 35)) {
5980 goto __pyx_L5_argtuple_error;
5982 values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
5983 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 7, __pyx_L3_error)
5984 values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
5985 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 7, __pyx_L3_error)
5986 values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
5987 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 7, __pyx_L3_error)
5988 values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
5989 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 7, __pyx_L3_error)
5990 values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
5991 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 7, __pyx_L3_error)
5992 values[5] = __Pyx_ArgRef_FASTCALL(__pyx_args, 5);
5993 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[5])) __PYX_ERR(0, 7, __pyx_L3_error)
5994 values[6] = __Pyx_ArgRef_FASTCALL(__pyx_args, 6);
5995 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[6])) __PYX_ERR(0, 7, __pyx_L3_error)
5996 values[7] = __Pyx_ArgRef_FASTCALL(__pyx_args, 7);
5997 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[7])) __PYX_ERR(0, 7, __pyx_L3_error)
5998 values[8] = __Pyx_ArgRef_FASTCALL(__pyx_args, 8);
5999 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[8])) __PYX_ERR(0, 7, __pyx_L3_error)
6000 values[9] = __Pyx_ArgRef_FASTCALL(__pyx_args, 9);
6001 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[9])) __PYX_ERR(0, 7, __pyx_L3_error)
6002 values[10] = __Pyx_ArgRef_FASTCALL(__pyx_args, 10);
6003 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[10])) __PYX_ERR(0, 7, __pyx_L3_error)
6004 values[11] = __Pyx_ArgRef_FASTCALL(__pyx_args, 11);
6005 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[11])) __PYX_ERR(0, 7, __pyx_L3_error)
6006 values[12] = __Pyx_ArgRef_FASTCALL(__pyx_args, 12);
6007 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[12])) __PYX_ERR(0, 7, __pyx_L3_error)
6008 values[13] = __Pyx_ArgRef_FASTCALL(__pyx_args, 13);
6009 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[13])) __PYX_ERR(0, 7, __pyx_L3_error)
6010 values[14] = __Pyx_ArgRef_FASTCALL(__pyx_args, 14);
6011 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[14])) __PYX_ERR(0, 7, __pyx_L3_error)
6012 values[15] = __Pyx_ArgRef_FASTCALL(__pyx_args, 15);
6013 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[15])) __PYX_ERR(0, 7, __pyx_L3_error)
6014 values[16] = __Pyx_ArgRef_FASTCALL(__pyx_args, 16);
6015 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[16])) __PYX_ERR(0, 7, __pyx_L3_error)
6016 values[17] = __Pyx_ArgRef_FASTCALL(__pyx_args, 17);
6017 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[17])) __PYX_ERR(0, 7, __pyx_L3_error)
6018 values[18] = __Pyx_ArgRef_FASTCALL(__pyx_args, 18);
6019 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[18])) __PYX_ERR(0, 7, __pyx_L3_error)
6020 values[19] = __Pyx_ArgRef_FASTCALL(__pyx_args, 19);
6021 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[19])) __PYX_ERR(0, 7, __pyx_L3_error)
6022 values[20] = __Pyx_ArgRef_FASTCALL(__pyx_args, 20);
6023 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[20])) __PYX_ERR(0, 7, __pyx_L3_error)
6024 values[21] = __Pyx_ArgRef_FASTCALL(__pyx_args, 21);
6025 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[21])) __PYX_ERR(0, 7, __pyx_L3_error)
6026 values[22] = __Pyx_ArgRef_FASTCALL(__pyx_args, 22);
6027 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[22])) __PYX_ERR(0, 7, __pyx_L3_error)
6028 values[23] = __Pyx_ArgRef_FASTCALL(__pyx_args, 23);
6029 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[23])) __PYX_ERR(0, 7, __pyx_L3_error)
6030 values[24] = __Pyx_ArgRef_FASTCALL(__pyx_args, 24);
6031 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[24])) __PYX_ERR(0, 7, __pyx_L3_error)
6032 values[25] = __Pyx_ArgRef_FASTCALL(__pyx_args, 25);
6033 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[25])) __PYX_ERR(0, 7, __pyx_L3_error)
6034 values[26] = __Pyx_ArgRef_FASTCALL(__pyx_args, 26);
6035 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[26])) __PYX_ERR(0, 7, __pyx_L3_error)
6036 values[27] = __Pyx_ArgRef_FASTCALL(__pyx_args, 27);
6037 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[27])) __PYX_ERR(0, 7, __pyx_L3_error)
6038 values[28] = __Pyx_ArgRef_FASTCALL(__pyx_args, 28);
6039 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[28])) __PYX_ERR(0, 7, __pyx_L3_error)
6040 values[29] = __Pyx_ArgRef_FASTCALL(__pyx_args, 29);
6041 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[29])) __PYX_ERR(0, 7, __pyx_L3_error)
6042 values[30] = __Pyx_ArgRef_FASTCALL(__pyx_args, 30);
6043 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[30])) __PYX_ERR(0, 7, __pyx_L3_error)
6044 values[31] = __Pyx_ArgRef_FASTCALL(__pyx_args, 31);
6045 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[31])) __PYX_ERR(0, 7, __pyx_L3_error)
6046 values[32] = __Pyx_ArgRef_FASTCALL(__pyx_args, 32);
6047 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[32])) __PYX_ERR(0, 7, __pyx_L3_error)
6048 values[33] = __Pyx_ArgRef_FASTCALL(__pyx_args, 33);
6049 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[33])) __PYX_ERR(0, 7, __pyx_L3_error)
6050 values[34] = __Pyx_ArgRef_FASTCALL(__pyx_args, 34);
6051 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[34])) __PYX_ERR(0, 7, __pyx_L3_error)
6053 __pyx_v_safetyFactor = __Pyx_PyFloat_AsDouble(values[0]);
if (unlikely((__pyx_v_safetyFactor == (
double)-1) && PyErr_Occurred())) __PYX_ERR(0, 8, __pyx_L3_error)
6054 __pyx_v_nSpace = __Pyx_PyLong_As_int(values[1]);
if (unlikely((__pyx_v_nSpace == (
int)-1) && PyErr_Occurred())) __PYX_ERR(0, 9, __pyx_L3_error)
6055 __pyx_v_pskModelFlag = __Pyx_PyLong_As_int(values[2]);
if (unlikely((__pyx_v_pskModelFlag == (
int)-1) && PyErr_Occurred())) __PYX_ERR(0, 10, __pyx_L3_error)
6056 __pyx_v_nParams = __Pyx_PyLong_As_int(values[3]);
if (unlikely((__pyx_v_nParams == (
int)-1) && PyErr_Occurred())) __PYX_ERR(0, 11, __pyx_L3_error)
6057 __pyx_v_rowptr = ((PyArrayObject *)values[4]);
6058 __pyx_v_colind = ((PyArrayObject *)values[5]);
6059 __pyx_v_materialTypes = ((PyArrayObject *)values[6]);
6060 __pyx_v_muw = __Pyx_PyFloat_AsDouble(values[7]);
if (unlikely((__pyx_v_muw == (
double)-1) && PyErr_Occurred())) __PYX_ERR(0, 15, __pyx_L3_error)
6061 __pyx_v_mun = __Pyx_PyFloat_AsDouble(values[8]);
if (unlikely((__pyx_v_mun == (
double)-1) && PyErr_Occurred())) __PYX_ERR(0, 16, __pyx_L3_error)
6062 __pyx_v_omega = ((PyArrayObject *)values[9]);
6063 __pyx_v_Kbar = ((PyArrayObject *)values[10]);
6064 __pyx_v_b = __Pyx_PyFloat_AsDouble(values[11]);
if (unlikely((__pyx_v_b == (
double)-1) && PyErr_Occurred())) __PYX_ERR(0, 19, __pyx_L3_error)
6065 __pyx_v_rwork_psk = ((PyArrayObject *)values[12]);
6066 __pyx_v_rwork_psk_tol = ((PyArrayObject *)values[13]);
6067 __pyx_v_rwork_density_w = ((PyArrayObject *)values[14]);
6068 __pyx_v_rwork_density_n = ((PyArrayObject *)values[15]);
6069 __pyx_v_g = ((PyArrayObject *)values[16]);
6070 __pyx_v_ebq_global_qt = ((PyArrayObject *)values[17]);
6071 __pyx_v_q_lambda_bar = ((PyArrayObject *)values[18]);
6072 __pyx_v_nElements_global = __Pyx_PyLong_As_int(values[19]);
if (unlikely((__pyx_v_nElements_global == (
int)-1) && PyErr_Occurred())) __PYX_ERR(0, 27, __pyx_L3_error)
6073 __pyx_v_nElementBoundaries_element = __Pyx_PyLong_As_int(values[20]);
if (unlikely((__pyx_v_nElementBoundaries_element == (
int)-1) && PyErr_Occurred())) __PYX_ERR(0, 28, __pyx_L3_error)
6074 __pyx_v_nInteriorElementBoundaries_global = __Pyx_PyLong_As_int(values[21]);
if (unlikely((__pyx_v_nInteriorElementBoundaries_global == (
int)-1) && PyErr_Occurred())) __PYX_ERR(0, 29, __pyx_L3_error)
6075 __pyx_v_nExteriorElementBoundaries_global = __Pyx_PyLong_As_int(values[22]);
if (unlikely((__pyx_v_nExteriorElementBoundaries_global == (
int)-1) && PyErr_Occurred())) __PYX_ERR(0, 30, __pyx_L3_error)
6076 __pyx_v_nQuadraturePoints_element = __Pyx_PyLong_As_int(values[23]);
if (unlikely((__pyx_v_nQuadraturePoints_element == (
int)-1) && PyErr_Occurred())) __PYX_ERR(0, 31, __pyx_L3_error)
6077 __pyx_v_nQuadraturePoints_elementBoundary = __Pyx_PyLong_As_int(values[24]);
if (unlikely((__pyx_v_nQuadraturePoints_elementBoundary == (
int)-1) && PyErr_Occurred())) __PYX_ERR(0, 32, __pyx_L3_error)
6078 __pyx_v_interiorElementBoundaries = ((PyArrayObject *)values[25]);
6079 __pyx_v_exteriorElementBoundaries = ((PyArrayObject *)values[26]);
6080 __pyx_v_elementBoundaryElements = ((PyArrayObject *)values[27]);
6081 __pyx_v_elementBoundaryLocalElementBoundaries = ((PyArrayObject *)values[28]);
6082 __pyx_v_n = ((PyArrayObject *)values[29]);
6083 __pyx_v_q_u = ((PyArrayObject *)values[30]);
6084 __pyx_v_q_dV = ((PyArrayObject *)values[31]);
6085 __pyx_v_isDOFBoundary = ((PyArrayObject *)values[32]);
6086 __pyx_v_bc_u = ((PyArrayObject *)values[33]);
6087 __pyx_v_flux = ((PyArrayObject *)values[34]);
6090 __pyx_L5_argtuple_error:;
6091 __Pyx_RaiseArgtupleInvalid(
"calculateRusanovFluxSaturationEquationIncomp_PWC", 1, 35, 35, __pyx_nargs); __PYX_ERR(0, 7, __pyx_L3_error)
6093 goto __pyx_L4_argument_unpacking_done;
6095 for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(
sizeof(values)/
sizeof(values[0])); ++__pyx_temp) {
6096 Py_XDECREF(values[__pyx_temp]);
6098 __Pyx_AddTraceback(
"cSubsurfaceTransportCoefficients.calculateRusanovFluxSaturationEquationIncomp_PWC", __pyx_clineno, __pyx_lineno, __pyx_filename);
6099 __Pyx_RefNannyFinishContext();
6101 __pyx_L4_argument_unpacking_done:;
6102 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_rowptr), __pyx_mstate_global->__pyx_ptype_5numpy_ndarray, 1,
"rowptr", 0))) __PYX_ERR(0, 12, __pyx_L1_error)
6103 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_colind), __pyx_mstate_global->__pyx_ptype_5numpy_ndarray, 1,
"colind", 0))) __PYX_ERR(0, 13, __pyx_L1_error)
6104 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_materialTypes), __pyx_mstate_global->__pyx_ptype_5numpy_ndarray, 1,
"materialTypes", 0))) __PYX_ERR(0, 14, __pyx_L1_error)
6105 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_omega), __pyx_mstate_global->__pyx_ptype_5numpy_ndarray, 1,
"omega", 0))) __PYX_ERR(0, 17, __pyx_L1_error)
6106 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_Kbar), __pyx_mstate_global->__pyx_ptype_5numpy_ndarray, 1,
"Kbar", 0))) __PYX_ERR(0, 18, __pyx_L1_error)
6107 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_rwork_psk), __pyx_mstate_global->__pyx_ptype_5numpy_ndarray, 1,
"rwork_psk", 0))) __PYX_ERR(0, 20, __pyx_L1_error)
6108 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_rwork_psk_tol), __pyx_mstate_global->__pyx_ptype_5numpy_ndarray, 1,
"rwork_psk_tol", 0))) __PYX_ERR(0, 21, __pyx_L1_error)
6109 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_rwork_density_w), __pyx_mstate_global->__pyx_ptype_5numpy_ndarray, 1,
"rwork_density_w", 0))) __PYX_ERR(0, 22, __pyx_L1_error)
6110 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_rwork_density_n), __pyx_mstate_global->__pyx_ptype_5numpy_ndarray, 1,
"rwork_density_n", 0))) __PYX_ERR(0, 23, __pyx_L1_error)
6111 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_g), __pyx_mstate_global->__pyx_ptype_5numpy_ndarray, 1,
"g", 0))) __PYX_ERR(0, 24, __pyx_L1_error)
6112 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_ebq_global_qt), __pyx_mstate_global->__pyx_ptype_5numpy_ndarray, 1,
"ebq_global_qt", 0))) __PYX_ERR(0, 25, __pyx_L1_error)
6113 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_q_lambda_bar), __pyx_mstate_global->__pyx_ptype_5numpy_ndarray, 1,
"q_lambda_bar", 0))) __PYX_ERR(0, 26, __pyx_L1_error)
6114 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_interiorElementBoundaries), __pyx_mstate_global->__pyx_ptype_5numpy_ndarray, 1,
"interiorElementBoundaries", 0))) __PYX_ERR(0, 33, __pyx_L1_error)
6115 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_exteriorElementBoundaries), __pyx_mstate_global->__pyx_ptype_5numpy_ndarray, 1,
"exteriorElementBoundaries", 0))) __PYX_ERR(0, 34, __pyx_L1_error)
6116 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_elementBoundaryElements), __pyx_mstate_global->__pyx_ptype_5numpy_ndarray, 1,
"elementBoundaryElements", 0))) __PYX_ERR(0, 35, __pyx_L1_error)
6117 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_elementBoundaryLocalElementBoundaries), __pyx_mstate_global->__pyx_ptype_5numpy_ndarray, 1,
"elementBoundaryLocalElementBoundaries", 0))) __PYX_ERR(0, 36, __pyx_L1_error)
6118 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_n), __pyx_mstate_global->__pyx_ptype_5numpy_ndarray, 1,
"n", 0))) __PYX_ERR(0, 37, __pyx_L1_error)
6119 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_q_u), __pyx_mstate_global->__pyx_ptype_5numpy_ndarray, 1,
"q_u", 0))) __PYX_ERR(0, 38, __pyx_L1_error)
6120 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_q_dV), __pyx_mstate_global->__pyx_ptype_5numpy_ndarray, 1,
"q_dV", 0))) __PYX_ERR(0, 39, __pyx_L1_error)
6121 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_isDOFBoundary), __pyx_mstate_global->__pyx_ptype_5numpy_ndarray, 1,
"isDOFBoundary", 0))) __PYX_ERR(0, 40, __pyx_L1_error)
6122 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_bc_u), __pyx_mstate_global->__pyx_ptype_5numpy_ndarray, 1,
"bc_u", 0))) __PYX_ERR(0, 41, __pyx_L1_error)
6123 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_flux), __pyx_mstate_global->__pyx_ptype_5numpy_ndarray, 1,
"flux", 0))) __PYX_ERR(0, 42, __pyx_L1_error)
6124 __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);
6130 for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(
sizeof(values)/
sizeof(values[0])); ++__pyx_temp) {
6131 Py_XDECREF(values[__pyx_temp]);
6133 goto __pyx_L7_cleaned_up;
6135 for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(
sizeof(values)/
sizeof(values[0])); ++__pyx_temp) {
6136 Py_XDECREF(values[__pyx_temp]);
6138 __pyx_L7_cleaned_up:;
6152 __Pyx_RefNannyFinishContext();
6156static 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) {
6158 PyObject *__pyx_r = NULL;
6159 __Pyx_RefNannyDeclarations
6161 int __pyx_lineno = 0;
6162 const char *__pyx_filename = NULL;
6163 int __pyx_clineno = 0;
6164 __Pyx_RefNannySetupContext(
"calculateRusanovFluxSaturationEquationIncomp_PWC", 0);
6173 __pyx_v_failed =
calculateRusanovFluxSaturationEquationIncomp_PWC(__pyx_v_safetyFactor, __pyx_v_nSpace, __pyx_v_pskModelFlag, __pyx_v_nParams, ((
int *)__pyx_f_5numpy_7ndarray_4data___get__(__pyx_v_rowptr)), ((
int *)__pyx_f_5numpy_7ndarray_4data___get__(__pyx_v_colind)), ((
int *)__pyx_f_5numpy_7ndarray_4data___get__(__pyx_v_materialTypes)), __pyx_v_muw, __pyx_v_mun, ((
double *)__pyx_f_5numpy_7ndarray_4data___get__(__pyx_v_omega)), ((
double *)__pyx_f_5numpy_7ndarray_4data___get__(__pyx_v_Kbar)), __pyx_v_b, ((
double *)__pyx_f_5numpy_7ndarray_4data___get__(__pyx_v_rwork_psk)), ((
double *)__pyx_f_5numpy_7ndarray_4data___get__(__pyx_v_rwork_psk_tol)), ((
double *)__pyx_f_5numpy_7ndarray_4data___get__(__pyx_v_rwork_density_w)), ((
double *)__pyx_f_5numpy_7ndarray_4data___get__(__pyx_v_rwork_density_n)), ((
double *)__pyx_f_5numpy_7ndarray_4data___get__(__pyx_v_g)), ((
double *)__pyx_f_5numpy_7ndarray_4data___get__(__pyx_v_ebq_global_qt)), ((
double *)__pyx_f_5numpy_7ndarray_4data___get__(__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, ((
int *)__pyx_f_5numpy_7ndarray_4data___get__(__pyx_v_interiorElementBoundaries)), ((
int *)__pyx_f_5numpy_7ndarray_4data___get__(__pyx_v_exteriorElementBoundaries)), ((
int *)__pyx_f_5numpy_7ndarray_4data___get__(__pyx_v_elementBoundaryElements)), ((
int *)__pyx_f_5numpy_7ndarray_4data___get__(__pyx_v_elementBoundaryLocalElementBoundaries)), ((
double *)__pyx_f_5numpy_7ndarray_4data___get__(__pyx_v_n)), ((
double *)__pyx_f_5numpy_7ndarray_4data___get__(__pyx_v_q_u)), ((
double *)__pyx_f_5numpy_7ndarray_4data___get__(__pyx_v_q_dV)), ((
int *)__pyx_f_5numpy_7ndarray_4data___get__(__pyx_v_isDOFBoundary)), ((
double *)__pyx_f_5numpy_7ndarray_4data___get__(__pyx_v_bc_u)), ((
double *)__pyx_f_5numpy_7ndarray_4data___get__(__pyx_v_flux)));
6182 #ifndef CYTHON_WITHOUT_ASSERTIONS
6183 if (unlikely(__pyx_assertions_enabled())) {
6184 __pyx_t_1 = (__pyx_v_failed == 0);
6186 if (unlikely(!__pyx_t_1)) {
6187 __Pyx_Raise(((PyObject *)(((PyTypeObject*)PyExc_AssertionError))), 0, 0, 0);
6188 __PYX_ERR(0, 79, __pyx_L1_error)
6193 if ((1));
else __PYX_ERR(0, 79, __pyx_L1_error)
6205 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
6208 __Pyx_AddTraceback(
"cSubsurfaceTransportCoefficients.calculateRusanovFluxSaturationEquationIncomp_PWC", __pyx_clineno, __pyx_lineno, __pyx_filename);
6212 __Pyx_XGIVEREF(__pyx_r);
6213 __Pyx_RefNannyFinishContext();
6226static PyObject *__pyx_pw_32cSubsurfaceTransportCoefficients_3piecewiseLinearTableLookup(PyObject *__pyx_self,
6227#
if CYTHON_VECTORCALL
6228PyObject *
const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
6230PyObject *__pyx_args, PyObject *__pyx_kwds
6233static PyMethodDef __pyx_mdef_32cSubsurfaceTransportCoefficients_3piecewiseLinearTableLookup = {
"piecewiseLinearTableLookup", (PyCFunction)(
void(*)(
void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_32cSubsurfaceTransportCoefficients_3piecewiseLinearTableLookup, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
6234static PyObject *__pyx_pw_32cSubsurfaceTransportCoefficients_3piecewiseLinearTableLookup(PyObject *__pyx_self,
6235#
if CYTHON_VECTORCALL
6236PyObject *
const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
6238PyObject *__pyx_args, PyObject *__pyx_kwds
6242 PyArrayObject *__pyx_v_xv = 0;
6243 PyArrayObject *__pyx_v_yv = 0;
6245 #if !CYTHON_VECTORCALL
6246 CYTHON_UNUSED Py_ssize_t __pyx_nargs;
6248 CYTHON_UNUSED PyObject *
const *__pyx_kwvalues;
6249 PyObject* values[4] = {0,0,0,0};
6250 int __pyx_lineno = 0;
6251 const char *__pyx_filename = NULL;
6252 int __pyx_clineno = 0;
6253 PyObject *__pyx_r = 0;
6254 __Pyx_RefNannyDeclarations
6255 __Pyx_RefNannySetupContext(
"piecewiseLinearTableLookup (wrapper)", 0);
6256 #if !CYTHON_VECTORCALL
6257 #if CYTHON_ASSUME_SAFE_SIZE
6258 __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
6260 __pyx_nargs = PyTuple_Size(__pyx_args);
if (unlikely(__pyx_nargs < 0))
return NULL;
6263 __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
6265 PyObject **
const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_x,&__pyx_mstate_global->__pyx_n_u_xv,&__pyx_mstate_global->__pyx_n_u_yv,&__pyx_mstate_global->__pyx_n_u_start,0};
6266 const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
6267 if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(0, 81, __pyx_L3_error)
6268 if (__pyx_kwds_len > 0) {
6269 switch (__pyx_nargs) {
6271 values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
6272 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 81, __pyx_L3_error)
6275 values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
6276 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 81, __pyx_L3_error)
6279 values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
6280 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 81, __pyx_L3_error)
6283 values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
6284 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 81, __pyx_L3_error)
6287 default:
goto __pyx_L5_argtuple_error;
6289 const Py_ssize_t kwd_pos_args = __pyx_nargs;
6290 if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len,
"piecewiseLinearTableLookup", 0) < (0)) __PYX_ERR(0, 81, __pyx_L3_error)
6291 for (Py_ssize_t i = __pyx_nargs; i < 3; i++) {
6292 if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid(
"piecewiseLinearTableLookup", 0, 3, 4, i); __PYX_ERR(0, 81, __pyx_L3_error) }
6295 switch (__pyx_nargs) {
6297 values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
6298 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 81, __pyx_L3_error)
6301 values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
6302 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 81, __pyx_L3_error)
6303 values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
6304 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 81, __pyx_L3_error)
6305 values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
6306 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 81, __pyx_L3_error)
6308 default:
goto __pyx_L5_argtuple_error;
6311 __pyx_v_x = __Pyx_PyFloat_AsDouble(values[0]);
if (unlikely((__pyx_v_x == (
double)-1) && PyErr_Occurred())) __PYX_ERR(0, 81, __pyx_L3_error)
6312 __pyx_v_xv = ((PyArrayObject *)values[1]);
6313 __pyx_v_yv = ((PyArrayObject *)values[2]);
6315 __pyx_v_start = __Pyx_PyLong_As_int(values[3]);
if (unlikely((__pyx_v_start == (
int)-1) && PyErr_Occurred())) __PYX_ERR(0, 84, __pyx_L3_error)
6317 __pyx_v_start = ((int)((int)0));
6321 __pyx_L5_argtuple_error:;
6322 __Pyx_RaiseArgtupleInvalid(
"piecewiseLinearTableLookup", 0, 3, 4, __pyx_nargs); __PYX_ERR(0, 81, __pyx_L3_error)
6324 goto __pyx_L4_argument_unpacking_done;
6326 for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(
sizeof(values)/
sizeof(values[0])); ++__pyx_temp) {
6327 Py_XDECREF(values[__pyx_temp]);
6329 __Pyx_AddTraceback(
"cSubsurfaceTransportCoefficients.piecewiseLinearTableLookup", __pyx_clineno, __pyx_lineno, __pyx_filename);
6330 __Pyx_RefNannyFinishContext();
6332 __pyx_L4_argument_unpacking_done:;
6333 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_xv), __pyx_mstate_global->__pyx_ptype_5numpy_ndarray, 1,
"xv", 0))) __PYX_ERR(0, 82, __pyx_L1_error)
6334 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_yv), __pyx_mstate_global->__pyx_ptype_5numpy_ndarray, 1,
"yv", 0))) __PYX_ERR(0, 83, __pyx_L1_error)
6335 __pyx_r = __pyx_pf_32cSubsurfaceTransportCoefficients_2piecewiseLinearTableLookup(__pyx_self, __pyx_v_x, __pyx_v_xv, __pyx_v_yv, __pyx_v_start);
6341 for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(
sizeof(values)/
sizeof(values[0])); ++__pyx_temp) {
6342 Py_XDECREF(values[__pyx_temp]);
6344 goto __pyx_L7_cleaned_up;
6346 for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(
sizeof(values)/
sizeof(values[0])); ++__pyx_temp) {
6347 Py_XDECREF(values[__pyx_temp]);
6349 __pyx_L7_cleaned_up:;
6352 __Pyx_RefNannyFinishContext();
6356static 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) {
6359 PyObject *__pyx_r = NULL;
6360 __Pyx_RefNannyDeclarations
6361 PyObject *__pyx_t_1 = NULL;
6362 PyObject *__pyx_t_2 = NULL;
6363 PyObject *__pyx_t_3 = NULL;
6364 PyObject *__pyx_t_4 = NULL;
6365 int __pyx_lineno = 0;
6366 const char *__pyx_filename = NULL;
6367 int __pyx_clineno = 0;
6368 __Pyx_RefNannySetupContext(
"piecewiseLinearTableLookup", 0);
6395 piecewiseLinearTableLookup(__pyx_v_x, (__pyx_f_5numpy_7ndarray_5shape___get__(__pyx_v_xv)[0]), (&__pyx_v_start), (&__pyx_v_y), (&__pyx_v_dy), ((
double *)__pyx_f_5numpy_7ndarray_4data___get__(__pyx_v_xv)), ((
double *)__pyx_f_5numpy_7ndarray_4data___get__(__pyx_v_yv)));
6402 __pyx_t_1 = PyFloat_FromDouble(__pyx_v_y);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 94, __pyx_L1_error)
6403 __Pyx_GOTREF(__pyx_t_1);
6404 __pyx_t_2 = PyFloat_FromDouble(__pyx_v_dy);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 94, __pyx_L1_error)
6405 __Pyx_GOTREF(__pyx_t_2);
6406 __pyx_t_3 = __Pyx_PyLong_From_int(__pyx_v_start);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 94, __pyx_L1_error)
6407 __Pyx_GOTREF(__pyx_t_3);
6408 __pyx_t_4 = PyTuple_New(3);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 94, __pyx_L1_error)
6409 __Pyx_GOTREF(__pyx_t_4);
6410 __Pyx_GIVEREF(__pyx_t_1);
6411 if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_1) != (0)) __PYX_ERR(0, 94, __pyx_L1_error);
6412 __Pyx_GIVEREF(__pyx_t_2);
6413 if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_2) != (0)) __PYX_ERR(0, 94, __pyx_L1_error);
6414 __Pyx_GIVEREF(__pyx_t_3);
6415 if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_t_3) != (0)) __PYX_ERR(0, 94, __pyx_L1_error);
6420 PyObject *__pyx_temp;
6422 __pyx_temp = __pyx_r;
6423 __pyx_r = __pyx_t_4;
6425 __Pyx_XDECREF(__pyx_temp);
6440 __Pyx_XDECREF(__pyx_t_1);
6441 __Pyx_XDECREF(__pyx_t_2);
6442 __Pyx_XDECREF(__pyx_t_3);
6443 __Pyx_XDECREF(__pyx_t_4);
6444 __Pyx_AddTraceback(
"cSubsurfaceTransportCoefficients.piecewiseLinearTableLookup", __pyx_clineno, __pyx_lineno, __pyx_filename);
6449 __Pyx_XGIVEREF(__pyx_r);
6450 __Pyx_RefNannyFinishContext();
6455static PyMethodDef __pyx_methods[] = {
6459static CYTHON_SMALL_CODE
int __Pyx_InitCachedBuiltins(__pyx_mstatetype *__pyx_mstate);
6460static CYTHON_SMALL_CODE
int __Pyx_InitCachedConstants(__pyx_mstatetype *__pyx_mstate);
6461static CYTHON_SMALL_CODE
int __Pyx_InitGlobals(
void);
6462static CYTHON_SMALL_CODE
int __Pyx_InitAfterSharedUtility(
void);
6463static CYTHON_SMALL_CODE
int __Pyx_InitConstants(__pyx_mstatetype *__pyx_mstate);
6464static CYTHON_SMALL_CODE
int __Pyx_modinit_Global_init_code(__pyx_mstatetype *__pyx_mstate);
6465static CYTHON_SMALL_CODE
int __Pyx_modinit_Variable_export_code(__pyx_mstatetype *__pyx_mstate);
6466static CYTHON_SMALL_CODE
int __Pyx_modinit_Function_export_code(__pyx_mstatetype *__pyx_mstate);
6467static CYTHON_SMALL_CODE
int __Pyx_modinit_Type_import_code(__pyx_mstatetype *__pyx_mstate);
6468static CYTHON_SMALL_CODE
int __Pyx_modinit_Variable_import_code(__pyx_mstatetype *__pyx_mstate);
6469static CYTHON_SMALL_CODE
int __Pyx_modinit_Function_import_code(__pyx_mstatetype *__pyx_mstate);
6470static CYTHON_SMALL_CODE
int __Pyx_CreateCodeObjects(__pyx_mstatetype *__pyx_mstate);
6473static int __Pyx_modinit_Global_init_code(__pyx_mstatetype *__pyx_mstate) {
6474 __Pyx_RefNannyDeclarations
6475 CYTHON_UNUSED_VAR(__pyx_mstate);
6476 __Pyx_RefNannySetupContext(
"__Pyx_modinit_Global_init_code", 0);
6478 __Pyx_RefNannyFinishContext();
6482static int __Pyx_modinit_Variable_export_code(__pyx_mstatetype *__pyx_mstate) {
6483 __Pyx_RefNannyDeclarations
6484 CYTHON_UNUSED_VAR(__pyx_mstate);
6485 __Pyx_RefNannySetupContext(
"__Pyx_modinit_Variable_export_code", 0);
6487 __Pyx_RefNannyFinishContext();
6491static int __Pyx_modinit_Function_export_code(__pyx_mstatetype *__pyx_mstate) {
6492 __Pyx_RefNannyDeclarations
6493 CYTHON_UNUSED_VAR(__pyx_mstate);
6494 __Pyx_RefNannySetupContext(
"__Pyx_modinit_Function_export_code", 0);
6496 __Pyx_RefNannyFinishContext();
6500static int __Pyx_modinit_Type_import_code(__pyx_mstatetype *__pyx_mstate) {
6501 __Pyx_RefNannyDeclarations
6502 PyObject *__pyx_t_1 = NULL;
6503 int __pyx_lineno = 0;
6504 const char *__pyx_filename = NULL;
6505 int __pyx_clineno = 0;
6506 CYTHON_UNUSED_VAR(__pyx_mstate);
6507 __Pyx_RefNannySetupContext(
"__Pyx_modinit_Type_import_code", 0);
6509 __pyx_t_1 = PyImport_ImportModule(__Pyx_BUILTIN_MODULE_NAME);
if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 9, __pyx_L1_error)
6510 __Pyx_GOTREF(__pyx_t_1);
6511 __pyx_mstate->__pyx_ptype_7cpython_4type_type = __Pyx_ImportType_3_3_0(__pyx_t_1, __Pyx_BUILTIN_MODULE_NAME,
"type",
6512 #
if defined(PYPY_VERSION_NUM) && PYPY_VERSION_NUM < 0x050B0000
6513 sizeof(PyTypeObject), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(PyTypeObject),
6514 #elif CYTHON_COMPILING_IN_LIMITED_API
6517 sizeof(PyHeapTypeObject), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(PyHeapTypeObject),
6519 __Pyx_ImportType_CheckSize_Warn_3_3_0);
if (!__pyx_mstate->__pyx_ptype_7cpython_4type_type) __PYX_ERR(2, 9, __pyx_L1_error)
6520 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
6521 __pyx_t_1 = PyImport_ImportModule(
"numpy");
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 229, __pyx_L1_error)
6522 __Pyx_GOTREF(__pyx_t_1);
6523 __pyx_mstate->__pyx_ptype_5numpy_dtype = __Pyx_ImportType_3_3_0(__pyx_t_1,
"numpy",
"dtype",
6524 #
if defined(PYPY_VERSION_NUM) && PYPY_VERSION_NUM < 0x050B0000
6525 sizeof(PyArray_Descr), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(PyArray_Descr),
6526 #elif CYTHON_COMPILING_IN_LIMITED_API
6527 sizeof(PyArray_Descr), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(PyArray_Descr),
6529 sizeof(PyArray_Descr), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(PyArray_Descr),
6531 __Pyx_ImportType_CheckSize_Ignore_3_3_0);
if (!__pyx_mstate->__pyx_ptype_5numpy_dtype) __PYX_ERR(1, 229, __pyx_L1_error)
6532 __pyx_mstate->__pyx_ptype_5numpy_flatiter = __Pyx_ImportType_3_3_0(__pyx_t_1,
"numpy",
"flatiter",
6533 #
if defined(PYPY_VERSION_NUM) && PYPY_VERSION_NUM < 0x050B0000
6534 sizeof(PyArrayIterObject), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(PyArrayIterObject),
6535 #elif CYTHON_COMPILING_IN_LIMITED_API
6536 sizeof(PyArrayIterObject), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(PyArrayIterObject),
6538 sizeof(PyArrayIterObject), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(PyArrayIterObject),
6540 __Pyx_ImportType_CheckSize_Ignore_3_3_0);
if (!__pyx_mstate->__pyx_ptype_5numpy_flatiter) __PYX_ERR(1, 286, __pyx_L1_error)
6541 __pyx_mstate->__pyx_ptype_5numpy_broadcast = __Pyx_ImportType_3_3_0(__pyx_t_1,
"numpy",
"broadcast",
6542 #
if defined(PYPY_VERSION_NUM) && PYPY_VERSION_NUM < 0x050B0000
6543 sizeof(PyArrayMultiIterObject), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(PyArrayMultiIterObject),
6544 #elif CYTHON_COMPILING_IN_LIMITED_API
6545 sizeof(PyArrayMultiIterObject), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(PyArrayMultiIterObject),
6547 sizeof(PyArrayMultiIterObject), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(PyArrayMultiIterObject),
6549 __Pyx_ImportType_CheckSize_Ignore_3_3_0);
if (!__pyx_mstate->__pyx_ptype_5numpy_broadcast) __PYX_ERR(1, 290, __pyx_L1_error)
6550 __pyx_mstate->__pyx_ptype_5numpy_ndarray = __Pyx_ImportType_3_3_0(__pyx_t_1,
"numpy",
"ndarray",
6551 #
if defined(PYPY_VERSION_NUM) && PYPY_VERSION_NUM < 0x050B0000
6552 sizeof(PyArrayObject), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(PyArrayObject),
6553 #elif CYTHON_COMPILING_IN_LIMITED_API
6554 sizeof(PyArrayObject), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(PyArrayObject),
6556 sizeof(PyArrayObject), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(PyArrayObject),
6558 __Pyx_ImportType_CheckSize_Ignore_3_3_0);
if (!__pyx_mstate->__pyx_ptype_5numpy_ndarray) __PYX_ERR(1, 329, __pyx_L1_error)
6559 __pyx_mstate->__pyx_ptype_5numpy_generic = __Pyx_ImportType_3_3_0(__pyx_t_1,
"numpy",
"generic",
6560 #
if defined(PYPY_VERSION_NUM) && PYPY_VERSION_NUM < 0x050B0000
6561 sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(PyObject),
6562 #elif CYTHON_COMPILING_IN_LIMITED_API
6563 sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(PyObject),
6565 sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(PyObject),
6567 __Pyx_ImportType_CheckSize_Warn_3_3_0);
if (!__pyx_mstate->__pyx_ptype_5numpy_generic) __PYX_ERR(1, 847, __pyx_L1_error)
6568 __pyx_mstate->__pyx_ptype_5numpy_number = __Pyx_ImportType_3_3_0(__pyx_t_1,
"numpy",
"number",
6569 #
if defined(PYPY_VERSION_NUM) && PYPY_VERSION_NUM < 0x050B0000
6570 sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(PyObject),
6571 #elif CYTHON_COMPILING_IN_LIMITED_API
6572 sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(PyObject),
6574 sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(PyObject),
6576 __Pyx_ImportType_CheckSize_Warn_3_3_0);
if (!__pyx_mstate->__pyx_ptype_5numpy_number) __PYX_ERR(1, 849, __pyx_L1_error)
6577 __pyx_mstate->__pyx_ptype_5numpy_integer = __Pyx_ImportType_3_3_0(__pyx_t_1,
"numpy",
"integer",
6578 #
if defined(PYPY_VERSION_NUM) && PYPY_VERSION_NUM < 0x050B0000
6579 sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(PyObject),
6580 #elif CYTHON_COMPILING_IN_LIMITED_API
6581 sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(PyObject),
6583 sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(PyObject),
6585 __Pyx_ImportType_CheckSize_Warn_3_3_0);
if (!__pyx_mstate->__pyx_ptype_5numpy_integer) __PYX_ERR(1, 851, __pyx_L1_error)
6586 __pyx_mstate->__pyx_ptype_5numpy_signedinteger = __Pyx_ImportType_3_3_0(__pyx_t_1,
"numpy",
"signedinteger",
6587 #
if defined(PYPY_VERSION_NUM) && PYPY_VERSION_NUM < 0x050B0000
6588 sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(PyObject),
6589 #elif CYTHON_COMPILING_IN_LIMITED_API
6590 sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(PyObject),
6592 sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(PyObject),
6594 __Pyx_ImportType_CheckSize_Warn_3_3_0);
if (!__pyx_mstate->__pyx_ptype_5numpy_signedinteger) __PYX_ERR(1, 853, __pyx_L1_error)
6595 __pyx_mstate->__pyx_ptype_5numpy_unsignedinteger = __Pyx_ImportType_3_3_0(__pyx_t_1,
"numpy",
"unsignedinteger",
6596 #
if defined(PYPY_VERSION_NUM) && PYPY_VERSION_NUM < 0x050B0000
6597 sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(PyObject),
6598 #elif CYTHON_COMPILING_IN_LIMITED_API
6599 sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(PyObject),
6601 sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(PyObject),
6603 __Pyx_ImportType_CheckSize_Warn_3_3_0);
if (!__pyx_mstate->__pyx_ptype_5numpy_unsignedinteger) __PYX_ERR(1, 855, __pyx_L1_error)
6604 __pyx_mstate->__pyx_ptype_5numpy_inexact = __Pyx_ImportType_3_3_0(__pyx_t_1,
"numpy",
"inexact",
6605 #
if defined(PYPY_VERSION_NUM) && PYPY_VERSION_NUM < 0x050B0000
6606 sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(PyObject),
6607 #elif CYTHON_COMPILING_IN_LIMITED_API
6608 sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(PyObject),
6610 sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(PyObject),
6612 __Pyx_ImportType_CheckSize_Warn_3_3_0);
if (!__pyx_mstate->__pyx_ptype_5numpy_inexact) __PYX_ERR(1, 857, __pyx_L1_error)
6613 __pyx_mstate->__pyx_ptype_5numpy_floating = __Pyx_ImportType_3_3_0(__pyx_t_1,
"numpy",
"floating",
6614 #
if defined(PYPY_VERSION_NUM) && PYPY_VERSION_NUM < 0x050B0000
6615 sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(PyObject),
6616 #elif CYTHON_COMPILING_IN_LIMITED_API
6617 sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(PyObject),
6619 sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(PyObject),
6621 __Pyx_ImportType_CheckSize_Warn_3_3_0);
if (!__pyx_mstate->__pyx_ptype_5numpy_floating) __PYX_ERR(1, 859, __pyx_L1_error)
6622 __pyx_mstate->__pyx_ptype_5numpy_complexfloating = __Pyx_ImportType_3_3_0(__pyx_t_1,
"numpy",
"complexfloating",
6623 #
if defined(PYPY_VERSION_NUM) && PYPY_VERSION_NUM < 0x050B0000
6624 sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(PyObject),
6625 #elif CYTHON_COMPILING_IN_LIMITED_API
6626 sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(PyObject),
6628 sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(PyObject),
6630 __Pyx_ImportType_CheckSize_Warn_3_3_0);
if (!__pyx_mstate->__pyx_ptype_5numpy_complexfloating) __PYX_ERR(1, 861, __pyx_L1_error)
6631 __pyx_mstate->__pyx_ptype_5numpy_flexible = __Pyx_ImportType_3_3_0(__pyx_t_1,
"numpy",
"flexible",
6632 #
if defined(PYPY_VERSION_NUM) && PYPY_VERSION_NUM < 0x050B0000
6633 sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(PyObject),
6634 #elif CYTHON_COMPILING_IN_LIMITED_API
6635 sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(PyObject),
6637 sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(PyObject),
6639 __Pyx_ImportType_CheckSize_Warn_3_3_0);
if (!__pyx_mstate->__pyx_ptype_5numpy_flexible) __PYX_ERR(1, 863, __pyx_L1_error)
6640 __pyx_mstate->__pyx_ptype_5numpy_character = __Pyx_ImportType_3_3_0(__pyx_t_1,
"numpy",
"character",
6641 #
if defined(PYPY_VERSION_NUM) && PYPY_VERSION_NUM < 0x050B0000
6642 sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(PyObject),
6643 #elif CYTHON_COMPILING_IN_LIMITED_API
6644 sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(PyObject),
6646 sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(PyObject),
6648 __Pyx_ImportType_CheckSize_Warn_3_3_0);
if (!__pyx_mstate->__pyx_ptype_5numpy_character) __PYX_ERR(1, 865, __pyx_L1_error)
6649 __pyx_mstate->__pyx_ptype_5numpy_ufunc = __Pyx_ImportType_3_3_0(__pyx_t_1,
"numpy",
"ufunc",
6650 #
if defined(PYPY_VERSION_NUM) && PYPY_VERSION_NUM < 0x050B0000
6651 sizeof(PyUFuncObject), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(PyUFuncObject),
6652 #elif CYTHON_COMPILING_IN_LIMITED_API
6653 sizeof(PyUFuncObject), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(PyUFuncObject),
6655 sizeof(PyUFuncObject), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(PyUFuncObject),
6657 __Pyx_ImportType_CheckSize_Ignore_3_3_0);
if (!__pyx_mstate->__pyx_ptype_5numpy_ufunc) __PYX_ERR(1, 946, __pyx_L1_error)
6658 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
6659 __Pyx_RefNannyFinishContext();
6662 __Pyx_XDECREF(__pyx_t_1);
6663 __Pyx_RefNannyFinishContext();
6667static int __Pyx_modinit_Variable_import_code(__pyx_mstatetype *__pyx_mstate) {
6668 __Pyx_RefNannyDeclarations
6669 CYTHON_UNUSED_VAR(__pyx_mstate);
6670 __Pyx_RefNannySetupContext(
"__Pyx_modinit_Variable_import_code", 0);
6672 __Pyx_RefNannyFinishContext();
6676static int __Pyx_modinit_Function_import_code(__pyx_mstatetype *__pyx_mstate) {
6677 __Pyx_RefNannyDeclarations
6678 CYTHON_UNUSED_VAR(__pyx_mstate);
6679 __Pyx_RefNannySetupContext(
"__Pyx_modinit_Function_import_code", 0);
6681 __Pyx_RefNannyFinishContext();
6685#if CYTHON_PEP489_MULTI_PHASE_INIT
6686static PyObject* __pyx_pymod_create(PyObject *spec, PyModuleDef *def);
6687static int __pyx_pymod_exec_cSubsurfaceTransportCoefficients(PyObject* module);
6688static PyModuleDef_Slot __pyx_moduledef_slots[] = {
6689 {Py_mod_create, (
void*)__pyx_pymod_create},
6690 {Py_mod_exec, (
void*)__pyx_pymod_exec_cSubsurfaceTransportCoefficients},
6691 #if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING
6692 {Py_mod_gil, __Pyx_FREETHREADING_COMPATIBLE},
6694 #if PY_VERSION_HEX >= 0x030C0000 && CYTHON_USE_MODULE_STATE
6695 {Py_mod_multiple_interpreters, Py_MOD_MULTIPLE_INTERPRETERS_NOT_SUPPORTED},
6703 struct PyModuleDef __pyx_moduledef =
6705 static struct PyModuleDef __pyx_moduledef =
6708 PyModuleDef_HEAD_INIT,
6709 "cSubsurfaceTransportCoefficients",
6711 #if CYTHON_USE_MODULE_STATE
6712 sizeof(__pyx_mstatetype),
6714 (CYTHON_PEP489_MULTI_PHASE_INIT) ? 0 : -1,
6717 #if CYTHON_PEP489_MULTI_PHASE_INIT
6718 __pyx_moduledef_slots,
6722 #if CYTHON_USE_MODULE_STATE
6737#ifndef CYTHON_NO_PYINIT_EXPORT
6738 #define __Pyx_PyMODINIT_FUNC PyMODINIT_FUNC
6741 #define __Pyx_PyMODINIT_FUNC extern "C" PyObject *
6743 #define __Pyx_PyMODINIT_FUNC PyObject *
6747__Pyx_PyMODINIT_FUNC PyInit_cSubsurfaceTransportCoefficients(
void) CYTHON_SMALL_CODE;
6748__Pyx_PyMODINIT_FUNC PyInit_cSubsurfaceTransportCoefficients(
void)
6749#if CYTHON_PEP489_MULTI_PHASE_INIT
6751 return PyModuleDef_Init(&__pyx_moduledef);
6754#if CYTHON_COMPILING_IN_LIMITED_API && (__PYX_LIMITED_VERSION_HEX < 0x030A0000 &&\
6755 (defined(_WIN32) || defined(WIN32) || defined(MS_WINDOWS)))
6756static PY_INT64_T __Pyx_GetCurrentInterpreterId(
void) {
6758 PyObject *module = PyImport_ImportModule(
"_interpreters");
6760 if (!PyErr_ExceptionMatches(PyExc_Exception)) {
6764 module = PyImport_ImportModule("_xxsubinterpreters");
6765 if (!module)
goto bad;
6767 PyObject *current = PyObject_CallMethod(module,
"get_current", NULL);
6769 if (!current)
goto bad;
6770 if (PyTuple_Check(current)) {
6771 PyObject *new_current = PySequence_GetItem(current, 0);
6773 current = new_current;
6774 if (!new_current)
goto bad;
6776 long long as_c_int = PyLong_AsLongLong(current);
6781 PySys_WriteStderr(
"__Pyx_GetCurrentInterpreterId failed. Try setting the C define CYTHON_PEP489_MULTI_PHASE_INIT=0\n");
6785#if !CYTHON_USE_MODULE_STATE
6786static CYTHON_SMALL_CODE
int __Pyx_check_single_interpreter(
void) {
6787 static PY_INT64_T main_interpreter_id = -1;
6788#if CYTHON_COMPILING_IN_GRAAL && defined(GRAALPY_VERSION_NUM) && GRAALPY_VERSION_NUM > 0x19000000
6789 PY_INT64_T current_id = GraalPyInterpreterState_GetIDFromThreadState(PyThreadState_Get());
6790#elif CYTHON_COMPILING_IN_GRAAL
6791 PY_INT64_T current_id = PyInterpreterState_GetIDFromThreadState(PyThreadState_Get());
6792#elif CYTHON_COMPILING_IN_LIMITED_API && (__PYX_LIMITED_VERSION_HEX < 0x030A0000 &&\
6793 (defined(_WIN32) || defined(WIN32) || defined(MS_WINDOWS)))
6794 PY_INT64_T current_id = __Pyx_GetCurrentInterpreterId();
6795#elif CYTHON_COMPILING_IN_LIMITED_API
6796 PY_INT64_T current_id = PyInterpreterState_GetID(PyInterpreterState_Get());
6798 PY_INT64_T current_id = PyInterpreterState_GetID(PyThreadState_Get()->interp);
6800 if (unlikely(current_id == -1)) {
6803 if (main_interpreter_id == -1) {
6804 main_interpreter_id = current_id;
6806 }
else if (unlikely(main_interpreter_id != current_id)) {
6809 "Interpreter change detected - this module can only be loaded into one interpreter per process.");
6815static CYTHON_SMALL_CODE
int __Pyx_copy_spec_to_module(PyObject *spec, PyObject *moddict,
const char* from_name,
const char* to_name,
int allow_none)
6817 PyObject *value = PyObject_GetAttrString(spec, from_name);
6819 if (likely(value)) {
6820 if (allow_none || value != Py_None) {
6821 result = PyDict_SetItemString(moddict, to_name, value);
6824 }
else if (PyErr_ExceptionMatches(PyExc_AttributeError)) {
6831static CYTHON_SMALL_CODE PyObject* __pyx_pymod_create(PyObject *spec, PyModuleDef *def) {
6832 PyObject *module = NULL, *moddict, *modname;
6833 CYTHON_UNUSED_VAR(def);
6834 #if !CYTHON_USE_MODULE_STATE
6835 if (__Pyx_check_single_interpreter())
6839 return __Pyx_NewRef(__pyx_m);
6840 modname = PyObject_GetAttrString(spec,
"name");
6841 if (unlikely(!modname))
goto bad;
6842 module = PyModule_NewObject(modname);
6844 if (unlikely(!module))
goto bad;
6845 moddict = PyModule_GetDict(module);
6846 if (unlikely(!moddict))
goto bad;
6847 if (unlikely(__Pyx_copy_spec_to_module(spec, moddict,
"loader",
"__loader__", 1) < 0))
goto bad;
6848 if (unlikely(__Pyx_copy_spec_to_module(spec, moddict,
"origin",
"__file__", 1) < 0))
goto bad;
6849 if (unlikely(__Pyx_copy_spec_to_module(spec, moddict,
"parent",
"__package__", 1) < 0))
goto bad;
6850 if (unlikely(__Pyx_copy_spec_to_module(spec, moddict,
"submodule_search_locations",
"__path__", 0) < 0))
goto bad;
6858static CYTHON_SMALL_CODE
int __pyx_pymod_exec_cSubsurfaceTransportCoefficients(PyObject *__pyx_pyinit_module)
6861 int stringtab_initialized = 0;
6862 #if CYTHON_USE_MODULE_STATE
6863 int pystate_addmodule_run = 0;
6865 __pyx_mstatetype *__pyx_mstate = NULL;
6866 PyObject *__pyx_t_1 = NULL;
6867 PyObject *__pyx_t_2 = NULL;
6868 PyObject *__pyx_t_3 = NULL;
6869 int __pyx_lineno = 0;
6870 const char *__pyx_filename = NULL;
6871 int __pyx_clineno = 0;
6872 __Pyx_RefNannyDeclarations
6873 #if CYTHON_PEP489_MULTI_PHASE_INIT
6875 if (__pyx_m == __pyx_pyinit_module)
return 0;
6876 PyErr_SetString(PyExc_RuntimeError,
"Module 'cSubsurfaceTransportCoefficients' has already been imported. Re-initialisation is not supported.");
6880 if (__pyx_m)
return __Pyx_NewRef(__pyx_m);
6883 #if CYTHON_PEP489_MULTI_PHASE_INIT
6884 __pyx_t_1 = __pyx_pyinit_module;
6885 Py_INCREF(__pyx_t_1);
6887 __pyx_t_1 = PyModule_Create(&__pyx_moduledef);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1, __pyx_L1_error)
6889 #if CYTHON_USE_MODULE_STATE
6891 int add_module_result = __Pyx_State_AddModule(__pyx_t_1, &__pyx_moduledef);
6893 if (unlikely((add_module_result < 0))) __PYX_ERR(0, 1, __pyx_L1_error)
6894 pystate_addmodule_run = 1;
6897 __pyx_m = __pyx_t_1;
6899 #if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING
6900 PyUnstable_Module_SetGIL(__pyx_m, Py_MOD_GIL_USED);
6902 __pyx_mstate = __pyx_mstate_global;
6903 CYTHON_UNUSED_VAR(__pyx_t_1);
6904 __pyx_mstate->__pyx_d = PyModule_GetDict(__pyx_m);
if (unlikely(!__pyx_mstate->__pyx_d)) __PYX_ERR(0, 1, __pyx_L1_error)
6905 Py_INCREF(__pyx_mstate->__pyx_d);
6906 __pyx_mstate->__pyx_b = __Pyx_PyImport_AddModuleRef(__Pyx_BUILTIN_MODULE_NAME);
if (unlikely(!__pyx_mstate->__pyx_b)) __PYX_ERR(0, 1, __pyx_L1_error)
6907 __pyx_mstate->__pyx_cython_runtime = __Pyx_PyImport_AddModuleRef(
"cython_runtime");
if (unlikely(!__pyx_mstate->__pyx_cython_runtime)) __PYX_ERR(0, 1, __pyx_L1_error)
6908 if (PyObject_SetAttrString(__pyx_m,
"__builtins__", __pyx_mstate->__pyx_b) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
6911 __Pyx_RefNanny = __Pyx_RefNannyImportAPI(
"refnanny");
6912 if (!__Pyx_RefNanny) {
6913 if (PyErr_ExceptionMatches(PyExc_Exception)) {
6915 __Pyx_RefNanny = __Pyx_RefNannyImportAPI(
"Cython.Runtime.refnanny");
6917 if (!__Pyx_RefNanny)
6918 Py_FatalError(
"failed to import 'refnanny' module");
6922__Pyx_RefNannySetupContext(
"PyInit_cSubsurfaceTransportCoefficients", 0);
6923 __Pyx_init_runtime_version();
6924 if (__Pyx_check_binary_version(__PYX_LIMITED_VERSION_HEX, __Pyx_get_runtime_version(), CYTHON_COMPILING_IN_LIMITED_API) < (0)) __PYX_ERR(0, 1, __pyx_L1_error)
6925 __pyx_mstate->__pyx_empty_tuple = PyTuple_New(0);
if (unlikely(!__pyx_mstate->__pyx_empty_tuple)) __PYX_ERR(0, 1, __pyx_L1_error)
6926 __pyx_mstate->__pyx_empty_bytes = PyBytes_FromStringAndSize(
"", 0);
if (unlikely(!__pyx_mstate->__pyx_empty_bytes)) __PYX_ERR(0, 1, __pyx_L1_error)
6927 __pyx_mstate->__pyx_empty_unicode = PyUnicode_FromStringAndSize(
"", 0);
if (unlikely(!__pyx_mstate->__pyx_empty_unicode)) __PYX_ERR(0, 1, __pyx_L1_error)
6930 if (__Pyx_InitConstants(__pyx_mstate) < (0)) __PYX_ERR(0, 1, __pyx_L1_error)
6931 stringtab_initialized = 1;
6932 if (__Pyx_InitGlobals() < (0)) __PYX_ERR(0, 1, __pyx_L1_error)
6933 if (__pyx_module_is_main_cSubsurfaceTransportCoefficients) {
6934 if (PyObject_SetAttr(__pyx_m, __pyx_mstate_global->__pyx_n_u_name, __pyx_mstate_global->__pyx_n_u_main) < (0)) __PYX_ERR(0, 1, __pyx_L1_error)
6937 PyObject *modules = PyImport_GetModuleDict();
if (unlikely(!modules)) __PYX_ERR(0, 1, __pyx_L1_error)
6938 if (!PyDict_GetItemString(modules,
"cSubsurfaceTransportCoefficients")) {
6939 if (unlikely((PyDict_SetItemString(modules,
"cSubsurfaceTransportCoefficients", __pyx_m) < 0))) __PYX_ERR(0, 1, __pyx_L1_error)
6943 if (__Pyx_InitCachedBuiltins(__pyx_mstate) < (0)) __PYX_ERR(0, 1, __pyx_L1_error)
6945 if (__Pyx_InitCachedConstants(__pyx_mstate) < (0)) __PYX_ERR(0, 1, __pyx_L1_error)
6946 if (__Pyx_CreateCodeObjects(__pyx_mstate) < (0)) __PYX_ERR(0, 1, __pyx_L1_error)
6948 (void)__Pyx_modinit_Global_init_code(__pyx_mstate);
6949 (void)__Pyx_modinit_Variable_export_code(__pyx_mstate);
6950 (void)__Pyx_modinit_Function_export_code(__pyx_mstate);
6952 if (unlikely((__Pyx_modinit_Type_import_code(__pyx_mstate) < 0))) __PYX_ERR(0, 1, __pyx_L1_error)
6953 (void)__Pyx_modinit_Variable_import_code(__pyx_mstate);
6954 (void)__Pyx_modinit_Function_import_code(__pyx_mstate);
6955 if (__Pyx_InitAfterSharedUtility() < (0)) __PYX_ERR(0, 1, __pyx_L1_error)
6965 __pyx_t_1 = __Pyx_Import(__pyx_mstate_global->__pyx_n_u_numpy, 0, 0, NULL, 0);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3, __pyx_L1_error)
6966 __pyx_t_2 = __pyx_t_1;
6967 __Pyx_GOTREF(__pyx_t_2);
6968 if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_np, __pyx_t_2) < (0)) __PYX_ERR(0, 3, __pyx_L1_error)
6969 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
6978 __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_32cSubsurfaceTransportCoefficients_1calculateRusanovFluxSaturationEquationIncomp_PWC, 0, __pyx_mstate_global->__pyx_n_u_calculateRusanovFluxSaturationEq, NULL, __pyx_mstate_global->__pyx_n_u_cSubsurfaceTransportCoefficients, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[0]));
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 7, __pyx_L1_error)
6979 __Pyx_GOTREF(__pyx_t_2);
6980 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
6981 PyUnstable_Object_EnableDeferredRefcount(__pyx_t_2);
6983 if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_calculateRusanovFluxSaturationEq, __pyx_t_2) < (0)) __PYX_ERR(0, 7, __pyx_L1_error)
6984 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
6993 __pyx_t_2 = __Pyx_PyLong_From_int(((
int)0));
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 84, __pyx_L1_error)
6994 __Pyx_GOTREF(__pyx_t_2);
7004 PyObject* __pyx_temp[1] = {__pyx_t_2};
7005 __pyx_t_3 = __Pyx_PyTuple_FromArray(__pyx_temp, 1);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 81, __pyx_L1_error)
7006 __Pyx_GOTREF(__pyx_t_3);
7008 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
7009 __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_32cSubsurfaceTransportCoefficients_3piecewiseLinearTableLookup, 0, __pyx_mstate_global->__pyx_n_u_piecewiseLinearTableLookup, NULL, __pyx_mstate_global->__pyx_n_u_cSubsurfaceTransportCoefficients, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1]));
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 81, __pyx_L1_error)
7010 __Pyx_GOTREF(__pyx_t_2);
7011 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
7012 PyUnstable_Object_EnableDeferredRefcount(__pyx_t_2);
7014 __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_2, __pyx_t_3);
7015 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
7016 if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_piecewiseLinearTableLookup, __pyx_t_2) < (0)) __PYX_ERR(0, 81, __pyx_L1_error)
7017 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
7024 __pyx_t_2 = __Pyx_PyDict_NewPresized(0);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1, __pyx_L1_error)
7025 __Pyx_GOTREF(__pyx_t_2);
7026 if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_test, __pyx_t_2) < (0)) __PYX_ERR(0, 1, __pyx_L1_error)
7027 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
7033 __Pyx_XDECREF(__pyx_t_2);
7034 __Pyx_XDECREF(__pyx_t_3);
7036 if (__pyx_mstate->__pyx_d && stringtab_initialized) {
7037 __Pyx_AddTraceback(
"init cSubsurfaceTransportCoefficients", __pyx_clineno, __pyx_lineno, __pyx_filename);
7039 #if !CYTHON_USE_MODULE_STATE
7043 if (pystate_addmodule_run) {
7044 PyObject *tp, *value, *tb;
7045 __Pyx_PyErr_FetchException(&tp, &value, &tb);
7046 __Pyx_State_RemoveModule(&__pyx_moduledef);
7047 __Pyx_PyErr_RestoreException(tp, value, tb);
7050 }
else if (!PyErr_Occurred()) {
7051 PyErr_SetString(PyExc_ImportError,
"init cSubsurfaceTransportCoefficients");
7054 __Pyx_RefNannyFinishContext();
7055 #if CYTHON_PEP489_MULTI_PHASE_INIT
7056 return (__pyx_m != NULL) ? 0 : -1;
7064static int __Pyx_InitCachedBuiltins(__pyx_mstatetype *__pyx_mstate) {
7065 CYTHON_UNUSED_VAR(__pyx_mstate);
7068 __pyx_mstate->__pyx_umethod_PyDict_Type_items.type = (PyObject*)&PyDict_Type;
7069 __pyx_mstate->__pyx_umethod_PyDict_Type_items.method_name = &__pyx_mstate->__pyx_n_u_items;
7070 __pyx_mstate->__pyx_umethod_PyDict_Type_pop.type = (PyObject*)&PyDict_Type;
7071 __pyx_mstate->__pyx_umethod_PyDict_Type_pop.method_name = &__pyx_mstate->__pyx_n_u_pop;
7072 __pyx_mstate->__pyx_umethod_PyDict_Type_values.type = (PyObject*)&PyDict_Type;
7073 __pyx_mstate->__pyx_umethod_PyDict_Type_values.method_name = &__pyx_mstate->__pyx_n_u_values;
7078static int __Pyx_InitCachedConstants(__pyx_mstatetype *__pyx_mstate) {
7079 __Pyx_RefNannyDeclarations
7080 CYTHON_UNUSED_VAR(__pyx_mstate);
7081 __Pyx_RefNannySetupContext(
"__Pyx_InitCachedConstants", 0);
7082 __Pyx_RefNannyFinishContext();
7087static int __Pyx_InitConstants(__pyx_mstatetype *__pyx_mstate) {
7088 int __pyx_lineno = 0;
7089 const char *__pyx_filename = NULL;
7090 int __pyx_clineno = 0;
7091 CYTHON_UNUSED_VAR(__pyx_mstate);
7093 const struct {
const unsigned int length: 8; } str_length_index[] = {{1},{179},{8},{39},{34},{44},{4},{20},{12},{8},{8},{10},{8},{12},{8},{13},{18},{1},{4},{32},{48},{18},{6},{2},{13},{23},{37},{25},{6},{4},{1},{25},{13},{5},{13},{3},{3},{1},{26},{16},{33},{33},{7},{25},{33},{6},{2},{5},{5},{26},{3},{12},{4},{12},{3},{6},{15},{15},{9},{13},{12},{10},{5},{6},{1},{2},{1},{2}};
7094 const struct {
const unsigned int length: 8; } bytes_length_index[] = {{71},{219}};
7095 #ifndef CYTHON_COMPRESS_STRINGS
7096 #define CYTHON_COMPRESS_STRINGS 90
7098 #if (CYTHON_COMPRESS_STRINGS) == 1
7099static const char cstring[] =
"x\332\205SKO\024A\020\206\004\r\006\023\020\023o\232&>\220D\326l\202\306\233Q\330\215D\304\345\021=vjzjv[z\272g\372\261\273s0\361\310q\216\0349r\344gx\344\270?\303\237`\315>\310\002!Lf\346\353\256\252\256\357\353\352\352\217\273\306#\363\035\360l\263\360\035\243\231t,F%#\264\340Q\025\314y+\205G[\005i\326j\264\3267>l0\3201\263\370\013\205w\314\205H(p\016\0353\t\213\202T^j\346\213\014]\215m\047\2540\201i\304\230y\3032\212\233^\340;\250\231C_\r\330*hm<xi4\247\345R\267WY,-\221\310.V\253\233\240\034\326 \2169\305\241\016iV\324\2700\026ki R\260\026\n\226\200T#2\231f\306\372\351\260\220\202\357\334\210\310,e\013\356\2558\010\221\0136\001\201\207\026\264\253|\233\006\223D\n\211\332\273ZV\364\277F`9o\025}\372\266\2500|\027\373~\037\023\316\307\342\221\323\223\004-*LA\352!\2328\250\241GC:\304<\200\232\214=:O ]%\322\004\252\036\202+\264\220\246vipQ$x\270K\241\000%\202\"\021\373\301\2016\335\246\n\375\003\360\301\016\213\332 \322\n\267\2650i\306[?7\205\242\324\2344zK)#\020G\302\220)\216\013\214r\336V&\002\305s\352\003L)\375g\023t\014\266h\214\246\356\232y\307\020}\343\212M\242\243\362\240\225\306\336p\214N!!\205m\251o\211\221n\353{s\222_zL\035\035 \205\202:\254\332+\r:\r=\255o\254\343ci\023\217\033\357E7nS3\t\330\326w\004\264\300B\352\364^\200\330V\225\305\226\221\025\301\204\3616\307d\027\372 \243R\353l\330\226&\3056d\022\005\366\244\303\235\352\340\355!D\nw\2149\nYf\262\314\035}3t!\233\n\3329\217\177\344\\A\032\305\300\251\017s\036\254\351e\336\332\236\261G<F\355\244/\270\276:\355\215\246\224\350r\300\275Q\016\022\364E\023\2047\226.`\214\t\320\035r\036\254\357\202\n\350\372\375nQt\377\314\376\273?\303V\006s\313%\375\036\227\365\301\302\253S8\315\007\253kgO\316\362\363\331\301\352\353\263+\277\372\371\362y}\002s\017\2177\217}Y\2474_fg\356=\273x\272\373\027\006\363\017\246\336\305\343n\2717\005\277O>M\\\313\345\3132\257\340E\tc\303\332I\275\202\365\223\241\375\355\351\243)X)\247}oN\256\021\215\351.\026+\231\323H\033\032\314/],\275;\337\233J\363\274\334\273\244\036\253\032\317F0""\267p\374\276\\.\353\377\001\211\330\r\267";
7100 PyObject *data = __Pyx_DecompressString(cstring, 731, 1);
7101 #define __Pyx_DecompressString_LZSS_UNUSED
7102 if (unlikely(!data)) __PYX_ERR(0, 1, __pyx_L1_error)
7103 const char*
const bytes = __Pyx_PyBytes_AsString(data);
7104 #if !CYTHON_ASSUME_SAFE_MACROS
7105 if (likely(bytes));
else { Py_DECREF(data); __PYX_ERR(0, 1, __pyx_L1_error) }
7107 #elif (CYTHON_COMPRESS_STRINGS) > 0 && (CYTHON_COMPRESS_STRINGS) <= 90
7108static const char cstring[] =
"\377?Note th\377at Cytho\377n is del\377iberatel\377y strict\373er!\001n PEP\377-484 and\377 rejects\377 subclas\377ses of b\377uiltin t\377ypes. If\377 you nee?d to p%\000%\t\377then set\376\200\000e \047anno\177tation_<\000\377ing\047 dir\366b\000iv\242\000o Fa\377lse.add_\376%\000enumpy.\377_core.mu\376r\000array f\367ailg\003impo\373rt\033\tumath\366\021\016pr\202 us/c\377Subsurfa\177ceTrans:\001\377Coeffici\377ents.pyx\377Kbar__Py\365x\001\000D\226 _Nex\277tRef__\266\004e\377____func\336\004\001main\003\002od\273ul\025\002nam\035\002q\367ual\004\005test\2663\000is\310\001ou\273 e\377asyncio.\374\332\000\013\003sbbc_u~\202\035calcul\266@\377RusanovF\377luxSatur\362\320\"Er\000\331!Inco\377mp_PWCcloine_\241\000tr\362\000\277backco\020\000d\377dyebq_gl\277obal_q\205`e\375m\376\000Bounda\357ryEl\n\002sel\326\n\nLo|\000E\007\nie}s\234 erior\010\016z\242Cf\237\000gint\016\023\337isDOFo\005it\347ems\276@L\000alT\376\333amunmuwn\245nd\016_\224\004\022\005s\305\004n\263ExS\024\031\005In\002\034P\377aramsnQuwadr\326!ePo\274\000qsi\006\001\025\265%nSp\335`\373np\271\204\002omega\377piecewis\373eL\212@arTab\377leLookup\377poppskMo\377delFlagq\377_dVq_lam\377bda_barq\377_urowptr\377rwork_de\177nsity_n\001\013\361w\030\003F\000\000\006_tol\377safetyFa\377ctorsetd\377efaultst\377artvalue\377sxxvyyv\200\377\001\360\006\000 !\330\004\373\022\220\002\000\023\2201\330\013\377&\240a\240q\330\047)\377\250\026\250q\260\001\330\047\363(\250\000\002\002\0051\260\022\260\3671\330\047\001\003\004\014\210C\357\210t\2201D\000H\001\000\377\005\036\320\035N\310a\330\363\010\t\000\000\000\003\330\010\017\210\347v\220Q\000\004\n\001}\230A\376\031\005\022\220%\220q\330\010\357\022\220$\220/\003\022\220)\333\2301\r\001-\230\023\002/\240\331\021\033\001\000\004!\220\020\t,\230\\Z\014o\003\017\320\017\255\001\010\000\005\374\r\000\316\000\330\010\020\320\0205\221\260\205\000\345\000A\003#\222\001t\004\017\361\210\221\002\202\004\212\003\004\013\2106\017\220\022\2201";
7109 PyObject *data = __Pyx_DecompressString_LZSS(cstring, 978, 1347);
7110 #define __Pyx_DecompressString_UNUSED
7111 if (unlikely(!data)) __PYX_ERR(0, 1, __pyx_L1_error)
7112 const char*
const bytes = __Pyx_PyBytes_AsString(data);
7113 #if !CYTHON_ASSUME_SAFE_MACROS
7114 if (likely(bytes));
else { Py_DECREF(data); __PYX_ERR(0, 1, __pyx_L1_error) }
7117static const char bytes[] =
"?Note that Cython is deliberately stricter than PEP-484 and rejects subclasses of builtin types. If you need to pass subclasses then set the \047annotation_typing\047 directive to False.add_notenumpy._core.multiarray failed to importnumpy._core.umath failed to importproteus/cSubsurfaceTransportCoefficients.pyxKbar__Pyx_PyDict_NextRef__annotate____func____main____module____name____qualname____test___is_coroutineasyncio.coroutinesbbc_ucSubsurfaceTransportCoefficientscalculateRusanovFluxSaturationEquationIncomp_PWCcline_in_tracebackcolinddyebq_global_qtelementBoundaryElementselementBoundaryLocalElementBoundariesexteriorElementBoundariesfailedfluxginteriorElementBoundariesisDOFBoundaryitemsmaterialTypesmunmuwnnElementBoundaries_elementnElements_globalnExteriorElementBoundaries_globalnInteriorElementBoundaries_globalnParamsnQuadraturePoints_elementnQuadraturePoints_elementBoundarynSpacenpnumpyomegapiecewiseLinearTableLookuppoppskModelFlagq_dVq_lambda_barq_urowptrrwork_density_nrwork_density_wrwork_pskrwork_psk_tolsafetyFactorsetdefaultstartvaluesxxvyyv\200\001\360\006\000 !\330\004\022\220!\330\004\023\2201\330\013&\240a\240q\330\047)\250\026\250q\260\001\330\047(\250\001\330\047(\250\001\330\047(\250\001\330\0471\260\022\2601\330\0471\260\022\2601\330\004\014\210C\210t\2201\200\001\360H\001\000\005\036\320\035N\310a\330\010\t\330\010\t\330\010\t\330\010\t\330\010\017\210v\220Q\330\010\017\210v\220Q\330\010\017\210}\230A\330\010\t\330\010\t\330\010\022\220%\220q\330\010\022\220$\220a\330\010\t\330\010\022\220)\2301\330\010\022\220-\230q\330\010\022\220/\240\021\330\010\022\220/\240\021\330\010\022\220!\2201\330\010\022\220-\230q\330\010\022\220,\230a\330\010\t\330\010\t\330\010\t\330\010\t\330\010\t\330\010\t\330\010\017\320\017(\250\001\330\010\017\320\017(\250\001\330\010\017\320\017&\240a\330\010\020\320\0205\260Q\330\010\022\220!\2201\330\010\022\220#\220Q\330\010\022\220$\220a\330\010\017\210}\230A\330\010\022\220$\220a\330\010\022\220$\220a\330\004\013\2106\220""\022\2201";
7118 PyObject *data = NULL;
7119 #define __Pyx_DecompressString_UNUSED
7120 #define __Pyx_DecompressString_LZSS_UNUSED
7122 PyObject **stringtab = __pyx_mstate->__pyx_string_tab;
7124 for (
int i = 0; i < 68; i++) {
7125 Py_ssize_t bytes_length = str_length_index[i].length;
7126 PyObject *
string = PyUnicode_DecodeUTF8(bytes + pos, bytes_length, NULL);
7127 if (likely(
string) && i >= 6) PyUnicode_InternInPlace(&
string);
7128 if (unlikely(!
string)) {
7130 __PYX_ERR(0, 1, __pyx_L1_error)
7132 stringtab[i] = string;
7133 pos += bytes_length;
7135 for (
int i = 68; i < 70; i++) {
7136 Py_ssize_t bytes_length = bytes_length_index[i-68].length;
7137 PyObject *
string = PyBytes_FromStringAndSize(bytes + pos, bytes_length);
7138 stringtab[i] = string;
7139 pos += bytes_length;
7140 if (unlikely(!
string)) {
7142 __PYX_ERR(0, 1, __pyx_L1_error)
7146 for (Py_ssize_t i = 0; i < 70; i++) {
7147 if (unlikely(PyObject_Hash(stringtab[i]) == -1)) {
7148 __PYX_ERR(0, 1, __pyx_L1_error)
7151 #if CYTHON_IMMORTAL_CONSTANTS
7153 PyObject **table = stringtab + 68;
7154 for (Py_ssize_t i=0; i<2; ++i) {
7155 #if PY_VERSION_HEX >= 0x030F0000
7156 PyUnstable_SetImmortal(table[i]);
7157 #elif CYTHON_COMPILING_IN_CPYTHON_FREETHREADING
7158 if ((PY_SSIZE_T_MAX <= _Py_IMMORTAL_REFCNT_LOCAL))
break;
7159 #if PY_VERSION_HEX < 0x030E0000
7160 if (_Py_IsOwnedByCurrentThread(table[i]) && Py_REFCNT(table[i]) == 1)
7162 if (PyUnstable_Object_IsUniquelyReferenced(table[i]))
7165 Py_SET_REFCNT(table[i], ((Py_ssize_t)_Py_IMMORTAL_REFCNT_LOCAL + 1));
7168 if ((PY_SSIZE_T_MAX < _Py_IMMORTAL_INITIAL_REFCNT))
break;
7169 Py_SET_REFCNT(table[i], _Py_IMMORTAL_INITIAL_REFCNT);
7184 unsigned int argcount : 6;
7185 unsigned int num_posonly_args : 1;
7186 unsigned int num_kwonly_args : 1;
7187 unsigned int nlocals : 6;
7188 unsigned int flags : 10;
7189 unsigned int first_line : 7;
7190} __Pyx_PyCode_New_function_description;
7195static PyObject* __Pyx_PyCode_New(
7196 const __Pyx_PyCode_New_function_description descr,
7197 PyObject *
const *varnames,
7200 PyObject *line_table,
7201 PyObject *tuple_dedup_map
7205static int __Pyx_CreateCodeObjects(__pyx_mstatetype *__pyx_mstate) {
7206 PyObject* tuple_dedup_map = PyDict_New();
7207 if (unlikely(!tuple_dedup_map))
return -1;
7209 const __Pyx_PyCode_New_function_description descr = {35, 0, 0, 36, (
unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 7};
7210 PyObject*
const varnames[] = {__pyx_mstate->__pyx_n_u_safetyFactor, __pyx_mstate->__pyx_n_u_nSpace, __pyx_mstate->__pyx_n_u_pskModelFlag, __pyx_mstate->__pyx_n_u_nParams, __pyx_mstate->__pyx_n_u_rowptr, __pyx_mstate->__pyx_n_u_colind, __pyx_mstate->__pyx_n_u_materialTypes, __pyx_mstate->__pyx_n_u_muw, __pyx_mstate->__pyx_n_u_mun, __pyx_mstate->__pyx_n_u_omega, __pyx_mstate->__pyx_n_u_Kbar, __pyx_mstate->__pyx_n_u_b, __pyx_mstate->__pyx_n_u_rwork_psk, __pyx_mstate->__pyx_n_u_rwork_psk_tol, __pyx_mstate->__pyx_n_u_rwork_density_w, __pyx_mstate->__pyx_n_u_rwork_density_n, __pyx_mstate->__pyx_n_u_g, __pyx_mstate->__pyx_n_u_ebq_global_qt, __pyx_mstate->__pyx_n_u_q_lambda_bar, __pyx_mstate->__pyx_n_u_nElements_global, __pyx_mstate->__pyx_n_u_nElementBoundaries_element, __pyx_mstate->__pyx_n_u_nInteriorElementBoundaries_globa, __pyx_mstate->__pyx_n_u_nExteriorElementBoundaries_globa, __pyx_mstate->__pyx_n_u_nQuadraturePoints_element, __pyx_mstate->__pyx_n_u_nQuadraturePoints_elementBoundar, __pyx_mstate->__pyx_n_u_interiorElementBoundaries, __pyx_mstate->__pyx_n_u_exteriorElementBoundaries, __pyx_mstate->__pyx_n_u_elementBoundaryElements, __pyx_mstate->__pyx_n_u_elementBoundaryLocalElementBound, __pyx_mstate->__pyx_n_u_n, __pyx_mstate->__pyx_n_u_q_u, __pyx_mstate->__pyx_n_u_q_dV, __pyx_mstate->__pyx_n_u_isDOFBoundary, __pyx_mstate->__pyx_n_u_bc_u, __pyx_mstate->__pyx_n_u_flux, __pyx_mstate->__pyx_n_u_failed};
7211 __pyx_mstate_global->__pyx_codeobj_tab[0] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_proteus_cSubsurfaceTransportCoef, __pyx_mstate->__pyx_n_u_calculateRusanovFluxSaturationEq, __pyx_mstate->__pyx_kp_b_iso88591_H_Na_vQ_vQ_A_q_a_1_q_1_q_a_a_5Q, tuple_dedup_map);
if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[0]))
goto bad;
7214 const __Pyx_PyCode_New_function_description descr = {4, 0, 0, 6, (
unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 81};
7215 PyObject*
const varnames[] = {__pyx_mstate->__pyx_n_u_x, __pyx_mstate->__pyx_n_u_xv, __pyx_mstate->__pyx_n_u_yv, __pyx_mstate->__pyx_n_u_start, __pyx_mstate->__pyx_n_u_y, __pyx_mstate->__pyx_n_u_dy};
7216 __pyx_mstate_global->__pyx_codeobj_tab[1] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_proteus_cSubsurfaceTransportCoef, __pyx_mstate->__pyx_n_u_piecewiseLinearTableLookup, __pyx_mstate->__pyx_kp_b_iso88591_1_aq_q_1_1_1_1_Ct1, tuple_dedup_map);
if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1]))
goto bad;
7218 Py_DECREF(tuple_dedup_map);
7221 Py_DECREF(tuple_dedup_map);
7226static int __Pyx_InitGlobals(
void) {
7227 int __pyx_lineno = 0;
7228 const char *__pyx_filename = NULL;
7229 int __pyx_clineno = 0;
7231 if (likely(__Pyx_init_co_variables() == 0 && __Pyx_init_tpflags_variables() == 0));
else
7233 if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1, __pyx_L1_error)
7236 if (likely(__Pyx_init_assertions_enabled() == 0));
else
7238 if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1, __pyx_L1_error)
7247 #ifdef NPY_FEATURE_VERSION
7248 #ifndef NO_IMPORT_ARRAY
7249 if (unlikely(_import_array() == -1)) {
7250 PyErr_SetString(PyExc_ImportError,
"numpy.core.multiarray failed to import "
7251 "(auto-generated because you didn't call 'numpy.import_array()' after cimporting numpy; "
7252 "use '<void>numpy._import_array' to disable if you are certain you don't need it).");
7257 if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1, __pyx_L1_error)
7260 if (likely(__pyx_CommonTypesMetaclass_init(__pyx_m) == 0));
else
7262 if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1, __pyx_L1_error)
7265 #if CYTHON_COMPILING_IN_LIMITED_API
7267 PyObject *typesModule=NULL;
7268 typesModule = PyImport_ImportModule(
"types");
7270 __pyx_mstate_global->__Pyx_CachedMethodType = PyObject_GetAttrString(typesModule,
"MethodType");
7271 Py_DECREF(typesModule);
7276 if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1, __pyx_L1_error)
7284static int __Pyx_InitAfterSharedUtility(
void) {
7285 int __pyx_lineno = 0;
7286 const char *__pyx_filename = NULL;
7287 int __pyx_clineno = 0;
7289 if (likely(__pyx_CyFunction_init(__pyx_m) == 0));
else
7291 if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1, __pyx_L1_error)
7302#pragma warning( push )
7307#pragma warning( disable : 4127 )
7317static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(
const char *modname) {
7318 PyObject *m = NULL, *p = NULL;
7320 m = PyImport_ImportModule(modname);
7322 p = PyObject_GetAttrString(m,
"RefNannyAPI");
7324 r = PyLong_AsVoidPtr(p);
7328 return (__Pyx_RefNannyAPIStruct *)
r;
7333#if CYTHON_USE_EXC_INFO_STACK && CYTHON_FAST_THREAD_STATE
7334static _PyErr_StackItem *
7335__Pyx_PyErr_GetTopmostException(PyThreadState *tstate)
7337 _PyErr_StackItem *exc_info = tstate->exc_info;
7338 while ((exc_info->exc_value == NULL || exc_info->exc_value == Py_None) &&
7339 exc_info->previous_item != NULL)
7341 exc_info = exc_info->previous_item;
7348#if CYTHON_FAST_THREAD_STATE
7349static CYTHON_INLINE
void __Pyx__ExceptionSave(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) {
7350 #if CYTHON_USE_EXC_INFO_STACK && PY_VERSION_HEX >= 0x030B00a4
7351 _PyErr_StackItem *exc_info = __Pyx_PyErr_GetTopmostException(tstate);
7352 PyObject *exc_value = exc_info->exc_value;
7353 if (exc_value == NULL || exc_value == Py_None) {
7360 *type = (PyObject*) Py_TYPE(exc_value);
7362 *tb = PyException_GetTraceback(exc_value);
7364 #elif CYTHON_USE_EXC_INFO_STACK
7365 _PyErr_StackItem *exc_info = __Pyx_PyErr_GetTopmostException(tstate);
7366 *type = exc_info->exc_type;
7367 *value = exc_info->exc_value;
7368 *tb = exc_info->exc_traceback;
7373 *type = tstate->exc_type;
7374 *value = tstate->exc_value;
7375 *tb = tstate->exc_traceback;
7381static CYTHON_INLINE
void __Pyx__ExceptionReset(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb) {
7382 #if CYTHON_USE_EXC_INFO_STACK && PY_VERSION_HEX >= 0x030B00a4
7383 _PyErr_StackItem *exc_info = tstate->exc_info;
7384 PyObject *tmp_value = exc_info->exc_value;
7385 exc_info->exc_value = value;
7386 Py_XDECREF(tmp_value);
7390 PyObject *tmp_type, *tmp_value, *tmp_tb;
7391 #if CYTHON_USE_EXC_INFO_STACK
7392 _PyErr_StackItem *exc_info = tstate->exc_info;
7393 tmp_type = exc_info->exc_type;
7394 tmp_value = exc_info->exc_value;
7395 tmp_tb = exc_info->exc_traceback;
7396 exc_info->exc_type = type;
7397 exc_info->exc_value = value;
7398 exc_info->exc_traceback = tb;
7400 tmp_type = tstate->exc_type;
7401 tmp_value = tstate->exc_value;
7402 tmp_tb = tstate->exc_traceback;
7403 tstate->exc_type = type;
7404 tstate->exc_value = value;
7405 tstate->exc_traceback = tb;
7407 Py_XDECREF(tmp_type);
7408 Py_XDECREF(tmp_value);
7415#if CYTHON_COMPILING_IN_CPYTHON
7416static int __Pyx_InBases(PyTypeObject *a, PyTypeObject *b) {
7418 a = __Pyx_PyType_GetSlot(a, tp_base, PyTypeObject*);
7422 return b == &PyBaseObject_Type;
7424static CYTHON_INLINE
int __Pyx_IsSubtype(PyTypeObject *a, PyTypeObject *b) {
7426 if (a == b)
return 1;
7430 n = PyTuple_GET_SIZE(mro);
7431 for (i = 0; i <
n; i++) {
7432 if (PyTuple_GET_ITEM(mro, i) == (PyObject *)b)
7437 return __Pyx_InBases(a, b);
7439static CYTHON_INLINE
int __Pyx_IsAnySubtype2(PyTypeObject *cls, PyTypeObject *a, PyTypeObject *b) {
7441 if (cls == a || cls == b)
return 1;
7445 n = PyTuple_GET_SIZE(mro);
7446 for (i = 0; i <
n; i++) {
7447 PyObject *base = PyTuple_GET_ITEM(mro, i);
7448 if (base == (PyObject *)a || base == (PyObject *)b)
7453 return __Pyx_InBases(cls, a) || __Pyx_InBases(cls, b);
7458#if CYTHON_FAST_THREAD_STATE
7459static CYTHON_INLINE
void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb) {
7460#if PY_VERSION_HEX >= 0x030C00A6
7461 PyObject *tmp_value;
7462 assert(type == NULL || (value != NULL && type == (PyObject*) Py_TYPE(value)));
7464 #if CYTHON_COMPILING_IN_CPYTHON
7465 if (unlikely(((PyBaseExceptionObject*) value)->traceback != tb))
7467 PyException_SetTraceback(value, tb);
7469 tmp_value = tstate->current_exception;
7470 tstate->current_exception = value;
7471 Py_XDECREF(tmp_value);
7475 PyObject *tmp_type, *tmp_value, *tmp_tb;
7476 tmp_type = tstate->curexc_type;
7477 tmp_value = tstate->curexc_value;
7478 tmp_tb = tstate->curexc_traceback;
7479 tstate->curexc_type = type;
7480 tstate->curexc_value = value;
7481 tstate->curexc_traceback = tb;
7482 Py_XDECREF(tmp_type);
7483 Py_XDECREF(tmp_value);
7487static CYTHON_INLINE
void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) {
7488#if PY_VERSION_HEX >= 0x030C00A6
7489 PyObject* exc_value;
7490 exc_value = tstate->current_exception;
7491 tstate->current_exception = 0;
7496 *type = (PyObject*) Py_TYPE(exc_value);
7498 #if CYTHON_COMPILING_IN_CPYTHON
7499 *tb = ((PyBaseExceptionObject*) exc_value)->traceback;
7502 *tb = PyException_GetTraceback(exc_value);
7506 *type = tstate->curexc_type;
7507 *value = tstate->curexc_value;
7508 *tb = tstate->curexc_traceback;
7509 tstate->curexc_type = 0;
7510 tstate->curexc_value = 0;
7511 tstate->curexc_traceback = 0;
7517#if CYTHON_COMPILING_IN_CPYTHON
7518static CYTHON_INLINE
int __Pyx_inner_PyErr_GivenExceptionMatches2(PyObject *err, PyObject* exc_type1, PyObject *exc_type2) {
7520 return __Pyx_IsAnySubtype2((PyTypeObject*)err, (PyTypeObject*)exc_type1, (PyTypeObject*)exc_type2);
7522 return __Pyx_IsSubtype((PyTypeObject*)err, (PyTypeObject*)exc_type2);
7525static int __Pyx_PyErr_GivenExceptionMatchesTuple(PyObject *exc_type, PyObject *tuple) {
7527 assert(PyExceptionClass_Check(exc_type));
7528 n = PyTuple_GET_SIZE(tuple);
7529 for (i=0; i<
n; i++) {
7530 if (exc_type == PyTuple_GET_ITEM(tuple, i))
return 1;
7532 for (i=0; i<
n; i++) {
7533 PyObject *t = PyTuple_GET_ITEM(tuple, i);
7534 if (likely(PyExceptionClass_Check(t))) {
7535 if (__Pyx_inner_PyErr_GivenExceptionMatches2(exc_type, NULL, t))
return 1;
7541static CYTHON_INLINE
int __Pyx_PyErr_GivenExceptionMatches(PyObject *err, PyObject* exc_type) {
7542 if (likely(err == exc_type))
return 1;
7543 if (likely(PyExceptionClass_Check(err))) {
7544 if (likely(PyExceptionClass_Check(exc_type))) {
7545 return __Pyx_inner_PyErr_GivenExceptionMatches2(err, NULL, exc_type);
7546 }
else if (likely(PyTuple_Check(exc_type))) {
7547 return __Pyx_PyErr_GivenExceptionMatchesTuple(err, exc_type);
7551 return PyErr_GivenExceptionMatches(err, exc_type);
7553static CYTHON_INLINE
int __Pyx_PyErr_GivenExceptionMatches2(PyObject *err, PyObject *exc_type1, PyObject *exc_type2) {
7554 assert(PyExceptionClass_Check(exc_type1));
7555 assert(PyExceptionClass_Check(exc_type2));
7556 if (likely(err == exc_type1 || err == exc_type2))
return 1;
7557 if (likely(PyExceptionClass_Check(err))) {
7558 return __Pyx_inner_PyErr_GivenExceptionMatches2(err, exc_type1, exc_type2);
7560 return (PyErr_GivenExceptionMatches(err, exc_type1) || PyErr_GivenExceptionMatches(err, exc_type2));
7565#if CYTHON_FAST_THREAD_STATE
7566static int __Pyx_PyErr_ExceptionMatchesTuple(PyObject *exc_type, PyObject *tuple) {
7568 n = PyTuple_GET_SIZE(tuple);
7569 for (i=0; i<
n; i++) {
7570 if (exc_type == PyTuple_GET_ITEM(tuple, i))
return 1;
7572 for (i=0; i<
n; i++) {
7573 if (__Pyx_PyErr_GivenExceptionMatches(exc_type, PyTuple_GET_ITEM(tuple, i)))
return 1;
7577static CYTHON_INLINE
int __Pyx_PyErr_ExceptionMatchesInState(PyThreadState* tstate, PyObject* err) {
7580#if PY_VERSION_HEX >= 0x030C00A6
7581 PyObject *current_exception = tstate->current_exception;
7582 if (unlikely(!current_exception))
return 0;
7583 exc_type = (PyObject*) Py_TYPE(current_exception);
7584 if (exc_type == err)
return 1;
7586 exc_type = tstate->curexc_type;
7587 if (exc_type == err)
return 1;
7588 if (unlikely(!exc_type))
return 0;
7590 #if CYTHON_AVOID_BORROWED_REFS
7591 Py_INCREF(exc_type);
7593 if (unlikely(PyTuple_Check(err))) {
7594 result = __Pyx_PyErr_ExceptionMatchesTuple(exc_type, err);
7596 result = __Pyx_PyErr_GivenExceptionMatches(exc_type, err);
7598 #if CYTHON_AVOID_BORROWED_REFS
7599 Py_DECREF(exc_type);
7606#if CYTHON_FAST_THREAD_STATE
7607static int __Pyx__GetException(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb)
7609static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb)
7612 PyObject *local_type = NULL, *local_value, *local_tb = NULL;
7613#if CYTHON_FAST_THREAD_STATE
7614 PyObject *tmp_type, *tmp_value, *tmp_tb;
7615 #if PY_VERSION_HEX >= 0x030C0000
7616 local_value = tstate->current_exception;
7617 tstate->current_exception = 0;
7619 local_type = tstate->curexc_type;
7620 local_value = tstate->curexc_value;
7621 local_tb = tstate->curexc_traceback;
7622 tstate->curexc_type = 0;
7623 tstate->curexc_value = 0;
7624 tstate->curexc_traceback = 0;
7626#elif __PYX_LIMITED_VERSION_HEX >= 0x030C0000
7627 local_value = PyErr_GetRaisedException();
7629 PyErr_Fetch(&local_type, &local_value, &local_tb);
7631#if __PYX_LIMITED_VERSION_HEX >= 0x030C0000
7632 if (likely(local_value)) {
7633 local_type = (PyObject*) Py_TYPE(local_value);
7634 Py_INCREF(local_type);
7635 local_tb = PyException_GetTraceback(local_value);
7638 PyErr_NormalizeException(&local_type, &local_value, &local_tb);
7639#if CYTHON_FAST_THREAD_STATE
7640 if (unlikely(tstate->curexc_type))
7642 if (unlikely(PyErr_Occurred()))
7646 if (unlikely(PyException_SetTraceback(local_value, local_tb) < 0))
7650 Py_XINCREF(local_tb);
7651 Py_XINCREF(local_type);
7652 Py_XINCREF(local_value);
7654 *value = local_value;
7656#if CYTHON_FAST_THREAD_STATE
7657 #if CYTHON_USE_EXC_INFO_STACK
7659 _PyErr_StackItem *exc_info = tstate->exc_info;
7660 #if PY_VERSION_HEX >= 0x030B00a4
7661 tmp_value = exc_info->exc_value;
7662 exc_info->exc_value = local_value;
7665 Py_XDECREF(local_type);
7666 Py_XDECREF(local_tb);
7668 tmp_type = exc_info->exc_type;
7669 tmp_value = exc_info->exc_value;
7670 tmp_tb = exc_info->exc_traceback;
7671 exc_info->exc_type = local_type;
7672 exc_info->exc_value = local_value;
7673 exc_info->exc_traceback = local_tb;
7677 tmp_type = tstate->exc_type;
7678 tmp_value = tstate->exc_value;
7679 tmp_tb = tstate->exc_traceback;
7680 tstate->exc_type = local_type;
7681 tstate->exc_value = local_value;
7682 tstate->exc_traceback = local_tb;
7684 Py_XDECREF(tmp_type);
7685 Py_XDECREF(tmp_value);
7687#elif __PYX_LIMITED_VERSION_HEX >= 0x030b0000
7688 PyErr_SetHandledException(local_value);
7689 Py_XDECREF(local_value);
7690 Py_XDECREF(local_type);
7691 Py_XDECREF(local_tb);
7693 PyErr_SetExcInfo(local_type, local_value, local_tb);
7696#if __PYX_LIMITED_VERSION_HEX < 0x030C0000
7701 Py_XDECREF(local_type);
7702 Py_XDECREF(local_value);
7703 Py_XDECREF(local_tb);
7709#if CYTHON_COMPILING_IN_CPYTHON
7710static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw) {
7712 ternaryfunc call = Py_TYPE(func)->tp_call;
7713 if (unlikely(!call))
7714 return PyObject_Call(func, arg, kw);
7715 if (unlikely(Py_EnterRecursiveCall(
" while calling a Python object")))
7717 result = (*call)(func, arg, kw);
7718 Py_LeaveRecursiveCall();
7719 if (unlikely(!result) && unlikely(!PyErr_Occurred())) {
7722 "NULL result without error in PyObject_Call");
7729#if CYTHON_COMPILING_IN_CPYTHON
7730static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg) {
7731 PyObject *self, *result;
7733 cfunc = __Pyx_CyOrPyCFunction_GET_FUNCTION(func);
7734 self = __Pyx_CyOrPyCFunction_GET_SELF(func);
7735 if (unlikely(Py_EnterRecursiveCall(
" while calling a Python object")))
7737 result = cfunc(self, arg);
7738 Py_LeaveRecursiveCall();
7739 if (unlikely(!result) && unlikely(!PyErr_Occurred())) {
7742 "NULL result without error in PyObject_Call");
7749#if CYTHON_COMPILING_IN_LIMITED_API
7750static PyObject* __Pyx_PyObject_FastCall_fallback(PyObject *func, PyObject *
const*args,
size_t nargs, PyObject *kwargs) {
7751 PyObject *argstuple;
7752 PyObject *result = 0;
7754 argstuple = PyTuple_New((Py_ssize_t)nargs);
7755 if (unlikely(!argstuple))
return NULL;
7756 for (i = 0; i < nargs; i++) {
7758 if (__Pyx_PyTuple_SET_ITEM(argstuple, (Py_ssize_t)i, args[i]) != (0))
goto bad;
7760 result = __Pyx_PyObject_Call(func, argstuple, kwargs);
7762 Py_DECREF(argstuple);
7766#if CYTHON_VECTORCALL && !(CYTHON_COMPILING_IN_LIMITED_API || CYTHON_COMPILING_IN_PYPY)
7767 #if CYTHON_COMPILING_IN_CPYTHON
7768static CYTHON_INLINE vectorcallfunc __Pyx_PyVectorcall_Function(PyObject *callable) {
7769 PyTypeObject *tp = Py_TYPE(callable);
7770 #if defined(__Pyx_CyFunction_USED)
7771 if (__Pyx_CyFunction_CheckExact(callable)) {
7772 return __Pyx_CyFunction_func_vectorcall(callable);
7775 if (!PyType_HasFeature(tp, Py_TPFLAGS_HAVE_VECTORCALL)) {
7778 assert(PyCallable_Check(callable));
7779 Py_ssize_t offset = tp->tp_vectorcall_offset;
7782 memcpy(&ptr, (
char *) callable + offset,
sizeof(ptr));
7786 #define __Pyx_PyVectorcall_Function(callable) PyVectorcall_Function(callable)
7789static CYTHON_INLINE PyObject* __Pyx_PyObject_FastCallDict(PyObject *func, PyObject *
const *args,
size_t nargsf, PyObject *kwargs) {
7790 Py_ssize_t nargs = __Pyx_PyVectorcall_NARGS(nargsf);
7791#if CYTHON_COMPILING_IN_CPYTHON
7792 if (nargs == 0 && kwargs == NULL) {
7793 if (__Pyx_CyOrPyCFunction_Check(func) && likely( __Pyx_CyOrPyCFunction_GET_FLAGS(func) & METH_NOARGS))
7794 return __Pyx_PyObject_CallMethO(func, NULL);
7796 else if (nargs == 1 && kwargs == NULL) {
7797 if (__Pyx_CyOrPyCFunction_Check(func) && likely( __Pyx_CyOrPyCFunction_GET_FLAGS(func) & METH_O))
7798 return __Pyx_PyObject_CallMethO(func, args[0]);
7801 if (kwargs == NULL) {
7802 #if CYTHON_VECTORCALL
7803 #if CYTHON_COMPILING_IN_LIMITED_API || CYTHON_COMPILING_IN_PYPY
7804 return PyObject_Vectorcall(func, args, nargsf, NULL);
7806 vectorcallfunc
f = __Pyx_PyVectorcall_Function(func);
7808 return f(func, args, nargsf, NULL);
7814 return __Pyx_PyObject_Call(func, __pyx_mstate_global->__pyx_empty_tuple, kwargs);
7816 #if CYTHON_COMPILING_IN_LIMITED_API
7817 return __Pyx_PyObject_FastCall_fallback(func, args, (
size_t)nargs, kwargs);
7818 #elif CYTHON_COMPILING_IN_PYPY
7819 return PyObject_VectorcallDict(func, args, (
size_t) nargs, kwargs);
7821 return PyObject_VectorcallDict(func, args, nargsf, kwargs);
7826static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause) {
7827 PyObject* owned_instance = NULL;
7828 if (tb == Py_None) {
7830 }
else if (tb && !PyTraceBack_Check(tb)) {
7831 PyErr_SetString(PyExc_TypeError,
7832 "raise: arg 3 must be a traceback or None");
7835 if (value == Py_None)
7837 if (PyExceptionInstance_Check(type)) {
7839 PyErr_SetString(PyExc_TypeError,
7840 "instance exception may not have a separate value");
7844 type = (PyObject*) Py_TYPE(value);
7845 }
else if (PyExceptionClass_Check(type)) {
7846 PyObject *instance_class = NULL;
7847 if (value && PyExceptionInstance_Check(value)) {
7848 instance_class = (PyObject*) Py_TYPE(value);
7849 if (instance_class != type) {
7850 int is_subclass = PyObject_IsSubclass(instance_class, type);
7852 instance_class = NULL;
7853 }
else if (unlikely(is_subclass == -1)) {
7856 type = instance_class;
7860 if (!instance_class) {
7863 args = PyTuple_New(0);
7864 else if (PyTuple_Check(value)) {
7868 args = PyTuple_Pack(1, value);
7871 owned_instance = PyObject_Call(type, args, NULL);
7873 if (!owned_instance)
7875 value = owned_instance;
7876 if (!PyExceptionInstance_Check(value)) {
7877 PyErr_Format(PyExc_TypeError,
7878 "calling %R should have returned an instance of "
7879 "BaseException, not %R",
7880 type, Py_TYPE(value));
7885 PyErr_SetString(PyExc_TypeError,
7886 "raise: exception class must be a subclass of BaseException");
7890 PyObject *fixed_cause;
7891 if (cause == Py_None) {
7893 }
else if (PyExceptionClass_Check(cause)) {
7894 fixed_cause = PyObject_CallObject(cause, NULL);
7895 if (fixed_cause == NULL)
7897 }
else if (PyExceptionInstance_Check(cause)) {
7898 fixed_cause = cause;
7899 Py_INCREF(fixed_cause);
7901 PyErr_SetString(PyExc_TypeError,
7902 "exception causes must derive from "
7906 PyException_SetCause(value, fixed_cause);
7908 PyErr_SetObject(type, value);
7910#if PY_VERSION_HEX >= 0x030C00A6
7911 PyException_SetTraceback(value, tb);
7912#elif CYTHON_FAST_THREAD_STATE
7913 PyThreadState *tstate = __Pyx_PyThreadState_Current;
7914 PyObject* tmp_tb = tstate->curexc_traceback;
7917 tstate->curexc_traceback = tb;
7921 PyObject *tmp_type, *tmp_value, *tmp_tb;
7922 PyErr_Fetch(&tmp_type, &tmp_value, &tmp_tb);
7924 PyErr_Restore(tmp_type, tmp_value, tb);
7929 Py_XDECREF(owned_instance);
7934#if CYTHON_COMPILING_IN_CPYTHON
7935static CYTHON_INLINE
void __Pyx_copy_object_array(PyObject *
const *CYTHON_RESTRICT src, PyObject** CYTHON_RESTRICT dest, Py_ssize_t length) {
7938 for (i = 0; i < length; i++) {
7939 v = dest[i] = src[i];
7946#if !(PY_VERSION_HEX >= 0x030F0000 && !CYTHON_COMPILING_IN_LIMITED_API)
7947CYTHON_UNUSED
static PyObject *
7948__Pyx_PyTuple_FromArray(PyObject *
const *src, Py_ssize_t
n) {
7950 return __Pyx_NewRef(__pyx_mstate_global->__pyx_empty_tuple);
7952 PyObject *res = PyTuple_New(
n);
7953 if (unlikely(res == NULL))
return NULL;
7954 #if CYTHON_COMPILING_IN_CPYTHON
7955 __Pyx_copy_object_array(src, ((PyTupleObject*)res)->ob_item,
n);
7958 for (i = 0; i <
n; i++) {
7960 if (unlikely(__Pyx_PyTuple_SET_ITEM(res, i, src[i]) < (0))) {
7971#ifndef __Pyx_DEFINED_PyObject_CompareStrStrBoolEq
7972#define __Pyx_DEFINED_PyObject_CompareStrStrBoolEq
7973static CYTHON_INLINE
int __Pyx_PyObject_CompareStrStrBoolEq(PyObject* s1, PyObject* s2) {
7974 #if __PYX_LIMITED_VERSION_HEX >= 0x030e0000
7975 int result = PyUnicode_Equal(s1, s2);
7976 #if !CYTHON_COMPILING_IN_CPYTHON
7977 if (unlikely(result == -1))
return -1;
7979 if (result == 0)
goto __pyx_return_false;
else goto __pyx_return_true;
7981 int result = PyUnicode_Compare(s1, s2);
7982 if (unlikely((result == -1) && PyErr_Occurred()))
return -1;
7983 if (result == 0)
goto __pyx_return_true;
else goto __pyx_return_false;
7991static CYTHON_INLINE
int __Pyx_PyObject_CompareBoolEq_str_str(PyObject *op1, PyObject *op2,
int pyop) {
7992 CYTHON_UNUSED_VAR(pyop);
7993 if (unlikely(op1 == Py_None)) {
7994 if (op2 == Py_None)
goto __pyx_return_true;
else goto __pyx_return_false;
7996 if (unlikely(op2 == Py_None)) {
7997 if (op1 == Py_None)
goto __pyx_return_true;
else goto __pyx_return_false;
8000 if (likely(op1 != Py_None)) {
8001 if (op1 == op2)
goto __pyx_return_true;
8002 if (likely(op2 != Py_None)) {
8003 return __Pyx_PyObject_CompareStrStrBoolEq(op1, op2);
8008 if ((0))
goto __pyx_richcmp;
8009 if ((0))
goto __pyx_return_true;
8010 if ((0))
goto __pyx_return_false;
8012 return __Pyx_PyObject_RichCompareBool(op1, op2, Py_EQ);
8020#if CYTHON_VECTORCALL
8021static CYTHON_INLINE PyObject * __Pyx_GetKwValue_FASTCALL(PyObject *kwnames, PyObject *
const *kwvalues, PyObject *
s)
8023 Py_ssize_t i,
n = __Pyx_PyTuple_GET_SIZE(kwnames);
8024 #if !CYTHON_ASSUME_SAFE_SIZE
8025 if (unlikely(
n == -1))
return NULL;
8027 for (i = 0; i <
n; i++)
8029 PyObject *namei = __Pyx_PyTuple_GET_ITEM(kwnames, i);
8030 #if !CYTHON_ASSUME_SAFE_MACROS
8031 if (unlikely(!namei))
return NULL;
8033 if (
s == namei)
return kwvalues[i];
8035 for (i = 0; i <
n; i++)
8037 PyObject *namei = __Pyx_PyTuple_GET_ITEM(kwnames, i);
8038 #if !CYTHON_ASSUME_SAFE_MACROS
8039 if (unlikely(!namei))
return NULL;
8041 int eq = __Pyx_PyUnicode_Equals(
s, namei);
8042 if (unlikely(eq != 0)) {
8043 if (unlikely(eq < 0))
return NULL;
8049#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030d0000 || CYTHON_COMPILING_IN_LIMITED_API || CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_GRAAL
8050CYTHON_UNUSED
static PyObject *__Pyx_KwargsAsDict_FASTCALL(PyObject *kwnames, PyObject *
const *kwvalues) {
8051 Py_ssize_t i, nkwargs;
8053#if !CYTHON_ASSUME_SAFE_SIZE
8054 nkwargs = PyTuple_Size(kwnames);
8055 if (unlikely(nkwargs < 0))
return NULL;
8057 nkwargs = PyTuple_GET_SIZE(kwnames);
8059 dict = PyDict_New();
8060 if (unlikely(!dict))
8062 for (i=0; i<nkwargs; i++) {
8063#if !CYTHON_ASSUME_SAFE_MACROS
8064 PyObject *key = PyTuple_GetItem(kwnames, i);
8067 PyObject *key = PyTuple_GET_ITEM(kwnames, i);
8069 if (unlikely(PyDict_SetItem(dict, key, kwvalues[i]) < 0))
8081static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg) {
8082 PyObject *args[2] = {NULL, arg};
8083 return __Pyx_PyObject_FastCall(func, args+1, 1 | __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET);
8087static CYTHON_INLINE
int __Pyx_IgnoreGivenException(PyObject *given_exception, PyObject *ignorable_exception) {
8088 if (PyErr_GivenExceptionMatches(given_exception ? given_exception : PyErr_Occurred(), ignorable_exception)) {
8096#if CYTHON_USE_TYPE_SLOTS
8097static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name) {
8098 PyTypeObject* tp = Py_TYPE(obj);
8099 if (likely(tp->tp_getattro))
8100 return tp->tp_getattro(obj, attr_name);
8101 return PyObject_GetAttr(obj, attr_name);
8106#if CYTHON_COMPILING_IN_LIMITED_API && __PYX_LIMITED_VERSION_HEX < 0x030C0000
8107static PyObject *__Pyx_SelflessCall(PyObject *method, PyObject *args, PyObject *kwargs) {
8109 PyObject *selfless_args = PyTuple_GetSlice(args, 1, PyTuple_Size(args));
8110 if (unlikely(!selfless_args))
return NULL;
8111 result = PyObject_Call(method, selfless_args, kwargs);
8112 Py_DECREF(selfless_args);
8116static PyObject *__Pyx_SelflessCall(PyObject *method, PyObject *
const *args, Py_ssize_t nargs, PyObject *kwnames) {
8117 return PyObject_Vectorcall(method, args ? args+1 : NULL, nargs ? (
size_t) nargs-1 : 0, kwnames);
8120static PyMethodDef __Pyx_UnboundCMethod_Def = {
8121 "CythonUnboundCMethod",
8122 __PYX_REINTERPRET_FUNCION(PyCFunction, __Pyx_SelflessCall),
8123#if CYTHON_COMPILING_IN_LIMITED_API && __PYX_LIMITED_VERSION_HEX < 0x030C0000
8124 METH_VARARGS | METH_KEYWORDS,
8126 METH_FASTCALL | METH_KEYWORDS,
8130static int __Pyx_TryUnpackUnboundCMethod(__Pyx_CachedCFunction* target) {
8131 PyObject *method, *result=NULL;
8132 method = __Pyx_PyObject_GetAttrStr(target->type, *target->method_name);
8133 if (unlikely(!method))
8136#if CYTHON_COMPILING_IN_CPYTHON
8137 if (likely(__Pyx_TypeCheck(method, &PyMethodDescr_Type)))
8139 PyMethodDescrObject *descr = (PyMethodDescrObject*) method;
8140 target->func = descr->d_method->ml_meth;
8141 target->flag = descr->d_method->ml_flags & ~(METH_CLASS | METH_STATIC | METH_COEXIST);
8144#if CYTHON_COMPILING_IN_PYPY
8146 if (PyCFunction_Check(method))
8151#if CYTHON_COMPILING_IN_LIMITED_API || CYTHON_COMPILING_IN_PYPY
8152 self = PyObject_GetAttrString(method,
"__self__");
8153 if (!self && !__Pyx_IgnoreException(PyExc_AttributeError)) {
8157 self = PyCFunction_GET_SELF(method);
8159 self_found = (self && self != Py_None);
8160#if CYTHON_COMPILING_IN_LIMITED_API || CYTHON_COMPILING_IN_PYPY
8164 PyObject *unbound_method = PyCFunction_New(&__Pyx_UnboundCMethod_Def, method);
8165 if (unlikely(!unbound_method))
return -1;
8167 result = unbound_method;
8170#if !CYTHON_COMPILING_IN_CPYTHON_FREETHREADING
8171 if (unlikely(target->method)) {
8175 target->method = result;
8180#if CYTHON_COMPILING_IN_CPYTHON
8181static CYTHON_INLINE PyObject* __Pyx_CallUnboundCMethod0(__Pyx_CachedCFunction* cfunc, PyObject* self) {
8182 int was_initialized = __Pyx_CachedCFunction_GetAndSetInitializing(cfunc);
8183 if (likely(was_initialized == 2 && cfunc->func)) {
8184 if (likely(cfunc->flag == METH_NOARGS))
8185 return __Pyx_CallCFunction(cfunc, self, NULL);
8186 if (likely(cfunc->flag == METH_FASTCALL))
8187 return __Pyx_CallCFunctionFast(cfunc, self, NULL, 0);
8188 if (cfunc->flag == (METH_FASTCALL | METH_KEYWORDS))
8189 return __Pyx_CallCFunctionFastWithKeywords(cfunc, self, NULL, 0, NULL);
8190 if (likely(cfunc->flag == (METH_VARARGS | METH_KEYWORDS)))
8191 return __Pyx_CallCFunctionWithKeywords(cfunc, self, __pyx_mstate_global->__pyx_empty_tuple, NULL);
8192 if (cfunc->flag == METH_VARARGS)
8193 return __Pyx_CallCFunction(cfunc, self, __pyx_mstate_global->__pyx_empty_tuple);
8194 return __Pyx__CallUnboundCMethod0(cfunc, self);
8196#if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING
8197 else if (unlikely(was_initialized == 1)) {
8198 __Pyx_CachedCFunction tmp_cfunc = {
8203 tmp_cfunc.type = cfunc->type;
8204 tmp_cfunc.method_name = cfunc->method_name;
8205 return __Pyx__CallUnboundCMethod0(&tmp_cfunc, self);
8208 PyObject *result = __Pyx__CallUnboundCMethod0(cfunc, self);
8209 __Pyx_CachedCFunction_SetFinishedInitializing(cfunc);
8213static PyObject* __Pyx__CallUnboundCMethod0(__Pyx_CachedCFunction* cfunc, PyObject* self) {
8215 if (unlikely(!cfunc->method) && unlikely(__Pyx_TryUnpackUnboundCMethod(cfunc) < 0))
return NULL;
8216 result = __Pyx_PyObject_CallOneArg(cfunc->method, self);
8221static CYTHON_INLINE PyObject* __Pyx_PyDict_Items(PyObject* d) {
8222 return __Pyx_CallUnboundCMethod0(&__pyx_mstate_global->__pyx_umethod_PyDict_Type_items, d);
8226static CYTHON_INLINE PyObject* __Pyx_PyDict_Values(PyObject* d) {
8227 return __Pyx_CallUnboundCMethod0(&__pyx_mstate_global->__pyx_umethod_PyDict_Type_values, d);
8231#if CYTHON_AVOID_BORROWED_REFS
8232static int __Pyx_PyDict_NextRef(PyObject *p, PyObject **ppos, PyObject **pkey, PyObject **pvalue) {
8233 PyObject *next = NULL;
8236 PyObject *dictview = pkey ? __Pyx_PyDict_Items(p) : __Pyx_PyDict_Values(p);
8237 if (unlikely(!dictview))
goto bad;
8238 *ppos = PyObject_GetIter(dictview);
8239 Py_DECREF(dictview);
8241 *ppos = PyObject_GetIter(p);
8243 if (unlikely(!*ppos))
goto bad;
8245 next = PyIter_Next(*ppos);
8247 if (PyErr_Occurred())
goto bad;
8250 if (pkey && pvalue) {
8251 *pkey = __Pyx_PySequence_ITEM(next, 0);
8252 if (unlikely(*pkey))
goto bad;
8253 *pvalue = __Pyx_PySequence_ITEM(next, 1);
8254 if (unlikely(*pvalue))
goto bad;
8265#if !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX >= 0x030d0000
8266 PyErr_FormatUnraisable(
"Exception ignored in __Pyx_PyDict_NextRef");
8268 PyErr_WriteUnraisable(__pyx_mstate_global->__pyx_n_u_Pyx_PyDict_NextRef);
8270 if (pkey) *pkey = NULL;
8271 if (pvalue) *pvalue = NULL;
8275static int __Pyx_PyDict_NextRef(PyObject *p, Py_ssize_t *ppos, PyObject **pkey, PyObject **pvalue) {
8276 int result = PyDict_Next(p, ppos, pkey, pvalue);
8277 if (likely(result == 1)) {
8278 if (pkey) Py_INCREF(*pkey);
8279 if (pvalue) Py_INCREF(*pvalue);
8286static void __Pyx_RaiseDoubleKeywordsError(
8287 const char* func_name,
8290 PyErr_Format(PyExc_TypeError,
8291 "%s() got multiple values for keyword argument '%U'", func_name, kw_name);
8295#if CYTHON_COMPILING_IN_CPYTHON
8296static CYTHON_INLINE PyObject *__Pyx_CallUnboundCMethod2(__Pyx_CachedCFunction *cfunc, PyObject *self, PyObject *arg1, PyObject *arg2) {
8297 int was_initialized = __Pyx_CachedCFunction_GetAndSetInitializing(cfunc);
8298 if (likely(was_initialized == 2 && cfunc->func)) {
8299 PyObject *args[2] = {arg1, arg2};
8300 if (cfunc->flag == METH_FASTCALL) {
8301 return __Pyx_CallCFunctionFast(cfunc, self, args, 2);
8303 if (cfunc->flag == (METH_FASTCALL | METH_KEYWORDS))
8304 return __Pyx_CallCFunctionFastWithKeywords(cfunc, self, args, 2, NULL);
8306#if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING
8307 else if (unlikely(was_initialized == 1)) {
8308 __Pyx_CachedCFunction tmp_cfunc = {
8313 tmp_cfunc.type = cfunc->type;
8314 tmp_cfunc.method_name = cfunc->method_name;
8315 return __Pyx__CallUnboundCMethod2(&tmp_cfunc, self, arg1, arg2);
8318 PyObject *result = __Pyx__CallUnboundCMethod2(cfunc, self, arg1, arg2);
8319 __Pyx_CachedCFunction_SetFinishedInitializing(cfunc);
8323static PyObject* __Pyx__CallUnboundCMethod2(__Pyx_CachedCFunction* cfunc, PyObject* self, PyObject* arg1, PyObject* arg2){
8324 if (unlikely(!cfunc->func && !cfunc->method) && unlikely(__Pyx_TryUnpackUnboundCMethod(cfunc) < 0))
return NULL;
8325#if CYTHON_COMPILING_IN_CPYTHON
8326 if (cfunc->func && (cfunc->flag & METH_VARARGS)) {
8327 PyObject *result = NULL;
8328 PyObject *args = PyTuple_New(2);
8329 if (unlikely(!args))
return NULL;
8331 PyTuple_SET_ITEM(args, 0, arg1);
8333 PyTuple_SET_ITEM(args, 1, arg2);
8334 if (cfunc->flag & METH_KEYWORDS)
8335 result = __Pyx_CallCFunctionWithKeywords(cfunc, self, args, NULL);
8337 result = __Pyx_CallCFunction(cfunc, self, args);
8343 PyObject *args[4] = {NULL, self, arg1, arg2};
8344 return __Pyx_PyObject_FastCall(cfunc->method, args+1, 3 | __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET);
8349static int __Pyx_ValidateDuplicatePosArgs(
8351 PyObject **
const argnames[],
8352 PyObject **
const *first_kw_arg,
8353 const char* function_name)
8355 PyObject **
const *name = argnames;
8356 while (name != first_kw_arg) {
8357 PyObject *key = **name;
8358 int found = PyDict_Contains(kwds, key);
8359 if (unlikely(found)) {
8360 if (found == 1) __Pyx_RaiseDoubleKeywordsError(function_name, key);
8369#if CYTHON_USE_UNICODE_INTERNALS
8370static CYTHON_INLINE
int __Pyx_UnicodeKeywordsEqual(PyObject *s1, PyObject *s2) {
8372 Py_ssize_t len = PyUnicode_GET_LENGTH(s1);
8373 if (len != PyUnicode_GET_LENGTH(s2))
return 0;
8374 kind = PyUnicode_KIND(s1);
8375 if (kind != PyUnicode_KIND(s2))
return 0;
8376 const void *data1 = PyUnicode_DATA(s1);
8377 const void *data2 = PyUnicode_DATA(s2);
8378 return (memcmp(data1, data2, (
size_t) len * (
size_t) kind) == 0);
8381static int __Pyx_MatchKeywordArg_str(
8383 PyObject **
const argnames[],
8384 PyObject **
const *first_kw_arg,
8385 size_t *index_found,
8386 const char *function_name)
8388 PyObject **
const *name;
8389 #if CYTHON_USE_UNICODE_INTERNALS
8390 Py_hash_t key_hash = ((PyASCIIObject*)key)->hash;
8391 if (unlikely(key_hash == -1)) {
8392 key_hash = PyObject_Hash(key);
8393 if (unlikely(key_hash == -1))
8397 name = first_kw_arg;
8399 PyObject *name_str = **name;
8400 #if CYTHON_USE_UNICODE_INTERNALS
8401 if (key_hash == ((PyASCIIObject*)name_str)->hash && __Pyx_UnicodeKeywordsEqual(name_str, key)) {
8402 *index_found = (size_t) (name - argnames);
8406 #if CYTHON_ASSUME_SAFE_SIZE
8407 if (PyUnicode_GET_LENGTH(name_str) == PyUnicode_GET_LENGTH(key))
8410 int cmp = PyUnicode_Compare(name_str, key);
8411 if (cmp < 0 && unlikely(PyErr_Occurred()))
goto bad;
8413 *index_found = (size_t) (name - argnames);
8421 while (name != first_kw_arg) {
8422 PyObject *name_str = **name;
8423 #if CYTHON_USE_UNICODE_INTERNALS
8424 if (unlikely(key_hash == ((PyASCIIObject*)name_str)->hash)) {
8425 if (__Pyx_UnicodeKeywordsEqual(name_str, key))
8426 goto arg_passed_twice;
8429 #if CYTHON_ASSUME_SAFE_SIZE
8430 if (PyUnicode_GET_LENGTH(name_str) == PyUnicode_GET_LENGTH(key))
8433 if (unlikely(name_str == key))
goto arg_passed_twice;
8434 int cmp = PyUnicode_Compare(name_str, key);
8435 if (cmp < 0 && unlikely(PyErr_Occurred()))
goto bad;
8436 if (cmp == 0)
goto arg_passed_twice;
8443 __Pyx_RaiseDoubleKeywordsError(function_name, key);
8448static int __Pyx_MatchKeywordArg_nostr(
8450 PyObject **
const argnames[],
8451 PyObject **
const *first_kw_arg,
8452 size_t *index_found,
8453 const char *function_name)
8455 PyObject **
const *name;
8456 if (unlikely(!PyUnicode_Check(key)))
goto invalid_keyword_type;
8457 name = first_kw_arg;
8459 int cmp = PyObject_RichCompareBool(**name, key, Py_EQ);
8461 *index_found = (size_t) (name - argnames);
8464 if (unlikely(cmp == -1))
goto bad;
8468 while (name != first_kw_arg) {
8469 int cmp = PyObject_RichCompareBool(**name, key, Py_EQ);
8470 if (unlikely(cmp != 0)) {
8471 if (cmp == 1)
goto arg_passed_twice;
8478 __Pyx_RaiseDoubleKeywordsError(function_name, key);
8480invalid_keyword_type:
8481 PyErr_Format(PyExc_TypeError,
8482 "%.200s() keywords must be strings", function_name);
8487static CYTHON_INLINE
int __Pyx_MatchKeywordArg(
8489 PyObject **
const argnames[],
8490 PyObject **
const *first_kw_arg,
8491 size_t *index_found,
8492 const char *function_name)
8494 return likely(PyUnicode_CheckExact(key)) ?
8495 __Pyx_MatchKeywordArg_str(key, argnames, first_kw_arg, index_found, function_name) :
8496 __Pyx_MatchKeywordArg_nostr(key, argnames, first_kw_arg, index_found, function_name);
8498static void __Pyx_RejectUnknownKeyword(
8500 PyObject **
const argnames[],
8501 PyObject **
const *first_kw_arg,
8502 const char *function_name)
8504 #if CYTHON_AVOID_BORROWED_REFS
8505 PyObject *pos = NULL;
8509 PyObject *key = NULL;
8510 __Pyx_BEGIN_CRITICAL_SECTION(kwds);
8511 #if CYTHON_AVOID_BORROWED_REFS
8512 while (__Pyx_PyDict_NextRef(kwds, &pos, &key, NULL))
8514 (void) __Pyx_PyDict_NextRef;
8515 while (PyDict_Next(kwds, &pos, &key, NULL))
8518 PyObject**
const *name = first_kw_arg;
8519 while (*name && (**name != key)) name++;
8521 size_t index_found = 0;
8522 int cmp = __Pyx_MatchKeywordArg(key, argnames, first_kw_arg, &index_found, function_name);
8525 PyErr_Format(PyExc_TypeError,
8526 "%s() got an unexpected keyword argument '%U'",
8527 function_name, key);
8529 #if CYTHON_AVOID_BORROWED_REFS
8535 #if CYTHON_AVOID_BORROWED_REFS
8539 __Pyx_END_CRITICAL_SECTION();
8540 #if CYTHON_AVOID_BORROWED_REFS
8543 assert(PyErr_Occurred());
8545static int __Pyx_ParseKeywordDict(
8547 PyObject **
const argnames[],
8549 Py_ssize_t num_pos_args,
8550 Py_ssize_t num_kwargs,
8551 const char* function_name,
8552 int ignore_unknown_kwargs)
8554 PyObject**
const *name;
8555 PyObject**
const *first_kw_arg = argnames + num_pos_args;
8556 Py_ssize_t extracted = 0;
8557#if !CYTHON_COMPILING_IN_PYPY || defined(PyArg_ValidateKeywordArguments)
8558 if (unlikely(!PyArg_ValidateKeywordArguments(kwds)))
return -1;
8560 name = first_kw_arg;
8561 while (*name && num_kwargs > extracted) {
8562 PyObject * key = **name;
8565 #if __PYX_LIMITED_VERSION_HEX >= 0x030d0000
8566 found = PyDict_GetItemRef(kwds, key, &value);
8568 value = PyDict_GetItemWithError(kwds, key);
8573 if (unlikely(PyErr_Occurred()))
goto bad;
8577 if (unlikely(found < 0))
goto bad;
8578 values[name-argnames] = value;
8583 if (num_kwargs > extracted) {
8584 if (ignore_unknown_kwargs) {
8585 if (unlikely(__Pyx_ValidateDuplicatePosArgs(kwds, argnames, first_kw_arg, function_name) == -1))
8588 __Pyx_RejectUnknownKeyword(kwds, argnames, first_kw_arg, function_name);
8596static int __Pyx_ParseKeywordDictToDict(
8598 PyObject **
const argnames[],
8601 Py_ssize_t num_pos_args,
8602 const char* function_name)
8604 PyObject**
const *name;
8605 PyObject**
const *first_kw_arg = argnames + num_pos_args;
8607#if !CYTHON_COMPILING_IN_PYPY || defined(PyArg_ValidateKeywordArguments)
8608 if (unlikely(!PyArg_ValidateKeywordArguments(kwds)))
return -1;
8610 if (PyDict_Update(kwds2, kwds) < 0)
goto bad;
8611 name = first_kw_arg;
8613 PyObject *key = **name;
8615#if !CYTHON_COMPILING_IN_LIMITED_API && (PY_VERSION_HEX >= 0x030d00A2 || defined(PyDict_Pop))
8616 int found = PyDict_Pop(kwds2, key, &value);
8618 if (unlikely(found < 0))
goto bad;
8619 values[name-argnames] = value;
8621#elif __PYX_LIMITED_VERSION_HEX >= 0x030d0000
8622 int found = PyDict_GetItemRef(kwds2, key, &value);
8624 if (unlikely(found < 0))
goto bad;
8625 values[name-argnames] = value;
8626 if (unlikely(PyDict_DelItem(kwds2, key) < 0))
goto bad;
8629 #if CYTHON_COMPILING_IN_CPYTHON
8630 value = _PyDict_Pop(kwds2, key, kwds2);
8632 value = __Pyx_CallUnboundCMethod2(&__pyx_mstate_global->__pyx_umethod_PyDict_Type_pop, kwds2, key, kwds2);
8634 if (value == kwds2) {
8637 if (unlikely(!value))
goto bad;
8638 values[name-argnames] = value;
8643 len = PyDict_Size(kwds2);
8645 return __Pyx_ValidateDuplicatePosArgs(kwds, argnames, first_kw_arg, function_name);
8646 }
else if (unlikely(len == -1)) {
8653static int __Pyx_ParseKeywordsTuple(
8655 PyObject *
const *kwvalues,
8656 PyObject **
const argnames[],
8659 Py_ssize_t num_pos_args,
8660 Py_ssize_t num_kwargs,
8661 const char* function_name,
8662 int ignore_unknown_kwargs)
8664 PyObject *key = NULL;
8665 PyObject**
const * name;
8666 PyObject**
const *first_kw_arg = argnames + num_pos_args;
8667 for (Py_ssize_t pos = 0; pos < num_kwargs; pos++) {
8668#if CYTHON_AVOID_BORROWED_REFS
8669 key = __Pyx_PySequence_ITEM(kwds, pos);
8671 key = __Pyx_PyTuple_GET_ITEM(kwds, pos);
8673#if !CYTHON_ASSUME_SAFE_MACROS
8674 if (unlikely(!key))
goto bad;
8676 name = first_kw_arg;
8677 while (*name && (**name != key)) name++;
8679 PyObject *value = kwvalues[pos];
8680 values[name-argnames] = __Pyx_NewRef(value);
8682 size_t index_found = 0;
8683 int cmp = __Pyx_MatchKeywordArg(key, argnames, first_kw_arg, &index_found, function_name);
8685 PyObject *value = kwvalues[pos];
8686 values[index_found] = __Pyx_NewRef(value);
8688 if (unlikely(cmp == -1))
goto bad;
8690 PyObject *value = kwvalues[pos];
8691 if (unlikely(PyDict_SetItem(kwds2, key, value)))
goto bad;
8692 }
else if (!ignore_unknown_kwargs) {
8693 goto invalid_keyword;
8697 #if CYTHON_AVOID_BORROWED_REFS
8704 PyErr_Format(PyExc_TypeError,
8705 "%s() got an unexpected keyword argument '%U'",
8706 function_name, key);
8709 #if CYTHON_AVOID_BORROWED_REFS
8716static int __Pyx_ParseKeywords(
8718 PyObject *
const *kwvalues,
8719 PyObject **
const argnames[],
8722 Py_ssize_t num_pos_args,
8723 Py_ssize_t num_kwargs,
8724 const char* function_name,
8725 int ignore_unknown_kwargs)
8727 if (CYTHON_VECTORCALL && likely(PyTuple_Check(kwds)))
8728 return __Pyx_ParseKeywordsTuple(kwds, kwvalues, argnames, kwds2, values, num_pos_args, num_kwargs, function_name, ignore_unknown_kwargs);
8730 return __Pyx_ParseKeywordDictToDict(kwds, argnames, kwds2, values, num_pos_args, function_name);
8732 return __Pyx_ParseKeywordDict(kwds, argnames, values, num_pos_args, num_kwargs, function_name, ignore_unknown_kwargs);
8736static void __Pyx_RaiseArgtupleInvalid(
8737 const char* func_name,
8741 Py_ssize_t num_found)
8743 Py_ssize_t num_expected;
8744 const char *more_or_less;
8745 if (num_found < num_min) {
8746 num_expected = num_min;
8747 more_or_less =
"at least";
8749 num_expected = num_max;
8750 more_or_less =
"at most";
8753 more_or_less =
"exactly";
8755 PyErr_Format(PyExc_TypeError,
8756 "%.200s() takes %.8s %" CYTHON_FORMAT_SSIZE_T
"d positional argument%.1s (%" CYTHON_FORMAT_SSIZE_T
"d given)",
8757 func_name, more_or_less, num_expected,
8758 (num_expected == 1) ?
"" :
"s", num_found);
8762static void __Pyx_ArgTypeError(PyObject *obj, PyTypeObject *type,
const char *name,
int exact)
8764 __Pyx_TypeName type_name;
8765 __Pyx_TypeName obj_type_name;
8766 PyObject *extra_info = __pyx_mstate_global->__pyx_empty_unicode;
8767 int from_annotation_subclass = 0;
8768 if (unlikely(!type)) {
8769 PyErr_SetString(PyExc_SystemError,
"Missing type object");
8771 }
else if (exact == 2) {
8772 if (__Pyx_TypeCheck(obj, type)) {
8773 from_annotation_subclass = 1;
8774 extra_info = __pyx_mstate_global->__pyx_kp_u_Note_that_Cython_is_deliberately;
8777 type_name = __Pyx_PyType_GetFullyQualifiedName(type);
8778 #if CYTHON_COMPILING_IN_LIMITED_API && __PYX_LIMITED_VERSION_HEX < 0x030d0000
8779 if (unlikely(!type_name))
return;
8781 obj_type_name = __Pyx_PyType_GetFullyQualifiedName(Py_TYPE(obj));
8782 #if CYTHON_COMPILING_IN_LIMITED_API && __PYX_LIMITED_VERSION_HEX < 0x030d0000
8783 if (unlikely(!obj_type_name))
goto obj_type_name_failed;
8785 PyErr_Format(PyExc_TypeError,
8786 "Argument '%.200s' has incorrect type (expected " __Pyx_FMT_TYPENAME
", got " __Pyx_FMT_TYPENAME
")"
8787#
if __PYX_LIMITED_VERSION_HEX < 0x030C0000
8790 , name, type_name, obj_type_name
8791#
if __PYX_LIMITED_VERSION_HEX < 0x030C0000
8792 , (from_annotation_subclass ?
". " :
""), extra_info
8795#if __PYX_LIMITED_VERSION_HEX >= 0x030C0000
8796 if (exact == 2 && from_annotation_subclass) {
8799 vargs[0] = PyErr_GetRaisedException();
8800 vargs[1] = extra_info;
8801 res = PyObject_VectorcallMethod(__pyx_mstate_global->__pyx_kp_u_add_note, vargs, 2, NULL);
8803 PyErr_SetRaisedException(vargs[0]);
8806 __Pyx_DECREF_TypeName(obj_type_name);
8807#if CYTHON_COMPILING_IN_LIMITED_API && __PYX_LIMITED_VERSION_HEX < 0x030d0000
8808obj_type_name_failed:
8810 __Pyx_DECREF_TypeName(type_name);
8815static CYTHON_INLINE
int __Pyx_ArgTypeTest(PyObject *obj, PyTypeObject *type,
int none_allowed,
const char *name,
int exact) {
8816 if (likely(Py_IS_TYPE(obj, type) | (none_allowed && (obj == Py_None))))
8818 if (!exact && likely(type) && likely(__Pyx_TypeCheck(obj, type)))
8820 __Pyx_ArgTypeError(obj, type, name, exact);
8825#ifndef __PYX_HAVE_RT_ImportType_3_3_0
8826#define __PYX_HAVE_RT_ImportType_3_3_0
8827static PyTypeObject *__Pyx_ImportType_3_3_0(PyObject *module,
const char *module_name,
const char *class_name,
8828 size_t size,
size_t alignment,
enum __Pyx_ImportType_CheckSize_3_3_0 check_size)
8830 PyObject *result = 0;
8831 Py_ssize_t basicsize;
8832 Py_ssize_t itemsize;
8833#if defined(Py_LIMITED_API) || (defined(CYTHON_COMPILING_IN_LIMITED_API) && CYTHON_COMPILING_IN_LIMITED_API)
8834 PyObject *py_basicsize;
8835 PyObject *py_itemsize;
8837 result = PyObject_GetAttrString(module, class_name);
8840 if (!PyType_Check(result)) {
8841 PyErr_Format(PyExc_TypeError,
8842 "%.200s.%.200s is not a type object",
8843 module_name, class_name);
8846#if !( defined(Py_LIMITED_API) || (defined(CYTHON_COMPILING_IN_LIMITED_API) && CYTHON_COMPILING_IN_LIMITED_API) )
8847 basicsize = ((PyTypeObject *)result)->tp_basicsize;
8848 itemsize = ((PyTypeObject *)result)->tp_itemsize;
8851 return (PyTypeObject *)result;
8853 py_basicsize = PyObject_GetAttrString(result,
"__basicsize__");
8856 basicsize = PyLong_AsSsize_t(py_basicsize);
8857 Py_DECREF(py_basicsize);
8859 if (basicsize == (Py_ssize_t)-1 && PyErr_Occurred())
8861 py_itemsize = PyObject_GetAttrString(result,
"__itemsize__");
8864 itemsize = PyLong_AsSsize_t(py_itemsize);
8865 Py_DECREF(py_itemsize);
8867 if (itemsize == (Py_ssize_t)-1 && PyErr_Occurred())
8871 if (size % alignment) {
8872 alignment = size % alignment;
8874 if (itemsize < (Py_ssize_t)alignment)
8875 itemsize = (Py_ssize_t)alignment;
8877 if ((
size_t)(basicsize + itemsize) < size) {
8878 PyErr_Format(PyExc_ValueError,
8879 "%.200s.%.200s size changed, may indicate binary incompatibility. "
8880 "Expected %zd from C header, got %zd from PyObject",
8881 module_name, class_name, size, basicsize+itemsize);
8884 if (check_size == __Pyx_ImportType_CheckSize_Error_3_3_0 &&
8885 ((
size_t)basicsize > size || (
size_t)(basicsize + itemsize) < size)) {
8886 PyErr_Format(PyExc_ValueError,
8887 "%.200s.%.200s size changed, may indicate binary incompatibility. "
8888 "Expected %zd from C header, got %zd-%zd from PyObject",
8889 module_name, class_name, size, basicsize, basicsize+itemsize);
8892 else if (check_size == __Pyx_ImportType_CheckSize_Warn_3_3_0 && (
size_t)basicsize > size) {
8893 if (PyErr_WarnFormat(NULL, 0,
8894 "%.200s.%.200s size changed, may indicate binary incompatibility. "
8895 "Expected %zd from C header, got %zd from PyObject",
8896 module_name, class_name, size, basicsize) < 0) {
8900 return (PyTypeObject *)result;
8908#if __PYX_LIMITED_VERSION_HEX < 0x030d0000
8909static void __Pyx_PyObject_GetAttrStr_ClearAttributeError(
void) {
8910 __Pyx_PyThreadState_declare
8911 __Pyx_PyThreadState_assign
8912 if (likely(__Pyx_PyErr_ExceptionMatches(PyExc_AttributeError)))
8913 __Pyx_PyErr_Clear();
8916static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStrNoError(PyObject* obj, PyObject* attr_name) {
8918#if __PYX_LIMITED_VERSION_HEX >= 0x030d0000
8919 (void) PyObject_GetOptionalAttr(obj, attr_name, &result);
8922#if CYTHON_COMPILING_IN_CPYTHON && CYTHON_USE_TYPE_SLOTS
8923 PyTypeObject* tp = Py_TYPE(obj);
8924 if (likely(tp->tp_getattro == PyObject_GenericGetAttr)) {
8925 return _PyObject_GenericGetAttrWithDict(obj, attr_name, NULL, 1);
8928 result = __Pyx_PyObject_GetAttrStr(obj, attr_name);
8929 if (unlikely(!result)) {
8930 __Pyx_PyObject_GetAttrStr_ClearAttributeError();
8937#if __PYX_LIMITED_VERSION_HEX < 0x030d0000
8938static CYTHON_INLINE
int __Pyx_HasAttr(PyObject *o, PyObject *
n) {
8940 if (unlikely(!PyUnicode_Check(
n))) {
8941 PyErr_SetString(PyExc_TypeError,
8942 "hasattr(): attribute name must be string");
8945 r = __Pyx_PyObject_GetAttrStrNoError(o,
n);
8947 return (unlikely(PyErr_Occurred())) ? -1 : 0;
8956CYTHON_UNUSED
static PyObject *
8957__Pyx_PyList_FromArray(PyObject *
const *src, Py_ssize_t
n) {
8958 PyObject *res = PyList_New(
n);
8959 if (unlikely(res == NULL))
return NULL;
8960 #if CYTHON_COMPILING_IN_CPYTHON
8961 __Pyx_copy_object_array(src, ((PyListObject*)res)->ob_item,
n);
8964 for (i = 0; i <
n; i++) {
8966 if (unlikely(__Pyx_PyList_SET_ITEM(res, i, src[i]) < (0))) {
8976static int __Pyx__Import_GetModule(PyObject *qualname, PyObject **module) {
8977 PyObject *imported_module = PyImport_GetModule(qualname);
8978 if (unlikely(!imported_module)) {
8980 if (PyErr_Occurred()) {
8985 *
module = imported_module;
8988static int __Pyx__Import_Lookup(PyObject *qualname, PyObject *
const *imported_names, Py_ssize_t len_imported_names, PyObject **module) {
8989 PyObject *imported_module;
8990 PyObject *top_level_package_name;
8992 int status, module_found;
8993 Py_ssize_t dot_index;
8994 module_found = __Pyx__Import_GetModule(qualname, &imported_module);
8995 if (unlikely(!module_found || module_found == -1)) {
8997 return module_found;
8999 if (imported_names) {
9000 for (i = 0; i < len_imported_names; i++) {
9001 PyObject *imported_name = imported_names[i];
9002#if __PYX_LIMITED_VERSION_HEX < 0x030d0000
9003 int has_imported_attribute = PyObject_HasAttr(imported_module, imported_name);
9005 int has_imported_attribute = PyObject_HasAttrWithError(imported_module, imported_name);
9006 if (unlikely(has_imported_attribute == -1))
goto error;
9008 if (!has_imported_attribute) {
9012 *
module = imported_module;
9015 dot_index = PyUnicode_FindChar(qualname,
'.', 0, PY_SSIZE_T_MAX, 1);
9016 if (dot_index == -1) {
9017 *
module = imported_module;
9020 if (unlikely(dot_index == -2))
goto error;
9021 top_level_package_name = PyUnicode_Substring(qualname, 0, dot_index);
9022 if (unlikely(!top_level_package_name))
goto error;
9023 Py_DECREF(imported_module);
9024 status = __Pyx__Import_GetModule(top_level_package_name, module);
9025 Py_DECREF(top_level_package_name);
9028 Py_DECREF(imported_module);
9032 Py_DECREF(imported_module);
9036static PyObject *__Pyx__Import(PyObject *name, PyObject *
const *imported_names, Py_ssize_t len_imported_names, PyObject *qualname, PyObject *moddict,
int level) {
9037 PyObject *module = 0;
9038 PyObject *empty_dict = 0;
9039 PyObject *from_list = 0;
9044 module_found = __Pyx__Import_Lookup(qualname, imported_names, len_imported_names, &module);
9045 if (likely(module_found == 1)) {
9047 }
else if (unlikely(module_found == -1)) {
9050 #if !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX >= 0x030f00a6
9051 empty_dict = PyFrozenDict_New(NULL);
9053 empty_dict = PyDict_New();
9055 if (unlikely(!empty_dict))
9057 if (imported_names) {
9058 from_list = __Pyx_PyList_FromArray(imported_names, len_imported_names);
9059 if (unlikely(!from_list))
9063 const char* package_sep = strchr(__Pyx_MODULE_NAME,
'.');
9064 if (package_sep != (0)) {
9065 module = PyImport_ImportModuleLevelObject(
9066 name, moddict, empty_dict, from_list, 1);
9067 if (unlikely(!module)) {
9068 if (unlikely(!PyErr_ExceptionMatches(PyExc_ImportError)))
9076 module = PyImport_ImportModuleLevelObject(
9077 name, moddict, empty_dict, from_list, level);
9080 Py_XDECREF(from_list);
9081 Py_XDECREF(empty_dict);
9086static PyObject *__Pyx_Import(PyObject *name, PyObject *
const *imported_names, Py_ssize_t len_imported_names, PyObject *qualname,
int level) {
9087 return __Pyx__Import(name, imported_names, len_imported_names, qualname, __pyx_mstate_global->__pyx_d, level);
9091static CYTHON_INLINE PyObject *__Pyx_PyDict_SetDefault(PyObject *d, PyObject *key, PyObject *default_value) {
9093#if __PYX_LIMITED_VERSION_HEX >= 0x030F0000 || (!CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX >= 0x030d00A4)
9094 PyDict_SetDefaultRef(d, key, default_value, &value);
9095#elif CYTHON_COMPILING_IN_LIMITED_API && __PYX_LIMITED_VERSION_HEX >= 0x030C0000
9096 PyObject *args[] = {d, key, default_value};
9097 value = PyObject_VectorcallMethod(__pyx_mstate_global->__pyx_n_u_setdefault, args, 3 | PY_VECTORCALL_ARGUMENTS_OFFSET, NULL);
9098#elif CYTHON_COMPILING_IN_LIMITED_API
9099 value = PyObject_CallMethodObjArgs(d, __pyx_mstate_global->__pyx_n_u_setdefault, key, default_value, NULL);
9101 value = PyDict_SetDefault(d, key, default_value);
9102 if (unlikely(!value))
return NULL;
9109#if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING && PY_VERSION_HEX < 0x030F00a3
9110 static PyObject *__Pyx_PyImport_AddModuleObjectRef(PyObject *name) {
9111 PyObject *module_dict = PyImport_GetModuleDict();
9113 if (PyMapping_GetOptionalItem(module_dict, name, &m) < 0) {
9116 if (m != NULL && PyModule_Check(m)) {
9120 m = PyModule_NewObject(name);
9123 if (PyDict_CheckExact(module_dict)) {
9125 (void)PyDict_SetDefaultRef(module_dict, name, m, &new_m);
9129 if (PyObject_SetItem(module_dict, name, m) != 0) {
9136 static PyObject *__Pyx_PyImport_AddModuleRef(
const char *name) {
9137 if ((PY_VERSION_HEX >= 0x030E0000) && Py_Version >= 0x030E0100) {
9138 return PyImport_AddModuleRef(name);
9140 PyObject *py_name = PyUnicode_FromString(name);
9141 if (!py_name)
return NULL;
9142 PyObject *module = __Pyx_PyImport_AddModuleObjectRef(py_name);
9146#elif __PYX_LIMITED_VERSION_HEX < 0x030d0000
9147 static PyObject *__Pyx_PyImport_AddModuleRef(
const char *name) {
9148 PyObject *module = PyImport_AddModule(name);
9155static PyObject *__Pyx_FetchSharedCythonABIModule(
void) {
9156 return __Pyx_PyImport_AddModuleRef(__PYX_ABI_MODULE_NAME);
9160static int __Pyx_VerifyCachedType(PyObject *cached_type,
9162 Py_ssize_t expected_basicsize) {
9163 Py_ssize_t basicsize;
9164 if (!PyType_Check(cached_type)) {
9165 PyErr_Format(PyExc_TypeError,
9166 "Shared Cython type %.200s is not a type object", name);
9169 if (expected_basicsize == 0) {
9172#if CYTHON_COMPILING_IN_LIMITED_API && CYTHON_OPAQUE_OBJECTS
9173 if (expected_basicsize < 0) {
9174 basicsize = PyType_GetTypeDataSize((PyTypeObject*)cached_type);
9178 #if CYTHON_COMPILING_IN_LIMITED_API
9179 PyObject *py_basicsize;
9180 py_basicsize = PyObject_GetAttrString(cached_type,
"__basicsize__");
9181 if (unlikely(!py_basicsize))
return -1;
9182 basicsize = PyLong_AsSsize_t(py_basicsize);
9183 Py_DECREF(py_basicsize);
9184 py_basicsize = NULL;
9185 if (unlikely(basicsize == (Py_ssize_t)-1) && PyErr_Occurred())
return -1;
9187 basicsize = ((PyTypeObject*) cached_type)->tp_basicsize;
9190 if ((expected_basicsize >= 0) ?
9191 (basicsize != expected_basicsize) :
9192 (basicsize < -expected_basicsize)) {
9193 PyErr_Format(PyExc_TypeError,
9194 "Shared Cython type %.200s has the wrong size, try recompiling",
9202#if __PYX_LIMITED_VERSION_HEX < 0x030C0000
9203static PyObject* __Pyx_PyType_FromMetaclass(PyTypeObject *metaclass, PyObject *module, PyType_Spec *spec, PyObject *bases) {
9204 PyObject *result = __Pyx_PyType_FromModuleAndSpec(module, spec, bases);
9205 if (result && metaclass) {
9206 PyObject *old_tp = (PyObject*)Py_TYPE(result);
9207 Py_INCREF((PyObject*)metaclass);
9208 Py_SET_TYPE(result, metaclass);
9210 PyType_Modified((PyTypeObject*)result);
9215#define __Pyx_PyType_FromMetaclass(me, mo, s, b) PyType_FromMetaclass(me, mo, s, b)
9217static PyTypeObject *__Pyx_FetchCommonTypeFromSpec(PyTypeObject *metaclass, PyObject *module, PyType_Spec *spec, PyObject *bases) {
9218 PyObject *abi_module = NULL, *cached_type = NULL, *abi_module_dict, *new_cached_type, *py_object_name;
9219 int get_item_ref_result;
9220 const char* object_name = strrchr(spec->name,
'.');
9221 object_name = object_name ? object_name+1 : spec->name;
9222 py_object_name = PyUnicode_FromString(object_name);
9223 if (!py_object_name)
return NULL;
9224 abi_module = __Pyx_FetchSharedCythonABIModule();
9225 if (!abi_module)
goto done;
9226 abi_module_dict = PyModule_GetDict(abi_module);
9227 if (!abi_module_dict)
goto done;
9228 get_item_ref_result = __Pyx_PyDict_GetItemRef(abi_module_dict, py_object_name, &cached_type);
9229 if (get_item_ref_result == 1) {
9230 if (__Pyx_VerifyCachedType(
9233 spec->basicsize) < 0) {
9237 }
else if (unlikely(get_item_ref_result == -1)) {
9240 cached_type = __Pyx_PyType_FromMetaclass(
9242 CYTHON_USE_MODULE_STATE ? module : abi_module,
9244 if (unlikely(!cached_type))
goto bad;
9245 new_cached_type = __Pyx_PyDict_SetDefault(abi_module_dict, py_object_name, cached_type);
9246 if (unlikely(new_cached_type != cached_type)) {
9247 if (unlikely(!new_cached_type))
goto bad;
9248 Py_DECREF(cached_type);
9249 cached_type = new_cached_type;
9250 if (__Pyx_VerifyCachedType(
9253 spec->basicsize) < 0) {
9258 Py_DECREF(new_cached_type);
9261 Py_XDECREF(abi_module);
9262 Py_DECREF(py_object_name);
9263 assert(cached_type == NULL || PyType_Check(cached_type));
9264 return (PyTypeObject *) cached_type;
9266 Py_XDECREF(cached_type);
9272static PyObject* __pyx_CommonTypesMetaclass_get_module(CYTHON_UNUSED PyObject *self, CYTHON_UNUSED
void* context) {
9273 return PyUnicode_FromString(__PYX_ABI_MODULE_NAME);
9275#if __PYX_LIMITED_VERSION_HEX < 0x030A0000
9276static PyObject* __pyx_CommonTypesMetaclass_call(CYTHON_UNUSED PyObject *self, CYTHON_UNUSED PyObject *args, CYTHON_UNUSED PyObject *kwds) {
9277 PyErr_SetString(PyExc_TypeError,
"Cannot instantiate Cython internal types");
9280static int __pyx_CommonTypesMetaclass_setattr(CYTHON_UNUSED PyObject *self, CYTHON_UNUSED PyObject *attr, CYTHON_UNUSED PyObject *value) {
9281 PyErr_SetString(PyExc_TypeError,
"Cython internal types are immutable");
9285static PyGetSetDef __pyx_CommonTypesMetaclass_getset[] = {
9286 {
"__module__", __pyx_CommonTypesMetaclass_get_module, NULL, NULL, NULL},
9289static PyType_Slot __pyx_CommonTypesMetaclass_slots[] = {
9290 {Py_tp_getset, (
void *)__pyx_CommonTypesMetaclass_getset},
9291 #if __PYX_LIMITED_VERSION_HEX < 0x030A0000
9292 {Py_tp_call, (
void*)__pyx_CommonTypesMetaclass_call},
9293 {Py_tp_new, (
void*)__pyx_CommonTypesMetaclass_call},
9294 {Py_tp_setattro, (
void*)__pyx_CommonTypesMetaclass_setattr},
9298static PyType_Spec __pyx_CommonTypesMetaclass_spec = {
9299 __PYX_TYPE_MODULE_PREFIX
"_common_types_metatype",
9302 Py_TPFLAGS_IMMUTABLETYPE |
9303 Py_TPFLAGS_DISALLOW_INSTANTIATION |
9305 __pyx_CommonTypesMetaclass_slots
9307static int __pyx_CommonTypesMetaclass_init(PyObject *module) {
9308 __pyx_mstatetype *mstate = __Pyx_PyModule_GetState(module);
9309 PyObject *bases = PyTuple_Pack(1, &PyType_Type);
9310 if (unlikely(!bases)) {
9313 mstate->__pyx_CommonTypesMetaclassType = __Pyx_FetchCommonTypeFromSpec(NULL, module, &__pyx_CommonTypesMetaclass_spec, bases);
9315 if (unlikely(mstate->__pyx_CommonTypesMetaclassType == NULL)) {
9322#if CYTHON_COMPILING_IN_LIMITED_API
9323static CYTHON_INLINE
int __Pyx__IsSameCyOrCFunctionNoMethod(PyObject *func,
void (*cfunc)(
void)) {
9324 if (__Pyx_CyFunction_Check(func)) {
9325 return __Pyx_as_CyFunctionObject(func)->func_methoddef->ml_meth == (PyCFunction) cfunc;
9326 }
else if (PyCFunction_Check(func)) {
9327 return PyCFunction_GetFunction(func) == (PyCFunction) cfunc;
9331static CYTHON_INLINE
int __Pyx__IsSameCyOrCFunction(PyObject *func,
void (*cfunc)(
void)) {
9332 if ((PyObject*)Py_TYPE(func) == __pyx_mstate_global->__Pyx_CachedMethodType) {
9334 PyObject *newFunc = PyObject_GetAttr(func, __pyx_mstate_global->__pyx_n_u_func);
9335 if (unlikely(!newFunc)) {
9339 result = __Pyx__IsSameCyOrCFunctionNoMethod(newFunc, cfunc);
9343 return __Pyx__IsSameCyOrCFunctionNoMethod(func, cfunc);
9346static CYTHON_INLINE
int __Pyx__IsSameCyOrCFunction(PyObject *func,
void (*cfunc)(
void)) {
9347 if (PyMethod_Check(func)) {
9348 func = PyMethod_GET_FUNCTION(func);
9350 return __Pyx_CyOrPyCFunction_Check(func) && __Pyx_CyOrPyCFunction_GET_FUNCTION(func) == (PyCFunction) cfunc;
9353static CYTHON_INLINE
void __Pyx__CyFunction_SetClassObj(__pyx_CyFunctionObject*
f, PyObject* classobj) {
9354#if CYTHON_COMPILING_IN_LIMITED_API
9355 __Pyx_Py_XDECREF_SET(
9356 __Pyx__CyFunction_GetClassObj(
f),
9357 ((classobj) ? __Pyx_NewRef(classobj) : NULL));
9359 __Pyx_Py_XDECREF_SET(
9360 ((PyCMethodObject *) (
f))->mm_class,
9361 (PyTypeObject*)((classobj) ? __Pyx_NewRef(classobj) : NULL));
9364static CYTHON_INLINE PyObject *__Pyx_CyFunction_InitDefaults(PyObject *func, PyTypeObject *defaults_type) {
9365 __pyx_CyFunctionObject *m = __Pyx_as_CyFunctionObject(func);
9366 m->defaults = PyObject_CallObject((PyObject*)defaults_type, NULL);
9367 if (unlikely(!m->defaults))
9371static CYTHON_INLINE
void __Pyx_CyFunction_SetDefaultsTuple(PyObject *func, PyObject *tuple) {
9372 __pyx_CyFunctionObject *m = __Pyx_as_CyFunctionObject(func);
9373 m->defaults_tuple = tuple;
9376static CYTHON_INLINE
void __Pyx_CyFunction_SetDefaultsKwDict(PyObject *func, PyObject *dict) {
9377 __pyx_CyFunctionObject *m = __Pyx_as_CyFunctionObject(func);
9378 m->defaults_kwdict = dict;
9381static CYTHON_INLINE
void __Pyx_CyFunction_SetAnnotationsDict(PyObject *func, PyObject *dict) {
9382 __pyx_CyFunctionObject *m = __Pyx_as_CyFunctionObject(func);
9383 m->func_annotations = dict;
9388#if !CYTHON_USE_TYPE_SPECS
9390static int __Pyx_call_type_traverse(PyObject *o,
int always_call, visitproc visit,
void *arg) {
9392 PyTypeObject *base = __Pyx_PyObject_GetSlot(o, tp_base, PyTypeObject*);
9393 unsigned long flags = PyType_GetFlags(base);
9394 if (flags & Py_TPFLAGS_HEAPTYPE) {
9398 Py_VISIT((PyObject*)Py_TYPE(o));
9404#if CYTHON_COMPILING_IN_LIMITED_API
9405static PyObject *__Pyx_PyMethod_New(PyObject *func, PyObject *self, PyObject *typ) {
9407 CYTHON_UNUSED_VAR(typ);
9409 return __Pyx_NewRef(func);
9410 #if __PYX_LIMITED_VERSION_HEX >= 0x030C0000
9412 PyObject *args[] = {func, self};
9413 result = PyObject_Vectorcall(__pyx_mstate_global->__Pyx_CachedMethodType, args, 2, NULL);
9416 result = PyObject_CallFunctionObjArgs(__pyx_mstate_global->__Pyx_CachedMethodType, func, self, NULL);
9421static PyObject *__Pyx_PyMethod_New(PyObject *func, PyObject *self, PyObject *typ) {
9422 CYTHON_UNUSED_VAR(typ);
9424 return __Pyx_NewRef(func);
9425 return PyMethod_New(func, self);
9430#if CYTHON_VECTORCALL
9431static PyObject *__Pyx_PyVectorcall_FastCallDict_kw(PyObject *func, __pyx_vectorcallfunc vc, PyObject *
const *args,
size_t nargs, PyObject *kw)
9433 PyObject *res = NULL;
9436 PyObject **kwvalues;
9438 #if CYTHON_AVOID_BORROWED_REFS
9444 PyObject *key, *value;
9445 unsigned long keys_are_strings;
9446 #if !CYTHON_ASSUME_SAFE_SIZE
9447 Py_ssize_t nkw = PyDict_Size(kw);
9448 if (unlikely(nkw == -1))
return NULL;
9450 Py_ssize_t nkw = PyDict_GET_SIZE(kw);
9452 newargs = (PyObject **)PyMem_Malloc((nargs + (
size_t)nkw) *
sizeof(args[0]));
9453 if (unlikely(newargs == NULL)) {
9457 for (j = 0; j < nargs; j++) newargs[j] = args[j];
9458 kwnames = PyTuple_New(nkw);
9459 if (unlikely(kwnames == NULL)) {
9460 PyMem_Free(newargs);
9463 kwvalues = newargs + nargs;
9466 keys_are_strings = Py_TPFLAGS_UNICODE_SUBCLASS;
9467 while (__Pyx_PyDict_NextRef(kw, &pos, &key, &value)) {
9469 #if CYTHON_COMPILING_IN_LIMITED_API
9470 PyType_GetFlags(Py_TYPE(key));
9472 Py_TYPE(key)->tp_flags;
9474 #if !CYTHON_ASSUME_SAFE_MACROS
9475 if (unlikely(PyTuple_SetItem(kwnames, i, key) < 0))
goto cleanup;
9477 PyTuple_SET_ITEM(kwnames, i, key);
9479 kwvalues[i] = value;
9482 if (unlikely(!keys_are_strings)) {
9483 PyErr_SetString(PyExc_TypeError,
"keywords must be strings");
9486 res = vc(func, newargs, nargs, kwnames);
9488 #if CYTHON_AVOID_BORROWED_REFS
9492 for (i = 0; i < nkw; i++)
9493 Py_DECREF(kwvalues[i]);
9494 PyMem_Free(newargs);
9497static CYTHON_INLINE PyObject *__Pyx_PyVectorcall_FastCallDict(PyObject *func, __pyx_vectorcallfunc vc, PyObject *
const *args,
size_t nargs, PyObject *kw)
9499 Py_ssize_t kw_size =
9500 likely(kw == NULL) ?
9502#if !CYTHON_ASSUME_SAFE_SIZE
9505 PyDict_GET_SIZE(kw);
9508 return vc(func, args, nargs, NULL);
9510#if !CYTHON_ASSUME_SAFE_SIZE
9511 else if (unlikely(kw_size == -1)) {
9515 return __Pyx_PyVectorcall_FastCallDict_kw(func, vc, args, nargs, kw);
9521__Pyx_CyFunction_get_doc_locked(__pyx_CyFunctionObject *op)
9523 if (unlikely(op->func_doc == NULL)) {
9524#if CYTHON_COMPILING_IN_LIMITED_API
9525 const char *doc = op->func_methoddef->ml_doc;
9527 const char *doc = ((PyCFunctionObject*)op)->m_ml->ml_doc;
9530 op->func_doc = PyUnicode_FromString(doc);
9531 if (unlikely(op->func_doc == NULL))
9538 Py_INCREF(op->func_doc);
9539 return op->func_doc;
9542__Pyx_CyFunction_get_doc(PyObject *op_in,
void *closure) {
9544 __pyx_CyFunctionObject *op = __Pyx_as_CyFunctionObject(op_in);
9545 CYTHON_UNUSED_VAR(closure);
9546 __Pyx_BEGIN_CRITICAL_SECTION(op_in);
9547 result = __Pyx_CyFunction_get_doc_locked(op);
9548 __Pyx_END_CRITICAL_SECTION();
9552__Pyx_CyFunction_set_doc(PyObject *op_in, PyObject *value,
void *context)
9554 __pyx_CyFunctionObject *op = __Pyx_as_CyFunctionObject(op_in);
9555 CYTHON_UNUSED_VAR(context);
9556 if (value == NULL) {
9560 __Pyx_BEGIN_CRITICAL_SECTION(op_in);
9561 __Pyx_Py_XDECREF_SET(op->func_doc, value);
9562 __Pyx_END_CRITICAL_SECTION();
9566__Pyx_CyFunction_get_name_locked(__pyx_CyFunctionObject *op)
9568 if (unlikely(op->func_name == NULL)) {
9569#if CYTHON_COMPILING_IN_LIMITED_API
9570 const char *name = op->func_methoddef->ml_name;
9572 const char *name = ((PyCFunctionObject*)op)->m_ml->ml_name;
9574 op->func_name = PyUnicode_InternFromString(name);
9575 if (unlikely(op->func_name == NULL))
9578 Py_INCREF(op->func_name);
9579 return op->func_name;
9582__Pyx_CyFunction_get_name(PyObject *op,
void *context)
9584 PyObject *result = NULL;
9585 CYTHON_UNUSED_VAR(context);
9586 __Pyx_BEGIN_CRITICAL_SECTION(op);
9587 result = __Pyx_CyFunction_get_name_locked(__Pyx_as_CyFunctionObject(op));
9588 __Pyx_END_CRITICAL_SECTION();
9592__Pyx_CyFunction_set_name(PyObject *op_in, PyObject *value,
void *context)
9594 CYTHON_UNUSED_VAR(context);
9595 if (unlikely(value == NULL || !PyUnicode_Check(value))) {
9596 PyErr_SetString(PyExc_TypeError,
9597 "__name__ must be set to a string object");
9600 __pyx_CyFunctionObject *op = __Pyx_as_CyFunctionObject(op_in);
9602 __Pyx_BEGIN_CRITICAL_SECTION(op_in);
9603 __Pyx_Py_XDECREF_SET(op->func_name, value);
9604 __Pyx_END_CRITICAL_SECTION();
9608__Pyx_CyFunction_get_qualname(PyObject *op_in,
void *context)
9610 CYTHON_UNUSED_VAR(context);
9611 __pyx_CyFunctionObject *op = __Pyx_as_CyFunctionObject(op_in);
9613 __Pyx_BEGIN_CRITICAL_SECTION(op_in);
9614 Py_INCREF(op->func_qualname);
9615 result = op->func_qualname;
9616 __Pyx_END_CRITICAL_SECTION();
9620__Pyx_CyFunction_set_qualname(PyObject *op_in, PyObject *value,
void *context)
9622 CYTHON_UNUSED_VAR(context);
9623 if (unlikely(value == NULL || !PyUnicode_Check(value))) {
9624 PyErr_SetString(PyExc_TypeError,
9625 "__qualname__ must be set to a string object");
9628 __pyx_CyFunctionObject *op = __Pyx_as_CyFunctionObject(op_in);
9630 __Pyx_BEGIN_CRITICAL_SECTION(op_in);
9631 __Pyx_Py_XDECREF_SET(op->func_qualname, value);
9632 __Pyx_END_CRITICAL_SECTION();
9635#if CYTHON_COMPILING_IN_LIMITED_API && __PYX_LIMITED_VERSION_HEX < 0x030A0000
9637__Pyx_CyFunction_get_dict(__pyx_CyFunctionObject *op,
void *context)
9639 CYTHON_UNUSED_VAR(context);
9640 if (unlikely(op->func_dict == NULL)) {
9641 op->func_dict = PyDict_New();
9642 if (unlikely(op->func_dict == NULL))
9645 Py_INCREF(op->func_dict);
9646 return op->func_dict;
9650__Pyx_CyFunction_get_globals(PyObject *op_in,
void *context)
9652 CYTHON_UNUSED_VAR(context);
9653 __pyx_CyFunctionObject *op = __Pyx_as_CyFunctionObject(op_in);
9654 Py_INCREF(op->func_globals);
9655 return op->func_globals;
9658__Pyx_CyFunction_get_closure(PyObject *op,
void *context)
9660 CYTHON_UNUSED_VAR(op);
9661 CYTHON_UNUSED_VAR(context);
9666__Pyx_CyFunction_get_code(PyObject *op_in,
void *context)
9668 __pyx_CyFunctionObject *op = __Pyx_as_CyFunctionObject(op_in);
9669 PyObject* result = (op->func_code) ? op->func_code : Py_None;
9670 CYTHON_UNUSED_VAR(context);
9675__Pyx_CyFunction_init_defaults(__pyx_CyFunctionObject *op, PyObject *op_obj) {
9677 PyObject *res = op->defaults_getter(op_obj);
9680 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
9681 op->defaults_tuple = PyTuple_GET_ITEM(res, 0);
9682 Py_INCREF(op->defaults_tuple);
9683 op->defaults_kwdict = PyTuple_GET_ITEM(res, 1);
9684 Py_INCREF(op->defaults_kwdict);
9686 op->defaults_tuple = __Pyx_PySequence_ITEM(res, 0);
9687 if (unlikely(!op->defaults_tuple)) result = -1;
9689 op->defaults_kwdict = __Pyx_PySequence_ITEM(res, 1);
9690 if (unlikely(!op->defaults_kwdict)) result = -1;
9697__Pyx_CyFunction_set_defaults(PyObject *op_in, PyObject* value,
void *context) {
9698 __pyx_CyFunctionObject *op = __Pyx_as_CyFunctionObject(op_in);
9699 CYTHON_UNUSED_VAR(context);
9702 }
else if (unlikely(value != Py_None && !PyTuple_Check(value))) {
9703 PyErr_SetString(PyExc_TypeError,
9704 "__defaults__ must be set to a tuple object");
9707 PyErr_WarnEx(PyExc_RuntimeWarning,
"changes to cyfunction.__defaults__ will not "
9708 "currently affect the values used in function calls", 1);
9710 __Pyx_BEGIN_CRITICAL_SECTION(op_in);
9711 __Pyx_Py_XDECREF_SET(op->defaults_tuple, value);
9712 __Pyx_END_CRITICAL_SECTION();
9716__Pyx_CyFunction_get_defaults_locked(PyObject *op_in) {
9717 __pyx_CyFunctionObject *op = __Pyx_as_CyFunctionObject(op_in);
9718 PyObject* result = op->defaults_tuple;
9719 if (unlikely(!result)) {
9720 if (op->defaults_getter) {
9721 if (unlikely(__Pyx_CyFunction_init_defaults(op, op_in) < 0))
return NULL;
9722 result = op->defaults_tuple;
9731__Pyx_CyFunction_get_defaults(PyObject *op,
void *context) {
9732 PyObject* result = NULL;
9733 CYTHON_UNUSED_VAR(context);
9734 __Pyx_BEGIN_CRITICAL_SECTION(op);
9735 result = __Pyx_CyFunction_get_defaults_locked(op);
9736 __Pyx_END_CRITICAL_SECTION();
9740__Pyx_CyFunction_set_kwdefaults(PyObject *op_in, PyObject* value,
void *context) {
9741 __pyx_CyFunctionObject *op = __Pyx_as_CyFunctionObject(op_in);
9742 CYTHON_UNUSED_VAR(context);
9745 }
else if (unlikely(value != Py_None && !PyDict_Check(value))) {
9746 PyErr_SetString(PyExc_TypeError,
9747 "__kwdefaults__ must be set to a dict object");
9750 PyErr_WarnEx(PyExc_RuntimeWarning,
"changes to cyfunction.__kwdefaults__ will not "
9751 "currently affect the values used in function calls", 1);
9753 __Pyx_BEGIN_CRITICAL_SECTION(op_in);
9754 __Pyx_Py_XDECREF_SET(op->defaults_kwdict, value);
9755 __Pyx_END_CRITICAL_SECTION();
9759__Pyx_CyFunction_get_kwdefaults_locked(PyObject *op_in) {
9760 __pyx_CyFunctionObject *op = __Pyx_as_CyFunctionObject(op_in);
9761 PyObject* result = op->defaults_kwdict;
9762 if (unlikely(!result)) {
9763 if (op->defaults_getter) {
9764 if (unlikely(__Pyx_CyFunction_init_defaults(op, op_in) < 0))
return NULL;
9765 result = op->defaults_kwdict;
9774__Pyx_CyFunction_get_kwdefaults(PyObject *op,
void *context) {
9776 CYTHON_UNUSED_VAR(context);
9777 __Pyx_BEGIN_CRITICAL_SECTION(op);
9778 result = __Pyx_CyFunction_get_kwdefaults_locked(op);
9779 __Pyx_END_CRITICAL_SECTION();
9782static int __Pyx_CyFunction_set_annotate_in_dict_if_exists(PyObject *op_in, PyObject *value);
9784__Pyx_CyFunction_set_annotations(PyObject *op_in, PyObject* value,
void *context) {
9785 CYTHON_UNUSED_VAR(context);
9786 if (!value || value == Py_None) {
9788 }
else if (unlikely(!PyDict_Check(value))) {
9789 PyErr_SetString(PyExc_TypeError,
9790 "__annotations__ must be set to a dict object");
9793 __pyx_CyFunctionObject *op = __Pyx_as_CyFunctionObject(op_in);
9795 __Pyx_BEGIN_CRITICAL_SECTION(op_in);
9796 __Pyx_Py_XDECREF_SET(op->func_annotations, value);
9797 __Pyx_END_CRITICAL_SECTION();
9798 if (unlikely(__Pyx_CyFunction_set_annotate_in_dict_if_exists(op_in, Py_None) < 0))
return -1;
9802__Pyx_CyFunction_get_dict_if_exists(PyObject *op_in, PyObject **dict) {
9805#if CYTHON_COMPILING_IN_PYPY
9806 *dict = PyObject_GenericGetDict(op_in, NULL);
9807#elif CYTHON_COMPILING_IN_LIMITED_API || PY_VERSION_HEX < 0x030C0000
9808 *dict = __Pyx_as_CyFunctionObject(op_in)->func_dict;
9810 PyObject **dictptr = _PyObject_GetDictPtr(op_in);
9811 *dict = likely(dictptr) ? *dictptr : NULL;
9813 return *dict ? 1 : 0;
9816__Pyx_CyFunction_get_annotate_from_dict_if_exists(PyObject *op_in, PyObject **annotate) {
9820 dict_found = __Pyx_CyFunction_get_dict_if_exists(op_in, &dict);
9821 if (!dict_found)
return 0;
9822 return __Pyx_PyDict_GetItemRef(dict, __pyx_mstate_global->__pyx_n_u_annotate, annotate);
9825__Pyx_CyFunction_set_annotate_in_dict_if_exists(PyObject *op_in, PyObject *value) {
9828 dict_found = __Pyx_CyFunction_get_dict_if_exists(op_in, &dict);
9829 if (!dict_found)
return 0;
9831 return PyDict_SetItem(dict, __pyx_mstate_global->__pyx_n_u_annotate, value);
9833#if !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX >= 0x030d0000
9834 return PyDict_Pop(dict, __pyx_mstate_global->__pyx_n_u_annotate, NULL);
9836 int result = PyDict_Contains(dict, __pyx_mstate_global->__pyx_n_u_annotate);
9838 result = PyDict_DelItem(dict, __pyx_mstate_global->__pyx_n_u_annotate);
9845__Pyx_CyFunction_set_annotate_in_dict(PyObject *op_in, PyObject *value) {
9848#if CYTHON_COMPILING_IN_LIMITED_API && __PYX_LIMITED_VERSION_HEX < 0x030A0000
9849 dict = __Pyx_CyFunction_get_dict(__Pyx_as_CyFunctionObject(op_in), NULL);
9851 dict = PyObject_GenericGetDict(op_in, NULL);
9853 if (unlikely(!dict))
return -1;
9854 result = PyDict_SetItem(dict, __pyx_mstate_global->__pyx_n_u_annotate, value);
9859__Pyx_CyFunction_get_annotations_locked(__pyx_CyFunctionObject *op) {
9860 PyObject* result = op->func_annotations;
9861 if (unlikely(!result)) {
9862 result = PyDict_New();
9863 if (unlikely(!result))
return NULL;
9864 op->func_annotations = result;
9870__Pyx_CyFunction_get_annotations(PyObject *op_in,
void *context) {
9871 PyObject *annotate = NULL;
9872 PyObject *result = NULL;
9873 __pyx_CyFunctionObject *op = __Pyx_as_CyFunctionObject(op_in);
9874 CYTHON_UNUSED_VAR(context);
9875 __Pyx_BEGIN_CRITICAL_SECTION(op_in);
9876 result = __Pyx_XNewRef(op->func_annotations);
9877 __Pyx_END_CRITICAL_SECTION();
9878 if (result)
return result;
9879 if (unlikely(__Pyx_CyFunction_get_annotate_from_dict_if_exists(op_in, &annotate) < 0))
return NULL;
9880 if (!annotate || annotate == Py_None) {
9881 Py_XDECREF(annotate);
9882 __Pyx_BEGIN_CRITICAL_SECTION(op_in);
9883 result = __Pyx_CyFunction_get_annotations_locked(op);
9884 __Pyx_END_CRITICAL_SECTION();
9887 PyObject *format = PyLong_FromLong(1L);
9888 if (likely(format)) {
9889 if (!Py_EnterRecursiveCall(
" cyfunction __annotations__.__get__")) {
9890 result = __Pyx_PyObject_CallOneArg(annotate, format);
9891 Py_LeaveRecursiveCall();
9895 Py_DECREF(annotate);
9896 if (unlikely(!result))
return NULL;
9897 if (unlikely(!PyDict_Check(result))) {
9898 PyErr_SetString(PyExc_TypeError,
"__annotate__ must return a dict");
9902 __Pyx_BEGIN_CRITICAL_SECTION(op_in);
9903 __Pyx_Py_XDECREF_SET(op->func_annotations, __Pyx_NewRef(result));
9904 __Pyx_END_CRITICAL_SECTION();
9907static PyObject *__Pyx_CyFunction_annotate_impl(PyObject *self, PyObject *arg) {
9908 CYTHON_UNUSED_VAR(arg);
9909 if (unlikely(!self)) {
9910 PyErr_SetString(PyExc_SystemError,
"cython __annotate__ called without 'self' argument");
9914 if (Py_EnterRecursiveCall(
" in cyfunction annotate")) {
9917 result = __Pyx_CyFunction_get_annotations(self, NULL);
9918 Py_LeaveRecursiveCall();
9922__Pyx_CyFunction_get_annotate(PyObject *op_in,
void *context);
9924__Pyx_CyFunction_set_annotate(PyObject *op_in, PyObject* value,
void *context) {
9925 CYTHON_UNUSED_VAR(context);
9926 if (value == NULL) {
9927 PyErr_SetString(PyExc_TypeError,
"__annotate__ cannot be deleted");
9930 if (unlikely(value != Py_None && !PyCallable_Check(value))) {
9931 PyErr_SetString(PyExc_TypeError,
"__annotate__ must be callable or None");
9934 if (unlikely(__Pyx_TypeCheck(value, &PyCFunction_Type))) {
9935#if !CYTHON_ASSUME_SAFE_MACROS && !CYTHON_COMPILING_IN_PYPY
9936 PyCFunction cfunction = PyCFunction_GetFunction(value);
9937 if (unlikely(!cfunction))
return -1;
9938 PyObject *value_self = PyCFunction_GetSelf(value);
9939 if (unlikely(!value_self && PyErr_Occurred()))
return -1;
9941 PyCFunction cfunction = PyCFunction_GET_FUNCTION(value);
9942 PyObject *value_self = PyCFunction_GET_SELF(value);
9944 if (cfunction == __Pyx_CyFunction_annotate_impl && value_self == op_in) {
9945 return __Pyx_CyFunction_set_annotate_in_dict_if_exists(op_in, NULL);
9948 if (value != Py_None) {
9949 __pyx_CyFunctionObject *op = __Pyx_as_CyFunctionObject(op_in);
9950 __Pyx_BEGIN_CRITICAL_SECTION(op_in);
9951 Py_CLEAR(op->func_annotations);
9952 __Pyx_END_CRITICAL_SECTION();
9954 return __Pyx_CyFunction_set_annotate_in_dict(op_in, value);
9956#if __PYX_LIMITED_VERSION_HEX < 0x030B0000
9958__Pyx_CyFunction_get_is_coroutine_value(__pyx_CyFunctionObject *op) {
9959 int is_coroutine = op->flags & __Pyx_CYFUNCTION_COROUTINE;
9961 PyObject *is_coroutine_value, *module, *fromlist, *marker = __pyx_mstate_global->__pyx_n_u_is_coroutine;
9962 fromlist = PyList_New(1);
9963 if (unlikely(!fromlist))
return NULL;
9965#if CYTHON_ASSUME_SAFE_MACROS
9966 PyList_SET_ITEM(fromlist, 0, marker);
9968 if (unlikely(PyList_SetItem(fromlist, 0, marker) < 0)) {
9969 Py_DECREF(fromlist);
9973 module = PyImport_ImportModuleLevelObject(__pyx_mstate_global->__pyx_n_u_asyncio_coroutines, NULL, NULL, fromlist, 0);
9974 Py_DECREF(fromlist);
9975 if (unlikely(!module)) {
9976 goto ignore_or_error;
9978 is_coroutine_value = __Pyx_PyObject_GetAttrStr(module, marker);
9980 if (likely(is_coroutine_value)) {
9981 return is_coroutine_value;
9984 if (!__Pyx_IgnoreException(PyExc_Exception)) {
9988 return __Pyx_PyBool_FromLong(is_coroutine);
9991__Pyx_CyFunction_get_is_coroutine(PyObject *op_in,
void *context) {
9992 __pyx_CyFunctionObject *op = __Pyx_as_CyFunctionObject(op_in);
9994 CYTHON_UNUSED_VAR(context);
9995 if (op->func_is_coroutine) {
9996 return __Pyx_NewRef(op->func_is_coroutine);
9998 result = __Pyx_CyFunction_get_is_coroutine_value(op);
9999 if (unlikely(!result))
10001 __Pyx_BEGIN_CRITICAL_SECTION(op_in);
10002 if (op->func_is_coroutine) {
10004 result = __Pyx_NewRef(op->func_is_coroutine);
10006 op->func_is_coroutine = __Pyx_NewRef(result);
10008 __Pyx_END_CRITICAL_SECTION();
10012static void __Pyx_CyFunction_raise_argument_count_error(PyObject *func,
const char* message, Py_ssize_t size) {
10013#if CYTHON_COMPILING_IN_LIMITED_API
10014 PyObject *py_name = __Pyx_CyFunction_get_name(func, NULL);
10015 if (!py_name)
return;
10016 PyErr_Format(PyExc_TypeError,
10017 "%.200S() %s (%" CYTHON_FORMAT_SSIZE_T
"d given)",
10018 py_name, message, size);
10019 Py_DECREF(py_name);
10021 const char* name = ((PyCFunctionObject*)func)->m_ml->ml_name;
10022 PyErr_Format(PyExc_TypeError,
10023 "%.200s() %s (%" CYTHON_FORMAT_SSIZE_T
"d given)",
10024 name, message, size);
10027static void __Pyx_CyFunction_raise_type_error(PyObject *func,
const char* message) {
10028#if CYTHON_COMPILING_IN_LIMITED_API
10029 PyObject *py_name = __Pyx_CyFunction_get_name(func, NULL);
10030 if (!py_name)
return;
10031 PyErr_Format(PyExc_TypeError,
10034 Py_DECREF(py_name);
10036 const char* name = ((PyCFunctionObject*)func)->m_ml->ml_name;
10037 PyErr_Format(PyExc_TypeError,
10042#if CYTHON_COMPILING_IN_LIMITED_API
10044__Pyx_CyFunction_get_module(PyObject *op_in,
void *context) {
10045 CYTHON_UNUSED_VAR(context);
10046 __pyx_CyFunctionObject *op = __Pyx_as_CyFunctionObject(op_in);
10047 Py_INCREF(op->func_module);
10048 return op->func_module;
10051__Pyx_CyFunction_set_module(PyObject *op_in, PyObject* value,
void *context) {
10052 CYTHON_UNUSED_VAR(context);
10053 __pyx_CyFunctionObject *op = __Pyx_as_CyFunctionObject(op_in);
10054 if (value == NULL) {
10058 PyObject *old = op->func_module;
10059 op->func_module = value;
10064static PyGetSetDef __pyx_CyFunction_getsets[] = {
10065 {
"func_doc", (getter)__Pyx_CyFunction_get_doc, (setter)__Pyx_CyFunction_set_doc, 0, 0},
10066 {
"__doc__", (getter)__Pyx_CyFunction_get_doc, (setter)__Pyx_CyFunction_set_doc, 0, 0},
10067 {
"func_name", (getter)__Pyx_CyFunction_get_name, (setter)__Pyx_CyFunction_set_name, 0, 0},
10068 {
"__name__", (getter)__Pyx_CyFunction_get_name, (setter)__Pyx_CyFunction_set_name, 0, 0},
10069 {
"__qualname__", (getter)__Pyx_CyFunction_get_qualname, (setter)__Pyx_CyFunction_set_qualname, 0, 0},
10070#if CYTHON_COMPILING_IN_LIMITED_API && __PYX_LIMITED_VERSION_HEX < 0x030A0000
10071 {
"func_dict", (getter)__Pyx_CyFunction_get_dict, (setter)PyObject_GenericSetDict, 0, 0},
10072 {
"__dict__", (getter)__Pyx_CyFunction_get_dict, (setter)PyObject_GenericSetDict, 0, 0},
10074 {
"func_dict", (getter)PyObject_GenericGetDict, (setter)PyObject_GenericSetDict, 0, 0},
10075 {
"__dict__", (getter)PyObject_GenericGetDict, (setter)PyObject_GenericSetDict, 0, 0},
10077 {
"func_globals", (getter)__Pyx_CyFunction_get_globals, 0, 0, 0},
10078 {
"__globals__", (getter)__Pyx_CyFunction_get_globals, 0, 0, 0},
10079 {
"func_closure", (getter)__Pyx_CyFunction_get_closure, 0, 0, 0},
10080 {
"__closure__", (getter)__Pyx_CyFunction_get_closure, 0, 0, 0},
10081 {
"func_code", (getter)__Pyx_CyFunction_get_code, 0, 0, 0},
10082 {
"__code__", (getter)__Pyx_CyFunction_get_code, 0, 0, 0},
10083 {
"func_defaults", (getter)__Pyx_CyFunction_get_defaults, (setter)__Pyx_CyFunction_set_defaults, 0, 0},
10084 {
"__defaults__", (getter)__Pyx_CyFunction_get_defaults, (setter)__Pyx_CyFunction_set_defaults, 0, 0},
10085 {
"__kwdefaults__", (getter)__Pyx_CyFunction_get_kwdefaults, (setter)__Pyx_CyFunction_set_kwdefaults, 0, 0},
10086 {
"__annotations__", (getter)__Pyx_CyFunction_get_annotations, (setter)__Pyx_CyFunction_set_annotations, 0, 0},
10087 {
"__annotate__", (getter)__Pyx_CyFunction_get_annotate, (setter)__Pyx_CyFunction_set_annotate, 0, 0},
10088#if __PYX_LIMITED_VERSION_HEX < 0x030B0000
10089 {
"_is_coroutine", (getter)__Pyx_CyFunction_get_is_coroutine, 0, 0, 0},
10091#if CYTHON_COMPILING_IN_LIMITED_API
10092 {
"__module__", (getter)__Pyx_CyFunction_get_module, (setter)__Pyx_CyFunction_set_module, 0, 0},
10096static PyMemberDef __pyx_CyFunction_members[] = {
10097#if !CYTHON_COMPILING_IN_LIMITED_API
10098 {
"__module__", T_OBJECT, offsetof(PyCFunctionObject, m_module), 0, 0},
10100#if PY_VERSION_HEX < 0x030C0000 || CYTHON_COMPILING_IN_LIMITED_API
10101 {
"__dictoffset__", T_PYSSIZET, offsetof(__pyx_CyFunctionObject, func_dict),
10102 __PYX_SHARED_RELATIVE_OFFSET | READONLY, 0},
10104#if CYTHON_VECTORCALL
10105#if CYTHON_COMPILING_IN_LIMITED_API || CYTHON_COMPILING_IN_PYPY
10106 {
"__vectorcalloffset__", T_PYSSIZET, offsetof(__pyx_CyFunctionObject, func_vectorcall),
10107 __PYX_SHARED_RELATIVE_OFFSET | READONLY, 0},
10109 {
"__vectorcalloffset__", T_PYSSIZET, offsetof(PyCFunctionObject, vectorcall), READONLY, 0},
10111#if CYTHON_COMPILING_IN_LIMITED_API
10112 {
"__weaklistoffset__", T_PYSSIZET, offsetof(__pyx_CyFunctionObject, func_weakreflist),
10113 __PYX_SHARED_RELATIVE_OFFSET | READONLY, 0},
10115 {
"__weaklistoffset__", T_PYSSIZET, offsetof(PyCFunctionObject, m_weakreflist), READONLY, 0},
10121__Pyx_CyFunction_reduce(PyObject *m_in, PyObject *args)
10123 PyObject *result = NULL;
10124 __pyx_CyFunctionObject *m = __Pyx_as_CyFunctionObject(m_in);
10125 CYTHON_UNUSED_VAR(args);
10126 __Pyx_BEGIN_CRITICAL_SECTION(m_in);
10127 Py_INCREF(m->func_qualname);
10128 result = m->func_qualname;
10129 __Pyx_END_CRITICAL_SECTION();
10132static PyMethodDef __pyx_CyFunction_methods[] = {
10133 {
"__annotate_cython__", __Pyx_CyFunction_annotate_impl, METH_O,
10134 "Placeholder __annotate__ function to allow 'functools.wraps' to work "
10135 "on Cython functions."},
10136 {
"__reduce__", (PyCFunction)__Pyx_CyFunction_reduce, METH_NOARGS, 0},
10140__Pyx_CyFunction_get_annotate(PyObject *op_in,
void *context) {
10141 PyObject *annotate = NULL;
10142 CYTHON_UNUSED_VAR(context);
10143 if (unlikely(__Pyx_CyFunction_get_annotate_from_dict_if_exists(op_in, &annotate) < 0))
return NULL;
10144 if (annotate)
return annotate;
10145 PyObject *method = PyCFunction_New(
10146 &__pyx_CyFunction_methods[0],
10150#if CYTHON_COMPILING_IN_LIMITED_API
10151#define __Pyx_CyFunction_weakreflist(cyfunc) ((cyfunc)->func_weakreflist)
10153#define __Pyx_CyFunction_weakreflist(cyfunc) (((PyCFunctionObject*)cyfunc)->m_weakreflist)
10155static PyObject *__Pyx_CyFunction_Init(PyObject *op_in,
10156 PyMethodDef *ml,
int flags, PyObject* qualname,
10157 PyObject *closure, PyObject *module, PyObject* globals, PyObject* code) {
10158 __pyx_CyFunctionObject* op = __Pyx_as_CyFunctionObject(op_in);
10159#if !CYTHON_COMPILING_IN_LIMITED_API
10160 PyCFunctionObject *cf = (PyCFunctionObject*) op;
10162 if (unlikely(op == NULL))
10164#if CYTHON_COMPILING_IN_LIMITED_API
10165 op->func_methoddef = ml;
10167 op->func_module =
module;
10170 __Pyx_CyFunction_weakreflist(op) = NULL;
10171#if !CYTHON_COMPILING_IN_LIMITED_API
10173 cf->m_self = (PyObject *) op;
10175 Py_XINCREF(closure);
10176 op->func_closure = closure;
10177#if !CYTHON_COMPILING_IN_LIMITED_API
10178 Py_XINCREF(module);
10179 cf->m_module =
module;
10181#if PY_VERSION_HEX < 0x030C0000 || CYTHON_COMPILING_IN_LIMITED_API
10182 op->func_dict = NULL;
10184 op->func_name = NULL;
10185 Py_INCREF(qualname);
10186 op->func_qualname = qualname;
10187 op->func_doc = NULL;
10188#if CYTHON_COMPILING_IN_LIMITED_API
10189 op->func_classobj = NULL;
10191 ((PyCMethodObject*)op)->mm_class = NULL;
10193 op->func_globals = globals;
10194 Py_INCREF(op->func_globals);
10196 op->func_code = code;
10197 op->defaults = NULL;
10198 op->defaults_tuple = NULL;
10199 op->defaults_kwdict = NULL;
10200 op->defaults_getter = NULL;
10201 op->func_annotations = NULL;
10202#if __PYX_LIMITED_VERSION_HEX < 0x030B0000
10203 op->func_is_coroutine = NULL;
10205#if CYTHON_VECTORCALL
10206 switch (ml->ml_flags & (METH_VARARGS | METH_FASTCALL | METH_NOARGS | METH_O | METH_KEYWORDS | METH_METHOD)) {
10208 __Pyx_CyFunction_func_vectorcall(op) = __Pyx_CyFunction_Vectorcall_NOARGS;
10211 __Pyx_CyFunction_func_vectorcall(op) = __Pyx_CyFunction_Vectorcall_O;
10213 case METH_METHOD | METH_FASTCALL | METH_KEYWORDS:
10214 __Pyx_CyFunction_func_vectorcall(op) = __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS_METHOD;
10216 case METH_FASTCALL | METH_KEYWORDS:
10217 __Pyx_CyFunction_func_vectorcall(op) = __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS;
10219 case METH_VARARGS | METH_KEYWORDS:
10220 __Pyx_CyFunction_func_vectorcall(op) = NULL;
10223 PyErr_SetString(PyExc_SystemError,
"Bad call flags for CyFunction");
10230static int __Pyx__CyFunction_clear(__pyx_CyFunctionObject *m)
10232 Py_CLEAR(m->func_closure);
10233#if CYTHON_COMPILING_IN_LIMITED_API
10234 Py_CLEAR(m->func_module);
10236 Py_CLEAR(((PyCFunctionObject*)m)->m_module);
10238#if PY_VERSION_HEX < 0x030C0000 || CYTHON_COMPILING_IN_LIMITED_API
10239 Py_CLEAR(m->func_dict);
10240#elif PY_VERSION_HEX < 0x030d0000
10241 _PyObject_ClearManagedDict((PyObject*)m);
10243 PyObject_ClearManagedDict((PyObject*)m);
10245 Py_CLEAR(m->func_name);
10246 Py_CLEAR(m->func_qualname);
10247 Py_CLEAR(m->func_doc);
10248 Py_CLEAR(m->func_globals);
10249 Py_CLEAR(m->func_code);
10250#if CYTHON_COMPILING_IN_LIMITED_API
10251 Py_CLEAR(m->func_classobj);
10254 PyObject *cls = (PyObject*) ((PyCMethodObject *) (m))->mm_class;
10255 ((PyCMethodObject *) (m))->mm_class = NULL;
10259 Py_CLEAR(m->defaults_tuple);
10260 Py_CLEAR(m->defaults_kwdict);
10261 Py_CLEAR(m->func_annotations);
10262#if __PYX_LIMITED_VERSION_HEX < 0x030B0000
10263 Py_CLEAR(m->func_is_coroutine);
10265 Py_CLEAR(m->defaults);
10269__Pyx_CyFunction_clear(PyObject *m)
10271 return __Pyx__CyFunction_clear(__Pyx_as_CyFunctionObject(m));
10273static void __Pyx__CyFunction_dealloc(PyObject *m)
10275 __pyx_CyFunctionObject *cyfunc = __Pyx_as_CyFunctionObject(m);
10276 if (__Pyx_CyFunction_weakreflist(cyfunc) != NULL)
10277 PyObject_ClearWeakRefs(m);
10278 __Pyx__CyFunction_clear(cyfunc);
10279 __Pyx_PyHeapTypeObject_GC_Del(m);
10281static void __Pyx_CyFunction_dealloc(PyObject *m)
10283 PyObject_GC_UnTrack(m);
10284 __Pyx__CyFunction_dealloc(m);
10286static int __Pyx_CyFunction_traverse(PyObject *m_in, visitproc visit,
void *arg)
10288 __pyx_CyFunctionObject *m = __Pyx_as_CyFunctionObject(m_in);
10290 int e = __Pyx_call_type_traverse(m_in, 1, visit, arg);
10293 Py_VISIT(m->func_closure);
10294#if CYTHON_COMPILING_IN_LIMITED_API
10295 Py_VISIT(m->func_module);
10297 Py_VISIT(((PyCFunctionObject*)m)->m_module);
10299#if PY_VERSION_HEX < 0x030C0000 || CYTHON_COMPILING_IN_LIMITED_API
10300 Py_VISIT(m->func_dict);
10304#if PY_VERSION_HEX < 0x030d0000
10305 _PyObject_VisitManagedDict
10307 PyObject_VisitManagedDict
10309 ((PyObject*)m, visit, arg);
10310 if (e != 0)
return e;
10313 __Pyx_VISIT_CONST(m->func_name);
10314 __Pyx_VISIT_CONST(m->func_qualname);
10315 Py_VISIT(m->func_doc);
10316 Py_VISIT(m->func_globals);
10317 __Pyx_VISIT_CONST(m->func_code);
10318 Py_VISIT(__Pyx__CyFunction_GetClassObj(m));
10319 Py_VISIT(m->defaults_tuple);
10320 Py_VISIT(m->defaults_kwdict);
10321 Py_VISIT(m->func_annotations);
10322#if __PYX_LIMITED_VERSION_HEX < 0x030B0000
10323 Py_VISIT(m->func_is_coroutine);
10325 Py_VISIT(m->defaults);
10329__Pyx_CyFunction_repr(PyObject *op_in)
10331 __pyx_CyFunctionObject *op = __Pyx_as_CyFunctionObject(op_in);
10333 __Pyx_BEGIN_CRITICAL_SECTION(op_in);
10334 repr = PyUnicode_FromFormat(
"<cyfunction %U at %p>",
10335 op->func_qualname, (
void *)op);
10336 __Pyx_END_CRITICAL_SECTION();
10339static PyObject * __Pyx_CyFunction_CallMethod(PyObject *func, PyObject *self, PyObject *arg, PyObject *kw) {
10340#if CYTHON_COMPILING_IN_LIMITED_API
10341 __pyx_CyFunctionObject *cyfunc = __Pyx_as_CyFunctionObject(func);
10342 PyCFunction meth = cyfunc->func_methoddef->ml_meth;
10343 int flags = cyfunc->func_methoddef->ml_flags;
10345 PyCFunctionObject*
f = (PyCFunctionObject*)func;
10346 PyCFunction meth =
f->m_ml->ml_meth;
10347 int flags =
f->m_ml->ml_flags;
10350 switch (flags & (METH_VARARGS | METH_KEYWORDS | METH_NOARGS | METH_O)) {
10352 if (likely(kw == NULL || PyDict_Size(kw) == 0))
10353 return (*meth)(self, arg);
10355 case METH_VARARGS | METH_KEYWORDS:
10356 return (*(PyCFunctionWithKeywords)(
void(*)(
void))meth)(self, arg, kw);
10358 if (likely(kw == NULL || PyDict_Size(kw) == 0)) {
10359#if CYTHON_ASSUME_SAFE_SIZE
10360 size = PyTuple_GET_SIZE(arg);
10362 size = PyTuple_Size(arg);
10363 if (unlikely(size < 0))
return NULL;
10365 if (likely(size == 0))
10366 return (*meth)(self, NULL);
10367 __Pyx_CyFunction_raise_argument_count_error(
10369 "takes no arguments", size);
10374 if (likely(kw == NULL || PyDict_Size(kw) == 0)) {
10375#if CYTHON_ASSUME_SAFE_SIZE
10376 size = PyTuple_GET_SIZE(arg);
10378 size = PyTuple_Size(arg);
10379 if (unlikely(size < 0))
return NULL;
10381 if (likely(size == 1)) {
10382 PyObject *result, *arg0;
10383 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
10384 arg0 = PyTuple_GET_ITEM(arg, 0);
10386 arg0 = __Pyx_PySequence_ITEM(arg, 0);
if (unlikely(!arg0))
return NULL;
10388 result = (*meth)(self, arg0);
10389 #if !(CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS)
10394 __Pyx_CyFunction_raise_argument_count_error(
10396 "takes exactly one argument", size);
10401 PyErr_SetString(PyExc_SystemError,
"Bad call flags for CyFunction");
10404 __Pyx_CyFunction_raise_type_error(
10405 func,
"takes no keyword arguments");
10408static CYTHON_INLINE PyObject *__Pyx_CyFunction_Call(PyObject *func, PyObject *arg, PyObject *kw) {
10410 result = __Pyx_CyFunction_CallMethod(func, func, arg, kw);
10413static PyObject *__Pyx_CyFunction_CallAsMethod(PyObject *func, PyObject *args, PyObject *kw) {
10415 __pyx_CyFunctionObject *cyfunc = __Pyx_as_CyFunctionObject(func);
10416#if CYTHON_VECTORCALL
10417 __pyx_vectorcallfunc vc = __Pyx_CyFunction_func_vectorcall(cyfunc);
10419#if CYTHON_ASSUME_SAFE_MACROS && CYTHON_ASSUME_SAFE_SIZE
10420 return __Pyx_PyVectorcall_FastCallDict(func, vc, &PyTuple_GET_ITEM(args, 0), (
size_t)PyTuple_GET_SIZE(args), kw);
10422 (void) &__Pyx_PyVectorcall_FastCallDict;
10423 return PyVectorcall_Call(func, args, kw);
10427 if ((cyfunc->flags & __Pyx_CYFUNCTION_CCLASS) && !(cyfunc->flags & __Pyx_CYFUNCTION_STATICMETHOD)) {
10429 PyObject *new_args;
10431#if CYTHON_ASSUME_SAFE_SIZE
10432 argc = PyTuple_GET_SIZE(args);
10434 argc = PyTuple_Size(args);
10435 if (unlikely(argc < 0))
return NULL;
10437 new_args = PyTuple_GetSlice(args, 1, argc);
10438 if (unlikely(!new_args))
10440 self = PyTuple_GetItem(args, 0);
10441 if (unlikely(!self)) {
10442 Py_DECREF(new_args);
10443 PyErr_Format(PyExc_TypeError,
10444 "unbound method %.200S() needs an argument",
10445 cyfunc->func_qualname);
10448 result = __Pyx_CyFunction_CallMethod(func, self, new_args, kw);
10449 Py_DECREF(new_args);
10451 result = __Pyx_CyFunction_Call(func, args, kw);
10455#if CYTHON_VECTORCALL
10456static CYTHON_INLINE
int __Pyx_CyFunction_Vectorcall_CheckArgs(PyObject *func, __pyx_CyFunctionObject *cyfunc, Py_ssize_t nargs, PyObject *kwnames)
10459 if ((cyfunc->flags & __Pyx_CYFUNCTION_CCLASS) && !(cyfunc->flags & __Pyx_CYFUNCTION_STATICMETHOD)) {
10460 if (unlikely(nargs < 1)) {
10461 __Pyx_CyFunction_raise_type_error(
10462 func,
"needs an argument");
10467 if (unlikely(kwnames) && unlikely(__Pyx_PyTuple_GET_SIZE(kwnames))) {
10468 __Pyx_CyFunction_raise_type_error(
10469 func,
"takes no keyword arguments");
10474static PyObject * __Pyx_CyFunction_Vectorcall_NOARGS(PyObject *func, PyObject *
const *args,
size_t nargsf, PyObject *kwnames)
10476 __pyx_CyFunctionObject *cyfunc = __Pyx_as_CyFunctionObject(func);
10477 Py_ssize_t nargs = PyVectorcall_NARGS(nargsf);
10479#if CYTHON_COMPILING_IN_LIMITED_API
10480 PyCFunction meth = cyfunc->func_methoddef->ml_meth;
10481 if (unlikely(!meth))
return NULL;
10483 PyCFunction meth = ((PyCFunctionObject*)cyfunc)->m_ml->ml_meth;
10485 switch (__Pyx_CyFunction_Vectorcall_CheckArgs(func, cyfunc, nargs, kwnames)) {
10497 if (unlikely(nargs != 0)) {
10498 __Pyx_CyFunction_raise_argument_count_error(
10499 func,
"takes no arguments", nargs);
10502 return meth(self, NULL);
10504static PyObject * __Pyx_CyFunction_Vectorcall_O(PyObject *func, PyObject *
const *args,
size_t nargsf, PyObject *kwnames)
10506 __pyx_CyFunctionObject *cyfunc = __Pyx_as_CyFunctionObject(func);
10507 Py_ssize_t nargs = PyVectorcall_NARGS(nargsf);
10509#if CYTHON_COMPILING_IN_LIMITED_API
10510 PyCFunction meth = cyfunc->func_methoddef->ml_meth;
10511 if (unlikely(!meth))
return NULL;
10513 PyCFunction meth = ((PyCFunctionObject*)cyfunc)->m_ml->ml_meth;
10515 switch (__Pyx_CyFunction_Vectorcall_CheckArgs(func, cyfunc, nargs, kwnames)) {
10527 if (unlikely(nargs != 1)) {
10528 __Pyx_CyFunction_raise_argument_count_error(
10529 func,
"takes exactly one argument", nargs);
10532 return meth(self, args[0]);
10534static PyObject * __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS(PyObject *func, PyObject *
const *args,
size_t nargsf, PyObject *kwnames)
10536 __pyx_CyFunctionObject *cyfunc = __Pyx_as_CyFunctionObject(func);
10537 Py_ssize_t nargs = PyVectorcall_NARGS(nargsf);
10539#if CYTHON_COMPILING_IN_LIMITED_API
10540 PyCFunction meth = cyfunc->func_methoddef->ml_meth;
10541 if (unlikely(!meth))
return NULL;
10543 PyCFunction meth = ((PyCFunctionObject*)cyfunc)->m_ml->ml_meth;
10545 switch (__Pyx_CyFunction_Vectorcall_CheckArgs(func, cyfunc, nargs, NULL)) {
10557 return ((__Pyx_PyCFunctionFastWithKeywords)(
void(*)(
void))meth)(self, args, nargs, kwnames);
10559static PyObject * __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS_METHOD(PyObject *func, PyObject *
const *args,
size_t nargsf, PyObject *kwnames)
10561 __pyx_CyFunctionObject *cyfunc = __Pyx_as_CyFunctionObject(func);
10562 PyTypeObject *cls = (PyTypeObject *) __Pyx__CyFunction_GetClassObj(cyfunc);
10563 Py_ssize_t nargs = PyVectorcall_NARGS(nargsf);
10565#if CYTHON_COMPILING_IN_LIMITED_API
10566 PyCFunction meth = cyfunc->func_methoddef->ml_meth;
10567 if (unlikely(!meth))
return NULL;
10569 PyCFunction meth = ((PyCFunctionObject*)cyfunc)->m_ml->ml_meth;
10571 switch (__Pyx_CyFunction_Vectorcall_CheckArgs(func, cyfunc, nargs, NULL)) {
10583 #if PY_VERSION_HEX < 0x030e00A6
10584 size_t nargs_value = (size_t) nargs;
10586 Py_ssize_t nargs_value = nargs;
10588 return ((__Pyx_PyCMethod)(
void(*)(
void))meth)(self, cls, args, nargs_value, kwnames);
10591static PyType_Slot __pyx_CyFunctionType_slots[] = {
10592 {Py_tp_dealloc, (
void *)__Pyx_CyFunction_dealloc},
10593 {Py_tp_repr, (
void *)__Pyx_CyFunction_repr},
10594 {Py_tp_call, (
void *)__Pyx_CyFunction_CallAsMethod},
10595 {Py_tp_traverse, (
void *)__Pyx_CyFunction_traverse},
10596 {Py_tp_clear, (
void *)__Pyx_CyFunction_clear},
10597 {Py_tp_methods, (
void *)__pyx_CyFunction_methods},
10598 {Py_tp_members, (
void *)__pyx_CyFunction_members},
10599 {Py_tp_getset, (
void *)__pyx_CyFunction_getsets},
10600 {Py_tp_descr_get, (
void *)__Pyx_PyMethod_New},
10603static PyType_Spec __pyx_CyFunctionType_spec = {
10604 __PYX_TYPE_MODULE_PREFIX
"cython_function_or_method",
10605 __PYX_SHARED_SIZEOF(__pyx_CyFunctionObject),
10607#ifdef Py_TPFLAGS_METHOD_DESCRIPTOR
10608 Py_TPFLAGS_METHOD_DESCRIPTOR |
10610#if CYTHON_VECTORCALL
10611#if defined(Py_TPFLAGS_HAVE_VECTORCALL)
10612 Py_TPFLAGS_HAVE_VECTORCALL |
10613#elif defined(_Py_TPFLAGS_HAVE_VECTORCALL)
10614 _Py_TPFLAGS_HAVE_VECTORCALL |
10617#if PY_VERSION_HEX >= 0x030C0000 && !CYTHON_COMPILING_IN_LIMITED_API
10618 Py_TPFLAGS_MANAGED_DICT |
10620 Py_TPFLAGS_IMMUTABLETYPE | Py_TPFLAGS_DISALLOW_INSTANTIATION |
10621 Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC | Py_TPFLAGS_BASETYPE,
10622 __pyx_CyFunctionType_slots
10624static int __pyx_CyFunction_init(PyObject *module) {
10625 __pyx_mstatetype *mstate = __Pyx_PyModule_GetState(module);
10626 mstate->__pyx_CyFunctionType = __Pyx_FetchCommonTypeFromSpec(
10627 mstate->__pyx_CommonTypesMetaclassType, module, &__pyx_CyFunctionType_spec, NULL);
10628 if (unlikely(mstate->__pyx_CyFunctionType == NULL)) {
10635static PyObject *__Pyx_CyFunction_New(PyMethodDef *ml,
int flags, PyObject* qualname,
10636 PyObject *closure, PyObject *module, PyObject* globals, PyObject* code) {
10637 (void)&__Pyx_Get_CyFunction_Type;
10638 PyObject *op = __Pyx_CyFunction_Init(
10639 PyObject_GC_New(PyObject, __pyx_mstate_global->__pyx_CyFunctionType),
10640 ml, flags, qualname, closure, module, globals, code
10643 PyObject_GC_Track(op);
10647static PyTypeObject *__Pyx_Get_CyFunction_Type(
void) {
10648 PyTypeObject *tp = __pyx_mstate_global->__pyx_CyFunctionType;
10649 Py_INCREF((PyObject*)tp);
10654#if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_TYPE_SLOTS
10655static CYTHON_INLINE PY_UINT64_T __Pyx_get_tp_dict_version(PyObject *obj) {
10656 PyObject *dict = Py_TYPE(obj)->tp_dict;
10657 return likely(dict) ? __PYX_GET_DICT_VERSION(dict) : 0;
10659static CYTHON_INLINE PY_UINT64_T __Pyx_get_object_dict_version(PyObject *obj) {
10660 PyObject **dictptr = NULL;
10661 Py_ssize_t offset = Py_TYPE(obj)->tp_dictoffset;
10663#if CYTHON_COMPILING_IN_CPYTHON
10664 dictptr = (likely(offset > 0)) ? (PyObject **) ((
char *)obj + offset) : _PyObject_GetDictPtr(obj);
10666 dictptr = _PyObject_GetDictPtr(obj);
10669 return (dictptr && *dictptr) ? __PYX_GET_DICT_VERSION(*dictptr) : 0;
10671static CYTHON_INLINE
int __Pyx_object_dict_version_matches(PyObject* obj, PY_UINT64_T tp_dict_version, PY_UINT64_T obj_dict_version) {
10672 PyObject *dict = Py_TYPE(obj)->tp_dict;
10673 if (unlikely(!dict) || unlikely(tp_dict_version != __PYX_GET_DICT_VERSION(dict)))
10675 return obj_dict_version == __Pyx_get_object_dict_version(obj);
10680#if CYTHON_CLINE_IN_TRACEBACK && CYTHON_CLINE_IN_TRACEBACK_RUNTIME
10681#if CYTHON_COMPILING_IN_LIMITED_API && __PYX_LIMITED_VERSION_HEX < 0x030A0000
10682#define __Pyx_PyProbablyModule_GetDict(o) __Pyx_XNewRef(PyModule_GetDict(o))
10683#elif !CYTHON_COMPILING_IN_CPYTHON || CYTHON_COMPILING_IN_CPYTHON_FREETHREADING
10684#define __Pyx_PyProbablyModule_GetDict(o) PyObject_GenericGetDict(o, NULL);
10686PyObject* __Pyx_PyProbablyModule_GetDict(PyObject *o) {
10687 PyObject **dict_ptr = _PyObject_GetDictPtr(o);
10688 return dict_ptr ? __Pyx_XNewRef(*dict_ptr) : NULL;
10691static int __Pyx_CLineForTraceback(PyThreadState *tstate,
int c_line) {
10692 PyObject *use_cline = NULL;
10693 PyObject *ptype, *pvalue, *ptraceback;
10694 PyObject *cython_runtime_dict;
10695 CYTHON_MAYBE_UNUSED_VAR(tstate);
10696 if (unlikely(!__pyx_mstate_global->__pyx_cython_runtime)) {
10699 __Pyx_ErrFetchInState(tstate, &ptype, &pvalue, &ptraceback);
10700 cython_runtime_dict = __Pyx_PyProbablyModule_GetDict(__pyx_mstate_global->__pyx_cython_runtime);
10701 if (likely(cython_runtime_dict)) {
10702 __PYX_PY_DICT_LOOKUP_IF_MODIFIED(
10703 use_cline, cython_runtime_dict,
10704 __Pyx_PyDict_SetDefault(cython_runtime_dict, __pyx_mstate_global->__pyx_n_u_cline_in_traceback, Py_False))
10706 if (use_cline == NULL || use_cline == Py_False || (use_cline != Py_True && PyObject_Not(use_cline) != 0)) {
10709 Py_XDECREF(use_cline);
10710 Py_XDECREF(cython_runtime_dict);
10711 __Pyx_ErrRestoreInState(tstate, ptype, pvalue, ptraceback);
10717static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries,
int count,
int code_line) {
10718 int start = 0, mid = 0, end = count - 1;
10719 if (end >= 0 && code_line > entries[end].code_line) {
10722 while (start < end) {
10723 mid = start + (end - start) / 2;
10724 if (code_line < entries[mid].code_line) {
10726 }
else if (code_line > entries[mid].code_line) {
10732 if (code_line <= entries[mid].code_line) {
10738static __Pyx_CachedCodeObjectType *__pyx__find_code_object(
struct __Pyx_CodeObjectCache *code_cache,
int code_line) {
10739 __Pyx_CachedCodeObjectType* code_object;
10741 if (unlikely(!code_line) || unlikely(!code_cache->entries)) {
10744 pos = __pyx_bisect_code_objects(code_cache->entries, code_cache->count, code_line);
10745 if (unlikely(pos >= code_cache->count) || unlikely(code_cache->entries[pos].code_line != code_line)) {
10748 code_object = code_cache->entries[pos].code_object;
10749 Py_INCREF(code_object);
10750 return code_object;
10752static __Pyx_CachedCodeObjectType *__pyx_find_code_object(
int code_line) {
10753#if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING && !CYTHON_ATOMICS
10754 (void)__pyx__find_code_object;
10757 struct __Pyx_CodeObjectCache *code_cache = &__pyx_mstate_global->__pyx_code_cache;
10758#if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING
10759 __pyx_nonatomic_int_type old_count = __pyx_atomic_incr_acq_rel(&code_cache->accessor_count);
10760 if (old_count < 0) {
10761 __pyx_atomic_decr_acq_rel(&code_cache->accessor_count);
10765 __Pyx_CachedCodeObjectType *result = __pyx__find_code_object(code_cache, code_line);
10766#if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING
10767 __pyx_atomic_decr_acq_rel(&code_cache->accessor_count);
10772static void __pyx__insert_code_object(
struct __Pyx_CodeObjectCache *code_cache,
int code_line, __Pyx_CachedCodeObjectType* code_object)
10775 __Pyx_CodeObjectCacheEntry* entries = code_cache->entries;
10776 if (unlikely(!code_line)) {
10779 if (unlikely(!entries)) {
10780 entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Malloc(64*
sizeof(__Pyx_CodeObjectCacheEntry));
10781 if (likely(entries)) {
10782 code_cache->entries = entries;
10783 code_cache->max_count = 64;
10784 code_cache->count = 1;
10785 entries[0].code_line = code_line;
10786 entries[0].code_object = code_object;
10787 Py_INCREF(code_object);
10791 pos = __pyx_bisect_code_objects(code_cache->entries, code_cache->count, code_line);
10792 if ((pos < code_cache->count) && unlikely(code_cache->entries[pos].code_line == code_line)) {
10793 __Pyx_CachedCodeObjectType* tmp = entries[pos].code_object;
10794 entries[pos].code_object = code_object;
10795 Py_INCREF(code_object);
10799 if (code_cache->count == code_cache->max_count) {
10800 int new_max = code_cache->max_count + 64;
10801 entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Realloc(
10802 code_cache->entries, ((
size_t)new_max) *
sizeof(__Pyx_CodeObjectCacheEntry));
10803 if (unlikely(!entries)) {
10806 code_cache->entries = entries;
10807 code_cache->max_count = new_max;
10809 for (i=code_cache->count; i>pos; i--) {
10810 entries[i] = entries[i-1];
10812 entries[pos].code_line = code_line;
10813 entries[pos].code_object = code_object;
10814 code_cache->count++;
10815 Py_INCREF(code_object);
10817static void __pyx_insert_code_object(
int code_line, __Pyx_CachedCodeObjectType* code_object) {
10818#if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING && !CYTHON_ATOMICS
10819 (void)__pyx__insert_code_object;
10822 struct __Pyx_CodeObjectCache *code_cache = &__pyx_mstate_global->__pyx_code_cache;
10823#if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING
10824 __pyx_nonatomic_int_type expected = 0;
10825 if (!__pyx_atomic_int_cmp_exchange(&code_cache->accessor_count, &expected, INT_MIN)) {
10829 __pyx__insert_code_object(code_cache, code_line, code_object);
10830#if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING
10831 __pyx_atomic_sub(&code_cache->accessor_count, INT_MIN);
10837#include "compile.h"
10838#include "frameobject.h"
10839#include "traceback.h"
10840#if PY_VERSION_HEX >= 0x030b00a6 && !CYTHON_COMPILING_IN_LIMITED_API && !defined(PYPY_VERSION)
10841 #ifndef Py_BUILD_CORE
10842 #define Py_BUILD_CORE 1
10844 #include "internal/pycore_frame.h"
10846#if CYTHON_COMPILING_IN_LIMITED_API
10847static PyObject *__Pyx_PyCode_Replace_For_AddTraceback(PyObject *code, PyObject *scratch_dict,
10848 PyObject *firstlineno, PyObject *name) {
10849 PyObject *replace = NULL;
10850 if (unlikely(PyDict_SetItemString(scratch_dict,
"co_firstlineno", firstlineno)))
return NULL;
10851 if (unlikely(PyDict_SetItemString(scratch_dict,
"co_name", name)))
return NULL;
10852 replace = PyObject_GetAttrString(code,
"replace");
10853 if (likely(replace)) {
10854 PyObject *result = PyObject_Call(replace, __pyx_mstate_global->__pyx_empty_tuple, scratch_dict);
10855 Py_DECREF(replace);
10860static void __Pyx_AddTraceback(
const char *funcname,
int c_line,
10861 int py_line,
const char *filename) {
10862 PyObject *code_object = NULL, *py_py_line = NULL, *py_funcname = NULL, *dict = NULL;
10863 PyObject *replace = NULL, *getframe = NULL, *frame = NULL;
10864 PyObject *exc_type, *exc_value, *exc_traceback;
10867 c_line = __Pyx_CLineForTraceback(__Pyx_PyThreadState_Current, c_line);
10869 __Pyx_PyErr_FetchException(&exc_type, &exc_value, &exc_traceback);
10870 code_object = __pyx_find_code_object(c_line ? -c_line : py_line);
10871 if (!code_object) {
10872 code_object = Py_CompileString(
"_getframe()", filename, Py_eval_input);
10873 if (unlikely(!code_object))
goto bad;
10874 py_py_line = PyLong_FromLong(py_line);
10875 if (unlikely(!py_py_line))
goto bad;
10877 py_funcname = PyUnicode_FromFormat(
"%s (%s:%d)", funcname, __pyx_cfilenm, c_line);
10879 py_funcname = PyUnicode_FromString(funcname);
10881 if (unlikely(!py_funcname))
goto bad;
10882 dict = PyDict_New();
10883 if (unlikely(!dict))
goto bad;
10885 PyObject *old_code_object = code_object;
10886 code_object = __Pyx_PyCode_Replace_For_AddTraceback(code_object, dict, py_py_line, py_funcname);
10887 Py_DECREF(old_code_object);
10889 if (unlikely(!code_object))
goto bad;
10890 __pyx_insert_code_object(c_line ? -c_line : py_line, code_object);
10892 dict = PyDict_New();
10894 getframe = PySys_GetObject(
"_getframe");
10895 if (unlikely(!getframe))
goto bad;
10896 if (unlikely(PyDict_SetItemString(dict,
"_getframe", getframe)))
goto bad;
10897 frame = PyEval_EvalCode(code_object, dict, dict);
10898 if (unlikely(!frame) || frame == Py_None)
goto bad;
10901 __Pyx_PyErr_RestoreException(exc_type, exc_value, exc_traceback);
10902 Py_XDECREF(code_object);
10903 Py_XDECREF(py_py_line);
10904 Py_XDECREF(py_funcname);
10906 Py_XDECREF(replace);
10909 (
struct _frame*)frame);
10914static PyCodeObject* __Pyx_CreateCodeObjectForTraceback(
10915 const char *funcname,
int c_line,
10916 int py_line,
const char *filename) {
10917 PyCodeObject *py_code = NULL;
10918 PyObject *py_funcname = NULL;
10920 py_funcname = PyUnicode_FromFormat(
"%s (%s:%d)", funcname, __pyx_cfilenm, c_line);
10921 if (!py_funcname)
goto bad;
10922 funcname = PyUnicode_AsUTF8(py_funcname);
10923 if (!funcname)
goto bad;
10925 py_code = PyCode_NewEmpty(filename, funcname, py_line);
10926 Py_XDECREF(py_funcname);
10929 Py_XDECREF(py_funcname);
10932static void __Pyx_AddTraceback(
const char *funcname,
int c_line,
10933 int py_line,
const char *filename) {
10934 PyCodeObject *py_code = 0;
10935 PyFrameObject *py_frame = 0;
10936 PyThreadState *tstate = __Pyx_PyThreadState_Current;
10937 PyObject *ptype, *pvalue, *ptraceback;
10939 c_line = __Pyx_CLineForTraceback(tstate, c_line);
10941 py_code = __pyx_find_code_object(c_line ? -c_line : py_line);
10943 __Pyx_ErrFetchInState(tstate, &ptype, &pvalue, &ptraceback);
10944 py_code = __Pyx_CreateCodeObjectForTraceback(
10945 funcname, c_line, py_line, filename);
10950 Py_XDECREF(pvalue);
10951 Py_XDECREF(ptraceback);
10954 __Pyx_ErrRestoreInState(tstate, ptype, pvalue, ptraceback);
10955 __pyx_insert_code_object(c_line ? -c_line : py_line, py_code);
10957 py_frame = PyFrame_New(
10960 __pyx_mstate_global->__pyx_d,
10963 if (!py_frame)
goto bad;
10964 __Pyx_PyFrame_SetLineNumber(py_frame, py_line);
10965 PyTraceBack_Here(py_frame);
10967 Py_XDECREF(py_code);
10968 Py_XDECREF(py_frame);
10973#define __PYX_VERIFY_RETURN_INT(target_type, func_type, func_value)\
10974 __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 0)
10975#define __PYX_VERIFY_RETURN_INT_EXC(target_type, func_type, func_value)\
10976 __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 1)
10977#define __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, exc)\
10979 func_type value = func_value;\
10980 if (sizeof(target_type) < sizeof(func_type)) {\
10981 if (unlikely(value != (func_type) (target_type) value)) {\
10982 func_type zero = 0;\
10983 if (exc && unlikely(value == (func_type)-1 && PyErr_Occurred()))\
10984 return (target_type) -1;\
10985 if (is_unsigned && unlikely(value < zero))\
10986 goto raise_neg_overflow;\
10988 goto raise_overflow;\
10991 return (target_type) value;\
10995#if CYTHON_CCOMPLEX && (1) && (!0 || __cplusplus)
10997 static CYTHON_INLINE __pyx_t_float_complex __pyx_t_float_complex_from_parts(
float x,
float y) {
10998 return ::std::complex< float >(x, y);
11001 static CYTHON_INLINE __pyx_t_float_complex __pyx_t_float_complex_from_parts(
float x,
float y) {
11002 return x + y*(__pyx_t_float_complex)_Complex_I;
11006 static CYTHON_INLINE __pyx_t_float_complex __pyx_t_float_complex_from_parts(
float x,
float y) {
11007 __pyx_t_float_complex
z;
11015#if CYTHON_CCOMPLEX && (1) && (!0 || __cplusplus)
11017 static CYTHON_INLINE
int __Pyx_c_eq_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
11018 return (a.real == b.real) && (a.imag == b.imag);
11020 static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_sum_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
11021 __pyx_t_float_complex
z;
11022 z.real = a.real + b.real;
11023 z.imag = a.imag + b.imag;
11026 static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_diff_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
11027 __pyx_t_float_complex
z;
11028 z.real = a.real - b.real;
11029 z.imag = a.imag - b.imag;
11032 static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_prod_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
11033 __pyx_t_float_complex
z;
11034 z.real = a.real * b.real - a.imag * b.imag;
11035 z.imag = a.real * b.imag + a.imag * b.real;
11039 static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_quot_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
11041 return __pyx_t_float_complex_from_parts(a.real / b.real, a.imag / b.real);
11042 }
else if (fabsf(b.real) >= fabsf(b.imag)) {
11043 if (b.real == 0 && b.imag == 0) {
11044 return __pyx_t_float_complex_from_parts(a.real / b.real, a.imag / b.imag);
11046 float r = b.imag / b.real;
11047 float s = (float)(1.0) / (b.real + b.imag *
r);
11048 return __pyx_t_float_complex_from_parts(
11049 (a.real + a.imag *
r) *
s, (a.imag - a.real *
r) *
s);
11052 float r = b.real / b.imag;
11053 float s = (float)(1.0) / (b.imag + b.real *
r);
11054 return __pyx_t_float_complex_from_parts(
11055 (a.real *
r + a.imag) *
s, (a.imag *
r - a.real) *
s);
11059 static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_quot_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
11061 return __pyx_t_float_complex_from_parts(a.real / b.real, a.imag / b.real);
11063 float denom = b.real * b.real + b.imag * b.imag;
11064 return __pyx_t_float_complex_from_parts(
11065 (a.real * b.real + a.imag * b.imag) / denom,
11066 (a.imag * b.real - a.real * b.imag) / denom);
11070 static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_neg_float(__pyx_t_float_complex a) {
11071 __pyx_t_float_complex
z;
11076 static CYTHON_INLINE
int __Pyx_c_is_zero_float(__pyx_t_float_complex a) {
11077 return (a.real == 0) && (a.imag == 0);
11079 static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_conj_float(__pyx_t_float_complex a) {
11080 __pyx_t_float_complex
z;
11086 static CYTHON_INLINE
float __Pyx_c_abs_float(__pyx_t_float_complex
z) {
11087 #if !defined(HAVE_HYPOT) || defined(_MSC_VER)
11088 return sqrtf(
z.real*
z.real +
z.imag*
z.imag);
11090 return hypotf(
z.real,
z.imag);
11093 static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_pow_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
11094 __pyx_t_float_complex
z;
11095 float r, lnr, theta, z_r, z_theta;
11096 if (b.imag == 0 && b.real == (
int)b.real) {
11098 float denom = a.real * a.real + a.imag * a.imag;
11099 a.real = a.real / denom;
11100 a.imag = -a.imag / denom;
11103 switch ((
int)b.real) {
11111 return __Pyx_c_prod_float(a, a);
11113 z = __Pyx_c_prod_float(a, a);
11114 return __Pyx_c_prod_float(
z, a);
11116 z = __Pyx_c_prod_float(a, a);
11117 return __Pyx_c_prod_float(
z,
z);
11123 }
else if ((b.imag == 0) && (a.real >= 0)) {
11124 z.real = powf(a.real, b.real);
11127 }
else if (a.real > 0) {
11132 theta = atan2f(0.0, -1.0);
11135 r = __Pyx_c_abs_float(a);
11136 theta = atan2f(a.imag, a.real);
11139 z_r = expf(lnr * b.real - theta * b.imag);
11140 z_theta = theta * b.real + lnr * b.imag;
11141 z.real = z_r * cosf(z_theta);
11142 z.imag = z_r * sinf(z_theta);
11149#if CYTHON_CCOMPLEX && (1) && (!0 || __cplusplus)
11151 static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(
double x,
double y) {
11152 return ::std::complex< double >(x, y);
11155 static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(
double x,
double y) {
11156 return x + y*(__pyx_t_double_complex)_Complex_I;
11160 static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(
double x,
double y) {
11161 __pyx_t_double_complex
z;
11169#if CYTHON_CCOMPLEX && (1) && (!0 || __cplusplus)
11171 static CYTHON_INLINE
int __Pyx_c_eq_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
11172 return (a.real == b.real) && (a.imag == b.imag);
11174 static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_sum_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
11175 __pyx_t_double_complex
z;
11176 z.real = a.real + b.real;
11177 z.imag = a.imag + b.imag;
11180 static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_diff_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
11181 __pyx_t_double_complex
z;
11182 z.real = a.real - b.real;
11183 z.imag = a.imag - b.imag;
11186 static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_prod_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
11187 __pyx_t_double_complex
z;
11188 z.real = a.real * b.real - a.imag * b.imag;
11189 z.imag = a.real * b.imag + a.imag * b.real;
11193 static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_quot_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
11195 return __pyx_t_double_complex_from_parts(a.real / b.real, a.imag / b.real);
11196 }
else if (fabs(b.real) >= fabs(b.imag)) {
11197 if (b.real == 0 && b.imag == 0) {
11198 return __pyx_t_double_complex_from_parts(a.real / b.real, a.imag / b.imag);
11200 double r = b.imag / b.real;
11201 double s = (double)(1.0) / (b.real + b.imag *
r);
11202 return __pyx_t_double_complex_from_parts(
11203 (a.real + a.imag *
r) *
s, (a.imag - a.real *
r) *
s);
11206 double r = b.real / b.imag;
11207 double s = (double)(1.0) / (b.imag + b.real *
r);
11208 return __pyx_t_double_complex_from_parts(
11209 (a.real *
r + a.imag) *
s, (a.imag *
r - a.real) *
s);
11213 static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_quot_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
11215 return __pyx_t_double_complex_from_parts(a.real / b.real, a.imag / b.real);
11217 double denom = b.real * b.real + b.imag * b.imag;
11218 return __pyx_t_double_complex_from_parts(
11219 (a.real * b.real + a.imag * b.imag) / denom,
11220 (a.imag * b.real - a.real * b.imag) / denom);
11224 static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_neg_double(__pyx_t_double_complex a) {
11225 __pyx_t_double_complex
z;
11230 static CYTHON_INLINE
int __Pyx_c_is_zero_double(__pyx_t_double_complex a) {
11231 return (a.real == 0) && (a.imag == 0);
11233 static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_conj_double(__pyx_t_double_complex a) {
11234 __pyx_t_double_complex
z;
11240 static CYTHON_INLINE
double __Pyx_c_abs_double(__pyx_t_double_complex
z) {
11241 #if !defined(HAVE_HYPOT) || defined(_MSC_VER)
11242 return sqrt(
z.real*
z.real +
z.imag*
z.imag);
11244 return hypot(
z.real,
z.imag);
11247 static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_pow_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
11248 __pyx_t_double_complex
z;
11249 double r, lnr, theta, z_r, z_theta;
11250 if (b.imag == 0 && b.real == (
int)b.real) {
11252 double denom = a.real * a.real + a.imag * a.imag;
11253 a.real = a.real / denom;
11254 a.imag = -a.imag / denom;
11257 switch ((
int)b.real) {
11265 return __Pyx_c_prod_double(a, a);
11267 z = __Pyx_c_prod_double(a, a);
11268 return __Pyx_c_prod_double(
z, a);
11270 z = __Pyx_c_prod_double(a, a);
11271 return __Pyx_c_prod_double(
z,
z);
11277 }
else if ((b.imag == 0) && (a.real >= 0)) {
11278 z.real = pow(a.real, b.real);
11281 }
else if (a.real > 0) {
11286 theta = atan2(0.0, -1.0);
11289 r = __Pyx_c_abs_double(a);
11290 theta = atan2(a.imag, a.real);
11293 z_r = exp(lnr * b.real - theta * b.imag);
11294 z_theta = theta * b.real + lnr * b.imag;
11295 z.real = z_r * cos(z_theta);
11296 z.imag = z_r * sin(z_theta);
11303#if CYTHON_CCOMPLEX && (1) && (!0 || __cplusplus)
11305 static CYTHON_INLINE __pyx_t_long_double_complex __pyx_t_long_double_complex_from_parts(
long double x,
long double y) {
11306 return ::std::complex< long double >(x, y);
11309 static CYTHON_INLINE __pyx_t_long_double_complex __pyx_t_long_double_complex_from_parts(
long double x,
long double y) {
11310 return x + y*(__pyx_t_long_double_complex)_Complex_I;
11314 static CYTHON_INLINE __pyx_t_long_double_complex __pyx_t_long_double_complex_from_parts(
long double x,
long double y) {
11315 __pyx_t_long_double_complex
z;
11323#if CYTHON_CCOMPLEX && (1) && (!0 || __cplusplus)
11325 static CYTHON_INLINE
int __Pyx_c_eq_long__double(__pyx_t_long_double_complex a, __pyx_t_long_double_complex b) {
11326 return (a.real == b.real) && (a.imag == b.imag);
11328 static CYTHON_INLINE __pyx_t_long_double_complex __Pyx_c_sum_long__double(__pyx_t_long_double_complex a, __pyx_t_long_double_complex b) {
11329 __pyx_t_long_double_complex
z;
11330 z.real = a.real + b.real;
11331 z.imag = a.imag + b.imag;
11334 static CYTHON_INLINE __pyx_t_long_double_complex __Pyx_c_diff_long__double(__pyx_t_long_double_complex a, __pyx_t_long_double_complex b) {
11335 __pyx_t_long_double_complex
z;
11336 z.real = a.real - b.real;
11337 z.imag = a.imag - b.imag;
11340 static CYTHON_INLINE __pyx_t_long_double_complex __Pyx_c_prod_long__double(__pyx_t_long_double_complex a, __pyx_t_long_double_complex b) {
11341 __pyx_t_long_double_complex
z;
11342 z.real = a.real * b.real - a.imag * b.imag;
11343 z.imag = a.real * b.imag + a.imag * b.real;
11347 static CYTHON_INLINE __pyx_t_long_double_complex __Pyx_c_quot_long__double(__pyx_t_long_double_complex a, __pyx_t_long_double_complex b) {
11349 return __pyx_t_long_double_complex_from_parts(a.real / b.real, a.imag / b.real);
11350 }
else if (fabsl(b.real) >= fabsl(b.imag)) {
11351 if (b.real == 0 && b.imag == 0) {
11352 return __pyx_t_long_double_complex_from_parts(a.real / b.real, a.imag / b.imag);
11354 long double r = b.imag / b.real;
11355 long double s = (
long double)(1.0) / (b.real + b.imag *
r);
11356 return __pyx_t_long_double_complex_from_parts(
11357 (a.real + a.imag *
r) *
s, (a.imag - a.real *
r) *
s);
11360 long double r = b.real / b.imag;
11361 long double s = (
long double)(1.0) / (b.imag + b.real *
r);
11362 return __pyx_t_long_double_complex_from_parts(
11363 (a.real *
r + a.imag) *
s, (a.imag *
r - a.real) *
s);
11367 static CYTHON_INLINE __pyx_t_long_double_complex __Pyx_c_quot_long__double(__pyx_t_long_double_complex a, __pyx_t_long_double_complex b) {
11369 return __pyx_t_long_double_complex_from_parts(a.real / b.real, a.imag / b.real);
11371 long double denom = b.real * b.real + b.imag * b.imag;
11372 return __pyx_t_long_double_complex_from_parts(
11373 (a.real * b.real + a.imag * b.imag) / denom,
11374 (a.imag * b.real - a.real * b.imag) / denom);
11378 static CYTHON_INLINE __pyx_t_long_double_complex __Pyx_c_neg_long__double(__pyx_t_long_double_complex a) {
11379 __pyx_t_long_double_complex
z;
11384 static CYTHON_INLINE
int __Pyx_c_is_zero_long__double(__pyx_t_long_double_complex a) {
11385 return (a.real == 0) && (a.imag == 0);
11387 static CYTHON_INLINE __pyx_t_long_double_complex __Pyx_c_conj_long__double(__pyx_t_long_double_complex a) {
11388 __pyx_t_long_double_complex
z;
11394 static CYTHON_INLINE
long double __Pyx_c_abs_long__double(__pyx_t_long_double_complex
z) {
11395 #if !defined(HAVE_HYPOT) || defined(_MSC_VER)
11396 return sqrtl(
z.real*
z.real +
z.imag*
z.imag);
11398 return hypotl(
z.real,
z.imag);
11401 static CYTHON_INLINE __pyx_t_long_double_complex __Pyx_c_pow_long__double(__pyx_t_long_double_complex a, __pyx_t_long_double_complex b) {
11402 __pyx_t_long_double_complex
z;
11403 long double r, lnr, theta, z_r, z_theta;
11404 if (b.imag == 0 && b.real == (
int)b.real) {
11406 long double denom = a.real * a.real + a.imag * a.imag;
11407 a.real = a.real / denom;
11408 a.imag = -a.imag / denom;
11411 switch ((
int)b.real) {
11419 return __Pyx_c_prod_long__double(a, a);
11421 z = __Pyx_c_prod_long__double(a, a);
11422 return __Pyx_c_prod_long__double(
z, a);
11424 z = __Pyx_c_prod_long__double(a, a);
11425 return __Pyx_c_prod_long__double(
z,
z);
11431 }
else if ((b.imag == 0) && (a.real >= 0)) {
11432 z.real = powl(a.real, b.real);
11435 }
else if (a.real > 0) {
11440 theta = atan2l(0.0, -1.0);
11443 r = __Pyx_c_abs_long__double(a);
11444 theta = atan2l(a.imag, a.real);
11447 z_r = expl(lnr * b.real - theta * b.imag);
11448 z_theta = theta * b.real + lnr * b.imag;
11449 z.real = z_r * cosl(z_theta);
11450 z.imag = z_r * sinl(z_theta);
11457static int __Pyx_LargePyLong___Pyx_PyLong_As_int(PyObject *x);
11458static int __Pyx_raise_neg_overflow___Pyx_PyLong_As_int(
void) {
11459 const char* type_name =
"int";
11460 PyErr_Format(PyExc_OverflowError,
11461 "can't convert negative value to %.200s", type_name);
11464static int __Pyx_raise_overflow___Pyx_PyLong_As_int(
void) {
11465 const char* type_name =
"int";
11466 PyErr_Format(PyExc_OverflowError,
11467 "value too large to convert to %.200s", type_name);
11470static CYTHON_INLINE
int __Pyx_PyULong___Pyx_PyLong_As_int(PyObject *x) {
11471 const int is_unsigned = 1;
11472#if CYTHON_USE_PYLONG_INTERNALS
11474 const digit* digits = __Pyx_PyLong_Digits(x);
11475 const Py_ssize_t size = __Pyx_PyLong_DigitCount(x);
11476 if (size == 2 && (8 *
sizeof(
int) > 1 * PyLong_SHIFT)) {
11477 if ((8 *
sizeof(
unsigned long) > 2 * PyLong_SHIFT)) {
11478 __PYX_VERIFY_RETURN_INT(
int,
unsigned long, (((((
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
11479 }
else if ((8 *
sizeof(
int) >= 2 * PyLong_SHIFT)) {
11480 return (
int) (((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0]));
11483 if (size == 3 && (8 *
sizeof(
int) > 2 * PyLong_SHIFT)) {
11484 if ((8 *
sizeof(
unsigned long) > 3 * PyLong_SHIFT)) {
11485 __PYX_VERIFY_RETURN_INT(
int,
unsigned long, (((((((
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
11486 }
else if ((8 *
sizeof(
int) >= 3 * PyLong_SHIFT)) {
11487 return (
int) (((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]));
11490 if (size == 4 && (8 *
sizeof(
int) > 3 * PyLong_SHIFT)) {
11491 if ((8 *
sizeof(
unsigned long) > 4 * PyLong_SHIFT)) {
11492 __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])))
11493 }
else if ((8 *
sizeof(
int) >= 4 * PyLong_SHIFT)) {
11494 return (
int) (((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]));
11499#elif CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030C00A7
11500 if (unlikely(Py_SIZE(x) < 0)) {
11501 goto raise_neg_overflow;
11505 int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
11506 if (unlikely(result < 0))
11508 if (unlikely(result == 1))
11509 goto raise_neg_overflow;
11512 if ((
sizeof(
int) <=
sizeof(
unsigned long))) {
11513 __PYX_VERIFY_RETURN_INT_EXC(
int,
unsigned long, PyLong_AsUnsignedLong(x))
11514 }
else if ((
sizeof(
int) <=
sizeof(
unsigned PY_LONG_LONG))) {
11515 __PYX_VERIFY_RETURN_INT_EXC(
int,
unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
11517 return __Pyx_LargePyLong___Pyx_PyLong_As_int(x);
11519 return __Pyx_raise_neg_overflow___Pyx_PyLong_As_int();
11521 return __Pyx_raise_overflow___Pyx_PyLong_As_int();
11523static CYTHON_INLINE
int __Pyx_PySLong___Pyx_PyLong_As_int(PyObject *x) {
11524 const int is_unsigned = 0;
11525#if CYTHON_USE_PYLONG_INTERNALS
11526 if (__Pyx_PyLong_IsNeg(x)) {
11527 const Py_ssize_t size = __Pyx_PyLong_DigitCount(x);
11528 const digit* digits = __Pyx_PyLong_Digits(x);
11529 if (size == 2 && (8 *
sizeof(
int) > 1 * PyLong_SHIFT)) {
11530 if ((8 *
sizeof(
long) > 2 * PyLong_SHIFT)) {
11531 long ival = - (long) (((((
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0]));
11532 __PYX_VERIFY_RETURN_INT(
int,
long, ival)
11533 }
else if ((8 *
sizeof(
int) - 1 > 2 * PyLong_SHIFT)) {
11534 return (
int) (((int) -1) * (((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
11537 if (size == 3 && (8 *
sizeof(
int) > 2 * PyLong_SHIFT)) {
11538 if ((8 *
sizeof(
long) > 3 * PyLong_SHIFT)) {
11539 long ival = - (long) (((((((
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0]));
11540 __PYX_VERIFY_RETURN_INT(
int,
long, ival)
11541 }
else if ((8 *
sizeof(
int) - 1 > 3 * PyLong_SHIFT)) {
11542 return (
int) (((int) -1) * (((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
11545 if (size == 4 && (8 *
sizeof(
int) > 3 * PyLong_SHIFT)) {
11546 if ((8 *
sizeof(
long) > 4 * PyLong_SHIFT)) {
11547 long ival = - (long) (((((((((
unsigned long)digits[3]) << PyLong_SHIFT) | (
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0]));
11548 __PYX_VERIFY_RETURN_INT(
int,
long, ival)
11549 }
else if ((8 *
sizeof(
int) - 1 > 4 * PyLong_SHIFT)) {
11550 return (
int) (((int) -1) * (((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
11555 const Py_ssize_t size = __Pyx_PyLong_DigitCount(x);
11556 const digit* digits = __Pyx_PyLong_Digits(x);
11557 if (size == 2 && (8 *
sizeof(
int) > 1 * PyLong_SHIFT)) {
11558 if ((8 *
sizeof(
long) > 2 * PyLong_SHIFT)) {
11559 __PYX_VERIFY_RETURN_INT(
int,
unsigned long, (((((
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
11560 }
else if ((8 *
sizeof(
int) - 1 > 2 * PyLong_SHIFT)) {
11561 return (
int) (((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0]));
11564 if (size == 3 && (8 *
sizeof(
int) > 2 * PyLong_SHIFT)) {
11565 if ((8 *
sizeof(
long) > 3 * PyLong_SHIFT)) {
11566 __PYX_VERIFY_RETURN_INT(
int,
unsigned long, (((((((
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
11567 }
else if ((8 *
sizeof(
int) - 1 > 3 * PyLong_SHIFT)) {
11568 return (
int) (((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]));
11571 if (size == 4 && (8 *
sizeof(
int) > 3 * PyLong_SHIFT)) {
11572 if ((8 *
sizeof(
long) > 4 * PyLong_SHIFT)) {
11573 __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])))
11574 }
else if ((8 *
sizeof(
int) - 1 > 4 * PyLong_SHIFT)) {
11575 return (
int) (((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]));
11581 #if __PYX_LIMITED_VERSION_HEX >= 0x030d0000
11582 if ((
sizeof(
int) <=
sizeof(
int)) && (
sizeof(
int) <
sizeof(
long))) {
11583 __PYX_VERIFY_RETURN_INT_EXC(
int,
int, PyLong_AsInt(x))
11586 if ((
sizeof(
int) <=
sizeof(
long))) {
11587 __PYX_VERIFY_RETURN_INT_EXC(
int,
long, PyLong_AsLong(x))
11588 }
else if ((
sizeof(
int) <=
sizeof(PY_LONG_LONG))) {
11589 __PYX_VERIFY_RETURN_INT_EXC(
int, PY_LONG_LONG, PyLong_AsLongLong(x))
11591 return __Pyx_LargePyLong___Pyx_PyLong_As_int(x);
11593 return __Pyx_raise_neg_overflow___Pyx_PyLong_As_int();
11595 return __Pyx_raise_overflow___Pyx_PyLong_As_int();
11597static int __Pyx_LargePyLong___Pyx_PyLong_As_int(PyObject *x) {
11598#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
11599#pragma GCC diagnostic push
11600#pragma GCC diagnostic ignored "-Wconversion"
11602 const int neg_one = (int) -1, const_zero = (
int) 0;
11603#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
11604#pragma GCC diagnostic pop
11606 const int is_unsigned = neg_one > const_zero;
11609#if PY_VERSION_HEX >= 0x030d00A6 && !CYTHON_COMPILING_IN_LIMITED_API
11610 Py_ssize_t bytes_copied = PyLong_AsNativeBytes(
11611 x, &val,
sizeof(val), Py_ASNATIVEBYTES_NATIVE_ENDIAN | (is_unsigned ? Py_ASNATIVEBYTES_UNSIGNED_BUFFER | Py_ASNATIVEBYTES_REJECT_NEGATIVE : 0));
11612 if (unlikely(bytes_copied == -1)) {
11613 }
else if (unlikely(bytes_copied > (Py_ssize_t)
sizeof(val))) {
11614 goto raise_overflow;
11618#elif PY_VERSION_HEX < 0x030d0000 && !(CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API) || defined(_PyLong_AsByteArray)
11619 int one = 1;
int is_little = (int)*(
unsigned char *)&one;
11620 unsigned char *bytes = (
unsigned char *)&val;
11621 ret = _PyLong_AsByteArray((PyLongObject *)x,
11622 bytes,
sizeof(val),
11623 is_little, !is_unsigned);
11624 if ((0))
goto raise_overflow;
11627 PyObject *stepval = NULL, *mask = NULL, *shift = NULL;
11628 int bits, remaining_bits, is_negative = 0;
11629 int chunk_size = (
sizeof(long) < 8) ? 30 : 62;
11630 if (likely(PyLong_CheckExact(x))) {
11631 v = __Pyx_NewRef(x);
11633 v = PyNumber_Long(x);
11634 if (unlikely(!
v))
return (
int) -1;
11635 assert(PyLong_CheckExact(
v));
11638 int result = PyObject_RichCompareBool(
v, Py_False, Py_LT);
11639 if (unlikely(result < 0)) {
11643 is_negative = result == 1;
11645 if (is_unsigned && unlikely(is_negative)) {
11647 PyErr_SetString(PyExc_OverflowError,
11648 "can't convert negative value to int");
11650 }
else if (is_negative) {
11651 stepval = PyNumber_Invert(
v);
11653 if (unlikely(!stepval))
11660 mask = PyLong_FromLong((1L << chunk_size) - 1);
if (unlikely(!mask))
goto done;
11661 shift = PyLong_FromLong(chunk_size);
if (unlikely(!shift))
goto done;
11662 for (bits = 0; bits < (int)
sizeof(int) * 8 - chunk_size; bits += chunk_size) {
11663 PyObject *tmp, *digit;
11665 digit = PyNumber_And(stepval, mask);
11666 if (unlikely(!digit))
goto done;
11667 idigit = PyLong_AsLong(digit);
11669 if (unlikely(idigit < 0))
goto done;
11670 val |= ((int) idigit) << bits;
11671 tmp = PyNumber_Rshift(stepval, shift);
11672 if (unlikely(!tmp))
goto done;
11673 Py_DECREF(stepval); stepval = tmp;
11675 Py_DECREF(shift); shift = NULL;
11676 Py_DECREF(mask); mask = NULL;
11678 long idigit = PyLong_AsLong(stepval);
11679 if (unlikely(idigit < 0))
goto done;
11680 remaining_bits = ((int)
sizeof(int) * 8) - bits - (is_unsigned ? 0 : 1);
11681 if (unlikely(idigit >= (1L << remaining_bits)))
11682 goto raise_overflow;
11683 val |= ((int) idigit) << bits;
11685 if (!is_unsigned) {
11686 if (unlikely(val & (((
int) 1) << (
sizeof(
int) * 8 - 1))))
11687 goto raise_overflow;
11695 Py_XDECREF(stepval);
11701 return __Pyx_raise_overflow___Pyx_PyLong_As_int();
11703static CYTHON_INLINE
int __Pyx_PyLong___Pyx_PyLong_As_int(PyObject *x) {
11704#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
11705#pragma GCC diagnostic push
11706#pragma GCC diagnostic ignored "-Wconversion"
11708 const int neg_one = (int) -1, const_zero = (
int) 0;
11709#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
11710#pragma GCC diagnostic pop
11712 const int is_unsigned = neg_one > const_zero;
11714 #if CYTHON_USE_PYLONG_INTERNALS
11715 if (unlikely(__Pyx_PyLong_IsNeg(x))) {
11716 goto raise_neg_overflow;
11717 }
else if (__Pyx_PyLong_IsCompact(x)) {
11718 __PYX_VERIFY_RETURN_INT(
int, __Pyx_compact_upylong, __Pyx_PyLong_CompactValueUnsigned(x))
11722 return __Pyx_PyULong___Pyx_PyLong_As_int(x);
11725 #if CYTHON_USE_PYLONG_INTERNALS
11726 if (__Pyx_PyLong_IsCompact(x)) {
11727 __PYX_VERIFY_RETURN_INT(
int, __Pyx_compact_pylong, __Pyx_PyLong_CompactValue(x))
11731 return __Pyx_PySLong___Pyx_PyLong_As_int(x);
11734#if CYTHON_USE_PYLONG_INTERNALS
11736 return __Pyx_raise_neg_overflow___Pyx_PyLong_As_int();
11738 return __Pyx_raise_overflow___Pyx_PyLong_As_int();
11741static int __Pyx_NonPyLong___Pyx_PyLong_As_int(PyObject *x) {
11743 PyObject *tmp = __Pyx_PyNumber_Long(x);
11744 if (!tmp)
return (
int) -1;
11745 val = __Pyx_PyLong_As_int(tmp);
11749static CYTHON_INLINE
int __Pyx_PyLong_As_int(PyObject *x) {
11750 if (likely(PyLong_Check(x))) {
11751 return __Pyx_PyLong___Pyx_PyLong_As_int(x);
11753 return __Pyx_NonPyLong___Pyx_PyLong_As_int(x);
11758#if CYTHON_VECTORCALL
11759CYTHON_UNUSED
static int __Pyx_CheckVectorcallKwarg(PyObject *kwnames, Py_ssize_t i) {
11760 PyObject *key = __Pyx_PyTuple_GET_ITEM(kwnames, i);
11761#if !CYTHON_ASSUME_SAFE_MACROS
11762 if (unlikely(!key))
return -1;
11764 if (unlikely(!PyUnicode_Check(key))) {
11765 PyErr_SetString(PyExc_TypeError,
"keywords must be strings");
11771CYTHON_UNUSED
static PyObject *__Pyx_MakeKwargDict(PyObject **keys, PyObject **values, Py_ssize_t
n) {
11772 PyObject *out = PyDict_New();
11773 if (unlikely(!out))
return NULL;
11774 for (Py_ssize_t i=0; i<
n; ++i) {
11775 if (unlikely(PyDict_SetItem(out, keys[i], values[i]) < 0)) {
11782CYTHON_UNUSED
static int __Pyx_CheckVectorcallKwarg(PyObject **kwnames, Py_ssize_t i) {
11783 PyObject *key = kwnames[i];
11784 if (unlikely(!PyUnicode_Check(key))) {
11785 PyErr_SetString(PyExc_TypeError,
"keywords must be strings");
11793#if !CYTHON_VECTORCALL
11794static PyObject *__Pyx_Object_VectorcallMethodKwds(PyObject *name, PyObject *
const *args,
size_t nargsf, PyObject *kwnames) {
11796 PyObject *obj = PyObject_GetAttr(args[0], name);
11797 if (unlikely(!obj))
11799 result = __Pyx_Object_VectorcallKwds(obj, args+1, nargsf-1, kwnames);
11806static CYTHON_INLINE PyObject* __Pyx_PyLong_From_int(
int value) {
11807#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
11808#pragma GCC diagnostic push
11809#pragma GCC diagnostic ignored "-Wconversion"
11811 const int neg_one = (int) -1, const_zero = (
int) 0;
11812#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
11813#pragma GCC diagnostic pop
11815 const int is_unsigned = neg_one > const_zero;
11817 if (
sizeof(
int) <
sizeof(
long)) {
11818 return PyLong_FromLong((
long) value);
11819 }
else if (
sizeof(
int) <=
sizeof(
unsigned long)) {
11820 return PyLong_FromUnsignedLong((
unsigned long) value);
11821#if !CYTHON_COMPILING_IN_PYPY
11822 }
else if (
sizeof(
int) <=
sizeof(
unsigned PY_LONG_LONG)) {
11823 return PyLong_FromUnsignedLongLong((
unsigned PY_LONG_LONG) value);
11827 if (
sizeof(
int) <=
sizeof(
long)) {
11828 return PyLong_FromLong((
long) value);
11829 }
else if (
sizeof(
int) <=
sizeof(PY_LONG_LONG)) {
11830 return PyLong_FromLongLong((PY_LONG_LONG) value);
11834 unsigned char *bytes = (
unsigned char *)&value;
11835#if !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX >= 0x030d00A4
11837 return PyLong_FromUnsignedNativeBytes(bytes,
sizeof(value), -1);
11839 return PyLong_FromNativeBytes(bytes,
sizeof(value), -1);
11841#elif !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030d0000
11842 int one = 1;
int little = (int)*(
unsigned char *)&one;
11843 return _PyLong_FromByteArray(bytes,
sizeof(
int),
11844 little, !is_unsigned);
11846 int one = 1;
int little = (int)*(
unsigned char *)&one;
11847 PyObject *result = NULL, *kwds = NULL;
11848 PyObject *py_bytes = NULL, *order_str = NULL, *from_bytes_str = NULL;;
11849 py_bytes = PyBytes_FromStringAndSize((
char*)bytes,
sizeof(
int));
11850 if (!py_bytes)
goto limited_bad;
11851 from_bytes_str = PyUnicode_FromStringAndSize(
"from_bytes", 10);
11852 if (!from_bytes_str)
goto limited_bad;
11853 order_str = PyUnicode_FromString(little ?
"little" :
"big");
11854 if (!order_str)
goto limited_bad;
11856 PyObject *args[] = { (PyObject*)&PyLong_Type, py_bytes, order_str, Py_True };
11857 if (!is_unsigned) {
11858 PyObject *signed_str = PyUnicode_FromStringAndSize(
"signed", 6);
11859 if (!signed_str)
goto limited_bad;
11860#if CYTHON_VECTORCALL
11861 kwds = PyTuple_Pack(1, signed_str);
11864 PyObject *keys[] = {signed_str};
11865 PyObject *values[] = {Py_True};
11866 kwds = __Pyx_MakeKwargDict(keys, values, 1);
11869 Py_DECREF(signed_str);
11870 if (unlikely(!kwds))
goto limited_bad;
11872 result = __Pyx_Object_VectorcallMethodKwds(from_bytes_str, args, 3 | __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET, kwds);
11876 Py_XDECREF(order_str);
11877 Py_XDECREF(py_bytes);
11878 Py_XDECREF(from_bytes_str);
11885#if CYTHON_COMPILING_IN_LIMITED_API && __PYX_LIMITED_VERSION_HEX < 0x030d0000
11886static __Pyx_TypeName
11887__Pyx_PyType_GetFullyQualifiedName(PyTypeObject* tp)
11889 PyObject *module = NULL, *name = NULL, *result = NULL;
11890 #if __PYX_LIMITED_VERSION_HEX < 0x030b0000
11891 name = __Pyx_PyObject_GetAttrStr((PyObject *)tp,
11892 __pyx_mstate_global->__pyx_n_u_qualname);
11894 name = PyType_GetQualName(tp);
11896 if (unlikely(name == NULL) || unlikely(!PyUnicode_Check(name)))
goto bad;
11897 module = __Pyx_PyObject_GetAttrStr((PyObject *)tp,
11898 __pyx_mstate_global->__pyx_n_u_module);
11899 if (unlikely(module == NULL) || unlikely(!PyUnicode_Check(module)))
goto bad;
11900 if (PyUnicode_CompareWithASCIIString(module,
"builtins") == 0) {
11905 result = PyUnicode_FromFormat(
"%U.%U", module, name);
11906 if (unlikely(result == NULL))
goto bad;
11909 Py_XDECREF(module);
11917 result = __Pyx_NewRef(__pyx_mstate_global->__pyx_kp_u_);
11924static CYTHON_INLINE PyObject* __Pyx_PyLong_From_long(
long value) {
11925#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
11926#pragma GCC diagnostic push
11927#pragma GCC diagnostic ignored "-Wconversion"
11929 const long neg_one = (long) -1, const_zero = (
long) 0;
11930#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
11931#pragma GCC diagnostic pop
11933 const int is_unsigned = neg_one > const_zero;
11935 if (
sizeof(
long) <
sizeof(
long)) {
11936 return PyLong_FromLong((
long) value);
11937 }
else if (
sizeof(
long) <=
sizeof(
unsigned long)) {
11938 return PyLong_FromUnsignedLong((
unsigned long) value);
11939#if !CYTHON_COMPILING_IN_PYPY
11940 }
else if (
sizeof(
long) <=
sizeof(
unsigned PY_LONG_LONG)) {
11941 return PyLong_FromUnsignedLongLong((
unsigned PY_LONG_LONG) value);
11945 if (
sizeof(
long) <=
sizeof(
long)) {
11946 return PyLong_FromLong((
long) value);
11947 }
else if (
sizeof(
long) <=
sizeof(PY_LONG_LONG)) {
11948 return PyLong_FromLongLong((PY_LONG_LONG) value);
11952 unsigned char *bytes = (
unsigned char *)&value;
11953#if !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX >= 0x030d00A4
11955 return PyLong_FromUnsignedNativeBytes(bytes,
sizeof(value), -1);
11957 return PyLong_FromNativeBytes(bytes,
sizeof(value), -1);
11959#elif !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030d0000
11960 int one = 1;
int little = (int)*(
unsigned char *)&one;
11961 return _PyLong_FromByteArray(bytes,
sizeof(
long),
11962 little, !is_unsigned);
11964 int one = 1;
int little = (int)*(
unsigned char *)&one;
11965 PyObject *result = NULL, *kwds = NULL;
11966 PyObject *py_bytes = NULL, *order_str = NULL, *from_bytes_str = NULL;;
11967 py_bytes = PyBytes_FromStringAndSize((
char*)bytes,
sizeof(
long));
11968 if (!py_bytes)
goto limited_bad;
11969 from_bytes_str = PyUnicode_FromStringAndSize(
"from_bytes", 10);
11970 if (!from_bytes_str)
goto limited_bad;
11971 order_str = PyUnicode_FromString(little ?
"little" :
"big");
11972 if (!order_str)
goto limited_bad;
11974 PyObject *args[] = { (PyObject*)&PyLong_Type, py_bytes, order_str, Py_True };
11975 if (!is_unsigned) {
11976 PyObject *signed_str = PyUnicode_FromStringAndSize(
"signed", 6);
11977 if (!signed_str)
goto limited_bad;
11978#if CYTHON_VECTORCALL
11979 kwds = PyTuple_Pack(1, signed_str);
11982 PyObject *keys[] = {signed_str};
11983 PyObject *values[] = {Py_True};
11984 kwds = __Pyx_MakeKwargDict(keys, values, 1);
11987 Py_DECREF(signed_str);
11988 if (unlikely(!kwds))
goto limited_bad;
11990 result = __Pyx_Object_VectorcallMethodKwds(from_bytes_str, args, 3 | __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET, kwds);
11994 Py_XDECREF(order_str);
11995 Py_XDECREF(py_bytes);
11996 Py_XDECREF(from_bytes_str);
12003static long __Pyx_LargePyLong___Pyx_PyLong_As_long(PyObject *x);
12004static long __Pyx_raise_neg_overflow___Pyx_PyLong_As_long(
void) {
12005 const char* type_name =
"long";
12006 PyErr_Format(PyExc_OverflowError,
12007 "can't convert negative value to %.200s", type_name);
12010static long __Pyx_raise_overflow___Pyx_PyLong_As_long(
void) {
12011 const char* type_name =
"long";
12012 PyErr_Format(PyExc_OverflowError,
12013 "value too large to convert to %.200s", type_name);
12016static CYTHON_INLINE
long __Pyx_PyULong___Pyx_PyLong_As_long(PyObject *x) {
12017 const int is_unsigned = 1;
12018#if CYTHON_USE_PYLONG_INTERNALS
12020 const digit* digits = __Pyx_PyLong_Digits(x);
12021 const Py_ssize_t size = __Pyx_PyLong_DigitCount(x);
12022 if (size == 2 && (8 *
sizeof(
long) > 1 * PyLong_SHIFT)) {
12023 if ((8 *
sizeof(
unsigned long) > 2 * PyLong_SHIFT)) {
12024 __PYX_VERIFY_RETURN_INT(
long,
unsigned long, (((((
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
12025 }
else if ((8 *
sizeof(
long) >= 2 * PyLong_SHIFT)) {
12026 return (
long) (((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0]));
12029 if (size == 3 && (8 *
sizeof(
long) > 2 * PyLong_SHIFT)) {
12030 if ((8 *
sizeof(
unsigned long) > 3 * PyLong_SHIFT)) {
12031 __PYX_VERIFY_RETURN_INT(
long,
unsigned long, (((((((
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
12032 }
else if ((8 *
sizeof(
long) >= 3 * PyLong_SHIFT)) {
12033 return (
long) (((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]));
12036 if (size == 4 && (8 *
sizeof(
long) > 3 * PyLong_SHIFT)) {
12037 if ((8 *
sizeof(
unsigned long) > 4 * PyLong_SHIFT)) {
12038 __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])))
12039 }
else if ((8 *
sizeof(
long) >= 4 * PyLong_SHIFT)) {
12040 return (
long) (((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]));
12045#elif CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030C00A7
12046 if (unlikely(Py_SIZE(x) < 0)) {
12047 goto raise_neg_overflow;
12051 int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
12052 if (unlikely(result < 0))
12054 if (unlikely(result == 1))
12055 goto raise_neg_overflow;
12058 if ((
sizeof(
long) <=
sizeof(
unsigned long))) {
12059 __PYX_VERIFY_RETURN_INT_EXC(
long,
unsigned long, PyLong_AsUnsignedLong(x))
12060 }
else if ((
sizeof(
long) <=
sizeof(
unsigned PY_LONG_LONG))) {
12061 __PYX_VERIFY_RETURN_INT_EXC(
long,
unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
12063 return __Pyx_LargePyLong___Pyx_PyLong_As_long(x);
12065 return __Pyx_raise_neg_overflow___Pyx_PyLong_As_long();
12067 return __Pyx_raise_overflow___Pyx_PyLong_As_long();
12069static CYTHON_INLINE
long __Pyx_PySLong___Pyx_PyLong_As_long(PyObject *x) {
12070 const int is_unsigned = 0;
12071#if CYTHON_USE_PYLONG_INTERNALS
12072 if (__Pyx_PyLong_IsNeg(x)) {
12073 const Py_ssize_t size = __Pyx_PyLong_DigitCount(x);
12074 const digit* digits = __Pyx_PyLong_Digits(x);
12075 if (size == 2 && (8 *
sizeof(
long) > 1 * PyLong_SHIFT)) {
12076 if ((8 *
sizeof(
long) > 2 * PyLong_SHIFT)) {
12077 long ival = - (long) (((((
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0]));
12078 __PYX_VERIFY_RETURN_INT(
long,
long, ival)
12079 }
else if ((8 *
sizeof(
long) - 1 > 2 * PyLong_SHIFT)) {
12080 return (
long) (((long) -1) * (((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
12083 if (size == 3 && (8 *
sizeof(
long) > 2 * PyLong_SHIFT)) {
12084 if ((8 *
sizeof(
long) > 3 * PyLong_SHIFT)) {
12085 long ival = - (long) (((((((
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0]));
12086 __PYX_VERIFY_RETURN_INT(
long,
long, ival)
12087 }
else if ((8 *
sizeof(
long) - 1 > 3 * PyLong_SHIFT)) {
12088 return (
long) (((long) -1) * (((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
12091 if (size == 4 && (8 *
sizeof(
long) > 3 * PyLong_SHIFT)) {
12092 if ((8 *
sizeof(
long) > 4 * PyLong_SHIFT)) {
12093 long ival = - (long) (((((((((
unsigned long)digits[3]) << PyLong_SHIFT) | (
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0]));
12094 __PYX_VERIFY_RETURN_INT(
long,
long, ival)
12095 }
else if ((8 *
sizeof(
long) - 1 > 4 * PyLong_SHIFT)) {
12096 return (
long) (((long) -1) * (((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
12101 const Py_ssize_t size = __Pyx_PyLong_DigitCount(x);
12102 const digit* digits = __Pyx_PyLong_Digits(x);
12103 if (size == 2 && (8 *
sizeof(
long) > 1 * PyLong_SHIFT)) {
12104 if ((8 *
sizeof(
long) > 2 * PyLong_SHIFT)) {
12105 __PYX_VERIFY_RETURN_INT(
long,
unsigned long, (((((
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
12106 }
else if ((8 *
sizeof(
long) - 1 > 2 * PyLong_SHIFT)) {
12107 return (
long) (((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0]));
12110 if (size == 3 && (8 *
sizeof(
long) > 2 * PyLong_SHIFT)) {
12111 if ((8 *
sizeof(
long) > 3 * PyLong_SHIFT)) {
12112 __PYX_VERIFY_RETURN_INT(
long,
unsigned long, (((((((
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
12113 }
else if ((8 *
sizeof(
long) - 1 > 3 * PyLong_SHIFT)) {
12114 return (
long) (((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]));
12117 if (size == 4 && (8 *
sizeof(
long) > 3 * PyLong_SHIFT)) {
12118 if ((8 *
sizeof(
long) > 4 * PyLong_SHIFT)) {
12119 __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])))
12120 }
else if ((8 *
sizeof(
long) - 1 > 4 * PyLong_SHIFT)) {
12121 return (
long) (((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]));
12127 #if __PYX_LIMITED_VERSION_HEX >= 0x030d0000
12128 if ((
sizeof(
long) <=
sizeof(
int)) && (
sizeof(
int) <
sizeof(
long))) {
12129 __PYX_VERIFY_RETURN_INT_EXC(
long,
int, PyLong_AsInt(x))
12132 if ((
sizeof(
long) <=
sizeof(
long))) {
12133 __PYX_VERIFY_RETURN_INT_EXC(
long,
long, PyLong_AsLong(x))
12134 }
else if ((
sizeof(
long) <=
sizeof(PY_LONG_LONG))) {
12135 __PYX_VERIFY_RETURN_INT_EXC(
long, PY_LONG_LONG, PyLong_AsLongLong(x))
12137 return __Pyx_LargePyLong___Pyx_PyLong_As_long(x);
12139 return __Pyx_raise_neg_overflow___Pyx_PyLong_As_long();
12141 return __Pyx_raise_overflow___Pyx_PyLong_As_long();
12143static long __Pyx_LargePyLong___Pyx_PyLong_As_long(PyObject *x) {
12144#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
12145#pragma GCC diagnostic push
12146#pragma GCC diagnostic ignored "-Wconversion"
12148 const long neg_one = (long) -1, const_zero = (
long) 0;
12149#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
12150#pragma GCC diagnostic pop
12152 const int is_unsigned = neg_one > const_zero;
12155#if PY_VERSION_HEX >= 0x030d00A6 && !CYTHON_COMPILING_IN_LIMITED_API
12156 Py_ssize_t bytes_copied = PyLong_AsNativeBytes(
12157 x, &val,
sizeof(val), Py_ASNATIVEBYTES_NATIVE_ENDIAN | (is_unsigned ? Py_ASNATIVEBYTES_UNSIGNED_BUFFER | Py_ASNATIVEBYTES_REJECT_NEGATIVE : 0));
12158 if (unlikely(bytes_copied == -1)) {
12159 }
else if (unlikely(bytes_copied > (Py_ssize_t)
sizeof(val))) {
12160 goto raise_overflow;
12164#elif PY_VERSION_HEX < 0x030d0000 && !(CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API) || defined(_PyLong_AsByteArray)
12165 int one = 1;
int is_little = (int)*(
unsigned char *)&one;
12166 unsigned char *bytes = (
unsigned char *)&val;
12167 ret = _PyLong_AsByteArray((PyLongObject *)x,
12168 bytes,
sizeof(val),
12169 is_little, !is_unsigned);
12170 if ((0))
goto raise_overflow;
12173 PyObject *stepval = NULL, *mask = NULL, *shift = NULL;
12174 int bits, remaining_bits, is_negative = 0;
12175 int chunk_size = (
sizeof(long) < 8) ? 30 : 62;
12176 if (likely(PyLong_CheckExact(x))) {
12177 v = __Pyx_NewRef(x);
12179 v = PyNumber_Long(x);
12180 if (unlikely(!
v))
return (
long) -1;
12181 assert(PyLong_CheckExact(
v));
12184 int result = PyObject_RichCompareBool(
v, Py_False, Py_LT);
12185 if (unlikely(result < 0)) {
12189 is_negative = result == 1;
12191 if (is_unsigned && unlikely(is_negative)) {
12193 PyErr_SetString(PyExc_OverflowError,
12194 "can't convert negative value to long");
12196 }
else if (is_negative) {
12197 stepval = PyNumber_Invert(
v);
12199 if (unlikely(!stepval))
12206 mask = PyLong_FromLong((1L << chunk_size) - 1);
if (unlikely(!mask))
goto done;
12207 shift = PyLong_FromLong(chunk_size);
if (unlikely(!shift))
goto done;
12208 for (bits = 0; bits < (int)
sizeof(long) * 8 - chunk_size; bits += chunk_size) {
12209 PyObject *tmp, *digit;
12211 digit = PyNumber_And(stepval, mask);
12212 if (unlikely(!digit))
goto done;
12213 idigit = PyLong_AsLong(digit);
12215 if (unlikely(idigit < 0))
goto done;
12216 val |= ((long) idigit) << bits;
12217 tmp = PyNumber_Rshift(stepval, shift);
12218 if (unlikely(!tmp))
goto done;
12219 Py_DECREF(stepval); stepval = tmp;
12221 Py_DECREF(shift); shift = NULL;
12222 Py_DECREF(mask); mask = NULL;
12224 long idigit = PyLong_AsLong(stepval);
12225 if (unlikely(idigit < 0))
goto done;
12226 remaining_bits = ((int)
sizeof(long) * 8) - bits - (is_unsigned ? 0 : 1);
12227 if (unlikely(idigit >= (1L << remaining_bits)))
12228 goto raise_overflow;
12229 val |= ((long) idigit) << bits;
12231 if (!is_unsigned) {
12232 if (unlikely(val & (((
long) 1) << (
sizeof(
long) * 8 - 1))))
12233 goto raise_overflow;
12241 Py_XDECREF(stepval);
12247 return __Pyx_raise_overflow___Pyx_PyLong_As_long();
12249static CYTHON_INLINE
long __Pyx_PyLong___Pyx_PyLong_As_long(PyObject *x) {
12250#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
12251#pragma GCC diagnostic push
12252#pragma GCC diagnostic ignored "-Wconversion"
12254 const long neg_one = (long) -1, const_zero = (
long) 0;
12255#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
12256#pragma GCC diagnostic pop
12258 const int is_unsigned = neg_one > const_zero;
12260 #if CYTHON_USE_PYLONG_INTERNALS
12261 if (unlikely(__Pyx_PyLong_IsNeg(x))) {
12262 goto raise_neg_overflow;
12263 }
else if (__Pyx_PyLong_IsCompact(x)) {
12264 __PYX_VERIFY_RETURN_INT(
long, __Pyx_compact_upylong, __Pyx_PyLong_CompactValueUnsigned(x))
12268 return __Pyx_PyULong___Pyx_PyLong_As_long(x);
12271 #if CYTHON_USE_PYLONG_INTERNALS
12272 if (__Pyx_PyLong_IsCompact(x)) {
12273 __PYX_VERIFY_RETURN_INT(
long, __Pyx_compact_pylong, __Pyx_PyLong_CompactValue(x))
12277 return __Pyx_PySLong___Pyx_PyLong_As_long(x);
12280#if CYTHON_USE_PYLONG_INTERNALS
12282 return __Pyx_raise_neg_overflow___Pyx_PyLong_As_long();
12284 return __Pyx_raise_overflow___Pyx_PyLong_As_long();
12287static long __Pyx_NonPyLong___Pyx_PyLong_As_long(PyObject *x) {
12289 PyObject *tmp = __Pyx_PyNumber_Long(x);
12290 if (!tmp)
return (
long) -1;
12291 val = __Pyx_PyLong_As_long(tmp);
12295static CYTHON_INLINE
long __Pyx_PyLong_As_long(PyObject *x) {
12296 if (likely(PyLong_Check(x))) {
12297 return __Pyx_PyLong___Pyx_PyLong_As_long(x);
12299 return __Pyx_NonPyLong___Pyx_PyLong_As_long(x);
12304#if __PYX_LIMITED_VERSION_HEX < 0x030b0000
12305void __Pyx_init_runtime_version(
void) {
12306 if (__Pyx_cached_runtime_version == 0) {
12307 const char* rt_version = Py_GetVersion();
12308 unsigned long version = 0;
12309 unsigned long factor = 0x01000000UL;
12310 unsigned int digit = 0;
12313 while (
'0' <= rt_version[i] && rt_version[i] <=
'9') {
12314 digit = digit * 10 + (
unsigned int) (rt_version[i] -
'0');
12317 version += factor * digit;
12318 if (rt_version[i] !=
'.')
12324 __Pyx_cached_runtime_version = version;
12328static unsigned long __Pyx_get_runtime_version(
void) {
12329#if __PYX_LIMITED_VERSION_HEX >= 0x030b0000
12330 return Py_Version & ~0xFFUL;
12332 return __Pyx_cached_runtime_version;
12337static int __Pyx_check_binary_version(
unsigned long ct_version,
unsigned long rt_version,
int allow_newer) {
12338 const unsigned long MAJOR_MINOR = 0xFFFF0000UL;
12339 if ((rt_version & MAJOR_MINOR) == (ct_version & MAJOR_MINOR))
12341 if (likely(allow_newer && (rt_version & MAJOR_MINOR) > (ct_version & MAJOR_MINOR)))
12345 PyOS_snprintf(message,
sizeof(message),
12346 "compile time Python version %d.%d "
12347 "of module '%.100s' "
12349 "runtime version %d.%d",
12350 (
int) (ct_version >> 24), (
int) ((ct_version >> 16) & 0xFF),
12352 (allow_newer) ?
"was newer than" :
"does not match",
12353 (
int) (rt_version >> 24), (
int) ((rt_version >> 16) & 0xFF)
12355 return PyErr_WarnEx(NULL, message, 1);
12360#if CYTHON_COMPILING_IN_LIMITED_API
12361 static PyObject* __Pyx__PyCode_New(
int a,
int p,
int k,
int l,
int s,
int f,
12362 PyObject *code, PyObject *
c, PyObject*
n, PyObject *
v,
12363 PyObject *fv, PyObject *cell, PyObject* fn,
12364 PyObject *name,
int fline, PyObject *lnos) {
12365 PyObject *exception_table = NULL;
12366 PyObject *types_module=NULL, *code_type=NULL, *result=NULL;
12367 #if __PYX_LIMITED_VERSION_HEX < 0x030b0000
12368 PyObject *version_info;
12369 PyObject *py_minor_version = NULL;
12371 long minor_version = 0;
12372 #if __PYX_LIMITED_VERSION_HEX >= 0x030b0000
12373 minor_version = 11;
12375 if (!(version_info = PySys_GetObject(
"version_info")))
goto end;
12376 if (!(py_minor_version = PySequence_GetItem(version_info, 1)))
goto end;
12377 minor_version = PyLong_AsLong(py_minor_version);
12378 Py_DECREF(py_minor_version);
12379 if (minor_version == -1 && PyErr_Occurred())
goto end;
12381 if (!(types_module = PyImport_ImportModule(
"types")))
goto end;
12382 if (!(code_type = PyObject_GetAttrString(types_module,
"CodeType")))
goto end;
12383 if (minor_version <= 10) {
12384 result = PyObject_CallFunction(code_type,
"iiiiiiOOOOOOiOOO", a,p, k, l,
s,
f, code,
12385 c,
n,
v, fn, name, fline, lnos, fv, cell);
12387 if (!(exception_table = PyBytes_FromStringAndSize(NULL, 0)))
goto end;
12388 result = PyObject_CallFunction(code_type,
"iiiiiiOOOOOOOiOOOO", a,p, k, l,
s,
f, code,
12389 c,
n,
v, fn, name, name, fline, lnos, exception_table, fv, cell);
12392 Py_XDECREF(code_type);
12393 Py_XDECREF(exception_table);
12394 Py_XDECREF(types_module);
12396 PyObject *exc_type, *exc_value, *exc_tb;
12397 PyErr_Fetch(&exc_type, &exc_value, &exc_tb);
12398 if (PyErr_WarnFormat(
12399 PyExc_RuntimeWarning, 1,
12400 "Code object creation failed in Cython module: %S\nTry recompiling with a more recent version of Cython.",
12401 exc_value ? exc_value : exc_type) == 0) {
12405 Py_DECREF(exc_type);
12406 Py_XDECREF(exc_value);
12407 Py_XDECREF(exc_tb);
12411#elif PY_VERSION_HEX >= 0x030B0000
12412 static PyCodeObject* __Pyx__PyCode_New(
int a,
int p,
int k,
int l,
int s,
int f,
12413 PyObject *code, PyObject *
c, PyObject*
n, PyObject *
v,
12414 PyObject *fv, PyObject *cell, PyObject* fn,
12415 PyObject *name,
int fline, PyObject *lnos) {
12416 PyCodeObject *result;
12418 #if PY_VERSION_HEX >= 0x030C0000
12419 PyUnstable_Code_NewWithPosOnlyArgs
12421 PyCode_NewWithPosOnlyArgs
12423 (a, p, k, l,
s,
f, code,
c,
n,
v, fv, cell, fn, name, name, fline, lnos, __pyx_mstate_global->__pyx_empty_bytes);
12424 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030c00A1
12425 if (likely(result))
12426 result->_co_firsttraceable = 0;
12430#elif !CYTHON_COMPILING_IN_PYPY
12431 #define __Pyx__PyCode_New(a, p, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\
12432 PyCode_NewWithPosOnlyArgs(a, p, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)
12434 #define __Pyx__PyCode_New(a, p, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\
12435 PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)
12437static PyObject* __Pyx_PyCode_New(
12438 const __Pyx_PyCode_New_function_description descr,
12439 PyObject *
const *varnames,
12440 PyObject *filename,
12441 PyObject *funcname,
12442 PyObject *line_table,
12443 PyObject *tuple_dedup_map
12445 PyObject *code_obj = NULL, *varnames_tuple_dedup = NULL, *code_bytes = NULL;
12446 Py_ssize_t var_count = (Py_ssize_t) descr.nlocals;
12447 PyObject *varnames_tuple = PyTuple_New(var_count);
12448 if (unlikely(!varnames_tuple))
return NULL;
12449 for (Py_ssize_t i=0; i < var_count; i++) {
12450 Py_INCREF(varnames[i]);
12451 if (__Pyx_PyTuple_SET_ITEM(varnames_tuple, i, varnames[i]) != (0))
goto done;
12453 #if CYTHON_COMPILING_IN_LIMITED_API
12454 varnames_tuple_dedup = PyDict_GetItem(tuple_dedup_map, varnames_tuple);
12455 if (!varnames_tuple_dedup) {
12456 if (unlikely(PyDict_SetItem(tuple_dedup_map, varnames_tuple, varnames_tuple) < 0))
goto done;
12457 varnames_tuple_dedup = varnames_tuple;
12460 varnames_tuple_dedup = PyDict_SetDefault(tuple_dedup_map, varnames_tuple, varnames_tuple);
12461 if (unlikely(!varnames_tuple_dedup))
goto done;
12463 #if CYTHON_AVOID_BORROWED_REFS
12464 Py_INCREF(varnames_tuple_dedup);
12466 if (__PYX_LIMITED_VERSION_HEX >= (0x030b0000) && line_table != NULL && !CYTHON_COMPILING_IN_GRAAL) {
12467 Py_ssize_t line_table_length = __Pyx_PyBytes_GET_SIZE(line_table);
12468 #if !CYTHON_ASSUME_SAFE_SIZE
12469 if (unlikely(line_table_length == -1))
goto done;
12471 Py_ssize_t code_len = (line_table_length * 2 + 4) & ~3LL;
12472 code_bytes = PyBytes_FromStringAndSize(NULL, code_len);
12473 if (unlikely(!code_bytes))
goto done;
12474 char* c_code_bytes = PyBytes_AsString(code_bytes);
12475 if (unlikely(!c_code_bytes))
goto done;
12476 memset(c_code_bytes, 0, (
size_t) code_len);
12478 code_obj = (PyObject*) __Pyx__PyCode_New(
12479 (
int) descr.argcount,
12480 (
int) descr.num_posonly_args,
12481 (
int) descr.num_kwonly_args,
12482 (
int) descr.nlocals,
12485 code_bytes ? code_bytes : __pyx_mstate_global->__pyx_empty_bytes,
12486 __pyx_mstate_global->__pyx_empty_tuple,
12487 __pyx_mstate_global->__pyx_empty_tuple,
12488 varnames_tuple_dedup,
12489 __pyx_mstate_global->__pyx_empty_tuple,
12490 __pyx_mstate_global->__pyx_empty_tuple,
12493 (
int) descr.first_line,
12494 (__PYX_LIMITED_VERSION_HEX >= (0x030b0000) && line_table) ? line_table : __pyx_mstate_global->__pyx_empty_bytes
12497 Py_XDECREF(code_bytes);
12498 #if CYTHON_AVOID_BORROWED_REFS
12499 Py_XDECREF(varnames_tuple_dedup);
12501 Py_DECREF(varnames_tuple);
12507static CYTHON_SMALL_CODE PyObject *__Pyx_DecompressString(
const char *
s, Py_ssize_t length,
int algo) {
12508#ifdef __Pyx_DecompressString_UNUSED
12509 CYTHON_UNUSED_VAR(
s);
12510 CYTHON_UNUSED_VAR(length);
12511 CYTHON_UNUSED_VAR(algo);
12514 PyObject *module = NULL, *decompress, *compressed_bytes, *decompressed;
12515 const char* module_name = algo == 3 ?
"compression.zstd" : algo == 2 ?
"bz2" :
"zlib";
12516 PyObject *methodname = PyUnicode_FromString(
"decompress");
12517 if (unlikely(!methodname))
return NULL;
12518 #if __PYX_LIMITED_VERSION_HEX >= 0x030e0000
12520 PyObject *fromlist = Py_BuildValue(
"[O]", methodname);
12521 if (unlikely(!fromlist))
goto bad;
12522 module = PyImport_ImportModuleLevel("compression.zstd", NULL, NULL, fromlist, 0);
12523 Py_DECREF(fromlist);
12526 module = PyImport_ImportModule(module_name);
12527 if (unlikely(!module))
goto import_failed;
12528 decompress = PyObject_GetAttr(module, methodname);
12529 if (unlikely(!decompress))
goto import_failed;
12532 char *memview_bytes =
const_cast<char*
>(
s);
12534 #if defined(__clang__)
12535 #pragma clang diagnostic push
12536 #pragma clang diagnostic ignored "-Wcast-qual"
12537 #elif !defined(__INTEL_COMPILER) && defined(__GNUC__)
12538 #pragma GCC diagnostic push
12539 #pragma GCC diagnostic ignored "-Wcast-qual"
12541 char *memview_bytes = (
char*)
s;
12542 #if defined(__clang__)
12543 #pragma clang diagnostic pop
12544 #elif !defined(__INTEL_COMPILER) && defined(__GNUC__)
12545 #pragma GCC diagnostic pop
12548 #if CYTHON_COMPILING_IN_LIMITED_API && !defined(PyBUF_READ)
12549 int memview_flags = 0x100;
12551 int memview_flags = PyBUF_READ;
12553 compressed_bytes = PyMemoryView_FromMemory(memview_bytes, length, memview_flags);
12555 if (unlikely(!compressed_bytes)) {
12556 Py_DECREF(decompress);
12559 decompressed = PyObject_CallFunctionObjArgs(decompress, compressed_bytes, NULL);
12560 Py_DECREF(compressed_bytes);
12561 Py_DECREF(decompress);
12563 Py_DECREF(methodname);
12564 return decompressed;
12566 PyErr_Format(PyExc_ImportError,
12567 "Failed to import '%.20s.decompress' - cannot initialise module strings. "
12568 "String compression was configured with the C macro 'CYTHON_COMPRESS_STRINGS=%d'.",
12569 module_name, algo);
12571 Py_XDECREF(module);
12572 Py_DECREF(methodname);
12578#ifndef __Pyx_DecompressString_LZSS_UNUSED
12580static CYTHON_SMALL_CODE
size_t __pyx_lzss_decompress(
const uint8_t* src, uint8_t* dst,
size_t dst_len) {
12581 size_t pos = 0, out_pos = 0;
12583 uint32_t flags = src[pos++] | 0xFF00;
12584 while (flags & 0x100) {
12586 dst[out_pos++] = src[pos++];
12588 uint32_t lo = src[pos++], hi = src[pos++];
12589 uint32_t end_offset_of_last_occurrence, match_length;
12590 if (!(lo & 0x80)) {
12591 end_offset_of_last_occurrence = lo;
12593 }
else if (!(hi & 0x80)) {
12594 end_offset_of_last_occurrence = 0x80 + (((hi << 2) & 0x180) | (lo & 0x7F));
12595 match_length = hi & 0x1F;
12597 end_offset_of_last_occurrence = 0x80 + ((hi & 0x7F) << 7 | (lo & 0x7F));
12598 match_length = src[pos++];
12601 size_t ref_pos = out_pos - end_offset_of_last_occurrence - match_length;
12602 memcpy(dst + out_pos, dst + ref_pos, match_length);
12603 out_pos += match_length;
12605 if (out_pos >= dst_len)
return pos;
12611static CYTHON_SMALL_CODE PyObject *__Pyx_DecompressString_LZSS(
const char *
s,
size_t compressed_length,
size_t uncompressed_length) {
12612#ifdef __Pyx_DecompressString_LZSS_UNUSED
12613 CYTHON_UNUSED_VAR(
s);
12614 CYTHON_UNUSED_VAR(compressed_length);
12615 CYTHON_UNUSED_VAR(uncompressed_length);
12619 unsigned char *result_data;
12621 result = PyBytes_FromStringAndSize(NULL, (Py_ssize_t) uncompressed_length);
12622 if (unlikely(!result))
return NULL;
12623 result_data = __Pyx_PyBytes_AsWritableUString(result);
12624 if (unlikely(!result_data))
goto bad;
12625 src_length = __pyx_lzss_decompress((
const uint8_t*)
s, result_data, uncompressed_length);
12626 if (unlikely(src_length != compressed_length))
goto decompression_failed;
12628decompression_failed:
12629 PyErr_SetString(PyExc_RuntimeError,
"LZSS string data decompression failed");
12637static CYTHON_INLINE Py_ssize_t __Pyx_ssize_strlen(
const char *
s) {
12638 size_t len = strlen(
s);
12639 if (unlikely(len > (
size_t) PY_SSIZE_T_MAX)) {
12640 PyErr_SetString(PyExc_OverflowError,
"byte string is too long");
12643 return (Py_ssize_t) len;
12645static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(
const char* c_str) {
12646 Py_ssize_t len = __Pyx_ssize_strlen(c_str);
12647 if (unlikely(len < 0))
return NULL;
12648 return __Pyx_PyUnicode_FromStringAndSize(c_str, len);
12650static CYTHON_INLINE PyObject* __Pyx_PyByteArray_FromString(
const char* c_str) {
12651 Py_ssize_t len = __Pyx_ssize_strlen(c_str);
12652 if (unlikely(len < 0))
return NULL;
12653 return PyByteArray_FromStringAndSize(c_str, len);
12655static CYTHON_INLINE
const char* __Pyx_PyObject_AsString(PyObject* o) {
12657 return __Pyx_PyObject_AsStringAndSize(o, &ignore);
12659#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_UTF8
12660static CYTHON_INLINE
const char* __Pyx_PyUnicode_AsStringAndSize(PyObject* o, Py_ssize_t *length) {
12661 if (unlikely(__Pyx_PyUnicode_READY(o) == -1))
return NULL;
12662#if CYTHON_COMPILING_IN_LIMITED_API
12664 const char* result;
12665 Py_ssize_t unicode_length;
12666 CYTHON_MAYBE_UNUSED_VAR(unicode_length);
12667 #if __PYX_LIMITED_VERSION_HEX < 0x030A0000
12668 if (unlikely(PyArg_Parse(o,
"s#", &result, length) < 0))
return NULL;
12670 result = PyUnicode_AsUTF8AndSize(o, length);
12672 #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
12673 unicode_length = PyUnicode_GetLength(o);
12674 if (unlikely(unicode_length < 0))
return NULL;
12675 if (unlikely(unicode_length != *length)) {
12676 PyUnicode_AsASCIIString(o);
12683#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
12684 if (likely(PyUnicode_IS_ASCII(o))) {
12685 *length = PyUnicode_GET_LENGTH(o);
12686 return PyUnicode_AsUTF8(o);
12688 PyUnicode_AsASCIIString(o);
12692 return PyUnicode_AsUTF8AndSize(o, length);
12697static CYTHON_INLINE
const char* __Pyx_PyObject_AsStringAndSize(PyObject* o, Py_ssize_t *length) {
12698#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_UTF8
12699 if (PyUnicode_Check(o)) {
12700 return __Pyx_PyUnicode_AsStringAndSize(o, length);
12703 if (PyByteArray_Check(o)) {
12704#if (CYTHON_ASSUME_SAFE_SIZE && CYTHON_ASSUME_SAFE_MACROS) || (CYTHON_COMPILING_IN_PYPY && (defined(PyByteArray_AS_STRING) && defined(PyByteArray_GET_SIZE)))
12705 *length = PyByteArray_GET_SIZE(o);
12706 return PyByteArray_AS_STRING(o);
12708 *length = PyByteArray_Size(o);
12709 if (*length == -1)
return NULL;
12710 return PyByteArray_AsString(o);
12715 int r = PyBytes_AsStringAndSize(o, &result, length);
12716 if (unlikely(
r < 0)) {
12723static CYTHON_INLINE
int __Pyx_PyObject_IsTrue(PyObject* x) {
12724 int is_true = x == Py_True;
12725 if (is_true | (x == Py_False) | (x == Py_None))
return is_true;
12726 else return PyObject_IsTrue(x);
12728static CYTHON_INLINE
int __Pyx_PyObject_IsTrueAndDecref(PyObject* x) {
12730 if (unlikely(!x))
return -1;
12731 retval = __Pyx_PyObject_IsTrue(x);
12735static PyObject* __Pyx_PyNumber_LongWrongResultType(PyObject* result) {
12736 __Pyx_TypeName result_type_name = __Pyx_PyType_GetFullyQualifiedName(Py_TYPE(result));
12737 #if CYTHON_COMPILING_IN_LIMITED_API && __PYX_LIMITED_VERSION_HEX < 0x030d0000
12738 if (unlikely(!result_type_name))
goto bad;
12740 if (PyLong_Check(result)) {
12741 if (PyErr_WarnFormat(PyExc_DeprecationWarning, 1,
12742 "__int__ returned non-int (type " __Pyx_FMT_TYPENAME
"). "
12743 "The ability to return an instance of a strict subclass of int is deprecated, "
12744 "and may be removed in a future version of Python.",
12745 result_type_name)) {
12746 __Pyx_DECREF_TypeName(result_type_name);
12749 __Pyx_DECREF_TypeName(result_type_name);
12752 PyErr_Format(PyExc_TypeError,
12753 "__int__ returned non-int (type " __Pyx_FMT_TYPENAME
")",
12755 __Pyx_DECREF_TypeName(result_type_name);
12760static CYTHON_INLINE PyObject* __Pyx_PyNumber_Long(PyObject* x) {
12761#if CYTHON_USE_TYPE_SLOTS
12762 PyNumberMethods *m;
12764 PyObject *res = NULL;
12765 if (likely(PyLong_Check(x)))
12766 return __Pyx_NewRef(x);
12767#if CYTHON_USE_TYPE_SLOTS
12768 m = Py_TYPE(x)->tp_as_number;
12769 if (likely(m && m->nb_int)) {
12770 res = m->nb_int(x);
12773 if (!PyBytes_CheckExact(x) && !PyUnicode_CheckExact(x)) {
12774 res = PyNumber_Long(x);
12778 if (unlikely(!PyLong_CheckExact(res))) {
12779 return __Pyx_PyNumber_LongWrongResultType(res);
12782 else if (!PyErr_Occurred()) {
12783 PyErr_SetString(PyExc_TypeError,
12784 "an integer is required");
12788static CYTHON_INLINE Py_ssize_t __Pyx_PyLong_AsSsize_t(PyObject* b) {
12789 #if CYTHON_USE_PYLONG_INTERNALS
12791 const Py_ssize_t size = __Pyx_PyLong_DigitCount(b);
12792 const int is_neg = __Pyx_PyLong_IsNeg(b);
12793 const digit* digits = __Pyx_PyLong_Digits(b);
12794 if (size == 0)
return 0;
12795 #if SIZEOF_SIZE_T * 8 > 1 * PyLong_SHIFT
12797 ival = (Py_ssize_t) (((
size_t)digits[0]));
12800 #if SIZEOF_SIZE_T * 8 > 2 * PyLong_SHIFT
12802 ival = (Py_ssize_t) (((((
size_t)digits[1]) << PyLong_SHIFT) | (
size_t)digits[0]));
12805 #if SIZEOF_SIZE_T * 8 > 3 * PyLong_SHIFT
12807 ival = (Py_ssize_t) (((((((
size_t)digits[2]) << PyLong_SHIFT) | (
size_t)digits[1]) << PyLong_SHIFT) | (
size_t)digits[0]));
12810 #if SIZEOF_SIZE_T * 8 > 4 * PyLong_SHIFT
12812 ival = (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]));
12815 return PyLong_AsSsize_t(b);
12816 return is_neg ? -ival : ival;
12818 return PyLong_AsSsize_t(b);
12821static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject* b) {
12822 if (likely(PyLong_Check(b))) {
12823 return __Pyx_PyLong_AsSsize_t(b);
12826 PyObject *x = PyNumber_Index(b);
12827 if (unlikely(!x))
return -1;
12828 ival = __Pyx_PyLong_AsSsize_t(x);
12833static CYTHON_INLINE Py_hash_t __Pyx_PyIndex_AsHash_t(PyObject* o) {
12834 if (
sizeof(Py_hash_t) ==
sizeof(Py_ssize_t)) {
12835 return (Py_hash_t) __Pyx_PyIndex_AsSsize_t(o);
12839 x = PyNumber_Index(o);
12841 ival = PyLong_AsLong(x);
12846static CYTHON_INLINE PyObject *__Pyx_Owned_Py_None(
int b) {
12847 CYTHON_UNUSED_VAR(b);
12848 return __Pyx_NewRef(Py_None);
12850static CYTHON_INLINE PyObject * __Pyx_PyBool_FromLong(
long b) {
12851 return __Pyx_NewRef(b ? Py_True: Py_False);
12853static CYTHON_INLINE PyObject * __Pyx_PyLong_FromSize_t(
size_t ival) {
12854 return PyLong_FromSize_t(ival);
12859#if CYTHON_PEP489_MULTI_PHASE_INIT && CYTHON_USE_MODULE_STATE
12860#ifndef CYTHON_MODULE_STATE_LOOKUP_THREAD_SAFE
12861#if (CYTHON_COMPILING_IN_LIMITED_API || PY_VERSION_HEX >= 0x030C0000)
12862 #define CYTHON_MODULE_STATE_LOOKUP_THREAD_SAFE 1
12864 #define CYTHON_MODULE_STATE_LOOKUP_THREAD_SAFE 0
12867#if CYTHON_MODULE_STATE_LOOKUP_THREAD_SAFE && !CYTHON_ATOMICS
12868#error "Module state with PEP489 requires atomics. Currently that's one of\
12869 C11, C++11, gcc atomic intrinsics or MSVC atomic intrinsics"
12871#if !CYTHON_MODULE_STATE_LOOKUP_THREAD_SAFE
12872#define __Pyx_ModuleStateLookup_Lock()
12873#define __Pyx_ModuleStateLookup_Unlock()
12874#elif !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX >= 0x030d0000
12875static PyMutex __Pyx_ModuleStateLookup_mutex = {0};
12876#define __Pyx_ModuleStateLookup_Lock() PyMutex_Lock(&__Pyx_ModuleStateLookup_mutex)
12877#define __Pyx_ModuleStateLookup_Unlock() PyMutex_Unlock(&__Pyx_ModuleStateLookup_mutex)
12878#elif defined(__cplusplus) && __cplusplus >= 201103L
12880static std::mutex __Pyx_ModuleStateLookup_mutex;
12881#define __Pyx_ModuleStateLookup_Lock() __Pyx_ModuleStateLookup_mutex.lock()
12882#define __Pyx_ModuleStateLookup_Unlock() __Pyx_ModuleStateLookup_mutex.unlock()
12883#elif defined(__STDC_VERSION__) && (__STDC_VERSION__ > 201112L) && !defined(__STDC_NO_THREADS__)
12884#include <threads.h>
12885static mtx_t __Pyx_ModuleStateLookup_mutex;
12886static once_flag __Pyx_ModuleStateLookup_mutex_once_flag = ONCE_FLAG_INIT;
12887static void __Pyx_ModuleStateLookup_initialize_mutex(
void) {
12888 mtx_init(&__Pyx_ModuleStateLookup_mutex, mtx_plain);
12890#define __Pyx_ModuleStateLookup_Lock()\
12891 call_once(&__Pyx_ModuleStateLookup_mutex_once_flag, __Pyx_ModuleStateLookup_initialize_mutex);\
12892 mtx_lock(&__Pyx_ModuleStateLookup_mutex)
12893#define __Pyx_ModuleStateLookup_Unlock() mtx_unlock(&__Pyx_ModuleStateLookup_mutex)
12894#elif defined(HAVE_PTHREAD_H)
12895#include <pthread.h>
12896static pthread_mutex_t __Pyx_ModuleStateLookup_mutex = PTHREAD_MUTEX_INITIALIZER;
12897#define __Pyx_ModuleStateLookup_Lock() pthread_mutex_lock(&__Pyx_ModuleStateLookup_mutex)
12898#define __Pyx_ModuleStateLookup_Unlock() pthread_mutex_unlock(&__Pyx_ModuleStateLookup_mutex)
12899#elif defined(_WIN32)
12900#include <Windows.h>
12901static SRWLOCK __Pyx_ModuleStateLookup_mutex = SRWLOCK_INIT;
12902#define __Pyx_ModuleStateLookup_Lock() AcquireSRWLockExclusive(&__Pyx_ModuleStateLookup_mutex)
12903#define __Pyx_ModuleStateLookup_Unlock() ReleaseSRWLockExclusive(&__Pyx_ModuleStateLookup_mutex)
12905#error "No suitable lock available for CYTHON_MODULE_STATE_LOOKUP_THREAD_SAFE.\
12906 Requires C standard >= C11, or C++ standard >= C++11,\
12907 or pthreads, or the Windows 32 API, or Python >= 3.13."
12912} __Pyx_InterpreterIdAndModule;
12914 char interpreter_id_as_index;
12916 Py_ssize_t allocated;
12917 __Pyx_InterpreterIdAndModule table[1];
12918} __Pyx_ModuleStateLookupData;
12919#define __PYX_MODULE_STATE_LOOKUP_SMALL_SIZE 32
12920#if CYTHON_MODULE_STATE_LOOKUP_THREAD_SAFE
12921static __pyx_atomic_int_type __Pyx_ModuleStateLookup_read_counter = 0;
12923#if CYTHON_MODULE_STATE_LOOKUP_THREAD_SAFE
12924static __pyx_atomic_ptr_type __Pyx_ModuleStateLookup_data = 0;
12926static __Pyx_ModuleStateLookupData* __Pyx_ModuleStateLookup_data = NULL;
12928static __Pyx_InterpreterIdAndModule* __Pyx_State_FindModuleStateLookupTableLowerBound(
12929 __Pyx_InterpreterIdAndModule* table,
12931 int64_t interpreterId) {
12932 __Pyx_InterpreterIdAndModule* begin = table;
12933 __Pyx_InterpreterIdAndModule* end = begin + count;
12934 if (begin->id == interpreterId) {
12937 while ((end - begin) > __PYX_MODULE_STATE_LOOKUP_SMALL_SIZE) {
12938 __Pyx_InterpreterIdAndModule* halfway = begin + (end - begin)/2;
12939 if (halfway->id == interpreterId) {
12942 if (halfway->id < interpreterId) {
12948 for (; begin < end; ++begin) {
12949 if (begin->id >= interpreterId)
return begin;
12953static PyObject *__Pyx_State_FindModule(CYTHON_UNUSED
void* dummy) {
12954 int64_t interpreter_id = PyInterpreterState_GetID(PyInterpreterState_Get());
12955 if (interpreter_id == -1)
return NULL;
12956#if CYTHON_MODULE_STATE_LOOKUP_THREAD_SAFE
12957 __Pyx_ModuleStateLookupData* data = (__Pyx_ModuleStateLookupData*)__pyx_atomic_pointer_load_relaxed(&__Pyx_ModuleStateLookup_data);
12959 __pyx_atomic_incr_acq_rel(&__Pyx_ModuleStateLookup_read_counter);
12960 if (likely(data)) {
12961 __Pyx_ModuleStateLookupData* new_data = (__Pyx_ModuleStateLookupData*)__pyx_atomic_pointer_load_acquire(&__Pyx_ModuleStateLookup_data);
12962 if (likely(data == new_data)) {
12963 goto read_finished;
12966 __pyx_atomic_decr_acq_rel(&__Pyx_ModuleStateLookup_read_counter);
12967 __Pyx_ModuleStateLookup_Lock();
12968 __pyx_atomic_incr_relaxed(&__Pyx_ModuleStateLookup_read_counter);
12969 data = (__Pyx_ModuleStateLookupData*)__pyx_atomic_pointer_load_relaxed(&__Pyx_ModuleStateLookup_data);
12970 __Pyx_ModuleStateLookup_Unlock();
12974 __Pyx_ModuleStateLookupData* data = __Pyx_ModuleStateLookup_data;
12976 __Pyx_InterpreterIdAndModule* found = NULL;
12977 if (unlikely(!data))
goto end;
12978 if (data->interpreter_id_as_index) {
12979 if (interpreter_id < data->count) {
12980 found = data->table+interpreter_id;
12983 found = __Pyx_State_FindModuleStateLookupTableLowerBound(
12984 data->table, data->count, interpreter_id);
12988 PyObject *result=NULL;
12989 if (found && found->id == interpreter_id) {
12990 result = found->module;
12992#if CYTHON_MODULE_STATE_LOOKUP_THREAD_SAFE
12993 __pyx_atomic_decr_acq_rel(&__Pyx_ModuleStateLookup_read_counter);
12998#if CYTHON_MODULE_STATE_LOOKUP_THREAD_SAFE
12999static void __Pyx_ModuleStateLookup_wait_until_no_readers(
void) {
13000 while (__pyx_atomic_load(&__Pyx_ModuleStateLookup_read_counter) != 0);
13003#define __Pyx_ModuleStateLookup_wait_until_no_readers()
13005static int __Pyx_State_AddModuleInterpIdAsIndex(__Pyx_ModuleStateLookupData **old_data, PyObject* module, int64_t interpreter_id) {
13006 Py_ssize_t to_allocate = (*old_data)->allocated;
13007 while (to_allocate <= interpreter_id) {
13008 if (to_allocate == 0) to_allocate = 1;
13009 else to_allocate *= 2;
13011 __Pyx_ModuleStateLookupData *new_data = *old_data;
13012 if (to_allocate != (*old_data)->allocated) {
13013 new_data = (__Pyx_ModuleStateLookupData *)realloc(
13015 sizeof(__Pyx_ModuleStateLookupData)+(to_allocate-1)*
sizeof(__Pyx_InterpreterIdAndModule));
13020 for (Py_ssize_t i = new_data->allocated; i < to_allocate; ++i) {
13021 new_data->table[i].id = i;
13022 new_data->table[i].module = NULL;
13024 new_data->allocated = to_allocate;
13026 new_data->table[interpreter_id].module =
module;
13027 if (new_data->count < interpreter_id+1) {
13028 new_data->count = interpreter_id+1;
13030 *old_data = new_data;
13033static void __Pyx_State_ConvertFromInterpIdAsIndex(__Pyx_ModuleStateLookupData *data) {
13034 __Pyx_InterpreterIdAndModule *read = data->table;
13035 __Pyx_InterpreterIdAndModule *write = data->table;
13036 __Pyx_InterpreterIdAndModule *end = read + data->count;
13037 for (; read<end; ++read) {
13038 if (read->module) {
13039 write->id = read->id;
13040 write->module = read->module;
13044 data->count = write - data->table;
13045 for (; write<end; ++write) {
13047 write->module = NULL;
13049 data->interpreter_id_as_index = 0;
13051static int __Pyx_State_AddModule(PyObject* module, CYTHON_UNUSED
void* dummy) {
13052 int64_t interpreter_id = PyInterpreterState_GetID(PyInterpreterState_Get());
13053 if (interpreter_id == -1)
return -1;
13055 __Pyx_ModuleStateLookup_Lock();
13056#if CYTHON_MODULE_STATE_LOOKUP_THREAD_SAFE
13057 __Pyx_ModuleStateLookupData *old_data = (__Pyx_ModuleStateLookupData *)
13058 __pyx_atomic_pointer_exchange(&__Pyx_ModuleStateLookup_data, 0);
13060 __Pyx_ModuleStateLookupData *old_data = __Pyx_ModuleStateLookup_data;
13062 __Pyx_ModuleStateLookupData *new_data = old_data;
13064 new_data = (__Pyx_ModuleStateLookupData *)calloc(1,
sizeof(__Pyx_ModuleStateLookupData));
13070 new_data->allocated = 1;
13071 new_data->interpreter_id_as_index = 1;
13073 __Pyx_ModuleStateLookup_wait_until_no_readers();
13074 if (new_data->interpreter_id_as_index) {
13075 if (interpreter_id < __PYX_MODULE_STATE_LOOKUP_SMALL_SIZE) {
13076 result = __Pyx_State_AddModuleInterpIdAsIndex(&new_data, module, interpreter_id);
13079 __Pyx_State_ConvertFromInterpIdAsIndex(new_data);
13082 Py_ssize_t insert_at = 0;
13084 __Pyx_InterpreterIdAndModule* lower_bound = __Pyx_State_FindModuleStateLookupTableLowerBound(
13085 new_data->table, new_data->count, interpreter_id);
13086 assert(lower_bound);
13087 insert_at = lower_bound - new_data->table;
13088 if (unlikely(insert_at < new_data->count && lower_bound->id == interpreter_id)) {
13089 lower_bound->module =
module;
13093 if (new_data->count+1 >= new_data->allocated) {
13094 Py_ssize_t to_allocate = (new_data->count+1)*2;
13096 (__Pyx_ModuleStateLookupData*)realloc(
13098 sizeof(__Pyx_ModuleStateLookupData) +
13099 (to_allocate-1)*
sizeof(__Pyx_InterpreterIdAndModule));
13102 new_data = old_data;
13106 new_data->allocated = to_allocate;
13109 int64_t last_id = interpreter_id;
13110 PyObject *last_module =
module;
13111 for (Py_ssize_t i=insert_at; i<new_data->count; ++i) {
13112 int64_t current_id = new_data->table[i].id;
13113 new_data->table[i].id = last_id;
13114 last_id = current_id;
13115 PyObject *current_module = new_data->table[i].module;
13116 new_data->table[i].module = last_module;
13117 last_module = current_module;
13121#if CYTHON_MODULE_STATE_LOOKUP_THREAD_SAFE
13122 __pyx_atomic_pointer_exchange(&__Pyx_ModuleStateLookup_data, new_data);
13124 __Pyx_ModuleStateLookup_data = new_data;
13126 __Pyx_ModuleStateLookup_Unlock();
13129static int __Pyx_State_RemoveModule(CYTHON_UNUSED
void* dummy) {
13130 int64_t interpreter_id = PyInterpreterState_GetID(PyInterpreterState_Get());
13131 if (interpreter_id == -1)
return -1;
13132 __Pyx_ModuleStateLookup_Lock();
13133#if CYTHON_MODULE_STATE_LOOKUP_THREAD_SAFE
13134 __Pyx_ModuleStateLookupData *data = (__Pyx_ModuleStateLookupData *)
13135 __pyx_atomic_pointer_exchange(&__Pyx_ModuleStateLookup_data, 0);
13137 __Pyx_ModuleStateLookupData *data = __Pyx_ModuleStateLookup_data;
13139 if (data->interpreter_id_as_index) {
13140 if (interpreter_id < data->count) {
13141 data->table[interpreter_id].module = NULL;
13146 __Pyx_ModuleStateLookup_wait_until_no_readers();
13147 __Pyx_InterpreterIdAndModule* lower_bound = __Pyx_State_FindModuleStateLookupTableLowerBound(
13148 data->table, data->count, interpreter_id);
13149 if (!lower_bound)
goto done;
13150 if (lower_bound->id != interpreter_id)
goto done;
13151 __Pyx_InterpreterIdAndModule *end = data->table+data->count;
13152 for (;lower_bound<end-1; ++lower_bound) {
13153 lower_bound->id = (lower_bound+1)->
id;
13154 lower_bound->module = (lower_bound+1)->module;
13158 if (data->count == 0) {
13163#if CYTHON_MODULE_STATE_LOOKUP_THREAD_SAFE
13164 __pyx_atomic_pointer_exchange(&__Pyx_ModuleStateLookup_data, data);
13166 __Pyx_ModuleStateLookup_data = data;
13168 __Pyx_ModuleStateLookup_Unlock();
13175#pragma warning( pop )
int calculateRusanovFluxSaturationEquationIncomp_PWC(double safetyFactor, int nSpace, int pskModelFlag, int nParams, const int *rowptr, const int *colind, const int *materialTypes, double muw, double mun, const double *omega, const double *Kbar, double b, const double *rwork_psk, const double *rwork_psk_tol, const double *rwork_density_w, const double *rwork_density_n, const double *g, const double *ebq_global_qt, const double *q_lambda_bar, int nElements_global, int nElementBoundaries_element, int nInteriorElementBoundaries_global, int nExteriorElementBoundaries_global, int nQuadraturePoints_element, int nQuadraturePoints_elementBoundary, const int *interiorElementBoundariesArray, const int *exteriorElementBoundariesArray, const int *elementBoundaryElementsArray, const int *elementBoundaryLocalElementBoundariesArray, const double *n, const double *q_u, const double *dV, const int *isDOFBoundary, const double *bc_u, double *flux)
void piecewiseLinearTableLookup(double x, int nv, int *start, double *y, double *dy, const double *xv, const double *yv)