89#ifndef PY_SSIZE_T_CLEAN
90#define PY_SSIZE_T_CLEAN
93#if defined(Py_LIMITED_API)
94 #if !defined(CYTHON_LIMITED_API)
95 #define CYTHON_LIMITED_API 1
97#elif defined(CYTHON_LIMITED_API)
99 #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.")
101 #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.
107 #error Python headers needed to compile C extensions, please install development version of Python.
108#elif PY_VERSION_HEX < 0x03090000
109 #error Cython requires Python 3.9+.
110#elif defined(Py_LIMITED_API) && (Py_LIMITED_API & 0xFFFF0000) > (PY_VERSION_HEX & 0xFFFF0000)
111 #error 'Py_LIMITED_API' can only select past Python X.Y versions, not future ones.
113#define __PYX_ABI_VERSION "3_3_0"
114#define CYTHON_HEX_VERSION 0x030300F0
115#define CYTHON_FUTURE_DIVISION 1
119 #define offsetof(type, member) ( (size_t) & ((type*)0) -> member )
121#if !defined(_WIN32) && !defined(WIN32) && !defined(MS_WINDOWS)
133 #define __Pyx_has_cbuiltin(name) __has_builtin(name)
135 #define __Pyx_has_cbuiltin(name) (0)
138 #define DL_IMPORT(t) t
141 #define DL_EXPORT(t) t
145 #define PY_LONG_LONG LONG_LONG
148 #define Py_HUGE_VAL HUGE_VAL
150#define __PYX_LIMITED_VERSION_HEX PY_VERSION_HEX
151#if defined(CYTHON_LIMITED_API)
152 #ifdef Py_LIMITED_API
153 #undef __PYX_LIMITED_VERSION_HEX
154 #define __PYX_LIMITED_VERSION_HEX Py_LIMITED_API
155 #if Py_LIMITED_API < 0x03090000
156 #error "Cython 3.3 requires the Python Limited API version to be 3.9 or greater."
159 #if defined(GRAALVM_PYTHON) || defined(PYPY_VERSION)
161 #pragma message ("Py_LIMITED_API is defined on PyPy or GraalPy. This takes precedence over Cython's specialized\
162 code for PyPy and GraalPy and is unlikely to work.")
164 #warning "Py_LIMITED_API is defined on PyPy or GraalPy. This takes precedence over Cython's specialized\
165 code for PyPy and GraalPy and is unlikely to work."
168 #define CYTHON_COMPILING_IN_PYPY 0
169 #define CYTHON_COMPILING_IN_CPYTHON 0
170 #define CYTHON_COMPILING_IN_LIMITED_API 1
171 #define CYTHON_COMPILING_IN_GRAAL 0
172 #define CYTHON_COMPILING_IN_CPYTHON_FREETHREADING 0
173 #undef CYTHON_USE_TYPE_SLOTS
174 #define CYTHON_USE_TYPE_SLOTS 0
175 #undef CYTHON_USE_TYPE_SPECS
176 #define CYTHON_USE_TYPE_SPECS 1
177 #undef CYTHON_USE_PYTYPE_LOOKUP
178 #define CYTHON_USE_PYTYPE_LOOKUP 0
179 #undef CYTHON_USE_PYLIST_INTERNALS
180 #define CYTHON_USE_PYLIST_INTERNALS 0
181 #undef CYTHON_USE_UNICODE_INTERNALS
182 #define CYTHON_USE_UNICODE_INTERNALS 0
183 #ifndef CYTHON_USE_UNICODE_WRITER
184 #define CYTHON_USE_UNICODE_WRITER 0
186 #undef CYTHON_USE_PYLONG_INTERNALS
187 #define CYTHON_USE_PYLONG_INTERNALS 0
188 #ifndef CYTHON_AVOID_BORROWED_REFS
189 #define CYTHON_AVOID_BORROWED_REFS 0
191 #ifndef CYTHON_AVOID_THREAD_UNSAFE_BORROWED_REFS
192 #define CYTHON_AVOID_THREAD_UNSAFE_BORROWED_REFS 0
194 #undef CYTHON_ASSUME_SAFE_MACROS
195 #define CYTHON_ASSUME_SAFE_MACROS 0
196 #undef CYTHON_ASSUME_SAFE_SIZE
197 #define CYTHON_ASSUME_SAFE_SIZE 0
198 #undef CYTHON_UNPACK_METHODS
199 #define CYTHON_UNPACK_METHODS 0
200 #undef CYTHON_FAST_THREAD_STATE
201 #define CYTHON_FAST_THREAD_STATE 0
202 #undef CYTHON_FAST_GIL
203 #define CYTHON_FAST_GIL 0
204 #undef CYTHON_VECTORCALL
205 #define CYTHON_VECTORCALL (__PYX_LIMITED_VERSION_HEX >= 0x030C0000)
206 #ifndef CYTHON_VECTORCALL_TPNEW
207 #define CYTHON_VECTORCALL_TPNEW (CYTHON_VECTORCALL && __PYX_LIMITED_VERSION_HEX >= 0x030E0000)
209 #ifndef CYTHON_PEP487_INIT_SUBCLASS
210 #define CYTHON_PEP487_INIT_SUBCLASS 1
212 #ifndef CYTHON_PEP489_MULTI_PHASE_INIT
213 #define CYTHON_PEP489_MULTI_PHASE_INIT 1
215 #ifndef CYTHON_USE_MODULE_STATE
216 #define CYTHON_USE_MODULE_STATE 0
218 #undef CYTHON_USE_SYS_MONITORING
219 #define CYTHON_USE_SYS_MONITORING 0
220 #ifndef CYTHON_USE_TP_FINALIZE
221 #define CYTHON_USE_TP_FINALIZE (__PYX_LIMITED_VERSION_HEX >= 0x030F0000 && PY_VERSION_HEX > 0x030F00A8)
223 #ifndef CYTHON_USE_AM_SEND
224 #define CYTHON_USE_AM_SEND (__PYX_LIMITED_VERSION_HEX >= 0x030A0000)
226 #undef CYTHON_USE_DICT_VERSIONS
227 #define CYTHON_USE_DICT_VERSIONS 0
228 #undef CYTHON_USE_EXC_INFO_STACK
229 #define CYTHON_USE_EXC_INFO_STACK 0
230 #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC
231 #define CYTHON_UPDATE_DESCRIPTOR_DOC 0
233 #ifndef CYTHON_USE_OWN_PREP_RERAISE_STAR
234 #define CYTHON_USE_OWN_PREP_RERAISE_STAR 1
236 #ifndef CYTHON_USE_FREELISTS
237 #define CYTHON_USE_FREELISTS 1
239 #undef CYTHON_IMMORTAL_CONSTANTS
240 #define CYTHON_IMMORTAL_CONSTANTS 0
241 #if __PYX_LIMITED_VERSION_HEX < 0x030E0000
242 #undef CYTHON_OPAQUE_OBJECTS
243 #define CYTHON_OPAQUE_OBJECTS 0
244 #elif !defined(CYTHON_OPAQUE_OBJECTS)
245 #define CYTHON_OPAQUE_OBJECTS (__PYX_LIMITED_VERSION_HEX >= 0x030F0000)
247#elif defined(GRAALVM_PYTHON)
250 #define CYTHON_COMPILING_IN_PYPY 0
251 #define CYTHON_COMPILING_IN_CPYTHON 0
252 #define CYTHON_COMPILING_IN_LIMITED_API 0
253 #define CYTHON_COMPILING_IN_GRAAL 1
254 #define CYTHON_COMPILING_IN_CPYTHON_FREETHREADING 0
255 #ifndef CYTHON_USE_TYPE_SLOTS
256 #define CYTHON_USE_TYPE_SLOTS 0
258 #undef CYTHON_USE_TYPE_SPECS
259 #define CYTHON_USE_TYPE_SPECS 0
260 #undef CYTHON_USE_PYTYPE_LOOKUP
261 #define CYTHON_USE_PYTYPE_LOOKUP 0
262 #undef CYTHON_USE_PYLIST_INTERNALS
263 #define CYTHON_USE_PYLIST_INTERNALS 0
264 #undef CYTHON_USE_UNICODE_INTERNALS
265 #define CYTHON_USE_UNICODE_INTERNALS 0
266 #undef CYTHON_USE_UNICODE_WRITER
267 #define CYTHON_USE_UNICODE_WRITER 0
268 #undef CYTHON_USE_PYLONG_INTERNALS
269 #define CYTHON_USE_PYLONG_INTERNALS 0
270 #undef CYTHON_AVOID_BORROWED_REFS
271 #define CYTHON_AVOID_BORROWED_REFS 1
272 #undef CYTHON_AVOID_THREAD_UNSAFE_BORROWED_REFS
273 #define CYTHON_AVOID_THREAD_UNSAFE_BORROWED_REFS 0
274 #undef CYTHON_ASSUME_SAFE_MACROS
275 #define CYTHON_ASSUME_SAFE_MACROS 0
276 #undef CYTHON_ASSUME_SAFE_SIZE
277 #define CYTHON_ASSUME_SAFE_SIZE 0
278 #undef CYTHON_UNPACK_METHODS
279 #define CYTHON_UNPACK_METHODS 0
280 #undef CYTHON_FAST_THREAD_STATE
281 #define CYTHON_FAST_THREAD_STATE 0
282 #undef CYTHON_FAST_GIL
283 #define CYTHON_FAST_GIL 0
284 #ifndef CYTHON_VECTORCALL
285 #define CYTHON_VECTORCALL 1
287 #if CYTHON_USE_TYPE_SPECS && PY_VERSION_HEX < 0x030E0000
288 #undef CYTHON_VECTORCALL_TPNEW
289 #define CYTHON_VECTORCALL_TPNEW 0
290 #elif !defined(CYTHON_VECTORCALL_TPNEW)
291 #define CYTHON_VECTORCALL_TPNEW CYTHON_VECTORCALL
293 #ifndef CYTHON_PEP487_INIT_SUBCLASS
294 #define CYTHON_PEP487_INIT_SUBCLASS 1
296 #undef CYTHON_PEP489_MULTI_PHASE_INIT
297 #define CYTHON_PEP489_MULTI_PHASE_INIT 1
298 #undef CYTHON_USE_MODULE_STATE
299 #define CYTHON_USE_MODULE_STATE 0
300 #undef CYTHON_USE_SYS_MONITORING
301 #define CYTHON_USE_SYS_MONITORING 0
302 #undef CYTHON_USE_TP_FINALIZE
303 #define CYTHON_USE_TP_FINALIZE 0
304 #undef CYTHON_USE_AM_SEND
305 #define CYTHON_USE_AM_SEND 0
306 #undef CYTHON_USE_DICT_VERSIONS
307 #define CYTHON_USE_DICT_VERSIONS 0
308 #undef CYTHON_USE_EXC_INFO_STACK
309 #define CYTHON_USE_EXC_INFO_STACK 1
310 #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC
311 #define CYTHON_UPDATE_DESCRIPTOR_DOC 0
313 #ifndef CYTHON_USE_OWN_PREP_RERAISE_STAR
314 #define CYTHON_USE_OWN_PREP_RERAISE_STAR 1
316 #undef CYTHON_USE_FREELISTS
317 #define CYTHON_USE_FREELISTS 0
318 #undef CYTHON_IMMORTAL_CONSTANTS
319 #define CYTHON_IMMORTAL_CONSTANTS 0
320 #undef CYTHON_OPAQUE_OBJECTS
321 #define CYTHON_OPAQUE_OBJECTS 0
322#elif defined(PYPY_VERSION)
323 #define CYTHON_COMPILING_IN_PYPY 1
324 #define CYTHON_COMPILING_IN_CPYTHON 0
325 #define CYTHON_COMPILING_IN_LIMITED_API 0
326 #define CYTHON_COMPILING_IN_GRAAL 0
327 #define CYTHON_COMPILING_IN_CPYTHON_FREETHREADING 0
328 #undef CYTHON_USE_TYPE_SLOTS
329 #define CYTHON_USE_TYPE_SLOTS 1
330 #ifndef CYTHON_USE_TYPE_SPECS
331 #define CYTHON_USE_TYPE_SPECS 0
333 #undef CYTHON_USE_PYTYPE_LOOKUP
334 #define CYTHON_USE_PYTYPE_LOOKUP 0
335 #undef CYTHON_USE_PYLIST_INTERNALS
336 #define CYTHON_USE_PYLIST_INTERNALS 0
337 #undef CYTHON_USE_UNICODE_INTERNALS
338 #define CYTHON_USE_UNICODE_INTERNALS 0
339 #undef CYTHON_USE_UNICODE_WRITER
340 #define CYTHON_USE_UNICODE_WRITER 0
341 #undef CYTHON_USE_PYLONG_INTERNALS
342 #define CYTHON_USE_PYLONG_INTERNALS 0
343 #undef CYTHON_AVOID_BORROWED_REFS
344 #define CYTHON_AVOID_BORROWED_REFS 1
345 #undef CYTHON_AVOID_THREAD_UNSAFE_BORROWED_REFS
346 #define CYTHON_AVOID_THREAD_UNSAFE_BORROWED_REFS 1
347 #undef CYTHON_ASSUME_SAFE_MACROS
348 #define CYTHON_ASSUME_SAFE_MACROS 0
349 #ifndef CYTHON_ASSUME_SAFE_SIZE
350 #define CYTHON_ASSUME_SAFE_SIZE 1
352 #undef CYTHON_UNPACK_METHODS
353 #define CYTHON_UNPACK_METHODS 0
354 #undef CYTHON_FAST_THREAD_STATE
355 #define CYTHON_FAST_THREAD_STATE 0
356 #undef CYTHON_FAST_GIL
357 #define CYTHON_FAST_GIL 0
358 #ifndef CYTHON_VECTORCALL
359 #define CYTHON_VECTORCALL 1
361 #if CYTHON_USE_TYPE_SPECS && PY_VERSION_HEX < 0x030E0000
362 #undef CYTHON_VECTORCALL_TPNEW
363 #define CYTHON_VECTORCALL_TPNEW 0
364 #elif !defined(CYTHON_VECTORCALL_TPNEW)
365 #define CYTHON_VECTORCALL_TPNEW (PYPY_VERSION_NUM >= 0x07030800 && CYTHON_VECTORCALL)
367 #ifndef CYTHON_PEP487_INIT_SUBCLASS
368 #define CYTHON_PEP487_INIT_SUBCLASS 1
370 #ifndef CYTHON_PEP489_MULTI_PHASE_INIT
371 #define CYTHON_PEP489_MULTI_PHASE_INIT 1
373 #undef CYTHON_USE_MODULE_STATE
374 #define CYTHON_USE_MODULE_STATE 0
375 #undef CYTHON_USE_SYS_MONITORING
376 #define CYTHON_USE_SYS_MONITORING 0
377 #ifndef CYTHON_USE_TP_FINALIZE
378 #define CYTHON_USE_TP_FINALIZE (PYPY_VERSION_NUM >= 0x07030C00)
380 #undef CYTHON_USE_AM_SEND
381 #define CYTHON_USE_AM_SEND 0
382 #undef CYTHON_USE_DICT_VERSIONS
383 #define CYTHON_USE_DICT_VERSIONS 0
384 #undef CYTHON_USE_EXC_INFO_STACK
385 #define CYTHON_USE_EXC_INFO_STACK 0
386 #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC
387 #define CYTHON_UPDATE_DESCRIPTOR_DOC (PYPY_VERSION_NUM >= 0x07031100)
389 #ifndef CYTHON_USE_OWN_PREP_RERAISE_STAR
390 #define CYTHON_USE_OWN_PREP_RERAISE_STAR 1
392 #undef CYTHON_USE_FREELISTS
393 #define CYTHON_USE_FREELISTS 0
394 #undef CYTHON_IMMORTAL_CONSTANTS
395 #define CYTHON_IMMORTAL_CONSTANTS 0
396 #undef CYTHON_OPAQUE_OBJECTS
397 #define CYTHON_OPAQUE_OBJECTS 0
399 #define CYTHON_COMPILING_IN_PYPY 0
400 #define CYTHON_COMPILING_IN_CPYTHON 1
401 #define CYTHON_COMPILING_IN_LIMITED_API 0
402 #define CYTHON_COMPILING_IN_GRAAL 0
403 #ifdef Py_GIL_DISABLED
404 #define CYTHON_COMPILING_IN_CPYTHON_FREETHREADING 1
406 #define CYTHON_COMPILING_IN_CPYTHON_FREETHREADING 0
408 #if PY_VERSION_HEX < 0x030A0000
409 #undef CYTHON_USE_TYPE_SLOTS
410 #define CYTHON_USE_TYPE_SLOTS 1
411 #elif !defined(CYTHON_USE_TYPE_SLOTS)
412 #define CYTHON_USE_TYPE_SLOTS 1
414 #ifndef CYTHON_USE_TYPE_SPECS
415 #define CYTHON_USE_TYPE_SPECS 0
417 #ifndef CYTHON_USE_PYTYPE_LOOKUP
418 #define CYTHON_USE_PYTYPE_LOOKUP 1
420 #ifndef CYTHON_USE_PYLONG_INTERNALS
421 #define CYTHON_USE_PYLONG_INTERNALS 1
423 #if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING
424 #undef CYTHON_USE_PYLIST_INTERNALS
425 #define CYTHON_USE_PYLIST_INTERNALS 0
426 #elif !defined(CYTHON_USE_PYLIST_INTERNALS)
427 #define CYTHON_USE_PYLIST_INTERNALS 1
429 #ifndef CYTHON_USE_UNICODE_INTERNALS
430 #define CYTHON_USE_UNICODE_INTERNALS 1
432 #if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING || PY_VERSION_HEX >= 0x030B00A2
433 #undef CYTHON_USE_UNICODE_WRITER
434 #define CYTHON_USE_UNICODE_WRITER 0
435 #elif !defined(CYTHON_USE_UNICODE_WRITER)
436 #define CYTHON_USE_UNICODE_WRITER 1
438 #ifndef CYTHON_AVOID_BORROWED_REFS
439 #define CYTHON_AVOID_BORROWED_REFS 0
441 #if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING
442 #undef CYTHON_AVOID_THREAD_UNSAFE_BORROWED_REFS
443 #define CYTHON_AVOID_THREAD_UNSAFE_BORROWED_REFS 1
444 #elif !defined(CYTHON_AVOID_THREAD_UNSAFE_BORROWED_REFS)
445 #define CYTHON_AVOID_THREAD_UNSAFE_BORROWED_REFS 0
447 #ifndef CYTHON_ASSUME_SAFE_MACROS
448 #define CYTHON_ASSUME_SAFE_MACROS 1
450 #ifndef CYTHON_ASSUME_SAFE_SIZE
451 #define CYTHON_ASSUME_SAFE_SIZE 1
453 #ifndef CYTHON_UNPACK_METHODS
454 #define CYTHON_UNPACK_METHODS 1
456 #ifndef CYTHON_FAST_THREAD_STATE
457 #define CYTHON_FAST_THREAD_STATE 1
459 #if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING
460 #undef CYTHON_FAST_GIL
461 #define CYTHON_FAST_GIL 0
462 #elif !defined(CYTHON_FAST_GIL)
463 #define CYTHON_FAST_GIL (PY_VERSION_HEX < 0x030C00A6)
465 #ifndef CYTHON_VECTORCALL
466 #define CYTHON_VECTORCALL 1
468 #if CYTHON_USE_TYPE_SPECS && PY_VERSION_HEX < 0x030E0000
469 #undef CYTHON_VECTORCALL_TPNEW
470 #define CYTHON_VECTORCALL_TPNEW 0
471 #elif !defined(CYTHON_VECTORCALL_TPNEW)
472 #define CYTHON_VECTORCALL_TPNEW CYTHON_VECTORCALL
474 #ifndef CYTHON_PEP487_INIT_SUBCLASS
475 #define CYTHON_PEP487_INIT_SUBCLASS 1
477 #ifndef CYTHON_PEP489_MULTI_PHASE_INIT
478 #define CYTHON_PEP489_MULTI_PHASE_INIT 1
480 #ifndef CYTHON_USE_MODULE_STATE
481 #define CYTHON_USE_MODULE_STATE 0
483 #ifndef CYTHON_USE_SYS_MONITORING
484 #define CYTHON_USE_SYS_MONITORING (PY_VERSION_HEX >= 0x030d00B1)
486 #ifndef CYTHON_USE_TP_FINALIZE
487 #define CYTHON_USE_TP_FINALIZE 1
489 #ifndef CYTHON_USE_AM_SEND
490 #define CYTHON_USE_AM_SEND 1
492 #if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING
493 #undef CYTHON_USE_DICT_VERSIONS
494 #define CYTHON_USE_DICT_VERSIONS 0
495 #elif !defined(CYTHON_USE_DICT_VERSIONS)
496 #define CYTHON_USE_DICT_VERSIONS (PY_VERSION_HEX < 0x030C00A5 && !CYTHON_USE_MODULE_STATE)
498 #ifndef CYTHON_USE_EXC_INFO_STACK
499 #define CYTHON_USE_EXC_INFO_STACK 1
501 #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC
502 #define CYTHON_UPDATE_DESCRIPTOR_DOC 1
504 #ifndef CYTHON_USE_OWN_PREP_RERAISE_STAR
505 #define CYTHON_USE_OWN_PREP_RERAISE_STAR (PY_VERSION_HEX < 0x030C00B2)
507 #ifndef CYTHON_USE_FREELISTS
508 #define CYTHON_USE_FREELISTS (!CYTHON_COMPILING_IN_CPYTHON_FREETHREADING)
510 #if defined(CYTHON_IMMORTAL_CONSTANTS) && PY_VERSION_HEX < 0x030C0000
511 #undef CYTHON_IMMORTAL_CONSTANTS
512 #define CYTHON_IMMORTAL_CONSTANTS 0
513 #elif !defined(CYTHON_IMMORTAL_CONSTANTS)
514 #define CYTHON_IMMORTAL_CONSTANTS (PY_VERSION_HEX >= 0x030C0000 && !CYTHON_USE_MODULE_STATE && CYTHON_COMPILING_IN_CPYTHON_FREETHREADING)
516 #ifndef CYTHON_OPAQUE_OBJECTS
517 #define CYTHON_OPAQUE_OBJECTS 0
520#if CYTHON_USE_PYLONG_INTERNALS
525 enum { __pyx_check_sizeof_voidp = 1 / (int)(SIZEOF_VOID_P ==
sizeof(
void*)) };
528#ifndef __has_attribute
529 #define __has_attribute(x) 0
531#ifndef __has_cpp_attribute
532 #define __has_cpp_attribute(x) 0
534#ifndef CYTHON_RESTRICT
535 #if defined(__GNUC__)
536 #define CYTHON_RESTRICT __restrict__
537 #elif defined(_MSC_VER) && _MSC_VER >= 1400
538 #define CYTHON_RESTRICT __restrict
539 #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
540 #define CYTHON_RESTRICT restrict
542 #define CYTHON_RESTRICT
546 #if defined(__cplusplus)
549 #if ((defined(_MSVC_LANG) && _MSVC_LANG >= 201703L) || __cplusplus >= 201703L)
550 #if __has_cpp_attribute(maybe_unused)
551 #define CYTHON_UNUSED [[maybe_unused]]
554 #elif defined(__STDC_VERSION__) && __STDC_VERSION__ >= 202311L
555 #define CYTHON_UNUSED [[maybe_unused]]
559# if defined(__GNUC__)
560# if !(defined(__cplusplus)) || (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4))
561# define CYTHON_UNUSED __attribute__ ((__unused__))
563# define CYTHON_UNUSED
565# elif defined(__ICC) || (defined(__INTEL_COMPILER) && !defined(_MSC_VER))
566# define CYTHON_UNUSED __attribute__ ((__unused__))
568# define CYTHON_UNUSED
571#ifndef CYTHON_UNUSED_VAR
572# if defined(__cplusplus)
573 template<
class T>
void CYTHON_UNUSED_VAR(
const T& ) { }
575# define CYTHON_UNUSED_VAR(x) (void)(x)
578#ifndef CYTHON_MAYBE_UNUSED_VAR
579 #define CYTHON_MAYBE_UNUSED_VAR(x) CYTHON_UNUSED_VAR(x)
581#ifndef CYTHON_NCP_UNUSED
582# if CYTHON_COMPILING_IN_CPYTHON && !CYTHON_COMPILING_IN_CPYTHON_FREETHREADING
583# define CYTHON_NCP_UNUSED
585# define CYTHON_NCP_UNUSED CYTHON_UNUSED
588#ifndef CYTHON_USE_CPP_STD_MOVE
589 #if defined(__cplusplus) && (\
590 __cplusplus >= 201103L || (defined(_MSC_VER) && _MSC_VER >= 1600))
591 #define CYTHON_USE_CPP_STD_MOVE 1
593 #define CYTHON_USE_CPP_STD_MOVE 0
596#define __Pyx_void_to_None(void_result) ((void)(void_result), Py_INCREF(Py_None), Py_None)
598typedef uintptr_t __pyx_uintptr_t;
599#ifndef CYTHON_FALLTHROUGH
600 #if defined(__cplusplus)
603 #if ((defined(_MSVC_LANG) && _MSVC_LANG >= 201703L) || __cplusplus >= 201703L)
604 #if __has_cpp_attribute(fallthrough)
605 #define CYTHON_FALLTHROUGH [[fallthrough]]
608 #ifndef CYTHON_FALLTHROUGH
609 #if __has_cpp_attribute(clang::fallthrough)
610 #define CYTHON_FALLTHROUGH [[clang::fallthrough]]
611 #elif __has_cpp_attribute(gnu::fallthrough)
612 #define CYTHON_FALLTHROUGH [[gnu::fallthrough]]
616 #ifndef CYTHON_FALLTHROUGH
617 #if __has_attribute(fallthrough)
618 #define CYTHON_FALLTHROUGH __attribute__((fallthrough))
620 #define CYTHON_FALLTHROUGH
623 #if defined(__clang__) && defined(__apple_build_version__)
624 #if __apple_build_version__ < 7000000
625 #undef CYTHON_FALLTHROUGH
626 #define CYTHON_FALLTHROUGH
631 #define __Pyx_UNREACHABLE() Py_UNREACHABLE()
632#elif __Pyx_has_cbuiltin(__builtin_unreachable)
633 #define __Pyx_UNREACHABLE() __builtin_unreachable()
634#elif defined(__clang__) || defined(__INTEL_COMPILER) || (defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 5)))
635 #define __Pyx_UNREACHABLE() __builtin_unreachable()
636#elif defined(_MSC_VER)
637 #define __Pyx_UNREACHABLE() __assume(0)
639 #define __Pyx_UNREACHABLE() Py_FatalError("Unreachable C code path reached")
641#ifndef Py_UNREACHABLE
642 #define Py_UNREACHABLE() __Pyx_UNREACHABLE()
645 template <
typename T>
646 struct __PYX_IS_UNSIGNED_IMPL {
static const bool value =
T(0) <
T(-1);};
647 #define __PYX_IS_UNSIGNED(type) (__PYX_IS_UNSIGNED_IMPL<type>::value)
649 #define __PYX_IS_UNSIGNED(type) (((type)-1) > 0)
651#if CYTHON_COMPILING_IN_PYPY == 1
652 #define __PYX_NEED_TP_PRINT_SLOT (PY_VERSION_HEX < 0x030A0000)
654 #define __PYX_NEED_TP_PRINT_SLOT 0
656#define __PYX_REINTERPRET_FUNCION(func_pointer, other_pointer) ((func_pointer)(void(*)(void))(other_pointer))
657#if __PYX_LIMITED_VERSION_HEX < 0x030C0000
658#define __Pyx_PyErr_FetchException(petype, peval, petb) PyErr_Fetch(petype, peval, petb)
659#define __Pyx_PyErr_RestoreException(etype, eval, etb) PyErr_Restore(etype, eval, etb)
661#define __Pyx_PyErr_FetchException(petype, peval, petb) *(petype)=NULL; *(peval)=PyErr_GetRaisedException(); *(petb)=NULL
662#define __Pyx_PyErr_RestoreException(etype, eval, etb) PyErr_SetRaisedException(eval)
667 #error "Cython files generated with the C++ option must be compiled with a C++ compiler."
670 #if defined(__clang__)
671 #define CYTHON_INLINE __inline__ __attribute__ ((__unused__))
673 #define CYTHON_INLINE inline
677void __Pyx_call_destructor(
T& x) {
681class __Pyx_FakeReference {
683 __Pyx_FakeReference() : ptr(NULL) { }
684 __Pyx_FakeReference(
const T& ref) : ptr(const_cast<
T*>(&ref)) { }
685 T *operator->() {
return ptr; }
686 T *operator&() {
return ptr; }
687 operator T&() {
return *ptr; }
688 template<
typename U>
bool operator ==(
const U& other)
const {
return *ptr == other; }
689 template<
typename U>
bool operator !=(
const U& other)
const {
return *ptr != other; }
690 template<
typename U>
bool operator==(
const __Pyx_FakeReference<U>& other)
const {
return *ptr == *other.ptr; }
691 template<
typename U>
bool operator!=(
const __Pyx_FakeReference<U>& other)
const {
return *ptr != *other.ptr; }
697#define __PYX_BUILD_PY_SSIZE_T "n"
698#define CYTHON_FORMAT_SSIZE_T "z"
699#define __Pyx_BUILTIN_MODULE_NAME "builtins"
700#define __Pyx_DefaultClassType PyType_Type
701#if CYTHON_COMPILING_IN_LIMITED_API
703 static int CO_OPTIMIZED;
706 static int CO_NEWLOCALS;
709 static int CO_VARARGS;
711 #ifndef CO_VARKEYWORDS
712 static int CO_VARKEYWORDS;
714 #ifndef CO_ASYNC_GENERATOR
715 static int CO_ASYNC_GENERATOR;
718 static int CO_GENERATOR;
721 static int CO_COROUTINE;
725 #define CO_COROUTINE 0x80
727 #ifndef CO_ASYNC_GENERATOR
728 #define CO_ASYNC_GENERATOR 0x200
731static int __Pyx_init_co_variables(
void);
732#if PY_VERSION_HEX >= 0x030A00B1 || defined(Py_Is)
733 #define __Pyx_Py_Is(x, y) Py_Is(x, y)
735 #define __Pyx_Py_Is(x, y) ((x) == (y))
737#if PY_VERSION_HEX >= 0x030A00B1 || defined(Py_IsNone)
738 #define __Pyx_Py_IsNone(ob) Py_IsNone(ob)
740 #define __Pyx_Py_IsNone(ob) __Pyx_Py_Is((ob), Py_None)
742#if PY_VERSION_HEX >= 0x030A00B1 || defined(Py_IsTrue)
743 #define __Pyx_Py_IsTrue(ob) Py_IsTrue(ob)
745 #define __Pyx_Py_IsTrue(ob) __Pyx_Py_Is((ob), Py_True)
747#if PY_VERSION_HEX >= 0x030A00B1 || defined(Py_IsFalse)
748 #define __Pyx_Py_IsFalse(ob) Py_IsFalse(ob)
750 #define __Pyx_Py_IsFalse(ob) __Pyx_Py_Is((ob), Py_False)
752#define __Pyx_NoneAsNull(obj) (__Pyx_Py_IsNone(obj) ? NULL : (obj))
753#if CYTHON_COMPILING_IN_PYPY
754 #define __Pyx_PyObject_GC_IsFinalized(o) _PyGC_FINALIZED(o)
756 #define __Pyx_PyObject_GC_IsFinalized(o) PyObject_GC_IsFinalized(o)
758#if CYTHON_COMPILING_IN_LIMITED_API
759static unsigned long __Pyx_Runtime_TPFLAGS_SEQUENCE;
760static unsigned long __Pyx_Runtime_TPFLAGS_MAPPING;
762#define __Pyx_Runtime_TPFLAGS_SEQUENCE Py_TPFLAGS_SEQUENCE
763#define __Pyx_Runtime_TPFLAGS_MAPPING Py_TPFLAGS_MAPPING
765static int __Pyx_init_tpflags_variables(
void);
766#ifndef Py_TPFLAGS_HAVE_FINALIZE
767 #define Py_TPFLAGS_HAVE_FINALIZE 0
769#ifndef Py_TPFLAGS_SEQUENCE
770 #define Py_TPFLAGS_SEQUENCE (CYTHON_COMPILING_IN_LIMITED_API ? 0 : 1 << 5)
772#ifndef Py_TPFLAGS_MAPPING
773 #define Py_TPFLAGS_MAPPING (CYTHON_COMPILING_IN_LIMITED_API ? 0 : 1 << 6)
775#ifndef Py_TPFLAGS_IMMUTABLETYPE
776 #define Py_TPFLAGS_IMMUTABLETYPE (1UL << 8)
778#ifndef Py_TPFLAGS_DISALLOW_INSTANTIATION
779 #define Py_TPFLAGS_DISALLOW_INSTANTIATION (1UL << 7)
781#ifndef METH_STACKLESS
782 #define METH_STACKLESS 0
784#if !defined(METH_FASTCALL) || CYTHON_COMPILING_IN_PYPY
785 #ifndef METH_FASTCALL
786 #define METH_FASTCALL 0x80
788 typedef PyObject *(*__Pyx_PyCFunctionFast) (PyObject *self, PyObject *
const *args, Py_ssize_t nargs);
789 typedef PyObject *(*__Pyx_PyCFunctionFastWithKeywords) (PyObject *self, PyObject *
const *args,
790 Py_ssize_t nargs, PyObject *kwnames);
792 #if PY_VERSION_HEX >= 0x030d00A4
793 # define __Pyx_PyCFunctionFast PyCFunctionFast
794 # define __Pyx_PyCFunctionFastWithKeywords PyCFunctionFastWithKeywords
796 # define __Pyx_PyCFunctionFast _PyCFunctionFast
797 # define __Pyx_PyCFunctionFastWithKeywords _PyCFunctionFastWithKeywords
801 #define __Pyx_METH_FASTCALL METH_FASTCALL
802 #define __Pyx_PyCFunction_FastCall __Pyx_PyCFunctionFast
803 #define __Pyx_PyCFunction_FastCallWithKeywords __Pyx_PyCFunctionFastWithKeywords
805 #define __Pyx_METH_FASTCALL METH_VARARGS
806 #define __Pyx_PyCFunction_FastCall PyCFunction
807 #define __Pyx_PyCFunction_FastCallWithKeywords PyCFunctionWithKeywords
810 #define __pyx_vectorcallfunc vectorcallfunc
811 #define __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET PY_VECTORCALL_ARGUMENTS_OFFSET
812 #define __Pyx_PyVectorcall_NARGS(n) PyVectorcall_NARGS((size_t)(n))
814 #define __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET 0
815 #define __Pyx_PyVectorcall_NARGS(n) ((Py_ssize_t)(n))
817#define __Pyx_PyCFunction_CheckExact(func) PyCFunction_CheckExact(func)
818#define __Pyx_CyOrPyCFunction_Check(func) PyCFunction_Check(func)
819#if CYTHON_COMPILING_IN_CPYTHON
820#define __Pyx_CyOrPyCFunction_GET_FUNCTION(func) (((PyCFunctionObject*)(func))->m_ml->ml_meth)
821#elif !CYTHON_COMPILING_IN_LIMITED_API
822#define __Pyx_CyOrPyCFunction_GET_FUNCTION(func) PyCFunction_GET_FUNCTION(func)
824#if CYTHON_COMPILING_IN_CPYTHON
825#define __Pyx_CyOrPyCFunction_GET_FLAGS(func) (((PyCFunctionObject*)(func))->m_ml->ml_flags)
826static CYTHON_INLINE PyObject* __Pyx_CyOrPyCFunction_GET_SELF(PyObject *func) {
827 return (__Pyx_CyOrPyCFunction_GET_FLAGS(func) & METH_STATIC) ? NULL : ((PyCFunctionObject*)func)->m_self;
830static CYTHON_INLINE
int __Pyx__IsSameCFunction(PyObject *func,
void (*cfunc)(
void)) {
831#if CYTHON_COMPILING_IN_LIMITED_API
832 return PyCFunction_Check(func) && PyCFunction_GetFunction(func) == (PyCFunction) cfunc;
834 return PyCFunction_Check(func) && PyCFunction_GET_FUNCTION(func) == (PyCFunction) cfunc;
837#define __Pyx_IsSameCFunction(func, cfunc) __Pyx__IsSameCFunction(func, cfunc)
838#if CYTHON_COMPILING_IN_LIMITED_API && __PYX_LIMITED_VERSION_HEX < 0x030A0000
839 #define __Pyx_PyType_FromModuleAndSpec(m, s, b) ((void)m, PyType_FromSpecWithBases(s, b))
841 #define __Pyx_PyType_FromModuleAndSpec(m, s, b) PyType_FromModuleAndSpec(m, s, b)
843#if CYTHON_COMPILING_IN_PYPY
844 typedef PyObject *(*__Pyx_PyCMethod)(PyObject *, PyTypeObject *, PyObject *
const *, size_t, PyObject *);
846 #define __Pyx_PyCMethod PyCMethod
849 #define METH_METHOD 0x200
851#if CYTHON_COMPILING_IN_PYPY && !defined(PyObject_Malloc)
852 #define PyObject_Malloc(s) PyMem_Malloc(s)
853 #define PyObject_Free(p) PyMem_Free(p)
854 #define PyObject_Realloc(p) PyMem_Realloc(p)
856#if CYTHON_COMPILING_IN_LIMITED_API
857 #define __Pyx_PyFrame_SetLineNumber(frame, lineno)
858#elif CYTHON_COMPILING_IN_GRAAL && defined(GRAALPY_VERSION_NUM) && GRAALPY_VERSION_NUM > 0x19000000
859 #define __Pyx_PyCode_HasFreeVars(co) (PyCode_GetNumFree(co) > 0)
860 #define __Pyx_PyFrame_SetLineNumber(frame, lineno) GraalPyFrame_SetLineNumber((frame), (lineno))
861#elif CYTHON_COMPILING_IN_GRAAL
862 #define __Pyx_PyCode_HasFreeVars(co) (PyCode_GetNumFree(co) > 0)
863 #define __Pyx_PyFrame_SetLineNumber(frame, lineno) _PyFrame_SetLineNumber((frame), (lineno))
865 #define __Pyx_PyCode_HasFreeVars(co) (PyCode_GetNumFree(co) > 0)
866 #define __Pyx_PyFrame_SetLineNumber(frame, lineno) (frame)->f_lineno = (lineno)
868#if CYTHON_COMPILING_IN_LIMITED_API
869 #define __Pyx_PyThreadState_Current PyThreadState_Get()
870#elif !CYTHON_FAST_THREAD_STATE
871 #define __Pyx_PyThreadState_Current PyThreadState_GET()
872#elif PY_VERSION_HEX >= 0x030d00A1
873 #define __Pyx_PyThreadState_Current PyThreadState_GetUnchecked()
875 #define __Pyx_PyThreadState_Current _PyThreadState_UncheckedGet()
877#if CYTHON_OPAQUE_OBJECTS && CYTHON_COMPILING_IN_LIMITED_API
878 #define __PYX_SHARED_SIZEOF(T) -((int)sizeof(T))
879 #define __PYX_SHARED_RELATIVE_OFFSET Py_RELATIVE_OFFSET
880 #define CYTHON_OPAQUE_SHARED_TYPES 1
882 #define __PYX_SHARED_SIZEOF(T) sizeof(T)
883 #define __PYX_SHARED_RELATIVE_OFFSET 0
884 #define CYTHON_OPAQUE_SHARED_TYPES 0
886#if CYTHON_USE_MODULE_STATE
887static CYTHON_INLINE
void *__Pyx__PyModule_GetState(PyObject *op)
890 result = PyModule_GetState(op);
892 Py_FatalError(
"Couldn't find the module state");
895#define __Pyx_PyModule_GetState(o) (__pyx_mstatetype *)__Pyx__PyModule_GetState(o)
897#define __Pyx_PyModule_GetState(op) ((void)op,__pyx_mstate_global)
899#define __Pyx_PyObject_GetSlot(obj, name, func_ctype) __Pyx_PyType_GetSlot(Py_TYPE((PyObject *) obj), name, func_ctype)
900#define __Pyx_PyObject_TryGetSlot(obj, name, func_ctype) __Pyx_PyType_TryGetSlot(Py_TYPE(obj), name, func_ctype)
901#define __Pyx_PyObject_GetSubSlot(obj, sub, name, func_ctype) __Pyx_PyType_GetSubSlot(Py_TYPE(obj), sub, name, func_ctype)
902#define __Pyx_PyObject_TryGetSubSlot(obj, sub, name, func_ctype) __Pyx_PyType_TryGetSubSlot(Py_TYPE(obj), sub, name, func_ctype)
903#if CYTHON_USE_TYPE_SLOTS
904 #define __Pyx_PyType_GetSlot(type, name, func_ctype) ((type)->name)
905 #define __Pyx_PyType_TryGetSlot(type, name, func_ctype) __Pyx_PyType_GetSlot(type, name, func_ctype)
906 #define __Pyx_PyType_GetSubSlot(type, sub, name, func_ctype) (((type)->sub) ? ((type)->sub->name) : NULL)
907 #define __Pyx_PyType_TryGetSubSlot(type, sub, name, func_ctype) __Pyx_PyType_GetSubSlot(type, sub, name, func_ctype)
909 #define __Pyx_PyType_GetSlot(type, name, func_ctype) ((func_ctype) PyType_GetSlot((type), Py_##name))
910 #define __Pyx_PyType_TryGetSlot(type, name, func_ctype)\
911 ((__PYX_LIMITED_VERSION_HEX >= 0x030A0000 ||\
912 (PyType_GetFlags(type) & Py_TPFLAGS_HEAPTYPE) || __Pyx_get_runtime_version() >= 0x030A0000) ?\
913 __Pyx_PyType_GetSlot(type, name, func_ctype) : NULL)
914 #define __Pyx_PyType_GetSubSlot(obj, sub, name, func_ctype) __Pyx_PyType_GetSlot(obj, name, func_ctype)
915 #define __Pyx_PyType_TryGetSubSlot(obj, sub, name, func_ctype) __Pyx_PyType_TryGetSlot(obj, name, func_ctype)
917#if CYTHON_COMPILING_IN_CPYTHON || defined(_PyDict_NewPresized)
918#define __Pyx_PyDict_NewPresized(n) ((n <= 8) ? PyDict_New() : _PyDict_NewPresized(n))
920#define __Pyx_PyDict_NewPresized(n) PyDict_New()
922#define __Pyx_PyNumber_Divide(x,y) PyNumber_TrueDivide(x,y)
923#define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceTrueDivide(x,y)
924#if CYTHON_COMPILING_IN_CPYTHON && CYTHON_USE_UNICODE_INTERNALS
925#define __Pyx_PyDict_GetItemStrWithError(dict, name) _PyDict_GetItem_KnownHash(dict, name, ((PyASCIIObject *) name)->hash)
926static CYTHON_INLINE PyObject * __Pyx_PyDict_GetItemStr(PyObject *dict, PyObject *name) {
927 PyObject *res = __Pyx_PyDict_GetItemStrWithError(dict, name);
928 if (res == NULL && PyErr_Occurred()) {
929 PyErr_WriteUnraisable(NULL);
933#elif !CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07020000
934#define __Pyx_PyDict_GetItemStrWithError PyDict_GetItemWithError
935#define __Pyx_PyDict_GetItemStr PyDict_GetItem
937static CYTHON_INLINE PyObject * __Pyx_PyDict_GetItemStrWithError(PyObject *dict, PyObject *name) {
938#if CYTHON_COMPILING_IN_PYPY
939 return PyDict_GetItem(dict, name);
942 PyDictObject *mp = (PyDictObject*) dict;
943 long hash = ((PyStringObject *) name)->ob_shash;
945 ep = (mp->ma_lookup)(mp, name, hash);
952#define __Pyx_PyDict_GetItemStr PyDict_GetItem
954#if CYTHON_USE_TYPE_SLOTS
955 #define __Pyx_PyType_GetFlags(tp) (((PyTypeObject *)tp)->tp_flags)
956 #define __Pyx_PyType_HasFeature(type, feature) ((__Pyx_PyType_GetFlags(type) & (feature)) != 0)
958 #define __Pyx_PyType_GetFlags(tp) (PyType_GetFlags((PyTypeObject *)tp))
959 #define __Pyx_PyType_HasFeature(type, feature) PyType_HasFeature(type, feature)
961#define __Pyx_PyObject_GetIterNextFunc(iterator) __Pyx_PyObject_GetSlot(iterator, tp_iternext, iternextfunc)
962#if CYTHON_USE_TYPE_SPECS
963#define __Pyx_PyHeapTypeObject_GC_Del(obj) {\
964 PyTypeObject *type = Py_TYPE((PyObject*)obj);\
965 assert(__Pyx_PyType_HasFeature(type, Py_TPFLAGS_HEAPTYPE));\
966 PyObject_GC_Del(obj);\
970#define __Pyx_PyHeapTypeObject_GC_Del(obj) PyObject_GC_Del(obj)
972#if CYTHON_COMPILING_IN_LIMITED_API
973 #define __Pyx_PyUnicode_READY(op) (0)
974 #define __Pyx_PyUnicode_READ_CHAR(u, i) PyUnicode_ReadChar(u, i)
975 #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u) ((void)u, 1114111U)
976 #define __Pyx_PyUnicode_KIND(u) ((void)u, (0))
977 #define __Pyx_PyUnicode_KIND_04(u) __Pyx_PyUnicode_KIND(u)
978 #define __Pyx_PyUnicode_DATA(u) ((void*)u)
979 #define __Pyx_PyUnicode_READ(k, d, i) ((void)k, PyUnicode_ReadChar((PyObject*)(d), i))
980 #define __Pyx_PyUnicode_IS_TRUE(u) (0 != PyUnicode_GetLength(u))
982 #if PY_VERSION_HEX >= 0x030C0000
983 #define __Pyx_PyUnicode_READY(op) (0)
985 #define __Pyx_PyUnicode_READY(op) (likely(PyUnicode_IS_READY(op)) ?\
986 0 : _PyUnicode_Ready((PyObject *)(op)))
988 #define __Pyx_PyUnicode_READ_CHAR(u, i) PyUnicode_READ_CHAR(u, i)
989 #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u) PyUnicode_MAX_CHAR_VALUE(u)
990 #define __Pyx_PyUnicode_KIND(u) ((int)PyUnicode_KIND(u))
991 #define __Pyx_PyUnicode_DATA(u) PyUnicode_DATA(u)
992 #define __Pyx_PyUnicode_READ(k, d, i) PyUnicode_READ(k, d, i)
993 #define __Pyx_PyUnicode_WRITE(k, d, i, ch) PyUnicode_WRITE(k, d, i, (Py_UCS4) ch)
994 #if PY_VERSION_HEX >= 0x030C0000
995 #define __Pyx_PyUnicode_IS_TRUE(u) (0 != PyUnicode_GET_LENGTH(u))
997 #if CYTHON_COMPILING_IN_CPYTHON
998 #define __Pyx_PyUnicode_IS_TRUE(u) (0 != (likely(PyUnicode_IS_READY(u)) ? PyUnicode_GET_LENGTH(u) : ((PyCompactUnicodeObject *)(u))->wstr_length))
1000 #define __Pyx_PyUnicode_IS_TRUE(u) (0 != (likely(PyUnicode_IS_READY(u)) ? PyUnicode_GET_LENGTH(u) : PyUnicode_GET_SIZE(u)))
1003 static CYTHON_INLINE
int __Pyx_PyUnicode_KIND_04(PyObject *o) {
1004 return __Pyx_PyUnicode_KIND(o) - (int) !!PyUnicode_IS_ASCII(o);
1007#if CYTHON_COMPILING_IN_PYPY
1008 #define __Pyx_PyUnicode_Concat(a, b) PyNumber_Add(a, b)
1009 #define __Pyx_PyUnicode_ConcatSafe(a, b) PyNumber_Add(a, b)
1011 #define __Pyx_PyUnicode_Concat(a, b) PyUnicode_Concat(a, b)
1012 #define __Pyx_PyUnicode_ConcatSafe(a, b) ((unlikely((a) == Py_None) || unlikely((b) == Py_None)) ?\
1013 PyNumber_Add(a, b) : __Pyx_PyUnicode_Concat(a, b))
1015#if CYTHON_COMPILING_IN_PYPY
1016 #if !defined(PyUnicode_DecodeUnicodeEscape)
1017 #define PyUnicode_DecodeUnicodeEscape(s, size, errors) PyUnicode_Decode(s, size, "unicode_escape", errors)
1019 #if !defined(PyUnicode_Contains)
1020 #define PyUnicode_Contains(u, s) PySequence_Contains(u, s)
1022 #if !defined(PyByteArray_Check)
1023 #define PyByteArray_Check(obj) PyObject_TypeCheck(obj, &PyByteArray_Type)
1025 #if !defined(PyObject_Format)
1026 #define PyObject_Format(obj, fmt) PyObject_CallMethod(obj, "__format__", "O", fmt)
1029#define __Pyx_PyUnicode_FormatSafe(a, b) ((unlikely((a) == Py_None || (PyUnicode_Check(b) && !PyUnicode_CheckExact(b)))) ? PyNumber_Remainder(a, b) : PyUnicode_Format(a, b))
1030#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
1031 #define __Pyx_PySequence_ListKeepNew(obj)\
1032 (likely(PyList_CheckExact(obj) && PyUnstable_Object_IsUniquelyReferenced(obj)) ? __Pyx_NewRef(obj) : PySequence_List(obj))
1033#elif CYTHON_COMPILING_IN_CPYTHON
1034 #define __Pyx_PySequence_ListKeepNew(obj)\
1035 (likely(PyList_CheckExact(obj) && Py_REFCNT(obj) == 1) ? __Pyx_NewRef(obj) : PySequence_List(obj))
1037 #define __Pyx_PySequence_ListKeepNew(obj) PySequence_List(obj)
1039#ifndef PySet_CheckExact
1040 #define PySet_CheckExact(obj) Py_IS_TYPE(obj, &PySet_Type)
1042enum __Pyx_ReferenceSharing {
1043 __Pyx_ReferenceSharing_DefinitelyUnique,
1044 __Pyx_ReferenceSharing_OwnStrongReference,
1045 __Pyx_ReferenceSharing_FunctionArgument,
1046 __Pyx_ReferenceSharing_SharedReference,
1048#if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING && PY_VERSION_HEX >= 0x030E0000
1049#define __Pyx_IS_UNIQUELY_REFERENCED(o, sharing)\
1050 (sharing == __Pyx_ReferenceSharing_DefinitelyUnique ? 1 :\
1051 (sharing == __Pyx_ReferenceSharing_FunctionArgument ? PyUnstable_Object_IsUniqueReferencedTemporary(o) :\
1052 (sharing == __Pyx_ReferenceSharing_OwnStrongReference ? PyUnstable_Object_IsUniquelyReferenced(o) : 0)))
1053#elif (CYTHON_COMPILING_IN_CPYTHON && !CYTHON_COMPILING_IN_CPYTHON_FREETHREADING) || CYTHON_COMPILING_IN_LIMITED_API
1054#define __Pyx_IS_UNIQUELY_REFERENCED(o, sharing) (((void)sharing), Py_REFCNT(o) == 1)
1056#define __Pyx_IS_UNIQUELY_REFERENCED(o, sharing) (((void)o), ((void)sharing), 0)
1058#if __PYX_LIMITED_VERSION_HEX >= 0x030d0000
1059 #define __Pyx_PyList_GetItemRef(o, i) PyList_GetItemRef(o, i)
1060#elif CYTHON_AVOID_BORROWED_REFS || CYTHON_AVOID_THREAD_UNSAFE_BORROWED_REFS
1061 #if CYTHON_COMPILING_IN_LIMITED_API || !CYTHON_ASSUME_SAFE_MACROS
1062 #define __Pyx_PyList_GetItemRef(o, i) (likely((i) >= 0) ? PySequence_GetItem(o, i) : (PyErr_SetString(PyExc_IndexError, "list index out of range"), (PyObject*)NULL))
1064 #define __Pyx_PyList_GetItemRef(o, i) PySequence_ITEM(o, i)
1066#elif CYTHON_COMPILING_IN_LIMITED_API || !(CYTHON_ASSUME_SAFE_MACROS && CYTHON_ASSUME_SAFE_SIZE)
1067 #define __Pyx_PyList_GetItemRef(o, i) __Pyx_XNewRef(PyList_GetItem(o, i))
1069 #define __Pyx_PyList_GetItemRef(o, i) (likely(__Pyx_is_valid_index(i, PyList_GET_SIZE(o))) ?\
1070 __Pyx_NewRef(PyList_GET_ITEM(o, i)) : (PyErr_SetString(PyExc_IndexError, "list index out of range"), (PyObject*)NULL))
1072#if CYTHON_AVOID_BORROWED_REFS || CYTHON_COMPILING_IN_LIMITED_API
1073 #define __Pyx_PyList_GET_ITEM_REF(o, i, unsafe_shared) ((void)(unsafe_shared),\
1074 __Pyx_PyList_GetItemRef(o, i))
1075#elif CYTHON_AVOID_THREAD_UNSAFE_BORROWED_REFS
1076 #if CYTHON_ASSUME_SAFE_MACROS
1077 #define __Pyx_PyList_GET_ITEM_REF(o, i, unsafe_shared) (\
1078 __Pyx_IS_UNIQUELY_REFERENCED(o, unsafe_shared) ?\
1079 __Pyx_NewRef(PyList_GET_ITEM(o, i)) : __Pyx_PyList_GetItemRef(o, i))
1081 #define __Pyx_PyList_GET_ITEM_REF(o, i, unsafe_shared) (\
1082 __Pyx_IS_UNIQUELY_REFERENCED(o, unsafe_shared) ?\
1083 __Pyx_XNewRef(PyList_GetItem(o, i)) : __Pyx_PyList_GetItemRef(o, i))
1085#elif CYTHON_ASSUME_SAFE_MACROS
1086 #define __Pyx_PyList_GET_ITEM_REF(o, i, unsafe_shared) ((void)(unsafe_shared),\
1087 __Pyx_NewRef(PyList_GET_ITEM(o, i)))
1089 #define __Pyx_PyList_GET_ITEM_REF(o, i, unsafe_shared) ((void)(unsafe_shared),\
1090 __Pyx_XNewRef(PyList_GetItem(o, i)))
1092#if __PYX_LIMITED_VERSION_HEX >= 0x030d0000
1093#define __Pyx_PyDict_GetItemRef(dict, key, result) PyDict_GetItemRef(dict, key, result)
1094#elif CYTHON_AVOID_BORROWED_REFS || CYTHON_AVOID_THREAD_UNSAFE_BORROWED_REFS
1095static CYTHON_INLINE
int __Pyx_PyDict_GetItemRef(PyObject *dict, PyObject *key, PyObject **result) {
1096 *result = PyObject_GetItem(dict, key);
1097 if (*result == NULL) {
1098 if (PyErr_ExceptionMatches(PyExc_KeyError)) {
1107static CYTHON_INLINE
int __Pyx_PyDict_GetItemRef(PyObject *dict, PyObject *key, PyObject **result) {
1108 *result = PyDict_GetItemWithError(dict, key);
1109 if (*result == NULL) {
1110 return PyErr_Occurred() ? -1 : 0;
1116#if defined(CYTHON_DEBUG_VISIT_CONST) && CYTHON_DEBUG_VISIT_CONST
1117 #define __Pyx_VISIT_CONST(obj) Py_VISIT(obj)
1119 #define __Pyx_VISIT_CONST(obj)
1121#if CYTHON_ASSUME_SAFE_MACROS
1122 #define __Pyx_PySequence_ITEM(o, i) PySequence_ITEM(o, i)
1123 #define __Pyx_PySequence_SIZE(seq) Py_SIZE(seq)
1124 #define __Pyx_PyTuple_SET_ITEM(o, i, v) (PyTuple_SET_ITEM(o, i, v), (0))
1125 #define __Pyx_PyTuple_GET_ITEM(o, i) PyTuple_GET_ITEM(o, i)
1126 #define __Pyx_PyList_SET_ITEM(o, i, v) (PyList_SET_ITEM(o, i, v), (0))
1127 #define __Pyx_PyList_GET_ITEM(o, i) PyList_GET_ITEM(o, i)
1129 #define __Pyx_PySequence_ITEM(o, i) PySequence_GetItem(o, i)
1130 #define __Pyx_PySequence_SIZE(seq) PySequence_Size(seq)
1131 #define __Pyx_PyTuple_SET_ITEM(o, i, v) PyTuple_SetItem(o, i, v)
1132 #define __Pyx_PyTuple_GET_ITEM(o, i) PyTuple_GetItem(o, i)
1133 #define __Pyx_PyList_SET_ITEM(o, i, v) PyList_SetItem(o, i, v)
1134 #define __Pyx_PyList_GET_ITEM(o, i) PyList_GetItem(o, i)
1136#if CYTHON_ASSUME_SAFE_SIZE
1137 #define __Pyx_PyTuple_GET_SIZE(o) PyTuple_GET_SIZE(o)
1138 #define __Pyx_PyList_GET_SIZE(o) PyList_GET_SIZE(o)
1139 #define __Pyx_PySet_GET_SIZE(o) PySet_GET_SIZE(o)
1140 #define __Pyx_PyDict_GET_SIZE(o) PyDict_GET_SIZE(o)
1141 #define __Pyx_PyBytes_GET_SIZE(o) PyBytes_GET_SIZE(o)
1142 #define __Pyx_PyByteArray_GET_SIZE(o) PyByteArray_GET_SIZE(o)
1143 #define __Pyx_PyUnicode_GET_LENGTH(o) PyUnicode_GET_LENGTH(o)
1145 #define __Pyx_PyTuple_GET_SIZE(o) PyTuple_Size(o)
1146 #define __Pyx_PyList_GET_SIZE(o) PyList_Size(o)
1147 #define __Pyx_PySet_GET_SIZE(o) PySet_Size(o)
1148 #define __Pyx_PyDict_GET_SIZE(o) PyDict_Size(o)
1149 #define __Pyx_PyBytes_GET_SIZE(o) PyBytes_Size(o)
1150 #define __Pyx_PyByteArray_GET_SIZE(o) PyByteArray_Size(o)
1151 #define __Pyx_PyUnicode_GET_LENGTH(o) PyUnicode_GetLength(o)
1153#if CYTHON_COMPILING_IN_PYPY && !defined(PyUnicode_InternFromString)
1154 #define PyUnicode_InternFromString(s) PyUnicode_FromString(s)
1156#define __Pyx_PyLong_FromHash_t PyLong_FromSsize_t
1157#define __Pyx_PyLong_AsHash_t __Pyx_PyIndex_AsSsize_t
1158#if __PYX_LIMITED_VERSION_HEX >= 0x030A0000
1159 #define __Pyx_PySendResult PySendResult
1165 } __Pyx_PySendResult;
1167#if CYTHON_COMPILING_IN_LIMITED_API || PY_VERSION_HEX < 0x030A00A3
1168 typedef __Pyx_PySendResult (*__Pyx_pyiter_sendfunc)(PyObject *iter, PyObject *value, PyObject **result);
1170 #define __Pyx_pyiter_sendfunc sendfunc
1172#if !CYTHON_USE_AM_SEND
1173#define __PYX_HAS_PY_AM_SEND 0
1174#elif __PYX_LIMITED_VERSION_HEX >= 0x030A0000
1175#define __PYX_HAS_PY_AM_SEND 1
1177#define __PYX_HAS_PY_AM_SEND 2
1179#if __PYX_HAS_PY_AM_SEND < 2
1180 #define __Pyx_PyAsyncMethodsStruct PyAsyncMethods
1186 __Pyx_pyiter_sendfunc am_send;
1187 } __Pyx_PyAsyncMethodsStruct;
1188 #define __Pyx_SlotTpAsAsync(s) ((PyAsyncMethods*)(s))
1190#if CYTHON_USE_AM_SEND && PY_VERSION_HEX < 0x030A00F0
1191 #define __Pyx_TPFLAGS_HAVE_AM_SEND (1UL << 21)
1193 #define __Pyx_TPFLAGS_HAVE_AM_SEND (0)
1195#if CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030A0000
1199PyAPI_FUNC(
void *) PyMem_Calloc(
size_t nelem,
size_t elsize);
1201#if CYTHON_COMPILING_IN_LIMITED_API
1202static int __Pyx_init_co_variable(PyObject *inspect,
const char* name,
int *write_to) {
1204 PyObject *py_value = PyObject_GetAttrString(inspect, name);
1205 if (!py_value)
return 0;
1206 value = (int) PyLong_AsLong(py_value);
1207 Py_DECREF(py_value);
1209 return value != -1 || !PyErr_Occurred();
1211static int __Pyx_init_co_variables(
void) {
1214 inspect = PyImport_ImportModule(
"inspect");
1216#if !defined(CO_OPTIMIZED)
1217 __Pyx_init_co_variable(inspect,
"CO_OPTIMIZED", &CO_OPTIMIZED) &&
1219#if !defined(CO_NEWLOCALS)
1220 __Pyx_init_co_variable(inspect,
"CO_NEWLOCALS", &CO_NEWLOCALS) &&
1222#if !defined(CO_VARARGS)
1223 __Pyx_init_co_variable(inspect,
"CO_VARARGS", &CO_VARARGS) &&
1225#if !defined(CO_VARKEYWORDS)
1226 __Pyx_init_co_variable(inspect,
"CO_VARKEYWORDS", &CO_VARKEYWORDS) &&
1228#if !defined(CO_ASYNC_GENERATOR)
1229 __Pyx_init_co_variable(inspect,
"CO_ASYNC_GENERATOR", &CO_ASYNC_GENERATOR) &&
1231#if !defined(CO_GENERATOR)
1232 __Pyx_init_co_variable(inspect,
"CO_GENERATOR", &CO_GENERATOR) &&
1234#if !defined(CO_COROUTINE)
1235 __Pyx_init_co_variable(inspect,
"CO_COROUTINE", &CO_COROUTINE) &&
1239 return result ? 0 : -1;
1241static int __Pyx_init_tpflags_bitcount(
unsigned long flag) {
1244 count += (int) (flag & 1);
1249static int __Pyx_init_tpflags_variables(
void) {
1250 if (__Pyx_Runtime_TPFLAGS_SEQUENCE != 0 && __Pyx_Runtime_TPFLAGS_MAPPING != 0) {
1253 PyObject *collections_abc = PyImport_ImportModule(
"collections.abc");
1254 if (!collections_abc)
return -1;
1256 PyObject *sequence = NULL, *mapping = NULL;
1257#if __PYX_LIMITED_VERSION_HEX >= 0x030D0000
1258 if (PyObject_GetOptionalAttrString(collections_abc,
"Sequence", &sequence) != 1)
goto fail;
1259 if (PyObject_GetOptionalAttrString(collections_abc,
"Mapping", &mapping) != 1)
goto fail;
1261 sequence = PyObject_GetAttrString(collections_abc,
"Sequence");
1262 if (!sequence)
goto fail_attr_lookup;
1263 mapping = PyObject_GetAttrString(collections_abc,
"Mapping");
1264 if (!mapping)
goto fail_attr_lookup;
1266 if (!PyType_Check(sequence) || !PyType_Check(mapping))
goto fail;
1268 unsigned long sequence_flags = PyType_GetFlags((PyTypeObject*)sequence);
1269 unsigned long mapping_flags = PyType_GetFlags((PyTypeObject*)mapping);
1270 unsigned long mutual_flags = sequence_flags & mapping_flags;
1271 sequence_flags = sequence_flags ^ mutual_flags;
1272 mapping_flags = mapping_flags ^ mutual_flags;
1273 if (__Pyx_Runtime_TPFLAGS_SEQUENCE == 0 && __Pyx_init_tpflags_bitcount(sequence_flags) == 1) {
1274 __Pyx_Runtime_TPFLAGS_SEQUENCE = sequence_flags;
1276 if (__Pyx_Runtime_TPFLAGS_MAPPING == 0 && __Pyx_init_tpflags_bitcount(mapping_flags) == 1) {
1277 __Pyx_Runtime_TPFLAGS_MAPPING = mapping_flags;
1281 Py_XDECREF(mapping);
1282 Py_XDECREF(sequence);
1283 Py_DECREF(collections_abc);
1285#if __PYX_LIMITED_VERSION_HEX < 0x030D0000
1287 if (PyErr_ExceptionMatches(PyExc_AttributeError)) {
1292 result = PyErr_Occurred() ? -1 : 0;
1296static int __Pyx_init_co_variables(
void) {
1299static int __Pyx_init_tpflags_variables(
void) {
1305#if defined(_WIN32) || defined(WIN32) || defined(MS_WINDOWS)
1306 #ifndef _USE_MATH_DEFINES
1307 #define _USE_MATH_DEFINES
1311#if defined(__CYGWIN__) && defined(_LDBL_EQ_DBL)
1312#define __Pyx_truncl trunc
1314#define __Pyx_truncl truncl
1317#ifndef CYTHON_CLINE_IN_TRACEBACK_RUNTIME
1318#define CYTHON_CLINE_IN_TRACEBACK_RUNTIME 1
1320#ifndef CYTHON_CLINE_IN_TRACEBACK
1321#define CYTHON_CLINE_IN_TRACEBACK CYTHON_CLINE_IN_TRACEBACK_RUNTIME
1323#if CYTHON_CLINE_IN_TRACEBACK
1324#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; }
1326#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; }
1328#define __PYX_ERR(f_index, lineno, Ln_error) \
1329 { __PYX_MARK_ERR_POS(f_index, lineno) goto Ln_error; }
1331#ifdef CYTHON_EXTERN_C
1332 #undef __PYX_EXTERN_C
1333 #define __PYX_EXTERN_C CYTHON_EXTERN_C
1334#elif defined(__PYX_EXTERN_C)
1336 #pragma message ("Please do not define the '__PYX_EXTERN_C' macro externally. Use 'CYTHON_EXTERN_C' instead.")
1338 #warning Please do not define the '__PYX_EXTERN_C' macro externally. Use 'CYTHON_EXTERN_C' instead.
1341 #define __PYX_EXTERN_C extern "C++"
1344#define __PYX_HAVE__cpskRelations
1345#define __PYX_HAVE_API__cpskRelations
1352#include "numpy/arrayobject.h"
1353#include "numpy/ndarrayobject.h"
1354#include "numpy/ndarraytypes.h"
1355#include "numpy/arrayscalars.h"
1356#include "numpy/ufuncobject.h"
1362#if defined(PYREX_WITHOUT_ASSERTIONS) && !defined(CYTHON_WITHOUT_ASSERTIONS)
1363#define CYTHON_WITHOUT_ASSERTIONS
1366#ifdef CYTHON_FREETHREADING_COMPATIBLE
1367#if CYTHON_FREETHREADING_COMPATIBLE
1368#define __Pyx_FREETHREADING_COMPATIBLE Py_MOD_GIL_NOT_USED
1370#define __Pyx_FREETHREADING_COMPATIBLE Py_MOD_GIL_USED
1373#define __Pyx_FREETHREADING_COMPATIBLE Py_MOD_GIL_USED
1375#define __PYX_DEFAULT_STRING_ENCODING_IS_ASCII 0
1376#define __PYX_DEFAULT_STRING_ENCODING_IS_UTF8 0
1377#define __PYX_DEFAULT_STRING_ENCODING ""
1378#define __Pyx_PyObject_FromString __Pyx_PyBytes_FromString
1379#define __Pyx_PyObject_FromStringAndSize __Pyx_PyBytes_FromStringAndSize
1380#define __Pyx_uchar_cast(c) ((unsigned char)c)
1381#define __Pyx_long_cast(x) ((long)x)
1382#define __Pyx_fits_Py_ssize_t(v, type, is_signed) (\
1383 (sizeof(type) < sizeof(Py_ssize_t)) ||\
1384 (sizeof(type) > sizeof(Py_ssize_t) &&\
1385 likely(v < (type)PY_SSIZE_T_MAX ||\
1386 v == (type)PY_SSIZE_T_MAX) &&\
1387 (!is_signed || likely(v > (type)PY_SSIZE_T_MIN ||\
1388 v == (type)PY_SSIZE_T_MIN))) ||\
1389 (sizeof(type) == sizeof(Py_ssize_t) &&\
1390 (is_signed || likely(v < (type)PY_SSIZE_T_MAX ||\
1391 v == (type)PY_SSIZE_T_MAX))) )
1392static CYTHON_INLINE
int __Pyx_is_valid_index(Py_ssize_t i, Py_ssize_t limit) {
1393 return (
size_t) i < (size_t) limit;
1395#if defined (__cplusplus) && __cplusplus >= 201103L
1397 #define __Pyx_sst_abs(value) std::abs(value)
1398#elif SIZEOF_INT >= SIZEOF_SIZE_T
1399 #define __Pyx_sst_abs(value) abs(value)
1400#elif SIZEOF_LONG >= SIZEOF_SIZE_T
1401 #define __Pyx_sst_abs(value) labs(value)
1402#elif defined (_MSC_VER)
1403 #define __Pyx_sst_abs(value) ((Py_ssize_t)_abs64(value))
1404#elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
1405 #define __Pyx_sst_abs(value) llabs(value)
1406#elif defined (__GNUC__)
1407 #define __Pyx_sst_abs(value) __builtin_llabs(value)
1409 #define __Pyx_sst_abs(value) ((value<0) ? -value : value)
1411static CYTHON_INLINE Py_ssize_t __Pyx_ssize_strlen(
const char *
s);
1412static CYTHON_INLINE
const char* __Pyx_PyObject_AsString(PyObject*);
1413static CYTHON_INLINE
const char* __Pyx_PyObject_AsStringAndSize(PyObject*, Py_ssize_t* length);
1414static CYTHON_INLINE PyObject* __Pyx_PyByteArray_FromString(
const char*);
1415#define __Pyx_PyByteArray_FromStringAndSize(s, l) PyByteArray_FromStringAndSize((const char*)s, l)
1416#define __Pyx_PyBytes_FromString PyBytes_FromString
1417#define __Pyx_PyBytes_FromStringAndSize PyBytes_FromStringAndSize
1418static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(
const char*);
1419#if CYTHON_ASSUME_SAFE_MACROS
1420 #define __Pyx_PyBytes_AsWritableString(s) ((char*) PyBytes_AS_STRING(s))
1421 #define __Pyx_PyBytes_AsWritableSString(s) ((signed char*) PyBytes_AS_STRING(s))
1422 #define __Pyx_PyBytes_AsWritableUString(s) ((unsigned char*) PyBytes_AS_STRING(s))
1423 #define __Pyx_PyBytes_AsString(s) ((const char*) PyBytes_AS_STRING(s))
1424 #define __Pyx_PyBytes_AsSString(s) ((const signed char*) PyBytes_AS_STRING(s))
1425 #define __Pyx_PyBytes_AsUString(s) ((const unsigned char*) PyBytes_AS_STRING(s))
1426 #define __Pyx_PyByteArray_AsString(s) PyByteArray_AS_STRING(s)
1428 #define __Pyx_PyBytes_AsWritableString(s) ((char*) PyBytes_AsString(s))
1429 #define __Pyx_PyBytes_AsWritableSString(s) ((signed char*) PyBytes_AsString(s))
1430 #define __Pyx_PyBytes_AsWritableUString(s) ((unsigned char*) PyBytes_AsString(s))
1431 #define __Pyx_PyBytes_AsString(s) ((const char*) PyBytes_AsString(s))
1432 #define __Pyx_PyBytes_AsSString(s) ((const signed char*) PyBytes_AsString(s))
1433 #define __Pyx_PyBytes_AsUString(s) ((const unsigned char*) PyBytes_AsString(s))
1434 #define __Pyx_PyByteArray_AsString(s) PyByteArray_AsString(s)
1436#define __Pyx_PyObject_AsWritableString(s) ((char*)(__pyx_uintptr_t) __Pyx_PyObject_AsString(s))
1437#define __Pyx_PyObject_AsWritableSString(s) ((signed char*)(__pyx_uintptr_t) __Pyx_PyObject_AsString(s))
1438#define __Pyx_PyObject_AsWritableUString(s) ((unsigned char*)(__pyx_uintptr_t) __Pyx_PyObject_AsString(s))
1439#define __Pyx_PyObject_AsSString(s) ((const signed char*) __Pyx_PyObject_AsString(s))
1440#define __Pyx_PyObject_AsUString(s) ((const unsigned char*) __Pyx_PyObject_AsString(s))
1441#define __Pyx_PyObject_FromCString(s) __Pyx_PyObject_FromString((const char*)s)
1442#define __Pyx_PyBytes_FromCString(s) __Pyx_PyBytes_FromString((const char*)s)
1443#define __Pyx_PyByteArray_FromCString(s) __Pyx_PyByteArray_FromString((const char*)s)
1444#define __Pyx_PyUnicode_FromCString(s) __Pyx_PyUnicode_FromString((const char*)s)
1445#define __Pyx_PyUnicode_FromOrdinal(o) PyUnicode_FromOrdinal((int)o)
1446#define __Pyx_PyUnicode_AsUnicode PyUnicode_AsUnicode
1447static CYTHON_INLINE PyObject *__Pyx_NewRef(PyObject *obj) {
1448#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030a0000 || defined(Py_NewRef)
1449 return Py_NewRef(obj);
1455static CYTHON_INLINE PyObject *__Pyx_XNewRef(PyObject *obj) {
1456#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030a0000 || defined(Py_XNewRef)
1457 return Py_XNewRef(obj);
1463static CYTHON_INLINE PyObject *__Pyx_Owned_Py_None(
int b);
1464static CYTHON_INLINE PyObject * __Pyx_PyBool_FromLong(
long b);
1465static CYTHON_INLINE
int __Pyx_PyObject_IsTrue(PyObject*);
1466static CYTHON_INLINE
int __Pyx_PyObject_IsTrueAndDecref(PyObject*);
1467static CYTHON_INLINE PyObject* __Pyx_PyNumber_Long(PyObject* x);
1468#define __Pyx_PyObject_RichCompareBool(a,b,cmp) __Pyx_PyObject_IsTrueAndDecref(PyObject_RichCompare((a),(b),(cmp)))
1469#define __Pyx_PySequence_Tuple(obj)\
1470 (likely(PyTuple_CheckExact(obj)) ? __Pyx_NewRef(obj) : PySequence_Tuple(obj))
1471static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject*);
1472static CYTHON_INLINE PyObject * __Pyx_PyLong_FromSize_t(
size_t);
1473static CYTHON_INLINE Py_hash_t __Pyx_PyIndex_AsHash_t(PyObject*);
1474#if CYTHON_ASSUME_SAFE_MACROS
1475#define __Pyx_PyFloat_AsDouble(x) (PyFloat_CheckExact(x) ? PyFloat_AS_DOUBLE(x) : PyFloat_AsDouble(x))
1476#define __Pyx_PyFloat_AS_DOUBLE(x) PyFloat_AS_DOUBLE(x)
1477#define __Pyx_PyFloat_IsNonZero(x) (PyFloat_AS_DOUBLE(x) != 0.0)
1479#define __Pyx_PyFloat_AsDouble(x) PyFloat_AsDouble(x)
1480#define __Pyx_PyFloat_AS_DOUBLE(x) PyFloat_AsDouble(x)
1481#define __Pyx_PyFloat_IsNonZero(x) PyObject_IsTrue(x)
1483#define __Pyx_PyFloat_AsFloat(x) ((float) __Pyx_PyFloat_AsDouble(x))
1484#define __Pyx_PyNumber_Int(x) (PyLong_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Long(x))
1485#if CYTHON_USE_PYLONG_INTERNALS
1486 #if PY_VERSION_HEX >= 0x030C00A7
1487 #ifndef _PyLong_SIGN_MASK
1488 #define _PyLong_SIGN_MASK 3
1490 #ifndef _PyLong_NON_SIZE_BITS
1491 #define _PyLong_NON_SIZE_BITS 3
1493 #define __Pyx_PyLong_SignBits(x) ((int) (((PyLongObject*)x)->long_value.lv_tag & _PyLong_SIGN_MASK))
1494 #define __Pyx_PyLong_Sign(x) (1 - __Pyx_PyLong_SignBits(x))
1495 #define __Pyx_PyLong_IsNeg(x) ((__Pyx_PyLong_SignBits(x) & 2) != 0)
1496 #define __Pyx_PyLong_IsNonNeg(x) (!__Pyx_PyLong_IsNeg(x))
1497 #define __Pyx_PyLong_IsZero(x) (__Pyx_PyLong_SignBits(x) & 1)
1498 #define __Pyx_PyLong_IsPos(x) (__Pyx_PyLong_SignBits(x) == 0)
1499 #define __Pyx_PyLong_CompactValueUnsigned(x) (__Pyx_PyLong_Digits(x)[0])
1500 #define __Pyx_PyLong_DigitCount(x) ((Py_ssize_t) (((PyLongObject*)x)->long_value.lv_tag >> _PyLong_NON_SIZE_BITS))
1501 #define __Pyx_PyLong_SignedDigitCount(x)\
1502 (((Py_ssize_t) __Pyx_PyLong_Sign(x)) * __Pyx_PyLong_DigitCount(x))
1503 #if defined(PyUnstable_Long_IsCompact) && defined(PyUnstable_Long_CompactValue)
1504 #define __Pyx_PyLong_IsCompact(x) PyUnstable_Long_IsCompact((PyLongObject*) x)
1505 #define __Pyx_PyLong_CompactValue(x) PyUnstable_Long_CompactValue((PyLongObject*) x)
1507 #define __Pyx_PyLong_IsCompact(x) (((PyLongObject*)x)->long_value.lv_tag < (2 << _PyLong_NON_SIZE_BITS))
1508 #define __Pyx_PyLong_CompactValue(x) (((Py_ssize_t) __Pyx_PyLong_Sign(x)) * (Py_ssize_t) __Pyx_PyLong_Digits(x)[0])
1510 static CYTHON_INLINE Py_ssize_t __Pyx_PyLong_CompareSignAndSize(PyObject *a, PyObject *b) {
1511 uintptr_t tag_a = ((PyLongObject*)a)->long_value.lv_tag;
1512 uintptr_t tag_b = ((PyLongObject*)b)->long_value.lv_tag;
1513 if (tag_a == tag_b)
return 0;
1514 int sign_a = (int) (tag_a & _PyLong_SIGN_MASK);
1515 int sign_b = (int) (tag_b & _PyLong_SIGN_MASK);
1516 if (sign_a > sign_b)
return -1;
1517 if (sign_a < sign_b)
return 1;
1518 Py_ssize_t size_a = (Py_ssize_t) (tag_a >> _PyLong_NON_SIZE_BITS);
1519 Py_ssize_t size_b = (Py_ssize_t) (tag_b >> _PyLong_NON_SIZE_BITS);
1520 return (1 - sign_a) * (size_a - size_b);
1522 typedef Py_ssize_t __Pyx_compact_pylong;
1523 typedef size_t __Pyx_compact_upylong;
1525 #define __Pyx_PyLong_Sign(x) ((int) ((Py_SIZE(x) == 0) ? 0 : (Py_SIZE(x) < 0) ? -1 : 1))
1526 #define __Pyx_PyLong_IsNeg(x) (Py_SIZE(x) < 0)
1527 #define __Pyx_PyLong_IsNonNeg(x) (Py_SIZE(x) >= 0)
1528 #define __Pyx_PyLong_IsZero(x) (Py_SIZE(x) == 0)
1529 #define __Pyx_PyLong_IsPos(x) (Py_SIZE(x) > 0)
1530 #define __Pyx_PyLong_CompactValueUnsigned(x) ((Py_SIZE(x) == 0) ? 0 : __Pyx_PyLong_Digits(x)[0])
1531 #define __Pyx_PyLong_DigitCount(x) __Pyx_sst_abs(Py_SIZE(x))
1532 #define __Pyx_PyLong_SignedDigitCount(x) Py_SIZE(x)
1533 #define __Pyx_PyLong_IsCompact(x) (Py_SIZE(x) == 0 || Py_SIZE(x) == 1 || Py_SIZE(x) == -1)
1534 #define __Pyx_PyLong_CompactValue(x)\
1535 ((Py_SIZE(x) == 0) ? (sdigit) 0 : ((Py_SIZE(x) < 0) ? -(sdigit)__Pyx_PyLong_Digits(x)[0] : (sdigit)__Pyx_PyLong_Digits(x)[0]))
1536 #define __Pyx_PyLong_CompareSignAndSize(a, b) (Py_SIZE(a) - Py_SIZE(b))
1537 typedef sdigit __Pyx_compact_pylong;
1538 typedef digit __Pyx_compact_upylong;
1540 #if PY_VERSION_HEX >= 0x030C00A5
1541 #define __Pyx_PyLong_Digits(x) (((PyLongObject*)x)->long_value.ob_digit)
1543 #define __Pyx_PyLong_Digits(x) (((PyLongObject*)x)->ob_digit)
1545 #define __Pyx_PyLong_IsNonZero(x) (!__Pyx_PyLong_IsZero(x))
1547 #define __Pyx_PyLong_IsNonZero(x) PyObject_IsTrue(x)
1549#if __PYX_DEFAULT_STRING_ENCODING_IS_UTF8
1550 #define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_DecodeUTF8(c_str, size, NULL)
1551#elif __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
1552 #define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_DecodeASCII(c_str, size, NULL)
1554 #define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_Decode(c_str, size, __PYX_DEFAULT_STRING_ENCODING, NULL)
1559#if defined(__GNUC__) && (__GNUC__ > 2 || (__GNUC__ == 2 && (__GNUC_MINOR__ > 95)))
1560 #define likely(x) __builtin_expect(!!(x), 1)
1561 #define unlikely(x) __builtin_expect(!!(x), 0)
1563 #define likely(x) (x)
1564 #define unlikely(x) (x)
1568#if __cplusplus > 201103L
1569#include <type_traits>
1571template <
typename T>
1572static void __Pyx_pretend_to_initialize(
T* ptr) {
1573#if __cplusplus > 201103L
1574 if ((std::is_trivially_default_constructible<T>::value))
1580static CYTHON_INLINE
void __Pyx_pretend_to_initialize(
void* ptr) { (void)ptr; }
1584#if !CYTHON_USE_MODULE_STATE
1585static PyObject *__pyx_m = NULL;
1587static const char *
const __pyx_cfilenm = __FILE__;
1590#if !defined(CYTHON_CCOMPLEX)
1591 #if defined(__cplusplus)
1592 #define CYTHON_CCOMPLEX 1
1593 #elif (defined(_Complex_I) && !defined(_MSC_VER)) || ((defined (__STDC_VERSION__) && __STDC_VERSION__ >= 201112L) && !defined(__STDC_NO_COMPLEX__) && !defined(_MSC_VER))
1594 #define CYTHON_CCOMPLEX 1
1596 #define CYTHON_CCOMPLEX 0
1603 #include <complex.h>
1606#if CYTHON_CCOMPLEX && !defined(__cplusplus) && defined(__sun__) && defined(__GNUC__)
1608 #define _Complex_I 1.0fj
1613static const char*
const __pyx_f[] = {
1614 "proteus/cpskRelations.pyx",
1615 "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd",
1620#include <pythread.h>
1621#ifndef CYTHON_ATOMICS
1622 #define CYTHON_ATOMICS 1
1624#define __PYX_CYTHON_ATOMICS_ENABLED() CYTHON_ATOMICS
1625#define __PYX_GET_CYTHON_COMPILING_IN_CPYTHON_FREETHREADING() CYTHON_COMPILING_IN_CPYTHON_FREETHREADING
1626#define __pyx_atomic_int_type int
1627#define __pyx_nonatomic_int_type int
1628#if CYTHON_ATOMICS && (defined(__STDC_VERSION__) &&\
1629 (__STDC_VERSION__ >= 201112L) &&\
1630 !defined(__STDC_NO_ATOMICS__))
1631 #include <stdatomic.h>
1632#elif CYTHON_ATOMICS && (defined(__cplusplus) && (\
1633 (__cplusplus >= 201103L) ||\
1634 (defined(_MSC_VER) && _MSC_VER >= 1700)))
1637#if CYTHON_ATOMICS && (defined(__STDC_VERSION__) &&\
1638 (__STDC_VERSION__ >= 201112L) &&\
1639 !defined(__STDC_NO_ATOMICS__) &&\
1640 ATOMIC_INT_LOCK_FREE == 2)
1641 #undef __pyx_atomic_int_type
1642 #define __pyx_atomic_int_type atomic_int
1643 #define __pyx_atomic_ptr_type atomic_uintptr_t
1644 #define __pyx_nonatomic_ptr_type uintptr_t
1645 #define __pyx_atomic_incr_relaxed(value) atomic_fetch_add_explicit(value, 1, memory_order_relaxed)
1646 #define __pyx_atomic_incr_acq_rel(value) atomic_fetch_add_explicit(value, 1, memory_order_acq_rel)
1647 #define __pyx_atomic_decr_acq_rel(value) atomic_fetch_sub_explicit(value, 1, memory_order_acq_rel)
1648 #define __pyx_atomic_sub(value, arg) atomic_fetch_sub(value, arg)
1649 #define __pyx_atomic_int_cmp_exchange(value, expected, desired) atomic_compare_exchange_strong(value, expected, desired)
1650 #define __pyx_atomic_load(value) atomic_load(value)
1651 #define __pyx_atomic_store(value, new_value) atomic_store(value, new_value)
1652 #define __pyx_atomic_pointer_load_relaxed(value) atomic_load_explicit(value, memory_order_relaxed)
1653 #define __pyx_atomic_pointer_load_acquire(value) atomic_load_explicit(value, memory_order_acquire)
1654 #define __pyx_atomic_pointer_exchange(value, new_value) atomic_exchange(value, (__pyx_nonatomic_ptr_type)new_value)
1655 #define __pyx_atomic_pointer_cmp_exchange(value, expected, desired) atomic_compare_exchange_strong(value, expected, desired)
1656 #if defined(__PYX_DEBUG_ATOMICS) && defined(_MSC_VER)
1657 #pragma message ("Using standard C atomics")
1658 #elif defined(__PYX_DEBUG_ATOMICS)
1659 #warning "Using standard C atomics"
1661#elif CYTHON_ATOMICS && (defined(__cplusplus) && (\
1662 (__cplusplus >= 201103L) ||\
1664 (defined(_MSC_VER) && _MSC_VER >= 1700)) &&\
1665 ATOMIC_INT_LOCK_FREE == 2)
1666 #undef __pyx_atomic_int_type
1667 #define __pyx_atomic_int_type std::atomic_int
1668 #define __pyx_atomic_ptr_type std::atomic_uintptr_t
1669 #define __pyx_nonatomic_ptr_type uintptr_t
1670 #define __pyx_atomic_incr_relaxed(value) std::atomic_fetch_add_explicit(value, 1, std::memory_order_relaxed)
1671 #define __pyx_atomic_incr_acq_rel(value) std::atomic_fetch_add_explicit(value, 1, std::memory_order_acq_rel)
1672 #define __pyx_atomic_decr_acq_rel(value) std::atomic_fetch_sub_explicit(value, 1, std::memory_order_acq_rel)
1673 #define __pyx_atomic_sub(value, arg) std::atomic_fetch_sub(value, arg)
1674 #define __pyx_atomic_int_cmp_exchange(value, expected, desired) std::atomic_compare_exchange_strong(value, expected, desired)
1675 #define __pyx_atomic_load(value) std::atomic_load(value)
1676 #define __pyx_atomic_store(value, new_value) std::atomic_store(value, new_value)
1677 #define __pyx_atomic_pointer_load_relaxed(value) std::atomic_load_explicit(value, std::memory_order_relaxed)
1678 #define __pyx_atomic_pointer_load_acquire(value) std::atomic_load_explicit(value, std::memory_order_acquire)
1679 #define __pyx_atomic_pointer_exchange(value, new_value) std::atomic_exchange(value, (__pyx_nonatomic_ptr_type)new_value)
1680 #define __pyx_atomic_pointer_cmp_exchange(value, expected, desired) std::atomic_compare_exchange_strong(value, expected, desired)
1681 #if defined(__PYX_DEBUG_ATOMICS) && defined(_MSC_VER)
1682 #pragma message ("Using standard C++ atomics")
1683 #elif defined(__PYX_DEBUG_ATOMICS)
1684 #warning "Using standard C++ atomics"
1686#elif CYTHON_ATOMICS && (__GNUC__ >= 5 || (__GNUC__ == 4 &&\
1687 (__GNUC_MINOR__ > 1 ||\
1688 (__GNUC_MINOR__ == 1 && __GNUC_PATCHLEVEL__ >= 2))))
1689 #define __pyx_atomic_ptr_type void*
1690 #define __pyx_nonatomic_ptr_type void*
1691 #define __pyx_atomic_incr_relaxed(value) __sync_fetch_and_add(value, 1)
1692 #define __pyx_atomic_incr_acq_rel(value) __sync_fetch_and_add(value, 1)
1693 #define __pyx_atomic_decr_acq_rel(value) __sync_fetch_and_sub(value, 1)
1694 #define __pyx_atomic_sub(value, arg) __sync_fetch_and_sub(value, arg)
1695 static CYTHON_INLINE
int __pyx_atomic_int_cmp_exchange(__pyx_atomic_int_type* value, __pyx_nonatomic_int_type* expected, __pyx_nonatomic_int_type desired) {
1696 __pyx_nonatomic_int_type old = __sync_val_compare_and_swap(value, *expected, desired);
1697 int result = old == *expected;
1701 #define __pyx_atomic_load(value) __sync_fetch_and_add(value, 0)
1702 #define __pyx_atomic_store(value, new_value) __sync_lock_test_and_set(value, new_value)
1703 #define __pyx_atomic_pointer_load_relaxed(value) __sync_fetch_and_add(value, 0)
1704 #define __pyx_atomic_pointer_load_acquire(value) __sync_fetch_and_add(value, 0)
1705 #define __pyx_atomic_pointer_exchange(value, new_value) __sync_lock_test_and_set(value, (__pyx_atomic_ptr_type)new_value)
1706 static CYTHON_INLINE
int __pyx_atomic_pointer_cmp_exchange(__pyx_atomic_ptr_type* value, __pyx_nonatomic_ptr_type* expected, __pyx_nonatomic_ptr_type desired) {
1707 __pyx_nonatomic_ptr_type old = __sync_val_compare_and_swap(value, *expected, desired);
1708 int result = old == *expected;
1712 #ifdef __PYX_DEBUG_ATOMICS
1713 #warning "Using GNU atomics"
1715#elif CYTHON_ATOMICS && defined(_MSC_VER)
1717 #undef __pyx_atomic_int_type
1718 #define __pyx_atomic_int_type long
1719 #define __pyx_atomic_ptr_type void*
1720 #undef __pyx_nonatomic_int_type
1721 #define __pyx_nonatomic_int_type long
1722 #define __pyx_nonatomic_ptr_type void*
1723 #pragma intrinsic (_InterlockedExchangeAdd, _InterlockedExchange, _InterlockedCompareExchange, _InterlockedCompareExchangePointer, _InterlockedExchangePointer)
1724 #define __pyx_atomic_incr_relaxed(value) _InterlockedExchangeAdd(value, 1)
1725 #define __pyx_atomic_incr_acq_rel(value) _InterlockedExchangeAdd(value, 1)
1726 #define __pyx_atomic_decr_acq_rel(value) _InterlockedExchangeAdd(value, -1)
1727 #define __pyx_atomic_sub(value, arg) _InterlockedExchangeAdd(value, -arg)
1728 static CYTHON_INLINE
int __pyx_atomic_int_cmp_exchange(__pyx_atomic_int_type* value, __pyx_nonatomic_int_type* expected, __pyx_nonatomic_int_type desired) {
1729 __pyx_nonatomic_int_type old = _InterlockedCompareExchange(value, desired, *expected);
1730 int result = old == *expected;
1734 #define __pyx_atomic_load(value) _InterlockedExchangeAdd(value, 0)
1735 #define __pyx_atomic_store(value, new_value) _InterlockedExchange(value, new_value)
1736 #define __pyx_atomic_pointer_load_relaxed(value) *(void * volatile *)value
1737 #define __pyx_atomic_pointer_load_acquire(value) _InterlockedCompareExchangePointer(value, 0, 0)
1738 #define __pyx_atomic_pointer_exchange(value, new_value) _InterlockedExchangePointer(value, (__pyx_atomic_ptr_type)new_value)
1739 static CYTHON_INLINE
int __pyx_atomic_pointer_cmp_exchange(__pyx_atomic_ptr_type* value, __pyx_nonatomic_ptr_type* expected, __pyx_nonatomic_ptr_type desired) {
1740 __pyx_atomic_ptr_type old = _InterlockedCompareExchangePointer(value, desired, *expected);
1741 int result = old == *expected;
1745 #ifdef __PYX_DEBUG_ATOMICS
1746 #pragma message ("Using MSVC atomics")
1749 #undef CYTHON_ATOMICS
1750 #define CYTHON_ATOMICS 0
1751 #ifdef __PYX_DEBUG_ATOMICS
1752 #warning "Not using atomics"
1757#if !CYTHON_COMPILING_IN_CPYTHON_FREETHREADING
1758#define __Pyx_PyCriticalSection void*
1759#define __Pyx_PyCriticalSection2 void*
1760#define __Pyx_PyCriticalSection_End(cs)
1761#define __Pyx_PyCriticalSection2_End(cs)
1763#define __Pyx_PyCriticalSection PyCriticalSection
1764#define __Pyx_PyCriticalSection2 PyCriticalSection2
1765#define __Pyx_PyCriticalSection_End PyCriticalSection_End
1766#define __Pyx_PyCriticalSection2_End PyCriticalSection2_End
1770#if !CYTHON_COMPILING_IN_CPYTHON_FREETHREADING
1771#define __Pyx_PyCriticalSection_Begin(cs, arg) (void)(cs)
1772#define __Pyx_PyCriticalSection2_Begin(cs, arg1, arg2) (void)(cs)
1774#define __Pyx_PyCriticalSection_Begin PyCriticalSection_Begin
1775#define __Pyx_PyCriticalSection2_Begin PyCriticalSection2_Begin
1777#if PY_VERSION_HEX < 0x030d0000 || CYTHON_COMPILING_IN_LIMITED_API
1778#define __Pyx_BEGIN_CRITICAL_SECTION(o) {
1779#define __Pyx_END_CRITICAL_SECTION() }
1781#define __Pyx_BEGIN_CRITICAL_SECTION Py_BEGIN_CRITICAL_SECTION
1782#define __Pyx_END_CRITICAL_SECTION Py_END_CRITICAL_SECTION
1786#include <structmember.h>
1797typedef npy_int8 __pyx_t_5numpy_int8_t;
1806typedef npy_int16 __pyx_t_5numpy_int16_t;
1815typedef npy_int32 __pyx_t_5numpy_int32_t;
1824typedef npy_int64 __pyx_t_5numpy_int64_t;
1833typedef npy_uint8 __pyx_t_5numpy_uint8_t;
1842typedef npy_uint16 __pyx_t_5numpy_uint16_t;
1851typedef npy_uint32 __pyx_t_5numpy_uint32_t;
1860typedef npy_uint64 __pyx_t_5numpy_uint64_t;
1869typedef npy_float32 __pyx_t_5numpy_float32_t;
1878typedef npy_float64 __pyx_t_5numpy_float64_t;
1887typedef npy_longlong __pyx_t_5numpy_longlong_t;
1896typedef npy_ulonglong __pyx_t_5numpy_ulonglong_t;
1905typedef npy_intp __pyx_t_5numpy_intp_t;
1914typedef npy_uintp __pyx_t_5numpy_uintp_t;
1923typedef npy_double __pyx_t_5numpy_float_t;
1932typedef npy_double __pyx_t_5numpy_double_t;
1941typedef npy_longdouble __pyx_t_5numpy_longdouble_t;
1944#if CYTHON_CCOMPLEX && (1) && (!0 || __cplusplus)
1946 typedef ::std::complex< float > __pyx_t_float_complex;
1948 typedef float _Complex __pyx_t_float_complex;
1951 typedef struct {
float real, imag; } __pyx_t_float_complex;
1953static CYTHON_INLINE __pyx_t_float_complex __pyx_t_float_complex_from_parts(
float,
float);
1956#if CYTHON_CCOMPLEX && (1) && (!0 || __cplusplus)
1958 typedef ::std::complex< double > __pyx_t_double_complex;
1960 typedef double _Complex __pyx_t_double_complex;
1963 typedef struct {
double real, imag; } __pyx_t_double_complex;
1965static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(
double,
double);
1968#if CYTHON_CCOMPLEX && (1) && (!0 || __cplusplus)
1970 typedef ::std::complex< long double > __pyx_t_long_double_complex;
1972 typedef long double _Complex __pyx_t_long_double_complex;
1975 typedef struct {
long double real, imag; } __pyx_t_long_double_complex;
1977static CYTHON_INLINE __pyx_t_long_double_complex __pyx_t_long_double_complex_from_parts(
long double,
long double);
1986#ifndef CYTHON_REFNANNY
1987 #define CYTHON_REFNANNY 0
1991 void (*INCREF)(
void*, PyObject*, Py_ssize_t);
1992 void (*DECREF)(
void*, PyObject*, Py_ssize_t);
1993 void (*GOTREF)(
void*, PyObject*, Py_ssize_t);
1994 void (*GIVEREF)(
void*, PyObject*, Py_ssize_t);
1995 void* (*SetupContext)(
const char*, Py_ssize_t,
const char*);
1996 void (*FinishContext)(
void**);
1997 } __Pyx_RefNannyAPIStruct;
1998 static __Pyx_RefNannyAPIStruct *__Pyx_RefNanny = NULL;
1999 static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(
const char *modname);
2000 #define __Pyx_RefNannyDeclarations void *__pyx_refnanny = NULL;
2001 #define __Pyx_RefNannySetupContext(name, acquire_gil)\
2003 PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();\
2004 __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), (__LINE__), (__FILE__));\
2005 PyGILState_Release(__pyx_gilstate_save);\
2007 __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), (__LINE__), (__FILE__));\
2009 #define __Pyx_RefNannyFinishContextNogil() {\
2010 PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();\
2011 __Pyx_RefNannyFinishContext();\
2012 PyGILState_Release(__pyx_gilstate_save);\
2014 #define __Pyx_RefNannyFinishContextNogil() {\
2015 PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();\
2016 __Pyx_RefNannyFinishContext();\
2017 PyGILState_Release(__pyx_gilstate_save);\
2019 #define __Pyx_RefNannyFinishContext()\
2020 __Pyx_RefNanny->FinishContext(&__pyx_refnanny)
2021 #define __Pyx_INCREF(r) __Pyx_RefNanny->INCREF(__pyx_refnanny, (PyObject *)(r), (__LINE__))
2022 #define __Pyx_DECREF(r) __Pyx_RefNanny->DECREF(__pyx_refnanny, (PyObject *)(r), (__LINE__))
2023 #define __Pyx_GOTREF(r) __Pyx_RefNanny->GOTREF(__pyx_refnanny, (PyObject *)(r), (__LINE__))
2024 #define __Pyx_GIVEREF(r) __Pyx_RefNanny->GIVEREF(__pyx_refnanny, (PyObject *)(r), (__LINE__))
2025 #define __Pyx_XINCREF(r) do { if((r) == NULL); else {__Pyx_INCREF(r); }} while(0)
2026 #define __Pyx_XDECREF(r) do { if((r) == NULL); else {__Pyx_DECREF(r); }} while(0)
2027 #define __Pyx_XGOTREF(r) do { if((r) == NULL); else {__Pyx_GOTREF(r); }} while(0)
2028 #define __Pyx_XGIVEREF(r) do { if((r) == NULL); else {__Pyx_GIVEREF(r);}} while(0)
2030 #define __Pyx_RefNannyDeclarations
2031 #define __Pyx_RefNannySetupContext(name, acquire_gil)
2032 #define __Pyx_RefNannyFinishContextNogil()
2033 #define __Pyx_RefNannyFinishContext()
2034 #define __Pyx_INCREF(r) Py_INCREF(r)
2035 #define __Pyx_DECREF(r) Py_DECREF(r)
2036 #define __Pyx_GOTREF(r)
2037 #define __Pyx_GIVEREF(r)
2038 #define __Pyx_XINCREF(r) Py_XINCREF(r)
2039 #define __Pyx_XDECREF(r) Py_XDECREF(r)
2040 #define __Pyx_XGOTREF(r)
2041 #define __Pyx_XGIVEREF(r)
2043#define __Pyx_Py_XDECREF_SET(r, v) do {\
2044 PyObject *tmp = (PyObject *) r;\
2045 r = v; Py_XDECREF(tmp);\
2047#define __Pyx_XDECREF_SET(r, v) do {\
2048 PyObject *tmp = (PyObject *) r;\
2049 r = v; __Pyx_XDECREF(tmp);\
2051#define __Pyx_DECREF_SET(r, v) do {\
2052 PyObject *tmp = (PyObject *) r;\
2053 r = v; __Pyx_DECREF(tmp);\
2055#define __Pyx_CLEAR(r) do { PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);} while(0)
2056#define __Pyx_XCLEAR(r) do { if((r) != NULL) {PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);}} while(0)
2059#if CYTHON_USE_EXC_INFO_STACK && CYTHON_FAST_THREAD_STATE
2060static _PyErr_StackItem * __Pyx_PyErr_GetTopmostException(PyThreadState *tstate);
2064#if CYTHON_FAST_THREAD_STATE
2065#define __Pyx_PyThreadState_declare PyThreadState *__pyx_tstate;
2066#define __Pyx_PyThreadState_assign __pyx_tstate = __Pyx_PyThreadState_Current;
2067#if PY_VERSION_HEX >= 0x030C00A6
2068#define __Pyx_PyErr_Occurred() (__pyx_tstate->current_exception != NULL)
2069#define __Pyx_PyErr_CurrentExceptionType() (__pyx_tstate->current_exception ? (PyObject*) Py_TYPE(__pyx_tstate->current_exception) : (PyObject*) NULL)
2071#define __Pyx_PyErr_Occurred() (__pyx_tstate->curexc_type != NULL)
2072#define __Pyx_PyErr_CurrentExceptionType() (__pyx_tstate->curexc_type)
2075#define __Pyx_PyThreadState_declare
2076#define __Pyx_PyThreadState_assign
2077#define __Pyx_PyErr_Occurred() (PyErr_Occurred() != NULL)
2078#define __Pyx_PyErr_CurrentExceptionType() PyErr_Occurred()
2082#if CYTHON_FAST_THREAD_STATE
2083#define __Pyx_ExceptionSave(type, value, tb) __Pyx__ExceptionSave(__pyx_tstate, type, value, tb)
2084static CYTHON_INLINE
void __Pyx__ExceptionSave(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb);
2085#define __Pyx_ExceptionReset(type, value, tb) __Pyx__ExceptionReset(__pyx_tstate, type, value, tb)
2086static CYTHON_INLINE
void __Pyx__ExceptionReset(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb);
2088#define __Pyx_ExceptionSave(type, value, tb) PyErr_GetExcInfo(type, value, tb)
2089#define __Pyx_ExceptionReset(type, value, tb) PyErr_SetExcInfo(type, value, tb)
2093#if CYTHON_COMPILING_IN_CPYTHON
2094#define __Pyx_TypeCheck(obj, type) __Pyx_IsSubtype(Py_TYPE(obj), (PyTypeObject *)type)
2095#define __Pyx_TypeCheck2(obj, type1, type2) __Pyx_IsAnySubtype2(Py_TYPE(obj), (PyTypeObject *)type1, (PyTypeObject *)type2)
2096static CYTHON_INLINE
int __Pyx_IsSubtype(PyTypeObject *a, PyTypeObject *b);
2097static CYTHON_INLINE
int __Pyx_IsAnySubtype2(PyTypeObject *cls, PyTypeObject *a, PyTypeObject *b);
2098#define __Pyx_PyAnySet_Check(obj) __Pyx_TypeCheck2(obj, &PySet_Type, &PyFrozenSet_Type)
2100#define __Pyx_TypeCheck(obj, type) PyObject_TypeCheck(obj, (PyTypeObject *)type)
2101#define __Pyx_TypeCheck2(obj, type1, type2) (PyObject_TypeCheck(obj, (PyTypeObject *)type1) || PyObject_TypeCheck(obj, (PyTypeObject *)type2))
2102#define __Pyx_PyAnySet_Check(obj) PyAnySet_Check(obj)
2106#define __Pyx_PyExc_Exception_Check(obj) __Pyx_TypeCheck(obj, PyExc_Exception)
2109#if CYTHON_FAST_THREAD_STATE
2110#define __Pyx_PyErr_Clear() __Pyx_ErrRestore(NULL, NULL, NULL)
2111#define __Pyx_ErrRestoreWithState(type, value, tb) __Pyx_ErrRestoreInState(PyThreadState_GET(), type, value, tb)
2112#define __Pyx_ErrFetchWithState(type, value, tb) __Pyx_ErrFetchInState(PyThreadState_GET(), type, value, tb)
2113#define __Pyx_ErrRestore(type, value, tb) __Pyx_ErrRestoreInState(__pyx_tstate, type, value, tb)
2114#define __Pyx_ErrFetch(type, value, tb) __Pyx_ErrFetchInState(__pyx_tstate, type, value, tb)
2115static CYTHON_INLINE
void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb);
2116static CYTHON_INLINE
void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb);
2117#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030C00A6
2118#define __Pyx_PyErr_SetNone(exc) (Py_INCREF(exc), __Pyx_ErrRestore((exc), NULL, NULL))
2120#define __Pyx_PyErr_SetNone(exc) PyErr_SetNone(exc)
2123#define __Pyx_PyErr_Clear() PyErr_Clear()
2124#define __Pyx_PyErr_SetNone(exc) PyErr_SetNone(exc)
2125#define __Pyx_ErrRestoreWithState(type, value, tb) PyErr_Restore(type, value, tb)
2126#define __Pyx_ErrFetchWithState(type, value, tb) PyErr_Fetch(type, value, tb)
2127#define __Pyx_ErrRestoreInState(tstate, type, value, tb) PyErr_Restore(type, value, tb)
2128#define __Pyx_ErrFetchInState(tstate, type, value, tb) PyErr_Fetch(type, value, tb)
2129#define __Pyx_ErrRestore(type, value, tb) PyErr_Restore(type, value, tb)
2130#define __Pyx_ErrFetch(type, value, tb) PyErr_Fetch(type, value, tb)
2134#if CYTHON_COMPILING_IN_CPYTHON
2135static CYTHON_INLINE
int __Pyx_PyErr_GivenExceptionMatches(PyObject *err, PyObject *type);
2136static CYTHON_INLINE
int __Pyx_PyErr_GivenExceptionMatches2(PyObject *err, PyObject *type1, PyObject *type2);
2138#define __Pyx_PyErr_GivenExceptionMatches(err, type) PyErr_GivenExceptionMatches(err, type)
2139static CYTHON_INLINE
int __Pyx_PyErr_GivenExceptionMatches2(PyObject *err, PyObject *type1, PyObject *type2) {
2140 return PyErr_GivenExceptionMatches(err, type1) || PyErr_GivenExceptionMatches(err, type2);
2143#define __Pyx_PyErr_ExceptionMatches2(err1, err2) __Pyx_PyErr_GivenExceptionMatches2(__Pyx_PyErr_CurrentExceptionType(), err1, err2)
2146#if CYTHON_FAST_THREAD_STATE
2147#define __Pyx_PyErr_ExceptionMatches(err) __Pyx_PyErr_ExceptionMatchesInState(__pyx_tstate, err)
2148static CYTHON_INLINE
int __Pyx_PyErr_ExceptionMatchesInState(PyThreadState* tstate, PyObject* err);
2150#define __Pyx_PyErr_ExceptionMatches(err) PyErr_ExceptionMatches(err)
2154#if CYTHON_FAST_THREAD_STATE
2155#define __Pyx_GetException(type, value, tb) __Pyx__GetException(__pyx_tstate, type, value, tb)
2156static int __Pyx__GetException(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb);
2158static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb);
2162#define __Pyx_PyExc_ImportError_Check(obj) __Pyx_TypeCheck(obj, PyExc_ImportError)
2165#if CYTHON_COMPILING_IN_CPYTHON
2166static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw);
2168#define __Pyx_PyObject_Call(func, arg, kw) PyObject_Call(func, arg, kw)
2172#if CYTHON_COMPILING_IN_CPYTHON
2173static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg);
2177#define __Pyx_PyObject_FastCall(func, args, nargs) __Pyx_PyObject_FastCallDict(func, args, (size_t)(nargs), NULL)
2178static CYTHON_INLINE PyObject* __Pyx_PyObject_FastCallDict(PyObject *func, PyObject *
const*args,
size_t nargsf, PyObject *kwargs);
2181static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause);
2184#if CYTHON_COMPILING_IN_CPYTHON
2185static CYTHON_INLINE
void __Pyx_copy_object_array(PyObject *
const *CYTHON_RESTRICT src, PyObject** CYTHON_RESTRICT dest, Py_ssize_t length);
2189#if PY_VERSION_HEX >= 0x030F0000 && !CYTHON_COMPILING_IN_LIMITED_API
2190#define __Pyx_PyTuple_FromArray(src, n) PyTuple_FromArray(src, ((n)<0) ? 0 : (n))
2192CYTHON_UNUSED
static PyObject *
2193__Pyx_PyTuple_FromArray(PyObject *
const *src, Py_ssize_t
n);
2203static CYTHON_INLINE
int __Pyx_PyObject_CompareBoolEq_str_str(PyObject *op1, PyObject *op2,
int pyop);
2206#define __Pyx_PyUnicode_Equals(s1, s2) __Pyx_PyObject_CompareBoolEq_str_str(s1, s2, Py_EQ)
2209#if CYTHON_AVOID_BORROWED_REFS
2210 #define __Pyx_ArgRef_VARARGS(args, i) __Pyx_PySequence_ITEM(args, i)
2211#elif CYTHON_ASSUME_SAFE_MACROS
2212 #define __Pyx_ArgRef_VARARGS(args, i) __Pyx_NewRef(__Pyx_PyTuple_GET_ITEM(args, i))
2214 #define __Pyx_ArgRef_VARARGS(args, i) __Pyx_XNewRef(PyTuple_GetItem(args, i))
2216#define __Pyx_NumKwargs_VARARGS(kwds) PyDict_Size(kwds)
2217#define __Pyx_KwValues_VARARGS(args, nargs) NULL
2218#define __Pyx_GetKwValue_VARARGS(kw, kwvalues, s) __Pyx_PyDict_GetItemStrWithError(kw, s)
2219#define __Pyx_KwargsAsDict_VARARGS(kw, kwvalues) PyDict_Copy(kw)
2220#if CYTHON_VECTORCALL
2221 #define __Pyx_ArgRef_FASTCALL(args, i) __Pyx_NewRef(args[i])
2222 #define __Pyx_NumKwargs_FASTCALL(kwds) __Pyx_PyTuple_GET_SIZE(kwds)
2223 #define __Pyx_KwValues_FASTCALL(args, nargs) ((args) + (nargs))
2224 static CYTHON_INLINE PyObject * __Pyx_GetKwValue_FASTCALL(PyObject *kwnames, PyObject *
const *kwvalues, PyObject *
s);
2225 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030d0000 || CYTHON_COMPILING_IN_LIMITED_API || CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_GRAAL
2226 CYTHON_UNUSED
static PyObject *__Pyx_KwargsAsDict_FASTCALL(PyObject *kwnames, PyObject *
const *kwvalues);
2228 #define __Pyx_KwargsAsDict_FASTCALL(kw, kwvalues) _PyStack_AsDict(kwvalues, kw)
2231 #define __Pyx_ArgRef_FASTCALL __Pyx_ArgRef_VARARGS
2232 #define __Pyx_NumKwargs_FASTCALL __Pyx_NumKwargs_VARARGS
2233 #define __Pyx_KwValues_FASTCALL __Pyx_KwValues_VARARGS
2234 #define __Pyx_GetKwValue_FASTCALL __Pyx_GetKwValue_VARARGS
2235 #define __Pyx_KwargsAsDict_FASTCALL __Pyx_KwargsAsDict_VARARGS
2237#if CYTHON_VECTORCALL_TPNEW
2238 #if !CYTHON_VECTORCALL
2239 #error Enabling CYTHON_VECTORCALL_TPNEW without CYTHON_VECTORCALL is not supported
2241 #define __Pyx_ArgRef_FASTCALL_TPNEW __Pyx_ArgRef_FASTCALL
2242 #define __Pyx_NumKwargs_FASTCALL_TPNEW __Pyx_NumKwargs_FASTCALL
2243 #define __Pyx_KwValues_FASTCALL_TPNEW __Pyx_KwValues_FASTCALL
2244 #define __Pyx_GetKwValue_FASTCALL_TPNEW __Pyx_GetKwValue_FASTCALL
2245 #define __Pyx_KwargsAsDict_FASTCALL_TPNEW __Pyx_KwargsAsDict_FASTCALL
2247 #define __Pyx_ArgRef_FASTCALL_TPNEW __Pyx_ArgRef_VARARGS
2248 #define __Pyx_NumKwargs_FASTCALL_TPNEW __Pyx_NumKwargs_VARARGS
2249 #define __Pyx_KwValues_FASTCALL_TPNEW __Pyx_KwValues_VARARGS
2250 #define __Pyx_GetKwValue_FASTCALL_TPNEW __Pyx_GetKwValue_VARARGS
2251 #define __Pyx_KwargsAsDict_FASTCALL_TPNEW __Pyx_KwargsAsDict_VARARGS
2253#define __Pyx_ArgsSlice_VARARGS(args, start, stop) PyTuple_GetSlice(args, start, stop)
2254#if CYTHON_VECTORCALL
2255#define __Pyx_ArgsSlice_FASTCALL(args, start, stop) __Pyx_PyTuple_FromArray(args + start, stop - start)
2257#define __Pyx_ArgsSlice_FASTCALL __Pyx_ArgsSlice_VARARGS
2261#define __Pyx_PyDict_items_TypePtr (&PyDictKeys_Type)
2262#define __Pyx_PyDict_items_Check(obj) PyObject_TypeCheck((obj), __Pyx_PyDictItems_TypePtr)
2263#define __Pyx_PyDict_items_CheckExact(obj) Py_IS_TYPE((obj), __Pyx_PyDictItems_TypePtr)
2264static CYTHON_INLINE PyObject* __Pyx_PyDict_Items(PyObject* d);
2267#define __Pyx_CallCFunction(cfunc, self, args)\
2268 ((PyCFunction)(void(*)(void))(cfunc)->func)(self, args)
2269#define __Pyx_CallCFunctionWithKeywords(cfunc, self, args, kwargs)\
2270 ((PyCFunctionWithKeywords)(void(*)(void))(cfunc)->func)(self, args, kwargs)
2271#define __Pyx_CallCFunctionFast(cfunc, self, args, nargs)\
2272 ((__Pyx_PyCFunctionFast)(void(*)(void))(PyCFunction)(cfunc)->func)(self, args, nargs)
2273#define __Pyx_CallCFunctionFastWithKeywords(cfunc, self, args, nargs, kwnames)\
2274 ((__Pyx_PyCFunctionFastWithKeywords)(void(*)(void))(PyCFunction)(cfunc)->func)(self, args, nargs, kwnames)
2277static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg);
2282 PyObject **method_name;
2286#if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING && CYTHON_ATOMICS
2287 __pyx_atomic_int_type initialized;
2289} __Pyx_CachedCFunction;
2292static CYTHON_INLINE
int __Pyx_IgnoreGivenException(PyObject *given_exception, PyObject *ignorable_exception);
2293#define __Pyx_IgnoreException(ignorable_exception) __Pyx_IgnoreGivenException(NULL, ignorable_exception)
2296#if CYTHON_USE_TYPE_SLOTS
2297static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name);
2299#define __Pyx_PyObject_GetAttrStr(o,n) PyObject_GetAttr(o,n)
2303static int __Pyx_TryUnpackUnboundCMethod(__Pyx_CachedCFunction* target);
2306#if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING
2307static CYTHON_INLINE
int __Pyx_CachedCFunction_GetAndSetInitializing(__Pyx_CachedCFunction *cfunc) {
2311 __pyx_nonatomic_int_type expected = 0;
2312 if (__pyx_atomic_int_cmp_exchange(&cfunc->initialized, &expected, 1)) {
2318static CYTHON_INLINE
void __Pyx_CachedCFunction_SetFinishedInitializing(__Pyx_CachedCFunction *cfunc) {
2320 __pyx_atomic_store(&cfunc->initialized, 2);
2324#define __Pyx_CachedCFunction_GetAndSetInitializing(cfunc) 2
2325#define __Pyx_CachedCFunction_SetFinishedInitializing(cfunc)
2330static PyObject* __Pyx__CallUnboundCMethod0(__Pyx_CachedCFunction* cfunc, PyObject* self);
2331#if CYTHON_COMPILING_IN_CPYTHON
2332static CYTHON_INLINE PyObject* __Pyx_CallUnboundCMethod0(__Pyx_CachedCFunction* cfunc, PyObject* self);
2334#define __Pyx_CallUnboundCMethod0(cfunc, self) __Pyx__CallUnboundCMethod0(cfunc, self)
2338#define __Pyx_PyDict_values_TypePtr (&PyDictKeys_Type)
2339#define __Pyx_PyDict_values_Check(obj) PyObject_TypeCheck((obj), __Pyx_PyDictValues_TypePtr)
2340#define __Pyx_PyDict_values_CheckExact(obj) Py_IS_TYPE((obj), __Pyx_PyDictValues_TypePtr)
2341static CYTHON_INLINE PyObject* __Pyx_PyDict_Values(PyObject* d);
2344#if CYTHON_AVOID_BORROWED_REFS
2345static int __Pyx_PyDict_NextRef(PyObject *p, PyObject **ppos, PyObject **pkey, PyObject **pvalue);
2348static int __Pyx_PyDict_NextRef(PyObject *p, Py_ssize_t *ppos, PyObject **pkey, PyObject **pvalue);
2352static void __Pyx_RaiseDoubleKeywordsError(
const char* func_name, PyObject* kw_name);
2355static int __Pyx_ParseKeywordsTuple(
2357 PyObject *
const *kwvalues,
2358 PyObject **
const argnames[],
2361 Py_ssize_t num_pos_args,
2362 Py_ssize_t num_kwargs,
2363 const char* function_name,
2364 int ignore_unknown_kwargs
2366static int __Pyx_ParseKeywordDictToDict(
2368 PyObject **
const argnames[],
2371 Py_ssize_t num_pos_args,
2372 const char* function_name
2374static int __Pyx_ParseKeywordDict(
2376 PyObject **
const argnames[],
2378 Py_ssize_t num_pos_args,
2379 Py_ssize_t num_kwargs,
2380 const char* function_name,
2381 int ignore_unknown_kwargs
2386static PyObject* __Pyx__CallUnboundCMethod2(__Pyx_CachedCFunction* cfunc, PyObject* self, PyObject* arg1, PyObject* arg2);
2387#if CYTHON_COMPILING_IN_CPYTHON
2388static CYTHON_INLINE PyObject *__Pyx_CallUnboundCMethod2(__Pyx_CachedCFunction *cfunc, PyObject *self, PyObject *arg1, PyObject *arg2);
2390#define __Pyx_CallUnboundCMethod2(cfunc, self, arg1, arg2) __Pyx__CallUnboundCMethod2(cfunc, self, arg1, arg2)
2394static CYTHON_INLINE
int __Pyx_ParseKeywords(
2395 PyObject *kwds, PyObject *
const *kwvalues, PyObject **
const argnames[],
2396 PyObject *kwds2, PyObject *values[],
2397 Py_ssize_t num_pos_args, Py_ssize_t num_kwargs,
2398 const char* function_name,
2399 int ignore_unknown_kwargs
2403static void __Pyx_RaiseArgtupleInvalid(
const char* func_name,
int exact,
2404 Py_ssize_t num_min, Py_ssize_t num_max, Py_ssize_t num_found);
2407#ifndef __PYX_HAVE_RT_ImportType_proto_3_3_0
2408#define __PYX_HAVE_RT_ImportType_proto_3_3_0
2409#if defined (__STDC_VERSION__) && __STDC_VERSION__ >= 201112L
2410#include <stdalign.h>
2412#if (defined (__STDC_VERSION__) && __STDC_VERSION__ >= 201112L) || __cplusplus >= 201103L
2413#define __PYX_GET_STRUCT_ALIGNMENT_3_3_0(s) alignof(s)
2415#define __PYX_GET_STRUCT_ALIGNMENT_3_3_0(s) sizeof(void*)
2417enum __Pyx_ImportType_CheckSize_3_3_0 {
2418 __Pyx_ImportType_CheckSize_Error_3_3_0 = 0,
2419 __Pyx_ImportType_CheckSize_Warn_3_3_0 = 1,
2420 __Pyx_ImportType_CheckSize_Ignore_3_3_0 = 2
2422static 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);
2426static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStrNoError(PyObject* obj, PyObject* attr_name);
2429#if __PYX_LIMITED_VERSION_HEX >= 0x030d0000
2430#define __Pyx_HasAttr(o, n) PyObject_HasAttrWithError(o, n)
2432static CYTHON_INLINE
int __Pyx_HasAttr(PyObject *, PyObject *);
2436CYTHON_UNUSED
static PyObject *
2437__Pyx_PyList_FromArray(PyObject *
const *src, Py_ssize_t
n);
2443static PyObject *__Pyx__Import(PyObject *name, PyObject *
const *imported_names, Py_ssize_t len_imported_names, PyObject *qualname, PyObject *moddict,
int level);
2446static CYTHON_INLINE PyObject *__Pyx_Import(PyObject *name, PyObject *
const *imported_names, Py_ssize_t len_imported_names, PyObject *qualname,
int level);
2449static CYTHON_INLINE PyObject *__Pyx_PyDict_SetDefault(PyObject *d, PyObject *key, PyObject *default_value);
2452#if ((CYTHON_COMPILING_IN_CPYTHON_FREETHREADING && PY_VERSION_HEX < 0x030F00a3) ||\
2453 __PYX_LIMITED_VERSION_HEX < 0x030d0000)
2454 static PyObject *__Pyx_PyImport_AddModuleRef(
const char *name);
2456 #define __Pyx_PyImport_AddModuleRef(name) PyImport_AddModuleRef(name)
2460static PyObject *__Pyx_FetchSharedCythonABIModule(
void);
2463static int __Pyx_VerifyCachedType(PyObject *cached_type,
2465 Py_ssize_t expected_basicsize);
2468static PyTypeObject* __Pyx_FetchCommonTypeFromSpec(PyTypeObject *metaclass, PyObject *module, PyType_Spec *spec, PyObject *bases);
2471static int __pyx_CommonTypesMetaclass_init(PyObject *module);
2472#define __Pyx_CommonTypesMetaclass_USED
2475#define __Pyx_CyFunction_USED
2476#if CYTHON_OPAQUE_SHARED_TYPES
2477#define __Pyx_as_CyFunctionObject(o) ((__pyx_CyFunctionObject *)PyObject_GetTypeData((o), __pyx_mstate_global->__pyx_CyFunctionType))
2479#define __Pyx_as_CyFunctionObject(o) ((__pyx_CyFunctionObject *)o)
2481#define __Pyx_CYFUNCTION_STATICMETHOD 0x01
2482#define __Pyx_CYFUNCTION_CLASSMETHOD 0x02
2483#define __Pyx_CYFUNCTION_CCLASS 0x04
2484#define __Pyx_CYFUNCTION_COROUTINE 0x08
2485#define __Pyx_CyFunction_GetClosure(f)\
2486 ((__Pyx_as_CyFunctionObject(f))->func_closure)
2487#if CYTHON_COMPILING_IN_LIMITED_API
2488 #define __Pyx__CyFunction_GetClassObj(f)\
2489 ((f)->func_classobj)
2491 #define __Pyx__CyFunction_GetClassObj(f)\
2492 ((PyObject*) ((PyCMethodObject *) (f))->mm_class)
2494#define __Pyx_CyFunction_GetClassObj(f)\
2495 __Pyx__CyFunction_GetClassObj(__Pyx_as_CyFunctionObject(f))
2496#define __Pyx_CyFunction_SetClassObj(f, classobj)\
2497 __Pyx__CyFunction_SetClassObj(__Pyx_as_CyFunctionObject(f), (classobj))
2498#define __Pyx_CyFunction_Defaults(type, f)\
2499 ((type *)((__Pyx_as_CyFunctionObject(f))->defaults))
2500#define __Pyx_CyFunction_SetDefaultsGetter(f, g)\
2501 (__Pyx_as_CyFunctionObject(f))->defaults_getter = (g)
2503#if CYTHON_COMPILING_IN_LIMITED_API
2504#if !CYTHON_OPAQUE_OBJECTS
2507 PyMethodDef *func_methoddef;
2508 PyObject *func_module;
2510 PyCMethodObject func;
2512#if (CYTHON_COMPILING_IN_LIMITED_API || CYTHON_COMPILING_IN_PYPY) && CYTHON_VECTORCALL
2513 __pyx_vectorcallfunc func_vectorcall;
2515#if CYTHON_COMPILING_IN_LIMITED_API
2516 PyObject *func_weakreflist;
2518#if PY_VERSION_HEX < 0x030C0000 || CYTHON_COMPILING_IN_LIMITED_API
2519 PyObject *func_dict;
2521 PyObject *func_name;
2522 PyObject *func_qualname;
2524 PyObject *func_globals;
2525 PyObject *func_code;
2526 PyObject *func_closure;
2527#if CYTHON_COMPILING_IN_LIMITED_API
2528 PyObject *func_classobj;
2532 PyObject *defaults_tuple;
2533 PyObject *defaults_kwdict;
2534 PyObject *(*defaults_getter)(PyObject *);
2535 PyObject *func_annotations;
2536#if __PYX_LIMITED_VERSION_HEX < 0x030B0000
2537 PyObject *func_is_coroutine;
2539} __pyx_CyFunctionObject;
2540#undef __Pyx_CyOrPyCFunction_Check
2541#define __Pyx_CyFunction_Check(obj) __Pyx_TypeCheck(obj, __pyx_mstate_global->__pyx_CyFunctionType)
2542#define __Pyx_CyOrPyCFunction_Check(obj) __Pyx_TypeCheck2(obj, __pyx_mstate_global->__pyx_CyFunctionType, &PyCFunction_Type)
2543#define __Pyx_CyFunction_CheckExact(obj) Py_IS_TYPE(obj, __pyx_mstate_global->__pyx_CyFunctionType)
2544static CYTHON_INLINE
int __Pyx__IsSameCyOrCFunction(PyObject *func,
void (*cfunc)(
void));
2545#undef __Pyx_IsSameCFunction
2546#define __Pyx_IsSameCFunction(func, cfunc) __Pyx__IsSameCyOrCFunction(func, cfunc)
2547static CYTHON_INLINE
void __Pyx__CyFunction_SetClassObj(__pyx_CyFunctionObject*
f, PyObject* classobj);
2548static CYTHON_INLINE PyObject *__Pyx_CyFunction_InitDefaults(PyObject *func,
2549 PyTypeObject *defaults_type);
2550static CYTHON_INLINE
void __Pyx_CyFunction_SetDefaultsTuple(PyObject *m,
2552static CYTHON_INLINE
void __Pyx_CyFunction_SetDefaultsKwDict(PyObject *m,
2554static CYTHON_INLINE
void __Pyx_CyFunction_SetAnnotationsDict(PyObject *m,
2556static int __pyx_CyFunction_init(PyObject *module);
2557#if CYTHON_VECTORCALL
2558#if CYTHON_COMPILING_IN_LIMITED_API || CYTHON_COMPILING_IN_PYPY
2559#define __Pyx_CyFunction_func_vectorcall(f) ((f)->func_vectorcall)
2561#define __Pyx_CyFunction_func_vectorcall(f) (((PyCFunctionObject*)f)->vectorcall)
2566#if !CYTHON_USE_TYPE_SPECS
2567#define __Pyx_call_type_traverse(o, always_call, visit, arg) 0
2569static int __Pyx_call_type_traverse(PyObject *o,
int always_call, visitproc visit,
void *arg);
2573static PyObject *__Pyx_PyMethod_New(PyObject *func, PyObject *self, PyObject *typ);
2576#if CYTHON_VECTORCALL
2577static CYTHON_INLINE PyObject *__Pyx_PyVectorcall_FastCallDict(PyObject *func, __pyx_vectorcallfunc vc, PyObject *
const *args,
size_t nargs, PyObject *kw);
2581static PyObject *__Pyx_CyFunction_Init(PyObject *op_in, PyMethodDef *ml,
2582 int flags, PyObject* qualname,
2584 PyObject *module, PyObject *globals,
2586#if CYTHON_VECTORCALL
2587static PyObject * __Pyx_CyFunction_Vectorcall_NOARGS(PyObject *func, PyObject *
const *args,
size_t nargsf, PyObject *kwnames);
2588static PyObject * __Pyx_CyFunction_Vectorcall_O(PyObject *func, PyObject *
const *args,
size_t nargsf, PyObject *kwnames);
2589static PyObject * __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS(PyObject *func, PyObject *
const *args,
size_t nargsf, PyObject *kwnames);
2590static PyObject * __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS_METHOD(PyObject *func, PyObject *
const *args,
size_t nargsf, PyObject *kwnames);
2594static PyObject *__Pyx_CyFunction_New(PyMethodDef *ml,
2595 int flags, PyObject* qualname,
2597 PyObject *module, PyObject *globals,
2599static PyTypeObject *__Pyx_Get_CyFunction_Type(
void);
2602#if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_TYPE_SLOTS
2603#define __PYX_DICT_VERSION_INIT ((PY_UINT64_T) -1)
2604#define __PYX_GET_DICT_VERSION(dict) (((PyDictObject*)(dict))->ma_version_tag)
2605#define __PYX_UPDATE_DICT_CACHE(dict, value, cache_var, version_var)\
2606 (version_var) = __PYX_GET_DICT_VERSION(dict);\
2607 (cache_var) = (value);
2608#define __PYX_PY_DICT_LOOKUP_IF_MODIFIED(VAR, DICT, LOOKUP) {\
2609 static PY_UINT64_T __pyx_dict_version = 0;\
2610 static PyObject *__pyx_dict_cached_value = NULL;\
2611 if (likely(__PYX_GET_DICT_VERSION(DICT) == __pyx_dict_version)) {\
2612 (VAR) = __Pyx_XNewRef(__pyx_dict_cached_value);\
2614 (VAR) = __pyx_dict_cached_value = (LOOKUP);\
2615 __pyx_dict_version = __PYX_GET_DICT_VERSION(DICT);\
2618static CYTHON_INLINE PY_UINT64_T __Pyx_get_tp_dict_version(PyObject *obj);
2619static CYTHON_INLINE PY_UINT64_T __Pyx_get_object_dict_version(PyObject *obj);
2620static CYTHON_INLINE
int __Pyx_object_dict_version_matches(PyObject* obj, PY_UINT64_T tp_dict_version, PY_UINT64_T obj_dict_version);
2622#define __PYX_GET_DICT_VERSION(dict) (0)
2623#define __PYX_UPDATE_DICT_CACHE(dict, value, cache_var, version_var)
2624#define __PYX_PY_DICT_LOOKUP_IF_MODIFIED(VAR, DICT, LOOKUP) (VAR) = (LOOKUP);
2628#if CYTHON_CLINE_IN_TRACEBACK && CYTHON_CLINE_IN_TRACEBACK_RUNTIME
2629static int __Pyx_CLineForTraceback(PyThreadState *tstate,
int c_line);
2631#define __Pyx_CLineForTraceback(tstate, c_line) (((CYTHON_CLINE_IN_TRACEBACK)) ? c_line : 0)
2635#if CYTHON_COMPILING_IN_LIMITED_API
2636typedef PyObject __Pyx_CachedCodeObjectType;
2638typedef PyCodeObject __Pyx_CachedCodeObjectType;
2641 __Pyx_CachedCodeObjectType* code_object;
2643} __Pyx_CodeObjectCacheEntry;
2644struct __Pyx_CodeObjectCache {
2647 __Pyx_CodeObjectCacheEntry* entries;
2648 #if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING
2649 __pyx_atomic_int_type accessor_count;
2652static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries,
int count,
int code_line);
2653static __Pyx_CachedCodeObjectType *__pyx_find_code_object(
int code_line);
2654static void __pyx_insert_code_object(
int code_line, __Pyx_CachedCodeObjectType* code_object);
2657static void __Pyx_AddTraceback(
const char *funcname,
int c_line,
2658 int py_line,
const char *filename);
2663 #define __Pyx_CREAL(z) ((z).real())
2664 #define __Pyx_CIMAG(z) ((z).imag())
2666 #define __Pyx_CREAL(z) (__real__(z))
2667 #define __Pyx_CIMAG(z) (__imag__(z))
2670 #define __Pyx_CREAL(z) ((z).real)
2671 #define __Pyx_CIMAG(z) ((z).imag)
2673#if defined(__cplusplus) && CYTHON_CCOMPLEX\
2674 && (defined(_WIN32) || defined(__clang__) || (defined(__GNUC__) && (__GNUC__ >= 5 || __GNUC__ == 4 && __GNUC_MINOR__ >= 4 )) || __cplusplus >= 201103)
2675 #define __Pyx_SET_CREAL(z,x) ((z).real(x))
2676 #define __Pyx_SET_CIMAG(z,y) ((z).imag(y))
2678 #define __Pyx_SET_CREAL(z,x) __Pyx_CREAL(z) = (x)
2679 #define __Pyx_SET_CIMAG(z,y) __Pyx_CIMAG(z) = (y)
2683#if CYTHON_CCOMPLEX && (1) && (!0 || __cplusplus)
2684 #define __Pyx_c_eq_float(a, b) ((a)==(b))
2685 #define __Pyx_c_sum_float(a, b) ((a)+(b))
2686 #define __Pyx_c_diff_float(a, b) ((a)-(b))
2687 #define __Pyx_c_prod_float(a, b) ((a)*(b))
2688 #define __Pyx_c_quot_float(a, b) ((a)/(b))
2689 #define __Pyx_c_neg_float(a) (-(a))
2691 #define __Pyx_c_is_zero_float(z) ((z)==(float)0)
2692 #define __Pyx_c_conj_float(z) (::std::conj(z))
2694 #define __Pyx_c_abs_float(z) (::std::abs(z))
2695 #define __Pyx_c_pow_float(a, b) (::std::pow(a, b))
2698 #define __Pyx_c_is_zero_float(z) ((z)==0)
2699 #define __Pyx_c_conj_float(z) (conjf(z))
2701 #define __Pyx_c_abs_float(z) (cabsf(z))
2702 #define __Pyx_c_pow_float(a, b) (cpowf(a, b))
2706 static CYTHON_INLINE
int __Pyx_c_eq_float(__pyx_t_float_complex, __pyx_t_float_complex);
2707 static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_sum_float(__pyx_t_float_complex, __pyx_t_float_complex);
2708 static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_diff_float(__pyx_t_float_complex, __pyx_t_float_complex);
2709 static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_prod_float(__pyx_t_float_complex, __pyx_t_float_complex);
2710 static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_quot_float(__pyx_t_float_complex, __pyx_t_float_complex);
2711 static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_neg_float(__pyx_t_float_complex);
2712 static CYTHON_INLINE
int __Pyx_c_is_zero_float(__pyx_t_float_complex);
2713 static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_conj_float(__pyx_t_float_complex);
2715 static CYTHON_INLINE
float __Pyx_c_abs_float(__pyx_t_float_complex);
2716 static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_pow_float(__pyx_t_float_complex, __pyx_t_float_complex);
2721#if CYTHON_CCOMPLEX && (1) && (!0 || __cplusplus)
2722 #define __Pyx_c_eq_double(a, b) ((a)==(b))
2723 #define __Pyx_c_sum_double(a, b) ((a)+(b))
2724 #define __Pyx_c_diff_double(a, b) ((a)-(b))
2725 #define __Pyx_c_prod_double(a, b) ((a)*(b))
2726 #define __Pyx_c_quot_double(a, b) ((a)/(b))
2727 #define __Pyx_c_neg_double(a) (-(a))
2729 #define __Pyx_c_is_zero_double(z) ((z)==(double)0)
2730 #define __Pyx_c_conj_double(z) (::std::conj(z))
2732 #define __Pyx_c_abs_double(z) (::std::abs(z))
2733 #define __Pyx_c_pow_double(a, b) (::std::pow(a, b))
2736 #define __Pyx_c_is_zero_double(z) ((z)==0)
2737 #define __Pyx_c_conj_double(z) (conj(z))
2739 #define __Pyx_c_abs_double(z) (cabs(z))
2740 #define __Pyx_c_pow_double(a, b) (cpow(a, b))
2744 static CYTHON_INLINE
int __Pyx_c_eq_double(__pyx_t_double_complex, __pyx_t_double_complex);
2745 static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_sum_double(__pyx_t_double_complex, __pyx_t_double_complex);
2746 static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_diff_double(__pyx_t_double_complex, __pyx_t_double_complex);
2747 static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_prod_double(__pyx_t_double_complex, __pyx_t_double_complex);
2748 static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_quot_double(__pyx_t_double_complex, __pyx_t_double_complex);
2749 static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_neg_double(__pyx_t_double_complex);
2750 static CYTHON_INLINE
int __Pyx_c_is_zero_double(__pyx_t_double_complex);
2751 static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_conj_double(__pyx_t_double_complex);
2753 static CYTHON_INLINE
double __Pyx_c_abs_double(__pyx_t_double_complex);
2754 static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_pow_double(__pyx_t_double_complex, __pyx_t_double_complex);
2759#if CYTHON_CCOMPLEX && (1) && (!0 || __cplusplus)
2760 #define __Pyx_c_eq_long__double(a, b) ((a)==(b))
2761 #define __Pyx_c_sum_long__double(a, b) ((a)+(b))
2762 #define __Pyx_c_diff_long__double(a, b) ((a)-(b))
2763 #define __Pyx_c_prod_long__double(a, b) ((a)*(b))
2764 #define __Pyx_c_quot_long__double(a, b) ((a)/(b))
2765 #define __Pyx_c_neg_long__double(a) (-(a))
2767 #define __Pyx_c_is_zero_long__double(z) ((z)==(long double)0)
2768 #define __Pyx_c_conj_long__double(z) (::std::conj(z))
2770 #define __Pyx_c_abs_long__double(z) (::std::abs(z))
2771 #define __Pyx_c_pow_long__double(a, b) (::std::pow(a, b))
2774 #define __Pyx_c_is_zero_long__double(z) ((z)==0)
2775 #define __Pyx_c_conj_long__double(z) (conjl(z))
2777 #define __Pyx_c_abs_long__double(z) (cabsl(z))
2778 #define __Pyx_c_pow_long__double(a, b) (cpowl(a, b))
2782 static CYTHON_INLINE
int __Pyx_c_eq_long__double(__pyx_t_long_double_complex, __pyx_t_long_double_complex);
2783 static CYTHON_INLINE __pyx_t_long_double_complex __Pyx_c_sum_long__double(__pyx_t_long_double_complex, __pyx_t_long_double_complex);
2784 static CYTHON_INLINE __pyx_t_long_double_complex __Pyx_c_diff_long__double(__pyx_t_long_double_complex, __pyx_t_long_double_complex);
2785 static CYTHON_INLINE __pyx_t_long_double_complex __Pyx_c_prod_long__double(__pyx_t_long_double_complex, __pyx_t_long_double_complex);
2786 static CYTHON_INLINE __pyx_t_long_double_complex __Pyx_c_quot_long__double(__pyx_t_long_double_complex, __pyx_t_long_double_complex);
2787 static CYTHON_INLINE __pyx_t_long_double_complex __Pyx_c_neg_long__double(__pyx_t_long_double_complex);
2788 static CYTHON_INLINE
int __Pyx_c_is_zero_long__double(__pyx_t_long_double_complex);
2789 static CYTHON_INLINE __pyx_t_long_double_complex __Pyx_c_conj_long__double(__pyx_t_long_double_complex);
2791 static CYTHON_INLINE
long double __Pyx_c_abs_long__double(__pyx_t_long_double_complex);
2792 static CYTHON_INLINE __pyx_t_long_double_complex __Pyx_c_pow_long__double(__pyx_t_long_double_complex, __pyx_t_long_double_complex);
2797#if CYTHON_COMPILING_IN_LIMITED_API && __PYX_LIMITED_VERSION_HEX >= 0x030d0000
2798typedef PyObject *__Pyx_TypeName;
2799#define __Pyx_FMT_TYPENAME "%N"
2800#define __Pyx_PyType_GetFullyQualifiedName(tp) Py_NewRef((PyObject*)tp)
2801#define __Pyx_DECREF_TypeName(obj) Py_DECREF(obj)
2802#elif CYTHON_COMPILING_IN_LIMITED_API
2803typedef PyObject *__Pyx_TypeName;
2804#define __Pyx_FMT_TYPENAME "%U"
2805#define __Pyx_DECREF_TypeName(obj) Py_XDECREF(obj)
2806static __Pyx_TypeName __Pyx_PyType_GetFullyQualifiedName(PyTypeObject* tp);
2808typedef const char *__Pyx_TypeName;
2809#define __Pyx_FMT_TYPENAME "%.200s"
2810#define __Pyx_PyType_GetFullyQualifiedName(tp) ((tp)->tp_name)
2811#define __Pyx_DECREF_TypeName(obj)
2815#if !defined(__INTEL_COMPILER) && defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 6))
2816#define __Pyx_HAS_GCC_DIAGNOSTIC
2820#if CYTHON_VECTORCALL
2821#define __Pyx_Object_VectorcallKwds PyObject_Vectorcall
2822CYTHON_UNUSED
static int __Pyx_CheckVectorcallKwarg(PyObject *kwnames, Py_ssize_t i);
2824#define __Pyx_Object_VectorcallKwds __Pyx_PyObject_FastCallDict
2825CYTHON_UNUSED
static PyObject *__Pyx_MakeKwargDict(PyObject **keys, PyObject **values, Py_ssize_t
n);
2826CYTHON_UNUSED
static int __Pyx_CheckVectorcallKwarg(PyObject **kwnames, Py_ssize_t i);
2830#if CYTHON_VECTORCALL
2831#define __Pyx_Object_VectorcallMethodKwds PyObject_VectorcallMethod
2833static PyObject *__Pyx_Object_VectorcallMethodKwds(PyObject *name, PyObject *
const *args,
size_t nargsf, PyObject *kwnames);
2837static CYTHON_INLINE PyObject* __Pyx_PyLong_From_long(
long value);
2840static CYTHON_INLINE
long __Pyx_PyLong_As_long(PyObject *);
2843static CYTHON_INLINE
int __Pyx_PyLong_As_int(PyObject *);
2846#if __PYX_LIMITED_VERSION_HEX < 0x030b0000
2847static unsigned long __Pyx_cached_runtime_version = 0;
2848static void __Pyx_init_runtime_version(
void);
2850#define __Pyx_init_runtime_version()
2852static unsigned long __Pyx_get_runtime_version(
void);
2855static int __Pyx_check_binary_version(
unsigned long ct_version,
unsigned long rt_version,
int allow_newer);
2858static PyObject *__Pyx_DecompressString(
const char *
s, Py_ssize_t length,
int algo);
2861#if CYTHON_PEP489_MULTI_PHASE_INIT && CYTHON_USE_MODULE_STATE
2863static PyObject *__Pyx_State_FindModule(
void*);
2864static int __Pyx_State_AddModule(PyObject* module,
void*);
2865static int __Pyx_State_RemoveModule(
void*);
2866#elif CYTHON_USE_MODULE_STATE
2867#define __Pyx_State_FindModule PyState_FindModule
2868#define __Pyx_State_AddModule PyState_AddModule
2869#define __Pyx_State_RemoveModule PyState_RemoveModule
2874#if CYTHON_COMPILING_IN_LIMITED_API
2875 #if CYTHON_VECTORCALL
2876 #define __PYX_VECTORCALL_ABI_SUFFIX "_vectorcall"
2878 #define __PYX_VECTORCALL_ABI_SUFFIX
2880 #define __PYX_LIMITED_ABI_SUFFIX "limited" __PYX_VECTORCALL_ABI_SUFFIX __PYX_AM_SEND_ABI_SUFFIX
2882 #define __PYX_LIMITED_ABI_SUFFIX
2884#if __PYX_HAS_PY_AM_SEND == 1
2885 #define __PYX_AM_SEND_ABI_SUFFIX
2886#elif __PYX_HAS_PY_AM_SEND == 2
2887 #define __PYX_AM_SEND_ABI_SUFFIX "amsendbackport"
2889 #define __PYX_AM_SEND_ABI_SUFFIX "noamsend"
2891#ifndef __PYX_MONITORING_ABI_SUFFIX
2892 #define __PYX_MONITORING_ABI_SUFFIX
2894#if CYTHON_USE_TP_FINALIZE
2895 #define __PYX_TP_FINALIZE_ABI_SUFFIX
2897 #define __PYX_TP_FINALIZE_ABI_SUFFIX "nofinalize"
2899#if CYTHON_USE_FREELISTS || !defined(__Pyx_AsyncGen_USED)
2900 #define __PYX_FREELISTS_ABI_SUFFIX
2902 #define __PYX_FREELISTS_ABI_SUFFIX "nofreelists"
2904#if CYTHON_OPAQUE_OBJECTS && CYTHON_COMPILING_IN_LIMITED_API
2905 #define __PYX_OPAQUE_OBJECTS_ABI_SUFFIX "opaque"
2907 #define __PYX_OPAQUE_OBJECTS_ABI_SUFFIX
2909#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
2910#define __PYX_ABI_MODULE_NAME "_cython_" CYTHON_ABI
2911#define __PYX_TYPE_MODULE_PREFIX __PYX_ABI_MODULE_NAME "."
2913static CYTHON_INLINE PyTypeObject *__pyx_f_5numpy_5dtype_7typeobj___get__(PyArray_Descr *__pyx_v_self);
2914static CYTHON_INLINE
char __pyx_f_5numpy_5dtype_4kind___get__(PyArray_Descr *__pyx_v_self);
2915static CYTHON_INLINE
char __pyx_f_5numpy_5dtype_4type___get__(PyArray_Descr *__pyx_v_self);
2916static CYTHON_INLINE
char __pyx_f_5numpy_5dtype_9byteorder___get__(PyArray_Descr *__pyx_v_self);
2917static CYTHON_INLINE
int __pyx_f_5numpy_5dtype_8type_num___get__(PyArray_Descr *__pyx_v_self);
2918static CYTHON_INLINE npy_intp __pyx_f_5numpy_5dtype_8itemsize___get__(PyArray_Descr *__pyx_v_self);
2919static CYTHON_INLINE npy_intp __pyx_f_5numpy_5dtype_9alignment___get__(PyArray_Descr *__pyx_v_self);
2920static CYTHON_INLINE PyObject *__pyx_f_5numpy_5dtype_6fields___get__(PyArray_Descr *__pyx_v_self);
2921static CYTHON_INLINE PyObject *__pyx_f_5numpy_5dtype_5names___get__(PyArray_Descr *__pyx_v_self);
2922static CYTHON_INLINE PyArray_ArrayDescr *__pyx_f_5numpy_5dtype_8subarray___get__(PyArray_Descr *__pyx_v_self);
2923static CYTHON_INLINE npy_uint64 __pyx_f_5numpy_5dtype_5flags___get__(PyArray_Descr *__pyx_v_self);
2924static CYTHON_INLINE
int __pyx_f_5numpy_9broadcast_7numiter___get__(PyArrayMultiIterObject *__pyx_v_self);
2925static CYTHON_INLINE npy_intp __pyx_f_5numpy_9broadcast_4size___get__(PyArrayMultiIterObject *__pyx_v_self);
2926static CYTHON_INLINE npy_intp __pyx_f_5numpy_9broadcast_5index___get__(PyArrayMultiIterObject *__pyx_v_self);
2927static CYTHON_INLINE
int __pyx_f_5numpy_9broadcast_2nd___get__(PyArrayMultiIterObject *__pyx_v_self);
2928static CYTHON_INLINE npy_intp *__pyx_f_5numpy_9broadcast_10dimensions___get__(PyArrayMultiIterObject *__pyx_v_self);
2929static CYTHON_INLINE
void **__pyx_f_5numpy_9broadcast_5iters___get__(PyArrayMultiIterObject *__pyx_v_self);
2930static CYTHON_INLINE PyObject *__pyx_f_5numpy_7ndarray_4base___get__(PyArrayObject *__pyx_v_self);
2931static CYTHON_INLINE PyArray_Descr *__pyx_f_5numpy_7ndarray_5descr___get__(PyArrayObject *__pyx_v_self);
2932static CYTHON_INLINE
int __pyx_f_5numpy_7ndarray_4ndim___get__(PyArrayObject *__pyx_v_self);
2933static CYTHON_INLINE npy_intp *__pyx_f_5numpy_7ndarray_5shape___get__(PyArrayObject *__pyx_v_self);
2934static CYTHON_INLINE npy_intp *__pyx_f_5numpy_7ndarray_7strides___get__(PyArrayObject *__pyx_v_self);
2935static CYTHON_INLINE npy_intp __pyx_f_5numpy_7ndarray_4size___get__(PyArrayObject *__pyx_v_self);
2936static CYTHON_INLINE
char *__pyx_f_5numpy_7ndarray_4data___get__(PyArrayObject *__pyx_v_self);
2937static CYTHON_INLINE
int __pyx_f_5numpy_5ufunc_3nin___get__(PyUFuncObject *__pyx_v_self);
2938static CYTHON_INLINE
int __pyx_f_5numpy_5ufunc_4nout___get__(PyUFuncObject *__pyx_v_self);
2939static CYTHON_INLINE
int __pyx_f_5numpy_5ufunc_5nargs___get__(PyUFuncObject *__pyx_v_self);
2940static CYTHON_INLINE PyUFuncGenericFunction *__pyx_f_5numpy_5ufunc_9functions___get__(PyUFuncObject *__pyx_v_self);
2941static CYTHON_INLINE
void **__pyx_f_5numpy_5ufunc_4data___get__(PyUFuncObject *__pyx_v_self);
2942static CYTHON_INLINE
int __pyx_f_5numpy_5ufunc_6ntypes___get__(PyUFuncObject *__pyx_v_self);
2943static CYTHON_INLINE
char const *__pyx_f_5numpy_5ufunc_4name___get__(PyUFuncObject *__pyx_v_self);
2944static CYTHON_INLINE
char const *__pyx_f_5numpy_5ufunc_3doc___get__(PyUFuncObject *__pyx_v_self);
2945static CYTHON_INLINE
void *__pyx_f_5numpy_5ufunc_3ptr___get__(PyUFuncObject *__pyx_v_self);
2946static CYTHON_INLINE PyObject *__pyx_f_5numpy_5ufunc_3obj___get__(PyUFuncObject *__pyx_v_self);
2947static CYTHON_INLINE PyObject *__pyx_f_5numpy_5ufunc_9userloops___get__(PyUFuncObject *__pyx_v_self);
2972#define __Pyx_MODULE_NAME "cpskRelations"
2973extern int __pyx_module_is_main_cpskRelations;
2974int __pyx_module_is_main_cpskRelations = 0;
2980static PyObject *__pyx_pf_13cpskRelations_vgm_cal_from_sw(CYTHON_UNUSED PyObject *__pyx_self,
double __pyx_v_Sw,
double __pyx_v_sw_min,
double __pyx_v_sw_max,
double __pyx_v_alpha,
double __pyx_v_m,
double __pyx_v_eps_small,
double __pyx_v_ns_del);
2981static PyObject *__pyx_pf_13cpskRelations_2vgm_calc_from_psic(CYTHON_UNUSED PyObject *__pyx_self,
double __pyx_v_psic,
double __pyx_v_sw_min,
double __pyx_v_sw_max,
double __pyx_v_alpha,
double __pyx_v_m,
double __pyx_v_eps_small,
double __pyx_v_ns_del);
2985#ifndef CYTHON_SMALL_CODE
2986#if defined(__clang__)
2987 #define CYTHON_SMALL_CODE
2988#elif defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 3))
2989 #define CYTHON_SMALL_CODE __attribute__((cold))
2991 #define CYTHON_SMALL_CODE
3001 PyObject *__pyx_cython_runtime;
3002 PyObject *__pyx_empty_tuple;
3003 PyObject *__pyx_empty_bytes;
3004 PyObject *__pyx_empty_unicode;
3005 PyTypeObject *__pyx_ptype_7cpython_4type_type;
3006 PyTypeObject *__pyx_ptype_5numpy_dtype;
3007 PyTypeObject *__pyx_ptype_5numpy_flatiter;
3008 PyTypeObject *__pyx_ptype_5numpy_broadcast;
3009 PyTypeObject *__pyx_ptype_5numpy_ndarray;
3010 PyTypeObject *__pyx_ptype_5numpy_generic;
3011 PyTypeObject *__pyx_ptype_5numpy_number;
3012 PyTypeObject *__pyx_ptype_5numpy_integer;
3013 PyTypeObject *__pyx_ptype_5numpy_signedinteger;
3014 PyTypeObject *__pyx_ptype_5numpy_unsignedinteger;
3015 PyTypeObject *__pyx_ptype_5numpy_inexact;
3016 PyTypeObject *__pyx_ptype_5numpy_floating;
3017 PyTypeObject *__pyx_ptype_5numpy_complexfloating;
3018 PyTypeObject *__pyx_ptype_5numpy_flexible;
3019 PyTypeObject *__pyx_ptype_5numpy_character;
3020 PyTypeObject *__pyx_ptype_5numpy_ufunc;
3021 __Pyx_CachedCFunction __pyx_umethod_PyDict_Type_items;
3022 __Pyx_CachedCFunction __pyx_umethod_PyDict_Type_pop;
3023 __Pyx_CachedCFunction __pyx_umethod_PyDict_Type_values;
3024 PyObject *__pyx_codeobj_tab[2];
3025 PyObject *__pyx_string_tab[37];
3028PyTypeObject *__pyx_CommonTypesMetaclassType;
3031#if CYTHON_COMPILING_IN_LIMITED_API
3032PyObject *__Pyx_CachedMethodType;
3036PyTypeObject *__pyx_CyFunctionType;
3039struct __Pyx_CodeObjectCache __pyx_code_cache;
3047#if CYTHON_USE_MODULE_STATE
3050extern struct PyModuleDef __pyx_moduledef;
3053static struct PyModuleDef __pyx_moduledef;
3056#define __pyx_mstate_global (__Pyx_PyModule_GetState(__Pyx_State_FindModule(&__pyx_moduledef)))
3058#define __pyx_m (__Pyx_State_FindModule(&__pyx_moduledef))
3060static __pyx_mstatetype __pyx_mstate_global_static =
3066static __pyx_mstatetype *
const __pyx_mstate_global = &__pyx_mstate_global_static;
3069#define __pyx_kp_u_ __pyx_string_tab[0]
3070#define __pyx_kp_u_numpy__core_multiarray_failed_to __pyx_string_tab[1]
3071#define __pyx_kp_u_numpy__core_umath_failed_to_impo __pyx_string_tab[2]
3072#define __pyx_kp_u_proteus_cpskRelations_pyx __pyx_string_tab[3]
3073#define __pyx_n_u_Sw __pyx_string_tab[4]
3074#define __pyx_n_u_Pyx_PyDict_NextRef __pyx_string_tab[5]
3075#define __pyx_n_u_annotate __pyx_string_tab[6]
3076#define __pyx_n_u_func __pyx_string_tab[7]
3077#define __pyx_n_u_main __pyx_string_tab[8]
3078#define __pyx_n_u_module __pyx_string_tab[9]
3079#define __pyx_n_u_name __pyx_string_tab[10]
3080#define __pyx_n_u_qualname __pyx_string_tab[11]
3081#define __pyx_n_u_test __pyx_string_tab[12]
3082#define __pyx_n_u_is_coroutine __pyx_string_tab[13]
3083#define __pyx_n_u_alpha __pyx_string_tab[14]
3084#define __pyx_n_u_asyncio_coroutines __pyx_string_tab[15]
3085#define __pyx_n_u_cline_in_traceback __pyx_string_tab[16]
3086#define __pyx_n_u_cpskRelations __pyx_string_tab[17]
3087#define __pyx_n_u_eps_small __pyx_string_tab[18]
3088#define __pyx_n_u_items __pyx_string_tab[19]
3089#define __pyx_n_u_m __pyx_string_tab[20]
3090#define __pyx_n_u_np __pyx_string_tab[21]
3091#define __pyx_n_u_ns_del __pyx_string_tab[22]
3092#define __pyx_n_u_numpy __pyx_string_tab[23]
3093#define __pyx_n_u_pop __pyx_string_tab[24]
3094#define __pyx_n_u_psic __pyx_string_tab[25]
3095#define __pyx_n_u_psk __pyx_string_tab[26]
3096#define __pyx_n_u_rwork __pyx_string_tab[27]
3097#define __pyx_n_u_rwork_tol __pyx_string_tab[28]
3098#define __pyx_n_u_setdefault __pyx_string_tab[29]
3099#define __pyx_n_u_sw_max __pyx_string_tab[30]
3100#define __pyx_n_u_sw_min __pyx_string_tab[31]
3101#define __pyx_n_u_values __pyx_string_tab[32]
3102#define __pyx_n_u_vgm_cal_from_sw __pyx_string_tab[33]
3103#define __pyx_n_u_vgm_calc_from_psic __pyx_string_tab[34]
3104#define __pyx_kp_b_iso88591_Q_Q_Q_Q_Qc_Qc_D_Qa_uAQ_CvS_S_S __pyx_string_tab[35]
3105#define __pyx_kp_b_iso88591_Q_Q_Q_Q_Qc_Qc_D_Qa_aq_Ct3e3e3k __pyx_string_tab[36]
3107#if CYTHON_USE_MODULE_STATE
3108static CYTHON_SMALL_CODE
int __pyx_m_clear(PyObject *m) {
3109 __pyx_mstatetype *clear_module_state = __Pyx_PyModule_GetState(m);
3110 if (!clear_module_state)
return 0;
3111 Py_CLEAR(clear_module_state->__pyx_d);
3112 Py_CLEAR(clear_module_state->__pyx_b);
3113 Py_CLEAR(clear_module_state->__pyx_cython_runtime);
3114 Py_CLEAR(clear_module_state->__pyx_empty_tuple);
3115 Py_CLEAR(clear_module_state->__pyx_empty_bytes);
3116 Py_CLEAR(clear_module_state->__pyx_empty_unicode);
3117 #if CYTHON_PEP489_MULTI_PHASE_INIT
3118 __Pyx_State_RemoveModule(NULL);
3120 Py_CLEAR(clear_module_state->__pyx_ptype_7cpython_4type_type);
3121 Py_CLEAR(clear_module_state->__pyx_ptype_5numpy_dtype);
3122 Py_CLEAR(clear_module_state->__pyx_ptype_5numpy_flatiter);
3123 Py_CLEAR(clear_module_state->__pyx_ptype_5numpy_broadcast);
3124 Py_CLEAR(clear_module_state->__pyx_ptype_5numpy_ndarray);
3125 Py_CLEAR(clear_module_state->__pyx_ptype_5numpy_generic);
3126 Py_CLEAR(clear_module_state->__pyx_ptype_5numpy_number);
3127 Py_CLEAR(clear_module_state->__pyx_ptype_5numpy_integer);
3128 Py_CLEAR(clear_module_state->__pyx_ptype_5numpy_signedinteger);
3129 Py_CLEAR(clear_module_state->__pyx_ptype_5numpy_unsignedinteger);
3130 Py_CLEAR(clear_module_state->__pyx_ptype_5numpy_inexact);
3131 Py_CLEAR(clear_module_state->__pyx_ptype_5numpy_floating);
3132 Py_CLEAR(clear_module_state->__pyx_ptype_5numpy_complexfloating);
3133 Py_CLEAR(clear_module_state->__pyx_ptype_5numpy_flexible);
3134 Py_CLEAR(clear_module_state->__pyx_ptype_5numpy_character);
3135 Py_CLEAR(clear_module_state->__pyx_ptype_5numpy_ufunc);
3136 Py_CLEAR(clear_module_state->__pyx_umethod_PyDict_Type_items.method);
3137 Py_CLEAR(clear_module_state->__pyx_umethod_PyDict_Type_pop.method);
3138 Py_CLEAR(clear_module_state->__pyx_umethod_PyDict_Type_values.method);
3139 for (
int i=0; i<2; ++i) { Py_CLEAR(clear_module_state->__pyx_codeobj_tab[i]); }
3140 for (
int i=0; i<37; ++i) { Py_CLEAR(clear_module_state->__pyx_string_tab[i]); }
3143Py_CLEAR(clear_module_state->__pyx_CommonTypesMetaclassType);
3146Py_CLEAR(clear_module_state->__pyx_CyFunctionType);
3153#if CYTHON_USE_MODULE_STATE
3154static CYTHON_SMALL_CODE
int __pyx_m_traverse(PyObject *m, visitproc visit,
void *arg) {
3155 __pyx_mstatetype *traverse_module_state = __Pyx_PyModule_GetState(m);
3156 if (!traverse_module_state)
return 0;
3157 Py_VISIT(traverse_module_state->__pyx_d);
3158 Py_VISIT(traverse_module_state->__pyx_b);
3159 Py_VISIT(traverse_module_state->__pyx_cython_runtime);
3160 __Pyx_VISIT_CONST(traverse_module_state->__pyx_empty_tuple);
3161 __Pyx_VISIT_CONST(traverse_module_state->__pyx_empty_bytes);
3162 __Pyx_VISIT_CONST(traverse_module_state->__pyx_empty_unicode);
3163 Py_VISIT(traverse_module_state->__pyx_ptype_7cpython_4type_type);
3164 Py_VISIT(traverse_module_state->__pyx_ptype_5numpy_dtype);
3165 Py_VISIT(traverse_module_state->__pyx_ptype_5numpy_flatiter);
3166 Py_VISIT(traverse_module_state->__pyx_ptype_5numpy_broadcast);
3167 Py_VISIT(traverse_module_state->__pyx_ptype_5numpy_ndarray);
3168 Py_VISIT(traverse_module_state->__pyx_ptype_5numpy_generic);
3169 Py_VISIT(traverse_module_state->__pyx_ptype_5numpy_number);
3170 Py_VISIT(traverse_module_state->__pyx_ptype_5numpy_integer);
3171 Py_VISIT(traverse_module_state->__pyx_ptype_5numpy_signedinteger);
3172 Py_VISIT(traverse_module_state->__pyx_ptype_5numpy_unsignedinteger);
3173 Py_VISIT(traverse_module_state->__pyx_ptype_5numpy_inexact);
3174 Py_VISIT(traverse_module_state->__pyx_ptype_5numpy_floating);
3175 Py_VISIT(traverse_module_state->__pyx_ptype_5numpy_complexfloating);
3176 Py_VISIT(traverse_module_state->__pyx_ptype_5numpy_flexible);
3177 Py_VISIT(traverse_module_state->__pyx_ptype_5numpy_character);
3178 Py_VISIT(traverse_module_state->__pyx_ptype_5numpy_ufunc);
3179 Py_VISIT(traverse_module_state->__pyx_umethod_PyDict_Type_items.method);
3180 Py_VISIT(traverse_module_state->__pyx_umethod_PyDict_Type_pop.method);
3181 Py_VISIT(traverse_module_state->__pyx_umethod_PyDict_Type_values.method);
3182 for (
int i=0; i<2; ++i) { __Pyx_VISIT_CONST(traverse_module_state->__pyx_codeobj_tab[i]); }
3183 for (
int i=0; i<37; ++i) { __Pyx_VISIT_CONST(traverse_module_state->__pyx_string_tab[i]); }
3186Py_VISIT(traverse_module_state->__pyx_CommonTypesMetaclassType);
3189Py_VISIT(traverse_module_state->__pyx_CyFunctionType);
3205static CYTHON_INLINE PyTypeObject *__pyx_f_5numpy_5dtype_7typeobj___get__(PyArray_Descr *__pyx_v_self) {
3206 PyTypeObject *__pyx_r;
3217 __pyx_r = PyDataType_TYPEOBJ(__pyx_v_self);
3242static CYTHON_INLINE
char __pyx_f_5numpy_5dtype_4kind___get__(PyArray_Descr *__pyx_v_self) {
3254 __pyx_r = PyDataType_KIND(__pyx_v_self);
3279static CYTHON_INLINE
char __pyx_f_5numpy_5dtype_4type___get__(PyArray_Descr *__pyx_v_self) {
3291 __pyx_r = PyDataType_TYPE(__pyx_v_self);
3316static CYTHON_INLINE
char __pyx_f_5numpy_5dtype_9byteorder___get__(PyArray_Descr *__pyx_v_self) {
3328 __pyx_r = PyDataType_BYTEORDER(__pyx_v_self);
3353static CYTHON_INLINE
int __pyx_f_5numpy_5dtype_8type_num___get__(PyArray_Descr *__pyx_v_self) {
3365 __pyx_r = PyDataType_TYPENUM(__pyx_v_self);
3390static CYTHON_INLINE npy_intp __pyx_f_5numpy_5dtype_8itemsize___get__(PyArray_Descr *__pyx_v_self) {
3402 __pyx_r = PyDataType_ELSIZE(__pyx_v_self);
3427static CYTHON_INLINE npy_intp __pyx_f_5numpy_5dtype_9alignment___get__(PyArray_Descr *__pyx_v_self) {
3439 __pyx_r = PyDataType_ALIGNMENT(__pyx_v_self);
3464static CYTHON_INLINE PyObject *__pyx_f_5numpy_5dtype_6fields___get__(PyArray_Descr *__pyx_v_self) {
3465 PyObject *__pyx_r = NULL;
3466 __Pyx_RefNannyDeclarations
3467 PyObject *__pyx_t_1;
3468 __Pyx_RefNannySetupContext(
"__get__", 0);
3477 __pyx_t_1 = PyDataType_FIELDS(__pyx_v_self);
3480 PyObject *__pyx_temp;
3482 __pyx_temp = __pyx_r;
3483 __Pyx_INCREF(((PyObject *)__pyx_t_1));
3484 __pyx_r = ((PyObject *)__pyx_t_1);
3486 __Pyx_XDECREF(__pyx_temp);
3501 __Pyx_XGIVEREF(__pyx_r);
3502 __Pyx_RefNannyFinishContext();
3514static CYTHON_INLINE PyObject *__pyx_f_5numpy_5dtype_5names___get__(PyArray_Descr *__pyx_v_self) {
3515 PyObject *__pyx_r = NULL;
3516 __Pyx_RefNannyDeclarations
3517 PyObject *__pyx_t_1;
3518 __Pyx_RefNannySetupContext(
"__get__", 0);
3527 __pyx_t_1 = PyDataType_NAMES(__pyx_v_self);
3530 PyObject *__pyx_temp;
3532 __pyx_temp = __pyx_r;
3533 __Pyx_INCREF(((PyObject*)__pyx_t_1));
3534 __pyx_r = ((PyObject*)__pyx_t_1);
3536 __Pyx_XDECREF(__pyx_temp);
3551 __Pyx_XGIVEREF(__pyx_r);
3552 __Pyx_RefNannyFinishContext();
3564static CYTHON_INLINE PyArray_ArrayDescr *__pyx_f_5numpy_5dtype_8subarray___get__(PyArray_Descr *__pyx_v_self) {
3565 PyArray_ArrayDescr *__pyx_r;
3576 __pyx_r = PyDataType_SUBARRAY(__pyx_v_self);
3601static CYTHON_INLINE npy_uint64 __pyx_f_5numpy_5dtype_5flags___get__(PyArray_Descr *__pyx_v_self) {
3613 __pyx_r = PyDataType_FLAGS(__pyx_v_self);
3638static CYTHON_INLINE
int __pyx_f_5numpy_9broadcast_7numiter___get__(PyArrayMultiIterObject *__pyx_v_self) {
3650 __pyx_r = PyArray_MultiIter_NUMITER(__pyx_v_self);
3675static CYTHON_INLINE npy_intp __pyx_f_5numpy_9broadcast_4size___get__(PyArrayMultiIterObject *__pyx_v_self) {
3687 __pyx_r = PyArray_MultiIter_SIZE(__pyx_v_self);
3712static CYTHON_INLINE npy_intp __pyx_f_5numpy_9broadcast_5index___get__(PyArrayMultiIterObject *__pyx_v_self) {
3724 __pyx_r = PyArray_MultiIter_INDEX(__pyx_v_self);
3749static CYTHON_INLINE
int __pyx_f_5numpy_9broadcast_2nd___get__(PyArrayMultiIterObject *__pyx_v_self) {
3761 __pyx_r = PyArray_MultiIter_NDIM(__pyx_v_self);
3786static CYTHON_INLINE npy_intp *__pyx_f_5numpy_9broadcast_10dimensions___get__(PyArrayMultiIterObject *__pyx_v_self) {
3798 __pyx_r = PyArray_MultiIter_DIMS(__pyx_v_self);
3823static CYTHON_INLINE
void **__pyx_f_5numpy_9broadcast_5iters___get__(PyArrayMultiIterObject *__pyx_v_self) {
3835 __pyx_r = PyArray_MultiIter_ITERS(__pyx_v_self);
3860static CYTHON_INLINE PyObject *__pyx_f_5numpy_7ndarray_4base___get__(PyArrayObject *__pyx_v_self) {
3872 __pyx_r = PyArray_BASE(__pyx_v_self);
3897static CYTHON_INLINE PyArray_Descr *__pyx_f_5numpy_7ndarray_5descr___get__(PyArrayObject *__pyx_v_self) {
3898 PyArray_Descr *__pyx_r = NULL;
3899 __Pyx_RefNannyDeclarations
3900 PyArray_Descr *__pyx_t_1;
3901 __Pyx_RefNannySetupContext(
"__get__", 0);
3910 __pyx_t_1 = PyArray_DESCR(__pyx_v_self);
3913 PyArray_Descr *__pyx_temp;
3915 __pyx_temp = __pyx_r;
3916 __Pyx_INCREF((PyObject *)((PyArray_Descr *)__pyx_t_1));
3917 __pyx_r = ((PyArray_Descr *)__pyx_t_1);
3919 __Pyx_XDECREF((PyObject *)__pyx_temp);
3934 __Pyx_XGIVEREF((PyObject *)__pyx_r);
3935 __Pyx_RefNannyFinishContext();
3947static CYTHON_INLINE
int __pyx_f_5numpy_7ndarray_4ndim___get__(PyArrayObject *__pyx_v_self) {
3959 __pyx_r = PyArray_NDIM(__pyx_v_self);
3984static CYTHON_INLINE npy_intp *__pyx_f_5numpy_7ndarray_5shape___get__(PyArrayObject *__pyx_v_self) {
3996 __pyx_r = PyArray_DIMS(__pyx_v_self);
4021static CYTHON_INLINE npy_intp *__pyx_f_5numpy_7ndarray_7strides___get__(PyArrayObject *__pyx_v_self) {
4033 __pyx_r = PyArray_STRIDES(__pyx_v_self);
4058static CYTHON_INLINE npy_intp __pyx_f_5numpy_7ndarray_4size___get__(PyArrayObject *__pyx_v_self) {
4070 __pyx_r = PyArray_SIZE(__pyx_v_self);
4095static CYTHON_INLINE
char *__pyx_f_5numpy_7ndarray_4data___get__(PyArrayObject *__pyx_v_self) {
4107 __pyx_r = PyArray_BYTES(__pyx_v_self);
4132static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew1(PyObject *__pyx_v_a) {
4133 PyObject *__pyx_r = NULL;
4134 __Pyx_RefNannyDeclarations
4135 PyObject *__pyx_t_1 = NULL;
4136 int __pyx_lineno = 0;
4137 const char *__pyx_filename = NULL;
4138 int __pyx_clineno = 0;
4139 __Pyx_RefNannySetupContext(
"PyArray_MultiIterNew1", 0);
4148 __pyx_t_1 = PyArray_MultiIterNew(1, ((
void *)__pyx_v_a));
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 795, __pyx_L1_error)
4149 __Pyx_GOTREF(__pyx_t_1);
4151 PyObject *__pyx_temp;
4153 __pyx_temp = __pyx_r;
4154 __pyx_r = __pyx_t_1;
4156 __Pyx_XDECREF(__pyx_temp);
4171 __Pyx_XDECREF(__pyx_t_1);
4172 __Pyx_AddTraceback(
"numpy.PyArray_MultiIterNew1", __pyx_clineno, __pyx_lineno, __pyx_filename);
4175 __Pyx_XGIVEREF(__pyx_r);
4176 __Pyx_RefNannyFinishContext();
4188static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew2(PyObject *__pyx_v_a, PyObject *__pyx_v_b) {
4189 PyObject *__pyx_r = NULL;
4190 __Pyx_RefNannyDeclarations
4191 PyObject *__pyx_t_1 = NULL;
4192 int __pyx_lineno = 0;
4193 const char *__pyx_filename = NULL;
4194 int __pyx_clineno = 0;
4195 __Pyx_RefNannySetupContext(
"PyArray_MultiIterNew2", 0);
4204 __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)
4205 __Pyx_GOTREF(__pyx_t_1);
4207 PyObject *__pyx_temp;
4209 __pyx_temp = __pyx_r;
4210 __pyx_r = __pyx_t_1;
4212 __Pyx_XDECREF(__pyx_temp);
4227 __Pyx_XDECREF(__pyx_t_1);
4228 __Pyx_AddTraceback(
"numpy.PyArray_MultiIterNew2", __pyx_clineno, __pyx_lineno, __pyx_filename);
4231 __Pyx_XGIVEREF(__pyx_r);
4232 __Pyx_RefNannyFinishContext();
4244static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew3(PyObject *__pyx_v_a, PyObject *__pyx_v_b, PyObject *__pyx_v_c) {
4245 PyObject *__pyx_r = NULL;
4246 __Pyx_RefNannyDeclarations
4247 PyObject *__pyx_t_1 = NULL;
4248 int __pyx_lineno = 0;
4249 const char *__pyx_filename = NULL;
4250 int __pyx_clineno = 0;
4251 __Pyx_RefNannySetupContext(
"PyArray_MultiIterNew3", 0);
4260 __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)
4261 __Pyx_GOTREF(__pyx_t_1);
4263 PyObject *__pyx_temp;
4265 __pyx_temp = __pyx_r;
4266 __pyx_r = __pyx_t_1;
4268 __Pyx_XDECREF(__pyx_temp);
4283 __Pyx_XDECREF(__pyx_t_1);
4284 __Pyx_AddTraceback(
"numpy.PyArray_MultiIterNew3", __pyx_clineno, __pyx_lineno, __pyx_filename);
4287 __Pyx_XGIVEREF(__pyx_r);
4288 __Pyx_RefNannyFinishContext();
4300static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew4(PyObject *__pyx_v_a, PyObject *__pyx_v_b, PyObject *__pyx_v_c, PyObject *__pyx_v_d) {
4301 PyObject *__pyx_r = NULL;
4302 __Pyx_RefNannyDeclarations
4303 PyObject *__pyx_t_1 = NULL;
4304 int __pyx_lineno = 0;
4305 const char *__pyx_filename = NULL;
4306 int __pyx_clineno = 0;
4307 __Pyx_RefNannySetupContext(
"PyArray_MultiIterNew4", 0);
4316 __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)
4317 __Pyx_GOTREF(__pyx_t_1);
4319 PyObject *__pyx_temp;
4321 __pyx_temp = __pyx_r;
4322 __pyx_r = __pyx_t_1;
4324 __Pyx_XDECREF(__pyx_temp);
4339 __Pyx_XDECREF(__pyx_t_1);
4340 __Pyx_AddTraceback(
"numpy.PyArray_MultiIterNew4", __pyx_clineno, __pyx_lineno, __pyx_filename);
4343 __Pyx_XGIVEREF(__pyx_r);
4344 __Pyx_RefNannyFinishContext();
4356static 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) {
4357 PyObject *__pyx_r = NULL;
4358 __Pyx_RefNannyDeclarations
4359 PyObject *__pyx_t_1 = NULL;
4360 int __pyx_lineno = 0;
4361 const char *__pyx_filename = NULL;
4362 int __pyx_clineno = 0;
4363 __Pyx_RefNannySetupContext(
"PyArray_MultiIterNew5", 0);
4372 __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)
4373 __Pyx_GOTREF(__pyx_t_1);
4375 PyObject *__pyx_temp;
4377 __pyx_temp = __pyx_r;
4378 __pyx_r = __pyx_t_1;
4380 __Pyx_XDECREF(__pyx_temp);
4395 __Pyx_XDECREF(__pyx_t_1);
4396 __Pyx_AddTraceback(
"numpy.PyArray_MultiIterNew5", __pyx_clineno, __pyx_lineno, __pyx_filename);
4399 __Pyx_XGIVEREF(__pyx_r);
4400 __Pyx_RefNannyFinishContext();
4412static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyDataType_SHAPE(PyArray_Descr *__pyx_v_d) {
4413 PyObject *__pyx_r = NULL;
4414 __Pyx_RefNannyDeclarations
4416 PyObject *__pyx_t_2;
4417 __Pyx_RefNannySetupContext(
"PyDataType_SHAPE", 0);
4426 __pyx_t_1 = PyDataType_HASSUBARRAY(__pyx_v_d);
4438 __pyx_t_2 = __pyx_f_5numpy_5dtype_8subarray___get__(__pyx_v_d)->shape;
4441 PyObject *__pyx_temp;
4443 __pyx_temp = __pyx_r;
4444 __Pyx_INCREF(((PyObject*)__pyx_t_2));
4445 __pyx_r = ((PyObject*)__pyx_t_2);
4447 __Pyx_XDECREF(__pyx_temp);
4470 PyObject *__pyx_temp;
4472 __pyx_temp = __pyx_r;
4473 __Pyx_INCREF(__pyx_mstate_global->__pyx_empty_tuple);
4474 __pyx_r = __pyx_mstate_global->__pyx_empty_tuple;
4476 __Pyx_XDECREF(__pyx_temp);
4491 __Pyx_XGIVEREF(__pyx_r);
4492 __Pyx_RefNannyFinishContext();
4504static CYTHON_INLINE
int __pyx_f_5numpy_5ufunc_3nin___get__(PyUFuncObject *__pyx_v_self) {
4516 __pyx_r = _PyUFuncObject_GET_ITEM_DATA(__pyx_v_self)->nin;
4541static CYTHON_INLINE
int __pyx_f_5numpy_5ufunc_4nout___get__(PyUFuncObject *__pyx_v_self) {
4553 __pyx_r = _PyUFuncObject_GET_ITEM_DATA(__pyx_v_self)->nout;
4578static CYTHON_INLINE
int __pyx_f_5numpy_5ufunc_5nargs___get__(PyUFuncObject *__pyx_v_self) {
4590 __pyx_r = _PyUFuncObject_GET_ITEM_DATA(__pyx_v_self)->nargs;
4615static CYTHON_INLINE PyUFuncGenericFunction *__pyx_f_5numpy_5ufunc_9functions___get__(PyUFuncObject *__pyx_v_self) {
4616 PyUFuncGenericFunction *__pyx_r;
4627 __pyx_r = _PyUFuncObject_GET_ITEM_DATA(__pyx_v_self)->functions;
4652static CYTHON_INLINE
void **__pyx_f_5numpy_5ufunc_4data___get__(PyUFuncObject *__pyx_v_self) {
4664 __pyx_r = ((
void **)_PyUFuncObject_GET_ITEM_DATA(__pyx_v_self)->data);
4689static CYTHON_INLINE
int __pyx_f_5numpy_5ufunc_6ntypes___get__(PyUFuncObject *__pyx_v_self) {
4701 __pyx_r = _PyUFuncObject_GET_ITEM_DATA(__pyx_v_self)->ntypes;
4726static CYTHON_INLINE
char const *__pyx_f_5numpy_5ufunc_4name___get__(PyUFuncObject *__pyx_v_self) {
4727 char const *__pyx_r;
4738 __pyx_r = _PyUFuncObject_GET_ITEM_DATA(__pyx_v_self)->name;
4763static CYTHON_INLINE
char const *__pyx_f_5numpy_5ufunc_3doc___get__(PyUFuncObject *__pyx_v_self) {
4764 char const *__pyx_r;
4775 __pyx_r = _PyUFuncObject_GET_ITEM_DATA(__pyx_v_self)->doc;
4800static CYTHON_INLINE
void *__pyx_f_5numpy_5ufunc_3ptr___get__(PyUFuncObject *__pyx_v_self) {
4812 __pyx_r = _PyUFuncObject_GET_ITEM_DATA(__pyx_v_self)->ptr;
4837static CYTHON_INLINE PyObject *__pyx_f_5numpy_5ufunc_3obj___get__(PyUFuncObject *__pyx_v_self) {
4849 __pyx_r = _PyUFuncObject_GET_ITEM_DATA(__pyx_v_self)->obj;
4874static CYTHON_INLINE PyObject *__pyx_f_5numpy_5ufunc_9userloops___get__(PyUFuncObject *__pyx_v_self) {
4886 __pyx_r = _PyUFuncObject_GET_ITEM_DATA(__pyx_v_self)->userloops;
4911static CYTHON_INLINE
void __pyx_f_5numpy_set_array_base(PyArrayObject *__pyx_v_arr, PyObject *__pyx_v_base) {
4913 int __pyx_lineno = 0;
4914 const char *__pyx_filename = NULL;
4915 int __pyx_clineno = 0;
4924 Py_INCREF(__pyx_v_base);
4933 __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)
4947 __Pyx_AddTraceback(
"numpy.set_array_base", __pyx_clineno, __pyx_lineno, __pyx_filename);
4960static CYTHON_INLINE PyObject *__pyx_f_5numpy_get_array_base(PyArrayObject *__pyx_v_arr) {
4961 PyObject *__pyx_v_base;
4962 PyObject *__pyx_r = NULL;
4963 __Pyx_RefNannyDeclarations
4965 __Pyx_RefNannySetupContext(
"get_array_base", 0);
4974 __pyx_v_base = PyArray_BASE(__pyx_v_arr);
4983 __pyx_t_1 = (__pyx_v_base == NULL);
4996 PyObject *__pyx_temp;
4998 __pyx_temp = __pyx_r;
4999 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
5001 __Pyx_XDECREF(__pyx_temp);
5022 PyObject *__pyx_temp;
5024 __pyx_temp = __pyx_r;
5025 __Pyx_INCREF(((PyObject *)__pyx_v_base));
5026 __pyx_r = ((PyObject *)__pyx_v_base);
5028 __Pyx_XDECREF(__pyx_temp);
5043 __Pyx_XGIVEREF(__pyx_r);
5044 __Pyx_RefNannyFinishContext();
5056static CYTHON_INLINE
int __pyx_f_5numpy_import_array(
void) {
5058 __Pyx_RefNannyDeclarations
5059 PyObject *__pyx_t_1 = NULL;
5060 PyObject *__pyx_t_2 = NULL;
5061 PyObject *__pyx_t_3 = NULL;
5063 PyObject *__pyx_t_5 = NULL;
5064 PyObject *__pyx_t_6 = NULL;
5065 PyObject *__pyx_t_7 = NULL;
5066 PyObject *__pyx_t_8 = NULL;
5067 PyObject *__pyx_t_9 = NULL;
5069 int __pyx_lineno = 0;
5070 const char *__pyx_filename = NULL;
5071 int __pyx_clineno = 0;
5072 __Pyx_RefNannySetupContext(
"import_array", 0);
5082 __Pyx_PyThreadState_declare
5083 __Pyx_PyThreadState_assign
5084 __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
5085 __Pyx_XGOTREF(__pyx_t_1);
5086 __Pyx_XGOTREF(__pyx_t_2);
5087 __Pyx_XGOTREF(__pyx_t_3);
5097 __pyx_t_4 = _import_array();
if (unlikely(__pyx_t_4 == ((
int)-1))) __PYX_ERR(1, 1079, __pyx_L3_error)
5108 __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
5109 __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
5110 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
5111 goto __pyx_L8_try_end;
5121 __pyx_t_4 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(((PyTypeObject*)PyExc_Exception))));
5123 __Pyx_AddTraceback(
"numpy.import_array", __pyx_clineno, __pyx_lineno, __pyx_filename);
5124 if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(1, 1080, __pyx_L5_except_error)
5125 __Pyx_XGOTREF(__pyx_t_5);
5126 __Pyx_XGOTREF(__pyx_t_6);
5127 __Pyx_XGOTREF(__pyx_t_7);
5139 PyObject *__pyx_callargs[2] = {__pyx_t_9, __pyx_mstate_global->__pyx_kp_u_numpy__core_multiarray_failed_to};
5140 __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));
5141 __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
5142 if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 1081, __pyx_L5_except_error)
5143 __Pyx_GOTREF(__pyx_t_8);
5145 __Pyx_Raise(__pyx_t_8, 0, 0, 0);
5146 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
5147 __PYX_ERR(1, 1081, __pyx_L5_except_error)
5149 goto __pyx_L5_except_error;
5158 __pyx_L5_except_error:;
5159 __Pyx_XGIVEREF(__pyx_t_1);
5160 __Pyx_XGIVEREF(__pyx_t_2);
5161 __Pyx_XGIVEREF(__pyx_t_3);
5162 __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
5163 goto __pyx_L1_error;
5179 __Pyx_XDECREF(__pyx_t_5);
5180 __Pyx_XDECREF(__pyx_t_6);
5181 __Pyx_XDECREF(__pyx_t_7);
5182 __Pyx_XDECREF(__pyx_t_8);
5183 __Pyx_XDECREF(__pyx_t_9);
5184 __Pyx_AddTraceback(
"numpy.import_array", __pyx_clineno, __pyx_lineno, __pyx_filename);
5188 __Pyx_RefNannyFinishContext();
5200static CYTHON_INLINE
int __pyx_f_5numpy_import_umath(
void) {
5202 __Pyx_RefNannyDeclarations
5203 PyObject *__pyx_t_1 = NULL;
5204 PyObject *__pyx_t_2 = NULL;
5205 PyObject *__pyx_t_3 = NULL;
5207 PyObject *__pyx_t_5 = NULL;
5208 PyObject *__pyx_t_6 = NULL;
5209 PyObject *__pyx_t_7 = NULL;
5210 PyObject *__pyx_t_8 = NULL;
5211 PyObject *__pyx_t_9 = NULL;
5213 int __pyx_lineno = 0;
5214 const char *__pyx_filename = NULL;
5215 int __pyx_clineno = 0;
5216 __Pyx_RefNannySetupContext(
"import_umath", 0);
5226 __Pyx_PyThreadState_declare
5227 __Pyx_PyThreadState_assign
5228 __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
5229 __Pyx_XGOTREF(__pyx_t_1);
5230 __Pyx_XGOTREF(__pyx_t_2);
5231 __Pyx_XGOTREF(__pyx_t_3);
5241 __pyx_t_4 = _import_umath();
if (unlikely(__pyx_t_4 == ((
int)-1))) __PYX_ERR(1, 1085, __pyx_L3_error)
5252 __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
5253 __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
5254 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
5255 goto __pyx_L8_try_end;
5265 __pyx_t_4 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(((PyTypeObject*)PyExc_Exception))));
5267 __Pyx_AddTraceback(
"numpy.import_umath", __pyx_clineno, __pyx_lineno, __pyx_filename);
5268 if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(1, 1086, __pyx_L5_except_error)
5269 __Pyx_XGOTREF(__pyx_t_5);
5270 __Pyx_XGOTREF(__pyx_t_6);
5271 __Pyx_XGOTREF(__pyx_t_7);
5283 PyObject *__pyx_callargs[2] = {__pyx_t_9, __pyx_mstate_global->__pyx_kp_u_numpy__core_umath_failed_to_impo};
5284 __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));
5285 __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
5286 if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 1087, __pyx_L5_except_error)
5287 __Pyx_GOTREF(__pyx_t_8);
5289 __Pyx_Raise(__pyx_t_8, 0, 0, 0);
5290 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
5291 __PYX_ERR(1, 1087, __pyx_L5_except_error)
5293 goto __pyx_L5_except_error;
5302 __pyx_L5_except_error:;
5303 __Pyx_XGIVEREF(__pyx_t_1);
5304 __Pyx_XGIVEREF(__pyx_t_2);
5305 __Pyx_XGIVEREF(__pyx_t_3);
5306 __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
5307 goto __pyx_L1_error;
5323 __Pyx_XDECREF(__pyx_t_5);
5324 __Pyx_XDECREF(__pyx_t_6);
5325 __Pyx_XDECREF(__pyx_t_7);
5326 __Pyx_XDECREF(__pyx_t_8);
5327 __Pyx_XDECREF(__pyx_t_9);
5328 __Pyx_AddTraceback(
"numpy.import_umath", __pyx_clineno, __pyx_lineno, __pyx_filename);
5332 __Pyx_RefNannyFinishContext();
5344static CYTHON_INLINE
int __pyx_f_5numpy_import_ufunc(
void) {
5346 __Pyx_RefNannyDeclarations
5347 PyObject *__pyx_t_1 = NULL;
5348 PyObject *__pyx_t_2 = NULL;
5349 PyObject *__pyx_t_3 = NULL;
5351 PyObject *__pyx_t_5 = NULL;
5352 PyObject *__pyx_t_6 = NULL;
5353 PyObject *__pyx_t_7 = NULL;
5354 PyObject *__pyx_t_8 = NULL;
5355 PyObject *__pyx_t_9 = NULL;
5357 int __pyx_lineno = 0;
5358 const char *__pyx_filename = NULL;
5359 int __pyx_clineno = 0;
5360 __Pyx_RefNannySetupContext(
"import_ufunc", 0);
5370 __Pyx_PyThreadState_declare
5371 __Pyx_PyThreadState_assign
5372 __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
5373 __Pyx_XGOTREF(__pyx_t_1);
5374 __Pyx_XGOTREF(__pyx_t_2);
5375 __Pyx_XGOTREF(__pyx_t_3);
5385 __pyx_t_4 = _import_umath();
if (unlikely(__pyx_t_4 == ((
int)-1))) __PYX_ERR(1, 1091, __pyx_L3_error)
5396 __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
5397 __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
5398 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
5399 goto __pyx_L8_try_end;
5409 __pyx_t_4 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(((PyTypeObject*)PyExc_Exception))));
5411 __Pyx_AddTraceback(
"numpy.import_ufunc", __pyx_clineno, __pyx_lineno, __pyx_filename);
5412 if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(1, 1092, __pyx_L5_except_error)
5413 __Pyx_XGOTREF(__pyx_t_5);
5414 __Pyx_XGOTREF(__pyx_t_6);
5415 __Pyx_XGOTREF(__pyx_t_7);
5427 PyObject *__pyx_callargs[2] = {__pyx_t_9, __pyx_mstate_global->__pyx_kp_u_numpy__core_umath_failed_to_impo};
5428 __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));
5429 __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
5430 if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 1093, __pyx_L5_except_error)
5431 __Pyx_GOTREF(__pyx_t_8);
5433 __Pyx_Raise(__pyx_t_8, 0, 0, 0);
5434 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
5435 __PYX_ERR(1, 1093, __pyx_L5_except_error)
5437 goto __pyx_L5_except_error;
5446 __pyx_L5_except_error:;
5447 __Pyx_XGIVEREF(__pyx_t_1);
5448 __Pyx_XGIVEREF(__pyx_t_2);
5449 __Pyx_XGIVEREF(__pyx_t_3);
5450 __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
5451 goto __pyx_L1_error;
5467 __Pyx_XDECREF(__pyx_t_5);
5468 __Pyx_XDECREF(__pyx_t_6);
5469 __Pyx_XDECREF(__pyx_t_7);
5470 __Pyx_XDECREF(__pyx_t_8);
5471 __Pyx_XDECREF(__pyx_t_9);
5472 __Pyx_AddTraceback(
"numpy.import_ufunc", __pyx_clineno, __pyx_lineno, __pyx_filename);
5476 __Pyx_RefNannyFinishContext();
5488static CYTHON_INLINE
int __pyx_f_5numpy_is_timedelta64_object(PyObject *__pyx_v_obj) {
5500 __pyx_r = PyObject_TypeCheck(__pyx_v_obj, (&PyTimedeltaArrType_Type));
5526static CYTHON_INLINE
int __pyx_f_5numpy_is_datetime64_object(PyObject *__pyx_v_obj) {
5538 __pyx_r = PyObject_TypeCheck(__pyx_v_obj, (&PyDatetimeArrType_Type));
5564static CYTHON_INLINE npy_datetime __pyx_f_5numpy_get_datetime64_value(PyObject *__pyx_v_obj) {
5565 npy_datetime __pyx_r;
5576 __pyx_r = _PyDatetimeScalarObject_GetValue(__pyx_v_obj);
5601static CYTHON_INLINE npy_timedelta __pyx_f_5numpy_get_timedelta64_value(PyObject *__pyx_v_obj) {
5602 npy_timedelta __pyx_r;
5613 __pyx_r = _PyTimedeltaScalarObject_GetValue(__pyx_v_obj);
5638static CYTHON_INLINE NPY_DATETIMEUNIT __pyx_f_5numpy_get_datetime64_unit(PyObject *__pyx_v_obj) {
5639 NPY_DATETIMEUNIT __pyx_r;
5650 __pyx_r = _PyDatetimeScalarObject_GetMetadata(__pyx_v_obj).base;
5676static PyObject *__pyx_pw_13cpskRelations_1vgm_cal_from_sw(PyObject *__pyx_self,
5677#
if CYTHON_VECTORCALL
5678PyObject *
const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
5680PyObject *__pyx_args, PyObject *__pyx_kwds
5683static PyMethodDef __pyx_mdef_13cpskRelations_1vgm_cal_from_sw = {
"vgm_cal_from_sw", (PyCFunction)(
void(*)(
void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_13cpskRelations_1vgm_cal_from_sw, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
5684static PyObject *__pyx_pw_13cpskRelations_1vgm_cal_from_sw(PyObject *__pyx_self,
5685#
if CYTHON_VECTORCALL
5686PyObject *
const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
5688PyObject *__pyx_args, PyObject *__pyx_kwds
5692 double __pyx_v_sw_min;
5693 double __pyx_v_sw_max;
5694 double __pyx_v_alpha;
5696 double __pyx_v_eps_small;
5697 double __pyx_v_ns_del;
5698 #if !CYTHON_VECTORCALL
5699 CYTHON_UNUSED Py_ssize_t __pyx_nargs;
5701 CYTHON_UNUSED PyObject *
const *__pyx_kwvalues;
5702 PyObject* values[7] = {0,0,0,0,0,0,0};
5703 int __pyx_lineno = 0;
5704 const char *__pyx_filename = NULL;
5705 int __pyx_clineno = 0;
5706 PyObject *__pyx_r = 0;
5707 __Pyx_RefNannyDeclarations
5708 __Pyx_RefNannySetupContext(
"vgm_cal_from_sw (wrapper)", 0);
5709 #if !CYTHON_VECTORCALL
5710 #if CYTHON_ASSUME_SAFE_SIZE
5711 __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
5713 __pyx_nargs = PyTuple_Size(__pyx_args);
if (unlikely(__pyx_nargs < 0))
return NULL;
5716 __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
5718 PyObject **
const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_Sw,&__pyx_mstate_global->__pyx_n_u_sw_min,&__pyx_mstate_global->__pyx_n_u_sw_max,&__pyx_mstate_global->__pyx_n_u_alpha,&__pyx_mstate_global->__pyx_n_u_m,&__pyx_mstate_global->__pyx_n_u_eps_small,&__pyx_mstate_global->__pyx_n_u_ns_del,0};
5719 const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
5720 if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(0, 7, __pyx_L3_error)
5721 if (__pyx_kwds_len > 0) {
5722 switch (__pyx_nargs) {
5724 values[6] = __Pyx_ArgRef_FASTCALL(__pyx_args, 6);
5725 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[6])) __PYX_ERR(0, 7, __pyx_L3_error)
5728 values[5] = __Pyx_ArgRef_FASTCALL(__pyx_args, 5);
5729 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[5])) __PYX_ERR(0, 7, __pyx_L3_error)
5732 values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
5733 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 7, __pyx_L3_error)
5736 values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
5737 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 7, __pyx_L3_error)
5740 values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
5741 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 7, __pyx_L3_error)
5744 values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
5745 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 7, __pyx_L3_error)
5748 values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
5749 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 7, __pyx_L3_error)
5752 default:
goto __pyx_L5_argtuple_error;
5754 const Py_ssize_t kwd_pos_args = __pyx_nargs;
5755 if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len,
"vgm_cal_from_sw", 0) < (0)) __PYX_ERR(0, 7, __pyx_L3_error)
5756 for (Py_ssize_t i = __pyx_nargs; i < 7; i++) {
5757 if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid(
"vgm_cal_from_sw", 1, 7, 7, i); __PYX_ERR(0, 7, __pyx_L3_error) }
5759 }
else if (unlikely(__pyx_nargs != 7)) {
5760 goto __pyx_L5_argtuple_error;
5762 values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
5763 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 7, __pyx_L3_error)
5764 values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
5765 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 7, __pyx_L3_error)
5766 values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
5767 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 7, __pyx_L3_error)
5768 values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
5769 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 7, __pyx_L3_error)
5770 values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
5771 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 7, __pyx_L3_error)
5772 values[5] = __Pyx_ArgRef_FASTCALL(__pyx_args, 5);
5773 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[5])) __PYX_ERR(0, 7, __pyx_L3_error)
5774 values[6] = __Pyx_ArgRef_FASTCALL(__pyx_args, 6);
5775 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[6])) __PYX_ERR(0, 7, __pyx_L3_error)
5777 __pyx_v_Sw = __Pyx_PyFloat_AsDouble(values[0]);
if (unlikely((__pyx_v_Sw == (
double)-1) && PyErr_Occurred())) __PYX_ERR(0, 7, __pyx_L3_error)
5778 __pyx_v_sw_min = __Pyx_PyFloat_AsDouble(values[1]);
if (unlikely((__pyx_v_sw_min == (
double)-1) && PyErr_Occurred())) __PYX_ERR(0, 8, __pyx_L3_error)
5779 __pyx_v_sw_max = __Pyx_PyFloat_AsDouble(values[2]);
if (unlikely((__pyx_v_sw_max == (
double)-1) && PyErr_Occurred())) __PYX_ERR(0, 9, __pyx_L3_error)
5780 __pyx_v_alpha = __Pyx_PyFloat_AsDouble(values[3]);
if (unlikely((__pyx_v_alpha == (
double)-1) && PyErr_Occurred())) __PYX_ERR(0, 10, __pyx_L3_error)
5781 __pyx_v_m = __Pyx_PyFloat_AsDouble(values[4]);
if (unlikely((__pyx_v_m == (
double)-1) && PyErr_Occurred())) __PYX_ERR(0, 11, __pyx_L3_error)
5782 __pyx_v_eps_small = __Pyx_PyFloat_AsDouble(values[5]);
if (unlikely((__pyx_v_eps_small == (
double)-1) && PyErr_Occurred())) __PYX_ERR(0, 12, __pyx_L3_error)
5783 __pyx_v_ns_del = __Pyx_PyFloat_AsDouble(values[6]);
if (unlikely((__pyx_v_ns_del == (
double)-1) && PyErr_Occurred())) __PYX_ERR(0, 13, __pyx_L3_error)
5786 __pyx_L5_argtuple_error:;
5787 __Pyx_RaiseArgtupleInvalid(
"vgm_cal_from_sw", 1, 7, 7, __pyx_nargs); __PYX_ERR(0, 7, __pyx_L3_error)
5789 goto __pyx_L4_argument_unpacking_done;
5791 for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(
sizeof(values)/
sizeof(values[0])); ++__pyx_temp) {
5792 Py_XDECREF(values[__pyx_temp]);
5794 __Pyx_AddTraceback(
"cpskRelations.vgm_cal_from_sw", __pyx_clineno, __pyx_lineno, __pyx_filename);
5795 __Pyx_RefNannyFinishContext();
5797 __pyx_L4_argument_unpacking_done:;
5798 __pyx_r = __pyx_pf_13cpskRelations_vgm_cal_from_sw(__pyx_self, __pyx_v_Sw, __pyx_v_sw_min, __pyx_v_sw_max, __pyx_v_alpha, __pyx_v_m, __pyx_v_eps_small, __pyx_v_ns_del);
5801 for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(
sizeof(values)/
sizeof(values[0])); ++__pyx_temp) {
5802 Py_XDECREF(values[__pyx_temp]);
5811 __Pyx_RefNannyFinishContext();
5815static PyObject *__pyx_pf_13cpskRelations_vgm_cal_from_sw(CYTHON_UNUSED PyObject *__pyx_self,
double __pyx_v_Sw,
double __pyx_v_sw_min,
double __pyx_v_sw_max,
double __pyx_v_alpha,
double __pyx_v_m,
double __pyx_v_eps_small,
double __pyx_v_ns_del) {
5816 double __pyx_v_rwork[4];
5817 double __pyx_v_rwork_tol[2];
5819 PyObject *__pyx_r = NULL;
5820 __Pyx_RefNannyDeclarations
5821 PyObject *__pyx_t_1 = NULL;
5822 PyObject *__pyx_t_2 = NULL;
5823 PyObject *__pyx_t_3 = NULL;
5824 PyObject *__pyx_t_4 = NULL;
5825 PyObject *__pyx_t_5 = NULL;
5826 PyObject *__pyx_t_6 = NULL;
5827 PyObject *__pyx_t_7 = NULL;
5828 int __pyx_lineno = 0;
5829 const char *__pyx_filename = NULL;
5830 int __pyx_clineno = 0;
5831 __Pyx_RefNannySetupContext(
"vgm_cal_from_sw", 0);
5840 (__pyx_v_rwork[0]) = __pyx_v_sw_min;
5849 (__pyx_v_rwork[1]) = __pyx_v_sw_max;
5858 (__pyx_v_rwork[2]) = __pyx_v_alpha;
5867 (__pyx_v_rwork[3]) = __pyx_v_m;
5876 (__pyx_v_rwork_tol[0]) = __pyx_v_eps_small;
5885 (__pyx_v_rwork_tol[1]) = __pyx_v_ns_del;
5894 __pyx_v_psk =
VGM(__pyx_v_rwork);
5912 __pyx_v_psk.
calc(__pyx_v_Sw);
5921 __pyx_t_1 = PyFloat_FromDouble(__pyx_v_psk.
psic);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 25, __pyx_L1_error)
5922 __Pyx_GOTREF(__pyx_t_1);
5923 __pyx_t_2 = PyFloat_FromDouble(__pyx_v_psk.
krw);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 25, __pyx_L1_error)
5924 __Pyx_GOTREF(__pyx_t_2);
5925 __pyx_t_3 = PyFloat_FromDouble(__pyx_v_psk.
krn);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 25, __pyx_L1_error)
5926 __Pyx_GOTREF(__pyx_t_3);
5927 __pyx_t_4 = PyFloat_FromDouble(__pyx_v_psk.
dpsic);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 25, __pyx_L1_error)
5928 __Pyx_GOTREF(__pyx_t_4);
5929 __pyx_t_5 = PyFloat_FromDouble(__pyx_v_psk.
dkrw);
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 25, __pyx_L1_error)
5930 __Pyx_GOTREF(__pyx_t_5);
5931 __pyx_t_6 = PyFloat_FromDouble(__pyx_v_psk.
dkrn);
if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 25, __pyx_L1_error)
5932 __Pyx_GOTREF(__pyx_t_6);
5933 __pyx_t_7 = PyTuple_New(6);
if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 25, __pyx_L1_error)
5934 __Pyx_GOTREF(__pyx_t_7);
5935 __Pyx_GIVEREF(__pyx_t_1);
5936 if (__Pyx_PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_1) != (0)) __PYX_ERR(0, 25, __pyx_L1_error);
5937 __Pyx_GIVEREF(__pyx_t_2);
5938 if (__Pyx_PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_t_2) != (0)) __PYX_ERR(0, 25, __pyx_L1_error);
5939 __Pyx_GIVEREF(__pyx_t_3);
5940 if (__Pyx_PyTuple_SET_ITEM(__pyx_t_7, 2, __pyx_t_3) != (0)) __PYX_ERR(0, 25, __pyx_L1_error);
5941 __Pyx_GIVEREF(__pyx_t_4);
5942 if (__Pyx_PyTuple_SET_ITEM(__pyx_t_7, 3, __pyx_t_4) != (0)) __PYX_ERR(0, 25, __pyx_L1_error);
5943 __Pyx_GIVEREF(__pyx_t_5);
5944 if (__Pyx_PyTuple_SET_ITEM(__pyx_t_7, 4, __pyx_t_5) != (0)) __PYX_ERR(0, 25, __pyx_L1_error);
5945 __Pyx_GIVEREF(__pyx_t_6);
5946 if (__Pyx_PyTuple_SET_ITEM(__pyx_t_7, 5, __pyx_t_6) != (0)) __PYX_ERR(0, 25, __pyx_L1_error);
5954 PyObject *__pyx_temp;
5956 __pyx_temp = __pyx_r;
5957 __pyx_r = __pyx_t_7;
5959 __Pyx_XDECREF(__pyx_temp);
5974 __Pyx_XDECREF(__pyx_t_1);
5975 __Pyx_XDECREF(__pyx_t_2);
5976 __Pyx_XDECREF(__pyx_t_3);
5977 __Pyx_XDECREF(__pyx_t_4);
5978 __Pyx_XDECREF(__pyx_t_5);
5979 __Pyx_XDECREF(__pyx_t_6);
5980 __Pyx_XDECREF(__pyx_t_7);
5981 __Pyx_AddTraceback(
"cpskRelations.vgm_cal_from_sw", __pyx_clineno, __pyx_lineno, __pyx_filename);
5987 __Pyx_XGIVEREF(__pyx_r);
5988 __Pyx_RefNannyFinishContext();
6001static PyObject *__pyx_pw_13cpskRelations_3vgm_calc_from_psic(PyObject *__pyx_self,
6002#
if CYTHON_VECTORCALL
6003PyObject *
const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
6005PyObject *__pyx_args, PyObject *__pyx_kwds
6008static PyMethodDef __pyx_mdef_13cpskRelations_3vgm_calc_from_psic = {
"vgm_calc_from_psic", (PyCFunction)(
void(*)(
void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_13cpskRelations_3vgm_calc_from_psic, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
6009static PyObject *__pyx_pw_13cpskRelations_3vgm_calc_from_psic(PyObject *__pyx_self,
6010#
if CYTHON_VECTORCALL
6011PyObject *
const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
6013PyObject *__pyx_args, PyObject *__pyx_kwds
6016 double __pyx_v_psic;
6017 double __pyx_v_sw_min;
6018 double __pyx_v_sw_max;
6019 double __pyx_v_alpha;
6021 double __pyx_v_eps_small;
6022 double __pyx_v_ns_del;
6023 #if !CYTHON_VECTORCALL
6024 CYTHON_UNUSED Py_ssize_t __pyx_nargs;
6026 CYTHON_UNUSED PyObject *
const *__pyx_kwvalues;
6027 PyObject* values[7] = {0,0,0,0,0,0,0};
6028 int __pyx_lineno = 0;
6029 const char *__pyx_filename = NULL;
6030 int __pyx_clineno = 0;
6031 PyObject *__pyx_r = 0;
6032 __Pyx_RefNannyDeclarations
6033 __Pyx_RefNannySetupContext(
"vgm_calc_from_psic (wrapper)", 0);
6034 #if !CYTHON_VECTORCALL
6035 #if CYTHON_ASSUME_SAFE_SIZE
6036 __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
6038 __pyx_nargs = PyTuple_Size(__pyx_args);
if (unlikely(__pyx_nargs < 0))
return NULL;
6041 __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
6043 PyObject **
const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_psic,&__pyx_mstate_global->__pyx_n_u_sw_min,&__pyx_mstate_global->__pyx_n_u_sw_max,&__pyx_mstate_global->__pyx_n_u_alpha,&__pyx_mstate_global->__pyx_n_u_m,&__pyx_mstate_global->__pyx_n_u_eps_small,&__pyx_mstate_global->__pyx_n_u_ns_del,0};
6044 const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
6045 if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(0, 27, __pyx_L3_error)
6046 if (__pyx_kwds_len > 0) {
6047 switch (__pyx_nargs) {
6049 values[6] = __Pyx_ArgRef_FASTCALL(__pyx_args, 6);
6050 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[6])) __PYX_ERR(0, 27, __pyx_L3_error)
6053 values[5] = __Pyx_ArgRef_FASTCALL(__pyx_args, 5);
6054 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[5])) __PYX_ERR(0, 27, __pyx_L3_error)
6057 values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
6058 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 27, __pyx_L3_error)
6061 values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
6062 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 27, __pyx_L3_error)
6065 values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
6066 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 27, __pyx_L3_error)
6069 values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
6070 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 27, __pyx_L3_error)
6073 values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
6074 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 27, __pyx_L3_error)
6077 default:
goto __pyx_L5_argtuple_error;
6079 const Py_ssize_t kwd_pos_args = __pyx_nargs;
6080 if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len,
"vgm_calc_from_psic", 0) < (0)) __PYX_ERR(0, 27, __pyx_L3_error)
6081 for (Py_ssize_t i = __pyx_nargs; i < 7; i++) {
6082 if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid(
"vgm_calc_from_psic", 1, 7, 7, i); __PYX_ERR(0, 27, __pyx_L3_error) }
6084 }
else if (unlikely(__pyx_nargs != 7)) {
6085 goto __pyx_L5_argtuple_error;
6087 values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
6088 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 27, __pyx_L3_error)
6089 values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
6090 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 27, __pyx_L3_error)
6091 values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
6092 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 27, __pyx_L3_error)
6093 values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
6094 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 27, __pyx_L3_error)
6095 values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
6096 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 27, __pyx_L3_error)
6097 values[5] = __Pyx_ArgRef_FASTCALL(__pyx_args, 5);
6098 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[5])) __PYX_ERR(0, 27, __pyx_L3_error)
6099 values[6] = __Pyx_ArgRef_FASTCALL(__pyx_args, 6);
6100 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[6])) __PYX_ERR(0, 27, __pyx_L3_error)
6102 __pyx_v_psic = __Pyx_PyFloat_AsDouble(values[0]);
if (unlikely((__pyx_v_psic == (
double)-1) && PyErr_Occurred())) __PYX_ERR(0, 27, __pyx_L3_error)
6103 __pyx_v_sw_min = __Pyx_PyFloat_AsDouble(values[1]);
if (unlikely((__pyx_v_sw_min == (
double)-1) && PyErr_Occurred())) __PYX_ERR(0, 28, __pyx_L3_error)
6104 __pyx_v_sw_max = __Pyx_PyFloat_AsDouble(values[2]);
if (unlikely((__pyx_v_sw_max == (
double)-1) && PyErr_Occurred())) __PYX_ERR(0, 29, __pyx_L3_error)
6105 __pyx_v_alpha = __Pyx_PyFloat_AsDouble(values[3]);
if (unlikely((__pyx_v_alpha == (
double)-1) && PyErr_Occurred())) __PYX_ERR(0, 30, __pyx_L3_error)
6106 __pyx_v_m = __Pyx_PyFloat_AsDouble(values[4]);
if (unlikely((__pyx_v_m == (
double)-1) && PyErr_Occurred())) __PYX_ERR(0, 31, __pyx_L3_error)
6107 __pyx_v_eps_small = __Pyx_PyFloat_AsDouble(values[5]);
if (unlikely((__pyx_v_eps_small == (
double)-1) && PyErr_Occurred())) __PYX_ERR(0, 32, __pyx_L3_error)
6108 __pyx_v_ns_del = __Pyx_PyFloat_AsDouble(values[6]);
if (unlikely((__pyx_v_ns_del == (
double)-1) && PyErr_Occurred())) __PYX_ERR(0, 33, __pyx_L3_error)
6111 __pyx_L5_argtuple_error:;
6112 __Pyx_RaiseArgtupleInvalid(
"vgm_calc_from_psic", 1, 7, 7, __pyx_nargs); __PYX_ERR(0, 27, __pyx_L3_error)
6114 goto __pyx_L4_argument_unpacking_done;
6116 for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(
sizeof(values)/
sizeof(values[0])); ++__pyx_temp) {
6117 Py_XDECREF(values[__pyx_temp]);
6119 __Pyx_AddTraceback(
"cpskRelations.vgm_calc_from_psic", __pyx_clineno, __pyx_lineno, __pyx_filename);
6120 __Pyx_RefNannyFinishContext();
6122 __pyx_L4_argument_unpacking_done:;
6123 __pyx_r = __pyx_pf_13cpskRelations_2vgm_calc_from_psic(__pyx_self, __pyx_v_psic, __pyx_v_sw_min, __pyx_v_sw_max, __pyx_v_alpha, __pyx_v_m, __pyx_v_eps_small, __pyx_v_ns_del);
6126 for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(
sizeof(values)/
sizeof(values[0])); ++__pyx_temp) {
6127 Py_XDECREF(values[__pyx_temp]);
6136 __Pyx_RefNannyFinishContext();
6140static PyObject *__pyx_pf_13cpskRelations_2vgm_calc_from_psic(CYTHON_UNUSED PyObject *__pyx_self,
double __pyx_v_psic,
double __pyx_v_sw_min,
double __pyx_v_sw_max,
double __pyx_v_alpha,
double __pyx_v_m,
double __pyx_v_eps_small,
double __pyx_v_ns_del) {
6141 double __pyx_v_rwork[4];
6142 double __pyx_v_rwork_tol[2];
6144 PyObject *__pyx_r = NULL;
6145 __Pyx_RefNannyDeclarations
6146 PyObject *__pyx_t_1 = NULL;
6147 PyObject *__pyx_t_2 = NULL;
6148 PyObject *__pyx_t_3 = NULL;
6149 PyObject *__pyx_t_4 = NULL;
6150 PyObject *__pyx_t_5 = NULL;
6151 PyObject *__pyx_t_6 = NULL;
6152 PyObject *__pyx_t_7 = NULL;
6153 int __pyx_lineno = 0;
6154 const char *__pyx_filename = NULL;
6155 int __pyx_clineno = 0;
6156 __Pyx_RefNannySetupContext(
"vgm_calc_from_psic", 0);
6165 (__pyx_v_rwork[0]) = __pyx_v_sw_min;
6174 (__pyx_v_rwork[1]) = __pyx_v_sw_max;
6183 (__pyx_v_rwork[2]) = __pyx_v_alpha;
6192 (__pyx_v_rwork[3]) = __pyx_v_m;
6201 (__pyx_v_rwork_tol[0]) = __pyx_v_eps_small;
6210 (__pyx_v_rwork_tol[1]) = __pyx_v_ns_del;
6219 __pyx_v_psk =
VGM(__pyx_v_rwork);
6243 __pyx_t_1 = PyFloat_FromDouble(__pyx_v_psk.
Se);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 45, __pyx_L1_error)
6244 __Pyx_GOTREF(__pyx_t_1);
6245 __pyx_t_2 = PyFloat_FromDouble(__pyx_v_psk.
krw);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 45, __pyx_L1_error)
6246 __Pyx_GOTREF(__pyx_t_2);
6247 __pyx_t_3 = PyFloat_FromDouble(__pyx_v_psk.
krn);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 45, __pyx_L1_error)
6248 __Pyx_GOTREF(__pyx_t_3);
6249 __pyx_t_4 = PyFloat_FromDouble(__pyx_v_psk.
dSe_dpsic);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 45, __pyx_L1_error)
6250 __Pyx_GOTREF(__pyx_t_4);
6251 __pyx_t_5 = PyFloat_FromDouble(__pyx_v_psk.
dkrw);
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 45, __pyx_L1_error)
6252 __Pyx_GOTREF(__pyx_t_5);
6253 __pyx_t_6 = PyFloat_FromDouble(__pyx_v_psk.
dkrn);
if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 45, __pyx_L1_error)
6254 __Pyx_GOTREF(__pyx_t_6);
6255 __pyx_t_7 = PyTuple_New(6);
if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 45, __pyx_L1_error)
6256 __Pyx_GOTREF(__pyx_t_7);
6257 __Pyx_GIVEREF(__pyx_t_1);
6258 if (__Pyx_PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_1) != (0)) __PYX_ERR(0, 45, __pyx_L1_error);
6259 __Pyx_GIVEREF(__pyx_t_2);
6260 if (__Pyx_PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_t_2) != (0)) __PYX_ERR(0, 45, __pyx_L1_error);
6261 __Pyx_GIVEREF(__pyx_t_3);
6262 if (__Pyx_PyTuple_SET_ITEM(__pyx_t_7, 2, __pyx_t_3) != (0)) __PYX_ERR(0, 45, __pyx_L1_error);
6263 __Pyx_GIVEREF(__pyx_t_4);
6264 if (__Pyx_PyTuple_SET_ITEM(__pyx_t_7, 3, __pyx_t_4) != (0)) __PYX_ERR(0, 45, __pyx_L1_error);
6265 __Pyx_GIVEREF(__pyx_t_5);
6266 if (__Pyx_PyTuple_SET_ITEM(__pyx_t_7, 4, __pyx_t_5) != (0)) __PYX_ERR(0, 45, __pyx_L1_error);
6267 __Pyx_GIVEREF(__pyx_t_6);
6268 if (__Pyx_PyTuple_SET_ITEM(__pyx_t_7, 5, __pyx_t_6) != (0)) __PYX_ERR(0, 45, __pyx_L1_error);
6276 PyObject *__pyx_temp;
6278 __pyx_temp = __pyx_r;
6279 __pyx_r = __pyx_t_7;
6281 __Pyx_XDECREF(__pyx_temp);
6296 __Pyx_XDECREF(__pyx_t_1);
6297 __Pyx_XDECREF(__pyx_t_2);
6298 __Pyx_XDECREF(__pyx_t_3);
6299 __Pyx_XDECREF(__pyx_t_4);
6300 __Pyx_XDECREF(__pyx_t_5);
6301 __Pyx_XDECREF(__pyx_t_6);
6302 __Pyx_XDECREF(__pyx_t_7);
6303 __Pyx_AddTraceback(
"cpskRelations.vgm_calc_from_psic", __pyx_clineno, __pyx_lineno, __pyx_filename);
6309 __Pyx_XGIVEREF(__pyx_r);
6310 __Pyx_RefNannyFinishContext();
6315static PyMethodDef __pyx_methods[] = {
6319static CYTHON_SMALL_CODE
int __Pyx_InitCachedBuiltins(__pyx_mstatetype *__pyx_mstate);
6320static CYTHON_SMALL_CODE
int __Pyx_InitCachedConstants(__pyx_mstatetype *__pyx_mstate);
6321static CYTHON_SMALL_CODE
int __Pyx_InitGlobals(
void);
6322static CYTHON_SMALL_CODE
int __Pyx_InitAfterSharedUtility(
void);
6323static CYTHON_SMALL_CODE
int __Pyx_InitConstants(__pyx_mstatetype *__pyx_mstate);
6324static CYTHON_SMALL_CODE
int __Pyx_modinit_Global_init_code(__pyx_mstatetype *__pyx_mstate);
6325static CYTHON_SMALL_CODE
int __Pyx_modinit_Variable_export_code(__pyx_mstatetype *__pyx_mstate);
6326static CYTHON_SMALL_CODE
int __Pyx_modinit_Function_export_code(__pyx_mstatetype *__pyx_mstate);
6327static CYTHON_SMALL_CODE
int __Pyx_modinit_Type_import_code(__pyx_mstatetype *__pyx_mstate);
6328static CYTHON_SMALL_CODE
int __Pyx_modinit_Variable_import_code(__pyx_mstatetype *__pyx_mstate);
6329static CYTHON_SMALL_CODE
int __Pyx_modinit_Function_import_code(__pyx_mstatetype *__pyx_mstate);
6330static CYTHON_SMALL_CODE
int __Pyx_CreateCodeObjects(__pyx_mstatetype *__pyx_mstate);
6333static int __Pyx_modinit_Global_init_code(__pyx_mstatetype *__pyx_mstate) {
6334 __Pyx_RefNannyDeclarations
6335 CYTHON_UNUSED_VAR(__pyx_mstate);
6336 __Pyx_RefNannySetupContext(
"__Pyx_modinit_Global_init_code", 0);
6338 __Pyx_RefNannyFinishContext();
6342static int __Pyx_modinit_Variable_export_code(__pyx_mstatetype *__pyx_mstate) {
6343 __Pyx_RefNannyDeclarations
6344 CYTHON_UNUSED_VAR(__pyx_mstate);
6345 __Pyx_RefNannySetupContext(
"__Pyx_modinit_Variable_export_code", 0);
6347 __Pyx_RefNannyFinishContext();
6351static int __Pyx_modinit_Function_export_code(__pyx_mstatetype *__pyx_mstate) {
6352 __Pyx_RefNannyDeclarations
6353 CYTHON_UNUSED_VAR(__pyx_mstate);
6354 __Pyx_RefNannySetupContext(
"__Pyx_modinit_Function_export_code", 0);
6356 __Pyx_RefNannyFinishContext();
6360static int __Pyx_modinit_Type_import_code(__pyx_mstatetype *__pyx_mstate) {
6361 __Pyx_RefNannyDeclarations
6362 PyObject *__pyx_t_1 = NULL;
6363 int __pyx_lineno = 0;
6364 const char *__pyx_filename = NULL;
6365 int __pyx_clineno = 0;
6366 CYTHON_UNUSED_VAR(__pyx_mstate);
6367 __Pyx_RefNannySetupContext(
"__Pyx_modinit_Type_import_code", 0);
6369 __pyx_t_1 = PyImport_ImportModule(__Pyx_BUILTIN_MODULE_NAME);
if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 9, __pyx_L1_error)
6370 __Pyx_GOTREF(__pyx_t_1);
6371 __pyx_mstate->__pyx_ptype_7cpython_4type_type = __Pyx_ImportType_3_3_0(__pyx_t_1, __Pyx_BUILTIN_MODULE_NAME,
"type",
6372 #
if defined(PYPY_VERSION_NUM) && PYPY_VERSION_NUM < 0x050B0000
6373 sizeof(PyTypeObject), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(PyTypeObject),
6374 #elif CYTHON_COMPILING_IN_LIMITED_API
6377 sizeof(PyHeapTypeObject), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(PyHeapTypeObject),
6379 __Pyx_ImportType_CheckSize_Warn_3_3_0);
if (!__pyx_mstate->__pyx_ptype_7cpython_4type_type) __PYX_ERR(2, 9, __pyx_L1_error)
6380 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
6381 __pyx_t_1 = PyImport_ImportModule(
"numpy");
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 229, __pyx_L1_error)
6382 __Pyx_GOTREF(__pyx_t_1);
6383 __pyx_mstate->__pyx_ptype_5numpy_dtype = __Pyx_ImportType_3_3_0(__pyx_t_1,
"numpy",
"dtype",
6384 #
if defined(PYPY_VERSION_NUM) && PYPY_VERSION_NUM < 0x050B0000
6385 sizeof(PyArray_Descr), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(PyArray_Descr),
6386 #elif CYTHON_COMPILING_IN_LIMITED_API
6387 sizeof(PyArray_Descr), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(PyArray_Descr),
6389 sizeof(PyArray_Descr), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(PyArray_Descr),
6391 __Pyx_ImportType_CheckSize_Ignore_3_3_0);
if (!__pyx_mstate->__pyx_ptype_5numpy_dtype) __PYX_ERR(1, 229, __pyx_L1_error)
6392 __pyx_mstate->__pyx_ptype_5numpy_flatiter = __Pyx_ImportType_3_3_0(__pyx_t_1,
"numpy",
"flatiter",
6393 #
if defined(PYPY_VERSION_NUM) && PYPY_VERSION_NUM < 0x050B0000
6394 sizeof(PyArrayIterObject), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(PyArrayIterObject),
6395 #elif CYTHON_COMPILING_IN_LIMITED_API
6396 sizeof(PyArrayIterObject), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(PyArrayIterObject),
6398 sizeof(PyArrayIterObject), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(PyArrayIterObject),
6400 __Pyx_ImportType_CheckSize_Ignore_3_3_0);
if (!__pyx_mstate->__pyx_ptype_5numpy_flatiter) __PYX_ERR(1, 286, __pyx_L1_error)
6401 __pyx_mstate->__pyx_ptype_5numpy_broadcast = __Pyx_ImportType_3_3_0(__pyx_t_1,
"numpy",
"broadcast",
6402 #
if defined(PYPY_VERSION_NUM) && PYPY_VERSION_NUM < 0x050B0000
6403 sizeof(PyArrayMultiIterObject), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(PyArrayMultiIterObject),
6404 #elif CYTHON_COMPILING_IN_LIMITED_API
6405 sizeof(PyArrayMultiIterObject), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(PyArrayMultiIterObject),
6407 sizeof(PyArrayMultiIterObject), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(PyArrayMultiIterObject),
6409 __Pyx_ImportType_CheckSize_Ignore_3_3_0);
if (!__pyx_mstate->__pyx_ptype_5numpy_broadcast) __PYX_ERR(1, 290, __pyx_L1_error)
6410 __pyx_mstate->__pyx_ptype_5numpy_ndarray = __Pyx_ImportType_3_3_0(__pyx_t_1,
"numpy",
"ndarray",
6411 #
if defined(PYPY_VERSION_NUM) && PYPY_VERSION_NUM < 0x050B0000
6412 sizeof(PyArrayObject), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(PyArrayObject),
6413 #elif CYTHON_COMPILING_IN_LIMITED_API
6414 sizeof(PyArrayObject), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(PyArrayObject),
6416 sizeof(PyArrayObject), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(PyArrayObject),
6418 __Pyx_ImportType_CheckSize_Ignore_3_3_0);
if (!__pyx_mstate->__pyx_ptype_5numpy_ndarray) __PYX_ERR(1, 329, __pyx_L1_error)
6419 __pyx_mstate->__pyx_ptype_5numpy_generic = __Pyx_ImportType_3_3_0(__pyx_t_1,
"numpy",
"generic",
6420 #
if defined(PYPY_VERSION_NUM) && PYPY_VERSION_NUM < 0x050B0000
6421 sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(PyObject),
6422 #elif CYTHON_COMPILING_IN_LIMITED_API
6423 sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(PyObject),
6425 sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(PyObject),
6427 __Pyx_ImportType_CheckSize_Warn_3_3_0);
if (!__pyx_mstate->__pyx_ptype_5numpy_generic) __PYX_ERR(1, 847, __pyx_L1_error)
6428 __pyx_mstate->__pyx_ptype_5numpy_number = __Pyx_ImportType_3_3_0(__pyx_t_1,
"numpy",
"number",
6429 #
if defined(PYPY_VERSION_NUM) && PYPY_VERSION_NUM < 0x050B0000
6430 sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(PyObject),
6431 #elif CYTHON_COMPILING_IN_LIMITED_API
6432 sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(PyObject),
6434 sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(PyObject),
6436 __Pyx_ImportType_CheckSize_Warn_3_3_0);
if (!__pyx_mstate->__pyx_ptype_5numpy_number) __PYX_ERR(1, 849, __pyx_L1_error)
6437 __pyx_mstate->__pyx_ptype_5numpy_integer = __Pyx_ImportType_3_3_0(__pyx_t_1,
"numpy",
"integer",
6438 #
if defined(PYPY_VERSION_NUM) && PYPY_VERSION_NUM < 0x050B0000
6439 sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(PyObject),
6440 #elif CYTHON_COMPILING_IN_LIMITED_API
6441 sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(PyObject),
6443 sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(PyObject),
6445 __Pyx_ImportType_CheckSize_Warn_3_3_0);
if (!__pyx_mstate->__pyx_ptype_5numpy_integer) __PYX_ERR(1, 851, __pyx_L1_error)
6446 __pyx_mstate->__pyx_ptype_5numpy_signedinteger = __Pyx_ImportType_3_3_0(__pyx_t_1,
"numpy",
"signedinteger",
6447 #
if defined(PYPY_VERSION_NUM) && PYPY_VERSION_NUM < 0x050B0000
6448 sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(PyObject),
6449 #elif CYTHON_COMPILING_IN_LIMITED_API
6450 sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(PyObject),
6452 sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(PyObject),
6454 __Pyx_ImportType_CheckSize_Warn_3_3_0);
if (!__pyx_mstate->__pyx_ptype_5numpy_signedinteger) __PYX_ERR(1, 853, __pyx_L1_error)
6455 __pyx_mstate->__pyx_ptype_5numpy_unsignedinteger = __Pyx_ImportType_3_3_0(__pyx_t_1,
"numpy",
"unsignedinteger",
6456 #
if defined(PYPY_VERSION_NUM) && PYPY_VERSION_NUM < 0x050B0000
6457 sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(PyObject),
6458 #elif CYTHON_COMPILING_IN_LIMITED_API
6459 sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(PyObject),
6461 sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(PyObject),
6463 __Pyx_ImportType_CheckSize_Warn_3_3_0);
if (!__pyx_mstate->__pyx_ptype_5numpy_unsignedinteger) __PYX_ERR(1, 855, __pyx_L1_error)
6464 __pyx_mstate->__pyx_ptype_5numpy_inexact = __Pyx_ImportType_3_3_0(__pyx_t_1,
"numpy",
"inexact",
6465 #
if defined(PYPY_VERSION_NUM) && PYPY_VERSION_NUM < 0x050B0000
6466 sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(PyObject),
6467 #elif CYTHON_COMPILING_IN_LIMITED_API
6468 sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(PyObject),
6470 sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(PyObject),
6472 __Pyx_ImportType_CheckSize_Warn_3_3_0);
if (!__pyx_mstate->__pyx_ptype_5numpy_inexact) __PYX_ERR(1, 857, __pyx_L1_error)
6473 __pyx_mstate->__pyx_ptype_5numpy_floating = __Pyx_ImportType_3_3_0(__pyx_t_1,
"numpy",
"floating",
6474 #
if defined(PYPY_VERSION_NUM) && PYPY_VERSION_NUM < 0x050B0000
6475 sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(PyObject),
6476 #elif CYTHON_COMPILING_IN_LIMITED_API
6477 sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(PyObject),
6479 sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(PyObject),
6481 __Pyx_ImportType_CheckSize_Warn_3_3_0);
if (!__pyx_mstate->__pyx_ptype_5numpy_floating) __PYX_ERR(1, 859, __pyx_L1_error)
6482 __pyx_mstate->__pyx_ptype_5numpy_complexfloating = __Pyx_ImportType_3_3_0(__pyx_t_1,
"numpy",
"complexfloating",
6483 #
if defined(PYPY_VERSION_NUM) && PYPY_VERSION_NUM < 0x050B0000
6484 sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(PyObject),
6485 #elif CYTHON_COMPILING_IN_LIMITED_API
6486 sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(PyObject),
6488 sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(PyObject),
6490 __Pyx_ImportType_CheckSize_Warn_3_3_0);
if (!__pyx_mstate->__pyx_ptype_5numpy_complexfloating) __PYX_ERR(1, 861, __pyx_L1_error)
6491 __pyx_mstate->__pyx_ptype_5numpy_flexible = __Pyx_ImportType_3_3_0(__pyx_t_1,
"numpy",
"flexible",
6492 #
if defined(PYPY_VERSION_NUM) && PYPY_VERSION_NUM < 0x050B0000
6493 sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(PyObject),
6494 #elif CYTHON_COMPILING_IN_LIMITED_API
6495 sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(PyObject),
6497 sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(PyObject),
6499 __Pyx_ImportType_CheckSize_Warn_3_3_0);
if (!__pyx_mstate->__pyx_ptype_5numpy_flexible) __PYX_ERR(1, 863, __pyx_L1_error)
6500 __pyx_mstate->__pyx_ptype_5numpy_character = __Pyx_ImportType_3_3_0(__pyx_t_1,
"numpy",
"character",
6501 #
if defined(PYPY_VERSION_NUM) && PYPY_VERSION_NUM < 0x050B0000
6502 sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(PyObject),
6503 #elif CYTHON_COMPILING_IN_LIMITED_API
6504 sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(PyObject),
6506 sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(PyObject),
6508 __Pyx_ImportType_CheckSize_Warn_3_3_0);
if (!__pyx_mstate->__pyx_ptype_5numpy_character) __PYX_ERR(1, 865, __pyx_L1_error)
6509 __pyx_mstate->__pyx_ptype_5numpy_ufunc = __Pyx_ImportType_3_3_0(__pyx_t_1,
"numpy",
"ufunc",
6510 #
if defined(PYPY_VERSION_NUM) && PYPY_VERSION_NUM < 0x050B0000
6511 sizeof(PyUFuncObject), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(PyUFuncObject),
6512 #elif CYTHON_COMPILING_IN_LIMITED_API
6513 sizeof(PyUFuncObject), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(PyUFuncObject),
6515 sizeof(PyUFuncObject), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(PyUFuncObject),
6517 __Pyx_ImportType_CheckSize_Ignore_3_3_0);
if (!__pyx_mstate->__pyx_ptype_5numpy_ufunc) __PYX_ERR(1, 946, __pyx_L1_error)
6518 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
6519 __Pyx_RefNannyFinishContext();
6522 __Pyx_XDECREF(__pyx_t_1);
6523 __Pyx_RefNannyFinishContext();
6527static int __Pyx_modinit_Variable_import_code(__pyx_mstatetype *__pyx_mstate) {
6528 __Pyx_RefNannyDeclarations
6529 CYTHON_UNUSED_VAR(__pyx_mstate);
6530 __Pyx_RefNannySetupContext(
"__Pyx_modinit_Variable_import_code", 0);
6532 __Pyx_RefNannyFinishContext();
6536static int __Pyx_modinit_Function_import_code(__pyx_mstatetype *__pyx_mstate) {
6537 __Pyx_RefNannyDeclarations
6538 CYTHON_UNUSED_VAR(__pyx_mstate);
6539 __Pyx_RefNannySetupContext(
"__Pyx_modinit_Function_import_code", 0);
6541 __Pyx_RefNannyFinishContext();
6545#if CYTHON_PEP489_MULTI_PHASE_INIT
6546static PyObject* __pyx_pymod_create(PyObject *spec, PyModuleDef *def);
6547static int __pyx_pymod_exec_cpskRelations(PyObject* module);
6548static PyModuleDef_Slot __pyx_moduledef_slots[] = {
6549 {Py_mod_create, (
void*)__pyx_pymod_create},
6550 {Py_mod_exec, (
void*)__pyx_pymod_exec_cpskRelations},
6551 #if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING
6552 {Py_mod_gil, __Pyx_FREETHREADING_COMPATIBLE},
6554 #if PY_VERSION_HEX >= 0x030C0000 && CYTHON_USE_MODULE_STATE
6555 {Py_mod_multiple_interpreters, Py_MOD_MULTIPLE_INTERPRETERS_NOT_SUPPORTED},
6563 struct PyModuleDef __pyx_moduledef =
6565 static struct PyModuleDef __pyx_moduledef =
6568 PyModuleDef_HEAD_INIT,
6571 #if CYTHON_USE_MODULE_STATE
6572 sizeof(__pyx_mstatetype),
6574 (CYTHON_PEP489_MULTI_PHASE_INIT) ? 0 : -1,
6577 #if CYTHON_PEP489_MULTI_PHASE_INIT
6578 __pyx_moduledef_slots,
6582 #if CYTHON_USE_MODULE_STATE
6597#ifndef CYTHON_NO_PYINIT_EXPORT
6598 #define __Pyx_PyMODINIT_FUNC PyMODINIT_FUNC
6601 #define __Pyx_PyMODINIT_FUNC extern "C" PyObject *
6603 #define __Pyx_PyMODINIT_FUNC PyObject *
6607__Pyx_PyMODINIT_FUNC PyInit_cpskRelations(
void) CYTHON_SMALL_CODE;
6608__Pyx_PyMODINIT_FUNC PyInit_cpskRelations(
void)
6609#if CYTHON_PEP489_MULTI_PHASE_INIT
6611 return PyModuleDef_Init(&__pyx_moduledef);
6614#if CYTHON_COMPILING_IN_LIMITED_API && (__PYX_LIMITED_VERSION_HEX < 0x030A0000 &&\
6615 (defined(_WIN32) || defined(WIN32) || defined(MS_WINDOWS)))
6616static PY_INT64_T __Pyx_GetCurrentInterpreterId(
void) {
6618 PyObject *module = PyImport_ImportModule(
"_interpreters");
6620 if (!PyErr_ExceptionMatches(PyExc_Exception)) {
6624 module = PyImport_ImportModule("_xxsubinterpreters");
6625 if (!module)
goto bad;
6627 PyObject *current = PyObject_CallMethod(module,
"get_current", NULL);
6629 if (!current)
goto bad;
6630 if (PyTuple_Check(current)) {
6631 PyObject *new_current = PySequence_GetItem(current, 0);
6633 current = new_current;
6634 if (!new_current)
goto bad;
6636 long long as_c_int = PyLong_AsLongLong(current);
6641 PySys_WriteStderr(
"__Pyx_GetCurrentInterpreterId failed. Try setting the C define CYTHON_PEP489_MULTI_PHASE_INIT=0\n");
6645#if !CYTHON_USE_MODULE_STATE
6646static CYTHON_SMALL_CODE
int __Pyx_check_single_interpreter(
void) {
6647 static PY_INT64_T main_interpreter_id = -1;
6648#if CYTHON_COMPILING_IN_GRAAL && defined(GRAALPY_VERSION_NUM) && GRAALPY_VERSION_NUM > 0x19000000
6649 PY_INT64_T current_id = GraalPyInterpreterState_GetIDFromThreadState(PyThreadState_Get());
6650#elif CYTHON_COMPILING_IN_GRAAL
6651 PY_INT64_T current_id = PyInterpreterState_GetIDFromThreadState(PyThreadState_Get());
6652#elif CYTHON_COMPILING_IN_LIMITED_API && (__PYX_LIMITED_VERSION_HEX < 0x030A0000 &&\
6653 (defined(_WIN32) || defined(WIN32) || defined(MS_WINDOWS)))
6654 PY_INT64_T current_id = __Pyx_GetCurrentInterpreterId();
6655#elif CYTHON_COMPILING_IN_LIMITED_API
6656 PY_INT64_T current_id = PyInterpreterState_GetID(PyInterpreterState_Get());
6658 PY_INT64_T current_id = PyInterpreterState_GetID(PyThreadState_Get()->interp);
6660 if (unlikely(current_id == -1)) {
6663 if (main_interpreter_id == -1) {
6664 main_interpreter_id = current_id;
6666 }
else if (unlikely(main_interpreter_id != current_id)) {
6669 "Interpreter change detected - this module can only be loaded into one interpreter per process.");
6675static CYTHON_SMALL_CODE
int __Pyx_copy_spec_to_module(PyObject *spec, PyObject *moddict,
const char* from_name,
const char* to_name,
int allow_none)
6677 PyObject *value = PyObject_GetAttrString(spec, from_name);
6679 if (likely(value)) {
6680 if (allow_none || value != Py_None) {
6681 result = PyDict_SetItemString(moddict, to_name, value);
6684 }
else if (PyErr_ExceptionMatches(PyExc_AttributeError)) {
6691static CYTHON_SMALL_CODE PyObject* __pyx_pymod_create(PyObject *spec, PyModuleDef *def) {
6692 PyObject *module = NULL, *moddict, *modname;
6693 CYTHON_UNUSED_VAR(def);
6694 #if !CYTHON_USE_MODULE_STATE
6695 if (__Pyx_check_single_interpreter())
6699 return __Pyx_NewRef(__pyx_m);
6700 modname = PyObject_GetAttrString(spec,
"name");
6701 if (unlikely(!modname))
goto bad;
6702 module = PyModule_NewObject(modname);
6704 if (unlikely(!module))
goto bad;
6705 moddict = PyModule_GetDict(module);
6706 if (unlikely(!moddict))
goto bad;
6707 if (unlikely(__Pyx_copy_spec_to_module(spec, moddict,
"loader",
"__loader__", 1) < 0))
goto bad;
6708 if (unlikely(__Pyx_copy_spec_to_module(spec, moddict,
"origin",
"__file__", 1) < 0))
goto bad;
6709 if (unlikely(__Pyx_copy_spec_to_module(spec, moddict,
"parent",
"__package__", 1) < 0))
goto bad;
6710 if (unlikely(__Pyx_copy_spec_to_module(spec, moddict,
"submodule_search_locations",
"__path__", 0) < 0))
goto bad;
6718static CYTHON_SMALL_CODE
int __pyx_pymod_exec_cpskRelations(PyObject *__pyx_pyinit_module)
6721 int stringtab_initialized = 0;
6722 #if CYTHON_USE_MODULE_STATE
6723 int pystate_addmodule_run = 0;
6725 __pyx_mstatetype *__pyx_mstate = NULL;
6726 PyObject *__pyx_t_1 = NULL;
6727 PyObject *__pyx_t_2 = NULL;
6728 int __pyx_lineno = 0;
6729 const char *__pyx_filename = NULL;
6730 int __pyx_clineno = 0;
6731 __Pyx_RefNannyDeclarations
6732 #if CYTHON_PEP489_MULTI_PHASE_INIT
6734 if (__pyx_m == __pyx_pyinit_module)
return 0;
6735 PyErr_SetString(PyExc_RuntimeError,
"Module 'cpskRelations' has already been imported. Re-initialisation is not supported.");
6739 if (__pyx_m)
return __Pyx_NewRef(__pyx_m);
6742 #if CYTHON_PEP489_MULTI_PHASE_INIT
6743 __pyx_t_1 = __pyx_pyinit_module;
6744 Py_INCREF(__pyx_t_1);
6746 __pyx_t_1 = PyModule_Create(&__pyx_moduledef);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1, __pyx_L1_error)
6748 #if CYTHON_USE_MODULE_STATE
6750 int add_module_result = __Pyx_State_AddModule(__pyx_t_1, &__pyx_moduledef);
6752 if (unlikely((add_module_result < 0))) __PYX_ERR(0, 1, __pyx_L1_error)
6753 pystate_addmodule_run = 1;
6756 __pyx_m = __pyx_t_1;
6758 #if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING
6759 PyUnstable_Module_SetGIL(__pyx_m, Py_MOD_GIL_USED);
6761 __pyx_mstate = __pyx_mstate_global;
6762 CYTHON_UNUSED_VAR(__pyx_t_1);
6763 __pyx_mstate->__pyx_d = PyModule_GetDict(__pyx_m);
if (unlikely(!__pyx_mstate->__pyx_d)) __PYX_ERR(0, 1, __pyx_L1_error)
6764 Py_INCREF(__pyx_mstate->__pyx_d);
6765 __pyx_mstate->__pyx_b = __Pyx_PyImport_AddModuleRef(__Pyx_BUILTIN_MODULE_NAME);
if (unlikely(!__pyx_mstate->__pyx_b)) __PYX_ERR(0, 1, __pyx_L1_error)
6766 __pyx_mstate->__pyx_cython_runtime = __Pyx_PyImport_AddModuleRef(
"cython_runtime");
if (unlikely(!__pyx_mstate->__pyx_cython_runtime)) __PYX_ERR(0, 1, __pyx_L1_error)
6767 if (PyObject_SetAttrString(__pyx_m,
"__builtins__", __pyx_mstate->__pyx_b) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
6770 __Pyx_RefNanny = __Pyx_RefNannyImportAPI(
"refnanny");
6771 if (!__Pyx_RefNanny) {
6772 if (PyErr_ExceptionMatches(PyExc_Exception)) {
6774 __Pyx_RefNanny = __Pyx_RefNannyImportAPI(
"Cython.Runtime.refnanny");
6776 if (!__Pyx_RefNanny)
6777 Py_FatalError(
"failed to import 'refnanny' module");
6781__Pyx_RefNannySetupContext(
"PyInit_cpskRelations", 0);
6782 __Pyx_init_runtime_version();
6783 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)
6784 __pyx_mstate->__pyx_empty_tuple = PyTuple_New(0);
if (unlikely(!__pyx_mstate->__pyx_empty_tuple)) __PYX_ERR(0, 1, __pyx_L1_error)
6785 __pyx_mstate->__pyx_empty_bytes = PyBytes_FromStringAndSize(
"", 0);
if (unlikely(!__pyx_mstate->__pyx_empty_bytes)) __PYX_ERR(0, 1, __pyx_L1_error)
6786 __pyx_mstate->__pyx_empty_unicode = PyUnicode_FromStringAndSize(
"", 0);
if (unlikely(!__pyx_mstate->__pyx_empty_unicode)) __PYX_ERR(0, 1, __pyx_L1_error)
6789 if (__Pyx_InitConstants(__pyx_mstate) < (0)) __PYX_ERR(0, 1, __pyx_L1_error)
6790 stringtab_initialized = 1;
6791 if (__Pyx_InitGlobals() < (0)) __PYX_ERR(0, 1, __pyx_L1_error)
6792 if (__pyx_module_is_main_cpskRelations) {
6793 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)
6796 PyObject *modules = PyImport_GetModuleDict();
if (unlikely(!modules)) __PYX_ERR(0, 1, __pyx_L1_error)
6797 if (!PyDict_GetItemString(modules,
"cpskRelations")) {
6798 if (unlikely((PyDict_SetItemString(modules,
"cpskRelations", __pyx_m) < 0))) __PYX_ERR(0, 1, __pyx_L1_error)
6802 if (__Pyx_InitCachedBuiltins(__pyx_mstate) < (0)) __PYX_ERR(0, 1, __pyx_L1_error)
6804 if (__Pyx_InitCachedConstants(__pyx_mstate) < (0)) __PYX_ERR(0, 1, __pyx_L1_error)
6805 if (__Pyx_CreateCodeObjects(__pyx_mstate) < (0)) __PYX_ERR(0, 1, __pyx_L1_error)
6807 (void)__Pyx_modinit_Global_init_code(__pyx_mstate);
6808 (void)__Pyx_modinit_Variable_export_code(__pyx_mstate);
6809 (void)__Pyx_modinit_Function_export_code(__pyx_mstate);
6811 if (unlikely((__Pyx_modinit_Type_import_code(__pyx_mstate) < 0))) __PYX_ERR(0, 1, __pyx_L1_error)
6812 (void)__Pyx_modinit_Variable_import_code(__pyx_mstate);
6813 (void)__Pyx_modinit_Function_import_code(__pyx_mstate);
6814 if (__Pyx_InitAfterSharedUtility() < (0)) __PYX_ERR(0, 1, __pyx_L1_error)
6824 __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)
6825 __pyx_t_2 = __pyx_t_1;
6826 __Pyx_GOTREF(__pyx_t_2);
6827 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)
6828 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
6837 __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_13cpskRelations_1vgm_cal_from_sw, 0, __pyx_mstate_global->__pyx_n_u_vgm_cal_from_sw, NULL, __pyx_mstate_global->__pyx_n_u_cpskRelations, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[0]));
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 7, __pyx_L1_error)
6838 __Pyx_GOTREF(__pyx_t_2);
6839 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
6840 PyUnstable_Object_EnableDeferredRefcount(__pyx_t_2);
6842 if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_vgm_cal_from_sw, __pyx_t_2) < (0)) __PYX_ERR(0, 7, __pyx_L1_error)
6843 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
6852 __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_13cpskRelations_3vgm_calc_from_psic, 0, __pyx_mstate_global->__pyx_n_u_vgm_calc_from_psic, NULL, __pyx_mstate_global->__pyx_n_u_cpskRelations, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1]));
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 27, __pyx_L1_error)
6853 __Pyx_GOTREF(__pyx_t_2);
6854 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
6855 PyUnstable_Object_EnableDeferredRefcount(__pyx_t_2);
6857 if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_vgm_calc_from_psic, __pyx_t_2) < (0)) __PYX_ERR(0, 27, __pyx_L1_error)
6858 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
6865 __pyx_t_2 = __Pyx_PyDict_NewPresized(0);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1, __pyx_L1_error)
6866 __Pyx_GOTREF(__pyx_t_2);
6867 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)
6868 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
6874 __Pyx_XDECREF(__pyx_t_2);
6876 if (__pyx_mstate->__pyx_d && stringtab_initialized) {
6877 __Pyx_AddTraceback(
"init cpskRelations", __pyx_clineno, __pyx_lineno, __pyx_filename);
6879 #if !CYTHON_USE_MODULE_STATE
6883 if (pystate_addmodule_run) {
6884 PyObject *tp, *value, *tb;
6885 __Pyx_PyErr_FetchException(&tp, &value, &tb);
6886 __Pyx_State_RemoveModule(&__pyx_moduledef);
6887 __Pyx_PyErr_RestoreException(tp, value, tb);
6890 }
else if (!PyErr_Occurred()) {
6891 PyErr_SetString(PyExc_ImportError,
"init cpskRelations");
6894 __Pyx_RefNannyFinishContext();
6895 #if CYTHON_PEP489_MULTI_PHASE_INIT
6896 return (__pyx_m != NULL) ? 0 : -1;
6904static int __Pyx_InitCachedBuiltins(__pyx_mstatetype *__pyx_mstate) {
6905 CYTHON_UNUSED_VAR(__pyx_mstate);
6908 __pyx_mstate->__pyx_umethod_PyDict_Type_items.type = (PyObject*)&PyDict_Type;
6909 __pyx_mstate->__pyx_umethod_PyDict_Type_items.method_name = &__pyx_mstate->__pyx_n_u_items;
6910 __pyx_mstate->__pyx_umethod_PyDict_Type_pop.type = (PyObject*)&PyDict_Type;
6911 __pyx_mstate->__pyx_umethod_PyDict_Type_pop.method_name = &__pyx_mstate->__pyx_n_u_pop;
6912 __pyx_mstate->__pyx_umethod_PyDict_Type_values.type = (PyObject*)&PyDict_Type;
6913 __pyx_mstate->__pyx_umethod_PyDict_Type_values.method_name = &__pyx_mstate->__pyx_n_u_values;
6918static int __Pyx_InitCachedConstants(__pyx_mstatetype *__pyx_mstate) {
6919 __Pyx_RefNannyDeclarations
6920 CYTHON_UNUSED_VAR(__pyx_mstate);
6921 __Pyx_RefNannySetupContext(
"__Pyx_InitCachedConstants", 0);
6922 __Pyx_RefNannyFinishContext();
6927static int __Pyx_InitConstants(__pyx_mstatetype *__pyx_mstate) {
6928 int __pyx_lineno = 0;
6929 const char *__pyx_filename = NULL;
6930 int __pyx_clineno = 0;
6931 CYTHON_UNUSED_VAR(__pyx_mstate);
6933 const struct {
const unsigned int length: 6; } str_length_index[] = {{1},{39},{34},{25},{2},{20},{12},{8},{8},{10},{8},{12},{8},{13},{5},{18},{18},{13},{9},{5},{1},{2},{6},{5},{3},{4},{3},{5},{9},{10},{6},{6},{6},{15},{18}};
6934 const struct {
const unsigned int length: 7; } bytes_length_index[] = {{112},{112}};
6935 #ifndef CYTHON_COMPRESS_STRINGS
6936 #define CYTHON_COMPRESS_STRINGS 0
6938 #if (CYTHON_COMPRESS_STRINGS) == 1
6939static const char cstring[] =
"x\332\255P;N\0031\020%\202\010\201\240\010\\ \022\022\025\nB9\000B JD\222\003X\2033K\254\370\027\3178\3116\220r\313-S\246L\271e\216\30218\002\273\t\240 D\207%\277\367\306~\232y\366\265\215\306\247-!]\300\226\211\232\025\204\000i3\001\245\261\337d\327T\306\273\300\333\266h\200\007\277\034>8\306H\227\322\323\260\213\032X9K-\237N{\023!\036\323i\271\357\224d\361\200S\356b\"\004X\353\030\030E\271\222he\305\006\224]\263\353G\275\276\261`\326<\212\240\2774#qI\212\252<.\262\262\010\332\017\000(\265R\271\326\367)I]\242({r\000\211O \207?\342\241\047A\006\264V\214\206\214\365\226D\037\365\372\261\336yO\252\262\207\211\013\033\020\3544!\3671\201\362\253hR\346\235V\250\354\030tD\032?\033!A\213$8#h\362Y\312M]u\233\325\336Ov\352\207Y#;\313:o{\007\177\213\343\254\223\311\274\261%.\226wE\255(\305\376\354%\357\344P\211\230\335T\346\243\3546\033\347\275y}\336[\324\027\275\345\376\222\212\363\325\356\352\352\277\347\275\346\220\2176\3638o\3478o\317q\321^\014\213\323\342~u\266\352|\000\377\360\347p";
6940 PyObject *data = __Pyx_DecompressString(cstring, 349, 1);
6941 #define __Pyx_DecompressString_LZSS_UNUSED
6942 if (unlikely(!data)) __PYX_ERR(0, 1, __pyx_L1_error)
6943 const char*
const bytes = __Pyx_PyBytes_AsString(data);
6944 #if !CYTHON_ASSUME_SAFE_MACROS
6945 if (likely(bytes));
else { Py_DECREF(data); __PYX_ERR(0, 1, __pyx_L1_error) }
6948static const char bytes[] =
"?numpy._core.multiarray failed to importnumpy._core.umath failed to importproteus/cpskRelations.pyxSw__Pyx_PyDict_NextRef__annotate____func____main____module____name____qualname____test___is_coroutinealphaasyncio.coroutinescline_in_tracebackcpskRelationseps_smallitemsmnpns_delnumpypoppsicpskrworkrwork_tolsetdefaultsw_maxsw_minvaluesvgm_cal_from_swvgm_calc_from_psic\200\001\360\022\000\005\n\210\021\210#\210Q\330\004\t\210\021\210#\210Q\330\004\t\210\021\210#\210Q\330\004\t\210\021\210#\210Q\330\004\r\210Q\210c\220\021\330\004\r\210Q\210c\220\021\330\004,\250D\260\001\260\021\330\004\007\200~\220Q\220a\330\004\007\200u\210A\210Q\330\004\014\210C\210v\220S\230\005\230S\240\005\240S\250\007\250s\260&\270\003\2701\200\001\360\022\000\005\n\210\021\210#\210Q\330\004\t\210\021\210#\210Q\330\004\t\210\021\210#\210Q\330\004\t\210\021\210#\210Q\330\004\r\210Q\210c\220\021\330\004\r\210Q\210c\220\021\330\004,\250D\260\001\260\021\330\004\007\200~\220Q\220a\330\004\007\200\177\220a\220q\330\004\014\210C\210t\2203\220e\2303\230e\2403\240k\260\023\260F\270#\270Q";
6949 PyObject *data = NULL;
6950 #define __Pyx_DecompressString_UNUSED
6951 #define __Pyx_DecompressString_LZSS_UNUSED
6953 PyObject **stringtab = __pyx_mstate->__pyx_string_tab;
6955 for (
int i = 0; i < 35; i++) {
6956 Py_ssize_t bytes_length = str_length_index[i].length;
6957 PyObject *
string = PyUnicode_DecodeUTF8(bytes + pos, bytes_length, NULL);
6958 if (likely(
string) && i >= 4) PyUnicode_InternInPlace(&
string);
6959 if (unlikely(!
string)) {
6961 __PYX_ERR(0, 1, __pyx_L1_error)
6963 stringtab[i] = string;
6964 pos += bytes_length;
6966 for (
int i = 35; i < 37; i++) {
6967 Py_ssize_t bytes_length = bytes_length_index[i-35].length;
6968 PyObject *
string = PyBytes_FromStringAndSize(bytes + pos, bytes_length);
6969 stringtab[i] = string;
6970 pos += bytes_length;
6971 if (unlikely(!
string)) {
6973 __PYX_ERR(0, 1, __pyx_L1_error)
6977 for (Py_ssize_t i = 0; i < 37; i++) {
6978 if (unlikely(PyObject_Hash(stringtab[i]) == -1)) {
6979 __PYX_ERR(0, 1, __pyx_L1_error)
6982 #if CYTHON_IMMORTAL_CONSTANTS
6984 PyObject **table = stringtab + 35;
6985 for (Py_ssize_t i=0; i<2; ++i) {
6986 #if PY_VERSION_HEX >= 0x030F0000
6987 PyUnstable_SetImmortal(table[i]);
6988 #elif CYTHON_COMPILING_IN_CPYTHON_FREETHREADING
6989 if ((PY_SSIZE_T_MAX <= _Py_IMMORTAL_REFCNT_LOCAL))
break;
6990 #if PY_VERSION_HEX < 0x030E0000
6991 if (_Py_IsOwnedByCurrentThread(table[i]) && Py_REFCNT(table[i]) == 1)
6993 if (PyUnstable_Object_IsUniquelyReferenced(table[i]))
6996 Py_SET_REFCNT(table[i], ((Py_ssize_t)_Py_IMMORTAL_REFCNT_LOCAL + 1));
6999 if ((PY_SSIZE_T_MAX < _Py_IMMORTAL_INITIAL_REFCNT))
break;
7000 Py_SET_REFCNT(table[i], _Py_IMMORTAL_INITIAL_REFCNT);
7015 unsigned int argcount : 3;
7016 unsigned int num_posonly_args : 1;
7017 unsigned int num_kwonly_args : 1;
7018 unsigned int nlocals : 4;
7019 unsigned int flags : 10;
7020 unsigned int first_line : 5;
7021} __Pyx_PyCode_New_function_description;
7026static PyObject* __Pyx_PyCode_New(
7027 const __Pyx_PyCode_New_function_description descr,
7028 PyObject *
const *varnames,
7031 PyObject *line_table,
7032 PyObject *tuple_dedup_map
7036static int __Pyx_CreateCodeObjects(__pyx_mstatetype *__pyx_mstate) {
7037 PyObject* tuple_dedup_map = PyDict_New();
7038 if (unlikely(!tuple_dedup_map))
return -1;
7040 const __Pyx_PyCode_New_function_description descr = {7, 0, 0, 10, (
unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 7};
7041 PyObject*
const varnames[] = {__pyx_mstate->__pyx_n_u_Sw, __pyx_mstate->__pyx_n_u_sw_min, __pyx_mstate->__pyx_n_u_sw_max, __pyx_mstate->__pyx_n_u_alpha, __pyx_mstate->__pyx_n_u_m, __pyx_mstate->__pyx_n_u_eps_small, __pyx_mstate->__pyx_n_u_ns_del, __pyx_mstate->__pyx_n_u_rwork, __pyx_mstate->__pyx_n_u_rwork_tol, __pyx_mstate->__pyx_n_u_psk};
7042 __pyx_mstate_global->__pyx_codeobj_tab[0] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_proteus_cpskRelations_pyx, __pyx_mstate->__pyx_n_u_vgm_cal_from_sw, __pyx_mstate->__pyx_kp_b_iso88591_Q_Q_Q_Q_Qc_Qc_D_Qa_uAQ_CvS_S_S, tuple_dedup_map);
if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[0]))
goto bad;
7045 const __Pyx_PyCode_New_function_description descr = {7, 0, 0, 10, (
unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 27};
7046 PyObject*
const varnames[] = {__pyx_mstate->__pyx_n_u_psic, __pyx_mstate->__pyx_n_u_sw_min, __pyx_mstate->__pyx_n_u_sw_max, __pyx_mstate->__pyx_n_u_alpha, __pyx_mstate->__pyx_n_u_m, __pyx_mstate->__pyx_n_u_eps_small, __pyx_mstate->__pyx_n_u_ns_del, __pyx_mstate->__pyx_n_u_rwork, __pyx_mstate->__pyx_n_u_rwork_tol, __pyx_mstate->__pyx_n_u_psk};
7047 __pyx_mstate_global->__pyx_codeobj_tab[1] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_proteus_cpskRelations_pyx, __pyx_mstate->__pyx_n_u_vgm_calc_from_psic, __pyx_mstate->__pyx_kp_b_iso88591_Q_Q_Q_Q_Qc_Qc_D_Qa_aq_Ct3e3e3k, tuple_dedup_map);
if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1]))
goto bad;
7049 Py_DECREF(tuple_dedup_map);
7052 Py_DECREF(tuple_dedup_map);
7057static int __Pyx_InitGlobals(
void) {
7058 int __pyx_lineno = 0;
7059 const char *__pyx_filename = NULL;
7060 int __pyx_clineno = 0;
7062 if (likely(__Pyx_init_co_variables() == 0 && __Pyx_init_tpflags_variables() == 0));
else
7064 if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1, __pyx_L1_error)
7073 #ifdef NPY_FEATURE_VERSION
7074 #ifndef NO_IMPORT_ARRAY
7075 if (unlikely(_import_array() == -1)) {
7076 PyErr_SetString(PyExc_ImportError,
"numpy.core.multiarray failed to import "
7077 "(auto-generated because you didn't call 'numpy.import_array()' after cimporting numpy; "
7078 "use '<void>numpy._import_array' to disable if you are certain you don't need it).");
7083 if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1, __pyx_L1_error)
7086 if (likely(__pyx_CommonTypesMetaclass_init(__pyx_m) == 0));
else
7088 if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1, __pyx_L1_error)
7091 #if CYTHON_COMPILING_IN_LIMITED_API
7093 PyObject *typesModule=NULL;
7094 typesModule = PyImport_ImportModule(
"types");
7096 __pyx_mstate_global->__Pyx_CachedMethodType = PyObject_GetAttrString(typesModule,
"MethodType");
7097 Py_DECREF(typesModule);
7102 if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1, __pyx_L1_error)
7110static int __Pyx_InitAfterSharedUtility(
void) {
7111 int __pyx_lineno = 0;
7112 const char *__pyx_filename = NULL;
7113 int __pyx_clineno = 0;
7115 if (likely(__pyx_CyFunction_init(__pyx_m) == 0));
else
7117 if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1, __pyx_L1_error)
7128#pragma warning( push )
7133#pragma warning( disable : 4127 )
7143static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(
const char *modname) {
7144 PyObject *m = NULL, *p = NULL;
7146 m = PyImport_ImportModule(modname);
7148 p = PyObject_GetAttrString(m,
"RefNannyAPI");
7150 r = PyLong_AsVoidPtr(p);
7154 return (__Pyx_RefNannyAPIStruct *)
r;
7159#if CYTHON_USE_EXC_INFO_STACK && CYTHON_FAST_THREAD_STATE
7160static _PyErr_StackItem *
7161__Pyx_PyErr_GetTopmostException(PyThreadState *tstate)
7163 _PyErr_StackItem *exc_info = tstate->exc_info;
7164 while ((exc_info->exc_value == NULL || exc_info->exc_value == Py_None) &&
7165 exc_info->previous_item != NULL)
7167 exc_info = exc_info->previous_item;
7174#if CYTHON_FAST_THREAD_STATE
7175static CYTHON_INLINE
void __Pyx__ExceptionSave(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) {
7176 #if CYTHON_USE_EXC_INFO_STACK && PY_VERSION_HEX >= 0x030B00a4
7177 _PyErr_StackItem *exc_info = __Pyx_PyErr_GetTopmostException(tstate);
7178 PyObject *exc_value = exc_info->exc_value;
7179 if (exc_value == NULL || exc_value == Py_None) {
7186 *type = (PyObject*) Py_TYPE(exc_value);
7188 *tb = PyException_GetTraceback(exc_value);
7190 #elif CYTHON_USE_EXC_INFO_STACK
7191 _PyErr_StackItem *exc_info = __Pyx_PyErr_GetTopmostException(tstate);
7192 *type = exc_info->exc_type;
7193 *value = exc_info->exc_value;
7194 *tb = exc_info->exc_traceback;
7199 *type = tstate->exc_type;
7200 *value = tstate->exc_value;
7201 *tb = tstate->exc_traceback;
7207static CYTHON_INLINE
void __Pyx__ExceptionReset(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb) {
7208 #if CYTHON_USE_EXC_INFO_STACK && PY_VERSION_HEX >= 0x030B00a4
7209 _PyErr_StackItem *exc_info = tstate->exc_info;
7210 PyObject *tmp_value = exc_info->exc_value;
7211 exc_info->exc_value = value;
7212 Py_XDECREF(tmp_value);
7216 PyObject *tmp_type, *tmp_value, *tmp_tb;
7217 #if CYTHON_USE_EXC_INFO_STACK
7218 _PyErr_StackItem *exc_info = tstate->exc_info;
7219 tmp_type = exc_info->exc_type;
7220 tmp_value = exc_info->exc_value;
7221 tmp_tb = exc_info->exc_traceback;
7222 exc_info->exc_type = type;
7223 exc_info->exc_value = value;
7224 exc_info->exc_traceback = tb;
7226 tmp_type = tstate->exc_type;
7227 tmp_value = tstate->exc_value;
7228 tmp_tb = tstate->exc_traceback;
7229 tstate->exc_type = type;
7230 tstate->exc_value = value;
7231 tstate->exc_traceback = tb;
7233 Py_XDECREF(tmp_type);
7234 Py_XDECREF(tmp_value);
7241#if CYTHON_COMPILING_IN_CPYTHON
7242static int __Pyx_InBases(PyTypeObject *a, PyTypeObject *b) {
7244 a = __Pyx_PyType_GetSlot(a, tp_base, PyTypeObject*);
7248 return b == &PyBaseObject_Type;
7250static CYTHON_INLINE
int __Pyx_IsSubtype(PyTypeObject *a, PyTypeObject *b) {
7252 if (a == b)
return 1;
7256 n = PyTuple_GET_SIZE(mro);
7257 for (i = 0; i <
n; i++) {
7258 if (PyTuple_GET_ITEM(mro, i) == (PyObject *)b)
7263 return __Pyx_InBases(a, b);
7265static CYTHON_INLINE
int __Pyx_IsAnySubtype2(PyTypeObject *cls, PyTypeObject *a, PyTypeObject *b) {
7267 if (cls == a || cls == b)
return 1;
7271 n = PyTuple_GET_SIZE(mro);
7272 for (i = 0; i <
n; i++) {
7273 PyObject *base = PyTuple_GET_ITEM(mro, i);
7274 if (base == (PyObject *)a || base == (PyObject *)b)
7279 return __Pyx_InBases(cls, a) || __Pyx_InBases(cls, b);
7284#if CYTHON_FAST_THREAD_STATE
7285static CYTHON_INLINE
void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb) {
7286#if PY_VERSION_HEX >= 0x030C00A6
7287 PyObject *tmp_value;
7288 assert(type == NULL || (value != NULL && type == (PyObject*) Py_TYPE(value)));
7290 #if CYTHON_COMPILING_IN_CPYTHON
7291 if (unlikely(((PyBaseExceptionObject*) value)->traceback != tb))
7293 PyException_SetTraceback(value, tb);
7295 tmp_value = tstate->current_exception;
7296 tstate->current_exception = value;
7297 Py_XDECREF(tmp_value);
7301 PyObject *tmp_type, *tmp_value, *tmp_tb;
7302 tmp_type = tstate->curexc_type;
7303 tmp_value = tstate->curexc_value;
7304 tmp_tb = tstate->curexc_traceback;
7305 tstate->curexc_type = type;
7306 tstate->curexc_value = value;
7307 tstate->curexc_traceback = tb;
7308 Py_XDECREF(tmp_type);
7309 Py_XDECREF(tmp_value);
7313static CYTHON_INLINE
void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) {
7314#if PY_VERSION_HEX >= 0x030C00A6
7315 PyObject* exc_value;
7316 exc_value = tstate->current_exception;
7317 tstate->current_exception = 0;
7322 *type = (PyObject*) Py_TYPE(exc_value);
7324 #if CYTHON_COMPILING_IN_CPYTHON
7325 *tb = ((PyBaseExceptionObject*) exc_value)->traceback;
7328 *tb = PyException_GetTraceback(exc_value);
7332 *type = tstate->curexc_type;
7333 *value = tstate->curexc_value;
7334 *tb = tstate->curexc_traceback;
7335 tstate->curexc_type = 0;
7336 tstate->curexc_value = 0;
7337 tstate->curexc_traceback = 0;
7343#if CYTHON_COMPILING_IN_CPYTHON
7344static CYTHON_INLINE
int __Pyx_inner_PyErr_GivenExceptionMatches2(PyObject *err, PyObject* exc_type1, PyObject *exc_type2) {
7346 return __Pyx_IsAnySubtype2((PyTypeObject*)err, (PyTypeObject*)exc_type1, (PyTypeObject*)exc_type2);
7348 return __Pyx_IsSubtype((PyTypeObject*)err, (PyTypeObject*)exc_type2);
7351static int __Pyx_PyErr_GivenExceptionMatchesTuple(PyObject *exc_type, PyObject *tuple) {
7353 assert(PyExceptionClass_Check(exc_type));
7354 n = PyTuple_GET_SIZE(tuple);
7355 for (i=0; i<
n; i++) {
7356 if (exc_type == PyTuple_GET_ITEM(tuple, i))
return 1;
7358 for (i=0; i<
n; i++) {
7359 PyObject *t = PyTuple_GET_ITEM(tuple, i);
7360 if (likely(PyExceptionClass_Check(t))) {
7361 if (__Pyx_inner_PyErr_GivenExceptionMatches2(exc_type, NULL, t))
return 1;
7367static CYTHON_INLINE
int __Pyx_PyErr_GivenExceptionMatches(PyObject *err, PyObject* exc_type) {
7368 if (likely(err == exc_type))
return 1;
7369 if (likely(PyExceptionClass_Check(err))) {
7370 if (likely(PyExceptionClass_Check(exc_type))) {
7371 return __Pyx_inner_PyErr_GivenExceptionMatches2(err, NULL, exc_type);
7372 }
else if (likely(PyTuple_Check(exc_type))) {
7373 return __Pyx_PyErr_GivenExceptionMatchesTuple(err, exc_type);
7377 return PyErr_GivenExceptionMatches(err, exc_type);
7379static CYTHON_INLINE
int __Pyx_PyErr_GivenExceptionMatches2(PyObject *err, PyObject *exc_type1, PyObject *exc_type2) {
7380 assert(PyExceptionClass_Check(exc_type1));
7381 assert(PyExceptionClass_Check(exc_type2));
7382 if (likely(err == exc_type1 || err == exc_type2))
return 1;
7383 if (likely(PyExceptionClass_Check(err))) {
7384 return __Pyx_inner_PyErr_GivenExceptionMatches2(err, exc_type1, exc_type2);
7386 return (PyErr_GivenExceptionMatches(err, exc_type1) || PyErr_GivenExceptionMatches(err, exc_type2));
7391#if CYTHON_FAST_THREAD_STATE
7392static int __Pyx_PyErr_ExceptionMatchesTuple(PyObject *exc_type, PyObject *tuple) {
7394 n = PyTuple_GET_SIZE(tuple);
7395 for (i=0; i<
n; i++) {
7396 if (exc_type == PyTuple_GET_ITEM(tuple, i))
return 1;
7398 for (i=0; i<
n; i++) {
7399 if (__Pyx_PyErr_GivenExceptionMatches(exc_type, PyTuple_GET_ITEM(tuple, i)))
return 1;
7403static CYTHON_INLINE
int __Pyx_PyErr_ExceptionMatchesInState(PyThreadState* tstate, PyObject* err) {
7406#if PY_VERSION_HEX >= 0x030C00A6
7407 PyObject *current_exception = tstate->current_exception;
7408 if (unlikely(!current_exception))
return 0;
7409 exc_type = (PyObject*) Py_TYPE(current_exception);
7410 if (exc_type == err)
return 1;
7412 exc_type = tstate->curexc_type;
7413 if (exc_type == err)
return 1;
7414 if (unlikely(!exc_type))
return 0;
7416 #if CYTHON_AVOID_BORROWED_REFS
7417 Py_INCREF(exc_type);
7419 if (unlikely(PyTuple_Check(err))) {
7420 result = __Pyx_PyErr_ExceptionMatchesTuple(exc_type, err);
7422 result = __Pyx_PyErr_GivenExceptionMatches(exc_type, err);
7424 #if CYTHON_AVOID_BORROWED_REFS
7425 Py_DECREF(exc_type);
7432#if CYTHON_FAST_THREAD_STATE
7433static int __Pyx__GetException(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb)
7435static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb)
7438 PyObject *local_type = NULL, *local_value, *local_tb = NULL;
7439#if CYTHON_FAST_THREAD_STATE
7440 PyObject *tmp_type, *tmp_value, *tmp_tb;
7441 #if PY_VERSION_HEX >= 0x030C0000
7442 local_value = tstate->current_exception;
7443 tstate->current_exception = 0;
7445 local_type = tstate->curexc_type;
7446 local_value = tstate->curexc_value;
7447 local_tb = tstate->curexc_traceback;
7448 tstate->curexc_type = 0;
7449 tstate->curexc_value = 0;
7450 tstate->curexc_traceback = 0;
7452#elif __PYX_LIMITED_VERSION_HEX >= 0x030C0000
7453 local_value = PyErr_GetRaisedException();
7455 PyErr_Fetch(&local_type, &local_value, &local_tb);
7457#if __PYX_LIMITED_VERSION_HEX >= 0x030C0000
7458 if (likely(local_value)) {
7459 local_type = (PyObject*) Py_TYPE(local_value);
7460 Py_INCREF(local_type);
7461 local_tb = PyException_GetTraceback(local_value);
7464 PyErr_NormalizeException(&local_type, &local_value, &local_tb);
7465#if CYTHON_FAST_THREAD_STATE
7466 if (unlikely(tstate->curexc_type))
7468 if (unlikely(PyErr_Occurred()))
7472 if (unlikely(PyException_SetTraceback(local_value, local_tb) < 0))
7476 Py_XINCREF(local_tb);
7477 Py_XINCREF(local_type);
7478 Py_XINCREF(local_value);
7480 *value = local_value;
7482#if CYTHON_FAST_THREAD_STATE
7483 #if CYTHON_USE_EXC_INFO_STACK
7485 _PyErr_StackItem *exc_info = tstate->exc_info;
7486 #if PY_VERSION_HEX >= 0x030B00a4
7487 tmp_value = exc_info->exc_value;
7488 exc_info->exc_value = local_value;
7491 Py_XDECREF(local_type);
7492 Py_XDECREF(local_tb);
7494 tmp_type = exc_info->exc_type;
7495 tmp_value = exc_info->exc_value;
7496 tmp_tb = exc_info->exc_traceback;
7497 exc_info->exc_type = local_type;
7498 exc_info->exc_value = local_value;
7499 exc_info->exc_traceback = local_tb;
7503 tmp_type = tstate->exc_type;
7504 tmp_value = tstate->exc_value;
7505 tmp_tb = tstate->exc_traceback;
7506 tstate->exc_type = local_type;
7507 tstate->exc_value = local_value;
7508 tstate->exc_traceback = local_tb;
7510 Py_XDECREF(tmp_type);
7511 Py_XDECREF(tmp_value);
7513#elif __PYX_LIMITED_VERSION_HEX >= 0x030b0000
7514 PyErr_SetHandledException(local_value);
7515 Py_XDECREF(local_value);
7516 Py_XDECREF(local_type);
7517 Py_XDECREF(local_tb);
7519 PyErr_SetExcInfo(local_type, local_value, local_tb);
7522#if __PYX_LIMITED_VERSION_HEX < 0x030C0000
7527 Py_XDECREF(local_type);
7528 Py_XDECREF(local_value);
7529 Py_XDECREF(local_tb);
7535#if CYTHON_COMPILING_IN_CPYTHON
7536static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw) {
7538 ternaryfunc call = Py_TYPE(func)->tp_call;
7539 if (unlikely(!call))
7540 return PyObject_Call(func, arg, kw);
7541 if (unlikely(Py_EnterRecursiveCall(
" while calling a Python object")))
7543 result = (*call)(func, arg, kw);
7544 Py_LeaveRecursiveCall();
7545 if (unlikely(!result) && unlikely(!PyErr_Occurred())) {
7548 "NULL result without error in PyObject_Call");
7555#if CYTHON_COMPILING_IN_CPYTHON
7556static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg) {
7557 PyObject *self, *result;
7559 cfunc = __Pyx_CyOrPyCFunction_GET_FUNCTION(func);
7560 self = __Pyx_CyOrPyCFunction_GET_SELF(func);
7561 if (unlikely(Py_EnterRecursiveCall(
" while calling a Python object")))
7563 result = cfunc(self, arg);
7564 Py_LeaveRecursiveCall();
7565 if (unlikely(!result) && unlikely(!PyErr_Occurred())) {
7568 "NULL result without error in PyObject_Call");
7575#if CYTHON_COMPILING_IN_LIMITED_API
7576static PyObject* __Pyx_PyObject_FastCall_fallback(PyObject *func, PyObject *
const*args,
size_t nargs, PyObject *kwargs) {
7577 PyObject *argstuple;
7578 PyObject *result = 0;
7580 argstuple = PyTuple_New((Py_ssize_t)nargs);
7581 if (unlikely(!argstuple))
return NULL;
7582 for (i = 0; i < nargs; i++) {
7584 if (__Pyx_PyTuple_SET_ITEM(argstuple, (Py_ssize_t)i, args[i]) != (0))
goto bad;
7586 result = __Pyx_PyObject_Call(func, argstuple, kwargs);
7588 Py_DECREF(argstuple);
7592#if CYTHON_VECTORCALL && !(CYTHON_COMPILING_IN_LIMITED_API || CYTHON_COMPILING_IN_PYPY)
7593 #if CYTHON_COMPILING_IN_CPYTHON
7594static CYTHON_INLINE vectorcallfunc __Pyx_PyVectorcall_Function(PyObject *callable) {
7595 PyTypeObject *tp = Py_TYPE(callable);
7596 #if defined(__Pyx_CyFunction_USED)
7597 if (__Pyx_CyFunction_CheckExact(callable)) {
7598 return __Pyx_CyFunction_func_vectorcall(callable);
7601 if (!PyType_HasFeature(tp, Py_TPFLAGS_HAVE_VECTORCALL)) {
7604 assert(PyCallable_Check(callable));
7605 Py_ssize_t offset = tp->tp_vectorcall_offset;
7608 memcpy(&ptr, (
char *) callable + offset,
sizeof(ptr));
7612 #define __Pyx_PyVectorcall_Function(callable) PyVectorcall_Function(callable)
7615static CYTHON_INLINE PyObject* __Pyx_PyObject_FastCallDict(PyObject *func, PyObject *
const *args,
size_t nargsf, PyObject *kwargs) {
7616 Py_ssize_t nargs = __Pyx_PyVectorcall_NARGS(nargsf);
7617#if CYTHON_COMPILING_IN_CPYTHON
7618 if (nargs == 0 && kwargs == NULL) {
7619 if (__Pyx_CyOrPyCFunction_Check(func) && likely( __Pyx_CyOrPyCFunction_GET_FLAGS(func) & METH_NOARGS))
7620 return __Pyx_PyObject_CallMethO(func, NULL);
7622 else if (nargs == 1 && kwargs == NULL) {
7623 if (__Pyx_CyOrPyCFunction_Check(func) && likely( __Pyx_CyOrPyCFunction_GET_FLAGS(func) & METH_O))
7624 return __Pyx_PyObject_CallMethO(func, args[0]);
7627 if (kwargs == NULL) {
7628 #if CYTHON_VECTORCALL
7629 #if CYTHON_COMPILING_IN_LIMITED_API || CYTHON_COMPILING_IN_PYPY
7630 return PyObject_Vectorcall(func, args, nargsf, NULL);
7632 vectorcallfunc
f = __Pyx_PyVectorcall_Function(func);
7634 return f(func, args, nargsf, NULL);
7640 return __Pyx_PyObject_Call(func, __pyx_mstate_global->__pyx_empty_tuple, kwargs);
7642 #if CYTHON_COMPILING_IN_LIMITED_API
7643 return __Pyx_PyObject_FastCall_fallback(func, args, (
size_t)nargs, kwargs);
7644 #elif CYTHON_COMPILING_IN_PYPY
7645 return PyObject_VectorcallDict(func, args, (
size_t) nargs, kwargs);
7647 return PyObject_VectorcallDict(func, args, nargsf, kwargs);
7652static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause) {
7653 PyObject* owned_instance = NULL;
7654 if (tb == Py_None) {
7656 }
else if (tb && !PyTraceBack_Check(tb)) {
7657 PyErr_SetString(PyExc_TypeError,
7658 "raise: arg 3 must be a traceback or None");
7661 if (value == Py_None)
7663 if (PyExceptionInstance_Check(type)) {
7665 PyErr_SetString(PyExc_TypeError,
7666 "instance exception may not have a separate value");
7670 type = (PyObject*) Py_TYPE(value);
7671 }
else if (PyExceptionClass_Check(type)) {
7672 PyObject *instance_class = NULL;
7673 if (value && PyExceptionInstance_Check(value)) {
7674 instance_class = (PyObject*) Py_TYPE(value);
7675 if (instance_class != type) {
7676 int is_subclass = PyObject_IsSubclass(instance_class, type);
7678 instance_class = NULL;
7679 }
else if (unlikely(is_subclass == -1)) {
7682 type = instance_class;
7686 if (!instance_class) {
7689 args = PyTuple_New(0);
7690 else if (PyTuple_Check(value)) {
7694 args = PyTuple_Pack(1, value);
7697 owned_instance = PyObject_Call(type, args, NULL);
7699 if (!owned_instance)
7701 value = owned_instance;
7702 if (!PyExceptionInstance_Check(value)) {
7703 PyErr_Format(PyExc_TypeError,
7704 "calling %R should have returned an instance of "
7705 "BaseException, not %R",
7706 type, Py_TYPE(value));
7711 PyErr_SetString(PyExc_TypeError,
7712 "raise: exception class must be a subclass of BaseException");
7716 PyObject *fixed_cause;
7717 if (cause == Py_None) {
7719 }
else if (PyExceptionClass_Check(cause)) {
7720 fixed_cause = PyObject_CallObject(cause, NULL);
7721 if (fixed_cause == NULL)
7723 }
else if (PyExceptionInstance_Check(cause)) {
7724 fixed_cause = cause;
7725 Py_INCREF(fixed_cause);
7727 PyErr_SetString(PyExc_TypeError,
7728 "exception causes must derive from "
7732 PyException_SetCause(value, fixed_cause);
7734 PyErr_SetObject(type, value);
7736#if PY_VERSION_HEX >= 0x030C00A6
7737 PyException_SetTraceback(value, tb);
7738#elif CYTHON_FAST_THREAD_STATE
7739 PyThreadState *tstate = __Pyx_PyThreadState_Current;
7740 PyObject* tmp_tb = tstate->curexc_traceback;
7743 tstate->curexc_traceback = tb;
7747 PyObject *tmp_type, *tmp_value, *tmp_tb;
7748 PyErr_Fetch(&tmp_type, &tmp_value, &tmp_tb);
7750 PyErr_Restore(tmp_type, tmp_value, tb);
7755 Py_XDECREF(owned_instance);
7760#if CYTHON_COMPILING_IN_CPYTHON
7761static CYTHON_INLINE
void __Pyx_copy_object_array(PyObject *
const *CYTHON_RESTRICT src, PyObject** CYTHON_RESTRICT dest, Py_ssize_t length) {
7764 for (i = 0; i < length; i++) {
7765 v = dest[i] = src[i];
7772#if !(PY_VERSION_HEX >= 0x030F0000 && !CYTHON_COMPILING_IN_LIMITED_API)
7773CYTHON_UNUSED
static PyObject *
7774__Pyx_PyTuple_FromArray(PyObject *
const *src, Py_ssize_t
n) {
7776 return __Pyx_NewRef(__pyx_mstate_global->__pyx_empty_tuple);
7778 PyObject *res = PyTuple_New(
n);
7779 if (unlikely(res == NULL))
return NULL;
7780 #if CYTHON_COMPILING_IN_CPYTHON
7781 __Pyx_copy_object_array(src, ((PyTupleObject*)res)->ob_item,
n);
7784 for (i = 0; i <
n; i++) {
7786 if (unlikely(__Pyx_PyTuple_SET_ITEM(res, i, src[i]) < (0))) {
7797#ifndef __Pyx_DEFINED_PyObject_CompareStrStrBoolEq
7798#define __Pyx_DEFINED_PyObject_CompareStrStrBoolEq
7799static CYTHON_INLINE
int __Pyx_PyObject_CompareStrStrBoolEq(PyObject* s1, PyObject* s2) {
7800 #if __PYX_LIMITED_VERSION_HEX >= 0x030e0000
7801 int result = PyUnicode_Equal(s1, s2);
7802 #if !CYTHON_COMPILING_IN_CPYTHON
7803 if (unlikely(result == -1))
return -1;
7805 if (result == 0)
goto __pyx_return_false;
else goto __pyx_return_true;
7807 int result = PyUnicode_Compare(s1, s2);
7808 if (unlikely((result == -1) && PyErr_Occurred()))
return -1;
7809 if (result == 0)
goto __pyx_return_true;
else goto __pyx_return_false;
7817static CYTHON_INLINE
int __Pyx_PyObject_CompareBoolEq_str_str(PyObject *op1, PyObject *op2,
int pyop) {
7818 CYTHON_UNUSED_VAR(pyop);
7819 if (unlikely(op1 == Py_None)) {
7820 if (op2 == Py_None)
goto __pyx_return_true;
else goto __pyx_return_false;
7822 if (unlikely(op2 == Py_None)) {
7823 if (op1 == Py_None)
goto __pyx_return_true;
else goto __pyx_return_false;
7826 if (likely(op1 != Py_None)) {
7827 if (op1 == op2)
goto __pyx_return_true;
7828 if (likely(op2 != Py_None)) {
7829 return __Pyx_PyObject_CompareStrStrBoolEq(op1, op2);
7834 if ((0))
goto __pyx_richcmp;
7835 if ((0))
goto __pyx_return_true;
7836 if ((0))
goto __pyx_return_false;
7838 return __Pyx_PyObject_RichCompareBool(op1, op2, Py_EQ);
7846#if CYTHON_VECTORCALL
7847static CYTHON_INLINE PyObject * __Pyx_GetKwValue_FASTCALL(PyObject *kwnames, PyObject *
const *kwvalues, PyObject *
s)
7849 Py_ssize_t i,
n = __Pyx_PyTuple_GET_SIZE(kwnames);
7850 #if !CYTHON_ASSUME_SAFE_SIZE
7851 if (unlikely(
n == -1))
return NULL;
7853 for (i = 0; i <
n; i++)
7855 PyObject *namei = __Pyx_PyTuple_GET_ITEM(kwnames, i);
7856 #if !CYTHON_ASSUME_SAFE_MACROS
7857 if (unlikely(!namei))
return NULL;
7859 if (
s == namei)
return kwvalues[i];
7861 for (i = 0; i <
n; i++)
7863 PyObject *namei = __Pyx_PyTuple_GET_ITEM(kwnames, i);
7864 #if !CYTHON_ASSUME_SAFE_MACROS
7865 if (unlikely(!namei))
return NULL;
7867 int eq = __Pyx_PyUnicode_Equals(
s, namei);
7868 if (unlikely(eq != 0)) {
7869 if (unlikely(eq < 0))
return NULL;
7875#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030d0000 || CYTHON_COMPILING_IN_LIMITED_API || CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_GRAAL
7876CYTHON_UNUSED
static PyObject *__Pyx_KwargsAsDict_FASTCALL(PyObject *kwnames, PyObject *
const *kwvalues) {
7877 Py_ssize_t i, nkwargs;
7879#if !CYTHON_ASSUME_SAFE_SIZE
7880 nkwargs = PyTuple_Size(kwnames);
7881 if (unlikely(nkwargs < 0))
return NULL;
7883 nkwargs = PyTuple_GET_SIZE(kwnames);
7885 dict = PyDict_New();
7886 if (unlikely(!dict))
7888 for (i=0; i<nkwargs; i++) {
7889#if !CYTHON_ASSUME_SAFE_MACROS
7890 PyObject *key = PyTuple_GetItem(kwnames, i);
7893 PyObject *key = PyTuple_GET_ITEM(kwnames, i);
7895 if (unlikely(PyDict_SetItem(dict, key, kwvalues[i]) < 0))
7907static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg) {
7908 PyObject *args[2] = {NULL, arg};
7909 return __Pyx_PyObject_FastCall(func, args+1, 1 | __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET);
7913static CYTHON_INLINE
int __Pyx_IgnoreGivenException(PyObject *given_exception, PyObject *ignorable_exception) {
7914 if (PyErr_GivenExceptionMatches(given_exception ? given_exception : PyErr_Occurred(), ignorable_exception)) {
7922#if CYTHON_USE_TYPE_SLOTS
7923static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name) {
7924 PyTypeObject* tp = Py_TYPE(obj);
7925 if (likely(tp->tp_getattro))
7926 return tp->tp_getattro(obj, attr_name);
7927 return PyObject_GetAttr(obj, attr_name);
7932#if CYTHON_COMPILING_IN_LIMITED_API && __PYX_LIMITED_VERSION_HEX < 0x030C0000
7933static PyObject *__Pyx_SelflessCall(PyObject *method, PyObject *args, PyObject *kwargs) {
7935 PyObject *selfless_args = PyTuple_GetSlice(args, 1, PyTuple_Size(args));
7936 if (unlikely(!selfless_args))
return NULL;
7937 result = PyObject_Call(method, selfless_args, kwargs);
7938 Py_DECREF(selfless_args);
7942static PyObject *__Pyx_SelflessCall(PyObject *method, PyObject *
const *args, Py_ssize_t nargs, PyObject *kwnames) {
7943 return PyObject_Vectorcall(method, args ? args+1 : NULL, nargs ? (
size_t) nargs-1 : 0, kwnames);
7946static PyMethodDef __Pyx_UnboundCMethod_Def = {
7947 "CythonUnboundCMethod",
7948 __PYX_REINTERPRET_FUNCION(PyCFunction, __Pyx_SelflessCall),
7949#if CYTHON_COMPILING_IN_LIMITED_API && __PYX_LIMITED_VERSION_HEX < 0x030C0000
7950 METH_VARARGS | METH_KEYWORDS,
7952 METH_FASTCALL | METH_KEYWORDS,
7956static int __Pyx_TryUnpackUnboundCMethod(__Pyx_CachedCFunction* target) {
7957 PyObject *method, *result=NULL;
7958 method = __Pyx_PyObject_GetAttrStr(target->type, *target->method_name);
7959 if (unlikely(!method))
7962#if CYTHON_COMPILING_IN_CPYTHON
7963 if (likely(__Pyx_TypeCheck(method, &PyMethodDescr_Type)))
7965 PyMethodDescrObject *descr = (PyMethodDescrObject*) method;
7966 target->func = descr->d_method->ml_meth;
7967 target->flag = descr->d_method->ml_flags & ~(METH_CLASS | METH_STATIC | METH_COEXIST);
7970#if CYTHON_COMPILING_IN_PYPY
7972 if (PyCFunction_Check(method))
7977#if CYTHON_COMPILING_IN_LIMITED_API || CYTHON_COMPILING_IN_PYPY
7978 self = PyObject_GetAttrString(method,
"__self__");
7979 if (!self && !__Pyx_IgnoreException(PyExc_AttributeError)) {
7983 self = PyCFunction_GET_SELF(method);
7985 self_found = (self && self != Py_None);
7986#if CYTHON_COMPILING_IN_LIMITED_API || CYTHON_COMPILING_IN_PYPY
7990 PyObject *unbound_method = PyCFunction_New(&__Pyx_UnboundCMethod_Def, method);
7991 if (unlikely(!unbound_method))
return -1;
7993 result = unbound_method;
7996#if !CYTHON_COMPILING_IN_CPYTHON_FREETHREADING
7997 if (unlikely(target->method)) {
8001 target->method = result;
8006#if CYTHON_COMPILING_IN_CPYTHON
8007static CYTHON_INLINE PyObject* __Pyx_CallUnboundCMethod0(__Pyx_CachedCFunction* cfunc, PyObject* self) {
8008 int was_initialized = __Pyx_CachedCFunction_GetAndSetInitializing(cfunc);
8009 if (likely(was_initialized == 2 && cfunc->func)) {
8010 if (likely(cfunc->flag == METH_NOARGS))
8011 return __Pyx_CallCFunction(cfunc, self, NULL);
8012 if (likely(cfunc->flag == METH_FASTCALL))
8013 return __Pyx_CallCFunctionFast(cfunc, self, NULL, 0);
8014 if (cfunc->flag == (METH_FASTCALL | METH_KEYWORDS))
8015 return __Pyx_CallCFunctionFastWithKeywords(cfunc, self, NULL, 0, NULL);
8016 if (likely(cfunc->flag == (METH_VARARGS | METH_KEYWORDS)))
8017 return __Pyx_CallCFunctionWithKeywords(cfunc, self, __pyx_mstate_global->__pyx_empty_tuple, NULL);
8018 if (cfunc->flag == METH_VARARGS)
8019 return __Pyx_CallCFunction(cfunc, self, __pyx_mstate_global->__pyx_empty_tuple);
8020 return __Pyx__CallUnboundCMethod0(cfunc, self);
8022#if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING
8023 else if (unlikely(was_initialized == 1)) {
8024 __Pyx_CachedCFunction tmp_cfunc = {
8029 tmp_cfunc.type = cfunc->type;
8030 tmp_cfunc.method_name = cfunc->method_name;
8031 return __Pyx__CallUnboundCMethod0(&tmp_cfunc, self);
8034 PyObject *result = __Pyx__CallUnboundCMethod0(cfunc, self);
8035 __Pyx_CachedCFunction_SetFinishedInitializing(cfunc);
8039static PyObject* __Pyx__CallUnboundCMethod0(__Pyx_CachedCFunction* cfunc, PyObject* self) {
8041 if (unlikely(!cfunc->method) && unlikely(__Pyx_TryUnpackUnboundCMethod(cfunc) < 0))
return NULL;
8042 result = __Pyx_PyObject_CallOneArg(cfunc->method, self);
8047static CYTHON_INLINE PyObject* __Pyx_PyDict_Items(PyObject* d) {
8048 return __Pyx_CallUnboundCMethod0(&__pyx_mstate_global->__pyx_umethod_PyDict_Type_items, d);
8052static CYTHON_INLINE PyObject* __Pyx_PyDict_Values(PyObject* d) {
8053 return __Pyx_CallUnboundCMethod0(&__pyx_mstate_global->__pyx_umethod_PyDict_Type_values, d);
8057#if CYTHON_AVOID_BORROWED_REFS
8058static int __Pyx_PyDict_NextRef(PyObject *p, PyObject **ppos, PyObject **pkey, PyObject **pvalue) {
8059 PyObject *next = NULL;
8062 PyObject *dictview = pkey ? __Pyx_PyDict_Items(p) : __Pyx_PyDict_Values(p);
8063 if (unlikely(!dictview))
goto bad;
8064 *ppos = PyObject_GetIter(dictview);
8065 Py_DECREF(dictview);
8067 *ppos = PyObject_GetIter(p);
8069 if (unlikely(!*ppos))
goto bad;
8071 next = PyIter_Next(*ppos);
8073 if (PyErr_Occurred())
goto bad;
8076 if (pkey && pvalue) {
8077 *pkey = __Pyx_PySequence_ITEM(next, 0);
8078 if (unlikely(*pkey))
goto bad;
8079 *pvalue = __Pyx_PySequence_ITEM(next, 1);
8080 if (unlikely(*pvalue))
goto bad;
8091#if !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX >= 0x030d0000
8092 PyErr_FormatUnraisable(
"Exception ignored in __Pyx_PyDict_NextRef");
8094 PyErr_WriteUnraisable(__pyx_mstate_global->__pyx_n_u_Pyx_PyDict_NextRef);
8096 if (pkey) *pkey = NULL;
8097 if (pvalue) *pvalue = NULL;
8101static int __Pyx_PyDict_NextRef(PyObject *p, Py_ssize_t *ppos, PyObject **pkey, PyObject **pvalue) {
8102 int result = PyDict_Next(p, ppos, pkey, pvalue);
8103 if (likely(result == 1)) {
8104 if (pkey) Py_INCREF(*pkey);
8105 if (pvalue) Py_INCREF(*pvalue);
8112static void __Pyx_RaiseDoubleKeywordsError(
8113 const char* func_name,
8116 PyErr_Format(PyExc_TypeError,
8117 "%s() got multiple values for keyword argument '%U'", func_name, kw_name);
8121#if CYTHON_COMPILING_IN_CPYTHON
8122static CYTHON_INLINE PyObject *__Pyx_CallUnboundCMethod2(__Pyx_CachedCFunction *cfunc, PyObject *self, PyObject *arg1, PyObject *arg2) {
8123 int was_initialized = __Pyx_CachedCFunction_GetAndSetInitializing(cfunc);
8124 if (likely(was_initialized == 2 && cfunc->func)) {
8125 PyObject *args[2] = {arg1, arg2};
8126 if (cfunc->flag == METH_FASTCALL) {
8127 return __Pyx_CallCFunctionFast(cfunc, self, args, 2);
8129 if (cfunc->flag == (METH_FASTCALL | METH_KEYWORDS))
8130 return __Pyx_CallCFunctionFastWithKeywords(cfunc, self, args, 2, NULL);
8132#if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING
8133 else if (unlikely(was_initialized == 1)) {
8134 __Pyx_CachedCFunction tmp_cfunc = {
8139 tmp_cfunc.type = cfunc->type;
8140 tmp_cfunc.method_name = cfunc->method_name;
8141 return __Pyx__CallUnboundCMethod2(&tmp_cfunc, self, arg1, arg2);
8144 PyObject *result = __Pyx__CallUnboundCMethod2(cfunc, self, arg1, arg2);
8145 __Pyx_CachedCFunction_SetFinishedInitializing(cfunc);
8149static PyObject* __Pyx__CallUnboundCMethod2(__Pyx_CachedCFunction* cfunc, PyObject* self, PyObject* arg1, PyObject* arg2){
8150 if (unlikely(!cfunc->func && !cfunc->method) && unlikely(__Pyx_TryUnpackUnboundCMethod(cfunc) < 0))
return NULL;
8151#if CYTHON_COMPILING_IN_CPYTHON
8152 if (cfunc->func && (cfunc->flag & METH_VARARGS)) {
8153 PyObject *result = NULL;
8154 PyObject *args = PyTuple_New(2);
8155 if (unlikely(!args))
return NULL;
8157 PyTuple_SET_ITEM(args, 0, arg1);
8159 PyTuple_SET_ITEM(args, 1, arg2);
8160 if (cfunc->flag & METH_KEYWORDS)
8161 result = __Pyx_CallCFunctionWithKeywords(cfunc, self, args, NULL);
8163 result = __Pyx_CallCFunction(cfunc, self, args);
8169 PyObject *args[4] = {NULL, self, arg1, arg2};
8170 return __Pyx_PyObject_FastCall(cfunc->method, args+1, 3 | __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET);
8175static int __Pyx_ValidateDuplicatePosArgs(
8177 PyObject **
const argnames[],
8178 PyObject **
const *first_kw_arg,
8179 const char* function_name)
8181 PyObject **
const *name = argnames;
8182 while (name != first_kw_arg) {
8183 PyObject *key = **name;
8184 int found = PyDict_Contains(kwds, key);
8185 if (unlikely(found)) {
8186 if (found == 1) __Pyx_RaiseDoubleKeywordsError(function_name, key);
8195#if CYTHON_USE_UNICODE_INTERNALS
8196static CYTHON_INLINE
int __Pyx_UnicodeKeywordsEqual(PyObject *s1, PyObject *s2) {
8198 Py_ssize_t len = PyUnicode_GET_LENGTH(s1);
8199 if (len != PyUnicode_GET_LENGTH(s2))
return 0;
8200 kind = PyUnicode_KIND(s1);
8201 if (kind != PyUnicode_KIND(s2))
return 0;
8202 const void *data1 = PyUnicode_DATA(s1);
8203 const void *data2 = PyUnicode_DATA(s2);
8204 return (memcmp(data1, data2, (
size_t) len * (
size_t) kind) == 0);
8207static int __Pyx_MatchKeywordArg_str(
8209 PyObject **
const argnames[],
8210 PyObject **
const *first_kw_arg,
8211 size_t *index_found,
8212 const char *function_name)
8214 PyObject **
const *name;
8215 #if CYTHON_USE_UNICODE_INTERNALS
8216 Py_hash_t key_hash = ((PyASCIIObject*)key)->hash;
8217 if (unlikely(key_hash == -1)) {
8218 key_hash = PyObject_Hash(key);
8219 if (unlikely(key_hash == -1))
8223 name = first_kw_arg;
8225 PyObject *name_str = **name;
8226 #if CYTHON_USE_UNICODE_INTERNALS
8227 if (key_hash == ((PyASCIIObject*)name_str)->hash && __Pyx_UnicodeKeywordsEqual(name_str, key)) {
8228 *index_found = (size_t) (name - argnames);
8232 #if CYTHON_ASSUME_SAFE_SIZE
8233 if (PyUnicode_GET_LENGTH(name_str) == PyUnicode_GET_LENGTH(key))
8236 int cmp = PyUnicode_Compare(name_str, key);
8237 if (cmp < 0 && unlikely(PyErr_Occurred()))
goto bad;
8239 *index_found = (size_t) (name - argnames);
8247 while (name != first_kw_arg) {
8248 PyObject *name_str = **name;
8249 #if CYTHON_USE_UNICODE_INTERNALS
8250 if (unlikely(key_hash == ((PyASCIIObject*)name_str)->hash)) {
8251 if (__Pyx_UnicodeKeywordsEqual(name_str, key))
8252 goto arg_passed_twice;
8255 #if CYTHON_ASSUME_SAFE_SIZE
8256 if (PyUnicode_GET_LENGTH(name_str) == PyUnicode_GET_LENGTH(key))
8259 if (unlikely(name_str == key))
goto arg_passed_twice;
8260 int cmp = PyUnicode_Compare(name_str, key);
8261 if (cmp < 0 && unlikely(PyErr_Occurred()))
goto bad;
8262 if (cmp == 0)
goto arg_passed_twice;
8269 __Pyx_RaiseDoubleKeywordsError(function_name, key);
8274static int __Pyx_MatchKeywordArg_nostr(
8276 PyObject **
const argnames[],
8277 PyObject **
const *first_kw_arg,
8278 size_t *index_found,
8279 const char *function_name)
8281 PyObject **
const *name;
8282 if (unlikely(!PyUnicode_Check(key)))
goto invalid_keyword_type;
8283 name = first_kw_arg;
8285 int cmp = PyObject_RichCompareBool(**name, key, Py_EQ);
8287 *index_found = (size_t) (name - argnames);
8290 if (unlikely(cmp == -1))
goto bad;
8294 while (name != first_kw_arg) {
8295 int cmp = PyObject_RichCompareBool(**name, key, Py_EQ);
8296 if (unlikely(cmp != 0)) {
8297 if (cmp == 1)
goto arg_passed_twice;
8304 __Pyx_RaiseDoubleKeywordsError(function_name, key);
8306invalid_keyword_type:
8307 PyErr_Format(PyExc_TypeError,
8308 "%.200s() keywords must be strings", function_name);
8313static CYTHON_INLINE
int __Pyx_MatchKeywordArg(
8315 PyObject **
const argnames[],
8316 PyObject **
const *first_kw_arg,
8317 size_t *index_found,
8318 const char *function_name)
8320 return likely(PyUnicode_CheckExact(key)) ?
8321 __Pyx_MatchKeywordArg_str(key, argnames, first_kw_arg, index_found, function_name) :
8322 __Pyx_MatchKeywordArg_nostr(key, argnames, first_kw_arg, index_found, function_name);
8324static void __Pyx_RejectUnknownKeyword(
8326 PyObject **
const argnames[],
8327 PyObject **
const *first_kw_arg,
8328 const char *function_name)
8330 #if CYTHON_AVOID_BORROWED_REFS
8331 PyObject *pos = NULL;
8335 PyObject *key = NULL;
8336 __Pyx_BEGIN_CRITICAL_SECTION(kwds);
8337 #if CYTHON_AVOID_BORROWED_REFS
8338 while (__Pyx_PyDict_NextRef(kwds, &pos, &key, NULL))
8340 (void) __Pyx_PyDict_NextRef;
8341 while (PyDict_Next(kwds, &pos, &key, NULL))
8344 PyObject**
const *name = first_kw_arg;
8345 while (*name && (**name != key)) name++;
8347 size_t index_found = 0;
8348 int cmp = __Pyx_MatchKeywordArg(key, argnames, first_kw_arg, &index_found, function_name);
8351 PyErr_Format(PyExc_TypeError,
8352 "%s() got an unexpected keyword argument '%U'",
8353 function_name, key);
8355 #if CYTHON_AVOID_BORROWED_REFS
8361 #if CYTHON_AVOID_BORROWED_REFS
8365 __Pyx_END_CRITICAL_SECTION();
8366 #if CYTHON_AVOID_BORROWED_REFS
8369 assert(PyErr_Occurred());
8371static int __Pyx_ParseKeywordDict(
8373 PyObject **
const argnames[],
8375 Py_ssize_t num_pos_args,
8376 Py_ssize_t num_kwargs,
8377 const char* function_name,
8378 int ignore_unknown_kwargs)
8380 PyObject**
const *name;
8381 PyObject**
const *first_kw_arg = argnames + num_pos_args;
8382 Py_ssize_t extracted = 0;
8383#if !CYTHON_COMPILING_IN_PYPY || defined(PyArg_ValidateKeywordArguments)
8384 if (unlikely(!PyArg_ValidateKeywordArguments(kwds)))
return -1;
8386 name = first_kw_arg;
8387 while (*name && num_kwargs > extracted) {
8388 PyObject * key = **name;
8391 #if __PYX_LIMITED_VERSION_HEX >= 0x030d0000
8392 found = PyDict_GetItemRef(kwds, key, &value);
8394 value = PyDict_GetItemWithError(kwds, key);
8399 if (unlikely(PyErr_Occurred()))
goto bad;
8403 if (unlikely(found < 0))
goto bad;
8404 values[name-argnames] = value;
8409 if (num_kwargs > extracted) {
8410 if (ignore_unknown_kwargs) {
8411 if (unlikely(__Pyx_ValidateDuplicatePosArgs(kwds, argnames, first_kw_arg, function_name) == -1))
8414 __Pyx_RejectUnknownKeyword(kwds, argnames, first_kw_arg, function_name);
8422static int __Pyx_ParseKeywordDictToDict(
8424 PyObject **
const argnames[],
8427 Py_ssize_t num_pos_args,
8428 const char* function_name)
8430 PyObject**
const *name;
8431 PyObject**
const *first_kw_arg = argnames + num_pos_args;
8433#if !CYTHON_COMPILING_IN_PYPY || defined(PyArg_ValidateKeywordArguments)
8434 if (unlikely(!PyArg_ValidateKeywordArguments(kwds)))
return -1;
8436 if (PyDict_Update(kwds2, kwds) < 0)
goto bad;
8437 name = first_kw_arg;
8439 PyObject *key = **name;
8441#if !CYTHON_COMPILING_IN_LIMITED_API && (PY_VERSION_HEX >= 0x030d00A2 || defined(PyDict_Pop))
8442 int found = PyDict_Pop(kwds2, key, &value);
8444 if (unlikely(found < 0))
goto bad;
8445 values[name-argnames] = value;
8447#elif __PYX_LIMITED_VERSION_HEX >= 0x030d0000
8448 int found = PyDict_GetItemRef(kwds2, key, &value);
8450 if (unlikely(found < 0))
goto bad;
8451 values[name-argnames] = value;
8452 if (unlikely(PyDict_DelItem(kwds2, key) < 0))
goto bad;
8455 #if CYTHON_COMPILING_IN_CPYTHON
8456 value = _PyDict_Pop(kwds2, key, kwds2);
8458 value = __Pyx_CallUnboundCMethod2(&__pyx_mstate_global->__pyx_umethod_PyDict_Type_pop, kwds2, key, kwds2);
8460 if (value == kwds2) {
8463 if (unlikely(!value))
goto bad;
8464 values[name-argnames] = value;
8469 len = PyDict_Size(kwds2);
8471 return __Pyx_ValidateDuplicatePosArgs(kwds, argnames, first_kw_arg, function_name);
8472 }
else if (unlikely(len == -1)) {
8479static int __Pyx_ParseKeywordsTuple(
8481 PyObject *
const *kwvalues,
8482 PyObject **
const argnames[],
8485 Py_ssize_t num_pos_args,
8486 Py_ssize_t num_kwargs,
8487 const char* function_name,
8488 int ignore_unknown_kwargs)
8490 PyObject *key = NULL;
8491 PyObject**
const * name;
8492 PyObject**
const *first_kw_arg = argnames + num_pos_args;
8493 for (Py_ssize_t pos = 0; pos < num_kwargs; pos++) {
8494#if CYTHON_AVOID_BORROWED_REFS
8495 key = __Pyx_PySequence_ITEM(kwds, pos);
8497 key = __Pyx_PyTuple_GET_ITEM(kwds, pos);
8499#if !CYTHON_ASSUME_SAFE_MACROS
8500 if (unlikely(!key))
goto bad;
8502 name = first_kw_arg;
8503 while (*name && (**name != key)) name++;
8505 PyObject *value = kwvalues[pos];
8506 values[name-argnames] = __Pyx_NewRef(value);
8508 size_t index_found = 0;
8509 int cmp = __Pyx_MatchKeywordArg(key, argnames, first_kw_arg, &index_found, function_name);
8511 PyObject *value = kwvalues[pos];
8512 values[index_found] = __Pyx_NewRef(value);
8514 if (unlikely(cmp == -1))
goto bad;
8516 PyObject *value = kwvalues[pos];
8517 if (unlikely(PyDict_SetItem(kwds2, key, value)))
goto bad;
8518 }
else if (!ignore_unknown_kwargs) {
8519 goto invalid_keyword;
8523 #if CYTHON_AVOID_BORROWED_REFS
8530 PyErr_Format(PyExc_TypeError,
8531 "%s() got an unexpected keyword argument '%U'",
8532 function_name, key);
8535 #if CYTHON_AVOID_BORROWED_REFS
8542static int __Pyx_ParseKeywords(
8544 PyObject *
const *kwvalues,
8545 PyObject **
const argnames[],
8548 Py_ssize_t num_pos_args,
8549 Py_ssize_t num_kwargs,
8550 const char* function_name,
8551 int ignore_unknown_kwargs)
8553 if (CYTHON_VECTORCALL && likely(PyTuple_Check(kwds)))
8554 return __Pyx_ParseKeywordsTuple(kwds, kwvalues, argnames, kwds2, values, num_pos_args, num_kwargs, function_name, ignore_unknown_kwargs);
8556 return __Pyx_ParseKeywordDictToDict(kwds, argnames, kwds2, values, num_pos_args, function_name);
8558 return __Pyx_ParseKeywordDict(kwds, argnames, values, num_pos_args, num_kwargs, function_name, ignore_unknown_kwargs);
8562static void __Pyx_RaiseArgtupleInvalid(
8563 const char* func_name,
8567 Py_ssize_t num_found)
8569 Py_ssize_t num_expected;
8570 const char *more_or_less;
8571 if (num_found < num_min) {
8572 num_expected = num_min;
8573 more_or_less =
"at least";
8575 num_expected = num_max;
8576 more_or_less =
"at most";
8579 more_or_less =
"exactly";
8581 PyErr_Format(PyExc_TypeError,
8582 "%.200s() takes %.8s %" CYTHON_FORMAT_SSIZE_T
"d positional argument%.1s (%" CYTHON_FORMAT_SSIZE_T
"d given)",
8583 func_name, more_or_less, num_expected,
8584 (num_expected == 1) ?
"" :
"s", num_found);
8588#ifndef __PYX_HAVE_RT_ImportType_3_3_0
8589#define __PYX_HAVE_RT_ImportType_3_3_0
8590static PyTypeObject *__Pyx_ImportType_3_3_0(PyObject *module,
const char *module_name,
const char *class_name,
8591 size_t size,
size_t alignment,
enum __Pyx_ImportType_CheckSize_3_3_0 check_size)
8593 PyObject *result = 0;
8594 Py_ssize_t basicsize;
8595 Py_ssize_t itemsize;
8596#if defined(Py_LIMITED_API) || (defined(CYTHON_COMPILING_IN_LIMITED_API) && CYTHON_COMPILING_IN_LIMITED_API)
8597 PyObject *py_basicsize;
8598 PyObject *py_itemsize;
8600 result = PyObject_GetAttrString(module, class_name);
8603 if (!PyType_Check(result)) {
8604 PyErr_Format(PyExc_TypeError,
8605 "%.200s.%.200s is not a type object",
8606 module_name, class_name);
8609#if !( defined(Py_LIMITED_API) || (defined(CYTHON_COMPILING_IN_LIMITED_API) && CYTHON_COMPILING_IN_LIMITED_API) )
8610 basicsize = ((PyTypeObject *)result)->tp_basicsize;
8611 itemsize = ((PyTypeObject *)result)->tp_itemsize;
8614 return (PyTypeObject *)result;
8616 py_basicsize = PyObject_GetAttrString(result,
"__basicsize__");
8619 basicsize = PyLong_AsSsize_t(py_basicsize);
8620 Py_DECREF(py_basicsize);
8622 if (basicsize == (Py_ssize_t)-1 && PyErr_Occurred())
8624 py_itemsize = PyObject_GetAttrString(result,
"__itemsize__");
8627 itemsize = PyLong_AsSsize_t(py_itemsize);
8628 Py_DECREF(py_itemsize);
8630 if (itemsize == (Py_ssize_t)-1 && PyErr_Occurred())
8634 if (size % alignment) {
8635 alignment = size % alignment;
8637 if (itemsize < (Py_ssize_t)alignment)
8638 itemsize = (Py_ssize_t)alignment;
8640 if ((
size_t)(basicsize + itemsize) < size) {
8641 PyErr_Format(PyExc_ValueError,
8642 "%.200s.%.200s size changed, may indicate binary incompatibility. "
8643 "Expected %zd from C header, got %zd from PyObject",
8644 module_name, class_name, size, basicsize+itemsize);
8647 if (check_size == __Pyx_ImportType_CheckSize_Error_3_3_0 &&
8648 ((
size_t)basicsize > size || (
size_t)(basicsize + itemsize) < size)) {
8649 PyErr_Format(PyExc_ValueError,
8650 "%.200s.%.200s size changed, may indicate binary incompatibility. "
8651 "Expected %zd from C header, got %zd-%zd from PyObject",
8652 module_name, class_name, size, basicsize, basicsize+itemsize);
8655 else if (check_size == __Pyx_ImportType_CheckSize_Warn_3_3_0 && (
size_t)basicsize > size) {
8656 if (PyErr_WarnFormat(NULL, 0,
8657 "%.200s.%.200s size changed, may indicate binary incompatibility. "
8658 "Expected %zd from C header, got %zd from PyObject",
8659 module_name, class_name, size, basicsize) < 0) {
8663 return (PyTypeObject *)result;
8671#if __PYX_LIMITED_VERSION_HEX < 0x030d0000
8672static void __Pyx_PyObject_GetAttrStr_ClearAttributeError(
void) {
8673 __Pyx_PyThreadState_declare
8674 __Pyx_PyThreadState_assign
8675 if (likely(__Pyx_PyErr_ExceptionMatches(PyExc_AttributeError)))
8676 __Pyx_PyErr_Clear();
8679static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStrNoError(PyObject* obj, PyObject* attr_name) {
8681#if __PYX_LIMITED_VERSION_HEX >= 0x030d0000
8682 (void) PyObject_GetOptionalAttr(obj, attr_name, &result);
8685#if CYTHON_COMPILING_IN_CPYTHON && CYTHON_USE_TYPE_SLOTS
8686 PyTypeObject* tp = Py_TYPE(obj);
8687 if (likely(tp->tp_getattro == PyObject_GenericGetAttr)) {
8688 return _PyObject_GenericGetAttrWithDict(obj, attr_name, NULL, 1);
8691 result = __Pyx_PyObject_GetAttrStr(obj, attr_name);
8692 if (unlikely(!result)) {
8693 __Pyx_PyObject_GetAttrStr_ClearAttributeError();
8700#if __PYX_LIMITED_VERSION_HEX < 0x030d0000
8701static CYTHON_INLINE
int __Pyx_HasAttr(PyObject *o, PyObject *
n) {
8703 if (unlikely(!PyUnicode_Check(
n))) {
8704 PyErr_SetString(PyExc_TypeError,
8705 "hasattr(): attribute name must be string");
8708 r = __Pyx_PyObject_GetAttrStrNoError(o,
n);
8710 return (unlikely(PyErr_Occurred())) ? -1 : 0;
8719CYTHON_UNUSED
static PyObject *
8720__Pyx_PyList_FromArray(PyObject *
const *src, Py_ssize_t
n) {
8721 PyObject *res = PyList_New(
n);
8722 if (unlikely(res == NULL))
return NULL;
8723 #if CYTHON_COMPILING_IN_CPYTHON
8724 __Pyx_copy_object_array(src, ((PyListObject*)res)->ob_item,
n);
8727 for (i = 0; i <
n; i++) {
8729 if (unlikely(__Pyx_PyList_SET_ITEM(res, i, src[i]) < (0))) {
8739static int __Pyx__Import_GetModule(PyObject *qualname, PyObject **module) {
8740 PyObject *imported_module = PyImport_GetModule(qualname);
8741 if (unlikely(!imported_module)) {
8743 if (PyErr_Occurred()) {
8748 *
module = imported_module;
8751static int __Pyx__Import_Lookup(PyObject *qualname, PyObject *
const *imported_names, Py_ssize_t len_imported_names, PyObject **module) {
8752 PyObject *imported_module;
8753 PyObject *top_level_package_name;
8755 int status, module_found;
8756 Py_ssize_t dot_index;
8757 module_found = __Pyx__Import_GetModule(qualname, &imported_module);
8758 if (unlikely(!module_found || module_found == -1)) {
8760 return module_found;
8762 if (imported_names) {
8763 for (i = 0; i < len_imported_names; i++) {
8764 PyObject *imported_name = imported_names[i];
8765#if __PYX_LIMITED_VERSION_HEX < 0x030d0000
8766 int has_imported_attribute = PyObject_HasAttr(imported_module, imported_name);
8768 int has_imported_attribute = PyObject_HasAttrWithError(imported_module, imported_name);
8769 if (unlikely(has_imported_attribute == -1))
goto error;
8771 if (!has_imported_attribute) {
8775 *
module = imported_module;
8778 dot_index = PyUnicode_FindChar(qualname,
'.', 0, PY_SSIZE_T_MAX, 1);
8779 if (dot_index == -1) {
8780 *
module = imported_module;
8783 if (unlikely(dot_index == -2))
goto error;
8784 top_level_package_name = PyUnicode_Substring(qualname, 0, dot_index);
8785 if (unlikely(!top_level_package_name))
goto error;
8786 Py_DECREF(imported_module);
8787 status = __Pyx__Import_GetModule(top_level_package_name, module);
8788 Py_DECREF(top_level_package_name);
8791 Py_DECREF(imported_module);
8795 Py_DECREF(imported_module);
8799static PyObject *__Pyx__Import(PyObject *name, PyObject *
const *imported_names, Py_ssize_t len_imported_names, PyObject *qualname, PyObject *moddict,
int level) {
8800 PyObject *module = 0;
8801 PyObject *empty_dict = 0;
8802 PyObject *from_list = 0;
8807 module_found = __Pyx__Import_Lookup(qualname, imported_names, len_imported_names, &module);
8808 if (likely(module_found == 1)) {
8810 }
else if (unlikely(module_found == -1)) {
8813 #if !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX >= 0x030f00a6
8814 empty_dict = PyFrozenDict_New(NULL);
8816 empty_dict = PyDict_New();
8818 if (unlikely(!empty_dict))
8820 if (imported_names) {
8821 from_list = __Pyx_PyList_FromArray(imported_names, len_imported_names);
8822 if (unlikely(!from_list))
8826 const char* package_sep = strchr(__Pyx_MODULE_NAME,
'.');
8827 if (package_sep != (0)) {
8828 module = PyImport_ImportModuleLevelObject(
8829 name, moddict, empty_dict, from_list, 1);
8830 if (unlikely(!module)) {
8831 if (unlikely(!PyErr_ExceptionMatches(PyExc_ImportError)))
8839 module = PyImport_ImportModuleLevelObject(
8840 name, moddict, empty_dict, from_list, level);
8843 Py_XDECREF(from_list);
8844 Py_XDECREF(empty_dict);
8849static PyObject *__Pyx_Import(PyObject *name, PyObject *
const *imported_names, Py_ssize_t len_imported_names, PyObject *qualname,
int level) {
8850 return __Pyx__Import(name, imported_names, len_imported_names, qualname, __pyx_mstate_global->__pyx_d, level);
8854static CYTHON_INLINE PyObject *__Pyx_PyDict_SetDefault(PyObject *d, PyObject *key, PyObject *default_value) {
8856#if __PYX_LIMITED_VERSION_HEX >= 0x030F0000 || (!CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX >= 0x030d00A4)
8857 PyDict_SetDefaultRef(d, key, default_value, &value);
8858#elif CYTHON_COMPILING_IN_LIMITED_API && __PYX_LIMITED_VERSION_HEX >= 0x030C0000
8859 PyObject *args[] = {d, key, default_value};
8860 value = PyObject_VectorcallMethod(__pyx_mstate_global->__pyx_n_u_setdefault, args, 3 | PY_VECTORCALL_ARGUMENTS_OFFSET, NULL);
8861#elif CYTHON_COMPILING_IN_LIMITED_API
8862 value = PyObject_CallMethodObjArgs(d, __pyx_mstate_global->__pyx_n_u_setdefault, key, default_value, NULL);
8864 value = PyDict_SetDefault(d, key, default_value);
8865 if (unlikely(!value))
return NULL;
8872#if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING && PY_VERSION_HEX < 0x030F00a3
8873 static PyObject *__Pyx_PyImport_AddModuleObjectRef(PyObject *name) {
8874 PyObject *module_dict = PyImport_GetModuleDict();
8876 if (PyMapping_GetOptionalItem(module_dict, name, &m) < 0) {
8879 if (m != NULL && PyModule_Check(m)) {
8883 m = PyModule_NewObject(name);
8886 if (PyDict_CheckExact(module_dict)) {
8888 (void)PyDict_SetDefaultRef(module_dict, name, m, &new_m);
8892 if (PyObject_SetItem(module_dict, name, m) != 0) {
8899 static PyObject *__Pyx_PyImport_AddModuleRef(
const char *name) {
8900 if ((PY_VERSION_HEX >= 0x030E0000) && Py_Version >= 0x030E0100) {
8901 return PyImport_AddModuleRef(name);
8903 PyObject *py_name = PyUnicode_FromString(name);
8904 if (!py_name)
return NULL;
8905 PyObject *module = __Pyx_PyImport_AddModuleObjectRef(py_name);
8909#elif __PYX_LIMITED_VERSION_HEX < 0x030d0000
8910 static PyObject *__Pyx_PyImport_AddModuleRef(
const char *name) {
8911 PyObject *module = PyImport_AddModule(name);
8918static PyObject *__Pyx_FetchSharedCythonABIModule(
void) {
8919 return __Pyx_PyImport_AddModuleRef(__PYX_ABI_MODULE_NAME);
8923static int __Pyx_VerifyCachedType(PyObject *cached_type,
8925 Py_ssize_t expected_basicsize) {
8926 Py_ssize_t basicsize;
8927 if (!PyType_Check(cached_type)) {
8928 PyErr_Format(PyExc_TypeError,
8929 "Shared Cython type %.200s is not a type object", name);
8932 if (expected_basicsize == 0) {
8935#if CYTHON_COMPILING_IN_LIMITED_API && CYTHON_OPAQUE_OBJECTS
8936 if (expected_basicsize < 0) {
8937 basicsize = PyType_GetTypeDataSize((PyTypeObject*)cached_type);
8941 #if CYTHON_COMPILING_IN_LIMITED_API
8942 PyObject *py_basicsize;
8943 py_basicsize = PyObject_GetAttrString(cached_type,
"__basicsize__");
8944 if (unlikely(!py_basicsize))
return -1;
8945 basicsize = PyLong_AsSsize_t(py_basicsize);
8946 Py_DECREF(py_basicsize);
8947 py_basicsize = NULL;
8948 if (unlikely(basicsize == (Py_ssize_t)-1) && PyErr_Occurred())
return -1;
8950 basicsize = ((PyTypeObject*) cached_type)->tp_basicsize;
8953 if ((expected_basicsize >= 0) ?
8954 (basicsize != expected_basicsize) :
8955 (basicsize < -expected_basicsize)) {
8956 PyErr_Format(PyExc_TypeError,
8957 "Shared Cython type %.200s has the wrong size, try recompiling",
8965#if __PYX_LIMITED_VERSION_HEX < 0x030C0000
8966static PyObject* __Pyx_PyType_FromMetaclass(PyTypeObject *metaclass, PyObject *module, PyType_Spec *spec, PyObject *bases) {
8967 PyObject *result = __Pyx_PyType_FromModuleAndSpec(module, spec, bases);
8968 if (result && metaclass) {
8969 PyObject *old_tp = (PyObject*)Py_TYPE(result);
8970 Py_INCREF((PyObject*)metaclass);
8971 Py_SET_TYPE(result, metaclass);
8973 PyType_Modified((PyTypeObject*)result);
8978#define __Pyx_PyType_FromMetaclass(me, mo, s, b) PyType_FromMetaclass(me, mo, s, b)
8980static PyTypeObject *__Pyx_FetchCommonTypeFromSpec(PyTypeObject *metaclass, PyObject *module, PyType_Spec *spec, PyObject *bases) {
8981 PyObject *abi_module = NULL, *cached_type = NULL, *abi_module_dict, *new_cached_type, *py_object_name;
8982 int get_item_ref_result;
8983 const char* object_name = strrchr(spec->name,
'.');
8984 object_name = object_name ? object_name+1 : spec->name;
8985 py_object_name = PyUnicode_FromString(object_name);
8986 if (!py_object_name)
return NULL;
8987 abi_module = __Pyx_FetchSharedCythonABIModule();
8988 if (!abi_module)
goto done;
8989 abi_module_dict = PyModule_GetDict(abi_module);
8990 if (!abi_module_dict)
goto done;
8991 get_item_ref_result = __Pyx_PyDict_GetItemRef(abi_module_dict, py_object_name, &cached_type);
8992 if (get_item_ref_result == 1) {
8993 if (__Pyx_VerifyCachedType(
8996 spec->basicsize) < 0) {
9000 }
else if (unlikely(get_item_ref_result == -1)) {
9003 cached_type = __Pyx_PyType_FromMetaclass(
9005 CYTHON_USE_MODULE_STATE ? module : abi_module,
9007 if (unlikely(!cached_type))
goto bad;
9008 new_cached_type = __Pyx_PyDict_SetDefault(abi_module_dict, py_object_name, cached_type);
9009 if (unlikely(new_cached_type != cached_type)) {
9010 if (unlikely(!new_cached_type))
goto bad;
9011 Py_DECREF(cached_type);
9012 cached_type = new_cached_type;
9013 if (__Pyx_VerifyCachedType(
9016 spec->basicsize) < 0) {
9021 Py_DECREF(new_cached_type);
9024 Py_XDECREF(abi_module);
9025 Py_DECREF(py_object_name);
9026 assert(cached_type == NULL || PyType_Check(cached_type));
9027 return (PyTypeObject *) cached_type;
9029 Py_XDECREF(cached_type);
9035static PyObject* __pyx_CommonTypesMetaclass_get_module(CYTHON_UNUSED PyObject *self, CYTHON_UNUSED
void* context) {
9036 return PyUnicode_FromString(__PYX_ABI_MODULE_NAME);
9038#if __PYX_LIMITED_VERSION_HEX < 0x030A0000
9039static PyObject* __pyx_CommonTypesMetaclass_call(CYTHON_UNUSED PyObject *self, CYTHON_UNUSED PyObject *args, CYTHON_UNUSED PyObject *kwds) {
9040 PyErr_SetString(PyExc_TypeError,
"Cannot instantiate Cython internal types");
9043static int __pyx_CommonTypesMetaclass_setattr(CYTHON_UNUSED PyObject *self, CYTHON_UNUSED PyObject *attr, CYTHON_UNUSED PyObject *value) {
9044 PyErr_SetString(PyExc_TypeError,
"Cython internal types are immutable");
9048static PyGetSetDef __pyx_CommonTypesMetaclass_getset[] = {
9049 {
"__module__", __pyx_CommonTypesMetaclass_get_module, NULL, NULL, NULL},
9052static PyType_Slot __pyx_CommonTypesMetaclass_slots[] = {
9053 {Py_tp_getset, (
void *)__pyx_CommonTypesMetaclass_getset},
9054 #if __PYX_LIMITED_VERSION_HEX < 0x030A0000
9055 {Py_tp_call, (
void*)__pyx_CommonTypesMetaclass_call},
9056 {Py_tp_new, (
void*)__pyx_CommonTypesMetaclass_call},
9057 {Py_tp_setattro, (
void*)__pyx_CommonTypesMetaclass_setattr},
9061static PyType_Spec __pyx_CommonTypesMetaclass_spec = {
9062 __PYX_TYPE_MODULE_PREFIX
"_common_types_metatype",
9065 Py_TPFLAGS_IMMUTABLETYPE |
9066 Py_TPFLAGS_DISALLOW_INSTANTIATION |
9068 __pyx_CommonTypesMetaclass_slots
9070static int __pyx_CommonTypesMetaclass_init(PyObject *module) {
9071 __pyx_mstatetype *mstate = __Pyx_PyModule_GetState(module);
9072 PyObject *bases = PyTuple_Pack(1, &PyType_Type);
9073 if (unlikely(!bases)) {
9076 mstate->__pyx_CommonTypesMetaclassType = __Pyx_FetchCommonTypeFromSpec(NULL, module, &__pyx_CommonTypesMetaclass_spec, bases);
9078 if (unlikely(mstate->__pyx_CommonTypesMetaclassType == NULL)) {
9085#if CYTHON_COMPILING_IN_LIMITED_API
9086static CYTHON_INLINE
int __Pyx__IsSameCyOrCFunctionNoMethod(PyObject *func,
void (*cfunc)(
void)) {
9087 if (__Pyx_CyFunction_Check(func)) {
9088 return __Pyx_as_CyFunctionObject(func)->func_methoddef->ml_meth == (PyCFunction) cfunc;
9089 }
else if (PyCFunction_Check(func)) {
9090 return PyCFunction_GetFunction(func) == (PyCFunction) cfunc;
9094static CYTHON_INLINE
int __Pyx__IsSameCyOrCFunction(PyObject *func,
void (*cfunc)(
void)) {
9095 if ((PyObject*)Py_TYPE(func) == __pyx_mstate_global->__Pyx_CachedMethodType) {
9097 PyObject *newFunc = PyObject_GetAttr(func, __pyx_mstate_global->__pyx_n_u_func);
9098 if (unlikely(!newFunc)) {
9102 result = __Pyx__IsSameCyOrCFunctionNoMethod(newFunc, cfunc);
9106 return __Pyx__IsSameCyOrCFunctionNoMethod(func, cfunc);
9109static CYTHON_INLINE
int __Pyx__IsSameCyOrCFunction(PyObject *func,
void (*cfunc)(
void)) {
9110 if (PyMethod_Check(func)) {
9111 func = PyMethod_GET_FUNCTION(func);
9113 return __Pyx_CyOrPyCFunction_Check(func) && __Pyx_CyOrPyCFunction_GET_FUNCTION(func) == (PyCFunction) cfunc;
9116static CYTHON_INLINE
void __Pyx__CyFunction_SetClassObj(__pyx_CyFunctionObject*
f, PyObject* classobj) {
9117#if CYTHON_COMPILING_IN_LIMITED_API
9118 __Pyx_Py_XDECREF_SET(
9119 __Pyx__CyFunction_GetClassObj(
f),
9120 ((classobj) ? __Pyx_NewRef(classobj) : NULL));
9122 __Pyx_Py_XDECREF_SET(
9123 ((PyCMethodObject *) (
f))->mm_class,
9124 (PyTypeObject*)((classobj) ? __Pyx_NewRef(classobj) : NULL));
9127static CYTHON_INLINE PyObject *__Pyx_CyFunction_InitDefaults(PyObject *func, PyTypeObject *defaults_type) {
9128 __pyx_CyFunctionObject *m = __Pyx_as_CyFunctionObject(func);
9129 m->defaults = PyObject_CallObject((PyObject*)defaults_type, NULL);
9130 if (unlikely(!m->defaults))
9134static CYTHON_INLINE
void __Pyx_CyFunction_SetDefaultsTuple(PyObject *func, PyObject *tuple) {
9135 __pyx_CyFunctionObject *m = __Pyx_as_CyFunctionObject(func);
9136 m->defaults_tuple = tuple;
9139static CYTHON_INLINE
void __Pyx_CyFunction_SetDefaultsKwDict(PyObject *func, PyObject *dict) {
9140 __pyx_CyFunctionObject *m = __Pyx_as_CyFunctionObject(func);
9141 m->defaults_kwdict = dict;
9144static CYTHON_INLINE
void __Pyx_CyFunction_SetAnnotationsDict(PyObject *func, PyObject *dict) {
9145 __pyx_CyFunctionObject *m = __Pyx_as_CyFunctionObject(func);
9146 m->func_annotations = dict;
9151#if !CYTHON_USE_TYPE_SPECS
9153static int __Pyx_call_type_traverse(PyObject *o,
int always_call, visitproc visit,
void *arg) {
9155 PyTypeObject *base = __Pyx_PyObject_GetSlot(o, tp_base, PyTypeObject*);
9156 unsigned long flags = PyType_GetFlags(base);
9157 if (flags & Py_TPFLAGS_HEAPTYPE) {
9161 Py_VISIT((PyObject*)Py_TYPE(o));
9167#if CYTHON_COMPILING_IN_LIMITED_API
9168static PyObject *__Pyx_PyMethod_New(PyObject *func, PyObject *self, PyObject *typ) {
9170 CYTHON_UNUSED_VAR(typ);
9172 return __Pyx_NewRef(func);
9173 #if __PYX_LIMITED_VERSION_HEX >= 0x030C0000
9175 PyObject *args[] = {func, self};
9176 result = PyObject_Vectorcall(__pyx_mstate_global->__Pyx_CachedMethodType, args, 2, NULL);
9179 result = PyObject_CallFunctionObjArgs(__pyx_mstate_global->__Pyx_CachedMethodType, func, self, NULL);
9184static PyObject *__Pyx_PyMethod_New(PyObject *func, PyObject *self, PyObject *typ) {
9185 CYTHON_UNUSED_VAR(typ);
9187 return __Pyx_NewRef(func);
9188 return PyMethod_New(func, self);
9193#if CYTHON_VECTORCALL
9194static PyObject *__Pyx_PyVectorcall_FastCallDict_kw(PyObject *func, __pyx_vectorcallfunc vc, PyObject *
const *args,
size_t nargs, PyObject *kw)
9196 PyObject *res = NULL;
9199 PyObject **kwvalues;
9201 #if CYTHON_AVOID_BORROWED_REFS
9207 PyObject *key, *value;
9208 unsigned long keys_are_strings;
9209 #if !CYTHON_ASSUME_SAFE_SIZE
9210 Py_ssize_t nkw = PyDict_Size(kw);
9211 if (unlikely(nkw == -1))
return NULL;
9213 Py_ssize_t nkw = PyDict_GET_SIZE(kw);
9215 newargs = (PyObject **)PyMem_Malloc((nargs + (
size_t)nkw) *
sizeof(args[0]));
9216 if (unlikely(newargs == NULL)) {
9220 for (j = 0; j < nargs; j++) newargs[j] = args[j];
9221 kwnames = PyTuple_New(nkw);
9222 if (unlikely(kwnames == NULL)) {
9223 PyMem_Free(newargs);
9226 kwvalues = newargs + nargs;
9229 keys_are_strings = Py_TPFLAGS_UNICODE_SUBCLASS;
9230 while (__Pyx_PyDict_NextRef(kw, &pos, &key, &value)) {
9232 #if CYTHON_COMPILING_IN_LIMITED_API
9233 PyType_GetFlags(Py_TYPE(key));
9235 Py_TYPE(key)->tp_flags;
9237 #if !CYTHON_ASSUME_SAFE_MACROS
9238 if (unlikely(PyTuple_SetItem(kwnames, i, key) < 0))
goto cleanup;
9240 PyTuple_SET_ITEM(kwnames, i, key);
9242 kwvalues[i] = value;
9245 if (unlikely(!keys_are_strings)) {
9246 PyErr_SetString(PyExc_TypeError,
"keywords must be strings");
9249 res = vc(func, newargs, nargs, kwnames);
9251 #if CYTHON_AVOID_BORROWED_REFS
9255 for (i = 0; i < nkw; i++)
9256 Py_DECREF(kwvalues[i]);
9257 PyMem_Free(newargs);
9260static CYTHON_INLINE PyObject *__Pyx_PyVectorcall_FastCallDict(PyObject *func, __pyx_vectorcallfunc vc, PyObject *
const *args,
size_t nargs, PyObject *kw)
9262 Py_ssize_t kw_size =
9263 likely(kw == NULL) ?
9265#if !CYTHON_ASSUME_SAFE_SIZE
9268 PyDict_GET_SIZE(kw);
9271 return vc(func, args, nargs, NULL);
9273#if !CYTHON_ASSUME_SAFE_SIZE
9274 else if (unlikely(kw_size == -1)) {
9278 return __Pyx_PyVectorcall_FastCallDict_kw(func, vc, args, nargs, kw);
9284__Pyx_CyFunction_get_doc_locked(__pyx_CyFunctionObject *op)
9286 if (unlikely(op->func_doc == NULL)) {
9287#if CYTHON_COMPILING_IN_LIMITED_API
9288 const char *doc = op->func_methoddef->ml_doc;
9290 const char *doc = ((PyCFunctionObject*)op)->m_ml->ml_doc;
9293 op->func_doc = PyUnicode_FromString(doc);
9294 if (unlikely(op->func_doc == NULL))
9301 Py_INCREF(op->func_doc);
9302 return op->func_doc;
9305__Pyx_CyFunction_get_doc(PyObject *op_in,
void *closure) {
9307 __pyx_CyFunctionObject *op = __Pyx_as_CyFunctionObject(op_in);
9308 CYTHON_UNUSED_VAR(closure);
9309 __Pyx_BEGIN_CRITICAL_SECTION(op_in);
9310 result = __Pyx_CyFunction_get_doc_locked(op);
9311 __Pyx_END_CRITICAL_SECTION();
9315__Pyx_CyFunction_set_doc(PyObject *op_in, PyObject *value,
void *context)
9317 __pyx_CyFunctionObject *op = __Pyx_as_CyFunctionObject(op_in);
9318 CYTHON_UNUSED_VAR(context);
9319 if (value == NULL) {
9323 __Pyx_BEGIN_CRITICAL_SECTION(op_in);
9324 __Pyx_Py_XDECREF_SET(op->func_doc, value);
9325 __Pyx_END_CRITICAL_SECTION();
9329__Pyx_CyFunction_get_name_locked(__pyx_CyFunctionObject *op)
9331 if (unlikely(op->func_name == NULL)) {
9332#if CYTHON_COMPILING_IN_LIMITED_API
9333 const char *name = op->func_methoddef->ml_name;
9335 const char *name = ((PyCFunctionObject*)op)->m_ml->ml_name;
9337 op->func_name = PyUnicode_InternFromString(name);
9338 if (unlikely(op->func_name == NULL))
9341 Py_INCREF(op->func_name);
9342 return op->func_name;
9345__Pyx_CyFunction_get_name(PyObject *op,
void *context)
9347 PyObject *result = NULL;
9348 CYTHON_UNUSED_VAR(context);
9349 __Pyx_BEGIN_CRITICAL_SECTION(op);
9350 result = __Pyx_CyFunction_get_name_locked(__Pyx_as_CyFunctionObject(op));
9351 __Pyx_END_CRITICAL_SECTION();
9355__Pyx_CyFunction_set_name(PyObject *op_in, PyObject *value,
void *context)
9357 CYTHON_UNUSED_VAR(context);
9358 if (unlikely(value == NULL || !PyUnicode_Check(value))) {
9359 PyErr_SetString(PyExc_TypeError,
9360 "__name__ must be set to a string object");
9363 __pyx_CyFunctionObject *op = __Pyx_as_CyFunctionObject(op_in);
9365 __Pyx_BEGIN_CRITICAL_SECTION(op_in);
9366 __Pyx_Py_XDECREF_SET(op->func_name, value);
9367 __Pyx_END_CRITICAL_SECTION();
9371__Pyx_CyFunction_get_qualname(PyObject *op_in,
void *context)
9373 CYTHON_UNUSED_VAR(context);
9374 __pyx_CyFunctionObject *op = __Pyx_as_CyFunctionObject(op_in);
9376 __Pyx_BEGIN_CRITICAL_SECTION(op_in);
9377 Py_INCREF(op->func_qualname);
9378 result = op->func_qualname;
9379 __Pyx_END_CRITICAL_SECTION();
9383__Pyx_CyFunction_set_qualname(PyObject *op_in, PyObject *value,
void *context)
9385 CYTHON_UNUSED_VAR(context);
9386 if (unlikely(value == NULL || !PyUnicode_Check(value))) {
9387 PyErr_SetString(PyExc_TypeError,
9388 "__qualname__ must be set to a string object");
9391 __pyx_CyFunctionObject *op = __Pyx_as_CyFunctionObject(op_in);
9393 __Pyx_BEGIN_CRITICAL_SECTION(op_in);
9394 __Pyx_Py_XDECREF_SET(op->func_qualname, value);
9395 __Pyx_END_CRITICAL_SECTION();
9398#if CYTHON_COMPILING_IN_LIMITED_API && __PYX_LIMITED_VERSION_HEX < 0x030A0000
9400__Pyx_CyFunction_get_dict(__pyx_CyFunctionObject *op,
void *context)
9402 CYTHON_UNUSED_VAR(context);
9403 if (unlikely(op->func_dict == NULL)) {
9404 op->func_dict = PyDict_New();
9405 if (unlikely(op->func_dict == NULL))
9408 Py_INCREF(op->func_dict);
9409 return op->func_dict;
9413__Pyx_CyFunction_get_globals(PyObject *op_in,
void *context)
9415 CYTHON_UNUSED_VAR(context);
9416 __pyx_CyFunctionObject *op = __Pyx_as_CyFunctionObject(op_in);
9417 Py_INCREF(op->func_globals);
9418 return op->func_globals;
9421__Pyx_CyFunction_get_closure(PyObject *op,
void *context)
9423 CYTHON_UNUSED_VAR(op);
9424 CYTHON_UNUSED_VAR(context);
9429__Pyx_CyFunction_get_code(PyObject *op_in,
void *context)
9431 __pyx_CyFunctionObject *op = __Pyx_as_CyFunctionObject(op_in);
9432 PyObject* result = (op->func_code) ? op->func_code : Py_None;
9433 CYTHON_UNUSED_VAR(context);
9438__Pyx_CyFunction_init_defaults(__pyx_CyFunctionObject *op, PyObject *op_obj) {
9440 PyObject *res = op->defaults_getter(op_obj);
9443 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
9444 op->defaults_tuple = PyTuple_GET_ITEM(res, 0);
9445 Py_INCREF(op->defaults_tuple);
9446 op->defaults_kwdict = PyTuple_GET_ITEM(res, 1);
9447 Py_INCREF(op->defaults_kwdict);
9449 op->defaults_tuple = __Pyx_PySequence_ITEM(res, 0);
9450 if (unlikely(!op->defaults_tuple)) result = -1;
9452 op->defaults_kwdict = __Pyx_PySequence_ITEM(res, 1);
9453 if (unlikely(!op->defaults_kwdict)) result = -1;
9460__Pyx_CyFunction_set_defaults(PyObject *op_in, PyObject* value,
void *context) {
9461 __pyx_CyFunctionObject *op = __Pyx_as_CyFunctionObject(op_in);
9462 CYTHON_UNUSED_VAR(context);
9465 }
else if (unlikely(value != Py_None && !PyTuple_Check(value))) {
9466 PyErr_SetString(PyExc_TypeError,
9467 "__defaults__ must be set to a tuple object");
9470 PyErr_WarnEx(PyExc_RuntimeWarning,
"changes to cyfunction.__defaults__ will not "
9471 "currently affect the values used in function calls", 1);
9473 __Pyx_BEGIN_CRITICAL_SECTION(op_in);
9474 __Pyx_Py_XDECREF_SET(op->defaults_tuple, value);
9475 __Pyx_END_CRITICAL_SECTION();
9479__Pyx_CyFunction_get_defaults_locked(PyObject *op_in) {
9480 __pyx_CyFunctionObject *op = __Pyx_as_CyFunctionObject(op_in);
9481 PyObject* result = op->defaults_tuple;
9482 if (unlikely(!result)) {
9483 if (op->defaults_getter) {
9484 if (unlikely(__Pyx_CyFunction_init_defaults(op, op_in) < 0))
return NULL;
9485 result = op->defaults_tuple;
9494__Pyx_CyFunction_get_defaults(PyObject *op,
void *context) {
9495 PyObject* result = NULL;
9496 CYTHON_UNUSED_VAR(context);
9497 __Pyx_BEGIN_CRITICAL_SECTION(op);
9498 result = __Pyx_CyFunction_get_defaults_locked(op);
9499 __Pyx_END_CRITICAL_SECTION();
9503__Pyx_CyFunction_set_kwdefaults(PyObject *op_in, PyObject* value,
void *context) {
9504 __pyx_CyFunctionObject *op = __Pyx_as_CyFunctionObject(op_in);
9505 CYTHON_UNUSED_VAR(context);
9508 }
else if (unlikely(value != Py_None && !PyDict_Check(value))) {
9509 PyErr_SetString(PyExc_TypeError,
9510 "__kwdefaults__ must be set to a dict object");
9513 PyErr_WarnEx(PyExc_RuntimeWarning,
"changes to cyfunction.__kwdefaults__ will not "
9514 "currently affect the values used in function calls", 1);
9516 __Pyx_BEGIN_CRITICAL_SECTION(op_in);
9517 __Pyx_Py_XDECREF_SET(op->defaults_kwdict, value);
9518 __Pyx_END_CRITICAL_SECTION();
9522__Pyx_CyFunction_get_kwdefaults_locked(PyObject *op_in) {
9523 __pyx_CyFunctionObject *op = __Pyx_as_CyFunctionObject(op_in);
9524 PyObject* result = op->defaults_kwdict;
9525 if (unlikely(!result)) {
9526 if (op->defaults_getter) {
9527 if (unlikely(__Pyx_CyFunction_init_defaults(op, op_in) < 0))
return NULL;
9528 result = op->defaults_kwdict;
9537__Pyx_CyFunction_get_kwdefaults(PyObject *op,
void *context) {
9539 CYTHON_UNUSED_VAR(context);
9540 __Pyx_BEGIN_CRITICAL_SECTION(op);
9541 result = __Pyx_CyFunction_get_kwdefaults_locked(op);
9542 __Pyx_END_CRITICAL_SECTION();
9545static int __Pyx_CyFunction_set_annotate_in_dict_if_exists(PyObject *op_in, PyObject *value);
9547__Pyx_CyFunction_set_annotations(PyObject *op_in, PyObject* value,
void *context) {
9548 CYTHON_UNUSED_VAR(context);
9549 if (!value || value == Py_None) {
9551 }
else if (unlikely(!PyDict_Check(value))) {
9552 PyErr_SetString(PyExc_TypeError,
9553 "__annotations__ must be set to a dict object");
9556 __pyx_CyFunctionObject *op = __Pyx_as_CyFunctionObject(op_in);
9558 __Pyx_BEGIN_CRITICAL_SECTION(op_in);
9559 __Pyx_Py_XDECREF_SET(op->func_annotations, value);
9560 __Pyx_END_CRITICAL_SECTION();
9561 if (unlikely(__Pyx_CyFunction_set_annotate_in_dict_if_exists(op_in, Py_None) < 0))
return -1;
9565__Pyx_CyFunction_get_dict_if_exists(PyObject *op_in, PyObject **dict) {
9568#if CYTHON_COMPILING_IN_PYPY
9569 *dict = PyObject_GenericGetDict(op_in, NULL);
9570#elif CYTHON_COMPILING_IN_LIMITED_API || PY_VERSION_HEX < 0x030C0000
9571 *dict = __Pyx_as_CyFunctionObject(op_in)->func_dict;
9573 PyObject **dictptr = _PyObject_GetDictPtr(op_in);
9574 *dict = likely(dictptr) ? *dictptr : NULL;
9576 return *dict ? 1 : 0;
9579__Pyx_CyFunction_get_annotate_from_dict_if_exists(PyObject *op_in, PyObject **annotate) {
9583 dict_found = __Pyx_CyFunction_get_dict_if_exists(op_in, &dict);
9584 if (!dict_found)
return 0;
9585 return __Pyx_PyDict_GetItemRef(dict, __pyx_mstate_global->__pyx_n_u_annotate, annotate);
9588__Pyx_CyFunction_set_annotate_in_dict_if_exists(PyObject *op_in, PyObject *value) {
9591 dict_found = __Pyx_CyFunction_get_dict_if_exists(op_in, &dict);
9592 if (!dict_found)
return 0;
9594 return PyDict_SetItem(dict, __pyx_mstate_global->__pyx_n_u_annotate, value);
9596#if !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX >= 0x030d0000
9597 return PyDict_Pop(dict, __pyx_mstate_global->__pyx_n_u_annotate, NULL);
9599 int result = PyDict_Contains(dict, __pyx_mstate_global->__pyx_n_u_annotate);
9601 result = PyDict_DelItem(dict, __pyx_mstate_global->__pyx_n_u_annotate);
9608__Pyx_CyFunction_set_annotate_in_dict(PyObject *op_in, PyObject *value) {
9611#if CYTHON_COMPILING_IN_LIMITED_API && __PYX_LIMITED_VERSION_HEX < 0x030A0000
9612 dict = __Pyx_CyFunction_get_dict(__Pyx_as_CyFunctionObject(op_in), NULL);
9614 dict = PyObject_GenericGetDict(op_in, NULL);
9616 if (unlikely(!dict))
return -1;
9617 result = PyDict_SetItem(dict, __pyx_mstate_global->__pyx_n_u_annotate, value);
9622__Pyx_CyFunction_get_annotations_locked(__pyx_CyFunctionObject *op) {
9623 PyObject* result = op->func_annotations;
9624 if (unlikely(!result)) {
9625 result = PyDict_New();
9626 if (unlikely(!result))
return NULL;
9627 op->func_annotations = result;
9633__Pyx_CyFunction_get_annotations(PyObject *op_in,
void *context) {
9634 PyObject *annotate = NULL;
9635 PyObject *result = NULL;
9636 __pyx_CyFunctionObject *op = __Pyx_as_CyFunctionObject(op_in);
9637 CYTHON_UNUSED_VAR(context);
9638 __Pyx_BEGIN_CRITICAL_SECTION(op_in);
9639 result = __Pyx_XNewRef(op->func_annotations);
9640 __Pyx_END_CRITICAL_SECTION();
9641 if (result)
return result;
9642 if (unlikely(__Pyx_CyFunction_get_annotate_from_dict_if_exists(op_in, &annotate) < 0))
return NULL;
9643 if (!annotate || annotate == Py_None) {
9644 Py_XDECREF(annotate);
9645 __Pyx_BEGIN_CRITICAL_SECTION(op_in);
9646 result = __Pyx_CyFunction_get_annotations_locked(op);
9647 __Pyx_END_CRITICAL_SECTION();
9650 PyObject *format = PyLong_FromLong(1L);
9651 if (likely(format)) {
9652 if (!Py_EnterRecursiveCall(
" cyfunction __annotations__.__get__")) {
9653 result = __Pyx_PyObject_CallOneArg(annotate, format);
9654 Py_LeaveRecursiveCall();
9658 Py_DECREF(annotate);
9659 if (unlikely(!result))
return NULL;
9660 if (unlikely(!PyDict_Check(result))) {
9661 PyErr_SetString(PyExc_TypeError,
"__annotate__ must return a dict");
9665 __Pyx_BEGIN_CRITICAL_SECTION(op_in);
9666 __Pyx_Py_XDECREF_SET(op->func_annotations, __Pyx_NewRef(result));
9667 __Pyx_END_CRITICAL_SECTION();
9670static PyObject *__Pyx_CyFunction_annotate_impl(PyObject *self, PyObject *arg) {
9671 CYTHON_UNUSED_VAR(arg);
9672 if (unlikely(!self)) {
9673 PyErr_SetString(PyExc_SystemError,
"cython __annotate__ called without 'self' argument");
9677 if (Py_EnterRecursiveCall(
" in cyfunction annotate")) {
9680 result = __Pyx_CyFunction_get_annotations(self, NULL);
9681 Py_LeaveRecursiveCall();
9685__Pyx_CyFunction_get_annotate(PyObject *op_in,
void *context);
9687__Pyx_CyFunction_set_annotate(PyObject *op_in, PyObject* value,
void *context) {
9688 CYTHON_UNUSED_VAR(context);
9689 if (value == NULL) {
9690 PyErr_SetString(PyExc_TypeError,
"__annotate__ cannot be deleted");
9693 if (unlikely(value != Py_None && !PyCallable_Check(value))) {
9694 PyErr_SetString(PyExc_TypeError,
"__annotate__ must be callable or None");
9697 if (unlikely(__Pyx_TypeCheck(value, &PyCFunction_Type))) {
9698#if !CYTHON_ASSUME_SAFE_MACROS && !CYTHON_COMPILING_IN_PYPY
9699 PyCFunction cfunction = PyCFunction_GetFunction(value);
9700 if (unlikely(!cfunction))
return -1;
9701 PyObject *value_self = PyCFunction_GetSelf(value);
9702 if (unlikely(!value_self && PyErr_Occurred()))
return -1;
9704 PyCFunction cfunction = PyCFunction_GET_FUNCTION(value);
9705 PyObject *value_self = PyCFunction_GET_SELF(value);
9707 if (cfunction == __Pyx_CyFunction_annotate_impl && value_self == op_in) {
9708 return __Pyx_CyFunction_set_annotate_in_dict_if_exists(op_in, NULL);
9711 if (value != Py_None) {
9712 __pyx_CyFunctionObject *op = __Pyx_as_CyFunctionObject(op_in);
9713 __Pyx_BEGIN_CRITICAL_SECTION(op_in);
9714 Py_CLEAR(op->func_annotations);
9715 __Pyx_END_CRITICAL_SECTION();
9717 return __Pyx_CyFunction_set_annotate_in_dict(op_in, value);
9719#if __PYX_LIMITED_VERSION_HEX < 0x030B0000
9721__Pyx_CyFunction_get_is_coroutine_value(__pyx_CyFunctionObject *op) {
9722 int is_coroutine = op->flags & __Pyx_CYFUNCTION_COROUTINE;
9724 PyObject *is_coroutine_value, *module, *fromlist, *marker = __pyx_mstate_global->__pyx_n_u_is_coroutine;
9725 fromlist = PyList_New(1);
9726 if (unlikely(!fromlist))
return NULL;
9728#if CYTHON_ASSUME_SAFE_MACROS
9729 PyList_SET_ITEM(fromlist, 0, marker);
9731 if (unlikely(PyList_SetItem(fromlist, 0, marker) < 0)) {
9732 Py_DECREF(fromlist);
9736 module = PyImport_ImportModuleLevelObject(__pyx_mstate_global->__pyx_n_u_asyncio_coroutines, NULL, NULL, fromlist, 0);
9737 Py_DECREF(fromlist);
9738 if (unlikely(!module)) {
9739 goto ignore_or_error;
9741 is_coroutine_value = __Pyx_PyObject_GetAttrStr(module, marker);
9743 if (likely(is_coroutine_value)) {
9744 return is_coroutine_value;
9747 if (!__Pyx_IgnoreException(PyExc_Exception)) {
9751 return __Pyx_PyBool_FromLong(is_coroutine);
9754__Pyx_CyFunction_get_is_coroutine(PyObject *op_in,
void *context) {
9755 __pyx_CyFunctionObject *op = __Pyx_as_CyFunctionObject(op_in);
9757 CYTHON_UNUSED_VAR(context);
9758 if (op->func_is_coroutine) {
9759 return __Pyx_NewRef(op->func_is_coroutine);
9761 result = __Pyx_CyFunction_get_is_coroutine_value(op);
9762 if (unlikely(!result))
9764 __Pyx_BEGIN_CRITICAL_SECTION(op_in);
9765 if (op->func_is_coroutine) {
9767 result = __Pyx_NewRef(op->func_is_coroutine);
9769 op->func_is_coroutine = __Pyx_NewRef(result);
9771 __Pyx_END_CRITICAL_SECTION();
9775static void __Pyx_CyFunction_raise_argument_count_error(PyObject *func,
const char* message, Py_ssize_t size) {
9776#if CYTHON_COMPILING_IN_LIMITED_API
9777 PyObject *py_name = __Pyx_CyFunction_get_name(func, NULL);
9778 if (!py_name)
return;
9779 PyErr_Format(PyExc_TypeError,
9780 "%.200S() %s (%" CYTHON_FORMAT_SSIZE_T
"d given)",
9781 py_name, message, size);
9784 const char* name = ((PyCFunctionObject*)func)->m_ml->ml_name;
9785 PyErr_Format(PyExc_TypeError,
9786 "%.200s() %s (%" CYTHON_FORMAT_SSIZE_T
"d given)",
9787 name, message, size);
9790static void __Pyx_CyFunction_raise_type_error(PyObject *func,
const char* message) {
9791#if CYTHON_COMPILING_IN_LIMITED_API
9792 PyObject *py_name = __Pyx_CyFunction_get_name(func, NULL);
9793 if (!py_name)
return;
9794 PyErr_Format(PyExc_TypeError,
9799 const char* name = ((PyCFunctionObject*)func)->m_ml->ml_name;
9800 PyErr_Format(PyExc_TypeError,
9805#if CYTHON_COMPILING_IN_LIMITED_API
9807__Pyx_CyFunction_get_module(PyObject *op_in,
void *context) {
9808 CYTHON_UNUSED_VAR(context);
9809 __pyx_CyFunctionObject *op = __Pyx_as_CyFunctionObject(op_in);
9810 Py_INCREF(op->func_module);
9811 return op->func_module;
9814__Pyx_CyFunction_set_module(PyObject *op_in, PyObject* value,
void *context) {
9815 CYTHON_UNUSED_VAR(context);
9816 __pyx_CyFunctionObject *op = __Pyx_as_CyFunctionObject(op_in);
9817 if (value == NULL) {
9821 PyObject *old = op->func_module;
9822 op->func_module = value;
9827static PyGetSetDef __pyx_CyFunction_getsets[] = {
9828 {
"func_doc", (getter)__Pyx_CyFunction_get_doc, (setter)__Pyx_CyFunction_set_doc, 0, 0},
9829 {
"__doc__", (getter)__Pyx_CyFunction_get_doc, (setter)__Pyx_CyFunction_set_doc, 0, 0},
9830 {
"func_name", (getter)__Pyx_CyFunction_get_name, (setter)__Pyx_CyFunction_set_name, 0, 0},
9831 {
"__name__", (getter)__Pyx_CyFunction_get_name, (setter)__Pyx_CyFunction_set_name, 0, 0},
9832 {
"__qualname__", (getter)__Pyx_CyFunction_get_qualname, (setter)__Pyx_CyFunction_set_qualname, 0, 0},
9833#if CYTHON_COMPILING_IN_LIMITED_API && __PYX_LIMITED_VERSION_HEX < 0x030A0000
9834 {
"func_dict", (getter)__Pyx_CyFunction_get_dict, (setter)PyObject_GenericSetDict, 0, 0},
9835 {
"__dict__", (getter)__Pyx_CyFunction_get_dict, (setter)PyObject_GenericSetDict, 0, 0},
9837 {
"func_dict", (getter)PyObject_GenericGetDict, (setter)PyObject_GenericSetDict, 0, 0},
9838 {
"__dict__", (getter)PyObject_GenericGetDict, (setter)PyObject_GenericSetDict, 0, 0},
9840 {
"func_globals", (getter)__Pyx_CyFunction_get_globals, 0, 0, 0},
9841 {
"__globals__", (getter)__Pyx_CyFunction_get_globals, 0, 0, 0},
9842 {
"func_closure", (getter)__Pyx_CyFunction_get_closure, 0, 0, 0},
9843 {
"__closure__", (getter)__Pyx_CyFunction_get_closure, 0, 0, 0},
9844 {
"func_code", (getter)__Pyx_CyFunction_get_code, 0, 0, 0},
9845 {
"__code__", (getter)__Pyx_CyFunction_get_code, 0, 0, 0},
9846 {
"func_defaults", (getter)__Pyx_CyFunction_get_defaults, (setter)__Pyx_CyFunction_set_defaults, 0, 0},
9847 {
"__defaults__", (getter)__Pyx_CyFunction_get_defaults, (setter)__Pyx_CyFunction_set_defaults, 0, 0},
9848 {
"__kwdefaults__", (getter)__Pyx_CyFunction_get_kwdefaults, (setter)__Pyx_CyFunction_set_kwdefaults, 0, 0},
9849 {
"__annotations__", (getter)__Pyx_CyFunction_get_annotations, (setter)__Pyx_CyFunction_set_annotations, 0, 0},
9850 {
"__annotate__", (getter)__Pyx_CyFunction_get_annotate, (setter)__Pyx_CyFunction_set_annotate, 0, 0},
9851#if __PYX_LIMITED_VERSION_HEX < 0x030B0000
9852 {
"_is_coroutine", (getter)__Pyx_CyFunction_get_is_coroutine, 0, 0, 0},
9854#if CYTHON_COMPILING_IN_LIMITED_API
9855 {
"__module__", (getter)__Pyx_CyFunction_get_module, (setter)__Pyx_CyFunction_set_module, 0, 0},
9859static PyMemberDef __pyx_CyFunction_members[] = {
9860#if !CYTHON_COMPILING_IN_LIMITED_API
9861 {
"__module__", T_OBJECT, offsetof(PyCFunctionObject, m_module), 0, 0},
9863#if PY_VERSION_HEX < 0x030C0000 || CYTHON_COMPILING_IN_LIMITED_API
9864 {
"__dictoffset__", T_PYSSIZET, offsetof(__pyx_CyFunctionObject, func_dict),
9865 __PYX_SHARED_RELATIVE_OFFSET | READONLY, 0},
9867#if CYTHON_VECTORCALL
9868#if CYTHON_COMPILING_IN_LIMITED_API || CYTHON_COMPILING_IN_PYPY
9869 {
"__vectorcalloffset__", T_PYSSIZET, offsetof(__pyx_CyFunctionObject, func_vectorcall),
9870 __PYX_SHARED_RELATIVE_OFFSET | READONLY, 0},
9872 {
"__vectorcalloffset__", T_PYSSIZET, offsetof(PyCFunctionObject, vectorcall), READONLY, 0},
9874#if CYTHON_COMPILING_IN_LIMITED_API
9875 {
"__weaklistoffset__", T_PYSSIZET, offsetof(__pyx_CyFunctionObject, func_weakreflist),
9876 __PYX_SHARED_RELATIVE_OFFSET | READONLY, 0},
9878 {
"__weaklistoffset__", T_PYSSIZET, offsetof(PyCFunctionObject, m_weakreflist), READONLY, 0},
9884__Pyx_CyFunction_reduce(PyObject *m_in, PyObject *args)
9886 PyObject *result = NULL;
9887 __pyx_CyFunctionObject *m = __Pyx_as_CyFunctionObject(m_in);
9888 CYTHON_UNUSED_VAR(args);
9889 __Pyx_BEGIN_CRITICAL_SECTION(m_in);
9890 Py_INCREF(m->func_qualname);
9891 result = m->func_qualname;
9892 __Pyx_END_CRITICAL_SECTION();
9895static PyMethodDef __pyx_CyFunction_methods[] = {
9896 {
"__annotate_cython__", __Pyx_CyFunction_annotate_impl, METH_O,
9897 "Placeholder __annotate__ function to allow 'functools.wraps' to work "
9898 "on Cython functions."},
9899 {
"__reduce__", (PyCFunction)__Pyx_CyFunction_reduce, METH_NOARGS, 0},
9903__Pyx_CyFunction_get_annotate(PyObject *op_in,
void *context) {
9904 PyObject *annotate = NULL;
9905 CYTHON_UNUSED_VAR(context);
9906 if (unlikely(__Pyx_CyFunction_get_annotate_from_dict_if_exists(op_in, &annotate) < 0))
return NULL;
9907 if (annotate)
return annotate;
9908 PyObject *method = PyCFunction_New(
9909 &__pyx_CyFunction_methods[0],
9913#if CYTHON_COMPILING_IN_LIMITED_API
9914#define __Pyx_CyFunction_weakreflist(cyfunc) ((cyfunc)->func_weakreflist)
9916#define __Pyx_CyFunction_weakreflist(cyfunc) (((PyCFunctionObject*)cyfunc)->m_weakreflist)
9918static PyObject *__Pyx_CyFunction_Init(PyObject *op_in,
9919 PyMethodDef *ml,
int flags, PyObject* qualname,
9920 PyObject *closure, PyObject *module, PyObject* globals, PyObject* code) {
9921 __pyx_CyFunctionObject* op = __Pyx_as_CyFunctionObject(op_in);
9922#if !CYTHON_COMPILING_IN_LIMITED_API
9923 PyCFunctionObject *cf = (PyCFunctionObject*) op;
9925 if (unlikely(op == NULL))
9927#if CYTHON_COMPILING_IN_LIMITED_API
9928 op->func_methoddef = ml;
9930 op->func_module =
module;
9933 __Pyx_CyFunction_weakreflist(op) = NULL;
9934#if !CYTHON_COMPILING_IN_LIMITED_API
9936 cf->m_self = (PyObject *) op;
9938 Py_XINCREF(closure);
9939 op->func_closure = closure;
9940#if !CYTHON_COMPILING_IN_LIMITED_API
9942 cf->m_module =
module;
9944#if PY_VERSION_HEX < 0x030C0000 || CYTHON_COMPILING_IN_LIMITED_API
9945 op->func_dict = NULL;
9947 op->func_name = NULL;
9948 Py_INCREF(qualname);
9949 op->func_qualname = qualname;
9950 op->func_doc = NULL;
9951#if CYTHON_COMPILING_IN_LIMITED_API
9952 op->func_classobj = NULL;
9954 ((PyCMethodObject*)op)->mm_class = NULL;
9956 op->func_globals = globals;
9957 Py_INCREF(op->func_globals);
9959 op->func_code = code;
9960 op->defaults = NULL;
9961 op->defaults_tuple = NULL;
9962 op->defaults_kwdict = NULL;
9963 op->defaults_getter = NULL;
9964 op->func_annotations = NULL;
9965#if __PYX_LIMITED_VERSION_HEX < 0x030B0000
9966 op->func_is_coroutine = NULL;
9968#if CYTHON_VECTORCALL
9969 switch (ml->ml_flags & (METH_VARARGS | METH_FASTCALL | METH_NOARGS | METH_O | METH_KEYWORDS | METH_METHOD)) {
9971 __Pyx_CyFunction_func_vectorcall(op) = __Pyx_CyFunction_Vectorcall_NOARGS;
9974 __Pyx_CyFunction_func_vectorcall(op) = __Pyx_CyFunction_Vectorcall_O;
9976 case METH_METHOD | METH_FASTCALL | METH_KEYWORDS:
9977 __Pyx_CyFunction_func_vectorcall(op) = __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS_METHOD;
9979 case METH_FASTCALL | METH_KEYWORDS:
9980 __Pyx_CyFunction_func_vectorcall(op) = __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS;
9982 case METH_VARARGS | METH_KEYWORDS:
9983 __Pyx_CyFunction_func_vectorcall(op) = NULL;
9986 PyErr_SetString(PyExc_SystemError,
"Bad call flags for CyFunction");
9993static int __Pyx__CyFunction_clear(__pyx_CyFunctionObject *m)
9995 Py_CLEAR(m->func_closure);
9996#if CYTHON_COMPILING_IN_LIMITED_API
9997 Py_CLEAR(m->func_module);
9999 Py_CLEAR(((PyCFunctionObject*)m)->m_module);
10001#if PY_VERSION_HEX < 0x030C0000 || CYTHON_COMPILING_IN_LIMITED_API
10002 Py_CLEAR(m->func_dict);
10003#elif PY_VERSION_HEX < 0x030d0000
10004 _PyObject_ClearManagedDict((PyObject*)m);
10006 PyObject_ClearManagedDict((PyObject*)m);
10008 Py_CLEAR(m->func_name);
10009 Py_CLEAR(m->func_qualname);
10010 Py_CLEAR(m->func_doc);
10011 Py_CLEAR(m->func_globals);
10012 Py_CLEAR(m->func_code);
10013#if CYTHON_COMPILING_IN_LIMITED_API
10014 Py_CLEAR(m->func_classobj);
10017 PyObject *cls = (PyObject*) ((PyCMethodObject *) (m))->mm_class;
10018 ((PyCMethodObject *) (m))->mm_class = NULL;
10022 Py_CLEAR(m->defaults_tuple);
10023 Py_CLEAR(m->defaults_kwdict);
10024 Py_CLEAR(m->func_annotations);
10025#if __PYX_LIMITED_VERSION_HEX < 0x030B0000
10026 Py_CLEAR(m->func_is_coroutine);
10028 Py_CLEAR(m->defaults);
10032__Pyx_CyFunction_clear(PyObject *m)
10034 return __Pyx__CyFunction_clear(__Pyx_as_CyFunctionObject(m));
10036static void __Pyx__CyFunction_dealloc(PyObject *m)
10038 __pyx_CyFunctionObject *cyfunc = __Pyx_as_CyFunctionObject(m);
10039 if (__Pyx_CyFunction_weakreflist(cyfunc) != NULL)
10040 PyObject_ClearWeakRefs(m);
10041 __Pyx__CyFunction_clear(cyfunc);
10042 __Pyx_PyHeapTypeObject_GC_Del(m);
10044static void __Pyx_CyFunction_dealloc(PyObject *m)
10046 PyObject_GC_UnTrack(m);
10047 __Pyx__CyFunction_dealloc(m);
10049static int __Pyx_CyFunction_traverse(PyObject *m_in, visitproc visit,
void *arg)
10051 __pyx_CyFunctionObject *m = __Pyx_as_CyFunctionObject(m_in);
10053 int e = __Pyx_call_type_traverse(m_in, 1, visit, arg);
10056 Py_VISIT(m->func_closure);
10057#if CYTHON_COMPILING_IN_LIMITED_API
10058 Py_VISIT(m->func_module);
10060 Py_VISIT(((PyCFunctionObject*)m)->m_module);
10062#if PY_VERSION_HEX < 0x030C0000 || CYTHON_COMPILING_IN_LIMITED_API
10063 Py_VISIT(m->func_dict);
10067#if PY_VERSION_HEX < 0x030d0000
10068 _PyObject_VisitManagedDict
10070 PyObject_VisitManagedDict
10072 ((PyObject*)m, visit, arg);
10073 if (e != 0)
return e;
10076 __Pyx_VISIT_CONST(m->func_name);
10077 __Pyx_VISIT_CONST(m->func_qualname);
10078 Py_VISIT(m->func_doc);
10079 Py_VISIT(m->func_globals);
10080 __Pyx_VISIT_CONST(m->func_code);
10081 Py_VISIT(__Pyx__CyFunction_GetClassObj(m));
10082 Py_VISIT(m->defaults_tuple);
10083 Py_VISIT(m->defaults_kwdict);
10084 Py_VISIT(m->func_annotations);
10085#if __PYX_LIMITED_VERSION_HEX < 0x030B0000
10086 Py_VISIT(m->func_is_coroutine);
10088 Py_VISIT(m->defaults);
10092__Pyx_CyFunction_repr(PyObject *op_in)
10094 __pyx_CyFunctionObject *op = __Pyx_as_CyFunctionObject(op_in);
10096 __Pyx_BEGIN_CRITICAL_SECTION(op_in);
10097 repr = PyUnicode_FromFormat(
"<cyfunction %U at %p>",
10098 op->func_qualname, (
void *)op);
10099 __Pyx_END_CRITICAL_SECTION();
10102static PyObject * __Pyx_CyFunction_CallMethod(PyObject *func, PyObject *self, PyObject *arg, PyObject *kw) {
10103#if CYTHON_COMPILING_IN_LIMITED_API
10104 __pyx_CyFunctionObject *cyfunc = __Pyx_as_CyFunctionObject(func);
10105 PyCFunction meth = cyfunc->func_methoddef->ml_meth;
10106 int flags = cyfunc->func_methoddef->ml_flags;
10108 PyCFunctionObject*
f = (PyCFunctionObject*)func;
10109 PyCFunction meth =
f->m_ml->ml_meth;
10110 int flags =
f->m_ml->ml_flags;
10113 switch (flags & (METH_VARARGS | METH_KEYWORDS | METH_NOARGS | METH_O)) {
10115 if (likely(kw == NULL || PyDict_Size(kw) == 0))
10116 return (*meth)(self, arg);
10118 case METH_VARARGS | METH_KEYWORDS:
10119 return (*(PyCFunctionWithKeywords)(
void(*)(
void))meth)(self, arg, kw);
10121 if (likely(kw == NULL || PyDict_Size(kw) == 0)) {
10122#if CYTHON_ASSUME_SAFE_SIZE
10123 size = PyTuple_GET_SIZE(arg);
10125 size = PyTuple_Size(arg);
10126 if (unlikely(size < 0))
return NULL;
10128 if (likely(size == 0))
10129 return (*meth)(self, NULL);
10130 __Pyx_CyFunction_raise_argument_count_error(
10132 "takes no arguments", size);
10137 if (likely(kw == NULL || PyDict_Size(kw) == 0)) {
10138#if CYTHON_ASSUME_SAFE_SIZE
10139 size = PyTuple_GET_SIZE(arg);
10141 size = PyTuple_Size(arg);
10142 if (unlikely(size < 0))
return NULL;
10144 if (likely(size == 1)) {
10145 PyObject *result, *arg0;
10146 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
10147 arg0 = PyTuple_GET_ITEM(arg, 0);
10149 arg0 = __Pyx_PySequence_ITEM(arg, 0);
if (unlikely(!arg0))
return NULL;
10151 result = (*meth)(self, arg0);
10152 #if !(CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS)
10157 __Pyx_CyFunction_raise_argument_count_error(
10159 "takes exactly one argument", size);
10164 PyErr_SetString(PyExc_SystemError,
"Bad call flags for CyFunction");
10167 __Pyx_CyFunction_raise_type_error(
10168 func,
"takes no keyword arguments");
10171static CYTHON_INLINE PyObject *__Pyx_CyFunction_Call(PyObject *func, PyObject *arg, PyObject *kw) {
10173 result = __Pyx_CyFunction_CallMethod(func, func, arg, kw);
10176static PyObject *__Pyx_CyFunction_CallAsMethod(PyObject *func, PyObject *args, PyObject *kw) {
10178 __pyx_CyFunctionObject *cyfunc = __Pyx_as_CyFunctionObject(func);
10179#if CYTHON_VECTORCALL
10180 __pyx_vectorcallfunc vc = __Pyx_CyFunction_func_vectorcall(cyfunc);
10182#if CYTHON_ASSUME_SAFE_MACROS && CYTHON_ASSUME_SAFE_SIZE
10183 return __Pyx_PyVectorcall_FastCallDict(func, vc, &PyTuple_GET_ITEM(args, 0), (
size_t)PyTuple_GET_SIZE(args), kw);
10185 (void) &__Pyx_PyVectorcall_FastCallDict;
10186 return PyVectorcall_Call(func, args, kw);
10190 if ((cyfunc->flags & __Pyx_CYFUNCTION_CCLASS) && !(cyfunc->flags & __Pyx_CYFUNCTION_STATICMETHOD)) {
10192 PyObject *new_args;
10194#if CYTHON_ASSUME_SAFE_SIZE
10195 argc = PyTuple_GET_SIZE(args);
10197 argc = PyTuple_Size(args);
10198 if (unlikely(argc < 0))
return NULL;
10200 new_args = PyTuple_GetSlice(args, 1, argc);
10201 if (unlikely(!new_args))
10203 self = PyTuple_GetItem(args, 0);
10204 if (unlikely(!self)) {
10205 Py_DECREF(new_args);
10206 PyErr_Format(PyExc_TypeError,
10207 "unbound method %.200S() needs an argument",
10208 cyfunc->func_qualname);
10211 result = __Pyx_CyFunction_CallMethod(func, self, new_args, kw);
10212 Py_DECREF(new_args);
10214 result = __Pyx_CyFunction_Call(func, args, kw);
10218#if CYTHON_VECTORCALL
10219static CYTHON_INLINE
int __Pyx_CyFunction_Vectorcall_CheckArgs(PyObject *func, __pyx_CyFunctionObject *cyfunc, Py_ssize_t nargs, PyObject *kwnames)
10222 if ((cyfunc->flags & __Pyx_CYFUNCTION_CCLASS) && !(cyfunc->flags & __Pyx_CYFUNCTION_STATICMETHOD)) {
10223 if (unlikely(nargs < 1)) {
10224 __Pyx_CyFunction_raise_type_error(
10225 func,
"needs an argument");
10230 if (unlikely(kwnames) && unlikely(__Pyx_PyTuple_GET_SIZE(kwnames))) {
10231 __Pyx_CyFunction_raise_type_error(
10232 func,
"takes no keyword arguments");
10237static PyObject * __Pyx_CyFunction_Vectorcall_NOARGS(PyObject *func, PyObject *
const *args,
size_t nargsf, PyObject *kwnames)
10239 __pyx_CyFunctionObject *cyfunc = __Pyx_as_CyFunctionObject(func);
10240 Py_ssize_t nargs = PyVectorcall_NARGS(nargsf);
10242#if CYTHON_COMPILING_IN_LIMITED_API
10243 PyCFunction meth = cyfunc->func_methoddef->ml_meth;
10244 if (unlikely(!meth))
return NULL;
10246 PyCFunction meth = ((PyCFunctionObject*)cyfunc)->m_ml->ml_meth;
10248 switch (__Pyx_CyFunction_Vectorcall_CheckArgs(func, cyfunc, nargs, kwnames)) {
10260 if (unlikely(nargs != 0)) {
10261 __Pyx_CyFunction_raise_argument_count_error(
10262 func,
"takes no arguments", nargs);
10265 return meth(self, NULL);
10267static PyObject * __Pyx_CyFunction_Vectorcall_O(PyObject *func, PyObject *
const *args,
size_t nargsf, PyObject *kwnames)
10269 __pyx_CyFunctionObject *cyfunc = __Pyx_as_CyFunctionObject(func);
10270 Py_ssize_t nargs = PyVectorcall_NARGS(nargsf);
10272#if CYTHON_COMPILING_IN_LIMITED_API
10273 PyCFunction meth = cyfunc->func_methoddef->ml_meth;
10274 if (unlikely(!meth))
return NULL;
10276 PyCFunction meth = ((PyCFunctionObject*)cyfunc)->m_ml->ml_meth;
10278 switch (__Pyx_CyFunction_Vectorcall_CheckArgs(func, cyfunc, nargs, kwnames)) {
10290 if (unlikely(nargs != 1)) {
10291 __Pyx_CyFunction_raise_argument_count_error(
10292 func,
"takes exactly one argument", nargs);
10295 return meth(self, args[0]);
10297static PyObject * __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS(PyObject *func, PyObject *
const *args,
size_t nargsf, PyObject *kwnames)
10299 __pyx_CyFunctionObject *cyfunc = __Pyx_as_CyFunctionObject(func);
10300 Py_ssize_t nargs = PyVectorcall_NARGS(nargsf);
10302#if CYTHON_COMPILING_IN_LIMITED_API
10303 PyCFunction meth = cyfunc->func_methoddef->ml_meth;
10304 if (unlikely(!meth))
return NULL;
10306 PyCFunction meth = ((PyCFunctionObject*)cyfunc)->m_ml->ml_meth;
10308 switch (__Pyx_CyFunction_Vectorcall_CheckArgs(func, cyfunc, nargs, NULL)) {
10320 return ((__Pyx_PyCFunctionFastWithKeywords)(
void(*)(
void))meth)(self, args, nargs, kwnames);
10322static PyObject * __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS_METHOD(PyObject *func, PyObject *
const *args,
size_t nargsf, PyObject *kwnames)
10324 __pyx_CyFunctionObject *cyfunc = __Pyx_as_CyFunctionObject(func);
10325 PyTypeObject *cls = (PyTypeObject *) __Pyx__CyFunction_GetClassObj(cyfunc);
10326 Py_ssize_t nargs = PyVectorcall_NARGS(nargsf);
10328#if CYTHON_COMPILING_IN_LIMITED_API
10329 PyCFunction meth = cyfunc->func_methoddef->ml_meth;
10330 if (unlikely(!meth))
return NULL;
10332 PyCFunction meth = ((PyCFunctionObject*)cyfunc)->m_ml->ml_meth;
10334 switch (__Pyx_CyFunction_Vectorcall_CheckArgs(func, cyfunc, nargs, NULL)) {
10346 #if PY_VERSION_HEX < 0x030e00A6
10347 size_t nargs_value = (size_t) nargs;
10349 Py_ssize_t nargs_value = nargs;
10351 return ((__Pyx_PyCMethod)(
void(*)(
void))meth)(self, cls, args, nargs_value, kwnames);
10354static PyType_Slot __pyx_CyFunctionType_slots[] = {
10355 {Py_tp_dealloc, (
void *)__Pyx_CyFunction_dealloc},
10356 {Py_tp_repr, (
void *)__Pyx_CyFunction_repr},
10357 {Py_tp_call, (
void *)__Pyx_CyFunction_CallAsMethod},
10358 {Py_tp_traverse, (
void *)__Pyx_CyFunction_traverse},
10359 {Py_tp_clear, (
void *)__Pyx_CyFunction_clear},
10360 {Py_tp_methods, (
void *)__pyx_CyFunction_methods},
10361 {Py_tp_members, (
void *)__pyx_CyFunction_members},
10362 {Py_tp_getset, (
void *)__pyx_CyFunction_getsets},
10363 {Py_tp_descr_get, (
void *)__Pyx_PyMethod_New},
10366static PyType_Spec __pyx_CyFunctionType_spec = {
10367 __PYX_TYPE_MODULE_PREFIX
"cython_function_or_method",
10368 __PYX_SHARED_SIZEOF(__pyx_CyFunctionObject),
10370#ifdef Py_TPFLAGS_METHOD_DESCRIPTOR
10371 Py_TPFLAGS_METHOD_DESCRIPTOR |
10373#if CYTHON_VECTORCALL
10374#if defined(Py_TPFLAGS_HAVE_VECTORCALL)
10375 Py_TPFLAGS_HAVE_VECTORCALL |
10376#elif defined(_Py_TPFLAGS_HAVE_VECTORCALL)
10377 _Py_TPFLAGS_HAVE_VECTORCALL |
10380#if PY_VERSION_HEX >= 0x030C0000 && !CYTHON_COMPILING_IN_LIMITED_API
10381 Py_TPFLAGS_MANAGED_DICT |
10383 Py_TPFLAGS_IMMUTABLETYPE | Py_TPFLAGS_DISALLOW_INSTANTIATION |
10384 Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC | Py_TPFLAGS_BASETYPE,
10385 __pyx_CyFunctionType_slots
10387static int __pyx_CyFunction_init(PyObject *module) {
10388 __pyx_mstatetype *mstate = __Pyx_PyModule_GetState(module);
10389 mstate->__pyx_CyFunctionType = __Pyx_FetchCommonTypeFromSpec(
10390 mstate->__pyx_CommonTypesMetaclassType, module, &__pyx_CyFunctionType_spec, NULL);
10391 if (unlikely(mstate->__pyx_CyFunctionType == NULL)) {
10398static PyObject *__Pyx_CyFunction_New(PyMethodDef *ml,
int flags, PyObject* qualname,
10399 PyObject *closure, PyObject *module, PyObject* globals, PyObject* code) {
10400 (void)&__Pyx_Get_CyFunction_Type;
10401 PyObject *op = __Pyx_CyFunction_Init(
10402 PyObject_GC_New(PyObject, __pyx_mstate_global->__pyx_CyFunctionType),
10403 ml, flags, qualname, closure, module, globals, code
10406 PyObject_GC_Track(op);
10410static PyTypeObject *__Pyx_Get_CyFunction_Type(
void) {
10411 PyTypeObject *tp = __pyx_mstate_global->__pyx_CyFunctionType;
10412 Py_INCREF((PyObject*)tp);
10417#if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_TYPE_SLOTS
10418static CYTHON_INLINE PY_UINT64_T __Pyx_get_tp_dict_version(PyObject *obj) {
10419 PyObject *dict = Py_TYPE(obj)->tp_dict;
10420 return likely(dict) ? __PYX_GET_DICT_VERSION(dict) : 0;
10422static CYTHON_INLINE PY_UINT64_T __Pyx_get_object_dict_version(PyObject *obj) {
10423 PyObject **dictptr = NULL;
10424 Py_ssize_t offset = Py_TYPE(obj)->tp_dictoffset;
10426#if CYTHON_COMPILING_IN_CPYTHON
10427 dictptr = (likely(offset > 0)) ? (PyObject **) ((
char *)obj + offset) : _PyObject_GetDictPtr(obj);
10429 dictptr = _PyObject_GetDictPtr(obj);
10432 return (dictptr && *dictptr) ? __PYX_GET_DICT_VERSION(*dictptr) : 0;
10434static CYTHON_INLINE
int __Pyx_object_dict_version_matches(PyObject* obj, PY_UINT64_T tp_dict_version, PY_UINT64_T obj_dict_version) {
10435 PyObject *dict = Py_TYPE(obj)->tp_dict;
10436 if (unlikely(!dict) || unlikely(tp_dict_version != __PYX_GET_DICT_VERSION(dict)))
10438 return obj_dict_version == __Pyx_get_object_dict_version(obj);
10443#if CYTHON_CLINE_IN_TRACEBACK && CYTHON_CLINE_IN_TRACEBACK_RUNTIME
10444#if CYTHON_COMPILING_IN_LIMITED_API && __PYX_LIMITED_VERSION_HEX < 0x030A0000
10445#define __Pyx_PyProbablyModule_GetDict(o) __Pyx_XNewRef(PyModule_GetDict(o))
10446#elif !CYTHON_COMPILING_IN_CPYTHON || CYTHON_COMPILING_IN_CPYTHON_FREETHREADING
10447#define __Pyx_PyProbablyModule_GetDict(o) PyObject_GenericGetDict(o, NULL);
10449PyObject* __Pyx_PyProbablyModule_GetDict(PyObject *o) {
10450 PyObject **dict_ptr = _PyObject_GetDictPtr(o);
10451 return dict_ptr ? __Pyx_XNewRef(*dict_ptr) : NULL;
10454static int __Pyx_CLineForTraceback(PyThreadState *tstate,
int c_line) {
10455 PyObject *use_cline = NULL;
10456 PyObject *ptype, *pvalue, *ptraceback;
10457 PyObject *cython_runtime_dict;
10458 CYTHON_MAYBE_UNUSED_VAR(tstate);
10459 if (unlikely(!__pyx_mstate_global->__pyx_cython_runtime)) {
10462 __Pyx_ErrFetchInState(tstate, &ptype, &pvalue, &ptraceback);
10463 cython_runtime_dict = __Pyx_PyProbablyModule_GetDict(__pyx_mstate_global->__pyx_cython_runtime);
10464 if (likely(cython_runtime_dict)) {
10465 __PYX_PY_DICT_LOOKUP_IF_MODIFIED(
10466 use_cline, cython_runtime_dict,
10467 __Pyx_PyDict_SetDefault(cython_runtime_dict, __pyx_mstate_global->__pyx_n_u_cline_in_traceback, Py_False))
10469 if (use_cline == NULL || use_cline == Py_False || (use_cline != Py_True && PyObject_Not(use_cline) != 0)) {
10472 Py_XDECREF(use_cline);
10473 Py_XDECREF(cython_runtime_dict);
10474 __Pyx_ErrRestoreInState(tstate, ptype, pvalue, ptraceback);
10480static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries,
int count,
int code_line) {
10481 int start = 0, mid = 0, end = count - 1;
10482 if (end >= 0 && code_line > entries[end].code_line) {
10485 while (start < end) {
10486 mid = start + (end - start) / 2;
10487 if (code_line < entries[mid].code_line) {
10489 }
else if (code_line > entries[mid].code_line) {
10495 if (code_line <= entries[mid].code_line) {
10501static __Pyx_CachedCodeObjectType *__pyx__find_code_object(
struct __Pyx_CodeObjectCache *code_cache,
int code_line) {
10502 __Pyx_CachedCodeObjectType* code_object;
10504 if (unlikely(!code_line) || unlikely(!code_cache->entries)) {
10507 pos = __pyx_bisect_code_objects(code_cache->entries, code_cache->count, code_line);
10508 if (unlikely(pos >= code_cache->count) || unlikely(code_cache->entries[pos].code_line != code_line)) {
10511 code_object = code_cache->entries[pos].code_object;
10512 Py_INCREF(code_object);
10513 return code_object;
10515static __Pyx_CachedCodeObjectType *__pyx_find_code_object(
int code_line) {
10516#if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING && !CYTHON_ATOMICS
10517 (void)__pyx__find_code_object;
10520 struct __Pyx_CodeObjectCache *code_cache = &__pyx_mstate_global->__pyx_code_cache;
10521#if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING
10522 __pyx_nonatomic_int_type old_count = __pyx_atomic_incr_acq_rel(&code_cache->accessor_count);
10523 if (old_count < 0) {
10524 __pyx_atomic_decr_acq_rel(&code_cache->accessor_count);
10528 __Pyx_CachedCodeObjectType *result = __pyx__find_code_object(code_cache, code_line);
10529#if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING
10530 __pyx_atomic_decr_acq_rel(&code_cache->accessor_count);
10535static void __pyx__insert_code_object(
struct __Pyx_CodeObjectCache *code_cache,
int code_line, __Pyx_CachedCodeObjectType* code_object)
10538 __Pyx_CodeObjectCacheEntry* entries = code_cache->entries;
10539 if (unlikely(!code_line)) {
10542 if (unlikely(!entries)) {
10543 entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Malloc(64*
sizeof(__Pyx_CodeObjectCacheEntry));
10544 if (likely(entries)) {
10545 code_cache->entries = entries;
10546 code_cache->max_count = 64;
10547 code_cache->count = 1;
10548 entries[0].code_line = code_line;
10549 entries[0].code_object = code_object;
10550 Py_INCREF(code_object);
10554 pos = __pyx_bisect_code_objects(code_cache->entries, code_cache->count, code_line);
10555 if ((pos < code_cache->count) && unlikely(code_cache->entries[pos].code_line == code_line)) {
10556 __Pyx_CachedCodeObjectType* tmp = entries[pos].code_object;
10557 entries[pos].code_object = code_object;
10558 Py_INCREF(code_object);
10562 if (code_cache->count == code_cache->max_count) {
10563 int new_max = code_cache->max_count + 64;
10564 entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Realloc(
10565 code_cache->entries, ((
size_t)new_max) *
sizeof(__Pyx_CodeObjectCacheEntry));
10566 if (unlikely(!entries)) {
10569 code_cache->entries = entries;
10570 code_cache->max_count = new_max;
10572 for (i=code_cache->count; i>pos; i--) {
10573 entries[i] = entries[i-1];
10575 entries[pos].code_line = code_line;
10576 entries[pos].code_object = code_object;
10577 code_cache->count++;
10578 Py_INCREF(code_object);
10580static void __pyx_insert_code_object(
int code_line, __Pyx_CachedCodeObjectType* code_object) {
10581#if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING && !CYTHON_ATOMICS
10582 (void)__pyx__insert_code_object;
10585 struct __Pyx_CodeObjectCache *code_cache = &__pyx_mstate_global->__pyx_code_cache;
10586#if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING
10587 __pyx_nonatomic_int_type expected = 0;
10588 if (!__pyx_atomic_int_cmp_exchange(&code_cache->accessor_count, &expected, INT_MIN)) {
10592 __pyx__insert_code_object(code_cache, code_line, code_object);
10593#if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING
10594 __pyx_atomic_sub(&code_cache->accessor_count, INT_MIN);
10600#include "compile.h"
10601#include "frameobject.h"
10602#include "traceback.h"
10603#if PY_VERSION_HEX >= 0x030b00a6 && !CYTHON_COMPILING_IN_LIMITED_API && !defined(PYPY_VERSION)
10604 #ifndef Py_BUILD_CORE
10605 #define Py_BUILD_CORE 1
10607 #include "internal/pycore_frame.h"
10609#if CYTHON_COMPILING_IN_LIMITED_API
10610static PyObject *__Pyx_PyCode_Replace_For_AddTraceback(PyObject *code, PyObject *scratch_dict,
10611 PyObject *firstlineno, PyObject *name) {
10612 PyObject *replace = NULL;
10613 if (unlikely(PyDict_SetItemString(scratch_dict,
"co_firstlineno", firstlineno)))
return NULL;
10614 if (unlikely(PyDict_SetItemString(scratch_dict,
"co_name", name)))
return NULL;
10615 replace = PyObject_GetAttrString(code,
"replace");
10616 if (likely(replace)) {
10617 PyObject *result = PyObject_Call(replace, __pyx_mstate_global->__pyx_empty_tuple, scratch_dict);
10618 Py_DECREF(replace);
10623static void __Pyx_AddTraceback(
const char *funcname,
int c_line,
10624 int py_line,
const char *filename) {
10625 PyObject *code_object = NULL, *py_py_line = NULL, *py_funcname = NULL, *dict = NULL;
10626 PyObject *replace = NULL, *getframe = NULL, *frame = NULL;
10627 PyObject *exc_type, *exc_value, *exc_traceback;
10630 c_line = __Pyx_CLineForTraceback(__Pyx_PyThreadState_Current, c_line);
10632 __Pyx_PyErr_FetchException(&exc_type, &exc_value, &exc_traceback);
10633 code_object = __pyx_find_code_object(c_line ? -c_line : py_line);
10634 if (!code_object) {
10635 code_object = Py_CompileString(
"_getframe()", filename, Py_eval_input);
10636 if (unlikely(!code_object))
goto bad;
10637 py_py_line = PyLong_FromLong(py_line);
10638 if (unlikely(!py_py_line))
goto bad;
10640 py_funcname = PyUnicode_FromFormat(
"%s (%s:%d)", funcname, __pyx_cfilenm, c_line);
10642 py_funcname = PyUnicode_FromString(funcname);
10644 if (unlikely(!py_funcname))
goto bad;
10645 dict = PyDict_New();
10646 if (unlikely(!dict))
goto bad;
10648 PyObject *old_code_object = code_object;
10649 code_object = __Pyx_PyCode_Replace_For_AddTraceback(code_object, dict, py_py_line, py_funcname);
10650 Py_DECREF(old_code_object);
10652 if (unlikely(!code_object))
goto bad;
10653 __pyx_insert_code_object(c_line ? -c_line : py_line, code_object);
10655 dict = PyDict_New();
10657 getframe = PySys_GetObject(
"_getframe");
10658 if (unlikely(!getframe))
goto bad;
10659 if (unlikely(PyDict_SetItemString(dict,
"_getframe", getframe)))
goto bad;
10660 frame = PyEval_EvalCode(code_object, dict, dict);
10661 if (unlikely(!frame) || frame == Py_None)
goto bad;
10664 __Pyx_PyErr_RestoreException(exc_type, exc_value, exc_traceback);
10665 Py_XDECREF(code_object);
10666 Py_XDECREF(py_py_line);
10667 Py_XDECREF(py_funcname);
10669 Py_XDECREF(replace);
10672 (
struct _frame*)frame);
10677static PyCodeObject* __Pyx_CreateCodeObjectForTraceback(
10678 const char *funcname,
int c_line,
10679 int py_line,
const char *filename) {
10680 PyCodeObject *py_code = NULL;
10681 PyObject *py_funcname = NULL;
10683 py_funcname = PyUnicode_FromFormat(
"%s (%s:%d)", funcname, __pyx_cfilenm, c_line);
10684 if (!py_funcname)
goto bad;
10685 funcname = PyUnicode_AsUTF8(py_funcname);
10686 if (!funcname)
goto bad;
10688 py_code = PyCode_NewEmpty(filename, funcname, py_line);
10689 Py_XDECREF(py_funcname);
10692 Py_XDECREF(py_funcname);
10695static void __Pyx_AddTraceback(
const char *funcname,
int c_line,
10696 int py_line,
const char *filename) {
10697 PyCodeObject *py_code = 0;
10698 PyFrameObject *py_frame = 0;
10699 PyThreadState *tstate = __Pyx_PyThreadState_Current;
10700 PyObject *ptype, *pvalue, *ptraceback;
10702 c_line = __Pyx_CLineForTraceback(tstate, c_line);
10704 py_code = __pyx_find_code_object(c_line ? -c_line : py_line);
10706 __Pyx_ErrFetchInState(tstate, &ptype, &pvalue, &ptraceback);
10707 py_code = __Pyx_CreateCodeObjectForTraceback(
10708 funcname, c_line, py_line, filename);
10713 Py_XDECREF(pvalue);
10714 Py_XDECREF(ptraceback);
10717 __Pyx_ErrRestoreInState(tstate, ptype, pvalue, ptraceback);
10718 __pyx_insert_code_object(c_line ? -c_line : py_line, py_code);
10720 py_frame = PyFrame_New(
10723 __pyx_mstate_global->__pyx_d,
10726 if (!py_frame)
goto bad;
10727 __Pyx_PyFrame_SetLineNumber(py_frame, py_line);
10728 PyTraceBack_Here(py_frame);
10730 Py_XDECREF(py_code);
10731 Py_XDECREF(py_frame);
10736#if CYTHON_CCOMPLEX && (1) && (!0 || __cplusplus)
10738 static CYTHON_INLINE __pyx_t_float_complex __pyx_t_float_complex_from_parts(
float x,
float y) {
10739 return ::std::complex< float >(x, y);
10742 static CYTHON_INLINE __pyx_t_float_complex __pyx_t_float_complex_from_parts(
float x,
float y) {
10743 return x + y*(__pyx_t_float_complex)_Complex_I;
10747 static CYTHON_INLINE __pyx_t_float_complex __pyx_t_float_complex_from_parts(
float x,
float y) {
10748 __pyx_t_float_complex
z;
10756#if CYTHON_CCOMPLEX && (1) && (!0 || __cplusplus)
10758 static CYTHON_INLINE
int __Pyx_c_eq_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
10759 return (a.real == b.real) && (a.imag == b.imag);
10761 static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_sum_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
10762 __pyx_t_float_complex
z;
10763 z.real = a.real + b.real;
10764 z.imag = a.imag + b.imag;
10767 static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_diff_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
10768 __pyx_t_float_complex
z;
10769 z.real = a.real - b.real;
10770 z.imag = a.imag - b.imag;
10773 static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_prod_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
10774 __pyx_t_float_complex
z;
10775 z.real = a.real * b.real - a.imag * b.imag;
10776 z.imag = a.real * b.imag + a.imag * b.real;
10780 static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_quot_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
10782 return __pyx_t_float_complex_from_parts(a.real / b.real, a.imag / b.real);
10783 }
else if (fabsf(b.real) >= fabsf(b.imag)) {
10784 if (b.real == 0 && b.imag == 0) {
10785 return __pyx_t_float_complex_from_parts(a.real / b.real, a.imag / b.imag);
10787 float r = b.imag / b.real;
10788 float s = (float)(1.0) / (b.real + b.imag *
r);
10789 return __pyx_t_float_complex_from_parts(
10790 (a.real + a.imag *
r) *
s, (a.imag - a.real *
r) *
s);
10793 float r = b.real / b.imag;
10794 float s = (float)(1.0) / (b.imag + b.real *
r);
10795 return __pyx_t_float_complex_from_parts(
10796 (a.real *
r + a.imag) *
s, (a.imag *
r - a.real) *
s);
10800 static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_quot_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
10802 return __pyx_t_float_complex_from_parts(a.real / b.real, a.imag / b.real);
10804 float denom = b.real * b.real + b.imag * b.imag;
10805 return __pyx_t_float_complex_from_parts(
10806 (a.real * b.real + a.imag * b.imag) / denom,
10807 (a.imag * b.real - a.real * b.imag) / denom);
10811 static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_neg_float(__pyx_t_float_complex a) {
10812 __pyx_t_float_complex
z;
10817 static CYTHON_INLINE
int __Pyx_c_is_zero_float(__pyx_t_float_complex a) {
10818 return (a.real == 0) && (a.imag == 0);
10820 static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_conj_float(__pyx_t_float_complex a) {
10821 __pyx_t_float_complex
z;
10827 static CYTHON_INLINE
float __Pyx_c_abs_float(__pyx_t_float_complex
z) {
10828 #if !defined(HAVE_HYPOT) || defined(_MSC_VER)
10829 return sqrtf(
z.real*
z.real +
z.imag*
z.imag);
10831 return hypotf(
z.real,
z.imag);
10834 static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_pow_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
10835 __pyx_t_float_complex
z;
10836 float r, lnr, theta, z_r, z_theta;
10837 if (b.imag == 0 && b.real == (
int)b.real) {
10839 float denom = a.real * a.real + a.imag * a.imag;
10840 a.real = a.real / denom;
10841 a.imag = -a.imag / denom;
10844 switch ((
int)b.real) {
10852 return __Pyx_c_prod_float(a, a);
10854 z = __Pyx_c_prod_float(a, a);
10855 return __Pyx_c_prod_float(
z, a);
10857 z = __Pyx_c_prod_float(a, a);
10858 return __Pyx_c_prod_float(
z,
z);
10864 }
else if ((b.imag == 0) && (a.real >= 0)) {
10865 z.real = powf(a.real, b.real);
10868 }
else if (a.real > 0) {
10873 theta = atan2f(0.0, -1.0);
10876 r = __Pyx_c_abs_float(a);
10877 theta = atan2f(a.imag, a.real);
10880 z_r = expf(lnr * b.real - theta * b.imag);
10881 z_theta = theta * b.real + lnr * b.imag;
10882 z.real = z_r * cosf(z_theta);
10883 z.imag = z_r * sinf(z_theta);
10890#if CYTHON_CCOMPLEX && (1) && (!0 || __cplusplus)
10892 static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(
double x,
double y) {
10893 return ::std::complex< double >(x, y);
10896 static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(
double x,
double y) {
10897 return x + y*(__pyx_t_double_complex)_Complex_I;
10901 static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(
double x,
double y) {
10902 __pyx_t_double_complex
z;
10910#if CYTHON_CCOMPLEX && (1) && (!0 || __cplusplus)
10912 static CYTHON_INLINE
int __Pyx_c_eq_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
10913 return (a.real == b.real) && (a.imag == b.imag);
10915 static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_sum_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
10916 __pyx_t_double_complex
z;
10917 z.real = a.real + b.real;
10918 z.imag = a.imag + b.imag;
10921 static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_diff_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
10922 __pyx_t_double_complex
z;
10923 z.real = a.real - b.real;
10924 z.imag = a.imag - b.imag;
10927 static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_prod_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
10928 __pyx_t_double_complex
z;
10929 z.real = a.real * b.real - a.imag * b.imag;
10930 z.imag = a.real * b.imag + a.imag * b.real;
10934 static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_quot_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
10936 return __pyx_t_double_complex_from_parts(a.real / b.real, a.imag / b.real);
10937 }
else if (fabs(b.real) >= fabs(b.imag)) {
10938 if (b.real == 0 && b.imag == 0) {
10939 return __pyx_t_double_complex_from_parts(a.real / b.real, a.imag / b.imag);
10941 double r = b.imag / b.real;
10942 double s = (double)(1.0) / (b.real + b.imag *
r);
10943 return __pyx_t_double_complex_from_parts(
10944 (a.real + a.imag *
r) *
s, (a.imag - a.real *
r) *
s);
10947 double r = b.real / b.imag;
10948 double s = (double)(1.0) / (b.imag + b.real *
r);
10949 return __pyx_t_double_complex_from_parts(
10950 (a.real *
r + a.imag) *
s, (a.imag *
r - a.real) *
s);
10954 static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_quot_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
10956 return __pyx_t_double_complex_from_parts(a.real / b.real, a.imag / b.real);
10958 double denom = b.real * b.real + b.imag * b.imag;
10959 return __pyx_t_double_complex_from_parts(
10960 (a.real * b.real + a.imag * b.imag) / denom,
10961 (a.imag * b.real - a.real * b.imag) / denom);
10965 static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_neg_double(__pyx_t_double_complex a) {
10966 __pyx_t_double_complex
z;
10971 static CYTHON_INLINE
int __Pyx_c_is_zero_double(__pyx_t_double_complex a) {
10972 return (a.real == 0) && (a.imag == 0);
10974 static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_conj_double(__pyx_t_double_complex a) {
10975 __pyx_t_double_complex
z;
10981 static CYTHON_INLINE
double __Pyx_c_abs_double(__pyx_t_double_complex
z) {
10982 #if !defined(HAVE_HYPOT) || defined(_MSC_VER)
10983 return sqrt(
z.real*
z.real +
z.imag*
z.imag);
10985 return hypot(
z.real,
z.imag);
10988 static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_pow_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
10989 __pyx_t_double_complex
z;
10990 double r, lnr, theta, z_r, z_theta;
10991 if (b.imag == 0 && b.real == (
int)b.real) {
10993 double denom = a.real * a.real + a.imag * a.imag;
10994 a.real = a.real / denom;
10995 a.imag = -a.imag / denom;
10998 switch ((
int)b.real) {
11006 return __Pyx_c_prod_double(a, a);
11008 z = __Pyx_c_prod_double(a, a);
11009 return __Pyx_c_prod_double(
z, a);
11011 z = __Pyx_c_prod_double(a, a);
11012 return __Pyx_c_prod_double(
z,
z);
11018 }
else if ((b.imag == 0) && (a.real >= 0)) {
11019 z.real = pow(a.real, b.real);
11022 }
else if (a.real > 0) {
11027 theta = atan2(0.0, -1.0);
11030 r = __Pyx_c_abs_double(a);
11031 theta = atan2(a.imag, a.real);
11034 z_r = exp(lnr * b.real - theta * b.imag);
11035 z_theta = theta * b.real + lnr * b.imag;
11036 z.real = z_r * cos(z_theta);
11037 z.imag = z_r * sin(z_theta);
11044#if CYTHON_CCOMPLEX && (1) && (!0 || __cplusplus)
11046 static CYTHON_INLINE __pyx_t_long_double_complex __pyx_t_long_double_complex_from_parts(
long double x,
long double y) {
11047 return ::std::complex< long double >(x, y);
11050 static CYTHON_INLINE __pyx_t_long_double_complex __pyx_t_long_double_complex_from_parts(
long double x,
long double y) {
11051 return x + y*(__pyx_t_long_double_complex)_Complex_I;
11055 static CYTHON_INLINE __pyx_t_long_double_complex __pyx_t_long_double_complex_from_parts(
long double x,
long double y) {
11056 __pyx_t_long_double_complex
z;
11064#if CYTHON_CCOMPLEX && (1) && (!0 || __cplusplus)
11066 static CYTHON_INLINE
int __Pyx_c_eq_long__double(__pyx_t_long_double_complex a, __pyx_t_long_double_complex b) {
11067 return (a.real == b.real) && (a.imag == b.imag);
11069 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) {
11070 __pyx_t_long_double_complex
z;
11071 z.real = a.real + b.real;
11072 z.imag = a.imag + b.imag;
11075 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) {
11076 __pyx_t_long_double_complex
z;
11077 z.real = a.real - b.real;
11078 z.imag = a.imag - b.imag;
11081 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) {
11082 __pyx_t_long_double_complex
z;
11083 z.real = a.real * b.real - a.imag * b.imag;
11084 z.imag = a.real * b.imag + a.imag * b.real;
11088 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) {
11090 return __pyx_t_long_double_complex_from_parts(a.real / b.real, a.imag / b.real);
11091 }
else if (fabsl(b.real) >= fabsl(b.imag)) {
11092 if (b.real == 0 && b.imag == 0) {
11093 return __pyx_t_long_double_complex_from_parts(a.real / b.real, a.imag / b.imag);
11095 long double r = b.imag / b.real;
11096 long double s = (
long double)(1.0) / (b.real + b.imag *
r);
11097 return __pyx_t_long_double_complex_from_parts(
11098 (a.real + a.imag *
r) *
s, (a.imag - a.real *
r) *
s);
11101 long double r = b.real / b.imag;
11102 long double s = (
long double)(1.0) / (b.imag + b.real *
r);
11103 return __pyx_t_long_double_complex_from_parts(
11104 (a.real *
r + a.imag) *
s, (a.imag *
r - a.real) *
s);
11108 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) {
11110 return __pyx_t_long_double_complex_from_parts(a.real / b.real, a.imag / b.real);
11112 long double denom = b.real * b.real + b.imag * b.imag;
11113 return __pyx_t_long_double_complex_from_parts(
11114 (a.real * b.real + a.imag * b.imag) / denom,
11115 (a.imag * b.real - a.real * b.imag) / denom);
11119 static CYTHON_INLINE __pyx_t_long_double_complex __Pyx_c_neg_long__double(__pyx_t_long_double_complex a) {
11120 __pyx_t_long_double_complex
z;
11125 static CYTHON_INLINE
int __Pyx_c_is_zero_long__double(__pyx_t_long_double_complex a) {
11126 return (a.real == 0) && (a.imag == 0);
11128 static CYTHON_INLINE __pyx_t_long_double_complex __Pyx_c_conj_long__double(__pyx_t_long_double_complex a) {
11129 __pyx_t_long_double_complex
z;
11135 static CYTHON_INLINE
long double __Pyx_c_abs_long__double(__pyx_t_long_double_complex
z) {
11136 #if !defined(HAVE_HYPOT) || defined(_MSC_VER)
11137 return sqrtl(
z.real*
z.real +
z.imag*
z.imag);
11139 return hypotl(
z.real,
z.imag);
11142 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) {
11143 __pyx_t_long_double_complex
z;
11144 long double r, lnr, theta, z_r, z_theta;
11145 if (b.imag == 0 && b.real == (
int)b.real) {
11147 long double denom = a.real * a.real + a.imag * a.imag;
11148 a.real = a.real / denom;
11149 a.imag = -a.imag / denom;
11152 switch ((
int)b.real) {
11160 return __Pyx_c_prod_long__double(a, a);
11162 z = __Pyx_c_prod_long__double(a, a);
11163 return __Pyx_c_prod_long__double(
z, a);
11165 z = __Pyx_c_prod_long__double(a, a);
11166 return __Pyx_c_prod_long__double(
z,
z);
11172 }
else if ((b.imag == 0) && (a.real >= 0)) {
11173 z.real = powl(a.real, b.real);
11176 }
else if (a.real > 0) {
11181 theta = atan2l(0.0, -1.0);
11184 r = __Pyx_c_abs_long__double(a);
11185 theta = atan2l(a.imag, a.real);
11188 z_r = expl(lnr * b.real - theta * b.imag);
11189 z_theta = theta * b.real + lnr * b.imag;
11190 z.real = z_r * cosl(z_theta);
11191 z.imag = z_r * sinl(z_theta);
11198#if CYTHON_COMPILING_IN_LIMITED_API && __PYX_LIMITED_VERSION_HEX < 0x030d0000
11199static __Pyx_TypeName
11200__Pyx_PyType_GetFullyQualifiedName(PyTypeObject* tp)
11202 PyObject *module = NULL, *name = NULL, *result = NULL;
11203 #if __PYX_LIMITED_VERSION_HEX < 0x030b0000
11204 name = __Pyx_PyObject_GetAttrStr((PyObject *)tp,
11205 __pyx_mstate_global->__pyx_n_u_qualname);
11207 name = PyType_GetQualName(tp);
11209 if (unlikely(name == NULL) || unlikely(!PyUnicode_Check(name)))
goto bad;
11210 module = __Pyx_PyObject_GetAttrStr((PyObject *)tp,
11211 __pyx_mstate_global->__pyx_n_u_module);
11212 if (unlikely(module == NULL) || unlikely(!PyUnicode_Check(module)))
goto bad;
11213 if (PyUnicode_CompareWithASCIIString(module,
"builtins") == 0) {
11218 result = PyUnicode_FromFormat(
"%U.%U", module, name);
11219 if (unlikely(result == NULL))
goto bad;
11222 Py_XDECREF(module);
11230 result = __Pyx_NewRef(__pyx_mstate_global->__pyx_kp_u_);
11237#if CYTHON_VECTORCALL
11238CYTHON_UNUSED
static int __Pyx_CheckVectorcallKwarg(PyObject *kwnames, Py_ssize_t i) {
11239 PyObject *key = __Pyx_PyTuple_GET_ITEM(kwnames, i);
11240#if !CYTHON_ASSUME_SAFE_MACROS
11241 if (unlikely(!key))
return -1;
11243 if (unlikely(!PyUnicode_Check(key))) {
11244 PyErr_SetString(PyExc_TypeError,
"keywords must be strings");
11250CYTHON_UNUSED
static PyObject *__Pyx_MakeKwargDict(PyObject **keys, PyObject **values, Py_ssize_t
n) {
11251 PyObject *out = PyDict_New();
11252 if (unlikely(!out))
return NULL;
11253 for (Py_ssize_t i=0; i<
n; ++i) {
11254 if (unlikely(PyDict_SetItem(out, keys[i], values[i]) < 0)) {
11261CYTHON_UNUSED
static int __Pyx_CheckVectorcallKwarg(PyObject **kwnames, Py_ssize_t i) {
11262 PyObject *key = kwnames[i];
11263 if (unlikely(!PyUnicode_Check(key))) {
11264 PyErr_SetString(PyExc_TypeError,
"keywords must be strings");
11272#if !CYTHON_VECTORCALL
11273static PyObject *__Pyx_Object_VectorcallMethodKwds(PyObject *name, PyObject *
const *args,
size_t nargsf, PyObject *kwnames) {
11275 PyObject *obj = PyObject_GetAttr(args[0], name);
11276 if (unlikely(!obj))
11278 result = __Pyx_Object_VectorcallKwds(obj, args+1, nargsf-1, kwnames);
11285static CYTHON_INLINE PyObject* __Pyx_PyLong_From_long(
long value) {
11286#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
11287#pragma GCC diagnostic push
11288#pragma GCC diagnostic ignored "-Wconversion"
11290 const long neg_one = (long) -1, const_zero = (
long) 0;
11291#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
11292#pragma GCC diagnostic pop
11294 const int is_unsigned = neg_one > const_zero;
11296 if (
sizeof(
long) <
sizeof(
long)) {
11297 return PyLong_FromLong((
long) value);
11298 }
else if (
sizeof(
long) <=
sizeof(
unsigned long)) {
11299 return PyLong_FromUnsignedLong((
unsigned long) value);
11300#if !CYTHON_COMPILING_IN_PYPY
11301 }
else if (
sizeof(
long) <=
sizeof(
unsigned PY_LONG_LONG)) {
11302 return PyLong_FromUnsignedLongLong((
unsigned PY_LONG_LONG) value);
11306 if (
sizeof(
long) <=
sizeof(
long)) {
11307 return PyLong_FromLong((
long) value);
11308 }
else if (
sizeof(
long) <=
sizeof(PY_LONG_LONG)) {
11309 return PyLong_FromLongLong((PY_LONG_LONG) value);
11313 unsigned char *bytes = (
unsigned char *)&value;
11314#if !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX >= 0x030d00A4
11316 return PyLong_FromUnsignedNativeBytes(bytes,
sizeof(value), -1);
11318 return PyLong_FromNativeBytes(bytes,
sizeof(value), -1);
11320#elif !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030d0000
11321 int one = 1;
int little = (int)*(
unsigned char *)&one;
11322 return _PyLong_FromByteArray(bytes,
sizeof(
long),
11323 little, !is_unsigned);
11325 int one = 1;
int little = (int)*(
unsigned char *)&one;
11326 PyObject *result = NULL, *kwds = NULL;
11327 PyObject *py_bytes = NULL, *order_str = NULL, *from_bytes_str = NULL;;
11328 py_bytes = PyBytes_FromStringAndSize((
char*)bytes,
sizeof(
long));
11329 if (!py_bytes)
goto limited_bad;
11330 from_bytes_str = PyUnicode_FromStringAndSize(
"from_bytes", 10);
11331 if (!from_bytes_str)
goto limited_bad;
11332 order_str = PyUnicode_FromString(little ?
"little" :
"big");
11333 if (!order_str)
goto limited_bad;
11335 PyObject *args[] = { (PyObject*)&PyLong_Type, py_bytes, order_str, Py_True };
11336 if (!is_unsigned) {
11337 PyObject *signed_str = PyUnicode_FromStringAndSize(
"signed", 6);
11338 if (!signed_str)
goto limited_bad;
11339#if CYTHON_VECTORCALL
11340 kwds = PyTuple_Pack(1, signed_str);
11343 PyObject *keys[] = {signed_str};
11344 PyObject *values[] = {Py_True};
11345 kwds = __Pyx_MakeKwargDict(keys, values, 1);
11348 Py_DECREF(signed_str);
11349 if (unlikely(!kwds))
goto limited_bad;
11351 result = __Pyx_Object_VectorcallMethodKwds(from_bytes_str, args, 3 | __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET, kwds);
11355 Py_XDECREF(order_str);
11356 Py_XDECREF(py_bytes);
11357 Py_XDECREF(from_bytes_str);
11364#define __PYX_VERIFY_RETURN_INT(target_type, func_type, func_value)\
11365 __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 0)
11366#define __PYX_VERIFY_RETURN_INT_EXC(target_type, func_type, func_value)\
11367 __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 1)
11368#define __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, exc)\
11370 func_type value = func_value;\
11371 if (sizeof(target_type) < sizeof(func_type)) {\
11372 if (unlikely(value != (func_type) (target_type) value)) {\
11373 func_type zero = 0;\
11374 if (exc && unlikely(value == (func_type)-1 && PyErr_Occurred()))\
11375 return (target_type) -1;\
11376 if (is_unsigned && unlikely(value < zero))\
11377 goto raise_neg_overflow;\
11379 goto raise_overflow;\
11382 return (target_type) value;\
11386static long __Pyx_LargePyLong___Pyx_PyLong_As_long(PyObject *x);
11387static long __Pyx_raise_neg_overflow___Pyx_PyLong_As_long(
void) {
11388 const char* type_name =
"long";
11389 PyErr_Format(PyExc_OverflowError,
11390 "can't convert negative value to %.200s", type_name);
11393static long __Pyx_raise_overflow___Pyx_PyLong_As_long(
void) {
11394 const char* type_name =
"long";
11395 PyErr_Format(PyExc_OverflowError,
11396 "value too large to convert to %.200s", type_name);
11399static CYTHON_INLINE
long __Pyx_PyULong___Pyx_PyLong_As_long(PyObject *x) {
11400 const int is_unsigned = 1;
11401#if CYTHON_USE_PYLONG_INTERNALS
11403 const digit* digits = __Pyx_PyLong_Digits(x);
11404 const Py_ssize_t size = __Pyx_PyLong_DigitCount(x);
11405 if (size == 2 && (8 *
sizeof(
long) > 1 * PyLong_SHIFT)) {
11406 if ((8 *
sizeof(
unsigned long) > 2 * PyLong_SHIFT)) {
11407 __PYX_VERIFY_RETURN_INT(
long,
unsigned long, (((((
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
11408 }
else if ((8 *
sizeof(
long) >= 2 * PyLong_SHIFT)) {
11409 return (
long) (((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0]));
11412 if (size == 3 && (8 *
sizeof(
long) > 2 * PyLong_SHIFT)) {
11413 if ((8 *
sizeof(
unsigned long) > 3 * PyLong_SHIFT)) {
11414 __PYX_VERIFY_RETURN_INT(
long,
unsigned long, (((((((
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
11415 }
else if ((8 *
sizeof(
long) >= 3 * PyLong_SHIFT)) {
11416 return (
long) (((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]));
11419 if (size == 4 && (8 *
sizeof(
long) > 3 * PyLong_SHIFT)) {
11420 if ((8 *
sizeof(
unsigned long) > 4 * PyLong_SHIFT)) {
11421 __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])))
11422 }
else if ((8 *
sizeof(
long) >= 4 * PyLong_SHIFT)) {
11423 return (
long) (((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]));
11428#elif CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030C00A7
11429 if (unlikely(Py_SIZE(x) < 0)) {
11430 goto raise_neg_overflow;
11434 int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
11435 if (unlikely(result < 0))
11437 if (unlikely(result == 1))
11438 goto raise_neg_overflow;
11441 if ((
sizeof(
long) <=
sizeof(
unsigned long))) {
11442 __PYX_VERIFY_RETURN_INT_EXC(
long,
unsigned long, PyLong_AsUnsignedLong(x))
11443 }
else if ((
sizeof(
long) <=
sizeof(
unsigned PY_LONG_LONG))) {
11444 __PYX_VERIFY_RETURN_INT_EXC(
long,
unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
11446 return __Pyx_LargePyLong___Pyx_PyLong_As_long(x);
11448 return __Pyx_raise_neg_overflow___Pyx_PyLong_As_long();
11450 return __Pyx_raise_overflow___Pyx_PyLong_As_long();
11452static CYTHON_INLINE
long __Pyx_PySLong___Pyx_PyLong_As_long(PyObject *x) {
11453 const int is_unsigned = 0;
11454#if CYTHON_USE_PYLONG_INTERNALS
11455 if (__Pyx_PyLong_IsNeg(x)) {
11456 const Py_ssize_t size = __Pyx_PyLong_DigitCount(x);
11457 const digit* digits = __Pyx_PyLong_Digits(x);
11458 if (size == 2 && (8 *
sizeof(
long) > 1 * PyLong_SHIFT)) {
11459 if ((8 *
sizeof(
long) > 2 * PyLong_SHIFT)) {
11460 long ival = - (long) (((((
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0]));
11461 __PYX_VERIFY_RETURN_INT(
long,
long, ival)
11462 }
else if ((8 *
sizeof(
long) - 1 > 2 * PyLong_SHIFT)) {
11463 return (
long) (((long) -1) * (((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
11466 if (size == 3 && (8 *
sizeof(
long) > 2 * PyLong_SHIFT)) {
11467 if ((8 *
sizeof(
long) > 3 * PyLong_SHIFT)) {
11468 long ival = - (long) (((((((
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0]));
11469 __PYX_VERIFY_RETURN_INT(
long,
long, ival)
11470 }
else if ((8 *
sizeof(
long) - 1 > 3 * PyLong_SHIFT)) {
11471 return (
long) (((long) -1) * (((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
11474 if (size == 4 && (8 *
sizeof(
long) > 3 * PyLong_SHIFT)) {
11475 if ((8 *
sizeof(
long) > 4 * PyLong_SHIFT)) {
11476 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]));
11477 __PYX_VERIFY_RETURN_INT(
long,
long, ival)
11478 }
else if ((8 *
sizeof(
long) - 1 > 4 * PyLong_SHIFT)) {
11479 return (
long) (((long) -1) * (((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
11484 const Py_ssize_t size = __Pyx_PyLong_DigitCount(x);
11485 const digit* digits = __Pyx_PyLong_Digits(x);
11486 if (size == 2 && (8 *
sizeof(
long) > 1 * PyLong_SHIFT)) {
11487 if ((8 *
sizeof(
long) > 2 * PyLong_SHIFT)) {
11488 __PYX_VERIFY_RETURN_INT(
long,
unsigned long, (((((
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
11489 }
else if ((8 *
sizeof(
long) - 1 > 2 * PyLong_SHIFT)) {
11490 return (
long) (((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0]));
11493 if (size == 3 && (8 *
sizeof(
long) > 2 * PyLong_SHIFT)) {
11494 if ((8 *
sizeof(
long) > 3 * PyLong_SHIFT)) {
11495 __PYX_VERIFY_RETURN_INT(
long,
unsigned long, (((((((
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
11496 }
else if ((8 *
sizeof(
long) - 1 > 3 * PyLong_SHIFT)) {
11497 return (
long) (((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]));
11500 if (size == 4 && (8 *
sizeof(
long) > 3 * PyLong_SHIFT)) {
11501 if ((8 *
sizeof(
long) > 4 * PyLong_SHIFT)) {
11502 __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])))
11503 }
else if ((8 *
sizeof(
long) - 1 > 4 * PyLong_SHIFT)) {
11504 return (
long) (((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]));
11510 #if __PYX_LIMITED_VERSION_HEX >= 0x030d0000
11511 if ((
sizeof(
long) <=
sizeof(
int)) && (
sizeof(
int) <
sizeof(
long))) {
11512 __PYX_VERIFY_RETURN_INT_EXC(
long,
int, PyLong_AsInt(x))
11515 if ((
sizeof(
long) <=
sizeof(
long))) {
11516 __PYX_VERIFY_RETURN_INT_EXC(
long,
long, PyLong_AsLong(x))
11517 }
else if ((
sizeof(
long) <=
sizeof(PY_LONG_LONG))) {
11518 __PYX_VERIFY_RETURN_INT_EXC(
long, PY_LONG_LONG, PyLong_AsLongLong(x))
11520 return __Pyx_LargePyLong___Pyx_PyLong_As_long(x);
11522 return __Pyx_raise_neg_overflow___Pyx_PyLong_As_long();
11524 return __Pyx_raise_overflow___Pyx_PyLong_As_long();
11526static long __Pyx_LargePyLong___Pyx_PyLong_As_long(PyObject *x) {
11527#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
11528#pragma GCC diagnostic push
11529#pragma GCC diagnostic ignored "-Wconversion"
11531 const long neg_one = (long) -1, const_zero = (
long) 0;
11532#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
11533#pragma GCC diagnostic pop
11535 const int is_unsigned = neg_one > const_zero;
11538#if PY_VERSION_HEX >= 0x030d00A6 && !CYTHON_COMPILING_IN_LIMITED_API
11539 Py_ssize_t bytes_copied = PyLong_AsNativeBytes(
11540 x, &val,
sizeof(val), Py_ASNATIVEBYTES_NATIVE_ENDIAN | (is_unsigned ? Py_ASNATIVEBYTES_UNSIGNED_BUFFER | Py_ASNATIVEBYTES_REJECT_NEGATIVE : 0));
11541 if (unlikely(bytes_copied == -1)) {
11542 }
else if (unlikely(bytes_copied > (Py_ssize_t)
sizeof(val))) {
11543 goto raise_overflow;
11547#elif PY_VERSION_HEX < 0x030d0000 && !(CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API) || defined(_PyLong_AsByteArray)
11548 int one = 1;
int is_little = (int)*(
unsigned char *)&one;
11549 unsigned char *bytes = (
unsigned char *)&val;
11550 ret = _PyLong_AsByteArray((PyLongObject *)x,
11551 bytes,
sizeof(val),
11552 is_little, !is_unsigned);
11553 if ((0))
goto raise_overflow;
11556 PyObject *stepval = NULL, *mask = NULL, *shift = NULL;
11557 int bits, remaining_bits, is_negative = 0;
11558 int chunk_size = (
sizeof(long) < 8) ? 30 : 62;
11559 if (likely(PyLong_CheckExact(x))) {
11560 v = __Pyx_NewRef(x);
11562 v = PyNumber_Long(x);
11563 if (unlikely(!
v))
return (
long) -1;
11564 assert(PyLong_CheckExact(
v));
11567 int result = PyObject_RichCompareBool(
v, Py_False, Py_LT);
11568 if (unlikely(result < 0)) {
11572 is_negative = result == 1;
11574 if (is_unsigned && unlikely(is_negative)) {
11576 PyErr_SetString(PyExc_OverflowError,
11577 "can't convert negative value to long");
11579 }
else if (is_negative) {
11580 stepval = PyNumber_Invert(
v);
11582 if (unlikely(!stepval))
11589 mask = PyLong_FromLong((1L << chunk_size) - 1);
if (unlikely(!mask))
goto done;
11590 shift = PyLong_FromLong(chunk_size);
if (unlikely(!shift))
goto done;
11591 for (bits = 0; bits < (int)
sizeof(long) * 8 - chunk_size; bits += chunk_size) {
11592 PyObject *tmp, *digit;
11594 digit = PyNumber_And(stepval, mask);
11595 if (unlikely(!digit))
goto done;
11596 idigit = PyLong_AsLong(digit);
11598 if (unlikely(idigit < 0))
goto done;
11599 val |= ((long) idigit) << bits;
11600 tmp = PyNumber_Rshift(stepval, shift);
11601 if (unlikely(!tmp))
goto done;
11602 Py_DECREF(stepval); stepval = tmp;
11604 Py_DECREF(shift); shift = NULL;
11605 Py_DECREF(mask); mask = NULL;
11607 long idigit = PyLong_AsLong(stepval);
11608 if (unlikely(idigit < 0))
goto done;
11609 remaining_bits = ((int)
sizeof(long) * 8) - bits - (is_unsigned ? 0 : 1);
11610 if (unlikely(idigit >= (1L << remaining_bits)))
11611 goto raise_overflow;
11612 val |= ((long) idigit) << bits;
11614 if (!is_unsigned) {
11615 if (unlikely(val & (((
long) 1) << (
sizeof(
long) * 8 - 1))))
11616 goto raise_overflow;
11624 Py_XDECREF(stepval);
11630 return __Pyx_raise_overflow___Pyx_PyLong_As_long();
11632static CYTHON_INLINE
long __Pyx_PyLong___Pyx_PyLong_As_long(PyObject *x) {
11633#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
11634#pragma GCC diagnostic push
11635#pragma GCC diagnostic ignored "-Wconversion"
11637 const long neg_one = (long) -1, const_zero = (
long) 0;
11638#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
11639#pragma GCC diagnostic pop
11641 const int is_unsigned = neg_one > const_zero;
11643 #if CYTHON_USE_PYLONG_INTERNALS
11644 if (unlikely(__Pyx_PyLong_IsNeg(x))) {
11645 goto raise_neg_overflow;
11646 }
else if (__Pyx_PyLong_IsCompact(x)) {
11647 __PYX_VERIFY_RETURN_INT(
long, __Pyx_compact_upylong, __Pyx_PyLong_CompactValueUnsigned(x))
11651 return __Pyx_PyULong___Pyx_PyLong_As_long(x);
11654 #if CYTHON_USE_PYLONG_INTERNALS
11655 if (__Pyx_PyLong_IsCompact(x)) {
11656 __PYX_VERIFY_RETURN_INT(
long, __Pyx_compact_pylong, __Pyx_PyLong_CompactValue(x))
11660 return __Pyx_PySLong___Pyx_PyLong_As_long(x);
11663#if CYTHON_USE_PYLONG_INTERNALS
11665 return __Pyx_raise_neg_overflow___Pyx_PyLong_As_long();
11667 return __Pyx_raise_overflow___Pyx_PyLong_As_long();
11670static long __Pyx_NonPyLong___Pyx_PyLong_As_long(PyObject *x) {
11672 PyObject *tmp = __Pyx_PyNumber_Long(x);
11673 if (!tmp)
return (
long) -1;
11674 val = __Pyx_PyLong_As_long(tmp);
11678static CYTHON_INLINE
long __Pyx_PyLong_As_long(PyObject *x) {
11679 if (likely(PyLong_Check(x))) {
11680 return __Pyx_PyLong___Pyx_PyLong_As_long(x);
11682 return __Pyx_NonPyLong___Pyx_PyLong_As_long(x);
11687static int __Pyx_LargePyLong___Pyx_PyLong_As_int(PyObject *x);
11688static int __Pyx_raise_neg_overflow___Pyx_PyLong_As_int(
void) {
11689 const char* type_name =
"int";
11690 PyErr_Format(PyExc_OverflowError,
11691 "can't convert negative value to %.200s", type_name);
11694static int __Pyx_raise_overflow___Pyx_PyLong_As_int(
void) {
11695 const char* type_name =
"int";
11696 PyErr_Format(PyExc_OverflowError,
11697 "value too large to convert to %.200s", type_name);
11700static CYTHON_INLINE
int __Pyx_PyULong___Pyx_PyLong_As_int(PyObject *x) {
11701 const int is_unsigned = 1;
11702#if CYTHON_USE_PYLONG_INTERNALS
11704 const digit* digits = __Pyx_PyLong_Digits(x);
11705 const Py_ssize_t size = __Pyx_PyLong_DigitCount(x);
11706 if (size == 2 && (8 *
sizeof(
int) > 1 * PyLong_SHIFT)) {
11707 if ((8 *
sizeof(
unsigned long) > 2 * PyLong_SHIFT)) {
11708 __PYX_VERIFY_RETURN_INT(
int,
unsigned long, (((((
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
11709 }
else if ((8 *
sizeof(
int) >= 2 * PyLong_SHIFT)) {
11710 return (
int) (((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0]));
11713 if (size == 3 && (8 *
sizeof(
int) > 2 * PyLong_SHIFT)) {
11714 if ((8 *
sizeof(
unsigned long) > 3 * PyLong_SHIFT)) {
11715 __PYX_VERIFY_RETURN_INT(
int,
unsigned long, (((((((
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
11716 }
else if ((8 *
sizeof(
int) >= 3 * PyLong_SHIFT)) {
11717 return (
int) (((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]));
11720 if (size == 4 && (8 *
sizeof(
int) > 3 * PyLong_SHIFT)) {
11721 if ((8 *
sizeof(
unsigned long) > 4 * PyLong_SHIFT)) {
11722 __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])))
11723 }
else if ((8 *
sizeof(
int) >= 4 * PyLong_SHIFT)) {
11724 return (
int) (((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]));
11729#elif CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030C00A7
11730 if (unlikely(Py_SIZE(x) < 0)) {
11731 goto raise_neg_overflow;
11735 int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
11736 if (unlikely(result < 0))
11738 if (unlikely(result == 1))
11739 goto raise_neg_overflow;
11742 if ((
sizeof(
int) <=
sizeof(
unsigned long))) {
11743 __PYX_VERIFY_RETURN_INT_EXC(
int,
unsigned long, PyLong_AsUnsignedLong(x))
11744 }
else if ((
sizeof(
int) <=
sizeof(
unsigned PY_LONG_LONG))) {
11745 __PYX_VERIFY_RETURN_INT_EXC(
int,
unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
11747 return __Pyx_LargePyLong___Pyx_PyLong_As_int(x);
11749 return __Pyx_raise_neg_overflow___Pyx_PyLong_As_int();
11751 return __Pyx_raise_overflow___Pyx_PyLong_As_int();
11753static CYTHON_INLINE
int __Pyx_PySLong___Pyx_PyLong_As_int(PyObject *x) {
11754 const int is_unsigned = 0;
11755#if CYTHON_USE_PYLONG_INTERNALS
11756 if (__Pyx_PyLong_IsNeg(x)) {
11757 const Py_ssize_t size = __Pyx_PyLong_DigitCount(x);
11758 const digit* digits = __Pyx_PyLong_Digits(x);
11759 if (size == 2 && (8 *
sizeof(
int) > 1 * PyLong_SHIFT)) {
11760 if ((8 *
sizeof(
long) > 2 * PyLong_SHIFT)) {
11761 long ival = - (long) (((((
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0]));
11762 __PYX_VERIFY_RETURN_INT(
int,
long, ival)
11763 }
else if ((8 *
sizeof(
int) - 1 > 2 * PyLong_SHIFT)) {
11764 return (
int) (((int) -1) * (((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
11767 if (size == 3 && (8 *
sizeof(
int) > 2 * PyLong_SHIFT)) {
11768 if ((8 *
sizeof(
long) > 3 * PyLong_SHIFT)) {
11769 long ival = - (long) (((((((
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0]));
11770 __PYX_VERIFY_RETURN_INT(
int,
long, ival)
11771 }
else if ((8 *
sizeof(
int) - 1 > 3 * PyLong_SHIFT)) {
11772 return (
int) (((int) -1) * (((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
11775 if (size == 4 && (8 *
sizeof(
int) > 3 * PyLong_SHIFT)) {
11776 if ((8 *
sizeof(
long) > 4 * PyLong_SHIFT)) {
11777 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]));
11778 __PYX_VERIFY_RETURN_INT(
int,
long, ival)
11779 }
else if ((8 *
sizeof(
int) - 1 > 4 * PyLong_SHIFT)) {
11780 return (
int) (((int) -1) * (((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
11785 const Py_ssize_t size = __Pyx_PyLong_DigitCount(x);
11786 const digit* digits = __Pyx_PyLong_Digits(x);
11787 if (size == 2 && (8 *
sizeof(
int) > 1 * PyLong_SHIFT)) {
11788 if ((8 *
sizeof(
long) > 2 * PyLong_SHIFT)) {
11789 __PYX_VERIFY_RETURN_INT(
int,
unsigned long, (((((
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
11790 }
else if ((8 *
sizeof(
int) - 1 > 2 * PyLong_SHIFT)) {
11791 return (
int) (((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0]));
11794 if (size == 3 && (8 *
sizeof(
int) > 2 * PyLong_SHIFT)) {
11795 if ((8 *
sizeof(
long) > 3 * PyLong_SHIFT)) {
11796 __PYX_VERIFY_RETURN_INT(
int,
unsigned long, (((((((
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
11797 }
else if ((8 *
sizeof(
int) - 1 > 3 * PyLong_SHIFT)) {
11798 return (
int) (((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]));
11801 if (size == 4 && (8 *
sizeof(
int) > 3 * PyLong_SHIFT)) {
11802 if ((8 *
sizeof(
long) > 4 * PyLong_SHIFT)) {
11803 __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])))
11804 }
else if ((8 *
sizeof(
int) - 1 > 4 * PyLong_SHIFT)) {
11805 return (
int) (((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]));
11811 #if __PYX_LIMITED_VERSION_HEX >= 0x030d0000
11812 if ((
sizeof(
int) <=
sizeof(
int)) && (
sizeof(
int) <
sizeof(
long))) {
11813 __PYX_VERIFY_RETURN_INT_EXC(
int,
int, PyLong_AsInt(x))
11816 if ((
sizeof(
int) <=
sizeof(
long))) {
11817 __PYX_VERIFY_RETURN_INT_EXC(
int,
long, PyLong_AsLong(x))
11818 }
else if ((
sizeof(
int) <=
sizeof(PY_LONG_LONG))) {
11819 __PYX_VERIFY_RETURN_INT_EXC(
int, PY_LONG_LONG, PyLong_AsLongLong(x))
11821 return __Pyx_LargePyLong___Pyx_PyLong_As_int(x);
11823 return __Pyx_raise_neg_overflow___Pyx_PyLong_As_int();
11825 return __Pyx_raise_overflow___Pyx_PyLong_As_int();
11827static int __Pyx_LargePyLong___Pyx_PyLong_As_int(PyObject *x) {
11828#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
11829#pragma GCC diagnostic push
11830#pragma GCC diagnostic ignored "-Wconversion"
11832 const int neg_one = (int) -1, const_zero = (
int) 0;
11833#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
11834#pragma GCC diagnostic pop
11836 const int is_unsigned = neg_one > const_zero;
11839#if PY_VERSION_HEX >= 0x030d00A6 && !CYTHON_COMPILING_IN_LIMITED_API
11840 Py_ssize_t bytes_copied = PyLong_AsNativeBytes(
11841 x, &val,
sizeof(val), Py_ASNATIVEBYTES_NATIVE_ENDIAN | (is_unsigned ? Py_ASNATIVEBYTES_UNSIGNED_BUFFER | Py_ASNATIVEBYTES_REJECT_NEGATIVE : 0));
11842 if (unlikely(bytes_copied == -1)) {
11843 }
else if (unlikely(bytes_copied > (Py_ssize_t)
sizeof(val))) {
11844 goto raise_overflow;
11848#elif PY_VERSION_HEX < 0x030d0000 && !(CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API) || defined(_PyLong_AsByteArray)
11849 int one = 1;
int is_little = (int)*(
unsigned char *)&one;
11850 unsigned char *bytes = (
unsigned char *)&val;
11851 ret = _PyLong_AsByteArray((PyLongObject *)x,
11852 bytes,
sizeof(val),
11853 is_little, !is_unsigned);
11854 if ((0))
goto raise_overflow;
11857 PyObject *stepval = NULL, *mask = NULL, *shift = NULL;
11858 int bits, remaining_bits, is_negative = 0;
11859 int chunk_size = (
sizeof(long) < 8) ? 30 : 62;
11860 if (likely(PyLong_CheckExact(x))) {
11861 v = __Pyx_NewRef(x);
11863 v = PyNumber_Long(x);
11864 if (unlikely(!
v))
return (
int) -1;
11865 assert(PyLong_CheckExact(
v));
11868 int result = PyObject_RichCompareBool(
v, Py_False, Py_LT);
11869 if (unlikely(result < 0)) {
11873 is_negative = result == 1;
11875 if (is_unsigned && unlikely(is_negative)) {
11877 PyErr_SetString(PyExc_OverflowError,
11878 "can't convert negative value to int");
11880 }
else if (is_negative) {
11881 stepval = PyNumber_Invert(
v);
11883 if (unlikely(!stepval))
11890 mask = PyLong_FromLong((1L << chunk_size) - 1);
if (unlikely(!mask))
goto done;
11891 shift = PyLong_FromLong(chunk_size);
if (unlikely(!shift))
goto done;
11892 for (bits = 0; bits < (int)
sizeof(int) * 8 - chunk_size; bits += chunk_size) {
11893 PyObject *tmp, *digit;
11895 digit = PyNumber_And(stepval, mask);
11896 if (unlikely(!digit))
goto done;
11897 idigit = PyLong_AsLong(digit);
11899 if (unlikely(idigit < 0))
goto done;
11900 val |= ((int) idigit) << bits;
11901 tmp = PyNumber_Rshift(stepval, shift);
11902 if (unlikely(!tmp))
goto done;
11903 Py_DECREF(stepval); stepval = tmp;
11905 Py_DECREF(shift); shift = NULL;
11906 Py_DECREF(mask); mask = NULL;
11908 long idigit = PyLong_AsLong(stepval);
11909 if (unlikely(idigit < 0))
goto done;
11910 remaining_bits = ((int)
sizeof(int) * 8) - bits - (is_unsigned ? 0 : 1);
11911 if (unlikely(idigit >= (1L << remaining_bits)))
11912 goto raise_overflow;
11913 val |= ((int) idigit) << bits;
11915 if (!is_unsigned) {
11916 if (unlikely(val & (((
int) 1) << (
sizeof(
int) * 8 - 1))))
11917 goto raise_overflow;
11925 Py_XDECREF(stepval);
11931 return __Pyx_raise_overflow___Pyx_PyLong_As_int();
11933static CYTHON_INLINE
int __Pyx_PyLong___Pyx_PyLong_As_int(PyObject *x) {
11934#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
11935#pragma GCC diagnostic push
11936#pragma GCC diagnostic ignored "-Wconversion"
11938 const int neg_one = (int) -1, const_zero = (
int) 0;
11939#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
11940#pragma GCC diagnostic pop
11942 const int is_unsigned = neg_one > const_zero;
11944 #if CYTHON_USE_PYLONG_INTERNALS
11945 if (unlikely(__Pyx_PyLong_IsNeg(x))) {
11946 goto raise_neg_overflow;
11947 }
else if (__Pyx_PyLong_IsCompact(x)) {
11948 __PYX_VERIFY_RETURN_INT(
int, __Pyx_compact_upylong, __Pyx_PyLong_CompactValueUnsigned(x))
11952 return __Pyx_PyULong___Pyx_PyLong_As_int(x);
11955 #if CYTHON_USE_PYLONG_INTERNALS
11956 if (__Pyx_PyLong_IsCompact(x)) {
11957 __PYX_VERIFY_RETURN_INT(
int, __Pyx_compact_pylong, __Pyx_PyLong_CompactValue(x))
11961 return __Pyx_PySLong___Pyx_PyLong_As_int(x);
11964#if CYTHON_USE_PYLONG_INTERNALS
11966 return __Pyx_raise_neg_overflow___Pyx_PyLong_As_int();
11968 return __Pyx_raise_overflow___Pyx_PyLong_As_int();
11971static int __Pyx_NonPyLong___Pyx_PyLong_As_int(PyObject *x) {
11973 PyObject *tmp = __Pyx_PyNumber_Long(x);
11974 if (!tmp)
return (
int) -1;
11975 val = __Pyx_PyLong_As_int(tmp);
11979static CYTHON_INLINE
int __Pyx_PyLong_As_int(PyObject *x) {
11980 if (likely(PyLong_Check(x))) {
11981 return __Pyx_PyLong___Pyx_PyLong_As_int(x);
11983 return __Pyx_NonPyLong___Pyx_PyLong_As_int(x);
11988#if __PYX_LIMITED_VERSION_HEX < 0x030b0000
11989void __Pyx_init_runtime_version(
void) {
11990 if (__Pyx_cached_runtime_version == 0) {
11991 const char* rt_version = Py_GetVersion();
11992 unsigned long version = 0;
11993 unsigned long factor = 0x01000000UL;
11994 unsigned int digit = 0;
11997 while (
'0' <= rt_version[i] && rt_version[i] <=
'9') {
11998 digit = digit * 10 + (
unsigned int) (rt_version[i] -
'0');
12001 version += factor * digit;
12002 if (rt_version[i] !=
'.')
12008 __Pyx_cached_runtime_version = version;
12012static unsigned long __Pyx_get_runtime_version(
void) {
12013#if __PYX_LIMITED_VERSION_HEX >= 0x030b0000
12014 return Py_Version & ~0xFFUL;
12016 return __Pyx_cached_runtime_version;
12021static int __Pyx_check_binary_version(
unsigned long ct_version,
unsigned long rt_version,
int allow_newer) {
12022 const unsigned long MAJOR_MINOR = 0xFFFF0000UL;
12023 if ((rt_version & MAJOR_MINOR) == (ct_version & MAJOR_MINOR))
12025 if (likely(allow_newer && (rt_version & MAJOR_MINOR) > (ct_version & MAJOR_MINOR)))
12029 PyOS_snprintf(message,
sizeof(message),
12030 "compile time Python version %d.%d "
12031 "of module '%.100s' "
12033 "runtime version %d.%d",
12034 (
int) (ct_version >> 24), (
int) ((ct_version >> 16) & 0xFF),
12036 (allow_newer) ?
"was newer than" :
"does not match",
12037 (
int) (rt_version >> 24), (
int) ((rt_version >> 16) & 0xFF)
12039 return PyErr_WarnEx(NULL, message, 1);
12044#if CYTHON_COMPILING_IN_LIMITED_API
12045 static PyObject* __Pyx__PyCode_New(
int a,
int p,
int k,
int l,
int s,
int f,
12046 PyObject *code, PyObject *
c, PyObject*
n, PyObject *
v,
12047 PyObject *fv, PyObject *cell, PyObject* fn,
12048 PyObject *name,
int fline, PyObject *lnos) {
12049 PyObject *exception_table = NULL;
12050 PyObject *types_module=NULL, *code_type=NULL, *result=NULL;
12051 #if __PYX_LIMITED_VERSION_HEX < 0x030b0000
12052 PyObject *version_info;
12053 PyObject *py_minor_version = NULL;
12055 long minor_version = 0;
12056 #if __PYX_LIMITED_VERSION_HEX >= 0x030b0000
12057 minor_version = 11;
12059 if (!(version_info = PySys_GetObject(
"version_info")))
goto end;
12060 if (!(py_minor_version = PySequence_GetItem(version_info, 1)))
goto end;
12061 minor_version = PyLong_AsLong(py_minor_version);
12062 Py_DECREF(py_minor_version);
12063 if (minor_version == -1 && PyErr_Occurred())
goto end;
12065 if (!(types_module = PyImport_ImportModule(
"types")))
goto end;
12066 if (!(code_type = PyObject_GetAttrString(types_module,
"CodeType")))
goto end;
12067 if (minor_version <= 10) {
12068 result = PyObject_CallFunction(code_type,
"iiiiiiOOOOOOiOOO", a,p, k, l,
s,
f, code,
12069 c,
n,
v, fn, name, fline, lnos, fv, cell);
12071 if (!(exception_table = PyBytes_FromStringAndSize(NULL, 0)))
goto end;
12072 result = PyObject_CallFunction(code_type,
"iiiiiiOOOOOOOiOOOO", a,p, k, l,
s,
f, code,
12073 c,
n,
v, fn, name, name, fline, lnos, exception_table, fv, cell);
12076 Py_XDECREF(code_type);
12077 Py_XDECREF(exception_table);
12078 Py_XDECREF(types_module);
12080 PyObject *exc_type, *exc_value, *exc_tb;
12081 PyErr_Fetch(&exc_type, &exc_value, &exc_tb);
12082 if (PyErr_WarnFormat(
12083 PyExc_RuntimeWarning, 1,
12084 "Code object creation failed in Cython module: %S\nTry recompiling with a more recent version of Cython.",
12085 exc_value ? exc_value : exc_type) == 0) {
12089 Py_DECREF(exc_type);
12090 Py_XDECREF(exc_value);
12091 Py_XDECREF(exc_tb);
12095#elif PY_VERSION_HEX >= 0x030B0000
12096 static PyCodeObject* __Pyx__PyCode_New(
int a,
int p,
int k,
int l,
int s,
int f,
12097 PyObject *code, PyObject *
c, PyObject*
n, PyObject *
v,
12098 PyObject *fv, PyObject *cell, PyObject* fn,
12099 PyObject *name,
int fline, PyObject *lnos) {
12100 PyCodeObject *result;
12102 #if PY_VERSION_HEX >= 0x030C0000
12103 PyUnstable_Code_NewWithPosOnlyArgs
12105 PyCode_NewWithPosOnlyArgs
12107 (a, p, k, l,
s,
f, code,
c,
n,
v, fv, cell, fn, name, name, fline, lnos, __pyx_mstate_global->__pyx_empty_bytes);
12108 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030c00A1
12109 if (likely(result))
12110 result->_co_firsttraceable = 0;
12114#elif !CYTHON_COMPILING_IN_PYPY
12115 #define __Pyx__PyCode_New(a, p, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\
12116 PyCode_NewWithPosOnlyArgs(a, p, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)
12118 #define __Pyx__PyCode_New(a, p, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\
12119 PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)
12121static PyObject* __Pyx_PyCode_New(
12122 const __Pyx_PyCode_New_function_description descr,
12123 PyObject *
const *varnames,
12124 PyObject *filename,
12125 PyObject *funcname,
12126 PyObject *line_table,
12127 PyObject *tuple_dedup_map
12129 PyObject *code_obj = NULL, *varnames_tuple_dedup = NULL, *code_bytes = NULL;
12130 Py_ssize_t var_count = (Py_ssize_t) descr.nlocals;
12131 PyObject *varnames_tuple = PyTuple_New(var_count);
12132 if (unlikely(!varnames_tuple))
return NULL;
12133 for (Py_ssize_t i=0; i < var_count; i++) {
12134 Py_INCREF(varnames[i]);
12135 if (__Pyx_PyTuple_SET_ITEM(varnames_tuple, i, varnames[i]) != (0))
goto done;
12137 #if CYTHON_COMPILING_IN_LIMITED_API
12138 varnames_tuple_dedup = PyDict_GetItem(tuple_dedup_map, varnames_tuple);
12139 if (!varnames_tuple_dedup) {
12140 if (unlikely(PyDict_SetItem(tuple_dedup_map, varnames_tuple, varnames_tuple) < 0))
goto done;
12141 varnames_tuple_dedup = varnames_tuple;
12144 varnames_tuple_dedup = PyDict_SetDefault(tuple_dedup_map, varnames_tuple, varnames_tuple);
12145 if (unlikely(!varnames_tuple_dedup))
goto done;
12147 #if CYTHON_AVOID_BORROWED_REFS
12148 Py_INCREF(varnames_tuple_dedup);
12150 if (__PYX_LIMITED_VERSION_HEX >= (0x030b0000) && line_table != NULL && !CYTHON_COMPILING_IN_GRAAL) {
12151 Py_ssize_t line_table_length = __Pyx_PyBytes_GET_SIZE(line_table);
12152 #if !CYTHON_ASSUME_SAFE_SIZE
12153 if (unlikely(line_table_length == -1))
goto done;
12155 Py_ssize_t code_len = (line_table_length * 2 + 4) & ~3LL;
12156 code_bytes = PyBytes_FromStringAndSize(NULL, code_len);
12157 if (unlikely(!code_bytes))
goto done;
12158 char* c_code_bytes = PyBytes_AsString(code_bytes);
12159 if (unlikely(!c_code_bytes))
goto done;
12160 memset(c_code_bytes, 0, (
size_t) code_len);
12162 code_obj = (PyObject*) __Pyx__PyCode_New(
12163 (
int) descr.argcount,
12164 (
int) descr.num_posonly_args,
12165 (
int) descr.num_kwonly_args,
12166 (
int) descr.nlocals,
12169 code_bytes ? code_bytes : __pyx_mstate_global->__pyx_empty_bytes,
12170 __pyx_mstate_global->__pyx_empty_tuple,
12171 __pyx_mstate_global->__pyx_empty_tuple,
12172 varnames_tuple_dedup,
12173 __pyx_mstate_global->__pyx_empty_tuple,
12174 __pyx_mstate_global->__pyx_empty_tuple,
12177 (
int) descr.first_line,
12178 (__PYX_LIMITED_VERSION_HEX >= (0x030b0000) && line_table) ? line_table : __pyx_mstate_global->__pyx_empty_bytes
12181 Py_XDECREF(code_bytes);
12182 #if CYTHON_AVOID_BORROWED_REFS
12183 Py_XDECREF(varnames_tuple_dedup);
12185 Py_DECREF(varnames_tuple);
12191static CYTHON_SMALL_CODE PyObject *__Pyx_DecompressString(
const char *
s, Py_ssize_t length,
int algo) {
12192#ifdef __Pyx_DecompressString_UNUSED
12193 CYTHON_UNUSED_VAR(
s);
12194 CYTHON_UNUSED_VAR(length);
12195 CYTHON_UNUSED_VAR(algo);
12198 PyObject *module = NULL, *decompress, *compressed_bytes, *decompressed;
12199 const char* module_name = algo == 3 ?
"compression.zstd" : algo == 2 ?
"bz2" :
"zlib";
12200 PyObject *methodname = PyUnicode_FromString(
"decompress");
12201 if (unlikely(!methodname))
return NULL;
12202 #if __PYX_LIMITED_VERSION_HEX >= 0x030e0000
12204 PyObject *fromlist = Py_BuildValue(
"[O]", methodname);
12205 if (unlikely(!fromlist))
goto bad;
12206 module = PyImport_ImportModuleLevel("compression.zstd", NULL, NULL, fromlist, 0);
12207 Py_DECREF(fromlist);
12210 module = PyImport_ImportModule(module_name);
12211 if (unlikely(!module))
goto import_failed;
12212 decompress = PyObject_GetAttr(module, methodname);
12213 if (unlikely(!decompress))
goto import_failed;
12216 char *memview_bytes =
const_cast<char*
>(
s);
12218 #if defined(__clang__)
12219 #pragma clang diagnostic push
12220 #pragma clang diagnostic ignored "-Wcast-qual"
12221 #elif !defined(__INTEL_COMPILER) && defined(__GNUC__)
12222 #pragma GCC diagnostic push
12223 #pragma GCC diagnostic ignored "-Wcast-qual"
12225 char *memview_bytes = (
char*)
s;
12226 #if defined(__clang__)
12227 #pragma clang diagnostic pop
12228 #elif !defined(__INTEL_COMPILER) && defined(__GNUC__)
12229 #pragma GCC diagnostic pop
12232 #if CYTHON_COMPILING_IN_LIMITED_API && !defined(PyBUF_READ)
12233 int memview_flags = 0x100;
12235 int memview_flags = PyBUF_READ;
12237 compressed_bytes = PyMemoryView_FromMemory(memview_bytes, length, memview_flags);
12239 if (unlikely(!compressed_bytes)) {
12240 Py_DECREF(decompress);
12243 decompressed = PyObject_CallFunctionObjArgs(decompress, compressed_bytes, NULL);
12244 Py_DECREF(compressed_bytes);
12245 Py_DECREF(decompress);
12247 Py_DECREF(methodname);
12248 return decompressed;
12250 PyErr_Format(PyExc_ImportError,
12251 "Failed to import '%.20s.decompress' - cannot initialise module strings. "
12252 "String compression was configured with the C macro 'CYTHON_COMPRESS_STRINGS=%d'.",
12253 module_name, algo);
12255 Py_XDECREF(module);
12256 Py_DECREF(methodname);
12262static CYTHON_INLINE Py_ssize_t __Pyx_ssize_strlen(
const char *
s) {
12263 size_t len = strlen(
s);
12264 if (unlikely(len > (
size_t) PY_SSIZE_T_MAX)) {
12265 PyErr_SetString(PyExc_OverflowError,
"byte string is too long");
12268 return (Py_ssize_t) len;
12270static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(
const char* c_str) {
12271 Py_ssize_t len = __Pyx_ssize_strlen(c_str);
12272 if (unlikely(len < 0))
return NULL;
12273 return __Pyx_PyUnicode_FromStringAndSize(c_str, len);
12275static CYTHON_INLINE PyObject* __Pyx_PyByteArray_FromString(
const char* c_str) {
12276 Py_ssize_t len = __Pyx_ssize_strlen(c_str);
12277 if (unlikely(len < 0))
return NULL;
12278 return PyByteArray_FromStringAndSize(c_str, len);
12280static CYTHON_INLINE
const char* __Pyx_PyObject_AsString(PyObject* o) {
12282 return __Pyx_PyObject_AsStringAndSize(o, &ignore);
12284#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_UTF8
12285static CYTHON_INLINE
const char* __Pyx_PyUnicode_AsStringAndSize(PyObject* o, Py_ssize_t *length) {
12286 if (unlikely(__Pyx_PyUnicode_READY(o) == -1))
return NULL;
12287#if CYTHON_COMPILING_IN_LIMITED_API
12289 const char* result;
12290 Py_ssize_t unicode_length;
12291 CYTHON_MAYBE_UNUSED_VAR(unicode_length);
12292 #if __PYX_LIMITED_VERSION_HEX < 0x030A0000
12293 if (unlikely(PyArg_Parse(o,
"s#", &result, length) < 0))
return NULL;
12295 result = PyUnicode_AsUTF8AndSize(o, length);
12297 #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
12298 unicode_length = PyUnicode_GetLength(o);
12299 if (unlikely(unicode_length < 0))
return NULL;
12300 if (unlikely(unicode_length != *length)) {
12301 PyUnicode_AsASCIIString(o);
12308#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
12309 if (likely(PyUnicode_IS_ASCII(o))) {
12310 *length = PyUnicode_GET_LENGTH(o);
12311 return PyUnicode_AsUTF8(o);
12313 PyUnicode_AsASCIIString(o);
12317 return PyUnicode_AsUTF8AndSize(o, length);
12322static CYTHON_INLINE
const char* __Pyx_PyObject_AsStringAndSize(PyObject* o, Py_ssize_t *length) {
12323#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_UTF8
12324 if (PyUnicode_Check(o)) {
12325 return __Pyx_PyUnicode_AsStringAndSize(o, length);
12328 if (PyByteArray_Check(o)) {
12329#if (CYTHON_ASSUME_SAFE_SIZE && CYTHON_ASSUME_SAFE_MACROS) || (CYTHON_COMPILING_IN_PYPY && (defined(PyByteArray_AS_STRING) && defined(PyByteArray_GET_SIZE)))
12330 *length = PyByteArray_GET_SIZE(o);
12331 return PyByteArray_AS_STRING(o);
12333 *length = PyByteArray_Size(o);
12334 if (*length == -1)
return NULL;
12335 return PyByteArray_AsString(o);
12340 int r = PyBytes_AsStringAndSize(o, &result, length);
12341 if (unlikely(
r < 0)) {
12348static CYTHON_INLINE
int __Pyx_PyObject_IsTrue(PyObject* x) {
12349 int is_true = x == Py_True;
12350 if (is_true | (x == Py_False) | (x == Py_None))
return is_true;
12351 else return PyObject_IsTrue(x);
12353static CYTHON_INLINE
int __Pyx_PyObject_IsTrueAndDecref(PyObject* x) {
12355 if (unlikely(!x))
return -1;
12356 retval = __Pyx_PyObject_IsTrue(x);
12360static PyObject* __Pyx_PyNumber_LongWrongResultType(PyObject* result) {
12361 __Pyx_TypeName result_type_name = __Pyx_PyType_GetFullyQualifiedName(Py_TYPE(result));
12362 #if CYTHON_COMPILING_IN_LIMITED_API && __PYX_LIMITED_VERSION_HEX < 0x030d0000
12363 if (unlikely(!result_type_name))
goto bad;
12365 if (PyLong_Check(result)) {
12366 if (PyErr_WarnFormat(PyExc_DeprecationWarning, 1,
12367 "__int__ returned non-int (type " __Pyx_FMT_TYPENAME
"). "
12368 "The ability to return an instance of a strict subclass of int is deprecated, "
12369 "and may be removed in a future version of Python.",
12370 result_type_name)) {
12371 __Pyx_DECREF_TypeName(result_type_name);
12374 __Pyx_DECREF_TypeName(result_type_name);
12377 PyErr_Format(PyExc_TypeError,
12378 "__int__ returned non-int (type " __Pyx_FMT_TYPENAME
")",
12380 __Pyx_DECREF_TypeName(result_type_name);
12385static CYTHON_INLINE PyObject* __Pyx_PyNumber_Long(PyObject* x) {
12386#if CYTHON_USE_TYPE_SLOTS
12387 PyNumberMethods *m;
12389 PyObject *res = NULL;
12390 if (likely(PyLong_Check(x)))
12391 return __Pyx_NewRef(x);
12392#if CYTHON_USE_TYPE_SLOTS
12393 m = Py_TYPE(x)->tp_as_number;
12394 if (likely(m && m->nb_int)) {
12395 res = m->nb_int(x);
12398 if (!PyBytes_CheckExact(x) && !PyUnicode_CheckExact(x)) {
12399 res = PyNumber_Long(x);
12403 if (unlikely(!PyLong_CheckExact(res))) {
12404 return __Pyx_PyNumber_LongWrongResultType(res);
12407 else if (!PyErr_Occurred()) {
12408 PyErr_SetString(PyExc_TypeError,
12409 "an integer is required");
12413static CYTHON_INLINE Py_ssize_t __Pyx_PyLong_AsSsize_t(PyObject* b) {
12414 #if CYTHON_USE_PYLONG_INTERNALS
12416 const Py_ssize_t size = __Pyx_PyLong_DigitCount(b);
12417 const int is_neg = __Pyx_PyLong_IsNeg(b);
12418 const digit* digits = __Pyx_PyLong_Digits(b);
12419 if (size == 0)
return 0;
12420 #if SIZEOF_SIZE_T * 8 > 1 * PyLong_SHIFT
12422 ival = (Py_ssize_t) (((
size_t)digits[0]));
12425 #if SIZEOF_SIZE_T * 8 > 2 * PyLong_SHIFT
12427 ival = (Py_ssize_t) (((((
size_t)digits[1]) << PyLong_SHIFT) | (
size_t)digits[0]));
12430 #if SIZEOF_SIZE_T * 8 > 3 * PyLong_SHIFT
12432 ival = (Py_ssize_t) (((((((
size_t)digits[2]) << PyLong_SHIFT) | (
size_t)digits[1]) << PyLong_SHIFT) | (
size_t)digits[0]));
12435 #if SIZEOF_SIZE_T * 8 > 4 * PyLong_SHIFT
12437 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]));
12440 return PyLong_AsSsize_t(b);
12441 return is_neg ? -ival : ival;
12443 return PyLong_AsSsize_t(b);
12446static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject* b) {
12447 if (likely(PyLong_Check(b))) {
12448 return __Pyx_PyLong_AsSsize_t(b);
12451 PyObject *x = PyNumber_Index(b);
12452 if (unlikely(!x))
return -1;
12453 ival = __Pyx_PyLong_AsSsize_t(x);
12458static CYTHON_INLINE Py_hash_t __Pyx_PyIndex_AsHash_t(PyObject* o) {
12459 if (
sizeof(Py_hash_t) ==
sizeof(Py_ssize_t)) {
12460 return (Py_hash_t) __Pyx_PyIndex_AsSsize_t(o);
12464 x = PyNumber_Index(o);
12466 ival = PyLong_AsLong(x);
12471static CYTHON_INLINE PyObject *__Pyx_Owned_Py_None(
int b) {
12472 CYTHON_UNUSED_VAR(b);
12473 return __Pyx_NewRef(Py_None);
12475static CYTHON_INLINE PyObject * __Pyx_PyBool_FromLong(
long b) {
12476 return __Pyx_NewRef(b ? Py_True: Py_False);
12478static CYTHON_INLINE PyObject * __Pyx_PyLong_FromSize_t(
size_t ival) {
12479 return PyLong_FromSize_t(ival);
12484#if CYTHON_PEP489_MULTI_PHASE_INIT && CYTHON_USE_MODULE_STATE
12485#ifndef CYTHON_MODULE_STATE_LOOKUP_THREAD_SAFE
12486#if (CYTHON_COMPILING_IN_LIMITED_API || PY_VERSION_HEX >= 0x030C0000)
12487 #define CYTHON_MODULE_STATE_LOOKUP_THREAD_SAFE 1
12489 #define CYTHON_MODULE_STATE_LOOKUP_THREAD_SAFE 0
12492#if CYTHON_MODULE_STATE_LOOKUP_THREAD_SAFE && !CYTHON_ATOMICS
12493#error "Module state with PEP489 requires atomics. Currently that's one of\
12494 C11, C++11, gcc atomic intrinsics or MSVC atomic intrinsics"
12496#if !CYTHON_MODULE_STATE_LOOKUP_THREAD_SAFE
12497#define __Pyx_ModuleStateLookup_Lock()
12498#define __Pyx_ModuleStateLookup_Unlock()
12499#elif !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX >= 0x030d0000
12500static PyMutex __Pyx_ModuleStateLookup_mutex = {0};
12501#define __Pyx_ModuleStateLookup_Lock() PyMutex_Lock(&__Pyx_ModuleStateLookup_mutex)
12502#define __Pyx_ModuleStateLookup_Unlock() PyMutex_Unlock(&__Pyx_ModuleStateLookup_mutex)
12503#elif defined(__cplusplus) && __cplusplus >= 201103L
12505static std::mutex __Pyx_ModuleStateLookup_mutex;
12506#define __Pyx_ModuleStateLookup_Lock() __Pyx_ModuleStateLookup_mutex.lock()
12507#define __Pyx_ModuleStateLookup_Unlock() __Pyx_ModuleStateLookup_mutex.unlock()
12508#elif defined(__STDC_VERSION__) && (__STDC_VERSION__ > 201112L) && !defined(__STDC_NO_THREADS__)
12509#include <threads.h>
12510static mtx_t __Pyx_ModuleStateLookup_mutex;
12511static once_flag __Pyx_ModuleStateLookup_mutex_once_flag = ONCE_FLAG_INIT;
12512static void __Pyx_ModuleStateLookup_initialize_mutex(
void) {
12513 mtx_init(&__Pyx_ModuleStateLookup_mutex, mtx_plain);
12515#define __Pyx_ModuleStateLookup_Lock()\
12516 call_once(&__Pyx_ModuleStateLookup_mutex_once_flag, __Pyx_ModuleStateLookup_initialize_mutex);\
12517 mtx_lock(&__Pyx_ModuleStateLookup_mutex)
12518#define __Pyx_ModuleStateLookup_Unlock() mtx_unlock(&__Pyx_ModuleStateLookup_mutex)
12519#elif defined(HAVE_PTHREAD_H)
12520#include <pthread.h>
12521static pthread_mutex_t __Pyx_ModuleStateLookup_mutex = PTHREAD_MUTEX_INITIALIZER;
12522#define __Pyx_ModuleStateLookup_Lock() pthread_mutex_lock(&__Pyx_ModuleStateLookup_mutex)
12523#define __Pyx_ModuleStateLookup_Unlock() pthread_mutex_unlock(&__Pyx_ModuleStateLookup_mutex)
12524#elif defined(_WIN32)
12525#include <Windows.h>
12526static SRWLOCK __Pyx_ModuleStateLookup_mutex = SRWLOCK_INIT;
12527#define __Pyx_ModuleStateLookup_Lock() AcquireSRWLockExclusive(&__Pyx_ModuleStateLookup_mutex)
12528#define __Pyx_ModuleStateLookup_Unlock() ReleaseSRWLockExclusive(&__Pyx_ModuleStateLookup_mutex)
12530#error "No suitable lock available for CYTHON_MODULE_STATE_LOOKUP_THREAD_SAFE.\
12531 Requires C standard >= C11, or C++ standard >= C++11,\
12532 or pthreads, or the Windows 32 API, or Python >= 3.13."
12537} __Pyx_InterpreterIdAndModule;
12539 char interpreter_id_as_index;
12541 Py_ssize_t allocated;
12542 __Pyx_InterpreterIdAndModule table[1];
12543} __Pyx_ModuleStateLookupData;
12544#define __PYX_MODULE_STATE_LOOKUP_SMALL_SIZE 32
12545#if CYTHON_MODULE_STATE_LOOKUP_THREAD_SAFE
12546static __pyx_atomic_int_type __Pyx_ModuleStateLookup_read_counter = 0;
12548#if CYTHON_MODULE_STATE_LOOKUP_THREAD_SAFE
12549static __pyx_atomic_ptr_type __Pyx_ModuleStateLookup_data = 0;
12551static __Pyx_ModuleStateLookupData* __Pyx_ModuleStateLookup_data = NULL;
12553static __Pyx_InterpreterIdAndModule* __Pyx_State_FindModuleStateLookupTableLowerBound(
12554 __Pyx_InterpreterIdAndModule* table,
12556 int64_t interpreterId) {
12557 __Pyx_InterpreterIdAndModule* begin = table;
12558 __Pyx_InterpreterIdAndModule* end = begin + count;
12559 if (begin->id == interpreterId) {
12562 while ((end - begin) > __PYX_MODULE_STATE_LOOKUP_SMALL_SIZE) {
12563 __Pyx_InterpreterIdAndModule* halfway = begin + (end - begin)/2;
12564 if (halfway->id == interpreterId) {
12567 if (halfway->id < interpreterId) {
12573 for (; begin < end; ++begin) {
12574 if (begin->id >= interpreterId)
return begin;
12578static PyObject *__Pyx_State_FindModule(CYTHON_UNUSED
void* dummy) {
12579 int64_t interpreter_id = PyInterpreterState_GetID(PyInterpreterState_Get());
12580 if (interpreter_id == -1)
return NULL;
12581#if CYTHON_MODULE_STATE_LOOKUP_THREAD_SAFE
12582 __Pyx_ModuleStateLookupData* data = (__Pyx_ModuleStateLookupData*)__pyx_atomic_pointer_load_relaxed(&__Pyx_ModuleStateLookup_data);
12584 __pyx_atomic_incr_acq_rel(&__Pyx_ModuleStateLookup_read_counter);
12585 if (likely(data)) {
12586 __Pyx_ModuleStateLookupData* new_data = (__Pyx_ModuleStateLookupData*)__pyx_atomic_pointer_load_acquire(&__Pyx_ModuleStateLookup_data);
12587 if (likely(data == new_data)) {
12588 goto read_finished;
12591 __pyx_atomic_decr_acq_rel(&__Pyx_ModuleStateLookup_read_counter);
12592 __Pyx_ModuleStateLookup_Lock();
12593 __pyx_atomic_incr_relaxed(&__Pyx_ModuleStateLookup_read_counter);
12594 data = (__Pyx_ModuleStateLookupData*)__pyx_atomic_pointer_load_relaxed(&__Pyx_ModuleStateLookup_data);
12595 __Pyx_ModuleStateLookup_Unlock();
12599 __Pyx_ModuleStateLookupData* data = __Pyx_ModuleStateLookup_data;
12601 __Pyx_InterpreterIdAndModule* found = NULL;
12602 if (unlikely(!data))
goto end;
12603 if (data->interpreter_id_as_index) {
12604 if (interpreter_id < data->count) {
12605 found = data->table+interpreter_id;
12608 found = __Pyx_State_FindModuleStateLookupTableLowerBound(
12609 data->table, data->count, interpreter_id);
12613 PyObject *result=NULL;
12614 if (found && found->id == interpreter_id) {
12615 result = found->module;
12617#if CYTHON_MODULE_STATE_LOOKUP_THREAD_SAFE
12618 __pyx_atomic_decr_acq_rel(&__Pyx_ModuleStateLookup_read_counter);
12623#if CYTHON_MODULE_STATE_LOOKUP_THREAD_SAFE
12624static void __Pyx_ModuleStateLookup_wait_until_no_readers(
void) {
12625 while (__pyx_atomic_load(&__Pyx_ModuleStateLookup_read_counter) != 0);
12628#define __Pyx_ModuleStateLookup_wait_until_no_readers()
12630static int __Pyx_State_AddModuleInterpIdAsIndex(__Pyx_ModuleStateLookupData **old_data, PyObject* module, int64_t interpreter_id) {
12631 Py_ssize_t to_allocate = (*old_data)->allocated;
12632 while (to_allocate <= interpreter_id) {
12633 if (to_allocate == 0) to_allocate = 1;
12634 else to_allocate *= 2;
12636 __Pyx_ModuleStateLookupData *new_data = *old_data;
12637 if (to_allocate != (*old_data)->allocated) {
12638 new_data = (__Pyx_ModuleStateLookupData *)realloc(
12640 sizeof(__Pyx_ModuleStateLookupData)+(to_allocate-1)*
sizeof(__Pyx_InterpreterIdAndModule));
12645 for (Py_ssize_t i = new_data->allocated; i < to_allocate; ++i) {
12646 new_data->table[i].id = i;
12647 new_data->table[i].module = NULL;
12649 new_data->allocated = to_allocate;
12651 new_data->table[interpreter_id].module =
module;
12652 if (new_data->count < interpreter_id+1) {
12653 new_data->count = interpreter_id+1;
12655 *old_data = new_data;
12658static void __Pyx_State_ConvertFromInterpIdAsIndex(__Pyx_ModuleStateLookupData *data) {
12659 __Pyx_InterpreterIdAndModule *read = data->table;
12660 __Pyx_InterpreterIdAndModule *write = data->table;
12661 __Pyx_InterpreterIdAndModule *end = read + data->count;
12662 for (; read<end; ++read) {
12663 if (read->module) {
12664 write->id = read->id;
12665 write->module = read->module;
12669 data->count = write - data->table;
12670 for (; write<end; ++write) {
12672 write->module = NULL;
12674 data->interpreter_id_as_index = 0;
12676static int __Pyx_State_AddModule(PyObject* module, CYTHON_UNUSED
void* dummy) {
12677 int64_t interpreter_id = PyInterpreterState_GetID(PyInterpreterState_Get());
12678 if (interpreter_id == -1)
return -1;
12680 __Pyx_ModuleStateLookup_Lock();
12681#if CYTHON_MODULE_STATE_LOOKUP_THREAD_SAFE
12682 __Pyx_ModuleStateLookupData *old_data = (__Pyx_ModuleStateLookupData *)
12683 __pyx_atomic_pointer_exchange(&__Pyx_ModuleStateLookup_data, 0);
12685 __Pyx_ModuleStateLookupData *old_data = __Pyx_ModuleStateLookup_data;
12687 __Pyx_ModuleStateLookupData *new_data = old_data;
12689 new_data = (__Pyx_ModuleStateLookupData *)calloc(1,
sizeof(__Pyx_ModuleStateLookupData));
12695 new_data->allocated = 1;
12696 new_data->interpreter_id_as_index = 1;
12698 __Pyx_ModuleStateLookup_wait_until_no_readers();
12699 if (new_data->interpreter_id_as_index) {
12700 if (interpreter_id < __PYX_MODULE_STATE_LOOKUP_SMALL_SIZE) {
12701 result = __Pyx_State_AddModuleInterpIdAsIndex(&new_data, module, interpreter_id);
12704 __Pyx_State_ConvertFromInterpIdAsIndex(new_data);
12707 Py_ssize_t insert_at = 0;
12709 __Pyx_InterpreterIdAndModule* lower_bound = __Pyx_State_FindModuleStateLookupTableLowerBound(
12710 new_data->table, new_data->count, interpreter_id);
12711 assert(lower_bound);
12712 insert_at = lower_bound - new_data->table;
12713 if (unlikely(insert_at < new_data->count && lower_bound->id == interpreter_id)) {
12714 lower_bound->module =
module;
12718 if (new_data->count+1 >= new_data->allocated) {
12719 Py_ssize_t to_allocate = (new_data->count+1)*2;
12721 (__Pyx_ModuleStateLookupData*)realloc(
12723 sizeof(__Pyx_ModuleStateLookupData) +
12724 (to_allocate-1)*
sizeof(__Pyx_InterpreterIdAndModule));
12727 new_data = old_data;
12731 new_data->allocated = to_allocate;
12734 int64_t last_id = interpreter_id;
12735 PyObject *last_module =
module;
12736 for (Py_ssize_t i=insert_at; i<new_data->count; ++i) {
12737 int64_t current_id = new_data->table[i].id;
12738 new_data->table[i].id = last_id;
12739 last_id = current_id;
12740 PyObject *current_module = new_data->table[i].module;
12741 new_data->table[i].module = last_module;
12742 last_module = current_module;
12746#if CYTHON_MODULE_STATE_LOOKUP_THREAD_SAFE
12747 __pyx_atomic_pointer_exchange(&__Pyx_ModuleStateLookup_data, new_data);
12749 __Pyx_ModuleStateLookup_data = new_data;
12751 __Pyx_ModuleStateLookup_Unlock();
12754static int __Pyx_State_RemoveModule(CYTHON_UNUSED
void* dummy) {
12755 int64_t interpreter_id = PyInterpreterState_GetID(PyInterpreterState_Get());
12756 if (interpreter_id == -1)
return -1;
12757 __Pyx_ModuleStateLookup_Lock();
12758#if CYTHON_MODULE_STATE_LOOKUP_THREAD_SAFE
12759 __Pyx_ModuleStateLookupData *data = (__Pyx_ModuleStateLookupData *)
12760 __pyx_atomic_pointer_exchange(&__Pyx_ModuleStateLookup_data, 0);
12762 __Pyx_ModuleStateLookupData *data = __Pyx_ModuleStateLookup_data;
12764 if (data->interpreter_id_as_index) {
12765 if (interpreter_id < data->count) {
12766 data->table[interpreter_id].module = NULL;
12771 __Pyx_ModuleStateLookup_wait_until_no_readers();
12772 __Pyx_InterpreterIdAndModule* lower_bound = __Pyx_State_FindModuleStateLookupTableLowerBound(
12773 data->table, data->count, interpreter_id);
12774 if (!lower_bound)
goto done;
12775 if (lower_bound->id != interpreter_id)
goto done;
12776 __Pyx_InterpreterIdAndModule *end = data->table+data->count;
12777 for (;lower_bound<end-1; ++lower_bound) {
12778 lower_bound->id = (lower_bound+1)->
id;
12779 lower_bound->module = (lower_bound+1)->module;
12783 if (data->count == 0) {
12788#if CYTHON_MODULE_STATE_LOOKUP_THREAD_SAFE
12789 __pyx_atomic_pointer_exchange(&__Pyx_ModuleStateLookup_data, data);
12791 __Pyx_ModuleStateLookup_data = data;
12793 __Pyx_ModuleStateLookup_Unlock();
12800#pragma warning( pop )
virtual void setTolerances(const double *rwork_tol)
void calc(const double &Sw)
virtual void calc_from_psic(const double &psicIn)
Richards free-function PSK closures (moved here from proteus/richards/psk_models.h).