51#ifndef PY_SSIZE_T_CLEAN
52#define PY_SSIZE_T_CLEAN
55#if defined(Py_LIMITED_API)
56 #if !defined(CYTHON_LIMITED_API)
57 #define CYTHON_LIMITED_API 1
59#elif defined(CYTHON_LIMITED_API)
61 #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.")
63 #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.
69 #error Python headers needed to compile C extensions, please install development version of Python.
70#elif PY_VERSION_HEX < 0x03090000
71 #error Cython requires Python 3.9+.
72#elif defined(Py_LIMITED_API) && (Py_LIMITED_API & 0xFFFF0000) > (PY_VERSION_HEX & 0xFFFF0000)
73 #error 'Py_LIMITED_API' can only select past Python X.Y versions, not future ones.
75#define __PYX_ABI_VERSION "3_3_0"
76#define CYTHON_HEX_VERSION 0x030300F0
77#define CYTHON_FUTURE_DIVISION 1
81 #define offsetof(type, member) ( (size_t) & ((type*)0) -> member )
83#if !defined(_WIN32) && !defined(WIN32) && !defined(MS_WINDOWS)
95 #define __Pyx_has_cbuiltin(name) __has_builtin(name)
97 #define __Pyx_has_cbuiltin(name) (0)
100 #define DL_IMPORT(t) t
103 #define DL_EXPORT(t) t
107 #define PY_LONG_LONG LONG_LONG
110 #define Py_HUGE_VAL HUGE_VAL
112#define __PYX_LIMITED_VERSION_HEX PY_VERSION_HEX
113#if defined(CYTHON_LIMITED_API)
114 #ifdef Py_LIMITED_API
115 #undef __PYX_LIMITED_VERSION_HEX
116 #define __PYX_LIMITED_VERSION_HEX Py_LIMITED_API
117 #if Py_LIMITED_API < 0x03090000
118 #error "Cython 3.3 requires the Python Limited API version to be 3.9 or greater."
121 #if defined(GRAALVM_PYTHON) || defined(PYPY_VERSION)
123 #pragma message ("Py_LIMITED_API is defined on PyPy or GraalPy. This takes precedence over Cython's specialized\
124 code for PyPy and GraalPy and is unlikely to work.")
126 #warning "Py_LIMITED_API is defined on PyPy or GraalPy. This takes precedence over Cython's specialized\
127 code for PyPy and GraalPy and is unlikely to work."
130 #define CYTHON_COMPILING_IN_PYPY 0
131 #define CYTHON_COMPILING_IN_CPYTHON 0
132 #define CYTHON_COMPILING_IN_LIMITED_API 1
133 #define CYTHON_COMPILING_IN_GRAAL 0
134 #define CYTHON_COMPILING_IN_CPYTHON_FREETHREADING 0
135 #undef CYTHON_USE_TYPE_SLOTS
136 #define CYTHON_USE_TYPE_SLOTS 0
137 #undef CYTHON_USE_TYPE_SPECS
138 #define CYTHON_USE_TYPE_SPECS 1
139 #undef CYTHON_USE_PYTYPE_LOOKUP
140 #define CYTHON_USE_PYTYPE_LOOKUP 0
141 #undef CYTHON_USE_PYLIST_INTERNALS
142 #define CYTHON_USE_PYLIST_INTERNALS 0
143 #undef CYTHON_USE_UNICODE_INTERNALS
144 #define CYTHON_USE_UNICODE_INTERNALS 0
145 #ifndef CYTHON_USE_UNICODE_WRITER
146 #define CYTHON_USE_UNICODE_WRITER 0
148 #undef CYTHON_USE_PYLONG_INTERNALS
149 #define CYTHON_USE_PYLONG_INTERNALS 0
150 #ifndef CYTHON_AVOID_BORROWED_REFS
151 #define CYTHON_AVOID_BORROWED_REFS 0
153 #ifndef CYTHON_AVOID_THREAD_UNSAFE_BORROWED_REFS
154 #define CYTHON_AVOID_THREAD_UNSAFE_BORROWED_REFS 0
156 #undef CYTHON_ASSUME_SAFE_MACROS
157 #define CYTHON_ASSUME_SAFE_MACROS 0
158 #undef CYTHON_ASSUME_SAFE_SIZE
159 #define CYTHON_ASSUME_SAFE_SIZE 0
160 #undef CYTHON_UNPACK_METHODS
161 #define CYTHON_UNPACK_METHODS 0
162 #undef CYTHON_FAST_THREAD_STATE
163 #define CYTHON_FAST_THREAD_STATE 0
164 #undef CYTHON_FAST_GIL
165 #define CYTHON_FAST_GIL 0
166 #undef CYTHON_VECTORCALL
167 #define CYTHON_VECTORCALL (__PYX_LIMITED_VERSION_HEX >= 0x030C0000)
168 #ifndef CYTHON_VECTORCALL_TPNEW
169 #define CYTHON_VECTORCALL_TPNEW (CYTHON_VECTORCALL && __PYX_LIMITED_VERSION_HEX >= 0x030E0000)
171 #ifndef CYTHON_PEP487_INIT_SUBCLASS
172 #define CYTHON_PEP487_INIT_SUBCLASS 1
174 #ifndef CYTHON_PEP489_MULTI_PHASE_INIT
175 #define CYTHON_PEP489_MULTI_PHASE_INIT 1
177 #ifndef CYTHON_USE_MODULE_STATE
178 #define CYTHON_USE_MODULE_STATE 0
180 #undef CYTHON_USE_SYS_MONITORING
181 #define CYTHON_USE_SYS_MONITORING 0
182 #ifndef CYTHON_USE_TP_FINALIZE
183 #define CYTHON_USE_TP_FINALIZE (__PYX_LIMITED_VERSION_HEX >= 0x030F0000 && PY_VERSION_HEX > 0x030F00A8)
185 #ifndef CYTHON_USE_AM_SEND
186 #define CYTHON_USE_AM_SEND (__PYX_LIMITED_VERSION_HEX >= 0x030A0000)
188 #undef CYTHON_USE_DICT_VERSIONS
189 #define CYTHON_USE_DICT_VERSIONS 0
190 #undef CYTHON_USE_EXC_INFO_STACK
191 #define CYTHON_USE_EXC_INFO_STACK 0
192 #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC
193 #define CYTHON_UPDATE_DESCRIPTOR_DOC 0
195 #ifndef CYTHON_USE_OWN_PREP_RERAISE_STAR
196 #define CYTHON_USE_OWN_PREP_RERAISE_STAR 1
198 #ifndef CYTHON_USE_FREELISTS
199 #define CYTHON_USE_FREELISTS 1
201 #undef CYTHON_IMMORTAL_CONSTANTS
202 #define CYTHON_IMMORTAL_CONSTANTS 0
203 #if __PYX_LIMITED_VERSION_HEX < 0x030E0000
204 #undef CYTHON_OPAQUE_OBJECTS
205 #define CYTHON_OPAQUE_OBJECTS 0
206 #elif !defined(CYTHON_OPAQUE_OBJECTS)
207 #define CYTHON_OPAQUE_OBJECTS (__PYX_LIMITED_VERSION_HEX >= 0x030F0000)
209#elif defined(GRAALVM_PYTHON)
212 #define CYTHON_COMPILING_IN_PYPY 0
213 #define CYTHON_COMPILING_IN_CPYTHON 0
214 #define CYTHON_COMPILING_IN_LIMITED_API 0
215 #define CYTHON_COMPILING_IN_GRAAL 1
216 #define CYTHON_COMPILING_IN_CPYTHON_FREETHREADING 0
217 #ifndef CYTHON_USE_TYPE_SLOTS
218 #define CYTHON_USE_TYPE_SLOTS 0
220 #undef CYTHON_USE_TYPE_SPECS
221 #define CYTHON_USE_TYPE_SPECS 0
222 #undef CYTHON_USE_PYTYPE_LOOKUP
223 #define CYTHON_USE_PYTYPE_LOOKUP 0
224 #undef CYTHON_USE_PYLIST_INTERNALS
225 #define CYTHON_USE_PYLIST_INTERNALS 0
226 #undef CYTHON_USE_UNICODE_INTERNALS
227 #define CYTHON_USE_UNICODE_INTERNALS 0
228 #undef CYTHON_USE_UNICODE_WRITER
229 #define CYTHON_USE_UNICODE_WRITER 0
230 #undef CYTHON_USE_PYLONG_INTERNALS
231 #define CYTHON_USE_PYLONG_INTERNALS 0
232 #undef CYTHON_AVOID_BORROWED_REFS
233 #define CYTHON_AVOID_BORROWED_REFS 1
234 #undef CYTHON_AVOID_THREAD_UNSAFE_BORROWED_REFS
235 #define CYTHON_AVOID_THREAD_UNSAFE_BORROWED_REFS 0
236 #undef CYTHON_ASSUME_SAFE_MACROS
237 #define CYTHON_ASSUME_SAFE_MACROS 0
238 #undef CYTHON_ASSUME_SAFE_SIZE
239 #define CYTHON_ASSUME_SAFE_SIZE 0
240 #undef CYTHON_UNPACK_METHODS
241 #define CYTHON_UNPACK_METHODS 0
242 #undef CYTHON_FAST_THREAD_STATE
243 #define CYTHON_FAST_THREAD_STATE 0
244 #undef CYTHON_FAST_GIL
245 #define CYTHON_FAST_GIL 0
246 #ifndef CYTHON_VECTORCALL
247 #define CYTHON_VECTORCALL 1
249 #if CYTHON_USE_TYPE_SPECS && PY_VERSION_HEX < 0x030E0000
250 #undef CYTHON_VECTORCALL_TPNEW
251 #define CYTHON_VECTORCALL_TPNEW 0
252 #elif !defined(CYTHON_VECTORCALL_TPNEW)
253 #define CYTHON_VECTORCALL_TPNEW CYTHON_VECTORCALL
255 #ifndef CYTHON_PEP487_INIT_SUBCLASS
256 #define CYTHON_PEP487_INIT_SUBCLASS 1
258 #undef CYTHON_PEP489_MULTI_PHASE_INIT
259 #define CYTHON_PEP489_MULTI_PHASE_INIT 1
260 #undef CYTHON_USE_MODULE_STATE
261 #define CYTHON_USE_MODULE_STATE 0
262 #undef CYTHON_USE_SYS_MONITORING
263 #define CYTHON_USE_SYS_MONITORING 0
264 #undef CYTHON_USE_TP_FINALIZE
265 #define CYTHON_USE_TP_FINALIZE 0
266 #undef CYTHON_USE_AM_SEND
267 #define CYTHON_USE_AM_SEND 0
268 #undef CYTHON_USE_DICT_VERSIONS
269 #define CYTHON_USE_DICT_VERSIONS 0
270 #undef CYTHON_USE_EXC_INFO_STACK
271 #define CYTHON_USE_EXC_INFO_STACK 1
272 #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC
273 #define CYTHON_UPDATE_DESCRIPTOR_DOC 0
275 #ifndef CYTHON_USE_OWN_PREP_RERAISE_STAR
276 #define CYTHON_USE_OWN_PREP_RERAISE_STAR 1
278 #undef CYTHON_USE_FREELISTS
279 #define CYTHON_USE_FREELISTS 0
280 #undef CYTHON_IMMORTAL_CONSTANTS
281 #define CYTHON_IMMORTAL_CONSTANTS 0
282 #undef CYTHON_OPAQUE_OBJECTS
283 #define CYTHON_OPAQUE_OBJECTS 0
284#elif defined(PYPY_VERSION)
285 #define CYTHON_COMPILING_IN_PYPY 1
286 #define CYTHON_COMPILING_IN_CPYTHON 0
287 #define CYTHON_COMPILING_IN_LIMITED_API 0
288 #define CYTHON_COMPILING_IN_GRAAL 0
289 #define CYTHON_COMPILING_IN_CPYTHON_FREETHREADING 0
290 #undef CYTHON_USE_TYPE_SLOTS
291 #define CYTHON_USE_TYPE_SLOTS 1
292 #ifndef CYTHON_USE_TYPE_SPECS
293 #define CYTHON_USE_TYPE_SPECS 0
295 #undef CYTHON_USE_PYTYPE_LOOKUP
296 #define CYTHON_USE_PYTYPE_LOOKUP 0
297 #undef CYTHON_USE_PYLIST_INTERNALS
298 #define CYTHON_USE_PYLIST_INTERNALS 0
299 #undef CYTHON_USE_UNICODE_INTERNALS
300 #define CYTHON_USE_UNICODE_INTERNALS 0
301 #undef CYTHON_USE_UNICODE_WRITER
302 #define CYTHON_USE_UNICODE_WRITER 0
303 #undef CYTHON_USE_PYLONG_INTERNALS
304 #define CYTHON_USE_PYLONG_INTERNALS 0
305 #undef CYTHON_AVOID_BORROWED_REFS
306 #define CYTHON_AVOID_BORROWED_REFS 1
307 #undef CYTHON_AVOID_THREAD_UNSAFE_BORROWED_REFS
308 #define CYTHON_AVOID_THREAD_UNSAFE_BORROWED_REFS 1
309 #undef CYTHON_ASSUME_SAFE_MACROS
310 #define CYTHON_ASSUME_SAFE_MACROS 0
311 #ifndef CYTHON_ASSUME_SAFE_SIZE
312 #define CYTHON_ASSUME_SAFE_SIZE 1
314 #undef CYTHON_UNPACK_METHODS
315 #define CYTHON_UNPACK_METHODS 0
316 #undef CYTHON_FAST_THREAD_STATE
317 #define CYTHON_FAST_THREAD_STATE 0
318 #undef CYTHON_FAST_GIL
319 #define CYTHON_FAST_GIL 0
320 #ifndef CYTHON_VECTORCALL
321 #define CYTHON_VECTORCALL 1
323 #if CYTHON_USE_TYPE_SPECS && PY_VERSION_HEX < 0x030E0000
324 #undef CYTHON_VECTORCALL_TPNEW
325 #define CYTHON_VECTORCALL_TPNEW 0
326 #elif !defined(CYTHON_VECTORCALL_TPNEW)
327 #define CYTHON_VECTORCALL_TPNEW (PYPY_VERSION_NUM >= 0x07030800 && CYTHON_VECTORCALL)
329 #ifndef CYTHON_PEP487_INIT_SUBCLASS
330 #define CYTHON_PEP487_INIT_SUBCLASS 1
332 #ifndef CYTHON_PEP489_MULTI_PHASE_INIT
333 #define CYTHON_PEP489_MULTI_PHASE_INIT 1
335 #undef CYTHON_USE_MODULE_STATE
336 #define CYTHON_USE_MODULE_STATE 0
337 #undef CYTHON_USE_SYS_MONITORING
338 #define CYTHON_USE_SYS_MONITORING 0
339 #ifndef CYTHON_USE_TP_FINALIZE
340 #define CYTHON_USE_TP_FINALIZE (PYPY_VERSION_NUM >= 0x07030C00)
342 #undef CYTHON_USE_AM_SEND
343 #define CYTHON_USE_AM_SEND 0
344 #undef CYTHON_USE_DICT_VERSIONS
345 #define CYTHON_USE_DICT_VERSIONS 0
346 #undef CYTHON_USE_EXC_INFO_STACK
347 #define CYTHON_USE_EXC_INFO_STACK 0
348 #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC
349 #define CYTHON_UPDATE_DESCRIPTOR_DOC (PYPY_VERSION_NUM >= 0x07031100)
351 #ifndef CYTHON_USE_OWN_PREP_RERAISE_STAR
352 #define CYTHON_USE_OWN_PREP_RERAISE_STAR 1
354 #undef CYTHON_USE_FREELISTS
355 #define CYTHON_USE_FREELISTS 0
356 #undef CYTHON_IMMORTAL_CONSTANTS
357 #define CYTHON_IMMORTAL_CONSTANTS 0
358 #undef CYTHON_OPAQUE_OBJECTS
359 #define CYTHON_OPAQUE_OBJECTS 0
361 #define CYTHON_COMPILING_IN_PYPY 0
362 #define CYTHON_COMPILING_IN_CPYTHON 1
363 #define CYTHON_COMPILING_IN_LIMITED_API 0
364 #define CYTHON_COMPILING_IN_GRAAL 0
365 #ifdef Py_GIL_DISABLED
366 #define CYTHON_COMPILING_IN_CPYTHON_FREETHREADING 1
368 #define CYTHON_COMPILING_IN_CPYTHON_FREETHREADING 0
370 #if PY_VERSION_HEX < 0x030A0000
371 #undef CYTHON_USE_TYPE_SLOTS
372 #define CYTHON_USE_TYPE_SLOTS 1
373 #elif !defined(CYTHON_USE_TYPE_SLOTS)
374 #define CYTHON_USE_TYPE_SLOTS 1
376 #ifndef CYTHON_USE_TYPE_SPECS
377 #define CYTHON_USE_TYPE_SPECS 0
379 #ifndef CYTHON_USE_PYTYPE_LOOKUP
380 #define CYTHON_USE_PYTYPE_LOOKUP 1
382 #ifndef CYTHON_USE_PYLONG_INTERNALS
383 #define CYTHON_USE_PYLONG_INTERNALS 1
385 #if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING
386 #undef CYTHON_USE_PYLIST_INTERNALS
387 #define CYTHON_USE_PYLIST_INTERNALS 0
388 #elif !defined(CYTHON_USE_PYLIST_INTERNALS)
389 #define CYTHON_USE_PYLIST_INTERNALS 1
391 #ifndef CYTHON_USE_UNICODE_INTERNALS
392 #define CYTHON_USE_UNICODE_INTERNALS 1
394 #if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING || PY_VERSION_HEX >= 0x030B00A2
395 #undef CYTHON_USE_UNICODE_WRITER
396 #define CYTHON_USE_UNICODE_WRITER 0
397 #elif !defined(CYTHON_USE_UNICODE_WRITER)
398 #define CYTHON_USE_UNICODE_WRITER 1
400 #ifndef CYTHON_AVOID_BORROWED_REFS
401 #define CYTHON_AVOID_BORROWED_REFS 0
403 #if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING
404 #undef CYTHON_AVOID_THREAD_UNSAFE_BORROWED_REFS
405 #define CYTHON_AVOID_THREAD_UNSAFE_BORROWED_REFS 1
406 #elif !defined(CYTHON_AVOID_THREAD_UNSAFE_BORROWED_REFS)
407 #define CYTHON_AVOID_THREAD_UNSAFE_BORROWED_REFS 0
409 #ifndef CYTHON_ASSUME_SAFE_MACROS
410 #define CYTHON_ASSUME_SAFE_MACROS 1
412 #ifndef CYTHON_ASSUME_SAFE_SIZE
413 #define CYTHON_ASSUME_SAFE_SIZE 1
415 #ifndef CYTHON_UNPACK_METHODS
416 #define CYTHON_UNPACK_METHODS 1
418 #ifndef CYTHON_FAST_THREAD_STATE
419 #define CYTHON_FAST_THREAD_STATE 1
421 #if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING
422 #undef CYTHON_FAST_GIL
423 #define CYTHON_FAST_GIL 0
424 #elif !defined(CYTHON_FAST_GIL)
425 #define CYTHON_FAST_GIL (PY_VERSION_HEX < 0x030C00A6)
427 #ifndef CYTHON_VECTORCALL
428 #define CYTHON_VECTORCALL 1
430 #if CYTHON_USE_TYPE_SPECS && PY_VERSION_HEX < 0x030E0000
431 #undef CYTHON_VECTORCALL_TPNEW
432 #define CYTHON_VECTORCALL_TPNEW 0
433 #elif !defined(CYTHON_VECTORCALL_TPNEW)
434 #define CYTHON_VECTORCALL_TPNEW CYTHON_VECTORCALL
436 #ifndef CYTHON_PEP487_INIT_SUBCLASS
437 #define CYTHON_PEP487_INIT_SUBCLASS 1
439 #ifndef CYTHON_PEP489_MULTI_PHASE_INIT
440 #define CYTHON_PEP489_MULTI_PHASE_INIT 1
442 #ifndef CYTHON_USE_MODULE_STATE
443 #define CYTHON_USE_MODULE_STATE 0
445 #ifndef CYTHON_USE_SYS_MONITORING
446 #define CYTHON_USE_SYS_MONITORING (PY_VERSION_HEX >= 0x030d00B1)
448 #ifndef CYTHON_USE_TP_FINALIZE
449 #define CYTHON_USE_TP_FINALIZE 1
451 #ifndef CYTHON_USE_AM_SEND
452 #define CYTHON_USE_AM_SEND 1
454 #if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING
455 #undef CYTHON_USE_DICT_VERSIONS
456 #define CYTHON_USE_DICT_VERSIONS 0
457 #elif !defined(CYTHON_USE_DICT_VERSIONS)
458 #define CYTHON_USE_DICT_VERSIONS (PY_VERSION_HEX < 0x030C00A5 && !CYTHON_USE_MODULE_STATE)
460 #ifndef CYTHON_USE_EXC_INFO_STACK
461 #define CYTHON_USE_EXC_INFO_STACK 1
463 #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC
464 #define CYTHON_UPDATE_DESCRIPTOR_DOC 1
466 #ifndef CYTHON_USE_OWN_PREP_RERAISE_STAR
467 #define CYTHON_USE_OWN_PREP_RERAISE_STAR (PY_VERSION_HEX < 0x030C00B2)
469 #ifndef CYTHON_USE_FREELISTS
470 #define CYTHON_USE_FREELISTS (!CYTHON_COMPILING_IN_CPYTHON_FREETHREADING)
472 #if defined(CYTHON_IMMORTAL_CONSTANTS) && PY_VERSION_HEX < 0x030C0000
473 #undef CYTHON_IMMORTAL_CONSTANTS
474 #define CYTHON_IMMORTAL_CONSTANTS 0
475 #elif !defined(CYTHON_IMMORTAL_CONSTANTS)
476 #define CYTHON_IMMORTAL_CONSTANTS (PY_VERSION_HEX >= 0x030C0000 && !CYTHON_USE_MODULE_STATE && CYTHON_COMPILING_IN_CPYTHON_FREETHREADING)
478 #ifndef CYTHON_OPAQUE_OBJECTS
479 #define CYTHON_OPAQUE_OBJECTS 0
482#if CYTHON_USE_PYLONG_INTERNALS
487 enum { __pyx_check_sizeof_voidp = 1 / (int)(SIZEOF_VOID_P ==
sizeof(
void*)) };
490#ifndef __has_attribute
491 #define __has_attribute(x) 0
493#ifndef __has_cpp_attribute
494 #define __has_cpp_attribute(x) 0
496#ifndef CYTHON_RESTRICT
497 #if defined(__GNUC__)
498 #define CYTHON_RESTRICT __restrict__
499 #elif defined(_MSC_VER) && _MSC_VER >= 1400
500 #define CYTHON_RESTRICT __restrict
501 #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
502 #define CYTHON_RESTRICT restrict
504 #define CYTHON_RESTRICT
508 #if defined(__cplusplus)
511 #if ((defined(_MSVC_LANG) && _MSVC_LANG >= 201703L) || __cplusplus >= 201703L)
512 #if __has_cpp_attribute(maybe_unused)
513 #define CYTHON_UNUSED [[maybe_unused]]
516 #elif defined(__STDC_VERSION__) && __STDC_VERSION__ >= 202311L
517 #define CYTHON_UNUSED [[maybe_unused]]
521# if defined(__GNUC__)
522# if !(defined(__cplusplus)) || (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4))
523# define CYTHON_UNUSED __attribute__ ((__unused__))
525# define CYTHON_UNUSED
527# elif defined(__ICC) || (defined(__INTEL_COMPILER) && !defined(_MSC_VER))
528# define CYTHON_UNUSED __attribute__ ((__unused__))
530# define CYTHON_UNUSED
533#ifndef CYTHON_UNUSED_VAR
534# if defined(__cplusplus)
535 template<
class T>
void CYTHON_UNUSED_VAR(
const T& ) { }
537# define CYTHON_UNUSED_VAR(x) (void)(x)
540#ifndef CYTHON_MAYBE_UNUSED_VAR
541 #define CYTHON_MAYBE_UNUSED_VAR(x) CYTHON_UNUSED_VAR(x)
543#ifndef CYTHON_NCP_UNUSED
544# if CYTHON_COMPILING_IN_CPYTHON && !CYTHON_COMPILING_IN_CPYTHON_FREETHREADING
545# define CYTHON_NCP_UNUSED
547# define CYTHON_NCP_UNUSED CYTHON_UNUSED
550#ifndef CYTHON_USE_CPP_STD_MOVE
551 #if defined(__cplusplus) && (\
552 __cplusplus >= 201103L || (defined(_MSC_VER) && _MSC_VER >= 1600))
553 #define CYTHON_USE_CPP_STD_MOVE 1
555 #define CYTHON_USE_CPP_STD_MOVE 0
558#define __Pyx_void_to_None(void_result) ((void)(void_result), Py_INCREF(Py_None), Py_None)
560typedef uintptr_t __pyx_uintptr_t;
561#ifndef CYTHON_FALLTHROUGH
562 #if defined(__cplusplus)
565 #if ((defined(_MSVC_LANG) && _MSVC_LANG >= 201703L) || __cplusplus >= 201703L)
566 #if __has_cpp_attribute(fallthrough)
567 #define CYTHON_FALLTHROUGH [[fallthrough]]
570 #ifndef CYTHON_FALLTHROUGH
571 #if __has_cpp_attribute(clang::fallthrough)
572 #define CYTHON_FALLTHROUGH [[clang::fallthrough]]
573 #elif __has_cpp_attribute(gnu::fallthrough)
574 #define CYTHON_FALLTHROUGH [[gnu::fallthrough]]
578 #ifndef CYTHON_FALLTHROUGH
579 #if __has_attribute(fallthrough)
580 #define CYTHON_FALLTHROUGH __attribute__((fallthrough))
582 #define CYTHON_FALLTHROUGH
585 #if defined(__clang__) && defined(__apple_build_version__)
586 #if __apple_build_version__ < 7000000
587 #undef CYTHON_FALLTHROUGH
588 #define CYTHON_FALLTHROUGH
593 #define __Pyx_UNREACHABLE() Py_UNREACHABLE()
594#elif __Pyx_has_cbuiltin(__builtin_unreachable)
595 #define __Pyx_UNREACHABLE() __builtin_unreachable()
596#elif defined(__clang__) || defined(__INTEL_COMPILER) || (defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 5)))
597 #define __Pyx_UNREACHABLE() __builtin_unreachable()
598#elif defined(_MSC_VER)
599 #define __Pyx_UNREACHABLE() __assume(0)
601 #define __Pyx_UNREACHABLE() Py_FatalError("Unreachable C code path reached")
603#ifndef Py_UNREACHABLE
604 #define Py_UNREACHABLE() __Pyx_UNREACHABLE()
607 template <
typename T>
608 struct __PYX_IS_UNSIGNED_IMPL {
static const bool value =
T(0) <
T(-1);};
609 #define __PYX_IS_UNSIGNED(type) (__PYX_IS_UNSIGNED_IMPL<type>::value)
611 #define __PYX_IS_UNSIGNED(type) (((type)-1) > 0)
613#if CYTHON_COMPILING_IN_PYPY == 1
614 #define __PYX_NEED_TP_PRINT_SLOT (PY_VERSION_HEX < 0x030A0000)
616 #define __PYX_NEED_TP_PRINT_SLOT 0
618#define __PYX_REINTERPRET_FUNCION(func_pointer, other_pointer) ((func_pointer)(void(*)(void))(other_pointer))
619#if __PYX_LIMITED_VERSION_HEX < 0x030C0000
620#define __Pyx_PyErr_FetchException(petype, peval, petb) PyErr_Fetch(petype, peval, petb)
621#define __Pyx_PyErr_RestoreException(etype, eval, etb) PyErr_Restore(etype, eval, etb)
623#define __Pyx_PyErr_FetchException(petype, peval, petb) *(petype)=NULL; *(peval)=PyErr_GetRaisedException(); *(petb)=NULL
624#define __Pyx_PyErr_RestoreException(etype, eval, etb) PyErr_SetRaisedException(eval)
629 #if defined(__clang__)
630 #define CYTHON_INLINE __inline__ __attribute__ ((__unused__))
631 #elif defined(__GNUC__)
632 #define CYTHON_INLINE __inline__
633 #elif defined(_MSC_VER)
634 #define CYTHON_INLINE __inline
635 #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
636 #define CYTHON_INLINE inline
638 #define CYTHON_INLINE
643#define __PYX_BUILD_PY_SSIZE_T "n"
644#define CYTHON_FORMAT_SSIZE_T "z"
645#define __Pyx_BUILTIN_MODULE_NAME "builtins"
646#define __Pyx_DefaultClassType PyType_Type
647#if CYTHON_COMPILING_IN_LIMITED_API
649 static int CO_OPTIMIZED;
652 static int CO_NEWLOCALS;
655 static int CO_VARARGS;
657 #ifndef CO_VARKEYWORDS
658 static int CO_VARKEYWORDS;
660 #ifndef CO_ASYNC_GENERATOR
661 static int CO_ASYNC_GENERATOR;
664 static int CO_GENERATOR;
667 static int CO_COROUTINE;
671 #define CO_COROUTINE 0x80
673 #ifndef CO_ASYNC_GENERATOR
674 #define CO_ASYNC_GENERATOR 0x200
677static int __Pyx_init_co_variables(
void);
678#if PY_VERSION_HEX >= 0x030A00B1 || defined(Py_Is)
679 #define __Pyx_Py_Is(x, y) Py_Is(x, y)
681 #define __Pyx_Py_Is(x, y) ((x) == (y))
683#if PY_VERSION_HEX >= 0x030A00B1 || defined(Py_IsNone)
684 #define __Pyx_Py_IsNone(ob) Py_IsNone(ob)
686 #define __Pyx_Py_IsNone(ob) __Pyx_Py_Is((ob), Py_None)
688#if PY_VERSION_HEX >= 0x030A00B1 || defined(Py_IsTrue)
689 #define __Pyx_Py_IsTrue(ob) Py_IsTrue(ob)
691 #define __Pyx_Py_IsTrue(ob) __Pyx_Py_Is((ob), Py_True)
693#if PY_VERSION_HEX >= 0x030A00B1 || defined(Py_IsFalse)
694 #define __Pyx_Py_IsFalse(ob) Py_IsFalse(ob)
696 #define __Pyx_Py_IsFalse(ob) __Pyx_Py_Is((ob), Py_False)
698#define __Pyx_NoneAsNull(obj) (__Pyx_Py_IsNone(obj) ? NULL : (obj))
699#if CYTHON_COMPILING_IN_PYPY
700 #define __Pyx_PyObject_GC_IsFinalized(o) _PyGC_FINALIZED(o)
702 #define __Pyx_PyObject_GC_IsFinalized(o) PyObject_GC_IsFinalized(o)
704#if CYTHON_COMPILING_IN_LIMITED_API
705static unsigned long __Pyx_Runtime_TPFLAGS_SEQUENCE;
706static unsigned long __Pyx_Runtime_TPFLAGS_MAPPING;
708#define __Pyx_Runtime_TPFLAGS_SEQUENCE Py_TPFLAGS_SEQUENCE
709#define __Pyx_Runtime_TPFLAGS_MAPPING Py_TPFLAGS_MAPPING
711static int __Pyx_init_tpflags_variables(
void);
712#ifndef Py_TPFLAGS_HAVE_FINALIZE
713 #define Py_TPFLAGS_HAVE_FINALIZE 0
715#ifndef Py_TPFLAGS_SEQUENCE
716 #define Py_TPFLAGS_SEQUENCE (CYTHON_COMPILING_IN_LIMITED_API ? 0 : 1 << 5)
718#ifndef Py_TPFLAGS_MAPPING
719 #define Py_TPFLAGS_MAPPING (CYTHON_COMPILING_IN_LIMITED_API ? 0 : 1 << 6)
721#ifndef Py_TPFLAGS_IMMUTABLETYPE
722 #define Py_TPFLAGS_IMMUTABLETYPE (1UL << 8)
724#ifndef Py_TPFLAGS_DISALLOW_INSTANTIATION
725 #define Py_TPFLAGS_DISALLOW_INSTANTIATION (1UL << 7)
727#ifndef METH_STACKLESS
728 #define METH_STACKLESS 0
730#if !defined(METH_FASTCALL) || CYTHON_COMPILING_IN_PYPY
731 #ifndef METH_FASTCALL
732 #define METH_FASTCALL 0x80
734 typedef PyObject *(*__Pyx_PyCFunctionFast) (PyObject *self, PyObject *
const *args, Py_ssize_t nargs);
735 typedef PyObject *(*__Pyx_PyCFunctionFastWithKeywords) (PyObject *self, PyObject *
const *args,
736 Py_ssize_t nargs, PyObject *kwnames);
738 #if PY_VERSION_HEX >= 0x030d00A4
739 # define __Pyx_PyCFunctionFast PyCFunctionFast
740 # define __Pyx_PyCFunctionFastWithKeywords PyCFunctionFastWithKeywords
742 # define __Pyx_PyCFunctionFast _PyCFunctionFast
743 # define __Pyx_PyCFunctionFastWithKeywords _PyCFunctionFastWithKeywords
747 #define __Pyx_METH_FASTCALL METH_FASTCALL
748 #define __Pyx_PyCFunction_FastCall __Pyx_PyCFunctionFast
749 #define __Pyx_PyCFunction_FastCallWithKeywords __Pyx_PyCFunctionFastWithKeywords
751 #define __Pyx_METH_FASTCALL METH_VARARGS
752 #define __Pyx_PyCFunction_FastCall PyCFunction
753 #define __Pyx_PyCFunction_FastCallWithKeywords PyCFunctionWithKeywords
756 #define __pyx_vectorcallfunc vectorcallfunc
757 #define __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET PY_VECTORCALL_ARGUMENTS_OFFSET
758 #define __Pyx_PyVectorcall_NARGS(n) PyVectorcall_NARGS((size_t)(n))
760 #define __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET 0
761 #define __Pyx_PyVectorcall_NARGS(n) ((Py_ssize_t)(n))
763#define __Pyx_PyCFunction_CheckExact(func) PyCFunction_CheckExact(func)
764#define __Pyx_CyOrPyCFunction_Check(func) PyCFunction_Check(func)
765#if CYTHON_COMPILING_IN_CPYTHON
766#define __Pyx_CyOrPyCFunction_GET_FUNCTION(func) (((PyCFunctionObject*)(func))->m_ml->ml_meth)
767#elif !CYTHON_COMPILING_IN_LIMITED_API
768#define __Pyx_CyOrPyCFunction_GET_FUNCTION(func) PyCFunction_GET_FUNCTION(func)
770#if CYTHON_COMPILING_IN_CPYTHON
771#define __Pyx_CyOrPyCFunction_GET_FLAGS(func) (((PyCFunctionObject*)(func))->m_ml->ml_flags)
772static CYTHON_INLINE PyObject* __Pyx_CyOrPyCFunction_GET_SELF(PyObject *func) {
773 return (__Pyx_CyOrPyCFunction_GET_FLAGS(func) & METH_STATIC) ? NULL : ((PyCFunctionObject*)func)->m_self;
776static CYTHON_INLINE
int __Pyx__IsSameCFunction(PyObject *func,
void (*cfunc)(
void)) {
777#if CYTHON_COMPILING_IN_LIMITED_API
778 return PyCFunction_Check(func) && PyCFunction_GetFunction(func) == (PyCFunction) cfunc;
780 return PyCFunction_Check(func) && PyCFunction_GET_FUNCTION(func) == (PyCFunction) cfunc;
783#define __Pyx_IsSameCFunction(func, cfunc) __Pyx__IsSameCFunction(func, cfunc)
784#if CYTHON_COMPILING_IN_LIMITED_API && __PYX_LIMITED_VERSION_HEX < 0x030A0000
785 #define __Pyx_PyType_FromModuleAndSpec(m, s, b) ((void)m, PyType_FromSpecWithBases(s, b))
787 #define __Pyx_PyType_FromModuleAndSpec(m, s, b) PyType_FromModuleAndSpec(m, s, b)
789#if CYTHON_COMPILING_IN_PYPY
790 typedef PyObject *(*__Pyx_PyCMethod)(PyObject *, PyTypeObject *, PyObject *
const *, size_t, PyObject *);
792 #define __Pyx_PyCMethod PyCMethod
795 #define METH_METHOD 0x200
797#if CYTHON_COMPILING_IN_PYPY && !defined(PyObject_Malloc)
798 #define PyObject_Malloc(s) PyMem_Malloc(s)
799 #define PyObject_Free(p) PyMem_Free(p)
800 #define PyObject_Realloc(p) PyMem_Realloc(p)
802#if CYTHON_COMPILING_IN_LIMITED_API
803 #define __Pyx_PyFrame_SetLineNumber(frame, lineno)
804#elif CYTHON_COMPILING_IN_GRAAL && defined(GRAALPY_VERSION_NUM) && GRAALPY_VERSION_NUM > 0x19000000
805 #define __Pyx_PyCode_HasFreeVars(co) (PyCode_GetNumFree(co) > 0)
806 #define __Pyx_PyFrame_SetLineNumber(frame, lineno) GraalPyFrame_SetLineNumber((frame), (lineno))
807#elif CYTHON_COMPILING_IN_GRAAL
808 #define __Pyx_PyCode_HasFreeVars(co) (PyCode_GetNumFree(co) > 0)
809 #define __Pyx_PyFrame_SetLineNumber(frame, lineno) _PyFrame_SetLineNumber((frame), (lineno))
811 #define __Pyx_PyCode_HasFreeVars(co) (PyCode_GetNumFree(co) > 0)
812 #define __Pyx_PyFrame_SetLineNumber(frame, lineno) (frame)->f_lineno = (lineno)
814#if CYTHON_COMPILING_IN_LIMITED_API
815 #define __Pyx_PyThreadState_Current PyThreadState_Get()
816#elif !CYTHON_FAST_THREAD_STATE
817 #define __Pyx_PyThreadState_Current PyThreadState_GET()
818#elif PY_VERSION_HEX >= 0x030d00A1
819 #define __Pyx_PyThreadState_Current PyThreadState_GetUnchecked()
821 #define __Pyx_PyThreadState_Current _PyThreadState_UncheckedGet()
823#if CYTHON_OPAQUE_OBJECTS && CYTHON_COMPILING_IN_LIMITED_API
824 #define __PYX_SHARED_SIZEOF(T) -((int)sizeof(T))
825 #define __PYX_SHARED_RELATIVE_OFFSET Py_RELATIVE_OFFSET
826 #define CYTHON_OPAQUE_SHARED_TYPES 1
828 #define __PYX_SHARED_SIZEOF(T) sizeof(T)
829 #define __PYX_SHARED_RELATIVE_OFFSET 0
830 #define CYTHON_OPAQUE_SHARED_TYPES 0
832#if CYTHON_USE_MODULE_STATE
833static CYTHON_INLINE
void *__Pyx__PyModule_GetState(PyObject *op)
836 result = PyModule_GetState(op);
838 Py_FatalError(
"Couldn't find the module state");
841#define __Pyx_PyModule_GetState(o) (__pyx_mstatetype *)__Pyx__PyModule_GetState(o)
843#define __Pyx_PyModule_GetState(op) ((void)op,__pyx_mstate_global)
845#define __Pyx_PyObject_GetSlot(obj, name, func_ctype) __Pyx_PyType_GetSlot(Py_TYPE((PyObject *) obj), name, func_ctype)
846#define __Pyx_PyObject_TryGetSlot(obj, name, func_ctype) __Pyx_PyType_TryGetSlot(Py_TYPE(obj), name, func_ctype)
847#define __Pyx_PyObject_GetSubSlot(obj, sub, name, func_ctype) __Pyx_PyType_GetSubSlot(Py_TYPE(obj), sub, name, func_ctype)
848#define __Pyx_PyObject_TryGetSubSlot(obj, sub, name, func_ctype) __Pyx_PyType_TryGetSubSlot(Py_TYPE(obj), sub, name, func_ctype)
849#if CYTHON_USE_TYPE_SLOTS
850 #define __Pyx_PyType_GetSlot(type, name, func_ctype) ((type)->name)
851 #define __Pyx_PyType_TryGetSlot(type, name, func_ctype) __Pyx_PyType_GetSlot(type, name, func_ctype)
852 #define __Pyx_PyType_GetSubSlot(type, sub, name, func_ctype) (((type)->sub) ? ((type)->sub->name) : NULL)
853 #define __Pyx_PyType_TryGetSubSlot(type, sub, name, func_ctype) __Pyx_PyType_GetSubSlot(type, sub, name, func_ctype)
855 #define __Pyx_PyType_GetSlot(type, name, func_ctype) ((func_ctype) PyType_GetSlot((type), Py_##name))
856 #define __Pyx_PyType_TryGetSlot(type, name, func_ctype)\
857 ((__PYX_LIMITED_VERSION_HEX >= 0x030A0000 ||\
858 (PyType_GetFlags(type) & Py_TPFLAGS_HEAPTYPE) || __Pyx_get_runtime_version() >= 0x030A0000) ?\
859 __Pyx_PyType_GetSlot(type, name, func_ctype) : NULL)
860 #define __Pyx_PyType_GetSubSlot(obj, sub, name, func_ctype) __Pyx_PyType_GetSlot(obj, name, func_ctype)
861 #define __Pyx_PyType_TryGetSubSlot(obj, sub, name, func_ctype) __Pyx_PyType_TryGetSlot(obj, name, func_ctype)
863#if CYTHON_COMPILING_IN_CPYTHON || defined(_PyDict_NewPresized)
864#define __Pyx_PyDict_NewPresized(n) ((n <= 8) ? PyDict_New() : _PyDict_NewPresized(n))
866#define __Pyx_PyDict_NewPresized(n) PyDict_New()
868#define __Pyx_PyNumber_Divide(x,y) PyNumber_TrueDivide(x,y)
869#define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceTrueDivide(x,y)
870#if CYTHON_COMPILING_IN_CPYTHON && CYTHON_USE_UNICODE_INTERNALS
871#define __Pyx_PyDict_GetItemStrWithError(dict, name) _PyDict_GetItem_KnownHash(dict, name, ((PyASCIIObject *) name)->hash)
872static CYTHON_INLINE PyObject * __Pyx_PyDict_GetItemStr(PyObject *dict, PyObject *name) {
873 PyObject *res = __Pyx_PyDict_GetItemStrWithError(dict, name);
874 if (res == NULL && PyErr_Occurred()) {
875 PyErr_WriteUnraisable(NULL);
879#elif !CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07020000
880#define __Pyx_PyDict_GetItemStrWithError PyDict_GetItemWithError
881#define __Pyx_PyDict_GetItemStr PyDict_GetItem
883static CYTHON_INLINE PyObject * __Pyx_PyDict_GetItemStrWithError(PyObject *dict, PyObject *name) {
884#if CYTHON_COMPILING_IN_PYPY
885 return PyDict_GetItem(dict, name);
888 PyDictObject *mp = (PyDictObject*) dict;
889 long hash = ((PyStringObject *) name)->ob_shash;
891 ep = (mp->ma_lookup)(mp, name, hash);
898#define __Pyx_PyDict_GetItemStr PyDict_GetItem
900#if CYTHON_USE_TYPE_SLOTS
901 #define __Pyx_PyType_GetFlags(tp) (((PyTypeObject *)tp)->tp_flags)
902 #define __Pyx_PyType_HasFeature(type, feature) ((__Pyx_PyType_GetFlags(type) & (feature)) != 0)
904 #define __Pyx_PyType_GetFlags(tp) (PyType_GetFlags((PyTypeObject *)tp))
905 #define __Pyx_PyType_HasFeature(type, feature) PyType_HasFeature(type, feature)
907#define __Pyx_PyObject_GetIterNextFunc(iterator) __Pyx_PyObject_GetSlot(iterator, tp_iternext, iternextfunc)
908#if CYTHON_USE_TYPE_SPECS
909#define __Pyx_PyHeapTypeObject_GC_Del(obj) {\
910 PyTypeObject *type = Py_TYPE((PyObject*)obj);\
911 assert(__Pyx_PyType_HasFeature(type, Py_TPFLAGS_HEAPTYPE));\
912 PyObject_GC_Del(obj);\
916#define __Pyx_PyHeapTypeObject_GC_Del(obj) PyObject_GC_Del(obj)
918#if CYTHON_COMPILING_IN_LIMITED_API
919 #define __Pyx_PyUnicode_READY(op) (0)
920 #define __Pyx_PyUnicode_READ_CHAR(u, i) PyUnicode_ReadChar(u, i)
921 #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u) ((void)u, 1114111U)
922 #define __Pyx_PyUnicode_KIND(u) ((void)u, (0))
923 #define __Pyx_PyUnicode_KIND_04(u) __Pyx_PyUnicode_KIND(u)
924 #define __Pyx_PyUnicode_DATA(u) ((void*)u)
925 #define __Pyx_PyUnicode_READ(k, d, i) ((void)k, PyUnicode_ReadChar((PyObject*)(d), i))
926 #define __Pyx_PyUnicode_IS_TRUE(u) (0 != PyUnicode_GetLength(u))
928 #if PY_VERSION_HEX >= 0x030C0000
929 #define __Pyx_PyUnicode_READY(op) (0)
931 #define __Pyx_PyUnicode_READY(op) (likely(PyUnicode_IS_READY(op)) ?\
932 0 : _PyUnicode_Ready((PyObject *)(op)))
934 #define __Pyx_PyUnicode_READ_CHAR(u, i) PyUnicode_READ_CHAR(u, i)
935 #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u) PyUnicode_MAX_CHAR_VALUE(u)
936 #define __Pyx_PyUnicode_KIND(u) ((int)PyUnicode_KIND(u))
937 #define __Pyx_PyUnicode_DATA(u) PyUnicode_DATA(u)
938 #define __Pyx_PyUnicode_READ(k, d, i) PyUnicode_READ(k, d, i)
939 #define __Pyx_PyUnicode_WRITE(k, d, i, ch) PyUnicode_WRITE(k, d, i, (Py_UCS4) ch)
940 #if PY_VERSION_HEX >= 0x030C0000
941 #define __Pyx_PyUnicode_IS_TRUE(u) (0 != PyUnicode_GET_LENGTH(u))
943 #if CYTHON_COMPILING_IN_CPYTHON
944 #define __Pyx_PyUnicode_IS_TRUE(u) (0 != (likely(PyUnicode_IS_READY(u)) ? PyUnicode_GET_LENGTH(u) : ((PyCompactUnicodeObject *)(u))->wstr_length))
946 #define __Pyx_PyUnicode_IS_TRUE(u) (0 != (likely(PyUnicode_IS_READY(u)) ? PyUnicode_GET_LENGTH(u) : PyUnicode_GET_SIZE(u)))
949 static CYTHON_INLINE
int __Pyx_PyUnicode_KIND_04(PyObject *o) {
950 return __Pyx_PyUnicode_KIND(o) - (int) !!PyUnicode_IS_ASCII(o);
953#if CYTHON_COMPILING_IN_PYPY
954 #define __Pyx_PyUnicode_Concat(a, b) PyNumber_Add(a, b)
955 #define __Pyx_PyUnicode_ConcatSafe(a, b) PyNumber_Add(a, b)
957 #define __Pyx_PyUnicode_Concat(a, b) PyUnicode_Concat(a, b)
958 #define __Pyx_PyUnicode_ConcatSafe(a, b) ((unlikely((a) == Py_None) || unlikely((b) == Py_None)) ?\
959 PyNumber_Add(a, b) : __Pyx_PyUnicode_Concat(a, b))
961#if CYTHON_COMPILING_IN_PYPY
962 #if !defined(PyUnicode_DecodeUnicodeEscape)
963 #define PyUnicode_DecodeUnicodeEscape(s, size, errors) PyUnicode_Decode(s, size, "unicode_escape", errors)
965 #if !defined(PyUnicode_Contains)
966 #define PyUnicode_Contains(u, s) PySequence_Contains(u, s)
968 #if !defined(PyByteArray_Check)
969 #define PyByteArray_Check(obj) PyObject_TypeCheck(obj, &PyByteArray_Type)
971 #if !defined(PyObject_Format)
972 #define PyObject_Format(obj, fmt) PyObject_CallMethod(obj, "__format__", "O", fmt)
975#define __Pyx_PyUnicode_FormatSafe(a, b) ((unlikely((a) == Py_None || (PyUnicode_Check(b) && !PyUnicode_CheckExact(b)))) ? PyNumber_Remainder(a, b) : PyUnicode_Format(a, b))
976#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
977 #define __Pyx_PySequence_ListKeepNew(obj)\
978 (likely(PyList_CheckExact(obj) && PyUnstable_Object_IsUniquelyReferenced(obj)) ? __Pyx_NewRef(obj) : PySequence_List(obj))
979#elif CYTHON_COMPILING_IN_CPYTHON
980 #define __Pyx_PySequence_ListKeepNew(obj)\
981 (likely(PyList_CheckExact(obj) && Py_REFCNT(obj) == 1) ? __Pyx_NewRef(obj) : PySequence_List(obj))
983 #define __Pyx_PySequence_ListKeepNew(obj) PySequence_List(obj)
985#ifndef PySet_CheckExact
986 #define PySet_CheckExact(obj) Py_IS_TYPE(obj, &PySet_Type)
988enum __Pyx_ReferenceSharing {
989 __Pyx_ReferenceSharing_DefinitelyUnique,
990 __Pyx_ReferenceSharing_OwnStrongReference,
991 __Pyx_ReferenceSharing_FunctionArgument,
992 __Pyx_ReferenceSharing_SharedReference,
994#if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING && PY_VERSION_HEX >= 0x030E0000
995#define __Pyx_IS_UNIQUELY_REFERENCED(o, sharing)\
996 (sharing == __Pyx_ReferenceSharing_DefinitelyUnique ? 1 :\
997 (sharing == __Pyx_ReferenceSharing_FunctionArgument ? PyUnstable_Object_IsUniqueReferencedTemporary(o) :\
998 (sharing == __Pyx_ReferenceSharing_OwnStrongReference ? PyUnstable_Object_IsUniquelyReferenced(o) : 0)))
999#elif (CYTHON_COMPILING_IN_CPYTHON && !CYTHON_COMPILING_IN_CPYTHON_FREETHREADING) || CYTHON_COMPILING_IN_LIMITED_API
1000#define __Pyx_IS_UNIQUELY_REFERENCED(o, sharing) (((void)sharing), Py_REFCNT(o) == 1)
1002#define __Pyx_IS_UNIQUELY_REFERENCED(o, sharing) (((void)o), ((void)sharing), 0)
1004#if __PYX_LIMITED_VERSION_HEX >= 0x030d0000
1005 #define __Pyx_PyList_GetItemRef(o, i) PyList_GetItemRef(o, i)
1006#elif CYTHON_AVOID_BORROWED_REFS || CYTHON_AVOID_THREAD_UNSAFE_BORROWED_REFS
1007 #if CYTHON_COMPILING_IN_LIMITED_API || !CYTHON_ASSUME_SAFE_MACROS
1008 #define __Pyx_PyList_GetItemRef(o, i) (likely((i) >= 0) ? PySequence_GetItem(o, i) : (PyErr_SetString(PyExc_IndexError, "list index out of range"), (PyObject*)NULL))
1010 #define __Pyx_PyList_GetItemRef(o, i) PySequence_ITEM(o, i)
1012#elif CYTHON_COMPILING_IN_LIMITED_API || !(CYTHON_ASSUME_SAFE_MACROS && CYTHON_ASSUME_SAFE_SIZE)
1013 #define __Pyx_PyList_GetItemRef(o, i) __Pyx_XNewRef(PyList_GetItem(o, i))
1015 #define __Pyx_PyList_GetItemRef(o, i) (likely(__Pyx_is_valid_index(i, PyList_GET_SIZE(o))) ?\
1016 __Pyx_NewRef(PyList_GET_ITEM(o, i)) : (PyErr_SetString(PyExc_IndexError, "list index out of range"), (PyObject*)NULL))
1018#if CYTHON_AVOID_BORROWED_REFS || CYTHON_COMPILING_IN_LIMITED_API
1019 #define __Pyx_PyList_GET_ITEM_REF(o, i, unsafe_shared) ((void)(unsafe_shared),\
1020 __Pyx_PyList_GetItemRef(o, i))
1021#elif CYTHON_AVOID_THREAD_UNSAFE_BORROWED_REFS
1022 #if CYTHON_ASSUME_SAFE_MACROS
1023 #define __Pyx_PyList_GET_ITEM_REF(o, i, unsafe_shared) (\
1024 __Pyx_IS_UNIQUELY_REFERENCED(o, unsafe_shared) ?\
1025 __Pyx_NewRef(PyList_GET_ITEM(o, i)) : __Pyx_PyList_GetItemRef(o, i))
1027 #define __Pyx_PyList_GET_ITEM_REF(o, i, unsafe_shared) (\
1028 __Pyx_IS_UNIQUELY_REFERENCED(o, unsafe_shared) ?\
1029 __Pyx_XNewRef(PyList_GetItem(o, i)) : __Pyx_PyList_GetItemRef(o, i))
1031#elif CYTHON_ASSUME_SAFE_MACROS
1032 #define __Pyx_PyList_GET_ITEM_REF(o, i, unsafe_shared) ((void)(unsafe_shared),\
1033 __Pyx_NewRef(PyList_GET_ITEM(o, i)))
1035 #define __Pyx_PyList_GET_ITEM_REF(o, i, unsafe_shared) ((void)(unsafe_shared),\
1036 __Pyx_XNewRef(PyList_GetItem(o, i)))
1038#if __PYX_LIMITED_VERSION_HEX >= 0x030d0000
1039#define __Pyx_PyDict_GetItemRef(dict, key, result) PyDict_GetItemRef(dict, key, result)
1040#elif CYTHON_AVOID_BORROWED_REFS || CYTHON_AVOID_THREAD_UNSAFE_BORROWED_REFS
1041static CYTHON_INLINE
int __Pyx_PyDict_GetItemRef(PyObject *dict, PyObject *key, PyObject **result) {
1042 *result = PyObject_GetItem(dict, key);
1043 if (*result == NULL) {
1044 if (PyErr_ExceptionMatches(PyExc_KeyError)) {
1053static CYTHON_INLINE
int __Pyx_PyDict_GetItemRef(PyObject *dict, PyObject *key, PyObject **result) {
1054 *result = PyDict_GetItemWithError(dict, key);
1055 if (*result == NULL) {
1056 return PyErr_Occurred() ? -1 : 0;
1062#if defined(CYTHON_DEBUG_VISIT_CONST) && CYTHON_DEBUG_VISIT_CONST
1063 #define __Pyx_VISIT_CONST(obj) Py_VISIT(obj)
1065 #define __Pyx_VISIT_CONST(obj)
1067#if CYTHON_ASSUME_SAFE_MACROS
1068 #define __Pyx_PySequence_ITEM(o, i) PySequence_ITEM(o, i)
1069 #define __Pyx_PySequence_SIZE(seq) Py_SIZE(seq)
1070 #define __Pyx_PyTuple_SET_ITEM(o, i, v) (PyTuple_SET_ITEM(o, i, v), (0))
1071 #define __Pyx_PyTuple_GET_ITEM(o, i) PyTuple_GET_ITEM(o, i)
1072 #define __Pyx_PyList_SET_ITEM(o, i, v) (PyList_SET_ITEM(o, i, v), (0))
1073 #define __Pyx_PyList_GET_ITEM(o, i) PyList_GET_ITEM(o, i)
1075 #define __Pyx_PySequence_ITEM(o, i) PySequence_GetItem(o, i)
1076 #define __Pyx_PySequence_SIZE(seq) PySequence_Size(seq)
1077 #define __Pyx_PyTuple_SET_ITEM(o, i, v) PyTuple_SetItem(o, i, v)
1078 #define __Pyx_PyTuple_GET_ITEM(o, i) PyTuple_GetItem(o, i)
1079 #define __Pyx_PyList_SET_ITEM(o, i, v) PyList_SetItem(o, i, v)
1080 #define __Pyx_PyList_GET_ITEM(o, i) PyList_GetItem(o, i)
1082#if CYTHON_ASSUME_SAFE_SIZE
1083 #define __Pyx_PyTuple_GET_SIZE(o) PyTuple_GET_SIZE(o)
1084 #define __Pyx_PyList_GET_SIZE(o) PyList_GET_SIZE(o)
1085 #define __Pyx_PySet_GET_SIZE(o) PySet_GET_SIZE(o)
1086 #define __Pyx_PyDict_GET_SIZE(o) PyDict_GET_SIZE(o)
1087 #define __Pyx_PyBytes_GET_SIZE(o) PyBytes_GET_SIZE(o)
1088 #define __Pyx_PyByteArray_GET_SIZE(o) PyByteArray_GET_SIZE(o)
1089 #define __Pyx_PyUnicode_GET_LENGTH(o) PyUnicode_GET_LENGTH(o)
1091 #define __Pyx_PyTuple_GET_SIZE(o) PyTuple_Size(o)
1092 #define __Pyx_PyList_GET_SIZE(o) PyList_Size(o)
1093 #define __Pyx_PySet_GET_SIZE(o) PySet_Size(o)
1094 #define __Pyx_PyDict_GET_SIZE(o) PyDict_Size(o)
1095 #define __Pyx_PyBytes_GET_SIZE(o) PyBytes_Size(o)
1096 #define __Pyx_PyByteArray_GET_SIZE(o) PyByteArray_Size(o)
1097 #define __Pyx_PyUnicode_GET_LENGTH(o) PyUnicode_GetLength(o)
1099#if CYTHON_COMPILING_IN_PYPY && !defined(PyUnicode_InternFromString)
1100 #define PyUnicode_InternFromString(s) PyUnicode_FromString(s)
1102#define __Pyx_PyLong_FromHash_t PyLong_FromSsize_t
1103#define __Pyx_PyLong_AsHash_t __Pyx_PyIndex_AsSsize_t
1104#if __PYX_LIMITED_VERSION_HEX >= 0x030A0000
1105 #define __Pyx_PySendResult PySendResult
1111 } __Pyx_PySendResult;
1113#if CYTHON_COMPILING_IN_LIMITED_API || PY_VERSION_HEX < 0x030A00A3
1114 typedef __Pyx_PySendResult (*__Pyx_pyiter_sendfunc)(PyObject *iter, PyObject *value, PyObject **result);
1116 #define __Pyx_pyiter_sendfunc sendfunc
1118#if !CYTHON_USE_AM_SEND
1119#define __PYX_HAS_PY_AM_SEND 0
1120#elif __PYX_LIMITED_VERSION_HEX >= 0x030A0000
1121#define __PYX_HAS_PY_AM_SEND 1
1123#define __PYX_HAS_PY_AM_SEND 2
1125#if __PYX_HAS_PY_AM_SEND < 2
1126 #define __Pyx_PyAsyncMethodsStruct PyAsyncMethods
1132 __Pyx_pyiter_sendfunc am_send;
1133 } __Pyx_PyAsyncMethodsStruct;
1134 #define __Pyx_SlotTpAsAsync(s) ((PyAsyncMethods*)(s))
1136#if CYTHON_USE_AM_SEND && PY_VERSION_HEX < 0x030A00F0
1137 #define __Pyx_TPFLAGS_HAVE_AM_SEND (1UL << 21)
1139 #define __Pyx_TPFLAGS_HAVE_AM_SEND (0)
1141#if CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030A0000
1145PyAPI_FUNC(
void *) PyMem_Calloc(
size_t nelem,
size_t elsize);
1147#if CYTHON_COMPILING_IN_LIMITED_API
1148static int __Pyx_init_co_variable(PyObject *inspect,
const char* name,
int *write_to) {
1150 PyObject *py_value = PyObject_GetAttrString(inspect, name);
1151 if (!py_value)
return 0;
1152 value = (int) PyLong_AsLong(py_value);
1153 Py_DECREF(py_value);
1155 return value != -1 || !PyErr_Occurred();
1157static int __Pyx_init_co_variables(
void) {
1160 inspect = PyImport_ImportModule(
"inspect");
1162#if !defined(CO_OPTIMIZED)
1163 __Pyx_init_co_variable(inspect,
"CO_OPTIMIZED", &CO_OPTIMIZED) &&
1165#if !defined(CO_NEWLOCALS)
1166 __Pyx_init_co_variable(inspect,
"CO_NEWLOCALS", &CO_NEWLOCALS) &&
1168#if !defined(CO_VARARGS)
1169 __Pyx_init_co_variable(inspect,
"CO_VARARGS", &CO_VARARGS) &&
1171#if !defined(CO_VARKEYWORDS)
1172 __Pyx_init_co_variable(inspect,
"CO_VARKEYWORDS", &CO_VARKEYWORDS) &&
1174#if !defined(CO_ASYNC_GENERATOR)
1175 __Pyx_init_co_variable(inspect,
"CO_ASYNC_GENERATOR", &CO_ASYNC_GENERATOR) &&
1177#if !defined(CO_GENERATOR)
1178 __Pyx_init_co_variable(inspect,
"CO_GENERATOR", &CO_GENERATOR) &&
1180#if !defined(CO_COROUTINE)
1181 __Pyx_init_co_variable(inspect,
"CO_COROUTINE", &CO_COROUTINE) &&
1185 return result ? 0 : -1;
1187static int __Pyx_init_tpflags_bitcount(
unsigned long flag) {
1190 count += (int) (flag & 1);
1195static int __Pyx_init_tpflags_variables(
void) {
1196 if (__Pyx_Runtime_TPFLAGS_SEQUENCE != 0 && __Pyx_Runtime_TPFLAGS_MAPPING != 0) {
1199 PyObject *collections_abc = PyImport_ImportModule(
"collections.abc");
1200 if (!collections_abc)
return -1;
1202 PyObject *sequence = NULL, *mapping = NULL;
1203#if __PYX_LIMITED_VERSION_HEX >= 0x030D0000
1204 if (PyObject_GetOptionalAttrString(collections_abc,
"Sequence", &sequence) != 1)
goto fail;
1205 if (PyObject_GetOptionalAttrString(collections_abc,
"Mapping", &mapping) != 1)
goto fail;
1207 sequence = PyObject_GetAttrString(collections_abc,
"Sequence");
1208 if (!sequence)
goto fail_attr_lookup;
1209 mapping = PyObject_GetAttrString(collections_abc,
"Mapping");
1210 if (!mapping)
goto fail_attr_lookup;
1212 if (!PyType_Check(sequence) || !PyType_Check(mapping))
goto fail;
1214 unsigned long sequence_flags = PyType_GetFlags((PyTypeObject*)sequence);
1215 unsigned long mapping_flags = PyType_GetFlags((PyTypeObject*)mapping);
1216 unsigned long mutual_flags = sequence_flags & mapping_flags;
1217 sequence_flags = sequence_flags ^ mutual_flags;
1218 mapping_flags = mapping_flags ^ mutual_flags;
1219 if (__Pyx_Runtime_TPFLAGS_SEQUENCE == 0 && __Pyx_init_tpflags_bitcount(sequence_flags) == 1) {
1220 __Pyx_Runtime_TPFLAGS_SEQUENCE = sequence_flags;
1222 if (__Pyx_Runtime_TPFLAGS_MAPPING == 0 && __Pyx_init_tpflags_bitcount(mapping_flags) == 1) {
1223 __Pyx_Runtime_TPFLAGS_MAPPING = mapping_flags;
1227 Py_XDECREF(mapping);
1228 Py_XDECREF(sequence);
1229 Py_DECREF(collections_abc);
1231#if __PYX_LIMITED_VERSION_HEX < 0x030D0000
1233 if (PyErr_ExceptionMatches(PyExc_AttributeError)) {
1238 result = PyErr_Occurred() ? -1 : 0;
1242static int __Pyx_init_co_variables(
void) {
1245static int __Pyx_init_tpflags_variables(
void) {
1251#if defined(_WIN32) || defined(WIN32) || defined(MS_WINDOWS)
1252 #ifndef _USE_MATH_DEFINES
1253 #define _USE_MATH_DEFINES
1257#if defined(__CYGWIN__) && defined(_LDBL_EQ_DBL)
1258#define __Pyx_truncl trunc
1260#define __Pyx_truncl truncl
1263#ifndef CYTHON_CLINE_IN_TRACEBACK_RUNTIME
1264#define CYTHON_CLINE_IN_TRACEBACK_RUNTIME 1
1266#ifndef CYTHON_CLINE_IN_TRACEBACK
1267#define CYTHON_CLINE_IN_TRACEBACK CYTHON_CLINE_IN_TRACEBACK_RUNTIME
1269#if CYTHON_CLINE_IN_TRACEBACK
1270#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; }
1272#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; }
1274#define __PYX_ERR(f_index, lineno, Ln_error) \
1275 { __PYX_MARK_ERR_POS(f_index, lineno) goto Ln_error; }
1277#ifdef CYTHON_EXTERN_C
1278 #undef __PYX_EXTERN_C
1279 #define __PYX_EXTERN_C CYTHON_EXTERN_C
1280#elif defined(__PYX_EXTERN_C)
1282 #pragma message ("Please do not define the '__PYX_EXTERN_C' macro externally. Use 'CYTHON_EXTERN_C' instead.")
1284 #warning Please do not define the '__PYX_EXTERN_C' macro externally. Use 'CYTHON_EXTERN_C' instead.
1288 #define __PYX_EXTERN_C extern "C"
1290 #define __PYX_EXTERN_C extern
1294#define __PYX_HAVE__cshockCapturing
1295#define __PYX_HAVE_API__cshockCapturing
1302#include "numpy/arrayobject.h"
1303#include "numpy/ndarrayobject.h"
1304#include "numpy/ndarraytypes.h"
1305#include "numpy/arrayscalars.h"
1306#include "numpy/ufuncobject.h"
1312#if defined(PYREX_WITHOUT_ASSERTIONS) && !defined(CYTHON_WITHOUT_ASSERTIONS)
1313#define CYTHON_WITHOUT_ASSERTIONS
1316#ifdef CYTHON_FREETHREADING_COMPATIBLE
1317#if CYTHON_FREETHREADING_COMPATIBLE
1318#define __Pyx_FREETHREADING_COMPATIBLE Py_MOD_GIL_NOT_USED
1320#define __Pyx_FREETHREADING_COMPATIBLE Py_MOD_GIL_USED
1323#define __Pyx_FREETHREADING_COMPATIBLE Py_MOD_GIL_USED
1325#define __PYX_DEFAULT_STRING_ENCODING_IS_ASCII 0
1326#define __PYX_DEFAULT_STRING_ENCODING_IS_UTF8 0
1327#define __PYX_DEFAULT_STRING_ENCODING ""
1328#define __Pyx_PyObject_FromString __Pyx_PyBytes_FromString
1329#define __Pyx_PyObject_FromStringAndSize __Pyx_PyBytes_FromStringAndSize
1330#define __Pyx_uchar_cast(c) ((unsigned char)c)
1331#define __Pyx_long_cast(x) ((long)x)
1332#define __Pyx_fits_Py_ssize_t(v, type, is_signed) (\
1333 (sizeof(type) < sizeof(Py_ssize_t)) ||\
1334 (sizeof(type) > sizeof(Py_ssize_t) &&\
1335 likely(v < (type)PY_SSIZE_T_MAX ||\
1336 v == (type)PY_SSIZE_T_MAX) &&\
1337 (!is_signed || likely(v > (type)PY_SSIZE_T_MIN ||\
1338 v == (type)PY_SSIZE_T_MIN))) ||\
1339 (sizeof(type) == sizeof(Py_ssize_t) &&\
1340 (is_signed || likely(v < (type)PY_SSIZE_T_MAX ||\
1341 v == (type)PY_SSIZE_T_MAX))) )
1342static CYTHON_INLINE
int __Pyx_is_valid_index(Py_ssize_t i, Py_ssize_t limit) {
1343 return (
size_t) i < (size_t) limit;
1345#if defined (__cplusplus) && __cplusplus >= 201103L
1347 #define __Pyx_sst_abs(value) std::abs(value)
1348#elif SIZEOF_INT >= SIZEOF_SIZE_T
1349 #define __Pyx_sst_abs(value) abs(value)
1350#elif SIZEOF_LONG >= SIZEOF_SIZE_T
1351 #define __Pyx_sst_abs(value) labs(value)
1352#elif defined (_MSC_VER)
1353 #define __Pyx_sst_abs(value) ((Py_ssize_t)_abs64(value))
1354#elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
1355 #define __Pyx_sst_abs(value) llabs(value)
1356#elif defined (__GNUC__)
1357 #define __Pyx_sst_abs(value) __builtin_llabs(value)
1359 #define __Pyx_sst_abs(value) ((value<0) ? -value : value)
1361static CYTHON_INLINE Py_ssize_t __Pyx_ssize_strlen(
const char *
s);
1362static CYTHON_INLINE
const char* __Pyx_PyObject_AsString(PyObject*);
1363static CYTHON_INLINE
const char* __Pyx_PyObject_AsStringAndSize(PyObject*, Py_ssize_t* length);
1364static CYTHON_INLINE PyObject* __Pyx_PyByteArray_FromString(
const char*);
1365#define __Pyx_PyByteArray_FromStringAndSize(s, l) PyByteArray_FromStringAndSize((const char*)s, l)
1366#define __Pyx_PyBytes_FromString PyBytes_FromString
1367#define __Pyx_PyBytes_FromStringAndSize PyBytes_FromStringAndSize
1368static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(
const char*);
1369#if CYTHON_ASSUME_SAFE_MACROS
1370 #define __Pyx_PyBytes_AsWritableString(s) ((char*) PyBytes_AS_STRING(s))
1371 #define __Pyx_PyBytes_AsWritableSString(s) ((signed char*) PyBytes_AS_STRING(s))
1372 #define __Pyx_PyBytes_AsWritableUString(s) ((unsigned char*) PyBytes_AS_STRING(s))
1373 #define __Pyx_PyBytes_AsString(s) ((const char*) PyBytes_AS_STRING(s))
1374 #define __Pyx_PyBytes_AsSString(s) ((const signed char*) PyBytes_AS_STRING(s))
1375 #define __Pyx_PyBytes_AsUString(s) ((const unsigned char*) PyBytes_AS_STRING(s))
1376 #define __Pyx_PyByteArray_AsString(s) PyByteArray_AS_STRING(s)
1378 #define __Pyx_PyBytes_AsWritableString(s) ((char*) PyBytes_AsString(s))
1379 #define __Pyx_PyBytes_AsWritableSString(s) ((signed char*) PyBytes_AsString(s))
1380 #define __Pyx_PyBytes_AsWritableUString(s) ((unsigned char*) PyBytes_AsString(s))
1381 #define __Pyx_PyBytes_AsString(s) ((const char*) PyBytes_AsString(s))
1382 #define __Pyx_PyBytes_AsSString(s) ((const signed char*) PyBytes_AsString(s))
1383 #define __Pyx_PyBytes_AsUString(s) ((const unsigned char*) PyBytes_AsString(s))
1384 #define __Pyx_PyByteArray_AsString(s) PyByteArray_AsString(s)
1386#define __Pyx_PyObject_AsWritableString(s) ((char*)(__pyx_uintptr_t) __Pyx_PyObject_AsString(s))
1387#define __Pyx_PyObject_AsWritableSString(s) ((signed char*)(__pyx_uintptr_t) __Pyx_PyObject_AsString(s))
1388#define __Pyx_PyObject_AsWritableUString(s) ((unsigned char*)(__pyx_uintptr_t) __Pyx_PyObject_AsString(s))
1389#define __Pyx_PyObject_AsSString(s) ((const signed char*) __Pyx_PyObject_AsString(s))
1390#define __Pyx_PyObject_AsUString(s) ((const unsigned char*) __Pyx_PyObject_AsString(s))
1391#define __Pyx_PyObject_FromCString(s) __Pyx_PyObject_FromString((const char*)s)
1392#define __Pyx_PyBytes_FromCString(s) __Pyx_PyBytes_FromString((const char*)s)
1393#define __Pyx_PyByteArray_FromCString(s) __Pyx_PyByteArray_FromString((const char*)s)
1394#define __Pyx_PyUnicode_FromCString(s) __Pyx_PyUnicode_FromString((const char*)s)
1395#define __Pyx_PyUnicode_FromOrdinal(o) PyUnicode_FromOrdinal((int)o)
1396#define __Pyx_PyUnicode_AsUnicode PyUnicode_AsUnicode
1397static CYTHON_INLINE PyObject *__Pyx_NewRef(PyObject *obj) {
1398#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030a0000 || defined(Py_NewRef)
1399 return Py_NewRef(obj);
1405static CYTHON_INLINE PyObject *__Pyx_XNewRef(PyObject *obj) {
1406#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030a0000 || defined(Py_XNewRef)
1407 return Py_XNewRef(obj);
1413static CYTHON_INLINE PyObject *__Pyx_Owned_Py_None(
int b);
1414static CYTHON_INLINE PyObject * __Pyx_PyBool_FromLong(
long b);
1415static CYTHON_INLINE
int __Pyx_PyObject_IsTrue(PyObject*);
1416static CYTHON_INLINE
int __Pyx_PyObject_IsTrueAndDecref(PyObject*);
1417static CYTHON_INLINE PyObject* __Pyx_PyNumber_Long(PyObject* x);
1418#define __Pyx_PyObject_RichCompareBool(a,b,cmp) __Pyx_PyObject_IsTrueAndDecref(PyObject_RichCompare((a),(b),(cmp)))
1419#define __Pyx_PySequence_Tuple(obj)\
1420 (likely(PyTuple_CheckExact(obj)) ? __Pyx_NewRef(obj) : PySequence_Tuple(obj))
1421static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject*);
1422static CYTHON_INLINE PyObject * __Pyx_PyLong_FromSize_t(
size_t);
1423static CYTHON_INLINE Py_hash_t __Pyx_PyIndex_AsHash_t(PyObject*);
1424#if CYTHON_ASSUME_SAFE_MACROS
1425#define __Pyx_PyFloat_AsDouble(x) (PyFloat_CheckExact(x) ? PyFloat_AS_DOUBLE(x) : PyFloat_AsDouble(x))
1426#define __Pyx_PyFloat_AS_DOUBLE(x) PyFloat_AS_DOUBLE(x)
1427#define __Pyx_PyFloat_IsNonZero(x) (PyFloat_AS_DOUBLE(x) != 0.0)
1429#define __Pyx_PyFloat_AsDouble(x) PyFloat_AsDouble(x)
1430#define __Pyx_PyFloat_AS_DOUBLE(x) PyFloat_AsDouble(x)
1431#define __Pyx_PyFloat_IsNonZero(x) PyObject_IsTrue(x)
1433#define __Pyx_PyFloat_AsFloat(x) ((float) __Pyx_PyFloat_AsDouble(x))
1434#define __Pyx_PyNumber_Int(x) (PyLong_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Long(x))
1435#if CYTHON_USE_PYLONG_INTERNALS
1436 #if PY_VERSION_HEX >= 0x030C00A7
1437 #ifndef _PyLong_SIGN_MASK
1438 #define _PyLong_SIGN_MASK 3
1440 #ifndef _PyLong_NON_SIZE_BITS
1441 #define _PyLong_NON_SIZE_BITS 3
1443 #define __Pyx_PyLong_SignBits(x) ((int) (((PyLongObject*)x)->long_value.lv_tag & _PyLong_SIGN_MASK))
1444 #define __Pyx_PyLong_Sign(x) (1 - __Pyx_PyLong_SignBits(x))
1445 #define __Pyx_PyLong_IsNeg(x) ((__Pyx_PyLong_SignBits(x) & 2) != 0)
1446 #define __Pyx_PyLong_IsNonNeg(x) (!__Pyx_PyLong_IsNeg(x))
1447 #define __Pyx_PyLong_IsZero(x) (__Pyx_PyLong_SignBits(x) & 1)
1448 #define __Pyx_PyLong_IsPos(x) (__Pyx_PyLong_SignBits(x) == 0)
1449 #define __Pyx_PyLong_CompactValueUnsigned(x) (__Pyx_PyLong_Digits(x)[0])
1450 #define __Pyx_PyLong_DigitCount(x) ((Py_ssize_t) (((PyLongObject*)x)->long_value.lv_tag >> _PyLong_NON_SIZE_BITS))
1451 #define __Pyx_PyLong_SignedDigitCount(x)\
1452 (((Py_ssize_t) __Pyx_PyLong_Sign(x)) * __Pyx_PyLong_DigitCount(x))
1453 #if defined(PyUnstable_Long_IsCompact) && defined(PyUnstable_Long_CompactValue)
1454 #define __Pyx_PyLong_IsCompact(x) PyUnstable_Long_IsCompact((PyLongObject*) x)
1455 #define __Pyx_PyLong_CompactValue(x) PyUnstable_Long_CompactValue((PyLongObject*) x)
1457 #define __Pyx_PyLong_IsCompact(x) (((PyLongObject*)x)->long_value.lv_tag < (2 << _PyLong_NON_SIZE_BITS))
1458 #define __Pyx_PyLong_CompactValue(x) (((Py_ssize_t) __Pyx_PyLong_Sign(x)) * (Py_ssize_t) __Pyx_PyLong_Digits(x)[0])
1460 static CYTHON_INLINE Py_ssize_t __Pyx_PyLong_CompareSignAndSize(PyObject *a, PyObject *b) {
1461 uintptr_t tag_a = ((PyLongObject*)a)->long_value.lv_tag;
1462 uintptr_t tag_b = ((PyLongObject*)b)->long_value.lv_tag;
1463 if (tag_a == tag_b)
return 0;
1464 int sign_a = (int) (tag_a & _PyLong_SIGN_MASK);
1465 int sign_b = (int) (tag_b & _PyLong_SIGN_MASK);
1466 if (sign_a > sign_b)
return -1;
1467 if (sign_a < sign_b)
return 1;
1468 Py_ssize_t size_a = (Py_ssize_t) (tag_a >> _PyLong_NON_SIZE_BITS);
1469 Py_ssize_t size_b = (Py_ssize_t) (tag_b >> _PyLong_NON_SIZE_BITS);
1470 return (1 - sign_a) * (size_a - size_b);
1472 typedef Py_ssize_t __Pyx_compact_pylong;
1473 typedef size_t __Pyx_compact_upylong;
1475 #define __Pyx_PyLong_Sign(x) ((int) ((Py_SIZE(x) == 0) ? 0 : (Py_SIZE(x) < 0) ? -1 : 1))
1476 #define __Pyx_PyLong_IsNeg(x) (Py_SIZE(x) < 0)
1477 #define __Pyx_PyLong_IsNonNeg(x) (Py_SIZE(x) >= 0)
1478 #define __Pyx_PyLong_IsZero(x) (Py_SIZE(x) == 0)
1479 #define __Pyx_PyLong_IsPos(x) (Py_SIZE(x) > 0)
1480 #define __Pyx_PyLong_CompactValueUnsigned(x) ((Py_SIZE(x) == 0) ? 0 : __Pyx_PyLong_Digits(x)[0])
1481 #define __Pyx_PyLong_DigitCount(x) __Pyx_sst_abs(Py_SIZE(x))
1482 #define __Pyx_PyLong_SignedDigitCount(x) Py_SIZE(x)
1483 #define __Pyx_PyLong_IsCompact(x) (Py_SIZE(x) == 0 || Py_SIZE(x) == 1 || Py_SIZE(x) == -1)
1484 #define __Pyx_PyLong_CompactValue(x)\
1485 ((Py_SIZE(x) == 0) ? (sdigit) 0 : ((Py_SIZE(x) < 0) ? -(sdigit)__Pyx_PyLong_Digits(x)[0] : (sdigit)__Pyx_PyLong_Digits(x)[0]))
1486 #define __Pyx_PyLong_CompareSignAndSize(a, b) (Py_SIZE(a) - Py_SIZE(b))
1487 typedef sdigit __Pyx_compact_pylong;
1488 typedef digit __Pyx_compact_upylong;
1490 #if PY_VERSION_HEX >= 0x030C00A5
1491 #define __Pyx_PyLong_Digits(x) (((PyLongObject*)x)->long_value.ob_digit)
1493 #define __Pyx_PyLong_Digits(x) (((PyLongObject*)x)->ob_digit)
1495 #define __Pyx_PyLong_IsNonZero(x) (!__Pyx_PyLong_IsZero(x))
1497 #define __Pyx_PyLong_IsNonZero(x) PyObject_IsTrue(x)
1499#if __PYX_DEFAULT_STRING_ENCODING_IS_UTF8
1500 #define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_DecodeUTF8(c_str, size, NULL)
1501#elif __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
1502 #define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_DecodeASCII(c_str, size, NULL)
1504 #define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_Decode(c_str, size, __PYX_DEFAULT_STRING_ENCODING, NULL)
1509#if defined(__GNUC__) && (__GNUC__ > 2 || (__GNUC__ == 2 && (__GNUC_MINOR__ > 95)))
1510 #define likely(x) __builtin_expect(!!(x), 1)
1511 #define unlikely(x) __builtin_expect(!!(x), 0)
1513 #define likely(x) (x)
1514 #define unlikely(x) (x)
1518#if __cplusplus > 201103L
1519#include <type_traits>
1521template <
typename T>
1522static void __Pyx_pretend_to_initialize(
T* ptr) {
1523#if __cplusplus > 201103L
1524 if ((std::is_trivially_default_constructible<T>::value))
1530static CYTHON_INLINE
void __Pyx_pretend_to_initialize(
void* ptr) { (void)ptr; }
1534#if !CYTHON_USE_MODULE_STATE
1535static PyObject *__pyx_m = NULL;
1537static const char *
const __pyx_cfilenm = __FILE__;
1540#if !defined(CYTHON_CCOMPLEX)
1541 #if defined(__cplusplus)
1542 #define CYTHON_CCOMPLEX 1
1543 #elif (defined(_Complex_I) && !defined(_MSC_VER)) || ((defined (__STDC_VERSION__) && __STDC_VERSION__ >= 201112L) && !defined(__STDC_NO_COMPLEX__) && !defined(_MSC_VER))
1544 #define CYTHON_CCOMPLEX 1
1546 #define CYTHON_CCOMPLEX 0
1553 #include <complex.h>
1556#if CYTHON_CCOMPLEX && !defined(__cplusplus) && defined(__sun__) && defined(__GNUC__)
1558 #define _Complex_I 1.0fj
1563static const char*
const __pyx_f[] = {
1564 "proteus/cshockCapturing.pyx",
1565 "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd",
1570#include <pythread.h>
1571#ifndef CYTHON_ATOMICS
1572 #define CYTHON_ATOMICS 1
1574#define __PYX_CYTHON_ATOMICS_ENABLED() CYTHON_ATOMICS
1575#define __PYX_GET_CYTHON_COMPILING_IN_CPYTHON_FREETHREADING() CYTHON_COMPILING_IN_CPYTHON_FREETHREADING
1576#define __pyx_atomic_int_type int
1577#define __pyx_nonatomic_int_type int
1578#if CYTHON_ATOMICS && (defined(__STDC_VERSION__) &&\
1579 (__STDC_VERSION__ >= 201112L) &&\
1580 !defined(__STDC_NO_ATOMICS__))
1581 #include <stdatomic.h>
1582#elif CYTHON_ATOMICS && (defined(__cplusplus) && (\
1583 (__cplusplus >= 201103L) ||\
1584 (defined(_MSC_VER) && _MSC_VER >= 1700)))
1587#if CYTHON_ATOMICS && (defined(__STDC_VERSION__) &&\
1588 (__STDC_VERSION__ >= 201112L) &&\
1589 !defined(__STDC_NO_ATOMICS__) &&\
1590 ATOMIC_INT_LOCK_FREE == 2)
1591 #undef __pyx_atomic_int_type
1592 #define __pyx_atomic_int_type atomic_int
1593 #define __pyx_atomic_ptr_type atomic_uintptr_t
1594 #define __pyx_nonatomic_ptr_type uintptr_t
1595 #define __pyx_atomic_incr_relaxed(value) atomic_fetch_add_explicit(value, 1, memory_order_relaxed)
1596 #define __pyx_atomic_incr_acq_rel(value) atomic_fetch_add_explicit(value, 1, memory_order_acq_rel)
1597 #define __pyx_atomic_decr_acq_rel(value) atomic_fetch_sub_explicit(value, 1, memory_order_acq_rel)
1598 #define __pyx_atomic_sub(value, arg) atomic_fetch_sub(value, arg)
1599 #define __pyx_atomic_int_cmp_exchange(value, expected, desired) atomic_compare_exchange_strong(value, expected, desired)
1600 #define __pyx_atomic_load(value) atomic_load(value)
1601 #define __pyx_atomic_store(value, new_value) atomic_store(value, new_value)
1602 #define __pyx_atomic_pointer_load_relaxed(value) atomic_load_explicit(value, memory_order_relaxed)
1603 #define __pyx_atomic_pointer_load_acquire(value) atomic_load_explicit(value, memory_order_acquire)
1604 #define __pyx_atomic_pointer_exchange(value, new_value) atomic_exchange(value, (__pyx_nonatomic_ptr_type)new_value)
1605 #define __pyx_atomic_pointer_cmp_exchange(value, expected, desired) atomic_compare_exchange_strong(value, expected, desired)
1606 #if defined(__PYX_DEBUG_ATOMICS) && defined(_MSC_VER)
1607 #pragma message ("Using standard C atomics")
1608 #elif defined(__PYX_DEBUG_ATOMICS)
1609 #warning "Using standard C atomics"
1611#elif CYTHON_ATOMICS && (defined(__cplusplus) && (\
1612 (__cplusplus >= 201103L) ||\
1614 (defined(_MSC_VER) && _MSC_VER >= 1700)) &&\
1615 ATOMIC_INT_LOCK_FREE == 2)
1616 #undef __pyx_atomic_int_type
1617 #define __pyx_atomic_int_type std::atomic_int
1618 #define __pyx_atomic_ptr_type std::atomic_uintptr_t
1619 #define __pyx_nonatomic_ptr_type uintptr_t
1620 #define __pyx_atomic_incr_relaxed(value) std::atomic_fetch_add_explicit(value, 1, std::memory_order_relaxed)
1621 #define __pyx_atomic_incr_acq_rel(value) std::atomic_fetch_add_explicit(value, 1, std::memory_order_acq_rel)
1622 #define __pyx_atomic_decr_acq_rel(value) std::atomic_fetch_sub_explicit(value, 1, std::memory_order_acq_rel)
1623 #define __pyx_atomic_sub(value, arg) std::atomic_fetch_sub(value, arg)
1624 #define __pyx_atomic_int_cmp_exchange(value, expected, desired) std::atomic_compare_exchange_strong(value, expected, desired)
1625 #define __pyx_atomic_load(value) std::atomic_load(value)
1626 #define __pyx_atomic_store(value, new_value) std::atomic_store(value, new_value)
1627 #define __pyx_atomic_pointer_load_relaxed(value) std::atomic_load_explicit(value, std::memory_order_relaxed)
1628 #define __pyx_atomic_pointer_load_acquire(value) std::atomic_load_explicit(value, std::memory_order_acquire)
1629 #define __pyx_atomic_pointer_exchange(value, new_value) std::atomic_exchange(value, (__pyx_nonatomic_ptr_type)new_value)
1630 #define __pyx_atomic_pointer_cmp_exchange(value, expected, desired) std::atomic_compare_exchange_strong(value, expected, desired)
1631 #if defined(__PYX_DEBUG_ATOMICS) && defined(_MSC_VER)
1632 #pragma message ("Using standard C++ atomics")
1633 #elif defined(__PYX_DEBUG_ATOMICS)
1634 #warning "Using standard C++ atomics"
1636#elif CYTHON_ATOMICS && (__GNUC__ >= 5 || (__GNUC__ == 4 &&\
1637 (__GNUC_MINOR__ > 1 ||\
1638 (__GNUC_MINOR__ == 1 && __GNUC_PATCHLEVEL__ >= 2))))
1639 #define __pyx_atomic_ptr_type void*
1640 #define __pyx_nonatomic_ptr_type void*
1641 #define __pyx_atomic_incr_relaxed(value) __sync_fetch_and_add(value, 1)
1642 #define __pyx_atomic_incr_acq_rel(value) __sync_fetch_and_add(value, 1)
1643 #define __pyx_atomic_decr_acq_rel(value) __sync_fetch_and_sub(value, 1)
1644 #define __pyx_atomic_sub(value, arg) __sync_fetch_and_sub(value, arg)
1645 static CYTHON_INLINE
int __pyx_atomic_int_cmp_exchange(__pyx_atomic_int_type* value, __pyx_nonatomic_int_type* expected, __pyx_nonatomic_int_type desired) {
1646 __pyx_nonatomic_int_type old = __sync_val_compare_and_swap(value, *expected, desired);
1647 int result = old == *expected;
1651 #define __pyx_atomic_load(value) __sync_fetch_and_add(value, 0)
1652 #define __pyx_atomic_store(value, new_value) __sync_lock_test_and_set(value, new_value)
1653 #define __pyx_atomic_pointer_load_relaxed(value) __sync_fetch_and_add(value, 0)
1654 #define __pyx_atomic_pointer_load_acquire(value) __sync_fetch_and_add(value, 0)
1655 #define __pyx_atomic_pointer_exchange(value, new_value) __sync_lock_test_and_set(value, (__pyx_atomic_ptr_type)new_value)
1656 static CYTHON_INLINE
int __pyx_atomic_pointer_cmp_exchange(__pyx_atomic_ptr_type* value, __pyx_nonatomic_ptr_type* expected, __pyx_nonatomic_ptr_type desired) {
1657 __pyx_nonatomic_ptr_type old = __sync_val_compare_and_swap(value, *expected, desired);
1658 int result = old == *expected;
1662 #ifdef __PYX_DEBUG_ATOMICS
1663 #warning "Using GNU atomics"
1665#elif CYTHON_ATOMICS && defined(_MSC_VER)
1667 #undef __pyx_atomic_int_type
1668 #define __pyx_atomic_int_type long
1669 #define __pyx_atomic_ptr_type void*
1670 #undef __pyx_nonatomic_int_type
1671 #define __pyx_nonatomic_int_type long
1672 #define __pyx_nonatomic_ptr_type void*
1673 #pragma intrinsic (_InterlockedExchangeAdd, _InterlockedExchange, _InterlockedCompareExchange, _InterlockedCompareExchangePointer, _InterlockedExchangePointer)
1674 #define __pyx_atomic_incr_relaxed(value) _InterlockedExchangeAdd(value, 1)
1675 #define __pyx_atomic_incr_acq_rel(value) _InterlockedExchangeAdd(value, 1)
1676 #define __pyx_atomic_decr_acq_rel(value) _InterlockedExchangeAdd(value, -1)
1677 #define __pyx_atomic_sub(value, arg) _InterlockedExchangeAdd(value, -arg)
1678 static CYTHON_INLINE
int __pyx_atomic_int_cmp_exchange(__pyx_atomic_int_type* value, __pyx_nonatomic_int_type* expected, __pyx_nonatomic_int_type desired) {
1679 __pyx_nonatomic_int_type old = _InterlockedCompareExchange(value, desired, *expected);
1680 int result = old == *expected;
1684 #define __pyx_atomic_load(value) _InterlockedExchangeAdd(value, 0)
1685 #define __pyx_atomic_store(value, new_value) _InterlockedExchange(value, new_value)
1686 #define __pyx_atomic_pointer_load_relaxed(value) *(void * volatile *)value
1687 #define __pyx_atomic_pointer_load_acquire(value) _InterlockedCompareExchangePointer(value, 0, 0)
1688 #define __pyx_atomic_pointer_exchange(value, new_value) _InterlockedExchangePointer(value, (__pyx_atomic_ptr_type)new_value)
1689 static CYTHON_INLINE
int __pyx_atomic_pointer_cmp_exchange(__pyx_atomic_ptr_type* value, __pyx_nonatomic_ptr_type* expected, __pyx_nonatomic_ptr_type desired) {
1690 __pyx_atomic_ptr_type old = _InterlockedCompareExchangePointer(value, desired, *expected);
1691 int result = old == *expected;
1695 #ifdef __PYX_DEBUG_ATOMICS
1696 #pragma message ("Using MSVC atomics")
1699 #undef CYTHON_ATOMICS
1700 #define CYTHON_ATOMICS 0
1701 #ifdef __PYX_DEBUG_ATOMICS
1702 #warning "Not using atomics"
1707#if !CYTHON_COMPILING_IN_CPYTHON_FREETHREADING
1708#define __Pyx_PyCriticalSection void*
1709#define __Pyx_PyCriticalSection2 void*
1710#define __Pyx_PyCriticalSection_End(cs)
1711#define __Pyx_PyCriticalSection2_End(cs)
1713#define __Pyx_PyCriticalSection PyCriticalSection
1714#define __Pyx_PyCriticalSection2 PyCriticalSection2
1715#define __Pyx_PyCriticalSection_End PyCriticalSection_End
1716#define __Pyx_PyCriticalSection2_End PyCriticalSection2_End
1720#if !CYTHON_COMPILING_IN_CPYTHON_FREETHREADING
1721#define __Pyx_PyCriticalSection_Begin(cs, arg) (void)(cs)
1722#define __Pyx_PyCriticalSection2_Begin(cs, arg1, arg2) (void)(cs)
1724#define __Pyx_PyCriticalSection_Begin PyCriticalSection_Begin
1725#define __Pyx_PyCriticalSection2_Begin PyCriticalSection2_Begin
1727#if PY_VERSION_HEX < 0x030d0000 || CYTHON_COMPILING_IN_LIMITED_API
1728#define __Pyx_BEGIN_CRITICAL_SECTION(o) {
1729#define __Pyx_END_CRITICAL_SECTION() }
1731#define __Pyx_BEGIN_CRITICAL_SECTION Py_BEGIN_CRITICAL_SECTION
1732#define __Pyx_END_CRITICAL_SECTION Py_END_CRITICAL_SECTION
1736#include <structmember.h>
1747typedef npy_int8 __pyx_t_5numpy_int8_t;
1756typedef npy_int16 __pyx_t_5numpy_int16_t;
1765typedef npy_int32 __pyx_t_5numpy_int32_t;
1774typedef npy_int64 __pyx_t_5numpy_int64_t;
1783typedef npy_uint8 __pyx_t_5numpy_uint8_t;
1792typedef npy_uint16 __pyx_t_5numpy_uint16_t;
1801typedef npy_uint32 __pyx_t_5numpy_uint32_t;
1810typedef npy_uint64 __pyx_t_5numpy_uint64_t;
1819typedef npy_float32 __pyx_t_5numpy_float32_t;
1828typedef npy_float64 __pyx_t_5numpy_float64_t;
1837typedef npy_longlong __pyx_t_5numpy_longlong_t;
1846typedef npy_ulonglong __pyx_t_5numpy_ulonglong_t;
1855typedef npy_intp __pyx_t_5numpy_intp_t;
1864typedef npy_uintp __pyx_t_5numpy_uintp_t;
1873typedef npy_double __pyx_t_5numpy_float_t;
1882typedef npy_double __pyx_t_5numpy_double_t;
1891typedef npy_longdouble __pyx_t_5numpy_longdouble_t;
1894#if CYTHON_CCOMPLEX && (1) && (!0 || __cplusplus)
1896 typedef ::std::complex< float > __pyx_t_float_complex;
1898 typedef float _Complex __pyx_t_float_complex;
1901 typedef struct {
float real, imag; } __pyx_t_float_complex;
1903static CYTHON_INLINE __pyx_t_float_complex __pyx_t_float_complex_from_parts(
float,
float);
1906#if CYTHON_CCOMPLEX && (1) && (!0 || __cplusplus)
1908 typedef ::std::complex< double > __pyx_t_double_complex;
1910 typedef double _Complex __pyx_t_double_complex;
1913 typedef struct {
double real, imag; } __pyx_t_double_complex;
1915static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(
double,
double);
1918#if CYTHON_CCOMPLEX && (1) && (!0 || __cplusplus)
1920 typedef ::std::complex< long double > __pyx_t_long_double_complex;
1922 typedef long double _Complex __pyx_t_long_double_complex;
1925 typedef struct {
long double real, imag; } __pyx_t_long_double_complex;
1927static CYTHON_INLINE __pyx_t_long_double_complex __pyx_t_long_double_complex_from_parts(
long double,
long double);
1936#ifndef CYTHON_REFNANNY
1937 #define CYTHON_REFNANNY 0
1941 void (*INCREF)(
void*, PyObject*, Py_ssize_t);
1942 void (*DECREF)(
void*, PyObject*, Py_ssize_t);
1943 void (*GOTREF)(
void*, PyObject*, Py_ssize_t);
1944 void (*GIVEREF)(
void*, PyObject*, Py_ssize_t);
1945 void* (*SetupContext)(
const char*, Py_ssize_t,
const char*);
1946 void (*FinishContext)(
void**);
1947 } __Pyx_RefNannyAPIStruct;
1948 static __Pyx_RefNannyAPIStruct *__Pyx_RefNanny = NULL;
1949 static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(
const char *modname);
1950 #define __Pyx_RefNannyDeclarations void *__pyx_refnanny = NULL;
1951 #define __Pyx_RefNannySetupContext(name, acquire_gil)\
1953 PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();\
1954 __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), (__LINE__), (__FILE__));\
1955 PyGILState_Release(__pyx_gilstate_save);\
1957 __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), (__LINE__), (__FILE__));\
1959 #define __Pyx_RefNannyFinishContextNogil() {\
1960 PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();\
1961 __Pyx_RefNannyFinishContext();\
1962 PyGILState_Release(__pyx_gilstate_save);\
1964 #define __Pyx_RefNannyFinishContextNogil() {\
1965 PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();\
1966 __Pyx_RefNannyFinishContext();\
1967 PyGILState_Release(__pyx_gilstate_save);\
1969 #define __Pyx_RefNannyFinishContext()\
1970 __Pyx_RefNanny->FinishContext(&__pyx_refnanny)
1971 #define __Pyx_INCREF(r) __Pyx_RefNanny->INCREF(__pyx_refnanny, (PyObject *)(r), (__LINE__))
1972 #define __Pyx_DECREF(r) __Pyx_RefNanny->DECREF(__pyx_refnanny, (PyObject *)(r), (__LINE__))
1973 #define __Pyx_GOTREF(r) __Pyx_RefNanny->GOTREF(__pyx_refnanny, (PyObject *)(r), (__LINE__))
1974 #define __Pyx_GIVEREF(r) __Pyx_RefNanny->GIVEREF(__pyx_refnanny, (PyObject *)(r), (__LINE__))
1975 #define __Pyx_XINCREF(r) do { if((r) == NULL); else {__Pyx_INCREF(r); }} while(0)
1976 #define __Pyx_XDECREF(r) do { if((r) == NULL); else {__Pyx_DECREF(r); }} while(0)
1977 #define __Pyx_XGOTREF(r) do { if((r) == NULL); else {__Pyx_GOTREF(r); }} while(0)
1978 #define __Pyx_XGIVEREF(r) do { if((r) == NULL); else {__Pyx_GIVEREF(r);}} while(0)
1980 #define __Pyx_RefNannyDeclarations
1981 #define __Pyx_RefNannySetupContext(name, acquire_gil)
1982 #define __Pyx_RefNannyFinishContextNogil()
1983 #define __Pyx_RefNannyFinishContext()
1984 #define __Pyx_INCREF(r) Py_INCREF(r)
1985 #define __Pyx_DECREF(r) Py_DECREF(r)
1986 #define __Pyx_GOTREF(r)
1987 #define __Pyx_GIVEREF(r)
1988 #define __Pyx_XINCREF(r) Py_XINCREF(r)
1989 #define __Pyx_XDECREF(r) Py_XDECREF(r)
1990 #define __Pyx_XGOTREF(r)
1991 #define __Pyx_XGIVEREF(r)
1993#define __Pyx_Py_XDECREF_SET(r, v) do {\
1994 PyObject *tmp = (PyObject *) r;\
1995 r = v; Py_XDECREF(tmp);\
1997#define __Pyx_XDECREF_SET(r, v) do {\
1998 PyObject *tmp = (PyObject *) r;\
1999 r = v; __Pyx_XDECREF(tmp);\
2001#define __Pyx_DECREF_SET(r, v) do {\
2002 PyObject *tmp = (PyObject *) r;\
2003 r = v; __Pyx_DECREF(tmp);\
2005#define __Pyx_CLEAR(r) do { PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);} while(0)
2006#define __Pyx_XCLEAR(r) do { if((r) != NULL) {PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);}} while(0)
2009#if CYTHON_USE_EXC_INFO_STACK && CYTHON_FAST_THREAD_STATE
2010static _PyErr_StackItem * __Pyx_PyErr_GetTopmostException(PyThreadState *tstate);
2014#if CYTHON_FAST_THREAD_STATE
2015#define __Pyx_PyThreadState_declare PyThreadState *__pyx_tstate;
2016#define __Pyx_PyThreadState_assign __pyx_tstate = __Pyx_PyThreadState_Current;
2017#if PY_VERSION_HEX >= 0x030C00A6
2018#define __Pyx_PyErr_Occurred() (__pyx_tstate->current_exception != NULL)
2019#define __Pyx_PyErr_CurrentExceptionType() (__pyx_tstate->current_exception ? (PyObject*) Py_TYPE(__pyx_tstate->current_exception) : (PyObject*) NULL)
2021#define __Pyx_PyErr_Occurred() (__pyx_tstate->curexc_type != NULL)
2022#define __Pyx_PyErr_CurrentExceptionType() (__pyx_tstate->curexc_type)
2025#define __Pyx_PyThreadState_declare
2026#define __Pyx_PyThreadState_assign
2027#define __Pyx_PyErr_Occurred() (PyErr_Occurred() != NULL)
2028#define __Pyx_PyErr_CurrentExceptionType() PyErr_Occurred()
2032#if CYTHON_FAST_THREAD_STATE
2033#define __Pyx_ExceptionSave(type, value, tb) __Pyx__ExceptionSave(__pyx_tstate, type, value, tb)
2034static CYTHON_INLINE
void __Pyx__ExceptionSave(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb);
2035#define __Pyx_ExceptionReset(type, value, tb) __Pyx__ExceptionReset(__pyx_tstate, type, value, tb)
2036static CYTHON_INLINE
void __Pyx__ExceptionReset(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb);
2038#define __Pyx_ExceptionSave(type, value, tb) PyErr_GetExcInfo(type, value, tb)
2039#define __Pyx_ExceptionReset(type, value, tb) PyErr_SetExcInfo(type, value, tb)
2043#if CYTHON_COMPILING_IN_CPYTHON
2044#define __Pyx_TypeCheck(obj, type) __Pyx_IsSubtype(Py_TYPE(obj), (PyTypeObject *)type)
2045#define __Pyx_TypeCheck2(obj, type1, type2) __Pyx_IsAnySubtype2(Py_TYPE(obj), (PyTypeObject *)type1, (PyTypeObject *)type2)
2046static CYTHON_INLINE
int __Pyx_IsSubtype(PyTypeObject *a, PyTypeObject *b);
2047static CYTHON_INLINE
int __Pyx_IsAnySubtype2(PyTypeObject *cls, PyTypeObject *a, PyTypeObject *b);
2048#define __Pyx_PyAnySet_Check(obj) __Pyx_TypeCheck2(obj, &PySet_Type, &PyFrozenSet_Type)
2050#define __Pyx_TypeCheck(obj, type) PyObject_TypeCheck(obj, (PyTypeObject *)type)
2051#define __Pyx_TypeCheck2(obj, type1, type2) (PyObject_TypeCheck(obj, (PyTypeObject *)type1) || PyObject_TypeCheck(obj, (PyTypeObject *)type2))
2052#define __Pyx_PyAnySet_Check(obj) PyAnySet_Check(obj)
2056#define __Pyx_PyExc_Exception_Check(obj) __Pyx_TypeCheck(obj, PyExc_Exception)
2059#if CYTHON_FAST_THREAD_STATE
2060#define __Pyx_PyErr_Clear() __Pyx_ErrRestore(NULL, NULL, NULL)
2061#define __Pyx_ErrRestoreWithState(type, value, tb) __Pyx_ErrRestoreInState(PyThreadState_GET(), type, value, tb)
2062#define __Pyx_ErrFetchWithState(type, value, tb) __Pyx_ErrFetchInState(PyThreadState_GET(), type, value, tb)
2063#define __Pyx_ErrRestore(type, value, tb) __Pyx_ErrRestoreInState(__pyx_tstate, type, value, tb)
2064#define __Pyx_ErrFetch(type, value, tb) __Pyx_ErrFetchInState(__pyx_tstate, type, value, tb)
2065static CYTHON_INLINE
void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb);
2066static CYTHON_INLINE
void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb);
2067#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030C00A6
2068#define __Pyx_PyErr_SetNone(exc) (Py_INCREF(exc), __Pyx_ErrRestore((exc), NULL, NULL))
2070#define __Pyx_PyErr_SetNone(exc) PyErr_SetNone(exc)
2073#define __Pyx_PyErr_Clear() PyErr_Clear()
2074#define __Pyx_PyErr_SetNone(exc) PyErr_SetNone(exc)
2075#define __Pyx_ErrRestoreWithState(type, value, tb) PyErr_Restore(type, value, tb)
2076#define __Pyx_ErrFetchWithState(type, value, tb) PyErr_Fetch(type, value, tb)
2077#define __Pyx_ErrRestoreInState(tstate, type, value, tb) PyErr_Restore(type, value, tb)
2078#define __Pyx_ErrFetchInState(tstate, type, value, tb) PyErr_Fetch(type, value, tb)
2079#define __Pyx_ErrRestore(type, value, tb) PyErr_Restore(type, value, tb)
2080#define __Pyx_ErrFetch(type, value, tb) PyErr_Fetch(type, value, tb)
2084#if CYTHON_COMPILING_IN_CPYTHON
2085static CYTHON_INLINE
int __Pyx_PyErr_GivenExceptionMatches(PyObject *err, PyObject *type);
2086static CYTHON_INLINE
int __Pyx_PyErr_GivenExceptionMatches2(PyObject *err, PyObject *type1, PyObject *type2);
2088#define __Pyx_PyErr_GivenExceptionMatches(err, type) PyErr_GivenExceptionMatches(err, type)
2089static CYTHON_INLINE
int __Pyx_PyErr_GivenExceptionMatches2(PyObject *err, PyObject *type1, PyObject *type2) {
2090 return PyErr_GivenExceptionMatches(err, type1) || PyErr_GivenExceptionMatches(err, type2);
2093#define __Pyx_PyErr_ExceptionMatches2(err1, err2) __Pyx_PyErr_GivenExceptionMatches2(__Pyx_PyErr_CurrentExceptionType(), err1, err2)
2096#if CYTHON_FAST_THREAD_STATE
2097#define __Pyx_PyErr_ExceptionMatches(err) __Pyx_PyErr_ExceptionMatchesInState(__pyx_tstate, err)
2098static CYTHON_INLINE
int __Pyx_PyErr_ExceptionMatchesInState(PyThreadState* tstate, PyObject* err);
2100#define __Pyx_PyErr_ExceptionMatches(err) PyErr_ExceptionMatches(err)
2104#if CYTHON_FAST_THREAD_STATE
2105#define __Pyx_GetException(type, value, tb) __Pyx__GetException(__pyx_tstate, type, value, tb)
2106static int __Pyx__GetException(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb);
2108static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb);
2112#define __Pyx_PyExc_ImportError_Check(obj) __Pyx_TypeCheck(obj, PyExc_ImportError)
2115#if CYTHON_COMPILING_IN_CPYTHON
2116static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw);
2118#define __Pyx_PyObject_Call(func, arg, kw) PyObject_Call(func, arg, kw)
2122#if CYTHON_COMPILING_IN_CPYTHON
2123static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg);
2127#define __Pyx_PyObject_FastCall(func, args, nargs) __Pyx_PyObject_FastCallDict(func, args, (size_t)(nargs), NULL)
2128static CYTHON_INLINE PyObject* __Pyx_PyObject_FastCallDict(PyObject *func, PyObject *
const*args,
size_t nargsf, PyObject *kwargs);
2131static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause);
2134#if CYTHON_COMPILING_IN_CPYTHON
2135static CYTHON_INLINE
void __Pyx_copy_object_array(PyObject *
const *CYTHON_RESTRICT src, PyObject** CYTHON_RESTRICT dest, Py_ssize_t length);
2139#if PY_VERSION_HEX >= 0x030F0000 && !CYTHON_COMPILING_IN_LIMITED_API
2140#define __Pyx_PyTuple_FromArray(src, n) PyTuple_FromArray(src, ((n)<0) ? 0 : (n))
2142CYTHON_UNUSED
static PyObject *
2143__Pyx_PyTuple_FromArray(PyObject *
const *src, Py_ssize_t
n);
2153static CYTHON_INLINE
int __Pyx_PyObject_CompareBoolEq_str_str(PyObject *op1, PyObject *op2,
int pyop);
2156#define __Pyx_PyUnicode_Equals(s1, s2) __Pyx_PyObject_CompareBoolEq_str_str(s1, s2, Py_EQ)
2159#if CYTHON_AVOID_BORROWED_REFS
2160 #define __Pyx_ArgRef_VARARGS(args, i) __Pyx_PySequence_ITEM(args, i)
2161#elif CYTHON_ASSUME_SAFE_MACROS
2162 #define __Pyx_ArgRef_VARARGS(args, i) __Pyx_NewRef(__Pyx_PyTuple_GET_ITEM(args, i))
2164 #define __Pyx_ArgRef_VARARGS(args, i) __Pyx_XNewRef(PyTuple_GetItem(args, i))
2166#define __Pyx_NumKwargs_VARARGS(kwds) PyDict_Size(kwds)
2167#define __Pyx_KwValues_VARARGS(args, nargs) NULL
2168#define __Pyx_GetKwValue_VARARGS(kw, kwvalues, s) __Pyx_PyDict_GetItemStrWithError(kw, s)
2169#define __Pyx_KwargsAsDict_VARARGS(kw, kwvalues) PyDict_Copy(kw)
2170#if CYTHON_VECTORCALL
2171 #define __Pyx_ArgRef_FASTCALL(args, i) __Pyx_NewRef(args[i])
2172 #define __Pyx_NumKwargs_FASTCALL(kwds) __Pyx_PyTuple_GET_SIZE(kwds)
2173 #define __Pyx_KwValues_FASTCALL(args, nargs) ((args) + (nargs))
2174 static CYTHON_INLINE PyObject * __Pyx_GetKwValue_FASTCALL(PyObject *kwnames, PyObject *
const *kwvalues, PyObject *
s);
2175 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030d0000 || CYTHON_COMPILING_IN_LIMITED_API || CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_GRAAL
2176 CYTHON_UNUSED
static PyObject *__Pyx_KwargsAsDict_FASTCALL(PyObject *kwnames, PyObject *
const *kwvalues);
2178 #define __Pyx_KwargsAsDict_FASTCALL(kw, kwvalues) _PyStack_AsDict(kwvalues, kw)
2181 #define __Pyx_ArgRef_FASTCALL __Pyx_ArgRef_VARARGS
2182 #define __Pyx_NumKwargs_FASTCALL __Pyx_NumKwargs_VARARGS
2183 #define __Pyx_KwValues_FASTCALL __Pyx_KwValues_VARARGS
2184 #define __Pyx_GetKwValue_FASTCALL __Pyx_GetKwValue_VARARGS
2185 #define __Pyx_KwargsAsDict_FASTCALL __Pyx_KwargsAsDict_VARARGS
2187#if CYTHON_VECTORCALL_TPNEW
2188 #if !CYTHON_VECTORCALL
2189 #error Enabling CYTHON_VECTORCALL_TPNEW without CYTHON_VECTORCALL is not supported
2191 #define __Pyx_ArgRef_FASTCALL_TPNEW __Pyx_ArgRef_FASTCALL
2192 #define __Pyx_NumKwargs_FASTCALL_TPNEW __Pyx_NumKwargs_FASTCALL
2193 #define __Pyx_KwValues_FASTCALL_TPNEW __Pyx_KwValues_FASTCALL
2194 #define __Pyx_GetKwValue_FASTCALL_TPNEW __Pyx_GetKwValue_FASTCALL
2195 #define __Pyx_KwargsAsDict_FASTCALL_TPNEW __Pyx_KwargsAsDict_FASTCALL
2197 #define __Pyx_ArgRef_FASTCALL_TPNEW __Pyx_ArgRef_VARARGS
2198 #define __Pyx_NumKwargs_FASTCALL_TPNEW __Pyx_NumKwargs_VARARGS
2199 #define __Pyx_KwValues_FASTCALL_TPNEW __Pyx_KwValues_VARARGS
2200 #define __Pyx_GetKwValue_FASTCALL_TPNEW __Pyx_GetKwValue_VARARGS
2201 #define __Pyx_KwargsAsDict_FASTCALL_TPNEW __Pyx_KwargsAsDict_VARARGS
2203#define __Pyx_ArgsSlice_VARARGS(args, start, stop) PyTuple_GetSlice(args, start, stop)
2204#if CYTHON_VECTORCALL
2205#define __Pyx_ArgsSlice_FASTCALL(args, start, stop) __Pyx_PyTuple_FromArray(args + start, stop - start)
2207#define __Pyx_ArgsSlice_FASTCALL __Pyx_ArgsSlice_VARARGS
2211#define __Pyx_PyDict_items_TypePtr (&PyDictKeys_Type)
2212#define __Pyx_PyDict_items_Check(obj) PyObject_TypeCheck((obj), __Pyx_PyDictItems_TypePtr)
2213#define __Pyx_PyDict_items_CheckExact(obj) Py_IS_TYPE((obj), __Pyx_PyDictItems_TypePtr)
2214static CYTHON_INLINE PyObject* __Pyx_PyDict_Items(PyObject* d);
2217#define __Pyx_CallCFunction(cfunc, self, args)\
2218 ((PyCFunction)(void(*)(void))(cfunc)->func)(self, args)
2219#define __Pyx_CallCFunctionWithKeywords(cfunc, self, args, kwargs)\
2220 ((PyCFunctionWithKeywords)(void(*)(void))(cfunc)->func)(self, args, kwargs)
2221#define __Pyx_CallCFunctionFast(cfunc, self, args, nargs)\
2222 ((__Pyx_PyCFunctionFast)(void(*)(void))(PyCFunction)(cfunc)->func)(self, args, nargs)
2223#define __Pyx_CallCFunctionFastWithKeywords(cfunc, self, args, nargs, kwnames)\
2224 ((__Pyx_PyCFunctionFastWithKeywords)(void(*)(void))(PyCFunction)(cfunc)->func)(self, args, nargs, kwnames)
2227static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg);
2232 PyObject **method_name;
2236#if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING && CYTHON_ATOMICS
2237 __pyx_atomic_int_type initialized;
2239} __Pyx_CachedCFunction;
2242static CYTHON_INLINE
int __Pyx_IgnoreGivenException(PyObject *given_exception, PyObject *ignorable_exception);
2243#define __Pyx_IgnoreException(ignorable_exception) __Pyx_IgnoreGivenException(NULL, ignorable_exception)
2246#if CYTHON_USE_TYPE_SLOTS
2247static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name);
2249#define __Pyx_PyObject_GetAttrStr(o,n) PyObject_GetAttr(o,n)
2253static int __Pyx_TryUnpackUnboundCMethod(__Pyx_CachedCFunction* target);
2256#if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING
2257static CYTHON_INLINE
int __Pyx_CachedCFunction_GetAndSetInitializing(__Pyx_CachedCFunction *cfunc) {
2261 __pyx_nonatomic_int_type expected = 0;
2262 if (__pyx_atomic_int_cmp_exchange(&cfunc->initialized, &expected, 1)) {
2268static CYTHON_INLINE
void __Pyx_CachedCFunction_SetFinishedInitializing(__Pyx_CachedCFunction *cfunc) {
2270 __pyx_atomic_store(&cfunc->initialized, 2);
2274#define __Pyx_CachedCFunction_GetAndSetInitializing(cfunc) 2
2275#define __Pyx_CachedCFunction_SetFinishedInitializing(cfunc)
2280static PyObject* __Pyx__CallUnboundCMethod0(__Pyx_CachedCFunction* cfunc, PyObject* self);
2281#if CYTHON_COMPILING_IN_CPYTHON
2282static CYTHON_INLINE PyObject* __Pyx_CallUnboundCMethod0(__Pyx_CachedCFunction* cfunc, PyObject* self);
2284#define __Pyx_CallUnboundCMethod0(cfunc, self) __Pyx__CallUnboundCMethod0(cfunc, self)
2288#define __Pyx_PyDict_values_TypePtr (&PyDictKeys_Type)
2289#define __Pyx_PyDict_values_Check(obj) PyObject_TypeCheck((obj), __Pyx_PyDictValues_TypePtr)
2290#define __Pyx_PyDict_values_CheckExact(obj) Py_IS_TYPE((obj), __Pyx_PyDictValues_TypePtr)
2291static CYTHON_INLINE PyObject* __Pyx_PyDict_Values(PyObject* d);
2294#if CYTHON_AVOID_BORROWED_REFS
2295static int __Pyx_PyDict_NextRef(PyObject *p, PyObject **ppos, PyObject **pkey, PyObject **pvalue);
2298static int __Pyx_PyDict_NextRef(PyObject *p, Py_ssize_t *ppos, PyObject **pkey, PyObject **pvalue);
2302static void __Pyx_RaiseDoubleKeywordsError(
const char* func_name, PyObject* kw_name);
2305static int __Pyx_ParseKeywordsTuple(
2307 PyObject *
const *kwvalues,
2308 PyObject **
const argnames[],
2311 Py_ssize_t num_pos_args,
2312 Py_ssize_t num_kwargs,
2313 const char* function_name,
2314 int ignore_unknown_kwargs
2316static int __Pyx_ParseKeywordDictToDict(
2318 PyObject **
const argnames[],
2321 Py_ssize_t num_pos_args,
2322 const char* function_name
2324static int __Pyx_ParseKeywordDict(
2326 PyObject **
const argnames[],
2328 Py_ssize_t num_pos_args,
2329 Py_ssize_t num_kwargs,
2330 const char* function_name,
2331 int ignore_unknown_kwargs
2336static PyObject* __Pyx__CallUnboundCMethod2(__Pyx_CachedCFunction* cfunc, PyObject* self, PyObject* arg1, PyObject* arg2);
2337#if CYTHON_COMPILING_IN_CPYTHON
2338static CYTHON_INLINE PyObject *__Pyx_CallUnboundCMethod2(__Pyx_CachedCFunction *cfunc, PyObject *self, PyObject *arg1, PyObject *arg2);
2340#define __Pyx_CallUnboundCMethod2(cfunc, self, arg1, arg2) __Pyx__CallUnboundCMethod2(cfunc, self, arg1, arg2)
2344static CYTHON_INLINE
int __Pyx_ParseKeywords(
2345 PyObject *kwds, PyObject *
const *kwvalues, PyObject **
const argnames[],
2346 PyObject *kwds2, PyObject *values[],
2347 Py_ssize_t num_pos_args, Py_ssize_t num_kwargs,
2348 const char* function_name,
2349 int ignore_unknown_kwargs
2353static void __Pyx_RaiseArgtupleInvalid(
const char* func_name,
int exact,
2354 Py_ssize_t num_min, Py_ssize_t num_max, Py_ssize_t num_found);
2357static void __Pyx_ArgTypeError(PyObject *obj, PyTypeObject *type,
const char *name,
int exact);
2360static CYTHON_INLINE
int __Pyx_ArgTypeTest(PyObject *obj, PyTypeObject *type,
int none_allowed,
const char *name,
int exact);
2363#ifndef __PYX_HAVE_RT_ImportType_proto_3_3_0
2364#define __PYX_HAVE_RT_ImportType_proto_3_3_0
2365#if defined (__STDC_VERSION__) && __STDC_VERSION__ >= 201112L
2366#include <stdalign.h>
2368#if (defined (__STDC_VERSION__) && __STDC_VERSION__ >= 201112L) || __cplusplus >= 201103L
2369#define __PYX_GET_STRUCT_ALIGNMENT_3_3_0(s) alignof(s)
2371#define __PYX_GET_STRUCT_ALIGNMENT_3_3_0(s) sizeof(void*)
2373enum __Pyx_ImportType_CheckSize_3_3_0 {
2374 __Pyx_ImportType_CheckSize_Error_3_3_0 = 0,
2375 __Pyx_ImportType_CheckSize_Warn_3_3_0 = 1,
2376 __Pyx_ImportType_CheckSize_Ignore_3_3_0 = 2
2378static 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);
2382static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStrNoError(PyObject* obj, PyObject* attr_name);
2385#if __PYX_LIMITED_VERSION_HEX >= 0x030d0000
2386#define __Pyx_HasAttr(o, n) PyObject_HasAttrWithError(o, n)
2388static CYTHON_INLINE
int __Pyx_HasAttr(PyObject *, PyObject *);
2392CYTHON_UNUSED
static PyObject *
2393__Pyx_PyList_FromArray(PyObject *
const *src, Py_ssize_t
n);
2399static PyObject *__Pyx__Import(PyObject *name, PyObject *
const *imported_names, Py_ssize_t len_imported_names, PyObject *qualname, PyObject *moddict,
int level);
2402static CYTHON_INLINE PyObject *__Pyx_Import(PyObject *name, PyObject *
const *imported_names, Py_ssize_t len_imported_names, PyObject *qualname,
int level);
2405static CYTHON_INLINE PyObject *__Pyx_PyDict_SetDefault(PyObject *d, PyObject *key, PyObject *default_value);
2408#if ((CYTHON_COMPILING_IN_CPYTHON_FREETHREADING && PY_VERSION_HEX < 0x030F00a3) ||\
2409 __PYX_LIMITED_VERSION_HEX < 0x030d0000)
2410 static PyObject *__Pyx_PyImport_AddModuleRef(
const char *name);
2412 #define __Pyx_PyImport_AddModuleRef(name) PyImport_AddModuleRef(name)
2416static PyObject *__Pyx_FetchSharedCythonABIModule(
void);
2419static int __Pyx_VerifyCachedType(PyObject *cached_type,
2421 Py_ssize_t expected_basicsize);
2424static PyTypeObject* __Pyx_FetchCommonTypeFromSpec(PyTypeObject *metaclass, PyObject *module, PyType_Spec *spec, PyObject *bases);
2427static int __pyx_CommonTypesMetaclass_init(PyObject *module);
2428#define __Pyx_CommonTypesMetaclass_USED
2431#define __Pyx_CyFunction_USED
2432#if CYTHON_OPAQUE_SHARED_TYPES
2433#define __Pyx_as_CyFunctionObject(o) ((__pyx_CyFunctionObject *)PyObject_GetTypeData((o), __pyx_mstate_global->__pyx_CyFunctionType))
2435#define __Pyx_as_CyFunctionObject(o) ((__pyx_CyFunctionObject *)o)
2437#define __Pyx_CYFUNCTION_STATICMETHOD 0x01
2438#define __Pyx_CYFUNCTION_CLASSMETHOD 0x02
2439#define __Pyx_CYFUNCTION_CCLASS 0x04
2440#define __Pyx_CYFUNCTION_COROUTINE 0x08
2441#define __Pyx_CyFunction_GetClosure(f)\
2442 ((__Pyx_as_CyFunctionObject(f))->func_closure)
2443#if CYTHON_COMPILING_IN_LIMITED_API
2444 #define __Pyx__CyFunction_GetClassObj(f)\
2445 ((f)->func_classobj)
2447 #define __Pyx__CyFunction_GetClassObj(f)\
2448 ((PyObject*) ((PyCMethodObject *) (f))->mm_class)
2450#define __Pyx_CyFunction_GetClassObj(f)\
2451 __Pyx__CyFunction_GetClassObj(__Pyx_as_CyFunctionObject(f))
2452#define __Pyx_CyFunction_SetClassObj(f, classobj)\
2453 __Pyx__CyFunction_SetClassObj(__Pyx_as_CyFunctionObject(f), (classobj))
2454#define __Pyx_CyFunction_Defaults(type, f)\
2455 ((type *)((__Pyx_as_CyFunctionObject(f))->defaults))
2456#define __Pyx_CyFunction_SetDefaultsGetter(f, g)\
2457 (__Pyx_as_CyFunctionObject(f))->defaults_getter = (g)
2459#if CYTHON_COMPILING_IN_LIMITED_API
2460#if !CYTHON_OPAQUE_OBJECTS
2463 PyMethodDef *func_methoddef;
2464 PyObject *func_module;
2466 PyCMethodObject func;
2468#if (CYTHON_COMPILING_IN_LIMITED_API || CYTHON_COMPILING_IN_PYPY) && CYTHON_VECTORCALL
2469 __pyx_vectorcallfunc func_vectorcall;
2471#if CYTHON_COMPILING_IN_LIMITED_API
2472 PyObject *func_weakreflist;
2474#if PY_VERSION_HEX < 0x030C0000 || CYTHON_COMPILING_IN_LIMITED_API
2475 PyObject *func_dict;
2477 PyObject *func_name;
2478 PyObject *func_qualname;
2480 PyObject *func_globals;
2481 PyObject *func_code;
2482 PyObject *func_closure;
2483#if CYTHON_COMPILING_IN_LIMITED_API
2484 PyObject *func_classobj;
2488 PyObject *defaults_tuple;
2489 PyObject *defaults_kwdict;
2490 PyObject *(*defaults_getter)(PyObject *);
2491 PyObject *func_annotations;
2492#if __PYX_LIMITED_VERSION_HEX < 0x030B0000
2493 PyObject *func_is_coroutine;
2495} __pyx_CyFunctionObject;
2496#undef __Pyx_CyOrPyCFunction_Check
2497#define __Pyx_CyFunction_Check(obj) __Pyx_TypeCheck(obj, __pyx_mstate_global->__pyx_CyFunctionType)
2498#define __Pyx_CyOrPyCFunction_Check(obj) __Pyx_TypeCheck2(obj, __pyx_mstate_global->__pyx_CyFunctionType, &PyCFunction_Type)
2499#define __Pyx_CyFunction_CheckExact(obj) Py_IS_TYPE(obj, __pyx_mstate_global->__pyx_CyFunctionType)
2500static CYTHON_INLINE
int __Pyx__IsSameCyOrCFunction(PyObject *func,
void (*cfunc)(
void));
2501#undef __Pyx_IsSameCFunction
2502#define __Pyx_IsSameCFunction(func, cfunc) __Pyx__IsSameCyOrCFunction(func, cfunc)
2503static CYTHON_INLINE
void __Pyx__CyFunction_SetClassObj(__pyx_CyFunctionObject*
f, PyObject* classobj);
2504static CYTHON_INLINE PyObject *__Pyx_CyFunction_InitDefaults(PyObject *func,
2505 PyTypeObject *defaults_type);
2506static CYTHON_INLINE
void __Pyx_CyFunction_SetDefaultsTuple(PyObject *m,
2508static CYTHON_INLINE
void __Pyx_CyFunction_SetDefaultsKwDict(PyObject *m,
2510static CYTHON_INLINE
void __Pyx_CyFunction_SetAnnotationsDict(PyObject *m,
2512static int __pyx_CyFunction_init(PyObject *module);
2513#if CYTHON_VECTORCALL
2514#if CYTHON_COMPILING_IN_LIMITED_API || CYTHON_COMPILING_IN_PYPY
2515#define __Pyx_CyFunction_func_vectorcall(f) ((f)->func_vectorcall)
2517#define __Pyx_CyFunction_func_vectorcall(f) (((PyCFunctionObject*)f)->vectorcall)
2522#if !CYTHON_USE_TYPE_SPECS
2523#define __Pyx_call_type_traverse(o, always_call, visit, arg) 0
2525static int __Pyx_call_type_traverse(PyObject *o,
int always_call, visitproc visit,
void *arg);
2529static PyObject *__Pyx_PyMethod_New(PyObject *func, PyObject *self, PyObject *typ);
2532#if CYTHON_VECTORCALL
2533static CYTHON_INLINE PyObject *__Pyx_PyVectorcall_FastCallDict(PyObject *func, __pyx_vectorcallfunc vc, PyObject *
const *args,
size_t nargs, PyObject *kw);
2537static PyObject *__Pyx_CyFunction_Init(PyObject *op_in, PyMethodDef *ml,
2538 int flags, PyObject* qualname,
2540 PyObject *module, PyObject *globals,
2542#if CYTHON_VECTORCALL
2543static PyObject * __Pyx_CyFunction_Vectorcall_NOARGS(PyObject *func, PyObject *
const *args,
size_t nargsf, PyObject *kwnames);
2544static PyObject * __Pyx_CyFunction_Vectorcall_O(PyObject *func, PyObject *
const *args,
size_t nargsf, PyObject *kwnames);
2545static PyObject * __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS(PyObject *func, PyObject *
const *args,
size_t nargsf, PyObject *kwnames);
2546static PyObject * __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS_METHOD(PyObject *func, PyObject *
const *args,
size_t nargsf, PyObject *kwnames);
2550static PyObject *__Pyx_CyFunction_New(PyMethodDef *ml,
2551 int flags, PyObject* qualname,
2553 PyObject *module, PyObject *globals,
2555static PyTypeObject *__Pyx_Get_CyFunction_Type(
void);
2558#if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_TYPE_SLOTS
2559#define __PYX_DICT_VERSION_INIT ((PY_UINT64_T) -1)
2560#define __PYX_GET_DICT_VERSION(dict) (((PyDictObject*)(dict))->ma_version_tag)
2561#define __PYX_UPDATE_DICT_CACHE(dict, value, cache_var, version_var)\
2562 (version_var) = __PYX_GET_DICT_VERSION(dict);\
2563 (cache_var) = (value);
2564#define __PYX_PY_DICT_LOOKUP_IF_MODIFIED(VAR, DICT, LOOKUP) {\
2565 static PY_UINT64_T __pyx_dict_version = 0;\
2566 static PyObject *__pyx_dict_cached_value = NULL;\
2567 if (likely(__PYX_GET_DICT_VERSION(DICT) == __pyx_dict_version)) {\
2568 (VAR) = __Pyx_XNewRef(__pyx_dict_cached_value);\
2570 (VAR) = __pyx_dict_cached_value = (LOOKUP);\
2571 __pyx_dict_version = __PYX_GET_DICT_VERSION(DICT);\
2574static CYTHON_INLINE PY_UINT64_T __Pyx_get_tp_dict_version(PyObject *obj);
2575static CYTHON_INLINE PY_UINT64_T __Pyx_get_object_dict_version(PyObject *obj);
2576static CYTHON_INLINE
int __Pyx_object_dict_version_matches(PyObject* obj, PY_UINT64_T tp_dict_version, PY_UINT64_T obj_dict_version);
2578#define __PYX_GET_DICT_VERSION(dict) (0)
2579#define __PYX_UPDATE_DICT_CACHE(dict, value, cache_var, version_var)
2580#define __PYX_PY_DICT_LOOKUP_IF_MODIFIED(VAR, DICT, LOOKUP) (VAR) = (LOOKUP);
2584#if CYTHON_CLINE_IN_TRACEBACK && CYTHON_CLINE_IN_TRACEBACK_RUNTIME
2585static int __Pyx_CLineForTraceback(PyThreadState *tstate,
int c_line);
2587#define __Pyx_CLineForTraceback(tstate, c_line) (((CYTHON_CLINE_IN_TRACEBACK)) ? c_line : 0)
2591#if CYTHON_COMPILING_IN_LIMITED_API
2592typedef PyObject __Pyx_CachedCodeObjectType;
2594typedef PyCodeObject __Pyx_CachedCodeObjectType;
2597 __Pyx_CachedCodeObjectType* code_object;
2599} __Pyx_CodeObjectCacheEntry;
2600struct __Pyx_CodeObjectCache {
2603 __Pyx_CodeObjectCacheEntry* entries;
2604 #if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING
2605 __pyx_atomic_int_type accessor_count;
2608static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries,
int count,
int code_line);
2609static __Pyx_CachedCodeObjectType *__pyx_find_code_object(
int code_line);
2610static void __pyx_insert_code_object(
int code_line, __Pyx_CachedCodeObjectType* code_object);
2613static void __Pyx_AddTraceback(
const char *funcname,
int c_line,
2614 int py_line,
const char *filename);
2617#if !defined(__INTEL_COMPILER) && defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 6))
2618#define __Pyx_HAS_GCC_DIAGNOSTIC
2624 #define __Pyx_CREAL(z) ((z).real())
2625 #define __Pyx_CIMAG(z) ((z).imag())
2627 #define __Pyx_CREAL(z) (__real__(z))
2628 #define __Pyx_CIMAG(z) (__imag__(z))
2631 #define __Pyx_CREAL(z) ((z).real)
2632 #define __Pyx_CIMAG(z) ((z).imag)
2634#if defined(__cplusplus) && CYTHON_CCOMPLEX\
2635 && (defined(_WIN32) || defined(__clang__) || (defined(__GNUC__) && (__GNUC__ >= 5 || __GNUC__ == 4 && __GNUC_MINOR__ >= 4 )) || __cplusplus >= 201103)
2636 #define __Pyx_SET_CREAL(z,x) ((z).real(x))
2637 #define __Pyx_SET_CIMAG(z,y) ((z).imag(y))
2639 #define __Pyx_SET_CREAL(z,x) __Pyx_CREAL(z) = (x)
2640 #define __Pyx_SET_CIMAG(z,y) __Pyx_CIMAG(z) = (y)
2644#if CYTHON_CCOMPLEX && (1) && (!0 || __cplusplus)
2645 #define __Pyx_c_eq_float(a, b) ((a)==(b))
2646 #define __Pyx_c_sum_float(a, b) ((a)+(b))
2647 #define __Pyx_c_diff_float(a, b) ((a)-(b))
2648 #define __Pyx_c_prod_float(a, b) ((a)*(b))
2649 #define __Pyx_c_quot_float(a, b) ((a)/(b))
2650 #define __Pyx_c_neg_float(a) (-(a))
2652 #define __Pyx_c_is_zero_float(z) ((z)==(float)0)
2653 #define __Pyx_c_conj_float(z) (::std::conj(z))
2655 #define __Pyx_c_abs_float(z) (::std::abs(z))
2656 #define __Pyx_c_pow_float(a, b) (::std::pow(a, b))
2659 #define __Pyx_c_is_zero_float(z) ((z)==0)
2660 #define __Pyx_c_conj_float(z) (conjf(z))
2662 #define __Pyx_c_abs_float(z) (cabsf(z))
2663 #define __Pyx_c_pow_float(a, b) (cpowf(a, b))
2667 static CYTHON_INLINE
int __Pyx_c_eq_float(__pyx_t_float_complex, __pyx_t_float_complex);
2668 static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_sum_float(__pyx_t_float_complex, __pyx_t_float_complex);
2669 static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_diff_float(__pyx_t_float_complex, __pyx_t_float_complex);
2670 static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_prod_float(__pyx_t_float_complex, __pyx_t_float_complex);
2671 static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_quot_float(__pyx_t_float_complex, __pyx_t_float_complex);
2672 static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_neg_float(__pyx_t_float_complex);
2673 static CYTHON_INLINE
int __Pyx_c_is_zero_float(__pyx_t_float_complex);
2674 static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_conj_float(__pyx_t_float_complex);
2676 static CYTHON_INLINE
float __Pyx_c_abs_float(__pyx_t_float_complex);
2677 static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_pow_float(__pyx_t_float_complex, __pyx_t_float_complex);
2682#if CYTHON_CCOMPLEX && (1) && (!0 || __cplusplus)
2683 #define __Pyx_c_eq_double(a, b) ((a)==(b))
2684 #define __Pyx_c_sum_double(a, b) ((a)+(b))
2685 #define __Pyx_c_diff_double(a, b) ((a)-(b))
2686 #define __Pyx_c_prod_double(a, b) ((a)*(b))
2687 #define __Pyx_c_quot_double(a, b) ((a)/(b))
2688 #define __Pyx_c_neg_double(a) (-(a))
2690 #define __Pyx_c_is_zero_double(z) ((z)==(double)0)
2691 #define __Pyx_c_conj_double(z) (::std::conj(z))
2693 #define __Pyx_c_abs_double(z) (::std::abs(z))
2694 #define __Pyx_c_pow_double(a, b) (::std::pow(a, b))
2697 #define __Pyx_c_is_zero_double(z) ((z)==0)
2698 #define __Pyx_c_conj_double(z) (conj(z))
2700 #define __Pyx_c_abs_double(z) (cabs(z))
2701 #define __Pyx_c_pow_double(a, b) (cpow(a, b))
2705 static CYTHON_INLINE
int __Pyx_c_eq_double(__pyx_t_double_complex, __pyx_t_double_complex);
2706 static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_sum_double(__pyx_t_double_complex, __pyx_t_double_complex);
2707 static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_diff_double(__pyx_t_double_complex, __pyx_t_double_complex);
2708 static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_prod_double(__pyx_t_double_complex, __pyx_t_double_complex);
2709 static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_quot_double(__pyx_t_double_complex, __pyx_t_double_complex);
2710 static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_neg_double(__pyx_t_double_complex);
2711 static CYTHON_INLINE
int __Pyx_c_is_zero_double(__pyx_t_double_complex);
2712 static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_conj_double(__pyx_t_double_complex);
2714 static CYTHON_INLINE
double __Pyx_c_abs_double(__pyx_t_double_complex);
2715 static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_pow_double(__pyx_t_double_complex, __pyx_t_double_complex);
2720#if CYTHON_CCOMPLEX && (1) && (!0 || __cplusplus)
2721 #define __Pyx_c_eq_long__double(a, b) ((a)==(b))
2722 #define __Pyx_c_sum_long__double(a, b) ((a)+(b))
2723 #define __Pyx_c_diff_long__double(a, b) ((a)-(b))
2724 #define __Pyx_c_prod_long__double(a, b) ((a)*(b))
2725 #define __Pyx_c_quot_long__double(a, b) ((a)/(b))
2726 #define __Pyx_c_neg_long__double(a) (-(a))
2728 #define __Pyx_c_is_zero_long__double(z) ((z)==(long double)0)
2729 #define __Pyx_c_conj_long__double(z) (::std::conj(z))
2731 #define __Pyx_c_abs_long__double(z) (::std::abs(z))
2732 #define __Pyx_c_pow_long__double(a, b) (::std::pow(a, b))
2735 #define __Pyx_c_is_zero_long__double(z) ((z)==0)
2736 #define __Pyx_c_conj_long__double(z) (conjl(z))
2738 #define __Pyx_c_abs_long__double(z) (cabsl(z))
2739 #define __Pyx_c_pow_long__double(a, b) (cpowl(a, b))
2743 static CYTHON_INLINE
int __Pyx_c_eq_long__double(__pyx_t_long_double_complex, __pyx_t_long_double_complex);
2744 static CYTHON_INLINE __pyx_t_long_double_complex __Pyx_c_sum_long__double(__pyx_t_long_double_complex, __pyx_t_long_double_complex);
2745 static CYTHON_INLINE __pyx_t_long_double_complex __Pyx_c_diff_long__double(__pyx_t_long_double_complex, __pyx_t_long_double_complex);
2746 static CYTHON_INLINE __pyx_t_long_double_complex __Pyx_c_prod_long__double(__pyx_t_long_double_complex, __pyx_t_long_double_complex);
2747 static CYTHON_INLINE __pyx_t_long_double_complex __Pyx_c_quot_long__double(__pyx_t_long_double_complex, __pyx_t_long_double_complex);
2748 static CYTHON_INLINE __pyx_t_long_double_complex __Pyx_c_neg_long__double(__pyx_t_long_double_complex);
2749 static CYTHON_INLINE
int __Pyx_c_is_zero_long__double(__pyx_t_long_double_complex);
2750 static CYTHON_INLINE __pyx_t_long_double_complex __Pyx_c_conj_long__double(__pyx_t_long_double_complex);
2752 static CYTHON_INLINE
long double __Pyx_c_abs_long__double(__pyx_t_long_double_complex);
2753 static CYTHON_INLINE __pyx_t_long_double_complex __Pyx_c_pow_long__double(__pyx_t_long_double_complex, __pyx_t_long_double_complex);
2758static CYTHON_INLINE
char __Pyx_PyLong_As_char(PyObject *);
2761#if CYTHON_COMPILING_IN_LIMITED_API && __PYX_LIMITED_VERSION_HEX >= 0x030d0000
2762typedef PyObject *__Pyx_TypeName;
2763#define __Pyx_FMT_TYPENAME "%N"
2764#define __Pyx_PyType_GetFullyQualifiedName(tp) Py_NewRef((PyObject*)tp)
2765#define __Pyx_DECREF_TypeName(obj) Py_DECREF(obj)
2766#elif CYTHON_COMPILING_IN_LIMITED_API
2767typedef PyObject *__Pyx_TypeName;
2768#define __Pyx_FMT_TYPENAME "%U"
2769#define __Pyx_DECREF_TypeName(obj) Py_XDECREF(obj)
2770static __Pyx_TypeName __Pyx_PyType_GetFullyQualifiedName(PyTypeObject* tp);
2772typedef const char *__Pyx_TypeName;
2773#define __Pyx_FMT_TYPENAME "%.200s"
2774#define __Pyx_PyType_GetFullyQualifiedName(tp) ((tp)->tp_name)
2775#define __Pyx_DECREF_TypeName(obj)
2779#if CYTHON_VECTORCALL
2780#define __Pyx_Object_VectorcallKwds PyObject_Vectorcall
2781CYTHON_UNUSED
static int __Pyx_CheckVectorcallKwarg(PyObject *kwnames, Py_ssize_t i);
2783#define __Pyx_Object_VectorcallKwds __Pyx_PyObject_FastCallDict
2784CYTHON_UNUSED
static PyObject *__Pyx_MakeKwargDict(PyObject **keys, PyObject **values, Py_ssize_t
n);
2785CYTHON_UNUSED
static int __Pyx_CheckVectorcallKwarg(PyObject **kwnames, Py_ssize_t i);
2789#if CYTHON_VECTORCALL
2790#define __Pyx_Object_VectorcallMethodKwds PyObject_VectorcallMethod
2792static PyObject *__Pyx_Object_VectorcallMethodKwds(PyObject *name, PyObject *
const *args,
size_t nargsf, PyObject *kwnames);
2796static CYTHON_INLINE PyObject* __Pyx_PyLong_From_long(
long value);
2799static CYTHON_INLINE
long __Pyx_PyLong_As_long(PyObject *);
2802static CYTHON_INLINE
int __Pyx_PyLong_As_int(PyObject *);
2805#if __PYX_LIMITED_VERSION_HEX < 0x030b0000
2806static unsigned long __Pyx_cached_runtime_version = 0;
2807static void __Pyx_init_runtime_version(
void);
2809#define __Pyx_init_runtime_version()
2811static unsigned long __Pyx_get_runtime_version(
void);
2814static int __Pyx_check_binary_version(
unsigned long ct_version,
unsigned long rt_version,
int allow_newer);
2817static PyObject *__Pyx_DecompressString(
const char *
s, Py_ssize_t length,
int algo);
2820static PyObject *__Pyx_DecompressString_LZSS(
const char *
s,
size_t compressed_length,
size_t uncompressed_length);
2823#if CYTHON_PEP489_MULTI_PHASE_INIT && CYTHON_USE_MODULE_STATE
2825static PyObject *__Pyx_State_FindModule(
void*);
2826static int __Pyx_State_AddModule(PyObject* module,
void*);
2827static int __Pyx_State_RemoveModule(
void*);
2828#elif CYTHON_USE_MODULE_STATE
2829#define __Pyx_State_FindModule PyState_FindModule
2830#define __Pyx_State_AddModule PyState_AddModule
2831#define __Pyx_State_RemoveModule PyState_RemoveModule
2836#if CYTHON_COMPILING_IN_LIMITED_API
2837 #if CYTHON_VECTORCALL
2838 #define __PYX_VECTORCALL_ABI_SUFFIX "_vectorcall"
2840 #define __PYX_VECTORCALL_ABI_SUFFIX
2842 #define __PYX_LIMITED_ABI_SUFFIX "limited" __PYX_VECTORCALL_ABI_SUFFIX __PYX_AM_SEND_ABI_SUFFIX
2844 #define __PYX_LIMITED_ABI_SUFFIX
2846#if __PYX_HAS_PY_AM_SEND == 1
2847 #define __PYX_AM_SEND_ABI_SUFFIX
2848#elif __PYX_HAS_PY_AM_SEND == 2
2849 #define __PYX_AM_SEND_ABI_SUFFIX "amsendbackport"
2851 #define __PYX_AM_SEND_ABI_SUFFIX "noamsend"
2853#ifndef __PYX_MONITORING_ABI_SUFFIX
2854 #define __PYX_MONITORING_ABI_SUFFIX
2856#if CYTHON_USE_TP_FINALIZE
2857 #define __PYX_TP_FINALIZE_ABI_SUFFIX
2859 #define __PYX_TP_FINALIZE_ABI_SUFFIX "nofinalize"
2861#if CYTHON_USE_FREELISTS || !defined(__Pyx_AsyncGen_USED)
2862 #define __PYX_FREELISTS_ABI_SUFFIX
2864 #define __PYX_FREELISTS_ABI_SUFFIX "nofreelists"
2866#if CYTHON_OPAQUE_OBJECTS && CYTHON_COMPILING_IN_LIMITED_API
2867 #define __PYX_OPAQUE_OBJECTS_ABI_SUFFIX "opaque"
2869 #define __PYX_OPAQUE_OBJECTS_ABI_SUFFIX
2871#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
2872#define __PYX_ABI_MODULE_NAME "_cython_" CYTHON_ABI
2873#define __PYX_TYPE_MODULE_PREFIX __PYX_ABI_MODULE_NAME "."
2875static CYTHON_INLINE PyTypeObject *__pyx_f_5numpy_5dtype_7typeobj___get__(PyArray_Descr *__pyx_v_self);
2876static CYTHON_INLINE
char __pyx_f_5numpy_5dtype_4kind___get__(PyArray_Descr *__pyx_v_self);
2877static CYTHON_INLINE
char __pyx_f_5numpy_5dtype_4type___get__(PyArray_Descr *__pyx_v_self);
2878static CYTHON_INLINE
char __pyx_f_5numpy_5dtype_9byteorder___get__(PyArray_Descr *__pyx_v_self);
2879static CYTHON_INLINE
int __pyx_f_5numpy_5dtype_8type_num___get__(PyArray_Descr *__pyx_v_self);
2880static CYTHON_INLINE npy_intp __pyx_f_5numpy_5dtype_8itemsize___get__(PyArray_Descr *__pyx_v_self);
2881static CYTHON_INLINE npy_intp __pyx_f_5numpy_5dtype_9alignment___get__(PyArray_Descr *__pyx_v_self);
2882static CYTHON_INLINE PyObject *__pyx_f_5numpy_5dtype_6fields___get__(PyArray_Descr *__pyx_v_self);
2883static CYTHON_INLINE PyObject *__pyx_f_5numpy_5dtype_5names___get__(PyArray_Descr *__pyx_v_self);
2884static CYTHON_INLINE PyArray_ArrayDescr *__pyx_f_5numpy_5dtype_8subarray___get__(PyArray_Descr *__pyx_v_self);
2885static CYTHON_INLINE npy_uint64 __pyx_f_5numpy_5dtype_5flags___get__(PyArray_Descr *__pyx_v_self);
2886static CYTHON_INLINE
int __pyx_f_5numpy_9broadcast_7numiter___get__(PyArrayMultiIterObject *__pyx_v_self);
2887static CYTHON_INLINE npy_intp __pyx_f_5numpy_9broadcast_4size___get__(PyArrayMultiIterObject *__pyx_v_self);
2888static CYTHON_INLINE npy_intp __pyx_f_5numpy_9broadcast_5index___get__(PyArrayMultiIterObject *__pyx_v_self);
2889static CYTHON_INLINE
int __pyx_f_5numpy_9broadcast_2nd___get__(PyArrayMultiIterObject *__pyx_v_self);
2890static CYTHON_INLINE npy_intp *__pyx_f_5numpy_9broadcast_10dimensions___get__(PyArrayMultiIterObject *__pyx_v_self);
2891static CYTHON_INLINE
void **__pyx_f_5numpy_9broadcast_5iters___get__(PyArrayMultiIterObject *__pyx_v_self);
2892static CYTHON_INLINE PyObject *__pyx_f_5numpy_7ndarray_4base___get__(PyArrayObject *__pyx_v_self);
2893static CYTHON_INLINE PyArray_Descr *__pyx_f_5numpy_7ndarray_5descr___get__(PyArrayObject *__pyx_v_self);
2894static CYTHON_INLINE
int __pyx_f_5numpy_7ndarray_4ndim___get__(PyArrayObject *__pyx_v_self);
2895static CYTHON_INLINE npy_intp *__pyx_f_5numpy_7ndarray_5shape___get__(PyArrayObject *__pyx_v_self);
2896static CYTHON_INLINE npy_intp *__pyx_f_5numpy_7ndarray_7strides___get__(PyArrayObject *__pyx_v_self);
2897static CYTHON_INLINE npy_intp __pyx_f_5numpy_7ndarray_4size___get__(PyArrayObject *__pyx_v_self);
2898static CYTHON_INLINE
char *__pyx_f_5numpy_7ndarray_4data___get__(PyArrayObject *__pyx_v_self);
2899static CYTHON_INLINE
int __pyx_f_5numpy_5ufunc_3nin___get__(PyUFuncObject *__pyx_v_self);
2900static CYTHON_INLINE
int __pyx_f_5numpy_5ufunc_4nout___get__(PyUFuncObject *__pyx_v_self);
2901static CYTHON_INLINE
int __pyx_f_5numpy_5ufunc_5nargs___get__(PyUFuncObject *__pyx_v_self);
2902static CYTHON_INLINE PyUFuncGenericFunction *__pyx_f_5numpy_5ufunc_9functions___get__(PyUFuncObject *__pyx_v_self);
2903static CYTHON_INLINE
void **__pyx_f_5numpy_5ufunc_4data___get__(PyUFuncObject *__pyx_v_self);
2904static CYTHON_INLINE
int __pyx_f_5numpy_5ufunc_6ntypes___get__(PyUFuncObject *__pyx_v_self);
2905static CYTHON_INLINE
char const *__pyx_f_5numpy_5ufunc_4name___get__(PyUFuncObject *__pyx_v_self);
2906static CYTHON_INLINE
char const *__pyx_f_5numpy_5ufunc_3doc___get__(PyUFuncObject *__pyx_v_self);
2907static CYTHON_INLINE
void *__pyx_f_5numpy_5ufunc_3ptr___get__(PyUFuncObject *__pyx_v_self);
2908static CYTHON_INLINE PyObject *__pyx_f_5numpy_5ufunc_3obj___get__(PyUFuncObject *__pyx_v_self);
2909static CYTHON_INLINE PyObject *__pyx_f_5numpy_5ufunc_9userloops___get__(PyUFuncObject *__pyx_v_self);
2932#define __Pyx_MODULE_NAME "cshockCapturing"
2933extern int __pyx_module_is_main_cshockCapturing;
2934int __pyx_module_is_main_cshockCapturing = 0;
2940static PyObject *__pyx_pf_15cshockCapturing_calculateNumericalDiffusionResGrad(CYTHON_UNUSED PyObject *__pyx_self,
double __pyx_v_shockCapturingDiffusion, PyArrayObject *__pyx_v_elementDiameter, PyArrayObject *__pyx_v_strong_residual, PyArrayObject *__pyx_v_grad_u, PyArrayObject *__pyx_v_numDiff);
2941static PyObject *__pyx_pf_15cshockCapturing_2calculateNumericalDiffusionResGradQuad(CYTHON_UNUSED PyObject *__pyx_self,
double __pyx_v_shockCapturingDiffusion, PyArrayObject *__pyx_v_elementDiameter, PyArrayObject *__pyx_v_strong_residual, PyArrayObject *__pyx_v_grad_u, PyArrayObject *__pyx_v_numDiff);
2942static PyObject *__pyx_pf_15cshockCapturing_4calculateNumericalDiffusionEikonal(CYTHON_UNUSED PyObject *__pyx_self,
double __pyx_v_shockCapturingDiffusion, PyArrayObject *__pyx_v_elementDiameter, PyArrayObject *__pyx_v_strong_residual, PyArrayObject *__pyx_v_numDiff);
2943static PyObject *__pyx_pf_15cshockCapturing_6calculateNumericalDiffusionHJ(CYTHON_UNUSED PyObject *__pyx_self,
char __pyx_v_shockCapturing,
double __pyx_v_shockCapturingDiffusion, PyArrayObject *__pyx_v_elementDiameter, PyArrayObject *__pyx_v_strong_residual, PyArrayObject *__pyx_v_mt, PyArrayObject *__pyx_v_H, PyArrayObject *__pyx_v_numDiff);
2944static PyObject *__pyx_pf_15cshockCapturing_8calculateNumericalDiffusionHJV2(CYTHON_UNUSED PyObject *__pyx_self,
char __pyx_v_shockCapturing,
double __pyx_v_shockCapturingDiffusion, PyArrayObject *__pyx_v_elementDiameter, PyArrayObject *__pyx_v_strong_residual, PyArrayObject *__pyx_v_mt, PyArrayObject *__pyx_v_H, PyArrayObject *__pyx_v_numDiff);
2945static PyObject *__pyx_pf_15cshockCapturing_10calculateNumericalDiffusion_A_1(CYTHON_UNUSED PyObject *__pyx_self,
double __pyx_v_shockCapturingFactor, PyArrayObject *__pyx_v_elementDiameter, PyArrayObject *__pyx_v_strong_residual, PyArrayObject *__pyx_v_mt, PyArrayObject *__pyx_v_df, PyArrayObject *__pyx_v_numDiff);
2946static PyObject *__pyx_pf_15cshockCapturing_12calculateNumericalDiffusionResGradJuanes(CYTHON_UNUSED PyObject *__pyx_self,
double __pyx_v_shockCapturingDiffusion,
double __pyx_v_uSC, PyArrayObject *__pyx_v_elementDiameter, PyArrayObject *__pyx_v_strong_residual, PyArrayObject *__pyx_v_grad_u, PyArrayObject *__pyx_v_numDiff);
2947static PyObject *__pyx_pf_15cshockCapturing_14calculateNumericalDiffusionJaffre(CYTHON_UNUSED PyObject *__pyx_self,
double __pyx_v_shockCapturingDiffusion,
double __pyx_v_beta, PyArrayObject *__pyx_v_elementDiameter, PyArrayObject *__pyx_v_strong_residual, PyArrayObject *__pyx_v_grad_u, PyArrayObject *__pyx_v_numDiff);
2951#ifndef CYTHON_SMALL_CODE
2952#if defined(__clang__)
2953 #define CYTHON_SMALL_CODE
2954#elif defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 3))
2955 #define CYTHON_SMALL_CODE __attribute__((cold))
2957 #define CYTHON_SMALL_CODE
2967 PyObject *__pyx_cython_runtime;
2968 PyObject *__pyx_empty_tuple;
2969 PyObject *__pyx_empty_bytes;
2970 PyObject *__pyx_empty_unicode;
2971 PyTypeObject *__pyx_ptype_7cpython_4type_type;
2972 PyTypeObject *__pyx_ptype_5numpy_dtype;
2973 PyTypeObject *__pyx_ptype_5numpy_flatiter;
2974 PyTypeObject *__pyx_ptype_5numpy_broadcast;
2975 PyTypeObject *__pyx_ptype_5numpy_ndarray;
2976 PyTypeObject *__pyx_ptype_5numpy_generic;
2977 PyTypeObject *__pyx_ptype_5numpy_number;
2978 PyTypeObject *__pyx_ptype_5numpy_integer;
2979 PyTypeObject *__pyx_ptype_5numpy_signedinteger;
2980 PyTypeObject *__pyx_ptype_5numpy_unsignedinteger;
2981 PyTypeObject *__pyx_ptype_5numpy_inexact;
2982 PyTypeObject *__pyx_ptype_5numpy_floating;
2983 PyTypeObject *__pyx_ptype_5numpy_complexfloating;
2984 PyTypeObject *__pyx_ptype_5numpy_flexible;
2985 PyTypeObject *__pyx_ptype_5numpy_character;
2986 PyTypeObject *__pyx_ptype_5numpy_ufunc;
2987 __Pyx_CachedCFunction __pyx_umethod_PyDict_Type_items;
2988 __Pyx_CachedCFunction __pyx_umethod_PyDict_Type_pop;
2989 __Pyx_CachedCFunction __pyx_umethod_PyDict_Type_values;
2990 PyObject *__pyx_codeobj_tab[8];
2991 PyObject *__pyx_string_tab[52];
2994PyTypeObject *__pyx_CommonTypesMetaclassType;
2997#if CYTHON_COMPILING_IN_LIMITED_API
2998PyObject *__Pyx_CachedMethodType;
3002PyTypeObject *__pyx_CyFunctionType;
3005struct __Pyx_CodeObjectCache __pyx_code_cache;
3013#if CYTHON_USE_MODULE_STATE
3016extern struct PyModuleDef __pyx_moduledef;
3019static struct PyModuleDef __pyx_moduledef;
3022#define __pyx_mstate_global (__Pyx_PyModule_GetState(__Pyx_State_FindModule(&__pyx_moduledef)))
3024#define __pyx_m (__Pyx_State_FindModule(&__pyx_moduledef))
3026static __pyx_mstatetype __pyx_mstate_global_static =
3032static __pyx_mstatetype *
const __pyx_mstate_global = &__pyx_mstate_global_static;
3035#define __pyx_kp_u_ __pyx_string_tab[0]
3036#define __pyx_kp_u_Note_that_Cython_is_deliberately __pyx_string_tab[1]
3037#define __pyx_kp_u_add_note __pyx_string_tab[2]
3038#define __pyx_kp_u_numpy__core_multiarray_failed_to __pyx_string_tab[3]
3039#define __pyx_kp_u_numpy__core_umath_failed_to_impo __pyx_string_tab[4]
3040#define __pyx_kp_u_proteus_cshockCapturing_pyx __pyx_string_tab[5]
3041#define __pyx_n_u_H __pyx_string_tab[6]
3042#define __pyx_n_u_Pyx_PyDict_NextRef __pyx_string_tab[7]
3043#define __pyx_n_u_annotate __pyx_string_tab[8]
3044#define __pyx_n_u_func __pyx_string_tab[9]
3045#define __pyx_n_u_main __pyx_string_tab[10]
3046#define __pyx_n_u_module __pyx_string_tab[11]
3047#define __pyx_n_u_name __pyx_string_tab[12]
3048#define __pyx_n_u_qualname __pyx_string_tab[13]
3049#define __pyx_n_u_test __pyx_string_tab[14]
3050#define __pyx_n_u_is_coroutine __pyx_string_tab[15]
3051#define __pyx_n_u_asyncio_coroutines __pyx_string_tab[16]
3052#define __pyx_n_u_beta __pyx_string_tab[17]
3053#define __pyx_n_u_calculateNumericalDiffusionEikon __pyx_string_tab[18]
3054#define __pyx_n_u_calculateNumericalDiffusionHJ __pyx_string_tab[19]
3055#define __pyx_n_u_calculateNumericalDiffusionHJV2 __pyx_string_tab[20]
3056#define __pyx_n_u_calculateNumericalDiffusionJaffr __pyx_string_tab[21]
3057#define __pyx_n_u_calculateNumericalDiffusionResGr __pyx_string_tab[22]
3058#define __pyx_n_u_calculateNumericalDiffusionResGr_3 __pyx_string_tab[23]
3059#define __pyx_n_u_calculateNumericalDiffusionResGr_2 __pyx_string_tab[24]
3060#define __pyx_n_u_calculateNumericalDiffusion_A_1 __pyx_string_tab[25]
3061#define __pyx_n_u_cline_in_traceback __pyx_string_tab[26]
3062#define __pyx_n_u_cshockCapturing __pyx_string_tab[27]
3063#define __pyx_n_u_df __pyx_string_tab[28]
3064#define __pyx_n_u_elementDiameter __pyx_string_tab[29]
3065#define __pyx_n_u_grad_u __pyx_string_tab[30]
3066#define __pyx_n_u_items __pyx_string_tab[31]
3067#define __pyx_n_u_mt __pyx_string_tab[32]
3068#define __pyx_n_u_np __pyx_string_tab[33]
3069#define __pyx_n_u_numDiff __pyx_string_tab[34]
3070#define __pyx_n_u_numpy __pyx_string_tab[35]
3071#define __pyx_n_u_pop __pyx_string_tab[36]
3072#define __pyx_n_u_setdefault __pyx_string_tab[37]
3073#define __pyx_n_u_shockCapturing __pyx_string_tab[38]
3074#define __pyx_n_u_shockCapturingDiffusion __pyx_string_tab[39]
3075#define __pyx_n_u_shockCapturingFactor __pyx_string_tab[40]
3076#define __pyx_n_u_strong_residual __pyx_string_tab[41]
3077#define __pyx_n_u_uSC __pyx_string_tab[42]
3078#define __pyx_n_u_values __pyx_string_tab[43]
3079#define __pyx_kp_b_iso88591_q_vQa_vQa_2_2_2 __pyx_string_tab[44]
3080#define __pyx_kp_b_iso88591_q_fAQ_fAQ_fAQ_2_2_2_2 __pyx_string_tab[45]
3081#define __pyx_kp_b_iso88591_1F_fAQ_fAQ_2_2_2_2 __pyx_string_tab[46]
3082#define __pyx_kp_b_iso88591_ARvQa_fAQ_fAQ_oQ_oQ_b_b_gQ __pyx_string_tab[47]
3083#define __pyx_kp_b_iso88591_avV1A_oQ_oQ_fA_gQ __pyx_string_tab[48]
3084#define __pyx_kp_b_iso88591_QfF_1_oQ_oQ_fA_gQ __pyx_string_tab[49]
3085#define __pyx_kp_b_iso88591_1F_1_V1A_oQ_oQ_b_aq_gQ __pyx_string_tab[50]
3086#define __pyx_kp_b_iso88591_AQfAQ_V1A_oQ_oQ_b_aq_gQ __pyx_string_tab[51]
3088#if CYTHON_USE_MODULE_STATE
3089static CYTHON_SMALL_CODE
int __pyx_m_clear(PyObject *m) {
3090 __pyx_mstatetype *clear_module_state = __Pyx_PyModule_GetState(m);
3091 if (!clear_module_state)
return 0;
3092 Py_CLEAR(clear_module_state->__pyx_d);
3093 Py_CLEAR(clear_module_state->__pyx_b);
3094 Py_CLEAR(clear_module_state->__pyx_cython_runtime);
3095 Py_CLEAR(clear_module_state->__pyx_empty_tuple);
3096 Py_CLEAR(clear_module_state->__pyx_empty_bytes);
3097 Py_CLEAR(clear_module_state->__pyx_empty_unicode);
3098 #if CYTHON_PEP489_MULTI_PHASE_INIT
3099 __Pyx_State_RemoveModule(NULL);
3101 Py_CLEAR(clear_module_state->__pyx_ptype_7cpython_4type_type);
3102 Py_CLEAR(clear_module_state->__pyx_ptype_5numpy_dtype);
3103 Py_CLEAR(clear_module_state->__pyx_ptype_5numpy_flatiter);
3104 Py_CLEAR(clear_module_state->__pyx_ptype_5numpy_broadcast);
3105 Py_CLEAR(clear_module_state->__pyx_ptype_5numpy_ndarray);
3106 Py_CLEAR(clear_module_state->__pyx_ptype_5numpy_generic);
3107 Py_CLEAR(clear_module_state->__pyx_ptype_5numpy_number);
3108 Py_CLEAR(clear_module_state->__pyx_ptype_5numpy_integer);
3109 Py_CLEAR(clear_module_state->__pyx_ptype_5numpy_signedinteger);
3110 Py_CLEAR(clear_module_state->__pyx_ptype_5numpy_unsignedinteger);
3111 Py_CLEAR(clear_module_state->__pyx_ptype_5numpy_inexact);
3112 Py_CLEAR(clear_module_state->__pyx_ptype_5numpy_floating);
3113 Py_CLEAR(clear_module_state->__pyx_ptype_5numpy_complexfloating);
3114 Py_CLEAR(clear_module_state->__pyx_ptype_5numpy_flexible);
3115 Py_CLEAR(clear_module_state->__pyx_ptype_5numpy_character);
3116 Py_CLEAR(clear_module_state->__pyx_ptype_5numpy_ufunc);
3117 Py_CLEAR(clear_module_state->__pyx_umethod_PyDict_Type_items.method);
3118 Py_CLEAR(clear_module_state->__pyx_umethod_PyDict_Type_pop.method);
3119 Py_CLEAR(clear_module_state->__pyx_umethod_PyDict_Type_values.method);
3120 for (
int i=0; i<8; ++i) { Py_CLEAR(clear_module_state->__pyx_codeobj_tab[i]); }
3121 for (
int i=0; i<52; ++i) { Py_CLEAR(clear_module_state->__pyx_string_tab[i]); }
3124Py_CLEAR(clear_module_state->__pyx_CommonTypesMetaclassType);
3127Py_CLEAR(clear_module_state->__pyx_CyFunctionType);
3134#if CYTHON_USE_MODULE_STATE
3135static CYTHON_SMALL_CODE
int __pyx_m_traverse(PyObject *m, visitproc visit,
void *arg) {
3136 __pyx_mstatetype *traverse_module_state = __Pyx_PyModule_GetState(m);
3137 if (!traverse_module_state)
return 0;
3138 Py_VISIT(traverse_module_state->__pyx_d);
3139 Py_VISIT(traverse_module_state->__pyx_b);
3140 Py_VISIT(traverse_module_state->__pyx_cython_runtime);
3141 __Pyx_VISIT_CONST(traverse_module_state->__pyx_empty_tuple);
3142 __Pyx_VISIT_CONST(traverse_module_state->__pyx_empty_bytes);
3143 __Pyx_VISIT_CONST(traverse_module_state->__pyx_empty_unicode);
3144 Py_VISIT(traverse_module_state->__pyx_ptype_7cpython_4type_type);
3145 Py_VISIT(traverse_module_state->__pyx_ptype_5numpy_dtype);
3146 Py_VISIT(traverse_module_state->__pyx_ptype_5numpy_flatiter);
3147 Py_VISIT(traverse_module_state->__pyx_ptype_5numpy_broadcast);
3148 Py_VISIT(traverse_module_state->__pyx_ptype_5numpy_ndarray);
3149 Py_VISIT(traverse_module_state->__pyx_ptype_5numpy_generic);
3150 Py_VISIT(traverse_module_state->__pyx_ptype_5numpy_number);
3151 Py_VISIT(traverse_module_state->__pyx_ptype_5numpy_integer);
3152 Py_VISIT(traverse_module_state->__pyx_ptype_5numpy_signedinteger);
3153 Py_VISIT(traverse_module_state->__pyx_ptype_5numpy_unsignedinteger);
3154 Py_VISIT(traverse_module_state->__pyx_ptype_5numpy_inexact);
3155 Py_VISIT(traverse_module_state->__pyx_ptype_5numpy_floating);
3156 Py_VISIT(traverse_module_state->__pyx_ptype_5numpy_complexfloating);
3157 Py_VISIT(traverse_module_state->__pyx_ptype_5numpy_flexible);
3158 Py_VISIT(traverse_module_state->__pyx_ptype_5numpy_character);
3159 Py_VISIT(traverse_module_state->__pyx_ptype_5numpy_ufunc);
3160 Py_VISIT(traverse_module_state->__pyx_umethod_PyDict_Type_items.method);
3161 Py_VISIT(traverse_module_state->__pyx_umethod_PyDict_Type_pop.method);
3162 Py_VISIT(traverse_module_state->__pyx_umethod_PyDict_Type_values.method);
3163 for (
int i=0; i<8; ++i) { __Pyx_VISIT_CONST(traverse_module_state->__pyx_codeobj_tab[i]); }
3164 for (
int i=0; i<52; ++i) { __Pyx_VISIT_CONST(traverse_module_state->__pyx_string_tab[i]); }
3167Py_VISIT(traverse_module_state->__pyx_CommonTypesMetaclassType);
3170Py_VISIT(traverse_module_state->__pyx_CyFunctionType);
3186static CYTHON_INLINE PyTypeObject *__pyx_f_5numpy_5dtype_7typeobj___get__(PyArray_Descr *__pyx_v_self) {
3187 PyTypeObject *__pyx_r;
3198 __pyx_r = PyDataType_TYPEOBJ(__pyx_v_self);
3223static CYTHON_INLINE
char __pyx_f_5numpy_5dtype_4kind___get__(PyArray_Descr *__pyx_v_self) {
3235 __pyx_r = PyDataType_KIND(__pyx_v_self);
3260static CYTHON_INLINE
char __pyx_f_5numpy_5dtype_4type___get__(PyArray_Descr *__pyx_v_self) {
3272 __pyx_r = PyDataType_TYPE(__pyx_v_self);
3297static CYTHON_INLINE
char __pyx_f_5numpy_5dtype_9byteorder___get__(PyArray_Descr *__pyx_v_self) {
3309 __pyx_r = PyDataType_BYTEORDER(__pyx_v_self);
3334static CYTHON_INLINE
int __pyx_f_5numpy_5dtype_8type_num___get__(PyArray_Descr *__pyx_v_self) {
3346 __pyx_r = PyDataType_TYPENUM(__pyx_v_self);
3371static CYTHON_INLINE npy_intp __pyx_f_5numpy_5dtype_8itemsize___get__(PyArray_Descr *__pyx_v_self) {
3383 __pyx_r = PyDataType_ELSIZE(__pyx_v_self);
3408static CYTHON_INLINE npy_intp __pyx_f_5numpy_5dtype_9alignment___get__(PyArray_Descr *__pyx_v_self) {
3420 __pyx_r = PyDataType_ALIGNMENT(__pyx_v_self);
3445static CYTHON_INLINE PyObject *__pyx_f_5numpy_5dtype_6fields___get__(PyArray_Descr *__pyx_v_self) {
3446 PyObject *__pyx_r = NULL;
3447 __Pyx_RefNannyDeclarations
3448 PyObject *__pyx_t_1;
3449 __Pyx_RefNannySetupContext(
"__get__", 0);
3458 __pyx_t_1 = PyDataType_FIELDS(__pyx_v_self);
3461 PyObject *__pyx_temp;
3463 __pyx_temp = __pyx_r;
3464 __Pyx_INCREF(((PyObject *)__pyx_t_1));
3465 __pyx_r = ((PyObject *)__pyx_t_1);
3467 __Pyx_XDECREF(__pyx_temp);
3482 __Pyx_XGIVEREF(__pyx_r);
3483 __Pyx_RefNannyFinishContext();
3495static CYTHON_INLINE PyObject *__pyx_f_5numpy_5dtype_5names___get__(PyArray_Descr *__pyx_v_self) {
3496 PyObject *__pyx_r = NULL;
3497 __Pyx_RefNannyDeclarations
3498 PyObject *__pyx_t_1;
3499 __Pyx_RefNannySetupContext(
"__get__", 0);
3508 __pyx_t_1 = PyDataType_NAMES(__pyx_v_self);
3511 PyObject *__pyx_temp;
3513 __pyx_temp = __pyx_r;
3514 __Pyx_INCREF(((PyObject*)__pyx_t_1));
3515 __pyx_r = ((PyObject*)__pyx_t_1);
3517 __Pyx_XDECREF(__pyx_temp);
3532 __Pyx_XGIVEREF(__pyx_r);
3533 __Pyx_RefNannyFinishContext();
3545static CYTHON_INLINE PyArray_ArrayDescr *__pyx_f_5numpy_5dtype_8subarray___get__(PyArray_Descr *__pyx_v_self) {
3546 PyArray_ArrayDescr *__pyx_r;
3557 __pyx_r = PyDataType_SUBARRAY(__pyx_v_self);
3582static CYTHON_INLINE npy_uint64 __pyx_f_5numpy_5dtype_5flags___get__(PyArray_Descr *__pyx_v_self) {
3594 __pyx_r = PyDataType_FLAGS(__pyx_v_self);
3619static CYTHON_INLINE
int __pyx_f_5numpy_9broadcast_7numiter___get__(PyArrayMultiIterObject *__pyx_v_self) {
3631 __pyx_r = PyArray_MultiIter_NUMITER(__pyx_v_self);
3656static CYTHON_INLINE npy_intp __pyx_f_5numpy_9broadcast_4size___get__(PyArrayMultiIterObject *__pyx_v_self) {
3668 __pyx_r = PyArray_MultiIter_SIZE(__pyx_v_self);
3693static CYTHON_INLINE npy_intp __pyx_f_5numpy_9broadcast_5index___get__(PyArrayMultiIterObject *__pyx_v_self) {
3705 __pyx_r = PyArray_MultiIter_INDEX(__pyx_v_self);
3730static CYTHON_INLINE
int __pyx_f_5numpy_9broadcast_2nd___get__(PyArrayMultiIterObject *__pyx_v_self) {
3742 __pyx_r = PyArray_MultiIter_NDIM(__pyx_v_self);
3767static CYTHON_INLINE npy_intp *__pyx_f_5numpy_9broadcast_10dimensions___get__(PyArrayMultiIterObject *__pyx_v_self) {
3779 __pyx_r = PyArray_MultiIter_DIMS(__pyx_v_self);
3804static CYTHON_INLINE
void **__pyx_f_5numpy_9broadcast_5iters___get__(PyArrayMultiIterObject *__pyx_v_self) {
3816 __pyx_r = PyArray_MultiIter_ITERS(__pyx_v_self);
3841static CYTHON_INLINE PyObject *__pyx_f_5numpy_7ndarray_4base___get__(PyArrayObject *__pyx_v_self) {
3853 __pyx_r = PyArray_BASE(__pyx_v_self);
3878static CYTHON_INLINE PyArray_Descr *__pyx_f_5numpy_7ndarray_5descr___get__(PyArrayObject *__pyx_v_self) {
3879 PyArray_Descr *__pyx_r = NULL;
3880 __Pyx_RefNannyDeclarations
3881 PyArray_Descr *__pyx_t_1;
3882 __Pyx_RefNannySetupContext(
"__get__", 0);
3891 __pyx_t_1 = PyArray_DESCR(__pyx_v_self);
3894 PyArray_Descr *__pyx_temp;
3896 __pyx_temp = __pyx_r;
3897 __Pyx_INCREF((PyObject *)((PyArray_Descr *)__pyx_t_1));
3898 __pyx_r = ((PyArray_Descr *)__pyx_t_1);
3900 __Pyx_XDECREF((PyObject *)__pyx_temp);
3915 __Pyx_XGIVEREF((PyObject *)__pyx_r);
3916 __Pyx_RefNannyFinishContext();
3928static CYTHON_INLINE
int __pyx_f_5numpy_7ndarray_4ndim___get__(PyArrayObject *__pyx_v_self) {
3940 __pyx_r = PyArray_NDIM(__pyx_v_self);
3965static CYTHON_INLINE npy_intp *__pyx_f_5numpy_7ndarray_5shape___get__(PyArrayObject *__pyx_v_self) {
3977 __pyx_r = PyArray_DIMS(__pyx_v_self);
4002static CYTHON_INLINE npy_intp *__pyx_f_5numpy_7ndarray_7strides___get__(PyArrayObject *__pyx_v_self) {
4014 __pyx_r = PyArray_STRIDES(__pyx_v_self);
4039static CYTHON_INLINE npy_intp __pyx_f_5numpy_7ndarray_4size___get__(PyArrayObject *__pyx_v_self) {
4051 __pyx_r = PyArray_SIZE(__pyx_v_self);
4076static CYTHON_INLINE
char *__pyx_f_5numpy_7ndarray_4data___get__(PyArrayObject *__pyx_v_self) {
4088 __pyx_r = PyArray_BYTES(__pyx_v_self);
4113static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew1(PyObject *__pyx_v_a) {
4114 PyObject *__pyx_r = NULL;
4115 __Pyx_RefNannyDeclarations
4116 PyObject *__pyx_t_1 = NULL;
4117 int __pyx_lineno = 0;
4118 const char *__pyx_filename = NULL;
4119 int __pyx_clineno = 0;
4120 __Pyx_RefNannySetupContext(
"PyArray_MultiIterNew1", 0);
4129 __pyx_t_1 = PyArray_MultiIterNew(1, ((
void *)__pyx_v_a));
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 795, __pyx_L1_error)
4130 __Pyx_GOTREF(__pyx_t_1);
4132 PyObject *__pyx_temp;
4134 __pyx_temp = __pyx_r;
4135 __pyx_r = __pyx_t_1;
4137 __Pyx_XDECREF(__pyx_temp);
4152 __Pyx_XDECREF(__pyx_t_1);
4153 __Pyx_AddTraceback(
"numpy.PyArray_MultiIterNew1", __pyx_clineno, __pyx_lineno, __pyx_filename);
4156 __Pyx_XGIVEREF(__pyx_r);
4157 __Pyx_RefNannyFinishContext();
4169static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew2(PyObject *__pyx_v_a, PyObject *__pyx_v_b) {
4170 PyObject *__pyx_r = NULL;
4171 __Pyx_RefNannyDeclarations
4172 PyObject *__pyx_t_1 = NULL;
4173 int __pyx_lineno = 0;
4174 const char *__pyx_filename = NULL;
4175 int __pyx_clineno = 0;
4176 __Pyx_RefNannySetupContext(
"PyArray_MultiIterNew2", 0);
4185 __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)
4186 __Pyx_GOTREF(__pyx_t_1);
4188 PyObject *__pyx_temp;
4190 __pyx_temp = __pyx_r;
4191 __pyx_r = __pyx_t_1;
4193 __Pyx_XDECREF(__pyx_temp);
4208 __Pyx_XDECREF(__pyx_t_1);
4209 __Pyx_AddTraceback(
"numpy.PyArray_MultiIterNew2", __pyx_clineno, __pyx_lineno, __pyx_filename);
4212 __Pyx_XGIVEREF(__pyx_r);
4213 __Pyx_RefNannyFinishContext();
4225static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew3(PyObject *__pyx_v_a, PyObject *__pyx_v_b, PyObject *__pyx_v_c) {
4226 PyObject *__pyx_r = NULL;
4227 __Pyx_RefNannyDeclarations
4228 PyObject *__pyx_t_1 = NULL;
4229 int __pyx_lineno = 0;
4230 const char *__pyx_filename = NULL;
4231 int __pyx_clineno = 0;
4232 __Pyx_RefNannySetupContext(
"PyArray_MultiIterNew3", 0);
4241 __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)
4242 __Pyx_GOTREF(__pyx_t_1);
4244 PyObject *__pyx_temp;
4246 __pyx_temp = __pyx_r;
4247 __pyx_r = __pyx_t_1;
4249 __Pyx_XDECREF(__pyx_temp);
4264 __Pyx_XDECREF(__pyx_t_1);
4265 __Pyx_AddTraceback(
"numpy.PyArray_MultiIterNew3", __pyx_clineno, __pyx_lineno, __pyx_filename);
4268 __Pyx_XGIVEREF(__pyx_r);
4269 __Pyx_RefNannyFinishContext();
4281static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew4(PyObject *__pyx_v_a, PyObject *__pyx_v_b, PyObject *__pyx_v_c, PyObject *__pyx_v_d) {
4282 PyObject *__pyx_r = NULL;
4283 __Pyx_RefNannyDeclarations
4284 PyObject *__pyx_t_1 = NULL;
4285 int __pyx_lineno = 0;
4286 const char *__pyx_filename = NULL;
4287 int __pyx_clineno = 0;
4288 __Pyx_RefNannySetupContext(
"PyArray_MultiIterNew4", 0);
4297 __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)
4298 __Pyx_GOTREF(__pyx_t_1);
4300 PyObject *__pyx_temp;
4302 __pyx_temp = __pyx_r;
4303 __pyx_r = __pyx_t_1;
4305 __Pyx_XDECREF(__pyx_temp);
4320 __Pyx_XDECREF(__pyx_t_1);
4321 __Pyx_AddTraceback(
"numpy.PyArray_MultiIterNew4", __pyx_clineno, __pyx_lineno, __pyx_filename);
4324 __Pyx_XGIVEREF(__pyx_r);
4325 __Pyx_RefNannyFinishContext();
4337static 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) {
4338 PyObject *__pyx_r = NULL;
4339 __Pyx_RefNannyDeclarations
4340 PyObject *__pyx_t_1 = NULL;
4341 int __pyx_lineno = 0;
4342 const char *__pyx_filename = NULL;
4343 int __pyx_clineno = 0;
4344 __Pyx_RefNannySetupContext(
"PyArray_MultiIterNew5", 0);
4353 __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)
4354 __Pyx_GOTREF(__pyx_t_1);
4356 PyObject *__pyx_temp;
4358 __pyx_temp = __pyx_r;
4359 __pyx_r = __pyx_t_1;
4361 __Pyx_XDECREF(__pyx_temp);
4376 __Pyx_XDECREF(__pyx_t_1);
4377 __Pyx_AddTraceback(
"numpy.PyArray_MultiIterNew5", __pyx_clineno, __pyx_lineno, __pyx_filename);
4380 __Pyx_XGIVEREF(__pyx_r);
4381 __Pyx_RefNannyFinishContext();
4393static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyDataType_SHAPE(PyArray_Descr *__pyx_v_d) {
4394 PyObject *__pyx_r = NULL;
4395 __Pyx_RefNannyDeclarations
4397 PyObject *__pyx_t_2;
4398 __Pyx_RefNannySetupContext(
"PyDataType_SHAPE", 0);
4407 __pyx_t_1 = PyDataType_HASSUBARRAY(__pyx_v_d);
4419 __pyx_t_2 = __pyx_f_5numpy_5dtype_8subarray___get__(__pyx_v_d)->shape;
4422 PyObject *__pyx_temp;
4424 __pyx_temp = __pyx_r;
4425 __Pyx_INCREF(((PyObject*)__pyx_t_2));
4426 __pyx_r = ((PyObject*)__pyx_t_2);
4428 __Pyx_XDECREF(__pyx_temp);
4451 PyObject *__pyx_temp;
4453 __pyx_temp = __pyx_r;
4454 __Pyx_INCREF(__pyx_mstate_global->__pyx_empty_tuple);
4455 __pyx_r = __pyx_mstate_global->__pyx_empty_tuple;
4457 __Pyx_XDECREF(__pyx_temp);
4472 __Pyx_XGIVEREF(__pyx_r);
4473 __Pyx_RefNannyFinishContext();
4485static CYTHON_INLINE
int __pyx_f_5numpy_5ufunc_3nin___get__(PyUFuncObject *__pyx_v_self) {
4497 __pyx_r = _PyUFuncObject_GET_ITEM_DATA(__pyx_v_self)->nin;
4522static CYTHON_INLINE
int __pyx_f_5numpy_5ufunc_4nout___get__(PyUFuncObject *__pyx_v_self) {
4534 __pyx_r = _PyUFuncObject_GET_ITEM_DATA(__pyx_v_self)->nout;
4559static CYTHON_INLINE
int __pyx_f_5numpy_5ufunc_5nargs___get__(PyUFuncObject *__pyx_v_self) {
4571 __pyx_r = _PyUFuncObject_GET_ITEM_DATA(__pyx_v_self)->nargs;
4596static CYTHON_INLINE PyUFuncGenericFunction *__pyx_f_5numpy_5ufunc_9functions___get__(PyUFuncObject *__pyx_v_self) {
4597 PyUFuncGenericFunction *__pyx_r;
4608 __pyx_r = _PyUFuncObject_GET_ITEM_DATA(__pyx_v_self)->functions;
4633static CYTHON_INLINE
void **__pyx_f_5numpy_5ufunc_4data___get__(PyUFuncObject *__pyx_v_self) {
4645 __pyx_r = ((
void **)_PyUFuncObject_GET_ITEM_DATA(__pyx_v_self)->data);
4670static CYTHON_INLINE
int __pyx_f_5numpy_5ufunc_6ntypes___get__(PyUFuncObject *__pyx_v_self) {
4682 __pyx_r = _PyUFuncObject_GET_ITEM_DATA(__pyx_v_self)->ntypes;
4707static CYTHON_INLINE
char const *__pyx_f_5numpy_5ufunc_4name___get__(PyUFuncObject *__pyx_v_self) {
4708 char const *__pyx_r;
4719 __pyx_r = _PyUFuncObject_GET_ITEM_DATA(__pyx_v_self)->name;
4744static CYTHON_INLINE
char const *__pyx_f_5numpy_5ufunc_3doc___get__(PyUFuncObject *__pyx_v_self) {
4745 char const *__pyx_r;
4756 __pyx_r = _PyUFuncObject_GET_ITEM_DATA(__pyx_v_self)->doc;
4781static CYTHON_INLINE
void *__pyx_f_5numpy_5ufunc_3ptr___get__(PyUFuncObject *__pyx_v_self) {
4793 __pyx_r = _PyUFuncObject_GET_ITEM_DATA(__pyx_v_self)->ptr;
4818static CYTHON_INLINE PyObject *__pyx_f_5numpy_5ufunc_3obj___get__(PyUFuncObject *__pyx_v_self) {
4830 __pyx_r = _PyUFuncObject_GET_ITEM_DATA(__pyx_v_self)->obj;
4855static CYTHON_INLINE PyObject *__pyx_f_5numpy_5ufunc_9userloops___get__(PyUFuncObject *__pyx_v_self) {
4867 __pyx_r = _PyUFuncObject_GET_ITEM_DATA(__pyx_v_self)->userloops;
4892static CYTHON_INLINE
void __pyx_f_5numpy_set_array_base(PyArrayObject *__pyx_v_arr, PyObject *__pyx_v_base) {
4894 int __pyx_lineno = 0;
4895 const char *__pyx_filename = NULL;
4896 int __pyx_clineno = 0;
4905 Py_INCREF(__pyx_v_base);
4914 __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)
4928 __Pyx_AddTraceback(
"numpy.set_array_base", __pyx_clineno, __pyx_lineno, __pyx_filename);
4941static CYTHON_INLINE PyObject *__pyx_f_5numpy_get_array_base(PyArrayObject *__pyx_v_arr) {
4942 PyObject *__pyx_v_base;
4943 PyObject *__pyx_r = NULL;
4944 __Pyx_RefNannyDeclarations
4946 __Pyx_RefNannySetupContext(
"get_array_base", 0);
4955 __pyx_v_base = PyArray_BASE(__pyx_v_arr);
4964 __pyx_t_1 = (__pyx_v_base == NULL);
4977 PyObject *__pyx_temp;
4979 __pyx_temp = __pyx_r;
4980 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
4982 __Pyx_XDECREF(__pyx_temp);
5003 PyObject *__pyx_temp;
5005 __pyx_temp = __pyx_r;
5006 __Pyx_INCREF(((PyObject *)__pyx_v_base));
5007 __pyx_r = ((PyObject *)__pyx_v_base);
5009 __Pyx_XDECREF(__pyx_temp);
5024 __Pyx_XGIVEREF(__pyx_r);
5025 __Pyx_RefNannyFinishContext();
5037static CYTHON_INLINE
int __pyx_f_5numpy_import_array(
void) {
5039 __Pyx_RefNannyDeclarations
5040 PyObject *__pyx_t_1 = NULL;
5041 PyObject *__pyx_t_2 = NULL;
5042 PyObject *__pyx_t_3 = NULL;
5044 PyObject *__pyx_t_5 = NULL;
5045 PyObject *__pyx_t_6 = NULL;
5046 PyObject *__pyx_t_7 = NULL;
5047 PyObject *__pyx_t_8 = NULL;
5048 PyObject *__pyx_t_9 = NULL;
5050 int __pyx_lineno = 0;
5051 const char *__pyx_filename = NULL;
5052 int __pyx_clineno = 0;
5053 __Pyx_RefNannySetupContext(
"import_array", 0);
5063 __Pyx_PyThreadState_declare
5064 __Pyx_PyThreadState_assign
5065 __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
5066 __Pyx_XGOTREF(__pyx_t_1);
5067 __Pyx_XGOTREF(__pyx_t_2);
5068 __Pyx_XGOTREF(__pyx_t_3);
5078 __pyx_t_4 = _import_array();
if (unlikely(__pyx_t_4 == ((
int)-1))) __PYX_ERR(1, 1079, __pyx_L3_error)
5089 __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
5090 __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
5091 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
5092 goto __pyx_L8_try_end;
5102 __pyx_t_4 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(((PyTypeObject*)PyExc_Exception))));
5104 __Pyx_AddTraceback(
"numpy.import_array", __pyx_clineno, __pyx_lineno, __pyx_filename);
5105 if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(1, 1080, __pyx_L5_except_error)
5106 __Pyx_XGOTREF(__pyx_t_5);
5107 __Pyx_XGOTREF(__pyx_t_6);
5108 __Pyx_XGOTREF(__pyx_t_7);
5120 PyObject *__pyx_callargs[2] = {__pyx_t_9, __pyx_mstate_global->__pyx_kp_u_numpy__core_multiarray_failed_to};
5121 __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));
5122 __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
5123 if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 1081, __pyx_L5_except_error)
5124 __Pyx_GOTREF(__pyx_t_8);
5126 __Pyx_Raise(__pyx_t_8, 0, 0, 0);
5127 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
5128 __PYX_ERR(1, 1081, __pyx_L5_except_error)
5130 goto __pyx_L5_except_error;
5139 __pyx_L5_except_error:;
5140 __Pyx_XGIVEREF(__pyx_t_1);
5141 __Pyx_XGIVEREF(__pyx_t_2);
5142 __Pyx_XGIVEREF(__pyx_t_3);
5143 __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
5144 goto __pyx_L1_error;
5160 __Pyx_XDECREF(__pyx_t_5);
5161 __Pyx_XDECREF(__pyx_t_6);
5162 __Pyx_XDECREF(__pyx_t_7);
5163 __Pyx_XDECREF(__pyx_t_8);
5164 __Pyx_XDECREF(__pyx_t_9);
5165 __Pyx_AddTraceback(
"numpy.import_array", __pyx_clineno, __pyx_lineno, __pyx_filename);
5169 __Pyx_RefNannyFinishContext();
5181static CYTHON_INLINE
int __pyx_f_5numpy_import_umath(
void) {
5183 __Pyx_RefNannyDeclarations
5184 PyObject *__pyx_t_1 = NULL;
5185 PyObject *__pyx_t_2 = NULL;
5186 PyObject *__pyx_t_3 = NULL;
5188 PyObject *__pyx_t_5 = NULL;
5189 PyObject *__pyx_t_6 = NULL;
5190 PyObject *__pyx_t_7 = NULL;
5191 PyObject *__pyx_t_8 = NULL;
5192 PyObject *__pyx_t_9 = NULL;
5194 int __pyx_lineno = 0;
5195 const char *__pyx_filename = NULL;
5196 int __pyx_clineno = 0;
5197 __Pyx_RefNannySetupContext(
"import_umath", 0);
5207 __Pyx_PyThreadState_declare
5208 __Pyx_PyThreadState_assign
5209 __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
5210 __Pyx_XGOTREF(__pyx_t_1);
5211 __Pyx_XGOTREF(__pyx_t_2);
5212 __Pyx_XGOTREF(__pyx_t_3);
5222 __pyx_t_4 = _import_umath();
if (unlikely(__pyx_t_4 == ((
int)-1))) __PYX_ERR(1, 1085, __pyx_L3_error)
5233 __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
5234 __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
5235 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
5236 goto __pyx_L8_try_end;
5246 __pyx_t_4 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(((PyTypeObject*)PyExc_Exception))));
5248 __Pyx_AddTraceback(
"numpy.import_umath", __pyx_clineno, __pyx_lineno, __pyx_filename);
5249 if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(1, 1086, __pyx_L5_except_error)
5250 __Pyx_XGOTREF(__pyx_t_5);
5251 __Pyx_XGOTREF(__pyx_t_6);
5252 __Pyx_XGOTREF(__pyx_t_7);
5264 PyObject *__pyx_callargs[2] = {__pyx_t_9, __pyx_mstate_global->__pyx_kp_u_numpy__core_umath_failed_to_impo};
5265 __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));
5266 __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
5267 if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 1087, __pyx_L5_except_error)
5268 __Pyx_GOTREF(__pyx_t_8);
5270 __Pyx_Raise(__pyx_t_8, 0, 0, 0);
5271 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
5272 __PYX_ERR(1, 1087, __pyx_L5_except_error)
5274 goto __pyx_L5_except_error;
5283 __pyx_L5_except_error:;
5284 __Pyx_XGIVEREF(__pyx_t_1);
5285 __Pyx_XGIVEREF(__pyx_t_2);
5286 __Pyx_XGIVEREF(__pyx_t_3);
5287 __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
5288 goto __pyx_L1_error;
5304 __Pyx_XDECREF(__pyx_t_5);
5305 __Pyx_XDECREF(__pyx_t_6);
5306 __Pyx_XDECREF(__pyx_t_7);
5307 __Pyx_XDECREF(__pyx_t_8);
5308 __Pyx_XDECREF(__pyx_t_9);
5309 __Pyx_AddTraceback(
"numpy.import_umath", __pyx_clineno, __pyx_lineno, __pyx_filename);
5313 __Pyx_RefNannyFinishContext();
5325static CYTHON_INLINE
int __pyx_f_5numpy_import_ufunc(
void) {
5327 __Pyx_RefNannyDeclarations
5328 PyObject *__pyx_t_1 = NULL;
5329 PyObject *__pyx_t_2 = NULL;
5330 PyObject *__pyx_t_3 = NULL;
5332 PyObject *__pyx_t_5 = NULL;
5333 PyObject *__pyx_t_6 = NULL;
5334 PyObject *__pyx_t_7 = NULL;
5335 PyObject *__pyx_t_8 = NULL;
5336 PyObject *__pyx_t_9 = NULL;
5338 int __pyx_lineno = 0;
5339 const char *__pyx_filename = NULL;
5340 int __pyx_clineno = 0;
5341 __Pyx_RefNannySetupContext(
"import_ufunc", 0);
5351 __Pyx_PyThreadState_declare
5352 __Pyx_PyThreadState_assign
5353 __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
5354 __Pyx_XGOTREF(__pyx_t_1);
5355 __Pyx_XGOTREF(__pyx_t_2);
5356 __Pyx_XGOTREF(__pyx_t_3);
5366 __pyx_t_4 = _import_umath();
if (unlikely(__pyx_t_4 == ((
int)-1))) __PYX_ERR(1, 1091, __pyx_L3_error)
5377 __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
5378 __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
5379 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
5380 goto __pyx_L8_try_end;
5390 __pyx_t_4 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(((PyTypeObject*)PyExc_Exception))));
5392 __Pyx_AddTraceback(
"numpy.import_ufunc", __pyx_clineno, __pyx_lineno, __pyx_filename);
5393 if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(1, 1092, __pyx_L5_except_error)
5394 __Pyx_XGOTREF(__pyx_t_5);
5395 __Pyx_XGOTREF(__pyx_t_6);
5396 __Pyx_XGOTREF(__pyx_t_7);
5408 PyObject *__pyx_callargs[2] = {__pyx_t_9, __pyx_mstate_global->__pyx_kp_u_numpy__core_umath_failed_to_impo};
5409 __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));
5410 __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
5411 if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 1093, __pyx_L5_except_error)
5412 __Pyx_GOTREF(__pyx_t_8);
5414 __Pyx_Raise(__pyx_t_8, 0, 0, 0);
5415 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
5416 __PYX_ERR(1, 1093, __pyx_L5_except_error)
5418 goto __pyx_L5_except_error;
5427 __pyx_L5_except_error:;
5428 __Pyx_XGIVEREF(__pyx_t_1);
5429 __Pyx_XGIVEREF(__pyx_t_2);
5430 __Pyx_XGIVEREF(__pyx_t_3);
5431 __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
5432 goto __pyx_L1_error;
5448 __Pyx_XDECREF(__pyx_t_5);
5449 __Pyx_XDECREF(__pyx_t_6);
5450 __Pyx_XDECREF(__pyx_t_7);
5451 __Pyx_XDECREF(__pyx_t_8);
5452 __Pyx_XDECREF(__pyx_t_9);
5453 __Pyx_AddTraceback(
"numpy.import_ufunc", __pyx_clineno, __pyx_lineno, __pyx_filename);
5457 __Pyx_RefNannyFinishContext();
5469static CYTHON_INLINE
int __pyx_f_5numpy_is_timedelta64_object(PyObject *__pyx_v_obj) {
5481 __pyx_r = PyObject_TypeCheck(__pyx_v_obj, (&PyTimedeltaArrType_Type));
5507static CYTHON_INLINE
int __pyx_f_5numpy_is_datetime64_object(PyObject *__pyx_v_obj) {
5519 __pyx_r = PyObject_TypeCheck(__pyx_v_obj, (&PyDatetimeArrType_Type));
5545static CYTHON_INLINE npy_datetime __pyx_f_5numpy_get_datetime64_value(PyObject *__pyx_v_obj) {
5546 npy_datetime __pyx_r;
5557 __pyx_r = _PyDatetimeScalarObject_GetValue(__pyx_v_obj);
5582static CYTHON_INLINE npy_timedelta __pyx_f_5numpy_get_timedelta64_value(PyObject *__pyx_v_obj) {
5583 npy_timedelta __pyx_r;
5594 __pyx_r = _PyTimedeltaScalarObject_GetValue(__pyx_v_obj);
5619static CYTHON_INLINE NPY_DATETIMEUNIT __pyx_f_5numpy_get_datetime64_unit(PyObject *__pyx_v_obj) {
5620 NPY_DATETIMEUNIT __pyx_r;
5631 __pyx_r = _PyDatetimeScalarObject_GetMetadata(__pyx_v_obj).base;
5657static PyObject *__pyx_pw_15cshockCapturing_1calculateNumericalDiffusionResGrad(PyObject *__pyx_self,
5658#
if CYTHON_VECTORCALL
5659PyObject *
const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
5661PyObject *__pyx_args, PyObject *__pyx_kwds
5664static PyMethodDef __pyx_mdef_15cshockCapturing_1calculateNumericalDiffusionResGrad = {
"calculateNumericalDiffusionResGrad", (PyCFunction)(
void(*)(
void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_15cshockCapturing_1calculateNumericalDiffusionResGrad, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
5665static PyObject *__pyx_pw_15cshockCapturing_1calculateNumericalDiffusionResGrad(PyObject *__pyx_self,
5666#
if CYTHON_VECTORCALL
5667PyObject *
const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
5669PyObject *__pyx_args, PyObject *__pyx_kwds
5672 double __pyx_v_shockCapturingDiffusion;
5673 PyArrayObject *__pyx_v_elementDiameter = 0;
5674 PyArrayObject *__pyx_v_strong_residual = 0;
5675 PyArrayObject *__pyx_v_grad_u = 0;
5676 PyArrayObject *__pyx_v_numDiff = 0;
5677 #if !CYTHON_VECTORCALL
5678 CYTHON_UNUSED Py_ssize_t __pyx_nargs;
5680 CYTHON_UNUSED PyObject *
const *__pyx_kwvalues;
5681 PyObject* values[5] = {0,0,0,0,0};
5682 int __pyx_lineno = 0;
5683 const char *__pyx_filename = NULL;
5684 int __pyx_clineno = 0;
5685 PyObject *__pyx_r = 0;
5686 __Pyx_RefNannyDeclarations
5687 __Pyx_RefNannySetupContext(
"calculateNumericalDiffusionResGrad (wrapper)", 0);
5688 #if !CYTHON_VECTORCALL
5689 #if CYTHON_ASSUME_SAFE_SIZE
5690 __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
5692 __pyx_nargs = PyTuple_Size(__pyx_args);
if (unlikely(__pyx_nargs < 0))
return NULL;
5695 __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
5697 PyObject **
const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_shockCapturingDiffusion,&__pyx_mstate_global->__pyx_n_u_elementDiameter,&__pyx_mstate_global->__pyx_n_u_strong_residual,&__pyx_mstate_global->__pyx_n_u_grad_u,&__pyx_mstate_global->__pyx_n_u_numDiff,0};
5698 const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
5699 if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(0, 74, __pyx_L3_error)
5700 if (__pyx_kwds_len > 0) {
5701 switch (__pyx_nargs) {
5703 values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
5704 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 74, __pyx_L3_error)
5707 values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
5708 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 74, __pyx_L3_error)
5711 values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
5712 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 74, __pyx_L3_error)
5715 values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
5716 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 74, __pyx_L3_error)
5719 values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
5720 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 74, __pyx_L3_error)
5723 default:
goto __pyx_L5_argtuple_error;
5725 const Py_ssize_t kwd_pos_args = __pyx_nargs;
5726 if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len,
"calculateNumericalDiffusionResGrad", 0) < (0)) __PYX_ERR(0, 74, __pyx_L3_error)
5727 for (Py_ssize_t i = __pyx_nargs; i < 5; i++) {
5728 if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid(
"calculateNumericalDiffusionResGrad", 1, 5, 5, i); __PYX_ERR(0, 74, __pyx_L3_error) }
5730 }
else if (unlikely(__pyx_nargs != 5)) {
5731 goto __pyx_L5_argtuple_error;
5733 values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
5734 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 74, __pyx_L3_error)
5735 values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
5736 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 74, __pyx_L3_error)
5737 values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
5738 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 74, __pyx_L3_error)
5739 values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
5740 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 74, __pyx_L3_error)
5741 values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
5742 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 74, __pyx_L3_error)
5744 __pyx_v_shockCapturingDiffusion = __Pyx_PyFloat_AsDouble(values[0]);
if (unlikely((__pyx_v_shockCapturingDiffusion == (
double)-1) && PyErr_Occurred())) __PYX_ERR(0, 74, __pyx_L3_error)
5745 __pyx_v_elementDiameter = ((PyArrayObject *)values[1]);
5746 __pyx_v_strong_residual = ((PyArrayObject *)values[2]);
5747 __pyx_v_grad_u = ((PyArrayObject *)values[3]);
5748 __pyx_v_numDiff = ((PyArrayObject *)values[4]);
5751 __pyx_L5_argtuple_error:;
5752 __Pyx_RaiseArgtupleInvalid(
"calculateNumericalDiffusionResGrad", 1, 5, 5, __pyx_nargs); __PYX_ERR(0, 74, __pyx_L3_error)
5754 goto __pyx_L4_argument_unpacking_done;
5756 for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(
sizeof(values)/
sizeof(values[0])); ++__pyx_temp) {
5757 Py_XDECREF(values[__pyx_temp]);
5759 __Pyx_AddTraceback(
"cshockCapturing.calculateNumericalDiffusionResGrad", __pyx_clineno, __pyx_lineno, __pyx_filename);
5760 __Pyx_RefNannyFinishContext();
5762 __pyx_L4_argument_unpacking_done:;
5763 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_elementDiameter), __pyx_mstate_global->__pyx_ptype_5numpy_ndarray, 1,
"elementDiameter", 0))) __PYX_ERR(0, 75, __pyx_L1_error)
5764 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_strong_residual), __pyx_mstate_global->__pyx_ptype_5numpy_ndarray, 1,
"strong_residual", 0))) __PYX_ERR(0, 76, __pyx_L1_error)
5765 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_grad_u), __pyx_mstate_global->__pyx_ptype_5numpy_ndarray, 1,
"grad_u", 0))) __PYX_ERR(0, 77, __pyx_L1_error)
5766 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_numDiff), __pyx_mstate_global->__pyx_ptype_5numpy_ndarray, 1,
"numDiff", 0))) __PYX_ERR(0, 78, __pyx_L1_error)
5767 __pyx_r = __pyx_pf_15cshockCapturing_calculateNumericalDiffusionResGrad(__pyx_self, __pyx_v_shockCapturingDiffusion, __pyx_v_elementDiameter, __pyx_v_strong_residual, __pyx_v_grad_u, __pyx_v_numDiff);
5773 for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(
sizeof(values)/
sizeof(values[0])); ++__pyx_temp) {
5774 Py_XDECREF(values[__pyx_temp]);
5776 goto __pyx_L7_cleaned_up;
5778 for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(
sizeof(values)/
sizeof(values[0])); ++__pyx_temp) {
5779 Py_XDECREF(values[__pyx_temp]);
5781 __pyx_L7_cleaned_up:;
5783 __Pyx_RefNannyFinishContext();
5787static PyObject *__pyx_pf_15cshockCapturing_calculateNumericalDiffusionResGrad(CYTHON_UNUSED PyObject *__pyx_self,
double __pyx_v_shockCapturingDiffusion, PyArrayObject *__pyx_v_elementDiameter, PyArrayObject *__pyx_v_strong_residual, PyArrayObject *__pyx_v_grad_u, PyArrayObject *__pyx_v_numDiff) {
5788 PyObject *__pyx_r = NULL;
5789 __Pyx_RefNannyDeclarations
5790 __Pyx_RefNannySetupContext(
"calculateNumericalDiffusionResGrad", 0);
5799 calculateNumericalDiffusionResGrad((__pyx_f_5numpy_7ndarray_5shape___get__(__pyx_v_grad_u)[0]), (__pyx_f_5numpy_7ndarray_5shape___get__(__pyx_v_grad_u)[1]), (__pyx_f_5numpy_7ndarray_5shape___get__(__pyx_v_grad_u)[2]), __pyx_v_shockCapturingDiffusion, ((
double *)__pyx_f_5numpy_7ndarray_4data___get__(__pyx_v_elementDiameter)), ((
double *)__pyx_f_5numpy_7ndarray_4data___get__(__pyx_v_strong_residual)), ((
double *)__pyx_f_5numpy_7ndarray_4data___get__(__pyx_v_grad_u)), ((
double *)__pyx_f_5numpy_7ndarray_4data___get__(__pyx_v_numDiff)));
5810 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
5811 __Pyx_XGIVEREF(__pyx_r);
5812 __Pyx_RefNannyFinishContext();
5825static PyObject *__pyx_pw_15cshockCapturing_3calculateNumericalDiffusionResGradQuad(PyObject *__pyx_self,
5826#
if CYTHON_VECTORCALL
5827PyObject *
const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
5829PyObject *__pyx_args, PyObject *__pyx_kwds
5832static PyMethodDef __pyx_mdef_15cshockCapturing_3calculateNumericalDiffusionResGradQuad = {
"calculateNumericalDiffusionResGradQuad", (PyCFunction)(
void(*)(
void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_15cshockCapturing_3calculateNumericalDiffusionResGradQuad, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
5833static PyObject *__pyx_pw_15cshockCapturing_3calculateNumericalDiffusionResGradQuad(PyObject *__pyx_self,
5834#
if CYTHON_VECTORCALL
5835PyObject *
const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
5837PyObject *__pyx_args, PyObject *__pyx_kwds
5840 double __pyx_v_shockCapturingDiffusion;
5841 PyArrayObject *__pyx_v_elementDiameter = 0;
5842 PyArrayObject *__pyx_v_strong_residual = 0;
5843 PyArrayObject *__pyx_v_grad_u = 0;
5844 PyArrayObject *__pyx_v_numDiff = 0;
5845 #if !CYTHON_VECTORCALL
5846 CYTHON_UNUSED Py_ssize_t __pyx_nargs;
5848 CYTHON_UNUSED PyObject *
const *__pyx_kwvalues;
5849 PyObject* values[5] = {0,0,0,0,0};
5850 int __pyx_lineno = 0;
5851 const char *__pyx_filename = NULL;
5852 int __pyx_clineno = 0;
5853 PyObject *__pyx_r = 0;
5854 __Pyx_RefNannyDeclarations
5855 __Pyx_RefNannySetupContext(
"calculateNumericalDiffusionResGradQuad (wrapper)", 0);
5856 #if !CYTHON_VECTORCALL
5857 #if CYTHON_ASSUME_SAFE_SIZE
5858 __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
5860 __pyx_nargs = PyTuple_Size(__pyx_args);
if (unlikely(__pyx_nargs < 0))
return NULL;
5863 __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
5865 PyObject **
const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_shockCapturingDiffusion,&__pyx_mstate_global->__pyx_n_u_elementDiameter,&__pyx_mstate_global->__pyx_n_u_strong_residual,&__pyx_mstate_global->__pyx_n_u_grad_u,&__pyx_mstate_global->__pyx_n_u_numDiff,0};
5866 const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
5867 if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(0, 87, __pyx_L3_error)
5868 if (__pyx_kwds_len > 0) {
5869 switch (__pyx_nargs) {
5871 values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
5872 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 87, __pyx_L3_error)
5875 values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
5876 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 87, __pyx_L3_error)
5879 values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
5880 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 87, __pyx_L3_error)
5883 values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
5884 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 87, __pyx_L3_error)
5887 values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
5888 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 87, __pyx_L3_error)
5891 default:
goto __pyx_L5_argtuple_error;
5893 const Py_ssize_t kwd_pos_args = __pyx_nargs;
5894 if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len,
"calculateNumericalDiffusionResGradQuad", 0) < (0)) __PYX_ERR(0, 87, __pyx_L3_error)
5895 for (Py_ssize_t i = __pyx_nargs; i < 5; i++) {
5896 if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid(
"calculateNumericalDiffusionResGradQuad", 1, 5, 5, i); __PYX_ERR(0, 87, __pyx_L3_error) }
5898 }
else if (unlikely(__pyx_nargs != 5)) {
5899 goto __pyx_L5_argtuple_error;
5901 values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
5902 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 87, __pyx_L3_error)
5903 values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
5904 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 87, __pyx_L3_error)
5905 values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
5906 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 87, __pyx_L3_error)
5907 values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
5908 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 87, __pyx_L3_error)
5909 values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
5910 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 87, __pyx_L3_error)
5912 __pyx_v_shockCapturingDiffusion = __Pyx_PyFloat_AsDouble(values[0]);
if (unlikely((__pyx_v_shockCapturingDiffusion == (
double)-1) && PyErr_Occurred())) __PYX_ERR(0, 87, __pyx_L3_error)
5913 __pyx_v_elementDiameter = ((PyArrayObject *)values[1]);
5914 __pyx_v_strong_residual = ((PyArrayObject *)values[2]);
5915 __pyx_v_grad_u = ((PyArrayObject *)values[3]);
5916 __pyx_v_numDiff = ((PyArrayObject *)values[4]);
5919 __pyx_L5_argtuple_error:;
5920 __Pyx_RaiseArgtupleInvalid(
"calculateNumericalDiffusionResGradQuad", 1, 5, 5, __pyx_nargs); __PYX_ERR(0, 87, __pyx_L3_error)
5922 goto __pyx_L4_argument_unpacking_done;
5924 for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(
sizeof(values)/
sizeof(values[0])); ++__pyx_temp) {
5925 Py_XDECREF(values[__pyx_temp]);
5927 __Pyx_AddTraceback(
"cshockCapturing.calculateNumericalDiffusionResGradQuad", __pyx_clineno, __pyx_lineno, __pyx_filename);
5928 __Pyx_RefNannyFinishContext();
5930 __pyx_L4_argument_unpacking_done:;
5931 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_elementDiameter), __pyx_mstate_global->__pyx_ptype_5numpy_ndarray, 1,
"elementDiameter", 0))) __PYX_ERR(0, 88, __pyx_L1_error)
5932 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_strong_residual), __pyx_mstate_global->__pyx_ptype_5numpy_ndarray, 1,
"strong_residual", 0))) __PYX_ERR(0, 89, __pyx_L1_error)
5933 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_grad_u), __pyx_mstate_global->__pyx_ptype_5numpy_ndarray, 1,
"grad_u", 0))) __PYX_ERR(0, 90, __pyx_L1_error)
5934 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_numDiff), __pyx_mstate_global->__pyx_ptype_5numpy_ndarray, 1,
"numDiff", 0))) __PYX_ERR(0, 91, __pyx_L1_error)
5935 __pyx_r = __pyx_pf_15cshockCapturing_2calculateNumericalDiffusionResGradQuad(__pyx_self, __pyx_v_shockCapturingDiffusion, __pyx_v_elementDiameter, __pyx_v_strong_residual, __pyx_v_grad_u, __pyx_v_numDiff);
5941 for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(
sizeof(values)/
sizeof(values[0])); ++__pyx_temp) {
5942 Py_XDECREF(values[__pyx_temp]);
5944 goto __pyx_L7_cleaned_up;
5946 for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(
sizeof(values)/
sizeof(values[0])); ++__pyx_temp) {
5947 Py_XDECREF(values[__pyx_temp]);
5949 __pyx_L7_cleaned_up:;
5951 __Pyx_RefNannyFinishContext();
5955static PyObject *__pyx_pf_15cshockCapturing_2calculateNumericalDiffusionResGradQuad(CYTHON_UNUSED PyObject *__pyx_self,
double __pyx_v_shockCapturingDiffusion, PyArrayObject *__pyx_v_elementDiameter, PyArrayObject *__pyx_v_strong_residual, PyArrayObject *__pyx_v_grad_u, PyArrayObject *__pyx_v_numDiff) {
5956 PyObject *__pyx_r = NULL;
5957 __Pyx_RefNannyDeclarations
5958 __Pyx_RefNannySetupContext(
"calculateNumericalDiffusionResGradQuad", 0);
5967 calculateNumericalDiffusionResGradQuad((__pyx_f_5numpy_7ndarray_5shape___get__(__pyx_v_grad_u)[0]), (__pyx_f_5numpy_7ndarray_5shape___get__(__pyx_v_grad_u)[1]), (__pyx_f_5numpy_7ndarray_5shape___get__(__pyx_v_grad_u)[2]), __pyx_v_shockCapturingDiffusion, ((
double *)__pyx_f_5numpy_7ndarray_4data___get__(__pyx_v_elementDiameter)), ((
double *)__pyx_f_5numpy_7ndarray_4data___get__(__pyx_v_strong_residual)), ((
double *)__pyx_f_5numpy_7ndarray_4data___get__(__pyx_v_grad_u)), ((
double *)__pyx_f_5numpy_7ndarray_4data___get__(__pyx_v_numDiff)));
5978 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
5979 __Pyx_XGIVEREF(__pyx_r);
5980 __Pyx_RefNannyFinishContext();
5993static PyObject *__pyx_pw_15cshockCapturing_5calculateNumericalDiffusionEikonal(PyObject *__pyx_self,
5994#
if CYTHON_VECTORCALL
5995PyObject *
const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
5997PyObject *__pyx_args, PyObject *__pyx_kwds
6000static PyMethodDef __pyx_mdef_15cshockCapturing_5calculateNumericalDiffusionEikonal = {
"calculateNumericalDiffusionEikonal", (PyCFunction)(
void(*)(
void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_15cshockCapturing_5calculateNumericalDiffusionEikonal, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
6001static PyObject *__pyx_pw_15cshockCapturing_5calculateNumericalDiffusionEikonal(PyObject *__pyx_self,
6002#
if CYTHON_VECTORCALL
6003PyObject *
const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
6005PyObject *__pyx_args, PyObject *__pyx_kwds
6008 double __pyx_v_shockCapturingDiffusion;
6009 PyArrayObject *__pyx_v_elementDiameter = 0;
6010 PyArrayObject *__pyx_v_strong_residual = 0;
6011 PyArrayObject *__pyx_v_numDiff = 0;
6012 #if !CYTHON_VECTORCALL
6013 CYTHON_UNUSED Py_ssize_t __pyx_nargs;
6015 CYTHON_UNUSED PyObject *
const *__pyx_kwvalues;
6016 PyObject* values[4] = {0,0,0,0};
6017 int __pyx_lineno = 0;
6018 const char *__pyx_filename = NULL;
6019 int __pyx_clineno = 0;
6020 PyObject *__pyx_r = 0;
6021 __Pyx_RefNannyDeclarations
6022 __Pyx_RefNannySetupContext(
"calculateNumericalDiffusionEikonal (wrapper)", 0);
6023 #if !CYTHON_VECTORCALL
6024 #if CYTHON_ASSUME_SAFE_SIZE
6025 __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
6027 __pyx_nargs = PyTuple_Size(__pyx_args);
if (unlikely(__pyx_nargs < 0))
return NULL;
6030 __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
6032 PyObject **
const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_shockCapturingDiffusion,&__pyx_mstate_global->__pyx_n_u_elementDiameter,&__pyx_mstate_global->__pyx_n_u_strong_residual,&__pyx_mstate_global->__pyx_n_u_numDiff,0};
6033 const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
6034 if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(0, 100, __pyx_L3_error)
6035 if (__pyx_kwds_len > 0) {
6036 switch (__pyx_nargs) {
6038 values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
6039 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 100, __pyx_L3_error)
6042 values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
6043 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 100, __pyx_L3_error)
6046 values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
6047 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 100, __pyx_L3_error)
6050 values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
6051 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 100, __pyx_L3_error)
6054 default:
goto __pyx_L5_argtuple_error;
6056 const Py_ssize_t kwd_pos_args = __pyx_nargs;
6057 if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len,
"calculateNumericalDiffusionEikonal", 0) < (0)) __PYX_ERR(0, 100, __pyx_L3_error)
6058 for (Py_ssize_t i = __pyx_nargs; i < 4; i++) {
6059 if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid(
"calculateNumericalDiffusionEikonal", 1, 4, 4, i); __PYX_ERR(0, 100, __pyx_L3_error) }
6061 }
else if (unlikely(__pyx_nargs != 4)) {
6062 goto __pyx_L5_argtuple_error;
6064 values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
6065 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 100, __pyx_L3_error)
6066 values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
6067 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 100, __pyx_L3_error)
6068 values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
6069 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 100, __pyx_L3_error)
6070 values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
6071 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 100, __pyx_L3_error)
6073 __pyx_v_shockCapturingDiffusion = __Pyx_PyFloat_AsDouble(values[0]);
if (unlikely((__pyx_v_shockCapturingDiffusion == (
double)-1) && PyErr_Occurred())) __PYX_ERR(0, 100, __pyx_L3_error)
6074 __pyx_v_elementDiameter = ((PyArrayObject *)values[1]);
6075 __pyx_v_strong_residual = ((PyArrayObject *)values[2]);
6076 __pyx_v_numDiff = ((PyArrayObject *)values[3]);
6079 __pyx_L5_argtuple_error:;
6080 __Pyx_RaiseArgtupleInvalid(
"calculateNumericalDiffusionEikonal", 1, 4, 4, __pyx_nargs); __PYX_ERR(0, 100, __pyx_L3_error)
6082 goto __pyx_L4_argument_unpacking_done;
6084 for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(
sizeof(values)/
sizeof(values[0])); ++__pyx_temp) {
6085 Py_XDECREF(values[__pyx_temp]);
6087 __Pyx_AddTraceback(
"cshockCapturing.calculateNumericalDiffusionEikonal", __pyx_clineno, __pyx_lineno, __pyx_filename);
6088 __Pyx_RefNannyFinishContext();
6090 __pyx_L4_argument_unpacking_done:;
6091 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_elementDiameter), __pyx_mstate_global->__pyx_ptype_5numpy_ndarray, 1,
"elementDiameter", 0))) __PYX_ERR(0, 101, __pyx_L1_error)
6092 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_strong_residual), __pyx_mstate_global->__pyx_ptype_5numpy_ndarray, 1,
"strong_residual", 0))) __PYX_ERR(0, 102, __pyx_L1_error)
6093 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_numDiff), __pyx_mstate_global->__pyx_ptype_5numpy_ndarray, 1,
"numDiff", 0))) __PYX_ERR(0, 103, __pyx_L1_error)
6094 __pyx_r = __pyx_pf_15cshockCapturing_4calculateNumericalDiffusionEikonal(__pyx_self, __pyx_v_shockCapturingDiffusion, __pyx_v_elementDiameter, __pyx_v_strong_residual, __pyx_v_numDiff);
6100 for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(
sizeof(values)/
sizeof(values[0])); ++__pyx_temp) {
6101 Py_XDECREF(values[__pyx_temp]);
6103 goto __pyx_L7_cleaned_up;
6105 for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(
sizeof(values)/
sizeof(values[0])); ++__pyx_temp) {
6106 Py_XDECREF(values[__pyx_temp]);
6108 __pyx_L7_cleaned_up:;
6110 __Pyx_RefNannyFinishContext();
6114static PyObject *__pyx_pf_15cshockCapturing_4calculateNumericalDiffusionEikonal(CYTHON_UNUSED PyObject *__pyx_self,
double __pyx_v_shockCapturingDiffusion, PyArrayObject *__pyx_v_elementDiameter, PyArrayObject *__pyx_v_strong_residual, PyArrayObject *__pyx_v_numDiff) {
6115 PyObject *__pyx_r = NULL;
6116 __Pyx_RefNannyDeclarations
6117 __Pyx_RefNannySetupContext(
"calculateNumericalDiffusionEikonal", 0);
6126 calculateNumericalDiffusionEikonal((__pyx_f_5numpy_7ndarray_5shape___get__(__pyx_v_numDiff)[0]), (__pyx_f_5numpy_7ndarray_5shape___get__(__pyx_v_numDiff)[1]), __pyx_v_shockCapturingDiffusion, ((
double *)__pyx_f_5numpy_7ndarray_4data___get__(__pyx_v_elementDiameter)), ((
double *)__pyx_f_5numpy_7ndarray_4data___get__(__pyx_v_strong_residual)), ((
double *)__pyx_f_5numpy_7ndarray_4data___get__(__pyx_v_numDiff)));
6137 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
6138 __Pyx_XGIVEREF(__pyx_r);
6139 __Pyx_RefNannyFinishContext();
6152static PyObject *__pyx_pw_15cshockCapturing_7calculateNumericalDiffusionHJ(PyObject *__pyx_self,
6153#
if CYTHON_VECTORCALL
6154PyObject *
const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
6156PyObject *__pyx_args, PyObject *__pyx_kwds
6159static PyMethodDef __pyx_mdef_15cshockCapturing_7calculateNumericalDiffusionHJ = {
"calculateNumericalDiffusionHJ", (PyCFunction)(
void(*)(
void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_15cshockCapturing_7calculateNumericalDiffusionHJ, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
6160static PyObject *__pyx_pw_15cshockCapturing_7calculateNumericalDiffusionHJ(PyObject *__pyx_self,
6161#
if CYTHON_VECTORCALL
6162PyObject *
const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
6164PyObject *__pyx_args, PyObject *__pyx_kwds
6167 char __pyx_v_shockCapturing;
6168 double __pyx_v_shockCapturingDiffusion;
6169 PyArrayObject *__pyx_v_elementDiameter = 0;
6170 PyArrayObject *__pyx_v_strong_residual = 0;
6171 PyArrayObject *__pyx_v_mt = 0;
6172 PyArrayObject *__pyx_v_H = 0;
6173 PyArrayObject *__pyx_v_numDiff = 0;
6174 #if !CYTHON_VECTORCALL
6175 CYTHON_UNUSED Py_ssize_t __pyx_nargs;
6177 CYTHON_UNUSED PyObject *
const *__pyx_kwvalues;
6178 PyObject* values[7] = {0,0,0,0,0,0,0};
6179 int __pyx_lineno = 0;
6180 const char *__pyx_filename = NULL;
6181 int __pyx_clineno = 0;
6182 PyObject *__pyx_r = 0;
6183 __Pyx_RefNannyDeclarations
6184 __Pyx_RefNannySetupContext(
"calculateNumericalDiffusionHJ (wrapper)", 0);
6185 #if !CYTHON_VECTORCALL
6186 #if CYTHON_ASSUME_SAFE_SIZE
6187 __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
6189 __pyx_nargs = PyTuple_Size(__pyx_args);
if (unlikely(__pyx_nargs < 0))
return NULL;
6192 __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
6194 PyObject **
const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_shockCapturing,&__pyx_mstate_global->__pyx_n_u_shockCapturingDiffusion,&__pyx_mstate_global->__pyx_n_u_elementDiameter,&__pyx_mstate_global->__pyx_n_u_strong_residual,&__pyx_mstate_global->__pyx_n_u_mt,&__pyx_mstate_global->__pyx_n_u_H,&__pyx_mstate_global->__pyx_n_u_numDiff,0};
6195 const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
6196 if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(0, 110, __pyx_L3_error)
6197 if (__pyx_kwds_len > 0) {
6198 switch (__pyx_nargs) {
6200 values[6] = __Pyx_ArgRef_FASTCALL(__pyx_args, 6);
6201 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[6])) __PYX_ERR(0, 110, __pyx_L3_error)
6204 values[5] = __Pyx_ArgRef_FASTCALL(__pyx_args, 5);
6205 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[5])) __PYX_ERR(0, 110, __pyx_L3_error)
6208 values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
6209 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 110, __pyx_L3_error)
6212 values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
6213 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 110, __pyx_L3_error)
6216 values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
6217 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 110, __pyx_L3_error)
6220 values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
6221 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 110, __pyx_L3_error)
6224 values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
6225 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 110, __pyx_L3_error)
6228 default:
goto __pyx_L5_argtuple_error;
6230 const Py_ssize_t kwd_pos_args = __pyx_nargs;
6231 if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len,
"calculateNumericalDiffusionHJ", 0) < (0)) __PYX_ERR(0, 110, __pyx_L3_error)
6232 for (Py_ssize_t i = __pyx_nargs; i < 7; i++) {
6233 if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid(
"calculateNumericalDiffusionHJ", 1, 7, 7, i); __PYX_ERR(0, 110, __pyx_L3_error) }
6235 }
else if (unlikely(__pyx_nargs != 7)) {
6236 goto __pyx_L5_argtuple_error;
6238 values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
6239 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 110, __pyx_L3_error)
6240 values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
6241 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 110, __pyx_L3_error)
6242 values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
6243 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 110, __pyx_L3_error)
6244 values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
6245 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 110, __pyx_L3_error)
6246 values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
6247 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 110, __pyx_L3_error)
6248 values[5] = __Pyx_ArgRef_FASTCALL(__pyx_args, 5);
6249 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[5])) __PYX_ERR(0, 110, __pyx_L3_error)
6250 values[6] = __Pyx_ArgRef_FASTCALL(__pyx_args, 6);
6251 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[6])) __PYX_ERR(0, 110, __pyx_L3_error)
6253 __pyx_v_shockCapturing = __Pyx_PyLong_As_char(values[0]);
if (unlikely((__pyx_v_shockCapturing == (
char)-1) && PyErr_Occurred())) __PYX_ERR(0, 110, __pyx_L3_error)
6254 __pyx_v_shockCapturingDiffusion = __Pyx_PyFloat_AsDouble(values[1]);
if (unlikely((__pyx_v_shockCapturingDiffusion == (
double)-1) && PyErr_Occurred())) __PYX_ERR(0, 111, __pyx_L3_error)
6255 __pyx_v_elementDiameter = ((PyArrayObject *)values[2]);
6256 __pyx_v_strong_residual = ((PyArrayObject *)values[3]);
6257 __pyx_v_mt = ((PyArrayObject *)values[4]);
6258 __pyx_v_H = ((PyArrayObject *)values[5]);
6259 __pyx_v_numDiff = ((PyArrayObject *)values[6]);
6262 __pyx_L5_argtuple_error:;
6263 __Pyx_RaiseArgtupleInvalid(
"calculateNumericalDiffusionHJ", 1, 7, 7, __pyx_nargs); __PYX_ERR(0, 110, __pyx_L3_error)
6265 goto __pyx_L4_argument_unpacking_done;
6267 for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(
sizeof(values)/
sizeof(values[0])); ++__pyx_temp) {
6268 Py_XDECREF(values[__pyx_temp]);
6270 __Pyx_AddTraceback(
"cshockCapturing.calculateNumericalDiffusionHJ", __pyx_clineno, __pyx_lineno, __pyx_filename);
6271 __Pyx_RefNannyFinishContext();
6273 __pyx_L4_argument_unpacking_done:;
6274 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_elementDiameter), __pyx_mstate_global->__pyx_ptype_5numpy_ndarray, 1,
"elementDiameter", 0))) __PYX_ERR(0, 112, __pyx_L1_error)
6275 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_strong_residual), __pyx_mstate_global->__pyx_ptype_5numpy_ndarray, 1,
"strong_residual", 0))) __PYX_ERR(0, 113, __pyx_L1_error)
6276 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_mt), __pyx_mstate_global->__pyx_ptype_5numpy_ndarray, 1,
"mt", 0))) __PYX_ERR(0, 114, __pyx_L1_error)
6277 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_H), __pyx_mstate_global->__pyx_ptype_5numpy_ndarray, 1,
"H", 0))) __PYX_ERR(0, 115, __pyx_L1_error)
6278 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_numDiff), __pyx_mstate_global->__pyx_ptype_5numpy_ndarray, 1,
"numDiff", 0))) __PYX_ERR(0, 116, __pyx_L1_error)
6279 __pyx_r = __pyx_pf_15cshockCapturing_6calculateNumericalDiffusionHJ(__pyx_self, __pyx_v_shockCapturing, __pyx_v_shockCapturingDiffusion, __pyx_v_elementDiameter, __pyx_v_strong_residual, __pyx_v_mt, __pyx_v_H, __pyx_v_numDiff);
6285 for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(
sizeof(values)/
sizeof(values[0])); ++__pyx_temp) {
6286 Py_XDECREF(values[__pyx_temp]);
6288 goto __pyx_L7_cleaned_up;
6290 for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(
sizeof(values)/
sizeof(values[0])); ++__pyx_temp) {
6291 Py_XDECREF(values[__pyx_temp]);
6293 __pyx_L7_cleaned_up:;
6296 __Pyx_RefNannyFinishContext();
6300static PyObject *__pyx_pf_15cshockCapturing_6calculateNumericalDiffusionHJ(CYTHON_UNUSED PyObject *__pyx_self,
char __pyx_v_shockCapturing,
double __pyx_v_shockCapturingDiffusion, PyArrayObject *__pyx_v_elementDiameter, PyArrayObject *__pyx_v_strong_residual, PyArrayObject *__pyx_v_mt, PyArrayObject *__pyx_v_H, PyArrayObject *__pyx_v_numDiff) {
6301 PyObject *__pyx_r = NULL;
6302 __Pyx_RefNannyDeclarations
6303 __Pyx_RefNannySetupContext(
"calculateNumericalDiffusionHJ", 0);
6312 calculateNumericalDiffusionHJ((__pyx_f_5numpy_7ndarray_5shape___get__(__pyx_v_H)[0]), (__pyx_f_5numpy_7ndarray_5shape___get__(__pyx_v_H)[1]), __pyx_v_shockCapturing, __pyx_v_shockCapturingDiffusion, ((
double *)__pyx_f_5numpy_7ndarray_4data___get__(__pyx_v_elementDiameter)), ((
double *)__pyx_f_5numpy_7ndarray_4data___get__(__pyx_v_strong_residual)), ((
double *)__pyx_f_5numpy_7ndarray_4data___get__(__pyx_v_mt)), ((
double *)__pyx_f_5numpy_7ndarray_4data___get__(__pyx_v_H)), ((
double *)__pyx_f_5numpy_7ndarray_4data___get__(__pyx_v_numDiff)));
6323 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
6324 __Pyx_XGIVEREF(__pyx_r);
6325 __Pyx_RefNannyFinishContext();
6338static PyObject *__pyx_pw_15cshockCapturing_9calculateNumericalDiffusionHJV2(PyObject *__pyx_self,
6339#
if CYTHON_VECTORCALL
6340PyObject *
const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
6342PyObject *__pyx_args, PyObject *__pyx_kwds
6345static PyMethodDef __pyx_mdef_15cshockCapturing_9calculateNumericalDiffusionHJV2 = {
"calculateNumericalDiffusionHJV2", (PyCFunction)(
void(*)(
void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_15cshockCapturing_9calculateNumericalDiffusionHJV2, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
6346static PyObject *__pyx_pw_15cshockCapturing_9calculateNumericalDiffusionHJV2(PyObject *__pyx_self,
6347#
if CYTHON_VECTORCALL
6348PyObject *
const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
6350PyObject *__pyx_args, PyObject *__pyx_kwds
6353 char __pyx_v_shockCapturing;
6354 double __pyx_v_shockCapturingDiffusion;
6355 PyArrayObject *__pyx_v_elementDiameter = 0;
6356 PyArrayObject *__pyx_v_strong_residual = 0;
6357 PyArrayObject *__pyx_v_mt = 0;
6358 PyArrayObject *__pyx_v_H = 0;
6359 PyArrayObject *__pyx_v_numDiff = 0;
6360 #if !CYTHON_VECTORCALL
6361 CYTHON_UNUSED Py_ssize_t __pyx_nargs;
6363 CYTHON_UNUSED PyObject *
const *__pyx_kwvalues;
6364 PyObject* values[7] = {0,0,0,0,0,0,0};
6365 int __pyx_lineno = 0;
6366 const char *__pyx_filename = NULL;
6367 int __pyx_clineno = 0;
6368 PyObject *__pyx_r = 0;
6369 __Pyx_RefNannyDeclarations
6370 __Pyx_RefNannySetupContext(
"calculateNumericalDiffusionHJV2 (wrapper)", 0);
6371 #if !CYTHON_VECTORCALL
6372 #if CYTHON_ASSUME_SAFE_SIZE
6373 __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
6375 __pyx_nargs = PyTuple_Size(__pyx_args);
if (unlikely(__pyx_nargs < 0))
return NULL;
6378 __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
6380 PyObject **
const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_shockCapturing,&__pyx_mstate_global->__pyx_n_u_shockCapturingDiffusion,&__pyx_mstate_global->__pyx_n_u_elementDiameter,&__pyx_mstate_global->__pyx_n_u_strong_residual,&__pyx_mstate_global->__pyx_n_u_mt,&__pyx_mstate_global->__pyx_n_u_H,&__pyx_mstate_global->__pyx_n_u_numDiff,0};
6381 const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
6382 if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(0, 126, __pyx_L3_error)
6383 if (__pyx_kwds_len > 0) {
6384 switch (__pyx_nargs) {
6386 values[6] = __Pyx_ArgRef_FASTCALL(__pyx_args, 6);
6387 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[6])) __PYX_ERR(0, 126, __pyx_L3_error)
6390 values[5] = __Pyx_ArgRef_FASTCALL(__pyx_args, 5);
6391 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[5])) __PYX_ERR(0, 126, __pyx_L3_error)
6394 values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
6395 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 126, __pyx_L3_error)
6398 values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
6399 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 126, __pyx_L3_error)
6402 values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
6403 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 126, __pyx_L3_error)
6406 values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
6407 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 126, __pyx_L3_error)
6410 values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
6411 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 126, __pyx_L3_error)
6414 default:
goto __pyx_L5_argtuple_error;
6416 const Py_ssize_t kwd_pos_args = __pyx_nargs;
6417 if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len,
"calculateNumericalDiffusionHJV2", 0) < (0)) __PYX_ERR(0, 126, __pyx_L3_error)
6418 for (Py_ssize_t i = __pyx_nargs; i < 7; i++) {
6419 if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid(
"calculateNumericalDiffusionHJV2", 1, 7, 7, i); __PYX_ERR(0, 126, __pyx_L3_error) }
6421 }
else if (unlikely(__pyx_nargs != 7)) {
6422 goto __pyx_L5_argtuple_error;
6424 values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
6425 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 126, __pyx_L3_error)
6426 values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
6427 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 126, __pyx_L3_error)
6428 values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
6429 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 126, __pyx_L3_error)
6430 values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
6431 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 126, __pyx_L3_error)
6432 values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
6433 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 126, __pyx_L3_error)
6434 values[5] = __Pyx_ArgRef_FASTCALL(__pyx_args, 5);
6435 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[5])) __PYX_ERR(0, 126, __pyx_L3_error)
6436 values[6] = __Pyx_ArgRef_FASTCALL(__pyx_args, 6);
6437 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[6])) __PYX_ERR(0, 126, __pyx_L3_error)
6439 __pyx_v_shockCapturing = __Pyx_PyLong_As_char(values[0]);
if (unlikely((__pyx_v_shockCapturing == (
char)-1) && PyErr_Occurred())) __PYX_ERR(0, 126, __pyx_L3_error)
6440 __pyx_v_shockCapturingDiffusion = __Pyx_PyFloat_AsDouble(values[1]);
if (unlikely((__pyx_v_shockCapturingDiffusion == (
double)-1) && PyErr_Occurred())) __PYX_ERR(0, 127, __pyx_L3_error)
6441 __pyx_v_elementDiameter = ((PyArrayObject *)values[2]);
6442 __pyx_v_strong_residual = ((PyArrayObject *)values[3]);
6443 __pyx_v_mt = ((PyArrayObject *)values[4]);
6444 __pyx_v_H = ((PyArrayObject *)values[5]);
6445 __pyx_v_numDiff = ((PyArrayObject *)values[6]);
6448 __pyx_L5_argtuple_error:;
6449 __Pyx_RaiseArgtupleInvalid(
"calculateNumericalDiffusionHJV2", 1, 7, 7, __pyx_nargs); __PYX_ERR(0, 126, __pyx_L3_error)
6451 goto __pyx_L4_argument_unpacking_done;
6453 for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(
sizeof(values)/
sizeof(values[0])); ++__pyx_temp) {
6454 Py_XDECREF(values[__pyx_temp]);
6456 __Pyx_AddTraceback(
"cshockCapturing.calculateNumericalDiffusionHJV2", __pyx_clineno, __pyx_lineno, __pyx_filename);
6457 __Pyx_RefNannyFinishContext();
6459 __pyx_L4_argument_unpacking_done:;
6460 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_elementDiameter), __pyx_mstate_global->__pyx_ptype_5numpy_ndarray, 1,
"elementDiameter", 0))) __PYX_ERR(0, 128, __pyx_L1_error)
6461 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_strong_residual), __pyx_mstate_global->__pyx_ptype_5numpy_ndarray, 1,
"strong_residual", 0))) __PYX_ERR(0, 129, __pyx_L1_error)
6462 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_mt), __pyx_mstate_global->__pyx_ptype_5numpy_ndarray, 1,
"mt", 0))) __PYX_ERR(0, 130, __pyx_L1_error)
6463 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_H), __pyx_mstate_global->__pyx_ptype_5numpy_ndarray, 1,
"H", 0))) __PYX_ERR(0, 131, __pyx_L1_error)
6464 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_numDiff), __pyx_mstate_global->__pyx_ptype_5numpy_ndarray, 1,
"numDiff", 0))) __PYX_ERR(0, 132, __pyx_L1_error)
6465 __pyx_r = __pyx_pf_15cshockCapturing_8calculateNumericalDiffusionHJV2(__pyx_self, __pyx_v_shockCapturing, __pyx_v_shockCapturingDiffusion, __pyx_v_elementDiameter, __pyx_v_strong_residual, __pyx_v_mt, __pyx_v_H, __pyx_v_numDiff);
6471 for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(
sizeof(values)/
sizeof(values[0])); ++__pyx_temp) {
6472 Py_XDECREF(values[__pyx_temp]);
6474 goto __pyx_L7_cleaned_up;
6476 for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(
sizeof(values)/
sizeof(values[0])); ++__pyx_temp) {
6477 Py_XDECREF(values[__pyx_temp]);
6479 __pyx_L7_cleaned_up:;
6482 __Pyx_RefNannyFinishContext();
6486static PyObject *__pyx_pf_15cshockCapturing_8calculateNumericalDiffusionHJV2(CYTHON_UNUSED PyObject *__pyx_self,
char __pyx_v_shockCapturing,
double __pyx_v_shockCapturingDiffusion, PyArrayObject *__pyx_v_elementDiameter, PyArrayObject *__pyx_v_strong_residual, PyArrayObject *__pyx_v_mt, PyArrayObject *__pyx_v_H, PyArrayObject *__pyx_v_numDiff) {
6487 PyObject *__pyx_r = NULL;
6488 __Pyx_RefNannyDeclarations
6489 __Pyx_RefNannySetupContext(
"calculateNumericalDiffusionHJV2", 0);
6498 calculateNumericalDiffusionHJV2((__pyx_f_5numpy_7ndarray_5shape___get__(__pyx_v_H)[0]), (__pyx_f_5numpy_7ndarray_5shape___get__(__pyx_v_H)[1]), __pyx_v_shockCapturing, __pyx_v_shockCapturingDiffusion, ((
double *)__pyx_f_5numpy_7ndarray_4data___get__(__pyx_v_elementDiameter)), ((
double *)__pyx_f_5numpy_7ndarray_4data___get__(__pyx_v_strong_residual)), ((
double *)__pyx_f_5numpy_7ndarray_4data___get__(__pyx_v_mt)), ((
double *)__pyx_f_5numpy_7ndarray_4data___get__(__pyx_v_H)), ((
double *)__pyx_f_5numpy_7ndarray_4data___get__(__pyx_v_numDiff)));
6509 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
6510 __Pyx_XGIVEREF(__pyx_r);
6511 __Pyx_RefNannyFinishContext();
6524static PyObject *__pyx_pw_15cshockCapturing_11calculateNumericalDiffusion_A_1(PyObject *__pyx_self,
6525#
if CYTHON_VECTORCALL
6526PyObject *
const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
6528PyObject *__pyx_args, PyObject *__pyx_kwds
6531static PyMethodDef __pyx_mdef_15cshockCapturing_11calculateNumericalDiffusion_A_1 = {
"calculateNumericalDiffusion_A_1", (PyCFunction)(
void(*)(
void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_15cshockCapturing_11calculateNumericalDiffusion_A_1, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
6532static PyObject *__pyx_pw_15cshockCapturing_11calculateNumericalDiffusion_A_1(PyObject *__pyx_self,
6533#
if CYTHON_VECTORCALL
6534PyObject *
const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
6536PyObject *__pyx_args, PyObject *__pyx_kwds
6539 double __pyx_v_shockCapturingFactor;
6540 PyArrayObject *__pyx_v_elementDiameter = 0;
6541 PyArrayObject *__pyx_v_strong_residual = 0;
6542 PyArrayObject *__pyx_v_mt = 0;
6543 PyArrayObject *__pyx_v_df = 0;
6544 PyArrayObject *__pyx_v_numDiff = 0;
6545 #if !CYTHON_VECTORCALL
6546 CYTHON_UNUSED Py_ssize_t __pyx_nargs;
6548 CYTHON_UNUSED PyObject *
const *__pyx_kwvalues;
6549 PyObject* values[6] = {0,0,0,0,0,0};
6550 int __pyx_lineno = 0;
6551 const char *__pyx_filename = NULL;
6552 int __pyx_clineno = 0;
6553 PyObject *__pyx_r = 0;
6554 __Pyx_RefNannyDeclarations
6555 __Pyx_RefNannySetupContext(
"calculateNumericalDiffusion_A_1 (wrapper)", 0);
6556 #if !CYTHON_VECTORCALL
6557 #if CYTHON_ASSUME_SAFE_SIZE
6558 __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
6560 __pyx_nargs = PyTuple_Size(__pyx_args);
if (unlikely(__pyx_nargs < 0))
return NULL;
6563 __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
6565 PyObject **
const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_shockCapturingFactor,&__pyx_mstate_global->__pyx_n_u_elementDiameter,&__pyx_mstate_global->__pyx_n_u_strong_residual,&__pyx_mstate_global->__pyx_n_u_mt,&__pyx_mstate_global->__pyx_n_u_df,&__pyx_mstate_global->__pyx_n_u_numDiff,0};
6566 const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
6567 if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(0, 142, __pyx_L3_error)
6568 if (__pyx_kwds_len > 0) {
6569 switch (__pyx_nargs) {
6571 values[5] = __Pyx_ArgRef_FASTCALL(__pyx_args, 5);
6572 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[5])) __PYX_ERR(0, 142, __pyx_L3_error)
6575 values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
6576 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 142, __pyx_L3_error)
6579 values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
6580 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 142, __pyx_L3_error)
6583 values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
6584 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 142, __pyx_L3_error)
6587 values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
6588 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 142, __pyx_L3_error)
6591 values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
6592 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 142, __pyx_L3_error)
6595 default:
goto __pyx_L5_argtuple_error;
6597 const Py_ssize_t kwd_pos_args = __pyx_nargs;
6598 if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len,
"calculateNumericalDiffusion_A_1", 0) < (0)) __PYX_ERR(0, 142, __pyx_L3_error)
6599 for (Py_ssize_t i = __pyx_nargs; i < 6; i++) {
6600 if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid(
"calculateNumericalDiffusion_A_1", 1, 6, 6, i); __PYX_ERR(0, 142, __pyx_L3_error) }
6602 }
else if (unlikely(__pyx_nargs != 6)) {
6603 goto __pyx_L5_argtuple_error;
6605 values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
6606 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 142, __pyx_L3_error)
6607 values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
6608 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 142, __pyx_L3_error)
6609 values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
6610 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 142, __pyx_L3_error)
6611 values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
6612 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 142, __pyx_L3_error)
6613 values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
6614 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 142, __pyx_L3_error)
6615 values[5] = __Pyx_ArgRef_FASTCALL(__pyx_args, 5);
6616 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[5])) __PYX_ERR(0, 142, __pyx_L3_error)
6618 __pyx_v_shockCapturingFactor = __Pyx_PyFloat_AsDouble(values[0]);
if (unlikely((__pyx_v_shockCapturingFactor == (
double)-1) && PyErr_Occurred())) __PYX_ERR(0, 142, __pyx_L3_error)
6619 __pyx_v_elementDiameter = ((PyArrayObject *)values[1]);
6620 __pyx_v_strong_residual = ((PyArrayObject *)values[2]);
6621 __pyx_v_mt = ((PyArrayObject *)values[3]);
6622 __pyx_v_df = ((PyArrayObject *)values[4]);
6623 __pyx_v_numDiff = ((PyArrayObject *)values[5]);
6626 __pyx_L5_argtuple_error:;
6627 __Pyx_RaiseArgtupleInvalid(
"calculateNumericalDiffusion_A_1", 1, 6, 6, __pyx_nargs); __PYX_ERR(0, 142, __pyx_L3_error)
6629 goto __pyx_L4_argument_unpacking_done;
6631 for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(
sizeof(values)/
sizeof(values[0])); ++__pyx_temp) {
6632 Py_XDECREF(values[__pyx_temp]);
6634 __Pyx_AddTraceback(
"cshockCapturing.calculateNumericalDiffusion_A_1", __pyx_clineno, __pyx_lineno, __pyx_filename);
6635 __Pyx_RefNannyFinishContext();
6637 __pyx_L4_argument_unpacking_done:;
6638 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_elementDiameter), __pyx_mstate_global->__pyx_ptype_5numpy_ndarray, 1,
"elementDiameter", 0))) __PYX_ERR(0, 143, __pyx_L1_error)
6639 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_strong_residual), __pyx_mstate_global->__pyx_ptype_5numpy_ndarray, 1,
"strong_residual", 0))) __PYX_ERR(0, 144, __pyx_L1_error)
6640 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_mt), __pyx_mstate_global->__pyx_ptype_5numpy_ndarray, 1,
"mt", 0))) __PYX_ERR(0, 145, __pyx_L1_error)
6641 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_df), __pyx_mstate_global->__pyx_ptype_5numpy_ndarray, 1,
"df", 0))) __PYX_ERR(0, 146, __pyx_L1_error)
6642 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_numDiff), __pyx_mstate_global->__pyx_ptype_5numpy_ndarray, 1,
"numDiff", 0))) __PYX_ERR(0, 147, __pyx_L1_error)
6643 __pyx_r = __pyx_pf_15cshockCapturing_10calculateNumericalDiffusion_A_1(__pyx_self, __pyx_v_shockCapturingFactor, __pyx_v_elementDiameter, __pyx_v_strong_residual, __pyx_v_mt, __pyx_v_df, __pyx_v_numDiff);
6649 for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(
sizeof(values)/
sizeof(values[0])); ++__pyx_temp) {
6650 Py_XDECREF(values[__pyx_temp]);
6652 goto __pyx_L7_cleaned_up;
6654 for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(
sizeof(values)/
sizeof(values[0])); ++__pyx_temp) {
6655 Py_XDECREF(values[__pyx_temp]);
6657 __pyx_L7_cleaned_up:;
6659 __Pyx_RefNannyFinishContext();
6663static PyObject *__pyx_pf_15cshockCapturing_10calculateNumericalDiffusion_A_1(CYTHON_UNUSED PyObject *__pyx_self,
double __pyx_v_shockCapturingFactor, PyArrayObject *__pyx_v_elementDiameter, PyArrayObject *__pyx_v_strong_residual, PyArrayObject *__pyx_v_mt, PyArrayObject *__pyx_v_df, PyArrayObject *__pyx_v_numDiff) {
6664 PyObject *__pyx_r = NULL;
6665 __Pyx_RefNannyDeclarations
6666 __Pyx_RefNannySetupContext(
"calculateNumericalDiffusion_A_1", 0);
6675 calculateNumericalDiffusion_A_1((__pyx_f_5numpy_7ndarray_5shape___get__(__pyx_v_df)[0]), (__pyx_f_5numpy_7ndarray_5shape___get__(__pyx_v_df)[1]), (__pyx_f_5numpy_7ndarray_5shape___get__(__pyx_v_df)[2]), __pyx_v_shockCapturingFactor, ((
double *)__pyx_f_5numpy_7ndarray_4data___get__(__pyx_v_elementDiameter)), ((
double *)__pyx_f_5numpy_7ndarray_4data___get__(__pyx_v_strong_residual)), ((
double *)__pyx_f_5numpy_7ndarray_4data___get__(__pyx_v_mt)), ((
double *)__pyx_f_5numpy_7ndarray_4data___get__(__pyx_v_df)), ((
double *)__pyx_f_5numpy_7ndarray_4data___get__(__pyx_v_numDiff)));
6686 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
6687 __Pyx_XGIVEREF(__pyx_r);
6688 __Pyx_RefNannyFinishContext();
6701static PyObject *__pyx_pw_15cshockCapturing_13calculateNumericalDiffusionResGradJuanes(PyObject *__pyx_self,
6702#
if CYTHON_VECTORCALL
6703PyObject *
const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
6705PyObject *__pyx_args, PyObject *__pyx_kwds
6708static PyMethodDef __pyx_mdef_15cshockCapturing_13calculateNumericalDiffusionResGradJuanes = {
"calculateNumericalDiffusionResGradJuanes", (PyCFunction)(
void(*)(
void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_15cshockCapturing_13calculateNumericalDiffusionResGradJuanes, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
6709static PyObject *__pyx_pw_15cshockCapturing_13calculateNumericalDiffusionResGradJuanes(PyObject *__pyx_self,
6710#
if CYTHON_VECTORCALL
6711PyObject *
const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
6713PyObject *__pyx_args, PyObject *__pyx_kwds
6716 double __pyx_v_shockCapturingDiffusion;
6718 PyArrayObject *__pyx_v_elementDiameter = 0;
6719 PyArrayObject *__pyx_v_strong_residual = 0;
6720 PyArrayObject *__pyx_v_grad_u = 0;
6721 PyArrayObject *__pyx_v_numDiff = 0;
6722 #if !CYTHON_VECTORCALL
6723 CYTHON_UNUSED Py_ssize_t __pyx_nargs;
6725 CYTHON_UNUSED PyObject *
const *__pyx_kwvalues;
6726 PyObject* values[6] = {0,0,0,0,0,0};
6727 int __pyx_lineno = 0;
6728 const char *__pyx_filename = NULL;
6729 int __pyx_clineno = 0;
6730 PyObject *__pyx_r = 0;
6731 __Pyx_RefNannyDeclarations
6732 __Pyx_RefNannySetupContext(
"calculateNumericalDiffusionResGradJuanes (wrapper)", 0);
6733 #if !CYTHON_VECTORCALL
6734 #if CYTHON_ASSUME_SAFE_SIZE
6735 __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
6737 __pyx_nargs = PyTuple_Size(__pyx_args);
if (unlikely(__pyx_nargs < 0))
return NULL;
6740 __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
6742 PyObject **
const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_shockCapturingDiffusion,&__pyx_mstate_global->__pyx_n_u_uSC,&__pyx_mstate_global->__pyx_n_u_elementDiameter,&__pyx_mstate_global->__pyx_n_u_strong_residual,&__pyx_mstate_global->__pyx_n_u_grad_u,&__pyx_mstate_global->__pyx_n_u_numDiff,0};
6743 const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
6744 if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(0, 157, __pyx_L3_error)
6745 if (__pyx_kwds_len > 0) {
6746 switch (__pyx_nargs) {
6748 values[5] = __Pyx_ArgRef_FASTCALL(__pyx_args, 5);
6749 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[5])) __PYX_ERR(0, 157, __pyx_L3_error)
6752 values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
6753 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 157, __pyx_L3_error)
6756 values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
6757 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 157, __pyx_L3_error)
6760 values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
6761 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 157, __pyx_L3_error)
6764 values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
6765 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 157, __pyx_L3_error)
6768 values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
6769 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 157, __pyx_L3_error)
6772 default:
goto __pyx_L5_argtuple_error;
6774 const Py_ssize_t kwd_pos_args = __pyx_nargs;
6775 if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len,
"calculateNumericalDiffusionResGradJuanes", 0) < (0)) __PYX_ERR(0, 157, __pyx_L3_error)
6776 for (Py_ssize_t i = __pyx_nargs; i < 6; i++) {
6777 if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid(
"calculateNumericalDiffusionResGradJuanes", 1, 6, 6, i); __PYX_ERR(0, 157, __pyx_L3_error) }
6779 }
else if (unlikely(__pyx_nargs != 6)) {
6780 goto __pyx_L5_argtuple_error;
6782 values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
6783 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 157, __pyx_L3_error)
6784 values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
6785 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 157, __pyx_L3_error)
6786 values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
6787 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 157, __pyx_L3_error)
6788 values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
6789 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 157, __pyx_L3_error)
6790 values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
6791 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 157, __pyx_L3_error)
6792 values[5] = __Pyx_ArgRef_FASTCALL(__pyx_args, 5);
6793 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[5])) __PYX_ERR(0, 157, __pyx_L3_error)
6795 __pyx_v_shockCapturingDiffusion = __Pyx_PyFloat_AsDouble(values[0]);
if (unlikely((__pyx_v_shockCapturingDiffusion == (
double)-1) && PyErr_Occurred())) __PYX_ERR(0, 157, __pyx_L3_error)
6796 __pyx_v_uSC = __Pyx_PyFloat_AsDouble(values[1]);
if (unlikely((__pyx_v_uSC == (
double)-1) && PyErr_Occurred())) __PYX_ERR(0, 158, __pyx_L3_error)
6797 __pyx_v_elementDiameter = ((PyArrayObject *)values[2]);
6798 __pyx_v_strong_residual = ((PyArrayObject *)values[3]);
6799 __pyx_v_grad_u = ((PyArrayObject *)values[4]);
6800 __pyx_v_numDiff = ((PyArrayObject *)values[5]);
6803 __pyx_L5_argtuple_error:;
6804 __Pyx_RaiseArgtupleInvalid(
"calculateNumericalDiffusionResGradJuanes", 1, 6, 6, __pyx_nargs); __PYX_ERR(0, 157, __pyx_L3_error)
6806 goto __pyx_L4_argument_unpacking_done;
6808 for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(
sizeof(values)/
sizeof(values[0])); ++__pyx_temp) {
6809 Py_XDECREF(values[__pyx_temp]);
6811 __Pyx_AddTraceback(
"cshockCapturing.calculateNumericalDiffusionResGradJuanes", __pyx_clineno, __pyx_lineno, __pyx_filename);
6812 __Pyx_RefNannyFinishContext();
6814 __pyx_L4_argument_unpacking_done:;
6815 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_elementDiameter), __pyx_mstate_global->__pyx_ptype_5numpy_ndarray, 1,
"elementDiameter", 0))) __PYX_ERR(0, 159, __pyx_L1_error)
6816 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_strong_residual), __pyx_mstate_global->__pyx_ptype_5numpy_ndarray, 1,
"strong_residual", 0))) __PYX_ERR(0, 160, __pyx_L1_error)
6817 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_grad_u), __pyx_mstate_global->__pyx_ptype_5numpy_ndarray, 1,
"grad_u", 0))) __PYX_ERR(0, 161, __pyx_L1_error)
6818 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_numDiff), __pyx_mstate_global->__pyx_ptype_5numpy_ndarray, 1,
"numDiff", 0))) __PYX_ERR(0, 162, __pyx_L1_error)
6819 __pyx_r = __pyx_pf_15cshockCapturing_12calculateNumericalDiffusionResGradJuanes(__pyx_self, __pyx_v_shockCapturingDiffusion, __pyx_v_uSC, __pyx_v_elementDiameter, __pyx_v_strong_residual, __pyx_v_grad_u, __pyx_v_numDiff);
6825 for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(
sizeof(values)/
sizeof(values[0])); ++__pyx_temp) {
6826 Py_XDECREF(values[__pyx_temp]);
6828 goto __pyx_L7_cleaned_up;
6830 for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(
sizeof(values)/
sizeof(values[0])); ++__pyx_temp) {
6831 Py_XDECREF(values[__pyx_temp]);
6833 __pyx_L7_cleaned_up:;
6836 __Pyx_RefNannyFinishContext();
6840static PyObject *__pyx_pf_15cshockCapturing_12calculateNumericalDiffusionResGradJuanes(CYTHON_UNUSED PyObject *__pyx_self,
double __pyx_v_shockCapturingDiffusion,
double __pyx_v_uSC, PyArrayObject *__pyx_v_elementDiameter, PyArrayObject *__pyx_v_strong_residual, PyArrayObject *__pyx_v_grad_u, PyArrayObject *__pyx_v_numDiff) {
6841 PyObject *__pyx_r = NULL;
6842 __Pyx_RefNannyDeclarations
6843 __Pyx_RefNannySetupContext(
"calculateNumericalDiffusionResGradJuanes", 0);
6852 calculateNumericalDiffusionResGradJuanes((__pyx_f_5numpy_7ndarray_5shape___get__(__pyx_v_grad_u)[0]), (__pyx_f_5numpy_7ndarray_5shape___get__(__pyx_v_grad_u)[1]), (__pyx_f_5numpy_7ndarray_5shape___get__(__pyx_v_grad_u)[2]), __pyx_v_shockCapturingDiffusion, __pyx_v_uSC, ((
double *)__pyx_f_5numpy_7ndarray_4data___get__(__pyx_v_elementDiameter)), ((
double *)__pyx_f_5numpy_7ndarray_4data___get__(__pyx_v_strong_residual)), ((
double *)__pyx_f_5numpy_7ndarray_4data___get__(__pyx_v_grad_u)), ((
double *)__pyx_f_5numpy_7ndarray_4data___get__(__pyx_v_numDiff)));
6863 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
6864 __Pyx_XGIVEREF(__pyx_r);
6865 __Pyx_RefNannyFinishContext();
6878static PyObject *__pyx_pw_15cshockCapturing_15calculateNumericalDiffusionJaffre(PyObject *__pyx_self,
6879#
if CYTHON_VECTORCALL
6880PyObject *
const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
6882PyObject *__pyx_args, PyObject *__pyx_kwds
6885static PyMethodDef __pyx_mdef_15cshockCapturing_15calculateNumericalDiffusionJaffre = {
"calculateNumericalDiffusionJaffre", (PyCFunction)(
void(*)(
void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_15cshockCapturing_15calculateNumericalDiffusionJaffre, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
6886static PyObject *__pyx_pw_15cshockCapturing_15calculateNumericalDiffusionJaffre(PyObject *__pyx_self,
6887#
if CYTHON_VECTORCALL
6888PyObject *
const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
6890PyObject *__pyx_args, PyObject *__pyx_kwds
6893 double __pyx_v_shockCapturingDiffusion;
6894 double __pyx_v_beta;
6895 PyArrayObject *__pyx_v_elementDiameter = 0;
6896 PyArrayObject *__pyx_v_strong_residual = 0;
6897 PyArrayObject *__pyx_v_grad_u = 0;
6898 PyArrayObject *__pyx_v_numDiff = 0;
6899 #if !CYTHON_VECTORCALL
6900 CYTHON_UNUSED Py_ssize_t __pyx_nargs;
6902 CYTHON_UNUSED PyObject *
const *__pyx_kwvalues;
6903 PyObject* values[6] = {0,0,0,0,0,0};
6904 int __pyx_lineno = 0;
6905 const char *__pyx_filename = NULL;
6906 int __pyx_clineno = 0;
6907 PyObject *__pyx_r = 0;
6908 __Pyx_RefNannyDeclarations
6909 __Pyx_RefNannySetupContext(
"calculateNumericalDiffusionJaffre (wrapper)", 0);
6910 #if !CYTHON_VECTORCALL
6911 #if CYTHON_ASSUME_SAFE_SIZE
6912 __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
6914 __pyx_nargs = PyTuple_Size(__pyx_args);
if (unlikely(__pyx_nargs < 0))
return NULL;
6917 __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
6919 PyObject **
const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_shockCapturingDiffusion,&__pyx_mstate_global->__pyx_n_u_beta,&__pyx_mstate_global->__pyx_n_u_elementDiameter,&__pyx_mstate_global->__pyx_n_u_strong_residual,&__pyx_mstate_global->__pyx_n_u_grad_u,&__pyx_mstate_global->__pyx_n_u_numDiff,0};
6920 const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
6921 if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(0, 172, __pyx_L3_error)
6922 if (__pyx_kwds_len > 0) {
6923 switch (__pyx_nargs) {
6925 values[5] = __Pyx_ArgRef_FASTCALL(__pyx_args, 5);
6926 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[5])) __PYX_ERR(0, 172, __pyx_L3_error)
6929 values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
6930 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 172, __pyx_L3_error)
6933 values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
6934 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 172, __pyx_L3_error)
6937 values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
6938 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 172, __pyx_L3_error)
6941 values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
6942 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 172, __pyx_L3_error)
6945 values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
6946 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 172, __pyx_L3_error)
6949 default:
goto __pyx_L5_argtuple_error;
6951 const Py_ssize_t kwd_pos_args = __pyx_nargs;
6952 if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len,
"calculateNumericalDiffusionJaffre", 0) < (0)) __PYX_ERR(0, 172, __pyx_L3_error)
6953 for (Py_ssize_t i = __pyx_nargs; i < 6; i++) {
6954 if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid(
"calculateNumericalDiffusionJaffre", 1, 6, 6, i); __PYX_ERR(0, 172, __pyx_L3_error) }
6956 }
else if (unlikely(__pyx_nargs != 6)) {
6957 goto __pyx_L5_argtuple_error;
6959 values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
6960 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 172, __pyx_L3_error)
6961 values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
6962 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 172, __pyx_L3_error)
6963 values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
6964 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 172, __pyx_L3_error)
6965 values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
6966 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 172, __pyx_L3_error)
6967 values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
6968 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 172, __pyx_L3_error)
6969 values[5] = __Pyx_ArgRef_FASTCALL(__pyx_args, 5);
6970 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[5])) __PYX_ERR(0, 172, __pyx_L3_error)
6972 __pyx_v_shockCapturingDiffusion = __Pyx_PyFloat_AsDouble(values[0]);
if (unlikely((__pyx_v_shockCapturingDiffusion == (
double)-1) && PyErr_Occurred())) __PYX_ERR(0, 172, __pyx_L3_error)
6973 __pyx_v_beta = __Pyx_PyFloat_AsDouble(values[1]);
if (unlikely((__pyx_v_beta == (
double)-1) && PyErr_Occurred())) __PYX_ERR(0, 173, __pyx_L3_error)
6974 __pyx_v_elementDiameter = ((PyArrayObject *)values[2]);
6975 __pyx_v_strong_residual = ((PyArrayObject *)values[3]);
6976 __pyx_v_grad_u = ((PyArrayObject *)values[4]);
6977 __pyx_v_numDiff = ((PyArrayObject *)values[5]);
6980 __pyx_L5_argtuple_error:;
6981 __Pyx_RaiseArgtupleInvalid(
"calculateNumericalDiffusionJaffre", 1, 6, 6, __pyx_nargs); __PYX_ERR(0, 172, __pyx_L3_error)
6983 goto __pyx_L4_argument_unpacking_done;
6985 for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(
sizeof(values)/
sizeof(values[0])); ++__pyx_temp) {
6986 Py_XDECREF(values[__pyx_temp]);
6988 __Pyx_AddTraceback(
"cshockCapturing.calculateNumericalDiffusionJaffre", __pyx_clineno, __pyx_lineno, __pyx_filename);
6989 __Pyx_RefNannyFinishContext();
6991 __pyx_L4_argument_unpacking_done:;
6992 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_elementDiameter), __pyx_mstate_global->__pyx_ptype_5numpy_ndarray, 1,
"elementDiameter", 0))) __PYX_ERR(0, 174, __pyx_L1_error)
6993 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_strong_residual), __pyx_mstate_global->__pyx_ptype_5numpy_ndarray, 1,
"strong_residual", 0))) __PYX_ERR(0, 175, __pyx_L1_error)
6994 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_grad_u), __pyx_mstate_global->__pyx_ptype_5numpy_ndarray, 1,
"grad_u", 0))) __PYX_ERR(0, 176, __pyx_L1_error)
6995 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_numDiff), __pyx_mstate_global->__pyx_ptype_5numpy_ndarray, 1,
"numDiff", 0))) __PYX_ERR(0, 177, __pyx_L1_error)
6996 __pyx_r = __pyx_pf_15cshockCapturing_14calculateNumericalDiffusionJaffre(__pyx_self, __pyx_v_shockCapturingDiffusion, __pyx_v_beta, __pyx_v_elementDiameter, __pyx_v_strong_residual, __pyx_v_grad_u, __pyx_v_numDiff);
7002 for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(
sizeof(values)/
sizeof(values[0])); ++__pyx_temp) {
7003 Py_XDECREF(values[__pyx_temp]);
7005 goto __pyx_L7_cleaned_up;
7007 for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(
sizeof(values)/
sizeof(values[0])); ++__pyx_temp) {
7008 Py_XDECREF(values[__pyx_temp]);
7010 __pyx_L7_cleaned_up:;
7013 __Pyx_RefNannyFinishContext();
7017static PyObject *__pyx_pf_15cshockCapturing_14calculateNumericalDiffusionJaffre(CYTHON_UNUSED PyObject *__pyx_self,
double __pyx_v_shockCapturingDiffusion,
double __pyx_v_beta, PyArrayObject *__pyx_v_elementDiameter, PyArrayObject *__pyx_v_strong_residual, PyArrayObject *__pyx_v_grad_u, PyArrayObject *__pyx_v_numDiff) {
7018 PyObject *__pyx_r = NULL;
7019 __Pyx_RefNannyDeclarations
7020 __Pyx_RefNannySetupContext(
"calculateNumericalDiffusionJaffre", 0);
7029 calculateNumericalDiffusionJaffre((__pyx_f_5numpy_7ndarray_5shape___get__(__pyx_v_grad_u)[0]), (__pyx_f_5numpy_7ndarray_5shape___get__(__pyx_v_grad_u)[1]), (__pyx_f_5numpy_7ndarray_5shape___get__(__pyx_v_grad_u)[2]), __pyx_v_shockCapturingDiffusion, __pyx_v_beta, ((
double *)__pyx_f_5numpy_7ndarray_4data___get__(__pyx_v_elementDiameter)), ((
double *)__pyx_f_5numpy_7ndarray_4data___get__(__pyx_v_strong_residual)), ((
double *)__pyx_f_5numpy_7ndarray_4data___get__(__pyx_v_grad_u)), ((
double *)__pyx_f_5numpy_7ndarray_4data___get__(__pyx_v_numDiff)));
7040 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
7041 __Pyx_XGIVEREF(__pyx_r);
7042 __Pyx_RefNannyFinishContext();
7047static PyMethodDef __pyx_methods[] = {
7051static CYTHON_SMALL_CODE
int __Pyx_InitCachedBuiltins(__pyx_mstatetype *__pyx_mstate);
7052static CYTHON_SMALL_CODE
int __Pyx_InitCachedConstants(__pyx_mstatetype *__pyx_mstate);
7053static CYTHON_SMALL_CODE
int __Pyx_InitGlobals(
void);
7054static CYTHON_SMALL_CODE
int __Pyx_InitAfterSharedUtility(
void);
7055static CYTHON_SMALL_CODE
int __Pyx_InitConstants(__pyx_mstatetype *__pyx_mstate);
7056static CYTHON_SMALL_CODE
int __Pyx_modinit_Global_init_code(__pyx_mstatetype *__pyx_mstate);
7057static CYTHON_SMALL_CODE
int __Pyx_modinit_Variable_export_code(__pyx_mstatetype *__pyx_mstate);
7058static CYTHON_SMALL_CODE
int __Pyx_modinit_Function_export_code(__pyx_mstatetype *__pyx_mstate);
7059static CYTHON_SMALL_CODE
int __Pyx_modinit_Type_import_code(__pyx_mstatetype *__pyx_mstate);
7060static CYTHON_SMALL_CODE
int __Pyx_modinit_Variable_import_code(__pyx_mstatetype *__pyx_mstate);
7061static CYTHON_SMALL_CODE
int __Pyx_modinit_Function_import_code(__pyx_mstatetype *__pyx_mstate);
7062static CYTHON_SMALL_CODE
int __Pyx_CreateCodeObjects(__pyx_mstatetype *__pyx_mstate);
7065static int __Pyx_modinit_Global_init_code(__pyx_mstatetype *__pyx_mstate) {
7066 __Pyx_RefNannyDeclarations
7067 CYTHON_UNUSED_VAR(__pyx_mstate);
7068 __Pyx_RefNannySetupContext(
"__Pyx_modinit_Global_init_code", 0);
7070 __Pyx_RefNannyFinishContext();
7074static int __Pyx_modinit_Variable_export_code(__pyx_mstatetype *__pyx_mstate) {
7075 __Pyx_RefNannyDeclarations
7076 CYTHON_UNUSED_VAR(__pyx_mstate);
7077 __Pyx_RefNannySetupContext(
"__Pyx_modinit_Variable_export_code", 0);
7079 __Pyx_RefNannyFinishContext();
7083static int __Pyx_modinit_Function_export_code(__pyx_mstatetype *__pyx_mstate) {
7084 __Pyx_RefNannyDeclarations
7085 CYTHON_UNUSED_VAR(__pyx_mstate);
7086 __Pyx_RefNannySetupContext(
"__Pyx_modinit_Function_export_code", 0);
7088 __Pyx_RefNannyFinishContext();
7092static int __Pyx_modinit_Type_import_code(__pyx_mstatetype *__pyx_mstate) {
7093 __Pyx_RefNannyDeclarations
7094 PyObject *__pyx_t_1 = NULL;
7095 int __pyx_lineno = 0;
7096 const char *__pyx_filename = NULL;
7097 int __pyx_clineno = 0;
7098 CYTHON_UNUSED_VAR(__pyx_mstate);
7099 __Pyx_RefNannySetupContext(
"__Pyx_modinit_Type_import_code", 0);
7101 __pyx_t_1 = PyImport_ImportModule(__Pyx_BUILTIN_MODULE_NAME);
if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 9, __pyx_L1_error)
7102 __Pyx_GOTREF(__pyx_t_1);
7103 __pyx_mstate->__pyx_ptype_7cpython_4type_type = __Pyx_ImportType_3_3_0(__pyx_t_1, __Pyx_BUILTIN_MODULE_NAME,
"type",
7104 #
if defined(PYPY_VERSION_NUM) && PYPY_VERSION_NUM < 0x050B0000
7105 sizeof(PyTypeObject), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(PyTypeObject),
7106 #elif CYTHON_COMPILING_IN_LIMITED_API
7109 sizeof(PyHeapTypeObject), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(PyHeapTypeObject),
7111 __Pyx_ImportType_CheckSize_Warn_3_3_0);
if (!__pyx_mstate->__pyx_ptype_7cpython_4type_type) __PYX_ERR(2, 9, __pyx_L1_error)
7112 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
7113 __pyx_t_1 = PyImport_ImportModule(
"numpy");
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 229, __pyx_L1_error)
7114 __Pyx_GOTREF(__pyx_t_1);
7115 __pyx_mstate->__pyx_ptype_5numpy_dtype = __Pyx_ImportType_3_3_0(__pyx_t_1,
"numpy",
"dtype",
7116 #
if defined(PYPY_VERSION_NUM) && PYPY_VERSION_NUM < 0x050B0000
7117 sizeof(PyArray_Descr), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(PyArray_Descr),
7118 #elif CYTHON_COMPILING_IN_LIMITED_API
7119 sizeof(PyArray_Descr), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(PyArray_Descr),
7121 sizeof(PyArray_Descr), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(PyArray_Descr),
7123 __Pyx_ImportType_CheckSize_Ignore_3_3_0);
if (!__pyx_mstate->__pyx_ptype_5numpy_dtype) __PYX_ERR(1, 229, __pyx_L1_error)
7124 __pyx_mstate->__pyx_ptype_5numpy_flatiter = __Pyx_ImportType_3_3_0(__pyx_t_1,
"numpy",
"flatiter",
7125 #
if defined(PYPY_VERSION_NUM) && PYPY_VERSION_NUM < 0x050B0000
7126 sizeof(PyArrayIterObject), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(PyArrayIterObject),
7127 #elif CYTHON_COMPILING_IN_LIMITED_API
7128 sizeof(PyArrayIterObject), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(PyArrayIterObject),
7130 sizeof(PyArrayIterObject), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(PyArrayIterObject),
7132 __Pyx_ImportType_CheckSize_Ignore_3_3_0);
if (!__pyx_mstate->__pyx_ptype_5numpy_flatiter) __PYX_ERR(1, 286, __pyx_L1_error)
7133 __pyx_mstate->__pyx_ptype_5numpy_broadcast = __Pyx_ImportType_3_3_0(__pyx_t_1,
"numpy",
"broadcast",
7134 #
if defined(PYPY_VERSION_NUM) && PYPY_VERSION_NUM < 0x050B0000
7135 sizeof(PyArrayMultiIterObject), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(PyArrayMultiIterObject),
7136 #elif CYTHON_COMPILING_IN_LIMITED_API
7137 sizeof(PyArrayMultiIterObject), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(PyArrayMultiIterObject),
7139 sizeof(PyArrayMultiIterObject), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(PyArrayMultiIterObject),
7141 __Pyx_ImportType_CheckSize_Ignore_3_3_0);
if (!__pyx_mstate->__pyx_ptype_5numpy_broadcast) __PYX_ERR(1, 290, __pyx_L1_error)
7142 __pyx_mstate->__pyx_ptype_5numpy_ndarray = __Pyx_ImportType_3_3_0(__pyx_t_1,
"numpy",
"ndarray",
7143 #
if defined(PYPY_VERSION_NUM) && PYPY_VERSION_NUM < 0x050B0000
7144 sizeof(PyArrayObject), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(PyArrayObject),
7145 #elif CYTHON_COMPILING_IN_LIMITED_API
7146 sizeof(PyArrayObject), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(PyArrayObject),
7148 sizeof(PyArrayObject), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(PyArrayObject),
7150 __Pyx_ImportType_CheckSize_Ignore_3_3_0);
if (!__pyx_mstate->__pyx_ptype_5numpy_ndarray) __PYX_ERR(1, 329, __pyx_L1_error)
7151 __pyx_mstate->__pyx_ptype_5numpy_generic = __Pyx_ImportType_3_3_0(__pyx_t_1,
"numpy",
"generic",
7152 #
if defined(PYPY_VERSION_NUM) && PYPY_VERSION_NUM < 0x050B0000
7153 sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(PyObject),
7154 #elif CYTHON_COMPILING_IN_LIMITED_API
7155 sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(PyObject),
7157 sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(PyObject),
7159 __Pyx_ImportType_CheckSize_Warn_3_3_0);
if (!__pyx_mstate->__pyx_ptype_5numpy_generic) __PYX_ERR(1, 847, __pyx_L1_error)
7160 __pyx_mstate->__pyx_ptype_5numpy_number = __Pyx_ImportType_3_3_0(__pyx_t_1,
"numpy",
"number",
7161 #
if defined(PYPY_VERSION_NUM) && PYPY_VERSION_NUM < 0x050B0000
7162 sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(PyObject),
7163 #elif CYTHON_COMPILING_IN_LIMITED_API
7164 sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(PyObject),
7166 sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(PyObject),
7168 __Pyx_ImportType_CheckSize_Warn_3_3_0);
if (!__pyx_mstate->__pyx_ptype_5numpy_number) __PYX_ERR(1, 849, __pyx_L1_error)
7169 __pyx_mstate->__pyx_ptype_5numpy_integer = __Pyx_ImportType_3_3_0(__pyx_t_1,
"numpy",
"integer",
7170 #
if defined(PYPY_VERSION_NUM) && PYPY_VERSION_NUM < 0x050B0000
7171 sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(PyObject),
7172 #elif CYTHON_COMPILING_IN_LIMITED_API
7173 sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(PyObject),
7175 sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(PyObject),
7177 __Pyx_ImportType_CheckSize_Warn_3_3_0);
if (!__pyx_mstate->__pyx_ptype_5numpy_integer) __PYX_ERR(1, 851, __pyx_L1_error)
7178 __pyx_mstate->__pyx_ptype_5numpy_signedinteger = __Pyx_ImportType_3_3_0(__pyx_t_1,
"numpy",
"signedinteger",
7179 #
if defined(PYPY_VERSION_NUM) && PYPY_VERSION_NUM < 0x050B0000
7180 sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(PyObject),
7181 #elif CYTHON_COMPILING_IN_LIMITED_API
7182 sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(PyObject),
7184 sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(PyObject),
7186 __Pyx_ImportType_CheckSize_Warn_3_3_0);
if (!__pyx_mstate->__pyx_ptype_5numpy_signedinteger) __PYX_ERR(1, 853, __pyx_L1_error)
7187 __pyx_mstate->__pyx_ptype_5numpy_unsignedinteger = __Pyx_ImportType_3_3_0(__pyx_t_1,
"numpy",
"unsignedinteger",
7188 #
if defined(PYPY_VERSION_NUM) && PYPY_VERSION_NUM < 0x050B0000
7189 sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(PyObject),
7190 #elif CYTHON_COMPILING_IN_LIMITED_API
7191 sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(PyObject),
7193 sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(PyObject),
7195 __Pyx_ImportType_CheckSize_Warn_3_3_0);
if (!__pyx_mstate->__pyx_ptype_5numpy_unsignedinteger) __PYX_ERR(1, 855, __pyx_L1_error)
7196 __pyx_mstate->__pyx_ptype_5numpy_inexact = __Pyx_ImportType_3_3_0(__pyx_t_1,
"numpy",
"inexact",
7197 #
if defined(PYPY_VERSION_NUM) && PYPY_VERSION_NUM < 0x050B0000
7198 sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(PyObject),
7199 #elif CYTHON_COMPILING_IN_LIMITED_API
7200 sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(PyObject),
7202 sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(PyObject),
7204 __Pyx_ImportType_CheckSize_Warn_3_3_0);
if (!__pyx_mstate->__pyx_ptype_5numpy_inexact) __PYX_ERR(1, 857, __pyx_L1_error)
7205 __pyx_mstate->__pyx_ptype_5numpy_floating = __Pyx_ImportType_3_3_0(__pyx_t_1,
"numpy",
"floating",
7206 #
if defined(PYPY_VERSION_NUM) && PYPY_VERSION_NUM < 0x050B0000
7207 sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(PyObject),
7208 #elif CYTHON_COMPILING_IN_LIMITED_API
7209 sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(PyObject),
7211 sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(PyObject),
7213 __Pyx_ImportType_CheckSize_Warn_3_3_0);
if (!__pyx_mstate->__pyx_ptype_5numpy_floating) __PYX_ERR(1, 859, __pyx_L1_error)
7214 __pyx_mstate->__pyx_ptype_5numpy_complexfloating = __Pyx_ImportType_3_3_0(__pyx_t_1,
"numpy",
"complexfloating",
7215 #
if defined(PYPY_VERSION_NUM) && PYPY_VERSION_NUM < 0x050B0000
7216 sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(PyObject),
7217 #elif CYTHON_COMPILING_IN_LIMITED_API
7218 sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(PyObject),
7220 sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(PyObject),
7222 __Pyx_ImportType_CheckSize_Warn_3_3_0);
if (!__pyx_mstate->__pyx_ptype_5numpy_complexfloating) __PYX_ERR(1, 861, __pyx_L1_error)
7223 __pyx_mstate->__pyx_ptype_5numpy_flexible = __Pyx_ImportType_3_3_0(__pyx_t_1,
"numpy",
"flexible",
7224 #
if defined(PYPY_VERSION_NUM) && PYPY_VERSION_NUM < 0x050B0000
7225 sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(PyObject),
7226 #elif CYTHON_COMPILING_IN_LIMITED_API
7227 sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(PyObject),
7229 sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(PyObject),
7231 __Pyx_ImportType_CheckSize_Warn_3_3_0);
if (!__pyx_mstate->__pyx_ptype_5numpy_flexible) __PYX_ERR(1, 863, __pyx_L1_error)
7232 __pyx_mstate->__pyx_ptype_5numpy_character = __Pyx_ImportType_3_3_0(__pyx_t_1,
"numpy",
"character",
7233 #
if defined(PYPY_VERSION_NUM) && PYPY_VERSION_NUM < 0x050B0000
7234 sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(PyObject),
7235 #elif CYTHON_COMPILING_IN_LIMITED_API
7236 sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(PyObject),
7238 sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(PyObject),
7240 __Pyx_ImportType_CheckSize_Warn_3_3_0);
if (!__pyx_mstate->__pyx_ptype_5numpy_character) __PYX_ERR(1, 865, __pyx_L1_error)
7241 __pyx_mstate->__pyx_ptype_5numpy_ufunc = __Pyx_ImportType_3_3_0(__pyx_t_1,
"numpy",
"ufunc",
7242 #
if defined(PYPY_VERSION_NUM) && PYPY_VERSION_NUM < 0x050B0000
7243 sizeof(PyUFuncObject), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(PyUFuncObject),
7244 #elif CYTHON_COMPILING_IN_LIMITED_API
7245 sizeof(PyUFuncObject), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(PyUFuncObject),
7247 sizeof(PyUFuncObject), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(PyUFuncObject),
7249 __Pyx_ImportType_CheckSize_Ignore_3_3_0);
if (!__pyx_mstate->__pyx_ptype_5numpy_ufunc) __PYX_ERR(1, 946, __pyx_L1_error)
7250 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
7251 __Pyx_RefNannyFinishContext();
7254 __Pyx_XDECREF(__pyx_t_1);
7255 __Pyx_RefNannyFinishContext();
7259static int __Pyx_modinit_Variable_import_code(__pyx_mstatetype *__pyx_mstate) {
7260 __Pyx_RefNannyDeclarations
7261 CYTHON_UNUSED_VAR(__pyx_mstate);
7262 __Pyx_RefNannySetupContext(
"__Pyx_modinit_Variable_import_code", 0);
7264 __Pyx_RefNannyFinishContext();
7268static int __Pyx_modinit_Function_import_code(__pyx_mstatetype *__pyx_mstate) {
7269 __Pyx_RefNannyDeclarations
7270 CYTHON_UNUSED_VAR(__pyx_mstate);
7271 __Pyx_RefNannySetupContext(
"__Pyx_modinit_Function_import_code", 0);
7273 __Pyx_RefNannyFinishContext();
7277#if CYTHON_PEP489_MULTI_PHASE_INIT
7278static PyObject* __pyx_pymod_create(PyObject *spec, PyModuleDef *def);
7279static int __pyx_pymod_exec_cshockCapturing(PyObject* module);
7280static PyModuleDef_Slot __pyx_moduledef_slots[] = {
7281 {Py_mod_create, (
void*)__pyx_pymod_create},
7282 {Py_mod_exec, (
void*)__pyx_pymod_exec_cshockCapturing},
7283 #if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING
7284 {Py_mod_gil, __Pyx_FREETHREADING_COMPATIBLE},
7286 #if PY_VERSION_HEX >= 0x030C0000 && CYTHON_USE_MODULE_STATE
7287 {Py_mod_multiple_interpreters, Py_MOD_MULTIPLE_INTERPRETERS_NOT_SUPPORTED},
7295 struct PyModuleDef __pyx_moduledef =
7297 static struct PyModuleDef __pyx_moduledef =
7300 PyModuleDef_HEAD_INIT,
7303 #if CYTHON_USE_MODULE_STATE
7304 sizeof(__pyx_mstatetype),
7306 (CYTHON_PEP489_MULTI_PHASE_INIT) ? 0 : -1,
7309 #if CYTHON_PEP489_MULTI_PHASE_INIT
7310 __pyx_moduledef_slots,
7314 #if CYTHON_USE_MODULE_STATE
7329#ifndef CYTHON_NO_PYINIT_EXPORT
7330 #define __Pyx_PyMODINIT_FUNC PyMODINIT_FUNC
7333 #define __Pyx_PyMODINIT_FUNC extern "C" PyObject *
7335 #define __Pyx_PyMODINIT_FUNC PyObject *
7339__Pyx_PyMODINIT_FUNC PyInit_cshockCapturing(
void) CYTHON_SMALL_CODE;
7340__Pyx_PyMODINIT_FUNC PyInit_cshockCapturing(
void)
7341#if CYTHON_PEP489_MULTI_PHASE_INIT
7343 return PyModuleDef_Init(&__pyx_moduledef);
7346#if CYTHON_COMPILING_IN_LIMITED_API && (__PYX_LIMITED_VERSION_HEX < 0x030A0000 &&\
7347 (defined(_WIN32) || defined(WIN32) || defined(MS_WINDOWS)))
7348static PY_INT64_T __Pyx_GetCurrentInterpreterId(
void) {
7350 PyObject *module = PyImport_ImportModule(
"_interpreters");
7352 if (!PyErr_ExceptionMatches(PyExc_Exception)) {
7356 module = PyImport_ImportModule("_xxsubinterpreters");
7357 if (!module)
goto bad;
7359 PyObject *current = PyObject_CallMethod(module,
"get_current", NULL);
7361 if (!current)
goto bad;
7362 if (PyTuple_Check(current)) {
7363 PyObject *new_current = PySequence_GetItem(current, 0);
7365 current = new_current;
7366 if (!new_current)
goto bad;
7368 long long as_c_int = PyLong_AsLongLong(current);
7373 PySys_WriteStderr(
"__Pyx_GetCurrentInterpreterId failed. Try setting the C define CYTHON_PEP489_MULTI_PHASE_INIT=0\n");
7377#if !CYTHON_USE_MODULE_STATE
7378static CYTHON_SMALL_CODE
int __Pyx_check_single_interpreter(
void) {
7379 static PY_INT64_T main_interpreter_id = -1;
7380#if CYTHON_COMPILING_IN_GRAAL && defined(GRAALPY_VERSION_NUM) && GRAALPY_VERSION_NUM > 0x19000000
7381 PY_INT64_T current_id = GraalPyInterpreterState_GetIDFromThreadState(PyThreadState_Get());
7382#elif CYTHON_COMPILING_IN_GRAAL
7383 PY_INT64_T current_id = PyInterpreterState_GetIDFromThreadState(PyThreadState_Get());
7384#elif CYTHON_COMPILING_IN_LIMITED_API && (__PYX_LIMITED_VERSION_HEX < 0x030A0000 &&\
7385 (defined(_WIN32) || defined(WIN32) || defined(MS_WINDOWS)))
7386 PY_INT64_T current_id = __Pyx_GetCurrentInterpreterId();
7387#elif CYTHON_COMPILING_IN_LIMITED_API
7388 PY_INT64_T current_id = PyInterpreterState_GetID(PyInterpreterState_Get());
7390 PY_INT64_T current_id = PyInterpreterState_GetID(PyThreadState_Get()->interp);
7392 if (unlikely(current_id == -1)) {
7395 if (main_interpreter_id == -1) {
7396 main_interpreter_id = current_id;
7398 }
else if (unlikely(main_interpreter_id != current_id)) {
7401 "Interpreter change detected - this module can only be loaded into one interpreter per process.");
7407static CYTHON_SMALL_CODE
int __Pyx_copy_spec_to_module(PyObject *spec, PyObject *moddict,
const char* from_name,
const char* to_name,
int allow_none)
7409 PyObject *value = PyObject_GetAttrString(spec, from_name);
7411 if (likely(value)) {
7412 if (allow_none || value != Py_None) {
7413 result = PyDict_SetItemString(moddict, to_name, value);
7416 }
else if (PyErr_ExceptionMatches(PyExc_AttributeError)) {
7423static CYTHON_SMALL_CODE PyObject* __pyx_pymod_create(PyObject *spec, PyModuleDef *def) {
7424 PyObject *module = NULL, *moddict, *modname;
7425 CYTHON_UNUSED_VAR(def);
7426 #if !CYTHON_USE_MODULE_STATE
7427 if (__Pyx_check_single_interpreter())
7431 return __Pyx_NewRef(__pyx_m);
7432 modname = PyObject_GetAttrString(spec,
"name");
7433 if (unlikely(!modname))
goto bad;
7434 module = PyModule_NewObject(modname);
7436 if (unlikely(!module))
goto bad;
7437 moddict = PyModule_GetDict(module);
7438 if (unlikely(!moddict))
goto bad;
7439 if (unlikely(__Pyx_copy_spec_to_module(spec, moddict,
"loader",
"__loader__", 1) < 0))
goto bad;
7440 if (unlikely(__Pyx_copy_spec_to_module(spec, moddict,
"origin",
"__file__", 1) < 0))
goto bad;
7441 if (unlikely(__Pyx_copy_spec_to_module(spec, moddict,
"parent",
"__package__", 1) < 0))
goto bad;
7442 if (unlikely(__Pyx_copy_spec_to_module(spec, moddict,
"submodule_search_locations",
"__path__", 0) < 0))
goto bad;
7450static CYTHON_SMALL_CODE
int __pyx_pymod_exec_cshockCapturing(PyObject *__pyx_pyinit_module)
7453 int stringtab_initialized = 0;
7454 #if CYTHON_USE_MODULE_STATE
7455 int pystate_addmodule_run = 0;
7457 __pyx_mstatetype *__pyx_mstate = NULL;
7458 PyObject *__pyx_t_1 = NULL;
7459 PyObject *__pyx_t_2 = NULL;
7460 int __pyx_lineno = 0;
7461 const char *__pyx_filename = NULL;
7462 int __pyx_clineno = 0;
7463 __Pyx_RefNannyDeclarations
7464 #if CYTHON_PEP489_MULTI_PHASE_INIT
7466 if (__pyx_m == __pyx_pyinit_module)
return 0;
7467 PyErr_SetString(PyExc_RuntimeError,
"Module 'cshockCapturing' has already been imported. Re-initialisation is not supported.");
7471 if (__pyx_m)
return __Pyx_NewRef(__pyx_m);
7474 #if CYTHON_PEP489_MULTI_PHASE_INIT
7475 __pyx_t_1 = __pyx_pyinit_module;
7476 Py_INCREF(__pyx_t_1);
7478 __pyx_t_1 = PyModule_Create(&__pyx_moduledef);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1, __pyx_L1_error)
7480 #if CYTHON_USE_MODULE_STATE
7482 int add_module_result = __Pyx_State_AddModule(__pyx_t_1, &__pyx_moduledef);
7484 if (unlikely((add_module_result < 0))) __PYX_ERR(0, 1, __pyx_L1_error)
7485 pystate_addmodule_run = 1;
7488 __pyx_m = __pyx_t_1;
7490 #if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING
7491 PyUnstable_Module_SetGIL(__pyx_m, Py_MOD_GIL_USED);
7493 __pyx_mstate = __pyx_mstate_global;
7494 CYTHON_UNUSED_VAR(__pyx_t_1);
7495 __pyx_mstate->__pyx_d = PyModule_GetDict(__pyx_m);
if (unlikely(!__pyx_mstate->__pyx_d)) __PYX_ERR(0, 1, __pyx_L1_error)
7496 Py_INCREF(__pyx_mstate->__pyx_d);
7497 __pyx_mstate->__pyx_b = __Pyx_PyImport_AddModuleRef(__Pyx_BUILTIN_MODULE_NAME);
if (unlikely(!__pyx_mstate->__pyx_b)) __PYX_ERR(0, 1, __pyx_L1_error)
7498 __pyx_mstate->__pyx_cython_runtime = __Pyx_PyImport_AddModuleRef(
"cython_runtime");
if (unlikely(!__pyx_mstate->__pyx_cython_runtime)) __PYX_ERR(0, 1, __pyx_L1_error)
7499 if (PyObject_SetAttrString(__pyx_m,
"__builtins__", __pyx_mstate->__pyx_b) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
7502 __Pyx_RefNanny = __Pyx_RefNannyImportAPI(
"refnanny");
7503 if (!__Pyx_RefNanny) {
7504 if (PyErr_ExceptionMatches(PyExc_Exception)) {
7506 __Pyx_RefNanny = __Pyx_RefNannyImportAPI(
"Cython.Runtime.refnanny");
7508 if (!__Pyx_RefNanny)
7509 Py_FatalError(
"failed to import 'refnanny' module");
7513__Pyx_RefNannySetupContext(
"PyInit_cshockCapturing", 0);
7514 __Pyx_init_runtime_version();
7515 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)
7516 __pyx_mstate->__pyx_empty_tuple = PyTuple_New(0);
if (unlikely(!__pyx_mstate->__pyx_empty_tuple)) __PYX_ERR(0, 1, __pyx_L1_error)
7517 __pyx_mstate->__pyx_empty_bytes = PyBytes_FromStringAndSize(
"", 0);
if (unlikely(!__pyx_mstate->__pyx_empty_bytes)) __PYX_ERR(0, 1, __pyx_L1_error)
7518 __pyx_mstate->__pyx_empty_unicode = PyUnicode_FromStringAndSize(
"", 0);
if (unlikely(!__pyx_mstate->__pyx_empty_unicode)) __PYX_ERR(0, 1, __pyx_L1_error)
7521 if (__Pyx_InitConstants(__pyx_mstate) < (0)) __PYX_ERR(0, 1, __pyx_L1_error)
7522 stringtab_initialized = 1;
7523 if (__Pyx_InitGlobals() < (0)) __PYX_ERR(0, 1, __pyx_L1_error)
7524 if (__pyx_module_is_main_cshockCapturing) {
7525 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)
7528 PyObject *modules = PyImport_GetModuleDict();
if (unlikely(!modules)) __PYX_ERR(0, 1, __pyx_L1_error)
7529 if (!PyDict_GetItemString(modules,
"cshockCapturing")) {
7530 if (unlikely((PyDict_SetItemString(modules,
"cshockCapturing", __pyx_m) < 0))) __PYX_ERR(0, 1, __pyx_L1_error)
7534 if (__Pyx_InitCachedBuiltins(__pyx_mstate) < (0)) __PYX_ERR(0, 1, __pyx_L1_error)
7536 if (__Pyx_InitCachedConstants(__pyx_mstate) < (0)) __PYX_ERR(0, 1, __pyx_L1_error)
7537 if (__Pyx_CreateCodeObjects(__pyx_mstate) < (0)) __PYX_ERR(0, 1, __pyx_L1_error)
7539 (void)__Pyx_modinit_Global_init_code(__pyx_mstate);
7540 (void)__Pyx_modinit_Variable_export_code(__pyx_mstate);
7541 (void)__Pyx_modinit_Function_export_code(__pyx_mstate);
7543 if (unlikely((__Pyx_modinit_Type_import_code(__pyx_mstate) < 0))) __PYX_ERR(0, 1, __pyx_L1_error)
7544 (void)__Pyx_modinit_Variable_import_code(__pyx_mstate);
7545 (void)__Pyx_modinit_Function_import_code(__pyx_mstate);
7546 if (__Pyx_InitAfterSharedUtility() < (0)) __PYX_ERR(0, 1, __pyx_L1_error)
7556 __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)
7557 __pyx_t_2 = __pyx_t_1;
7558 __Pyx_GOTREF(__pyx_t_2);
7559 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)
7560 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
7569 __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_15cshockCapturing_1calculateNumericalDiffusionResGrad, 0, __pyx_mstate_global->__pyx_n_u_calculateNumericalDiffusionResGr, NULL, __pyx_mstate_global->__pyx_n_u_cshockCapturing, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[0]));
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 74, __pyx_L1_error)
7570 __Pyx_GOTREF(__pyx_t_2);
7571 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
7572 PyUnstable_Object_EnableDeferredRefcount(__pyx_t_2);
7574 if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_calculateNumericalDiffusionResGr, __pyx_t_2) < (0)) __PYX_ERR(0, 74, __pyx_L1_error)
7575 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
7584 __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_15cshockCapturing_3calculateNumericalDiffusionResGradQuad, 0, __pyx_mstate_global->__pyx_n_u_calculateNumericalDiffusionResGr_2, NULL, __pyx_mstate_global->__pyx_n_u_cshockCapturing, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1]));
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 87, __pyx_L1_error)
7585 __Pyx_GOTREF(__pyx_t_2);
7586 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
7587 PyUnstable_Object_EnableDeferredRefcount(__pyx_t_2);
7589 if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_calculateNumericalDiffusionResGr_2, __pyx_t_2) < (0)) __PYX_ERR(0, 87, __pyx_L1_error)
7590 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
7599 __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_15cshockCapturing_5calculateNumericalDiffusionEikonal, 0, __pyx_mstate_global->__pyx_n_u_calculateNumericalDiffusionEikon, NULL, __pyx_mstate_global->__pyx_n_u_cshockCapturing, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[2]));
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 100, __pyx_L1_error)
7600 __Pyx_GOTREF(__pyx_t_2);
7601 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
7602 PyUnstable_Object_EnableDeferredRefcount(__pyx_t_2);
7604 if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_calculateNumericalDiffusionEikon, __pyx_t_2) < (0)) __PYX_ERR(0, 100, __pyx_L1_error)
7605 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
7614 __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_15cshockCapturing_7calculateNumericalDiffusionHJ, 0, __pyx_mstate_global->__pyx_n_u_calculateNumericalDiffusionHJ, NULL, __pyx_mstate_global->__pyx_n_u_cshockCapturing, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[3]));
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 110, __pyx_L1_error)
7615 __Pyx_GOTREF(__pyx_t_2);
7616 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
7617 PyUnstable_Object_EnableDeferredRefcount(__pyx_t_2);
7619 if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_calculateNumericalDiffusionHJ, __pyx_t_2) < (0)) __PYX_ERR(0, 110, __pyx_L1_error)
7620 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
7629 __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_15cshockCapturing_9calculateNumericalDiffusionHJV2, 0, __pyx_mstate_global->__pyx_n_u_calculateNumericalDiffusionHJV2, NULL, __pyx_mstate_global->__pyx_n_u_cshockCapturing, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[4]));
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 126, __pyx_L1_error)
7630 __Pyx_GOTREF(__pyx_t_2);
7631 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
7632 PyUnstable_Object_EnableDeferredRefcount(__pyx_t_2);
7634 if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_calculateNumericalDiffusionHJV2, __pyx_t_2) < (0)) __PYX_ERR(0, 126, __pyx_L1_error)
7635 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
7644 __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_15cshockCapturing_11calculateNumericalDiffusion_A_1, 0, __pyx_mstate_global->__pyx_n_u_calculateNumericalDiffusion_A_1, NULL, __pyx_mstate_global->__pyx_n_u_cshockCapturing, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[5]));
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 142, __pyx_L1_error)
7645 __Pyx_GOTREF(__pyx_t_2);
7646 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
7647 PyUnstable_Object_EnableDeferredRefcount(__pyx_t_2);
7649 if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_calculateNumericalDiffusion_A_1, __pyx_t_2) < (0)) __PYX_ERR(0, 142, __pyx_L1_error)
7650 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
7659 __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_15cshockCapturing_13calculateNumericalDiffusionResGradJuanes, 0, __pyx_mstate_global->__pyx_n_u_calculateNumericalDiffusionResGr_3, NULL, __pyx_mstate_global->__pyx_n_u_cshockCapturing, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[6]));
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 157, __pyx_L1_error)
7660 __Pyx_GOTREF(__pyx_t_2);
7661 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
7662 PyUnstable_Object_EnableDeferredRefcount(__pyx_t_2);
7664 if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_calculateNumericalDiffusionResGr_3, __pyx_t_2) < (0)) __PYX_ERR(0, 157, __pyx_L1_error)
7665 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
7674 __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_15cshockCapturing_15calculateNumericalDiffusionJaffre, 0, __pyx_mstate_global->__pyx_n_u_calculateNumericalDiffusionJaffr, NULL, __pyx_mstate_global->__pyx_n_u_cshockCapturing, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[7]));
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 172, __pyx_L1_error)
7675 __Pyx_GOTREF(__pyx_t_2);
7676 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
7677 PyUnstable_Object_EnableDeferredRefcount(__pyx_t_2);
7679 if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_calculateNumericalDiffusionJaffr, __pyx_t_2) < (0)) __PYX_ERR(0, 172, __pyx_L1_error)
7680 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
7687 __pyx_t_2 = __Pyx_PyDict_NewPresized(0);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1, __pyx_L1_error)
7688 __Pyx_GOTREF(__pyx_t_2);
7689 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)
7690 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
7696 __Pyx_XDECREF(__pyx_t_2);
7698 if (__pyx_mstate->__pyx_d && stringtab_initialized) {
7699 __Pyx_AddTraceback(
"init cshockCapturing", __pyx_clineno, __pyx_lineno, __pyx_filename);
7701 #if !CYTHON_USE_MODULE_STATE
7705 if (pystate_addmodule_run) {
7706 PyObject *tp, *value, *tb;
7707 __Pyx_PyErr_FetchException(&tp, &value, &tb);
7708 __Pyx_State_RemoveModule(&__pyx_moduledef);
7709 __Pyx_PyErr_RestoreException(tp, value, tb);
7712 }
else if (!PyErr_Occurred()) {
7713 PyErr_SetString(PyExc_ImportError,
"init cshockCapturing");
7716 __Pyx_RefNannyFinishContext();
7717 #if CYTHON_PEP489_MULTI_PHASE_INIT
7718 return (__pyx_m != NULL) ? 0 : -1;
7726static int __Pyx_InitCachedBuiltins(__pyx_mstatetype *__pyx_mstate) {
7727 CYTHON_UNUSED_VAR(__pyx_mstate);
7730 __pyx_mstate->__pyx_umethod_PyDict_Type_items.type = (PyObject*)&PyDict_Type;
7731 __pyx_mstate->__pyx_umethod_PyDict_Type_items.method_name = &__pyx_mstate->__pyx_n_u_items;
7732 __pyx_mstate->__pyx_umethod_PyDict_Type_pop.type = (PyObject*)&PyDict_Type;
7733 __pyx_mstate->__pyx_umethod_PyDict_Type_pop.method_name = &__pyx_mstate->__pyx_n_u_pop;
7734 __pyx_mstate->__pyx_umethod_PyDict_Type_values.type = (PyObject*)&PyDict_Type;
7735 __pyx_mstate->__pyx_umethod_PyDict_Type_values.method_name = &__pyx_mstate->__pyx_n_u_values;
7740static int __Pyx_InitCachedConstants(__pyx_mstatetype *__pyx_mstate) {
7741 __Pyx_RefNannyDeclarations
7742 CYTHON_UNUSED_VAR(__pyx_mstate);
7743 __Pyx_RefNannySetupContext(
"__Pyx_InitCachedConstants", 0);
7744 __Pyx_RefNannyFinishContext();
7749static int __Pyx_InitConstants(__pyx_mstatetype *__pyx_mstate) {
7750 int __pyx_lineno = 0;
7751 const char *__pyx_filename = NULL;
7752 int __pyx_clineno = 0;
7753 CYTHON_UNUSED_VAR(__pyx_mstate);
7755 const struct {
const unsigned int length: 8; } str_length_index[] = {{1},{179},{8},{39},{34},{27},{1},{20},{12},{8},{8},{10},{8},{12},{8},{13},{18},{4},{34},{29},{31},{33},{34},{40},{38},{31},{18},{15},{2},{15},{6},{5},{2},{2},{7},{5},{3},{10},{14},{23},{20},{15},{3},{6}};
7756 const struct {
const unsigned int length: 7; } bytes_length_index[] = {{50},{66},{66},{73},{69},{69},{67},{67}};
7757 #ifndef CYTHON_COMPRESS_STRINGS
7758 #define CYTHON_COMPRESS_STRINGS 90
7760 #if (CYTHON_COMPRESS_STRINGS) == 1
7761static const char cstring[] =
"x\332\235S\315n\323@\020n\016\005\204\020R\336`+\332& p\225\212\0037\024\265\r\245\207\252.R\257\253\211=\233,\265w\335\375\211\352\033\217\342\343\036}\314\221\307\310c\360\010\214\323\0379\364O\324\222=\343\235o\276\231\375v\366\353\261v\310\334\024\034\333+\335T+&-K1\223c4\3400+\231uF&\016M\003R\354\344\340\344\323\347/\237\031\250\224\031\374\211\211\263\314\372q\222\201\265h\231\026l\354e\346\244b\256,\320F\354\273`\245\366L!\246\314iV\020\256\235\340\246\250\230E\3278\254\007Ji\007Nj\305)]\252I\217\245\322P\0219\303&{\004\231\305\010\322\224\023\016\225\317\2132\342\2116\030\345\236\212\2021P2\0012\273*&\363B\033\327\206\371\034\334\364\016\2420\304\346\355Nb\247:9\337\203\302yC\305\243\242\274<\344\374\244\274\244w\237D\340\307x\351NQp~\335(rz\204WIcs\220jiu\352\263eDA\276\264\027\036\262\033\337\241ud\244m\032\322\236\224B\260\245J\244\216n\027\354\030\035$\220%>\243\032\307>G:\002\310\366\245\020\336\2228\007\362\\+\n?\2148<z4x\266\373H\370\010\204 \315\037\006\234\242\375f }\032q\344\2016\3634.\366\217\262\361!\037$\031\351\302I`g \3011$\347\377\034V*0\303\034\225\333\227\2444\315\353\204\210\271\227\016s\233;U\320\0244\204\313a(tA#\227\242\000\232\232U\232\325\277\333\026V\227G\2208m\350bh5\341\006\255L\351\200\375\217\275\031}\321\376\352\374y\265\266\336\257.\302\3130\253\343\032\026\375\235\033\347\375\242\277[\357\374\356\266Lo\336\245\214\327W\031/\202\250\207u\274\350Gw\234{R\267\347\235\025\206\217a\020F\315\352\274\373\034\2067k\353[\325\260:\255f!\016\260\330\334\256D\030\206\270\345l-6\243\240\347q\313\214\353N\313L\352\370\212\250W\001\321\234\325\203z\270\330\374\020\266\353N\335m9[\367r\211\006\334\"\211\250\017Q\217\346\033\363\3013I\336\256\255\277\2536\252A5\n\033\201H\266\2523\322h\370P\356\365. \\\254P4\252\304\267\032\374\047\305_\322R)\350";
7762 PyObject *data = __Pyx_DecompressString(cstring, 615, 1);
7763 #define __Pyx_DecompressString_LZSS_UNUSED
7764 if (unlikely(!data)) __PYX_ERR(0, 1, __pyx_L1_error)
7765 const char*
const bytes = __Pyx_PyBytes_AsString(data);
7766 #if !CYTHON_ASSUME_SAFE_MACROS
7767 if (likely(bytes));
else { Py_DECREF(data); __PYX_ERR(0, 1, __pyx_L1_error) }
7769 #elif (CYTHON_COMPRESS_STRINGS) > 0 && (CYTHON_COMPRESS_STRINGS) <= 90
7770static 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\377shockCap\367turz\000.pyx\277H__Pyx\001\000D\376\202 _NextRe\367f__\242\004e___\337_func\004\001ma{in\003\002odul\025\002\367nam\035\002qual\336\004\005test3\000is\366\264\001ou\247 easy\237ncio.\306\000\013\003s\377betacalc{ul\201@Nume\200@\377alDiffus>\232 Eikon\034\000\010\027{HJ$\030HJV2C\030\317Jaff\361 e\027Re\277sGradc\001\036J\337uanes\006\037Qu\3761\032_A_1cli\367ne_\336 trac\337eback\236Ldf\377elementD\275i\363 terg\240\000_\377uitemsmt\343np\252`\274!\257bpop\036\360`defa\263`\346K\364K\374\351&\213kFactor\377strong_r\357esid\336@uSC\377values\200\001\377\360\010\000\005(\240q\250\377\007\250v\260Q\260a\330\373(/\001\005)\330(2\260\347/\300\021\000\004\n\001\047\270\021\372/\000\n,\003\006\250f\260A\037\260Q\330(.\000\006\n\005(\020\367&\270\0015\n,\2501\250\333F\260\023\000\270\021\0161\014\000\377\005%\240A\240R\240v\377\250Q\250a\330$&\240\337f\250A\250Q\000\006\330$\377%\330$.\250o\270Q\234\000\004\n\001b\260\001\000\004\030\001gs\260Q\374\000F\000\047\240aD\000\377V\2601\260A\330$*?\250&\260\001\260\021\000\006D\002\3509\020\371\0008\n.\205\000f\260F\357\270!\2701\0164\016\000\005\377#\240!\2401\240F\250\273!\250B\000%\240V\241 A\\i\025\306\004a\250q\303\007\016\220#\001Q\205%\023-";
7771 PyObject *data = __Pyx_DecompressString_LZSS(cstring, 793, 1378);
7772 #define __Pyx_DecompressString_UNUSED
7773 if (unlikely(!data)) __PYX_ERR(0, 1, __pyx_L1_error)
7774 const char*
const bytes = __Pyx_PyBytes_AsString(data);
7775 #if !CYTHON_ASSUME_SAFE_MACROS
7776 if (likely(bytes));
else { Py_DECREF(data); __PYX_ERR(0, 1, __pyx_L1_error) }
7779static 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/cshockCapturing.pyxH__Pyx_PyDict_NextRef__annotate____func____main____module____name____qualname____test___is_coroutineasyncio.coroutinesbetacalculateNumericalDiffusionEikonalcalculateNumericalDiffusionHJcalculateNumericalDiffusionHJV2calculateNumericalDiffusionJaffrecalculateNumericalDiffusionResGradcalculateNumericalDiffusionResGradJuanescalculateNumericalDiffusionResGradQuadcalculateNumericalDiffusion_A_1cline_in_tracebackcshockCapturingdfelementDiametergrad_uitemsmtnpnumDiffnumpypopsetdefaultshockCapturingshockCapturingDiffusionshockCapturingFactorstrong_residualuSCvalues\200\001\360\010\000\005(\240q\250\007\250v\260Q\260a\330(/\250v\260Q\260a\330()\330(2\260/\300\021\330(2\260/\300\021\330(2\260\047\270\021\200\001\360\n\000\005(\240q\250\006\250f\260A\260Q\330(.\250f\260A\260Q\330(.\250f\260A\260Q\330()\330(2\260/\300\021\330(2\260/\300\021\330(2\260&\270\001\330(2\260\047\270\021\200\001\360\n\000\005,\2501\250F\260&\270\001\270\021\330(.\250f\260A\260Q\330(.\250f\260A\260Q\330()\330(2\260/\300\021\330(2\260/\300\021\330(2\260&\270\001\330(2\260\047\270\021\200\001\360\014\000\005%\240A\240R\240v\250Q\250a\330$&\240f\250A\250Q\330$&\240f\250A\250Q\330$%\330$.\250o\270Q\330$.\250o\270Q\330$.\250b\260\001\330$.\250b\260\001\330$.\250g\260Q\200\001\360\014\000\005\047\240a\240v\250V\2601\260A\330$*\250&\260\001\260\021\330$*\250&\260\001\260\021\330$%\330$%\330$.\250o\270Q\330$.\250o\270Q\330$.\250f\260A\330$.\250g\260Q\200\001\360\014\000\005.\250Q\250f\260F\270!\2701\330$*\250&\260\001\260\021\330$*\250&\260\001\260\021\330$%\330$%\330$.\250o\270Q\330$.\250o\270Q\330$.\250f\260A\330$.\250g\260Q\200\001\360\016\000\005#\240!\2401\240F\250!\2501\330$%\240V\2501\250A\330$%\330$%\330$.\250o""\270Q\330$.\250o\270Q\330$.\250b\260\001\330$.\250a\250q\330$.\250g\260Q\200\001\360\016\000\005%\240A\240Q\240f\250A\250Q\330$%\240V\2501\250A\330$%\330$%\330$.\250o\270Q\330$.\250o\270Q\330$.\250b\260\001\330$.\250a\250q\330$.\250g\260Q";
7780 PyObject *data = NULL;
7781 #define __Pyx_DecompressString_UNUSED
7782 #define __Pyx_DecompressString_LZSS_UNUSED
7784 PyObject **stringtab = __pyx_mstate->__pyx_string_tab;
7786 for (
int i = 0; i < 44; i++) {
7787 Py_ssize_t bytes_length = str_length_index[i].length;
7788 PyObject *
string = PyUnicode_DecodeUTF8(bytes + pos, bytes_length, NULL);
7789 if (likely(
string) && i >= 6) PyUnicode_InternInPlace(&
string);
7790 if (unlikely(!
string)) {
7792 __PYX_ERR(0, 1, __pyx_L1_error)
7794 stringtab[i] = string;
7795 pos += bytes_length;
7797 for (
int i = 44; i < 52; i++) {
7798 Py_ssize_t bytes_length = bytes_length_index[i-44].length;
7799 PyObject *
string = PyBytes_FromStringAndSize(bytes + pos, bytes_length);
7800 stringtab[i] = string;
7801 pos += bytes_length;
7802 if (unlikely(!
string)) {
7804 __PYX_ERR(0, 1, __pyx_L1_error)
7808 for (Py_ssize_t i = 0; i < 52; i++) {
7809 if (unlikely(PyObject_Hash(stringtab[i]) == -1)) {
7810 __PYX_ERR(0, 1, __pyx_L1_error)
7813 #if CYTHON_IMMORTAL_CONSTANTS
7815 PyObject **table = stringtab + 44;
7816 for (Py_ssize_t i=0; i<8; ++i) {
7817 #if PY_VERSION_HEX >= 0x030F0000
7818 PyUnstable_SetImmortal(table[i]);
7819 #elif CYTHON_COMPILING_IN_CPYTHON_FREETHREADING
7820 if ((PY_SSIZE_T_MAX <= _Py_IMMORTAL_REFCNT_LOCAL))
break;
7821 #if PY_VERSION_HEX < 0x030E0000
7822 if (_Py_IsOwnedByCurrentThread(table[i]) && Py_REFCNT(table[i]) == 1)
7824 if (PyUnstable_Object_IsUniquelyReferenced(table[i]))
7827 Py_SET_REFCNT(table[i], ((Py_ssize_t)_Py_IMMORTAL_REFCNT_LOCAL + 1));
7830 if ((PY_SSIZE_T_MAX < _Py_IMMORTAL_INITIAL_REFCNT))
break;
7831 Py_SET_REFCNT(table[i], _Py_IMMORTAL_INITIAL_REFCNT);
7846 unsigned int argcount : 3;
7847 unsigned int num_posonly_args : 1;
7848 unsigned int num_kwonly_args : 1;
7849 unsigned int nlocals : 3;
7850 unsigned int flags : 10;
7851 unsigned int first_line : 8;
7852} __Pyx_PyCode_New_function_description;
7857static PyObject* __Pyx_PyCode_New(
7858 const __Pyx_PyCode_New_function_description descr,
7859 PyObject *
const *varnames,
7862 PyObject *line_table,
7863 PyObject *tuple_dedup_map
7867static int __Pyx_CreateCodeObjects(__pyx_mstatetype *__pyx_mstate) {
7868 PyObject* tuple_dedup_map = PyDict_New();
7869 if (unlikely(!tuple_dedup_map))
return -1;
7871 const __Pyx_PyCode_New_function_description descr = {5, 0, 0, 5, (
unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 74};
7872 PyObject*
const varnames[] = {__pyx_mstate->__pyx_n_u_shockCapturingDiffusion, __pyx_mstate->__pyx_n_u_elementDiameter, __pyx_mstate->__pyx_n_u_strong_residual, __pyx_mstate->__pyx_n_u_grad_u, __pyx_mstate->__pyx_n_u_numDiff};
7873 __pyx_mstate_global->__pyx_codeobj_tab[0] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_proteus_cshockCapturing_pyx, __pyx_mstate->__pyx_n_u_calculateNumericalDiffusionResGr, __pyx_mstate->__pyx_kp_b_iso88591_q_fAQ_fAQ_fAQ_2_2_2_2, tuple_dedup_map);
if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[0]))
goto bad;
7876 const __Pyx_PyCode_New_function_description descr = {5, 0, 0, 5, (
unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 87};
7877 PyObject*
const varnames[] = {__pyx_mstate->__pyx_n_u_shockCapturingDiffusion, __pyx_mstate->__pyx_n_u_elementDiameter, __pyx_mstate->__pyx_n_u_strong_residual, __pyx_mstate->__pyx_n_u_grad_u, __pyx_mstate->__pyx_n_u_numDiff};
7878 __pyx_mstate_global->__pyx_codeobj_tab[1] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_proteus_cshockCapturing_pyx, __pyx_mstate->__pyx_n_u_calculateNumericalDiffusionResGr_2, __pyx_mstate->__pyx_kp_b_iso88591_1F_fAQ_fAQ_2_2_2_2, tuple_dedup_map);
if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1]))
goto bad;
7881 const __Pyx_PyCode_New_function_description descr = {4, 0, 0, 4, (
unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 100};
7882 PyObject*
const varnames[] = {__pyx_mstate->__pyx_n_u_shockCapturingDiffusion, __pyx_mstate->__pyx_n_u_elementDiameter, __pyx_mstate->__pyx_n_u_strong_residual, __pyx_mstate->__pyx_n_u_numDiff};
7883 __pyx_mstate_global->__pyx_codeobj_tab[2] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_proteus_cshockCapturing_pyx, __pyx_mstate->__pyx_n_u_calculateNumericalDiffusionEikon, __pyx_mstate->__pyx_kp_b_iso88591_q_vQa_vQa_2_2_2, tuple_dedup_map);
if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[2]))
goto bad;
7886 const __Pyx_PyCode_New_function_description descr = {7, 0, 0, 7, (
unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 110};
7887 PyObject*
const varnames[] = {__pyx_mstate->__pyx_n_u_shockCapturing, __pyx_mstate->__pyx_n_u_shockCapturingDiffusion, __pyx_mstate->__pyx_n_u_elementDiameter, __pyx_mstate->__pyx_n_u_strong_residual, __pyx_mstate->__pyx_n_u_mt, __pyx_mstate->__pyx_n_u_H, __pyx_mstate->__pyx_n_u_numDiff};
7888 __pyx_mstate_global->__pyx_codeobj_tab[3] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_proteus_cshockCapturing_pyx, __pyx_mstate->__pyx_n_u_calculateNumericalDiffusionHJ, __pyx_mstate->__pyx_kp_b_iso88591_1F_1_V1A_oQ_oQ_b_aq_gQ, tuple_dedup_map);
if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[3]))
goto bad;
7891 const __Pyx_PyCode_New_function_description descr = {7, 0, 0, 7, (
unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 126};
7892 PyObject*
const varnames[] = {__pyx_mstate->__pyx_n_u_shockCapturing, __pyx_mstate->__pyx_n_u_shockCapturingDiffusion, __pyx_mstate->__pyx_n_u_elementDiameter, __pyx_mstate->__pyx_n_u_strong_residual, __pyx_mstate->__pyx_n_u_mt, __pyx_mstate->__pyx_n_u_H, __pyx_mstate->__pyx_n_u_numDiff};
7893 __pyx_mstate_global->__pyx_codeobj_tab[4] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_proteus_cshockCapturing_pyx, __pyx_mstate->__pyx_n_u_calculateNumericalDiffusionHJV2, __pyx_mstate->__pyx_kp_b_iso88591_AQfAQ_V1A_oQ_oQ_b_aq_gQ, tuple_dedup_map);
if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[4]))
goto bad;
7896 const __Pyx_PyCode_New_function_description descr = {6, 0, 0, 6, (
unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 142};
7897 PyObject*
const varnames[] = {__pyx_mstate->__pyx_n_u_shockCapturingFactor, __pyx_mstate->__pyx_n_u_elementDiameter, __pyx_mstate->__pyx_n_u_strong_residual, __pyx_mstate->__pyx_n_u_mt, __pyx_mstate->__pyx_n_u_df, __pyx_mstate->__pyx_n_u_numDiff};
7898 __pyx_mstate_global->__pyx_codeobj_tab[5] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_proteus_cshockCapturing_pyx, __pyx_mstate->__pyx_n_u_calculateNumericalDiffusion_A_1, __pyx_mstate->__pyx_kp_b_iso88591_ARvQa_fAQ_fAQ_oQ_oQ_b_b_gQ, tuple_dedup_map);
if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[5]))
goto bad;
7901 const __Pyx_PyCode_New_function_description descr = {6, 0, 0, 6, (
unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 157};
7902 PyObject*
const varnames[] = {__pyx_mstate->__pyx_n_u_shockCapturingDiffusion, __pyx_mstate->__pyx_n_u_uSC, __pyx_mstate->__pyx_n_u_elementDiameter, __pyx_mstate->__pyx_n_u_strong_residual, __pyx_mstate->__pyx_n_u_grad_u, __pyx_mstate->__pyx_n_u_numDiff};
7903 __pyx_mstate_global->__pyx_codeobj_tab[6] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_proteus_cshockCapturing_pyx, __pyx_mstate->__pyx_n_u_calculateNumericalDiffusionResGr_3, __pyx_mstate->__pyx_kp_b_iso88591_QfF_1_oQ_oQ_fA_gQ, tuple_dedup_map);
if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[6]))
goto bad;
7906 const __Pyx_PyCode_New_function_description descr = {6, 0, 0, 6, (
unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 172};
7907 PyObject*
const varnames[] = {__pyx_mstate->__pyx_n_u_shockCapturingDiffusion, __pyx_mstate->__pyx_n_u_beta, __pyx_mstate->__pyx_n_u_elementDiameter, __pyx_mstate->__pyx_n_u_strong_residual, __pyx_mstate->__pyx_n_u_grad_u, __pyx_mstate->__pyx_n_u_numDiff};
7908 __pyx_mstate_global->__pyx_codeobj_tab[7] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_proteus_cshockCapturing_pyx, __pyx_mstate->__pyx_n_u_calculateNumericalDiffusionJaffr, __pyx_mstate->__pyx_kp_b_iso88591_avV1A_oQ_oQ_fA_gQ, tuple_dedup_map);
if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[7]))
goto bad;
7910 Py_DECREF(tuple_dedup_map);
7913 Py_DECREF(tuple_dedup_map);
7918static int __Pyx_InitGlobals(
void) {
7919 int __pyx_lineno = 0;
7920 const char *__pyx_filename = NULL;
7921 int __pyx_clineno = 0;
7923 if (likely(__Pyx_init_co_variables() == 0 && __Pyx_init_tpflags_variables() == 0));
else
7925 if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1, __pyx_L1_error)
7934 #ifdef NPY_FEATURE_VERSION
7935 #ifndef NO_IMPORT_ARRAY
7936 if (unlikely(_import_array() == -1)) {
7937 PyErr_SetString(PyExc_ImportError,
"numpy.core.multiarray failed to import "
7938 "(auto-generated because you didn't call 'numpy.import_array()' after cimporting numpy; "
7939 "use '<void>numpy._import_array' to disable if you are certain you don't need it).");
7944 if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1, __pyx_L1_error)
7947 if (likely(__pyx_CommonTypesMetaclass_init(__pyx_m) == 0));
else
7949 if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1, __pyx_L1_error)
7952 #if CYTHON_COMPILING_IN_LIMITED_API
7954 PyObject *typesModule=NULL;
7955 typesModule = PyImport_ImportModule(
"types");
7957 __pyx_mstate_global->__Pyx_CachedMethodType = PyObject_GetAttrString(typesModule,
"MethodType");
7958 Py_DECREF(typesModule);
7963 if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1, __pyx_L1_error)
7971static int __Pyx_InitAfterSharedUtility(
void) {
7972 int __pyx_lineno = 0;
7973 const char *__pyx_filename = NULL;
7974 int __pyx_clineno = 0;
7976 if (likely(__pyx_CyFunction_init(__pyx_m) == 0));
else
7978 if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1, __pyx_L1_error)
7989#pragma warning( push )
7994#pragma warning( disable : 4127 )
8004static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(
const char *modname) {
8005 PyObject *m = NULL, *p = NULL;
8007 m = PyImport_ImportModule(modname);
8009 p = PyObject_GetAttrString(m,
"RefNannyAPI");
8011 r = PyLong_AsVoidPtr(p);
8015 return (__Pyx_RefNannyAPIStruct *)
r;
8020#if CYTHON_USE_EXC_INFO_STACK && CYTHON_FAST_THREAD_STATE
8021static _PyErr_StackItem *
8022__Pyx_PyErr_GetTopmostException(PyThreadState *tstate)
8024 _PyErr_StackItem *exc_info = tstate->exc_info;
8025 while ((exc_info->exc_value == NULL || exc_info->exc_value == Py_None) &&
8026 exc_info->previous_item != NULL)
8028 exc_info = exc_info->previous_item;
8035#if CYTHON_FAST_THREAD_STATE
8036static CYTHON_INLINE
void __Pyx__ExceptionSave(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) {
8037 #if CYTHON_USE_EXC_INFO_STACK && PY_VERSION_HEX >= 0x030B00a4
8038 _PyErr_StackItem *exc_info = __Pyx_PyErr_GetTopmostException(tstate);
8039 PyObject *exc_value = exc_info->exc_value;
8040 if (exc_value == NULL || exc_value == Py_None) {
8047 *type = (PyObject*) Py_TYPE(exc_value);
8049 *tb = PyException_GetTraceback(exc_value);
8051 #elif CYTHON_USE_EXC_INFO_STACK
8052 _PyErr_StackItem *exc_info = __Pyx_PyErr_GetTopmostException(tstate);
8053 *type = exc_info->exc_type;
8054 *value = exc_info->exc_value;
8055 *tb = exc_info->exc_traceback;
8060 *type = tstate->exc_type;
8061 *value = tstate->exc_value;
8062 *tb = tstate->exc_traceback;
8068static CYTHON_INLINE
void __Pyx__ExceptionReset(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb) {
8069 #if CYTHON_USE_EXC_INFO_STACK && PY_VERSION_HEX >= 0x030B00a4
8070 _PyErr_StackItem *exc_info = tstate->exc_info;
8071 PyObject *tmp_value = exc_info->exc_value;
8072 exc_info->exc_value = value;
8073 Py_XDECREF(tmp_value);
8077 PyObject *tmp_type, *tmp_value, *tmp_tb;
8078 #if CYTHON_USE_EXC_INFO_STACK
8079 _PyErr_StackItem *exc_info = tstate->exc_info;
8080 tmp_type = exc_info->exc_type;
8081 tmp_value = exc_info->exc_value;
8082 tmp_tb = exc_info->exc_traceback;
8083 exc_info->exc_type = type;
8084 exc_info->exc_value = value;
8085 exc_info->exc_traceback = tb;
8087 tmp_type = tstate->exc_type;
8088 tmp_value = tstate->exc_value;
8089 tmp_tb = tstate->exc_traceback;
8090 tstate->exc_type = type;
8091 tstate->exc_value = value;
8092 tstate->exc_traceback = tb;
8094 Py_XDECREF(tmp_type);
8095 Py_XDECREF(tmp_value);
8102#if CYTHON_COMPILING_IN_CPYTHON
8103static int __Pyx_InBases(PyTypeObject *a, PyTypeObject *b) {
8105 a = __Pyx_PyType_GetSlot(a, tp_base, PyTypeObject*);
8109 return b == &PyBaseObject_Type;
8111static CYTHON_INLINE
int __Pyx_IsSubtype(PyTypeObject *a, PyTypeObject *b) {
8113 if (a == b)
return 1;
8117 n = PyTuple_GET_SIZE(mro);
8118 for (i = 0; i <
n; i++) {
8119 if (PyTuple_GET_ITEM(mro, i) == (PyObject *)b)
8124 return __Pyx_InBases(a, b);
8126static CYTHON_INLINE
int __Pyx_IsAnySubtype2(PyTypeObject *cls, PyTypeObject *a, PyTypeObject *b) {
8128 if (cls == a || cls == b)
return 1;
8132 n = PyTuple_GET_SIZE(mro);
8133 for (i = 0; i <
n; i++) {
8134 PyObject *base = PyTuple_GET_ITEM(mro, i);
8135 if (base == (PyObject *)a || base == (PyObject *)b)
8140 return __Pyx_InBases(cls, a) || __Pyx_InBases(cls, b);
8145#if CYTHON_FAST_THREAD_STATE
8146static CYTHON_INLINE
void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb) {
8147#if PY_VERSION_HEX >= 0x030C00A6
8148 PyObject *tmp_value;
8149 assert(type == NULL || (value != NULL && type == (PyObject*) Py_TYPE(value)));
8151 #if CYTHON_COMPILING_IN_CPYTHON
8152 if (unlikely(((PyBaseExceptionObject*) value)->traceback != tb))
8154 PyException_SetTraceback(value, tb);
8156 tmp_value = tstate->current_exception;
8157 tstate->current_exception = value;
8158 Py_XDECREF(tmp_value);
8162 PyObject *tmp_type, *tmp_value, *tmp_tb;
8163 tmp_type = tstate->curexc_type;
8164 tmp_value = tstate->curexc_value;
8165 tmp_tb = tstate->curexc_traceback;
8166 tstate->curexc_type = type;
8167 tstate->curexc_value = value;
8168 tstate->curexc_traceback = tb;
8169 Py_XDECREF(tmp_type);
8170 Py_XDECREF(tmp_value);
8174static CYTHON_INLINE
void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) {
8175#if PY_VERSION_HEX >= 0x030C00A6
8176 PyObject* exc_value;
8177 exc_value = tstate->current_exception;
8178 tstate->current_exception = 0;
8183 *type = (PyObject*) Py_TYPE(exc_value);
8185 #if CYTHON_COMPILING_IN_CPYTHON
8186 *tb = ((PyBaseExceptionObject*) exc_value)->traceback;
8189 *tb = PyException_GetTraceback(exc_value);
8193 *type = tstate->curexc_type;
8194 *value = tstate->curexc_value;
8195 *tb = tstate->curexc_traceback;
8196 tstate->curexc_type = 0;
8197 tstate->curexc_value = 0;
8198 tstate->curexc_traceback = 0;
8204#if CYTHON_COMPILING_IN_CPYTHON
8205static CYTHON_INLINE
int __Pyx_inner_PyErr_GivenExceptionMatches2(PyObject *err, PyObject* exc_type1, PyObject *exc_type2) {
8207 return __Pyx_IsAnySubtype2((PyTypeObject*)err, (PyTypeObject*)exc_type1, (PyTypeObject*)exc_type2);
8209 return __Pyx_IsSubtype((PyTypeObject*)err, (PyTypeObject*)exc_type2);
8212static int __Pyx_PyErr_GivenExceptionMatchesTuple(PyObject *exc_type, PyObject *tuple) {
8214 assert(PyExceptionClass_Check(exc_type));
8215 n = PyTuple_GET_SIZE(tuple);
8216 for (i=0; i<
n; i++) {
8217 if (exc_type == PyTuple_GET_ITEM(tuple, i))
return 1;
8219 for (i=0; i<
n; i++) {
8220 PyObject *t = PyTuple_GET_ITEM(tuple, i);
8221 if (likely(PyExceptionClass_Check(t))) {
8222 if (__Pyx_inner_PyErr_GivenExceptionMatches2(exc_type, NULL, t))
return 1;
8228static CYTHON_INLINE
int __Pyx_PyErr_GivenExceptionMatches(PyObject *err, PyObject* exc_type) {
8229 if (likely(err == exc_type))
return 1;
8230 if (likely(PyExceptionClass_Check(err))) {
8231 if (likely(PyExceptionClass_Check(exc_type))) {
8232 return __Pyx_inner_PyErr_GivenExceptionMatches2(err, NULL, exc_type);
8233 }
else if (likely(PyTuple_Check(exc_type))) {
8234 return __Pyx_PyErr_GivenExceptionMatchesTuple(err, exc_type);
8238 return PyErr_GivenExceptionMatches(err, exc_type);
8240static CYTHON_INLINE
int __Pyx_PyErr_GivenExceptionMatches2(PyObject *err, PyObject *exc_type1, PyObject *exc_type2) {
8241 assert(PyExceptionClass_Check(exc_type1));
8242 assert(PyExceptionClass_Check(exc_type2));
8243 if (likely(err == exc_type1 || err == exc_type2))
return 1;
8244 if (likely(PyExceptionClass_Check(err))) {
8245 return __Pyx_inner_PyErr_GivenExceptionMatches2(err, exc_type1, exc_type2);
8247 return (PyErr_GivenExceptionMatches(err, exc_type1) || PyErr_GivenExceptionMatches(err, exc_type2));
8252#if CYTHON_FAST_THREAD_STATE
8253static int __Pyx_PyErr_ExceptionMatchesTuple(PyObject *exc_type, PyObject *tuple) {
8255 n = PyTuple_GET_SIZE(tuple);
8256 for (i=0; i<
n; i++) {
8257 if (exc_type == PyTuple_GET_ITEM(tuple, i))
return 1;
8259 for (i=0; i<
n; i++) {
8260 if (__Pyx_PyErr_GivenExceptionMatches(exc_type, PyTuple_GET_ITEM(tuple, i)))
return 1;
8264static CYTHON_INLINE
int __Pyx_PyErr_ExceptionMatchesInState(PyThreadState* tstate, PyObject* err) {
8267#if PY_VERSION_HEX >= 0x030C00A6
8268 PyObject *current_exception = tstate->current_exception;
8269 if (unlikely(!current_exception))
return 0;
8270 exc_type = (PyObject*) Py_TYPE(current_exception);
8271 if (exc_type == err)
return 1;
8273 exc_type = tstate->curexc_type;
8274 if (exc_type == err)
return 1;
8275 if (unlikely(!exc_type))
return 0;
8277 #if CYTHON_AVOID_BORROWED_REFS
8278 Py_INCREF(exc_type);
8280 if (unlikely(PyTuple_Check(err))) {
8281 result = __Pyx_PyErr_ExceptionMatchesTuple(exc_type, err);
8283 result = __Pyx_PyErr_GivenExceptionMatches(exc_type, err);
8285 #if CYTHON_AVOID_BORROWED_REFS
8286 Py_DECREF(exc_type);
8293#if CYTHON_FAST_THREAD_STATE
8294static int __Pyx__GetException(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb)
8296static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb)
8299 PyObject *local_type = NULL, *local_value, *local_tb = NULL;
8300#if CYTHON_FAST_THREAD_STATE
8301 PyObject *tmp_type, *tmp_value, *tmp_tb;
8302 #if PY_VERSION_HEX >= 0x030C0000
8303 local_value = tstate->current_exception;
8304 tstate->current_exception = 0;
8306 local_type = tstate->curexc_type;
8307 local_value = tstate->curexc_value;
8308 local_tb = tstate->curexc_traceback;
8309 tstate->curexc_type = 0;
8310 tstate->curexc_value = 0;
8311 tstate->curexc_traceback = 0;
8313#elif __PYX_LIMITED_VERSION_HEX >= 0x030C0000
8314 local_value = PyErr_GetRaisedException();
8316 PyErr_Fetch(&local_type, &local_value, &local_tb);
8318#if __PYX_LIMITED_VERSION_HEX >= 0x030C0000
8319 if (likely(local_value)) {
8320 local_type = (PyObject*) Py_TYPE(local_value);
8321 Py_INCREF(local_type);
8322 local_tb = PyException_GetTraceback(local_value);
8325 PyErr_NormalizeException(&local_type, &local_value, &local_tb);
8326#if CYTHON_FAST_THREAD_STATE
8327 if (unlikely(tstate->curexc_type))
8329 if (unlikely(PyErr_Occurred()))
8333 if (unlikely(PyException_SetTraceback(local_value, local_tb) < 0))
8337 Py_XINCREF(local_tb);
8338 Py_XINCREF(local_type);
8339 Py_XINCREF(local_value);
8341 *value = local_value;
8343#if CYTHON_FAST_THREAD_STATE
8344 #if CYTHON_USE_EXC_INFO_STACK
8346 _PyErr_StackItem *exc_info = tstate->exc_info;
8347 #if PY_VERSION_HEX >= 0x030B00a4
8348 tmp_value = exc_info->exc_value;
8349 exc_info->exc_value = local_value;
8352 Py_XDECREF(local_type);
8353 Py_XDECREF(local_tb);
8355 tmp_type = exc_info->exc_type;
8356 tmp_value = exc_info->exc_value;
8357 tmp_tb = exc_info->exc_traceback;
8358 exc_info->exc_type = local_type;
8359 exc_info->exc_value = local_value;
8360 exc_info->exc_traceback = local_tb;
8364 tmp_type = tstate->exc_type;
8365 tmp_value = tstate->exc_value;
8366 tmp_tb = tstate->exc_traceback;
8367 tstate->exc_type = local_type;
8368 tstate->exc_value = local_value;
8369 tstate->exc_traceback = local_tb;
8371 Py_XDECREF(tmp_type);
8372 Py_XDECREF(tmp_value);
8374#elif __PYX_LIMITED_VERSION_HEX >= 0x030b0000
8375 PyErr_SetHandledException(local_value);
8376 Py_XDECREF(local_value);
8377 Py_XDECREF(local_type);
8378 Py_XDECREF(local_tb);
8380 PyErr_SetExcInfo(local_type, local_value, local_tb);
8383#if __PYX_LIMITED_VERSION_HEX < 0x030C0000
8388 Py_XDECREF(local_type);
8389 Py_XDECREF(local_value);
8390 Py_XDECREF(local_tb);
8396#if CYTHON_COMPILING_IN_CPYTHON
8397static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw) {
8399 ternaryfunc call = Py_TYPE(func)->tp_call;
8400 if (unlikely(!call))
8401 return PyObject_Call(func, arg, kw);
8402 if (unlikely(Py_EnterRecursiveCall(
" while calling a Python object")))
8404 result = (*call)(func, arg, kw);
8405 Py_LeaveRecursiveCall();
8406 if (unlikely(!result) && unlikely(!PyErr_Occurred())) {
8409 "NULL result without error in PyObject_Call");
8416#if CYTHON_COMPILING_IN_CPYTHON
8417static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg) {
8418 PyObject *self, *result;
8420 cfunc = __Pyx_CyOrPyCFunction_GET_FUNCTION(func);
8421 self = __Pyx_CyOrPyCFunction_GET_SELF(func);
8422 if (unlikely(Py_EnterRecursiveCall(
" while calling a Python object")))
8424 result = cfunc(self, arg);
8425 Py_LeaveRecursiveCall();
8426 if (unlikely(!result) && unlikely(!PyErr_Occurred())) {
8429 "NULL result without error in PyObject_Call");
8436#if CYTHON_COMPILING_IN_LIMITED_API
8437static PyObject* __Pyx_PyObject_FastCall_fallback(PyObject *func, PyObject *
const*args,
size_t nargs, PyObject *kwargs) {
8438 PyObject *argstuple;
8439 PyObject *result = 0;
8441 argstuple = PyTuple_New((Py_ssize_t)nargs);
8442 if (unlikely(!argstuple))
return NULL;
8443 for (i = 0; i < nargs; i++) {
8445 if (__Pyx_PyTuple_SET_ITEM(argstuple, (Py_ssize_t)i, args[i]) != (0))
goto bad;
8447 result = __Pyx_PyObject_Call(func, argstuple, kwargs);
8449 Py_DECREF(argstuple);
8453#if CYTHON_VECTORCALL && !(CYTHON_COMPILING_IN_LIMITED_API || CYTHON_COMPILING_IN_PYPY)
8454 #if CYTHON_COMPILING_IN_CPYTHON
8455static CYTHON_INLINE vectorcallfunc __Pyx_PyVectorcall_Function(PyObject *callable) {
8456 PyTypeObject *tp = Py_TYPE(callable);
8457 #if defined(__Pyx_CyFunction_USED)
8458 if (__Pyx_CyFunction_CheckExact(callable)) {
8459 return __Pyx_CyFunction_func_vectorcall(callable);
8462 if (!PyType_HasFeature(tp, Py_TPFLAGS_HAVE_VECTORCALL)) {
8465 assert(PyCallable_Check(callable));
8466 Py_ssize_t offset = tp->tp_vectorcall_offset;
8469 memcpy(&ptr, (
char *) callable + offset,
sizeof(ptr));
8473 #define __Pyx_PyVectorcall_Function(callable) PyVectorcall_Function(callable)
8476static CYTHON_INLINE PyObject* __Pyx_PyObject_FastCallDict(PyObject *func, PyObject *
const *args,
size_t nargsf, PyObject *kwargs) {
8477 Py_ssize_t nargs = __Pyx_PyVectorcall_NARGS(nargsf);
8478#if CYTHON_COMPILING_IN_CPYTHON
8479 if (nargs == 0 && kwargs == NULL) {
8480 if (__Pyx_CyOrPyCFunction_Check(func) && likely( __Pyx_CyOrPyCFunction_GET_FLAGS(func) & METH_NOARGS))
8481 return __Pyx_PyObject_CallMethO(func, NULL);
8483 else if (nargs == 1 && kwargs == NULL) {
8484 if (__Pyx_CyOrPyCFunction_Check(func) && likely( __Pyx_CyOrPyCFunction_GET_FLAGS(func) & METH_O))
8485 return __Pyx_PyObject_CallMethO(func, args[0]);
8488 if (kwargs == NULL) {
8489 #if CYTHON_VECTORCALL
8490 #if CYTHON_COMPILING_IN_LIMITED_API || CYTHON_COMPILING_IN_PYPY
8491 return PyObject_Vectorcall(func, args, nargsf, NULL);
8493 vectorcallfunc
f = __Pyx_PyVectorcall_Function(func);
8495 return f(func, args, nargsf, NULL);
8501 return __Pyx_PyObject_Call(func, __pyx_mstate_global->__pyx_empty_tuple, kwargs);
8503 #if CYTHON_COMPILING_IN_LIMITED_API
8504 return __Pyx_PyObject_FastCall_fallback(func, args, (
size_t)nargs, kwargs);
8505 #elif CYTHON_COMPILING_IN_PYPY
8506 return PyObject_VectorcallDict(func, args, (
size_t) nargs, kwargs);
8508 return PyObject_VectorcallDict(func, args, nargsf, kwargs);
8513static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause) {
8514 PyObject* owned_instance = NULL;
8515 if (tb == Py_None) {
8517 }
else if (tb && !PyTraceBack_Check(tb)) {
8518 PyErr_SetString(PyExc_TypeError,
8519 "raise: arg 3 must be a traceback or None");
8522 if (value == Py_None)
8524 if (PyExceptionInstance_Check(type)) {
8526 PyErr_SetString(PyExc_TypeError,
8527 "instance exception may not have a separate value");
8531 type = (PyObject*) Py_TYPE(value);
8532 }
else if (PyExceptionClass_Check(type)) {
8533 PyObject *instance_class = NULL;
8534 if (value && PyExceptionInstance_Check(value)) {
8535 instance_class = (PyObject*) Py_TYPE(value);
8536 if (instance_class != type) {
8537 int is_subclass = PyObject_IsSubclass(instance_class, type);
8539 instance_class = NULL;
8540 }
else if (unlikely(is_subclass == -1)) {
8543 type = instance_class;
8547 if (!instance_class) {
8550 args = PyTuple_New(0);
8551 else if (PyTuple_Check(value)) {
8555 args = PyTuple_Pack(1, value);
8558 owned_instance = PyObject_Call(type, args, NULL);
8560 if (!owned_instance)
8562 value = owned_instance;
8563 if (!PyExceptionInstance_Check(value)) {
8564 PyErr_Format(PyExc_TypeError,
8565 "calling %R should have returned an instance of "
8566 "BaseException, not %R",
8567 type, Py_TYPE(value));
8572 PyErr_SetString(PyExc_TypeError,
8573 "raise: exception class must be a subclass of BaseException");
8577 PyObject *fixed_cause;
8578 if (cause == Py_None) {
8580 }
else if (PyExceptionClass_Check(cause)) {
8581 fixed_cause = PyObject_CallObject(cause, NULL);
8582 if (fixed_cause == NULL)
8584 }
else if (PyExceptionInstance_Check(cause)) {
8585 fixed_cause = cause;
8586 Py_INCREF(fixed_cause);
8588 PyErr_SetString(PyExc_TypeError,
8589 "exception causes must derive from "
8593 PyException_SetCause(value, fixed_cause);
8595 PyErr_SetObject(type, value);
8597#if PY_VERSION_HEX >= 0x030C00A6
8598 PyException_SetTraceback(value, tb);
8599#elif CYTHON_FAST_THREAD_STATE
8600 PyThreadState *tstate = __Pyx_PyThreadState_Current;
8601 PyObject* tmp_tb = tstate->curexc_traceback;
8604 tstate->curexc_traceback = tb;
8608 PyObject *tmp_type, *tmp_value, *tmp_tb;
8609 PyErr_Fetch(&tmp_type, &tmp_value, &tmp_tb);
8611 PyErr_Restore(tmp_type, tmp_value, tb);
8616 Py_XDECREF(owned_instance);
8621#if CYTHON_COMPILING_IN_CPYTHON
8622static CYTHON_INLINE
void __Pyx_copy_object_array(PyObject *
const *CYTHON_RESTRICT src, PyObject** CYTHON_RESTRICT dest, Py_ssize_t length) {
8625 for (i = 0; i < length; i++) {
8626 v = dest[i] = src[i];
8633#if !(PY_VERSION_HEX >= 0x030F0000 && !CYTHON_COMPILING_IN_LIMITED_API)
8634CYTHON_UNUSED
static PyObject *
8635__Pyx_PyTuple_FromArray(PyObject *
const *src, Py_ssize_t
n) {
8637 return __Pyx_NewRef(__pyx_mstate_global->__pyx_empty_tuple);
8639 PyObject *res = PyTuple_New(
n);
8640 if (unlikely(res == NULL))
return NULL;
8641 #if CYTHON_COMPILING_IN_CPYTHON
8642 __Pyx_copy_object_array(src, ((PyTupleObject*)res)->ob_item,
n);
8645 for (i = 0; i <
n; i++) {
8647 if (unlikely(__Pyx_PyTuple_SET_ITEM(res, i, src[i]) < (0))) {
8658#ifndef __Pyx_DEFINED_PyObject_CompareStrStrBoolEq
8659#define __Pyx_DEFINED_PyObject_CompareStrStrBoolEq
8660static CYTHON_INLINE
int __Pyx_PyObject_CompareStrStrBoolEq(PyObject* s1, PyObject* s2) {
8661 #if __PYX_LIMITED_VERSION_HEX >= 0x030e0000
8662 int result = PyUnicode_Equal(s1, s2);
8663 #if !CYTHON_COMPILING_IN_CPYTHON
8664 if (unlikely(result == -1))
return -1;
8666 if (result == 0)
goto __pyx_return_false;
else goto __pyx_return_true;
8668 int result = PyUnicode_Compare(s1, s2);
8669 if (unlikely((result == -1) && PyErr_Occurred()))
return -1;
8670 if (result == 0)
goto __pyx_return_true;
else goto __pyx_return_false;
8678static CYTHON_INLINE
int __Pyx_PyObject_CompareBoolEq_str_str(PyObject *op1, PyObject *op2,
int pyop) {
8679 CYTHON_UNUSED_VAR(pyop);
8680 if (unlikely(op1 == Py_None)) {
8681 if (op2 == Py_None)
goto __pyx_return_true;
else goto __pyx_return_false;
8683 if (unlikely(op2 == Py_None)) {
8684 if (op1 == Py_None)
goto __pyx_return_true;
else goto __pyx_return_false;
8687 if (likely(op1 != Py_None)) {
8688 if (op1 == op2)
goto __pyx_return_true;
8689 if (likely(op2 != Py_None)) {
8690 return __Pyx_PyObject_CompareStrStrBoolEq(op1, op2);
8695 if ((0))
goto __pyx_richcmp;
8696 if ((0))
goto __pyx_return_true;
8697 if ((0))
goto __pyx_return_false;
8699 return __Pyx_PyObject_RichCompareBool(op1, op2, Py_EQ);
8707#if CYTHON_VECTORCALL
8708static CYTHON_INLINE PyObject * __Pyx_GetKwValue_FASTCALL(PyObject *kwnames, PyObject *
const *kwvalues, PyObject *
s)
8710 Py_ssize_t i,
n = __Pyx_PyTuple_GET_SIZE(kwnames);
8711 #if !CYTHON_ASSUME_SAFE_SIZE
8712 if (unlikely(
n == -1))
return NULL;
8714 for (i = 0; i <
n; i++)
8716 PyObject *namei = __Pyx_PyTuple_GET_ITEM(kwnames, i);
8717 #if !CYTHON_ASSUME_SAFE_MACROS
8718 if (unlikely(!namei))
return NULL;
8720 if (
s == namei)
return kwvalues[i];
8722 for (i = 0; i <
n; i++)
8724 PyObject *namei = __Pyx_PyTuple_GET_ITEM(kwnames, i);
8725 #if !CYTHON_ASSUME_SAFE_MACROS
8726 if (unlikely(!namei))
return NULL;
8728 int eq = __Pyx_PyUnicode_Equals(
s, namei);
8729 if (unlikely(eq != 0)) {
8730 if (unlikely(eq < 0))
return NULL;
8736#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030d0000 || CYTHON_COMPILING_IN_LIMITED_API || CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_GRAAL
8737CYTHON_UNUSED
static PyObject *__Pyx_KwargsAsDict_FASTCALL(PyObject *kwnames, PyObject *
const *kwvalues) {
8738 Py_ssize_t i, nkwargs;
8740#if !CYTHON_ASSUME_SAFE_SIZE
8741 nkwargs = PyTuple_Size(kwnames);
8742 if (unlikely(nkwargs < 0))
return NULL;
8744 nkwargs = PyTuple_GET_SIZE(kwnames);
8746 dict = PyDict_New();
8747 if (unlikely(!dict))
8749 for (i=0; i<nkwargs; i++) {
8750#if !CYTHON_ASSUME_SAFE_MACROS
8751 PyObject *key = PyTuple_GetItem(kwnames, i);
8754 PyObject *key = PyTuple_GET_ITEM(kwnames, i);
8756 if (unlikely(PyDict_SetItem(dict, key, kwvalues[i]) < 0))
8768static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg) {
8769 PyObject *args[2] = {NULL, arg};
8770 return __Pyx_PyObject_FastCall(func, args+1, 1 | __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET);
8774static CYTHON_INLINE
int __Pyx_IgnoreGivenException(PyObject *given_exception, PyObject *ignorable_exception) {
8775 if (PyErr_GivenExceptionMatches(given_exception ? given_exception : PyErr_Occurred(), ignorable_exception)) {
8783#if CYTHON_USE_TYPE_SLOTS
8784static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name) {
8785 PyTypeObject* tp = Py_TYPE(obj);
8786 if (likely(tp->tp_getattro))
8787 return tp->tp_getattro(obj, attr_name);
8788 return PyObject_GetAttr(obj, attr_name);
8793#if CYTHON_COMPILING_IN_LIMITED_API && __PYX_LIMITED_VERSION_HEX < 0x030C0000
8794static PyObject *__Pyx_SelflessCall(PyObject *method, PyObject *args, PyObject *kwargs) {
8796 PyObject *selfless_args = PyTuple_GetSlice(args, 1, PyTuple_Size(args));
8797 if (unlikely(!selfless_args))
return NULL;
8798 result = PyObject_Call(method, selfless_args, kwargs);
8799 Py_DECREF(selfless_args);
8803static PyObject *__Pyx_SelflessCall(PyObject *method, PyObject *
const *args, Py_ssize_t nargs, PyObject *kwnames) {
8804 return PyObject_Vectorcall(method, args ? args+1 : NULL, nargs ? (
size_t) nargs-1 : 0, kwnames);
8807static PyMethodDef __Pyx_UnboundCMethod_Def = {
8808 "CythonUnboundCMethod",
8809 __PYX_REINTERPRET_FUNCION(PyCFunction, __Pyx_SelflessCall),
8810#if CYTHON_COMPILING_IN_LIMITED_API && __PYX_LIMITED_VERSION_HEX < 0x030C0000
8811 METH_VARARGS | METH_KEYWORDS,
8813 METH_FASTCALL | METH_KEYWORDS,
8817static int __Pyx_TryUnpackUnboundCMethod(__Pyx_CachedCFunction* target) {
8818 PyObject *method, *result=NULL;
8819 method = __Pyx_PyObject_GetAttrStr(target->type, *target->method_name);
8820 if (unlikely(!method))
8823#if CYTHON_COMPILING_IN_CPYTHON
8824 if (likely(__Pyx_TypeCheck(method, &PyMethodDescr_Type)))
8826 PyMethodDescrObject *descr = (PyMethodDescrObject*) method;
8827 target->func = descr->d_method->ml_meth;
8828 target->flag = descr->d_method->ml_flags & ~(METH_CLASS | METH_STATIC | METH_COEXIST);
8831#if CYTHON_COMPILING_IN_PYPY
8833 if (PyCFunction_Check(method))
8838#if CYTHON_COMPILING_IN_LIMITED_API || CYTHON_COMPILING_IN_PYPY
8839 self = PyObject_GetAttrString(method,
"__self__");
8840 if (!self && !__Pyx_IgnoreException(PyExc_AttributeError)) {
8844 self = PyCFunction_GET_SELF(method);
8846 self_found = (self && self != Py_None);
8847#if CYTHON_COMPILING_IN_LIMITED_API || CYTHON_COMPILING_IN_PYPY
8851 PyObject *unbound_method = PyCFunction_New(&__Pyx_UnboundCMethod_Def, method);
8852 if (unlikely(!unbound_method))
return -1;
8854 result = unbound_method;
8857#if !CYTHON_COMPILING_IN_CPYTHON_FREETHREADING
8858 if (unlikely(target->method)) {
8862 target->method = result;
8867#if CYTHON_COMPILING_IN_CPYTHON
8868static CYTHON_INLINE PyObject* __Pyx_CallUnboundCMethod0(__Pyx_CachedCFunction* cfunc, PyObject* self) {
8869 int was_initialized = __Pyx_CachedCFunction_GetAndSetInitializing(cfunc);
8870 if (likely(was_initialized == 2 && cfunc->func)) {
8871 if (likely(cfunc->flag == METH_NOARGS))
8872 return __Pyx_CallCFunction(cfunc, self, NULL);
8873 if (likely(cfunc->flag == METH_FASTCALL))
8874 return __Pyx_CallCFunctionFast(cfunc, self, NULL, 0);
8875 if (cfunc->flag == (METH_FASTCALL | METH_KEYWORDS))
8876 return __Pyx_CallCFunctionFastWithKeywords(cfunc, self, NULL, 0, NULL);
8877 if (likely(cfunc->flag == (METH_VARARGS | METH_KEYWORDS)))
8878 return __Pyx_CallCFunctionWithKeywords(cfunc, self, __pyx_mstate_global->__pyx_empty_tuple, NULL);
8879 if (cfunc->flag == METH_VARARGS)
8880 return __Pyx_CallCFunction(cfunc, self, __pyx_mstate_global->__pyx_empty_tuple);
8881 return __Pyx__CallUnboundCMethod0(cfunc, self);
8883#if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING
8884 else if (unlikely(was_initialized == 1)) {
8885 __Pyx_CachedCFunction tmp_cfunc = {
8890 tmp_cfunc.type = cfunc->type;
8891 tmp_cfunc.method_name = cfunc->method_name;
8892 return __Pyx__CallUnboundCMethod0(&tmp_cfunc, self);
8895 PyObject *result = __Pyx__CallUnboundCMethod0(cfunc, self);
8896 __Pyx_CachedCFunction_SetFinishedInitializing(cfunc);
8900static PyObject* __Pyx__CallUnboundCMethod0(__Pyx_CachedCFunction* cfunc, PyObject* self) {
8902 if (unlikely(!cfunc->method) && unlikely(__Pyx_TryUnpackUnboundCMethod(cfunc) < 0))
return NULL;
8903 result = __Pyx_PyObject_CallOneArg(cfunc->method, self);
8908static CYTHON_INLINE PyObject* __Pyx_PyDict_Items(PyObject* d) {
8909 return __Pyx_CallUnboundCMethod0(&__pyx_mstate_global->__pyx_umethod_PyDict_Type_items, d);
8913static CYTHON_INLINE PyObject* __Pyx_PyDict_Values(PyObject* d) {
8914 return __Pyx_CallUnboundCMethod0(&__pyx_mstate_global->__pyx_umethod_PyDict_Type_values, d);
8918#if CYTHON_AVOID_BORROWED_REFS
8919static int __Pyx_PyDict_NextRef(PyObject *p, PyObject **ppos, PyObject **pkey, PyObject **pvalue) {
8920 PyObject *next = NULL;
8923 PyObject *dictview = pkey ? __Pyx_PyDict_Items(p) : __Pyx_PyDict_Values(p);
8924 if (unlikely(!dictview))
goto bad;
8925 *ppos = PyObject_GetIter(dictview);
8926 Py_DECREF(dictview);
8928 *ppos = PyObject_GetIter(p);
8930 if (unlikely(!*ppos))
goto bad;
8932 next = PyIter_Next(*ppos);
8934 if (PyErr_Occurred())
goto bad;
8937 if (pkey && pvalue) {
8938 *pkey = __Pyx_PySequence_ITEM(next, 0);
8939 if (unlikely(*pkey))
goto bad;
8940 *pvalue = __Pyx_PySequence_ITEM(next, 1);
8941 if (unlikely(*pvalue))
goto bad;
8952#if !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX >= 0x030d0000
8953 PyErr_FormatUnraisable(
"Exception ignored in __Pyx_PyDict_NextRef");
8955 PyErr_WriteUnraisable(__pyx_mstate_global->__pyx_n_u_Pyx_PyDict_NextRef);
8957 if (pkey) *pkey = NULL;
8958 if (pvalue) *pvalue = NULL;
8962static int __Pyx_PyDict_NextRef(PyObject *p, Py_ssize_t *ppos, PyObject **pkey, PyObject **pvalue) {
8963 int result = PyDict_Next(p, ppos, pkey, pvalue);
8964 if (likely(result == 1)) {
8965 if (pkey) Py_INCREF(*pkey);
8966 if (pvalue) Py_INCREF(*pvalue);
8973static void __Pyx_RaiseDoubleKeywordsError(
8974 const char* func_name,
8977 PyErr_Format(PyExc_TypeError,
8978 "%s() got multiple values for keyword argument '%U'", func_name, kw_name);
8982#if CYTHON_COMPILING_IN_CPYTHON
8983static CYTHON_INLINE PyObject *__Pyx_CallUnboundCMethod2(__Pyx_CachedCFunction *cfunc, PyObject *self, PyObject *arg1, PyObject *arg2) {
8984 int was_initialized = __Pyx_CachedCFunction_GetAndSetInitializing(cfunc);
8985 if (likely(was_initialized == 2 && cfunc->func)) {
8986 PyObject *args[2] = {arg1, arg2};
8987 if (cfunc->flag == METH_FASTCALL) {
8988 return __Pyx_CallCFunctionFast(cfunc, self, args, 2);
8990 if (cfunc->flag == (METH_FASTCALL | METH_KEYWORDS))
8991 return __Pyx_CallCFunctionFastWithKeywords(cfunc, self, args, 2, NULL);
8993#if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING
8994 else if (unlikely(was_initialized == 1)) {
8995 __Pyx_CachedCFunction tmp_cfunc = {
9000 tmp_cfunc.type = cfunc->type;
9001 tmp_cfunc.method_name = cfunc->method_name;
9002 return __Pyx__CallUnboundCMethod2(&tmp_cfunc, self, arg1, arg2);
9005 PyObject *result = __Pyx__CallUnboundCMethod2(cfunc, self, arg1, arg2);
9006 __Pyx_CachedCFunction_SetFinishedInitializing(cfunc);
9010static PyObject* __Pyx__CallUnboundCMethod2(__Pyx_CachedCFunction* cfunc, PyObject* self, PyObject* arg1, PyObject* arg2){
9011 if (unlikely(!cfunc->func && !cfunc->method) && unlikely(__Pyx_TryUnpackUnboundCMethod(cfunc) < 0))
return NULL;
9012#if CYTHON_COMPILING_IN_CPYTHON
9013 if (cfunc->func && (cfunc->flag & METH_VARARGS)) {
9014 PyObject *result = NULL;
9015 PyObject *args = PyTuple_New(2);
9016 if (unlikely(!args))
return NULL;
9018 PyTuple_SET_ITEM(args, 0, arg1);
9020 PyTuple_SET_ITEM(args, 1, arg2);
9021 if (cfunc->flag & METH_KEYWORDS)
9022 result = __Pyx_CallCFunctionWithKeywords(cfunc, self, args, NULL);
9024 result = __Pyx_CallCFunction(cfunc, self, args);
9030 PyObject *args[4] = {NULL, self, arg1, arg2};
9031 return __Pyx_PyObject_FastCall(cfunc->method, args+1, 3 | __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET);
9036static int __Pyx_ValidateDuplicatePosArgs(
9038 PyObject **
const argnames[],
9039 PyObject **
const *first_kw_arg,
9040 const char* function_name)
9042 PyObject **
const *name = argnames;
9043 while (name != first_kw_arg) {
9044 PyObject *key = **name;
9045 int found = PyDict_Contains(kwds, key);
9046 if (unlikely(found)) {
9047 if (found == 1) __Pyx_RaiseDoubleKeywordsError(function_name, key);
9056#if CYTHON_USE_UNICODE_INTERNALS
9057static CYTHON_INLINE
int __Pyx_UnicodeKeywordsEqual(PyObject *s1, PyObject *s2) {
9059 Py_ssize_t len = PyUnicode_GET_LENGTH(s1);
9060 if (len != PyUnicode_GET_LENGTH(s2))
return 0;
9061 kind = PyUnicode_KIND(s1);
9062 if (kind != PyUnicode_KIND(s2))
return 0;
9063 const void *data1 = PyUnicode_DATA(s1);
9064 const void *data2 = PyUnicode_DATA(s2);
9065 return (memcmp(data1, data2, (
size_t) len * (
size_t) kind) == 0);
9068static int __Pyx_MatchKeywordArg_str(
9070 PyObject **
const argnames[],
9071 PyObject **
const *first_kw_arg,
9072 size_t *index_found,
9073 const char *function_name)
9075 PyObject **
const *name;
9076 #if CYTHON_USE_UNICODE_INTERNALS
9077 Py_hash_t key_hash = ((PyASCIIObject*)key)->hash;
9078 if (unlikely(key_hash == -1)) {
9079 key_hash = PyObject_Hash(key);
9080 if (unlikely(key_hash == -1))
9084 name = first_kw_arg;
9086 PyObject *name_str = **name;
9087 #if CYTHON_USE_UNICODE_INTERNALS
9088 if (key_hash == ((PyASCIIObject*)name_str)->hash && __Pyx_UnicodeKeywordsEqual(name_str, key)) {
9089 *index_found = (size_t) (name - argnames);
9093 #if CYTHON_ASSUME_SAFE_SIZE
9094 if (PyUnicode_GET_LENGTH(name_str) == PyUnicode_GET_LENGTH(key))
9097 int cmp = PyUnicode_Compare(name_str, key);
9098 if (cmp < 0 && unlikely(PyErr_Occurred()))
goto bad;
9100 *index_found = (size_t) (name - argnames);
9108 while (name != first_kw_arg) {
9109 PyObject *name_str = **name;
9110 #if CYTHON_USE_UNICODE_INTERNALS
9111 if (unlikely(key_hash == ((PyASCIIObject*)name_str)->hash)) {
9112 if (__Pyx_UnicodeKeywordsEqual(name_str, key))
9113 goto arg_passed_twice;
9116 #if CYTHON_ASSUME_SAFE_SIZE
9117 if (PyUnicode_GET_LENGTH(name_str) == PyUnicode_GET_LENGTH(key))
9120 if (unlikely(name_str == key))
goto arg_passed_twice;
9121 int cmp = PyUnicode_Compare(name_str, key);
9122 if (cmp < 0 && unlikely(PyErr_Occurred()))
goto bad;
9123 if (cmp == 0)
goto arg_passed_twice;
9130 __Pyx_RaiseDoubleKeywordsError(function_name, key);
9135static int __Pyx_MatchKeywordArg_nostr(
9137 PyObject **
const argnames[],
9138 PyObject **
const *first_kw_arg,
9139 size_t *index_found,
9140 const char *function_name)
9142 PyObject **
const *name;
9143 if (unlikely(!PyUnicode_Check(key)))
goto invalid_keyword_type;
9144 name = first_kw_arg;
9146 int cmp = PyObject_RichCompareBool(**name, key, Py_EQ);
9148 *index_found = (size_t) (name - argnames);
9151 if (unlikely(cmp == -1))
goto bad;
9155 while (name != first_kw_arg) {
9156 int cmp = PyObject_RichCompareBool(**name, key, Py_EQ);
9157 if (unlikely(cmp != 0)) {
9158 if (cmp == 1)
goto arg_passed_twice;
9165 __Pyx_RaiseDoubleKeywordsError(function_name, key);
9167invalid_keyword_type:
9168 PyErr_Format(PyExc_TypeError,
9169 "%.200s() keywords must be strings", function_name);
9174static CYTHON_INLINE
int __Pyx_MatchKeywordArg(
9176 PyObject **
const argnames[],
9177 PyObject **
const *first_kw_arg,
9178 size_t *index_found,
9179 const char *function_name)
9181 return likely(PyUnicode_CheckExact(key)) ?
9182 __Pyx_MatchKeywordArg_str(key, argnames, first_kw_arg, index_found, function_name) :
9183 __Pyx_MatchKeywordArg_nostr(key, argnames, first_kw_arg, index_found, function_name);
9185static void __Pyx_RejectUnknownKeyword(
9187 PyObject **
const argnames[],
9188 PyObject **
const *first_kw_arg,
9189 const char *function_name)
9191 #if CYTHON_AVOID_BORROWED_REFS
9192 PyObject *pos = NULL;
9196 PyObject *key = NULL;
9197 __Pyx_BEGIN_CRITICAL_SECTION(kwds);
9198 #if CYTHON_AVOID_BORROWED_REFS
9199 while (__Pyx_PyDict_NextRef(kwds, &pos, &key, NULL))
9201 (void) __Pyx_PyDict_NextRef;
9202 while (PyDict_Next(kwds, &pos, &key, NULL))
9205 PyObject**
const *name = first_kw_arg;
9206 while (*name && (**name != key)) name++;
9208 size_t index_found = 0;
9209 int cmp = __Pyx_MatchKeywordArg(key, argnames, first_kw_arg, &index_found, function_name);
9212 PyErr_Format(PyExc_TypeError,
9213 "%s() got an unexpected keyword argument '%U'",
9214 function_name, key);
9216 #if CYTHON_AVOID_BORROWED_REFS
9222 #if CYTHON_AVOID_BORROWED_REFS
9226 __Pyx_END_CRITICAL_SECTION();
9227 #if CYTHON_AVOID_BORROWED_REFS
9230 assert(PyErr_Occurred());
9232static int __Pyx_ParseKeywordDict(
9234 PyObject **
const argnames[],
9236 Py_ssize_t num_pos_args,
9237 Py_ssize_t num_kwargs,
9238 const char* function_name,
9239 int ignore_unknown_kwargs)
9241 PyObject**
const *name;
9242 PyObject**
const *first_kw_arg = argnames + num_pos_args;
9243 Py_ssize_t extracted = 0;
9244#if !CYTHON_COMPILING_IN_PYPY || defined(PyArg_ValidateKeywordArguments)
9245 if (unlikely(!PyArg_ValidateKeywordArguments(kwds)))
return -1;
9247 name = first_kw_arg;
9248 while (*name && num_kwargs > extracted) {
9249 PyObject * key = **name;
9252 #if __PYX_LIMITED_VERSION_HEX >= 0x030d0000
9253 found = PyDict_GetItemRef(kwds, key, &value);
9255 value = PyDict_GetItemWithError(kwds, key);
9260 if (unlikely(PyErr_Occurred()))
goto bad;
9264 if (unlikely(found < 0))
goto bad;
9265 values[name-argnames] = value;
9270 if (num_kwargs > extracted) {
9271 if (ignore_unknown_kwargs) {
9272 if (unlikely(__Pyx_ValidateDuplicatePosArgs(kwds, argnames, first_kw_arg, function_name) == -1))
9275 __Pyx_RejectUnknownKeyword(kwds, argnames, first_kw_arg, function_name);
9283static int __Pyx_ParseKeywordDictToDict(
9285 PyObject **
const argnames[],
9288 Py_ssize_t num_pos_args,
9289 const char* function_name)
9291 PyObject**
const *name;
9292 PyObject**
const *first_kw_arg = argnames + num_pos_args;
9294#if !CYTHON_COMPILING_IN_PYPY || defined(PyArg_ValidateKeywordArguments)
9295 if (unlikely(!PyArg_ValidateKeywordArguments(kwds)))
return -1;
9297 if (PyDict_Update(kwds2, kwds) < 0)
goto bad;
9298 name = first_kw_arg;
9300 PyObject *key = **name;
9302#if !CYTHON_COMPILING_IN_LIMITED_API && (PY_VERSION_HEX >= 0x030d00A2 || defined(PyDict_Pop))
9303 int found = PyDict_Pop(kwds2, key, &value);
9305 if (unlikely(found < 0))
goto bad;
9306 values[name-argnames] = value;
9308#elif __PYX_LIMITED_VERSION_HEX >= 0x030d0000
9309 int found = PyDict_GetItemRef(kwds2, key, &value);
9311 if (unlikely(found < 0))
goto bad;
9312 values[name-argnames] = value;
9313 if (unlikely(PyDict_DelItem(kwds2, key) < 0))
goto bad;
9316 #if CYTHON_COMPILING_IN_CPYTHON
9317 value = _PyDict_Pop(kwds2, key, kwds2);
9319 value = __Pyx_CallUnboundCMethod2(&__pyx_mstate_global->__pyx_umethod_PyDict_Type_pop, kwds2, key, kwds2);
9321 if (value == kwds2) {
9324 if (unlikely(!value))
goto bad;
9325 values[name-argnames] = value;
9330 len = PyDict_Size(kwds2);
9332 return __Pyx_ValidateDuplicatePosArgs(kwds, argnames, first_kw_arg, function_name);
9333 }
else if (unlikely(len == -1)) {
9340static int __Pyx_ParseKeywordsTuple(
9342 PyObject *
const *kwvalues,
9343 PyObject **
const argnames[],
9346 Py_ssize_t num_pos_args,
9347 Py_ssize_t num_kwargs,
9348 const char* function_name,
9349 int ignore_unknown_kwargs)
9351 PyObject *key = NULL;
9352 PyObject**
const * name;
9353 PyObject**
const *first_kw_arg = argnames + num_pos_args;
9354 for (Py_ssize_t pos = 0; pos < num_kwargs; pos++) {
9355#if CYTHON_AVOID_BORROWED_REFS
9356 key = __Pyx_PySequence_ITEM(kwds, pos);
9358 key = __Pyx_PyTuple_GET_ITEM(kwds, pos);
9360#if !CYTHON_ASSUME_SAFE_MACROS
9361 if (unlikely(!key))
goto bad;
9363 name = first_kw_arg;
9364 while (*name && (**name != key)) name++;
9366 PyObject *value = kwvalues[pos];
9367 values[name-argnames] = __Pyx_NewRef(value);
9369 size_t index_found = 0;
9370 int cmp = __Pyx_MatchKeywordArg(key, argnames, first_kw_arg, &index_found, function_name);
9372 PyObject *value = kwvalues[pos];
9373 values[index_found] = __Pyx_NewRef(value);
9375 if (unlikely(cmp == -1))
goto bad;
9377 PyObject *value = kwvalues[pos];
9378 if (unlikely(PyDict_SetItem(kwds2, key, value)))
goto bad;
9379 }
else if (!ignore_unknown_kwargs) {
9380 goto invalid_keyword;
9384 #if CYTHON_AVOID_BORROWED_REFS
9391 PyErr_Format(PyExc_TypeError,
9392 "%s() got an unexpected keyword argument '%U'",
9393 function_name, key);
9396 #if CYTHON_AVOID_BORROWED_REFS
9403static int __Pyx_ParseKeywords(
9405 PyObject *
const *kwvalues,
9406 PyObject **
const argnames[],
9409 Py_ssize_t num_pos_args,
9410 Py_ssize_t num_kwargs,
9411 const char* function_name,
9412 int ignore_unknown_kwargs)
9414 if (CYTHON_VECTORCALL && likely(PyTuple_Check(kwds)))
9415 return __Pyx_ParseKeywordsTuple(kwds, kwvalues, argnames, kwds2, values, num_pos_args, num_kwargs, function_name, ignore_unknown_kwargs);
9417 return __Pyx_ParseKeywordDictToDict(kwds, argnames, kwds2, values, num_pos_args, function_name);
9419 return __Pyx_ParseKeywordDict(kwds, argnames, values, num_pos_args, num_kwargs, function_name, ignore_unknown_kwargs);
9423static void __Pyx_RaiseArgtupleInvalid(
9424 const char* func_name,
9428 Py_ssize_t num_found)
9430 Py_ssize_t num_expected;
9431 const char *more_or_less;
9432 if (num_found < num_min) {
9433 num_expected = num_min;
9434 more_or_less =
"at least";
9436 num_expected = num_max;
9437 more_or_less =
"at most";
9440 more_or_less =
"exactly";
9442 PyErr_Format(PyExc_TypeError,
9443 "%.200s() takes %.8s %" CYTHON_FORMAT_SSIZE_T
"d positional argument%.1s (%" CYTHON_FORMAT_SSIZE_T
"d given)",
9444 func_name, more_or_less, num_expected,
9445 (num_expected == 1) ?
"" :
"s", num_found);
9449static void __Pyx_ArgTypeError(PyObject *obj, PyTypeObject *type,
const char *name,
int exact)
9451 __Pyx_TypeName type_name;
9452 __Pyx_TypeName obj_type_name;
9453 PyObject *extra_info = __pyx_mstate_global->__pyx_empty_unicode;
9454 int from_annotation_subclass = 0;
9455 if (unlikely(!type)) {
9456 PyErr_SetString(PyExc_SystemError,
"Missing type object");
9458 }
else if (exact == 2) {
9459 if (__Pyx_TypeCheck(obj, type)) {
9460 from_annotation_subclass = 1;
9461 extra_info = __pyx_mstate_global->__pyx_kp_u_Note_that_Cython_is_deliberately;
9464 type_name = __Pyx_PyType_GetFullyQualifiedName(type);
9465 #if CYTHON_COMPILING_IN_LIMITED_API && __PYX_LIMITED_VERSION_HEX < 0x030d0000
9466 if (unlikely(!type_name))
return;
9468 obj_type_name = __Pyx_PyType_GetFullyQualifiedName(Py_TYPE(obj));
9469 #if CYTHON_COMPILING_IN_LIMITED_API && __PYX_LIMITED_VERSION_HEX < 0x030d0000
9470 if (unlikely(!obj_type_name))
goto obj_type_name_failed;
9472 PyErr_Format(PyExc_TypeError,
9473 "Argument '%.200s' has incorrect type (expected " __Pyx_FMT_TYPENAME
", got " __Pyx_FMT_TYPENAME
")"
9474#
if __PYX_LIMITED_VERSION_HEX < 0x030C0000
9477 , name, type_name, obj_type_name
9478#
if __PYX_LIMITED_VERSION_HEX < 0x030C0000
9479 , (from_annotation_subclass ?
". " :
""), extra_info
9482#if __PYX_LIMITED_VERSION_HEX >= 0x030C0000
9483 if (exact == 2 && from_annotation_subclass) {
9486 vargs[0] = PyErr_GetRaisedException();
9487 vargs[1] = extra_info;
9488 res = PyObject_VectorcallMethod(__pyx_mstate_global->__pyx_kp_u_add_note, vargs, 2, NULL);
9490 PyErr_SetRaisedException(vargs[0]);
9493 __Pyx_DECREF_TypeName(obj_type_name);
9494#if CYTHON_COMPILING_IN_LIMITED_API && __PYX_LIMITED_VERSION_HEX < 0x030d0000
9495obj_type_name_failed:
9497 __Pyx_DECREF_TypeName(type_name);
9502static CYTHON_INLINE
int __Pyx_ArgTypeTest(PyObject *obj, PyTypeObject *type,
int none_allowed,
const char *name,
int exact) {
9503 if (likely(Py_IS_TYPE(obj, type) | (none_allowed && (obj == Py_None))))
9505 if (!exact && likely(type) && likely(__Pyx_TypeCheck(obj, type)))
9507 __Pyx_ArgTypeError(obj, type, name, exact);
9512#ifndef __PYX_HAVE_RT_ImportType_3_3_0
9513#define __PYX_HAVE_RT_ImportType_3_3_0
9514static PyTypeObject *__Pyx_ImportType_3_3_0(PyObject *module,
const char *module_name,
const char *class_name,
9515 size_t size,
size_t alignment,
enum __Pyx_ImportType_CheckSize_3_3_0 check_size)
9517 PyObject *result = 0;
9518 Py_ssize_t basicsize;
9519 Py_ssize_t itemsize;
9520#if defined(Py_LIMITED_API) || (defined(CYTHON_COMPILING_IN_LIMITED_API) && CYTHON_COMPILING_IN_LIMITED_API)
9521 PyObject *py_basicsize;
9522 PyObject *py_itemsize;
9524 result = PyObject_GetAttrString(module, class_name);
9527 if (!PyType_Check(result)) {
9528 PyErr_Format(PyExc_TypeError,
9529 "%.200s.%.200s is not a type object",
9530 module_name, class_name);
9533#if !( defined(Py_LIMITED_API) || (defined(CYTHON_COMPILING_IN_LIMITED_API) && CYTHON_COMPILING_IN_LIMITED_API) )
9534 basicsize = ((PyTypeObject *)result)->tp_basicsize;
9535 itemsize = ((PyTypeObject *)result)->tp_itemsize;
9538 return (PyTypeObject *)result;
9540 py_basicsize = PyObject_GetAttrString(result,
"__basicsize__");
9543 basicsize = PyLong_AsSsize_t(py_basicsize);
9544 Py_DECREF(py_basicsize);
9546 if (basicsize == (Py_ssize_t)-1 && PyErr_Occurred())
9548 py_itemsize = PyObject_GetAttrString(result,
"__itemsize__");
9551 itemsize = PyLong_AsSsize_t(py_itemsize);
9552 Py_DECREF(py_itemsize);
9554 if (itemsize == (Py_ssize_t)-1 && PyErr_Occurred())
9558 if (size % alignment) {
9559 alignment = size % alignment;
9561 if (itemsize < (Py_ssize_t)alignment)
9562 itemsize = (Py_ssize_t)alignment;
9564 if ((
size_t)(basicsize + itemsize) < size) {
9565 PyErr_Format(PyExc_ValueError,
9566 "%.200s.%.200s size changed, may indicate binary incompatibility. "
9567 "Expected %zd from C header, got %zd from PyObject",
9568 module_name, class_name, size, basicsize+itemsize);
9571 if (check_size == __Pyx_ImportType_CheckSize_Error_3_3_0 &&
9572 ((
size_t)basicsize > size || (
size_t)(basicsize + itemsize) < size)) {
9573 PyErr_Format(PyExc_ValueError,
9574 "%.200s.%.200s size changed, may indicate binary incompatibility. "
9575 "Expected %zd from C header, got %zd-%zd from PyObject",
9576 module_name, class_name, size, basicsize, basicsize+itemsize);
9579 else if (check_size == __Pyx_ImportType_CheckSize_Warn_3_3_0 && (
size_t)basicsize > size) {
9580 if (PyErr_WarnFormat(NULL, 0,
9581 "%.200s.%.200s size changed, may indicate binary incompatibility. "
9582 "Expected %zd from C header, got %zd from PyObject",
9583 module_name, class_name, size, basicsize) < 0) {
9587 return (PyTypeObject *)result;
9595#if __PYX_LIMITED_VERSION_HEX < 0x030d0000
9596static void __Pyx_PyObject_GetAttrStr_ClearAttributeError(
void) {
9597 __Pyx_PyThreadState_declare
9598 __Pyx_PyThreadState_assign
9599 if (likely(__Pyx_PyErr_ExceptionMatches(PyExc_AttributeError)))
9600 __Pyx_PyErr_Clear();
9603static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStrNoError(PyObject* obj, PyObject* attr_name) {
9605#if __PYX_LIMITED_VERSION_HEX >= 0x030d0000
9606 (void) PyObject_GetOptionalAttr(obj, attr_name, &result);
9609#if CYTHON_COMPILING_IN_CPYTHON && CYTHON_USE_TYPE_SLOTS
9610 PyTypeObject* tp = Py_TYPE(obj);
9611 if (likely(tp->tp_getattro == PyObject_GenericGetAttr)) {
9612 return _PyObject_GenericGetAttrWithDict(obj, attr_name, NULL, 1);
9615 result = __Pyx_PyObject_GetAttrStr(obj, attr_name);
9616 if (unlikely(!result)) {
9617 __Pyx_PyObject_GetAttrStr_ClearAttributeError();
9624#if __PYX_LIMITED_VERSION_HEX < 0x030d0000
9625static CYTHON_INLINE
int __Pyx_HasAttr(PyObject *o, PyObject *
n) {
9627 if (unlikely(!PyUnicode_Check(
n))) {
9628 PyErr_SetString(PyExc_TypeError,
9629 "hasattr(): attribute name must be string");
9632 r = __Pyx_PyObject_GetAttrStrNoError(o,
n);
9634 return (unlikely(PyErr_Occurred())) ? -1 : 0;
9643CYTHON_UNUSED
static PyObject *
9644__Pyx_PyList_FromArray(PyObject *
const *src, Py_ssize_t
n) {
9645 PyObject *res = PyList_New(
n);
9646 if (unlikely(res == NULL))
return NULL;
9647 #if CYTHON_COMPILING_IN_CPYTHON
9648 __Pyx_copy_object_array(src, ((PyListObject*)res)->ob_item,
n);
9651 for (i = 0; i <
n; i++) {
9653 if (unlikely(__Pyx_PyList_SET_ITEM(res, i, src[i]) < (0))) {
9663static int __Pyx__Import_GetModule(PyObject *qualname, PyObject **module) {
9664 PyObject *imported_module = PyImport_GetModule(qualname);
9665 if (unlikely(!imported_module)) {
9667 if (PyErr_Occurred()) {
9672 *
module = imported_module;
9675static int __Pyx__Import_Lookup(PyObject *qualname, PyObject *
const *imported_names, Py_ssize_t len_imported_names, PyObject **module) {
9676 PyObject *imported_module;
9677 PyObject *top_level_package_name;
9679 int status, module_found;
9680 Py_ssize_t dot_index;
9681 module_found = __Pyx__Import_GetModule(qualname, &imported_module);
9682 if (unlikely(!module_found || module_found == -1)) {
9684 return module_found;
9686 if (imported_names) {
9687 for (i = 0; i < len_imported_names; i++) {
9688 PyObject *imported_name = imported_names[i];
9689#if __PYX_LIMITED_VERSION_HEX < 0x030d0000
9690 int has_imported_attribute = PyObject_HasAttr(imported_module, imported_name);
9692 int has_imported_attribute = PyObject_HasAttrWithError(imported_module, imported_name);
9693 if (unlikely(has_imported_attribute == -1))
goto error;
9695 if (!has_imported_attribute) {
9699 *
module = imported_module;
9702 dot_index = PyUnicode_FindChar(qualname,
'.', 0, PY_SSIZE_T_MAX, 1);
9703 if (dot_index == -1) {
9704 *
module = imported_module;
9707 if (unlikely(dot_index == -2))
goto error;
9708 top_level_package_name = PyUnicode_Substring(qualname, 0, dot_index);
9709 if (unlikely(!top_level_package_name))
goto error;
9710 Py_DECREF(imported_module);
9711 status = __Pyx__Import_GetModule(top_level_package_name, module);
9712 Py_DECREF(top_level_package_name);
9715 Py_DECREF(imported_module);
9719 Py_DECREF(imported_module);
9723static PyObject *__Pyx__Import(PyObject *name, PyObject *
const *imported_names, Py_ssize_t len_imported_names, PyObject *qualname, PyObject *moddict,
int level) {
9724 PyObject *module = 0;
9725 PyObject *empty_dict = 0;
9726 PyObject *from_list = 0;
9731 module_found = __Pyx__Import_Lookup(qualname, imported_names, len_imported_names, &module);
9732 if (likely(module_found == 1)) {
9734 }
else if (unlikely(module_found == -1)) {
9737 #if !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX >= 0x030f00a6
9738 empty_dict = PyFrozenDict_New(NULL);
9740 empty_dict = PyDict_New();
9742 if (unlikely(!empty_dict))
9744 if (imported_names) {
9745 from_list = __Pyx_PyList_FromArray(imported_names, len_imported_names);
9746 if (unlikely(!from_list))
9750 const char* package_sep = strchr(__Pyx_MODULE_NAME,
'.');
9751 if (package_sep != (0)) {
9752 module = PyImport_ImportModuleLevelObject(
9753 name, moddict, empty_dict, from_list, 1);
9754 if (unlikely(!module)) {
9755 if (unlikely(!PyErr_ExceptionMatches(PyExc_ImportError)))
9763 module = PyImport_ImportModuleLevelObject(
9764 name, moddict, empty_dict, from_list, level);
9767 Py_XDECREF(from_list);
9768 Py_XDECREF(empty_dict);
9773static PyObject *__Pyx_Import(PyObject *name, PyObject *
const *imported_names, Py_ssize_t len_imported_names, PyObject *qualname,
int level) {
9774 return __Pyx__Import(name, imported_names, len_imported_names, qualname, __pyx_mstate_global->__pyx_d, level);
9778static CYTHON_INLINE PyObject *__Pyx_PyDict_SetDefault(PyObject *d, PyObject *key, PyObject *default_value) {
9780#if __PYX_LIMITED_VERSION_HEX >= 0x030F0000 || (!CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX >= 0x030d00A4)
9781 PyDict_SetDefaultRef(d, key, default_value, &value);
9782#elif CYTHON_COMPILING_IN_LIMITED_API && __PYX_LIMITED_VERSION_HEX >= 0x030C0000
9783 PyObject *args[] = {d, key, default_value};
9784 value = PyObject_VectorcallMethod(__pyx_mstate_global->__pyx_n_u_setdefault, args, 3 | PY_VECTORCALL_ARGUMENTS_OFFSET, NULL);
9785#elif CYTHON_COMPILING_IN_LIMITED_API
9786 value = PyObject_CallMethodObjArgs(d, __pyx_mstate_global->__pyx_n_u_setdefault, key, default_value, NULL);
9788 value = PyDict_SetDefault(d, key, default_value);
9789 if (unlikely(!value))
return NULL;
9796#if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING && PY_VERSION_HEX < 0x030F00a3
9797 static PyObject *__Pyx_PyImport_AddModuleObjectRef(PyObject *name) {
9798 PyObject *module_dict = PyImport_GetModuleDict();
9800 if (PyMapping_GetOptionalItem(module_dict, name, &m) < 0) {
9803 if (m != NULL && PyModule_Check(m)) {
9807 m = PyModule_NewObject(name);
9810 if (PyDict_CheckExact(module_dict)) {
9812 (void)PyDict_SetDefaultRef(module_dict, name, m, &new_m);
9816 if (PyObject_SetItem(module_dict, name, m) != 0) {
9823 static PyObject *__Pyx_PyImport_AddModuleRef(
const char *name) {
9824 if ((PY_VERSION_HEX >= 0x030E0000) && Py_Version >= 0x030E0100) {
9825 return PyImport_AddModuleRef(name);
9827 PyObject *py_name = PyUnicode_FromString(name);
9828 if (!py_name)
return NULL;
9829 PyObject *module = __Pyx_PyImport_AddModuleObjectRef(py_name);
9833#elif __PYX_LIMITED_VERSION_HEX < 0x030d0000
9834 static PyObject *__Pyx_PyImport_AddModuleRef(
const char *name) {
9835 PyObject *module = PyImport_AddModule(name);
9842static PyObject *__Pyx_FetchSharedCythonABIModule(
void) {
9843 return __Pyx_PyImport_AddModuleRef(__PYX_ABI_MODULE_NAME);
9847static int __Pyx_VerifyCachedType(PyObject *cached_type,
9849 Py_ssize_t expected_basicsize) {
9850 Py_ssize_t basicsize;
9851 if (!PyType_Check(cached_type)) {
9852 PyErr_Format(PyExc_TypeError,
9853 "Shared Cython type %.200s is not a type object", name);
9856 if (expected_basicsize == 0) {
9859#if CYTHON_COMPILING_IN_LIMITED_API && CYTHON_OPAQUE_OBJECTS
9860 if (expected_basicsize < 0) {
9861 basicsize = PyType_GetTypeDataSize((PyTypeObject*)cached_type);
9865 #if CYTHON_COMPILING_IN_LIMITED_API
9866 PyObject *py_basicsize;
9867 py_basicsize = PyObject_GetAttrString(cached_type,
"__basicsize__");
9868 if (unlikely(!py_basicsize))
return -1;
9869 basicsize = PyLong_AsSsize_t(py_basicsize);
9870 Py_DECREF(py_basicsize);
9871 py_basicsize = NULL;
9872 if (unlikely(basicsize == (Py_ssize_t)-1) && PyErr_Occurred())
return -1;
9874 basicsize = ((PyTypeObject*) cached_type)->tp_basicsize;
9877 if ((expected_basicsize >= 0) ?
9878 (basicsize != expected_basicsize) :
9879 (basicsize < -expected_basicsize)) {
9880 PyErr_Format(PyExc_TypeError,
9881 "Shared Cython type %.200s has the wrong size, try recompiling",
9889#if __PYX_LIMITED_VERSION_HEX < 0x030C0000
9890static PyObject* __Pyx_PyType_FromMetaclass(PyTypeObject *metaclass, PyObject *module, PyType_Spec *spec, PyObject *bases) {
9891 PyObject *result = __Pyx_PyType_FromModuleAndSpec(module, spec, bases);
9892 if (result && metaclass) {
9893 PyObject *old_tp = (PyObject*)Py_TYPE(result);
9894 Py_INCREF((PyObject*)metaclass);
9895 Py_SET_TYPE(result, metaclass);
9897 PyType_Modified((PyTypeObject*)result);
9902#define __Pyx_PyType_FromMetaclass(me, mo, s, b) PyType_FromMetaclass(me, mo, s, b)
9904static PyTypeObject *__Pyx_FetchCommonTypeFromSpec(PyTypeObject *metaclass, PyObject *module, PyType_Spec *spec, PyObject *bases) {
9905 PyObject *abi_module = NULL, *cached_type = NULL, *abi_module_dict, *new_cached_type, *py_object_name;
9906 int get_item_ref_result;
9907 const char* object_name = strrchr(spec->name,
'.');
9908 object_name = object_name ? object_name+1 : spec->name;
9909 py_object_name = PyUnicode_FromString(object_name);
9910 if (!py_object_name)
return NULL;
9911 abi_module = __Pyx_FetchSharedCythonABIModule();
9912 if (!abi_module)
goto done;
9913 abi_module_dict = PyModule_GetDict(abi_module);
9914 if (!abi_module_dict)
goto done;
9915 get_item_ref_result = __Pyx_PyDict_GetItemRef(abi_module_dict, py_object_name, &cached_type);
9916 if (get_item_ref_result == 1) {
9917 if (__Pyx_VerifyCachedType(
9920 spec->basicsize) < 0) {
9924 }
else if (unlikely(get_item_ref_result == -1)) {
9927 cached_type = __Pyx_PyType_FromMetaclass(
9929 CYTHON_USE_MODULE_STATE ? module : abi_module,
9931 if (unlikely(!cached_type))
goto bad;
9932 new_cached_type = __Pyx_PyDict_SetDefault(abi_module_dict, py_object_name, cached_type);
9933 if (unlikely(new_cached_type != cached_type)) {
9934 if (unlikely(!new_cached_type))
goto bad;
9935 Py_DECREF(cached_type);
9936 cached_type = new_cached_type;
9937 if (__Pyx_VerifyCachedType(
9940 spec->basicsize) < 0) {
9945 Py_DECREF(new_cached_type);
9948 Py_XDECREF(abi_module);
9949 Py_DECREF(py_object_name);
9950 assert(cached_type == NULL || PyType_Check(cached_type));
9951 return (PyTypeObject *) cached_type;
9953 Py_XDECREF(cached_type);
9959static PyObject* __pyx_CommonTypesMetaclass_get_module(CYTHON_UNUSED PyObject *self, CYTHON_UNUSED
void* context) {
9960 return PyUnicode_FromString(__PYX_ABI_MODULE_NAME);
9962#if __PYX_LIMITED_VERSION_HEX < 0x030A0000
9963static PyObject* __pyx_CommonTypesMetaclass_call(CYTHON_UNUSED PyObject *self, CYTHON_UNUSED PyObject *args, CYTHON_UNUSED PyObject *kwds) {
9964 PyErr_SetString(PyExc_TypeError,
"Cannot instantiate Cython internal types");
9967static int __pyx_CommonTypesMetaclass_setattr(CYTHON_UNUSED PyObject *self, CYTHON_UNUSED PyObject *attr, CYTHON_UNUSED PyObject *value) {
9968 PyErr_SetString(PyExc_TypeError,
"Cython internal types are immutable");
9972static PyGetSetDef __pyx_CommonTypesMetaclass_getset[] = {
9973 {
"__module__", __pyx_CommonTypesMetaclass_get_module, NULL, NULL, NULL},
9976static PyType_Slot __pyx_CommonTypesMetaclass_slots[] = {
9977 {Py_tp_getset, (
void *)__pyx_CommonTypesMetaclass_getset},
9978 #if __PYX_LIMITED_VERSION_HEX < 0x030A0000
9979 {Py_tp_call, (
void*)__pyx_CommonTypesMetaclass_call},
9980 {Py_tp_new, (
void*)__pyx_CommonTypesMetaclass_call},
9981 {Py_tp_setattro, (
void*)__pyx_CommonTypesMetaclass_setattr},
9985static PyType_Spec __pyx_CommonTypesMetaclass_spec = {
9986 __PYX_TYPE_MODULE_PREFIX
"_common_types_metatype",
9989 Py_TPFLAGS_IMMUTABLETYPE |
9990 Py_TPFLAGS_DISALLOW_INSTANTIATION |
9992 __pyx_CommonTypesMetaclass_slots
9994static int __pyx_CommonTypesMetaclass_init(PyObject *module) {
9995 __pyx_mstatetype *mstate = __Pyx_PyModule_GetState(module);
9996 PyObject *bases = PyTuple_Pack(1, &PyType_Type);
9997 if (unlikely(!bases)) {
10000 mstate->__pyx_CommonTypesMetaclassType = __Pyx_FetchCommonTypeFromSpec(NULL, module, &__pyx_CommonTypesMetaclass_spec, bases);
10002 if (unlikely(mstate->__pyx_CommonTypesMetaclassType == NULL)) {
10009#if CYTHON_COMPILING_IN_LIMITED_API
10010static CYTHON_INLINE
int __Pyx__IsSameCyOrCFunctionNoMethod(PyObject *func,
void (*cfunc)(
void)) {
10011 if (__Pyx_CyFunction_Check(func)) {
10012 return __Pyx_as_CyFunctionObject(func)->func_methoddef->ml_meth == (PyCFunction) cfunc;
10013 }
else if (PyCFunction_Check(func)) {
10014 return PyCFunction_GetFunction(func) == (PyCFunction) cfunc;
10018static CYTHON_INLINE
int __Pyx__IsSameCyOrCFunction(PyObject *func,
void (*cfunc)(
void)) {
10019 if ((PyObject*)Py_TYPE(func) == __pyx_mstate_global->__Pyx_CachedMethodType) {
10021 PyObject *newFunc = PyObject_GetAttr(func, __pyx_mstate_global->__pyx_n_u_func);
10022 if (unlikely(!newFunc)) {
10026 result = __Pyx__IsSameCyOrCFunctionNoMethod(newFunc, cfunc);
10027 Py_DECREF(newFunc);
10030 return __Pyx__IsSameCyOrCFunctionNoMethod(func, cfunc);
10033static CYTHON_INLINE
int __Pyx__IsSameCyOrCFunction(PyObject *func,
void (*cfunc)(
void)) {
10034 if (PyMethod_Check(func)) {
10035 func = PyMethod_GET_FUNCTION(func);
10037 return __Pyx_CyOrPyCFunction_Check(func) && __Pyx_CyOrPyCFunction_GET_FUNCTION(func) == (PyCFunction) cfunc;
10040static CYTHON_INLINE
void __Pyx__CyFunction_SetClassObj(__pyx_CyFunctionObject*
f, PyObject* classobj) {
10041#if CYTHON_COMPILING_IN_LIMITED_API
10042 __Pyx_Py_XDECREF_SET(
10043 __Pyx__CyFunction_GetClassObj(
f),
10044 ((classobj) ? __Pyx_NewRef(classobj) : NULL));
10046 __Pyx_Py_XDECREF_SET(
10047 ((PyCMethodObject *) (
f))->mm_class,
10048 (PyTypeObject*)((classobj) ? __Pyx_NewRef(classobj) : NULL));
10051static CYTHON_INLINE PyObject *__Pyx_CyFunction_InitDefaults(PyObject *func, PyTypeObject *defaults_type) {
10052 __pyx_CyFunctionObject *m = __Pyx_as_CyFunctionObject(func);
10053 m->defaults = PyObject_CallObject((PyObject*)defaults_type, NULL);
10054 if (unlikely(!m->defaults))
10056 return m->defaults;
10058static CYTHON_INLINE
void __Pyx_CyFunction_SetDefaultsTuple(PyObject *func, PyObject *tuple) {
10059 __pyx_CyFunctionObject *m = __Pyx_as_CyFunctionObject(func);
10060 m->defaults_tuple = tuple;
10063static CYTHON_INLINE
void __Pyx_CyFunction_SetDefaultsKwDict(PyObject *func, PyObject *dict) {
10064 __pyx_CyFunctionObject *m = __Pyx_as_CyFunctionObject(func);
10065 m->defaults_kwdict = dict;
10068static CYTHON_INLINE
void __Pyx_CyFunction_SetAnnotationsDict(PyObject *func, PyObject *dict) {
10069 __pyx_CyFunctionObject *m = __Pyx_as_CyFunctionObject(func);
10070 m->func_annotations = dict;
10075#if !CYTHON_USE_TYPE_SPECS
10077static int __Pyx_call_type_traverse(PyObject *o,
int always_call, visitproc visit,
void *arg) {
10078 if (!always_call) {
10079 PyTypeObject *base = __Pyx_PyObject_GetSlot(o, tp_base, PyTypeObject*);
10080 unsigned long flags = PyType_GetFlags(base);
10081 if (flags & Py_TPFLAGS_HEAPTYPE) {
10085 Py_VISIT((PyObject*)Py_TYPE(o));
10091#if CYTHON_COMPILING_IN_LIMITED_API
10092static PyObject *__Pyx_PyMethod_New(PyObject *func, PyObject *self, PyObject *typ) {
10094 CYTHON_UNUSED_VAR(typ);
10096 return __Pyx_NewRef(func);
10097 #if __PYX_LIMITED_VERSION_HEX >= 0x030C0000
10099 PyObject *args[] = {func, self};
10100 result = PyObject_Vectorcall(__pyx_mstate_global->__Pyx_CachedMethodType, args, 2, NULL);
10103 result = PyObject_CallFunctionObjArgs(__pyx_mstate_global->__Pyx_CachedMethodType, func, self, NULL);
10108static PyObject *__Pyx_PyMethod_New(PyObject *func, PyObject *self, PyObject *typ) {
10109 CYTHON_UNUSED_VAR(typ);
10111 return __Pyx_NewRef(func);
10112 return PyMethod_New(func, self);
10117#if CYTHON_VECTORCALL
10118static PyObject *__Pyx_PyVectorcall_FastCallDict_kw(PyObject *func, __pyx_vectorcallfunc vc, PyObject *
const *args,
size_t nargs, PyObject *kw)
10120 PyObject *res = NULL;
10122 PyObject **newargs;
10123 PyObject **kwvalues;
10125 #if CYTHON_AVOID_BORROWED_REFS
10131 PyObject *key, *value;
10132 unsigned long keys_are_strings;
10133 #if !CYTHON_ASSUME_SAFE_SIZE
10134 Py_ssize_t nkw = PyDict_Size(kw);
10135 if (unlikely(nkw == -1))
return NULL;
10137 Py_ssize_t nkw = PyDict_GET_SIZE(kw);
10139 newargs = (PyObject **)PyMem_Malloc((nargs + (
size_t)nkw) *
sizeof(args[0]));
10140 if (unlikely(newargs == NULL)) {
10144 for (j = 0; j < nargs; j++) newargs[j] = args[j];
10145 kwnames = PyTuple_New(nkw);
10146 if (unlikely(kwnames == NULL)) {
10147 PyMem_Free(newargs);
10150 kwvalues = newargs + nargs;
10153 keys_are_strings = Py_TPFLAGS_UNICODE_SUBCLASS;
10154 while (__Pyx_PyDict_NextRef(kw, &pos, &key, &value)) {
10155 keys_are_strings &=
10156 #if CYTHON_COMPILING_IN_LIMITED_API
10157 PyType_GetFlags(Py_TYPE(key));
10159 Py_TYPE(key)->tp_flags;
10161 #if !CYTHON_ASSUME_SAFE_MACROS
10162 if (unlikely(PyTuple_SetItem(kwnames, i, key) < 0))
goto cleanup;
10164 PyTuple_SET_ITEM(kwnames, i, key);
10166 kwvalues[i] = value;
10169 if (unlikely(!keys_are_strings)) {
10170 PyErr_SetString(PyExc_TypeError,
"keywords must be strings");
10173 res = vc(func, newargs, nargs, kwnames);
10175 #if CYTHON_AVOID_BORROWED_REFS
10178 Py_DECREF(kwnames);
10179 for (i = 0; i < nkw; i++)
10180 Py_DECREF(kwvalues[i]);
10181 PyMem_Free(newargs);
10184static CYTHON_INLINE PyObject *__Pyx_PyVectorcall_FastCallDict(PyObject *func, __pyx_vectorcallfunc vc, PyObject *
const *args,
size_t nargs, PyObject *kw)
10186 Py_ssize_t kw_size =
10187 likely(kw == NULL) ?
10189#if !CYTHON_ASSUME_SAFE_SIZE
10192 PyDict_GET_SIZE(kw);
10194 if (kw_size == 0) {
10195 return vc(func, args, nargs, NULL);
10197#if !CYTHON_ASSUME_SAFE_SIZE
10198 else if (unlikely(kw_size == -1)) {
10202 return __Pyx_PyVectorcall_FastCallDict_kw(func, vc, args, nargs, kw);
10208__Pyx_CyFunction_get_doc_locked(__pyx_CyFunctionObject *op)
10210 if (unlikely(op->func_doc == NULL)) {
10211#if CYTHON_COMPILING_IN_LIMITED_API
10212 const char *doc = op->func_methoddef->ml_doc;
10214 const char *doc = ((PyCFunctionObject*)op)->m_ml->ml_doc;
10217 op->func_doc = PyUnicode_FromString(doc);
10218 if (unlikely(op->func_doc == NULL))
10221 Py_INCREF(Py_None);
10225 Py_INCREF(op->func_doc);
10226 return op->func_doc;
10229__Pyx_CyFunction_get_doc(PyObject *op_in,
void *closure) {
10231 __pyx_CyFunctionObject *op = __Pyx_as_CyFunctionObject(op_in);
10232 CYTHON_UNUSED_VAR(closure);
10233 __Pyx_BEGIN_CRITICAL_SECTION(op_in);
10234 result = __Pyx_CyFunction_get_doc_locked(op);
10235 __Pyx_END_CRITICAL_SECTION();
10239__Pyx_CyFunction_set_doc(PyObject *op_in, PyObject *value,
void *context)
10241 __pyx_CyFunctionObject *op = __Pyx_as_CyFunctionObject(op_in);
10242 CYTHON_UNUSED_VAR(context);
10243 if (value == NULL) {
10247 __Pyx_BEGIN_CRITICAL_SECTION(op_in);
10248 __Pyx_Py_XDECREF_SET(op->func_doc, value);
10249 __Pyx_END_CRITICAL_SECTION();
10253__Pyx_CyFunction_get_name_locked(__pyx_CyFunctionObject *op)
10255 if (unlikely(op->func_name == NULL)) {
10256#if CYTHON_COMPILING_IN_LIMITED_API
10257 const char *name = op->func_methoddef->ml_name;
10259 const char *name = ((PyCFunctionObject*)op)->m_ml->ml_name;
10261 op->func_name = PyUnicode_InternFromString(name);
10262 if (unlikely(op->func_name == NULL))
10265 Py_INCREF(op->func_name);
10266 return op->func_name;
10269__Pyx_CyFunction_get_name(PyObject *op,
void *context)
10271 PyObject *result = NULL;
10272 CYTHON_UNUSED_VAR(context);
10273 __Pyx_BEGIN_CRITICAL_SECTION(op);
10274 result = __Pyx_CyFunction_get_name_locked(__Pyx_as_CyFunctionObject(op));
10275 __Pyx_END_CRITICAL_SECTION();
10279__Pyx_CyFunction_set_name(PyObject *op_in, PyObject *value,
void *context)
10281 CYTHON_UNUSED_VAR(context);
10282 if (unlikely(value == NULL || !PyUnicode_Check(value))) {
10283 PyErr_SetString(PyExc_TypeError,
10284 "__name__ must be set to a string object");
10287 __pyx_CyFunctionObject *op = __Pyx_as_CyFunctionObject(op_in);
10289 __Pyx_BEGIN_CRITICAL_SECTION(op_in);
10290 __Pyx_Py_XDECREF_SET(op->func_name, value);
10291 __Pyx_END_CRITICAL_SECTION();
10295__Pyx_CyFunction_get_qualname(PyObject *op_in,
void *context)
10297 CYTHON_UNUSED_VAR(context);
10298 __pyx_CyFunctionObject *op = __Pyx_as_CyFunctionObject(op_in);
10300 __Pyx_BEGIN_CRITICAL_SECTION(op_in);
10301 Py_INCREF(op->func_qualname);
10302 result = op->func_qualname;
10303 __Pyx_END_CRITICAL_SECTION();
10307__Pyx_CyFunction_set_qualname(PyObject *op_in, PyObject *value,
void *context)
10309 CYTHON_UNUSED_VAR(context);
10310 if (unlikely(value == NULL || !PyUnicode_Check(value))) {
10311 PyErr_SetString(PyExc_TypeError,
10312 "__qualname__ must be set to a string object");
10315 __pyx_CyFunctionObject *op = __Pyx_as_CyFunctionObject(op_in);
10317 __Pyx_BEGIN_CRITICAL_SECTION(op_in);
10318 __Pyx_Py_XDECREF_SET(op->func_qualname, value);
10319 __Pyx_END_CRITICAL_SECTION();
10322#if CYTHON_COMPILING_IN_LIMITED_API && __PYX_LIMITED_VERSION_HEX < 0x030A0000
10324__Pyx_CyFunction_get_dict(__pyx_CyFunctionObject *op,
void *context)
10326 CYTHON_UNUSED_VAR(context);
10327 if (unlikely(op->func_dict == NULL)) {
10328 op->func_dict = PyDict_New();
10329 if (unlikely(op->func_dict == NULL))
10332 Py_INCREF(op->func_dict);
10333 return op->func_dict;
10337__Pyx_CyFunction_get_globals(PyObject *op_in,
void *context)
10339 CYTHON_UNUSED_VAR(context);
10340 __pyx_CyFunctionObject *op = __Pyx_as_CyFunctionObject(op_in);
10341 Py_INCREF(op->func_globals);
10342 return op->func_globals;
10345__Pyx_CyFunction_get_closure(PyObject *op,
void *context)
10347 CYTHON_UNUSED_VAR(op);
10348 CYTHON_UNUSED_VAR(context);
10349 Py_INCREF(Py_None);
10353__Pyx_CyFunction_get_code(PyObject *op_in,
void *context)
10355 __pyx_CyFunctionObject *op = __Pyx_as_CyFunctionObject(op_in);
10356 PyObject* result = (op->func_code) ? op->func_code : Py_None;
10357 CYTHON_UNUSED_VAR(context);
10362__Pyx_CyFunction_init_defaults(__pyx_CyFunctionObject *op, PyObject *op_obj) {
10364 PyObject *res = op->defaults_getter(op_obj);
10365 if (unlikely(!res))
10367 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
10368 op->defaults_tuple = PyTuple_GET_ITEM(res, 0);
10369 Py_INCREF(op->defaults_tuple);
10370 op->defaults_kwdict = PyTuple_GET_ITEM(res, 1);
10371 Py_INCREF(op->defaults_kwdict);
10373 op->defaults_tuple = __Pyx_PySequence_ITEM(res, 0);
10374 if (unlikely(!op->defaults_tuple)) result = -1;
10376 op->defaults_kwdict = __Pyx_PySequence_ITEM(res, 1);
10377 if (unlikely(!op->defaults_kwdict)) result = -1;
10384__Pyx_CyFunction_set_defaults(PyObject *op_in, PyObject* value,
void *context) {
10385 __pyx_CyFunctionObject *op = __Pyx_as_CyFunctionObject(op_in);
10386 CYTHON_UNUSED_VAR(context);
10389 }
else if (unlikely(value != Py_None && !PyTuple_Check(value))) {
10390 PyErr_SetString(PyExc_TypeError,
10391 "__defaults__ must be set to a tuple object");
10394 PyErr_WarnEx(PyExc_RuntimeWarning,
"changes to cyfunction.__defaults__ will not "
10395 "currently affect the values used in function calls", 1);
10397 __Pyx_BEGIN_CRITICAL_SECTION(op_in);
10398 __Pyx_Py_XDECREF_SET(op->defaults_tuple, value);
10399 __Pyx_END_CRITICAL_SECTION();
10403__Pyx_CyFunction_get_defaults_locked(PyObject *op_in) {
10404 __pyx_CyFunctionObject *op = __Pyx_as_CyFunctionObject(op_in);
10405 PyObject* result = op->defaults_tuple;
10406 if (unlikely(!result)) {
10407 if (op->defaults_getter) {
10408 if (unlikely(__Pyx_CyFunction_init_defaults(op, op_in) < 0))
return NULL;
10409 result = op->defaults_tuple;
10418__Pyx_CyFunction_get_defaults(PyObject *op,
void *context) {
10419 PyObject* result = NULL;
10420 CYTHON_UNUSED_VAR(context);
10421 __Pyx_BEGIN_CRITICAL_SECTION(op);
10422 result = __Pyx_CyFunction_get_defaults_locked(op);
10423 __Pyx_END_CRITICAL_SECTION();
10427__Pyx_CyFunction_set_kwdefaults(PyObject *op_in, PyObject* value,
void *context) {
10428 __pyx_CyFunctionObject *op = __Pyx_as_CyFunctionObject(op_in);
10429 CYTHON_UNUSED_VAR(context);
10432 }
else if (unlikely(value != Py_None && !PyDict_Check(value))) {
10433 PyErr_SetString(PyExc_TypeError,
10434 "__kwdefaults__ must be set to a dict object");
10437 PyErr_WarnEx(PyExc_RuntimeWarning,
"changes to cyfunction.__kwdefaults__ will not "
10438 "currently affect the values used in function calls", 1);
10440 __Pyx_BEGIN_CRITICAL_SECTION(op_in);
10441 __Pyx_Py_XDECREF_SET(op->defaults_kwdict, value);
10442 __Pyx_END_CRITICAL_SECTION();
10446__Pyx_CyFunction_get_kwdefaults_locked(PyObject *op_in) {
10447 __pyx_CyFunctionObject *op = __Pyx_as_CyFunctionObject(op_in);
10448 PyObject* result = op->defaults_kwdict;
10449 if (unlikely(!result)) {
10450 if (op->defaults_getter) {
10451 if (unlikely(__Pyx_CyFunction_init_defaults(op, op_in) < 0))
return NULL;
10452 result = op->defaults_kwdict;
10461__Pyx_CyFunction_get_kwdefaults(PyObject *op,
void *context) {
10463 CYTHON_UNUSED_VAR(context);
10464 __Pyx_BEGIN_CRITICAL_SECTION(op);
10465 result = __Pyx_CyFunction_get_kwdefaults_locked(op);
10466 __Pyx_END_CRITICAL_SECTION();
10469static int __Pyx_CyFunction_set_annotate_in_dict_if_exists(PyObject *op_in, PyObject *value);
10471__Pyx_CyFunction_set_annotations(PyObject *op_in, PyObject* value,
void *context) {
10472 CYTHON_UNUSED_VAR(context);
10473 if (!value || value == Py_None) {
10475 }
else if (unlikely(!PyDict_Check(value))) {
10476 PyErr_SetString(PyExc_TypeError,
10477 "__annotations__ must be set to a dict object");
10480 __pyx_CyFunctionObject *op = __Pyx_as_CyFunctionObject(op_in);
10482 __Pyx_BEGIN_CRITICAL_SECTION(op_in);
10483 __Pyx_Py_XDECREF_SET(op->func_annotations, value);
10484 __Pyx_END_CRITICAL_SECTION();
10485 if (unlikely(__Pyx_CyFunction_set_annotate_in_dict_if_exists(op_in, Py_None) < 0))
return -1;
10489__Pyx_CyFunction_get_dict_if_exists(PyObject *op_in, PyObject **dict) {
10492#if CYTHON_COMPILING_IN_PYPY
10493 *dict = PyObject_GenericGetDict(op_in, NULL);
10494#elif CYTHON_COMPILING_IN_LIMITED_API || PY_VERSION_HEX < 0x030C0000
10495 *dict = __Pyx_as_CyFunctionObject(op_in)->func_dict;
10497 PyObject **dictptr = _PyObject_GetDictPtr(op_in);
10498 *dict = likely(dictptr) ? *dictptr : NULL;
10500 return *dict ? 1 : 0;
10503__Pyx_CyFunction_get_annotate_from_dict_if_exists(PyObject *op_in, PyObject **annotate) {
10507 dict_found = __Pyx_CyFunction_get_dict_if_exists(op_in, &dict);
10508 if (!dict_found)
return 0;
10509 return __Pyx_PyDict_GetItemRef(dict, __pyx_mstate_global->__pyx_n_u_annotate, annotate);
10512__Pyx_CyFunction_set_annotate_in_dict_if_exists(PyObject *op_in, PyObject *value) {
10515 dict_found = __Pyx_CyFunction_get_dict_if_exists(op_in, &dict);
10516 if (!dict_found)
return 0;
10518 return PyDict_SetItem(dict, __pyx_mstate_global->__pyx_n_u_annotate, value);
10520#if !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX >= 0x030d0000
10521 return PyDict_Pop(dict, __pyx_mstate_global->__pyx_n_u_annotate, NULL);
10523 int result = PyDict_Contains(dict, __pyx_mstate_global->__pyx_n_u_annotate);
10525 result = PyDict_DelItem(dict, __pyx_mstate_global->__pyx_n_u_annotate);
10532__Pyx_CyFunction_set_annotate_in_dict(PyObject *op_in, PyObject *value) {
10535#if CYTHON_COMPILING_IN_LIMITED_API && __PYX_LIMITED_VERSION_HEX < 0x030A0000
10536 dict = __Pyx_CyFunction_get_dict(__Pyx_as_CyFunctionObject(op_in), NULL);
10538 dict = PyObject_GenericGetDict(op_in, NULL);
10540 if (unlikely(!dict))
return -1;
10541 result = PyDict_SetItem(dict, __pyx_mstate_global->__pyx_n_u_annotate, value);
10546__Pyx_CyFunction_get_annotations_locked(__pyx_CyFunctionObject *op) {
10547 PyObject* result = op->func_annotations;
10548 if (unlikely(!result)) {
10549 result = PyDict_New();
10550 if (unlikely(!result))
return NULL;
10551 op->func_annotations = result;
10557__Pyx_CyFunction_get_annotations(PyObject *op_in,
void *context) {
10558 PyObject *annotate = NULL;
10559 PyObject *result = NULL;
10560 __pyx_CyFunctionObject *op = __Pyx_as_CyFunctionObject(op_in);
10561 CYTHON_UNUSED_VAR(context);
10562 __Pyx_BEGIN_CRITICAL_SECTION(op_in);
10563 result = __Pyx_XNewRef(op->func_annotations);
10564 __Pyx_END_CRITICAL_SECTION();
10565 if (result)
return result;
10566 if (unlikely(__Pyx_CyFunction_get_annotate_from_dict_if_exists(op_in, &annotate) < 0))
return NULL;
10567 if (!annotate || annotate == Py_None) {
10568 Py_XDECREF(annotate);
10569 __Pyx_BEGIN_CRITICAL_SECTION(op_in);
10570 result = __Pyx_CyFunction_get_annotations_locked(op);
10571 __Pyx_END_CRITICAL_SECTION();
10574 PyObject *format = PyLong_FromLong(1L);
10575 if (likely(format)) {
10576 if (!Py_EnterRecursiveCall(
" cyfunction __annotations__.__get__")) {
10577 result = __Pyx_PyObject_CallOneArg(annotate, format);
10578 Py_LeaveRecursiveCall();
10582 Py_DECREF(annotate);
10583 if (unlikely(!result))
return NULL;
10584 if (unlikely(!PyDict_Check(result))) {
10585 PyErr_SetString(PyExc_TypeError,
"__annotate__ must return a dict");
10589 __Pyx_BEGIN_CRITICAL_SECTION(op_in);
10590 __Pyx_Py_XDECREF_SET(op->func_annotations, __Pyx_NewRef(result));
10591 __Pyx_END_CRITICAL_SECTION();
10594static PyObject *__Pyx_CyFunction_annotate_impl(PyObject *self, PyObject *arg) {
10595 CYTHON_UNUSED_VAR(arg);
10596 if (unlikely(!self)) {
10597 PyErr_SetString(PyExc_SystemError,
"cython __annotate__ called without 'self' argument");
10601 if (Py_EnterRecursiveCall(
" in cyfunction annotate")) {
10604 result = __Pyx_CyFunction_get_annotations(self, NULL);
10605 Py_LeaveRecursiveCall();
10609__Pyx_CyFunction_get_annotate(PyObject *op_in,
void *context);
10611__Pyx_CyFunction_set_annotate(PyObject *op_in, PyObject* value,
void *context) {
10612 CYTHON_UNUSED_VAR(context);
10613 if (value == NULL) {
10614 PyErr_SetString(PyExc_TypeError,
"__annotate__ cannot be deleted");
10617 if (unlikely(value != Py_None && !PyCallable_Check(value))) {
10618 PyErr_SetString(PyExc_TypeError,
"__annotate__ must be callable or None");
10621 if (unlikely(__Pyx_TypeCheck(value, &PyCFunction_Type))) {
10622#if !CYTHON_ASSUME_SAFE_MACROS && !CYTHON_COMPILING_IN_PYPY
10623 PyCFunction cfunction = PyCFunction_GetFunction(value);
10624 if (unlikely(!cfunction))
return -1;
10625 PyObject *value_self = PyCFunction_GetSelf(value);
10626 if (unlikely(!value_self && PyErr_Occurred()))
return -1;
10628 PyCFunction cfunction = PyCFunction_GET_FUNCTION(value);
10629 PyObject *value_self = PyCFunction_GET_SELF(value);
10631 if (cfunction == __Pyx_CyFunction_annotate_impl && value_self == op_in) {
10632 return __Pyx_CyFunction_set_annotate_in_dict_if_exists(op_in, NULL);
10635 if (value != Py_None) {
10636 __pyx_CyFunctionObject *op = __Pyx_as_CyFunctionObject(op_in);
10637 __Pyx_BEGIN_CRITICAL_SECTION(op_in);
10638 Py_CLEAR(op->func_annotations);
10639 __Pyx_END_CRITICAL_SECTION();
10641 return __Pyx_CyFunction_set_annotate_in_dict(op_in, value);
10643#if __PYX_LIMITED_VERSION_HEX < 0x030B0000
10645__Pyx_CyFunction_get_is_coroutine_value(__pyx_CyFunctionObject *op) {
10646 int is_coroutine = op->flags & __Pyx_CYFUNCTION_COROUTINE;
10647 if (is_coroutine) {
10648 PyObject *is_coroutine_value, *module, *fromlist, *marker = __pyx_mstate_global->__pyx_n_u_is_coroutine;
10649 fromlist = PyList_New(1);
10650 if (unlikely(!fromlist))
return NULL;
10652#if CYTHON_ASSUME_SAFE_MACROS
10653 PyList_SET_ITEM(fromlist, 0, marker);
10655 if (unlikely(PyList_SetItem(fromlist, 0, marker) < 0)) {
10656 Py_DECREF(fromlist);
10660 module = PyImport_ImportModuleLevelObject(__pyx_mstate_global->__pyx_n_u_asyncio_coroutines, NULL, NULL, fromlist, 0);
10661 Py_DECREF(fromlist);
10662 if (unlikely(!module)) {
10663 goto ignore_or_error;
10665 is_coroutine_value = __Pyx_PyObject_GetAttrStr(module, marker);
10667 if (likely(is_coroutine_value)) {
10668 return is_coroutine_value;
10671 if (!__Pyx_IgnoreException(PyExc_Exception)) {
10675 return __Pyx_PyBool_FromLong(is_coroutine);
10678__Pyx_CyFunction_get_is_coroutine(PyObject *op_in,
void *context) {
10679 __pyx_CyFunctionObject *op = __Pyx_as_CyFunctionObject(op_in);
10681 CYTHON_UNUSED_VAR(context);
10682 if (op->func_is_coroutine) {
10683 return __Pyx_NewRef(op->func_is_coroutine);
10685 result = __Pyx_CyFunction_get_is_coroutine_value(op);
10686 if (unlikely(!result))
10688 __Pyx_BEGIN_CRITICAL_SECTION(op_in);
10689 if (op->func_is_coroutine) {
10691 result = __Pyx_NewRef(op->func_is_coroutine);
10693 op->func_is_coroutine = __Pyx_NewRef(result);
10695 __Pyx_END_CRITICAL_SECTION();
10699static void __Pyx_CyFunction_raise_argument_count_error(PyObject *func,
const char* message, Py_ssize_t size) {
10700#if CYTHON_COMPILING_IN_LIMITED_API
10701 PyObject *py_name = __Pyx_CyFunction_get_name(func, NULL);
10702 if (!py_name)
return;
10703 PyErr_Format(PyExc_TypeError,
10704 "%.200S() %s (%" CYTHON_FORMAT_SSIZE_T
"d given)",
10705 py_name, message, size);
10706 Py_DECREF(py_name);
10708 const char* name = ((PyCFunctionObject*)func)->m_ml->ml_name;
10709 PyErr_Format(PyExc_TypeError,
10710 "%.200s() %s (%" CYTHON_FORMAT_SSIZE_T
"d given)",
10711 name, message, size);
10714static void __Pyx_CyFunction_raise_type_error(PyObject *func,
const char* message) {
10715#if CYTHON_COMPILING_IN_LIMITED_API
10716 PyObject *py_name = __Pyx_CyFunction_get_name(func, NULL);
10717 if (!py_name)
return;
10718 PyErr_Format(PyExc_TypeError,
10721 Py_DECREF(py_name);
10723 const char* name = ((PyCFunctionObject*)func)->m_ml->ml_name;
10724 PyErr_Format(PyExc_TypeError,
10729#if CYTHON_COMPILING_IN_LIMITED_API
10731__Pyx_CyFunction_get_module(PyObject *op_in,
void *context) {
10732 CYTHON_UNUSED_VAR(context);
10733 __pyx_CyFunctionObject *op = __Pyx_as_CyFunctionObject(op_in);
10734 Py_INCREF(op->func_module);
10735 return op->func_module;
10738__Pyx_CyFunction_set_module(PyObject *op_in, PyObject* value,
void *context) {
10739 CYTHON_UNUSED_VAR(context);
10740 __pyx_CyFunctionObject *op = __Pyx_as_CyFunctionObject(op_in);
10741 if (value == NULL) {
10745 PyObject *old = op->func_module;
10746 op->func_module = value;
10751static PyGetSetDef __pyx_CyFunction_getsets[] = {
10752 {
"func_doc", (getter)__Pyx_CyFunction_get_doc, (setter)__Pyx_CyFunction_set_doc, 0, 0},
10753 {
"__doc__", (getter)__Pyx_CyFunction_get_doc, (setter)__Pyx_CyFunction_set_doc, 0, 0},
10754 {
"func_name", (getter)__Pyx_CyFunction_get_name, (setter)__Pyx_CyFunction_set_name, 0, 0},
10755 {
"__name__", (getter)__Pyx_CyFunction_get_name, (setter)__Pyx_CyFunction_set_name, 0, 0},
10756 {
"__qualname__", (getter)__Pyx_CyFunction_get_qualname, (setter)__Pyx_CyFunction_set_qualname, 0, 0},
10757#if CYTHON_COMPILING_IN_LIMITED_API && __PYX_LIMITED_VERSION_HEX < 0x030A0000
10758 {
"func_dict", (getter)__Pyx_CyFunction_get_dict, (setter)PyObject_GenericSetDict, 0, 0},
10759 {
"__dict__", (getter)__Pyx_CyFunction_get_dict, (setter)PyObject_GenericSetDict, 0, 0},
10761 {
"func_dict", (getter)PyObject_GenericGetDict, (setter)PyObject_GenericSetDict, 0, 0},
10762 {
"__dict__", (getter)PyObject_GenericGetDict, (setter)PyObject_GenericSetDict, 0, 0},
10764 {
"func_globals", (getter)__Pyx_CyFunction_get_globals, 0, 0, 0},
10765 {
"__globals__", (getter)__Pyx_CyFunction_get_globals, 0, 0, 0},
10766 {
"func_closure", (getter)__Pyx_CyFunction_get_closure, 0, 0, 0},
10767 {
"__closure__", (getter)__Pyx_CyFunction_get_closure, 0, 0, 0},
10768 {
"func_code", (getter)__Pyx_CyFunction_get_code, 0, 0, 0},
10769 {
"__code__", (getter)__Pyx_CyFunction_get_code, 0, 0, 0},
10770 {
"func_defaults", (getter)__Pyx_CyFunction_get_defaults, (setter)__Pyx_CyFunction_set_defaults, 0, 0},
10771 {
"__defaults__", (getter)__Pyx_CyFunction_get_defaults, (setter)__Pyx_CyFunction_set_defaults, 0, 0},
10772 {
"__kwdefaults__", (getter)__Pyx_CyFunction_get_kwdefaults, (setter)__Pyx_CyFunction_set_kwdefaults, 0, 0},
10773 {
"__annotations__", (getter)__Pyx_CyFunction_get_annotations, (setter)__Pyx_CyFunction_set_annotations, 0, 0},
10774 {
"__annotate__", (getter)__Pyx_CyFunction_get_annotate, (setter)__Pyx_CyFunction_set_annotate, 0, 0},
10775#if __PYX_LIMITED_VERSION_HEX < 0x030B0000
10776 {
"_is_coroutine", (getter)__Pyx_CyFunction_get_is_coroutine, 0, 0, 0},
10778#if CYTHON_COMPILING_IN_LIMITED_API
10779 {
"__module__", (getter)__Pyx_CyFunction_get_module, (setter)__Pyx_CyFunction_set_module, 0, 0},
10783static PyMemberDef __pyx_CyFunction_members[] = {
10784#if !CYTHON_COMPILING_IN_LIMITED_API
10785 {
"__module__", T_OBJECT, offsetof(PyCFunctionObject, m_module), 0, 0},
10787#if PY_VERSION_HEX < 0x030C0000 || CYTHON_COMPILING_IN_LIMITED_API
10788 {
"__dictoffset__", T_PYSSIZET, offsetof(__pyx_CyFunctionObject, func_dict),
10789 __PYX_SHARED_RELATIVE_OFFSET | READONLY, 0},
10791#if CYTHON_VECTORCALL
10792#if CYTHON_COMPILING_IN_LIMITED_API || CYTHON_COMPILING_IN_PYPY
10793 {
"__vectorcalloffset__", T_PYSSIZET, offsetof(__pyx_CyFunctionObject, func_vectorcall),
10794 __PYX_SHARED_RELATIVE_OFFSET | READONLY, 0},
10796 {
"__vectorcalloffset__", T_PYSSIZET, offsetof(PyCFunctionObject, vectorcall), READONLY, 0},
10798#if CYTHON_COMPILING_IN_LIMITED_API
10799 {
"__weaklistoffset__", T_PYSSIZET, offsetof(__pyx_CyFunctionObject, func_weakreflist),
10800 __PYX_SHARED_RELATIVE_OFFSET | READONLY, 0},
10802 {
"__weaklistoffset__", T_PYSSIZET, offsetof(PyCFunctionObject, m_weakreflist), READONLY, 0},
10808__Pyx_CyFunction_reduce(PyObject *m_in, PyObject *args)
10810 PyObject *result = NULL;
10811 __pyx_CyFunctionObject *m = __Pyx_as_CyFunctionObject(m_in);
10812 CYTHON_UNUSED_VAR(args);
10813 __Pyx_BEGIN_CRITICAL_SECTION(m_in);
10814 Py_INCREF(m->func_qualname);
10815 result = m->func_qualname;
10816 __Pyx_END_CRITICAL_SECTION();
10819static PyMethodDef __pyx_CyFunction_methods[] = {
10820 {
"__annotate_cython__", __Pyx_CyFunction_annotate_impl, METH_O,
10821 "Placeholder __annotate__ function to allow 'functools.wraps' to work "
10822 "on Cython functions."},
10823 {
"__reduce__", (PyCFunction)__Pyx_CyFunction_reduce, METH_NOARGS, 0},
10827__Pyx_CyFunction_get_annotate(PyObject *op_in,
void *context) {
10828 PyObject *annotate = NULL;
10829 CYTHON_UNUSED_VAR(context);
10830 if (unlikely(__Pyx_CyFunction_get_annotate_from_dict_if_exists(op_in, &annotate) < 0))
return NULL;
10831 if (annotate)
return annotate;
10832 PyObject *method = PyCFunction_New(
10833 &__pyx_CyFunction_methods[0],
10837#if CYTHON_COMPILING_IN_LIMITED_API
10838#define __Pyx_CyFunction_weakreflist(cyfunc) ((cyfunc)->func_weakreflist)
10840#define __Pyx_CyFunction_weakreflist(cyfunc) (((PyCFunctionObject*)cyfunc)->m_weakreflist)
10842static PyObject *__Pyx_CyFunction_Init(PyObject *op_in,
10843 PyMethodDef *ml,
int flags, PyObject* qualname,
10844 PyObject *closure, PyObject *module, PyObject* globals, PyObject* code) {
10845 __pyx_CyFunctionObject* op = __Pyx_as_CyFunctionObject(op_in);
10846#if !CYTHON_COMPILING_IN_LIMITED_API
10847 PyCFunctionObject *cf = (PyCFunctionObject*) op;
10849 if (unlikely(op == NULL))
10851#if CYTHON_COMPILING_IN_LIMITED_API
10852 op->func_methoddef = ml;
10854 op->func_module =
module;
10857 __Pyx_CyFunction_weakreflist(op) = NULL;
10858#if !CYTHON_COMPILING_IN_LIMITED_API
10860 cf->m_self = (PyObject *) op;
10862 Py_XINCREF(closure);
10863 op->func_closure = closure;
10864#if !CYTHON_COMPILING_IN_LIMITED_API
10865 Py_XINCREF(module);
10866 cf->m_module =
module;
10868#if PY_VERSION_HEX < 0x030C0000 || CYTHON_COMPILING_IN_LIMITED_API
10869 op->func_dict = NULL;
10871 op->func_name = NULL;
10872 Py_INCREF(qualname);
10873 op->func_qualname = qualname;
10874 op->func_doc = NULL;
10875#if CYTHON_COMPILING_IN_LIMITED_API
10876 op->func_classobj = NULL;
10878 ((PyCMethodObject*)op)->mm_class = NULL;
10880 op->func_globals = globals;
10881 Py_INCREF(op->func_globals);
10883 op->func_code = code;
10884 op->defaults = NULL;
10885 op->defaults_tuple = NULL;
10886 op->defaults_kwdict = NULL;
10887 op->defaults_getter = NULL;
10888 op->func_annotations = NULL;
10889#if __PYX_LIMITED_VERSION_HEX < 0x030B0000
10890 op->func_is_coroutine = NULL;
10892#if CYTHON_VECTORCALL
10893 switch (ml->ml_flags & (METH_VARARGS | METH_FASTCALL | METH_NOARGS | METH_O | METH_KEYWORDS | METH_METHOD)) {
10895 __Pyx_CyFunction_func_vectorcall(op) = __Pyx_CyFunction_Vectorcall_NOARGS;
10898 __Pyx_CyFunction_func_vectorcall(op) = __Pyx_CyFunction_Vectorcall_O;
10900 case METH_METHOD | METH_FASTCALL | METH_KEYWORDS:
10901 __Pyx_CyFunction_func_vectorcall(op) = __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS_METHOD;
10903 case METH_FASTCALL | METH_KEYWORDS:
10904 __Pyx_CyFunction_func_vectorcall(op) = __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS;
10906 case METH_VARARGS | METH_KEYWORDS:
10907 __Pyx_CyFunction_func_vectorcall(op) = NULL;
10910 PyErr_SetString(PyExc_SystemError,
"Bad call flags for CyFunction");
10917static int __Pyx__CyFunction_clear(__pyx_CyFunctionObject *m)
10919 Py_CLEAR(m->func_closure);
10920#if CYTHON_COMPILING_IN_LIMITED_API
10921 Py_CLEAR(m->func_module);
10923 Py_CLEAR(((PyCFunctionObject*)m)->m_module);
10925#if PY_VERSION_HEX < 0x030C0000 || CYTHON_COMPILING_IN_LIMITED_API
10926 Py_CLEAR(m->func_dict);
10927#elif PY_VERSION_HEX < 0x030d0000
10928 _PyObject_ClearManagedDict((PyObject*)m);
10930 PyObject_ClearManagedDict((PyObject*)m);
10932 Py_CLEAR(m->func_name);
10933 Py_CLEAR(m->func_qualname);
10934 Py_CLEAR(m->func_doc);
10935 Py_CLEAR(m->func_globals);
10936 Py_CLEAR(m->func_code);
10937#if CYTHON_COMPILING_IN_LIMITED_API
10938 Py_CLEAR(m->func_classobj);
10941 PyObject *cls = (PyObject*) ((PyCMethodObject *) (m))->mm_class;
10942 ((PyCMethodObject *) (m))->mm_class = NULL;
10946 Py_CLEAR(m->defaults_tuple);
10947 Py_CLEAR(m->defaults_kwdict);
10948 Py_CLEAR(m->func_annotations);
10949#if __PYX_LIMITED_VERSION_HEX < 0x030B0000
10950 Py_CLEAR(m->func_is_coroutine);
10952 Py_CLEAR(m->defaults);
10956__Pyx_CyFunction_clear(PyObject *m)
10958 return __Pyx__CyFunction_clear(__Pyx_as_CyFunctionObject(m));
10960static void __Pyx__CyFunction_dealloc(PyObject *m)
10962 __pyx_CyFunctionObject *cyfunc = __Pyx_as_CyFunctionObject(m);
10963 if (__Pyx_CyFunction_weakreflist(cyfunc) != NULL)
10964 PyObject_ClearWeakRefs(m);
10965 __Pyx__CyFunction_clear(cyfunc);
10966 __Pyx_PyHeapTypeObject_GC_Del(m);
10968static void __Pyx_CyFunction_dealloc(PyObject *m)
10970 PyObject_GC_UnTrack(m);
10971 __Pyx__CyFunction_dealloc(m);
10973static int __Pyx_CyFunction_traverse(PyObject *m_in, visitproc visit,
void *arg)
10975 __pyx_CyFunctionObject *m = __Pyx_as_CyFunctionObject(m_in);
10977 int e = __Pyx_call_type_traverse(m_in, 1, visit, arg);
10980 Py_VISIT(m->func_closure);
10981#if CYTHON_COMPILING_IN_LIMITED_API
10982 Py_VISIT(m->func_module);
10984 Py_VISIT(((PyCFunctionObject*)m)->m_module);
10986#if PY_VERSION_HEX < 0x030C0000 || CYTHON_COMPILING_IN_LIMITED_API
10987 Py_VISIT(m->func_dict);
10991#if PY_VERSION_HEX < 0x030d0000
10992 _PyObject_VisitManagedDict
10994 PyObject_VisitManagedDict
10996 ((PyObject*)m, visit, arg);
10997 if (e != 0)
return e;
11000 __Pyx_VISIT_CONST(m->func_name);
11001 __Pyx_VISIT_CONST(m->func_qualname);
11002 Py_VISIT(m->func_doc);
11003 Py_VISIT(m->func_globals);
11004 __Pyx_VISIT_CONST(m->func_code);
11005 Py_VISIT(__Pyx__CyFunction_GetClassObj(m));
11006 Py_VISIT(m->defaults_tuple);
11007 Py_VISIT(m->defaults_kwdict);
11008 Py_VISIT(m->func_annotations);
11009#if __PYX_LIMITED_VERSION_HEX < 0x030B0000
11010 Py_VISIT(m->func_is_coroutine);
11012 Py_VISIT(m->defaults);
11016__Pyx_CyFunction_repr(PyObject *op_in)
11018 __pyx_CyFunctionObject *op = __Pyx_as_CyFunctionObject(op_in);
11020 __Pyx_BEGIN_CRITICAL_SECTION(op_in);
11021 repr = PyUnicode_FromFormat(
"<cyfunction %U at %p>",
11022 op->func_qualname, (
void *)op);
11023 __Pyx_END_CRITICAL_SECTION();
11026static PyObject * __Pyx_CyFunction_CallMethod(PyObject *func, PyObject *self, PyObject *arg, PyObject *kw) {
11027#if CYTHON_COMPILING_IN_LIMITED_API
11028 __pyx_CyFunctionObject *cyfunc = __Pyx_as_CyFunctionObject(func);
11029 PyCFunction meth = cyfunc->func_methoddef->ml_meth;
11030 int flags = cyfunc->func_methoddef->ml_flags;
11032 PyCFunctionObject*
f = (PyCFunctionObject*)func;
11033 PyCFunction meth =
f->m_ml->ml_meth;
11034 int flags =
f->m_ml->ml_flags;
11037 switch (flags & (METH_VARARGS | METH_KEYWORDS | METH_NOARGS | METH_O)) {
11039 if (likely(kw == NULL || PyDict_Size(kw) == 0))
11040 return (*meth)(self, arg);
11042 case METH_VARARGS | METH_KEYWORDS:
11043 return (*(PyCFunctionWithKeywords)(
void(*)(
void))meth)(self, arg, kw);
11045 if (likely(kw == NULL || PyDict_Size(kw) == 0)) {
11046#if CYTHON_ASSUME_SAFE_SIZE
11047 size = PyTuple_GET_SIZE(arg);
11049 size = PyTuple_Size(arg);
11050 if (unlikely(size < 0))
return NULL;
11052 if (likely(size == 0))
11053 return (*meth)(self, NULL);
11054 __Pyx_CyFunction_raise_argument_count_error(
11056 "takes no arguments", size);
11061 if (likely(kw == NULL || PyDict_Size(kw) == 0)) {
11062#if CYTHON_ASSUME_SAFE_SIZE
11063 size = PyTuple_GET_SIZE(arg);
11065 size = PyTuple_Size(arg);
11066 if (unlikely(size < 0))
return NULL;
11068 if (likely(size == 1)) {
11069 PyObject *result, *arg0;
11070 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
11071 arg0 = PyTuple_GET_ITEM(arg, 0);
11073 arg0 = __Pyx_PySequence_ITEM(arg, 0);
if (unlikely(!arg0))
return NULL;
11075 result = (*meth)(self, arg0);
11076 #if !(CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS)
11081 __Pyx_CyFunction_raise_argument_count_error(
11083 "takes exactly one argument", size);
11088 PyErr_SetString(PyExc_SystemError,
"Bad call flags for CyFunction");
11091 __Pyx_CyFunction_raise_type_error(
11092 func,
"takes no keyword arguments");
11095static CYTHON_INLINE PyObject *__Pyx_CyFunction_Call(PyObject *func, PyObject *arg, PyObject *kw) {
11097 result = __Pyx_CyFunction_CallMethod(func, func, arg, kw);
11100static PyObject *__Pyx_CyFunction_CallAsMethod(PyObject *func, PyObject *args, PyObject *kw) {
11102 __pyx_CyFunctionObject *cyfunc = __Pyx_as_CyFunctionObject(func);
11103#if CYTHON_VECTORCALL
11104 __pyx_vectorcallfunc vc = __Pyx_CyFunction_func_vectorcall(cyfunc);
11106#if CYTHON_ASSUME_SAFE_MACROS && CYTHON_ASSUME_SAFE_SIZE
11107 return __Pyx_PyVectorcall_FastCallDict(func, vc, &PyTuple_GET_ITEM(args, 0), (
size_t)PyTuple_GET_SIZE(args), kw);
11109 (void) &__Pyx_PyVectorcall_FastCallDict;
11110 return PyVectorcall_Call(func, args, kw);
11114 if ((cyfunc->flags & __Pyx_CYFUNCTION_CCLASS) && !(cyfunc->flags & __Pyx_CYFUNCTION_STATICMETHOD)) {
11116 PyObject *new_args;
11118#if CYTHON_ASSUME_SAFE_SIZE
11119 argc = PyTuple_GET_SIZE(args);
11121 argc = PyTuple_Size(args);
11122 if (unlikely(argc < 0))
return NULL;
11124 new_args = PyTuple_GetSlice(args, 1, argc);
11125 if (unlikely(!new_args))
11127 self = PyTuple_GetItem(args, 0);
11128 if (unlikely(!self)) {
11129 Py_DECREF(new_args);
11130 PyErr_Format(PyExc_TypeError,
11131 "unbound method %.200S() needs an argument",
11132 cyfunc->func_qualname);
11135 result = __Pyx_CyFunction_CallMethod(func, self, new_args, kw);
11136 Py_DECREF(new_args);
11138 result = __Pyx_CyFunction_Call(func, args, kw);
11142#if CYTHON_VECTORCALL
11143static CYTHON_INLINE
int __Pyx_CyFunction_Vectorcall_CheckArgs(PyObject *func, __pyx_CyFunctionObject *cyfunc, Py_ssize_t nargs, PyObject *kwnames)
11146 if ((cyfunc->flags & __Pyx_CYFUNCTION_CCLASS) && !(cyfunc->flags & __Pyx_CYFUNCTION_STATICMETHOD)) {
11147 if (unlikely(nargs < 1)) {
11148 __Pyx_CyFunction_raise_type_error(
11149 func,
"needs an argument");
11154 if (unlikely(kwnames) && unlikely(__Pyx_PyTuple_GET_SIZE(kwnames))) {
11155 __Pyx_CyFunction_raise_type_error(
11156 func,
"takes no keyword arguments");
11161static PyObject * __Pyx_CyFunction_Vectorcall_NOARGS(PyObject *func, PyObject *
const *args,
size_t nargsf, PyObject *kwnames)
11163 __pyx_CyFunctionObject *cyfunc = __Pyx_as_CyFunctionObject(func);
11164 Py_ssize_t nargs = PyVectorcall_NARGS(nargsf);
11166#if CYTHON_COMPILING_IN_LIMITED_API
11167 PyCFunction meth = cyfunc->func_methoddef->ml_meth;
11168 if (unlikely(!meth))
return NULL;
11170 PyCFunction meth = ((PyCFunctionObject*)cyfunc)->m_ml->ml_meth;
11172 switch (__Pyx_CyFunction_Vectorcall_CheckArgs(func, cyfunc, nargs, kwnames)) {
11184 if (unlikely(nargs != 0)) {
11185 __Pyx_CyFunction_raise_argument_count_error(
11186 func,
"takes no arguments", nargs);
11189 return meth(self, NULL);
11191static PyObject * __Pyx_CyFunction_Vectorcall_O(PyObject *func, PyObject *
const *args,
size_t nargsf, PyObject *kwnames)
11193 __pyx_CyFunctionObject *cyfunc = __Pyx_as_CyFunctionObject(func);
11194 Py_ssize_t nargs = PyVectorcall_NARGS(nargsf);
11196#if CYTHON_COMPILING_IN_LIMITED_API
11197 PyCFunction meth = cyfunc->func_methoddef->ml_meth;
11198 if (unlikely(!meth))
return NULL;
11200 PyCFunction meth = ((PyCFunctionObject*)cyfunc)->m_ml->ml_meth;
11202 switch (__Pyx_CyFunction_Vectorcall_CheckArgs(func, cyfunc, nargs, kwnames)) {
11214 if (unlikely(nargs != 1)) {
11215 __Pyx_CyFunction_raise_argument_count_error(
11216 func,
"takes exactly one argument", nargs);
11219 return meth(self, args[0]);
11221static PyObject * __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS(PyObject *func, PyObject *
const *args,
size_t nargsf, PyObject *kwnames)
11223 __pyx_CyFunctionObject *cyfunc = __Pyx_as_CyFunctionObject(func);
11224 Py_ssize_t nargs = PyVectorcall_NARGS(nargsf);
11226#if CYTHON_COMPILING_IN_LIMITED_API
11227 PyCFunction meth = cyfunc->func_methoddef->ml_meth;
11228 if (unlikely(!meth))
return NULL;
11230 PyCFunction meth = ((PyCFunctionObject*)cyfunc)->m_ml->ml_meth;
11232 switch (__Pyx_CyFunction_Vectorcall_CheckArgs(func, cyfunc, nargs, NULL)) {
11244 return ((__Pyx_PyCFunctionFastWithKeywords)(
void(*)(
void))meth)(self, args, nargs, kwnames);
11246static PyObject * __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS_METHOD(PyObject *func, PyObject *
const *args,
size_t nargsf, PyObject *kwnames)
11248 __pyx_CyFunctionObject *cyfunc = __Pyx_as_CyFunctionObject(func);
11249 PyTypeObject *cls = (PyTypeObject *) __Pyx__CyFunction_GetClassObj(cyfunc);
11250 Py_ssize_t nargs = PyVectorcall_NARGS(nargsf);
11252#if CYTHON_COMPILING_IN_LIMITED_API
11253 PyCFunction meth = cyfunc->func_methoddef->ml_meth;
11254 if (unlikely(!meth))
return NULL;
11256 PyCFunction meth = ((PyCFunctionObject*)cyfunc)->m_ml->ml_meth;
11258 switch (__Pyx_CyFunction_Vectorcall_CheckArgs(func, cyfunc, nargs, NULL)) {
11270 #if PY_VERSION_HEX < 0x030e00A6
11271 size_t nargs_value = (size_t) nargs;
11273 Py_ssize_t nargs_value = nargs;
11275 return ((__Pyx_PyCMethod)(
void(*)(
void))meth)(self, cls, args, nargs_value, kwnames);
11278static PyType_Slot __pyx_CyFunctionType_slots[] = {
11279 {Py_tp_dealloc, (
void *)__Pyx_CyFunction_dealloc},
11280 {Py_tp_repr, (
void *)__Pyx_CyFunction_repr},
11281 {Py_tp_call, (
void *)__Pyx_CyFunction_CallAsMethod},
11282 {Py_tp_traverse, (
void *)__Pyx_CyFunction_traverse},
11283 {Py_tp_clear, (
void *)__Pyx_CyFunction_clear},
11284 {Py_tp_methods, (
void *)__pyx_CyFunction_methods},
11285 {Py_tp_members, (
void *)__pyx_CyFunction_members},
11286 {Py_tp_getset, (
void *)__pyx_CyFunction_getsets},
11287 {Py_tp_descr_get, (
void *)__Pyx_PyMethod_New},
11290static PyType_Spec __pyx_CyFunctionType_spec = {
11291 __PYX_TYPE_MODULE_PREFIX
"cython_function_or_method",
11292 __PYX_SHARED_SIZEOF(__pyx_CyFunctionObject),
11294#ifdef Py_TPFLAGS_METHOD_DESCRIPTOR
11295 Py_TPFLAGS_METHOD_DESCRIPTOR |
11297#if CYTHON_VECTORCALL
11298#if defined(Py_TPFLAGS_HAVE_VECTORCALL)
11299 Py_TPFLAGS_HAVE_VECTORCALL |
11300#elif defined(_Py_TPFLAGS_HAVE_VECTORCALL)
11301 _Py_TPFLAGS_HAVE_VECTORCALL |
11304#if PY_VERSION_HEX >= 0x030C0000 && !CYTHON_COMPILING_IN_LIMITED_API
11305 Py_TPFLAGS_MANAGED_DICT |
11307 Py_TPFLAGS_IMMUTABLETYPE | Py_TPFLAGS_DISALLOW_INSTANTIATION |
11308 Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC | Py_TPFLAGS_BASETYPE,
11309 __pyx_CyFunctionType_slots
11311static int __pyx_CyFunction_init(PyObject *module) {
11312 __pyx_mstatetype *mstate = __Pyx_PyModule_GetState(module);
11313 mstate->__pyx_CyFunctionType = __Pyx_FetchCommonTypeFromSpec(
11314 mstate->__pyx_CommonTypesMetaclassType, module, &__pyx_CyFunctionType_spec, NULL);
11315 if (unlikely(mstate->__pyx_CyFunctionType == NULL)) {
11322static PyObject *__Pyx_CyFunction_New(PyMethodDef *ml,
int flags, PyObject* qualname,
11323 PyObject *closure, PyObject *module, PyObject* globals, PyObject* code) {
11324 (void)&__Pyx_Get_CyFunction_Type;
11325 PyObject *op = __Pyx_CyFunction_Init(
11326 PyObject_GC_New(PyObject, __pyx_mstate_global->__pyx_CyFunctionType),
11327 ml, flags, qualname, closure, module, globals, code
11330 PyObject_GC_Track(op);
11334static PyTypeObject *__Pyx_Get_CyFunction_Type(
void) {
11335 PyTypeObject *tp = __pyx_mstate_global->__pyx_CyFunctionType;
11336 Py_INCREF((PyObject*)tp);
11341#if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_TYPE_SLOTS
11342static CYTHON_INLINE PY_UINT64_T __Pyx_get_tp_dict_version(PyObject *obj) {
11343 PyObject *dict = Py_TYPE(obj)->tp_dict;
11344 return likely(dict) ? __PYX_GET_DICT_VERSION(dict) : 0;
11346static CYTHON_INLINE PY_UINT64_T __Pyx_get_object_dict_version(PyObject *obj) {
11347 PyObject **dictptr = NULL;
11348 Py_ssize_t offset = Py_TYPE(obj)->tp_dictoffset;
11350#if CYTHON_COMPILING_IN_CPYTHON
11351 dictptr = (likely(offset > 0)) ? (PyObject **) ((
char *)obj + offset) : _PyObject_GetDictPtr(obj);
11353 dictptr = _PyObject_GetDictPtr(obj);
11356 return (dictptr && *dictptr) ? __PYX_GET_DICT_VERSION(*dictptr) : 0;
11358static CYTHON_INLINE
int __Pyx_object_dict_version_matches(PyObject* obj, PY_UINT64_T tp_dict_version, PY_UINT64_T obj_dict_version) {
11359 PyObject *dict = Py_TYPE(obj)->tp_dict;
11360 if (unlikely(!dict) || unlikely(tp_dict_version != __PYX_GET_DICT_VERSION(dict)))
11362 return obj_dict_version == __Pyx_get_object_dict_version(obj);
11367#if CYTHON_CLINE_IN_TRACEBACK && CYTHON_CLINE_IN_TRACEBACK_RUNTIME
11368#if CYTHON_COMPILING_IN_LIMITED_API && __PYX_LIMITED_VERSION_HEX < 0x030A0000
11369#define __Pyx_PyProbablyModule_GetDict(o) __Pyx_XNewRef(PyModule_GetDict(o))
11370#elif !CYTHON_COMPILING_IN_CPYTHON || CYTHON_COMPILING_IN_CPYTHON_FREETHREADING
11371#define __Pyx_PyProbablyModule_GetDict(o) PyObject_GenericGetDict(o, NULL);
11373PyObject* __Pyx_PyProbablyModule_GetDict(PyObject *o) {
11374 PyObject **dict_ptr = _PyObject_GetDictPtr(o);
11375 return dict_ptr ? __Pyx_XNewRef(*dict_ptr) : NULL;
11378static int __Pyx_CLineForTraceback(PyThreadState *tstate,
int c_line) {
11379 PyObject *use_cline = NULL;
11380 PyObject *ptype, *pvalue, *ptraceback;
11381 PyObject *cython_runtime_dict;
11382 CYTHON_MAYBE_UNUSED_VAR(tstate);
11383 if (unlikely(!__pyx_mstate_global->__pyx_cython_runtime)) {
11386 __Pyx_ErrFetchInState(tstate, &ptype, &pvalue, &ptraceback);
11387 cython_runtime_dict = __Pyx_PyProbablyModule_GetDict(__pyx_mstate_global->__pyx_cython_runtime);
11388 if (likely(cython_runtime_dict)) {
11389 __PYX_PY_DICT_LOOKUP_IF_MODIFIED(
11390 use_cline, cython_runtime_dict,
11391 __Pyx_PyDict_SetDefault(cython_runtime_dict, __pyx_mstate_global->__pyx_n_u_cline_in_traceback, Py_False))
11393 if (use_cline == NULL || use_cline == Py_False || (use_cline != Py_True && PyObject_Not(use_cline) != 0)) {
11396 Py_XDECREF(use_cline);
11397 Py_XDECREF(cython_runtime_dict);
11398 __Pyx_ErrRestoreInState(tstate, ptype, pvalue, ptraceback);
11404static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries,
int count,
int code_line) {
11405 int start = 0, mid = 0, end = count - 1;
11406 if (end >= 0 && code_line > entries[end].code_line) {
11409 while (start < end) {
11410 mid = start + (end - start) / 2;
11411 if (code_line < entries[mid].code_line) {
11413 }
else if (code_line > entries[mid].code_line) {
11419 if (code_line <= entries[mid].code_line) {
11425static __Pyx_CachedCodeObjectType *__pyx__find_code_object(
struct __Pyx_CodeObjectCache *code_cache,
int code_line) {
11426 __Pyx_CachedCodeObjectType* code_object;
11428 if (unlikely(!code_line) || unlikely(!code_cache->entries)) {
11431 pos = __pyx_bisect_code_objects(code_cache->entries, code_cache->count, code_line);
11432 if (unlikely(pos >= code_cache->count) || unlikely(code_cache->entries[pos].code_line != code_line)) {
11435 code_object = code_cache->entries[pos].code_object;
11436 Py_INCREF(code_object);
11437 return code_object;
11439static __Pyx_CachedCodeObjectType *__pyx_find_code_object(
int code_line) {
11440#if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING && !CYTHON_ATOMICS
11441 (void)__pyx__find_code_object;
11444 struct __Pyx_CodeObjectCache *code_cache = &__pyx_mstate_global->__pyx_code_cache;
11445#if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING
11446 __pyx_nonatomic_int_type old_count = __pyx_atomic_incr_acq_rel(&code_cache->accessor_count);
11447 if (old_count < 0) {
11448 __pyx_atomic_decr_acq_rel(&code_cache->accessor_count);
11452 __Pyx_CachedCodeObjectType *result = __pyx__find_code_object(code_cache, code_line);
11453#if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING
11454 __pyx_atomic_decr_acq_rel(&code_cache->accessor_count);
11459static void __pyx__insert_code_object(
struct __Pyx_CodeObjectCache *code_cache,
int code_line, __Pyx_CachedCodeObjectType* code_object)
11462 __Pyx_CodeObjectCacheEntry* entries = code_cache->entries;
11463 if (unlikely(!code_line)) {
11466 if (unlikely(!entries)) {
11467 entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Malloc(64*
sizeof(__Pyx_CodeObjectCacheEntry));
11468 if (likely(entries)) {
11469 code_cache->entries = entries;
11470 code_cache->max_count = 64;
11471 code_cache->count = 1;
11472 entries[0].code_line = code_line;
11473 entries[0].code_object = code_object;
11474 Py_INCREF(code_object);
11478 pos = __pyx_bisect_code_objects(code_cache->entries, code_cache->count, code_line);
11479 if ((pos < code_cache->count) && unlikely(code_cache->entries[pos].code_line == code_line)) {
11480 __Pyx_CachedCodeObjectType* tmp = entries[pos].code_object;
11481 entries[pos].code_object = code_object;
11482 Py_INCREF(code_object);
11486 if (code_cache->count == code_cache->max_count) {
11487 int new_max = code_cache->max_count + 64;
11488 entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Realloc(
11489 code_cache->entries, ((
size_t)new_max) *
sizeof(__Pyx_CodeObjectCacheEntry));
11490 if (unlikely(!entries)) {
11493 code_cache->entries = entries;
11494 code_cache->max_count = new_max;
11496 for (i=code_cache->count; i>pos; i--) {
11497 entries[i] = entries[i-1];
11499 entries[pos].code_line = code_line;
11500 entries[pos].code_object = code_object;
11501 code_cache->count++;
11502 Py_INCREF(code_object);
11504static void __pyx_insert_code_object(
int code_line, __Pyx_CachedCodeObjectType* code_object) {
11505#if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING && !CYTHON_ATOMICS
11506 (void)__pyx__insert_code_object;
11509 struct __Pyx_CodeObjectCache *code_cache = &__pyx_mstate_global->__pyx_code_cache;
11510#if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING
11511 __pyx_nonatomic_int_type expected = 0;
11512 if (!__pyx_atomic_int_cmp_exchange(&code_cache->accessor_count, &expected, INT_MIN)) {
11516 __pyx__insert_code_object(code_cache, code_line, code_object);
11517#if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING
11518 __pyx_atomic_sub(&code_cache->accessor_count, INT_MIN);
11524#include "compile.h"
11525#include "frameobject.h"
11526#include "traceback.h"
11527#if PY_VERSION_HEX >= 0x030b00a6 && !CYTHON_COMPILING_IN_LIMITED_API && !defined(PYPY_VERSION)
11528 #ifndef Py_BUILD_CORE
11529 #define Py_BUILD_CORE 1
11531 #include "internal/pycore_frame.h"
11533#if CYTHON_COMPILING_IN_LIMITED_API
11534static PyObject *__Pyx_PyCode_Replace_For_AddTraceback(PyObject *code, PyObject *scratch_dict,
11535 PyObject *firstlineno, PyObject *name) {
11536 PyObject *replace = NULL;
11537 if (unlikely(PyDict_SetItemString(scratch_dict,
"co_firstlineno", firstlineno)))
return NULL;
11538 if (unlikely(PyDict_SetItemString(scratch_dict,
"co_name", name)))
return NULL;
11539 replace = PyObject_GetAttrString(code,
"replace");
11540 if (likely(replace)) {
11541 PyObject *result = PyObject_Call(replace, __pyx_mstate_global->__pyx_empty_tuple, scratch_dict);
11542 Py_DECREF(replace);
11547static void __Pyx_AddTraceback(
const char *funcname,
int c_line,
11548 int py_line,
const char *filename) {
11549 PyObject *code_object = NULL, *py_py_line = NULL, *py_funcname = NULL, *dict = NULL;
11550 PyObject *replace = NULL, *getframe = NULL, *frame = NULL;
11551 PyObject *exc_type, *exc_value, *exc_traceback;
11554 c_line = __Pyx_CLineForTraceback(__Pyx_PyThreadState_Current, c_line);
11556 __Pyx_PyErr_FetchException(&exc_type, &exc_value, &exc_traceback);
11557 code_object = __pyx_find_code_object(c_line ? -c_line : py_line);
11558 if (!code_object) {
11559 code_object = Py_CompileString(
"_getframe()", filename, Py_eval_input);
11560 if (unlikely(!code_object))
goto bad;
11561 py_py_line = PyLong_FromLong(py_line);
11562 if (unlikely(!py_py_line))
goto bad;
11564 py_funcname = PyUnicode_FromFormat(
"%s (%s:%d)", funcname, __pyx_cfilenm, c_line);
11566 py_funcname = PyUnicode_FromString(funcname);
11568 if (unlikely(!py_funcname))
goto bad;
11569 dict = PyDict_New();
11570 if (unlikely(!dict))
goto bad;
11572 PyObject *old_code_object = code_object;
11573 code_object = __Pyx_PyCode_Replace_For_AddTraceback(code_object, dict, py_py_line, py_funcname);
11574 Py_DECREF(old_code_object);
11576 if (unlikely(!code_object))
goto bad;
11577 __pyx_insert_code_object(c_line ? -c_line : py_line, code_object);
11579 dict = PyDict_New();
11581 getframe = PySys_GetObject(
"_getframe");
11582 if (unlikely(!getframe))
goto bad;
11583 if (unlikely(PyDict_SetItemString(dict,
"_getframe", getframe)))
goto bad;
11584 frame = PyEval_EvalCode(code_object, dict, dict);
11585 if (unlikely(!frame) || frame == Py_None)
goto bad;
11588 __Pyx_PyErr_RestoreException(exc_type, exc_value, exc_traceback);
11589 Py_XDECREF(code_object);
11590 Py_XDECREF(py_py_line);
11591 Py_XDECREF(py_funcname);
11593 Py_XDECREF(replace);
11596 (
struct _frame*)frame);
11601static PyCodeObject* __Pyx_CreateCodeObjectForTraceback(
11602 const char *funcname,
int c_line,
11603 int py_line,
const char *filename) {
11604 PyCodeObject *py_code = NULL;
11605 PyObject *py_funcname = NULL;
11607 py_funcname = PyUnicode_FromFormat(
"%s (%s:%d)", funcname, __pyx_cfilenm, c_line);
11608 if (!py_funcname)
goto bad;
11609 funcname = PyUnicode_AsUTF8(py_funcname);
11610 if (!funcname)
goto bad;
11612 py_code = PyCode_NewEmpty(filename, funcname, py_line);
11613 Py_XDECREF(py_funcname);
11616 Py_XDECREF(py_funcname);
11619static void __Pyx_AddTraceback(
const char *funcname,
int c_line,
11620 int py_line,
const char *filename) {
11621 PyCodeObject *py_code = 0;
11622 PyFrameObject *py_frame = 0;
11623 PyThreadState *tstate = __Pyx_PyThreadState_Current;
11624 PyObject *ptype, *pvalue, *ptraceback;
11626 c_line = __Pyx_CLineForTraceback(tstate, c_line);
11628 py_code = __pyx_find_code_object(c_line ? -c_line : py_line);
11630 __Pyx_ErrFetchInState(tstate, &ptype, &pvalue, &ptraceback);
11631 py_code = __Pyx_CreateCodeObjectForTraceback(
11632 funcname, c_line, py_line, filename);
11637 Py_XDECREF(pvalue);
11638 Py_XDECREF(ptraceback);
11641 __Pyx_ErrRestoreInState(tstate, ptype, pvalue, ptraceback);
11642 __pyx_insert_code_object(c_line ? -c_line : py_line, py_code);
11644 py_frame = PyFrame_New(
11647 __pyx_mstate_global->__pyx_d,
11650 if (!py_frame)
goto bad;
11651 __Pyx_PyFrame_SetLineNumber(py_frame, py_line);
11652 PyTraceBack_Here(py_frame);
11654 Py_XDECREF(py_code);
11655 Py_XDECREF(py_frame);
11660#define __PYX_VERIFY_RETURN_INT(target_type, func_type, func_value)\
11661 __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 0)
11662#define __PYX_VERIFY_RETURN_INT_EXC(target_type, func_type, func_value)\
11663 __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 1)
11664#define __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, exc)\
11666 func_type value = func_value;\
11667 if (sizeof(target_type) < sizeof(func_type)) {\
11668 if (unlikely(value != (func_type) (target_type) value)) {\
11669 func_type zero = 0;\
11670 if (exc && unlikely(value == (func_type)-1 && PyErr_Occurred()))\
11671 return (target_type) -1;\
11672 if (is_unsigned && unlikely(value < zero))\
11673 goto raise_neg_overflow;\
11675 goto raise_overflow;\
11678 return (target_type) value;\
11682#if CYTHON_CCOMPLEX && (1) && (!0 || __cplusplus)
11684 static CYTHON_INLINE __pyx_t_float_complex __pyx_t_float_complex_from_parts(
float x,
float y) {
11685 return ::std::complex< float >(x, y);
11688 static CYTHON_INLINE __pyx_t_float_complex __pyx_t_float_complex_from_parts(
float x,
float y) {
11689 return x + y*(__pyx_t_float_complex)_Complex_I;
11693 static CYTHON_INLINE __pyx_t_float_complex __pyx_t_float_complex_from_parts(
float x,
float y) {
11694 __pyx_t_float_complex
z;
11702#if CYTHON_CCOMPLEX && (1) && (!0 || __cplusplus)
11704 static CYTHON_INLINE
int __Pyx_c_eq_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
11705 return (a.real == b.real) && (a.imag == b.imag);
11707 static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_sum_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
11708 __pyx_t_float_complex
z;
11709 z.real = a.real + b.real;
11710 z.imag = a.imag + b.imag;
11713 static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_diff_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
11714 __pyx_t_float_complex
z;
11715 z.real = a.real - b.real;
11716 z.imag = a.imag - b.imag;
11719 static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_prod_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
11720 __pyx_t_float_complex
z;
11721 z.real = a.real * b.real - a.imag * b.imag;
11722 z.imag = a.real * b.imag + a.imag * b.real;
11726 static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_quot_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
11728 return __pyx_t_float_complex_from_parts(a.real / b.real, a.imag / b.real);
11729 }
else if (fabsf(b.real) >= fabsf(b.imag)) {
11730 if (b.real == 0 && b.imag == 0) {
11731 return __pyx_t_float_complex_from_parts(a.real / b.real, a.imag / b.imag);
11733 float r = b.imag / b.real;
11734 float s = (float)(1.0) / (b.real + b.imag *
r);
11735 return __pyx_t_float_complex_from_parts(
11736 (a.real + a.imag *
r) *
s, (a.imag - a.real *
r) *
s);
11739 float r = b.real / b.imag;
11740 float s = (float)(1.0) / (b.imag + b.real *
r);
11741 return __pyx_t_float_complex_from_parts(
11742 (a.real *
r + a.imag) *
s, (a.imag *
r - a.real) *
s);
11746 static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_quot_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
11748 return __pyx_t_float_complex_from_parts(a.real / b.real, a.imag / b.real);
11750 float denom = b.real * b.real + b.imag * b.imag;
11751 return __pyx_t_float_complex_from_parts(
11752 (a.real * b.real + a.imag * b.imag) / denom,
11753 (a.imag * b.real - a.real * b.imag) / denom);
11757 static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_neg_float(__pyx_t_float_complex a) {
11758 __pyx_t_float_complex
z;
11763 static CYTHON_INLINE
int __Pyx_c_is_zero_float(__pyx_t_float_complex a) {
11764 return (a.real == 0) && (a.imag == 0);
11766 static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_conj_float(__pyx_t_float_complex a) {
11767 __pyx_t_float_complex
z;
11773 static CYTHON_INLINE
float __Pyx_c_abs_float(__pyx_t_float_complex
z) {
11774 #if !defined(HAVE_HYPOT) || defined(_MSC_VER)
11775 return sqrtf(
z.real*
z.real +
z.imag*
z.imag);
11777 return hypotf(
z.real,
z.imag);
11780 static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_pow_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
11781 __pyx_t_float_complex
z;
11782 float r, lnr, theta, z_r, z_theta;
11783 if (b.imag == 0 && b.real == (
int)b.real) {
11785 float denom = a.real * a.real + a.imag * a.imag;
11786 a.real = a.real / denom;
11787 a.imag = -a.imag / denom;
11790 switch ((
int)b.real) {
11798 return __Pyx_c_prod_float(a, a);
11800 z = __Pyx_c_prod_float(a, a);
11801 return __Pyx_c_prod_float(
z, a);
11803 z = __Pyx_c_prod_float(a, a);
11804 return __Pyx_c_prod_float(
z,
z);
11810 }
else if ((b.imag == 0) && (a.real >= 0)) {
11811 z.real = powf(a.real, b.real);
11814 }
else if (a.real > 0) {
11819 theta = atan2f(0.0, -1.0);
11822 r = __Pyx_c_abs_float(a);
11823 theta = atan2f(a.imag, a.real);
11826 z_r = expf(lnr * b.real - theta * b.imag);
11827 z_theta = theta * b.real + lnr * b.imag;
11828 z.real = z_r * cosf(z_theta);
11829 z.imag = z_r * sinf(z_theta);
11836#if CYTHON_CCOMPLEX && (1) && (!0 || __cplusplus)
11838 static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(
double x,
double y) {
11839 return ::std::complex< double >(x, y);
11842 static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(
double x,
double y) {
11843 return x + y*(__pyx_t_double_complex)_Complex_I;
11847 static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(
double x,
double y) {
11848 __pyx_t_double_complex
z;
11856#if CYTHON_CCOMPLEX && (1) && (!0 || __cplusplus)
11858 static CYTHON_INLINE
int __Pyx_c_eq_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
11859 return (a.real == b.real) && (a.imag == b.imag);
11861 static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_sum_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
11862 __pyx_t_double_complex
z;
11863 z.real = a.real + b.real;
11864 z.imag = a.imag + b.imag;
11867 static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_diff_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
11868 __pyx_t_double_complex
z;
11869 z.real = a.real - b.real;
11870 z.imag = a.imag - b.imag;
11873 static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_prod_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
11874 __pyx_t_double_complex
z;
11875 z.real = a.real * b.real - a.imag * b.imag;
11876 z.imag = a.real * b.imag + a.imag * b.real;
11880 static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_quot_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
11882 return __pyx_t_double_complex_from_parts(a.real / b.real, a.imag / b.real);
11883 }
else if (fabs(b.real) >= fabs(b.imag)) {
11884 if (b.real == 0 && b.imag == 0) {
11885 return __pyx_t_double_complex_from_parts(a.real / b.real, a.imag / b.imag);
11887 double r = b.imag / b.real;
11888 double s = (double)(1.0) / (b.real + b.imag *
r);
11889 return __pyx_t_double_complex_from_parts(
11890 (a.real + a.imag *
r) *
s, (a.imag - a.real *
r) *
s);
11893 double r = b.real / b.imag;
11894 double s = (double)(1.0) / (b.imag + b.real *
r);
11895 return __pyx_t_double_complex_from_parts(
11896 (a.real *
r + a.imag) *
s, (a.imag *
r - a.real) *
s);
11900 static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_quot_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
11902 return __pyx_t_double_complex_from_parts(a.real / b.real, a.imag / b.real);
11904 double denom = b.real * b.real + b.imag * b.imag;
11905 return __pyx_t_double_complex_from_parts(
11906 (a.real * b.real + a.imag * b.imag) / denom,
11907 (a.imag * b.real - a.real * b.imag) / denom);
11911 static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_neg_double(__pyx_t_double_complex a) {
11912 __pyx_t_double_complex
z;
11917 static CYTHON_INLINE
int __Pyx_c_is_zero_double(__pyx_t_double_complex a) {
11918 return (a.real == 0) && (a.imag == 0);
11920 static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_conj_double(__pyx_t_double_complex a) {
11921 __pyx_t_double_complex
z;
11927 static CYTHON_INLINE
double __Pyx_c_abs_double(__pyx_t_double_complex
z) {
11928 #if !defined(HAVE_HYPOT) || defined(_MSC_VER)
11929 return sqrt(
z.real*
z.real +
z.imag*
z.imag);
11931 return hypot(
z.real,
z.imag);
11934 static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_pow_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
11935 __pyx_t_double_complex
z;
11936 double r, lnr, theta, z_r, z_theta;
11937 if (b.imag == 0 && b.real == (
int)b.real) {
11939 double denom = a.real * a.real + a.imag * a.imag;
11940 a.real = a.real / denom;
11941 a.imag = -a.imag / denom;
11944 switch ((
int)b.real) {
11952 return __Pyx_c_prod_double(a, a);
11954 z = __Pyx_c_prod_double(a, a);
11955 return __Pyx_c_prod_double(
z, a);
11957 z = __Pyx_c_prod_double(a, a);
11958 return __Pyx_c_prod_double(
z,
z);
11964 }
else if ((b.imag == 0) && (a.real >= 0)) {
11965 z.real = pow(a.real, b.real);
11968 }
else if (a.real > 0) {
11973 theta = atan2(0.0, -1.0);
11976 r = __Pyx_c_abs_double(a);
11977 theta = atan2(a.imag, a.real);
11980 z_r = exp(lnr * b.real - theta * b.imag);
11981 z_theta = theta * b.real + lnr * b.imag;
11982 z.real = z_r * cos(z_theta);
11983 z.imag = z_r * sin(z_theta);
11990#if CYTHON_CCOMPLEX && (1) && (!0 || __cplusplus)
11992 static CYTHON_INLINE __pyx_t_long_double_complex __pyx_t_long_double_complex_from_parts(
long double x,
long double y) {
11993 return ::std::complex< long double >(x, y);
11996 static CYTHON_INLINE __pyx_t_long_double_complex __pyx_t_long_double_complex_from_parts(
long double x,
long double y) {
11997 return x + y*(__pyx_t_long_double_complex)_Complex_I;
12001 static CYTHON_INLINE __pyx_t_long_double_complex __pyx_t_long_double_complex_from_parts(
long double x,
long double y) {
12002 __pyx_t_long_double_complex
z;
12010#if CYTHON_CCOMPLEX && (1) && (!0 || __cplusplus)
12012 static CYTHON_INLINE
int __Pyx_c_eq_long__double(__pyx_t_long_double_complex a, __pyx_t_long_double_complex b) {
12013 return (a.real == b.real) && (a.imag == b.imag);
12015 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) {
12016 __pyx_t_long_double_complex
z;
12017 z.real = a.real + b.real;
12018 z.imag = a.imag + b.imag;
12021 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) {
12022 __pyx_t_long_double_complex
z;
12023 z.real = a.real - b.real;
12024 z.imag = a.imag - b.imag;
12027 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) {
12028 __pyx_t_long_double_complex
z;
12029 z.real = a.real * b.real - a.imag * b.imag;
12030 z.imag = a.real * b.imag + a.imag * b.real;
12034 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) {
12036 return __pyx_t_long_double_complex_from_parts(a.real / b.real, a.imag / b.real);
12037 }
else if (fabsl(b.real) >= fabsl(b.imag)) {
12038 if (b.real == 0 && b.imag == 0) {
12039 return __pyx_t_long_double_complex_from_parts(a.real / b.real, a.imag / b.imag);
12041 long double r = b.imag / b.real;
12042 long double s = (
long double)(1.0) / (b.real + b.imag *
r);
12043 return __pyx_t_long_double_complex_from_parts(
12044 (a.real + a.imag *
r) *
s, (a.imag - a.real *
r) *
s);
12047 long double r = b.real / b.imag;
12048 long double s = (
long double)(1.0) / (b.imag + b.real *
r);
12049 return __pyx_t_long_double_complex_from_parts(
12050 (a.real *
r + a.imag) *
s, (a.imag *
r - a.real) *
s);
12054 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) {
12056 return __pyx_t_long_double_complex_from_parts(a.real / b.real, a.imag / b.real);
12058 long double denom = b.real * b.real + b.imag * b.imag;
12059 return __pyx_t_long_double_complex_from_parts(
12060 (a.real * b.real + a.imag * b.imag) / denom,
12061 (a.imag * b.real - a.real * b.imag) / denom);
12065 static CYTHON_INLINE __pyx_t_long_double_complex __Pyx_c_neg_long__double(__pyx_t_long_double_complex a) {
12066 __pyx_t_long_double_complex
z;
12071 static CYTHON_INLINE
int __Pyx_c_is_zero_long__double(__pyx_t_long_double_complex a) {
12072 return (a.real == 0) && (a.imag == 0);
12074 static CYTHON_INLINE __pyx_t_long_double_complex __Pyx_c_conj_long__double(__pyx_t_long_double_complex a) {
12075 __pyx_t_long_double_complex
z;
12081 static CYTHON_INLINE
long double __Pyx_c_abs_long__double(__pyx_t_long_double_complex
z) {
12082 #if !defined(HAVE_HYPOT) || defined(_MSC_VER)
12083 return sqrtl(
z.real*
z.real +
z.imag*
z.imag);
12085 return hypotl(
z.real,
z.imag);
12088 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) {
12089 __pyx_t_long_double_complex
z;
12090 long double r, lnr, theta, z_r, z_theta;
12091 if (b.imag == 0 && b.real == (
int)b.real) {
12093 long double denom = a.real * a.real + a.imag * a.imag;
12094 a.real = a.real / denom;
12095 a.imag = -a.imag / denom;
12098 switch ((
int)b.real) {
12106 return __Pyx_c_prod_long__double(a, a);
12108 z = __Pyx_c_prod_long__double(a, a);
12109 return __Pyx_c_prod_long__double(
z, a);
12111 z = __Pyx_c_prod_long__double(a, a);
12112 return __Pyx_c_prod_long__double(
z,
z);
12118 }
else if ((b.imag == 0) && (a.real >= 0)) {
12119 z.real = powl(a.real, b.real);
12122 }
else if (a.real > 0) {
12127 theta = atan2l(0.0, -1.0);
12130 r = __Pyx_c_abs_long__double(a);
12131 theta = atan2l(a.imag, a.real);
12134 z_r = expl(lnr * b.real - theta * b.imag);
12135 z_theta = theta * b.real + lnr * b.imag;
12136 z.real = z_r * cosl(z_theta);
12137 z.imag = z_r * sinl(z_theta);
12144static char __Pyx_LargePyLong___Pyx_PyLong_As_char(PyObject *x);
12145static char __Pyx_raise_neg_overflow___Pyx_PyLong_As_char(
void) {
12146 const char* type_name =
"char";
12147 PyErr_Format(PyExc_OverflowError,
12148 "can't convert negative value to %.200s", type_name);
12151static char __Pyx_raise_overflow___Pyx_PyLong_As_char(
void) {
12152 const char* type_name =
"char";
12153 PyErr_Format(PyExc_OverflowError,
12154 "value too large to convert to %.200s", type_name);
12157static CYTHON_INLINE
char __Pyx_PyULong___Pyx_PyLong_As_char(PyObject *x) {
12158 const int is_unsigned = 1;
12159#if CYTHON_USE_PYLONG_INTERNALS
12161 const digit* digits = __Pyx_PyLong_Digits(x);
12162 const Py_ssize_t size = __Pyx_PyLong_DigitCount(x);
12163 if (size == 2 && (8 *
sizeof(
char) > 1 * PyLong_SHIFT)) {
12164 if ((8 *
sizeof(
unsigned long) > 2 * PyLong_SHIFT)) {
12165 __PYX_VERIFY_RETURN_INT(
char,
unsigned long, (((((
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
12166 }
else if ((8 *
sizeof(
char) >= 2 * PyLong_SHIFT)) {
12167 return (
char) (((((char)digits[1]) << PyLong_SHIFT) | (char)digits[0]));
12170 if (size == 3 && (8 *
sizeof(
char) > 2 * PyLong_SHIFT)) {
12171 if ((8 *
sizeof(
unsigned long) > 3 * PyLong_SHIFT)) {
12172 __PYX_VERIFY_RETURN_INT(
char,
unsigned long, (((((((
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
12173 }
else if ((8 *
sizeof(
char) >= 3 * PyLong_SHIFT)) {
12174 return (
char) (((((((char)digits[2]) << PyLong_SHIFT) | (char)digits[1]) << PyLong_SHIFT) | (char)digits[0]));
12177 if (size == 4 && (8 *
sizeof(
char) > 3 * PyLong_SHIFT)) {
12178 if ((8 *
sizeof(
unsigned long) > 4 * PyLong_SHIFT)) {
12179 __PYX_VERIFY_RETURN_INT(
char,
unsigned long, (((((((((
unsigned long)digits[3]) << PyLong_SHIFT) | (
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
12180 }
else if ((8 *
sizeof(
char) >= 4 * PyLong_SHIFT)) {
12181 return (
char) (((((((((char)digits[3]) << PyLong_SHIFT) | (char)digits[2]) << PyLong_SHIFT) | (char)digits[1]) << PyLong_SHIFT) | (char)digits[0]));
12186#elif CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030C00A7
12187 if (unlikely(Py_SIZE(x) < 0)) {
12188 goto raise_neg_overflow;
12192 int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
12193 if (unlikely(result < 0))
12195 if (unlikely(result == 1))
12196 goto raise_neg_overflow;
12199 if ((
sizeof(
char) <=
sizeof(
unsigned long))) {
12200 __PYX_VERIFY_RETURN_INT_EXC(
char,
unsigned long, PyLong_AsUnsignedLong(x))
12201 }
else if ((
sizeof(
char) <=
sizeof(
unsigned PY_LONG_LONG))) {
12202 __PYX_VERIFY_RETURN_INT_EXC(
char,
unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
12204 return __Pyx_LargePyLong___Pyx_PyLong_As_char(x);
12206 return __Pyx_raise_neg_overflow___Pyx_PyLong_As_char();
12208 return __Pyx_raise_overflow___Pyx_PyLong_As_char();
12210static CYTHON_INLINE
char __Pyx_PySLong___Pyx_PyLong_As_char(PyObject *x) {
12211 const int is_unsigned = 0;
12212#if CYTHON_USE_PYLONG_INTERNALS
12213 if (__Pyx_PyLong_IsNeg(x)) {
12214 const Py_ssize_t size = __Pyx_PyLong_DigitCount(x);
12215 const digit* digits = __Pyx_PyLong_Digits(x);
12216 if (size == 2 && (8 *
sizeof(
char) > 1 * PyLong_SHIFT)) {
12217 if ((8 *
sizeof(
long) > 2 * PyLong_SHIFT)) {
12218 long ival = - (long) (((((
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0]));
12219 __PYX_VERIFY_RETURN_INT(
char,
long, ival)
12220 }
else if ((8 *
sizeof(
char) - 1 > 2 * PyLong_SHIFT)) {
12221 return (
char) (((char) -1) * (((((char)digits[1]) << PyLong_SHIFT) | (char)digits[0])));
12224 if (size == 3 && (8 *
sizeof(
char) > 2 * PyLong_SHIFT)) {
12225 if ((8 *
sizeof(
long) > 3 * PyLong_SHIFT)) {
12226 long ival = - (long) (((((((
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0]));
12227 __PYX_VERIFY_RETURN_INT(
char,
long, ival)
12228 }
else if ((8 *
sizeof(
char) - 1 > 3 * PyLong_SHIFT)) {
12229 return (
char) (((char) -1) * (((((((char)digits[2]) << PyLong_SHIFT) | (char)digits[1]) << PyLong_SHIFT) | (char)digits[0])));
12232 if (size == 4 && (8 *
sizeof(
char) > 3 * PyLong_SHIFT)) {
12233 if ((8 *
sizeof(
long) > 4 * PyLong_SHIFT)) {
12234 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]));
12235 __PYX_VERIFY_RETURN_INT(
char,
long, ival)
12236 }
else if ((8 *
sizeof(
char) - 1 > 4 * PyLong_SHIFT)) {
12237 return (
char) (((char) -1) * (((((((((char)digits[3]) << PyLong_SHIFT) | (char)digits[2]) << PyLong_SHIFT) | (char)digits[1]) << PyLong_SHIFT) | (char)digits[0])));
12242 const Py_ssize_t size = __Pyx_PyLong_DigitCount(x);
12243 const digit* digits = __Pyx_PyLong_Digits(x);
12244 if (size == 2 && (8 *
sizeof(
char) > 1 * PyLong_SHIFT)) {
12245 if ((8 *
sizeof(
long) > 2 * PyLong_SHIFT)) {
12246 __PYX_VERIFY_RETURN_INT(
char,
unsigned long, (((((
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
12247 }
else if ((8 *
sizeof(
char) - 1 > 2 * PyLong_SHIFT)) {
12248 return (
char) (((((char)digits[1]) << PyLong_SHIFT) | (char)digits[0]));
12251 if (size == 3 && (8 *
sizeof(
char) > 2 * PyLong_SHIFT)) {
12252 if ((8 *
sizeof(
long) > 3 * PyLong_SHIFT)) {
12253 __PYX_VERIFY_RETURN_INT(
char,
unsigned long, (((((((
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
12254 }
else if ((8 *
sizeof(
char) - 1 > 3 * PyLong_SHIFT)) {
12255 return (
char) (((((((char)digits[2]) << PyLong_SHIFT) | (char)digits[1]) << PyLong_SHIFT) | (char)digits[0]));
12258 if (size == 4 && (8 *
sizeof(
char) > 3 * PyLong_SHIFT)) {
12259 if ((8 *
sizeof(
long) > 4 * PyLong_SHIFT)) {
12260 __PYX_VERIFY_RETURN_INT(
char,
unsigned long, (((((((((
unsigned long)digits[3]) << PyLong_SHIFT) | (
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
12261 }
else if ((8 *
sizeof(
char) - 1 > 4 * PyLong_SHIFT)) {
12262 return (
char) (((((((((char)digits[3]) << PyLong_SHIFT) | (char)digits[2]) << PyLong_SHIFT) | (char)digits[1]) << PyLong_SHIFT) | (char)digits[0]));
12268 #if __PYX_LIMITED_VERSION_HEX >= 0x030d0000
12269 if ((
sizeof(
char) <=
sizeof(
int)) && (
sizeof(
int) <
sizeof(
long))) {
12270 __PYX_VERIFY_RETURN_INT_EXC(
char,
int, PyLong_AsInt(x))
12273 if ((
sizeof(
char) <=
sizeof(
long))) {
12274 __PYX_VERIFY_RETURN_INT_EXC(
char,
long, PyLong_AsLong(x))
12275 }
else if ((
sizeof(
char) <=
sizeof(PY_LONG_LONG))) {
12276 __PYX_VERIFY_RETURN_INT_EXC(
char, PY_LONG_LONG, PyLong_AsLongLong(x))
12278 return __Pyx_LargePyLong___Pyx_PyLong_As_char(x);
12280 return __Pyx_raise_neg_overflow___Pyx_PyLong_As_char();
12282 return __Pyx_raise_overflow___Pyx_PyLong_As_char();
12284static char __Pyx_LargePyLong___Pyx_PyLong_As_char(PyObject *x) {
12285#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
12286#pragma GCC diagnostic push
12287#pragma GCC diagnostic ignored "-Wconversion"
12289 const char neg_one = (char) -1, const_zero = (
char) 0;
12290#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
12291#pragma GCC diagnostic pop
12293 const int is_unsigned = neg_one > const_zero;
12296#if PY_VERSION_HEX >= 0x030d00A6 && !CYTHON_COMPILING_IN_LIMITED_API
12297 Py_ssize_t bytes_copied = PyLong_AsNativeBytes(
12298 x, &val,
sizeof(val), Py_ASNATIVEBYTES_NATIVE_ENDIAN | (is_unsigned ? Py_ASNATIVEBYTES_UNSIGNED_BUFFER | Py_ASNATIVEBYTES_REJECT_NEGATIVE : 0));
12299 if (unlikely(bytes_copied == -1)) {
12300 }
else if (unlikely(bytes_copied > (Py_ssize_t)
sizeof(val))) {
12301 goto raise_overflow;
12305#elif PY_VERSION_HEX < 0x030d0000 && !(CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API) || defined(_PyLong_AsByteArray)
12306 int one = 1;
int is_little = (int)*(
unsigned char *)&one;
12307 unsigned char *bytes = (
unsigned char *)&val;
12308 ret = _PyLong_AsByteArray((PyLongObject *)x,
12309 bytes,
sizeof(val),
12310 is_little, !is_unsigned);
12311 if ((0))
goto raise_overflow;
12314 PyObject *stepval = NULL, *mask = NULL, *shift = NULL;
12315 int bits, remaining_bits, is_negative = 0;
12316 int chunk_size = (
sizeof(long) < 8) ? 30 : 62;
12317 if (likely(PyLong_CheckExact(x))) {
12318 v = __Pyx_NewRef(x);
12320 v = PyNumber_Long(x);
12321 if (unlikely(!
v))
return (
char) -1;
12322 assert(PyLong_CheckExact(
v));
12325 int result = PyObject_RichCompareBool(
v, Py_False, Py_LT);
12326 if (unlikely(result < 0)) {
12330 is_negative = result == 1;
12332 if (is_unsigned && unlikely(is_negative)) {
12334 PyErr_SetString(PyExc_OverflowError,
12335 "can't convert negative value to char");
12337 }
else if (is_negative) {
12338 stepval = PyNumber_Invert(
v);
12340 if (unlikely(!stepval))
12347 mask = PyLong_FromLong((1L << chunk_size) - 1);
if (unlikely(!mask))
goto done;
12348 shift = PyLong_FromLong(chunk_size);
if (unlikely(!shift))
goto done;
12349 for (bits = 0; bits < (int)
sizeof(char) * 8 - chunk_size; bits += chunk_size) {
12350 PyObject *tmp, *digit;
12352 digit = PyNumber_And(stepval, mask);
12353 if (unlikely(!digit))
goto done;
12354 idigit = PyLong_AsLong(digit);
12356 if (unlikely(idigit < 0))
goto done;
12357 val |= ((char) idigit) << bits;
12358 tmp = PyNumber_Rshift(stepval, shift);
12359 if (unlikely(!tmp))
goto done;
12360 Py_DECREF(stepval); stepval = tmp;
12362 Py_DECREF(shift); shift = NULL;
12363 Py_DECREF(mask); mask = NULL;
12365 long idigit = PyLong_AsLong(stepval);
12366 if (unlikely(idigit < 0))
goto done;
12367 remaining_bits = ((int)
sizeof(char) * 8) - bits - (is_unsigned ? 0 : 1);
12368 if (unlikely(idigit >= (1L << remaining_bits)))
12369 goto raise_overflow;
12370 val |= ((char) idigit) << bits;
12372 if (!is_unsigned) {
12373 if (unlikely(val & (((
char) 1) << (
sizeof(
char) * 8 - 1))))
12374 goto raise_overflow;
12382 Py_XDECREF(stepval);
12388 return __Pyx_raise_overflow___Pyx_PyLong_As_char();
12390static CYTHON_INLINE
char __Pyx_PyLong___Pyx_PyLong_As_char(PyObject *x) {
12391#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
12392#pragma GCC diagnostic push
12393#pragma GCC diagnostic ignored "-Wconversion"
12395 const char neg_one = (char) -1, const_zero = (
char) 0;
12396#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
12397#pragma GCC diagnostic pop
12399 const int is_unsigned = neg_one > const_zero;
12401 #if CYTHON_USE_PYLONG_INTERNALS
12402 if (unlikely(__Pyx_PyLong_IsNeg(x))) {
12403 goto raise_neg_overflow;
12404 }
else if (__Pyx_PyLong_IsCompact(x)) {
12405 __PYX_VERIFY_RETURN_INT(
char, __Pyx_compact_upylong, __Pyx_PyLong_CompactValueUnsigned(x))
12409 return __Pyx_PyULong___Pyx_PyLong_As_char(x);
12412 #if CYTHON_USE_PYLONG_INTERNALS
12413 if (__Pyx_PyLong_IsCompact(x)) {
12414 __PYX_VERIFY_RETURN_INT(
char, __Pyx_compact_pylong, __Pyx_PyLong_CompactValue(x))
12418 return __Pyx_PySLong___Pyx_PyLong_As_char(x);
12421#if CYTHON_USE_PYLONG_INTERNALS
12423 return __Pyx_raise_neg_overflow___Pyx_PyLong_As_char();
12425 return __Pyx_raise_overflow___Pyx_PyLong_As_char();
12428static char __Pyx_NonPyLong___Pyx_PyLong_As_char(PyObject *x) {
12430 PyObject *tmp = __Pyx_PyNumber_Long(x);
12431 if (!tmp)
return (
char) -1;
12432 val = __Pyx_PyLong_As_char(tmp);
12436static CYTHON_INLINE
char __Pyx_PyLong_As_char(PyObject *x) {
12437 if (likely(PyLong_Check(x))) {
12438 return __Pyx_PyLong___Pyx_PyLong_As_char(x);
12440 return __Pyx_NonPyLong___Pyx_PyLong_As_char(x);
12445#if CYTHON_COMPILING_IN_LIMITED_API && __PYX_LIMITED_VERSION_HEX < 0x030d0000
12446static __Pyx_TypeName
12447__Pyx_PyType_GetFullyQualifiedName(PyTypeObject* tp)
12449 PyObject *module = NULL, *name = NULL, *result = NULL;
12450 #if __PYX_LIMITED_VERSION_HEX < 0x030b0000
12451 name = __Pyx_PyObject_GetAttrStr((PyObject *)tp,
12452 __pyx_mstate_global->__pyx_n_u_qualname);
12454 name = PyType_GetQualName(tp);
12456 if (unlikely(name == NULL) || unlikely(!PyUnicode_Check(name)))
goto bad;
12457 module = __Pyx_PyObject_GetAttrStr((PyObject *)tp,
12458 __pyx_mstate_global->__pyx_n_u_module);
12459 if (unlikely(module == NULL) || unlikely(!PyUnicode_Check(module)))
goto bad;
12460 if (PyUnicode_CompareWithASCIIString(module,
"builtins") == 0) {
12465 result = PyUnicode_FromFormat(
"%U.%U", module, name);
12466 if (unlikely(result == NULL))
goto bad;
12469 Py_XDECREF(module);
12477 result = __Pyx_NewRef(__pyx_mstate_global->__pyx_kp_u_);
12484#if CYTHON_VECTORCALL
12485CYTHON_UNUSED
static int __Pyx_CheckVectorcallKwarg(PyObject *kwnames, Py_ssize_t i) {
12486 PyObject *key = __Pyx_PyTuple_GET_ITEM(kwnames, i);
12487#if !CYTHON_ASSUME_SAFE_MACROS
12488 if (unlikely(!key))
return -1;
12490 if (unlikely(!PyUnicode_Check(key))) {
12491 PyErr_SetString(PyExc_TypeError,
"keywords must be strings");
12497CYTHON_UNUSED
static PyObject *__Pyx_MakeKwargDict(PyObject **keys, PyObject **values, Py_ssize_t
n) {
12498 PyObject *out = PyDict_New();
12499 if (unlikely(!out))
return NULL;
12500 for (Py_ssize_t i=0; i<
n; ++i) {
12501 if (unlikely(PyDict_SetItem(out, keys[i], values[i]) < 0)) {
12508CYTHON_UNUSED
static int __Pyx_CheckVectorcallKwarg(PyObject **kwnames, Py_ssize_t i) {
12509 PyObject *key = kwnames[i];
12510 if (unlikely(!PyUnicode_Check(key))) {
12511 PyErr_SetString(PyExc_TypeError,
"keywords must be strings");
12519#if !CYTHON_VECTORCALL
12520static PyObject *__Pyx_Object_VectorcallMethodKwds(PyObject *name, PyObject *
const *args,
size_t nargsf, PyObject *kwnames) {
12522 PyObject *obj = PyObject_GetAttr(args[0], name);
12523 if (unlikely(!obj))
12525 result = __Pyx_Object_VectorcallKwds(obj, args+1, nargsf-1, kwnames);
12532static CYTHON_INLINE PyObject* __Pyx_PyLong_From_long(
long value) {
12533#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
12534#pragma GCC diagnostic push
12535#pragma GCC diagnostic ignored "-Wconversion"
12537 const long neg_one = (long) -1, const_zero = (
long) 0;
12538#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
12539#pragma GCC diagnostic pop
12541 const int is_unsigned = neg_one > const_zero;
12543 if (
sizeof(
long) <
sizeof(
long)) {
12544 return PyLong_FromLong((
long) value);
12545 }
else if (
sizeof(
long) <=
sizeof(
unsigned long)) {
12546 return PyLong_FromUnsignedLong((
unsigned long) value);
12547#if !CYTHON_COMPILING_IN_PYPY
12548 }
else if (
sizeof(
long) <=
sizeof(
unsigned PY_LONG_LONG)) {
12549 return PyLong_FromUnsignedLongLong((
unsigned PY_LONG_LONG) value);
12553 if (
sizeof(
long) <=
sizeof(
long)) {
12554 return PyLong_FromLong((
long) value);
12555 }
else if (
sizeof(
long) <=
sizeof(PY_LONG_LONG)) {
12556 return PyLong_FromLongLong((PY_LONG_LONG) value);
12560 unsigned char *bytes = (
unsigned char *)&value;
12561#if !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX >= 0x030d00A4
12563 return PyLong_FromUnsignedNativeBytes(bytes,
sizeof(value), -1);
12565 return PyLong_FromNativeBytes(bytes,
sizeof(value), -1);
12567#elif !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030d0000
12568 int one = 1;
int little = (int)*(
unsigned char *)&one;
12569 return _PyLong_FromByteArray(bytes,
sizeof(
long),
12570 little, !is_unsigned);
12572 int one = 1;
int little = (int)*(
unsigned char *)&one;
12573 PyObject *result = NULL, *kwds = NULL;
12574 PyObject *py_bytes = NULL, *order_str = NULL, *from_bytes_str = NULL;;
12575 py_bytes = PyBytes_FromStringAndSize((
char*)bytes,
sizeof(
long));
12576 if (!py_bytes)
goto limited_bad;
12577 from_bytes_str = PyUnicode_FromStringAndSize(
"from_bytes", 10);
12578 if (!from_bytes_str)
goto limited_bad;
12579 order_str = PyUnicode_FromString(little ?
"little" :
"big");
12580 if (!order_str)
goto limited_bad;
12582 PyObject *args[] = { (PyObject*)&PyLong_Type, py_bytes, order_str, Py_True };
12583 if (!is_unsigned) {
12584 PyObject *signed_str = PyUnicode_FromStringAndSize(
"signed", 6);
12585 if (!signed_str)
goto limited_bad;
12586#if CYTHON_VECTORCALL
12587 kwds = PyTuple_Pack(1, signed_str);
12590 PyObject *keys[] = {signed_str};
12591 PyObject *values[] = {Py_True};
12592 kwds = __Pyx_MakeKwargDict(keys, values, 1);
12595 Py_DECREF(signed_str);
12596 if (unlikely(!kwds))
goto limited_bad;
12598 result = __Pyx_Object_VectorcallMethodKwds(from_bytes_str, args, 3 | __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET, kwds);
12602 Py_XDECREF(order_str);
12603 Py_XDECREF(py_bytes);
12604 Py_XDECREF(from_bytes_str);
12611static long __Pyx_LargePyLong___Pyx_PyLong_As_long(PyObject *x);
12612static long __Pyx_raise_neg_overflow___Pyx_PyLong_As_long(
void) {
12613 const char* type_name =
"long";
12614 PyErr_Format(PyExc_OverflowError,
12615 "can't convert negative value to %.200s", type_name);
12618static long __Pyx_raise_overflow___Pyx_PyLong_As_long(
void) {
12619 const char* type_name =
"long";
12620 PyErr_Format(PyExc_OverflowError,
12621 "value too large to convert to %.200s", type_name);
12624static CYTHON_INLINE
long __Pyx_PyULong___Pyx_PyLong_As_long(PyObject *x) {
12625 const int is_unsigned = 1;
12626#if CYTHON_USE_PYLONG_INTERNALS
12628 const digit* digits = __Pyx_PyLong_Digits(x);
12629 const Py_ssize_t size = __Pyx_PyLong_DigitCount(x);
12630 if (size == 2 && (8 *
sizeof(
long) > 1 * PyLong_SHIFT)) {
12631 if ((8 *
sizeof(
unsigned long) > 2 * PyLong_SHIFT)) {
12632 __PYX_VERIFY_RETURN_INT(
long,
unsigned long, (((((
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
12633 }
else if ((8 *
sizeof(
long) >= 2 * PyLong_SHIFT)) {
12634 return (
long) (((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0]));
12637 if (size == 3 && (8 *
sizeof(
long) > 2 * PyLong_SHIFT)) {
12638 if ((8 *
sizeof(
unsigned long) > 3 * PyLong_SHIFT)) {
12639 __PYX_VERIFY_RETURN_INT(
long,
unsigned long, (((((((
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
12640 }
else if ((8 *
sizeof(
long) >= 3 * PyLong_SHIFT)) {
12641 return (
long) (((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]));
12644 if (size == 4 && (8 *
sizeof(
long) > 3 * PyLong_SHIFT)) {
12645 if ((8 *
sizeof(
unsigned long) > 4 * PyLong_SHIFT)) {
12646 __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])))
12647 }
else if ((8 *
sizeof(
long) >= 4 * PyLong_SHIFT)) {
12648 return (
long) (((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]));
12653#elif CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030C00A7
12654 if (unlikely(Py_SIZE(x) < 0)) {
12655 goto raise_neg_overflow;
12659 int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
12660 if (unlikely(result < 0))
12662 if (unlikely(result == 1))
12663 goto raise_neg_overflow;
12666 if ((
sizeof(
long) <=
sizeof(
unsigned long))) {
12667 __PYX_VERIFY_RETURN_INT_EXC(
long,
unsigned long, PyLong_AsUnsignedLong(x))
12668 }
else if ((
sizeof(
long) <=
sizeof(
unsigned PY_LONG_LONG))) {
12669 __PYX_VERIFY_RETURN_INT_EXC(
long,
unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
12671 return __Pyx_LargePyLong___Pyx_PyLong_As_long(x);
12673 return __Pyx_raise_neg_overflow___Pyx_PyLong_As_long();
12675 return __Pyx_raise_overflow___Pyx_PyLong_As_long();
12677static CYTHON_INLINE
long __Pyx_PySLong___Pyx_PyLong_As_long(PyObject *x) {
12678 const int is_unsigned = 0;
12679#if CYTHON_USE_PYLONG_INTERNALS
12680 if (__Pyx_PyLong_IsNeg(x)) {
12681 const Py_ssize_t size = __Pyx_PyLong_DigitCount(x);
12682 const digit* digits = __Pyx_PyLong_Digits(x);
12683 if (size == 2 && (8 *
sizeof(
long) > 1 * PyLong_SHIFT)) {
12684 if ((8 *
sizeof(
long) > 2 * PyLong_SHIFT)) {
12685 long ival = - (long) (((((
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0]));
12686 __PYX_VERIFY_RETURN_INT(
long,
long, ival)
12687 }
else if ((8 *
sizeof(
long) - 1 > 2 * PyLong_SHIFT)) {
12688 return (
long) (((long) -1) * (((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
12691 if (size == 3 && (8 *
sizeof(
long) > 2 * PyLong_SHIFT)) {
12692 if ((8 *
sizeof(
long) > 3 * PyLong_SHIFT)) {
12693 long ival = - (long) (((((((
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0]));
12694 __PYX_VERIFY_RETURN_INT(
long,
long, ival)
12695 }
else if ((8 *
sizeof(
long) - 1 > 3 * PyLong_SHIFT)) {
12696 return (
long) (((long) -1) * (((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
12699 if (size == 4 && (8 *
sizeof(
long) > 3 * PyLong_SHIFT)) {
12700 if ((8 *
sizeof(
long) > 4 * PyLong_SHIFT)) {
12701 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]));
12702 __PYX_VERIFY_RETURN_INT(
long,
long, ival)
12703 }
else if ((8 *
sizeof(
long) - 1 > 4 * PyLong_SHIFT)) {
12704 return (
long) (((long) -1) * (((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
12709 const Py_ssize_t size = __Pyx_PyLong_DigitCount(x);
12710 const digit* digits = __Pyx_PyLong_Digits(x);
12711 if (size == 2 && (8 *
sizeof(
long) > 1 * PyLong_SHIFT)) {
12712 if ((8 *
sizeof(
long) > 2 * PyLong_SHIFT)) {
12713 __PYX_VERIFY_RETURN_INT(
long,
unsigned long, (((((
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
12714 }
else if ((8 *
sizeof(
long) - 1 > 2 * PyLong_SHIFT)) {
12715 return (
long) (((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0]));
12718 if (size == 3 && (8 *
sizeof(
long) > 2 * PyLong_SHIFT)) {
12719 if ((8 *
sizeof(
long) > 3 * PyLong_SHIFT)) {
12720 __PYX_VERIFY_RETURN_INT(
long,
unsigned long, (((((((
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
12721 }
else if ((8 *
sizeof(
long) - 1 > 3 * PyLong_SHIFT)) {
12722 return (
long) (((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]));
12725 if (size == 4 && (8 *
sizeof(
long) > 3 * PyLong_SHIFT)) {
12726 if ((8 *
sizeof(
long) > 4 * PyLong_SHIFT)) {
12727 __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])))
12728 }
else if ((8 *
sizeof(
long) - 1 > 4 * PyLong_SHIFT)) {
12729 return (
long) (((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]));
12735 #if __PYX_LIMITED_VERSION_HEX >= 0x030d0000
12736 if ((
sizeof(
long) <=
sizeof(
int)) && (
sizeof(
int) <
sizeof(
long))) {
12737 __PYX_VERIFY_RETURN_INT_EXC(
long,
int, PyLong_AsInt(x))
12740 if ((
sizeof(
long) <=
sizeof(
long))) {
12741 __PYX_VERIFY_RETURN_INT_EXC(
long,
long, PyLong_AsLong(x))
12742 }
else if ((
sizeof(
long) <=
sizeof(PY_LONG_LONG))) {
12743 __PYX_VERIFY_RETURN_INT_EXC(
long, PY_LONG_LONG, PyLong_AsLongLong(x))
12745 return __Pyx_LargePyLong___Pyx_PyLong_As_long(x);
12747 return __Pyx_raise_neg_overflow___Pyx_PyLong_As_long();
12749 return __Pyx_raise_overflow___Pyx_PyLong_As_long();
12751static long __Pyx_LargePyLong___Pyx_PyLong_As_long(PyObject *x) {
12752#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
12753#pragma GCC diagnostic push
12754#pragma GCC diagnostic ignored "-Wconversion"
12756 const long neg_one = (long) -1, const_zero = (
long) 0;
12757#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
12758#pragma GCC diagnostic pop
12760 const int is_unsigned = neg_one > const_zero;
12763#if PY_VERSION_HEX >= 0x030d00A6 && !CYTHON_COMPILING_IN_LIMITED_API
12764 Py_ssize_t bytes_copied = PyLong_AsNativeBytes(
12765 x, &val,
sizeof(val), Py_ASNATIVEBYTES_NATIVE_ENDIAN | (is_unsigned ? Py_ASNATIVEBYTES_UNSIGNED_BUFFER | Py_ASNATIVEBYTES_REJECT_NEGATIVE : 0));
12766 if (unlikely(bytes_copied == -1)) {
12767 }
else if (unlikely(bytes_copied > (Py_ssize_t)
sizeof(val))) {
12768 goto raise_overflow;
12772#elif PY_VERSION_HEX < 0x030d0000 && !(CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API) || defined(_PyLong_AsByteArray)
12773 int one = 1;
int is_little = (int)*(
unsigned char *)&one;
12774 unsigned char *bytes = (
unsigned char *)&val;
12775 ret = _PyLong_AsByteArray((PyLongObject *)x,
12776 bytes,
sizeof(val),
12777 is_little, !is_unsigned);
12778 if ((0))
goto raise_overflow;
12781 PyObject *stepval = NULL, *mask = NULL, *shift = NULL;
12782 int bits, remaining_bits, is_negative = 0;
12783 int chunk_size = (
sizeof(long) < 8) ? 30 : 62;
12784 if (likely(PyLong_CheckExact(x))) {
12785 v = __Pyx_NewRef(x);
12787 v = PyNumber_Long(x);
12788 if (unlikely(!
v))
return (
long) -1;
12789 assert(PyLong_CheckExact(
v));
12792 int result = PyObject_RichCompareBool(
v, Py_False, Py_LT);
12793 if (unlikely(result < 0)) {
12797 is_negative = result == 1;
12799 if (is_unsigned && unlikely(is_negative)) {
12801 PyErr_SetString(PyExc_OverflowError,
12802 "can't convert negative value to long");
12804 }
else if (is_negative) {
12805 stepval = PyNumber_Invert(
v);
12807 if (unlikely(!stepval))
12814 mask = PyLong_FromLong((1L << chunk_size) - 1);
if (unlikely(!mask))
goto done;
12815 shift = PyLong_FromLong(chunk_size);
if (unlikely(!shift))
goto done;
12816 for (bits = 0; bits < (int)
sizeof(long) * 8 - chunk_size; bits += chunk_size) {
12817 PyObject *tmp, *digit;
12819 digit = PyNumber_And(stepval, mask);
12820 if (unlikely(!digit))
goto done;
12821 idigit = PyLong_AsLong(digit);
12823 if (unlikely(idigit < 0))
goto done;
12824 val |= ((long) idigit) << bits;
12825 tmp = PyNumber_Rshift(stepval, shift);
12826 if (unlikely(!tmp))
goto done;
12827 Py_DECREF(stepval); stepval = tmp;
12829 Py_DECREF(shift); shift = NULL;
12830 Py_DECREF(mask); mask = NULL;
12832 long idigit = PyLong_AsLong(stepval);
12833 if (unlikely(idigit < 0))
goto done;
12834 remaining_bits = ((int)
sizeof(long) * 8) - bits - (is_unsigned ? 0 : 1);
12835 if (unlikely(idigit >= (1L << remaining_bits)))
12836 goto raise_overflow;
12837 val |= ((long) idigit) << bits;
12839 if (!is_unsigned) {
12840 if (unlikely(val & (((
long) 1) << (
sizeof(
long) * 8 - 1))))
12841 goto raise_overflow;
12849 Py_XDECREF(stepval);
12855 return __Pyx_raise_overflow___Pyx_PyLong_As_long();
12857static CYTHON_INLINE
long __Pyx_PyLong___Pyx_PyLong_As_long(PyObject *x) {
12858#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
12859#pragma GCC diagnostic push
12860#pragma GCC diagnostic ignored "-Wconversion"
12862 const long neg_one = (long) -1, const_zero = (
long) 0;
12863#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
12864#pragma GCC diagnostic pop
12866 const int is_unsigned = neg_one > const_zero;
12868 #if CYTHON_USE_PYLONG_INTERNALS
12869 if (unlikely(__Pyx_PyLong_IsNeg(x))) {
12870 goto raise_neg_overflow;
12871 }
else if (__Pyx_PyLong_IsCompact(x)) {
12872 __PYX_VERIFY_RETURN_INT(
long, __Pyx_compact_upylong, __Pyx_PyLong_CompactValueUnsigned(x))
12876 return __Pyx_PyULong___Pyx_PyLong_As_long(x);
12879 #if CYTHON_USE_PYLONG_INTERNALS
12880 if (__Pyx_PyLong_IsCompact(x)) {
12881 __PYX_VERIFY_RETURN_INT(
long, __Pyx_compact_pylong, __Pyx_PyLong_CompactValue(x))
12885 return __Pyx_PySLong___Pyx_PyLong_As_long(x);
12888#if CYTHON_USE_PYLONG_INTERNALS
12890 return __Pyx_raise_neg_overflow___Pyx_PyLong_As_long();
12892 return __Pyx_raise_overflow___Pyx_PyLong_As_long();
12895static long __Pyx_NonPyLong___Pyx_PyLong_As_long(PyObject *x) {
12897 PyObject *tmp = __Pyx_PyNumber_Long(x);
12898 if (!tmp)
return (
long) -1;
12899 val = __Pyx_PyLong_As_long(tmp);
12903static CYTHON_INLINE
long __Pyx_PyLong_As_long(PyObject *x) {
12904 if (likely(PyLong_Check(x))) {
12905 return __Pyx_PyLong___Pyx_PyLong_As_long(x);
12907 return __Pyx_NonPyLong___Pyx_PyLong_As_long(x);
12912static int __Pyx_LargePyLong___Pyx_PyLong_As_int(PyObject *x);
12913static int __Pyx_raise_neg_overflow___Pyx_PyLong_As_int(
void) {
12914 const char* type_name =
"int";
12915 PyErr_Format(PyExc_OverflowError,
12916 "can't convert negative value to %.200s", type_name);
12919static int __Pyx_raise_overflow___Pyx_PyLong_As_int(
void) {
12920 const char* type_name =
"int";
12921 PyErr_Format(PyExc_OverflowError,
12922 "value too large to convert to %.200s", type_name);
12925static CYTHON_INLINE
int __Pyx_PyULong___Pyx_PyLong_As_int(PyObject *x) {
12926 const int is_unsigned = 1;
12927#if CYTHON_USE_PYLONG_INTERNALS
12929 const digit* digits = __Pyx_PyLong_Digits(x);
12930 const Py_ssize_t size = __Pyx_PyLong_DigitCount(x);
12931 if (size == 2 && (8 *
sizeof(
int) > 1 * PyLong_SHIFT)) {
12932 if ((8 *
sizeof(
unsigned long) > 2 * PyLong_SHIFT)) {
12933 __PYX_VERIFY_RETURN_INT(
int,
unsigned long, (((((
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
12934 }
else if ((8 *
sizeof(
int) >= 2 * PyLong_SHIFT)) {
12935 return (
int) (((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0]));
12938 if (size == 3 && (8 *
sizeof(
int) > 2 * PyLong_SHIFT)) {
12939 if ((8 *
sizeof(
unsigned long) > 3 * PyLong_SHIFT)) {
12940 __PYX_VERIFY_RETURN_INT(
int,
unsigned long, (((((((
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
12941 }
else if ((8 *
sizeof(
int) >= 3 * PyLong_SHIFT)) {
12942 return (
int) (((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]));
12945 if (size == 4 && (8 *
sizeof(
int) > 3 * PyLong_SHIFT)) {
12946 if ((8 *
sizeof(
unsigned long) > 4 * PyLong_SHIFT)) {
12947 __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])))
12948 }
else if ((8 *
sizeof(
int) >= 4 * PyLong_SHIFT)) {
12949 return (
int) (((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]));
12954#elif CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030C00A7
12955 if (unlikely(Py_SIZE(x) < 0)) {
12956 goto raise_neg_overflow;
12960 int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
12961 if (unlikely(result < 0))
12963 if (unlikely(result == 1))
12964 goto raise_neg_overflow;
12967 if ((
sizeof(
int) <=
sizeof(
unsigned long))) {
12968 __PYX_VERIFY_RETURN_INT_EXC(
int,
unsigned long, PyLong_AsUnsignedLong(x))
12969 }
else if ((
sizeof(
int) <=
sizeof(
unsigned PY_LONG_LONG))) {
12970 __PYX_VERIFY_RETURN_INT_EXC(
int,
unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
12972 return __Pyx_LargePyLong___Pyx_PyLong_As_int(x);
12974 return __Pyx_raise_neg_overflow___Pyx_PyLong_As_int();
12976 return __Pyx_raise_overflow___Pyx_PyLong_As_int();
12978static CYTHON_INLINE
int __Pyx_PySLong___Pyx_PyLong_As_int(PyObject *x) {
12979 const int is_unsigned = 0;
12980#if CYTHON_USE_PYLONG_INTERNALS
12981 if (__Pyx_PyLong_IsNeg(x)) {
12982 const Py_ssize_t size = __Pyx_PyLong_DigitCount(x);
12983 const digit* digits = __Pyx_PyLong_Digits(x);
12984 if (size == 2 && (8 *
sizeof(
int) > 1 * PyLong_SHIFT)) {
12985 if ((8 *
sizeof(
long) > 2 * PyLong_SHIFT)) {
12986 long ival = - (long) (((((
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0]));
12987 __PYX_VERIFY_RETURN_INT(
int,
long, ival)
12988 }
else if ((8 *
sizeof(
int) - 1 > 2 * PyLong_SHIFT)) {
12989 return (
int) (((int) -1) * (((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
12992 if (size == 3 && (8 *
sizeof(
int) > 2 * PyLong_SHIFT)) {
12993 if ((8 *
sizeof(
long) > 3 * PyLong_SHIFT)) {
12994 long ival = - (long) (((((((
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0]));
12995 __PYX_VERIFY_RETURN_INT(
int,
long, ival)
12996 }
else if ((8 *
sizeof(
int) - 1 > 3 * PyLong_SHIFT)) {
12997 return (
int) (((int) -1) * (((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
13000 if (size == 4 && (8 *
sizeof(
int) > 3 * PyLong_SHIFT)) {
13001 if ((8 *
sizeof(
long) > 4 * PyLong_SHIFT)) {
13002 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]));
13003 __PYX_VERIFY_RETURN_INT(
int,
long, ival)
13004 }
else if ((8 *
sizeof(
int) - 1 > 4 * PyLong_SHIFT)) {
13005 return (
int) (((int) -1) * (((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
13010 const Py_ssize_t size = __Pyx_PyLong_DigitCount(x);
13011 const digit* digits = __Pyx_PyLong_Digits(x);
13012 if (size == 2 && (8 *
sizeof(
int) > 1 * PyLong_SHIFT)) {
13013 if ((8 *
sizeof(
long) > 2 * PyLong_SHIFT)) {
13014 __PYX_VERIFY_RETURN_INT(
int,
unsigned long, (((((
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
13015 }
else if ((8 *
sizeof(
int) - 1 > 2 * PyLong_SHIFT)) {
13016 return (
int) (((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0]));
13019 if (size == 3 && (8 *
sizeof(
int) > 2 * PyLong_SHIFT)) {
13020 if ((8 *
sizeof(
long) > 3 * PyLong_SHIFT)) {
13021 __PYX_VERIFY_RETURN_INT(
int,
unsigned long, (((((((
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
13022 }
else if ((8 *
sizeof(
int) - 1 > 3 * PyLong_SHIFT)) {
13023 return (
int) (((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]));
13026 if (size == 4 && (8 *
sizeof(
int) > 3 * PyLong_SHIFT)) {
13027 if ((8 *
sizeof(
long) > 4 * PyLong_SHIFT)) {
13028 __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])))
13029 }
else if ((8 *
sizeof(
int) - 1 > 4 * PyLong_SHIFT)) {
13030 return (
int) (((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]));
13036 #if __PYX_LIMITED_VERSION_HEX >= 0x030d0000
13037 if ((
sizeof(
int) <=
sizeof(
int)) && (
sizeof(
int) <
sizeof(
long))) {
13038 __PYX_VERIFY_RETURN_INT_EXC(
int,
int, PyLong_AsInt(x))
13041 if ((
sizeof(
int) <=
sizeof(
long))) {
13042 __PYX_VERIFY_RETURN_INT_EXC(
int,
long, PyLong_AsLong(x))
13043 }
else if ((
sizeof(
int) <=
sizeof(PY_LONG_LONG))) {
13044 __PYX_VERIFY_RETURN_INT_EXC(
int, PY_LONG_LONG, PyLong_AsLongLong(x))
13046 return __Pyx_LargePyLong___Pyx_PyLong_As_int(x);
13048 return __Pyx_raise_neg_overflow___Pyx_PyLong_As_int();
13050 return __Pyx_raise_overflow___Pyx_PyLong_As_int();
13052static int __Pyx_LargePyLong___Pyx_PyLong_As_int(PyObject *x) {
13053#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
13054#pragma GCC diagnostic push
13055#pragma GCC diagnostic ignored "-Wconversion"
13057 const int neg_one = (int) -1, const_zero = (
int) 0;
13058#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
13059#pragma GCC diagnostic pop
13061 const int is_unsigned = neg_one > const_zero;
13064#if PY_VERSION_HEX >= 0x030d00A6 && !CYTHON_COMPILING_IN_LIMITED_API
13065 Py_ssize_t bytes_copied = PyLong_AsNativeBytes(
13066 x, &val,
sizeof(val), Py_ASNATIVEBYTES_NATIVE_ENDIAN | (is_unsigned ? Py_ASNATIVEBYTES_UNSIGNED_BUFFER | Py_ASNATIVEBYTES_REJECT_NEGATIVE : 0));
13067 if (unlikely(bytes_copied == -1)) {
13068 }
else if (unlikely(bytes_copied > (Py_ssize_t)
sizeof(val))) {
13069 goto raise_overflow;
13073#elif PY_VERSION_HEX < 0x030d0000 && !(CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API) || defined(_PyLong_AsByteArray)
13074 int one = 1;
int is_little = (int)*(
unsigned char *)&one;
13075 unsigned char *bytes = (
unsigned char *)&val;
13076 ret = _PyLong_AsByteArray((PyLongObject *)x,
13077 bytes,
sizeof(val),
13078 is_little, !is_unsigned);
13079 if ((0))
goto raise_overflow;
13082 PyObject *stepval = NULL, *mask = NULL, *shift = NULL;
13083 int bits, remaining_bits, is_negative = 0;
13084 int chunk_size = (
sizeof(long) < 8) ? 30 : 62;
13085 if (likely(PyLong_CheckExact(x))) {
13086 v = __Pyx_NewRef(x);
13088 v = PyNumber_Long(x);
13089 if (unlikely(!
v))
return (
int) -1;
13090 assert(PyLong_CheckExact(
v));
13093 int result = PyObject_RichCompareBool(
v, Py_False, Py_LT);
13094 if (unlikely(result < 0)) {
13098 is_negative = result == 1;
13100 if (is_unsigned && unlikely(is_negative)) {
13102 PyErr_SetString(PyExc_OverflowError,
13103 "can't convert negative value to int");
13105 }
else if (is_negative) {
13106 stepval = PyNumber_Invert(
v);
13108 if (unlikely(!stepval))
13115 mask = PyLong_FromLong((1L << chunk_size) - 1);
if (unlikely(!mask))
goto done;
13116 shift = PyLong_FromLong(chunk_size);
if (unlikely(!shift))
goto done;
13117 for (bits = 0; bits < (int)
sizeof(int) * 8 - chunk_size; bits += chunk_size) {
13118 PyObject *tmp, *digit;
13120 digit = PyNumber_And(stepval, mask);
13121 if (unlikely(!digit))
goto done;
13122 idigit = PyLong_AsLong(digit);
13124 if (unlikely(idigit < 0))
goto done;
13125 val |= ((int) idigit) << bits;
13126 tmp = PyNumber_Rshift(stepval, shift);
13127 if (unlikely(!tmp))
goto done;
13128 Py_DECREF(stepval); stepval = tmp;
13130 Py_DECREF(shift); shift = NULL;
13131 Py_DECREF(mask); mask = NULL;
13133 long idigit = PyLong_AsLong(stepval);
13134 if (unlikely(idigit < 0))
goto done;
13135 remaining_bits = ((int)
sizeof(int) * 8) - bits - (is_unsigned ? 0 : 1);
13136 if (unlikely(idigit >= (1L << remaining_bits)))
13137 goto raise_overflow;
13138 val |= ((int) idigit) << bits;
13140 if (!is_unsigned) {
13141 if (unlikely(val & (((
int) 1) << (
sizeof(
int) * 8 - 1))))
13142 goto raise_overflow;
13150 Py_XDECREF(stepval);
13156 return __Pyx_raise_overflow___Pyx_PyLong_As_int();
13158static CYTHON_INLINE
int __Pyx_PyLong___Pyx_PyLong_As_int(PyObject *x) {
13159#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
13160#pragma GCC diagnostic push
13161#pragma GCC diagnostic ignored "-Wconversion"
13163 const int neg_one = (int) -1, const_zero = (
int) 0;
13164#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
13165#pragma GCC diagnostic pop
13167 const int is_unsigned = neg_one > const_zero;
13169 #if CYTHON_USE_PYLONG_INTERNALS
13170 if (unlikely(__Pyx_PyLong_IsNeg(x))) {
13171 goto raise_neg_overflow;
13172 }
else if (__Pyx_PyLong_IsCompact(x)) {
13173 __PYX_VERIFY_RETURN_INT(
int, __Pyx_compact_upylong, __Pyx_PyLong_CompactValueUnsigned(x))
13177 return __Pyx_PyULong___Pyx_PyLong_As_int(x);
13180 #if CYTHON_USE_PYLONG_INTERNALS
13181 if (__Pyx_PyLong_IsCompact(x)) {
13182 __PYX_VERIFY_RETURN_INT(
int, __Pyx_compact_pylong, __Pyx_PyLong_CompactValue(x))
13186 return __Pyx_PySLong___Pyx_PyLong_As_int(x);
13189#if CYTHON_USE_PYLONG_INTERNALS
13191 return __Pyx_raise_neg_overflow___Pyx_PyLong_As_int();
13193 return __Pyx_raise_overflow___Pyx_PyLong_As_int();
13196static int __Pyx_NonPyLong___Pyx_PyLong_As_int(PyObject *x) {
13198 PyObject *tmp = __Pyx_PyNumber_Long(x);
13199 if (!tmp)
return (
int) -1;
13200 val = __Pyx_PyLong_As_int(tmp);
13204static CYTHON_INLINE
int __Pyx_PyLong_As_int(PyObject *x) {
13205 if (likely(PyLong_Check(x))) {
13206 return __Pyx_PyLong___Pyx_PyLong_As_int(x);
13208 return __Pyx_NonPyLong___Pyx_PyLong_As_int(x);
13213#if __PYX_LIMITED_VERSION_HEX < 0x030b0000
13214void __Pyx_init_runtime_version(
void) {
13215 if (__Pyx_cached_runtime_version == 0) {
13216 const char* rt_version = Py_GetVersion();
13217 unsigned long version = 0;
13218 unsigned long factor = 0x01000000UL;
13219 unsigned int digit = 0;
13222 while (
'0' <= rt_version[i] && rt_version[i] <=
'9') {
13223 digit = digit * 10 + (
unsigned int) (rt_version[i] -
'0');
13226 version += factor * digit;
13227 if (rt_version[i] !=
'.')
13233 __Pyx_cached_runtime_version = version;
13237static unsigned long __Pyx_get_runtime_version(
void) {
13238#if __PYX_LIMITED_VERSION_HEX >= 0x030b0000
13239 return Py_Version & ~0xFFUL;
13241 return __Pyx_cached_runtime_version;
13246static int __Pyx_check_binary_version(
unsigned long ct_version,
unsigned long rt_version,
int allow_newer) {
13247 const unsigned long MAJOR_MINOR = 0xFFFF0000UL;
13248 if ((rt_version & MAJOR_MINOR) == (ct_version & MAJOR_MINOR))
13250 if (likely(allow_newer && (rt_version & MAJOR_MINOR) > (ct_version & MAJOR_MINOR)))
13254 PyOS_snprintf(message,
sizeof(message),
13255 "compile time Python version %d.%d "
13256 "of module '%.100s' "
13258 "runtime version %d.%d",
13259 (
int) (ct_version >> 24), (
int) ((ct_version >> 16) & 0xFF),
13261 (allow_newer) ?
"was newer than" :
"does not match",
13262 (
int) (rt_version >> 24), (
int) ((rt_version >> 16) & 0xFF)
13264 return PyErr_WarnEx(NULL, message, 1);
13269#if CYTHON_COMPILING_IN_LIMITED_API
13270 static PyObject* __Pyx__PyCode_New(
int a,
int p,
int k,
int l,
int s,
int f,
13271 PyObject *code, PyObject *
c, PyObject*
n, PyObject *
v,
13272 PyObject *fv, PyObject *cell, PyObject* fn,
13273 PyObject *name,
int fline, PyObject *lnos) {
13274 PyObject *exception_table = NULL;
13275 PyObject *types_module=NULL, *code_type=NULL, *result=NULL;
13276 #if __PYX_LIMITED_VERSION_HEX < 0x030b0000
13277 PyObject *version_info;
13278 PyObject *py_minor_version = NULL;
13280 long minor_version = 0;
13281 #if __PYX_LIMITED_VERSION_HEX >= 0x030b0000
13282 minor_version = 11;
13284 if (!(version_info = PySys_GetObject(
"version_info")))
goto end;
13285 if (!(py_minor_version = PySequence_GetItem(version_info, 1)))
goto end;
13286 minor_version = PyLong_AsLong(py_minor_version);
13287 Py_DECREF(py_minor_version);
13288 if (minor_version == -1 && PyErr_Occurred())
goto end;
13290 if (!(types_module = PyImport_ImportModule(
"types")))
goto end;
13291 if (!(code_type = PyObject_GetAttrString(types_module,
"CodeType")))
goto end;
13292 if (minor_version <= 10) {
13293 result = PyObject_CallFunction(code_type,
"iiiiiiOOOOOOiOOO", a,p, k, l,
s,
f, code,
13294 c,
n,
v, fn, name, fline, lnos, fv, cell);
13296 if (!(exception_table = PyBytes_FromStringAndSize(NULL, 0)))
goto end;
13297 result = PyObject_CallFunction(code_type,
"iiiiiiOOOOOOOiOOOO", a,p, k, l,
s,
f, code,
13298 c,
n,
v, fn, name, name, fline, lnos, exception_table, fv, cell);
13301 Py_XDECREF(code_type);
13302 Py_XDECREF(exception_table);
13303 Py_XDECREF(types_module);
13305 PyObject *exc_type, *exc_value, *exc_tb;
13306 PyErr_Fetch(&exc_type, &exc_value, &exc_tb);
13307 if (PyErr_WarnFormat(
13308 PyExc_RuntimeWarning, 1,
13309 "Code object creation failed in Cython module: %S\nTry recompiling with a more recent version of Cython.",
13310 exc_value ? exc_value : exc_type) == 0) {
13314 Py_DECREF(exc_type);
13315 Py_XDECREF(exc_value);
13316 Py_XDECREF(exc_tb);
13320#elif PY_VERSION_HEX >= 0x030B0000
13321 static PyCodeObject* __Pyx__PyCode_New(
int a,
int p,
int k,
int l,
int s,
int f,
13322 PyObject *code, PyObject *
c, PyObject*
n, PyObject *
v,
13323 PyObject *fv, PyObject *cell, PyObject* fn,
13324 PyObject *name,
int fline, PyObject *lnos) {
13325 PyCodeObject *result;
13327 #if PY_VERSION_HEX >= 0x030C0000
13328 PyUnstable_Code_NewWithPosOnlyArgs
13330 PyCode_NewWithPosOnlyArgs
13332 (a, p, k, l,
s,
f, code,
c,
n,
v, fv, cell, fn, name, name, fline, lnos, __pyx_mstate_global->__pyx_empty_bytes);
13333 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030c00A1
13334 if (likely(result))
13335 result->_co_firsttraceable = 0;
13339#elif !CYTHON_COMPILING_IN_PYPY
13340 #define __Pyx__PyCode_New(a, p, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\
13341 PyCode_NewWithPosOnlyArgs(a, p, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)
13343 #define __Pyx__PyCode_New(a, p, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\
13344 PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)
13346static PyObject* __Pyx_PyCode_New(
13347 const __Pyx_PyCode_New_function_description descr,
13348 PyObject *
const *varnames,
13349 PyObject *filename,
13350 PyObject *funcname,
13351 PyObject *line_table,
13352 PyObject *tuple_dedup_map
13354 PyObject *code_obj = NULL, *varnames_tuple_dedup = NULL, *code_bytes = NULL;
13355 Py_ssize_t var_count = (Py_ssize_t) descr.nlocals;
13356 PyObject *varnames_tuple = PyTuple_New(var_count);
13357 if (unlikely(!varnames_tuple))
return NULL;
13358 for (Py_ssize_t i=0; i < var_count; i++) {
13359 Py_INCREF(varnames[i]);
13360 if (__Pyx_PyTuple_SET_ITEM(varnames_tuple, i, varnames[i]) != (0))
goto done;
13362 #if CYTHON_COMPILING_IN_LIMITED_API
13363 varnames_tuple_dedup = PyDict_GetItem(tuple_dedup_map, varnames_tuple);
13364 if (!varnames_tuple_dedup) {
13365 if (unlikely(PyDict_SetItem(tuple_dedup_map, varnames_tuple, varnames_tuple) < 0))
goto done;
13366 varnames_tuple_dedup = varnames_tuple;
13369 varnames_tuple_dedup = PyDict_SetDefault(tuple_dedup_map, varnames_tuple, varnames_tuple);
13370 if (unlikely(!varnames_tuple_dedup))
goto done;
13372 #if CYTHON_AVOID_BORROWED_REFS
13373 Py_INCREF(varnames_tuple_dedup);
13375 if (__PYX_LIMITED_VERSION_HEX >= (0x030b0000) && line_table != NULL && !CYTHON_COMPILING_IN_GRAAL) {
13376 Py_ssize_t line_table_length = __Pyx_PyBytes_GET_SIZE(line_table);
13377 #if !CYTHON_ASSUME_SAFE_SIZE
13378 if (unlikely(line_table_length == -1))
goto done;
13380 Py_ssize_t code_len = (line_table_length * 2 + 4) & ~3LL;
13381 code_bytes = PyBytes_FromStringAndSize(NULL, code_len);
13382 if (unlikely(!code_bytes))
goto done;
13383 char* c_code_bytes = PyBytes_AsString(code_bytes);
13384 if (unlikely(!c_code_bytes))
goto done;
13385 memset(c_code_bytes, 0, (
size_t) code_len);
13387 code_obj = (PyObject*) __Pyx__PyCode_New(
13388 (
int) descr.argcount,
13389 (
int) descr.num_posonly_args,
13390 (
int) descr.num_kwonly_args,
13391 (
int) descr.nlocals,
13394 code_bytes ? code_bytes : __pyx_mstate_global->__pyx_empty_bytes,
13395 __pyx_mstate_global->__pyx_empty_tuple,
13396 __pyx_mstate_global->__pyx_empty_tuple,
13397 varnames_tuple_dedup,
13398 __pyx_mstate_global->__pyx_empty_tuple,
13399 __pyx_mstate_global->__pyx_empty_tuple,
13402 (
int) descr.first_line,
13403 (__PYX_LIMITED_VERSION_HEX >= (0x030b0000) && line_table) ? line_table : __pyx_mstate_global->__pyx_empty_bytes
13406 Py_XDECREF(code_bytes);
13407 #if CYTHON_AVOID_BORROWED_REFS
13408 Py_XDECREF(varnames_tuple_dedup);
13410 Py_DECREF(varnames_tuple);
13416static CYTHON_SMALL_CODE PyObject *__Pyx_DecompressString(
const char *
s, Py_ssize_t length,
int algo) {
13417#ifdef __Pyx_DecompressString_UNUSED
13418 CYTHON_UNUSED_VAR(
s);
13419 CYTHON_UNUSED_VAR(length);
13420 CYTHON_UNUSED_VAR(algo);
13423 PyObject *module = NULL, *decompress, *compressed_bytes, *decompressed;
13424 const char* module_name = algo == 3 ?
"compression.zstd" : algo == 2 ?
"bz2" :
"zlib";
13425 PyObject *methodname = PyUnicode_FromString(
"decompress");
13426 if (unlikely(!methodname))
return NULL;
13427 #if __PYX_LIMITED_VERSION_HEX >= 0x030e0000
13429 PyObject *fromlist = Py_BuildValue(
"[O]", methodname);
13430 if (unlikely(!fromlist))
goto bad;
13431 module = PyImport_ImportModuleLevel("compression.zstd", NULL, NULL, fromlist, 0);
13432 Py_DECREF(fromlist);
13435 module = PyImport_ImportModule(module_name);
13436 if (unlikely(!module))
goto import_failed;
13437 decompress = PyObject_GetAttr(module, methodname);
13438 if (unlikely(!decompress))
goto import_failed;
13441 char *memview_bytes =
const_cast<char*
>(
s);
13443 #if defined(__clang__)
13444 #pragma clang diagnostic push
13445 #pragma clang diagnostic ignored "-Wcast-qual"
13446 #elif !defined(__INTEL_COMPILER) && defined(__GNUC__)
13447 #pragma GCC diagnostic push
13448 #pragma GCC diagnostic ignored "-Wcast-qual"
13450 char *memview_bytes = (
char*)
s;
13451 #if defined(__clang__)
13452 #pragma clang diagnostic pop
13453 #elif !defined(__INTEL_COMPILER) && defined(__GNUC__)
13454 #pragma GCC diagnostic pop
13457 #if CYTHON_COMPILING_IN_LIMITED_API && !defined(PyBUF_READ)
13458 int memview_flags = 0x100;
13460 int memview_flags = PyBUF_READ;
13462 compressed_bytes = PyMemoryView_FromMemory(memview_bytes, length, memview_flags);
13464 if (unlikely(!compressed_bytes)) {
13465 Py_DECREF(decompress);
13468 decompressed = PyObject_CallFunctionObjArgs(decompress, compressed_bytes, NULL);
13469 Py_DECREF(compressed_bytes);
13470 Py_DECREF(decompress);
13472 Py_DECREF(methodname);
13473 return decompressed;
13475 PyErr_Format(PyExc_ImportError,
13476 "Failed to import '%.20s.decompress' - cannot initialise module strings. "
13477 "String compression was configured with the C macro 'CYTHON_COMPRESS_STRINGS=%d'.",
13478 module_name, algo);
13480 Py_XDECREF(module);
13481 Py_DECREF(methodname);
13487#ifndef __Pyx_DecompressString_LZSS_UNUSED
13489static CYTHON_SMALL_CODE
size_t __pyx_lzss_decompress(
const uint8_t* src, uint8_t* dst,
size_t dst_len) {
13490 size_t pos = 0, out_pos = 0;
13492 uint32_t flags = src[pos++] | 0xFF00;
13493 while (flags & 0x100) {
13495 dst[out_pos++] = src[pos++];
13497 uint32_t lo = src[pos++], hi = src[pos++];
13498 uint32_t end_offset_of_last_occurrence, match_length;
13499 if (!(lo & 0x80)) {
13500 end_offset_of_last_occurrence = lo;
13502 }
else if (!(hi & 0x80)) {
13503 end_offset_of_last_occurrence = 0x80 + (((hi << 2) & 0x180) | (lo & 0x7F));
13504 match_length = hi & 0x1F;
13506 end_offset_of_last_occurrence = 0x80 + ((hi & 0x7F) << 7 | (lo & 0x7F));
13507 match_length = src[pos++];
13510 size_t ref_pos = out_pos - end_offset_of_last_occurrence - match_length;
13511 memcpy(dst + out_pos, dst + ref_pos, match_length);
13512 out_pos += match_length;
13514 if (out_pos >= dst_len)
return pos;
13520static CYTHON_SMALL_CODE PyObject *__Pyx_DecompressString_LZSS(
const char *
s,
size_t compressed_length,
size_t uncompressed_length) {
13521#ifdef __Pyx_DecompressString_LZSS_UNUSED
13522 CYTHON_UNUSED_VAR(
s);
13523 CYTHON_UNUSED_VAR(compressed_length);
13524 CYTHON_UNUSED_VAR(uncompressed_length);
13528 unsigned char *result_data;
13530 result = PyBytes_FromStringAndSize(NULL, (Py_ssize_t) uncompressed_length);
13531 if (unlikely(!result))
return NULL;
13532 result_data = __Pyx_PyBytes_AsWritableUString(result);
13533 if (unlikely(!result_data))
goto bad;
13534 src_length = __pyx_lzss_decompress((
const uint8_t*)
s, result_data, uncompressed_length);
13535 if (unlikely(src_length != compressed_length))
goto decompression_failed;
13537decompression_failed:
13538 PyErr_SetString(PyExc_RuntimeError,
"LZSS string data decompression failed");
13546static CYTHON_INLINE Py_ssize_t __Pyx_ssize_strlen(
const char *
s) {
13547 size_t len = strlen(
s);
13548 if (unlikely(len > (
size_t) PY_SSIZE_T_MAX)) {
13549 PyErr_SetString(PyExc_OverflowError,
"byte string is too long");
13552 return (Py_ssize_t) len;
13554static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(
const char* c_str) {
13555 Py_ssize_t len = __Pyx_ssize_strlen(c_str);
13556 if (unlikely(len < 0))
return NULL;
13557 return __Pyx_PyUnicode_FromStringAndSize(c_str, len);
13559static CYTHON_INLINE PyObject* __Pyx_PyByteArray_FromString(
const char* c_str) {
13560 Py_ssize_t len = __Pyx_ssize_strlen(c_str);
13561 if (unlikely(len < 0))
return NULL;
13562 return PyByteArray_FromStringAndSize(c_str, len);
13564static CYTHON_INLINE
const char* __Pyx_PyObject_AsString(PyObject* o) {
13566 return __Pyx_PyObject_AsStringAndSize(o, &ignore);
13568#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_UTF8
13569static CYTHON_INLINE
const char* __Pyx_PyUnicode_AsStringAndSize(PyObject* o, Py_ssize_t *length) {
13570 if (unlikely(__Pyx_PyUnicode_READY(o) == -1))
return NULL;
13571#if CYTHON_COMPILING_IN_LIMITED_API
13573 const char* result;
13574 Py_ssize_t unicode_length;
13575 CYTHON_MAYBE_UNUSED_VAR(unicode_length);
13576 #if __PYX_LIMITED_VERSION_HEX < 0x030A0000
13577 if (unlikely(PyArg_Parse(o,
"s#", &result, length) < 0))
return NULL;
13579 result = PyUnicode_AsUTF8AndSize(o, length);
13581 #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
13582 unicode_length = PyUnicode_GetLength(o);
13583 if (unlikely(unicode_length < 0))
return NULL;
13584 if (unlikely(unicode_length != *length)) {
13585 PyUnicode_AsASCIIString(o);
13592#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
13593 if (likely(PyUnicode_IS_ASCII(o))) {
13594 *length = PyUnicode_GET_LENGTH(o);
13595 return PyUnicode_AsUTF8(o);
13597 PyUnicode_AsASCIIString(o);
13601 return PyUnicode_AsUTF8AndSize(o, length);
13606static CYTHON_INLINE
const char* __Pyx_PyObject_AsStringAndSize(PyObject* o, Py_ssize_t *length) {
13607#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_UTF8
13608 if (PyUnicode_Check(o)) {
13609 return __Pyx_PyUnicode_AsStringAndSize(o, length);
13612 if (PyByteArray_Check(o)) {
13613#if (CYTHON_ASSUME_SAFE_SIZE && CYTHON_ASSUME_SAFE_MACROS) || (CYTHON_COMPILING_IN_PYPY && (defined(PyByteArray_AS_STRING) && defined(PyByteArray_GET_SIZE)))
13614 *length = PyByteArray_GET_SIZE(o);
13615 return PyByteArray_AS_STRING(o);
13617 *length = PyByteArray_Size(o);
13618 if (*length == -1)
return NULL;
13619 return PyByteArray_AsString(o);
13624 int r = PyBytes_AsStringAndSize(o, &result, length);
13625 if (unlikely(
r < 0)) {
13632static CYTHON_INLINE
int __Pyx_PyObject_IsTrue(PyObject* x) {
13633 int is_true = x == Py_True;
13634 if (is_true | (x == Py_False) | (x == Py_None))
return is_true;
13635 else return PyObject_IsTrue(x);
13637static CYTHON_INLINE
int __Pyx_PyObject_IsTrueAndDecref(PyObject* x) {
13639 if (unlikely(!x))
return -1;
13640 retval = __Pyx_PyObject_IsTrue(x);
13644static PyObject* __Pyx_PyNumber_LongWrongResultType(PyObject* result) {
13645 __Pyx_TypeName result_type_name = __Pyx_PyType_GetFullyQualifiedName(Py_TYPE(result));
13646 #if CYTHON_COMPILING_IN_LIMITED_API && __PYX_LIMITED_VERSION_HEX < 0x030d0000
13647 if (unlikely(!result_type_name))
goto bad;
13649 if (PyLong_Check(result)) {
13650 if (PyErr_WarnFormat(PyExc_DeprecationWarning, 1,
13651 "__int__ returned non-int (type " __Pyx_FMT_TYPENAME
"). "
13652 "The ability to return an instance of a strict subclass of int is deprecated, "
13653 "and may be removed in a future version of Python.",
13654 result_type_name)) {
13655 __Pyx_DECREF_TypeName(result_type_name);
13658 __Pyx_DECREF_TypeName(result_type_name);
13661 PyErr_Format(PyExc_TypeError,
13662 "__int__ returned non-int (type " __Pyx_FMT_TYPENAME
")",
13664 __Pyx_DECREF_TypeName(result_type_name);
13669static CYTHON_INLINE PyObject* __Pyx_PyNumber_Long(PyObject* x) {
13670#if CYTHON_USE_TYPE_SLOTS
13671 PyNumberMethods *m;
13673 PyObject *res = NULL;
13674 if (likely(PyLong_Check(x)))
13675 return __Pyx_NewRef(x);
13676#if CYTHON_USE_TYPE_SLOTS
13677 m = Py_TYPE(x)->tp_as_number;
13678 if (likely(m && m->nb_int)) {
13679 res = m->nb_int(x);
13682 if (!PyBytes_CheckExact(x) && !PyUnicode_CheckExact(x)) {
13683 res = PyNumber_Long(x);
13687 if (unlikely(!PyLong_CheckExact(res))) {
13688 return __Pyx_PyNumber_LongWrongResultType(res);
13691 else if (!PyErr_Occurred()) {
13692 PyErr_SetString(PyExc_TypeError,
13693 "an integer is required");
13697static CYTHON_INLINE Py_ssize_t __Pyx_PyLong_AsSsize_t(PyObject* b) {
13698 #if CYTHON_USE_PYLONG_INTERNALS
13700 const Py_ssize_t size = __Pyx_PyLong_DigitCount(b);
13701 const int is_neg = __Pyx_PyLong_IsNeg(b);
13702 const digit* digits = __Pyx_PyLong_Digits(b);
13703 if (size == 0)
return 0;
13704 #if SIZEOF_SIZE_T * 8 > 1 * PyLong_SHIFT
13706 ival = (Py_ssize_t) (((
size_t)digits[0]));
13709 #if SIZEOF_SIZE_T * 8 > 2 * PyLong_SHIFT
13711 ival = (Py_ssize_t) (((((
size_t)digits[1]) << PyLong_SHIFT) | (
size_t)digits[0]));
13714 #if SIZEOF_SIZE_T * 8 > 3 * PyLong_SHIFT
13716 ival = (Py_ssize_t) (((((((
size_t)digits[2]) << PyLong_SHIFT) | (
size_t)digits[1]) << PyLong_SHIFT) | (
size_t)digits[0]));
13719 #if SIZEOF_SIZE_T * 8 > 4 * PyLong_SHIFT
13721 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]));
13724 return PyLong_AsSsize_t(b);
13725 return is_neg ? -ival : ival;
13727 return PyLong_AsSsize_t(b);
13730static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject* b) {
13731 if (likely(PyLong_Check(b))) {
13732 return __Pyx_PyLong_AsSsize_t(b);
13735 PyObject *x = PyNumber_Index(b);
13736 if (unlikely(!x))
return -1;
13737 ival = __Pyx_PyLong_AsSsize_t(x);
13742static CYTHON_INLINE Py_hash_t __Pyx_PyIndex_AsHash_t(PyObject* o) {
13743 if (
sizeof(Py_hash_t) ==
sizeof(Py_ssize_t)) {
13744 return (Py_hash_t) __Pyx_PyIndex_AsSsize_t(o);
13748 x = PyNumber_Index(o);
13750 ival = PyLong_AsLong(x);
13755static CYTHON_INLINE PyObject *__Pyx_Owned_Py_None(
int b) {
13756 CYTHON_UNUSED_VAR(b);
13757 return __Pyx_NewRef(Py_None);
13759static CYTHON_INLINE PyObject * __Pyx_PyBool_FromLong(
long b) {
13760 return __Pyx_NewRef(b ? Py_True: Py_False);
13762static CYTHON_INLINE PyObject * __Pyx_PyLong_FromSize_t(
size_t ival) {
13763 return PyLong_FromSize_t(ival);
13768#if CYTHON_PEP489_MULTI_PHASE_INIT && CYTHON_USE_MODULE_STATE
13769#ifndef CYTHON_MODULE_STATE_LOOKUP_THREAD_SAFE
13770#if (CYTHON_COMPILING_IN_LIMITED_API || PY_VERSION_HEX >= 0x030C0000)
13771 #define CYTHON_MODULE_STATE_LOOKUP_THREAD_SAFE 1
13773 #define CYTHON_MODULE_STATE_LOOKUP_THREAD_SAFE 0
13776#if CYTHON_MODULE_STATE_LOOKUP_THREAD_SAFE && !CYTHON_ATOMICS
13777#error "Module state with PEP489 requires atomics. Currently that's one of\
13778 C11, C++11, gcc atomic intrinsics or MSVC atomic intrinsics"
13780#if !CYTHON_MODULE_STATE_LOOKUP_THREAD_SAFE
13781#define __Pyx_ModuleStateLookup_Lock()
13782#define __Pyx_ModuleStateLookup_Unlock()
13783#elif !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX >= 0x030d0000
13784static PyMutex __Pyx_ModuleStateLookup_mutex = {0};
13785#define __Pyx_ModuleStateLookup_Lock() PyMutex_Lock(&__Pyx_ModuleStateLookup_mutex)
13786#define __Pyx_ModuleStateLookup_Unlock() PyMutex_Unlock(&__Pyx_ModuleStateLookup_mutex)
13787#elif defined(__cplusplus) && __cplusplus >= 201103L
13789static std::mutex __Pyx_ModuleStateLookup_mutex;
13790#define __Pyx_ModuleStateLookup_Lock() __Pyx_ModuleStateLookup_mutex.lock()
13791#define __Pyx_ModuleStateLookup_Unlock() __Pyx_ModuleStateLookup_mutex.unlock()
13792#elif defined(__STDC_VERSION__) && (__STDC_VERSION__ > 201112L) && !defined(__STDC_NO_THREADS__)
13793#include <threads.h>
13794static mtx_t __Pyx_ModuleStateLookup_mutex;
13795static once_flag __Pyx_ModuleStateLookup_mutex_once_flag = ONCE_FLAG_INIT;
13796static void __Pyx_ModuleStateLookup_initialize_mutex(
void) {
13797 mtx_init(&__Pyx_ModuleStateLookup_mutex, mtx_plain);
13799#define __Pyx_ModuleStateLookup_Lock()\
13800 call_once(&__Pyx_ModuleStateLookup_mutex_once_flag, __Pyx_ModuleStateLookup_initialize_mutex);\
13801 mtx_lock(&__Pyx_ModuleStateLookup_mutex)
13802#define __Pyx_ModuleStateLookup_Unlock() mtx_unlock(&__Pyx_ModuleStateLookup_mutex)
13803#elif defined(HAVE_PTHREAD_H)
13804#include <pthread.h>
13805static pthread_mutex_t __Pyx_ModuleStateLookup_mutex = PTHREAD_MUTEX_INITIALIZER;
13806#define __Pyx_ModuleStateLookup_Lock() pthread_mutex_lock(&__Pyx_ModuleStateLookup_mutex)
13807#define __Pyx_ModuleStateLookup_Unlock() pthread_mutex_unlock(&__Pyx_ModuleStateLookup_mutex)
13808#elif defined(_WIN32)
13809#include <Windows.h>
13810static SRWLOCK __Pyx_ModuleStateLookup_mutex = SRWLOCK_INIT;
13811#define __Pyx_ModuleStateLookup_Lock() AcquireSRWLockExclusive(&__Pyx_ModuleStateLookup_mutex)
13812#define __Pyx_ModuleStateLookup_Unlock() ReleaseSRWLockExclusive(&__Pyx_ModuleStateLookup_mutex)
13814#error "No suitable lock available for CYTHON_MODULE_STATE_LOOKUP_THREAD_SAFE.\
13815 Requires C standard >= C11, or C++ standard >= C++11,\
13816 or pthreads, or the Windows 32 API, or Python >= 3.13."
13821} __Pyx_InterpreterIdAndModule;
13823 char interpreter_id_as_index;
13825 Py_ssize_t allocated;
13826 __Pyx_InterpreterIdAndModule table[1];
13827} __Pyx_ModuleStateLookupData;
13828#define __PYX_MODULE_STATE_LOOKUP_SMALL_SIZE 32
13829#if CYTHON_MODULE_STATE_LOOKUP_THREAD_SAFE
13830static __pyx_atomic_int_type __Pyx_ModuleStateLookup_read_counter = 0;
13832#if CYTHON_MODULE_STATE_LOOKUP_THREAD_SAFE
13833static __pyx_atomic_ptr_type __Pyx_ModuleStateLookup_data = 0;
13835static __Pyx_ModuleStateLookupData* __Pyx_ModuleStateLookup_data = NULL;
13837static __Pyx_InterpreterIdAndModule* __Pyx_State_FindModuleStateLookupTableLowerBound(
13838 __Pyx_InterpreterIdAndModule* table,
13840 int64_t interpreterId) {
13841 __Pyx_InterpreterIdAndModule* begin = table;
13842 __Pyx_InterpreterIdAndModule* end = begin + count;
13843 if (begin->id == interpreterId) {
13846 while ((end - begin) > __PYX_MODULE_STATE_LOOKUP_SMALL_SIZE) {
13847 __Pyx_InterpreterIdAndModule* halfway = begin + (end - begin)/2;
13848 if (halfway->id == interpreterId) {
13851 if (halfway->id < interpreterId) {
13857 for (; begin < end; ++begin) {
13858 if (begin->id >= interpreterId)
return begin;
13862static PyObject *__Pyx_State_FindModule(CYTHON_UNUSED
void* dummy) {
13863 int64_t interpreter_id = PyInterpreterState_GetID(PyInterpreterState_Get());
13864 if (interpreter_id == -1)
return NULL;
13865#if CYTHON_MODULE_STATE_LOOKUP_THREAD_SAFE
13866 __Pyx_ModuleStateLookupData* data = (__Pyx_ModuleStateLookupData*)__pyx_atomic_pointer_load_relaxed(&__Pyx_ModuleStateLookup_data);
13868 __pyx_atomic_incr_acq_rel(&__Pyx_ModuleStateLookup_read_counter);
13869 if (likely(data)) {
13870 __Pyx_ModuleStateLookupData* new_data = (__Pyx_ModuleStateLookupData*)__pyx_atomic_pointer_load_acquire(&__Pyx_ModuleStateLookup_data);
13871 if (likely(data == new_data)) {
13872 goto read_finished;
13875 __pyx_atomic_decr_acq_rel(&__Pyx_ModuleStateLookup_read_counter);
13876 __Pyx_ModuleStateLookup_Lock();
13877 __pyx_atomic_incr_relaxed(&__Pyx_ModuleStateLookup_read_counter);
13878 data = (__Pyx_ModuleStateLookupData*)__pyx_atomic_pointer_load_relaxed(&__Pyx_ModuleStateLookup_data);
13879 __Pyx_ModuleStateLookup_Unlock();
13883 __Pyx_ModuleStateLookupData* data = __Pyx_ModuleStateLookup_data;
13885 __Pyx_InterpreterIdAndModule* found = NULL;
13886 if (unlikely(!data))
goto end;
13887 if (data->interpreter_id_as_index) {
13888 if (interpreter_id < data->count) {
13889 found = data->table+interpreter_id;
13892 found = __Pyx_State_FindModuleStateLookupTableLowerBound(
13893 data->table, data->count, interpreter_id);
13897 PyObject *result=NULL;
13898 if (found && found->id == interpreter_id) {
13899 result = found->module;
13901#if CYTHON_MODULE_STATE_LOOKUP_THREAD_SAFE
13902 __pyx_atomic_decr_acq_rel(&__Pyx_ModuleStateLookup_read_counter);
13907#if CYTHON_MODULE_STATE_LOOKUP_THREAD_SAFE
13908static void __Pyx_ModuleStateLookup_wait_until_no_readers(
void) {
13909 while (__pyx_atomic_load(&__Pyx_ModuleStateLookup_read_counter) != 0);
13912#define __Pyx_ModuleStateLookup_wait_until_no_readers()
13914static int __Pyx_State_AddModuleInterpIdAsIndex(__Pyx_ModuleStateLookupData **old_data, PyObject* module, int64_t interpreter_id) {
13915 Py_ssize_t to_allocate = (*old_data)->allocated;
13916 while (to_allocate <= interpreter_id) {
13917 if (to_allocate == 0) to_allocate = 1;
13918 else to_allocate *= 2;
13920 __Pyx_ModuleStateLookupData *new_data = *old_data;
13921 if (to_allocate != (*old_data)->allocated) {
13922 new_data = (__Pyx_ModuleStateLookupData *)realloc(
13924 sizeof(__Pyx_ModuleStateLookupData)+(to_allocate-1)*
sizeof(__Pyx_InterpreterIdAndModule));
13929 for (Py_ssize_t i = new_data->allocated; i < to_allocate; ++i) {
13930 new_data->table[i].id = i;
13931 new_data->table[i].module = NULL;
13933 new_data->allocated = to_allocate;
13935 new_data->table[interpreter_id].module =
module;
13936 if (new_data->count < interpreter_id+1) {
13937 new_data->count = interpreter_id+1;
13939 *old_data = new_data;
13942static void __Pyx_State_ConvertFromInterpIdAsIndex(__Pyx_ModuleStateLookupData *data) {
13943 __Pyx_InterpreterIdAndModule *read = data->table;
13944 __Pyx_InterpreterIdAndModule *write = data->table;
13945 __Pyx_InterpreterIdAndModule *end = read + data->count;
13946 for (; read<end; ++read) {
13947 if (read->module) {
13948 write->id = read->id;
13949 write->module = read->module;
13953 data->count = write - data->table;
13954 for (; write<end; ++write) {
13956 write->module = NULL;
13958 data->interpreter_id_as_index = 0;
13960static int __Pyx_State_AddModule(PyObject* module, CYTHON_UNUSED
void* dummy) {
13961 int64_t interpreter_id = PyInterpreterState_GetID(PyInterpreterState_Get());
13962 if (interpreter_id == -1)
return -1;
13964 __Pyx_ModuleStateLookup_Lock();
13965#if CYTHON_MODULE_STATE_LOOKUP_THREAD_SAFE
13966 __Pyx_ModuleStateLookupData *old_data = (__Pyx_ModuleStateLookupData *)
13967 __pyx_atomic_pointer_exchange(&__Pyx_ModuleStateLookup_data, 0);
13969 __Pyx_ModuleStateLookupData *old_data = __Pyx_ModuleStateLookup_data;
13971 __Pyx_ModuleStateLookupData *new_data = old_data;
13973 new_data = (__Pyx_ModuleStateLookupData *)calloc(1,
sizeof(__Pyx_ModuleStateLookupData));
13979 new_data->allocated = 1;
13980 new_data->interpreter_id_as_index = 1;
13982 __Pyx_ModuleStateLookup_wait_until_no_readers();
13983 if (new_data->interpreter_id_as_index) {
13984 if (interpreter_id < __PYX_MODULE_STATE_LOOKUP_SMALL_SIZE) {
13985 result = __Pyx_State_AddModuleInterpIdAsIndex(&new_data, module, interpreter_id);
13988 __Pyx_State_ConvertFromInterpIdAsIndex(new_data);
13991 Py_ssize_t insert_at = 0;
13993 __Pyx_InterpreterIdAndModule* lower_bound = __Pyx_State_FindModuleStateLookupTableLowerBound(
13994 new_data->table, new_data->count, interpreter_id);
13995 assert(lower_bound);
13996 insert_at = lower_bound - new_data->table;
13997 if (unlikely(insert_at < new_data->count && lower_bound->id == interpreter_id)) {
13998 lower_bound->module =
module;
14002 if (new_data->count+1 >= new_data->allocated) {
14003 Py_ssize_t to_allocate = (new_data->count+1)*2;
14005 (__Pyx_ModuleStateLookupData*)realloc(
14007 sizeof(__Pyx_ModuleStateLookupData) +
14008 (to_allocate-1)*
sizeof(__Pyx_InterpreterIdAndModule));
14011 new_data = old_data;
14015 new_data->allocated = to_allocate;
14018 int64_t last_id = interpreter_id;
14019 PyObject *last_module =
module;
14020 for (Py_ssize_t i=insert_at; i<new_data->count; ++i) {
14021 int64_t current_id = new_data->table[i].id;
14022 new_data->table[i].id = last_id;
14023 last_id = current_id;
14024 PyObject *current_module = new_data->table[i].module;
14025 new_data->table[i].module = last_module;
14026 last_module = current_module;
14030#if CYTHON_MODULE_STATE_LOOKUP_THREAD_SAFE
14031 __pyx_atomic_pointer_exchange(&__Pyx_ModuleStateLookup_data, new_data);
14033 __Pyx_ModuleStateLookup_data = new_data;
14035 __Pyx_ModuleStateLookup_Unlock();
14038static int __Pyx_State_RemoveModule(CYTHON_UNUSED
void* dummy) {
14039 int64_t interpreter_id = PyInterpreterState_GetID(PyInterpreterState_Get());
14040 if (interpreter_id == -1)
return -1;
14041 __Pyx_ModuleStateLookup_Lock();
14042#if CYTHON_MODULE_STATE_LOOKUP_THREAD_SAFE
14043 __Pyx_ModuleStateLookupData *data = (__Pyx_ModuleStateLookupData *)
14044 __pyx_atomic_pointer_exchange(&__Pyx_ModuleStateLookup_data, 0);
14046 __Pyx_ModuleStateLookupData *data = __Pyx_ModuleStateLookup_data;
14048 if (data->interpreter_id_as_index) {
14049 if (interpreter_id < data->count) {
14050 data->table[interpreter_id].module = NULL;
14055 __Pyx_ModuleStateLookup_wait_until_no_readers();
14056 __Pyx_InterpreterIdAndModule* lower_bound = __Pyx_State_FindModuleStateLookupTableLowerBound(
14057 data->table, data->count, interpreter_id);
14058 if (!lower_bound)
goto done;
14059 if (lower_bound->id != interpreter_id)
goto done;
14060 __Pyx_InterpreterIdAndModule *end = data->table+data->count;
14061 for (;lower_bound<end-1; ++lower_bound) {
14062 lower_bound->id = (lower_bound+1)->
id;
14063 lower_bound->module = (lower_bound+1)->module;
14067 if (data->count == 0) {
14072#if CYTHON_MODULE_STATE_LOOKUP_THREAD_SAFE
14073 __pyx_atomic_pointer_exchange(&__Pyx_ModuleStateLookup_data, data);
14075 __Pyx_ModuleStateLookup_data = data;
14077 __Pyx_ModuleStateLookup_Unlock();
14084#pragma warning( pop )
void calculateNumericalDiffusionJaffre(int nElements_global, int nQuadraturePoints_element, int nSpace, double shockCapturingDiffusion, double beta, double *elementDiameter, double *strong_residual, double *grad_u, double *numDiff)
void calculateNumericalDiffusionEikonal(int nElements_global, int nQuadraturePoints_element, double shockCapturingDiffusion, double *elementDiameter, double *strong_residual, double *numDiff)
void calculateNumericalDiffusionResGradQuad(int nElements_global, int nQuadraturePoints_element, int nSpace, double shockCapturingDiffusion, double *elementDiameter, double *strong_residual, double *grad_u, double *numDiff)
void calculateNumericalDiffusionHJV2(int nElements_global, int nQuadraturePoints_element, char shockCapturing, double shockCapturingDiffusion, double *elementDiameter, double *strong_residual, double *mt, double *H, double *numDiff)
Calculate the shock capturing diffusion for a Hamilton-Jacobi equation at the quadrature points mwf t...
void calculateNumericalDiffusionResGradJuanes(int nElements_global, int nQuadraturePoints_element, int nSpace, double shockCapturingDiffusion, double uSC, double *elementDiameter, double *strong_residual, double *grad_u, double *numDiff)
void calculateNumericalDiffusionResGrad(int nElements_global, int nQuadraturePoints_element, int nSpace, double shockCapturingDiffusion, double *elementDiameter, double *strong_residual, double *grad_u, double *numDiff)
void calculateNumericalDiffusionHJ(int nElements_global, int nQuadraturePoints_element, char shockCapturing, double shockCapturingDiffusion, double *elementDiameter, double *strong_residual, double *mt, double *H, double *numDiff)
Calculate the shock capturing diffusion for a Hamilton-Jacobi equation at the quadrature points.
void calculateNumericalDiffusion_A_1(int nElements_global, int nQuadraturePoints_element, int nSpace, double shockCapturingFactor, double *elementDiameter, double *strong_residual, double *mt, double *df, double *numDiff)
C implementations of shock capturing diffusion calculations.