proteus 1.9.0
C/C++/Fortran libraries
Loading...
Searching...
No Matches
cshockCapturing.c
Go to the documentation of this file.
1/* Generated by Cython 3.3.0 */
2
3/* BEGIN: Cython Metadata
4{
5 "distutils": {
6 "depends": [
7 "/work/cekees/miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/_core/include/numpy/arrayobject.h",
8 "/work/cekees/miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/_core/include/numpy/arrayscalars.h",
9 "/work/cekees/miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/_core/include/numpy/ndarrayobject.h",
10 "/work/cekees/miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/_core/include/numpy/ndarraytypes.h",
11 "/work/cekees/miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/_core/include/numpy/ufuncobject.h",
12 "proteus/shockCapturing.h"
13 ],
14 "extra_compile_args": [
15 "-Wall",
16 "-DF77_POST_UNDERSCORE",
17 "-DUSE_BLAS",
18 "-DCMRVEC_BOUNDS_CHECK",
19 "-DMV_VECTOR_BOUNDS_CHECK",
20 "-DPETSC_INCLUDE_AS_C",
21 "-DPETSC_SKIP_COMPLEX"
22 ],
23 "extra_link_args": [
24 "-Wl,-rpath,/work/cekees/miniforge3/envs/proteus-jupyterhub/lib",
25 "-Wl,-rpath,/work/cekees/miniforge3/envs/proteus-jupyterhub/lib",
26 "-Wl,-rpath,/work/cekees/miniforge3/envs/proteus-jupyterhub/lib",
27 "-Wl,-rpath,/work/cekees/miniforge3/envs/proteus-jupyterhub/lib",
28 "-Wl,-rpath,/work/cekees/miniforge3/envs/proteus-jupyterhub/lib",
29 "-Wl,-rpath,/work/cekees/miniforge3/envs/proteus-jupyterhub/lib",
30 "-Wl,-rpath,/work/cekees/miniforge3/envs/proteus-jupyterhub/lib",
31 "-Wl,-rpath,/work/cekees/miniforge3/envs/proteus-jupyterhub/lib"
32 ],
33 "include_dirs": [
34 "proteus",
35 "/work/cekees/miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/_core/include"
36 ],
37 "language": "c",
38 "libraries": [
39 "m"
40 ],
41 "name": "cshockCapturing",
42 "sources": [
43 "proteus/cshockCapturing.pyx",
44 "proteus/shockCapturing.c"
45 ]
46 },
47 "module_name": "cshockCapturing"
48}
49END: Cython Metadata */
50
51#ifndef PY_SSIZE_T_CLEAN
52#define PY_SSIZE_T_CLEAN
53#endif /* PY_SSIZE_T_CLEAN */
54/* InitLimitedAPI */
55#if defined(Py_LIMITED_API)
56 #if !defined(CYTHON_LIMITED_API)
57 #define CYTHON_LIMITED_API 1
58 #endif
59#elif defined(CYTHON_LIMITED_API)
60 #ifdef _MSC_VER
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.")
62 #else
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.
64 #endif
65#endif
66
67#include "Python.h"
68#ifndef Py_PYTHON_H
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.
74#else
75#define __PYX_ABI_VERSION "3_3_0"
76#define CYTHON_HEX_VERSION 0x030300F0
77#define CYTHON_FUTURE_DIVISION 1
78/* CModulePreamble */
79#include <stddef.h>
80#ifndef offsetof
81 #define offsetof(type, member) ( (size_t) & ((type*)0) -> member )
82#endif
83#if !defined(_WIN32) && !defined(WIN32) && !defined(MS_WINDOWS)
84 #ifndef __stdcall
85 #define __stdcall
86 #endif
87 #ifndef __cdecl
88 #define __cdecl
89 #endif
90 #ifndef __fastcall
91 #define __fastcall
92 #endif
93#endif
94#ifdef __has_builtin
95 #define __Pyx_has_cbuiltin(name) __has_builtin(name)
96#else
97 #define __Pyx_has_cbuiltin(name) (0)
98#endif
99#ifndef DL_IMPORT
100 #define DL_IMPORT(t) t
101#endif
102#ifndef DL_EXPORT
103 #define DL_EXPORT(t) t
104#endif
105#define __PYX_COMMA ,
106#ifndef PY_LONG_LONG
107 #define PY_LONG_LONG LONG_LONG
108#endif
109#ifndef Py_HUGE_VAL
110 #define Py_HUGE_VAL HUGE_VAL
111#endif
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."
119 #endif
120 #endif
121 #if defined(GRAALVM_PYTHON) || defined(PYPY_VERSION)
122 #ifdef _MSC_VER
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.")
125 #else
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."
128 #endif
129 #endif
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
147 #endif
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
152 #endif
153 #ifndef CYTHON_AVOID_THREAD_UNSAFE_BORROWED_REFS
154 #define CYTHON_AVOID_THREAD_UNSAFE_BORROWED_REFS 0
155 #endif
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)
170 #endif
171 #ifndef CYTHON_PEP487_INIT_SUBCLASS
172 #define CYTHON_PEP487_INIT_SUBCLASS 1
173 #endif
174 #ifndef CYTHON_PEP489_MULTI_PHASE_INIT
175 #define CYTHON_PEP489_MULTI_PHASE_INIT 1
176 #endif
177 #ifndef CYTHON_USE_MODULE_STATE
178 #define CYTHON_USE_MODULE_STATE 0
179 #endif
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)
184 #endif
185 #ifndef CYTHON_USE_AM_SEND
186 #define CYTHON_USE_AM_SEND (__PYX_LIMITED_VERSION_HEX >= 0x030A0000)
187 #endif
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
194 #endif
195 #ifndef CYTHON_USE_OWN_PREP_RERAISE_STAR
196 #define CYTHON_USE_OWN_PREP_RERAISE_STAR 1
197 #endif
198 #ifndef CYTHON_USE_FREELISTS
199 #define CYTHON_USE_FREELISTS 1
200 #endif
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)
208 #endif
209#elif defined(GRAALVM_PYTHON)
210 /* For very preliminary testing purposes. Most variables are set the same as PyPy.
211 The existence of this section does not imply that anything works or is even tested */
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
219 #endif
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
248 #endif
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
254 #endif
255 #ifndef CYTHON_PEP487_INIT_SUBCLASS
256 #define CYTHON_PEP487_INIT_SUBCLASS 1
257 #endif
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
274 #endif
275 #ifndef CYTHON_USE_OWN_PREP_RERAISE_STAR
276 #define CYTHON_USE_OWN_PREP_RERAISE_STAR 1
277 #endif
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
294 #endif
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
313 #endif
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
322 #endif
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)
328 #endif
329 #ifndef CYTHON_PEP487_INIT_SUBCLASS
330 #define CYTHON_PEP487_INIT_SUBCLASS 1
331 #endif
332 #ifndef CYTHON_PEP489_MULTI_PHASE_INIT
333 #define CYTHON_PEP489_MULTI_PHASE_INIT 1
334 #endif
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)
341 #endif
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)
350 #endif
351 #ifndef CYTHON_USE_OWN_PREP_RERAISE_STAR
352 #define CYTHON_USE_OWN_PREP_RERAISE_STAR 1
353 #endif
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
360#else
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
367 #else
368 #define CYTHON_COMPILING_IN_CPYTHON_FREETHREADING 0
369 #endif
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
375 #endif
376 #ifndef CYTHON_USE_TYPE_SPECS
377 #define CYTHON_USE_TYPE_SPECS 0
378 #endif
379 #ifndef CYTHON_USE_PYTYPE_LOOKUP
380 #define CYTHON_USE_PYTYPE_LOOKUP 1
381 #endif
382 #ifndef CYTHON_USE_PYLONG_INTERNALS
383 #define CYTHON_USE_PYLONG_INTERNALS 1
384 #endif
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
390 #endif
391 #ifndef CYTHON_USE_UNICODE_INTERNALS
392 #define CYTHON_USE_UNICODE_INTERNALS 1
393 #endif
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
399 #endif
400 #ifndef CYTHON_AVOID_BORROWED_REFS
401 #define CYTHON_AVOID_BORROWED_REFS 0
402 #endif
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
408 #endif
409 #ifndef CYTHON_ASSUME_SAFE_MACROS
410 #define CYTHON_ASSUME_SAFE_MACROS 1
411 #endif
412 #ifndef CYTHON_ASSUME_SAFE_SIZE
413 #define CYTHON_ASSUME_SAFE_SIZE 1
414 #endif
415 #ifndef CYTHON_UNPACK_METHODS
416 #define CYTHON_UNPACK_METHODS 1
417 #endif
418 #ifndef CYTHON_FAST_THREAD_STATE
419 #define CYTHON_FAST_THREAD_STATE 1
420 #endif
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)
426 #endif
427 #ifndef CYTHON_VECTORCALL
428 #define CYTHON_VECTORCALL 1
429 #endif
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
435 #endif
436 #ifndef CYTHON_PEP487_INIT_SUBCLASS
437 #define CYTHON_PEP487_INIT_SUBCLASS 1
438 #endif
439 #ifndef CYTHON_PEP489_MULTI_PHASE_INIT
440 #define CYTHON_PEP489_MULTI_PHASE_INIT 1
441 #endif
442 #ifndef CYTHON_USE_MODULE_STATE
443 #define CYTHON_USE_MODULE_STATE 0
444 #endif
445 #ifndef CYTHON_USE_SYS_MONITORING
446 #define CYTHON_USE_SYS_MONITORING (PY_VERSION_HEX >= 0x030d00B1)
447 #endif
448 #ifndef CYTHON_USE_TP_FINALIZE
449 #define CYTHON_USE_TP_FINALIZE 1
450 #endif
451 #ifndef CYTHON_USE_AM_SEND
452 #define CYTHON_USE_AM_SEND 1
453 #endif
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)
459 #endif
460 #ifndef CYTHON_USE_EXC_INFO_STACK
461 #define CYTHON_USE_EXC_INFO_STACK 1
462 #endif
463 #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC
464 #define CYTHON_UPDATE_DESCRIPTOR_DOC 1
465 #endif
466 #ifndef CYTHON_USE_OWN_PREP_RERAISE_STAR
467 #define CYTHON_USE_OWN_PREP_RERAISE_STAR (PY_VERSION_HEX < 0x030C00B2)
468 #endif
469 #ifndef CYTHON_USE_FREELISTS
470 #define CYTHON_USE_FREELISTS (!CYTHON_COMPILING_IN_CPYTHON_FREETHREADING)
471 #endif
472 #if defined(CYTHON_IMMORTAL_CONSTANTS) && PY_VERSION_HEX < 0x030C0000
473 #undef CYTHON_IMMORTAL_CONSTANTS
474 #define CYTHON_IMMORTAL_CONSTANTS 0 // definitely won't work
475 #elif !defined(CYTHON_IMMORTAL_CONSTANTS)
476 #define CYTHON_IMMORTAL_CONSTANTS (PY_VERSION_HEX >= 0x030C0000 && !CYTHON_USE_MODULE_STATE && CYTHON_COMPILING_IN_CPYTHON_FREETHREADING)
477 #endif
478 #ifndef CYTHON_OPAQUE_OBJECTS
479 #define CYTHON_OPAQUE_OBJECTS 0
480 #endif
481#endif
482#if CYTHON_USE_PYLONG_INTERNALS
483 #undef SHIFT
484 #undef BASE
485 #undef MASK
486 #ifdef SIZEOF_VOID_P
487 enum { __pyx_check_sizeof_voidp = 1 / (int)(SIZEOF_VOID_P == sizeof(void*)) };
488 #endif
489#endif
490#ifndef __has_attribute
491 #define __has_attribute(x) 0
492#endif
493#ifndef __has_cpp_attribute
494 #define __has_cpp_attribute(x) 0
495#endif
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
503 #else
504 #define CYTHON_RESTRICT
505 #endif
506#endif
507#ifndef CYTHON_UNUSED
508 #if defined(__cplusplus)
509 /* for clang __has_cpp_attribute(maybe_unused) is true even before C++17
510 * but leads to warnings with -pedantic, since it is a C++17 feature */
511 #if ((defined(_MSVC_LANG) && _MSVC_LANG >= 201703L) || __cplusplus >= 201703L)
512 #if __has_cpp_attribute(maybe_unused)
513 #define CYTHON_UNUSED [[maybe_unused]]
514 #endif
515 #endif
516 #elif defined(__STDC_VERSION__) && __STDC_VERSION__ >= 202311L
517 #define CYTHON_UNUSED [[maybe_unused]]
518 #endif
519#endif
520#ifndef CYTHON_UNUSED
521# if defined(__GNUC__)
522# if !(defined(__cplusplus)) || (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4))
523# define CYTHON_UNUSED __attribute__ ((__unused__))
524# else
525# define CYTHON_UNUSED
526# endif
527# elif defined(__ICC) || (defined(__INTEL_COMPILER) && !defined(_MSC_VER))
528# define CYTHON_UNUSED __attribute__ ((__unused__))
529# else
530# define CYTHON_UNUSED
531# endif
532#endif
533#ifndef CYTHON_UNUSED_VAR
534# if defined(__cplusplus)
535 template<class T> void CYTHON_UNUSED_VAR( const T& ) { }
536# else
537# define CYTHON_UNUSED_VAR(x) (void)(x)
538# endif
539#endif
540#ifndef CYTHON_MAYBE_UNUSED_VAR
541 #define CYTHON_MAYBE_UNUSED_VAR(x) CYTHON_UNUSED_VAR(x)
542#endif
543#ifndef CYTHON_NCP_UNUSED
544# if CYTHON_COMPILING_IN_CPYTHON && !CYTHON_COMPILING_IN_CPYTHON_FREETHREADING
545# define CYTHON_NCP_UNUSED
546# else
547# define CYTHON_NCP_UNUSED CYTHON_UNUSED
548# endif
549#endif
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
554 #else
555 #define CYTHON_USE_CPP_STD_MOVE 0
556 #endif
557#endif
558#define __Pyx_void_to_None(void_result) ((void)(void_result), Py_INCREF(Py_None), Py_None)
559#include <stdint.h>
560typedef uintptr_t __pyx_uintptr_t;
561#ifndef CYTHON_FALLTHROUGH
562 #if defined(__cplusplus)
563 /* for clang __has_cpp_attribute(fallthrough) is true even before C++17
564 * but leads to warnings with -pedantic, since it is a C++17 feature */
565 #if ((defined(_MSVC_LANG) && _MSVC_LANG >= 201703L) || __cplusplus >= 201703L)
566 #if __has_cpp_attribute(fallthrough)
567 #define CYTHON_FALLTHROUGH [[fallthrough]]
568 #endif
569 #endif
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]]
575 #endif
576 #endif
577 #endif
578 #ifndef CYTHON_FALLTHROUGH
579 #if __has_attribute(fallthrough)
580 #define CYTHON_FALLTHROUGH __attribute__((fallthrough))
581 #else
582 #define CYTHON_FALLTHROUGH
583 #endif
584 #endif
585 #if defined(__clang__) && defined(__apple_build_version__)
586 #if __apple_build_version__ < 7000000
587 #undef CYTHON_FALLTHROUGH
588 #define CYTHON_FALLTHROUGH
589 #endif
590 #endif
591#endif
592#ifdef Py_UNREACHABLE
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)
600#else
601 #define __Pyx_UNREACHABLE() Py_FatalError("Unreachable C code path reached")
602#endif
603#ifndef Py_UNREACHABLE
604 #define Py_UNREACHABLE() __Pyx_UNREACHABLE()
605#endif
606#ifdef __cplusplus
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)
610#else
611 #define __PYX_IS_UNSIGNED(type) (((type)-1) > 0)
612#endif
613#if CYTHON_COMPILING_IN_PYPY == 1
614 #define __PYX_NEED_TP_PRINT_SLOT (PY_VERSION_HEX < 0x030A0000)
615#else
616 #define __PYX_NEED_TP_PRINT_SLOT 0
617#endif
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)
622#else
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)
625#endif
626
627/* CInitCode */
628#ifndef CYTHON_INLINE
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
637 #else
638 #define CYTHON_INLINE
639 #endif
640#endif
641
642/* PythonCompatibility */
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
648 #ifndef CO_OPTIMIZED
649 static int CO_OPTIMIZED;
650 #endif
651 #ifndef CO_NEWLOCALS
652 static int CO_NEWLOCALS;
653 #endif
654 #ifndef CO_VARARGS
655 static int CO_VARARGS;
656 #endif
657 #ifndef CO_VARKEYWORDS
658 static int CO_VARKEYWORDS;
659 #endif
660 #ifndef CO_ASYNC_GENERATOR
661 static int CO_ASYNC_GENERATOR;
662 #endif
663 #ifndef CO_GENERATOR
664 static int CO_GENERATOR;
665 #endif
666 #ifndef CO_COROUTINE
667 static int CO_COROUTINE;
668 #endif
669#else
670 #ifndef CO_COROUTINE
671 #define CO_COROUTINE 0x80
672 #endif
673 #ifndef CO_ASYNC_GENERATOR
674 #define CO_ASYNC_GENERATOR 0x200
675 #endif
676#endif
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)
680#else
681 #define __Pyx_Py_Is(x, y) ((x) == (y))
682#endif
683#if PY_VERSION_HEX >= 0x030A00B1 || defined(Py_IsNone)
684 #define __Pyx_Py_IsNone(ob) Py_IsNone(ob)
685#else
686 #define __Pyx_Py_IsNone(ob) __Pyx_Py_Is((ob), Py_None)
687#endif
688#if PY_VERSION_HEX >= 0x030A00B1 || defined(Py_IsTrue)
689 #define __Pyx_Py_IsTrue(ob) Py_IsTrue(ob)
690#else
691 #define __Pyx_Py_IsTrue(ob) __Pyx_Py_Is((ob), Py_True)
692#endif
693#if PY_VERSION_HEX >= 0x030A00B1 || defined(Py_IsFalse)
694 #define __Pyx_Py_IsFalse(ob) Py_IsFalse(ob)
695#else
696 #define __Pyx_Py_IsFalse(ob) __Pyx_Py_Is((ob), Py_False)
697#endif
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)
701#else
702 #define __Pyx_PyObject_GC_IsFinalized(o) PyObject_GC_IsFinalized(o)
703#endif
704#if CYTHON_COMPILING_IN_LIMITED_API
705static unsigned long __Pyx_Runtime_TPFLAGS_SEQUENCE;
706static unsigned long __Pyx_Runtime_TPFLAGS_MAPPING;
707#else
708#define __Pyx_Runtime_TPFLAGS_SEQUENCE Py_TPFLAGS_SEQUENCE
709#define __Pyx_Runtime_TPFLAGS_MAPPING Py_TPFLAGS_MAPPING
710#endif
711static int __Pyx_init_tpflags_variables(void);
712#ifndef Py_TPFLAGS_HAVE_FINALIZE
713 #define Py_TPFLAGS_HAVE_FINALIZE 0
714#endif
715#ifndef Py_TPFLAGS_SEQUENCE
716 #define Py_TPFLAGS_SEQUENCE (CYTHON_COMPILING_IN_LIMITED_API ? 0 : 1 << 5)
717#endif
718#ifndef Py_TPFLAGS_MAPPING
719 #define Py_TPFLAGS_MAPPING (CYTHON_COMPILING_IN_LIMITED_API ? 0 : 1 << 6)
720#endif
721#ifndef Py_TPFLAGS_IMMUTABLETYPE
722 #define Py_TPFLAGS_IMMUTABLETYPE (1UL << 8)
723#endif
724#ifndef Py_TPFLAGS_DISALLOW_INSTANTIATION
725 #define Py_TPFLAGS_DISALLOW_INSTANTIATION (1UL << 7)
726#endif
727#ifndef METH_STACKLESS
728 #define METH_STACKLESS 0
729#endif
730#if !defined(METH_FASTCALL) || CYTHON_COMPILING_IN_PYPY
731 #ifndef METH_FASTCALL
732 #define METH_FASTCALL 0x80
733 #endif
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);
737#else
738 #if PY_VERSION_HEX >= 0x030d00A4
739 # define __Pyx_PyCFunctionFast PyCFunctionFast
740 # define __Pyx_PyCFunctionFastWithKeywords PyCFunctionFastWithKeywords
741 #else
742 # define __Pyx_PyCFunctionFast _PyCFunctionFast
743 # define __Pyx_PyCFunctionFastWithKeywords _PyCFunctionFastWithKeywords
744 #endif
745#endif
746#if CYTHON_VECTORCALL
747 #define __Pyx_METH_FASTCALL METH_FASTCALL
748 #define __Pyx_PyCFunction_FastCall __Pyx_PyCFunctionFast
749 #define __Pyx_PyCFunction_FastCallWithKeywords __Pyx_PyCFunctionFastWithKeywords
750#else
751 #define __Pyx_METH_FASTCALL METH_VARARGS
752 #define __Pyx_PyCFunction_FastCall PyCFunction
753 #define __Pyx_PyCFunction_FastCallWithKeywords PyCFunctionWithKeywords
754#endif
755#if CYTHON_VECTORCALL
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))
759#else
760 #define __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET 0
761 #define __Pyx_PyVectorcall_NARGS(n) ((Py_ssize_t)(n))
762#endif
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)
769#endif
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;
774}
775#endif
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;
779#else
780 return PyCFunction_Check(func) && PyCFunction_GET_FUNCTION(func) == (PyCFunction) cfunc;
781#endif
782}
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))
786#else
787 #define __Pyx_PyType_FromModuleAndSpec(m, s, b) PyType_FromModuleAndSpec(m, s, b)
788#endif
789#if CYTHON_COMPILING_IN_PYPY
790 typedef PyObject *(*__Pyx_PyCMethod)(PyObject *, PyTypeObject *, PyObject *const *, size_t, PyObject *);
791#else
792 #define __Pyx_PyCMethod PyCMethod
793#endif
794#ifndef METH_METHOD
795 #define METH_METHOD 0x200
796#endif
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)
801#endif
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))
810#else
811 #define __Pyx_PyCode_HasFreeVars(co) (PyCode_GetNumFree(co) > 0)
812 #define __Pyx_PyFrame_SetLineNumber(frame, lineno) (frame)->f_lineno = (lineno)
813#endif
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()
820#else
821 #define __Pyx_PyThreadState_Current _PyThreadState_UncheckedGet()
822#endif
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
827#else
828 #define __PYX_SHARED_SIZEOF(T) sizeof(T)
829 #define __PYX_SHARED_RELATIVE_OFFSET 0
830 #define CYTHON_OPAQUE_SHARED_TYPES 0
831#endif
832#if CYTHON_USE_MODULE_STATE
833static CYTHON_INLINE void *__Pyx__PyModule_GetState(PyObject *op)
834{
835 void *result;
836 result = PyModule_GetState(op);
837 if (!result)
838 Py_FatalError("Couldn't find the module state");
839 return result;
840}
841#define __Pyx_PyModule_GetState(o) (__pyx_mstatetype *)__Pyx__PyModule_GetState(o)
842#else
843#define __Pyx_PyModule_GetState(op) ((void)op,__pyx_mstate_global)
844#endif
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)
854#else
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)
862#endif
863#if CYTHON_COMPILING_IN_CPYTHON || defined(_PyDict_NewPresized)
864#define __Pyx_PyDict_NewPresized(n) ((n <= 8) ? PyDict_New() : _PyDict_NewPresized(n))
865#else
866#define __Pyx_PyDict_NewPresized(n) PyDict_New()
867#endif
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);
876 }
877 return res;
878}
879#elif !CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07020000
880#define __Pyx_PyDict_GetItemStrWithError PyDict_GetItemWithError
881#define __Pyx_PyDict_GetItemStr PyDict_GetItem
882#else
883static CYTHON_INLINE PyObject * __Pyx_PyDict_GetItemStrWithError(PyObject *dict, PyObject *name) {
884#if CYTHON_COMPILING_IN_PYPY
885 return PyDict_GetItem(dict, name);
886#else
887 PyDictEntry *ep;
888 PyDictObject *mp = (PyDictObject*) dict;
889 long hash = ((PyStringObject *) name)->ob_shash;
890 assert(hash != -1);
891 ep = (mp->ma_lookup)(mp, name, hash);
892 if (ep == NULL) {
893 return NULL;
894 }
895 return ep->me_value;
896#endif
897}
898#define __Pyx_PyDict_GetItemStr PyDict_GetItem
899#endif
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)
903#else
904 #define __Pyx_PyType_GetFlags(tp) (PyType_GetFlags((PyTypeObject *)tp))
905 #define __Pyx_PyType_HasFeature(type, feature) PyType_HasFeature(type, feature)
906#endif
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);\
913 Py_DECREF(type);\
914}
915#else
916#define __Pyx_PyHeapTypeObject_GC_Del(obj) PyObject_GC_Del(obj)
917#endif
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))
927#else
928 #if PY_VERSION_HEX >= 0x030C0000
929 #define __Pyx_PyUnicode_READY(op) (0)
930 #else
931 #define __Pyx_PyUnicode_READY(op) (likely(PyUnicode_IS_READY(op)) ?\
932 0 : _PyUnicode_Ready((PyObject *)(op)))
933 #endif
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))
942 #else
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))
945 #else
946 #define __Pyx_PyUnicode_IS_TRUE(u) (0 != (likely(PyUnicode_IS_READY(u)) ? PyUnicode_GET_LENGTH(u) : PyUnicode_GET_SIZE(u)))
947 #endif
948 #endif
949 static CYTHON_INLINE int __Pyx_PyUnicode_KIND_04(PyObject *o) {
950 return __Pyx_PyUnicode_KIND(o) - (int) !!PyUnicode_IS_ASCII(o);
951 }
952#endif
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)
956#else
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))
960#endif
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)
964 #endif
965 #if !defined(PyUnicode_Contains)
966 #define PyUnicode_Contains(u, s) PySequence_Contains(u, s)
967 #endif
968 #if !defined(PyByteArray_Check)
969 #define PyByteArray_Check(obj) PyObject_TypeCheck(obj, &PyByteArray_Type)
970 #endif
971 #if !defined(PyObject_Format)
972 #define PyObject_Format(obj, fmt) PyObject_CallMethod(obj, "__format__", "O", fmt)
973 #endif
974#endif
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))
982#else
983 #define __Pyx_PySequence_ListKeepNew(obj) PySequence_List(obj)
984#endif
985#ifndef PySet_CheckExact
986 #define PySet_CheckExact(obj) Py_IS_TYPE(obj, &PySet_Type)
987#endif
988enum __Pyx_ReferenceSharing {
989 __Pyx_ReferenceSharing_DefinitelyUnique, // We created it so we know it's unshared - no need to check
990 __Pyx_ReferenceSharing_OwnStrongReference,
991 __Pyx_ReferenceSharing_FunctionArgument,
992 __Pyx_ReferenceSharing_SharedReference, // Never trust it to be unshared because it's a global or similar
993};
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)
1001#else
1002#define __Pyx_IS_UNIQUELY_REFERENCED(o, sharing) (((void)o), ((void)sharing), 0)
1003#endif
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))
1009 #else
1010 #define __Pyx_PyList_GetItemRef(o, i) PySequence_ITEM(o, i)
1011 #endif
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))
1014#else
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))
1017#endif
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))
1026 #else
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))
1030 #endif
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)))
1034#else
1035 #define __Pyx_PyList_GET_ITEM_REF(o, i, unsafe_shared) ((void)(unsafe_shared),\
1036 __Pyx_XNewRef(PyList_GetItem(o, i)))
1037#endif
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)) {
1045 PyErr_Clear();
1046 return 0;
1047 }
1048 return -1;
1049 }
1050 return 1;
1051}
1052#else
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;
1057 }
1058 Py_INCREF(*result);
1059 return 1;
1060}
1061#endif
1062#if defined(CYTHON_DEBUG_VISIT_CONST) && CYTHON_DEBUG_VISIT_CONST
1063 #define __Pyx_VISIT_CONST(obj) Py_VISIT(obj)
1064#else
1065 #define __Pyx_VISIT_CONST(obj)
1066#endif
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)
1074#else
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)
1081#endif
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)
1090#else
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)
1098#endif
1099#if CYTHON_COMPILING_IN_PYPY && !defined(PyUnicode_InternFromString)
1100 #define PyUnicode_InternFromString(s) PyUnicode_FromString(s)
1101#endif
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
1106#else
1107 typedef enum {
1108 PYGEN_RETURN = 0,
1109 PYGEN_ERROR = -1,
1110 PYGEN_NEXT = 1,
1111 } __Pyx_PySendResult;
1112#endif
1113#if CYTHON_COMPILING_IN_LIMITED_API || PY_VERSION_HEX < 0x030A00A3
1114 typedef __Pyx_PySendResult (*__Pyx_pyiter_sendfunc)(PyObject *iter, PyObject *value, PyObject **result);
1115#else
1116 #define __Pyx_pyiter_sendfunc sendfunc
1117#endif
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
1122#else
1123#define __PYX_HAS_PY_AM_SEND 2 // our own backported implementation
1124#endif
1125#if __PYX_HAS_PY_AM_SEND < 2
1126 #define __Pyx_PyAsyncMethodsStruct PyAsyncMethods
1127#else
1128 typedef struct {
1129 unaryfunc am_await;
1130 unaryfunc am_aiter;
1131 unaryfunc am_anext;
1132 __Pyx_pyiter_sendfunc am_send;
1133 } __Pyx_PyAsyncMethodsStruct;
1134 #define __Pyx_SlotTpAsAsync(s) ((PyAsyncMethods*)(s))
1135#endif
1136#if CYTHON_USE_AM_SEND && PY_VERSION_HEX < 0x030A00F0
1137 #define __Pyx_TPFLAGS_HAVE_AM_SEND (1UL << 21)
1138#else
1139 #define __Pyx_TPFLAGS_HAVE_AM_SEND (0)
1140#endif
1141#if CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030A0000
1142#ifdef __cplusplus
1143extern "C"
1144#endif
1145PyAPI_FUNC(void *) PyMem_Calloc(size_t nelem, size_t elsize);
1146#endif
1147#if CYTHON_COMPILING_IN_LIMITED_API
1148static int __Pyx_init_co_variable(PyObject *inspect, const char* name, int *write_to) {
1149 int value;
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);
1154 *write_to = value;
1155 return value != -1 || !PyErr_Occurred();
1156}
1157static int __Pyx_init_co_variables(void) {
1158 PyObject *inspect;
1159 int result;
1160 inspect = PyImport_ImportModule("inspect");
1161 result =
1162#if !defined(CO_OPTIMIZED)
1163 __Pyx_init_co_variable(inspect, "CO_OPTIMIZED", &CO_OPTIMIZED) &&
1164#endif
1165#if !defined(CO_NEWLOCALS)
1166 __Pyx_init_co_variable(inspect, "CO_NEWLOCALS", &CO_NEWLOCALS) &&
1167#endif
1168#if !defined(CO_VARARGS)
1169 __Pyx_init_co_variable(inspect, "CO_VARARGS", &CO_VARARGS) &&
1170#endif
1171#if !defined(CO_VARKEYWORDS)
1172 __Pyx_init_co_variable(inspect, "CO_VARKEYWORDS", &CO_VARKEYWORDS) &&
1173#endif
1174#if !defined(CO_ASYNC_GENERATOR)
1175 __Pyx_init_co_variable(inspect, "CO_ASYNC_GENERATOR", &CO_ASYNC_GENERATOR) &&
1176#endif
1177#if !defined(CO_GENERATOR)
1178 __Pyx_init_co_variable(inspect, "CO_GENERATOR", &CO_GENERATOR) &&
1179#endif
1180#if !defined(CO_COROUTINE)
1181 __Pyx_init_co_variable(inspect, "CO_COROUTINE", &CO_COROUTINE) &&
1182#endif
1183 1;
1184 Py_DECREF(inspect);
1185 return result ? 0 : -1;
1186}
1187static int __Pyx_init_tpflags_bitcount(unsigned long flag) {
1188 int count = 0;
1189 while (flag) {
1190 count += (int) (flag & 1);
1191 flag >>= 1;
1192 }
1193 return count;
1194}
1195static int __Pyx_init_tpflags_variables(void) {
1196 if (__Pyx_Runtime_TPFLAGS_SEQUENCE != 0 && __Pyx_Runtime_TPFLAGS_MAPPING != 0) {
1197 return 0;
1198 }
1199 PyObject *collections_abc = PyImport_ImportModule("collections.abc");
1200 if (!collections_abc) return -1;
1201 int result = 0;
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;
1206#else
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;
1211#endif
1212 if (!PyType_Check(sequence) || !PyType_Check(mapping)) goto fail;
1213 {
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;
1221 }
1222 if (__Pyx_Runtime_TPFLAGS_MAPPING == 0 && __Pyx_init_tpflags_bitcount(mapping_flags) == 1) {
1223 __Pyx_Runtime_TPFLAGS_MAPPING = mapping_flags;
1224 }
1225 }
1226 cleanup:
1227 Py_XDECREF(mapping);
1228 Py_XDECREF(sequence);
1229 Py_DECREF(collections_abc);
1230 return result;
1231#if __PYX_LIMITED_VERSION_HEX < 0x030D0000
1232 fail_attr_lookup:
1233 if (PyErr_ExceptionMatches(PyExc_AttributeError)) {
1234 PyErr_Clear();
1235 }
1236#endif
1237 fail:
1238 result = PyErr_Occurred() ? -1 : 0;
1239 goto cleanup;
1240}
1241#else
1242static int __Pyx_init_co_variables(void) {
1243 return 0; // It's a limited API-only feature
1244}
1245static int __Pyx_init_tpflags_variables(void) {
1246 return 0; // It's a limited API-only feature
1247}
1248#endif
1249
1250/* MathInitCode */
1251#if defined(_WIN32) || defined(WIN32) || defined(MS_WINDOWS)
1252 #ifndef _USE_MATH_DEFINES
1253 #define _USE_MATH_DEFINES
1254 #endif
1255#endif
1256#include <math.h>
1257#if defined(__CYGWIN__) && defined(_LDBL_EQ_DBL)
1258#define __Pyx_truncl trunc
1259#else
1260#define __Pyx_truncl truncl
1261#endif
1262
1263#ifndef CYTHON_CLINE_IN_TRACEBACK_RUNTIME
1264#define CYTHON_CLINE_IN_TRACEBACK_RUNTIME 1
1265#endif
1266#ifndef CYTHON_CLINE_IN_TRACEBACK
1267#define CYTHON_CLINE_IN_TRACEBACK CYTHON_CLINE_IN_TRACEBACK_RUNTIME
1268#endif
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; }
1271#else
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; }
1273#endif
1274#define __PYX_ERR(f_index, lineno, Ln_error) \
1275 { __PYX_MARK_ERR_POS(f_index, lineno) goto Ln_error; }
1276
1277#ifdef CYTHON_EXTERN_C
1278 #undef __PYX_EXTERN_C
1279 #define __PYX_EXTERN_C CYTHON_EXTERN_C
1280#elif defined(__PYX_EXTERN_C)
1281 #ifdef _MSC_VER
1282 #pragma message ("Please do not define the '__PYX_EXTERN_C' macro externally. Use 'CYTHON_EXTERN_C' instead.")
1283 #else
1284 #warning Please do not define the '__PYX_EXTERN_C' macro externally. Use 'CYTHON_EXTERN_C' instead.
1285 #endif
1286#else
1287 #ifdef __cplusplus
1288 #define __PYX_EXTERN_C extern "C"
1289 #else
1290 #define __PYX_EXTERN_C extern
1291 #endif
1292#endif
1293
1294#define __PYX_HAVE__cshockCapturing
1295#define __PYX_HAVE_API__cshockCapturing
1296/* Early includes */
1297#include <string.h>
1298#include <stdio.h>
1299
1300 /* Using NumPy API declarations from "numpy/__init__.cython-30.pxd" */
1301
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"
1307#include "shockCapturing.h"
1308#ifdef _OPENMP
1309#include <omp.h>
1310#endif /* _OPENMP */
1311
1312#if defined(PYREX_WITHOUT_ASSERTIONS) && !defined(CYTHON_WITHOUT_ASSERTIONS)
1313#define CYTHON_WITHOUT_ASSERTIONS
1314#endif
1315
1316#ifdef CYTHON_FREETHREADING_COMPATIBLE
1317#if CYTHON_FREETHREADING_COMPATIBLE
1318#define __Pyx_FREETHREADING_COMPATIBLE Py_MOD_GIL_NOT_USED
1319#else
1320#define __Pyx_FREETHREADING_COMPATIBLE Py_MOD_GIL_USED
1321#endif
1322#else
1323#define __Pyx_FREETHREADING_COMPATIBLE Py_MOD_GIL_USED
1324#endif
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;
1344}
1345#if defined (__cplusplus) && __cplusplus >= 201103L
1346 #include <cstdlib>
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)
1358#else
1359 #define __Pyx_sst_abs(value) ((value<0) ? -value : value)
1360#endif
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)
1377#else
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)
1385#endif
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);
1400#else
1401 Py_INCREF(obj);
1402 return obj;
1403#endif
1404}
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);
1408#else
1409 Py_XINCREF(obj);
1410 return obj;
1411#endif
1412}
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)
1428#else
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)
1432#endif
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
1439 #endif
1440 #ifndef _PyLong_NON_SIZE_BITS
1441 #define _PyLong_NON_SIZE_BITS 3
1442 #endif
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)
1456 #else
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])
1459 #endif
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);
1471 }
1472 typedef Py_ssize_t __Pyx_compact_pylong;
1473 typedef size_t __Pyx_compact_upylong;
1474 #else
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;
1489 #endif
1490 #if PY_VERSION_HEX >= 0x030C00A5
1491 #define __Pyx_PyLong_Digits(x) (((PyLongObject*)x)->long_value.ob_digit)
1492 #else
1493 #define __Pyx_PyLong_Digits(x) (((PyLongObject*)x)->ob_digit)
1494 #endif
1495 #define __Pyx_PyLong_IsNonZero(x) (!__Pyx_PyLong_IsZero(x))
1496#else
1497 #define __Pyx_PyLong_IsNonZero(x) PyObject_IsTrue(x)
1498#endif
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)
1503#else
1504 #define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_Decode(c_str, size, __PYX_DEFAULT_STRING_ENCODING, NULL)
1505#endif
1506
1507
1508/* Test for GCC > 2.95 */
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)
1512#else /* !__GNUC__ or GCC < 2.95 */
1513 #define likely(x) (x)
1514 #define unlikely(x) (x)
1515#endif /* __GNUC__ */
1516/* PretendToInitialize */
1517#ifdef __cplusplus
1518#if __cplusplus > 201103L
1519#include <type_traits>
1520#endif
1521template <typename T>
1522static void __Pyx_pretend_to_initialize(T* ptr) {
1523#if __cplusplus > 201103L
1524 if ((std::is_trivially_default_constructible<T>::value))
1525#endif
1526 *ptr = T();
1527 (void)ptr;
1528}
1529#else
1530static CYTHON_INLINE void __Pyx_pretend_to_initialize(void* ptr) { (void)ptr; }
1531#endif
1532
1533
1534#if !CYTHON_USE_MODULE_STATE
1535static PyObject *__pyx_m = NULL;
1536#endif
1537static const char * const __pyx_cfilenm = __FILE__;
1538
1539/* Header.proto */
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
1545 #else
1546 #define CYTHON_CCOMPLEX 0
1547 #endif
1548#endif
1549#if CYTHON_CCOMPLEX
1550 #ifdef __cplusplus
1551 #include <complex>
1552 #else
1553 #include <complex.h>
1554 #endif
1555#endif
1556#if CYTHON_CCOMPLEX && !defined(__cplusplus) && defined(__sun__) && defined(__GNUC__)
1557 #undef _Complex_I
1558 #define _Complex_I 1.0fj
1559#endif
1560
1561/* #### Code section: filename_table ### */
1562
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",
1566 "cpython/type.pxd",
1567};
1568/* #### Code section: utility_code_proto_before_types ### */
1569/* Atomics.proto (used by UnpackUnboundCMethod) */
1570#include <pythread.h>
1571#ifndef CYTHON_ATOMICS
1572 #define CYTHON_ATOMICS 1
1573#endif
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)))
1585 #include <atomic>
1586#endif
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"
1610 #endif
1611#elif CYTHON_ATOMICS && (defined(__cplusplus) && (\
1612 (__cplusplus >= 201103L) ||\
1613\
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"
1635 #endif
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;
1648 *expected = old;
1649 return result;
1650 }
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;
1659 *expected = old;
1660 return result;
1661 }
1662 #ifdef __PYX_DEBUG_ATOMICS
1663 #warning "Using GNU atomics"
1664 #endif
1665#elif CYTHON_ATOMICS && defined(_MSC_VER)
1666 #include <intrin.h>
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;
1681 *expected = old;
1682 return result;
1683 }
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;
1692 *expected = old;
1693 return result;
1694 }
1695 #ifdef __PYX_DEBUG_ATOMICS
1696 #pragma message ("Using MSVC atomics")
1697 #endif
1698#else
1699 #undef CYTHON_ATOMICS
1700 #define CYTHON_ATOMICS 0
1701 #ifdef __PYX_DEBUG_ATOMICS
1702 #warning "Not using atomics"
1703 #endif
1704#endif
1705
1706/* CriticalSectionsDefinition.proto (used by CriticalSections) */
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)
1712#else
1713#define __Pyx_PyCriticalSection PyCriticalSection
1714#define __Pyx_PyCriticalSection2 PyCriticalSection2
1715#define __Pyx_PyCriticalSection_End PyCriticalSection_End
1716#define __Pyx_PyCriticalSection2_End PyCriticalSection2_End
1717#endif
1718
1719/* CriticalSections.proto (used by ParseKeywordsImpl) */
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)
1723#else
1724#define __Pyx_PyCriticalSection_Begin PyCriticalSection_Begin
1725#define __Pyx_PyCriticalSection2_Begin PyCriticalSection2_Begin
1726#endif
1727#if PY_VERSION_HEX < 0x030d0000 || CYTHON_COMPILING_IN_LIMITED_API
1728#define __Pyx_BEGIN_CRITICAL_SECTION(o) {
1729#define __Pyx_END_CRITICAL_SECTION() }
1730#else
1731#define __Pyx_BEGIN_CRITICAL_SECTION Py_BEGIN_CRITICAL_SECTION
1732#define __Pyx_END_CRITICAL_SECTION Py_END_CRITICAL_SECTION
1733#endif
1734
1735/* IncludeStructmemberH.proto (used by CythonFunctionShared) */
1736#include <structmember.h>
1737
1738/* #### Code section: numeric_typedefs ### */
1739
1740/* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":761
1741 * # in Cython to enable them only on the right systems.
1742 *
1743 * ctypedef npy_int8 int8_t # <<<<<<<<<<<<<<
1744 * ctypedef npy_int16 int16_t
1745 * ctypedef npy_int32 int32_t
1746*/
1747typedef npy_int8 __pyx_t_5numpy_int8_t;
1748
1749/* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":762
1750 *
1751 * ctypedef npy_int8 int8_t
1752 * ctypedef npy_int16 int16_t # <<<<<<<<<<<<<<
1753 * ctypedef npy_int32 int32_t
1754 * ctypedef npy_int64 int64_t
1755*/
1756typedef npy_int16 __pyx_t_5numpy_int16_t;
1757
1758/* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":763
1759 * ctypedef npy_int8 int8_t
1760 * ctypedef npy_int16 int16_t
1761 * ctypedef npy_int32 int32_t # <<<<<<<<<<<<<<
1762 * ctypedef npy_int64 int64_t
1763 *
1764*/
1765typedef npy_int32 __pyx_t_5numpy_int32_t;
1766
1767/* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":764
1768 * ctypedef npy_int16 int16_t
1769 * ctypedef npy_int32 int32_t
1770 * ctypedef npy_int64 int64_t # <<<<<<<<<<<<<<
1771 *
1772 * ctypedef npy_uint8 uint8_t
1773*/
1774typedef npy_int64 __pyx_t_5numpy_int64_t;
1775
1776/* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":766
1777 * ctypedef npy_int64 int64_t
1778 *
1779 * ctypedef npy_uint8 uint8_t # <<<<<<<<<<<<<<
1780 * ctypedef npy_uint16 uint16_t
1781 * ctypedef npy_uint32 uint32_t
1782*/
1783typedef npy_uint8 __pyx_t_5numpy_uint8_t;
1784
1785/* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":767
1786 *
1787 * ctypedef npy_uint8 uint8_t
1788 * ctypedef npy_uint16 uint16_t # <<<<<<<<<<<<<<
1789 * ctypedef npy_uint32 uint32_t
1790 * ctypedef npy_uint64 uint64_t
1791*/
1792typedef npy_uint16 __pyx_t_5numpy_uint16_t;
1793
1794/* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":768
1795 * ctypedef npy_uint8 uint8_t
1796 * ctypedef npy_uint16 uint16_t
1797 * ctypedef npy_uint32 uint32_t # <<<<<<<<<<<<<<
1798 * ctypedef npy_uint64 uint64_t
1799 *
1800*/
1801typedef npy_uint32 __pyx_t_5numpy_uint32_t;
1802
1803/* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":769
1804 * ctypedef npy_uint16 uint16_t
1805 * ctypedef npy_uint32 uint32_t
1806 * ctypedef npy_uint64 uint64_t # <<<<<<<<<<<<<<
1807 *
1808 * ctypedef npy_float32 float32_t
1809*/
1810typedef npy_uint64 __pyx_t_5numpy_uint64_t;
1811
1812/* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":771
1813 * ctypedef npy_uint64 uint64_t
1814 *
1815 * ctypedef npy_float32 float32_t # <<<<<<<<<<<<<<
1816 * ctypedef npy_float64 float64_t
1817 * #ctypedef npy_float80 float80_t
1818*/
1819typedef npy_float32 __pyx_t_5numpy_float32_t;
1820
1821/* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":772
1822 *
1823 * ctypedef npy_float32 float32_t
1824 * ctypedef npy_float64 float64_t # <<<<<<<<<<<<<<
1825 * #ctypedef npy_float80 float80_t
1826 * #ctypedef npy_float128 float128_t
1827*/
1828typedef npy_float64 __pyx_t_5numpy_float64_t;
1829
1830/* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":779
1831 * ctypedef double complex complex128_t
1832 *
1833 * ctypedef npy_longlong longlong_t # <<<<<<<<<<<<<<
1834 * ctypedef npy_ulonglong ulonglong_t
1835 *
1836*/
1837typedef npy_longlong __pyx_t_5numpy_longlong_t;
1838
1839/* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":780
1840 *
1841 * ctypedef npy_longlong longlong_t
1842 * ctypedef npy_ulonglong ulonglong_t # <<<<<<<<<<<<<<
1843 *
1844 * ctypedef npy_intp intp_t
1845*/
1846typedef npy_ulonglong __pyx_t_5numpy_ulonglong_t;
1847
1848/* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":782
1849 * ctypedef npy_ulonglong ulonglong_t
1850 *
1851 * ctypedef npy_intp intp_t # <<<<<<<<<<<<<<
1852 * ctypedef npy_uintp uintp_t
1853 *
1854*/
1855typedef npy_intp __pyx_t_5numpy_intp_t;
1856
1857/* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":783
1858 *
1859 * ctypedef npy_intp intp_t
1860 * ctypedef npy_uintp uintp_t # <<<<<<<<<<<<<<
1861 *
1862 * ctypedef npy_double float_t
1863*/
1864typedef npy_uintp __pyx_t_5numpy_uintp_t;
1865
1866/* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":785
1867 * ctypedef npy_uintp uintp_t
1868 *
1869 * ctypedef npy_double float_t # <<<<<<<<<<<<<<
1870 * ctypedef npy_double double_t
1871 * ctypedef npy_longdouble longdouble_t
1872*/
1873typedef npy_double __pyx_t_5numpy_float_t;
1874
1875/* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":786
1876 *
1877 * ctypedef npy_double float_t
1878 * ctypedef npy_double double_t # <<<<<<<<<<<<<<
1879 * ctypedef npy_longdouble longdouble_t
1880 *
1881*/
1882typedef npy_double __pyx_t_5numpy_double_t;
1883
1884/* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":787
1885 * ctypedef npy_double float_t
1886 * ctypedef npy_double double_t
1887 * ctypedef npy_longdouble longdouble_t # <<<<<<<<<<<<<<
1888 *
1889 * ctypedef float complex cfloat_t
1890*/
1891typedef npy_longdouble __pyx_t_5numpy_longdouble_t;
1892/* #### Code section: complex_type_declarations ### */
1893/* Declarations.proto */
1894#if CYTHON_CCOMPLEX && (1) && (!0 || __cplusplus)
1895 #ifdef __cplusplus
1896 typedef ::std::complex< float > __pyx_t_float_complex;
1897 #else
1898 typedef float _Complex __pyx_t_float_complex;
1899 #endif
1900#else
1901 typedef struct { float real, imag; } __pyx_t_float_complex;
1902#endif
1903static CYTHON_INLINE __pyx_t_float_complex __pyx_t_float_complex_from_parts(float, float);
1904
1905/* Declarations.proto */
1906#if CYTHON_CCOMPLEX && (1) && (!0 || __cplusplus)
1907 #ifdef __cplusplus
1908 typedef ::std::complex< double > __pyx_t_double_complex;
1909 #else
1910 typedef double _Complex __pyx_t_double_complex;
1911 #endif
1912#else
1913 typedef struct { double real, imag; } __pyx_t_double_complex;
1914#endif
1915static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(double, double);
1916
1917/* Declarations.proto */
1918#if CYTHON_CCOMPLEX && (1) && (!0 || __cplusplus)
1919 #ifdef __cplusplus
1920 typedef ::std::complex< long double > __pyx_t_long_double_complex;
1921 #else
1922 typedef long double _Complex __pyx_t_long_double_complex;
1923 #endif
1924#else
1925 typedef struct { long double real, imag; } __pyx_t_long_double_complex;
1926#endif
1927static CYTHON_INLINE __pyx_t_long_double_complex __pyx_t_long_double_complex_from_parts(long double, long double);
1928
1929/* #### Code section: type_declarations ### */
1930
1931/*--- Type declarations ---*/
1932/* #### Code section: utility_code_proto ### */
1933
1934/* --- Runtime support code (head) --- */
1935/* Refnanny.proto */
1936#ifndef CYTHON_REFNANNY
1937 #define CYTHON_REFNANNY 0
1938#endif
1939#if CYTHON_REFNANNY
1940 typedef struct {
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)\
1952 if (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);\
1956 } else {\
1957 __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), (__LINE__), (__FILE__));\
1958 }
1959 #define __Pyx_RefNannyFinishContextNogil() {\
1960 PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();\
1961 __Pyx_RefNannyFinishContext();\
1962 PyGILState_Release(__pyx_gilstate_save);\
1963 }
1964 #define __Pyx_RefNannyFinishContextNogil() {\
1965 PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();\
1966 __Pyx_RefNannyFinishContext();\
1967 PyGILState_Release(__pyx_gilstate_save);\
1968 }
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)
1979#else
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)
1992#endif
1993#define __Pyx_Py_XDECREF_SET(r, v) do {\
1994 PyObject *tmp = (PyObject *) r;\
1995 r = v; Py_XDECREF(tmp);\
1996 } while (0)
1997#define __Pyx_XDECREF_SET(r, v) do {\
1998 PyObject *tmp = (PyObject *) r;\
1999 r = v; __Pyx_XDECREF(tmp);\
2000 } while (0)
2001#define __Pyx_DECREF_SET(r, v) do {\
2002 PyObject *tmp = (PyObject *) r;\
2003 r = v; __Pyx_DECREF(tmp);\
2004 } while (0)
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)
2007
2008/* GetTopmostException.proto (used by SaveResetException) */
2009#if CYTHON_USE_EXC_INFO_STACK && CYTHON_FAST_THREAD_STATE
2010static _PyErr_StackItem * __Pyx_PyErr_GetTopmostException(PyThreadState *tstate);
2011#endif
2012
2013/* PyThreadStateGet.proto (used by SaveResetException) */
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)
2020#else
2021#define __Pyx_PyErr_Occurred() (__pyx_tstate->curexc_type != NULL)
2022#define __Pyx_PyErr_CurrentExceptionType() (__pyx_tstate->curexc_type)
2023#endif
2024#else
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()
2029#endif
2030
2031/* SaveResetException.proto */
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);
2037#else
2038#define __Pyx_ExceptionSave(type, value, tb) PyErr_GetExcInfo(type, value, tb)
2039#define __Pyx_ExceptionReset(type, value, tb) PyErr_SetExcInfo(type, value, tb)
2040#endif
2041
2042/* FastTypeChecks.proto (used by PyException_Check) */
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)
2049#else
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)
2053#endif
2054
2055/* PyException_Check.proto */
2056#define __Pyx_PyExc_Exception_Check(obj) __Pyx_TypeCheck(obj, PyExc_Exception)
2057
2058/* PyErrFetchRestore.proto (used by GivenExceptionMatches) */
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))
2069#else
2070#define __Pyx_PyErr_SetNone(exc) PyErr_SetNone(exc)
2071#endif
2072#else
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)
2081#endif
2082
2083/* GivenExceptionMatches.proto (used by PyErrExceptionMatches) */
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);
2087#else
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);
2091}
2092#endif
2093#define __Pyx_PyErr_ExceptionMatches2(err1, err2) __Pyx_PyErr_GivenExceptionMatches2(__Pyx_PyErr_CurrentExceptionType(), err1, err2)
2094
2095/* PyErrExceptionMatches.proto */
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);
2099#else
2100#define __Pyx_PyErr_ExceptionMatches(err) PyErr_ExceptionMatches(err)
2101#endif
2102
2103/* GetException.proto */
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);
2107#else
2108static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb);
2109#endif
2110
2111/* PyImportError_Check.proto */
2112#define __Pyx_PyExc_ImportError_Check(obj) __Pyx_TypeCheck(obj, PyExc_ImportError)
2113
2114/* PyObjectCall.proto (used by PyObjectFastCall) */
2115#if CYTHON_COMPILING_IN_CPYTHON
2116static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw);
2117#else
2118#define __Pyx_PyObject_Call(func, arg, kw) PyObject_Call(func, arg, kw)
2119#endif
2120
2121/* PyObjectCallMethO.proto (used by PyObjectFastCall) */
2122#if CYTHON_COMPILING_IN_CPYTHON
2123static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg);
2124#endif
2125
2126/* PyObjectFastCall.proto */
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);
2129
2130/* RaiseException.export */
2131static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause);
2132
2133/* CopyObjectArray.proto (used by TupleOrListFromArrayImpl) */
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);
2136#endif
2137
2138/* TupleOrListFromArrayImpl.proto (used by TupleFromArray) */
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))
2141#else
2142CYTHON_UNUSED static PyObject *
2143__Pyx_PyTuple_FromArray(PyObject *const *src, Py_ssize_t n);
2144#endif
2145
2146/* TupleFromArray.proto (used by fastcall) */
2147
2148
2149/* IncludeStringH.proto (used by PyObjectCompare) */
2150#include <string.h>
2151
2152/* PyObjectCompare.proto (used by UnicodeEquals) */
2153static CYTHON_INLINE int __Pyx_PyObject_CompareBoolEq_str_str(PyObject *op1, PyObject *op2, int pyop);
2154
2155/* UnicodeEquals.proto (used by fastcall) */
2156#define __Pyx_PyUnicode_Equals(s1, s2) __Pyx_PyObject_CompareBoolEq_str_str(s1, s2, Py_EQ)
2157
2158/* fastcall.proto */
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))
2163#else
2164 #define __Pyx_ArgRef_VARARGS(args, i) __Pyx_XNewRef(PyTuple_GetItem(args, i))
2165#endif
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);
2177 #else
2178 #define __Pyx_KwargsAsDict_FASTCALL(kw, kwvalues) _PyStack_AsDict(kwvalues, kw)
2179 #endif
2180#else
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
2186#endif
2187#if CYTHON_VECTORCALL_TPNEW
2188 #if !CYTHON_VECTORCALL
2189 #error Enabling CYTHON_VECTORCALL_TPNEW without CYTHON_VECTORCALL is not supported
2190 #endif
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
2196#else
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
2202#endif
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)
2206#else
2207#define __Pyx_ArgsSlice_FASTCALL __Pyx_ArgsSlice_VARARGS
2208#endif
2209
2210/* py_dict_items.proto (used by OwnedDictNext) */
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);
2215
2216/* CallCFunction.proto (used by CallUnboundCMethod0) */
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)
2225
2226/* PyObjectCallOneArg.proto (used by CallUnboundCMethod0) */
2227static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg);
2228
2229/* UnpackUnboundCMethod_decl.proto (used by UnpackUnboundCMethod) */
2230typedef struct {
2231 PyObject *type;
2232 PyObject **method_name;
2233 PyCFunction func;
2234 PyObject *method;
2235 int flag;
2236#if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING && CYTHON_ATOMICS
2237 __pyx_atomic_int_type initialized;
2238#endif
2239} __Pyx_CachedCFunction;
2240
2241/* IgnoreException.proto (used by UnpackUnboundCMethod_impl) */
2242static CYTHON_INLINE int __Pyx_IgnoreGivenException(PyObject *given_exception, PyObject *ignorable_exception);
2243#define __Pyx_IgnoreException(ignorable_exception) __Pyx_IgnoreGivenException(NULL, ignorable_exception)
2244
2245/* PyObjectGetAttrStr.proto (used by UnpackUnboundCMethod_impl) */
2246#if CYTHON_USE_TYPE_SLOTS
2247static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name);
2248#else
2249#define __Pyx_PyObject_GetAttrStr(o,n) PyObject_GetAttr(o,n)
2250#endif
2251
2252/* UnpackUnboundCMethod_impl.export */
2253static int __Pyx_TryUnpackUnboundCMethod(__Pyx_CachedCFunction* target);
2254
2255/* UnpackUnboundCMethod.proto (used by CallUnboundCMethod0) */
2256#if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING
2257static CYTHON_INLINE int __Pyx_CachedCFunction_GetAndSetInitializing(__Pyx_CachedCFunction *cfunc) {
2258#if !CYTHON_ATOMICS
2259 return 1;
2260#else
2261 __pyx_nonatomic_int_type expected = 0;
2262 if (__pyx_atomic_int_cmp_exchange(&cfunc->initialized, &expected, 1)) {
2263 return 0;
2264 }
2265 return expected;
2266#endif
2267}
2268static CYTHON_INLINE void __Pyx_CachedCFunction_SetFinishedInitializing(__Pyx_CachedCFunction *cfunc) {
2269#if CYTHON_ATOMICS
2270 __pyx_atomic_store(&cfunc->initialized, 2);
2271#endif
2272}
2273#else
2274#define __Pyx_CachedCFunction_GetAndSetInitializing(cfunc) 2
2275#define __Pyx_CachedCFunction_SetFinishedInitializing(cfunc)
2276#endif
2277
2278/* CallUnboundCMethod0.proto */
2279CYTHON_UNUSED
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);
2283#else
2284#define __Pyx_CallUnboundCMethod0(cfunc, self) __Pyx__CallUnboundCMethod0(cfunc, self)
2285#endif
2286
2287/* py_dict_values.proto (used by OwnedDictNext) */
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);
2292
2293/* OwnedDictNext.proto (used by ParseKeywordsImpl) */
2294#if CYTHON_AVOID_BORROWED_REFS
2295static int __Pyx_PyDict_NextRef(PyObject *p, PyObject **ppos, PyObject **pkey, PyObject **pvalue);
2296#else
2297CYTHON_INLINE
2298static int __Pyx_PyDict_NextRef(PyObject *p, Py_ssize_t *ppos, PyObject **pkey, PyObject **pvalue);
2299#endif
2300
2301/* RaiseDoubleKeywords.proto (used by ParseKeywordsImpl) */
2302static void __Pyx_RaiseDoubleKeywordsError(const char* func_name, PyObject* kw_name);
2303
2304/* ParseKeywordsImpl.export */
2305static int __Pyx_ParseKeywordsTuple(
2306 PyObject *kwds,
2307 PyObject * const *kwvalues,
2308 PyObject ** const argnames[],
2309 PyObject *kwds2,
2310 PyObject *values[],
2311 Py_ssize_t num_pos_args,
2312 Py_ssize_t num_kwargs,
2313 const char* function_name,
2314 int ignore_unknown_kwargs
2315);
2316static int __Pyx_ParseKeywordDictToDict(
2317 PyObject *kwds,
2318 PyObject ** const argnames[],
2319 PyObject *kwds2,
2320 PyObject *values[],
2321 Py_ssize_t num_pos_args,
2322 const char* function_name
2323);
2324static int __Pyx_ParseKeywordDict(
2325 PyObject *kwds,
2326 PyObject ** const argnames[],
2327 PyObject *values[],
2328 Py_ssize_t num_pos_args,
2329 Py_ssize_t num_kwargs,
2330 const char* function_name,
2331 int ignore_unknown_kwargs
2332);
2333
2334/* CallUnboundCMethod2.proto */
2335CYTHON_UNUSED
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);
2339#else
2340#define __Pyx_CallUnboundCMethod2(cfunc, self, arg1, arg2) __Pyx__CallUnboundCMethod2(cfunc, self, arg1, arg2)
2341#endif
2342
2343/* ParseKeywords.proto */
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
2350);
2351
2352/* RaiseArgTupleInvalid.export */
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);
2355
2356/* ArgTypeTestError.export */
2357static void __Pyx_ArgTypeError(PyObject *obj, PyTypeObject *type, const char *name, int exact);
2358
2359/* ArgTypeTest.proto */
2360static CYTHON_INLINE int __Pyx_ArgTypeTest(PyObject *obj, PyTypeObject *type, int none_allowed, const char *name, int exact);
2361
2362/* TypeImport.proto */
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>
2367#endif
2368#if (defined (__STDC_VERSION__) && __STDC_VERSION__ >= 201112L) || __cplusplus >= 201103L
2369#define __PYX_GET_STRUCT_ALIGNMENT_3_3_0(s) alignof(s)
2370#else
2371#define __PYX_GET_STRUCT_ALIGNMENT_3_3_0(s) sizeof(void*)
2372#endif
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
2377};
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);
2379#endif
2380
2381/* PyObjectGetAttrStrNoError.proto (used by HasAttr) */
2382static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStrNoError(PyObject* obj, PyObject* attr_name);
2383
2384/* HasAttr.proto (used by ImportImpl) */
2385#if __PYX_LIMITED_VERSION_HEX >= 0x030d0000
2386#define __Pyx_HasAttr(o, n) PyObject_HasAttrWithError(o, n)
2387#else
2388static CYTHON_INLINE int __Pyx_HasAttr(PyObject *, PyObject *);
2389#endif
2390
2391/* TupleOrListFromArrayImpl.proto (used by ListFromArray) */
2392CYTHON_UNUSED static PyObject *
2393__Pyx_PyList_FromArray(PyObject *const *src, Py_ssize_t n);
2394
2395/* ListFromArray.proto (used by ImportImpl) */
2396
2397
2398/* ImportImpl.export */
2399static PyObject *__Pyx__Import(PyObject *name, PyObject *const *imported_names, Py_ssize_t len_imported_names, PyObject *qualname, PyObject *moddict, int level);
2400
2401/* Import.proto */
2402static CYTHON_INLINE PyObject *__Pyx_Import(PyObject *name, PyObject *const *imported_names, Py_ssize_t len_imported_names, PyObject *qualname, int level);
2403
2404/* dict_setdefault.proto (used by FetchCommonType) */
2405static CYTHON_INLINE PyObject *__Pyx_PyDict_SetDefault(PyObject *d, PyObject *key, PyObject *default_value);
2406
2407/* AddModuleRef.proto (used by FetchSharedCythonModule) */
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);
2411#else
2412 #define __Pyx_PyImport_AddModuleRef(name) PyImport_AddModuleRef(name)
2413#endif
2414
2415/* FetchSharedCythonModule.proto (used by FetchCommonType) */
2416static PyObject *__Pyx_FetchSharedCythonABIModule(void);
2417
2418/* VerifyCachedType.proto (used by FetchCommonType) */
2419static int __Pyx_VerifyCachedType(PyObject *cached_type,
2420 const char *name,
2421 Py_ssize_t expected_basicsize);
2422
2423/* FetchCommonType.proto (used by CommonTypesMetaclass) */
2424static PyTypeObject* __Pyx_FetchCommonTypeFromSpec(PyTypeObject *metaclass, PyObject *module, PyType_Spec *spec, PyObject *bases);
2425
2426/* CommonTypesMetaclass.proto (used by CythonFunctionShared) */
2427static int __pyx_CommonTypesMetaclass_init(PyObject *module);
2428#define __Pyx_CommonTypesMetaclass_USED
2429
2430/* CythonFunctionPerModule.proto (used by CythonFunctionShared) */
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))
2434#else
2435#define __Pyx_as_CyFunctionObject(o) ((__pyx_CyFunctionObject *)o)
2436#endif
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)
2446#else
2447 #define __Pyx__CyFunction_GetClassObj(f)\
2448 ((PyObject*) ((PyCMethodObject *) (f))->mm_class)
2449#endif
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)
2458typedef struct {
2459#if CYTHON_COMPILING_IN_LIMITED_API
2460#if !CYTHON_OPAQUE_OBJECTS
2461 PyObject_HEAD
2462#endif
2463 PyMethodDef *func_methoddef;
2464 PyObject *func_module;
2465#else
2466 PyCMethodObject func;
2467#endif
2468#if (CYTHON_COMPILING_IN_LIMITED_API || CYTHON_COMPILING_IN_PYPY) && CYTHON_VECTORCALL
2469 __pyx_vectorcallfunc func_vectorcall;
2470#endif
2471#if CYTHON_COMPILING_IN_LIMITED_API
2472 PyObject *func_weakreflist;
2473#endif
2474#if PY_VERSION_HEX < 0x030C0000 || CYTHON_COMPILING_IN_LIMITED_API
2475 PyObject *func_dict;
2476#endif
2477 PyObject *func_name;
2478 PyObject *func_qualname;
2479 PyObject *func_doc;
2480 PyObject *func_globals;
2481 PyObject *func_code;
2482 PyObject *func_closure;
2483#if CYTHON_COMPILING_IN_LIMITED_API
2484 PyObject *func_classobj;
2485#endif
2486 PyObject *defaults;
2487 int flags;
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;
2494#endif
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,
2507 PyObject *tuple);
2508static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsKwDict(PyObject *m,
2509 PyObject *dict);
2510static CYTHON_INLINE void __Pyx_CyFunction_SetAnnotationsDict(PyObject *m,
2511 PyObject *dict);
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)
2516#else
2517#define __Pyx_CyFunction_func_vectorcall(f) (((PyCFunctionObject*)f)->vectorcall)
2518#endif
2519#endif
2520
2521/* CallTypeTraverse.proto (used by CythonFunctionShared) */
2522#if !CYTHON_USE_TYPE_SPECS
2523#define __Pyx_call_type_traverse(o, always_call, visit, arg) 0
2524#else
2525static int __Pyx_call_type_traverse(PyObject *o, int always_call, visitproc visit, void *arg);
2526#endif
2527
2528/* PyMethodNew.proto (used by CythonFunctionShared) */
2529static PyObject *__Pyx_PyMethod_New(PyObject *func, PyObject *self, PyObject *typ);
2530
2531/* PyVectorcallFastCallDict.proto (used by CythonFunctionShared) */
2532#if CYTHON_VECTORCALL
2533static CYTHON_INLINE PyObject *__Pyx_PyVectorcall_FastCallDict(PyObject *func, __pyx_vectorcallfunc vc, PyObject *const *args, size_t nargs, PyObject *kw);
2534#endif
2535
2536/* CythonFunctionShared.proto (used by CythonFunction) */
2537static PyObject *__Pyx_CyFunction_Init(PyObject *op_in, PyMethodDef *ml,
2538 int flags, PyObject* qualname,
2539 PyObject *closure,
2540 PyObject *module, PyObject *globals,
2541 PyObject* code);
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);
2547#endif
2548
2549/* CythonFunction.export */
2550static PyObject *__Pyx_CyFunction_New(PyMethodDef *ml,
2551 int flags, PyObject* qualname,
2552 PyObject *closure,
2553 PyObject *module, PyObject *globals,
2554 PyObject* code);
2555static PyTypeObject *__Pyx_Get_CyFunction_Type(void);
2556
2557/* PyDictVersioning.proto (used by CLineInTraceback) */
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);\
2569 } else {\
2570 (VAR) = __pyx_dict_cached_value = (LOOKUP);\
2571 __pyx_dict_version = __PYX_GET_DICT_VERSION(DICT);\
2572 }\
2573}
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);
2577#else
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);
2581#endif
2582
2583/* CLineInTraceback.proto (used by AddTraceback) */
2584#if CYTHON_CLINE_IN_TRACEBACK && CYTHON_CLINE_IN_TRACEBACK_RUNTIME
2585static int __Pyx_CLineForTraceback(PyThreadState *tstate, int c_line);
2586#else
2587#define __Pyx_CLineForTraceback(tstate, c_line) (((CYTHON_CLINE_IN_TRACEBACK)) ? c_line : 0)
2588#endif
2589
2590/* CodeObjectCache.proto (used by AddTraceback) */
2591#if CYTHON_COMPILING_IN_LIMITED_API
2592typedef PyObject __Pyx_CachedCodeObjectType;
2593#else
2594typedef PyCodeObject __Pyx_CachedCodeObjectType;
2595#endif
2596typedef struct {
2597 __Pyx_CachedCodeObjectType* code_object;
2598 int code_line;
2599} __Pyx_CodeObjectCacheEntry;
2600struct __Pyx_CodeObjectCache {
2601 int count;
2602 int max_count;
2603 __Pyx_CodeObjectCacheEntry* entries;
2604 #if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING
2605 __pyx_atomic_int_type accessor_count;
2606 #endif
2607};
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);
2611
2612/* AddTraceback.proto */
2613static void __Pyx_AddTraceback(const char *funcname, int c_line,
2614 int py_line, const char *filename);
2615
2616/* GCCDiagnostics.proto */
2617#if !defined(__INTEL_COMPILER) && defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 6))
2618#define __Pyx_HAS_GCC_DIAGNOSTIC
2619#endif
2620
2621/* RealImag.proto */
2622#if CYTHON_CCOMPLEX
2623 #ifdef __cplusplus
2624 #define __Pyx_CREAL(z) ((z).real())
2625 #define __Pyx_CIMAG(z) ((z).imag())
2626 #else
2627 #define __Pyx_CREAL(z) (__real__(z))
2628 #define __Pyx_CIMAG(z) (__imag__(z))
2629 #endif
2630#else
2631 #define __Pyx_CREAL(z) ((z).real)
2632 #define __Pyx_CIMAG(z) ((z).imag)
2633#endif
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))
2638#else
2639 #define __Pyx_SET_CREAL(z,x) __Pyx_CREAL(z) = (x)
2640 #define __Pyx_SET_CIMAG(z,y) __Pyx_CIMAG(z) = (y)
2641#endif
2642
2643/* Arithmetic.proto */
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))
2651 #ifdef __cplusplus
2652 #define __Pyx_c_is_zero_float(z) ((z)==(float)0)
2653 #define __Pyx_c_conj_float(z) (::std::conj(z))
2654 #if 1
2655 #define __Pyx_c_abs_float(z) (::std::abs(z))
2656 #define __Pyx_c_pow_float(a, b) (::std::pow(a, b))
2657 #endif
2658 #else
2659 #define __Pyx_c_is_zero_float(z) ((z)==0)
2660 #define __Pyx_c_conj_float(z) (conjf(z))
2661 #if 1
2662 #define __Pyx_c_abs_float(z) (cabsf(z))
2663 #define __Pyx_c_pow_float(a, b) (cpowf(a, b))
2664 #endif
2665 #endif
2666#else
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);
2675 #if 1
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);
2678 #endif
2679#endif
2680
2681/* Arithmetic.proto */
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))
2689 #ifdef __cplusplus
2690 #define __Pyx_c_is_zero_double(z) ((z)==(double)0)
2691 #define __Pyx_c_conj_double(z) (::std::conj(z))
2692 #if 1
2693 #define __Pyx_c_abs_double(z) (::std::abs(z))
2694 #define __Pyx_c_pow_double(a, b) (::std::pow(a, b))
2695 #endif
2696 #else
2697 #define __Pyx_c_is_zero_double(z) ((z)==0)
2698 #define __Pyx_c_conj_double(z) (conj(z))
2699 #if 1
2700 #define __Pyx_c_abs_double(z) (cabs(z))
2701 #define __Pyx_c_pow_double(a, b) (cpow(a, b))
2702 #endif
2703 #endif
2704#else
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);
2713 #if 1
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);
2716 #endif
2717#endif
2718
2719/* Arithmetic.proto */
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))
2727 #ifdef __cplusplus
2728 #define __Pyx_c_is_zero_long__double(z) ((z)==(long double)0)
2729 #define __Pyx_c_conj_long__double(z) (::std::conj(z))
2730 #if 1
2731 #define __Pyx_c_abs_long__double(z) (::std::abs(z))
2732 #define __Pyx_c_pow_long__double(a, b) (::std::pow(a, b))
2733 #endif
2734 #else
2735 #define __Pyx_c_is_zero_long__double(z) ((z)==0)
2736 #define __Pyx_c_conj_long__double(z) (conjl(z))
2737 #if 1
2738 #define __Pyx_c_abs_long__double(z) (cabsl(z))
2739 #define __Pyx_c_pow_long__double(a, b) (cpowl(a, b))
2740 #endif
2741 #endif
2742#else
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);
2751 #if 1
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);
2754 #endif
2755#endif
2756
2757/* CIntFromPy.proto */
2758static CYTHON_INLINE char __Pyx_PyLong_As_char(PyObject *);
2759
2760/* FormatTypeName.proto */
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);
2771#else // !LIMITED_API
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)
2776#endif
2777
2778/* PyObjectVectorcallKwds.proto (used by PyObjectVectorcallMethodKwds) */
2779#if CYTHON_VECTORCALL
2780#define __Pyx_Object_VectorcallKwds PyObject_Vectorcall
2781CYTHON_UNUSED static int __Pyx_CheckVectorcallKwarg(PyObject *kwnames, Py_ssize_t i);
2782#else
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);
2786#endif
2787
2788/* PyObjectVectorcallMethodKwds.proto (used by CIntToPy) */
2789#if CYTHON_VECTORCALL
2790#define __Pyx_Object_VectorcallMethodKwds PyObject_VectorcallMethod
2791#else
2792static PyObject *__Pyx_Object_VectorcallMethodKwds(PyObject *name, PyObject *const *args, size_t nargsf, PyObject *kwnames);
2793#endif
2794
2795/* CIntToPy.proto */
2796static CYTHON_INLINE PyObject* __Pyx_PyLong_From_long(long value);
2797
2798/* CIntFromPy.proto */
2799static CYTHON_INLINE long __Pyx_PyLong_As_long(PyObject *);
2800
2801/* CIntFromPy.proto */
2802static CYTHON_INLINE int __Pyx_PyLong_As_int(PyObject *);
2803
2804/* GetRuntimeVersion.proto */
2805#if __PYX_LIMITED_VERSION_HEX < 0x030b0000
2806static unsigned long __Pyx_cached_runtime_version = 0;
2807static void __Pyx_init_runtime_version(void);
2808#else
2809#define __Pyx_init_runtime_version()
2810#endif
2811static unsigned long __Pyx_get_runtime_version(void);
2812
2813/* CheckBinaryVersion.proto */
2814static int __Pyx_check_binary_version(unsigned long ct_version, unsigned long rt_version, int allow_newer);
2815
2816/* DecompressString.proto */
2817static PyObject *__Pyx_DecompressString(const char *s, Py_ssize_t length, int algo);
2818
2819/* DecompressString_LZSS.proto */
2820static PyObject *__Pyx_DecompressString_LZSS(const char *s, size_t compressed_length, size_t uncompressed_length);
2821
2822/* MultiPhaseInitModuleState.proto */
2823#if CYTHON_PEP489_MULTI_PHASE_INIT && CYTHON_USE_MODULE_STATE
2824#include <stdlib.h>
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
2832#endif
2833
2834/* #### Code section: module_declarations ### */
2835/* CythonABIVersion.proto */
2836#if CYTHON_COMPILING_IN_LIMITED_API
2837 #if CYTHON_VECTORCALL
2838 #define __PYX_VECTORCALL_ABI_SUFFIX "_vectorcall"
2839 #else
2840 #define __PYX_VECTORCALL_ABI_SUFFIX
2841 #endif
2842 #define __PYX_LIMITED_ABI_SUFFIX "limited" __PYX_VECTORCALL_ABI_SUFFIX __PYX_AM_SEND_ABI_SUFFIX
2843#else
2844 #define __PYX_LIMITED_ABI_SUFFIX
2845#endif
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"
2850#else
2851 #define __PYX_AM_SEND_ABI_SUFFIX "noamsend"
2852#endif
2853#ifndef __PYX_MONITORING_ABI_SUFFIX
2854 #define __PYX_MONITORING_ABI_SUFFIX
2855#endif
2856#if CYTHON_USE_TP_FINALIZE
2857 #define __PYX_TP_FINALIZE_ABI_SUFFIX
2858#else
2859 #define __PYX_TP_FINALIZE_ABI_SUFFIX "nofinalize"
2860#endif
2861#if CYTHON_USE_FREELISTS || !defined(__Pyx_AsyncGen_USED)
2862 #define __PYX_FREELISTS_ABI_SUFFIX
2863#else
2864 #define __PYX_FREELISTS_ABI_SUFFIX "nofreelists"
2865#endif
2866#if CYTHON_OPAQUE_OBJECTS && CYTHON_COMPILING_IN_LIMITED_API
2867 #define __PYX_OPAQUE_OBJECTS_ABI_SUFFIX "opaque"
2868#else
2869 #define __PYX_OPAQUE_OBJECTS_ABI_SUFFIX
2870#endif
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 "."
2874
2875static CYTHON_INLINE PyTypeObject *__pyx_f_5numpy_5dtype_7typeobj___get__(PyArray_Descr *__pyx_v_self); /* proto*/
2876static CYTHON_INLINE char __pyx_f_5numpy_5dtype_4kind___get__(PyArray_Descr *__pyx_v_self); /* proto*/
2877static CYTHON_INLINE char __pyx_f_5numpy_5dtype_4type___get__(PyArray_Descr *__pyx_v_self); /* proto*/
2878static CYTHON_INLINE char __pyx_f_5numpy_5dtype_9byteorder___get__(PyArray_Descr *__pyx_v_self); /* proto*/
2879static CYTHON_INLINE int __pyx_f_5numpy_5dtype_8type_num___get__(PyArray_Descr *__pyx_v_self); /* proto*/
2880static CYTHON_INLINE npy_intp __pyx_f_5numpy_5dtype_8itemsize___get__(PyArray_Descr *__pyx_v_self); /* proto*/
2881static CYTHON_INLINE npy_intp __pyx_f_5numpy_5dtype_9alignment___get__(PyArray_Descr *__pyx_v_self); /* proto*/
2882static CYTHON_INLINE PyObject *__pyx_f_5numpy_5dtype_6fields___get__(PyArray_Descr *__pyx_v_self); /* proto*/
2883static CYTHON_INLINE PyObject *__pyx_f_5numpy_5dtype_5names___get__(PyArray_Descr *__pyx_v_self); /* proto*/
2884static CYTHON_INLINE PyArray_ArrayDescr *__pyx_f_5numpy_5dtype_8subarray___get__(PyArray_Descr *__pyx_v_self); /* proto*/
2885static CYTHON_INLINE npy_uint64 __pyx_f_5numpy_5dtype_5flags___get__(PyArray_Descr *__pyx_v_self); /* proto*/
2886static CYTHON_INLINE int __pyx_f_5numpy_9broadcast_7numiter___get__(PyArrayMultiIterObject *__pyx_v_self); /* proto*/
2887static CYTHON_INLINE npy_intp __pyx_f_5numpy_9broadcast_4size___get__(PyArrayMultiIterObject *__pyx_v_self); /* proto*/
2888static CYTHON_INLINE npy_intp __pyx_f_5numpy_9broadcast_5index___get__(PyArrayMultiIterObject *__pyx_v_self); /* proto*/
2889static CYTHON_INLINE int __pyx_f_5numpy_9broadcast_2nd___get__(PyArrayMultiIterObject *__pyx_v_self); /* proto*/
2890static CYTHON_INLINE npy_intp *__pyx_f_5numpy_9broadcast_10dimensions___get__(PyArrayMultiIterObject *__pyx_v_self); /* proto*/
2891static CYTHON_INLINE void **__pyx_f_5numpy_9broadcast_5iters___get__(PyArrayMultiIterObject *__pyx_v_self); /* proto*/
2892static CYTHON_INLINE PyObject *__pyx_f_5numpy_7ndarray_4base___get__(PyArrayObject *__pyx_v_self); /* proto*/
2893static CYTHON_INLINE PyArray_Descr *__pyx_f_5numpy_7ndarray_5descr___get__(PyArrayObject *__pyx_v_self); /* proto*/
2894static CYTHON_INLINE int __pyx_f_5numpy_7ndarray_4ndim___get__(PyArrayObject *__pyx_v_self); /* proto*/
2895static CYTHON_INLINE npy_intp *__pyx_f_5numpy_7ndarray_5shape___get__(PyArrayObject *__pyx_v_self); /* proto*/
2896static CYTHON_INLINE npy_intp *__pyx_f_5numpy_7ndarray_7strides___get__(PyArrayObject *__pyx_v_self); /* proto*/
2897static CYTHON_INLINE npy_intp __pyx_f_5numpy_7ndarray_4size___get__(PyArrayObject *__pyx_v_self); /* proto*/
2898static CYTHON_INLINE char *__pyx_f_5numpy_7ndarray_4data___get__(PyArrayObject *__pyx_v_self); /* proto*/
2899static CYTHON_INLINE int __pyx_f_5numpy_5ufunc_3nin___get__(PyUFuncObject *__pyx_v_self); /* proto*/
2900static CYTHON_INLINE int __pyx_f_5numpy_5ufunc_4nout___get__(PyUFuncObject *__pyx_v_self); /* proto*/
2901static CYTHON_INLINE int __pyx_f_5numpy_5ufunc_5nargs___get__(PyUFuncObject *__pyx_v_self); /* proto*/
2902static CYTHON_INLINE PyUFuncGenericFunction *__pyx_f_5numpy_5ufunc_9functions___get__(PyUFuncObject *__pyx_v_self); /* proto*/
2903static CYTHON_INLINE void **__pyx_f_5numpy_5ufunc_4data___get__(PyUFuncObject *__pyx_v_self); /* proto*/
2904static CYTHON_INLINE int __pyx_f_5numpy_5ufunc_6ntypes___get__(PyUFuncObject *__pyx_v_self); /* proto*/
2905static CYTHON_INLINE char const *__pyx_f_5numpy_5ufunc_4name___get__(PyUFuncObject *__pyx_v_self); /* proto*/
2906static CYTHON_INLINE char const *__pyx_f_5numpy_5ufunc_3doc___get__(PyUFuncObject *__pyx_v_self); /* proto*/
2907static CYTHON_INLINE void *__pyx_f_5numpy_5ufunc_3ptr___get__(PyUFuncObject *__pyx_v_self); /* proto*/
2908static CYTHON_INLINE PyObject *__pyx_f_5numpy_5ufunc_3obj___get__(PyUFuncObject *__pyx_v_self); /* proto*/
2909static CYTHON_INLINE PyObject *__pyx_f_5numpy_5ufunc_9userloops___get__(PyUFuncObject *__pyx_v_self); /* proto*/
2910
2911/* Module declarations from "libc.string" */
2912
2913/* Module declarations from "libc.stdio" */
2914
2915/* Module declarations from "__builtin__" */
2916
2917/* Module declarations from "cpython.type" */
2918
2919/* Module declarations from "cpython" */
2920
2921/* Module declarations from "cpython.object" */
2922
2923/* Module declarations from "cpython.ref" */
2924
2925/* Module declarations from "numpy" */
2926
2927/* Module declarations from "numpy" */
2928
2929/* Module declarations from "cshockCapturing" */
2930/* #### Code section: typeinfo ### */
2931/* #### Code section: before_global_var ### */
2932#define __Pyx_MODULE_NAME "cshockCapturing"
2933extern int __pyx_module_is_main_cshockCapturing;
2934int __pyx_module_is_main_cshockCapturing = 0;
2935
2936/* Implementation of "cshockCapturing" */
2937/* #### Code section: global_var ### */
2938/* #### Code section: string_decls ### */
2939/* #### Code section: decls ### */
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); /* proto */
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); /* proto */
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); /* proto */
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); /* proto */
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); /* proto */
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); /* proto */
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); /* proto */
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); /* proto */
2948/* #### Code section: late_includes ### */
2949/* #### Code section: module_state ### */
2950/* SmallCodeConfig */
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))
2956#else
2957 #define CYTHON_SMALL_CODE
2958#endif
2959#endif
2960
2961#ifdef __cplusplus
2962namespace {
2963 #endif
2964 typedef struct {
2965 PyObject *__pyx_d;
2966 PyObject *__pyx_b;
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];
2992/* #### Code section: module_state_contents ### */
2993/* CommonTypesMetaclass.module_state_decls */
2994PyTypeObject *__pyx_CommonTypesMetaclassType;
2995
2996/* CachedMethodType.module_state_decls */
2997#if CYTHON_COMPILING_IN_LIMITED_API
2998PyObject *__Pyx_CachedMethodType;
2999#endif
3000
3001/* CythonFunctionPerModule.module_state_decls */
3002PyTypeObject *__pyx_CyFunctionType;
3003
3004/* CodeObjectCache.module_state_decls */
3005struct __Pyx_CodeObjectCache __pyx_code_cache;
3006
3007/* #### Code section: module_state_end ### */
3008} __pyx_mstatetype;
3009#ifdef __cplusplus
3010} /* anonymous namespace */
3011#endif
3012
3013#if CYTHON_USE_MODULE_STATE
3014#ifdef __cplusplus
3015namespace {
3016extern struct PyModuleDef __pyx_moduledef;
3017} /* anonymous namespace */
3018#else
3019static struct PyModuleDef __pyx_moduledef;
3020#endif
3021
3022#define __pyx_mstate_global (__Pyx_PyModule_GetState(__Pyx_State_FindModule(&__pyx_moduledef)))
3023
3024#define __pyx_m (__Pyx_State_FindModule(&__pyx_moduledef))
3025#else
3026static __pyx_mstatetype __pyx_mstate_global_static =
3027#ifdef __cplusplus
3028 {};
3029#else
3030 {0};
3031#endif
3032static __pyx_mstatetype * const __pyx_mstate_global = &__pyx_mstate_global_static;
3033#endif
3034/* #### Code section: constant_name_defines ### */
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]
3087/* #### Code section: module_state_clear ### */
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);
3100 #endif
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]); }
3122/* #### Code section: module_state_clear_contents ### */
3123/* CommonTypesMetaclass.module_state_clear */
3124Py_CLEAR(clear_module_state->__pyx_CommonTypesMetaclassType);
3125
3126/* CythonFunctionPerModule.module_state_clear */
3127Py_CLEAR(clear_module_state->__pyx_CyFunctionType);
3128
3129/* #### Code section: module_state_clear_end ### */
3130return 0;
3131}
3132#endif
3133/* #### Code section: module_state_traverse ### */
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]); }
3165/* #### Code section: module_state_traverse_contents ### */
3166/* CommonTypesMetaclass.module_state_traverse */
3167Py_VISIT(traverse_module_state->__pyx_CommonTypesMetaclassType);
3168
3169/* CythonFunctionPerModule.module_state_traverse */
3170Py_VISIT(traverse_module_state->__pyx_CyFunctionType);
3171
3172/* #### Code section: module_state_traverse_end ### */
3173return 0;
3174}
3175#endif
3176/* #### Code section: module_code ### */
3177
3178/* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":230
3179 *
3180 * ctypedef class numpy.dtype [object PyArray_Descr, check_size ignore]:
3181 * @property # <<<<<<<<<<<<<<
3182 * cdef inline PyTypeObject* typeobj(self) noexcept nogil:
3183 * return PyDataType_TYPEOBJ(self)
3184*/
3185
3186static CYTHON_INLINE PyTypeObject *__pyx_f_5numpy_5dtype_7typeobj___get__(PyArray_Descr *__pyx_v_self) {
3187 PyTypeObject *__pyx_r;
3188
3189 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":232
3190 * @property
3191 * cdef inline PyTypeObject* typeobj(self) noexcept nogil:
3192 * return PyDataType_TYPEOBJ(self) # <<<<<<<<<<<<<<
3193 *
3194 * @property
3195*/
3196 {
3197
3198 __pyx_r = PyDataType_TYPEOBJ(__pyx_v_self);
3199 }
3200 goto __pyx_L0;
3201
3202 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":230
3203 *
3204 * ctypedef class numpy.dtype [object PyArray_Descr, check_size ignore]:
3205 * @property # <<<<<<<<<<<<<<
3206 * cdef inline PyTypeObject* typeobj(self) noexcept nogil:
3207 * return PyDataType_TYPEOBJ(self)
3208*/
3209
3210 /* function exit code */
3211 __pyx_L0:;
3212 return __pyx_r;
3213}
3214
3215/* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":234
3216 * return PyDataType_TYPEOBJ(self)
3217 *
3218 * @property # <<<<<<<<<<<<<<
3219 * cdef inline char kind(self) noexcept nogil:
3220 * return PyDataType_KIND(self)
3221*/
3222
3223static CYTHON_INLINE char __pyx_f_5numpy_5dtype_4kind___get__(PyArray_Descr *__pyx_v_self) {
3224 char __pyx_r;
3225
3226 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":236
3227 * @property
3228 * cdef inline char kind(self) noexcept nogil:
3229 * return PyDataType_KIND(self) # <<<<<<<<<<<<<<
3230 *
3231 * @property
3232*/
3233 {
3234
3235 __pyx_r = PyDataType_KIND(__pyx_v_self);
3236 }
3237 goto __pyx_L0;
3238
3239 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":234
3240 * return PyDataType_TYPEOBJ(self)
3241 *
3242 * @property # <<<<<<<<<<<<<<
3243 * cdef inline char kind(self) noexcept nogil:
3244 * return PyDataType_KIND(self)
3245*/
3246
3247 /* function exit code */
3248 __pyx_L0:;
3249 return __pyx_r;
3250}
3251
3252/* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":238
3253 * return PyDataType_KIND(self)
3254 *
3255 * @property # <<<<<<<<<<<<<<
3256 * cdef inline char type(self) noexcept nogil:
3257 * return PyDataType_TYPE(self)
3258*/
3259
3260static CYTHON_INLINE char __pyx_f_5numpy_5dtype_4type___get__(PyArray_Descr *__pyx_v_self) {
3261 char __pyx_r;
3262
3263 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":240
3264 * @property
3265 * cdef inline char type(self) noexcept nogil:
3266 * return PyDataType_TYPE(self) # <<<<<<<<<<<<<<
3267 *
3268 * # Numpy sometimes mutates this without warning (e.g. it'll
3269*/
3270 {
3271
3272 __pyx_r = PyDataType_TYPE(__pyx_v_self);
3273 }
3274 goto __pyx_L0;
3275
3276 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":238
3277 * return PyDataType_KIND(self)
3278 *
3279 * @property # <<<<<<<<<<<<<<
3280 * cdef inline char type(self) noexcept nogil:
3281 * return PyDataType_TYPE(self)
3282*/
3283
3284 /* function exit code */
3285 __pyx_L0:;
3286 return __pyx_r;
3287}
3288
3289/* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":247
3290 * # PyArray_IsNativeByteOrder(dtype.byteorder) instead of
3291 * # directly accessing this field.
3292 * @property # <<<<<<<<<<<<<<
3293 * cdef inline char byteorder(self) noexcept nogil:
3294 * return PyDataType_BYTEORDER(self)
3295*/
3296
3297static CYTHON_INLINE char __pyx_f_5numpy_5dtype_9byteorder___get__(PyArray_Descr *__pyx_v_self) {
3298 char __pyx_r;
3299
3300 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":249
3301 * @property
3302 * cdef inline char byteorder(self) noexcept nogil:
3303 * return PyDataType_BYTEORDER(self) # <<<<<<<<<<<<<<
3304 *
3305 * @property
3306*/
3307 {
3308
3309 __pyx_r = PyDataType_BYTEORDER(__pyx_v_self);
3310 }
3311 goto __pyx_L0;
3312
3313 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":247
3314 * # PyArray_IsNativeByteOrder(dtype.byteorder) instead of
3315 * # directly accessing this field.
3316 * @property # <<<<<<<<<<<<<<
3317 * cdef inline char byteorder(self) noexcept nogil:
3318 * return PyDataType_BYTEORDER(self)
3319*/
3320
3321 /* function exit code */
3322 __pyx_L0:;
3323 return __pyx_r;
3324}
3325
3326/* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":251
3327 * return PyDataType_BYTEORDER(self)
3328 *
3329 * @property # <<<<<<<<<<<<<<
3330 * cdef inline int type_num(self) noexcept nogil:
3331 * return PyDataType_TYPENUM(self)
3332*/
3333
3334static CYTHON_INLINE int __pyx_f_5numpy_5dtype_8type_num___get__(PyArray_Descr *__pyx_v_self) {
3335 int __pyx_r;
3336
3337 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":253
3338 * @property
3339 * cdef inline int type_num(self) noexcept nogil:
3340 * return PyDataType_TYPENUM(self) # <<<<<<<<<<<<<<
3341 *
3342 * @property
3343*/
3344 {
3345
3346 __pyx_r = PyDataType_TYPENUM(__pyx_v_self);
3347 }
3348 goto __pyx_L0;
3349
3350 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":251
3351 * return PyDataType_BYTEORDER(self)
3352 *
3353 * @property # <<<<<<<<<<<<<<
3354 * cdef inline int type_num(self) noexcept nogil:
3355 * return PyDataType_TYPENUM(self)
3356*/
3357
3358 /* function exit code */
3359 __pyx_L0:;
3360 return __pyx_r;
3361}
3362
3363/* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":255
3364 * return PyDataType_TYPENUM(self)
3365 *
3366 * @property # <<<<<<<<<<<<<<
3367 * cdef inline npy_intp itemsize(self) noexcept nogil:
3368 * return PyDataType_ELSIZE(self)
3369*/
3370
3371static CYTHON_INLINE npy_intp __pyx_f_5numpy_5dtype_8itemsize___get__(PyArray_Descr *__pyx_v_self) {
3372 npy_intp __pyx_r;
3373
3374 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":257
3375 * @property
3376 * cdef inline npy_intp itemsize(self) noexcept nogil:
3377 * return PyDataType_ELSIZE(self) # <<<<<<<<<<<<<<
3378 *
3379 * @property
3380*/
3381 {
3382
3383 __pyx_r = PyDataType_ELSIZE(__pyx_v_self);
3384 }
3385 goto __pyx_L0;
3386
3387 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":255
3388 * return PyDataType_TYPENUM(self)
3389 *
3390 * @property # <<<<<<<<<<<<<<
3391 * cdef inline npy_intp itemsize(self) noexcept nogil:
3392 * return PyDataType_ELSIZE(self)
3393*/
3394
3395 /* function exit code */
3396 __pyx_L0:;
3397 return __pyx_r;
3398}
3399
3400/* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":259
3401 * return PyDataType_ELSIZE(self)
3402 *
3403 * @property # <<<<<<<<<<<<<<
3404 * cdef inline npy_intp alignment(self) noexcept nogil:
3405 * return PyDataType_ALIGNMENT(self)
3406*/
3407
3408static CYTHON_INLINE npy_intp __pyx_f_5numpy_5dtype_9alignment___get__(PyArray_Descr *__pyx_v_self) {
3409 npy_intp __pyx_r;
3410
3411 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":261
3412 * @property
3413 * cdef inline npy_intp alignment(self) noexcept nogil:
3414 * return PyDataType_ALIGNMENT(self) # <<<<<<<<<<<<<<
3415 *
3416 * # Use fields/names with care as they may be NULL. You must check
3417*/
3418 {
3419
3420 __pyx_r = PyDataType_ALIGNMENT(__pyx_v_self);
3421 }
3422 goto __pyx_L0;
3423
3424 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":259
3425 * return PyDataType_ELSIZE(self)
3426 *
3427 * @property # <<<<<<<<<<<<<<
3428 * cdef inline npy_intp alignment(self) noexcept nogil:
3429 * return PyDataType_ALIGNMENT(self)
3430*/
3431
3432 /* function exit code */
3433 __pyx_L0:;
3434 return __pyx_r;
3435}
3436
3437/* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":265
3438 * # Use fields/names with care as they may be NULL. You must check
3439 * # for this using PyDataType_HASFIELDS.
3440 * @property # <<<<<<<<<<<<<<
3441 * cdef inline object fields(self):
3442 * return <object>PyDataType_FIELDS(self)
3443*/
3444
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);
3450
3451 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":267
3452 * @property
3453 * cdef inline object fields(self):
3454 * return <object>PyDataType_FIELDS(self) # <<<<<<<<<<<<<<
3455 *
3456 * @property
3457*/
3458 __pyx_t_1 = PyDataType_FIELDS(__pyx_v_self);
3459
3460 {
3461 PyObject *__pyx_temp;
3462 {
3463 __pyx_temp = __pyx_r;
3464 __Pyx_INCREF(((PyObject *)__pyx_t_1));
3465 __pyx_r = ((PyObject *)__pyx_t_1);
3466 }
3467 __Pyx_XDECREF(__pyx_temp);
3468 }
3469
3470 goto __pyx_L0;
3471
3472 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":265
3473 * # Use fields/names with care as they may be NULL. You must check
3474 * # for this using PyDataType_HASFIELDS.
3475 * @property # <<<<<<<<<<<<<<
3476 * cdef inline object fields(self):
3477 * return <object>PyDataType_FIELDS(self)
3478*/
3479
3480 /* function exit code */
3481 __pyx_L0:;
3482 __Pyx_XGIVEREF(__pyx_r);
3483 __Pyx_RefNannyFinishContext();
3484 return __pyx_r;
3485}
3486
3487/* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":269
3488 * return <object>PyDataType_FIELDS(self)
3489 *
3490 * @property # <<<<<<<<<<<<<<
3491 * cdef inline tuple names(self):
3492 * return <tuple>PyDataType_NAMES(self)
3493*/
3494
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);
3500
3501 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":271
3502 * @property
3503 * cdef inline tuple names(self):
3504 * return <tuple>PyDataType_NAMES(self) # <<<<<<<<<<<<<<
3505 *
3506 * # Use PyDataType_HASSUBARRAY to test whether this field is
3507*/
3508 __pyx_t_1 = PyDataType_NAMES(__pyx_v_self);
3509
3510 {
3511 PyObject *__pyx_temp;
3512 {
3513 __pyx_temp = __pyx_r;
3514 __Pyx_INCREF(((PyObject*)__pyx_t_1));
3515 __pyx_r = ((PyObject*)__pyx_t_1);
3516 }
3517 __Pyx_XDECREF(__pyx_temp);
3518 }
3519
3520 goto __pyx_L0;
3521
3522 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":269
3523 * return <object>PyDataType_FIELDS(self)
3524 *
3525 * @property # <<<<<<<<<<<<<<
3526 * cdef inline tuple names(self):
3527 * return <tuple>PyDataType_NAMES(self)
3528*/
3529
3530 /* function exit code */
3531 __pyx_L0:;
3532 __Pyx_XGIVEREF(__pyx_r);
3533 __Pyx_RefNannyFinishContext();
3534 return __pyx_r;
3535}
3536
3537/* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":276
3538 * # valid (the pointer can be NULL). Most users should access
3539 * # this field via the inline helper method PyDataType_SHAPE.
3540 * @property # <<<<<<<<<<<<<<
3541 * cdef inline PyArray_ArrayDescr* subarray(self) noexcept nogil:
3542 * return PyDataType_SUBARRAY(self)
3543*/
3544
3545static CYTHON_INLINE PyArray_ArrayDescr *__pyx_f_5numpy_5dtype_8subarray___get__(PyArray_Descr *__pyx_v_self) {
3546 PyArray_ArrayDescr *__pyx_r;
3547
3548 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":278
3549 * @property
3550 * cdef inline PyArray_ArrayDescr* subarray(self) noexcept nogil:
3551 * return PyDataType_SUBARRAY(self) # <<<<<<<<<<<<<<
3552 *
3553 * @property
3554*/
3555 {
3556
3557 __pyx_r = PyDataType_SUBARRAY(__pyx_v_self);
3558 }
3559 goto __pyx_L0;
3560
3561 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":276
3562 * # valid (the pointer can be NULL). Most users should access
3563 * # this field via the inline helper method PyDataType_SHAPE.
3564 * @property # <<<<<<<<<<<<<<
3565 * cdef inline PyArray_ArrayDescr* subarray(self) noexcept nogil:
3566 * return PyDataType_SUBARRAY(self)
3567*/
3568
3569 /* function exit code */
3570 __pyx_L0:;
3571 return __pyx_r;
3572}
3573
3574/* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":280
3575 * return PyDataType_SUBARRAY(self)
3576 *
3577 * @property # <<<<<<<<<<<<<<
3578 * cdef inline npy_uint64 flags(self) noexcept nogil:
3579 * """The data types flags."""
3580*/
3581
3582static CYTHON_INLINE npy_uint64 __pyx_f_5numpy_5dtype_5flags___get__(PyArray_Descr *__pyx_v_self) {
3583 npy_uint64 __pyx_r;
3584
3585 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":283
3586 * cdef inline npy_uint64 flags(self) noexcept nogil:
3587 * """The data types flags."""
3588 * return PyDataType_FLAGS(self) # <<<<<<<<<<<<<<
3589 *
3590 *
3591*/
3592 {
3593
3594 __pyx_r = PyDataType_FLAGS(__pyx_v_self);
3595 }
3596 goto __pyx_L0;
3597
3598 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":280
3599 * return PyDataType_SUBARRAY(self)
3600 *
3601 * @property # <<<<<<<<<<<<<<
3602 * cdef inline npy_uint64 flags(self) noexcept nogil:
3603 * """The data types flags."""
3604*/
3605
3606 /* function exit code */
3607 __pyx_L0:;
3608 return __pyx_r;
3609}
3610
3611/* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":292
3612 * ctypedef class numpy.broadcast [object PyArrayMultiIterObject, check_size ignore]:
3613 *
3614 * @property # <<<<<<<<<<<<<<
3615 * cdef inline int numiter(self) noexcept nogil:
3616 * """The number of arrays that need to be broadcast to the same shape."""
3617*/
3618
3619static CYTHON_INLINE int __pyx_f_5numpy_9broadcast_7numiter___get__(PyArrayMultiIterObject *__pyx_v_self) {
3620 int __pyx_r;
3621
3622 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":295
3623 * cdef inline int numiter(self) noexcept nogil:
3624 * """The number of arrays that need to be broadcast to the same shape."""
3625 * return PyArray_MultiIter_NUMITER(self) # <<<<<<<<<<<<<<
3626 *
3627 * @property
3628*/
3629 {
3630
3631 __pyx_r = PyArray_MultiIter_NUMITER(__pyx_v_self);
3632 }
3633 goto __pyx_L0;
3634
3635 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":292
3636 * ctypedef class numpy.broadcast [object PyArrayMultiIterObject, check_size ignore]:
3637 *
3638 * @property # <<<<<<<<<<<<<<
3639 * cdef inline int numiter(self) noexcept nogil:
3640 * """The number of arrays that need to be broadcast to the same shape."""
3641*/
3642
3643 /* function exit code */
3644 __pyx_L0:;
3645 return __pyx_r;
3646}
3647
3648/* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":297
3649 * return PyArray_MultiIter_NUMITER(self)
3650 *
3651 * @property # <<<<<<<<<<<<<<
3652 * cdef inline npy_intp size(self) noexcept nogil:
3653 * """The total broadcasted size."""
3654*/
3655
3656static CYTHON_INLINE npy_intp __pyx_f_5numpy_9broadcast_4size___get__(PyArrayMultiIterObject *__pyx_v_self) {
3657 npy_intp __pyx_r;
3658
3659 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":300
3660 * cdef inline npy_intp size(self) noexcept nogil:
3661 * """The total broadcasted size."""
3662 * return PyArray_MultiIter_SIZE(self) # <<<<<<<<<<<<<<
3663 *
3664 * @property
3665*/
3666 {
3667
3668 __pyx_r = PyArray_MultiIter_SIZE(__pyx_v_self);
3669 }
3670 goto __pyx_L0;
3671
3672 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":297
3673 * return PyArray_MultiIter_NUMITER(self)
3674 *
3675 * @property # <<<<<<<<<<<<<<
3676 * cdef inline npy_intp size(self) noexcept nogil:
3677 * """The total broadcasted size."""
3678*/
3679
3680 /* function exit code */
3681 __pyx_L0:;
3682 return __pyx_r;
3683}
3684
3685/* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":302
3686 * return PyArray_MultiIter_SIZE(self)
3687 *
3688 * @property # <<<<<<<<<<<<<<
3689 * cdef inline npy_intp index(self) noexcept nogil:
3690 * """The current (1-d) index into the broadcasted result."""
3691*/
3692
3693static CYTHON_INLINE npy_intp __pyx_f_5numpy_9broadcast_5index___get__(PyArrayMultiIterObject *__pyx_v_self) {
3694 npy_intp __pyx_r;
3695
3696 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":305
3697 * cdef inline npy_intp index(self) noexcept nogil:
3698 * """The current (1-d) index into the broadcasted result."""
3699 * return PyArray_MultiIter_INDEX(self) # <<<<<<<<<<<<<<
3700 *
3701 * @property
3702*/
3703 {
3704
3705 __pyx_r = PyArray_MultiIter_INDEX(__pyx_v_self);
3706 }
3707 goto __pyx_L0;
3708
3709 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":302
3710 * return PyArray_MultiIter_SIZE(self)
3711 *
3712 * @property # <<<<<<<<<<<<<<
3713 * cdef inline npy_intp index(self) noexcept nogil:
3714 * """The current (1-d) index into the broadcasted result."""
3715*/
3716
3717 /* function exit code */
3718 __pyx_L0:;
3719 return __pyx_r;
3720}
3721
3722/* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":307
3723 * return PyArray_MultiIter_INDEX(self)
3724 *
3725 * @property # <<<<<<<<<<<<<<
3726 * cdef inline int nd(self) noexcept nogil:
3727 * """The number of dimensions in the broadcasted result."""
3728*/
3729
3730static CYTHON_INLINE int __pyx_f_5numpy_9broadcast_2nd___get__(PyArrayMultiIterObject *__pyx_v_self) {
3731 int __pyx_r;
3732
3733 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":310
3734 * cdef inline int nd(self) noexcept nogil:
3735 * """The number of dimensions in the broadcasted result."""
3736 * return PyArray_MultiIter_NDIM(self) # <<<<<<<<<<<<<<
3737 *
3738 * @property
3739*/
3740 {
3741
3742 __pyx_r = PyArray_MultiIter_NDIM(__pyx_v_self);
3743 }
3744 goto __pyx_L0;
3745
3746 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":307
3747 * return PyArray_MultiIter_INDEX(self)
3748 *
3749 * @property # <<<<<<<<<<<<<<
3750 * cdef inline int nd(self) noexcept nogil:
3751 * """The number of dimensions in the broadcasted result."""
3752*/
3753
3754 /* function exit code */
3755 __pyx_L0:;
3756 return __pyx_r;
3757}
3758
3759/* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":312
3760 * return PyArray_MultiIter_NDIM(self)
3761 *
3762 * @property # <<<<<<<<<<<<<<
3763 * cdef inline npy_intp* dimensions(self) noexcept nogil:
3764 * """The shape of the broadcasted result."""
3765*/
3766
3767static CYTHON_INLINE npy_intp *__pyx_f_5numpy_9broadcast_10dimensions___get__(PyArrayMultiIterObject *__pyx_v_self) {
3768 npy_intp *__pyx_r;
3769
3770 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":315
3771 * cdef inline npy_intp* dimensions(self) noexcept nogil:
3772 * """The shape of the broadcasted result."""
3773 * return PyArray_MultiIter_DIMS(self) # <<<<<<<<<<<<<<
3774 *
3775 * @property
3776*/
3777 {
3778
3779 __pyx_r = PyArray_MultiIter_DIMS(__pyx_v_self);
3780 }
3781 goto __pyx_L0;
3782
3783 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":312
3784 * return PyArray_MultiIter_NDIM(self)
3785 *
3786 * @property # <<<<<<<<<<<<<<
3787 * cdef inline npy_intp* dimensions(self) noexcept nogil:
3788 * """The shape of the broadcasted result."""
3789*/
3790
3791 /* function exit code */
3792 __pyx_L0:;
3793 return __pyx_r;
3794}
3795
3796/* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":317
3797 * return PyArray_MultiIter_DIMS(self)
3798 *
3799 * @property # <<<<<<<<<<<<<<
3800 * cdef inline void** iters(self) noexcept nogil:
3801 * """An array of iterator objects that holds the iterators for the arrays to be broadcast together.
3802*/
3803
3804static CYTHON_INLINE void **__pyx_f_5numpy_9broadcast_5iters___get__(PyArrayMultiIterObject *__pyx_v_self) {
3805 void **__pyx_r;
3806
3807 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":321
3808 * """An array of iterator objects that holds the iterators for the arrays to be broadcast together.
3809 * On return, the iterators are adjusted for broadcasting."""
3810 * return PyArray_MultiIter_ITERS(self) # <<<<<<<<<<<<<<
3811 *
3812 *
3813*/
3814 {
3815
3816 __pyx_r = PyArray_MultiIter_ITERS(__pyx_v_self);
3817 }
3818 goto __pyx_L0;
3819
3820 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":317
3821 * return PyArray_MultiIter_DIMS(self)
3822 *
3823 * @property # <<<<<<<<<<<<<<
3824 * cdef inline void** iters(self) noexcept nogil:
3825 * """An array of iterator objects that holds the iterators for the arrays to be broadcast together.
3826*/
3827
3828 /* function exit code */
3829 __pyx_L0:;
3830 return __pyx_r;
3831}
3832
3833/* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":335
3834 * # Instead, we use properties that map to the corresponding C-API functions.
3835 *
3836 * @property # <<<<<<<<<<<<<<
3837 * cdef inline PyObject* base(self) noexcept nogil:
3838 * """Returns a borrowed reference to the object owning the data/memory.
3839*/
3840
3841static CYTHON_INLINE PyObject *__pyx_f_5numpy_7ndarray_4base___get__(PyArrayObject *__pyx_v_self) {
3842 PyObject *__pyx_r;
3843
3844 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":339
3845 * """Returns a borrowed reference to the object owning the data/memory.
3846 * """
3847 * return PyArray_BASE(self) # <<<<<<<<<<<<<<
3848 *
3849 * @property
3850*/
3851 {
3852
3853 __pyx_r = PyArray_BASE(__pyx_v_self);
3854 }
3855 goto __pyx_L0;
3856
3857 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":335
3858 * # Instead, we use properties that map to the corresponding C-API functions.
3859 *
3860 * @property # <<<<<<<<<<<<<<
3861 * cdef inline PyObject* base(self) noexcept nogil:
3862 * """Returns a borrowed reference to the object owning the data/memory.
3863*/
3864
3865 /* function exit code */
3866 __pyx_L0:;
3867 return __pyx_r;
3868}
3869
3870/* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":341
3871 * return PyArray_BASE(self)
3872 *
3873 * @property # <<<<<<<<<<<<<<
3874 * cdef inline dtype descr(self):
3875 * """Returns an owned reference to the dtype of the array.
3876*/
3877
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);
3883
3884 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":345
3885 * """Returns an owned reference to the dtype of the array.
3886 * """
3887 * return <dtype>PyArray_DESCR(self) # <<<<<<<<<<<<<<
3888 *
3889 * @property
3890*/
3891 __pyx_t_1 = PyArray_DESCR(__pyx_v_self);
3892
3893 {
3894 PyArray_Descr *__pyx_temp;
3895 {
3896 __pyx_temp = __pyx_r;
3897 __Pyx_INCREF((PyObject *)((PyArray_Descr *)__pyx_t_1));
3898 __pyx_r = ((PyArray_Descr *)__pyx_t_1);
3899 }
3900 __Pyx_XDECREF((PyObject *)__pyx_temp);
3901 }
3902
3903 goto __pyx_L0;
3904
3905 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":341
3906 * return PyArray_BASE(self)
3907 *
3908 * @property # <<<<<<<<<<<<<<
3909 * cdef inline dtype descr(self):
3910 * """Returns an owned reference to the dtype of the array.
3911*/
3912
3913 /* function exit code */
3914 __pyx_L0:;
3915 __Pyx_XGIVEREF((PyObject *)__pyx_r);
3916 __Pyx_RefNannyFinishContext();
3917 return __pyx_r;
3918}
3919
3920/* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":347
3921 * return <dtype>PyArray_DESCR(self)
3922 *
3923 * @property # <<<<<<<<<<<<<<
3924 * cdef inline int ndim(self) noexcept nogil:
3925 * """Returns the number of dimensions in the array.
3926*/
3927
3928static CYTHON_INLINE int __pyx_f_5numpy_7ndarray_4ndim___get__(PyArrayObject *__pyx_v_self) {
3929 int __pyx_r;
3930
3931 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":351
3932 * """Returns the number of dimensions in the array.
3933 * """
3934 * return PyArray_NDIM(self) # <<<<<<<<<<<<<<
3935 *
3936 * @property
3937*/
3938 {
3939
3940 __pyx_r = PyArray_NDIM(__pyx_v_self);
3941 }
3942 goto __pyx_L0;
3943
3944 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":347
3945 * return <dtype>PyArray_DESCR(self)
3946 *
3947 * @property # <<<<<<<<<<<<<<
3948 * cdef inline int ndim(self) noexcept nogil:
3949 * """Returns the number of dimensions in the array.
3950*/
3951
3952 /* function exit code */
3953 __pyx_L0:;
3954 return __pyx_r;
3955}
3956
3957/* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":353
3958 * return PyArray_NDIM(self)
3959 *
3960 * @property # <<<<<<<<<<<<<<
3961 * cdef inline npy_intp *shape(self) noexcept nogil:
3962 * """Returns a pointer to the dimensions/shape of the array.
3963*/
3964
3965static CYTHON_INLINE npy_intp *__pyx_f_5numpy_7ndarray_5shape___get__(PyArrayObject *__pyx_v_self) {
3966 npy_intp *__pyx_r;
3967
3968 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":359
3969 * Can return NULL for 0-dimensional arrays.
3970 * """
3971 * return PyArray_DIMS(self) # <<<<<<<<<<<<<<
3972 *
3973 * @property
3974*/
3975 {
3976
3977 __pyx_r = PyArray_DIMS(__pyx_v_self);
3978 }
3979 goto __pyx_L0;
3980
3981 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":353
3982 * return PyArray_NDIM(self)
3983 *
3984 * @property # <<<<<<<<<<<<<<
3985 * cdef inline npy_intp *shape(self) noexcept nogil:
3986 * """Returns a pointer to the dimensions/shape of the array.
3987*/
3988
3989 /* function exit code */
3990 __pyx_L0:;
3991 return __pyx_r;
3992}
3993
3994/* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":361
3995 * return PyArray_DIMS(self)
3996 *
3997 * @property # <<<<<<<<<<<<<<
3998 * cdef inline npy_intp *strides(self) noexcept nogil:
3999 * """Returns a pointer to the strides of the array.
4000*/
4001
4002static CYTHON_INLINE npy_intp *__pyx_f_5numpy_7ndarray_7strides___get__(PyArrayObject *__pyx_v_self) {
4003 npy_intp *__pyx_r;
4004
4005 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":366
4006 * The number of elements matches the number of dimensions of the array (ndim).
4007 * """
4008 * return PyArray_STRIDES(self) # <<<<<<<<<<<<<<
4009 *
4010 * @property
4011*/
4012 {
4013
4014 __pyx_r = PyArray_STRIDES(__pyx_v_self);
4015 }
4016 goto __pyx_L0;
4017
4018 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":361
4019 * return PyArray_DIMS(self)
4020 *
4021 * @property # <<<<<<<<<<<<<<
4022 * cdef inline npy_intp *strides(self) noexcept nogil:
4023 * """Returns a pointer to the strides of the array.
4024*/
4025
4026 /* function exit code */
4027 __pyx_L0:;
4028 return __pyx_r;
4029}
4030
4031/* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":368
4032 * return PyArray_STRIDES(self)
4033 *
4034 * @property # <<<<<<<<<<<<<<
4035 * cdef inline npy_intp size(self) noexcept nogil:
4036 * """Returns the total size (in number of elements) of the array.
4037*/
4038
4039static CYTHON_INLINE npy_intp __pyx_f_5numpy_7ndarray_4size___get__(PyArrayObject *__pyx_v_self) {
4040 npy_intp __pyx_r;
4041
4042 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":372
4043 * """Returns the total size (in number of elements) of the array.
4044 * """
4045 * return PyArray_SIZE(self) # <<<<<<<<<<<<<<
4046 *
4047 * @property
4048*/
4049 {
4050
4051 __pyx_r = PyArray_SIZE(__pyx_v_self);
4052 }
4053 goto __pyx_L0;
4054
4055 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":368
4056 * return PyArray_STRIDES(self)
4057 *
4058 * @property # <<<<<<<<<<<<<<
4059 * cdef inline npy_intp size(self) noexcept nogil:
4060 * """Returns the total size (in number of elements) of the array.
4061*/
4062
4063 /* function exit code */
4064 __pyx_L0:;
4065 return __pyx_r;
4066}
4067
4068/* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":374
4069 * return PyArray_SIZE(self)
4070 *
4071 * @property # <<<<<<<<<<<<<<
4072 * cdef inline char* data(self) noexcept nogil:
4073 * """The pointer to the data buffer as a char*.
4074*/
4075
4076static CYTHON_INLINE char *__pyx_f_5numpy_7ndarray_4data___get__(PyArrayObject *__pyx_v_self) {
4077 char *__pyx_r;
4078
4079 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":381
4080 * of `PyArray_DATA()` instead, which returns a 'void*'.
4081 * """
4082 * return PyArray_BYTES(self) # <<<<<<<<<<<<<<
4083 *
4084 *
4085*/
4086 {
4087
4088 __pyx_r = PyArray_BYTES(__pyx_v_self);
4089 }
4090 goto __pyx_L0;
4091
4092 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":374
4093 * return PyArray_SIZE(self)
4094 *
4095 * @property # <<<<<<<<<<<<<<
4096 * cdef inline char* data(self) noexcept nogil:
4097 * """The pointer to the data buffer as a char*.
4098*/
4099
4100 /* function exit code */
4101 __pyx_L0:;
4102 return __pyx_r;
4103}
4104
4105/* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":794
4106 * ctypedef long double complex clongdouble_t
4107 *
4108 * cdef inline object PyArray_MultiIterNew1(a): # <<<<<<<<<<<<<<
4109 * return PyArray_MultiIterNew(1, <void*>a)
4110 *
4111*/
4112
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);
4121
4122 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":795
4123 *
4124 * cdef inline object PyArray_MultiIterNew1(a):
4125 * return PyArray_MultiIterNew(1, <void*>a) # <<<<<<<<<<<<<<
4126 *
4127 * cdef inline object PyArray_MultiIterNew2(a, b):
4128*/
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);
4131 {
4132 PyObject *__pyx_temp;
4133 {
4134 __pyx_temp = __pyx_r;
4135 __pyx_r = __pyx_t_1;
4136 }
4137 __Pyx_XDECREF(__pyx_temp);
4138 }
4139 __pyx_t_1 = 0;
4140 goto __pyx_L0;
4141
4142 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":794
4143 * ctypedef long double complex clongdouble_t
4144 *
4145 * cdef inline object PyArray_MultiIterNew1(a): # <<<<<<<<<<<<<<
4146 * return PyArray_MultiIterNew(1, <void*>a)
4147 *
4148*/
4149
4150 /* function exit code */
4151 __pyx_L1_error:;
4152 __Pyx_XDECREF(__pyx_t_1);
4153 __Pyx_AddTraceback("numpy.PyArray_MultiIterNew1", __pyx_clineno, __pyx_lineno, __pyx_filename);
4154 __pyx_r = 0;
4155 __pyx_L0:;
4156 __Pyx_XGIVEREF(__pyx_r);
4157 __Pyx_RefNannyFinishContext();
4158 return __pyx_r;
4159}
4160
4161/* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":797
4162 * return PyArray_MultiIterNew(1, <void*>a)
4163 *
4164 * cdef inline object PyArray_MultiIterNew2(a, b): # <<<<<<<<<<<<<<
4165 * return PyArray_MultiIterNew(2, <void*>a, <void*>b)
4166 *
4167*/
4168
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);
4177
4178 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":798
4179 *
4180 * cdef inline object PyArray_MultiIterNew2(a, b):
4181 * return PyArray_MultiIterNew(2, <void*>a, <void*>b) # <<<<<<<<<<<<<<
4182 *
4183 * cdef inline object PyArray_MultiIterNew3(a, b, c):
4184*/
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);
4187 {
4188 PyObject *__pyx_temp;
4189 {
4190 __pyx_temp = __pyx_r;
4191 __pyx_r = __pyx_t_1;
4192 }
4193 __Pyx_XDECREF(__pyx_temp);
4194 }
4195 __pyx_t_1 = 0;
4196 goto __pyx_L0;
4197
4198 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":797
4199 * return PyArray_MultiIterNew(1, <void*>a)
4200 *
4201 * cdef inline object PyArray_MultiIterNew2(a, b): # <<<<<<<<<<<<<<
4202 * return PyArray_MultiIterNew(2, <void*>a, <void*>b)
4203 *
4204*/
4205
4206 /* function exit code */
4207 __pyx_L1_error:;
4208 __Pyx_XDECREF(__pyx_t_1);
4209 __Pyx_AddTraceback("numpy.PyArray_MultiIterNew2", __pyx_clineno, __pyx_lineno, __pyx_filename);
4210 __pyx_r = 0;
4211 __pyx_L0:;
4212 __Pyx_XGIVEREF(__pyx_r);
4213 __Pyx_RefNannyFinishContext();
4214 return __pyx_r;
4215}
4216
4217/* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":800
4218 * return PyArray_MultiIterNew(2, <void*>a, <void*>b)
4219 *
4220 * cdef inline object PyArray_MultiIterNew3(a, b, c): # <<<<<<<<<<<<<<
4221 * return PyArray_MultiIterNew(3, <void*>a, <void*>b, <void*> c)
4222 *
4223*/
4224
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);
4233
4234 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":801
4235 *
4236 * cdef inline object PyArray_MultiIterNew3(a, b, c):
4237 * return PyArray_MultiIterNew(3, <void*>a, <void*>b, <void*> c) # <<<<<<<<<<<<<<
4238 *
4239 * cdef inline object PyArray_MultiIterNew4(a, b, c, d):
4240*/
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);
4243 {
4244 PyObject *__pyx_temp;
4245 {
4246 __pyx_temp = __pyx_r;
4247 __pyx_r = __pyx_t_1;
4248 }
4249 __Pyx_XDECREF(__pyx_temp);
4250 }
4251 __pyx_t_1 = 0;
4252 goto __pyx_L0;
4253
4254 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":800
4255 * return PyArray_MultiIterNew(2, <void*>a, <void*>b)
4256 *
4257 * cdef inline object PyArray_MultiIterNew3(a, b, c): # <<<<<<<<<<<<<<
4258 * return PyArray_MultiIterNew(3, <void*>a, <void*>b, <void*> c)
4259 *
4260*/
4261
4262 /* function exit code */
4263 __pyx_L1_error:;
4264 __Pyx_XDECREF(__pyx_t_1);
4265 __Pyx_AddTraceback("numpy.PyArray_MultiIterNew3", __pyx_clineno, __pyx_lineno, __pyx_filename);
4266 __pyx_r = 0;
4267 __pyx_L0:;
4268 __Pyx_XGIVEREF(__pyx_r);
4269 __Pyx_RefNannyFinishContext();
4270 return __pyx_r;
4271}
4272
4273/* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":803
4274 * return PyArray_MultiIterNew(3, <void*>a, <void*>b, <void*> c)
4275 *
4276 * cdef inline object PyArray_MultiIterNew4(a, b, c, d): # <<<<<<<<<<<<<<
4277 * return PyArray_MultiIterNew(4, <void*>a, <void*>b, <void*>c, <void*> d)
4278 *
4279*/
4280
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);
4289
4290 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":804
4291 *
4292 * cdef inline object PyArray_MultiIterNew4(a, b, c, d):
4293 * return PyArray_MultiIterNew(4, <void*>a, <void*>b, <void*>c, <void*> d) # <<<<<<<<<<<<<<
4294 *
4295 * cdef inline object PyArray_MultiIterNew5(a, b, c, d, e):
4296*/
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);
4299 {
4300 PyObject *__pyx_temp;
4301 {
4302 __pyx_temp = __pyx_r;
4303 __pyx_r = __pyx_t_1;
4304 }
4305 __Pyx_XDECREF(__pyx_temp);
4306 }
4307 __pyx_t_1 = 0;
4308 goto __pyx_L0;
4309
4310 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":803
4311 * return PyArray_MultiIterNew(3, <void*>a, <void*>b, <void*> c)
4312 *
4313 * cdef inline object PyArray_MultiIterNew4(a, b, c, d): # <<<<<<<<<<<<<<
4314 * return PyArray_MultiIterNew(4, <void*>a, <void*>b, <void*>c, <void*> d)
4315 *
4316*/
4317
4318 /* function exit code */
4319 __pyx_L1_error:;
4320 __Pyx_XDECREF(__pyx_t_1);
4321 __Pyx_AddTraceback("numpy.PyArray_MultiIterNew4", __pyx_clineno, __pyx_lineno, __pyx_filename);
4322 __pyx_r = 0;
4323 __pyx_L0:;
4324 __Pyx_XGIVEREF(__pyx_r);
4325 __Pyx_RefNannyFinishContext();
4326 return __pyx_r;
4327}
4328
4329/* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":806
4330 * return PyArray_MultiIterNew(4, <void*>a, <void*>b, <void*>c, <void*> d)
4331 *
4332 * cdef inline object PyArray_MultiIterNew5(a, b, c, d, e): # <<<<<<<<<<<<<<
4333 * return PyArray_MultiIterNew(5, <void*>a, <void*>b, <void*>c, <void*> d, <void*> e)
4334 *
4335*/
4336
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);
4345
4346 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":807
4347 *
4348 * cdef inline object PyArray_MultiIterNew5(a, b, c, d, e):
4349 * return PyArray_MultiIterNew(5, <void*>a, <void*>b, <void*>c, <void*> d, <void*> e) # <<<<<<<<<<<<<<
4350 *
4351 * cdef inline tuple PyDataType_SHAPE(dtype d):
4352*/
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);
4355 {
4356 PyObject *__pyx_temp;
4357 {
4358 __pyx_temp = __pyx_r;
4359 __pyx_r = __pyx_t_1;
4360 }
4361 __Pyx_XDECREF(__pyx_temp);
4362 }
4363 __pyx_t_1 = 0;
4364 goto __pyx_L0;
4365
4366 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":806
4367 * return PyArray_MultiIterNew(4, <void*>a, <void*>b, <void*>c, <void*> d)
4368 *
4369 * cdef inline object PyArray_MultiIterNew5(a, b, c, d, e): # <<<<<<<<<<<<<<
4370 * return PyArray_MultiIterNew(5, <void*>a, <void*>b, <void*>c, <void*> d, <void*> e)
4371 *
4372*/
4373
4374 /* function exit code */
4375 __pyx_L1_error:;
4376 __Pyx_XDECREF(__pyx_t_1);
4377 __Pyx_AddTraceback("numpy.PyArray_MultiIterNew5", __pyx_clineno, __pyx_lineno, __pyx_filename);
4378 __pyx_r = 0;
4379 __pyx_L0:;
4380 __Pyx_XGIVEREF(__pyx_r);
4381 __Pyx_RefNannyFinishContext();
4382 return __pyx_r;
4383}
4384
4385/* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":809
4386 * return PyArray_MultiIterNew(5, <void*>a, <void*>b, <void*>c, <void*> d, <void*> e)
4387 *
4388 * cdef inline tuple PyDataType_SHAPE(dtype d): # <<<<<<<<<<<<<<
4389 * if PyDataType_HASSUBARRAY(d):
4390 * return <tuple>d.subarray.shape
4391*/
4392
4393static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyDataType_SHAPE(PyArray_Descr *__pyx_v_d) {
4394 PyObject *__pyx_r = NULL;
4395 __Pyx_RefNannyDeclarations
4396 int __pyx_t_1;
4397 PyObject *__pyx_t_2;
4398 __Pyx_RefNannySetupContext("PyDataType_SHAPE", 0);
4399
4400 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":810
4401 *
4402 * cdef inline tuple PyDataType_SHAPE(dtype d):
4403 * if PyDataType_HASSUBARRAY(d): # <<<<<<<<<<<<<<
4404 * return <tuple>d.subarray.shape
4405 * else:
4406*/
4407 __pyx_t_1 = PyDataType_HASSUBARRAY(__pyx_v_d);
4408
4409 if (__pyx_t_1) {
4410
4411
4412 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":811
4413 * cdef inline tuple PyDataType_SHAPE(dtype d):
4414 * if PyDataType_HASSUBARRAY(d):
4415 * return <tuple>d.subarray.shape # <<<<<<<<<<<<<<
4416 * else:
4417 * return ()
4418*/
4419 __pyx_t_2 = __pyx_f_5numpy_5dtype_8subarray___get__(__pyx_v_d)->shape;
4420
4421 {
4422 PyObject *__pyx_temp;
4423 {
4424 __pyx_temp = __pyx_r;
4425 __Pyx_INCREF(((PyObject*)__pyx_t_2));
4426 __pyx_r = ((PyObject*)__pyx_t_2);
4427 }
4428 __Pyx_XDECREF(__pyx_temp);
4429 }
4430
4431 goto __pyx_L0;
4432
4433 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":810
4434 *
4435 * cdef inline tuple PyDataType_SHAPE(dtype d):
4436 * if PyDataType_HASSUBARRAY(d): # <<<<<<<<<<<<<<
4437 * return <tuple>d.subarray.shape
4438 * else:
4439*/
4440 }
4441
4442 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":813
4443 * return <tuple>d.subarray.shape
4444 * else:
4445 * return () # <<<<<<<<<<<<<<
4446 *
4447 *
4448*/
4449 /*else*/ {
4450 {
4451 PyObject *__pyx_temp;
4452 {
4453 __pyx_temp = __pyx_r;
4454 __Pyx_INCREF(__pyx_mstate_global->__pyx_empty_tuple);
4455 __pyx_r = __pyx_mstate_global->__pyx_empty_tuple;
4456 }
4457 __Pyx_XDECREF(__pyx_temp);
4458 }
4459 goto __pyx_L0;
4460 }
4461
4462 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":809
4463 * return PyArray_MultiIterNew(5, <void*>a, <void*>b, <void*>c, <void*> d, <void*> e)
4464 *
4465 * cdef inline tuple PyDataType_SHAPE(dtype d): # <<<<<<<<<<<<<<
4466 * if PyDataType_HASSUBARRAY(d):
4467 * return <tuple>d.subarray.shape
4468*/
4469
4470 /* function exit code */
4471 __pyx_L0:;
4472 __Pyx_XGIVEREF(__pyx_r);
4473 __Pyx_RefNannyFinishContext();
4474 return __pyx_r;
4475}
4476
4477/* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":947
4478 *
4479 * ctypedef class numpy.ufunc [object PyUFuncObject, check_size ignore]:
4480 * @property # <<<<<<<<<<<<<<
4481 * cdef inline int nin(self) noexcept nogil:
4482 * return _PyUFuncObject_GET_ITEM_DATA(self).nin
4483*/
4484
4485static CYTHON_INLINE int __pyx_f_5numpy_5ufunc_3nin___get__(PyUFuncObject *__pyx_v_self) {
4486 int __pyx_r;
4487
4488 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":949
4489 * @property
4490 * cdef inline int nin(self) noexcept nogil:
4491 * return _PyUFuncObject_GET_ITEM_DATA(self).nin # <<<<<<<<<<<<<<
4492 *
4493 * @property
4494*/
4495 {
4496
4497 __pyx_r = _PyUFuncObject_GET_ITEM_DATA(__pyx_v_self)->nin;
4498 }
4499 goto __pyx_L0;
4500
4501 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":947
4502 *
4503 * ctypedef class numpy.ufunc [object PyUFuncObject, check_size ignore]:
4504 * @property # <<<<<<<<<<<<<<
4505 * cdef inline int nin(self) noexcept nogil:
4506 * return _PyUFuncObject_GET_ITEM_DATA(self).nin
4507*/
4508
4509 /* function exit code */
4510 __pyx_L0:;
4511 return __pyx_r;
4512}
4513
4514/* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":951
4515 * return _PyUFuncObject_GET_ITEM_DATA(self).nin
4516 *
4517 * @property # <<<<<<<<<<<<<<
4518 * cdef inline int nout(self) noexcept nogil:
4519 * return _PyUFuncObject_GET_ITEM_DATA(self).nout
4520*/
4521
4522static CYTHON_INLINE int __pyx_f_5numpy_5ufunc_4nout___get__(PyUFuncObject *__pyx_v_self) {
4523 int __pyx_r;
4524
4525 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":953
4526 * @property
4527 * cdef inline int nout(self) noexcept nogil:
4528 * return _PyUFuncObject_GET_ITEM_DATA(self).nout # <<<<<<<<<<<<<<
4529 *
4530 * @property
4531*/
4532 {
4533
4534 __pyx_r = _PyUFuncObject_GET_ITEM_DATA(__pyx_v_self)->nout;
4535 }
4536 goto __pyx_L0;
4537
4538 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":951
4539 * return _PyUFuncObject_GET_ITEM_DATA(self).nin
4540 *
4541 * @property # <<<<<<<<<<<<<<
4542 * cdef inline int nout(self) noexcept nogil:
4543 * return _PyUFuncObject_GET_ITEM_DATA(self).nout
4544*/
4545
4546 /* function exit code */
4547 __pyx_L0:;
4548 return __pyx_r;
4549}
4550
4551/* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":955
4552 * return _PyUFuncObject_GET_ITEM_DATA(self).nout
4553 *
4554 * @property # <<<<<<<<<<<<<<
4555 * cdef inline int nargs(self) noexcept nogil:
4556 * return _PyUFuncObject_GET_ITEM_DATA(self).nargs
4557*/
4558
4559static CYTHON_INLINE int __pyx_f_5numpy_5ufunc_5nargs___get__(PyUFuncObject *__pyx_v_self) {
4560 int __pyx_r;
4561
4562 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":957
4563 * @property
4564 * cdef inline int nargs(self) noexcept nogil:
4565 * return _PyUFuncObject_GET_ITEM_DATA(self).nargs # <<<<<<<<<<<<<<
4566 *
4567 * @property
4568*/
4569 {
4570
4571 __pyx_r = _PyUFuncObject_GET_ITEM_DATA(__pyx_v_self)->nargs;
4572 }
4573 goto __pyx_L0;
4574
4575 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":955
4576 * return _PyUFuncObject_GET_ITEM_DATA(self).nout
4577 *
4578 * @property # <<<<<<<<<<<<<<
4579 * cdef inline int nargs(self) noexcept nogil:
4580 * return _PyUFuncObject_GET_ITEM_DATA(self).nargs
4581*/
4582
4583 /* function exit code */
4584 __pyx_L0:;
4585 return __pyx_r;
4586}
4587
4588/* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":959
4589 * return _PyUFuncObject_GET_ITEM_DATA(self).nargs
4590 *
4591 * @property # <<<<<<<<<<<<<<
4592 * cdef inline PyUFuncGenericFunction* functions(self) noexcept nogil:
4593 * return _PyUFuncObject_GET_ITEM_DATA(self).functions
4594*/
4595
4596static CYTHON_INLINE PyUFuncGenericFunction *__pyx_f_5numpy_5ufunc_9functions___get__(PyUFuncObject *__pyx_v_self) {
4597 PyUFuncGenericFunction *__pyx_r;
4598
4599 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":961
4600 * @property
4601 * cdef inline PyUFuncGenericFunction* functions(self) noexcept nogil:
4602 * return _PyUFuncObject_GET_ITEM_DATA(self).functions # <<<<<<<<<<<<<<
4603 *
4604 * @property
4605*/
4606 {
4607
4608 __pyx_r = _PyUFuncObject_GET_ITEM_DATA(__pyx_v_self)->functions;
4609 }
4610 goto __pyx_L0;
4611
4612 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":959
4613 * return _PyUFuncObject_GET_ITEM_DATA(self).nargs
4614 *
4615 * @property # <<<<<<<<<<<<<<
4616 * cdef inline PyUFuncGenericFunction* functions(self) noexcept nogil:
4617 * return _PyUFuncObject_GET_ITEM_DATA(self).functions
4618*/
4619
4620 /* function exit code */
4621 __pyx_L0:;
4622 return __pyx_r;
4623}
4624
4625/* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":963
4626 * return _PyUFuncObject_GET_ITEM_DATA(self).functions
4627 *
4628 * @property # <<<<<<<<<<<<<<
4629 * cdef inline void ** data(self) noexcept nogil:
4630 * return <void **>_PyUFuncObject_GET_ITEM_DATA(self).data
4631*/
4632
4633static CYTHON_INLINE void **__pyx_f_5numpy_5ufunc_4data___get__(PyUFuncObject *__pyx_v_self) {
4634 void **__pyx_r;
4635
4636 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":965
4637 * @property
4638 * cdef inline void ** data(self) noexcept nogil:
4639 * return <void **>_PyUFuncObject_GET_ITEM_DATA(self).data # <<<<<<<<<<<<<<
4640 *
4641 * @property
4642*/
4643 {
4644
4645 __pyx_r = ((void **)_PyUFuncObject_GET_ITEM_DATA(__pyx_v_self)->data);
4646 }
4647 goto __pyx_L0;
4648
4649 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":963
4650 * return _PyUFuncObject_GET_ITEM_DATA(self).functions
4651 *
4652 * @property # <<<<<<<<<<<<<<
4653 * cdef inline void ** data(self) noexcept nogil:
4654 * return <void **>_PyUFuncObject_GET_ITEM_DATA(self).data
4655*/
4656
4657 /* function exit code */
4658 __pyx_L0:;
4659 return __pyx_r;
4660}
4661
4662/* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":967
4663 * return <void **>_PyUFuncObject_GET_ITEM_DATA(self).data
4664 *
4665 * @property # <<<<<<<<<<<<<<
4666 * cdef inline int ntypes(self) noexcept nogil:
4667 * return _PyUFuncObject_GET_ITEM_DATA(self).ntypes
4668*/
4669
4670static CYTHON_INLINE int __pyx_f_5numpy_5ufunc_6ntypes___get__(PyUFuncObject *__pyx_v_self) {
4671 int __pyx_r;
4672
4673 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":969
4674 * @property
4675 * cdef inline int ntypes(self) noexcept nogil:
4676 * return _PyUFuncObject_GET_ITEM_DATA(self).ntypes # <<<<<<<<<<<<<<
4677 *
4678 * @property
4679*/
4680 {
4681
4682 __pyx_r = _PyUFuncObject_GET_ITEM_DATA(__pyx_v_self)->ntypes;
4683 }
4684 goto __pyx_L0;
4685
4686 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":967
4687 * return <void **>_PyUFuncObject_GET_ITEM_DATA(self).data
4688 *
4689 * @property # <<<<<<<<<<<<<<
4690 * cdef inline int ntypes(self) noexcept nogil:
4691 * return _PyUFuncObject_GET_ITEM_DATA(self).ntypes
4692*/
4693
4694 /* function exit code */
4695 __pyx_L0:;
4696 return __pyx_r;
4697}
4698
4699/* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":971
4700 * return _PyUFuncObject_GET_ITEM_DATA(self).ntypes
4701 *
4702 * @property # <<<<<<<<<<<<<<
4703 * cdef inline const char* name(self) noexcept nogil:
4704 * return _PyUFuncObject_GET_ITEM_DATA(self).name
4705*/
4706
4707static CYTHON_INLINE char const *__pyx_f_5numpy_5ufunc_4name___get__(PyUFuncObject *__pyx_v_self) {
4708 char const *__pyx_r;
4709
4710 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":973
4711 * @property
4712 * cdef inline const char* name(self) noexcept nogil:
4713 * return _PyUFuncObject_GET_ITEM_DATA(self).name # <<<<<<<<<<<<<<
4714 *
4715 * @property
4716*/
4717 {
4718
4719 __pyx_r = _PyUFuncObject_GET_ITEM_DATA(__pyx_v_self)->name;
4720 }
4721 goto __pyx_L0;
4722
4723 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":971
4724 * return _PyUFuncObject_GET_ITEM_DATA(self).ntypes
4725 *
4726 * @property # <<<<<<<<<<<<<<
4727 * cdef inline const char* name(self) noexcept nogil:
4728 * return _PyUFuncObject_GET_ITEM_DATA(self).name
4729*/
4730
4731 /* function exit code */
4732 __pyx_L0:;
4733 return __pyx_r;
4734}
4735
4736/* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":975
4737 * return _PyUFuncObject_GET_ITEM_DATA(self).name
4738 *
4739 * @property # <<<<<<<<<<<<<<
4740 * cdef inline const char* doc(self) noexcept nogil:
4741 * return _PyUFuncObject_GET_ITEM_DATA(self).doc
4742*/
4743
4744static CYTHON_INLINE char const *__pyx_f_5numpy_5ufunc_3doc___get__(PyUFuncObject *__pyx_v_self) {
4745 char const *__pyx_r;
4746
4747 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":977
4748 * @property
4749 * cdef inline const char* doc(self) noexcept nogil:
4750 * return _PyUFuncObject_GET_ITEM_DATA(self).doc # <<<<<<<<<<<<<<
4751 *
4752 * @property
4753*/
4754 {
4755
4756 __pyx_r = _PyUFuncObject_GET_ITEM_DATA(__pyx_v_self)->doc;
4757 }
4758 goto __pyx_L0;
4759
4760 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":975
4761 * return _PyUFuncObject_GET_ITEM_DATA(self).name
4762 *
4763 * @property # <<<<<<<<<<<<<<
4764 * cdef inline const char* doc(self) noexcept nogil:
4765 * return _PyUFuncObject_GET_ITEM_DATA(self).doc
4766*/
4767
4768 /* function exit code */
4769 __pyx_L0:;
4770 return __pyx_r;
4771}
4772
4773/* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":979
4774 * return _PyUFuncObject_GET_ITEM_DATA(self).doc
4775 *
4776 * @property # <<<<<<<<<<<<<<
4777 * cdef inline void* ptr(self) noexcept nogil:
4778 * return _PyUFuncObject_GET_ITEM_DATA(self).ptr
4779*/
4780
4781static CYTHON_INLINE void *__pyx_f_5numpy_5ufunc_3ptr___get__(PyUFuncObject *__pyx_v_self) {
4782 void *__pyx_r;
4783
4784 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":981
4785 * @property
4786 * cdef inline void* ptr(self) noexcept nogil:
4787 * return _PyUFuncObject_GET_ITEM_DATA(self).ptr # <<<<<<<<<<<<<<
4788 *
4789 * @property
4790*/
4791 {
4792
4793 __pyx_r = _PyUFuncObject_GET_ITEM_DATA(__pyx_v_self)->ptr;
4794 }
4795 goto __pyx_L0;
4796
4797 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":979
4798 * return _PyUFuncObject_GET_ITEM_DATA(self).doc
4799 *
4800 * @property # <<<<<<<<<<<<<<
4801 * cdef inline void* ptr(self) noexcept nogil:
4802 * return _PyUFuncObject_GET_ITEM_DATA(self).ptr
4803*/
4804
4805 /* function exit code */
4806 __pyx_L0:;
4807 return __pyx_r;
4808}
4809
4810/* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":983
4811 * return _PyUFuncObject_GET_ITEM_DATA(self).ptr
4812 *
4813 * @property # <<<<<<<<<<<<<<
4814 * cdef inline PyObject* obj(self) noexcept nogil:
4815 * return _PyUFuncObject_GET_ITEM_DATA(self).obj
4816*/
4817
4818static CYTHON_INLINE PyObject *__pyx_f_5numpy_5ufunc_3obj___get__(PyUFuncObject *__pyx_v_self) {
4819 PyObject *__pyx_r;
4820
4821 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":985
4822 * @property
4823 * cdef inline PyObject* obj(self) noexcept nogil:
4824 * return _PyUFuncObject_GET_ITEM_DATA(self).obj # <<<<<<<<<<<<<<
4825 *
4826 * @property
4827*/
4828 {
4829
4830 __pyx_r = _PyUFuncObject_GET_ITEM_DATA(__pyx_v_self)->obj;
4831 }
4832 goto __pyx_L0;
4833
4834 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":983
4835 * return _PyUFuncObject_GET_ITEM_DATA(self).ptr
4836 *
4837 * @property # <<<<<<<<<<<<<<
4838 * cdef inline PyObject* obj(self) noexcept nogil:
4839 * return _PyUFuncObject_GET_ITEM_DATA(self).obj
4840*/
4841
4842 /* function exit code */
4843 __pyx_L0:;
4844 return __pyx_r;
4845}
4846
4847/* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":987
4848 * return _PyUFuncObject_GET_ITEM_DATA(self).obj
4849 *
4850 * @property # <<<<<<<<<<<<<<
4851 * cdef inline PyObject* userloops(self) noexcept nogil:
4852 * return _PyUFuncObject_GET_ITEM_DATA(self).userloops
4853*/
4854
4855static CYTHON_INLINE PyObject *__pyx_f_5numpy_5ufunc_9userloops___get__(PyUFuncObject *__pyx_v_self) {
4856 PyObject *__pyx_r;
4857
4858 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":989
4859 * @property
4860 * cdef inline PyObject* userloops(self) noexcept nogil:
4861 * return _PyUFuncObject_GET_ITEM_DATA(self).userloops # <<<<<<<<<<<<<<
4862 *
4863 * PyUFuncObject_fields *_PyUFuncObject_GET_ITEM_DATA(ufunc) nogil
4864*/
4865 {
4866
4867 __pyx_r = _PyUFuncObject_GET_ITEM_DATA(__pyx_v_self)->userloops;
4868 }
4869 goto __pyx_L0;
4870
4871 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":987
4872 * return _PyUFuncObject_GET_ITEM_DATA(self).obj
4873 *
4874 * @property # <<<<<<<<<<<<<<
4875 * cdef inline PyObject* userloops(self) noexcept nogil:
4876 * return _PyUFuncObject_GET_ITEM_DATA(self).userloops
4877*/
4878
4879 /* function exit code */
4880 __pyx_L0:;
4881 return __pyx_r;
4882}
4883
4884/* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":1065
4885 * int _import_umath() except -1
4886 *
4887 * cdef inline void set_array_base(ndarray arr, object base) except *: # <<<<<<<<<<<<<<
4888 * Py_INCREF(base) # important to do this before stealing the reference below!
4889 * PyArray_SetBaseObject(arr, base)
4890*/
4891
4892static CYTHON_INLINE void __pyx_f_5numpy_set_array_base(PyArrayObject *__pyx_v_arr, PyObject *__pyx_v_base) {
4893 int __pyx_t_1;
4894 int __pyx_lineno = 0;
4895 const char *__pyx_filename = NULL;
4896 int __pyx_clineno = 0;
4897
4898 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":1066
4899 *
4900 * cdef inline void set_array_base(ndarray arr, object base) except *:
4901 * Py_INCREF(base) # important to do this before stealing the reference below! # <<<<<<<<<<<<<<
4902 * PyArray_SetBaseObject(arr, base)
4903 *
4904*/
4905 Py_INCREF(__pyx_v_base);
4906
4907 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":1067
4908 * cdef inline void set_array_base(ndarray arr, object base) except *:
4909 * Py_INCREF(base) # important to do this before stealing the reference below!
4910 * PyArray_SetBaseObject(arr, base) # <<<<<<<<<<<<<<
4911 *
4912 * cdef inline object get_array_base(ndarray arr):
4913*/
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)
4915
4916
4917 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":1065
4918 * int _import_umath() except -1
4919 *
4920 * cdef inline void set_array_base(ndarray arr, object base) except *: # <<<<<<<<<<<<<<
4921 * Py_INCREF(base) # important to do this before stealing the reference below!
4922 * PyArray_SetBaseObject(arr, base)
4923*/
4924
4925 /* function exit code */
4926 goto __pyx_L0;
4927 __pyx_L1_error:;
4928 __Pyx_AddTraceback("numpy.set_array_base", __pyx_clineno, __pyx_lineno, __pyx_filename);
4929 __pyx_L0:;
4930
4931}
4932
4933/* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":1069
4934 * PyArray_SetBaseObject(arr, base)
4935 *
4936 * cdef inline object get_array_base(ndarray arr): # <<<<<<<<<<<<<<
4937 * base = PyArray_BASE(arr)
4938 * if base is NULL:
4939*/
4940
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
4945 int __pyx_t_1;
4946 __Pyx_RefNannySetupContext("get_array_base", 0);
4947
4948 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":1070
4949 *
4950 * cdef inline object get_array_base(ndarray arr):
4951 * base = PyArray_BASE(arr) # <<<<<<<<<<<<<<
4952 * if base is NULL:
4953 * return None
4954*/
4955 __pyx_v_base = PyArray_BASE(__pyx_v_arr);
4956
4957 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":1071
4958 * cdef inline object get_array_base(ndarray arr):
4959 * base = PyArray_BASE(arr)
4960 * if base is NULL: # <<<<<<<<<<<<<<
4961 * return None
4962 * return <object>base
4963*/
4964 __pyx_t_1 = (__pyx_v_base == NULL);
4965
4966 if (__pyx_t_1) {
4967
4968
4969 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":1072
4970 * base = PyArray_BASE(arr)
4971 * if base is NULL:
4972 * return None # <<<<<<<<<<<<<<
4973 * return <object>base
4974 *
4975*/
4976 {
4977 PyObject *__pyx_temp;
4978 {
4979 __pyx_temp = __pyx_r;
4980 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
4981 }
4982 __Pyx_XDECREF(__pyx_temp);
4983 }
4984 goto __pyx_L0;
4985
4986 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":1071
4987 * cdef inline object get_array_base(ndarray arr):
4988 * base = PyArray_BASE(arr)
4989 * if base is NULL: # <<<<<<<<<<<<<<
4990 * return None
4991 * return <object>base
4992*/
4993 }
4994
4995 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":1073
4996 * if base is NULL:
4997 * return None
4998 * return <object>base # <<<<<<<<<<<<<<
4999 *
5000 * # Versions of the import_* functions which are more suitable for
5001*/
5002 {
5003 PyObject *__pyx_temp;
5004 {
5005 __pyx_temp = __pyx_r;
5006 __Pyx_INCREF(((PyObject *)__pyx_v_base));
5007 __pyx_r = ((PyObject *)__pyx_v_base);
5008 }
5009 __Pyx_XDECREF(__pyx_temp);
5010 }
5011 goto __pyx_L0;
5012
5013 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":1069
5014 * PyArray_SetBaseObject(arr, base)
5015 *
5016 * cdef inline object get_array_base(ndarray arr): # <<<<<<<<<<<<<<
5017 * base = PyArray_BASE(arr)
5018 * if base is NULL:
5019*/
5020
5021 /* function exit code */
5022 __pyx_L0:;
5023
5024 __Pyx_XGIVEREF(__pyx_r);
5025 __Pyx_RefNannyFinishContext();
5026 return __pyx_r;
5027}
5028
5029/* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":1077
5030 * # Versions of the import_* functions which are more suitable for
5031 * # Cython code.
5032 * cdef inline int import_array() except -1: # <<<<<<<<<<<<<<
5033 * try:
5034 * __pyx_import_array()
5035*/
5036
5037static CYTHON_INLINE int __pyx_f_5numpy_import_array(void) {
5038 int __pyx_r;
5039 __Pyx_RefNannyDeclarations
5040 PyObject *__pyx_t_1 = NULL;
5041 PyObject *__pyx_t_2 = NULL;
5042 PyObject *__pyx_t_3 = NULL;
5043 int __pyx_t_4;
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;
5049 size_t __pyx_t_10;
5050 int __pyx_lineno = 0;
5051 const char *__pyx_filename = NULL;
5052 int __pyx_clineno = 0;
5053 __Pyx_RefNannySetupContext("import_array", 0);
5054
5055 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":1078
5056 * # Cython code.
5057 * cdef inline int import_array() except -1:
5058 * try: # <<<<<<<<<<<<<<
5059 * __pyx_import_array()
5060 * except Exception:
5061*/
5062 {
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);
5069 /*try:*/ {
5070
5071 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":1079
5072 * cdef inline int import_array() except -1:
5073 * try:
5074 * __pyx_import_array() # <<<<<<<<<<<<<<
5075 * except Exception:
5076 * raise ImportError("numpy._core.multiarray failed to import")
5077*/
5078 __pyx_t_4 = _import_array(); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(1, 1079, __pyx_L3_error)
5079
5080
5081 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":1078
5082 * # Cython code.
5083 * cdef inline int import_array() except -1:
5084 * try: # <<<<<<<<<<<<<<
5085 * __pyx_import_array()
5086 * except Exception:
5087*/
5088 }
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;
5093 __pyx_L3_error:;
5094
5095 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":1080
5096 * try:
5097 * __pyx_import_array()
5098 * except Exception: # <<<<<<<<<<<<<<
5099 * raise ImportError("numpy._core.multiarray failed to import")
5100 *
5101*/
5102 __pyx_t_4 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(((PyTypeObject*)PyExc_Exception))));
5103 if (__pyx_t_4) {
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);
5109
5110 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":1081
5111 * __pyx_import_array()
5112 * except Exception:
5113 * raise ImportError("numpy._core.multiarray failed to import") # <<<<<<<<<<<<<<
5114 *
5115 * cdef inline int import_umath() except -1:
5116*/
5117 __pyx_t_9 = NULL;
5118 __pyx_t_10 = 1;
5119 {
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);
5125 }
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)
5129 }
5130 goto __pyx_L5_except_error;
5131
5132 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":1078
5133 * # Cython code.
5134 * cdef inline int import_array() except -1:
5135 * try: # <<<<<<<<<<<<<<
5136 * __pyx_import_array()
5137 * except Exception:
5138*/
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;
5145 __pyx_L8_try_end:;
5146 }
5147
5148 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":1077
5149 * # Versions of the import_* functions which are more suitable for
5150 * # Cython code.
5151 * cdef inline int import_array() except -1: # <<<<<<<<<<<<<<
5152 * try:
5153 * __pyx_import_array()
5154*/
5155
5156 /* function exit code */
5157 __pyx_r = 0;
5158 goto __pyx_L0;
5159 __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);
5166 __pyx_r = -1;
5167 __pyx_L0:;
5168
5169 __Pyx_RefNannyFinishContext();
5170 return __pyx_r;
5171}
5172
5173/* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":1083
5174 * raise ImportError("numpy._core.multiarray failed to import")
5175 *
5176 * cdef inline int import_umath() except -1: # <<<<<<<<<<<<<<
5177 * try:
5178 * _import_umath()
5179*/
5180
5181static CYTHON_INLINE int __pyx_f_5numpy_import_umath(void) {
5182 int __pyx_r;
5183 __Pyx_RefNannyDeclarations
5184 PyObject *__pyx_t_1 = NULL;
5185 PyObject *__pyx_t_2 = NULL;
5186 PyObject *__pyx_t_3 = NULL;
5187 int __pyx_t_4;
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;
5193 size_t __pyx_t_10;
5194 int __pyx_lineno = 0;
5195 const char *__pyx_filename = NULL;
5196 int __pyx_clineno = 0;
5197 __Pyx_RefNannySetupContext("import_umath", 0);
5198
5199 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":1084
5200 *
5201 * cdef inline int import_umath() except -1:
5202 * try: # <<<<<<<<<<<<<<
5203 * _import_umath()
5204 * except Exception:
5205*/
5206 {
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);
5213 /*try:*/ {
5214
5215 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":1085
5216 * cdef inline int import_umath() except -1:
5217 * try:
5218 * _import_umath() # <<<<<<<<<<<<<<
5219 * except Exception:
5220 * raise ImportError("numpy._core.umath failed to import")
5221*/
5222 __pyx_t_4 = _import_umath(); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(1, 1085, __pyx_L3_error)
5223
5224
5225 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":1084
5226 *
5227 * cdef inline int import_umath() except -1:
5228 * try: # <<<<<<<<<<<<<<
5229 * _import_umath()
5230 * except Exception:
5231*/
5232 }
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;
5237 __pyx_L3_error:;
5238
5239 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":1086
5240 * try:
5241 * _import_umath()
5242 * except Exception: # <<<<<<<<<<<<<<
5243 * raise ImportError("numpy._core.umath failed to import")
5244 *
5245*/
5246 __pyx_t_4 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(((PyTypeObject*)PyExc_Exception))));
5247 if (__pyx_t_4) {
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);
5253
5254 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":1087
5255 * _import_umath()
5256 * except Exception:
5257 * raise ImportError("numpy._core.umath failed to import") # <<<<<<<<<<<<<<
5258 *
5259 * cdef inline int import_ufunc() except -1:
5260*/
5261 __pyx_t_9 = NULL;
5262 __pyx_t_10 = 1;
5263 {
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);
5269 }
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)
5273 }
5274 goto __pyx_L5_except_error;
5275
5276 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":1084
5277 *
5278 * cdef inline int import_umath() except -1:
5279 * try: # <<<<<<<<<<<<<<
5280 * _import_umath()
5281 * except Exception:
5282*/
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;
5289 __pyx_L8_try_end:;
5290 }
5291
5292 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":1083
5293 * raise ImportError("numpy._core.multiarray failed to import")
5294 *
5295 * cdef inline int import_umath() except -1: # <<<<<<<<<<<<<<
5296 * try:
5297 * _import_umath()
5298*/
5299
5300 /* function exit code */
5301 __pyx_r = 0;
5302 goto __pyx_L0;
5303 __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);
5310 __pyx_r = -1;
5311 __pyx_L0:;
5312
5313 __Pyx_RefNannyFinishContext();
5314 return __pyx_r;
5315}
5316
5317/* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":1089
5318 * raise ImportError("numpy._core.umath failed to import")
5319 *
5320 * cdef inline int import_ufunc() except -1: # <<<<<<<<<<<<<<
5321 * try:
5322 * _import_umath()
5323*/
5324
5325static CYTHON_INLINE int __pyx_f_5numpy_import_ufunc(void) {
5326 int __pyx_r;
5327 __Pyx_RefNannyDeclarations
5328 PyObject *__pyx_t_1 = NULL;
5329 PyObject *__pyx_t_2 = NULL;
5330 PyObject *__pyx_t_3 = NULL;
5331 int __pyx_t_4;
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;
5337 size_t __pyx_t_10;
5338 int __pyx_lineno = 0;
5339 const char *__pyx_filename = NULL;
5340 int __pyx_clineno = 0;
5341 __Pyx_RefNannySetupContext("import_ufunc", 0);
5342
5343 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":1090
5344 *
5345 * cdef inline int import_ufunc() except -1:
5346 * try: # <<<<<<<<<<<<<<
5347 * _import_umath()
5348 * except Exception:
5349*/
5350 {
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);
5357 /*try:*/ {
5358
5359 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":1091
5360 * cdef inline int import_ufunc() except -1:
5361 * try:
5362 * _import_umath() # <<<<<<<<<<<<<<
5363 * except Exception:
5364 * raise ImportError("numpy._core.umath failed to import")
5365*/
5366 __pyx_t_4 = _import_umath(); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(1, 1091, __pyx_L3_error)
5367
5368
5369 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":1090
5370 *
5371 * cdef inline int import_ufunc() except -1:
5372 * try: # <<<<<<<<<<<<<<
5373 * _import_umath()
5374 * except Exception:
5375*/
5376 }
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;
5381 __pyx_L3_error:;
5382
5383 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":1092
5384 * try:
5385 * _import_umath()
5386 * except Exception: # <<<<<<<<<<<<<<
5387 * raise ImportError("numpy._core.umath failed to import")
5388 *
5389*/
5390 __pyx_t_4 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(((PyTypeObject*)PyExc_Exception))));
5391 if (__pyx_t_4) {
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);
5397
5398 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":1093
5399 * _import_umath()
5400 * except Exception:
5401 * raise ImportError("numpy._core.umath failed to import") # <<<<<<<<<<<<<<
5402 *
5403 *
5404*/
5405 __pyx_t_9 = NULL;
5406 __pyx_t_10 = 1;
5407 {
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);
5413 }
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)
5417 }
5418 goto __pyx_L5_except_error;
5419
5420 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":1090
5421 *
5422 * cdef inline int import_ufunc() except -1:
5423 * try: # <<<<<<<<<<<<<<
5424 * _import_umath()
5425 * except Exception:
5426*/
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;
5433 __pyx_L8_try_end:;
5434 }
5435
5436 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":1089
5437 * raise ImportError("numpy._core.umath failed to import")
5438 *
5439 * cdef inline int import_ufunc() except -1: # <<<<<<<<<<<<<<
5440 * try:
5441 * _import_umath()
5442*/
5443
5444 /* function exit code */
5445 __pyx_r = 0;
5446 goto __pyx_L0;
5447 __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);
5454 __pyx_r = -1;
5455 __pyx_L0:;
5456
5457 __Pyx_RefNannyFinishContext();
5458 return __pyx_r;
5459}
5460
5461/* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":1096
5462 *
5463 *
5464 * cdef inline bint is_timedelta64_object(object obj) noexcept: # <<<<<<<<<<<<<<
5465 * """
5466 * Cython equivalent of `isinstance(obj, np.timedelta64)`
5467*/
5468
5469static CYTHON_INLINE int __pyx_f_5numpy_is_timedelta64_object(PyObject *__pyx_v_obj) {
5470 int __pyx_r;
5471
5472 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":1108
5473 * bool
5474 * """
5475 * return PyObject_TypeCheck(obj, &PyTimedeltaArrType_Type) # <<<<<<<<<<<<<<
5476 *
5477 *
5478*/
5479 {
5480
5481 __pyx_r = PyObject_TypeCheck(__pyx_v_obj, (&PyTimedeltaArrType_Type));
5482 }
5483 goto __pyx_L0;
5484
5485 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":1096
5486 *
5487 *
5488 * cdef inline bint is_timedelta64_object(object obj) noexcept: # <<<<<<<<<<<<<<
5489 * """
5490 * Cython equivalent of `isinstance(obj, np.timedelta64)`
5491*/
5492
5493 /* function exit code */
5494 __pyx_L0:;
5495
5496 return __pyx_r;
5497}
5498
5499/* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":1111
5500 *
5501 *
5502 * cdef inline bint is_datetime64_object(object obj) noexcept: # <<<<<<<<<<<<<<
5503 * """
5504 * Cython equivalent of `isinstance(obj, np.datetime64)`
5505*/
5506
5507static CYTHON_INLINE int __pyx_f_5numpy_is_datetime64_object(PyObject *__pyx_v_obj) {
5508 int __pyx_r;
5509
5510 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":1123
5511 * bool
5512 * """
5513 * return PyObject_TypeCheck(obj, &PyDatetimeArrType_Type) # <<<<<<<<<<<<<<
5514 *
5515 *
5516*/
5517 {
5518
5519 __pyx_r = PyObject_TypeCheck(__pyx_v_obj, (&PyDatetimeArrType_Type));
5520 }
5521 goto __pyx_L0;
5522
5523 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":1111
5524 *
5525 *
5526 * cdef inline bint is_datetime64_object(object obj) noexcept: # <<<<<<<<<<<<<<
5527 * """
5528 * Cython equivalent of `isinstance(obj, np.datetime64)`
5529*/
5530
5531 /* function exit code */
5532 __pyx_L0:;
5533
5534 return __pyx_r;
5535}
5536
5537/* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":1126
5538 *
5539 *
5540 * cdef inline npy_datetime get_datetime64_value(object obj) noexcept nogil: # <<<<<<<<<<<<<<
5541 * """
5542 * returns the int64 value underlying scalar numpy datetime64 object
5543*/
5544
5545static CYTHON_INLINE npy_datetime __pyx_f_5numpy_get_datetime64_value(PyObject *__pyx_v_obj) {
5546 npy_datetime __pyx_r;
5547
5548 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":1133
5549 * also needed. That can be found using `get_datetime64_unit`.
5550 * """
5551 * return _PyDatetimeScalarObject_GetValue(obj) # <<<<<<<<<<<<<<
5552 *
5553 *
5554*/
5555 {
5556
5557 __pyx_r = _PyDatetimeScalarObject_GetValue(__pyx_v_obj);
5558 }
5559 goto __pyx_L0;
5560
5561 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":1126
5562 *
5563 *
5564 * cdef inline npy_datetime get_datetime64_value(object obj) noexcept nogil: # <<<<<<<<<<<<<<
5565 * """
5566 * returns the int64 value underlying scalar numpy datetime64 object
5567*/
5568
5569 /* function exit code */
5570 __pyx_L0:;
5571 return __pyx_r;
5572}
5573
5574/* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":1136
5575 *
5576 *
5577 * cdef inline npy_timedelta get_timedelta64_value(object obj) noexcept nogil: # <<<<<<<<<<<<<<
5578 * """
5579 * returns the int64 value underlying scalar numpy timedelta64 object
5580*/
5581
5582static CYTHON_INLINE npy_timedelta __pyx_f_5numpy_get_timedelta64_value(PyObject *__pyx_v_obj) {
5583 npy_timedelta __pyx_r;
5584
5585 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":1140
5586 * returns the int64 value underlying scalar numpy timedelta64 object
5587 * """
5588 * return _PyTimedeltaScalarObject_GetValue(obj) # <<<<<<<<<<<<<<
5589 *
5590 *
5591*/
5592 {
5593
5594 __pyx_r = _PyTimedeltaScalarObject_GetValue(__pyx_v_obj);
5595 }
5596 goto __pyx_L0;
5597
5598 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":1136
5599 *
5600 *
5601 * cdef inline npy_timedelta get_timedelta64_value(object obj) noexcept nogil: # <<<<<<<<<<<<<<
5602 * """
5603 * returns the int64 value underlying scalar numpy timedelta64 object
5604*/
5605
5606 /* function exit code */
5607 __pyx_L0:;
5608 return __pyx_r;
5609}
5610
5611/* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":1143
5612 *
5613 *
5614 * cdef inline NPY_DATETIMEUNIT get_datetime64_unit(object obj) noexcept nogil: # <<<<<<<<<<<<<<
5615 * """
5616 * returns the unit part of the dtype for a numpy datetime64 object.
5617*/
5618
5619static CYTHON_INLINE NPY_DATETIMEUNIT __pyx_f_5numpy_get_datetime64_unit(PyObject *__pyx_v_obj) {
5620 NPY_DATETIMEUNIT __pyx_r;
5621
5622 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":1147
5623 * returns the unit part of the dtype for a numpy datetime64 object.
5624 * """
5625 * return _PyDatetimeScalarObject_GetMetadata(obj).base # <<<<<<<<<<<<<<
5626 *
5627 *
5628*/
5629 {
5630
5631 __pyx_r = _PyDatetimeScalarObject_GetMetadata(__pyx_v_obj).base;
5632 }
5633 goto __pyx_L0;
5634
5635 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":1143
5636 *
5637 *
5638 * cdef inline NPY_DATETIMEUNIT get_datetime64_unit(object obj) noexcept nogil: # <<<<<<<<<<<<<<
5639 * """
5640 * returns the unit part of the dtype for a numpy datetime64 object.
5641*/
5642
5643 /* function exit code */
5644 __pyx_L0:;
5645 return __pyx_r;
5646}
5647
5648/* "cshockCapturing.pyx":74
5649 * double* numDiff)
5650 * ###11111111111
5651 * def calculateNumericalDiffusionResGrad(double shockCapturingDiffusion, # <<<<<<<<<<<<<<
5652 * np.ndarray elementDiameter,
5653 * np.ndarray strong_residual,
5654*/
5655
5656/* Python wrapper */
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
5660#else
5661PyObject *__pyx_args, PyObject *__pyx_kwds
5662#endif
5663); /*proto*/
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
5668#else
5669PyObject *__pyx_args, PyObject *__pyx_kwds
5670#endif
5671) {
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;
5679 #endif
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);
5691 #else
5692 __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
5693 #endif
5694 #endif
5695 __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
5696 {
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) {
5702 case 5:
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)
5705 CYTHON_FALLTHROUGH;
5706 case 4:
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)
5709 CYTHON_FALLTHROUGH;
5710 case 3:
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)
5713 CYTHON_FALLTHROUGH;
5714 case 2:
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)
5717 CYTHON_FALLTHROUGH;
5718 case 1:
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)
5721 CYTHON_FALLTHROUGH;
5722 case 0: break;
5723 default: goto __pyx_L5_argtuple_error;
5724 }
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) }
5729 }
5730 } else if (unlikely(__pyx_nargs != 5)) {
5731 goto __pyx_L5_argtuple_error;
5732 } else {
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)
5743 }
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]);
5749 }
5750 goto __pyx_L6_skip;
5751 __pyx_L5_argtuple_error:;
5752 __Pyx_RaiseArgtupleInvalid("calculateNumericalDiffusionResGrad", 1, 5, 5, __pyx_nargs); __PYX_ERR(0, 74, __pyx_L3_error)
5753 __pyx_L6_skip:;
5754 goto __pyx_L4_argument_unpacking_done;
5755 __pyx_L3_error:;
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]);
5758 }
5759 __Pyx_AddTraceback("cshockCapturing.calculateNumericalDiffusionResGrad", __pyx_clineno, __pyx_lineno, __pyx_filename);
5760 __Pyx_RefNannyFinishContext();
5761 return NULL;
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);
5768
5769 /* function exit code */
5770 goto __pyx_L0;
5771 __pyx_L1_error:;
5772 __pyx_r = NULL;
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]);
5775 }
5776 goto __pyx_L7_cleaned_up;
5777 __pyx_L0:;
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]);
5780 }
5781 __pyx_L7_cleaned_up:;
5782
5783 __Pyx_RefNannyFinishContext();
5784 return __pyx_r;
5785}
5786
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);
5791
5792 /* "cshockCapturing.pyx":79
5793 * np.ndarray grad_u,
5794 * np.ndarray numDiff):
5795 * ccalculateNumericalDiffusionResGrad(grad_u.shape[0], # <<<<<<<<<<<<<<
5796 * grad_u.shape[1],
5797 * grad_u.shape[2],
5798*/
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)));
5800
5801 /* "cshockCapturing.pyx":74
5802 * double* numDiff)
5803 * ###11111111111
5804 * def calculateNumericalDiffusionResGrad(double shockCapturingDiffusion, # <<<<<<<<<<<<<<
5805 * np.ndarray elementDiameter,
5806 * np.ndarray strong_residual,
5807*/
5808
5809 /* function exit code */
5810 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
5811 __Pyx_XGIVEREF(__pyx_r);
5812 __Pyx_RefNannyFinishContext();
5813 return __pyx_r;
5814}
5815
5816/* "cshockCapturing.pyx":87
5817 * <double*> grad_u.data,
5818 * <double*> numDiff.data)
5819 * def calculateNumericalDiffusionResGradQuad(double shockCapturingDiffusion, # <<<<<<<<<<<<<<
5820 * np.ndarray elementDiameter,
5821 * np.ndarray strong_residual,
5822*/
5823
5824/* Python wrapper */
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
5828#else
5829PyObject *__pyx_args, PyObject *__pyx_kwds
5830#endif
5831); /*proto*/
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
5836#else
5837PyObject *__pyx_args, PyObject *__pyx_kwds
5838#endif
5839) {
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;
5847 #endif
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);
5859 #else
5860 __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
5861 #endif
5862 #endif
5863 __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
5864 {
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) {
5870 case 5:
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)
5873 CYTHON_FALLTHROUGH;
5874 case 4:
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)
5877 CYTHON_FALLTHROUGH;
5878 case 3:
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)
5881 CYTHON_FALLTHROUGH;
5882 case 2:
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)
5885 CYTHON_FALLTHROUGH;
5886 case 1:
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)
5889 CYTHON_FALLTHROUGH;
5890 case 0: break;
5891 default: goto __pyx_L5_argtuple_error;
5892 }
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) }
5897 }
5898 } else if (unlikely(__pyx_nargs != 5)) {
5899 goto __pyx_L5_argtuple_error;
5900 } else {
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)
5911 }
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]);
5917 }
5918 goto __pyx_L6_skip;
5919 __pyx_L5_argtuple_error:;
5920 __Pyx_RaiseArgtupleInvalid("calculateNumericalDiffusionResGradQuad", 1, 5, 5, __pyx_nargs); __PYX_ERR(0, 87, __pyx_L3_error)
5921 __pyx_L6_skip:;
5922 goto __pyx_L4_argument_unpacking_done;
5923 __pyx_L3_error:;
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]);
5926 }
5927 __Pyx_AddTraceback("cshockCapturing.calculateNumericalDiffusionResGradQuad", __pyx_clineno, __pyx_lineno, __pyx_filename);
5928 __Pyx_RefNannyFinishContext();
5929 return NULL;
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);
5936
5937 /* function exit code */
5938 goto __pyx_L0;
5939 __pyx_L1_error:;
5940 __pyx_r = NULL;
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]);
5943 }
5944 goto __pyx_L7_cleaned_up;
5945 __pyx_L0:;
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]);
5948 }
5949 __pyx_L7_cleaned_up:;
5950
5951 __Pyx_RefNannyFinishContext();
5952 return __pyx_r;
5953}
5954
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);
5959
5960 /* "cshockCapturing.pyx":92
5961 * np.ndarray grad_u,
5962 * np.ndarray numDiff):
5963 * ccalculateNumericalDiffusionResGradQuad(grad_u.shape[0], # <<<<<<<<<<<<<<
5964 * grad_u.shape[1],
5965 * grad_u.shape[2],
5966*/
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)));
5968
5969 /* "cshockCapturing.pyx":87
5970 * <double*> grad_u.data,
5971 * <double*> numDiff.data)
5972 * def calculateNumericalDiffusionResGradQuad(double shockCapturingDiffusion, # <<<<<<<<<<<<<<
5973 * np.ndarray elementDiameter,
5974 * np.ndarray strong_residual,
5975*/
5976
5977 /* function exit code */
5978 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
5979 __Pyx_XGIVEREF(__pyx_r);
5980 __Pyx_RefNannyFinishContext();
5981 return __pyx_r;
5982}
5983
5984/* "cshockCapturing.pyx":100
5985 * <double*> grad_u.data,
5986 * <double*> numDiff.data)
5987 * def calculateNumericalDiffusionEikonal(double shockCapturingDiffusion, # <<<<<<<<<<<<<<
5988 * np.ndarray elementDiameter,
5989 * np.ndarray strong_residual,
5990*/
5991
5992/* Python wrapper */
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
5996#else
5997PyObject *__pyx_args, PyObject *__pyx_kwds
5998#endif
5999); /*proto*/
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
6004#else
6005PyObject *__pyx_args, PyObject *__pyx_kwds
6006#endif
6007) {
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;
6014 #endif
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);
6026 #else
6027 __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
6028 #endif
6029 #endif
6030 __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
6031 {
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) {
6037 case 4:
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)
6040 CYTHON_FALLTHROUGH;
6041 case 3:
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)
6044 CYTHON_FALLTHROUGH;
6045 case 2:
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)
6048 CYTHON_FALLTHROUGH;
6049 case 1:
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)
6052 CYTHON_FALLTHROUGH;
6053 case 0: break;
6054 default: goto __pyx_L5_argtuple_error;
6055 }
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) }
6060 }
6061 } else if (unlikely(__pyx_nargs != 4)) {
6062 goto __pyx_L5_argtuple_error;
6063 } else {
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)
6072 }
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]);
6077 }
6078 goto __pyx_L6_skip;
6079 __pyx_L5_argtuple_error:;
6080 __Pyx_RaiseArgtupleInvalid("calculateNumericalDiffusionEikonal", 1, 4, 4, __pyx_nargs); __PYX_ERR(0, 100, __pyx_L3_error)
6081 __pyx_L6_skip:;
6082 goto __pyx_L4_argument_unpacking_done;
6083 __pyx_L3_error:;
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]);
6086 }
6087 __Pyx_AddTraceback("cshockCapturing.calculateNumericalDiffusionEikonal", __pyx_clineno, __pyx_lineno, __pyx_filename);
6088 __Pyx_RefNannyFinishContext();
6089 return NULL;
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);
6095
6096 /* function exit code */
6097 goto __pyx_L0;
6098 __pyx_L1_error:;
6099 __pyx_r = NULL;
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]);
6102 }
6103 goto __pyx_L7_cleaned_up;
6104 __pyx_L0:;
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]);
6107 }
6108 __pyx_L7_cleaned_up:;
6109
6110 __Pyx_RefNannyFinishContext();
6111 return __pyx_r;
6112}
6113
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);
6118
6119 /* "cshockCapturing.pyx":104
6120 * np.ndarray strong_residual,
6121 * np.ndarray numDiff):
6122 * ccalculateNumericalDiffusionEikonal(numDiff.shape[0], # <<<<<<<<<<<<<<
6123 * numDiff.shape[1],
6124 * shockCapturingDiffusion,
6125*/
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)));
6127
6128 /* "cshockCapturing.pyx":100
6129 * <double*> grad_u.data,
6130 * <double*> numDiff.data)
6131 * def calculateNumericalDiffusionEikonal(double shockCapturingDiffusion, # <<<<<<<<<<<<<<
6132 * np.ndarray elementDiameter,
6133 * np.ndarray strong_residual,
6134*/
6135
6136 /* function exit code */
6137 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
6138 __Pyx_XGIVEREF(__pyx_r);
6139 __Pyx_RefNannyFinishContext();
6140 return __pyx_r;
6141}
6142
6143/* "cshockCapturing.pyx":110
6144 * <double*> strong_residual.data,
6145 * <double*> numDiff.data)
6146 * def calculateNumericalDiffusionHJ(char shockCapturing, # <<<<<<<<<<<<<<
6147 * double shockCapturingDiffusion,
6148 * np.ndarray elementDiameter,
6149*/
6150
6151/* Python wrapper */
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
6155#else
6156PyObject *__pyx_args, PyObject *__pyx_kwds
6157#endif
6158); /*proto*/
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
6163#else
6164PyObject *__pyx_args, PyObject *__pyx_kwds
6165#endif
6166) {
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;
6176 #endif
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);
6188 #else
6189 __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
6190 #endif
6191 #endif
6192 __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
6193 {
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) {
6199 case 7:
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)
6202 CYTHON_FALLTHROUGH;
6203 case 6:
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)
6206 CYTHON_FALLTHROUGH;
6207 case 5:
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)
6210 CYTHON_FALLTHROUGH;
6211 case 4:
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)
6214 CYTHON_FALLTHROUGH;
6215 case 3:
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)
6218 CYTHON_FALLTHROUGH;
6219 case 2:
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)
6222 CYTHON_FALLTHROUGH;
6223 case 1:
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)
6226 CYTHON_FALLTHROUGH;
6227 case 0: break;
6228 default: goto __pyx_L5_argtuple_error;
6229 }
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) }
6234 }
6235 } else if (unlikely(__pyx_nargs != 7)) {
6236 goto __pyx_L5_argtuple_error;
6237 } else {
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)
6252 }
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]);
6260 }
6261 goto __pyx_L6_skip;
6262 __pyx_L5_argtuple_error:;
6263 __Pyx_RaiseArgtupleInvalid("calculateNumericalDiffusionHJ", 1, 7, 7, __pyx_nargs); __PYX_ERR(0, 110, __pyx_L3_error)
6264 __pyx_L6_skip:;
6265 goto __pyx_L4_argument_unpacking_done;
6266 __pyx_L3_error:;
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]);
6269 }
6270 __Pyx_AddTraceback("cshockCapturing.calculateNumericalDiffusionHJ", __pyx_clineno, __pyx_lineno, __pyx_filename);
6271 __Pyx_RefNannyFinishContext();
6272 return NULL;
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);
6280
6281 /* function exit code */
6282 goto __pyx_L0;
6283 __pyx_L1_error:;
6284 __pyx_r = NULL;
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]);
6287 }
6288 goto __pyx_L7_cleaned_up;
6289 __pyx_L0:;
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]);
6292 }
6293 __pyx_L7_cleaned_up:;
6294
6295
6296 __Pyx_RefNannyFinishContext();
6297 return __pyx_r;
6298}
6299
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);
6304
6305 /* "cshockCapturing.pyx":117
6306 * np.ndarray H,
6307 * np.ndarray numDiff):
6308 * ccalculateNumericalDiffusionHJ(H.shape[0], # <<<<<<<<<<<<<<
6309 * H.shape[1],
6310 * shockCapturing,
6311*/
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)));
6313
6314 /* "cshockCapturing.pyx":110
6315 * <double*> strong_residual.data,
6316 * <double*> numDiff.data)
6317 * def calculateNumericalDiffusionHJ(char shockCapturing, # <<<<<<<<<<<<<<
6318 * double shockCapturingDiffusion,
6319 * np.ndarray elementDiameter,
6320*/
6321
6322 /* function exit code */
6323 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
6324 __Pyx_XGIVEREF(__pyx_r);
6325 __Pyx_RefNannyFinishContext();
6326 return __pyx_r;
6327}
6328
6329/* "cshockCapturing.pyx":126
6330 * <double*> H.data,
6331 * <double*> numDiff.data)
6332 * def calculateNumericalDiffusionHJV2(char shockCapturing, # <<<<<<<<<<<<<<
6333 * double shockCapturingDiffusion,
6334 * np.ndarray elementDiameter,
6335*/
6336
6337/* Python wrapper */
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
6341#else
6342PyObject *__pyx_args, PyObject *__pyx_kwds
6343#endif
6344); /*proto*/
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
6349#else
6350PyObject *__pyx_args, PyObject *__pyx_kwds
6351#endif
6352) {
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;
6362 #endif
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);
6374 #else
6375 __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
6376 #endif
6377 #endif
6378 __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
6379 {
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) {
6385 case 7:
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)
6388 CYTHON_FALLTHROUGH;
6389 case 6:
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)
6392 CYTHON_FALLTHROUGH;
6393 case 5:
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)
6396 CYTHON_FALLTHROUGH;
6397 case 4:
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)
6400 CYTHON_FALLTHROUGH;
6401 case 3:
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)
6404 CYTHON_FALLTHROUGH;
6405 case 2:
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)
6408 CYTHON_FALLTHROUGH;
6409 case 1:
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)
6412 CYTHON_FALLTHROUGH;
6413 case 0: break;
6414 default: goto __pyx_L5_argtuple_error;
6415 }
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) }
6420 }
6421 } else if (unlikely(__pyx_nargs != 7)) {
6422 goto __pyx_L5_argtuple_error;
6423 } else {
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)
6438 }
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]);
6446 }
6447 goto __pyx_L6_skip;
6448 __pyx_L5_argtuple_error:;
6449 __Pyx_RaiseArgtupleInvalid("calculateNumericalDiffusionHJV2", 1, 7, 7, __pyx_nargs); __PYX_ERR(0, 126, __pyx_L3_error)
6450 __pyx_L6_skip:;
6451 goto __pyx_L4_argument_unpacking_done;
6452 __pyx_L3_error:;
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]);
6455 }
6456 __Pyx_AddTraceback("cshockCapturing.calculateNumericalDiffusionHJV2", __pyx_clineno, __pyx_lineno, __pyx_filename);
6457 __Pyx_RefNannyFinishContext();
6458 return NULL;
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);
6466
6467 /* function exit code */
6468 goto __pyx_L0;
6469 __pyx_L1_error:;
6470 __pyx_r = NULL;
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]);
6473 }
6474 goto __pyx_L7_cleaned_up;
6475 __pyx_L0:;
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]);
6478 }
6479 __pyx_L7_cleaned_up:;
6480
6481
6482 __Pyx_RefNannyFinishContext();
6483 return __pyx_r;
6484}
6485
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);
6490
6491 /* "cshockCapturing.pyx":133
6492 * np.ndarray H,
6493 * np.ndarray numDiff):
6494 * ccalculateNumericalDiffusionHJV2(H.shape[0], # <<<<<<<<<<<<<<
6495 * H.shape[1],
6496 * shockCapturing,
6497*/
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)));
6499
6500 /* "cshockCapturing.pyx":126
6501 * <double*> H.data,
6502 * <double*> numDiff.data)
6503 * def calculateNumericalDiffusionHJV2(char shockCapturing, # <<<<<<<<<<<<<<
6504 * double shockCapturingDiffusion,
6505 * np.ndarray elementDiameter,
6506*/
6507
6508 /* function exit code */
6509 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
6510 __Pyx_XGIVEREF(__pyx_r);
6511 __Pyx_RefNannyFinishContext();
6512 return __pyx_r;
6513}
6514
6515/* "cshockCapturing.pyx":142
6516 * <double*> H.data,
6517 * <double*> numDiff.data)
6518 * def calculateNumericalDiffusion_A_1(double shockCapturingFactor, # <<<<<<<<<<<<<<
6519 * np.ndarray elementDiameter,
6520 * np.ndarray strong_residual,
6521*/
6522
6523/* Python wrapper */
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
6527#else
6528PyObject *__pyx_args, PyObject *__pyx_kwds
6529#endif
6530); /*proto*/
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
6535#else
6536PyObject *__pyx_args, PyObject *__pyx_kwds
6537#endif
6538) {
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;
6547 #endif
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);
6559 #else
6560 __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
6561 #endif
6562 #endif
6563 __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
6564 {
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) {
6570 case 6:
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)
6573 CYTHON_FALLTHROUGH;
6574 case 5:
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)
6577 CYTHON_FALLTHROUGH;
6578 case 4:
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)
6581 CYTHON_FALLTHROUGH;
6582 case 3:
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)
6585 CYTHON_FALLTHROUGH;
6586 case 2:
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)
6589 CYTHON_FALLTHROUGH;
6590 case 1:
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)
6593 CYTHON_FALLTHROUGH;
6594 case 0: break;
6595 default: goto __pyx_L5_argtuple_error;
6596 }
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) }
6601 }
6602 } else if (unlikely(__pyx_nargs != 6)) {
6603 goto __pyx_L5_argtuple_error;
6604 } else {
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)
6617 }
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]);
6624 }
6625 goto __pyx_L6_skip;
6626 __pyx_L5_argtuple_error:;
6627 __Pyx_RaiseArgtupleInvalid("calculateNumericalDiffusion_A_1", 1, 6, 6, __pyx_nargs); __PYX_ERR(0, 142, __pyx_L3_error)
6628 __pyx_L6_skip:;
6629 goto __pyx_L4_argument_unpacking_done;
6630 __pyx_L3_error:;
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]);
6633 }
6634 __Pyx_AddTraceback("cshockCapturing.calculateNumericalDiffusion_A_1", __pyx_clineno, __pyx_lineno, __pyx_filename);
6635 __Pyx_RefNannyFinishContext();
6636 return NULL;
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);
6644
6645 /* function exit code */
6646 goto __pyx_L0;
6647 __pyx_L1_error:;
6648 __pyx_r = NULL;
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]);
6651 }
6652 goto __pyx_L7_cleaned_up;
6653 __pyx_L0:;
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]);
6656 }
6657 __pyx_L7_cleaned_up:;
6658
6659 __Pyx_RefNannyFinishContext();
6660 return __pyx_r;
6661}
6662
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);
6667
6668 /* "cshockCapturing.pyx":148
6669 * np.ndarray df,
6670 * np.ndarray numDiff):
6671 * ccalculateNumericalDiffusion_A_1(df.shape[0], # <<<<<<<<<<<<<<
6672 * df.shape[1],
6673 * df.shape[2],
6674*/
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)));
6676
6677 /* "cshockCapturing.pyx":142
6678 * <double*> H.data,
6679 * <double*> numDiff.data)
6680 * def calculateNumericalDiffusion_A_1(double shockCapturingFactor, # <<<<<<<<<<<<<<
6681 * np.ndarray elementDiameter,
6682 * np.ndarray strong_residual,
6683*/
6684
6685 /* function exit code */
6686 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
6687 __Pyx_XGIVEREF(__pyx_r);
6688 __Pyx_RefNannyFinishContext();
6689 return __pyx_r;
6690}
6691
6692/* "cshockCapturing.pyx":157
6693 * <double*> df.data,
6694 * <double*> numDiff.data)
6695 * def calculateNumericalDiffusionResGradJuanes(double shockCapturingDiffusion, # <<<<<<<<<<<<<<
6696 * double uSC,
6697 * np.ndarray elementDiameter,
6698*/
6699
6700/* Python wrapper */
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
6704#else
6705PyObject *__pyx_args, PyObject *__pyx_kwds
6706#endif
6707); /*proto*/
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
6712#else
6713PyObject *__pyx_args, PyObject *__pyx_kwds
6714#endif
6715) {
6716 double __pyx_v_shockCapturingDiffusion;
6717 double __pyx_v_uSC;
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;
6724 #endif
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);
6736 #else
6737 __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
6738 #endif
6739 #endif
6740 __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
6741 {
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) {
6747 case 6:
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)
6750 CYTHON_FALLTHROUGH;
6751 case 5:
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)
6754 CYTHON_FALLTHROUGH;
6755 case 4:
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)
6758 CYTHON_FALLTHROUGH;
6759 case 3:
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)
6762 CYTHON_FALLTHROUGH;
6763 case 2:
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)
6766 CYTHON_FALLTHROUGH;
6767 case 1:
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)
6770 CYTHON_FALLTHROUGH;
6771 case 0: break;
6772 default: goto __pyx_L5_argtuple_error;
6773 }
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) }
6778 }
6779 } else if (unlikely(__pyx_nargs != 6)) {
6780 goto __pyx_L5_argtuple_error;
6781 } else {
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)
6794 }
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]);
6801 }
6802 goto __pyx_L6_skip;
6803 __pyx_L5_argtuple_error:;
6804 __Pyx_RaiseArgtupleInvalid("calculateNumericalDiffusionResGradJuanes", 1, 6, 6, __pyx_nargs); __PYX_ERR(0, 157, __pyx_L3_error)
6805 __pyx_L6_skip:;
6806 goto __pyx_L4_argument_unpacking_done;
6807 __pyx_L3_error:;
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]);
6810 }
6811 __Pyx_AddTraceback("cshockCapturing.calculateNumericalDiffusionResGradJuanes", __pyx_clineno, __pyx_lineno, __pyx_filename);
6812 __Pyx_RefNannyFinishContext();
6813 return NULL;
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);
6820
6821 /* function exit code */
6822 goto __pyx_L0;
6823 __pyx_L1_error:;
6824 __pyx_r = NULL;
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]);
6827 }
6828 goto __pyx_L7_cleaned_up;
6829 __pyx_L0:;
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]);
6832 }
6833 __pyx_L7_cleaned_up:;
6834
6835
6836 __Pyx_RefNannyFinishContext();
6837 return __pyx_r;
6838}
6839
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);
6844
6845 /* "cshockCapturing.pyx":163
6846 * np.ndarray grad_u,
6847 * np.ndarray numDiff):
6848 * ccalculateNumericalDiffusionResGradJuanes(grad_u.shape[0], # <<<<<<<<<<<<<<
6849 * grad_u.shape[1],
6850 * grad_u.shape[2],
6851*/
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)));
6853
6854 /* "cshockCapturing.pyx":157
6855 * <double*> df.data,
6856 * <double*> numDiff.data)
6857 * def calculateNumericalDiffusionResGradJuanes(double shockCapturingDiffusion, # <<<<<<<<<<<<<<
6858 * double uSC,
6859 * np.ndarray elementDiameter,
6860*/
6861
6862 /* function exit code */
6863 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
6864 __Pyx_XGIVEREF(__pyx_r);
6865 __Pyx_RefNannyFinishContext();
6866 return __pyx_r;
6867}
6868
6869/* "cshockCapturing.pyx":172
6870 * <double*> grad_u.data,
6871 * <double*> numDiff.data)
6872 * def calculateNumericalDiffusionJaffre(double shockCapturingDiffusion, # <<<<<<<<<<<<<<
6873 * double beta,
6874 * np.ndarray elementDiameter,
6875*/
6876
6877/* Python wrapper */
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
6881#else
6882PyObject *__pyx_args, PyObject *__pyx_kwds
6883#endif
6884); /*proto*/
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
6889#else
6890PyObject *__pyx_args, PyObject *__pyx_kwds
6891#endif
6892) {
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;
6901 #endif
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);
6913 #else
6914 __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
6915 #endif
6916 #endif
6917 __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
6918 {
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) {
6924 case 6:
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)
6927 CYTHON_FALLTHROUGH;
6928 case 5:
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)
6931 CYTHON_FALLTHROUGH;
6932 case 4:
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)
6935 CYTHON_FALLTHROUGH;
6936 case 3:
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)
6939 CYTHON_FALLTHROUGH;
6940 case 2:
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)
6943 CYTHON_FALLTHROUGH;
6944 case 1:
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)
6947 CYTHON_FALLTHROUGH;
6948 case 0: break;
6949 default: goto __pyx_L5_argtuple_error;
6950 }
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) }
6955 }
6956 } else if (unlikely(__pyx_nargs != 6)) {
6957 goto __pyx_L5_argtuple_error;
6958 } else {
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)
6971 }
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]);
6978 }
6979 goto __pyx_L6_skip;
6980 __pyx_L5_argtuple_error:;
6981 __Pyx_RaiseArgtupleInvalid("calculateNumericalDiffusionJaffre", 1, 6, 6, __pyx_nargs); __PYX_ERR(0, 172, __pyx_L3_error)
6982 __pyx_L6_skip:;
6983 goto __pyx_L4_argument_unpacking_done;
6984 __pyx_L3_error:;
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]);
6987 }
6988 __Pyx_AddTraceback("cshockCapturing.calculateNumericalDiffusionJaffre", __pyx_clineno, __pyx_lineno, __pyx_filename);
6989 __Pyx_RefNannyFinishContext();
6990 return NULL;
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);
6997
6998 /* function exit code */
6999 goto __pyx_L0;
7000 __pyx_L1_error:;
7001 __pyx_r = NULL;
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]);
7004 }
7005 goto __pyx_L7_cleaned_up;
7006 __pyx_L0:;
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]);
7009 }
7010 __pyx_L7_cleaned_up:;
7011
7012
7013 __Pyx_RefNannyFinishContext();
7014 return __pyx_r;
7015}
7016
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);
7021
7022 /* "cshockCapturing.pyx":178
7023 * np.ndarray grad_u,
7024 * np.ndarray numDiff):
7025 * ccalculateNumericalDiffusionJaffre(grad_u.shape[0], # <<<<<<<<<<<<<<
7026 * grad_u.shape[1],
7027 * grad_u.shape[2],
7028*/
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)));
7030
7031 /* "cshockCapturing.pyx":172
7032 * <double*> grad_u.data,
7033 * <double*> numDiff.data)
7034 * def calculateNumericalDiffusionJaffre(double shockCapturingDiffusion, # <<<<<<<<<<<<<<
7035 * double beta,
7036 * np.ndarray elementDiameter,
7037*/
7038
7039 /* function exit code */
7040 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
7041 __Pyx_XGIVEREF(__pyx_r);
7042 __Pyx_RefNannyFinishContext();
7043 return __pyx_r;
7044}
7045/* #### Code section: module_exttypes ### */
7046
7047static PyMethodDef __pyx_methods[] = {
7048 {0, 0, 0, 0}
7049};
7050/* #### Code section: initfunc_declarations ### */
7051static CYTHON_SMALL_CODE int __Pyx_InitCachedBuiltins(__pyx_mstatetype *__pyx_mstate); /*proto*/
7052static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(__pyx_mstatetype *__pyx_mstate); /*proto*/
7053static CYTHON_SMALL_CODE int __Pyx_InitGlobals(void); /*proto*/
7054static CYTHON_SMALL_CODE int __Pyx_InitAfterSharedUtility(void); /*proto*/
7055static CYTHON_SMALL_CODE int __Pyx_InitConstants(__pyx_mstatetype *__pyx_mstate); /*proto*/
7056static CYTHON_SMALL_CODE int __Pyx_modinit_Global_init_code(__pyx_mstatetype *__pyx_mstate); /*proto*/
7057static CYTHON_SMALL_CODE int __Pyx_modinit_Variable_export_code(__pyx_mstatetype *__pyx_mstate); /*proto*/
7058static CYTHON_SMALL_CODE int __Pyx_modinit_Function_export_code(__pyx_mstatetype *__pyx_mstate); /*proto*/
7059static CYTHON_SMALL_CODE int __Pyx_modinit_Type_import_code(__pyx_mstatetype *__pyx_mstate); /*proto*/
7060static CYTHON_SMALL_CODE int __Pyx_modinit_Variable_import_code(__pyx_mstatetype *__pyx_mstate); /*proto*/
7061static CYTHON_SMALL_CODE int __Pyx_modinit_Function_import_code(__pyx_mstatetype *__pyx_mstate); /*proto*/
7062static CYTHON_SMALL_CODE int __Pyx_CreateCodeObjects(__pyx_mstatetype *__pyx_mstate); /*proto*/
7063/* #### Code section: init_module ### */
7064
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);
7069 /*--- Global init code ---*/
7070 __Pyx_RefNannyFinishContext();
7071 return 0;
7072}
7073
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);
7078 /*--- Variable export code ---*/
7079 __Pyx_RefNannyFinishContext();
7080 return 0;
7081}
7082
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);
7087 /*--- Function export code ---*/
7088 __Pyx_RefNannyFinishContext();
7089 return 0;
7090}
7091
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);
7100 /*--- Type import code ---*/
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
7107 0, 0,
7108 #else
7109 sizeof(PyHeapTypeObject), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(PyHeapTypeObject),
7110 #endif
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),
7120 #else
7121 sizeof(PyArray_Descr), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(PyArray_Descr),
7122 #endif
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),
7129 #else
7130 sizeof(PyArrayIterObject), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(PyArrayIterObject),
7131 #endif
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),
7138 #else
7139 sizeof(PyArrayMultiIterObject), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(PyArrayMultiIterObject),
7140 #endif
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),
7147 #else
7148 sizeof(PyArrayObject), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(PyArrayObject),
7149 #endif
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),
7156 #else
7157 sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(PyObject),
7158 #endif
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),
7165 #else
7166 sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(PyObject),
7167 #endif
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),
7174 #else
7175 sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(PyObject),
7176 #endif
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),
7183 #else
7184 sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(PyObject),
7185 #endif
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),
7192 #else
7193 sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(PyObject),
7194 #endif
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),
7201 #else
7202 sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(PyObject),
7203 #endif
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),
7210 #else
7211 sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(PyObject),
7212 #endif
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),
7219 #else
7220 sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(PyObject),
7221 #endif
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),
7228 #else
7229 sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(PyObject),
7230 #endif
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),
7237 #else
7238 sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(PyObject),
7239 #endif
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),
7246 #else
7247 sizeof(PyUFuncObject), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(PyUFuncObject),
7248 #endif
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();
7252 return 0;
7253 __pyx_L1_error:;
7254 __Pyx_XDECREF(__pyx_t_1);
7255 __Pyx_RefNannyFinishContext();
7256 return -1;
7257}
7258
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);
7263 /*--- Variable import code ---*/
7264 __Pyx_RefNannyFinishContext();
7265 return 0;
7266}
7267
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);
7272 /*--- Function import code ---*/
7273 __Pyx_RefNannyFinishContext();
7274 return 0;
7275}
7276
7277#if CYTHON_PEP489_MULTI_PHASE_INIT
7278static PyObject* __pyx_pymod_create(PyObject *spec, PyModuleDef *def); /*proto*/
7279static int __pyx_pymod_exec_cshockCapturing(PyObject* module); /*proto*/
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},
7285 #endif
7286 #if PY_VERSION_HEX >= 0x030C0000 && CYTHON_USE_MODULE_STATE
7287 {Py_mod_multiple_interpreters, Py_MOD_MULTIPLE_INTERPRETERS_NOT_SUPPORTED},
7288 #endif
7289 {0, NULL}
7290};
7291#endif
7292
7293#ifdef __cplusplus
7294namespace {
7295 struct PyModuleDef __pyx_moduledef =
7296 #else
7297 static struct PyModuleDef __pyx_moduledef =
7298 #endif
7299 {
7300 PyModuleDef_HEAD_INIT,
7301 "cshockCapturing",
7302 0, /* m_doc */
7303 #if CYTHON_USE_MODULE_STATE
7304 sizeof(__pyx_mstatetype), /* m_size */
7305 #else
7306 (CYTHON_PEP489_MULTI_PHASE_INIT) ? 0 : -1, /* m_size */
7307 #endif
7308 __pyx_methods /* m_methods */,
7309 #if CYTHON_PEP489_MULTI_PHASE_INIT
7310 __pyx_moduledef_slots, /* m_slots */
7311 #else
7312 NULL, /* m_reload */
7313 #endif
7314 #if CYTHON_USE_MODULE_STATE
7315 __pyx_m_traverse, /* m_traverse */
7316 __pyx_m_clear, /* m_clear */
7317 NULL /* m_free */
7318 #else
7319 NULL, /* m_traverse */
7320 NULL, /* m_clear */
7321 NULL /* m_free */
7322 #endif
7323 };
7324 #ifdef __cplusplus
7325} /* anonymous namespace */
7326#endif
7327
7328/* PyModInitFuncType */
7329#ifndef CYTHON_NO_PYINIT_EXPORT
7330 #define __Pyx_PyMODINIT_FUNC PyMODINIT_FUNC
7331#else
7332 #ifdef __cplusplus
7333 #define __Pyx_PyMODINIT_FUNC extern "C" PyObject *
7334 #else
7335 #define __Pyx_PyMODINIT_FUNC PyObject *
7336 #endif
7337#endif
7338
7339__Pyx_PyMODINIT_FUNC PyInit_cshockCapturing(void) CYTHON_SMALL_CODE; /*proto*/
7340__Pyx_PyMODINIT_FUNC PyInit_cshockCapturing(void)
7341#if CYTHON_PEP489_MULTI_PHASE_INIT
7342{
7343 return PyModuleDef_Init(&__pyx_moduledef);
7344}
7345/* ModuleCreationPEP489 */
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) {
7349 {
7350 PyObject *module = PyImport_ImportModule("_interpreters"); // 3.13+ I think
7351 if (!module) {
7352 if (!PyErr_ExceptionMatches(PyExc_Exception)) {
7353 goto bad; // BaseException
7354 }
7355 PyErr_Clear(); // just try the 3.8-3.12 version
7356 module = PyImport_ImportModule("_xxsubinterpreters");
7357 if (!module) goto bad;
7358 }
7359 PyObject *current = PyObject_CallMethod(module, "get_current", NULL);
7360 Py_DECREF(module);
7361 if (!current) goto bad;
7362 if (PyTuple_Check(current)) {
7363 PyObject *new_current = PySequence_GetItem(current, 0);
7364 Py_DECREF(current);
7365 current = new_current;
7366 if (!new_current) goto bad;
7367 }
7368 long long as_c_int = PyLong_AsLongLong(current);
7369 Py_DECREF(current);
7370 return as_c_int;
7371 }
7372 bad:
7373 PySys_WriteStderr("__Pyx_GetCurrentInterpreterId failed. Try setting the C define CYTHON_PEP489_MULTI_PHASE_INIT=0\n");
7374 return -1;
7375}
7376#endif
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());
7389#else
7390 PY_INT64_T current_id = PyInterpreterState_GetID(PyThreadState_Get()->interp);
7391#endif
7392 if (unlikely(current_id == -1)) {
7393 return -1;
7394 }
7395 if (main_interpreter_id == -1) {
7396 main_interpreter_id = current_id;
7397 return 0;
7398 } else if (unlikely(main_interpreter_id != current_id)) {
7399 PyErr_SetString(
7400 PyExc_ImportError,
7401 "Interpreter change detected - this module can only be loaded into one interpreter per process.");
7402 return -1;
7403 }
7404 return 0;
7405}
7406#endif
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)
7408{
7409 PyObject *value = PyObject_GetAttrString(spec, from_name);
7410 int result = 0;
7411 if (likely(value)) {
7412 if (allow_none || value != Py_None) {
7413 result = PyDict_SetItemString(moddict, to_name, value);
7414 }
7415 Py_DECREF(value);
7416 } else if (PyErr_ExceptionMatches(PyExc_AttributeError)) {
7417 PyErr_Clear();
7418 } else {
7419 result = -1;
7420 }
7421 return result;
7422}
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())
7428 return NULL;
7429 #endif
7430 if (__pyx_m)
7431 return __Pyx_NewRef(__pyx_m);
7432 modname = PyObject_GetAttrString(spec, "name");
7433 if (unlikely(!modname)) goto bad;
7434 module = PyModule_NewObject(modname);
7435 Py_DECREF(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;
7443 return module;
7444bad:
7445 Py_XDECREF(module);
7446 return NULL;
7447}
7448
7449
7450static CYTHON_SMALL_CODE int __pyx_pymod_exec_cshockCapturing(PyObject *__pyx_pyinit_module)
7451#endif
7452{
7453 int stringtab_initialized = 0;
7454 #if CYTHON_USE_MODULE_STATE
7455 int pystate_addmodule_run = 0;
7456 #endif
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
7465 if (__pyx_m) {
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.");
7468 return -1;
7469 }
7470 #else
7471 if (__pyx_m) return __Pyx_NewRef(__pyx_m);
7472 #endif
7473 /*--- Module creation code ---*/
7474 #if CYTHON_PEP489_MULTI_PHASE_INIT
7475 __pyx_t_1 = __pyx_pyinit_module;
7476 Py_INCREF(__pyx_t_1);
7477 #else
7478 __pyx_t_1 = PyModule_Create(&__pyx_moduledef); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1, __pyx_L1_error)
7479 #endif
7480 #if CYTHON_USE_MODULE_STATE
7481 {
7482 int add_module_result = __Pyx_State_AddModule(__pyx_t_1, &__pyx_moduledef);
7483 __pyx_t_1 = 0; /* transfer ownership from __pyx_t_1 to "cshockCapturing" pseudovariable */
7484 if (unlikely((add_module_result < 0))) __PYX_ERR(0, 1, __pyx_L1_error)
7485 pystate_addmodule_run = 1;
7486 }
7487 #else
7488 __pyx_m = __pyx_t_1;
7489 #endif
7490 #if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING
7491 PyUnstable_Module_SetGIL(__pyx_m, Py_MOD_GIL_USED);
7492 #endif
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)
7500 /* ImportRefnannyAPI */
7501 #if CYTHON_REFNANNY
7502 __Pyx_RefNanny = __Pyx_RefNannyImportAPI("refnanny");
7503 if (!__Pyx_RefNanny) {
7504 if (PyErr_ExceptionMatches(PyExc_Exception)) {
7505 PyErr_Clear();
7506 __Pyx_RefNanny = __Pyx_RefNannyImportAPI("Cython.Runtime.refnanny");
7507 }
7508 if (!__Pyx_RefNanny)
7509 Py_FatalError("failed to import 'refnanny' module");
7510 }
7511 #endif
7512
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)
7519 /*--- Library function declarations ---*/
7520 /*--- Initialize various global constants etc. ---*/
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)
7526 }
7527 {
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)
7531 }
7532 }
7533 /*--- Builtin init code ---*/
7534 if (__Pyx_InitCachedBuiltins(__pyx_mstate) < (0)) __PYX_ERR(0, 1, __pyx_L1_error)
7535 /*--- Constants init code ---*/
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)
7538 /*--- Global type/function init code ---*/
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);
7542 /*--- Type init code ---*/
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)
7547 /*--- Execution code ---*/
7548
7549 /* "cshockCapturing.pyx":3
7550 * # A type of -*- python -*- file
7551 * # cython: language_level=3
7552 * import numpy as np # <<<<<<<<<<<<<<
7553 * cimport numpy as np
7554 * cdef extern from "shockCapturing.h":
7555*/
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;
7561
7562 /* "cshockCapturing.pyx":74
7563 * double* numDiff)
7564 * ###11111111111
7565 * def calculateNumericalDiffusionResGrad(double shockCapturingDiffusion, # <<<<<<<<<<<<<<
7566 * np.ndarray elementDiameter,
7567 * np.ndarray strong_residual,
7568*/
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);
7573 #endif
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;
7576
7577 /* "cshockCapturing.pyx":87
7578 * <double*> grad_u.data,
7579 * <double*> numDiff.data)
7580 * def calculateNumericalDiffusionResGradQuad(double shockCapturingDiffusion, # <<<<<<<<<<<<<<
7581 * np.ndarray elementDiameter,
7582 * np.ndarray strong_residual,
7583*/
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);
7588 #endif
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;
7591
7592 /* "cshockCapturing.pyx":100
7593 * <double*> grad_u.data,
7594 * <double*> numDiff.data)
7595 * def calculateNumericalDiffusionEikonal(double shockCapturingDiffusion, # <<<<<<<<<<<<<<
7596 * np.ndarray elementDiameter,
7597 * np.ndarray strong_residual,
7598*/
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);
7603 #endif
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;
7606
7607 /* "cshockCapturing.pyx":110
7608 * <double*> strong_residual.data,
7609 * <double*> numDiff.data)
7610 * def calculateNumericalDiffusionHJ(char shockCapturing, # <<<<<<<<<<<<<<
7611 * double shockCapturingDiffusion,
7612 * np.ndarray elementDiameter,
7613*/
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);
7618 #endif
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;
7621
7622 /* "cshockCapturing.pyx":126
7623 * <double*> H.data,
7624 * <double*> numDiff.data)
7625 * def calculateNumericalDiffusionHJV2(char shockCapturing, # <<<<<<<<<<<<<<
7626 * double shockCapturingDiffusion,
7627 * np.ndarray elementDiameter,
7628*/
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);
7633 #endif
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;
7636
7637 /* "cshockCapturing.pyx":142
7638 * <double*> H.data,
7639 * <double*> numDiff.data)
7640 * def calculateNumericalDiffusion_A_1(double shockCapturingFactor, # <<<<<<<<<<<<<<
7641 * np.ndarray elementDiameter,
7642 * np.ndarray strong_residual,
7643*/
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);
7648 #endif
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;
7651
7652 /* "cshockCapturing.pyx":157
7653 * <double*> df.data,
7654 * <double*> numDiff.data)
7655 * def calculateNumericalDiffusionResGradJuanes(double shockCapturingDiffusion, # <<<<<<<<<<<<<<
7656 * double uSC,
7657 * np.ndarray elementDiameter,
7658*/
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);
7663 #endif
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;
7666
7667 /* "cshockCapturing.pyx":172
7668 * <double*> grad_u.data,
7669 * <double*> numDiff.data)
7670 * def calculateNumericalDiffusionJaffre(double shockCapturingDiffusion, # <<<<<<<<<<<<<<
7671 * double beta,
7672 * np.ndarray elementDiameter,
7673*/
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);
7678 #endif
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;
7681
7682 /* "cshockCapturing.pyx":1
7683 * # A type of -*- python -*- file # <<<<<<<<<<<<<<
7684 * # cython: language_level=3
7685 * import numpy as np
7686*/
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;
7691
7692 /*--- Wrapped vars code ---*/
7693
7694 goto __pyx_L0;
7695 __pyx_L1_error:;
7696 __Pyx_XDECREF(__pyx_t_2);
7697 if (__pyx_m) {
7698 if (__pyx_mstate->__pyx_d && stringtab_initialized) {
7699 __Pyx_AddTraceback("init cshockCapturing", __pyx_clineno, __pyx_lineno, __pyx_filename);
7700 }
7701 #if !CYTHON_USE_MODULE_STATE
7702 Py_CLEAR(__pyx_m);
7703 #else
7704 Py_DECREF(__pyx_m);
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);
7710 }
7711 #endif
7712 } else if (!PyErr_Occurred()) {
7713 PyErr_SetString(PyExc_ImportError, "init cshockCapturing");
7714 }
7715 __pyx_L0:;
7716 __Pyx_RefNannyFinishContext();
7717 #if CYTHON_PEP489_MULTI_PHASE_INIT
7718 return (__pyx_m != NULL) ? 0 : -1;
7719 #else
7720 return __pyx_m;
7721 #endif
7722}
7723/* #### Code section: pystring_table ### */
7724/* #### Code section: cached_builtins ### */
7725
7726static int __Pyx_InitCachedBuiltins(__pyx_mstatetype *__pyx_mstate) {
7727 CYTHON_UNUSED_VAR(__pyx_mstate);
7728
7729 /* Cached unbound methods */
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;
7736 return 0;
7737}
7738/* #### Code section: cached_constants ### */
7739
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();
7745 return 0;
7746}
7747/* #### Code section: init_constants ### */
7748
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);
7754 {
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
7759 #endif
7760 #if (CYTHON_COMPRESS_STRINGS) == 1 /* compression: zlib (615 bytes) */
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) }
7768 #endif
7769 #elif (CYTHON_COMPRESS_STRINGS) > 0 && (CYTHON_COMPRESS_STRINGS) <= 90 /* compression: lzss (793 bytes) */
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) }
7777 #endif
7778 #else /* compression: none (1378 bytes) */
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
7783 #endif
7784 PyObject **stringtab = __pyx_mstate->__pyx_string_tab;
7785 Py_ssize_t pos = 0;
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)) {
7791 Py_XDECREF(data);
7792 __PYX_ERR(0, 1, __pyx_L1_error)
7793 }
7794 stringtab[i] = string;
7795 pos += bytes_length;
7796 }
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)) {
7803 Py_XDECREF(data);
7804 __PYX_ERR(0, 1, __pyx_L1_error)
7805 }
7806 }
7807 Py_XDECREF(data);
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)
7811 }
7812 }
7813 #if CYTHON_IMMORTAL_CONSTANTS
7814 {
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)
7823 #else
7824 if (PyUnstable_Object_IsUniquelyReferenced(table[i]))
7825 #endif
7826 {
7827 Py_SET_REFCNT(table[i], ((Py_ssize_t)_Py_IMMORTAL_REFCNT_LOCAL + 1));
7828 }
7829 #else
7830 if ((PY_SSIZE_T_MAX < _Py_IMMORTAL_INITIAL_REFCNT)) break;
7831 Py_SET_REFCNT(table[i], _Py_IMMORTAL_INITIAL_REFCNT);
7832 #endif
7833 }
7834 }
7835 #endif
7836 }
7837 return 0;
7838 __pyx_L1_error:;
7839 return -1;
7840}
7841/* #### Code section: init_codeobjects ### */
7842#ifdef __cplusplus
7843namespace {
7844#endif
7845typedef struct {
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;
7853#ifdef __cplusplus
7854} /* anonymous namespace */
7855#endif
7856/* NewCodeObj.proto */
7857static PyObject* __Pyx_PyCode_New(
7858 const __Pyx_PyCode_New_function_description descr,
7859 PyObject * const *varnames,
7860 PyObject *filename,
7861 PyObject *funcname,
7862 PyObject *line_table,
7863 PyObject *tuple_dedup_map
7864);
7865
7866
7867static int __Pyx_CreateCodeObjects(__pyx_mstatetype *__pyx_mstate) {
7868 PyObject* tuple_dedup_map = PyDict_New();
7869 if (unlikely(!tuple_dedup_map)) return -1;
7870 {
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;
7874 }
7875 {
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;
7879 }
7880 {
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;
7884 }
7885 {
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;
7889 }
7890 {
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;
7894 }
7895 {
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;
7899 }
7900 {
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;
7904 }
7905 {
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;
7909 }
7910 Py_DECREF(tuple_dedup_map);
7911 return 0;
7912 bad:
7913 Py_DECREF(tuple_dedup_map);
7914 return -1;
7915}
7916/* #### Code section: init_globals ### */
7917
7918static int __Pyx_InitGlobals(void) {
7919 int __pyx_lineno = 0;
7920 const char *__pyx_filename = NULL;
7921 int __pyx_clineno = 0;
7922 /* PythonCompatibility.init */
7923 if (likely(__Pyx_init_co_variables() == 0 && __Pyx_init_tpflags_variables() == 0)); else
7924
7925 if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1, __pyx_L1_error)
7926
7927 /* NumpyImportArray.init */
7928 /*
7929 * Cython has automatically inserted a call to _import_array since
7930 * you didn't include one when you cimported numpy. To disable this
7931 * add the line
7932 * <void>numpy._import_array
7933 */
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).");
7940 }
7941 #endif
7942 #endif
7943
7944 if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1, __pyx_L1_error)
7945
7946 /* CommonTypesMetaclass.init */
7947 if (likely(__pyx_CommonTypesMetaclass_init(__pyx_m) == 0)); else
7948
7949 if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1, __pyx_L1_error)
7950
7951 /* CachedMethodType.init */
7952 #if CYTHON_COMPILING_IN_LIMITED_API
7953 {
7954 PyObject *typesModule=NULL;
7955 typesModule = PyImport_ImportModule("types");
7956 if (typesModule) {
7957 __pyx_mstate_global->__Pyx_CachedMethodType = PyObject_GetAttrString(typesModule, "MethodType");
7958 Py_DECREF(typesModule);
7959 }
7960 } // error handling follows
7961 #endif
7962
7963 if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1, __pyx_L1_error)
7964
7965 return 0;
7966 __pyx_L1_error:;
7967 return -1;
7968}
7969/* #### Code section: init_after_shared_utility ### */
7970
7971static int __Pyx_InitAfterSharedUtility(void) {
7972 int __pyx_lineno = 0;
7973 const char *__pyx_filename = NULL;
7974 int __pyx_clineno = 0;
7975 /* CythonFunctionPerModule.init */
7976 if (likely(__pyx_CyFunction_init(__pyx_m) == 0)); else
7977
7978 if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1, __pyx_L1_error)
7979
7980 return 0;
7981 __pyx_L1_error:;
7982 return -1;
7983}
7984/* #### Code section: cleanup_globals ### */
7985/* #### Code section: cleanup_module ### */
7986/* #### Code section: main_method ### */
7987/* #### Code section: utility_code_pragmas ### */
7988#ifdef _MSC_VER
7989#pragma warning( push )
7990/* Warning 4127: conditional expression is constant
7991 * Cython uses constant conditional expressions to allow in inline functions to be optimized at
7992 * compile-time, so this warning is not useful
7993 */
7994#pragma warning( disable : 4127 )
7995#endif
7996
7997
7998
7999/* #### Code section: utility_code_def ### */
8000
8001/* --- Runtime support code --- */
8002/* Refnanny */
8003#if CYTHON_REFNANNY
8004static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname) {
8005 PyObject *m = NULL, *p = NULL;
8006 void *r = NULL;
8007 m = PyImport_ImportModule(modname);
8008 if (!m) goto end;
8009 p = PyObject_GetAttrString(m, "RefNannyAPI");
8010 if (!p) goto end;
8011 r = PyLong_AsVoidPtr(p);
8012end:
8013 Py_XDECREF(p);
8014 Py_XDECREF(m);
8015 return (__Pyx_RefNannyAPIStruct *)r;
8016}
8017#endif
8018
8019/* GetTopmostException (used by SaveResetException) */
8020#if CYTHON_USE_EXC_INFO_STACK && CYTHON_FAST_THREAD_STATE
8021static _PyErr_StackItem *
8022__Pyx_PyErr_GetTopmostException(PyThreadState *tstate)
8023{
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)
8027 {
8028 exc_info = exc_info->previous_item;
8029 }
8030 return exc_info;
8031}
8032#endif
8033
8034/* SaveResetException */
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) {
8041 *value = NULL;
8042 *type = NULL;
8043 *tb = NULL;
8044 } else {
8045 *value = exc_value;
8046 Py_INCREF(*value);
8047 *type = (PyObject*) Py_TYPE(exc_value);
8048 Py_INCREF(*type);
8049 *tb = PyException_GetTraceback(exc_value);
8050 }
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;
8056 Py_XINCREF(*type);
8057 Py_XINCREF(*value);
8058 Py_XINCREF(*tb);
8059 #else
8060 *type = tstate->exc_type;
8061 *value = tstate->exc_value;
8062 *tb = tstate->exc_traceback;
8063 Py_XINCREF(*type);
8064 Py_XINCREF(*value);
8065 Py_XINCREF(*tb);
8066 #endif
8067}
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);
8074 Py_XDECREF(type);
8075 Py_XDECREF(tb);
8076 #else
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;
8086 #else
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;
8093 #endif
8094 Py_XDECREF(tmp_type);
8095 Py_XDECREF(tmp_value);
8096 Py_XDECREF(tmp_tb);
8097 #endif
8098}
8099#endif
8100
8101/* FastTypeChecks (used by PyException_Check) */
8102#if CYTHON_COMPILING_IN_CPYTHON
8103static int __Pyx_InBases(PyTypeObject *a, PyTypeObject *b) {
8104 while (a) {
8105 a = __Pyx_PyType_GetSlot(a, tp_base, PyTypeObject*);
8106 if (a == b)
8107 return 1;
8108 }
8109 return b == &PyBaseObject_Type;
8110}
8111static CYTHON_INLINE int __Pyx_IsSubtype(PyTypeObject *a, PyTypeObject *b) {
8112 PyObject *mro;
8113 if (a == b) return 1;
8114 mro = a->tp_mro;
8115 if (likely(mro)) {
8116 Py_ssize_t i, n;
8117 n = PyTuple_GET_SIZE(mro);
8118 for (i = 0; i < n; i++) {
8119 if (PyTuple_GET_ITEM(mro, i) == (PyObject *)b)
8120 return 1;
8121 }
8122 return 0;
8123 }
8124 return __Pyx_InBases(a, b);
8125}
8126static CYTHON_INLINE int __Pyx_IsAnySubtype2(PyTypeObject *cls, PyTypeObject *a, PyTypeObject *b) {
8127 PyObject *mro;
8128 if (cls == a || cls == b) return 1;
8129 mro = cls->tp_mro;
8130 if (likely(mro)) {
8131 Py_ssize_t i, n;
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)
8136 return 1;
8137 }
8138 return 0;
8139 }
8140 return __Pyx_InBases(cls, a) || __Pyx_InBases(cls, b);
8141}
8142#endif
8143
8144/* PyErrFetchRestore (used by GivenExceptionMatches) */
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)));
8150 if (value) {
8151 #if CYTHON_COMPILING_IN_CPYTHON
8152 if (unlikely(((PyBaseExceptionObject*) value)->traceback != tb))
8153 #endif
8154 PyException_SetTraceback(value, tb);
8155 }
8156 tmp_value = tstate->current_exception;
8157 tstate->current_exception = value;
8158 Py_XDECREF(tmp_value);
8159 Py_XDECREF(type);
8160 Py_XDECREF(tb);
8161#else
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);
8171 Py_XDECREF(tmp_tb);
8172#endif
8173}
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;
8179 *value = exc_value;
8180 *type = NULL;
8181 *tb = NULL;
8182 if (exc_value) {
8183 *type = (PyObject*) Py_TYPE(exc_value);
8184 Py_INCREF(*type);
8185 #if CYTHON_COMPILING_IN_CPYTHON
8186 *tb = ((PyBaseExceptionObject*) exc_value)->traceback;
8187 Py_XINCREF(*tb);
8188 #else
8189 *tb = PyException_GetTraceback(exc_value);
8190 #endif
8191 }
8192#else
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;
8199#endif
8200}
8201#endif
8202
8203/* GivenExceptionMatches (used by PyErrExceptionMatches) */
8204#if CYTHON_COMPILING_IN_CPYTHON
8205static CYTHON_INLINE int __Pyx_inner_PyErr_GivenExceptionMatches2(PyObject *err, PyObject* exc_type1, PyObject *exc_type2) {
8206 if (exc_type1) {
8207 return __Pyx_IsAnySubtype2((PyTypeObject*)err, (PyTypeObject*)exc_type1, (PyTypeObject*)exc_type2);
8208 } else {
8209 return __Pyx_IsSubtype((PyTypeObject*)err, (PyTypeObject*)exc_type2);
8210 }
8211}
8212static int __Pyx_PyErr_GivenExceptionMatchesTuple(PyObject *exc_type, PyObject *tuple) {
8213 Py_ssize_t i, n;
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;
8218 }
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;
8223 } else {
8224 }
8225 }
8226 return 0;
8227}
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);
8235 } else {
8236 }
8237 }
8238 return PyErr_GivenExceptionMatches(err, exc_type);
8239}
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);
8246 }
8247 return (PyErr_GivenExceptionMatches(err, exc_type1) || PyErr_GivenExceptionMatches(err, exc_type2));
8248}
8249#endif
8250
8251/* PyErrExceptionMatches */
8252#if CYTHON_FAST_THREAD_STATE
8253static int __Pyx_PyErr_ExceptionMatchesTuple(PyObject *exc_type, PyObject *tuple) {
8254 Py_ssize_t i, n;
8255 n = PyTuple_GET_SIZE(tuple);
8256 for (i=0; i<n; i++) {
8257 if (exc_type == PyTuple_GET_ITEM(tuple, i)) return 1;
8258 }
8259 for (i=0; i<n; i++) {
8260 if (__Pyx_PyErr_GivenExceptionMatches(exc_type, PyTuple_GET_ITEM(tuple, i))) return 1;
8261 }
8262 return 0;
8263}
8264static CYTHON_INLINE int __Pyx_PyErr_ExceptionMatchesInState(PyThreadState* tstate, PyObject* err) {
8265 int result;
8266 PyObject *exc_type;
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;
8272#else
8273 exc_type = tstate->curexc_type;
8274 if (exc_type == err) return 1;
8275 if (unlikely(!exc_type)) return 0;
8276#endif
8277 #if CYTHON_AVOID_BORROWED_REFS
8278 Py_INCREF(exc_type);
8279 #endif
8280 if (unlikely(PyTuple_Check(err))) {
8281 result = __Pyx_PyErr_ExceptionMatchesTuple(exc_type, err);
8282 } else {
8283 result = __Pyx_PyErr_GivenExceptionMatches(exc_type, err);
8284 }
8285 #if CYTHON_AVOID_BORROWED_REFS
8286 Py_DECREF(exc_type);
8287 #endif
8288 return result;
8289}
8290#endif
8291
8292/* GetException */
8293#if CYTHON_FAST_THREAD_STATE
8294static int __Pyx__GetException(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb)
8295#else
8296static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb)
8297#endif
8298{
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;
8305 #else
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;
8312 #endif
8313#elif __PYX_LIMITED_VERSION_HEX >= 0x030C0000
8314 local_value = PyErr_GetRaisedException();
8315#else
8316 PyErr_Fetch(&local_type, &local_value, &local_tb);
8317#endif
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);
8323 }
8324#else
8325 PyErr_NormalizeException(&local_type, &local_value, &local_tb);
8326#if CYTHON_FAST_THREAD_STATE
8327 if (unlikely(tstate->curexc_type))
8328#else
8329 if (unlikely(PyErr_Occurred()))
8330#endif
8331 goto bad;
8332 if (local_tb) {
8333 if (unlikely(PyException_SetTraceback(local_value, local_tb) < 0))
8334 goto bad;
8335 }
8336#endif // __PYX_LIMITED_VERSION_HEX >= 0x030C0000
8337 Py_XINCREF(local_tb);
8338 Py_XINCREF(local_type);
8339 Py_XINCREF(local_value);
8340 *type = local_type;
8341 *value = local_value;
8342 *tb = local_tb;
8343#if CYTHON_FAST_THREAD_STATE
8344 #if CYTHON_USE_EXC_INFO_STACK
8345 {
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;
8350 tmp_type = NULL;
8351 tmp_tb = NULL;
8352 Py_XDECREF(local_type);
8353 Py_XDECREF(local_tb);
8354 #else
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;
8361 #endif
8362 }
8363 #else
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;
8370 #endif
8371 Py_XDECREF(tmp_type);
8372 Py_XDECREF(tmp_value);
8373 Py_XDECREF(tmp_tb);
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);
8379#else
8380 PyErr_SetExcInfo(local_type, local_value, local_tb);
8381#endif
8382 return 0;
8383#if __PYX_LIMITED_VERSION_HEX < 0x030C0000
8384bad:
8385 *type = 0;
8386 *value = 0;
8387 *tb = 0;
8388 Py_XDECREF(local_type);
8389 Py_XDECREF(local_value);
8390 Py_XDECREF(local_tb);
8391 return -1;
8392#endif
8393}
8394
8395/* PyObjectCall (used by PyObjectFastCall) */
8396#if CYTHON_COMPILING_IN_CPYTHON
8397static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw) {
8398 PyObject *result;
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")))
8403 return NULL;
8404 result = (*call)(func, arg, kw);
8405 Py_LeaveRecursiveCall();
8406 if (unlikely(!result) && unlikely(!PyErr_Occurred())) {
8407 PyErr_SetString(
8408 PyExc_SystemError,
8409 "NULL result without error in PyObject_Call");
8410 }
8411 return result;
8412}
8413#endif
8414
8415/* PyObjectCallMethO (used by PyObjectFastCall) */
8416#if CYTHON_COMPILING_IN_CPYTHON
8417static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg) {
8418 PyObject *self, *result;
8419 PyCFunction cfunc;
8420 cfunc = __Pyx_CyOrPyCFunction_GET_FUNCTION(func);
8421 self = __Pyx_CyOrPyCFunction_GET_SELF(func);
8422 if (unlikely(Py_EnterRecursiveCall(" while calling a Python object")))
8423 return NULL;
8424 result = cfunc(self, arg);
8425 Py_LeaveRecursiveCall();
8426 if (unlikely(!result) && unlikely(!PyErr_Occurred())) {
8427 PyErr_SetString(
8428 PyExc_SystemError,
8429 "NULL result without error in PyObject_Call");
8430 }
8431 return result;
8432}
8433#endif
8434
8435/* PyObjectFastCall */
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;
8440 size_t i;
8441 argstuple = PyTuple_New((Py_ssize_t)nargs);
8442 if (unlikely(!argstuple)) return NULL;
8443 for (i = 0; i < nargs; i++) {
8444 Py_INCREF(args[i]);
8445 if (__Pyx_PyTuple_SET_ITEM(argstuple, (Py_ssize_t)i, args[i]) != (0)) goto bad;
8446 }
8447 result = __Pyx_PyObject_Call(func, argstuple, kwargs);
8448 bad:
8449 Py_DECREF(argstuple);
8450 return result;
8451}
8452#endif
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);
8460 }
8461 #endif
8462 if (!PyType_HasFeature(tp, Py_TPFLAGS_HAVE_VECTORCALL)) {
8463 return NULL;
8464 }
8465 assert(PyCallable_Check(callable));
8466 Py_ssize_t offset = tp->tp_vectorcall_offset;
8467 assert(offset > 0);
8468 vectorcallfunc ptr;
8469 memcpy(&ptr, (char *) callable + offset, sizeof(ptr));
8470 return ptr;
8471}
8472 #else
8473 #define __Pyx_PyVectorcall_Function(callable) PyVectorcall_Function(callable)
8474 #endif
8475#endif
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);
8482 }
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]);
8486 }
8487#endif
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);
8492 #else
8493 vectorcallfunc f = __Pyx_PyVectorcall_Function(func);
8494 if (f) {
8495 return f(func, args, nargsf, NULL);
8496 }
8497 #endif
8498 #endif
8499 }
8500 if (nargs == 0) {
8501 return __Pyx_PyObject_Call(func, __pyx_mstate_global->__pyx_empty_tuple, kwargs);
8502 }
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);
8507 #else
8508 return PyObject_VectorcallDict(func, args, nargsf, kwargs);
8509 #endif
8510}
8511
8512/* RaiseException */
8513static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause) {
8514 PyObject* owned_instance = NULL;
8515 if (tb == Py_None) {
8516 tb = 0;
8517 } else if (tb && !PyTraceBack_Check(tb)) {
8518 PyErr_SetString(PyExc_TypeError,
8519 "raise: arg 3 must be a traceback or None");
8520 goto bad;
8521 }
8522 if (value == Py_None)
8523 value = 0;
8524 if (PyExceptionInstance_Check(type)) {
8525 if (value) {
8526 PyErr_SetString(PyExc_TypeError,
8527 "instance exception may not have a separate value");
8528 goto bad;
8529 }
8530 value = type;
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);
8538 if (!is_subclass) {
8539 instance_class = NULL;
8540 } else if (unlikely(is_subclass == -1)) {
8541 goto bad;
8542 } else {
8543 type = instance_class;
8544 }
8545 }
8546 }
8547 if (!instance_class) {
8548 PyObject *args;
8549 if (!value)
8550 args = PyTuple_New(0);
8551 else if (PyTuple_Check(value)) {
8552 Py_INCREF(value);
8553 args = value;
8554 } else
8555 args = PyTuple_Pack(1, value);
8556 if (!args)
8557 goto bad;
8558 owned_instance = PyObject_Call(type, args, NULL);
8559 Py_DECREF(args);
8560 if (!owned_instance)
8561 goto bad;
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));
8568 goto bad;
8569 }
8570 }
8571 } else {
8572 PyErr_SetString(PyExc_TypeError,
8573 "raise: exception class must be a subclass of BaseException");
8574 goto bad;
8575 }
8576 if (cause) {
8577 PyObject *fixed_cause;
8578 if (cause == Py_None) {
8579 fixed_cause = NULL;
8580 } else if (PyExceptionClass_Check(cause)) {
8581 fixed_cause = PyObject_CallObject(cause, NULL);
8582 if (fixed_cause == NULL)
8583 goto bad;
8584 } else if (PyExceptionInstance_Check(cause)) {
8585 fixed_cause = cause;
8586 Py_INCREF(fixed_cause);
8587 } else {
8588 PyErr_SetString(PyExc_TypeError,
8589 "exception causes must derive from "
8590 "BaseException");
8591 goto bad;
8592 }
8593 PyException_SetCause(value, fixed_cause);
8594 }
8595 PyErr_SetObject(type, value);
8596 if (tb) {
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;
8602 if (tb != tmp_tb) {
8603 Py_INCREF(tb);
8604 tstate->curexc_traceback = tb;
8605 Py_XDECREF(tmp_tb);
8606 }
8607#else
8608 PyObject *tmp_type, *tmp_value, *tmp_tb;
8609 PyErr_Fetch(&tmp_type, &tmp_value, &tmp_tb);
8610 Py_INCREF(tb);
8611 PyErr_Restore(tmp_type, tmp_value, tb);
8612 Py_XDECREF(tmp_tb);
8613#endif
8614 }
8615bad:
8616 Py_XDECREF(owned_instance);
8617 return;
8618}
8619
8620/* CopyObjectArray (used by TupleOrListFromArrayImpl) */
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) {
8623 PyObject *v;
8624 Py_ssize_t i;
8625 for (i = 0; i < length; i++) {
8626 v = dest[i] = src[i];
8627 Py_INCREF(v);
8628 }
8629}
8630#endif
8631
8632/* TupleOrListFromArrayImpl (used by TupleFromArray) */
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) {
8636 if (n <= 0) {
8637 return __Pyx_NewRef(__pyx_mstate_global->__pyx_empty_tuple);
8638 }
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);
8643 #else
8644 Py_ssize_t i;
8645 for (i = 0; i < n; i++) {
8646 Py_INCREF(src[i]);
8647 if (unlikely(__Pyx_PyTuple_SET_ITEM(res, i, src[i]) < (0))) {
8648 Py_DECREF(res);
8649 return NULL;
8650 }
8651 }
8652 #endif
8653 return res;
8654}
8655#endif
8656
8657/* PyObjectCompare (used by UnicodeEquals) */
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;
8665 #endif
8666 if (result == 0) goto __pyx_return_false; else goto __pyx_return_true;
8667 #else
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;
8671 #endif
8672__pyx_return_true:
8673 return 1;
8674__pyx_return_false:
8675 return 0;
8676}
8677#endif
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;
8682 }
8683 if (unlikely(op2 == Py_None)) {
8684 if (op1 == Py_None) goto __pyx_return_true; else goto __pyx_return_false;
8685 }
8686
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);
8691 }
8692 goto __pyx_richcmp;
8693 }
8694
8695 if ((0)) goto __pyx_richcmp;
8696 if ((0)) goto __pyx_return_true;
8697 if ((0)) goto __pyx_return_false;
8698__pyx_richcmp:
8699 return __Pyx_PyObject_RichCompareBool(op1, op2, Py_EQ);
8700__pyx_return_true:
8701 return 1;
8702__pyx_return_false:
8703 return 0;
8704}
8705
8706/* fastcall */
8707#if CYTHON_VECTORCALL
8708static CYTHON_INLINE PyObject * __Pyx_GetKwValue_FASTCALL(PyObject *kwnames, PyObject *const *kwvalues, PyObject *s)
8709{
8710 Py_ssize_t i, n = __Pyx_PyTuple_GET_SIZE(kwnames);
8711 #if !CYTHON_ASSUME_SAFE_SIZE
8712 if (unlikely(n == -1)) return NULL;
8713 #endif
8714 for (i = 0; i < n; i++)
8715 {
8716 PyObject *namei = __Pyx_PyTuple_GET_ITEM(kwnames, i);
8717 #if !CYTHON_ASSUME_SAFE_MACROS
8718 if (unlikely(!namei)) return NULL;
8719 #endif
8720 if (s == namei) return kwvalues[i];
8721 }
8722 for (i = 0; i < n; i++)
8723 {
8724 PyObject *namei = __Pyx_PyTuple_GET_ITEM(kwnames, i);
8725 #if !CYTHON_ASSUME_SAFE_MACROS
8726 if (unlikely(!namei)) return NULL;
8727 #endif
8728 int eq = __Pyx_PyUnicode_Equals(s, namei);
8729 if (unlikely(eq != 0)) {
8730 if (unlikely(eq < 0)) return NULL;
8731 return kwvalues[i];
8732 }
8733 }
8734 return NULL;
8735}
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;
8739 PyObject *dict;
8740#if !CYTHON_ASSUME_SAFE_SIZE
8741 nkwargs = PyTuple_Size(kwnames);
8742 if (unlikely(nkwargs < 0)) return NULL;
8743#else
8744 nkwargs = PyTuple_GET_SIZE(kwnames);
8745#endif
8746 dict = PyDict_New();
8747 if (unlikely(!dict))
8748 return NULL;
8749 for (i=0; i<nkwargs; i++) {
8750#if !CYTHON_ASSUME_SAFE_MACROS
8751 PyObject *key = PyTuple_GetItem(kwnames, i);
8752 if (!key) goto bad;
8753#else
8754 PyObject *key = PyTuple_GET_ITEM(kwnames, i);
8755#endif
8756 if (unlikely(PyDict_SetItem(dict, key, kwvalues[i]) < 0))
8757 goto bad;
8758 }
8759 return dict;
8760bad:
8761 Py_DECREF(dict);
8762 return NULL;
8763}
8764#endif
8765#endif
8766
8767/* PyObjectCallOneArg (used by CallUnboundCMethod0) */
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);
8771}
8772
8773/* IgnoreException (used by UnpackUnboundCMethod_impl) */
8774static CYTHON_INLINE int __Pyx_IgnoreGivenException(PyObject *given_exception, PyObject *ignorable_exception) {
8775 if (PyErr_GivenExceptionMatches(given_exception ? given_exception : PyErr_Occurred(), ignorable_exception)) {
8776 PyErr_Clear();
8777 return 1;
8778 }
8779 return 0;
8780}
8781
8782/* PyObjectGetAttrStr (used by UnpackUnboundCMethod_impl) */
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);
8789}
8790#endif
8791
8792/* UnpackUnboundCMethod_impl (used by UnpackUnboundCMethod) */
8793#if CYTHON_COMPILING_IN_LIMITED_API && __PYX_LIMITED_VERSION_HEX < 0x030C0000
8794static PyObject *__Pyx_SelflessCall(PyObject *method, PyObject *args, PyObject *kwargs) {
8795 PyObject *result;
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);
8800 return result;
8801}
8802#else
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);
8805}
8806#endif
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,
8812#else
8813 METH_FASTCALL | METH_KEYWORDS,
8814#endif
8815 NULL
8816};
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))
8821 return -1;
8822 result = method;
8823#if CYTHON_COMPILING_IN_CPYTHON
8824 if (likely(__Pyx_TypeCheck(method, &PyMethodDescr_Type)))
8825 {
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);
8829 } else
8830#endif
8831#if CYTHON_COMPILING_IN_PYPY
8832#else
8833 if (PyCFunction_Check(method))
8834#endif
8835 {
8836 PyObject *self;
8837 int self_found;
8838#if CYTHON_COMPILING_IN_LIMITED_API || CYTHON_COMPILING_IN_PYPY
8839 self = PyObject_GetAttrString(method, "__self__");
8840 if (!self && !__Pyx_IgnoreException(PyExc_AttributeError)) {
8841 return -1;
8842 }
8843#else
8844 self = PyCFunction_GET_SELF(method);
8845#endif
8846 self_found = (self && self != Py_None);
8847#if CYTHON_COMPILING_IN_LIMITED_API || CYTHON_COMPILING_IN_PYPY
8848 Py_XDECREF(self);
8849#endif
8850 if (self_found) {
8851 PyObject *unbound_method = PyCFunction_New(&__Pyx_UnboundCMethod_Def, method);
8852 if (unlikely(!unbound_method)) return -1;
8853 Py_DECREF(method);
8854 result = unbound_method;
8855 }
8856 }
8857#if !CYTHON_COMPILING_IN_CPYTHON_FREETHREADING
8858 if (unlikely(target->method)) {
8859 Py_DECREF(result);
8860 } else
8861#endif
8862 target->method = result;
8863 return 0;
8864}
8865
8866/* CallUnboundCMethod0 */
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);
8882 }
8883#if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING
8884 else if (unlikely(was_initialized == 1)) {
8885 __Pyx_CachedCFunction tmp_cfunc = {
8886#ifndef __cplusplus
8887 0
8888#endif
8889 };
8890 tmp_cfunc.type = cfunc->type;
8891 tmp_cfunc.method_name = cfunc->method_name;
8892 return __Pyx__CallUnboundCMethod0(&tmp_cfunc, self);
8893 }
8894#endif
8895 PyObject *result = __Pyx__CallUnboundCMethod0(cfunc, self);
8896 __Pyx_CachedCFunction_SetFinishedInitializing(cfunc);
8897 return result;
8898}
8899#endif
8900static PyObject* __Pyx__CallUnboundCMethod0(__Pyx_CachedCFunction* cfunc, PyObject* self) {
8901 PyObject *result;
8902 if (unlikely(!cfunc->method) && unlikely(__Pyx_TryUnpackUnboundCMethod(cfunc) < 0)) return NULL;
8903 result = __Pyx_PyObject_CallOneArg(cfunc->method, self);
8904 return result;
8905}
8906
8907/* py_dict_items (used by OwnedDictNext) */
8908static CYTHON_INLINE PyObject* __Pyx_PyDict_Items(PyObject* d) {
8909 return __Pyx_CallUnboundCMethod0(&__pyx_mstate_global->__pyx_umethod_PyDict_Type_items, d);
8910}
8911
8912/* py_dict_values (used by OwnedDictNext) */
8913static CYTHON_INLINE PyObject* __Pyx_PyDict_Values(PyObject* d) {
8914 return __Pyx_CallUnboundCMethod0(&__pyx_mstate_global->__pyx_umethod_PyDict_Type_values, d);
8915}
8916
8917/* OwnedDictNext (used by ParseKeywordsImpl) */
8918#if CYTHON_AVOID_BORROWED_REFS
8919static int __Pyx_PyDict_NextRef(PyObject *p, PyObject **ppos, PyObject **pkey, PyObject **pvalue) {
8920 PyObject *next = NULL;
8921 if (!*ppos) {
8922 if (pvalue) {
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);
8927 } else {
8928 *ppos = PyObject_GetIter(p);
8929 }
8930 if (unlikely(!*ppos)) goto bad;
8931 }
8932 next = PyIter_Next(*ppos);
8933 if (!next) {
8934 if (PyErr_Occurred()) goto bad;
8935 return 0;
8936 }
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;
8942 Py_DECREF(next);
8943 } else if (pkey) {
8944 *pkey = next;
8945 } else {
8946 assert(pvalue);
8947 *pvalue = next;
8948 }
8949 return 1;
8950 bad:
8951 Py_XDECREF(next);
8952#if !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX >= 0x030d0000
8953 PyErr_FormatUnraisable("Exception ignored in __Pyx_PyDict_NextRef");
8954#else
8955 PyErr_WriteUnraisable(__pyx_mstate_global->__pyx_n_u_Pyx_PyDict_NextRef);
8956#endif
8957 if (pkey) *pkey = NULL;
8958 if (pvalue) *pvalue = NULL;
8959 return 0;
8960}
8961#else // !CYTHON_AVOID_BORROWED_REFS
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);
8967 }
8968 return result;
8969}
8970#endif
8971
8972/* RaiseDoubleKeywords (used by ParseKeywordsImpl) */
8973static void __Pyx_RaiseDoubleKeywordsError(
8974 const char* func_name,
8975 PyObject* kw_name)
8976{
8977 PyErr_Format(PyExc_TypeError,
8978 "%s() got multiple values for keyword argument '%U'", func_name, kw_name);
8979}
8980
8981/* CallUnboundCMethod2 */
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);
8989 }
8990 if (cfunc->flag == (METH_FASTCALL | METH_KEYWORDS))
8991 return __Pyx_CallCFunctionFastWithKeywords(cfunc, self, args, 2, NULL);
8992 }
8993#if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING
8994 else if (unlikely(was_initialized == 1)) {
8995 __Pyx_CachedCFunction tmp_cfunc = {
8996#ifndef __cplusplus
8997 0
8998#endif
8999 };
9000 tmp_cfunc.type = cfunc->type;
9001 tmp_cfunc.method_name = cfunc->method_name;
9002 return __Pyx__CallUnboundCMethod2(&tmp_cfunc, self, arg1, arg2);
9003 }
9004#endif
9005 PyObject *result = __Pyx__CallUnboundCMethod2(cfunc, self, arg1, arg2);
9006 __Pyx_CachedCFunction_SetFinishedInitializing(cfunc);
9007 return result;
9008}
9009#endif
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;
9017 Py_INCREF(arg1);
9018 PyTuple_SET_ITEM(args, 0, arg1);
9019 Py_INCREF(arg2);
9020 PyTuple_SET_ITEM(args, 1, arg2);
9021 if (cfunc->flag & METH_KEYWORDS)
9022 result = __Pyx_CallCFunctionWithKeywords(cfunc, self, args, NULL);
9023 else
9024 result = __Pyx_CallCFunction(cfunc, self, args);
9025 Py_DECREF(args);
9026 return result;
9027 }
9028#endif
9029 {
9030 PyObject *args[4] = {NULL, self, arg1, arg2};
9031 return __Pyx_PyObject_FastCall(cfunc->method, args+1, 3 | __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET);
9032 }
9033}
9034
9035/* ParseKeywordsImpl (used by ParseKeywords) */
9036static int __Pyx_ValidateDuplicatePosArgs(
9037 PyObject *kwds,
9038 PyObject ** const argnames[],
9039 PyObject ** const *first_kw_arg,
9040 const char* function_name)
9041{
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);
9048 goto bad;
9049 }
9050 name++;
9051 }
9052 return 0;
9053bad:
9054 return -1;
9055}
9056#if CYTHON_USE_UNICODE_INTERNALS
9057static CYTHON_INLINE int __Pyx_UnicodeKeywordsEqual(PyObject *s1, PyObject *s2) {
9058 int kind;
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);
9066}
9067#endif
9068static int __Pyx_MatchKeywordArg_str(
9069 PyObject *key,
9070 PyObject ** const argnames[],
9071 PyObject ** const *first_kw_arg,
9072 size_t *index_found,
9073 const char *function_name)
9074{
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))
9081 goto bad;
9082 }
9083 #endif
9084 name = first_kw_arg;
9085 while (*name) {
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);
9090 return 1;
9091 }
9092 #else
9093 #if CYTHON_ASSUME_SAFE_SIZE
9094 if (PyUnicode_GET_LENGTH(name_str) == PyUnicode_GET_LENGTH(key))
9095 #endif
9096 {
9097 int cmp = PyUnicode_Compare(name_str, key);
9098 if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad;
9099 if (cmp == 0) {
9100 *index_found = (size_t) (name - argnames);
9101 return 1;
9102 }
9103 }
9104 #endif
9105 name++;
9106 }
9107 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;
9114 }
9115 #else
9116 #if CYTHON_ASSUME_SAFE_SIZE
9117 if (PyUnicode_GET_LENGTH(name_str) == PyUnicode_GET_LENGTH(key))
9118 #endif
9119 {
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;
9124 }
9125 #endif
9126 name++;
9127 }
9128 return 0;
9129arg_passed_twice:
9130 __Pyx_RaiseDoubleKeywordsError(function_name, key);
9131 goto bad;
9132bad:
9133 return -1;
9134}
9135static int __Pyx_MatchKeywordArg_nostr(
9136 PyObject *key,
9137 PyObject ** const argnames[],
9138 PyObject ** const *first_kw_arg,
9139 size_t *index_found,
9140 const char *function_name)
9141{
9142 PyObject ** const *name;
9143 if (unlikely(!PyUnicode_Check(key))) goto invalid_keyword_type;
9144 name = first_kw_arg;
9145 while (*name) {
9146 int cmp = PyObject_RichCompareBool(**name, key, Py_EQ);
9147 if (cmp == 1) {
9148 *index_found = (size_t) (name - argnames);
9149 return 1;
9150 }
9151 if (unlikely(cmp == -1)) goto bad;
9152 name++;
9153 }
9154 name = argnames;
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;
9159 else goto bad;
9160 }
9161 name++;
9162 }
9163 return 0;
9164arg_passed_twice:
9165 __Pyx_RaiseDoubleKeywordsError(function_name, key);
9166 goto bad;
9167invalid_keyword_type:
9168 PyErr_Format(PyExc_TypeError,
9169 "%.200s() keywords must be strings", function_name);
9170 goto bad;
9171bad:
9172 return -1;
9173}
9174static CYTHON_INLINE int __Pyx_MatchKeywordArg(
9175 PyObject *key,
9176 PyObject ** const argnames[],
9177 PyObject ** const *first_kw_arg,
9178 size_t *index_found,
9179 const char *function_name)
9180{
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);
9184}
9185static void __Pyx_RejectUnknownKeyword(
9186 PyObject *kwds,
9187 PyObject ** const argnames[],
9188 PyObject ** const *first_kw_arg,
9189 const char *function_name)
9190{
9191 #if CYTHON_AVOID_BORROWED_REFS
9192 PyObject *pos = NULL;
9193 #else
9194 Py_ssize_t pos = 0;
9195 #endif
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))
9200 #else
9201 (void) __Pyx_PyDict_NextRef;
9202 while (PyDict_Next(kwds, &pos, &key, NULL))
9203 #endif
9204 {
9205 PyObject** const *name = first_kw_arg;
9206 while (*name && (**name != key)) name++;
9207 if (!*name) {
9208 size_t index_found = 0;
9209 int cmp = __Pyx_MatchKeywordArg(key, argnames, first_kw_arg, &index_found, function_name);
9210 if (cmp != 1) {
9211 if (cmp == 0) {
9212 PyErr_Format(PyExc_TypeError,
9213 "%s() got an unexpected keyword argument '%U'",
9214 function_name, key);
9215 }
9216 #if CYTHON_AVOID_BORROWED_REFS
9217 Py_DECREF(key);
9218 #endif
9219 break;
9220 }
9221 }
9222 #if CYTHON_AVOID_BORROWED_REFS
9223 Py_DECREF(key);
9224 #endif
9225 }
9226 __Pyx_END_CRITICAL_SECTION();
9227 #if CYTHON_AVOID_BORROWED_REFS
9228 Py_XDECREF(pos);
9229 #endif
9230 assert(PyErr_Occurred());
9231}
9232static int __Pyx_ParseKeywordDict(
9233 PyObject *kwds,
9234 PyObject ** const argnames[],
9235 PyObject *values[],
9236 Py_ssize_t num_pos_args,
9237 Py_ssize_t num_kwargs,
9238 const char* function_name,
9239 int ignore_unknown_kwargs)
9240{
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;
9246#endif
9247 name = first_kw_arg;
9248 while (*name && num_kwargs > extracted) {
9249 PyObject * key = **name;
9250 PyObject *value;
9251 int found = 0;
9252 #if __PYX_LIMITED_VERSION_HEX >= 0x030d0000
9253 found = PyDict_GetItemRef(kwds, key, &value);
9254 #else
9255 value = PyDict_GetItemWithError(kwds, key);
9256 if (value) {
9257 Py_INCREF(value);
9258 found = 1;
9259 } else {
9260 if (unlikely(PyErr_Occurred())) goto bad;
9261 }
9262 #endif
9263 if (found) {
9264 if (unlikely(found < 0)) goto bad;
9265 values[name-argnames] = value;
9266 extracted++;
9267 }
9268 name++;
9269 }
9270 if (num_kwargs > extracted) {
9271 if (ignore_unknown_kwargs) {
9272 if (unlikely(__Pyx_ValidateDuplicatePosArgs(kwds, argnames, first_kw_arg, function_name) == -1))
9273 goto bad;
9274 } else {
9275 __Pyx_RejectUnknownKeyword(kwds, argnames, first_kw_arg, function_name);
9276 goto bad;
9277 }
9278 }
9279 return 0;
9280bad:
9281 return -1;
9282}
9283static int __Pyx_ParseKeywordDictToDict(
9284 PyObject *kwds,
9285 PyObject ** const argnames[],
9286 PyObject *kwds2,
9287 PyObject *values[],
9288 Py_ssize_t num_pos_args,
9289 const char* function_name)
9290{
9291 PyObject** const *name;
9292 PyObject** const *first_kw_arg = argnames + num_pos_args;
9293 Py_ssize_t len;
9294#if !CYTHON_COMPILING_IN_PYPY || defined(PyArg_ValidateKeywordArguments)
9295 if (unlikely(!PyArg_ValidateKeywordArguments(kwds))) return -1;
9296#endif
9297 if (PyDict_Update(kwds2, kwds) < 0) goto bad;
9298 name = first_kw_arg;
9299 while (*name) {
9300 PyObject *key = **name;
9301 PyObject *value;
9302#if !CYTHON_COMPILING_IN_LIMITED_API && (PY_VERSION_HEX >= 0x030d00A2 || defined(PyDict_Pop))
9303 int found = PyDict_Pop(kwds2, key, &value);
9304 if (found) {
9305 if (unlikely(found < 0)) goto bad;
9306 values[name-argnames] = value;
9307 }
9308#elif __PYX_LIMITED_VERSION_HEX >= 0x030d0000
9309 int found = PyDict_GetItemRef(kwds2, key, &value);
9310 if (found) {
9311 if (unlikely(found < 0)) goto bad;
9312 values[name-argnames] = value;
9313 if (unlikely(PyDict_DelItem(kwds2, key) < 0)) goto bad;
9314 }
9315#else
9316 #if CYTHON_COMPILING_IN_CPYTHON
9317 value = _PyDict_Pop(kwds2, key, kwds2);
9318 #else
9319 value = __Pyx_CallUnboundCMethod2(&__pyx_mstate_global->__pyx_umethod_PyDict_Type_pop, kwds2, key, kwds2);
9320 #endif
9321 if (value == kwds2) {
9322 Py_DECREF(value);
9323 } else {
9324 if (unlikely(!value)) goto bad;
9325 values[name-argnames] = value;
9326 }
9327#endif
9328 name++;
9329 }
9330 len = PyDict_Size(kwds2);
9331 if (len > 0) {
9332 return __Pyx_ValidateDuplicatePosArgs(kwds, argnames, first_kw_arg, function_name);
9333 } else if (unlikely(len == -1)) {
9334 goto bad;
9335 }
9336 return 0;
9337bad:
9338 return -1;
9339}
9340static int __Pyx_ParseKeywordsTuple(
9341 PyObject *kwds,
9342 PyObject * const *kwvalues,
9343 PyObject ** const argnames[],
9344 PyObject *kwds2,
9345 PyObject *values[],
9346 Py_ssize_t num_pos_args,
9347 Py_ssize_t num_kwargs,
9348 const char* function_name,
9349 int ignore_unknown_kwargs)
9350{
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);
9357#else
9358 key = __Pyx_PyTuple_GET_ITEM(kwds, pos);
9359#endif
9360#if !CYTHON_ASSUME_SAFE_MACROS
9361 if (unlikely(!key)) goto bad;
9362#endif
9363 name = first_kw_arg;
9364 while (*name && (**name != key)) name++;
9365 if (*name) {
9366 PyObject *value = kwvalues[pos];
9367 values[name-argnames] = __Pyx_NewRef(value);
9368 } else {
9369 size_t index_found = 0;
9370 int cmp = __Pyx_MatchKeywordArg(key, argnames, first_kw_arg, &index_found, function_name);
9371 if (cmp == 1) {
9372 PyObject *value = kwvalues[pos];
9373 values[index_found] = __Pyx_NewRef(value);
9374 } else {
9375 if (unlikely(cmp == -1)) goto bad;
9376 if (kwds2) {
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;
9381 }
9382 }
9383 }
9384 #if CYTHON_AVOID_BORROWED_REFS
9385 Py_DECREF(key);
9386 key = NULL;
9387 #endif
9388 }
9389 return 0;
9390invalid_keyword:
9391 PyErr_Format(PyExc_TypeError,
9392 "%s() got an unexpected keyword argument '%U'",
9393 function_name, key);
9394 goto bad;
9395bad:
9396 #if CYTHON_AVOID_BORROWED_REFS
9397 Py_XDECREF(key);
9398 #endif
9399 return -1;
9400}
9401
9402/* ParseKeywords */
9403static int __Pyx_ParseKeywords(
9404 PyObject *kwds,
9405 PyObject * const *kwvalues,
9406 PyObject ** const argnames[],
9407 PyObject *kwds2,
9408 PyObject *values[],
9409 Py_ssize_t num_pos_args,
9410 Py_ssize_t num_kwargs,
9411 const char* function_name,
9412 int ignore_unknown_kwargs)
9413{
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);
9416 else if (kwds2)
9417 return __Pyx_ParseKeywordDictToDict(kwds, argnames, kwds2, values, num_pos_args, function_name);
9418 else
9419 return __Pyx_ParseKeywordDict(kwds, argnames, values, num_pos_args, num_kwargs, function_name, ignore_unknown_kwargs);
9420}
9421
9422/* RaiseArgTupleInvalid */
9423static void __Pyx_RaiseArgtupleInvalid(
9424 const char* func_name,
9425 int exact,
9426 Py_ssize_t num_min,
9427 Py_ssize_t num_max,
9428 Py_ssize_t num_found)
9429{
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";
9435 } else {
9436 num_expected = num_max;
9437 more_or_less = "at most";
9438 }
9439 if (exact) {
9440 more_or_less = "exactly";
9441 }
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);
9446}
9447
9448/* ArgTypeTestError (used by ArgTypeTest) */
9449static void __Pyx_ArgTypeError(PyObject *obj, PyTypeObject *type, const char *name, int exact)
9450{
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");
9457 return;
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;
9462 }
9463 }
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;
9467 #endif
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;
9471 #endif
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
9475 "%s%U"
9476#endif
9477 , name, type_name, obj_type_name
9478#if __PYX_LIMITED_VERSION_HEX < 0x030C0000
9479 , (from_annotation_subclass ? ". " : ""), extra_info
9480#endif
9481 );
9482#if __PYX_LIMITED_VERSION_HEX >= 0x030C0000
9483 if (exact == 2 && from_annotation_subclass) {
9484 PyObject *res;
9485 PyObject *vargs[2];
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);
9489 Py_XDECREF(res);
9490 PyErr_SetRaisedException(vargs[0]);
9491 }
9492#endif
9493 __Pyx_DECREF_TypeName(obj_type_name);
9494#if CYTHON_COMPILING_IN_LIMITED_API && __PYX_LIMITED_VERSION_HEX < 0x030d0000
9495obj_type_name_failed:
9496#endif
9497 __Pyx_DECREF_TypeName(type_name);
9498 return;
9499}
9500
9501/* ArgTypeTest */
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))))
9504 return 1;
9505 if (!exact && likely(type) && likely(__Pyx_TypeCheck(obj, type)))
9506 return 1;
9507 __Pyx_ArgTypeError(obj, type, name, exact);
9508 return 0;
9509}
9510
9511/* TypeImport */
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)
9516{
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;
9523#endif
9524 result = PyObject_GetAttrString(module, class_name);
9525 if (!result)
9526 goto bad;
9527 if (!PyType_Check(result)) {
9528 PyErr_Format(PyExc_TypeError,
9529 "%.200s.%.200s is not a type object",
9530 module_name, class_name);
9531 goto bad;
9532 }
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;
9536#else
9537 if (size == 0) {
9538 return (PyTypeObject *)result;
9539 }
9540 py_basicsize = PyObject_GetAttrString(result, "__basicsize__");
9541 if (!py_basicsize)
9542 goto bad;
9543 basicsize = PyLong_AsSsize_t(py_basicsize);
9544 Py_DECREF(py_basicsize);
9545 py_basicsize = 0;
9546 if (basicsize == (Py_ssize_t)-1 && PyErr_Occurred())
9547 goto bad;
9548 py_itemsize = PyObject_GetAttrString(result, "__itemsize__");
9549 if (!py_itemsize)
9550 goto bad;
9551 itemsize = PyLong_AsSsize_t(py_itemsize);
9552 Py_DECREF(py_itemsize);
9553 py_itemsize = 0;
9554 if (itemsize == (Py_ssize_t)-1 && PyErr_Occurred())
9555 goto bad;
9556#endif
9557 if (itemsize) {
9558 if (size % alignment) {
9559 alignment = size % alignment;
9560 }
9561 if (itemsize < (Py_ssize_t)alignment)
9562 itemsize = (Py_ssize_t)alignment;
9563 }
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);
9569 goto bad;
9570 }
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);
9577 goto bad;
9578 }
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) {
9584 goto bad;
9585 }
9586 }
9587 return (PyTypeObject *)result;
9588bad:
9589 Py_XDECREF(result);
9590 return NULL;
9591}
9592#endif
9593
9594/* PyObjectGetAttrStrNoError (used by HasAttr) */
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();
9601}
9602#endif
9603static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStrNoError(PyObject* obj, PyObject* attr_name) {
9604 PyObject *result;
9605#if __PYX_LIMITED_VERSION_HEX >= 0x030d0000
9606 (void) PyObject_GetOptionalAttr(obj, attr_name, &result);
9607 return result;
9608#else
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);
9613 }
9614#endif
9615 result = __Pyx_PyObject_GetAttrStr(obj, attr_name);
9616 if (unlikely(!result)) {
9617 __Pyx_PyObject_GetAttrStr_ClearAttributeError();
9618 }
9619 return result;
9620#endif
9621}
9622
9623/* HasAttr (used by ImportImpl) */
9624#if __PYX_LIMITED_VERSION_HEX < 0x030d0000
9625static CYTHON_INLINE int __Pyx_HasAttr(PyObject *o, PyObject *n) {
9626 PyObject *r;
9627 if (unlikely(!PyUnicode_Check(n))) {
9628 PyErr_SetString(PyExc_TypeError,
9629 "hasattr(): attribute name must be string");
9630 return -1;
9631 }
9632 r = __Pyx_PyObject_GetAttrStrNoError(o, n);
9633 if (!r) {
9634 return (unlikely(PyErr_Occurred())) ? -1 : 0;
9635 } else {
9636 Py_DECREF(r);
9637 return 1;
9638 }
9639}
9640#endif
9641
9642/* TupleOrListFromArrayImpl (used by ListFromArray) */
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);
9649 #else
9650 Py_ssize_t i;
9651 for (i = 0; i < n; i++) {
9652 Py_INCREF(src[i]);
9653 if (unlikely(__Pyx_PyList_SET_ITEM(res, i, src[i]) < (0))) {
9654 Py_DECREF(res);
9655 return NULL;
9656 }
9657 }
9658 #endif
9659 return res;
9660}
9661
9662/* ImportImpl (used by Import) */
9663static int __Pyx__Import_GetModule(PyObject *qualname, PyObject **module) {
9664 PyObject *imported_module = PyImport_GetModule(qualname);
9665 if (unlikely(!imported_module)) {
9666 *module = NULL;
9667 if (PyErr_Occurred()) {
9668 return -1;
9669 }
9670 return 0;
9671 }
9672 *module = imported_module;
9673 return 1;
9674}
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;
9678 Py_ssize_t i;
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)) {
9683 *module = NULL;
9684 return module_found;
9685 }
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);
9691#else
9692 int has_imported_attribute = PyObject_HasAttrWithError(imported_module, imported_name);
9693 if (unlikely(has_imported_attribute == -1)) goto error;
9694#endif
9695 if (!has_imported_attribute) {
9696 goto not_found;
9697 }
9698 }
9699 *module = imported_module;
9700 return 1;
9701 }
9702 dot_index = PyUnicode_FindChar(qualname, '.', 0, PY_SSIZE_T_MAX, 1);
9703 if (dot_index == -1) {
9704 *module = imported_module;
9705 return 1;
9706 }
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);
9713 return status;
9714error:
9715 Py_DECREF(imported_module);
9716 *module = NULL;
9717 return -1;
9718not_found:
9719 Py_DECREF(imported_module);
9720 *module = NULL;
9721 return 0;
9722}
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;
9727 int module_found;
9728 if (!qualname) {
9729 qualname = name;
9730 }
9731 module_found = __Pyx__Import_Lookup(qualname, imported_names, len_imported_names, &module);
9732 if (likely(module_found == 1)) {
9733 return module;
9734 } else if (unlikely(module_found == -1)) {
9735 return NULL;
9736 }
9737 #if !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX >= 0x030f00a6
9738 empty_dict = PyFrozenDict_New(NULL);
9739 #else
9740 empty_dict = PyDict_New();
9741 #endif
9742 if (unlikely(!empty_dict))
9743 goto bad;
9744 if (imported_names) {
9745 from_list = __Pyx_PyList_FromArray(imported_names, len_imported_names);
9746 if (unlikely(!from_list))
9747 goto bad;
9748 }
9749 if (level == -1) {
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)))
9756 goto bad;
9757 PyErr_Clear();
9758 }
9759 }
9760 level = 0;
9761 }
9762 if (!module) {
9763 module = PyImport_ImportModuleLevelObject(
9764 name, moddict, empty_dict, from_list, level);
9765 }
9766bad:
9767 Py_XDECREF(from_list);
9768 Py_XDECREF(empty_dict);
9769 return module;
9770}
9771
9772/* Import */
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);
9775}
9776
9777/* dict_setdefault (used by FetchCommonType) */
9778static CYTHON_INLINE PyObject *__Pyx_PyDict_SetDefault(PyObject *d, PyObject *key, PyObject *default_value) {
9779 PyObject* 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);
9787#else
9788 value = PyDict_SetDefault(d, key, default_value);
9789 if (unlikely(!value)) return NULL;
9790 Py_INCREF(value);
9791#endif
9792 return value;
9793}
9794
9795/* AddModuleRef (used by FetchSharedCythonModule) */
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();
9799 PyObject *m;
9800 if (PyMapping_GetOptionalItem(module_dict, name, &m) < 0) {
9801 return NULL;
9802 }
9803 if (m != NULL && PyModule_Check(m)) {
9804 return m;
9805 }
9806 Py_XDECREF(m);
9807 m = PyModule_NewObject(name);
9808 if (m == NULL)
9809 return NULL;
9810 if (PyDict_CheckExact(module_dict)) {
9811 PyObject *new_m;
9812 (void)PyDict_SetDefaultRef(module_dict, name, m, &new_m);
9813 Py_DECREF(m);
9814 return new_m;
9815 } else {
9816 if (PyObject_SetItem(module_dict, name, m) != 0) {
9817 Py_DECREF(m);
9818 return NULL;
9819 }
9820 return m;
9821 }
9822 }
9823 static PyObject *__Pyx_PyImport_AddModuleRef(const char *name) {
9824 if ((PY_VERSION_HEX >= 0x030E0000) && Py_Version >= 0x030E0100) {
9825 return PyImport_AddModuleRef(name);
9826 }
9827 PyObject *py_name = PyUnicode_FromString(name);
9828 if (!py_name) return NULL;
9829 PyObject *module = __Pyx_PyImport_AddModuleObjectRef(py_name);
9830 Py_DECREF(py_name);
9831 return module;
9832 }
9833#elif __PYX_LIMITED_VERSION_HEX < 0x030d0000
9834 static PyObject *__Pyx_PyImport_AddModuleRef(const char *name) {
9835 PyObject *module = PyImport_AddModule(name);
9836 Py_XINCREF(module);
9837 return module;
9838 }
9839#endif
9840
9841/* FetchSharedCythonModule (used by FetchCommonType) */
9842static PyObject *__Pyx_FetchSharedCythonABIModule(void) {
9843 return __Pyx_PyImport_AddModuleRef(__PYX_ABI_MODULE_NAME);
9844}
9845
9846/* VerifyCachedType (used by FetchCommonType) */
9847static int __Pyx_VerifyCachedType(PyObject *cached_type,
9848 const char *name,
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);
9854 return -1;
9855 }
9856 if (expected_basicsize == 0) {
9857 return 0; // size is inherited, nothing useful to check
9858 }
9859#if CYTHON_COMPILING_IN_LIMITED_API && CYTHON_OPAQUE_OBJECTS
9860 if (expected_basicsize < 0) {
9861 basicsize = PyType_GetTypeDataSize((PyTypeObject*)cached_type);
9862 } else
9863#endif
9864 {
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;
9873 #else
9874 basicsize = ((PyTypeObject*) cached_type)->tp_basicsize;
9875 #endif
9876 }
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",
9882 name);
9883 return -1;
9884 }
9885 return 0;
9886}
9887
9888/* FetchCommonType (used by CommonTypesMetaclass) */
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);
9896 Py_DECREF(old_tp);
9897 PyType_Modified((PyTypeObject*)result);
9898 }
9899 return result;
9900}
9901#else
9902#define __Pyx_PyType_FromMetaclass(me, mo, s, b) PyType_FromMetaclass(me, mo, s, b)
9903#endif
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(
9918 cached_type,
9919 object_name,
9920 spec->basicsize) < 0) {
9921 goto bad;
9922 }
9923 goto done;
9924 } else if (unlikely(get_item_ref_result == -1)) {
9925 goto bad;
9926 }
9927 cached_type = __Pyx_PyType_FromMetaclass(
9928 metaclass,
9929 CYTHON_USE_MODULE_STATE ? module : abi_module,
9930 spec, bases);
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(
9938 cached_type,
9939 object_name,
9940 spec->basicsize) < 0) {
9941 goto bad;
9942 }
9943 goto done;
9944 } else {
9945 Py_DECREF(new_cached_type);
9946 }
9947done:
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;
9952bad:
9953 Py_XDECREF(cached_type);
9954 cached_type = NULL;
9955 goto done;
9956}
9957
9958/* CommonTypesMetaclass (used by CythonFunctionShared) */
9959static PyObject* __pyx_CommonTypesMetaclass_get_module(CYTHON_UNUSED PyObject *self, CYTHON_UNUSED void* context) {
9960 return PyUnicode_FromString(__PYX_ABI_MODULE_NAME);
9961}
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");
9965 return NULL;
9966}
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");
9969 return -1;
9970}
9971#endif
9972static PyGetSetDef __pyx_CommonTypesMetaclass_getset[] = {
9973 {"__module__", __pyx_CommonTypesMetaclass_get_module, NULL, NULL, NULL},
9974 {0, 0, 0, 0, 0}
9975};
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},
9982 #endif
9983 {0, 0}
9984};
9985static PyType_Spec __pyx_CommonTypesMetaclass_spec = {
9986 __PYX_TYPE_MODULE_PREFIX "_common_types_metatype",
9987 0,
9988 0,
9989 Py_TPFLAGS_IMMUTABLETYPE |
9990 Py_TPFLAGS_DISALLOW_INSTANTIATION |
9991 Py_TPFLAGS_DEFAULT,
9992 __pyx_CommonTypesMetaclass_slots
9993};
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)) {
9998 return -1;
9999 }
10000 mstate->__pyx_CommonTypesMetaclassType = __Pyx_FetchCommonTypeFromSpec(NULL, module, &__pyx_CommonTypesMetaclass_spec, bases);
10001 Py_DECREF(bases);
10002 if (unlikely(mstate->__pyx_CommonTypesMetaclassType == NULL)) {
10003 return -1;
10004 }
10005 return 0;
10006}
10007
10008/* CythonFunctionPerModule (used by CythonFunctionShared) */
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;
10015 }
10016 return 0;
10017}
10018static CYTHON_INLINE int __Pyx__IsSameCyOrCFunction(PyObject *func, void (*cfunc)(void)) {
10019 if ((PyObject*)Py_TYPE(func) == __pyx_mstate_global->__Pyx_CachedMethodType) {
10020 int result;
10021 PyObject *newFunc = PyObject_GetAttr(func, __pyx_mstate_global->__pyx_n_u_func);
10022 if (unlikely(!newFunc)) {
10023 PyErr_Clear(); // It's only an optimization, so don't throw an error
10024 return 0;
10025 }
10026 result = __Pyx__IsSameCyOrCFunctionNoMethod(newFunc, cfunc);
10027 Py_DECREF(newFunc);
10028 return result;
10029 }
10030 return __Pyx__IsSameCyOrCFunctionNoMethod(func, cfunc);
10031}
10032#else
10033static CYTHON_INLINE int __Pyx__IsSameCyOrCFunction(PyObject *func, void (*cfunc)(void)) {
10034 if (PyMethod_Check(func)) {
10035 func = PyMethod_GET_FUNCTION(func);
10036 }
10037 return __Pyx_CyOrPyCFunction_Check(func) && __Pyx_CyOrPyCFunction_GET_FUNCTION(func) == (PyCFunction) cfunc;
10038}
10039#endif
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));
10045#else
10046 __Pyx_Py_XDECREF_SET(
10047 ((PyCMethodObject *) (f))->mm_class,
10048 (PyTypeObject*)((classobj) ? __Pyx_NewRef(classobj) : NULL));
10049#endif
10050}
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); // _PyObject_New(defaults_type);
10054 if (unlikely(!m->defaults))
10055 return NULL;
10056 return m->defaults;
10057}
10058static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsTuple(PyObject *func, PyObject *tuple) {
10059 __pyx_CyFunctionObject *m = __Pyx_as_CyFunctionObject(func);
10060 m->defaults_tuple = tuple;
10061 Py_INCREF(tuple);
10062}
10063static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsKwDict(PyObject *func, PyObject *dict) {
10064 __pyx_CyFunctionObject *m = __Pyx_as_CyFunctionObject(func);
10065 m->defaults_kwdict = dict;
10066 Py_INCREF(dict);
10067}
10068static CYTHON_INLINE void __Pyx_CyFunction_SetAnnotationsDict(PyObject *func, PyObject *dict) {
10069 __pyx_CyFunctionObject *m = __Pyx_as_CyFunctionObject(func);
10070 m->func_annotations = dict;
10071 Py_INCREF(dict);
10072}
10073
10074/* CallTypeTraverse (used by CythonFunctionShared) */
10075#if !CYTHON_USE_TYPE_SPECS
10076#else
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) {
10082 return 0;
10083 }
10084 }
10085 Py_VISIT((PyObject*)Py_TYPE(o));
10086 return 0;
10087}
10088#endif
10089
10090/* PyMethodNew (used by CythonFunctionShared) */
10091#if CYTHON_COMPILING_IN_LIMITED_API
10092static PyObject *__Pyx_PyMethod_New(PyObject *func, PyObject *self, PyObject *typ) {
10093 PyObject *result;
10094 CYTHON_UNUSED_VAR(typ);
10095 if (!self)
10096 return __Pyx_NewRef(func);
10097 #if __PYX_LIMITED_VERSION_HEX >= 0x030C0000
10098 {
10099 PyObject *args[] = {func, self};
10100 result = PyObject_Vectorcall(__pyx_mstate_global->__Pyx_CachedMethodType, args, 2, NULL);
10101 }
10102 #else
10103 result = PyObject_CallFunctionObjArgs(__pyx_mstate_global->__Pyx_CachedMethodType, func, self, NULL);
10104 #endif
10105 return result;
10106}
10107#else
10108static PyObject *__Pyx_PyMethod_New(PyObject *func, PyObject *self, PyObject *typ) {
10109 CYTHON_UNUSED_VAR(typ);
10110 if (!self)
10111 return __Pyx_NewRef(func);
10112 return PyMethod_New(func, self);
10113}
10114#endif
10115
10116/* PyVectorcallFastCallDict (used by CythonFunctionShared) */
10117#if CYTHON_VECTORCALL
10118static PyObject *__Pyx_PyVectorcall_FastCallDict_kw(PyObject *func, __pyx_vectorcallfunc vc, PyObject *const *args, size_t nargs, PyObject *kw)
10119{
10120 PyObject *res = NULL;
10121 PyObject *kwnames;
10122 PyObject **newargs;
10123 PyObject **kwvalues;
10124 Py_ssize_t i;
10125 #if CYTHON_AVOID_BORROWED_REFS
10126 PyObject *pos;
10127 #else
10128 Py_ssize_t pos;
10129 #endif
10130 size_t j;
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;
10136 #else
10137 Py_ssize_t nkw = PyDict_GET_SIZE(kw);
10138 #endif
10139 newargs = (PyObject **)PyMem_Malloc((nargs + (size_t)nkw) * sizeof(args[0]));
10140 if (unlikely(newargs == NULL)) {
10141 PyErr_NoMemory();
10142 return NULL;
10143 }
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);
10148 return NULL;
10149 }
10150 kwvalues = newargs + nargs;
10151 pos = 0;
10152 i = 0;
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));
10158 #else
10159 Py_TYPE(key)->tp_flags;
10160 #endif
10161 #if !CYTHON_ASSUME_SAFE_MACROS
10162 if (unlikely(PyTuple_SetItem(kwnames, i, key) < 0)) goto cleanup;
10163 #else
10164 PyTuple_SET_ITEM(kwnames, i, key);
10165 #endif
10166 kwvalues[i] = value;
10167 i++;
10168 }
10169 if (unlikely(!keys_are_strings)) {
10170 PyErr_SetString(PyExc_TypeError, "keywords must be strings");
10171 goto cleanup;
10172 }
10173 res = vc(func, newargs, nargs, kwnames);
10174cleanup:
10175 #if CYTHON_AVOID_BORROWED_REFS
10176 Py_DECREF(pos);
10177 #endif
10178 Py_DECREF(kwnames);
10179 for (i = 0; i < nkw; i++)
10180 Py_DECREF(kwvalues[i]);
10181 PyMem_Free(newargs);
10182 return res;
10183}
10184static CYTHON_INLINE PyObject *__Pyx_PyVectorcall_FastCallDict(PyObject *func, __pyx_vectorcallfunc vc, PyObject *const *args, size_t nargs, PyObject *kw)
10185{
10186 Py_ssize_t kw_size =
10187 likely(kw == NULL) ?
10188 0 :
10189#if !CYTHON_ASSUME_SAFE_SIZE
10190 PyDict_Size(kw);
10191#else
10192 PyDict_GET_SIZE(kw);
10193#endif
10194 if (kw_size == 0) {
10195 return vc(func, args, nargs, NULL);
10196 }
10197#if !CYTHON_ASSUME_SAFE_SIZE
10198 else if (unlikely(kw_size == -1)) {
10199 return NULL;
10200 }
10201#endif
10202 return __Pyx_PyVectorcall_FastCallDict_kw(func, vc, args, nargs, kw);
10203}
10204#endif
10205
10206/* CythonFunctionShared (used by CythonFunction) */
10207static PyObject *
10208__Pyx_CyFunction_get_doc_locked(__pyx_CyFunctionObject *op)
10209{
10210 if (unlikely(op->func_doc == NULL)) {
10211#if CYTHON_COMPILING_IN_LIMITED_API
10212 const char *doc = op->func_methoddef->ml_doc;
10213#else
10214 const char *doc = ((PyCFunctionObject*)op)->m_ml->ml_doc;
10215#endif
10216 if (doc) {
10217 op->func_doc = PyUnicode_FromString(doc);
10218 if (unlikely(op->func_doc == NULL))
10219 return NULL;
10220 } else {
10221 Py_INCREF(Py_None);
10222 return Py_None;
10223 }
10224 }
10225 Py_INCREF(op->func_doc);
10226 return op->func_doc;
10227}
10228static PyObject *
10229__Pyx_CyFunction_get_doc(PyObject *op_in, void *closure) {
10230 PyObject *result;
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();
10236 return result;
10237}
10238static int
10239__Pyx_CyFunction_set_doc(PyObject *op_in, PyObject *value, void *context)
10240{
10241 __pyx_CyFunctionObject *op = __Pyx_as_CyFunctionObject(op_in);
10242 CYTHON_UNUSED_VAR(context);
10243 if (value == NULL) {
10244 value = Py_None;
10245 }
10246 Py_INCREF(value);
10247 __Pyx_BEGIN_CRITICAL_SECTION(op_in);
10248 __Pyx_Py_XDECREF_SET(op->func_doc, value);
10249 __Pyx_END_CRITICAL_SECTION();
10250 return 0;
10251}
10252static PyObject *
10253__Pyx_CyFunction_get_name_locked(__pyx_CyFunctionObject *op)
10254{
10255 if (unlikely(op->func_name == NULL)) {
10256#if CYTHON_COMPILING_IN_LIMITED_API
10257 const char *name = op->func_methoddef->ml_name;
10258#else
10259 const char *name = ((PyCFunctionObject*)op)->m_ml->ml_name;
10260#endif
10261 op->func_name = PyUnicode_InternFromString(name);
10262 if (unlikely(op->func_name == NULL))
10263 return NULL;
10264 }
10265 Py_INCREF(op->func_name);
10266 return op->func_name;
10267}
10268static PyObject *
10269__Pyx_CyFunction_get_name(PyObject *op, void *context)
10270{
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();
10276 return result;
10277}
10278static int
10279__Pyx_CyFunction_set_name(PyObject *op_in, PyObject *value, void *context)
10280{
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");
10285 return -1;
10286 }
10287 __pyx_CyFunctionObject *op = __Pyx_as_CyFunctionObject(op_in);
10288 Py_INCREF(value);
10289 __Pyx_BEGIN_CRITICAL_SECTION(op_in);
10290 __Pyx_Py_XDECREF_SET(op->func_name, value);
10291 __Pyx_END_CRITICAL_SECTION();
10292 return 0;
10293}
10294static PyObject *
10295__Pyx_CyFunction_get_qualname(PyObject *op_in, void *context)
10296{
10297 CYTHON_UNUSED_VAR(context);
10298 __pyx_CyFunctionObject *op = __Pyx_as_CyFunctionObject(op_in);
10299 PyObject *result;
10300 __Pyx_BEGIN_CRITICAL_SECTION(op_in);
10301 Py_INCREF(op->func_qualname);
10302 result = op->func_qualname;
10303 __Pyx_END_CRITICAL_SECTION();
10304 return result;
10305}
10306static int
10307__Pyx_CyFunction_set_qualname(PyObject *op_in, PyObject *value, void *context)
10308{
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");
10313 return -1;
10314 }
10315 __pyx_CyFunctionObject *op = __Pyx_as_CyFunctionObject(op_in);
10316 Py_INCREF(value);
10317 __Pyx_BEGIN_CRITICAL_SECTION(op_in);
10318 __Pyx_Py_XDECREF_SET(op->func_qualname, value);
10319 __Pyx_END_CRITICAL_SECTION();
10320 return 0;
10321}
10322#if CYTHON_COMPILING_IN_LIMITED_API && __PYX_LIMITED_VERSION_HEX < 0x030A0000
10323static PyObject *
10324__Pyx_CyFunction_get_dict(__pyx_CyFunctionObject *op, void *context)
10325{
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))
10330 return NULL;
10331 }
10332 Py_INCREF(op->func_dict);
10333 return op->func_dict;
10334}
10335#endif
10336static PyObject *
10337__Pyx_CyFunction_get_globals(PyObject *op_in, void *context)
10338{
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;
10343}
10344static PyObject *
10345__Pyx_CyFunction_get_closure(PyObject *op, void *context)
10346{
10347 CYTHON_UNUSED_VAR(op);
10348 CYTHON_UNUSED_VAR(context);
10349 Py_INCREF(Py_None);
10350 return Py_None;
10351}
10352static PyObject *
10353__Pyx_CyFunction_get_code(PyObject *op_in, void *context)
10354{
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);
10358 Py_INCREF(result);
10359 return result;
10360}
10361static int
10362__Pyx_CyFunction_init_defaults(__pyx_CyFunctionObject *op, PyObject *op_obj) {
10363 int result = 0;
10364 PyObject *res = op->defaults_getter(op_obj);
10365 if (unlikely(!res))
10366 return -1;
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);
10372 #else
10373 op->defaults_tuple = __Pyx_PySequence_ITEM(res, 0);
10374 if (unlikely(!op->defaults_tuple)) result = -1;
10375 else {
10376 op->defaults_kwdict = __Pyx_PySequence_ITEM(res, 1);
10377 if (unlikely(!op->defaults_kwdict)) result = -1;
10378 }
10379 #endif
10380 Py_DECREF(res);
10381 return result;
10382}
10383static int
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);
10387 if (!value) {
10388 value = Py_None;
10389 } else if (unlikely(value != Py_None && !PyTuple_Check(value))) {
10390 PyErr_SetString(PyExc_TypeError,
10391 "__defaults__ must be set to a tuple object");
10392 return -1;
10393 }
10394 PyErr_WarnEx(PyExc_RuntimeWarning, "changes to cyfunction.__defaults__ will not "
10395 "currently affect the values used in function calls", 1);
10396 Py_INCREF(value);
10397 __Pyx_BEGIN_CRITICAL_SECTION(op_in);
10398 __Pyx_Py_XDECREF_SET(op->defaults_tuple, value);
10399 __Pyx_END_CRITICAL_SECTION();
10400 return 0;
10401}
10402static PyObject *
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;
10410 } else {
10411 result = Py_None;
10412 }
10413 }
10414 Py_INCREF(result);
10415 return result;
10416}
10417static PyObject *
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();
10424 return result;
10425}
10426static int
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);
10430 if (!value) {
10431 value = Py_None;
10432 } else if (unlikely(value != Py_None && !PyDict_Check(value))) {
10433 PyErr_SetString(PyExc_TypeError,
10434 "__kwdefaults__ must be set to a dict object");
10435 return -1;
10436 }
10437 PyErr_WarnEx(PyExc_RuntimeWarning, "changes to cyfunction.__kwdefaults__ will not "
10438 "currently affect the values used in function calls", 1);
10439 Py_INCREF(value);
10440 __Pyx_BEGIN_CRITICAL_SECTION(op_in);
10441 __Pyx_Py_XDECREF_SET(op->defaults_kwdict, value);
10442 __Pyx_END_CRITICAL_SECTION();
10443 return 0;
10444}
10445static PyObject *
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;
10453 } else {
10454 result = Py_None;
10455 }
10456 }
10457 Py_INCREF(result);
10458 return result;
10459}
10460static PyObject *
10461__Pyx_CyFunction_get_kwdefaults(PyObject *op, void *context) {
10462 PyObject* result;
10463 CYTHON_UNUSED_VAR(context);
10464 __Pyx_BEGIN_CRITICAL_SECTION(op);
10465 result = __Pyx_CyFunction_get_kwdefaults_locked(op);
10466 __Pyx_END_CRITICAL_SECTION();
10467 return result;
10468}
10469static int __Pyx_CyFunction_set_annotate_in_dict_if_exists(PyObject *op_in, PyObject *value);
10470static int
10471__Pyx_CyFunction_set_annotations(PyObject *op_in, PyObject* value, void *context) {
10472 CYTHON_UNUSED_VAR(context);
10473 if (!value || value == Py_None) {
10474 value = NULL;
10475 } else if (unlikely(!PyDict_Check(value))) {
10476 PyErr_SetString(PyExc_TypeError,
10477 "__annotations__ must be set to a dict object");
10478 return -1;
10479 }
10480 __pyx_CyFunctionObject *op = __Pyx_as_CyFunctionObject(op_in);
10481 Py_XINCREF(value);
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;
10486 return 0;
10487}
10488static int
10489__Pyx_CyFunction_get_dict_if_exists(PyObject *op_in, PyObject **dict) {
10490 /* Return 1 if the function dict exists, 0 otherwise. This cannot fail:
10491 * _PyObject_GetDictPtr() may clear errors internally, but never reports them. */
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;
10496#else
10497 PyObject **dictptr = _PyObject_GetDictPtr(op_in);
10498 *dict = likely(dictptr) ? *dictptr : NULL;
10499#endif
10500 return *dict ? 1 : 0;
10501}
10502static int
10503__Pyx_CyFunction_get_annotate_from_dict_if_exists(PyObject *op_in, PyObject **annotate) {
10504 PyObject *dict;
10505 int dict_found;
10506 *annotate = NULL;
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);
10510}
10511static int
10512__Pyx_CyFunction_set_annotate_in_dict_if_exists(PyObject *op_in, PyObject *value) {
10513 PyObject *dict;
10514 int dict_found;
10515 dict_found = __Pyx_CyFunction_get_dict_if_exists(op_in, &dict);
10516 if (!dict_found) return 0;
10517 if (value) {
10518 return PyDict_SetItem(dict, __pyx_mstate_global->__pyx_n_u_annotate, value);
10519 } else {
10520#if !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX >= 0x030d0000
10521 return PyDict_Pop(dict, __pyx_mstate_global->__pyx_n_u_annotate, NULL);
10522#else
10523 int result = PyDict_Contains(dict, __pyx_mstate_global->__pyx_n_u_annotate);
10524 if (result == 1) {
10525 result = PyDict_DelItem(dict, __pyx_mstate_global->__pyx_n_u_annotate);
10526 }
10527 return result;
10528#endif
10529 }
10530}
10531static int
10532__Pyx_CyFunction_set_annotate_in_dict(PyObject *op_in, PyObject *value) {
10533 PyObject *dict;
10534 int result;
10535#if CYTHON_COMPILING_IN_LIMITED_API && __PYX_LIMITED_VERSION_HEX < 0x030A0000
10536 dict = __Pyx_CyFunction_get_dict(__Pyx_as_CyFunctionObject(op_in), NULL);
10537#else
10538 dict = PyObject_GenericGetDict(op_in, NULL);
10539#endif
10540 if (unlikely(!dict)) return -1;
10541 result = PyDict_SetItem(dict, __pyx_mstate_global->__pyx_n_u_annotate, value);
10542 Py_DECREF(dict);
10543 return result;
10544}
10545static PyObject *
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;
10552 }
10553 Py_INCREF(result);
10554 return result;
10555}
10556static PyObject *
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();
10572 return result;
10573 }
10574 PyObject *format = PyLong_FromLong(1L); // annotationlib.Format.VALUE
10575 if (likely(format)) {
10576 if (!Py_EnterRecursiveCall(" cyfunction __annotations__.__get__")) {
10577 result = __Pyx_PyObject_CallOneArg(annotate, format);
10578 Py_LeaveRecursiveCall();
10579 Py_DECREF(format);
10580 }
10581 }
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");
10586 Py_DECREF(result);
10587 return NULL;
10588 }
10589 __Pyx_BEGIN_CRITICAL_SECTION(op_in);
10590 __Pyx_Py_XDECREF_SET(op->func_annotations, __Pyx_NewRef(result));
10591 __Pyx_END_CRITICAL_SECTION();
10592 return result;
10593}
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");
10598 return NULL;
10599 }
10600 PyObject *result;
10601 if (Py_EnterRecursiveCall(" in cyfunction annotate")) {
10602 return NULL;
10603 }
10604 result = __Pyx_CyFunction_get_annotations(self, NULL);
10605 Py_LeaveRecursiveCall();
10606 return result;
10607}
10608static PyObject *
10609__Pyx_CyFunction_get_annotate(PyObject *op_in, void *context);
10610static int
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");
10615 return -1;
10616 }
10617 if (unlikely(value != Py_None && !PyCallable_Check(value))) {
10618 PyErr_SetString(PyExc_TypeError, "__annotate__ must be callable or None");
10619 return -1;
10620 }
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;
10627#else
10628 PyCFunction cfunction = PyCFunction_GET_FUNCTION(value);
10629 PyObject *value_self = PyCFunction_GET_SELF(value);
10630#endif
10631 if (cfunction == __Pyx_CyFunction_annotate_impl && value_self == op_in) {
10632 return __Pyx_CyFunction_set_annotate_in_dict_if_exists(op_in, NULL);
10633 }
10634 }
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();
10640 }
10641 return __Pyx_CyFunction_set_annotate_in_dict(op_in, value);
10642}
10643#if __PYX_LIMITED_VERSION_HEX < 0x030B0000
10644static PyObject *
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;
10651 Py_INCREF(marker);
10652#if CYTHON_ASSUME_SAFE_MACROS
10653 PyList_SET_ITEM(fromlist, 0, marker);
10654#else
10655 if (unlikely(PyList_SetItem(fromlist, 0, marker) < 0)) {
10656 Py_DECREF(fromlist);
10657 return NULL;
10658 }
10659#endif
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;
10664 }
10665 is_coroutine_value = __Pyx_PyObject_GetAttrStr(module, marker);
10666 Py_DECREF(module);
10667 if (likely(is_coroutine_value)) {
10668 return is_coroutine_value;
10669 }
10670ignore_or_error:
10671 if (!__Pyx_IgnoreException(PyExc_Exception)) {
10672 return NULL;
10673 }
10674 }
10675 return __Pyx_PyBool_FromLong(is_coroutine);
10676}
10677static PyObject *
10678__Pyx_CyFunction_get_is_coroutine(PyObject *op_in, void *context) {
10679 __pyx_CyFunctionObject *op = __Pyx_as_CyFunctionObject(op_in);
10680 PyObject *result;
10681 CYTHON_UNUSED_VAR(context);
10682 if (op->func_is_coroutine) {
10683 return __Pyx_NewRef(op->func_is_coroutine);
10684 }
10685 result = __Pyx_CyFunction_get_is_coroutine_value(op);
10686 if (unlikely(!result))
10687 return NULL;
10688 __Pyx_BEGIN_CRITICAL_SECTION(op_in);
10689 if (op->func_is_coroutine) {
10690 Py_DECREF(result);
10691 result = __Pyx_NewRef(op->func_is_coroutine);
10692 } else {
10693 op->func_is_coroutine = __Pyx_NewRef(result);
10694 }
10695 __Pyx_END_CRITICAL_SECTION();
10696 return result;
10697}
10698#endif
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);
10707#else
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);
10712#endif
10713}
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,
10719 "%.200S() %s",
10720 py_name, message);
10721 Py_DECREF(py_name);
10722#else
10723 const char* name = ((PyCFunctionObject*)func)->m_ml->ml_name;
10724 PyErr_Format(PyExc_TypeError,
10725 "%.200s() %s",
10726 name, message);
10727#endif
10728}
10729#if CYTHON_COMPILING_IN_LIMITED_API
10730static PyObject *
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;
10736}
10737static int
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) {
10742 value = Py_None;
10743 }
10744 Py_INCREF(value);
10745 PyObject *old = op->func_module;
10746 op->func_module = value;
10747 Py_DECREF(old);
10748 return 0;
10749}
10750#endif
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},
10760#else
10761 {"func_dict", (getter)PyObject_GenericGetDict, (setter)PyObject_GenericSetDict, 0, 0},
10762 {"__dict__", (getter)PyObject_GenericGetDict, (setter)PyObject_GenericSetDict, 0, 0},
10763#endif
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},
10777#endif
10778#if CYTHON_COMPILING_IN_LIMITED_API
10779 {"__module__", (getter)__Pyx_CyFunction_get_module, (setter)__Pyx_CyFunction_set_module, 0, 0},
10780#endif
10781 {0, 0, 0, 0, 0}
10782};
10783static PyMemberDef __pyx_CyFunction_members[] = {
10784#if !CYTHON_COMPILING_IN_LIMITED_API
10785 {"__module__", T_OBJECT, offsetof(PyCFunctionObject, m_module), 0, 0},
10786#endif
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},
10790#endif
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},
10795#else
10796 {"__vectorcalloffset__", T_PYSSIZET, offsetof(PyCFunctionObject, vectorcall), READONLY, 0},
10797#endif
10798#if CYTHON_COMPILING_IN_LIMITED_API
10799 {"__weaklistoffset__", T_PYSSIZET, offsetof(__pyx_CyFunctionObject, func_weakreflist),
10800 __PYX_SHARED_RELATIVE_OFFSET | READONLY, 0},
10801#else
10802 {"__weaklistoffset__", T_PYSSIZET, offsetof(PyCFunctionObject, m_weakreflist), READONLY, 0},
10803#endif
10804#endif
10805 {0, 0, 0, 0, 0}
10806};
10807static PyObject *
10808__Pyx_CyFunction_reduce(PyObject *m_in, PyObject *args)
10809{
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();
10817 return result;
10818}
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},
10824 {0, 0, 0, 0}
10825};
10826static PyObject *
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],
10834 op_in);
10835 return method;
10836}
10837#if CYTHON_COMPILING_IN_LIMITED_API
10838#define __Pyx_CyFunction_weakreflist(cyfunc) ((cyfunc)->func_weakreflist)
10839#else
10840#define __Pyx_CyFunction_weakreflist(cyfunc) (((PyCFunctionObject*)cyfunc)->m_weakreflist)
10841#endif
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;
10848#endif
10849 if (unlikely(op == NULL))
10850 return NULL;
10851#if CYTHON_COMPILING_IN_LIMITED_API
10852 op->func_methoddef = ml;
10853 Py_INCREF(module);
10854 op->func_module = module;
10855#endif
10856 op->flags = flags;
10857 __Pyx_CyFunction_weakreflist(op) = NULL;
10858#if !CYTHON_COMPILING_IN_LIMITED_API
10859 cf->m_ml = ml;
10860 cf->m_self = (PyObject *) op;
10861#endif
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;
10867#endif
10868#if PY_VERSION_HEX < 0x030C0000 || CYTHON_COMPILING_IN_LIMITED_API
10869 op->func_dict = NULL;
10870#endif
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;
10877#else
10878 ((PyCMethodObject*)op)->mm_class = NULL;
10879#endif
10880 op->func_globals = globals;
10881 Py_INCREF(op->func_globals);
10882 Py_XINCREF(code);
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;
10891#endif
10892#if CYTHON_VECTORCALL
10893 switch (ml->ml_flags & (METH_VARARGS | METH_FASTCALL | METH_NOARGS | METH_O | METH_KEYWORDS | METH_METHOD)) {
10894 case METH_NOARGS:
10895 __Pyx_CyFunction_func_vectorcall(op) = __Pyx_CyFunction_Vectorcall_NOARGS;
10896 break;
10897 case METH_O:
10898 __Pyx_CyFunction_func_vectorcall(op) = __Pyx_CyFunction_Vectorcall_O;
10899 break;
10900 case METH_METHOD | METH_FASTCALL | METH_KEYWORDS:
10901 __Pyx_CyFunction_func_vectorcall(op) = __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS_METHOD;
10902 break;
10903 case METH_FASTCALL | METH_KEYWORDS:
10904 __Pyx_CyFunction_func_vectorcall(op) = __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS;
10905 break;
10906 case METH_VARARGS | METH_KEYWORDS:
10907 __Pyx_CyFunction_func_vectorcall(op) = NULL;
10908 break;
10909 default:
10910 PyErr_SetString(PyExc_SystemError, "Bad call flags for CyFunction");
10911 Py_DECREF(op_in);
10912 return NULL;
10913 }
10914#endif
10915 return op_in;
10916}
10917static int __Pyx__CyFunction_clear(__pyx_CyFunctionObject *m)
10918{
10919 Py_CLEAR(m->func_closure);
10920#if CYTHON_COMPILING_IN_LIMITED_API
10921 Py_CLEAR(m->func_module);
10922#else
10923 Py_CLEAR(((PyCFunctionObject*)m)->m_module);
10924#endif
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);
10929#else
10930 PyObject_ClearManagedDict((PyObject*)m);
10931#endif
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);
10939#else
10940 {
10941 PyObject *cls = (PyObject*) ((PyCMethodObject *) (m))->mm_class;
10942 ((PyCMethodObject *) (m))->mm_class = NULL;
10943 Py_XDECREF(cls);
10944 }
10945#endif
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);
10951#endif
10952 Py_CLEAR(m->defaults);
10953 return 0;
10954}
10955static int
10956__Pyx_CyFunction_clear(PyObject *m)
10957{
10958 return __Pyx__CyFunction_clear(__Pyx_as_CyFunctionObject(m));
10959}
10960static void __Pyx__CyFunction_dealloc(PyObject *m)
10961{
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);
10967}
10968static void __Pyx_CyFunction_dealloc(PyObject *m)
10969{
10970 PyObject_GC_UnTrack(m);
10971 __Pyx__CyFunction_dealloc(m);
10972}
10973static int __Pyx_CyFunction_traverse(PyObject *m_in, visitproc visit, void *arg)
10974{
10975 __pyx_CyFunctionObject *m = __Pyx_as_CyFunctionObject(m_in);
10976 {
10977 int e = __Pyx_call_type_traverse(m_in, 1, visit, arg);
10978 if (e) return e;
10979 }
10980 Py_VISIT(m->func_closure);
10981#if CYTHON_COMPILING_IN_LIMITED_API
10982 Py_VISIT(m->func_module);
10983#else
10984 Py_VISIT(((PyCFunctionObject*)m)->m_module);
10985#endif
10986#if PY_VERSION_HEX < 0x030C0000 || CYTHON_COMPILING_IN_LIMITED_API
10987 Py_VISIT(m->func_dict);
10988#else
10989 {
10990 int e =
10991#if PY_VERSION_HEX < 0x030d0000
10992 _PyObject_VisitManagedDict
10993#else
10994 PyObject_VisitManagedDict
10995#endif
10996 ((PyObject*)m, visit, arg);
10997 if (e != 0) return e;
10998 }
10999#endif
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);
11011#endif
11012 Py_VISIT(m->defaults);
11013 return 0;
11014}
11015static PyObject*
11016__Pyx_CyFunction_repr(PyObject *op_in)
11017{
11018 __pyx_CyFunctionObject *op = __Pyx_as_CyFunctionObject(op_in);
11019 PyObject *repr;
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();
11024 return repr;
11025}
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;
11031#else
11032 PyCFunctionObject* f = (PyCFunctionObject*)func;
11033 PyCFunction meth = f->m_ml->ml_meth;
11034 int flags = f->m_ml->ml_flags;
11035#endif
11036 Py_ssize_t size;
11037 switch (flags & (METH_VARARGS | METH_KEYWORDS | METH_NOARGS | METH_O)) {
11038 case METH_VARARGS:
11039 if (likely(kw == NULL || PyDict_Size(kw) == 0))
11040 return (*meth)(self, arg);
11041 break;
11042 case METH_VARARGS | METH_KEYWORDS:
11043 return (*(PyCFunctionWithKeywords)(void(*)(void))meth)(self, arg, kw);
11044 case METH_NOARGS:
11045 if (likely(kw == NULL || PyDict_Size(kw) == 0)) {
11046#if CYTHON_ASSUME_SAFE_SIZE
11047 size = PyTuple_GET_SIZE(arg);
11048#else
11049 size = PyTuple_Size(arg);
11050 if (unlikely(size < 0)) return NULL;
11051#endif
11052 if (likely(size == 0))
11053 return (*meth)(self, NULL);
11054 __Pyx_CyFunction_raise_argument_count_error(
11055 func,
11056 "takes no arguments", size);
11057 return NULL;
11058 }
11059 break;
11060 case METH_O:
11061 if (likely(kw == NULL || PyDict_Size(kw) == 0)) {
11062#if CYTHON_ASSUME_SAFE_SIZE
11063 size = PyTuple_GET_SIZE(arg);
11064#else
11065 size = PyTuple_Size(arg);
11066 if (unlikely(size < 0)) return NULL;
11067#endif
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);
11072 #else
11073 arg0 = __Pyx_PySequence_ITEM(arg, 0); if (unlikely(!arg0)) return NULL;
11074 #endif
11075 result = (*meth)(self, arg0);
11076 #if !(CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS)
11077 Py_DECREF(arg0);
11078 #endif
11079 return result;
11080 }
11081 __Pyx_CyFunction_raise_argument_count_error(
11082 func,
11083 "takes exactly one argument", size);
11084 return NULL;
11085 }
11086 break;
11087 default:
11088 PyErr_SetString(PyExc_SystemError, "Bad call flags for CyFunction");
11089 return NULL;
11090 }
11091 __Pyx_CyFunction_raise_type_error(
11092 func, "takes no keyword arguments");
11093 return NULL;
11094}
11095static CYTHON_INLINE PyObject *__Pyx_CyFunction_Call(PyObject *func, PyObject *arg, PyObject *kw) {
11096 PyObject *result;
11097 result = __Pyx_CyFunction_CallMethod(func, func, arg, kw);
11098 return result;
11099}
11100static PyObject *__Pyx_CyFunction_CallAsMethod(PyObject *func, PyObject *args, PyObject *kw) {
11101 PyObject *result;
11102 __pyx_CyFunctionObject *cyfunc = __Pyx_as_CyFunctionObject(func);
11103#if CYTHON_VECTORCALL
11104 __pyx_vectorcallfunc vc = __Pyx_CyFunction_func_vectorcall(cyfunc);
11105 if (vc) {
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);
11108#else
11109 (void) &__Pyx_PyVectorcall_FastCallDict;
11110 return PyVectorcall_Call(func, args, kw);
11111#endif
11112 }
11113#endif
11114 if ((cyfunc->flags & __Pyx_CYFUNCTION_CCLASS) && !(cyfunc->flags & __Pyx_CYFUNCTION_STATICMETHOD)) {
11115 Py_ssize_t argc;
11116 PyObject *new_args;
11117 PyObject *self;
11118#if CYTHON_ASSUME_SAFE_SIZE
11119 argc = PyTuple_GET_SIZE(args);
11120#else
11121 argc = PyTuple_Size(args);
11122 if (unlikely(argc < 0)) return NULL;
11123#endif
11124 new_args = PyTuple_GetSlice(args, 1, argc);
11125 if (unlikely(!new_args))
11126 return NULL;
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);
11133 return NULL;
11134 }
11135 result = __Pyx_CyFunction_CallMethod(func, self, new_args, kw);
11136 Py_DECREF(new_args);
11137 } else {
11138 result = __Pyx_CyFunction_Call(func, args, kw);
11139 }
11140 return result;
11141}
11142#if CYTHON_VECTORCALL
11143static CYTHON_INLINE int __Pyx_CyFunction_Vectorcall_CheckArgs(PyObject *func, __pyx_CyFunctionObject *cyfunc, Py_ssize_t nargs, PyObject *kwnames)
11144{
11145 int ret = 0;
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");
11150 return -1;
11151 }
11152 ret = 1;
11153 }
11154 if (unlikely(kwnames) && unlikely(__Pyx_PyTuple_GET_SIZE(kwnames))) {
11155 __Pyx_CyFunction_raise_type_error(
11156 func, "takes no keyword arguments");
11157 return -1;
11158 }
11159 return ret;
11160}
11161static PyObject * __Pyx_CyFunction_Vectorcall_NOARGS(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames)
11162{
11163 __pyx_CyFunctionObject *cyfunc = __Pyx_as_CyFunctionObject(func);
11164 Py_ssize_t nargs = PyVectorcall_NARGS(nargsf);
11165 PyObject *self;
11166#if CYTHON_COMPILING_IN_LIMITED_API
11167 PyCFunction meth = cyfunc->func_methoddef->ml_meth;
11168 if (unlikely(!meth)) return NULL;
11169#else
11170 PyCFunction meth = ((PyCFunctionObject*)cyfunc)->m_ml->ml_meth;
11171#endif
11172 switch (__Pyx_CyFunction_Vectorcall_CheckArgs(func, cyfunc, nargs, kwnames)) {
11173 case 1:
11174 self = args[0];
11175 args += 1;
11176 nargs -= 1;
11177 break;
11178 case 0:
11179 self = func;
11180 break;
11181 default:
11182 return NULL;
11183 }
11184 if (unlikely(nargs != 0)) {
11185 __Pyx_CyFunction_raise_argument_count_error(
11186 func, "takes no arguments", nargs);
11187 return NULL;
11188 }
11189 return meth(self, NULL);
11190}
11191static PyObject * __Pyx_CyFunction_Vectorcall_O(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames)
11192{
11193 __pyx_CyFunctionObject *cyfunc = __Pyx_as_CyFunctionObject(func);
11194 Py_ssize_t nargs = PyVectorcall_NARGS(nargsf);
11195 PyObject *self;
11196#if CYTHON_COMPILING_IN_LIMITED_API
11197 PyCFunction meth = cyfunc->func_methoddef->ml_meth;
11198 if (unlikely(!meth)) return NULL;
11199#else
11200 PyCFunction meth = ((PyCFunctionObject*)cyfunc)->m_ml->ml_meth;
11201#endif
11202 switch (__Pyx_CyFunction_Vectorcall_CheckArgs(func, cyfunc, nargs, kwnames)) {
11203 case 1:
11204 self = args[0];
11205 args += 1;
11206 nargs -= 1;
11207 break;
11208 case 0:
11209 self = func;
11210 break;
11211 default:
11212 return NULL;
11213 }
11214 if (unlikely(nargs != 1)) {
11215 __Pyx_CyFunction_raise_argument_count_error(
11216 func, "takes exactly one argument", nargs);
11217 return NULL;
11218 }
11219 return meth(self, args[0]);
11220}
11221static PyObject * __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames)
11222{
11223 __pyx_CyFunctionObject *cyfunc = __Pyx_as_CyFunctionObject(func);
11224 Py_ssize_t nargs = PyVectorcall_NARGS(nargsf);
11225 PyObject *self;
11226#if CYTHON_COMPILING_IN_LIMITED_API
11227 PyCFunction meth = cyfunc->func_methoddef->ml_meth;
11228 if (unlikely(!meth)) return NULL;
11229#else
11230 PyCFunction meth = ((PyCFunctionObject*)cyfunc)->m_ml->ml_meth;
11231#endif
11232 switch (__Pyx_CyFunction_Vectorcall_CheckArgs(func, cyfunc, nargs, NULL)) {
11233 case 1:
11234 self = args[0];
11235 args += 1;
11236 nargs -= 1;
11237 break;
11238 case 0:
11239 self = func;
11240 break;
11241 default:
11242 return NULL;
11243 }
11244 return ((__Pyx_PyCFunctionFastWithKeywords)(void(*)(void))meth)(self, args, nargs, kwnames);
11245}
11246static PyObject * __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS_METHOD(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames)
11247{
11248 __pyx_CyFunctionObject *cyfunc = __Pyx_as_CyFunctionObject(func);
11249 PyTypeObject *cls = (PyTypeObject *) __Pyx__CyFunction_GetClassObj(cyfunc);
11250 Py_ssize_t nargs = PyVectorcall_NARGS(nargsf);
11251 PyObject *self;
11252#if CYTHON_COMPILING_IN_LIMITED_API
11253 PyCFunction meth = cyfunc->func_methoddef->ml_meth;
11254 if (unlikely(!meth)) return NULL;
11255#else
11256 PyCFunction meth = ((PyCFunctionObject*)cyfunc)->m_ml->ml_meth;
11257#endif
11258 switch (__Pyx_CyFunction_Vectorcall_CheckArgs(func, cyfunc, nargs, NULL)) {
11259 case 1:
11260 self = args[0];
11261 args += 1;
11262 nargs -= 1;
11263 break;
11264 case 0:
11265 self = func;
11266 break;
11267 default:
11268 return NULL;
11269 }
11270 #if PY_VERSION_HEX < 0x030e00A6
11271 size_t nargs_value = (size_t) nargs;
11272 #else
11273 Py_ssize_t nargs_value = nargs;
11274 #endif
11275 return ((__Pyx_PyCMethod)(void(*)(void))meth)(self, cls, args, nargs_value, kwnames);
11276}
11277#endif
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},
11288 {0, 0},
11289};
11290static PyType_Spec __pyx_CyFunctionType_spec = {
11291 __PYX_TYPE_MODULE_PREFIX "cython_function_or_method",
11292 __PYX_SHARED_SIZEOF(__pyx_CyFunctionObject),
11293 0,
11294#ifdef Py_TPFLAGS_METHOD_DESCRIPTOR
11295 Py_TPFLAGS_METHOD_DESCRIPTOR |
11296#endif
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 |
11302#endif
11303#endif // CYTHON_VECTORCALL
11304#if PY_VERSION_HEX >= 0x030C0000 && !CYTHON_COMPILING_IN_LIMITED_API
11305 Py_TPFLAGS_MANAGED_DICT |
11306#endif
11307 Py_TPFLAGS_IMMUTABLETYPE | Py_TPFLAGS_DISALLOW_INSTANTIATION |
11308 Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC | Py_TPFLAGS_BASETYPE,
11309 __pyx_CyFunctionType_slots
11310};
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)) {
11316 return -1;
11317 }
11318 return 0;
11319}
11320
11321/* CythonFunction */
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
11328 );
11329 if (likely(op)) {
11330 PyObject_GC_Track(op);
11331 }
11332 return op;
11333}
11334static PyTypeObject *__Pyx_Get_CyFunction_Type(void) {
11335 PyTypeObject *tp = __pyx_mstate_global->__pyx_CyFunctionType;
11336 Py_INCREF((PyObject*)tp);
11337 return tp;
11338}
11339
11340/* PyDictVersioning (used by CLineInTraceback) */
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;
11345}
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;
11349 if (offset) {
11350#if CYTHON_COMPILING_IN_CPYTHON
11351 dictptr = (likely(offset > 0)) ? (PyObject **) ((char *)obj + offset) : _PyObject_GetDictPtr(obj);
11352#else
11353 dictptr = _PyObject_GetDictPtr(obj);
11354#endif
11355 }
11356 return (dictptr && *dictptr) ? __PYX_GET_DICT_VERSION(*dictptr) : 0;
11357}
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)))
11361 return 0;
11362 return obj_dict_version == __Pyx_get_object_dict_version(obj);
11363}
11364#endif
11365
11366/* CLineInTraceback (used by AddTraceback) */
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);
11372#else
11373PyObject* __Pyx_PyProbablyModule_GetDict(PyObject *o) {
11374 PyObject **dict_ptr = _PyObject_GetDictPtr(o);
11375 return dict_ptr ? __Pyx_XNewRef(*dict_ptr) : NULL;
11376}
11377#endif
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)) {
11384 return c_line;
11385 }
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))
11392 }
11393 if (use_cline == NULL || use_cline == Py_False || (use_cline != Py_True && PyObject_Not(use_cline) != 0)) {
11394 c_line = 0;
11395 }
11396 Py_XDECREF(use_cline);
11397 Py_XDECREF(cython_runtime_dict);
11398 __Pyx_ErrRestoreInState(tstate, ptype, pvalue, ptraceback);
11399 return c_line;
11400}
11401#endif
11402
11403/* CodeObjectCache (used by AddTraceback) */
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) {
11407 return count;
11408 }
11409 while (start < end) {
11410 mid = start + (end - start) / 2;
11411 if (code_line < entries[mid].code_line) {
11412 end = mid;
11413 } else if (code_line > entries[mid].code_line) {
11414 start = mid + 1;
11415 } else {
11416 return mid;
11417 }
11418 }
11419 if (code_line <= entries[mid].code_line) {
11420 return mid;
11421 } else {
11422 return mid + 1;
11423 }
11424}
11425static __Pyx_CachedCodeObjectType *__pyx__find_code_object(struct __Pyx_CodeObjectCache *code_cache, int code_line) {
11426 __Pyx_CachedCodeObjectType* code_object;
11427 int pos;
11428 if (unlikely(!code_line) || unlikely(!code_cache->entries)) {
11429 return NULL;
11430 }
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)) {
11433 return NULL;
11434 }
11435 code_object = code_cache->entries[pos].code_object;
11436 Py_INCREF(code_object);
11437 return code_object;
11438}
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;
11442 return NULL; // Most implementation should have atomics. But otherwise, don't make it thread-safe, just miss.
11443#else
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);
11449 return NULL;
11450 }
11451#endif
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);
11455#endif
11456 return result;
11457#endif
11458}
11459static void __pyx__insert_code_object(struct __Pyx_CodeObjectCache *code_cache, int code_line, __Pyx_CachedCodeObjectType* code_object)
11460{
11461 int pos, i;
11462 __Pyx_CodeObjectCacheEntry* entries = code_cache->entries;
11463 if (unlikely(!code_line)) {
11464 return;
11465 }
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);
11475 }
11476 return;
11477 }
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);
11483 Py_DECREF(tmp);
11484 return;
11485 }
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)) {
11491 return;
11492 }
11493 code_cache->entries = entries;
11494 code_cache->max_count = new_max;
11495 }
11496 for (i=code_cache->count; i>pos; i--) {
11497 entries[i] = entries[i-1];
11498 }
11499 entries[pos].code_line = code_line;
11500 entries[pos].code_object = code_object;
11501 code_cache->count++;
11502 Py_INCREF(code_object);
11503}
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;
11507 return; // Most implementation should have atomics. But otherwise, don't make it thread-safe, just fail.
11508#else
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)) {
11513 return;
11514 }
11515#endif
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);
11519#endif
11520#endif
11521}
11522
11523/* AddTraceback */
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
11530 #endif
11531 #include "internal/pycore_frame.h"
11532#endif
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);
11543 return result;
11544 }
11545 return NULL;
11546}
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;
11552 int success = 0;
11553 if (c_line) {
11554 c_line = __Pyx_CLineForTraceback(__Pyx_PyThreadState_Current, c_line);
11555 }
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;
11563 if (c_line) {
11564 py_funcname = PyUnicode_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line);
11565 } else {
11566 py_funcname = PyUnicode_FromString(funcname);
11567 }
11568 if (unlikely(!py_funcname)) goto bad;
11569 dict = PyDict_New();
11570 if (unlikely(!dict)) goto bad;
11571 {
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);
11575 }
11576 if (unlikely(!code_object)) goto bad;
11577 __pyx_insert_code_object(c_line ? -c_line : py_line, code_object);
11578 } else {
11579 dict = PyDict_New();
11580 }
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;
11586 success = 1;
11587 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);
11592 Py_XDECREF(dict);
11593 Py_XDECREF(replace);
11594 if (success) {
11595 PyTraceBack_Here(
11596 (struct _frame*)frame);
11597 }
11598 Py_XDECREF(frame);
11599}
11600#else
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;
11606 if (c_line) {
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;
11611 }
11612 py_code = PyCode_NewEmpty(filename, funcname, py_line);
11613 Py_XDECREF(py_funcname);
11614 return py_code;
11615bad:
11616 Py_XDECREF(py_funcname);
11617 return NULL;
11618}
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;
11625 if (c_line) {
11626 c_line = __Pyx_CLineForTraceback(tstate, c_line);
11627 }
11628 py_code = __pyx_find_code_object(c_line ? -c_line : py_line);
11629 if (!py_code) {
11630 __Pyx_ErrFetchInState(tstate, &ptype, &pvalue, &ptraceback);
11631 py_code = __Pyx_CreateCodeObjectForTraceback(
11632 funcname, c_line, py_line, filename);
11633 if (!py_code) {
11634 /* If the code object creation fails, then we should clear the
11635 fetched exception references and propagate the new exception */
11636 Py_XDECREF(ptype);
11637 Py_XDECREF(pvalue);
11638 Py_XDECREF(ptraceback);
11639 goto bad;
11640 }
11641 __Pyx_ErrRestoreInState(tstate, ptype, pvalue, ptraceback);
11642 __pyx_insert_code_object(c_line ? -c_line : py_line, py_code);
11643 }
11644 py_frame = PyFrame_New(
11645 tstate, /*PyThreadState *tstate,*/
11646 py_code, /*PyCodeObject *code,*/
11647 __pyx_mstate_global->__pyx_d, /*PyObject *globals,*/
11648 0 /*PyObject *locals*/
11649 );
11650 if (!py_frame) goto bad;
11651 __Pyx_PyFrame_SetLineNumber(py_frame, py_line);
11652 PyTraceBack_Here(py_frame);
11653bad:
11654 Py_XDECREF(py_code);
11655 Py_XDECREF(py_frame);
11656}
11657#endif
11658
11659/* CIntFromPyVerify */
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)\
11665 {\
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;\
11674 else\
11675 goto raise_overflow;\
11676 }\
11677 }\
11678 return (target_type) value;\
11679 }
11680
11681/* Declarations */
11682#if CYTHON_CCOMPLEX && (1) && (!0 || __cplusplus)
11683 #ifdef __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);
11686 }
11687 #else
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;
11690 }
11691 #endif
11692#else
11693 static CYTHON_INLINE __pyx_t_float_complex __pyx_t_float_complex_from_parts(float x, float y) {
11694 __pyx_t_float_complex z;
11695 z.real = x;
11696 z.imag = y;
11697 return z;
11698 }
11699#endif
11700
11701/* Arithmetic */
11702#if CYTHON_CCOMPLEX && (1) && (!0 || __cplusplus)
11703#else
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);
11706 }
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;
11711 return z;
11712 }
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;
11717 return z;
11718 }
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;
11723 return z;
11724 }
11725 #if 1
11726 static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_quot_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
11727 if (b.imag == 0) {
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);
11732 } else {
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);
11737 }
11738 } else {
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);
11743 }
11744 }
11745 #else
11746 static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_quot_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
11747 if (b.imag == 0) {
11748 return __pyx_t_float_complex_from_parts(a.real / b.real, a.imag / b.real);
11749 } else {
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);
11754 }
11755 }
11756 #endif
11757 static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_neg_float(__pyx_t_float_complex a) {
11758 __pyx_t_float_complex z;
11759 z.real = -a.real;
11760 z.imag = -a.imag;
11761 return z;
11762 }
11763 static CYTHON_INLINE int __Pyx_c_is_zero_float(__pyx_t_float_complex a) {
11764 return (a.real == 0) && (a.imag == 0);
11765 }
11766 static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_conj_float(__pyx_t_float_complex a) {
11767 __pyx_t_float_complex z;
11768 z.real = a.real;
11769 z.imag = -a.imag;
11770 return z;
11771 }
11772 #if 1
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);
11776 #else
11777 return hypotf(z.real, z.imag);
11778 #endif
11779 }
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) {
11784 if (b.real < 0) {
11785 float denom = a.real * a.real + a.imag * a.imag;
11786 a.real = a.real / denom;
11787 a.imag = -a.imag / denom;
11788 b.real = -b.real;
11789 }
11790 switch ((int)b.real) {
11791 case 0:
11792 z.real = 1;
11793 z.imag = 0;
11794 return z;
11795 case 1:
11796 return a;
11797 case 2:
11798 return __Pyx_c_prod_float(a, a);
11799 case 3:
11800 z = __Pyx_c_prod_float(a, a);
11801 return __Pyx_c_prod_float(z, a);
11802 case 4:
11803 z = __Pyx_c_prod_float(a, a);
11804 return __Pyx_c_prod_float(z, z);
11805 }
11806 }
11807 if (a.imag == 0) {
11808 if (a.real == 0) {
11809 return a;
11810 } else if ((b.imag == 0) && (a.real >= 0)) {
11811 z.real = powf(a.real, b.real);
11812 z.imag = 0;
11813 return z;
11814 } else if (a.real > 0) {
11815 r = a.real;
11816 theta = 0;
11817 } else {
11818 r = -a.real;
11819 theta = atan2f(0.0, -1.0);
11820 }
11821 } else {
11822 r = __Pyx_c_abs_float(a);
11823 theta = atan2f(a.imag, a.real);
11824 }
11825 lnr = logf(r);
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);
11830 return z;
11831 }
11832 #endif
11833#endif
11834
11835/* Declarations */
11836#if CYTHON_CCOMPLEX && (1) && (!0 || __cplusplus)
11837 #ifdef __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);
11840 }
11841 #else
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;
11844 }
11845 #endif
11846#else
11847 static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(double x, double y) {
11848 __pyx_t_double_complex z;
11849 z.real = x;
11850 z.imag = y;
11851 return z;
11852 }
11853#endif
11854
11855/* Arithmetic */
11856#if CYTHON_CCOMPLEX && (1) && (!0 || __cplusplus)
11857#else
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);
11860 }
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;
11865 return z;
11866 }
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;
11871 return z;
11872 }
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;
11877 return z;
11878 }
11879 #if 1
11880 static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_quot_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
11881 if (b.imag == 0) {
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);
11886 } else {
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);
11891 }
11892 } else {
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);
11897 }
11898 }
11899 #else
11900 static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_quot_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
11901 if (b.imag == 0) {
11902 return __pyx_t_double_complex_from_parts(a.real / b.real, a.imag / b.real);
11903 } else {
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);
11908 }
11909 }
11910 #endif
11911 static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_neg_double(__pyx_t_double_complex a) {
11912 __pyx_t_double_complex z;
11913 z.real = -a.real;
11914 z.imag = -a.imag;
11915 return z;
11916 }
11917 static CYTHON_INLINE int __Pyx_c_is_zero_double(__pyx_t_double_complex a) {
11918 return (a.real == 0) && (a.imag == 0);
11919 }
11920 static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_conj_double(__pyx_t_double_complex a) {
11921 __pyx_t_double_complex z;
11922 z.real = a.real;
11923 z.imag = -a.imag;
11924 return z;
11925 }
11926 #if 1
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);
11930 #else
11931 return hypot(z.real, z.imag);
11932 #endif
11933 }
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) {
11938 if (b.real < 0) {
11939 double denom = a.real * a.real + a.imag * a.imag;
11940 a.real = a.real / denom;
11941 a.imag = -a.imag / denom;
11942 b.real = -b.real;
11943 }
11944 switch ((int)b.real) {
11945 case 0:
11946 z.real = 1;
11947 z.imag = 0;
11948 return z;
11949 case 1:
11950 return a;
11951 case 2:
11952 return __Pyx_c_prod_double(a, a);
11953 case 3:
11954 z = __Pyx_c_prod_double(a, a);
11955 return __Pyx_c_prod_double(z, a);
11956 case 4:
11957 z = __Pyx_c_prod_double(a, a);
11958 return __Pyx_c_prod_double(z, z);
11959 }
11960 }
11961 if (a.imag == 0) {
11962 if (a.real == 0) {
11963 return a;
11964 } else if ((b.imag == 0) && (a.real >= 0)) {
11965 z.real = pow(a.real, b.real);
11966 z.imag = 0;
11967 return z;
11968 } else if (a.real > 0) {
11969 r = a.real;
11970 theta = 0;
11971 } else {
11972 r = -a.real;
11973 theta = atan2(0.0, -1.0);
11974 }
11975 } else {
11976 r = __Pyx_c_abs_double(a);
11977 theta = atan2(a.imag, a.real);
11978 }
11979 lnr = log(r);
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);
11984 return z;
11985 }
11986 #endif
11987#endif
11988
11989/* Declarations */
11990#if CYTHON_CCOMPLEX && (1) && (!0 || __cplusplus)
11991 #ifdef __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);
11994 }
11995 #else
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;
11998 }
11999 #endif
12000#else
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;
12003 z.real = x;
12004 z.imag = y;
12005 return z;
12006 }
12007#endif
12008
12009/* Arithmetic */
12010#if CYTHON_CCOMPLEX && (1) && (!0 || __cplusplus)
12011#else
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);
12014 }
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;
12019 return z;
12020 }
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;
12025 return z;
12026 }
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;
12031 return z;
12032 }
12033 #if 1
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) {
12035 if (b.imag == 0) {
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);
12040 } else {
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);
12045 }
12046 } else {
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);
12051 }
12052 }
12053 #else
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) {
12055 if (b.imag == 0) {
12056 return __pyx_t_long_double_complex_from_parts(a.real / b.real, a.imag / b.real);
12057 } else {
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);
12062 }
12063 }
12064 #endif
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;
12067 z.real = -a.real;
12068 z.imag = -a.imag;
12069 return z;
12070 }
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);
12073 }
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;
12076 z.real = a.real;
12077 z.imag = -a.imag;
12078 return z;
12079 }
12080 #if 1
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);
12084 #else
12085 return hypotl(z.real, z.imag);
12086 #endif
12087 }
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) {
12092 if (b.real < 0) {
12093 long double denom = a.real * a.real + a.imag * a.imag;
12094 a.real = a.real / denom;
12095 a.imag = -a.imag / denom;
12096 b.real = -b.real;
12097 }
12098 switch ((int)b.real) {
12099 case 0:
12100 z.real = 1;
12101 z.imag = 0;
12102 return z;
12103 case 1:
12104 return a;
12105 case 2:
12106 return __Pyx_c_prod_long__double(a, a);
12107 case 3:
12108 z = __Pyx_c_prod_long__double(a, a);
12109 return __Pyx_c_prod_long__double(z, a);
12110 case 4:
12111 z = __Pyx_c_prod_long__double(a, a);
12112 return __Pyx_c_prod_long__double(z, z);
12113 }
12114 }
12115 if (a.imag == 0) {
12116 if (a.real == 0) {
12117 return a;
12118 } else if ((b.imag == 0) && (a.real >= 0)) {
12119 z.real = powl(a.real, b.real);
12120 z.imag = 0;
12121 return z;
12122 } else if (a.real > 0) {
12123 r = a.real;
12124 theta = 0;
12125 } else {
12126 r = -a.real;
12127 theta = atan2l(0.0, -1.0);
12128 }
12129 } else {
12130 r = __Pyx_c_abs_long__double(a);
12131 theta = atan2l(a.imag, a.real);
12132 }
12133 lnr = logl(r);
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);
12138 return z;
12139 }
12140 #endif
12141#endif
12142
12143/* CIntFromPy */
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);
12149 return (char) -1;
12150}
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);
12155 return (char) -1;
12156}
12157static CYTHON_INLINE char __Pyx_PyULong___Pyx_PyLong_As_char(PyObject *x) {
12158 const int is_unsigned = 1;
12159#if CYTHON_USE_PYLONG_INTERNALS
12160 {
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]));
12168 }
12169 } else
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]));
12175 }
12176 } else
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]));
12182 }
12183 } else
12184 {}
12185 }
12186#elif CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030C00A7
12187 if (unlikely(Py_SIZE(x) < 0)) {
12188 goto raise_neg_overflow;
12189 }
12190#else
12191 {
12192 int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
12193 if (unlikely(result < 0))
12194 return (char) -1;
12195 if (unlikely(result == 1))
12196 goto raise_neg_overflow;
12197 }
12198#endif
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))
12203 }
12204 return __Pyx_LargePyLong___Pyx_PyLong_As_char(x);
12205raise_neg_overflow:
12206 return __Pyx_raise_neg_overflow___Pyx_PyLong_As_char();
12207raise_overflow:
12208 return __Pyx_raise_overflow___Pyx_PyLong_As_char();
12209}
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])));
12222 }
12223 } else
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])));
12230 }
12231 } else
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])));
12238 }
12239 } else
12240 {}
12241 } else {
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]));
12249 }
12250 } else
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]));
12256 }
12257 } else
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]));
12263 }
12264 } else
12265 {}
12266 }
12267#endif
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))
12271 } else
12272 #endif
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))
12277 }
12278 return __Pyx_LargePyLong___Pyx_PyLong_As_char(x);
12279raise_neg_overflow:
12280 return __Pyx_raise_neg_overflow___Pyx_PyLong_As_char();
12281raise_overflow:
12282 return __Pyx_raise_overflow___Pyx_PyLong_As_char();
12283}
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"
12288#endif
12289 const char neg_one = (char) -1, const_zero = (char) 0;
12290#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
12291#pragma GCC diagnostic pop
12292#endif
12293 const int is_unsigned = neg_one > const_zero;
12294 char val;
12295 int ret = -1;
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;
12302 } else {
12303 ret = 0;
12304 }
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;
12312#else
12313 PyObject *v;
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);
12319 } else {
12320 v = PyNumber_Long(x);
12321 if (unlikely(!v)) return (char) -1;
12322 assert(PyLong_CheckExact(v));
12323 }
12324 {
12325 int result = PyObject_RichCompareBool(v, Py_False, Py_LT);
12326 if (unlikely(result < 0)) {
12327 Py_DECREF(v);
12328 return (char) -1;
12329 }
12330 is_negative = result == 1;
12331 }
12332 if (is_unsigned && unlikely(is_negative)) {
12333 Py_DECREF(v);
12334 PyErr_SetString(PyExc_OverflowError,
12335 "can't convert negative value to char");
12336 return (char) -1;
12337 } else if (is_negative) {
12338 stepval = PyNumber_Invert(v);
12339 Py_DECREF(v);
12340 if (unlikely(!stepval))
12341 return (char) -1;
12342 } else {
12343 stepval = v;
12344 }
12345 v = NULL;
12346 val = (char) 0;
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;
12351 long idigit;
12352 digit = PyNumber_And(stepval, mask);
12353 if (unlikely(!digit)) goto done;
12354 idigit = PyLong_AsLong(digit);
12355 Py_DECREF(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;
12361 }
12362 Py_DECREF(shift); shift = NULL;
12363 Py_DECREF(mask); mask = NULL;
12364 {
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;
12371 }
12372 if (!is_unsigned) {
12373 if (unlikely(val & (((char) 1) << (sizeof(char) * 8 - 1))))
12374 goto raise_overflow;
12375 if (is_negative)
12376 val = ~val;
12377 }
12378 ret = 0;
12379done:
12380 Py_XDECREF(shift);
12381 Py_XDECREF(mask);
12382 Py_XDECREF(stepval);
12383#endif
12384 if (unlikely(ret))
12385 return (char) -1;
12386 return val;
12387raise_overflow:
12388 return __Pyx_raise_overflow___Pyx_PyLong_As_char();
12389}
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"
12394#endif
12395 const char neg_one = (char) -1, const_zero = (char) 0;
12396#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
12397#pragma GCC diagnostic pop
12398#endif
12399 const int is_unsigned = neg_one > const_zero;
12400 if (is_unsigned) {
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))
12406 } else
12407 #endif
12408 {
12409 return __Pyx_PyULong___Pyx_PyLong_As_char(x);
12410 }
12411 } else {
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))
12415 } else
12416 #endif
12417 {
12418 return __Pyx_PySLong___Pyx_PyLong_As_char(x);
12419 }
12420 }
12421#if CYTHON_USE_PYLONG_INTERNALS
12422raise_neg_overflow:
12423 return __Pyx_raise_neg_overflow___Pyx_PyLong_As_char();
12424raise_overflow:
12425 return __Pyx_raise_overflow___Pyx_PyLong_As_char();
12426#endif
12427}
12428static char __Pyx_NonPyLong___Pyx_PyLong_As_char(PyObject *x) {
12429 char val;
12430 PyObject *tmp = __Pyx_PyNumber_Long(x);
12431 if (!tmp) return (char) -1;
12432 val = __Pyx_PyLong_As_char(tmp);
12433 Py_DECREF(tmp);
12434 return val;
12435}
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);
12439 } else {
12440 return __Pyx_NonPyLong___Pyx_PyLong_As_char(x);
12441 }
12442}
12443
12444/* FormatTypeName */
12445#if CYTHON_COMPILING_IN_LIMITED_API && __PYX_LIMITED_VERSION_HEX < 0x030d0000
12446static __Pyx_TypeName
12447__Pyx_PyType_GetFullyQualifiedName(PyTypeObject* tp)
12448{
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);
12453 #else
12454 name = PyType_GetQualName(tp);
12455 #endif
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) {
12461 result = name;
12462 name = NULL;
12463 goto done;
12464 }
12465 result = PyUnicode_FromFormat("%U.%U", module, name);
12466 if (unlikely(result == NULL)) goto bad;
12467 done:
12468 Py_XDECREF(name);
12469 Py_XDECREF(module);
12470 return result;
12471 bad:
12472 PyErr_Clear();
12473 if (name) {
12474 result = name;
12475 name = NULL;
12476 } else {
12477 result = __Pyx_NewRef(__pyx_mstate_global->__pyx_kp_u_);
12478 }
12479 goto done;
12480}
12481#endif
12482
12483/* PyObjectVectorcallKwds (used by PyObjectVectorcallMethodKwds) */
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;
12489#endif
12490 if (unlikely(!PyUnicode_Check(key))) {
12491 PyErr_SetString(PyExc_TypeError, "keywords must be strings");
12492 return -1;
12493 }
12494 return 0;
12495}
12496#else
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)) {
12502 Py_DECREF(out);
12503 return NULL;
12504 }
12505 }
12506 return out;
12507}
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");
12512 return -1;
12513 }
12514 return 0;
12515}
12516#endif
12517
12518/* PyObjectVectorcallMethodKwds (used by CIntToPy) */
12519#if !CYTHON_VECTORCALL
12520static PyObject *__Pyx_Object_VectorcallMethodKwds(PyObject *name, PyObject *const *args, size_t nargsf, PyObject *kwnames) {
12521 PyObject *result;
12522 PyObject *obj = PyObject_GetAttr(args[0], name);
12523 if (unlikely(!obj))
12524 return NULL;
12525 result = __Pyx_Object_VectorcallKwds(obj, args+1, nargsf-1, kwnames);
12526 Py_DECREF(obj);
12527 return result;
12528}
12529#endif
12530
12531/* CIntToPy */
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"
12536#endif
12537 const long neg_one = (long) -1, const_zero = (long) 0;
12538#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
12539#pragma GCC diagnostic pop
12540#endif
12541 const int is_unsigned = neg_one > const_zero;
12542 if (is_unsigned) {
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);
12550#endif
12551 }
12552 } else {
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);
12557 }
12558 }
12559 {
12560 unsigned char *bytes = (unsigned char *)&value;
12561#if !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX >= 0x030d00A4
12562 if (is_unsigned) {
12563 return PyLong_FromUnsignedNativeBytes(bytes, sizeof(value), -1);
12564 } else {
12565 return PyLong_FromNativeBytes(bytes, sizeof(value), -1);
12566 }
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);
12571#else
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;
12581 {
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);
12588#else
12589 {
12590 PyObject *keys[] = {signed_str};
12591 PyObject *values[] = {Py_True};
12592 kwds = __Pyx_MakeKwargDict(keys, values, 1);
12593 }
12594#endif
12595 Py_DECREF(signed_str);
12596 if (unlikely(!kwds)) goto limited_bad;
12597 }
12598 result = __Pyx_Object_VectorcallMethodKwds(from_bytes_str, args, 3 | __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET, kwds);
12599 }
12600 limited_bad:
12601 Py_XDECREF(kwds);
12602 Py_XDECREF(order_str);
12603 Py_XDECREF(py_bytes);
12604 Py_XDECREF(from_bytes_str);
12605 return result;
12606#endif
12607 }
12608}
12609
12610/* CIntFromPy */
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);
12616 return (long) -1;
12617}
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);
12622 return (long) -1;
12623}
12624static CYTHON_INLINE long __Pyx_PyULong___Pyx_PyLong_As_long(PyObject *x) {
12625 const int is_unsigned = 1;
12626#if CYTHON_USE_PYLONG_INTERNALS
12627 {
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]));
12635 }
12636 } else
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]));
12642 }
12643 } else
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]));
12649 }
12650 } else
12651 {}
12652 }
12653#elif CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030C00A7
12654 if (unlikely(Py_SIZE(x) < 0)) {
12655 goto raise_neg_overflow;
12656 }
12657#else
12658 {
12659 int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
12660 if (unlikely(result < 0))
12661 return (long) -1;
12662 if (unlikely(result == 1))
12663 goto raise_neg_overflow;
12664 }
12665#endif
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))
12670 }
12671 return __Pyx_LargePyLong___Pyx_PyLong_As_long(x);
12672raise_neg_overflow:
12673 return __Pyx_raise_neg_overflow___Pyx_PyLong_As_long();
12674raise_overflow:
12675 return __Pyx_raise_overflow___Pyx_PyLong_As_long();
12676}
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])));
12689 }
12690 } else
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])));
12697 }
12698 } else
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])));
12705 }
12706 } else
12707 {}
12708 } else {
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]));
12716 }
12717 } else
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]));
12723 }
12724 } else
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]));
12730 }
12731 } else
12732 {}
12733 }
12734#endif
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))
12738 } else
12739 #endif
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))
12744 }
12745 return __Pyx_LargePyLong___Pyx_PyLong_As_long(x);
12746raise_neg_overflow:
12747 return __Pyx_raise_neg_overflow___Pyx_PyLong_As_long();
12748raise_overflow:
12749 return __Pyx_raise_overflow___Pyx_PyLong_As_long();
12750}
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"
12755#endif
12756 const long neg_one = (long) -1, const_zero = (long) 0;
12757#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
12758#pragma GCC diagnostic pop
12759#endif
12760 const int is_unsigned = neg_one > const_zero;
12761 long val;
12762 int ret = -1;
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;
12769 } else {
12770 ret = 0;
12771 }
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;
12779#else
12780 PyObject *v;
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);
12786 } else {
12787 v = PyNumber_Long(x);
12788 if (unlikely(!v)) return (long) -1;
12789 assert(PyLong_CheckExact(v));
12790 }
12791 {
12792 int result = PyObject_RichCompareBool(v, Py_False, Py_LT);
12793 if (unlikely(result < 0)) {
12794 Py_DECREF(v);
12795 return (long) -1;
12796 }
12797 is_negative = result == 1;
12798 }
12799 if (is_unsigned && unlikely(is_negative)) {
12800 Py_DECREF(v);
12801 PyErr_SetString(PyExc_OverflowError,
12802 "can't convert negative value to long");
12803 return (long) -1;
12804 } else if (is_negative) {
12805 stepval = PyNumber_Invert(v);
12806 Py_DECREF(v);
12807 if (unlikely(!stepval))
12808 return (long) -1;
12809 } else {
12810 stepval = v;
12811 }
12812 v = NULL;
12813 val = (long) 0;
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;
12818 long idigit;
12819 digit = PyNumber_And(stepval, mask);
12820 if (unlikely(!digit)) goto done;
12821 idigit = PyLong_AsLong(digit);
12822 Py_DECREF(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;
12828 }
12829 Py_DECREF(shift); shift = NULL;
12830 Py_DECREF(mask); mask = NULL;
12831 {
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;
12838 }
12839 if (!is_unsigned) {
12840 if (unlikely(val & (((long) 1) << (sizeof(long) * 8 - 1))))
12841 goto raise_overflow;
12842 if (is_negative)
12843 val = ~val;
12844 }
12845 ret = 0;
12846done:
12847 Py_XDECREF(shift);
12848 Py_XDECREF(mask);
12849 Py_XDECREF(stepval);
12850#endif
12851 if (unlikely(ret))
12852 return (long) -1;
12853 return val;
12854raise_overflow:
12855 return __Pyx_raise_overflow___Pyx_PyLong_As_long();
12856}
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"
12861#endif
12862 const long neg_one = (long) -1, const_zero = (long) 0;
12863#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
12864#pragma GCC diagnostic pop
12865#endif
12866 const int is_unsigned = neg_one > const_zero;
12867 if (is_unsigned) {
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))
12873 } else
12874 #endif
12875 {
12876 return __Pyx_PyULong___Pyx_PyLong_As_long(x);
12877 }
12878 } else {
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))
12882 } else
12883 #endif
12884 {
12885 return __Pyx_PySLong___Pyx_PyLong_As_long(x);
12886 }
12887 }
12888#if CYTHON_USE_PYLONG_INTERNALS
12889raise_neg_overflow:
12890 return __Pyx_raise_neg_overflow___Pyx_PyLong_As_long();
12891raise_overflow:
12892 return __Pyx_raise_overflow___Pyx_PyLong_As_long();
12893#endif
12894}
12895static long __Pyx_NonPyLong___Pyx_PyLong_As_long(PyObject *x) {
12896 long val;
12897 PyObject *tmp = __Pyx_PyNumber_Long(x);
12898 if (!tmp) return (long) -1;
12899 val = __Pyx_PyLong_As_long(tmp);
12900 Py_DECREF(tmp);
12901 return val;
12902}
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);
12906 } else {
12907 return __Pyx_NonPyLong___Pyx_PyLong_As_long(x);
12908 }
12909}
12910
12911/* CIntFromPy */
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);
12917 return (int) -1;
12918}
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);
12923 return (int) -1;
12924}
12925static CYTHON_INLINE int __Pyx_PyULong___Pyx_PyLong_As_int(PyObject *x) {
12926 const int is_unsigned = 1;
12927#if CYTHON_USE_PYLONG_INTERNALS
12928 {
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]));
12936 }
12937 } else
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]));
12943 }
12944 } else
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]));
12950 }
12951 } else
12952 {}
12953 }
12954#elif CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030C00A7
12955 if (unlikely(Py_SIZE(x) < 0)) {
12956 goto raise_neg_overflow;
12957 }
12958#else
12959 {
12960 int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
12961 if (unlikely(result < 0))
12962 return (int) -1;
12963 if (unlikely(result == 1))
12964 goto raise_neg_overflow;
12965 }
12966#endif
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))
12971 }
12972 return __Pyx_LargePyLong___Pyx_PyLong_As_int(x);
12973raise_neg_overflow:
12974 return __Pyx_raise_neg_overflow___Pyx_PyLong_As_int();
12975raise_overflow:
12976 return __Pyx_raise_overflow___Pyx_PyLong_As_int();
12977}
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])));
12990 }
12991 } else
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])));
12998 }
12999 } else
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])));
13006 }
13007 } else
13008 {}
13009 } else {
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]));
13017 }
13018 } else
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]));
13024 }
13025 } else
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]));
13031 }
13032 } else
13033 {}
13034 }
13035#endif
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))
13039 } else
13040 #endif
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))
13045 }
13046 return __Pyx_LargePyLong___Pyx_PyLong_As_int(x);
13047raise_neg_overflow:
13048 return __Pyx_raise_neg_overflow___Pyx_PyLong_As_int();
13049raise_overflow:
13050 return __Pyx_raise_overflow___Pyx_PyLong_As_int();
13051}
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"
13056#endif
13057 const int neg_one = (int) -1, const_zero = (int) 0;
13058#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
13059#pragma GCC diagnostic pop
13060#endif
13061 const int is_unsigned = neg_one > const_zero;
13062 int val;
13063 int ret = -1;
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;
13070 } else {
13071 ret = 0;
13072 }
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;
13080#else
13081 PyObject *v;
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);
13087 } else {
13088 v = PyNumber_Long(x);
13089 if (unlikely(!v)) return (int) -1;
13090 assert(PyLong_CheckExact(v));
13091 }
13092 {
13093 int result = PyObject_RichCompareBool(v, Py_False, Py_LT);
13094 if (unlikely(result < 0)) {
13095 Py_DECREF(v);
13096 return (int) -1;
13097 }
13098 is_negative = result == 1;
13099 }
13100 if (is_unsigned && unlikely(is_negative)) {
13101 Py_DECREF(v);
13102 PyErr_SetString(PyExc_OverflowError,
13103 "can't convert negative value to int");
13104 return (int) -1;
13105 } else if (is_negative) {
13106 stepval = PyNumber_Invert(v);
13107 Py_DECREF(v);
13108 if (unlikely(!stepval))
13109 return (int) -1;
13110 } else {
13111 stepval = v;
13112 }
13113 v = NULL;
13114 val = (int) 0;
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;
13119 long idigit;
13120 digit = PyNumber_And(stepval, mask);
13121 if (unlikely(!digit)) goto done;
13122 idigit = PyLong_AsLong(digit);
13123 Py_DECREF(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;
13129 }
13130 Py_DECREF(shift); shift = NULL;
13131 Py_DECREF(mask); mask = NULL;
13132 {
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;
13139 }
13140 if (!is_unsigned) {
13141 if (unlikely(val & (((int) 1) << (sizeof(int) * 8 - 1))))
13142 goto raise_overflow;
13143 if (is_negative)
13144 val = ~val;
13145 }
13146 ret = 0;
13147done:
13148 Py_XDECREF(shift);
13149 Py_XDECREF(mask);
13150 Py_XDECREF(stepval);
13151#endif
13152 if (unlikely(ret))
13153 return (int) -1;
13154 return val;
13155raise_overflow:
13156 return __Pyx_raise_overflow___Pyx_PyLong_As_int();
13157}
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"
13162#endif
13163 const int neg_one = (int) -1, const_zero = (int) 0;
13164#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
13165#pragma GCC diagnostic pop
13166#endif
13167 const int is_unsigned = neg_one > const_zero;
13168 if (is_unsigned) {
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))
13174 } else
13175 #endif
13176 {
13177 return __Pyx_PyULong___Pyx_PyLong_As_int(x);
13178 }
13179 } else {
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))
13183 } else
13184 #endif
13185 {
13186 return __Pyx_PySLong___Pyx_PyLong_As_int(x);
13187 }
13188 }
13189#if CYTHON_USE_PYLONG_INTERNALS
13190raise_neg_overflow:
13191 return __Pyx_raise_neg_overflow___Pyx_PyLong_As_int();
13192raise_overflow:
13193 return __Pyx_raise_overflow___Pyx_PyLong_As_int();
13194#endif
13195}
13196static int __Pyx_NonPyLong___Pyx_PyLong_As_int(PyObject *x) {
13197 int val;
13198 PyObject *tmp = __Pyx_PyNumber_Long(x);
13199 if (!tmp) return (int) -1;
13200 val = __Pyx_PyLong_As_int(tmp);
13201 Py_DECREF(tmp);
13202 return val;
13203}
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);
13207 } else {
13208 return __Pyx_NonPyLong___Pyx_PyLong_As_int(x);
13209 }
13210}
13211
13212/* GetRuntimeVersion */
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;
13220 int i = 0;
13221 while (factor) {
13222 while ('0' <= rt_version[i] && rt_version[i] <= '9') {
13223 digit = digit * 10 + (unsigned int) (rt_version[i] - '0');
13224 ++i;
13225 }
13226 version += factor * digit;
13227 if (rt_version[i] != '.')
13228 break;
13229 digit = 0;
13230 factor >>= 8;
13231 ++i;
13232 }
13233 __Pyx_cached_runtime_version = version;
13234 }
13235}
13236#endif
13237static unsigned long __Pyx_get_runtime_version(void) {
13238#if __PYX_LIMITED_VERSION_HEX >= 0x030b0000
13239 return Py_Version & ~0xFFUL;
13240#else
13241 return __Pyx_cached_runtime_version;
13242#endif
13243}
13244
13245/* CheckBinaryVersion */
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))
13249 return 0;
13250 if (likely(allow_newer && (rt_version & MAJOR_MINOR) > (ct_version & MAJOR_MINOR)))
13251 return 1;
13252 {
13253 char message[200];
13254 PyOS_snprintf(message, sizeof(message),
13255 "compile time Python version %d.%d "
13256 "of module '%.100s' "
13257 "%s "
13258 "runtime version %d.%d",
13259 (int) (ct_version >> 24), (int) ((ct_version >> 16) & 0xFF),
13260 __Pyx_MODULE_NAME,
13261 (allow_newer) ? "was newer than" : "does not match",
13262 (int) (rt_version >> 24), (int) ((rt_version >> 16) & 0xFF)
13263 );
13264 return PyErr_WarnEx(NULL, message, 1);
13265 }
13266}
13267
13268/* NewCodeObj */
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;
13279 #endif
13280 long minor_version = 0;
13281 #if __PYX_LIMITED_VERSION_HEX >= 0x030b0000
13282 minor_version = 11;
13283 #else
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;
13289 #endif
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);
13295 } else {
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);
13299 }
13300 end:
13301 Py_XDECREF(code_type);
13302 Py_XDECREF(exception_table);
13303 Py_XDECREF(types_module);
13304 if (!result) {
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) {
13311 result = Py_None;
13312 Py_INCREF(result);
13313 }
13314 Py_DECREF(exc_type);
13315 Py_XDECREF(exc_value);
13316 Py_XDECREF(exc_tb);
13317 }
13318 return result;
13319 }
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;
13326 result =
13327 #if PY_VERSION_HEX >= 0x030C0000
13328 PyUnstable_Code_NewWithPosOnlyArgs
13329 #else
13330 PyCode_NewWithPosOnlyArgs
13331 #endif
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;
13336 #endif
13337 return result;
13338 }
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)
13342#else
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)
13345#endif
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
13353) {
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;
13361 }
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;
13367 }
13368 #else
13369 varnames_tuple_dedup = PyDict_SetDefault(tuple_dedup_map, varnames_tuple, varnames_tuple);
13370 if (unlikely(!varnames_tuple_dedup)) goto done;
13371 #endif
13372 #if CYTHON_AVOID_BORROWED_REFS
13373 Py_INCREF(varnames_tuple_dedup);
13374 #endif
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;
13379 #endif
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);
13386 }
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,
13392 0,
13393 (int) descr.flags,
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,
13400 filename,
13401 funcname,
13402 (int) descr.first_line,
13403 (__PYX_LIMITED_VERSION_HEX >= (0x030b0000) && line_table) ? line_table : __pyx_mstate_global->__pyx_empty_bytes
13404 );
13405done:
13406 Py_XDECREF(code_bytes);
13407 #if CYTHON_AVOID_BORROWED_REFS
13408 Py_XDECREF(varnames_tuple_dedup);
13409 #endif
13410 Py_DECREF(varnames_tuple);
13411 return code_obj;
13412}
13413
13414/* DecompressString */
13415CYTHON_UNUSED
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);
13421 return NULL;
13422#else
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
13428 if (algo == 3) {
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);
13433 } else
13434 #endif
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;
13439 {
13440 #ifdef __cplusplus
13441 char *memview_bytes = const_cast<char*>(s);
13442 #else
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"
13449 #endif
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
13455 #endif
13456 #endif
13457 #if CYTHON_COMPILING_IN_LIMITED_API && !defined(PyBUF_READ)
13458 int memview_flags = 0x100;
13459 #else
13460 int memview_flags = PyBUF_READ;
13461 #endif
13462 compressed_bytes = PyMemoryView_FromMemory(memview_bytes, length, memview_flags);
13463 }
13464 if (unlikely(!compressed_bytes)) {
13465 Py_DECREF(decompress);
13466 goto bad;
13467 }
13468 decompressed = PyObject_CallFunctionObjArgs(decompress, compressed_bytes, NULL);
13469 Py_DECREF(compressed_bytes);
13470 Py_DECREF(decompress);
13471 Py_DECREF(module);
13472 Py_DECREF(methodname);
13473 return decompressed;
13474import_failed:
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);
13479bad:
13480 Py_XDECREF(module);
13481 Py_DECREF(methodname);
13482 return NULL;
13483#endif
13484}
13485
13486/* DecompressString_LZSS */
13487#ifndef __Pyx_DecompressString_LZSS_UNUSED
13488CYTHON_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;
13491 while (1) {
13492 uint32_t flags = src[pos++] | 0xFF00;
13493 while (flags & 0x100) {
13494 if (flags & 1) {
13495 dst[out_pos++] = src[pos++];
13496 } else {
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;
13501 match_length = hi;
13502 } else if (!(hi & 0x80)) {
13503 end_offset_of_last_occurrence = 0x80 + (((hi << 2) & 0x180) | (lo & 0x7F));
13504 match_length = hi & 0x1F;
13505 } else {
13506 end_offset_of_last_occurrence = 0x80 + ((hi & 0x7F) << 7 | (lo & 0x7F));
13507 match_length = src[pos++];
13508 }
13509 match_length += 3;
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;
13513 }
13514 if (out_pos >= dst_len) return pos;
13515 flags >>= 1;
13516 }
13517 }
13518}
13519#endif
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);
13525 return NULL;
13526#else
13527 PyObject *result;
13528 unsigned char *result_data;
13529 size_t src_length;
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;
13536 return result;
13537decompression_failed:
13538 PyErr_SetString(PyExc_RuntimeError, "LZSS string data decompression failed");
13539bad:
13540 Py_DECREF(result);
13541 return NULL;
13542#endif
13543}
13544
13545#include <string.h>
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");
13550 return -1;
13551 }
13552 return (Py_ssize_t) len;
13553}
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);
13558}
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);
13563}
13564static CYTHON_INLINE const char* __Pyx_PyObject_AsString(PyObject* o) {
13565 Py_ssize_t ignore;
13566 return __Pyx_PyObject_AsStringAndSize(o, &ignore);
13567}
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
13572 {
13573 const char* result;
13574 Py_ssize_t unicode_length;
13575 CYTHON_MAYBE_UNUSED_VAR(unicode_length); // only for __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
13576 #if __PYX_LIMITED_VERSION_HEX < 0x030A0000
13577 if (unlikely(PyArg_Parse(o, "s#", &result, length) < 0)) return NULL;
13578 #else
13579 result = PyUnicode_AsUTF8AndSize(o, length);
13580 #endif
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);
13586 return NULL;
13587 }
13588 #endif
13589 return result;
13590 }
13591#else
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);
13596 } else {
13597 PyUnicode_AsASCIIString(o);
13598 return NULL;
13599 }
13600#else
13601 return PyUnicode_AsUTF8AndSize(o, length);
13602#endif
13603#endif
13604}
13605#endif
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);
13610 } else
13611#endif
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);
13616#else
13617 *length = PyByteArray_Size(o);
13618 if (*length == -1) return NULL;
13619 return PyByteArray_AsString(o);
13620#endif
13621 } else
13622 {
13623 char* result;
13624 int r = PyBytes_AsStringAndSize(o, &result, length);
13625 if (unlikely(r < 0)) {
13626 return NULL;
13627 } else {
13628 return result;
13629 }
13630 }
13631}
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);
13636}
13637static CYTHON_INLINE int __Pyx_PyObject_IsTrueAndDecref(PyObject* x) {
13638 int retval;
13639 if (unlikely(!x)) return -1;
13640 retval = __Pyx_PyObject_IsTrue(x);
13641 Py_DECREF(x);
13642 return retval;
13643}
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;
13648 #endif
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);
13656 goto bad;
13657 }
13658 __Pyx_DECREF_TypeName(result_type_name);
13659 return result;
13660 }
13661 PyErr_Format(PyExc_TypeError,
13662 "__int__ returned non-int (type " __Pyx_FMT_TYPENAME ")",
13663 result_type_name);
13664 __Pyx_DECREF_TypeName(result_type_name);
13665bad:
13666 Py_DECREF(result);
13667 return NULL;
13668}
13669static CYTHON_INLINE PyObject* __Pyx_PyNumber_Long(PyObject* x) {
13670#if CYTHON_USE_TYPE_SLOTS
13671 PyNumberMethods *m;
13672#endif
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);
13680 }
13681#else
13682 if (!PyBytes_CheckExact(x) && !PyUnicode_CheckExact(x)) {
13683 res = PyNumber_Long(x);
13684 }
13685#endif
13686 if (likely(res)) {
13687 if (unlikely(!PyLong_CheckExact(res))) {
13688 return __Pyx_PyNumber_LongWrongResultType(res);
13689 }
13690 }
13691 else if (!PyErr_Occurred()) {
13692 PyErr_SetString(PyExc_TypeError,
13693 "an integer is required");
13694 }
13695 return res;
13696}
13697static CYTHON_INLINE Py_ssize_t __Pyx_PyLong_AsSsize_t(PyObject* b) {
13698 #if CYTHON_USE_PYLONG_INTERNALS
13699 Py_ssize_t ival;
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
13705 if (size == 1) {
13706 ival = (Py_ssize_t) (((size_t)digits[0]));
13707 } else
13708 #endif
13709 #if SIZEOF_SIZE_T * 8 > 2 * PyLong_SHIFT
13710 if (size == 2) {
13711 ival = (Py_ssize_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
13712 } else
13713 #endif
13714 #if SIZEOF_SIZE_T * 8 > 3 * PyLong_SHIFT
13715 if (size == 3) {
13716 ival = (Py_ssize_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
13717 } else
13718 #endif
13719 #if SIZEOF_SIZE_T * 8 > 4 * PyLong_SHIFT
13720 if (size == 4) {
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]));
13722 } else
13723 #endif
13724 return PyLong_AsSsize_t(b);
13725 return is_neg ? -ival : ival;
13726 #else
13727 return PyLong_AsSsize_t(b);
13728 #endif
13729}
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);
13733 } else {
13734 Py_ssize_t ival;
13735 PyObject *x = PyNumber_Index(b);
13736 if (unlikely(!x)) return -1;
13737 ival = __Pyx_PyLong_AsSsize_t(x);
13738 Py_DECREF(x);
13739 return ival;
13740 }
13741}
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);
13745 } else {
13746 Py_ssize_t ival;
13747 PyObject *x;
13748 x = PyNumber_Index(o);
13749 if (!x) return -1;
13750 ival = PyLong_AsLong(x);
13751 Py_DECREF(x);
13752 return ival;
13753 }
13754}
13755static CYTHON_INLINE PyObject *__Pyx_Owned_Py_None(int b) {
13756 CYTHON_UNUSED_VAR(b);
13757 return __Pyx_NewRef(Py_None);
13758}
13759static CYTHON_INLINE PyObject * __Pyx_PyBool_FromLong(long b) {
13760 return __Pyx_NewRef(b ? Py_True: Py_False);
13761}
13762static CYTHON_INLINE PyObject * __Pyx_PyLong_FromSize_t(size_t ival) {
13763 return PyLong_FromSize_t(ival);
13764}
13765
13766
13767/* MultiPhaseInitModuleState */
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
13772#else
13773 #define CYTHON_MODULE_STATE_LOOKUP_THREAD_SAFE 0
13774#endif
13775#endif
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"
13779#endif
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
13788#include <mutex>
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);
13798}
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> // synchapi.h on its own doesn't work
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)
13813#else
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."
13817#endif
13818typedef struct {
13819 int64_t id;
13820 PyObject *module;
13821} __Pyx_InterpreterIdAndModule;
13822typedef struct {
13823 char interpreter_id_as_index;
13824 Py_ssize_t count;
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;
13831#endif
13832#if CYTHON_MODULE_STATE_LOOKUP_THREAD_SAFE
13833static __pyx_atomic_ptr_type __Pyx_ModuleStateLookup_data = 0;
13834#else
13835static __Pyx_ModuleStateLookupData* __Pyx_ModuleStateLookup_data = NULL;
13836#endif
13837static __Pyx_InterpreterIdAndModule* __Pyx_State_FindModuleStateLookupTableLowerBound(
13838 __Pyx_InterpreterIdAndModule* table,
13839 Py_ssize_t count,
13840 int64_t interpreterId) {
13841 __Pyx_InterpreterIdAndModule* begin = table;
13842 __Pyx_InterpreterIdAndModule* end = begin + count;
13843 if (begin->id == interpreterId) {
13844 return begin;
13845 }
13846 while ((end - begin) > __PYX_MODULE_STATE_LOOKUP_SMALL_SIZE) {
13847 __Pyx_InterpreterIdAndModule* halfway = begin + (end - begin)/2;
13848 if (halfway->id == interpreterId) {
13849 return halfway;
13850 }
13851 if (halfway->id < interpreterId) {
13852 begin = halfway;
13853 } else {
13854 end = halfway;
13855 }
13856 }
13857 for (; begin < end; ++begin) {
13858 if (begin->id >= interpreterId) return begin;
13859 }
13860 return begin;
13861}
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);
13867 {
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;
13873 }
13874 }
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();
13880 }
13881 read_finished:;
13882#else
13883 __Pyx_ModuleStateLookupData* data = __Pyx_ModuleStateLookup_data;
13884#endif
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;
13890 }
13891 } else {
13892 found = __Pyx_State_FindModuleStateLookupTableLowerBound(
13893 data->table, data->count, interpreter_id);
13894 }
13895 end:
13896 {
13897 PyObject *result=NULL;
13898 if (found && found->id == interpreter_id) {
13899 result = found->module;
13900 }
13901#if CYTHON_MODULE_STATE_LOOKUP_THREAD_SAFE
13902 __pyx_atomic_decr_acq_rel(&__Pyx_ModuleStateLookup_read_counter);
13903#endif
13904 return result;
13905 }
13906}
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);
13910}
13911#else
13912#define __Pyx_ModuleStateLookup_wait_until_no_readers()
13913#endif
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;
13919 }
13920 __Pyx_ModuleStateLookupData *new_data = *old_data;
13921 if (to_allocate != (*old_data)->allocated) {
13922 new_data = (__Pyx_ModuleStateLookupData *)realloc(
13923 *old_data,
13924 sizeof(__Pyx_ModuleStateLookupData)+(to_allocate-1)*sizeof(__Pyx_InterpreterIdAndModule));
13925 if (!new_data) {
13926 PyErr_NoMemory();
13927 return -1;
13928 }
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;
13932 }
13933 new_data->allocated = to_allocate;
13934 }
13935 new_data->table[interpreter_id].module = module;
13936 if (new_data->count < interpreter_id+1) {
13937 new_data->count = interpreter_id+1;
13938 }
13939 *old_data = new_data;
13940 return 0;
13941}
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;
13950 ++write;
13951 }
13952 }
13953 data->count = write - data->table;
13954 for (; write<end; ++write) {
13955 write->id = 0;
13956 write->module = NULL;
13957 }
13958 data->interpreter_id_as_index = 0;
13959}
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;
13963 int result = 0;
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);
13968#else
13969 __Pyx_ModuleStateLookupData *old_data = __Pyx_ModuleStateLookup_data;
13970#endif
13971 __Pyx_ModuleStateLookupData *new_data = old_data;
13972 if (!new_data) {
13973 new_data = (__Pyx_ModuleStateLookupData *)calloc(1, sizeof(__Pyx_ModuleStateLookupData));
13974 if (!new_data) {
13975 result = -1;
13976 PyErr_NoMemory();
13977 goto end;
13978 }
13979 new_data->allocated = 1;
13980 new_data->interpreter_id_as_index = 1;
13981 }
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);
13986 goto end;
13987 }
13988 __Pyx_State_ConvertFromInterpIdAsIndex(new_data);
13989 }
13990 {
13991 Py_ssize_t insert_at = 0;
13992 {
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;
13999 goto end; // already in table, nothing more to do
14000 }
14001 }
14002 if (new_data->count+1 >= new_data->allocated) {
14003 Py_ssize_t to_allocate = (new_data->count+1)*2;
14004 new_data =
14005 (__Pyx_ModuleStateLookupData*)realloc(
14006 new_data,
14007 sizeof(__Pyx_ModuleStateLookupData) +
14008 (to_allocate-1)*sizeof(__Pyx_InterpreterIdAndModule));
14009 if (!new_data) {
14010 result = -1;
14011 new_data = old_data;
14012 PyErr_NoMemory();
14013 goto end;
14014 }
14015 new_data->allocated = to_allocate;
14016 }
14017 ++new_data->count;
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;
14027 }
14028 }
14029 end:
14030#if CYTHON_MODULE_STATE_LOOKUP_THREAD_SAFE
14031 __pyx_atomic_pointer_exchange(&__Pyx_ModuleStateLookup_data, new_data);
14032#else
14033 __Pyx_ModuleStateLookup_data = new_data;
14034#endif
14035 __Pyx_ModuleStateLookup_Unlock();
14036 return result;
14037}
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);
14045#else
14046 __Pyx_ModuleStateLookupData *data = __Pyx_ModuleStateLookup_data;
14047#endif
14048 if (data->interpreter_id_as_index) {
14049 if (interpreter_id < data->count) {
14050 data->table[interpreter_id].module = NULL;
14051 }
14052 goto done;
14053 }
14054 {
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;
14064 }
14065 }
14066 --data->count;
14067 if (data->count == 0) {
14068 free(data);
14069 data = NULL;
14070 }
14071 done:
14072#if CYTHON_MODULE_STATE_LOOKUP_THREAD_SAFE
14073 __pyx_atomic_pointer_exchange(&__Pyx_ModuleStateLookup_data, data);
14074#else
14075 __Pyx_ModuleStateLookup_data = data;
14076#endif
14077 __Pyx_ModuleStateLookup_Unlock();
14078 return 0;
14079}
14080#endif
14081
14082/* #### Code section: utility_code_pragmas_end ### */
14083#ifdef _MSC_VER
14084#pragma warning( pop )
14085#endif
14086
14087
14088
14089/* #### Code section: end ### */
14090#endif /* Py_PYTHON_H */
Int n
Definition Headers.h:28
Double T
Definition Headers.h:87
Double r
Definition Headers.h:83
Double f
Definition Headers.h:64
Double s
Definition Headers.h:84
Double * z
Definition Headers.h:49
Double v
Definition Headers.h:95
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)
#define c(i)
Definition jf.h:21
C implementations of shock capturing diffusion calculations.