57#ifndef PY_SSIZE_T_CLEAN
58#define PY_SSIZE_T_CLEAN
61#if defined(Py_LIMITED_API)
62 #if !defined(CYTHON_LIMITED_API)
63 #define CYTHON_LIMITED_API 1
65#elif defined(CYTHON_LIMITED_API)
67 #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.")
69 #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.
75 #error Python headers needed to compile C extensions, please install development version of Python.
76#elif PY_VERSION_HEX < 0x03090000
77 #error Cython requires Python 3.9+.
78#elif defined(Py_LIMITED_API) && (Py_LIMITED_API & 0xFFFF0000) > (PY_VERSION_HEX & 0xFFFF0000)
79 #error 'Py_LIMITED_API' can only select past Python X.Y versions, not future ones.
81#define __PYX_ABI_VERSION "3_3_0"
82#define CYTHON_HEX_VERSION 0x030300F0
83#define CYTHON_FUTURE_DIVISION 1
87 #define offsetof(type, member) ( (size_t) & ((type*)0) -> member )
89#if !defined(_WIN32) && !defined(WIN32) && !defined(MS_WINDOWS)
101 #define __Pyx_has_cbuiltin(name) __has_builtin(name)
103 #define __Pyx_has_cbuiltin(name) (0)
106 #define DL_IMPORT(t) t
109 #define DL_EXPORT(t) t
113 #define PY_LONG_LONG LONG_LONG
116 #define Py_HUGE_VAL HUGE_VAL
118#define __PYX_LIMITED_VERSION_HEX PY_VERSION_HEX
119#if defined(CYTHON_LIMITED_API)
120 #ifdef Py_LIMITED_API
121 #undef __PYX_LIMITED_VERSION_HEX
122 #define __PYX_LIMITED_VERSION_HEX Py_LIMITED_API
123 #if Py_LIMITED_API < 0x03090000
124 #error "Cython 3.3 requires the Python Limited API version to be 3.9 or greater."
127 #if defined(GRAALVM_PYTHON) || defined(PYPY_VERSION)
129 #pragma message ("Py_LIMITED_API is defined on PyPy or GraalPy. This takes precedence over Cython's specialized\
130 code for PyPy and GraalPy and is unlikely to work.")
132 #warning "Py_LIMITED_API is defined on PyPy or GraalPy. This takes precedence over Cython's specialized\
133 code for PyPy and GraalPy and is unlikely to work."
136 #define CYTHON_COMPILING_IN_PYPY 0
137 #define CYTHON_COMPILING_IN_CPYTHON 0
138 #define CYTHON_COMPILING_IN_LIMITED_API 1
139 #define CYTHON_COMPILING_IN_GRAAL 0
140 #define CYTHON_COMPILING_IN_CPYTHON_FREETHREADING 0
141 #undef CYTHON_USE_TYPE_SLOTS
142 #define CYTHON_USE_TYPE_SLOTS 0
143 #undef CYTHON_USE_TYPE_SPECS
144 #define CYTHON_USE_TYPE_SPECS 1
145 #undef CYTHON_USE_PYTYPE_LOOKUP
146 #define CYTHON_USE_PYTYPE_LOOKUP 0
147 #undef CYTHON_USE_PYLIST_INTERNALS
148 #define CYTHON_USE_PYLIST_INTERNALS 0
149 #undef CYTHON_USE_UNICODE_INTERNALS
150 #define CYTHON_USE_UNICODE_INTERNALS 0
151 #ifndef CYTHON_USE_UNICODE_WRITER
152 #define CYTHON_USE_UNICODE_WRITER 0
154 #undef CYTHON_USE_PYLONG_INTERNALS
155 #define CYTHON_USE_PYLONG_INTERNALS 0
156 #ifndef CYTHON_AVOID_BORROWED_REFS
157 #define CYTHON_AVOID_BORROWED_REFS 0
159 #ifndef CYTHON_AVOID_THREAD_UNSAFE_BORROWED_REFS
160 #define CYTHON_AVOID_THREAD_UNSAFE_BORROWED_REFS 0
162 #undef CYTHON_ASSUME_SAFE_MACROS
163 #define CYTHON_ASSUME_SAFE_MACROS 0
164 #undef CYTHON_ASSUME_SAFE_SIZE
165 #define CYTHON_ASSUME_SAFE_SIZE 0
166 #undef CYTHON_UNPACK_METHODS
167 #define CYTHON_UNPACK_METHODS 0
168 #undef CYTHON_FAST_THREAD_STATE
169 #define CYTHON_FAST_THREAD_STATE 0
170 #undef CYTHON_FAST_GIL
171 #define CYTHON_FAST_GIL 0
172 #undef CYTHON_VECTORCALL
173 #define CYTHON_VECTORCALL (__PYX_LIMITED_VERSION_HEX >= 0x030C0000)
174 #ifndef CYTHON_VECTORCALL_TPNEW
175 #define CYTHON_VECTORCALL_TPNEW (CYTHON_VECTORCALL && __PYX_LIMITED_VERSION_HEX >= 0x030E0000)
177 #ifndef CYTHON_PEP487_INIT_SUBCLASS
178 #define CYTHON_PEP487_INIT_SUBCLASS 1
180 #ifndef CYTHON_PEP489_MULTI_PHASE_INIT
181 #define CYTHON_PEP489_MULTI_PHASE_INIT 1
183 #ifndef CYTHON_USE_MODULE_STATE
184 #define CYTHON_USE_MODULE_STATE 0
186 #undef CYTHON_USE_SYS_MONITORING
187 #define CYTHON_USE_SYS_MONITORING 0
188 #ifndef CYTHON_USE_TP_FINALIZE
189 #define CYTHON_USE_TP_FINALIZE (__PYX_LIMITED_VERSION_HEX >= 0x030F0000 && PY_VERSION_HEX > 0x030F00A8)
191 #ifndef CYTHON_USE_AM_SEND
192 #define CYTHON_USE_AM_SEND (__PYX_LIMITED_VERSION_HEX >= 0x030A0000)
194 #undef CYTHON_USE_DICT_VERSIONS
195 #define CYTHON_USE_DICT_VERSIONS 0
196 #undef CYTHON_USE_EXC_INFO_STACK
197 #define CYTHON_USE_EXC_INFO_STACK 0
198 #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC
199 #define CYTHON_UPDATE_DESCRIPTOR_DOC 0
201 #ifndef CYTHON_USE_OWN_PREP_RERAISE_STAR
202 #define CYTHON_USE_OWN_PREP_RERAISE_STAR 1
204 #ifndef CYTHON_USE_FREELISTS
205 #define CYTHON_USE_FREELISTS 1
207 #undef CYTHON_IMMORTAL_CONSTANTS
208 #define CYTHON_IMMORTAL_CONSTANTS 0
209 #if __PYX_LIMITED_VERSION_HEX < 0x030E0000
210 #undef CYTHON_OPAQUE_OBJECTS
211 #define CYTHON_OPAQUE_OBJECTS 0
212 #elif !defined(CYTHON_OPAQUE_OBJECTS)
213 #define CYTHON_OPAQUE_OBJECTS (__PYX_LIMITED_VERSION_HEX >= 0x030F0000)
215#elif defined(GRAALVM_PYTHON)
218 #define CYTHON_COMPILING_IN_PYPY 0
219 #define CYTHON_COMPILING_IN_CPYTHON 0
220 #define CYTHON_COMPILING_IN_LIMITED_API 0
221 #define CYTHON_COMPILING_IN_GRAAL 1
222 #define CYTHON_COMPILING_IN_CPYTHON_FREETHREADING 0
223 #ifndef CYTHON_USE_TYPE_SLOTS
224 #define CYTHON_USE_TYPE_SLOTS 0
226 #undef CYTHON_USE_TYPE_SPECS
227 #define CYTHON_USE_TYPE_SPECS 0
228 #undef CYTHON_USE_PYTYPE_LOOKUP
229 #define CYTHON_USE_PYTYPE_LOOKUP 0
230 #undef CYTHON_USE_PYLIST_INTERNALS
231 #define CYTHON_USE_PYLIST_INTERNALS 0
232 #undef CYTHON_USE_UNICODE_INTERNALS
233 #define CYTHON_USE_UNICODE_INTERNALS 0
234 #undef CYTHON_USE_UNICODE_WRITER
235 #define CYTHON_USE_UNICODE_WRITER 0
236 #undef CYTHON_USE_PYLONG_INTERNALS
237 #define CYTHON_USE_PYLONG_INTERNALS 0
238 #undef CYTHON_AVOID_BORROWED_REFS
239 #define CYTHON_AVOID_BORROWED_REFS 1
240 #undef CYTHON_AVOID_THREAD_UNSAFE_BORROWED_REFS
241 #define CYTHON_AVOID_THREAD_UNSAFE_BORROWED_REFS 0
242 #undef CYTHON_ASSUME_SAFE_MACROS
243 #define CYTHON_ASSUME_SAFE_MACROS 0
244 #undef CYTHON_ASSUME_SAFE_SIZE
245 #define CYTHON_ASSUME_SAFE_SIZE 0
246 #undef CYTHON_UNPACK_METHODS
247 #define CYTHON_UNPACK_METHODS 0
248 #undef CYTHON_FAST_THREAD_STATE
249 #define CYTHON_FAST_THREAD_STATE 0
250 #undef CYTHON_FAST_GIL
251 #define CYTHON_FAST_GIL 0
252 #ifndef CYTHON_VECTORCALL
253 #define CYTHON_VECTORCALL 1
255 #if CYTHON_USE_TYPE_SPECS && PY_VERSION_HEX < 0x030E0000
256 #undef CYTHON_VECTORCALL_TPNEW
257 #define CYTHON_VECTORCALL_TPNEW 0
258 #elif !defined(CYTHON_VECTORCALL_TPNEW)
259 #define CYTHON_VECTORCALL_TPNEW CYTHON_VECTORCALL
261 #ifndef CYTHON_PEP487_INIT_SUBCLASS
262 #define CYTHON_PEP487_INIT_SUBCLASS 1
264 #undef CYTHON_PEP489_MULTI_PHASE_INIT
265 #define CYTHON_PEP489_MULTI_PHASE_INIT 1
266 #undef CYTHON_USE_MODULE_STATE
267 #define CYTHON_USE_MODULE_STATE 0
268 #undef CYTHON_USE_SYS_MONITORING
269 #define CYTHON_USE_SYS_MONITORING 0
270 #undef CYTHON_USE_TP_FINALIZE
271 #define CYTHON_USE_TP_FINALIZE 0
272 #undef CYTHON_USE_AM_SEND
273 #define CYTHON_USE_AM_SEND 0
274 #undef CYTHON_USE_DICT_VERSIONS
275 #define CYTHON_USE_DICT_VERSIONS 0
276 #undef CYTHON_USE_EXC_INFO_STACK
277 #define CYTHON_USE_EXC_INFO_STACK 1
278 #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC
279 #define CYTHON_UPDATE_DESCRIPTOR_DOC 0
281 #ifndef CYTHON_USE_OWN_PREP_RERAISE_STAR
282 #define CYTHON_USE_OWN_PREP_RERAISE_STAR 1
284 #undef CYTHON_USE_FREELISTS
285 #define CYTHON_USE_FREELISTS 0
286 #undef CYTHON_IMMORTAL_CONSTANTS
287 #define CYTHON_IMMORTAL_CONSTANTS 0
288 #undef CYTHON_OPAQUE_OBJECTS
289 #define CYTHON_OPAQUE_OBJECTS 0
290#elif defined(PYPY_VERSION)
291 #define CYTHON_COMPILING_IN_PYPY 1
292 #define CYTHON_COMPILING_IN_CPYTHON 0
293 #define CYTHON_COMPILING_IN_LIMITED_API 0
294 #define CYTHON_COMPILING_IN_GRAAL 0
295 #define CYTHON_COMPILING_IN_CPYTHON_FREETHREADING 0
296 #undef CYTHON_USE_TYPE_SLOTS
297 #define CYTHON_USE_TYPE_SLOTS 1
298 #ifndef CYTHON_USE_TYPE_SPECS
299 #define CYTHON_USE_TYPE_SPECS 0
301 #undef CYTHON_USE_PYTYPE_LOOKUP
302 #define CYTHON_USE_PYTYPE_LOOKUP 0
303 #undef CYTHON_USE_PYLIST_INTERNALS
304 #define CYTHON_USE_PYLIST_INTERNALS 0
305 #undef CYTHON_USE_UNICODE_INTERNALS
306 #define CYTHON_USE_UNICODE_INTERNALS 0
307 #undef CYTHON_USE_UNICODE_WRITER
308 #define CYTHON_USE_UNICODE_WRITER 0
309 #undef CYTHON_USE_PYLONG_INTERNALS
310 #define CYTHON_USE_PYLONG_INTERNALS 0
311 #undef CYTHON_AVOID_BORROWED_REFS
312 #define CYTHON_AVOID_BORROWED_REFS 1
313 #undef CYTHON_AVOID_THREAD_UNSAFE_BORROWED_REFS
314 #define CYTHON_AVOID_THREAD_UNSAFE_BORROWED_REFS 1
315 #undef CYTHON_ASSUME_SAFE_MACROS
316 #define CYTHON_ASSUME_SAFE_MACROS 0
317 #ifndef CYTHON_ASSUME_SAFE_SIZE
318 #define CYTHON_ASSUME_SAFE_SIZE 1
320 #undef CYTHON_UNPACK_METHODS
321 #define CYTHON_UNPACK_METHODS 0
322 #undef CYTHON_FAST_THREAD_STATE
323 #define CYTHON_FAST_THREAD_STATE 0
324 #undef CYTHON_FAST_GIL
325 #define CYTHON_FAST_GIL 0
326 #ifndef CYTHON_VECTORCALL
327 #define CYTHON_VECTORCALL 1
329 #if CYTHON_USE_TYPE_SPECS && PY_VERSION_HEX < 0x030E0000
330 #undef CYTHON_VECTORCALL_TPNEW
331 #define CYTHON_VECTORCALL_TPNEW 0
332 #elif !defined(CYTHON_VECTORCALL_TPNEW)
333 #define CYTHON_VECTORCALL_TPNEW (PYPY_VERSION_NUM >= 0x07030800 && CYTHON_VECTORCALL)
335 #ifndef CYTHON_PEP487_INIT_SUBCLASS
336 #define CYTHON_PEP487_INIT_SUBCLASS 1
338 #ifndef CYTHON_PEP489_MULTI_PHASE_INIT
339 #define CYTHON_PEP489_MULTI_PHASE_INIT 1
341 #undef CYTHON_USE_MODULE_STATE
342 #define CYTHON_USE_MODULE_STATE 0
343 #undef CYTHON_USE_SYS_MONITORING
344 #define CYTHON_USE_SYS_MONITORING 0
345 #ifndef CYTHON_USE_TP_FINALIZE
346 #define CYTHON_USE_TP_FINALIZE (PYPY_VERSION_NUM >= 0x07030C00)
348 #undef CYTHON_USE_AM_SEND
349 #define CYTHON_USE_AM_SEND 0
350 #undef CYTHON_USE_DICT_VERSIONS
351 #define CYTHON_USE_DICT_VERSIONS 0
352 #undef CYTHON_USE_EXC_INFO_STACK
353 #define CYTHON_USE_EXC_INFO_STACK 0
354 #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC
355 #define CYTHON_UPDATE_DESCRIPTOR_DOC (PYPY_VERSION_NUM >= 0x07031100)
357 #ifndef CYTHON_USE_OWN_PREP_RERAISE_STAR
358 #define CYTHON_USE_OWN_PREP_RERAISE_STAR 1
360 #undef CYTHON_USE_FREELISTS
361 #define CYTHON_USE_FREELISTS 0
362 #undef CYTHON_IMMORTAL_CONSTANTS
363 #define CYTHON_IMMORTAL_CONSTANTS 0
364 #undef CYTHON_OPAQUE_OBJECTS
365 #define CYTHON_OPAQUE_OBJECTS 0
367 #define CYTHON_COMPILING_IN_PYPY 0
368 #define CYTHON_COMPILING_IN_CPYTHON 1
369 #define CYTHON_COMPILING_IN_LIMITED_API 0
370 #define CYTHON_COMPILING_IN_GRAAL 0
371 #ifdef Py_GIL_DISABLED
372 #define CYTHON_COMPILING_IN_CPYTHON_FREETHREADING 1
374 #define CYTHON_COMPILING_IN_CPYTHON_FREETHREADING 0
376 #if PY_VERSION_HEX < 0x030A0000
377 #undef CYTHON_USE_TYPE_SLOTS
378 #define CYTHON_USE_TYPE_SLOTS 1
379 #elif !defined(CYTHON_USE_TYPE_SLOTS)
380 #define CYTHON_USE_TYPE_SLOTS 1
382 #ifndef CYTHON_USE_TYPE_SPECS
383 #define CYTHON_USE_TYPE_SPECS 0
385 #ifndef CYTHON_USE_PYTYPE_LOOKUP
386 #define CYTHON_USE_PYTYPE_LOOKUP 1
388 #ifndef CYTHON_USE_PYLONG_INTERNALS
389 #define CYTHON_USE_PYLONG_INTERNALS 1
391 #if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING
392 #undef CYTHON_USE_PYLIST_INTERNALS
393 #define CYTHON_USE_PYLIST_INTERNALS 0
394 #elif !defined(CYTHON_USE_PYLIST_INTERNALS)
395 #define CYTHON_USE_PYLIST_INTERNALS 1
397 #ifndef CYTHON_USE_UNICODE_INTERNALS
398 #define CYTHON_USE_UNICODE_INTERNALS 1
400 #if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING || PY_VERSION_HEX >= 0x030B00A2
401 #undef CYTHON_USE_UNICODE_WRITER
402 #define CYTHON_USE_UNICODE_WRITER 0
403 #elif !defined(CYTHON_USE_UNICODE_WRITER)
404 #define CYTHON_USE_UNICODE_WRITER 1
406 #ifndef CYTHON_AVOID_BORROWED_REFS
407 #define CYTHON_AVOID_BORROWED_REFS 0
409 #if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING
410 #undef CYTHON_AVOID_THREAD_UNSAFE_BORROWED_REFS
411 #define CYTHON_AVOID_THREAD_UNSAFE_BORROWED_REFS 1
412 #elif !defined(CYTHON_AVOID_THREAD_UNSAFE_BORROWED_REFS)
413 #define CYTHON_AVOID_THREAD_UNSAFE_BORROWED_REFS 0
415 #ifndef CYTHON_ASSUME_SAFE_MACROS
416 #define CYTHON_ASSUME_SAFE_MACROS 1
418 #ifndef CYTHON_ASSUME_SAFE_SIZE
419 #define CYTHON_ASSUME_SAFE_SIZE 1
421 #ifndef CYTHON_UNPACK_METHODS
422 #define CYTHON_UNPACK_METHODS 1
424 #ifndef CYTHON_FAST_THREAD_STATE
425 #define CYTHON_FAST_THREAD_STATE 1
427 #if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING
428 #undef CYTHON_FAST_GIL
429 #define CYTHON_FAST_GIL 0
430 #elif !defined(CYTHON_FAST_GIL)
431 #define CYTHON_FAST_GIL (PY_VERSION_HEX < 0x030C00A6)
433 #ifndef CYTHON_VECTORCALL
434 #define CYTHON_VECTORCALL 1
436 #if CYTHON_USE_TYPE_SPECS && PY_VERSION_HEX < 0x030E0000
437 #undef CYTHON_VECTORCALL_TPNEW
438 #define CYTHON_VECTORCALL_TPNEW 0
439 #elif !defined(CYTHON_VECTORCALL_TPNEW)
440 #define CYTHON_VECTORCALL_TPNEW CYTHON_VECTORCALL
442 #ifndef CYTHON_PEP487_INIT_SUBCLASS
443 #define CYTHON_PEP487_INIT_SUBCLASS 1
445 #ifndef CYTHON_PEP489_MULTI_PHASE_INIT
446 #define CYTHON_PEP489_MULTI_PHASE_INIT 1
448 #ifndef CYTHON_USE_MODULE_STATE
449 #define CYTHON_USE_MODULE_STATE 0
451 #ifndef CYTHON_USE_SYS_MONITORING
452 #define CYTHON_USE_SYS_MONITORING (PY_VERSION_HEX >= 0x030d00B1)
454 #ifndef CYTHON_USE_TP_FINALIZE
455 #define CYTHON_USE_TP_FINALIZE 1
457 #ifndef CYTHON_USE_AM_SEND
458 #define CYTHON_USE_AM_SEND 1
460 #if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING
461 #undef CYTHON_USE_DICT_VERSIONS
462 #define CYTHON_USE_DICT_VERSIONS 0
463 #elif !defined(CYTHON_USE_DICT_VERSIONS)
464 #define CYTHON_USE_DICT_VERSIONS (PY_VERSION_HEX < 0x030C00A5 && !CYTHON_USE_MODULE_STATE)
466 #ifndef CYTHON_USE_EXC_INFO_STACK
467 #define CYTHON_USE_EXC_INFO_STACK 1
469 #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC
470 #define CYTHON_UPDATE_DESCRIPTOR_DOC 1
472 #ifndef CYTHON_USE_OWN_PREP_RERAISE_STAR
473 #define CYTHON_USE_OWN_PREP_RERAISE_STAR (PY_VERSION_HEX < 0x030C00B2)
475 #ifndef CYTHON_USE_FREELISTS
476 #define CYTHON_USE_FREELISTS (!CYTHON_COMPILING_IN_CPYTHON_FREETHREADING)
478 #if defined(CYTHON_IMMORTAL_CONSTANTS) && PY_VERSION_HEX < 0x030C0000
479 #undef CYTHON_IMMORTAL_CONSTANTS
480 #define CYTHON_IMMORTAL_CONSTANTS 0
481 #elif !defined(CYTHON_IMMORTAL_CONSTANTS)
482 #define CYTHON_IMMORTAL_CONSTANTS (PY_VERSION_HEX >= 0x030C0000 && !CYTHON_USE_MODULE_STATE && CYTHON_COMPILING_IN_CPYTHON_FREETHREADING)
484 #ifndef CYTHON_OPAQUE_OBJECTS
485 #define CYTHON_OPAQUE_OBJECTS 0
488#if CYTHON_USE_PYLONG_INTERNALS
493 enum { __pyx_check_sizeof_voidp = 1 / (int)(SIZEOF_VOID_P ==
sizeof(
void*)) };
496#ifndef __has_attribute
497 #define __has_attribute(x) 0
499#ifndef __has_cpp_attribute
500 #define __has_cpp_attribute(x) 0
502#ifndef CYTHON_RESTRICT
503 #if defined(__GNUC__)
504 #define CYTHON_RESTRICT __restrict__
505 #elif defined(_MSC_VER) && _MSC_VER >= 1400
506 #define CYTHON_RESTRICT __restrict
507 #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
508 #define CYTHON_RESTRICT restrict
510 #define CYTHON_RESTRICT
514 #if defined(__cplusplus)
517 #if ((defined(_MSVC_LANG) && _MSVC_LANG >= 201703L) || __cplusplus >= 201703L)
518 #if __has_cpp_attribute(maybe_unused)
519 #define CYTHON_UNUSED [[maybe_unused]]
522 #elif defined(__STDC_VERSION__) && __STDC_VERSION__ >= 202311L
523 #define CYTHON_UNUSED [[maybe_unused]]
527# if defined(__GNUC__)
528# if !(defined(__cplusplus)) || (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4))
529# define CYTHON_UNUSED __attribute__ ((__unused__))
531# define CYTHON_UNUSED
533# elif defined(__ICC) || (defined(__INTEL_COMPILER) && !defined(_MSC_VER))
534# define CYTHON_UNUSED __attribute__ ((__unused__))
536# define CYTHON_UNUSED
539#ifndef CYTHON_UNUSED_VAR
540# if defined(__cplusplus)
541 template<
class T>
void CYTHON_UNUSED_VAR(
const T& ) { }
543# define CYTHON_UNUSED_VAR(x) (void)(x)
546#ifndef CYTHON_MAYBE_UNUSED_VAR
547 #define CYTHON_MAYBE_UNUSED_VAR(x) CYTHON_UNUSED_VAR(x)
549#ifndef CYTHON_NCP_UNUSED
550# if CYTHON_COMPILING_IN_CPYTHON && !CYTHON_COMPILING_IN_CPYTHON_FREETHREADING
551# define CYTHON_NCP_UNUSED
553# define CYTHON_NCP_UNUSED CYTHON_UNUSED
556#ifndef CYTHON_USE_CPP_STD_MOVE
557 #if defined(__cplusplus) && (\
558 __cplusplus >= 201103L || (defined(_MSC_VER) && _MSC_VER >= 1600))
559 #define CYTHON_USE_CPP_STD_MOVE 1
561 #define CYTHON_USE_CPP_STD_MOVE 0
564#define __Pyx_void_to_None(void_result) ((void)(void_result), Py_INCREF(Py_None), Py_None)
566typedef uintptr_t __pyx_uintptr_t;
567#ifndef CYTHON_FALLTHROUGH
568 #if defined(__cplusplus)
571 #if ((defined(_MSVC_LANG) && _MSVC_LANG >= 201703L) || __cplusplus >= 201703L)
572 #if __has_cpp_attribute(fallthrough)
573 #define CYTHON_FALLTHROUGH [[fallthrough]]
576 #ifndef CYTHON_FALLTHROUGH
577 #if __has_cpp_attribute(clang::fallthrough)
578 #define CYTHON_FALLTHROUGH [[clang::fallthrough]]
579 #elif __has_cpp_attribute(gnu::fallthrough)
580 #define CYTHON_FALLTHROUGH [[gnu::fallthrough]]
584 #ifndef CYTHON_FALLTHROUGH
585 #if __has_attribute(fallthrough)
586 #define CYTHON_FALLTHROUGH __attribute__((fallthrough))
588 #define CYTHON_FALLTHROUGH
591 #if defined(__clang__) && defined(__apple_build_version__)
592 #if __apple_build_version__ < 7000000
593 #undef CYTHON_FALLTHROUGH
594 #define CYTHON_FALLTHROUGH
599 #define __Pyx_UNREACHABLE() Py_UNREACHABLE()
600#elif __Pyx_has_cbuiltin(__builtin_unreachable)
601 #define __Pyx_UNREACHABLE() __builtin_unreachable()
602#elif defined(__clang__) || defined(__INTEL_COMPILER) || (defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 5)))
603 #define __Pyx_UNREACHABLE() __builtin_unreachable()
604#elif defined(_MSC_VER)
605 #define __Pyx_UNREACHABLE() __assume(0)
607 #define __Pyx_UNREACHABLE() Py_FatalError("Unreachable C code path reached")
609#ifndef Py_UNREACHABLE
610 #define Py_UNREACHABLE() __Pyx_UNREACHABLE()
613 template <
typename T>
614 struct __PYX_IS_UNSIGNED_IMPL {
static const bool value =
T(0) <
T(-1);};
615 #define __PYX_IS_UNSIGNED(type) (__PYX_IS_UNSIGNED_IMPL<type>::value)
617 #define __PYX_IS_UNSIGNED(type) (((type)-1) > 0)
619#if CYTHON_COMPILING_IN_PYPY == 1
620 #define __PYX_NEED_TP_PRINT_SLOT (PY_VERSION_HEX < 0x030A0000)
622 #define __PYX_NEED_TP_PRINT_SLOT 0
624#define __PYX_REINTERPRET_FUNCION(func_pointer, other_pointer) ((func_pointer)(void(*)(void))(other_pointer))
625#if __PYX_LIMITED_VERSION_HEX < 0x030C0000
626#define __Pyx_PyErr_FetchException(petype, peval, petb) PyErr_Fetch(petype, peval, petb)
627#define __Pyx_PyErr_RestoreException(etype, eval, etb) PyErr_Restore(etype, eval, etb)
629#define __Pyx_PyErr_FetchException(petype, peval, petb) *(petype)=NULL; *(peval)=PyErr_GetRaisedException(); *(petb)=NULL
630#define __Pyx_PyErr_RestoreException(etype, eval, etb) PyErr_SetRaisedException(eval)
635 #if defined(__clang__)
636 #define CYTHON_INLINE __inline__ __attribute__ ((__unused__))
637 #elif defined(__GNUC__)
638 #define CYTHON_INLINE __inline__
639 #elif defined(_MSC_VER)
640 #define CYTHON_INLINE __inline
641 #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
642 #define CYTHON_INLINE inline
644 #define CYTHON_INLINE
649#define __PYX_BUILD_PY_SSIZE_T "n"
650#define CYTHON_FORMAT_SSIZE_T "z"
651#define __Pyx_BUILTIN_MODULE_NAME "builtins"
652#define __Pyx_DefaultClassType PyType_Type
653#if CYTHON_COMPILING_IN_LIMITED_API
655 static int CO_OPTIMIZED;
658 static int CO_NEWLOCALS;
661 static int CO_VARARGS;
663 #ifndef CO_VARKEYWORDS
664 static int CO_VARKEYWORDS;
666 #ifndef CO_ASYNC_GENERATOR
667 static int CO_ASYNC_GENERATOR;
670 static int CO_GENERATOR;
673 static int CO_COROUTINE;
677 #define CO_COROUTINE 0x80
679 #ifndef CO_ASYNC_GENERATOR
680 #define CO_ASYNC_GENERATOR 0x200
683static int __Pyx_init_co_variables(
void);
684#if PY_VERSION_HEX >= 0x030A00B1 || defined(Py_Is)
685 #define __Pyx_Py_Is(x, y) Py_Is(x, y)
687 #define __Pyx_Py_Is(x, y) ((x) == (y))
689#if PY_VERSION_HEX >= 0x030A00B1 || defined(Py_IsNone)
690 #define __Pyx_Py_IsNone(ob) Py_IsNone(ob)
692 #define __Pyx_Py_IsNone(ob) __Pyx_Py_Is((ob), Py_None)
694#if PY_VERSION_HEX >= 0x030A00B1 || defined(Py_IsTrue)
695 #define __Pyx_Py_IsTrue(ob) Py_IsTrue(ob)
697 #define __Pyx_Py_IsTrue(ob) __Pyx_Py_Is((ob), Py_True)
699#if PY_VERSION_HEX >= 0x030A00B1 || defined(Py_IsFalse)
700 #define __Pyx_Py_IsFalse(ob) Py_IsFalse(ob)
702 #define __Pyx_Py_IsFalse(ob) __Pyx_Py_Is((ob), Py_False)
704#define __Pyx_NoneAsNull(obj) (__Pyx_Py_IsNone(obj) ? NULL : (obj))
705#if CYTHON_COMPILING_IN_PYPY
706 #define __Pyx_PyObject_GC_IsFinalized(o) _PyGC_FINALIZED(o)
708 #define __Pyx_PyObject_GC_IsFinalized(o) PyObject_GC_IsFinalized(o)
710#if CYTHON_COMPILING_IN_LIMITED_API
711static unsigned long __Pyx_Runtime_TPFLAGS_SEQUENCE;
712static unsigned long __Pyx_Runtime_TPFLAGS_MAPPING;
714#define __Pyx_Runtime_TPFLAGS_SEQUENCE Py_TPFLAGS_SEQUENCE
715#define __Pyx_Runtime_TPFLAGS_MAPPING Py_TPFLAGS_MAPPING
717static int __Pyx_init_tpflags_variables(
void);
718#ifndef Py_TPFLAGS_HAVE_FINALIZE
719 #define Py_TPFLAGS_HAVE_FINALIZE 0
721#ifndef Py_TPFLAGS_SEQUENCE
722 #define Py_TPFLAGS_SEQUENCE (CYTHON_COMPILING_IN_LIMITED_API ? 0 : 1 << 5)
724#ifndef Py_TPFLAGS_MAPPING
725 #define Py_TPFLAGS_MAPPING (CYTHON_COMPILING_IN_LIMITED_API ? 0 : 1 << 6)
727#ifndef Py_TPFLAGS_IMMUTABLETYPE
728 #define Py_TPFLAGS_IMMUTABLETYPE (1UL << 8)
730#ifndef Py_TPFLAGS_DISALLOW_INSTANTIATION
731 #define Py_TPFLAGS_DISALLOW_INSTANTIATION (1UL << 7)
733#ifndef METH_STACKLESS
734 #define METH_STACKLESS 0
736#if !defined(METH_FASTCALL) || CYTHON_COMPILING_IN_PYPY
737 #ifndef METH_FASTCALL
738 #define METH_FASTCALL 0x80
740 typedef PyObject *(*__Pyx_PyCFunctionFast) (PyObject *self, PyObject *
const *args, Py_ssize_t nargs);
741 typedef PyObject *(*__Pyx_PyCFunctionFastWithKeywords) (PyObject *self, PyObject *
const *args,
742 Py_ssize_t nargs, PyObject *kwnames);
744 #if PY_VERSION_HEX >= 0x030d00A4
745 # define __Pyx_PyCFunctionFast PyCFunctionFast
746 # define __Pyx_PyCFunctionFastWithKeywords PyCFunctionFastWithKeywords
748 # define __Pyx_PyCFunctionFast _PyCFunctionFast
749 # define __Pyx_PyCFunctionFastWithKeywords _PyCFunctionFastWithKeywords
753 #define __Pyx_METH_FASTCALL METH_FASTCALL
754 #define __Pyx_PyCFunction_FastCall __Pyx_PyCFunctionFast
755 #define __Pyx_PyCFunction_FastCallWithKeywords __Pyx_PyCFunctionFastWithKeywords
757 #define __Pyx_METH_FASTCALL METH_VARARGS
758 #define __Pyx_PyCFunction_FastCall PyCFunction
759 #define __Pyx_PyCFunction_FastCallWithKeywords PyCFunctionWithKeywords
762 #define __pyx_vectorcallfunc vectorcallfunc
763 #define __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET PY_VECTORCALL_ARGUMENTS_OFFSET
764 #define __Pyx_PyVectorcall_NARGS(n) PyVectorcall_NARGS((size_t)(n))
766 #define __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET 0
767 #define __Pyx_PyVectorcall_NARGS(n) ((Py_ssize_t)(n))
769#define __Pyx_PyCFunction_CheckExact(func) PyCFunction_CheckExact(func)
770#define __Pyx_CyOrPyCFunction_Check(func) PyCFunction_Check(func)
771#if CYTHON_COMPILING_IN_CPYTHON
772#define __Pyx_CyOrPyCFunction_GET_FUNCTION(func) (((PyCFunctionObject*)(func))->m_ml->ml_meth)
773#elif !CYTHON_COMPILING_IN_LIMITED_API
774#define __Pyx_CyOrPyCFunction_GET_FUNCTION(func) PyCFunction_GET_FUNCTION(func)
776#if CYTHON_COMPILING_IN_CPYTHON
777#define __Pyx_CyOrPyCFunction_GET_FLAGS(func) (((PyCFunctionObject*)(func))->m_ml->ml_flags)
778static CYTHON_INLINE PyObject* __Pyx_CyOrPyCFunction_GET_SELF(PyObject *func) {
779 return (__Pyx_CyOrPyCFunction_GET_FLAGS(func) & METH_STATIC) ? NULL : ((PyCFunctionObject*)func)->m_self;
782static CYTHON_INLINE
int __Pyx__IsSameCFunction(PyObject *func,
void (*cfunc)(
void)) {
783#if CYTHON_COMPILING_IN_LIMITED_API
784 return PyCFunction_Check(func) && PyCFunction_GetFunction(func) == (PyCFunction) cfunc;
786 return PyCFunction_Check(func) && PyCFunction_GET_FUNCTION(func) == (PyCFunction) cfunc;
789#define __Pyx_IsSameCFunction(func, cfunc) __Pyx__IsSameCFunction(func, cfunc)
790#if CYTHON_COMPILING_IN_LIMITED_API && __PYX_LIMITED_VERSION_HEX < 0x030A0000
791 #define __Pyx_PyType_FromModuleAndSpec(m, s, b) ((void)m, PyType_FromSpecWithBases(s, b))
793 #define __Pyx_PyType_FromModuleAndSpec(m, s, b) PyType_FromModuleAndSpec(m, s, b)
795#if CYTHON_COMPILING_IN_PYPY
796 typedef PyObject *(*__Pyx_PyCMethod)(PyObject *, PyTypeObject *, PyObject *
const *, size_t, PyObject *);
798 #define __Pyx_PyCMethod PyCMethod
801 #define METH_METHOD 0x200
803#if CYTHON_COMPILING_IN_PYPY && !defined(PyObject_Malloc)
804 #define PyObject_Malloc(s) PyMem_Malloc(s)
805 #define PyObject_Free(p) PyMem_Free(p)
806 #define PyObject_Realloc(p) PyMem_Realloc(p)
808#if CYTHON_COMPILING_IN_LIMITED_API
809 #define __Pyx_PyFrame_SetLineNumber(frame, lineno)
810#elif CYTHON_COMPILING_IN_GRAAL && defined(GRAALPY_VERSION_NUM) && GRAALPY_VERSION_NUM > 0x19000000
811 #define __Pyx_PyCode_HasFreeVars(co) (PyCode_GetNumFree(co) > 0)
812 #define __Pyx_PyFrame_SetLineNumber(frame, lineno) GraalPyFrame_SetLineNumber((frame), (lineno))
813#elif CYTHON_COMPILING_IN_GRAAL
814 #define __Pyx_PyCode_HasFreeVars(co) (PyCode_GetNumFree(co) > 0)
815 #define __Pyx_PyFrame_SetLineNumber(frame, lineno) _PyFrame_SetLineNumber((frame), (lineno))
817 #define __Pyx_PyCode_HasFreeVars(co) (PyCode_GetNumFree(co) > 0)
818 #define __Pyx_PyFrame_SetLineNumber(frame, lineno) (frame)->f_lineno = (lineno)
820#if CYTHON_COMPILING_IN_LIMITED_API
821 #define __Pyx_PyThreadState_Current PyThreadState_Get()
822#elif !CYTHON_FAST_THREAD_STATE
823 #define __Pyx_PyThreadState_Current PyThreadState_GET()
824#elif PY_VERSION_HEX >= 0x030d00A1
825 #define __Pyx_PyThreadState_Current PyThreadState_GetUnchecked()
827 #define __Pyx_PyThreadState_Current _PyThreadState_UncheckedGet()
829#if CYTHON_OPAQUE_OBJECTS && CYTHON_COMPILING_IN_LIMITED_API
830 #define __PYX_SHARED_SIZEOF(T) -((int)sizeof(T))
831 #define __PYX_SHARED_RELATIVE_OFFSET Py_RELATIVE_OFFSET
832 #define CYTHON_OPAQUE_SHARED_TYPES 1
834 #define __PYX_SHARED_SIZEOF(T) sizeof(T)
835 #define __PYX_SHARED_RELATIVE_OFFSET 0
836 #define CYTHON_OPAQUE_SHARED_TYPES 0
838#if CYTHON_USE_MODULE_STATE
839static CYTHON_INLINE
void *__Pyx__PyModule_GetState(PyObject *op)
842 result = PyModule_GetState(op);
844 Py_FatalError(
"Couldn't find the module state");
847#define __Pyx_PyModule_GetState(o) (__pyx_mstatetype *)__Pyx__PyModule_GetState(o)
849#define __Pyx_PyModule_GetState(op) ((void)op,__pyx_mstate_global)
851#define __Pyx_PyObject_GetSlot(obj, name, func_ctype) __Pyx_PyType_GetSlot(Py_TYPE((PyObject *) obj), name, func_ctype)
852#define __Pyx_PyObject_TryGetSlot(obj, name, func_ctype) __Pyx_PyType_TryGetSlot(Py_TYPE(obj), name, func_ctype)
853#define __Pyx_PyObject_GetSubSlot(obj, sub, name, func_ctype) __Pyx_PyType_GetSubSlot(Py_TYPE(obj), sub, name, func_ctype)
854#define __Pyx_PyObject_TryGetSubSlot(obj, sub, name, func_ctype) __Pyx_PyType_TryGetSubSlot(Py_TYPE(obj), sub, name, func_ctype)
855#if CYTHON_USE_TYPE_SLOTS
856 #define __Pyx_PyType_GetSlot(type, name, func_ctype) ((type)->name)
857 #define __Pyx_PyType_TryGetSlot(type, name, func_ctype) __Pyx_PyType_GetSlot(type, name, func_ctype)
858 #define __Pyx_PyType_GetSubSlot(type, sub, name, func_ctype) (((type)->sub) ? ((type)->sub->name) : NULL)
859 #define __Pyx_PyType_TryGetSubSlot(type, sub, name, func_ctype) __Pyx_PyType_GetSubSlot(type, sub, name, func_ctype)
861 #define __Pyx_PyType_GetSlot(type, name, func_ctype) ((func_ctype) PyType_GetSlot((type), Py_##name))
862 #define __Pyx_PyType_TryGetSlot(type, name, func_ctype)\
863 ((__PYX_LIMITED_VERSION_HEX >= 0x030A0000 ||\
864 (PyType_GetFlags(type) & Py_TPFLAGS_HEAPTYPE) || __Pyx_get_runtime_version() >= 0x030A0000) ?\
865 __Pyx_PyType_GetSlot(type, name, func_ctype) : NULL)
866 #define __Pyx_PyType_GetSubSlot(obj, sub, name, func_ctype) __Pyx_PyType_GetSlot(obj, name, func_ctype)
867 #define __Pyx_PyType_TryGetSubSlot(obj, sub, name, func_ctype) __Pyx_PyType_TryGetSlot(obj, name, func_ctype)
869#if CYTHON_COMPILING_IN_CPYTHON || defined(_PyDict_NewPresized)
870#define __Pyx_PyDict_NewPresized(n) ((n <= 8) ? PyDict_New() : _PyDict_NewPresized(n))
872#define __Pyx_PyDict_NewPresized(n) PyDict_New()
874#define __Pyx_PyNumber_Divide(x,y) PyNumber_TrueDivide(x,y)
875#define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceTrueDivide(x,y)
876#if CYTHON_COMPILING_IN_CPYTHON && CYTHON_USE_UNICODE_INTERNALS
877#define __Pyx_PyDict_GetItemStrWithError(dict, name) _PyDict_GetItem_KnownHash(dict, name, ((PyASCIIObject *) name)->hash)
878static CYTHON_INLINE PyObject * __Pyx_PyDict_GetItemStr(PyObject *dict, PyObject *name) {
879 PyObject *res = __Pyx_PyDict_GetItemStrWithError(dict, name);
880 if (res == NULL && PyErr_Occurred()) {
881 PyErr_WriteUnraisable(NULL);
885#elif !CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07020000
886#define __Pyx_PyDict_GetItemStrWithError PyDict_GetItemWithError
887#define __Pyx_PyDict_GetItemStr PyDict_GetItem
889static CYTHON_INLINE PyObject * __Pyx_PyDict_GetItemStrWithError(PyObject *dict, PyObject *name) {
890#if CYTHON_COMPILING_IN_PYPY
891 return PyDict_GetItem(dict, name);
894 PyDictObject *mp = (PyDictObject*) dict;
895 long hash = ((PyStringObject *) name)->ob_shash;
897 ep = (mp->ma_lookup)(mp, name, hash);
904#define __Pyx_PyDict_GetItemStr PyDict_GetItem
906#if CYTHON_USE_TYPE_SLOTS
907 #define __Pyx_PyType_GetFlags(tp) (((PyTypeObject *)tp)->tp_flags)
908 #define __Pyx_PyType_HasFeature(type, feature) ((__Pyx_PyType_GetFlags(type) & (feature)) != 0)
910 #define __Pyx_PyType_GetFlags(tp) (PyType_GetFlags((PyTypeObject *)tp))
911 #define __Pyx_PyType_HasFeature(type, feature) PyType_HasFeature(type, feature)
913#define __Pyx_PyObject_GetIterNextFunc(iterator) __Pyx_PyObject_GetSlot(iterator, tp_iternext, iternextfunc)
914#if CYTHON_USE_TYPE_SPECS
915#define __Pyx_PyHeapTypeObject_GC_Del(obj) {\
916 PyTypeObject *type = Py_TYPE((PyObject*)obj);\
917 assert(__Pyx_PyType_HasFeature(type, Py_TPFLAGS_HEAPTYPE));\
918 PyObject_GC_Del(obj);\
922#define __Pyx_PyHeapTypeObject_GC_Del(obj) PyObject_GC_Del(obj)
924#if CYTHON_COMPILING_IN_LIMITED_API
925 #define __Pyx_PyUnicode_READY(op) (0)
926 #define __Pyx_PyUnicode_READ_CHAR(u, i) PyUnicode_ReadChar(u, i)
927 #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u) ((void)u, 1114111U)
928 #define __Pyx_PyUnicode_KIND(u) ((void)u, (0))
929 #define __Pyx_PyUnicode_KIND_04(u) __Pyx_PyUnicode_KIND(u)
930 #define __Pyx_PyUnicode_DATA(u) ((void*)u)
931 #define __Pyx_PyUnicode_READ(k, d, i) ((void)k, PyUnicode_ReadChar((PyObject*)(d), i))
932 #define __Pyx_PyUnicode_IS_TRUE(u) (0 != PyUnicode_GetLength(u))
934 #if PY_VERSION_HEX >= 0x030C0000
935 #define __Pyx_PyUnicode_READY(op) (0)
937 #define __Pyx_PyUnicode_READY(op) (likely(PyUnicode_IS_READY(op)) ?\
938 0 : _PyUnicode_Ready((PyObject *)(op)))
940 #define __Pyx_PyUnicode_READ_CHAR(u, i) PyUnicode_READ_CHAR(u, i)
941 #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u) PyUnicode_MAX_CHAR_VALUE(u)
942 #define __Pyx_PyUnicode_KIND(u) ((int)PyUnicode_KIND(u))
943 #define __Pyx_PyUnicode_DATA(u) PyUnicode_DATA(u)
944 #define __Pyx_PyUnicode_READ(k, d, i) PyUnicode_READ(k, d, i)
945 #define __Pyx_PyUnicode_WRITE(k, d, i, ch) PyUnicode_WRITE(k, d, i, (Py_UCS4) ch)
946 #if PY_VERSION_HEX >= 0x030C0000
947 #define __Pyx_PyUnicode_IS_TRUE(u) (0 != PyUnicode_GET_LENGTH(u))
949 #if CYTHON_COMPILING_IN_CPYTHON
950 #define __Pyx_PyUnicode_IS_TRUE(u) (0 != (likely(PyUnicode_IS_READY(u)) ? PyUnicode_GET_LENGTH(u) : ((PyCompactUnicodeObject *)(u))->wstr_length))
952 #define __Pyx_PyUnicode_IS_TRUE(u) (0 != (likely(PyUnicode_IS_READY(u)) ? PyUnicode_GET_LENGTH(u) : PyUnicode_GET_SIZE(u)))
955 static CYTHON_INLINE
int __Pyx_PyUnicode_KIND_04(PyObject *o) {
956 return __Pyx_PyUnicode_KIND(o) - (int) !!PyUnicode_IS_ASCII(o);
959#if CYTHON_COMPILING_IN_PYPY
960 #define __Pyx_PyUnicode_Concat(a, b) PyNumber_Add(a, b)
961 #define __Pyx_PyUnicode_ConcatSafe(a, b) PyNumber_Add(a, b)
963 #define __Pyx_PyUnicode_Concat(a, b) PyUnicode_Concat(a, b)
964 #define __Pyx_PyUnicode_ConcatSafe(a, b) ((unlikely((a) == Py_None) || unlikely((b) == Py_None)) ?\
965 PyNumber_Add(a, b) : __Pyx_PyUnicode_Concat(a, b))
967#if CYTHON_COMPILING_IN_PYPY
968 #if !defined(PyUnicode_DecodeUnicodeEscape)
969 #define PyUnicode_DecodeUnicodeEscape(s, size, errors) PyUnicode_Decode(s, size, "unicode_escape", errors)
971 #if !defined(PyUnicode_Contains)
972 #define PyUnicode_Contains(u, s) PySequence_Contains(u, s)
974 #if !defined(PyByteArray_Check)
975 #define PyByteArray_Check(obj) PyObject_TypeCheck(obj, &PyByteArray_Type)
977 #if !defined(PyObject_Format)
978 #define PyObject_Format(obj, fmt) PyObject_CallMethod(obj, "__format__", "O", fmt)
981#define __Pyx_PyUnicode_FormatSafe(a, b) ((unlikely((a) == Py_None || (PyUnicode_Check(b) && !PyUnicode_CheckExact(b)))) ? PyNumber_Remainder(a, b) : PyUnicode_Format(a, b))
982#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
983 #define __Pyx_PySequence_ListKeepNew(obj)\
984 (likely(PyList_CheckExact(obj) && PyUnstable_Object_IsUniquelyReferenced(obj)) ? __Pyx_NewRef(obj) : PySequence_List(obj))
985#elif CYTHON_COMPILING_IN_CPYTHON
986 #define __Pyx_PySequence_ListKeepNew(obj)\
987 (likely(PyList_CheckExact(obj) && Py_REFCNT(obj) == 1) ? __Pyx_NewRef(obj) : PySequence_List(obj))
989 #define __Pyx_PySequence_ListKeepNew(obj) PySequence_List(obj)
991#ifndef PySet_CheckExact
992 #define PySet_CheckExact(obj) Py_IS_TYPE(obj, &PySet_Type)
994enum __Pyx_ReferenceSharing {
995 __Pyx_ReferenceSharing_DefinitelyUnique,
996 __Pyx_ReferenceSharing_OwnStrongReference,
997 __Pyx_ReferenceSharing_FunctionArgument,
998 __Pyx_ReferenceSharing_SharedReference,
1000#if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING && PY_VERSION_HEX >= 0x030E0000
1001#define __Pyx_IS_UNIQUELY_REFERENCED(o, sharing)\
1002 (sharing == __Pyx_ReferenceSharing_DefinitelyUnique ? 1 :\
1003 (sharing == __Pyx_ReferenceSharing_FunctionArgument ? PyUnstable_Object_IsUniqueReferencedTemporary(o) :\
1004 (sharing == __Pyx_ReferenceSharing_OwnStrongReference ? PyUnstable_Object_IsUniquelyReferenced(o) : 0)))
1005#elif (CYTHON_COMPILING_IN_CPYTHON && !CYTHON_COMPILING_IN_CPYTHON_FREETHREADING) || CYTHON_COMPILING_IN_LIMITED_API
1006#define __Pyx_IS_UNIQUELY_REFERENCED(o, sharing) (((void)sharing), Py_REFCNT(o) == 1)
1008#define __Pyx_IS_UNIQUELY_REFERENCED(o, sharing) (((void)o), ((void)sharing), 0)
1010#if __PYX_LIMITED_VERSION_HEX >= 0x030d0000
1011 #define __Pyx_PyList_GetItemRef(o, i) PyList_GetItemRef(o, i)
1012#elif CYTHON_AVOID_BORROWED_REFS || CYTHON_AVOID_THREAD_UNSAFE_BORROWED_REFS
1013 #if CYTHON_COMPILING_IN_LIMITED_API || !CYTHON_ASSUME_SAFE_MACROS
1014 #define __Pyx_PyList_GetItemRef(o, i) (likely((i) >= 0) ? PySequence_GetItem(o, i) : (PyErr_SetString(PyExc_IndexError, "list index out of range"), (PyObject*)NULL))
1016 #define __Pyx_PyList_GetItemRef(o, i) PySequence_ITEM(o, i)
1018#elif CYTHON_COMPILING_IN_LIMITED_API || !(CYTHON_ASSUME_SAFE_MACROS && CYTHON_ASSUME_SAFE_SIZE)
1019 #define __Pyx_PyList_GetItemRef(o, i) __Pyx_XNewRef(PyList_GetItem(o, i))
1021 #define __Pyx_PyList_GetItemRef(o, i) (likely(__Pyx_is_valid_index(i, PyList_GET_SIZE(o))) ?\
1022 __Pyx_NewRef(PyList_GET_ITEM(o, i)) : (PyErr_SetString(PyExc_IndexError, "list index out of range"), (PyObject*)NULL))
1024#if CYTHON_AVOID_BORROWED_REFS || CYTHON_COMPILING_IN_LIMITED_API
1025 #define __Pyx_PyList_GET_ITEM_REF(o, i, unsafe_shared) ((void)(unsafe_shared),\
1026 __Pyx_PyList_GetItemRef(o, i))
1027#elif CYTHON_AVOID_THREAD_UNSAFE_BORROWED_REFS
1028 #if CYTHON_ASSUME_SAFE_MACROS
1029 #define __Pyx_PyList_GET_ITEM_REF(o, i, unsafe_shared) (\
1030 __Pyx_IS_UNIQUELY_REFERENCED(o, unsafe_shared) ?\
1031 __Pyx_NewRef(PyList_GET_ITEM(o, i)) : __Pyx_PyList_GetItemRef(o, i))
1033 #define __Pyx_PyList_GET_ITEM_REF(o, i, unsafe_shared) (\
1034 __Pyx_IS_UNIQUELY_REFERENCED(o, unsafe_shared) ?\
1035 __Pyx_XNewRef(PyList_GetItem(o, i)) : __Pyx_PyList_GetItemRef(o, i))
1037#elif CYTHON_ASSUME_SAFE_MACROS
1038 #define __Pyx_PyList_GET_ITEM_REF(o, i, unsafe_shared) ((void)(unsafe_shared),\
1039 __Pyx_NewRef(PyList_GET_ITEM(o, i)))
1041 #define __Pyx_PyList_GET_ITEM_REF(o, i, unsafe_shared) ((void)(unsafe_shared),\
1042 __Pyx_XNewRef(PyList_GetItem(o, i)))
1044#if __PYX_LIMITED_VERSION_HEX >= 0x030d0000
1045#define __Pyx_PyDict_GetItemRef(dict, key, result) PyDict_GetItemRef(dict, key, result)
1046#elif CYTHON_AVOID_BORROWED_REFS || CYTHON_AVOID_THREAD_UNSAFE_BORROWED_REFS
1047static CYTHON_INLINE
int __Pyx_PyDict_GetItemRef(PyObject *dict, PyObject *key, PyObject **result) {
1048 *result = PyObject_GetItem(dict, key);
1049 if (*result == NULL) {
1050 if (PyErr_ExceptionMatches(PyExc_KeyError)) {
1059static CYTHON_INLINE
int __Pyx_PyDict_GetItemRef(PyObject *dict, PyObject *key, PyObject **result) {
1060 *result = PyDict_GetItemWithError(dict, key);
1061 if (*result == NULL) {
1062 return PyErr_Occurred() ? -1 : 0;
1068#if defined(CYTHON_DEBUG_VISIT_CONST) && CYTHON_DEBUG_VISIT_CONST
1069 #define __Pyx_VISIT_CONST(obj) Py_VISIT(obj)
1071 #define __Pyx_VISIT_CONST(obj)
1073#if CYTHON_ASSUME_SAFE_MACROS
1074 #define __Pyx_PySequence_ITEM(o, i) PySequence_ITEM(o, i)
1075 #define __Pyx_PySequence_SIZE(seq) Py_SIZE(seq)
1076 #define __Pyx_PyTuple_SET_ITEM(o, i, v) (PyTuple_SET_ITEM(o, i, v), (0))
1077 #define __Pyx_PyTuple_GET_ITEM(o, i) PyTuple_GET_ITEM(o, i)
1078 #define __Pyx_PyList_SET_ITEM(o, i, v) (PyList_SET_ITEM(o, i, v), (0))
1079 #define __Pyx_PyList_GET_ITEM(o, i) PyList_GET_ITEM(o, i)
1081 #define __Pyx_PySequence_ITEM(o, i) PySequence_GetItem(o, i)
1082 #define __Pyx_PySequence_SIZE(seq) PySequence_Size(seq)
1083 #define __Pyx_PyTuple_SET_ITEM(o, i, v) PyTuple_SetItem(o, i, v)
1084 #define __Pyx_PyTuple_GET_ITEM(o, i) PyTuple_GetItem(o, i)
1085 #define __Pyx_PyList_SET_ITEM(o, i, v) PyList_SetItem(o, i, v)
1086 #define __Pyx_PyList_GET_ITEM(o, i) PyList_GetItem(o, i)
1088#if CYTHON_ASSUME_SAFE_SIZE
1089 #define __Pyx_PyTuple_GET_SIZE(o) PyTuple_GET_SIZE(o)
1090 #define __Pyx_PyList_GET_SIZE(o) PyList_GET_SIZE(o)
1091 #define __Pyx_PySet_GET_SIZE(o) PySet_GET_SIZE(o)
1092 #define __Pyx_PyDict_GET_SIZE(o) PyDict_GET_SIZE(o)
1093 #define __Pyx_PyBytes_GET_SIZE(o) PyBytes_GET_SIZE(o)
1094 #define __Pyx_PyByteArray_GET_SIZE(o) PyByteArray_GET_SIZE(o)
1095 #define __Pyx_PyUnicode_GET_LENGTH(o) PyUnicode_GET_LENGTH(o)
1097 #define __Pyx_PyTuple_GET_SIZE(o) PyTuple_Size(o)
1098 #define __Pyx_PyList_GET_SIZE(o) PyList_Size(o)
1099 #define __Pyx_PySet_GET_SIZE(o) PySet_Size(o)
1100 #define __Pyx_PyDict_GET_SIZE(o) PyDict_Size(o)
1101 #define __Pyx_PyBytes_GET_SIZE(o) PyBytes_Size(o)
1102 #define __Pyx_PyByteArray_GET_SIZE(o) PyByteArray_Size(o)
1103 #define __Pyx_PyUnicode_GET_LENGTH(o) PyUnicode_GetLength(o)
1105#if CYTHON_COMPILING_IN_PYPY && !defined(PyUnicode_InternFromString)
1106 #define PyUnicode_InternFromString(s) PyUnicode_FromString(s)
1108#define __Pyx_PyLong_FromHash_t PyLong_FromSsize_t
1109#define __Pyx_PyLong_AsHash_t __Pyx_PyIndex_AsSsize_t
1110#if __PYX_LIMITED_VERSION_HEX >= 0x030A0000
1111 #define __Pyx_PySendResult PySendResult
1117 } __Pyx_PySendResult;
1119#if CYTHON_COMPILING_IN_LIMITED_API || PY_VERSION_HEX < 0x030A00A3
1120 typedef __Pyx_PySendResult (*__Pyx_pyiter_sendfunc)(PyObject *iter, PyObject *value, PyObject **result);
1122 #define __Pyx_pyiter_sendfunc sendfunc
1124#if !CYTHON_USE_AM_SEND
1125#define __PYX_HAS_PY_AM_SEND 0
1126#elif __PYX_LIMITED_VERSION_HEX >= 0x030A0000
1127#define __PYX_HAS_PY_AM_SEND 1
1129#define __PYX_HAS_PY_AM_SEND 2
1131#if __PYX_HAS_PY_AM_SEND < 2
1132 #define __Pyx_PyAsyncMethodsStruct PyAsyncMethods
1138 __Pyx_pyiter_sendfunc am_send;
1139 } __Pyx_PyAsyncMethodsStruct;
1140 #define __Pyx_SlotTpAsAsync(s) ((PyAsyncMethods*)(s))
1142#if CYTHON_USE_AM_SEND && PY_VERSION_HEX < 0x030A00F0
1143 #define __Pyx_TPFLAGS_HAVE_AM_SEND (1UL << 21)
1145 #define __Pyx_TPFLAGS_HAVE_AM_SEND (0)
1147#if CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030A0000
1151PyAPI_FUNC(
void *) PyMem_Calloc(
size_t nelem,
size_t elsize);
1153#if CYTHON_COMPILING_IN_LIMITED_API
1154static int __Pyx_init_co_variable(PyObject *inspect,
const char* name,
int *write_to) {
1156 PyObject *py_value = PyObject_GetAttrString(inspect, name);
1157 if (!py_value)
return 0;
1158 value = (int) PyLong_AsLong(py_value);
1159 Py_DECREF(py_value);
1161 return value != -1 || !PyErr_Occurred();
1163static int __Pyx_init_co_variables(
void) {
1166 inspect = PyImport_ImportModule(
"inspect");
1168#if !defined(CO_OPTIMIZED)
1169 __Pyx_init_co_variable(inspect,
"CO_OPTIMIZED", &CO_OPTIMIZED) &&
1171#if !defined(CO_NEWLOCALS)
1172 __Pyx_init_co_variable(inspect,
"CO_NEWLOCALS", &CO_NEWLOCALS) &&
1174#if !defined(CO_VARARGS)
1175 __Pyx_init_co_variable(inspect,
"CO_VARARGS", &CO_VARARGS) &&
1177#if !defined(CO_VARKEYWORDS)
1178 __Pyx_init_co_variable(inspect,
"CO_VARKEYWORDS", &CO_VARKEYWORDS) &&
1180#if !defined(CO_ASYNC_GENERATOR)
1181 __Pyx_init_co_variable(inspect,
"CO_ASYNC_GENERATOR", &CO_ASYNC_GENERATOR) &&
1183#if !defined(CO_GENERATOR)
1184 __Pyx_init_co_variable(inspect,
"CO_GENERATOR", &CO_GENERATOR) &&
1186#if !defined(CO_COROUTINE)
1187 __Pyx_init_co_variable(inspect,
"CO_COROUTINE", &CO_COROUTINE) &&
1191 return result ? 0 : -1;
1193static int __Pyx_init_tpflags_bitcount(
unsigned long flag) {
1196 count += (int) (flag & 1);
1201static int __Pyx_init_tpflags_variables(
void) {
1202 if (__Pyx_Runtime_TPFLAGS_SEQUENCE != 0 && __Pyx_Runtime_TPFLAGS_MAPPING != 0) {
1205 PyObject *collections_abc = PyImport_ImportModule(
"collections.abc");
1206 if (!collections_abc)
return -1;
1208 PyObject *sequence = NULL, *mapping = NULL;
1209#if __PYX_LIMITED_VERSION_HEX >= 0x030D0000
1210 if (PyObject_GetOptionalAttrString(collections_abc,
"Sequence", &sequence) != 1)
goto fail;
1211 if (PyObject_GetOptionalAttrString(collections_abc,
"Mapping", &mapping) != 1)
goto fail;
1213 sequence = PyObject_GetAttrString(collections_abc,
"Sequence");
1214 if (!sequence)
goto fail_attr_lookup;
1215 mapping = PyObject_GetAttrString(collections_abc,
"Mapping");
1216 if (!mapping)
goto fail_attr_lookup;
1218 if (!PyType_Check(sequence) || !PyType_Check(mapping))
goto fail;
1220 unsigned long sequence_flags = PyType_GetFlags((PyTypeObject*)sequence);
1221 unsigned long mapping_flags = PyType_GetFlags((PyTypeObject*)mapping);
1222 unsigned long mutual_flags = sequence_flags & mapping_flags;
1223 sequence_flags = sequence_flags ^ mutual_flags;
1224 mapping_flags = mapping_flags ^ mutual_flags;
1225 if (__Pyx_Runtime_TPFLAGS_SEQUENCE == 0 && __Pyx_init_tpflags_bitcount(sequence_flags) == 1) {
1226 __Pyx_Runtime_TPFLAGS_SEQUENCE = sequence_flags;
1228 if (__Pyx_Runtime_TPFLAGS_MAPPING == 0 && __Pyx_init_tpflags_bitcount(mapping_flags) == 1) {
1229 __Pyx_Runtime_TPFLAGS_MAPPING = mapping_flags;
1233 Py_XDECREF(mapping);
1234 Py_XDECREF(sequence);
1235 Py_DECREF(collections_abc);
1237#if __PYX_LIMITED_VERSION_HEX < 0x030D0000
1239 if (PyErr_ExceptionMatches(PyExc_AttributeError)) {
1244 result = PyErr_Occurred() ? -1 : 0;
1248static int __Pyx_init_co_variables(
void) {
1251static int __Pyx_init_tpflags_variables(
void) {
1257#if defined(_WIN32) || defined(WIN32) || defined(MS_WINDOWS)
1258 #ifndef _USE_MATH_DEFINES
1259 #define _USE_MATH_DEFINES
1263#if defined(__CYGWIN__) && defined(_LDBL_EQ_DBL)
1264#define __Pyx_truncl trunc
1266#define __Pyx_truncl truncl
1269#ifndef CYTHON_CLINE_IN_TRACEBACK_RUNTIME
1270#define CYTHON_CLINE_IN_TRACEBACK_RUNTIME 1
1272#ifndef CYTHON_CLINE_IN_TRACEBACK
1273#define CYTHON_CLINE_IN_TRACEBACK CYTHON_CLINE_IN_TRACEBACK_RUNTIME
1275#if CYTHON_CLINE_IN_TRACEBACK
1276#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; }
1278#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; }
1280#define __PYX_ERR(f_index, lineno, Ln_error) \
1281 { __PYX_MARK_ERR_POS(f_index, lineno) goto Ln_error; }
1283#ifdef CYTHON_EXTERN_C
1284 #undef __PYX_EXTERN_C
1285 #define __PYX_EXTERN_C CYTHON_EXTERN_C
1286#elif defined(__PYX_EXTERN_C)
1288 #pragma message ("Please do not define the '__PYX_EXTERN_C' macro externally. Use 'CYTHON_EXTERN_C' instead.")
1290 #warning Please do not define the '__PYX_EXTERN_C' macro externally. Use 'CYTHON_EXTERN_C' instead.
1294 #define __PYX_EXTERN_C extern "C"
1296 #define __PYX_EXTERN_C extern
1300#define __PYX_HAVE__clapack
1301#define __PYX_HAVE_API__clapack
1308#include "numpy/arrayobject.h"
1309#include "numpy/ndarrayobject.h"
1310#include "numpy/ndarraytypes.h"
1311#include "numpy/arrayscalars.h"
1312#include "numpy/ufuncobject.h"
1319#if defined(PYREX_WITHOUT_ASSERTIONS) && !defined(CYTHON_WITHOUT_ASSERTIONS)
1320#define CYTHON_WITHOUT_ASSERTIONS
1323#ifdef CYTHON_FREETHREADING_COMPATIBLE
1324#if CYTHON_FREETHREADING_COMPATIBLE
1325#define __Pyx_FREETHREADING_COMPATIBLE Py_MOD_GIL_NOT_USED
1327#define __Pyx_FREETHREADING_COMPATIBLE Py_MOD_GIL_USED
1330#define __Pyx_FREETHREADING_COMPATIBLE Py_MOD_GIL_USED
1332#define __PYX_DEFAULT_STRING_ENCODING_IS_ASCII 0
1333#define __PYX_DEFAULT_STRING_ENCODING_IS_UTF8 0
1334#define __PYX_DEFAULT_STRING_ENCODING ""
1335#define __Pyx_PyObject_FromString __Pyx_PyBytes_FromString
1336#define __Pyx_PyObject_FromStringAndSize __Pyx_PyBytes_FromStringAndSize
1337#define __Pyx_uchar_cast(c) ((unsigned char)c)
1338#define __Pyx_long_cast(x) ((long)x)
1339#define __Pyx_fits_Py_ssize_t(v, type, is_signed) (\
1340 (sizeof(type) < sizeof(Py_ssize_t)) ||\
1341 (sizeof(type) > sizeof(Py_ssize_t) &&\
1342 likely(v < (type)PY_SSIZE_T_MAX ||\
1343 v == (type)PY_SSIZE_T_MAX) &&\
1344 (!is_signed || likely(v > (type)PY_SSIZE_T_MIN ||\
1345 v == (type)PY_SSIZE_T_MIN))) ||\
1346 (sizeof(type) == sizeof(Py_ssize_t) &&\
1347 (is_signed || likely(v < (type)PY_SSIZE_T_MAX ||\
1348 v == (type)PY_SSIZE_T_MAX))) )
1349static CYTHON_INLINE
int __Pyx_is_valid_index(Py_ssize_t i, Py_ssize_t limit) {
1350 return (
size_t) i < (size_t) limit;
1352#if defined (__cplusplus) && __cplusplus >= 201103L
1354 #define __Pyx_sst_abs(value) std::abs(value)
1355#elif SIZEOF_INT >= SIZEOF_SIZE_T
1356 #define __Pyx_sst_abs(value) abs(value)
1357#elif SIZEOF_LONG >= SIZEOF_SIZE_T
1358 #define __Pyx_sst_abs(value) labs(value)
1359#elif defined (_MSC_VER)
1360 #define __Pyx_sst_abs(value) ((Py_ssize_t)_abs64(value))
1361#elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
1362 #define __Pyx_sst_abs(value) llabs(value)
1363#elif defined (__GNUC__)
1364 #define __Pyx_sst_abs(value) __builtin_llabs(value)
1366 #define __Pyx_sst_abs(value) ((value<0) ? -value : value)
1368static CYTHON_INLINE Py_ssize_t __Pyx_ssize_strlen(
const char *
s);
1369static CYTHON_INLINE
const char* __Pyx_PyObject_AsString(PyObject*);
1370static CYTHON_INLINE
const char* __Pyx_PyObject_AsStringAndSize(PyObject*, Py_ssize_t* length);
1371static CYTHON_INLINE PyObject* __Pyx_PyByteArray_FromString(
const char*);
1372#define __Pyx_PyByteArray_FromStringAndSize(s, l) PyByteArray_FromStringAndSize((const char*)s, l)
1373#define __Pyx_PyBytes_FromString PyBytes_FromString
1374#define __Pyx_PyBytes_FromStringAndSize PyBytes_FromStringAndSize
1375static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(
const char*);
1376#if CYTHON_ASSUME_SAFE_MACROS
1377 #define __Pyx_PyBytes_AsWritableString(s) ((char*) PyBytes_AS_STRING(s))
1378 #define __Pyx_PyBytes_AsWritableSString(s) ((signed char*) PyBytes_AS_STRING(s))
1379 #define __Pyx_PyBytes_AsWritableUString(s) ((unsigned char*) PyBytes_AS_STRING(s))
1380 #define __Pyx_PyBytes_AsString(s) ((const char*) PyBytes_AS_STRING(s))
1381 #define __Pyx_PyBytes_AsSString(s) ((const signed char*) PyBytes_AS_STRING(s))
1382 #define __Pyx_PyBytes_AsUString(s) ((const unsigned char*) PyBytes_AS_STRING(s))
1383 #define __Pyx_PyByteArray_AsString(s) PyByteArray_AS_STRING(s)
1385 #define __Pyx_PyBytes_AsWritableString(s) ((char*) PyBytes_AsString(s))
1386 #define __Pyx_PyBytes_AsWritableSString(s) ((signed char*) PyBytes_AsString(s))
1387 #define __Pyx_PyBytes_AsWritableUString(s) ((unsigned char*) PyBytes_AsString(s))
1388 #define __Pyx_PyBytes_AsString(s) ((const char*) PyBytes_AsString(s))
1389 #define __Pyx_PyBytes_AsSString(s) ((const signed char*) PyBytes_AsString(s))
1390 #define __Pyx_PyBytes_AsUString(s) ((const unsigned char*) PyBytes_AsString(s))
1391 #define __Pyx_PyByteArray_AsString(s) PyByteArray_AsString(s)
1393#define __Pyx_PyObject_AsWritableString(s) ((char*)(__pyx_uintptr_t) __Pyx_PyObject_AsString(s))
1394#define __Pyx_PyObject_AsWritableSString(s) ((signed char*)(__pyx_uintptr_t) __Pyx_PyObject_AsString(s))
1395#define __Pyx_PyObject_AsWritableUString(s) ((unsigned char*)(__pyx_uintptr_t) __Pyx_PyObject_AsString(s))
1396#define __Pyx_PyObject_AsSString(s) ((const signed char*) __Pyx_PyObject_AsString(s))
1397#define __Pyx_PyObject_AsUString(s) ((const unsigned char*) __Pyx_PyObject_AsString(s))
1398#define __Pyx_PyObject_FromCString(s) __Pyx_PyObject_FromString((const char*)s)
1399#define __Pyx_PyBytes_FromCString(s) __Pyx_PyBytes_FromString((const char*)s)
1400#define __Pyx_PyByteArray_FromCString(s) __Pyx_PyByteArray_FromString((const char*)s)
1401#define __Pyx_PyUnicode_FromCString(s) __Pyx_PyUnicode_FromString((const char*)s)
1402#define __Pyx_PyUnicode_FromOrdinal(o) PyUnicode_FromOrdinal((int)o)
1403#define __Pyx_PyUnicode_AsUnicode PyUnicode_AsUnicode
1404static CYTHON_INLINE PyObject *__Pyx_NewRef(PyObject *obj) {
1405#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030a0000 || defined(Py_NewRef)
1406 return Py_NewRef(obj);
1412static CYTHON_INLINE PyObject *__Pyx_XNewRef(PyObject *obj) {
1413#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030a0000 || defined(Py_XNewRef)
1414 return Py_XNewRef(obj);
1420static CYTHON_INLINE PyObject *__Pyx_Owned_Py_None(
int b);
1421static CYTHON_INLINE PyObject * __Pyx_PyBool_FromLong(
long b);
1422static CYTHON_INLINE
int __Pyx_PyObject_IsTrue(PyObject*);
1423static CYTHON_INLINE
int __Pyx_PyObject_IsTrueAndDecref(PyObject*);
1424static CYTHON_INLINE PyObject* __Pyx_PyNumber_Long(PyObject* x);
1425#define __Pyx_PyObject_RichCompareBool(a,b,cmp) __Pyx_PyObject_IsTrueAndDecref(PyObject_RichCompare((a),(b),(cmp)))
1426#define __Pyx_PySequence_Tuple(obj)\
1427 (likely(PyTuple_CheckExact(obj)) ? __Pyx_NewRef(obj) : PySequence_Tuple(obj))
1428static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject*);
1429static CYTHON_INLINE PyObject * __Pyx_PyLong_FromSize_t(
size_t);
1430static CYTHON_INLINE Py_hash_t __Pyx_PyIndex_AsHash_t(PyObject*);
1431#if CYTHON_ASSUME_SAFE_MACROS
1432#define __Pyx_PyFloat_AsDouble(x) (PyFloat_CheckExact(x) ? PyFloat_AS_DOUBLE(x) : PyFloat_AsDouble(x))
1433#define __Pyx_PyFloat_AS_DOUBLE(x) PyFloat_AS_DOUBLE(x)
1434#define __Pyx_PyFloat_IsNonZero(x) (PyFloat_AS_DOUBLE(x) != 0.0)
1436#define __Pyx_PyFloat_AsDouble(x) PyFloat_AsDouble(x)
1437#define __Pyx_PyFloat_AS_DOUBLE(x) PyFloat_AsDouble(x)
1438#define __Pyx_PyFloat_IsNonZero(x) PyObject_IsTrue(x)
1440#define __Pyx_PyFloat_AsFloat(x) ((float) __Pyx_PyFloat_AsDouble(x))
1441#define __Pyx_PyNumber_Int(x) (PyLong_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Long(x))
1442#if CYTHON_USE_PYLONG_INTERNALS
1443 #if PY_VERSION_HEX >= 0x030C00A7
1444 #ifndef _PyLong_SIGN_MASK
1445 #define _PyLong_SIGN_MASK 3
1447 #ifndef _PyLong_NON_SIZE_BITS
1448 #define _PyLong_NON_SIZE_BITS 3
1450 #define __Pyx_PyLong_SignBits(x) ((int) (((PyLongObject*)x)->long_value.lv_tag & _PyLong_SIGN_MASK))
1451 #define __Pyx_PyLong_Sign(x) (1 - __Pyx_PyLong_SignBits(x))
1452 #define __Pyx_PyLong_IsNeg(x) ((__Pyx_PyLong_SignBits(x) & 2) != 0)
1453 #define __Pyx_PyLong_IsNonNeg(x) (!__Pyx_PyLong_IsNeg(x))
1454 #define __Pyx_PyLong_IsZero(x) (__Pyx_PyLong_SignBits(x) & 1)
1455 #define __Pyx_PyLong_IsPos(x) (__Pyx_PyLong_SignBits(x) == 0)
1456 #define __Pyx_PyLong_CompactValueUnsigned(x) (__Pyx_PyLong_Digits(x)[0])
1457 #define __Pyx_PyLong_DigitCount(x) ((Py_ssize_t) (((PyLongObject*)x)->long_value.lv_tag >> _PyLong_NON_SIZE_BITS))
1458 #define __Pyx_PyLong_SignedDigitCount(x)\
1459 (((Py_ssize_t) __Pyx_PyLong_Sign(x)) * __Pyx_PyLong_DigitCount(x))
1460 #if defined(PyUnstable_Long_IsCompact) && defined(PyUnstable_Long_CompactValue)
1461 #define __Pyx_PyLong_IsCompact(x) PyUnstable_Long_IsCompact((PyLongObject*) x)
1462 #define __Pyx_PyLong_CompactValue(x) PyUnstable_Long_CompactValue((PyLongObject*) x)
1464 #define __Pyx_PyLong_IsCompact(x) (((PyLongObject*)x)->long_value.lv_tag < (2 << _PyLong_NON_SIZE_BITS))
1465 #define __Pyx_PyLong_CompactValue(x) (((Py_ssize_t) __Pyx_PyLong_Sign(x)) * (Py_ssize_t) __Pyx_PyLong_Digits(x)[0])
1467 static CYTHON_INLINE Py_ssize_t __Pyx_PyLong_CompareSignAndSize(PyObject *a, PyObject *b) {
1468 uintptr_t tag_a = ((PyLongObject*)a)->long_value.lv_tag;
1469 uintptr_t tag_b = ((PyLongObject*)b)->long_value.lv_tag;
1470 if (tag_a == tag_b)
return 0;
1471 int sign_a = (int) (tag_a & _PyLong_SIGN_MASK);
1472 int sign_b = (int) (tag_b & _PyLong_SIGN_MASK);
1473 if (sign_a > sign_b)
return -1;
1474 if (sign_a < sign_b)
return 1;
1475 Py_ssize_t size_a = (Py_ssize_t) (tag_a >> _PyLong_NON_SIZE_BITS);
1476 Py_ssize_t size_b = (Py_ssize_t) (tag_b >> _PyLong_NON_SIZE_BITS);
1477 return (1 - sign_a) * (size_a - size_b);
1479 typedef Py_ssize_t __Pyx_compact_pylong;
1480 typedef size_t __Pyx_compact_upylong;
1482 #define __Pyx_PyLong_Sign(x) ((int) ((Py_SIZE(x) == 0) ? 0 : (Py_SIZE(x) < 0) ? -1 : 1))
1483 #define __Pyx_PyLong_IsNeg(x) (Py_SIZE(x) < 0)
1484 #define __Pyx_PyLong_IsNonNeg(x) (Py_SIZE(x) >= 0)
1485 #define __Pyx_PyLong_IsZero(x) (Py_SIZE(x) == 0)
1486 #define __Pyx_PyLong_IsPos(x) (Py_SIZE(x) > 0)
1487 #define __Pyx_PyLong_CompactValueUnsigned(x) ((Py_SIZE(x) == 0) ? 0 : __Pyx_PyLong_Digits(x)[0])
1488 #define __Pyx_PyLong_DigitCount(x) __Pyx_sst_abs(Py_SIZE(x))
1489 #define __Pyx_PyLong_SignedDigitCount(x) Py_SIZE(x)
1490 #define __Pyx_PyLong_IsCompact(x) (Py_SIZE(x) == 0 || Py_SIZE(x) == 1 || Py_SIZE(x) == -1)
1491 #define __Pyx_PyLong_CompactValue(x)\
1492 ((Py_SIZE(x) == 0) ? (sdigit) 0 : ((Py_SIZE(x) < 0) ? -(sdigit)__Pyx_PyLong_Digits(x)[0] : (sdigit)__Pyx_PyLong_Digits(x)[0]))
1493 #define __Pyx_PyLong_CompareSignAndSize(a, b) (Py_SIZE(a) - Py_SIZE(b))
1494 typedef sdigit __Pyx_compact_pylong;
1495 typedef digit __Pyx_compact_upylong;
1497 #if PY_VERSION_HEX >= 0x030C00A5
1498 #define __Pyx_PyLong_Digits(x) (((PyLongObject*)x)->long_value.ob_digit)
1500 #define __Pyx_PyLong_Digits(x) (((PyLongObject*)x)->ob_digit)
1502 #define __Pyx_PyLong_IsNonZero(x) (!__Pyx_PyLong_IsZero(x))
1504 #define __Pyx_PyLong_IsNonZero(x) PyObject_IsTrue(x)
1506#if __PYX_DEFAULT_STRING_ENCODING_IS_UTF8
1507 #define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_DecodeUTF8(c_str, size, NULL)
1508#elif __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
1509 #define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_DecodeASCII(c_str, size, NULL)
1511 #define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_Decode(c_str, size, __PYX_DEFAULT_STRING_ENCODING, NULL)
1516#if defined(__GNUC__) && (__GNUC__ > 2 || (__GNUC__ == 2 && (__GNUC_MINOR__ > 95)))
1517 #define likely(x) __builtin_expect(!!(x), 1)
1518 #define unlikely(x) __builtin_expect(!!(x), 0)
1520 #define likely(x) (x)
1521 #define unlikely(x) (x)
1525#if __cplusplus > 201103L
1526#include <type_traits>
1528template <
typename T>
1529static void __Pyx_pretend_to_initialize(
T* ptr) {
1530#if __cplusplus > 201103L
1531 if ((std::is_trivially_default_constructible<T>::value))
1537static CYTHON_INLINE
void __Pyx_pretend_to_initialize(
void* ptr) { (void)ptr; }
1541#if !CYTHON_USE_MODULE_STATE
1542static PyObject *__pyx_m = NULL;
1544static const char *
const __pyx_cfilenm = __FILE__;
1547#if !defined(CYTHON_CCOMPLEX)
1548 #if defined(__cplusplus)
1549 #define CYTHON_CCOMPLEX 1
1550 #elif (defined(_Complex_I) && !defined(_MSC_VER)) || ((defined (__STDC_VERSION__) && __STDC_VERSION__ >= 201112L) && !defined(__STDC_NO_COMPLEX__) && !defined(_MSC_VER))
1551 #define CYTHON_CCOMPLEX 1
1553 #define CYTHON_CCOMPLEX 0
1560 #include <complex.h>
1563#if CYTHON_CCOMPLEX && !defined(__cplusplus) && defined(__sun__) && defined(__GNUC__)
1565 #define _Complex_I 1.0fj
1570static const char*
const __pyx_f[] = {
1571 "proteus/clapack.pyx",
1572 "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd",
1577#include <pythread.h>
1578#ifndef CYTHON_ATOMICS
1579 #define CYTHON_ATOMICS 1
1581#define __PYX_CYTHON_ATOMICS_ENABLED() CYTHON_ATOMICS
1582#define __PYX_GET_CYTHON_COMPILING_IN_CPYTHON_FREETHREADING() CYTHON_COMPILING_IN_CPYTHON_FREETHREADING
1583#define __pyx_atomic_int_type int
1584#define __pyx_nonatomic_int_type int
1585#if CYTHON_ATOMICS && (defined(__STDC_VERSION__) &&\
1586 (__STDC_VERSION__ >= 201112L) &&\
1587 !defined(__STDC_NO_ATOMICS__))
1588 #include <stdatomic.h>
1589#elif CYTHON_ATOMICS && (defined(__cplusplus) && (\
1590 (__cplusplus >= 201103L) ||\
1591 (defined(_MSC_VER) && _MSC_VER >= 1700)))
1594#if CYTHON_ATOMICS && (defined(__STDC_VERSION__) &&\
1595 (__STDC_VERSION__ >= 201112L) &&\
1596 !defined(__STDC_NO_ATOMICS__) &&\
1597 ATOMIC_INT_LOCK_FREE == 2)
1598 #undef __pyx_atomic_int_type
1599 #define __pyx_atomic_int_type atomic_int
1600 #define __pyx_atomic_ptr_type atomic_uintptr_t
1601 #define __pyx_nonatomic_ptr_type uintptr_t
1602 #define __pyx_atomic_incr_relaxed(value) atomic_fetch_add_explicit(value, 1, memory_order_relaxed)
1603 #define __pyx_atomic_incr_acq_rel(value) atomic_fetch_add_explicit(value, 1, memory_order_acq_rel)
1604 #define __pyx_atomic_decr_acq_rel(value) atomic_fetch_sub_explicit(value, 1, memory_order_acq_rel)
1605 #define __pyx_atomic_sub(value, arg) atomic_fetch_sub(value, arg)
1606 #define __pyx_atomic_int_cmp_exchange(value, expected, desired) atomic_compare_exchange_strong(value, expected, desired)
1607 #define __pyx_atomic_load(value) atomic_load(value)
1608 #define __pyx_atomic_store(value, new_value) atomic_store(value, new_value)
1609 #define __pyx_atomic_pointer_load_relaxed(value) atomic_load_explicit(value, memory_order_relaxed)
1610 #define __pyx_atomic_pointer_load_acquire(value) atomic_load_explicit(value, memory_order_acquire)
1611 #define __pyx_atomic_pointer_exchange(value, new_value) atomic_exchange(value, (__pyx_nonatomic_ptr_type)new_value)
1612 #define __pyx_atomic_pointer_cmp_exchange(value, expected, desired) atomic_compare_exchange_strong(value, expected, desired)
1613 #if defined(__PYX_DEBUG_ATOMICS) && defined(_MSC_VER)
1614 #pragma message ("Using standard C atomics")
1615 #elif defined(__PYX_DEBUG_ATOMICS)
1616 #warning "Using standard C atomics"
1618#elif CYTHON_ATOMICS && (defined(__cplusplus) && (\
1619 (__cplusplus >= 201103L) ||\
1621 (defined(_MSC_VER) && _MSC_VER >= 1700)) &&\
1622 ATOMIC_INT_LOCK_FREE == 2)
1623 #undef __pyx_atomic_int_type
1624 #define __pyx_atomic_int_type std::atomic_int
1625 #define __pyx_atomic_ptr_type std::atomic_uintptr_t
1626 #define __pyx_nonatomic_ptr_type uintptr_t
1627 #define __pyx_atomic_incr_relaxed(value) std::atomic_fetch_add_explicit(value, 1, std::memory_order_relaxed)
1628 #define __pyx_atomic_incr_acq_rel(value) std::atomic_fetch_add_explicit(value, 1, std::memory_order_acq_rel)
1629 #define __pyx_atomic_decr_acq_rel(value) std::atomic_fetch_sub_explicit(value, 1, std::memory_order_acq_rel)
1630 #define __pyx_atomic_sub(value, arg) std::atomic_fetch_sub(value, arg)
1631 #define __pyx_atomic_int_cmp_exchange(value, expected, desired) std::atomic_compare_exchange_strong(value, expected, desired)
1632 #define __pyx_atomic_load(value) std::atomic_load(value)
1633 #define __pyx_atomic_store(value, new_value) std::atomic_store(value, new_value)
1634 #define __pyx_atomic_pointer_load_relaxed(value) std::atomic_load_explicit(value, std::memory_order_relaxed)
1635 #define __pyx_atomic_pointer_load_acquire(value) std::atomic_load_explicit(value, std::memory_order_acquire)
1636 #define __pyx_atomic_pointer_exchange(value, new_value) std::atomic_exchange(value, (__pyx_nonatomic_ptr_type)new_value)
1637 #define __pyx_atomic_pointer_cmp_exchange(value, expected, desired) std::atomic_compare_exchange_strong(value, expected, desired)
1638 #if defined(__PYX_DEBUG_ATOMICS) && defined(_MSC_VER)
1639 #pragma message ("Using standard C++ atomics")
1640 #elif defined(__PYX_DEBUG_ATOMICS)
1641 #warning "Using standard C++ atomics"
1643#elif CYTHON_ATOMICS && (__GNUC__ >= 5 || (__GNUC__ == 4 &&\
1644 (__GNUC_MINOR__ > 1 ||\
1645 (__GNUC_MINOR__ == 1 && __GNUC_PATCHLEVEL__ >= 2))))
1646 #define __pyx_atomic_ptr_type void*
1647 #define __pyx_nonatomic_ptr_type void*
1648 #define __pyx_atomic_incr_relaxed(value) __sync_fetch_and_add(value, 1)
1649 #define __pyx_atomic_incr_acq_rel(value) __sync_fetch_and_add(value, 1)
1650 #define __pyx_atomic_decr_acq_rel(value) __sync_fetch_and_sub(value, 1)
1651 #define __pyx_atomic_sub(value, arg) __sync_fetch_and_sub(value, arg)
1652 static CYTHON_INLINE
int __pyx_atomic_int_cmp_exchange(__pyx_atomic_int_type* value, __pyx_nonatomic_int_type* expected, __pyx_nonatomic_int_type desired) {
1653 __pyx_nonatomic_int_type old = __sync_val_compare_and_swap(value, *expected, desired);
1654 int result = old == *expected;
1658 #define __pyx_atomic_load(value) __sync_fetch_and_add(value, 0)
1659 #define __pyx_atomic_store(value, new_value) __sync_lock_test_and_set(value, new_value)
1660 #define __pyx_atomic_pointer_load_relaxed(value) __sync_fetch_and_add(value, 0)
1661 #define __pyx_atomic_pointer_load_acquire(value) __sync_fetch_and_add(value, 0)
1662 #define __pyx_atomic_pointer_exchange(value, new_value) __sync_lock_test_and_set(value, (__pyx_atomic_ptr_type)new_value)
1663 static CYTHON_INLINE
int __pyx_atomic_pointer_cmp_exchange(__pyx_atomic_ptr_type* value, __pyx_nonatomic_ptr_type* expected, __pyx_nonatomic_ptr_type desired) {
1664 __pyx_nonatomic_ptr_type old = __sync_val_compare_and_swap(value, *expected, desired);
1665 int result = old == *expected;
1669 #ifdef __PYX_DEBUG_ATOMICS
1670 #warning "Using GNU atomics"
1672#elif CYTHON_ATOMICS && defined(_MSC_VER)
1674 #undef __pyx_atomic_int_type
1675 #define __pyx_atomic_int_type long
1676 #define __pyx_atomic_ptr_type void*
1677 #undef __pyx_nonatomic_int_type
1678 #define __pyx_nonatomic_int_type long
1679 #define __pyx_nonatomic_ptr_type void*
1680 #pragma intrinsic (_InterlockedExchangeAdd, _InterlockedExchange, _InterlockedCompareExchange, _InterlockedCompareExchangePointer, _InterlockedExchangePointer)
1681 #define __pyx_atomic_incr_relaxed(value) _InterlockedExchangeAdd(value, 1)
1682 #define __pyx_atomic_incr_acq_rel(value) _InterlockedExchangeAdd(value, 1)
1683 #define __pyx_atomic_decr_acq_rel(value) _InterlockedExchangeAdd(value, -1)
1684 #define __pyx_atomic_sub(value, arg) _InterlockedExchangeAdd(value, -arg)
1685 static CYTHON_INLINE
int __pyx_atomic_int_cmp_exchange(__pyx_atomic_int_type* value, __pyx_nonatomic_int_type* expected, __pyx_nonatomic_int_type desired) {
1686 __pyx_nonatomic_int_type old = _InterlockedCompareExchange(value, desired, *expected);
1687 int result = old == *expected;
1691 #define __pyx_atomic_load(value) _InterlockedExchangeAdd(value, 0)
1692 #define __pyx_atomic_store(value, new_value) _InterlockedExchange(value, new_value)
1693 #define __pyx_atomic_pointer_load_relaxed(value) *(void * volatile *)value
1694 #define __pyx_atomic_pointer_load_acquire(value) _InterlockedCompareExchangePointer(value, 0, 0)
1695 #define __pyx_atomic_pointer_exchange(value, new_value) _InterlockedExchangePointer(value, (__pyx_atomic_ptr_type)new_value)
1696 static CYTHON_INLINE
int __pyx_atomic_pointer_cmp_exchange(__pyx_atomic_ptr_type* value, __pyx_nonatomic_ptr_type* expected, __pyx_nonatomic_ptr_type desired) {
1697 __pyx_atomic_ptr_type old = _InterlockedCompareExchangePointer(value, desired, *expected);
1698 int result = old == *expected;
1702 #ifdef __PYX_DEBUG_ATOMICS
1703 #pragma message ("Using MSVC atomics")
1706 #undef CYTHON_ATOMICS
1707 #define CYTHON_ATOMICS 0
1708 #ifdef __PYX_DEBUG_ATOMICS
1709 #warning "Not using atomics"
1714#if !CYTHON_COMPILING_IN_CPYTHON_FREETHREADING
1715#define __Pyx_PyCriticalSection void*
1716#define __Pyx_PyCriticalSection2 void*
1717#define __Pyx_PyCriticalSection_End(cs)
1718#define __Pyx_PyCriticalSection2_End(cs)
1720#define __Pyx_PyCriticalSection PyCriticalSection
1721#define __Pyx_PyCriticalSection2 PyCriticalSection2
1722#define __Pyx_PyCriticalSection_End PyCriticalSection_End
1723#define __Pyx_PyCriticalSection2_End PyCriticalSection2_End
1727#if !CYTHON_COMPILING_IN_CPYTHON_FREETHREADING
1728#define __Pyx_PyCriticalSection_Begin(cs, arg) (void)(cs)
1729#define __Pyx_PyCriticalSection2_Begin(cs, arg1, arg2) (void)(cs)
1731#define __Pyx_PyCriticalSection_Begin PyCriticalSection_Begin
1732#define __Pyx_PyCriticalSection2_Begin PyCriticalSection2_Begin
1734#if PY_VERSION_HEX < 0x030d0000 || CYTHON_COMPILING_IN_LIMITED_API
1735#define __Pyx_BEGIN_CRITICAL_SECTION(o) {
1736#define __Pyx_END_CRITICAL_SECTION() }
1738#define __Pyx_BEGIN_CRITICAL_SECTION Py_BEGIN_CRITICAL_SECTION
1739#define __Pyx_END_CRITICAL_SECTION Py_END_CRITICAL_SECTION
1743#include <structmember.h>
1754typedef npy_int8 __pyx_t_5numpy_int8_t;
1763typedef npy_int16 __pyx_t_5numpy_int16_t;
1772typedef npy_int32 __pyx_t_5numpy_int32_t;
1781typedef npy_int64 __pyx_t_5numpy_int64_t;
1790typedef npy_uint8 __pyx_t_5numpy_uint8_t;
1799typedef npy_uint16 __pyx_t_5numpy_uint16_t;
1808typedef npy_uint32 __pyx_t_5numpy_uint32_t;
1817typedef npy_uint64 __pyx_t_5numpy_uint64_t;
1826typedef npy_float32 __pyx_t_5numpy_float32_t;
1835typedef npy_float64 __pyx_t_5numpy_float64_t;
1844typedef npy_longlong __pyx_t_5numpy_longlong_t;
1853typedef npy_ulonglong __pyx_t_5numpy_ulonglong_t;
1862typedef npy_intp __pyx_t_5numpy_intp_t;
1871typedef npy_uintp __pyx_t_5numpy_uintp_t;
1880typedef npy_double __pyx_t_5numpy_float_t;
1889typedef npy_double __pyx_t_5numpy_double_t;
1898typedef npy_longdouble __pyx_t_5numpy_longdouble_t;
1901#if CYTHON_CCOMPLEX && (1) && (!0 || __cplusplus)
1903 typedef ::std::complex< float > __pyx_t_float_complex;
1905 typedef float _Complex __pyx_t_float_complex;
1908 typedef struct {
float real, imag; } __pyx_t_float_complex;
1910static CYTHON_INLINE __pyx_t_float_complex __pyx_t_float_complex_from_parts(
float,
float);
1913#if CYTHON_CCOMPLEX && (1) && (!0 || __cplusplus)
1915 typedef ::std::complex< double > __pyx_t_double_complex;
1917 typedef double _Complex __pyx_t_double_complex;
1920 typedef struct {
double real, imag; } __pyx_t_double_complex;
1922static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(
double,
double);
1925#if CYTHON_CCOMPLEX && (1) && (!0 || __cplusplus)
1927 typedef ::std::complex< long double > __pyx_t_long_double_complex;
1929 typedef long double _Complex __pyx_t_long_double_complex;
1932 typedef struct {
long double real, imag; } __pyx_t_long_double_complex;
1934static CYTHON_INLINE __pyx_t_long_double_complex __pyx_t_long_double_complex_from_parts(
long double,
long double);
1943#ifndef CYTHON_REFNANNY
1944 #define CYTHON_REFNANNY 0
1948 void (*INCREF)(
void*, PyObject*, Py_ssize_t);
1949 void (*DECREF)(
void*, PyObject*, Py_ssize_t);
1950 void (*GOTREF)(
void*, PyObject*, Py_ssize_t);
1951 void (*GIVEREF)(
void*, PyObject*, Py_ssize_t);
1952 void* (*SetupContext)(
const char*, Py_ssize_t,
const char*);
1953 void (*FinishContext)(
void**);
1954 } __Pyx_RefNannyAPIStruct;
1955 static __Pyx_RefNannyAPIStruct *__Pyx_RefNanny = NULL;
1956 static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(
const char *modname);
1957 #define __Pyx_RefNannyDeclarations void *__pyx_refnanny = NULL;
1958 #define __Pyx_RefNannySetupContext(name, acquire_gil)\
1960 PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();\
1961 __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), (__LINE__), (__FILE__));\
1962 PyGILState_Release(__pyx_gilstate_save);\
1964 __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), (__LINE__), (__FILE__));\
1966 #define __Pyx_RefNannyFinishContextNogil() {\
1967 PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();\
1968 __Pyx_RefNannyFinishContext();\
1969 PyGILState_Release(__pyx_gilstate_save);\
1971 #define __Pyx_RefNannyFinishContextNogil() {\
1972 PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();\
1973 __Pyx_RefNannyFinishContext();\
1974 PyGILState_Release(__pyx_gilstate_save);\
1976 #define __Pyx_RefNannyFinishContext()\
1977 __Pyx_RefNanny->FinishContext(&__pyx_refnanny)
1978 #define __Pyx_INCREF(r) __Pyx_RefNanny->INCREF(__pyx_refnanny, (PyObject *)(r), (__LINE__))
1979 #define __Pyx_DECREF(r) __Pyx_RefNanny->DECREF(__pyx_refnanny, (PyObject *)(r), (__LINE__))
1980 #define __Pyx_GOTREF(r) __Pyx_RefNanny->GOTREF(__pyx_refnanny, (PyObject *)(r), (__LINE__))
1981 #define __Pyx_GIVEREF(r) __Pyx_RefNanny->GIVEREF(__pyx_refnanny, (PyObject *)(r), (__LINE__))
1982 #define __Pyx_XINCREF(r) do { if((r) == NULL); else {__Pyx_INCREF(r); }} while(0)
1983 #define __Pyx_XDECREF(r) do { if((r) == NULL); else {__Pyx_DECREF(r); }} while(0)
1984 #define __Pyx_XGOTREF(r) do { if((r) == NULL); else {__Pyx_GOTREF(r); }} while(0)
1985 #define __Pyx_XGIVEREF(r) do { if((r) == NULL); else {__Pyx_GIVEREF(r);}} while(0)
1987 #define __Pyx_RefNannyDeclarations
1988 #define __Pyx_RefNannySetupContext(name, acquire_gil)
1989 #define __Pyx_RefNannyFinishContextNogil()
1990 #define __Pyx_RefNannyFinishContext()
1991 #define __Pyx_INCREF(r) Py_INCREF(r)
1992 #define __Pyx_DECREF(r) Py_DECREF(r)
1993 #define __Pyx_GOTREF(r)
1994 #define __Pyx_GIVEREF(r)
1995 #define __Pyx_XINCREF(r) Py_XINCREF(r)
1996 #define __Pyx_XDECREF(r) Py_XDECREF(r)
1997 #define __Pyx_XGOTREF(r)
1998 #define __Pyx_XGIVEREF(r)
2000#define __Pyx_Py_XDECREF_SET(r, v) do {\
2001 PyObject *tmp = (PyObject *) r;\
2002 r = v; Py_XDECREF(tmp);\
2004#define __Pyx_XDECREF_SET(r, v) do {\
2005 PyObject *tmp = (PyObject *) r;\
2006 r = v; __Pyx_XDECREF(tmp);\
2008#define __Pyx_DECREF_SET(r, v) do {\
2009 PyObject *tmp = (PyObject *) r;\
2010 r = v; __Pyx_DECREF(tmp);\
2012#define __Pyx_CLEAR(r) do { PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);} while(0)
2013#define __Pyx_XCLEAR(r) do { if((r) != NULL) {PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);}} while(0)
2016#if CYTHON_USE_EXC_INFO_STACK && CYTHON_FAST_THREAD_STATE
2017static _PyErr_StackItem * __Pyx_PyErr_GetTopmostException(PyThreadState *tstate);
2021#if CYTHON_FAST_THREAD_STATE
2022#define __Pyx_PyThreadState_declare PyThreadState *__pyx_tstate;
2023#define __Pyx_PyThreadState_assign __pyx_tstate = __Pyx_PyThreadState_Current;
2024#if PY_VERSION_HEX >= 0x030C00A6
2025#define __Pyx_PyErr_Occurred() (__pyx_tstate->current_exception != NULL)
2026#define __Pyx_PyErr_CurrentExceptionType() (__pyx_tstate->current_exception ? (PyObject*) Py_TYPE(__pyx_tstate->current_exception) : (PyObject*) NULL)
2028#define __Pyx_PyErr_Occurred() (__pyx_tstate->curexc_type != NULL)
2029#define __Pyx_PyErr_CurrentExceptionType() (__pyx_tstate->curexc_type)
2032#define __Pyx_PyThreadState_declare
2033#define __Pyx_PyThreadState_assign
2034#define __Pyx_PyErr_Occurred() (PyErr_Occurred() != NULL)
2035#define __Pyx_PyErr_CurrentExceptionType() PyErr_Occurred()
2039#if CYTHON_FAST_THREAD_STATE
2040#define __Pyx_ExceptionSave(type, value, tb) __Pyx__ExceptionSave(__pyx_tstate, type, value, tb)
2041static CYTHON_INLINE
void __Pyx__ExceptionSave(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb);
2042#define __Pyx_ExceptionReset(type, value, tb) __Pyx__ExceptionReset(__pyx_tstate, type, value, tb)
2043static CYTHON_INLINE
void __Pyx__ExceptionReset(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb);
2045#define __Pyx_ExceptionSave(type, value, tb) PyErr_GetExcInfo(type, value, tb)
2046#define __Pyx_ExceptionReset(type, value, tb) PyErr_SetExcInfo(type, value, tb)
2050#if CYTHON_COMPILING_IN_CPYTHON
2051#define __Pyx_TypeCheck(obj, type) __Pyx_IsSubtype(Py_TYPE(obj), (PyTypeObject *)type)
2052#define __Pyx_TypeCheck2(obj, type1, type2) __Pyx_IsAnySubtype2(Py_TYPE(obj), (PyTypeObject *)type1, (PyTypeObject *)type2)
2053static CYTHON_INLINE
int __Pyx_IsSubtype(PyTypeObject *a, PyTypeObject *b);
2054static CYTHON_INLINE
int __Pyx_IsAnySubtype2(PyTypeObject *cls, PyTypeObject *a, PyTypeObject *b);
2055#define __Pyx_PyAnySet_Check(obj) __Pyx_TypeCheck2(obj, &PySet_Type, &PyFrozenSet_Type)
2057#define __Pyx_TypeCheck(obj, type) PyObject_TypeCheck(obj, (PyTypeObject *)type)
2058#define __Pyx_TypeCheck2(obj, type1, type2) (PyObject_TypeCheck(obj, (PyTypeObject *)type1) || PyObject_TypeCheck(obj, (PyTypeObject *)type2))
2059#define __Pyx_PyAnySet_Check(obj) PyAnySet_Check(obj)
2063#define __Pyx_PyExc_Exception_Check(obj) __Pyx_TypeCheck(obj, PyExc_Exception)
2066#if CYTHON_FAST_THREAD_STATE
2067#define __Pyx_PyErr_Clear() __Pyx_ErrRestore(NULL, NULL, NULL)
2068#define __Pyx_ErrRestoreWithState(type, value, tb) __Pyx_ErrRestoreInState(PyThreadState_GET(), type, value, tb)
2069#define __Pyx_ErrFetchWithState(type, value, tb) __Pyx_ErrFetchInState(PyThreadState_GET(), type, value, tb)
2070#define __Pyx_ErrRestore(type, value, tb) __Pyx_ErrRestoreInState(__pyx_tstate, type, value, tb)
2071#define __Pyx_ErrFetch(type, value, tb) __Pyx_ErrFetchInState(__pyx_tstate, type, value, tb)
2072static CYTHON_INLINE
void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb);
2073static CYTHON_INLINE
void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb);
2074#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030C00A6
2075#define __Pyx_PyErr_SetNone(exc) (Py_INCREF(exc), __Pyx_ErrRestore((exc), NULL, NULL))
2077#define __Pyx_PyErr_SetNone(exc) PyErr_SetNone(exc)
2080#define __Pyx_PyErr_Clear() PyErr_Clear()
2081#define __Pyx_PyErr_SetNone(exc) PyErr_SetNone(exc)
2082#define __Pyx_ErrRestoreWithState(type, value, tb) PyErr_Restore(type, value, tb)
2083#define __Pyx_ErrFetchWithState(type, value, tb) PyErr_Fetch(type, value, tb)
2084#define __Pyx_ErrRestoreInState(tstate, type, value, tb) PyErr_Restore(type, value, tb)
2085#define __Pyx_ErrFetchInState(tstate, type, value, tb) PyErr_Fetch(type, value, tb)
2086#define __Pyx_ErrRestore(type, value, tb) PyErr_Restore(type, value, tb)
2087#define __Pyx_ErrFetch(type, value, tb) PyErr_Fetch(type, value, tb)
2091#if CYTHON_COMPILING_IN_CPYTHON
2092static CYTHON_INLINE
int __Pyx_PyErr_GivenExceptionMatches(PyObject *err, PyObject *type);
2093static CYTHON_INLINE
int __Pyx_PyErr_GivenExceptionMatches2(PyObject *err, PyObject *type1, PyObject *type2);
2095#define __Pyx_PyErr_GivenExceptionMatches(err, type) PyErr_GivenExceptionMatches(err, type)
2096static CYTHON_INLINE
int __Pyx_PyErr_GivenExceptionMatches2(PyObject *err, PyObject *type1, PyObject *type2) {
2097 return PyErr_GivenExceptionMatches(err, type1) || PyErr_GivenExceptionMatches(err, type2);
2100#define __Pyx_PyErr_ExceptionMatches2(err1, err2) __Pyx_PyErr_GivenExceptionMatches2(__Pyx_PyErr_CurrentExceptionType(), err1, err2)
2103#if CYTHON_FAST_THREAD_STATE
2104#define __Pyx_PyErr_ExceptionMatches(err) __Pyx_PyErr_ExceptionMatchesInState(__pyx_tstate, err)
2105static CYTHON_INLINE
int __Pyx_PyErr_ExceptionMatchesInState(PyThreadState* tstate, PyObject* err);
2107#define __Pyx_PyErr_ExceptionMatches(err) PyErr_ExceptionMatches(err)
2111#if CYTHON_FAST_THREAD_STATE
2112#define __Pyx_GetException(type, value, tb) __Pyx__GetException(__pyx_tstate, type, value, tb)
2113static int __Pyx__GetException(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb);
2115static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb);
2119#define __Pyx_PyExc_ImportError_Check(obj) __Pyx_TypeCheck(obj, PyExc_ImportError)
2122#if CYTHON_COMPILING_IN_CPYTHON
2123static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw);
2125#define __Pyx_PyObject_Call(func, arg, kw) PyObject_Call(func, arg, kw)
2129#if CYTHON_COMPILING_IN_CPYTHON
2130static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg);
2134#define __Pyx_PyObject_FastCall(func, args, nargs) __Pyx_PyObject_FastCallDict(func, args, (size_t)(nargs), NULL)
2135static CYTHON_INLINE PyObject* __Pyx_PyObject_FastCallDict(PyObject *func, PyObject *
const*args,
size_t nargsf, PyObject *kwargs);
2138static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause);
2141#if CYTHON_COMPILING_IN_CPYTHON
2142static CYTHON_INLINE
void __Pyx_copy_object_array(PyObject *
const *CYTHON_RESTRICT src, PyObject** CYTHON_RESTRICT dest, Py_ssize_t length);
2146#if PY_VERSION_HEX >= 0x030F0000 && !CYTHON_COMPILING_IN_LIMITED_API
2147#define __Pyx_PyTuple_FromArray(src, n) PyTuple_FromArray(src, ((n)<0) ? 0 : (n))
2149CYTHON_UNUSED
static PyObject *
2150__Pyx_PyTuple_FromArray(PyObject *
const *src, Py_ssize_t
n);
2160static CYTHON_INLINE
int __Pyx_PyObject_CompareBoolEq_str_str(PyObject *op1, PyObject *op2,
int pyop);
2163#define __Pyx_PyUnicode_Equals(s1, s2) __Pyx_PyObject_CompareBoolEq_str_str(s1, s2, Py_EQ)
2166#if CYTHON_AVOID_BORROWED_REFS
2167 #define __Pyx_ArgRef_VARARGS(args, i) __Pyx_PySequence_ITEM(args, i)
2168#elif CYTHON_ASSUME_SAFE_MACROS
2169 #define __Pyx_ArgRef_VARARGS(args, i) __Pyx_NewRef(__Pyx_PyTuple_GET_ITEM(args, i))
2171 #define __Pyx_ArgRef_VARARGS(args, i) __Pyx_XNewRef(PyTuple_GetItem(args, i))
2173#define __Pyx_NumKwargs_VARARGS(kwds) PyDict_Size(kwds)
2174#define __Pyx_KwValues_VARARGS(args, nargs) NULL
2175#define __Pyx_GetKwValue_VARARGS(kw, kwvalues, s) __Pyx_PyDict_GetItemStrWithError(kw, s)
2176#define __Pyx_KwargsAsDict_VARARGS(kw, kwvalues) PyDict_Copy(kw)
2177#if CYTHON_VECTORCALL
2178 #define __Pyx_ArgRef_FASTCALL(args, i) __Pyx_NewRef(args[i])
2179 #define __Pyx_NumKwargs_FASTCALL(kwds) __Pyx_PyTuple_GET_SIZE(kwds)
2180 #define __Pyx_KwValues_FASTCALL(args, nargs) ((args) + (nargs))
2181 static CYTHON_INLINE PyObject * __Pyx_GetKwValue_FASTCALL(PyObject *kwnames, PyObject *
const *kwvalues, PyObject *
s);
2182 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030d0000 || CYTHON_COMPILING_IN_LIMITED_API || CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_GRAAL
2183 CYTHON_UNUSED
static PyObject *__Pyx_KwargsAsDict_FASTCALL(PyObject *kwnames, PyObject *
const *kwvalues);
2185 #define __Pyx_KwargsAsDict_FASTCALL(kw, kwvalues) _PyStack_AsDict(kwvalues, kw)
2188 #define __Pyx_ArgRef_FASTCALL __Pyx_ArgRef_VARARGS
2189 #define __Pyx_NumKwargs_FASTCALL __Pyx_NumKwargs_VARARGS
2190 #define __Pyx_KwValues_FASTCALL __Pyx_KwValues_VARARGS
2191 #define __Pyx_GetKwValue_FASTCALL __Pyx_GetKwValue_VARARGS
2192 #define __Pyx_KwargsAsDict_FASTCALL __Pyx_KwargsAsDict_VARARGS
2194#if CYTHON_VECTORCALL_TPNEW
2195 #if !CYTHON_VECTORCALL
2196 #error Enabling CYTHON_VECTORCALL_TPNEW without CYTHON_VECTORCALL is not supported
2198 #define __Pyx_ArgRef_FASTCALL_TPNEW __Pyx_ArgRef_FASTCALL
2199 #define __Pyx_NumKwargs_FASTCALL_TPNEW __Pyx_NumKwargs_FASTCALL
2200 #define __Pyx_KwValues_FASTCALL_TPNEW __Pyx_KwValues_FASTCALL
2201 #define __Pyx_GetKwValue_FASTCALL_TPNEW __Pyx_GetKwValue_FASTCALL
2202 #define __Pyx_KwargsAsDict_FASTCALL_TPNEW __Pyx_KwargsAsDict_FASTCALL
2204 #define __Pyx_ArgRef_FASTCALL_TPNEW __Pyx_ArgRef_VARARGS
2205 #define __Pyx_NumKwargs_FASTCALL_TPNEW __Pyx_NumKwargs_VARARGS
2206 #define __Pyx_KwValues_FASTCALL_TPNEW __Pyx_KwValues_VARARGS
2207 #define __Pyx_GetKwValue_FASTCALL_TPNEW __Pyx_GetKwValue_VARARGS
2208 #define __Pyx_KwargsAsDict_FASTCALL_TPNEW __Pyx_KwargsAsDict_VARARGS
2210#define __Pyx_ArgsSlice_VARARGS(args, start, stop) PyTuple_GetSlice(args, start, stop)
2211#if CYTHON_VECTORCALL
2212#define __Pyx_ArgsSlice_FASTCALL(args, start, stop) __Pyx_PyTuple_FromArray(args + start, stop - start)
2214#define __Pyx_ArgsSlice_FASTCALL __Pyx_ArgsSlice_VARARGS
2218#define __Pyx_PyDict_items_TypePtr (&PyDictKeys_Type)
2219#define __Pyx_PyDict_items_Check(obj) PyObject_TypeCheck((obj), __Pyx_PyDictItems_TypePtr)
2220#define __Pyx_PyDict_items_CheckExact(obj) Py_IS_TYPE((obj), __Pyx_PyDictItems_TypePtr)
2221static CYTHON_INLINE PyObject* __Pyx_PyDict_Items(PyObject* d);
2224#define __Pyx_CallCFunction(cfunc, self, args)\
2225 ((PyCFunction)(void(*)(void))(cfunc)->func)(self, args)
2226#define __Pyx_CallCFunctionWithKeywords(cfunc, self, args, kwargs)\
2227 ((PyCFunctionWithKeywords)(void(*)(void))(cfunc)->func)(self, args, kwargs)
2228#define __Pyx_CallCFunctionFast(cfunc, self, args, nargs)\
2229 ((__Pyx_PyCFunctionFast)(void(*)(void))(PyCFunction)(cfunc)->func)(self, args, nargs)
2230#define __Pyx_CallCFunctionFastWithKeywords(cfunc, self, args, nargs, kwnames)\
2231 ((__Pyx_PyCFunctionFastWithKeywords)(void(*)(void))(PyCFunction)(cfunc)->func)(self, args, nargs, kwnames)
2234static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg);
2239 PyObject **method_name;
2243#if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING && CYTHON_ATOMICS
2244 __pyx_atomic_int_type initialized;
2246} __Pyx_CachedCFunction;
2249static CYTHON_INLINE
int __Pyx_IgnoreGivenException(PyObject *given_exception, PyObject *ignorable_exception);
2250#define __Pyx_IgnoreException(ignorable_exception) __Pyx_IgnoreGivenException(NULL, ignorable_exception)
2253#if CYTHON_USE_TYPE_SLOTS
2254static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name);
2256#define __Pyx_PyObject_GetAttrStr(o,n) PyObject_GetAttr(o,n)
2260static int __Pyx_TryUnpackUnboundCMethod(__Pyx_CachedCFunction* target);
2263#if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING
2264static CYTHON_INLINE
int __Pyx_CachedCFunction_GetAndSetInitializing(__Pyx_CachedCFunction *cfunc) {
2268 __pyx_nonatomic_int_type expected = 0;
2269 if (__pyx_atomic_int_cmp_exchange(&cfunc->initialized, &expected, 1)) {
2275static CYTHON_INLINE
void __Pyx_CachedCFunction_SetFinishedInitializing(__Pyx_CachedCFunction *cfunc) {
2277 __pyx_atomic_store(&cfunc->initialized, 2);
2281#define __Pyx_CachedCFunction_GetAndSetInitializing(cfunc) 2
2282#define __Pyx_CachedCFunction_SetFinishedInitializing(cfunc)
2287static PyObject* __Pyx__CallUnboundCMethod0(__Pyx_CachedCFunction* cfunc, PyObject* self);
2288#if CYTHON_COMPILING_IN_CPYTHON
2289static CYTHON_INLINE PyObject* __Pyx_CallUnboundCMethod0(__Pyx_CachedCFunction* cfunc, PyObject* self);
2291#define __Pyx_CallUnboundCMethod0(cfunc, self) __Pyx__CallUnboundCMethod0(cfunc, self)
2295#define __Pyx_PyDict_values_TypePtr (&PyDictKeys_Type)
2296#define __Pyx_PyDict_values_Check(obj) PyObject_TypeCheck((obj), __Pyx_PyDictValues_TypePtr)
2297#define __Pyx_PyDict_values_CheckExact(obj) Py_IS_TYPE((obj), __Pyx_PyDictValues_TypePtr)
2298static CYTHON_INLINE PyObject* __Pyx_PyDict_Values(PyObject* d);
2301#if CYTHON_AVOID_BORROWED_REFS
2302static int __Pyx_PyDict_NextRef(PyObject *p, PyObject **ppos, PyObject **pkey, PyObject **pvalue);
2305static int __Pyx_PyDict_NextRef(PyObject *p, Py_ssize_t *ppos, PyObject **pkey, PyObject **pvalue);
2309static void __Pyx_RaiseDoubleKeywordsError(
const char* func_name, PyObject* kw_name);
2312static int __Pyx_ParseKeywordsTuple(
2314 PyObject *
const *kwvalues,
2315 PyObject **
const argnames[],
2318 Py_ssize_t num_pos_args,
2319 Py_ssize_t num_kwargs,
2320 const char* function_name,
2321 int ignore_unknown_kwargs
2323static int __Pyx_ParseKeywordDictToDict(
2325 PyObject **
const argnames[],
2328 Py_ssize_t num_pos_args,
2329 const char* function_name
2331static int __Pyx_ParseKeywordDict(
2333 PyObject **
const argnames[],
2335 Py_ssize_t num_pos_args,
2336 Py_ssize_t num_kwargs,
2337 const char* function_name,
2338 int ignore_unknown_kwargs
2343static PyObject* __Pyx__CallUnboundCMethod2(__Pyx_CachedCFunction* cfunc, PyObject* self, PyObject* arg1, PyObject* arg2);
2344#if CYTHON_COMPILING_IN_CPYTHON
2345static CYTHON_INLINE PyObject *__Pyx_CallUnboundCMethod2(__Pyx_CachedCFunction *cfunc, PyObject *self, PyObject *arg1, PyObject *arg2);
2347#define __Pyx_CallUnboundCMethod2(cfunc, self, arg1, arg2) __Pyx__CallUnboundCMethod2(cfunc, self, arg1, arg2)
2351static CYTHON_INLINE
int __Pyx_ParseKeywords(
2352 PyObject *kwds, PyObject *
const *kwvalues, PyObject **
const argnames[],
2353 PyObject *kwds2, PyObject *values[],
2354 Py_ssize_t num_pos_args, Py_ssize_t num_kwargs,
2355 const char* function_name,
2356 int ignore_unknown_kwargs
2360static void __Pyx_RaiseArgtupleInvalid(
const char* func_name,
int exact,
2361 Py_ssize_t num_min, Py_ssize_t num_max, Py_ssize_t num_found);
2364#if CYTHON_COMPILING_IN_LIMITED_API && __PYX_LIMITED_VERSION_HEX < 0x030d0000
2365#define __Pyx_PyObject_DelAttr(o, n) PyObject_SetAttr(o, n, NULL)
2367#define __Pyx_PyObject_DelAttr(o, n) PyObject_DelAttr(o, n)
2371#if CYTHON_USE_TYPE_SLOTS
2372#define __Pyx_PyObject_DelAttrStr(o,n) __Pyx_PyObject_SetAttrStr(o, n, NULL)
2373static CYTHON_INLINE
int __Pyx_PyObject_SetAttrStr(PyObject* obj, PyObject* attr_name, PyObject* value);
2375#define __Pyx_PyObject_DelAttrStr(o,n) __Pyx_PyObject_DelAttr(o,n)
2376#define __Pyx_PyObject_SetAttrStr(o,n,v) PyObject_SetAttr(o,n,v)
2380static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStrNoError(PyObject* obj, PyObject* attr_name);
2383static PyObject *__Pyx_GetBuiltinName(PyObject *name);
2386#if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_TYPE_SLOTS
2387#define __PYX_DICT_VERSION_INIT ((PY_UINT64_T) -1)
2388#define __PYX_GET_DICT_VERSION(dict) (((PyDictObject*)(dict))->ma_version_tag)
2389#define __PYX_UPDATE_DICT_CACHE(dict, value, cache_var, version_var)\
2390 (version_var) = __PYX_GET_DICT_VERSION(dict);\
2391 (cache_var) = (value);
2392#define __PYX_PY_DICT_LOOKUP_IF_MODIFIED(VAR, DICT, LOOKUP) {\
2393 static PY_UINT64_T __pyx_dict_version = 0;\
2394 static PyObject *__pyx_dict_cached_value = NULL;\
2395 if (likely(__PYX_GET_DICT_VERSION(DICT) == __pyx_dict_version)) {\
2396 (VAR) = __Pyx_XNewRef(__pyx_dict_cached_value);\
2398 (VAR) = __pyx_dict_cached_value = (LOOKUP);\
2399 __pyx_dict_version = __PYX_GET_DICT_VERSION(DICT);\
2402static CYTHON_INLINE PY_UINT64_T __Pyx_get_tp_dict_version(PyObject *obj);
2403static CYTHON_INLINE PY_UINT64_T __Pyx_get_object_dict_version(PyObject *obj);
2404static CYTHON_INLINE
int __Pyx_object_dict_version_matches(PyObject* obj, PY_UINT64_T tp_dict_version, PY_UINT64_T obj_dict_version);
2406#define __PYX_GET_DICT_VERSION(dict) (0)
2407#define __PYX_UPDATE_DICT_CACHE(dict, value, cache_var, version_var)
2408#define __PYX_PY_DICT_LOOKUP_IF_MODIFIED(VAR, DICT, LOOKUP) (VAR) = (LOOKUP);
2412#if CYTHON_USE_DICT_VERSIONS
2413#define __Pyx_GetModuleGlobalName(var, name) do {\
2414 static PY_UINT64_T __pyx_dict_version = 0;\
2415 static PyObject *__pyx_dict_cached_value = NULL;\
2416 (var) = (likely(__pyx_dict_version == __PYX_GET_DICT_VERSION(__pyx_mstate_global->__pyx_d))) ?\
2417 (likely(__pyx_dict_cached_value) ? __Pyx_NewRef(__pyx_dict_cached_value) : __Pyx_GetBuiltinName(name)) :\
2418 __Pyx__GetModuleGlobalName(name, &__pyx_dict_version, &__pyx_dict_cached_value);\
2420#define __Pyx_GetModuleGlobalNameUncached(var, name) do {\
2421 PY_UINT64_T __pyx_dict_version;\
2422 PyObject *__pyx_dict_cached_value;\
2423 (var) = __Pyx__GetModuleGlobalName(name, &__pyx_dict_version, &__pyx_dict_cached_value);\
2425static PyObject *__Pyx__GetModuleGlobalName(PyObject *name, PY_UINT64_T *dict_version, PyObject **dict_cached_value);
2427#define __Pyx_GetModuleGlobalName(var, name) (var) = __Pyx__GetModuleGlobalName(name)
2428#define __Pyx_GetModuleGlobalNameUncached(var, name) (var) = __Pyx__GetModuleGlobalName(name)
2429static CYTHON_INLINE PyObject *__Pyx__GetModuleGlobalName(PyObject *name);
2433#if CYTHON_VECTORCALL
2434#define __Pyx_Object_VectorcallKwds PyObject_Vectorcall
2435CYTHON_UNUSED
static int __Pyx_CheckVectorcallKwarg(PyObject *kwnames, Py_ssize_t i);
2437#define __Pyx_Object_VectorcallKwds __Pyx_PyObject_FastCallDict
2438CYTHON_UNUSED
static PyObject *__Pyx_MakeKwargDict(PyObject **keys, PyObject **values, Py_ssize_t
n);
2439CYTHON_UNUSED
static int __Pyx_CheckVectorcallKwarg(PyObject **kwnames, Py_ssize_t i);
2443#if CYTHON_COMPILING_IN_LIMITED_API && __PYX_LIMITED_VERSION_HEX >= 0x030d0000
2444typedef PyObject *__Pyx_TypeName;
2445#define __Pyx_FMT_TYPENAME "%N"
2446#define __Pyx_PyType_GetFullyQualifiedName(tp) Py_NewRef((PyObject*)tp)
2447#define __Pyx_DECREF_TypeName(obj) Py_DECREF(obj)
2448#elif CYTHON_COMPILING_IN_LIMITED_API
2449typedef PyObject *__Pyx_TypeName;
2450#define __Pyx_FMT_TYPENAME "%U"
2451#define __Pyx_DECREF_TypeName(obj) Py_XDECREF(obj)
2452static __Pyx_TypeName __Pyx_PyType_GetFullyQualifiedName(PyTypeObject* tp);
2454typedef const char *__Pyx_TypeName;
2455#define __Pyx_FMT_TYPENAME "%.200s"
2456#define __Pyx_PyType_GetFullyQualifiedName(tp) ((tp)->tp_name)
2457#define __Pyx_DECREF_TypeName(obj)
2461#define __Pyx_RaiseErrorWithObjectTypes1(exc_type, message, arg, obj1, obj2) __Pyx_RaiseErrorWithTypes1(exc_type, message, arg, Py_TYPE(obj1), Py_TYPE(obj2))
2462#define __Pyx_RaiseTypeErrorWithObjectTypes(message, obj1, obj2) __Pyx_RaiseTypeErrorWithTypes(message, Py_TYPE(obj1), Py_TYPE(obj2))
2463#define __Pyx_RaiseTypeErrorWithTypes(message, type_obj1, type_obj2) __Pyx_RaiseErrorWithTypes1(PyExc_TypeError, "%.1s" message, "", type_obj1, type_obj2)
2465static void __Pyx_RaiseErrorWithTypes1(PyObject* exc_type,
const char *message,
const char *arg, PyTypeObject *type_obj1, PyTypeObject *type_obj2);
2468static CYTHON_INLINE
int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type);
2471#ifndef __PYX_HAVE_RT_ImportType_proto_3_3_0
2472#define __PYX_HAVE_RT_ImportType_proto_3_3_0
2473#if defined (__STDC_VERSION__) && __STDC_VERSION__ >= 201112L
2474#include <stdalign.h>
2476#if (defined (__STDC_VERSION__) && __STDC_VERSION__ >= 201112L) || __cplusplus >= 201103L
2477#define __PYX_GET_STRUCT_ALIGNMENT_3_3_0(s) alignof(s)
2479#define __PYX_GET_STRUCT_ALIGNMENT_3_3_0(s) sizeof(void*)
2481enum __Pyx_ImportType_CheckSize_3_3_0 {
2482 __Pyx_ImportType_CheckSize_Error_3_3_0 = 0,
2483 __Pyx_ImportType_CheckSize_Warn_3_3_0 = 1,
2484 __Pyx_ImportType_CheckSize_Ignore_3_3_0 = 2
2486static 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);
2490#if __PYX_LIMITED_VERSION_HEX >= 0x030d0000
2491#define __Pyx_HasAttr(o, n) PyObject_HasAttrWithError(o, n)
2493static CYTHON_INLINE
int __Pyx_HasAttr(PyObject *, PyObject *);
2497CYTHON_UNUSED
static PyObject *
2498__Pyx_PyList_FromArray(PyObject *
const *src, Py_ssize_t
n);
2504static PyObject *__Pyx__Import(PyObject *name, PyObject *
const *imported_names, Py_ssize_t len_imported_names, PyObject *qualname, PyObject *moddict,
int level);
2507static CYTHON_INLINE PyObject *__Pyx_Import(PyObject *name, PyObject *
const *imported_names, Py_ssize_t len_imported_names, PyObject *qualname,
int level);
2510static CYTHON_INLINE PyObject *__Pyx_PyDict_SetDefault(PyObject *d, PyObject *key, PyObject *default_value);
2513#if ((CYTHON_COMPILING_IN_CPYTHON_FREETHREADING && PY_VERSION_HEX < 0x030F00a3) ||\
2514 __PYX_LIMITED_VERSION_HEX < 0x030d0000)
2515 static PyObject *__Pyx_PyImport_AddModuleRef(
const char *name);
2517 #define __Pyx_PyImport_AddModuleRef(name) PyImport_AddModuleRef(name)
2521static PyObject *__Pyx_FetchSharedCythonABIModule(
void);
2524static int __Pyx_VerifyCachedType(PyObject *cached_type,
2526 Py_ssize_t expected_basicsize);
2529static PyTypeObject* __Pyx_FetchCommonTypeFromSpec(PyTypeObject *metaclass, PyObject *module, PyType_Spec *spec, PyObject *bases);
2532static int __pyx_CommonTypesMetaclass_init(PyObject *module);
2533#define __Pyx_CommonTypesMetaclass_USED
2536#define __Pyx_CyFunction_USED
2537#if CYTHON_OPAQUE_SHARED_TYPES
2538#define __Pyx_as_CyFunctionObject(o) ((__pyx_CyFunctionObject *)PyObject_GetTypeData((o), __pyx_mstate_global->__pyx_CyFunctionType))
2540#define __Pyx_as_CyFunctionObject(o) ((__pyx_CyFunctionObject *)o)
2542#define __Pyx_CYFUNCTION_STATICMETHOD 0x01
2543#define __Pyx_CYFUNCTION_CLASSMETHOD 0x02
2544#define __Pyx_CYFUNCTION_CCLASS 0x04
2545#define __Pyx_CYFUNCTION_COROUTINE 0x08
2546#define __Pyx_CyFunction_GetClosure(f)\
2547 ((__Pyx_as_CyFunctionObject(f))->func_closure)
2548#if CYTHON_COMPILING_IN_LIMITED_API
2549 #define __Pyx__CyFunction_GetClassObj(f)\
2550 ((f)->func_classobj)
2552 #define __Pyx__CyFunction_GetClassObj(f)\
2553 ((PyObject*) ((PyCMethodObject *) (f))->mm_class)
2555#define __Pyx_CyFunction_GetClassObj(f)\
2556 __Pyx__CyFunction_GetClassObj(__Pyx_as_CyFunctionObject(f))
2557#define __Pyx_CyFunction_SetClassObj(f, classobj)\
2558 __Pyx__CyFunction_SetClassObj(__Pyx_as_CyFunctionObject(f), (classobj))
2559#define __Pyx_CyFunction_Defaults(type, f)\
2560 ((type *)((__Pyx_as_CyFunctionObject(f))->defaults))
2561#define __Pyx_CyFunction_SetDefaultsGetter(f, g)\
2562 (__Pyx_as_CyFunctionObject(f))->defaults_getter = (g)
2564#if CYTHON_COMPILING_IN_LIMITED_API
2565#if !CYTHON_OPAQUE_OBJECTS
2568 PyMethodDef *func_methoddef;
2569 PyObject *func_module;
2571 PyCMethodObject func;
2573#if (CYTHON_COMPILING_IN_LIMITED_API || CYTHON_COMPILING_IN_PYPY) && CYTHON_VECTORCALL
2574 __pyx_vectorcallfunc func_vectorcall;
2576#if CYTHON_COMPILING_IN_LIMITED_API
2577 PyObject *func_weakreflist;
2579#if PY_VERSION_HEX < 0x030C0000 || CYTHON_COMPILING_IN_LIMITED_API
2580 PyObject *func_dict;
2582 PyObject *func_name;
2583 PyObject *func_qualname;
2585 PyObject *func_globals;
2586 PyObject *func_code;
2587 PyObject *func_closure;
2588#if CYTHON_COMPILING_IN_LIMITED_API
2589 PyObject *func_classobj;
2593 PyObject *defaults_tuple;
2594 PyObject *defaults_kwdict;
2595 PyObject *(*defaults_getter)(PyObject *);
2596 PyObject *func_annotations;
2597#if __PYX_LIMITED_VERSION_HEX < 0x030B0000
2598 PyObject *func_is_coroutine;
2600} __pyx_CyFunctionObject;
2601#undef __Pyx_CyOrPyCFunction_Check
2602#define __Pyx_CyFunction_Check(obj) __Pyx_TypeCheck(obj, __pyx_mstate_global->__pyx_CyFunctionType)
2603#define __Pyx_CyOrPyCFunction_Check(obj) __Pyx_TypeCheck2(obj, __pyx_mstate_global->__pyx_CyFunctionType, &PyCFunction_Type)
2604#define __Pyx_CyFunction_CheckExact(obj) Py_IS_TYPE(obj, __pyx_mstate_global->__pyx_CyFunctionType)
2605static CYTHON_INLINE
int __Pyx__IsSameCyOrCFunction(PyObject *func,
void (*cfunc)(
void));
2606#undef __Pyx_IsSameCFunction
2607#define __Pyx_IsSameCFunction(func, cfunc) __Pyx__IsSameCyOrCFunction(func, cfunc)
2608static CYTHON_INLINE
void __Pyx__CyFunction_SetClassObj(__pyx_CyFunctionObject*
f, PyObject* classobj);
2609static CYTHON_INLINE PyObject *__Pyx_CyFunction_InitDefaults(PyObject *func,
2610 PyTypeObject *defaults_type);
2611static CYTHON_INLINE
void __Pyx_CyFunction_SetDefaultsTuple(PyObject *m,
2613static CYTHON_INLINE
void __Pyx_CyFunction_SetDefaultsKwDict(PyObject *m,
2615static CYTHON_INLINE
void __Pyx_CyFunction_SetAnnotationsDict(PyObject *m,
2617static int __pyx_CyFunction_init(PyObject *module);
2618#if CYTHON_VECTORCALL
2619#if CYTHON_COMPILING_IN_LIMITED_API || CYTHON_COMPILING_IN_PYPY
2620#define __Pyx_CyFunction_func_vectorcall(f) ((f)->func_vectorcall)
2622#define __Pyx_CyFunction_func_vectorcall(f) (((PyCFunctionObject*)f)->vectorcall)
2627#if !CYTHON_USE_TYPE_SPECS
2628#define __Pyx_call_type_traverse(o, always_call, visit, arg) 0
2630static int __Pyx_call_type_traverse(PyObject *o,
int always_call, visitproc visit,
void *arg);
2634static PyObject *__Pyx_PyMethod_New(PyObject *func, PyObject *self, PyObject *typ);
2637#if CYTHON_VECTORCALL
2638static CYTHON_INLINE PyObject *__Pyx_PyVectorcall_FastCallDict(PyObject *func, __pyx_vectorcallfunc vc, PyObject *
const *args,
size_t nargs, PyObject *kw);
2642static PyObject *__Pyx_CyFunction_Init(PyObject *op_in, PyMethodDef *ml,
2643 int flags, PyObject* qualname,
2645 PyObject *module, PyObject *globals,
2647#if CYTHON_VECTORCALL
2648static PyObject * __Pyx_CyFunction_Vectorcall_NOARGS(PyObject *func, PyObject *
const *args,
size_t nargsf, PyObject *kwnames);
2649static PyObject * __Pyx_CyFunction_Vectorcall_O(PyObject *func, PyObject *
const *args,
size_t nargsf, PyObject *kwnames);
2650static PyObject * __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS(PyObject *func, PyObject *
const *args,
size_t nargsf, PyObject *kwnames);
2651static PyObject * __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS_METHOD(PyObject *func, PyObject *
const *args,
size_t nargsf, PyObject *kwnames);
2655static PyObject *__Pyx_CyFunction_New(PyMethodDef *ml,
2656 int flags, PyObject* qualname,
2658 PyObject *module, PyObject *globals,
2660static PyTypeObject *__Pyx_Get_CyFunction_Type(
void);
2663#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030d0000
2664#define __Pyx_SetNameInClass(ns, name, value)\
2665 (likely(PyDict_CheckExact(ns)) ? _PyDict_SetItem_KnownHash(ns, name, value, ((PyASCIIObject *) name)->hash) : PyObject_SetItem(ns, name, value))
2666#elif CYTHON_COMPILING_IN_CPYTHON
2667#define __Pyx_SetNameInClass(ns, name, value)\
2668 (likely(PyDict_CheckExact(ns)) ? PyDict_SetItem(ns, name, value) : PyObject_SetItem(ns, name, value))
2670#define __Pyx_SetNameInClass(ns, name, value) PyObject_SetItem(ns, name, value)
2674static PyObject *__Pyx_CalculateMetaclass(PyTypeObject *metaclass, PyObject *bases);
2677static CYTHON_INLINE PyObject* __Pyx_PyObject_Call2Args(PyObject* function, PyObject* arg1, PyObject* arg2);
2680#if CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
2681#define __Pyx_PyObject_LookupSpecialNoError(obj, attr_name) __Pyx__PyObject_LookupSpecial(obj, attr_name, 0)
2682#define __Pyx_PyObject_LookupSpecial(obj, attr_name) __Pyx__PyObject_LookupSpecial(obj, attr_name, 1)
2683static CYTHON_INLINE PyObject* __Pyx__PyObject_LookupSpecial(PyObject* obj, PyObject* attr_name,
int with_error);
2685#define __Pyx_PyObject_LookupSpecialNoError(o,n) __Pyx_PyObject_GetAttrStrNoError(o,n)
2686#define __Pyx_PyObject_LookupSpecial(o,n) __Pyx_PyObject_GetAttrStr(o,n)
2690static PyObject *__Pyx_Py3MetaclassPrepare(PyObject *metaclass, PyObject *bases, PyObject *name, PyObject *qualname,
2691 PyObject *mkw, PyObject *modname, PyObject *doc);
2692static PyObject *__Pyx_Py3ClassCreate(PyObject *metaclass, PyObject *name, PyObject *bases, PyObject *dict,
2693 PyObject *mkw,
int calculate_metaclass,
int allow_py2_metaclass);
2696#if CYTHON_CLINE_IN_TRACEBACK && CYTHON_CLINE_IN_TRACEBACK_RUNTIME
2697static int __Pyx_CLineForTraceback(PyThreadState *tstate,
int c_line);
2699#define __Pyx_CLineForTraceback(tstate, c_line) (((CYTHON_CLINE_IN_TRACEBACK)) ? c_line : 0)
2703#if CYTHON_COMPILING_IN_LIMITED_API
2704typedef PyObject __Pyx_CachedCodeObjectType;
2706typedef PyCodeObject __Pyx_CachedCodeObjectType;
2709 __Pyx_CachedCodeObjectType* code_object;
2711} __Pyx_CodeObjectCacheEntry;
2712struct __Pyx_CodeObjectCache {
2715 __Pyx_CodeObjectCacheEntry* entries;
2716 #if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING
2717 __pyx_atomic_int_type accessor_count;
2720static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries,
int count,
int code_line);
2721static __Pyx_CachedCodeObjectType *__pyx_find_code_object(
int code_line);
2722static void __pyx_insert_code_object(
int code_line, __Pyx_CachedCodeObjectType* code_object);
2725static void __Pyx_AddTraceback(
const char *funcname,
int c_line,
2726 int py_line,
const char *filename);
2729static CYTHON_INLINE
long __Pyx_pow_long(
long,
long);
2732#if !defined(__INTEL_COMPILER) && defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 6))
2733#define __Pyx_HAS_GCC_DIAGNOSTIC
2739 #define __Pyx_CREAL(z) ((z).real())
2740 #define __Pyx_CIMAG(z) ((z).imag())
2742 #define __Pyx_CREAL(z) (__real__(z))
2743 #define __Pyx_CIMAG(z) (__imag__(z))
2746 #define __Pyx_CREAL(z) ((z).real)
2747 #define __Pyx_CIMAG(z) ((z).imag)
2749#if defined(__cplusplus) && CYTHON_CCOMPLEX\
2750 && (defined(_WIN32) || defined(__clang__) || (defined(__GNUC__) && (__GNUC__ >= 5 || __GNUC__ == 4 && __GNUC_MINOR__ >= 4 )) || __cplusplus >= 201103)
2751 #define __Pyx_SET_CREAL(z,x) ((z).real(x))
2752 #define __Pyx_SET_CIMAG(z,y) ((z).imag(y))
2754 #define __Pyx_SET_CREAL(z,x) __Pyx_CREAL(z) = (x)
2755 #define __Pyx_SET_CIMAG(z,y) __Pyx_CIMAG(z) = (y)
2759#if CYTHON_CCOMPLEX && (1) && (!0 || __cplusplus)
2760 #define __Pyx_c_eq_float(a, b) ((a)==(b))
2761 #define __Pyx_c_sum_float(a, b) ((a)+(b))
2762 #define __Pyx_c_diff_float(a, b) ((a)-(b))
2763 #define __Pyx_c_prod_float(a, b) ((a)*(b))
2764 #define __Pyx_c_quot_float(a, b) ((a)/(b))
2765 #define __Pyx_c_neg_float(a) (-(a))
2767 #define __Pyx_c_is_zero_float(z) ((z)==(float)0)
2768 #define __Pyx_c_conj_float(z) (::std::conj(z))
2770 #define __Pyx_c_abs_float(z) (::std::abs(z))
2771 #define __Pyx_c_pow_float(a, b) (::std::pow(a, b))
2774 #define __Pyx_c_is_zero_float(z) ((z)==0)
2775 #define __Pyx_c_conj_float(z) (conjf(z))
2777 #define __Pyx_c_abs_float(z) (cabsf(z))
2778 #define __Pyx_c_pow_float(a, b) (cpowf(a, b))
2782 static CYTHON_INLINE
int __Pyx_c_eq_float(__pyx_t_float_complex, __pyx_t_float_complex);
2783 static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_sum_float(__pyx_t_float_complex, __pyx_t_float_complex);
2784 static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_diff_float(__pyx_t_float_complex, __pyx_t_float_complex);
2785 static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_prod_float(__pyx_t_float_complex, __pyx_t_float_complex);
2786 static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_quot_float(__pyx_t_float_complex, __pyx_t_float_complex);
2787 static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_neg_float(__pyx_t_float_complex);
2788 static CYTHON_INLINE
int __Pyx_c_is_zero_float(__pyx_t_float_complex);
2789 static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_conj_float(__pyx_t_float_complex);
2791 static CYTHON_INLINE
float __Pyx_c_abs_float(__pyx_t_float_complex);
2792 static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_pow_float(__pyx_t_float_complex, __pyx_t_float_complex);
2797#if CYTHON_CCOMPLEX && (1) && (!0 || __cplusplus)
2798 #define __Pyx_c_eq_double(a, b) ((a)==(b))
2799 #define __Pyx_c_sum_double(a, b) ((a)+(b))
2800 #define __Pyx_c_diff_double(a, b) ((a)-(b))
2801 #define __Pyx_c_prod_double(a, b) ((a)*(b))
2802 #define __Pyx_c_quot_double(a, b) ((a)/(b))
2803 #define __Pyx_c_neg_double(a) (-(a))
2805 #define __Pyx_c_is_zero_double(z) ((z)==(double)0)
2806 #define __Pyx_c_conj_double(z) (::std::conj(z))
2808 #define __Pyx_c_abs_double(z) (::std::abs(z))
2809 #define __Pyx_c_pow_double(a, b) (::std::pow(a, b))
2812 #define __Pyx_c_is_zero_double(z) ((z)==0)
2813 #define __Pyx_c_conj_double(z) (conj(z))
2815 #define __Pyx_c_abs_double(z) (cabs(z))
2816 #define __Pyx_c_pow_double(a, b) (cpow(a, b))
2820 static CYTHON_INLINE
int __Pyx_c_eq_double(__pyx_t_double_complex, __pyx_t_double_complex);
2821 static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_sum_double(__pyx_t_double_complex, __pyx_t_double_complex);
2822 static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_diff_double(__pyx_t_double_complex, __pyx_t_double_complex);
2823 static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_prod_double(__pyx_t_double_complex, __pyx_t_double_complex);
2824 static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_quot_double(__pyx_t_double_complex, __pyx_t_double_complex);
2825 static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_neg_double(__pyx_t_double_complex);
2826 static CYTHON_INLINE
int __Pyx_c_is_zero_double(__pyx_t_double_complex);
2827 static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_conj_double(__pyx_t_double_complex);
2829 static CYTHON_INLINE
double __Pyx_c_abs_double(__pyx_t_double_complex);
2830 static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_pow_double(__pyx_t_double_complex, __pyx_t_double_complex);
2835#if CYTHON_CCOMPLEX && (1) && (!0 || __cplusplus)
2836 #define __Pyx_c_eq_long__double(a, b) ((a)==(b))
2837 #define __Pyx_c_sum_long__double(a, b) ((a)+(b))
2838 #define __Pyx_c_diff_long__double(a, b) ((a)-(b))
2839 #define __Pyx_c_prod_long__double(a, b) ((a)*(b))
2840 #define __Pyx_c_quot_long__double(a, b) ((a)/(b))
2841 #define __Pyx_c_neg_long__double(a) (-(a))
2843 #define __Pyx_c_is_zero_long__double(z) ((z)==(long double)0)
2844 #define __Pyx_c_conj_long__double(z) (::std::conj(z))
2846 #define __Pyx_c_abs_long__double(z) (::std::abs(z))
2847 #define __Pyx_c_pow_long__double(a, b) (::std::pow(a, b))
2850 #define __Pyx_c_is_zero_long__double(z) ((z)==0)
2851 #define __Pyx_c_conj_long__double(z) (conjl(z))
2853 #define __Pyx_c_abs_long__double(z) (cabsl(z))
2854 #define __Pyx_c_pow_long__double(a, b) (cpowl(a, b))
2858 static CYTHON_INLINE
int __Pyx_c_eq_long__double(__pyx_t_long_double_complex, __pyx_t_long_double_complex);
2859 static CYTHON_INLINE __pyx_t_long_double_complex __Pyx_c_sum_long__double(__pyx_t_long_double_complex, __pyx_t_long_double_complex);
2860 static CYTHON_INLINE __pyx_t_long_double_complex __Pyx_c_diff_long__double(__pyx_t_long_double_complex, __pyx_t_long_double_complex);
2861 static CYTHON_INLINE __pyx_t_long_double_complex __Pyx_c_prod_long__double(__pyx_t_long_double_complex, __pyx_t_long_double_complex);
2862 static CYTHON_INLINE __pyx_t_long_double_complex __Pyx_c_quot_long__double(__pyx_t_long_double_complex, __pyx_t_long_double_complex);
2863 static CYTHON_INLINE __pyx_t_long_double_complex __Pyx_c_neg_long__double(__pyx_t_long_double_complex);
2864 static CYTHON_INLINE
int __Pyx_c_is_zero_long__double(__pyx_t_long_double_complex);
2865 static CYTHON_INLINE __pyx_t_long_double_complex __Pyx_c_conj_long__double(__pyx_t_long_double_complex);
2867 static CYTHON_INLINE
long double __Pyx_c_abs_long__double(__pyx_t_long_double_complex);
2868 static CYTHON_INLINE __pyx_t_long_double_complex __Pyx_c_pow_long__double(__pyx_t_long_double_complex, __pyx_t_long_double_complex);
2873static CYTHON_INLINE
int __Pyx_PyLong_As_int(PyObject *);
2876#if CYTHON_VECTORCALL
2877#define __Pyx_Object_VectorcallMethodKwds PyObject_VectorcallMethod
2879static PyObject *__Pyx_Object_VectorcallMethodKwds(PyObject *name, PyObject *
const *args,
size_t nargsf, PyObject *kwnames);
2883static CYTHON_INLINE PyObject* __Pyx_PyLong_From_long(
long value);
2886static CYTHON_INLINE
long __Pyx_PyLong_As_long(PyObject *);
2889#if __PYX_LIMITED_VERSION_HEX < 0x030b0000
2890static unsigned long __Pyx_cached_runtime_version = 0;
2891static void __Pyx_init_runtime_version(
void);
2893#define __Pyx_init_runtime_version()
2895static unsigned long __Pyx_get_runtime_version(
void);
2898static int __Pyx_check_binary_version(
unsigned long ct_version,
unsigned long rt_version,
int allow_newer);
2901static PyObject *__Pyx_DecompressString(
const char *
s, Py_ssize_t length,
int algo);
2904#if CYTHON_PEP489_MULTI_PHASE_INIT && CYTHON_USE_MODULE_STATE
2906static PyObject *__Pyx_State_FindModule(
void*);
2907static int __Pyx_State_AddModule(PyObject* module,
void*);
2908static int __Pyx_State_RemoveModule(
void*);
2909#elif CYTHON_USE_MODULE_STATE
2910#define __Pyx_State_FindModule PyState_FindModule
2911#define __Pyx_State_AddModule PyState_AddModule
2912#define __Pyx_State_RemoveModule PyState_RemoveModule
2917#if CYTHON_COMPILING_IN_LIMITED_API
2918 #if CYTHON_VECTORCALL
2919 #define __PYX_VECTORCALL_ABI_SUFFIX "_vectorcall"
2921 #define __PYX_VECTORCALL_ABI_SUFFIX
2923 #define __PYX_LIMITED_ABI_SUFFIX "limited" __PYX_VECTORCALL_ABI_SUFFIX __PYX_AM_SEND_ABI_SUFFIX
2925 #define __PYX_LIMITED_ABI_SUFFIX
2927#if __PYX_HAS_PY_AM_SEND == 1
2928 #define __PYX_AM_SEND_ABI_SUFFIX
2929#elif __PYX_HAS_PY_AM_SEND == 2
2930 #define __PYX_AM_SEND_ABI_SUFFIX "amsendbackport"
2932 #define __PYX_AM_SEND_ABI_SUFFIX "noamsend"
2934#ifndef __PYX_MONITORING_ABI_SUFFIX
2935 #define __PYX_MONITORING_ABI_SUFFIX
2937#if CYTHON_USE_TP_FINALIZE
2938 #define __PYX_TP_FINALIZE_ABI_SUFFIX
2940 #define __PYX_TP_FINALIZE_ABI_SUFFIX "nofinalize"
2942#if CYTHON_USE_FREELISTS || !defined(__Pyx_AsyncGen_USED)
2943 #define __PYX_FREELISTS_ABI_SUFFIX
2945 #define __PYX_FREELISTS_ABI_SUFFIX "nofreelists"
2947#if CYTHON_OPAQUE_OBJECTS && CYTHON_COMPILING_IN_LIMITED_API
2948 #define __PYX_OPAQUE_OBJECTS_ABI_SUFFIX "opaque"
2950 #define __PYX_OPAQUE_OBJECTS_ABI_SUFFIX
2952#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
2953#define __PYX_ABI_MODULE_NAME "_cython_" CYTHON_ABI
2954#define __PYX_TYPE_MODULE_PREFIX __PYX_ABI_MODULE_NAME "."
2956static CYTHON_INLINE PyTypeObject *__pyx_f_5numpy_5dtype_7typeobj___get__(PyArray_Descr *__pyx_v_self);
2957static CYTHON_INLINE
char __pyx_f_5numpy_5dtype_4kind___get__(PyArray_Descr *__pyx_v_self);
2958static CYTHON_INLINE
char __pyx_f_5numpy_5dtype_4type___get__(PyArray_Descr *__pyx_v_self);
2959static CYTHON_INLINE
char __pyx_f_5numpy_5dtype_9byteorder___get__(PyArray_Descr *__pyx_v_self);
2960static CYTHON_INLINE
int __pyx_f_5numpy_5dtype_8type_num___get__(PyArray_Descr *__pyx_v_self);
2961static CYTHON_INLINE npy_intp __pyx_f_5numpy_5dtype_8itemsize___get__(PyArray_Descr *__pyx_v_self);
2962static CYTHON_INLINE npy_intp __pyx_f_5numpy_5dtype_9alignment___get__(PyArray_Descr *__pyx_v_self);
2963static CYTHON_INLINE PyObject *__pyx_f_5numpy_5dtype_6fields___get__(PyArray_Descr *__pyx_v_self);
2964static CYTHON_INLINE PyObject *__pyx_f_5numpy_5dtype_5names___get__(PyArray_Descr *__pyx_v_self);
2965static CYTHON_INLINE PyArray_ArrayDescr *__pyx_f_5numpy_5dtype_8subarray___get__(PyArray_Descr *__pyx_v_self);
2966static CYTHON_INLINE npy_uint64 __pyx_f_5numpy_5dtype_5flags___get__(PyArray_Descr *__pyx_v_self);
2967static CYTHON_INLINE
int __pyx_f_5numpy_9broadcast_7numiter___get__(PyArrayMultiIterObject *__pyx_v_self);
2968static CYTHON_INLINE npy_intp __pyx_f_5numpy_9broadcast_4size___get__(PyArrayMultiIterObject *__pyx_v_self);
2969static CYTHON_INLINE npy_intp __pyx_f_5numpy_9broadcast_5index___get__(PyArrayMultiIterObject *__pyx_v_self);
2970static CYTHON_INLINE
int __pyx_f_5numpy_9broadcast_2nd___get__(PyArrayMultiIterObject *__pyx_v_self);
2971static CYTHON_INLINE npy_intp *__pyx_f_5numpy_9broadcast_10dimensions___get__(PyArrayMultiIterObject *__pyx_v_self);
2972static CYTHON_INLINE
void **__pyx_f_5numpy_9broadcast_5iters___get__(PyArrayMultiIterObject *__pyx_v_self);
2973static CYTHON_INLINE PyObject *__pyx_f_5numpy_7ndarray_4base___get__(PyArrayObject *__pyx_v_self);
2974static CYTHON_INLINE PyArray_Descr *__pyx_f_5numpy_7ndarray_5descr___get__(PyArrayObject *__pyx_v_self);
2975static CYTHON_INLINE
int __pyx_f_5numpy_7ndarray_4ndim___get__(PyArrayObject *__pyx_v_self);
2976static CYTHON_INLINE npy_intp *__pyx_f_5numpy_7ndarray_5shape___get__(PyArrayObject *__pyx_v_self);
2977static CYTHON_INLINE npy_intp *__pyx_f_5numpy_7ndarray_7strides___get__(PyArrayObject *__pyx_v_self);
2978static CYTHON_INLINE npy_intp __pyx_f_5numpy_7ndarray_4size___get__(PyArrayObject *__pyx_v_self);
2979static CYTHON_INLINE
char *__pyx_f_5numpy_7ndarray_4data___get__(PyArrayObject *__pyx_v_self);
2980static CYTHON_INLINE
int __pyx_f_5numpy_5ufunc_3nin___get__(PyUFuncObject *__pyx_v_self);
2981static CYTHON_INLINE
int __pyx_f_5numpy_5ufunc_4nout___get__(PyUFuncObject *__pyx_v_self);
2982static CYTHON_INLINE
int __pyx_f_5numpy_5ufunc_5nargs___get__(PyUFuncObject *__pyx_v_self);
2983static CYTHON_INLINE PyUFuncGenericFunction *__pyx_f_5numpy_5ufunc_9functions___get__(PyUFuncObject *__pyx_v_self);
2984static CYTHON_INLINE
void **__pyx_f_5numpy_5ufunc_4data___get__(PyUFuncObject *__pyx_v_self);
2985static CYTHON_INLINE
int __pyx_f_5numpy_5ufunc_6ntypes___get__(PyUFuncObject *__pyx_v_self);
2986static CYTHON_INLINE
char const *__pyx_f_5numpy_5ufunc_4name___get__(PyUFuncObject *__pyx_v_self);
2987static CYTHON_INLINE
char const *__pyx_f_5numpy_5ufunc_3doc___get__(PyUFuncObject *__pyx_v_self);
2988static CYTHON_INLINE
void *__pyx_f_5numpy_5ufunc_3ptr___get__(PyUFuncObject *__pyx_v_self);
2989static CYTHON_INLINE PyObject *__pyx_f_5numpy_5ufunc_3obj___get__(PyUFuncObject *__pyx_v_self);
2990static CYTHON_INLINE PyObject *__pyx_f_5numpy_5ufunc_9userloops___get__(PyUFuncObject *__pyx_v_self);
3011static PyObject *__pyx_f_7clapack_lapackWrappersDCopy(
int, PyArrayObject *, PyArrayObject *);
3012static PyObject *__pyx_f_7clapack_lapackWrappersDenseFactorPrepare(
int, PyArrayObject *, PyArrayObject *);
3013static PyObject *__pyx_f_7clapack_lapackWrappersDenseFactorSolve(
int, PyArrayObject *, PyArrayObject *, PyArrayObject *);
3014static PyObject *__pyx_f_7clapack_lapackWrappersDenseCalculateEigenvalues(
char *,
char *,
int, PyArrayObject *,
int, PyArrayObject *, PyArrayObject *, PyArrayObject *,
int, PyArrayObject *,
int, PyArrayObject *,
int);
3017#define __Pyx_MODULE_NAME "clapack"
3018extern int __pyx_module_is_main_clapack;
3019int __pyx_module_is_main_clapack = 0;
3025static PyObject *__pyx_pf_7clapack_11DenseFactor___init__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_n);
3026static PyObject *__pyx_pf_7clapack_blasCopy(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_n, PyObject *__pyx_v_mat, PyObject *__pyx_v_denseFactor);
3027static PyObject *__pyx_pf_7clapack_2denseFactorPrepare(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_n, PyObject *__pyx_v_mat, PyObject *__pyx_v_denseFactor);
3028static PyObject *__pyx_pf_7clapack_4denseFactorSolve(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_n, CYTHON_UNUSED PyObject *__pyx_v_mat, PyObject *__pyx_v_denseFactor, PyObject *__pyx_v_b);
3029static PyObject *__pyx_pf_7clapack_6denseCalculateEigenvalues(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_jobvl, PyObject *__pyx_v_jobvr, PyObject *__pyx_v_n, PyObject *__pyx_v_leig, PyObject *__pyx_v_lda, PyObject *__pyx_v_eigenvalues_r, PyObject *__pyx_v_eigenvalues_i, PyObject *__pyx_v_leftEigenvectors, PyObject *__pyx_v_ldvl, PyObject *__pyx_v_rightEigenvectors, PyObject *__pyx_v_ldvr, PyObject *__pyx_v_work, PyObject *__pyx_v_lwork);
3033#ifndef CYTHON_SMALL_CODE
3034#if defined(__clang__)
3035 #define CYTHON_SMALL_CODE
3036#elif defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 3))
3037 #define CYTHON_SMALL_CODE __attribute__((cold))
3039 #define CYTHON_SMALL_CODE
3049 PyObject *__pyx_cython_runtime;
3050 PyObject *__pyx_empty_tuple;
3051 PyObject *__pyx_empty_bytes;
3052 PyObject *__pyx_empty_unicode;
3053 PyTypeObject *__pyx_ptype_7cpython_4type_type;
3054 PyTypeObject *__pyx_ptype_5numpy_dtype;
3055 PyTypeObject *__pyx_ptype_5numpy_flatiter;
3056 PyTypeObject *__pyx_ptype_5numpy_broadcast;
3057 PyTypeObject *__pyx_ptype_5numpy_ndarray;
3058 PyTypeObject *__pyx_ptype_5numpy_generic;
3059 PyTypeObject *__pyx_ptype_5numpy_number;
3060 PyTypeObject *__pyx_ptype_5numpy_integer;
3061 PyTypeObject *__pyx_ptype_5numpy_signedinteger;
3062 PyTypeObject *__pyx_ptype_5numpy_unsignedinteger;
3063 PyTypeObject *__pyx_ptype_5numpy_inexact;
3064 PyTypeObject *__pyx_ptype_5numpy_floating;
3065 PyTypeObject *__pyx_ptype_5numpy_complexfloating;
3066 PyTypeObject *__pyx_ptype_5numpy_flexible;
3067 PyTypeObject *__pyx_ptype_5numpy_character;
3068 PyTypeObject *__pyx_ptype_5numpy_ufunc;
3069 __Pyx_CachedCFunction __pyx_umethod_PyDict_Type_items;
3070 __Pyx_CachedCFunction __pyx_umethod_PyDict_Type_pop;
3071 __Pyx_CachedCFunction __pyx_umethod_PyDict_Type_values;
3072 PyObject *__pyx_tuple[1];
3073 PyObject *__pyx_codeobj_tab[5];
3074 PyObject *__pyx_string_tab[62];
3077PyTypeObject *__pyx_CommonTypesMetaclassType;
3080#if CYTHON_COMPILING_IN_LIMITED_API
3081PyObject *__Pyx_CachedMethodType;
3085PyTypeObject *__pyx_CyFunctionType;
3088struct __Pyx_CodeObjectCache __pyx_code_cache;
3096#if CYTHON_USE_MODULE_STATE
3099extern struct PyModuleDef __pyx_moduledef;
3102static struct PyModuleDef __pyx_moduledef;
3105#define __pyx_mstate_global (__Pyx_PyModule_GetState(__Pyx_State_FindModule(&__pyx_moduledef)))
3107#define __pyx_m (__Pyx_State_FindModule(&__pyx_moduledef))
3109static __pyx_mstatetype __pyx_mstate_global_static =
3115static __pyx_mstatetype *
const __pyx_mstate_global = &__pyx_mstate_global_static;
3118#define __pyx_kp_u_ __pyx_string_tab[0]
3119#define __pyx_kp_u_numpy__core_multiarray_failed_to __pyx_string_tab[1]
3120#define __pyx_kp_u_numpy__core_umath_failed_to_impo __pyx_string_tab[2]
3121#define __pyx_kp_u_proteus_clapack_pyx __pyx_string_tab[3]
3122#define __pyx_n_u_DF_lu __pyx_string_tab[4]
3123#define __pyx_n_u_DF_pivots __pyx_string_tab[5]
3124#define __pyx_n_u_DenseFactor __pyx_string_tab[6]
3125#define __pyx_n_u_DenseFactor___init __pyx_string_tab[7]
3126#define __pyx_n_u_Pyx_PyDict_NextRef __pyx_string_tab[8]
3127#define __pyx_n_u_annotate __pyx_string_tab[9]
3128#define __pyx_n_u_doc __pyx_string_tab[10]
3129#define __pyx_n_u_func __pyx_string_tab[11]
3130#define __pyx_n_u_init __pyx_string_tab[12]
3131#define __pyx_n_u_main __pyx_string_tab[13]
3132#define __pyx_n_u_metaclass __pyx_string_tab[14]
3133#define __pyx_n_u_module __pyx_string_tab[15]
3134#define __pyx_n_u_name __pyx_string_tab[16]
3135#define __pyx_n_u_prepare __pyx_string_tab[17]
3136#define __pyx_n_u_qualname __pyx_string_tab[18]
3137#define __pyx_n_u_test __pyx_string_tab[19]
3138#define __pyx_n_u_is_coroutine __pyx_string_tab[20]
3139#define __pyx_n_u_asyncio_coroutines __pyx_string_tab[21]
3140#define __pyx_n_u_b __pyx_string_tab[22]
3141#define __pyx_n_u_blasCopy __pyx_string_tab[23]
3142#define __pyx_n_u_clapack __pyx_string_tab[24]
3143#define __pyx_n_u_cline_in_traceback __pyx_string_tab[25]
3144#define __pyx_n_u_denseCalculateEigenvalues __pyx_string_tab[26]
3145#define __pyx_n_u_denseFactor __pyx_string_tab[27]
3146#define __pyx_n_u_denseFactorPrepare __pyx_string_tab[28]
3147#define __pyx_n_u_denseFactorSolve __pyx_string_tab[29]
3148#define __pyx_n_u_dtype __pyx_string_tab[30]
3149#define __pyx_n_u_eigenvalues_i __pyx_string_tab[31]
3150#define __pyx_n_u_eigenvalues_r __pyx_string_tab[32]
3151#define __pyx_n_u_int32 __pyx_string_tab[33]
3152#define __pyx_n_u_items __pyx_string_tab[34]
3153#define __pyx_n_u_jobvl __pyx_string_tab[35]
3154#define __pyx_n_u_jobvr __pyx_string_tab[36]
3155#define __pyx_n_u_lda __pyx_string_tab[37]
3156#define __pyx_n_u_ldvl __pyx_string_tab[38]
3157#define __pyx_n_u_ldvr __pyx_string_tab[39]
3158#define __pyx_n_u_leftEigenvectors __pyx_string_tab[40]
3159#define __pyx_n_u_leig __pyx_string_tab[41]
3160#define __pyx_n_u_lu __pyx_string_tab[42]
3161#define __pyx_n_u_lwork __pyx_string_tab[43]
3162#define __pyx_n_u_mat __pyx_string_tab[44]
3163#define __pyx_n_u_n __pyx_string_tab[45]
3164#define __pyx_n_u_np __pyx_string_tab[46]
3165#define __pyx_n_u_numpy __pyx_string_tab[47]
3166#define __pyx_n_u_pivots __pyx_string_tab[48]
3167#define __pyx_n_u_pop __pyx_string_tab[49]
3168#define __pyx_n_u_rightEigenvectors __pyx_string_tab[50]
3169#define __pyx_n_u_self __pyx_string_tab[51]
3170#define __pyx_n_u_setdefault __pyx_string_tab[52]
3171#define __pyx_n_u_shape __pyx_string_tab[53]
3172#define __pyx_n_u_values __pyx_string_tab[54]
3173#define __pyx_n_u_work __pyx_string_tab[55]
3174#define __pyx_n_u_zeros __pyx_string_tab[56]
3175#define __pyx_kp_b_iso88591_Kq_q __pyx_string_tab[57]
3176#define __pyx_kp_b_iso88591_1_Kq_q_AQ __pyx_string_tab[58]
3177#define __pyx_kp_b_iso88591_1_Kq_1 __pyx_string_tab[59]
3178#define __pyx_kp_b_iso88591_X_1A __pyx_string_tab[60]
3179#define __pyx_kp_b_iso88591_A_E_F_F_7_D_a_Jb_avS_a __pyx_string_tab[61]
3181#if CYTHON_USE_MODULE_STATE
3182static CYTHON_SMALL_CODE
int __pyx_m_clear(PyObject *m) {
3183 __pyx_mstatetype *clear_module_state = __Pyx_PyModule_GetState(m);
3184 if (!clear_module_state)
return 0;
3185 Py_CLEAR(clear_module_state->__pyx_d);
3186 Py_CLEAR(clear_module_state->__pyx_b);
3187 Py_CLEAR(clear_module_state->__pyx_cython_runtime);
3188 Py_CLEAR(clear_module_state->__pyx_empty_tuple);
3189 Py_CLEAR(clear_module_state->__pyx_empty_bytes);
3190 Py_CLEAR(clear_module_state->__pyx_empty_unicode);
3191 #if CYTHON_PEP489_MULTI_PHASE_INIT
3192 __Pyx_State_RemoveModule(NULL);
3194 Py_CLEAR(clear_module_state->__pyx_ptype_7cpython_4type_type);
3195 Py_CLEAR(clear_module_state->__pyx_ptype_5numpy_dtype);
3196 Py_CLEAR(clear_module_state->__pyx_ptype_5numpy_flatiter);
3197 Py_CLEAR(clear_module_state->__pyx_ptype_5numpy_broadcast);
3198 Py_CLEAR(clear_module_state->__pyx_ptype_5numpy_ndarray);
3199 Py_CLEAR(clear_module_state->__pyx_ptype_5numpy_generic);
3200 Py_CLEAR(clear_module_state->__pyx_ptype_5numpy_number);
3201 Py_CLEAR(clear_module_state->__pyx_ptype_5numpy_integer);
3202 Py_CLEAR(clear_module_state->__pyx_ptype_5numpy_signedinteger);
3203 Py_CLEAR(clear_module_state->__pyx_ptype_5numpy_unsignedinteger);
3204 Py_CLEAR(clear_module_state->__pyx_ptype_5numpy_inexact);
3205 Py_CLEAR(clear_module_state->__pyx_ptype_5numpy_floating);
3206 Py_CLEAR(clear_module_state->__pyx_ptype_5numpy_complexfloating);
3207 Py_CLEAR(clear_module_state->__pyx_ptype_5numpy_flexible);
3208 Py_CLEAR(clear_module_state->__pyx_ptype_5numpy_character);
3209 Py_CLEAR(clear_module_state->__pyx_ptype_5numpy_ufunc);
3210 Py_CLEAR(clear_module_state->__pyx_umethod_PyDict_Type_items.method);
3211 Py_CLEAR(clear_module_state->__pyx_umethod_PyDict_Type_pop.method);
3212 Py_CLEAR(clear_module_state->__pyx_umethod_PyDict_Type_values.method);
3213 for (
int i=0; i<1; ++i) { Py_CLEAR(clear_module_state->__pyx_tuple[i]); }
3214 for (
int i=0; i<5; ++i) { Py_CLEAR(clear_module_state->__pyx_codeobj_tab[i]); }
3215 for (
int i=0; i<62; ++i) { Py_CLEAR(clear_module_state->__pyx_string_tab[i]); }
3218Py_CLEAR(clear_module_state->__pyx_CommonTypesMetaclassType);
3221Py_CLEAR(clear_module_state->__pyx_CyFunctionType);
3228#if CYTHON_USE_MODULE_STATE
3229static CYTHON_SMALL_CODE
int __pyx_m_traverse(PyObject *m, visitproc visit,
void *arg) {
3230 __pyx_mstatetype *traverse_module_state = __Pyx_PyModule_GetState(m);
3231 if (!traverse_module_state)
return 0;
3232 Py_VISIT(traverse_module_state->__pyx_d);
3233 Py_VISIT(traverse_module_state->__pyx_b);
3234 Py_VISIT(traverse_module_state->__pyx_cython_runtime);
3235 __Pyx_VISIT_CONST(traverse_module_state->__pyx_empty_tuple);
3236 __Pyx_VISIT_CONST(traverse_module_state->__pyx_empty_bytes);
3237 __Pyx_VISIT_CONST(traverse_module_state->__pyx_empty_unicode);
3238 Py_VISIT(traverse_module_state->__pyx_ptype_7cpython_4type_type);
3239 Py_VISIT(traverse_module_state->__pyx_ptype_5numpy_dtype);
3240 Py_VISIT(traverse_module_state->__pyx_ptype_5numpy_flatiter);
3241 Py_VISIT(traverse_module_state->__pyx_ptype_5numpy_broadcast);
3242 Py_VISIT(traverse_module_state->__pyx_ptype_5numpy_ndarray);
3243 Py_VISIT(traverse_module_state->__pyx_ptype_5numpy_generic);
3244 Py_VISIT(traverse_module_state->__pyx_ptype_5numpy_number);
3245 Py_VISIT(traverse_module_state->__pyx_ptype_5numpy_integer);
3246 Py_VISIT(traverse_module_state->__pyx_ptype_5numpy_signedinteger);
3247 Py_VISIT(traverse_module_state->__pyx_ptype_5numpy_unsignedinteger);
3248 Py_VISIT(traverse_module_state->__pyx_ptype_5numpy_inexact);
3249 Py_VISIT(traverse_module_state->__pyx_ptype_5numpy_floating);
3250 Py_VISIT(traverse_module_state->__pyx_ptype_5numpy_complexfloating);
3251 Py_VISIT(traverse_module_state->__pyx_ptype_5numpy_flexible);
3252 Py_VISIT(traverse_module_state->__pyx_ptype_5numpy_character);
3253 Py_VISIT(traverse_module_state->__pyx_ptype_5numpy_ufunc);
3254 Py_VISIT(traverse_module_state->__pyx_umethod_PyDict_Type_items.method);
3255 Py_VISIT(traverse_module_state->__pyx_umethod_PyDict_Type_pop.method);
3256 Py_VISIT(traverse_module_state->__pyx_umethod_PyDict_Type_values.method);
3257 for (
int i=0; i<1; ++i) { __Pyx_VISIT_CONST(traverse_module_state->__pyx_tuple[i]); }
3258 for (
int i=0; i<5; ++i) { __Pyx_VISIT_CONST(traverse_module_state->__pyx_codeobj_tab[i]); }
3259 for (
int i=0; i<62; ++i) { __Pyx_VISIT_CONST(traverse_module_state->__pyx_string_tab[i]); }
3262Py_VISIT(traverse_module_state->__pyx_CommonTypesMetaclassType);
3265Py_VISIT(traverse_module_state->__pyx_CyFunctionType);
3281static CYTHON_INLINE PyTypeObject *__pyx_f_5numpy_5dtype_7typeobj___get__(PyArray_Descr *__pyx_v_self) {
3282 PyTypeObject *__pyx_r;
3293 __pyx_r = PyDataType_TYPEOBJ(__pyx_v_self);
3318static CYTHON_INLINE
char __pyx_f_5numpy_5dtype_4kind___get__(PyArray_Descr *__pyx_v_self) {
3330 __pyx_r = PyDataType_KIND(__pyx_v_self);
3355static CYTHON_INLINE
char __pyx_f_5numpy_5dtype_4type___get__(PyArray_Descr *__pyx_v_self) {
3367 __pyx_r = PyDataType_TYPE(__pyx_v_self);
3392static CYTHON_INLINE
char __pyx_f_5numpy_5dtype_9byteorder___get__(PyArray_Descr *__pyx_v_self) {
3404 __pyx_r = PyDataType_BYTEORDER(__pyx_v_self);
3429static CYTHON_INLINE
int __pyx_f_5numpy_5dtype_8type_num___get__(PyArray_Descr *__pyx_v_self) {
3441 __pyx_r = PyDataType_TYPENUM(__pyx_v_self);
3466static CYTHON_INLINE npy_intp __pyx_f_5numpy_5dtype_8itemsize___get__(PyArray_Descr *__pyx_v_self) {
3478 __pyx_r = PyDataType_ELSIZE(__pyx_v_self);
3503static CYTHON_INLINE npy_intp __pyx_f_5numpy_5dtype_9alignment___get__(PyArray_Descr *__pyx_v_self) {
3515 __pyx_r = PyDataType_ALIGNMENT(__pyx_v_self);
3540static CYTHON_INLINE PyObject *__pyx_f_5numpy_5dtype_6fields___get__(PyArray_Descr *__pyx_v_self) {
3541 PyObject *__pyx_r = NULL;
3542 __Pyx_RefNannyDeclarations
3543 PyObject *__pyx_t_1;
3544 __Pyx_RefNannySetupContext(
"__get__", 0);
3553 __pyx_t_1 = PyDataType_FIELDS(__pyx_v_self);
3556 PyObject *__pyx_temp;
3558 __pyx_temp = __pyx_r;
3559 __Pyx_INCREF(((PyObject *)__pyx_t_1));
3560 __pyx_r = ((PyObject *)__pyx_t_1);
3562 __Pyx_XDECREF(__pyx_temp);
3577 __Pyx_XGIVEREF(__pyx_r);
3578 __Pyx_RefNannyFinishContext();
3590static CYTHON_INLINE PyObject *__pyx_f_5numpy_5dtype_5names___get__(PyArray_Descr *__pyx_v_self) {
3591 PyObject *__pyx_r = NULL;
3592 __Pyx_RefNannyDeclarations
3593 PyObject *__pyx_t_1;
3594 __Pyx_RefNannySetupContext(
"__get__", 0);
3603 __pyx_t_1 = PyDataType_NAMES(__pyx_v_self);
3606 PyObject *__pyx_temp;
3608 __pyx_temp = __pyx_r;
3609 __Pyx_INCREF(((PyObject*)__pyx_t_1));
3610 __pyx_r = ((PyObject*)__pyx_t_1);
3612 __Pyx_XDECREF(__pyx_temp);
3627 __Pyx_XGIVEREF(__pyx_r);
3628 __Pyx_RefNannyFinishContext();
3640static CYTHON_INLINE PyArray_ArrayDescr *__pyx_f_5numpy_5dtype_8subarray___get__(PyArray_Descr *__pyx_v_self) {
3641 PyArray_ArrayDescr *__pyx_r;
3652 __pyx_r = PyDataType_SUBARRAY(__pyx_v_self);
3677static CYTHON_INLINE npy_uint64 __pyx_f_5numpy_5dtype_5flags___get__(PyArray_Descr *__pyx_v_self) {
3689 __pyx_r = PyDataType_FLAGS(__pyx_v_self);
3714static CYTHON_INLINE
int __pyx_f_5numpy_9broadcast_7numiter___get__(PyArrayMultiIterObject *__pyx_v_self) {
3726 __pyx_r = PyArray_MultiIter_NUMITER(__pyx_v_self);
3751static CYTHON_INLINE npy_intp __pyx_f_5numpy_9broadcast_4size___get__(PyArrayMultiIterObject *__pyx_v_self) {
3763 __pyx_r = PyArray_MultiIter_SIZE(__pyx_v_self);
3788static CYTHON_INLINE npy_intp __pyx_f_5numpy_9broadcast_5index___get__(PyArrayMultiIterObject *__pyx_v_self) {
3800 __pyx_r = PyArray_MultiIter_INDEX(__pyx_v_self);
3825static CYTHON_INLINE
int __pyx_f_5numpy_9broadcast_2nd___get__(PyArrayMultiIterObject *__pyx_v_self) {
3837 __pyx_r = PyArray_MultiIter_NDIM(__pyx_v_self);
3862static CYTHON_INLINE npy_intp *__pyx_f_5numpy_9broadcast_10dimensions___get__(PyArrayMultiIterObject *__pyx_v_self) {
3874 __pyx_r = PyArray_MultiIter_DIMS(__pyx_v_self);
3899static CYTHON_INLINE
void **__pyx_f_5numpy_9broadcast_5iters___get__(PyArrayMultiIterObject *__pyx_v_self) {
3911 __pyx_r = PyArray_MultiIter_ITERS(__pyx_v_self);
3936static CYTHON_INLINE PyObject *__pyx_f_5numpy_7ndarray_4base___get__(PyArrayObject *__pyx_v_self) {
3948 __pyx_r = PyArray_BASE(__pyx_v_self);
3973static CYTHON_INLINE PyArray_Descr *__pyx_f_5numpy_7ndarray_5descr___get__(PyArrayObject *__pyx_v_self) {
3974 PyArray_Descr *__pyx_r = NULL;
3975 __Pyx_RefNannyDeclarations
3976 PyArray_Descr *__pyx_t_1;
3977 __Pyx_RefNannySetupContext(
"__get__", 0);
3986 __pyx_t_1 = PyArray_DESCR(__pyx_v_self);
3989 PyArray_Descr *__pyx_temp;
3991 __pyx_temp = __pyx_r;
3992 __Pyx_INCREF((PyObject *)((PyArray_Descr *)__pyx_t_1));
3993 __pyx_r = ((PyArray_Descr *)__pyx_t_1);
3995 __Pyx_XDECREF((PyObject *)__pyx_temp);
4010 __Pyx_XGIVEREF((PyObject *)__pyx_r);
4011 __Pyx_RefNannyFinishContext();
4023static CYTHON_INLINE
int __pyx_f_5numpy_7ndarray_4ndim___get__(PyArrayObject *__pyx_v_self) {
4035 __pyx_r = PyArray_NDIM(__pyx_v_self);
4060static CYTHON_INLINE npy_intp *__pyx_f_5numpy_7ndarray_5shape___get__(PyArrayObject *__pyx_v_self) {
4072 __pyx_r = PyArray_DIMS(__pyx_v_self);
4097static CYTHON_INLINE npy_intp *__pyx_f_5numpy_7ndarray_7strides___get__(PyArrayObject *__pyx_v_self) {
4109 __pyx_r = PyArray_STRIDES(__pyx_v_self);
4134static CYTHON_INLINE npy_intp __pyx_f_5numpy_7ndarray_4size___get__(PyArrayObject *__pyx_v_self) {
4146 __pyx_r = PyArray_SIZE(__pyx_v_self);
4171static CYTHON_INLINE
char *__pyx_f_5numpy_7ndarray_4data___get__(PyArrayObject *__pyx_v_self) {
4183 __pyx_r = PyArray_BYTES(__pyx_v_self);
4208static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew1(PyObject *__pyx_v_a) {
4209 PyObject *__pyx_r = NULL;
4210 __Pyx_RefNannyDeclarations
4211 PyObject *__pyx_t_1 = NULL;
4212 int __pyx_lineno = 0;
4213 const char *__pyx_filename = NULL;
4214 int __pyx_clineno = 0;
4215 __Pyx_RefNannySetupContext(
"PyArray_MultiIterNew1", 0);
4224 __pyx_t_1 = PyArray_MultiIterNew(1, ((
void *)__pyx_v_a));
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 795, __pyx_L1_error)
4225 __Pyx_GOTREF(__pyx_t_1);
4227 PyObject *__pyx_temp;
4229 __pyx_temp = __pyx_r;
4230 __pyx_r = __pyx_t_1;
4232 __Pyx_XDECREF(__pyx_temp);
4247 __Pyx_XDECREF(__pyx_t_1);
4248 __Pyx_AddTraceback(
"numpy.PyArray_MultiIterNew1", __pyx_clineno, __pyx_lineno, __pyx_filename);
4251 __Pyx_XGIVEREF(__pyx_r);
4252 __Pyx_RefNannyFinishContext();
4264static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew2(PyObject *__pyx_v_a, PyObject *__pyx_v_b) {
4265 PyObject *__pyx_r = NULL;
4266 __Pyx_RefNannyDeclarations
4267 PyObject *__pyx_t_1 = NULL;
4268 int __pyx_lineno = 0;
4269 const char *__pyx_filename = NULL;
4270 int __pyx_clineno = 0;
4271 __Pyx_RefNannySetupContext(
"PyArray_MultiIterNew2", 0);
4280 __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)
4281 __Pyx_GOTREF(__pyx_t_1);
4283 PyObject *__pyx_temp;
4285 __pyx_temp = __pyx_r;
4286 __pyx_r = __pyx_t_1;
4288 __Pyx_XDECREF(__pyx_temp);
4303 __Pyx_XDECREF(__pyx_t_1);
4304 __Pyx_AddTraceback(
"numpy.PyArray_MultiIterNew2", __pyx_clineno, __pyx_lineno, __pyx_filename);
4307 __Pyx_XGIVEREF(__pyx_r);
4308 __Pyx_RefNannyFinishContext();
4320static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew3(PyObject *__pyx_v_a, PyObject *__pyx_v_b, PyObject *__pyx_v_c) {
4321 PyObject *__pyx_r = NULL;
4322 __Pyx_RefNannyDeclarations
4323 PyObject *__pyx_t_1 = NULL;
4324 int __pyx_lineno = 0;
4325 const char *__pyx_filename = NULL;
4326 int __pyx_clineno = 0;
4327 __Pyx_RefNannySetupContext(
"PyArray_MultiIterNew3", 0);
4336 __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)
4337 __Pyx_GOTREF(__pyx_t_1);
4339 PyObject *__pyx_temp;
4341 __pyx_temp = __pyx_r;
4342 __pyx_r = __pyx_t_1;
4344 __Pyx_XDECREF(__pyx_temp);
4359 __Pyx_XDECREF(__pyx_t_1);
4360 __Pyx_AddTraceback(
"numpy.PyArray_MultiIterNew3", __pyx_clineno, __pyx_lineno, __pyx_filename);
4363 __Pyx_XGIVEREF(__pyx_r);
4364 __Pyx_RefNannyFinishContext();
4376static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew4(PyObject *__pyx_v_a, PyObject *__pyx_v_b, PyObject *__pyx_v_c, PyObject *__pyx_v_d) {
4377 PyObject *__pyx_r = NULL;
4378 __Pyx_RefNannyDeclarations
4379 PyObject *__pyx_t_1 = NULL;
4380 int __pyx_lineno = 0;
4381 const char *__pyx_filename = NULL;
4382 int __pyx_clineno = 0;
4383 __Pyx_RefNannySetupContext(
"PyArray_MultiIterNew4", 0);
4392 __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)
4393 __Pyx_GOTREF(__pyx_t_1);
4395 PyObject *__pyx_temp;
4397 __pyx_temp = __pyx_r;
4398 __pyx_r = __pyx_t_1;
4400 __Pyx_XDECREF(__pyx_temp);
4415 __Pyx_XDECREF(__pyx_t_1);
4416 __Pyx_AddTraceback(
"numpy.PyArray_MultiIterNew4", __pyx_clineno, __pyx_lineno, __pyx_filename);
4419 __Pyx_XGIVEREF(__pyx_r);
4420 __Pyx_RefNannyFinishContext();
4432static 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) {
4433 PyObject *__pyx_r = NULL;
4434 __Pyx_RefNannyDeclarations
4435 PyObject *__pyx_t_1 = NULL;
4436 int __pyx_lineno = 0;
4437 const char *__pyx_filename = NULL;
4438 int __pyx_clineno = 0;
4439 __Pyx_RefNannySetupContext(
"PyArray_MultiIterNew5", 0);
4448 __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)
4449 __Pyx_GOTREF(__pyx_t_1);
4451 PyObject *__pyx_temp;
4453 __pyx_temp = __pyx_r;
4454 __pyx_r = __pyx_t_1;
4456 __Pyx_XDECREF(__pyx_temp);
4471 __Pyx_XDECREF(__pyx_t_1);
4472 __Pyx_AddTraceback(
"numpy.PyArray_MultiIterNew5", __pyx_clineno, __pyx_lineno, __pyx_filename);
4475 __Pyx_XGIVEREF(__pyx_r);
4476 __Pyx_RefNannyFinishContext();
4488static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyDataType_SHAPE(PyArray_Descr *__pyx_v_d) {
4489 PyObject *__pyx_r = NULL;
4490 __Pyx_RefNannyDeclarations
4492 PyObject *__pyx_t_2;
4493 __Pyx_RefNannySetupContext(
"PyDataType_SHAPE", 0);
4502 __pyx_t_1 = PyDataType_HASSUBARRAY(__pyx_v_d);
4514 __pyx_t_2 = __pyx_f_5numpy_5dtype_8subarray___get__(__pyx_v_d)->shape;
4517 PyObject *__pyx_temp;
4519 __pyx_temp = __pyx_r;
4520 __Pyx_INCREF(((PyObject*)__pyx_t_2));
4521 __pyx_r = ((PyObject*)__pyx_t_2);
4523 __Pyx_XDECREF(__pyx_temp);
4546 PyObject *__pyx_temp;
4548 __pyx_temp = __pyx_r;
4549 __Pyx_INCREF(__pyx_mstate_global->__pyx_empty_tuple);
4550 __pyx_r = __pyx_mstate_global->__pyx_empty_tuple;
4552 __Pyx_XDECREF(__pyx_temp);
4567 __Pyx_XGIVEREF(__pyx_r);
4568 __Pyx_RefNannyFinishContext();
4580static CYTHON_INLINE
int __pyx_f_5numpy_5ufunc_3nin___get__(PyUFuncObject *__pyx_v_self) {
4592 __pyx_r = _PyUFuncObject_GET_ITEM_DATA(__pyx_v_self)->nin;
4617static CYTHON_INLINE
int __pyx_f_5numpy_5ufunc_4nout___get__(PyUFuncObject *__pyx_v_self) {
4629 __pyx_r = _PyUFuncObject_GET_ITEM_DATA(__pyx_v_self)->nout;
4654static CYTHON_INLINE
int __pyx_f_5numpy_5ufunc_5nargs___get__(PyUFuncObject *__pyx_v_self) {
4666 __pyx_r = _PyUFuncObject_GET_ITEM_DATA(__pyx_v_self)->nargs;
4691static CYTHON_INLINE PyUFuncGenericFunction *__pyx_f_5numpy_5ufunc_9functions___get__(PyUFuncObject *__pyx_v_self) {
4692 PyUFuncGenericFunction *__pyx_r;
4703 __pyx_r = _PyUFuncObject_GET_ITEM_DATA(__pyx_v_self)->functions;
4728static CYTHON_INLINE
void **__pyx_f_5numpy_5ufunc_4data___get__(PyUFuncObject *__pyx_v_self) {
4740 __pyx_r = ((
void **)_PyUFuncObject_GET_ITEM_DATA(__pyx_v_self)->data);
4765static CYTHON_INLINE
int __pyx_f_5numpy_5ufunc_6ntypes___get__(PyUFuncObject *__pyx_v_self) {
4777 __pyx_r = _PyUFuncObject_GET_ITEM_DATA(__pyx_v_self)->ntypes;
4802static CYTHON_INLINE
char const *__pyx_f_5numpy_5ufunc_4name___get__(PyUFuncObject *__pyx_v_self) {
4803 char const *__pyx_r;
4814 __pyx_r = _PyUFuncObject_GET_ITEM_DATA(__pyx_v_self)->name;
4839static CYTHON_INLINE
char const *__pyx_f_5numpy_5ufunc_3doc___get__(PyUFuncObject *__pyx_v_self) {
4840 char const *__pyx_r;
4851 __pyx_r = _PyUFuncObject_GET_ITEM_DATA(__pyx_v_self)->doc;
4876static CYTHON_INLINE
void *__pyx_f_5numpy_5ufunc_3ptr___get__(PyUFuncObject *__pyx_v_self) {
4888 __pyx_r = _PyUFuncObject_GET_ITEM_DATA(__pyx_v_self)->ptr;
4913static CYTHON_INLINE PyObject *__pyx_f_5numpy_5ufunc_3obj___get__(PyUFuncObject *__pyx_v_self) {
4925 __pyx_r = _PyUFuncObject_GET_ITEM_DATA(__pyx_v_self)->obj;
4950static CYTHON_INLINE PyObject *__pyx_f_5numpy_5ufunc_9userloops___get__(PyUFuncObject *__pyx_v_self) {
4962 __pyx_r = _PyUFuncObject_GET_ITEM_DATA(__pyx_v_self)->userloops;
4987static CYTHON_INLINE
void __pyx_f_5numpy_set_array_base(PyArrayObject *__pyx_v_arr, PyObject *__pyx_v_base) {
4989 int __pyx_lineno = 0;
4990 const char *__pyx_filename = NULL;
4991 int __pyx_clineno = 0;
5000 Py_INCREF(__pyx_v_base);
5009 __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)
5023 __Pyx_AddTraceback(
"numpy.set_array_base", __pyx_clineno, __pyx_lineno, __pyx_filename);
5036static CYTHON_INLINE PyObject *__pyx_f_5numpy_get_array_base(PyArrayObject *__pyx_v_arr) {
5037 PyObject *__pyx_v_base;
5038 PyObject *__pyx_r = NULL;
5039 __Pyx_RefNannyDeclarations
5041 __Pyx_RefNannySetupContext(
"get_array_base", 0);
5050 __pyx_v_base = PyArray_BASE(__pyx_v_arr);
5059 __pyx_t_1 = (__pyx_v_base == NULL);
5072 PyObject *__pyx_temp;
5074 __pyx_temp = __pyx_r;
5075 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
5077 __Pyx_XDECREF(__pyx_temp);
5098 PyObject *__pyx_temp;
5100 __pyx_temp = __pyx_r;
5101 __Pyx_INCREF(((PyObject *)__pyx_v_base));
5102 __pyx_r = ((PyObject *)__pyx_v_base);
5104 __Pyx_XDECREF(__pyx_temp);
5119 __Pyx_XGIVEREF(__pyx_r);
5120 __Pyx_RefNannyFinishContext();
5132static CYTHON_INLINE
int __pyx_f_5numpy_import_array(
void) {
5134 __Pyx_RefNannyDeclarations
5135 PyObject *__pyx_t_1 = NULL;
5136 PyObject *__pyx_t_2 = NULL;
5137 PyObject *__pyx_t_3 = NULL;
5139 PyObject *__pyx_t_5 = NULL;
5140 PyObject *__pyx_t_6 = NULL;
5141 PyObject *__pyx_t_7 = NULL;
5142 PyObject *__pyx_t_8 = NULL;
5143 PyObject *__pyx_t_9 = NULL;
5145 int __pyx_lineno = 0;
5146 const char *__pyx_filename = NULL;
5147 int __pyx_clineno = 0;
5148 __Pyx_RefNannySetupContext(
"import_array", 0);
5158 __Pyx_PyThreadState_declare
5159 __Pyx_PyThreadState_assign
5160 __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
5161 __Pyx_XGOTREF(__pyx_t_1);
5162 __Pyx_XGOTREF(__pyx_t_2);
5163 __Pyx_XGOTREF(__pyx_t_3);
5173 __pyx_t_4 = _import_array();
if (unlikely(__pyx_t_4 == ((
int)-1))) __PYX_ERR(1, 1079, __pyx_L3_error)
5184 __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
5185 __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
5186 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
5187 goto __pyx_L8_try_end;
5197 __pyx_t_4 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(((PyTypeObject*)PyExc_Exception))));
5199 __Pyx_AddTraceback(
"numpy.import_array", __pyx_clineno, __pyx_lineno, __pyx_filename);
5200 if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(1, 1080, __pyx_L5_except_error)
5201 __Pyx_XGOTREF(__pyx_t_5);
5202 __Pyx_XGOTREF(__pyx_t_6);
5203 __Pyx_XGOTREF(__pyx_t_7);
5215 PyObject *__pyx_callargs[2] = {__pyx_t_9, __pyx_mstate_global->__pyx_kp_u_numpy__core_multiarray_failed_to};
5216 __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));
5217 __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
5218 if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 1081, __pyx_L5_except_error)
5219 __Pyx_GOTREF(__pyx_t_8);
5221 __Pyx_Raise(__pyx_t_8, 0, 0, 0);
5222 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
5223 __PYX_ERR(1, 1081, __pyx_L5_except_error)
5225 goto __pyx_L5_except_error;
5234 __pyx_L5_except_error:;
5235 __Pyx_XGIVEREF(__pyx_t_1);
5236 __Pyx_XGIVEREF(__pyx_t_2);
5237 __Pyx_XGIVEREF(__pyx_t_3);
5238 __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
5239 goto __pyx_L1_error;
5255 __Pyx_XDECREF(__pyx_t_5);
5256 __Pyx_XDECREF(__pyx_t_6);
5257 __Pyx_XDECREF(__pyx_t_7);
5258 __Pyx_XDECREF(__pyx_t_8);
5259 __Pyx_XDECREF(__pyx_t_9);
5260 __Pyx_AddTraceback(
"numpy.import_array", __pyx_clineno, __pyx_lineno, __pyx_filename);
5264 __Pyx_RefNannyFinishContext();
5276static CYTHON_INLINE
int __pyx_f_5numpy_import_umath(
void) {
5278 __Pyx_RefNannyDeclarations
5279 PyObject *__pyx_t_1 = NULL;
5280 PyObject *__pyx_t_2 = NULL;
5281 PyObject *__pyx_t_3 = NULL;
5283 PyObject *__pyx_t_5 = NULL;
5284 PyObject *__pyx_t_6 = NULL;
5285 PyObject *__pyx_t_7 = NULL;
5286 PyObject *__pyx_t_8 = NULL;
5287 PyObject *__pyx_t_9 = NULL;
5289 int __pyx_lineno = 0;
5290 const char *__pyx_filename = NULL;
5291 int __pyx_clineno = 0;
5292 __Pyx_RefNannySetupContext(
"import_umath", 0);
5302 __Pyx_PyThreadState_declare
5303 __Pyx_PyThreadState_assign
5304 __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
5305 __Pyx_XGOTREF(__pyx_t_1);
5306 __Pyx_XGOTREF(__pyx_t_2);
5307 __Pyx_XGOTREF(__pyx_t_3);
5317 __pyx_t_4 = _import_umath();
if (unlikely(__pyx_t_4 == ((
int)-1))) __PYX_ERR(1, 1085, __pyx_L3_error)
5328 __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
5329 __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
5330 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
5331 goto __pyx_L8_try_end;
5341 __pyx_t_4 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(((PyTypeObject*)PyExc_Exception))));
5343 __Pyx_AddTraceback(
"numpy.import_umath", __pyx_clineno, __pyx_lineno, __pyx_filename);
5344 if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(1, 1086, __pyx_L5_except_error)
5345 __Pyx_XGOTREF(__pyx_t_5);
5346 __Pyx_XGOTREF(__pyx_t_6);
5347 __Pyx_XGOTREF(__pyx_t_7);
5359 PyObject *__pyx_callargs[2] = {__pyx_t_9, __pyx_mstate_global->__pyx_kp_u_numpy__core_umath_failed_to_impo};
5360 __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));
5361 __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
5362 if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 1087, __pyx_L5_except_error)
5363 __Pyx_GOTREF(__pyx_t_8);
5365 __Pyx_Raise(__pyx_t_8, 0, 0, 0);
5366 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
5367 __PYX_ERR(1, 1087, __pyx_L5_except_error)
5369 goto __pyx_L5_except_error;
5378 __pyx_L5_except_error:;
5379 __Pyx_XGIVEREF(__pyx_t_1);
5380 __Pyx_XGIVEREF(__pyx_t_2);
5381 __Pyx_XGIVEREF(__pyx_t_3);
5382 __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
5383 goto __pyx_L1_error;
5399 __Pyx_XDECREF(__pyx_t_5);
5400 __Pyx_XDECREF(__pyx_t_6);
5401 __Pyx_XDECREF(__pyx_t_7);
5402 __Pyx_XDECREF(__pyx_t_8);
5403 __Pyx_XDECREF(__pyx_t_9);
5404 __Pyx_AddTraceback(
"numpy.import_umath", __pyx_clineno, __pyx_lineno, __pyx_filename);
5408 __Pyx_RefNannyFinishContext();
5420static CYTHON_INLINE
int __pyx_f_5numpy_import_ufunc(
void) {
5422 __Pyx_RefNannyDeclarations
5423 PyObject *__pyx_t_1 = NULL;
5424 PyObject *__pyx_t_2 = NULL;
5425 PyObject *__pyx_t_3 = NULL;
5427 PyObject *__pyx_t_5 = NULL;
5428 PyObject *__pyx_t_6 = NULL;
5429 PyObject *__pyx_t_7 = NULL;
5430 PyObject *__pyx_t_8 = NULL;
5431 PyObject *__pyx_t_9 = NULL;
5433 int __pyx_lineno = 0;
5434 const char *__pyx_filename = NULL;
5435 int __pyx_clineno = 0;
5436 __Pyx_RefNannySetupContext(
"import_ufunc", 0);
5446 __Pyx_PyThreadState_declare
5447 __Pyx_PyThreadState_assign
5448 __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
5449 __Pyx_XGOTREF(__pyx_t_1);
5450 __Pyx_XGOTREF(__pyx_t_2);
5451 __Pyx_XGOTREF(__pyx_t_3);
5461 __pyx_t_4 = _import_umath();
if (unlikely(__pyx_t_4 == ((
int)-1))) __PYX_ERR(1, 1091, __pyx_L3_error)
5472 __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
5473 __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
5474 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
5475 goto __pyx_L8_try_end;
5485 __pyx_t_4 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(((PyTypeObject*)PyExc_Exception))));
5487 __Pyx_AddTraceback(
"numpy.import_ufunc", __pyx_clineno, __pyx_lineno, __pyx_filename);
5488 if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(1, 1092, __pyx_L5_except_error)
5489 __Pyx_XGOTREF(__pyx_t_5);
5490 __Pyx_XGOTREF(__pyx_t_6);
5491 __Pyx_XGOTREF(__pyx_t_7);
5503 PyObject *__pyx_callargs[2] = {__pyx_t_9, __pyx_mstate_global->__pyx_kp_u_numpy__core_umath_failed_to_impo};
5504 __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));
5505 __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
5506 if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 1093, __pyx_L5_except_error)
5507 __Pyx_GOTREF(__pyx_t_8);
5509 __Pyx_Raise(__pyx_t_8, 0, 0, 0);
5510 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
5511 __PYX_ERR(1, 1093, __pyx_L5_except_error)
5513 goto __pyx_L5_except_error;
5522 __pyx_L5_except_error:;
5523 __Pyx_XGIVEREF(__pyx_t_1);
5524 __Pyx_XGIVEREF(__pyx_t_2);
5525 __Pyx_XGIVEREF(__pyx_t_3);
5526 __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
5527 goto __pyx_L1_error;
5543 __Pyx_XDECREF(__pyx_t_5);
5544 __Pyx_XDECREF(__pyx_t_6);
5545 __Pyx_XDECREF(__pyx_t_7);
5546 __Pyx_XDECREF(__pyx_t_8);
5547 __Pyx_XDECREF(__pyx_t_9);
5548 __Pyx_AddTraceback(
"numpy.import_ufunc", __pyx_clineno, __pyx_lineno, __pyx_filename);
5552 __Pyx_RefNannyFinishContext();
5564static CYTHON_INLINE
int __pyx_f_5numpy_is_timedelta64_object(PyObject *__pyx_v_obj) {
5576 __pyx_r = PyObject_TypeCheck(__pyx_v_obj, (&PyTimedeltaArrType_Type));
5602static CYTHON_INLINE
int __pyx_f_5numpy_is_datetime64_object(PyObject *__pyx_v_obj) {
5614 __pyx_r = PyObject_TypeCheck(__pyx_v_obj, (&PyDatetimeArrType_Type));
5640static CYTHON_INLINE npy_datetime __pyx_f_5numpy_get_datetime64_value(PyObject *__pyx_v_obj) {
5641 npy_datetime __pyx_r;
5652 __pyx_r = _PyDatetimeScalarObject_GetValue(__pyx_v_obj);
5677static CYTHON_INLINE npy_timedelta __pyx_f_5numpy_get_timedelta64_value(PyObject *__pyx_v_obj) {
5678 npy_timedelta __pyx_r;
5689 __pyx_r = _PyTimedeltaScalarObject_GetValue(__pyx_v_obj);
5714static CYTHON_INLINE NPY_DATETIMEUNIT __pyx_f_5numpy_get_datetime64_unit(PyObject *__pyx_v_obj) {
5715 NPY_DATETIMEUNIT __pyx_r;
5726 __pyx_r = _PyDatetimeScalarObject_GetMetadata(__pyx_v_obj).base;
5752static PyObject *__pyx_pw_7clapack_11DenseFactor_1__init__(PyObject *__pyx_self,
5753#
if CYTHON_VECTORCALL
5754PyObject *
const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
5756PyObject *__pyx_args, PyObject *__pyx_kwds
5759static PyMethodDef __pyx_mdef_7clapack_11DenseFactor_1__init__ = {
"__init__", (PyCFunction)(
void(*)(
void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7clapack_11DenseFactor_1__init__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
5760static PyObject *__pyx_pw_7clapack_11DenseFactor_1__init__(PyObject *__pyx_self,
5761#
if CYTHON_VECTORCALL
5762PyObject *
const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
5764PyObject *__pyx_args, PyObject *__pyx_kwds
5767 PyObject *__pyx_v_self = 0;
5768 PyObject *__pyx_v_n = 0;
5769 #if !CYTHON_VECTORCALL
5770 CYTHON_UNUSED Py_ssize_t __pyx_nargs;
5772 CYTHON_UNUSED PyObject *
const *__pyx_kwvalues;
5773 PyObject* values[2] = {0,0};
5774 int __pyx_lineno = 0;
5775 const char *__pyx_filename = NULL;
5776 int __pyx_clineno = 0;
5777 PyObject *__pyx_r = 0;
5778 __Pyx_RefNannyDeclarations
5779 __Pyx_RefNannySetupContext(
"__init__ (wrapper)", 0);
5780 #if !CYTHON_VECTORCALL
5781 #if CYTHON_ASSUME_SAFE_SIZE
5782 __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
5784 __pyx_nargs = PyTuple_Size(__pyx_args);
if (unlikely(__pyx_nargs < 0))
return NULL;
5787 __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
5789 PyObject **
const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_self,&__pyx_mstate_global->__pyx_n_u_n,0};
5790 const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
5791 if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(0, 18, __pyx_L3_error)
5792 if (__pyx_kwds_len > 0) {
5793 switch (__pyx_nargs) {
5795 values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
5796 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 18, __pyx_L3_error)
5799 values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
5800 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 18, __pyx_L3_error)
5803 default:
goto __pyx_L5_argtuple_error;
5805 const Py_ssize_t kwd_pos_args = __pyx_nargs;
5806 if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len,
"__init__", 0) < (0)) __PYX_ERR(0, 18, __pyx_L3_error)
5807 for (Py_ssize_t i = __pyx_nargs; i < 2; i++) {
5808 if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid(
"__init__", 1, 2, 2, i); __PYX_ERR(0, 18, __pyx_L3_error) }
5810 }
else if (unlikely(__pyx_nargs != 2)) {
5811 goto __pyx_L5_argtuple_error;
5813 values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
5814 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 18, __pyx_L3_error)
5815 values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
5816 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 18, __pyx_L3_error)
5818 __pyx_v_self = values[0];
5819 __pyx_v_n = values[1];
5822 __pyx_L5_argtuple_error:;
5823 __Pyx_RaiseArgtupleInvalid(
"__init__", 1, 2, 2, __pyx_nargs); __PYX_ERR(0, 18, __pyx_L3_error)
5825 goto __pyx_L4_argument_unpacking_done;
5827 for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(
sizeof(values)/
sizeof(values[0])); ++__pyx_temp) {
5828 Py_XDECREF(values[__pyx_temp]);
5830 __Pyx_AddTraceback(
"clapack.DenseFactor.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
5831 __Pyx_RefNannyFinishContext();
5833 __pyx_L4_argument_unpacking_done:;
5834 __pyx_r = __pyx_pf_7clapack_11DenseFactor___init__(__pyx_self, __pyx_v_self, __pyx_v_n);
5837 for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(
sizeof(values)/
sizeof(values[0])); ++__pyx_temp) {
5838 Py_XDECREF(values[__pyx_temp]);
5840 __Pyx_RefNannyFinishContext();
5844static PyObject *__pyx_pf_7clapack_11DenseFactor___init__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_n) {
5845 PyObject *__pyx_r = NULL;
5846 __Pyx_RefNannyDeclarations
5847 PyObject *__pyx_t_1 = NULL;
5848 PyObject *__pyx_t_2 = NULL;
5849 PyObject *__pyx_t_3 = NULL;
5850 PyObject *__pyx_t_4 = NULL;
5852 PyObject *__pyx_t_6 = NULL;
5853 int __pyx_lineno = 0;
5854 const char *__pyx_filename = NULL;
5855 int __pyx_clineno = 0;
5856 __Pyx_RefNannySetupContext(
"__init__", 0);
5865 if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_n, __pyx_v_n) < (0)) __PYX_ERR(0, 19, __pyx_L1_error)
5875 __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_np);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 20, __pyx_L1_error)
5876 __Pyx_GOTREF(__pyx_t_3);
5877 __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_zeros);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 20, __pyx_L1_error)
5878 __Pyx_GOTREF(__pyx_t_4);
5879 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
5880 __pyx_t_3 = PyTuple_New(2);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 20, __pyx_L1_error)
5881 __Pyx_GOTREF(__pyx_t_3);
5882 __Pyx_INCREF(__pyx_v_n);
5883 __Pyx_GIVEREF(__pyx_v_n);
5884 if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_n) != (0)) __PYX_ERR(0, 20, __pyx_L1_error);
5885 __Pyx_INCREF(__pyx_v_n);
5886 __Pyx_GIVEREF(__pyx_v_n);
5887 if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_v_n) != (0)) __PYX_ERR(0, 20, __pyx_L1_error);
5889 #if CYTHON_UNPACK_METHODS
5890 if (unlikely(PyMethod_Check(__pyx_t_4))) {
5891 __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_4);
5893 PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_4);
5894 __Pyx_INCREF(__pyx_t_2);
5895 __Pyx_INCREF(__pyx__function);
5896 __Pyx_DECREF_SET(__pyx_t_4, __pyx__function);
5901 PyObject *__pyx_callargs[3] = {__pyx_t_2, __pyx_t_3, ((PyObject *)(&PyFloat_Type))};
5902 #if CYTHON_VECTORCALL
5903 __pyx_t_6 = __pyx_mstate_global->__pyx_tuple[0];
5904 if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 20, __pyx_L1_error)
5905 __Pyx_INCREF(__pyx_t_6);
5908 PyObject *__pyx_temp[2] = {__pyx_mstate_global->__pyx_n_u_shape, __pyx_mstate_global->__pyx_n_u_dtype};
5909 __pyx_t_6 = __Pyx_MakeKwargDict(__pyx_temp, __pyx_callargs+1, 2);
5910 if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 20, __pyx_L1_error)
5911 __Pyx_GOTREF(__pyx_t_6);
5914 __pyx_t_1 = __Pyx_Object_VectorcallKwds((PyObject*)__pyx_t_4, __pyx_callargs+__pyx_t_5, (1-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET), __pyx_t_6);
5915 __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
5916 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
5917 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
5918 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
5919 if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 20, __pyx_L1_error)
5920 __Pyx_GOTREF(__pyx_t_1);
5922 if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_lu, __pyx_t_1) < (0)) __PYX_ERR(0, 20, __pyx_L1_error)
5923 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
5933 __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_np);
if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 21, __pyx_L1_error)
5934 __Pyx_GOTREF(__pyx_t_6);
5935 __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_zeros);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 21, __pyx_L1_error)
5936 __Pyx_GOTREF(__pyx_t_3);
5937 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
5939 #if CYTHON_UNPACK_METHODS
5940 if (unlikely(PyMethod_Check(__pyx_t_3))) {
5941 __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
5943 PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_3);
5944 __Pyx_INCREF(__pyx_t_4);
5945 __Pyx_INCREF(__pyx__function);
5946 __Pyx_DECREF_SET(__pyx_t_3, __pyx__function);
5951 PyObject *__pyx_callargs[3] = {__pyx_t_4, __pyx_v_n, __pyx_mstate_global->__pyx_n_u_int32};
5952 #if CYTHON_VECTORCALL
5953 __pyx_t_6 = __pyx_mstate_global->__pyx_tuple[0];
5954 if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 21, __pyx_L1_error)
5955 __Pyx_INCREF(__pyx_t_6);
5958 PyObject *__pyx_temp[2] = {__pyx_mstate_global->__pyx_n_u_shape, __pyx_mstate_global->__pyx_n_u_dtype};
5959 __pyx_t_6 = __Pyx_MakeKwargDict(__pyx_temp, __pyx_callargs+1, 2);
5960 if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 21, __pyx_L1_error)
5961 __Pyx_GOTREF(__pyx_t_6);
5964 __pyx_t_1 = __Pyx_Object_VectorcallKwds((PyObject*)__pyx_t_3, __pyx_callargs+__pyx_t_5, (1-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET), __pyx_t_6);
5965 __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
5966 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
5967 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
5968 if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 21, __pyx_L1_error)
5969 __Pyx_GOTREF(__pyx_t_1);
5971 if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_pivots, __pyx_t_1) < (0)) __PYX_ERR(0, 21, __pyx_L1_error)
5972 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
5983 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
5986 __Pyx_XDECREF(__pyx_t_1);
5987 __Pyx_XDECREF(__pyx_t_2);
5988 __Pyx_XDECREF(__pyx_t_3);
5989 __Pyx_XDECREF(__pyx_t_4);
5990 __Pyx_XDECREF(__pyx_t_6);
5991 __Pyx_AddTraceback(
"clapack.DenseFactor.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
5994 __Pyx_XGIVEREF(__pyx_r);
5995 __Pyx_RefNannyFinishContext();
6007static PyObject *__pyx_f_7clapack_lapackWrappersDCopy(
int __pyx_v_n, PyArrayObject *__pyx_v_mat, PyArrayObject *__pyx_v_lu) {
6008 CYTHON_UNUSED
int __pyx_v_dim;
6012 PyObject *__pyx_r = NULL;
6013 __Pyx_RefNannyDeclarations
6014 __Pyx_RefNannySetupContext(
"lapackWrappersDCopy", 0);
6023 __pyx_v_dim = __pyx_v_n;
6026 __pyx_v_dim2 = __Pyx_pow_long(((
long)__pyx_v_n), 2);
6035 dcopy_((&__pyx_v_dim2), ((
double *)__pyx_f_5numpy_7ndarray_4data___get__(__pyx_v_mat)), (&__pyx_v_incr1), ((
double *)__pyx_f_5numpy_7ndarray_4data___get__(__pyx_v_lu)), (&__pyx_v_incr2));
6046 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
6051 __Pyx_XGIVEREF(__pyx_r);
6052 __Pyx_RefNannyFinishContext();
6064static PyObject *__pyx_f_7clapack_lapackWrappersDenseFactorPrepare(
int __pyx_v_dim, PyArrayObject *__pyx_v_lu, PyArrayObject *__pyx_v_pivot) {
6067 PyObject *__pyx_r = NULL;
6068 __Pyx_RefNannyDeclarations
6069 __Pyx_RefNannySetupContext(
"lapackWrappersDenseFactorPrepare", 0);
6079 __pyx_v_N = __pyx_v_dim;
6088 (void)(
dgetrf_((&__pyx_v_N), (&__pyx_v_N), ((
double *)__pyx_f_5numpy_7ndarray_4data___get__(__pyx_v_lu)), (&__pyx_v_N), ((
int *)__pyx_f_5numpy_7ndarray_4data___get__(__pyx_v_pivot)), (&__pyx_v_info)));
6099 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
6102 __Pyx_XGIVEREF(__pyx_r);
6103 __Pyx_RefNannyFinishContext();
6115static PyObject *__pyx_f_7clapack_lapackWrappersDenseFactorSolve(
int __pyx_v_dim, PyArrayObject *__pyx_v_lu, PyArrayObject *__pyx_v_pivots, PyArrayObject *__pyx_v_b) {
6120 PyObject *__pyx_r = NULL;
6121 __Pyx_RefNannyDeclarations
6122 __Pyx_RefNannySetupContext(
"lapackWrappersDenseFactorSolve", 0);
6131 __pyx_v_trans =
'T';
6140 __pyx_v_N = __pyx_v_dim;
6151 (void)(
dgetrs_((&__pyx_v_trans), (&__pyx_v_N), (&__pyx_v_nrhs), ((
double *)__pyx_f_5numpy_7ndarray_4data___get__(__pyx_v_lu)), (&__pyx_v_N), ((
int *)__pyx_f_5numpy_7ndarray_4data___get__(__pyx_v_pivots)), ((
double *)__pyx_f_5numpy_7ndarray_4data___get__(__pyx_v_b)), (&__pyx_v_N), (&__pyx_v_info)));
6162 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
6167 __Pyx_XGIVEREF(__pyx_r);
6168 __Pyx_RefNannyFinishContext();
6180static PyObject *__pyx_f_7clapack_lapackWrappersDenseCalculateEigenvalues(
char *__pyx_v_jobvl,
char *__pyx_v_jobvr,
int __pyx_v_n, PyArrayObject *__pyx_v_A,
int __pyx_v_lda, PyArrayObject *__pyx_v_wr, PyArrayObject *__pyx_v_wi, PyArrayObject *__pyx_v_vl,
int __pyx_v_ldvl, PyArrayObject *__pyx_v_vr,
int __pyx_v_ldvr, PyArrayObject *__pyx_v_work,
int __pyx_v_nwork) {
6182 PyObject *__pyx_r = NULL;
6183 __Pyx_RefNannyDeclarations
6184 __Pyx_RefNannySetupContext(
"lapackWrappersDenseCalculateEigenvalues", 0);
6202 (void)(
dgeev_(__pyx_v_jobvl, __pyx_v_jobvr, (&__pyx_v_n), ((
double *)__pyx_f_5numpy_7ndarray_4data___get__(__pyx_v_A)), (&__pyx_v_lda), ((
double *)__pyx_f_5numpy_7ndarray_4data___get__(__pyx_v_wr)), ((
double *)__pyx_f_5numpy_7ndarray_4data___get__(__pyx_v_wi)), ((
double *)__pyx_f_5numpy_7ndarray_4data___get__(__pyx_v_vl)), (&__pyx_v_ldvl), ((
double *)__pyx_f_5numpy_7ndarray_4data___get__(__pyx_v_vr)), (&__pyx_v_ldvr), ((
double *)__pyx_f_5numpy_7ndarray_4data___get__(__pyx_v_work)), (&__pyx_v_nwork), (&__pyx_v_info)));
6213 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
6215 __Pyx_XGIVEREF(__pyx_r);
6216 __Pyx_RefNannyFinishContext();
6229static PyObject *__pyx_pw_7clapack_1blasCopy(PyObject *__pyx_self,
6230#
if CYTHON_VECTORCALL
6231PyObject *
const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
6233PyObject *__pyx_args, PyObject *__pyx_kwds
6236static PyMethodDef __pyx_mdef_7clapack_1blasCopy = {
"blasCopy", (PyCFunction)(
void(*)(
void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7clapack_1blasCopy, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
6237static PyObject *__pyx_pw_7clapack_1blasCopy(PyObject *__pyx_self,
6238#
if CYTHON_VECTORCALL
6239PyObject *
const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
6241PyObject *__pyx_args, PyObject *__pyx_kwds
6244 PyObject *__pyx_v_n = 0;
6245 PyObject *__pyx_v_mat = 0;
6246 PyObject *__pyx_v_denseFactor = 0;
6247 #if !CYTHON_VECTORCALL
6248 CYTHON_UNUSED Py_ssize_t __pyx_nargs;
6250 CYTHON_UNUSED PyObject *
const *__pyx_kwvalues;
6251 PyObject* values[3] = {0,0,0};
6252 int __pyx_lineno = 0;
6253 const char *__pyx_filename = NULL;
6254 int __pyx_clineno = 0;
6255 PyObject *__pyx_r = 0;
6256 __Pyx_RefNannyDeclarations
6257 __Pyx_RefNannySetupContext(
"blasCopy (wrapper)", 0);
6258 #if !CYTHON_VECTORCALL
6259 #if CYTHON_ASSUME_SAFE_SIZE
6260 __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
6262 __pyx_nargs = PyTuple_Size(__pyx_args);
if (unlikely(__pyx_nargs < 0))
return NULL;
6265 __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
6267 PyObject **
const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_n,&__pyx_mstate_global->__pyx_n_u_mat,&__pyx_mstate_global->__pyx_n_u_denseFactor,0};
6268 const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
6269 if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(0, 92, __pyx_L3_error)
6270 if (__pyx_kwds_len > 0) {
6271 switch (__pyx_nargs) {
6273 values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
6274 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 92, __pyx_L3_error)
6277 values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
6278 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 92, __pyx_L3_error)
6281 values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
6282 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 92, __pyx_L3_error)
6285 default:
goto __pyx_L5_argtuple_error;
6287 const Py_ssize_t kwd_pos_args = __pyx_nargs;
6288 if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len,
"blasCopy", 0) < (0)) __PYX_ERR(0, 92, __pyx_L3_error)
6289 for (Py_ssize_t i = __pyx_nargs; i < 3; i++) {
6290 if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid(
"blasCopy", 1, 3, 3, i); __PYX_ERR(0, 92, __pyx_L3_error) }
6292 }
else if (unlikely(__pyx_nargs != 3)) {
6293 goto __pyx_L5_argtuple_error;
6295 values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
6296 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 92, __pyx_L3_error)
6297 values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
6298 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 92, __pyx_L3_error)
6299 values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
6300 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 92, __pyx_L3_error)
6302 __pyx_v_n = values[0];
6303 __pyx_v_mat = values[1];
6304 __pyx_v_denseFactor = values[2];
6307 __pyx_L5_argtuple_error:;
6308 __Pyx_RaiseArgtupleInvalid(
"blasCopy", 1, 3, 3, __pyx_nargs); __PYX_ERR(0, 92, __pyx_L3_error)
6310 goto __pyx_L4_argument_unpacking_done;
6312 for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(
sizeof(values)/
sizeof(values[0])); ++__pyx_temp) {
6313 Py_XDECREF(values[__pyx_temp]);
6315 __Pyx_AddTraceback(
"clapack.blasCopy", __pyx_clineno, __pyx_lineno, __pyx_filename);
6316 __Pyx_RefNannyFinishContext();
6318 __pyx_L4_argument_unpacking_done:;
6319 __pyx_r = __pyx_pf_7clapack_blasCopy(__pyx_self, __pyx_v_n, __pyx_v_mat, __pyx_v_denseFactor);
6322 for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(
sizeof(values)/
sizeof(values[0])); ++__pyx_temp) {
6323 Py_XDECREF(values[__pyx_temp]);
6325 __Pyx_RefNannyFinishContext();
6329static PyObject *__pyx_pf_7clapack_blasCopy(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_n, PyObject *__pyx_v_mat, PyObject *__pyx_v_denseFactor) {
6330 PyObject *__pyx_v_DF_lu = NULL;
6331 PyObject *__pyx_r = NULL;
6332 __Pyx_RefNannyDeclarations
6333 PyObject *__pyx_t_1 = NULL;
6335 int __pyx_lineno = 0;
6336 const char *__pyx_filename = NULL;
6337 int __pyx_clineno = 0;
6338 __Pyx_RefNannySetupContext(
"blasCopy", 0);
6347 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_denseFactor, __pyx_mstate_global->__pyx_n_u_lu);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 95, __pyx_L1_error)
6348 __Pyx_GOTREF(__pyx_t_1);
6349 __pyx_v_DF_lu = __pyx_t_1;
6359 __pyx_t_2 = __Pyx_PyLong_As_int(__pyx_v_n);
if (unlikely((__pyx_t_2 == (
int)-1) && PyErr_Occurred())) __PYX_ERR(0, 97, __pyx_L1_error)
6368 if (!(likely(((__pyx_v_mat) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_mat, __pyx_mstate_global->__pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 98, __pyx_L1_error)
6377 if (!(likely(((__pyx_v_DF_lu) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_DF_lu, __pyx_mstate_global->__pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 99, __pyx_L1_error)
6386 __pyx_t_1 = __pyx_f_7clapack_lapackWrappersDCopy(__pyx_t_2, ((PyArrayObject *)__pyx_v_mat), ((PyArrayObject *)__pyx_v_DF_lu));
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 97, __pyx_L1_error)
6387 __Pyx_GOTREF(__pyx_t_1);
6389 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
6400 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
6403 __Pyx_XDECREF(__pyx_t_1);
6404 __Pyx_AddTraceback(
"clapack.blasCopy", __pyx_clineno, __pyx_lineno, __pyx_filename);
6407 __Pyx_XDECREF(__pyx_v_DF_lu);
6408 __Pyx_XGIVEREF(__pyx_r);
6409 __Pyx_RefNannyFinishContext();
6422static PyObject *__pyx_pw_7clapack_3denseFactorPrepare(PyObject *__pyx_self,
6423#
if CYTHON_VECTORCALL
6424PyObject *
const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
6426PyObject *__pyx_args, PyObject *__pyx_kwds
6429static PyMethodDef __pyx_mdef_7clapack_3denseFactorPrepare = {
"denseFactorPrepare", (PyCFunction)(
void(*)(
void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7clapack_3denseFactorPrepare, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
6430static PyObject *__pyx_pw_7clapack_3denseFactorPrepare(PyObject *__pyx_self,
6431#
if CYTHON_VECTORCALL
6432PyObject *
const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
6434PyObject *__pyx_args, PyObject *__pyx_kwds
6437 PyObject *__pyx_v_n = 0;
6438 PyObject *__pyx_v_mat = 0;
6439 PyObject *__pyx_v_denseFactor = 0;
6440 #if !CYTHON_VECTORCALL
6441 CYTHON_UNUSED Py_ssize_t __pyx_nargs;
6443 CYTHON_UNUSED PyObject *
const *__pyx_kwvalues;
6444 PyObject* values[3] = {0,0,0};
6445 int __pyx_lineno = 0;
6446 const char *__pyx_filename = NULL;
6447 int __pyx_clineno = 0;
6448 PyObject *__pyx_r = 0;
6449 __Pyx_RefNannyDeclarations
6450 __Pyx_RefNannySetupContext(
"denseFactorPrepare (wrapper)", 0);
6451 #if !CYTHON_VECTORCALL
6452 #if CYTHON_ASSUME_SAFE_SIZE
6453 __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
6455 __pyx_nargs = PyTuple_Size(__pyx_args);
if (unlikely(__pyx_nargs < 0))
return NULL;
6458 __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
6460 PyObject **
const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_n,&__pyx_mstate_global->__pyx_n_u_mat,&__pyx_mstate_global->__pyx_n_u_denseFactor,0};
6461 const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
6462 if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(0, 101, __pyx_L3_error)
6463 if (__pyx_kwds_len > 0) {
6464 switch (__pyx_nargs) {
6466 values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
6467 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 101, __pyx_L3_error)
6470 values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
6471 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 101, __pyx_L3_error)
6474 values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
6475 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 101, __pyx_L3_error)
6478 default:
goto __pyx_L5_argtuple_error;
6480 const Py_ssize_t kwd_pos_args = __pyx_nargs;
6481 if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len,
"denseFactorPrepare", 0) < (0)) __PYX_ERR(0, 101, __pyx_L3_error)
6482 for (Py_ssize_t i = __pyx_nargs; i < 3; i++) {
6483 if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid(
"denseFactorPrepare", 1, 3, 3, i); __PYX_ERR(0, 101, __pyx_L3_error) }
6485 }
else if (unlikely(__pyx_nargs != 3)) {
6486 goto __pyx_L5_argtuple_error;
6488 values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
6489 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 101, __pyx_L3_error)
6490 values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
6491 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 101, __pyx_L3_error)
6492 values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
6493 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 101, __pyx_L3_error)
6495 __pyx_v_n = values[0];
6496 __pyx_v_mat = values[1];
6497 __pyx_v_denseFactor = values[2];
6500 __pyx_L5_argtuple_error:;
6501 __Pyx_RaiseArgtupleInvalid(
"denseFactorPrepare", 1, 3, 3, __pyx_nargs); __PYX_ERR(0, 101, __pyx_L3_error)
6503 goto __pyx_L4_argument_unpacking_done;
6505 for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(
sizeof(values)/
sizeof(values[0])); ++__pyx_temp) {
6506 Py_XDECREF(values[__pyx_temp]);
6508 __Pyx_AddTraceback(
"clapack.denseFactorPrepare", __pyx_clineno, __pyx_lineno, __pyx_filename);
6509 __Pyx_RefNannyFinishContext();
6511 __pyx_L4_argument_unpacking_done:;
6512 __pyx_r = __pyx_pf_7clapack_2denseFactorPrepare(__pyx_self, __pyx_v_n, __pyx_v_mat, __pyx_v_denseFactor);
6515 for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(
sizeof(values)/
sizeof(values[0])); ++__pyx_temp) {
6516 Py_XDECREF(values[__pyx_temp]);
6518 __Pyx_RefNannyFinishContext();
6522static PyObject *__pyx_pf_7clapack_2denseFactorPrepare(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_n, PyObject *__pyx_v_mat, PyObject *__pyx_v_denseFactor) {
6523 PyObject *__pyx_v_DF_pivots = NULL;
6524 PyObject *__pyx_v_DF_lu = NULL;
6525 PyObject *__pyx_r = NULL;
6526 __Pyx_RefNannyDeclarations
6527 PyObject *__pyx_t_1 = NULL;
6529 int __pyx_lineno = 0;
6530 const char *__pyx_filename = NULL;
6531 int __pyx_clineno = 0;
6532 __Pyx_RefNannySetupContext(
"denseFactorPrepare", 0);
6541 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_denseFactor, __pyx_mstate_global->__pyx_n_u_pivots);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 104, __pyx_L1_error)
6542 __Pyx_GOTREF(__pyx_t_1);
6543 __pyx_v_DF_pivots = __pyx_t_1;
6553 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_denseFactor, __pyx_mstate_global->__pyx_n_u_lu);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 105, __pyx_L1_error)
6554 __Pyx_GOTREF(__pyx_t_1);
6555 __pyx_v_DF_lu = __pyx_t_1;
6565 __pyx_t_2 = __Pyx_PyLong_As_int(__pyx_v_n);
if (unlikely((__pyx_t_2 == (
int)-1) && PyErr_Occurred())) __PYX_ERR(0, 107, __pyx_L1_error)
6574 if (!(likely(((__pyx_v_mat) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_mat, __pyx_mstate_global->__pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 108, __pyx_L1_error)
6583 if (!(likely(((__pyx_v_DF_lu) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_DF_lu, __pyx_mstate_global->__pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 109, __pyx_L1_error)
6592 __pyx_t_1 = __pyx_f_7clapack_lapackWrappersDCopy(__pyx_t_2, ((PyArrayObject *)__pyx_v_mat), ((PyArrayObject *)__pyx_v_DF_lu));
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 107, __pyx_L1_error)
6593 __Pyx_GOTREF(__pyx_t_1);
6595 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
6604 __pyx_t_2 = __Pyx_PyLong_As_int(__pyx_v_n);
if (unlikely((__pyx_t_2 == (
int)-1) && PyErr_Occurred())) __PYX_ERR(0, 111, __pyx_L1_error)
6613 if (!(likely(((__pyx_v_DF_lu) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_DF_lu, __pyx_mstate_global->__pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 112, __pyx_L1_error)
6622 if (!(likely(((__pyx_v_DF_pivots) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_DF_pivots, __pyx_mstate_global->__pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 113, __pyx_L1_error)
6631 __pyx_t_1 = __pyx_f_7clapack_lapackWrappersDenseFactorPrepare(__pyx_t_2, ((PyArrayObject *)__pyx_v_DF_lu), ((PyArrayObject *)__pyx_v_DF_pivots));
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 111, __pyx_L1_error)
6632 __Pyx_GOTREF(__pyx_t_1);
6634 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
6645 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
6648 __Pyx_XDECREF(__pyx_t_1);
6649 __Pyx_AddTraceback(
"clapack.denseFactorPrepare", __pyx_clineno, __pyx_lineno, __pyx_filename);
6652 __Pyx_XDECREF(__pyx_v_DF_pivots);
6653 __Pyx_XDECREF(__pyx_v_DF_lu);
6654 __Pyx_XGIVEREF(__pyx_r);
6655 __Pyx_RefNannyFinishContext();
6668static PyObject *__pyx_pw_7clapack_5denseFactorSolve(PyObject *__pyx_self,
6669#
if CYTHON_VECTORCALL
6670PyObject *
const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
6672PyObject *__pyx_args, PyObject *__pyx_kwds
6675static PyMethodDef __pyx_mdef_7clapack_5denseFactorSolve = {
"denseFactorSolve", (PyCFunction)(
void(*)(
void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7clapack_5denseFactorSolve, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
6676static PyObject *__pyx_pw_7clapack_5denseFactorSolve(PyObject *__pyx_self,
6677#
if CYTHON_VECTORCALL
6678PyObject *
const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
6680PyObject *__pyx_args, PyObject *__pyx_kwds
6683 PyObject *__pyx_v_n = 0;
6684 CYTHON_UNUSED PyObject *__pyx_v_mat = 0;
6685 PyObject *__pyx_v_denseFactor = 0;
6686 PyObject *__pyx_v_b = 0;
6687 #if !CYTHON_VECTORCALL
6688 CYTHON_UNUSED Py_ssize_t __pyx_nargs;
6690 CYTHON_UNUSED PyObject *
const *__pyx_kwvalues;
6691 PyObject* values[4] = {0,0,0,0};
6692 int __pyx_lineno = 0;
6693 const char *__pyx_filename = NULL;
6694 int __pyx_clineno = 0;
6695 PyObject *__pyx_r = 0;
6696 __Pyx_RefNannyDeclarations
6697 __Pyx_RefNannySetupContext(
"denseFactorSolve (wrapper)", 0);
6698 #if !CYTHON_VECTORCALL
6699 #if CYTHON_ASSUME_SAFE_SIZE
6700 __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
6702 __pyx_nargs = PyTuple_Size(__pyx_args);
if (unlikely(__pyx_nargs < 0))
return NULL;
6705 __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
6707 PyObject **
const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_n,&__pyx_mstate_global->__pyx_n_u_mat,&__pyx_mstate_global->__pyx_n_u_denseFactor,&__pyx_mstate_global->__pyx_n_u_b,0};
6708 const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
6709 if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(0, 115, __pyx_L3_error)
6710 if (__pyx_kwds_len > 0) {
6711 switch (__pyx_nargs) {
6713 values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
6714 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 115, __pyx_L3_error)
6717 values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
6718 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 115, __pyx_L3_error)
6721 values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
6722 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 115, __pyx_L3_error)
6725 values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
6726 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 115, __pyx_L3_error)
6729 default:
goto __pyx_L5_argtuple_error;
6731 const Py_ssize_t kwd_pos_args = __pyx_nargs;
6732 if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len,
"denseFactorSolve", 0) < (0)) __PYX_ERR(0, 115, __pyx_L3_error)
6733 for (Py_ssize_t i = __pyx_nargs; i < 4; i++) {
6734 if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid(
"denseFactorSolve", 1, 4, 4, i); __PYX_ERR(0, 115, __pyx_L3_error) }
6736 }
else if (unlikely(__pyx_nargs != 4)) {
6737 goto __pyx_L5_argtuple_error;
6739 values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
6740 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 115, __pyx_L3_error)
6741 values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
6742 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 115, __pyx_L3_error)
6743 values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
6744 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 115, __pyx_L3_error)
6745 values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
6746 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 115, __pyx_L3_error)
6748 __pyx_v_n = values[0];
6749 __pyx_v_mat = values[1];
6750 __pyx_v_denseFactor = values[2];
6751 __pyx_v_b = values[3];
6754 __pyx_L5_argtuple_error:;
6755 __Pyx_RaiseArgtupleInvalid(
"denseFactorSolve", 1, 4, 4, __pyx_nargs); __PYX_ERR(0, 115, __pyx_L3_error)
6757 goto __pyx_L4_argument_unpacking_done;
6759 for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(
sizeof(values)/
sizeof(values[0])); ++__pyx_temp) {
6760 Py_XDECREF(values[__pyx_temp]);
6762 __Pyx_AddTraceback(
"clapack.denseFactorSolve", __pyx_clineno, __pyx_lineno, __pyx_filename);
6763 __Pyx_RefNannyFinishContext();
6765 __pyx_L4_argument_unpacking_done:;
6766 __pyx_r = __pyx_pf_7clapack_4denseFactorSolve(__pyx_self, __pyx_v_n, __pyx_v_mat, __pyx_v_denseFactor, __pyx_v_b);
6769 for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(
sizeof(values)/
sizeof(values[0])); ++__pyx_temp) {
6770 Py_XDECREF(values[__pyx_temp]);
6772 __Pyx_RefNannyFinishContext();
6776static PyObject *__pyx_pf_7clapack_4denseFactorSolve(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_n, CYTHON_UNUSED PyObject *__pyx_v_mat, PyObject *__pyx_v_denseFactor, PyObject *__pyx_v_b) {
6777 PyObject *__pyx_v_DF_pivots = NULL;
6778 PyObject *__pyx_v_DF_lu = NULL;
6779 PyObject *__pyx_r = NULL;
6780 __Pyx_RefNannyDeclarations
6781 PyObject *__pyx_t_1 = NULL;
6783 int __pyx_lineno = 0;
6784 const char *__pyx_filename = NULL;
6785 int __pyx_clineno = 0;
6786 __Pyx_RefNannySetupContext(
"denseFactorSolve", 0);
6795 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_denseFactor, __pyx_mstate_global->__pyx_n_u_pivots);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 119, __pyx_L1_error)
6796 __Pyx_GOTREF(__pyx_t_1);
6797 __pyx_v_DF_pivots = __pyx_t_1;
6807 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_denseFactor, __pyx_mstate_global->__pyx_n_u_lu);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 120, __pyx_L1_error)
6808 __Pyx_GOTREF(__pyx_t_1);
6809 __pyx_v_DF_lu = __pyx_t_1;
6819 __pyx_t_2 = __Pyx_PyLong_As_int(__pyx_v_n);
if (unlikely((__pyx_t_2 == (
int)-1) && PyErr_Occurred())) __PYX_ERR(0, 122, __pyx_L1_error)
6828 if (!(likely(((__pyx_v_DF_lu) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_DF_lu, __pyx_mstate_global->__pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 123, __pyx_L1_error)
6837 if (!(likely(((__pyx_v_DF_pivots) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_DF_pivots, __pyx_mstate_global->__pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 124, __pyx_L1_error)
6846 if (!(likely(((__pyx_v_b) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_b, __pyx_mstate_global->__pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 125, __pyx_L1_error)
6855 __pyx_t_1 = __pyx_f_7clapack_lapackWrappersDenseFactorSolve(__pyx_t_2, ((PyArrayObject *)__pyx_v_DF_lu), ((PyArrayObject *)__pyx_v_DF_pivots), ((PyArrayObject *)__pyx_v_b));
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 122, __pyx_L1_error)
6856 __Pyx_GOTREF(__pyx_t_1);
6858 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
6869 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
6872 __Pyx_XDECREF(__pyx_t_1);
6873 __Pyx_AddTraceback(
"clapack.denseFactorSolve", __pyx_clineno, __pyx_lineno, __pyx_filename);
6876 __Pyx_XDECREF(__pyx_v_DF_pivots);
6877 __Pyx_XDECREF(__pyx_v_DF_lu);
6878 __Pyx_XGIVEREF(__pyx_r);
6879 __Pyx_RefNannyFinishContext();
6892static PyObject *__pyx_pw_7clapack_7denseCalculateEigenvalues(PyObject *__pyx_self,
6893#
if CYTHON_VECTORCALL
6894PyObject *
const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
6896PyObject *__pyx_args, PyObject *__pyx_kwds
6899PyDoc_STRVAR(__pyx_doc_7clapack_6denseCalculateEigenvalues,
"\n Parameters\n ----------\n jobvl (input) : str\n \047N\047 indicates left eigenvectors are not computed\n \047V\047 indicates left eigenvectors are computed\n jobvr (input) : str\n \047N\047 indicates right eigenvectors are not computed\n \047V\047 indicates right eigenvectors are computed\n n (input) : int\n order of matrix A\n leig (input / output) : np array\n on entry matrix A, on exit overwritten\n lda (input) : int\n leading dimension of the array A\n eigenvalues_r (output) : array\n real part of computed eigenvalues\n eigenvalues_i (output) : array\n imaginary part of computed eigenvalues\n vl (output) : array\n storage container for left eigenvectors\n ldvl (input) : int\n leading dimension of the array vl\n vr (output) : array\n storage container for right eigenvectos\n ldvr (input) : int\n leading dimension of array vr\n work (workspace / output) : array\n lwork (input) : int\n ");
6900static PyMethodDef __pyx_mdef_7clapack_7denseCalculateEigenvalues = {
"denseCalculateEigenvalues", (PyCFunction)(
void(*)(
void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7clapack_7denseCalculateEigenvalues, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7clapack_6denseCalculateEigenvalues};
6901static PyObject *__pyx_pw_7clapack_7denseCalculateEigenvalues(PyObject *__pyx_self,
6902#
if CYTHON_VECTORCALL
6903PyObject *
const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
6905PyObject *__pyx_args, PyObject *__pyx_kwds
6908 PyObject *__pyx_v_jobvl = 0;
6909 PyObject *__pyx_v_jobvr = 0;
6910 PyObject *__pyx_v_n = 0;
6911 PyObject *__pyx_v_leig = 0;
6912 PyObject *__pyx_v_lda = 0;
6913 PyObject *__pyx_v_eigenvalues_r = 0;
6914 PyObject *__pyx_v_eigenvalues_i = 0;
6915 PyObject *__pyx_v_leftEigenvectors = 0;
6916 PyObject *__pyx_v_ldvl = 0;
6917 PyObject *__pyx_v_rightEigenvectors = 0;
6918 PyObject *__pyx_v_ldvr = 0;
6919 PyObject *__pyx_v_work = 0;
6920 PyObject *__pyx_v_lwork = 0;
6921 #if !CYTHON_VECTORCALL
6922 CYTHON_UNUSED Py_ssize_t __pyx_nargs;
6924 CYTHON_UNUSED PyObject *
const *__pyx_kwvalues;
6925 PyObject* values[13] = {0,0,0,0,0,0,0,0,0,0,0,0,0};
6926 int __pyx_lineno = 0;
6927 const char *__pyx_filename = NULL;
6928 int __pyx_clineno = 0;
6929 PyObject *__pyx_r = 0;
6930 __Pyx_RefNannyDeclarations
6931 __Pyx_RefNannySetupContext(
"denseCalculateEigenvalues (wrapper)", 0);
6932 #if !CYTHON_VECTORCALL
6933 #if CYTHON_ASSUME_SAFE_SIZE
6934 __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
6936 __pyx_nargs = PyTuple_Size(__pyx_args);
if (unlikely(__pyx_nargs < 0))
return NULL;
6939 __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
6941 PyObject **
const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_jobvl,&__pyx_mstate_global->__pyx_n_u_jobvr,&__pyx_mstate_global->__pyx_n_u_n,&__pyx_mstate_global->__pyx_n_u_leig,&__pyx_mstate_global->__pyx_n_u_lda,&__pyx_mstate_global->__pyx_n_u_eigenvalues_r,&__pyx_mstate_global->__pyx_n_u_eigenvalues_i,&__pyx_mstate_global->__pyx_n_u_leftEigenvectors,&__pyx_mstate_global->__pyx_n_u_ldvl,&__pyx_mstate_global->__pyx_n_u_rightEigenvectors,&__pyx_mstate_global->__pyx_n_u_ldvr,&__pyx_mstate_global->__pyx_n_u_work,&__pyx_mstate_global->__pyx_n_u_lwork,0};
6942 const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
6943 if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(0, 127, __pyx_L3_error)
6944 if (__pyx_kwds_len > 0) {
6945 switch (__pyx_nargs) {
6947 values[12] = __Pyx_ArgRef_FASTCALL(__pyx_args, 12);
6948 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[12])) __PYX_ERR(0, 127, __pyx_L3_error)
6951 values[11] = __Pyx_ArgRef_FASTCALL(__pyx_args, 11);
6952 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[11])) __PYX_ERR(0, 127, __pyx_L3_error)
6955 values[10] = __Pyx_ArgRef_FASTCALL(__pyx_args, 10);
6956 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[10])) __PYX_ERR(0, 127, __pyx_L3_error)
6959 values[9] = __Pyx_ArgRef_FASTCALL(__pyx_args, 9);
6960 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[9])) __PYX_ERR(0, 127, __pyx_L3_error)
6963 values[8] = __Pyx_ArgRef_FASTCALL(__pyx_args, 8);
6964 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[8])) __PYX_ERR(0, 127, __pyx_L3_error)
6967 values[7] = __Pyx_ArgRef_FASTCALL(__pyx_args, 7);
6968 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[7])) __PYX_ERR(0, 127, __pyx_L3_error)
6971 values[6] = __Pyx_ArgRef_FASTCALL(__pyx_args, 6);
6972 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[6])) __PYX_ERR(0, 127, __pyx_L3_error)
6975 values[5] = __Pyx_ArgRef_FASTCALL(__pyx_args, 5);
6976 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[5])) __PYX_ERR(0, 127, __pyx_L3_error)
6979 values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
6980 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 127, __pyx_L3_error)
6983 values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
6984 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 127, __pyx_L3_error)
6987 values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
6988 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 127, __pyx_L3_error)
6991 values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
6992 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 127, __pyx_L3_error)
6995 values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
6996 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 127, __pyx_L3_error)
6999 default:
goto __pyx_L5_argtuple_error;
7001 const Py_ssize_t kwd_pos_args = __pyx_nargs;
7002 if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len,
"denseCalculateEigenvalues", 0) < (0)) __PYX_ERR(0, 127, __pyx_L3_error)
7003 for (Py_ssize_t i = __pyx_nargs; i < 13; i++) {
7004 if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid(
"denseCalculateEigenvalues", 1, 13, 13, i); __PYX_ERR(0, 127, __pyx_L3_error) }
7006 }
else if (unlikely(__pyx_nargs != 13)) {
7007 goto __pyx_L5_argtuple_error;
7009 values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
7010 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 127, __pyx_L3_error)
7011 values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
7012 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 127, __pyx_L3_error)
7013 values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
7014 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 127, __pyx_L3_error)
7015 values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
7016 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 127, __pyx_L3_error)
7017 values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
7018 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 127, __pyx_L3_error)
7019 values[5] = __Pyx_ArgRef_FASTCALL(__pyx_args, 5);
7020 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[5])) __PYX_ERR(0, 127, __pyx_L3_error)
7021 values[6] = __Pyx_ArgRef_FASTCALL(__pyx_args, 6);
7022 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[6])) __PYX_ERR(0, 127, __pyx_L3_error)
7023 values[7] = __Pyx_ArgRef_FASTCALL(__pyx_args, 7);
7024 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[7])) __PYX_ERR(0, 127, __pyx_L3_error)
7025 values[8] = __Pyx_ArgRef_FASTCALL(__pyx_args, 8);
7026 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[8])) __PYX_ERR(0, 127, __pyx_L3_error)
7027 values[9] = __Pyx_ArgRef_FASTCALL(__pyx_args, 9);
7028 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[9])) __PYX_ERR(0, 127, __pyx_L3_error)
7029 values[10] = __Pyx_ArgRef_FASTCALL(__pyx_args, 10);
7030 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[10])) __PYX_ERR(0, 127, __pyx_L3_error)
7031 values[11] = __Pyx_ArgRef_FASTCALL(__pyx_args, 11);
7032 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[11])) __PYX_ERR(0, 127, __pyx_L3_error)
7033 values[12] = __Pyx_ArgRef_FASTCALL(__pyx_args, 12);
7034 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[12])) __PYX_ERR(0, 127, __pyx_L3_error)
7036 __pyx_v_jobvl = values[0];
7037 __pyx_v_jobvr = values[1];
7038 __pyx_v_n = values[2];
7039 __pyx_v_leig = values[3];
7040 __pyx_v_lda = values[4];
7041 __pyx_v_eigenvalues_r = values[5];
7042 __pyx_v_eigenvalues_i = values[6];
7043 __pyx_v_leftEigenvectors = values[7];
7044 __pyx_v_ldvl = values[8];
7045 __pyx_v_rightEigenvectors = values[9];
7046 __pyx_v_ldvr = values[10];
7047 __pyx_v_work = values[11];
7048 __pyx_v_lwork = values[12];
7051 __pyx_L5_argtuple_error:;
7052 __Pyx_RaiseArgtupleInvalid(
"denseCalculateEigenvalues", 1, 13, 13, __pyx_nargs); __PYX_ERR(0, 127, __pyx_L3_error)
7054 goto __pyx_L4_argument_unpacking_done;
7056 for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(
sizeof(values)/
sizeof(values[0])); ++__pyx_temp) {
7057 Py_XDECREF(values[__pyx_temp]);
7059 __Pyx_AddTraceback(
"clapack.denseCalculateEigenvalues", __pyx_clineno, __pyx_lineno, __pyx_filename);
7060 __Pyx_RefNannyFinishContext();
7062 __pyx_L4_argument_unpacking_done:;
7063 __pyx_r = __pyx_pf_7clapack_6denseCalculateEigenvalues(__pyx_self, __pyx_v_jobvl, __pyx_v_jobvr, __pyx_v_n, __pyx_v_leig, __pyx_v_lda, __pyx_v_eigenvalues_r, __pyx_v_eigenvalues_i, __pyx_v_leftEigenvectors, __pyx_v_ldvl, __pyx_v_rightEigenvectors, __pyx_v_ldvr, __pyx_v_work, __pyx_v_lwork);
7066 for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(
sizeof(values)/
sizeof(values[0])); ++__pyx_temp) {
7067 Py_XDECREF(values[__pyx_temp]);
7069 __Pyx_RefNannyFinishContext();
7073static PyObject *__pyx_pf_7clapack_6denseCalculateEigenvalues(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_jobvl, PyObject *__pyx_v_jobvr, PyObject *__pyx_v_n, PyObject *__pyx_v_leig, PyObject *__pyx_v_lda, PyObject *__pyx_v_eigenvalues_r, PyObject *__pyx_v_eigenvalues_i, PyObject *__pyx_v_leftEigenvectors, PyObject *__pyx_v_ldvl, PyObject *__pyx_v_rightEigenvectors, PyObject *__pyx_v_ldvr, PyObject *__pyx_v_work, PyObject *__pyx_v_lwork) {
7074 PyObject *__pyx_r = NULL;
7075 __Pyx_RefNannyDeclarations
7083 PyObject *__pyx_t_8 = NULL;
7084 int __pyx_lineno = 0;
7085 const char *__pyx_filename = NULL;
7086 int __pyx_clineno = 0;
7087 __Pyx_RefNannySetupContext(
"denseCalculateEigenvalues", 0);
7096 __pyx_t_1 = __Pyx_PyObject_AsWritableString(__pyx_v_jobvl);
if (unlikely((!__pyx_t_1) && PyErr_Occurred())) __PYX_ERR(0, 171, __pyx_L1_error)
7105 __pyx_t_2 = __Pyx_PyObject_AsWritableString(__pyx_v_jobvr);
if (unlikely((!__pyx_t_2) && PyErr_Occurred())) __PYX_ERR(0, 172, __pyx_L1_error)
7114 __pyx_t_3 = __Pyx_PyLong_As_int(__pyx_v_n);
if (unlikely((__pyx_t_3 == (
int)-1) && PyErr_Occurred())) __PYX_ERR(0, 173, __pyx_L1_error)
7123 if (!(likely(((__pyx_v_leig) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_leig, __pyx_mstate_global->__pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 174, __pyx_L1_error)
7132 __pyx_t_4 = __Pyx_PyLong_As_int(__pyx_v_lda);
if (unlikely((__pyx_t_4 == (
int)-1) && PyErr_Occurred())) __PYX_ERR(0, 175, __pyx_L1_error)
7141 if (!(likely(((__pyx_v_eigenvalues_r) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_eigenvalues_r, __pyx_mstate_global->__pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 176, __pyx_L1_error)
7150 if (!(likely(((__pyx_v_eigenvalues_i) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_eigenvalues_i, __pyx_mstate_global->__pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 177, __pyx_L1_error)
7159 if (!(likely(((__pyx_v_leftEigenvectors) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_leftEigenvectors, __pyx_mstate_global->__pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 178, __pyx_L1_error)
7168 __pyx_t_5 = __Pyx_PyLong_As_int(__pyx_v_ldvl);
if (unlikely((__pyx_t_5 == (
int)-1) && PyErr_Occurred())) __PYX_ERR(0, 179, __pyx_L1_error)
7177 if (!(likely(((__pyx_v_rightEigenvectors) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_rightEigenvectors, __pyx_mstate_global->__pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 180, __pyx_L1_error)
7186 __pyx_t_6 = __Pyx_PyLong_As_int(__pyx_v_ldvr);
if (unlikely((__pyx_t_6 == (
int)-1) && PyErr_Occurred())) __PYX_ERR(0, 181, __pyx_L1_error)
7195 if (!(likely(((__pyx_v_work) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_work, __pyx_mstate_global->__pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 182, __pyx_L1_error)
7203 __pyx_t_7 = __Pyx_PyLong_As_int(__pyx_v_lwork);
if (unlikely((__pyx_t_7 == (
int)-1) && PyErr_Occurred())) __PYX_ERR(0, 183, __pyx_L1_error)
7212 __pyx_t_8 = __pyx_f_7clapack_lapackWrappersDenseCalculateEigenvalues(__pyx_t_1, __pyx_t_2, __pyx_t_3, ((PyArrayObject *)__pyx_v_leig), __pyx_t_4, ((PyArrayObject *)__pyx_v_eigenvalues_r), ((PyArrayObject *)__pyx_v_eigenvalues_i), ((PyArrayObject *)__pyx_v_leftEigenvectors), __pyx_t_5, ((PyArrayObject *)__pyx_v_rightEigenvectors), __pyx_t_6, ((PyArrayObject *)__pyx_v_work), __pyx_t_7);
if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 171, __pyx_L1_error)
7213 __Pyx_GOTREF(__pyx_t_8);
7221 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
7232 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
7235 __Pyx_XDECREF(__pyx_t_8);
7236 __Pyx_AddTraceback(
"clapack.denseCalculateEigenvalues", __pyx_clineno, __pyx_lineno, __pyx_filename);
7239 __Pyx_XGIVEREF(__pyx_r);
7240 __Pyx_RefNannyFinishContext();
7245static PyMethodDef __pyx_methods[] = {
7249static CYTHON_SMALL_CODE
int __Pyx_InitCachedBuiltins(__pyx_mstatetype *__pyx_mstate);
7250static CYTHON_SMALL_CODE
int __Pyx_InitCachedConstants(__pyx_mstatetype *__pyx_mstate);
7251static CYTHON_SMALL_CODE
int __Pyx_InitGlobals(
void);
7252static CYTHON_SMALL_CODE
int __Pyx_InitAfterSharedUtility(
void);
7253static CYTHON_SMALL_CODE
int __Pyx_InitConstants(__pyx_mstatetype *__pyx_mstate);
7254static CYTHON_SMALL_CODE
int __Pyx_modinit_Global_init_code(__pyx_mstatetype *__pyx_mstate);
7255static CYTHON_SMALL_CODE
int __Pyx_modinit_Variable_export_code(__pyx_mstatetype *__pyx_mstate);
7256static CYTHON_SMALL_CODE
int __Pyx_modinit_Function_export_code(__pyx_mstatetype *__pyx_mstate);
7257static CYTHON_SMALL_CODE
int __Pyx_modinit_Type_import_code(__pyx_mstatetype *__pyx_mstate);
7258static CYTHON_SMALL_CODE
int __Pyx_modinit_Variable_import_code(__pyx_mstatetype *__pyx_mstate);
7259static CYTHON_SMALL_CODE
int __Pyx_modinit_Function_import_code(__pyx_mstatetype *__pyx_mstate);
7260static CYTHON_SMALL_CODE
int __Pyx_CreateCodeObjects(__pyx_mstatetype *__pyx_mstate);
7263static int __Pyx_modinit_Global_init_code(__pyx_mstatetype *__pyx_mstate) {
7264 __Pyx_RefNannyDeclarations
7265 CYTHON_UNUSED_VAR(__pyx_mstate);
7266 __Pyx_RefNannySetupContext(
"__Pyx_modinit_Global_init_code", 0);
7268 __Pyx_RefNannyFinishContext();
7272static int __Pyx_modinit_Variable_export_code(__pyx_mstatetype *__pyx_mstate) {
7273 __Pyx_RefNannyDeclarations
7274 CYTHON_UNUSED_VAR(__pyx_mstate);
7275 __Pyx_RefNannySetupContext(
"__Pyx_modinit_Variable_export_code", 0);
7277 __Pyx_RefNannyFinishContext();
7281static int __Pyx_modinit_Function_export_code(__pyx_mstatetype *__pyx_mstate) {
7282 __Pyx_RefNannyDeclarations
7283 CYTHON_UNUSED_VAR(__pyx_mstate);
7284 __Pyx_RefNannySetupContext(
"__Pyx_modinit_Function_export_code", 0);
7286 __Pyx_RefNannyFinishContext();
7290static int __Pyx_modinit_Type_import_code(__pyx_mstatetype *__pyx_mstate) {
7291 __Pyx_RefNannyDeclarations
7292 PyObject *__pyx_t_1 = NULL;
7293 int __pyx_lineno = 0;
7294 const char *__pyx_filename = NULL;
7295 int __pyx_clineno = 0;
7296 CYTHON_UNUSED_VAR(__pyx_mstate);
7297 __Pyx_RefNannySetupContext(
"__Pyx_modinit_Type_import_code", 0);
7299 __pyx_t_1 = PyImport_ImportModule(__Pyx_BUILTIN_MODULE_NAME);
if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 9, __pyx_L1_error)
7300 __Pyx_GOTREF(__pyx_t_1);
7301 __pyx_mstate->__pyx_ptype_7cpython_4type_type = __Pyx_ImportType_3_3_0(__pyx_t_1, __Pyx_BUILTIN_MODULE_NAME,
"type",
7302 #
if defined(PYPY_VERSION_NUM) && PYPY_VERSION_NUM < 0x050B0000
7303 sizeof(PyTypeObject), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(PyTypeObject),
7304 #elif CYTHON_COMPILING_IN_LIMITED_API
7307 sizeof(PyHeapTypeObject), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(PyHeapTypeObject),
7309 __Pyx_ImportType_CheckSize_Warn_3_3_0);
if (!__pyx_mstate->__pyx_ptype_7cpython_4type_type) __PYX_ERR(2, 9, __pyx_L1_error)
7310 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
7311 __pyx_t_1 = PyImport_ImportModule(
"numpy");
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 229, __pyx_L1_error)
7312 __Pyx_GOTREF(__pyx_t_1);
7313 __pyx_mstate->__pyx_ptype_5numpy_dtype = __Pyx_ImportType_3_3_0(__pyx_t_1,
"numpy",
"dtype",
7314 #
if defined(PYPY_VERSION_NUM) && PYPY_VERSION_NUM < 0x050B0000
7315 sizeof(PyArray_Descr), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(PyArray_Descr),
7316 #elif CYTHON_COMPILING_IN_LIMITED_API
7317 sizeof(PyArray_Descr), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(PyArray_Descr),
7319 sizeof(PyArray_Descr), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(PyArray_Descr),
7321 __Pyx_ImportType_CheckSize_Ignore_3_3_0);
if (!__pyx_mstate->__pyx_ptype_5numpy_dtype) __PYX_ERR(1, 229, __pyx_L1_error)
7322 __pyx_mstate->__pyx_ptype_5numpy_flatiter = __Pyx_ImportType_3_3_0(__pyx_t_1,
"numpy",
"flatiter",
7323 #
if defined(PYPY_VERSION_NUM) && PYPY_VERSION_NUM < 0x050B0000
7324 sizeof(PyArrayIterObject), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(PyArrayIterObject),
7325 #elif CYTHON_COMPILING_IN_LIMITED_API
7326 sizeof(PyArrayIterObject), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(PyArrayIterObject),
7328 sizeof(PyArrayIterObject), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(PyArrayIterObject),
7330 __Pyx_ImportType_CheckSize_Ignore_3_3_0);
if (!__pyx_mstate->__pyx_ptype_5numpy_flatiter) __PYX_ERR(1, 286, __pyx_L1_error)
7331 __pyx_mstate->__pyx_ptype_5numpy_broadcast = __Pyx_ImportType_3_3_0(__pyx_t_1,
"numpy",
"broadcast",
7332 #
if defined(PYPY_VERSION_NUM) && PYPY_VERSION_NUM < 0x050B0000
7333 sizeof(PyArrayMultiIterObject), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(PyArrayMultiIterObject),
7334 #elif CYTHON_COMPILING_IN_LIMITED_API
7335 sizeof(PyArrayMultiIterObject), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(PyArrayMultiIterObject),
7337 sizeof(PyArrayMultiIterObject), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(PyArrayMultiIterObject),
7339 __Pyx_ImportType_CheckSize_Ignore_3_3_0);
if (!__pyx_mstate->__pyx_ptype_5numpy_broadcast) __PYX_ERR(1, 290, __pyx_L1_error)
7340 __pyx_mstate->__pyx_ptype_5numpy_ndarray = __Pyx_ImportType_3_3_0(__pyx_t_1,
"numpy",
"ndarray",
7341 #
if defined(PYPY_VERSION_NUM) && PYPY_VERSION_NUM < 0x050B0000
7342 sizeof(PyArrayObject), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(PyArrayObject),
7343 #elif CYTHON_COMPILING_IN_LIMITED_API
7344 sizeof(PyArrayObject), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(PyArrayObject),
7346 sizeof(PyArrayObject), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(PyArrayObject),
7348 __Pyx_ImportType_CheckSize_Ignore_3_3_0);
if (!__pyx_mstate->__pyx_ptype_5numpy_ndarray) __PYX_ERR(1, 329, __pyx_L1_error)
7349 __pyx_mstate->__pyx_ptype_5numpy_generic = __Pyx_ImportType_3_3_0(__pyx_t_1,
"numpy",
"generic",
7350 #
if defined(PYPY_VERSION_NUM) && PYPY_VERSION_NUM < 0x050B0000
7351 sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(PyObject),
7352 #elif CYTHON_COMPILING_IN_LIMITED_API
7353 sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(PyObject),
7355 sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(PyObject),
7357 __Pyx_ImportType_CheckSize_Warn_3_3_0);
if (!__pyx_mstate->__pyx_ptype_5numpy_generic) __PYX_ERR(1, 847, __pyx_L1_error)
7358 __pyx_mstate->__pyx_ptype_5numpy_number = __Pyx_ImportType_3_3_0(__pyx_t_1,
"numpy",
"number",
7359 #
if defined(PYPY_VERSION_NUM) && PYPY_VERSION_NUM < 0x050B0000
7360 sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(PyObject),
7361 #elif CYTHON_COMPILING_IN_LIMITED_API
7362 sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(PyObject),
7364 sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(PyObject),
7366 __Pyx_ImportType_CheckSize_Warn_3_3_0);
if (!__pyx_mstate->__pyx_ptype_5numpy_number) __PYX_ERR(1, 849, __pyx_L1_error)
7367 __pyx_mstate->__pyx_ptype_5numpy_integer = __Pyx_ImportType_3_3_0(__pyx_t_1,
"numpy",
"integer",
7368 #
if defined(PYPY_VERSION_NUM) && PYPY_VERSION_NUM < 0x050B0000
7369 sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(PyObject),
7370 #elif CYTHON_COMPILING_IN_LIMITED_API
7371 sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(PyObject),
7373 sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(PyObject),
7375 __Pyx_ImportType_CheckSize_Warn_3_3_0);
if (!__pyx_mstate->__pyx_ptype_5numpy_integer) __PYX_ERR(1, 851, __pyx_L1_error)
7376 __pyx_mstate->__pyx_ptype_5numpy_signedinteger = __Pyx_ImportType_3_3_0(__pyx_t_1,
"numpy",
"signedinteger",
7377 #
if defined(PYPY_VERSION_NUM) && PYPY_VERSION_NUM < 0x050B0000
7378 sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(PyObject),
7379 #elif CYTHON_COMPILING_IN_LIMITED_API
7380 sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(PyObject),
7382 sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(PyObject),
7384 __Pyx_ImportType_CheckSize_Warn_3_3_0);
if (!__pyx_mstate->__pyx_ptype_5numpy_signedinteger) __PYX_ERR(1, 853, __pyx_L1_error)
7385 __pyx_mstate->__pyx_ptype_5numpy_unsignedinteger = __Pyx_ImportType_3_3_0(__pyx_t_1,
"numpy",
"unsignedinteger",
7386 #
if defined(PYPY_VERSION_NUM) && PYPY_VERSION_NUM < 0x050B0000
7387 sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(PyObject),
7388 #elif CYTHON_COMPILING_IN_LIMITED_API
7389 sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(PyObject),
7391 sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(PyObject),
7393 __Pyx_ImportType_CheckSize_Warn_3_3_0);
if (!__pyx_mstate->__pyx_ptype_5numpy_unsignedinteger) __PYX_ERR(1, 855, __pyx_L1_error)
7394 __pyx_mstate->__pyx_ptype_5numpy_inexact = __Pyx_ImportType_3_3_0(__pyx_t_1,
"numpy",
"inexact",
7395 #
if defined(PYPY_VERSION_NUM) && PYPY_VERSION_NUM < 0x050B0000
7396 sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(PyObject),
7397 #elif CYTHON_COMPILING_IN_LIMITED_API
7398 sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(PyObject),
7400 sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(PyObject),
7402 __Pyx_ImportType_CheckSize_Warn_3_3_0);
if (!__pyx_mstate->__pyx_ptype_5numpy_inexact) __PYX_ERR(1, 857, __pyx_L1_error)
7403 __pyx_mstate->__pyx_ptype_5numpy_floating = __Pyx_ImportType_3_3_0(__pyx_t_1,
"numpy",
"floating",
7404 #
if defined(PYPY_VERSION_NUM) && PYPY_VERSION_NUM < 0x050B0000
7405 sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(PyObject),
7406 #elif CYTHON_COMPILING_IN_LIMITED_API
7407 sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(PyObject),
7409 sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(PyObject),
7411 __Pyx_ImportType_CheckSize_Warn_3_3_0);
if (!__pyx_mstate->__pyx_ptype_5numpy_floating) __PYX_ERR(1, 859, __pyx_L1_error)
7412 __pyx_mstate->__pyx_ptype_5numpy_complexfloating = __Pyx_ImportType_3_3_0(__pyx_t_1,
"numpy",
"complexfloating",
7413 #
if defined(PYPY_VERSION_NUM) && PYPY_VERSION_NUM < 0x050B0000
7414 sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(PyObject),
7415 #elif CYTHON_COMPILING_IN_LIMITED_API
7416 sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(PyObject),
7418 sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(PyObject),
7420 __Pyx_ImportType_CheckSize_Warn_3_3_0);
if (!__pyx_mstate->__pyx_ptype_5numpy_complexfloating) __PYX_ERR(1, 861, __pyx_L1_error)
7421 __pyx_mstate->__pyx_ptype_5numpy_flexible = __Pyx_ImportType_3_3_0(__pyx_t_1,
"numpy",
"flexible",
7422 #
if defined(PYPY_VERSION_NUM) && PYPY_VERSION_NUM < 0x050B0000
7423 sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(PyObject),
7424 #elif CYTHON_COMPILING_IN_LIMITED_API
7425 sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(PyObject),
7427 sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(PyObject),
7429 __Pyx_ImportType_CheckSize_Warn_3_3_0);
if (!__pyx_mstate->__pyx_ptype_5numpy_flexible) __PYX_ERR(1, 863, __pyx_L1_error)
7430 __pyx_mstate->__pyx_ptype_5numpy_character = __Pyx_ImportType_3_3_0(__pyx_t_1,
"numpy",
"character",
7431 #
if defined(PYPY_VERSION_NUM) && PYPY_VERSION_NUM < 0x050B0000
7432 sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(PyObject),
7433 #elif CYTHON_COMPILING_IN_LIMITED_API
7434 sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(PyObject),
7436 sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(PyObject),
7438 __Pyx_ImportType_CheckSize_Warn_3_3_0);
if (!__pyx_mstate->__pyx_ptype_5numpy_character) __PYX_ERR(1, 865, __pyx_L1_error)
7439 __pyx_mstate->__pyx_ptype_5numpy_ufunc = __Pyx_ImportType_3_3_0(__pyx_t_1,
"numpy",
"ufunc",
7440 #
if defined(PYPY_VERSION_NUM) && PYPY_VERSION_NUM < 0x050B0000
7441 sizeof(PyUFuncObject), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(PyUFuncObject),
7442 #elif CYTHON_COMPILING_IN_LIMITED_API
7443 sizeof(PyUFuncObject), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(PyUFuncObject),
7445 sizeof(PyUFuncObject), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(PyUFuncObject),
7447 __Pyx_ImportType_CheckSize_Ignore_3_3_0);
if (!__pyx_mstate->__pyx_ptype_5numpy_ufunc) __PYX_ERR(1, 946, __pyx_L1_error)
7448 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
7449 __Pyx_RefNannyFinishContext();
7452 __Pyx_XDECREF(__pyx_t_1);
7453 __Pyx_RefNannyFinishContext();
7457static int __Pyx_modinit_Variable_import_code(__pyx_mstatetype *__pyx_mstate) {
7458 __Pyx_RefNannyDeclarations
7459 CYTHON_UNUSED_VAR(__pyx_mstate);
7460 __Pyx_RefNannySetupContext(
"__Pyx_modinit_Variable_import_code", 0);
7462 __Pyx_RefNannyFinishContext();
7466static int __Pyx_modinit_Function_import_code(__pyx_mstatetype *__pyx_mstate) {
7467 __Pyx_RefNannyDeclarations
7468 CYTHON_UNUSED_VAR(__pyx_mstate);
7469 __Pyx_RefNannySetupContext(
"__Pyx_modinit_Function_import_code", 0);
7471 __Pyx_RefNannyFinishContext();
7475#if CYTHON_PEP489_MULTI_PHASE_INIT
7476static PyObject* __pyx_pymod_create(PyObject *spec, PyModuleDef *def);
7477static int __pyx_pymod_exec_clapack(PyObject* module);
7478static PyModuleDef_Slot __pyx_moduledef_slots[] = {
7479 {Py_mod_create, (
void*)__pyx_pymod_create},
7480 {Py_mod_exec, (
void*)__pyx_pymod_exec_clapack},
7481 #if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING
7482 {Py_mod_gil, __Pyx_FREETHREADING_COMPATIBLE},
7484 #if PY_VERSION_HEX >= 0x030C0000 && CYTHON_USE_MODULE_STATE
7485 {Py_mod_multiple_interpreters, Py_MOD_MULTIPLE_INTERPRETERS_NOT_SUPPORTED},
7493 struct PyModuleDef __pyx_moduledef =
7495 static struct PyModuleDef __pyx_moduledef =
7498 PyModuleDef_HEAD_INIT,
7501 #if CYTHON_USE_MODULE_STATE
7502 sizeof(__pyx_mstatetype),
7504 (CYTHON_PEP489_MULTI_PHASE_INIT) ? 0 : -1,
7507 #if CYTHON_PEP489_MULTI_PHASE_INIT
7508 __pyx_moduledef_slots,
7512 #if CYTHON_USE_MODULE_STATE
7527#ifndef CYTHON_NO_PYINIT_EXPORT
7528 #define __Pyx_PyMODINIT_FUNC PyMODINIT_FUNC
7531 #define __Pyx_PyMODINIT_FUNC extern "C" PyObject *
7533 #define __Pyx_PyMODINIT_FUNC PyObject *
7537__Pyx_PyMODINIT_FUNC PyInit_clapack(
void) CYTHON_SMALL_CODE;
7538__Pyx_PyMODINIT_FUNC PyInit_clapack(
void)
7539#if CYTHON_PEP489_MULTI_PHASE_INIT
7541 return PyModuleDef_Init(&__pyx_moduledef);
7544#if CYTHON_COMPILING_IN_LIMITED_API && (__PYX_LIMITED_VERSION_HEX < 0x030A0000 &&\
7545 (defined(_WIN32) || defined(WIN32) || defined(MS_WINDOWS)))
7546static PY_INT64_T __Pyx_GetCurrentInterpreterId(
void) {
7548 PyObject *module = PyImport_ImportModule(
"_interpreters");
7550 if (!PyErr_ExceptionMatches(PyExc_Exception)) {
7554 module = PyImport_ImportModule("_xxsubinterpreters");
7555 if (!module)
goto bad;
7557 PyObject *current = PyObject_CallMethod(module,
"get_current", NULL);
7559 if (!current)
goto bad;
7560 if (PyTuple_Check(current)) {
7561 PyObject *new_current = PySequence_GetItem(current, 0);
7563 current = new_current;
7564 if (!new_current)
goto bad;
7566 long long as_c_int = PyLong_AsLongLong(current);
7571 PySys_WriteStderr(
"__Pyx_GetCurrentInterpreterId failed. Try setting the C define CYTHON_PEP489_MULTI_PHASE_INIT=0\n");
7575#if !CYTHON_USE_MODULE_STATE
7576static CYTHON_SMALL_CODE
int __Pyx_check_single_interpreter(
void) {
7577 static PY_INT64_T main_interpreter_id = -1;
7578#if CYTHON_COMPILING_IN_GRAAL && defined(GRAALPY_VERSION_NUM) && GRAALPY_VERSION_NUM > 0x19000000
7579 PY_INT64_T current_id = GraalPyInterpreterState_GetIDFromThreadState(PyThreadState_Get());
7580#elif CYTHON_COMPILING_IN_GRAAL
7581 PY_INT64_T current_id = PyInterpreterState_GetIDFromThreadState(PyThreadState_Get());
7582#elif CYTHON_COMPILING_IN_LIMITED_API && (__PYX_LIMITED_VERSION_HEX < 0x030A0000 &&\
7583 (defined(_WIN32) || defined(WIN32) || defined(MS_WINDOWS)))
7584 PY_INT64_T current_id = __Pyx_GetCurrentInterpreterId();
7585#elif CYTHON_COMPILING_IN_LIMITED_API
7586 PY_INT64_T current_id = PyInterpreterState_GetID(PyInterpreterState_Get());
7588 PY_INT64_T current_id = PyInterpreterState_GetID(PyThreadState_Get()->interp);
7590 if (unlikely(current_id == -1)) {
7593 if (main_interpreter_id == -1) {
7594 main_interpreter_id = current_id;
7596 }
else if (unlikely(main_interpreter_id != current_id)) {
7599 "Interpreter change detected - this module can only be loaded into one interpreter per process.");
7605static CYTHON_SMALL_CODE
int __Pyx_copy_spec_to_module(PyObject *spec, PyObject *moddict,
const char* from_name,
const char* to_name,
int allow_none)
7607 PyObject *value = PyObject_GetAttrString(spec, from_name);
7609 if (likely(value)) {
7610 if (allow_none || value != Py_None) {
7611 result = PyDict_SetItemString(moddict, to_name, value);
7614 }
else if (PyErr_ExceptionMatches(PyExc_AttributeError)) {
7621static CYTHON_SMALL_CODE PyObject* __pyx_pymod_create(PyObject *spec, PyModuleDef *def) {
7622 PyObject *module = NULL, *moddict, *modname;
7623 CYTHON_UNUSED_VAR(def);
7624 #if !CYTHON_USE_MODULE_STATE
7625 if (__Pyx_check_single_interpreter())
7629 return __Pyx_NewRef(__pyx_m);
7630 modname = PyObject_GetAttrString(spec,
"name");
7631 if (unlikely(!modname))
goto bad;
7632 module = PyModule_NewObject(modname);
7634 if (unlikely(!module))
goto bad;
7635 moddict = PyModule_GetDict(module);
7636 if (unlikely(!moddict))
goto bad;
7637 if (unlikely(__Pyx_copy_spec_to_module(spec, moddict,
"loader",
"__loader__", 1) < 0))
goto bad;
7638 if (unlikely(__Pyx_copy_spec_to_module(spec, moddict,
"origin",
"__file__", 1) < 0))
goto bad;
7639 if (unlikely(__Pyx_copy_spec_to_module(spec, moddict,
"parent",
"__package__", 1) < 0))
goto bad;
7640 if (unlikely(__Pyx_copy_spec_to_module(spec, moddict,
"submodule_search_locations",
"__path__", 0) < 0))
goto bad;
7648static CYTHON_SMALL_CODE
int __pyx_pymod_exec_clapack(PyObject *__pyx_pyinit_module)
7651 int stringtab_initialized = 0;
7652 #if CYTHON_USE_MODULE_STATE
7653 int pystate_addmodule_run = 0;
7655 __pyx_mstatetype *__pyx_mstate = NULL;
7656 PyObject *__pyx_t_1 = NULL;
7657 PyObject *__pyx_t_2 = NULL;
7658 PyObject *__pyx_t_3 = NULL;
7659 int __pyx_lineno = 0;
7660 const char *__pyx_filename = NULL;
7661 int __pyx_clineno = 0;
7662 __Pyx_RefNannyDeclarations
7663 #if CYTHON_PEP489_MULTI_PHASE_INIT
7665 if (__pyx_m == __pyx_pyinit_module)
return 0;
7666 PyErr_SetString(PyExc_RuntimeError,
"Module 'clapack' has already been imported. Re-initialisation is not supported.");
7670 if (__pyx_m)
return __Pyx_NewRef(__pyx_m);
7673 #if CYTHON_PEP489_MULTI_PHASE_INIT
7674 __pyx_t_1 = __pyx_pyinit_module;
7675 Py_INCREF(__pyx_t_1);
7677 __pyx_t_1 = PyModule_Create(&__pyx_moduledef);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1, __pyx_L1_error)
7679 #if CYTHON_USE_MODULE_STATE
7681 int add_module_result = __Pyx_State_AddModule(__pyx_t_1, &__pyx_moduledef);
7683 if (unlikely((add_module_result < 0))) __PYX_ERR(0, 1, __pyx_L1_error)
7684 pystate_addmodule_run = 1;
7687 __pyx_m = __pyx_t_1;
7689 #if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING
7690 PyUnstable_Module_SetGIL(__pyx_m, Py_MOD_GIL_USED);
7692 __pyx_mstate = __pyx_mstate_global;
7693 CYTHON_UNUSED_VAR(__pyx_t_1);
7694 __pyx_mstate->__pyx_d = PyModule_GetDict(__pyx_m);
if (unlikely(!__pyx_mstate->__pyx_d)) __PYX_ERR(0, 1, __pyx_L1_error)
7695 Py_INCREF(__pyx_mstate->__pyx_d);
7696 __pyx_mstate->__pyx_b = __Pyx_PyImport_AddModuleRef(__Pyx_BUILTIN_MODULE_NAME);
if (unlikely(!__pyx_mstate->__pyx_b)) __PYX_ERR(0, 1, __pyx_L1_error)
7697 __pyx_mstate->__pyx_cython_runtime = __Pyx_PyImport_AddModuleRef(
"cython_runtime");
if (unlikely(!__pyx_mstate->__pyx_cython_runtime)) __PYX_ERR(0, 1, __pyx_L1_error)
7698 if (PyObject_SetAttrString(__pyx_m,
"__builtins__", __pyx_mstate->__pyx_b) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
7701 __Pyx_RefNanny = __Pyx_RefNannyImportAPI(
"refnanny");
7702 if (!__Pyx_RefNanny) {
7703 if (PyErr_ExceptionMatches(PyExc_Exception)) {
7705 __Pyx_RefNanny = __Pyx_RefNannyImportAPI(
"Cython.Runtime.refnanny");
7707 if (!__Pyx_RefNanny)
7708 Py_FatalError(
"failed to import 'refnanny' module");
7712__Pyx_RefNannySetupContext(
"PyInit_clapack", 0);
7713 __Pyx_init_runtime_version();
7714 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)
7715 __pyx_mstate->__pyx_empty_tuple = PyTuple_New(0);
if (unlikely(!__pyx_mstate->__pyx_empty_tuple)) __PYX_ERR(0, 1, __pyx_L1_error)
7716 __pyx_mstate->__pyx_empty_bytes = PyBytes_FromStringAndSize(
"", 0);
if (unlikely(!__pyx_mstate->__pyx_empty_bytes)) __PYX_ERR(0, 1, __pyx_L1_error)
7717 __pyx_mstate->__pyx_empty_unicode = PyUnicode_FromStringAndSize(
"", 0);
if (unlikely(!__pyx_mstate->__pyx_empty_unicode)) __PYX_ERR(0, 1, __pyx_L1_error)
7720 if (__Pyx_InitConstants(__pyx_mstate) < (0)) __PYX_ERR(0, 1, __pyx_L1_error)
7721 stringtab_initialized = 1;
7722 if (__Pyx_InitGlobals() < (0)) __PYX_ERR(0, 1, __pyx_L1_error)
7723 if (__pyx_module_is_main_clapack) {
7724 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)
7727 PyObject *modules = PyImport_GetModuleDict();
if (unlikely(!modules)) __PYX_ERR(0, 1, __pyx_L1_error)
7728 if (!PyDict_GetItemString(modules,
"clapack")) {
7729 if (unlikely((PyDict_SetItemString(modules,
"clapack", __pyx_m) < 0))) __PYX_ERR(0, 1, __pyx_L1_error)
7733 if (__Pyx_InitCachedBuiltins(__pyx_mstate) < (0)) __PYX_ERR(0, 1, __pyx_L1_error)
7735 if (__Pyx_InitCachedConstants(__pyx_mstate) < (0)) __PYX_ERR(0, 1, __pyx_L1_error)
7736 if (__Pyx_CreateCodeObjects(__pyx_mstate) < (0)) __PYX_ERR(0, 1, __pyx_L1_error)
7738 (void)__Pyx_modinit_Global_init_code(__pyx_mstate);
7739 (void)__Pyx_modinit_Variable_export_code(__pyx_mstate);
7740 (void)__Pyx_modinit_Function_export_code(__pyx_mstate);
7742 if (unlikely((__Pyx_modinit_Type_import_code(__pyx_mstate) < 0))) __PYX_ERR(0, 1, __pyx_L1_error)
7743 (void)__Pyx_modinit_Variable_import_code(__pyx_mstate);
7744 (void)__Pyx_modinit_Function_import_code(__pyx_mstate);
7745 if (__Pyx_InitAfterSharedUtility() < (0)) __PYX_ERR(0, 1, __pyx_L1_error)
7754 __pyx_t_1 = __Pyx_Import(__pyx_mstate_global->__pyx_n_u_numpy, 0, 0, NULL, 0);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2, __pyx_L1_error)
7755 __pyx_t_2 = __pyx_t_1;
7756 __Pyx_GOTREF(__pyx_t_2);
7757 if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_np, __pyx_t_2) < (0)) __PYX_ERR(0, 2, __pyx_L1_error)
7758 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
7767 __pyx_t_2 = __Pyx_Py3MetaclassPrepare((PyObject *) NULL, __pyx_mstate_global->__pyx_empty_tuple, __pyx_mstate_global->__pyx_n_u_DenseFactor, __pyx_mstate_global->__pyx_n_u_DenseFactor, (PyObject *) NULL, __pyx_mstate_global->__pyx_n_u_clapack, (PyObject *) NULL);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 17, __pyx_L1_error)
7768 __Pyx_GOTREF(__pyx_t_2);
7777 __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_7clapack_11DenseFactor_1__init__, 0, __pyx_mstate_global->__pyx_n_u_DenseFactor___init, NULL, __pyx_mstate_global->__pyx_n_u_clapack, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[0]));
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 18, __pyx_L1_error)
7778 __Pyx_GOTREF(__pyx_t_3);
7779 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
7780 PyUnstable_Object_EnableDeferredRefcount(__pyx_t_3);
7782 if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_init, __pyx_t_3) < (0)) __PYX_ERR(0, 18, __pyx_L1_error)
7783 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
7792 __pyx_t_3 = __Pyx_Py3ClassCreate(((PyObject*)&PyType_Type), __pyx_mstate_global->__pyx_n_u_DenseFactor, __pyx_mstate_global->__pyx_empty_tuple, __pyx_t_2, NULL, 0, 0);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 17, __pyx_L1_error)
7793 __Pyx_GOTREF(__pyx_t_3);
7794 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
7795 PyUnstable_Object_EnableDeferredRefcount(__pyx_t_3);
7797 if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_DenseFactor, __pyx_t_3) < (0)) __PYX_ERR(0, 17, __pyx_L1_error)
7798 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
7799 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
7808 __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_7clapack_1blasCopy, 0, __pyx_mstate_global->__pyx_n_u_blasCopy, NULL, __pyx_mstate_global->__pyx_n_u_clapack, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1]));
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 92, __pyx_L1_error)
7809 __Pyx_GOTREF(__pyx_t_2);
7810 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
7811 PyUnstable_Object_EnableDeferredRefcount(__pyx_t_2);
7813 if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_blasCopy, __pyx_t_2) < (0)) __PYX_ERR(0, 92, __pyx_L1_error)
7814 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
7823 __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_7clapack_3denseFactorPrepare, 0, __pyx_mstate_global->__pyx_n_u_denseFactorPrepare, NULL, __pyx_mstate_global->__pyx_n_u_clapack, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[2]));
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 101, __pyx_L1_error)
7824 __Pyx_GOTREF(__pyx_t_2);
7825 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
7826 PyUnstable_Object_EnableDeferredRefcount(__pyx_t_2);
7828 if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_denseFactorPrepare, __pyx_t_2) < (0)) __PYX_ERR(0, 101, __pyx_L1_error)
7829 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
7838 __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_7clapack_5denseFactorSolve, 0, __pyx_mstate_global->__pyx_n_u_denseFactorSolve, NULL, __pyx_mstate_global->__pyx_n_u_clapack, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[3]));
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 115, __pyx_L1_error)
7839 __Pyx_GOTREF(__pyx_t_2);
7840 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
7841 PyUnstable_Object_EnableDeferredRefcount(__pyx_t_2);
7843 if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_denseFactorSolve, __pyx_t_2) < (0)) __PYX_ERR(0, 115, __pyx_L1_error)
7844 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
7853 __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_7clapack_7denseCalculateEigenvalues, 0, __pyx_mstate_global->__pyx_n_u_denseCalculateEigenvalues, NULL, __pyx_mstate_global->__pyx_n_u_clapack, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[4]));
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 127, __pyx_L1_error)
7854 __Pyx_GOTREF(__pyx_t_2);
7855 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
7856 PyUnstable_Object_EnableDeferredRefcount(__pyx_t_2);
7858 if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_denseCalculateEigenvalues, __pyx_t_2) < (0)) __PYX_ERR(0, 127, __pyx_L1_error)
7859 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
7866 __pyx_t_2 = __Pyx_PyDict_NewPresized(0);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1, __pyx_L1_error)
7867 __Pyx_GOTREF(__pyx_t_2);
7868 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)
7869 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
7875 __Pyx_XDECREF(__pyx_t_2);
7876 __Pyx_XDECREF(__pyx_t_3);
7878 if (__pyx_mstate->__pyx_d && stringtab_initialized) {
7879 __Pyx_AddTraceback(
"init clapack", __pyx_clineno, __pyx_lineno, __pyx_filename);
7881 #if !CYTHON_USE_MODULE_STATE
7885 if (pystate_addmodule_run) {
7886 PyObject *tp, *value, *tb;
7887 __Pyx_PyErr_FetchException(&tp, &value, &tb);
7888 __Pyx_State_RemoveModule(&__pyx_moduledef);
7889 __Pyx_PyErr_RestoreException(tp, value, tb);
7892 }
else if (!PyErr_Occurred()) {
7893 PyErr_SetString(PyExc_ImportError,
"init clapack");
7896 __Pyx_RefNannyFinishContext();
7897 #if CYTHON_PEP489_MULTI_PHASE_INIT
7898 return (__pyx_m != NULL) ? 0 : -1;
7906static int __Pyx_InitCachedBuiltins(__pyx_mstatetype *__pyx_mstate) {
7907 CYTHON_UNUSED_VAR(__pyx_mstate);
7910 __pyx_mstate->__pyx_umethod_PyDict_Type_items.type = (PyObject*)&PyDict_Type;
7911 __pyx_mstate->__pyx_umethod_PyDict_Type_items.method_name = &__pyx_mstate->__pyx_n_u_items;
7912 __pyx_mstate->__pyx_umethod_PyDict_Type_pop.type = (PyObject*)&PyDict_Type;
7913 __pyx_mstate->__pyx_umethod_PyDict_Type_pop.method_name = &__pyx_mstate->__pyx_n_u_pop;
7914 __pyx_mstate->__pyx_umethod_PyDict_Type_values.type = (PyObject*)&PyDict_Type;
7915 __pyx_mstate->__pyx_umethod_PyDict_Type_values.method_name = &__pyx_mstate->__pyx_n_u_values;
7920static int __Pyx_InitCachedConstants(__pyx_mstatetype *__pyx_mstate) {
7921 __Pyx_RefNannyDeclarations
7922 int __pyx_lineno = 0;
7923 const char *__pyx_filename = NULL;
7924 int __pyx_clineno = 0;
7925 CYTHON_UNUSED_VAR(__pyx_mstate);
7926 __Pyx_RefNannySetupContext(
"__Pyx_InitCachedConstants", 0);
7936 PyObject* __pyx_temp[2] = {__pyx_mstate_global->__pyx_n_u_shape, __pyx_mstate_global->__pyx_n_u_dtype};
7937 __pyx_mstate_global->__pyx_tuple[0] = __Pyx_PyTuple_FromArray(__pyx_temp, 2);
if (unlikely(!__pyx_mstate_global->__pyx_tuple[0])) __PYX_ERR(0, 20, __pyx_L1_error)
7938 __Pyx_GOTREF(__pyx_mstate_global->__pyx_tuple[0]);
7940 __Pyx_GIVEREF(__pyx_mstate_global->__pyx_tuple[0]);
7941 #if CYTHON_IMMORTAL_CONSTANTS
7943 PyObject **table = __pyx_mstate->__pyx_tuple;
7944 for (Py_ssize_t i=0; i<1; ++i) {
7945 #if PY_VERSION_HEX >= 0x030F0000
7946 PyUnstable_SetImmortal(table[i]);
7947 #elif CYTHON_COMPILING_IN_CPYTHON_FREETHREADING
7948 if ((PY_SSIZE_T_MAX <= _Py_IMMORTAL_REFCNT_LOCAL))
break;
7949 #if PY_VERSION_HEX < 0x030E0000
7950 if (_Py_IsOwnedByCurrentThread(table[i]) && Py_REFCNT(table[i]) == 1)
7952 if (PyUnstable_Object_IsUniquelyReferenced(table[i]))
7955 Py_SET_REFCNT(table[i], ((Py_ssize_t)_Py_IMMORTAL_REFCNT_LOCAL + 1));
7958 if ((PY_SSIZE_T_MAX < _Py_IMMORTAL_INITIAL_REFCNT))
break;
7959 Py_SET_REFCNT(table[i], _Py_IMMORTAL_INITIAL_REFCNT);
7964 __Pyx_RefNannyFinishContext();
7967 __Pyx_RefNannyFinishContext();
7972static int __Pyx_InitConstants(__pyx_mstatetype *__pyx_mstate) {
7973 int __pyx_lineno = 0;
7974 const char *__pyx_filename = NULL;
7975 int __pyx_clineno = 0;
7976 CYTHON_UNUSED_VAR(__pyx_mstate);
7978 const struct {
const unsigned int length: 6; } str_length_index[] = {{1},{39},{34},{19},{5},{9},{11},{20},{20},{12},{7},{8},{8},{8},{13},{10},{8},{11},{12},{8},{13},{18},{1},{8},{7},{18},{25},{11},{18},{16},{5},{13},{13},{5},{5},{5},{5},{3},{4},{4},{16},{4},{2},{5},{3},{1},{2},{5},{6},{3},{17},{4},{10},{5},{6},{4},{5}};
7979 const struct {
const unsigned int length: 6; } bytes_length_index[] = {{24},{44},{34},{48},{49}};
7980 #ifndef CYTHON_COMPRESS_STRINGS
7981 #define CYTHON_COMPRESS_STRINGS 0
7983 #if (CYTHON_COMPRESS_STRINGS) == 1
7984static const char cstring[] =
"x\332\205R\275n\3330\020\216\001\307\010\320t\310\324vs\334\264S\252\302\355\320\2610\342xh\200 m\226n\304Y:\305l(\222&\217\252\325)cF\215\0325\372\2214\346\021\372\010%\245\246Q\233\241\304\221w\374\370\335\037\216\037\245\313t\021\261X\031\2142\047\210\2031P\214S\340\002\2231\2511\317\2642\324\247\271\014h\365\210\241\215\"t\366m,@C|\035\351b3_0\341\374\241y\256\310\316QZ\\@L\312\364\314\2101.91\277.\212\215\337s\036\023;\307\r}\301\2241\220R\021\020\206\367D\305A\245N\266\372\336-\003.[\215\004>\271\265\355E%N\264^\022\262Vk\203\032Lk\256\035\210{\230\320\206(\334\206\336\224#.\021l!c\256\242?\200].}\334\023\245\213\337\315\305\302\243\276\000F\006b\\z$\t\035\235\200\210\235\360\325\236\362+\2249\010\2076yh\265g^t\305\364\220K%rL\250\320\210\017\316\214\367/\206Kz\377\216\023f\366\233Z\346\"\034F$ \222\\\370m\004\246\324e\306\020\321\n\357,\234\370\256\314\265\237\230\224\272\035b7\014\255\264\341W\253\277\370\026Ej\221\022L\301\177\004\273\002\215]\346\020\341\007\032eo\006?G;\273Oo\317\312\365\335\360Y\271\256\006\315\363\027^:\374\240|RM\233\341\376\243\347\273\341Q=\253?7\257^{\361\334\275\177\271\223\372\260\2366/\217:\361\214\257\203\235\335\343\355t;k\216\337\374Wnf\315\336\376\355iy\020\324\242\234\224\213\352\260\372PO\352\371v\264\205\000~*\227\325\250\202*\257/\003\364\013\030\354)J";
7985 PyObject *data = __Pyx_DecompressString(cstring, 454, 1);
7986 #define __Pyx_DecompressString_LZSS_UNUSED
7987 if (unlikely(!data)) __PYX_ERR(0, 1, __pyx_L1_error)
7988 const char*
const bytes = __Pyx_PyBytes_AsString(data);
7989 #if !CYTHON_ASSUME_SAFE_MACROS
7990 if (likely(bytes));
else { Py_DECREF(data); __PYX_ERR(0, 1, __pyx_L1_error) }
7993static const char bytes[] =
"?numpy._core.multiarray failed to importnumpy._core.umath failed to importproteus/clapack.pyxDF_luDF_pivotsDenseFactorDenseFactor.__init____Pyx_PyDict_NextRef__annotate____doc____func____init____main____metaclass____module____name____prepare____qualname____test___is_coroutineasyncio.coroutinesbblasCopyclapackcline_in_tracebackdenseCalculateEigenvaluesdenseFactordenseFactorPreparedenseFactorSolvedtypeeigenvalues_ieigenvalues_rint32itemsjobvljobvrldaldvlldvrleftEigenvectorsleiglulworkmatnnpnumpypivotspoprightEigenvectorsselfsetdefaultshapevaluesworkzeros\200\001\360\006\000\005\r\210K\220q\340\004\027\220q\230\001\330\030\031\330\030\031\200\001\360\006\000\005\021\220\013\2301\330\004\014\210K\220q\340\004\027\220q\230\001\330\030\031\330\030\031\340\004$\240A\240Q\330%&\330%&\200\001\360\010\000\005\021\220\013\2301\330\004\014\210K\220q\340\004\"\240!\2401\330#$\330#$\330#$\200\001\360X\001\000\005,\2501\250A\330,-\330,-\330,-\330,-\330,-\330,-\330,-\330,-\330,-\330,-\330,-\330,-\200A\330\010\014\210E\220\021\330\010\014\210F\220\"\220F\230!\2307\240\"\240D\250\006\250a\330\010\014\210J\220b\230\006\230a\230v\240S\250\006\250a";
7994 PyObject *data = NULL;
7995 #define __Pyx_DecompressString_UNUSED
7996 #define __Pyx_DecompressString_LZSS_UNUSED
7998 PyObject **stringtab = __pyx_mstate->__pyx_string_tab;
8000 for (
int i = 0; i < 57; i++) {
8001 Py_ssize_t bytes_length = str_length_index[i].length;
8002 PyObject *
string = PyUnicode_DecodeUTF8(bytes + pos, bytes_length, NULL);
8003 if (likely(
string) && i >= 4) PyUnicode_InternInPlace(&
string);
8004 if (unlikely(!
string)) {
8006 __PYX_ERR(0, 1, __pyx_L1_error)
8008 stringtab[i] = string;
8009 pos += bytes_length;
8011 for (
int i = 57; i < 62; i++) {
8012 Py_ssize_t bytes_length = bytes_length_index[i-57].length;
8013 PyObject *
string = PyBytes_FromStringAndSize(bytes + pos, bytes_length);
8014 stringtab[i] = string;
8015 pos += bytes_length;
8016 if (unlikely(!
string)) {
8018 __PYX_ERR(0, 1, __pyx_L1_error)
8022 for (Py_ssize_t i = 0; i < 62; i++) {
8023 if (unlikely(PyObject_Hash(stringtab[i]) == -1)) {
8024 __PYX_ERR(0, 1, __pyx_L1_error)
8027 #if CYTHON_IMMORTAL_CONSTANTS
8029 PyObject **table = stringtab + 57;
8030 for (Py_ssize_t i=0; i<5; ++i) {
8031 #if PY_VERSION_HEX >= 0x030F0000
8032 PyUnstable_SetImmortal(table[i]);
8033 #elif CYTHON_COMPILING_IN_CPYTHON_FREETHREADING
8034 if ((PY_SSIZE_T_MAX <= _Py_IMMORTAL_REFCNT_LOCAL))
break;
8035 #if PY_VERSION_HEX < 0x030E0000
8036 if (_Py_IsOwnedByCurrentThread(table[i]) && Py_REFCNT(table[i]) == 1)
8038 if (PyUnstable_Object_IsUniquelyReferenced(table[i]))
8041 Py_SET_REFCNT(table[i], ((Py_ssize_t)_Py_IMMORTAL_REFCNT_LOCAL + 1));
8044 if ((PY_SSIZE_T_MAX < _Py_IMMORTAL_INITIAL_REFCNT))
break;
8045 Py_SET_REFCNT(table[i], _Py_IMMORTAL_INITIAL_REFCNT);
8060 unsigned int argcount : 4;
8061 unsigned int num_posonly_args : 1;
8062 unsigned int num_kwonly_args : 1;
8063 unsigned int nlocals : 4;
8064 unsigned int flags : 10;
8065 unsigned int first_line : 7;
8066} __Pyx_PyCode_New_function_description;
8071static PyObject* __Pyx_PyCode_New(
8072 const __Pyx_PyCode_New_function_description descr,
8073 PyObject *
const *varnames,
8076 PyObject *line_table,
8077 PyObject *tuple_dedup_map
8081static int __Pyx_CreateCodeObjects(__pyx_mstatetype *__pyx_mstate) {
8082 PyObject* tuple_dedup_map = PyDict_New();
8083 if (unlikely(!tuple_dedup_map))
return -1;
8085 const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 2, (
unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 18};
8086 PyObject*
const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_n};
8087 __pyx_mstate_global->__pyx_codeobj_tab[0] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_proteus_clapack_pyx, __pyx_mstate->__pyx_n_u_init, __pyx_mstate->__pyx_kp_b_iso88591_A_E_F_F_7_D_a_Jb_avS_a, tuple_dedup_map);
if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[0]))
goto bad;
8090 const __Pyx_PyCode_New_function_description descr = {3, 0, 0, 4, (
unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 92};
8091 PyObject*
const varnames[] = {__pyx_mstate->__pyx_n_u_n, __pyx_mstate->__pyx_n_u_mat, __pyx_mstate->__pyx_n_u_denseFactor, __pyx_mstate->__pyx_n_u_DF_lu};
8092 __pyx_mstate_global->__pyx_codeobj_tab[1] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_proteus_clapack_pyx, __pyx_mstate->__pyx_n_u_blasCopy, __pyx_mstate->__pyx_kp_b_iso88591_Kq_q, tuple_dedup_map);
if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1]))
goto bad;
8095 const __Pyx_PyCode_New_function_description descr = {3, 0, 0, 5, (
unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 101};
8096 PyObject*
const varnames[] = {__pyx_mstate->__pyx_n_u_n, __pyx_mstate->__pyx_n_u_mat, __pyx_mstate->__pyx_n_u_denseFactor, __pyx_mstate->__pyx_n_u_DF_pivots, __pyx_mstate->__pyx_n_u_DF_lu};
8097 __pyx_mstate_global->__pyx_codeobj_tab[2] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_proteus_clapack_pyx, __pyx_mstate->__pyx_n_u_denseFactorPrepare, __pyx_mstate->__pyx_kp_b_iso88591_1_Kq_q_AQ, tuple_dedup_map);
if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[2]))
goto bad;
8100 const __Pyx_PyCode_New_function_description descr = {4, 0, 0, 6, (
unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 115};
8101 PyObject*
const varnames[] = {__pyx_mstate->__pyx_n_u_n, __pyx_mstate->__pyx_n_u_mat, __pyx_mstate->__pyx_n_u_denseFactor, __pyx_mstate->__pyx_n_u_b, __pyx_mstate->__pyx_n_u_DF_pivots, __pyx_mstate->__pyx_n_u_DF_lu};
8102 __pyx_mstate_global->__pyx_codeobj_tab[3] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_proteus_clapack_pyx, __pyx_mstate->__pyx_n_u_denseFactorSolve, __pyx_mstate->__pyx_kp_b_iso88591_1_Kq_1, tuple_dedup_map);
if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[3]))
goto bad;
8105 const __Pyx_PyCode_New_function_description descr = {13, 0, 0, 13, (
unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 127};
8106 PyObject*
const varnames[] = {__pyx_mstate->__pyx_n_u_jobvl, __pyx_mstate->__pyx_n_u_jobvr, __pyx_mstate->__pyx_n_u_n, __pyx_mstate->__pyx_n_u_leig, __pyx_mstate->__pyx_n_u_lda, __pyx_mstate->__pyx_n_u_eigenvalues_r, __pyx_mstate->__pyx_n_u_eigenvalues_i, __pyx_mstate->__pyx_n_u_leftEigenvectors, __pyx_mstate->__pyx_n_u_ldvl, __pyx_mstate->__pyx_n_u_rightEigenvectors, __pyx_mstate->__pyx_n_u_ldvr, __pyx_mstate->__pyx_n_u_work, __pyx_mstate->__pyx_n_u_lwork};
8107 __pyx_mstate_global->__pyx_codeobj_tab[4] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_proteus_clapack_pyx, __pyx_mstate->__pyx_n_u_denseCalculateEigenvalues, __pyx_mstate->__pyx_kp_b_iso88591_X_1A, tuple_dedup_map);
if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[4]))
goto bad;
8109 Py_DECREF(tuple_dedup_map);
8112 Py_DECREF(tuple_dedup_map);
8117static int __Pyx_InitGlobals(
void) {
8118 int __pyx_lineno = 0;
8119 const char *__pyx_filename = NULL;
8120 int __pyx_clineno = 0;
8122 if (likely(__Pyx_init_co_variables() == 0 && __Pyx_init_tpflags_variables() == 0));
else
8124 if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1, __pyx_L1_error)
8133 #ifdef NPY_FEATURE_VERSION
8134 #ifndef NO_IMPORT_ARRAY
8135 if (unlikely(_import_array() == -1)) {
8136 PyErr_SetString(PyExc_ImportError,
"numpy.core.multiarray failed to import "
8137 "(auto-generated because you didn't call 'numpy.import_array()' after cimporting numpy; "
8138 "use '<void>numpy._import_array' to disable if you are certain you don't need it).");
8143 if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1, __pyx_L1_error)
8146 if (likely(__pyx_CommonTypesMetaclass_init(__pyx_m) == 0));
else
8148 if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1, __pyx_L1_error)
8151 #if CYTHON_COMPILING_IN_LIMITED_API
8153 PyObject *typesModule=NULL;
8154 typesModule = PyImport_ImportModule(
"types");
8156 __pyx_mstate_global->__Pyx_CachedMethodType = PyObject_GetAttrString(typesModule,
"MethodType");
8157 Py_DECREF(typesModule);
8162 if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1, __pyx_L1_error)
8170static int __Pyx_InitAfterSharedUtility(
void) {
8171 int __pyx_lineno = 0;
8172 const char *__pyx_filename = NULL;
8173 int __pyx_clineno = 0;
8175 if (likely(__pyx_CyFunction_init(__pyx_m) == 0));
else
8177 if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1, __pyx_L1_error)
8188#pragma warning( push )
8193#pragma warning( disable : 4127 )
8203static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(
const char *modname) {
8204 PyObject *m = NULL, *p = NULL;
8206 m = PyImport_ImportModule(modname);
8208 p = PyObject_GetAttrString(m,
"RefNannyAPI");
8210 r = PyLong_AsVoidPtr(p);
8214 return (__Pyx_RefNannyAPIStruct *)
r;
8219#if CYTHON_USE_EXC_INFO_STACK && CYTHON_FAST_THREAD_STATE
8220static _PyErr_StackItem *
8221__Pyx_PyErr_GetTopmostException(PyThreadState *tstate)
8223 _PyErr_StackItem *exc_info = tstate->exc_info;
8224 while ((exc_info->exc_value == NULL || exc_info->exc_value == Py_None) &&
8225 exc_info->previous_item != NULL)
8227 exc_info = exc_info->previous_item;
8234#if CYTHON_FAST_THREAD_STATE
8235static CYTHON_INLINE
void __Pyx__ExceptionSave(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) {
8236 #if CYTHON_USE_EXC_INFO_STACK && PY_VERSION_HEX >= 0x030B00a4
8237 _PyErr_StackItem *exc_info = __Pyx_PyErr_GetTopmostException(tstate);
8238 PyObject *exc_value = exc_info->exc_value;
8239 if (exc_value == NULL || exc_value == Py_None) {
8246 *type = (PyObject*) Py_TYPE(exc_value);
8248 *tb = PyException_GetTraceback(exc_value);
8250 #elif CYTHON_USE_EXC_INFO_STACK
8251 _PyErr_StackItem *exc_info = __Pyx_PyErr_GetTopmostException(tstate);
8252 *type = exc_info->exc_type;
8253 *value = exc_info->exc_value;
8254 *tb = exc_info->exc_traceback;
8259 *type = tstate->exc_type;
8260 *value = tstate->exc_value;
8261 *tb = tstate->exc_traceback;
8267static CYTHON_INLINE
void __Pyx__ExceptionReset(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb) {
8268 #if CYTHON_USE_EXC_INFO_STACK && PY_VERSION_HEX >= 0x030B00a4
8269 _PyErr_StackItem *exc_info = tstate->exc_info;
8270 PyObject *tmp_value = exc_info->exc_value;
8271 exc_info->exc_value = value;
8272 Py_XDECREF(tmp_value);
8276 PyObject *tmp_type, *tmp_value, *tmp_tb;
8277 #if CYTHON_USE_EXC_INFO_STACK
8278 _PyErr_StackItem *exc_info = tstate->exc_info;
8279 tmp_type = exc_info->exc_type;
8280 tmp_value = exc_info->exc_value;
8281 tmp_tb = exc_info->exc_traceback;
8282 exc_info->exc_type = type;
8283 exc_info->exc_value = value;
8284 exc_info->exc_traceback = tb;
8286 tmp_type = tstate->exc_type;
8287 tmp_value = tstate->exc_value;
8288 tmp_tb = tstate->exc_traceback;
8289 tstate->exc_type = type;
8290 tstate->exc_value = value;
8291 tstate->exc_traceback = tb;
8293 Py_XDECREF(tmp_type);
8294 Py_XDECREF(tmp_value);
8301#if CYTHON_COMPILING_IN_CPYTHON
8302static int __Pyx_InBases(PyTypeObject *a, PyTypeObject *b) {
8304 a = __Pyx_PyType_GetSlot(a, tp_base, PyTypeObject*);
8308 return b == &PyBaseObject_Type;
8310static CYTHON_INLINE
int __Pyx_IsSubtype(PyTypeObject *a, PyTypeObject *b) {
8312 if (a == b)
return 1;
8316 n = PyTuple_GET_SIZE(mro);
8317 for (i = 0; i <
n; i++) {
8318 if (PyTuple_GET_ITEM(mro, i) == (PyObject *)b)
8323 return __Pyx_InBases(a, b);
8325static CYTHON_INLINE
int __Pyx_IsAnySubtype2(PyTypeObject *cls, PyTypeObject *a, PyTypeObject *b) {
8327 if (cls == a || cls == b)
return 1;
8331 n = PyTuple_GET_SIZE(mro);
8332 for (i = 0; i <
n; i++) {
8333 PyObject *base = PyTuple_GET_ITEM(mro, i);
8334 if (base == (PyObject *)a || base == (PyObject *)b)
8339 return __Pyx_InBases(cls, a) || __Pyx_InBases(cls, b);
8344#if CYTHON_FAST_THREAD_STATE
8345static CYTHON_INLINE
void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb) {
8346#if PY_VERSION_HEX >= 0x030C00A6
8347 PyObject *tmp_value;
8348 assert(type == NULL || (value != NULL && type == (PyObject*) Py_TYPE(value)));
8350 #if CYTHON_COMPILING_IN_CPYTHON
8351 if (unlikely(((PyBaseExceptionObject*) value)->traceback != tb))
8353 PyException_SetTraceback(value, tb);
8355 tmp_value = tstate->current_exception;
8356 tstate->current_exception = value;
8357 Py_XDECREF(tmp_value);
8361 PyObject *tmp_type, *tmp_value, *tmp_tb;
8362 tmp_type = tstate->curexc_type;
8363 tmp_value = tstate->curexc_value;
8364 tmp_tb = tstate->curexc_traceback;
8365 tstate->curexc_type = type;
8366 tstate->curexc_value = value;
8367 tstate->curexc_traceback = tb;
8368 Py_XDECREF(tmp_type);
8369 Py_XDECREF(tmp_value);
8373static CYTHON_INLINE
void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) {
8374#if PY_VERSION_HEX >= 0x030C00A6
8375 PyObject* exc_value;
8376 exc_value = tstate->current_exception;
8377 tstate->current_exception = 0;
8382 *type = (PyObject*) Py_TYPE(exc_value);
8384 #if CYTHON_COMPILING_IN_CPYTHON
8385 *tb = ((PyBaseExceptionObject*) exc_value)->traceback;
8388 *tb = PyException_GetTraceback(exc_value);
8392 *type = tstate->curexc_type;
8393 *value = tstate->curexc_value;
8394 *tb = tstate->curexc_traceback;
8395 tstate->curexc_type = 0;
8396 tstate->curexc_value = 0;
8397 tstate->curexc_traceback = 0;
8403#if CYTHON_COMPILING_IN_CPYTHON
8404static CYTHON_INLINE
int __Pyx_inner_PyErr_GivenExceptionMatches2(PyObject *err, PyObject* exc_type1, PyObject *exc_type2) {
8406 return __Pyx_IsAnySubtype2((PyTypeObject*)err, (PyTypeObject*)exc_type1, (PyTypeObject*)exc_type2);
8408 return __Pyx_IsSubtype((PyTypeObject*)err, (PyTypeObject*)exc_type2);
8411static int __Pyx_PyErr_GivenExceptionMatchesTuple(PyObject *exc_type, PyObject *tuple) {
8413 assert(PyExceptionClass_Check(exc_type));
8414 n = PyTuple_GET_SIZE(tuple);
8415 for (i=0; i<
n; i++) {
8416 if (exc_type == PyTuple_GET_ITEM(tuple, i))
return 1;
8418 for (i=0; i<
n; i++) {
8419 PyObject *t = PyTuple_GET_ITEM(tuple, i);
8420 if (likely(PyExceptionClass_Check(t))) {
8421 if (__Pyx_inner_PyErr_GivenExceptionMatches2(exc_type, NULL, t))
return 1;
8427static CYTHON_INLINE
int __Pyx_PyErr_GivenExceptionMatches(PyObject *err, PyObject* exc_type) {
8428 if (likely(err == exc_type))
return 1;
8429 if (likely(PyExceptionClass_Check(err))) {
8430 if (likely(PyExceptionClass_Check(exc_type))) {
8431 return __Pyx_inner_PyErr_GivenExceptionMatches2(err, NULL, exc_type);
8432 }
else if (likely(PyTuple_Check(exc_type))) {
8433 return __Pyx_PyErr_GivenExceptionMatchesTuple(err, exc_type);
8437 return PyErr_GivenExceptionMatches(err, exc_type);
8439static CYTHON_INLINE
int __Pyx_PyErr_GivenExceptionMatches2(PyObject *err, PyObject *exc_type1, PyObject *exc_type2) {
8440 assert(PyExceptionClass_Check(exc_type1));
8441 assert(PyExceptionClass_Check(exc_type2));
8442 if (likely(err == exc_type1 || err == exc_type2))
return 1;
8443 if (likely(PyExceptionClass_Check(err))) {
8444 return __Pyx_inner_PyErr_GivenExceptionMatches2(err, exc_type1, exc_type2);
8446 return (PyErr_GivenExceptionMatches(err, exc_type1) || PyErr_GivenExceptionMatches(err, exc_type2));
8451#if CYTHON_FAST_THREAD_STATE
8452static int __Pyx_PyErr_ExceptionMatchesTuple(PyObject *exc_type, PyObject *tuple) {
8454 n = PyTuple_GET_SIZE(tuple);
8455 for (i=0; i<
n; i++) {
8456 if (exc_type == PyTuple_GET_ITEM(tuple, i))
return 1;
8458 for (i=0; i<
n; i++) {
8459 if (__Pyx_PyErr_GivenExceptionMatches(exc_type, PyTuple_GET_ITEM(tuple, i)))
return 1;
8463static CYTHON_INLINE
int __Pyx_PyErr_ExceptionMatchesInState(PyThreadState* tstate, PyObject* err) {
8466#if PY_VERSION_HEX >= 0x030C00A6
8467 PyObject *current_exception = tstate->current_exception;
8468 if (unlikely(!current_exception))
return 0;
8469 exc_type = (PyObject*) Py_TYPE(current_exception);
8470 if (exc_type == err)
return 1;
8472 exc_type = tstate->curexc_type;
8473 if (exc_type == err)
return 1;
8474 if (unlikely(!exc_type))
return 0;
8476 #if CYTHON_AVOID_BORROWED_REFS
8477 Py_INCREF(exc_type);
8479 if (unlikely(PyTuple_Check(err))) {
8480 result = __Pyx_PyErr_ExceptionMatchesTuple(exc_type, err);
8482 result = __Pyx_PyErr_GivenExceptionMatches(exc_type, err);
8484 #if CYTHON_AVOID_BORROWED_REFS
8485 Py_DECREF(exc_type);
8492#if CYTHON_FAST_THREAD_STATE
8493static int __Pyx__GetException(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb)
8495static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb)
8498 PyObject *local_type = NULL, *local_value, *local_tb = NULL;
8499#if CYTHON_FAST_THREAD_STATE
8500 PyObject *tmp_type, *tmp_value, *tmp_tb;
8501 #if PY_VERSION_HEX >= 0x030C0000
8502 local_value = tstate->current_exception;
8503 tstate->current_exception = 0;
8505 local_type = tstate->curexc_type;
8506 local_value = tstate->curexc_value;
8507 local_tb = tstate->curexc_traceback;
8508 tstate->curexc_type = 0;
8509 tstate->curexc_value = 0;
8510 tstate->curexc_traceback = 0;
8512#elif __PYX_LIMITED_VERSION_HEX >= 0x030C0000
8513 local_value = PyErr_GetRaisedException();
8515 PyErr_Fetch(&local_type, &local_value, &local_tb);
8517#if __PYX_LIMITED_VERSION_HEX >= 0x030C0000
8518 if (likely(local_value)) {
8519 local_type = (PyObject*) Py_TYPE(local_value);
8520 Py_INCREF(local_type);
8521 local_tb = PyException_GetTraceback(local_value);
8524 PyErr_NormalizeException(&local_type, &local_value, &local_tb);
8525#if CYTHON_FAST_THREAD_STATE
8526 if (unlikely(tstate->curexc_type))
8528 if (unlikely(PyErr_Occurred()))
8532 if (unlikely(PyException_SetTraceback(local_value, local_tb) < 0))
8536 Py_XINCREF(local_tb);
8537 Py_XINCREF(local_type);
8538 Py_XINCREF(local_value);
8540 *value = local_value;
8542#if CYTHON_FAST_THREAD_STATE
8543 #if CYTHON_USE_EXC_INFO_STACK
8545 _PyErr_StackItem *exc_info = tstate->exc_info;
8546 #if PY_VERSION_HEX >= 0x030B00a4
8547 tmp_value = exc_info->exc_value;
8548 exc_info->exc_value = local_value;
8551 Py_XDECREF(local_type);
8552 Py_XDECREF(local_tb);
8554 tmp_type = exc_info->exc_type;
8555 tmp_value = exc_info->exc_value;
8556 tmp_tb = exc_info->exc_traceback;
8557 exc_info->exc_type = local_type;
8558 exc_info->exc_value = local_value;
8559 exc_info->exc_traceback = local_tb;
8563 tmp_type = tstate->exc_type;
8564 tmp_value = tstate->exc_value;
8565 tmp_tb = tstate->exc_traceback;
8566 tstate->exc_type = local_type;
8567 tstate->exc_value = local_value;
8568 tstate->exc_traceback = local_tb;
8570 Py_XDECREF(tmp_type);
8571 Py_XDECREF(tmp_value);
8573#elif __PYX_LIMITED_VERSION_HEX >= 0x030b0000
8574 PyErr_SetHandledException(local_value);
8575 Py_XDECREF(local_value);
8576 Py_XDECREF(local_type);
8577 Py_XDECREF(local_tb);
8579 PyErr_SetExcInfo(local_type, local_value, local_tb);
8582#if __PYX_LIMITED_VERSION_HEX < 0x030C0000
8587 Py_XDECREF(local_type);
8588 Py_XDECREF(local_value);
8589 Py_XDECREF(local_tb);
8595#if CYTHON_COMPILING_IN_CPYTHON
8596static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw) {
8598 ternaryfunc call = Py_TYPE(func)->tp_call;
8599 if (unlikely(!call))
8600 return PyObject_Call(func, arg, kw);
8601 if (unlikely(Py_EnterRecursiveCall(
" while calling a Python object")))
8603 result = (*call)(func, arg, kw);
8604 Py_LeaveRecursiveCall();
8605 if (unlikely(!result) && unlikely(!PyErr_Occurred())) {
8608 "NULL result without error in PyObject_Call");
8615#if CYTHON_COMPILING_IN_CPYTHON
8616static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg) {
8617 PyObject *self, *result;
8619 cfunc = __Pyx_CyOrPyCFunction_GET_FUNCTION(func);
8620 self = __Pyx_CyOrPyCFunction_GET_SELF(func);
8621 if (unlikely(Py_EnterRecursiveCall(
" while calling a Python object")))
8623 result = cfunc(self, arg);
8624 Py_LeaveRecursiveCall();
8625 if (unlikely(!result) && unlikely(!PyErr_Occurred())) {
8628 "NULL result without error in PyObject_Call");
8635#if CYTHON_COMPILING_IN_LIMITED_API
8636static PyObject* __Pyx_PyObject_FastCall_fallback(PyObject *func, PyObject *
const*args,
size_t nargs, PyObject *kwargs) {
8637 PyObject *argstuple;
8638 PyObject *result = 0;
8640 argstuple = PyTuple_New((Py_ssize_t)nargs);
8641 if (unlikely(!argstuple))
return NULL;
8642 for (i = 0; i < nargs; i++) {
8644 if (__Pyx_PyTuple_SET_ITEM(argstuple, (Py_ssize_t)i, args[i]) != (0))
goto bad;
8646 result = __Pyx_PyObject_Call(func, argstuple, kwargs);
8648 Py_DECREF(argstuple);
8652#if CYTHON_VECTORCALL && !(CYTHON_COMPILING_IN_LIMITED_API || CYTHON_COMPILING_IN_PYPY)
8653 #if CYTHON_COMPILING_IN_CPYTHON
8654static CYTHON_INLINE vectorcallfunc __Pyx_PyVectorcall_Function(PyObject *callable) {
8655 PyTypeObject *tp = Py_TYPE(callable);
8656 #if defined(__Pyx_CyFunction_USED)
8657 if (__Pyx_CyFunction_CheckExact(callable)) {
8658 return __Pyx_CyFunction_func_vectorcall(callable);
8661 if (!PyType_HasFeature(tp, Py_TPFLAGS_HAVE_VECTORCALL)) {
8664 assert(PyCallable_Check(callable));
8665 Py_ssize_t offset = tp->tp_vectorcall_offset;
8668 memcpy(&ptr, (
char *) callable + offset,
sizeof(ptr));
8672 #define __Pyx_PyVectorcall_Function(callable) PyVectorcall_Function(callable)
8675static CYTHON_INLINE PyObject* __Pyx_PyObject_FastCallDict(PyObject *func, PyObject *
const *args,
size_t nargsf, PyObject *kwargs) {
8676 Py_ssize_t nargs = __Pyx_PyVectorcall_NARGS(nargsf);
8677#if CYTHON_COMPILING_IN_CPYTHON
8678 if (nargs == 0 && kwargs == NULL) {
8679 if (__Pyx_CyOrPyCFunction_Check(func) && likely( __Pyx_CyOrPyCFunction_GET_FLAGS(func) & METH_NOARGS))
8680 return __Pyx_PyObject_CallMethO(func, NULL);
8682 else if (nargs == 1 && kwargs == NULL) {
8683 if (__Pyx_CyOrPyCFunction_Check(func) && likely( __Pyx_CyOrPyCFunction_GET_FLAGS(func) & METH_O))
8684 return __Pyx_PyObject_CallMethO(func, args[0]);
8687 if (kwargs == NULL) {
8688 #if CYTHON_VECTORCALL
8689 #if CYTHON_COMPILING_IN_LIMITED_API || CYTHON_COMPILING_IN_PYPY
8690 return PyObject_Vectorcall(func, args, nargsf, NULL);
8692 vectorcallfunc
f = __Pyx_PyVectorcall_Function(func);
8694 return f(func, args, nargsf, NULL);
8700 return __Pyx_PyObject_Call(func, __pyx_mstate_global->__pyx_empty_tuple, kwargs);
8702 #if CYTHON_COMPILING_IN_LIMITED_API
8703 return __Pyx_PyObject_FastCall_fallback(func, args, (
size_t)nargs, kwargs);
8704 #elif CYTHON_COMPILING_IN_PYPY
8705 return PyObject_VectorcallDict(func, args, (
size_t) nargs, kwargs);
8707 return PyObject_VectorcallDict(func, args, nargsf, kwargs);
8712static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause) {
8713 PyObject* owned_instance = NULL;
8714 if (tb == Py_None) {
8716 }
else if (tb && !PyTraceBack_Check(tb)) {
8717 PyErr_SetString(PyExc_TypeError,
8718 "raise: arg 3 must be a traceback or None");
8721 if (value == Py_None)
8723 if (PyExceptionInstance_Check(type)) {
8725 PyErr_SetString(PyExc_TypeError,
8726 "instance exception may not have a separate value");
8730 type = (PyObject*) Py_TYPE(value);
8731 }
else if (PyExceptionClass_Check(type)) {
8732 PyObject *instance_class = NULL;
8733 if (value && PyExceptionInstance_Check(value)) {
8734 instance_class = (PyObject*) Py_TYPE(value);
8735 if (instance_class != type) {
8736 int is_subclass = PyObject_IsSubclass(instance_class, type);
8738 instance_class = NULL;
8739 }
else if (unlikely(is_subclass == -1)) {
8742 type = instance_class;
8746 if (!instance_class) {
8749 args = PyTuple_New(0);
8750 else if (PyTuple_Check(value)) {
8754 args = PyTuple_Pack(1, value);
8757 owned_instance = PyObject_Call(type, args, NULL);
8759 if (!owned_instance)
8761 value = owned_instance;
8762 if (!PyExceptionInstance_Check(value)) {
8763 PyErr_Format(PyExc_TypeError,
8764 "calling %R should have returned an instance of "
8765 "BaseException, not %R",
8766 type, Py_TYPE(value));
8771 PyErr_SetString(PyExc_TypeError,
8772 "raise: exception class must be a subclass of BaseException");
8776 PyObject *fixed_cause;
8777 if (cause == Py_None) {
8779 }
else if (PyExceptionClass_Check(cause)) {
8780 fixed_cause = PyObject_CallObject(cause, NULL);
8781 if (fixed_cause == NULL)
8783 }
else if (PyExceptionInstance_Check(cause)) {
8784 fixed_cause = cause;
8785 Py_INCREF(fixed_cause);
8787 PyErr_SetString(PyExc_TypeError,
8788 "exception causes must derive from "
8792 PyException_SetCause(value, fixed_cause);
8794 PyErr_SetObject(type, value);
8796#if PY_VERSION_HEX >= 0x030C00A6
8797 PyException_SetTraceback(value, tb);
8798#elif CYTHON_FAST_THREAD_STATE
8799 PyThreadState *tstate = __Pyx_PyThreadState_Current;
8800 PyObject* tmp_tb = tstate->curexc_traceback;
8803 tstate->curexc_traceback = tb;
8807 PyObject *tmp_type, *tmp_value, *tmp_tb;
8808 PyErr_Fetch(&tmp_type, &tmp_value, &tmp_tb);
8810 PyErr_Restore(tmp_type, tmp_value, tb);
8815 Py_XDECREF(owned_instance);
8820#if CYTHON_COMPILING_IN_CPYTHON
8821static CYTHON_INLINE
void __Pyx_copy_object_array(PyObject *
const *CYTHON_RESTRICT src, PyObject** CYTHON_RESTRICT dest, Py_ssize_t length) {
8824 for (i = 0; i < length; i++) {
8825 v = dest[i] = src[i];
8832#if !(PY_VERSION_HEX >= 0x030F0000 && !CYTHON_COMPILING_IN_LIMITED_API)
8833CYTHON_UNUSED
static PyObject *
8834__Pyx_PyTuple_FromArray(PyObject *
const *src, Py_ssize_t
n) {
8836 return __Pyx_NewRef(__pyx_mstate_global->__pyx_empty_tuple);
8838 PyObject *res = PyTuple_New(
n);
8839 if (unlikely(res == NULL))
return NULL;
8840 #if CYTHON_COMPILING_IN_CPYTHON
8841 __Pyx_copy_object_array(src, ((PyTupleObject*)res)->ob_item,
n);
8844 for (i = 0; i <
n; i++) {
8846 if (unlikely(__Pyx_PyTuple_SET_ITEM(res, i, src[i]) < (0))) {
8857#ifndef __Pyx_DEFINED_PyObject_CompareStrStrBoolEq
8858#define __Pyx_DEFINED_PyObject_CompareStrStrBoolEq
8859static CYTHON_INLINE
int __Pyx_PyObject_CompareStrStrBoolEq(PyObject* s1, PyObject* s2) {
8860 #if __PYX_LIMITED_VERSION_HEX >= 0x030e0000
8861 int result = PyUnicode_Equal(s1, s2);
8862 #if !CYTHON_COMPILING_IN_CPYTHON
8863 if (unlikely(result == -1))
return -1;
8865 if (result == 0)
goto __pyx_return_false;
else goto __pyx_return_true;
8867 int result = PyUnicode_Compare(s1, s2);
8868 if (unlikely((result == -1) && PyErr_Occurred()))
return -1;
8869 if (result == 0)
goto __pyx_return_true;
else goto __pyx_return_false;
8877static CYTHON_INLINE
int __Pyx_PyObject_CompareBoolEq_str_str(PyObject *op1, PyObject *op2,
int pyop) {
8878 CYTHON_UNUSED_VAR(pyop);
8879 if (unlikely(op1 == Py_None)) {
8880 if (op2 == Py_None)
goto __pyx_return_true;
else goto __pyx_return_false;
8882 if (unlikely(op2 == Py_None)) {
8883 if (op1 == Py_None)
goto __pyx_return_true;
else goto __pyx_return_false;
8886 if (likely(op1 != Py_None)) {
8887 if (op1 == op2)
goto __pyx_return_true;
8888 if (likely(op2 != Py_None)) {
8889 return __Pyx_PyObject_CompareStrStrBoolEq(op1, op2);
8894 if ((0))
goto __pyx_richcmp;
8895 if ((0))
goto __pyx_return_true;
8896 if ((0))
goto __pyx_return_false;
8898 return __Pyx_PyObject_RichCompareBool(op1, op2, Py_EQ);
8906#if CYTHON_VECTORCALL
8907static CYTHON_INLINE PyObject * __Pyx_GetKwValue_FASTCALL(PyObject *kwnames, PyObject *
const *kwvalues, PyObject *
s)
8909 Py_ssize_t i,
n = __Pyx_PyTuple_GET_SIZE(kwnames);
8910 #if !CYTHON_ASSUME_SAFE_SIZE
8911 if (unlikely(
n == -1))
return NULL;
8913 for (i = 0; i <
n; i++)
8915 PyObject *namei = __Pyx_PyTuple_GET_ITEM(kwnames, i);
8916 #if !CYTHON_ASSUME_SAFE_MACROS
8917 if (unlikely(!namei))
return NULL;
8919 if (
s == namei)
return kwvalues[i];
8921 for (i = 0; i <
n; i++)
8923 PyObject *namei = __Pyx_PyTuple_GET_ITEM(kwnames, i);
8924 #if !CYTHON_ASSUME_SAFE_MACROS
8925 if (unlikely(!namei))
return NULL;
8927 int eq = __Pyx_PyUnicode_Equals(
s, namei);
8928 if (unlikely(eq != 0)) {
8929 if (unlikely(eq < 0))
return NULL;
8935#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030d0000 || CYTHON_COMPILING_IN_LIMITED_API || CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_GRAAL
8936CYTHON_UNUSED
static PyObject *__Pyx_KwargsAsDict_FASTCALL(PyObject *kwnames, PyObject *
const *kwvalues) {
8937 Py_ssize_t i, nkwargs;
8939#if !CYTHON_ASSUME_SAFE_SIZE
8940 nkwargs = PyTuple_Size(kwnames);
8941 if (unlikely(nkwargs < 0))
return NULL;
8943 nkwargs = PyTuple_GET_SIZE(kwnames);
8945 dict = PyDict_New();
8946 if (unlikely(!dict))
8948 for (i=0; i<nkwargs; i++) {
8949#if !CYTHON_ASSUME_SAFE_MACROS
8950 PyObject *key = PyTuple_GetItem(kwnames, i);
8953 PyObject *key = PyTuple_GET_ITEM(kwnames, i);
8955 if (unlikely(PyDict_SetItem(dict, key, kwvalues[i]) < 0))
8967static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg) {
8968 PyObject *args[2] = {NULL, arg};
8969 return __Pyx_PyObject_FastCall(func, args+1, 1 | __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET);
8973static CYTHON_INLINE
int __Pyx_IgnoreGivenException(PyObject *given_exception, PyObject *ignorable_exception) {
8974 if (PyErr_GivenExceptionMatches(given_exception ? given_exception : PyErr_Occurred(), ignorable_exception)) {
8982#if CYTHON_USE_TYPE_SLOTS
8983static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name) {
8984 PyTypeObject* tp = Py_TYPE(obj);
8985 if (likely(tp->tp_getattro))
8986 return tp->tp_getattro(obj, attr_name);
8987 return PyObject_GetAttr(obj, attr_name);
8992#if CYTHON_COMPILING_IN_LIMITED_API && __PYX_LIMITED_VERSION_HEX < 0x030C0000
8993static PyObject *__Pyx_SelflessCall(PyObject *method, PyObject *args, PyObject *kwargs) {
8995 PyObject *selfless_args = PyTuple_GetSlice(args, 1, PyTuple_Size(args));
8996 if (unlikely(!selfless_args))
return NULL;
8997 result = PyObject_Call(method, selfless_args, kwargs);
8998 Py_DECREF(selfless_args);
9002static PyObject *__Pyx_SelflessCall(PyObject *method, PyObject *
const *args, Py_ssize_t nargs, PyObject *kwnames) {
9003 return PyObject_Vectorcall(method, args ? args+1 : NULL, nargs ? (
size_t) nargs-1 : 0, kwnames);
9006static PyMethodDef __Pyx_UnboundCMethod_Def = {
9007 "CythonUnboundCMethod",
9008 __PYX_REINTERPRET_FUNCION(PyCFunction, __Pyx_SelflessCall),
9009#if CYTHON_COMPILING_IN_LIMITED_API && __PYX_LIMITED_VERSION_HEX < 0x030C0000
9010 METH_VARARGS | METH_KEYWORDS,
9012 METH_FASTCALL | METH_KEYWORDS,
9016static int __Pyx_TryUnpackUnboundCMethod(__Pyx_CachedCFunction* target) {
9017 PyObject *method, *result=NULL;
9018 method = __Pyx_PyObject_GetAttrStr(target->type, *target->method_name);
9019 if (unlikely(!method))
9022#if CYTHON_COMPILING_IN_CPYTHON
9023 if (likely(__Pyx_TypeCheck(method, &PyMethodDescr_Type)))
9025 PyMethodDescrObject *descr = (PyMethodDescrObject*) method;
9026 target->func = descr->d_method->ml_meth;
9027 target->flag = descr->d_method->ml_flags & ~(METH_CLASS | METH_STATIC | METH_COEXIST);
9030#if CYTHON_COMPILING_IN_PYPY
9032 if (PyCFunction_Check(method))
9037#if CYTHON_COMPILING_IN_LIMITED_API || CYTHON_COMPILING_IN_PYPY
9038 self = PyObject_GetAttrString(method,
"__self__");
9039 if (!self && !__Pyx_IgnoreException(PyExc_AttributeError)) {
9043 self = PyCFunction_GET_SELF(method);
9045 self_found = (self && self != Py_None);
9046#if CYTHON_COMPILING_IN_LIMITED_API || CYTHON_COMPILING_IN_PYPY
9050 PyObject *unbound_method = PyCFunction_New(&__Pyx_UnboundCMethod_Def, method);
9051 if (unlikely(!unbound_method))
return -1;
9053 result = unbound_method;
9056#if !CYTHON_COMPILING_IN_CPYTHON_FREETHREADING
9057 if (unlikely(target->method)) {
9061 target->method = result;
9066#if CYTHON_COMPILING_IN_CPYTHON
9067static CYTHON_INLINE PyObject* __Pyx_CallUnboundCMethod0(__Pyx_CachedCFunction* cfunc, PyObject* self) {
9068 int was_initialized = __Pyx_CachedCFunction_GetAndSetInitializing(cfunc);
9069 if (likely(was_initialized == 2 && cfunc->func)) {
9070 if (likely(cfunc->flag == METH_NOARGS))
9071 return __Pyx_CallCFunction(cfunc, self, NULL);
9072 if (likely(cfunc->flag == METH_FASTCALL))
9073 return __Pyx_CallCFunctionFast(cfunc, self, NULL, 0);
9074 if (cfunc->flag == (METH_FASTCALL | METH_KEYWORDS))
9075 return __Pyx_CallCFunctionFastWithKeywords(cfunc, self, NULL, 0, NULL);
9076 if (likely(cfunc->flag == (METH_VARARGS | METH_KEYWORDS)))
9077 return __Pyx_CallCFunctionWithKeywords(cfunc, self, __pyx_mstate_global->__pyx_empty_tuple, NULL);
9078 if (cfunc->flag == METH_VARARGS)
9079 return __Pyx_CallCFunction(cfunc, self, __pyx_mstate_global->__pyx_empty_tuple);
9080 return __Pyx__CallUnboundCMethod0(cfunc, self);
9082#if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING
9083 else if (unlikely(was_initialized == 1)) {
9084 __Pyx_CachedCFunction tmp_cfunc = {
9089 tmp_cfunc.type = cfunc->type;
9090 tmp_cfunc.method_name = cfunc->method_name;
9091 return __Pyx__CallUnboundCMethod0(&tmp_cfunc, self);
9094 PyObject *result = __Pyx__CallUnboundCMethod0(cfunc, self);
9095 __Pyx_CachedCFunction_SetFinishedInitializing(cfunc);
9099static PyObject* __Pyx__CallUnboundCMethod0(__Pyx_CachedCFunction* cfunc, PyObject* self) {
9101 if (unlikely(!cfunc->method) && unlikely(__Pyx_TryUnpackUnboundCMethod(cfunc) < 0))
return NULL;
9102 result = __Pyx_PyObject_CallOneArg(cfunc->method, self);
9107static CYTHON_INLINE PyObject* __Pyx_PyDict_Items(PyObject* d) {
9108 return __Pyx_CallUnboundCMethod0(&__pyx_mstate_global->__pyx_umethod_PyDict_Type_items, d);
9112static CYTHON_INLINE PyObject* __Pyx_PyDict_Values(PyObject* d) {
9113 return __Pyx_CallUnboundCMethod0(&__pyx_mstate_global->__pyx_umethod_PyDict_Type_values, d);
9117#if CYTHON_AVOID_BORROWED_REFS
9118static int __Pyx_PyDict_NextRef(PyObject *p, PyObject **ppos, PyObject **pkey, PyObject **pvalue) {
9119 PyObject *next = NULL;
9122 PyObject *dictview = pkey ? __Pyx_PyDict_Items(p) : __Pyx_PyDict_Values(p);
9123 if (unlikely(!dictview))
goto bad;
9124 *ppos = PyObject_GetIter(dictview);
9125 Py_DECREF(dictview);
9127 *ppos = PyObject_GetIter(p);
9129 if (unlikely(!*ppos))
goto bad;
9131 next = PyIter_Next(*ppos);
9133 if (PyErr_Occurred())
goto bad;
9136 if (pkey && pvalue) {
9137 *pkey = __Pyx_PySequence_ITEM(next, 0);
9138 if (unlikely(*pkey))
goto bad;
9139 *pvalue = __Pyx_PySequence_ITEM(next, 1);
9140 if (unlikely(*pvalue))
goto bad;
9151#if !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX >= 0x030d0000
9152 PyErr_FormatUnraisable(
"Exception ignored in __Pyx_PyDict_NextRef");
9154 PyErr_WriteUnraisable(__pyx_mstate_global->__pyx_n_u_Pyx_PyDict_NextRef);
9156 if (pkey) *pkey = NULL;
9157 if (pvalue) *pvalue = NULL;
9161static int __Pyx_PyDict_NextRef(PyObject *p, Py_ssize_t *ppos, PyObject **pkey, PyObject **pvalue) {
9162 int result = PyDict_Next(p, ppos, pkey, pvalue);
9163 if (likely(result == 1)) {
9164 if (pkey) Py_INCREF(*pkey);
9165 if (pvalue) Py_INCREF(*pvalue);
9172static void __Pyx_RaiseDoubleKeywordsError(
9173 const char* func_name,
9176 PyErr_Format(PyExc_TypeError,
9177 "%s() got multiple values for keyword argument '%U'", func_name, kw_name);
9181#if CYTHON_COMPILING_IN_CPYTHON
9182static CYTHON_INLINE PyObject *__Pyx_CallUnboundCMethod2(__Pyx_CachedCFunction *cfunc, PyObject *self, PyObject *arg1, PyObject *arg2) {
9183 int was_initialized = __Pyx_CachedCFunction_GetAndSetInitializing(cfunc);
9184 if (likely(was_initialized == 2 && cfunc->func)) {
9185 PyObject *args[2] = {arg1, arg2};
9186 if (cfunc->flag == METH_FASTCALL) {
9187 return __Pyx_CallCFunctionFast(cfunc, self, args, 2);
9189 if (cfunc->flag == (METH_FASTCALL | METH_KEYWORDS))
9190 return __Pyx_CallCFunctionFastWithKeywords(cfunc, self, args, 2, NULL);
9192#if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING
9193 else if (unlikely(was_initialized == 1)) {
9194 __Pyx_CachedCFunction tmp_cfunc = {
9199 tmp_cfunc.type = cfunc->type;
9200 tmp_cfunc.method_name = cfunc->method_name;
9201 return __Pyx__CallUnboundCMethod2(&tmp_cfunc, self, arg1, arg2);
9204 PyObject *result = __Pyx__CallUnboundCMethod2(cfunc, self, arg1, arg2);
9205 __Pyx_CachedCFunction_SetFinishedInitializing(cfunc);
9209static PyObject* __Pyx__CallUnboundCMethod2(__Pyx_CachedCFunction* cfunc, PyObject* self, PyObject* arg1, PyObject* arg2){
9210 if (unlikely(!cfunc->func && !cfunc->method) && unlikely(__Pyx_TryUnpackUnboundCMethod(cfunc) < 0))
return NULL;
9211#if CYTHON_COMPILING_IN_CPYTHON
9212 if (cfunc->func && (cfunc->flag & METH_VARARGS)) {
9213 PyObject *result = NULL;
9214 PyObject *args = PyTuple_New(2);
9215 if (unlikely(!args))
return NULL;
9217 PyTuple_SET_ITEM(args, 0, arg1);
9219 PyTuple_SET_ITEM(args, 1, arg2);
9220 if (cfunc->flag & METH_KEYWORDS)
9221 result = __Pyx_CallCFunctionWithKeywords(cfunc, self, args, NULL);
9223 result = __Pyx_CallCFunction(cfunc, self, args);
9229 PyObject *args[4] = {NULL, self, arg1, arg2};
9230 return __Pyx_PyObject_FastCall(cfunc->method, args+1, 3 | __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET);
9235static int __Pyx_ValidateDuplicatePosArgs(
9237 PyObject **
const argnames[],
9238 PyObject **
const *first_kw_arg,
9239 const char* function_name)
9241 PyObject **
const *name = argnames;
9242 while (name != first_kw_arg) {
9243 PyObject *key = **name;
9244 int found = PyDict_Contains(kwds, key);
9245 if (unlikely(found)) {
9246 if (found == 1) __Pyx_RaiseDoubleKeywordsError(function_name, key);
9255#if CYTHON_USE_UNICODE_INTERNALS
9256static CYTHON_INLINE
int __Pyx_UnicodeKeywordsEqual(PyObject *s1, PyObject *s2) {
9258 Py_ssize_t len = PyUnicode_GET_LENGTH(s1);
9259 if (len != PyUnicode_GET_LENGTH(s2))
return 0;
9260 kind = PyUnicode_KIND(s1);
9261 if (kind != PyUnicode_KIND(s2))
return 0;
9262 const void *data1 = PyUnicode_DATA(s1);
9263 const void *data2 = PyUnicode_DATA(s2);
9264 return (memcmp(data1, data2, (
size_t) len * (
size_t) kind) == 0);
9267static int __Pyx_MatchKeywordArg_str(
9269 PyObject **
const argnames[],
9270 PyObject **
const *first_kw_arg,
9271 size_t *index_found,
9272 const char *function_name)
9274 PyObject **
const *name;
9275 #if CYTHON_USE_UNICODE_INTERNALS
9276 Py_hash_t key_hash = ((PyASCIIObject*)key)->hash;
9277 if (unlikely(key_hash == -1)) {
9278 key_hash = PyObject_Hash(key);
9279 if (unlikely(key_hash == -1))
9283 name = first_kw_arg;
9285 PyObject *name_str = **name;
9286 #if CYTHON_USE_UNICODE_INTERNALS
9287 if (key_hash == ((PyASCIIObject*)name_str)->hash && __Pyx_UnicodeKeywordsEqual(name_str, key)) {
9288 *index_found = (size_t) (name - argnames);
9292 #if CYTHON_ASSUME_SAFE_SIZE
9293 if (PyUnicode_GET_LENGTH(name_str) == PyUnicode_GET_LENGTH(key))
9296 int cmp = PyUnicode_Compare(name_str, key);
9297 if (cmp < 0 && unlikely(PyErr_Occurred()))
goto bad;
9299 *index_found = (size_t) (name - argnames);
9307 while (name != first_kw_arg) {
9308 PyObject *name_str = **name;
9309 #if CYTHON_USE_UNICODE_INTERNALS
9310 if (unlikely(key_hash == ((PyASCIIObject*)name_str)->hash)) {
9311 if (__Pyx_UnicodeKeywordsEqual(name_str, key))
9312 goto arg_passed_twice;
9315 #if CYTHON_ASSUME_SAFE_SIZE
9316 if (PyUnicode_GET_LENGTH(name_str) == PyUnicode_GET_LENGTH(key))
9319 if (unlikely(name_str == key))
goto arg_passed_twice;
9320 int cmp = PyUnicode_Compare(name_str, key);
9321 if (cmp < 0 && unlikely(PyErr_Occurred()))
goto bad;
9322 if (cmp == 0)
goto arg_passed_twice;
9329 __Pyx_RaiseDoubleKeywordsError(function_name, key);
9334static int __Pyx_MatchKeywordArg_nostr(
9336 PyObject **
const argnames[],
9337 PyObject **
const *first_kw_arg,
9338 size_t *index_found,
9339 const char *function_name)
9341 PyObject **
const *name;
9342 if (unlikely(!PyUnicode_Check(key)))
goto invalid_keyword_type;
9343 name = first_kw_arg;
9345 int cmp = PyObject_RichCompareBool(**name, key, Py_EQ);
9347 *index_found = (size_t) (name - argnames);
9350 if (unlikely(cmp == -1))
goto bad;
9354 while (name != first_kw_arg) {
9355 int cmp = PyObject_RichCompareBool(**name, key, Py_EQ);
9356 if (unlikely(cmp != 0)) {
9357 if (cmp == 1)
goto arg_passed_twice;
9364 __Pyx_RaiseDoubleKeywordsError(function_name, key);
9366invalid_keyword_type:
9367 PyErr_Format(PyExc_TypeError,
9368 "%.200s() keywords must be strings", function_name);
9373static CYTHON_INLINE
int __Pyx_MatchKeywordArg(
9375 PyObject **
const argnames[],
9376 PyObject **
const *first_kw_arg,
9377 size_t *index_found,
9378 const char *function_name)
9380 return likely(PyUnicode_CheckExact(key)) ?
9381 __Pyx_MatchKeywordArg_str(key, argnames, first_kw_arg, index_found, function_name) :
9382 __Pyx_MatchKeywordArg_nostr(key, argnames, first_kw_arg, index_found, function_name);
9384static void __Pyx_RejectUnknownKeyword(
9386 PyObject **
const argnames[],
9387 PyObject **
const *first_kw_arg,
9388 const char *function_name)
9390 #if CYTHON_AVOID_BORROWED_REFS
9391 PyObject *pos = NULL;
9395 PyObject *key = NULL;
9396 __Pyx_BEGIN_CRITICAL_SECTION(kwds);
9397 #if CYTHON_AVOID_BORROWED_REFS
9398 while (__Pyx_PyDict_NextRef(kwds, &pos, &key, NULL))
9400 (void) __Pyx_PyDict_NextRef;
9401 while (PyDict_Next(kwds, &pos, &key, NULL))
9404 PyObject**
const *name = first_kw_arg;
9405 while (*name && (**name != key)) name++;
9407 size_t index_found = 0;
9408 int cmp = __Pyx_MatchKeywordArg(key, argnames, first_kw_arg, &index_found, function_name);
9411 PyErr_Format(PyExc_TypeError,
9412 "%s() got an unexpected keyword argument '%U'",
9413 function_name, key);
9415 #if CYTHON_AVOID_BORROWED_REFS
9421 #if CYTHON_AVOID_BORROWED_REFS
9425 __Pyx_END_CRITICAL_SECTION();
9426 #if CYTHON_AVOID_BORROWED_REFS
9429 assert(PyErr_Occurred());
9431static int __Pyx_ParseKeywordDict(
9433 PyObject **
const argnames[],
9435 Py_ssize_t num_pos_args,
9436 Py_ssize_t num_kwargs,
9437 const char* function_name,
9438 int ignore_unknown_kwargs)
9440 PyObject**
const *name;
9441 PyObject**
const *first_kw_arg = argnames + num_pos_args;
9442 Py_ssize_t extracted = 0;
9443#if !CYTHON_COMPILING_IN_PYPY || defined(PyArg_ValidateKeywordArguments)
9444 if (unlikely(!PyArg_ValidateKeywordArguments(kwds)))
return -1;
9446 name = first_kw_arg;
9447 while (*name && num_kwargs > extracted) {
9448 PyObject * key = **name;
9451 #if __PYX_LIMITED_VERSION_HEX >= 0x030d0000
9452 found = PyDict_GetItemRef(kwds, key, &value);
9454 value = PyDict_GetItemWithError(kwds, key);
9459 if (unlikely(PyErr_Occurred()))
goto bad;
9463 if (unlikely(found < 0))
goto bad;
9464 values[name-argnames] = value;
9469 if (num_kwargs > extracted) {
9470 if (ignore_unknown_kwargs) {
9471 if (unlikely(__Pyx_ValidateDuplicatePosArgs(kwds, argnames, first_kw_arg, function_name) == -1))
9474 __Pyx_RejectUnknownKeyword(kwds, argnames, first_kw_arg, function_name);
9482static int __Pyx_ParseKeywordDictToDict(
9484 PyObject **
const argnames[],
9487 Py_ssize_t num_pos_args,
9488 const char* function_name)
9490 PyObject**
const *name;
9491 PyObject**
const *first_kw_arg = argnames + num_pos_args;
9493#if !CYTHON_COMPILING_IN_PYPY || defined(PyArg_ValidateKeywordArguments)
9494 if (unlikely(!PyArg_ValidateKeywordArguments(kwds)))
return -1;
9496 if (PyDict_Update(kwds2, kwds) < 0)
goto bad;
9497 name = first_kw_arg;
9499 PyObject *key = **name;
9501#if !CYTHON_COMPILING_IN_LIMITED_API && (PY_VERSION_HEX >= 0x030d00A2 || defined(PyDict_Pop))
9502 int found = PyDict_Pop(kwds2, key, &value);
9504 if (unlikely(found < 0))
goto bad;
9505 values[name-argnames] = value;
9507#elif __PYX_LIMITED_VERSION_HEX >= 0x030d0000
9508 int found = PyDict_GetItemRef(kwds2, key, &value);
9510 if (unlikely(found < 0))
goto bad;
9511 values[name-argnames] = value;
9512 if (unlikely(PyDict_DelItem(kwds2, key) < 0))
goto bad;
9515 #if CYTHON_COMPILING_IN_CPYTHON
9516 value = _PyDict_Pop(kwds2, key, kwds2);
9518 value = __Pyx_CallUnboundCMethod2(&__pyx_mstate_global->__pyx_umethod_PyDict_Type_pop, kwds2, key, kwds2);
9520 if (value == kwds2) {
9523 if (unlikely(!value))
goto bad;
9524 values[name-argnames] = value;
9529 len = PyDict_Size(kwds2);
9531 return __Pyx_ValidateDuplicatePosArgs(kwds, argnames, first_kw_arg, function_name);
9532 }
else if (unlikely(len == -1)) {
9539static int __Pyx_ParseKeywordsTuple(
9541 PyObject *
const *kwvalues,
9542 PyObject **
const argnames[],
9545 Py_ssize_t num_pos_args,
9546 Py_ssize_t num_kwargs,
9547 const char* function_name,
9548 int ignore_unknown_kwargs)
9550 PyObject *key = NULL;
9551 PyObject**
const * name;
9552 PyObject**
const *first_kw_arg = argnames + num_pos_args;
9553 for (Py_ssize_t pos = 0; pos < num_kwargs; pos++) {
9554#if CYTHON_AVOID_BORROWED_REFS
9555 key = __Pyx_PySequence_ITEM(kwds, pos);
9557 key = __Pyx_PyTuple_GET_ITEM(kwds, pos);
9559#if !CYTHON_ASSUME_SAFE_MACROS
9560 if (unlikely(!key))
goto bad;
9562 name = first_kw_arg;
9563 while (*name && (**name != key)) name++;
9565 PyObject *value = kwvalues[pos];
9566 values[name-argnames] = __Pyx_NewRef(value);
9568 size_t index_found = 0;
9569 int cmp = __Pyx_MatchKeywordArg(key, argnames, first_kw_arg, &index_found, function_name);
9571 PyObject *value = kwvalues[pos];
9572 values[index_found] = __Pyx_NewRef(value);
9574 if (unlikely(cmp == -1))
goto bad;
9576 PyObject *value = kwvalues[pos];
9577 if (unlikely(PyDict_SetItem(kwds2, key, value)))
goto bad;
9578 }
else if (!ignore_unknown_kwargs) {
9579 goto invalid_keyword;
9583 #if CYTHON_AVOID_BORROWED_REFS
9590 PyErr_Format(PyExc_TypeError,
9591 "%s() got an unexpected keyword argument '%U'",
9592 function_name, key);
9595 #if CYTHON_AVOID_BORROWED_REFS
9602static int __Pyx_ParseKeywords(
9604 PyObject *
const *kwvalues,
9605 PyObject **
const argnames[],
9608 Py_ssize_t num_pos_args,
9609 Py_ssize_t num_kwargs,
9610 const char* function_name,
9611 int ignore_unknown_kwargs)
9613 if (CYTHON_VECTORCALL && likely(PyTuple_Check(kwds)))
9614 return __Pyx_ParseKeywordsTuple(kwds, kwvalues, argnames, kwds2, values, num_pos_args, num_kwargs, function_name, ignore_unknown_kwargs);
9616 return __Pyx_ParseKeywordDictToDict(kwds, argnames, kwds2, values, num_pos_args, function_name);
9618 return __Pyx_ParseKeywordDict(kwds, argnames, values, num_pos_args, num_kwargs, function_name, ignore_unknown_kwargs);
9622static void __Pyx_RaiseArgtupleInvalid(
9623 const char* func_name,
9627 Py_ssize_t num_found)
9629 Py_ssize_t num_expected;
9630 const char *more_or_less;
9631 if (num_found < num_min) {
9632 num_expected = num_min;
9633 more_or_less =
"at least";
9635 num_expected = num_max;
9636 more_or_less =
"at most";
9639 more_or_less =
"exactly";
9641 PyErr_Format(PyExc_TypeError,
9642 "%.200s() takes %.8s %" CYTHON_FORMAT_SSIZE_T
"d positional argument%.1s (%" CYTHON_FORMAT_SSIZE_T
"d given)",
9643 func_name, more_or_less, num_expected,
9644 (num_expected == 1) ?
"" :
"s", num_found);
9648#if CYTHON_USE_TYPE_SLOTS
9649static CYTHON_INLINE
int __Pyx_PyObject_SetAttrStr(PyObject* obj, PyObject* attr_name, PyObject* value) {
9650 PyTypeObject* tp = Py_TYPE(obj);
9651 if (likely(tp->tp_setattro))
9652 return tp->tp_setattro(obj, attr_name, value);
9653 return PyObject_SetAttr(obj, attr_name, value);
9658#if __PYX_LIMITED_VERSION_HEX < 0x030d0000
9659static void __Pyx_PyObject_GetAttrStr_ClearAttributeError(
void) {
9660 __Pyx_PyThreadState_declare
9661 __Pyx_PyThreadState_assign
9662 if (likely(__Pyx_PyErr_ExceptionMatches(PyExc_AttributeError)))
9663 __Pyx_PyErr_Clear();
9666static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStrNoError(PyObject* obj, PyObject* attr_name) {
9668#if __PYX_LIMITED_VERSION_HEX >= 0x030d0000
9669 (void) PyObject_GetOptionalAttr(obj, attr_name, &result);
9672#if CYTHON_COMPILING_IN_CPYTHON && CYTHON_USE_TYPE_SLOTS
9673 PyTypeObject* tp = Py_TYPE(obj);
9674 if (likely(tp->tp_getattro == PyObject_GenericGetAttr)) {
9675 return _PyObject_GenericGetAttrWithDict(obj, attr_name, NULL, 1);
9678 result = __Pyx_PyObject_GetAttrStr(obj, attr_name);
9679 if (unlikely(!result)) {
9680 __Pyx_PyObject_GetAttrStr_ClearAttributeError();
9687static PyObject *__Pyx_GetBuiltinName(PyObject *name) {
9688 PyObject* result = __Pyx_PyObject_GetAttrStrNoError(__pyx_mstate_global->__pyx_b, name);
9689 if (unlikely(!result) && !PyErr_Occurred()) {
9690 PyErr_Format(PyExc_NameError,
9691 "name '%U' is not defined", name);
9697#if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_TYPE_SLOTS
9698static CYTHON_INLINE PY_UINT64_T __Pyx_get_tp_dict_version(PyObject *obj) {
9699 PyObject *dict = Py_TYPE(obj)->tp_dict;
9700 return likely(dict) ? __PYX_GET_DICT_VERSION(dict) : 0;
9702static CYTHON_INLINE PY_UINT64_T __Pyx_get_object_dict_version(PyObject *obj) {
9703 PyObject **dictptr = NULL;
9704 Py_ssize_t offset = Py_TYPE(obj)->tp_dictoffset;
9706#if CYTHON_COMPILING_IN_CPYTHON
9707 dictptr = (likely(offset > 0)) ? (PyObject **) ((
char *)obj + offset) : _PyObject_GetDictPtr(obj);
9709 dictptr = _PyObject_GetDictPtr(obj);
9712 return (dictptr && *dictptr) ? __PYX_GET_DICT_VERSION(*dictptr) : 0;
9714static CYTHON_INLINE
int __Pyx_object_dict_version_matches(PyObject* obj, PY_UINT64_T tp_dict_version, PY_UINT64_T obj_dict_version) {
9715 PyObject *dict = Py_TYPE(obj)->tp_dict;
9716 if (unlikely(!dict) || unlikely(tp_dict_version != __PYX_GET_DICT_VERSION(dict)))
9718 return obj_dict_version == __Pyx_get_object_dict_version(obj);
9723#if CYTHON_USE_DICT_VERSIONS
9724static PyObject *__Pyx__GetModuleGlobalName(PyObject *name, PY_UINT64_T *dict_version, PyObject **dict_cached_value)
9726static CYTHON_INLINE PyObject *__Pyx__GetModuleGlobalName(PyObject *name)
9730#if CYTHON_COMPILING_IN_LIMITED_API
9731 if (unlikely(!__pyx_m)) {
9732 if (!PyErr_Occurred())
9733 PyErr_SetNone(PyExc_NameError);
9736 result = PyObject_GetAttr(__pyx_m, name);
9737 if (likely(result)) {
9740 if (!__Pyx_IgnoreException(PyExc_Exception)) {
9743#elif CYTHON_AVOID_BORROWED_REFS || CYTHON_AVOID_THREAD_UNSAFE_BORROWED_REFS
9744 if (unlikely(__Pyx_PyDict_GetItemRef(__pyx_mstate_global->__pyx_d, name, &result) == -1)) {
9745 if (!__Pyx_IgnoreException(PyExc_Exception)) {
9749 __PYX_UPDATE_DICT_CACHE(__pyx_mstate_global->__pyx_d, result, *dict_cached_value, *dict_version)
9750 if (likely(result)) {
9754 result = _PyDict_GetItem_KnownHash(__pyx_mstate_global->__pyx_d, name, ((PyASCIIObject *) name)->hash);
9755 __PYX_UPDATE_DICT_CACHE(__pyx_mstate_global->__pyx_d, result, *dict_cached_value, *dict_version)
9756 if (likely(result)) {
9757 return __Pyx_NewRef(result);
9759 PyObject *exc = PyErr_Occurred();
9760 if (unlikely(exc) && !__Pyx_IgnoreGivenException(exc, PyExc_Exception)) {
9764 return __Pyx_GetBuiltinName(name);
9768#if CYTHON_VECTORCALL
9769CYTHON_UNUSED
static int __Pyx_CheckVectorcallKwarg(PyObject *kwnames, Py_ssize_t i) {
9770 PyObject *key = __Pyx_PyTuple_GET_ITEM(kwnames, i);
9771#if !CYTHON_ASSUME_SAFE_MACROS
9772 if (unlikely(!key))
return -1;
9774 if (unlikely(!PyUnicode_Check(key))) {
9775 PyErr_SetString(PyExc_TypeError,
"keywords must be strings");
9781CYTHON_UNUSED
static PyObject *__Pyx_MakeKwargDict(PyObject **keys, PyObject **values, Py_ssize_t
n) {
9782 PyObject *out = PyDict_New();
9783 if (unlikely(!out))
return NULL;
9784 for (Py_ssize_t i=0; i<
n; ++i) {
9785 if (unlikely(PyDict_SetItem(out, keys[i], values[i]) < 0)) {
9792CYTHON_UNUSED
static int __Pyx_CheckVectorcallKwarg(PyObject **kwnames, Py_ssize_t i) {
9793 PyObject *key = kwnames[i];
9794 if (unlikely(!PyUnicode_Check(key))) {
9795 PyErr_SetString(PyExc_TypeError,
"keywords must be strings");
9803#if CYTHON_COMPILING_IN_LIMITED_API && __PYX_LIMITED_VERSION_HEX < 0x030d0000
9804static __Pyx_TypeName
9805__Pyx_PyType_GetFullyQualifiedName(PyTypeObject* tp)
9807 PyObject *module = NULL, *name = NULL, *result = NULL;
9808 #if __PYX_LIMITED_VERSION_HEX < 0x030b0000
9809 name = __Pyx_PyObject_GetAttrStr((PyObject *)tp,
9810 __pyx_mstate_global->__pyx_n_u_qualname);
9812 name = PyType_GetQualName(tp);
9814 if (unlikely(name == NULL) || unlikely(!PyUnicode_Check(name)))
goto bad;
9815 module = __Pyx_PyObject_GetAttrStr((PyObject *)tp,
9816 __pyx_mstate_global->__pyx_n_u_module);
9817 if (unlikely(module == NULL) || unlikely(!PyUnicode_Check(module)))
goto bad;
9818 if (PyUnicode_CompareWithASCIIString(module,
"builtins") == 0) {
9823 result = PyUnicode_FromFormat(
"%U.%U", module, name);
9824 if (unlikely(result == NULL))
goto bad;
9835 result = __Pyx_NewRef(__pyx_mstate_global->__pyx_kp_u_);
9842static void __Pyx_RaiseErrorWithTypes1(PyObject* exc_type,
const char *message,
const char *arg, PyTypeObject *type_obj1, PyTypeObject *type_obj2) {
9843 __Pyx_TypeName type_name1 = __Pyx_PyType_GetFullyQualifiedName(type_obj1);
9844 #if CYTHON_COMPILING_IN_LIMITED_API && __PYX_LIMITED_VERSION_HEX < 0x030d0000
9845 if (unlikely(!type_name1))
return;
9847 __Pyx_TypeName type_name2 = __Pyx_PyType_GetFullyQualifiedName(type_obj2);
9848 #if CYTHON_COMPILING_IN_LIMITED_API && __PYX_LIMITED_VERSION_HEX < 0x030d0000
9849 if (unlikely(!type_name2))
goto type2_failed;
9851 PyErr_Format(exc_type, message, arg, type_name1, type_name2);
9852 __Pyx_DECREF_TypeName(type_name2);
9853#if CYTHON_COMPILING_IN_LIMITED_API && __PYX_LIMITED_VERSION_HEX < 0x030d0000
9856 __Pyx_DECREF_TypeName(type_name1);
9860static CYTHON_INLINE
int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type) {
9861 if (unlikely(!type)) {
9862 PyErr_SetString(PyExc_SystemError,
"Missing type object");
9865 if (likely(__Pyx_TypeCheck(obj, type)))
9867 __Pyx_RaiseTypeErrorWithTypes(
9868 "Cannot convert " __Pyx_FMT_TYPENAME
" to " __Pyx_FMT_TYPENAME,
9869 Py_TYPE(obj), type);
9874#ifndef __PYX_HAVE_RT_ImportType_3_3_0
9875#define __PYX_HAVE_RT_ImportType_3_3_0
9876static PyTypeObject *__Pyx_ImportType_3_3_0(PyObject *module,
const char *module_name,
const char *class_name,
9877 size_t size,
size_t alignment,
enum __Pyx_ImportType_CheckSize_3_3_0 check_size)
9879 PyObject *result = 0;
9880 Py_ssize_t basicsize;
9881 Py_ssize_t itemsize;
9882#if defined(Py_LIMITED_API) || (defined(CYTHON_COMPILING_IN_LIMITED_API) && CYTHON_COMPILING_IN_LIMITED_API)
9883 PyObject *py_basicsize;
9884 PyObject *py_itemsize;
9886 result = PyObject_GetAttrString(module, class_name);
9889 if (!PyType_Check(result)) {
9890 PyErr_Format(PyExc_TypeError,
9891 "%.200s.%.200s is not a type object",
9892 module_name, class_name);
9895#if !( defined(Py_LIMITED_API) || (defined(CYTHON_COMPILING_IN_LIMITED_API) && CYTHON_COMPILING_IN_LIMITED_API) )
9896 basicsize = ((PyTypeObject *)result)->tp_basicsize;
9897 itemsize = ((PyTypeObject *)result)->tp_itemsize;
9900 return (PyTypeObject *)result;
9902 py_basicsize = PyObject_GetAttrString(result,
"__basicsize__");
9905 basicsize = PyLong_AsSsize_t(py_basicsize);
9906 Py_DECREF(py_basicsize);
9908 if (basicsize == (Py_ssize_t)-1 && PyErr_Occurred())
9910 py_itemsize = PyObject_GetAttrString(result,
"__itemsize__");
9913 itemsize = PyLong_AsSsize_t(py_itemsize);
9914 Py_DECREF(py_itemsize);
9916 if (itemsize == (Py_ssize_t)-1 && PyErr_Occurred())
9920 if (size % alignment) {
9921 alignment = size % alignment;
9923 if (itemsize < (Py_ssize_t)alignment)
9924 itemsize = (Py_ssize_t)alignment;
9926 if ((
size_t)(basicsize + itemsize) < size) {
9927 PyErr_Format(PyExc_ValueError,
9928 "%.200s.%.200s size changed, may indicate binary incompatibility. "
9929 "Expected %zd from C header, got %zd from PyObject",
9930 module_name, class_name, size, basicsize+itemsize);
9933 if (check_size == __Pyx_ImportType_CheckSize_Error_3_3_0 &&
9934 ((
size_t)basicsize > size || (
size_t)(basicsize + itemsize) < size)) {
9935 PyErr_Format(PyExc_ValueError,
9936 "%.200s.%.200s size changed, may indicate binary incompatibility. "
9937 "Expected %zd from C header, got %zd-%zd from PyObject",
9938 module_name, class_name, size, basicsize, basicsize+itemsize);
9941 else if (check_size == __Pyx_ImportType_CheckSize_Warn_3_3_0 && (
size_t)basicsize > size) {
9942 if (PyErr_WarnFormat(NULL, 0,
9943 "%.200s.%.200s size changed, may indicate binary incompatibility. "
9944 "Expected %zd from C header, got %zd from PyObject",
9945 module_name, class_name, size, basicsize) < 0) {
9949 return (PyTypeObject *)result;
9957#if __PYX_LIMITED_VERSION_HEX < 0x030d0000
9958static CYTHON_INLINE
int __Pyx_HasAttr(PyObject *o, PyObject *
n) {
9960 if (unlikely(!PyUnicode_Check(
n))) {
9961 PyErr_SetString(PyExc_TypeError,
9962 "hasattr(): attribute name must be string");
9965 r = __Pyx_PyObject_GetAttrStrNoError(o,
n);
9967 return (unlikely(PyErr_Occurred())) ? -1 : 0;
9976CYTHON_UNUSED
static PyObject *
9977__Pyx_PyList_FromArray(PyObject *
const *src, Py_ssize_t
n) {
9978 PyObject *res = PyList_New(
n);
9979 if (unlikely(res == NULL))
return NULL;
9980 #if CYTHON_COMPILING_IN_CPYTHON
9981 __Pyx_copy_object_array(src, ((PyListObject*)res)->ob_item,
n);
9984 for (i = 0; i <
n; i++) {
9986 if (unlikely(__Pyx_PyList_SET_ITEM(res, i, src[i]) < (0))) {
9996static int __Pyx__Import_GetModule(PyObject *qualname, PyObject **module) {
9997 PyObject *imported_module = PyImport_GetModule(qualname);
9998 if (unlikely(!imported_module)) {
10000 if (PyErr_Occurred()) {
10005 *
module = imported_module;
10008static int __Pyx__Import_Lookup(PyObject *qualname, PyObject *
const *imported_names, Py_ssize_t len_imported_names, PyObject **module) {
10009 PyObject *imported_module;
10010 PyObject *top_level_package_name;
10012 int status, module_found;
10013 Py_ssize_t dot_index;
10014 module_found = __Pyx__Import_GetModule(qualname, &imported_module);
10015 if (unlikely(!module_found || module_found == -1)) {
10017 return module_found;
10019 if (imported_names) {
10020 for (i = 0; i < len_imported_names; i++) {
10021 PyObject *imported_name = imported_names[i];
10022#if __PYX_LIMITED_VERSION_HEX < 0x030d0000
10023 int has_imported_attribute = PyObject_HasAttr(imported_module, imported_name);
10025 int has_imported_attribute = PyObject_HasAttrWithError(imported_module, imported_name);
10026 if (unlikely(has_imported_attribute == -1))
goto error;
10028 if (!has_imported_attribute) {
10032 *
module = imported_module;
10035 dot_index = PyUnicode_FindChar(qualname,
'.', 0, PY_SSIZE_T_MAX, 1);
10036 if (dot_index == -1) {
10037 *
module = imported_module;
10040 if (unlikely(dot_index == -2))
goto error;
10041 top_level_package_name = PyUnicode_Substring(qualname, 0, dot_index);
10042 if (unlikely(!top_level_package_name))
goto error;
10043 Py_DECREF(imported_module);
10044 status = __Pyx__Import_GetModule(top_level_package_name, module);
10045 Py_DECREF(top_level_package_name);
10048 Py_DECREF(imported_module);
10052 Py_DECREF(imported_module);
10056static PyObject *__Pyx__Import(PyObject *name, PyObject *
const *imported_names, Py_ssize_t len_imported_names, PyObject *qualname, PyObject *moddict,
int level) {
10057 PyObject *module = 0;
10058 PyObject *empty_dict = 0;
10059 PyObject *from_list = 0;
10064 module_found = __Pyx__Import_Lookup(qualname, imported_names, len_imported_names, &module);
10065 if (likely(module_found == 1)) {
10067 }
else if (unlikely(module_found == -1)) {
10070 #if !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX >= 0x030f00a6
10071 empty_dict = PyFrozenDict_New(NULL);
10073 empty_dict = PyDict_New();
10075 if (unlikely(!empty_dict))
10077 if (imported_names) {
10078 from_list = __Pyx_PyList_FromArray(imported_names, len_imported_names);
10079 if (unlikely(!from_list))
10083 const char* package_sep = strchr(__Pyx_MODULE_NAME,
'.');
10084 if (package_sep != (0)) {
10085 module = PyImport_ImportModuleLevelObject(
10086 name, moddict, empty_dict, from_list, 1);
10087 if (unlikely(!module)) {
10088 if (unlikely(!PyErr_ExceptionMatches(PyExc_ImportError)))
10096 module = PyImport_ImportModuleLevelObject(
10097 name, moddict, empty_dict, from_list, level);
10100 Py_XDECREF(from_list);
10101 Py_XDECREF(empty_dict);
10106static PyObject *__Pyx_Import(PyObject *name, PyObject *
const *imported_names, Py_ssize_t len_imported_names, PyObject *qualname,
int level) {
10107 return __Pyx__Import(name, imported_names, len_imported_names, qualname, __pyx_mstate_global->__pyx_d, level);
10111static CYTHON_INLINE PyObject *__Pyx_PyDict_SetDefault(PyObject *d, PyObject *key, PyObject *default_value) {
10113#if __PYX_LIMITED_VERSION_HEX >= 0x030F0000 || (!CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX >= 0x030d00A4)
10114 PyDict_SetDefaultRef(d, key, default_value, &value);
10115#elif CYTHON_COMPILING_IN_LIMITED_API && __PYX_LIMITED_VERSION_HEX >= 0x030C0000
10116 PyObject *args[] = {d, key, default_value};
10117 value = PyObject_VectorcallMethod(__pyx_mstate_global->__pyx_n_u_setdefault, args, 3 | PY_VECTORCALL_ARGUMENTS_OFFSET, NULL);
10118#elif CYTHON_COMPILING_IN_LIMITED_API
10119 value = PyObject_CallMethodObjArgs(d, __pyx_mstate_global->__pyx_n_u_setdefault, key, default_value, NULL);
10121 value = PyDict_SetDefault(d, key, default_value);
10122 if (unlikely(!value))
return NULL;
10129#if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING && PY_VERSION_HEX < 0x030F00a3
10130 static PyObject *__Pyx_PyImport_AddModuleObjectRef(PyObject *name) {
10131 PyObject *module_dict = PyImport_GetModuleDict();
10133 if (PyMapping_GetOptionalItem(module_dict, name, &m) < 0) {
10136 if (m != NULL && PyModule_Check(m)) {
10140 m = PyModule_NewObject(name);
10143 if (PyDict_CheckExact(module_dict)) {
10145 (void)PyDict_SetDefaultRef(module_dict, name, m, &new_m);
10149 if (PyObject_SetItem(module_dict, name, m) != 0) {
10156 static PyObject *__Pyx_PyImport_AddModuleRef(
const char *name) {
10157 if ((PY_VERSION_HEX >= 0x030E0000) && Py_Version >= 0x030E0100) {
10158 return PyImport_AddModuleRef(name);
10160 PyObject *py_name = PyUnicode_FromString(name);
10161 if (!py_name)
return NULL;
10162 PyObject *module = __Pyx_PyImport_AddModuleObjectRef(py_name);
10163 Py_DECREF(py_name);
10166#elif __PYX_LIMITED_VERSION_HEX < 0x030d0000
10167 static PyObject *__Pyx_PyImport_AddModuleRef(
const char *name) {
10168 PyObject *module = PyImport_AddModule(name);
10169 Py_XINCREF(module);
10175static PyObject *__Pyx_FetchSharedCythonABIModule(
void) {
10176 return __Pyx_PyImport_AddModuleRef(__PYX_ABI_MODULE_NAME);
10180static int __Pyx_VerifyCachedType(PyObject *cached_type,
10182 Py_ssize_t expected_basicsize) {
10183 Py_ssize_t basicsize;
10184 if (!PyType_Check(cached_type)) {
10185 PyErr_Format(PyExc_TypeError,
10186 "Shared Cython type %.200s is not a type object", name);
10189 if (expected_basicsize == 0) {
10192#if CYTHON_COMPILING_IN_LIMITED_API && CYTHON_OPAQUE_OBJECTS
10193 if (expected_basicsize < 0) {
10194 basicsize = PyType_GetTypeDataSize((PyTypeObject*)cached_type);
10198 #if CYTHON_COMPILING_IN_LIMITED_API
10199 PyObject *py_basicsize;
10200 py_basicsize = PyObject_GetAttrString(cached_type,
"__basicsize__");
10201 if (unlikely(!py_basicsize))
return -1;
10202 basicsize = PyLong_AsSsize_t(py_basicsize);
10203 Py_DECREF(py_basicsize);
10204 py_basicsize = NULL;
10205 if (unlikely(basicsize == (Py_ssize_t)-1) && PyErr_Occurred())
return -1;
10207 basicsize = ((PyTypeObject*) cached_type)->tp_basicsize;
10210 if ((expected_basicsize >= 0) ?
10211 (basicsize != expected_basicsize) :
10212 (basicsize < -expected_basicsize)) {
10213 PyErr_Format(PyExc_TypeError,
10214 "Shared Cython type %.200s has the wrong size, try recompiling",
10222#if __PYX_LIMITED_VERSION_HEX < 0x030C0000
10223static PyObject* __Pyx_PyType_FromMetaclass(PyTypeObject *metaclass, PyObject *module, PyType_Spec *spec, PyObject *bases) {
10224 PyObject *result = __Pyx_PyType_FromModuleAndSpec(module, spec, bases);
10225 if (result && metaclass) {
10226 PyObject *old_tp = (PyObject*)Py_TYPE(result);
10227 Py_INCREF((PyObject*)metaclass);
10228 Py_SET_TYPE(result, metaclass);
10230 PyType_Modified((PyTypeObject*)result);
10235#define __Pyx_PyType_FromMetaclass(me, mo, s, b) PyType_FromMetaclass(me, mo, s, b)
10237static PyTypeObject *__Pyx_FetchCommonTypeFromSpec(PyTypeObject *metaclass, PyObject *module, PyType_Spec *spec, PyObject *bases) {
10238 PyObject *abi_module = NULL, *cached_type = NULL, *abi_module_dict, *new_cached_type, *py_object_name;
10239 int get_item_ref_result;
10240 const char* object_name = strrchr(spec->name,
'.');
10241 object_name = object_name ? object_name+1 : spec->name;
10242 py_object_name = PyUnicode_FromString(object_name);
10243 if (!py_object_name)
return NULL;
10244 abi_module = __Pyx_FetchSharedCythonABIModule();
10245 if (!abi_module)
goto done;
10246 abi_module_dict = PyModule_GetDict(abi_module);
10247 if (!abi_module_dict)
goto done;
10248 get_item_ref_result = __Pyx_PyDict_GetItemRef(abi_module_dict, py_object_name, &cached_type);
10249 if (get_item_ref_result == 1) {
10250 if (__Pyx_VerifyCachedType(
10253 spec->basicsize) < 0) {
10257 }
else if (unlikely(get_item_ref_result == -1)) {
10260 cached_type = __Pyx_PyType_FromMetaclass(
10262 CYTHON_USE_MODULE_STATE ? module : abi_module,
10264 if (unlikely(!cached_type))
goto bad;
10265 new_cached_type = __Pyx_PyDict_SetDefault(abi_module_dict, py_object_name, cached_type);
10266 if (unlikely(new_cached_type != cached_type)) {
10267 if (unlikely(!new_cached_type))
goto bad;
10268 Py_DECREF(cached_type);
10269 cached_type = new_cached_type;
10270 if (__Pyx_VerifyCachedType(
10273 spec->basicsize) < 0) {
10278 Py_DECREF(new_cached_type);
10281 Py_XDECREF(abi_module);
10282 Py_DECREF(py_object_name);
10283 assert(cached_type == NULL || PyType_Check(cached_type));
10284 return (PyTypeObject *) cached_type;
10286 Py_XDECREF(cached_type);
10287 cached_type = NULL;
10292static PyObject* __pyx_CommonTypesMetaclass_get_module(CYTHON_UNUSED PyObject *self, CYTHON_UNUSED
void* context) {
10293 return PyUnicode_FromString(__PYX_ABI_MODULE_NAME);
10295#if __PYX_LIMITED_VERSION_HEX < 0x030A0000
10296static PyObject* __pyx_CommonTypesMetaclass_call(CYTHON_UNUSED PyObject *self, CYTHON_UNUSED PyObject *args, CYTHON_UNUSED PyObject *kwds) {
10297 PyErr_SetString(PyExc_TypeError,
"Cannot instantiate Cython internal types");
10300static int __pyx_CommonTypesMetaclass_setattr(CYTHON_UNUSED PyObject *self, CYTHON_UNUSED PyObject *attr, CYTHON_UNUSED PyObject *value) {
10301 PyErr_SetString(PyExc_TypeError,
"Cython internal types are immutable");
10305static PyGetSetDef __pyx_CommonTypesMetaclass_getset[] = {
10306 {
"__module__", __pyx_CommonTypesMetaclass_get_module, NULL, NULL, NULL},
10309static PyType_Slot __pyx_CommonTypesMetaclass_slots[] = {
10310 {Py_tp_getset, (
void *)__pyx_CommonTypesMetaclass_getset},
10311 #if __PYX_LIMITED_VERSION_HEX < 0x030A0000
10312 {Py_tp_call, (
void*)__pyx_CommonTypesMetaclass_call},
10313 {Py_tp_new, (
void*)__pyx_CommonTypesMetaclass_call},
10314 {Py_tp_setattro, (
void*)__pyx_CommonTypesMetaclass_setattr},
10318static PyType_Spec __pyx_CommonTypesMetaclass_spec = {
10319 __PYX_TYPE_MODULE_PREFIX
"_common_types_metatype",
10322 Py_TPFLAGS_IMMUTABLETYPE |
10323 Py_TPFLAGS_DISALLOW_INSTANTIATION |
10324 Py_TPFLAGS_DEFAULT,
10325 __pyx_CommonTypesMetaclass_slots
10327static int __pyx_CommonTypesMetaclass_init(PyObject *module) {
10328 __pyx_mstatetype *mstate = __Pyx_PyModule_GetState(module);
10329 PyObject *bases = PyTuple_Pack(1, &PyType_Type);
10330 if (unlikely(!bases)) {
10333 mstate->__pyx_CommonTypesMetaclassType = __Pyx_FetchCommonTypeFromSpec(NULL, module, &__pyx_CommonTypesMetaclass_spec, bases);
10335 if (unlikely(mstate->__pyx_CommonTypesMetaclassType == NULL)) {
10342#if CYTHON_COMPILING_IN_LIMITED_API
10343static CYTHON_INLINE
int __Pyx__IsSameCyOrCFunctionNoMethod(PyObject *func,
void (*cfunc)(
void)) {
10344 if (__Pyx_CyFunction_Check(func)) {
10345 return __Pyx_as_CyFunctionObject(func)->func_methoddef->ml_meth == (PyCFunction) cfunc;
10346 }
else if (PyCFunction_Check(func)) {
10347 return PyCFunction_GetFunction(func) == (PyCFunction) cfunc;
10351static CYTHON_INLINE
int __Pyx__IsSameCyOrCFunction(PyObject *func,
void (*cfunc)(
void)) {
10352 if ((PyObject*)Py_TYPE(func) == __pyx_mstate_global->__Pyx_CachedMethodType) {
10354 PyObject *newFunc = PyObject_GetAttr(func, __pyx_mstate_global->__pyx_n_u_func);
10355 if (unlikely(!newFunc)) {
10359 result = __Pyx__IsSameCyOrCFunctionNoMethod(newFunc, cfunc);
10360 Py_DECREF(newFunc);
10363 return __Pyx__IsSameCyOrCFunctionNoMethod(func, cfunc);
10366static CYTHON_INLINE
int __Pyx__IsSameCyOrCFunction(PyObject *func,
void (*cfunc)(
void)) {
10367 if (PyMethod_Check(func)) {
10368 func = PyMethod_GET_FUNCTION(func);
10370 return __Pyx_CyOrPyCFunction_Check(func) && __Pyx_CyOrPyCFunction_GET_FUNCTION(func) == (PyCFunction) cfunc;
10373static CYTHON_INLINE
void __Pyx__CyFunction_SetClassObj(__pyx_CyFunctionObject*
f, PyObject* classobj) {
10374#if CYTHON_COMPILING_IN_LIMITED_API
10375 __Pyx_Py_XDECREF_SET(
10376 __Pyx__CyFunction_GetClassObj(
f),
10377 ((classobj) ? __Pyx_NewRef(classobj) : NULL));
10379 __Pyx_Py_XDECREF_SET(
10380 ((PyCMethodObject *) (
f))->mm_class,
10381 (PyTypeObject*)((classobj) ? __Pyx_NewRef(classobj) : NULL));
10384static CYTHON_INLINE PyObject *__Pyx_CyFunction_InitDefaults(PyObject *func, PyTypeObject *defaults_type) {
10385 __pyx_CyFunctionObject *m = __Pyx_as_CyFunctionObject(func);
10386 m->defaults = PyObject_CallObject((PyObject*)defaults_type, NULL);
10387 if (unlikely(!m->defaults))
10389 return m->defaults;
10391static CYTHON_INLINE
void __Pyx_CyFunction_SetDefaultsTuple(PyObject *func, PyObject *tuple) {
10392 __pyx_CyFunctionObject *m = __Pyx_as_CyFunctionObject(func);
10393 m->defaults_tuple = tuple;
10396static CYTHON_INLINE
void __Pyx_CyFunction_SetDefaultsKwDict(PyObject *func, PyObject *dict) {
10397 __pyx_CyFunctionObject *m = __Pyx_as_CyFunctionObject(func);
10398 m->defaults_kwdict = dict;
10401static CYTHON_INLINE
void __Pyx_CyFunction_SetAnnotationsDict(PyObject *func, PyObject *dict) {
10402 __pyx_CyFunctionObject *m = __Pyx_as_CyFunctionObject(func);
10403 m->func_annotations = dict;
10408#if !CYTHON_USE_TYPE_SPECS
10410static int __Pyx_call_type_traverse(PyObject *o,
int always_call, visitproc visit,
void *arg) {
10411 if (!always_call) {
10412 PyTypeObject *base = __Pyx_PyObject_GetSlot(o, tp_base, PyTypeObject*);
10413 unsigned long flags = PyType_GetFlags(base);
10414 if (flags & Py_TPFLAGS_HEAPTYPE) {
10418 Py_VISIT((PyObject*)Py_TYPE(o));
10424#if CYTHON_COMPILING_IN_LIMITED_API
10425static PyObject *__Pyx_PyMethod_New(PyObject *func, PyObject *self, PyObject *typ) {
10427 CYTHON_UNUSED_VAR(typ);
10429 return __Pyx_NewRef(func);
10430 #if __PYX_LIMITED_VERSION_HEX >= 0x030C0000
10432 PyObject *args[] = {func, self};
10433 result = PyObject_Vectorcall(__pyx_mstate_global->__Pyx_CachedMethodType, args, 2, NULL);
10436 result = PyObject_CallFunctionObjArgs(__pyx_mstate_global->__Pyx_CachedMethodType, func, self, NULL);
10441static PyObject *__Pyx_PyMethod_New(PyObject *func, PyObject *self, PyObject *typ) {
10442 CYTHON_UNUSED_VAR(typ);
10444 return __Pyx_NewRef(func);
10445 return PyMethod_New(func, self);
10450#if CYTHON_VECTORCALL
10451static PyObject *__Pyx_PyVectorcall_FastCallDict_kw(PyObject *func, __pyx_vectorcallfunc vc, PyObject *
const *args,
size_t nargs, PyObject *kw)
10453 PyObject *res = NULL;
10455 PyObject **newargs;
10456 PyObject **kwvalues;
10458 #if CYTHON_AVOID_BORROWED_REFS
10464 PyObject *key, *value;
10465 unsigned long keys_are_strings;
10466 #if !CYTHON_ASSUME_SAFE_SIZE
10467 Py_ssize_t nkw = PyDict_Size(kw);
10468 if (unlikely(nkw == -1))
return NULL;
10470 Py_ssize_t nkw = PyDict_GET_SIZE(kw);
10472 newargs = (PyObject **)PyMem_Malloc((nargs + (
size_t)nkw) *
sizeof(args[0]));
10473 if (unlikely(newargs == NULL)) {
10477 for (j = 0; j < nargs; j++) newargs[j] = args[j];
10478 kwnames = PyTuple_New(nkw);
10479 if (unlikely(kwnames == NULL)) {
10480 PyMem_Free(newargs);
10483 kwvalues = newargs + nargs;
10486 keys_are_strings = Py_TPFLAGS_UNICODE_SUBCLASS;
10487 while (__Pyx_PyDict_NextRef(kw, &pos, &key, &value)) {
10488 keys_are_strings &=
10489 #if CYTHON_COMPILING_IN_LIMITED_API
10490 PyType_GetFlags(Py_TYPE(key));
10492 Py_TYPE(key)->tp_flags;
10494 #if !CYTHON_ASSUME_SAFE_MACROS
10495 if (unlikely(PyTuple_SetItem(kwnames, i, key) < 0))
goto cleanup;
10497 PyTuple_SET_ITEM(kwnames, i, key);
10499 kwvalues[i] = value;
10502 if (unlikely(!keys_are_strings)) {
10503 PyErr_SetString(PyExc_TypeError,
"keywords must be strings");
10506 res = vc(func, newargs, nargs, kwnames);
10508 #if CYTHON_AVOID_BORROWED_REFS
10511 Py_DECREF(kwnames);
10512 for (i = 0; i < nkw; i++)
10513 Py_DECREF(kwvalues[i]);
10514 PyMem_Free(newargs);
10517static CYTHON_INLINE PyObject *__Pyx_PyVectorcall_FastCallDict(PyObject *func, __pyx_vectorcallfunc vc, PyObject *
const *args,
size_t nargs, PyObject *kw)
10519 Py_ssize_t kw_size =
10520 likely(kw == NULL) ?
10522#if !CYTHON_ASSUME_SAFE_SIZE
10525 PyDict_GET_SIZE(kw);
10527 if (kw_size == 0) {
10528 return vc(func, args, nargs, NULL);
10530#if !CYTHON_ASSUME_SAFE_SIZE
10531 else if (unlikely(kw_size == -1)) {
10535 return __Pyx_PyVectorcall_FastCallDict_kw(func, vc, args, nargs, kw);
10541__Pyx_CyFunction_get_doc_locked(__pyx_CyFunctionObject *op)
10543 if (unlikely(op->func_doc == NULL)) {
10544#if CYTHON_COMPILING_IN_LIMITED_API
10545 const char *doc = op->func_methoddef->ml_doc;
10547 const char *doc = ((PyCFunctionObject*)op)->m_ml->ml_doc;
10550 op->func_doc = PyUnicode_FromString(doc);
10551 if (unlikely(op->func_doc == NULL))
10554 Py_INCREF(Py_None);
10558 Py_INCREF(op->func_doc);
10559 return op->func_doc;
10562__Pyx_CyFunction_get_doc(PyObject *op_in,
void *closure) {
10564 __pyx_CyFunctionObject *op = __Pyx_as_CyFunctionObject(op_in);
10565 CYTHON_UNUSED_VAR(closure);
10566 __Pyx_BEGIN_CRITICAL_SECTION(op_in);
10567 result = __Pyx_CyFunction_get_doc_locked(op);
10568 __Pyx_END_CRITICAL_SECTION();
10572__Pyx_CyFunction_set_doc(PyObject *op_in, PyObject *value,
void *context)
10574 __pyx_CyFunctionObject *op = __Pyx_as_CyFunctionObject(op_in);
10575 CYTHON_UNUSED_VAR(context);
10576 if (value == NULL) {
10580 __Pyx_BEGIN_CRITICAL_SECTION(op_in);
10581 __Pyx_Py_XDECREF_SET(op->func_doc, value);
10582 __Pyx_END_CRITICAL_SECTION();
10586__Pyx_CyFunction_get_name_locked(__pyx_CyFunctionObject *op)
10588 if (unlikely(op->func_name == NULL)) {
10589#if CYTHON_COMPILING_IN_LIMITED_API
10590 const char *name = op->func_methoddef->ml_name;
10592 const char *name = ((PyCFunctionObject*)op)->m_ml->ml_name;
10594 op->func_name = PyUnicode_InternFromString(name);
10595 if (unlikely(op->func_name == NULL))
10598 Py_INCREF(op->func_name);
10599 return op->func_name;
10602__Pyx_CyFunction_get_name(PyObject *op,
void *context)
10604 PyObject *result = NULL;
10605 CYTHON_UNUSED_VAR(context);
10606 __Pyx_BEGIN_CRITICAL_SECTION(op);
10607 result = __Pyx_CyFunction_get_name_locked(__Pyx_as_CyFunctionObject(op));
10608 __Pyx_END_CRITICAL_SECTION();
10612__Pyx_CyFunction_set_name(PyObject *op_in, PyObject *value,
void *context)
10614 CYTHON_UNUSED_VAR(context);
10615 if (unlikely(value == NULL || !PyUnicode_Check(value))) {
10616 PyErr_SetString(PyExc_TypeError,
10617 "__name__ must be set to a string object");
10620 __pyx_CyFunctionObject *op = __Pyx_as_CyFunctionObject(op_in);
10622 __Pyx_BEGIN_CRITICAL_SECTION(op_in);
10623 __Pyx_Py_XDECREF_SET(op->func_name, value);
10624 __Pyx_END_CRITICAL_SECTION();
10628__Pyx_CyFunction_get_qualname(PyObject *op_in,
void *context)
10630 CYTHON_UNUSED_VAR(context);
10631 __pyx_CyFunctionObject *op = __Pyx_as_CyFunctionObject(op_in);
10633 __Pyx_BEGIN_CRITICAL_SECTION(op_in);
10634 Py_INCREF(op->func_qualname);
10635 result = op->func_qualname;
10636 __Pyx_END_CRITICAL_SECTION();
10640__Pyx_CyFunction_set_qualname(PyObject *op_in, PyObject *value,
void *context)
10642 CYTHON_UNUSED_VAR(context);
10643 if (unlikely(value == NULL || !PyUnicode_Check(value))) {
10644 PyErr_SetString(PyExc_TypeError,
10645 "__qualname__ must be set to a string object");
10648 __pyx_CyFunctionObject *op = __Pyx_as_CyFunctionObject(op_in);
10650 __Pyx_BEGIN_CRITICAL_SECTION(op_in);
10651 __Pyx_Py_XDECREF_SET(op->func_qualname, value);
10652 __Pyx_END_CRITICAL_SECTION();
10655#if CYTHON_COMPILING_IN_LIMITED_API && __PYX_LIMITED_VERSION_HEX < 0x030A0000
10657__Pyx_CyFunction_get_dict(__pyx_CyFunctionObject *op,
void *context)
10659 CYTHON_UNUSED_VAR(context);
10660 if (unlikely(op->func_dict == NULL)) {
10661 op->func_dict = PyDict_New();
10662 if (unlikely(op->func_dict == NULL))
10665 Py_INCREF(op->func_dict);
10666 return op->func_dict;
10670__Pyx_CyFunction_get_globals(PyObject *op_in,
void *context)
10672 CYTHON_UNUSED_VAR(context);
10673 __pyx_CyFunctionObject *op = __Pyx_as_CyFunctionObject(op_in);
10674 Py_INCREF(op->func_globals);
10675 return op->func_globals;
10678__Pyx_CyFunction_get_closure(PyObject *op,
void *context)
10680 CYTHON_UNUSED_VAR(op);
10681 CYTHON_UNUSED_VAR(context);
10682 Py_INCREF(Py_None);
10686__Pyx_CyFunction_get_code(PyObject *op_in,
void *context)
10688 __pyx_CyFunctionObject *op = __Pyx_as_CyFunctionObject(op_in);
10689 PyObject* result = (op->func_code) ? op->func_code : Py_None;
10690 CYTHON_UNUSED_VAR(context);
10695__Pyx_CyFunction_init_defaults(__pyx_CyFunctionObject *op, PyObject *op_obj) {
10697 PyObject *res = op->defaults_getter(op_obj);
10698 if (unlikely(!res))
10700 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
10701 op->defaults_tuple = PyTuple_GET_ITEM(res, 0);
10702 Py_INCREF(op->defaults_tuple);
10703 op->defaults_kwdict = PyTuple_GET_ITEM(res, 1);
10704 Py_INCREF(op->defaults_kwdict);
10706 op->defaults_tuple = __Pyx_PySequence_ITEM(res, 0);
10707 if (unlikely(!op->defaults_tuple)) result = -1;
10709 op->defaults_kwdict = __Pyx_PySequence_ITEM(res, 1);
10710 if (unlikely(!op->defaults_kwdict)) result = -1;
10717__Pyx_CyFunction_set_defaults(PyObject *op_in, PyObject* value,
void *context) {
10718 __pyx_CyFunctionObject *op = __Pyx_as_CyFunctionObject(op_in);
10719 CYTHON_UNUSED_VAR(context);
10722 }
else if (unlikely(value != Py_None && !PyTuple_Check(value))) {
10723 PyErr_SetString(PyExc_TypeError,
10724 "__defaults__ must be set to a tuple object");
10727 PyErr_WarnEx(PyExc_RuntimeWarning,
"changes to cyfunction.__defaults__ will not "
10728 "currently affect the values used in function calls", 1);
10730 __Pyx_BEGIN_CRITICAL_SECTION(op_in);
10731 __Pyx_Py_XDECREF_SET(op->defaults_tuple, value);
10732 __Pyx_END_CRITICAL_SECTION();
10736__Pyx_CyFunction_get_defaults_locked(PyObject *op_in) {
10737 __pyx_CyFunctionObject *op = __Pyx_as_CyFunctionObject(op_in);
10738 PyObject* result = op->defaults_tuple;
10739 if (unlikely(!result)) {
10740 if (op->defaults_getter) {
10741 if (unlikely(__Pyx_CyFunction_init_defaults(op, op_in) < 0))
return NULL;
10742 result = op->defaults_tuple;
10751__Pyx_CyFunction_get_defaults(PyObject *op,
void *context) {
10752 PyObject* result = NULL;
10753 CYTHON_UNUSED_VAR(context);
10754 __Pyx_BEGIN_CRITICAL_SECTION(op);
10755 result = __Pyx_CyFunction_get_defaults_locked(op);
10756 __Pyx_END_CRITICAL_SECTION();
10760__Pyx_CyFunction_set_kwdefaults(PyObject *op_in, PyObject* value,
void *context) {
10761 __pyx_CyFunctionObject *op = __Pyx_as_CyFunctionObject(op_in);
10762 CYTHON_UNUSED_VAR(context);
10765 }
else if (unlikely(value != Py_None && !PyDict_Check(value))) {
10766 PyErr_SetString(PyExc_TypeError,
10767 "__kwdefaults__ must be set to a dict object");
10770 PyErr_WarnEx(PyExc_RuntimeWarning,
"changes to cyfunction.__kwdefaults__ will not "
10771 "currently affect the values used in function calls", 1);
10773 __Pyx_BEGIN_CRITICAL_SECTION(op_in);
10774 __Pyx_Py_XDECREF_SET(op->defaults_kwdict, value);
10775 __Pyx_END_CRITICAL_SECTION();
10779__Pyx_CyFunction_get_kwdefaults_locked(PyObject *op_in) {
10780 __pyx_CyFunctionObject *op = __Pyx_as_CyFunctionObject(op_in);
10781 PyObject* result = op->defaults_kwdict;
10782 if (unlikely(!result)) {
10783 if (op->defaults_getter) {
10784 if (unlikely(__Pyx_CyFunction_init_defaults(op, op_in) < 0))
return NULL;
10785 result = op->defaults_kwdict;
10794__Pyx_CyFunction_get_kwdefaults(PyObject *op,
void *context) {
10796 CYTHON_UNUSED_VAR(context);
10797 __Pyx_BEGIN_CRITICAL_SECTION(op);
10798 result = __Pyx_CyFunction_get_kwdefaults_locked(op);
10799 __Pyx_END_CRITICAL_SECTION();
10802static int __Pyx_CyFunction_set_annotate_in_dict_if_exists(PyObject *op_in, PyObject *value);
10804__Pyx_CyFunction_set_annotations(PyObject *op_in, PyObject* value,
void *context) {
10805 CYTHON_UNUSED_VAR(context);
10806 if (!value || value == Py_None) {
10808 }
else if (unlikely(!PyDict_Check(value))) {
10809 PyErr_SetString(PyExc_TypeError,
10810 "__annotations__ must be set to a dict object");
10813 __pyx_CyFunctionObject *op = __Pyx_as_CyFunctionObject(op_in);
10815 __Pyx_BEGIN_CRITICAL_SECTION(op_in);
10816 __Pyx_Py_XDECREF_SET(op->func_annotations, value);
10817 __Pyx_END_CRITICAL_SECTION();
10818 if (unlikely(__Pyx_CyFunction_set_annotate_in_dict_if_exists(op_in, Py_None) < 0))
return -1;
10822__Pyx_CyFunction_get_dict_if_exists(PyObject *op_in, PyObject **dict) {
10825#if CYTHON_COMPILING_IN_PYPY
10826 *dict = PyObject_GenericGetDict(op_in, NULL);
10827#elif CYTHON_COMPILING_IN_LIMITED_API || PY_VERSION_HEX < 0x030C0000
10828 *dict = __Pyx_as_CyFunctionObject(op_in)->func_dict;
10830 PyObject **dictptr = _PyObject_GetDictPtr(op_in);
10831 *dict = likely(dictptr) ? *dictptr : NULL;
10833 return *dict ? 1 : 0;
10836__Pyx_CyFunction_get_annotate_from_dict_if_exists(PyObject *op_in, PyObject **annotate) {
10840 dict_found = __Pyx_CyFunction_get_dict_if_exists(op_in, &dict);
10841 if (!dict_found)
return 0;
10842 return __Pyx_PyDict_GetItemRef(dict, __pyx_mstate_global->__pyx_n_u_annotate, annotate);
10845__Pyx_CyFunction_set_annotate_in_dict_if_exists(PyObject *op_in, PyObject *value) {
10848 dict_found = __Pyx_CyFunction_get_dict_if_exists(op_in, &dict);
10849 if (!dict_found)
return 0;
10851 return PyDict_SetItem(dict, __pyx_mstate_global->__pyx_n_u_annotate, value);
10853#if !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX >= 0x030d0000
10854 return PyDict_Pop(dict, __pyx_mstate_global->__pyx_n_u_annotate, NULL);
10856 int result = PyDict_Contains(dict, __pyx_mstate_global->__pyx_n_u_annotate);
10858 result = PyDict_DelItem(dict, __pyx_mstate_global->__pyx_n_u_annotate);
10865__Pyx_CyFunction_set_annotate_in_dict(PyObject *op_in, PyObject *value) {
10868#if CYTHON_COMPILING_IN_LIMITED_API && __PYX_LIMITED_VERSION_HEX < 0x030A0000
10869 dict = __Pyx_CyFunction_get_dict(__Pyx_as_CyFunctionObject(op_in), NULL);
10871 dict = PyObject_GenericGetDict(op_in, NULL);
10873 if (unlikely(!dict))
return -1;
10874 result = PyDict_SetItem(dict, __pyx_mstate_global->__pyx_n_u_annotate, value);
10879__Pyx_CyFunction_get_annotations_locked(__pyx_CyFunctionObject *op) {
10880 PyObject* result = op->func_annotations;
10881 if (unlikely(!result)) {
10882 result = PyDict_New();
10883 if (unlikely(!result))
return NULL;
10884 op->func_annotations = result;
10890__Pyx_CyFunction_get_annotations(PyObject *op_in,
void *context) {
10891 PyObject *annotate = NULL;
10892 PyObject *result = NULL;
10893 __pyx_CyFunctionObject *op = __Pyx_as_CyFunctionObject(op_in);
10894 CYTHON_UNUSED_VAR(context);
10895 __Pyx_BEGIN_CRITICAL_SECTION(op_in);
10896 result = __Pyx_XNewRef(op->func_annotations);
10897 __Pyx_END_CRITICAL_SECTION();
10898 if (result)
return result;
10899 if (unlikely(__Pyx_CyFunction_get_annotate_from_dict_if_exists(op_in, &annotate) < 0))
return NULL;
10900 if (!annotate || annotate == Py_None) {
10901 Py_XDECREF(annotate);
10902 __Pyx_BEGIN_CRITICAL_SECTION(op_in);
10903 result = __Pyx_CyFunction_get_annotations_locked(op);
10904 __Pyx_END_CRITICAL_SECTION();
10907 PyObject *format = PyLong_FromLong(1L);
10908 if (likely(format)) {
10909 if (!Py_EnterRecursiveCall(
" cyfunction __annotations__.__get__")) {
10910 result = __Pyx_PyObject_CallOneArg(annotate, format);
10911 Py_LeaveRecursiveCall();
10915 Py_DECREF(annotate);
10916 if (unlikely(!result))
return NULL;
10917 if (unlikely(!PyDict_Check(result))) {
10918 PyErr_SetString(PyExc_TypeError,
"__annotate__ must return a dict");
10922 __Pyx_BEGIN_CRITICAL_SECTION(op_in);
10923 __Pyx_Py_XDECREF_SET(op->func_annotations, __Pyx_NewRef(result));
10924 __Pyx_END_CRITICAL_SECTION();
10927static PyObject *__Pyx_CyFunction_annotate_impl(PyObject *self, PyObject *arg) {
10928 CYTHON_UNUSED_VAR(arg);
10929 if (unlikely(!self)) {
10930 PyErr_SetString(PyExc_SystemError,
"cython __annotate__ called without 'self' argument");
10934 if (Py_EnterRecursiveCall(
" in cyfunction annotate")) {
10937 result = __Pyx_CyFunction_get_annotations(self, NULL);
10938 Py_LeaveRecursiveCall();
10942__Pyx_CyFunction_get_annotate(PyObject *op_in,
void *context);
10944__Pyx_CyFunction_set_annotate(PyObject *op_in, PyObject* value,
void *context) {
10945 CYTHON_UNUSED_VAR(context);
10946 if (value == NULL) {
10947 PyErr_SetString(PyExc_TypeError,
"__annotate__ cannot be deleted");
10950 if (unlikely(value != Py_None && !PyCallable_Check(value))) {
10951 PyErr_SetString(PyExc_TypeError,
"__annotate__ must be callable or None");
10954 if (unlikely(__Pyx_TypeCheck(value, &PyCFunction_Type))) {
10955#if !CYTHON_ASSUME_SAFE_MACROS && !CYTHON_COMPILING_IN_PYPY
10956 PyCFunction cfunction = PyCFunction_GetFunction(value);
10957 if (unlikely(!cfunction))
return -1;
10958 PyObject *value_self = PyCFunction_GetSelf(value);
10959 if (unlikely(!value_self && PyErr_Occurred()))
return -1;
10961 PyCFunction cfunction = PyCFunction_GET_FUNCTION(value);
10962 PyObject *value_self = PyCFunction_GET_SELF(value);
10964 if (cfunction == __Pyx_CyFunction_annotate_impl && value_self == op_in) {
10965 return __Pyx_CyFunction_set_annotate_in_dict_if_exists(op_in, NULL);
10968 if (value != Py_None) {
10969 __pyx_CyFunctionObject *op = __Pyx_as_CyFunctionObject(op_in);
10970 __Pyx_BEGIN_CRITICAL_SECTION(op_in);
10971 Py_CLEAR(op->func_annotations);
10972 __Pyx_END_CRITICAL_SECTION();
10974 return __Pyx_CyFunction_set_annotate_in_dict(op_in, value);
10976#if __PYX_LIMITED_VERSION_HEX < 0x030B0000
10978__Pyx_CyFunction_get_is_coroutine_value(__pyx_CyFunctionObject *op) {
10979 int is_coroutine = op->flags & __Pyx_CYFUNCTION_COROUTINE;
10980 if (is_coroutine) {
10981 PyObject *is_coroutine_value, *module, *fromlist, *marker = __pyx_mstate_global->__pyx_n_u_is_coroutine;
10982 fromlist = PyList_New(1);
10983 if (unlikely(!fromlist))
return NULL;
10985#if CYTHON_ASSUME_SAFE_MACROS
10986 PyList_SET_ITEM(fromlist, 0, marker);
10988 if (unlikely(PyList_SetItem(fromlist, 0, marker) < 0)) {
10989 Py_DECREF(fromlist);
10993 module = PyImport_ImportModuleLevelObject(__pyx_mstate_global->__pyx_n_u_asyncio_coroutines, NULL, NULL, fromlist, 0);
10994 Py_DECREF(fromlist);
10995 if (unlikely(!module)) {
10996 goto ignore_or_error;
10998 is_coroutine_value = __Pyx_PyObject_GetAttrStr(module, marker);
11000 if (likely(is_coroutine_value)) {
11001 return is_coroutine_value;
11004 if (!__Pyx_IgnoreException(PyExc_Exception)) {
11008 return __Pyx_PyBool_FromLong(is_coroutine);
11011__Pyx_CyFunction_get_is_coroutine(PyObject *op_in,
void *context) {
11012 __pyx_CyFunctionObject *op = __Pyx_as_CyFunctionObject(op_in);
11014 CYTHON_UNUSED_VAR(context);
11015 if (op->func_is_coroutine) {
11016 return __Pyx_NewRef(op->func_is_coroutine);
11018 result = __Pyx_CyFunction_get_is_coroutine_value(op);
11019 if (unlikely(!result))
11021 __Pyx_BEGIN_CRITICAL_SECTION(op_in);
11022 if (op->func_is_coroutine) {
11024 result = __Pyx_NewRef(op->func_is_coroutine);
11026 op->func_is_coroutine = __Pyx_NewRef(result);
11028 __Pyx_END_CRITICAL_SECTION();
11032static void __Pyx_CyFunction_raise_argument_count_error(PyObject *func,
const char* message, Py_ssize_t size) {
11033#if CYTHON_COMPILING_IN_LIMITED_API
11034 PyObject *py_name = __Pyx_CyFunction_get_name(func, NULL);
11035 if (!py_name)
return;
11036 PyErr_Format(PyExc_TypeError,
11037 "%.200S() %s (%" CYTHON_FORMAT_SSIZE_T
"d given)",
11038 py_name, message, size);
11039 Py_DECREF(py_name);
11041 const char* name = ((PyCFunctionObject*)func)->m_ml->ml_name;
11042 PyErr_Format(PyExc_TypeError,
11043 "%.200s() %s (%" CYTHON_FORMAT_SSIZE_T
"d given)",
11044 name, message, size);
11047static void __Pyx_CyFunction_raise_type_error(PyObject *func,
const char* message) {
11048#if CYTHON_COMPILING_IN_LIMITED_API
11049 PyObject *py_name = __Pyx_CyFunction_get_name(func, NULL);
11050 if (!py_name)
return;
11051 PyErr_Format(PyExc_TypeError,
11054 Py_DECREF(py_name);
11056 const char* name = ((PyCFunctionObject*)func)->m_ml->ml_name;
11057 PyErr_Format(PyExc_TypeError,
11062#if CYTHON_COMPILING_IN_LIMITED_API
11064__Pyx_CyFunction_get_module(PyObject *op_in,
void *context) {
11065 CYTHON_UNUSED_VAR(context);
11066 __pyx_CyFunctionObject *op = __Pyx_as_CyFunctionObject(op_in);
11067 Py_INCREF(op->func_module);
11068 return op->func_module;
11071__Pyx_CyFunction_set_module(PyObject *op_in, PyObject* value,
void *context) {
11072 CYTHON_UNUSED_VAR(context);
11073 __pyx_CyFunctionObject *op = __Pyx_as_CyFunctionObject(op_in);
11074 if (value == NULL) {
11078 PyObject *old = op->func_module;
11079 op->func_module = value;
11084static PyGetSetDef __pyx_CyFunction_getsets[] = {
11085 {
"func_doc", (getter)__Pyx_CyFunction_get_doc, (setter)__Pyx_CyFunction_set_doc, 0, 0},
11086 {
"__doc__", (getter)__Pyx_CyFunction_get_doc, (setter)__Pyx_CyFunction_set_doc, 0, 0},
11087 {
"func_name", (getter)__Pyx_CyFunction_get_name, (setter)__Pyx_CyFunction_set_name, 0, 0},
11088 {
"__name__", (getter)__Pyx_CyFunction_get_name, (setter)__Pyx_CyFunction_set_name, 0, 0},
11089 {
"__qualname__", (getter)__Pyx_CyFunction_get_qualname, (setter)__Pyx_CyFunction_set_qualname, 0, 0},
11090#if CYTHON_COMPILING_IN_LIMITED_API && __PYX_LIMITED_VERSION_HEX < 0x030A0000
11091 {
"func_dict", (getter)__Pyx_CyFunction_get_dict, (setter)PyObject_GenericSetDict, 0, 0},
11092 {
"__dict__", (getter)__Pyx_CyFunction_get_dict, (setter)PyObject_GenericSetDict, 0, 0},
11094 {
"func_dict", (getter)PyObject_GenericGetDict, (setter)PyObject_GenericSetDict, 0, 0},
11095 {
"__dict__", (getter)PyObject_GenericGetDict, (setter)PyObject_GenericSetDict, 0, 0},
11097 {
"func_globals", (getter)__Pyx_CyFunction_get_globals, 0, 0, 0},
11098 {
"__globals__", (getter)__Pyx_CyFunction_get_globals, 0, 0, 0},
11099 {
"func_closure", (getter)__Pyx_CyFunction_get_closure, 0, 0, 0},
11100 {
"__closure__", (getter)__Pyx_CyFunction_get_closure, 0, 0, 0},
11101 {
"func_code", (getter)__Pyx_CyFunction_get_code, 0, 0, 0},
11102 {
"__code__", (getter)__Pyx_CyFunction_get_code, 0, 0, 0},
11103 {
"func_defaults", (getter)__Pyx_CyFunction_get_defaults, (setter)__Pyx_CyFunction_set_defaults, 0, 0},
11104 {
"__defaults__", (getter)__Pyx_CyFunction_get_defaults, (setter)__Pyx_CyFunction_set_defaults, 0, 0},
11105 {
"__kwdefaults__", (getter)__Pyx_CyFunction_get_kwdefaults, (setter)__Pyx_CyFunction_set_kwdefaults, 0, 0},
11106 {
"__annotations__", (getter)__Pyx_CyFunction_get_annotations, (setter)__Pyx_CyFunction_set_annotations, 0, 0},
11107 {
"__annotate__", (getter)__Pyx_CyFunction_get_annotate, (setter)__Pyx_CyFunction_set_annotate, 0, 0},
11108#if __PYX_LIMITED_VERSION_HEX < 0x030B0000
11109 {
"_is_coroutine", (getter)__Pyx_CyFunction_get_is_coroutine, 0, 0, 0},
11111#if CYTHON_COMPILING_IN_LIMITED_API
11112 {
"__module__", (getter)__Pyx_CyFunction_get_module, (setter)__Pyx_CyFunction_set_module, 0, 0},
11116static PyMemberDef __pyx_CyFunction_members[] = {
11117#if !CYTHON_COMPILING_IN_LIMITED_API
11118 {
"__module__", T_OBJECT, offsetof(PyCFunctionObject, m_module), 0, 0},
11120#if PY_VERSION_HEX < 0x030C0000 || CYTHON_COMPILING_IN_LIMITED_API
11121 {
"__dictoffset__", T_PYSSIZET, offsetof(__pyx_CyFunctionObject, func_dict),
11122 __PYX_SHARED_RELATIVE_OFFSET | READONLY, 0},
11124#if CYTHON_VECTORCALL
11125#if CYTHON_COMPILING_IN_LIMITED_API || CYTHON_COMPILING_IN_PYPY
11126 {
"__vectorcalloffset__", T_PYSSIZET, offsetof(__pyx_CyFunctionObject, func_vectorcall),
11127 __PYX_SHARED_RELATIVE_OFFSET | READONLY, 0},
11129 {
"__vectorcalloffset__", T_PYSSIZET, offsetof(PyCFunctionObject, vectorcall), READONLY, 0},
11131#if CYTHON_COMPILING_IN_LIMITED_API
11132 {
"__weaklistoffset__", T_PYSSIZET, offsetof(__pyx_CyFunctionObject, func_weakreflist),
11133 __PYX_SHARED_RELATIVE_OFFSET | READONLY, 0},
11135 {
"__weaklistoffset__", T_PYSSIZET, offsetof(PyCFunctionObject, m_weakreflist), READONLY, 0},
11141__Pyx_CyFunction_reduce(PyObject *m_in, PyObject *args)
11143 PyObject *result = NULL;
11144 __pyx_CyFunctionObject *m = __Pyx_as_CyFunctionObject(m_in);
11145 CYTHON_UNUSED_VAR(args);
11146 __Pyx_BEGIN_CRITICAL_SECTION(m_in);
11147 Py_INCREF(m->func_qualname);
11148 result = m->func_qualname;
11149 __Pyx_END_CRITICAL_SECTION();
11152static PyMethodDef __pyx_CyFunction_methods[] = {
11153 {
"__annotate_cython__", __Pyx_CyFunction_annotate_impl, METH_O,
11154 "Placeholder __annotate__ function to allow 'functools.wraps' to work "
11155 "on Cython functions."},
11156 {
"__reduce__", (PyCFunction)__Pyx_CyFunction_reduce, METH_NOARGS, 0},
11160__Pyx_CyFunction_get_annotate(PyObject *op_in,
void *context) {
11161 PyObject *annotate = NULL;
11162 CYTHON_UNUSED_VAR(context);
11163 if (unlikely(__Pyx_CyFunction_get_annotate_from_dict_if_exists(op_in, &annotate) < 0))
return NULL;
11164 if (annotate)
return annotate;
11165 PyObject *method = PyCFunction_New(
11166 &__pyx_CyFunction_methods[0],
11170#if CYTHON_COMPILING_IN_LIMITED_API
11171#define __Pyx_CyFunction_weakreflist(cyfunc) ((cyfunc)->func_weakreflist)
11173#define __Pyx_CyFunction_weakreflist(cyfunc) (((PyCFunctionObject*)cyfunc)->m_weakreflist)
11175static PyObject *__Pyx_CyFunction_Init(PyObject *op_in,
11176 PyMethodDef *ml,
int flags, PyObject* qualname,
11177 PyObject *closure, PyObject *module, PyObject* globals, PyObject* code) {
11178 __pyx_CyFunctionObject* op = __Pyx_as_CyFunctionObject(op_in);
11179#if !CYTHON_COMPILING_IN_LIMITED_API
11180 PyCFunctionObject *cf = (PyCFunctionObject*) op;
11182 if (unlikely(op == NULL))
11184#if CYTHON_COMPILING_IN_LIMITED_API
11185 op->func_methoddef = ml;
11187 op->func_module =
module;
11190 __Pyx_CyFunction_weakreflist(op) = NULL;
11191#if !CYTHON_COMPILING_IN_LIMITED_API
11193 cf->m_self = (PyObject *) op;
11195 Py_XINCREF(closure);
11196 op->func_closure = closure;
11197#if !CYTHON_COMPILING_IN_LIMITED_API
11198 Py_XINCREF(module);
11199 cf->m_module =
module;
11201#if PY_VERSION_HEX < 0x030C0000 || CYTHON_COMPILING_IN_LIMITED_API
11202 op->func_dict = NULL;
11204 op->func_name = NULL;
11205 Py_INCREF(qualname);
11206 op->func_qualname = qualname;
11207 op->func_doc = NULL;
11208#if CYTHON_COMPILING_IN_LIMITED_API
11209 op->func_classobj = NULL;
11211 ((PyCMethodObject*)op)->mm_class = NULL;
11213 op->func_globals = globals;
11214 Py_INCREF(op->func_globals);
11216 op->func_code = code;
11217 op->defaults = NULL;
11218 op->defaults_tuple = NULL;
11219 op->defaults_kwdict = NULL;
11220 op->defaults_getter = NULL;
11221 op->func_annotations = NULL;
11222#if __PYX_LIMITED_VERSION_HEX < 0x030B0000
11223 op->func_is_coroutine = NULL;
11225#if CYTHON_VECTORCALL
11226 switch (ml->ml_flags & (METH_VARARGS | METH_FASTCALL | METH_NOARGS | METH_O | METH_KEYWORDS | METH_METHOD)) {
11228 __Pyx_CyFunction_func_vectorcall(op) = __Pyx_CyFunction_Vectorcall_NOARGS;
11231 __Pyx_CyFunction_func_vectorcall(op) = __Pyx_CyFunction_Vectorcall_O;
11233 case METH_METHOD | METH_FASTCALL | METH_KEYWORDS:
11234 __Pyx_CyFunction_func_vectorcall(op) = __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS_METHOD;
11236 case METH_FASTCALL | METH_KEYWORDS:
11237 __Pyx_CyFunction_func_vectorcall(op) = __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS;
11239 case METH_VARARGS | METH_KEYWORDS:
11240 __Pyx_CyFunction_func_vectorcall(op) = NULL;
11243 PyErr_SetString(PyExc_SystemError,
"Bad call flags for CyFunction");
11250static int __Pyx__CyFunction_clear(__pyx_CyFunctionObject *m)
11252 Py_CLEAR(m->func_closure);
11253#if CYTHON_COMPILING_IN_LIMITED_API
11254 Py_CLEAR(m->func_module);
11256 Py_CLEAR(((PyCFunctionObject*)m)->m_module);
11258#if PY_VERSION_HEX < 0x030C0000 || CYTHON_COMPILING_IN_LIMITED_API
11259 Py_CLEAR(m->func_dict);
11260#elif PY_VERSION_HEX < 0x030d0000
11261 _PyObject_ClearManagedDict((PyObject*)m);
11263 PyObject_ClearManagedDict((PyObject*)m);
11265 Py_CLEAR(m->func_name);
11266 Py_CLEAR(m->func_qualname);
11267 Py_CLEAR(m->func_doc);
11268 Py_CLEAR(m->func_globals);
11269 Py_CLEAR(m->func_code);
11270#if CYTHON_COMPILING_IN_LIMITED_API
11271 Py_CLEAR(m->func_classobj);
11274 PyObject *cls = (PyObject*) ((PyCMethodObject *) (m))->mm_class;
11275 ((PyCMethodObject *) (m))->mm_class = NULL;
11279 Py_CLEAR(m->defaults_tuple);
11280 Py_CLEAR(m->defaults_kwdict);
11281 Py_CLEAR(m->func_annotations);
11282#if __PYX_LIMITED_VERSION_HEX < 0x030B0000
11283 Py_CLEAR(m->func_is_coroutine);
11285 Py_CLEAR(m->defaults);
11289__Pyx_CyFunction_clear(PyObject *m)
11291 return __Pyx__CyFunction_clear(__Pyx_as_CyFunctionObject(m));
11293static void __Pyx__CyFunction_dealloc(PyObject *m)
11295 __pyx_CyFunctionObject *cyfunc = __Pyx_as_CyFunctionObject(m);
11296 if (__Pyx_CyFunction_weakreflist(cyfunc) != NULL)
11297 PyObject_ClearWeakRefs(m);
11298 __Pyx__CyFunction_clear(cyfunc);
11299 __Pyx_PyHeapTypeObject_GC_Del(m);
11301static void __Pyx_CyFunction_dealloc(PyObject *m)
11303 PyObject_GC_UnTrack(m);
11304 __Pyx__CyFunction_dealloc(m);
11306static int __Pyx_CyFunction_traverse(PyObject *m_in, visitproc visit,
void *arg)
11308 __pyx_CyFunctionObject *m = __Pyx_as_CyFunctionObject(m_in);
11310 int e = __Pyx_call_type_traverse(m_in, 1, visit, arg);
11313 Py_VISIT(m->func_closure);
11314#if CYTHON_COMPILING_IN_LIMITED_API
11315 Py_VISIT(m->func_module);
11317 Py_VISIT(((PyCFunctionObject*)m)->m_module);
11319#if PY_VERSION_HEX < 0x030C0000 || CYTHON_COMPILING_IN_LIMITED_API
11320 Py_VISIT(m->func_dict);
11324#if PY_VERSION_HEX < 0x030d0000
11325 _PyObject_VisitManagedDict
11327 PyObject_VisitManagedDict
11329 ((PyObject*)m, visit, arg);
11330 if (e != 0)
return e;
11333 __Pyx_VISIT_CONST(m->func_name);
11334 __Pyx_VISIT_CONST(m->func_qualname);
11335 Py_VISIT(m->func_doc);
11336 Py_VISIT(m->func_globals);
11337 __Pyx_VISIT_CONST(m->func_code);
11338 Py_VISIT(__Pyx__CyFunction_GetClassObj(m));
11339 Py_VISIT(m->defaults_tuple);
11340 Py_VISIT(m->defaults_kwdict);
11341 Py_VISIT(m->func_annotations);
11342#if __PYX_LIMITED_VERSION_HEX < 0x030B0000
11343 Py_VISIT(m->func_is_coroutine);
11345 Py_VISIT(m->defaults);
11349__Pyx_CyFunction_repr(PyObject *op_in)
11351 __pyx_CyFunctionObject *op = __Pyx_as_CyFunctionObject(op_in);
11353 __Pyx_BEGIN_CRITICAL_SECTION(op_in);
11354 repr = PyUnicode_FromFormat(
"<cyfunction %U at %p>",
11355 op->func_qualname, (
void *)op);
11356 __Pyx_END_CRITICAL_SECTION();
11359static PyObject * __Pyx_CyFunction_CallMethod(PyObject *func, PyObject *self, PyObject *arg, PyObject *kw) {
11360#if CYTHON_COMPILING_IN_LIMITED_API
11361 __pyx_CyFunctionObject *cyfunc = __Pyx_as_CyFunctionObject(func);
11362 PyCFunction meth = cyfunc->func_methoddef->ml_meth;
11363 int flags = cyfunc->func_methoddef->ml_flags;
11365 PyCFunctionObject*
f = (PyCFunctionObject*)func;
11366 PyCFunction meth =
f->m_ml->ml_meth;
11367 int flags =
f->m_ml->ml_flags;
11370 switch (flags & (METH_VARARGS | METH_KEYWORDS | METH_NOARGS | METH_O)) {
11372 if (likely(kw == NULL || PyDict_Size(kw) == 0))
11373 return (*meth)(self, arg);
11375 case METH_VARARGS | METH_KEYWORDS:
11376 return (*(PyCFunctionWithKeywords)(
void(*)(
void))meth)(self, arg, kw);
11378 if (likely(kw == NULL || PyDict_Size(kw) == 0)) {
11379#if CYTHON_ASSUME_SAFE_SIZE
11380 size = PyTuple_GET_SIZE(arg);
11382 size = PyTuple_Size(arg);
11383 if (unlikely(size < 0))
return NULL;
11385 if (likely(size == 0))
11386 return (*meth)(self, NULL);
11387 __Pyx_CyFunction_raise_argument_count_error(
11389 "takes no arguments", size);
11394 if (likely(kw == NULL || PyDict_Size(kw) == 0)) {
11395#if CYTHON_ASSUME_SAFE_SIZE
11396 size = PyTuple_GET_SIZE(arg);
11398 size = PyTuple_Size(arg);
11399 if (unlikely(size < 0))
return NULL;
11401 if (likely(size == 1)) {
11402 PyObject *result, *arg0;
11403 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
11404 arg0 = PyTuple_GET_ITEM(arg, 0);
11406 arg0 = __Pyx_PySequence_ITEM(arg, 0);
if (unlikely(!arg0))
return NULL;
11408 result = (*meth)(self, arg0);
11409 #if !(CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS)
11414 __Pyx_CyFunction_raise_argument_count_error(
11416 "takes exactly one argument", size);
11421 PyErr_SetString(PyExc_SystemError,
"Bad call flags for CyFunction");
11424 __Pyx_CyFunction_raise_type_error(
11425 func,
"takes no keyword arguments");
11428static CYTHON_INLINE PyObject *__Pyx_CyFunction_Call(PyObject *func, PyObject *arg, PyObject *kw) {
11430 result = __Pyx_CyFunction_CallMethod(func, func, arg, kw);
11433static PyObject *__Pyx_CyFunction_CallAsMethod(PyObject *func, PyObject *args, PyObject *kw) {
11435 __pyx_CyFunctionObject *cyfunc = __Pyx_as_CyFunctionObject(func);
11436#if CYTHON_VECTORCALL
11437 __pyx_vectorcallfunc vc = __Pyx_CyFunction_func_vectorcall(cyfunc);
11439#if CYTHON_ASSUME_SAFE_MACROS && CYTHON_ASSUME_SAFE_SIZE
11440 return __Pyx_PyVectorcall_FastCallDict(func, vc, &PyTuple_GET_ITEM(args, 0), (
size_t)PyTuple_GET_SIZE(args), kw);
11442 (void) &__Pyx_PyVectorcall_FastCallDict;
11443 return PyVectorcall_Call(func, args, kw);
11447 if ((cyfunc->flags & __Pyx_CYFUNCTION_CCLASS) && !(cyfunc->flags & __Pyx_CYFUNCTION_STATICMETHOD)) {
11449 PyObject *new_args;
11451#if CYTHON_ASSUME_SAFE_SIZE
11452 argc = PyTuple_GET_SIZE(args);
11454 argc = PyTuple_Size(args);
11455 if (unlikely(argc < 0))
return NULL;
11457 new_args = PyTuple_GetSlice(args, 1, argc);
11458 if (unlikely(!new_args))
11460 self = PyTuple_GetItem(args, 0);
11461 if (unlikely(!self)) {
11462 Py_DECREF(new_args);
11463 PyErr_Format(PyExc_TypeError,
11464 "unbound method %.200S() needs an argument",
11465 cyfunc->func_qualname);
11468 result = __Pyx_CyFunction_CallMethod(func, self, new_args, kw);
11469 Py_DECREF(new_args);
11471 result = __Pyx_CyFunction_Call(func, args, kw);
11475#if CYTHON_VECTORCALL
11476static CYTHON_INLINE
int __Pyx_CyFunction_Vectorcall_CheckArgs(PyObject *func, __pyx_CyFunctionObject *cyfunc, Py_ssize_t nargs, PyObject *kwnames)
11479 if ((cyfunc->flags & __Pyx_CYFUNCTION_CCLASS) && !(cyfunc->flags & __Pyx_CYFUNCTION_STATICMETHOD)) {
11480 if (unlikely(nargs < 1)) {
11481 __Pyx_CyFunction_raise_type_error(
11482 func,
"needs an argument");
11487 if (unlikely(kwnames) && unlikely(__Pyx_PyTuple_GET_SIZE(kwnames))) {
11488 __Pyx_CyFunction_raise_type_error(
11489 func,
"takes no keyword arguments");
11494static PyObject * __Pyx_CyFunction_Vectorcall_NOARGS(PyObject *func, PyObject *
const *args,
size_t nargsf, PyObject *kwnames)
11496 __pyx_CyFunctionObject *cyfunc = __Pyx_as_CyFunctionObject(func);
11497 Py_ssize_t nargs = PyVectorcall_NARGS(nargsf);
11499#if CYTHON_COMPILING_IN_LIMITED_API
11500 PyCFunction meth = cyfunc->func_methoddef->ml_meth;
11501 if (unlikely(!meth))
return NULL;
11503 PyCFunction meth = ((PyCFunctionObject*)cyfunc)->m_ml->ml_meth;
11505 switch (__Pyx_CyFunction_Vectorcall_CheckArgs(func, cyfunc, nargs, kwnames)) {
11517 if (unlikely(nargs != 0)) {
11518 __Pyx_CyFunction_raise_argument_count_error(
11519 func,
"takes no arguments", nargs);
11522 return meth(self, NULL);
11524static PyObject * __Pyx_CyFunction_Vectorcall_O(PyObject *func, PyObject *
const *args,
size_t nargsf, PyObject *kwnames)
11526 __pyx_CyFunctionObject *cyfunc = __Pyx_as_CyFunctionObject(func);
11527 Py_ssize_t nargs = PyVectorcall_NARGS(nargsf);
11529#if CYTHON_COMPILING_IN_LIMITED_API
11530 PyCFunction meth = cyfunc->func_methoddef->ml_meth;
11531 if (unlikely(!meth))
return NULL;
11533 PyCFunction meth = ((PyCFunctionObject*)cyfunc)->m_ml->ml_meth;
11535 switch (__Pyx_CyFunction_Vectorcall_CheckArgs(func, cyfunc, nargs, kwnames)) {
11547 if (unlikely(nargs != 1)) {
11548 __Pyx_CyFunction_raise_argument_count_error(
11549 func,
"takes exactly one argument", nargs);
11552 return meth(self, args[0]);
11554static PyObject * __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS(PyObject *func, PyObject *
const *args,
size_t nargsf, PyObject *kwnames)
11556 __pyx_CyFunctionObject *cyfunc = __Pyx_as_CyFunctionObject(func);
11557 Py_ssize_t nargs = PyVectorcall_NARGS(nargsf);
11559#if CYTHON_COMPILING_IN_LIMITED_API
11560 PyCFunction meth = cyfunc->func_methoddef->ml_meth;
11561 if (unlikely(!meth))
return NULL;
11563 PyCFunction meth = ((PyCFunctionObject*)cyfunc)->m_ml->ml_meth;
11565 switch (__Pyx_CyFunction_Vectorcall_CheckArgs(func, cyfunc, nargs, NULL)) {
11577 return ((__Pyx_PyCFunctionFastWithKeywords)(
void(*)(
void))meth)(self, args, nargs, kwnames);
11579static PyObject * __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS_METHOD(PyObject *func, PyObject *
const *args,
size_t nargsf, PyObject *kwnames)
11581 __pyx_CyFunctionObject *cyfunc = __Pyx_as_CyFunctionObject(func);
11582 PyTypeObject *cls = (PyTypeObject *) __Pyx__CyFunction_GetClassObj(cyfunc);
11583 Py_ssize_t nargs = PyVectorcall_NARGS(nargsf);
11585#if CYTHON_COMPILING_IN_LIMITED_API
11586 PyCFunction meth = cyfunc->func_methoddef->ml_meth;
11587 if (unlikely(!meth))
return NULL;
11589 PyCFunction meth = ((PyCFunctionObject*)cyfunc)->m_ml->ml_meth;
11591 switch (__Pyx_CyFunction_Vectorcall_CheckArgs(func, cyfunc, nargs, NULL)) {
11603 #if PY_VERSION_HEX < 0x030e00A6
11604 size_t nargs_value = (size_t) nargs;
11606 Py_ssize_t nargs_value = nargs;
11608 return ((__Pyx_PyCMethod)(
void(*)(
void))meth)(self, cls, args, nargs_value, kwnames);
11611static PyType_Slot __pyx_CyFunctionType_slots[] = {
11612 {Py_tp_dealloc, (
void *)__Pyx_CyFunction_dealloc},
11613 {Py_tp_repr, (
void *)__Pyx_CyFunction_repr},
11614 {Py_tp_call, (
void *)__Pyx_CyFunction_CallAsMethod},
11615 {Py_tp_traverse, (
void *)__Pyx_CyFunction_traverse},
11616 {Py_tp_clear, (
void *)__Pyx_CyFunction_clear},
11617 {Py_tp_methods, (
void *)__pyx_CyFunction_methods},
11618 {Py_tp_members, (
void *)__pyx_CyFunction_members},
11619 {Py_tp_getset, (
void *)__pyx_CyFunction_getsets},
11620 {Py_tp_descr_get, (
void *)__Pyx_PyMethod_New},
11623static PyType_Spec __pyx_CyFunctionType_spec = {
11624 __PYX_TYPE_MODULE_PREFIX
"cython_function_or_method",
11625 __PYX_SHARED_SIZEOF(__pyx_CyFunctionObject),
11627#ifdef Py_TPFLAGS_METHOD_DESCRIPTOR
11628 Py_TPFLAGS_METHOD_DESCRIPTOR |
11630#if CYTHON_VECTORCALL
11631#if defined(Py_TPFLAGS_HAVE_VECTORCALL)
11632 Py_TPFLAGS_HAVE_VECTORCALL |
11633#elif defined(_Py_TPFLAGS_HAVE_VECTORCALL)
11634 _Py_TPFLAGS_HAVE_VECTORCALL |
11637#if PY_VERSION_HEX >= 0x030C0000 && !CYTHON_COMPILING_IN_LIMITED_API
11638 Py_TPFLAGS_MANAGED_DICT |
11640 Py_TPFLAGS_IMMUTABLETYPE | Py_TPFLAGS_DISALLOW_INSTANTIATION |
11641 Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC | Py_TPFLAGS_BASETYPE,
11642 __pyx_CyFunctionType_slots
11644static int __pyx_CyFunction_init(PyObject *module) {
11645 __pyx_mstatetype *mstate = __Pyx_PyModule_GetState(module);
11646 mstate->__pyx_CyFunctionType = __Pyx_FetchCommonTypeFromSpec(
11647 mstate->__pyx_CommonTypesMetaclassType, module, &__pyx_CyFunctionType_spec, NULL);
11648 if (unlikely(mstate->__pyx_CyFunctionType == NULL)) {
11655static PyObject *__Pyx_CyFunction_New(PyMethodDef *ml,
int flags, PyObject* qualname,
11656 PyObject *closure, PyObject *module, PyObject* globals, PyObject* code) {
11657 (void)&__Pyx_Get_CyFunction_Type;
11658 PyObject *op = __Pyx_CyFunction_Init(
11659 PyObject_GC_New(PyObject, __pyx_mstate_global->__pyx_CyFunctionType),
11660 ml, flags, qualname, closure, module, globals, code
11663 PyObject_GC_Track(op);
11667static PyTypeObject *__Pyx_Get_CyFunction_Type(
void) {
11668 PyTypeObject *tp = __pyx_mstate_global->__pyx_CyFunctionType;
11669 Py_INCREF((PyObject*)tp);
11674static PyObject *__Pyx_CalculateMetaclass(PyTypeObject *metaclass, PyObject *bases) {
11675 Py_ssize_t i, nbases;
11676#if CYTHON_ASSUME_SAFE_SIZE
11677 nbases = PyTuple_GET_SIZE(bases);
11679 nbases = PyTuple_Size(bases);
11680 if (nbases < 0)
return NULL;
11682 for (i=0; i < nbases; i++) {
11683 PyTypeObject *tmptype;
11684#if CYTHON_ASSUME_SAFE_MACROS
11685 PyObject *tmp = PyTuple_GET_ITEM(bases, i);
11687 PyObject *tmp = PyTuple_GetItem(bases, i);
11688 if (!tmp)
return NULL;
11690 tmptype = Py_TYPE(tmp);
11692 metaclass = tmptype;
11695 if (PyType_IsSubtype(metaclass, tmptype))
11697 if (PyType_IsSubtype(tmptype, metaclass)) {
11698 metaclass = tmptype;
11701 PyErr_SetString(PyExc_TypeError,
11702 "metaclass conflict: "
11703 "the metaclass of a derived class "
11704 "must be a (non-strict) subclass "
11705 "of the metaclasses of all its bases");
11709 metaclass = &PyType_Type;
11711 Py_INCREF((PyObject*) metaclass);
11712 return (PyObject*) metaclass;
11716static CYTHON_INLINE PyObject* __Pyx_PyObject_Call2Args(PyObject* function, PyObject* arg1, PyObject* arg2) {
11717 PyObject *args[3] = {NULL, arg1, arg2};
11718 return __Pyx_PyObject_FastCall(function, args+1, 2 | __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET);
11722#if CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
11723static CYTHON_INLINE PyObject* __Pyx__PyObject_LookupSpecial(PyObject* obj, PyObject* attr_name,
int with_error) {
11725 PyTypeObject *tp = Py_TYPE(obj);
11726 res = _PyType_Lookup(tp, attr_name);
11728 descrgetfunc
f = Py_TYPE(res)->tp_descr_get;
11732 res =
f(res, obj, (PyObject *)tp);
11734 }
else if (with_error) {
11735 PyErr_SetObject(PyExc_AttributeError, attr_name);
11742static PyObject *__Pyx_Py3MetaclassPrepare(PyObject *metaclass, PyObject *bases, PyObject *name,
11743 PyObject *qualname, PyObject *mkw, PyObject *modname, PyObject *doc) {
11746 PyObject *prep = __Pyx_PyObject_GetAttrStrNoError(metaclass, __pyx_mstate_global->__pyx_n_u_prepare);
11748 PyObject *pargs[3] = {NULL, name, bases};
11749 ns = __Pyx_PyObject_FastCallDict(prep, pargs+1, 2 | __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET, mkw);
11752 if (unlikely(PyErr_Occurred()))
11761 if (unlikely(PyObject_SetItem(
ns, __pyx_mstate_global->__pyx_n_u_module, modname) < 0))
goto bad;
11762 if (unlikely(PyObject_SetItem(
ns, __pyx_mstate_global->__pyx_n_u_qualname, qualname) < 0))
goto bad;
11763 if (unlikely(doc && PyObject_SetItem(
ns, __pyx_mstate_global->__pyx_n_u_doc, doc) < 0))
goto bad;
11769static PyObject *__Pyx_Py3ClassCreate(PyObject *metaclass, PyObject *name, PyObject *bases,
11770 PyObject *dict, PyObject *mkw,
11771 int calculate_metaclass,
int allow_py2_metaclass) {
11773 PyObject *owned_metaclass = NULL;
11774 PyObject *margs[4] = {NULL, name, bases, dict};
11775 if (allow_py2_metaclass) {
11776 owned_metaclass = PyObject_GetItem(dict, __pyx_mstate_global->__pyx_n_u_metaclass);
11777 if (owned_metaclass) {
11778 metaclass = owned_metaclass;
11779 }
else if (likely(PyErr_ExceptionMatches(PyExc_KeyError))) {
11785 if (calculate_metaclass && (!metaclass || PyType_Check(metaclass))) {
11786 metaclass = __Pyx_CalculateMetaclass((PyTypeObject*) metaclass, bases);
11787 Py_XDECREF(owned_metaclass);
11788 if (unlikely(!metaclass))
11790 owned_metaclass = metaclass;
11792 result = __Pyx_PyObject_FastCallDict(metaclass, margs+1, 3 | __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET, mkw);
11793 Py_XDECREF(owned_metaclass);
11798#if CYTHON_CLINE_IN_TRACEBACK && CYTHON_CLINE_IN_TRACEBACK_RUNTIME
11799#if CYTHON_COMPILING_IN_LIMITED_API && __PYX_LIMITED_VERSION_HEX < 0x030A0000
11800#define __Pyx_PyProbablyModule_GetDict(o) __Pyx_XNewRef(PyModule_GetDict(o))
11801#elif !CYTHON_COMPILING_IN_CPYTHON || CYTHON_COMPILING_IN_CPYTHON_FREETHREADING
11802#define __Pyx_PyProbablyModule_GetDict(o) PyObject_GenericGetDict(o, NULL);
11804PyObject* __Pyx_PyProbablyModule_GetDict(PyObject *o) {
11805 PyObject **dict_ptr = _PyObject_GetDictPtr(o);
11806 return dict_ptr ? __Pyx_XNewRef(*dict_ptr) : NULL;
11809static int __Pyx_CLineForTraceback(PyThreadState *tstate,
int c_line) {
11810 PyObject *use_cline = NULL;
11811 PyObject *ptype, *pvalue, *ptraceback;
11812 PyObject *cython_runtime_dict;
11813 CYTHON_MAYBE_UNUSED_VAR(tstate);
11814 if (unlikely(!__pyx_mstate_global->__pyx_cython_runtime)) {
11817 __Pyx_ErrFetchInState(tstate, &ptype, &pvalue, &ptraceback);
11818 cython_runtime_dict = __Pyx_PyProbablyModule_GetDict(__pyx_mstate_global->__pyx_cython_runtime);
11819 if (likely(cython_runtime_dict)) {
11820 __PYX_PY_DICT_LOOKUP_IF_MODIFIED(
11821 use_cline, cython_runtime_dict,
11822 __Pyx_PyDict_SetDefault(cython_runtime_dict, __pyx_mstate_global->__pyx_n_u_cline_in_traceback, Py_False))
11824 if (use_cline == NULL || use_cline == Py_False || (use_cline != Py_True && PyObject_Not(use_cline) != 0)) {
11827 Py_XDECREF(use_cline);
11828 Py_XDECREF(cython_runtime_dict);
11829 __Pyx_ErrRestoreInState(tstate, ptype, pvalue, ptraceback);
11835static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries,
int count,
int code_line) {
11836 int start = 0, mid = 0, end = count - 1;
11837 if (end >= 0 && code_line > entries[end].code_line) {
11840 while (start < end) {
11841 mid = start + (end - start) / 2;
11842 if (code_line < entries[mid].code_line) {
11844 }
else if (code_line > entries[mid].code_line) {
11850 if (code_line <= entries[mid].code_line) {
11856static __Pyx_CachedCodeObjectType *__pyx__find_code_object(
struct __Pyx_CodeObjectCache *code_cache,
int code_line) {
11857 __Pyx_CachedCodeObjectType* code_object;
11859 if (unlikely(!code_line) || unlikely(!code_cache->entries)) {
11862 pos = __pyx_bisect_code_objects(code_cache->entries, code_cache->count, code_line);
11863 if (unlikely(pos >= code_cache->count) || unlikely(code_cache->entries[pos].code_line != code_line)) {
11866 code_object = code_cache->entries[pos].code_object;
11867 Py_INCREF(code_object);
11868 return code_object;
11870static __Pyx_CachedCodeObjectType *__pyx_find_code_object(
int code_line) {
11871#if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING && !CYTHON_ATOMICS
11872 (void)__pyx__find_code_object;
11875 struct __Pyx_CodeObjectCache *code_cache = &__pyx_mstate_global->__pyx_code_cache;
11876#if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING
11877 __pyx_nonatomic_int_type old_count = __pyx_atomic_incr_acq_rel(&code_cache->accessor_count);
11878 if (old_count < 0) {
11879 __pyx_atomic_decr_acq_rel(&code_cache->accessor_count);
11883 __Pyx_CachedCodeObjectType *result = __pyx__find_code_object(code_cache, code_line);
11884#if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING
11885 __pyx_atomic_decr_acq_rel(&code_cache->accessor_count);
11890static void __pyx__insert_code_object(
struct __Pyx_CodeObjectCache *code_cache,
int code_line, __Pyx_CachedCodeObjectType* code_object)
11893 __Pyx_CodeObjectCacheEntry* entries = code_cache->entries;
11894 if (unlikely(!code_line)) {
11897 if (unlikely(!entries)) {
11898 entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Malloc(64*
sizeof(__Pyx_CodeObjectCacheEntry));
11899 if (likely(entries)) {
11900 code_cache->entries = entries;
11901 code_cache->max_count = 64;
11902 code_cache->count = 1;
11903 entries[0].code_line = code_line;
11904 entries[0].code_object = code_object;
11905 Py_INCREF(code_object);
11909 pos = __pyx_bisect_code_objects(code_cache->entries, code_cache->count, code_line);
11910 if ((pos < code_cache->count) && unlikely(code_cache->entries[pos].code_line == code_line)) {
11911 __Pyx_CachedCodeObjectType* tmp = entries[pos].code_object;
11912 entries[pos].code_object = code_object;
11913 Py_INCREF(code_object);
11917 if (code_cache->count == code_cache->max_count) {
11918 int new_max = code_cache->max_count + 64;
11919 entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Realloc(
11920 code_cache->entries, ((
size_t)new_max) *
sizeof(__Pyx_CodeObjectCacheEntry));
11921 if (unlikely(!entries)) {
11924 code_cache->entries = entries;
11925 code_cache->max_count = new_max;
11927 for (i=code_cache->count; i>pos; i--) {
11928 entries[i] = entries[i-1];
11930 entries[pos].code_line = code_line;
11931 entries[pos].code_object = code_object;
11932 code_cache->count++;
11933 Py_INCREF(code_object);
11935static void __pyx_insert_code_object(
int code_line, __Pyx_CachedCodeObjectType* code_object) {
11936#if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING && !CYTHON_ATOMICS
11937 (void)__pyx__insert_code_object;
11940 struct __Pyx_CodeObjectCache *code_cache = &__pyx_mstate_global->__pyx_code_cache;
11941#if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING
11942 __pyx_nonatomic_int_type expected = 0;
11943 if (!__pyx_atomic_int_cmp_exchange(&code_cache->accessor_count, &expected, INT_MIN)) {
11947 __pyx__insert_code_object(code_cache, code_line, code_object);
11948#if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING
11949 __pyx_atomic_sub(&code_cache->accessor_count, INT_MIN);
11955#include "compile.h"
11956#include "frameobject.h"
11957#include "traceback.h"
11958#if PY_VERSION_HEX >= 0x030b00a6 && !CYTHON_COMPILING_IN_LIMITED_API && !defined(PYPY_VERSION)
11959 #ifndef Py_BUILD_CORE
11960 #define Py_BUILD_CORE 1
11962 #include "internal/pycore_frame.h"
11964#if CYTHON_COMPILING_IN_LIMITED_API
11965static PyObject *__Pyx_PyCode_Replace_For_AddTraceback(PyObject *code, PyObject *scratch_dict,
11966 PyObject *firstlineno, PyObject *name) {
11967 PyObject *replace = NULL;
11968 if (unlikely(PyDict_SetItemString(scratch_dict,
"co_firstlineno", firstlineno)))
return NULL;
11969 if (unlikely(PyDict_SetItemString(scratch_dict,
"co_name", name)))
return NULL;
11970 replace = PyObject_GetAttrString(code,
"replace");
11971 if (likely(replace)) {
11972 PyObject *result = PyObject_Call(replace, __pyx_mstate_global->__pyx_empty_tuple, scratch_dict);
11973 Py_DECREF(replace);
11978static void __Pyx_AddTraceback(
const char *funcname,
int c_line,
11979 int py_line,
const char *filename) {
11980 PyObject *code_object = NULL, *py_py_line = NULL, *py_funcname = NULL, *dict = NULL;
11981 PyObject *replace = NULL, *getframe = NULL, *frame = NULL;
11982 PyObject *exc_type, *exc_value, *exc_traceback;
11985 c_line = __Pyx_CLineForTraceback(__Pyx_PyThreadState_Current, c_line);
11987 __Pyx_PyErr_FetchException(&exc_type, &exc_value, &exc_traceback);
11988 code_object = __pyx_find_code_object(c_line ? -c_line : py_line);
11989 if (!code_object) {
11990 code_object = Py_CompileString(
"_getframe()", filename, Py_eval_input);
11991 if (unlikely(!code_object))
goto bad;
11992 py_py_line = PyLong_FromLong(py_line);
11993 if (unlikely(!py_py_line))
goto bad;
11995 py_funcname = PyUnicode_FromFormat(
"%s (%s:%d)", funcname, __pyx_cfilenm, c_line);
11997 py_funcname = PyUnicode_FromString(funcname);
11999 if (unlikely(!py_funcname))
goto bad;
12000 dict = PyDict_New();
12001 if (unlikely(!dict))
goto bad;
12003 PyObject *old_code_object = code_object;
12004 code_object = __Pyx_PyCode_Replace_For_AddTraceback(code_object, dict, py_py_line, py_funcname);
12005 Py_DECREF(old_code_object);
12007 if (unlikely(!code_object))
goto bad;
12008 __pyx_insert_code_object(c_line ? -c_line : py_line, code_object);
12010 dict = PyDict_New();
12012 getframe = PySys_GetObject(
"_getframe");
12013 if (unlikely(!getframe))
goto bad;
12014 if (unlikely(PyDict_SetItemString(dict,
"_getframe", getframe)))
goto bad;
12015 frame = PyEval_EvalCode(code_object, dict, dict);
12016 if (unlikely(!frame) || frame == Py_None)
goto bad;
12019 __Pyx_PyErr_RestoreException(exc_type, exc_value, exc_traceback);
12020 Py_XDECREF(code_object);
12021 Py_XDECREF(py_py_line);
12022 Py_XDECREF(py_funcname);
12024 Py_XDECREF(replace);
12027 (
struct _frame*)frame);
12032static PyCodeObject* __Pyx_CreateCodeObjectForTraceback(
12033 const char *funcname,
int c_line,
12034 int py_line,
const char *filename) {
12035 PyCodeObject *py_code = NULL;
12036 PyObject *py_funcname = NULL;
12038 py_funcname = PyUnicode_FromFormat(
"%s (%s:%d)", funcname, __pyx_cfilenm, c_line);
12039 if (!py_funcname)
goto bad;
12040 funcname = PyUnicode_AsUTF8(py_funcname);
12041 if (!funcname)
goto bad;
12043 py_code = PyCode_NewEmpty(filename, funcname, py_line);
12044 Py_XDECREF(py_funcname);
12047 Py_XDECREF(py_funcname);
12050static void __Pyx_AddTraceback(
const char *funcname,
int c_line,
12051 int py_line,
const char *filename) {
12052 PyCodeObject *py_code = 0;
12053 PyFrameObject *py_frame = 0;
12054 PyThreadState *tstate = __Pyx_PyThreadState_Current;
12055 PyObject *ptype, *pvalue, *ptraceback;
12057 c_line = __Pyx_CLineForTraceback(tstate, c_line);
12059 py_code = __pyx_find_code_object(c_line ? -c_line : py_line);
12061 __Pyx_ErrFetchInState(tstate, &ptype, &pvalue, &ptraceback);
12062 py_code = __Pyx_CreateCodeObjectForTraceback(
12063 funcname, c_line, py_line, filename);
12068 Py_XDECREF(pvalue);
12069 Py_XDECREF(ptraceback);
12072 __Pyx_ErrRestoreInState(tstate, ptype, pvalue, ptraceback);
12073 __pyx_insert_code_object(c_line ? -c_line : py_line, py_code);
12075 py_frame = PyFrame_New(
12078 __pyx_mstate_global->__pyx_d,
12081 if (!py_frame)
goto bad;
12082 __Pyx_PyFrame_SetLineNumber(py_frame, py_line);
12083 PyTraceBack_Here(py_frame);
12085 Py_XDECREF(py_code);
12086 Py_XDECREF(py_frame);
12091static CYTHON_INLINE
long __Pyx_pow_long(
long b,
long e) {
12096 CYTHON_FALLTHROUGH;
12099 CYTHON_FALLTHROUGH;
12106 if (unlikely(e<0))
return 0;
12109 while (likely(e)) {
12110 t *= (b * (e&1)) | ((~e)&1);
12118#define __PYX_VERIFY_RETURN_INT(target_type, func_type, func_value)\
12119 __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 0)
12120#define __PYX_VERIFY_RETURN_INT_EXC(target_type, func_type, func_value)\
12121 __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 1)
12122#define __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, exc)\
12124 func_type value = func_value;\
12125 if (sizeof(target_type) < sizeof(func_type)) {\
12126 if (unlikely(value != (func_type) (target_type) value)) {\
12127 func_type zero = 0;\
12128 if (exc && unlikely(value == (func_type)-1 && PyErr_Occurred()))\
12129 return (target_type) -1;\
12130 if (is_unsigned && unlikely(value < zero))\
12131 goto raise_neg_overflow;\
12133 goto raise_overflow;\
12136 return (target_type) value;\
12140#if CYTHON_CCOMPLEX && (1) && (!0 || __cplusplus)
12142 static CYTHON_INLINE __pyx_t_float_complex __pyx_t_float_complex_from_parts(
float x,
float y) {
12143 return ::std::complex< float >(x, y);
12146 static CYTHON_INLINE __pyx_t_float_complex __pyx_t_float_complex_from_parts(
float x,
float y) {
12147 return x + y*(__pyx_t_float_complex)_Complex_I;
12151 static CYTHON_INLINE __pyx_t_float_complex __pyx_t_float_complex_from_parts(
float x,
float y) {
12152 __pyx_t_float_complex
z;
12160#if CYTHON_CCOMPLEX && (1) && (!0 || __cplusplus)
12162 static CYTHON_INLINE
int __Pyx_c_eq_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
12163 return (a.real == b.real) && (a.imag == b.imag);
12165 static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_sum_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
12166 __pyx_t_float_complex
z;
12167 z.real = a.real + b.real;
12168 z.imag = a.imag + b.imag;
12171 static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_diff_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
12172 __pyx_t_float_complex
z;
12173 z.real = a.real - b.real;
12174 z.imag = a.imag - b.imag;
12177 static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_prod_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
12178 __pyx_t_float_complex
z;
12179 z.real = a.real * b.real - a.imag * b.imag;
12180 z.imag = a.real * b.imag + a.imag * b.real;
12184 static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_quot_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
12186 return __pyx_t_float_complex_from_parts(a.real / b.real, a.imag / b.real);
12187 }
else if (fabsf(b.real) >= fabsf(b.imag)) {
12188 if (b.real == 0 && b.imag == 0) {
12189 return __pyx_t_float_complex_from_parts(a.real / b.real, a.imag / b.imag);
12191 float r = b.imag / b.real;
12192 float s = (float)(1.0) / (b.real + b.imag *
r);
12193 return __pyx_t_float_complex_from_parts(
12194 (a.real + a.imag *
r) *
s, (a.imag - a.real *
r) *
s);
12197 float r = b.real / b.imag;
12198 float s = (float)(1.0) / (b.imag + b.real *
r);
12199 return __pyx_t_float_complex_from_parts(
12200 (a.real *
r + a.imag) *
s, (a.imag *
r - a.real) *
s);
12204 static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_quot_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
12206 return __pyx_t_float_complex_from_parts(a.real / b.real, a.imag / b.real);
12208 float denom = b.real * b.real + b.imag * b.imag;
12209 return __pyx_t_float_complex_from_parts(
12210 (a.real * b.real + a.imag * b.imag) / denom,
12211 (a.imag * b.real - a.real * b.imag) / denom);
12215 static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_neg_float(__pyx_t_float_complex a) {
12216 __pyx_t_float_complex
z;
12221 static CYTHON_INLINE
int __Pyx_c_is_zero_float(__pyx_t_float_complex a) {
12222 return (a.real == 0) && (a.imag == 0);
12224 static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_conj_float(__pyx_t_float_complex a) {
12225 __pyx_t_float_complex
z;
12231 static CYTHON_INLINE
float __Pyx_c_abs_float(__pyx_t_float_complex
z) {
12232 #if !defined(HAVE_HYPOT) || defined(_MSC_VER)
12233 return sqrtf(
z.real*
z.real +
z.imag*
z.imag);
12235 return hypotf(
z.real,
z.imag);
12238 static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_pow_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
12239 __pyx_t_float_complex
z;
12240 float r, lnr, theta, z_r, z_theta;
12241 if (b.imag == 0 && b.real == (
int)b.real) {
12243 float denom = a.real * a.real + a.imag * a.imag;
12244 a.real = a.real / denom;
12245 a.imag = -a.imag / denom;
12248 switch ((
int)b.real) {
12256 return __Pyx_c_prod_float(a, a);
12258 z = __Pyx_c_prod_float(a, a);
12259 return __Pyx_c_prod_float(
z, a);
12261 z = __Pyx_c_prod_float(a, a);
12262 return __Pyx_c_prod_float(
z,
z);
12268 }
else if ((b.imag == 0) && (a.real >= 0)) {
12269 z.real = powf(a.real, b.real);
12272 }
else if (a.real > 0) {
12277 theta = atan2f(0.0, -1.0);
12280 r = __Pyx_c_abs_float(a);
12281 theta = atan2f(a.imag, a.real);
12284 z_r = expf(lnr * b.real - theta * b.imag);
12285 z_theta = theta * b.real + lnr * b.imag;
12286 z.real = z_r * cosf(z_theta);
12287 z.imag = z_r * sinf(z_theta);
12294#if CYTHON_CCOMPLEX && (1) && (!0 || __cplusplus)
12296 static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(
double x,
double y) {
12297 return ::std::complex< double >(x, y);
12300 static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(
double x,
double y) {
12301 return x + y*(__pyx_t_double_complex)_Complex_I;
12305 static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(
double x,
double y) {
12306 __pyx_t_double_complex
z;
12314#if CYTHON_CCOMPLEX && (1) && (!0 || __cplusplus)
12316 static CYTHON_INLINE
int __Pyx_c_eq_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
12317 return (a.real == b.real) && (a.imag == b.imag);
12319 static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_sum_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
12320 __pyx_t_double_complex
z;
12321 z.real = a.real + b.real;
12322 z.imag = a.imag + b.imag;
12325 static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_diff_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
12326 __pyx_t_double_complex
z;
12327 z.real = a.real - b.real;
12328 z.imag = a.imag - b.imag;
12331 static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_prod_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
12332 __pyx_t_double_complex
z;
12333 z.real = a.real * b.real - a.imag * b.imag;
12334 z.imag = a.real * b.imag + a.imag * b.real;
12338 static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_quot_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
12340 return __pyx_t_double_complex_from_parts(a.real / b.real, a.imag / b.real);
12341 }
else if (fabs(b.real) >= fabs(b.imag)) {
12342 if (b.real == 0 && b.imag == 0) {
12343 return __pyx_t_double_complex_from_parts(a.real / b.real, a.imag / b.imag);
12345 double r = b.imag / b.real;
12346 double s = (double)(1.0) / (b.real + b.imag *
r);
12347 return __pyx_t_double_complex_from_parts(
12348 (a.real + a.imag *
r) *
s, (a.imag - a.real *
r) *
s);
12351 double r = b.real / b.imag;
12352 double s = (double)(1.0) / (b.imag + b.real *
r);
12353 return __pyx_t_double_complex_from_parts(
12354 (a.real *
r + a.imag) *
s, (a.imag *
r - a.real) *
s);
12358 static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_quot_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
12360 return __pyx_t_double_complex_from_parts(a.real / b.real, a.imag / b.real);
12362 double denom = b.real * b.real + b.imag * b.imag;
12363 return __pyx_t_double_complex_from_parts(
12364 (a.real * b.real + a.imag * b.imag) / denom,
12365 (a.imag * b.real - a.real * b.imag) / denom);
12369 static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_neg_double(__pyx_t_double_complex a) {
12370 __pyx_t_double_complex
z;
12375 static CYTHON_INLINE
int __Pyx_c_is_zero_double(__pyx_t_double_complex a) {
12376 return (a.real == 0) && (a.imag == 0);
12378 static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_conj_double(__pyx_t_double_complex a) {
12379 __pyx_t_double_complex
z;
12385 static CYTHON_INLINE
double __Pyx_c_abs_double(__pyx_t_double_complex
z) {
12386 #if !defined(HAVE_HYPOT) || defined(_MSC_VER)
12387 return sqrt(
z.real*
z.real +
z.imag*
z.imag);
12389 return hypot(
z.real,
z.imag);
12392 static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_pow_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
12393 __pyx_t_double_complex
z;
12394 double r, lnr, theta, z_r, z_theta;
12395 if (b.imag == 0 && b.real == (
int)b.real) {
12397 double denom = a.real * a.real + a.imag * a.imag;
12398 a.real = a.real / denom;
12399 a.imag = -a.imag / denom;
12402 switch ((
int)b.real) {
12410 return __Pyx_c_prod_double(a, a);
12412 z = __Pyx_c_prod_double(a, a);
12413 return __Pyx_c_prod_double(
z, a);
12415 z = __Pyx_c_prod_double(a, a);
12416 return __Pyx_c_prod_double(
z,
z);
12422 }
else if ((b.imag == 0) && (a.real >= 0)) {
12423 z.real = pow(a.real, b.real);
12426 }
else if (a.real > 0) {
12431 theta = atan2(0.0, -1.0);
12434 r = __Pyx_c_abs_double(a);
12435 theta = atan2(a.imag, a.real);
12438 z_r = exp(lnr * b.real - theta * b.imag);
12439 z_theta = theta * b.real + lnr * b.imag;
12440 z.real = z_r * cos(z_theta);
12441 z.imag = z_r * sin(z_theta);
12448#if CYTHON_CCOMPLEX && (1) && (!0 || __cplusplus)
12450 static CYTHON_INLINE __pyx_t_long_double_complex __pyx_t_long_double_complex_from_parts(
long double x,
long double y) {
12451 return ::std::complex< long double >(x, y);
12454 static CYTHON_INLINE __pyx_t_long_double_complex __pyx_t_long_double_complex_from_parts(
long double x,
long double y) {
12455 return x + y*(__pyx_t_long_double_complex)_Complex_I;
12459 static CYTHON_INLINE __pyx_t_long_double_complex __pyx_t_long_double_complex_from_parts(
long double x,
long double y) {
12460 __pyx_t_long_double_complex
z;
12468#if CYTHON_CCOMPLEX && (1) && (!0 || __cplusplus)
12470 static CYTHON_INLINE
int __Pyx_c_eq_long__double(__pyx_t_long_double_complex a, __pyx_t_long_double_complex b) {
12471 return (a.real == b.real) && (a.imag == b.imag);
12473 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) {
12474 __pyx_t_long_double_complex
z;
12475 z.real = a.real + b.real;
12476 z.imag = a.imag + b.imag;
12479 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) {
12480 __pyx_t_long_double_complex
z;
12481 z.real = a.real - b.real;
12482 z.imag = a.imag - b.imag;
12485 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) {
12486 __pyx_t_long_double_complex
z;
12487 z.real = a.real * b.real - a.imag * b.imag;
12488 z.imag = a.real * b.imag + a.imag * b.real;
12492 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) {
12494 return __pyx_t_long_double_complex_from_parts(a.real / b.real, a.imag / b.real);
12495 }
else if (fabsl(b.real) >= fabsl(b.imag)) {
12496 if (b.real == 0 && b.imag == 0) {
12497 return __pyx_t_long_double_complex_from_parts(a.real / b.real, a.imag / b.imag);
12499 long double r = b.imag / b.real;
12500 long double s = (
long double)(1.0) / (b.real + b.imag *
r);
12501 return __pyx_t_long_double_complex_from_parts(
12502 (a.real + a.imag *
r) *
s, (a.imag - a.real *
r) *
s);
12505 long double r = b.real / b.imag;
12506 long double s = (
long double)(1.0) / (b.imag + b.real *
r);
12507 return __pyx_t_long_double_complex_from_parts(
12508 (a.real *
r + a.imag) *
s, (a.imag *
r - a.real) *
s);
12512 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) {
12514 return __pyx_t_long_double_complex_from_parts(a.real / b.real, a.imag / b.real);
12516 long double denom = b.real * b.real + b.imag * b.imag;
12517 return __pyx_t_long_double_complex_from_parts(
12518 (a.real * b.real + a.imag * b.imag) / denom,
12519 (a.imag * b.real - a.real * b.imag) / denom);
12523 static CYTHON_INLINE __pyx_t_long_double_complex __Pyx_c_neg_long__double(__pyx_t_long_double_complex a) {
12524 __pyx_t_long_double_complex
z;
12529 static CYTHON_INLINE
int __Pyx_c_is_zero_long__double(__pyx_t_long_double_complex a) {
12530 return (a.real == 0) && (a.imag == 0);
12532 static CYTHON_INLINE __pyx_t_long_double_complex __Pyx_c_conj_long__double(__pyx_t_long_double_complex a) {
12533 __pyx_t_long_double_complex
z;
12539 static CYTHON_INLINE
long double __Pyx_c_abs_long__double(__pyx_t_long_double_complex
z) {
12540 #if !defined(HAVE_HYPOT) || defined(_MSC_VER)
12541 return sqrtl(
z.real*
z.real +
z.imag*
z.imag);
12543 return hypotl(
z.real,
z.imag);
12546 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) {
12547 __pyx_t_long_double_complex
z;
12548 long double r, lnr, theta, z_r, z_theta;
12549 if (b.imag == 0 && b.real == (
int)b.real) {
12551 long double denom = a.real * a.real + a.imag * a.imag;
12552 a.real = a.real / denom;
12553 a.imag = -a.imag / denom;
12556 switch ((
int)b.real) {
12564 return __Pyx_c_prod_long__double(a, a);
12566 z = __Pyx_c_prod_long__double(a, a);
12567 return __Pyx_c_prod_long__double(
z, a);
12569 z = __Pyx_c_prod_long__double(a, a);
12570 return __Pyx_c_prod_long__double(
z,
z);
12576 }
else if ((b.imag == 0) && (a.real >= 0)) {
12577 z.real = powl(a.real, b.real);
12580 }
else if (a.real > 0) {
12585 theta = atan2l(0.0, -1.0);
12588 r = __Pyx_c_abs_long__double(a);
12589 theta = atan2l(a.imag, a.real);
12592 z_r = expl(lnr * b.real - theta * b.imag);
12593 z_theta = theta * b.real + lnr * b.imag;
12594 z.real = z_r * cosl(z_theta);
12595 z.imag = z_r * sinl(z_theta);
12602static int __Pyx_LargePyLong___Pyx_PyLong_As_int(PyObject *x);
12603static int __Pyx_raise_neg_overflow___Pyx_PyLong_As_int(
void) {
12604 const char* type_name =
"int";
12605 PyErr_Format(PyExc_OverflowError,
12606 "can't convert negative value to %.200s", type_name);
12609static int __Pyx_raise_overflow___Pyx_PyLong_As_int(
void) {
12610 const char* type_name =
"int";
12611 PyErr_Format(PyExc_OverflowError,
12612 "value too large to convert to %.200s", type_name);
12615static CYTHON_INLINE
int __Pyx_PyULong___Pyx_PyLong_As_int(PyObject *x) {
12616 const int is_unsigned = 1;
12617#if CYTHON_USE_PYLONG_INTERNALS
12619 const digit* digits = __Pyx_PyLong_Digits(x);
12620 const Py_ssize_t size = __Pyx_PyLong_DigitCount(x);
12621 if (size == 2 && (8 *
sizeof(
int) > 1 * PyLong_SHIFT)) {
12622 if ((8 *
sizeof(
unsigned long) > 2 * PyLong_SHIFT)) {
12623 __PYX_VERIFY_RETURN_INT(
int,
unsigned long, (((((
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
12624 }
else if ((8 *
sizeof(
int) >= 2 * PyLong_SHIFT)) {
12625 return (
int) (((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0]));
12628 if (size == 3 && (8 *
sizeof(
int) > 2 * PyLong_SHIFT)) {
12629 if ((8 *
sizeof(
unsigned long) > 3 * PyLong_SHIFT)) {
12630 __PYX_VERIFY_RETURN_INT(
int,
unsigned long, (((((((
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
12631 }
else if ((8 *
sizeof(
int) >= 3 * PyLong_SHIFT)) {
12632 return (
int) (((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]));
12635 if (size == 4 && (8 *
sizeof(
int) > 3 * PyLong_SHIFT)) {
12636 if ((8 *
sizeof(
unsigned long) > 4 * PyLong_SHIFT)) {
12637 __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])))
12638 }
else if ((8 *
sizeof(
int) >= 4 * PyLong_SHIFT)) {
12639 return (
int) (((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]));
12644#elif CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030C00A7
12645 if (unlikely(Py_SIZE(x) < 0)) {
12646 goto raise_neg_overflow;
12650 int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
12651 if (unlikely(result < 0))
12653 if (unlikely(result == 1))
12654 goto raise_neg_overflow;
12657 if ((
sizeof(
int) <=
sizeof(
unsigned long))) {
12658 __PYX_VERIFY_RETURN_INT_EXC(
int,
unsigned long, PyLong_AsUnsignedLong(x))
12659 }
else if ((
sizeof(
int) <=
sizeof(
unsigned PY_LONG_LONG))) {
12660 __PYX_VERIFY_RETURN_INT_EXC(
int,
unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
12662 return __Pyx_LargePyLong___Pyx_PyLong_As_int(x);
12664 return __Pyx_raise_neg_overflow___Pyx_PyLong_As_int();
12666 return __Pyx_raise_overflow___Pyx_PyLong_As_int();
12668static CYTHON_INLINE
int __Pyx_PySLong___Pyx_PyLong_As_int(PyObject *x) {
12669 const int is_unsigned = 0;
12670#if CYTHON_USE_PYLONG_INTERNALS
12671 if (__Pyx_PyLong_IsNeg(x)) {
12672 const Py_ssize_t size = __Pyx_PyLong_DigitCount(x);
12673 const digit* digits = __Pyx_PyLong_Digits(x);
12674 if (size == 2 && (8 *
sizeof(
int) > 1 * PyLong_SHIFT)) {
12675 if ((8 *
sizeof(
long) > 2 * PyLong_SHIFT)) {
12676 long ival = - (long) (((((
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0]));
12677 __PYX_VERIFY_RETURN_INT(
int,
long, ival)
12678 }
else if ((8 *
sizeof(
int) - 1 > 2 * PyLong_SHIFT)) {
12679 return (
int) (((int) -1) * (((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
12682 if (size == 3 && (8 *
sizeof(
int) > 2 * PyLong_SHIFT)) {
12683 if ((8 *
sizeof(
long) > 3 * PyLong_SHIFT)) {
12684 long ival = - (long) (((((((
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0]));
12685 __PYX_VERIFY_RETURN_INT(
int,
long, ival)
12686 }
else if ((8 *
sizeof(
int) - 1 > 3 * PyLong_SHIFT)) {
12687 return (
int) (((int) -1) * (((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
12690 if (size == 4 && (8 *
sizeof(
int) > 3 * PyLong_SHIFT)) {
12691 if ((8 *
sizeof(
long) > 4 * PyLong_SHIFT)) {
12692 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]));
12693 __PYX_VERIFY_RETURN_INT(
int,
long, ival)
12694 }
else if ((8 *
sizeof(
int) - 1 > 4 * PyLong_SHIFT)) {
12695 return (
int) (((int) -1) * (((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
12700 const Py_ssize_t size = __Pyx_PyLong_DigitCount(x);
12701 const digit* digits = __Pyx_PyLong_Digits(x);
12702 if (size == 2 && (8 *
sizeof(
int) > 1 * PyLong_SHIFT)) {
12703 if ((8 *
sizeof(
long) > 2 * PyLong_SHIFT)) {
12704 __PYX_VERIFY_RETURN_INT(
int,
unsigned long, (((((
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
12705 }
else if ((8 *
sizeof(
int) - 1 > 2 * PyLong_SHIFT)) {
12706 return (
int) (((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0]));
12709 if (size == 3 && (8 *
sizeof(
int) > 2 * PyLong_SHIFT)) {
12710 if ((8 *
sizeof(
long) > 3 * PyLong_SHIFT)) {
12711 __PYX_VERIFY_RETURN_INT(
int,
unsigned long, (((((((
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
12712 }
else if ((8 *
sizeof(
int) - 1 > 3 * PyLong_SHIFT)) {
12713 return (
int) (((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]));
12716 if (size == 4 && (8 *
sizeof(
int) > 3 * PyLong_SHIFT)) {
12717 if ((8 *
sizeof(
long) > 4 * PyLong_SHIFT)) {
12718 __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])))
12719 }
else if ((8 *
sizeof(
int) - 1 > 4 * PyLong_SHIFT)) {
12720 return (
int) (((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]));
12726 #if __PYX_LIMITED_VERSION_HEX >= 0x030d0000
12727 if ((
sizeof(
int) <=
sizeof(
int)) && (
sizeof(
int) <
sizeof(
long))) {
12728 __PYX_VERIFY_RETURN_INT_EXC(
int,
int, PyLong_AsInt(x))
12731 if ((
sizeof(
int) <=
sizeof(
long))) {
12732 __PYX_VERIFY_RETURN_INT_EXC(
int,
long, PyLong_AsLong(x))
12733 }
else if ((
sizeof(
int) <=
sizeof(PY_LONG_LONG))) {
12734 __PYX_VERIFY_RETURN_INT_EXC(
int, PY_LONG_LONG, PyLong_AsLongLong(x))
12736 return __Pyx_LargePyLong___Pyx_PyLong_As_int(x);
12738 return __Pyx_raise_neg_overflow___Pyx_PyLong_As_int();
12740 return __Pyx_raise_overflow___Pyx_PyLong_As_int();
12742static int __Pyx_LargePyLong___Pyx_PyLong_As_int(PyObject *x) {
12743#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
12744#pragma GCC diagnostic push
12745#pragma GCC diagnostic ignored "-Wconversion"
12747 const int neg_one = (int) -1, const_zero = (
int) 0;
12748#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
12749#pragma GCC diagnostic pop
12751 const int is_unsigned = neg_one > const_zero;
12754#if PY_VERSION_HEX >= 0x030d00A6 && !CYTHON_COMPILING_IN_LIMITED_API
12755 Py_ssize_t bytes_copied = PyLong_AsNativeBytes(
12756 x, &val,
sizeof(val), Py_ASNATIVEBYTES_NATIVE_ENDIAN | (is_unsigned ? Py_ASNATIVEBYTES_UNSIGNED_BUFFER | Py_ASNATIVEBYTES_REJECT_NEGATIVE : 0));
12757 if (unlikely(bytes_copied == -1)) {
12758 }
else if (unlikely(bytes_copied > (Py_ssize_t)
sizeof(val))) {
12759 goto raise_overflow;
12763#elif PY_VERSION_HEX < 0x030d0000 && !(CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API) || defined(_PyLong_AsByteArray)
12764 int one = 1;
int is_little = (int)*(
unsigned char *)&one;
12765 unsigned char *bytes = (
unsigned char *)&val;
12766 ret = _PyLong_AsByteArray((PyLongObject *)x,
12767 bytes,
sizeof(val),
12768 is_little, !is_unsigned);
12769 if ((0))
goto raise_overflow;
12772 PyObject *stepval = NULL, *mask = NULL, *shift = NULL;
12773 int bits, remaining_bits, is_negative = 0;
12774 int chunk_size = (
sizeof(long) < 8) ? 30 : 62;
12775 if (likely(PyLong_CheckExact(x))) {
12776 v = __Pyx_NewRef(x);
12778 v = PyNumber_Long(x);
12779 if (unlikely(!
v))
return (
int) -1;
12780 assert(PyLong_CheckExact(
v));
12783 int result = PyObject_RichCompareBool(
v, Py_False, Py_LT);
12784 if (unlikely(result < 0)) {
12788 is_negative = result == 1;
12790 if (is_unsigned && unlikely(is_negative)) {
12792 PyErr_SetString(PyExc_OverflowError,
12793 "can't convert negative value to int");
12795 }
else if (is_negative) {
12796 stepval = PyNumber_Invert(
v);
12798 if (unlikely(!stepval))
12805 mask = PyLong_FromLong((1L << chunk_size) - 1);
if (unlikely(!mask))
goto done;
12806 shift = PyLong_FromLong(chunk_size);
if (unlikely(!shift))
goto done;
12807 for (bits = 0; bits < (int)
sizeof(int) * 8 - chunk_size; bits += chunk_size) {
12808 PyObject *tmp, *digit;
12810 digit = PyNumber_And(stepval, mask);
12811 if (unlikely(!digit))
goto done;
12812 idigit = PyLong_AsLong(digit);
12814 if (unlikely(idigit < 0))
goto done;
12815 val |= ((int) idigit) << bits;
12816 tmp = PyNumber_Rshift(stepval, shift);
12817 if (unlikely(!tmp))
goto done;
12818 Py_DECREF(stepval); stepval = tmp;
12820 Py_DECREF(shift); shift = NULL;
12821 Py_DECREF(mask); mask = NULL;
12823 long idigit = PyLong_AsLong(stepval);
12824 if (unlikely(idigit < 0))
goto done;
12825 remaining_bits = ((int)
sizeof(int) * 8) - bits - (is_unsigned ? 0 : 1);
12826 if (unlikely(idigit >= (1L << remaining_bits)))
12827 goto raise_overflow;
12828 val |= ((int) idigit) << bits;
12830 if (!is_unsigned) {
12831 if (unlikely(val & (((
int) 1) << (
sizeof(
int) * 8 - 1))))
12832 goto raise_overflow;
12840 Py_XDECREF(stepval);
12846 return __Pyx_raise_overflow___Pyx_PyLong_As_int();
12848static CYTHON_INLINE
int __Pyx_PyLong___Pyx_PyLong_As_int(PyObject *x) {
12849#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
12850#pragma GCC diagnostic push
12851#pragma GCC diagnostic ignored "-Wconversion"
12853 const int neg_one = (int) -1, const_zero = (
int) 0;
12854#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
12855#pragma GCC diagnostic pop
12857 const int is_unsigned = neg_one > const_zero;
12859 #if CYTHON_USE_PYLONG_INTERNALS
12860 if (unlikely(__Pyx_PyLong_IsNeg(x))) {
12861 goto raise_neg_overflow;
12862 }
else if (__Pyx_PyLong_IsCompact(x)) {
12863 __PYX_VERIFY_RETURN_INT(
int, __Pyx_compact_upylong, __Pyx_PyLong_CompactValueUnsigned(x))
12867 return __Pyx_PyULong___Pyx_PyLong_As_int(x);
12870 #if CYTHON_USE_PYLONG_INTERNALS
12871 if (__Pyx_PyLong_IsCompact(x)) {
12872 __PYX_VERIFY_RETURN_INT(
int, __Pyx_compact_pylong, __Pyx_PyLong_CompactValue(x))
12876 return __Pyx_PySLong___Pyx_PyLong_As_int(x);
12879#if CYTHON_USE_PYLONG_INTERNALS
12881 return __Pyx_raise_neg_overflow___Pyx_PyLong_As_int();
12883 return __Pyx_raise_overflow___Pyx_PyLong_As_int();
12886static int __Pyx_NonPyLong___Pyx_PyLong_As_int(PyObject *x) {
12888 PyObject *tmp = __Pyx_PyNumber_Long(x);
12889 if (!tmp)
return (
int) -1;
12890 val = __Pyx_PyLong_As_int(tmp);
12894static CYTHON_INLINE
int __Pyx_PyLong_As_int(PyObject *x) {
12895 if (likely(PyLong_Check(x))) {
12896 return __Pyx_PyLong___Pyx_PyLong_As_int(x);
12898 return __Pyx_NonPyLong___Pyx_PyLong_As_int(x);
12903#if !CYTHON_VECTORCALL
12904static PyObject *__Pyx_Object_VectorcallMethodKwds(PyObject *name, PyObject *
const *args,
size_t nargsf, PyObject *kwnames) {
12906 PyObject *obj = PyObject_GetAttr(args[0], name);
12907 if (unlikely(!obj))
12909 result = __Pyx_Object_VectorcallKwds(obj, args+1, nargsf-1, kwnames);
12916static CYTHON_INLINE PyObject* __Pyx_PyLong_From_long(
long value) {
12917#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
12918#pragma GCC diagnostic push
12919#pragma GCC diagnostic ignored "-Wconversion"
12921 const long neg_one = (long) -1, const_zero = (
long) 0;
12922#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
12923#pragma GCC diagnostic pop
12925 const int is_unsigned = neg_one > const_zero;
12927 if (
sizeof(
long) <
sizeof(
long)) {
12928 return PyLong_FromLong((
long) value);
12929 }
else if (
sizeof(
long) <=
sizeof(
unsigned long)) {
12930 return PyLong_FromUnsignedLong((
unsigned long) value);
12931#if !CYTHON_COMPILING_IN_PYPY
12932 }
else if (
sizeof(
long) <=
sizeof(
unsigned PY_LONG_LONG)) {
12933 return PyLong_FromUnsignedLongLong((
unsigned PY_LONG_LONG) value);
12937 if (
sizeof(
long) <=
sizeof(
long)) {
12938 return PyLong_FromLong((
long) value);
12939 }
else if (
sizeof(
long) <=
sizeof(PY_LONG_LONG)) {
12940 return PyLong_FromLongLong((PY_LONG_LONG) value);
12944 unsigned char *bytes = (
unsigned char *)&value;
12945#if !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX >= 0x030d00A4
12947 return PyLong_FromUnsignedNativeBytes(bytes,
sizeof(value), -1);
12949 return PyLong_FromNativeBytes(bytes,
sizeof(value), -1);
12951#elif !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030d0000
12952 int one = 1;
int little = (int)*(
unsigned char *)&one;
12953 return _PyLong_FromByteArray(bytes,
sizeof(
long),
12954 little, !is_unsigned);
12956 int one = 1;
int little = (int)*(
unsigned char *)&one;
12957 PyObject *result = NULL, *kwds = NULL;
12958 PyObject *py_bytes = NULL, *order_str = NULL, *from_bytes_str = NULL;;
12959 py_bytes = PyBytes_FromStringAndSize((
char*)bytes,
sizeof(
long));
12960 if (!py_bytes)
goto limited_bad;
12961 from_bytes_str = PyUnicode_FromStringAndSize(
"from_bytes", 10);
12962 if (!from_bytes_str)
goto limited_bad;
12963 order_str = PyUnicode_FromString(little ?
"little" :
"big");
12964 if (!order_str)
goto limited_bad;
12966 PyObject *args[] = { (PyObject*)&PyLong_Type, py_bytes, order_str, Py_True };
12967 if (!is_unsigned) {
12968 PyObject *signed_str = PyUnicode_FromStringAndSize(
"signed", 6);
12969 if (!signed_str)
goto limited_bad;
12970#if CYTHON_VECTORCALL
12971 kwds = PyTuple_Pack(1, signed_str);
12974 PyObject *keys[] = {signed_str};
12975 PyObject *values[] = {Py_True};
12976 kwds = __Pyx_MakeKwargDict(keys, values, 1);
12979 Py_DECREF(signed_str);
12980 if (unlikely(!kwds))
goto limited_bad;
12982 result = __Pyx_Object_VectorcallMethodKwds(from_bytes_str, args, 3 | __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET, kwds);
12986 Py_XDECREF(order_str);
12987 Py_XDECREF(py_bytes);
12988 Py_XDECREF(from_bytes_str);
12995static long __Pyx_LargePyLong___Pyx_PyLong_As_long(PyObject *x);
12996static long __Pyx_raise_neg_overflow___Pyx_PyLong_As_long(
void) {
12997 const char* type_name =
"long";
12998 PyErr_Format(PyExc_OverflowError,
12999 "can't convert negative value to %.200s", type_name);
13002static long __Pyx_raise_overflow___Pyx_PyLong_As_long(
void) {
13003 const char* type_name =
"long";
13004 PyErr_Format(PyExc_OverflowError,
13005 "value too large to convert to %.200s", type_name);
13008static CYTHON_INLINE
long __Pyx_PyULong___Pyx_PyLong_As_long(PyObject *x) {
13009 const int is_unsigned = 1;
13010#if CYTHON_USE_PYLONG_INTERNALS
13012 const digit* digits = __Pyx_PyLong_Digits(x);
13013 const Py_ssize_t size = __Pyx_PyLong_DigitCount(x);
13014 if (size == 2 && (8 *
sizeof(
long) > 1 * PyLong_SHIFT)) {
13015 if ((8 *
sizeof(
unsigned long) > 2 * PyLong_SHIFT)) {
13016 __PYX_VERIFY_RETURN_INT(
long,
unsigned long, (((((
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
13017 }
else if ((8 *
sizeof(
long) >= 2 * PyLong_SHIFT)) {
13018 return (
long) (((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0]));
13021 if (size == 3 && (8 *
sizeof(
long) > 2 * PyLong_SHIFT)) {
13022 if ((8 *
sizeof(
unsigned long) > 3 * PyLong_SHIFT)) {
13023 __PYX_VERIFY_RETURN_INT(
long,
unsigned long, (((((((
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
13024 }
else if ((8 *
sizeof(
long) >= 3 * PyLong_SHIFT)) {
13025 return (
long) (((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]));
13028 if (size == 4 && (8 *
sizeof(
long) > 3 * PyLong_SHIFT)) {
13029 if ((8 *
sizeof(
unsigned long) > 4 * PyLong_SHIFT)) {
13030 __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])))
13031 }
else if ((8 *
sizeof(
long) >= 4 * PyLong_SHIFT)) {
13032 return (
long) (((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]));
13037#elif CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030C00A7
13038 if (unlikely(Py_SIZE(x) < 0)) {
13039 goto raise_neg_overflow;
13043 int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
13044 if (unlikely(result < 0))
13046 if (unlikely(result == 1))
13047 goto raise_neg_overflow;
13050 if ((
sizeof(
long) <=
sizeof(
unsigned long))) {
13051 __PYX_VERIFY_RETURN_INT_EXC(
long,
unsigned long, PyLong_AsUnsignedLong(x))
13052 }
else if ((
sizeof(
long) <=
sizeof(
unsigned PY_LONG_LONG))) {
13053 __PYX_VERIFY_RETURN_INT_EXC(
long,
unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
13055 return __Pyx_LargePyLong___Pyx_PyLong_As_long(x);
13057 return __Pyx_raise_neg_overflow___Pyx_PyLong_As_long();
13059 return __Pyx_raise_overflow___Pyx_PyLong_As_long();
13061static CYTHON_INLINE
long __Pyx_PySLong___Pyx_PyLong_As_long(PyObject *x) {
13062 const int is_unsigned = 0;
13063#if CYTHON_USE_PYLONG_INTERNALS
13064 if (__Pyx_PyLong_IsNeg(x)) {
13065 const Py_ssize_t size = __Pyx_PyLong_DigitCount(x);
13066 const digit* digits = __Pyx_PyLong_Digits(x);
13067 if (size == 2 && (8 *
sizeof(
long) > 1 * PyLong_SHIFT)) {
13068 if ((8 *
sizeof(
long) > 2 * PyLong_SHIFT)) {
13069 long ival = - (long) (((((
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0]));
13070 __PYX_VERIFY_RETURN_INT(
long,
long, ival)
13071 }
else if ((8 *
sizeof(
long) - 1 > 2 * PyLong_SHIFT)) {
13072 return (
long) (((long) -1) * (((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
13075 if (size == 3 && (8 *
sizeof(
long) > 2 * PyLong_SHIFT)) {
13076 if ((8 *
sizeof(
long) > 3 * PyLong_SHIFT)) {
13077 long ival = - (long) (((((((
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0]));
13078 __PYX_VERIFY_RETURN_INT(
long,
long, ival)
13079 }
else if ((8 *
sizeof(
long) - 1 > 3 * PyLong_SHIFT)) {
13080 return (
long) (((long) -1) * (((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
13083 if (size == 4 && (8 *
sizeof(
long) > 3 * PyLong_SHIFT)) {
13084 if ((8 *
sizeof(
long) > 4 * PyLong_SHIFT)) {
13085 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]));
13086 __PYX_VERIFY_RETURN_INT(
long,
long, ival)
13087 }
else if ((8 *
sizeof(
long) - 1 > 4 * PyLong_SHIFT)) {
13088 return (
long) (((long) -1) * (((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
13093 const Py_ssize_t size = __Pyx_PyLong_DigitCount(x);
13094 const digit* digits = __Pyx_PyLong_Digits(x);
13095 if (size == 2 && (8 *
sizeof(
long) > 1 * PyLong_SHIFT)) {
13096 if ((8 *
sizeof(
long) > 2 * PyLong_SHIFT)) {
13097 __PYX_VERIFY_RETURN_INT(
long,
unsigned long, (((((
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
13098 }
else if ((8 *
sizeof(
long) - 1 > 2 * PyLong_SHIFT)) {
13099 return (
long) (((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0]));
13102 if (size == 3 && (8 *
sizeof(
long) > 2 * PyLong_SHIFT)) {
13103 if ((8 *
sizeof(
long) > 3 * PyLong_SHIFT)) {
13104 __PYX_VERIFY_RETURN_INT(
long,
unsigned long, (((((((
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
13105 }
else if ((8 *
sizeof(
long) - 1 > 3 * PyLong_SHIFT)) {
13106 return (
long) (((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]));
13109 if (size == 4 && (8 *
sizeof(
long) > 3 * PyLong_SHIFT)) {
13110 if ((8 *
sizeof(
long) > 4 * PyLong_SHIFT)) {
13111 __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])))
13112 }
else if ((8 *
sizeof(
long) - 1 > 4 * PyLong_SHIFT)) {
13113 return (
long) (((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]));
13119 #if __PYX_LIMITED_VERSION_HEX >= 0x030d0000
13120 if ((
sizeof(
long) <=
sizeof(
int)) && (
sizeof(
int) <
sizeof(
long))) {
13121 __PYX_VERIFY_RETURN_INT_EXC(
long,
int, PyLong_AsInt(x))
13124 if ((
sizeof(
long) <=
sizeof(
long))) {
13125 __PYX_VERIFY_RETURN_INT_EXC(
long,
long, PyLong_AsLong(x))
13126 }
else if ((
sizeof(
long) <=
sizeof(PY_LONG_LONG))) {
13127 __PYX_VERIFY_RETURN_INT_EXC(
long, PY_LONG_LONG, PyLong_AsLongLong(x))
13129 return __Pyx_LargePyLong___Pyx_PyLong_As_long(x);
13131 return __Pyx_raise_neg_overflow___Pyx_PyLong_As_long();
13133 return __Pyx_raise_overflow___Pyx_PyLong_As_long();
13135static long __Pyx_LargePyLong___Pyx_PyLong_As_long(PyObject *x) {
13136#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
13137#pragma GCC diagnostic push
13138#pragma GCC diagnostic ignored "-Wconversion"
13140 const long neg_one = (long) -1, const_zero = (
long) 0;
13141#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
13142#pragma GCC diagnostic pop
13144 const int is_unsigned = neg_one > const_zero;
13147#if PY_VERSION_HEX >= 0x030d00A6 && !CYTHON_COMPILING_IN_LIMITED_API
13148 Py_ssize_t bytes_copied = PyLong_AsNativeBytes(
13149 x, &val,
sizeof(val), Py_ASNATIVEBYTES_NATIVE_ENDIAN | (is_unsigned ? Py_ASNATIVEBYTES_UNSIGNED_BUFFER | Py_ASNATIVEBYTES_REJECT_NEGATIVE : 0));
13150 if (unlikely(bytes_copied == -1)) {
13151 }
else if (unlikely(bytes_copied > (Py_ssize_t)
sizeof(val))) {
13152 goto raise_overflow;
13156#elif PY_VERSION_HEX < 0x030d0000 && !(CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API) || defined(_PyLong_AsByteArray)
13157 int one = 1;
int is_little = (int)*(
unsigned char *)&one;
13158 unsigned char *bytes = (
unsigned char *)&val;
13159 ret = _PyLong_AsByteArray((PyLongObject *)x,
13160 bytes,
sizeof(val),
13161 is_little, !is_unsigned);
13162 if ((0))
goto raise_overflow;
13165 PyObject *stepval = NULL, *mask = NULL, *shift = NULL;
13166 int bits, remaining_bits, is_negative = 0;
13167 int chunk_size = (
sizeof(long) < 8) ? 30 : 62;
13168 if (likely(PyLong_CheckExact(x))) {
13169 v = __Pyx_NewRef(x);
13171 v = PyNumber_Long(x);
13172 if (unlikely(!
v))
return (
long) -1;
13173 assert(PyLong_CheckExact(
v));
13176 int result = PyObject_RichCompareBool(
v, Py_False, Py_LT);
13177 if (unlikely(result < 0)) {
13181 is_negative = result == 1;
13183 if (is_unsigned && unlikely(is_negative)) {
13185 PyErr_SetString(PyExc_OverflowError,
13186 "can't convert negative value to long");
13188 }
else if (is_negative) {
13189 stepval = PyNumber_Invert(
v);
13191 if (unlikely(!stepval))
13198 mask = PyLong_FromLong((1L << chunk_size) - 1);
if (unlikely(!mask))
goto done;
13199 shift = PyLong_FromLong(chunk_size);
if (unlikely(!shift))
goto done;
13200 for (bits = 0; bits < (int)
sizeof(long) * 8 - chunk_size; bits += chunk_size) {
13201 PyObject *tmp, *digit;
13203 digit = PyNumber_And(stepval, mask);
13204 if (unlikely(!digit))
goto done;
13205 idigit = PyLong_AsLong(digit);
13207 if (unlikely(idigit < 0))
goto done;
13208 val |= ((long) idigit) << bits;
13209 tmp = PyNumber_Rshift(stepval, shift);
13210 if (unlikely(!tmp))
goto done;
13211 Py_DECREF(stepval); stepval = tmp;
13213 Py_DECREF(shift); shift = NULL;
13214 Py_DECREF(mask); mask = NULL;
13216 long idigit = PyLong_AsLong(stepval);
13217 if (unlikely(idigit < 0))
goto done;
13218 remaining_bits = ((int)
sizeof(long) * 8) - bits - (is_unsigned ? 0 : 1);
13219 if (unlikely(idigit >= (1L << remaining_bits)))
13220 goto raise_overflow;
13221 val |= ((long) idigit) << bits;
13223 if (!is_unsigned) {
13224 if (unlikely(val & (((
long) 1) << (
sizeof(
long) * 8 - 1))))
13225 goto raise_overflow;
13233 Py_XDECREF(stepval);
13239 return __Pyx_raise_overflow___Pyx_PyLong_As_long();
13241static CYTHON_INLINE
long __Pyx_PyLong___Pyx_PyLong_As_long(PyObject *x) {
13242#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
13243#pragma GCC diagnostic push
13244#pragma GCC diagnostic ignored "-Wconversion"
13246 const long neg_one = (long) -1, const_zero = (
long) 0;
13247#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
13248#pragma GCC diagnostic pop
13250 const int is_unsigned = neg_one > const_zero;
13252 #if CYTHON_USE_PYLONG_INTERNALS
13253 if (unlikely(__Pyx_PyLong_IsNeg(x))) {
13254 goto raise_neg_overflow;
13255 }
else if (__Pyx_PyLong_IsCompact(x)) {
13256 __PYX_VERIFY_RETURN_INT(
long, __Pyx_compact_upylong, __Pyx_PyLong_CompactValueUnsigned(x))
13260 return __Pyx_PyULong___Pyx_PyLong_As_long(x);
13263 #if CYTHON_USE_PYLONG_INTERNALS
13264 if (__Pyx_PyLong_IsCompact(x)) {
13265 __PYX_VERIFY_RETURN_INT(
long, __Pyx_compact_pylong, __Pyx_PyLong_CompactValue(x))
13269 return __Pyx_PySLong___Pyx_PyLong_As_long(x);
13272#if CYTHON_USE_PYLONG_INTERNALS
13274 return __Pyx_raise_neg_overflow___Pyx_PyLong_As_long();
13276 return __Pyx_raise_overflow___Pyx_PyLong_As_long();
13279static long __Pyx_NonPyLong___Pyx_PyLong_As_long(PyObject *x) {
13281 PyObject *tmp = __Pyx_PyNumber_Long(x);
13282 if (!tmp)
return (
long) -1;
13283 val = __Pyx_PyLong_As_long(tmp);
13287static CYTHON_INLINE
long __Pyx_PyLong_As_long(PyObject *x) {
13288 if (likely(PyLong_Check(x))) {
13289 return __Pyx_PyLong___Pyx_PyLong_As_long(x);
13291 return __Pyx_NonPyLong___Pyx_PyLong_As_long(x);
13296#if __PYX_LIMITED_VERSION_HEX < 0x030b0000
13297void __Pyx_init_runtime_version(
void) {
13298 if (__Pyx_cached_runtime_version == 0) {
13299 const char* rt_version = Py_GetVersion();
13300 unsigned long version = 0;
13301 unsigned long factor = 0x01000000UL;
13302 unsigned int digit = 0;
13305 while (
'0' <= rt_version[i] && rt_version[i] <=
'9') {
13306 digit = digit * 10 + (
unsigned int) (rt_version[i] -
'0');
13309 version += factor * digit;
13310 if (rt_version[i] !=
'.')
13316 __Pyx_cached_runtime_version = version;
13320static unsigned long __Pyx_get_runtime_version(
void) {
13321#if __PYX_LIMITED_VERSION_HEX >= 0x030b0000
13322 return Py_Version & ~0xFFUL;
13324 return __Pyx_cached_runtime_version;
13329static int __Pyx_check_binary_version(
unsigned long ct_version,
unsigned long rt_version,
int allow_newer) {
13330 const unsigned long MAJOR_MINOR = 0xFFFF0000UL;
13331 if ((rt_version & MAJOR_MINOR) == (ct_version & MAJOR_MINOR))
13333 if (likely(allow_newer && (rt_version & MAJOR_MINOR) > (ct_version & MAJOR_MINOR)))
13337 PyOS_snprintf(message,
sizeof(message),
13338 "compile time Python version %d.%d "
13339 "of module '%.100s' "
13341 "runtime version %d.%d",
13342 (
int) (ct_version >> 24), (
int) ((ct_version >> 16) & 0xFF),
13344 (allow_newer) ?
"was newer than" :
"does not match",
13345 (
int) (rt_version >> 24), (
int) ((rt_version >> 16) & 0xFF)
13347 return PyErr_WarnEx(NULL, message, 1);
13352#if CYTHON_COMPILING_IN_LIMITED_API
13353 static PyObject* __Pyx__PyCode_New(
int a,
int p,
int k,
int l,
int s,
int f,
13354 PyObject *code, PyObject *
c, PyObject*
n, PyObject *
v,
13355 PyObject *fv, PyObject *cell, PyObject* fn,
13356 PyObject *name,
int fline, PyObject *lnos) {
13357 PyObject *exception_table = NULL;
13358 PyObject *types_module=NULL, *code_type=NULL, *result=NULL;
13359 #if __PYX_LIMITED_VERSION_HEX < 0x030b0000
13360 PyObject *version_info;
13361 PyObject *py_minor_version = NULL;
13363 long minor_version = 0;
13364 #if __PYX_LIMITED_VERSION_HEX >= 0x030b0000
13365 minor_version = 11;
13367 if (!(version_info = PySys_GetObject(
"version_info")))
goto end;
13368 if (!(py_minor_version = PySequence_GetItem(version_info, 1)))
goto end;
13369 minor_version = PyLong_AsLong(py_minor_version);
13370 Py_DECREF(py_minor_version);
13371 if (minor_version == -1 && PyErr_Occurred())
goto end;
13373 if (!(types_module = PyImport_ImportModule(
"types")))
goto end;
13374 if (!(code_type = PyObject_GetAttrString(types_module,
"CodeType")))
goto end;
13375 if (minor_version <= 10) {
13376 result = PyObject_CallFunction(code_type,
"iiiiiiOOOOOOiOOO", a,p, k, l,
s,
f, code,
13377 c,
n,
v, fn, name, fline, lnos, fv, cell);
13379 if (!(exception_table = PyBytes_FromStringAndSize(NULL, 0)))
goto end;
13380 result = PyObject_CallFunction(code_type,
"iiiiiiOOOOOOOiOOOO", a,p, k, l,
s,
f, code,
13381 c,
n,
v, fn, name, name, fline, lnos, exception_table, fv, cell);
13384 Py_XDECREF(code_type);
13385 Py_XDECREF(exception_table);
13386 Py_XDECREF(types_module);
13388 PyObject *exc_type, *exc_value, *exc_tb;
13389 PyErr_Fetch(&exc_type, &exc_value, &exc_tb);
13390 if (PyErr_WarnFormat(
13391 PyExc_RuntimeWarning, 1,
13392 "Code object creation failed in Cython module: %S\nTry recompiling with a more recent version of Cython.",
13393 exc_value ? exc_value : exc_type) == 0) {
13397 Py_DECREF(exc_type);
13398 Py_XDECREF(exc_value);
13399 Py_XDECREF(exc_tb);
13403#elif PY_VERSION_HEX >= 0x030B0000
13404 static PyCodeObject* __Pyx__PyCode_New(
int a,
int p,
int k,
int l,
int s,
int f,
13405 PyObject *code, PyObject *
c, PyObject*
n, PyObject *
v,
13406 PyObject *fv, PyObject *cell, PyObject* fn,
13407 PyObject *name,
int fline, PyObject *lnos) {
13408 PyCodeObject *result;
13410 #if PY_VERSION_HEX >= 0x030C0000
13411 PyUnstable_Code_NewWithPosOnlyArgs
13413 PyCode_NewWithPosOnlyArgs
13415 (a, p, k, l,
s,
f, code,
c,
n,
v, fv, cell, fn, name, name, fline, lnos, __pyx_mstate_global->__pyx_empty_bytes);
13416 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030c00A1
13417 if (likely(result))
13418 result->_co_firsttraceable = 0;
13422#elif !CYTHON_COMPILING_IN_PYPY
13423 #define __Pyx__PyCode_New(a, p, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\
13424 PyCode_NewWithPosOnlyArgs(a, p, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)
13426 #define __Pyx__PyCode_New(a, p, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\
13427 PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)
13429static PyObject* __Pyx_PyCode_New(
13430 const __Pyx_PyCode_New_function_description descr,
13431 PyObject *
const *varnames,
13432 PyObject *filename,
13433 PyObject *funcname,
13434 PyObject *line_table,
13435 PyObject *tuple_dedup_map
13437 PyObject *code_obj = NULL, *varnames_tuple_dedup = NULL, *code_bytes = NULL;
13438 Py_ssize_t var_count = (Py_ssize_t) descr.nlocals;
13439 PyObject *varnames_tuple = PyTuple_New(var_count);
13440 if (unlikely(!varnames_tuple))
return NULL;
13441 for (Py_ssize_t i=0; i < var_count; i++) {
13442 Py_INCREF(varnames[i]);
13443 if (__Pyx_PyTuple_SET_ITEM(varnames_tuple, i, varnames[i]) != (0))
goto done;
13445 #if CYTHON_COMPILING_IN_LIMITED_API
13446 varnames_tuple_dedup = PyDict_GetItem(tuple_dedup_map, varnames_tuple);
13447 if (!varnames_tuple_dedup) {
13448 if (unlikely(PyDict_SetItem(tuple_dedup_map, varnames_tuple, varnames_tuple) < 0))
goto done;
13449 varnames_tuple_dedup = varnames_tuple;
13452 varnames_tuple_dedup = PyDict_SetDefault(tuple_dedup_map, varnames_tuple, varnames_tuple);
13453 if (unlikely(!varnames_tuple_dedup))
goto done;
13455 #if CYTHON_AVOID_BORROWED_REFS
13456 Py_INCREF(varnames_tuple_dedup);
13458 if (__PYX_LIMITED_VERSION_HEX >= (0x030b0000) && line_table != NULL && !CYTHON_COMPILING_IN_GRAAL) {
13459 Py_ssize_t line_table_length = __Pyx_PyBytes_GET_SIZE(line_table);
13460 #if !CYTHON_ASSUME_SAFE_SIZE
13461 if (unlikely(line_table_length == -1))
goto done;
13463 Py_ssize_t code_len = (line_table_length * 2 + 4) & ~3LL;
13464 code_bytes = PyBytes_FromStringAndSize(NULL, code_len);
13465 if (unlikely(!code_bytes))
goto done;
13466 char* c_code_bytes = PyBytes_AsString(code_bytes);
13467 if (unlikely(!c_code_bytes))
goto done;
13468 memset(c_code_bytes, 0, (
size_t) code_len);
13470 code_obj = (PyObject*) __Pyx__PyCode_New(
13471 (
int) descr.argcount,
13472 (
int) descr.num_posonly_args,
13473 (
int) descr.num_kwonly_args,
13474 (
int) descr.nlocals,
13477 code_bytes ? code_bytes : __pyx_mstate_global->__pyx_empty_bytes,
13478 __pyx_mstate_global->__pyx_empty_tuple,
13479 __pyx_mstate_global->__pyx_empty_tuple,
13480 varnames_tuple_dedup,
13481 __pyx_mstate_global->__pyx_empty_tuple,
13482 __pyx_mstate_global->__pyx_empty_tuple,
13485 (
int) descr.first_line,
13486 (__PYX_LIMITED_VERSION_HEX >= (0x030b0000) && line_table) ? line_table : __pyx_mstate_global->__pyx_empty_bytes
13489 Py_XDECREF(code_bytes);
13490 #if CYTHON_AVOID_BORROWED_REFS
13491 Py_XDECREF(varnames_tuple_dedup);
13493 Py_DECREF(varnames_tuple);
13499static CYTHON_SMALL_CODE PyObject *__Pyx_DecompressString(
const char *
s, Py_ssize_t length,
int algo) {
13500#ifdef __Pyx_DecompressString_UNUSED
13501 CYTHON_UNUSED_VAR(
s);
13502 CYTHON_UNUSED_VAR(length);
13503 CYTHON_UNUSED_VAR(algo);
13506 PyObject *module = NULL, *decompress, *compressed_bytes, *decompressed;
13507 const char* module_name = algo == 3 ?
"compression.zstd" : algo == 2 ?
"bz2" :
"zlib";
13508 PyObject *methodname = PyUnicode_FromString(
"decompress");
13509 if (unlikely(!methodname))
return NULL;
13510 #if __PYX_LIMITED_VERSION_HEX >= 0x030e0000
13512 PyObject *fromlist = Py_BuildValue(
"[O]", methodname);
13513 if (unlikely(!fromlist))
goto bad;
13514 module = PyImport_ImportModuleLevel("compression.zstd", NULL, NULL, fromlist, 0);
13515 Py_DECREF(fromlist);
13518 module = PyImport_ImportModule(module_name);
13519 if (unlikely(!module))
goto import_failed;
13520 decompress = PyObject_GetAttr(module, methodname);
13521 if (unlikely(!decompress))
goto import_failed;
13524 char *memview_bytes =
const_cast<char*
>(
s);
13526 #if defined(__clang__)
13527 #pragma clang diagnostic push
13528 #pragma clang diagnostic ignored "-Wcast-qual"
13529 #elif !defined(__INTEL_COMPILER) && defined(__GNUC__)
13530 #pragma GCC diagnostic push
13531 #pragma GCC diagnostic ignored "-Wcast-qual"
13533 char *memview_bytes = (
char*)
s;
13534 #if defined(__clang__)
13535 #pragma clang diagnostic pop
13536 #elif !defined(__INTEL_COMPILER) && defined(__GNUC__)
13537 #pragma GCC diagnostic pop
13540 #if CYTHON_COMPILING_IN_LIMITED_API && !defined(PyBUF_READ)
13541 int memview_flags = 0x100;
13543 int memview_flags = PyBUF_READ;
13545 compressed_bytes = PyMemoryView_FromMemory(memview_bytes, length, memview_flags);
13547 if (unlikely(!compressed_bytes)) {
13548 Py_DECREF(decompress);
13551 decompressed = PyObject_CallFunctionObjArgs(decompress, compressed_bytes, NULL);
13552 Py_DECREF(compressed_bytes);
13553 Py_DECREF(decompress);
13555 Py_DECREF(methodname);
13556 return decompressed;
13558 PyErr_Format(PyExc_ImportError,
13559 "Failed to import '%.20s.decompress' - cannot initialise module strings. "
13560 "String compression was configured with the C macro 'CYTHON_COMPRESS_STRINGS=%d'.",
13561 module_name, algo);
13563 Py_XDECREF(module);
13564 Py_DECREF(methodname);
13570static CYTHON_INLINE Py_ssize_t __Pyx_ssize_strlen(
const char *
s) {
13571 size_t len = strlen(
s);
13572 if (unlikely(len > (
size_t) PY_SSIZE_T_MAX)) {
13573 PyErr_SetString(PyExc_OverflowError,
"byte string is too long");
13576 return (Py_ssize_t) len;
13578static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(
const char* c_str) {
13579 Py_ssize_t len = __Pyx_ssize_strlen(c_str);
13580 if (unlikely(len < 0))
return NULL;
13581 return __Pyx_PyUnicode_FromStringAndSize(c_str, len);
13583static CYTHON_INLINE PyObject* __Pyx_PyByteArray_FromString(
const char* c_str) {
13584 Py_ssize_t len = __Pyx_ssize_strlen(c_str);
13585 if (unlikely(len < 0))
return NULL;
13586 return PyByteArray_FromStringAndSize(c_str, len);
13588static CYTHON_INLINE
const char* __Pyx_PyObject_AsString(PyObject* o) {
13590 return __Pyx_PyObject_AsStringAndSize(o, &ignore);
13592#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_UTF8
13593static CYTHON_INLINE
const char* __Pyx_PyUnicode_AsStringAndSize(PyObject* o, Py_ssize_t *length) {
13594 if (unlikely(__Pyx_PyUnicode_READY(o) == -1))
return NULL;
13595#if CYTHON_COMPILING_IN_LIMITED_API
13597 const char* result;
13598 Py_ssize_t unicode_length;
13599 CYTHON_MAYBE_UNUSED_VAR(unicode_length);
13600 #if __PYX_LIMITED_VERSION_HEX < 0x030A0000
13601 if (unlikely(PyArg_Parse(o,
"s#", &result, length) < 0))
return NULL;
13603 result = PyUnicode_AsUTF8AndSize(o, length);
13605 #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
13606 unicode_length = PyUnicode_GetLength(o);
13607 if (unlikely(unicode_length < 0))
return NULL;
13608 if (unlikely(unicode_length != *length)) {
13609 PyUnicode_AsASCIIString(o);
13616#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
13617 if (likely(PyUnicode_IS_ASCII(o))) {
13618 *length = PyUnicode_GET_LENGTH(o);
13619 return PyUnicode_AsUTF8(o);
13621 PyUnicode_AsASCIIString(o);
13625 return PyUnicode_AsUTF8AndSize(o, length);
13630static CYTHON_INLINE
const char* __Pyx_PyObject_AsStringAndSize(PyObject* o, Py_ssize_t *length) {
13631#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_UTF8
13632 if (PyUnicode_Check(o)) {
13633 return __Pyx_PyUnicode_AsStringAndSize(o, length);
13636 if (PyByteArray_Check(o)) {
13637#if (CYTHON_ASSUME_SAFE_SIZE && CYTHON_ASSUME_SAFE_MACROS) || (CYTHON_COMPILING_IN_PYPY && (defined(PyByteArray_AS_STRING) && defined(PyByteArray_GET_SIZE)))
13638 *length = PyByteArray_GET_SIZE(o);
13639 return PyByteArray_AS_STRING(o);
13641 *length = PyByteArray_Size(o);
13642 if (*length == -1)
return NULL;
13643 return PyByteArray_AsString(o);
13648 int r = PyBytes_AsStringAndSize(o, &result, length);
13649 if (unlikely(
r < 0)) {
13656static CYTHON_INLINE
int __Pyx_PyObject_IsTrue(PyObject* x) {
13657 int is_true = x == Py_True;
13658 if (is_true | (x == Py_False) | (x == Py_None))
return is_true;
13659 else return PyObject_IsTrue(x);
13661static CYTHON_INLINE
int __Pyx_PyObject_IsTrueAndDecref(PyObject* x) {
13663 if (unlikely(!x))
return -1;
13664 retval = __Pyx_PyObject_IsTrue(x);
13668static PyObject* __Pyx_PyNumber_LongWrongResultType(PyObject* result) {
13669 __Pyx_TypeName result_type_name = __Pyx_PyType_GetFullyQualifiedName(Py_TYPE(result));
13670 #if CYTHON_COMPILING_IN_LIMITED_API && __PYX_LIMITED_VERSION_HEX < 0x030d0000
13671 if (unlikely(!result_type_name))
goto bad;
13673 if (PyLong_Check(result)) {
13674 if (PyErr_WarnFormat(PyExc_DeprecationWarning, 1,
13675 "__int__ returned non-int (type " __Pyx_FMT_TYPENAME
"). "
13676 "The ability to return an instance of a strict subclass of int is deprecated, "
13677 "and may be removed in a future version of Python.",
13678 result_type_name)) {
13679 __Pyx_DECREF_TypeName(result_type_name);
13682 __Pyx_DECREF_TypeName(result_type_name);
13685 PyErr_Format(PyExc_TypeError,
13686 "__int__ returned non-int (type " __Pyx_FMT_TYPENAME
")",
13688 __Pyx_DECREF_TypeName(result_type_name);
13693static CYTHON_INLINE PyObject* __Pyx_PyNumber_Long(PyObject* x) {
13694#if CYTHON_USE_TYPE_SLOTS
13695 PyNumberMethods *m;
13697 PyObject *res = NULL;
13698 if (likely(PyLong_Check(x)))
13699 return __Pyx_NewRef(x);
13700#if CYTHON_USE_TYPE_SLOTS
13701 m = Py_TYPE(x)->tp_as_number;
13702 if (likely(m && m->nb_int)) {
13703 res = m->nb_int(x);
13706 if (!PyBytes_CheckExact(x) && !PyUnicode_CheckExact(x)) {
13707 res = PyNumber_Long(x);
13711 if (unlikely(!PyLong_CheckExact(res))) {
13712 return __Pyx_PyNumber_LongWrongResultType(res);
13715 else if (!PyErr_Occurred()) {
13716 PyErr_SetString(PyExc_TypeError,
13717 "an integer is required");
13721static CYTHON_INLINE Py_ssize_t __Pyx_PyLong_AsSsize_t(PyObject* b) {
13722 #if CYTHON_USE_PYLONG_INTERNALS
13724 const Py_ssize_t size = __Pyx_PyLong_DigitCount(b);
13725 const int is_neg = __Pyx_PyLong_IsNeg(b);
13726 const digit* digits = __Pyx_PyLong_Digits(b);
13727 if (size == 0)
return 0;
13728 #if SIZEOF_SIZE_T * 8 > 1 * PyLong_SHIFT
13730 ival = (Py_ssize_t) (((
size_t)digits[0]));
13733 #if SIZEOF_SIZE_T * 8 > 2 * PyLong_SHIFT
13735 ival = (Py_ssize_t) (((((
size_t)digits[1]) << PyLong_SHIFT) | (
size_t)digits[0]));
13738 #if SIZEOF_SIZE_T * 8 > 3 * PyLong_SHIFT
13740 ival = (Py_ssize_t) (((((((
size_t)digits[2]) << PyLong_SHIFT) | (
size_t)digits[1]) << PyLong_SHIFT) | (
size_t)digits[0]));
13743 #if SIZEOF_SIZE_T * 8 > 4 * PyLong_SHIFT
13745 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]));
13748 return PyLong_AsSsize_t(b);
13749 return is_neg ? -ival : ival;
13751 return PyLong_AsSsize_t(b);
13754static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject* b) {
13755 if (likely(PyLong_Check(b))) {
13756 return __Pyx_PyLong_AsSsize_t(b);
13759 PyObject *x = PyNumber_Index(b);
13760 if (unlikely(!x))
return -1;
13761 ival = __Pyx_PyLong_AsSsize_t(x);
13766static CYTHON_INLINE Py_hash_t __Pyx_PyIndex_AsHash_t(PyObject* o) {
13767 if (
sizeof(Py_hash_t) ==
sizeof(Py_ssize_t)) {
13768 return (Py_hash_t) __Pyx_PyIndex_AsSsize_t(o);
13772 x = PyNumber_Index(o);
13774 ival = PyLong_AsLong(x);
13779static CYTHON_INLINE PyObject *__Pyx_Owned_Py_None(
int b) {
13780 CYTHON_UNUSED_VAR(b);
13781 return __Pyx_NewRef(Py_None);
13783static CYTHON_INLINE PyObject * __Pyx_PyBool_FromLong(
long b) {
13784 return __Pyx_NewRef(b ? Py_True: Py_False);
13786static CYTHON_INLINE PyObject * __Pyx_PyLong_FromSize_t(
size_t ival) {
13787 return PyLong_FromSize_t(ival);
13792#if CYTHON_PEP489_MULTI_PHASE_INIT && CYTHON_USE_MODULE_STATE
13793#ifndef CYTHON_MODULE_STATE_LOOKUP_THREAD_SAFE
13794#if (CYTHON_COMPILING_IN_LIMITED_API || PY_VERSION_HEX >= 0x030C0000)
13795 #define CYTHON_MODULE_STATE_LOOKUP_THREAD_SAFE 1
13797 #define CYTHON_MODULE_STATE_LOOKUP_THREAD_SAFE 0
13800#if CYTHON_MODULE_STATE_LOOKUP_THREAD_SAFE && !CYTHON_ATOMICS
13801#error "Module state with PEP489 requires atomics. Currently that's one of\
13802 C11, C++11, gcc atomic intrinsics or MSVC atomic intrinsics"
13804#if !CYTHON_MODULE_STATE_LOOKUP_THREAD_SAFE
13805#define __Pyx_ModuleStateLookup_Lock()
13806#define __Pyx_ModuleStateLookup_Unlock()
13807#elif !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX >= 0x030d0000
13808static PyMutex __Pyx_ModuleStateLookup_mutex = {0};
13809#define __Pyx_ModuleStateLookup_Lock() PyMutex_Lock(&__Pyx_ModuleStateLookup_mutex)
13810#define __Pyx_ModuleStateLookup_Unlock() PyMutex_Unlock(&__Pyx_ModuleStateLookup_mutex)
13811#elif defined(__cplusplus) && __cplusplus >= 201103L
13813static std::mutex __Pyx_ModuleStateLookup_mutex;
13814#define __Pyx_ModuleStateLookup_Lock() __Pyx_ModuleStateLookup_mutex.lock()
13815#define __Pyx_ModuleStateLookup_Unlock() __Pyx_ModuleStateLookup_mutex.unlock()
13816#elif defined(__STDC_VERSION__) && (__STDC_VERSION__ > 201112L) && !defined(__STDC_NO_THREADS__)
13817#include <threads.h>
13818static mtx_t __Pyx_ModuleStateLookup_mutex;
13819static once_flag __Pyx_ModuleStateLookup_mutex_once_flag = ONCE_FLAG_INIT;
13820static void __Pyx_ModuleStateLookup_initialize_mutex(
void) {
13821 mtx_init(&__Pyx_ModuleStateLookup_mutex, mtx_plain);
13823#define __Pyx_ModuleStateLookup_Lock()\
13824 call_once(&__Pyx_ModuleStateLookup_mutex_once_flag, __Pyx_ModuleStateLookup_initialize_mutex);\
13825 mtx_lock(&__Pyx_ModuleStateLookup_mutex)
13826#define __Pyx_ModuleStateLookup_Unlock() mtx_unlock(&__Pyx_ModuleStateLookup_mutex)
13827#elif defined(HAVE_PTHREAD_H)
13828#include <pthread.h>
13829static pthread_mutex_t __Pyx_ModuleStateLookup_mutex = PTHREAD_MUTEX_INITIALIZER;
13830#define __Pyx_ModuleStateLookup_Lock() pthread_mutex_lock(&__Pyx_ModuleStateLookup_mutex)
13831#define __Pyx_ModuleStateLookup_Unlock() pthread_mutex_unlock(&__Pyx_ModuleStateLookup_mutex)
13832#elif defined(_WIN32)
13833#include <Windows.h>
13834static SRWLOCK __Pyx_ModuleStateLookup_mutex = SRWLOCK_INIT;
13835#define __Pyx_ModuleStateLookup_Lock() AcquireSRWLockExclusive(&__Pyx_ModuleStateLookup_mutex)
13836#define __Pyx_ModuleStateLookup_Unlock() ReleaseSRWLockExclusive(&__Pyx_ModuleStateLookup_mutex)
13838#error "No suitable lock available for CYTHON_MODULE_STATE_LOOKUP_THREAD_SAFE.\
13839 Requires C standard >= C11, or C++ standard >= C++11,\
13840 or pthreads, or the Windows 32 API, or Python >= 3.13."
13845} __Pyx_InterpreterIdAndModule;
13847 char interpreter_id_as_index;
13849 Py_ssize_t allocated;
13850 __Pyx_InterpreterIdAndModule table[1];
13851} __Pyx_ModuleStateLookupData;
13852#define __PYX_MODULE_STATE_LOOKUP_SMALL_SIZE 32
13853#if CYTHON_MODULE_STATE_LOOKUP_THREAD_SAFE
13854static __pyx_atomic_int_type __Pyx_ModuleStateLookup_read_counter = 0;
13856#if CYTHON_MODULE_STATE_LOOKUP_THREAD_SAFE
13857static __pyx_atomic_ptr_type __Pyx_ModuleStateLookup_data = 0;
13859static __Pyx_ModuleStateLookupData* __Pyx_ModuleStateLookup_data = NULL;
13861static __Pyx_InterpreterIdAndModule* __Pyx_State_FindModuleStateLookupTableLowerBound(
13862 __Pyx_InterpreterIdAndModule* table,
13864 int64_t interpreterId) {
13865 __Pyx_InterpreterIdAndModule* begin = table;
13866 __Pyx_InterpreterIdAndModule* end = begin + count;
13867 if (begin->id == interpreterId) {
13870 while ((end - begin) > __PYX_MODULE_STATE_LOOKUP_SMALL_SIZE) {
13871 __Pyx_InterpreterIdAndModule* halfway = begin + (end - begin)/2;
13872 if (halfway->id == interpreterId) {
13875 if (halfway->id < interpreterId) {
13881 for (; begin < end; ++begin) {
13882 if (begin->id >= interpreterId)
return begin;
13886static PyObject *__Pyx_State_FindModule(CYTHON_UNUSED
void* dummy) {
13887 int64_t interpreter_id = PyInterpreterState_GetID(PyInterpreterState_Get());
13888 if (interpreter_id == -1)
return NULL;
13889#if CYTHON_MODULE_STATE_LOOKUP_THREAD_SAFE
13890 __Pyx_ModuleStateLookupData* data = (__Pyx_ModuleStateLookupData*)__pyx_atomic_pointer_load_relaxed(&__Pyx_ModuleStateLookup_data);
13892 __pyx_atomic_incr_acq_rel(&__Pyx_ModuleStateLookup_read_counter);
13893 if (likely(data)) {
13894 __Pyx_ModuleStateLookupData* new_data = (__Pyx_ModuleStateLookupData*)__pyx_atomic_pointer_load_acquire(&__Pyx_ModuleStateLookup_data);
13895 if (likely(data == new_data)) {
13896 goto read_finished;
13899 __pyx_atomic_decr_acq_rel(&__Pyx_ModuleStateLookup_read_counter);
13900 __Pyx_ModuleStateLookup_Lock();
13901 __pyx_atomic_incr_relaxed(&__Pyx_ModuleStateLookup_read_counter);
13902 data = (__Pyx_ModuleStateLookupData*)__pyx_atomic_pointer_load_relaxed(&__Pyx_ModuleStateLookup_data);
13903 __Pyx_ModuleStateLookup_Unlock();
13907 __Pyx_ModuleStateLookupData* data = __Pyx_ModuleStateLookup_data;
13909 __Pyx_InterpreterIdAndModule* found = NULL;
13910 if (unlikely(!data))
goto end;
13911 if (data->interpreter_id_as_index) {
13912 if (interpreter_id < data->count) {
13913 found = data->table+interpreter_id;
13916 found = __Pyx_State_FindModuleStateLookupTableLowerBound(
13917 data->table, data->count, interpreter_id);
13921 PyObject *result=NULL;
13922 if (found && found->id == interpreter_id) {
13923 result = found->module;
13925#if CYTHON_MODULE_STATE_LOOKUP_THREAD_SAFE
13926 __pyx_atomic_decr_acq_rel(&__Pyx_ModuleStateLookup_read_counter);
13931#if CYTHON_MODULE_STATE_LOOKUP_THREAD_SAFE
13932static void __Pyx_ModuleStateLookup_wait_until_no_readers(
void) {
13933 while (__pyx_atomic_load(&__Pyx_ModuleStateLookup_read_counter) != 0);
13936#define __Pyx_ModuleStateLookup_wait_until_no_readers()
13938static int __Pyx_State_AddModuleInterpIdAsIndex(__Pyx_ModuleStateLookupData **old_data, PyObject* module, int64_t interpreter_id) {
13939 Py_ssize_t to_allocate = (*old_data)->allocated;
13940 while (to_allocate <= interpreter_id) {
13941 if (to_allocate == 0) to_allocate = 1;
13942 else to_allocate *= 2;
13944 __Pyx_ModuleStateLookupData *new_data = *old_data;
13945 if (to_allocate != (*old_data)->allocated) {
13946 new_data = (__Pyx_ModuleStateLookupData *)realloc(
13948 sizeof(__Pyx_ModuleStateLookupData)+(to_allocate-1)*
sizeof(__Pyx_InterpreterIdAndModule));
13953 for (Py_ssize_t i = new_data->allocated; i < to_allocate; ++i) {
13954 new_data->table[i].id = i;
13955 new_data->table[i].module = NULL;
13957 new_data->allocated = to_allocate;
13959 new_data->table[interpreter_id].module =
module;
13960 if (new_data->count < interpreter_id+1) {
13961 new_data->count = interpreter_id+1;
13963 *old_data = new_data;
13966static void __Pyx_State_ConvertFromInterpIdAsIndex(__Pyx_ModuleStateLookupData *data) {
13967 __Pyx_InterpreterIdAndModule *read = data->table;
13968 __Pyx_InterpreterIdAndModule *write = data->table;
13969 __Pyx_InterpreterIdAndModule *end = read + data->count;
13970 for (; read<end; ++read) {
13971 if (read->module) {
13972 write->id = read->id;
13973 write->module = read->module;
13977 data->count = write - data->table;
13978 for (; write<end; ++write) {
13980 write->module = NULL;
13982 data->interpreter_id_as_index = 0;
13984static int __Pyx_State_AddModule(PyObject* module, CYTHON_UNUSED
void* dummy) {
13985 int64_t interpreter_id = PyInterpreterState_GetID(PyInterpreterState_Get());
13986 if (interpreter_id == -1)
return -1;
13988 __Pyx_ModuleStateLookup_Lock();
13989#if CYTHON_MODULE_STATE_LOOKUP_THREAD_SAFE
13990 __Pyx_ModuleStateLookupData *old_data = (__Pyx_ModuleStateLookupData *)
13991 __pyx_atomic_pointer_exchange(&__Pyx_ModuleStateLookup_data, 0);
13993 __Pyx_ModuleStateLookupData *old_data = __Pyx_ModuleStateLookup_data;
13995 __Pyx_ModuleStateLookupData *new_data = old_data;
13997 new_data = (__Pyx_ModuleStateLookupData *)calloc(1,
sizeof(__Pyx_ModuleStateLookupData));
14003 new_data->allocated = 1;
14004 new_data->interpreter_id_as_index = 1;
14006 __Pyx_ModuleStateLookup_wait_until_no_readers();
14007 if (new_data->interpreter_id_as_index) {
14008 if (interpreter_id < __PYX_MODULE_STATE_LOOKUP_SMALL_SIZE) {
14009 result = __Pyx_State_AddModuleInterpIdAsIndex(&new_data, module, interpreter_id);
14012 __Pyx_State_ConvertFromInterpIdAsIndex(new_data);
14015 Py_ssize_t insert_at = 0;
14017 __Pyx_InterpreterIdAndModule* lower_bound = __Pyx_State_FindModuleStateLookupTableLowerBound(
14018 new_data->table, new_data->count, interpreter_id);
14019 assert(lower_bound);
14020 insert_at = lower_bound - new_data->table;
14021 if (unlikely(insert_at < new_data->count && lower_bound->id == interpreter_id)) {
14022 lower_bound->module =
module;
14026 if (new_data->count+1 >= new_data->allocated) {
14027 Py_ssize_t to_allocate = (new_data->count+1)*2;
14029 (__Pyx_ModuleStateLookupData*)realloc(
14031 sizeof(__Pyx_ModuleStateLookupData) +
14032 (to_allocate-1)*
sizeof(__Pyx_InterpreterIdAndModule));
14035 new_data = old_data;
14039 new_data->allocated = to_allocate;
14042 int64_t last_id = interpreter_id;
14043 PyObject *last_module =
module;
14044 for (Py_ssize_t i=insert_at; i<new_data->count; ++i) {
14045 int64_t current_id = new_data->table[i].id;
14046 new_data->table[i].id = last_id;
14047 last_id = current_id;
14048 PyObject *current_module = new_data->table[i].module;
14049 new_data->table[i].module = last_module;
14050 last_module = current_module;
14054#if CYTHON_MODULE_STATE_LOOKUP_THREAD_SAFE
14055 __pyx_atomic_pointer_exchange(&__Pyx_ModuleStateLookup_data, new_data);
14057 __Pyx_ModuleStateLookup_data = new_data;
14059 __Pyx_ModuleStateLookup_Unlock();
14062static int __Pyx_State_RemoveModule(CYTHON_UNUSED
void* dummy) {
14063 int64_t interpreter_id = PyInterpreterState_GetID(PyInterpreterState_Get());
14064 if (interpreter_id == -1)
return -1;
14065 __Pyx_ModuleStateLookup_Lock();
14066#if CYTHON_MODULE_STATE_LOOKUP_THREAD_SAFE
14067 __Pyx_ModuleStateLookupData *data = (__Pyx_ModuleStateLookupData *)
14068 __pyx_atomic_pointer_exchange(&__Pyx_ModuleStateLookup_data, 0);
14070 __Pyx_ModuleStateLookupData *data = __Pyx_ModuleStateLookup_data;
14072 if (data->interpreter_id_as_index) {
14073 if (interpreter_id < data->count) {
14074 data->table[interpreter_id].module = NULL;
14079 __Pyx_ModuleStateLookup_wait_until_no_readers();
14080 __Pyx_InterpreterIdAndModule* lower_bound = __Pyx_State_FindModuleStateLookupTableLowerBound(
14081 data->table, data->count, interpreter_id);
14082 if (!lower_bound)
goto done;
14083 if (lower_bound->id != interpreter_id)
goto done;
14084 __Pyx_InterpreterIdAndModule *end = data->table+data->count;
14085 for (;lower_bound<end-1; ++lower_bound) {
14086 lower_bound->id = (lower_bound+1)->
id;
14087 lower_bound->module = (lower_bound+1)->module;
14091 if (data->count == 0) {
14096#if CYTHON_MODULE_STATE_LOOKUP_THREAD_SAFE
14097 __pyx_atomic_pointer_exchange(&__Pyx_ModuleStateLookup_data, data);
14099 __Pyx_ModuleStateLookup_data = data;
14101 __Pyx_ModuleStateLookup_Unlock();
14108#pragma warning( pop )
void dcopy_(const int *N, const double *X, const int *incX, double *Y, const int *incY)
int dgetrf_(int *m, int *n, double *a, int *lda, int *ipiv, int *info)
int dgeev_(char *jobvl, char *jobvr, int *n, double *a, int *lda, double *wr, double *wi, double *vl, int *ldvl, double *vr, int *ldvr, double *work, int *lwork, int *info)
int dgetrs_(char *trans, int *n, int *nrhs, double *a, int *lda, int *ipiv, double *b, int *ldb, int *info)