68#ifndef PY_SSIZE_T_CLEAN
69#define PY_SSIZE_T_CLEAN
72#if defined(Py_LIMITED_API)
73 #if !defined(CYTHON_LIMITED_API)
74 #define CYTHON_LIMITED_API 1
76#elif defined(CYTHON_LIMITED_API)
78 #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.")
80 #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.
86 #error Python headers needed to compile C extensions, please install development version of Python.
87#elif PY_VERSION_HEX < 0x03090000
88 #error Cython requires Python 3.9+.
89#elif defined(Py_LIMITED_API) && (Py_LIMITED_API & 0xFFFF0000) > (PY_VERSION_HEX & 0xFFFF0000)
90 #error 'Py_LIMITED_API' can only select past Python X.Y versions, not future ones.
92#define __PYX_ABI_VERSION "3_3_0"
93#define CYTHON_HEX_VERSION 0x030300F0
94#define CYTHON_FUTURE_DIVISION 1
98 #define offsetof(type, member) ( (size_t) & ((type*)0) -> member )
100#if !defined(_WIN32) && !defined(WIN32) && !defined(MS_WINDOWS)
112 #define __Pyx_has_cbuiltin(name) __has_builtin(name)
114 #define __Pyx_has_cbuiltin(name) (0)
117 #define DL_IMPORT(t) t
120 #define DL_EXPORT(t) t
124 #define PY_LONG_LONG LONG_LONG
127 #define Py_HUGE_VAL HUGE_VAL
129#define __PYX_LIMITED_VERSION_HEX PY_VERSION_HEX
130#if defined(CYTHON_LIMITED_API)
131 #ifdef Py_LIMITED_API
132 #undef __PYX_LIMITED_VERSION_HEX
133 #define __PYX_LIMITED_VERSION_HEX Py_LIMITED_API
134 #if Py_LIMITED_API < 0x03090000
135 #error "Cython 3.3 requires the Python Limited API version to be 3.9 or greater."
138 #if defined(GRAALVM_PYTHON) || defined(PYPY_VERSION)
140 #pragma message ("Py_LIMITED_API is defined on PyPy or GraalPy. This takes precedence over Cython's specialized\
141 code for PyPy and GraalPy and is unlikely to work.")
143 #warning "Py_LIMITED_API is defined on PyPy or GraalPy. This takes precedence over Cython's specialized\
144 code for PyPy and GraalPy and is unlikely to work."
147 #define CYTHON_COMPILING_IN_PYPY 0
148 #define CYTHON_COMPILING_IN_CPYTHON 0
149 #define CYTHON_COMPILING_IN_LIMITED_API 1
150 #define CYTHON_COMPILING_IN_GRAAL 0
151 #define CYTHON_COMPILING_IN_CPYTHON_FREETHREADING 0
152 #undef CYTHON_USE_TYPE_SLOTS
153 #define CYTHON_USE_TYPE_SLOTS 0
154 #undef CYTHON_USE_TYPE_SPECS
155 #define CYTHON_USE_TYPE_SPECS 1
156 #undef CYTHON_USE_PYTYPE_LOOKUP
157 #define CYTHON_USE_PYTYPE_LOOKUP 0
158 #undef CYTHON_USE_PYLIST_INTERNALS
159 #define CYTHON_USE_PYLIST_INTERNALS 0
160 #undef CYTHON_USE_UNICODE_INTERNALS
161 #define CYTHON_USE_UNICODE_INTERNALS 0
162 #ifndef CYTHON_USE_UNICODE_WRITER
163 #define CYTHON_USE_UNICODE_WRITER 0
165 #undef CYTHON_USE_PYLONG_INTERNALS
166 #define CYTHON_USE_PYLONG_INTERNALS 0
167 #ifndef CYTHON_AVOID_BORROWED_REFS
168 #define CYTHON_AVOID_BORROWED_REFS 0
170 #ifndef CYTHON_AVOID_THREAD_UNSAFE_BORROWED_REFS
171 #define CYTHON_AVOID_THREAD_UNSAFE_BORROWED_REFS 0
173 #undef CYTHON_ASSUME_SAFE_MACROS
174 #define CYTHON_ASSUME_SAFE_MACROS 0
175 #undef CYTHON_ASSUME_SAFE_SIZE
176 #define CYTHON_ASSUME_SAFE_SIZE 0
177 #undef CYTHON_UNPACK_METHODS
178 #define CYTHON_UNPACK_METHODS 0
179 #undef CYTHON_FAST_THREAD_STATE
180 #define CYTHON_FAST_THREAD_STATE 0
181 #undef CYTHON_FAST_GIL
182 #define CYTHON_FAST_GIL 0
183 #undef CYTHON_VECTORCALL
184 #define CYTHON_VECTORCALL (__PYX_LIMITED_VERSION_HEX >= 0x030C0000)
185 #ifndef CYTHON_VECTORCALL_TPNEW
186 #define CYTHON_VECTORCALL_TPNEW (CYTHON_VECTORCALL && __PYX_LIMITED_VERSION_HEX >= 0x030E0000)
188 #ifndef CYTHON_PEP487_INIT_SUBCLASS
189 #define CYTHON_PEP487_INIT_SUBCLASS 1
191 #ifndef CYTHON_PEP489_MULTI_PHASE_INIT
192 #define CYTHON_PEP489_MULTI_PHASE_INIT 1
194 #ifndef CYTHON_USE_MODULE_STATE
195 #define CYTHON_USE_MODULE_STATE 0
197 #undef CYTHON_USE_SYS_MONITORING
198 #define CYTHON_USE_SYS_MONITORING 0
199 #ifndef CYTHON_USE_TP_FINALIZE
200 #define CYTHON_USE_TP_FINALIZE (__PYX_LIMITED_VERSION_HEX >= 0x030F0000 && PY_VERSION_HEX > 0x030F00A8)
202 #ifndef CYTHON_USE_AM_SEND
203 #define CYTHON_USE_AM_SEND (__PYX_LIMITED_VERSION_HEX >= 0x030A0000)
205 #undef CYTHON_USE_DICT_VERSIONS
206 #define CYTHON_USE_DICT_VERSIONS 0
207 #undef CYTHON_USE_EXC_INFO_STACK
208 #define CYTHON_USE_EXC_INFO_STACK 0
209 #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC
210 #define CYTHON_UPDATE_DESCRIPTOR_DOC 0
212 #ifndef CYTHON_USE_OWN_PREP_RERAISE_STAR
213 #define CYTHON_USE_OWN_PREP_RERAISE_STAR 1
215 #ifndef CYTHON_USE_FREELISTS
216 #define CYTHON_USE_FREELISTS 1
218 #undef CYTHON_IMMORTAL_CONSTANTS
219 #define CYTHON_IMMORTAL_CONSTANTS 0
220 #if __PYX_LIMITED_VERSION_HEX < 0x030E0000
221 #undef CYTHON_OPAQUE_OBJECTS
222 #define CYTHON_OPAQUE_OBJECTS 0
223 #elif !defined(CYTHON_OPAQUE_OBJECTS)
224 #define CYTHON_OPAQUE_OBJECTS (__PYX_LIMITED_VERSION_HEX >= 0x030F0000)
226#elif defined(GRAALVM_PYTHON)
229 #define CYTHON_COMPILING_IN_PYPY 0
230 #define CYTHON_COMPILING_IN_CPYTHON 0
231 #define CYTHON_COMPILING_IN_LIMITED_API 0
232 #define CYTHON_COMPILING_IN_GRAAL 1
233 #define CYTHON_COMPILING_IN_CPYTHON_FREETHREADING 0
234 #ifndef CYTHON_USE_TYPE_SLOTS
235 #define CYTHON_USE_TYPE_SLOTS 0
237 #undef CYTHON_USE_TYPE_SPECS
238 #define CYTHON_USE_TYPE_SPECS 0
239 #undef CYTHON_USE_PYTYPE_LOOKUP
240 #define CYTHON_USE_PYTYPE_LOOKUP 0
241 #undef CYTHON_USE_PYLIST_INTERNALS
242 #define CYTHON_USE_PYLIST_INTERNALS 0
243 #undef CYTHON_USE_UNICODE_INTERNALS
244 #define CYTHON_USE_UNICODE_INTERNALS 0
245 #undef CYTHON_USE_UNICODE_WRITER
246 #define CYTHON_USE_UNICODE_WRITER 0
247 #undef CYTHON_USE_PYLONG_INTERNALS
248 #define CYTHON_USE_PYLONG_INTERNALS 0
249 #undef CYTHON_AVOID_BORROWED_REFS
250 #define CYTHON_AVOID_BORROWED_REFS 1
251 #undef CYTHON_AVOID_THREAD_UNSAFE_BORROWED_REFS
252 #define CYTHON_AVOID_THREAD_UNSAFE_BORROWED_REFS 0
253 #undef CYTHON_ASSUME_SAFE_MACROS
254 #define CYTHON_ASSUME_SAFE_MACROS 0
255 #undef CYTHON_ASSUME_SAFE_SIZE
256 #define CYTHON_ASSUME_SAFE_SIZE 0
257 #undef CYTHON_UNPACK_METHODS
258 #define CYTHON_UNPACK_METHODS 0
259 #undef CYTHON_FAST_THREAD_STATE
260 #define CYTHON_FAST_THREAD_STATE 0
261 #undef CYTHON_FAST_GIL
262 #define CYTHON_FAST_GIL 0
263 #ifndef CYTHON_VECTORCALL
264 #define CYTHON_VECTORCALL 1
266 #if CYTHON_USE_TYPE_SPECS && PY_VERSION_HEX < 0x030E0000
267 #undef CYTHON_VECTORCALL_TPNEW
268 #define CYTHON_VECTORCALL_TPNEW 0
269 #elif !defined(CYTHON_VECTORCALL_TPNEW)
270 #define CYTHON_VECTORCALL_TPNEW CYTHON_VECTORCALL
272 #ifndef CYTHON_PEP487_INIT_SUBCLASS
273 #define CYTHON_PEP487_INIT_SUBCLASS 1
275 #undef CYTHON_PEP489_MULTI_PHASE_INIT
276 #define CYTHON_PEP489_MULTI_PHASE_INIT 1
277 #undef CYTHON_USE_MODULE_STATE
278 #define CYTHON_USE_MODULE_STATE 0
279 #undef CYTHON_USE_SYS_MONITORING
280 #define CYTHON_USE_SYS_MONITORING 0
281 #undef CYTHON_USE_TP_FINALIZE
282 #define CYTHON_USE_TP_FINALIZE 0
283 #undef CYTHON_USE_AM_SEND
284 #define CYTHON_USE_AM_SEND 0
285 #undef CYTHON_USE_DICT_VERSIONS
286 #define CYTHON_USE_DICT_VERSIONS 0
287 #undef CYTHON_USE_EXC_INFO_STACK
288 #define CYTHON_USE_EXC_INFO_STACK 1
289 #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC
290 #define CYTHON_UPDATE_DESCRIPTOR_DOC 0
292 #ifndef CYTHON_USE_OWN_PREP_RERAISE_STAR
293 #define CYTHON_USE_OWN_PREP_RERAISE_STAR 1
295 #undef CYTHON_USE_FREELISTS
296 #define CYTHON_USE_FREELISTS 0
297 #undef CYTHON_IMMORTAL_CONSTANTS
298 #define CYTHON_IMMORTAL_CONSTANTS 0
299 #undef CYTHON_OPAQUE_OBJECTS
300 #define CYTHON_OPAQUE_OBJECTS 0
301#elif defined(PYPY_VERSION)
302 #define CYTHON_COMPILING_IN_PYPY 1
303 #define CYTHON_COMPILING_IN_CPYTHON 0
304 #define CYTHON_COMPILING_IN_LIMITED_API 0
305 #define CYTHON_COMPILING_IN_GRAAL 0
306 #define CYTHON_COMPILING_IN_CPYTHON_FREETHREADING 0
307 #undef CYTHON_USE_TYPE_SLOTS
308 #define CYTHON_USE_TYPE_SLOTS 1
309 #ifndef CYTHON_USE_TYPE_SPECS
310 #define CYTHON_USE_TYPE_SPECS 0
312 #undef CYTHON_USE_PYTYPE_LOOKUP
313 #define CYTHON_USE_PYTYPE_LOOKUP 0
314 #undef CYTHON_USE_PYLIST_INTERNALS
315 #define CYTHON_USE_PYLIST_INTERNALS 0
316 #undef CYTHON_USE_UNICODE_INTERNALS
317 #define CYTHON_USE_UNICODE_INTERNALS 0
318 #undef CYTHON_USE_UNICODE_WRITER
319 #define CYTHON_USE_UNICODE_WRITER 0
320 #undef CYTHON_USE_PYLONG_INTERNALS
321 #define CYTHON_USE_PYLONG_INTERNALS 0
322 #undef CYTHON_AVOID_BORROWED_REFS
323 #define CYTHON_AVOID_BORROWED_REFS 1
324 #undef CYTHON_AVOID_THREAD_UNSAFE_BORROWED_REFS
325 #define CYTHON_AVOID_THREAD_UNSAFE_BORROWED_REFS 1
326 #undef CYTHON_ASSUME_SAFE_MACROS
327 #define CYTHON_ASSUME_SAFE_MACROS 0
328 #ifndef CYTHON_ASSUME_SAFE_SIZE
329 #define CYTHON_ASSUME_SAFE_SIZE 1
331 #undef CYTHON_UNPACK_METHODS
332 #define CYTHON_UNPACK_METHODS 0
333 #undef CYTHON_FAST_THREAD_STATE
334 #define CYTHON_FAST_THREAD_STATE 0
335 #undef CYTHON_FAST_GIL
336 #define CYTHON_FAST_GIL 0
337 #ifndef CYTHON_VECTORCALL
338 #define CYTHON_VECTORCALL 1
340 #if CYTHON_USE_TYPE_SPECS && PY_VERSION_HEX < 0x030E0000
341 #undef CYTHON_VECTORCALL_TPNEW
342 #define CYTHON_VECTORCALL_TPNEW 0
343 #elif !defined(CYTHON_VECTORCALL_TPNEW)
344 #define CYTHON_VECTORCALL_TPNEW (PYPY_VERSION_NUM >= 0x07030800 && CYTHON_VECTORCALL)
346 #ifndef CYTHON_PEP487_INIT_SUBCLASS
347 #define CYTHON_PEP487_INIT_SUBCLASS 1
349 #ifndef CYTHON_PEP489_MULTI_PHASE_INIT
350 #define CYTHON_PEP489_MULTI_PHASE_INIT 1
352 #undef CYTHON_USE_MODULE_STATE
353 #define CYTHON_USE_MODULE_STATE 0
354 #undef CYTHON_USE_SYS_MONITORING
355 #define CYTHON_USE_SYS_MONITORING 0
356 #ifndef CYTHON_USE_TP_FINALIZE
357 #define CYTHON_USE_TP_FINALIZE (PYPY_VERSION_NUM >= 0x07030C00)
359 #undef CYTHON_USE_AM_SEND
360 #define CYTHON_USE_AM_SEND 0
361 #undef CYTHON_USE_DICT_VERSIONS
362 #define CYTHON_USE_DICT_VERSIONS 0
363 #undef CYTHON_USE_EXC_INFO_STACK
364 #define CYTHON_USE_EXC_INFO_STACK 0
365 #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC
366 #define CYTHON_UPDATE_DESCRIPTOR_DOC (PYPY_VERSION_NUM >= 0x07031100)
368 #ifndef CYTHON_USE_OWN_PREP_RERAISE_STAR
369 #define CYTHON_USE_OWN_PREP_RERAISE_STAR 1
371 #undef CYTHON_USE_FREELISTS
372 #define CYTHON_USE_FREELISTS 0
373 #undef CYTHON_IMMORTAL_CONSTANTS
374 #define CYTHON_IMMORTAL_CONSTANTS 0
375 #undef CYTHON_OPAQUE_OBJECTS
376 #define CYTHON_OPAQUE_OBJECTS 0
378 #define CYTHON_COMPILING_IN_PYPY 0
379 #define CYTHON_COMPILING_IN_CPYTHON 1
380 #define CYTHON_COMPILING_IN_LIMITED_API 0
381 #define CYTHON_COMPILING_IN_GRAAL 0
382 #ifdef Py_GIL_DISABLED
383 #define CYTHON_COMPILING_IN_CPYTHON_FREETHREADING 1
385 #define CYTHON_COMPILING_IN_CPYTHON_FREETHREADING 0
387 #if PY_VERSION_HEX < 0x030A0000
388 #undef CYTHON_USE_TYPE_SLOTS
389 #define CYTHON_USE_TYPE_SLOTS 1
390 #elif !defined(CYTHON_USE_TYPE_SLOTS)
391 #define CYTHON_USE_TYPE_SLOTS 1
393 #ifndef CYTHON_USE_TYPE_SPECS
394 #define CYTHON_USE_TYPE_SPECS 0
396 #ifndef CYTHON_USE_PYTYPE_LOOKUP
397 #define CYTHON_USE_PYTYPE_LOOKUP 1
399 #ifndef CYTHON_USE_PYLONG_INTERNALS
400 #define CYTHON_USE_PYLONG_INTERNALS 1
402 #if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING
403 #undef CYTHON_USE_PYLIST_INTERNALS
404 #define CYTHON_USE_PYLIST_INTERNALS 0
405 #elif !defined(CYTHON_USE_PYLIST_INTERNALS)
406 #define CYTHON_USE_PYLIST_INTERNALS 1
408 #ifndef CYTHON_USE_UNICODE_INTERNALS
409 #define CYTHON_USE_UNICODE_INTERNALS 1
411 #if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING || PY_VERSION_HEX >= 0x030B00A2
412 #undef CYTHON_USE_UNICODE_WRITER
413 #define CYTHON_USE_UNICODE_WRITER 0
414 #elif !defined(CYTHON_USE_UNICODE_WRITER)
415 #define CYTHON_USE_UNICODE_WRITER 1
417 #ifndef CYTHON_AVOID_BORROWED_REFS
418 #define CYTHON_AVOID_BORROWED_REFS 0
420 #if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING
421 #undef CYTHON_AVOID_THREAD_UNSAFE_BORROWED_REFS
422 #define CYTHON_AVOID_THREAD_UNSAFE_BORROWED_REFS 1
423 #elif !defined(CYTHON_AVOID_THREAD_UNSAFE_BORROWED_REFS)
424 #define CYTHON_AVOID_THREAD_UNSAFE_BORROWED_REFS 0
426 #ifndef CYTHON_ASSUME_SAFE_MACROS
427 #define CYTHON_ASSUME_SAFE_MACROS 1
429 #ifndef CYTHON_ASSUME_SAFE_SIZE
430 #define CYTHON_ASSUME_SAFE_SIZE 1
432 #ifndef CYTHON_UNPACK_METHODS
433 #define CYTHON_UNPACK_METHODS 1
435 #ifndef CYTHON_FAST_THREAD_STATE
436 #define CYTHON_FAST_THREAD_STATE 1
438 #if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING
439 #undef CYTHON_FAST_GIL
440 #define CYTHON_FAST_GIL 0
441 #elif !defined(CYTHON_FAST_GIL)
442 #define CYTHON_FAST_GIL (PY_VERSION_HEX < 0x030C00A6)
444 #ifndef CYTHON_VECTORCALL
445 #define CYTHON_VECTORCALL 1
447 #if CYTHON_USE_TYPE_SPECS && PY_VERSION_HEX < 0x030E0000
448 #undef CYTHON_VECTORCALL_TPNEW
449 #define CYTHON_VECTORCALL_TPNEW 0
450 #elif !defined(CYTHON_VECTORCALL_TPNEW)
451 #define CYTHON_VECTORCALL_TPNEW CYTHON_VECTORCALL
453 #ifndef CYTHON_PEP487_INIT_SUBCLASS
454 #define CYTHON_PEP487_INIT_SUBCLASS 1
456 #ifndef CYTHON_PEP489_MULTI_PHASE_INIT
457 #define CYTHON_PEP489_MULTI_PHASE_INIT 1
459 #ifndef CYTHON_USE_MODULE_STATE
460 #define CYTHON_USE_MODULE_STATE 0
462 #ifndef CYTHON_USE_SYS_MONITORING
463 #define CYTHON_USE_SYS_MONITORING (PY_VERSION_HEX >= 0x030d00B1)
465 #ifndef CYTHON_USE_TP_FINALIZE
466 #define CYTHON_USE_TP_FINALIZE 1
468 #ifndef CYTHON_USE_AM_SEND
469 #define CYTHON_USE_AM_SEND 1
471 #if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING
472 #undef CYTHON_USE_DICT_VERSIONS
473 #define CYTHON_USE_DICT_VERSIONS 0
474 #elif !defined(CYTHON_USE_DICT_VERSIONS)
475 #define CYTHON_USE_DICT_VERSIONS (PY_VERSION_HEX < 0x030C00A5 && !CYTHON_USE_MODULE_STATE)
477 #ifndef CYTHON_USE_EXC_INFO_STACK
478 #define CYTHON_USE_EXC_INFO_STACK 1
480 #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC
481 #define CYTHON_UPDATE_DESCRIPTOR_DOC 1
483 #ifndef CYTHON_USE_OWN_PREP_RERAISE_STAR
484 #define CYTHON_USE_OWN_PREP_RERAISE_STAR (PY_VERSION_HEX < 0x030C00B2)
486 #ifndef CYTHON_USE_FREELISTS
487 #define CYTHON_USE_FREELISTS (!CYTHON_COMPILING_IN_CPYTHON_FREETHREADING)
489 #if defined(CYTHON_IMMORTAL_CONSTANTS) && PY_VERSION_HEX < 0x030C0000
490 #undef CYTHON_IMMORTAL_CONSTANTS
491 #define CYTHON_IMMORTAL_CONSTANTS 0
492 #elif !defined(CYTHON_IMMORTAL_CONSTANTS)
493 #define CYTHON_IMMORTAL_CONSTANTS (PY_VERSION_HEX >= 0x030C0000 && !CYTHON_USE_MODULE_STATE && CYTHON_COMPILING_IN_CPYTHON_FREETHREADING)
495 #ifndef CYTHON_OPAQUE_OBJECTS
496 #define CYTHON_OPAQUE_OBJECTS 0
499#if CYTHON_USE_PYLONG_INTERNALS
504 enum { __pyx_check_sizeof_voidp = 1 / (int)(SIZEOF_VOID_P ==
sizeof(
void*)) };
507#ifndef __has_attribute
508 #define __has_attribute(x) 0
510#ifndef __has_cpp_attribute
511 #define __has_cpp_attribute(x) 0
513#ifndef CYTHON_RESTRICT
514 #if defined(__GNUC__)
515 #define CYTHON_RESTRICT __restrict__
516 #elif defined(_MSC_VER) && _MSC_VER >= 1400
517 #define CYTHON_RESTRICT __restrict
518 #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
519 #define CYTHON_RESTRICT restrict
521 #define CYTHON_RESTRICT
525 #if defined(__cplusplus)
528 #if ((defined(_MSVC_LANG) && _MSVC_LANG >= 201703L) || __cplusplus >= 201703L)
529 #if __has_cpp_attribute(maybe_unused)
530 #define CYTHON_UNUSED [[maybe_unused]]
533 #elif defined(__STDC_VERSION__) && __STDC_VERSION__ >= 202311L
534 #define CYTHON_UNUSED [[maybe_unused]]
538# if defined(__GNUC__)
539# if !(defined(__cplusplus)) || (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4))
540# define CYTHON_UNUSED __attribute__ ((__unused__))
542# define CYTHON_UNUSED
544# elif defined(__ICC) || (defined(__INTEL_COMPILER) && !defined(_MSC_VER))
545# define CYTHON_UNUSED __attribute__ ((__unused__))
547# define CYTHON_UNUSED
550#ifndef CYTHON_UNUSED_VAR
551# if defined(__cplusplus)
552 template<
class T>
void CYTHON_UNUSED_VAR(
const T& ) { }
554# define CYTHON_UNUSED_VAR(x) (void)(x)
557#ifndef CYTHON_MAYBE_UNUSED_VAR
558 #define CYTHON_MAYBE_UNUSED_VAR(x) CYTHON_UNUSED_VAR(x)
560#ifndef CYTHON_NCP_UNUSED
561# if CYTHON_COMPILING_IN_CPYTHON && !CYTHON_COMPILING_IN_CPYTHON_FREETHREADING
562# define CYTHON_NCP_UNUSED
564# define CYTHON_NCP_UNUSED CYTHON_UNUSED
567#ifndef CYTHON_USE_CPP_STD_MOVE
568 #if defined(__cplusplus) && (\
569 __cplusplus >= 201103L || (defined(_MSC_VER) && _MSC_VER >= 1600))
570 #define CYTHON_USE_CPP_STD_MOVE 1
572 #define CYTHON_USE_CPP_STD_MOVE 0
575#define __Pyx_void_to_None(void_result) ((void)(void_result), Py_INCREF(Py_None), Py_None)
577typedef uintptr_t __pyx_uintptr_t;
578#ifndef CYTHON_FALLTHROUGH
579 #if defined(__cplusplus)
582 #if ((defined(_MSVC_LANG) && _MSVC_LANG >= 201703L) || __cplusplus >= 201703L)
583 #if __has_cpp_attribute(fallthrough)
584 #define CYTHON_FALLTHROUGH [[fallthrough]]
587 #ifndef CYTHON_FALLTHROUGH
588 #if __has_cpp_attribute(clang::fallthrough)
589 #define CYTHON_FALLTHROUGH [[clang::fallthrough]]
590 #elif __has_cpp_attribute(gnu::fallthrough)
591 #define CYTHON_FALLTHROUGH [[gnu::fallthrough]]
595 #ifndef CYTHON_FALLTHROUGH
596 #if __has_attribute(fallthrough)
597 #define CYTHON_FALLTHROUGH __attribute__((fallthrough))
599 #define CYTHON_FALLTHROUGH
602 #if defined(__clang__) && defined(__apple_build_version__)
603 #if __apple_build_version__ < 7000000
604 #undef CYTHON_FALLTHROUGH
605 #define CYTHON_FALLTHROUGH
610 #define __Pyx_UNREACHABLE() Py_UNREACHABLE()
611#elif __Pyx_has_cbuiltin(__builtin_unreachable)
612 #define __Pyx_UNREACHABLE() __builtin_unreachable()
613#elif defined(__clang__) || defined(__INTEL_COMPILER) || (defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 5)))
614 #define __Pyx_UNREACHABLE() __builtin_unreachable()
615#elif defined(_MSC_VER)
616 #define __Pyx_UNREACHABLE() __assume(0)
618 #define __Pyx_UNREACHABLE() Py_FatalError("Unreachable C code path reached")
620#ifndef Py_UNREACHABLE
621 #define Py_UNREACHABLE() __Pyx_UNREACHABLE()
624 template <
typename T>
625 struct __PYX_IS_UNSIGNED_IMPL {
static const bool value =
T(0) <
T(-1);};
626 #define __PYX_IS_UNSIGNED(type) (__PYX_IS_UNSIGNED_IMPL<type>::value)
628 #define __PYX_IS_UNSIGNED(type) (((type)-1) > 0)
630#if CYTHON_COMPILING_IN_PYPY == 1
631 #define __PYX_NEED_TP_PRINT_SLOT (PY_VERSION_HEX < 0x030A0000)
633 #define __PYX_NEED_TP_PRINT_SLOT 0
635#define __PYX_REINTERPRET_FUNCION(func_pointer, other_pointer) ((func_pointer)(void(*)(void))(other_pointer))
636#if __PYX_LIMITED_VERSION_HEX < 0x030C0000
637#define __Pyx_PyErr_FetchException(petype, peval, petb) PyErr_Fetch(petype, peval, petb)
638#define __Pyx_PyErr_RestoreException(etype, eval, etb) PyErr_Restore(etype, eval, etb)
640#define __Pyx_PyErr_FetchException(petype, peval, petb) *(petype)=NULL; *(peval)=PyErr_GetRaisedException(); *(petb)=NULL
641#define __Pyx_PyErr_RestoreException(etype, eval, etb) PyErr_SetRaisedException(eval)
646 #if defined(__clang__)
647 #define CYTHON_INLINE __inline__ __attribute__ ((__unused__))
648 #elif defined(__GNUC__)
649 #define CYTHON_INLINE __inline__
650 #elif defined(_MSC_VER)
651 #define CYTHON_INLINE __inline
652 #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
653 #define CYTHON_INLINE inline
655 #define CYTHON_INLINE
660#define __PYX_BUILD_PY_SSIZE_T "n"
661#define CYTHON_FORMAT_SSIZE_T "z"
662#define __Pyx_BUILTIN_MODULE_NAME "builtins"
663#define __Pyx_DefaultClassType PyType_Type
664#if CYTHON_COMPILING_IN_LIMITED_API
666 static int CO_OPTIMIZED;
669 static int CO_NEWLOCALS;
672 static int CO_VARARGS;
674 #ifndef CO_VARKEYWORDS
675 static int CO_VARKEYWORDS;
677 #ifndef CO_ASYNC_GENERATOR
678 static int CO_ASYNC_GENERATOR;
681 static int CO_GENERATOR;
684 static int CO_COROUTINE;
688 #define CO_COROUTINE 0x80
690 #ifndef CO_ASYNC_GENERATOR
691 #define CO_ASYNC_GENERATOR 0x200
694static int __Pyx_init_co_variables(
void);
695#if PY_VERSION_HEX >= 0x030A00B1 || defined(Py_Is)
696 #define __Pyx_Py_Is(x, y) Py_Is(x, y)
698 #define __Pyx_Py_Is(x, y) ((x) == (y))
700#if PY_VERSION_HEX >= 0x030A00B1 || defined(Py_IsNone)
701 #define __Pyx_Py_IsNone(ob) Py_IsNone(ob)
703 #define __Pyx_Py_IsNone(ob) __Pyx_Py_Is((ob), Py_None)
705#if PY_VERSION_HEX >= 0x030A00B1 || defined(Py_IsTrue)
706 #define __Pyx_Py_IsTrue(ob) Py_IsTrue(ob)
708 #define __Pyx_Py_IsTrue(ob) __Pyx_Py_Is((ob), Py_True)
710#if PY_VERSION_HEX >= 0x030A00B1 || defined(Py_IsFalse)
711 #define __Pyx_Py_IsFalse(ob) Py_IsFalse(ob)
713 #define __Pyx_Py_IsFalse(ob) __Pyx_Py_Is((ob), Py_False)
715#define __Pyx_NoneAsNull(obj) (__Pyx_Py_IsNone(obj) ? NULL : (obj))
716#if CYTHON_COMPILING_IN_PYPY
717 #define __Pyx_PyObject_GC_IsFinalized(o) _PyGC_FINALIZED(o)
719 #define __Pyx_PyObject_GC_IsFinalized(o) PyObject_GC_IsFinalized(o)
721#if CYTHON_COMPILING_IN_LIMITED_API
722static unsigned long __Pyx_Runtime_TPFLAGS_SEQUENCE;
723static unsigned long __Pyx_Runtime_TPFLAGS_MAPPING;
725#define __Pyx_Runtime_TPFLAGS_SEQUENCE Py_TPFLAGS_SEQUENCE
726#define __Pyx_Runtime_TPFLAGS_MAPPING Py_TPFLAGS_MAPPING
728static int __Pyx_init_tpflags_variables(
void);
729#ifndef Py_TPFLAGS_HAVE_FINALIZE
730 #define Py_TPFLAGS_HAVE_FINALIZE 0
732#ifndef Py_TPFLAGS_SEQUENCE
733 #define Py_TPFLAGS_SEQUENCE (CYTHON_COMPILING_IN_LIMITED_API ? 0 : 1 << 5)
735#ifndef Py_TPFLAGS_MAPPING
736 #define Py_TPFLAGS_MAPPING (CYTHON_COMPILING_IN_LIMITED_API ? 0 : 1 << 6)
738#ifndef Py_TPFLAGS_IMMUTABLETYPE
739 #define Py_TPFLAGS_IMMUTABLETYPE (1UL << 8)
741#ifndef Py_TPFLAGS_DISALLOW_INSTANTIATION
742 #define Py_TPFLAGS_DISALLOW_INSTANTIATION (1UL << 7)
744#ifndef METH_STACKLESS
745 #define METH_STACKLESS 0
747#if !defined(METH_FASTCALL) || CYTHON_COMPILING_IN_PYPY
748 #ifndef METH_FASTCALL
749 #define METH_FASTCALL 0x80
751 typedef PyObject *(*__Pyx_PyCFunctionFast) (PyObject *self, PyObject *
const *args, Py_ssize_t nargs);
752 typedef PyObject *(*__Pyx_PyCFunctionFastWithKeywords) (PyObject *self, PyObject *
const *args,
753 Py_ssize_t nargs, PyObject *kwnames);
755 #if PY_VERSION_HEX >= 0x030d00A4
756 # define __Pyx_PyCFunctionFast PyCFunctionFast
757 # define __Pyx_PyCFunctionFastWithKeywords PyCFunctionFastWithKeywords
759 # define __Pyx_PyCFunctionFast _PyCFunctionFast
760 # define __Pyx_PyCFunctionFastWithKeywords _PyCFunctionFastWithKeywords
764 #define __Pyx_METH_FASTCALL METH_FASTCALL
765 #define __Pyx_PyCFunction_FastCall __Pyx_PyCFunctionFast
766 #define __Pyx_PyCFunction_FastCallWithKeywords __Pyx_PyCFunctionFastWithKeywords
768 #define __Pyx_METH_FASTCALL METH_VARARGS
769 #define __Pyx_PyCFunction_FastCall PyCFunction
770 #define __Pyx_PyCFunction_FastCallWithKeywords PyCFunctionWithKeywords
773 #define __pyx_vectorcallfunc vectorcallfunc
774 #define __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET PY_VECTORCALL_ARGUMENTS_OFFSET
775 #define __Pyx_PyVectorcall_NARGS(n) PyVectorcall_NARGS((size_t)(n))
777 #define __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET 0
778 #define __Pyx_PyVectorcall_NARGS(n) ((Py_ssize_t)(n))
780#define __Pyx_PyCFunction_CheckExact(func) PyCFunction_CheckExact(func)
781#define __Pyx_CyOrPyCFunction_Check(func) PyCFunction_Check(func)
782#if CYTHON_COMPILING_IN_CPYTHON
783#define __Pyx_CyOrPyCFunction_GET_FUNCTION(func) (((PyCFunctionObject*)(func))->m_ml->ml_meth)
784#elif !CYTHON_COMPILING_IN_LIMITED_API
785#define __Pyx_CyOrPyCFunction_GET_FUNCTION(func) PyCFunction_GET_FUNCTION(func)
787#if CYTHON_COMPILING_IN_CPYTHON
788#define __Pyx_CyOrPyCFunction_GET_FLAGS(func) (((PyCFunctionObject*)(func))->m_ml->ml_flags)
789static CYTHON_INLINE PyObject* __Pyx_CyOrPyCFunction_GET_SELF(PyObject *func) {
790 return (__Pyx_CyOrPyCFunction_GET_FLAGS(func) & METH_STATIC) ? NULL : ((PyCFunctionObject*)func)->m_self;
793static CYTHON_INLINE
int __Pyx__IsSameCFunction(PyObject *func,
void (*cfunc)(
void)) {
794#if CYTHON_COMPILING_IN_LIMITED_API
795 return PyCFunction_Check(func) && PyCFunction_GetFunction(func) == (PyCFunction) cfunc;
797 return PyCFunction_Check(func) && PyCFunction_GET_FUNCTION(func) == (PyCFunction) cfunc;
800#define __Pyx_IsSameCFunction(func, cfunc) __Pyx__IsSameCFunction(func, cfunc)
801#if CYTHON_COMPILING_IN_LIMITED_API && __PYX_LIMITED_VERSION_HEX < 0x030A0000
802 #define __Pyx_PyType_FromModuleAndSpec(m, s, b) ((void)m, PyType_FromSpecWithBases(s, b))
804 #define __Pyx_PyType_FromModuleAndSpec(m, s, b) PyType_FromModuleAndSpec(m, s, b)
806#if CYTHON_COMPILING_IN_PYPY
807 typedef PyObject *(*__Pyx_PyCMethod)(PyObject *, PyTypeObject *, PyObject *
const *, size_t, PyObject *);
809 #define __Pyx_PyCMethod PyCMethod
812 #define METH_METHOD 0x200
814#if CYTHON_COMPILING_IN_PYPY && !defined(PyObject_Malloc)
815 #define PyObject_Malloc(s) PyMem_Malloc(s)
816 #define PyObject_Free(p) PyMem_Free(p)
817 #define PyObject_Realloc(p) PyMem_Realloc(p)
819#if CYTHON_COMPILING_IN_LIMITED_API
820 #define __Pyx_PyFrame_SetLineNumber(frame, lineno)
821#elif CYTHON_COMPILING_IN_GRAAL && defined(GRAALPY_VERSION_NUM) && GRAALPY_VERSION_NUM > 0x19000000
822 #define __Pyx_PyCode_HasFreeVars(co) (PyCode_GetNumFree(co) > 0)
823 #define __Pyx_PyFrame_SetLineNumber(frame, lineno) GraalPyFrame_SetLineNumber((frame), (lineno))
824#elif CYTHON_COMPILING_IN_GRAAL
825 #define __Pyx_PyCode_HasFreeVars(co) (PyCode_GetNumFree(co) > 0)
826 #define __Pyx_PyFrame_SetLineNumber(frame, lineno) _PyFrame_SetLineNumber((frame), (lineno))
828 #define __Pyx_PyCode_HasFreeVars(co) (PyCode_GetNumFree(co) > 0)
829 #define __Pyx_PyFrame_SetLineNumber(frame, lineno) (frame)->f_lineno = (lineno)
831#if CYTHON_COMPILING_IN_LIMITED_API
832 #define __Pyx_PyThreadState_Current PyThreadState_Get()
833#elif !CYTHON_FAST_THREAD_STATE
834 #define __Pyx_PyThreadState_Current PyThreadState_GET()
835#elif PY_VERSION_HEX >= 0x030d00A1
836 #define __Pyx_PyThreadState_Current PyThreadState_GetUnchecked()
838 #define __Pyx_PyThreadState_Current _PyThreadState_UncheckedGet()
840#if CYTHON_OPAQUE_OBJECTS && CYTHON_COMPILING_IN_LIMITED_API
841 #define __PYX_SHARED_SIZEOF(T) -((int)sizeof(T))
842 #define __PYX_SHARED_RELATIVE_OFFSET Py_RELATIVE_OFFSET
843 #define CYTHON_OPAQUE_SHARED_TYPES 1
845 #define __PYX_SHARED_SIZEOF(T) sizeof(T)
846 #define __PYX_SHARED_RELATIVE_OFFSET 0
847 #define CYTHON_OPAQUE_SHARED_TYPES 0
849#if CYTHON_USE_MODULE_STATE
850static CYTHON_INLINE
void *__Pyx__PyModule_GetState(PyObject *op)
853 result = PyModule_GetState(op);
855 Py_FatalError(
"Couldn't find the module state");
858#define __Pyx_PyModule_GetState(o) (__pyx_mstatetype *)__Pyx__PyModule_GetState(o)
860#define __Pyx_PyModule_GetState(op) ((void)op,__pyx_mstate_global)
862#define __Pyx_PyObject_GetSlot(obj, name, func_ctype) __Pyx_PyType_GetSlot(Py_TYPE((PyObject *) obj), name, func_ctype)
863#define __Pyx_PyObject_TryGetSlot(obj, name, func_ctype) __Pyx_PyType_TryGetSlot(Py_TYPE(obj), name, func_ctype)
864#define __Pyx_PyObject_GetSubSlot(obj, sub, name, func_ctype) __Pyx_PyType_GetSubSlot(Py_TYPE(obj), sub, name, func_ctype)
865#define __Pyx_PyObject_TryGetSubSlot(obj, sub, name, func_ctype) __Pyx_PyType_TryGetSubSlot(Py_TYPE(obj), sub, name, func_ctype)
866#if CYTHON_USE_TYPE_SLOTS
867 #define __Pyx_PyType_GetSlot(type, name, func_ctype) ((type)->name)
868 #define __Pyx_PyType_TryGetSlot(type, name, func_ctype) __Pyx_PyType_GetSlot(type, name, func_ctype)
869 #define __Pyx_PyType_GetSubSlot(type, sub, name, func_ctype) (((type)->sub) ? ((type)->sub->name) : NULL)
870 #define __Pyx_PyType_TryGetSubSlot(type, sub, name, func_ctype) __Pyx_PyType_GetSubSlot(type, sub, name, func_ctype)
872 #define __Pyx_PyType_GetSlot(type, name, func_ctype) ((func_ctype) PyType_GetSlot((type), Py_##name))
873 #define __Pyx_PyType_TryGetSlot(type, name, func_ctype)\
874 ((__PYX_LIMITED_VERSION_HEX >= 0x030A0000 ||\
875 (PyType_GetFlags(type) & Py_TPFLAGS_HEAPTYPE) || __Pyx_get_runtime_version() >= 0x030A0000) ?\
876 __Pyx_PyType_GetSlot(type, name, func_ctype) : NULL)
877 #define __Pyx_PyType_GetSubSlot(obj, sub, name, func_ctype) __Pyx_PyType_GetSlot(obj, name, func_ctype)
878 #define __Pyx_PyType_TryGetSubSlot(obj, sub, name, func_ctype) __Pyx_PyType_TryGetSlot(obj, name, func_ctype)
880#if CYTHON_COMPILING_IN_CPYTHON || defined(_PyDict_NewPresized)
881#define __Pyx_PyDict_NewPresized(n) ((n <= 8) ? PyDict_New() : _PyDict_NewPresized(n))
883#define __Pyx_PyDict_NewPresized(n) PyDict_New()
885#define __Pyx_PyNumber_Divide(x,y) PyNumber_TrueDivide(x,y)
886#define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceTrueDivide(x,y)
887#if CYTHON_COMPILING_IN_CPYTHON && CYTHON_USE_UNICODE_INTERNALS
888#define __Pyx_PyDict_GetItemStrWithError(dict, name) _PyDict_GetItem_KnownHash(dict, name, ((PyASCIIObject *) name)->hash)
889static CYTHON_INLINE PyObject * __Pyx_PyDict_GetItemStr(PyObject *dict, PyObject *name) {
890 PyObject *res = __Pyx_PyDict_GetItemStrWithError(dict, name);
891 if (res == NULL && PyErr_Occurred()) {
892 PyErr_WriteUnraisable(NULL);
896#elif !CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07020000
897#define __Pyx_PyDict_GetItemStrWithError PyDict_GetItemWithError
898#define __Pyx_PyDict_GetItemStr PyDict_GetItem
900static CYTHON_INLINE PyObject * __Pyx_PyDict_GetItemStrWithError(PyObject *dict, PyObject *name) {
901#if CYTHON_COMPILING_IN_PYPY
902 return PyDict_GetItem(dict, name);
905 PyDictObject *mp = (PyDictObject*) dict;
906 long hash = ((PyStringObject *) name)->ob_shash;
908 ep = (mp->ma_lookup)(mp, name, hash);
915#define __Pyx_PyDict_GetItemStr PyDict_GetItem
917#if CYTHON_USE_TYPE_SLOTS
918 #define __Pyx_PyType_GetFlags(tp) (((PyTypeObject *)tp)->tp_flags)
919 #define __Pyx_PyType_HasFeature(type, feature) ((__Pyx_PyType_GetFlags(type) & (feature)) != 0)
921 #define __Pyx_PyType_GetFlags(tp) (PyType_GetFlags((PyTypeObject *)tp))
922 #define __Pyx_PyType_HasFeature(type, feature) PyType_HasFeature(type, feature)
924#define __Pyx_PyObject_GetIterNextFunc(iterator) __Pyx_PyObject_GetSlot(iterator, tp_iternext, iternextfunc)
925#if CYTHON_USE_TYPE_SPECS
926#define __Pyx_PyHeapTypeObject_GC_Del(obj) {\
927 PyTypeObject *type = Py_TYPE((PyObject*)obj);\
928 assert(__Pyx_PyType_HasFeature(type, Py_TPFLAGS_HEAPTYPE));\
929 PyObject_GC_Del(obj);\
933#define __Pyx_PyHeapTypeObject_GC_Del(obj) PyObject_GC_Del(obj)
935#if CYTHON_COMPILING_IN_LIMITED_API
936 #define __Pyx_PyUnicode_READY(op) (0)
937 #define __Pyx_PyUnicode_READ_CHAR(u, i) PyUnicode_ReadChar(u, i)
938 #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u) ((void)u, 1114111U)
939 #define __Pyx_PyUnicode_KIND(u) ((void)u, (0))
940 #define __Pyx_PyUnicode_KIND_04(u) __Pyx_PyUnicode_KIND(u)
941 #define __Pyx_PyUnicode_DATA(u) ((void*)u)
942 #define __Pyx_PyUnicode_READ(k, d, i) ((void)k, PyUnicode_ReadChar((PyObject*)(d), i))
943 #define __Pyx_PyUnicode_IS_TRUE(u) (0 != PyUnicode_GetLength(u))
945 #if PY_VERSION_HEX >= 0x030C0000
946 #define __Pyx_PyUnicode_READY(op) (0)
948 #define __Pyx_PyUnicode_READY(op) (likely(PyUnicode_IS_READY(op)) ?\
949 0 : _PyUnicode_Ready((PyObject *)(op)))
951 #define __Pyx_PyUnicode_READ_CHAR(u, i) PyUnicode_READ_CHAR(u, i)
952 #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u) PyUnicode_MAX_CHAR_VALUE(u)
953 #define __Pyx_PyUnicode_KIND(u) ((int)PyUnicode_KIND(u))
954 #define __Pyx_PyUnicode_DATA(u) PyUnicode_DATA(u)
955 #define __Pyx_PyUnicode_READ(k, d, i) PyUnicode_READ(k, d, i)
956 #define __Pyx_PyUnicode_WRITE(k, d, i, ch) PyUnicode_WRITE(k, d, i, (Py_UCS4) ch)
957 #if PY_VERSION_HEX >= 0x030C0000
958 #define __Pyx_PyUnicode_IS_TRUE(u) (0 != PyUnicode_GET_LENGTH(u))
960 #if CYTHON_COMPILING_IN_CPYTHON
961 #define __Pyx_PyUnicode_IS_TRUE(u) (0 != (likely(PyUnicode_IS_READY(u)) ? PyUnicode_GET_LENGTH(u) : ((PyCompactUnicodeObject *)(u))->wstr_length))
963 #define __Pyx_PyUnicode_IS_TRUE(u) (0 != (likely(PyUnicode_IS_READY(u)) ? PyUnicode_GET_LENGTH(u) : PyUnicode_GET_SIZE(u)))
966 static CYTHON_INLINE
int __Pyx_PyUnicode_KIND_04(PyObject *o) {
967 return __Pyx_PyUnicode_KIND(o) - (int) !!PyUnicode_IS_ASCII(o);
970#if CYTHON_COMPILING_IN_PYPY
971 #define __Pyx_PyUnicode_Concat(a, b) PyNumber_Add(a, b)
972 #define __Pyx_PyUnicode_ConcatSafe(a, b) PyNumber_Add(a, b)
974 #define __Pyx_PyUnicode_Concat(a, b) PyUnicode_Concat(a, b)
975 #define __Pyx_PyUnicode_ConcatSafe(a, b) ((unlikely((a) == Py_None) || unlikely((b) == Py_None)) ?\
976 PyNumber_Add(a, b) : __Pyx_PyUnicode_Concat(a, b))
978#if CYTHON_COMPILING_IN_PYPY
979 #if !defined(PyUnicode_DecodeUnicodeEscape)
980 #define PyUnicode_DecodeUnicodeEscape(s, size, errors) PyUnicode_Decode(s, size, "unicode_escape", errors)
982 #if !defined(PyUnicode_Contains)
983 #define PyUnicode_Contains(u, s) PySequence_Contains(u, s)
985 #if !defined(PyByteArray_Check)
986 #define PyByteArray_Check(obj) PyObject_TypeCheck(obj, &PyByteArray_Type)
988 #if !defined(PyObject_Format)
989 #define PyObject_Format(obj, fmt) PyObject_CallMethod(obj, "__format__", "O", fmt)
992#define __Pyx_PyUnicode_FormatSafe(a, b) ((unlikely((a) == Py_None || (PyUnicode_Check(b) && !PyUnicode_CheckExact(b)))) ? PyNumber_Remainder(a, b) : PyUnicode_Format(a, b))
993#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
994 #define __Pyx_PySequence_ListKeepNew(obj)\
995 (likely(PyList_CheckExact(obj) && PyUnstable_Object_IsUniquelyReferenced(obj)) ? __Pyx_NewRef(obj) : PySequence_List(obj))
996#elif CYTHON_COMPILING_IN_CPYTHON
997 #define __Pyx_PySequence_ListKeepNew(obj)\
998 (likely(PyList_CheckExact(obj) && Py_REFCNT(obj) == 1) ? __Pyx_NewRef(obj) : PySequence_List(obj))
1000 #define __Pyx_PySequence_ListKeepNew(obj) PySequence_List(obj)
1002#ifndef PySet_CheckExact
1003 #define PySet_CheckExact(obj) Py_IS_TYPE(obj, &PySet_Type)
1005enum __Pyx_ReferenceSharing {
1006 __Pyx_ReferenceSharing_DefinitelyUnique,
1007 __Pyx_ReferenceSharing_OwnStrongReference,
1008 __Pyx_ReferenceSharing_FunctionArgument,
1009 __Pyx_ReferenceSharing_SharedReference,
1011#if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING && PY_VERSION_HEX >= 0x030E0000
1012#define __Pyx_IS_UNIQUELY_REFERENCED(o, sharing)\
1013 (sharing == __Pyx_ReferenceSharing_DefinitelyUnique ? 1 :\
1014 (sharing == __Pyx_ReferenceSharing_FunctionArgument ? PyUnstable_Object_IsUniqueReferencedTemporary(o) :\
1015 (sharing == __Pyx_ReferenceSharing_OwnStrongReference ? PyUnstable_Object_IsUniquelyReferenced(o) : 0)))
1016#elif (CYTHON_COMPILING_IN_CPYTHON && !CYTHON_COMPILING_IN_CPYTHON_FREETHREADING) || CYTHON_COMPILING_IN_LIMITED_API
1017#define __Pyx_IS_UNIQUELY_REFERENCED(o, sharing) (((void)sharing), Py_REFCNT(o) == 1)
1019#define __Pyx_IS_UNIQUELY_REFERENCED(o, sharing) (((void)o), ((void)sharing), 0)
1021#if __PYX_LIMITED_VERSION_HEX >= 0x030d0000
1022 #define __Pyx_PyList_GetItemRef(o, i) PyList_GetItemRef(o, i)
1023#elif CYTHON_AVOID_BORROWED_REFS || CYTHON_AVOID_THREAD_UNSAFE_BORROWED_REFS
1024 #if CYTHON_COMPILING_IN_LIMITED_API || !CYTHON_ASSUME_SAFE_MACROS
1025 #define __Pyx_PyList_GetItemRef(o, i) (likely((i) >= 0) ? PySequence_GetItem(o, i) : (PyErr_SetString(PyExc_IndexError, "list index out of range"), (PyObject*)NULL))
1027 #define __Pyx_PyList_GetItemRef(o, i) PySequence_ITEM(o, i)
1029#elif CYTHON_COMPILING_IN_LIMITED_API || !(CYTHON_ASSUME_SAFE_MACROS && CYTHON_ASSUME_SAFE_SIZE)
1030 #define __Pyx_PyList_GetItemRef(o, i) __Pyx_XNewRef(PyList_GetItem(o, i))
1032 #define __Pyx_PyList_GetItemRef(o, i) (likely(__Pyx_is_valid_index(i, PyList_GET_SIZE(o))) ?\
1033 __Pyx_NewRef(PyList_GET_ITEM(o, i)) : (PyErr_SetString(PyExc_IndexError, "list index out of range"), (PyObject*)NULL))
1035#if CYTHON_AVOID_BORROWED_REFS || CYTHON_COMPILING_IN_LIMITED_API
1036 #define __Pyx_PyList_GET_ITEM_REF(o, i, unsafe_shared) ((void)(unsafe_shared),\
1037 __Pyx_PyList_GetItemRef(o, i))
1038#elif CYTHON_AVOID_THREAD_UNSAFE_BORROWED_REFS
1039 #if CYTHON_ASSUME_SAFE_MACROS
1040 #define __Pyx_PyList_GET_ITEM_REF(o, i, unsafe_shared) (\
1041 __Pyx_IS_UNIQUELY_REFERENCED(o, unsafe_shared) ?\
1042 __Pyx_NewRef(PyList_GET_ITEM(o, i)) : __Pyx_PyList_GetItemRef(o, i))
1044 #define __Pyx_PyList_GET_ITEM_REF(o, i, unsafe_shared) (\
1045 __Pyx_IS_UNIQUELY_REFERENCED(o, unsafe_shared) ?\
1046 __Pyx_XNewRef(PyList_GetItem(o, i)) : __Pyx_PyList_GetItemRef(o, i))
1048#elif CYTHON_ASSUME_SAFE_MACROS
1049 #define __Pyx_PyList_GET_ITEM_REF(o, i, unsafe_shared) ((void)(unsafe_shared),\
1050 __Pyx_NewRef(PyList_GET_ITEM(o, i)))
1052 #define __Pyx_PyList_GET_ITEM_REF(o, i, unsafe_shared) ((void)(unsafe_shared),\
1053 __Pyx_XNewRef(PyList_GetItem(o, i)))
1055#if __PYX_LIMITED_VERSION_HEX >= 0x030d0000
1056#define __Pyx_PyDict_GetItemRef(dict, key, result) PyDict_GetItemRef(dict, key, result)
1057#elif CYTHON_AVOID_BORROWED_REFS || CYTHON_AVOID_THREAD_UNSAFE_BORROWED_REFS
1058static CYTHON_INLINE
int __Pyx_PyDict_GetItemRef(PyObject *dict, PyObject *key, PyObject **result) {
1059 *result = PyObject_GetItem(dict, key);
1060 if (*result == NULL) {
1061 if (PyErr_ExceptionMatches(PyExc_KeyError)) {
1070static CYTHON_INLINE
int __Pyx_PyDict_GetItemRef(PyObject *dict, PyObject *key, PyObject **result) {
1071 *result = PyDict_GetItemWithError(dict, key);
1072 if (*result == NULL) {
1073 return PyErr_Occurred() ? -1 : 0;
1079#if defined(CYTHON_DEBUG_VISIT_CONST) && CYTHON_DEBUG_VISIT_CONST
1080 #define __Pyx_VISIT_CONST(obj) Py_VISIT(obj)
1082 #define __Pyx_VISIT_CONST(obj)
1084#if CYTHON_ASSUME_SAFE_MACROS
1085 #define __Pyx_PySequence_ITEM(o, i) PySequence_ITEM(o, i)
1086 #define __Pyx_PySequence_SIZE(seq) Py_SIZE(seq)
1087 #define __Pyx_PyTuple_SET_ITEM(o, i, v) (PyTuple_SET_ITEM(o, i, v), (0))
1088 #define __Pyx_PyTuple_GET_ITEM(o, i) PyTuple_GET_ITEM(o, i)
1089 #define __Pyx_PyList_SET_ITEM(o, i, v) (PyList_SET_ITEM(o, i, v), (0))
1090 #define __Pyx_PyList_GET_ITEM(o, i) PyList_GET_ITEM(o, i)
1092 #define __Pyx_PySequence_ITEM(o, i) PySequence_GetItem(o, i)
1093 #define __Pyx_PySequence_SIZE(seq) PySequence_Size(seq)
1094 #define __Pyx_PyTuple_SET_ITEM(o, i, v) PyTuple_SetItem(o, i, v)
1095 #define __Pyx_PyTuple_GET_ITEM(o, i) PyTuple_GetItem(o, i)
1096 #define __Pyx_PyList_SET_ITEM(o, i, v) PyList_SetItem(o, i, v)
1097 #define __Pyx_PyList_GET_ITEM(o, i) PyList_GetItem(o, i)
1099#if CYTHON_ASSUME_SAFE_SIZE
1100 #define __Pyx_PyTuple_GET_SIZE(o) PyTuple_GET_SIZE(o)
1101 #define __Pyx_PyList_GET_SIZE(o) PyList_GET_SIZE(o)
1102 #define __Pyx_PySet_GET_SIZE(o) PySet_GET_SIZE(o)
1103 #define __Pyx_PyDict_GET_SIZE(o) PyDict_GET_SIZE(o)
1104 #define __Pyx_PyBytes_GET_SIZE(o) PyBytes_GET_SIZE(o)
1105 #define __Pyx_PyByteArray_GET_SIZE(o) PyByteArray_GET_SIZE(o)
1106 #define __Pyx_PyUnicode_GET_LENGTH(o) PyUnicode_GET_LENGTH(o)
1108 #define __Pyx_PyTuple_GET_SIZE(o) PyTuple_Size(o)
1109 #define __Pyx_PyList_GET_SIZE(o) PyList_Size(o)
1110 #define __Pyx_PySet_GET_SIZE(o) PySet_Size(o)
1111 #define __Pyx_PyDict_GET_SIZE(o) PyDict_Size(o)
1112 #define __Pyx_PyBytes_GET_SIZE(o) PyBytes_Size(o)
1113 #define __Pyx_PyByteArray_GET_SIZE(o) PyByteArray_Size(o)
1114 #define __Pyx_PyUnicode_GET_LENGTH(o) PyUnicode_GetLength(o)
1116#if CYTHON_COMPILING_IN_PYPY && !defined(PyUnicode_InternFromString)
1117 #define PyUnicode_InternFromString(s) PyUnicode_FromString(s)
1119#define __Pyx_PyLong_FromHash_t PyLong_FromSsize_t
1120#define __Pyx_PyLong_AsHash_t __Pyx_PyIndex_AsSsize_t
1121#if __PYX_LIMITED_VERSION_HEX >= 0x030A0000
1122 #define __Pyx_PySendResult PySendResult
1128 } __Pyx_PySendResult;
1130#if CYTHON_COMPILING_IN_LIMITED_API || PY_VERSION_HEX < 0x030A00A3
1131 typedef __Pyx_PySendResult (*__Pyx_pyiter_sendfunc)(PyObject *iter, PyObject *value, PyObject **result);
1133 #define __Pyx_pyiter_sendfunc sendfunc
1135#if !CYTHON_USE_AM_SEND
1136#define __PYX_HAS_PY_AM_SEND 0
1137#elif __PYX_LIMITED_VERSION_HEX >= 0x030A0000
1138#define __PYX_HAS_PY_AM_SEND 1
1140#define __PYX_HAS_PY_AM_SEND 2
1142#if __PYX_HAS_PY_AM_SEND < 2
1143 #define __Pyx_PyAsyncMethodsStruct PyAsyncMethods
1149 __Pyx_pyiter_sendfunc am_send;
1150 } __Pyx_PyAsyncMethodsStruct;
1151 #define __Pyx_SlotTpAsAsync(s) ((PyAsyncMethods*)(s))
1153#if CYTHON_USE_AM_SEND && PY_VERSION_HEX < 0x030A00F0
1154 #define __Pyx_TPFLAGS_HAVE_AM_SEND (1UL << 21)
1156 #define __Pyx_TPFLAGS_HAVE_AM_SEND (0)
1158#if CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030A0000
1162PyAPI_FUNC(
void *) PyMem_Calloc(
size_t nelem,
size_t elsize);
1164#if CYTHON_COMPILING_IN_LIMITED_API
1165static int __Pyx_init_co_variable(PyObject *inspect,
const char* name,
int *write_to) {
1167 PyObject *py_value = PyObject_GetAttrString(inspect, name);
1168 if (!py_value)
return 0;
1169 value = (int) PyLong_AsLong(py_value);
1170 Py_DECREF(py_value);
1172 return value != -1 || !PyErr_Occurred();
1174static int __Pyx_init_co_variables(
void) {
1177 inspect = PyImport_ImportModule(
"inspect");
1179#if !defined(CO_OPTIMIZED)
1180 __Pyx_init_co_variable(inspect,
"CO_OPTIMIZED", &CO_OPTIMIZED) &&
1182#if !defined(CO_NEWLOCALS)
1183 __Pyx_init_co_variable(inspect,
"CO_NEWLOCALS", &CO_NEWLOCALS) &&
1185#if !defined(CO_VARARGS)
1186 __Pyx_init_co_variable(inspect,
"CO_VARARGS", &CO_VARARGS) &&
1188#if !defined(CO_VARKEYWORDS)
1189 __Pyx_init_co_variable(inspect,
"CO_VARKEYWORDS", &CO_VARKEYWORDS) &&
1191#if !defined(CO_ASYNC_GENERATOR)
1192 __Pyx_init_co_variable(inspect,
"CO_ASYNC_GENERATOR", &CO_ASYNC_GENERATOR) &&
1194#if !defined(CO_GENERATOR)
1195 __Pyx_init_co_variable(inspect,
"CO_GENERATOR", &CO_GENERATOR) &&
1197#if !defined(CO_COROUTINE)
1198 __Pyx_init_co_variable(inspect,
"CO_COROUTINE", &CO_COROUTINE) &&
1202 return result ? 0 : -1;
1204static int __Pyx_init_tpflags_bitcount(
unsigned long flag) {
1207 count += (int) (flag & 1);
1212static int __Pyx_init_tpflags_variables(
void) {
1213 if (__Pyx_Runtime_TPFLAGS_SEQUENCE != 0 && __Pyx_Runtime_TPFLAGS_MAPPING != 0) {
1216 PyObject *collections_abc = PyImport_ImportModule(
"collections.abc");
1217 if (!collections_abc)
return -1;
1219 PyObject *sequence = NULL, *mapping = NULL;
1220#if __PYX_LIMITED_VERSION_HEX >= 0x030D0000
1221 if (PyObject_GetOptionalAttrString(collections_abc,
"Sequence", &sequence) != 1)
goto fail;
1222 if (PyObject_GetOptionalAttrString(collections_abc,
"Mapping", &mapping) != 1)
goto fail;
1224 sequence = PyObject_GetAttrString(collections_abc,
"Sequence");
1225 if (!sequence)
goto fail_attr_lookup;
1226 mapping = PyObject_GetAttrString(collections_abc,
"Mapping");
1227 if (!mapping)
goto fail_attr_lookup;
1229 if (!PyType_Check(sequence) || !PyType_Check(mapping))
goto fail;
1231 unsigned long sequence_flags = PyType_GetFlags((PyTypeObject*)sequence);
1232 unsigned long mapping_flags = PyType_GetFlags((PyTypeObject*)mapping);
1233 unsigned long mutual_flags = sequence_flags & mapping_flags;
1234 sequence_flags = sequence_flags ^ mutual_flags;
1235 mapping_flags = mapping_flags ^ mutual_flags;
1236 if (__Pyx_Runtime_TPFLAGS_SEQUENCE == 0 && __Pyx_init_tpflags_bitcount(sequence_flags) == 1) {
1237 __Pyx_Runtime_TPFLAGS_SEQUENCE = sequence_flags;
1239 if (__Pyx_Runtime_TPFLAGS_MAPPING == 0 && __Pyx_init_tpflags_bitcount(mapping_flags) == 1) {
1240 __Pyx_Runtime_TPFLAGS_MAPPING = mapping_flags;
1244 Py_XDECREF(mapping);
1245 Py_XDECREF(sequence);
1246 Py_DECREF(collections_abc);
1248#if __PYX_LIMITED_VERSION_HEX < 0x030D0000
1250 if (PyErr_ExceptionMatches(PyExc_AttributeError)) {
1255 result = PyErr_Occurred() ? -1 : 0;
1259static int __Pyx_init_co_variables(
void) {
1262static int __Pyx_init_tpflags_variables(
void) {
1268#if defined(_WIN32) || defined(WIN32) || defined(MS_WINDOWS)
1269 #ifndef _USE_MATH_DEFINES
1270 #define _USE_MATH_DEFINES
1274#if defined(__CYGWIN__) && defined(_LDBL_EQ_DBL)
1275#define __Pyx_truncl trunc
1277#define __Pyx_truncl truncl
1280#ifndef CYTHON_CLINE_IN_TRACEBACK_RUNTIME
1281#define CYTHON_CLINE_IN_TRACEBACK_RUNTIME 1
1283#ifndef CYTHON_CLINE_IN_TRACEBACK
1284#define CYTHON_CLINE_IN_TRACEBACK CYTHON_CLINE_IN_TRACEBACK_RUNTIME
1286#if CYTHON_CLINE_IN_TRACEBACK
1287#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; }
1289#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; }
1291#define __PYX_ERR(f_index, lineno, Ln_error) \
1292 { __PYX_MARK_ERR_POS(f_index, lineno) goto Ln_error; }
1294#ifdef CYTHON_EXTERN_C
1295 #undef __PYX_EXTERN_C
1296 #define __PYX_EXTERN_C CYTHON_EXTERN_C
1297#elif defined(__PYX_EXTERN_C)
1299 #pragma message ("Please do not define the '__PYX_EXTERN_C' macro externally. Use 'CYTHON_EXTERN_C' instead.")
1301 #warning Please do not define the '__PYX_EXTERN_C' macro externally. Use 'CYTHON_EXTERN_C' instead.
1305 #define __PYX_EXTERN_C extern "C"
1307 #define __PYX_EXTERN_C extern
1311#define __PYX_HAVE__superluWrappers
1312#define __PYX_HAVE_API__superluWrappers
1319#include "numpy/arrayobject.h"
1320#include "numpy/ndarrayobject.h"
1321#include "numpy/ndarraytypes.h"
1322#include "numpy/arrayscalars.h"
1323#include "numpy/ufuncobject.h"
1326#include "pythread.h"
1328 typedef int (*__pyx_memoryview_to_dtype_func_type)(
char*, PyObject*);
1334#if defined(PYREX_WITHOUT_ASSERTIONS) && !defined(CYTHON_WITHOUT_ASSERTIONS)
1335#define CYTHON_WITHOUT_ASSERTIONS
1338#ifdef CYTHON_FREETHREADING_COMPATIBLE
1339#if CYTHON_FREETHREADING_COMPATIBLE
1340#define __Pyx_FREETHREADING_COMPATIBLE Py_MOD_GIL_NOT_USED
1342#define __Pyx_FREETHREADING_COMPATIBLE Py_MOD_GIL_USED
1345#define __Pyx_FREETHREADING_COMPATIBLE Py_MOD_GIL_USED
1347#define __PYX_DEFAULT_STRING_ENCODING_IS_ASCII 0
1348#define __PYX_DEFAULT_STRING_ENCODING_IS_UTF8 0
1349#define __PYX_DEFAULT_STRING_ENCODING ""
1350#define __Pyx_PyObject_FromString __Pyx_PyBytes_FromString
1351#define __Pyx_PyObject_FromStringAndSize __Pyx_PyBytes_FromStringAndSize
1352#define __Pyx_uchar_cast(c) ((unsigned char)c)
1353#define __Pyx_long_cast(x) ((long)x)
1354#define __Pyx_fits_Py_ssize_t(v, type, is_signed) (\
1355 (sizeof(type) < sizeof(Py_ssize_t)) ||\
1356 (sizeof(type) > sizeof(Py_ssize_t) &&\
1357 likely(v < (type)PY_SSIZE_T_MAX ||\
1358 v == (type)PY_SSIZE_T_MAX) &&\
1359 (!is_signed || likely(v > (type)PY_SSIZE_T_MIN ||\
1360 v == (type)PY_SSIZE_T_MIN))) ||\
1361 (sizeof(type) == sizeof(Py_ssize_t) &&\
1362 (is_signed || likely(v < (type)PY_SSIZE_T_MAX ||\
1363 v == (type)PY_SSIZE_T_MAX))) )
1364static CYTHON_INLINE
int __Pyx_is_valid_index(Py_ssize_t i, Py_ssize_t limit) {
1365 return (
size_t) i < (size_t) limit;
1367#if defined (__cplusplus) && __cplusplus >= 201103L
1369 #define __Pyx_sst_abs(value) std::abs(value)
1370#elif SIZEOF_INT >= SIZEOF_SIZE_T
1371 #define __Pyx_sst_abs(value) abs(value)
1372#elif SIZEOF_LONG >= SIZEOF_SIZE_T
1373 #define __Pyx_sst_abs(value) labs(value)
1374#elif defined (_MSC_VER)
1375 #define __Pyx_sst_abs(value) ((Py_ssize_t)_abs64(value))
1376#elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
1377 #define __Pyx_sst_abs(value) llabs(value)
1378#elif defined (__GNUC__)
1379 #define __Pyx_sst_abs(value) __builtin_llabs(value)
1381 #define __Pyx_sst_abs(value) ((value<0) ? -value : value)
1383static CYTHON_INLINE Py_ssize_t __Pyx_ssize_strlen(
const char *
s);
1384static CYTHON_INLINE
const char* __Pyx_PyObject_AsString(PyObject*);
1385static CYTHON_INLINE
const char* __Pyx_PyObject_AsStringAndSize(PyObject*, Py_ssize_t* length);
1386static CYTHON_INLINE PyObject* __Pyx_PyByteArray_FromString(
const char*);
1387#define __Pyx_PyByteArray_FromStringAndSize(s, l) PyByteArray_FromStringAndSize((const char*)s, l)
1388#define __Pyx_PyBytes_FromString PyBytes_FromString
1389#define __Pyx_PyBytes_FromStringAndSize PyBytes_FromStringAndSize
1390static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(
const char*);
1391#if CYTHON_ASSUME_SAFE_MACROS
1392 #define __Pyx_PyBytes_AsWritableString(s) ((char*) PyBytes_AS_STRING(s))
1393 #define __Pyx_PyBytes_AsWritableSString(s) ((signed char*) PyBytes_AS_STRING(s))
1394 #define __Pyx_PyBytes_AsWritableUString(s) ((unsigned char*) PyBytes_AS_STRING(s))
1395 #define __Pyx_PyBytes_AsString(s) ((const char*) PyBytes_AS_STRING(s))
1396 #define __Pyx_PyBytes_AsSString(s) ((const signed char*) PyBytes_AS_STRING(s))
1397 #define __Pyx_PyBytes_AsUString(s) ((const unsigned char*) PyBytes_AS_STRING(s))
1398 #define __Pyx_PyByteArray_AsString(s) PyByteArray_AS_STRING(s)
1400 #define __Pyx_PyBytes_AsWritableString(s) ((char*) PyBytes_AsString(s))
1401 #define __Pyx_PyBytes_AsWritableSString(s) ((signed char*) PyBytes_AsString(s))
1402 #define __Pyx_PyBytes_AsWritableUString(s) ((unsigned char*) PyBytes_AsString(s))
1403 #define __Pyx_PyBytes_AsString(s) ((const char*) PyBytes_AsString(s))
1404 #define __Pyx_PyBytes_AsSString(s) ((const signed char*) PyBytes_AsString(s))
1405 #define __Pyx_PyBytes_AsUString(s) ((const unsigned char*) PyBytes_AsString(s))
1406 #define __Pyx_PyByteArray_AsString(s) PyByteArray_AsString(s)
1408#define __Pyx_PyObject_AsWritableString(s) ((char*)(__pyx_uintptr_t) __Pyx_PyObject_AsString(s))
1409#define __Pyx_PyObject_AsWritableSString(s) ((signed char*)(__pyx_uintptr_t) __Pyx_PyObject_AsString(s))
1410#define __Pyx_PyObject_AsWritableUString(s) ((unsigned char*)(__pyx_uintptr_t) __Pyx_PyObject_AsString(s))
1411#define __Pyx_PyObject_AsSString(s) ((const signed char*) __Pyx_PyObject_AsString(s))
1412#define __Pyx_PyObject_AsUString(s) ((const unsigned char*) __Pyx_PyObject_AsString(s))
1413#define __Pyx_PyObject_FromCString(s) __Pyx_PyObject_FromString((const char*)s)
1414#define __Pyx_PyBytes_FromCString(s) __Pyx_PyBytes_FromString((const char*)s)
1415#define __Pyx_PyByteArray_FromCString(s) __Pyx_PyByteArray_FromString((const char*)s)
1416#define __Pyx_PyUnicode_FromCString(s) __Pyx_PyUnicode_FromString((const char*)s)
1417#define __Pyx_PyUnicode_FromOrdinal(o) PyUnicode_FromOrdinal((int)o)
1418#define __Pyx_PyUnicode_AsUnicode PyUnicode_AsUnicode
1419static CYTHON_INLINE PyObject *__Pyx_NewRef(PyObject *obj) {
1420#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030a0000 || defined(Py_NewRef)
1421 return Py_NewRef(obj);
1427static CYTHON_INLINE PyObject *__Pyx_XNewRef(PyObject *obj) {
1428#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030a0000 || defined(Py_XNewRef)
1429 return Py_XNewRef(obj);
1435static CYTHON_INLINE PyObject *__Pyx_Owned_Py_None(
int b);
1436static CYTHON_INLINE PyObject * __Pyx_PyBool_FromLong(
long b);
1437static CYTHON_INLINE
int __Pyx_PyObject_IsTrue(PyObject*);
1438static CYTHON_INLINE
int __Pyx_PyObject_IsTrueAndDecref(PyObject*);
1439static CYTHON_INLINE PyObject* __Pyx_PyNumber_Long(PyObject* x);
1440#define __Pyx_PyObject_RichCompareBool(a,b,cmp) __Pyx_PyObject_IsTrueAndDecref(PyObject_RichCompare((a),(b),(cmp)))
1441#define __Pyx_PySequence_Tuple(obj)\
1442 (likely(PyTuple_CheckExact(obj)) ? __Pyx_NewRef(obj) : PySequence_Tuple(obj))
1443static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject*);
1444static CYTHON_INLINE PyObject * __Pyx_PyLong_FromSize_t(
size_t);
1445static CYTHON_INLINE Py_hash_t __Pyx_PyIndex_AsHash_t(PyObject*);
1446#if CYTHON_ASSUME_SAFE_MACROS
1447#define __Pyx_PyFloat_AsDouble(x) (PyFloat_CheckExact(x) ? PyFloat_AS_DOUBLE(x) : PyFloat_AsDouble(x))
1448#define __Pyx_PyFloat_AS_DOUBLE(x) PyFloat_AS_DOUBLE(x)
1449#define __Pyx_PyFloat_IsNonZero(x) (PyFloat_AS_DOUBLE(x) != 0.0)
1451#define __Pyx_PyFloat_AsDouble(x) PyFloat_AsDouble(x)
1452#define __Pyx_PyFloat_AS_DOUBLE(x) PyFloat_AsDouble(x)
1453#define __Pyx_PyFloat_IsNonZero(x) PyObject_IsTrue(x)
1455#define __Pyx_PyFloat_AsFloat(x) ((float) __Pyx_PyFloat_AsDouble(x))
1456#define __Pyx_PyNumber_Int(x) (PyLong_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Long(x))
1457#if CYTHON_USE_PYLONG_INTERNALS
1458 #if PY_VERSION_HEX >= 0x030C00A7
1459 #ifndef _PyLong_SIGN_MASK
1460 #define _PyLong_SIGN_MASK 3
1462 #ifndef _PyLong_NON_SIZE_BITS
1463 #define _PyLong_NON_SIZE_BITS 3
1465 #define __Pyx_PyLong_SignBits(x) ((int) (((PyLongObject*)x)->long_value.lv_tag & _PyLong_SIGN_MASK))
1466 #define __Pyx_PyLong_Sign(x) (1 - __Pyx_PyLong_SignBits(x))
1467 #define __Pyx_PyLong_IsNeg(x) ((__Pyx_PyLong_SignBits(x) & 2) != 0)
1468 #define __Pyx_PyLong_IsNonNeg(x) (!__Pyx_PyLong_IsNeg(x))
1469 #define __Pyx_PyLong_IsZero(x) (__Pyx_PyLong_SignBits(x) & 1)
1470 #define __Pyx_PyLong_IsPos(x) (__Pyx_PyLong_SignBits(x) == 0)
1471 #define __Pyx_PyLong_CompactValueUnsigned(x) (__Pyx_PyLong_Digits(x)[0])
1472 #define __Pyx_PyLong_DigitCount(x) ((Py_ssize_t) (((PyLongObject*)x)->long_value.lv_tag >> _PyLong_NON_SIZE_BITS))
1473 #define __Pyx_PyLong_SignedDigitCount(x)\
1474 (((Py_ssize_t) __Pyx_PyLong_Sign(x)) * __Pyx_PyLong_DigitCount(x))
1475 #if defined(PyUnstable_Long_IsCompact) && defined(PyUnstable_Long_CompactValue)
1476 #define __Pyx_PyLong_IsCompact(x) PyUnstable_Long_IsCompact((PyLongObject*) x)
1477 #define __Pyx_PyLong_CompactValue(x) PyUnstable_Long_CompactValue((PyLongObject*) x)
1479 #define __Pyx_PyLong_IsCompact(x) (((PyLongObject*)x)->long_value.lv_tag < (2 << _PyLong_NON_SIZE_BITS))
1480 #define __Pyx_PyLong_CompactValue(x) (((Py_ssize_t) __Pyx_PyLong_Sign(x)) * (Py_ssize_t) __Pyx_PyLong_Digits(x)[0])
1482 static CYTHON_INLINE Py_ssize_t __Pyx_PyLong_CompareSignAndSize(PyObject *a, PyObject *b) {
1483 uintptr_t tag_a = ((PyLongObject*)a)->long_value.lv_tag;
1484 uintptr_t tag_b = ((PyLongObject*)b)->long_value.lv_tag;
1485 if (tag_a == tag_b)
return 0;
1486 int sign_a = (int) (tag_a & _PyLong_SIGN_MASK);
1487 int sign_b = (int) (tag_b & _PyLong_SIGN_MASK);
1488 if (sign_a > sign_b)
return -1;
1489 if (sign_a < sign_b)
return 1;
1490 Py_ssize_t size_a = (Py_ssize_t) (tag_a >> _PyLong_NON_SIZE_BITS);
1491 Py_ssize_t size_b = (Py_ssize_t) (tag_b >> _PyLong_NON_SIZE_BITS);
1492 return (1 - sign_a) * (size_a - size_b);
1494 typedef Py_ssize_t __Pyx_compact_pylong;
1495 typedef size_t __Pyx_compact_upylong;
1497 #define __Pyx_PyLong_Sign(x) ((int) ((Py_SIZE(x) == 0) ? 0 : (Py_SIZE(x) < 0) ? -1 : 1))
1498 #define __Pyx_PyLong_IsNeg(x) (Py_SIZE(x) < 0)
1499 #define __Pyx_PyLong_IsNonNeg(x) (Py_SIZE(x) >= 0)
1500 #define __Pyx_PyLong_IsZero(x) (Py_SIZE(x) == 0)
1501 #define __Pyx_PyLong_IsPos(x) (Py_SIZE(x) > 0)
1502 #define __Pyx_PyLong_CompactValueUnsigned(x) ((Py_SIZE(x) == 0) ? 0 : __Pyx_PyLong_Digits(x)[0])
1503 #define __Pyx_PyLong_DigitCount(x) __Pyx_sst_abs(Py_SIZE(x))
1504 #define __Pyx_PyLong_SignedDigitCount(x) Py_SIZE(x)
1505 #define __Pyx_PyLong_IsCompact(x) (Py_SIZE(x) == 0 || Py_SIZE(x) == 1 || Py_SIZE(x) == -1)
1506 #define __Pyx_PyLong_CompactValue(x)\
1507 ((Py_SIZE(x) == 0) ? (sdigit) 0 : ((Py_SIZE(x) < 0) ? -(sdigit)__Pyx_PyLong_Digits(x)[0] : (sdigit)__Pyx_PyLong_Digits(x)[0]))
1508 #define __Pyx_PyLong_CompareSignAndSize(a, b) (Py_SIZE(a) - Py_SIZE(b))
1509 typedef sdigit __Pyx_compact_pylong;
1510 typedef digit __Pyx_compact_upylong;
1512 #if PY_VERSION_HEX >= 0x030C00A5
1513 #define __Pyx_PyLong_Digits(x) (((PyLongObject*)x)->long_value.ob_digit)
1515 #define __Pyx_PyLong_Digits(x) (((PyLongObject*)x)->ob_digit)
1517 #define __Pyx_PyLong_IsNonZero(x) (!__Pyx_PyLong_IsZero(x))
1519 #define __Pyx_PyLong_IsNonZero(x) PyObject_IsTrue(x)
1521#if __PYX_DEFAULT_STRING_ENCODING_IS_UTF8
1522 #define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_DecodeUTF8(c_str, size, NULL)
1523#elif __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
1524 #define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_DecodeASCII(c_str, size, NULL)
1526 #define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_Decode(c_str, size, __PYX_DEFAULT_STRING_ENCODING, NULL)
1531#if defined(__GNUC__) && (__GNUC__ > 2 || (__GNUC__ == 2 && (__GNUC_MINOR__ > 95)))
1532 #define likely(x) __builtin_expect(!!(x), 1)
1533 #define unlikely(x) __builtin_expect(!!(x), 0)
1535 #define likely(x) (x)
1536 #define unlikely(x) (x)
1540#if __cplusplus > 201103L
1541#include <type_traits>
1543template <
typename T>
1544static void __Pyx_pretend_to_initialize(
T* ptr) {
1545#if __cplusplus > 201103L
1546 if ((std::is_trivially_default_constructible<T>::value))
1552static CYTHON_INLINE
void __Pyx_pretend_to_initialize(
void* ptr) { (void)ptr; }
1556#if !CYTHON_USE_MODULE_STATE
1557static PyObject *__pyx_m = NULL;
1559static const char *
const __pyx_cfilenm = __FILE__;
1562#if !defined(CYTHON_CCOMPLEX)
1563 #if defined(__cplusplus)
1564 #define CYTHON_CCOMPLEX 1
1565 #elif (defined(_Complex_I) && !defined(_MSC_VER)) || ((defined (__STDC_VERSION__) && __STDC_VERSION__ >= 201112L) && !defined(__STDC_NO_COMPLEX__) && !defined(_MSC_VER))
1566 #define CYTHON_CCOMPLEX 1
1568 #define CYTHON_CCOMPLEX 0
1575 #include <complex.h>
1578#if CYTHON_CCOMPLEX && !defined(__cplusplus) && defined(__sun__) && defined(__GNUC__)
1580 #define _Complex_I 1.0fj
1585static const char*
const __pyx_f[] = {
1586 "proteus/superluWrappers.pyx",
1588 "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd",
1593#include <pythread.h>
1594#ifndef CYTHON_ATOMICS
1595 #define CYTHON_ATOMICS 1
1597#define __PYX_CYTHON_ATOMICS_ENABLED() CYTHON_ATOMICS
1598#define __PYX_GET_CYTHON_COMPILING_IN_CPYTHON_FREETHREADING() CYTHON_COMPILING_IN_CPYTHON_FREETHREADING
1599#define __pyx_atomic_int_type int
1600#define __pyx_nonatomic_int_type int
1601#if CYTHON_ATOMICS && (defined(__STDC_VERSION__) &&\
1602 (__STDC_VERSION__ >= 201112L) &&\
1603 !defined(__STDC_NO_ATOMICS__))
1604 #include <stdatomic.h>
1605#elif CYTHON_ATOMICS && (defined(__cplusplus) && (\
1606 (__cplusplus >= 201103L) ||\
1607 (defined(_MSC_VER) && _MSC_VER >= 1700)))
1610#if CYTHON_ATOMICS && (defined(__STDC_VERSION__) &&\
1611 (__STDC_VERSION__ >= 201112L) &&\
1612 !defined(__STDC_NO_ATOMICS__) &&\
1613 ATOMIC_INT_LOCK_FREE == 2)
1614 #undef __pyx_atomic_int_type
1615 #define __pyx_atomic_int_type atomic_int
1616 #define __pyx_atomic_ptr_type atomic_uintptr_t
1617 #define __pyx_nonatomic_ptr_type uintptr_t
1618 #define __pyx_atomic_incr_relaxed(value) atomic_fetch_add_explicit(value, 1, memory_order_relaxed)
1619 #define __pyx_atomic_incr_acq_rel(value) atomic_fetch_add_explicit(value, 1, memory_order_acq_rel)
1620 #define __pyx_atomic_decr_acq_rel(value) atomic_fetch_sub_explicit(value, 1, memory_order_acq_rel)
1621 #define __pyx_atomic_sub(value, arg) atomic_fetch_sub(value, arg)
1622 #define __pyx_atomic_int_cmp_exchange(value, expected, desired) atomic_compare_exchange_strong(value, expected, desired)
1623 #define __pyx_atomic_load(value) atomic_load(value)
1624 #define __pyx_atomic_store(value, new_value) atomic_store(value, new_value)
1625 #define __pyx_atomic_pointer_load_relaxed(value) atomic_load_explicit(value, memory_order_relaxed)
1626 #define __pyx_atomic_pointer_load_acquire(value) atomic_load_explicit(value, memory_order_acquire)
1627 #define __pyx_atomic_pointer_exchange(value, new_value) atomic_exchange(value, (__pyx_nonatomic_ptr_type)new_value)
1628 #define __pyx_atomic_pointer_cmp_exchange(value, expected, desired) atomic_compare_exchange_strong(value, expected, desired)
1629 #if defined(__PYX_DEBUG_ATOMICS) && defined(_MSC_VER)
1630 #pragma message ("Using standard C atomics")
1631 #elif defined(__PYX_DEBUG_ATOMICS)
1632 #warning "Using standard C atomics"
1634#elif CYTHON_ATOMICS && (defined(__cplusplus) && (\
1635 (__cplusplus >= 201103L) ||\
1637 (defined(_MSC_VER) && _MSC_VER >= 1700)) &&\
1638 ATOMIC_INT_LOCK_FREE == 2)
1639 #undef __pyx_atomic_int_type
1640 #define __pyx_atomic_int_type std::atomic_int
1641 #define __pyx_atomic_ptr_type std::atomic_uintptr_t
1642 #define __pyx_nonatomic_ptr_type uintptr_t
1643 #define __pyx_atomic_incr_relaxed(value) std::atomic_fetch_add_explicit(value, 1, std::memory_order_relaxed)
1644 #define __pyx_atomic_incr_acq_rel(value) std::atomic_fetch_add_explicit(value, 1, std::memory_order_acq_rel)
1645 #define __pyx_atomic_decr_acq_rel(value) std::atomic_fetch_sub_explicit(value, 1, std::memory_order_acq_rel)
1646 #define __pyx_atomic_sub(value, arg) std::atomic_fetch_sub(value, arg)
1647 #define __pyx_atomic_int_cmp_exchange(value, expected, desired) std::atomic_compare_exchange_strong(value, expected, desired)
1648 #define __pyx_atomic_load(value) std::atomic_load(value)
1649 #define __pyx_atomic_store(value, new_value) std::atomic_store(value, new_value)
1650 #define __pyx_atomic_pointer_load_relaxed(value) std::atomic_load_explicit(value, std::memory_order_relaxed)
1651 #define __pyx_atomic_pointer_load_acquire(value) std::atomic_load_explicit(value, std::memory_order_acquire)
1652 #define __pyx_atomic_pointer_exchange(value, new_value) std::atomic_exchange(value, (__pyx_nonatomic_ptr_type)new_value)
1653 #define __pyx_atomic_pointer_cmp_exchange(value, expected, desired) std::atomic_compare_exchange_strong(value, expected, desired)
1654 #if defined(__PYX_DEBUG_ATOMICS) && defined(_MSC_VER)
1655 #pragma message ("Using standard C++ atomics")
1656 #elif defined(__PYX_DEBUG_ATOMICS)
1657 #warning "Using standard C++ atomics"
1659#elif CYTHON_ATOMICS && (__GNUC__ >= 5 || (__GNUC__ == 4 &&\
1660 (__GNUC_MINOR__ > 1 ||\
1661 (__GNUC_MINOR__ == 1 && __GNUC_PATCHLEVEL__ >= 2))))
1662 #define __pyx_atomic_ptr_type void*
1663 #define __pyx_nonatomic_ptr_type void*
1664 #define __pyx_atomic_incr_relaxed(value) __sync_fetch_and_add(value, 1)
1665 #define __pyx_atomic_incr_acq_rel(value) __sync_fetch_and_add(value, 1)
1666 #define __pyx_atomic_decr_acq_rel(value) __sync_fetch_and_sub(value, 1)
1667 #define __pyx_atomic_sub(value, arg) __sync_fetch_and_sub(value, arg)
1668 static CYTHON_INLINE
int __pyx_atomic_int_cmp_exchange(__pyx_atomic_int_type* value, __pyx_nonatomic_int_type* expected, __pyx_nonatomic_int_type desired) {
1669 __pyx_nonatomic_int_type old = __sync_val_compare_and_swap(value, *expected, desired);
1670 int result = old == *expected;
1674 #define __pyx_atomic_load(value) __sync_fetch_and_add(value, 0)
1675 #define __pyx_atomic_store(value, new_value) __sync_lock_test_and_set(value, new_value)
1676 #define __pyx_atomic_pointer_load_relaxed(value) __sync_fetch_and_add(value, 0)
1677 #define __pyx_atomic_pointer_load_acquire(value) __sync_fetch_and_add(value, 0)
1678 #define __pyx_atomic_pointer_exchange(value, new_value) __sync_lock_test_and_set(value, (__pyx_atomic_ptr_type)new_value)
1679 static CYTHON_INLINE
int __pyx_atomic_pointer_cmp_exchange(__pyx_atomic_ptr_type* value, __pyx_nonatomic_ptr_type* expected, __pyx_nonatomic_ptr_type desired) {
1680 __pyx_nonatomic_ptr_type old = __sync_val_compare_and_swap(value, *expected, desired);
1681 int result = old == *expected;
1685 #ifdef __PYX_DEBUG_ATOMICS
1686 #warning "Using GNU atomics"
1688#elif CYTHON_ATOMICS && defined(_MSC_VER)
1690 #undef __pyx_atomic_int_type
1691 #define __pyx_atomic_int_type long
1692 #define __pyx_atomic_ptr_type void*
1693 #undef __pyx_nonatomic_int_type
1694 #define __pyx_nonatomic_int_type long
1695 #define __pyx_nonatomic_ptr_type void*
1696 #pragma intrinsic (_InterlockedExchangeAdd, _InterlockedExchange, _InterlockedCompareExchange, _InterlockedCompareExchangePointer, _InterlockedExchangePointer)
1697 #define __pyx_atomic_incr_relaxed(value) _InterlockedExchangeAdd(value, 1)
1698 #define __pyx_atomic_incr_acq_rel(value) _InterlockedExchangeAdd(value, 1)
1699 #define __pyx_atomic_decr_acq_rel(value) _InterlockedExchangeAdd(value, -1)
1700 #define __pyx_atomic_sub(value, arg) _InterlockedExchangeAdd(value, -arg)
1701 static CYTHON_INLINE
int __pyx_atomic_int_cmp_exchange(__pyx_atomic_int_type* value, __pyx_nonatomic_int_type* expected, __pyx_nonatomic_int_type desired) {
1702 __pyx_nonatomic_int_type old = _InterlockedCompareExchange(value, desired, *expected);
1703 int result = old == *expected;
1707 #define __pyx_atomic_load(value) _InterlockedExchangeAdd(value, 0)
1708 #define __pyx_atomic_store(value, new_value) _InterlockedExchange(value, new_value)
1709 #define __pyx_atomic_pointer_load_relaxed(value) *(void * volatile *)value
1710 #define __pyx_atomic_pointer_load_acquire(value) _InterlockedCompareExchangePointer(value, 0, 0)
1711 #define __pyx_atomic_pointer_exchange(value, new_value) _InterlockedExchangePointer(value, (__pyx_atomic_ptr_type)new_value)
1712 static CYTHON_INLINE
int __pyx_atomic_pointer_cmp_exchange(__pyx_atomic_ptr_type* value, __pyx_nonatomic_ptr_type* expected, __pyx_nonatomic_ptr_type desired) {
1713 __pyx_atomic_ptr_type old = _InterlockedCompareExchangePointer(value, desired, *expected);
1714 int result = old == *expected;
1718 #ifdef __PYX_DEBUG_ATOMICS
1719 #pragma message ("Using MSVC atomics")
1722 #undef CYTHON_ATOMICS
1723 #define CYTHON_ATOMICS 0
1724 #ifdef __PYX_DEBUG_ATOMICS
1725 #warning "Not using atomics"
1730#if !CYTHON_COMPILING_IN_CPYTHON_FREETHREADING
1731#define __Pyx_PyCriticalSection void*
1732#define __Pyx_PyCriticalSection2 void*
1733#define __Pyx_PyCriticalSection_End(cs)
1734#define __Pyx_PyCriticalSection2_End(cs)
1736#define __Pyx_PyCriticalSection PyCriticalSection
1737#define __Pyx_PyCriticalSection2 PyCriticalSection2
1738#define __Pyx_PyCriticalSection_End PyCriticalSection_End
1739#define __Pyx_PyCriticalSection2_End PyCriticalSection2_End
1743#if !CYTHON_COMPILING_IN_CPYTHON_FREETHREADING
1744#define __Pyx_PyCriticalSection_Begin(cs, arg) (void)(cs)
1745#define __Pyx_PyCriticalSection2_Begin(cs, arg1, arg2) (void)(cs)
1747#define __Pyx_PyCriticalSection_Begin PyCriticalSection_Begin
1748#define __Pyx_PyCriticalSection2_Begin PyCriticalSection2_Begin
1750#if PY_VERSION_HEX < 0x030d0000 || CYTHON_COMPILING_IN_LIMITED_API
1751#define __Pyx_BEGIN_CRITICAL_SECTION(o) {
1752#define __Pyx_END_CRITICAL_SECTION() }
1754#define __Pyx_BEGIN_CRITICAL_SECTION Py_BEGIN_CRITICAL_SECTION
1755#define __Pyx_END_CRITICAL_SECTION Py_END_CRITICAL_SECTION
1759#ifndef __PYX_FORCE_INIT_THREADS
1760 #define __PYX_FORCE_INIT_THREADS 0
1764#define __Pyx_PyGILState_Ensure PyGILState_Ensure
1765#define __Pyx_PyGILState_Release PyGILState_Release
1766#define __Pyx_FastGIL_Remember()
1767#define __Pyx_FastGIL_Forget()
1768#define __Pyx_FastGilFuncInit()
1771#include <structmember.h>
1774struct __Pyx_StructField_;
1775#define __PYX_BUF_FLAGS_PACKED_STRUCT (1 << 0)
1778 const struct __Pyx_StructField_* fields;
1780 size_t arraysize[8];
1786typedef struct __Pyx_StructField_ {
1787 const __Pyx_TypeInfo* type;
1792 const __Pyx_StructField* field;
1793 size_t parent_offset;
1794} __Pyx_BufFmt_StackElem;
1796 __Pyx_StructField root;
1797 __Pyx_BufFmt_StackElem* head;
1799 size_t new_count, enc_count;
1800 size_t struct_alignment;
1805 char is_valid_array;
1806} __Pyx_BufFmt_Context;
1809struct __pyx_memoryview_obj;
1811 struct __pyx_memoryview_obj *memview;
1813 Py_ssize_t shape[8];
1814 Py_ssize_t strides[8];
1815 Py_ssize_t suboffsets[8];
1816} __Pyx_memviewslice;
1817#define __Pyx_MemoryView_Len(m) (m.shape[0])
1818#define __Pyx_MEMVIEW_DIRECT 1
1819#define __Pyx_MEMVIEW_PTR 2
1820#define __Pyx_MEMVIEW_FULL 4
1821#define __Pyx_MEMVIEW_CONTIG 8
1822#define __Pyx_MEMVIEW_STRIDED 16
1823#define __Pyx_MEMVIEW_FOLLOW 32
1824#define __Pyx_IS_C_CONTIG 1
1825#define __Pyx_IS_F_CONTIG 2
1826#define __Pyx_MEMSLICE_INIT { 0, 0, { 0 }, { 0 }, { 0 } }
1828 #define __pyx_add_acquisition_count(memview)\
1829 __pyx_atomic_incr_relaxed(__pyx_get_slice_count_pointer(memview))
1830 #define __pyx_sub_acquisition_count(memview)\
1831 __pyx_atomic_decr_acq_rel(__pyx_get_slice_count_pointer(memview))
1833 #define __pyx_add_acquisition_count(memview)\
1834 __pyx_add_acquisition_count_locked(__pyx_get_slice_count_pointer(memview), memview->lock)
1835 #define __pyx_sub_acquisition_count(memview)\
1836 __pyx_sub_acquisition_count_locked(__pyx_get_slice_count_pointer(memview), memview->lock)
1848typedef npy_int8 __pyx_t_5numpy_int8_t;
1857typedef npy_int16 __pyx_t_5numpy_int16_t;
1866typedef npy_int32 __pyx_t_5numpy_int32_t;
1875typedef npy_int64 __pyx_t_5numpy_int64_t;
1884typedef npy_uint8 __pyx_t_5numpy_uint8_t;
1893typedef npy_uint16 __pyx_t_5numpy_uint16_t;
1902typedef npy_uint32 __pyx_t_5numpy_uint32_t;
1911typedef npy_uint64 __pyx_t_5numpy_uint64_t;
1920typedef npy_float32 __pyx_t_5numpy_float32_t;
1929typedef npy_float64 __pyx_t_5numpy_float64_t;
1938typedef npy_longlong __pyx_t_5numpy_longlong_t;
1947typedef npy_ulonglong __pyx_t_5numpy_ulonglong_t;
1956typedef npy_intp __pyx_t_5numpy_intp_t;
1965typedef npy_uintp __pyx_t_5numpy_uintp_t;
1974typedef npy_double __pyx_t_5numpy_float_t;
1983typedef npy_double __pyx_t_5numpy_double_t;
1992typedef npy_longdouble __pyx_t_5numpy_longdouble_t;
1995#if CYTHON_CCOMPLEX && (1) && (!0 || __cplusplus)
1997 typedef ::std::complex< float > __pyx_t_float_complex;
1999 typedef float _Complex __pyx_t_float_complex;
2002 typedef struct {
float real, imag; } __pyx_t_float_complex;
2004static CYTHON_INLINE __pyx_t_float_complex __pyx_t_float_complex_from_parts(
float,
float);
2007#if CYTHON_CCOMPLEX && (1) && (!0 || __cplusplus)
2009 typedef ::std::complex< double > __pyx_t_double_complex;
2011 typedef double _Complex __pyx_t_double_complex;
2014 typedef struct {
double real, imag; } __pyx_t_double_complex;
2016static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(
double,
double);
2019#if CYTHON_CCOMPLEX && (1) && (!0 || __cplusplus)
2021 typedef ::std::complex< long double > __pyx_t_long_double_complex;
2023 typedef long double _Complex __pyx_t_long_double_complex;
2026 typedef struct {
long double real, imag; } __pyx_t_long_double_complex;
2028static CYTHON_INLINE __pyx_t_long_double_complex __pyx_t_long_double_complex_from_parts(
long double,
long double);
2033struct __pyx_obj_15superluWrappers_cSparseMatrix;
2034struct __pyx_obj_15superluWrappers_SparseFactor;
2035struct __pyx_array_obj;
2036struct __pyx_MemviewEnum_obj;
2037struct __pyx_memoryview_obj;
2038struct __pyx_memoryviewslice_obj;
2039struct __pyx_t_15superluWrappers__NRformat;
2040struct __pyx_t_15superluWrappers__NCformat;
2041struct __pyx_t_15superluWrappers__DNformat;
2042struct __pyx_t_15superluWrappers__NCPformat;
2051struct __pyx_t_15superluWrappers__NRformat {
2052 __pyx_t_5numpy_int32_t
nnz;
2053 __pyx_t_5numpy_float64_t *nzval;
2054 __pyx_t_5numpy_int32_t *colind;
2055 __pyx_t_5numpy_int32_t *rowptr;
2065struct __pyx_t_15superluWrappers__NCformat {
2066 __pyx_t_5numpy_int32_t
nnz;
2067 __pyx_t_5numpy_float64_t *nzval;
2068 __pyx_t_5numpy_int32_t *rowind;
2069 __pyx_t_5numpy_int32_t *colptr;
2079struct __pyx_t_15superluWrappers__DNformat {
2080 __pyx_t_5numpy_int32_t lda;
2091struct __pyx_t_15superluWrappers__NCPformat {
2092 __pyx_t_5numpy_int32_t
nnz;
2094 __pyx_t_5numpy_int32_t *rowind;
2095 __pyx_t_5numpy_int32_t *colbeg;
2096 __pyx_t_5numpy_int32_t *colend;
2106struct __pyx_obj_15superluWrappers_cSparseMatrix {
2108 __pyx_t_5numpy_int32_t dim[2];
2109 struct __pyx_t_15superluWrappers__NRformat A;
2120struct __pyx_obj_15superluWrappers_SparseFactor {
2122 struct __pyx_vtabstruct_15superluWrappers_SparseFactor *__pyx_vtab;
2123 superlu_options_t options;
2131 struct __pyx_t_15superluWrappers__NCformat storeA;
2132 struct __pyx_t_15superluWrappers__DNformat storeX;
2136 unsigned int use_same_perm_c;
2137 unsigned int use_same_sparsity;
2149struct __pyx_array_obj {
2151 struct __pyx_vtabstruct_array *__pyx_vtab;
2157 Py_ssize_t *_strides;
2158 Py_ssize_t itemsize;
2161 void (*callback_free_data)(
void *);
2163 int dtype_is_object;
2174struct __pyx_MemviewEnum_obj {
2187struct __pyx_memoryview_obj {
2189 struct __pyx_vtabstruct_memoryview *__pyx_vtab;
2193 PyThread_type_lock lock;
2194 __pyx_atomic_int_type acquisition_count;
2197 int dtype_is_object;
2198 __Pyx_TypeInfo
const *typeinfo;
2209struct __pyx_memoryviewslice_obj {
2210 struct __pyx_memoryview_obj __pyx_base;
2211 __Pyx_memviewslice from_slice;
2212 PyObject *from_object;
2213 PyObject *(*to_object_func)(
char *);
2214 __pyx_memoryview_to_dtype_func_type to_dtype_func;
2227struct __pyx_vtabstruct_15superluWrappers_SparseFactor {
2228 PyObject *(*_set_mat_types)(
struct __pyx_obj_15superluWrappers_SparseFactor *);
2230static struct __pyx_vtabstruct_15superluWrappers_SparseFactor *__pyx_vtabptr_15superluWrappers_SparseFactor;
2241struct __pyx_vtabstruct_array {
2242 PyObject *(*get_memview)(
struct __pyx_array_obj *);
2244static struct __pyx_vtabstruct_array *__pyx_vtabptr_array;
2255struct __pyx_vtabstruct_memoryview {
2256 char *(*get_item_pointer)(
struct __pyx_memoryview_obj *, PyObject *);
2257 PyObject *(*is_slice)(
struct __pyx_memoryview_obj *, PyObject *);
2258 PyObject *(*setitem_slice_assignment)(
struct __pyx_memoryview_obj *, PyObject *, PyObject *);
2259 PyObject *(*setitem_slice_assign_scalar)(
struct __pyx_memoryview_obj *,
struct __pyx_memoryview_obj *, PyObject *);
2260 PyObject *(*setitem_indexed)(
struct __pyx_memoryview_obj *, PyObject *, PyObject *);
2261 PyObject *(*setitem_indexed1)(
struct __pyx_memoryview_obj *, PyObject *, PyObject *);
2262 PyObject *(*convert_item_to_object)(
struct __pyx_memoryview_obj *,
char *);
2263 PyObject *(*assign_item_from_object)(
struct __pyx_memoryview_obj *,
char *, PyObject *);
2264 PyObject *(*_get_base)(
struct __pyx_memoryview_obj *);
2266static struct __pyx_vtabstruct_memoryview *__pyx_vtabptr_memoryview;
2277struct __pyx_vtabstruct__memoryviewslice {
2278 struct __pyx_vtabstruct_memoryview __pyx_base;
2280static struct __pyx_vtabstruct__memoryviewslice *__pyx_vtabptr__memoryviewslice;
2285#ifndef CYTHON_REFNANNY
2286 #define CYTHON_REFNANNY 0
2290 void (*INCREF)(
void*, PyObject*, Py_ssize_t);
2291 void (*DECREF)(
void*, PyObject*, Py_ssize_t);
2292 void (*GOTREF)(
void*, PyObject*, Py_ssize_t);
2293 void (*GIVEREF)(
void*, PyObject*, Py_ssize_t);
2294 void* (*SetupContext)(
const char*, Py_ssize_t,
const char*);
2295 void (*FinishContext)(
void**);
2296 } __Pyx_RefNannyAPIStruct;
2297 static __Pyx_RefNannyAPIStruct *__Pyx_RefNanny = NULL;
2298 static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(
const char *modname);
2299 #define __Pyx_RefNannyDeclarations void *__pyx_refnanny = NULL;
2300 #define __Pyx_RefNannySetupContext(name, acquire_gil)\
2302 PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();\
2303 __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), (__LINE__), (__FILE__));\
2304 PyGILState_Release(__pyx_gilstate_save);\
2306 __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), (__LINE__), (__FILE__));\
2308 #define __Pyx_RefNannyFinishContextNogil() {\
2309 PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();\
2310 __Pyx_RefNannyFinishContext();\
2311 PyGILState_Release(__pyx_gilstate_save);\
2313 #define __Pyx_RefNannyFinishContextNogil() {\
2314 PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();\
2315 __Pyx_RefNannyFinishContext();\
2316 PyGILState_Release(__pyx_gilstate_save);\
2318 #define __Pyx_RefNannyFinishContext()\
2319 __Pyx_RefNanny->FinishContext(&__pyx_refnanny)
2320 #define __Pyx_INCREF(r) __Pyx_RefNanny->INCREF(__pyx_refnanny, (PyObject *)(r), (__LINE__))
2321 #define __Pyx_DECREF(r) __Pyx_RefNanny->DECREF(__pyx_refnanny, (PyObject *)(r), (__LINE__))
2322 #define __Pyx_GOTREF(r) __Pyx_RefNanny->GOTREF(__pyx_refnanny, (PyObject *)(r), (__LINE__))
2323 #define __Pyx_GIVEREF(r) __Pyx_RefNanny->GIVEREF(__pyx_refnanny, (PyObject *)(r), (__LINE__))
2324 #define __Pyx_XINCREF(r) do { if((r) == NULL); else {__Pyx_INCREF(r); }} while(0)
2325 #define __Pyx_XDECREF(r) do { if((r) == NULL); else {__Pyx_DECREF(r); }} while(0)
2326 #define __Pyx_XGOTREF(r) do { if((r) == NULL); else {__Pyx_GOTREF(r); }} while(0)
2327 #define __Pyx_XGIVEREF(r) do { if((r) == NULL); else {__Pyx_GIVEREF(r);}} while(0)
2329 #define __Pyx_RefNannyDeclarations
2330 #define __Pyx_RefNannySetupContext(name, acquire_gil)
2331 #define __Pyx_RefNannyFinishContextNogil()
2332 #define __Pyx_RefNannyFinishContext()
2333 #define __Pyx_INCREF(r) Py_INCREF(r)
2334 #define __Pyx_DECREF(r) Py_DECREF(r)
2335 #define __Pyx_GOTREF(r)
2336 #define __Pyx_GIVEREF(r)
2337 #define __Pyx_XINCREF(r) Py_XINCREF(r)
2338 #define __Pyx_XDECREF(r) Py_XDECREF(r)
2339 #define __Pyx_XGOTREF(r)
2340 #define __Pyx_XGIVEREF(r)
2342#define __Pyx_Py_XDECREF_SET(r, v) do {\
2343 PyObject *tmp = (PyObject *) r;\
2344 r = v; Py_XDECREF(tmp);\
2346#define __Pyx_XDECREF_SET(r, v) do {\
2347 PyObject *tmp = (PyObject *) r;\
2348 r = v; __Pyx_XDECREF(tmp);\
2350#define __Pyx_DECREF_SET(r, v) do {\
2351 PyObject *tmp = (PyObject *) r;\
2352 r = v; __Pyx_DECREF(tmp);\
2354#define __Pyx_CLEAR(r) do { PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);} while(0)
2355#define __Pyx_XCLEAR(r) do { if((r) != NULL) {PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);}} while(0)
2358#if CYTHON_COMPILING_IN_CPYTHON
2359#define __Pyx_TypeCheck(obj, type) __Pyx_IsSubtype(Py_TYPE(obj), (PyTypeObject *)type)
2360#define __Pyx_TypeCheck2(obj, type1, type2) __Pyx_IsAnySubtype2(Py_TYPE(obj), (PyTypeObject *)type1, (PyTypeObject *)type2)
2361static CYTHON_INLINE
int __Pyx_IsSubtype(PyTypeObject *a, PyTypeObject *b);
2362static CYTHON_INLINE
int __Pyx_IsAnySubtype2(PyTypeObject *cls, PyTypeObject *a, PyTypeObject *b);
2363#define __Pyx_PyAnySet_Check(obj) __Pyx_TypeCheck2(obj, &PySet_Type, &PyFrozenSet_Type)
2365#define __Pyx_TypeCheck(obj, type) PyObject_TypeCheck(obj, (PyTypeObject *)type)
2366#define __Pyx_TypeCheck2(obj, type1, type2) (PyObject_TypeCheck(obj, (PyTypeObject *)type1) || PyObject_TypeCheck(obj, (PyTypeObject *)type2))
2367#define __Pyx_PyAnySet_Check(obj) PyAnySet_Check(obj)
2371#if CYTHON_FAST_THREAD_STATE
2372#define __Pyx_PyThreadState_declare PyThreadState *__pyx_tstate;
2373#define __Pyx_PyThreadState_assign __pyx_tstate = __Pyx_PyThreadState_Current;
2374#if PY_VERSION_HEX >= 0x030C00A6
2375#define __Pyx_PyErr_Occurred() (__pyx_tstate->current_exception != NULL)
2376#define __Pyx_PyErr_CurrentExceptionType() (__pyx_tstate->current_exception ? (PyObject*) Py_TYPE(__pyx_tstate->current_exception) : (PyObject*) NULL)
2378#define __Pyx_PyErr_Occurred() (__pyx_tstate->curexc_type != NULL)
2379#define __Pyx_PyErr_CurrentExceptionType() (__pyx_tstate->curexc_type)
2382#define __Pyx_PyThreadState_declare
2383#define __Pyx_PyThreadState_assign
2384#define __Pyx_PyErr_Occurred() (PyErr_Occurred() != NULL)
2385#define __Pyx_PyErr_CurrentExceptionType() PyErr_Occurred()
2389#if CYTHON_FAST_THREAD_STATE
2390#define __Pyx_PyErr_Clear() __Pyx_ErrRestore(NULL, NULL, NULL)
2391#define __Pyx_ErrRestoreWithState(type, value, tb) __Pyx_ErrRestoreInState(PyThreadState_GET(), type, value, tb)
2392#define __Pyx_ErrFetchWithState(type, value, tb) __Pyx_ErrFetchInState(PyThreadState_GET(), type, value, tb)
2393#define __Pyx_ErrRestore(type, value, tb) __Pyx_ErrRestoreInState(__pyx_tstate, type, value, tb)
2394#define __Pyx_ErrFetch(type, value, tb) __Pyx_ErrFetchInState(__pyx_tstate, type, value, tb)
2395static CYTHON_INLINE
void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb);
2396static CYTHON_INLINE
void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb);
2397#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030C00A6
2398#define __Pyx_PyErr_SetNone(exc) (Py_INCREF(exc), __Pyx_ErrRestore((exc), NULL, NULL))
2400#define __Pyx_PyErr_SetNone(exc) PyErr_SetNone(exc)
2403#define __Pyx_PyErr_Clear() PyErr_Clear()
2404#define __Pyx_PyErr_SetNone(exc) PyErr_SetNone(exc)
2405#define __Pyx_ErrRestoreWithState(type, value, tb) PyErr_Restore(type, value, tb)
2406#define __Pyx_ErrFetchWithState(type, value, tb) PyErr_Fetch(type, value, tb)
2407#define __Pyx_ErrRestoreInState(tstate, type, value, tb) PyErr_Restore(type, value, tb)
2408#define __Pyx_ErrFetchInState(tstate, type, value, tb) PyErr_Fetch(type, value, tb)
2409#define __Pyx_ErrRestore(type, value, tb) PyErr_Restore(type, value, tb)
2410#define __Pyx_ErrFetch(type, value, tb) PyErr_Fetch(type, value, tb)
2414#if CYTHON_COMPILING_IN_CPYTHON
2415static CYTHON_INLINE
int __Pyx_PyErr_GivenExceptionMatches(PyObject *err, PyObject *type);
2416static CYTHON_INLINE
int __Pyx_PyErr_GivenExceptionMatches2(PyObject *err, PyObject *type1, PyObject *type2);
2418#define __Pyx_PyErr_GivenExceptionMatches(err, type) PyErr_GivenExceptionMatches(err, type)
2419static CYTHON_INLINE
int __Pyx_PyErr_GivenExceptionMatches2(PyObject *err, PyObject *type1, PyObject *type2) {
2420 return PyErr_GivenExceptionMatches(err, type1) || PyErr_GivenExceptionMatches(err, type2);
2423#define __Pyx_PyErr_ExceptionMatches2(err1, err2) __Pyx_PyErr_GivenExceptionMatches2(__Pyx_PyErr_CurrentExceptionType(), err1, err2)
2426#if CYTHON_FAST_THREAD_STATE
2427#define __Pyx_PyErr_ExceptionMatches(err) __Pyx_PyErr_ExceptionMatchesInState(__pyx_tstate, err)
2428static CYTHON_INLINE
int __Pyx_PyErr_ExceptionMatchesInState(PyThreadState* tstate, PyObject* err);
2430#define __Pyx_PyErr_ExceptionMatches(err) PyErr_ExceptionMatches(err)
2434#if CYTHON_USE_TYPE_SLOTS
2435static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name);
2437#define __Pyx_PyObject_GetAttrStr(o,n) PyObject_GetAttr(o,n)
2441static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStrNoError(PyObject* obj, PyObject* attr_name);
2444static PyObject *__Pyx_GetBuiltinName(PyObject *name);
2447#if CYTHON_COMPILING_IN_CPYTHON
2448static CYTHON_INLINE
void __Pyx_copy_object_array(PyObject *
const *CYTHON_RESTRICT src, PyObject** CYTHON_RESTRICT dest, Py_ssize_t length);
2452#if PY_VERSION_HEX >= 0x030F0000 && !CYTHON_COMPILING_IN_LIMITED_API
2453#define __Pyx_PyTuple_FromArray(src, n) PyTuple_FromArray(src, ((n)<0) ? 0 : (n))
2455CYTHON_UNUSED
static PyObject *
2456__Pyx_PyTuple_FromArray(PyObject *
const *src, Py_ssize_t
n);
2466static CYTHON_INLINE
int __Pyx_PyObject_CompareBoolEq_str_str(PyObject *op1, PyObject *op2,
int pyop);
2469#define __Pyx_PyUnicode_Equals(s1, s2) __Pyx_PyObject_CompareBoolEq_str_str(s1, s2, Py_EQ)
2472#if CYTHON_AVOID_BORROWED_REFS
2473 #define __Pyx_ArgRef_VARARGS(args, i) __Pyx_PySequence_ITEM(args, i)
2474#elif CYTHON_ASSUME_SAFE_MACROS
2475 #define __Pyx_ArgRef_VARARGS(args, i) __Pyx_NewRef(__Pyx_PyTuple_GET_ITEM(args, i))
2477 #define __Pyx_ArgRef_VARARGS(args, i) __Pyx_XNewRef(PyTuple_GetItem(args, i))
2479#define __Pyx_NumKwargs_VARARGS(kwds) PyDict_Size(kwds)
2480#define __Pyx_KwValues_VARARGS(args, nargs) NULL
2481#define __Pyx_GetKwValue_VARARGS(kw, kwvalues, s) __Pyx_PyDict_GetItemStrWithError(kw, s)
2482#define __Pyx_KwargsAsDict_VARARGS(kw, kwvalues) PyDict_Copy(kw)
2483#if CYTHON_VECTORCALL
2484 #define __Pyx_ArgRef_FASTCALL(args, i) __Pyx_NewRef(args[i])
2485 #define __Pyx_NumKwargs_FASTCALL(kwds) __Pyx_PyTuple_GET_SIZE(kwds)
2486 #define __Pyx_KwValues_FASTCALL(args, nargs) ((args) + (nargs))
2487 static CYTHON_INLINE PyObject * __Pyx_GetKwValue_FASTCALL(PyObject *kwnames, PyObject *
const *kwvalues, PyObject *
s);
2488 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030d0000 || CYTHON_COMPILING_IN_LIMITED_API || CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_GRAAL
2489 CYTHON_UNUSED
static PyObject *__Pyx_KwargsAsDict_FASTCALL(PyObject *kwnames, PyObject *
const *kwvalues);
2491 #define __Pyx_KwargsAsDict_FASTCALL(kw, kwvalues) _PyStack_AsDict(kwvalues, kw)
2494 #define __Pyx_ArgRef_FASTCALL __Pyx_ArgRef_VARARGS
2495 #define __Pyx_NumKwargs_FASTCALL __Pyx_NumKwargs_VARARGS
2496 #define __Pyx_KwValues_FASTCALL __Pyx_KwValues_VARARGS
2497 #define __Pyx_GetKwValue_FASTCALL __Pyx_GetKwValue_VARARGS
2498 #define __Pyx_KwargsAsDict_FASTCALL __Pyx_KwargsAsDict_VARARGS
2500#if CYTHON_VECTORCALL_TPNEW
2501 #if !CYTHON_VECTORCALL
2502 #error Enabling CYTHON_VECTORCALL_TPNEW without CYTHON_VECTORCALL is not supported
2504 #define __Pyx_ArgRef_FASTCALL_TPNEW __Pyx_ArgRef_FASTCALL
2505 #define __Pyx_NumKwargs_FASTCALL_TPNEW __Pyx_NumKwargs_FASTCALL
2506 #define __Pyx_KwValues_FASTCALL_TPNEW __Pyx_KwValues_FASTCALL
2507 #define __Pyx_GetKwValue_FASTCALL_TPNEW __Pyx_GetKwValue_FASTCALL
2508 #define __Pyx_KwargsAsDict_FASTCALL_TPNEW __Pyx_KwargsAsDict_FASTCALL
2510 #define __Pyx_ArgRef_FASTCALL_TPNEW __Pyx_ArgRef_VARARGS
2511 #define __Pyx_NumKwargs_FASTCALL_TPNEW __Pyx_NumKwargs_VARARGS
2512 #define __Pyx_KwValues_FASTCALL_TPNEW __Pyx_KwValues_VARARGS
2513 #define __Pyx_GetKwValue_FASTCALL_TPNEW __Pyx_GetKwValue_VARARGS
2514 #define __Pyx_KwargsAsDict_FASTCALL_TPNEW __Pyx_KwargsAsDict_VARARGS
2516#define __Pyx_ArgsSlice_VARARGS(args, start, stop) PyTuple_GetSlice(args, start, stop)
2517#if CYTHON_VECTORCALL
2518#define __Pyx_ArgsSlice_FASTCALL(args, start, stop) __Pyx_PyTuple_FromArray(args + start, stop - start)
2520#define __Pyx_ArgsSlice_FASTCALL __Pyx_ArgsSlice_VARARGS
2524#define __Pyx_PyDict_items_TypePtr (&PyDictKeys_Type)
2525#define __Pyx_PyDict_items_Check(obj) PyObject_TypeCheck((obj), __Pyx_PyDictItems_TypePtr)
2526#define __Pyx_PyDict_items_CheckExact(obj) Py_IS_TYPE((obj), __Pyx_PyDictItems_TypePtr)
2527static CYTHON_INLINE PyObject* __Pyx_PyDict_Items(PyObject* d);
2530#define __Pyx_CallCFunction(cfunc, self, args)\
2531 ((PyCFunction)(void(*)(void))(cfunc)->func)(self, args)
2532#define __Pyx_CallCFunctionWithKeywords(cfunc, self, args, kwargs)\
2533 ((PyCFunctionWithKeywords)(void(*)(void))(cfunc)->func)(self, args, kwargs)
2534#define __Pyx_CallCFunctionFast(cfunc, self, args, nargs)\
2535 ((__Pyx_PyCFunctionFast)(void(*)(void))(PyCFunction)(cfunc)->func)(self, args, nargs)
2536#define __Pyx_CallCFunctionFastWithKeywords(cfunc, self, args, nargs, kwnames)\
2537 ((__Pyx_PyCFunctionFastWithKeywords)(void(*)(void))(PyCFunction)(cfunc)->func)(self, args, nargs, kwnames)
2540#if CYTHON_COMPILING_IN_CPYTHON
2541static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw);
2543#define __Pyx_PyObject_Call(func, arg, kw) PyObject_Call(func, arg, kw)
2547#if CYTHON_COMPILING_IN_CPYTHON
2548static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg);
2552#define __Pyx_PyObject_FastCall(func, args, nargs) __Pyx_PyObject_FastCallDict(func, args, (size_t)(nargs), NULL)
2553static CYTHON_INLINE PyObject* __Pyx_PyObject_FastCallDict(PyObject *func, PyObject *
const*args,
size_t nargsf, PyObject *kwargs);
2556static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg);
2561 PyObject **method_name;
2565#if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING && CYTHON_ATOMICS
2566 __pyx_atomic_int_type initialized;
2568} __Pyx_CachedCFunction;
2571static CYTHON_INLINE
int __Pyx_IgnoreGivenException(PyObject *given_exception, PyObject *ignorable_exception);
2572#define __Pyx_IgnoreException(ignorable_exception) __Pyx_IgnoreGivenException(NULL, ignorable_exception)
2575static int __Pyx_TryUnpackUnboundCMethod(__Pyx_CachedCFunction* target);
2578#if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING
2579static CYTHON_INLINE
int __Pyx_CachedCFunction_GetAndSetInitializing(__Pyx_CachedCFunction *cfunc) {
2583 __pyx_nonatomic_int_type expected = 0;
2584 if (__pyx_atomic_int_cmp_exchange(&cfunc->initialized, &expected, 1)) {
2590static CYTHON_INLINE
void __Pyx_CachedCFunction_SetFinishedInitializing(__Pyx_CachedCFunction *cfunc) {
2592 __pyx_atomic_store(&cfunc->initialized, 2);
2596#define __Pyx_CachedCFunction_GetAndSetInitializing(cfunc) 2
2597#define __Pyx_CachedCFunction_SetFinishedInitializing(cfunc)
2602static PyObject* __Pyx__CallUnboundCMethod0(__Pyx_CachedCFunction* cfunc, PyObject* self);
2603#if CYTHON_COMPILING_IN_CPYTHON
2604static CYTHON_INLINE PyObject* __Pyx_CallUnboundCMethod0(__Pyx_CachedCFunction* cfunc, PyObject* self);
2606#define __Pyx_CallUnboundCMethod0(cfunc, self) __Pyx__CallUnboundCMethod0(cfunc, self)
2610#define __Pyx_PyDict_values_TypePtr (&PyDictKeys_Type)
2611#define __Pyx_PyDict_values_Check(obj) PyObject_TypeCheck((obj), __Pyx_PyDictValues_TypePtr)
2612#define __Pyx_PyDict_values_CheckExact(obj) Py_IS_TYPE((obj), __Pyx_PyDictValues_TypePtr)
2613static CYTHON_INLINE PyObject* __Pyx_PyDict_Values(PyObject* d);
2616#if CYTHON_AVOID_BORROWED_REFS
2617static int __Pyx_PyDict_NextRef(PyObject *p, PyObject **ppos, PyObject **pkey, PyObject **pvalue);
2620static int __Pyx_PyDict_NextRef(PyObject *p, Py_ssize_t *ppos, PyObject **pkey, PyObject **pvalue);
2624static void __Pyx_RaiseDoubleKeywordsError(
const char* func_name, PyObject* kw_name);
2627static int __Pyx_ParseKeywordsTuple(
2629 PyObject *
const *kwvalues,
2630 PyObject **
const argnames[],
2633 Py_ssize_t num_pos_args,
2634 Py_ssize_t num_kwargs,
2635 const char* function_name,
2636 int ignore_unknown_kwargs
2638static int __Pyx_ParseKeywordDictToDict(
2640 PyObject **
const argnames[],
2643 Py_ssize_t num_pos_args,
2644 const char* function_name
2646static int __Pyx_ParseKeywordDict(
2648 PyObject **
const argnames[],
2650 Py_ssize_t num_pos_args,
2651 Py_ssize_t num_kwargs,
2652 const char* function_name,
2653 int ignore_unknown_kwargs
2658static PyObject* __Pyx__CallUnboundCMethod2(__Pyx_CachedCFunction* cfunc, PyObject* self, PyObject* arg1, PyObject* arg2);
2659#if CYTHON_COMPILING_IN_CPYTHON
2660static CYTHON_INLINE PyObject *__Pyx_CallUnboundCMethod2(__Pyx_CachedCFunction *cfunc, PyObject *self, PyObject *arg1, PyObject *arg2);
2662#define __Pyx_CallUnboundCMethod2(cfunc, self, arg1, arg2) __Pyx__CallUnboundCMethod2(cfunc, self, arg1, arg2)
2666static CYTHON_INLINE
int __Pyx_ParseKeywords(
2667 PyObject *kwds, PyObject *
const *kwvalues, PyObject **
const argnames[],
2668 PyObject *kwds2, PyObject *values[],
2669 Py_ssize_t num_pos_args, Py_ssize_t num_kwargs,
2670 const char* function_name,
2671 int ignore_unknown_kwargs
2675static void __Pyx_RaiseArgtupleInvalid(
const char* func_name,
int exact,
2676 Py_ssize_t num_min, Py_ssize_t num_max, Py_ssize_t num_found);
2679static void __Pyx_ArgTypeError(PyObject *obj, PyTypeObject *type,
const char *name,
int exact);
2682static CYTHON_INLINE
int __Pyx_ArgTypeTest(PyObject *obj, PyTypeObject *type,
int none_allowed,
const char *name,
int exact);
2685#if CYTHON_VECTORCALL
2686#define __Pyx_PyObject_FastCallMethod(name, args, nargsf) PyObject_VectorcallMethod(name, args, nargsf, NULL)
2688static PyObject *__Pyx_PyObject_FastCallMethod(PyObject *name, PyObject *
const *args,
size_t nargsf);
2692#if CYTHON_COMPILING_IN_LIMITED_API && __PYX_LIMITED_VERSION_HEX >= 0x030d0000
2693typedef PyObject *__Pyx_TypeName;
2694#define __Pyx_FMT_TYPENAME "%N"
2695#define __Pyx_PyType_GetFullyQualifiedName(tp) Py_NewRef((PyObject*)tp)
2696#define __Pyx_DECREF_TypeName(obj) Py_DECREF(obj)
2697#elif CYTHON_COMPILING_IN_LIMITED_API
2698typedef PyObject *__Pyx_TypeName;
2699#define __Pyx_FMT_TYPENAME "%U"
2700#define __Pyx_DECREF_TypeName(obj) Py_XDECREF(obj)
2701static __Pyx_TypeName __Pyx_PyType_GetFullyQualifiedName(PyTypeObject* tp);
2703typedef const char *__Pyx_TypeName;
2704#define __Pyx_FMT_TYPENAME "%.200s"
2705#define __Pyx_PyType_GetFullyQualifiedName(tp) ((tp)->tp_name)
2706#define __Pyx_DECREF_TypeName(obj)
2710#define __Pyx_RaiseTypeErrorWithObjectType1(message, arg, obj) __Pyx_RaiseErrorWithObjectType1(PyExc_TypeError, message, arg, obj)
2711#define __Pyx_RaiseErrorWithObjectType1(exc_type, message, arg, obj) __Pyx_RaiseErrorWithType1(exc_type, message, arg, Py_TYPE(obj))
2713static void __Pyx_RaiseErrorWithType1(PyObject* exc_type,
const char* message,
const char *arg, PyTypeObject *type_obj);
2717static int __Pyx_RaiseUnexpectedTypeError(
const char *expected, PyObject *obj);
2720#define __Pyx_PyExc_MemoryError_Check(obj) __Pyx_TypeCheck(obj, PyExc_MemoryError)
2723static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause);
2726#define __Pyx_PyExc_ValueError_Check(obj) __Pyx_TypeCheck(obj, PyExc_ValueError)
2729static PyObject* __Pyx_PyUnicode_BuildFromAscii(Py_ssize_t ulength,
const char* chars,
int clength,
2730 int prepend_sign,
char padding_char);
2733static CYTHON_INLINE
int __Pyx_CheckUnicodeValue(
int value);
2734static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromOrdinal_Padded(
int value, Py_ssize_t width,
char padding_char);
2737#if !defined(__INTEL_COMPILER) && defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 6))
2738#define __Pyx_HAS_GCC_DIAGNOSTIC
2745#define __Pyx_PyUnicode_From_int(value, width, padding_char, format_char) (\
2746 ((format_char) == ('c')) ?\
2747 __Pyx_uchar___Pyx_PyUnicode_From_int(value, width, padding_char) :\
2748 __Pyx____Pyx_PyUnicode_From_int(value, width, padding_char, format_char)\
2750static CYTHON_INLINE PyObject* __Pyx_uchar___Pyx_PyUnicode_From_int(
int value, Py_ssize_t width,
char padding_char);
2751static CYTHON_INLINE PyObject* __Pyx____Pyx_PyUnicode_From_int(
int value, Py_ssize_t width,
char padding_char,
char format_char);
2754#define __Pyx_PyUnicode_From_Py_ssize_t(value, width, padding_char, format_char) (\
2755 ((format_char) == ('c')) ?\
2756 __Pyx_uchar___Pyx_PyUnicode_From_Py_ssize_t(value, width, padding_char) :\
2757 __Pyx____Pyx_PyUnicode_From_Py_ssize_t(value, width, padding_char, format_char)\
2759static CYTHON_INLINE PyObject* __Pyx_uchar___Pyx_PyUnicode_From_Py_ssize_t(Py_ssize_t value, Py_ssize_t width,
char padding_char);
2760static CYTHON_INLINE PyObject* __Pyx____Pyx_PyUnicode_From_Py_ssize_t(Py_ssize_t value, Py_ssize_t width,
char padding_char,
char format_char);
2763#define __Pyx_PyUnicode_Join_CAN_USE_KIND_AND_LENGTH\
2764 (!CYTHON_COMPILING_IN_GRAAL && !CYTHON_COMPILING_IN_PYPY && !CYTHON_COMPILING_IN_LIMITED_API)
2767static PyObject* __Pyx_PyUnicode_Join(PyObject** values, Py_ssize_t value_count, Py_ssize_t result_ulength,
int kind);
2770#if CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API || CYTHON_COMPILING_IN_GRAAL
2771#define __Pyx_PyObject_Equals_uchar(s1, s2, ch2, equals, s1_is_str) (\
2772 ((s1) == (s2)) ? ((equals) == Py_EQ) :\
2773 ((s1) == Py_None) ? ((equals) == Py_NE) :\
2774 __Pyx_PyObject_RichCompareBool(s1, s2, equals)\
2777#define __Pyx_PyObject_Equals_uchar(s1, s2, ch2, equals, s1_is_str) (\
2778 ((s1) == (s2)) ? ((equals) == Py_EQ) :\
2779 ((s1) == Py_None) ? ((equals) == Py_NE) :\
2780 (likely((s1_is_str) || PyUnicode_CheckExact(s1)) ?\
2781 __Pyx__PyUnicode_EqualsUCS4(s1, ch2, equals) :\
2782 __Pyx_PyObject_RichCompareBool(s1, s2, equals)\
2784static CYTHON_INLINE
int __Pyx__PyUnicode_EqualsUCS4(PyObject* s1, Py_UCS4 ch2,
int equals);
2788#define __Pyx_PyObject_Equals_obj_ch99(s1, s2, equals) __Pyx_PyObject_Equals_uchar(s1, s2, 99, equals, 0)
2791static CYTHON_INLINE
int __Pyx_PyObject_CompareBoolEq_object_str(PyObject *op1, PyObject *op2,
int pyop);
2794#if CYTHON_COMPILING_IN_PYPY
2795 #define __Pyx_PyObject_FormatSimple(s, f) (\
2796 likely(PyUnicode_CheckExact(s)) ? (Py_INCREF(s), s) :\
2797 PyObject_Format(s, f))
2798#elif CYTHON_USE_TYPE_SLOTS
2799 #define __Pyx_PyObject_FormatSimple(s, f) (\
2800 likely(PyUnicode_CheckExact(s)) ? (Py_INCREF(s), s) :\
2801 likely(PyLong_CheckExact(s)) ? PyLong_Type.tp_repr(s) :\
2802 likely(PyFloat_CheckExact(s)) ? PyFloat_Type.tp_repr(s) :\
2803 PyObject_Format(s, f))
2805 #define __Pyx_PyObject_FormatSimple(s, f) (\
2806 likely(PyUnicode_CheckExact(s)) ? (Py_INCREF(s), s) :\
2807 PyObject_Format(s, f))
2811static CYTHON_INLINE PyObject* __Pyx_PyObject_CompareEq_object_bytes(PyObject *op1, PyObject *op2,
int pyop);
2813CYTHON_UNUSED
static int __pyx_array_getbuffer(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info,
int __pyx_v_flags);
2815#define __Pyx_PyObject_Equals_str_ch99(s1, s2, equals) __Pyx_PyObject_Equals_uchar(s1, s2, 99, equals, 1)
2817static PyObject *__pyx_array_get_memview(
struct __pyx_array_obj *);
2819static CYTHON_INLINE PyObject *__Pyx_GetAttr(PyObject *, PyObject *);
2822#if CYTHON_COMPILING_IN_LIMITED_API
2823#define __Pyx_PyFrozenDict_TypePtr ((PyTypeObject*) __pyx_mstate_global->__Pyx_PyFrozenDictType)
2824#define __Pyx_PyFrozenDict_New(it) __Pyx__PyFrozenDict_New(__pyx_mstate_global->__Pyx_PyFrozenDictType, it)
2825static CYTHON_INLINE PyObject* __Pyx__PyFrozenDict_New(PyObject* frozendict_type, PyObject* it);
2826#define __Pyx_PyFrozenDict_NewEmpty() __Pyx_PyFrozenDict_New(NULL)
2827#define __Pyx_PyFrozenDict_Check(obj) PyObject_TypeCheck((obj), __Pyx_PyFrozenDict_TypePtr)
2828#define __Pyx_PyFrozenDict_CheckExact(obj) Py_IS_TYPE((obj), __Pyx_PyFrozenDict_TypePtr)
2829#define __Pyx_PyAnyDict_Check(obj) __Pyx__PyAnyDict_Check(obj, __Pyx_PyFrozenDict_TypePtr)
2830static CYTHON_INLINE
int __Pyx__PyAnyDict_Check(PyObject *obj, PyTypeObject* frozendict_type) {
2831 return PyObject_TypeCheck(obj, &PyDict_Type) || PyObject_TypeCheck(obj, frozendict_type);
2833#define __Pyx_PyAnyDict_CheckExact(obj) __Pyx__PyAnyDict_CheckExact(obj, __Pyx_PyFrozenDict_TypePtr)
2834static CYTHON_INLINE
int __Pyx__PyAnyDict_CheckExact(PyObject *obj, PyTypeObject* frozendict_type) {
2835 return Py_IS_TYPE(obj, &PyDict_Type) || Py_IS_TYPE(obj, frozendict_type);
2837#elif PY_VERSION_HEX >= 0x030f00a6 ||\
2838 (defined(PyFrozenDict_Check) && defined(PyAnyDict_Check) && defined(PyFrozenDict_New))
2839#define __Pyx_PyFrozenDict_TypePtr (&PyFrozenDict_Type)
2840#define __Pyx_PyFrozenDict_New(it) PyFrozenDict_New(it)
2841#define __Pyx_PyFrozenDict_NewEmpty() PyFrozenDict_New(NULL)
2842#define __Pyx_PyFrozenDict_Check(obj) PyFrozenDict_Check(obj)
2843#define __Pyx_PyFrozenDict_CheckExact(obj) PyFrozenDict_CheckExact(obj)
2844#define __Pyx_PyAnyDict_Check(obj) PyAnyDict_Check(obj)
2845#define __Pyx_PyAnyDict_CheckExact(obj) PyAnyDict_CheckExact(obj)
2847#define __Pyx_PyFrozenDict_TypePtr (&PyDict_Type)
2848static CYTHON_INLINE PyObject* __Pyx_PyFrozenDict_New(PyObject* it) {
2850 return PyDict_New();
2851 }
else if (PyDict_Check(it)) {
2852 return PyDict_Copy(it);
2854 PyObject *dict = PyDict_New();
2855 if (!dict)
return NULL;
2856 PyObject *result = PyNumber_InPlaceOr(dict, it);
2861#define __Pyx_PyFrozenDict_NewEmpty() PyDict_New()
2862#define __Pyx_PyFrozenDict_Check(obj) PyDict_Check(obj)
2863#define __Pyx_PyFrozenDict_CheckExact(obj) PyDict_CheckExact(obj)
2864#define __Pyx_PyAnyDict_Check(obj) PyDict_Check(obj)
2865#define __Pyx_PyAnyDict_CheckExact(obj) PyDict_CheckExact(obj)
2869#define __Pyx_GetItemInt(o, i, type, is_signed, to_py_func, wraparound, boundscheck, has_gil, unsafe_shared)\
2870 (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\
2871 __Pyx_GetItemInt_Fast(o, (Py_ssize_t)i, wraparound, boundscheck, unsafe_shared) :\
2872 __Pyx_GetItemInt_Generic(o, to_py_func(i)))
2873#define __Pyx_GetItemInt_List(o, i, type, is_signed, to_py_func, wraparound, boundscheck, has_gil, unsafe_shared)\
2874 (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\
2875 __Pyx_GetItemInt_List_Fast(o, (Py_ssize_t)i, wraparound, boundscheck, unsafe_shared) :\
2876 (PyErr_SetString(PyExc_IndexError, "list index out of range"), (PyObject*)NULL))
2877static CYTHON_INLINE PyObject *__Pyx_GetItemInt_List_Fast(PyObject *o, Py_ssize_t i,
2878 int wraparound,
int boundscheck,
int unsafe_shared);
2879#define __Pyx_GetItemInt_Tuple(o, i, type, is_signed, to_py_func, wraparound, boundscheck, has_gil, unsafe_shared)\
2880 (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\
2881 __Pyx_GetItemInt_Tuple_Fast(o, (Py_ssize_t)i, wraparound, boundscheck, unsafe_shared) :\
2882 (PyErr_SetString(PyExc_IndexError, "tuple index out of range"), (PyObject*)NULL))
2883static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize_t i,
2884 int wraparound,
int boundscheck,
int unsafe_shared);
2885static PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j);
2886static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i,
2887 int wraparound,
int boundscheck,
int unsafe_shared);
2890#define __Pyx_RaiseTypeErrorWithObjectType(message, obj) __Pyx_RaiseErrorWithObjectType(PyExc_TypeError, message, obj)
2891#define __Pyx_RaiseErrorWithObjectType(exc_type, message, obj) __Pyx_RaiseErrorWithType(exc_type, message, Py_TYPE(obj))
2893static void __Pyx_RaiseErrorWithType(PyObject* exc_type,
const char* message, PyTypeObject *type_obj);
2896#if CYTHON_USE_TYPE_SLOTS
2897static CYTHON_INLINE PyObject *__Pyx_PyObject_GetItem(PyObject *obj, PyObject *key);
2899#define __Pyx_PyObject_GetItem(obj, key) PyObject_GetItem(obj, key)
2903static void __Pyx_RejectKeywords(
const char* function_name, PyObject *kwds);
2906#define __Pyx_PyExc_TypeError_Check(obj) __Pyx_TypeCheck(obj, PyExc_TypeError)
2909static CYTHON_INLINE Py_ssize_t __Pyx_div_Py_ssize_t(Py_ssize_t, Py_ssize_t,
int b_is_constant);
2912#define __Pyx_UNARY_NEG_WOULD_OVERFLOW(x)\
2913 (((x) < 0) & ((unsigned long)(x) == 0-(unsigned long)(x)))
2916static CYTHON_INLINE PyObject *__Pyx_GetAttr3(PyObject *, PyObject *, PyObject *);
2919#if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_TYPE_SLOTS
2920#define __PYX_DICT_VERSION_INIT ((PY_UINT64_T) -1)
2921#define __PYX_GET_DICT_VERSION(dict) (((PyDictObject*)(dict))->ma_version_tag)
2922#define __PYX_UPDATE_DICT_CACHE(dict, value, cache_var, version_var)\
2923 (version_var) = __PYX_GET_DICT_VERSION(dict);\
2924 (cache_var) = (value);
2925#define __PYX_PY_DICT_LOOKUP_IF_MODIFIED(VAR, DICT, LOOKUP) {\
2926 static PY_UINT64_T __pyx_dict_version = 0;\
2927 static PyObject *__pyx_dict_cached_value = NULL;\
2928 if (likely(__PYX_GET_DICT_VERSION(DICT) == __pyx_dict_version)) {\
2929 (VAR) = __Pyx_XNewRef(__pyx_dict_cached_value);\
2931 (VAR) = __pyx_dict_cached_value = (LOOKUP);\
2932 __pyx_dict_version = __PYX_GET_DICT_VERSION(DICT);\
2935static CYTHON_INLINE PY_UINT64_T __Pyx_get_tp_dict_version(PyObject *obj);
2936static CYTHON_INLINE PY_UINT64_T __Pyx_get_object_dict_version(PyObject *obj);
2937static CYTHON_INLINE
int __Pyx_object_dict_version_matches(PyObject* obj, PY_UINT64_T tp_dict_version, PY_UINT64_T obj_dict_version);
2939#define __PYX_GET_DICT_VERSION(dict) (0)
2940#define __PYX_UPDATE_DICT_CACHE(dict, value, cache_var, version_var)
2941#define __PYX_PY_DICT_LOOKUP_IF_MODIFIED(VAR, DICT, LOOKUP) (VAR) = (LOOKUP);
2945#if CYTHON_USE_DICT_VERSIONS
2946#define __Pyx_GetModuleGlobalName(var, name) do {\
2947 static PY_UINT64_T __pyx_dict_version = 0;\
2948 static PyObject *__pyx_dict_cached_value = NULL;\
2949 (var) = (likely(__pyx_dict_version == __PYX_GET_DICT_VERSION(__pyx_mstate_global->__pyx_d))) ?\
2950 (likely(__pyx_dict_cached_value) ? __Pyx_NewRef(__pyx_dict_cached_value) : __Pyx_GetBuiltinName(name)) :\
2951 __Pyx__GetModuleGlobalName(name, &__pyx_dict_version, &__pyx_dict_cached_value);\
2953#define __Pyx_GetModuleGlobalNameUncached(var, name) do {\
2954 PY_UINT64_T __pyx_dict_version;\
2955 PyObject *__pyx_dict_cached_value;\
2956 (var) = __Pyx__GetModuleGlobalName(name, &__pyx_dict_version, &__pyx_dict_cached_value);\
2958static PyObject *__Pyx__GetModuleGlobalName(PyObject *name, PY_UINT64_T *dict_version, PyObject **dict_cached_value);
2960#define __Pyx_GetModuleGlobalName(var, name) (var) = __Pyx__GetModuleGlobalName(name)
2961#define __Pyx_GetModuleGlobalNameUncached(var, name) (var) = __Pyx__GetModuleGlobalName(name)
2962static CYTHON_INLINE PyObject *__Pyx__GetModuleGlobalName(PyObject *name);
2966#if CYTHON_COMPILING_IN_LIMITED_API || PY_VERSION_HEX >= 0x030C0000
2967 static int __pyx_assertions_enabled_flag;
2968 #define __pyx_assertions_enabled() (__pyx_assertions_enabled_flag)
2969 #if __clang__ || __GNUC__
2970 __attribute__((no_sanitize(
"thread")))
2972 static int __Pyx_init_assertions_enabled(
void) {
2973 PyObject *builtins, *debug, *debug_str;
2975 builtins = PyEval_GetBuiltins();
2976 if (!builtins)
goto bad;
2977 debug_str = PyUnicode_FromStringAndSize(
"__debug__", 9);
2978 if (!debug_str)
goto bad;
2979 debug = PyObject_GetItem(builtins, debug_str);
2980 Py_DECREF(debug_str);
2981 if (!debug)
goto bad;
2982 flag = PyObject_IsTrue(debug);
2984 if (flag == -1)
goto bad;
2985 __pyx_assertions_enabled_flag = flag;
2988 __pyx_assertions_enabled_flag = 1;
2992 #define __Pyx_init_assertions_enabled() (0)
2993 #define __pyx_assertions_enabled() (!Py_OptimizeFlag)
2997#define __Pyx_PyExc_AssertionError_Check(obj) __Pyx_TypeCheck(obj, PyExc_AssertionError)
3000static CYTHON_INLINE
void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected);
3003static CYTHON_INLINE
void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index);
3006static CYTHON_INLINE
void __Pyx_RaiseNoneNotIterableError(
void);
3009#if CYTHON_USE_EXC_INFO_STACK && CYTHON_FAST_THREAD_STATE
3010static _PyErr_StackItem * __Pyx_PyErr_GetTopmostException(PyThreadState *tstate);
3014#if CYTHON_FAST_THREAD_STATE
3015#define __Pyx_ExceptionSave(type, value, tb) __Pyx__ExceptionSave(__pyx_tstate, type, value, tb)
3016static CYTHON_INLINE
void __Pyx__ExceptionSave(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb);
3017#define __Pyx_ExceptionReset(type, value, tb) __Pyx__ExceptionReset(__pyx_tstate, type, value, tb)
3018static CYTHON_INLINE
void __Pyx__ExceptionReset(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb);
3020#define __Pyx_ExceptionSave(type, value, tb) PyErr_GetExcInfo(type, value, tb)
3021#define __Pyx_ExceptionReset(type, value, tb) PyErr_SetExcInfo(type, value, tb)
3025#define __Pyx_RaiseErrorWithObjectTypes1(exc_type, message, arg, obj1, obj2) __Pyx_RaiseErrorWithTypes1(exc_type, message, arg, Py_TYPE(obj1), Py_TYPE(obj2))
3026#define __Pyx_RaiseTypeErrorWithObjectTypes(message, obj1, obj2) __Pyx_RaiseTypeErrorWithTypes(message, Py_TYPE(obj1), Py_TYPE(obj2))
3027#define __Pyx_RaiseTypeErrorWithTypes(message, type_obj1, type_obj2) __Pyx_RaiseErrorWithTypes1(PyExc_TypeError, "%.1s" message, "", type_obj1, type_obj2)
3029static void __Pyx_RaiseErrorWithTypes1(PyObject* exc_type,
const char *message,
const char *arg, PyTypeObject *type_obj1, PyTypeObject *type_obj2);
3032static CYTHON_INLINE
int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type);
3035#if CYTHON_FAST_THREAD_STATE
3036#define __Pyx_GetException(type, value, tb) __Pyx__GetException(__pyx_tstate, type, value, tb)
3037static int __Pyx__GetException(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb);
3039static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb);
3043#if CYTHON_FAST_THREAD_STATE
3044#define __Pyx_ExceptionSwap(type, value, tb) __Pyx__ExceptionSwap(__pyx_tstate, type, value, tb)
3045static CYTHON_INLINE
void __Pyx__ExceptionSwap(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb);
3047static CYTHON_INLINE
void __Pyx_ExceptionSwap(PyObject **type, PyObject **value, PyObject **tb);
3051#if __PYX_LIMITED_VERSION_HEX >= 0x030d0000
3052#define __Pyx_HasAttr(o, n) PyObject_HasAttrWithError(o, n)
3054static CYTHON_INLINE
int __Pyx_HasAttr(PyObject *, PyObject *);
3058CYTHON_UNUSED
static PyObject *
3059__Pyx_PyList_FromArray(PyObject *
const *src, Py_ssize_t
n);
3065static PyObject *__Pyx__Import(PyObject *name, PyObject *
const *imported_names, Py_ssize_t len_imported_names, PyObject *qualname, PyObject *moddict,
int level);
3068static CYTHON_INLINE PyObject *__Pyx_Import(PyObject *name, PyObject *
const *imported_names, Py_ssize_t len_imported_names, PyObject *qualname,
int level);
3070CYTHON_UNUSED
static int __pyx_memoryview_getbuffer(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info,
int __pyx_v_flags);
3072static CYTHON_INLINE
int __Pyx_ListComp_AppendAndDecref(PyObject* list, PyObject* x);
3075#define __Pyx_PySequence_Multiply_Left(mul, seq) __Pyx_PySequence_Multiply(seq, mul)
3076#if !CYTHON_USE_TYPE_SLOTS
3077#define __Pyx_PySequence_Multiply PySequence_Repeat
3079static CYTHON_INLINE PyObject* __Pyx_PySequence_Multiply(PyObject *seq, Py_ssize_t mul);
3083#if CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_GRAAL || CYTHON_COMPILING_IN_LIMITED_API
3084#define __Pyx_PyNumber_Multiply_object_int(op1, op2) PyNumber_Multiply(op1, op2)
3085#define __Pyx_PyNumber_InPlaceMultiply_object_int(op1, op2) PyNumber_InPlaceMultiply(op1, op2)
3087#define __Pyx_PyNumber_Multiply_object_int(op1, op2) __Pyx__PyNumber_Multiply_object_int(op1, op2, 0)
3088#define __Pyx_PyNumber_InPlaceMultiply_object_int(op1, op2) __Pyx__PyNumber_Multiply_object_int(op1, op2, 1)
3089static CYTHON_INLINE PyObject* __Pyx__PyNumber_Multiply_object_int(PyObject *op1, PyObject *op2,
int inplace);
3093static CYTHON_INLINE PyObject* __Pyx_PyObject_FormatSimpleAndDecref(PyObject*
s, PyObject*
f);
3094static CYTHON_INLINE PyObject* __Pyx_PyObject_FormatAndDecref(PyObject*
s, PyObject*
f);
3097#if CYTHON_USE_UNICODE_WRITER
3098static PyObject* __Pyx_PyObject_Format(PyObject*
s, PyObject*
f);
3100#define __Pyx_PyObject_Format(s, f) PyObject_Format(s, f)
3104#define __Pyx_PyObject_Unicode(obj)\
3105 (likely(PyUnicode_CheckExact(obj)) ? __Pyx_NewRef(obj) : PyObject_Str(obj))
3108#define __Pyx_SetItemInt(o, i, v, type, is_signed, to_py_func, wraparound, boundscheck, has_gil, unsafe_shared)\
3109 (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\
3110 __Pyx_SetItemInt_Fast(o, (Py_ssize_t)i, v, wraparound, boundscheck, unsafe_shared) :\
3111 __Pyx_SetItemInt_Generic(o, to_py_func(i), v))
3112static int __Pyx_SetItemInt_Generic(PyObject *o, PyObject *j, PyObject *
v);
3113static CYTHON_INLINE
int __Pyx_SetItemInt_Fast(PyObject *o, Py_ssize_t i, PyObject *
v,
3114 int wraparound,
int boundscheck,
int unsafe_shared);
3117static void __Pyx_RaiseUnboundLocalError(
const char *varname);
3120static CYTHON_INLINE
long __Pyx_div_long(
long,
long,
int b_is_constant);
3123#define __Pyx_PyExc_Exception_Check(obj) __Pyx_TypeCheck(obj, PyExc_Exception)
3126#define __Pyx_PyExc_ImportError_Check(obj) __Pyx_TypeCheck(obj, PyExc_ImportError)
3129#if CYTHON_COMPILING_IN_LIMITED_API && __PYX_LIMITED_VERSION_HEX < 0x030d0000
3130#define __Pyx_PyObject_DelAttr(o, n) PyObject_SetAttr(o, n, NULL)
3132#define __Pyx_PyObject_DelAttr(o, n) PyObject_DelAttr(o, n)
3136#if CYTHON_USE_TYPE_SLOTS
3137#define __Pyx_PyObject_DelAttrStr(o,n) __Pyx_PyObject_SetAttrStr(o, n, NULL)
3138static CYTHON_INLINE
int __Pyx_PyObject_SetAttrStr(PyObject* obj, PyObject* attr_name, PyObject* value);
3140#define __Pyx_PyObject_DelAttrStr(o,n) __Pyx_PyObject_DelAttr(o,n)
3141#define __Pyx_PyObject_SetAttrStr(o,n,v) PyObject_SetAttr(o,n,v)
3145#if CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
3146#define __Pyx_PyObject_LookupSpecialNoError(obj, attr_name) __Pyx__PyObject_LookupSpecial(obj, attr_name, 0)
3147#define __Pyx_PyObject_LookupSpecial(obj, attr_name) __Pyx__PyObject_LookupSpecial(obj, attr_name, 1)
3148static CYTHON_INLINE PyObject* __Pyx__PyObject_LookupSpecial(PyObject* obj, PyObject* attr_name,
int with_error);
3150#define __Pyx_PyObject_LookupSpecialNoError(o,n) __Pyx_PyObject_GetAttrStrNoError(o,n)
3151#define __Pyx_PyObject_LookupSpecial(o,n) __Pyx_PyObject_GetAttrStr(o,n)
3155#if CYTHON_COMPILING_IN_PYPY && !defined(PyRange_Check)
3156 #define PyRange_Check(obj) __Pyx_TypeCheck((obj), &PyRange_Type)
3160#if !CYTHON_COMPILING_IN_PYPY
3161static CYTHON_INLINE PyObject* __Pyx_PyLong_AddObjC(PyObject *op1, PyObject *op2,
long intval,
int inplace,
int zerodivision_check);
3163#define __Pyx_PyLong_AddObjC(op1, op2, intval, inplace, zerodivision_check)\
3164 (inplace ? PyNumber_InPlaceAdd(op1, op2) : PyNumber_Add(op1, op2))
3168#if CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_GRAAL || CYTHON_COMPILING_IN_LIMITED_API
3169#define __Pyx_PyNumber_Add_object_object(op1, op2) PyNumber_Add(op1, op2)
3170#define __Pyx_PyNumber_InPlaceAdd_object_object(op1, op2) PyNumber_InPlaceAdd(op1, op2)
3172#define __Pyx_PyNumber_Add_object_object(op1, op2) __Pyx__PyNumber_Add_object_object(op1, op2, 0)
3173#define __Pyx_PyNumber_InPlaceAdd_object_object(op1, op2) __Pyx__PyNumber_Add_object_object(op1, op2, 1)
3174static CYTHON_INLINE PyObject* __Pyx__PyNumber_Add_object_object(PyObject *op1, PyObject *op2,
int inplace);
3178static CYTHON_INLINE
int __Pyx_PyObject_CompareBoolGe_object_int(PyObject *op1, PyObject *op2,
int pyop);
3181static CYTHON_INLINE
int __Pyx_PyObject_CompareBoolLe_object_object(PyObject *op1, PyObject *op2,
int pyop);
3184static CYTHON_INLINE
int __Pyx_PyObject_CompareBoolGt_object_object(PyObject *op1, PyObject *op2,
int pyop);
3187#if CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_GRAAL || CYTHON_COMPILING_IN_LIMITED_API
3188#define __Pyx_PyNumber_Subtract_object_object(op1, op2) PyNumber_Subtract(op1, op2)
3189#define __Pyx_PyNumber_InPlaceSubtract_object_object(op1, op2) PyNumber_InPlaceSubtract(op1, op2)
3191#define __Pyx_PyNumber_Subtract_object_object(op1, op2) __Pyx__PyNumber_Subtract_object_object(op1, op2, 0)
3192#define __Pyx_PyNumber_InPlaceSubtract_object_object(op1, op2) __Pyx__PyNumber_Subtract_object_object(op1, op2, 1)
3193static CYTHON_INLINE PyObject* __Pyx__PyNumber_Subtract_object_object(PyObject *op1, PyObject *op2,
int inplace);
3197static CYTHON_INLINE PyObject* __Pyx_PyObject_GetSlice(
3198 PyObject* obj, Py_ssize_t cstart, Py_ssize_t cstop,
3199 PyObject** py_start, PyObject** py_stop, PyObject** py_slice,
3200 int has_cstart,
int has_cstop,
int wraparound);
3203static void __Pyx_PyBuiltin_Invalid(PyObject *obj,
const char *builtin_type_name,
const char *argname);
3206static CYTHON_INLINE
int __Pyx_PyInt_FromNumber(PyObject **number_var,
const char *argname,
int accept_none);
3209static PyObject *__Pyx_AllocateExtensionType(PyTypeObject *t,
int is_final);
3212#if CYTHON_VECTORCALL_TPNEW
3213typedef PyObject * (*__Pyx_tpnewvectorcallfunc)(PyTypeObject* o, PyObject *
const *args, Py_ssize_t nargs, PyObject *kwnames);
3214static PyObject * __Pyx_CallTpnewAsVectorcall(__Pyx_tpnewvectorcallfunc
f, PyTypeObject* o, PyObject *a, PyObject *k);
3218#if CYTHON_VECTORCALL_TPNEW
3219static PyObject *__Pyx_CallNewInitFromVectorcall(PyTypeObject *t, PyObject *
const *args,
size_t nargsf, PyObject *kwnames);
3223#if CYTHON_VECTORCALL_TPNEW
3224typedef int (*__Pyx_tpinitvectorcallfunc)(PyObject* o, PyObject *
const *args, Py_ssize_t nargs, PyObject *kwnames);
3225static int __Pyx_CallTpinitAsVectorcall(__Pyx_tpinitvectorcallfunc
f, PyObject* o, PyObject *a, PyObject *k);
3229#if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING
3230#define __Pyx_DeallocKeepAliveBegin(o) do {\
3231 _Py_atomic_store_uintptr_relaxed(&(o)->ob_tid, _Py_ThreadId());\
3232 _Py_atomic_store_uint32_relaxed(&(o)->ob_ref_local, 1);\
3233 _Py_atomic_store_ssize_relaxed(&(o)->ob_ref_shared, 0);\
3235#define __Pyx_DeallocKeepAliveEnd(o)\
3236 _Py_atomic_store_uint32_relaxed(&(o)->ob_ref_local, 0)
3238#define __Pyx_DeallocKeepAliveBegin(o) Py_SET_REFCNT(o, Py_REFCNT(o) + 1)
3239#define __Pyx_DeallocKeepAliveEnd(o) Py_SET_REFCNT(o, Py_REFCNT(o) - 1)
3243#if !CYTHON_USE_TYPE_SPECS
3244#define __Pyx_call_type_traverse(o, always_call, visit, arg) 0
3246static int __Pyx_call_type_traverse(PyObject *o,
int always_call, visitproc visit,
void *arg);
3250static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethod0(PyObject* obj, PyObject* method_name);
3253#if !CYTHON_USE_TYPE_SLOTS
3254CYTHON_UNUSED
static Py_ssize_t __Pyx_GetTypeDictOffset(PyObject *tp,
int require_cython_valid_result);
3258#if CYTHON_COMPILING_IN_CPYTHON || CYTHON_COMPILING_IN_LIMITED_API || CYTHON_USE_TYPE_SPECS
3259static int __Pyx_validate_bases_tuple(
const char *type_name,
int has_dictoffset, PyObject *bases);
3263CYTHON_UNUSED
static int __Pyx_PyType_Ready(PyTypeObject *t);
3266#if CYTHON_COMPILING_IN_LIMITED_API
3267static PyObject *__Pyx_GetTypeTypeDict(PyTypeObject *tp);
3271#define __Pyx_DelItemOnTypeDict(tp, k) __Pyx__DelItemOnTypeDict((PyTypeObject*)tp, k)
3274static int __Pyx__DelItemOnTypeDict(PyTypeObject *tp, PyObject *k);
3277#define __Pyx_SetItemOnTypeDict(tp, k, v) __Pyx__SetItemOnTypeDict((PyTypeObject*)tp, k, v)
3280static int __Pyx__SetItemOnTypeDict(PyTypeObject *tp, PyObject *k, PyObject *
v);
3283static int __Pyx_setup_reduce(PyObject* type_obj);
3286static int __Pyx_GetVtable(PyTypeObject *type,
void** table);
3289static int __Pyx_MergeVtables(PyTypeObject *type);
3292static int __Pyx_SetVtable(PyTypeObject* typeptr ,
void* vtable);
3295#if CYTHON_COMPILING_IN_LIMITED_API || CYTHON_COMPILING_IN_PYPY
3296int __Pyx_ApplySequenceOrMappingFlag(PyTypeObject *tp,
int is_sequence);
3298#define __Pyx_ApplySequenceOrMappingFlag(tp, is_sequence) (0)
3302#ifndef __PYX_HAVE_RT_ImportType_proto_3_3_0
3303#define __PYX_HAVE_RT_ImportType_proto_3_3_0
3304#if defined (__STDC_VERSION__) && __STDC_VERSION__ >= 201112L
3305#include <stdalign.h>
3307#if (defined (__STDC_VERSION__) && __STDC_VERSION__ >= 201112L) || __cplusplus >= 201103L
3308#define __PYX_GET_STRUCT_ALIGNMENT_3_3_0(s) alignof(s)
3310#define __PYX_GET_STRUCT_ALIGNMENT_3_3_0(s) sizeof(void*)
3312enum __Pyx_ImportType_CheckSize_3_3_0 {
3313 __Pyx_ImportType_CheckSize_Error_3_3_0 = 0,
3314 __Pyx_ImportType_CheckSize_Warn_3_3_0 = 1,
3315 __Pyx_ImportType_CheckSize_Ignore_3_3_0 = 2
3317static 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);
3321static PyObject* __Pyx_PEP560_update_bases(PyObject *bases);
3324static PyObject *__Pyx_CalculateMetaclass(PyTypeObject *metaclass, PyObject *bases);
3327static CYTHON_INLINE PyObject *__Pyx_PyDict_SetDefault(PyObject *d, PyObject *key, PyObject *default_value);
3330#if ((CYTHON_COMPILING_IN_CPYTHON_FREETHREADING && PY_VERSION_HEX < 0x030F00a3) ||\
3331 __PYX_LIMITED_VERSION_HEX < 0x030d0000)
3332 static PyObject *__Pyx_PyImport_AddModuleRef(
const char *name);
3334 #define __Pyx_PyImport_AddModuleRef(name) PyImport_AddModuleRef(name)
3338static PyObject *__Pyx_FetchSharedCythonABIModule(
void);
3341static int __Pyx_VerifyCachedType(PyObject *cached_type,
3343 Py_ssize_t expected_basicsize);
3346static PyTypeObject* __Pyx_FetchCommonTypeFromSpec(PyTypeObject *metaclass, PyObject *module, PyType_Spec *spec, PyObject *bases);
3349static int __pyx_CommonTypesMetaclass_init(PyObject *module);
3350#define __Pyx_CommonTypesMetaclass_USED
3353#define __Pyx_CyFunction_USED
3354#if CYTHON_OPAQUE_SHARED_TYPES
3355#define __Pyx_as_CyFunctionObject(o) ((__pyx_CyFunctionObject *)PyObject_GetTypeData((o), __pyx_mstate_global->__pyx_CyFunctionType))
3357#define __Pyx_as_CyFunctionObject(o) ((__pyx_CyFunctionObject *)o)
3359#define __Pyx_CYFUNCTION_STATICMETHOD 0x01
3360#define __Pyx_CYFUNCTION_CLASSMETHOD 0x02
3361#define __Pyx_CYFUNCTION_CCLASS 0x04
3362#define __Pyx_CYFUNCTION_COROUTINE 0x08
3363#define __Pyx_CyFunction_GetClosure(f)\
3364 ((__Pyx_as_CyFunctionObject(f))->func_closure)
3365#if CYTHON_COMPILING_IN_LIMITED_API
3366 #define __Pyx__CyFunction_GetClassObj(f)\
3367 ((f)->func_classobj)
3369 #define __Pyx__CyFunction_GetClassObj(f)\
3370 ((PyObject*) ((PyCMethodObject *) (f))->mm_class)
3372#define __Pyx_CyFunction_GetClassObj(f)\
3373 __Pyx__CyFunction_GetClassObj(__Pyx_as_CyFunctionObject(f))
3374#define __Pyx_CyFunction_SetClassObj(f, classobj)\
3375 __Pyx__CyFunction_SetClassObj(__Pyx_as_CyFunctionObject(f), (classobj))
3376#define __Pyx_CyFunction_Defaults(type, f)\
3377 ((type *)((__Pyx_as_CyFunctionObject(f))->defaults))
3378#define __Pyx_CyFunction_SetDefaultsGetter(f, g)\
3379 (__Pyx_as_CyFunctionObject(f))->defaults_getter = (g)
3381#if CYTHON_COMPILING_IN_LIMITED_API
3382#if !CYTHON_OPAQUE_OBJECTS
3385 PyMethodDef *func_methoddef;
3386 PyObject *func_module;
3388 PyCMethodObject func;
3390#if (CYTHON_COMPILING_IN_LIMITED_API || CYTHON_COMPILING_IN_PYPY) && CYTHON_VECTORCALL
3391 __pyx_vectorcallfunc func_vectorcall;
3393#if CYTHON_COMPILING_IN_LIMITED_API
3394 PyObject *func_weakreflist;
3396#if PY_VERSION_HEX < 0x030C0000 || CYTHON_COMPILING_IN_LIMITED_API
3397 PyObject *func_dict;
3399 PyObject *func_name;
3400 PyObject *func_qualname;
3402 PyObject *func_globals;
3403 PyObject *func_code;
3404 PyObject *func_closure;
3405#if CYTHON_COMPILING_IN_LIMITED_API
3406 PyObject *func_classobj;
3410 PyObject *defaults_tuple;
3411 PyObject *defaults_kwdict;
3412 PyObject *(*defaults_getter)(PyObject *);
3413 PyObject *func_annotations;
3414#if __PYX_LIMITED_VERSION_HEX < 0x030B0000
3415 PyObject *func_is_coroutine;
3417} __pyx_CyFunctionObject;
3418#undef __Pyx_CyOrPyCFunction_Check
3419#define __Pyx_CyFunction_Check(obj) __Pyx_TypeCheck(obj, __pyx_mstate_global->__pyx_CyFunctionType)
3420#define __Pyx_CyOrPyCFunction_Check(obj) __Pyx_TypeCheck2(obj, __pyx_mstate_global->__pyx_CyFunctionType, &PyCFunction_Type)
3421#define __Pyx_CyFunction_CheckExact(obj) Py_IS_TYPE(obj, __pyx_mstate_global->__pyx_CyFunctionType)
3422static CYTHON_INLINE
int __Pyx__IsSameCyOrCFunction(PyObject *func,
void (*cfunc)(
void));
3423#undef __Pyx_IsSameCFunction
3424#define __Pyx_IsSameCFunction(func, cfunc) __Pyx__IsSameCyOrCFunction(func, cfunc)
3425static CYTHON_INLINE
void __Pyx__CyFunction_SetClassObj(__pyx_CyFunctionObject*
f, PyObject* classobj);
3426static CYTHON_INLINE PyObject *__Pyx_CyFunction_InitDefaults(PyObject *func,
3427 PyTypeObject *defaults_type);
3428static CYTHON_INLINE
void __Pyx_CyFunction_SetDefaultsTuple(PyObject *m,
3430static CYTHON_INLINE
void __Pyx_CyFunction_SetDefaultsKwDict(PyObject *m,
3432static CYTHON_INLINE
void __Pyx_CyFunction_SetAnnotationsDict(PyObject *m,
3434static int __pyx_CyFunction_init(PyObject *module);
3435#if CYTHON_VECTORCALL
3436#if CYTHON_COMPILING_IN_LIMITED_API || CYTHON_COMPILING_IN_PYPY
3437#define __Pyx_CyFunction_func_vectorcall(f) ((f)->func_vectorcall)
3439#define __Pyx_CyFunction_func_vectorcall(f) (((PyCFunctionObject*)f)->vectorcall)
3444static PyObject *__Pyx_PyMethod_New(PyObject *func, PyObject *self, PyObject *typ);
3447#if CYTHON_VECTORCALL
3448static CYTHON_INLINE PyObject *__Pyx_PyVectorcall_FastCallDict(PyObject *func, __pyx_vectorcallfunc vc, PyObject *
const *args,
size_t nargs, PyObject *kw);
3452static PyObject *__Pyx_CyFunction_Init(PyObject *op_in, PyMethodDef *ml,
3453 int flags, PyObject* qualname,
3455 PyObject *module, PyObject *globals,
3457#if CYTHON_VECTORCALL
3458static PyObject * __Pyx_CyFunction_Vectorcall_NOARGS(PyObject *func, PyObject *
const *args,
size_t nargsf, PyObject *kwnames);
3459static PyObject * __Pyx_CyFunction_Vectorcall_O(PyObject *func, PyObject *
const *args,
size_t nargsf, PyObject *kwnames);
3460static PyObject * __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS(PyObject *func, PyObject *
const *args,
size_t nargsf, PyObject *kwnames);
3461static PyObject * __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS_METHOD(PyObject *func, PyObject *
const *args,
size_t nargsf, PyObject *kwnames);
3465static PyObject *__Pyx_CyFunction_New(PyMethodDef *ml,
3466 int flags, PyObject* qualname,
3468 PyObject *module, PyObject *globals,
3470static PyTypeObject *__Pyx_Get_CyFunction_Type(
void);
3473#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030d0000
3474#define __Pyx_SetNameInClass(ns, name, value)\
3475 (likely(PyDict_CheckExact(ns)) ? _PyDict_SetItem_KnownHash(ns, name, value, ((PyASCIIObject *) name)->hash) : PyObject_SetItem(ns, name, value))
3476#elif CYTHON_COMPILING_IN_CPYTHON
3477#define __Pyx_SetNameInClass(ns, name, value)\
3478 (likely(PyDict_CheckExact(ns)) ? PyDict_SetItem(ns, name, value) : PyObject_SetItem(ns, name, value))
3480#define __Pyx_SetNameInClass(ns, name, value) PyObject_SetItem(ns, name, value)
3484static CYTHON_INLINE PyObject* __Pyx_PyObject_Call2Args(PyObject* function, PyObject* arg1, PyObject* arg2);
3487static PyObject *__Pyx_Py3MetaclassPrepare(PyObject *metaclass, PyObject *bases, PyObject *name, PyObject *qualname,
3488 PyObject *mkw, PyObject *modname, PyObject *doc);
3489static PyObject *__Pyx_Py3ClassCreate(PyObject *metaclass, PyObject *name, PyObject *bases, PyObject *dict,
3490 PyObject *mkw,
int calculate_metaclass,
int allow_py2_metaclass);
3493#if CYTHON_CLINE_IN_TRACEBACK && CYTHON_CLINE_IN_TRACEBACK_RUNTIME
3494static int __Pyx_CLineForTraceback(PyThreadState *tstate,
int c_line);
3496#define __Pyx_CLineForTraceback(tstate, c_line) (((CYTHON_CLINE_IN_TRACEBACK)) ? c_line : 0)
3500#if CYTHON_COMPILING_IN_LIMITED_API
3501typedef PyObject __Pyx_CachedCodeObjectType;
3503typedef PyCodeObject __Pyx_CachedCodeObjectType;
3506 __Pyx_CachedCodeObjectType* code_object;
3508} __Pyx_CodeObjectCacheEntry;
3509struct __Pyx_CodeObjectCache {
3512 __Pyx_CodeObjectCacheEntry* entries;
3513 #if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING
3514 __pyx_atomic_int_type accessor_count;
3517static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries,
int count,
int code_line);
3518static __Pyx_CachedCodeObjectType *__pyx_find_code_object(
int code_line);
3519static void __pyx_insert_code_object(
int code_line, __Pyx_CachedCodeObjectType* code_object);
3522static void __Pyx_AddTraceback(
const char *funcname,
int c_line,
3523 int py_line,
const char *filename);
3527 Py_ssize_t shape, strides, suboffsets;
3534 __Pyx_Buffer *rcbuffer;
3536 __Pyx_Buf_DimInfo diminfo[8];
3540static CYTHON_INLINE
int __pyx_add_acquisition_count_locked(
3541 __pyx_atomic_int_type *acquisition_count, PyThread_type_lock lock);
3542static CYTHON_INLINE
int __pyx_sub_acquisition_count_locked(
3543 __pyx_atomic_int_type *acquisition_count, PyThread_type_lock lock);
3544#define __pyx_get_slice_count_pointer(memview) (&memview->acquisition_count)
3545#define __PYX_INC_MEMVIEW(slice, have_gil) __Pyx_INC_MEMVIEW(slice, have_gil, __LINE__)
3546#define __PYX_XCLEAR_MEMVIEW(slice, have_gil) __Pyx_XCLEAR_MEMVIEW(slice, have_gil, __LINE__)
3547static CYTHON_INLINE
void __Pyx_INC_MEMVIEW(__Pyx_memviewslice *,
int,
int);
3548static CYTHON_INLINE
void __Pyx_XCLEAR_MEMVIEW(__Pyx_memviewslice *,
int,
int);
3551static int __pyx_memviewslice_is_contig(
const __Pyx_memviewslice mvs,
char order,
int ndim);
3554static int __pyx_slices_overlap(__Pyx_memviewslice *slice1,
3555 __Pyx_memviewslice *slice2,
3556 int ndim,
size_t itemsize);
3559static int __Pyx_init_memviewslice(
3560 struct __pyx_memoryview_obj *memview,
3562 __Pyx_memviewslice *memviewslice,
3563 int memview_is_new_reference);
3566static CYTHON_INLINE
int __pyx_memoryview_slice_memviewslice(
3567 __Pyx_memviewslice *dst,
3568 Py_ssize_t shape, Py_ssize_t stride, Py_ssize_t suboffset,
3569 int dim,
int new_ndim,
int *suboffset_dim,
3570 Py_ssize_t start, Py_ssize_t stop, Py_ssize_t step,
3571 int have_start,
int have_stop,
int have_step,
3575static CYTHON_INLINE
int __Pyx_Is_Little_Endian(
void);
3578static const char* __Pyx_BufFmt_CheckString(__Pyx_BufFmt_Context* ctx,
const char* ts);
3579static void __Pyx_BufFmt_Init(__Pyx_BufFmt_Context* ctx,
3580 __Pyx_BufFmt_StackElem* stack,
3581 const __Pyx_TypeInfo* type);
3584static int __pyx_typeinfo_cmp(
const __Pyx_TypeInfo *a,
const __Pyx_TypeInfo *b);
3587static int __Pyx_ValidateAndInit_memviewslice(
3592 const __Pyx_TypeInfo *dtype,
3593 __Pyx_BufFmt_StackElem stack[],
3594 __Pyx_memviewslice *memviewslice,
3595 PyObject *original_obj);
3598static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_float64_t(PyObject *,
int writable_flag);
3601static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_int32_t(PyObject *,
int writable_flag);
3606 #define __Pyx_CREAL(z) ((z).real())
3607 #define __Pyx_CIMAG(z) ((z).imag())
3609 #define __Pyx_CREAL(z) (__real__(z))
3610 #define __Pyx_CIMAG(z) (__imag__(z))
3613 #define __Pyx_CREAL(z) ((z).real)
3614 #define __Pyx_CIMAG(z) ((z).imag)
3616#if defined(__cplusplus) && CYTHON_CCOMPLEX\
3617 && (defined(_WIN32) || defined(__clang__) || (defined(__GNUC__) && (__GNUC__ >= 5 || __GNUC__ == 4 && __GNUC_MINOR__ >= 4 )) || __cplusplus >= 201103)
3618 #define __Pyx_SET_CREAL(z,x) ((z).real(x))
3619 #define __Pyx_SET_CIMAG(z,y) ((z).imag(y))
3621 #define __Pyx_SET_CREAL(z,x) __Pyx_CREAL(z) = (x)
3622 #define __Pyx_SET_CIMAG(z,y) __Pyx_CIMAG(z) = (y)
3626#if CYTHON_CCOMPLEX && (1) && (!0 || __cplusplus)
3627 #define __Pyx_c_eq_float(a, b) ((a)==(b))
3628 #define __Pyx_c_sum_float(a, b) ((a)+(b))
3629 #define __Pyx_c_diff_float(a, b) ((a)-(b))
3630 #define __Pyx_c_prod_float(a, b) ((a)*(b))
3631 #define __Pyx_c_quot_float(a, b) ((a)/(b))
3632 #define __Pyx_c_neg_float(a) (-(a))
3634 #define __Pyx_c_is_zero_float(z) ((z)==(float)0)
3635 #define __Pyx_c_conj_float(z) (::std::conj(z))
3637 #define __Pyx_c_abs_float(z) (::std::abs(z))
3638 #define __Pyx_c_pow_float(a, b) (::std::pow(a, b))
3641 #define __Pyx_c_is_zero_float(z) ((z)==0)
3642 #define __Pyx_c_conj_float(z) (conjf(z))
3644 #define __Pyx_c_abs_float(z) (cabsf(z))
3645 #define __Pyx_c_pow_float(a, b) (cpowf(a, b))
3649 static CYTHON_INLINE
int __Pyx_c_eq_float(__pyx_t_float_complex, __pyx_t_float_complex);
3650 static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_sum_float(__pyx_t_float_complex, __pyx_t_float_complex);
3651 static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_diff_float(__pyx_t_float_complex, __pyx_t_float_complex);
3652 static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_prod_float(__pyx_t_float_complex, __pyx_t_float_complex);
3653 static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_quot_float(__pyx_t_float_complex, __pyx_t_float_complex);
3654 static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_neg_float(__pyx_t_float_complex);
3655 static CYTHON_INLINE
int __Pyx_c_is_zero_float(__pyx_t_float_complex);
3656 static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_conj_float(__pyx_t_float_complex);
3658 static CYTHON_INLINE
float __Pyx_c_abs_float(__pyx_t_float_complex);
3659 static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_pow_float(__pyx_t_float_complex, __pyx_t_float_complex);
3664#if CYTHON_CCOMPLEX && (1) && (!0 || __cplusplus)
3665 #define __Pyx_c_eq_double(a, b) ((a)==(b))
3666 #define __Pyx_c_sum_double(a, b) ((a)+(b))
3667 #define __Pyx_c_diff_double(a, b) ((a)-(b))
3668 #define __Pyx_c_prod_double(a, b) ((a)*(b))
3669 #define __Pyx_c_quot_double(a, b) ((a)/(b))
3670 #define __Pyx_c_neg_double(a) (-(a))
3672 #define __Pyx_c_is_zero_double(z) ((z)==(double)0)
3673 #define __Pyx_c_conj_double(z) (::std::conj(z))
3675 #define __Pyx_c_abs_double(z) (::std::abs(z))
3676 #define __Pyx_c_pow_double(a, b) (::std::pow(a, b))
3679 #define __Pyx_c_is_zero_double(z) ((z)==0)
3680 #define __Pyx_c_conj_double(z) (conj(z))
3682 #define __Pyx_c_abs_double(z) (cabs(z))
3683 #define __Pyx_c_pow_double(a, b) (cpow(a, b))
3687 static CYTHON_INLINE
int __Pyx_c_eq_double(__pyx_t_double_complex, __pyx_t_double_complex);
3688 static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_sum_double(__pyx_t_double_complex, __pyx_t_double_complex);
3689 static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_diff_double(__pyx_t_double_complex, __pyx_t_double_complex);
3690 static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_prod_double(__pyx_t_double_complex, __pyx_t_double_complex);
3691 static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_quot_double(__pyx_t_double_complex, __pyx_t_double_complex);
3692 static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_neg_double(__pyx_t_double_complex);
3693 static CYTHON_INLINE
int __Pyx_c_is_zero_double(__pyx_t_double_complex);
3694 static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_conj_double(__pyx_t_double_complex);
3696 static CYTHON_INLINE
double __Pyx_c_abs_double(__pyx_t_double_complex);
3697 static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_pow_double(__pyx_t_double_complex, __pyx_t_double_complex);
3702#if CYTHON_CCOMPLEX && (1) && (!0 || __cplusplus)
3703 #define __Pyx_c_eq_long__double(a, b) ((a)==(b))
3704 #define __Pyx_c_sum_long__double(a, b) ((a)+(b))
3705 #define __Pyx_c_diff_long__double(a, b) ((a)-(b))
3706 #define __Pyx_c_prod_long__double(a, b) ((a)*(b))
3707 #define __Pyx_c_quot_long__double(a, b) ((a)/(b))
3708 #define __Pyx_c_neg_long__double(a) (-(a))
3710 #define __Pyx_c_is_zero_long__double(z) ((z)==(long double)0)
3711 #define __Pyx_c_conj_long__double(z) (::std::conj(z))
3713 #define __Pyx_c_abs_long__double(z) (::std::abs(z))
3714 #define __Pyx_c_pow_long__double(a, b) (::std::pow(a, b))
3717 #define __Pyx_c_is_zero_long__double(z) ((z)==0)
3718 #define __Pyx_c_conj_long__double(z) (conjl(z))
3720 #define __Pyx_c_abs_long__double(z) (cabsl(z))
3721 #define __Pyx_c_pow_long__double(a, b) (cpowl(a, b))
3725 static CYTHON_INLINE
int __Pyx_c_eq_long__double(__pyx_t_long_double_complex, __pyx_t_long_double_complex);
3726 static CYTHON_INLINE __pyx_t_long_double_complex __Pyx_c_sum_long__double(__pyx_t_long_double_complex, __pyx_t_long_double_complex);
3727 static CYTHON_INLINE __pyx_t_long_double_complex __Pyx_c_diff_long__double(__pyx_t_long_double_complex, __pyx_t_long_double_complex);
3728 static CYTHON_INLINE __pyx_t_long_double_complex __Pyx_c_prod_long__double(__pyx_t_long_double_complex, __pyx_t_long_double_complex);
3729 static CYTHON_INLINE __pyx_t_long_double_complex __Pyx_c_quot_long__double(__pyx_t_long_double_complex, __pyx_t_long_double_complex);
3730 static CYTHON_INLINE __pyx_t_long_double_complex __Pyx_c_neg_long__double(__pyx_t_long_double_complex);
3731 static CYTHON_INLINE
int __Pyx_c_is_zero_long__double(__pyx_t_long_double_complex);
3732 static CYTHON_INLINE __pyx_t_long_double_complex __Pyx_c_conj_long__double(__pyx_t_long_double_complex);
3734 static CYTHON_INLINE
long double __Pyx_c_abs_long__double(__pyx_t_long_double_complex);
3735 static CYTHON_INLINE __pyx_t_long_double_complex __Pyx_c_pow_long__double(__pyx_t_long_double_complex, __pyx_t_long_double_complex);
3740static __Pyx_memviewslice
3741__pyx_memoryview_copy_new_contig(
const __Pyx_memviewslice *from_mvs,
3742 const char *mode,
int ndim,
3743 Py_ssize_t sizeof_dtype,
int contig_flag,
3744 int dtype_is_object);
3747static CYTHON_INLINE
int __Pyx_PyLong_As_int(PyObject *);
3750#if CYTHON_VECTORCALL
3751#define __Pyx_Object_VectorcallKwds PyObject_Vectorcall
3752CYTHON_UNUSED
static int __Pyx_CheckVectorcallKwarg(PyObject *kwnames, Py_ssize_t i);
3754#define __Pyx_Object_VectorcallKwds __Pyx_PyObject_FastCallDict
3755CYTHON_UNUSED
static PyObject *__Pyx_MakeKwargDict(PyObject **keys, PyObject **values, Py_ssize_t
n);
3756CYTHON_UNUSED
static int __Pyx_CheckVectorcallKwarg(PyObject **kwnames, Py_ssize_t i);
3760#if CYTHON_VECTORCALL
3761#define __Pyx_Object_VectorcallMethodKwds PyObject_VectorcallMethod
3763static PyObject *__Pyx_Object_VectorcallMethodKwds(PyObject *name, PyObject *
const *args,
size_t nargsf, PyObject *kwnames);
3767static CYTHON_INLINE PyObject* __Pyx_PyLong_From_npy_int32(npy_int32 value);
3770static CYTHON_INLINE PyObject* __Pyx_PyLong_From_int(
int value);
3773static CYTHON_INLINE npy_int32 __Pyx_PyLong_As_npy_int32(PyObject *);
3776static CYTHON_INLINE
size_t __Pyx_PyLong_As_size_t(PyObject *);
3779static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethod1(PyObject* obj, PyObject* method_name, PyObject* arg);
3782static int __Pyx_UpdateUnpickledDict(PyObject *obj, PyObject *state, Py_ssize_t index);
3785static void __Pyx_RaiseUnpickleChecksumError(
long checksum,
long checksum1,
long checksum2,
long checksum3,
const char *members);
3788static CYTHON_INLINE
int __Pyx_CheckUnpickleChecksum(
long checksum,
long checksum1,
long checksum2,
long checksum3,
const char *members);
3791static CYTHON_INLINE
long __Pyx_PyLong_As_long(PyObject *);
3794static CYTHON_INLINE PyObject* __Pyx_PyLong_From_long(
long value);
3797static CYTHON_INLINE
char __Pyx_PyLong_As_char(PyObject *);
3800#if __PYX_LIMITED_VERSION_HEX < 0x030b0000
3801static unsigned long __Pyx_cached_runtime_version = 0;
3802static void __Pyx_init_runtime_version(
void);
3804#define __Pyx_init_runtime_version()
3806static unsigned long __Pyx_get_runtime_version(
void);
3809static int __Pyx_check_binary_version(
unsigned long ct_version,
unsigned long rt_version,
int allow_newer);
3812static PyObject *__Pyx_DecompressString(
const char *
s, Py_ssize_t length,
int algo);
3815static PyObject *__Pyx_DecompressString_LZSS(
const char *
s,
size_t compressed_length,
size_t uncompressed_length);
3818#if CYTHON_PEP489_MULTI_PHASE_INIT && CYTHON_USE_MODULE_STATE
3820static PyObject *__Pyx_State_FindModule(
void*);
3821static int __Pyx_State_AddModule(PyObject* module,
void*);
3822static int __Pyx_State_RemoveModule(
void*);
3823#elif CYTHON_USE_MODULE_STATE
3824#define __Pyx_State_FindModule PyState_FindModule
3825#define __Pyx_State_AddModule PyState_AddModule
3826#define __Pyx_State_RemoveModule PyState_RemoveModule
3831#if CYTHON_COMPILING_IN_LIMITED_API
3832 #if CYTHON_VECTORCALL
3833 #define __PYX_VECTORCALL_ABI_SUFFIX "_vectorcall"
3835 #define __PYX_VECTORCALL_ABI_SUFFIX
3837 #define __PYX_LIMITED_ABI_SUFFIX "limited" __PYX_VECTORCALL_ABI_SUFFIX __PYX_AM_SEND_ABI_SUFFIX
3839 #define __PYX_LIMITED_ABI_SUFFIX
3841#if __PYX_HAS_PY_AM_SEND == 1
3842 #define __PYX_AM_SEND_ABI_SUFFIX
3843#elif __PYX_HAS_PY_AM_SEND == 2
3844 #define __PYX_AM_SEND_ABI_SUFFIX "amsendbackport"
3846 #define __PYX_AM_SEND_ABI_SUFFIX "noamsend"
3848#ifndef __PYX_MONITORING_ABI_SUFFIX
3849 #define __PYX_MONITORING_ABI_SUFFIX
3851#if CYTHON_USE_TP_FINALIZE
3852 #define __PYX_TP_FINALIZE_ABI_SUFFIX
3854 #define __PYX_TP_FINALIZE_ABI_SUFFIX "nofinalize"
3856#if CYTHON_USE_FREELISTS || !defined(__Pyx_AsyncGen_USED)
3857 #define __PYX_FREELISTS_ABI_SUFFIX
3859 #define __PYX_FREELISTS_ABI_SUFFIX "nofreelists"
3861#if CYTHON_OPAQUE_OBJECTS && CYTHON_COMPILING_IN_LIMITED_API
3862 #define __PYX_OPAQUE_OBJECTS_ABI_SUFFIX "opaque"
3864 #define __PYX_OPAQUE_OBJECTS_ABI_SUFFIX
3866#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
3867#define __PYX_ABI_MODULE_NAME "_cython_" CYTHON_ABI
3868#define __PYX_TYPE_MODULE_PREFIX __PYX_ABI_MODULE_NAME "."
3870static PyObject *__pyx_array_get_memview(
struct __pyx_array_obj *__pyx_v_self);
3871static char *__pyx_memoryview_get_item_pointer(
struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index);
3872static PyObject *__pyx_memoryview_is_slice(
struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_obj);
3873static PyObject *__pyx_memoryview_setitem_slice_assignment(
struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_dst, PyObject *__pyx_v_src);
3874static PyObject *__pyx_memoryview_setitem_slice_assign_scalar(
struct __pyx_memoryview_obj *__pyx_v_self,
struct __pyx_memoryview_obj *__pyx_v_dst, PyObject *__pyx_v_value);
3875static PyObject *__pyx_memoryview_setitem_indexed(
struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_indices, PyObject *__pyx_v_value);
3876static PyObject *__pyx_memoryview_setitem_indexed1(
struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index, PyObject *__pyx_v_value);
3877static PyObject *__pyx_memoryview_convert_item_to_object(
struct __pyx_memoryview_obj *__pyx_v_self,
char *__pyx_v_itemp);
3878static PyObject *__pyx_memoryview_assign_item_from_object(
struct __pyx_memoryview_obj *__pyx_v_self,
char *__pyx_v_itemp, PyObject *__pyx_v_value);
3879static PyObject *__pyx_memoryview__get_base(
struct __pyx_memoryview_obj *__pyx_v_self);
3880static PyObject *__pyx_memoryviewslice_convert_item_to_object(
struct __pyx_memoryviewslice_obj *__pyx_v_self,
char *__pyx_v_itemp);
3881static PyObject *__pyx_memoryviewslice_assign_item_from_object(
struct __pyx_memoryviewslice_obj *__pyx_v_self,
char *__pyx_v_itemp, PyObject *__pyx_v_value);
3882static PyObject *__pyx_memoryviewslice__get_base(
struct __pyx_memoryviewslice_obj *__pyx_v_self);
3883static CYTHON_INLINE PyTypeObject *__pyx_f_5numpy_5dtype_7typeobj___get__(PyArray_Descr *__pyx_v_self);
3884static CYTHON_INLINE
char __pyx_f_5numpy_5dtype_4kind___get__(PyArray_Descr *__pyx_v_self);
3885static CYTHON_INLINE
char __pyx_f_5numpy_5dtype_4type___get__(PyArray_Descr *__pyx_v_self);
3886static CYTHON_INLINE
char __pyx_f_5numpy_5dtype_9byteorder___get__(PyArray_Descr *__pyx_v_self);
3887static CYTHON_INLINE
int __pyx_f_5numpy_5dtype_8type_num___get__(PyArray_Descr *__pyx_v_self);
3888static CYTHON_INLINE npy_intp __pyx_f_5numpy_5dtype_8itemsize___get__(PyArray_Descr *__pyx_v_self);
3889static CYTHON_INLINE npy_intp __pyx_f_5numpy_5dtype_9alignment___get__(PyArray_Descr *__pyx_v_self);
3890static CYTHON_INLINE PyObject *__pyx_f_5numpy_5dtype_6fields___get__(PyArray_Descr *__pyx_v_self);
3891static CYTHON_INLINE PyObject *__pyx_f_5numpy_5dtype_5names___get__(PyArray_Descr *__pyx_v_self);
3892static CYTHON_INLINE PyArray_ArrayDescr *__pyx_f_5numpy_5dtype_8subarray___get__(PyArray_Descr *__pyx_v_self);
3893static CYTHON_INLINE npy_uint64 __pyx_f_5numpy_5dtype_5flags___get__(PyArray_Descr *__pyx_v_self);
3894static CYTHON_INLINE
int __pyx_f_5numpy_9broadcast_7numiter___get__(PyArrayMultiIterObject *__pyx_v_self);
3895static CYTHON_INLINE npy_intp __pyx_f_5numpy_9broadcast_4size___get__(PyArrayMultiIterObject *__pyx_v_self);
3896static CYTHON_INLINE npy_intp __pyx_f_5numpy_9broadcast_5index___get__(PyArrayMultiIterObject *__pyx_v_self);
3897static CYTHON_INLINE
int __pyx_f_5numpy_9broadcast_2nd___get__(PyArrayMultiIterObject *__pyx_v_self);
3898static CYTHON_INLINE npy_intp *__pyx_f_5numpy_9broadcast_10dimensions___get__(PyArrayMultiIterObject *__pyx_v_self);
3899static CYTHON_INLINE
void **__pyx_f_5numpy_9broadcast_5iters___get__(PyArrayMultiIterObject *__pyx_v_self);
3900static CYTHON_INLINE PyObject *__pyx_f_5numpy_7ndarray_4base___get__(PyArrayObject *__pyx_v_self);
3901static CYTHON_INLINE PyArray_Descr *__pyx_f_5numpy_7ndarray_5descr___get__(PyArrayObject *__pyx_v_self);
3902static CYTHON_INLINE
int __pyx_f_5numpy_7ndarray_4ndim___get__(PyArrayObject *__pyx_v_self);
3903static CYTHON_INLINE npy_intp *__pyx_f_5numpy_7ndarray_5shape___get__(PyArrayObject *__pyx_v_self);
3904static CYTHON_INLINE npy_intp *__pyx_f_5numpy_7ndarray_7strides___get__(PyArrayObject *__pyx_v_self);
3905static CYTHON_INLINE npy_intp __pyx_f_5numpy_7ndarray_4size___get__(PyArrayObject *__pyx_v_self);
3906static CYTHON_INLINE
char *__pyx_f_5numpy_7ndarray_4data___get__(PyArrayObject *__pyx_v_self);
3907static CYTHON_INLINE
int __pyx_f_5numpy_5ufunc_3nin___get__(PyUFuncObject *__pyx_v_self);
3908static CYTHON_INLINE
int __pyx_f_5numpy_5ufunc_4nout___get__(PyUFuncObject *__pyx_v_self);
3909static CYTHON_INLINE
int __pyx_f_5numpy_5ufunc_5nargs___get__(PyUFuncObject *__pyx_v_self);
3910static CYTHON_INLINE PyUFuncGenericFunction *__pyx_f_5numpy_5ufunc_9functions___get__(PyUFuncObject *__pyx_v_self);
3911static CYTHON_INLINE
void **__pyx_f_5numpy_5ufunc_4data___get__(PyUFuncObject *__pyx_v_self);
3912static CYTHON_INLINE
int __pyx_f_5numpy_5ufunc_6ntypes___get__(PyUFuncObject *__pyx_v_self);
3913static CYTHON_INLINE
char const *__pyx_f_5numpy_5ufunc_4name___get__(PyUFuncObject *__pyx_v_self);
3914static CYTHON_INLINE
char const *__pyx_f_5numpy_5ufunc_3doc___get__(PyUFuncObject *__pyx_v_self);
3915static CYTHON_INLINE
void *__pyx_f_5numpy_5ufunc_3ptr___get__(PyUFuncObject *__pyx_v_self);
3916static CYTHON_INLINE PyObject *__pyx_f_5numpy_5ufunc_3obj___get__(PyUFuncObject *__pyx_v_self);
3917static CYTHON_INLINE PyObject *__pyx_f_5numpy_5ufunc_9userloops___get__(PyUFuncObject *__pyx_v_self);
3918static PyObject *__pyx_f_15superluWrappers_12SparseFactor__set_mat_types(
struct __pyx_obj_15superluWrappers_SparseFactor *__pyx_v_self);
3947static PyObject *__pyx_collections_abc_Sequence = 0;
3948static PyObject *
generic = 0;
3949static PyObject *strided = 0;
3950static PyObject *indirect = 0;
3951static PyObject *contiguous = 0;
3952static PyObject *indirect_contiguous = 0;
3953static int __pyx_memoryview_thread_locks_used;
3954static PyThread_type_lock __pyx_memoryview_thread_locks[8];
3955static void __pyx_f_15superluWrappers_SparseMatrix_matvec(
struct __pyx_obj_15superluWrappers_cSparseMatrix *, __Pyx_memviewslice, __Pyx_memviewslice);
3956static void __pyx_f_15superluWrappers_superluWrappersSparseFactorPrepare(
struct __pyx_obj_15superluWrappers_cSparseMatrix *,
struct __pyx_obj_15superluWrappers_SparseFactor *);
3957static void __pyx_f_15superluWrappers_superluWrappersSparseFactorSolve(
struct __pyx_obj_15superluWrappers_SparseFactor *, __Pyx_memviewslice);
3958static int __pyx_array_allocate_buffer(
struct __pyx_array_obj *);
3959static struct __pyx_array_obj *__pyx_array_new(PyObject *, Py_ssize_t,
char *,
char const *,
char *);
3960static PyObject *__pyx_memoryview_new(PyObject *,
int,
int, __Pyx_TypeInfo
const *);
3961static CYTHON_INLINE
int __pyx_memoryview_check(PyObject *);
3962static int __pyx_memoryview_err_invalid_index(PyObject *);
3963static PyObject *_unellipsify_index_tuple(PyObject *,
int);
3964static PyObject *_unellipsify(PyObject *,
int);
3965static int assert_direct_dimensions(Py_ssize_t *,
int);
3966static struct __pyx_memoryview_obj *__pyx_memview_slice(
struct __pyx_memoryview_obj *, PyObject *);
3967static char *__pyx_pybuffer_index(Py_buffer *,
char *, Py_ssize_t, Py_ssize_t);
3968static int __pyx_memslice_transpose(__Pyx_memviewslice *);
3969static PyObject *__pyx_memoryview_fromslice(__Pyx_memviewslice,
int, PyObject *(*)(
char *), __pyx_memoryview_to_dtype_func_type,
int);
3970static __Pyx_memviewslice *__pyx_memoryview_get_slice_from_memoryview(
struct __pyx_memoryview_obj *, __Pyx_memviewslice *);
3971static void __pyx_memoryview_slice_copy(
struct __pyx_memoryview_obj *, __Pyx_memviewslice *);
3972static PyObject *__pyx_memoryview_copy_object(
struct __pyx_memoryview_obj *);
3973static PyObject *__pyx_memoryview_copy_object_from_slice(
struct __pyx_memoryview_obj *, __Pyx_memviewslice *);
3974static Py_ssize_t abs_py_ssize_t(Py_ssize_t);
3975static char __pyx_get_best_slice_order(__Pyx_memviewslice *,
int);
3976static void _copy_strided_to_strided(
char *, Py_ssize_t *,
char *, Py_ssize_t *, Py_ssize_t *, Py_ssize_t *,
int,
size_t);
3977static void copy_strided_to_strided(__Pyx_memviewslice *, __Pyx_memviewslice *,
int,
size_t);
3978static size_t __pyx_memoryview_slice_get_size(__Pyx_memviewslice *,
int);
3979static Py_ssize_t __pyx_fill_contig_strides_array(Py_ssize_t *, Py_ssize_t *, Py_ssize_t,
int,
char);
3980static void *__pyx_memoryview_copy_data_to_temp(__Pyx_memviewslice *, __Pyx_memviewslice *,
char,
int);
3981static int __pyx_memoryview_err_extents(
int, Py_ssize_t, Py_ssize_t);
3982static int __pyx_memoryview_err_dim(PyObject *,
char const *,
int);
3983static int __pyx_memoryview_err(PyObject *,
char const *);
3984static int __pyx_memoryview_err_no_memory(
void);
3985static int __pyx_memoryview_err_ValueError(
char const *);
3986static int __pyx_memoryview_err_IndexError(
char const *, Py_ssize_t);
3987static int __pyx_memoryview_copy_contents(__Pyx_memviewslice, __Pyx_memviewslice,
int,
int,
int);
3988static void __pyx_memoryview_broadcast_leading(__Pyx_memviewslice *,
int,
int);
3989static void __pyx_memoryview_refcount_copying(__Pyx_memviewslice *,
int,
int,
int);
3990static void __pyx_memoryview_refcount_objects_in_slice_with_gil(
char *, Py_ssize_t *, Py_ssize_t *,
int,
int);
3991static void __pyx_memoryview_refcount_objects_in_slice(
char *, Py_ssize_t *, Py_ssize_t *,
int,
int);
3992static void __pyx_memoryview_slice_assign_scalar(__Pyx_memviewslice *,
int,
size_t,
void *,
int);
3993static void __pyx_memoryview__slice_assign_scalar(
char *, Py_ssize_t *, Py_ssize_t *,
int,
size_t,
void *);
3994static PyObject *__pyx_unpickle_Enum__set_state(
struct __pyx_MemviewEnum_obj *, PyObject *);
3996static const __Pyx_TypeInfo __Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t = {
"float64_t", NULL,
sizeof(__pyx_t_5numpy_float64_t), { 0 }, 0,
'R', 0, 0 };
3997static const __Pyx_TypeInfo __Pyx_TypeInfo_nn___pyx_t_5numpy_int32_t = {
"int32_t", NULL,
sizeof(__pyx_t_5numpy_int32_t), { 0 }, 0, __PYX_IS_UNSIGNED(__pyx_t_5numpy_int32_t) ?
'U' :
'I', __PYX_IS_UNSIGNED(__pyx_t_5numpy_int32_t), 0 };
3999#define __Pyx_MODULE_NAME "superluWrappers"
4000extern int __pyx_module_is_main_superluWrappers;
4001int __pyx_module_is_main_superluWrappers = 0;
4005static PyObject *__pyx_builtin_object;
4006static PyObject *__pyx_builtin_open;
4007static PyObject *__pyx_builtin___import__;
4008static PyObject *__pyx_builtin_enumerate;
4009static PyObject *__pyx_builtin_Ellipsis;
4010static PyObject *__pyx_builtin_id;
4012static const char __pyx_k_c[] =
"c";
4013static const char __pyx_k_name[] =
"name";
4014static const char __pyx_k_fortran[] =
"fortran";
4015static const char __pyx_k_Dimension_d_is_not_direct[] =
"Dimension %d is not direct";
4016static const char __pyx_k_Cannot_index_with_type_200U[] =
"Cannot index with type \047%.200U\047";
4017static const char __pyx_k_itemsize_0_for_cython_array[] =
"itemsize <= 0 for cython.array";
4018static const char __pyx_k_Buffer_view_does_not_expose_stri[] =
"Buffer view does not expose strides";
4019static const char __pyx_k_Can_only_create_a_buffer_that_is[] =
"Can only create a buffer that is contiguous in memory.";
4020static const char __pyx_k_Cannot_create_writable_memory_vi[] =
"Cannot create writable memory view from read-only memoryview";
4021static const char __pyx_k_Cannot_transpose_memoryview_with[] =
"Cannot transpose memoryview with indirect dimensions";
4022static const char __pyx_k_Empty_shape_tuple_for_cython_arr[] =
"Empty shape tuple for cython.array";
4023static const char __pyx_k_Indirect_dimensions_not_supporte[] =
"Indirect dimensions not supported";
4024static const char __pyx_k_Out_of_bounds_on_buffer_access_a[] =
"Out of bounds on buffer access (axis %zd)";
4025static const char __pyx_k_Unable_to_convert_item_to_object[] =
"Unable to convert item to object";
4026static const char __pyx_k_got_differing_extents_in_dimensi[] =
"got differing extents in dimension %d (got %zd and %zd)";
4028static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array___cinit__(
struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_shape, Py_ssize_t __pyx_v_itemsize, PyObject *__pyx_v_format, PyObject *__pyx_v_mode,
int __pyx_v_allocate_buffer);
4029static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array_2__getbuffer__(
struct __pyx_array_obj *__pyx_v_self, Py_buffer *__pyx_v_info,
int __pyx_v_flags);
4030static void __pyx_array___pyx_pf_15View_dot_MemoryView_5array_4__dealloc__(
struct __pyx_array_obj *__pyx_v_self);
4031static PyObject *__pyx_pf_15View_dot_MemoryView_5array_7memview___get__(
struct __pyx_array_obj *__pyx_v_self);
4032static Py_ssize_t __pyx_array___pyx_pf_15View_dot_MemoryView_5array_6__len__(
struct __pyx_array_obj *__pyx_v_self);
4033static PyObject *__pyx_array___pyx_pf_15View_dot_MemoryView_5array_8__getattr__(
struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_attr);
4034static PyObject *__pyx_array___pyx_pf_15View_dot_MemoryView_5array_10__getitem__(
struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_item);
4035static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array_12__setitem__(
struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_item, PyObject *__pyx_v_value);
4036static PyObject *__pyx_pf___pyx_array___reduce_cython__(CYTHON_UNUSED
struct __pyx_array_obj *__pyx_v_self);
4037static PyObject *__pyx_pf___pyx_array_2__setstate_cython__(CYTHON_UNUSED
struct __pyx_array_obj *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state);
4038static int __pyx_MemviewEnum___pyx_pf_15View_dot_MemoryView_4Enum___init__(
struct __pyx_MemviewEnum_obj *__pyx_v_self, PyObject *__pyx_v_name);
4039static PyObject *__pyx_MemviewEnum___pyx_pf_15View_dot_MemoryView_4Enum_2__repr__(
struct __pyx_MemviewEnum_obj *__pyx_v_self);
4040static PyObject *__pyx_pf___pyx_MemviewEnum___reduce_cython__(
struct __pyx_MemviewEnum_obj *__pyx_v_self);
4041static PyObject *__pyx_pf___pyx_MemviewEnum_2__setstate_cython__(
struct __pyx_MemviewEnum_obj *__pyx_v_self, PyObject *__pyx_v___pyx_state);
4042static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview___cinit__(
struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_obj,
int __pyx_v_flags,
int __pyx_v_dtype_is_object);
4043static void __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_2__dealloc__(
struct __pyx_memoryview_obj *__pyx_v_self);
4044static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_4__getitem__(
struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index);
4045static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_6__setitem__(
struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index, PyObject *__pyx_v_value);
4046static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_8__getbuffer__(
struct __pyx_memoryview_obj *__pyx_v_self, Py_buffer *__pyx_v_info,
int __pyx_v_flags);
4047static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_1T___get__(
struct __pyx_memoryview_obj *__pyx_v_self);
4048static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_4base___get__(
struct __pyx_memoryview_obj *__pyx_v_self);
4049static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_5shape___get__(
struct __pyx_memoryview_obj *__pyx_v_self);
4050static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_7strides___get__(
struct __pyx_memoryview_obj *__pyx_v_self);
4051static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_10suboffsets___get__(
struct __pyx_memoryview_obj *__pyx_v_self);
4052static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_4ndim___get__(
struct __pyx_memoryview_obj *__pyx_v_self);
4053static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_8itemsize___get__(
struct __pyx_memoryview_obj *__pyx_v_self);
4054static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_6nbytes___get__(
struct __pyx_memoryview_obj *__pyx_v_self);
4055static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_4size___get__(
struct __pyx_memoryview_obj *__pyx_v_self);
4056static Py_ssize_t __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_10__len__(
struct __pyx_memoryview_obj *__pyx_v_self);
4057static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_12__repr__(
struct __pyx_memoryview_obj *__pyx_v_self);
4058static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_14__str__(
struct __pyx_memoryview_obj *__pyx_v_self);
4059static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_16is_c_contig(
struct __pyx_memoryview_obj *__pyx_v_self);
4060static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_18is_f_contig(
struct __pyx_memoryview_obj *__pyx_v_self);
4061static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_20copy(
struct __pyx_memoryview_obj *__pyx_v_self);
4062static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_22copy_fortran(
struct __pyx_memoryview_obj *__pyx_v_self);
4063static PyObject *__pyx_pf___pyx_memoryview___reduce_cython__(CYTHON_UNUSED
struct __pyx_memoryview_obj *__pyx_v_self);
4064static PyObject *__pyx_pf___pyx_memoryview_2__setstate_cython__(CYTHON_UNUSED
struct __pyx_memoryview_obj *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state);
4065static void __pyx_memoryviewslice___pyx_pf_15View_dot_MemoryView_16_memoryviewslice___dealloc__(
struct __pyx_memoryviewslice_obj *__pyx_v_self);
4066static PyObject *__pyx_pf___pyx_memoryviewslice___reduce_cython__(CYTHON_UNUSED
struct __pyx_memoryviewslice_obj *__pyx_v_self);
4067static PyObject *__pyx_pf___pyx_memoryviewslice_2__setstate_cython__(CYTHON_UNUSED
struct __pyx_memoryviewslice_obj *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state);
4068static PyObject *__pyx_pf_15View_dot_MemoryView___pyx_unpickle_Enum(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v___pyx_type,
long __pyx_v___pyx_checksum, PyObject *__pyx_v___pyx_state);
4069static PyObject *__pyx_pf_15superluWrappers_12SparseMatrix___init__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_nr, PyObject *__pyx_v_nc, PyObject *__pyx_v_nnz, PyObject *__pyx_v_nzvals, PyObject *__pyx_v_colind, PyObject *__pyx_v_rowptr);
4070static PyObject *__pyx_pf_15superluWrappers_12SparseMatrix_2matvec(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_x, PyObject *__pyx_v_y);
4071static PyObject *__pyx_pf_15superluWrappers_12SparseMatrix_4fwrite(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_filename, PyObject *__pyx_v_base);
4072static PyObject *__pyx_pf_15superluWrappers_12SparseMatrix_6getCSRrepresentation(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self);
4073static PyObject *__pyx_pf_15superluWrappers_12SparseMatrix_8getSubMatCSRrepresentation(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_range_start, PyObject *__pyx_v_range_end);
4074static int __pyx_pf_15superluWrappers_13cSparseMatrix___cinit__(
struct __pyx_obj_15superluWrappers_cSparseMatrix *__pyx_v_self,
int __pyx_v_nr,
int __pyx_v_nc,
int __pyx_v_nnz, __Pyx_memviewslice __pyx_v_nzval, __Pyx_memviewslice __pyx_v_colind, __Pyx_memviewslice __pyx_v_rowptr);
4075static PyObject *__pyx_pf_15superluWrappers_13cSparseMatrix_2__reduce_cython__(CYTHON_UNUSED
struct __pyx_obj_15superluWrappers_cSparseMatrix *__pyx_v_self);
4076static PyObject *__pyx_pf_15superluWrappers_13cSparseMatrix_4__setstate_cython__(CYTHON_UNUSED
struct __pyx_obj_15superluWrappers_cSparseMatrix *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state);
4077static int __pyx_pf_15superluWrappers_12SparseFactor___init__(
struct __pyx_obj_15superluWrappers_SparseFactor *__pyx_v_self, PyObject *__pyx_v_dim);
4078static PyObject *__pyx_pf_15superluWrappers_12SparseFactor_3dim___get__(
struct __pyx_obj_15superluWrappers_SparseFactor *__pyx_v_self);
4079static int __pyx_pf_15superluWrappers_12SparseFactor_3dim_2__set__(
struct __pyx_obj_15superluWrappers_SparseFactor *__pyx_v_self, PyObject *__pyx_v_value);
4080static PyObject *__pyx_pf_15superluWrappers_12SparseFactor_2__reduce_cython__(CYTHON_UNUSED
struct __pyx_obj_15superluWrappers_SparseFactor *__pyx_v_self);
4081static PyObject *__pyx_pf_15superluWrappers_12SparseFactor_4__setstate_cython__(CYTHON_UNUSED
struct __pyx_obj_15superluWrappers_SparseFactor *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state);
4082static PyObject *__pyx_pf_15superluWrappers_sparseFactorPrepare(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_sparse_matrix, PyObject *__pyx_v_sparseFactor);
4083static PyObject *__pyx_pf_15superluWrappers_2sparseFactorSolve(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_sparseFactor, PyObject *__pyx_v_x);
4084static PyObject *__pyx_tp_new__initialisation_15superluWrappers_cSparseMatrix(PyObject *o,
4085#
if CYTHON_VECTORCALL_TPNEW
4086 PyObject *
const *args, Py_ssize_t nargs, PyObject *kwnames
4088 PyObject *a, PyObject *k
4091static PyObject *__pyx_tp_new_vectorcall_15superluWrappers_cSparseMatrix(PyTypeObject *t,
4092#
if CYTHON_VECTORCALL_TPNEW
4093 PyObject *
const *args, Py_ssize_t nargs, PyObject *kwnames
4095 PyObject *a, PyObject *k
4098#if CYTHON_VECTORCALL_TPNEW
4099static PyObject *__pyx_tp_new_15superluWrappers_cSparseMatrix(PyTypeObject *t, PyObject *a, PyObject *k);
4101#if !CYTHON_VECTORCALL_TPNEW
4102#define __pyx_tp_new_15superluWrappers_cSparseMatrix __pyx_tp_new_vectorcall_15superluWrappers_cSparseMatrix
4104#if CYTHON_VECTORCALL_TPNEW
4105static PyObject *__pyx_tp_vectorcall_15superluWrappers_cSparseMatrix(PyObject *t, PyObject *
const *args,
size_t nargsf, PyObject *kwnames);
4107static PyObject *__pyx_tp_new__initialisation_15superluWrappers_SparseFactor(PyObject *o,
4108#
if CYTHON_VECTORCALL_TPNEW
4109 PyObject *
const *args, Py_ssize_t nargs, PyObject *kwnames
4111 PyObject *a, PyObject *k
4114static PyObject *__pyx_tp_new_vectorcall_15superluWrappers_SparseFactor(PyTypeObject *t,
4115#
if CYTHON_VECTORCALL_TPNEW
4116 PyObject *
const *args, Py_ssize_t nargs, PyObject *kwnames
4118 PyObject *a, PyObject *k
4121#if CYTHON_VECTORCALL_TPNEW
4122static PyObject *__pyx_tp_new_15superluWrappers_SparseFactor(PyTypeObject *t, PyObject *a, PyObject *k);
4124#if !CYTHON_VECTORCALL_TPNEW
4125#define __pyx_tp_new_15superluWrappers_SparseFactor __pyx_tp_new_vectorcall_15superluWrappers_SparseFactor
4127#if CYTHON_VECTORCALL_TPNEW
4128static PyObject *__pyx_tp_vectorcall_15superluWrappers_SparseFactor(PyObject *t, PyObject *
const *args,
size_t nargsf, PyObject *kwnames);
4130#if CYTHON_VECTORCALL_TPNEW
4131static int __pyx_tp_init_15superluWrappers_SparseFactor(PyObject *o, PyObject *args, PyObject *kwds);
4133#if !CYTHON_VECTORCALL_TPNEW
4134#define __pyx_tp_init_15superluWrappers_SparseFactor __pyx_pw_15superluWrappers_12SparseFactor_1__init__
4136static PyObject *__pyx_tp_new__initialisation_array(PyObject *o,
4137#
if CYTHON_VECTORCALL_TPNEW
4138 PyObject *
const *args, Py_ssize_t nargs, PyObject *kwnames
4140 PyObject *a, PyObject *k
4143static PyObject *__pyx_tp_new_vectorcall_array(PyTypeObject *t,
4144#
if CYTHON_VECTORCALL_TPNEW
4145 PyObject *
const *args, Py_ssize_t nargs, PyObject *kwnames
4147 PyObject *a, PyObject *k
4150#if CYTHON_VECTORCALL_TPNEW
4151static PyObject *__pyx_tp_new_array(PyTypeObject *t, PyObject *a, PyObject *k);
4153#if !CYTHON_VECTORCALL_TPNEW
4154#define __pyx_tp_new_array __pyx_tp_new_vectorcall_array
4156#if CYTHON_VECTORCALL_TPNEW
4157static PyObject *__pyx_tp_vectorcall_array(PyObject *t, PyObject *
const *args,
size_t nargsf, PyObject *kwnames);
4159static PyObject *__pyx_tp_new__initialisation_Enum(PyObject *o,
4160#
if CYTHON_VECTORCALL_TPNEW
4161 PyObject *
const *args, Py_ssize_t nargs, PyObject *kwnames
4163 PyObject *a, PyObject *k
4166static PyObject *__pyx_tp_new_vectorcall_Enum(PyTypeObject *t,
4167#
if CYTHON_VECTORCALL_TPNEW
4168 PyObject *
const *args, Py_ssize_t nargs, PyObject *kwnames
4170 PyObject *a, PyObject *k
4173#if CYTHON_VECTORCALL_TPNEW
4174static PyObject *__pyx_tp_new_Enum(PyTypeObject *t, PyObject *a, PyObject *k);
4176#if !CYTHON_VECTORCALL_TPNEW
4177#define __pyx_tp_new_Enum __pyx_tp_new_vectorcall_Enum
4179#if CYTHON_VECTORCALL_TPNEW
4180static PyObject *__pyx_tp_vectorcall_Enum(PyObject *t, PyObject *
const *args,
size_t nargsf, PyObject *kwnames);
4182#if CYTHON_VECTORCALL_TPNEW
4183static int __pyx_tp_init_Enum(PyObject *o, PyObject *args, PyObject *kwds);
4185#if !CYTHON_VECTORCALL_TPNEW
4186#define __pyx_tp_init_Enum __pyx_MemviewEnum___init__
4188static PyObject *__pyx_tp_new__initialisation_memoryview(PyObject *o,
4189#
if CYTHON_VECTORCALL_TPNEW
4190 PyObject *
const *args, Py_ssize_t nargs, PyObject *kwnames
4192 PyObject *a, PyObject *k
4195static PyObject *__pyx_tp_new_vectorcall_memoryview(PyTypeObject *t,
4196#
if CYTHON_VECTORCALL_TPNEW
4197 PyObject *
const *args, Py_ssize_t nargs, PyObject *kwnames
4199 PyObject *a, PyObject *k
4202#if CYTHON_VECTORCALL_TPNEW
4203static PyObject *__pyx_tp_new_memoryview(PyTypeObject *t, PyObject *a, PyObject *k);
4205#if !CYTHON_VECTORCALL_TPNEW
4206#define __pyx_tp_new_memoryview __pyx_tp_new_vectorcall_memoryview
4208#if CYTHON_VECTORCALL_TPNEW
4209static PyObject *__pyx_tp_vectorcall_memoryview(PyObject *t, PyObject *
const *args,
size_t nargsf, PyObject *kwnames);
4211static PyObject *__pyx_tp_new__initialisation__memoryviewslice(PyObject *o,
4212#
if CYTHON_VECTORCALL_TPNEW
4213 PyObject *
const *args, Py_ssize_t nargs, PyObject *kwnames
4215 PyObject *a, PyObject *k
4218static PyObject *__pyx_tp_new_vectorcall__memoryviewslice(PyTypeObject *t,
4219#
if CYTHON_VECTORCALL_TPNEW
4220 PyObject *
const *args, Py_ssize_t nargs, PyObject *kwnames
4222 PyObject *a, PyObject *k
4225#if CYTHON_VECTORCALL_TPNEW
4226static PyObject *__pyx_tp_new__memoryviewslice(PyTypeObject *t, PyObject *a, PyObject *k);
4228#if !CYTHON_VECTORCALL_TPNEW
4229#define __pyx_tp_new__memoryviewslice __pyx_tp_new_vectorcall__memoryviewslice
4231#if CYTHON_VECTORCALL_TPNEW
4232static PyObject *__pyx_tp_vectorcall__memoryviewslice(PyObject *t, PyObject *
const *args,
size_t nargsf, PyObject *kwnames);
4237#ifndef CYTHON_SMALL_CODE
4238#if defined(__clang__)
4239 #define CYTHON_SMALL_CODE
4240#elif defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 3))
4241 #define CYTHON_SMALL_CODE __attribute__((cold))
4243 #define CYTHON_SMALL_CODE
4253 PyObject *__pyx_cython_runtime;
4254 PyObject *__pyx_empty_tuple;
4255 PyObject *__pyx_empty_bytes;
4256 PyObject *__pyx_empty_unicode;
4257 PyTypeObject *__pyx_ptype_7cpython_4type_type;
4258 PyTypeObject *__pyx_ptype_5numpy_dtype;
4259 PyTypeObject *__pyx_ptype_5numpy_flatiter;
4260 PyTypeObject *__pyx_ptype_5numpy_broadcast;
4261 PyTypeObject *__pyx_ptype_5numpy_ndarray;
4262 PyTypeObject *__pyx_ptype_5numpy_generic;
4263 PyTypeObject *__pyx_ptype_5numpy_number;
4264 PyTypeObject *__pyx_ptype_5numpy_integer;
4265 PyTypeObject *__pyx_ptype_5numpy_signedinteger;
4266 PyTypeObject *__pyx_ptype_5numpy_unsignedinteger;
4267 PyTypeObject *__pyx_ptype_5numpy_inexact;
4268 PyTypeObject *__pyx_ptype_5numpy_floating;
4269 PyTypeObject *__pyx_ptype_5numpy_complexfloating;
4270 PyTypeObject *__pyx_ptype_5numpy_flexible;
4271 PyTypeObject *__pyx_ptype_5numpy_character;
4272 PyTypeObject *__pyx_ptype_5numpy_ufunc;
4273 PyObject *__pyx_type_15superluWrappers_cSparseMatrix;
4274 PyObject *__pyx_type_15superluWrappers_SparseFactor;
4275 PyObject *__pyx_type___pyx_array;
4276 PyObject *__pyx_type___pyx_MemviewEnum;
4277 PyObject *__pyx_type___pyx_memoryview;
4278 PyObject *__pyx_type___pyx_memoryviewslice;
4279 PyTypeObject *__pyx_ptype_15superluWrappers_cSparseMatrix;
4280 PyTypeObject *__pyx_ptype_15superluWrappers_SparseFactor;
4281 PyTypeObject *__pyx_array_type;
4282 PyTypeObject *__pyx_MemviewEnum_type;
4283 PyTypeObject *__pyx_memoryview_type;
4284 PyTypeObject *__pyx_memoryviewslice_type;
4285 __Pyx_CachedCFunction __pyx_umethod_PyDict_Type_items;
4286 __Pyx_CachedCFunction __pyx_umethod_PyDict_Type_pop;
4287 __Pyx_CachedCFunction __pyx_umethod_PyDict_Type_values;
4288 PyObject *__pyx_slice[1];
4289 PyObject *__pyx_tuple[5];
4290 PyObject *__pyx_codeobj_tab[11];
4291 PyObject *__pyx_string_tab[160];
4292 PyObject *__pyx_number_tab[4];
4295#if CYTHON_COMPILING_IN_LIMITED_API
4296PyObject *__Pyx_PyFrozenDictType;
4300PyTypeObject *__pyx_CommonTypesMetaclassType;
4303#if CYTHON_COMPILING_IN_LIMITED_API
4304PyObject *__Pyx_CachedMethodType;
4308PyTypeObject *__pyx_CyFunctionType;
4311struct __Pyx_CodeObjectCache __pyx_code_cache;
4319#if CYTHON_USE_MODULE_STATE
4322extern struct PyModuleDef __pyx_moduledef;
4325static struct PyModuleDef __pyx_moduledef;
4328#define __pyx_mstate_global (__Pyx_PyModule_GetState(__Pyx_State_FindModule(&__pyx_moduledef)))
4330#define __pyx_m (__Pyx_State_FindModule(&__pyx_moduledef))
4332static __pyx_mstatetype __pyx_mstate_global_static =
4338static __pyx_mstatetype *
const __pyx_mstate_global = &__pyx_mstate_global_static;
4341#define __pyx_kp_u_at_0x __pyx_string_tab[0]
4342#define __pyx_kp_u_object_2 __pyx_string_tab[1]
4343#define __pyx_kp_u_d_d_13_8e __pyx_string_tab[2]
4344#define __pyx_kp_u_i_i_i __pyx_string_tab[3]
4345#define __pyx_kp_u_tree_fragment __pyx_string_tab[4]
4346#define __pyx_kp_u__3 __pyx_string_tab[5]
4347#define __pyx_kp_u__2 __pyx_string_tab[6]
4348#define __pyx_kp_u_MemoryView_of __pyx_string_tab[7]
4349#define __pyx_kp_u_contiguous_and_direct __pyx_string_tab[8]
4350#define __pyx_kp_u_contiguous_and_indirect __pyx_string_tab[9]
4351#define __pyx_kp_u_strided_and_direct_or_indirect __pyx_string_tab[10]
4352#define __pyx_kp_u_strided_and_direct __pyx_string_tab[11]
4353#define __pyx_kp_u_strided_and_indirect __pyx_string_tab[12]
4354#define __pyx_kp_u__4 __pyx_string_tab[13]
4355#define __pyx_kp_u_ __pyx_string_tab[14]
4356#define __pyx_kp_u_Cannot_assign_to_read_only_memor __pyx_string_tab[15]
4357#define __pyx_kp_u_Invalid_mode_expected_c_or_fortr __pyx_string_tab[16]
4358#define __pyx_kp_u_Invalid_shape_in_axis __pyx_string_tab[17]
4359#define __pyx_kp_u_Note_that_Cython_is_deliberately __pyx_string_tab[18]
4360#define __pyx_kp_u_add_note __pyx_string_tab[19]
4361#define __pyx_kp_u_collections_abc __pyx_string_tab[20]
4362#define __pyx_kp_u_disable __pyx_string_tab[21]
4363#define __pyx_kp_u_enable __pyx_string_tab[22]
4364#define __pyx_kp_u_gc __pyx_string_tab[23]
4365#define __pyx_kp_u_isenabled __pyx_string_tab[24]
4366#define __pyx_kp_u_no_default___reduce___due_to_non __pyx_string_tab[25]
4367#define __pyx_kp_u_numpy__core_multiarray_failed_to __pyx_string_tab[26]
4368#define __pyx_kp_u_numpy__core_umath_failed_to_impo __pyx_string_tab[27]
4369#define __pyx_kp_u_proteus_superluWrappers_pyx __pyx_string_tab[28]
4370#define __pyx_kp_u_self_A_self_AC_self_L_self_U_sel __pyx_string_tab[29]
4371#define __pyx_kp_u_unable_to_allocate_array_data __pyx_string_tab[30]
4372#define __pyx_kp_u_unable_to_allocate_shape_and_str __pyx_string_tab[31]
4373#define __pyx_n_u_ASCII __pyx_string_tab[32]
4374#define __pyx_n_u_Ellipsis __pyx_string_tab[33]
4375#define __pyx_n_u_Sequence __pyx_string_tab[34]
4376#define __pyx_n_u_SparseFactor __pyx_string_tab[35]
4377#define __pyx_n_u_SparseFactor___reduce_cython __pyx_string_tab[36]
4378#define __pyx_n_u_SparseFactor___setstate_cython __pyx_string_tab[37]
4379#define __pyx_n_u_SparseMatrix __pyx_string_tab[38]
4380#define __pyx_n_u_SparseMatrix___init __pyx_string_tab[39]
4381#define __pyx_n_u_SparseMatrix_fwrite __pyx_string_tab[40]
4382#define __pyx_n_u_SparseMatrix_getCSRrepresentatio __pyx_string_tab[41]
4383#define __pyx_n_u_SparseMatrix_getSubMatCSRreprese __pyx_string_tab[42]
4384#define __pyx_n_u_SparseMatrix_matvec __pyx_string_tab[43]
4385#define __pyx_n_u_View_MemoryView __pyx_string_tab[44]
4386#define __pyx_n_u_Pyx_PyDict_NextRef __pyx_string_tab[45]
4387#define __pyx_n_u_annotate __pyx_string_tab[46]
4388#define __pyx_n_u_class __pyx_string_tab[47]
4389#define __pyx_n_u_class_getitem __pyx_string_tab[48]
4390#define __pyx_n_u_dict __pyx_string_tab[49]
4391#define __pyx_n_u_doc __pyx_string_tab[50]
4392#define __pyx_n_u_enter __pyx_string_tab[51]
4393#define __pyx_n_u_exit __pyx_string_tab[52]
4394#define __pyx_n_u_func __pyx_string_tab[53]
4395#define __pyx_n_u_getstate __pyx_string_tab[54]
4396#define __pyx_n_u_import __pyx_string_tab[55]
4397#define __pyx_n_u_init __pyx_string_tab[56]
4398#define __pyx_n_u_main __pyx_string_tab[57]
4399#define __pyx_n_u_metaclass __pyx_string_tab[58]
4400#define __pyx_n_u_module __pyx_string_tab[59]
4401#define __pyx_n_u_mro_entries __pyx_string_tab[60]
4402#define __pyx_n_u_name_2 __pyx_string_tab[61]
4403#define __pyx_n_u_new __pyx_string_tab[62]
4404#define __pyx_n_u_prepare __pyx_string_tab[63]
4405#define __pyx_n_u_pyx_checksum __pyx_string_tab[64]
4406#define __pyx_n_u_pyx_state __pyx_string_tab[65]
4407#define __pyx_n_u_pyx_type __pyx_string_tab[66]
4408#define __pyx_n_u_pyx_unpickle_Enum __pyx_string_tab[67]
4409#define __pyx_n_u_pyx_vtable __pyx_string_tab[68]
4410#define __pyx_n_u_qualname __pyx_string_tab[69]
4411#define __pyx_n_u_reduce __pyx_string_tab[70]
4412#define __pyx_n_u_reduce_cython __pyx_string_tab[71]
4413#define __pyx_n_u_reduce_ex __pyx_string_tab[72]
4414#define __pyx_n_u_set_name __pyx_string_tab[73]
4415#define __pyx_n_u_setstate __pyx_string_tab[74]
4416#define __pyx_n_u_setstate_cython __pyx_string_tab[75]
4417#define __pyx_n_u_test __pyx_string_tab[76]
4418#define __pyx_n_u_cSparseMatrix __pyx_string_tab[77]
4419#define __pyx_n_u_is_coroutine __pyx_string_tab[78]
4420#define __pyx_n_u_rows __pyx_string_tab[79]
4421#define __pyx_n_u_abc __pyx_string_tab[80]
4422#define __pyx_n_u_allocate_buffer __pyx_string_tab[81]
4423#define __pyx_n_u_asyncio_coroutines __pyx_string_tab[82]
4424#define __pyx_n_u_base __pyx_string_tab[83]
4425#define __pyx_n_u_c __pyx_string_tab[84]
4426#define __pyx_n_u_cSparseMatrix_2 __pyx_string_tab[85]
4427#define __pyx_n_u_cSparseMatrix___reduce_cython __pyx_string_tab[86]
4428#define __pyx_n_u_cSparseMatrix___setstate_cython __pyx_string_tab[87]
4429#define __pyx_n_u_cline_in_traceback __pyx_string_tab[88]
4430#define __pyx_n_u_colind __pyx_string_tab[89]
4431#define __pyx_n_u_count __pyx_string_tab[90]
4432#define __pyx_n_u_dim __pyx_string_tab[91]
4433#define __pyx_n_u_dtype_is_object __pyx_string_tab[92]
4434#define __pyx_n_u_encode __pyx_string_tab[93]
4435#define __pyx_n_u_enumerate __pyx_string_tab[94]
4436#define __pyx_n_u_error __pyx_string_tab[95]
4437#define __pyx_n_u_filename __pyx_string_tab[96]
4438#define __pyx_n_u_flags __pyx_string_tab[97]
4439#define __pyx_n_u_format __pyx_string_tab[98]
4440#define __pyx_n_u_fortran __pyx_string_tab[99]
4441#define __pyx_n_u_fwrite __pyx_string_tab[100]
4442#define __pyx_n_u_getCSRrepresentation __pyx_string_tab[101]
4443#define __pyx_n_u_getSubMatCSRrepresentation __pyx_string_tab[102]
4444#define __pyx_n_u_i __pyx_string_tab[103]
4445#define __pyx_n_u_id __pyx_string_tab[104]
4446#define __pyx_n_u_index __pyx_string_tab[105]
4447#define __pyx_n_u_items __pyx_string_tab[106]
4448#define __pyx_n_u_itemsize __pyx_string_tab[107]
4449#define __pyx_n_u_k __pyx_string_tab[108]
4450#define __pyx_n_u_matvec __pyx_string_tab[109]
4451#define __pyx_n_u_memview __pyx_string_tab[110]
4452#define __pyx_n_u_mode __pyx_string_tab[111]
4453#define __pyx_n_u_name __pyx_string_tab[112]
4454#define __pyx_n_u_nc __pyx_string_tab[113]
4455#define __pyx_n_u_ndim __pyx_string_tab[114]
4456#define __pyx_n_u_nnz __pyx_string_tab[115]
4457#define __pyx_n_u_np __pyx_string_tab[116]
4458#define __pyx_n_u_nr __pyx_string_tab[117]
4459#define __pyx_n_u_numpy __pyx_string_tab[118]
4460#define __pyx_n_u_nzval __pyx_string_tab[119]
4461#define __pyx_n_u_nzvals __pyx_string_tab[120]
4462#define __pyx_n_u_obj __pyx_string_tab[121]
4463#define __pyx_n_u_object __pyx_string_tab[122]
4464#define __pyx_n_u_open __pyx_string_tab[123]
4465#define __pyx_n_u_output_file __pyx_string_tab[124]
4466#define __pyx_n_u_pack __pyx_string_tab[125]
4467#define __pyx_n_u_pop __pyx_string_tab[126]
4468#define __pyx_n_u_range_end __pyx_string_tab[127]
4469#define __pyx_n_u_range_start __pyx_string_tab[128]
4470#define __pyx_n_u_register __pyx_string_tab[129]
4471#define __pyx_n_u_rowptr __pyx_string_tab[130]
4472#define __pyx_n_u_self __pyx_string_tab[131]
4473#define __pyx_n_u_setdefault __pyx_string_tab[132]
4474#define __pyx_n_u_shape __pyx_string_tab[133]
4475#define __pyx_n_u_size __pyx_string_tab[134]
4476#define __pyx_n_u_sparseFactor __pyx_string_tab[135]
4477#define __pyx_n_u_sparseFactorPrepare __pyx_string_tab[136]
4478#define __pyx_n_u_sparseFactorSolve __pyx_string_tab[137]
4479#define __pyx_n_u_sparse_matrix __pyx_string_tab[138]
4480#define __pyx_n_u_start __pyx_string_tab[139]
4481#define __pyx_n_u_step __pyx_string_tab[140]
4482#define __pyx_n_u_stop __pyx_string_tab[141]
4483#define __pyx_n_u_struct __pyx_string_tab[142]
4484#define __pyx_n_u_superluWrappers __pyx_string_tab[143]
4485#define __pyx_n_u_unpack __pyx_string_tab[144]
4486#define __pyx_n_u_update __pyx_string_tab[145]
4487#define __pyx_n_u_values __pyx_string_tab[146]
4488#define __pyx_n_u_w __pyx_string_tab[147]
4489#define __pyx_n_u_write __pyx_string_tab[148]
4490#define __pyx_n_u_x __pyx_string_tab[149]
4491#define __pyx_n_u_y __pyx_string_tab[150]
4492#define __pyx_n_b_O __pyx_string_tab[151]
4493#define __pyx_kp_b_iso88591_Q __pyx_string_tab[152]
4494#define __pyx_kp_b_iso88591_AQ __pyx_string_tab[153]
4495#define __pyx_kp_b_iso88591_a_A __pyx_string_tab[154]
4496#define __pyx_kp_b_iso88591_A_F_t6_G1_IQd_t1_Ja_Ja_Ja_m1A_0 __pyx_string_tab[155]
4497#define __pyx_kp_b_iso88591_A_IT_a __pyx_string_tab[156]
4498#define __pyx_kp_b_iso88591_A_1D_1_A __pyx_string_tab[157]
4499#define __pyx_kp_b_iso88591_A_HA_vQnCt5_E_WATQR_U_4q_E_at7_4 __pyx_string_tab[158]
4500#define __pyx_kp_b_iso88591_A_3d_3d_z_1_A_vS_A_d_Rt7_1_WA_r __pyx_string_tab[159]
4501#define __pyx_int_0 __pyx_number_tab[0]
4502#define __pyx_int_neg_1 __pyx_number_tab[1]
4503#define __pyx_int_1 __pyx_number_tab[2]
4504#define __pyx_int_136983863 __pyx_number_tab[3]
4506#if CYTHON_USE_MODULE_STATE
4507static CYTHON_SMALL_CODE
int __pyx_m_clear(PyObject *m) {
4508 __pyx_mstatetype *clear_module_state = __Pyx_PyModule_GetState(m);
4509 if (!clear_module_state)
return 0;
4510 Py_CLEAR(clear_module_state->__pyx_d);
4511 Py_CLEAR(clear_module_state->__pyx_b);
4512 Py_CLEAR(clear_module_state->__pyx_cython_runtime);
4513 Py_CLEAR(clear_module_state->__pyx_empty_tuple);
4514 Py_CLEAR(clear_module_state->__pyx_empty_bytes);
4515 Py_CLEAR(clear_module_state->__pyx_empty_unicode);
4516 #if CYTHON_PEP489_MULTI_PHASE_INIT
4517 __Pyx_State_RemoveModule(NULL);
4519 Py_CLEAR(clear_module_state->__pyx_ptype_7cpython_4type_type);
4520 Py_CLEAR(clear_module_state->__pyx_ptype_5numpy_dtype);
4521 Py_CLEAR(clear_module_state->__pyx_ptype_5numpy_flatiter);
4522 Py_CLEAR(clear_module_state->__pyx_ptype_5numpy_broadcast);
4523 Py_CLEAR(clear_module_state->__pyx_ptype_5numpy_ndarray);
4524 Py_CLEAR(clear_module_state->__pyx_ptype_5numpy_generic);
4525 Py_CLEAR(clear_module_state->__pyx_ptype_5numpy_number);
4526 Py_CLEAR(clear_module_state->__pyx_ptype_5numpy_integer);
4527 Py_CLEAR(clear_module_state->__pyx_ptype_5numpy_signedinteger);
4528 Py_CLEAR(clear_module_state->__pyx_ptype_5numpy_unsignedinteger);
4529 Py_CLEAR(clear_module_state->__pyx_ptype_5numpy_inexact);
4530 Py_CLEAR(clear_module_state->__pyx_ptype_5numpy_floating);
4531 Py_CLEAR(clear_module_state->__pyx_ptype_5numpy_complexfloating);
4532 Py_CLEAR(clear_module_state->__pyx_ptype_5numpy_flexible);
4533 Py_CLEAR(clear_module_state->__pyx_ptype_5numpy_character);
4534 Py_CLEAR(clear_module_state->__pyx_ptype_5numpy_ufunc);
4535 Py_CLEAR(clear_module_state->__pyx_ptype_15superluWrappers_cSparseMatrix);
4536 Py_CLEAR(clear_module_state->__pyx_type_15superluWrappers_cSparseMatrix);
4537 Py_CLEAR(clear_module_state->__pyx_ptype_15superluWrappers_SparseFactor);
4538 Py_CLEAR(clear_module_state->__pyx_type_15superluWrappers_SparseFactor);
4539 Py_CLEAR(clear_module_state->__pyx_array_type);
4540 Py_CLEAR(clear_module_state->__pyx_type___pyx_array);
4541 Py_CLEAR(clear_module_state->__pyx_MemviewEnum_type);
4542 Py_CLEAR(clear_module_state->__pyx_type___pyx_MemviewEnum);
4543 Py_CLEAR(clear_module_state->__pyx_memoryview_type);
4544 Py_CLEAR(clear_module_state->__pyx_type___pyx_memoryview);
4545 Py_CLEAR(clear_module_state->__pyx_memoryviewslice_type);
4546 Py_CLEAR(clear_module_state->__pyx_type___pyx_memoryviewslice);
4547 Py_CLEAR(clear_module_state->__pyx_umethod_PyDict_Type_items.method);
4548 Py_CLEAR(clear_module_state->__pyx_umethod_PyDict_Type_pop.method);
4549 Py_CLEAR(clear_module_state->__pyx_umethod_PyDict_Type_values.method);
4550 for (
int i=0; i<1; ++i) { Py_CLEAR(clear_module_state->__pyx_slice[i]); }
4551 for (
int i=0; i<5; ++i) { Py_CLEAR(clear_module_state->__pyx_tuple[i]); }
4552 for (
int i=0; i<11; ++i) { Py_CLEAR(clear_module_state->__pyx_codeobj_tab[i]); }
4553 for (
int i=0; i<160; ++i) { Py_CLEAR(clear_module_state->__pyx_string_tab[i]); }
4554 for (
int i=0; i<4; ++i) { Py_CLEAR(clear_module_state->__pyx_number_tab[i]); }
4557Py_CLEAR(clear_module_state->__pyx_CommonTypesMetaclassType);
4560Py_CLEAR(clear_module_state->__pyx_CyFunctionType);
4567#if CYTHON_USE_MODULE_STATE
4568static CYTHON_SMALL_CODE
int __pyx_m_traverse(PyObject *m, visitproc visit,
void *arg) {
4569 __pyx_mstatetype *traverse_module_state = __Pyx_PyModule_GetState(m);
4570 if (!traverse_module_state)
return 0;
4571 Py_VISIT(traverse_module_state->__pyx_d);
4572 Py_VISIT(traverse_module_state->__pyx_b);
4573 Py_VISIT(traverse_module_state->__pyx_cython_runtime);
4574 __Pyx_VISIT_CONST(traverse_module_state->__pyx_empty_tuple);
4575 __Pyx_VISIT_CONST(traverse_module_state->__pyx_empty_bytes);
4576 __Pyx_VISIT_CONST(traverse_module_state->__pyx_empty_unicode);
4577 Py_VISIT(traverse_module_state->__pyx_ptype_7cpython_4type_type);
4578 Py_VISIT(traverse_module_state->__pyx_ptype_5numpy_dtype);
4579 Py_VISIT(traverse_module_state->__pyx_ptype_5numpy_flatiter);
4580 Py_VISIT(traverse_module_state->__pyx_ptype_5numpy_broadcast);
4581 Py_VISIT(traverse_module_state->__pyx_ptype_5numpy_ndarray);
4582 Py_VISIT(traverse_module_state->__pyx_ptype_5numpy_generic);
4583 Py_VISIT(traverse_module_state->__pyx_ptype_5numpy_number);
4584 Py_VISIT(traverse_module_state->__pyx_ptype_5numpy_integer);
4585 Py_VISIT(traverse_module_state->__pyx_ptype_5numpy_signedinteger);
4586 Py_VISIT(traverse_module_state->__pyx_ptype_5numpy_unsignedinteger);
4587 Py_VISIT(traverse_module_state->__pyx_ptype_5numpy_inexact);
4588 Py_VISIT(traverse_module_state->__pyx_ptype_5numpy_floating);
4589 Py_VISIT(traverse_module_state->__pyx_ptype_5numpy_complexfloating);
4590 Py_VISIT(traverse_module_state->__pyx_ptype_5numpy_flexible);
4591 Py_VISIT(traverse_module_state->__pyx_ptype_5numpy_character);
4592 Py_VISIT(traverse_module_state->__pyx_ptype_5numpy_ufunc);
4593 Py_VISIT(traverse_module_state->__pyx_ptype_15superluWrappers_cSparseMatrix);
4594 Py_VISIT(traverse_module_state->__pyx_type_15superluWrappers_cSparseMatrix);
4595 Py_VISIT(traverse_module_state->__pyx_ptype_15superluWrappers_SparseFactor);
4596 Py_VISIT(traverse_module_state->__pyx_type_15superluWrappers_SparseFactor);
4597 Py_VISIT(traverse_module_state->__pyx_array_type);
4598 Py_VISIT(traverse_module_state->__pyx_type___pyx_array);
4599 Py_VISIT(traverse_module_state->__pyx_MemviewEnum_type);
4600 Py_VISIT(traverse_module_state->__pyx_type___pyx_MemviewEnum);
4601 Py_VISIT(traverse_module_state->__pyx_memoryview_type);
4602 Py_VISIT(traverse_module_state->__pyx_type___pyx_memoryview);
4603 Py_VISIT(traverse_module_state->__pyx_memoryviewslice_type);
4604 Py_VISIT(traverse_module_state->__pyx_type___pyx_memoryviewslice);
4605 Py_VISIT(traverse_module_state->__pyx_umethod_PyDict_Type_items.method);
4606 Py_VISIT(traverse_module_state->__pyx_umethod_PyDict_Type_pop.method);
4607 Py_VISIT(traverse_module_state->__pyx_umethod_PyDict_Type_values.method);
4608 for (
int i=0; i<1; ++i) { __Pyx_VISIT_CONST(traverse_module_state->__pyx_slice[i]); }
4609 for (
int i=0; i<5; ++i) { __Pyx_VISIT_CONST(traverse_module_state->__pyx_tuple[i]); }
4610 for (
int i=0; i<11; ++i) { __Pyx_VISIT_CONST(traverse_module_state->__pyx_codeobj_tab[i]); }
4611 for (
int i=0; i<160; ++i) { __Pyx_VISIT_CONST(traverse_module_state->__pyx_string_tab[i]); }
4612 for (
int i=0; i<4; ++i) { __Pyx_VISIT_CONST(traverse_module_state->__pyx_number_tab[i]); }
4615Py_VISIT(traverse_module_state->__pyx_CommonTypesMetaclassType);
4618Py_VISIT(traverse_module_state->__pyx_CyFunctionType);
4635static int __pyx_array___cinit__(PyObject *__pyx_v_self,
4636#
if CYTHON_VECTORCALL_TPNEW
4637PyObject *
const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
4639PyObject *__pyx_args, PyObject *__pyx_kwds
4642static int __pyx_array___cinit__(PyObject *__pyx_v_self,
4643#
if CYTHON_VECTORCALL_TPNEW
4644PyObject *
const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
4646PyObject *__pyx_args, PyObject *__pyx_kwds
4649 PyObject *__pyx_v_shape = 0;
4650 Py_ssize_t __pyx_v_itemsize;
4651 PyObject *__pyx_v_format = 0;
4652 PyObject *__pyx_v_mode = 0;
4653 int __pyx_v_allocate_buffer;
4654 #if !CYTHON_VECTORCALL_TPNEW
4655 CYTHON_UNUSED Py_ssize_t __pyx_nargs;
4657 CYTHON_UNUSED PyObject *
const *__pyx_kwvalues;
4658 PyObject* values[5] = {0,0,0,0,0};
4659 int __pyx_lineno = 0;
4660 const char *__pyx_filename = NULL;
4661 int __pyx_clineno = 0;
4663 __Pyx_RefNannyDeclarations
4664 __Pyx_RefNannySetupContext(
"__cinit__ (wrapper)", 0);
4665 #if !CYTHON_VECTORCALL_TPNEW
4666 #if CYTHON_ASSUME_SAFE_SIZE
4667 __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
4669 __pyx_nargs = PyTuple_Size(__pyx_args);
if (unlikely(__pyx_nargs < 0))
return -1;
4672 __pyx_kwvalues = __Pyx_KwValues_FASTCALL_TPNEW(__pyx_args, __pyx_nargs);
4674 PyObject **
const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_shape,&__pyx_mstate_global->__pyx_n_u_itemsize,&__pyx_mstate_global->__pyx_n_u_format,&__pyx_mstate_global->__pyx_n_u_mode,&__pyx_mstate_global->__pyx_n_u_allocate_buffer,0};
4675 const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL_TPNEW(__pyx_kwds) : 0;
4676 if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(1, 147, __pyx_L3_error)
4677 if (__pyx_kwds_len > 0) {
4678 switch (__pyx_nargs) {
4680 values[4] = __Pyx_ArgRef_FASTCALL_TPNEW(__pyx_args, 4);
4681 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(1, 147, __pyx_L3_error)
4684 values[3] = __Pyx_ArgRef_FASTCALL_TPNEW(__pyx_args, 3);
4685 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(1, 147, __pyx_L3_error)
4688 values[2] = __Pyx_ArgRef_FASTCALL_TPNEW(__pyx_args, 2);
4689 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(1, 147, __pyx_L3_error)
4692 values[1] = __Pyx_ArgRef_FASTCALL_TPNEW(__pyx_args, 1);
4693 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(1, 147, __pyx_L3_error)
4696 values[0] = __Pyx_ArgRef_FASTCALL_TPNEW(__pyx_args, 0);
4697 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(1, 147, __pyx_L3_error)
4700 default:
goto __pyx_L5_argtuple_error;
4702 const Py_ssize_t kwd_pos_args = __pyx_nargs;
4703 if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len,
"__cinit__", 0) < (0)) __PYX_ERR(1, 147, __pyx_L3_error)
4704 if (!values[3]) values[3] = __Pyx_NewRef(((PyObject *)__pyx_mstate_global->__pyx_n_u_c));
4705 for (Py_ssize_t i = __pyx_nargs; i < 3; i++) {
4706 if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid(
"__cinit__", 0, 3, 5, i); __PYX_ERR(1, 147, __pyx_L3_error) }
4709 switch (__pyx_nargs) {
4711 values[4] = __Pyx_ArgRef_FASTCALL_TPNEW(__pyx_args, 4);
4712 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(1, 147, __pyx_L3_error)
4715 values[3] = __Pyx_ArgRef_FASTCALL_TPNEW(__pyx_args, 3);
4716 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(1, 147, __pyx_L3_error)
4719 values[2] = __Pyx_ArgRef_FASTCALL_TPNEW(__pyx_args, 2);
4720 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(1, 147, __pyx_L3_error)
4721 values[1] = __Pyx_ArgRef_FASTCALL_TPNEW(__pyx_args, 1);
4722 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(1, 147, __pyx_L3_error)
4723 values[0] = __Pyx_ArgRef_FASTCALL_TPNEW(__pyx_args, 0);
4724 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(1, 147, __pyx_L3_error)
4726 default:
goto __pyx_L5_argtuple_error;
4728 if (!values[3]) values[3] = __Pyx_NewRef(((PyObject *)__pyx_mstate_global->__pyx_n_u_c));
4730 __pyx_v_shape = ((PyObject*)values[0]);
4731 __pyx_v_itemsize = __Pyx_PyIndex_AsSsize_t(values[1]);
if (unlikely((__pyx_v_itemsize == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(1, 147, __pyx_L3_error)
4732 __pyx_v_format = values[2];
4733 __pyx_v_mode = values[3];
4735 __pyx_v_allocate_buffer = __Pyx_PyObject_IsTrue(values[4]);
if (unlikely((__pyx_v_allocate_buffer == (
int)-1) && PyErr_Occurred())) __PYX_ERR(1, 148, __pyx_L3_error)
4745 __pyx_v_allocate_buffer = ((int)1);
4749 __pyx_L5_argtuple_error:;
4750 __Pyx_RaiseArgtupleInvalid(
"__cinit__", 0, 3, 5, __pyx_nargs); __PYX_ERR(1, 147, __pyx_L3_error)
4752 goto __pyx_L4_argument_unpacking_done;
4754 for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(
sizeof(values)/
sizeof(values[0])); ++__pyx_temp) {
4755 Py_XDECREF(values[__pyx_temp]);
4757 __Pyx_AddTraceback(
"View.MemoryView.array.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
4758 __Pyx_RefNannyFinishContext();
4760 __pyx_L4_argument_unpacking_done:;
4761 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_shape), (&PyTuple_Type), 1,
"shape", 1))) __PYX_ERR(1, 147, __pyx_L1_error)
4762 if (unlikely(((PyObject *)__pyx_v_format) == Py_None)) {
4763 PyErr_Format(PyExc_TypeError,
"Argument '%.200s' must not be None",
"format"); __PYX_ERR(1, 147, __pyx_L1_error)
4765 __pyx_r = __pyx_array___pyx_pf_15View_dot_MemoryView_5array___cinit__(((
struct __pyx_array_obj *)__pyx_v_self), __pyx_v_shape, __pyx_v_itemsize, __pyx_v_format, __pyx_v_mode, __pyx_v_allocate_buffer);
4779 for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(
sizeof(values)/
sizeof(values[0])); ++__pyx_temp) {
4780 Py_XDECREF(values[__pyx_temp]);
4782 goto __pyx_L7_cleaned_up;
4784 for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(
sizeof(values)/
sizeof(values[0])); ++__pyx_temp) {
4785 Py_XDECREF(values[__pyx_temp]);
4787 __pyx_L7_cleaned_up:;
4790 __Pyx_RefNannyFinishContext();
4794static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array___cinit__(
struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_shape, Py_ssize_t __pyx_v_itemsize, PyObject *__pyx_v_format, PyObject *__pyx_v_mode,
int __pyx_v_allocate_buffer) {
4796 Py_ssize_t __pyx_v_dim;
4799 __Pyx_RefNannyDeclarations
4800 Py_ssize_t __pyx_t_1;
4804 PyObject *__pyx_t_5 = NULL;
4805 PyObject *__pyx_t_6 = NULL;
4808 Py_ssize_t __pyx_t_9;
4809 PyObject *__pyx_t_10 = NULL;
4810 PyObject *__pyx_t_11[5];
4812 PyObject *__pyx_t_13 = NULL;
4813 int __pyx_lineno = 0;
4814 const char *__pyx_filename = NULL;
4815 int __pyx_clineno = 0;
4816 __Pyx_RefNannySetupContext(
"__cinit__", 0);
4817 __Pyx_INCREF(__pyx_v_format);
4826 if (unlikely(__pyx_v_shape == Py_None)) {
4827 PyErr_SetString(PyExc_TypeError,
"object of type \047NoneType\047 has no len()");
4828 __PYX_ERR(1, 153, __pyx_L1_error)
4830 __pyx_t_1 = __Pyx_PyTuple_GET_SIZE(__pyx_v_shape);
if (unlikely(__pyx_t_1 == ((Py_ssize_t)-1))) __PYX_ERR(1, 153, __pyx_L1_error)
4831 __pyx_v_self->ndim = ((int)__pyx_t_1);
4841 __pyx_v_self->itemsize = __pyx_v_itemsize;
4850 __pyx_t_2 = (!(__pyx_v_self->ndim != 0));
4852 if (unlikely(__pyx_t_2)) {
4862 __pyx_t_3 = __pyx_memoryview_err_ValueError(__pyx_k_Empty_shape_tuple_for_cython_arr);
if (unlikely(__pyx_t_3 == ((
int)-1))) __PYX_ERR(1, 157, __pyx_L1_error)
4881 __pyx_t_2 = (__pyx_v_itemsize <= 0);
4883 if (unlikely(__pyx_t_2)) {
4893 __pyx_t_3 = __pyx_memoryview_err_ValueError(__pyx_k_itemsize_0_for_cython_array);
if (unlikely(__pyx_t_3 == ((
int)-1))) __PYX_ERR(1, 160, __pyx_L1_error)
4912 __pyx_t_2 = PyBytes_Check(__pyx_v_format);
4913 __pyx_t_4 = (!__pyx_t_2);
4926 __pyx_t_6 = __pyx_v_format;
4927 __Pyx_INCREF(__pyx_t_6);
4930 PyObject *__pyx_callargs[2] = {__pyx_t_6, __pyx_mstate_global->__pyx_n_u_ASCII};
4931 __pyx_t_5 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_encode, __pyx_callargs+__pyx_t_7, (2-__pyx_t_7) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
4932 __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
4933 if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 163, __pyx_L1_error)
4934 __Pyx_GOTREF(__pyx_t_5);
4936 __Pyx_DECREF_SET(__pyx_v_format, __pyx_t_5);
4955 __pyx_t_5 = __pyx_v_format;
4956 __Pyx_INCREF(__pyx_t_5);
4957 if (!(likely(PyBytes_CheckExact(__pyx_t_5))||((__pyx_t_5) == Py_None) || __Pyx_RaiseUnexpectedTypeError(
"bytes", __pyx_t_5))) __PYX_ERR(1, 164, __pyx_L1_error)
4958 __Pyx_GIVEREF(__pyx_t_5);
4959 __Pyx_GOTREF(__pyx_v_self->_format);
4960 __Pyx_DECREF(__pyx_v_self->_format);
4961 __pyx_v_self->_format = ((PyObject*)__pyx_t_5);
4971 if (unlikely(__pyx_v_self->_format == Py_None)) {
4972 PyErr_SetString(PyExc_TypeError,
"expected bytes, NoneType found");
4973 __PYX_ERR(1, 165, __pyx_L1_error)
4975 __pyx_t_8 = __Pyx_PyBytes_AsWritableString(__pyx_v_self->_format);
if (unlikely((!__pyx_t_8) && PyErr_Occurred())) __PYX_ERR(1, 165, __pyx_L1_error)
4976 __pyx_v_self->format = __pyx_t_8;
4985 __pyx_v_self->_shape = ((Py_ssize_t *)PyObject_Malloc((((
sizeof(Py_ssize_t)) * 2) * ((
size_t)__pyx_v_self->ndim))));
4994 __pyx_v_self->_strides = (__pyx_v_self->_shape + __pyx_v_self->ndim);
5003 __pyx_t_4 = (!(__pyx_v_self->_shape != 0));
5005 if (unlikely(__pyx_t_4)) {
5015 __Pyx_Raise(((PyObject *)(((PyTypeObject*)PyExc_MemoryError))), __pyx_mstate_global->__pyx_kp_u_unable_to_allocate_shape_and_str, 0, 0);
5016 __PYX_ERR(1, 172, __pyx_L1_error)
5036 __pyx_t_5 = __pyx_v_shape; __Pyx_INCREF(__pyx_t_5);
5040 Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_5);
5041 #if !CYTHON_ASSUME_SAFE_SIZE
5042 if (unlikely((__pyx_temp < 0))) __PYX_ERR(1, 175, __pyx_L1_error)
5044 if (__pyx_t_1 >= __pyx_temp)
break;
5046 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
5047 __pyx_t_6 = __Pyx_NewRef(PyTuple_GET_ITEM(__pyx_t_5, __pyx_t_1));
5049 __pyx_t_6 = __Pyx_PySequence_ITEM(__pyx_t_5, __pyx_t_1);
5052 if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 175, __pyx_L1_error)
5053 __Pyx_GOTREF(__pyx_t_6);
5054 __pyx_t_9 = __Pyx_PyIndex_AsSsize_t(__pyx_t_6);
if (unlikely((__pyx_t_9 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(1, 175, __pyx_L1_error)
5055 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
5056 __pyx_v_dim = __pyx_t_9;
5057 __pyx_v_idx = __pyx_t_3;
5058 __pyx_t_3 = (__pyx_t_3 + 1);
5067 __pyx_t_4 = (__pyx_v_dim <= 0);
5069 if (unlikely(__pyx_t_4)) {
5079 __pyx_t_6 = __Pyx_PyUnicode_From_int(__pyx_v_idx, 0,
' ',
'd');
if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 177, __pyx_L1_error)
5080 __Pyx_GOTREF(__pyx_t_6);
5081 __pyx_t_10 = __Pyx_PyUnicode_From_Py_ssize_t(__pyx_v_dim, 0,
' ',
'd');
if (unlikely(!__pyx_t_10)) __PYX_ERR(1, 177, __pyx_L1_error)
5082 __Pyx_GOTREF(__pyx_t_10);
5083 __pyx_t_11[0] = __pyx_mstate_global->__pyx_kp_u_Invalid_shape_in_axis;
5084 __pyx_t_11[1] = __pyx_t_6;
5085 __pyx_t_11[2] = __pyx_mstate_global->__pyx_kp_u__2;
5086 __pyx_t_11[3] = __pyx_t_10;
5087 __pyx_t_11[4] = __pyx_mstate_global->__pyx_kp_u__3;
5089 #if __Pyx_PyUnicode_Join_CAN_USE_KIND_AND_LENGTH
5090 __pyx_t_9 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_11[1]) + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_11[3]);
5093 __pyx_t_13 = __Pyx_PyUnicode_Join(__pyx_t_11, 5, __pyx_t_9, __pyx_t_12);
5094 if (unlikely(!__pyx_t_13)) __PYX_ERR(1, 177, __pyx_L1_error)
5095 __Pyx_GOTREF(__pyx_t_13);
5096 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
5097 __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
5098 __Pyx_Raise(((PyObject *)(((PyTypeObject*)PyExc_ValueError))), __pyx_t_13, 0, 0);
5099 __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
5100 __PYX_ERR(1, 177, __pyx_L1_error)
5118 (__pyx_v_self->_shape[__pyx_v_idx]) = __pyx_v_dim;
5128 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
5137 __pyx_t_4 = (__Pyx_PyObject_Equals_obj_ch99(__pyx_v_mode, __pyx_mstate_global->__pyx_n_u_c, Py_EQ));
if (unlikely((__pyx_t_4 < 0))) __PYX_ERR(1, 181, __pyx_L1_error)
5148 __pyx_v_order =
'C';
5157 __Pyx_INCREF(__pyx_mstate_global->__pyx_n_u_c);
5158 __Pyx_GIVEREF(__pyx_mstate_global->__pyx_n_u_c);
5159 __Pyx_GOTREF(__pyx_v_self->mode);
5160 __Pyx_DECREF(__pyx_v_self->mode);
5161 __pyx_v_self->mode = __pyx_mstate_global->__pyx_n_u_c;
5180 __pyx_t_4 = __Pyx_PyObject_CompareBoolEq_object_str(__pyx_v_mode, __pyx_mstate_global->__pyx_n_u_fortran, Py_EQ);
if (unlikely((__pyx_t_4 < 0))) __PYX_ERR(1, 184, __pyx_L1_error)
5181 if (likely(__pyx_t_4)) {
5191 __pyx_v_order =
'F';
5200 __Pyx_INCREF(__pyx_mstate_global->__pyx_n_u_fortran);
5201 __Pyx_GIVEREF(__pyx_mstate_global->__pyx_n_u_fortran);
5202 __Pyx_GOTREF(__pyx_v_self->mode);
5203 __Pyx_DECREF(__pyx_v_self->mode);
5204 __pyx_v_self->mode = __pyx_mstate_global->__pyx_n_u_fortran;
5224 __pyx_t_5 = __Pyx_PyObject_FormatSimple(__pyx_v_mode, __pyx_mstate_global->__pyx_empty_unicode);
if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 188, __pyx_L1_error)
5225 __Pyx_GOTREF(__pyx_t_5);
5226 __pyx_t_13 = __Pyx_PyUnicode_Concat(__pyx_mstate_global->__pyx_kp_u_Invalid_mode_expected_c_or_fortr, __pyx_t_5);
if (unlikely(!__pyx_t_13)) __PYX_ERR(1, 188, __pyx_L1_error)
5227 __Pyx_GOTREF(__pyx_t_13);
5228 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
5229 __Pyx_Raise(((PyObject *)(((PyTypeObject*)PyExc_ValueError))), __pyx_t_13, 0, 0);
5230 __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
5231 __PYX_ERR(1, 188, __pyx_L1_error)
5242 __pyx_v_self->len = __pyx_fill_contig_strides_array(__pyx_v_self->_shape, __pyx_v_self->_strides, __pyx_v_itemsize, __pyx_v_self->ndim, __pyx_v_order);
5251 __pyx_v_self->free_data = __pyx_v_allocate_buffer;
5260 __pyx_t_13 = __Pyx_PyObject_CompareEq_object_bytes(__pyx_v_format, __pyx_mstate_global->__pyx_n_b_O, Py_EQ); __Pyx_XGOTREF(__pyx_t_13);
if (unlikely(!__pyx_t_13)) __PYX_ERR(1, 193, __pyx_L1_error)
5261 __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_13);
if (unlikely((__pyx_t_4 == (
int)-1) && PyErr_Occurred())) __PYX_ERR(1, 193, __pyx_L1_error)
5262 __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
5263 __pyx_v_self->dtype_is_object = __pyx_t_4;
5272 if (__pyx_v_allocate_buffer) {
5281 __pyx_t_3 = __pyx_array_allocate_buffer(__pyx_v_self);
if (unlikely(__pyx_t_3 == ((
int)-1))) __PYX_ERR(1, 196, __pyx_L1_error)
5305 __Pyx_XDECREF(__pyx_t_5);
5306 __Pyx_XDECREF(__pyx_t_6);
5307 __Pyx_XDECREF(__pyx_t_10);
5308 __Pyx_XDECREF(__pyx_t_13);
5309 __Pyx_AddTraceback(
"View.MemoryView.array.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
5315 __Pyx_XDECREF(__pyx_v_format);
5317 __Pyx_RefNannyFinishContext();
5330CYTHON_UNUSED
static int __pyx_array_getbuffer(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info,
int __pyx_v_flags);
5331CYTHON_UNUSED
static int __pyx_array_getbuffer(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info,
int __pyx_v_flags) {
5332 CYTHON_UNUSED PyObject *
const *__pyx_kwvalues;
5334 __Pyx_RefNannyDeclarations
5335 __Pyx_RefNannySetupContext(
"__getbuffer__ (wrapper)", 0);
5336 __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
5337 __pyx_r = __pyx_array___pyx_pf_15View_dot_MemoryView_5array_2__getbuffer__(((
struct __pyx_array_obj *)__pyx_v_self), ((Py_buffer *)__pyx_v_info), ((
int)__pyx_v_flags));
5342 __Pyx_RefNannyFinishContext();
5346static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array_2__getbuffer__(
struct __pyx_array_obj *__pyx_v_self, Py_buffer *__pyx_v_info,
int __pyx_v_flags) {
5347 int __pyx_v_bufmode;
5349 __Pyx_RefNannyDeclarations
5353 Py_ssize_t __pyx_t_4;
5354 Py_ssize_t *__pyx_t_5;
5355 int __pyx_lineno = 0;
5356 const char *__pyx_filename = NULL;
5357 int __pyx_clineno = 0;
5358 if (unlikely(__pyx_v_info == NULL)) {
5359 PyErr_SetString(PyExc_BufferError,
"PyObject_GetBuffer: view==NULL argument is obsolete");
5362 __Pyx_RefNannySetupContext(
"__getbuffer__", 0);
5363 __pyx_v_info->obj = Py_None; __Pyx_INCREF(Py_None);
5364 __Pyx_GIVEREF(__pyx_v_info->obj);
5373 __pyx_v_bufmode = -1;
5382 __pyx_t_1 = ((__pyx_v_flags & ((PyBUF_C_CONTIGUOUS | PyBUF_F_CONTIGUOUS) | PyBUF_ANY_CONTIGUOUS)) != 0);
5394 __pyx_t_1 = (__Pyx_PyObject_Equals_str_ch99(__pyx_v_self->mode, __pyx_mstate_global->__pyx_n_u_c, Py_EQ));
if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(1, 202, __pyx_L1_error)
5405 __pyx_v_bufmode = (PyBUF_C_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS);
5424 __pyx_t_1 = __Pyx_PyObject_CompareBoolEq_str_str(__pyx_v_self->mode, __pyx_mstate_global->__pyx_n_u_fortran, Py_EQ);
if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(1, 204, __pyx_L1_error)
5435 __pyx_v_bufmode = (PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS);
5454 __pyx_t_1 = (!((__pyx_v_flags & __pyx_v_bufmode) != 0));
5456 if (unlikely(__pyx_t_1)) {
5466 __pyx_t_2 = __pyx_memoryview_err_ValueError(__pyx_k_Can_only_create_a_buffer_that_is);
if (unlikely(__pyx_t_2 == ((
int)-1))) __PYX_ERR(1, 207, __pyx_L1_error)
5494 __pyx_t_3 = __pyx_v_self->data;
5496 __pyx_v_info->buf = __pyx_t_3;
5505 __pyx_t_4 = __pyx_v_self->len;
5507 __pyx_v_info->len = __pyx_t_4;
5516 __pyx_t_1 = ((__pyx_v_flags & PyBUF_STRIDES) != 0);
5528 __pyx_t_2 = __pyx_v_self->ndim;
5530 __pyx_v_info->ndim = __pyx_t_2;
5539 __pyx_t_5 = __pyx_v_self->_shape;
5541 __pyx_v_info->shape = __pyx_t_5;
5550 __pyx_t_5 = __pyx_v_self->_strides;
5552 __pyx_v_info->strides = __pyx_t_5;
5572 __pyx_v_info->ndim = 1;
5581 __pyx_t_1 = ((__pyx_v_flags & PyBUF_ND) != 0);
5585 __pyx_t_5 = (&__pyx_v_self->len);
5591 __pyx_v_info->shape = __pyx_t_5;
5600 __pyx_v_info->strides = NULL;
5611 __pyx_v_info->suboffsets = NULL;
5620 __pyx_t_4 = __pyx_v_self->itemsize;
5622 __pyx_v_info->itemsize = __pyx_t_4;
5631 __pyx_v_info->readonly = 0;
5640 __pyx_t_1 = ((__pyx_v_flags & PyBUF_FORMAT) != 0);
5644 __pyx_t_3 = __pyx_v_self->format;
5650 __pyx_v_info->format = __pyx_t_3;
5659 __Pyx_INCREF((PyObject *)__pyx_v_self);
5660 __Pyx_GIVEREF((PyObject *)__pyx_v_self);
5661 __Pyx_GOTREF(__pyx_v_info->obj);
5662 __Pyx_DECREF(__pyx_v_info->obj);
5663 __pyx_v_info->obj = ((PyObject *)__pyx_v_self);
5677 __Pyx_AddTraceback(
"View.MemoryView.array.__getbuffer__", __pyx_clineno, __pyx_lineno, __pyx_filename);
5679 if (__pyx_v_info->obj != NULL) {
5680 __Pyx_GOTREF(__pyx_v_info->obj);
5681 __Pyx_DECREF(__pyx_v_info->obj); __pyx_v_info->obj = 0;
5685 if (__pyx_v_info->obj == Py_None) {
5686 __Pyx_GOTREF(__pyx_v_info->obj);
5687 __Pyx_DECREF(__pyx_v_info->obj); __pyx_v_info->obj = 0;
5692 __Pyx_RefNannyFinishContext();
5705static void __pyx_array___dealloc__(PyObject *__pyx_v_self);
5706static void __pyx_array___dealloc__(PyObject *__pyx_v_self) {
5707 CYTHON_UNUSED PyObject *
const *__pyx_kwvalues;
5708 __Pyx_RefNannyDeclarations
5709 __Pyx_RefNannySetupContext(
"__dealloc__ (wrapper)", 0);
5710 __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
5711 __pyx_array___pyx_pf_15View_dot_MemoryView_5array_4__dealloc__(((
struct __pyx_array_obj *)__pyx_v_self));
5714 __Pyx_RefNannyFinishContext();
5717static void __pyx_array___pyx_pf_15View_dot_MemoryView_5array_4__dealloc__(
struct __pyx_array_obj *__pyx_v_self) {
5728 __pyx_t_1 = (__pyx_v_self->callback_free_data != NULL);
5740 __pyx_v_self->callback_free_data(__pyx_v_self->data);
5759 if (__pyx_v_self->free_data) {
5762 __pyx_t_1 = __pyx_v_self->free_data;
5763 goto __pyx_L4_bool_binop_done;
5765 __pyx_t_2 = (__pyx_v_self->data != NULL);
5768 __pyx_t_1 = __pyx_t_2;
5770 __pyx_L4_bool_binop_done:;
5781 if (__pyx_v_self->dtype_is_object) {
5790 __pyx_memoryview_refcount_objects_in_slice(__pyx_v_self->data, __pyx_v_self->_shape, __pyx_v_self->_strides, __pyx_v_self->ndim, 0);
5808 free(__pyx_v_self->data);
5827 PyObject_Free(__pyx_v_self->_shape);
5850static PyObject *__pyx_pw_15View_dot_MemoryView_5array_7memview_1__get__(PyObject *__pyx_v_self);
5851static PyObject *__pyx_pw_15View_dot_MemoryView_5array_7memview_1__get__(PyObject *__pyx_v_self) {
5852 CYTHON_UNUSED PyObject *
const *__pyx_kwvalues;
5853 PyObject *__pyx_r = 0;
5854 __Pyx_RefNannyDeclarations
5855 __Pyx_RefNannySetupContext(
"__get__ (wrapper)", 0);
5856 __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
5857 __pyx_r = __pyx_pf_15View_dot_MemoryView_5array_7memview___get__(((
struct __pyx_array_obj *)__pyx_v_self));
5860 __Pyx_RefNannyFinishContext();
5864static PyObject *__pyx_pf_15View_dot_MemoryView_5array_7memview___get__(
struct __pyx_array_obj *__pyx_v_self) {
5865 PyObject *__pyx_r = NULL;
5866 __Pyx_RefNannyDeclarations
5867 PyObject *__pyx_t_1 = NULL;
5868 int __pyx_lineno = 0;
5869 const char *__pyx_filename = NULL;
5870 int __pyx_clineno = 0;
5871 __Pyx_RefNannySetupContext(
"__get__", 0);
5880 __pyx_t_1 = __pyx_array_get_memview(__pyx_v_self);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 237, __pyx_L1_error)
5881 __Pyx_GOTREF(__pyx_t_1);
5883 PyObject *__pyx_temp;
5885 __pyx_temp = __pyx_r;
5886 __pyx_r = __pyx_t_1;
5888 __Pyx_XDECREF(__pyx_temp);
5903 __Pyx_XDECREF(__pyx_t_1);
5904 __Pyx_AddTraceback(
"View.MemoryView.array.memview.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
5907 __Pyx_XGIVEREF(__pyx_r);
5908 __Pyx_RefNannyFinishContext();
5920static PyObject *__pyx_array_get_memview(
struct __pyx_array_obj *__pyx_v_self) {
5922 PyObject *__pyx_r = NULL;
5923 __Pyx_RefNannyDeclarations
5924 PyObject *__pyx_t_1 = NULL;
5925 PyObject *__pyx_t_2 = NULL;
5926 PyObject *__pyx_t_3 = NULL;
5927 PyObject *__pyx_t_4 = NULL;
5929 int __pyx_lineno = 0;
5930 const char *__pyx_filename = NULL;
5931 int __pyx_clineno = 0;
5932 __Pyx_RefNannySetupContext(
"get_memview", 0);
5941 __pyx_v_flags = ((PyBUF_ANY_CONTIGUOUS | PyBUF_FORMAT) | PyBUF_WRITABLE);
5951 __pyx_t_3 = __Pyx_PyLong_From_int(__pyx_v_flags);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 243, __pyx_L1_error)
5952 __Pyx_GOTREF(__pyx_t_3);
5953 __pyx_t_4 = __Pyx_PyBool_FromLong(__pyx_v_self->dtype_is_object);
if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 243, __pyx_L1_error)
5954 __Pyx_GOTREF(__pyx_t_4);
5957 PyObject *__pyx_callargs[4] = {__pyx_t_2, ((PyObject *)__pyx_v_self), __pyx_t_3, __pyx_t_4};
5958 __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_mstate_global->__pyx_memoryview_type, __pyx_callargs+__pyx_t_5, (4-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
5959 __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
5960 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
5961 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
5962 if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 243, __pyx_L1_error)
5963 __Pyx_GOTREF((PyObject *)__pyx_t_1);
5966 PyObject *__pyx_temp;
5968 __pyx_temp = __pyx_r;
5969 __pyx_r = ((PyObject *)__pyx_t_1);
5971 __Pyx_XDECREF(__pyx_temp);
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_AddTraceback(
"View.MemoryView.array.get_memview", __pyx_clineno, __pyx_lineno, __pyx_filename);
5994 __Pyx_XGIVEREF(__pyx_r);
5995 __Pyx_RefNannyFinishContext();
6008static Py_ssize_t __pyx_array___len__(PyObject *__pyx_v_self);
6009static Py_ssize_t __pyx_array___len__(PyObject *__pyx_v_self) {
6010 CYTHON_UNUSED PyObject *
const *__pyx_kwvalues;
6012 __Pyx_RefNannyDeclarations
6013 __Pyx_RefNannySetupContext(
"__len__ (wrapper)", 0);
6014 __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
6015 __pyx_r = __pyx_array___pyx_pf_15View_dot_MemoryView_5array_6__len__(((
struct __pyx_array_obj *)__pyx_v_self));
6018 __Pyx_RefNannyFinishContext();
6022static Py_ssize_t __pyx_array___pyx_pf_15View_dot_MemoryView_5array_6__len__(
struct __pyx_array_obj *__pyx_v_self) {
6034 __pyx_r = (__pyx_v_self->_shape[0]);
6061static PyObject *__pyx_array___getattr__(PyObject *__pyx_v_self, PyObject *__pyx_v_attr);
6062static PyObject *__pyx_array___getattr__(PyObject *__pyx_v_self, PyObject *__pyx_v_attr) {
6063 CYTHON_UNUSED PyObject *
const *__pyx_kwvalues;
6064 PyObject *__pyx_r = 0;
6065 __Pyx_RefNannyDeclarations
6066 __Pyx_RefNannySetupContext(
"__getattr__ (wrapper)", 0);
6067 __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
6068 __pyx_r = __pyx_array___pyx_pf_15View_dot_MemoryView_5array_8__getattr__(((
struct __pyx_array_obj *)__pyx_v_self), ((PyObject *)__pyx_v_attr));
6071 __Pyx_RefNannyFinishContext();
6075static PyObject *__pyx_array___pyx_pf_15View_dot_MemoryView_5array_8__getattr__(
struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_attr) {
6076 PyObject *__pyx_r = NULL;
6077 __Pyx_RefNannyDeclarations
6078 PyObject *__pyx_t_1 = NULL;
6079 PyObject *__pyx_t_2 = NULL;
6080 int __pyx_lineno = 0;
6081 const char *__pyx_filename = NULL;
6082 int __pyx_clineno = 0;
6083 __Pyx_RefNannySetupContext(
"__getattr__", 0);
6092 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_mstate_global->__pyx_n_u_memview);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 249, __pyx_L1_error)
6093 __Pyx_GOTREF(__pyx_t_1);
6094 __pyx_t_2 = __Pyx_GetAttr(__pyx_t_1, __pyx_v_attr);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 249, __pyx_L1_error)
6095 __Pyx_GOTREF(__pyx_t_2);
6096 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
6098 PyObject *__pyx_temp;
6100 __pyx_temp = __pyx_r;
6101 __pyx_r = __pyx_t_2;
6103 __Pyx_XDECREF(__pyx_temp);
6118 __Pyx_XDECREF(__pyx_t_1);
6119 __Pyx_XDECREF(__pyx_t_2);
6120 __Pyx_AddTraceback(
"View.MemoryView.array.__getattr__", __pyx_clineno, __pyx_lineno, __pyx_filename);
6123 __Pyx_XGIVEREF(__pyx_r);
6124 __Pyx_RefNannyFinishContext();
6137static PyObject *__pyx_array___getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_item);
6138static PyObject *__pyx_array___getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_item) {
6139 CYTHON_UNUSED PyObject *
const *__pyx_kwvalues;
6140 PyObject *__pyx_r = 0;
6141 __Pyx_RefNannyDeclarations
6142 __Pyx_RefNannySetupContext(
"__getitem__ (wrapper)", 0);
6143 __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
6144 __pyx_r = __pyx_array___pyx_pf_15View_dot_MemoryView_5array_10__getitem__(((
struct __pyx_array_obj *)__pyx_v_self), ((PyObject *)__pyx_v_item));
6147 __Pyx_RefNannyFinishContext();
6151static PyObject *__pyx_array___pyx_pf_15View_dot_MemoryView_5array_10__getitem__(
struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_item) {
6152 PyObject *__pyx_r = NULL;
6153 __Pyx_RefNannyDeclarations
6154 PyObject *__pyx_t_1 = NULL;
6155 PyObject *__pyx_t_2 = NULL;
6156 int __pyx_lineno = 0;
6157 const char *__pyx_filename = NULL;
6158 int __pyx_clineno = 0;
6159 __Pyx_RefNannySetupContext(
"__getitem__", 0);
6168 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_mstate_global->__pyx_n_u_memview);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 252, __pyx_L1_error)
6169 __Pyx_GOTREF(__pyx_t_1);
6170 __pyx_t_2 = __Pyx_PyObject_GetItem(__pyx_t_1, __pyx_v_item);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 252, __pyx_L1_error)
6171 __Pyx_GOTREF(__pyx_t_2);
6172 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
6174 PyObject *__pyx_temp;
6176 __pyx_temp = __pyx_r;
6177 __pyx_r = __pyx_t_2;
6179 __Pyx_XDECREF(__pyx_temp);
6194 __Pyx_XDECREF(__pyx_t_1);
6195 __Pyx_XDECREF(__pyx_t_2);
6196 __Pyx_AddTraceback(
"View.MemoryView.array.__getitem__", __pyx_clineno, __pyx_lineno, __pyx_filename);
6199 __Pyx_XGIVEREF(__pyx_r);
6200 __Pyx_RefNannyFinishContext();
6213static int __pyx_array___setitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_item, PyObject *__pyx_v_value);
6214static int __pyx_array___setitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_item, PyObject *__pyx_v_value) {
6215 CYTHON_UNUSED PyObject *
const *__pyx_kwvalues;
6217 __Pyx_RefNannyDeclarations
6218 __Pyx_RefNannySetupContext(
"__setitem__ (wrapper)", 0);
6219 __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
6220 __pyx_r = __pyx_array___pyx_pf_15View_dot_MemoryView_5array_12__setitem__(((
struct __pyx_array_obj *)__pyx_v_self), ((PyObject *)__pyx_v_item), ((PyObject *)__pyx_v_value));
6223 __Pyx_RefNannyFinishContext();
6227static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array_12__setitem__(
struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_item, PyObject *__pyx_v_value) {
6229 __Pyx_RefNannyDeclarations
6230 PyObject *__pyx_t_1 = NULL;
6231 int __pyx_lineno = 0;
6232 const char *__pyx_filename = NULL;
6233 int __pyx_clineno = 0;
6234 __Pyx_RefNannySetupContext(
"__setitem__", 0);
6243 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_mstate_global->__pyx_n_u_memview);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 255, __pyx_L1_error)
6244 __Pyx_GOTREF(__pyx_t_1);
6245 if (unlikely((PyObject_SetItem(__pyx_t_1, __pyx_v_item, __pyx_v_value) < 0))) __PYX_ERR(1, 255, __pyx_L1_error)
6246 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
6260 __Pyx_XDECREF(__pyx_t_1);
6261 __Pyx_AddTraceback(
"View.MemoryView.array.__setitem__", __pyx_clineno, __pyx_lineno, __pyx_filename);
6265 __Pyx_RefNannyFinishContext();
6276static PyObject *__pyx_pw___pyx_array_1__reduce_cython__(PyObject *__pyx_v_self,
6277#
if CYTHON_VECTORCALL
6278PyObject *
const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
6280PyObject *__pyx_args, PyObject *__pyx_kwds
6283static PyObject *__pyx_pw___pyx_array_1__reduce_cython__(PyObject *__pyx_v_self,
6284#
if CYTHON_VECTORCALL
6285PyObject *
const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
6287PyObject *__pyx_args, PyObject *__pyx_kwds
6290 #if !CYTHON_VECTORCALL
6291 CYTHON_UNUSED Py_ssize_t __pyx_nargs;
6293 CYTHON_UNUSED PyObject *
const *__pyx_kwvalues;
6294 PyObject *__pyx_r = 0;
6295 __Pyx_RefNannyDeclarations
6296 __Pyx_RefNannySetupContext(
"__reduce_cython__ (wrapper)", 0);
6297 #if !CYTHON_VECTORCALL
6298 #if CYTHON_ASSUME_SAFE_SIZE
6299 __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
6301 __pyx_nargs = PyTuple_Size(__pyx_args);
if (unlikely(__pyx_nargs < 0))
return NULL;
6304 __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
6305 if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid(
"__reduce_cython__", 1, 0, 0, __pyx_nargs);
return NULL; }
6306 const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
6307 if (unlikely(__pyx_kwds_len < 0))
return NULL;
6308 if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords(
"__reduce_cython__", __pyx_kwds);
return NULL;}
6309 __pyx_r = __pyx_pf___pyx_array___reduce_cython__(((
struct __pyx_array_obj *)__pyx_v_self));
6312 __Pyx_RefNannyFinishContext();
6316static PyObject *__pyx_pf___pyx_array___reduce_cython__(CYTHON_UNUSED
struct __pyx_array_obj *__pyx_v_self) {
6317 PyObject *__pyx_r = NULL;
6318 __Pyx_RefNannyDeclarations
6319 int __pyx_lineno = 0;
6320 const char *__pyx_filename = NULL;
6321 int __pyx_clineno = 0;
6322 __Pyx_RefNannySetupContext(
"__reduce_cython__", 0);
6330 __Pyx_Raise(((PyObject *)(((PyTypeObject*)PyExc_TypeError))), __pyx_mstate_global->__pyx_kp_u_no_default___reduce___due_to_non, 0, 0);
6331 __PYX_ERR(1, 2, __pyx_L1_error)
6341 __Pyx_AddTraceback(
"View.MemoryView.array.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
6343 __Pyx_XGIVEREF(__pyx_r);
6344 __Pyx_RefNannyFinishContext();
6356static PyObject *__pyx_pw___pyx_array_3__setstate_cython__(PyObject *__pyx_v_self,
6357#
if CYTHON_VECTORCALL
6358PyObject *
const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
6360PyObject *__pyx_args, PyObject *__pyx_kwds
6363static PyObject *__pyx_pw___pyx_array_3__setstate_cython__(PyObject *__pyx_v_self,
6364#
if CYTHON_VECTORCALL
6365PyObject *
const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
6367PyObject *__pyx_args, PyObject *__pyx_kwds
6370 CYTHON_UNUSED PyObject *__pyx_v___pyx_state = 0;
6371 #if !CYTHON_VECTORCALL
6372 CYTHON_UNUSED Py_ssize_t __pyx_nargs;
6374 CYTHON_UNUSED PyObject *
const *__pyx_kwvalues;
6375 PyObject* values[1] = {0};
6376 int __pyx_lineno = 0;
6377 const char *__pyx_filename = NULL;
6378 int __pyx_clineno = 0;
6379 PyObject *__pyx_r = 0;
6380 __Pyx_RefNannyDeclarations
6381 __Pyx_RefNannySetupContext(
"__setstate_cython__ (wrapper)", 0);
6382 #if !CYTHON_VECTORCALL
6383 #if CYTHON_ASSUME_SAFE_SIZE
6384 __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
6386 __pyx_nargs = PyTuple_Size(__pyx_args);
if (unlikely(__pyx_nargs < 0))
return NULL;
6389 __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
6391 PyObject **
const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_pyx_state,0};
6392 const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
6393 if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(1, 3, __pyx_L3_error)
6394 if (__pyx_kwds_len > 0) {
6395 switch (__pyx_nargs) {
6397 values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
6398 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(1, 3, __pyx_L3_error)
6401 default:
goto __pyx_L5_argtuple_error;
6403 const Py_ssize_t kwd_pos_args = __pyx_nargs;
6404 if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len,
"__setstate_cython__", 0) < (0)) __PYX_ERR(1, 3, __pyx_L3_error)
6405 for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
6406 if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid(
"__setstate_cython__", 1, 1, 1, i); __PYX_ERR(1, 3, __pyx_L3_error) }
6408 }
else if (unlikely(__pyx_nargs != 1)) {
6409 goto __pyx_L5_argtuple_error;
6411 values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
6412 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(1, 3, __pyx_L3_error)
6414 __pyx_v___pyx_state = values[0];
6417 __pyx_L5_argtuple_error:;
6418 __Pyx_RaiseArgtupleInvalid(
"__setstate_cython__", 1, 1, 1, __pyx_nargs); __PYX_ERR(1, 3, __pyx_L3_error)
6420 goto __pyx_L4_argument_unpacking_done;
6422 for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(
sizeof(values)/
sizeof(values[0])); ++__pyx_temp) {
6423 Py_XDECREF(values[__pyx_temp]);
6425 __Pyx_AddTraceback(
"View.MemoryView.array.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
6426 __Pyx_RefNannyFinishContext();
6428 __pyx_L4_argument_unpacking_done:;
6429 __pyx_r = __pyx_pf___pyx_array_2__setstate_cython__(((
struct __pyx_array_obj *)__pyx_v_self), __pyx_v___pyx_state);
6432 for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(
sizeof(values)/
sizeof(values[0])); ++__pyx_temp) {
6433 Py_XDECREF(values[__pyx_temp]);
6435 __Pyx_RefNannyFinishContext();
6439static PyObject *__pyx_pf___pyx_array_2__setstate_cython__(CYTHON_UNUSED
struct __pyx_array_obj *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) {
6440 PyObject *__pyx_r = NULL;
6441 __Pyx_RefNannyDeclarations
6442 int __pyx_lineno = 0;
6443 const char *__pyx_filename = NULL;
6444 int __pyx_clineno = 0;
6445 __Pyx_RefNannySetupContext(
"__setstate_cython__", 0);
6452 __Pyx_Raise(((PyObject *)(((PyTypeObject*)PyExc_TypeError))), __pyx_mstate_global->__pyx_kp_u_no_default___reduce___due_to_non, 0, 0);
6453 __PYX_ERR(1, 4, __pyx_L1_error)
6464 __Pyx_AddTraceback(
"View.MemoryView.array.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
6466 __Pyx_XGIVEREF(__pyx_r);
6467 __Pyx_RefNannyFinishContext();
6479static int __pyx_array_allocate_buffer(
struct __pyx_array_obj *__pyx_v_self) {
6480 Py_ssize_t __pyx_v_i;
6481 PyObject **__pyx_v_p;
6484 Py_ssize_t __pyx_t_2;
6485 Py_ssize_t __pyx_t_3;
6486 Py_ssize_t __pyx_t_4;
6487 int __pyx_lineno = 0;
6488 const char *__pyx_filename = NULL;
6489 int __pyx_clineno = 0;
6498 __pyx_v_self->free_data = 1;
6507 __pyx_v_self->data = ((
char *)malloc(((
size_t)__pyx_v_self->len)));
6516 __pyx_t_1 = (!(__pyx_v_self->data != 0));
6518 if (unlikely(__pyx_t_1)) {
6528 __Pyx_Raise(((PyObject *)(((PyTypeObject*)PyExc_MemoryError))), __pyx_mstate_global->__pyx_kp_u_unable_to_allocate_array_data, 0, 0);
6529 __PYX_ERR(1, 274, __pyx_L1_error)
6547 if (__pyx_v_self->dtype_is_object) {
6556 __pyx_v_p = ((PyObject **)__pyx_v_self->data);
6565 if (unlikely(__pyx_v_self->itemsize == 0)) {
6566 PyErr_SetString(PyExc_ZeroDivisionError,
"integer division or modulo by zero");
6567 __PYX_ERR(1, 278, __pyx_L1_error)
6569 else if (
sizeof(Py_ssize_t) ==
sizeof(
long) && (!(((Py_ssize_t)-1) > 0)) && unlikely(__pyx_v_self->itemsize == (Py_ssize_t)-1) && unlikely(__Pyx_UNARY_NEG_WOULD_OVERFLOW(__pyx_v_self->len))) {
6570 PyErr_SetString(PyExc_OverflowError,
"value too large to perform division");
6571 __PYX_ERR(1, 278, __pyx_L1_error)
6574 __pyx_t_2 = __Pyx_div_Py_ssize_t(__pyx_v_self->len, __pyx_v_self->itemsize, 0);
6575 __pyx_t_3 = __pyx_t_2;
6577 for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
6578 __pyx_v_i = __pyx_t_4;
6587 (__pyx_v_p[__pyx_v_i]) = Py_None;
6632 __Pyx_AddTraceback(
"View.MemoryView._allocate_buffer", __pyx_clineno, __pyx_lineno, __pyx_filename);
6649static struct __pyx_array_obj *__pyx_array_new(PyObject *__pyx_v_shape, Py_ssize_t __pyx_v_itemsize,
char *__pyx_v_format,
char const *__pyx_v_c_mode,
char *__pyx_v_buf) {
6650 struct __pyx_array_obj *__pyx_v_result = 0;
6651 PyObject *__pyx_v_mode = 0;
6652 struct __pyx_array_obj *__pyx_r = NULL;
6653 __Pyx_RefNannyDeclarations
6654 PyObject *__pyx_t_1 = NULL;
6656 PyObject *__pyx_t_3 = NULL;
6657 PyObject *__pyx_t_4 = NULL;
6658 int __pyx_lineno = 0;
6659 const char *__pyx_filename = NULL;
6660 int __pyx_clineno = 0;
6661 __Pyx_RefNannySetupContext(
"array_cwrapper", 0);
6670 __pyx_t_2 = ((__pyx_v_c_mode[0]) ==
'f');
6673 __Pyx_INCREF(__pyx_mstate_global->__pyx_n_u_fortran);
6674 __pyx_t_1 = __pyx_mstate_global->__pyx_n_u_fortran;
6676 __Pyx_INCREF(__pyx_mstate_global->__pyx_n_u_c);
6677 __pyx_t_1 = __pyx_mstate_global->__pyx_n_u_c;
6680 __pyx_v_mode = ((PyObject*)__pyx_t_1);
6690 __pyx_t_2 = (__pyx_v_buf == NULL);
6702 __pyx_t_1 = PyLong_FromSsize_t(__pyx_v_itemsize);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 290, __pyx_L1_error)
6703 __Pyx_GOTREF(__pyx_t_1);
6704 __pyx_t_3 = __Pyx_PyBytes_FromString(__pyx_v_format);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 290, __pyx_L1_error)
6705 __Pyx_GOTREF(__pyx_t_3);
6706 __pyx_t_4 = PyTuple_New(4);
if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 290, __pyx_L1_error)
6707 __Pyx_GOTREF(__pyx_t_4);
6708 __Pyx_INCREF(__pyx_v_shape);
6709 __Pyx_GIVEREF(__pyx_v_shape);
6710 if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_shape) != (0)) __PYX_ERR(1, 290, __pyx_L1_error);
6711 __Pyx_GIVEREF(__pyx_t_1);
6712 if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_1) != (0)) __PYX_ERR(1, 290, __pyx_L1_error);
6713 __Pyx_GIVEREF(__pyx_t_3);
6714 if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_t_3) != (0)) __PYX_ERR(1, 290, __pyx_L1_error);
6715 __Pyx_INCREF(__pyx_v_mode);
6716 __Pyx_GIVEREF(__pyx_v_mode);
6717 if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 3, __pyx_v_mode) != (0)) __PYX_ERR(1, 290, __pyx_L1_error);
6720 __pyx_t_3 = ((PyObject *)__pyx_tp_new_array(((PyTypeObject *)__pyx_mstate_global->__pyx_array_type), __pyx_t_4, NULL));
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 290, __pyx_L1_error)
6721 __Pyx_GOTREF(__pyx_t_3);
6722 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
6723 __pyx_v_result = ((
struct __pyx_array_obj *)__pyx_t_3);
6744 __pyx_t_3 = PyLong_FromSsize_t(__pyx_v_itemsize);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 292, __pyx_L1_error)
6745 __Pyx_GOTREF(__pyx_t_3);
6746 __pyx_t_4 = __Pyx_PyBytes_FromString(__pyx_v_format);
if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 292, __pyx_L1_error)
6747 __Pyx_GOTREF(__pyx_t_4);
6748 __pyx_t_1 = PyTuple_New(4);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 292, __pyx_L1_error)
6749 __Pyx_GOTREF(__pyx_t_1);
6750 __Pyx_INCREF(__pyx_v_shape);
6751 __Pyx_GIVEREF(__pyx_v_shape);
6752 if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_shape) != (0)) __PYX_ERR(1, 292, __pyx_L1_error);
6753 __Pyx_GIVEREF(__pyx_t_3);
6754 if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_3) != (0)) __PYX_ERR(1, 292, __pyx_L1_error);
6755 __Pyx_GIVEREF(__pyx_t_4);
6756 if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_t_4) != (0)) __PYX_ERR(1, 292, __pyx_L1_error);
6757 __Pyx_INCREF(__pyx_v_mode);
6758 __Pyx_GIVEREF(__pyx_v_mode);
6759 if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 3, __pyx_v_mode) != (0)) __PYX_ERR(1, 292, __pyx_L1_error);
6762 __pyx_t_4 = __Pyx_PyDict_NewPresized(1);
if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 292, __pyx_L1_error)
6763 __Pyx_GOTREF(__pyx_t_4);
6764 if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_allocate_buffer, Py_False) < (0)) __PYX_ERR(1, 292, __pyx_L1_error)
6765 __pyx_t_3 = ((PyObject *)__pyx_tp_new_array(((PyTypeObject *)__pyx_mstate_global->__pyx_array_type), __pyx_t_1, __pyx_t_4));
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 292, __pyx_L1_error)
6766 __Pyx_GOTREF(__pyx_t_3);
6767 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
6768 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
6769 __pyx_v_result = ((
struct __pyx_array_obj *)__pyx_t_3);
6779 __pyx_v_result->data = __pyx_v_buf;
6791 struct __pyx_array_obj *__pyx_temp;
6793 __pyx_temp = __pyx_r;
6794 __Pyx_INCREF((PyObject *)__pyx_v_result);
6795 __pyx_r = __pyx_v_result;
6797 __Pyx_XDECREF((PyObject *)__pyx_temp);
6811 __Pyx_XDECREF(__pyx_t_1);
6812 __Pyx_XDECREF(__pyx_t_3);
6813 __Pyx_XDECREF(__pyx_t_4);
6814 __Pyx_AddTraceback(
"View.MemoryView.array_cwrapper", __pyx_clineno, __pyx_lineno, __pyx_filename);
6817 __Pyx_XDECREF((PyObject *)__pyx_v_result);
6818 __Pyx_XDECREF(__pyx_v_mode);
6819 __Pyx_XGIVEREF((PyObject *)__pyx_r);
6820 __Pyx_RefNannyFinishContext();
6833static int __pyx_MemviewEnum___init__(PyObject *__pyx_v_self,
6834#
if CYTHON_VECTORCALL_TPNEW
6835PyObject *
const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
6837PyObject *__pyx_args, PyObject *__pyx_kwds
6840static int __pyx_MemviewEnum___init__(PyObject *__pyx_v_self,
6841#
if CYTHON_VECTORCALL_TPNEW
6842PyObject *
const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
6844PyObject *__pyx_args, PyObject *__pyx_kwds
6847 PyObject *__pyx_v_name = 0;
6848 #if !CYTHON_VECTORCALL_TPNEW
6849 CYTHON_UNUSED Py_ssize_t __pyx_nargs;
6851 CYTHON_UNUSED PyObject *
const *__pyx_kwvalues;
6852 PyObject* values[1] = {0};
6853 int __pyx_lineno = 0;
6854 const char *__pyx_filename = NULL;
6855 int __pyx_clineno = 0;
6857 __Pyx_RefNannyDeclarations
6858 __Pyx_RefNannySetupContext(
"__init__ (wrapper)", 0);
6859 #if !CYTHON_VECTORCALL_TPNEW
6860 #if CYTHON_ASSUME_SAFE_SIZE
6861 __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
6863 __pyx_nargs = PyTuple_Size(__pyx_args);
if (unlikely(__pyx_nargs < 0))
return -1;
6866 __pyx_kwvalues = __Pyx_KwValues_FASTCALL_TPNEW(__pyx_args, __pyx_nargs);
6868 PyObject **
const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_name,0};
6869 const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL_TPNEW(__pyx_kwds) : 0;
6870 if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(1, 321, __pyx_L3_error)
6871 if (__pyx_kwds_len > 0) {
6872 switch (__pyx_nargs) {
6874 values[0] = __Pyx_ArgRef_FASTCALL_TPNEW(__pyx_args, 0);
6875 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(1, 321, __pyx_L3_error)
6878 default:
goto __pyx_L5_argtuple_error;
6880 const Py_ssize_t kwd_pos_args = __pyx_nargs;
6881 if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len,
"__init__", 0) < (0)) __PYX_ERR(1, 321, __pyx_L3_error)
6882 for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
6883 if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid(
"__init__", 1, 1, 1, i); __PYX_ERR(1, 321, __pyx_L3_error) }
6885 }
else if (unlikely(__pyx_nargs != 1)) {
6886 goto __pyx_L5_argtuple_error;
6888 values[0] = __Pyx_ArgRef_FASTCALL_TPNEW(__pyx_args, 0);
6889 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(1, 321, __pyx_L3_error)
6891 __pyx_v_name = values[0];
6894 __pyx_L5_argtuple_error:;
6895 __Pyx_RaiseArgtupleInvalid(
"__init__", 1, 1, 1, __pyx_nargs); __PYX_ERR(1, 321, __pyx_L3_error)
6897 goto __pyx_L4_argument_unpacking_done;
6899 for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(
sizeof(values)/
sizeof(values[0])); ++__pyx_temp) {
6900 Py_XDECREF(values[__pyx_temp]);
6902 __Pyx_AddTraceback(
"View.MemoryView.Enum.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
6903 __Pyx_RefNannyFinishContext();
6905 __pyx_L4_argument_unpacking_done:;
6906 __pyx_r = __pyx_MemviewEnum___pyx_pf_15View_dot_MemoryView_4Enum___init__(((
struct __pyx_MemviewEnum_obj *)__pyx_v_self), __pyx_v_name);
6909 for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(
sizeof(values)/
sizeof(values[0])); ++__pyx_temp) {
6910 Py_XDECREF(values[__pyx_temp]);
6912 __Pyx_RefNannyFinishContext();
6916static int __pyx_MemviewEnum___pyx_pf_15View_dot_MemoryView_4Enum___init__(
struct __pyx_MemviewEnum_obj *__pyx_v_self, PyObject *__pyx_v_name) {
6918 __Pyx_RefNannyDeclarations
6919 __Pyx_RefNannySetupContext(
"__init__", 0);
6928 __Pyx_INCREF(__pyx_v_name);
6929 __Pyx_GIVEREF(__pyx_v_name);
6930 __Pyx_GOTREF(__pyx_v_self->name);
6931 __Pyx_DECREF(__pyx_v_self->name);
6932 __pyx_v_self->name = __pyx_v_name;
6945 __Pyx_RefNannyFinishContext();
6958static PyObject *__pyx_MemviewEnum___repr__(PyObject *__pyx_v_self);
6959static PyObject *__pyx_MemviewEnum___repr__(PyObject *__pyx_v_self) {
6960 CYTHON_UNUSED PyObject *
const *__pyx_kwvalues;
6961 PyObject *__pyx_r = 0;
6962 __Pyx_RefNannyDeclarations
6963 __Pyx_RefNannySetupContext(
"__repr__ (wrapper)", 0);
6964 __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
6965 __pyx_r = __pyx_MemviewEnum___pyx_pf_15View_dot_MemoryView_4Enum_2__repr__(((
struct __pyx_MemviewEnum_obj *)__pyx_v_self));
6968 __Pyx_RefNannyFinishContext();
6972static PyObject *__pyx_MemviewEnum___pyx_pf_15View_dot_MemoryView_4Enum_2__repr__(
struct __pyx_MemviewEnum_obj *__pyx_v_self) {
6973 PyObject *__pyx_r = NULL;
6974 __Pyx_RefNannyDeclarations
6975 __Pyx_RefNannySetupContext(
"__repr__", 0);
6985 PyObject *__pyx_temp;
6987 __pyx_temp = __pyx_r;
6988 __Pyx_INCREF(__pyx_v_self->name);
6989 __pyx_r = __pyx_v_self->name;
6991 __Pyx_XDECREF(__pyx_temp);
7005 __Pyx_XGIVEREF(__pyx_r);
7006 __Pyx_RefNannyFinishContext();
7017static PyObject *__pyx_pw___pyx_MemviewEnum_1__reduce_cython__(PyObject *__pyx_v_self,
7018#
if CYTHON_VECTORCALL
7019PyObject *
const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
7021PyObject *__pyx_args, PyObject *__pyx_kwds
7024static PyObject *__pyx_pw___pyx_MemviewEnum_1__reduce_cython__(PyObject *__pyx_v_self,
7025#
if CYTHON_VECTORCALL
7026PyObject *
const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
7028PyObject *__pyx_args, PyObject *__pyx_kwds
7031 #if !CYTHON_VECTORCALL
7032 CYTHON_UNUSED Py_ssize_t __pyx_nargs;
7034 CYTHON_UNUSED PyObject *
const *__pyx_kwvalues;
7035 PyObject *__pyx_r = 0;
7036 __Pyx_RefNannyDeclarations
7037 __Pyx_RefNannySetupContext(
"__reduce_cython__ (wrapper)", 0);
7038 #if !CYTHON_VECTORCALL
7039 #if CYTHON_ASSUME_SAFE_SIZE
7040 __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
7042 __pyx_nargs = PyTuple_Size(__pyx_args);
if (unlikely(__pyx_nargs < 0))
return NULL;
7045 __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
7046 if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid(
"__reduce_cython__", 1, 0, 0, __pyx_nargs);
return NULL; }
7047 const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
7048 if (unlikely(__pyx_kwds_len < 0))
return NULL;
7049 if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords(
"__reduce_cython__", __pyx_kwds);
return NULL;}
7050 __pyx_r = __pyx_pf___pyx_MemviewEnum___reduce_cython__(((
struct __pyx_MemviewEnum_obj *)__pyx_v_self));
7053 __Pyx_RefNannyFinishContext();
7057static PyObject *__pyx_pf___pyx_MemviewEnum___reduce_cython__(
struct __pyx_MemviewEnum_obj *__pyx_v_self) {
7058 PyObject *__pyx_v_state = 0;
7059 PyObject *__pyx_v__dict = 0;
7060 int __pyx_v_use_setstate;
7061 PyObject *__pyx_r = NULL;
7062 __Pyx_RefNannyDeclarations
7063 PyObject *__pyx_t_1 = NULL;
7064 PyObject *__pyx_t_2 = NULL;
7067 PyObject *__pyx_t_5 = NULL;
7068 int __pyx_lineno = 0;
7069 const char *__pyx_filename = NULL;
7070 int __pyx_clineno = 0;
7071 __Pyx_RefNannySetupContext(
"__reduce_cython__", 0);
7081 __Pyx_PyCriticalSection __pyx_cs;
7082 __pyx_t_1 = ((PyObject *)__pyx_v_self);
7083 __Pyx_INCREF(__pyx_t_1);
7084 __Pyx_PyCriticalSection_Begin(&__pyx_cs, (PyObject*)__pyx_t_1);
7094 __pyx_t_2 = PyTuple_New(1);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 6, __pyx_L4_error)
7095 __Pyx_GOTREF(__pyx_t_2);
7096 __Pyx_INCREF(__pyx_v_self->name);
7097 __Pyx_GIVEREF(__pyx_v_self->name);
7098 if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_self->name) != (0)) __PYX_ERR(1, 6, __pyx_L4_error);
7099 __pyx_v_state = ((PyObject*)__pyx_t_2);
7109 __pyx_t_2 = __Pyx_GetAttr3(((PyObject *)__pyx_v_self), __pyx_mstate_global->__pyx_n_u_dict, Py_None);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 7, __pyx_L4_error)
7110 __Pyx_GOTREF(__pyx_t_2);
7111 __pyx_v__dict = __pyx_t_2;
7124 __Pyx_PyCriticalSection_End(&__pyx_cs);
7128 __Pyx_PyCriticalSection_End(&__pyx_cs);
7129 goto __pyx_L1_error;
7133 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
7143 __pyx_t_4 = (__pyx_v__dict != Py_None);
7148 __pyx_t_3 = __pyx_t_4;
7150 goto __pyx_L7_bool_binop_done;
7152 __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_v__dict);
if (unlikely((__pyx_t_4 < 0))) __PYX_ERR(1, 8, __pyx_L1_error)
7154 __pyx_t_3 = __pyx_t_4;
7156 __pyx_L7_bool_binop_done:;
7167 __pyx_t_1 = PyTuple_New(1);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 9, __pyx_L1_error)
7168 __Pyx_GOTREF(__pyx_t_1);
7169 __Pyx_INCREF(__pyx_v__dict);
7170 __Pyx_GIVEREF(__pyx_v__dict);
7171 if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v__dict) != (0)) __PYX_ERR(1, 9, __pyx_L1_error);
7172 __pyx_t_2 = PyNumber_InPlaceAdd(__pyx_v_state, __pyx_t_1);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 9, __pyx_L1_error)
7173 __Pyx_GOTREF(__pyx_t_2);
7174 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
7175 __Pyx_DECREF_SET(__pyx_v_state, ((PyObject*)__pyx_t_2));
7185 __pyx_v_use_setstate = 1;
7205 __pyx_t_3 = (__pyx_v_self->name != Py_None);
7206 __pyx_v_use_setstate = __pyx_t_3;
7217 if (__pyx_v_use_setstate) {
7226 __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_pyx_unpickle_Enum);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 14, __pyx_L1_error)
7227 __Pyx_GOTREF(__pyx_t_2);
7228 __pyx_t_1 = PyTuple_New(3);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 14, __pyx_L1_error)
7229 __Pyx_GOTREF(__pyx_t_1);
7230 __Pyx_INCREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
7231 __Pyx_GIVEREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
7232 if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self)))) != (0)) __PYX_ERR(1, 14, __pyx_L1_error);
7233 __Pyx_INCREF(__pyx_mstate_global->__pyx_int_136983863);
7234 __Pyx_GIVEREF(__pyx_mstate_global->__pyx_int_136983863);
7235 if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_mstate_global->__pyx_int_136983863) != (0)) __PYX_ERR(1, 14, __pyx_L1_error);
7236 __Pyx_INCREF(Py_None);
7237 __Pyx_GIVEREF(Py_None);
7238 if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 2, Py_None) != (0)) __PYX_ERR(1, 14, __pyx_L1_error);
7239 __pyx_t_5 = PyTuple_New(3);
if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 14, __pyx_L1_error)
7240 __Pyx_GOTREF(__pyx_t_5);
7241 __Pyx_GIVEREF(__pyx_t_2);
7242 if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_2) != (0)) __PYX_ERR(1, 14, __pyx_L1_error);
7243 __Pyx_GIVEREF(__pyx_t_1);
7244 if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_1) != (0)) __PYX_ERR(1, 14, __pyx_L1_error);
7245 __Pyx_INCREF(__pyx_v_state);
7246 __Pyx_GIVEREF(__pyx_v_state);
7247 if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 2, __pyx_v_state) != (0)) __PYX_ERR(1, 14, __pyx_L1_error);
7251 PyObject *__pyx_temp;
7253 __pyx_temp = __pyx_r;
7254 __pyx_r = __pyx_t_5;
7256 __Pyx_XDECREF(__pyx_temp);
7278 __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_pyx_unpickle_Enum);
if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 16, __pyx_L1_error)
7279 __Pyx_GOTREF(__pyx_t_5);
7280 __pyx_t_1 = PyTuple_New(3);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 16, __pyx_L1_error)
7281 __Pyx_GOTREF(__pyx_t_1);
7282 __Pyx_INCREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
7283 __Pyx_GIVEREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
7284 if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self)))) != (0)) __PYX_ERR(1, 16, __pyx_L1_error);
7285 __Pyx_INCREF(__pyx_mstate_global->__pyx_int_136983863);
7286 __Pyx_GIVEREF(__pyx_mstate_global->__pyx_int_136983863);
7287 if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_mstate_global->__pyx_int_136983863) != (0)) __PYX_ERR(1, 16, __pyx_L1_error);
7288 __Pyx_INCREF(__pyx_v_state);
7289 __Pyx_GIVEREF(__pyx_v_state);
7290 if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_v_state) != (0)) __PYX_ERR(1, 16, __pyx_L1_error);
7291 __pyx_t_2 = PyTuple_New(2);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 16, __pyx_L1_error)
7292 __Pyx_GOTREF(__pyx_t_2);
7293 __Pyx_GIVEREF(__pyx_t_5);
7294 if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_5) != (0)) __PYX_ERR(1, 16, __pyx_L1_error);
7295 __Pyx_GIVEREF(__pyx_t_1);
7296 if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_1) != (0)) __PYX_ERR(1, 16, __pyx_L1_error);
7300 PyObject *__pyx_temp;
7302 __pyx_temp = __pyx_r;
7303 __pyx_r = __pyx_t_2;
7305 __Pyx_XDECREF(__pyx_temp);
7319 __Pyx_XDECREF(__pyx_t_1);
7320 __Pyx_XDECREF(__pyx_t_2);
7321 __Pyx_XDECREF(__pyx_t_5);
7322 __Pyx_AddTraceback(
"View.MemoryView.Enum.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
7325 __Pyx_XDECREF(__pyx_v_state);
7326 __Pyx_XDECREF(__pyx_v__dict);
7328 __Pyx_XGIVEREF(__pyx_r);
7329 __Pyx_RefNannyFinishContext();
7341static PyObject *__pyx_pw___pyx_MemviewEnum_3__setstate_cython__(PyObject *__pyx_v_self,
7342#
if CYTHON_VECTORCALL
7343PyObject *
const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
7345PyObject *__pyx_args, PyObject *__pyx_kwds
7348static PyObject *__pyx_pw___pyx_MemviewEnum_3__setstate_cython__(PyObject *__pyx_v_self,
7349#
if CYTHON_VECTORCALL
7350PyObject *
const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
7352PyObject *__pyx_args, PyObject *__pyx_kwds
7355 PyObject *__pyx_v___pyx_state = 0;
7356 #if !CYTHON_VECTORCALL
7357 CYTHON_UNUSED Py_ssize_t __pyx_nargs;
7359 CYTHON_UNUSED PyObject *
const *__pyx_kwvalues;
7360 PyObject* values[1] = {0};
7361 int __pyx_lineno = 0;
7362 const char *__pyx_filename = NULL;
7363 int __pyx_clineno = 0;
7364 PyObject *__pyx_r = 0;
7365 __Pyx_RefNannyDeclarations
7366 __Pyx_RefNannySetupContext(
"__setstate_cython__ (wrapper)", 0);
7367 #if !CYTHON_VECTORCALL
7368 #if CYTHON_ASSUME_SAFE_SIZE
7369 __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
7371 __pyx_nargs = PyTuple_Size(__pyx_args);
if (unlikely(__pyx_nargs < 0))
return NULL;
7374 __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
7376 PyObject **
const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_pyx_state,0};
7377 const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
7378 if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(1, 17, __pyx_L3_error)
7379 if (__pyx_kwds_len > 0) {
7380 switch (__pyx_nargs) {
7382 values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
7383 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(1, 17, __pyx_L3_error)
7386 default:
goto __pyx_L5_argtuple_error;
7388 const Py_ssize_t kwd_pos_args = __pyx_nargs;
7389 if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len,
"__setstate_cython__", 0) < (0)) __PYX_ERR(1, 17, __pyx_L3_error)
7390 for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
7391 if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid(
"__setstate_cython__", 1, 1, 1, i); __PYX_ERR(1, 17, __pyx_L3_error) }
7393 }
else if (unlikely(__pyx_nargs != 1)) {
7394 goto __pyx_L5_argtuple_error;
7396 values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
7397 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(1, 17, __pyx_L3_error)
7399 __pyx_v___pyx_state = values[0];
7402 __pyx_L5_argtuple_error:;
7403 __Pyx_RaiseArgtupleInvalid(
"__setstate_cython__", 1, 1, 1, __pyx_nargs); __PYX_ERR(1, 17, __pyx_L3_error)
7405 goto __pyx_L4_argument_unpacking_done;
7407 for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(
sizeof(values)/
sizeof(values[0])); ++__pyx_temp) {
7408 Py_XDECREF(values[__pyx_temp]);
7410 __Pyx_AddTraceback(
"View.MemoryView.Enum.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
7411 __Pyx_RefNannyFinishContext();
7413 __pyx_L4_argument_unpacking_done:;
7414 __pyx_r = __pyx_pf___pyx_MemviewEnum_2__setstate_cython__(((
struct __pyx_MemviewEnum_obj *)__pyx_v_self), __pyx_v___pyx_state);
7417 for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(
sizeof(values)/
sizeof(values[0])); ++__pyx_temp) {
7418 Py_XDECREF(values[__pyx_temp]);
7420 __Pyx_RefNannyFinishContext();
7424static PyObject *__pyx_pf___pyx_MemviewEnum_2__setstate_cython__(
struct __pyx_MemviewEnum_obj *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
7425 PyObject *__pyx_r = NULL;
7426 __Pyx_RefNannyDeclarations
7427 PyObject *__pyx_t_1 = NULL;
7428 PyObject *__pyx_t_2 = NULL;
7429 int __pyx_lineno = 0;
7430 const char *__pyx_filename = NULL;
7431 int __pyx_clineno = 0;
7432 __Pyx_RefNannySetupContext(
"__setstate_cython__", 0);
7439 __pyx_t_1 = __pyx_v___pyx_state;
7440 __Pyx_INCREF(__pyx_t_1);
7441 if (!(likely(PyTuple_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None) || __Pyx_RaiseUnexpectedTypeError(
"tuple", __pyx_t_1))) __PYX_ERR(1, 18, __pyx_L1_error)
7442 if (unlikely(__pyx_t_1 == Py_None)) {
7443 PyErr_SetString(PyExc_TypeError,
"cannot pass None into a C function argument that is declared \047not None\047");
7444 __PYX_ERR(1, 18, __pyx_L1_error)
7446 __pyx_t_2 = __pyx_unpickle_Enum__set_state(__pyx_v_self, ((PyObject*)__pyx_t_1));
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 18, __pyx_L1_error)
7447 __Pyx_GOTREF(__pyx_t_2);
7448 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
7449 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
7459 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
7462 __Pyx_XDECREF(__pyx_t_1);
7463 __Pyx_XDECREF(__pyx_t_2);
7464 __Pyx_AddTraceback(
"View.MemoryView.Enum.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
7467 __Pyx_XGIVEREF(__pyx_r);
7468 __Pyx_RefNannyFinishContext();
7481static int __pyx_memoryview___cinit__(PyObject *__pyx_v_self,
7482#
if CYTHON_VECTORCALL_TPNEW
7483PyObject *
const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
7485PyObject *__pyx_args, PyObject *__pyx_kwds
7488static int __pyx_memoryview___cinit__(PyObject *__pyx_v_self,
7489#
if CYTHON_VECTORCALL_TPNEW
7490PyObject *
const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
7492PyObject *__pyx_args, PyObject *__pyx_kwds
7495 PyObject *__pyx_v_obj = 0;
7497 int __pyx_v_dtype_is_object;
7498 #if !CYTHON_VECTORCALL_TPNEW
7499 CYTHON_UNUSED Py_ssize_t __pyx_nargs;
7501 CYTHON_UNUSED PyObject *
const *__pyx_kwvalues;
7502 PyObject* values[3] = {0,0,0};
7503 int __pyx_lineno = 0;
7504 const char *__pyx_filename = NULL;
7505 int __pyx_clineno = 0;
7507 __Pyx_RefNannyDeclarations
7508 __Pyx_RefNannySetupContext(
"__cinit__ (wrapper)", 0);
7509 #if !CYTHON_VECTORCALL_TPNEW
7510 #if CYTHON_ASSUME_SAFE_SIZE
7511 __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
7513 __pyx_nargs = PyTuple_Size(__pyx_args);
if (unlikely(__pyx_nargs < 0))
return -1;
7516 __pyx_kwvalues = __Pyx_KwValues_FASTCALL_TPNEW(__pyx_args, __pyx_nargs);
7518 PyObject **
const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_obj,&__pyx_mstate_global->__pyx_n_u_flags,&__pyx_mstate_global->__pyx_n_u_dtype_is_object,0};
7519 const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL_TPNEW(__pyx_kwds) : 0;
7520 if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(1, 367, __pyx_L3_error)
7521 if (__pyx_kwds_len > 0) {
7522 switch (__pyx_nargs) {
7524 values[2] = __Pyx_ArgRef_FASTCALL_TPNEW(__pyx_args, 2);
7525 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(1, 367, __pyx_L3_error)
7528 values[1] = __Pyx_ArgRef_FASTCALL_TPNEW(__pyx_args, 1);
7529 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(1, 367, __pyx_L3_error)
7532 values[0] = __Pyx_ArgRef_FASTCALL_TPNEW(__pyx_args, 0);
7533 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(1, 367, __pyx_L3_error)
7536 default:
goto __pyx_L5_argtuple_error;
7538 const Py_ssize_t kwd_pos_args = __pyx_nargs;
7539 if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len,
"__cinit__", 0) < (0)) __PYX_ERR(1, 367, __pyx_L3_error)
7540 for (Py_ssize_t i = __pyx_nargs; i < 2; i++) {
7541 if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid(
"__cinit__", 0, 2, 3, i); __PYX_ERR(1, 367, __pyx_L3_error) }
7544 switch (__pyx_nargs) {
7546 values[2] = __Pyx_ArgRef_FASTCALL_TPNEW(__pyx_args, 2);
7547 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(1, 367, __pyx_L3_error)
7550 values[1] = __Pyx_ArgRef_FASTCALL_TPNEW(__pyx_args, 1);
7551 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(1, 367, __pyx_L3_error)
7552 values[0] = __Pyx_ArgRef_FASTCALL_TPNEW(__pyx_args, 0);
7553 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(1, 367, __pyx_L3_error)
7555 default:
goto __pyx_L5_argtuple_error;
7558 __pyx_v_obj = values[0];
7559 __pyx_v_flags = __Pyx_PyLong_As_int(values[1]);
if (unlikely((__pyx_v_flags == (
int)-1) && PyErr_Occurred())) __PYX_ERR(1, 367, __pyx_L3_error)
7561 __pyx_v_dtype_is_object = __Pyx_PyObject_IsTrue(values[2]);
if (unlikely((__pyx_v_dtype_is_object == (
int)-1) && PyErr_Occurred())) __PYX_ERR(1, 367, __pyx_L3_error)
7563 __pyx_v_dtype_is_object = ((int)0);
7567 __pyx_L5_argtuple_error:;
7568 __Pyx_RaiseArgtupleInvalid(
"__cinit__", 0, 2, 3, __pyx_nargs); __PYX_ERR(1, 367, __pyx_L3_error)
7570 goto __pyx_L4_argument_unpacking_done;
7572 for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(
sizeof(values)/
sizeof(values[0])); ++__pyx_temp) {
7573 Py_XDECREF(values[__pyx_temp]);
7575 __Pyx_AddTraceback(
"View.MemoryView.memoryview.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
7576 __Pyx_RefNannyFinishContext();
7578 __pyx_L4_argument_unpacking_done:;
7579 __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview___cinit__(((
struct __pyx_memoryview_obj *)__pyx_v_self), __pyx_v_obj, __pyx_v_flags, __pyx_v_dtype_is_object);
7582 for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(
sizeof(values)/
sizeof(values[0])); ++__pyx_temp) {
7583 Py_XDECREF(values[__pyx_temp]);
7587 __Pyx_RefNannyFinishContext();
7591static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview___cinit__(
struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_obj,
int __pyx_v_flags,
int __pyx_v_dtype_is_object) {
7593 __Pyx_RefNannyDeclarations
7597 int __pyx_lineno = 0;
7598 const char *__pyx_filename = NULL;
7599 int __pyx_clineno = 0;
7600 __Pyx_RefNannySetupContext(
"__cinit__", 0);
7609 __Pyx_INCREF(__pyx_v_obj);
7610 __Pyx_GIVEREF(__pyx_v_obj);
7611 __Pyx_GOTREF(__pyx_v_self->obj);
7612 __Pyx_DECREF(__pyx_v_self->obj);
7613 __pyx_v_self->obj = __pyx_v_obj;
7622 __pyx_v_self->flags = __pyx_v_flags;
7631 __pyx_t_2 = (((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))) == ((PyObject *)__pyx_mstate_global->__pyx_memoryview_type));
7636 __pyx_t_1 = __pyx_t_2;
7638 goto __pyx_L4_bool_binop_done;
7640 __pyx_t_2 = (__pyx_v_obj != Py_None);
7642 __pyx_t_1 = __pyx_t_2;
7644 __pyx_L4_bool_binop_done:;
7655 __pyx_t_3 = PyObject_GetBuffer(__pyx_v_obj, (&__pyx_v_self->view), __pyx_v_flags);
if (unlikely(__pyx_t_3 == ((
int)-1))) __PYX_ERR(1, 371, __pyx_L1_error)
7665 __pyx_t_1 = (((PyObject *)__pyx_v_self->view.obj) == NULL);
7677 ((Py_buffer *)(&__pyx_v_self->view))->obj = Py_None;
7713 __pyx_t_1 = (!__PYX_CYTHON_ATOMICS_ENABLED());
7725 __pyx_t_2 = (__pyx_memoryview_thread_locks_used < 8);
7731 __pyx_t_1 = __pyx_t_2;
7733 goto __pyx_L9_bool_binop_done;
7743 __pyx_t_2 = (!__PYX_GET_CYTHON_COMPILING_IN_CPYTHON_FREETHREADING());
7746 __pyx_t_1 = __pyx_t_2;
7748 __pyx_L9_bool_binop_done:;
7767 __pyx_v_self->lock = (__pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used]);
7776 __pyx_memoryview_thread_locks_used = (__pyx_memoryview_thread_locks_used + 1);
7794 __pyx_t_1 = (__pyx_v_self->lock == NULL);
7806 __pyx_v_self->lock = PyThread_allocate_lock();
7815 __pyx_t_1 = (__pyx_v_self->lock == NULL);
7817 if (unlikely(__pyx_t_1)) {
7827 PyErr_NoMemory(); __PYX_ERR(1, 386, __pyx_L1_error)
7863 __pyx_t_1 = ((__pyx_v_flags & PyBUF_FORMAT) != 0);
7875 __pyx_t_2 = ((__pyx_v_self->view.format[0]) ==
'O');
7881 __pyx_t_1 = __pyx_t_2;
7883 goto __pyx_L14_bool_binop_done;
7885 __pyx_t_2 = ((__pyx_v_self->view.format[1]) ==
'\x00');
7888 __pyx_t_1 = __pyx_t_2;
7890 __pyx_L14_bool_binop_done:;
7891 __pyx_v_self->dtype_is_object = __pyx_t_1;
7911 __pyx_v_self->dtype_is_object = __pyx_v_dtype_is_object;
7922 #ifndef CYTHON_WITHOUT_ASSERTIONS
7923 if (unlikely(__pyx_assertions_enabled())) {
7924 __pyx_t_1 = ((((__pyx_uintptr_t)(&__pyx_v_self->acquisition_count)) % (
sizeof(__pyx_atomic_int_type))) == 0);
7926 if (unlikely(!__pyx_t_1)) {
7927 __Pyx_Raise(((PyObject *)(((PyTypeObject*)PyExc_AssertionError))), 0, 0, 0);
7928 __PYX_ERR(1, 394, __pyx_L1_error)
7933 if ((1));
else __PYX_ERR(1, 394, __pyx_L1_error)
7943 __pyx_v_self->typeinfo = NULL;
7957 __Pyx_AddTraceback(
"View.MemoryView.memoryview.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
7961 __Pyx_RefNannyFinishContext();
7974static void __pyx_memoryview___dealloc__(PyObject *__pyx_v_self);
7975static void __pyx_memoryview___dealloc__(PyObject *__pyx_v_self) {
7976 CYTHON_UNUSED PyObject *
const *__pyx_kwvalues;
7977 __Pyx_RefNannyDeclarations
7978 __Pyx_RefNannySetupContext(
"__dealloc__ (wrapper)", 0);
7979 __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
7980 __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_2__dealloc__(((
struct __pyx_memoryview_obj *)__pyx_v_self));
7983 __Pyx_RefNannyFinishContext();
7986static void __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_2__dealloc__(
struct __pyx_memoryview_obj *__pyx_v_self) {
7989 Py_ssize_t __pyx_t_2;
7990 Py_ssize_t __pyx_t_3;
7992 PyThread_type_lock __pyx_t_5;
7993 PyThread_type_lock __pyx_t_6;
8002 __pyx_t_1 = (__pyx_v_self->obj != Py_None);
8013 PyBuffer_Release((&__pyx_v_self->view));
8032 __pyx_t_1 = (((Py_buffer *)(&__pyx_v_self->view))->obj == Py_None);
8044 ((Py_buffer *)(&__pyx_v_self->view))->obj = NULL;
8072 __pyx_t_1 = (__pyx_v_self->lock != NULL);
8084 __pyx_t_1 = __PYX_GET_CYTHON_COMPILING_IN_CPYTHON_FREETHREADING();
8091 __pyx_t_2 = __pyx_memoryview_thread_locks_used;
8094 __pyx_t_3 = __pyx_t_2;
8096 for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
8097 __pyx_v_i = __pyx_t_4;
8106 __pyx_t_1 = ((__pyx_memoryview_thread_locks[__pyx_v_i]) == __pyx_v_self->lock);
8118 __pyx_memoryview_thread_locks_used = (__pyx_memoryview_thread_locks_used - 1);
8127 __pyx_t_1 = (__pyx_v_i != __pyx_memoryview_thread_locks_used);
8139 __pyx_t_5 = (__pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used]);
8141 __pyx_t_6 = (__pyx_memoryview_thread_locks[__pyx_v_i]);
8151 (__pyx_memoryview_thread_locks[__pyx_v_i]) = __pyx_t_5;
8153 (__pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used]) = __pyx_t_6;
8172 goto __pyx_L6_break;
8192 PyThread_free_lock(__pyx_v_self->lock);
8228static char *__pyx_memoryview_get_item_pointer(
struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index) {
8229 Py_ssize_t __pyx_v_dim;
8230 char *__pyx_v_itemp;
8231 PyObject *__pyx_v_idx = NULL;
8233 __Pyx_RefNannyDeclarations
8234 Py_ssize_t __pyx_t_1;
8235 PyObject *__pyx_t_2 = NULL;
8236 Py_ssize_t __pyx_t_3;
8237 PyObject *__pyx_t_4 = NULL;
8238 Py_ssize_t __pyx_t_5;
8240 int __pyx_lineno = 0;
8241 const char *__pyx_filename = NULL;
8242 int __pyx_clineno = 0;
8243 __Pyx_RefNannySetupContext(
"get_item_pointer", 0);
8252 __pyx_v_itemp = ((
char *)__pyx_v_self->view.buf);
8263 __pyx_t_2 = __pyx_v_index; __Pyx_INCREF(__pyx_t_2);
8267 Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_2);
8268 #if !CYTHON_ASSUME_SAFE_SIZE
8269 if (unlikely((__pyx_temp < 0))) __PYX_ERR(1, 423, __pyx_L1_error)
8271 if (__pyx_t_3 >= __pyx_temp)
break;
8273 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
8274 __pyx_t_4 = __Pyx_NewRef(PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_3));
8276 __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_2, __pyx_t_3);
8279 if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 423, __pyx_L1_error)
8280 __Pyx_GOTREF(__pyx_t_4);
8281 __Pyx_XDECREF_SET(__pyx_v_idx, __pyx_t_4);
8283 __pyx_v_dim = __pyx_t_1;
8284 __pyx_t_1 = (__pyx_t_1 + 1);
8293 __pyx_t_5 = __Pyx_PyIndex_AsSsize_t(__pyx_v_idx);
if (unlikely((__pyx_t_5 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(1, 424, __pyx_L1_error)
8294 __pyx_t_6 = __pyx_pybuffer_index((&__pyx_v_self->view), __pyx_v_itemp, __pyx_t_5, __pyx_v_dim);
if (unlikely(__pyx_t_6 == ((
void *)NULL))) __PYX_ERR(1, 424, __pyx_L1_error)
8295 __pyx_v_itemp = __pyx_t_6;
8306 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
8317 __pyx_r = __pyx_v_itemp;
8331 __Pyx_XDECREF(__pyx_t_2);
8332 __Pyx_XDECREF(__pyx_t_4);
8333 __Pyx_AddTraceback(
"View.MemoryView.memoryview.get_item_pointer", __pyx_clineno, __pyx_lineno, __pyx_filename);
8338 __Pyx_XDECREF(__pyx_v_idx);
8340 __Pyx_RefNannyFinishContext();
8353static PyObject *__pyx_memoryview___getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_index);
8354static PyObject *__pyx_memoryview___getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_index) {
8355 CYTHON_UNUSED PyObject *
const *__pyx_kwvalues;
8356 PyObject *__pyx_r = 0;
8357 __Pyx_RefNannyDeclarations
8358 __Pyx_RefNannySetupContext(
"__getitem__ (wrapper)", 0);
8359 __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
8360 __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_4__getitem__(((
struct __pyx_memoryview_obj *)__pyx_v_self), ((PyObject *)__pyx_v_index));
8363 __Pyx_RefNannyFinishContext();
8367static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_4__getitem__(
struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index) {
8368 char *__pyx_v_buffer;
8369 int __pyx_v_have_slices;
8370 PyObject *__pyx_v_indices = NULL;
8371 char *__pyx_v_itemp;
8372 PyObject *__pyx_r = NULL;
8373 __Pyx_RefNannyDeclarations
8376 Py_ssize_t __pyx_t_3;
8378 PyObject *__pyx_t_5 = NULL;
8379 PyObject *__pyx_t_6 = NULL;
8380 PyObject *__pyx_t_7 = NULL;
8381 int __pyx_lineno = 0;
8382 const char *__pyx_filename = NULL;
8383 int __pyx_clineno = 0;
8384 __Pyx_RefNannySetupContext(
"__getitem__", 0);
8393 __pyx_t_2 = (__pyx_v_self->view.ndim == 1);
8399 __pyx_t_1 = __pyx_t_2;
8401 goto __pyx_L4_bool_binop_done;
8403 __pyx_t_2 = PyLong_Check(__pyx_v_index);
8405 __pyx_t_1 = __pyx_t_2;
8407 __pyx_L4_bool_binop_done:;
8418 __pyx_v_buffer = ((
char *)__pyx_v_self->view.buf);
8427 __pyx_t_3 = __Pyx_PyIndex_AsSsize_t(__pyx_v_index);
if (unlikely((__pyx_t_3 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(1, 434, __pyx_L1_error)
8428 __pyx_t_4 = __pyx_pybuffer_index((&__pyx_v_self->view), __pyx_v_buffer, __pyx_t_3, 0);
if (unlikely(__pyx_t_4 == ((
void *)NULL))) __PYX_ERR(1, 434, __pyx_L1_error)
8437 __pyx_t_5 = ((
struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->convert_item_to_object(__pyx_v_self, __pyx_t_4);
if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 433, __pyx_L1_error)
8438 __Pyx_GOTREF(__pyx_t_5);
8442 PyObject *__pyx_temp;
8444 __pyx_temp = __pyx_r;
8445 __pyx_r = __pyx_t_5;
8447 __Pyx_XDECREF(__pyx_temp);
8468 __pyx_t_1 = (__pyx_v_index == __pyx_builtin_Ellipsis);
8480 PyObject *__pyx_temp;
8482 __pyx_temp = __pyx_r;
8483 __Pyx_INCREF((PyObject *)__pyx_v_self);
8484 __pyx_r = ((PyObject *)__pyx_v_self);
8486 __Pyx_XDECREF(__pyx_temp);
8506 __pyx_t_5 = _unellipsify(__pyx_v_index, __pyx_v_self->view.ndim);
if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 439, __pyx_L1_error)
8507 __Pyx_GOTREF(__pyx_t_5);
8508 if (likely(__pyx_t_5 != Py_None)) {
8509 PyObject* sequence = __pyx_t_5;
8510 Py_ssize_t size = __Pyx_PyTuple_GET_SIZE(sequence);
8511 if (unlikely(size != 2)) {
8512 if (size > 2) __Pyx_RaiseTooManyValuesError(2);
8513 else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
8514 __PYX_ERR(1, 439, __pyx_L1_error)
8516 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
8517 __pyx_t_6 = PyTuple_GET_ITEM(sequence, 0);
8518 __Pyx_INCREF(__pyx_t_6);
8519 __pyx_t_7 = PyTuple_GET_ITEM(sequence, 1);
8520 __Pyx_INCREF(__pyx_t_7);
8522 __pyx_t_6 = __Pyx_PySequence_ITEM(sequence, 0);
if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 439, __pyx_L1_error)
8523 __Pyx_GOTREF(__pyx_t_6);
8524 __pyx_t_7 = __Pyx_PySequence_ITEM(sequence, 1);
if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 439, __pyx_L1_error)
8525 __Pyx_GOTREF(__pyx_t_7);
8527 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
8529 __Pyx_RaiseNoneNotIterableError(); __PYX_ERR(1, 439, __pyx_L1_error)
8531 __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_6);
if (unlikely((__pyx_t_1 == (
int)-1) && PyErr_Occurred())) __PYX_ERR(1, 439, __pyx_L1_error)
8532 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
8533 if (!(likely(PyTuple_CheckExact(__pyx_t_7))||((__pyx_t_7) == Py_None) || __Pyx_RaiseUnexpectedTypeError(
"tuple", __pyx_t_7))) __PYX_ERR(1, 439, __pyx_L1_error)
8534 __pyx_v_have_slices = __pyx_t_1;
8535 __pyx_v_indices = ((PyObject*)__pyx_t_7);
8545 if (__pyx_v_have_slices) {
8554 __pyx_t_5 = ((PyObject *)__pyx_memview_slice(__pyx_v_self, __pyx_v_indices));
if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 443, __pyx_L1_error)
8555 __Pyx_GOTREF(__pyx_t_5);
8557 PyObject *__pyx_temp;
8559 __pyx_temp = __pyx_r;
8560 __pyx_r = __pyx_t_5;
8562 __Pyx_XDECREF(__pyx_temp);
8584 if (unlikely(__pyx_v_indices == Py_None)) {
8585 PyErr_SetString(PyExc_TypeError,
"cannot pass None into a C function argument that is declared \047not None\047");
8586 __PYX_ERR(1, 445, __pyx_L1_error)
8588 __pyx_t_4 = __pyx_memoryview_get_item_pointer(__pyx_v_self, ((PyObject*)__pyx_v_indices));
if (unlikely(__pyx_t_4 == ((
void *)NULL))) __PYX_ERR(1, 445, __pyx_L1_error)
8589 __pyx_v_itemp = __pyx_t_4;
8598 __pyx_t_5 = ((
struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->convert_item_to_object(__pyx_v_self, __pyx_v_itemp);
if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 446, __pyx_L1_error)
8599 __Pyx_GOTREF(__pyx_t_5);
8601 PyObject *__pyx_temp;
8603 __pyx_temp = __pyx_r;
8604 __pyx_r = __pyx_t_5;
8606 __Pyx_XDECREF(__pyx_temp);
8622 __Pyx_XDECREF(__pyx_t_5);
8623 __Pyx_XDECREF(__pyx_t_6);
8624 __Pyx_XDECREF(__pyx_t_7);
8625 __Pyx_AddTraceback(
"View.MemoryView.memoryview.__getitem__", __pyx_clineno, __pyx_lineno, __pyx_filename);
8630 __Pyx_XDECREF(__pyx_v_indices);
8632 __Pyx_XGIVEREF(__pyx_r);
8633 __Pyx_RefNannyFinishContext();
8646static int __pyx_memoryview___setitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_index, PyObject *__pyx_v_value);
8647static int __pyx_memoryview___setitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_index, PyObject *__pyx_v_value) {
8648 CYTHON_UNUSED PyObject *
const *__pyx_kwvalues;
8650 __Pyx_RefNannyDeclarations
8651 __Pyx_RefNannySetupContext(
"__setitem__ (wrapper)", 0);
8652 __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
8653 __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_6__setitem__(((
struct __pyx_memoryview_obj *)__pyx_v_self), ((PyObject *)__pyx_v_index), ((PyObject *)__pyx_v_value));
8656 __Pyx_RefNannyFinishContext();
8660static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_6__setitem__(
struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index, PyObject *__pyx_v_value) {
8661 int __pyx_v_have_slices;
8662 PyObject *__pyx_v_indices = NULL;
8663 PyObject *__pyx_v_obj = NULL;
8664 struct __pyx_memoryview_obj *__pyx_v_target_slice = NULL;
8666 __Pyx_RefNannyDeclarations
8669 PyObject *__pyx_t_3 = NULL;
8670 PyObject *__pyx_t_4 = NULL;
8671 PyObject *__pyx_t_5 = NULL;
8672 int __pyx_lineno = 0;
8673 const char *__pyx_filename = NULL;
8674 int __pyx_clineno = 0;
8675 __Pyx_RefNannySetupContext(
"__setitem__", 0);
8684 if (unlikely(__pyx_v_self->view.readonly)) {
8693 __Pyx_Raise(((PyObject *)(((PyTypeObject*)PyExc_TypeError))), __pyx_mstate_global->__pyx_kp_u_Cannot_assign_to_read_only_memor, 0, 0);
8694 __PYX_ERR(1, 450, __pyx_L1_error)
8712 __pyx_t_2 = (__pyx_v_self->view.ndim == 1);
8718 __pyx_t_1 = __pyx_t_2;
8720 goto __pyx_L5_bool_binop_done;
8722 __pyx_t_2 = PyLong_Check(__pyx_v_index);
8724 __pyx_t_1 = __pyx_t_2;
8726 __pyx_L5_bool_binop_done:;
8737 __pyx_t_3 = __pyx_memoryview_setitem_indexed1(__pyx_v_self, __pyx_v_index, __pyx_v_value);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 453, __pyx_L1_error)
8738 __Pyx_GOTREF(__pyx_t_3);
8739 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
8769 __pyx_t_3 = _unellipsify(__pyx_v_index, __pyx_v_self->view.ndim);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 456, __pyx_L1_error)
8770 __Pyx_GOTREF(__pyx_t_3);
8771 if (likely(__pyx_t_3 != Py_None)) {
8772 PyObject* sequence = __pyx_t_3;
8773 Py_ssize_t size = __Pyx_PyTuple_GET_SIZE(sequence);
8774 if (unlikely(size != 2)) {
8775 if (size > 2) __Pyx_RaiseTooManyValuesError(2);
8776 else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
8777 __PYX_ERR(1, 456, __pyx_L1_error)
8779 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
8780 __pyx_t_4 = PyTuple_GET_ITEM(sequence, 0);
8781 __Pyx_INCREF(__pyx_t_4);
8782 __pyx_t_5 = PyTuple_GET_ITEM(sequence, 1);
8783 __Pyx_INCREF(__pyx_t_5);
8785 __pyx_t_4 = __Pyx_PySequence_ITEM(sequence, 0);
if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 456, __pyx_L1_error)
8786 __Pyx_GOTREF(__pyx_t_4);
8787 __pyx_t_5 = __Pyx_PySequence_ITEM(sequence, 1);
if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 456, __pyx_L1_error)
8788 __Pyx_GOTREF(__pyx_t_5);
8790 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
8792 __Pyx_RaiseNoneNotIterableError(); __PYX_ERR(1, 456, __pyx_L1_error)
8794 __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_4);
if (unlikely((__pyx_t_1 == (
int)-1) && PyErr_Occurred())) __PYX_ERR(1, 456, __pyx_L1_error)
8795 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
8796 if (!(likely(PyTuple_CheckExact(__pyx_t_5))||((__pyx_t_5) == Py_None) || __Pyx_RaiseUnexpectedTypeError(
"tuple", __pyx_t_5))) __PYX_ERR(1, 456, __pyx_L1_error)
8797 __pyx_v_have_slices = __pyx_t_1;
8798 __pyx_v_indices = ((PyObject*)__pyx_t_5);
8808 if (__pyx_v_have_slices) {
8817 __pyx_t_3 = __pyx_memoryview_is_slice(__pyx_v_self, __pyx_v_value);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 459, __pyx_L1_error)
8818 __Pyx_GOTREF(__pyx_t_3);
8819 __pyx_v_obj = __pyx_t_3;
8829 __pyx_t_3 = ((PyObject *)__pyx_memview_slice(__pyx_v_self, __pyx_v_indices));
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 460, __pyx_L1_error)
8830 __Pyx_GOTREF(__pyx_t_3);
8831 __pyx_v_target_slice = ((
struct __pyx_memoryview_obj *)__pyx_t_3);
8841 __pyx_t_1 = (__pyx_v_obj != Py_None);
8852 __pyx_t_3 = __pyx_memoryview_setitem_slice_assignment(__pyx_v_self, ((PyObject *)__pyx_v_target_slice), __pyx_v_obj);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 462, __pyx_L1_error)
8853 __Pyx_GOTREF(__pyx_t_3);
8854 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
8874 __pyx_t_3 = __pyx_memoryview_setitem_slice_assign_scalar(__pyx_v_self, __pyx_v_target_slice, __pyx_v_value);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 464, __pyx_L1_error)
8875 __Pyx_GOTREF(__pyx_t_3);
8876 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
8898 if (unlikely(__pyx_v_indices == Py_None)) {
8899 PyErr_SetString(PyExc_TypeError,
"cannot pass None into a C function argument that is declared \047not None\047");
8900 __PYX_ERR(1, 466, __pyx_L1_error)
8902 __pyx_t_3 = __pyx_memoryview_setitem_indexed(__pyx_v_self, ((PyObject*)__pyx_v_indices), __pyx_v_value);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 466, __pyx_L1_error)
8903 __Pyx_GOTREF(__pyx_t_3);
8904 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
8920 __Pyx_XDECREF(__pyx_t_3);
8921 __Pyx_XDECREF(__pyx_t_4);
8922 __Pyx_XDECREF(__pyx_t_5);
8923 __Pyx_AddTraceback(
"View.MemoryView.memoryview.__setitem__", __pyx_clineno, __pyx_lineno, __pyx_filename);
8927 __Pyx_XDECREF(__pyx_v_indices);
8928 __Pyx_XDECREF(__pyx_v_obj);
8929 __Pyx_XDECREF((PyObject *)__pyx_v_target_slice);
8931 __Pyx_RefNannyFinishContext();
8943static PyObject *__pyx_memoryview_is_slice(
struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_obj) {
8944 PyObject *__pyx_r = NULL;
8945 __Pyx_RefNannyDeclarations
8948 PyObject *__pyx_t_3 = NULL;
8949 PyObject *__pyx_t_4 = NULL;
8950 PyObject *__pyx_t_5 = NULL;
8951 PyObject *__pyx_t_6 = NULL;
8952 PyObject *__pyx_t_7 = NULL;
8953 PyObject *__pyx_t_8 = NULL;
8954 PyObject *__pyx_t_9 = NULL;
8957 int __pyx_lineno = 0;
8958 const char *__pyx_filename = NULL;
8959 int __pyx_clineno = 0;
8960 __Pyx_RefNannySetupContext(
"is_slice", 0);
8961 __Pyx_INCREF(__pyx_v_obj);
8970 __pyx_t_1 = __Pyx_TypeCheck(__pyx_v_obj, __pyx_mstate_global->__pyx_memoryview_type);
8971 __pyx_t_2 = (!__pyx_t_1);
8985 __Pyx_PyThreadState_declare
8986 __Pyx_PyThreadState_assign
8987 __Pyx_ExceptionSave(&__pyx_t_3, &__pyx_t_4, &__pyx_t_5);
8988 __Pyx_XGOTREF(__pyx_t_3);
8989 __Pyx_XGOTREF(__pyx_t_4);
8990 __Pyx_XGOTREF(__pyx_t_5);
9001 __pyx_t_8 = __Pyx_PyLong_From_int(((__pyx_v_self->flags & (~PyBUF_WRITABLE)) | PyBUF_ANY_CONTIGUOUS));
if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 472, __pyx_L4_error)
9002 __Pyx_GOTREF(__pyx_t_8);
9011 __pyx_t_9 = __Pyx_PyBool_FromLong(__pyx_v_self->dtype_is_object);
if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 473, __pyx_L4_error)
9012 __Pyx_GOTREF(__pyx_t_9);
9015 PyObject *__pyx_callargs[4] = {__pyx_t_7, __pyx_v_obj, __pyx_t_8, __pyx_t_9};
9016 __pyx_t_6 = __Pyx_PyObject_FastCall((PyObject*)__pyx_mstate_global->__pyx_memoryview_type, __pyx_callargs+__pyx_t_10, (4-__pyx_t_10) | (__pyx_t_10*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
9017 __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
9018 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
9019 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
9020 if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 472, __pyx_L4_error)
9021 __Pyx_GOTREF((PyObject *)__pyx_t_6);
9023 __Pyx_DECREF_SET(__pyx_v_obj, ((PyObject *)__pyx_t_6));
9034 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
9035 __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
9036 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
9037 goto __pyx_L9_try_end;
9039 __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
9040 __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
9041 __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
9042 __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
9051 __pyx_t_11 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(((PyTypeObject*)PyExc_TypeError))));
9053 __Pyx_ErrRestore(0,0,0);
9063 PyObject *__pyx_temp;
9065 __pyx_temp = __pyx_r;
9066 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
9068 __Pyx_XDECREF(__pyx_temp);
9070 goto __pyx_L7_except_return;
9072 goto __pyx_L6_except_error;
9081 __pyx_L6_except_error:;
9082 __Pyx_XGIVEREF(__pyx_t_3);
9083 __Pyx_XGIVEREF(__pyx_t_4);
9084 __Pyx_XGIVEREF(__pyx_t_5);
9085 __Pyx_ExceptionReset(__pyx_t_3, __pyx_t_4, __pyx_t_5);
9086 goto __pyx_L1_error;
9087 __pyx_L7_except_return:;
9088 __Pyx_XGIVEREF(__pyx_t_3);
9089 __Pyx_XGIVEREF(__pyx_t_4);
9090 __Pyx_XGIVEREF(__pyx_t_5);
9091 __Pyx_ExceptionReset(__pyx_t_3, __pyx_t_4, __pyx_t_5);
9113 PyObject *__pyx_temp;
9115 __pyx_temp = __pyx_r;
9116 __Pyx_INCREF(__pyx_v_obj);
9117 __pyx_r = __pyx_v_obj;
9119 __Pyx_XDECREF(__pyx_temp);
9133 __Pyx_XDECREF(__pyx_t_6);
9134 __Pyx_XDECREF(__pyx_t_7);
9135 __Pyx_XDECREF(__pyx_t_8);
9136 __Pyx_XDECREF(__pyx_t_9);
9137 __Pyx_AddTraceback(
"View.MemoryView.memoryview.is_slice", __pyx_clineno, __pyx_lineno, __pyx_filename);
9140 __Pyx_XDECREF(__pyx_v_obj);
9141 __Pyx_XGIVEREF(__pyx_r);
9142 __Pyx_RefNannyFinishContext();
9154static PyObject *__pyx_memoryview_setitem_slice_assignment(
struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_dst, PyObject *__pyx_v_src) {
9155 __Pyx_memviewslice __pyx_v_dst_slice;
9156 __Pyx_memviewslice __pyx_v_src_slice;
9157 __Pyx_memviewslice __pyx_v_msrc;
9158 __Pyx_memviewslice __pyx_v_mdst;
9159 PyObject *__pyx_r = NULL;
9160 __Pyx_RefNannyDeclarations
9161 __Pyx_memviewslice *__pyx_t_1;
9162 PyObject *__pyx_t_2 = NULL;
9166 int __pyx_lineno = 0;
9167 const char *__pyx_filename = NULL;
9168 int __pyx_clineno = 0;
9169 __Pyx_RefNannySetupContext(
"setitem_slice_assignment", 0);
9178 if (!(likely(((__pyx_v_src) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_src, __pyx_mstate_global->__pyx_memoryview_type))))) __PYX_ERR(1, 483, __pyx_L1_error)
9179 __pyx_t_1 = __pyx_memoryview_get_slice_from_memoryview(((
struct __pyx_memoryview_obj *)__pyx_v_src), (&__pyx_v_src_slice));
if (unlikely(__pyx_t_1 == ((
void *)NULL))) __PYX_ERR(1, 483, __pyx_L1_error)
9180 __pyx_v_msrc = (__pyx_t_1[0]);
9190 if (!(likely(((__pyx_v_dst) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_dst, __pyx_mstate_global->__pyx_memoryview_type))))) __PYX_ERR(1, 484, __pyx_L1_error)
9191 __pyx_t_1 = __pyx_memoryview_get_slice_from_memoryview(((
struct __pyx_memoryview_obj *)__pyx_v_dst), (&__pyx_v_dst_slice));
if (unlikely(__pyx_t_1 == ((
void *)NULL))) __PYX_ERR(1, 484, __pyx_L1_error)
9192 __pyx_v_mdst = (__pyx_t_1[0]);
9202 __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_src, __pyx_mstate_global->__pyx_n_u_ndim);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 486, __pyx_L1_error)
9203 __Pyx_GOTREF(__pyx_t_2);
9204 __pyx_t_3 = __Pyx_PyLong_As_int(__pyx_t_2);
if (unlikely((__pyx_t_3 == (
int)-1) && PyErr_Occurred())) __PYX_ERR(1, 486, __pyx_L1_error)
9205 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
9206 __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_dst, __pyx_mstate_global->__pyx_n_u_ndim);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 486, __pyx_L1_error)
9207 __Pyx_GOTREF(__pyx_t_2);
9208 __pyx_t_4 = __Pyx_PyLong_As_int(__pyx_t_2);
if (unlikely((__pyx_t_4 == (
int)-1) && PyErr_Occurred())) __PYX_ERR(1, 486, __pyx_L1_error)
9209 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
9210 __pyx_t_5 = __pyx_memoryview_copy_contents(__pyx_v_msrc, __pyx_v_mdst, __pyx_t_3, __pyx_t_4, __pyx_v_self->dtype_is_object);
if (unlikely(__pyx_t_5 == ((
int)-1))) __PYX_ERR(1, 486, __pyx_L1_error)
9224 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
9227 __Pyx_XDECREF(__pyx_t_2);
9228 __Pyx_AddTraceback(
"View.MemoryView.memoryview.setitem_slice_assignment", __pyx_clineno, __pyx_lineno, __pyx_filename);
9235 __Pyx_XGIVEREF(__pyx_r);
9236 __Pyx_RefNannyFinishContext();
9248static PyObject *__pyx_memoryview_setitem_slice_assign_scalar(
struct __pyx_memoryview_obj *__pyx_v_self,
struct __pyx_memoryview_obj *__pyx_v_dst, PyObject *__pyx_v_value) {
9249 int __pyx_v_array[128];
9252 __Pyx_memviewslice *__pyx_v_dst_slice;
9253 __Pyx_memviewslice __pyx_v_tmp_slice;
9254 PyObject *__pyx_r = NULL;
9255 __Pyx_RefNannyDeclarations
9256 __Pyx_memviewslice *__pyx_t_1;
9258 PyObject *__pyx_t_3 = NULL;
9261 char const *__pyx_t_6;
9262 PyObject *__pyx_t_7 = NULL;
9263 PyObject *__pyx_t_8 = NULL;
9264 PyObject *__pyx_t_9 = NULL;
9265 PyObject *__pyx_t_10 = NULL;
9266 PyObject *__pyx_t_11 = NULL;
9267 PyObject *__pyx_t_12 = NULL;
9268 int __pyx_lineno = 0;
9269 const char *__pyx_filename = NULL;
9270 int __pyx_clineno = 0;
9271 __Pyx_RefNannySetupContext(
"setitem_slice_assign_scalar", 0);
9289 __pyx_t_1 = __pyx_memoryview_get_slice_from_memoryview(__pyx_v_dst, (&__pyx_v_tmp_slice));
if (unlikely(__pyx_t_1 == ((
void *)NULL))) __PYX_ERR(1, 496, __pyx_L1_error)
9290 __pyx_v_dst_slice = __pyx_t_1;
9299 __pyx_t_2 = (((size_t)__pyx_v_self->view.itemsize) > (
sizeof(__pyx_v_array)));
9311 __pyx_v_tmp = PyMem_Malloc(((
size_t)__pyx_v_self->view.itemsize));
9320 __pyx_t_2 = (__pyx_v_tmp == NULL);
9322 if (unlikely(__pyx_t_2)) {
9332 PyErr_NoMemory(); __PYX_ERR(1, 501, __pyx_L1_error)
9350 __pyx_v_item = __pyx_v_tmp;
9370 __pyx_v_item = ((
void *)__pyx_v_array);
9390 if (__pyx_v_self->dtype_is_object) {
9399 (((PyObject **)__pyx_v_item)[0]) = ((PyObject *)__pyx_v_value);
9419 __pyx_t_3 = ((
struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->assign_item_from_object(__pyx_v_self, ((
char *)__pyx_v_item), __pyx_v_value);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 510, __pyx_L6_error)
9420 __Pyx_GOTREF(__pyx_t_3);
9421 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
9432 __pyx_t_2 = (__pyx_v_self->view.suboffsets != NULL);
9444 __pyx_t_4 = assert_direct_dimensions(__pyx_v_self->view.suboffsets, __pyx_v_self->view.ndim);
if (unlikely(__pyx_t_4 == ((
int)-1))) __PYX_ERR(1, 515, __pyx_L6_error)
9463 __pyx_memoryview_slice_assign_scalar(__pyx_v_dst_slice, __pyx_v_dst->view.ndim, ((
size_t)__pyx_v_self->view.itemsize), __pyx_v_item, __pyx_v_self->dtype_is_object);
9475 PyMem_Free(__pyx_v_tmp);
9480 __Pyx_PyThreadState_declare
9481 __Pyx_PyThreadState_assign
9482 __pyx_t_7 = 0; __pyx_t_8 = 0; __pyx_t_9 = 0; __pyx_t_10 = 0; __pyx_t_11 = 0; __pyx_t_12 = 0;
9483 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
9484 __Pyx_ExceptionSwap(&__pyx_t_10, &__pyx_t_11, &__pyx_t_12);
9485 if ( unlikely(__Pyx_GetException(&__pyx_t_7, &__pyx_t_8, &__pyx_t_9) < 0)) __Pyx_ErrFetch(&__pyx_t_7, &__pyx_t_8, &__pyx_t_9);
9486 __Pyx_XGOTREF(__pyx_t_7);
9487 __Pyx_XGOTREF(__pyx_t_8);
9488 __Pyx_XGOTREF(__pyx_t_9);
9489 __Pyx_XGOTREF(__pyx_t_10);
9490 __Pyx_XGOTREF(__pyx_t_11);
9491 __Pyx_XGOTREF(__pyx_t_12);
9492 __pyx_t_4 = __pyx_lineno; __pyx_t_5 = __pyx_clineno; __pyx_t_6 = __pyx_filename;
9494 PyMem_Free(__pyx_v_tmp);
9496 __Pyx_XGIVEREF(__pyx_t_10);
9497 __Pyx_XGIVEREF(__pyx_t_11);
9498 __Pyx_XGIVEREF(__pyx_t_12);
9499 __Pyx_ExceptionReset(__pyx_t_10, __pyx_t_11, __pyx_t_12);
9500 __Pyx_XGIVEREF(__pyx_t_7);
9501 __Pyx_XGIVEREF(__pyx_t_8);
9502 __Pyx_XGIVEREF(__pyx_t_9);
9503 __Pyx_ErrRestore(__pyx_t_7, __pyx_t_8, __pyx_t_9);
9504 __pyx_t_7 = 0; __pyx_t_8 = 0; __pyx_t_9 = 0; __pyx_t_10 = 0; __pyx_t_11 = 0; __pyx_t_12 = 0;
9505 __pyx_lineno = __pyx_t_4; __pyx_clineno = __pyx_t_5; __pyx_filename = __pyx_t_6;
9506 goto __pyx_L1_error;
9520 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
9523 __Pyx_XDECREF(__pyx_t_3);
9524 __Pyx_AddTraceback(
"View.MemoryView.memoryview.setitem_slice_assign_scalar", __pyx_clineno, __pyx_lineno, __pyx_filename);
9532 __Pyx_XGIVEREF(__pyx_r);
9533 __Pyx_RefNannyFinishContext();
9545static PyObject *__pyx_memoryview_setitem_indexed(
struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_indices, PyObject *__pyx_v_value) {
9546 char *__pyx_v_itemp;
9547 PyObject *__pyx_r = NULL;
9548 __Pyx_RefNannyDeclarations
9550 PyObject *__pyx_t_2 = NULL;
9551 int __pyx_lineno = 0;
9552 const char *__pyx_filename = NULL;
9553 int __pyx_clineno = 0;
9554 __Pyx_RefNannySetupContext(
"setitem_indexed", 0);
9563 __pyx_t_1 = __pyx_memoryview_get_item_pointer(__pyx_v_self, __pyx_v_indices);
if (unlikely(__pyx_t_1 == ((
void *)NULL))) __PYX_ERR(1, 523, __pyx_L1_error)
9564 __pyx_v_itemp = __pyx_t_1;
9573 __pyx_t_2 = ((
struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->assign_item_from_object(__pyx_v_self, __pyx_v_itemp, __pyx_v_value);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 524, __pyx_L1_error)
9574 __Pyx_GOTREF(__pyx_t_2);
9575 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
9586 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
9589 __Pyx_XDECREF(__pyx_t_2);
9590 __Pyx_AddTraceback(
"View.MemoryView.memoryview.setitem_indexed", __pyx_clineno, __pyx_lineno, __pyx_filename);
9594 __Pyx_XGIVEREF(__pyx_r);
9595 __Pyx_RefNannyFinishContext();
9607static PyObject *__pyx_memoryview_setitem_indexed1(
struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index, PyObject *__pyx_v_value) {
9608 char *__pyx_v_buffer;
9609 char *__pyx_v_itemp;
9610 PyObject *__pyx_r = NULL;
9611 __Pyx_RefNannyDeclarations
9612 Py_ssize_t __pyx_t_1;
9614 PyObject *__pyx_t_3 = NULL;
9615 int __pyx_lineno = 0;
9616 const char *__pyx_filename = NULL;
9617 int __pyx_clineno = 0;
9618 __Pyx_RefNannySetupContext(
"setitem_indexed1", 0);
9627 __pyx_v_buffer = ((
char *)__pyx_v_self->view.buf);
9636 __pyx_t_1 = __Pyx_PyIndex_AsSsize_t(__pyx_v_index);
if (unlikely((__pyx_t_1 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(1, 529, __pyx_L1_error)
9637 __pyx_t_2 = __pyx_pybuffer_index((&__pyx_v_self->view), __pyx_v_buffer, __pyx_t_1, 0);
if (unlikely(__pyx_t_2 == ((
void *)NULL))) __PYX_ERR(1, 529, __pyx_L1_error)
9638 __pyx_v_itemp = __pyx_t_2;
9648 __pyx_t_3 = ((
struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->assign_item_from_object(__pyx_v_self, __pyx_v_itemp, __pyx_v_value);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 530, __pyx_L1_error)
9649 __Pyx_GOTREF(__pyx_t_3);
9650 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
9661 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
9664 __Pyx_XDECREF(__pyx_t_3);
9665 __Pyx_AddTraceback(
"View.MemoryView.memoryview.setitem_indexed1", __pyx_clineno, __pyx_lineno, __pyx_filename);
9670 __Pyx_XGIVEREF(__pyx_r);
9671 __Pyx_RefNannyFinishContext();
9683static PyObject *__pyx_memoryview_convert_item_to_object(
struct __pyx_memoryview_obj *__pyx_v_self,
char *__pyx_v_itemp) {
9684 PyObject *__pyx_v_struct = NULL;
9685 PyObject *__pyx_v_bytesitem = 0;
9686 PyObject *__pyx_v_result = NULL;
9687 PyObject *__pyx_r = NULL;
9688 __Pyx_RefNannyDeclarations
9689 PyObject *__pyx_t_1 = NULL;
9690 PyObject *__pyx_t_2 = NULL;
9691 PyObject *__pyx_t_3 = NULL;
9692 PyObject *__pyx_t_4 = NULL;
9693 PyObject *__pyx_t_5 = NULL;
9694 PyObject *__pyx_t_6 = NULL;
9696 Py_ssize_t __pyx_t_8;
9698 PyObject *__pyx_t_10 = NULL;
9700 int __pyx_lineno = 0;
9701 const char *__pyx_filename = NULL;
9702 int __pyx_clineno = 0;
9703 __Pyx_RefNannySetupContext(
"convert_item_to_object", 0);
9712 __pyx_t_2 = __Pyx_Import(__pyx_mstate_global->__pyx_n_u_struct, 0, 0, NULL, 0);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 535, __pyx_L1_error)
9713 __pyx_t_1 = __pyx_t_2;
9714 __Pyx_GOTREF(__pyx_t_1);
9715 __pyx_v_struct = __pyx_t_1;
9725 __pyx_t_1 = __Pyx_PyBytes_FromStringAndSize(__pyx_v_itemp + 0, __pyx_v_self->view.itemsize - 0);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 538, __pyx_L1_error)
9726 __Pyx_GOTREF(__pyx_t_1);
9727 __pyx_v_bytesitem = ((PyObject*)__pyx_t_1);
9738 __Pyx_PyThreadState_declare
9739 __Pyx_PyThreadState_assign
9740 __Pyx_ExceptionSave(&__pyx_t_2, &__pyx_t_3, &__pyx_t_4);
9741 __Pyx_XGOTREF(__pyx_t_2);
9742 __Pyx_XGOTREF(__pyx_t_3);
9743 __Pyx_XGOTREF(__pyx_t_4);
9753 __pyx_t_5 = __pyx_v_struct;
9754 __Pyx_INCREF(__pyx_t_5);
9755 __pyx_t_6 = __Pyx_PyBytes_FromString(__pyx_v_self->view.format);
if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 540, __pyx_L3_error)
9756 __Pyx_GOTREF(__pyx_t_6);
9759 PyObject *__pyx_callargs[3] = {__pyx_t_5, __pyx_t_6, __pyx_v_bytesitem};
9760 __pyx_t_1 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_unpack, __pyx_callargs+__pyx_t_7, (3-__pyx_t_7) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
9761 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
9762 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
9763 if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 540, __pyx_L3_error)
9764 __Pyx_GOTREF(__pyx_t_1);
9766 __pyx_v_result = __pyx_t_1;
9786 __pyx_t_8 = __Pyx_ssize_strlen(__pyx_v_self->view.format);
if (unlikely(__pyx_t_8 == ((Py_ssize_t)-1))) __PYX_ERR(1, 544, __pyx_L5_except_error)
9787 __pyx_t_9 = (__pyx_t_8 == 1);
9800 __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_result, 0,
long, 1, __Pyx_PyLong_From_long, 0, 1, 1, __Pyx_ReferenceSharing_OwnStrongReference);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 545, __pyx_L5_except_error)
9801 __Pyx_GOTREF(__pyx_t_1);
9803 PyObject *__pyx_temp;
9805 __pyx_temp = __pyx_r;
9806 __pyx_r = __pyx_t_1;
9808 __Pyx_XDECREF(__pyx_temp);
9811 goto __pyx_L6_except_return;
9830 PyObject *__pyx_temp;
9832 __pyx_temp = __pyx_r;
9833 __Pyx_INCREF(__pyx_v_result);
9834 __pyx_r = __pyx_v_result;
9836 __Pyx_XDECREF(__pyx_temp);
9838 goto __pyx_L6_except_return;
9841 __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
9842 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
9843 __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
9852 __Pyx_ErrFetch(&__pyx_t_1, &__pyx_t_6, &__pyx_t_5);
9853 __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_v_struct, __pyx_mstate_global->__pyx_n_u_error);
if (unlikely(!__pyx_t_10)) __PYX_ERR(1, 541, __pyx_L5_except_error)
9854 __Pyx_GOTREF(__pyx_t_10);
9855 __pyx_t_11 = __Pyx_PyErr_GivenExceptionMatches(__pyx_t_1, __pyx_t_10);
9856 __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
9857 __Pyx_ErrRestore(__pyx_t_1, __pyx_t_6, __pyx_t_5);
9858 __pyx_t_1 = 0; __pyx_t_6 = 0; __pyx_t_5 = 0;
9860 __Pyx_AddTraceback(
"View.MemoryView.memoryview.convert_item_to_object", __pyx_clineno, __pyx_lineno, __pyx_filename);
9861 if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_1) < 0) __PYX_ERR(1, 541, __pyx_L5_except_error)
9862 __Pyx_XGOTREF(__pyx_t_5);
9863 __Pyx_XGOTREF(__pyx_t_6);
9864 __Pyx_XGOTREF(__pyx_t_1);
9873 __pyx_t_11 = __pyx_memoryview_err_ValueError(__pyx_k_Unable_to_convert_item_to_object);
if (unlikely(__pyx_t_11 == ((
int)-1))) __PYX_ERR(1, 542, __pyx_L5_except_error)
9875 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
9876 __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
9877 __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
9878 goto __pyx_L4_exception_handled;
9880 goto __pyx_L5_except_error;
9889 __pyx_L5_except_error:;
9890 __Pyx_XGIVEREF(__pyx_t_2);
9891 __Pyx_XGIVEREF(__pyx_t_3);
9892 __Pyx_XGIVEREF(__pyx_t_4);
9893 __Pyx_ExceptionReset(__pyx_t_2, __pyx_t_3, __pyx_t_4);
9894 goto __pyx_L1_error;
9895 __pyx_L6_except_return:;
9896 __Pyx_XGIVEREF(__pyx_t_2);
9897 __Pyx_XGIVEREF(__pyx_t_3);
9898 __Pyx_XGIVEREF(__pyx_t_4);
9899 __Pyx_ExceptionReset(__pyx_t_2, __pyx_t_3, __pyx_t_4);
9901 __pyx_L4_exception_handled:;
9902 __Pyx_XGIVEREF(__pyx_t_2);
9903 __Pyx_XGIVEREF(__pyx_t_3);
9904 __Pyx_XGIVEREF(__pyx_t_4);
9905 __Pyx_ExceptionReset(__pyx_t_2, __pyx_t_3, __pyx_t_4);
9917 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
9920 __Pyx_XDECREF(__pyx_t_1);
9921 __Pyx_XDECREF(__pyx_t_5);
9922 __Pyx_XDECREF(__pyx_t_6);
9923 __Pyx_XDECREF(__pyx_t_10);
9924 __Pyx_AddTraceback(
"View.MemoryView.memoryview.convert_item_to_object", __pyx_clineno, __pyx_lineno, __pyx_filename);
9927 __Pyx_XDECREF(__pyx_v_struct);
9928 __Pyx_XDECREF(__pyx_v_bytesitem);
9929 __Pyx_XDECREF(__pyx_v_result);
9930 __Pyx_XGIVEREF(__pyx_r);
9931 __Pyx_RefNannyFinishContext();
9943static PyObject *__pyx_memoryview_assign_item_from_object(
struct __pyx_memoryview_obj *__pyx_v_self,
char *__pyx_v_itemp, PyObject *__pyx_v_value) {
9944 PyObject *__pyx_v_struct = NULL;
9946 PyObject *__pyx_v_bytesvalue = 0;
9947 Py_ssize_t __pyx_v_i;
9948 PyObject *__pyx_r = NULL;
9949 __Pyx_RefNannyDeclarations
9950 PyObject *__pyx_t_1 = NULL;
9951 PyObject *__pyx_t_2 = NULL;
9953 PyObject *__pyx_t_4 = NULL;
9954 PyObject *__pyx_t_5 = NULL;
9955 PyObject *__pyx_t_6 = NULL;
9957 Py_ssize_t __pyx_t_8;
9958 PyObject *__pyx_t_9 = NULL;
9961 Py_ssize_t __pyx_t_12;
9964 int __pyx_lineno = 0;
9965 const char *__pyx_filename = NULL;
9966 int __pyx_clineno = 0;
9967 __Pyx_RefNannySetupContext(
"assign_item_from_object", 0);
9976 __pyx_t_2 = __Pyx_Import(__pyx_mstate_global->__pyx_n_u_struct, 0, 0, NULL, 0);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 551, __pyx_L1_error)
9977 __pyx_t_1 = __pyx_t_2;
9978 __Pyx_GOTREF(__pyx_t_1);
9979 __pyx_v_struct = __pyx_t_1;
9989 __pyx_t_3 = PyTuple_Check(__pyx_v_value);
10000 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_struct, __pyx_mstate_global->__pyx_n_u_pack);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 557, __pyx_L1_error)
10001 __Pyx_GOTREF(__pyx_t_1);
10002 __pyx_t_4 = __Pyx_PyBytes_FromString(__pyx_v_self->view.format);
if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 557, __pyx_L1_error)
10003 __Pyx_GOTREF(__pyx_t_4);
10004 __pyx_t_5 = PyTuple_New(1);
if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 557, __pyx_L1_error)
10005 __Pyx_GOTREF(__pyx_t_5);
10006 __Pyx_GIVEREF(__pyx_t_4);
10007 if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4) != (0)) __PYX_ERR(1, 557, __pyx_L1_error);
10009 __pyx_t_4 = __Pyx_PySequence_Tuple(__pyx_v_value);
if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 557, __pyx_L1_error)
10010 __Pyx_GOTREF(__pyx_t_4);
10011 __pyx_t_6 = PyNumber_Add(__pyx_t_5, __pyx_t_4);
if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 557, __pyx_L1_error)
10012 __Pyx_GOTREF(__pyx_t_6);
10013 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
10014 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
10015 __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_6, NULL);
if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 557, __pyx_L1_error)
10016 __Pyx_GOTREF(__pyx_t_4);
10017 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
10018 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
10019 if (!(likely(PyBytes_CheckExact(__pyx_t_4))||((__pyx_t_4) == Py_None) || __Pyx_RaiseUnexpectedTypeError(
"bytes", __pyx_t_4))) __PYX_ERR(1, 557, __pyx_L1_error)
10020 __pyx_v_bytesvalue = ((PyObject*)__pyx_t_4);
10041 __pyx_t_6 = __pyx_v_struct;
10042 __Pyx_INCREF(__pyx_t_6);
10043 __pyx_t_1 = __Pyx_PyBytes_FromString(__pyx_v_self->view.format);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 559, __pyx_L1_error)
10044 __Pyx_GOTREF(__pyx_t_1);
10047 PyObject *__pyx_callargs[3] = {__pyx_t_6, __pyx_t_1, __pyx_v_value};
10048 __pyx_t_4 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_pack, __pyx_callargs+__pyx_t_7, (3-__pyx_t_7) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
10049 __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
10050 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
10051 if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 559, __pyx_L1_error)
10052 __Pyx_GOTREF(__pyx_t_4);
10054 if (!(likely(PyBytes_CheckExact(__pyx_t_4))||((__pyx_t_4) == Py_None) || __Pyx_RaiseUnexpectedTypeError(
"bytes", __pyx_t_4))) __PYX_ERR(1, 559, __pyx_L1_error)
10055 __pyx_v_bytesvalue = ((PyObject*)__pyx_t_4);
10069 if (unlikely(__pyx_v_bytesvalue == Py_None)) {
10070 PyErr_SetString(PyExc_TypeError,
"\047NoneType\047 is not iterable");
10071 __PYX_ERR(1, 561, __pyx_L1_error)
10073 __Pyx_INCREF(__pyx_v_bytesvalue);
10074 __pyx_t_9 = __pyx_v_bytesvalue;
10075 __pyx_t_11 = __Pyx_PyBytes_AsWritableString(__pyx_t_9);
if (unlikely(__pyx_t_11 == ((
char *)NULL))) __PYX_ERR(1, 561, __pyx_L1_error)
10076 __pyx_t_12 = __Pyx_PyBytes_GET_SIZE(__pyx_t_9);
if (unlikely(__pyx_t_12 == ((Py_ssize_t)-1))) __PYX_ERR(1, 561, __pyx_L1_error)
10077 __pyx_t_13 = (__pyx_t_11 + __pyx_t_12);
10079 for (__pyx_t_14 = __pyx_t_11; __pyx_t_14 < __pyx_t_13; __pyx_t_14++) {
10080 __pyx_t_10 = __pyx_t_14;
10081 __pyx_v_c = (__pyx_t_10[0]);
10090 __pyx_v_i = __pyx_t_8;
10099 __pyx_t_8 = (__pyx_t_8 + 1);
10108 (__pyx_v_itemp[__pyx_v_i]) = __pyx_v_c;
10113 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
10124 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
10127 __Pyx_XDECREF(__pyx_t_1);
10128 __Pyx_XDECREF(__pyx_t_4);
10129 __Pyx_XDECREF(__pyx_t_5);
10130 __Pyx_XDECREF(__pyx_t_6);
10131 __Pyx_XDECREF(__pyx_t_9);
10132 __Pyx_AddTraceback(
"View.MemoryView.memoryview.assign_item_from_object", __pyx_clineno, __pyx_lineno, __pyx_filename);
10135 __Pyx_XDECREF(__pyx_v_struct);
10137 __Pyx_XDECREF(__pyx_v_bytesvalue);
10139 __Pyx_XGIVEREF(__pyx_r);
10140 __Pyx_RefNannyFinishContext();
10153CYTHON_UNUSED
static int __pyx_memoryview_getbuffer(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info,
int __pyx_v_flags);
10154CYTHON_UNUSED
static int __pyx_memoryview_getbuffer(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info,
int __pyx_v_flags) {
10155 CYTHON_UNUSED PyObject *
const *__pyx_kwvalues;
10157 __Pyx_RefNannyDeclarations
10158 __Pyx_RefNannySetupContext(
"__getbuffer__ (wrapper)", 0);
10159 __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
10160 __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_8__getbuffer__(((
struct __pyx_memoryview_obj *)__pyx_v_self), ((Py_buffer *)__pyx_v_info), ((
int)__pyx_v_flags));
10165 __Pyx_RefNannyFinishContext();
10169static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_8__getbuffer__(
struct __pyx_memoryview_obj *__pyx_v_self, Py_buffer *__pyx_v_info,
int __pyx_v_flags) {
10171 __Pyx_RefNannyDeclarations
10175 Py_ssize_t *__pyx_t_4;
10178 Py_ssize_t __pyx_t_7;
10179 int __pyx_lineno = 0;
10180 const char *__pyx_filename = NULL;
10181 int __pyx_clineno = 0;
10182 if (unlikely(__pyx_v_info == NULL)) {
10183 PyErr_SetString(PyExc_BufferError,
"PyObject_GetBuffer: view==NULL argument is obsolete");
10186 __Pyx_RefNannySetupContext(
"__getbuffer__", 0);
10187 __pyx_v_info->obj = Py_None; __Pyx_INCREF(Py_None);
10188 __Pyx_GIVEREF(__pyx_v_info->obj);
10197 __pyx_t_2 = ((__pyx_v_flags & PyBUF_WRITABLE) != 0);
10203 __pyx_t_1 = __pyx_t_2;
10205 goto __pyx_L4_bool_binop_done;
10208 __pyx_t_1 = __pyx_v_self->view.readonly;
10209 __pyx_L4_bool_binop_done:;
10210 if (unlikely(__pyx_t_1)) {
10220 __pyx_t_3 = __pyx_memoryview_err_ValueError(__pyx_k_Cannot_create_writable_memory_vi);
if (unlikely(__pyx_t_3 == ((
int)-1))) __PYX_ERR(1, 567, __pyx_L1_error)
10239 __pyx_t_1 = ((__pyx_v_flags & PyBUF_ND) != 0);
10251 __pyx_t_4 = __pyx_v_self->view.shape;
10253 __pyx_v_info->shape = __pyx_t_4;
10273 __pyx_v_info->shape = NULL;
10284 __pyx_t_1 = ((__pyx_v_flags & PyBUF_STRIDES) != 0);
10296 __pyx_t_4 = __pyx_v_self->view.strides;
10298 __pyx_v_info->strides = __pyx_t_4;
10318 __pyx_v_info->strides = NULL;
10329 __pyx_t_1 = ((__pyx_v_flags & PyBUF_INDIRECT) != 0);
10341 __pyx_t_4 = __pyx_v_self->view.suboffsets;
10343 __pyx_v_info->suboffsets = __pyx_t_4;
10363 __pyx_v_info->suboffsets = NULL;
10374 __pyx_t_1 = ((__pyx_v_flags & PyBUF_FORMAT) != 0);
10386 __pyx_t_5 = __pyx_v_self->view.format;
10388 __pyx_v_info->format = __pyx_t_5;
10408 __pyx_v_info->format = NULL;
10419 __pyx_t_6 = __pyx_v_self->view.buf;
10421 __pyx_v_info->buf = __pyx_t_6;
10430 __pyx_t_3 = __pyx_v_self->view.ndim;
10432 __pyx_v_info->ndim = __pyx_t_3;
10441 __pyx_t_7 = __pyx_v_self->view.itemsize;
10443 __pyx_v_info->itemsize = __pyx_t_7;
10452 __pyx_t_7 = __pyx_v_self->view.len;
10454 __pyx_v_info->len = __pyx_t_7;
10463 __pyx_t_1 = __pyx_v_self->view.readonly;
10465 __pyx_v_info->readonly = __pyx_t_1;
10474 __Pyx_INCREF((PyObject *)__pyx_v_self);
10475 __Pyx_GIVEREF((PyObject *)__pyx_v_self);
10476 __Pyx_GOTREF(__pyx_v_info->obj);
10477 __Pyx_DECREF(__pyx_v_info->obj);
10478 __pyx_v_info->obj = ((PyObject *)__pyx_v_self);
10492 __Pyx_AddTraceback(
"View.MemoryView.memoryview.__getbuffer__", __pyx_clineno, __pyx_lineno, __pyx_filename);
10494 if (__pyx_v_info->obj != NULL) {
10495 __Pyx_GOTREF(__pyx_v_info->obj);
10496 __Pyx_DECREF(__pyx_v_info->obj); __pyx_v_info->obj = 0;
10500 if (__pyx_v_info->obj == Py_None) {
10501 __Pyx_GOTREF(__pyx_v_info->obj);
10502 __Pyx_DECREF(__pyx_v_info->obj); __pyx_v_info->obj = 0;
10506 __Pyx_RefNannyFinishContext();
10519static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_1T_1__get__(PyObject *__pyx_v_self);
10520static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_1T_1__get__(PyObject *__pyx_v_self) {
10521 CYTHON_UNUSED PyObject *
const *__pyx_kwvalues;
10522 PyObject *__pyx_r = 0;
10523 __Pyx_RefNannyDeclarations
10524 __Pyx_RefNannySetupContext(
"__get__ (wrapper)", 0);
10525 __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
10526 __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_1T___get__(((
struct __pyx_memoryview_obj *)__pyx_v_self));
10529 __Pyx_RefNannyFinishContext();
10533static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_1T___get__(
struct __pyx_memoryview_obj *__pyx_v_self) {
10534 struct __pyx_memoryviewslice_obj *__pyx_v_result = 0;
10535 PyObject *__pyx_r = NULL;
10536 __Pyx_RefNannyDeclarations
10537 PyObject *__pyx_t_1 = NULL;
10539 int __pyx_lineno = 0;
10540 const char *__pyx_filename = NULL;
10541 int __pyx_clineno = 0;
10542 __Pyx_RefNannySetupContext(
"__get__", 0);
10551 __pyx_t_1 = __pyx_memoryview_copy_object(__pyx_v_self);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 599, __pyx_L1_error)
10552 __Pyx_GOTREF(__pyx_t_1);
10553 if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_mstate_global->__pyx_memoryviewslice_type))))) __PYX_ERR(1, 599, __pyx_L1_error)
10554 __pyx_v_result = ((
struct __pyx_memoryviewslice_obj *)__pyx_t_1);
10564 __pyx_t_2 = __pyx_memslice_transpose((&__pyx_v_result->from_slice));
if (unlikely(__pyx_t_2 == ((
int)-1))) __PYX_ERR(1, 600, __pyx_L1_error)
10575 PyObject *__pyx_temp;
10577 __pyx_temp = __pyx_r;
10578 __Pyx_INCREF((PyObject *)__pyx_v_result);
10579 __pyx_r = ((PyObject *)__pyx_v_result);
10581 __Pyx_XDECREF(__pyx_temp);
10595 __Pyx_XDECREF(__pyx_t_1);
10596 __Pyx_AddTraceback(
"View.MemoryView.memoryview.T.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
10599 __Pyx_XDECREF((PyObject *)__pyx_v_result);
10600 __Pyx_XGIVEREF(__pyx_r);
10601 __Pyx_RefNannyFinishContext();
10614static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_4base_1__get__(PyObject *__pyx_v_self);
10615static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_4base_1__get__(PyObject *__pyx_v_self) {
10616 CYTHON_UNUSED PyObject *
const *__pyx_kwvalues;
10617 PyObject *__pyx_r = 0;
10618 __Pyx_RefNannyDeclarations
10619 __Pyx_RefNannySetupContext(
"__get__ (wrapper)", 0);
10620 __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
10621 __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_4base___get__(((
struct __pyx_memoryview_obj *)__pyx_v_self));
10624 __Pyx_RefNannyFinishContext();
10628static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_4base___get__(
struct __pyx_memoryview_obj *__pyx_v_self) {
10629 PyObject *__pyx_r = NULL;
10630 __Pyx_RefNannyDeclarations
10631 PyObject *__pyx_t_1 = NULL;
10632 int __pyx_lineno = 0;
10633 const char *__pyx_filename = NULL;
10634 int __pyx_clineno = 0;
10635 __Pyx_RefNannySetupContext(
"__get__", 0);
10644 __pyx_t_1 = ((
struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->_get_base(__pyx_v_self);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 605, __pyx_L1_error)
10645 __Pyx_GOTREF(__pyx_t_1);
10647 PyObject *__pyx_temp;
10649 __pyx_temp = __pyx_r;
10650 __pyx_r = __pyx_t_1;
10652 __Pyx_XDECREF(__pyx_temp);
10667 __Pyx_XDECREF(__pyx_t_1);
10668 __Pyx_AddTraceback(
"View.MemoryView.memoryview.base.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
10671 __Pyx_XGIVEREF(__pyx_r);
10672 __Pyx_RefNannyFinishContext();
10684static PyObject *__pyx_memoryview__get_base(
struct __pyx_memoryview_obj *__pyx_v_self) {
10685 PyObject *__pyx_r = NULL;
10686 __Pyx_RefNannyDeclarations
10687 __Pyx_RefNannySetupContext(
"_get_base", 0);
10697 PyObject *__pyx_temp;
10699 __pyx_temp = __pyx_r;
10700 __Pyx_INCREF(__pyx_v_self->obj);
10701 __pyx_r = __pyx_v_self->obj;
10703 __Pyx_XDECREF(__pyx_temp);
10717 __Pyx_XGIVEREF(__pyx_r);
10718 __Pyx_RefNannyFinishContext();
10731static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_5shape_1__get__(PyObject *__pyx_v_self);
10732static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_5shape_1__get__(PyObject *__pyx_v_self) {
10733 CYTHON_UNUSED PyObject *
const *__pyx_kwvalues;
10734 PyObject *__pyx_r = 0;
10735 __Pyx_RefNannyDeclarations
10736 __Pyx_RefNannySetupContext(
"__get__ (wrapper)", 0);
10737 __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
10738 __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_5shape___get__(((
struct __pyx_memoryview_obj *)__pyx_v_self));
10741 __Pyx_RefNannyFinishContext();
10745static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_5shape___get__(
struct __pyx_memoryview_obj *__pyx_v_self) {
10746 Py_ssize_t __pyx_7genexpr__pyx_v_length;
10747 PyObject *__pyx_r = NULL;
10748 __Pyx_RefNannyDeclarations
10749 PyObject *__pyx_t_1 = NULL;
10750 Py_ssize_t *__pyx_t_2;
10751 Py_ssize_t *__pyx_t_3;
10752 Py_ssize_t *__pyx_t_4;
10753 PyObject *__pyx_t_5 = NULL;
10754 int __pyx_lineno = 0;
10755 const char *__pyx_filename = NULL;
10756 int __pyx_clineno = 0;
10757 __Pyx_RefNannySetupContext(
"__get__", 0);
10767 __pyx_t_1 = PyList_New(0);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 612, __pyx_L1_error)
10768 __Pyx_GOTREF(__pyx_t_1);
10769 __pyx_t_3 = (__pyx_v_self->view.shape + __pyx_v_self->view.ndim);
10771 for (__pyx_t_4 = __pyx_v_self->view.shape; __pyx_t_4 < __pyx_t_3; __pyx_t_4++) {
10772 __pyx_t_2 = __pyx_t_4;
10773 __pyx_7genexpr__pyx_v_length = (__pyx_t_2[0]);
10774 __pyx_t_5 = PyLong_FromSsize_t(__pyx_7genexpr__pyx_v_length);
if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 612, __pyx_L1_error)
10775 __Pyx_GOTREF(__pyx_t_5);
10776 __Pyx_GIVEREF(__pyx_t_5);
10777 if (unlikely(__Pyx_ListComp_AppendAndDecref(__pyx_t_1, __pyx_t_5))) __PYX_ERR(1, 612, __pyx_L1_error)
10782 __pyx_t_5 = PyList_AsTuple(((PyObject*)__pyx_t_1));
if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 612, __pyx_L1_error)
10783 __Pyx_GOTREF(__pyx_t_5);
10784 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
10786 PyObject *__pyx_temp;
10788 __pyx_temp = __pyx_r;
10789 __pyx_r = __pyx_t_5;
10791 __Pyx_XDECREF(__pyx_temp);
10806 __Pyx_XDECREF(__pyx_t_1);
10807 __Pyx_XDECREF(__pyx_t_5);
10808 __Pyx_AddTraceback(
"View.MemoryView.memoryview.shape.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
10812 __Pyx_XGIVEREF(__pyx_r);
10813 __Pyx_RefNannyFinishContext();
10826static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_7strides_1__get__(PyObject *__pyx_v_self);
10827static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_7strides_1__get__(PyObject *__pyx_v_self) {
10828 CYTHON_UNUSED PyObject *
const *__pyx_kwvalues;
10829 PyObject *__pyx_r = 0;
10830 __Pyx_RefNannyDeclarations
10831 __Pyx_RefNannySetupContext(
"__get__ (wrapper)", 0);
10832 __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
10833 __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_7strides___get__(((
struct __pyx_memoryview_obj *)__pyx_v_self));
10836 __Pyx_RefNannyFinishContext();
10840static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_7strides___get__(
struct __pyx_memoryview_obj *__pyx_v_self) {
10841 Py_ssize_t __pyx_8genexpr1__pyx_v_stride;
10842 PyObject *__pyx_r = NULL;
10843 __Pyx_RefNannyDeclarations
10846 PyObject *__pyx_t_3 = NULL;
10847 Py_ssize_t *__pyx_t_4;
10848 Py_ssize_t *__pyx_t_5;
10849 Py_ssize_t *__pyx_t_6;
10850 PyObject *__pyx_t_7 = NULL;
10851 int __pyx_lineno = 0;
10852 const char *__pyx_filename = NULL;
10853 int __pyx_clineno = 0;
10854 __Pyx_RefNannySetupContext(
"__get__", 0);
10863 __pyx_t_1 = (__pyx_v_self->view.strides == NULL);
10865 if (unlikely(__pyx_t_1)) {
10875 __pyx_t_2 = __pyx_memoryview_err_ValueError(__pyx_k_Buffer_view_does_not_expose_stri);
if (unlikely(__pyx_t_2 == ((
int)-1))) __PYX_ERR(1, 618, __pyx_L1_error)
10895 __pyx_t_3 = PyList_New(0);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 620, __pyx_L1_error)
10896 __Pyx_GOTREF(__pyx_t_3);
10897 __pyx_t_5 = (__pyx_v_self->view.strides + __pyx_v_self->view.ndim);
10899 for (__pyx_t_6 = __pyx_v_self->view.strides; __pyx_t_6 < __pyx_t_5; __pyx_t_6++) {
10900 __pyx_t_4 = __pyx_t_6;
10901 __pyx_8genexpr1__pyx_v_stride = (__pyx_t_4[0]);
10902 __pyx_t_7 = PyLong_FromSsize_t(__pyx_8genexpr1__pyx_v_stride);
if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 620, __pyx_L1_error)
10903 __Pyx_GOTREF(__pyx_t_7);
10904 __Pyx_GIVEREF(__pyx_t_7);
10905 if (unlikely(__Pyx_ListComp_AppendAndDecref(__pyx_t_3, __pyx_t_7))) __PYX_ERR(1, 620, __pyx_L1_error)
10910 __pyx_t_7 = PyList_AsTuple(((PyObject*)__pyx_t_3));
if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 620, __pyx_L1_error)
10911 __Pyx_GOTREF(__pyx_t_7);
10912 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
10914 PyObject *__pyx_temp;
10916 __pyx_temp = __pyx_r;
10917 __pyx_r = __pyx_t_7;
10919 __Pyx_XDECREF(__pyx_temp);
10934 __Pyx_XDECREF(__pyx_t_3);
10935 __Pyx_XDECREF(__pyx_t_7);
10936 __Pyx_AddTraceback(
"View.MemoryView.memoryview.strides.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
10940 __Pyx_XGIVEREF(__pyx_r);
10941 __Pyx_RefNannyFinishContext();
10954static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_10suboffsets_1__get__(PyObject *__pyx_v_self);
10955static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_10suboffsets_1__get__(PyObject *__pyx_v_self) {
10956 CYTHON_UNUSED PyObject *
const *__pyx_kwvalues;
10957 PyObject *__pyx_r = 0;
10958 __Pyx_RefNannyDeclarations
10959 __Pyx_RefNannySetupContext(
"__get__ (wrapper)", 0);
10960 __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
10961 __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_10suboffsets___get__(((
struct __pyx_memoryview_obj *)__pyx_v_self));
10964 __Pyx_RefNannyFinishContext();
10968static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_10suboffsets___get__(
struct __pyx_memoryview_obj *__pyx_v_self) {
10969 Py_ssize_t __pyx_8genexpr2__pyx_v_suboffset;
10970 PyObject *__pyx_r = NULL;
10971 __Pyx_RefNannyDeclarations
10973 PyObject *__pyx_t_2 = NULL;
10974 Py_ssize_t *__pyx_t_3;
10975 Py_ssize_t *__pyx_t_4;
10976 Py_ssize_t *__pyx_t_5;
10977 PyObject *__pyx_t_6 = NULL;
10978 int __pyx_lineno = 0;
10979 const char *__pyx_filename = NULL;
10980 int __pyx_clineno = 0;
10981 __Pyx_RefNannySetupContext(
"__get__", 0);
10990 __pyx_t_1 = (__pyx_v_self->view.suboffsets == NULL);
11002 __pyx_t_2 = __Pyx_PySequence_Multiply(__pyx_mstate_global->__pyx_tuple[0], __pyx_v_self->view.ndim);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 625, __pyx_L1_error)
11003 __Pyx_GOTREF(__pyx_t_2);
11005 PyObject *__pyx_temp;
11007 __pyx_temp = __pyx_r;
11008 __pyx_r = __pyx_t_2;
11010 __Pyx_XDECREF(__pyx_temp);
11032 __pyx_t_2 = PyList_New(0);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 627, __pyx_L1_error)
11033 __Pyx_GOTREF(__pyx_t_2);
11034 __pyx_t_4 = (__pyx_v_self->view.suboffsets + __pyx_v_self->view.ndim);
11036 for (__pyx_t_5 = __pyx_v_self->view.suboffsets; __pyx_t_5 < __pyx_t_4; __pyx_t_5++) {
11037 __pyx_t_3 = __pyx_t_5;
11038 __pyx_8genexpr2__pyx_v_suboffset = (__pyx_t_3[0]);
11039 __pyx_t_6 = PyLong_FromSsize_t(__pyx_8genexpr2__pyx_v_suboffset);
if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 627, __pyx_L1_error)
11040 __Pyx_GOTREF(__pyx_t_6);
11041 __Pyx_GIVEREF(__pyx_t_6);
11042 if (unlikely(__Pyx_ListComp_AppendAndDecref(__pyx_t_2, __pyx_t_6))) __PYX_ERR(1, 627, __pyx_L1_error)
11047 __pyx_t_6 = PyList_AsTuple(((PyObject*)__pyx_t_2));
if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 627, __pyx_L1_error)
11048 __Pyx_GOTREF(__pyx_t_6);
11049 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
11051 PyObject *__pyx_temp;
11053 __pyx_temp = __pyx_r;
11054 __pyx_r = __pyx_t_6;
11056 __Pyx_XDECREF(__pyx_temp);
11071 __Pyx_XDECREF(__pyx_t_2);
11072 __Pyx_XDECREF(__pyx_t_6);
11073 __Pyx_AddTraceback(
"View.MemoryView.memoryview.suboffsets.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
11077 __Pyx_XGIVEREF(__pyx_r);
11078 __Pyx_RefNannyFinishContext();
11091static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_4ndim_1__get__(PyObject *__pyx_v_self);
11092static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_4ndim_1__get__(PyObject *__pyx_v_self) {
11093 CYTHON_UNUSED PyObject *
const *__pyx_kwvalues;
11094 PyObject *__pyx_r = 0;
11095 __Pyx_RefNannyDeclarations
11096 __Pyx_RefNannySetupContext(
"__get__ (wrapper)", 0);
11097 __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
11098 __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_4ndim___get__(((
struct __pyx_memoryview_obj *)__pyx_v_self));
11101 __Pyx_RefNannyFinishContext();
11105static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_4ndim___get__(
struct __pyx_memoryview_obj *__pyx_v_self) {
11106 PyObject *__pyx_r = NULL;
11107 __Pyx_RefNannyDeclarations
11108 PyObject *__pyx_t_1 = NULL;
11109 int __pyx_lineno = 0;
11110 const char *__pyx_filename = NULL;
11111 int __pyx_clineno = 0;
11112 __Pyx_RefNannySetupContext(
"__get__", 0);
11121 __pyx_t_1 = __Pyx_PyLong_From_int(__pyx_v_self->view.ndim);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 631, __pyx_L1_error)
11122 __Pyx_GOTREF(__pyx_t_1);
11124 PyObject *__pyx_temp;
11126 __pyx_temp = __pyx_r;
11127 __pyx_r = __pyx_t_1;
11129 __Pyx_XDECREF(__pyx_temp);
11144 __Pyx_XDECREF(__pyx_t_1);
11145 __Pyx_AddTraceback(
"View.MemoryView.memoryview.ndim.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
11148 __Pyx_XGIVEREF(__pyx_r);
11149 __Pyx_RefNannyFinishContext();
11162static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_8itemsize_1__get__(PyObject *__pyx_v_self);
11163static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_8itemsize_1__get__(PyObject *__pyx_v_self) {
11164 CYTHON_UNUSED PyObject *
const *__pyx_kwvalues;
11165 PyObject *__pyx_r = 0;
11166 __Pyx_RefNannyDeclarations
11167 __Pyx_RefNannySetupContext(
"__get__ (wrapper)", 0);
11168 __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
11169 __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_8itemsize___get__(((
struct __pyx_memoryview_obj *)__pyx_v_self));
11172 __Pyx_RefNannyFinishContext();
11176static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_8itemsize___get__(
struct __pyx_memoryview_obj *__pyx_v_self) {
11177 PyObject *__pyx_r = NULL;
11178 __Pyx_RefNannyDeclarations
11179 PyObject *__pyx_t_1 = NULL;
11180 int __pyx_lineno = 0;
11181 const char *__pyx_filename = NULL;
11182 int __pyx_clineno = 0;
11183 __Pyx_RefNannySetupContext(
"__get__", 0);
11192 __pyx_t_1 = PyLong_FromSsize_t(__pyx_v_self->view.itemsize);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 635, __pyx_L1_error)
11193 __Pyx_GOTREF(__pyx_t_1);
11195 PyObject *__pyx_temp;
11197 __pyx_temp = __pyx_r;
11198 __pyx_r = __pyx_t_1;
11200 __Pyx_XDECREF(__pyx_temp);
11215 __Pyx_XDECREF(__pyx_t_1);
11216 __Pyx_AddTraceback(
"View.MemoryView.memoryview.itemsize.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
11219 __Pyx_XGIVEREF(__pyx_r);
11220 __Pyx_RefNannyFinishContext();
11233static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_6nbytes_1__get__(PyObject *__pyx_v_self);
11234static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_6nbytes_1__get__(PyObject *__pyx_v_self) {
11235 CYTHON_UNUSED PyObject *
const *__pyx_kwvalues;
11236 PyObject *__pyx_r = 0;
11237 __Pyx_RefNannyDeclarations
11238 __Pyx_RefNannySetupContext(
"__get__ (wrapper)", 0);
11239 __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
11240 __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_6nbytes___get__(((
struct __pyx_memoryview_obj *)__pyx_v_self));
11243 __Pyx_RefNannyFinishContext();
11247static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_6nbytes___get__(
struct __pyx_memoryview_obj *__pyx_v_self) {
11248 PyObject *__pyx_r = NULL;
11249 __Pyx_RefNannyDeclarations
11250 PyObject *__pyx_t_1 = NULL;
11251 PyObject *__pyx_t_2 = NULL;
11252 PyObject *__pyx_t_3 = NULL;
11253 int __pyx_lineno = 0;
11254 const char *__pyx_filename = NULL;
11255 int __pyx_clineno = 0;
11256 __Pyx_RefNannySetupContext(
"__get__", 0);
11265 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_mstate_global->__pyx_n_u_size);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 639, __pyx_L1_error)
11266 __Pyx_GOTREF(__pyx_t_1);
11267 __pyx_t_2 = PyLong_FromSsize_t(__pyx_v_self->view.itemsize);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 639, __pyx_L1_error)
11268 __Pyx_GOTREF(__pyx_t_2);
11269 __pyx_t_3 = __Pyx_PyNumber_Multiply_object_int(__pyx_t_1, __pyx_t_2);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 639, __pyx_L1_error)
11270 __Pyx_GOTREF(__pyx_t_3);
11271 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
11272 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
11274 PyObject *__pyx_temp;
11276 __pyx_temp = __pyx_r;
11277 __pyx_r = __pyx_t_3;
11279 __Pyx_XDECREF(__pyx_temp);
11294 __Pyx_XDECREF(__pyx_t_1);
11295 __Pyx_XDECREF(__pyx_t_2);
11296 __Pyx_XDECREF(__pyx_t_3);
11297 __Pyx_AddTraceback(
"View.MemoryView.memoryview.nbytes.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
11300 __Pyx_XGIVEREF(__pyx_r);
11301 __Pyx_RefNannyFinishContext();
11314static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_4size_1__get__(PyObject *__pyx_v_self);
11315static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_4size_1__get__(PyObject *__pyx_v_self) {
11316 CYTHON_UNUSED PyObject *
const *__pyx_kwvalues;
11317 PyObject *__pyx_r = 0;
11318 __Pyx_RefNannyDeclarations
11319 __Pyx_RefNannySetupContext(
"__get__ (wrapper)", 0);
11320 __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
11321 __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_4size___get__(((
struct __pyx_memoryview_obj *)__pyx_v_self));
11324 __Pyx_RefNannyFinishContext();
11328static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_4size___get__(
struct __pyx_memoryview_obj *__pyx_v_self) {
11329 size_t __pyx_v_result;
11330 Py_ssize_t __pyx_v_length;
11331 PyObject *__pyx_r = NULL;
11332 __Pyx_RefNannyDeclarations
11334 Py_ssize_t *__pyx_t_2;
11335 Py_ssize_t *__pyx_t_3;
11336 Py_ssize_t *__pyx_t_4;
11337 PyObject *__pyx_t_5 = NULL;
11338 int __pyx_lineno = 0;
11339 const char *__pyx_filename = NULL;
11340 int __pyx_clineno = 0;
11341 __Pyx_RefNannySetupContext(
"__get__", 0);
11350 __pyx_t_1 = (__pyx_v_self->_size == Py_None);
11361 __pyx_v_result = 1;
11370 __pyx_t_3 = (__pyx_v_self->view.shape + __pyx_v_self->view.ndim);
11372 for (__pyx_t_4 = __pyx_v_self->view.shape; __pyx_t_4 < __pyx_t_3; __pyx_t_4++) {
11373 __pyx_t_2 = __pyx_t_4;
11374 __pyx_v_length = (__pyx_t_2[0]);
11383 __pyx_v_result = (__pyx_v_result * ((size_t)__pyx_v_length));
11394 __pyx_t_5 = __Pyx_PyLong_FromSize_t(__pyx_v_result);
if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 650, __pyx_L1_error)
11395 __Pyx_GOTREF(__pyx_t_5);
11396 __Pyx_GIVEREF(__pyx_t_5);
11397 __Pyx_GOTREF(__pyx_v_self->_size);
11398 __Pyx_DECREF(__pyx_v_self->_size);
11399 __pyx_v_self->_size = __pyx_t_5;
11419 PyObject *__pyx_temp;
11421 __pyx_temp = __pyx_r;
11422 __Pyx_INCREF(__pyx_v_self->_size);
11423 __pyx_r = __pyx_v_self->_size;
11425 __Pyx_XDECREF(__pyx_temp);
11439 __Pyx_XDECREF(__pyx_t_5);
11440 __Pyx_AddTraceback(
"View.MemoryView.memoryview.size.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
11445 __Pyx_XGIVEREF(__pyx_r);
11446 __Pyx_RefNannyFinishContext();
11459static Py_ssize_t __pyx_memoryview___len__(PyObject *__pyx_v_self);
11460static Py_ssize_t __pyx_memoryview___len__(PyObject *__pyx_v_self) {
11461 CYTHON_UNUSED PyObject *
const *__pyx_kwvalues;
11462 Py_ssize_t __pyx_r;
11463 __Pyx_RefNannyDeclarations
11464 __Pyx_RefNannySetupContext(
"__len__ (wrapper)", 0);
11465 __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
11466 __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_10__len__(((
struct __pyx_memoryview_obj *)__pyx_v_self));
11469 __Pyx_RefNannyFinishContext();
11473static Py_ssize_t __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_10__len__(
struct __pyx_memoryview_obj *__pyx_v_self) {
11474 Py_ssize_t __pyx_r;
11484 __pyx_t_1 = (__pyx_v_self->view.ndim >= 1);
11498 __pyx_r = (__pyx_v_self->view.shape[0]);
11547static PyObject *__pyx_memoryview___repr__(PyObject *__pyx_v_self);
11548static PyObject *__pyx_memoryview___repr__(PyObject *__pyx_v_self) {
11549 CYTHON_UNUSED PyObject *
const *__pyx_kwvalues;
11550 PyObject *__pyx_r = 0;
11551 __Pyx_RefNannyDeclarations
11552 __Pyx_RefNannySetupContext(
"__repr__ (wrapper)", 0);
11553 __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
11554 __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_12__repr__(((
struct __pyx_memoryview_obj *)__pyx_v_self));
11557 __Pyx_RefNannyFinishContext();
11561static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_12__repr__(
struct __pyx_memoryview_obj *__pyx_v_self) {
11562 PyObject *__pyx_r = NULL;
11563 __Pyx_RefNannyDeclarations
11564 PyObject *__pyx_t_1 = NULL;
11565 PyObject *__pyx_t_2 = NULL;
11566 PyObject *__pyx_t_3 = NULL;
11567 PyObject *__pyx_t_4[5];
11568 Py_ssize_t __pyx_t_5;
11570 int __pyx_lineno = 0;
11571 const char *__pyx_filename = NULL;
11572 int __pyx_clineno = 0;
11573 __Pyx_RefNannySetupContext(
"__repr__", 0);
11582 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_mstate_global->__pyx_n_u_base);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 661, __pyx_L1_error)
11583 __Pyx_GOTREF(__pyx_t_1);
11584 __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_class);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 661, __pyx_L1_error)
11585 __Pyx_GOTREF(__pyx_t_2);
11586 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
11587 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_name_2);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 661, __pyx_L1_error)
11588 __Pyx_GOTREF(__pyx_t_1);
11589 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
11590 __pyx_t_2 = __Pyx_PyObject_FormatSimpleAndDecref(PyObject_Repr(__pyx_t_1), __pyx_mstate_global->__pyx_empty_unicode);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 661, __pyx_L1_error)
11591 __Pyx_GOTREF(__pyx_t_2);
11592 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
11601 __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_builtin_id, ((PyObject *)__pyx_v_self));
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 662, __pyx_L1_error)
11602 __Pyx_GOTREF(__pyx_t_1);
11603 __pyx_t_3 = __Pyx_PyObject_Format(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_x);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 662, __pyx_L1_error)
11604 __Pyx_GOTREF(__pyx_t_3);
11605 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
11606 __pyx_t_4[0] = __pyx_mstate_global->__pyx_kp_u_MemoryView_of;
11607 __pyx_t_4[1] = __pyx_t_2;
11608 __pyx_t_4[2] = __pyx_mstate_global->__pyx_kp_u_at_0x;
11609 __pyx_t_4[3] = __pyx_t_3;
11610 __pyx_t_4[4] = __pyx_mstate_global->__pyx_kp_u__4;
11620 #if __Pyx_PyUnicode_Join_CAN_USE_KIND_AND_LENGTH
11621 __pyx_t_5 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_4[1]) + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_4[3]);
11624 #if __Pyx_PyUnicode_Join_CAN_USE_KIND_AND_LENGTH
11625 __pyx_t_6 |= __Pyx_PyUnicode_KIND_04(__pyx_t_4[1]) | __Pyx_PyUnicode_KIND_04(__pyx_t_4[3]);
11627 __pyx_t_1 = __Pyx_PyUnicode_Join(__pyx_t_4, 5, __pyx_t_5, __pyx_t_6);
11628 if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 661, __pyx_L1_error)
11629 __Pyx_GOTREF(__pyx_t_1);
11630 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
11631 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
11633 PyObject *__pyx_temp;
11635 __pyx_temp = __pyx_r;
11636 __pyx_r = __pyx_t_1;
11638 __Pyx_XDECREF(__pyx_temp);
11653 __Pyx_XDECREF(__pyx_t_1);
11654 __Pyx_XDECREF(__pyx_t_2);
11655 __Pyx_XDECREF(__pyx_t_3);
11656 __Pyx_AddTraceback(
"View.MemoryView.memoryview.__repr__", __pyx_clineno, __pyx_lineno, __pyx_filename);
11659 __Pyx_XGIVEREF(__pyx_r);
11660 __Pyx_RefNannyFinishContext();
11673static PyObject *__pyx_memoryview___str__(PyObject *__pyx_v_self);
11674static PyObject *__pyx_memoryview___str__(PyObject *__pyx_v_self) {
11675 CYTHON_UNUSED PyObject *
const *__pyx_kwvalues;
11676 PyObject *__pyx_r = 0;
11677 __Pyx_RefNannyDeclarations
11678 __Pyx_RefNannySetupContext(
"__str__ (wrapper)", 0);
11679 __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
11680 __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_14__str__(((
struct __pyx_memoryview_obj *)__pyx_v_self));
11683 __Pyx_RefNannyFinishContext();
11687static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_14__str__(
struct __pyx_memoryview_obj *__pyx_v_self) {
11688 PyObject *__pyx_r = NULL;
11689 __Pyx_RefNannyDeclarations
11690 PyObject *__pyx_t_1 = NULL;
11691 PyObject *__pyx_t_2 = NULL;
11692 PyObject *__pyx_t_3[3];
11693 Py_ssize_t __pyx_t_4;
11695 int __pyx_lineno = 0;
11696 const char *__pyx_filename = NULL;
11697 int __pyx_clineno = 0;
11698 __Pyx_RefNannySetupContext(
"__str__", 0);
11707 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_mstate_global->__pyx_n_u_base);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 665, __pyx_L1_error)
11708 __Pyx_GOTREF(__pyx_t_1);
11709 __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_class);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 665, __pyx_L1_error)
11710 __Pyx_GOTREF(__pyx_t_2);
11711 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
11712 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_name_2);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 665, __pyx_L1_error)
11713 __Pyx_GOTREF(__pyx_t_1);
11714 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
11715 __pyx_t_2 = __Pyx_PyObject_FormatSimpleAndDecref(PyObject_Repr(__pyx_t_1), __pyx_mstate_global->__pyx_empty_unicode);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 665, __pyx_L1_error)
11716 __Pyx_GOTREF(__pyx_t_2);
11717 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
11718 __pyx_t_3[0] = __pyx_mstate_global->__pyx_kp_u_MemoryView_of;
11719 __pyx_t_3[1] = __pyx_t_2;
11720 __pyx_t_3[2] = __pyx_mstate_global->__pyx_kp_u_object_2;
11722 #if __Pyx_PyUnicode_Join_CAN_USE_KIND_AND_LENGTH
11723 __pyx_t_4 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_3[1]);
11726 #if __Pyx_PyUnicode_Join_CAN_USE_KIND_AND_LENGTH
11727 __pyx_t_5 |= __Pyx_PyUnicode_KIND_04(__pyx_t_3[1]);
11729 __pyx_t_1 = __Pyx_PyUnicode_Join(__pyx_t_3, 3, __pyx_t_4, __pyx_t_5);
11730 if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 665, __pyx_L1_error)
11731 __Pyx_GOTREF(__pyx_t_1);
11732 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
11734 PyObject *__pyx_temp;
11736 __pyx_temp = __pyx_r;
11737 __pyx_r = __pyx_t_1;
11739 __Pyx_XDECREF(__pyx_temp);
11754 __Pyx_XDECREF(__pyx_t_1);
11755 __Pyx_XDECREF(__pyx_t_2);
11756 __Pyx_AddTraceback(
"View.MemoryView.memoryview.__str__", __pyx_clineno, __pyx_lineno, __pyx_filename);
11759 __Pyx_XGIVEREF(__pyx_r);
11760 __Pyx_RefNannyFinishContext();
11773static PyObject *__pyx_memoryview_is_c_contig(PyObject *__pyx_v_self,
11774#
if CYTHON_VECTORCALL
11775PyObject *
const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
11777PyObject *__pyx_args, PyObject *__pyx_kwds
11780static PyObject *__pyx_memoryview_is_c_contig(PyObject *__pyx_v_self,
11781#
if CYTHON_VECTORCALL
11782PyObject *
const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
11784PyObject *__pyx_args, PyObject *__pyx_kwds
11787 #if !CYTHON_VECTORCALL
11788 CYTHON_UNUSED Py_ssize_t __pyx_nargs;
11790 CYTHON_UNUSED PyObject *
const *__pyx_kwvalues;
11791 PyObject *__pyx_r = 0;
11792 __Pyx_RefNannyDeclarations
11793 __Pyx_RefNannySetupContext(
"is_c_contig (wrapper)", 0);
11794 #if !CYTHON_VECTORCALL
11795 #if CYTHON_ASSUME_SAFE_SIZE
11796 __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
11798 __pyx_nargs = PyTuple_Size(__pyx_args);
if (unlikely(__pyx_nargs < 0))
return NULL;
11801 __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
11802 if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid(
"is_c_contig", 1, 0, 0, __pyx_nargs);
return NULL; }
11803 const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
11804 if (unlikely(__pyx_kwds_len < 0))
return NULL;
11805 if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords(
"is_c_contig", __pyx_kwds);
return NULL;}
11806 __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_16is_c_contig(((
struct __pyx_memoryview_obj *)__pyx_v_self));
11809 __Pyx_RefNannyFinishContext();
11813static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_16is_c_contig(
struct __pyx_memoryview_obj *__pyx_v_self) {
11814 __Pyx_memviewslice *__pyx_v_mslice;
11815 __Pyx_memviewslice __pyx_v_tmp;
11816 PyObject *__pyx_r = NULL;
11817 __Pyx_RefNannyDeclarations
11818 __Pyx_memviewslice *__pyx_t_1;
11819 PyObject *__pyx_t_2 = NULL;
11820 int __pyx_lineno = 0;
11821 const char *__pyx_filename = NULL;
11822 int __pyx_clineno = 0;
11823 __Pyx_RefNannySetupContext(
"is_c_contig", 0);
11832 __pyx_t_1 = __pyx_memoryview_get_slice_from_memoryview(__pyx_v_self, (&__pyx_v_tmp));
if (unlikely(__pyx_t_1 == ((
void *)NULL))) __PYX_ERR(1, 671, __pyx_L1_error)
11833 __pyx_v_mslice = __pyx_t_1;
11842 __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_memviewslice_is_contig((__pyx_v_mslice[0]),
'C', __pyx_v_self->view.ndim));
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 672, __pyx_L1_error)
11843 __Pyx_GOTREF(__pyx_t_2);
11845 PyObject *__pyx_temp;
11847 __pyx_temp = __pyx_r;
11848 __pyx_r = __pyx_t_2;
11850 __Pyx_XDECREF(__pyx_temp);
11865 __Pyx_XDECREF(__pyx_t_2);
11866 __Pyx_AddTraceback(
"View.MemoryView.memoryview.is_c_contig", __pyx_clineno, __pyx_lineno, __pyx_filename);
11871 __Pyx_XGIVEREF(__pyx_r);
11872 __Pyx_RefNannyFinishContext();
11885static PyObject *__pyx_memoryview_is_f_contig(PyObject *__pyx_v_self,
11886#
if CYTHON_VECTORCALL
11887PyObject *
const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
11889PyObject *__pyx_args, PyObject *__pyx_kwds
11892static PyObject *__pyx_memoryview_is_f_contig(PyObject *__pyx_v_self,
11893#
if CYTHON_VECTORCALL
11894PyObject *
const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
11896PyObject *__pyx_args, PyObject *__pyx_kwds
11899 #if !CYTHON_VECTORCALL
11900 CYTHON_UNUSED Py_ssize_t __pyx_nargs;
11902 CYTHON_UNUSED PyObject *
const *__pyx_kwvalues;
11903 PyObject *__pyx_r = 0;
11904 __Pyx_RefNannyDeclarations
11905 __Pyx_RefNannySetupContext(
"is_f_contig (wrapper)", 0);
11906 #if !CYTHON_VECTORCALL
11907 #if CYTHON_ASSUME_SAFE_SIZE
11908 __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
11910 __pyx_nargs = PyTuple_Size(__pyx_args);
if (unlikely(__pyx_nargs < 0))
return NULL;
11913 __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
11914 if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid(
"is_f_contig", 1, 0, 0, __pyx_nargs);
return NULL; }
11915 const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
11916 if (unlikely(__pyx_kwds_len < 0))
return NULL;
11917 if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords(
"is_f_contig", __pyx_kwds);
return NULL;}
11918 __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_18is_f_contig(((
struct __pyx_memoryview_obj *)__pyx_v_self));
11921 __Pyx_RefNannyFinishContext();
11925static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_18is_f_contig(
struct __pyx_memoryview_obj *__pyx_v_self) {
11926 __Pyx_memviewslice *__pyx_v_mslice;
11927 __Pyx_memviewslice __pyx_v_tmp;
11928 PyObject *__pyx_r = NULL;
11929 __Pyx_RefNannyDeclarations
11930 __Pyx_memviewslice *__pyx_t_1;
11931 PyObject *__pyx_t_2 = NULL;
11932 int __pyx_lineno = 0;
11933 const char *__pyx_filename = NULL;
11934 int __pyx_clineno = 0;
11935 __Pyx_RefNannySetupContext(
"is_f_contig", 0);
11944 __pyx_t_1 = __pyx_memoryview_get_slice_from_memoryview(__pyx_v_self, (&__pyx_v_tmp));
if (unlikely(__pyx_t_1 == ((
void *)NULL))) __PYX_ERR(1, 677, __pyx_L1_error)
11945 __pyx_v_mslice = __pyx_t_1;
11954 __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_memviewslice_is_contig((__pyx_v_mslice[0]),
'F', __pyx_v_self->view.ndim));
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 678, __pyx_L1_error)
11955 __Pyx_GOTREF(__pyx_t_2);
11957 PyObject *__pyx_temp;
11959 __pyx_temp = __pyx_r;
11960 __pyx_r = __pyx_t_2;
11962 __Pyx_XDECREF(__pyx_temp);
11977 __Pyx_XDECREF(__pyx_t_2);
11978 __Pyx_AddTraceback(
"View.MemoryView.memoryview.is_f_contig", __pyx_clineno, __pyx_lineno, __pyx_filename);
11983 __Pyx_XGIVEREF(__pyx_r);
11984 __Pyx_RefNannyFinishContext();
11997static PyObject *__pyx_memoryview_copy(PyObject *__pyx_v_self,
11998#
if CYTHON_VECTORCALL
11999PyObject *
const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
12001PyObject *__pyx_args, PyObject *__pyx_kwds
12004static PyObject *__pyx_memoryview_copy(PyObject *__pyx_v_self,
12005#
if CYTHON_VECTORCALL
12006PyObject *
const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
12008PyObject *__pyx_args, PyObject *__pyx_kwds
12011 #if !CYTHON_VECTORCALL
12012 CYTHON_UNUSED Py_ssize_t __pyx_nargs;
12014 CYTHON_UNUSED PyObject *
const *__pyx_kwvalues;
12015 PyObject *__pyx_r = 0;
12016 __Pyx_RefNannyDeclarations
12017 __Pyx_RefNannySetupContext(
"copy (wrapper)", 0);
12018 #if !CYTHON_VECTORCALL
12019 #if CYTHON_ASSUME_SAFE_SIZE
12020 __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
12022 __pyx_nargs = PyTuple_Size(__pyx_args);
if (unlikely(__pyx_nargs < 0))
return NULL;
12025 __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
12026 if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid(
"copy", 1, 0, 0, __pyx_nargs);
return NULL; }
12027 const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
12028 if (unlikely(__pyx_kwds_len < 0))
return NULL;
12029 if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords(
"copy", __pyx_kwds);
return NULL;}
12030 __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_20copy(((
struct __pyx_memoryview_obj *)__pyx_v_self));
12033 __Pyx_RefNannyFinishContext();
12037static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_20copy(
struct __pyx_memoryview_obj *__pyx_v_self) {
12038 __Pyx_memviewslice __pyx_v_mslice;
12040 PyObject *__pyx_r = NULL;
12041 __Pyx_RefNannyDeclarations
12042 __Pyx_memviewslice __pyx_t_1;
12043 PyObject *__pyx_t_2 = NULL;
12044 int __pyx_lineno = 0;
12045 const char *__pyx_filename = NULL;
12046 int __pyx_clineno = 0;
12047 __Pyx_RefNannySetupContext(
"copy", 0);
12056 __pyx_v_flags = (__pyx_v_self->flags & (~PyBUF_F_CONTIGUOUS));
12065 __pyx_memoryview_slice_copy(__pyx_v_self, (&__pyx_v_mslice));
12074 __pyx_t_1 = __pyx_memoryview_copy_new_contig((&__pyx_v_mslice), __pyx_k_c, __pyx_v_self->view.ndim, __pyx_v_self->view.itemsize, (__pyx_v_flags | PyBUF_C_CONTIGUOUS), __pyx_v_self->dtype_is_object);
if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 685, __pyx_L1_error)
12075 __pyx_v_mslice = __pyx_t_1;
12084 __pyx_t_2 = __pyx_memoryview_copy_object_from_slice(__pyx_v_self, (&__pyx_v_mslice));
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 690, __pyx_L1_error)
12085 __Pyx_GOTREF(__pyx_t_2);
12087 PyObject *__pyx_temp;
12089 __pyx_temp = __pyx_r;
12090 __pyx_r = __pyx_t_2;
12092 __Pyx_XDECREF(__pyx_temp);
12107 __Pyx_XDECREF(__pyx_t_2);
12108 __Pyx_AddTraceback(
"View.MemoryView.memoryview.copy", __pyx_clineno, __pyx_lineno, __pyx_filename);
12113 __Pyx_XGIVEREF(__pyx_r);
12114 __Pyx_RefNannyFinishContext();
12127static PyObject *__pyx_memoryview_copy_fortran(PyObject *__pyx_v_self,
12128#
if CYTHON_VECTORCALL
12129PyObject *
const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
12131PyObject *__pyx_args, PyObject *__pyx_kwds
12134static PyObject *__pyx_memoryview_copy_fortran(PyObject *__pyx_v_self,
12135#
if CYTHON_VECTORCALL
12136PyObject *
const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
12138PyObject *__pyx_args, PyObject *__pyx_kwds
12141 #if !CYTHON_VECTORCALL
12142 CYTHON_UNUSED Py_ssize_t __pyx_nargs;
12144 CYTHON_UNUSED PyObject *
const *__pyx_kwvalues;
12145 PyObject *__pyx_r = 0;
12146 __Pyx_RefNannyDeclarations
12147 __Pyx_RefNannySetupContext(
"copy_fortran (wrapper)", 0);
12148 #if !CYTHON_VECTORCALL
12149 #if CYTHON_ASSUME_SAFE_SIZE
12150 __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
12152 __pyx_nargs = PyTuple_Size(__pyx_args);
if (unlikely(__pyx_nargs < 0))
return NULL;
12155 __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
12156 if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid(
"copy_fortran", 1, 0, 0, __pyx_nargs);
return NULL; }
12157 const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
12158 if (unlikely(__pyx_kwds_len < 0))
return NULL;
12159 if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords(
"copy_fortran", __pyx_kwds);
return NULL;}
12160 __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_22copy_fortran(((
struct __pyx_memoryview_obj *)__pyx_v_self));
12163 __Pyx_RefNannyFinishContext();
12167static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_22copy_fortran(
struct __pyx_memoryview_obj *__pyx_v_self) {
12168 __Pyx_memviewslice __pyx_v_src;
12169 __Pyx_memviewslice __pyx_v_dst;
12171 PyObject *__pyx_r = NULL;
12172 __Pyx_RefNannyDeclarations
12173 __Pyx_memviewslice __pyx_t_1;
12174 PyObject *__pyx_t_2 = NULL;
12175 int __pyx_lineno = 0;
12176 const char *__pyx_filename = NULL;
12177 int __pyx_clineno = 0;
12178 __Pyx_RefNannySetupContext(
"copy_fortran", 0);
12187 __pyx_v_flags = (__pyx_v_self->flags & (~PyBUF_C_CONTIGUOUS));
12196 __pyx_memoryview_slice_copy(__pyx_v_self, (&__pyx_v_src));
12205 __pyx_t_1 = __pyx_memoryview_copy_new_contig((&__pyx_v_src), __pyx_k_fortran, __pyx_v_self->view.ndim, __pyx_v_self->view.itemsize, (__pyx_v_flags | PyBUF_F_CONTIGUOUS), __pyx_v_self->dtype_is_object);
if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 697, __pyx_L1_error)
12206 __pyx_v_dst = __pyx_t_1;
12215 __pyx_t_2 = __pyx_memoryview_copy_object_from_slice(__pyx_v_self, (&__pyx_v_dst));
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 702, __pyx_L1_error)
12216 __Pyx_GOTREF(__pyx_t_2);
12218 PyObject *__pyx_temp;
12220 __pyx_temp = __pyx_r;
12221 __pyx_r = __pyx_t_2;
12223 __Pyx_XDECREF(__pyx_temp);
12238 __Pyx_XDECREF(__pyx_t_2);
12239 __Pyx_AddTraceback(
"View.MemoryView.memoryview.copy_fortran", __pyx_clineno, __pyx_lineno, __pyx_filename);
12245 __Pyx_XGIVEREF(__pyx_r);
12246 __Pyx_RefNannyFinishContext();
12257static PyObject *__pyx_pw___pyx_memoryview_1__reduce_cython__(PyObject *__pyx_v_self,
12258#
if CYTHON_VECTORCALL
12259PyObject *
const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
12261PyObject *__pyx_args, PyObject *__pyx_kwds
12264static PyObject *__pyx_pw___pyx_memoryview_1__reduce_cython__(PyObject *__pyx_v_self,
12265#
if CYTHON_VECTORCALL
12266PyObject *
const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
12268PyObject *__pyx_args, PyObject *__pyx_kwds
12271 #if !CYTHON_VECTORCALL
12272 CYTHON_UNUSED Py_ssize_t __pyx_nargs;
12274 CYTHON_UNUSED PyObject *
const *__pyx_kwvalues;
12275 PyObject *__pyx_r = 0;
12276 __Pyx_RefNannyDeclarations
12277 __Pyx_RefNannySetupContext(
"__reduce_cython__ (wrapper)", 0);
12278 #if !CYTHON_VECTORCALL
12279 #if CYTHON_ASSUME_SAFE_SIZE
12280 __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
12282 __pyx_nargs = PyTuple_Size(__pyx_args);
if (unlikely(__pyx_nargs < 0))
return NULL;
12285 __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
12286 if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid(
"__reduce_cython__", 1, 0, 0, __pyx_nargs);
return NULL; }
12287 const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
12288 if (unlikely(__pyx_kwds_len < 0))
return NULL;
12289 if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords(
"__reduce_cython__", __pyx_kwds);
return NULL;}
12290 __pyx_r = __pyx_pf___pyx_memoryview___reduce_cython__(((
struct __pyx_memoryview_obj *)__pyx_v_self));
12293 __Pyx_RefNannyFinishContext();
12297static PyObject *__pyx_pf___pyx_memoryview___reduce_cython__(CYTHON_UNUSED
struct __pyx_memoryview_obj *__pyx_v_self) {
12298 PyObject *__pyx_r = NULL;
12299 __Pyx_RefNannyDeclarations
12300 int __pyx_lineno = 0;
12301 const char *__pyx_filename = NULL;
12302 int __pyx_clineno = 0;
12303 __Pyx_RefNannySetupContext(
"__reduce_cython__", 0);
12311 __Pyx_Raise(((PyObject *)(((PyTypeObject*)PyExc_TypeError))), __pyx_mstate_global->__pyx_kp_u_no_default___reduce___due_to_non, 0, 0);
12312 __PYX_ERR(1, 2, __pyx_L1_error)
12322 __Pyx_AddTraceback(
"View.MemoryView.memoryview.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
12324 __Pyx_XGIVEREF(__pyx_r);
12325 __Pyx_RefNannyFinishContext();
12337static PyObject *__pyx_pw___pyx_memoryview_3__setstate_cython__(PyObject *__pyx_v_self,
12338#
if CYTHON_VECTORCALL
12339PyObject *
const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
12341PyObject *__pyx_args, PyObject *__pyx_kwds
12344static PyObject *__pyx_pw___pyx_memoryview_3__setstate_cython__(PyObject *__pyx_v_self,
12345#
if CYTHON_VECTORCALL
12346PyObject *
const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
12348PyObject *__pyx_args, PyObject *__pyx_kwds
12351 CYTHON_UNUSED PyObject *__pyx_v___pyx_state = 0;
12352 #if !CYTHON_VECTORCALL
12353 CYTHON_UNUSED Py_ssize_t __pyx_nargs;
12355 CYTHON_UNUSED PyObject *
const *__pyx_kwvalues;
12356 PyObject* values[1] = {0};
12357 int __pyx_lineno = 0;
12358 const char *__pyx_filename = NULL;
12359 int __pyx_clineno = 0;
12360 PyObject *__pyx_r = 0;
12361 __Pyx_RefNannyDeclarations
12362 __Pyx_RefNannySetupContext(
"__setstate_cython__ (wrapper)", 0);
12363 #if !CYTHON_VECTORCALL
12364 #if CYTHON_ASSUME_SAFE_SIZE
12365 __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
12367 __pyx_nargs = PyTuple_Size(__pyx_args);
if (unlikely(__pyx_nargs < 0))
return NULL;
12370 __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
12372 PyObject **
const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_pyx_state,0};
12373 const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
12374 if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(1, 3, __pyx_L3_error)
12375 if (__pyx_kwds_len > 0) {
12376 switch (__pyx_nargs) {
12378 values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
12379 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(1, 3, __pyx_L3_error)
12380 CYTHON_FALLTHROUGH;
12382 default:
goto __pyx_L5_argtuple_error;
12384 const Py_ssize_t kwd_pos_args = __pyx_nargs;
12385 if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len,
"__setstate_cython__", 0) < (0)) __PYX_ERR(1, 3, __pyx_L3_error)
12386 for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
12387 if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid(
"__setstate_cython__", 1, 1, 1, i); __PYX_ERR(1, 3, __pyx_L3_error) }
12389 }
else if (unlikely(__pyx_nargs != 1)) {
12390 goto __pyx_L5_argtuple_error;
12392 values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
12393 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(1, 3, __pyx_L3_error)
12395 __pyx_v___pyx_state = values[0];
12397 goto __pyx_L6_skip;
12398 __pyx_L5_argtuple_error:;
12399 __Pyx_RaiseArgtupleInvalid(
"__setstate_cython__", 1, 1, 1, __pyx_nargs); __PYX_ERR(1, 3, __pyx_L3_error)
12401 goto __pyx_L4_argument_unpacking_done;
12403 for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(
sizeof(values)/
sizeof(values[0])); ++__pyx_temp) {
12404 Py_XDECREF(values[__pyx_temp]);
12406 __Pyx_AddTraceback(
"View.MemoryView.memoryview.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
12407 __Pyx_RefNannyFinishContext();
12409 __pyx_L4_argument_unpacking_done:;
12410 __pyx_r = __pyx_pf___pyx_memoryview_2__setstate_cython__(((
struct __pyx_memoryview_obj *)__pyx_v_self), __pyx_v___pyx_state);
12413 for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(
sizeof(values)/
sizeof(values[0])); ++__pyx_temp) {
12414 Py_XDECREF(values[__pyx_temp]);
12416 __Pyx_RefNannyFinishContext();
12420static PyObject *__pyx_pf___pyx_memoryview_2__setstate_cython__(CYTHON_UNUSED
struct __pyx_memoryview_obj *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) {
12421 PyObject *__pyx_r = NULL;
12422 __Pyx_RefNannyDeclarations
12423 int __pyx_lineno = 0;
12424 const char *__pyx_filename = NULL;
12425 int __pyx_clineno = 0;
12426 __Pyx_RefNannySetupContext(
"__setstate_cython__", 0);
12433 __Pyx_Raise(((PyObject *)(((PyTypeObject*)PyExc_TypeError))), __pyx_mstate_global->__pyx_kp_u_no_default___reduce___due_to_non, 0, 0);
12434 __PYX_ERR(1, 4, __pyx_L1_error)
12445 __Pyx_AddTraceback(
"View.MemoryView.memoryview.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
12447 __Pyx_XGIVEREF(__pyx_r);
12448 __Pyx_RefNannyFinishContext();
12460static PyObject *__pyx_memoryview_new(PyObject *__pyx_v_o,
int __pyx_v_flags,
int __pyx_v_dtype_is_object, __Pyx_TypeInfo
const *__pyx_v_typeinfo) {
12461 struct __pyx_memoryview_obj *__pyx_v_result = 0;
12462 PyObject *__pyx_r = NULL;
12463 __Pyx_RefNannyDeclarations
12464 PyObject *__pyx_t_1 = NULL;
12465 PyObject *__pyx_t_2 = NULL;
12466 PyObject *__pyx_t_3 = NULL;
12467 PyObject *__pyx_t_4 = NULL;
12469 int __pyx_lineno = 0;
12470 const char *__pyx_filename = NULL;
12471 int __pyx_clineno = 0;
12472 __Pyx_RefNannySetupContext(
"memoryview_cwrapper", 0);
12482 __pyx_t_3 = __Pyx_PyLong_From_int(__pyx_v_flags);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 707, __pyx_L1_error)
12483 __Pyx_GOTREF(__pyx_t_3);
12484 __pyx_t_4 = __Pyx_PyBool_FromLong(__pyx_v_dtype_is_object);
if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 707, __pyx_L1_error)
12485 __Pyx_GOTREF(__pyx_t_4);
12488 PyObject *__pyx_callargs[4] = {__pyx_t_2, __pyx_v_o, __pyx_t_3, __pyx_t_4};
12489 __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_mstate_global->__pyx_memoryview_type, __pyx_callargs+__pyx_t_5, (4-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
12490 __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
12491 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
12492 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
12493 if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 707, __pyx_L1_error)
12494 __Pyx_GOTREF((PyObject *)__pyx_t_1);
12496 __pyx_v_result = ((
struct __pyx_memoryview_obj *)__pyx_t_1);
12506 __pyx_v_result->typeinfo = __pyx_v_typeinfo;
12516 PyObject *__pyx_temp;
12518 __pyx_temp = __pyx_r;
12519 __Pyx_INCREF((PyObject *)__pyx_v_result);
12520 __pyx_r = ((PyObject *)__pyx_v_result);
12522 __Pyx_XDECREF(__pyx_temp);
12536 __Pyx_XDECREF(__pyx_t_1);
12537 __Pyx_XDECREF(__pyx_t_2);
12538 __Pyx_XDECREF(__pyx_t_3);
12539 __Pyx_XDECREF(__pyx_t_4);
12540 __Pyx_AddTraceback(
"View.MemoryView.memoryview_cwrapper", __pyx_clineno, __pyx_lineno, __pyx_filename);
12543 __Pyx_XDECREF((PyObject *)__pyx_v_result);
12544 __Pyx_XGIVEREF(__pyx_r);
12545 __Pyx_RefNannyFinishContext();
12557static CYTHON_INLINE
int __pyx_memoryview_check(PyObject *__pyx_v_o) {
12568 __pyx_t_1 = __Pyx_TypeCheck(__pyx_v_o, __pyx_mstate_global->__pyx_memoryview_type);
12570 __pyx_r = __pyx_t_1;
12596static int __pyx_memoryview_err_invalid_index(PyObject *__pyx_v_item) {
12597 PyObject *__pyx_v_type_name = NULL;
12599 __Pyx_RefNannyDeclarations
12600 PyObject *__pyx_t_1 = NULL;
12601 int __pyx_lineno = 0;
12602 const char *__pyx_filename = NULL;
12603 int __pyx_clineno = 0;
12604 __Pyx_RefNannySetupContext(
"_err_invalid_index", 0);
12613 __pyx_t_1 = __Pyx_PyObject_Unicode(((PyObject *)Py_TYPE(__pyx_v_item)));
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 718, __pyx_L1_error)
12614 __Pyx_GOTREF(__pyx_t_1);
12615 __pyx_v_type_name = ((PyObject*)__pyx_t_1);
12625 (void)(PyErr_Format(PyExc_TypeError, __pyx_k_Cannot_index_with_type_200U, ((PyObject *)__pyx_v_type_name)));
12650 __Pyx_XDECREF(__pyx_t_1);
12651 __Pyx_AddTraceback(
"View.MemoryView._err_invalid_index", __pyx_clineno, __pyx_lineno, __pyx_filename);
12654 __Pyx_XDECREF(__pyx_v_type_name);
12656 __Pyx_RefNannyFinishContext();
12668static PyObject *_unellipsify_index_tuple(PyObject *__pyx_v_index_tuple,
int __pyx_v_ndim) {
12669 Py_ssize_t __pyx_v_first_ellipsis_index;
12670 Py_ssize_t __pyx_v_idx;
12671 Py_ssize_t __pyx_v_ellipsis_end;
12672 Py_ssize_t __pyx_v_indices_from_ellipsis;
12673 int __pyx_v_have_slices;
12674 PyObject *__pyx_v_item = NULL;
12675 PyObject *__pyx_v_result = NULL;
12676 PyObject *__pyx_r = NULL;
12677 __Pyx_RefNannyDeclarations
12678 PyObject *__pyx_t_1 = NULL;
12679 Py_ssize_t __pyx_t_2;
12680 PyObject *__pyx_t_3 = NULL;
12683 Py_ssize_t __pyx_t_6;
12684 Py_ssize_t __pyx_t_7;
12685 Py_ssize_t __pyx_t_8;
12686 int __pyx_lineno = 0;
12687 const char *__pyx_filename = NULL;
12688 int __pyx_clineno = 0;
12689 __Pyx_RefNannySetupContext(
"_unellipsify_index_tuple", 0);
12690 __Pyx_INCREF(__pyx_v_index_tuple);
12699 __pyx_v_first_ellipsis_index = -1L;
12708 __pyx_v_have_slices = 0;
12726 __pyx_t_1 = __pyx_v_index_tuple; __Pyx_INCREF(__pyx_t_1);
12730 Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_1);
12731 #if !CYTHON_ASSUME_SAFE_SIZE
12732 if (unlikely((__pyx_temp < 0))) __PYX_ERR(1, 733, __pyx_L1_error)
12734 if (__pyx_t_2 >= __pyx_temp)
break;
12736 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
12737 __pyx_t_3 = __Pyx_NewRef(PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_2));
12739 __pyx_t_3 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_2);
12742 if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 733, __pyx_L1_error)
12743 __Pyx_GOTREF(__pyx_t_3);
12744 __Pyx_XDECREF_SET(__pyx_v_item, __pyx_t_3);
12754 __pyx_t_4 = (__pyx_v_item == __pyx_builtin_Ellipsis);
12765 __pyx_v_have_slices = 1;
12774 __pyx_t_4 = (__pyx_v_first_ellipsis_index == -1L);
12786 __pyx_v_first_ellipsis_index = __pyx_v_idx;
12814 __pyx_t_4 = PySlice_Check(__pyx_v_item);
12825 __pyx_v_have_slices = 1;
12844 __pyx_t_4 = (!(PyIndex_Check(__pyx_v_item) != 0));
12846 if (unlikely(__pyx_t_4)) {
12856 __pyx_t_5 = __pyx_memoryview_err_invalid_index(__pyx_v_item);
if (unlikely(__pyx_t_5 == ((
int)-1))) __PYX_ERR(1, 741, __pyx_L1_error)
12876 __pyx_v_idx = (__pyx_v_idx + 1);
12886 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
12895 __pyx_t_4 = (__pyx_v_first_ellipsis_index >= 0);
12907 __pyx_t_1 = PyList_New(1 * ((__pyx_v_ndim<0) ? 0:__pyx_v_ndim));
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 745, __pyx_L1_error)
12908 __Pyx_GOTREF(__pyx_t_1);
12909 { Py_ssize_t __pyx_temp;
12910 for (__pyx_temp=0; __pyx_temp < __pyx_v_ndim; __pyx_temp++) {
12911 __Pyx_INCREF(__pyx_mstate_global->__pyx_slice[0]);
12912 __Pyx_GIVEREF(__pyx_mstate_global->__pyx_slice[0]);
12913 if (__Pyx_PyList_SET_ITEM(__pyx_t_1, __pyx_temp, __pyx_mstate_global->__pyx_slice[0]) != (0)) __PYX_ERR(1, 745, __pyx_L1_error);
12916 __pyx_v_result = ((PyObject*)__pyx_t_1);
12927 __pyx_t_2 = __pyx_v_first_ellipsis_index;
12928 __pyx_t_6 = __pyx_t_2;
12930 for (__pyx_t_7 = 0; __pyx_t_7 < __pyx_t_6; __pyx_t_7+=1) {
12931 __pyx_v_idx = __pyx_t_7;
12940 __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v_index_tuple, __pyx_v_idx, Py_ssize_t, 1, PyLong_FromSsize_t, 1, 1, 1, __Pyx_ReferenceSharing_FunctionArgument);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 748, __pyx_L1_error)
12941 __Pyx_GOTREF(__pyx_t_1);
12942 if (unlikely((__Pyx_SetItemInt(__pyx_v_result, __pyx_v_idx, __pyx_t_1, Py_ssize_t, 1, PyLong_FromSsize_t, 1, 1, 1, __Pyx_ReferenceSharing_OwnStrongReference) < 0))) __PYX_ERR(1, 748, __pyx_L1_error)
12943 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
12954 __pyx_t_2 = __Pyx_PyTuple_GET_SIZE(__pyx_v_index_tuple);
if (unlikely(__pyx_t_2 == ((Py_ssize_t)-1))) __PYX_ERR(1, 750, __pyx_L1_error)
12955 __pyx_v_indices_from_ellipsis = (__pyx_t_2 - __pyx_v_first_ellipsis_index);
12965 __pyx_v_ellipsis_end = (__pyx_v_ndim - __pyx_v_indices_from_ellipsis);
12975 __pyx_t_2 = __pyx_v_indices_from_ellipsis;
12976 __pyx_t_6 = __pyx_t_2;
12978 for (__pyx_t_7 = 1; __pyx_t_7 < __pyx_t_6; __pyx_t_7+=1) {
12979 __pyx_v_idx = __pyx_t_7;
12988 __pyx_t_8 = (__pyx_v_first_ellipsis_index + __pyx_v_idx);
12990 __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v_index_tuple, __pyx_t_8, Py_ssize_t, 1, PyLong_FromSsize_t, 1, 1, 1, __Pyx_ReferenceSharing_FunctionArgument);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 754, __pyx_L1_error)
12991 __Pyx_GOTREF(__pyx_t_1);
12993 __Pyx_XDECREF_SET(__pyx_v_item, __pyx_t_1);
13003 __pyx_t_4 = (__pyx_v_item != __pyx_builtin_Ellipsis);
13014 __pyx_t_8 = (__pyx_v_ellipsis_end + __pyx_v_idx);
13016 if (unlikely((__Pyx_SetItemInt(__pyx_v_result, __pyx_t_8, __pyx_v_item, Py_ssize_t, 1, PyLong_FromSsize_t, 1, 1, 1, __Pyx_ReferenceSharing_OwnStrongReference) < 0))) __PYX_ERR(1, 756, __pyx_L1_error)
13037 __pyx_t_1 = PyList_AsTuple(__pyx_v_result);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 758, __pyx_L1_error)
13038 __Pyx_GOTREF(__pyx_t_1);
13039 __Pyx_DECREF_SET(__pyx_v_index_tuple, ((PyObject*)__pyx_t_1));
13059 __pyx_t_4 = (__pyx_v_ndim > __pyx_v_idx);
13071 __pyx_v_have_slices = 1;
13080 __pyx_t_2 = (__pyx_v_ndim - __pyx_v_idx);
13082 __pyx_t_1 = __Pyx_PySequence_Multiply(__pyx_mstate_global->__pyx_tuple[1], __pyx_t_2);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 763, __pyx_L1_error)
13083 __Pyx_GOTREF(__pyx_t_1);
13085 __pyx_t_3 = PyNumber_InPlaceAdd(__pyx_v_index_tuple, __pyx_t_1);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 763, __pyx_L1_error)
13086 __Pyx_GOTREF(__pyx_t_3);
13087 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
13088 __Pyx_DECREF_SET(__pyx_v_index_tuple, ((PyObject*)__pyx_t_3));
13108 __pyx_t_3 = __Pyx_PyBool_FromLong(__pyx_v_have_slices);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 765, __pyx_L1_error)
13109 __Pyx_GOTREF(__pyx_t_3);
13110 __pyx_t_1 = PyTuple_New(2);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 765, __pyx_L1_error)
13111 __Pyx_GOTREF(__pyx_t_1);
13112 __Pyx_GIVEREF(__pyx_t_3);
13113 if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_3) != (0)) __PYX_ERR(1, 765, __pyx_L1_error);
13114 __Pyx_INCREF(__pyx_v_index_tuple);
13115 __Pyx_GIVEREF(__pyx_v_index_tuple);
13116 if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_v_index_tuple) != (0)) __PYX_ERR(1, 765, __pyx_L1_error);
13119 PyObject *__pyx_temp;
13121 __pyx_temp = __pyx_r;
13122 __pyx_r = ((PyObject*)__pyx_t_1);
13124 __Pyx_XDECREF(__pyx_temp);
13139 __Pyx_XDECREF(__pyx_t_1);
13140 __Pyx_XDECREF(__pyx_t_3);
13141 __Pyx_AddTraceback(
"View.MemoryView._unellipsify_index_tuple", __pyx_clineno, __pyx_lineno, __pyx_filename);
13149 __Pyx_XDECREF(__pyx_v_item);
13150 __Pyx_XDECREF(__pyx_v_result);
13151 __Pyx_XDECREF(__pyx_v_index_tuple);
13152 __Pyx_XGIVEREF(__pyx_r);
13153 __Pyx_RefNannyFinishContext();
13165static PyObject *_unellipsify(PyObject *__pyx_v_index,
int __pyx_v_ndim) {
13166 PyObject *__pyx_v_result = 0;
13167 int __pyx_v_have_slices;
13168 PyObject *__pyx_r = NULL;
13169 __Pyx_RefNannyDeclarations
13171 PyObject *__pyx_t_2 = NULL;
13174 PyObject *__pyx_t_5 = NULL;
13175 PyObject *__pyx_t_6 = NULL;
13176 int __pyx_lineno = 0;
13177 const char *__pyx_filename = NULL;
13178 int __pyx_clineno = 0;
13179 __Pyx_RefNannySetupContext(
"_unellipsify", 0);
13188 __pyx_v_have_slices = 0;
13197 __pyx_t_1 = (__pyx_v_index == __pyx_builtin_Ellipsis);
13208 __pyx_v_have_slices = 1;
13217 __pyx_t_2 = __Pyx_PySequence_Multiply(__pyx_mstate_global->__pyx_tuple[1], __pyx_v_ndim);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 777, __pyx_L1_error)
13218 __Pyx_GOTREF(__pyx_t_2);
13219 __pyx_v_result = ((PyObject*)__pyx_t_2);
13239 __pyx_t_1 = PyTuple_Check(__pyx_v_index);
13250 if (unlikely(__pyx_v_index == Py_None)) {
13251 PyErr_SetString(PyExc_TypeError,
"cannot pass None into a C function argument that is declared \047not None\047");
13252 __PYX_ERR(1, 780, __pyx_L1_error)
13254 __pyx_t_2 = _unellipsify_index_tuple(((PyObject*)__pyx_v_index), __pyx_v_ndim);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 780, __pyx_L1_error)
13255 __Pyx_GOTREF(__pyx_t_2);
13257 PyObject *__pyx_temp;
13259 __pyx_temp = __pyx_r;
13260 __pyx_r = ((PyObject*)__pyx_t_2);
13262 __Pyx_XDECREF(__pyx_temp);
13284 __pyx_t_1 = PySlice_Check(__pyx_v_index);
13295 __pyx_v_have_slices = 1;
13314 __pyx_t_1 = (!(PyIndex_Check(__pyx_v_index) != 0));
13316 if (unlikely(__pyx_t_1)) {
13326 __pyx_t_3 = __pyx_memoryview_err_invalid_index(__pyx_v_index);
if (unlikely(__pyx_t_3 == ((
int)-1))) __PYX_ERR(1, 786, __pyx_L1_error)
13346 switch (__pyx_v_ndim) {
13356 __pyx_t_2 = PyTuple_New(1);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 790, __pyx_L1_error)
13357 __Pyx_GOTREF(__pyx_t_2);
13358 __Pyx_INCREF(__pyx_v_index);
13359 __Pyx_GIVEREF(__pyx_v_index);
13360 if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_index) != (0)) __PYX_ERR(1, 790, __pyx_L1_error);
13361 __pyx_v_result = ((PyObject*)__pyx_t_2);
13381 __pyx_v_have_slices = 1;
13390 __pyx_t_2 = PyTuple_New(2);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 793, __pyx_L1_error)
13391 __Pyx_GOTREF(__pyx_t_2);
13392 __Pyx_INCREF(__pyx_v_index);
13393 __Pyx_GIVEREF(__pyx_v_index);
13394 if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_index) != (0)) __PYX_ERR(1, 793, __pyx_L1_error);
13395 __Pyx_INCREF(__pyx_mstate_global->__pyx_slice[0]);
13396 __Pyx_GIVEREF(__pyx_mstate_global->__pyx_slice[0]);
13397 if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_mstate_global->__pyx_slice[0]) != (0)) __PYX_ERR(1, 793, __pyx_L1_error);
13398 __pyx_v_result = ((PyObject*)__pyx_t_2);
13418 __pyx_v_have_slices = 1;
13427 __pyx_t_2 = PyTuple_New(1);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 796, __pyx_L1_error)
13428 __Pyx_GOTREF(__pyx_t_2);
13429 __Pyx_INCREF(__pyx_v_index);
13430 __Pyx_GIVEREF(__pyx_v_index);
13431 if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_index) != (0)) __PYX_ERR(1, 796, __pyx_L1_error);
13432 __pyx_t_4 = (__pyx_v_ndim - 1);
13434 __pyx_t_5 = __Pyx_PySequence_Multiply(__pyx_mstate_global->__pyx_tuple[1], __pyx_t_4);
if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 796, __pyx_L1_error)
13435 __Pyx_GOTREF(__pyx_t_5);
13437 __pyx_t_6 = PyNumber_Add(__pyx_t_2, __pyx_t_5);
if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 796, __pyx_L1_error)
13438 __Pyx_GOTREF(__pyx_t_6);
13439 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
13440 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
13441 __pyx_v_result = ((PyObject*)__pyx_t_6);
13455 __pyx_t_6 = __Pyx_PyBool_FromLong(__pyx_v_have_slices);
if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 798, __pyx_L1_error)
13456 __Pyx_GOTREF(__pyx_t_6);
13457 __pyx_t_5 = PyTuple_New(2);
if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 798, __pyx_L1_error)
13458 __Pyx_GOTREF(__pyx_t_5);
13459 __Pyx_GIVEREF(__pyx_t_6);
13460 if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_6) != (0)) __PYX_ERR(1, 798, __pyx_L1_error);
13461 __Pyx_INCREF(__pyx_v_result);
13462 __Pyx_GIVEREF(__pyx_v_result);
13463 if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_v_result) != (0)) __PYX_ERR(1, 798, __pyx_L1_error);
13466 PyObject *__pyx_temp;
13468 __pyx_temp = __pyx_r;
13469 __pyx_r = ((PyObject*)__pyx_t_5);
13471 __Pyx_XDECREF(__pyx_temp);
13486 __Pyx_XDECREF(__pyx_t_2);
13487 __Pyx_XDECREF(__pyx_t_5);
13488 __Pyx_XDECREF(__pyx_t_6);
13489 __Pyx_AddTraceback(
"View.MemoryView._unellipsify", __pyx_clineno, __pyx_lineno, __pyx_filename);
13492 __Pyx_XDECREF(__pyx_v_result);
13494 __Pyx_XGIVEREF(__pyx_r);
13495 __Pyx_RefNannyFinishContext();
13507static int assert_direct_dimensions(Py_ssize_t *__pyx_v_suboffsets,
int __pyx_v_ndim) {
13508 Py_ssize_t __pyx_v_suboffset;
13510 Py_ssize_t *__pyx_t_1;
13511 Py_ssize_t *__pyx_t_2;
13512 Py_ssize_t *__pyx_t_3;
13515 int __pyx_lineno = 0;
13516 const char *__pyx_filename = NULL;
13517 int __pyx_clineno = 0;
13526 __pyx_t_2 = (__pyx_v_suboffsets + __pyx_v_ndim);
13528 for (__pyx_t_3 = __pyx_v_suboffsets; __pyx_t_3 < __pyx_t_2; __pyx_t_3++) {
13529 __pyx_t_1 = __pyx_t_3;
13530 __pyx_v_suboffset = (__pyx_t_1[0]);
13539 __pyx_t_4 = (__pyx_v_suboffset >= 0);
13541 if (unlikely(__pyx_t_4)) {
13551 __pyx_t_5 = __pyx_memoryview_err_ValueError(__pyx_k_Indirect_dimensions_not_supporte);
if (unlikely(__pyx_t_5 == ((
int)-1))) __PYX_ERR(1, 804, __pyx_L1_error)
13588 __Pyx_AddTraceback(
"View.MemoryView.assert_direct_dimensions", __pyx_clineno, __pyx_lineno, __pyx_filename);
13604static struct __pyx_memoryview_obj *__pyx_memview_slice(
struct __pyx_memoryview_obj *__pyx_v_memview, PyObject *__pyx_v_indices) {
13605 int __pyx_v_new_ndim;
13606 int __pyx_v_suboffset_dim;
13608 __Pyx_memviewslice __pyx_v_src;
13609 __Pyx_memviewslice __pyx_v_dst;
13610 __Pyx_memviewslice *__pyx_v_p_src;
13611 struct __pyx_memoryviewslice_obj *__pyx_v_memviewsliceobj = 0;
13612 __Pyx_memviewslice *__pyx_v_p_dst;
13613 int *__pyx_v_p_suboffset_dim;
13614 Py_ssize_t __pyx_v_start;
13615 Py_ssize_t __pyx_v_stop;
13616 Py_ssize_t __pyx_v_step;
13617 Py_ssize_t __pyx_v_cindex;
13618 int __pyx_v_have_start;
13619 int __pyx_v_have_stop;
13620 int __pyx_v_have_step;
13621 PyObject *__pyx_v_index = NULL;
13622 struct __pyx_memoryview_obj *__pyx_r = NULL;
13623 __Pyx_RefNannyDeclarations
13625 PyObject *__pyx_t_2 = NULL;
13626 struct __pyx_memoryview_obj *__pyx_t_3;
13629 Py_ssize_t __pyx_t_6;
13630 PyObject *__pyx_t_7 = NULL;
13631 Py_ssize_t __pyx_t_8;
13633 Py_ssize_t __pyx_t_10;
13634 int __pyx_lineno = 0;
13635 const char *__pyx_filename = NULL;
13636 int __pyx_clineno = 0;
13637 __Pyx_RefNannySetupContext(
"memview_slice", 0);
13646 __pyx_v_new_ndim = 0;
13647 __pyx_v_suboffset_dim = -1;
13656 (void)(memset((&__pyx_v_dst), 0, (
sizeof(__pyx_v_dst))));
13665 #ifndef CYTHON_WITHOUT_ASSERTIONS
13666 if (unlikely(__pyx_assertions_enabled())) {
13667 __pyx_t_1 = (__pyx_v_memview->view.ndim > 0);
13669 if (unlikely(!__pyx_t_1)) {
13670 __Pyx_Raise(((PyObject *)(((PyTypeObject*)PyExc_AssertionError))), 0, 0, 0);
13671 __PYX_ERR(1, 824, __pyx_L1_error)
13676 if ((1));
else __PYX_ERR(1, 824, __pyx_L1_error)
13686 __pyx_t_1 = __Pyx_TypeCheck(((PyObject *)__pyx_v_memview), __pyx_mstate_global->__pyx_memoryviewslice_type);
13697 __pyx_t_2 = ((PyObject *)__pyx_v_memview);
13698 __Pyx_INCREF(__pyx_t_2);
13699 if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_mstate_global->__pyx_memoryviewslice_type))))) __PYX_ERR(1, 827, __pyx_L1_error)
13700 __pyx_v_memviewsliceobj = ((
struct __pyx_memoryviewslice_obj *)__pyx_t_2);
13710 __pyx_v_p_src = (&__pyx_v_memviewsliceobj->from_slice);
13730 __pyx_memoryview_slice_copy(__pyx_v_memview, (&__pyx_v_src));
13739 __pyx_v_p_src = (&__pyx_v_src);
13750 __pyx_t_3 = __pyx_v_p_src->memview;
13752 __pyx_v_dst.memview = __pyx_t_3;
13761 __pyx_t_4 = __pyx_v_p_src->data;
13763 __pyx_v_dst.data = __pyx_t_4;
13772 __pyx_v_p_dst = (&__pyx_v_dst);
13781 __pyx_v_p_suboffset_dim = (&__pyx_v_suboffset_dim);
13792 __pyx_t_2 = __pyx_v_indices; __Pyx_INCREF(__pyx_t_2);
13796 Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_2);
13797 #if !CYTHON_ASSUME_SAFE_SIZE
13798 if (unlikely((__pyx_temp < 0))) __PYX_ERR(1, 848, __pyx_L1_error)
13800 if (__pyx_t_6 >= __pyx_temp)
break;
13802 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
13803 __pyx_t_7 = __Pyx_NewRef(PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_6));
13805 __pyx_t_7 = __Pyx_PySequence_ITEM(__pyx_t_2, __pyx_t_6);
13808 if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 848, __pyx_L1_error)
13809 __Pyx_GOTREF(__pyx_t_7);
13810 __Pyx_XDECREF_SET(__pyx_v_index, __pyx_t_7);
13812 __pyx_v_dim = __pyx_t_5;
13813 __pyx_t_5 = (__pyx_t_5 + 1);
13822 __pyx_t_1 = (PyIndex_Check(__pyx_v_index) != 0);
13834 __pyx_t_8 = __Pyx_PyIndex_AsSsize_t(__pyx_v_index);
if (unlikely((__pyx_t_8 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(1, 850, __pyx_L1_error)
13835 __pyx_v_cindex = __pyx_t_8;
13844 __pyx_t_9 = __pyx_memoryview_slice_memviewslice(__pyx_v_p_dst, (__pyx_v_p_src->shape[__pyx_v_dim]), (__pyx_v_p_src->strides[__pyx_v_dim]), (__pyx_v_p_src->suboffsets[__pyx_v_dim]), __pyx_v_dim, __pyx_v_new_ndim, __pyx_v_p_suboffset_dim, __pyx_v_cindex, 0, 0, 0, 0, 0, 0);
if (unlikely(__pyx_t_9 == ((
int)-1))) __PYX_ERR(1, 851, __pyx_L1_error)
13864 __pyx_t_1 = (__pyx_v_index == Py_None);
13875 (__pyx_v_p_dst->shape[__pyx_v_new_ndim]) = 1;
13884 (__pyx_v_p_dst->strides[__pyx_v_new_ndim]) = 0;
13893 (__pyx_v_p_dst->suboffsets[__pyx_v_new_ndim]) = -1L;
13902 __pyx_v_new_ndim = (__pyx_v_new_ndim + 1);
13922 __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_mstate_global->__pyx_n_u_start);
if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 863, __pyx_L1_error)
13923 __Pyx_GOTREF(__pyx_t_7);
13924 __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_7);
if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(1, 863, __pyx_L1_error)
13926 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
13928 __pyx_t_10 = __Pyx_PyIndex_AsSsize_t(__pyx_t_7);
if (unlikely((__pyx_t_10 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(1, 863, __pyx_L1_error)
13929 __pyx_t_8 = __pyx_t_10;
13930 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
13931 goto __pyx_L7_bool_binop_done;
13935 __pyx_L7_bool_binop_done:;
13936 __pyx_v_start = __pyx_t_8;
13945 __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_mstate_global->__pyx_n_u_stop);
if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 864, __pyx_L1_error)
13946 __Pyx_GOTREF(__pyx_t_7);
13947 __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_7);
if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(1, 864, __pyx_L1_error)
13949 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
13951 __pyx_t_10 = __Pyx_PyIndex_AsSsize_t(__pyx_t_7);
if (unlikely((__pyx_t_10 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(1, 864, __pyx_L1_error)
13952 __pyx_t_8 = __pyx_t_10;
13953 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
13954 goto __pyx_L9_bool_binop_done;
13958 __pyx_L9_bool_binop_done:;
13959 __pyx_v_stop = __pyx_t_8;
13968 __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_mstate_global->__pyx_n_u_step);
if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 865, __pyx_L1_error)
13969 __Pyx_GOTREF(__pyx_t_7);
13970 __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_7);
if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(1, 865, __pyx_L1_error)
13972 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
13974 __pyx_t_10 = __Pyx_PyIndex_AsSsize_t(__pyx_t_7);
if (unlikely((__pyx_t_10 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(1, 865, __pyx_L1_error)
13975 __pyx_t_8 = __pyx_t_10;
13976 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
13977 goto __pyx_L11_bool_binop_done;
13981 __pyx_L11_bool_binop_done:;
13982 __pyx_v_step = __pyx_t_8;
13991 __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_mstate_global->__pyx_n_u_start);
if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 867, __pyx_L1_error)
13992 __Pyx_GOTREF(__pyx_t_7);
13993 __pyx_t_1 = (__pyx_t_7 != Py_None);
13994 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
13995 __pyx_v_have_start = __pyx_t_1;
14004 __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_mstate_global->__pyx_n_u_stop);
if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 868, __pyx_L1_error)
14005 __Pyx_GOTREF(__pyx_t_7);
14006 __pyx_t_1 = (__pyx_t_7 != Py_None);
14007 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
14008 __pyx_v_have_stop = __pyx_t_1;
14017 __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_mstate_global->__pyx_n_u_step);
if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 869, __pyx_L1_error)
14018 __Pyx_GOTREF(__pyx_t_7);
14019 __pyx_t_1 = (__pyx_t_7 != Py_None);
14020 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
14021 __pyx_v_have_step = __pyx_t_1;
14030 __pyx_t_9 = __pyx_memoryview_slice_memviewslice(__pyx_v_p_dst, (__pyx_v_p_src->shape[__pyx_v_dim]), (__pyx_v_p_src->strides[__pyx_v_dim]), (__pyx_v_p_src->suboffsets[__pyx_v_dim]), __pyx_v_dim, __pyx_v_new_ndim, __pyx_v_p_suboffset_dim, __pyx_v_start, __pyx_v_stop, __pyx_v_step, __pyx_v_have_start, __pyx_v_have_stop, __pyx_v_have_step, 1);
if (unlikely(__pyx_t_9 == ((
int)-1))) __PYX_ERR(1, 871, __pyx_L1_error)
14040 __pyx_v_new_ndim = (__pyx_v_new_ndim + 1);
14052 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
14061 __pyx_t_1 = __Pyx_TypeCheck(((PyObject *)__pyx_v_memview), __pyx_mstate_global->__pyx_memoryviewslice_type);
14072 if (unlikely(!__pyx_v_memviewsliceobj)) { __Pyx_RaiseUnboundLocalError(
"memviewsliceobj"); __PYX_ERR(1, 881, __pyx_L1_error) }
14081 if (unlikely(!__pyx_v_memviewsliceobj)) { __Pyx_RaiseUnboundLocalError(
"memviewsliceobj"); __PYX_ERR(1, 882, __pyx_L1_error) }
14090 __pyx_t_2 = __pyx_memoryview_fromslice(__pyx_v_dst, __pyx_v_new_ndim, __pyx_v_memviewsliceobj->to_object_func, __pyx_v_memviewsliceobj->to_dtype_func, __pyx_v_memview->dtype_is_object);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 880, __pyx_L1_error)
14091 __Pyx_GOTREF(__pyx_t_2);
14092 if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_mstate_global->__pyx_memoryview_type))))) __PYX_ERR(1, 880, __pyx_L1_error)
14094 struct __pyx_memoryview_obj *__pyx_temp;
14096 __pyx_temp = __pyx_r;
14097 __pyx_r = ((
struct __pyx_memoryview_obj *)__pyx_t_2);
14099 __Pyx_XDECREF((PyObject *)__pyx_temp);
14129 __pyx_t_2 = __pyx_memoryview_fromslice(__pyx_v_dst, __pyx_v_new_ndim, NULL, NULL, __pyx_v_memview->dtype_is_object);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 885, __pyx_L1_error)
14130 __Pyx_GOTREF(__pyx_t_2);
14139 if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_mstate_global->__pyx_memoryview_type))))) __PYX_ERR(1, 885, __pyx_L1_error)
14141 struct __pyx_memoryview_obj *__pyx_temp;
14143 __pyx_temp = __pyx_r;
14144 __pyx_r = ((
struct __pyx_memoryview_obj *)__pyx_t_2);
14146 __Pyx_XDECREF((PyObject *)__pyx_temp);
14162 __Pyx_XDECREF(__pyx_t_2);
14163 __Pyx_XDECREF(__pyx_t_7);
14164 __Pyx_AddTraceback(
"View.MemoryView.memview_slice", __pyx_clineno, __pyx_lineno, __pyx_filename);
14173 __Pyx_XDECREF((PyObject *)__pyx_v_memviewsliceobj);
14183 __Pyx_XDECREF(__pyx_v_index);
14184 __Pyx_XGIVEREF((PyObject *)__pyx_r);
14185 __Pyx_RefNannyFinishContext();
14197static char *__pyx_pybuffer_index(Py_buffer *__pyx_v_view,
char *__pyx_v_bufp, Py_ssize_t __pyx_v_index, Py_ssize_t __pyx_v_dim) {
14198 Py_ssize_t __pyx_v_shape;
14199 Py_ssize_t __pyx_v_stride;
14200 Py_ssize_t __pyx_v_suboffset;
14201 Py_ssize_t __pyx_v_itemsize;
14202 char *__pyx_v_resultp;
14204 Py_ssize_t __pyx_t_1;
14207 int __pyx_lineno = 0;
14208 const char *__pyx_filename = NULL;
14209 int __pyx_clineno = 0;
14219 __pyx_v_suboffset = -1L;
14228 __pyx_t_1 = __pyx_v_view->itemsize;
14230 __pyx_v_itemsize = __pyx_t_1;
14239 __pyx_t_2 = (__pyx_v_view->ndim == 0);
14251 if (unlikely(__pyx_v_itemsize == 0)) {
14252 PyErr_SetString(PyExc_ZeroDivisionError,
"integer division or modulo by zero");
14253 __PYX_ERR(1, 900, __pyx_L1_error)
14255 else if (
sizeof(Py_ssize_t) ==
sizeof(
long) && (!(((Py_ssize_t)-1) > 0)) && unlikely(__pyx_v_itemsize == (Py_ssize_t)-1) && unlikely(__Pyx_UNARY_NEG_WOULD_OVERFLOW(__pyx_v_view->len))) {
14256 PyErr_SetString(PyExc_OverflowError,
"value too large to perform division");
14257 __PYX_ERR(1, 900, __pyx_L1_error)
14259 __pyx_v_shape = __Pyx_div_Py_ssize_t(__pyx_v_view->len, __pyx_v_itemsize, 0);
14268 __pyx_v_stride = __pyx_v_itemsize;
14288 __pyx_v_shape = (__pyx_v_view->shape[__pyx_v_dim]);
14297 __pyx_v_stride = (__pyx_v_view->strides[__pyx_v_dim]);
14306 __pyx_t_2 = (__pyx_v_view->suboffsets != NULL);
14318 __pyx_v_suboffset = (__pyx_v_view->suboffsets[__pyx_v_dim]);
14338 __pyx_t_2 = (__pyx_v_index < 0);
14350 __pyx_v_index = (__pyx_v_index + (__pyx_v_view->shape[__pyx_v_dim]));
14359 __pyx_t_2 = (__pyx_v_index < 0);
14361 if (unlikely(__pyx_t_2)) {
14371 __pyx_t_3 = __pyx_memoryview_err_IndexError(__pyx_k_Out_of_bounds_on_buffer_access_a, __pyx_v_dim);
if (unlikely(__pyx_t_3 == ((
int)-1))) __PYX_ERR(1, 911, __pyx_L1_error)
14399 __pyx_t_2 = (__pyx_v_index >= __pyx_v_shape);
14401 if (unlikely(__pyx_t_2)) {
14411 __pyx_t_3 = __pyx_memoryview_err_IndexError(__pyx_k_Out_of_bounds_on_buffer_access_a, __pyx_v_dim);
if (unlikely(__pyx_t_3 == ((
int)-1))) __PYX_ERR(1, 914, __pyx_L1_error)
14430 __pyx_v_resultp = (__pyx_v_bufp + (__pyx_v_index * __pyx_v_stride));
14439 __pyx_t_2 = (__pyx_v_suboffset >= 0);
14451 __pyx_v_resultp = ((((
char **)__pyx_v_resultp)[0]) + __pyx_v_suboffset);
14471 __pyx_r = __pyx_v_resultp;
14485 __Pyx_AddTraceback(
"View.MemoryView.pybuffer_index", __pyx_clineno, __pyx_lineno, __pyx_filename);
14506static int __pyx_memslice_transpose(__Pyx_memviewslice *__pyx_v_memslice) {
14508 Py_ssize_t *__pyx_v_shape;
14509 Py_ssize_t *__pyx_v_strides;
14514 Py_ssize_t *__pyx_t_2;
14517 Py_ssize_t __pyx_t_5;
14518 Py_ssize_t __pyx_t_6;
14522 int __pyx_lineno = 0;
14523 const char *__pyx_filename = NULL;
14524 int __pyx_clineno = 0;
14525 PyGILState_STATE __pyx_gilstate_save;
14534 __pyx_t_1 = __pyx_v_memslice->memview->view.ndim;
14536 __pyx_v_ndim = __pyx_t_1;
14545 __pyx_t_2 = __pyx_v_memslice->shape;
14547 __pyx_v_shape = __pyx_t_2;
14556 __pyx_t_2 = __pyx_v_memslice->strides;
14558 __pyx_v_strides = __pyx_t_2;
14568 __pyx_t_3 = __Pyx_div_long(__pyx_v_ndim, 2, 1);
14569 __pyx_t_4 = __pyx_t_3;
14571 for (__pyx_t_1 = 0; __pyx_t_1 < __pyx_t_4; __pyx_t_1+=1) {
14572 __pyx_v_i = __pyx_t_1;
14581 __pyx_v_j = ((__pyx_v_ndim - 1) - __pyx_v_i);
14590 __pyx_t_5 = (__pyx_v_strides[__pyx_v_j]);
14592 __pyx_t_6 = (__pyx_v_strides[__pyx_v_i]);
14594 (__pyx_v_strides[__pyx_v_i]) = __pyx_t_5;
14596 (__pyx_v_strides[__pyx_v_j]) = __pyx_t_6;
14606 __pyx_t_6 = (__pyx_v_shape[__pyx_v_j]);
14608 __pyx_t_5 = (__pyx_v_shape[__pyx_v_i]);
14610 (__pyx_v_shape[__pyx_v_i]) = __pyx_t_6;
14612 (__pyx_v_shape[__pyx_v_j]) = __pyx_t_5;
14622 __pyx_t_8 = ((__pyx_v_memslice->suboffsets[__pyx_v_i]) >= 0);
14628 __pyx_t_7 = __pyx_t_8;
14630 goto __pyx_L6_bool_binop_done;
14632 __pyx_t_8 = ((__pyx_v_memslice->suboffsets[__pyx_v_j]) >= 0);
14635 __pyx_t_7 = __pyx_t_8;
14637 __pyx_L6_bool_binop_done:;
14638 if (unlikely(__pyx_t_7)) {
14648 __pyx_t_9 = __pyx_memoryview_err(PyExc_ValueError, __pyx_k_Cannot_transpose_memoryview_with);
if (unlikely(__pyx_t_9 == ((
int)-1))) __PYX_ERR(1, 940, __pyx_L1_error)
14685 __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
14686 __Pyx_AddTraceback(
"View.MemoryView.transpose_memslice", __pyx_clineno, __pyx_lineno, __pyx_filename);
14688 __Pyx_PyGILState_Release(__pyx_gilstate_save);
14707static void __pyx_memoryviewslice___dealloc__(PyObject *__pyx_v_self);
14708static void __pyx_memoryviewslice___dealloc__(PyObject *__pyx_v_self) {
14709 CYTHON_UNUSED PyObject *
const *__pyx_kwvalues;
14710 __Pyx_RefNannyDeclarations
14711 __Pyx_RefNannySetupContext(
"__dealloc__ (wrapper)", 0);
14712 __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
14713 __pyx_memoryviewslice___pyx_pf_15View_dot_MemoryView_16_memoryviewslice___dealloc__(((
struct __pyx_memoryviewslice_obj *)__pyx_v_self));
14716 __Pyx_RefNannyFinishContext();
14719static void __pyx_memoryviewslice___pyx_pf_15View_dot_MemoryView_16_memoryviewslice___dealloc__(
struct __pyx_memoryviewslice_obj *__pyx_v_self) {
14728 __PYX_XCLEAR_MEMVIEW((&__pyx_v_self->from_slice), 1);
14750static PyObject *__pyx_memoryviewslice_convert_item_to_object(
struct __pyx_memoryviewslice_obj *__pyx_v_self,
char *__pyx_v_itemp) {
14751 PyObject *__pyx_r = NULL;
14752 __Pyx_RefNannyDeclarations
14754 PyObject *__pyx_t_2 = NULL;
14755 int __pyx_lineno = 0;
14756 const char *__pyx_filename = NULL;
14757 int __pyx_clineno = 0;
14758 __Pyx_RefNannySetupContext(
"convert_item_to_object", 0);
14767 __pyx_t_1 = (__pyx_v_self->to_object_func != NULL);
14779 __pyx_t_2 = __pyx_v_self->to_object_func(__pyx_v_itemp);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 965, __pyx_L1_error)
14780 __Pyx_GOTREF(__pyx_t_2);
14782 PyObject *__pyx_temp;
14784 __pyx_temp = __pyx_r;
14785 __pyx_r = __pyx_t_2;
14787 __Pyx_XDECREF(__pyx_temp);
14809 __pyx_t_2 = __pyx_memoryview_convert_item_to_object(((
struct __pyx_memoryview_obj *)__pyx_v_self), __pyx_v_itemp);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 967, __pyx_L1_error)
14810 __Pyx_GOTREF(__pyx_t_2);
14812 PyObject *__pyx_temp;
14814 __pyx_temp = __pyx_r;
14815 __pyx_r = __pyx_t_2;
14817 __Pyx_XDECREF(__pyx_temp);
14833 __Pyx_XDECREF(__pyx_t_2);
14834 __Pyx_AddTraceback(
"View.MemoryView._memoryviewslice.convert_item_to_object", __pyx_clineno, __pyx_lineno, __pyx_filename);
14837 __Pyx_XGIVEREF(__pyx_r);
14838 __Pyx_RefNannyFinishContext();
14850static PyObject *__pyx_memoryviewslice_assign_item_from_object(
struct __pyx_memoryviewslice_obj *__pyx_v_self,
char *__pyx_v_itemp, PyObject *__pyx_v_value) {
14851 PyObject *__pyx_r = NULL;
14852 __Pyx_RefNannyDeclarations
14855 PyObject *__pyx_t_3 = NULL;
14856 int __pyx_lineno = 0;
14857 const char *__pyx_filename = NULL;
14858 int __pyx_clineno = 0;
14859 __Pyx_RefNannySetupContext(
"assign_item_from_object", 0);
14868 __pyx_t_1 = (__pyx_v_self->to_dtype_func != NULL);
14880 __pyx_t_2 = __pyx_v_self->to_dtype_func(__pyx_v_itemp, __pyx_v_value);
if (unlikely(__pyx_t_2 == ((
int)0))) __PYX_ERR(1, 971, __pyx_L1_error)
14901 __pyx_t_3 = __pyx_memoryview_assign_item_from_object(((
struct __pyx_memoryview_obj *)__pyx_v_self), __pyx_v_itemp, __pyx_v_value);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 973, __pyx_L1_error)
14902 __Pyx_GOTREF(__pyx_t_3);
14903 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
14916 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
14919 __Pyx_XDECREF(__pyx_t_3);
14920 __Pyx_AddTraceback(
"View.MemoryView._memoryviewslice.assign_item_from_object", __pyx_clineno, __pyx_lineno, __pyx_filename);
14923 __Pyx_XGIVEREF(__pyx_r);
14924 __Pyx_RefNannyFinishContext();
14936static PyObject *__pyx_memoryviewslice__get_base(
struct __pyx_memoryviewslice_obj *__pyx_v_self) {
14937 PyObject *__pyx_r = NULL;
14938 __Pyx_RefNannyDeclarations
14939 __Pyx_RefNannySetupContext(
"_get_base", 0);
14949 PyObject *__pyx_temp;
14951 __pyx_temp = __pyx_r;
14952 __Pyx_INCREF(__pyx_v_self->from_object);
14953 __pyx_r = __pyx_v_self->from_object;
14955 __Pyx_XDECREF(__pyx_temp);
14969 __Pyx_XGIVEREF(__pyx_r);
14970 __Pyx_RefNannyFinishContext();
14981static PyObject *__pyx_pw___pyx_memoryviewslice_1__reduce_cython__(PyObject *__pyx_v_self,
14982#
if CYTHON_VECTORCALL
14983PyObject *
const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
14985PyObject *__pyx_args, PyObject *__pyx_kwds
14988static PyObject *__pyx_pw___pyx_memoryviewslice_1__reduce_cython__(PyObject *__pyx_v_self,
14989#
if CYTHON_VECTORCALL
14990PyObject *
const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
14992PyObject *__pyx_args, PyObject *__pyx_kwds
14995 #if !CYTHON_VECTORCALL
14996 CYTHON_UNUSED Py_ssize_t __pyx_nargs;
14998 CYTHON_UNUSED PyObject *
const *__pyx_kwvalues;
14999 PyObject *__pyx_r = 0;
15000 __Pyx_RefNannyDeclarations
15001 __Pyx_RefNannySetupContext(
"__reduce_cython__ (wrapper)", 0);
15002 #if !CYTHON_VECTORCALL
15003 #if CYTHON_ASSUME_SAFE_SIZE
15004 __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
15006 __pyx_nargs = PyTuple_Size(__pyx_args);
if (unlikely(__pyx_nargs < 0))
return NULL;
15009 __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
15010 if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid(
"__reduce_cython__", 1, 0, 0, __pyx_nargs);
return NULL; }
15011 const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
15012 if (unlikely(__pyx_kwds_len < 0))
return NULL;
15013 if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords(
"__reduce_cython__", __pyx_kwds);
return NULL;}
15014 __pyx_r = __pyx_pf___pyx_memoryviewslice___reduce_cython__(((
struct __pyx_memoryviewslice_obj *)__pyx_v_self));
15017 __Pyx_RefNannyFinishContext();
15021static PyObject *__pyx_pf___pyx_memoryviewslice___reduce_cython__(CYTHON_UNUSED
struct __pyx_memoryviewslice_obj *__pyx_v_self) {
15022 PyObject *__pyx_r = NULL;
15023 __Pyx_RefNannyDeclarations
15024 int __pyx_lineno = 0;
15025 const char *__pyx_filename = NULL;
15026 int __pyx_clineno = 0;
15027 __Pyx_RefNannySetupContext(
"__reduce_cython__", 0);
15035 __Pyx_Raise(((PyObject *)(((PyTypeObject*)PyExc_TypeError))), __pyx_mstate_global->__pyx_kp_u_no_default___reduce___due_to_non, 0, 0);
15036 __PYX_ERR(1, 2, __pyx_L1_error)
15046 __Pyx_AddTraceback(
"View.MemoryView._memoryviewslice.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
15048 __Pyx_XGIVEREF(__pyx_r);
15049 __Pyx_RefNannyFinishContext();
15061static PyObject *__pyx_pw___pyx_memoryviewslice_3__setstate_cython__(PyObject *__pyx_v_self,
15062#
if CYTHON_VECTORCALL
15063PyObject *
const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
15065PyObject *__pyx_args, PyObject *__pyx_kwds
15068static PyObject *__pyx_pw___pyx_memoryviewslice_3__setstate_cython__(PyObject *__pyx_v_self,
15069#
if CYTHON_VECTORCALL
15070PyObject *
const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
15072PyObject *__pyx_args, PyObject *__pyx_kwds
15075 CYTHON_UNUSED PyObject *__pyx_v___pyx_state = 0;
15076 #if !CYTHON_VECTORCALL
15077 CYTHON_UNUSED Py_ssize_t __pyx_nargs;
15079 CYTHON_UNUSED PyObject *
const *__pyx_kwvalues;
15080 PyObject* values[1] = {0};
15081 int __pyx_lineno = 0;
15082 const char *__pyx_filename = NULL;
15083 int __pyx_clineno = 0;
15084 PyObject *__pyx_r = 0;
15085 __Pyx_RefNannyDeclarations
15086 __Pyx_RefNannySetupContext(
"__setstate_cython__ (wrapper)", 0);
15087 #if !CYTHON_VECTORCALL
15088 #if CYTHON_ASSUME_SAFE_SIZE
15089 __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
15091 __pyx_nargs = PyTuple_Size(__pyx_args);
if (unlikely(__pyx_nargs < 0))
return NULL;
15094 __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
15096 PyObject **
const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_pyx_state,0};
15097 const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
15098 if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(1, 3, __pyx_L3_error)
15099 if (__pyx_kwds_len > 0) {
15100 switch (__pyx_nargs) {
15102 values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
15103 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(1, 3, __pyx_L3_error)
15104 CYTHON_FALLTHROUGH;
15106 default:
goto __pyx_L5_argtuple_error;
15108 const Py_ssize_t kwd_pos_args = __pyx_nargs;
15109 if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len,
"__setstate_cython__", 0) < (0)) __PYX_ERR(1, 3, __pyx_L3_error)
15110 for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
15111 if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid(
"__setstate_cython__", 1, 1, 1, i); __PYX_ERR(1, 3, __pyx_L3_error) }
15113 }
else if (unlikely(__pyx_nargs != 1)) {
15114 goto __pyx_L5_argtuple_error;
15116 values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
15117 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(1, 3, __pyx_L3_error)
15119 __pyx_v___pyx_state = values[0];
15121 goto __pyx_L6_skip;
15122 __pyx_L5_argtuple_error:;
15123 __Pyx_RaiseArgtupleInvalid(
"__setstate_cython__", 1, 1, 1, __pyx_nargs); __PYX_ERR(1, 3, __pyx_L3_error)
15125 goto __pyx_L4_argument_unpacking_done;
15127 for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(
sizeof(values)/
sizeof(values[0])); ++__pyx_temp) {
15128 Py_XDECREF(values[__pyx_temp]);
15130 __Pyx_AddTraceback(
"View.MemoryView._memoryviewslice.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
15131 __Pyx_RefNannyFinishContext();
15133 __pyx_L4_argument_unpacking_done:;
15134 __pyx_r = __pyx_pf___pyx_memoryviewslice_2__setstate_cython__(((
struct __pyx_memoryviewslice_obj *)__pyx_v_self), __pyx_v___pyx_state);
15137 for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(
sizeof(values)/
sizeof(values[0])); ++__pyx_temp) {
15138 Py_XDECREF(values[__pyx_temp]);
15140 __Pyx_RefNannyFinishContext();
15144static PyObject *__pyx_pf___pyx_memoryviewslice_2__setstate_cython__(CYTHON_UNUSED
struct __pyx_memoryviewslice_obj *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) {
15145 PyObject *__pyx_r = NULL;
15146 __Pyx_RefNannyDeclarations
15147 int __pyx_lineno = 0;
15148 const char *__pyx_filename = NULL;
15149 int __pyx_clineno = 0;
15150 __Pyx_RefNannySetupContext(
"__setstate_cython__", 0);
15157 __Pyx_Raise(((PyObject *)(((PyTypeObject*)PyExc_TypeError))), __pyx_mstate_global->__pyx_kp_u_no_default___reduce___due_to_non, 0, 0);
15158 __PYX_ERR(1, 4, __pyx_L1_error)
15169 __Pyx_AddTraceback(
"View.MemoryView._memoryviewslice.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
15171 __Pyx_XGIVEREF(__pyx_r);
15172 __Pyx_RefNannyFinishContext();
15184static PyObject *__pyx_memoryview_fromslice(__Pyx_memviewslice __pyx_v_memviewslice,
int __pyx_v_ndim, PyObject *(*__pyx_v_to_object_func)(
char *), __pyx_memoryview_to_dtype_func_type __pyx_v_to_dtype_func,
int __pyx_v_dtype_is_object) {
15185 struct __pyx_memoryviewslice_obj *__pyx_v_result = 0;
15186 Py_ssize_t __pyx_v_suboffset;
15187 Py_ssize_t __pyx_v_length;
15188 PyObject *__pyx_r = NULL;
15189 __Pyx_RefNannyDeclarations
15191 PyObject *__pyx_t_2 = NULL;
15192 PyObject *__pyx_t_3 = NULL;
15193 __Pyx_TypeInfo
const *__pyx_t_4;
15194 Py_buffer __pyx_t_5;
15195 Py_ssize_t *__pyx_t_6;
15196 Py_ssize_t *__pyx_t_7;
15197 Py_ssize_t *__pyx_t_8;
15198 Py_ssize_t __pyx_t_9;
15199 int __pyx_lineno = 0;
15200 const char *__pyx_filename = NULL;
15201 int __pyx_clineno = 0;
15202 __Pyx_RefNannySetupContext(
"memoryview_fromslice", 0);
15211 __pyx_t_1 = (((PyObject *)__pyx_v_memviewslice.memview) == Py_None);
15224 PyObject *__pyx_temp;
15226 __pyx_temp = __pyx_r;
15227 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
15229 __Pyx_XDECREF(__pyx_temp);
15249 __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_v_dtype_is_object);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1010, __pyx_L1_error)
15250 __Pyx_GOTREF(__pyx_t_2);
15251 __pyx_t_3 = PyTuple_New(3);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1010, __pyx_L1_error)
15252 __Pyx_GOTREF(__pyx_t_3);
15253 __Pyx_INCREF(Py_None);
15254 __Pyx_GIVEREF(Py_None);
15255 if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, Py_None) != (0)) __PYX_ERR(1, 1010, __pyx_L1_error);
15256 __Pyx_INCREF(__pyx_mstate_global->__pyx_int_0);
15257 __Pyx_GIVEREF(__pyx_mstate_global->__pyx_int_0);
15258 if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_mstate_global->__pyx_int_0) != (0)) __PYX_ERR(1, 1010, __pyx_L1_error);
15259 __Pyx_GIVEREF(__pyx_t_2);
15260 if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_t_2) != (0)) __PYX_ERR(1, 1010, __pyx_L1_error);
15262 __pyx_t_2 = ((PyObject *)__pyx_tp_new__memoryviewslice(((PyTypeObject *)__pyx_mstate_global->__pyx_memoryviewslice_type), __pyx_t_3, NULL));
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1010, __pyx_L1_error)
15263 __Pyx_GOTREF(__pyx_t_2);
15264 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
15265 __pyx_v_result = ((
struct __pyx_memoryviewslice_obj *)__pyx_t_2);
15275 __pyx_v_result->from_slice = __pyx_v_memviewslice;
15284 __PYX_INC_MEMVIEW((&__pyx_v_memviewslice), 1);
15293 __pyx_t_2 = ((
struct __pyx_vtabstruct_memoryview *)((
struct __pyx_memoryview_obj *)__pyx_v_memviewslice.memview)->__pyx_vtab)->_get_base(((
struct __pyx_memoryview_obj *)__pyx_v_memviewslice.memview));
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1015, __pyx_L1_error)
15294 __Pyx_GOTREF(__pyx_t_2);
15295 __Pyx_GIVEREF(__pyx_t_2);
15296 __Pyx_GOTREF(__pyx_v_result->from_object);
15297 __Pyx_DECREF(__pyx_v_result->from_object);
15298 __pyx_v_result->from_object = __pyx_t_2;
15308 __pyx_t_4 = __pyx_v_memviewslice.memview->typeinfo;
15310 __pyx_v_result->__pyx_base.typeinfo = __pyx_t_4;
15319 __pyx_t_5 = __pyx_v_memviewslice.memview->view;
15321 __pyx_v_result->__pyx_base.view = __pyx_t_5;
15330 __pyx_v_result->__pyx_base.view.buf = ((
void *)__pyx_v_memviewslice.data);
15339 __pyx_v_result->__pyx_base.view.ndim = __pyx_v_ndim;
15348 ((Py_buffer *)(&__pyx_v_result->__pyx_base.view))->obj = Py_None;
15357 Py_INCREF(Py_None);
15366 __pyx_t_1 = ((((
struct __pyx_memoryview_obj *)__pyx_v_memviewslice.memview)->flags & PyBUF_WRITABLE) != 0);
15378 __pyx_v_result->__pyx_base.flags = PyBUF_RECORDS;
15398 __pyx_v_result->__pyx_base.flags = PyBUF_RECORDS_RO;
15409 __pyx_v_result->__pyx_base.view.shape = ((Py_ssize_t *)__pyx_v_result->from_slice.shape);
15418 __pyx_v_result->__pyx_base.view.strides = ((Py_ssize_t *)__pyx_v_result->from_slice.strides);
15427 __pyx_v_result->__pyx_base.view.suboffsets = NULL;
15436 __pyx_t_7 = (__pyx_v_result->from_slice.suboffsets + __pyx_v_ndim);
15438 for (__pyx_t_8 = __pyx_v_result->from_slice.suboffsets; __pyx_t_8 < __pyx_t_7; __pyx_t_8++) {
15439 __pyx_t_6 = __pyx_t_8;
15440 __pyx_v_suboffset = (__pyx_t_6[0]);
15449 __pyx_t_1 = (__pyx_v_suboffset >= 0);
15461 __pyx_v_result->__pyx_base.view.suboffsets = ((Py_ssize_t *)__pyx_v_result->from_slice.suboffsets);
15470 goto __pyx_L6_break;
15491 __pyx_t_9 = __pyx_v_result->__pyx_base.view.itemsize;
15493 __pyx_v_result->__pyx_base.view.len = __pyx_t_9;
15502 __pyx_t_7 = (__pyx_v_result->__pyx_base.view.shape + __pyx_v_ndim);
15504 for (__pyx_t_8 = __pyx_v_result->__pyx_base.view.shape; __pyx_t_8 < __pyx_t_7; __pyx_t_8++) {
15505 __pyx_t_6 = __pyx_t_8;
15506 __pyx_v_length = (__pyx_t_6[0]);
15515 __pyx_v_result->__pyx_base.view.len = (__pyx_v_result->__pyx_base.view.len * __pyx_v_length);
15526 __pyx_v_result->to_object_func = __pyx_v_to_object_func;
15535 __pyx_v_result->to_dtype_func = __pyx_v_to_dtype_func;
15545 PyObject *__pyx_temp;
15547 __pyx_temp = __pyx_r;
15548 __Pyx_INCREF((PyObject *)__pyx_v_result);
15549 __pyx_r = ((PyObject *)__pyx_v_result);
15551 __Pyx_XDECREF(__pyx_temp);
15565 __Pyx_XDECREF(__pyx_t_2);
15566 __Pyx_XDECREF(__pyx_t_3);
15567 __Pyx_AddTraceback(
"View.MemoryView.memoryview_fromslice", __pyx_clineno, __pyx_lineno, __pyx_filename);
15570 __Pyx_XDECREF((PyObject *)__pyx_v_result);
15573 __Pyx_XGIVEREF(__pyx_r);
15574 __Pyx_RefNannyFinishContext();
15586static __Pyx_memviewslice *__pyx_memoryview_get_slice_from_memoryview(
struct __pyx_memoryview_obj *__pyx_v_memview, __Pyx_memviewslice *__pyx_v_mslice) {
15587 struct __pyx_memoryviewslice_obj *__pyx_v_obj = 0;
15588 __Pyx_memviewslice *__pyx_r;
15589 __Pyx_RefNannyDeclarations
15591 PyObject *__pyx_t_2 = NULL;
15592 int __pyx_lineno = 0;
15593 const char *__pyx_filename = NULL;
15594 int __pyx_clineno = 0;
15595 __Pyx_RefNannySetupContext(
"get_slice_from_memview", 0);
15604 __pyx_t_1 = __Pyx_TypeCheck(((PyObject *)__pyx_v_memview), __pyx_mstate_global->__pyx_memoryviewslice_type);
15615 __pyx_t_2 = ((PyObject *)__pyx_v_memview);
15616 __Pyx_INCREF(__pyx_t_2);
15617 if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_mstate_global->__pyx_memoryviewslice_type))))) __PYX_ERR(1, 1054, __pyx_L1_error)
15618 __pyx_v_obj = ((
struct __pyx_memoryviewslice_obj *)__pyx_t_2);
15630 __pyx_r = (&__pyx_v_obj->from_slice);
15651 __pyx_memoryview_slice_copy(__pyx_v_memview, __pyx_v_mslice);
15662 __pyx_r = __pyx_v_mslice;
15677 __Pyx_XDECREF(__pyx_t_2);
15678 __Pyx_AddTraceback(
"View.MemoryView.get_slice_from_memview", __pyx_clineno, __pyx_lineno, __pyx_filename);
15681 __Pyx_XDECREF((PyObject *)__pyx_v_obj);
15683 __Pyx_RefNannyFinishContext();
15695static void __pyx_memoryview_slice_copy(
struct __pyx_memoryview_obj *__pyx_v_memview, __Pyx_memviewslice *__pyx_v_dst) {
15697 Py_ssize_t *__pyx_v_shape;
15698 Py_ssize_t *__pyx_v_strides;
15699 Py_ssize_t *__pyx_v_suboffsets;
15700 Py_ssize_t *__pyx_t_1;
15704 Py_ssize_t __pyx_t_5;
15714 __pyx_t_1 = __pyx_v_memview->view.shape;
15716 __pyx_v_shape = __pyx_t_1;
15725 __pyx_t_1 = __pyx_v_memview->view.strides;
15727 __pyx_v_strides = __pyx_t_1;
15736 __pyx_t_1 = __pyx_v_memview->view.suboffsets;
15738 __pyx_v_suboffsets = __pyx_t_1;
15747 __pyx_v_dst->memview = ((
struct __pyx_memoryview_obj *)__pyx_v_memview);
15756 __pyx_v_dst->data = ((
char *)__pyx_v_memview->view.buf);
15766 __pyx_t_2 = __pyx_v_memview->view.ndim;
15767 __pyx_t_3 = __pyx_t_2;
15769 for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
15770 __pyx_v_dim = __pyx_t_4;
15779 (__pyx_v_dst->shape[__pyx_v_dim]) = (__pyx_v_shape[__pyx_v_dim]);
15788 (__pyx_v_dst->strides[__pyx_v_dim]) = (__pyx_v_strides[__pyx_v_dim]);
15797 __pyx_t_6 = (__pyx_v_suboffsets != 0);
15801 __pyx_t_5 = (__pyx_v_suboffsets[__pyx_v_dim]);
15807 (__pyx_v_dst->suboffsets[__pyx_v_dim]) = __pyx_t_5;
15836static PyObject *__pyx_memoryview_copy_object(
struct __pyx_memoryview_obj *__pyx_v_memview) {
15837 __Pyx_memviewslice __pyx_v_memviewslice;
15838 PyObject *__pyx_r = NULL;
15839 __Pyx_RefNannyDeclarations
15840 PyObject *__pyx_t_1 = NULL;
15841 int __pyx_lineno = 0;
15842 const char *__pyx_filename = NULL;
15843 int __pyx_clineno = 0;
15844 __Pyx_RefNannySetupContext(
"memoryview_copy", 0);
15853 __pyx_memoryview_slice_copy(__pyx_v_memview, (&__pyx_v_memviewslice));
15862 __pyx_t_1 = __pyx_memoryview_copy_object_from_slice(__pyx_v_memview, (&__pyx_v_memviewslice));
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1082, __pyx_L1_error)
15863 __Pyx_GOTREF(__pyx_t_1);
15865 PyObject *__pyx_temp;
15867 __pyx_temp = __pyx_r;
15868 __pyx_r = __pyx_t_1;
15870 __Pyx_XDECREF(__pyx_temp);
15885 __Pyx_XDECREF(__pyx_t_1);
15886 __Pyx_AddTraceback(
"View.MemoryView.memoryview_copy", __pyx_clineno, __pyx_lineno, __pyx_filename);
15890 __Pyx_XGIVEREF(__pyx_r);
15891 __Pyx_RefNannyFinishContext();
15903static PyObject *__pyx_memoryview_copy_object_from_slice(
struct __pyx_memoryview_obj *__pyx_v_memview, __Pyx_memviewslice *__pyx_v_memviewslice) {
15904 PyObject *(*__pyx_v_to_object_func)(
char *);
15905 __pyx_memoryview_to_dtype_func_type __pyx_v_to_dtype_func;
15906 PyObject *__pyx_r = NULL;
15907 __Pyx_RefNannyDeclarations
15909 PyObject *(*__pyx_t_2)(
char *);
15910 __pyx_memoryview_to_dtype_func_type __pyx_t_3;
15911 PyObject *__pyx_t_4 = NULL;
15912 int __pyx_lineno = 0;
15913 const char *__pyx_filename = NULL;
15914 int __pyx_clineno = 0;
15915 __Pyx_RefNannySetupContext(
"memoryview_copy_from_slice", 0);
15924 __pyx_t_1 = __Pyx_TypeCheck(((PyObject *)__pyx_v_memview), __pyx_mstate_global->__pyx_memoryviewslice_type);
15935 __pyx_t_2 = ((
struct __pyx_memoryviewslice_obj *)__pyx_v_memview)->to_object_func;
15937 __pyx_v_to_object_func = __pyx_t_2;
15946 __pyx_t_3 = ((
struct __pyx_memoryviewslice_obj *)__pyx_v_memview)->to_dtype_func;
15948 __pyx_v_to_dtype_func = __pyx_t_3;
15968 __pyx_v_to_object_func = NULL;
15977 __pyx_v_to_dtype_func = NULL;
15988 __pyx_t_4 = __pyx_memoryview_fromslice((__pyx_v_memviewslice[0]), __pyx_v_memview->view.ndim, __pyx_v_to_object_func, __pyx_v_to_dtype_func, __pyx_v_memview->dtype_is_object);
if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 1099, __pyx_L1_error)
15989 __Pyx_GOTREF(__pyx_t_4);
15991 PyObject *__pyx_temp;
15993 __pyx_temp = __pyx_r;
15994 __pyx_r = __pyx_t_4;
15996 __Pyx_XDECREF(__pyx_temp);
16011 __Pyx_XDECREF(__pyx_t_4);
16012 __Pyx_AddTraceback(
"View.MemoryView.memoryview_copy_from_slice", __pyx_clineno, __pyx_lineno, __pyx_filename);
16017 __Pyx_XGIVEREF(__pyx_r);
16018 __Pyx_RefNannyFinishContext();
16030static Py_ssize_t abs_py_ssize_t(Py_ssize_t __pyx_v_arg) {
16031 Py_ssize_t __pyx_r;
16032 Py_ssize_t __pyx_t_1;
16042 __pyx_t_2 = (__pyx_v_arg < 0);
16046 __pyx_t_1 = (-__pyx_v_arg);
16049 __pyx_t_1 = __pyx_v_arg;
16053 __pyx_r = __pyx_t_1;
16078static char __pyx_get_best_slice_order(__Pyx_memviewslice *__pyx_v_mslice,
int __pyx_v_ndim) {
16080 Py_ssize_t __pyx_v_c_stride;
16081 Py_ssize_t __pyx_v_f_stride;
16095 __pyx_v_c_stride = 0;
16104 __pyx_v_f_stride = 0;
16113 for (__pyx_t_1 = (__pyx_v_ndim - 1); __pyx_t_1 > -1; __pyx_t_1-=1) {
16114 __pyx_v_i = __pyx_t_1;
16123 __pyx_t_2 = ((__pyx_v_mslice->shape[__pyx_v_i]) > 1);
16135 __pyx_v_c_stride = (__pyx_v_mslice->strides[__pyx_v_i]);
16144 goto __pyx_L4_break;
16165 __pyx_t_1 = __pyx_v_ndim;
16166 __pyx_t_3 = __pyx_t_1;
16168 for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
16169 __pyx_v_i = __pyx_t_4;
16178 __pyx_t_2 = ((__pyx_v_mslice->shape[__pyx_v_i]) > 1);
16190 __pyx_v_f_stride = (__pyx_v_mslice->strides[__pyx_v_i]);
16199 goto __pyx_L7_break;
16220 __pyx_t_2 = (abs_py_ssize_t(__pyx_v_c_stride) <= abs_py_ssize_t(__pyx_v_f_stride));
16286static void _copy_strided_to_strided(
char *__pyx_v_src_data, Py_ssize_t *__pyx_v_src_strides,
char *__pyx_v_dst_data, Py_ssize_t *__pyx_v_dst_strides, Py_ssize_t *__pyx_v_src_shape, Py_ssize_t *__pyx_v_dst_shape,
int __pyx_v_ndim,
size_t __pyx_v_itemsize) {
16287 CYTHON_UNUSED Py_ssize_t __pyx_v_i;
16288 CYTHON_UNUSED Py_ssize_t __pyx_v_src_extent;
16289 Py_ssize_t __pyx_v_dst_extent;
16290 Py_ssize_t __pyx_v_src_stride;
16291 Py_ssize_t __pyx_v_dst_stride;
16294 Py_ssize_t __pyx_t_3;
16295 Py_ssize_t __pyx_t_4;
16296 Py_ssize_t __pyx_t_5;
16307 __pyx_v_src_extent = (__pyx_v_src_shape[0]);
16316 __pyx_v_dst_extent = (__pyx_v_dst_shape[0]);
16325 __pyx_v_src_stride = (__pyx_v_src_strides[0]);
16334 __pyx_v_dst_stride = (__pyx_v_dst_strides[0]);
16343 __pyx_t_1 = (__pyx_v_ndim == 1);
16355 __pyx_t_2 = (__pyx_v_src_stride > 0);
16361 __pyx_t_1 = __pyx_t_2;
16363 goto __pyx_L5_bool_binop_done;
16365 __pyx_t_2 = (__pyx_v_dst_stride > 0);
16371 __pyx_t_1 = __pyx_t_2;
16373 goto __pyx_L5_bool_binop_done;
16383 __pyx_t_2 = (((size_t)__pyx_v_src_stride) == __pyx_v_itemsize);
16385 __pyx_t_2 = (__pyx_v_itemsize == ((size_t)__pyx_v_dst_stride));
16388 __pyx_t_1 = __pyx_t_2;
16390 __pyx_L5_bool_binop_done:;
16409 (void)(memcpy(__pyx_v_dst_data, __pyx_v_src_data, (__pyx_v_itemsize * ((
size_t)__pyx_v_dst_extent))));
16430 __pyx_t_3 = __pyx_v_dst_extent;
16431 __pyx_t_4 = __pyx_t_3;
16433 for (__pyx_t_5 = 0; __pyx_t_5 < __pyx_t_4; __pyx_t_5+=1) {
16434 __pyx_v_i = __pyx_t_5;
16443 (void)(memcpy(__pyx_v_dst_data, __pyx_v_src_data, __pyx_v_itemsize));
16452 __pyx_v_src_data = (__pyx_v_src_data + __pyx_v_src_stride);
16461 __pyx_v_dst_data = (__pyx_v_dst_data + __pyx_v_dst_stride);
16486 __pyx_t_3 = __pyx_v_dst_extent;
16487 __pyx_t_4 = __pyx_t_3;
16489 for (__pyx_t_5 = 0; __pyx_t_5 < __pyx_t_4; __pyx_t_5+=1) {
16490 __pyx_v_i = __pyx_t_5;
16499 _copy_strided_to_strided(__pyx_v_src_data, (__pyx_v_src_strides + 1), __pyx_v_dst_data, (__pyx_v_dst_strides + 1), (__pyx_v_src_shape + 1), (__pyx_v_dst_shape + 1), (__pyx_v_ndim - 1), __pyx_v_itemsize);
16508 __pyx_v_src_data = (__pyx_v_src_data + __pyx_v_src_stride);
16517 __pyx_v_dst_data = (__pyx_v_dst_data + __pyx_v_dst_stride);
16549static void copy_strided_to_strided(__Pyx_memviewslice *__pyx_v_src, __Pyx_memviewslice *__pyx_v_dst,
int __pyx_v_ndim,
size_t __pyx_v_itemsize) {
16558 _copy_strided_to_strided(__pyx_v_src->data, __pyx_v_src->strides, __pyx_v_dst->data, __pyx_v_dst->strides, __pyx_v_src->shape, __pyx_v_dst->shape, __pyx_v_ndim, __pyx_v_itemsize);
16579static size_t __pyx_memoryview_slice_get_size(__Pyx_memviewslice *__pyx_v_src,
int __pyx_v_ndim) {
16580 Py_ssize_t __pyx_v_shape;
16581 size_t __pyx_v_size;
16583 Py_ssize_t *__pyx_t_1;
16584 Py_ssize_t *__pyx_t_2;
16585 Py_ssize_t *__pyx_t_3;
16594 __pyx_v_size = ((size_t)__pyx_v_src->memview->view.itemsize);
16603 __pyx_t_2 = (__pyx_v_src->shape + __pyx_v_ndim);
16605 for (__pyx_t_3 = __pyx_v_src->shape; __pyx_t_3 < __pyx_t_2; __pyx_t_3++) {
16606 __pyx_t_1 = __pyx_t_3;
16607 __pyx_v_shape = (__pyx_t_1[0]);
16616 __pyx_v_size = (__pyx_v_size * ((size_t)__pyx_v_shape));
16629 __pyx_r = __pyx_v_size;
16656static Py_ssize_t __pyx_fill_contig_strides_array(Py_ssize_t *__pyx_v_shape, Py_ssize_t *__pyx_v_strides, Py_ssize_t __pyx_v_stride,
int __pyx_v_ndim,
char __pyx_v_order) {
16658 Py_ssize_t __pyx_r;
16672 __pyx_t_1 = (__pyx_v_order ==
'F');
16685 __pyx_t_2 = __pyx_v_ndim;
16686 __pyx_t_3 = __pyx_t_2;
16688 for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
16689 __pyx_v_idx = __pyx_t_4;
16698 (__pyx_v_strides[__pyx_v_idx]) = __pyx_v_stride;
16707 __pyx_v_stride = (__pyx_v_stride * (__pyx_v_shape[__pyx_v_idx]));
16729 for (__pyx_t_2 = (__pyx_v_ndim - 1); __pyx_t_2 > -1; __pyx_t_2-=1) {
16730 __pyx_v_idx = __pyx_t_2;
16739 (__pyx_v_strides[__pyx_v_idx]) = __pyx_v_stride;
16748 __pyx_v_stride = (__pyx_v_stride * (__pyx_v_shape[__pyx_v_idx]));
16762 __pyx_r = __pyx_v_stride;
16789static void *__pyx_memoryview_copy_data_to_temp(__Pyx_memviewslice *__pyx_v_src, __Pyx_memviewslice *__pyx_v_tmpslice,
char __pyx_v_order,
int __pyx_v_ndim) {
16791 void *__pyx_v_result;
16792 size_t __pyx_v_itemsize;
16793 size_t __pyx_v_size;
16797 struct __pyx_memoryview_obj *__pyx_t_3;
16800 int __pyx_lineno = 0;
16801 const char *__pyx_filename = NULL;
16802 int __pyx_clineno = 0;
16803 PyGILState_STATE __pyx_gilstate_save;
16812 __pyx_v_itemsize = ((size_t)__pyx_v_src->memview->view.itemsize);
16821 __pyx_v_size = __pyx_memoryview_slice_get_size(__pyx_v_src, __pyx_v_ndim);
16830 __pyx_v_result = malloc(__pyx_v_size);
16839 __pyx_t_1 = (!(__pyx_v_result != 0));
16841 if (unlikely(__pyx_t_1)) {
16851 __pyx_t_2 = __pyx_memoryview_err_no_memory();
if (unlikely(__pyx_t_2 == ((
int)-1))) __PYX_ERR(1, 1220, __pyx_L1_error)
16870 __pyx_v_tmpslice->data = ((
char *)__pyx_v_result);
16879 __pyx_t_3 = __pyx_v_src->memview;
16881 __pyx_v_tmpslice->memview = __pyx_t_3;
16891 __pyx_t_2 = __pyx_v_ndim;
16892 __pyx_t_4 = __pyx_t_2;
16894 for (__pyx_t_5 = 0; __pyx_t_5 < __pyx_t_4; __pyx_t_5+=1) {
16895 __pyx_v_i = __pyx_t_5;
16904 (__pyx_v_tmpslice->shape[__pyx_v_i]) = (__pyx_v_src->shape[__pyx_v_i]);
16913 (__pyx_v_tmpslice->suboffsets[__pyx_v_i]) = -1L;
16924 (void)(__pyx_fill_contig_strides_array((&(__pyx_v_tmpslice->shape[0])), (&(__pyx_v_tmpslice->strides[0])), ((Py_ssize_t)__pyx_v_itemsize), __pyx_v_ndim, __pyx_v_order));
16934 __pyx_t_2 = __pyx_v_ndim;
16935 __pyx_t_4 = __pyx_t_2;
16937 for (__pyx_t_5 = 0; __pyx_t_5 < __pyx_t_4; __pyx_t_5+=1) {
16938 __pyx_v_i = __pyx_t_5;
16947 __pyx_t_1 = ((__pyx_v_tmpslice->shape[__pyx_v_i]) == 1);
16959 (__pyx_v_tmpslice->strides[__pyx_v_i]) = 0;
16979 __pyx_t_1 = __pyx_memviewslice_is_contig((__pyx_v_src[0]), __pyx_v_order, __pyx_v_ndim);
16991 (void)(memcpy(__pyx_v_result, __pyx_v_src->data, __pyx_v_size));
17011 copy_strided_to_strided(__pyx_v_src, __pyx_v_tmpslice, __pyx_v_ndim, __pyx_v_itemsize);
17024 __pyx_r = __pyx_v_result;
17038 __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
17039 __Pyx_AddTraceback(
"View.MemoryView.copy_data_to_temp", __pyx_clineno, __pyx_lineno, __pyx_filename);
17041 __Pyx_PyGILState_Release(__pyx_gilstate_save);
17058static int __pyx_memoryview_err_extents(
int __pyx_v_i, Py_ssize_t __pyx_v_extent1, Py_ssize_t __pyx_v_extent2) {
17060 PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
17072 (void)(PyErr_Format(PyExc_ValueError, __pyx_k_got_differing_extents_in_dimensi, __pyx_v_i, __pyx_v_extent1, __pyx_v_extent2));
17101 __Pyx_PyGILState_Release(__pyx_gilstate_save);
17113static int __pyx_memoryview_err_dim(PyObject *__pyx_v_error,
char const *__pyx_v_msg,
int __pyx_v_dim) {
17115 PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
17127 (void)(PyErr_Format(__pyx_v_error, __pyx_v_msg, __pyx_v_dim));
17156 __Pyx_PyGILState_Release(__pyx_gilstate_save);
17168static int __pyx_memoryview_err(PyObject *__pyx_v_error,
char const *__pyx_v_msg) {
17170 PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
17181 (void)(PyErr_SetString(__pyx_v_error, __pyx_v_msg));
17209 __Pyx_PyGILState_Release(__pyx_gilstate_save);
17221static int __pyx_memoryview_err_no_memory(
void) {
17223 int __pyx_lineno = 0;
17224 const char *__pyx_filename = NULL;
17225 int __pyx_clineno = 0;
17226 PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
17235 PyErr_NoMemory(); __PYX_ERR(1, 1267, __pyx_L1_error)
17247 __Pyx_AddTraceback(
"View.MemoryView._err_no_memory", __pyx_clineno, __pyx_lineno, __pyx_filename);
17250 __Pyx_PyGILState_Release(__pyx_gilstate_save);
17262static int __pyx_memoryview_err_ValueError(
char const *__pyx_v_msg) {
17272 (void)(PyErr_SetString(PyExc_ValueError, __pyx_v_msg));
17309static int __pyx_memoryview_err_IndexError(
char const *__pyx_v_msg, Py_ssize_t __pyx_v_index) {
17319 (void)(PyErr_Format(PyExc_IndexError, __pyx_v_msg, __pyx_v_index));
17356static int __pyx_memoryview_copy_contents(__Pyx_memviewslice __pyx_v_src, __Pyx_memviewslice __pyx_v_dst,
int __pyx_v_src_ndim,
int __pyx_v_dst_ndim,
int __pyx_v_dtype_is_object) {
17357 void *__pyx_v_tmpdata;
17358 size_t __pyx_v_itemsize;
17360 char __pyx_v_order;
17361 int __pyx_v_broadcasting;
17362 int __pyx_v_direct_copy;
17363 __Pyx_memviewslice __pyx_v_tmp;
17372 int __pyx_lineno = 0;
17373 const char *__pyx_filename = NULL;
17374 int __pyx_clineno = 0;
17375 PyGILState_STATE __pyx_gilstate_save;
17385 __pyx_v_tmpdata = NULL;
17394 __pyx_v_itemsize = ((size_t)__pyx_v_src.memview->view.itemsize);
17403 __pyx_v_order = __pyx_get_best_slice_order((&__pyx_v_src), __pyx_v_src_ndim);
17412 __pyx_v_broadcasting = 0;
17421 __pyx_v_direct_copy = 0;
17430 __pyx_t_1 = (__pyx_v_src_ndim < __pyx_v_dst_ndim);
17442 __pyx_memoryview_broadcast_leading((&__pyx_v_src), __pyx_v_src_ndim, __pyx_v_dst_ndim);
17461 __pyx_t_1 = (__pyx_v_dst_ndim < __pyx_v_src_ndim);
17473 __pyx_memoryview_broadcast_leading((&__pyx_v_dst), __pyx_v_dst_ndim, __pyx_v_src_ndim);
17493 __pyx_t_2 = __pyx_v_dst_ndim;
17495 __pyx_t_3 = __pyx_v_src_ndim;
17496 __pyx_t_1 = (__pyx_t_2 > __pyx_t_3);
17500 __pyx_t_4 = __pyx_t_2;
17503 __pyx_t_4 = __pyx_t_3;
17506 __pyx_v_ndim = __pyx_t_4;
17517 __pyx_t_4 = __pyx_v_ndim;
17518 __pyx_t_2 = __pyx_t_4;
17520 for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) {
17521 __pyx_v_i = __pyx_t_3;
17530 __pyx_t_1 = ((__pyx_v_src.shape[__pyx_v_i]) != (__pyx_v_dst.shape[__pyx_v_i]));
17542 __pyx_t_1 = ((__pyx_v_src.shape[__pyx_v_i]) == 1);
17544 if (likely(__pyx_t_1)) {
17554 __pyx_v_broadcasting = 1;
17563 (__pyx_v_src.strides[__pyx_v_i]) = 0;
17583 __pyx_t_5 = __pyx_memoryview_err_extents(__pyx_v_i, (__pyx_v_dst.shape[__pyx_v_i]), (__pyx_v_src.shape[__pyx_v_i]));
if (unlikely(__pyx_t_5 == ((
int)-1))) __PYX_ERR(1, 1312, __pyx_L1_error)
17604 __pyx_t_1 = ((__pyx_v_src.suboffsets[__pyx_v_i]) >= 0);
17606 if (unlikely(__pyx_t_1)) {
17616 __pyx_t_5 = __pyx_memoryview_err_dim(PyExc_ValueError, __pyx_k_Dimension_d_is_not_direct, __pyx_v_i);
if (unlikely(__pyx_t_5 == ((
int)-1))) __PYX_ERR(1, 1315, __pyx_L1_error)
17637 __pyx_t_1 = __pyx_slices_overlap((&__pyx_v_src), (&__pyx_v_dst), __pyx_v_ndim, __pyx_v_itemsize);
17649 __pyx_t_1 = (!__pyx_memviewslice_is_contig(__pyx_v_src, __pyx_v_order, __pyx_v_ndim));
17661 __pyx_v_order = __pyx_get_best_slice_order((&__pyx_v_dst), __pyx_v_ndim);
17679 __pyx_t_6 = __pyx_memoryview_copy_data_to_temp((&__pyx_v_src), (&__pyx_v_tmp), __pyx_v_order, __pyx_v_ndim);
if (unlikely(__pyx_t_6 == ((
void *)NULL))) __PYX_ERR(1, 1322, __pyx_L1_error)
17680 __pyx_v_tmpdata = __pyx_t_6;
17689 __pyx_v_src = __pyx_v_tmp;
17707 __pyx_t_1 = (!__pyx_v_broadcasting);
17719 __pyx_t_1 = __pyx_memviewslice_is_contig(__pyx_v_src,
'C', __pyx_v_ndim);
17731 __pyx_v_direct_copy = __pyx_memviewslice_is_contig(__pyx_v_dst,
'C', __pyx_v_ndim);
17750 __pyx_t_1 = __pyx_memviewslice_is_contig(__pyx_v_src,
'F', __pyx_v_ndim);
17762 __pyx_v_direct_copy = __pyx_memviewslice_is_contig(__pyx_v_dst,
'F', __pyx_v_ndim);
17781 if (__pyx_v_direct_copy) {
17790 __pyx_memoryview_refcount_copying((&__pyx_v_dst), __pyx_v_dtype_is_object, __pyx_v_ndim, 0);
17799 (void)(memcpy(__pyx_v_dst.data, __pyx_v_src.data, __pyx_memoryview_slice_get_size((&__pyx_v_src), __pyx_v_ndim)));
17808 __pyx_memoryview_refcount_copying((&__pyx_v_dst), __pyx_v_dtype_is_object, __pyx_v_ndim, 1);
17817 free(__pyx_v_tmpdata);
17857 __pyx_t_1 = (__pyx_v_order ==
'F');
17859 __pyx_t_1 = (
'F' == __pyx_get_best_slice_order((&__pyx_v_dst), __pyx_v_ndim));
17871 __pyx_t_4 = __pyx_memslice_transpose((&__pyx_v_src));
if (unlikely(__pyx_t_4 == ((
int)-1))) __PYX_ERR(1, 1344, __pyx_L1_error)
17881 __pyx_t_4 = __pyx_memslice_transpose((&__pyx_v_dst));
if (unlikely(__pyx_t_4 == ((
int)-1))) __PYX_ERR(1, 1345, __pyx_L1_error)
17900 __pyx_memoryview_refcount_copying((&__pyx_v_dst), __pyx_v_dtype_is_object, __pyx_v_ndim, 0);
17909 copy_strided_to_strided((&__pyx_v_src), (&__pyx_v_dst), __pyx_v_ndim, __pyx_v_itemsize);
17918 __pyx_memoryview_refcount_copying((&__pyx_v_dst), __pyx_v_dtype_is_object, __pyx_v_ndim, 1);
17927 free(__pyx_v_tmpdata);
17952 __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
17953 __Pyx_AddTraceback(
"View.MemoryView.memoryview_copy_contents", __pyx_clineno, __pyx_lineno, __pyx_filename);
17955 __Pyx_PyGILState_Release(__pyx_gilstate_save);
17977static void __pyx_memoryview_broadcast_leading(__Pyx_memviewslice *__pyx_v_mslice,
int __pyx_v_ndim,
int __pyx_v_ndim_other) {
17979 int __pyx_v_offset;
17991 __pyx_v_offset = (__pyx_v_ndim_other - __pyx_v_ndim);
18000 for (__pyx_t_1 = (__pyx_v_ndim - 1); __pyx_t_1 > -1; __pyx_t_1-=1) {
18001 __pyx_v_i = __pyx_t_1;
18010 (__pyx_v_mslice->shape[(__pyx_v_i + __pyx_v_offset)]) = (__pyx_v_mslice->shape[__pyx_v_i]);
18019 (__pyx_v_mslice->strides[(__pyx_v_i + __pyx_v_offset)]) = (__pyx_v_mslice->strides[__pyx_v_i]);
18028 (__pyx_v_mslice->suboffsets[(__pyx_v_i + __pyx_v_offset)]) = (__pyx_v_mslice->suboffsets[__pyx_v_i]);
18039 __pyx_t_1 = __pyx_v_offset;
18040 __pyx_t_2 = __pyx_t_1;
18042 for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) {
18043 __pyx_v_i = __pyx_t_3;
18052 (__pyx_v_mslice->shape[__pyx_v_i]) = 1;
18061 (__pyx_v_mslice->strides[__pyx_v_i]) = (__pyx_v_mslice->strides[0]);
18070 (__pyx_v_mslice->suboffsets[__pyx_v_i]) = -1L;
18095static void __pyx_memoryview_refcount_copying(__Pyx_memviewslice *__pyx_v_dst,
int __pyx_v_dtype_is_object,
int __pyx_v_ndim,
int __pyx_v_inc) {
18104 if (__pyx_v_dtype_is_object) {
18113 __pyx_memoryview_refcount_objects_in_slice_with_gil(__pyx_v_dst->data, __pyx_v_dst->shape, __pyx_v_dst->strides, __pyx_v_ndim, __pyx_v_inc);
18143static void __pyx_memoryview_refcount_objects_in_slice_with_gil(
char *__pyx_v_data, Py_ssize_t *__pyx_v_shape, Py_ssize_t *__pyx_v_strides,
int __pyx_v_ndim,
int __pyx_v_inc) {
18144 PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
18158 __pyx_memoryview_refcount_objects_in_slice(__pyx_v_data, __pyx_v_shape, __pyx_v_strides, __pyx_v_ndim, __pyx_v_inc);
18175 __Pyx_PyGILState_Release(__pyx_gilstate_save);
18186static void __pyx_memoryview_refcount_objects_in_slice(
char *__pyx_v_data, Py_ssize_t *__pyx_v_shape, Py_ssize_t *__pyx_v_strides,
int __pyx_v_ndim,
int __pyx_v_inc) {
18187 CYTHON_UNUSED Py_ssize_t __pyx_v_i;
18188 Py_ssize_t __pyx_v_stride;
18189 Py_ssize_t __pyx_t_1;
18190 Py_ssize_t __pyx_t_2;
18191 Py_ssize_t __pyx_t_3;
18202 __pyx_v_stride = (__pyx_v_strides[0]);
18212 __pyx_t_1 = (__pyx_v_shape[0]);
18213 __pyx_t_2 = __pyx_t_1;
18215 for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) {
18216 __pyx_v_i = __pyx_t_3;
18225 __pyx_t_4 = (__pyx_v_ndim == 1);
18246 Py_INCREF((((PyObject **)__pyx_v_data)[0]));
18266 Py_DECREF((((PyObject **)__pyx_v_data)[0]));
18288 __pyx_memoryview_refcount_objects_in_slice(__pyx_v_data, (__pyx_v_shape + 1), (__pyx_v_strides + 1), (__pyx_v_ndim - 1), __pyx_v_inc);
18299 __pyx_v_data = (__pyx_v_data + __pyx_v_stride);
18326static void __pyx_memoryview_slice_assign_scalar(__Pyx_memviewslice *__pyx_v_dst,
int __pyx_v_ndim,
size_t __pyx_v_itemsize,
void *__pyx_v_item,
int __pyx_v_dtype_is_object) {
18335 __pyx_memoryview_refcount_copying(__pyx_v_dst, __pyx_v_dtype_is_object, __pyx_v_ndim, 0);
18344 __pyx_memoryview__slice_assign_scalar(__pyx_v_dst->data, __pyx_v_dst->shape, __pyx_v_dst->strides, __pyx_v_ndim, __pyx_v_itemsize, __pyx_v_item);
18353 __pyx_memoryview_refcount_copying(__pyx_v_dst, __pyx_v_dtype_is_object, __pyx_v_ndim, 1);
18374static void __pyx_memoryview__slice_assign_scalar(
char *__pyx_v_data, Py_ssize_t *__pyx_v_shape, Py_ssize_t *__pyx_v_strides,
int __pyx_v_ndim,
size_t __pyx_v_itemsize,
void *__pyx_v_item) {
18375 CYTHON_UNUSED Py_ssize_t __pyx_v_i;
18376 Py_ssize_t __pyx_v_stride;
18377 Py_ssize_t __pyx_v_extent;
18379 Py_ssize_t __pyx_t_2;
18380 Py_ssize_t __pyx_t_3;
18381 Py_ssize_t __pyx_t_4;
18391 __pyx_v_stride = (__pyx_v_strides[0]);
18400 __pyx_v_extent = (__pyx_v_shape[0]);
18409 __pyx_t_1 = (__pyx_v_ndim == 1);
18422 __pyx_t_2 = __pyx_v_extent;
18423 __pyx_t_3 = __pyx_t_2;
18425 for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
18426 __pyx_v_i = __pyx_t_4;
18435 (void)(memcpy(__pyx_v_data, __pyx_v_item, __pyx_v_itemsize));
18444 __pyx_v_data = (__pyx_v_data + __pyx_v_stride);
18467 __pyx_t_2 = __pyx_v_extent;
18468 __pyx_t_3 = __pyx_t_2;
18470 for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
18471 __pyx_v_i = __pyx_t_4;
18480 __pyx_memoryview__slice_assign_scalar(__pyx_v_data, (__pyx_v_shape + 1), (__pyx_v_strides + 1), (__pyx_v_ndim - 1), __pyx_v_itemsize, __pyx_v_item);
18488 __pyx_v_data = (__pyx_v_data + __pyx_v_stride);
18518static PyObject *__pyx_pw_15View_dot_MemoryView_1__pyx_unpickle_Enum(PyObject *__pyx_self,
18519#
if CYTHON_VECTORCALL
18520PyObject *
const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
18522PyObject *__pyx_args, PyObject *__pyx_kwds
18525static PyMethodDef __pyx_mdef_15View_dot_MemoryView_1__pyx_unpickle_Enum = {
"__pyx_unpickle_Enum", (PyCFunction)(
void(*)(
void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_15View_dot_MemoryView_1__pyx_unpickle_Enum, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
18526static PyObject *__pyx_pw_15View_dot_MemoryView_1__pyx_unpickle_Enum(PyObject *__pyx_self,
18527#
if CYTHON_VECTORCALL
18528PyObject *
const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
18530PyObject *__pyx_args, PyObject *__pyx_kwds
18533 PyObject *__pyx_v___pyx_type = 0;
18534 long __pyx_v___pyx_checksum;
18535 PyObject *__pyx_v___pyx_state = 0;
18536 #if !CYTHON_VECTORCALL
18537 CYTHON_UNUSED Py_ssize_t __pyx_nargs;
18539 CYTHON_UNUSED PyObject *
const *__pyx_kwvalues;
18540 PyObject* values[3] = {0,0,0};
18541 int __pyx_lineno = 0;
18542 const char *__pyx_filename = NULL;
18543 int __pyx_clineno = 0;
18544 PyObject *__pyx_r = 0;
18545 __Pyx_RefNannyDeclarations
18546 __Pyx_RefNannySetupContext(
"__pyx_unpickle_Enum (wrapper)", 0);
18547 #if !CYTHON_VECTORCALL
18548 #if CYTHON_ASSUME_SAFE_SIZE
18549 __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
18551 __pyx_nargs = PyTuple_Size(__pyx_args);
if (unlikely(__pyx_nargs < 0))
return NULL;
18554 __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
18556 PyObject **
const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_pyx_type,&__pyx_mstate_global->__pyx_n_u_pyx_checksum,&__pyx_mstate_global->__pyx_n_u_pyx_state,0};
18557 const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
18558 if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(1, 4, __pyx_L3_error)
18559 if (__pyx_kwds_len > 0) {
18560 switch (__pyx_nargs) {
18562 values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
18563 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(1, 4, __pyx_L3_error)
18564 CYTHON_FALLTHROUGH;
18566 values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
18567 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(1, 4, __pyx_L3_error)
18568 CYTHON_FALLTHROUGH;
18570 values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
18571 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(1, 4, __pyx_L3_error)
18572 CYTHON_FALLTHROUGH;
18574 default:
goto __pyx_L5_argtuple_error;
18576 const Py_ssize_t kwd_pos_args = __pyx_nargs;
18577 if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len,
"__pyx_unpickle_Enum", 0) < (0)) __PYX_ERR(1, 4, __pyx_L3_error)
18578 for (Py_ssize_t i = __pyx_nargs; i < 3; i++) {
18579 if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid(
"__pyx_unpickle_Enum", 1, 3, 3, i); __PYX_ERR(1, 4, __pyx_L3_error) }
18581 }
else if (unlikely(__pyx_nargs != 3)) {
18582 goto __pyx_L5_argtuple_error;
18584 values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
18585 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(1, 4, __pyx_L3_error)
18586 values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
18587 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(1, 4, __pyx_L3_error)
18588 values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
18589 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(1, 4, __pyx_L3_error)
18591 __pyx_v___pyx_type = values[0];
18592 __pyx_v___pyx_checksum = __Pyx_PyLong_As_long(values[1]);
if (unlikely((__pyx_v___pyx_checksum == (
long)-1) && PyErr_Occurred())) __PYX_ERR(1, 4, __pyx_L3_error)
18593 __pyx_v___pyx_state = ((PyObject*)values[2]);
18595 goto __pyx_L6_skip;
18596 __pyx_L5_argtuple_error:;
18597 __Pyx_RaiseArgtupleInvalid(
"__pyx_unpickle_Enum", 1, 3, 3, __pyx_nargs); __PYX_ERR(1, 4, __pyx_L3_error)
18599 goto __pyx_L4_argument_unpacking_done;
18601 for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(
sizeof(values)/
sizeof(values[0])); ++__pyx_temp) {
18602 Py_XDECREF(values[__pyx_temp]);
18604 __Pyx_AddTraceback(
"View.MemoryView.__pyx_unpickle_Enum", __pyx_clineno, __pyx_lineno, __pyx_filename);
18605 __Pyx_RefNannyFinishContext();
18607 __pyx_L4_argument_unpacking_done:;
18608 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v___pyx_state), (&PyTuple_Type), 1,
"__pyx_state", 1))) __PYX_ERR(1, 4, __pyx_L1_error)
18609 __pyx_r = __pyx_pf_15View_dot_MemoryView___pyx_unpickle_Enum(__pyx_self, __pyx_v___pyx_type, __pyx_v___pyx_checksum, __pyx_v___pyx_state);
18615 for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(
sizeof(values)/
sizeof(values[0])); ++__pyx_temp) {
18616 Py_XDECREF(values[__pyx_temp]);
18618 goto __pyx_L7_cleaned_up;
18620 for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(
sizeof(values)/
sizeof(values[0])); ++__pyx_temp) {
18621 Py_XDECREF(values[__pyx_temp]);
18623 __pyx_L7_cleaned_up:;
18625 __Pyx_RefNannyFinishContext();
18629static PyObject *__pyx_pf_15View_dot_MemoryView___pyx_unpickle_Enum(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v___pyx_type,
long __pyx_v___pyx_checksum, PyObject *__pyx_v___pyx_state) {
18630 PyObject *__pyx_v___pyx_result = 0;
18631 PyObject *__pyx_r = NULL;
18632 __Pyx_RefNannyDeclarations
18634 PyObject *__pyx_t_2 = NULL;
18635 PyObject *__pyx_t_3 = NULL;
18638 int __pyx_lineno = 0;
18639 const char *__pyx_filename = NULL;
18640 int __pyx_clineno = 0;
18641 __Pyx_RefNannySetupContext(
"__pyx_unpickle_Enum", 0);
18650 __pyx_t_1 = __Pyx_CheckUnpickleChecksum(__pyx_v___pyx_checksum, 0x82a3537, 0x6ae9995, 0xb068931, __pyx_k_name);
if (unlikely(__pyx_t_1 == ((
int)-1))) __PYX_ERR(1, 6, __pyx_L1_error)
18660 __pyx_t_3 = ((PyObject *)__pyx_mstate_global->__pyx_MemviewEnum_type);
18661 __Pyx_INCREF(__pyx_t_3);
18664 PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_v___pyx_type};
18665 __pyx_t_2 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_new, __pyx_callargs+__pyx_t_4, (2-__pyx_t_4) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
18666 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
18667 if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 7, __pyx_L1_error)
18668 __Pyx_GOTREF(__pyx_t_2);
18670 __pyx_v___pyx_result = __pyx_t_2;
18680 __pyx_t_5 = (__pyx_v___pyx_state != ((PyObject*)Py_None));
18691 if (unlikely(__pyx_v___pyx_state == Py_None)) {
18692 PyErr_SetString(PyExc_TypeError,
"cannot pass None into a C function argument that is declared \047not None\047");
18693 __PYX_ERR(1, 9, __pyx_L1_error)
18695 __pyx_t_2 = __pyx_unpickle_Enum__set_state(((
struct __pyx_MemviewEnum_obj *)__pyx_v___pyx_result), __pyx_v___pyx_state);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 9, __pyx_L1_error)
18696 __Pyx_GOTREF(__pyx_t_2);
18697 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
18716 PyObject *__pyx_temp;
18718 __pyx_temp = __pyx_r;
18719 __Pyx_INCREF(__pyx_v___pyx_result);
18720 __pyx_r = __pyx_v___pyx_result;
18722 __Pyx_XDECREF(__pyx_temp);
18736 __Pyx_XDECREF(__pyx_t_2);
18737 __Pyx_XDECREF(__pyx_t_3);
18738 __Pyx_AddTraceback(
"View.MemoryView.__pyx_unpickle_Enum", __pyx_clineno, __pyx_lineno, __pyx_filename);
18741 __Pyx_XDECREF(__pyx_v___pyx_result);
18742 __Pyx_XGIVEREF(__pyx_r);
18743 __Pyx_RefNannyFinishContext();
18755static PyObject *__pyx_unpickle_Enum__set_state(
struct __pyx_MemviewEnum_obj *__pyx_v___pyx_result, PyObject *__pyx_v___pyx_state) {
18756 PyObject *__pyx_r = NULL;
18757 __Pyx_RefNannyDeclarations
18758 PyObject *__pyx_t_1 = NULL;
18760 int __pyx_lineno = 0;
18761 const char *__pyx_filename = NULL;
18762 int __pyx_clineno = 0;
18763 __Pyx_RefNannySetupContext(
"__pyx_unpickle_Enum__set_state", 0);
18771 __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 0,
long, 1, __Pyx_PyLong_From_long, 0, 1, 1, __Pyx_ReferenceSharing_FunctionArgument);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 12, __pyx_L1_error)
18772 __Pyx_GOTREF(__pyx_t_1);
18773 __Pyx_GIVEREF(__pyx_t_1);
18774 __Pyx_GOTREF(__pyx_v___pyx_result->name);
18775 __Pyx_DECREF(__pyx_v___pyx_result->name);
18776 __pyx_v___pyx_result->name = __pyx_t_1;
18784 __pyx_t_2 = __Pyx_UpdateUnpickledDict(((PyObject *)__pyx_v___pyx_result), __pyx_v___pyx_state, 1);
if (unlikely(__pyx_t_2 == ((
int)-1))) __PYX_ERR(1, 13, __pyx_L1_error)
18796 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
18799 __Pyx_XDECREF(__pyx_t_1);
18800 __Pyx_AddTraceback(
"View.MemoryView.__pyx_unpickle_Enum__set_state", __pyx_clineno, __pyx_lineno, __pyx_filename);
18803 __Pyx_XGIVEREF(__pyx_r);
18804 __Pyx_RefNannyFinishContext();
18816static CYTHON_INLINE PyTypeObject *__pyx_f_5numpy_5dtype_7typeobj___get__(PyArray_Descr *__pyx_v_self) {
18817 PyTypeObject *__pyx_r;
18828 __pyx_r = PyDataType_TYPEOBJ(__pyx_v_self);
18853static CYTHON_INLINE
char __pyx_f_5numpy_5dtype_4kind___get__(PyArray_Descr *__pyx_v_self) {
18865 __pyx_r = PyDataType_KIND(__pyx_v_self);
18890static CYTHON_INLINE
char __pyx_f_5numpy_5dtype_4type___get__(PyArray_Descr *__pyx_v_self) {
18902 __pyx_r = PyDataType_TYPE(__pyx_v_self);
18927static CYTHON_INLINE
char __pyx_f_5numpy_5dtype_9byteorder___get__(PyArray_Descr *__pyx_v_self) {
18939 __pyx_r = PyDataType_BYTEORDER(__pyx_v_self);
18964static CYTHON_INLINE
int __pyx_f_5numpy_5dtype_8type_num___get__(PyArray_Descr *__pyx_v_self) {
18976 __pyx_r = PyDataType_TYPENUM(__pyx_v_self);
19001static CYTHON_INLINE npy_intp __pyx_f_5numpy_5dtype_8itemsize___get__(PyArray_Descr *__pyx_v_self) {
19013 __pyx_r = PyDataType_ELSIZE(__pyx_v_self);
19038static CYTHON_INLINE npy_intp __pyx_f_5numpy_5dtype_9alignment___get__(PyArray_Descr *__pyx_v_self) {
19050 __pyx_r = PyDataType_ALIGNMENT(__pyx_v_self);
19075static CYTHON_INLINE PyObject *__pyx_f_5numpy_5dtype_6fields___get__(PyArray_Descr *__pyx_v_self) {
19076 PyObject *__pyx_r = NULL;
19077 __Pyx_RefNannyDeclarations
19078 PyObject *__pyx_t_1;
19079 __Pyx_RefNannySetupContext(
"__get__", 0);
19088 __pyx_t_1 = PyDataType_FIELDS(__pyx_v_self);
19091 PyObject *__pyx_temp;
19093 __pyx_temp = __pyx_r;
19094 __Pyx_INCREF(((PyObject *)__pyx_t_1));
19095 __pyx_r = ((PyObject *)__pyx_t_1);
19097 __Pyx_XDECREF(__pyx_temp);
19112 __Pyx_XGIVEREF(__pyx_r);
19113 __Pyx_RefNannyFinishContext();
19125static CYTHON_INLINE PyObject *__pyx_f_5numpy_5dtype_5names___get__(PyArray_Descr *__pyx_v_self) {
19126 PyObject *__pyx_r = NULL;
19127 __Pyx_RefNannyDeclarations
19128 PyObject *__pyx_t_1;
19129 __Pyx_RefNannySetupContext(
"__get__", 0);
19138 __pyx_t_1 = PyDataType_NAMES(__pyx_v_self);
19141 PyObject *__pyx_temp;
19143 __pyx_temp = __pyx_r;
19144 __Pyx_INCREF(((PyObject*)__pyx_t_1));
19145 __pyx_r = ((PyObject*)__pyx_t_1);
19147 __Pyx_XDECREF(__pyx_temp);
19162 __Pyx_XGIVEREF(__pyx_r);
19163 __Pyx_RefNannyFinishContext();
19175static CYTHON_INLINE PyArray_ArrayDescr *__pyx_f_5numpy_5dtype_8subarray___get__(PyArray_Descr *__pyx_v_self) {
19176 PyArray_ArrayDescr *__pyx_r;
19187 __pyx_r = PyDataType_SUBARRAY(__pyx_v_self);
19212static CYTHON_INLINE npy_uint64 __pyx_f_5numpy_5dtype_5flags___get__(PyArray_Descr *__pyx_v_self) {
19213 npy_uint64 __pyx_r;
19224 __pyx_r = PyDataType_FLAGS(__pyx_v_self);
19249static CYTHON_INLINE
int __pyx_f_5numpy_9broadcast_7numiter___get__(PyArrayMultiIterObject *__pyx_v_self) {
19261 __pyx_r = PyArray_MultiIter_NUMITER(__pyx_v_self);
19286static CYTHON_INLINE npy_intp __pyx_f_5numpy_9broadcast_4size___get__(PyArrayMultiIterObject *__pyx_v_self) {
19298 __pyx_r = PyArray_MultiIter_SIZE(__pyx_v_self);
19323static CYTHON_INLINE npy_intp __pyx_f_5numpy_9broadcast_5index___get__(PyArrayMultiIterObject *__pyx_v_self) {
19335 __pyx_r = PyArray_MultiIter_INDEX(__pyx_v_self);
19360static CYTHON_INLINE
int __pyx_f_5numpy_9broadcast_2nd___get__(PyArrayMultiIterObject *__pyx_v_self) {
19372 __pyx_r = PyArray_MultiIter_NDIM(__pyx_v_self);
19397static CYTHON_INLINE npy_intp *__pyx_f_5numpy_9broadcast_10dimensions___get__(PyArrayMultiIterObject *__pyx_v_self) {
19409 __pyx_r = PyArray_MultiIter_DIMS(__pyx_v_self);
19434static CYTHON_INLINE
void **__pyx_f_5numpy_9broadcast_5iters___get__(PyArrayMultiIterObject *__pyx_v_self) {
19446 __pyx_r = PyArray_MultiIter_ITERS(__pyx_v_self);
19471static CYTHON_INLINE PyObject *__pyx_f_5numpy_7ndarray_4base___get__(PyArrayObject *__pyx_v_self) {
19483 __pyx_r = PyArray_BASE(__pyx_v_self);
19508static CYTHON_INLINE PyArray_Descr *__pyx_f_5numpy_7ndarray_5descr___get__(PyArrayObject *__pyx_v_self) {
19509 PyArray_Descr *__pyx_r = NULL;
19510 __Pyx_RefNannyDeclarations
19511 PyArray_Descr *__pyx_t_1;
19512 __Pyx_RefNannySetupContext(
"__get__", 0);
19521 __pyx_t_1 = PyArray_DESCR(__pyx_v_self);
19524 PyArray_Descr *__pyx_temp;
19526 __pyx_temp = __pyx_r;
19527 __Pyx_INCREF((PyObject *)((PyArray_Descr *)__pyx_t_1));
19528 __pyx_r = ((PyArray_Descr *)__pyx_t_1);
19530 __Pyx_XDECREF((PyObject *)__pyx_temp);
19545 __Pyx_XGIVEREF((PyObject *)__pyx_r);
19546 __Pyx_RefNannyFinishContext();
19558static CYTHON_INLINE
int __pyx_f_5numpy_7ndarray_4ndim___get__(PyArrayObject *__pyx_v_self) {
19570 __pyx_r = PyArray_NDIM(__pyx_v_self);
19595static CYTHON_INLINE npy_intp *__pyx_f_5numpy_7ndarray_5shape___get__(PyArrayObject *__pyx_v_self) {
19607 __pyx_r = PyArray_DIMS(__pyx_v_self);
19632static CYTHON_INLINE npy_intp *__pyx_f_5numpy_7ndarray_7strides___get__(PyArrayObject *__pyx_v_self) {
19644 __pyx_r = PyArray_STRIDES(__pyx_v_self);
19669static CYTHON_INLINE npy_intp __pyx_f_5numpy_7ndarray_4size___get__(PyArrayObject *__pyx_v_self) {
19681 __pyx_r = PyArray_SIZE(__pyx_v_self);
19706static CYTHON_INLINE
char *__pyx_f_5numpy_7ndarray_4data___get__(PyArrayObject *__pyx_v_self) {
19718 __pyx_r = PyArray_BYTES(__pyx_v_self);
19743static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew1(PyObject *__pyx_v_a) {
19744 PyObject *__pyx_r = NULL;
19745 __Pyx_RefNannyDeclarations
19746 PyObject *__pyx_t_1 = NULL;
19747 int __pyx_lineno = 0;
19748 const char *__pyx_filename = NULL;
19749 int __pyx_clineno = 0;
19750 __Pyx_RefNannySetupContext(
"PyArray_MultiIterNew1", 0);
19759 __pyx_t_1 = PyArray_MultiIterNew(1, ((
void *)__pyx_v_a));
if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 795, __pyx_L1_error)
19760 __Pyx_GOTREF(__pyx_t_1);
19762 PyObject *__pyx_temp;
19764 __pyx_temp = __pyx_r;
19765 __pyx_r = __pyx_t_1;
19767 __Pyx_XDECREF(__pyx_temp);
19782 __Pyx_XDECREF(__pyx_t_1);
19783 __Pyx_AddTraceback(
"numpy.PyArray_MultiIterNew1", __pyx_clineno, __pyx_lineno, __pyx_filename);
19786 __Pyx_XGIVEREF(__pyx_r);
19787 __Pyx_RefNannyFinishContext();
19799static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew2(PyObject *__pyx_v_a, PyObject *__pyx_v_b) {
19800 PyObject *__pyx_r = NULL;
19801 __Pyx_RefNannyDeclarations
19802 PyObject *__pyx_t_1 = NULL;
19803 int __pyx_lineno = 0;
19804 const char *__pyx_filename = NULL;
19805 int __pyx_clineno = 0;
19806 __Pyx_RefNannySetupContext(
"PyArray_MultiIterNew2", 0);
19815 __pyx_t_1 = PyArray_MultiIterNew(2, ((
void *)__pyx_v_a), ((
void *)__pyx_v_b));
if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 798, __pyx_L1_error)
19816 __Pyx_GOTREF(__pyx_t_1);
19818 PyObject *__pyx_temp;
19820 __pyx_temp = __pyx_r;
19821 __pyx_r = __pyx_t_1;
19823 __Pyx_XDECREF(__pyx_temp);
19838 __Pyx_XDECREF(__pyx_t_1);
19839 __Pyx_AddTraceback(
"numpy.PyArray_MultiIterNew2", __pyx_clineno, __pyx_lineno, __pyx_filename);
19842 __Pyx_XGIVEREF(__pyx_r);
19843 __Pyx_RefNannyFinishContext();
19855static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew3(PyObject *__pyx_v_a, PyObject *__pyx_v_b, PyObject *__pyx_v_c) {
19856 PyObject *__pyx_r = NULL;
19857 __Pyx_RefNannyDeclarations
19858 PyObject *__pyx_t_1 = NULL;
19859 int __pyx_lineno = 0;
19860 const char *__pyx_filename = NULL;
19861 int __pyx_clineno = 0;
19862 __Pyx_RefNannySetupContext(
"PyArray_MultiIterNew3", 0);
19871 __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(2, 801, __pyx_L1_error)
19872 __Pyx_GOTREF(__pyx_t_1);
19874 PyObject *__pyx_temp;
19876 __pyx_temp = __pyx_r;
19877 __pyx_r = __pyx_t_1;
19879 __Pyx_XDECREF(__pyx_temp);
19894 __Pyx_XDECREF(__pyx_t_1);
19895 __Pyx_AddTraceback(
"numpy.PyArray_MultiIterNew3", __pyx_clineno, __pyx_lineno, __pyx_filename);
19898 __Pyx_XGIVEREF(__pyx_r);
19899 __Pyx_RefNannyFinishContext();
19911static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew4(PyObject *__pyx_v_a, PyObject *__pyx_v_b, PyObject *__pyx_v_c, PyObject *__pyx_v_d) {
19912 PyObject *__pyx_r = NULL;
19913 __Pyx_RefNannyDeclarations
19914 PyObject *__pyx_t_1 = NULL;
19915 int __pyx_lineno = 0;
19916 const char *__pyx_filename = NULL;
19917 int __pyx_clineno = 0;
19918 __Pyx_RefNannySetupContext(
"PyArray_MultiIterNew4", 0);
19927 __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(2, 804, __pyx_L1_error)
19928 __Pyx_GOTREF(__pyx_t_1);
19930 PyObject *__pyx_temp;
19932 __pyx_temp = __pyx_r;
19933 __pyx_r = __pyx_t_1;
19935 __Pyx_XDECREF(__pyx_temp);
19950 __Pyx_XDECREF(__pyx_t_1);
19951 __Pyx_AddTraceback(
"numpy.PyArray_MultiIterNew4", __pyx_clineno, __pyx_lineno, __pyx_filename);
19954 __Pyx_XGIVEREF(__pyx_r);
19955 __Pyx_RefNannyFinishContext();
19967static 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) {
19968 PyObject *__pyx_r = NULL;
19969 __Pyx_RefNannyDeclarations
19970 PyObject *__pyx_t_1 = NULL;
19971 int __pyx_lineno = 0;
19972 const char *__pyx_filename = NULL;
19973 int __pyx_clineno = 0;
19974 __Pyx_RefNannySetupContext(
"PyArray_MultiIterNew5", 0);
19983 __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(2, 807, __pyx_L1_error)
19984 __Pyx_GOTREF(__pyx_t_1);
19986 PyObject *__pyx_temp;
19988 __pyx_temp = __pyx_r;
19989 __pyx_r = __pyx_t_1;
19991 __Pyx_XDECREF(__pyx_temp);
20006 __Pyx_XDECREF(__pyx_t_1);
20007 __Pyx_AddTraceback(
"numpy.PyArray_MultiIterNew5", __pyx_clineno, __pyx_lineno, __pyx_filename);
20010 __Pyx_XGIVEREF(__pyx_r);
20011 __Pyx_RefNannyFinishContext();
20023static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyDataType_SHAPE(PyArray_Descr *__pyx_v_d) {
20024 PyObject *__pyx_r = NULL;
20025 __Pyx_RefNannyDeclarations
20027 PyObject *__pyx_t_2;
20028 __Pyx_RefNannySetupContext(
"PyDataType_SHAPE", 0);
20037 __pyx_t_1 = PyDataType_HASSUBARRAY(__pyx_v_d);
20049 __pyx_t_2 = __pyx_f_5numpy_5dtype_8subarray___get__(__pyx_v_d)->shape;
20052 PyObject *__pyx_temp;
20054 __pyx_temp = __pyx_r;
20055 __Pyx_INCREF(((PyObject*)__pyx_t_2));
20056 __pyx_r = ((PyObject*)__pyx_t_2);
20058 __Pyx_XDECREF(__pyx_temp);
20081 PyObject *__pyx_temp;
20083 __pyx_temp = __pyx_r;
20084 __Pyx_INCREF(__pyx_mstate_global->__pyx_empty_tuple);
20085 __pyx_r = __pyx_mstate_global->__pyx_empty_tuple;
20087 __Pyx_XDECREF(__pyx_temp);
20102 __Pyx_XGIVEREF(__pyx_r);
20103 __Pyx_RefNannyFinishContext();
20115static CYTHON_INLINE
int __pyx_f_5numpy_5ufunc_3nin___get__(PyUFuncObject *__pyx_v_self) {
20127 __pyx_r = _PyUFuncObject_GET_ITEM_DATA(__pyx_v_self)->nin;
20152static CYTHON_INLINE
int __pyx_f_5numpy_5ufunc_4nout___get__(PyUFuncObject *__pyx_v_self) {
20164 __pyx_r = _PyUFuncObject_GET_ITEM_DATA(__pyx_v_self)->nout;
20189static CYTHON_INLINE
int __pyx_f_5numpy_5ufunc_5nargs___get__(PyUFuncObject *__pyx_v_self) {
20201 __pyx_r = _PyUFuncObject_GET_ITEM_DATA(__pyx_v_self)->nargs;
20226static CYTHON_INLINE PyUFuncGenericFunction *__pyx_f_5numpy_5ufunc_9functions___get__(PyUFuncObject *__pyx_v_self) {
20227 PyUFuncGenericFunction *__pyx_r;
20238 __pyx_r = _PyUFuncObject_GET_ITEM_DATA(__pyx_v_self)->functions;
20263static CYTHON_INLINE
void **__pyx_f_5numpy_5ufunc_4data___get__(PyUFuncObject *__pyx_v_self) {
20275 __pyx_r = ((
void **)_PyUFuncObject_GET_ITEM_DATA(__pyx_v_self)->data);
20300static CYTHON_INLINE
int __pyx_f_5numpy_5ufunc_6ntypes___get__(PyUFuncObject *__pyx_v_self) {
20312 __pyx_r = _PyUFuncObject_GET_ITEM_DATA(__pyx_v_self)->ntypes;
20337static CYTHON_INLINE
char const *__pyx_f_5numpy_5ufunc_4name___get__(PyUFuncObject *__pyx_v_self) {
20338 char const *__pyx_r;
20349 __pyx_r = _PyUFuncObject_GET_ITEM_DATA(__pyx_v_self)->name;
20374static CYTHON_INLINE
char const *__pyx_f_5numpy_5ufunc_3doc___get__(PyUFuncObject *__pyx_v_self) {
20375 char const *__pyx_r;
20386 __pyx_r = _PyUFuncObject_GET_ITEM_DATA(__pyx_v_self)->doc;
20411static CYTHON_INLINE
void *__pyx_f_5numpy_5ufunc_3ptr___get__(PyUFuncObject *__pyx_v_self) {
20423 __pyx_r = _PyUFuncObject_GET_ITEM_DATA(__pyx_v_self)->ptr;
20448static CYTHON_INLINE PyObject *__pyx_f_5numpy_5ufunc_3obj___get__(PyUFuncObject *__pyx_v_self) {
20460 __pyx_r = _PyUFuncObject_GET_ITEM_DATA(__pyx_v_self)->obj;
20485static CYTHON_INLINE PyObject *__pyx_f_5numpy_5ufunc_9userloops___get__(PyUFuncObject *__pyx_v_self) {
20497 __pyx_r = _PyUFuncObject_GET_ITEM_DATA(__pyx_v_self)->userloops;
20522static CYTHON_INLINE
void __pyx_f_5numpy_set_array_base(PyArrayObject *__pyx_v_arr, PyObject *__pyx_v_base) {
20524 int __pyx_lineno = 0;
20525 const char *__pyx_filename = NULL;
20526 int __pyx_clineno = 0;
20535 Py_INCREF(__pyx_v_base);
20544 __pyx_t_1 = PyArray_SetBaseObject(__pyx_v_arr, __pyx_v_base);
if (unlikely(__pyx_t_1 == ((
int)-1))) __PYX_ERR(2, 1067, __pyx_L1_error)
20558 __Pyx_AddTraceback(
"numpy.set_array_base", __pyx_clineno, __pyx_lineno, __pyx_filename);
20571static CYTHON_INLINE PyObject *__pyx_f_5numpy_get_array_base(PyArrayObject *__pyx_v_arr) {
20572 PyObject *__pyx_v_base;
20573 PyObject *__pyx_r = NULL;
20574 __Pyx_RefNannyDeclarations
20576 __Pyx_RefNannySetupContext(
"get_array_base", 0);
20585 __pyx_v_base = PyArray_BASE(__pyx_v_arr);
20594 __pyx_t_1 = (__pyx_v_base == NULL);
20607 PyObject *__pyx_temp;
20609 __pyx_temp = __pyx_r;
20610 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
20612 __Pyx_XDECREF(__pyx_temp);
20633 PyObject *__pyx_temp;
20635 __pyx_temp = __pyx_r;
20636 __Pyx_INCREF(((PyObject *)__pyx_v_base));
20637 __pyx_r = ((PyObject *)__pyx_v_base);
20639 __Pyx_XDECREF(__pyx_temp);
20654 __Pyx_XGIVEREF(__pyx_r);
20655 __Pyx_RefNannyFinishContext();
20667static CYTHON_INLINE
int __pyx_f_5numpy_import_array(
void) {
20669 __Pyx_RefNannyDeclarations
20670 PyObject *__pyx_t_1 = NULL;
20671 PyObject *__pyx_t_2 = NULL;
20672 PyObject *__pyx_t_3 = NULL;
20674 PyObject *__pyx_t_5 = NULL;
20675 PyObject *__pyx_t_6 = NULL;
20676 PyObject *__pyx_t_7 = NULL;
20677 PyObject *__pyx_t_8 = NULL;
20678 PyObject *__pyx_t_9 = NULL;
20680 int __pyx_lineno = 0;
20681 const char *__pyx_filename = NULL;
20682 int __pyx_clineno = 0;
20683 __Pyx_RefNannySetupContext(
"import_array", 0);
20693 __Pyx_PyThreadState_declare
20694 __Pyx_PyThreadState_assign
20695 __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
20696 __Pyx_XGOTREF(__pyx_t_1);
20697 __Pyx_XGOTREF(__pyx_t_2);
20698 __Pyx_XGOTREF(__pyx_t_3);
20708 __pyx_t_4 = _import_array();
if (unlikely(__pyx_t_4 == ((
int)-1))) __PYX_ERR(2, 1079, __pyx_L3_error)
20719 __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
20720 __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
20721 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
20722 goto __pyx_L8_try_end;
20732 __pyx_t_4 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(((PyTypeObject*)PyExc_Exception))));
20734 __Pyx_AddTraceback(
"numpy.import_array", __pyx_clineno, __pyx_lineno, __pyx_filename);
20735 if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(2, 1080, __pyx_L5_except_error)
20736 __Pyx_XGOTREF(__pyx_t_5);
20737 __Pyx_XGOTREF(__pyx_t_6);
20738 __Pyx_XGOTREF(__pyx_t_7);
20750 PyObject *__pyx_callargs[2] = {__pyx_t_9, __pyx_mstate_global->__pyx_kp_u_numpy__core_multiarray_failed_to};
20751 __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));
20752 __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
20753 if (unlikely(!__pyx_t_8)) __PYX_ERR(2, 1081, __pyx_L5_except_error)
20754 __Pyx_GOTREF(__pyx_t_8);
20756 __Pyx_Raise(__pyx_t_8, 0, 0, 0);
20757 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
20758 __PYX_ERR(2, 1081, __pyx_L5_except_error)
20760 goto __pyx_L5_except_error;
20769 __pyx_L5_except_error:;
20770 __Pyx_XGIVEREF(__pyx_t_1);
20771 __Pyx_XGIVEREF(__pyx_t_2);
20772 __Pyx_XGIVEREF(__pyx_t_3);
20773 __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
20774 goto __pyx_L1_error;
20790 __Pyx_XDECREF(__pyx_t_5);
20791 __Pyx_XDECREF(__pyx_t_6);
20792 __Pyx_XDECREF(__pyx_t_7);
20793 __Pyx_XDECREF(__pyx_t_8);
20794 __Pyx_XDECREF(__pyx_t_9);
20795 __Pyx_AddTraceback(
"numpy.import_array", __pyx_clineno, __pyx_lineno, __pyx_filename);
20799 __Pyx_RefNannyFinishContext();
20811static CYTHON_INLINE
int __pyx_f_5numpy_import_umath(
void) {
20813 __Pyx_RefNannyDeclarations
20814 PyObject *__pyx_t_1 = NULL;
20815 PyObject *__pyx_t_2 = NULL;
20816 PyObject *__pyx_t_3 = NULL;
20818 PyObject *__pyx_t_5 = NULL;
20819 PyObject *__pyx_t_6 = NULL;
20820 PyObject *__pyx_t_7 = NULL;
20821 PyObject *__pyx_t_8 = NULL;
20822 PyObject *__pyx_t_9 = NULL;
20824 int __pyx_lineno = 0;
20825 const char *__pyx_filename = NULL;
20826 int __pyx_clineno = 0;
20827 __Pyx_RefNannySetupContext(
"import_umath", 0);
20837 __Pyx_PyThreadState_declare
20838 __Pyx_PyThreadState_assign
20839 __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
20840 __Pyx_XGOTREF(__pyx_t_1);
20841 __Pyx_XGOTREF(__pyx_t_2);
20842 __Pyx_XGOTREF(__pyx_t_3);
20852 __pyx_t_4 = _import_umath();
if (unlikely(__pyx_t_4 == ((
int)-1))) __PYX_ERR(2, 1085, __pyx_L3_error)
20863 __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
20864 __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
20865 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
20866 goto __pyx_L8_try_end;
20876 __pyx_t_4 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(((PyTypeObject*)PyExc_Exception))));
20878 __Pyx_AddTraceback(
"numpy.import_umath", __pyx_clineno, __pyx_lineno, __pyx_filename);
20879 if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(2, 1086, __pyx_L5_except_error)
20880 __Pyx_XGOTREF(__pyx_t_5);
20881 __Pyx_XGOTREF(__pyx_t_6);
20882 __Pyx_XGOTREF(__pyx_t_7);
20894 PyObject *__pyx_callargs[2] = {__pyx_t_9, __pyx_mstate_global->__pyx_kp_u_numpy__core_umath_failed_to_impo};
20895 __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));
20896 __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
20897 if (unlikely(!__pyx_t_8)) __PYX_ERR(2, 1087, __pyx_L5_except_error)
20898 __Pyx_GOTREF(__pyx_t_8);
20900 __Pyx_Raise(__pyx_t_8, 0, 0, 0);
20901 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
20902 __PYX_ERR(2, 1087, __pyx_L5_except_error)
20904 goto __pyx_L5_except_error;
20913 __pyx_L5_except_error:;
20914 __Pyx_XGIVEREF(__pyx_t_1);
20915 __Pyx_XGIVEREF(__pyx_t_2);
20916 __Pyx_XGIVEREF(__pyx_t_3);
20917 __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
20918 goto __pyx_L1_error;
20934 __Pyx_XDECREF(__pyx_t_5);
20935 __Pyx_XDECREF(__pyx_t_6);
20936 __Pyx_XDECREF(__pyx_t_7);
20937 __Pyx_XDECREF(__pyx_t_8);
20938 __Pyx_XDECREF(__pyx_t_9);
20939 __Pyx_AddTraceback(
"numpy.import_umath", __pyx_clineno, __pyx_lineno, __pyx_filename);
20943 __Pyx_RefNannyFinishContext();
20955static CYTHON_INLINE
int __pyx_f_5numpy_import_ufunc(
void) {
20957 __Pyx_RefNannyDeclarations
20958 PyObject *__pyx_t_1 = NULL;
20959 PyObject *__pyx_t_2 = NULL;
20960 PyObject *__pyx_t_3 = NULL;
20962 PyObject *__pyx_t_5 = NULL;
20963 PyObject *__pyx_t_6 = NULL;
20964 PyObject *__pyx_t_7 = NULL;
20965 PyObject *__pyx_t_8 = NULL;
20966 PyObject *__pyx_t_9 = NULL;
20968 int __pyx_lineno = 0;
20969 const char *__pyx_filename = NULL;
20970 int __pyx_clineno = 0;
20971 __Pyx_RefNannySetupContext(
"import_ufunc", 0);
20981 __Pyx_PyThreadState_declare
20982 __Pyx_PyThreadState_assign
20983 __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
20984 __Pyx_XGOTREF(__pyx_t_1);
20985 __Pyx_XGOTREF(__pyx_t_2);
20986 __Pyx_XGOTREF(__pyx_t_3);
20996 __pyx_t_4 = _import_umath();
if (unlikely(__pyx_t_4 == ((
int)-1))) __PYX_ERR(2, 1091, __pyx_L3_error)
21007 __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
21008 __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
21009 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
21010 goto __pyx_L8_try_end;
21020 __pyx_t_4 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(((PyTypeObject*)PyExc_Exception))));
21022 __Pyx_AddTraceback(
"numpy.import_ufunc", __pyx_clineno, __pyx_lineno, __pyx_filename);
21023 if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(2, 1092, __pyx_L5_except_error)
21024 __Pyx_XGOTREF(__pyx_t_5);
21025 __Pyx_XGOTREF(__pyx_t_6);
21026 __Pyx_XGOTREF(__pyx_t_7);
21038 PyObject *__pyx_callargs[2] = {__pyx_t_9, __pyx_mstate_global->__pyx_kp_u_numpy__core_umath_failed_to_impo};
21039 __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));
21040 __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
21041 if (unlikely(!__pyx_t_8)) __PYX_ERR(2, 1093, __pyx_L5_except_error)
21042 __Pyx_GOTREF(__pyx_t_8);
21044 __Pyx_Raise(__pyx_t_8, 0, 0, 0);
21045 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
21046 __PYX_ERR(2, 1093, __pyx_L5_except_error)
21048 goto __pyx_L5_except_error;
21057 __pyx_L5_except_error:;
21058 __Pyx_XGIVEREF(__pyx_t_1);
21059 __Pyx_XGIVEREF(__pyx_t_2);
21060 __Pyx_XGIVEREF(__pyx_t_3);
21061 __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
21062 goto __pyx_L1_error;
21078 __Pyx_XDECREF(__pyx_t_5);
21079 __Pyx_XDECREF(__pyx_t_6);
21080 __Pyx_XDECREF(__pyx_t_7);
21081 __Pyx_XDECREF(__pyx_t_8);
21082 __Pyx_XDECREF(__pyx_t_9);
21083 __Pyx_AddTraceback(
"numpy.import_ufunc", __pyx_clineno, __pyx_lineno, __pyx_filename);
21087 __Pyx_RefNannyFinishContext();
21099static CYTHON_INLINE
int __pyx_f_5numpy_is_timedelta64_object(PyObject *__pyx_v_obj) {
21111 __pyx_r = PyObject_TypeCheck(__pyx_v_obj, (&PyTimedeltaArrType_Type));
21137static CYTHON_INLINE
int __pyx_f_5numpy_is_datetime64_object(PyObject *__pyx_v_obj) {
21149 __pyx_r = PyObject_TypeCheck(__pyx_v_obj, (&PyDatetimeArrType_Type));
21175static CYTHON_INLINE npy_datetime __pyx_f_5numpy_get_datetime64_value(PyObject *__pyx_v_obj) {
21176 npy_datetime __pyx_r;
21187 __pyx_r = _PyDatetimeScalarObject_GetValue(__pyx_v_obj);
21212static CYTHON_INLINE npy_timedelta __pyx_f_5numpy_get_timedelta64_value(PyObject *__pyx_v_obj) {
21213 npy_timedelta __pyx_r;
21224 __pyx_r = _PyTimedeltaScalarObject_GetValue(__pyx_v_obj);
21249static CYTHON_INLINE NPY_DATETIMEUNIT __pyx_f_5numpy_get_datetime64_unit(PyObject *__pyx_v_obj) {
21250 NPY_DATETIMEUNIT __pyx_r;
21261 __pyx_r = _PyDatetimeScalarObject_GetMetadata(__pyx_v_obj).base;
21287static PyObject *__pyx_pw_15superluWrappers_12SparseMatrix_1__init__(PyObject *__pyx_self,
21288#
if CYTHON_VECTORCALL
21289PyObject *
const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
21291PyObject *__pyx_args, PyObject *__pyx_kwds
21294static PyMethodDef __pyx_mdef_15superluWrappers_12SparseMatrix_1__init__ = {
"__init__", (PyCFunction)(
void(*)(
void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_15superluWrappers_12SparseMatrix_1__init__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
21295static PyObject *__pyx_pw_15superluWrappers_12SparseMatrix_1__init__(PyObject *__pyx_self,
21296#
if CYTHON_VECTORCALL
21297PyObject *
const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
21299PyObject *__pyx_args, PyObject *__pyx_kwds
21302 PyObject *__pyx_v_self = 0;
21303 PyObject *__pyx_v_nr = 0;
21304 PyObject *__pyx_v_nc = 0;
21305 PyObject *__pyx_v_nnz = 0;
21306 PyObject *__pyx_v_nzvals = 0;
21307 PyObject *__pyx_v_colind = 0;
21308 PyObject *__pyx_v_rowptr = 0;
21309 #if !CYTHON_VECTORCALL
21310 CYTHON_UNUSED Py_ssize_t __pyx_nargs;
21312 CYTHON_UNUSED PyObject *
const *__pyx_kwvalues;
21313 PyObject* values[7] = {0,0,0,0,0,0,0};
21314 int __pyx_lineno = 0;
21315 const char *__pyx_filename = NULL;
21316 int __pyx_clineno = 0;
21317 PyObject *__pyx_r = 0;
21318 __Pyx_RefNannyDeclarations
21319 __Pyx_RefNannySetupContext(
"__init__ (wrapper)", 0);
21320 #if !CYTHON_VECTORCALL
21321 #if CYTHON_ASSUME_SAFE_SIZE
21322 __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
21324 __pyx_nargs = PyTuple_Size(__pyx_args);
if (unlikely(__pyx_nargs < 0))
return NULL;
21327 __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
21329 PyObject **
const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_self,&__pyx_mstate_global->__pyx_n_u_nr,&__pyx_mstate_global->__pyx_n_u_nc,&__pyx_mstate_global->__pyx_n_u_nnz,&__pyx_mstate_global->__pyx_n_u_nzvals,&__pyx_mstate_global->__pyx_n_u_colind,&__pyx_mstate_global->__pyx_n_u_rowptr,0};
21330 const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
21331 if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(0, 15, __pyx_L3_error)
21332 if (__pyx_kwds_len > 0) {
21333 switch (__pyx_nargs) {
21335 values[6] = __Pyx_ArgRef_FASTCALL(__pyx_args, 6);
21336 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[6])) __PYX_ERR(0, 15, __pyx_L3_error)
21337 CYTHON_FALLTHROUGH;
21339 values[5] = __Pyx_ArgRef_FASTCALL(__pyx_args, 5);
21340 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[5])) __PYX_ERR(0, 15, __pyx_L3_error)
21341 CYTHON_FALLTHROUGH;
21343 values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
21344 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 15, __pyx_L3_error)
21345 CYTHON_FALLTHROUGH;
21347 values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
21348 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 15, __pyx_L3_error)
21349 CYTHON_FALLTHROUGH;
21351 values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
21352 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 15, __pyx_L3_error)
21353 CYTHON_FALLTHROUGH;
21355 values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
21356 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 15, __pyx_L3_error)
21357 CYTHON_FALLTHROUGH;
21359 values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
21360 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 15, __pyx_L3_error)
21361 CYTHON_FALLTHROUGH;
21363 default:
goto __pyx_L5_argtuple_error;
21365 const Py_ssize_t kwd_pos_args = __pyx_nargs;
21366 if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len,
"__init__", 0) < (0)) __PYX_ERR(0, 15, __pyx_L3_error)
21367 for (Py_ssize_t i = __pyx_nargs; i < 7; i++) {
21368 if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid(
"__init__", 1, 7, 7, i); __PYX_ERR(0, 15, __pyx_L3_error) }
21370 }
else if (unlikely(__pyx_nargs != 7)) {
21371 goto __pyx_L5_argtuple_error;
21373 values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
21374 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 15, __pyx_L3_error)
21375 values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
21376 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 15, __pyx_L3_error)
21377 values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
21378 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 15, __pyx_L3_error)
21379 values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
21380 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 15, __pyx_L3_error)
21381 values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
21382 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 15, __pyx_L3_error)
21383 values[5] = __Pyx_ArgRef_FASTCALL(__pyx_args, 5);
21384 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[5])) __PYX_ERR(0, 15, __pyx_L3_error)
21385 values[6] = __Pyx_ArgRef_FASTCALL(__pyx_args, 6);
21386 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[6])) __PYX_ERR(0, 15, __pyx_L3_error)
21388 __pyx_v_self = values[0];
21389 __pyx_v_nr = values[1];
21390 __pyx_v_nc = values[2];
21391 __pyx_v_nnz = values[3];
21392 __pyx_v_nzvals = values[4];
21393 __pyx_v_colind = values[5];
21394 __pyx_v_rowptr = values[6];
21396 goto __pyx_L6_skip;
21397 __pyx_L5_argtuple_error:;
21398 __Pyx_RaiseArgtupleInvalid(
"__init__", 1, 7, 7, __pyx_nargs); __PYX_ERR(0, 15, __pyx_L3_error)
21400 goto __pyx_L4_argument_unpacking_done;
21402 for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(
sizeof(values)/
sizeof(values[0])); ++__pyx_temp) {
21403 Py_XDECREF(values[__pyx_temp]);
21405 __Pyx_AddTraceback(
"superluWrappers.SparseMatrix.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
21406 __Pyx_RefNannyFinishContext();
21408 __pyx_L4_argument_unpacking_done:;
21409 __pyx_r = __pyx_pf_15superluWrappers_12SparseMatrix___init__(__pyx_self, __pyx_v_self, __pyx_v_nr, __pyx_v_nc, __pyx_v_nnz, __pyx_v_nzvals, __pyx_v_colind, __pyx_v_rowptr);
21412 for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(
sizeof(values)/
sizeof(values[0])); ++__pyx_temp) {
21413 Py_XDECREF(values[__pyx_temp]);
21415 __Pyx_RefNannyFinishContext();
21419static PyObject *__pyx_pf_15superluWrappers_12SparseMatrix___init__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_nr, PyObject *__pyx_v_nc, PyObject *__pyx_v_nnz, PyObject *__pyx_v_nzvals, PyObject *__pyx_v_colind, PyObject *__pyx_v_rowptr) {
21420 PyObject *__pyx_r = NULL;
21421 __Pyx_RefNannyDeclarations
21422 PyObject *__pyx_t_1 = NULL;
21423 PyObject *__pyx_t_2 = NULL;
21424 PyObject *__pyx_t_3 = NULL;
21425 PyObject *__pyx_t_4 = NULL;
21426 PyObject *__pyx_t_5 = NULL;
21428 int __pyx_lineno = 0;
21429 const char *__pyx_filename = NULL;
21430 int __pyx_clineno = 0;
21431 __Pyx_RefNannySetupContext(
"__init__", 0);
21440 if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_nr, __pyx_v_nr) < (0)) __PYX_ERR(0, 22, __pyx_L1_error)
21441 if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_nc, __pyx_v_nc) < (0)) __PYX_ERR(0, 22, __pyx_L1_error)
21450 if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_nnz, __pyx_v_nnz) < (0)) __PYX_ERR(0, 23, __pyx_L1_error)
21459 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_nr);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 24, __pyx_L1_error)
21460 __Pyx_GOTREF(__pyx_t_1);
21461 __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_nc);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 24, __pyx_L1_error)
21462 __Pyx_GOTREF(__pyx_t_2);
21463 __pyx_t_3 = PyList_New(2);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 24, __pyx_L1_error)
21464 __Pyx_GOTREF(__pyx_t_3);
21465 __Pyx_GIVEREF(__pyx_t_1);
21466 if (__Pyx_PyList_SET_ITEM(__pyx_t_3, 0, __pyx_t_1) != (0)) __PYX_ERR(0, 24, __pyx_L1_error);
21467 __Pyx_GIVEREF(__pyx_t_2);
21468 if (__Pyx_PyList_SET_ITEM(__pyx_t_3, 1, __pyx_t_2) != (0)) __PYX_ERR(0, 24, __pyx_L1_error);
21471 if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_shape, __pyx_t_3) < (0)) __PYX_ERR(0, 24, __pyx_L1_error)
21472 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
21481 if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_nzvals, __pyx_v_nzvals) < (0)) __PYX_ERR(0, 25, __pyx_L1_error)
21490 if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_colind, __pyx_v_colind) < (0)) __PYX_ERR(0, 26, __pyx_L1_error)
21499 if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_rowptr, __pyx_v_rowptr) < (0)) __PYX_ERR(0, 27, __pyx_L1_error)
21517 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_nzvals);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 31, __pyx_L1_error)
21518 __Pyx_GOTREF(__pyx_t_1);
21527 __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_colind);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 32, __pyx_L1_error)
21528 __Pyx_GOTREF(__pyx_t_4);
21537 __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_rowptr);
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 33, __pyx_L1_error)
21538 __Pyx_GOTREF(__pyx_t_5);
21541 PyObject *__pyx_callargs[7] = {__pyx_t_2, __pyx_v_nr, __pyx_v_nc, __pyx_v_nnz, __pyx_t_1, __pyx_t_4, __pyx_t_5};
21542 __pyx_t_3 = __Pyx_PyObject_FastCall((PyObject*)__pyx_mstate_global->__pyx_ptype_15superluWrappers_cSparseMatrix, __pyx_callargs+__pyx_t_6, (7-__pyx_t_6) | (__pyx_t_6*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
21543 __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
21544 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
21545 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
21546 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
21547 if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 28, __pyx_L1_error)
21548 __Pyx_GOTREF((PyObject *)__pyx_t_3);
21558 if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_cSparseMatrix, ((PyObject *)__pyx_t_3)) < (0)) __PYX_ERR(0, 28, __pyx_L1_error)
21559 __Pyx_DECREF((PyObject *)__pyx_t_3); __pyx_t_3 = 0;
21570 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
21573 __Pyx_XDECREF(__pyx_t_1);
21574 __Pyx_XDECREF(__pyx_t_2);
21575 __Pyx_XDECREF(__pyx_t_3);
21576 __Pyx_XDECREF(__pyx_t_4);
21577 __Pyx_XDECREF(__pyx_t_5);
21578 __Pyx_AddTraceback(
"superluWrappers.SparseMatrix.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
21581 __Pyx_XGIVEREF(__pyx_r);
21582 __Pyx_RefNannyFinishContext();
21595static PyObject *__pyx_pw_15superluWrappers_12SparseMatrix_3matvec(PyObject *__pyx_self,
21596#
if CYTHON_VECTORCALL
21597PyObject *
const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
21599PyObject *__pyx_args, PyObject *__pyx_kwds
21602PyDoc_STRVAR(__pyx_doc_15superluWrappers_12SparseMatrix_2matvec,
"\n Compute the sparse matrix-vector product y = Ax\n\n Arguments\n ---------\n x (input) : numpy array\n y (output) : numpy array\n ");
21603static PyMethodDef __pyx_mdef_15superluWrappers_12SparseMatrix_3matvec = {
"matvec", (PyCFunction)(
void(*)(
void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_15superluWrappers_12SparseMatrix_3matvec, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_15superluWrappers_12SparseMatrix_2matvec};
21604static PyObject *__pyx_pw_15superluWrappers_12SparseMatrix_3matvec(PyObject *__pyx_self,
21605#
if CYTHON_VECTORCALL
21606PyObject *
const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
21608PyObject *__pyx_args, PyObject *__pyx_kwds
21611 PyObject *__pyx_v_self = 0;
21612 PyObject *__pyx_v_x = 0;
21613 PyObject *__pyx_v_y = 0;
21614 #if !CYTHON_VECTORCALL
21615 CYTHON_UNUSED Py_ssize_t __pyx_nargs;
21617 CYTHON_UNUSED PyObject *
const *__pyx_kwvalues;
21618 PyObject* values[3] = {0,0,0};
21619 int __pyx_lineno = 0;
21620 const char *__pyx_filename = NULL;
21621 int __pyx_clineno = 0;
21622 PyObject *__pyx_r = 0;
21623 __Pyx_RefNannyDeclarations
21624 __Pyx_RefNannySetupContext(
"matvec (wrapper)", 0);
21625 #if !CYTHON_VECTORCALL
21626 #if CYTHON_ASSUME_SAFE_SIZE
21627 __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
21629 __pyx_nargs = PyTuple_Size(__pyx_args);
if (unlikely(__pyx_nargs < 0))
return NULL;
21632 __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
21634 PyObject **
const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_self,&__pyx_mstate_global->__pyx_n_u_x,&__pyx_mstate_global->__pyx_n_u_y,0};
21635 const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
21636 if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(0, 35, __pyx_L3_error)
21637 if (__pyx_kwds_len > 0) {
21638 switch (__pyx_nargs) {
21640 values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
21641 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 35, __pyx_L3_error)
21642 CYTHON_FALLTHROUGH;
21644 values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
21645 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 35, __pyx_L3_error)
21646 CYTHON_FALLTHROUGH;
21648 values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
21649 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 35, __pyx_L3_error)
21650 CYTHON_FALLTHROUGH;
21652 default:
goto __pyx_L5_argtuple_error;
21654 const Py_ssize_t kwd_pos_args = __pyx_nargs;
21655 if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len,
"matvec", 0) < (0)) __PYX_ERR(0, 35, __pyx_L3_error)
21656 for (Py_ssize_t i = __pyx_nargs; i < 3; i++) {
21657 if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid(
"matvec", 1, 3, 3, i); __PYX_ERR(0, 35, __pyx_L3_error) }
21659 }
else if (unlikely(__pyx_nargs != 3)) {
21660 goto __pyx_L5_argtuple_error;
21662 values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
21663 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 35, __pyx_L3_error)
21664 values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
21665 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 35, __pyx_L3_error)
21666 values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
21667 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 35, __pyx_L3_error)
21669 __pyx_v_self = values[0];
21670 __pyx_v_x = values[1];
21671 __pyx_v_y = values[2];
21673 goto __pyx_L6_skip;
21674 __pyx_L5_argtuple_error:;
21675 __Pyx_RaiseArgtupleInvalid(
"matvec", 1, 3, 3, __pyx_nargs); __PYX_ERR(0, 35, __pyx_L3_error)
21677 goto __pyx_L4_argument_unpacking_done;
21679 for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(
sizeof(values)/
sizeof(values[0])); ++__pyx_temp) {
21680 Py_XDECREF(values[__pyx_temp]);
21682 __Pyx_AddTraceback(
"superluWrappers.SparseMatrix.matvec", __pyx_clineno, __pyx_lineno, __pyx_filename);
21683 __Pyx_RefNannyFinishContext();
21685 __pyx_L4_argument_unpacking_done:;
21686 __pyx_r = __pyx_pf_15superluWrappers_12SparseMatrix_2matvec(__pyx_self, __pyx_v_self, __pyx_v_x, __pyx_v_y);
21689 for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(
sizeof(values)/
sizeof(values[0])); ++__pyx_temp) {
21690 Py_XDECREF(values[__pyx_temp]);
21692 __Pyx_RefNannyFinishContext();
21696static PyObject *__pyx_pf_15superluWrappers_12SparseMatrix_2matvec(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_x, PyObject *__pyx_v_y) {
21697 PyObject *__pyx_r = NULL;
21698 __Pyx_RefNannyDeclarations
21699 PyObject *__pyx_t_1 = NULL;
21700 __Pyx_memviewslice __pyx_t_2 = { 0, 0, { 0 }, { 0 }, { 0 } };
21701 __Pyx_memviewslice __pyx_t_3 = { 0, 0, { 0 }, { 0 }, { 0 } };
21702 int __pyx_lineno = 0;
21703 const char *__pyx_filename = NULL;
21704 int __pyx_clineno = 0;
21705 __Pyx_RefNannySetupContext(
"matvec", 0);
21714 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_cSparseMatrix);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 44, __pyx_L1_error)
21715 __Pyx_GOTREF(__pyx_t_1);
21716 if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_mstate_global->__pyx_ptype_15superluWrappers_cSparseMatrix))))) __PYX_ERR(0, 44, __pyx_L1_error)
21717 __pyx_t_2 = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_float64_t(__pyx_v_x, PyBUF_WRITABLE);
if (unlikely(!__pyx_t_2.memview)) __PYX_ERR(0, 44, __pyx_L1_error)
21718 __pyx_t_3 = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_float64_t(__pyx_v_y, PyBUF_WRITABLE);
if (unlikely(!__pyx_t_3.memview)) __PYX_ERR(0, 44, __pyx_L1_error)
21719 __pyx_f_15superluWrappers_SparseMatrix_matvec(((
struct __pyx_obj_15superluWrappers_cSparseMatrix *)__pyx_t_1), __pyx_t_2, __pyx_t_3);
if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 44, __pyx_L1_error)
21720 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
21721 __PYX_XCLEAR_MEMVIEW(&__pyx_t_2, 1);; __pyx_t_2.memview = NULL; __pyx_t_2.data = NULL;
21722 __PYX_XCLEAR_MEMVIEW(&__pyx_t_3, 1);; __pyx_t_3.memview = NULL; __pyx_t_3.data = NULL;
21733 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
21736 __Pyx_XDECREF(__pyx_t_1);
21737 __PYX_XCLEAR_MEMVIEW(&__pyx_t_2, 1);
21738 __PYX_XCLEAR_MEMVIEW(&__pyx_t_3, 1);
21739 __Pyx_AddTraceback(
"superluWrappers.SparseMatrix.matvec", __pyx_clineno, __pyx_lineno, __pyx_filename);
21742 __Pyx_XGIVEREF(__pyx_r);
21743 __Pyx_RefNannyFinishContext();
21756static PyObject *__pyx_pw_15superluWrappers_12SparseMatrix_5fwrite(PyObject *__pyx_self,
21757#
if CYTHON_VECTORCALL
21758PyObject *
const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
21760PyObject *__pyx_args, PyObject *__pyx_kwds
21763PyDoc_STRVAR(__pyx_doc_15superluWrappers_12SparseMatrix_4fwrite,
" Write the sparse matrix to a file\n\n Arguments\n ---------\n filename : str\n The output filename\n base : int\n ?!Possibly something to do with parallel?!\n ");
21764static PyMethodDef __pyx_mdef_15superluWrappers_12SparseMatrix_5fwrite = {
"fwrite", (PyCFunction)(
void(*)(
void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_15superluWrappers_12SparseMatrix_5fwrite, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_15superluWrappers_12SparseMatrix_4fwrite};
21765static PyObject *__pyx_pw_15superluWrappers_12SparseMatrix_5fwrite(PyObject *__pyx_self,
21766#
if CYTHON_VECTORCALL
21767PyObject *
const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
21769PyObject *__pyx_args, PyObject *__pyx_kwds
21772 PyObject *__pyx_v_self = 0;
21773 PyObject *__pyx_v_filename = 0;
21774 PyObject *__pyx_v_base = 0;
21775 #if !CYTHON_VECTORCALL
21776 CYTHON_UNUSED Py_ssize_t __pyx_nargs;
21778 CYTHON_UNUSED PyObject *
const *__pyx_kwvalues;
21779 PyObject* values[3] = {0,0,0};
21780 int __pyx_lineno = 0;
21781 const char *__pyx_filename = NULL;
21782 int __pyx_clineno = 0;
21783 PyObject *__pyx_r = 0;
21784 __Pyx_RefNannyDeclarations
21785 __Pyx_RefNannySetupContext(
"fwrite (wrapper)", 0);
21786 #if !CYTHON_VECTORCALL
21787 #if CYTHON_ASSUME_SAFE_SIZE
21788 __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
21790 __pyx_nargs = PyTuple_Size(__pyx_args);
if (unlikely(__pyx_nargs < 0))
return NULL;
21793 __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
21795 PyObject **
const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_self,&__pyx_mstate_global->__pyx_n_u_filename,&__pyx_mstate_global->__pyx_n_u_base,0};
21796 const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
21797 if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(0, 46, __pyx_L3_error)
21798 if (__pyx_kwds_len > 0) {
21799 switch (__pyx_nargs) {
21801 values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
21802 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 46, __pyx_L3_error)
21803 CYTHON_FALLTHROUGH;
21805 values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
21806 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 46, __pyx_L3_error)
21807 CYTHON_FALLTHROUGH;
21809 values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
21810 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 46, __pyx_L3_error)
21811 CYTHON_FALLTHROUGH;
21813 default:
goto __pyx_L5_argtuple_error;
21815 const Py_ssize_t kwd_pos_args = __pyx_nargs;
21816 if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len,
"fwrite", 0) < (0)) __PYX_ERR(0, 46, __pyx_L3_error)
21817 for (Py_ssize_t i = __pyx_nargs; i < 3; i++) {
21818 if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid(
"fwrite", 1, 3, 3, i); __PYX_ERR(0, 46, __pyx_L3_error) }
21820 }
else if (unlikely(__pyx_nargs != 3)) {
21821 goto __pyx_L5_argtuple_error;
21823 values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
21824 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 46, __pyx_L3_error)
21825 values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
21826 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 46, __pyx_L3_error)
21827 values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
21828 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 46, __pyx_L3_error)
21830 __pyx_v_self = values[0];
21831 __pyx_v_filename = values[1];
21832 __pyx_v_base = values[2];
21834 goto __pyx_L6_skip;
21835 __pyx_L5_argtuple_error:;
21836 __Pyx_RaiseArgtupleInvalid(
"fwrite", 1, 3, 3, __pyx_nargs); __PYX_ERR(0, 46, __pyx_L3_error)
21838 goto __pyx_L4_argument_unpacking_done;
21840 for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(
sizeof(values)/
sizeof(values[0])); ++__pyx_temp) {
21841 Py_XDECREF(values[__pyx_temp]);
21843 __Pyx_AddTraceback(
"superluWrappers.SparseMatrix.fwrite", __pyx_clineno, __pyx_lineno, __pyx_filename);
21844 __Pyx_RefNannyFinishContext();
21846 __pyx_L4_argument_unpacking_done:;
21847 __pyx_r = __pyx_pf_15superluWrappers_12SparseMatrix_4fwrite(__pyx_self, __pyx_v_self, __pyx_v_filename, __pyx_v_base);
21850 for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(
sizeof(values)/
sizeof(values[0])); ++__pyx_temp) {
21851 Py_XDECREF(values[__pyx_temp]);
21853 __Pyx_RefNannyFinishContext();
21857static PyObject *__pyx_pf_15superluWrappers_12SparseMatrix_4fwrite(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_filename, PyObject *__pyx_v_base) {
21858 PyObject *__pyx_v_output_file = NULL;
21859 PyObject *__pyx_v_i = NULL;
21860 PyObject *__pyx_v_k = NULL;
21861 PyObject *__pyx_r = NULL;
21862 __Pyx_RefNannyDeclarations
21863 PyObject *__pyx_t_1 = NULL;
21864 PyObject *__pyx_t_2 = NULL;
21866 PyObject *__pyx_t_4 = NULL;
21867 PyObject *__pyx_t_5 = NULL;
21868 PyObject *__pyx_t_6 = NULL;
21869 PyObject *__pyx_t_7 = NULL;
21870 PyObject *__pyx_t_8 = NULL;
21871 PyObject *__pyx_t_9 = NULL;
21872 PyObject *__pyx_t_10 = NULL;
21873 PyObject *__pyx_t_11 = NULL;
21874 PyObject *__pyx_t_12 = NULL;
21875 PyObject *(*__pyx_t_13)(PyObject *);
21876 PyObject *(*__pyx_t_14)(PyObject *);
21877 PyObject *__pyx_t_15 = NULL;
21878 PyObject *__pyx_t_16 = NULL;
21881 int __pyx_lineno = 0;
21882 const char *__pyx_filename = NULL;
21883 int __pyx_clineno = 0;
21884 __Pyx_RefNannySetupContext(
"fwrite", 0);
21897 PyObject *__pyx_callargs[3] = {__pyx_t_2, __pyx_v_filename, __pyx_mstate_global->__pyx_n_u_w};
21898 __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_builtin_open, __pyx_callargs+__pyx_t_3, (3-__pyx_t_3) | (__pyx_t_3*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
21899 __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
21900 if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 56, __pyx_L1_error)
21901 __Pyx_GOTREF(__pyx_t_1);
21903 __pyx_t_4 = __Pyx_PyObject_LookupSpecial(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_exit);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 56, __pyx_L1_error)
21904 __Pyx_GOTREF(__pyx_t_4);
21906 __pyx_t_6 = __Pyx_PyObject_LookupSpecial(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_enter);
if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 56, __pyx_L3_error)
21907 __Pyx_GOTREF(__pyx_t_6);
21909 #if CYTHON_UNPACK_METHODS
21910 if (likely(PyMethod_Check(__pyx_t_6))) {
21911 __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_6);
21913 PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_6);
21914 __Pyx_INCREF(__pyx_t_5);
21915 __Pyx_INCREF(__pyx__function);
21916 __Pyx_DECREF_SET(__pyx_t_6, __pyx__function);
21921 PyObject *__pyx_callargs[2] = {__pyx_t_5, NULL};
21922 __pyx_t_2 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_6, __pyx_callargs+__pyx_t_3, (1-__pyx_t_3) | (__pyx_t_3*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
21923 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
21924 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
21925 if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 56, __pyx_L3_error)
21926 __Pyx_GOTREF(__pyx_t_2);
21928 __pyx_t_6 = __pyx_t_2;
21930 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
21933 __Pyx_PyThreadState_declare
21934 __Pyx_PyThreadState_assign
21935 __Pyx_ExceptionSave(&__pyx_t_7, &__pyx_t_8, &__pyx_t_9);
21936 __Pyx_XGOTREF(__pyx_t_7);
21937 __Pyx_XGOTREF(__pyx_t_8);
21938 __Pyx_XGOTREF(__pyx_t_9);
21940 __pyx_v_output_file = __pyx_t_6;
21950 __pyx_t_1 = __pyx_v_output_file;
21951 __Pyx_INCREF(__pyx_t_1);
21952 __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_nr);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 57, __pyx_L7_error)
21953 __Pyx_GOTREF(__pyx_t_2);
21954 __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_nc);
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 57, __pyx_L7_error)
21955 __Pyx_GOTREF(__pyx_t_5);
21956 __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_rowptr);
if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 57, __pyx_L7_error)
21957 __Pyx_GOTREF(__pyx_t_10);
21958 __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_nr);
if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 57, __pyx_L7_error)
21959 __Pyx_GOTREF(__pyx_t_11);
21960 __pyx_t_12 = __Pyx_PyObject_GetItem(__pyx_t_10, __pyx_t_11);
if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 57, __pyx_L7_error)
21961 __Pyx_GOTREF(__pyx_t_12);
21962 __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
21963 __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
21964 __pyx_t_11 = PyTuple_New(3);
if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 57, __pyx_L7_error)
21965 __Pyx_GOTREF(__pyx_t_11);
21966 __Pyx_GIVEREF(__pyx_t_2);
21967 if (__Pyx_PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_t_2) != (0)) __PYX_ERR(0, 57, __pyx_L7_error);
21968 __Pyx_GIVEREF(__pyx_t_5);
21969 if (__Pyx_PyTuple_SET_ITEM(__pyx_t_11, 1, __pyx_t_5) != (0)) __PYX_ERR(0, 57, __pyx_L7_error);
21970 __Pyx_GIVEREF(__pyx_t_12);
21971 if (__Pyx_PyTuple_SET_ITEM(__pyx_t_11, 2, __pyx_t_12) != (0)) __PYX_ERR(0, 57, __pyx_L7_error);
21975 __pyx_t_12 = PyUnicode_Format(__pyx_mstate_global->__pyx_kp_u_i_i_i, __pyx_t_11);
if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 57, __pyx_L7_error)
21976 __Pyx_GOTREF(__pyx_t_12);
21977 __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
21980 PyObject *__pyx_callargs[2] = {__pyx_t_1, __pyx_t_12};
21981 __pyx_t_6 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_write, __pyx_callargs+__pyx_t_3, (2-__pyx_t_3) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
21982 __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
21983 __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
21984 if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 57, __pyx_L7_error)
21985 __Pyx_GOTREF(__pyx_t_6);
21987 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
21997 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_nr);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 58, __pyx_L7_error)
21998 __Pyx_GOTREF(__pyx_t_1);
22001 PyObject *__pyx_callargs[2] = {__pyx_t_12, __pyx_t_1};
22002 __pyx_t_6 = __Pyx_PyObject_FastCall((PyObject*)(&PyRange_Type), __pyx_callargs+__pyx_t_3, (2-__pyx_t_3) | (__pyx_t_3*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
22003 __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
22004 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
22005 if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 58, __pyx_L7_error)
22006 __Pyx_GOTREF(__pyx_t_6);
22008 __pyx_t_1 = PyObject_GetIter(__pyx_t_6);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 58, __pyx_L7_error)
22009 __Pyx_GOTREF(__pyx_t_1);
22010 __pyx_t_13 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_1);
if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 58, __pyx_L7_error)
22011 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
22014 __pyx_t_6 = __pyx_t_13(__pyx_t_1);
22015 if (unlikely(!__pyx_t_6)) {
22016 PyObject* exc_type = PyErr_Occurred();
22018 if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 58, __pyx_L7_error)
22024 __Pyx_GOTREF(__pyx_t_6);
22025 __Pyx_XDECREF_SET(__pyx_v_i, __pyx_t_6);
22036 __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_rowptr);
if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 59, __pyx_L7_error)
22037 __Pyx_GOTREF(__pyx_t_11);
22038 __pyx_t_5 = __Pyx_PyObject_GetItem(__pyx_t_11, __pyx_v_i);
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 59, __pyx_L7_error)
22039 __Pyx_GOTREF(__pyx_t_5);
22040 __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
22041 __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_rowptr);
if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 59, __pyx_L7_error)
22042 __Pyx_GOTREF(__pyx_t_11);
22043 __pyx_t_2 = __Pyx_PyLong_AddObjC(__pyx_v_i, __pyx_mstate_global->__pyx_int_1, 1, 0, 0);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 59, __pyx_L7_error)
22044 __Pyx_GOTREF(__pyx_t_2);
22045 __pyx_t_10 = __Pyx_PyObject_GetItem(__pyx_t_11, __pyx_t_2);
if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 59, __pyx_L7_error)
22046 __Pyx_GOTREF(__pyx_t_10);
22047 __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
22048 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
22051 PyObject *__pyx_callargs[3] = {__pyx_t_12, __pyx_t_5, __pyx_t_10};
22052 __pyx_t_6 = __Pyx_PyObject_FastCall((PyObject*)(&PyRange_Type), __pyx_callargs+__pyx_t_3, (3-__pyx_t_3) | (__pyx_t_3*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
22053 __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
22054 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
22055 __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
22056 if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 59, __pyx_L7_error)
22057 __Pyx_GOTREF(__pyx_t_6);
22059 __pyx_t_10 = PyObject_GetIter(__pyx_t_6);
if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 59, __pyx_L7_error)
22060 __Pyx_GOTREF(__pyx_t_10);
22061 __pyx_t_14 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_10);
if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 59, __pyx_L7_error)
22062 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
22065 __pyx_t_6 = __pyx_t_14(__pyx_t_10);
22066 if (unlikely(!__pyx_t_6)) {
22067 PyObject* exc_type = PyErr_Occurred();
22069 if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 59, __pyx_L7_error)
22075 __Pyx_GOTREF(__pyx_t_6);
22076 __Pyx_XDECREF_SET(__pyx_v_k, __pyx_t_6);
22086 __pyx_t_5 = __pyx_v_output_file;
22087 __Pyx_INCREF(__pyx_t_5);
22088 __pyx_t_12 = __Pyx_PyNumber_Add_object_object(__pyx_v_i, __pyx_v_base);
if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 60, __pyx_L7_error)
22089 __Pyx_GOTREF(__pyx_t_12);
22090 __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_colind);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 60, __pyx_L7_error)
22091 __Pyx_GOTREF(__pyx_t_2);
22092 __pyx_t_11 = __Pyx_PyObject_GetItem(__pyx_t_2, __pyx_v_k);
if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 60, __pyx_L7_error)
22093 __Pyx_GOTREF(__pyx_t_11);
22094 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
22095 __pyx_t_2 = __Pyx_PyNumber_Add_object_object(__pyx_t_11, __pyx_v_base);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 60, __pyx_L7_error)
22096 __Pyx_GOTREF(__pyx_t_2);
22097 __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
22098 __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_nzvals);
if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 60, __pyx_L7_error)
22099 __Pyx_GOTREF(__pyx_t_11);
22100 __pyx_t_15 = __Pyx_PyObject_GetItem(__pyx_t_11, __pyx_v_k);
if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 60, __pyx_L7_error)
22101 __Pyx_GOTREF(__pyx_t_15);
22102 __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
22103 __pyx_t_11 = PyTuple_New(3);
if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 60, __pyx_L7_error)
22104 __Pyx_GOTREF(__pyx_t_11);
22105 __Pyx_GIVEREF(__pyx_t_12);
22106 if (__Pyx_PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_t_12) != (0)) __PYX_ERR(0, 60, __pyx_L7_error);
22107 __Pyx_GIVEREF(__pyx_t_2);
22108 if (__Pyx_PyTuple_SET_ITEM(__pyx_t_11, 1, __pyx_t_2) != (0)) __PYX_ERR(0, 60, __pyx_L7_error);
22109 __Pyx_GIVEREF(__pyx_t_15);
22110 if (__Pyx_PyTuple_SET_ITEM(__pyx_t_11, 2, __pyx_t_15) != (0)) __PYX_ERR(0, 60, __pyx_L7_error);
22114 __pyx_t_15 = PyUnicode_Format(__pyx_mstate_global->__pyx_kp_u_d_d_13_8e, __pyx_t_11);
if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 60, __pyx_L7_error)
22115 __Pyx_GOTREF(__pyx_t_15);
22116 __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
22119 PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_t_15};
22120 __pyx_t_6 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_write, __pyx_callargs+__pyx_t_3, (2-__pyx_t_3) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
22121 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
22122 __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
22123 if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 60, __pyx_L7_error)
22124 __Pyx_GOTREF(__pyx_t_6);
22126 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
22136 __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
22146 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
22156 __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
22157 __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
22158 __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
22159 goto __pyx_L12_try_end;
22161 __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
22162 __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
22163 __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
22164 __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
22165 __Pyx_XDECREF(__pyx_t_15); __pyx_t_15 = 0;
22166 __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
22167 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
22168 __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
22170 __Pyx_AddTraceback(
"superluWrappers.SparseMatrix.fwrite", __pyx_clineno, __pyx_lineno, __pyx_filename);
22171 if (__Pyx_GetException(&__pyx_t_1, &__pyx_t_10, &__pyx_t_6) < 0) __PYX_ERR(0, 56, __pyx_L9_except_error)
22172 __Pyx_XGOTREF(__pyx_t_1);
22173 __Pyx_XGOTREF(__pyx_t_10);
22174 __Pyx_XGOTREF(__pyx_t_6);
22176 PyObject* __pyx_temp[3] = {__pyx_t_1, __pyx_t_10, __pyx_t_6};
22177 __pyx_t_15 = __Pyx_PyTuple_FromArray(__pyx_temp, 3);
if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 56, __pyx_L9_except_error)
22178 __Pyx_GOTREF(__pyx_t_15);
22180 __pyx_t_16 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_15, NULL);
22181 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
22182 __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
22183 if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 56, __pyx_L9_except_error)
22184 __Pyx_GOTREF(__pyx_t_16);
22185 __pyx_t_17 = __Pyx_PyObject_IsTrue(__pyx_t_16);
22186 __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
22187 if (__pyx_t_17 < (0)) __PYX_ERR(0, 56, __pyx_L9_except_error)
22188 __pyx_t_18 = (!__pyx_t_17);
22191 if (unlikely(__pyx_t_18)) {
22193 __Pyx_GIVEREF(__pyx_t_1);
22194 __Pyx_GIVEREF(__pyx_t_10);
22195 __Pyx_XGIVEREF(__pyx_t_6);
22196 __Pyx_ErrRestoreWithState(__pyx_t_1, __pyx_t_10, __pyx_t_6);
22197 __pyx_t_1 = 0; __pyx_t_10 = 0; __pyx_t_6 = 0;
22198 __PYX_ERR(0, 56, __pyx_L9_except_error)
22200 __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
22201 __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
22202 __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
22203 goto __pyx_L8_exception_handled;
22205 __pyx_L9_except_error:;
22206 __Pyx_XGIVEREF(__pyx_t_7);
22207 __Pyx_XGIVEREF(__pyx_t_8);
22208 __Pyx_XGIVEREF(__pyx_t_9);
22209 __Pyx_ExceptionReset(__pyx_t_7, __pyx_t_8, __pyx_t_9);
22210 goto __pyx_L1_error;
22211 __pyx_L8_exception_handled:;
22212 __Pyx_XGIVEREF(__pyx_t_7);
22213 __Pyx_XGIVEREF(__pyx_t_8);
22214 __Pyx_XGIVEREF(__pyx_t_9);
22215 __Pyx_ExceptionReset(__pyx_t_7, __pyx_t_8, __pyx_t_9);
22216 __pyx_L12_try_end:;
22222 __pyx_t_9 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_mstate_global->__pyx_tuple[2], NULL);
22223 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
22224 if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 56, __pyx_L1_error)
22225 __Pyx_GOTREF(__pyx_t_9);
22226 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
22234 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
22235 goto __pyx_L1_error;
22248 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
22251 __Pyx_XDECREF(__pyx_t_1);
22252 __Pyx_XDECREF(__pyx_t_2);
22253 __Pyx_XDECREF(__pyx_t_5);
22254 __Pyx_XDECREF(__pyx_t_6);
22255 __Pyx_XDECREF(__pyx_t_10);
22256 __Pyx_XDECREF(__pyx_t_11);
22257 __Pyx_XDECREF(__pyx_t_12);
22258 __Pyx_XDECREF(__pyx_t_15);
22259 __Pyx_AddTraceback(
"superluWrappers.SparseMatrix.fwrite", __pyx_clineno, __pyx_lineno, __pyx_filename);
22262 __Pyx_XDECREF(__pyx_v_output_file);
22263 __Pyx_XDECREF(__pyx_v_i);
22264 __Pyx_XDECREF(__pyx_v_k);
22265 __Pyx_XGIVEREF(__pyx_r);
22266 __Pyx_RefNannyFinishContext();
22279static PyObject *__pyx_pw_15superluWrappers_12SparseMatrix_7getCSRrepresentation(PyObject *__pyx_self,
22280#
if CYTHON_VECTORCALL
22281PyObject *
const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
22283PyObject *__pyx_args, PyObject *__pyx_kwds
22286PyDoc_STRVAR(__pyx_doc_15superluWrappers_12SparseMatrix_6getCSRrepresentation,
" Get the CSR representation of the sparse matrix.\n\n Returns\n -------\n csr_data : tuple of nparray\n (rowptr, colptr, vals)\n ");
22287static PyMethodDef __pyx_mdef_15superluWrappers_12SparseMatrix_7getCSRrepresentation = {
"getCSRrepresentation", (PyCFunction)(
void(*)(
void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_15superluWrappers_12SparseMatrix_7getCSRrepresentation, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_15superluWrappers_12SparseMatrix_6getCSRrepresentation};
22288static PyObject *__pyx_pw_15superluWrappers_12SparseMatrix_7getCSRrepresentation(PyObject *__pyx_self,
22289#
if CYTHON_VECTORCALL
22290PyObject *
const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
22292PyObject *__pyx_args, PyObject *__pyx_kwds
22295 PyObject *__pyx_v_self = 0;
22296 #if !CYTHON_VECTORCALL
22297 CYTHON_UNUSED Py_ssize_t __pyx_nargs;
22299 CYTHON_UNUSED PyObject *
const *__pyx_kwvalues;
22300 PyObject* values[1] = {0};
22301 int __pyx_lineno = 0;
22302 const char *__pyx_filename = NULL;
22303 int __pyx_clineno = 0;
22304 PyObject *__pyx_r = 0;
22305 __Pyx_RefNannyDeclarations
22306 __Pyx_RefNannySetupContext(
"getCSRrepresentation (wrapper)", 0);
22307 #if !CYTHON_VECTORCALL
22308 #if CYTHON_ASSUME_SAFE_SIZE
22309 __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
22311 __pyx_nargs = PyTuple_Size(__pyx_args);
if (unlikely(__pyx_nargs < 0))
return NULL;
22314 __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
22316 PyObject **
const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_self,0};
22317 const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
22318 if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(0, 62, __pyx_L3_error)
22319 if (__pyx_kwds_len > 0) {
22320 switch (__pyx_nargs) {
22322 values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
22323 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 62, __pyx_L3_error)
22324 CYTHON_FALLTHROUGH;
22326 default:
goto __pyx_L5_argtuple_error;
22328 const Py_ssize_t kwd_pos_args = __pyx_nargs;
22329 if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len,
"getCSRrepresentation", 0) < (0)) __PYX_ERR(0, 62, __pyx_L3_error)
22330 for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
22331 if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid(
"getCSRrepresentation", 1, 1, 1, i); __PYX_ERR(0, 62, __pyx_L3_error) }
22333 }
else if (unlikely(__pyx_nargs != 1)) {
22334 goto __pyx_L5_argtuple_error;
22336 values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
22337 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 62, __pyx_L3_error)
22339 __pyx_v_self = values[0];
22341 goto __pyx_L6_skip;
22342 __pyx_L5_argtuple_error:;
22343 __Pyx_RaiseArgtupleInvalid(
"getCSRrepresentation", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 62, __pyx_L3_error)
22345 goto __pyx_L4_argument_unpacking_done;
22347 for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(
sizeof(values)/
sizeof(values[0])); ++__pyx_temp) {
22348 Py_XDECREF(values[__pyx_temp]);
22350 __Pyx_AddTraceback(
"superluWrappers.SparseMatrix.getCSRrepresentation", __pyx_clineno, __pyx_lineno, __pyx_filename);
22351 __Pyx_RefNannyFinishContext();
22353 __pyx_L4_argument_unpacking_done:;
22354 __pyx_r = __pyx_pf_15superluWrappers_12SparseMatrix_6getCSRrepresentation(__pyx_self, __pyx_v_self);
22357 for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(
sizeof(values)/
sizeof(values[0])); ++__pyx_temp) {
22358 Py_XDECREF(values[__pyx_temp]);
22360 __Pyx_RefNannyFinishContext();
22364static PyObject *__pyx_pf_15superluWrappers_12SparseMatrix_6getCSRrepresentation(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) {
22365 PyObject *__pyx_r = NULL;
22366 __Pyx_RefNannyDeclarations
22367 PyObject *__pyx_t_1 = NULL;
22368 PyObject *__pyx_t_2 = NULL;
22369 PyObject *__pyx_t_3 = NULL;
22370 PyObject *__pyx_t_4 = NULL;
22371 int __pyx_lineno = 0;
22372 const char *__pyx_filename = NULL;
22373 int __pyx_clineno = 0;
22374 __Pyx_RefNannySetupContext(
"getCSRrepresentation", 0);
22383 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_rowptr);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 70, __pyx_L1_error)
22384 __Pyx_GOTREF(__pyx_t_1);
22385 __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_colind);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 70, __pyx_L1_error)
22386 __Pyx_GOTREF(__pyx_t_2);
22387 __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_nzvals);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 70, __pyx_L1_error)
22388 __Pyx_GOTREF(__pyx_t_3);
22389 __pyx_t_4 = PyTuple_New(3);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 70, __pyx_L1_error)
22390 __Pyx_GOTREF(__pyx_t_4);
22391 __Pyx_GIVEREF(__pyx_t_1);
22392 if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_1) != (0)) __PYX_ERR(0, 70, __pyx_L1_error);
22393 __Pyx_GIVEREF(__pyx_t_2);
22394 if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_2) != (0)) __PYX_ERR(0, 70, __pyx_L1_error);
22395 __Pyx_GIVEREF(__pyx_t_3);
22396 if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_t_3) != (0)) __PYX_ERR(0, 70, __pyx_L1_error);
22401 PyObject *__pyx_temp;
22403 __pyx_temp = __pyx_r;
22404 __pyx_r = __pyx_t_4;
22406 __Pyx_XDECREF(__pyx_temp);
22421 __Pyx_XDECREF(__pyx_t_1);
22422 __Pyx_XDECREF(__pyx_t_2);
22423 __Pyx_XDECREF(__pyx_t_3);
22424 __Pyx_XDECREF(__pyx_t_4);
22425 __Pyx_AddTraceback(
"superluWrappers.SparseMatrix.getCSRrepresentation", __pyx_clineno, __pyx_lineno, __pyx_filename);
22428 __Pyx_XGIVEREF(__pyx_r);
22429 __Pyx_RefNannyFinishContext();
22442static PyObject *__pyx_pw_15superluWrappers_12SparseMatrix_9getSubMatCSRrepresentation(PyObject *__pyx_self,
22443#
if CYTHON_VECTORCALL
22444PyObject *
const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
22446PyObject *__pyx_args, PyObject *__pyx_kwds
22449PyDoc_STRVAR(__pyx_doc_15superluWrappers_12SparseMatrix_8getSubMatCSRrepresentation,
" Get the CSR representation for a submatrix.\n\n Arguments\n ---------\n range_start : int\n range_end : int\n\n Returns\n -------\n csr_data : tuple of nparray\n (rowptr, colind, nzvals)\n ");
22450static PyMethodDef __pyx_mdef_15superluWrappers_12SparseMatrix_9getSubMatCSRrepresentation = {
"getSubMatCSRrepresentation", (PyCFunction)(
void(*)(
void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_15superluWrappers_12SparseMatrix_9getSubMatCSRrepresentation, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_15superluWrappers_12SparseMatrix_8getSubMatCSRrepresentation};
22451static PyObject *__pyx_pw_15superluWrappers_12SparseMatrix_9getSubMatCSRrepresentation(PyObject *__pyx_self,
22452#
if CYTHON_VECTORCALL
22453PyObject *
const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
22455PyObject *__pyx_args, PyObject *__pyx_kwds
22458 PyObject *__pyx_v_self = 0;
22459 PyObject *__pyx_v_range_start = 0;
22460 PyObject *__pyx_v_range_end = 0;
22461 #if !CYTHON_VECTORCALL
22462 CYTHON_UNUSED Py_ssize_t __pyx_nargs;
22464 CYTHON_UNUSED PyObject *
const *__pyx_kwvalues;
22465 PyObject* values[3] = {0,0,0};
22466 int __pyx_lineno = 0;
22467 const char *__pyx_filename = NULL;
22468 int __pyx_clineno = 0;
22469 PyObject *__pyx_r = 0;
22470 __Pyx_RefNannyDeclarations
22471 __Pyx_RefNannySetupContext(
"getSubMatCSRrepresentation (wrapper)", 0);
22472 #if !CYTHON_VECTORCALL
22473 #if CYTHON_ASSUME_SAFE_SIZE
22474 __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
22476 __pyx_nargs = PyTuple_Size(__pyx_args);
if (unlikely(__pyx_nargs < 0))
return NULL;
22479 __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
22481 PyObject **
const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_self,&__pyx_mstate_global->__pyx_n_u_range_start,&__pyx_mstate_global->__pyx_n_u_range_end,0};
22482 const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
22483 if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(0, 72, __pyx_L3_error)
22484 if (__pyx_kwds_len > 0) {
22485 switch (__pyx_nargs) {
22487 values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
22488 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 72, __pyx_L3_error)
22489 CYTHON_FALLTHROUGH;
22491 values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
22492 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 72, __pyx_L3_error)
22493 CYTHON_FALLTHROUGH;
22495 values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
22496 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 72, __pyx_L3_error)
22497 CYTHON_FALLTHROUGH;
22499 default:
goto __pyx_L5_argtuple_error;
22501 const Py_ssize_t kwd_pos_args = __pyx_nargs;
22502 if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len,
"getSubMatCSRrepresentation", 0) < (0)) __PYX_ERR(0, 72, __pyx_L3_error)
22503 for (Py_ssize_t i = __pyx_nargs; i < 3; i++) {
22504 if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid(
"getSubMatCSRrepresentation", 1, 3, 3, i); __PYX_ERR(0, 72, __pyx_L3_error) }
22506 }
else if (unlikely(__pyx_nargs != 3)) {
22507 goto __pyx_L5_argtuple_error;
22509 values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
22510 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 72, __pyx_L3_error)
22511 values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
22512 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 72, __pyx_L3_error)
22513 values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
22514 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 72, __pyx_L3_error)
22516 __pyx_v_self = values[0];
22517 __pyx_v_range_start = values[1];
22518 __pyx_v_range_end = values[2];
22520 goto __pyx_L6_skip;
22521 __pyx_L5_argtuple_error:;
22522 __Pyx_RaiseArgtupleInvalid(
"getSubMatCSRrepresentation", 1, 3, 3, __pyx_nargs); __PYX_ERR(0, 72, __pyx_L3_error)
22524 goto __pyx_L4_argument_unpacking_done;
22526 for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(
sizeof(values)/
sizeof(values[0])); ++__pyx_temp) {
22527 Py_XDECREF(values[__pyx_temp]);
22529 __Pyx_AddTraceback(
"superluWrappers.SparseMatrix.getSubMatCSRrepresentation", __pyx_clineno, __pyx_lineno, __pyx_filename);
22530 __Pyx_RefNannyFinishContext();
22532 __pyx_L4_argument_unpacking_done:;
22533 __pyx_r = __pyx_pf_15superluWrappers_12SparseMatrix_8getSubMatCSRrepresentation(__pyx_self, __pyx_v_self, __pyx_v_range_start, __pyx_v_range_end);
22536 for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(
sizeof(values)/
sizeof(values[0])); ++__pyx_temp) {
22537 Py_XDECREF(values[__pyx_temp]);
22539 __Pyx_RefNannyFinishContext();
22543static PyObject *__pyx_pf_15superluWrappers_12SparseMatrix_8getSubMatCSRrepresentation(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_range_start, PyObject *__pyx_v_range_end) {
22544 PyObject *__pyx_v__rows = NULL;
22545 PyObject *__pyx_v_nnz = NULL;
22546 PyObject *__pyx_v_rowptr = NULL;
22547 PyObject *__pyx_v_colind = NULL;
22548 PyObject *__pyx_v_nzvals = NULL;
22549 PyObject *__pyx_r = NULL;
22550 __Pyx_RefNannyDeclarations
22552 PyObject *__pyx_t_2 = NULL;
22553 PyObject *__pyx_t_3 = NULL;
22554 PyObject *__pyx_t_4 = NULL;
22555 PyObject *__pyx_t_5 = NULL;
22556 int __pyx_lineno = 0;
22557 const char *__pyx_filename = NULL;
22558 int __pyx_clineno = 0;
22559 __Pyx_RefNannySetupContext(
"getSubMatCSRrepresentation", 0);
22568 #ifndef CYTHON_WITHOUT_ASSERTIONS
22569 if (unlikely(__pyx_assertions_enabled())) {
22570 __pyx_t_1 = __Pyx_PyObject_CompareBoolGe_object_int(__pyx_v_range_start, __pyx_mstate_global->__pyx_int_0, Py_GE);
if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 87, __pyx_L1_error)
22571 if (unlikely(!__pyx_t_1)) {
22572 __Pyx_Raise(((PyObject *)(((PyTypeObject*)PyExc_AssertionError))), 0, 0, 0);
22573 __PYX_ERR(0, 87, __pyx_L1_error)
22578 if ((1));
else __PYX_ERR(0, 87, __pyx_L1_error)
22580 #ifndef CYTHON_WITHOUT_ASSERTIONS
22581 if (unlikely(__pyx_assertions_enabled())) {
22582 __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_nr);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 87, __pyx_L1_error)
22583 __Pyx_GOTREF(__pyx_t_2);
22584 __pyx_t_1 = __Pyx_PyObject_CompareBoolLe_object_object(__pyx_v_range_end, __pyx_t_2, Py_LE);
if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 87, __pyx_L1_error)
22585 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
22586 if (unlikely(!__pyx_t_1)) {
22587 __Pyx_Raise(((PyObject *)(((PyTypeObject*)PyExc_AssertionError))), 0, 0, 0);
22588 __PYX_ERR(0, 87, __pyx_L1_error)
22593 if ((1));
else __PYX_ERR(0, 87, __pyx_L1_error)
22603 #ifndef CYTHON_WITHOUT_ASSERTIONS
22604 if (unlikely(__pyx_assertions_enabled())) {
22605 __pyx_t_1 = __Pyx_PyObject_CompareBoolGt_object_object(__pyx_v_range_end, __pyx_v_range_start, Py_GT);
if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 88, __pyx_L1_error)
22606 if (unlikely(!__pyx_t_1)) {
22607 __Pyx_Raise(((PyObject *)(((PyTypeObject*)PyExc_AssertionError))), 0, 0, 0);
22608 __PYX_ERR(0, 88, __pyx_L1_error)
22613 if ((1));
else __PYX_ERR(0, 88, __pyx_L1_error)
22623 __pyx_t_2 = __Pyx_PyNumber_Subtract_object_object(__pyx_v_range_end, __pyx_v_range_start);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 89, __pyx_L1_error)
22624 __Pyx_GOTREF(__pyx_t_2);
22625 __pyx_v__rows = __pyx_t_2;
22635 #ifndef CYTHON_WITHOUT_ASSERTIONS
22636 if (unlikely(__pyx_assertions_enabled())) {
22637 __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_nr);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 90, __pyx_L1_error)
22638 __Pyx_GOTREF(__pyx_t_2);
22639 __pyx_t_1 = __Pyx_PyObject_CompareBoolLe_object_object(__pyx_v__rows, __pyx_t_2, Py_LE);
if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 90, __pyx_L1_error)
22640 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
22641 if (unlikely(!__pyx_t_1)) {
22642 __Pyx_Raise(((PyObject *)(((PyTypeObject*)PyExc_AssertionError))), 0, 0, 0);
22643 __PYX_ERR(0, 90, __pyx_L1_error)
22648 if ((1));
else __PYX_ERR(0, 90, __pyx_L1_error)
22658 __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_rowptr);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 92, __pyx_L1_error)
22659 __Pyx_GOTREF(__pyx_t_2);
22660 __pyx_t_3 = __Pyx_PyObject_GetItem(__pyx_t_2, __pyx_v_range_end);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 92, __pyx_L1_error)
22661 __Pyx_GOTREF(__pyx_t_3);
22662 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
22663 __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_rowptr);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 92, __pyx_L1_error)
22664 __Pyx_GOTREF(__pyx_t_2);
22665 __pyx_t_4 = __Pyx_PyObject_GetItem(__pyx_t_2, __pyx_v_range_start);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 92, __pyx_L1_error)
22666 __Pyx_GOTREF(__pyx_t_4);
22667 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
22668 __pyx_t_2 = __Pyx_PyNumber_Subtract_object_object(__pyx_t_3, __pyx_t_4);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 92, __pyx_L1_error)
22669 __Pyx_GOTREF(__pyx_t_2);
22670 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
22671 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
22672 __pyx_v_nnz = __pyx_t_2;
22682 __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_rowptr);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 94, __pyx_L1_error)
22683 __Pyx_GOTREF(__pyx_t_2);
22684 __pyx_t_4 = __Pyx_PyNumber_Add_object_object(__pyx_v_range_start, __pyx_v__rows);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 94, __pyx_L1_error)
22685 __Pyx_GOTREF(__pyx_t_4);
22686 __pyx_t_3 = __Pyx_PyLong_AddObjC(__pyx_t_4, __pyx_mstate_global->__pyx_int_1, 1, 0, 0);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 94, __pyx_L1_error)
22687 __Pyx_GOTREF(__pyx_t_3);
22688 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
22689 __pyx_t_4 = __Pyx_PyObject_GetSlice(__pyx_t_2, 0, 0, &__pyx_v_range_start, &__pyx_t_3, NULL, 0, 0, 0);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 94, __pyx_L1_error)
22690 __Pyx_GOTREF(__pyx_t_4);
22691 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
22692 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
22693 __pyx_v_rowptr = __pyx_t_4;
22703 __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_colind);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 95, __pyx_L1_error)
22704 __Pyx_GOTREF(__pyx_t_4);
22705 __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_rowptr);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 95, __pyx_L1_error)
22706 __Pyx_GOTREF(__pyx_t_3);
22707 __pyx_t_2 = __Pyx_PyObject_GetItem(__pyx_t_3, __pyx_v_range_start);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 95, __pyx_L1_error)
22708 __Pyx_GOTREF(__pyx_t_2);
22709 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
22710 __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_rowptr);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 95, __pyx_L1_error)
22711 __Pyx_GOTREF(__pyx_t_3);
22712 __pyx_t_5 = __Pyx_PyObject_GetItem(__pyx_t_3, __pyx_v_range_start);
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 95, __pyx_L1_error)
22713 __Pyx_GOTREF(__pyx_t_5);
22714 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
22715 __pyx_t_3 = __Pyx_PyNumber_Add_object_object(__pyx_t_5, __pyx_v_nnz);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 95, __pyx_L1_error)
22716 __Pyx_GOTREF(__pyx_t_3);
22717 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
22718 __pyx_t_5 = __Pyx_PyObject_GetSlice(__pyx_t_4, 0, 0, &__pyx_t_2, &__pyx_t_3, NULL, 0, 0, 0);
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 95, __pyx_L1_error)
22719 __Pyx_GOTREF(__pyx_t_5);
22720 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
22721 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
22722 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
22723 __pyx_v_colind = __pyx_t_5;
22733 __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_nzvals);
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 96, __pyx_L1_error)
22734 __Pyx_GOTREF(__pyx_t_5);
22735 __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_rowptr);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 96, __pyx_L1_error)
22736 __Pyx_GOTREF(__pyx_t_3);
22737 __pyx_t_2 = __Pyx_PyObject_GetItem(__pyx_t_3, __pyx_v_range_start);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 96, __pyx_L1_error)
22738 __Pyx_GOTREF(__pyx_t_2);
22739 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
22740 __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_rowptr);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 96, __pyx_L1_error)
22741 __Pyx_GOTREF(__pyx_t_3);
22742 __pyx_t_4 = __Pyx_PyObject_GetItem(__pyx_t_3, __pyx_v_range_start);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 96, __pyx_L1_error)
22743 __Pyx_GOTREF(__pyx_t_4);
22744 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
22745 __pyx_t_3 = __Pyx_PyNumber_Add_object_object(__pyx_t_4, __pyx_v_nnz);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 96, __pyx_L1_error)
22746 __Pyx_GOTREF(__pyx_t_3);
22747 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
22748 __pyx_t_4 = __Pyx_PyObject_GetSlice(__pyx_t_5, 0, 0, &__pyx_t_2, &__pyx_t_3, NULL, 0, 0, 0);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 96, __pyx_L1_error)
22749 __Pyx_GOTREF(__pyx_t_4);
22750 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
22751 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
22752 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
22753 __pyx_v_nzvals = __pyx_t_4;
22763 __pyx_t_4 = PyTuple_New(3);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 98, __pyx_L1_error)
22764 __Pyx_GOTREF(__pyx_t_4);
22765 __Pyx_INCREF(__pyx_v_rowptr);
22766 __Pyx_GIVEREF(__pyx_v_rowptr);
22767 if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_rowptr) != (0)) __PYX_ERR(0, 98, __pyx_L1_error);
22768 __Pyx_INCREF(__pyx_v_colind);
22769 __Pyx_GIVEREF(__pyx_v_colind);
22770 if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_v_colind) != (0)) __PYX_ERR(0, 98, __pyx_L1_error);
22771 __Pyx_INCREF(__pyx_v_nzvals);
22772 __Pyx_GIVEREF(__pyx_v_nzvals);
22773 if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_v_nzvals) != (0)) __PYX_ERR(0, 98, __pyx_L1_error);
22775 PyObject *__pyx_temp;
22777 __pyx_temp = __pyx_r;
22778 __pyx_r = __pyx_t_4;
22780 __Pyx_XDECREF(__pyx_temp);
22795 __Pyx_XDECREF(__pyx_t_2);
22796 __Pyx_XDECREF(__pyx_t_3);
22797 __Pyx_XDECREF(__pyx_t_4);
22798 __Pyx_XDECREF(__pyx_t_5);
22799 __Pyx_AddTraceback(
"superluWrappers.SparseMatrix.getSubMatCSRrepresentation", __pyx_clineno, __pyx_lineno, __pyx_filename);
22802 __Pyx_XDECREF(__pyx_v__rows);
22803 __Pyx_XDECREF(__pyx_v_nnz);
22804 __Pyx_XDECREF(__pyx_v_rowptr);
22805 __Pyx_XDECREF(__pyx_v_colind);
22806 __Pyx_XDECREF(__pyx_v_nzvals);
22807 __Pyx_XGIVEREF(__pyx_r);
22808 __Pyx_RefNannyFinishContext();
22821static int __pyx_pw_15superluWrappers_13cSparseMatrix_1__cinit__(PyObject *__pyx_v_self,
22822#
if CYTHON_VECTORCALL_TPNEW
22823PyObject *
const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
22825PyObject *__pyx_args, PyObject *__pyx_kwds
22828static int __pyx_pw_15superluWrappers_13cSparseMatrix_1__cinit__(PyObject *__pyx_v_self,
22829#
if CYTHON_VECTORCALL_TPNEW
22830PyObject *
const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
22832PyObject *__pyx_args, PyObject *__pyx_kwds
22838 __Pyx_memviewslice __pyx_v_nzval = { 0, 0, { 0 }, { 0 }, { 0 } };
22839 __Pyx_memviewslice __pyx_v_colind = { 0, 0, { 0 }, { 0 }, { 0 } };
22840 __Pyx_memviewslice __pyx_v_rowptr = { 0, 0, { 0 }, { 0 }, { 0 } };
22841 #if !CYTHON_VECTORCALL_TPNEW
22842 CYTHON_UNUSED Py_ssize_t __pyx_nargs;
22844 CYTHON_UNUSED PyObject *
const *__pyx_kwvalues;
22845 PyObject* values[6] = {0,0,0,0,0,0};
22846 int __pyx_lineno = 0;
22847 const char *__pyx_filename = NULL;
22848 int __pyx_clineno = 0;
22850 __Pyx_RefNannyDeclarations
22851 __Pyx_RefNannySetupContext(
"__cinit__ (wrapper)", 0);
22852 #if !CYTHON_VECTORCALL_TPNEW
22853 #if CYTHON_ASSUME_SAFE_SIZE
22854 __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
22856 __pyx_nargs = PyTuple_Size(__pyx_args);
if (unlikely(__pyx_nargs < 0))
return -1;
22859 __pyx_kwvalues = __Pyx_KwValues_FASTCALL_TPNEW(__pyx_args, __pyx_nargs);
22861 PyObject **
const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_nr,&__pyx_mstate_global->__pyx_n_u_nc,&__pyx_mstate_global->__pyx_n_u_nnz,&__pyx_mstate_global->__pyx_n_u_nzval,&__pyx_mstate_global->__pyx_n_u_colind,&__pyx_mstate_global->__pyx_n_u_rowptr,0};
22862 const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL_TPNEW(__pyx_kwds) : 0;
22863 if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(0, 102, __pyx_L3_error)
22864 if (__pyx_kwds_len > 0) {
22865 switch (__pyx_nargs) {
22867 values[5] = __Pyx_ArgRef_FASTCALL_TPNEW(__pyx_args, 5);
22868 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[5])) __PYX_ERR(0, 102, __pyx_L3_error)
22869 CYTHON_FALLTHROUGH;
22871 values[4] = __Pyx_ArgRef_FASTCALL_TPNEW(__pyx_args, 4);
22872 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 102, __pyx_L3_error)
22873 CYTHON_FALLTHROUGH;
22875 values[3] = __Pyx_ArgRef_FASTCALL_TPNEW(__pyx_args, 3);
22876 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 102, __pyx_L3_error)
22877 CYTHON_FALLTHROUGH;
22879 values[2] = __Pyx_ArgRef_FASTCALL_TPNEW(__pyx_args, 2);
22880 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 102, __pyx_L3_error)
22881 CYTHON_FALLTHROUGH;
22883 values[1] = __Pyx_ArgRef_FASTCALL_TPNEW(__pyx_args, 1);
22884 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 102, __pyx_L3_error)
22885 CYTHON_FALLTHROUGH;
22887 values[0] = __Pyx_ArgRef_FASTCALL_TPNEW(__pyx_args, 0);
22888 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 102, __pyx_L3_error)
22889 CYTHON_FALLTHROUGH;
22891 default:
goto __pyx_L5_argtuple_error;
22893 const Py_ssize_t kwd_pos_args = __pyx_nargs;
22894 if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len,
"__cinit__", 0) < (0)) __PYX_ERR(0, 102, __pyx_L3_error)
22895 for (Py_ssize_t i = __pyx_nargs; i < 6; i++) {
22896 if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid(
"__cinit__", 1, 6, 6, i); __PYX_ERR(0, 102, __pyx_L3_error) }
22898 }
else if (unlikely(__pyx_nargs != 6)) {
22899 goto __pyx_L5_argtuple_error;
22901 values[0] = __Pyx_ArgRef_FASTCALL_TPNEW(__pyx_args, 0);
22902 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 102, __pyx_L3_error)
22903 values[1] = __Pyx_ArgRef_FASTCALL_TPNEW(__pyx_args, 1);
22904 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 102, __pyx_L3_error)
22905 values[2] = __Pyx_ArgRef_FASTCALL_TPNEW(__pyx_args, 2);
22906 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 102, __pyx_L3_error)
22907 values[3] = __Pyx_ArgRef_FASTCALL_TPNEW(__pyx_args, 3);
22908 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 102, __pyx_L3_error)
22909 values[4] = __Pyx_ArgRef_FASTCALL_TPNEW(__pyx_args, 4);
22910 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 102, __pyx_L3_error)
22911 values[5] = __Pyx_ArgRef_FASTCALL_TPNEW(__pyx_args, 5);
22912 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[5])) __PYX_ERR(0, 102, __pyx_L3_error)
22914 __pyx_v_nr = __Pyx_PyLong_As_int(values[0]);
if (unlikely((__pyx_v_nr == (
int)-1) && PyErr_Occurred())) __PYX_ERR(0, 103, __pyx_L3_error)
22915 __pyx_v_nc = __Pyx_PyLong_As_int(values[1]);
if (unlikely((__pyx_v_nc == (
int)-1) && PyErr_Occurred())) __PYX_ERR(0, 104, __pyx_L3_error)
22916 __pyx_v_nnz = __Pyx_PyLong_As_int(values[2]);
if (unlikely((__pyx_v_nnz == (
int)-1) && PyErr_Occurred())) __PYX_ERR(0, 105, __pyx_L3_error)
22917 __pyx_v_nzval = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_float64_t(values[3], PyBUF_WRITABLE);
if (unlikely(!__pyx_v_nzval.memview)) __PYX_ERR(0, 106, __pyx_L3_error)
22918 __pyx_v_colind = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_int32_t(values[4], PyBUF_WRITABLE);
if (unlikely(!__pyx_v_colind.memview)) __PYX_ERR(0, 107, __pyx_L3_error)
22919 __pyx_v_rowptr = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_int32_t(values[5], PyBUF_WRITABLE);
if (unlikely(!__pyx_v_rowptr.memview)) __PYX_ERR(0, 108, __pyx_L3_error)
22921 goto __pyx_L6_skip;
22922 __pyx_L5_argtuple_error:;
22923 __Pyx_RaiseArgtupleInvalid(
"__cinit__", 1, 6, 6, __pyx_nargs); __PYX_ERR(0, 102, __pyx_L3_error)
22925 goto __pyx_L4_argument_unpacking_done;
22927 for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(
sizeof(values)/
sizeof(values[0])); ++__pyx_temp) {
22928 Py_XDECREF(values[__pyx_temp]);
22930 __PYX_XCLEAR_MEMVIEW(&__pyx_v_nzval, 1);
22931 __PYX_XCLEAR_MEMVIEW(&__pyx_v_colind, 1);
22932 __PYX_XCLEAR_MEMVIEW(&__pyx_v_rowptr, 1);
22933 __Pyx_AddTraceback(
"superluWrappers.cSparseMatrix.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
22934 __Pyx_RefNannyFinishContext();
22936 __pyx_L4_argument_unpacking_done:;
22937 __pyx_r = __pyx_pf_15superluWrappers_13cSparseMatrix___cinit__(((
struct __pyx_obj_15superluWrappers_cSparseMatrix *)__pyx_v_self), __pyx_v_nr, __pyx_v_nc, __pyx_v_nnz, __pyx_v_nzval, __pyx_v_colind, __pyx_v_rowptr);
22940 for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(
sizeof(values)/
sizeof(values[0])); ++__pyx_temp) {
22941 Py_XDECREF(values[__pyx_temp]);
22946 __PYX_XCLEAR_MEMVIEW(&__pyx_v_nzval, 1);
22947 __PYX_XCLEAR_MEMVIEW(&__pyx_v_colind, 1);
22948 __PYX_XCLEAR_MEMVIEW(&__pyx_v_rowptr, 1);
22949 __Pyx_RefNannyFinishContext();
22953static int __pyx_pf_15superluWrappers_13cSparseMatrix___cinit__(
struct __pyx_obj_15superluWrappers_cSparseMatrix *__pyx_v_self,
int __pyx_v_nr,
int __pyx_v_nc,
int __pyx_v_nnz, __Pyx_memviewslice __pyx_v_nzval, __Pyx_memviewslice __pyx_v_colind, __Pyx_memviewslice __pyx_v_rowptr) {
22955 Py_ssize_t __pyx_t_1;
22964 (__pyx_v_self->dim[0]) = __pyx_v_nr;
22965 (__pyx_v_self->dim[1]) = __pyx_v_nc;
22974 __pyx_v_self->A.nnz = __pyx_v_nnz;
22984 __pyx_v_self->A.nzval = (&(*((__pyx_t_5numpy_float64_t *) ( (__pyx_v_nzval.data + __pyx_t_1 * __pyx_v_nzval.strides[0]) ))));
22994 __pyx_v_self->A.colind = (&(*((__pyx_t_5numpy_int32_t *) ( (__pyx_v_colind.data + __pyx_t_1 * __pyx_v_colind.strides[0]) ))));
23004 __pyx_v_self->A.rowptr = (&(*((__pyx_t_5numpy_int32_t *) ( (__pyx_v_rowptr.data + __pyx_t_1 * __pyx_v_rowptr.strides[0]) ))));
23027static PyObject *__pyx_pw_15superluWrappers_13cSparseMatrix_3__reduce_cython__(PyObject *__pyx_v_self,
23028#
if CYTHON_VECTORCALL
23029PyObject *
const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
23031PyObject *__pyx_args, PyObject *__pyx_kwds
23034static PyMethodDef __pyx_mdef_15superluWrappers_13cSparseMatrix_3__reduce_cython__ = {
"__reduce_cython__", (PyCFunction)(
void(*)(
void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_15superluWrappers_13cSparseMatrix_3__reduce_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
23035static PyObject *__pyx_pw_15superluWrappers_13cSparseMatrix_3__reduce_cython__(PyObject *__pyx_v_self,
23036#
if CYTHON_VECTORCALL
23037PyObject *
const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
23039PyObject *__pyx_args, PyObject *__pyx_kwds
23042 #if !CYTHON_VECTORCALL
23043 CYTHON_UNUSED Py_ssize_t __pyx_nargs;
23045 CYTHON_UNUSED PyObject *
const *__pyx_kwvalues;
23046 PyObject *__pyx_r = 0;
23047 __Pyx_RefNannyDeclarations
23048 __Pyx_RefNannySetupContext(
"__reduce_cython__ (wrapper)", 0);
23049 #if !CYTHON_VECTORCALL
23050 #if CYTHON_ASSUME_SAFE_SIZE
23051 __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
23053 __pyx_nargs = PyTuple_Size(__pyx_args);
if (unlikely(__pyx_nargs < 0))
return NULL;
23056 __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
23057 if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid(
"__reduce_cython__", 1, 0, 0, __pyx_nargs);
return NULL; }
23058 const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
23059 if (unlikely(__pyx_kwds_len < 0))
return NULL;
23060 if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords(
"__reduce_cython__", __pyx_kwds);
return NULL;}
23061 __pyx_r = __pyx_pf_15superluWrappers_13cSparseMatrix_2__reduce_cython__(((
struct __pyx_obj_15superluWrappers_cSparseMatrix *)__pyx_v_self));
23064 __Pyx_RefNannyFinishContext();
23068static PyObject *__pyx_pf_15superluWrappers_13cSparseMatrix_2__reduce_cython__(CYTHON_UNUSED
struct __pyx_obj_15superluWrappers_cSparseMatrix *__pyx_v_self) {
23069 PyObject *__pyx_r = NULL;
23070 __Pyx_RefNannyDeclarations
23071 int __pyx_lineno = 0;
23072 const char *__pyx_filename = NULL;
23073 int __pyx_clineno = 0;
23074 __Pyx_RefNannySetupContext(
"__reduce_cython__", 0);
23082 __Pyx_Raise(((PyObject *)(((PyTypeObject*)PyExc_TypeError))), __pyx_mstate_global->__pyx_kp_u_no_default___reduce___due_to_non, 0, 0);
23083 __PYX_ERR(1, 2, __pyx_L1_error)
23093 __Pyx_AddTraceback(
"superluWrappers.cSparseMatrix.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
23095 __Pyx_XGIVEREF(__pyx_r);
23096 __Pyx_RefNannyFinishContext();
23108static PyObject *__pyx_pw_15superluWrappers_13cSparseMatrix_5__setstate_cython__(PyObject *__pyx_v_self,
23109#
if CYTHON_VECTORCALL
23110PyObject *
const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
23112PyObject *__pyx_args, PyObject *__pyx_kwds
23115static PyMethodDef __pyx_mdef_15superluWrappers_13cSparseMatrix_5__setstate_cython__ = {
"__setstate_cython__", (PyCFunction)(
void(*)(
void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_15superluWrappers_13cSparseMatrix_5__setstate_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
23116static PyObject *__pyx_pw_15superluWrappers_13cSparseMatrix_5__setstate_cython__(PyObject *__pyx_v_self,
23117#
if CYTHON_VECTORCALL
23118PyObject *
const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
23120PyObject *__pyx_args, PyObject *__pyx_kwds
23123 CYTHON_UNUSED PyObject *__pyx_v___pyx_state = 0;
23124 #if !CYTHON_VECTORCALL
23125 CYTHON_UNUSED Py_ssize_t __pyx_nargs;
23127 CYTHON_UNUSED PyObject *
const *__pyx_kwvalues;
23128 PyObject* values[1] = {0};
23129 int __pyx_lineno = 0;
23130 const char *__pyx_filename = NULL;
23131 int __pyx_clineno = 0;
23132 PyObject *__pyx_r = 0;
23133 __Pyx_RefNannyDeclarations
23134 __Pyx_RefNannySetupContext(
"__setstate_cython__ (wrapper)", 0);
23135 #if !CYTHON_VECTORCALL
23136 #if CYTHON_ASSUME_SAFE_SIZE
23137 __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
23139 __pyx_nargs = PyTuple_Size(__pyx_args);
if (unlikely(__pyx_nargs < 0))
return NULL;
23142 __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
23144 PyObject **
const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_pyx_state,0};
23145 const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
23146 if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(1, 3, __pyx_L3_error)
23147 if (__pyx_kwds_len > 0) {
23148 switch (__pyx_nargs) {
23150 values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
23151 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(1, 3, __pyx_L3_error)
23152 CYTHON_FALLTHROUGH;
23154 default:
goto __pyx_L5_argtuple_error;
23156 const Py_ssize_t kwd_pos_args = __pyx_nargs;
23157 if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len,
"__setstate_cython__", 0) < (0)) __PYX_ERR(1, 3, __pyx_L3_error)
23158 for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
23159 if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid(
"__setstate_cython__", 1, 1, 1, i); __PYX_ERR(1, 3, __pyx_L3_error) }
23161 }
else if (unlikely(__pyx_nargs != 1)) {
23162 goto __pyx_L5_argtuple_error;
23164 values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
23165 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(1, 3, __pyx_L3_error)
23167 __pyx_v___pyx_state = values[0];
23169 goto __pyx_L6_skip;
23170 __pyx_L5_argtuple_error:;
23171 __Pyx_RaiseArgtupleInvalid(
"__setstate_cython__", 1, 1, 1, __pyx_nargs); __PYX_ERR(1, 3, __pyx_L3_error)
23173 goto __pyx_L4_argument_unpacking_done;
23175 for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(
sizeof(values)/
sizeof(values[0])); ++__pyx_temp) {
23176 Py_XDECREF(values[__pyx_temp]);
23178 __Pyx_AddTraceback(
"superluWrappers.cSparseMatrix.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
23179 __Pyx_RefNannyFinishContext();
23181 __pyx_L4_argument_unpacking_done:;
23182 __pyx_r = __pyx_pf_15superluWrappers_13cSparseMatrix_4__setstate_cython__(((
struct __pyx_obj_15superluWrappers_cSparseMatrix *)__pyx_v_self), __pyx_v___pyx_state);
23185 for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(
sizeof(values)/
sizeof(values[0])); ++__pyx_temp) {
23186 Py_XDECREF(values[__pyx_temp]);
23188 __Pyx_RefNannyFinishContext();
23192static PyObject *__pyx_pf_15superluWrappers_13cSparseMatrix_4__setstate_cython__(CYTHON_UNUSED
struct __pyx_obj_15superluWrappers_cSparseMatrix *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) {
23193 PyObject *__pyx_r = NULL;
23194 __Pyx_RefNannyDeclarations
23195 int __pyx_lineno = 0;
23196 const char *__pyx_filename = NULL;
23197 int __pyx_clineno = 0;
23198 __Pyx_RefNannySetupContext(
"__setstate_cython__", 0);
23205 __Pyx_Raise(((PyObject *)(((PyTypeObject*)PyExc_TypeError))), __pyx_mstate_global->__pyx_kp_u_no_default___reduce___due_to_non, 0, 0);
23206 __PYX_ERR(1, 4, __pyx_L1_error)
23217 __Pyx_AddTraceback(
"superluWrappers.cSparseMatrix.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
23219 __Pyx_XGIVEREF(__pyx_r);
23220 __Pyx_RefNannyFinishContext();
23232static void __pyx_f_15superluWrappers_SparseMatrix_matvec(
struct __pyx_obj_15superluWrappers_cSparseMatrix *__pyx_v_sm, __Pyx_memviewslice __pyx_v_xp, __Pyx_memviewslice __pyx_v_yp) {
23233 __pyx_t_5numpy_float64_t __pyx_v_tmp;
23238 __pyx_t_5numpy_int32_t __pyx_t_1;
23239 __pyx_t_5numpy_int32_t __pyx_t_2;
23244 Py_ssize_t __pyx_t_7;
23263 __pyx_t_1 = (__pyx_v_sm->dim[0]);
23264 __pyx_t_2 = __pyx_t_1;
23266 for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) {
23267 __pyx_v_i = __pyx_t_3;
23285 __pyx_v_k_lo = (__pyx_v_sm->A.rowptr[__pyx_v_i]);
23294 __pyx_v_k_hi = (__pyx_v_sm->A.rowptr[(__pyx_v_i + 1)]);
23304 __pyx_t_4 = __pyx_v_k_hi;
23305 __pyx_t_5 = __pyx_t_4;
23307 for (__pyx_t_6 = __pyx_v_k_lo; __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) {
23308 __pyx_v_k = __pyx_t_6;
23317 __pyx_t_7 = (__pyx_v_sm->A.colind[__pyx_v_k]);
23318 __pyx_v_tmp = (__pyx_v_tmp + ((__pyx_v_sm->A.nzval[__pyx_v_k]) * (*((__pyx_t_5numpy_float64_t *) ( (__pyx_v_xp.data + __pyx_t_7 * __pyx_v_xp.strides[0]) )))));
23329 __pyx_t_7 = __pyx_v_i;
23330 *((__pyx_t_5numpy_float64_t *) ( (__pyx_v_yp.data + __pyx_t_7 * __pyx_v_yp.strides[0]) )) = __pyx_v_tmp;
23360static int __pyx_pw_15superluWrappers_12SparseFactor_1__init__(PyObject *__pyx_v_self,
23361#
if CYTHON_VECTORCALL_TPNEW
23362PyObject *
const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
23364PyObject *__pyx_args, PyObject *__pyx_kwds
23367PyDoc_STRVAR(__pyx_doc_15superluWrappers_12SparseFactor___init__,
"\n Arguments\n ---------\n dim : int\n Dimension of the sparse factor.\n ");
23368#if CYTHON_UPDATE_DESCRIPTOR_DOC
23369struct wrapperbase __pyx_wrapperbase_15superluWrappers_12SparseFactor___init__;
23371static int __pyx_pw_15superluWrappers_12SparseFactor_1__init__(PyObject *__pyx_v_self,
23372#
if CYTHON_VECTORCALL_TPNEW
23373PyObject *
const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
23375PyObject *__pyx_args, PyObject *__pyx_kwds
23378 PyObject *__pyx_v_dim = 0;
23379 #if !CYTHON_VECTORCALL_TPNEW
23380 CYTHON_UNUSED Py_ssize_t __pyx_nargs;
23382 CYTHON_UNUSED PyObject *
const *__pyx_kwvalues;
23383 PyObject* values[1] = {0};
23384 int __pyx_lineno = 0;
23385 const char *__pyx_filename = NULL;
23386 int __pyx_clineno = 0;
23388 __Pyx_RefNannyDeclarations
23389 __Pyx_RefNannySetupContext(
"__init__ (wrapper)", 0);
23390 #if !CYTHON_VECTORCALL_TPNEW
23391 #if CYTHON_ASSUME_SAFE_SIZE
23392 __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
23394 __pyx_nargs = PyTuple_Size(__pyx_args);
if (unlikely(__pyx_nargs < 0))
return -1;
23397 __pyx_kwvalues = __Pyx_KwValues_FASTCALL_TPNEW(__pyx_args, __pyx_nargs);
23399 PyObject **
const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_dim,0};
23400 const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL_TPNEW(__pyx_kwds) : 0;
23401 if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(0, 173, __pyx_L3_error)
23402 if (__pyx_kwds_len > 0) {
23403 switch (__pyx_nargs) {
23405 values[0] = __Pyx_ArgRef_FASTCALL_TPNEW(__pyx_args, 0);
23406 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 173, __pyx_L3_error)
23407 CYTHON_FALLTHROUGH;
23409 default:
goto __pyx_L5_argtuple_error;
23411 const Py_ssize_t kwd_pos_args = __pyx_nargs;
23412 if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len,
"__init__", 0) < (0)) __PYX_ERR(0, 173, __pyx_L3_error)
23413 for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
23414 if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid(
"__init__", 1, 1, 1, i); __PYX_ERR(0, 173, __pyx_L3_error) }
23416 }
else if (unlikely(__pyx_nargs != 1)) {
23417 goto __pyx_L5_argtuple_error;
23419 values[0] = __Pyx_ArgRef_FASTCALL_TPNEW(__pyx_args, 0);
23420 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 173, __pyx_L3_error)
23422 __pyx_v_dim = values[0];
23424 goto __pyx_L6_skip;
23425 __pyx_L5_argtuple_error:;
23426 __Pyx_RaiseArgtupleInvalid(
"__init__", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 173, __pyx_L3_error)
23428 goto __pyx_L4_argument_unpacking_done;
23430 for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(
sizeof(values)/
sizeof(values[0])); ++__pyx_temp) {
23431 Py_XDECREF(values[__pyx_temp]);
23433 __Pyx_AddTraceback(
"superluWrappers.SparseFactor.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
23434 __Pyx_RefNannyFinishContext();
23436 __pyx_L4_argument_unpacking_done:;
23437 __pyx_r = __pyx_pf_15superluWrappers_12SparseFactor___init__(((
struct __pyx_obj_15superluWrappers_SparseFactor *)__pyx_v_self), __pyx_v_dim);
23440 for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(
sizeof(values)/
sizeof(values[0])); ++__pyx_temp) {
23441 Py_XDECREF(values[__pyx_temp]);
23443 __Pyx_RefNannyFinishContext();
23447static int __pyx_pf_15superluWrappers_12SparseFactor___init__(
struct __pyx_obj_15superluWrappers_SparseFactor *__pyx_v_self, PyObject *__pyx_v_dim) {
23449 __Pyx_RefNannyDeclarations
23450 PyObject *__pyx_t_1 = NULL;
23452 __pyx_t_5numpy_int32_t __pyx_t_3;
23453 PyObject *__pyx_t_4 = NULL;
23455 int __pyx_lineno = 0;
23456 const char *__pyx_filename = NULL;
23457 int __pyx_clineno = 0;
23458 __Pyx_RefNannySetupContext(
"__init__", 0);
23467 StatInit((&__pyx_v_self->stat));
23476 set_default_options((&__pyx_v_self->options));
23485 __pyx_t_1 = ((
struct __pyx_vtabstruct_15superluWrappers_SparseFactor *)__pyx_v_self->__pyx_vtab)->_set_mat_types(__pyx_v_self);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 182, __pyx_L1_error)
23486 __Pyx_GOTREF(__pyx_t_1);
23487 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
23496 __pyx_t_2 = __Pyx_PyLong_As_int(__pyx_v_dim);
if (unlikely((__pyx_t_2 == (
int)-1) && PyErr_Occurred())) __PYX_ERR(0, 183, __pyx_L1_error)
23497 __pyx_v_self->dim = __pyx_t_2;
23506 __pyx_t_2 = __Pyx_PyLong_As_int(__pyx_v_dim);
if (unlikely((__pyx_t_2 == (
int)-1) && PyErr_Occurred())) __PYX_ERR(0, 184, __pyx_L1_error)
23507 __pyx_v_self->A.nrow = __pyx_t_2;
23508 __pyx_t_2 = __Pyx_PyLong_As_int(__pyx_v_dim);
if (unlikely((__pyx_t_2 == (
int)-1) && PyErr_Occurred())) __PYX_ERR(0, 184, __pyx_L1_error)
23509 __pyx_v_self->A.ncol = __pyx_t_2;
23518 __pyx_t_2 = __Pyx_PyLong_As_int(__pyx_v_dim);
if (unlikely((__pyx_t_2 == (
int)-1) && PyErr_Occurred())) __PYX_ERR(0, 185, __pyx_L1_error)
23519 __pyx_v_self->AC.nrow = __pyx_t_2;
23520 __pyx_t_2 = __Pyx_PyLong_As_int(__pyx_v_dim);
if (unlikely((__pyx_t_2 == (
int)-1) && PyErr_Occurred())) __PYX_ERR(0, 185, __pyx_L1_error)
23521 __pyx_v_self->AC.ncol = __pyx_t_2;
23530 __pyx_t_2 = __Pyx_PyLong_As_int(__pyx_v_dim);
if (unlikely((__pyx_t_2 == (
int)-1) && PyErr_Occurred())) __PYX_ERR(0, 186, __pyx_L1_error)
23531 __pyx_v_self->L.nrow = __pyx_t_2;
23532 __pyx_t_2 = __Pyx_PyLong_As_int(__pyx_v_dim);
if (unlikely((__pyx_t_2 == (
int)-1) && PyErr_Occurred())) __PYX_ERR(0, 186, __pyx_L1_error)
23533 __pyx_v_self->L.ncol = __pyx_t_2;
23542 __pyx_t_2 = __Pyx_PyLong_As_int(__pyx_v_dim);
if (unlikely((__pyx_t_2 == (
int)-1) && PyErr_Occurred())) __PYX_ERR(0, 187, __pyx_L1_error)
23543 __pyx_v_self->U.nrow = __pyx_t_2;
23544 __pyx_t_2 = __Pyx_PyLong_As_int(__pyx_v_dim);
if (unlikely((__pyx_t_2 == (
int)-1) && PyErr_Occurred())) __PYX_ERR(0, 187, __pyx_L1_error)
23545 __pyx_v_self->U.ncol = __pyx_t_2;
23554 __pyx_t_2 = __Pyx_PyLong_As_int(__pyx_v_dim);
if (unlikely((__pyx_t_2 == (
int)-1) && PyErr_Occurred())) __PYX_ERR(0, 188, __pyx_L1_error)
23555 __pyx_v_self->X.nrow = __pyx_t_2;
23556 __pyx_v_self->X.ncol = 1;
23565 __pyx_t_3 = __Pyx_PyLong_As_npy_int32(__pyx_v_dim);
if (unlikely((__pyx_t_3 == ((npy_int32)-1)) && PyErr_Occurred())) __PYX_ERR(0, 189, __pyx_L1_error)
23566 __pyx_v_self->storeX.lda = __pyx_t_3;
23575 __pyx_v_self->use_same_perm_c = 0;
23584 __pyx_v_self->use_same_sparsity = 0;
23593 __pyx_t_1 = __Pyx_PyLong_FromSize_t((
sizeof(__pyx_t_5numpy_int32_t)));
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 192, __pyx_L1_error)
23594 __Pyx_GOTREF(__pyx_t_1);
23595 __pyx_t_4 = __Pyx_PyNumber_Multiply_object_int(__pyx_v_dim, __pyx_t_1);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 192, __pyx_L1_error)
23596 __Pyx_GOTREF(__pyx_t_4);
23597 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
23598 __pyx_t_5 = __Pyx_PyLong_As_size_t(__pyx_t_4);
if (unlikely((__pyx_t_5 == (
size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 192, __pyx_L1_error)
23599 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
23600 __pyx_v_self->perm_c = ((
int *)malloc(__pyx_t_5));
23610 __pyx_t_4 = __Pyx_PyLong_FromSize_t((
sizeof(__pyx_t_5numpy_int32_t)));
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 193, __pyx_L1_error)
23611 __Pyx_GOTREF(__pyx_t_4);
23612 __pyx_t_1 = __Pyx_PyNumber_Multiply_object_int(__pyx_v_dim, __pyx_t_4);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 193, __pyx_L1_error)
23613 __Pyx_GOTREF(__pyx_t_1);
23614 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
23615 __pyx_t_5 = __Pyx_PyLong_As_size_t(__pyx_t_1);
if (unlikely((__pyx_t_5 == (
size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 193, __pyx_L1_error)
23616 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
23617 __pyx_v_self->perm_r = ((
int *)malloc(__pyx_t_5));
23627 __pyx_t_1 = __Pyx_PyLong_FromSize_t((
sizeof(__pyx_t_5numpy_int32_t)));
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 194, __pyx_L1_error)
23628 __Pyx_GOTREF(__pyx_t_1);
23629 __pyx_t_4 = __Pyx_PyNumber_Multiply_object_int(__pyx_v_dim, __pyx_t_1);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 194, __pyx_L1_error)
23630 __Pyx_GOTREF(__pyx_t_4);
23631 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
23632 __pyx_t_5 = __Pyx_PyLong_As_size_t(__pyx_t_4);
if (unlikely((__pyx_t_5 == (
size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 194, __pyx_L1_error)
23633 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
23634 __pyx_v_self->etree = ((
int *)malloc(__pyx_t_5));
23649 __Pyx_XDECREF(__pyx_t_1);
23650 __Pyx_XDECREF(__pyx_t_4);
23651 __Pyx_AddTraceback(
"superluWrappers.SparseFactor.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
23655 __Pyx_RefNannyFinishContext();
23667static PyObject *__pyx_f_15superluWrappers_12SparseFactor__set_mat_types(
struct __pyx_obj_15superluWrappers_SparseFactor *__pyx_v_self) {
23668 PyObject *__pyx_r = NULL;
23669 __Pyx_RefNannyDeclarations
23670 __Pyx_RefNannySetupContext(
"_set_mat_types", 0);
23679 __pyx_v_self->A.Stype = SLU_NC;
23688 __pyx_v_self->A.Dtype = SLU_D;
23697 __pyx_v_self->A.Mtype = SLU_GE;
23706 __pyx_v_self->A.Store = (&__pyx_v_self->storeA);
23715 __pyx_v_self->AC.Stype = SLU_NCP;
23724 __pyx_v_self->AC.Dtype = SLU_D;
23733 __pyx_v_self->AC.Mtype = SLU_GE;
23742 __pyx_v_self->AC.Store = NULL;
23751 __pyx_v_self->L.Stype = SLU_NC;
23760 __pyx_v_self->L.Dtype = SLU_D;
23769 __pyx_v_self->L.Mtype = SLU_TRLU;
23778 __pyx_v_self->L.Store = NULL;
23787 __pyx_v_self->U.Stype = SLU_NC;
23796 __pyx_v_self->U.Dtype = SLU_D;
23805 __pyx_v_self->U.Mtype = SLU_TRU;
23814 __pyx_v_self->U.Store = NULL;
23823 __pyx_v_self->X.Stype = SLU_DN;
23832 __pyx_v_self->X.Dtype = SLU_D;
23841 __pyx_v_self->X.Mtype = SLU_GE;
23850 __pyx_v_self->X.Store = (&__pyx_v_self->storeX);
23861 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
23862 __Pyx_XGIVEREF(__pyx_r);
23863 __Pyx_RefNannyFinishContext();
23876static PyObject *__pyx_pw_15superluWrappers_12SparseFactor_3dim_1__get__(PyObject *__pyx_v_self);
23877static PyObject *__pyx_pw_15superluWrappers_12SparseFactor_3dim_1__get__(PyObject *__pyx_v_self) {
23878 CYTHON_UNUSED PyObject *
const *__pyx_kwvalues;
23879 PyObject *__pyx_r = 0;
23880 __Pyx_RefNannyDeclarations
23881 __Pyx_RefNannySetupContext(
"__get__ (wrapper)", 0);
23882 __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
23883 __pyx_r = __pyx_pf_15superluWrappers_12SparseFactor_3dim___get__(((
struct __pyx_obj_15superluWrappers_SparseFactor *)__pyx_v_self));
23886 __Pyx_RefNannyFinishContext();
23890static PyObject *__pyx_pf_15superluWrappers_12SparseFactor_3dim___get__(
struct __pyx_obj_15superluWrappers_SparseFactor *__pyx_v_self) {
23891 PyObject *__pyx_r = NULL;
23892 __Pyx_RefNannyDeclarations
23893 PyObject *__pyx_t_1 = NULL;
23894 PyObject *__pyx_t_2 = NULL;
23895 PyObject *__pyx_t_3 = NULL;
23896 int __pyx_lineno = 0;
23897 const char *__pyx_filename = NULL;
23898 int __pyx_clineno = 0;
23899 __Pyx_RefNannySetupContext(
"__get__", 0);
23901 __Pyx_PyCriticalSection __pyx_cs;
23902 __pyx_t_1 = ((PyObject *)__pyx_v_self);
23903 __Pyx_INCREF(__pyx_t_1);
23904 __Pyx_PyCriticalSection_Begin(&__pyx_cs, (PyObject*)__pyx_t_1);
23906 __pyx_t_2 = __Pyx_PyLong_From_int(__pyx_v_self->dim);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 171, __pyx_L4_error)
23907 __Pyx_GOTREF(__pyx_t_2);
23909 PyObject *__pyx_temp;
23911 __pyx_temp = __pyx_r;
23912 __pyx_r = __pyx_t_2;
23914 __Pyx_XDECREF(__pyx_temp);
23917 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
23918 goto __pyx_L3_return;
23922 __pyx_t_3 = __pyx_r;
23924 __Pyx_PyCriticalSection_End(&__pyx_cs);
23925 __pyx_r = __pyx_t_3;
23930 __Pyx_PyCriticalSection_End(&__pyx_cs);
23931 goto __pyx_L1_error;
23934 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
23939 __Pyx_XDECREF(__pyx_t_1);
23940 __Pyx_XDECREF(__pyx_t_2);
23941 __Pyx_AddTraceback(
"superluWrappers.SparseFactor.dim.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
23944 __Pyx_XGIVEREF(__pyx_r);
23945 __Pyx_RefNannyFinishContext();
23950static int __pyx_pw_15superluWrappers_12SparseFactor_3dim_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value);
23951static int __pyx_pw_15superluWrappers_12SparseFactor_3dim_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
23952 CYTHON_UNUSED PyObject *
const *__pyx_kwvalues;
23954 __Pyx_RefNannyDeclarations
23955 __Pyx_RefNannySetupContext(
"__set__ (wrapper)", 0);
23956 __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
23957 __pyx_r = __pyx_pf_15superluWrappers_12SparseFactor_3dim_2__set__(((
struct __pyx_obj_15superluWrappers_SparseFactor *)__pyx_v_self), ((PyObject *)__pyx_v_value));
23960 __Pyx_RefNannyFinishContext();
23964static int __pyx_pf_15superluWrappers_12SparseFactor_3dim_2__set__(
struct __pyx_obj_15superluWrappers_SparseFactor *__pyx_v_self, PyObject *__pyx_v_value) {
23966 __Pyx_RefNannyDeclarations
23967 PyObject *__pyx_t_1 = NULL;
23969 int __pyx_lineno = 0;
23970 const char *__pyx_filename = NULL;
23971 int __pyx_clineno = 0;
23972 __Pyx_RefNannySetupContext(
"__set__", 0);
23974 __Pyx_PyCriticalSection __pyx_cs;
23975 __pyx_t_1 = ((PyObject *)__pyx_v_self);
23976 __Pyx_INCREF(__pyx_t_1);
23977 __Pyx_PyCriticalSection_Begin(&__pyx_cs, (PyObject*)__pyx_t_1);
23979 __pyx_t_2 = __Pyx_PyLong_As_int(__pyx_v_value);
if (unlikely((__pyx_t_2 == (
int)-1) && PyErr_Occurred())) __PYX_ERR(0, 171, __pyx_L4_error)
23980 __pyx_v_self->dim = __pyx_t_2;
23984 __Pyx_PyCriticalSection_End(&__pyx_cs);
23988 __Pyx_PyCriticalSection_End(&__pyx_cs);
23989 goto __pyx_L1_error;
23993 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
24000 __Pyx_XDECREF(__pyx_t_1);
24001 __Pyx_AddTraceback(
"superluWrappers.SparseFactor.dim.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
24005 __Pyx_RefNannyFinishContext();
24016static PyObject *__pyx_pw_15superluWrappers_12SparseFactor_3__reduce_cython__(PyObject *__pyx_v_self,
24017#
if CYTHON_VECTORCALL
24018PyObject *
const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
24020PyObject *__pyx_args, PyObject *__pyx_kwds
24023static PyMethodDef __pyx_mdef_15superluWrappers_12SparseFactor_3__reduce_cython__ = {
"__reduce_cython__", (PyCFunction)(
void(*)(
void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_15superluWrappers_12SparseFactor_3__reduce_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
24024static PyObject *__pyx_pw_15superluWrappers_12SparseFactor_3__reduce_cython__(PyObject *__pyx_v_self,
24025#
if CYTHON_VECTORCALL
24026PyObject *
const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
24028PyObject *__pyx_args, PyObject *__pyx_kwds
24031 #if !CYTHON_VECTORCALL
24032 CYTHON_UNUSED Py_ssize_t __pyx_nargs;
24034 CYTHON_UNUSED PyObject *
const *__pyx_kwvalues;
24035 PyObject *__pyx_r = 0;
24036 __Pyx_RefNannyDeclarations
24037 __Pyx_RefNannySetupContext(
"__reduce_cython__ (wrapper)", 0);
24038 #if !CYTHON_VECTORCALL
24039 #if CYTHON_ASSUME_SAFE_SIZE
24040 __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
24042 __pyx_nargs = PyTuple_Size(__pyx_args);
if (unlikely(__pyx_nargs < 0))
return NULL;
24045 __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
24046 if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid(
"__reduce_cython__", 1, 0, 0, __pyx_nargs);
return NULL; }
24047 const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
24048 if (unlikely(__pyx_kwds_len < 0))
return NULL;
24049 if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords(
"__reduce_cython__", __pyx_kwds);
return NULL;}
24050 __pyx_r = __pyx_pf_15superluWrappers_12SparseFactor_2__reduce_cython__(((
struct __pyx_obj_15superluWrappers_SparseFactor *)__pyx_v_self));
24053 __Pyx_RefNannyFinishContext();
24057static PyObject *__pyx_pf_15superluWrappers_12SparseFactor_2__reduce_cython__(CYTHON_UNUSED
struct __pyx_obj_15superluWrappers_SparseFactor *__pyx_v_self) {
24058 PyObject *__pyx_r = NULL;
24059 __Pyx_RefNannyDeclarations
24060 int __pyx_lineno = 0;
24061 const char *__pyx_filename = NULL;
24062 int __pyx_clineno = 0;
24063 __Pyx_RefNannySetupContext(
"__reduce_cython__", 0);
24071 __Pyx_Raise(((PyObject *)(((PyTypeObject*)PyExc_TypeError))), __pyx_mstate_global->__pyx_kp_u_self_A_self_AC_self_L_self_U_sel, 0, 0);
24072 __PYX_ERR(1, 2, __pyx_L1_error)
24082 __Pyx_AddTraceback(
"superluWrappers.SparseFactor.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
24084 __Pyx_XGIVEREF(__pyx_r);
24085 __Pyx_RefNannyFinishContext();
24097static PyObject *__pyx_pw_15superluWrappers_12SparseFactor_5__setstate_cython__(PyObject *__pyx_v_self,
24098#
if CYTHON_VECTORCALL
24099PyObject *
const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
24101PyObject *__pyx_args, PyObject *__pyx_kwds
24104static PyMethodDef __pyx_mdef_15superluWrappers_12SparseFactor_5__setstate_cython__ = {
"__setstate_cython__", (PyCFunction)(
void(*)(
void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_15superluWrappers_12SparseFactor_5__setstate_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
24105static PyObject *__pyx_pw_15superluWrappers_12SparseFactor_5__setstate_cython__(PyObject *__pyx_v_self,
24106#
if CYTHON_VECTORCALL
24107PyObject *
const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
24109PyObject *__pyx_args, PyObject *__pyx_kwds
24112 CYTHON_UNUSED PyObject *__pyx_v___pyx_state = 0;
24113 #if !CYTHON_VECTORCALL
24114 CYTHON_UNUSED Py_ssize_t __pyx_nargs;
24116 CYTHON_UNUSED PyObject *
const *__pyx_kwvalues;
24117 PyObject* values[1] = {0};
24118 int __pyx_lineno = 0;
24119 const char *__pyx_filename = NULL;
24120 int __pyx_clineno = 0;
24121 PyObject *__pyx_r = 0;
24122 __Pyx_RefNannyDeclarations
24123 __Pyx_RefNannySetupContext(
"__setstate_cython__ (wrapper)", 0);
24124 #if !CYTHON_VECTORCALL
24125 #if CYTHON_ASSUME_SAFE_SIZE
24126 __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
24128 __pyx_nargs = PyTuple_Size(__pyx_args);
if (unlikely(__pyx_nargs < 0))
return NULL;
24131 __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
24133 PyObject **
const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_pyx_state,0};
24134 const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
24135 if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(1, 3, __pyx_L3_error)
24136 if (__pyx_kwds_len > 0) {
24137 switch (__pyx_nargs) {
24139 values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
24140 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(1, 3, __pyx_L3_error)
24141 CYTHON_FALLTHROUGH;
24143 default:
goto __pyx_L5_argtuple_error;
24145 const Py_ssize_t kwd_pos_args = __pyx_nargs;
24146 if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len,
"__setstate_cython__", 0) < (0)) __PYX_ERR(1, 3, __pyx_L3_error)
24147 for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
24148 if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid(
"__setstate_cython__", 1, 1, 1, i); __PYX_ERR(1, 3, __pyx_L3_error) }
24150 }
else if (unlikely(__pyx_nargs != 1)) {
24151 goto __pyx_L5_argtuple_error;
24153 values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
24154 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(1, 3, __pyx_L3_error)
24156 __pyx_v___pyx_state = values[0];
24158 goto __pyx_L6_skip;
24159 __pyx_L5_argtuple_error:;
24160 __Pyx_RaiseArgtupleInvalid(
"__setstate_cython__", 1, 1, 1, __pyx_nargs); __PYX_ERR(1, 3, __pyx_L3_error)
24162 goto __pyx_L4_argument_unpacking_done;
24164 for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(
sizeof(values)/
sizeof(values[0])); ++__pyx_temp) {
24165 Py_XDECREF(values[__pyx_temp]);
24167 __Pyx_AddTraceback(
"superluWrappers.SparseFactor.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
24168 __Pyx_RefNannyFinishContext();
24170 __pyx_L4_argument_unpacking_done:;
24171 __pyx_r = __pyx_pf_15superluWrappers_12SparseFactor_4__setstate_cython__(((
struct __pyx_obj_15superluWrappers_SparseFactor *)__pyx_v_self), __pyx_v___pyx_state);
24174 for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(
sizeof(values)/
sizeof(values[0])); ++__pyx_temp) {
24175 Py_XDECREF(values[__pyx_temp]);
24177 __Pyx_RefNannyFinishContext();
24181static PyObject *__pyx_pf_15superluWrappers_12SparseFactor_4__setstate_cython__(CYTHON_UNUSED
struct __pyx_obj_15superluWrappers_SparseFactor *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) {
24182 PyObject *__pyx_r = NULL;
24183 __Pyx_RefNannyDeclarations
24184 int __pyx_lineno = 0;
24185 const char *__pyx_filename = NULL;
24186 int __pyx_clineno = 0;
24187 __Pyx_RefNannySetupContext(
"__setstate_cython__", 0);
24194 __Pyx_Raise(((PyObject *)(((PyTypeObject*)PyExc_TypeError))), __pyx_mstate_global->__pyx_kp_u_self_A_self_AC_self_L_self_U_sel, 0, 0);
24195 __PYX_ERR(1, 4, __pyx_L1_error)
24206 __Pyx_AddTraceback(
"superluWrappers.SparseFactor.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
24208 __Pyx_XGIVEREF(__pyx_r);
24209 __Pyx_RefNannyFinishContext();
24222static PyObject *__pyx_pw_15superluWrappers_1sparseFactorPrepare(PyObject *__pyx_self,
24223#
if CYTHON_VECTORCALL
24224PyObject *
const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
24226PyObject *__pyx_args, PyObject *__pyx_kwds
24229PyDoc_STRVAR(__pyx_doc_15superluWrappers_sparseFactorPrepare,
" Python wrapper for superlu Sparse Factor Prepare function.\n\n Arguments\n ---------\n sparse_matrix : superluWrappers.SparseMatrix\n sparseFactor: superluWrappers.SparseFactor\n\n ");
24230static PyMethodDef __pyx_mdef_15superluWrappers_1sparseFactorPrepare = {
"sparseFactorPrepare", (PyCFunction)(
void(*)(
void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_15superluWrappers_1sparseFactorPrepare, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_15superluWrappers_sparseFactorPrepare};
24231static PyObject *__pyx_pw_15superluWrappers_1sparseFactorPrepare(PyObject *__pyx_self,
24232#
if CYTHON_VECTORCALL
24233PyObject *
const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
24235PyObject *__pyx_args, PyObject *__pyx_kwds
24238 PyObject *__pyx_v_sparse_matrix = 0;
24239 PyObject *__pyx_v_sparseFactor = 0;
24240 #if !CYTHON_VECTORCALL
24241 CYTHON_UNUSED Py_ssize_t __pyx_nargs;
24243 CYTHON_UNUSED PyObject *
const *__pyx_kwvalues;
24244 PyObject* values[2] = {0,0};
24245 int __pyx_lineno = 0;
24246 const char *__pyx_filename = NULL;
24247 int __pyx_clineno = 0;
24248 PyObject *__pyx_r = 0;
24249 __Pyx_RefNannyDeclarations
24250 __Pyx_RefNannySetupContext(
"sparseFactorPrepare (wrapper)", 0);
24251 #if !CYTHON_VECTORCALL
24252 #if CYTHON_ASSUME_SAFE_SIZE
24253 __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
24255 __pyx_nargs = PyTuple_Size(__pyx_args);
if (unlikely(__pyx_nargs < 0))
return NULL;
24258 __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
24260 PyObject **
const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_sparse_matrix,&__pyx_mstate_global->__pyx_n_u_sparseFactor,0};
24261 const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
24262 if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(0, 222, __pyx_L3_error)
24263 if (__pyx_kwds_len > 0) {
24264 switch (__pyx_nargs) {
24266 values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
24267 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 222, __pyx_L3_error)
24268 CYTHON_FALLTHROUGH;
24270 values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
24271 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 222, __pyx_L3_error)
24272 CYTHON_FALLTHROUGH;
24274 default:
goto __pyx_L5_argtuple_error;
24276 const Py_ssize_t kwd_pos_args = __pyx_nargs;
24277 if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len,
"sparseFactorPrepare", 0) < (0)) __PYX_ERR(0, 222, __pyx_L3_error)
24278 for (Py_ssize_t i = __pyx_nargs; i < 2; i++) {
24279 if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid(
"sparseFactorPrepare", 1, 2, 2, i); __PYX_ERR(0, 222, __pyx_L3_error) }
24281 }
else if (unlikely(__pyx_nargs != 2)) {
24282 goto __pyx_L5_argtuple_error;
24284 values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
24285 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 222, __pyx_L3_error)
24286 values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
24287 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 222, __pyx_L3_error)
24289 __pyx_v_sparse_matrix = values[0];
24290 __pyx_v_sparseFactor = values[1];
24292 goto __pyx_L6_skip;
24293 __pyx_L5_argtuple_error:;
24294 __Pyx_RaiseArgtupleInvalid(
"sparseFactorPrepare", 1, 2, 2, __pyx_nargs); __PYX_ERR(0, 222, __pyx_L3_error)
24296 goto __pyx_L4_argument_unpacking_done;
24298 for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(
sizeof(values)/
sizeof(values[0])); ++__pyx_temp) {
24299 Py_XDECREF(values[__pyx_temp]);
24301 __Pyx_AddTraceback(
"superluWrappers.sparseFactorPrepare", __pyx_clineno, __pyx_lineno, __pyx_filename);
24302 __Pyx_RefNannyFinishContext();
24304 __pyx_L4_argument_unpacking_done:;
24305 __pyx_r = __pyx_pf_15superluWrappers_sparseFactorPrepare(__pyx_self, __pyx_v_sparse_matrix, __pyx_v_sparseFactor);
24308 for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(
sizeof(values)/
sizeof(values[0])); ++__pyx_temp) {
24309 Py_XDECREF(values[__pyx_temp]);
24311 __Pyx_RefNannyFinishContext();
24315static PyObject *__pyx_pf_15superluWrappers_sparseFactorPrepare(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_sparse_matrix, PyObject *__pyx_v_sparseFactor) {
24316 PyObject *__pyx_r = NULL;
24317 __Pyx_RefNannyDeclarations
24318 PyObject *__pyx_t_1 = NULL;
24319 int __pyx_lineno = 0;
24320 const char *__pyx_filename = NULL;
24321 int __pyx_clineno = 0;
24322 __Pyx_RefNannySetupContext(
"sparseFactorPrepare", 0);
24331 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_sparse_matrix, __pyx_mstate_global->__pyx_n_u_cSparseMatrix);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 232, __pyx_L1_error)
24332 __Pyx_GOTREF(__pyx_t_1);
24333 if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_mstate_global->__pyx_ptype_15superluWrappers_cSparseMatrix))))) __PYX_ERR(0, 232, __pyx_L1_error)
24342 if (!(likely(((__pyx_v_sparseFactor) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_sparseFactor, __pyx_mstate_global->__pyx_ptype_15superluWrappers_SparseFactor))))) __PYX_ERR(0, 233, __pyx_L1_error)
24351 __pyx_f_15superluWrappers_superluWrappersSparseFactorPrepare(((
struct __pyx_obj_15superluWrappers_cSparseMatrix *)__pyx_t_1), ((
struct __pyx_obj_15superluWrappers_SparseFactor *)__pyx_v_sparseFactor));
if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 232, __pyx_L1_error)
24352 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
24363 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
24366 __Pyx_XDECREF(__pyx_t_1);
24367 __Pyx_AddTraceback(
"superluWrappers.sparseFactorPrepare", __pyx_clineno, __pyx_lineno, __pyx_filename);
24370 __Pyx_XGIVEREF(__pyx_r);
24371 __Pyx_RefNannyFinishContext();
24383static void __pyx_f_15superluWrappers_superluWrappersSparseFactorPrepare(
struct __pyx_obj_15superluWrappers_cSparseMatrix *__pyx_v_sm,
struct __pyx_obj_15superluWrappers_SparseFactor *__pyx_v_sparseFactor) {
24384 int __pyx_v_permc_spec;
24387 int __pyx_v_panel_size;
24390 void *__pyx_v_work;
24391 PyObject *__pyx_v_i = NULL;
24392 __Pyx_RefNannyDeclarations
24393 __pyx_t_5numpy_int32_t __pyx_t_1;
24396 PyObject *__pyx_t_4 = NULL;
24397 PyObject *__pyx_t_5 = NULL;
24398 PyObject *__pyx_t_6 = NULL;
24400 PyObject *(*__pyx_t_8)(PyObject *);
24401 Py_ssize_t __pyx_t_9;
24402 Py_ssize_t __pyx_t_10;
24403 int __pyx_lineno = 0;
24404 const char *__pyx_filename = NULL;
24405 int __pyx_clineno = 0;
24406 __Pyx_RefNannySetupContext(
"superluWrappersSparseFactorPrepare", 0);
24415 __pyx_v_permc_spec = 3;
24433 __pyx_v_panel_size = 10;
24460 __pyx_v_work = NULL;
24469 __pyx_t_1 = __pyx_v_sm->A.nnz;
24471 __pyx_v_sparseFactor->storeA.nnz = __pyx_t_1;
24480 __pyx_v_sparseFactor->storeA.nzval = (&(__pyx_v_sm->A.nzval[0]));
24489 __pyx_v_sparseFactor->storeA.colptr = (&(__pyx_v_sm->A.rowptr[0]));
24498 __pyx_v_sparseFactor->storeA.rowind = (&(__pyx_v_sm->A.colind[0]));
24507 __pyx_t_2 = (__pyx_v_sparseFactor->use_same_perm_c == 0);
24519 get_perm_c(__pyx_v_permc_spec, (&__pyx_v_sparseFactor->A), __pyx_v_sparseFactor->perm_c);
24528 __pyx_v_sparseFactor->use_same_perm_c = 1;
24546 __pyx_t_2 = (__pyx_v_sparseFactor->use_same_sparsity == 0);
24558 __pyx_t_2 = (__pyx_v_sparseFactor->AC.Store != NULL);
24570 Destroy_CompCol_Permuted((&__pyx_v_sparseFactor->AC));
24579 Destroy_SuperNode_Matrix((&__pyx_v_sparseFactor->L));
24588 Destroy_CompCol_Matrix((&__pyx_v_sparseFactor->U));
24606 sp_preorder((&__pyx_v_sparseFactor->options), (&__pyx_v_sparseFactor->A), __pyx_v_sparseFactor->perm_c, __pyx_v_sparseFactor->etree, (&__pyx_v_sparseFactor->AC));
24615 __pyx_v_sparseFactor->use_same_sparsity = 1;
24635 __pyx_v_sparseFactor->options.Fact = SamePattern_SameRowPerm;
24644 __pyx_t_3 = __pyx_v_sparseFactor->A.ncol;
24646 __pyx_v_n = __pyx_t_3;
24656 __pyx_t_6 = __Pyx_PyLong_From_int(__pyx_v_n);
if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 271, __pyx_L1_error)
24657 __Pyx_GOTREF(__pyx_t_6);
24660 PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_t_6};
24661 __pyx_t_4 = __Pyx_PyObject_FastCall((PyObject*)(&PyRange_Type), __pyx_callargs+__pyx_t_7, (2-__pyx_t_7) | (__pyx_t_7*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
24662 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
24663 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
24664 if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 271, __pyx_L1_error)
24665 __Pyx_GOTREF(__pyx_t_4);
24667 __pyx_t_6 = PyObject_GetIter(__pyx_t_4);
if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 271, __pyx_L1_error)
24668 __Pyx_GOTREF(__pyx_t_6);
24669 __pyx_t_8 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_6);
if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 271, __pyx_L1_error)
24670 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
24673 __pyx_t_4 = __pyx_t_8(__pyx_t_6);
24674 if (unlikely(!__pyx_t_4)) {
24675 PyObject* exc_type = PyErr_Occurred();
24677 if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 271, __pyx_L1_error)
24683 __Pyx_GOTREF(__pyx_t_4);
24684 if (__Pyx_PyInt_FromNumber(&__pyx_t_4, NULL, 1) < (0)) __PYX_ERR(0, 271, __pyx_L1_error)
24685 __Pyx_XDECREF_SET(__pyx_v_i, ((PyObject*)__pyx_t_4));
24695 __pyx_t_9 = __Pyx_PyIndex_AsSsize_t(__pyx_v_i);
if (unlikely((__pyx_t_9 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 272, __pyx_L1_error)
24696 __pyx_t_10 = __Pyx_PyIndex_AsSsize_t(__pyx_v_i);
if (unlikely((__pyx_t_10 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 272, __pyx_L1_error)
24697 (((
struct __pyx_t_15superluWrappers__NCPformat *)__pyx_v_sparseFactor->AC.Store)->colbeg[(__pyx_v_sparseFactor->perm_c[__pyx_t_10])]) = (((
struct __pyx_t_15superluWrappers__NCformat *)__pyx_v_sparseFactor->A.Store)->colptr[__pyx_t_9]);
24708 __pyx_t_4 = __Pyx_PyLong_AddObjC(__pyx_v_i, __pyx_mstate_global->__pyx_int_1, 1, 0, 0);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 273, __pyx_L1_error)
24709 __Pyx_GOTREF(__pyx_t_4);
24710 __pyx_t_9 = __Pyx_PyIndex_AsSsize_t(__pyx_t_4);
if (unlikely((__pyx_t_9 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 273, __pyx_L1_error)
24711 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
24712 __pyx_t_10 = __Pyx_PyIndex_AsSsize_t(__pyx_v_i);
if (unlikely((__pyx_t_10 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 273, __pyx_L1_error)
24713 (((
struct __pyx_t_15superluWrappers__NCPformat *)__pyx_v_sparseFactor->AC.Store)->colend[(__pyx_v_sparseFactor->perm_c[__pyx_t_10])]) = (((
struct __pyx_t_15superluWrappers__NCformat *)__pyx_v_sparseFactor->A.Store)->colptr[__pyx_t_9]);
24725 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
24736 dgstrf((&__pyx_v_sparseFactor->options), (&__pyx_v_sparseFactor->AC), __pyx_v_relax, __pyx_v_panel_size, __pyx_v_sparseFactor->etree, __pyx_v_work, __pyx_v_lwork, __pyx_v_sparseFactor->perm_c, __pyx_v_sparseFactor->perm_r, (&__pyx_v_sparseFactor->L), (&__pyx_v_sparseFactor->U), (&__pyx_v_sparseFactor->Glu), (&__pyx_v_sparseFactor->stat), (&__pyx_v_info));
24749 __Pyx_XDECREF(__pyx_t_4);
24750 __Pyx_XDECREF(__pyx_t_5);
24751 __Pyx_XDECREF(__pyx_t_6);
24752 __Pyx_AddTraceback(
"superluWrappers.superluWrappersSparseFactorPrepare", __pyx_clineno, __pyx_lineno, __pyx_filename);
24761 __Pyx_XDECREF(__pyx_v_i);
24763 __Pyx_RefNannyFinishContext();
24775static PyObject *__pyx_pw_15superluWrappers_3sparseFactorSolve(PyObject *__pyx_self,
24776#
if CYTHON_VECTORCALL
24777PyObject *
const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
24779PyObject *__pyx_args, PyObject *__pyx_kwds
24782PyDoc_STRVAR(__pyx_doc_15superluWrappers_2sparseFactorSolve,
" Sparse factor solve wrappers\n\n Arguments\n ---------\n sparseFactor : superluWrappers.SparseFactor\n x (input / output) : np.array\n x serves as the right hand side and then becomes the solution\n ");
24783static PyMethodDef __pyx_mdef_15superluWrappers_3sparseFactorSolve = {
"sparseFactorSolve", (PyCFunction)(
void(*)(
void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_15superluWrappers_3sparseFactorSolve, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_15superluWrappers_2sparseFactorSolve};
24784static PyObject *__pyx_pw_15superluWrappers_3sparseFactorSolve(PyObject *__pyx_self,
24785#
if CYTHON_VECTORCALL
24786PyObject *
const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
24788PyObject *__pyx_args, PyObject *__pyx_kwds
24791 PyObject *__pyx_v_sparseFactor = 0;
24792 PyObject *__pyx_v_x = 0;
24793 #if !CYTHON_VECTORCALL
24794 CYTHON_UNUSED Py_ssize_t __pyx_nargs;
24796 CYTHON_UNUSED PyObject *
const *__pyx_kwvalues;
24797 PyObject* values[2] = {0,0};
24798 int __pyx_lineno = 0;
24799 const char *__pyx_filename = NULL;
24800 int __pyx_clineno = 0;
24801 PyObject *__pyx_r = 0;
24802 __Pyx_RefNannyDeclarations
24803 __Pyx_RefNannySetupContext(
"sparseFactorSolve (wrapper)", 0);
24804 #if !CYTHON_VECTORCALL
24805 #if CYTHON_ASSUME_SAFE_SIZE
24806 __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
24808 __pyx_nargs = PyTuple_Size(__pyx_args);
if (unlikely(__pyx_nargs < 0))
return NULL;
24811 __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
24813 PyObject **
const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_sparseFactor,&__pyx_mstate_global->__pyx_n_u_x,0};
24814 const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
24815 if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(0, 289, __pyx_L3_error)
24816 if (__pyx_kwds_len > 0) {
24817 switch (__pyx_nargs) {
24819 values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
24820 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 289, __pyx_L3_error)
24821 CYTHON_FALLTHROUGH;
24823 values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
24824 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 289, __pyx_L3_error)
24825 CYTHON_FALLTHROUGH;
24827 default:
goto __pyx_L5_argtuple_error;
24829 const Py_ssize_t kwd_pos_args = __pyx_nargs;
24830 if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len,
"sparseFactorSolve", 0) < (0)) __PYX_ERR(0, 289, __pyx_L3_error)
24831 for (Py_ssize_t i = __pyx_nargs; i < 2; i++) {
24832 if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid(
"sparseFactorSolve", 1, 2, 2, i); __PYX_ERR(0, 289, __pyx_L3_error) }
24834 }
else if (unlikely(__pyx_nargs != 2)) {
24835 goto __pyx_L5_argtuple_error;
24837 values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
24838 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 289, __pyx_L3_error)
24839 values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
24840 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 289, __pyx_L3_error)
24842 __pyx_v_sparseFactor = values[0];
24843 __pyx_v_x = values[1];
24845 goto __pyx_L6_skip;
24846 __pyx_L5_argtuple_error:;
24847 __Pyx_RaiseArgtupleInvalid(
"sparseFactorSolve", 1, 2, 2, __pyx_nargs); __PYX_ERR(0, 289, __pyx_L3_error)
24849 goto __pyx_L4_argument_unpacking_done;
24851 for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(
sizeof(values)/
sizeof(values[0])); ++__pyx_temp) {
24852 Py_XDECREF(values[__pyx_temp]);
24854 __Pyx_AddTraceback(
"superluWrappers.sparseFactorSolve", __pyx_clineno, __pyx_lineno, __pyx_filename);
24855 __Pyx_RefNannyFinishContext();
24857 __pyx_L4_argument_unpacking_done:;
24858 __pyx_r = __pyx_pf_15superluWrappers_2sparseFactorSolve(__pyx_self, __pyx_v_sparseFactor, __pyx_v_x);
24861 for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(
sizeof(values)/
sizeof(values[0])); ++__pyx_temp) {
24862 Py_XDECREF(values[__pyx_temp]);
24864 __Pyx_RefNannyFinishContext();
24868static PyObject *__pyx_pf_15superluWrappers_2sparseFactorSolve(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_sparseFactor, PyObject *__pyx_v_x) {
24869 PyObject *__pyx_r = NULL;
24870 __Pyx_RefNannyDeclarations
24871 __Pyx_memviewslice __pyx_t_1 = { 0, 0, { 0 }, { 0 }, { 0 } };
24872 int __pyx_lineno = 0;
24873 const char *__pyx_filename = NULL;
24874 int __pyx_clineno = 0;
24875 __Pyx_RefNannySetupContext(
"sparseFactorSolve", 0);
24884 if (!(likely(((__pyx_v_sparseFactor) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_sparseFactor, __pyx_mstate_global->__pyx_ptype_15superluWrappers_SparseFactor))))) __PYX_ERR(0, 299, __pyx_L1_error)
24893 __pyx_t_1 = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_float64_t(__pyx_v_x, PyBUF_WRITABLE);
if (unlikely(!__pyx_t_1.memview)) __PYX_ERR(0, 300, __pyx_L1_error)
24902 __pyx_f_15superluWrappers_superluWrappersSparseFactorSolve(((
struct __pyx_obj_15superluWrappers_SparseFactor *)__pyx_v_sparseFactor), __pyx_t_1);
if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 299, __pyx_L1_error)
24903 __PYX_XCLEAR_MEMVIEW(&__pyx_t_1, 1);; __pyx_t_1.memview = NULL; __pyx_t_1.data = NULL;
24914 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
24917 __PYX_XCLEAR_MEMVIEW(&__pyx_t_1, 1);
24918 __Pyx_AddTraceback(
"superluWrappers.sparseFactorSolve", __pyx_clineno, __pyx_lineno, __pyx_filename);
24921 __Pyx_XGIVEREF(__pyx_r);
24922 __Pyx_RefNannyFinishContext();
24934static void __pyx_f_15superluWrappers_superluWrappersSparseFactorSolve(
struct __pyx_obj_15superluWrappers_SparseFactor *__pyx_v_sparseFactor, __Pyx_memviewslice __pyx_v_x) {
24935 trans_t __pyx_v_trans;
24937 Py_ssize_t __pyx_t_1;
24946 __pyx_v_trans = TRANS;
24965 __pyx_v_sparseFactor->storeX.nzval = (&(*((__pyx_t_5numpy_float64_t *) ( (__pyx_v_x.data + __pyx_t_1 * __pyx_v_x.strides[0]) ))));
24974 dgstrs(__pyx_v_trans, (&__pyx_v_sparseFactor->L), (&__pyx_v_sparseFactor->U), __pyx_v_sparseFactor->perm_c, __pyx_v_sparseFactor->perm_r, (&__pyx_v_sparseFactor->X), (&__pyx_v_sparseFactor->stat), (&__pyx_v_info));
24991static PyObject *__pyx_tp_new__initialisation_15superluWrappers_cSparseMatrix(PyObject *o,
24992#
if CYTHON_VECTORCALL_TPNEW
24993 PyObject *
const *args, Py_ssize_t nargs, PyObject *kwnames
24995 PyObject *a, PyObject *k
24999 int cinit_result = __pyx_pw_15superluWrappers_13cSparseMatrix_1__cinit__(o,
25000#
if CYTHON_VECTORCALL_TPNEW
25001 args, nargs, kwnames
25006 if (unlikely(cinit_result))
goto bad;
25010 Py_DECREF(o); o = 0;
25014static PyObject *__pyx_tp_new_vectorcall_15superluWrappers_cSparseMatrix(PyTypeObject *t,
25015#
if CYTHON_VECTORCALL_TPNEW
25016 PyObject *
const *args, Py_ssize_t nargs, PyObject *kwnames
25018 PyObject *a, PyObject *k
25022 o = __Pyx_AllocateExtensionType(t, 0);
25023 if (unlikely(!o))
return 0;
25024 return __pyx_tp_new__initialisation_15superluWrappers_cSparseMatrix(o,
25025#
if CYTHON_VECTORCALL_TPNEW
25026 args, nargs, kwnames
25033#if CYTHON_VECTORCALL_TPNEW
25034static PyObject *__pyx_tp_new_15superluWrappers_cSparseMatrix(PyTypeObject *t, PyObject *a, PyObject *k) {
25035 return __Pyx_CallTpnewAsVectorcall(__pyx_tp_new_vectorcall_15superluWrappers_cSparseMatrix, t, a, k);
25039#if CYTHON_VECTORCALL_TPNEW
25040static PyObject *__pyx_tp_vectorcall_15superluWrappers_cSparseMatrix(PyObject *t, PyObject *
const *args,
size_t nargsf, PyObject *kwnames) {
25041 if (unlikely((PyTypeObject*)t != __pyx_mstate_global->__pyx_ptype_15superluWrappers_cSparseMatrix || __Pyx_PyType_HasFeature((PyTypeObject*)t, Py_TPFLAGS_IS_ABSTRACT))) {
25042 return __Pyx_CallNewInitFromVectorcall((PyTypeObject*)t, args, nargsf, kwnames);
25044 Py_ssize_t nargs = PyVectorcall_NARGS(nargsf);
25045 PyObject *o = __pyx_tp_new_vectorcall_15superluWrappers_cSparseMatrix((PyTypeObject*)t, args, nargs, kwnames);
25050static void __pyx_tp_dealloc_15superluWrappers_cSparseMatrix(PyObject *o) {
25051 #if CYTHON_USE_TP_FINALIZE
25052 if (unlikely(__Pyx_PyObject_GetSlot(o, tp_finalize, destructor)) && (!PyType_IS_GC(Py_TYPE(o)) || !__Pyx_PyObject_GC_IsFinalized(o))) {
25053 if (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_15superluWrappers_cSparseMatrix) {
25054 if (PyObject_CallFinalizerFromDealloc(o))
return;
25058 PyTypeObject *tp = Py_TYPE(o);
25059 #if CYTHON_USE_TYPE_SLOTS
25063 freefunc tp_free = (freefunc)PyType_GetSlot(tp, Py_tp_free);
25064 if (tp_free) tp_free(o);
25067 #if CYTHON_USE_TYPE_SPECS
25072static PyMethodDef __pyx_methods_15superluWrappers_cSparseMatrix[] = {
25073 {
"__reduce_cython__", (PyCFunction)(
void(*)(
void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_15superluWrappers_13cSparseMatrix_3__reduce_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0},
25074 {
"__setstate_cython__", (PyCFunction)(
void(*)(
void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_15superluWrappers_13cSparseMatrix_5__setstate_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0},
25077#if CYTHON_USE_TYPE_SPECS
25078static PyType_Slot __pyx_type_15superluWrappers_cSparseMatrix_slots[] = {
25079 {Py_tp_dealloc, (
void *)__pyx_tp_dealloc_15superluWrappers_cSparseMatrix},
25080 {Py_tp_methods, (
void *)__pyx_methods_15superluWrappers_cSparseMatrix},
25081 {Py_tp_new, (
void *)__pyx_tp_new_15superluWrappers_cSparseMatrix},
25082 #if (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800) && (!CYTHON_COMPILING_IN_LIMITED_API || __PYX_LIMITED_VERSION_HEX >= 0x030E0000)
25083 #if CYTHON_VECTORCALL_TPNEW
25084 {Py_tp_vectorcall, (
void *)__pyx_tp_vectorcall_15superluWrappers_cSparseMatrix},
25089static PyType_Spec __pyx_type_15superluWrappers_cSparseMatrix_spec = {
25090 "superluWrappers.cSparseMatrix",
25091 sizeof(
struct __pyx_obj_15superluWrappers_cSparseMatrix),
25093 Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_BASETYPE,
25094 __pyx_type_15superluWrappers_cSparseMatrix_slots,
25098static PyTypeObject __pyx_type_15superluWrappers_cSparseMatrix = {
25099 PyVarObject_HEAD_INIT(0, 0)
25100 "superluWrappers.""cSparseMatrix",
25101 sizeof(
struct __pyx_obj_15superluWrappers_cSparseMatrix),
25103 __pyx_tp_dealloc_15superluWrappers_cSparseMatrix,
25118 Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_BASETYPE,
25126 __pyx_methods_15superluWrappers_cSparseMatrix,
25133 #
if !CYTHON_USE_TYPE_SPECS
25138 __pyx_tp_new_15superluWrappers_cSparseMatrix,
25148 #
if CYTHON_USE_TP_FINALIZE
25153 #
if (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800) && (!CYTHON_COMPILING_IN_LIMITED_API || __PYX_LIMITED_VERSION_HEX >= 0x030E0000)
25154 #
if CYTHON_VECTORCALL_TPNEW
25155 __pyx_tp_vectorcall_15superluWrappers_cSparseMatrix,
25160 #
if __PYX_NEED_TP_PRINT_SLOT == 1
25163 #
if PY_VERSION_HEX >= 0x030C0000
25166 #
if PY_VERSION_HEX >= 0x030d00A4
25169 #
if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x030a0000
25174static struct __pyx_vtabstruct_15superluWrappers_SparseFactor __pyx_vtable_15superluWrappers_SparseFactor;
25176static PyObject *__pyx_tp_new__initialisation_15superluWrappers_SparseFactor(PyObject *o,
25177#
if CYTHON_VECTORCALL_TPNEW
25178 CYTHON_UNUSED PyObject *
const *args, CYTHON_UNUSED Py_ssize_t nargs, CYTHON_UNUSED PyObject *kwnames
25180 CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k
25183 struct __pyx_obj_15superluWrappers_SparseFactor *p = ((
struct __pyx_obj_15superluWrappers_SparseFactor *)o);
25184 p->__pyx_vtab = __pyx_vtabptr_15superluWrappers_SparseFactor;
25188static PyObject *__pyx_tp_new_vectorcall_15superluWrappers_SparseFactor(PyTypeObject *t,
25189#
if CYTHON_VECTORCALL_TPNEW
25190 PyObject *
const *args, Py_ssize_t nargs, PyObject *kwnames
25192 PyObject *a, PyObject *k
25196 o = __Pyx_AllocateExtensionType(t, 0);
25197 if (unlikely(!o))
return 0;
25198 return __pyx_tp_new__initialisation_15superluWrappers_SparseFactor(o,
25199#
if CYTHON_VECTORCALL_TPNEW
25200 args, nargs, kwnames
25207#if CYTHON_VECTORCALL_TPNEW
25208static PyObject *__pyx_tp_new_15superluWrappers_SparseFactor(PyTypeObject *t, PyObject *a, PyObject *k) {
25209 return __Pyx_CallTpnewAsVectorcall(__pyx_tp_new_vectorcall_15superluWrappers_SparseFactor, t, a, k);
25213#if CYTHON_VECTORCALL_TPNEW
25214static PyObject *__pyx_tp_vectorcall_15superluWrappers_SparseFactor(PyObject *t, PyObject *
const *args,
size_t nargsf, PyObject *kwnames) {
25215 if (unlikely((PyTypeObject*)t != __pyx_mstate_global->__pyx_ptype_15superluWrappers_SparseFactor || __Pyx_PyType_HasFeature((PyTypeObject*)t, Py_TPFLAGS_IS_ABSTRACT))) {
25216 return __Pyx_CallNewInitFromVectorcall((PyTypeObject*)t, args, nargsf, kwnames);
25218 Py_ssize_t nargs = PyVectorcall_NARGS(nargsf);
25219 PyObject *o = __pyx_tp_new_vectorcall_15superluWrappers_SparseFactor((PyTypeObject*)t, args, nargs, kwnames);
25221 assert(Py_TYPE(o) == (PyTypeObject*)t);
25222 if (unlikely(__pyx_pw_15superluWrappers_12SparseFactor_1__init__(o, args, nargs, kwnames) < 0)) {
25230#if CYTHON_VECTORCALL_TPNEW
25231static int __pyx_tp_init_15superluWrappers_SparseFactor(PyObject *o, PyObject *args, PyObject *kwds) {
25232 return __Pyx_CallTpinitAsVectorcall(__pyx_pw_15superluWrappers_12SparseFactor_1__init__, o, args, kwds);
25236static void __pyx_tp_dealloc_15superluWrappers_SparseFactor(PyObject *o) {
25237 #if CYTHON_USE_TP_FINALIZE
25238 if (unlikely(__Pyx_PyObject_GetSlot(o, tp_finalize, destructor)) && (!PyType_IS_GC(Py_TYPE(o)) || !__Pyx_PyObject_GC_IsFinalized(o))) {
25239 if (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_15superluWrappers_SparseFactor) {
25240 if (PyObject_CallFinalizerFromDealloc(o))
return;
25244 PyTypeObject *tp = Py_TYPE(o);
25245 #if CYTHON_USE_TYPE_SLOTS
25249 freefunc tp_free = (freefunc)PyType_GetSlot(tp, Py_tp_free);
25250 if (tp_free) tp_free(o);
25253 #if CYTHON_USE_TYPE_SPECS
25258static PyObject *__pyx_getprop_15superluWrappers_12SparseFactor_dim(PyObject *o, CYTHON_UNUSED
void *x) {
25259 return __pyx_pw_15superluWrappers_12SparseFactor_3dim_1__get__(o);
25262static int __pyx_setprop_15superluWrappers_12SparseFactor_dim(PyObject *o, PyObject *
v, CYTHON_UNUSED
void *x) {
25264 return __pyx_pw_15superluWrappers_12SparseFactor_3dim_3__set__(o,
v);
25267 PyErr_SetString(PyExc_NotImplementedError,
"__del__");
25272static PyMethodDef __pyx_methods_15superluWrappers_SparseFactor[] = {
25273 {
"__reduce_cython__", (PyCFunction)(
void(*)(
void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_15superluWrappers_12SparseFactor_3__reduce_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0},
25274 {
"__setstate_cython__", (PyCFunction)(
void(*)(
void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_15superluWrappers_12SparseFactor_5__setstate_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0},
25278static struct PyGetSetDef __pyx_getsets_15superluWrappers_SparseFactor[] = {
25279 {
"dim", __pyx_getprop_15superluWrappers_12SparseFactor_dim, __pyx_setprop_15superluWrappers_12SparseFactor_dim, 0, 0},
25282#if CYTHON_USE_TYPE_SPECS
25283static PyType_Slot __pyx_type_15superluWrappers_SparseFactor_slots[] = {
25284 {Py_tp_dealloc, (
void *)__pyx_tp_dealloc_15superluWrappers_SparseFactor},
25285 {Py_tp_methods, (
void *)__pyx_methods_15superluWrappers_SparseFactor},
25286 {Py_tp_getset, (
void *)__pyx_getsets_15superluWrappers_SparseFactor},
25287 {Py_tp_init, (
void *)__pyx_tp_init_15superluWrappers_SparseFactor},
25288 {Py_tp_new, (
void *)__pyx_tp_new_15superluWrappers_SparseFactor},
25289 #if (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800) && (!CYTHON_COMPILING_IN_LIMITED_API || __PYX_LIMITED_VERSION_HEX >= 0x030E0000)
25290 #if CYTHON_VECTORCALL_TPNEW
25291 {Py_tp_vectorcall, (
void *)__pyx_tp_vectorcall_15superluWrappers_SparseFactor},
25296static PyType_Spec __pyx_type_15superluWrappers_SparseFactor_spec = {
25297 "superluWrappers.SparseFactor",
25298 sizeof(
struct __pyx_obj_15superluWrappers_SparseFactor),
25300 Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_BASETYPE,
25301 __pyx_type_15superluWrappers_SparseFactor_slots,
25305static PyTypeObject __pyx_type_15superluWrappers_SparseFactor = {
25306 PyVarObject_HEAD_INIT(0, 0)
25307 "superluWrappers.""SparseFactor",
25308 sizeof(
struct __pyx_obj_15superluWrappers_SparseFactor),
25310 __pyx_tp_dealloc_15superluWrappers_SparseFactor,
25325 Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_BASETYPE,
25333 __pyx_methods_15superluWrappers_SparseFactor,
25335 __pyx_getsets_15superluWrappers_SparseFactor,
25340 #
if !CYTHON_USE_TYPE_SPECS
25343 __pyx_tp_init_15superluWrappers_SparseFactor,
25345 __pyx_tp_new_15superluWrappers_SparseFactor,
25355 #
if CYTHON_USE_TP_FINALIZE
25360 #
if (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800) && (!CYTHON_COMPILING_IN_LIMITED_API || __PYX_LIMITED_VERSION_HEX >= 0x030E0000)
25361 #
if CYTHON_VECTORCALL_TPNEW
25362 __pyx_tp_vectorcall_15superluWrappers_SparseFactor,
25367 #
if __PYX_NEED_TP_PRINT_SLOT == 1
25370 #
if PY_VERSION_HEX >= 0x030C0000
25373 #
if PY_VERSION_HEX >= 0x030d00A4
25376 #
if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x030a0000
25381static struct __pyx_vtabstruct_array __pyx_vtable_array;
25383static PyObject *__pyx_tp_new__initialisation_array(PyObject *o,
25384#
if CYTHON_VECTORCALL_TPNEW
25385 PyObject *
const *args, Py_ssize_t nargs, PyObject *kwnames
25387 PyObject *a, PyObject *k
25390 struct __pyx_array_obj *p = ((
struct __pyx_array_obj *)o);
25391 p->__pyx_vtab = __pyx_vtabptr_array;
25392 p->mode = ((PyObject*)Py_None); Py_INCREF(Py_None);
25393 p->_format = ((PyObject*)Py_None); Py_INCREF(Py_None);
25395 int cinit_result = __pyx_array___cinit__(o,
25396#
if CYTHON_VECTORCALL_TPNEW
25397 args, nargs, kwnames
25402 if (unlikely(cinit_result))
goto bad;
25406 Py_DECREF(o); o = 0;
25410static PyObject *__pyx_tp_new_vectorcall_array(PyTypeObject *t,
25411#
if CYTHON_VECTORCALL_TPNEW
25412 PyObject *
const *args, Py_ssize_t nargs, PyObject *kwnames
25414 PyObject *a, PyObject *k
25418 o = __Pyx_AllocateExtensionType(t, 0);
25419 if (unlikely(!o))
return 0;
25420 return __pyx_tp_new__initialisation_array(o,
25421#
if CYTHON_VECTORCALL_TPNEW
25422 args, nargs, kwnames
25429#if CYTHON_VECTORCALL_TPNEW
25430static PyObject *__pyx_tp_new_array(PyTypeObject *t, PyObject *a, PyObject *k) {
25431 return __Pyx_CallTpnewAsVectorcall(__pyx_tp_new_vectorcall_array, t, a, k);
25435#if CYTHON_VECTORCALL_TPNEW
25436static PyObject *__pyx_tp_vectorcall_array(PyObject *t, PyObject *
const *args,
size_t nargsf, PyObject *kwnames) {
25437 if (unlikely((PyTypeObject*)t != __pyx_mstate_global->__pyx_array_type || __Pyx_PyType_HasFeature((PyTypeObject*)t, Py_TPFLAGS_IS_ABSTRACT))) {
25438 return __Pyx_CallNewInitFromVectorcall((PyTypeObject*)t, args, nargsf, kwnames);
25440 Py_ssize_t nargs = PyVectorcall_NARGS(nargsf);
25441 PyObject *o = __pyx_tp_new_vectorcall_array((PyTypeObject*)t, args, nargs, kwnames);
25446static void __pyx_tp_dealloc_array(PyObject *o) {
25447 struct __pyx_array_obj *p = (
struct __pyx_array_obj *)o;
25448 #if CYTHON_USE_TP_FINALIZE
25449 if (unlikely(__Pyx_PyObject_GetSlot(o, tp_finalize, destructor)) && (!PyType_IS_GC(Py_TYPE(o)) || !__Pyx_PyObject_GC_IsFinalized(o))) {
25450 if (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_array) {
25451 if (PyObject_CallFinalizerFromDealloc(o))
return;
25456 PyObject *etype, *eval, *etb;
25457 __Pyx_PyErr_FetchException(&etype, &eval, &etb);
25458 __Pyx_DeallocKeepAliveBegin(o);
25459 __pyx_array___dealloc__(o);
25460 __Pyx_DeallocKeepAliveEnd(o);
25461 __Pyx_PyErr_RestoreException(etype, eval, etb);
25464 Py_CLEAR(p->_format);
25465 PyTypeObject *tp = Py_TYPE(o);
25466 #if CYTHON_USE_TYPE_SLOTS
25470 freefunc tp_free = (freefunc)PyType_GetSlot(tp, Py_tp_free);
25471 if (tp_free) tp_free(o);
25474 #if CYTHON_USE_TYPE_SPECS
25479static PyObject *__pyx_sq_item_array(PyObject *o, Py_ssize_t i) {
25481 PyObject *x = PyLong_FromSsize_t(i);
if (unlikely(!x))
return NULL;
25482 #if CYTHON_USE_TYPE_SLOTS || (!CYTHON_USE_TYPE_SPECS && __PYX_LIMITED_VERSION_HEX < 0x030A0000)
25483 binaryfunc
f = Py_TYPE(o)->tp_as_mapping->mp_subscript;
25485 binaryfunc
f = ((binaryfunc)PyType_GetSlot(Py_TYPE(o), Py_mp_subscript));
25492static PyObject *__pyx_mp_subscript_array(PyObject *o, PyObject *i) {
25493 return __pyx_array___getitem__(o, i);
25496static int __pyx_sq_ass_item_array(PyObject *o, Py_ssize_t i, PyObject *
v) {
25498 PyObject *x = PyLong_FromSsize_t(i);
if (unlikely(!x))
return -1;
25499 int r = __pyx_array___setitem__(o, x,
v);
25503 __Pyx_RaiseErrorWithObjectType1(PyExc_NotImplementedError,
"Subscript %.10s not supported by " __Pyx_FMT_TYPENAME,
"deletion", o);
25508static int __pyx_mp_ass_subscript_array(PyObject *o, PyObject *i, PyObject *
v) {
25510 return __pyx_array___setitem__(o, i,
v);
25512 __Pyx_RaiseErrorWithObjectType1(PyExc_NotImplementedError,
"Subscript %.10s not supported by " __Pyx_FMT_TYPENAME,
"deletion", o);
25517static PyObject *__pyx_tp_getattro_array(PyObject *o, PyObject *
n) {
25518 PyObject *
v = PyObject_GenericGetAttr(o,
n);
25519 if (!
v && PyErr_ExceptionMatches(PyExc_AttributeError)) {
25521 v = __pyx_array___getattr__(o,
n);
25526static PyObject *__pyx_getprop___pyx_array_memview(PyObject *o, CYTHON_UNUSED
void *x) {
25527 return __pyx_pw_15View_dot_MemoryView_5array_7memview_1__get__(o);
25530static PyMethodDef __pyx_methods_array[] = {
25531 {
"__getattr__", (PyCFunction)__pyx_array___getattr__, METH_O|METH_COEXIST, 0},
25532 {
"__reduce_cython__", (PyCFunction)(
void(*)(
void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw___pyx_array_1__reduce_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0},
25533 {
"__setstate_cython__", (PyCFunction)(
void(*)(
void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw___pyx_array_3__setstate_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0},
25537static struct PyGetSetDef __pyx_getsets_array[] = {
25538 {
"memview", __pyx_getprop___pyx_array_memview, 0, 0, 0},
25541#if CYTHON_USE_TYPE_SPECS
25542#if !CYTHON_COMPILING_IN_LIMITED_API
25544static PyBufferProcs __pyx_tp_as_buffer_array = {
25545 __pyx_array_getbuffer,
25549static PyType_Slot __pyx_type___pyx_array_slots[] = {
25550 {Py_tp_dealloc, (
void *)__pyx_tp_dealloc_array},
25551 {Py_sq_length, (
void *)__pyx_array___len__},
25552 {Py_sq_item, (
void *)__pyx_sq_item_array},
25553 {Py_sq_ass_item, (
void *)__pyx_sq_ass_item_array},
25554 {Py_mp_length, (
void *)__pyx_array___len__},
25555 {Py_mp_subscript, (
void *)__pyx_mp_subscript_array},
25556 {Py_mp_ass_subscript, (
void *)__pyx_mp_ass_subscript_array},
25557 {Py_tp_getattro, (
void *)__pyx_tp_getattro_array},
25558 #if defined(Py_bf_getbuffer)
25559 {Py_bf_getbuffer, (
void *)__pyx_array_getbuffer},
25561 {Py_tp_methods, (
void *)__pyx_methods_array},
25562 {Py_tp_getset, (
void *)__pyx_getsets_array},
25563 {Py_tp_new, (
void *)__pyx_tp_new_array},
25564 #if (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800) && (!CYTHON_COMPILING_IN_LIMITED_API || __PYX_LIMITED_VERSION_HEX >= 0x030E0000)
25565 #if CYTHON_VECTORCALL_TPNEW
25566 {Py_tp_vectorcall, (
void *)__pyx_tp_vectorcall_array},
25571static PyType_Spec __pyx_type___pyx_array_spec = {
25572 "superluWrappers.array",
25573 sizeof(
struct __pyx_array_obj),
25575 Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_SEQUENCE,
25576 __pyx_type___pyx_array_slots,
25580static PySequenceMethods __pyx_tp_as_sequence_array = {
25581 __pyx_array___len__,
25584 __pyx_sq_item_array,
25586 __pyx_sq_ass_item_array,
25593static PyMappingMethods __pyx_tp_as_mapping_array = {
25594 __pyx_array___len__,
25595 __pyx_mp_subscript_array,
25596 __pyx_mp_ass_subscript_array,
25599static PyBufferProcs __pyx_tp_as_buffer_array = {
25600 __pyx_array_getbuffer,
25604static PyTypeObject __pyx_type___pyx_array = {
25605 PyVarObject_HEAD_INIT(0, 0)
25606 "superluWrappers.""array",
25607 sizeof(
struct __pyx_array_obj),
25609 __pyx_tp_dealloc_array,
25616 &__pyx_tp_as_sequence_array,
25617 &__pyx_tp_as_mapping_array,
25621 __pyx_tp_getattro_array,
25623 &__pyx_tp_as_buffer_array,
25624 Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_SEQUENCE,
25632 __pyx_methods_array,
25634 __pyx_getsets_array,
25639 #
if !CYTHON_USE_TYPE_SPECS
25644 __pyx_tp_new_array,
25654 #
if CYTHON_USE_TP_FINALIZE
25659 #
if (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800) && (!CYTHON_COMPILING_IN_LIMITED_API || __PYX_LIMITED_VERSION_HEX >= 0x030E0000)
25660 #
if CYTHON_VECTORCALL_TPNEW
25661 __pyx_tp_vectorcall_array,
25666 #
if __PYX_NEED_TP_PRINT_SLOT == 1
25669 #
if PY_VERSION_HEX >= 0x030C0000
25672 #
if PY_VERSION_HEX >= 0x030d00A4
25675 #
if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x030a0000
25681static PyObject *__pyx_tp_new__initialisation_Enum(PyObject *o,
25682#
if CYTHON_VECTORCALL_TPNEW
25683 CYTHON_UNUSED PyObject *
const *args, CYTHON_UNUSED Py_ssize_t nargs, CYTHON_UNUSED PyObject *kwnames
25685 CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k
25688 struct __pyx_MemviewEnum_obj *p = ((
struct __pyx_MemviewEnum_obj *)o);
25689 p->name = Py_None; Py_INCREF(Py_None);
25693static PyObject *__pyx_tp_new_vectorcall_Enum(PyTypeObject *t,
25694#
if CYTHON_VECTORCALL_TPNEW
25695 PyObject *
const *args, Py_ssize_t nargs, PyObject *kwnames
25697 PyObject *a, PyObject *k
25701 o = __Pyx_AllocateExtensionType(t, 0);
25702 if (unlikely(!o))
return 0;
25703 return __pyx_tp_new__initialisation_Enum(o,
25704#
if CYTHON_VECTORCALL_TPNEW
25705 args, nargs, kwnames
25712#if CYTHON_VECTORCALL_TPNEW
25713static PyObject *__pyx_tp_new_Enum(PyTypeObject *t, PyObject *a, PyObject *k) {
25714 return __Pyx_CallTpnewAsVectorcall(__pyx_tp_new_vectorcall_Enum, t, a, k);
25718#if CYTHON_VECTORCALL_TPNEW
25719static PyObject *__pyx_tp_vectorcall_Enum(PyObject *t, PyObject *
const *args,
size_t nargsf, PyObject *kwnames) {
25720 if (unlikely((PyTypeObject*)t != __pyx_mstate_global->__pyx_MemviewEnum_type || __Pyx_PyType_HasFeature((PyTypeObject*)t, Py_TPFLAGS_IS_ABSTRACT))) {
25721 return __Pyx_CallNewInitFromVectorcall((PyTypeObject*)t, args, nargsf, kwnames);
25723 Py_ssize_t nargs = PyVectorcall_NARGS(nargsf);
25724 PyObject *o = __pyx_tp_new_vectorcall_Enum((PyTypeObject*)t, args, nargs, kwnames);
25726 assert(Py_TYPE(o) == (PyTypeObject*)t);
25727 if (unlikely(__pyx_MemviewEnum___init__(o, args, nargs, kwnames) < 0)) {
25735#if CYTHON_VECTORCALL_TPNEW
25736static int __pyx_tp_init_Enum(PyObject *o, PyObject *args, PyObject *kwds) {
25737 return __Pyx_CallTpinitAsVectorcall(__pyx_MemviewEnum___init__, o, args, kwds);
25741static void __pyx_tp_dealloc_Enum(PyObject *o) {
25742 struct __pyx_MemviewEnum_obj *p = (
struct __pyx_MemviewEnum_obj *)o;
25743 #if CYTHON_USE_TP_FINALIZE
25744 if (unlikely(__Pyx_PyObject_GetSlot(o, tp_finalize, destructor)) && !__Pyx_PyObject_GC_IsFinalized(o)) {
25745 if (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_Enum) {
25746 if (PyObject_CallFinalizerFromDealloc(o))
return;
25750 PyObject_GC_UnTrack(o);
25752 PyTypeObject *tp = Py_TYPE(o);
25753 #if CYTHON_USE_TYPE_SLOTS
25757 freefunc tp_free = (freefunc)PyType_GetSlot(tp, Py_tp_free);
25758 if (tp_free) tp_free(o);
25761 #if CYTHON_USE_TYPE_SPECS
25766static int __pyx_tp_traverse_Enum(PyObject *o, visitproc
v,
void *a) {
25768 struct __pyx_MemviewEnum_obj *p = (
struct __pyx_MemviewEnum_obj *)o;
25770 e = __Pyx_call_type_traverse(o, 1,
v, a);
25774 e = (*v)(p->name, a);
if (e)
return e;
25779static int __pyx_tp_clear_Enum(PyObject *o) {
25781 struct __pyx_MemviewEnum_obj *p = (
struct __pyx_MemviewEnum_obj *)o;
25782 tmp = ((PyObject*)p->name);
25783 p->name = Py_None; Py_INCREF(Py_None);
25788static PyMethodDef __pyx_methods_Enum[] = {
25789 {
"__reduce_cython__", (PyCFunction)(
void(*)(
void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw___pyx_MemviewEnum_1__reduce_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0},
25790 {
"__setstate_cython__", (PyCFunction)(
void(*)(
void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw___pyx_MemviewEnum_3__setstate_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0},
25793#if CYTHON_USE_TYPE_SPECS
25794static PyType_Slot __pyx_type___pyx_MemviewEnum_slots[] = {
25795 {Py_tp_dealloc, (
void *)__pyx_tp_dealloc_Enum},
25796 {Py_tp_repr, (
void *)__pyx_MemviewEnum___repr__},
25797 {Py_tp_traverse, (
void *)__pyx_tp_traverse_Enum},
25798 {Py_tp_clear, (
void *)__pyx_tp_clear_Enum},
25799 {Py_tp_methods, (
void *)__pyx_methods_Enum},
25800 {Py_tp_init, (
void *)__pyx_tp_init_Enum},
25801 {Py_tp_new, (
void *)__pyx_tp_new_Enum},
25802 #if (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800) && (!CYTHON_COMPILING_IN_LIMITED_API || __PYX_LIMITED_VERSION_HEX >= 0x030E0000)
25803 #if CYTHON_VECTORCALL_TPNEW
25804 {Py_tp_vectorcall, (
void *)__pyx_tp_vectorcall_Enum},
25809static PyType_Spec __pyx_type___pyx_MemviewEnum_spec = {
25810 "superluWrappers.Enum",
25811 sizeof(
struct __pyx_MemviewEnum_obj),
25813 Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC,
25814 __pyx_type___pyx_MemviewEnum_slots,
25818static PyTypeObject __pyx_type___pyx_MemviewEnum = {
25819 PyVarObject_HEAD_INIT(0, 0)
25820 "superluWrappers.""Enum",
25821 sizeof(
struct __pyx_MemviewEnum_obj),
25823 __pyx_tp_dealloc_Enum,
25828 __pyx_MemviewEnum___repr__,
25838 Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC,
25840 __pyx_tp_traverse_Enum,
25841 __pyx_tp_clear_Enum,
25846 __pyx_methods_Enum,
25853 #
if !CYTHON_USE_TYPE_SPECS
25856 __pyx_tp_init_Enum,
25868 #
if CYTHON_USE_TP_FINALIZE
25873 #
if (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800) && (!CYTHON_COMPILING_IN_LIMITED_API || __PYX_LIMITED_VERSION_HEX >= 0x030E0000)
25874 #
if CYTHON_VECTORCALL_TPNEW
25875 __pyx_tp_vectorcall_Enum,
25880 #
if __PYX_NEED_TP_PRINT_SLOT == 1
25883 #
if PY_VERSION_HEX >= 0x030C0000
25886 #
if PY_VERSION_HEX >= 0x030d00A4
25889 #
if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x030a0000
25894static struct __pyx_vtabstruct_memoryview __pyx_vtable_memoryview;
25896static PyObject *__pyx_tp_new__initialisation_memoryview(PyObject *o,
25897#
if CYTHON_VECTORCALL_TPNEW
25898 PyObject *
const *args, Py_ssize_t nargs, PyObject *kwnames
25900 PyObject *a, PyObject *k
25903 struct __pyx_memoryview_obj *p = ((
struct __pyx_memoryview_obj *)o);
25904 p->__pyx_vtab = __pyx_vtabptr_memoryview;
25905 p->obj = Py_None; Py_INCREF(Py_None);
25906 p->_size = Py_None; Py_INCREF(Py_None);
25907 p->view.obj = NULL;
25909 int cinit_result = __pyx_memoryview___cinit__(o,
25910#
if CYTHON_VECTORCALL_TPNEW
25911 args, nargs, kwnames
25916 if (unlikely(cinit_result))
goto bad;
25920 Py_DECREF(o); o = 0;
25924static PyObject *__pyx_tp_new_vectorcall_memoryview(PyTypeObject *t,
25925#
if CYTHON_VECTORCALL_TPNEW
25926 PyObject *
const *args, Py_ssize_t nargs, PyObject *kwnames
25928 PyObject *a, PyObject *k
25932 o = __Pyx_AllocateExtensionType(t, 0);
25933 if (unlikely(!o))
return 0;
25934 return __pyx_tp_new__initialisation_memoryview(o,
25935#
if CYTHON_VECTORCALL_TPNEW
25936 args, nargs, kwnames
25943#if CYTHON_VECTORCALL_TPNEW
25944static PyObject *__pyx_tp_new_memoryview(PyTypeObject *t, PyObject *a, PyObject *k) {
25945 return __Pyx_CallTpnewAsVectorcall(__pyx_tp_new_vectorcall_memoryview, t, a, k);
25949#if CYTHON_VECTORCALL_TPNEW
25950static PyObject *__pyx_tp_vectorcall_memoryview(PyObject *t, PyObject *
const *args,
size_t nargsf, PyObject *kwnames) {
25951 if (unlikely((PyTypeObject*)t != __pyx_mstate_global->__pyx_memoryview_type || __Pyx_PyType_HasFeature((PyTypeObject*)t, Py_TPFLAGS_IS_ABSTRACT))) {
25952 return __Pyx_CallNewInitFromVectorcall((PyTypeObject*)t, args, nargsf, kwnames);
25954 Py_ssize_t nargs = PyVectorcall_NARGS(nargsf);
25955 PyObject *o = __pyx_tp_new_vectorcall_memoryview((PyTypeObject*)t, args, nargs, kwnames);
25960static void __pyx_tp_dealloc_memoryview(PyObject *o) {
25961 struct __pyx_memoryview_obj *p = (
struct __pyx_memoryview_obj *)o;
25962 #if CYTHON_USE_TP_FINALIZE
25963 if (unlikely(__Pyx_PyObject_GetSlot(o, tp_finalize, destructor)) && !__Pyx_PyObject_GC_IsFinalized(o)) {
25964 if (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_memoryview) {
25965 if (PyObject_CallFinalizerFromDealloc(o))
return;
25969 PyObject_GC_UnTrack(o);
25971 PyObject *etype, *eval, *etb;
25972 __Pyx_PyErr_FetchException(&etype, &eval, &etb);
25973 __Pyx_DeallocKeepAliveBegin(o);
25974 __pyx_memoryview___dealloc__(o);
25975 __Pyx_DeallocKeepAliveEnd(o);
25976 __Pyx_PyErr_RestoreException(etype, eval, etb);
25979 Py_CLEAR(p->_size);
25980 PyTypeObject *tp = Py_TYPE(o);
25981 #if CYTHON_USE_TYPE_SLOTS
25985 freefunc tp_free = (freefunc)PyType_GetSlot(tp, Py_tp_free);
25986 if (tp_free) tp_free(o);
25989 #if CYTHON_USE_TYPE_SPECS
25994static int __pyx_tp_traverse_memoryview(PyObject *o, visitproc
v,
void *a) {
25996 struct __pyx_memoryview_obj *p = (
struct __pyx_memoryview_obj *)o;
25998 e = __Pyx_call_type_traverse(o, 1,
v, a);
26002 e = (*v)(p->obj, a);
if (e)
return e;
26005 e = (*v)(p->_size, a);
if (e)
return e;
26008 e = (*v)(p->view.obj, a);
if (e)
return e;
26013static int __pyx_tp_clear_memoryview(PyObject *o) {
26015 struct __pyx_memoryview_obj *p = (
struct __pyx_memoryview_obj *)o;
26016 tmp = ((PyObject*)p->obj);
26017 p->obj = Py_None; Py_INCREF(Py_None);
26019 tmp = ((PyObject*)p->_size);
26020 p->_size = Py_None; Py_INCREF(Py_None);
26022 Py_CLEAR(p->view.obj);
26026static PyObject *__pyx_sq_item_memoryview(PyObject *o, Py_ssize_t i) {
26028 PyObject *x = PyLong_FromSsize_t(i);
if (unlikely(!x))
return NULL;
26029 #if CYTHON_USE_TYPE_SLOTS || (!CYTHON_USE_TYPE_SPECS && __PYX_LIMITED_VERSION_HEX < 0x030A0000)
26030 binaryfunc
f = Py_TYPE(o)->tp_as_mapping->mp_subscript;
26032 binaryfunc
f = ((binaryfunc)PyType_GetSlot(Py_TYPE(o), Py_mp_subscript));
26039static PyObject *__pyx_mp_subscript_memoryview(PyObject *o, PyObject *i) {
26040 return __pyx_memoryview___getitem__(o, i);
26043static int __pyx_sq_ass_item_memoryview(PyObject *o, Py_ssize_t i, PyObject *
v) {
26045 PyObject *x = PyLong_FromSsize_t(i);
if (unlikely(!x))
return -1;
26046 int r = __pyx_memoryview___setitem__(o, x,
v);
26050 __Pyx_RaiseErrorWithObjectType1(PyExc_NotImplementedError,
"Subscript %.10s not supported by " __Pyx_FMT_TYPENAME,
"deletion", o);
26055static int __pyx_mp_ass_subscript_memoryview(PyObject *o, PyObject *i, PyObject *
v) {
26057 return __pyx_memoryview___setitem__(o, i,
v);
26059 __Pyx_RaiseErrorWithObjectType1(PyExc_NotImplementedError,
"Subscript %.10s not supported by " __Pyx_FMT_TYPENAME,
"deletion", o);
26064static PyObject *__pyx_getprop___pyx_memoryview_T(PyObject *o, CYTHON_UNUSED
void *x) {
26065 return __pyx_pw_15View_dot_MemoryView_10memoryview_1T_1__get__(o);
26068static PyObject *__pyx_getprop___pyx_memoryview_base(PyObject *o, CYTHON_UNUSED
void *x) {
26069 return __pyx_pw_15View_dot_MemoryView_10memoryview_4base_1__get__(o);
26072static PyObject *__pyx_getprop___pyx_memoryview_shape(PyObject *o, CYTHON_UNUSED
void *x) {
26073 return __pyx_pw_15View_dot_MemoryView_10memoryview_5shape_1__get__(o);
26076static PyObject *__pyx_getprop___pyx_memoryview_strides(PyObject *o, CYTHON_UNUSED
void *x) {
26077 return __pyx_pw_15View_dot_MemoryView_10memoryview_7strides_1__get__(o);
26080static PyObject *__pyx_getprop___pyx_memoryview_suboffsets(PyObject *o, CYTHON_UNUSED
void *x) {
26081 return __pyx_pw_15View_dot_MemoryView_10memoryview_10suboffsets_1__get__(o);
26084static PyObject *__pyx_getprop___pyx_memoryview_ndim(PyObject *o, CYTHON_UNUSED
void *x) {
26085 return __pyx_pw_15View_dot_MemoryView_10memoryview_4ndim_1__get__(o);
26088static PyObject *__pyx_getprop___pyx_memoryview_itemsize(PyObject *o, CYTHON_UNUSED
void *x) {
26089 return __pyx_pw_15View_dot_MemoryView_10memoryview_8itemsize_1__get__(o);
26092static PyObject *__pyx_getprop___pyx_memoryview_nbytes(PyObject *o, CYTHON_UNUSED
void *x) {
26093 return __pyx_pw_15View_dot_MemoryView_10memoryview_6nbytes_1__get__(o);
26096static PyObject *__pyx_getprop___pyx_memoryview_size(PyObject *o, CYTHON_UNUSED
void *x) {
26097 return __pyx_pw_15View_dot_MemoryView_10memoryview_4size_1__get__(o);
26100static PyMethodDef __pyx_methods_memoryview[] = {
26101 {
"is_c_contig", (PyCFunction)(
void(*)(
void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_memoryview_is_c_contig, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0},
26102 {
"is_f_contig", (PyCFunction)(
void(*)(
void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_memoryview_is_f_contig, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0},
26103 {
"copy", (PyCFunction)(
void(*)(
void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_memoryview_copy, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0},
26104 {
"copy_fortran", (PyCFunction)(
void(*)(
void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_memoryview_copy_fortran, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0},
26105 {
"__reduce_cython__", (PyCFunction)(
void(*)(
void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw___pyx_memoryview_1__reduce_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0},
26106 {
"__setstate_cython__", (PyCFunction)(
void(*)(
void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw___pyx_memoryview_3__setstate_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0},
26110static struct PyGetSetDef __pyx_getsets_memoryview[] = {
26111 {
"T", __pyx_getprop___pyx_memoryview_T, 0, 0, 0},
26112 {
"base", __pyx_getprop___pyx_memoryview_base, 0, 0, 0},
26113 {
"shape", __pyx_getprop___pyx_memoryview_shape, 0, 0, 0},
26114 {
"strides", __pyx_getprop___pyx_memoryview_strides, 0, 0, 0},
26115 {
"suboffsets", __pyx_getprop___pyx_memoryview_suboffsets, 0, 0, 0},
26116 {
"ndim", __pyx_getprop___pyx_memoryview_ndim, 0, 0, 0},
26117 {
"itemsize", __pyx_getprop___pyx_memoryview_itemsize, 0, 0, 0},
26118 {
"nbytes", __pyx_getprop___pyx_memoryview_nbytes, 0, 0, 0},
26119 {
"size", __pyx_getprop___pyx_memoryview_size, 0, 0, 0},
26122#if CYTHON_USE_TYPE_SPECS
26123#if !CYTHON_COMPILING_IN_LIMITED_API
26125static PyBufferProcs __pyx_tp_as_buffer_memoryview = {
26126 __pyx_memoryview_getbuffer,
26130static PyType_Slot __pyx_type___pyx_memoryview_slots[] = {
26131 {Py_tp_dealloc, (
void *)__pyx_tp_dealloc_memoryview},
26132 {Py_tp_repr, (
void *)__pyx_memoryview___repr__},
26133 {Py_sq_length, (
void *)__pyx_memoryview___len__},
26134 {Py_sq_item, (
void *)__pyx_sq_item_memoryview},
26135 {Py_sq_ass_item, (
void *)__pyx_sq_ass_item_memoryview},
26136 {Py_mp_length, (
void *)__pyx_memoryview___len__},
26137 {Py_mp_subscript, (
void *)__pyx_mp_subscript_memoryview},
26138 {Py_mp_ass_subscript, (
void *)__pyx_mp_ass_subscript_memoryview},
26139 {Py_tp_str, (
void *)__pyx_memoryview___str__},
26140 #if defined(Py_bf_getbuffer)
26141 {Py_bf_getbuffer, (
void *)__pyx_memoryview_getbuffer},
26143 {Py_tp_traverse, (
void *)__pyx_tp_traverse_memoryview},
26144 {Py_tp_clear, (
void *)__pyx_tp_clear_memoryview},
26145 {Py_tp_methods, (
void *)__pyx_methods_memoryview},
26146 {Py_tp_getset, (
void *)__pyx_getsets_memoryview},
26147 {Py_tp_new, (
void *)__pyx_tp_new_memoryview},
26148 #if (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800) && (!CYTHON_COMPILING_IN_LIMITED_API || __PYX_LIMITED_VERSION_HEX >= 0x030E0000)
26149 #if CYTHON_VECTORCALL_TPNEW
26150 {Py_tp_vectorcall, (
void *)__pyx_tp_vectorcall_memoryview},
26155static PyType_Spec __pyx_type___pyx_memoryview_spec = {
26156 "superluWrappers.memoryview",
26157 sizeof(
struct __pyx_memoryview_obj),
26159 Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC,
26160 __pyx_type___pyx_memoryview_slots,
26164static PySequenceMethods __pyx_tp_as_sequence_memoryview = {
26165 __pyx_memoryview___len__,
26168 __pyx_sq_item_memoryview,
26170 __pyx_sq_ass_item_memoryview,
26177static PyMappingMethods __pyx_tp_as_mapping_memoryview = {
26178 __pyx_memoryview___len__,
26179 __pyx_mp_subscript_memoryview,
26180 __pyx_mp_ass_subscript_memoryview,
26183static PyBufferProcs __pyx_tp_as_buffer_memoryview = {
26184 __pyx_memoryview_getbuffer,
26188static PyTypeObject __pyx_type___pyx_memoryview = {
26189 PyVarObject_HEAD_INIT(0, 0)
26190 "superluWrappers.""memoryview",
26191 sizeof(
struct __pyx_memoryview_obj),
26193 __pyx_tp_dealloc_memoryview,
26198 __pyx_memoryview___repr__,
26200 &__pyx_tp_as_sequence_memoryview,
26201 &__pyx_tp_as_mapping_memoryview,
26204 __pyx_memoryview___str__,
26207 &__pyx_tp_as_buffer_memoryview,
26208 Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC,
26210 __pyx_tp_traverse_memoryview,
26211 __pyx_tp_clear_memoryview,
26216 __pyx_methods_memoryview,
26218 __pyx_getsets_memoryview,
26223 #
if !CYTHON_USE_TYPE_SPECS
26228 __pyx_tp_new_memoryview,
26238 #
if CYTHON_USE_TP_FINALIZE
26243 #
if (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800) && (!CYTHON_COMPILING_IN_LIMITED_API || __PYX_LIMITED_VERSION_HEX >= 0x030E0000)
26244 #
if CYTHON_VECTORCALL_TPNEW
26245 __pyx_tp_vectorcall_memoryview,
26250 #
if __PYX_NEED_TP_PRINT_SLOT == 1
26253 #
if PY_VERSION_HEX >= 0x030C0000
26256 #
if PY_VERSION_HEX >= 0x030d00A4
26259 #
if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x030a0000
26264static struct __pyx_vtabstruct__memoryviewslice __pyx_vtable__memoryviewslice;
26266static PyObject *__pyx_tp_new__initialisation__memoryviewslice(PyObject *o,
26267#
if CYTHON_VECTORCALL_TPNEW
26268 CYTHON_UNUSED PyObject *
const *args, CYTHON_UNUSED Py_ssize_t nargs, CYTHON_UNUSED PyObject *kwnames
26270 CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k
26273 struct __pyx_memoryviewslice_obj *p = ((
struct __pyx_memoryviewslice_obj *)o);
26274 p->__pyx_base.__pyx_vtab = (
struct __pyx_vtabstruct_memoryview*)__pyx_vtabptr__memoryviewslice;
26275 p->from_object = Py_None; Py_INCREF(Py_None);
26276 p->from_slice.memview = NULL;
26280static PyObject *__pyx_tp_new_vectorcall__memoryviewslice(PyTypeObject *t,
26281#
if CYTHON_VECTORCALL_TPNEW
26282 PyObject *
const *args, Py_ssize_t nargs, PyObject *kwnames
26284 PyObject *a, PyObject *k
26288 o = __pyx_tp_new_vectorcall_memoryview(t,
26289#
if CYTHON_VECTORCALL_TPNEW
26290 args, nargs, kwnames
26295 if (unlikely(!o))
return 0;
26296 return __pyx_tp_new__initialisation__memoryviewslice(o,
26297#
if CYTHON_VECTORCALL_TPNEW
26298 args, nargs, kwnames
26305#if CYTHON_VECTORCALL_TPNEW
26306static PyObject *__pyx_tp_new__memoryviewslice(PyTypeObject *t, PyObject *a, PyObject *k) {
26307 return __Pyx_CallTpnewAsVectorcall(__pyx_tp_new_vectorcall__memoryviewslice, t, a, k);
26311#if CYTHON_VECTORCALL_TPNEW
26312static PyObject *__pyx_tp_vectorcall__memoryviewslice(PyObject *t, PyObject *
const *args,
size_t nargsf, PyObject *kwnames) {
26313 if (unlikely((PyTypeObject*)t != __pyx_mstate_global->__pyx_memoryviewslice_type || __Pyx_PyType_HasFeature((PyTypeObject*)t, Py_TPFLAGS_IS_ABSTRACT))) {
26314 return __Pyx_CallNewInitFromVectorcall((PyTypeObject*)t, args, nargsf, kwnames);
26316 Py_ssize_t nargs = PyVectorcall_NARGS(nargsf);
26317 PyObject *o = __pyx_tp_new_vectorcall__memoryviewslice((PyTypeObject*)t, args, nargs, kwnames);
26322static void __pyx_tp_dealloc__memoryviewslice(PyObject *o) {
26323 struct __pyx_memoryviewslice_obj *p = (
struct __pyx_memoryviewslice_obj *)o;
26324 #if CYTHON_USE_TP_FINALIZE
26325 if (unlikely(__Pyx_PyObject_GetSlot(o, tp_finalize, destructor)) && !__Pyx_PyObject_GC_IsFinalized(o)) {
26326 if (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc__memoryviewslice) {
26327 if (PyObject_CallFinalizerFromDealloc(o))
return;
26331 PyObject_GC_UnTrack(o);
26333 PyObject *etype, *eval, *etb;
26334 __Pyx_PyErr_FetchException(&etype, &eval, &etb);
26335 __Pyx_DeallocKeepAliveBegin(o);
26336 __pyx_memoryviewslice___dealloc__(o);
26337 __Pyx_DeallocKeepAliveEnd(o);
26338 __Pyx_PyErr_RestoreException(etype, eval, etb);
26340 Py_CLEAR(p->from_object);
26341 PyObject_GC_Track(o);
26342 __pyx_tp_dealloc_memoryview(o);
26345static int __pyx_tp_traverse__memoryviewslice(PyObject *o, visitproc
v,
void *a) {
26347 struct __pyx_memoryviewslice_obj *p = (
struct __pyx_memoryviewslice_obj *)o;
26348 e = __pyx_tp_traverse_memoryview(o,
v, a);
if (e)
return e;
26349 if (p->from_object) {
26350 e = (*v)(p->from_object, a);
if (e)
return e;
26355static int __pyx_tp_clear__memoryviewslice(PyObject *o) {
26357 struct __pyx_memoryviewslice_obj *p = (
struct __pyx_memoryviewslice_obj *)o;
26358 __pyx_tp_clear_memoryview(o);
26359 tmp = ((PyObject*)p->from_object);
26360 p->from_object = Py_None; Py_INCREF(Py_None);
26362 __PYX_XCLEAR_MEMVIEW(&p->from_slice, 1);
26366static PyMethodDef __pyx_methods__memoryviewslice[] = {
26367 {
"__reduce_cython__", (PyCFunction)(
void(*)(
void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw___pyx_memoryviewslice_1__reduce_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0},
26368 {
"__setstate_cython__", (PyCFunction)(
void(*)(
void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw___pyx_memoryviewslice_3__setstate_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0},
26371#if CYTHON_USE_TYPE_SPECS
26372static PyType_Slot __pyx_type___pyx_memoryviewslice_slots[] = {
26373 {Py_tp_dealloc, (
void *)__pyx_tp_dealloc__memoryviewslice},
26374 {Py_tp_doc, (
void *)PyDoc_STR(
"Internal class for passing memoryview slices to Python")},
26375 {Py_tp_traverse, (
void *)__pyx_tp_traverse__memoryviewslice},
26376 {Py_tp_clear, (
void *)__pyx_tp_clear__memoryviewslice},
26377 {Py_tp_methods, (
void *)__pyx_methods__memoryviewslice},
26378 {Py_tp_new, (
void *)__pyx_tp_new__memoryviewslice},
26379 #if (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800) && (!CYTHON_COMPILING_IN_LIMITED_API || __PYX_LIMITED_VERSION_HEX >= 0x030E0000)
26380 #if CYTHON_VECTORCALL_TPNEW
26381 {Py_tp_vectorcall, (
void *)__pyx_tp_vectorcall__memoryviewslice},
26386static PyType_Spec __pyx_type___pyx_memoryviewslice_spec = {
26387 "superluWrappers._memoryviewslice",
26388 sizeof(
struct __pyx_memoryviewslice_obj),
26390 Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC|Py_TPFLAGS_SEQUENCE,
26391 __pyx_type___pyx_memoryviewslice_slots,
26395static PyTypeObject __pyx_type___pyx_memoryviewslice = {
26396 PyVarObject_HEAD_INIT(0, 0)
26397 "superluWrappers.""_memoryviewslice",
26398 sizeof(
struct __pyx_memoryviewslice_obj),
26400 __pyx_tp_dealloc__memoryviewslice,
26405 #
if CYTHON_COMPILING_IN_PYPY || 0
26406 __pyx_memoryview___repr__,
26415 #
if CYTHON_COMPILING_IN_PYPY || 0
26416 __pyx_memoryview___str__,
26423 Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC|Py_TPFLAGS_SEQUENCE,
26424 PyDoc_STR(
"Internal class for passing memoryview slices to Python"),
26425 __pyx_tp_traverse__memoryviewslice,
26426 __pyx_tp_clear__memoryviewslice,
26431 __pyx_methods__memoryviewslice,
26438 #if !CYTHON_USE_TYPE_SPECS
26443 __pyx_tp_new__memoryviewslice,
26453 #if CYTHON_USE_TP_FINALIZE
26458 #if (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800) && (!CYTHON_COMPILING_IN_LIMITED_API || __PYX_LIMITED_VERSION_HEX >= 0x030E0000)
26459 #if CYTHON_VECTORCALL_TPNEW
26460 __pyx_tp_vectorcall__memoryviewslice,
26465 #if __PYX_NEED_TP_PRINT_SLOT == 1
26468 #if PY_VERSION_HEX >= 0x030C0000
26471 #if PY_VERSION_HEX >= 0x030d00A4
26474 #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x030a0000
26480static PyMethodDef __pyx_methods[] = {
26484static CYTHON_SMALL_CODE
int __Pyx_InitCachedBuiltins(__pyx_mstatetype *__pyx_mstate);
26485static CYTHON_SMALL_CODE
int __Pyx_InitCachedConstants(__pyx_mstatetype *__pyx_mstate);
26486static CYTHON_SMALL_CODE
int __Pyx_InitGlobals(
void);
26487static CYTHON_SMALL_CODE
int __Pyx_InitAfterSharedUtility(
void);
26488static CYTHON_SMALL_CODE
int __Pyx_InitConstants(__pyx_mstatetype *__pyx_mstate);
26489static CYTHON_SMALL_CODE
int __Pyx_modinit_Global_init_code(__pyx_mstatetype *__pyx_mstate);
26490static CYTHON_SMALL_CODE
int __Pyx_modinit_Variable_export_code(__pyx_mstatetype *__pyx_mstate);
26491static CYTHON_SMALL_CODE
int __Pyx_modinit_Function_export_code(__pyx_mstatetype *__pyx_mstate);
26492static CYTHON_SMALL_CODE
int __Pyx_modinit_Exttype___pyx_obj_15superluWrappers_cSparseMatrix(__pyx_mstatetype *__pyx_mstate);
26493static CYTHON_SMALL_CODE
int __Pyx_modinit_Exttype___pyx_obj_15superluWrappers_SparseFactor(__pyx_mstatetype *__pyx_mstate);
26494static CYTHON_SMALL_CODE
int __Pyx_modinit_Exttype___pyx_array_obj(__pyx_mstatetype *__pyx_mstate);
26495static CYTHON_SMALL_CODE
int __Pyx_modinit_Exttype___pyx_MemviewEnum_obj(__pyx_mstatetype *__pyx_mstate);
26496static CYTHON_SMALL_CODE
int __Pyx_modinit_Exttype___pyx_memoryview_obj(__pyx_mstatetype *__pyx_mstate);
26497static CYTHON_SMALL_CODE
int __Pyx_modinit_Exttype___pyx_memoryviewslice_obj(__pyx_mstatetype *__pyx_mstate);
26498static CYTHON_SMALL_CODE
int __Pyx_modinit_Type_import_code(__pyx_mstatetype *__pyx_mstate);
26499static CYTHON_SMALL_CODE
int __Pyx_modinit_Variable_import_code(__pyx_mstatetype *__pyx_mstate);
26500static CYTHON_SMALL_CODE
int __Pyx_modinit_Function_import_code(__pyx_mstatetype *__pyx_mstate);
26501static CYTHON_SMALL_CODE
int __Pyx_CreateCodeObjects(__pyx_mstatetype *__pyx_mstate);
26504static int __Pyx_modinit_Global_init_code(__pyx_mstatetype *__pyx_mstate) {
26505 __Pyx_RefNannyDeclarations
26506 CYTHON_UNUSED_VAR(__pyx_mstate);
26507 __Pyx_RefNannySetupContext(
"__Pyx_modinit_Global_init_code", 0);
26509 __pyx_collections_abc_Sequence = Py_None; Py_INCREF(Py_None);
26510 generic = Py_None; Py_INCREF(Py_None);
26511 strided = Py_None; Py_INCREF(Py_None);
26512 indirect = Py_None; Py_INCREF(Py_None);
26513 contiguous = Py_None; Py_INCREF(Py_None);
26514 indirect_contiguous = Py_None; Py_INCREF(Py_None);
26515 __Pyx_RefNannyFinishContext();
26519static int __Pyx_modinit_Variable_export_code(__pyx_mstatetype *__pyx_mstate) {
26520 __Pyx_RefNannyDeclarations
26521 CYTHON_UNUSED_VAR(__pyx_mstate);
26522 __Pyx_RefNannySetupContext(
"__Pyx_modinit_Variable_export_code", 0);
26524 __Pyx_RefNannyFinishContext();
26528static int __Pyx_modinit_Function_export_code(__pyx_mstatetype *__pyx_mstate) {
26529 __Pyx_RefNannyDeclarations
26530 CYTHON_UNUSED_VAR(__pyx_mstate);
26531 __Pyx_RefNannySetupContext(
"__Pyx_modinit_Function_export_code", 0);
26533 __Pyx_RefNannyFinishContext();
26537static int __Pyx_modinit_Exttype___pyx_obj_15superluWrappers_cSparseMatrix(__pyx_mstatetype *__pyx_mstate) {
26538 __Pyx_RefNannyDeclarations
26539 int __pyx_lineno = 0;
26540 const char *__pyx_filename = NULL;
26541 int __pyx_clineno = 0;
26542 CYTHON_UNUSED_VAR(__pyx_mstate);
26543 __Pyx_RefNannySetupContext(
"__Pyx_modinit_Exttype___pyx_obj_15superluWrappers_cSparseMatrix", 0);
26545 #if CYTHON_USE_TYPE_SPECS
26546 __pyx_mstate->__pyx_ptype_15superluWrappers_cSparseMatrix = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_15superluWrappers_cSparseMatrix_spec, NULL);
if (unlikely(!__pyx_mstate->__pyx_ptype_15superluWrappers_cSparseMatrix)) __PYX_ERR(0, 100, __pyx_L1_error)
26548 __pyx_mstate->__pyx_ptype_15superluWrappers_cSparseMatrix = &__pyx_type_15superluWrappers_cSparseMatrix;
26550 #if !CYTHON_COMPILING_IN_LIMITED_API
26552 #if !CYTHON_USE_TYPE_SPECS
26553 if (__Pyx_PyType_Ready(__pyx_mstate->__pyx_ptype_15superluWrappers_cSparseMatrix) < (0)) __PYX_ERR(0, 100, __pyx_L1_error)
26555 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
26556 PyUnstable_Object_EnableDeferredRefcount((PyObject*)__pyx_mstate->__pyx_ptype_15superluWrappers_cSparseMatrix);
26558 #if !CYTHON_COMPILING_IN_LIMITED_API
26559 if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_mstate->__pyx_ptype_15superluWrappers_cSparseMatrix->tp_dictoffset && __pyx_mstate->__pyx_ptype_15superluWrappers_cSparseMatrix->tp_getattro == PyObject_GenericGetAttr)) {
26560 __pyx_mstate->__pyx_ptype_15superluWrappers_cSparseMatrix->tp_getattro = PyObject_GenericGetAttr;
26563 if (PyObject_SetAttr(__pyx_m, __pyx_mstate_global->__pyx_n_u_cSparseMatrix_2, (PyObject *) __pyx_mstate->__pyx_ptype_15superluWrappers_cSparseMatrix) < (0)) __PYX_ERR(0, 100, __pyx_L1_error)
26564 if (__Pyx_setup_reduce((PyObject *) __pyx_mstate->__pyx_ptype_15superluWrappers_cSparseMatrix) < (0)) __PYX_ERR(0, 100, __pyx_L1_error)
26565 __Pyx_RefNannyFinishContext();
26568 __Pyx_RefNannyFinishContext();
26572static int __Pyx_modinit_Exttype___pyx_obj_15superluWrappers_SparseFactor(__pyx_mstatetype *__pyx_mstate) {
26573 __Pyx_RefNannyDeclarations
26574 int __pyx_lineno = 0;
26575 const char *__pyx_filename = NULL;
26576 int __pyx_clineno = 0;
26577 CYTHON_UNUSED_VAR(__pyx_mstate);
26578 __Pyx_RefNannySetupContext(
"__Pyx_modinit_Exttype___pyx_obj_15superluWrappers_SparseFactor", 0);
26580 __pyx_vtabptr_15superluWrappers_SparseFactor = &__pyx_vtable_15superluWrappers_SparseFactor;
26581 __pyx_vtable_15superluWrappers_SparseFactor._set_mat_types = (PyObject *(*)(
struct __pyx_obj_15superluWrappers_SparseFactor *))__pyx_f_15superluWrappers_12SparseFactor__set_mat_types;
26582 #if CYTHON_USE_TYPE_SPECS
26583 __pyx_mstate->__pyx_ptype_15superluWrappers_SparseFactor = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_15superluWrappers_SparseFactor_spec, NULL);
if (unlikely(!__pyx_mstate->__pyx_ptype_15superluWrappers_SparseFactor)) __PYX_ERR(0, 148, __pyx_L1_error)
26585 __pyx_mstate->__pyx_ptype_15superluWrappers_SparseFactor = &__pyx_type_15superluWrappers_SparseFactor;
26587 #if !CYTHON_COMPILING_IN_LIMITED_API
26589 #if !CYTHON_USE_TYPE_SPECS
26590 if (__Pyx_PyType_Ready(__pyx_mstate->__pyx_ptype_15superluWrappers_SparseFactor) < (0)) __PYX_ERR(0, 148, __pyx_L1_error)
26592 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
26593 PyUnstable_Object_EnableDeferredRefcount((PyObject*)__pyx_mstate->__pyx_ptype_15superluWrappers_SparseFactor);
26595 #if !CYTHON_COMPILING_IN_LIMITED_API
26596 if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_mstate->__pyx_ptype_15superluWrappers_SparseFactor->tp_dictoffset && __pyx_mstate->__pyx_ptype_15superluWrappers_SparseFactor->tp_getattro == PyObject_GenericGetAttr)) {
26597 __pyx_mstate->__pyx_ptype_15superluWrappers_SparseFactor->tp_getattro = PyObject_GenericGetAttr;
26600 #if CYTHON_UPDATE_DESCRIPTOR_DOC
26602 PyObject *wrapper = PyObject_GetAttrString((PyObject *)__pyx_mstate->__pyx_ptype_15superluWrappers_SparseFactor,
"__init__");
if (unlikely(!wrapper)) __PYX_ERR(0, 148, __pyx_L1_error)
26603 if (Py_IS_TYPE(wrapper, &PyWrapperDescr_Type)) {
26604 __pyx_wrapperbase_15superluWrappers_12SparseFactor___init__ = *((PyWrapperDescrObject *)wrapper)->d_base;
26605 __pyx_wrapperbase_15superluWrappers_12SparseFactor___init__.doc = __pyx_doc_15superluWrappers_12SparseFactor___init__;
26606 ((PyWrapperDescrObject *)wrapper)->d_base = &__pyx_wrapperbase_15superluWrappers_12SparseFactor___init__;
26610 if (__Pyx_SetVtable(__pyx_mstate->__pyx_ptype_15superluWrappers_SparseFactor, __pyx_vtabptr_15superluWrappers_SparseFactor) < (0)) __PYX_ERR(0, 148, __pyx_L1_error)
26611 if (PyObject_SetAttr(__pyx_m, __pyx_mstate_global->__pyx_n_u_SparseFactor, (PyObject *) __pyx_mstate->__pyx_ptype_15superluWrappers_SparseFactor) < (0)) __PYX_ERR(0, 148, __pyx_L1_error)
26612 if (__Pyx_setup_reduce((PyObject *) __pyx_mstate->__pyx_ptype_15superluWrappers_SparseFactor) < (0)) __PYX_ERR(0, 148, __pyx_L1_error)
26613 __Pyx_RefNannyFinishContext();
26616 __Pyx_RefNannyFinishContext();
26620static int __Pyx_modinit_Exttype___pyx_array_obj(__pyx_mstatetype *__pyx_mstate) {
26621 __Pyx_RefNannyDeclarations
26622 int __pyx_lineno = 0;
26623 const char *__pyx_filename = NULL;
26624 int __pyx_clineno = 0;
26625 CYTHON_UNUSED_VAR(__pyx_mstate);
26626 __Pyx_RefNannySetupContext(
"__Pyx_modinit_Exttype___pyx_array_obj", 0);
26628 __pyx_vtabptr_array = &__pyx_vtable_array;
26629 __pyx_vtable_array.get_memview = (PyObject *(*)(
struct __pyx_array_obj *))__pyx_array_get_memview;
26630 #if CYTHON_USE_TYPE_SPECS
26631 __pyx_mstate->__pyx_array_type = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type___pyx_array_spec, NULL);
if (unlikely(!__pyx_mstate->__pyx_array_type)) __PYX_ERR(1, 128, __pyx_L1_error)
26632 #if !CYTHON_COMPILING_IN_LIMITED_API
26633 __pyx_mstate->__pyx_array_type->tp_as_buffer = &__pyx_tp_as_buffer_array;
26634 if (!__pyx_mstate->__pyx_array_type->tp_as_buffer->bf_releasebuffer && __pyx_mstate->__pyx_array_type->tp_base->tp_as_buffer && __pyx_mstate->__pyx_array_type->tp_base->tp_as_buffer->bf_releasebuffer) {
26635 __pyx_mstate->__pyx_array_type->tp_as_buffer->bf_releasebuffer = __pyx_mstate->__pyx_array_type->tp_base->tp_as_buffer->bf_releasebuffer;
26637 #elif defined(Py_bf_getbuffer) && defined(Py_bf_releasebuffer)
26639 #elif defined(_MSC_VER)
26640 #pragma message ("The buffer protocol is not supported in the Limited C-API < 3.11.")
26642 #warning "The buffer protocol is not supported in the Limited C-API < 3.11."
26645 __pyx_mstate->__pyx_array_type = &__pyx_type___pyx_array;
26647 if (__Pyx_ApplySequenceOrMappingFlag(__pyx_mstate->__pyx_array_type, 1) < (0)) __PYX_ERR(1, 128, __pyx_L1_error)
26648 #if !CYTHON_COMPILING_IN_LIMITED_API
26650 #if !CYTHON_USE_TYPE_SPECS
26651 if (__Pyx_PyType_Ready(__pyx_mstate->__pyx_array_type) < (0)) __PYX_ERR(1, 128, __pyx_L1_error)
26653 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
26654 PyUnstable_Object_EnableDeferredRefcount((PyObject*)__pyx_mstate->__pyx_array_type);
26656 if (__Pyx_SetVtable(__pyx_mstate->__pyx_array_type, __pyx_vtabptr_array) < (0)) __PYX_ERR(1, 128, __pyx_L1_error)
26657 if (__Pyx_setup_reduce((PyObject *) __pyx_mstate->__pyx_array_type) < (0)) __PYX_ERR(1, 128, __pyx_L1_error)
26658 __Pyx_RefNannyFinishContext();
26661 __Pyx_RefNannyFinishContext();
26665static int __Pyx_modinit_Exttype___pyx_MemviewEnum_obj(__pyx_mstatetype *__pyx_mstate) {
26666 __Pyx_RefNannyDeclarations
26667 int __pyx_lineno = 0;
26668 const char *__pyx_filename = NULL;
26669 int __pyx_clineno = 0;
26670 CYTHON_UNUSED_VAR(__pyx_mstate);
26671 __Pyx_RefNannySetupContext(
"__Pyx_modinit_Exttype___pyx_MemviewEnum_obj", 0);
26673 #if CYTHON_USE_TYPE_SPECS
26674 __pyx_mstate->__pyx_MemviewEnum_type = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type___pyx_MemviewEnum_spec, NULL);
if (unlikely(!__pyx_mstate->__pyx_MemviewEnum_type)) __PYX_ERR(1, 318, __pyx_L1_error)
26676 __pyx_mstate->__pyx_MemviewEnum_type = &__pyx_type___pyx_MemviewEnum;
26678 #if !CYTHON_COMPILING_IN_LIMITED_API
26680 #if !CYTHON_USE_TYPE_SPECS
26681 if (__Pyx_PyType_Ready(__pyx_mstate->__pyx_MemviewEnum_type) < (0)) __PYX_ERR(1, 318, __pyx_L1_error)
26683 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
26684 PyUnstable_Object_EnableDeferredRefcount((PyObject*)__pyx_mstate->__pyx_MemviewEnum_type);
26686 #if !CYTHON_COMPILING_IN_LIMITED_API
26687 if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_mstate->__pyx_MemviewEnum_type->tp_dictoffset && __pyx_mstate->__pyx_MemviewEnum_type->tp_getattro == PyObject_GenericGetAttr)) {
26688 __pyx_mstate->__pyx_MemviewEnum_type->tp_getattro = PyObject_GenericGetAttr;
26691 if (__Pyx_setup_reduce((PyObject *) __pyx_mstate->__pyx_MemviewEnum_type) < (0)) __PYX_ERR(1, 318, __pyx_L1_error)
26692 __Pyx_RefNannyFinishContext();
26695 __Pyx_RefNannyFinishContext();
26699static int __Pyx_modinit_Exttype___pyx_memoryview_obj(__pyx_mstatetype *__pyx_mstate) {
26700 __Pyx_RefNannyDeclarations
26701 int __pyx_lineno = 0;
26702 const char *__pyx_filename = NULL;
26703 int __pyx_clineno = 0;
26704 CYTHON_UNUSED_VAR(__pyx_mstate);
26705 __Pyx_RefNannySetupContext(
"__Pyx_modinit_Exttype___pyx_memoryview_obj", 0);
26707 __pyx_vtabptr_memoryview = &__pyx_vtable_memoryview;
26708 __pyx_vtable_memoryview.get_item_pointer = (
char *(*)(
struct __pyx_memoryview_obj *, PyObject *))__pyx_memoryview_get_item_pointer;
26709 __pyx_vtable_memoryview.is_slice = (PyObject *(*)(
struct __pyx_memoryview_obj *, PyObject *))__pyx_memoryview_is_slice;
26710 __pyx_vtable_memoryview.setitem_slice_assignment = (PyObject *(*)(
struct __pyx_memoryview_obj *, PyObject *, PyObject *))__pyx_memoryview_setitem_slice_assignment;
26711 __pyx_vtable_memoryview.setitem_slice_assign_scalar = (PyObject *(*)(
struct __pyx_memoryview_obj *,
struct __pyx_memoryview_obj *, PyObject *))__pyx_memoryview_setitem_slice_assign_scalar;
26712 __pyx_vtable_memoryview.setitem_indexed = (PyObject *(*)(
struct __pyx_memoryview_obj *, PyObject *, PyObject *))__pyx_memoryview_setitem_indexed;
26713 __pyx_vtable_memoryview.setitem_indexed1 = (PyObject *(*)(
struct __pyx_memoryview_obj *, PyObject *, PyObject *))__pyx_memoryview_setitem_indexed1;
26714 __pyx_vtable_memoryview.convert_item_to_object = (PyObject *(*)(
struct __pyx_memoryview_obj *,
char *))__pyx_memoryview_convert_item_to_object;
26715 __pyx_vtable_memoryview.assign_item_from_object = (PyObject *(*)(
struct __pyx_memoryview_obj *,
char *, PyObject *))__pyx_memoryview_assign_item_from_object;
26716 __pyx_vtable_memoryview._get_base = (PyObject *(*)(
struct __pyx_memoryview_obj *))__pyx_memoryview__get_base;
26717 #if CYTHON_USE_TYPE_SPECS
26718 __pyx_mstate->__pyx_memoryview_type = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type___pyx_memoryview_spec, NULL);
if (unlikely(!__pyx_mstate->__pyx_memoryview_type)) __PYX_ERR(1, 353, __pyx_L1_error)
26719 #if !CYTHON_COMPILING_IN_LIMITED_API
26720 __pyx_mstate->__pyx_memoryview_type->tp_as_buffer = &__pyx_tp_as_buffer_memoryview;
26721 if (!__pyx_mstate->__pyx_memoryview_type->tp_as_buffer->bf_releasebuffer && __pyx_mstate->__pyx_memoryview_type->tp_base->tp_as_buffer && __pyx_mstate->__pyx_memoryview_type->tp_base->tp_as_buffer->bf_releasebuffer) {
26722 __pyx_mstate->__pyx_memoryview_type->tp_as_buffer->bf_releasebuffer = __pyx_mstate->__pyx_memoryview_type->tp_base->tp_as_buffer->bf_releasebuffer;
26724 #elif defined(Py_bf_getbuffer) && defined(Py_bf_releasebuffer)
26726 #elif defined(_MSC_VER)
26727 #pragma message ("The buffer protocol is not supported in the Limited C-API < 3.11.")
26729 #warning "The buffer protocol is not supported in the Limited C-API < 3.11."
26732 __pyx_mstate->__pyx_memoryview_type = &__pyx_type___pyx_memoryview;
26734 #if !CYTHON_COMPILING_IN_LIMITED_API
26736 #if !CYTHON_USE_TYPE_SPECS
26737 if (__Pyx_PyType_Ready(__pyx_mstate->__pyx_memoryview_type) < (0)) __PYX_ERR(1, 353, __pyx_L1_error)
26739 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
26740 PyUnstable_Object_EnableDeferredRefcount((PyObject*)__pyx_mstate->__pyx_memoryview_type);
26742 #if !CYTHON_COMPILING_IN_LIMITED_API
26743 if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_mstate->__pyx_memoryview_type->tp_dictoffset && __pyx_mstate->__pyx_memoryview_type->tp_getattro == PyObject_GenericGetAttr)) {
26744 __pyx_mstate->__pyx_memoryview_type->tp_getattro = PyObject_GenericGetAttr;
26747 if (__Pyx_SetVtable(__pyx_mstate->__pyx_memoryview_type, __pyx_vtabptr_memoryview) < (0)) __PYX_ERR(1, 353, __pyx_L1_error)
26748 if (__Pyx_setup_reduce((PyObject *) __pyx_mstate->__pyx_memoryview_type) < (0)) __PYX_ERR(1, 353, __pyx_L1_error)
26749 __Pyx_RefNannyFinishContext();
26752 __Pyx_RefNannyFinishContext();
26756static int __Pyx_modinit_Exttype___pyx_memoryviewslice_obj(__pyx_mstatetype *__pyx_mstate) {
26757 __Pyx_RefNannyDeclarations
26758 PyObject *__pyx_t_1 = NULL;
26759 int __pyx_lineno = 0;
26760 const char *__pyx_filename = NULL;
26761 int __pyx_clineno = 0;
26762 CYTHON_UNUSED_VAR(__pyx_mstate);
26763 __Pyx_RefNannySetupContext(
"__Pyx_modinit_Exttype___pyx_memoryviewslice_obj", 0);
26765 __pyx_vtabptr__memoryviewslice = &__pyx_vtable__memoryviewslice;
26766 __pyx_vtable__memoryviewslice.__pyx_base = *__pyx_vtabptr_memoryview;
26767 __pyx_vtable__memoryviewslice.__pyx_base.convert_item_to_object = (PyObject *(*)(
struct __pyx_memoryview_obj *,
char *))__pyx_memoryviewslice_convert_item_to_object;
26768 __pyx_vtable__memoryviewslice.__pyx_base.assign_item_from_object = (PyObject *(*)(
struct __pyx_memoryview_obj *,
char *, PyObject *))__pyx_memoryviewslice_assign_item_from_object;
26769 __pyx_vtable__memoryviewslice.__pyx_base._get_base = (PyObject *(*)(
struct __pyx_memoryview_obj *))__pyx_memoryviewslice__get_base;
26770 #if CYTHON_USE_TYPE_SPECS
26771 __pyx_t_1 = PyTuple_Pack(1, (PyObject *)__pyx_mstate_global->__pyx_memoryview_type);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 947, __pyx_L1_error)
26772 __Pyx_GOTREF(__pyx_t_1);
26773 __pyx_mstate->__pyx_memoryviewslice_type = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type___pyx_memoryviewslice_spec, __pyx_t_1);
26774 __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
26775 if (unlikely(!__pyx_mstate->__pyx_memoryviewslice_type)) __PYX_ERR(1, 947, __pyx_L1_error)
26777 __pyx_mstate->__pyx_memoryviewslice_type = &__pyx_type___pyx_memoryviewslice;
26779 if (__Pyx_ApplySequenceOrMappingFlag(__pyx_mstate->__pyx_memoryviewslice_type, 1) < (0)) __PYX_ERR(1, 947, __pyx_L1_error)
26780 #if !CYTHON_COMPILING_IN_LIMITED_API
26781 __pyx_mstate_global->__pyx_memoryviewslice_type->tp_base = __pyx_mstate_global->__pyx_memoryview_type;
26783 #if !CYTHON_USE_TYPE_SPECS
26784 if (__Pyx_PyType_Ready(__pyx_mstate->__pyx_memoryviewslice_type) < (0)) __PYX_ERR(1, 947, __pyx_L1_error)
26786 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
26787 PyUnstable_Object_EnableDeferredRefcount((PyObject*)__pyx_mstate->__pyx_memoryviewslice_type);
26789 #if !CYTHON_COMPILING_IN_LIMITED_API
26790 if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_mstate->__pyx_memoryviewslice_type->tp_dictoffset && __pyx_mstate->__pyx_memoryviewslice_type->tp_getattro == PyObject_GenericGetAttr)) {
26791 __pyx_mstate->__pyx_memoryviewslice_type->tp_getattro = PyObject_GenericGetAttr;
26794 if (__Pyx_SetVtable(__pyx_mstate->__pyx_memoryviewslice_type, __pyx_vtabptr__memoryviewslice) < (0)) __PYX_ERR(1, 947, __pyx_L1_error)
26795 if (__Pyx_setup_reduce((PyObject *) __pyx_mstate->__pyx_memoryviewslice_type) < (0)) __PYX_ERR(1, 947, __pyx_L1_error)
26796 __Pyx_RefNannyFinishContext();
26799 __Pyx_XDECREF(__pyx_t_1);
26800 __Pyx_RefNannyFinishContext();
26804static int __Pyx_modinit_Type_import_code(__pyx_mstatetype *__pyx_mstate) {
26805 __Pyx_RefNannyDeclarations
26806 PyObject *__pyx_t_1 = NULL;
26807 int __pyx_lineno = 0;
26808 const char *__pyx_filename = NULL;
26809 int __pyx_clineno = 0;
26810 CYTHON_UNUSED_VAR(__pyx_mstate);
26811 __Pyx_RefNannySetupContext(
"__Pyx_modinit_Type_import_code", 0);
26813 __pyx_t_1 = PyImport_ImportModule(__Pyx_BUILTIN_MODULE_NAME);
if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 9, __pyx_L1_error)
26814 __Pyx_GOTREF(__pyx_t_1);
26815 __pyx_mstate->__pyx_ptype_7cpython_4type_type = __Pyx_ImportType_3_3_0(__pyx_t_1, __Pyx_BUILTIN_MODULE_NAME,
"type",
26816 #
if defined(PYPY_VERSION_NUM) && PYPY_VERSION_NUM < 0x050B0000
26817 sizeof(PyTypeObject), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(PyTypeObject),
26818 #elif CYTHON_COMPILING_IN_LIMITED_API
26821 sizeof(PyHeapTypeObject), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(PyHeapTypeObject),
26823 __Pyx_ImportType_CheckSize_Warn_3_3_0);
if (!__pyx_mstate->__pyx_ptype_7cpython_4type_type) __PYX_ERR(3, 9, __pyx_L1_error)
26824 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
26825 __pyx_t_1 = PyImport_ImportModule(
"numpy");
if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 229, __pyx_L1_error)
26826 __Pyx_GOTREF(__pyx_t_1);
26827 __pyx_mstate->__pyx_ptype_5numpy_dtype = __Pyx_ImportType_3_3_0(__pyx_t_1,
"numpy",
"dtype",
26828 #
if defined(PYPY_VERSION_NUM) && PYPY_VERSION_NUM < 0x050B0000
26829 sizeof(PyArray_Descr), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(PyArray_Descr),
26830 #elif CYTHON_COMPILING_IN_LIMITED_API
26831 sizeof(PyArray_Descr), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(PyArray_Descr),
26833 sizeof(PyArray_Descr), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(PyArray_Descr),
26835 __Pyx_ImportType_CheckSize_Ignore_3_3_0);
if (!__pyx_mstate->__pyx_ptype_5numpy_dtype) __PYX_ERR(2, 229, __pyx_L1_error)
26836 __pyx_mstate->__pyx_ptype_5numpy_flatiter = __Pyx_ImportType_3_3_0(__pyx_t_1,
"numpy",
"flatiter",
26837 #
if defined(PYPY_VERSION_NUM) && PYPY_VERSION_NUM < 0x050B0000
26838 sizeof(PyArrayIterObject), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(PyArrayIterObject),
26839 #elif CYTHON_COMPILING_IN_LIMITED_API
26840 sizeof(PyArrayIterObject), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(PyArrayIterObject),
26842 sizeof(PyArrayIterObject), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(PyArrayIterObject),
26844 __Pyx_ImportType_CheckSize_Ignore_3_3_0);
if (!__pyx_mstate->__pyx_ptype_5numpy_flatiter) __PYX_ERR(2, 286, __pyx_L1_error)
26845 __pyx_mstate->__pyx_ptype_5numpy_broadcast = __Pyx_ImportType_3_3_0(__pyx_t_1,
"numpy",
"broadcast",
26846 #
if defined(PYPY_VERSION_NUM) && PYPY_VERSION_NUM < 0x050B0000
26847 sizeof(PyArrayMultiIterObject), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(PyArrayMultiIterObject),
26848 #elif CYTHON_COMPILING_IN_LIMITED_API
26849 sizeof(PyArrayMultiIterObject), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(PyArrayMultiIterObject),
26851 sizeof(PyArrayMultiIterObject), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(PyArrayMultiIterObject),
26853 __Pyx_ImportType_CheckSize_Ignore_3_3_0);
if (!__pyx_mstate->__pyx_ptype_5numpy_broadcast) __PYX_ERR(2, 290, __pyx_L1_error)
26854 __pyx_mstate->__pyx_ptype_5numpy_ndarray = __Pyx_ImportType_3_3_0(__pyx_t_1,
"numpy",
"ndarray",
26855 #
if defined(PYPY_VERSION_NUM) && PYPY_VERSION_NUM < 0x050B0000
26856 sizeof(PyArrayObject), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(PyArrayObject),
26857 #elif CYTHON_COMPILING_IN_LIMITED_API
26858 sizeof(PyArrayObject), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(PyArrayObject),
26860 sizeof(PyArrayObject), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(PyArrayObject),
26862 __Pyx_ImportType_CheckSize_Ignore_3_3_0);
if (!__pyx_mstate->__pyx_ptype_5numpy_ndarray) __PYX_ERR(2, 329, __pyx_L1_error)
26863 __pyx_mstate->__pyx_ptype_5numpy_generic = __Pyx_ImportType_3_3_0(__pyx_t_1,
"numpy",
"generic",
26864 #
if defined(PYPY_VERSION_NUM) && PYPY_VERSION_NUM < 0x050B0000
26865 sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(PyObject),
26866 #elif CYTHON_COMPILING_IN_LIMITED_API
26867 sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(PyObject),
26869 sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(PyObject),
26871 __Pyx_ImportType_CheckSize_Warn_3_3_0);
if (!__pyx_mstate->__pyx_ptype_5numpy_generic) __PYX_ERR(2, 847, __pyx_L1_error)
26872 __pyx_mstate->__pyx_ptype_5numpy_number = __Pyx_ImportType_3_3_0(__pyx_t_1,
"numpy",
"number",
26873 #
if defined(PYPY_VERSION_NUM) && PYPY_VERSION_NUM < 0x050B0000
26874 sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(PyObject),
26875 #elif CYTHON_COMPILING_IN_LIMITED_API
26876 sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(PyObject),
26878 sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(PyObject),
26880 __Pyx_ImportType_CheckSize_Warn_3_3_0);
if (!__pyx_mstate->__pyx_ptype_5numpy_number) __PYX_ERR(2, 849, __pyx_L1_error)
26881 __pyx_mstate->__pyx_ptype_5numpy_integer = __Pyx_ImportType_3_3_0(__pyx_t_1,
"numpy",
"integer",
26882 #
if defined(PYPY_VERSION_NUM) && PYPY_VERSION_NUM < 0x050B0000
26883 sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(PyObject),
26884 #elif CYTHON_COMPILING_IN_LIMITED_API
26885 sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(PyObject),
26887 sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(PyObject),
26889 __Pyx_ImportType_CheckSize_Warn_3_3_0);
if (!__pyx_mstate->__pyx_ptype_5numpy_integer) __PYX_ERR(2, 851, __pyx_L1_error)
26890 __pyx_mstate->__pyx_ptype_5numpy_signedinteger = __Pyx_ImportType_3_3_0(__pyx_t_1,
"numpy",
"signedinteger",
26891 #
if defined(PYPY_VERSION_NUM) && PYPY_VERSION_NUM < 0x050B0000
26892 sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(PyObject),
26893 #elif CYTHON_COMPILING_IN_LIMITED_API
26894 sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(PyObject),
26896 sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(PyObject),
26898 __Pyx_ImportType_CheckSize_Warn_3_3_0);
if (!__pyx_mstate->__pyx_ptype_5numpy_signedinteger) __PYX_ERR(2, 853, __pyx_L1_error)
26899 __pyx_mstate->__pyx_ptype_5numpy_unsignedinteger = __Pyx_ImportType_3_3_0(__pyx_t_1,
"numpy",
"unsignedinteger",
26900 #
if defined(PYPY_VERSION_NUM) && PYPY_VERSION_NUM < 0x050B0000
26901 sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(PyObject),
26902 #elif CYTHON_COMPILING_IN_LIMITED_API
26903 sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(PyObject),
26905 sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(PyObject),
26907 __Pyx_ImportType_CheckSize_Warn_3_3_0);
if (!__pyx_mstate->__pyx_ptype_5numpy_unsignedinteger) __PYX_ERR(2, 855, __pyx_L1_error)
26908 __pyx_mstate->__pyx_ptype_5numpy_inexact = __Pyx_ImportType_3_3_0(__pyx_t_1,
"numpy",
"inexact",
26909 #
if defined(PYPY_VERSION_NUM) && PYPY_VERSION_NUM < 0x050B0000
26910 sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(PyObject),
26911 #elif CYTHON_COMPILING_IN_LIMITED_API
26912 sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(PyObject),
26914 sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(PyObject),
26916 __Pyx_ImportType_CheckSize_Warn_3_3_0);
if (!__pyx_mstate->__pyx_ptype_5numpy_inexact) __PYX_ERR(2, 857, __pyx_L1_error)
26917 __pyx_mstate->__pyx_ptype_5numpy_floating = __Pyx_ImportType_3_3_0(__pyx_t_1,
"numpy",
"floating",
26918 #
if defined(PYPY_VERSION_NUM) && PYPY_VERSION_NUM < 0x050B0000
26919 sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(PyObject),
26920 #elif CYTHON_COMPILING_IN_LIMITED_API
26921 sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(PyObject),
26923 sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(PyObject),
26925 __Pyx_ImportType_CheckSize_Warn_3_3_0);
if (!__pyx_mstate->__pyx_ptype_5numpy_floating) __PYX_ERR(2, 859, __pyx_L1_error)
26926 __pyx_mstate->__pyx_ptype_5numpy_complexfloating = __Pyx_ImportType_3_3_0(__pyx_t_1,
"numpy",
"complexfloating",
26927 #
if defined(PYPY_VERSION_NUM) && PYPY_VERSION_NUM < 0x050B0000
26928 sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(PyObject),
26929 #elif CYTHON_COMPILING_IN_LIMITED_API
26930 sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(PyObject),
26932 sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(PyObject),
26934 __Pyx_ImportType_CheckSize_Warn_3_3_0);
if (!__pyx_mstate->__pyx_ptype_5numpy_complexfloating) __PYX_ERR(2, 861, __pyx_L1_error)
26935 __pyx_mstate->__pyx_ptype_5numpy_flexible = __Pyx_ImportType_3_3_0(__pyx_t_1,
"numpy",
"flexible",
26936 #
if defined(PYPY_VERSION_NUM) && PYPY_VERSION_NUM < 0x050B0000
26937 sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(PyObject),
26938 #elif CYTHON_COMPILING_IN_LIMITED_API
26939 sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(PyObject),
26941 sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(PyObject),
26943 __Pyx_ImportType_CheckSize_Warn_3_3_0);
if (!__pyx_mstate->__pyx_ptype_5numpy_flexible) __PYX_ERR(2, 863, __pyx_L1_error)
26944 __pyx_mstate->__pyx_ptype_5numpy_character = __Pyx_ImportType_3_3_0(__pyx_t_1,
"numpy",
"character",
26945 #
if defined(PYPY_VERSION_NUM) && PYPY_VERSION_NUM < 0x050B0000
26946 sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(PyObject),
26947 #elif CYTHON_COMPILING_IN_LIMITED_API
26948 sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(PyObject),
26950 sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(PyObject),
26952 __Pyx_ImportType_CheckSize_Warn_3_3_0);
if (!__pyx_mstate->__pyx_ptype_5numpy_character) __PYX_ERR(2, 865, __pyx_L1_error)
26953 __pyx_mstate->__pyx_ptype_5numpy_ufunc = __Pyx_ImportType_3_3_0(__pyx_t_1,
"numpy",
"ufunc",
26954 #
if defined(PYPY_VERSION_NUM) && PYPY_VERSION_NUM < 0x050B0000
26955 sizeof(PyUFuncObject), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(PyUFuncObject),
26956 #elif CYTHON_COMPILING_IN_LIMITED_API
26957 sizeof(PyUFuncObject), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(PyUFuncObject),
26959 sizeof(PyUFuncObject), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(PyUFuncObject),
26961 __Pyx_ImportType_CheckSize_Ignore_3_3_0);
if (!__pyx_mstate->__pyx_ptype_5numpy_ufunc) __PYX_ERR(2, 946, __pyx_L1_error)
26962 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
26963 __Pyx_RefNannyFinishContext();
26966 __Pyx_XDECREF(__pyx_t_1);
26967 __Pyx_RefNannyFinishContext();
26971static int __Pyx_modinit_Variable_import_code(__pyx_mstatetype *__pyx_mstate) {
26972 __Pyx_RefNannyDeclarations
26973 CYTHON_UNUSED_VAR(__pyx_mstate);
26974 __Pyx_RefNannySetupContext(
"__Pyx_modinit_Variable_import_code", 0);
26976 __Pyx_RefNannyFinishContext();
26980static int __Pyx_modinit_Function_import_code(__pyx_mstatetype *__pyx_mstate) {
26981 __Pyx_RefNannyDeclarations
26982 CYTHON_UNUSED_VAR(__pyx_mstate);
26983 __Pyx_RefNannySetupContext(
"__Pyx_modinit_Function_import_code", 0);
26985 __Pyx_RefNannyFinishContext();
26989#if CYTHON_PEP489_MULTI_PHASE_INIT
26990static PyObject* __pyx_pymod_create(PyObject *spec, PyModuleDef *def);
26991static int __pyx_pymod_exec_superluWrappers(PyObject* module);
26992static PyModuleDef_Slot __pyx_moduledef_slots[] = {
26993 {Py_mod_create, (
void*)__pyx_pymod_create},
26994 {Py_mod_exec, (
void*)__pyx_pymod_exec_superluWrappers},
26995 #if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING
26996 {Py_mod_gil, __Pyx_FREETHREADING_COMPATIBLE},
26998 #if PY_VERSION_HEX >= 0x030C0000 && CYTHON_USE_MODULE_STATE
26999 {Py_mod_multiple_interpreters, Py_MOD_MULTIPLE_INTERPRETERS_NOT_SUPPORTED},
27007 struct PyModuleDef __pyx_moduledef =
27009 static struct PyModuleDef __pyx_moduledef =
27012 PyModuleDef_HEAD_INIT,
27015 #if CYTHON_USE_MODULE_STATE
27016 sizeof(__pyx_mstatetype),
27018 (CYTHON_PEP489_MULTI_PHASE_INIT) ? 0 : -1,
27021 #if CYTHON_PEP489_MULTI_PHASE_INIT
27022 __pyx_moduledef_slots,
27026 #if CYTHON_USE_MODULE_STATE
27041#ifndef CYTHON_NO_PYINIT_EXPORT
27042 #define __Pyx_PyMODINIT_FUNC PyMODINIT_FUNC
27045 #define __Pyx_PyMODINIT_FUNC extern "C" PyObject *
27047 #define __Pyx_PyMODINIT_FUNC PyObject *
27051__Pyx_PyMODINIT_FUNC PyInit_superluWrappers(
void) CYTHON_SMALL_CODE;
27052__Pyx_PyMODINIT_FUNC PyInit_superluWrappers(
void)
27053#if CYTHON_PEP489_MULTI_PHASE_INIT
27055 return PyModuleDef_Init(&__pyx_moduledef);
27058#if CYTHON_COMPILING_IN_LIMITED_API && (__PYX_LIMITED_VERSION_HEX < 0x030A0000 &&\
27059 (defined(_WIN32) || defined(WIN32) || defined(MS_WINDOWS)))
27060static PY_INT64_T __Pyx_GetCurrentInterpreterId(
void) {
27062 PyObject *module = PyImport_ImportModule(
"_interpreters");
27064 if (!PyErr_ExceptionMatches(PyExc_Exception)) {
27068 module = PyImport_ImportModule("_xxsubinterpreters");
27069 if (!module)
goto bad;
27071 PyObject *current = PyObject_CallMethod(module,
"get_current", NULL);
27073 if (!current)
goto bad;
27074 if (PyTuple_Check(current)) {
27075 PyObject *new_current = PySequence_GetItem(current, 0);
27076 Py_DECREF(current);
27077 current = new_current;
27078 if (!new_current)
goto bad;
27080 long long as_c_int = PyLong_AsLongLong(current);
27081 Py_DECREF(current);
27085 PySys_WriteStderr(
"__Pyx_GetCurrentInterpreterId failed. Try setting the C define CYTHON_PEP489_MULTI_PHASE_INIT=0\n");
27089#if !CYTHON_USE_MODULE_STATE
27090static CYTHON_SMALL_CODE
int __Pyx_check_single_interpreter(
void) {
27091 static PY_INT64_T main_interpreter_id = -1;
27092#if CYTHON_COMPILING_IN_GRAAL && defined(GRAALPY_VERSION_NUM) && GRAALPY_VERSION_NUM > 0x19000000
27093 PY_INT64_T current_id = GraalPyInterpreterState_GetIDFromThreadState(PyThreadState_Get());
27094#elif CYTHON_COMPILING_IN_GRAAL
27095 PY_INT64_T current_id = PyInterpreterState_GetIDFromThreadState(PyThreadState_Get());
27096#elif CYTHON_COMPILING_IN_LIMITED_API && (__PYX_LIMITED_VERSION_HEX < 0x030A0000 &&\
27097 (defined(_WIN32) || defined(WIN32) || defined(MS_WINDOWS)))
27098 PY_INT64_T current_id = __Pyx_GetCurrentInterpreterId();
27099#elif CYTHON_COMPILING_IN_LIMITED_API
27100 PY_INT64_T current_id = PyInterpreterState_GetID(PyInterpreterState_Get());
27102 PY_INT64_T current_id = PyInterpreterState_GetID(PyThreadState_Get()->interp);
27104 if (unlikely(current_id == -1)) {
27107 if (main_interpreter_id == -1) {
27108 main_interpreter_id = current_id;
27110 }
else if (unlikely(main_interpreter_id != current_id)) {
27113 "Interpreter change detected - this module can only be loaded into one interpreter per process.");
27119static CYTHON_SMALL_CODE
int __Pyx_copy_spec_to_module(PyObject *spec, PyObject *moddict,
const char* from_name,
const char* to_name,
int allow_none)
27121 PyObject *value = PyObject_GetAttrString(spec, from_name);
27123 if (likely(value)) {
27124 if (allow_none || value != Py_None) {
27125 result = PyDict_SetItemString(moddict, to_name, value);
27128 }
else if (PyErr_ExceptionMatches(PyExc_AttributeError)) {
27135static CYTHON_SMALL_CODE PyObject* __pyx_pymod_create(PyObject *spec, PyModuleDef *def) {
27136 PyObject *module = NULL, *moddict, *modname;
27137 CYTHON_UNUSED_VAR(def);
27138 #if !CYTHON_USE_MODULE_STATE
27139 if (__Pyx_check_single_interpreter())
27143 return __Pyx_NewRef(__pyx_m);
27144 modname = PyObject_GetAttrString(spec,
"name");
27145 if (unlikely(!modname))
goto bad;
27146 module = PyModule_NewObject(modname);
27147 Py_DECREF(modname);
27148 if (unlikely(!module))
goto bad;
27149 moddict = PyModule_GetDict(module);
27150 if (unlikely(!moddict))
goto bad;
27151 if (unlikely(__Pyx_copy_spec_to_module(spec, moddict,
"loader",
"__loader__", 1) < 0))
goto bad;
27152 if (unlikely(__Pyx_copy_spec_to_module(spec, moddict,
"origin",
"__file__", 1) < 0))
goto bad;
27153 if (unlikely(__Pyx_copy_spec_to_module(spec, moddict,
"parent",
"__package__", 1) < 0))
goto bad;
27154 if (unlikely(__Pyx_copy_spec_to_module(spec, moddict,
"submodule_search_locations",
"__path__", 0) < 0))
goto bad;
27157 Py_XDECREF(module);
27162static CYTHON_SMALL_CODE
int __pyx_pymod_exec_superluWrappers(PyObject *__pyx_pyinit_module)
27165 int stringtab_initialized = 0;
27166 #if CYTHON_USE_MODULE_STATE
27167 int pystate_addmodule_run = 0;
27169 __pyx_mstatetype *__pyx_mstate = NULL;
27170 PyObject *__pyx_t_1 = NULL;
27171 PyObject *__pyx_t_2 = NULL;
27172 PyObject *__pyx_t_3 = NULL;
27173 PyObject *__pyx_t_4 = NULL;
27174 PyObject *__pyx_t_5 = NULL;
27176 static PyThread_type_lock __pyx_t_7[8];
27178 PyObject *__pyx_t_9 = NULL;
27179 PyObject *__pyx_t_10 = NULL;
27180 int __pyx_lineno = 0;
27181 const char *__pyx_filename = NULL;
27182 int __pyx_clineno = 0;
27183 __Pyx_RefNannyDeclarations
27184 #if CYTHON_PEP489_MULTI_PHASE_INIT
27186 if (__pyx_m == __pyx_pyinit_module)
return 0;
27187 PyErr_SetString(PyExc_RuntimeError,
"Module 'superluWrappers' has already been imported. Re-initialisation is not supported.");
27191 if (__pyx_m)
return __Pyx_NewRef(__pyx_m);
27194 #if CYTHON_PEP489_MULTI_PHASE_INIT
27195 __pyx_t_1 = __pyx_pyinit_module;
27196 Py_INCREF(__pyx_t_1);
27198 __pyx_t_1 = PyModule_Create(&__pyx_moduledef);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1, __pyx_L1_error)
27200 #if CYTHON_USE_MODULE_STATE
27202 int add_module_result = __Pyx_State_AddModule(__pyx_t_1, &__pyx_moduledef);
27204 if (unlikely((add_module_result < 0))) __PYX_ERR(0, 1, __pyx_L1_error)
27205 pystate_addmodule_run = 1;
27208 __pyx_m = __pyx_t_1;
27210 #if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING
27211 PyUnstable_Module_SetGIL(__pyx_m, Py_MOD_GIL_USED);
27213 __pyx_mstate = __pyx_mstate_global;
27214 CYTHON_UNUSED_VAR(__pyx_t_1);
27215 __pyx_mstate->__pyx_d = PyModule_GetDict(__pyx_m);
if (unlikely(!__pyx_mstate->__pyx_d)) __PYX_ERR(0, 1, __pyx_L1_error)
27216 Py_INCREF(__pyx_mstate->__pyx_d);
27217 __pyx_mstate->__pyx_b = __Pyx_PyImport_AddModuleRef(__Pyx_BUILTIN_MODULE_NAME);
if (unlikely(!__pyx_mstate->__pyx_b)) __PYX_ERR(0, 1, __pyx_L1_error)
27218 __pyx_mstate->__pyx_cython_runtime = __Pyx_PyImport_AddModuleRef(
"cython_runtime");
if (unlikely(!__pyx_mstate->__pyx_cython_runtime)) __PYX_ERR(0, 1, __pyx_L1_error)
27219 if (PyObject_SetAttrString(__pyx_m,
"__builtins__", __pyx_mstate->__pyx_b) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
27221 #if CYTHON_REFNANNY
27222 __Pyx_RefNanny = __Pyx_RefNannyImportAPI(
"refnanny");
27223 if (!__Pyx_RefNanny) {
27224 if (PyErr_ExceptionMatches(PyExc_Exception)) {
27226 __Pyx_RefNanny = __Pyx_RefNannyImportAPI(
"Cython.Runtime.refnanny");
27228 if (!__Pyx_RefNanny)
27229 Py_FatalError(
"failed to import 'refnanny' module");
27233__Pyx_RefNannySetupContext(
"PyInit_superluWrappers", 0);
27234 __Pyx_init_runtime_version();
27235 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)
27236 __pyx_mstate->__pyx_empty_tuple = PyTuple_New(0);
if (unlikely(!__pyx_mstate->__pyx_empty_tuple)) __PYX_ERR(0, 1, __pyx_L1_error)
27237 __pyx_mstate->__pyx_empty_bytes = PyBytes_FromStringAndSize(
"", 0);
if (unlikely(!__pyx_mstate->__pyx_empty_bytes)) __PYX_ERR(0, 1, __pyx_L1_error)
27238 __pyx_mstate->__pyx_empty_unicode = PyUnicode_FromStringAndSize(
"", 0);
if (unlikely(!__pyx_mstate->__pyx_empty_unicode)) __PYX_ERR(0, 1, __pyx_L1_error)
27241 if (__Pyx_InitConstants(__pyx_mstate) < (0)) __PYX_ERR(0, 1, __pyx_L1_error)
27242 stringtab_initialized = 1;
27243 if (__Pyx_InitGlobals() < (0)) __PYX_ERR(0, 1, __pyx_L1_error)
27244 if (__pyx_module_is_main_superluWrappers) {
27245 if (PyObject_SetAttr(__pyx_m, __pyx_mstate_global->__pyx_n_u_name_2, __pyx_mstate_global->__pyx_n_u_main) < (0)) __PYX_ERR(0, 1, __pyx_L1_error)
27248 PyObject *modules = PyImport_GetModuleDict();
if (unlikely(!modules)) __PYX_ERR(0, 1, __pyx_L1_error)
27249 if (!PyDict_GetItemString(modules,
"superluWrappers")) {
27250 if (unlikely((PyDict_SetItemString(modules,
"superluWrappers", __pyx_m) < 0))) __PYX_ERR(0, 1, __pyx_L1_error)
27254 if (__Pyx_InitCachedBuiltins(__pyx_mstate) < (0)) __PYX_ERR(0, 1, __pyx_L1_error)
27256 if (__Pyx_InitCachedConstants(__pyx_mstate) < (0)) __PYX_ERR(0, 1, __pyx_L1_error)
27257 if (__Pyx_CreateCodeObjects(__pyx_mstate) < (0)) __PYX_ERR(0, 1, __pyx_L1_error)
27259 (void)__Pyx_modinit_Global_init_code(__pyx_mstate);
27260 (void)__Pyx_modinit_Variable_export_code(__pyx_mstate);
27261 (void)__Pyx_modinit_Function_export_code(__pyx_mstate);
27263 if (unlikely((__Pyx_modinit_Exttype___pyx_obj_15superluWrappers_cSparseMatrix(__pyx_mstate) < 0))) __PYX_ERR(0, 1, __pyx_L1_error)
27264 if (unlikely((__Pyx_modinit_Exttype___pyx_obj_15superluWrappers_SparseFactor(__pyx_mstate) < 0))) __PYX_ERR(0, 1, __pyx_L1_error)
27265 if (unlikely((__Pyx_modinit_Exttype___pyx_array_obj(__pyx_mstate) < 0))) __PYX_ERR(0, 1, __pyx_L1_error)
27266 if (unlikely((__Pyx_modinit_Exttype___pyx_MemviewEnum_obj(__pyx_mstate) < 0))) __PYX_ERR(0, 1, __pyx_L1_error)
27267 if (unlikely((__Pyx_modinit_Exttype___pyx_memoryview_obj(__pyx_mstate) < 0))) __PYX_ERR(0, 1, __pyx_L1_error)
27268 if (unlikely((__Pyx_modinit_Exttype___pyx_memoryviewslice_obj(__pyx_mstate) < 0))) __PYX_ERR(0, 1, __pyx_L1_error)
27269 if (unlikely((__Pyx_modinit_Type_import_code(__pyx_mstate) < 0))) __PYX_ERR(0, 1, __pyx_L1_error)
27270 (void)__Pyx_modinit_Variable_import_code(__pyx_mstate);
27271 (void)__Pyx_modinit_Function_import_code(__pyx_mstate);
27272 if (__Pyx_InitAfterSharedUtility() < (0)) __PYX_ERR(0, 1, __pyx_L1_error)
27283 __Pyx_PyThreadState_declare
27284 __Pyx_PyThreadState_assign
27285 __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
27286 __Pyx_XGOTREF(__pyx_t_1);
27287 __Pyx_XGOTREF(__pyx_t_2);
27288 __Pyx_XGOTREF(__pyx_t_3);
27301 PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_mstate_global->__pyx_kp_u_collections_abc};
27302 __pyx_t_4 = __Pyx_PyObject_FastCall((PyObject*)__pyx_builtin___import__, __pyx_callargs+__pyx_t_6, (2-__pyx_t_6) | (__pyx_t_6*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
27303 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
27304 if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 119, __pyx_L2_error)
27305 __Pyx_GOTREF(__pyx_t_4);
27307 __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_abc);
if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 119, __pyx_L2_error)
27308 __Pyx_GOTREF(__pyx_t_5);
27309 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
27310 __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_Sequence);
if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 119, __pyx_L2_error)
27311 __Pyx_GOTREF(__pyx_t_4);
27312 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
27313 __Pyx_XGOTREF(__pyx_collections_abc_Sequence);
27314 __Pyx_DECREF_SET(__pyx_collections_abc_Sequence, __pyx_t_4);
27315 __Pyx_GIVEREF(__pyx_t_4);
27326 __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
27327 __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
27328 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
27329 goto __pyx_L7_try_end;
27331 __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
27332 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
27342 __Pyx_ErrRestore(0,0,0);
27351 __Pyx_INCREF(Py_None);
27352 __Pyx_XGOTREF(__pyx_collections_abc_Sequence);
27353 __Pyx_DECREF_SET(__pyx_collections_abc_Sequence, Py_None);
27354 __Pyx_GIVEREF(Py_None);
27355 goto __pyx_L3_exception_handled;
27357 __pyx_L3_exception_handled:;
27358 __Pyx_XGIVEREF(__pyx_t_1);
27359 __Pyx_XGIVEREF(__pyx_t_2);
27360 __Pyx_XGIVEREF(__pyx_t_3);
27361 __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
27373 __Pyx_PyThreadState_declare
27374 __Pyx_PyThreadState_assign
27375 __Pyx_ExceptionSave(&__pyx_t_3, &__pyx_t_2, &__pyx_t_1);
27376 __Pyx_XGOTREF(__pyx_t_3);
27377 __Pyx_XGOTREF(__pyx_t_2);
27378 __Pyx_XGOTREF(__pyx_t_1);
27388 __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_collections_abc_Sequence, __pyx_mstate_global->__pyx_n_u_count);
if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 259, __pyx_L10_error)
27389 __Pyx_GOTREF(__pyx_t_4);
27390 if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_array_type, __pyx_mstate_global->__pyx_n_u_count, __pyx_t_4) < (0)) __PYX_ERR(1, 259, __pyx_L10_error)
27391 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
27400 __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_collections_abc_Sequence, __pyx_mstate_global->__pyx_n_u_index);
if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 260, __pyx_L10_error)
27401 __Pyx_GOTREF(__pyx_t_4);
27402 if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_array_type, __pyx_mstate_global->__pyx_n_u_index, __pyx_t_4) < (0)) __PYX_ERR(1, 260, __pyx_L10_error)
27403 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
27413 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
27414 __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
27415 __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
27416 goto __pyx_L15_try_end;
27418 __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
27419 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
27429 __Pyx_ErrRestore(0,0,0);
27430 goto __pyx_L11_exception_handled;
27432 __pyx_L11_exception_handled:;
27433 __Pyx_XGIVEREF(__pyx_t_3);
27434 __Pyx_XGIVEREF(__pyx_t_2);
27435 __Pyx_XGIVEREF(__pyx_t_1);
27436 __Pyx_ExceptionReset(__pyx_t_3, __pyx_t_2, __pyx_t_1);
27437 __pyx_L15_try_end:;
27450 PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_mstate_global->__pyx_kp_u_strided_and_direct_or_indirect};
27451 __pyx_t_4 = __Pyx_PyObject_FastCall((PyObject*)__pyx_mstate_global->__pyx_MemviewEnum_type, __pyx_callargs+__pyx_t_6, (2-__pyx_t_6) | (__pyx_t_6*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
27452 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
27453 if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 326, __pyx_L1_error)
27454 __Pyx_GOTREF((PyObject *)__pyx_t_4);
27456 __Pyx_XGOTREF(generic);
27457 __Pyx_DECREF_SET(generic, ((PyObject *)__pyx_t_4));
27458 __Pyx_GIVEREF((PyObject *)__pyx_t_4);
27471 PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_mstate_global->__pyx_kp_u_strided_and_direct};
27472 __pyx_t_4 = __Pyx_PyObject_FastCall((PyObject*)__pyx_mstate_global->__pyx_MemviewEnum_type, __pyx_callargs+__pyx_t_6, (2-__pyx_t_6) | (__pyx_t_6*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
27473 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
27474 if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 327, __pyx_L1_error)
27475 __Pyx_GOTREF((PyObject *)__pyx_t_4);
27477 __Pyx_XGOTREF(strided);
27478 __Pyx_DECREF_SET(strided, ((PyObject *)__pyx_t_4));
27479 __Pyx_GIVEREF((PyObject *)__pyx_t_4);
27492 PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_mstate_global->__pyx_kp_u_strided_and_indirect};
27493 __pyx_t_4 = __Pyx_PyObject_FastCall((PyObject*)__pyx_mstate_global->__pyx_MemviewEnum_type, __pyx_callargs+__pyx_t_6, (2-__pyx_t_6) | (__pyx_t_6*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
27494 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
27495 if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 328, __pyx_L1_error)
27496 __Pyx_GOTREF((PyObject *)__pyx_t_4);
27498 __Pyx_XGOTREF(indirect);
27499 __Pyx_DECREF_SET(indirect, ((PyObject *)__pyx_t_4));
27500 __Pyx_GIVEREF((PyObject *)__pyx_t_4);
27513 PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_mstate_global->__pyx_kp_u_contiguous_and_direct};
27514 __pyx_t_4 = __Pyx_PyObject_FastCall((PyObject*)__pyx_mstate_global->__pyx_MemviewEnum_type, __pyx_callargs+__pyx_t_6, (2-__pyx_t_6) | (__pyx_t_6*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
27515 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
27516 if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 331, __pyx_L1_error)
27517 __Pyx_GOTREF((PyObject *)__pyx_t_4);
27519 __Pyx_XGOTREF(contiguous);
27520 __Pyx_DECREF_SET(contiguous, ((PyObject *)__pyx_t_4));
27521 __Pyx_GIVEREF((PyObject *)__pyx_t_4);
27534 PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_mstate_global->__pyx_kp_u_contiguous_and_indirect};
27535 __pyx_t_4 = __Pyx_PyObject_FastCall((PyObject*)__pyx_mstate_global->__pyx_MemviewEnum_type, __pyx_callargs+__pyx_t_6, (2-__pyx_t_6) | (__pyx_t_6*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
27536 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
27537 if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 332, __pyx_L1_error)
27538 __Pyx_GOTREF((PyObject *)__pyx_t_4);
27540 __Pyx_XGOTREF(indirect_contiguous);
27541 __Pyx_DECREF_SET(indirect_contiguous, ((PyObject *)__pyx_t_4));
27542 __Pyx_GIVEREF((PyObject *)__pyx_t_4);
27552 __pyx_memoryview_thread_locks_used = 0;
27561 __pyx_t_7[0] = PyThread_allocate_lock();
27562 __pyx_t_7[1] = PyThread_allocate_lock();
27563 __pyx_t_7[2] = PyThread_allocate_lock();
27564 __pyx_t_7[3] = PyThread_allocate_lock();
27565 __pyx_t_7[4] = PyThread_allocate_lock();
27566 __pyx_t_7[5] = PyThread_allocate_lock();
27567 __pyx_t_7[6] = PyThread_allocate_lock();
27568 __pyx_t_7[7] = PyThread_allocate_lock();
27569 memcpy(&(__pyx_memoryview_thread_locks[0]), __pyx_t_7,
sizeof(__pyx_memoryview_thread_locks[0]) * (8));
27579 __Pyx_PyThreadState_declare
27580 __Pyx_PyThreadState_assign
27581 __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
27582 __Pyx_XGOTREF(__pyx_t_1);
27583 __Pyx_XGOTREF(__pyx_t_2);
27584 __Pyx_XGOTREF(__pyx_t_3);
27594 __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_collections_abc_Sequence, __pyx_mstate_global->__pyx_n_u_count);
if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 980, __pyx_L18_error)
27595 __Pyx_GOTREF(__pyx_t_4);
27596 if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_memoryviewslice_type, __pyx_mstate_global->__pyx_n_u_count, __pyx_t_4) < (0)) __PYX_ERR(1, 980, __pyx_L18_error)
27597 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
27606 __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_collections_abc_Sequence, __pyx_mstate_global->__pyx_n_u_index);
if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 981, __pyx_L18_error)
27607 __Pyx_GOTREF(__pyx_t_4);
27608 if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_memoryviewslice_type, __pyx_mstate_global->__pyx_n_u_index, __pyx_t_4) < (0)) __PYX_ERR(1, 981, __pyx_L18_error)
27609 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
27619 __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
27620 __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
27621 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
27622 goto __pyx_L23_try_end;
27624 __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
27625 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
27635 __Pyx_ErrRestore(0,0,0);
27636 goto __pyx_L19_exception_handled;
27638 __pyx_L19_exception_handled:;
27639 __Pyx_XGIVEREF(__pyx_t_1);
27640 __Pyx_XGIVEREF(__pyx_t_2);
27641 __Pyx_XGIVEREF(__pyx_t_3);
27642 __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
27643 __pyx_L23_try_end:;
27654 __Pyx_PyThreadState_declare
27655 __Pyx_PyThreadState_assign
27656 __Pyx_ExceptionSave(&__pyx_t_3, &__pyx_t_2, &__pyx_t_1);
27657 __Pyx_XGOTREF(__pyx_t_3);
27658 __Pyx_XGOTREF(__pyx_t_2);
27659 __Pyx_XGOTREF(__pyx_t_1);
27669 __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_collections_abc_Sequence);
if (unlikely((__pyx_t_8 < 0))) __PYX_ERR(1, 986, __pyx_L26_error)
27680 __pyx_t_5 = __pyx_collections_abc_Sequence;
27681 __Pyx_INCREF(__pyx_t_5);
27684 PyObject *__pyx_callargs[2] = {__pyx_t_5, ((PyObject *)__pyx_mstate_global->__pyx_memoryviewslice_type)};
27685 __pyx_t_4 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_register, __pyx_callargs+__pyx_t_6, (2-__pyx_t_6) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
27686 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
27687 if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 990, __pyx_L26_error)
27688 __Pyx_GOTREF(__pyx_t_4);
27690 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
27699 __pyx_t_5 = __pyx_collections_abc_Sequence;
27700 __Pyx_INCREF(__pyx_t_5);
27703 PyObject *__pyx_callargs[2] = {__pyx_t_5, ((PyObject *)__pyx_mstate_global->__pyx_array_type)};
27704 __pyx_t_4 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_register, __pyx_callargs+__pyx_t_6, (2-__pyx_t_6) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
27705 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
27706 if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 991, __pyx_L26_error)
27707 __Pyx_GOTREF(__pyx_t_4);
27709 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
27728 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
27729 __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
27730 __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
27731 goto __pyx_L31_try_end;
27733 __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
27734 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
27744 __Pyx_ErrRestore(0,0,0);
27745 goto __pyx_L27_exception_handled;
27747 __pyx_L27_exception_handled:;
27748 __Pyx_XGIVEREF(__pyx_t_3);
27749 __Pyx_XGIVEREF(__pyx_t_2);
27750 __Pyx_XGIVEREF(__pyx_t_1);
27751 __Pyx_ExceptionReset(__pyx_t_3, __pyx_t_2, __pyx_t_1);
27752 __pyx_L31_try_end:;
27762 __pyx_t_4 = PyCFunction_NewEx(&__pyx_mdef_15View_dot_MemoryView_1__pyx_unpickle_Enum, NULL, __pyx_mstate_global->__pyx_n_u_View_MemoryView);
if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 4, __pyx_L1_error)
27763 __Pyx_GOTREF(__pyx_t_4);
27764 if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_pyx_unpickle_Enum, __pyx_t_4) < (0)) __PYX_ERR(1, 4, __pyx_L1_error)
27765 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
27774 __pyx_t_1 = __Pyx_Import(__pyx_mstate_global->__pyx_n_u_numpy, 0, 0, NULL, 0);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 7, __pyx_L1_error)
27775 __pyx_t_4 = __pyx_t_1;
27776 __Pyx_GOTREF(__pyx_t_4);
27777 if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_np, __pyx_t_4) < (0)) __PYX_ERR(0, 7, __pyx_L1_error)
27778 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
27787 __pyx_t_4 = __Pyx_PEP560_update_bases(__pyx_mstate_global->__pyx_tuple[4]);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 13, __pyx_L1_error)
27788 __Pyx_GOTREF(__pyx_t_4);
27789 __pyx_t_5 = __Pyx_CalculateMetaclass(NULL, __pyx_t_4);
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 13, __pyx_L1_error)
27790 __Pyx_GOTREF(__pyx_t_5);
27791 __pyx_t_9 = __Pyx_Py3MetaclassPrepare(__pyx_t_5, __pyx_t_4, __pyx_mstate_global->__pyx_n_u_SparseMatrix, __pyx_mstate_global->__pyx_n_u_SparseMatrix, (PyObject *) NULL, __pyx_mstate_global->__pyx_n_u_superluWrappers, (PyObject *) NULL);
if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 13, __pyx_L1_error)
27792 __Pyx_GOTREF(__pyx_t_9);
27793 if (__pyx_t_4 != __pyx_mstate_global->__pyx_tuple[4]) {
27794 if (unlikely((PyDict_SetItemString(__pyx_t_9,
"__orig_bases__", __pyx_mstate_global->__pyx_tuple[4]) < 0))) __PYX_ERR(0, 13, __pyx_L1_error)
27804 __pyx_t_10 = __Pyx_CyFunction_New(&__pyx_mdef_15superluWrappers_12SparseMatrix_1__init__, 0, __pyx_mstate_global->__pyx_n_u_SparseMatrix___init, NULL, __pyx_mstate_global->__pyx_n_u_superluWrappers, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[0]));
if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 15, __pyx_L1_error)
27805 __Pyx_GOTREF(__pyx_t_10);
27806 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
27807 PyUnstable_Object_EnableDeferredRefcount(__pyx_t_10);
27809 if (__Pyx_SetNameInClass(__pyx_t_9, __pyx_mstate_global->__pyx_n_u_init, __pyx_t_10) < (0)) __PYX_ERR(0, 15, __pyx_L1_error)
27810 __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
27819 __pyx_t_10 = __Pyx_CyFunction_New(&__pyx_mdef_15superluWrappers_12SparseMatrix_3matvec, 0, __pyx_mstate_global->__pyx_n_u_SparseMatrix_matvec, NULL, __pyx_mstate_global->__pyx_n_u_superluWrappers, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1]));
if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 35, __pyx_L1_error)
27820 __Pyx_GOTREF(__pyx_t_10);
27821 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
27822 PyUnstable_Object_EnableDeferredRefcount(__pyx_t_10);
27824 if (__Pyx_SetNameInClass(__pyx_t_9, __pyx_mstate_global->__pyx_n_u_matvec, __pyx_t_10) < (0)) __PYX_ERR(0, 35, __pyx_L1_error)
27825 __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
27834 __pyx_t_10 = __Pyx_CyFunction_New(&__pyx_mdef_15superluWrappers_12SparseMatrix_5fwrite, 0, __pyx_mstate_global->__pyx_n_u_SparseMatrix_fwrite, NULL, __pyx_mstate_global->__pyx_n_u_superluWrappers, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[2]));
if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 46, __pyx_L1_error)
27835 __Pyx_GOTREF(__pyx_t_10);
27836 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
27837 PyUnstable_Object_EnableDeferredRefcount(__pyx_t_10);
27839 if (__Pyx_SetNameInClass(__pyx_t_9, __pyx_mstate_global->__pyx_n_u_fwrite, __pyx_t_10) < (0)) __PYX_ERR(0, 46, __pyx_L1_error)
27840 __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
27849 __pyx_t_10 = __Pyx_CyFunction_New(&__pyx_mdef_15superluWrappers_12SparseMatrix_7getCSRrepresentation, 0, __pyx_mstate_global->__pyx_n_u_SparseMatrix_getCSRrepresentatio, NULL, __pyx_mstate_global->__pyx_n_u_superluWrappers, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[3]));
if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 62, __pyx_L1_error)
27850 __Pyx_GOTREF(__pyx_t_10);
27851 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
27852 PyUnstable_Object_EnableDeferredRefcount(__pyx_t_10);
27854 if (__Pyx_SetNameInClass(__pyx_t_9, __pyx_mstate_global->__pyx_n_u_getCSRrepresentation, __pyx_t_10) < (0)) __PYX_ERR(0, 62, __pyx_L1_error)
27855 __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
27864 __pyx_t_10 = __Pyx_CyFunction_New(&__pyx_mdef_15superluWrappers_12SparseMatrix_9getSubMatCSRrepresentation, 0, __pyx_mstate_global->__pyx_n_u_SparseMatrix_getSubMatCSRreprese, NULL, __pyx_mstate_global->__pyx_n_u_superluWrappers, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[4]));
if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 72, __pyx_L1_error)
27865 __Pyx_GOTREF(__pyx_t_10);
27866 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
27867 PyUnstable_Object_EnableDeferredRefcount(__pyx_t_10);
27869 if (__Pyx_SetNameInClass(__pyx_t_9, __pyx_mstate_global->__pyx_n_u_getSubMatCSRrepresentation, __pyx_t_10) < (0)) __PYX_ERR(0, 72, __pyx_L1_error)
27870 __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
27879 __pyx_t_10 = __Pyx_Py3ClassCreate(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_SparseMatrix, __pyx_t_4, __pyx_t_9, NULL, 0, 0);
if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 13, __pyx_L1_error)
27880 __Pyx_GOTREF(__pyx_t_10);
27881 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
27882 PyUnstable_Object_EnableDeferredRefcount(__pyx_t_10);
27884 if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_SparseMatrix, __pyx_t_10) < (0)) __PYX_ERR(0, 13, __pyx_L1_error)
27885 __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
27886 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
27887 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
27888 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
27895 __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_15superluWrappers_13cSparseMatrix_3__reduce_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_cSparseMatrix___reduce_cython, NULL, __pyx_mstate_global->__pyx_n_u_superluWrappers, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[5]));
if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 1, __pyx_L1_error)
27896 __Pyx_GOTREF(__pyx_t_4);
27897 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
27898 PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
27900 if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_reduce_cython, __pyx_t_4) < (0)) __PYX_ERR(1, 1, __pyx_L1_error)
27901 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
27909 __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_15superluWrappers_13cSparseMatrix_5__setstate_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_cSparseMatrix___setstate_cython, NULL, __pyx_mstate_global->__pyx_n_u_superluWrappers, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[6]));
if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 3, __pyx_L1_error)
27910 __Pyx_GOTREF(__pyx_t_4);
27911 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
27912 PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
27914 if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_setstate_cython, __pyx_t_4) < (0)) __PYX_ERR(1, 3, __pyx_L1_error)
27915 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
27922 __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_15superluWrappers_12SparseFactor_3__reduce_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_SparseFactor___reduce_cython, NULL, __pyx_mstate_global->__pyx_n_u_superluWrappers, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[7]));
if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 1, __pyx_L1_error)
27923 __Pyx_GOTREF(__pyx_t_4);
27924 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
27925 PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
27927 if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_reduce_cython, __pyx_t_4) < (0)) __PYX_ERR(1, 1, __pyx_L1_error)
27928 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
27936 __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_15superluWrappers_12SparseFactor_5__setstate_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_SparseFactor___setstate_cython, NULL, __pyx_mstate_global->__pyx_n_u_superluWrappers, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[8]));
if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 3, __pyx_L1_error)
27937 __Pyx_GOTREF(__pyx_t_4);
27938 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
27939 PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
27941 if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_setstate_cython, __pyx_t_4) < (0)) __PYX_ERR(1, 3, __pyx_L1_error)
27942 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
27951 __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_15superluWrappers_1sparseFactorPrepare, 0, __pyx_mstate_global->__pyx_n_u_sparseFactorPrepare, NULL, __pyx_mstate_global->__pyx_n_u_superluWrappers, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[9]));
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 222, __pyx_L1_error)
27952 __Pyx_GOTREF(__pyx_t_4);
27953 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
27954 PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
27956 if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_sparseFactorPrepare, __pyx_t_4) < (0)) __PYX_ERR(0, 222, __pyx_L1_error)
27957 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
27966 __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_15superluWrappers_3sparseFactorSolve, 0, __pyx_mstate_global->__pyx_n_u_sparseFactorSolve, NULL, __pyx_mstate_global->__pyx_n_u_superluWrappers, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[10]));
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 289, __pyx_L1_error)
27967 __Pyx_GOTREF(__pyx_t_4);
27968 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
27969 PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
27971 if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_sparseFactorSolve, __pyx_t_4) < (0)) __PYX_ERR(0, 289, __pyx_L1_error)
27972 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
27979 __pyx_t_4 = __Pyx_PyDict_NewPresized(0);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1, __pyx_L1_error)
27980 __Pyx_GOTREF(__pyx_t_4);
27981 if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_test, __pyx_t_4) < (0)) __PYX_ERR(0, 1, __pyx_L1_error)
27982 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
27988 __Pyx_XDECREF(__pyx_t_4);
27989 __Pyx_XDECREF(__pyx_t_5);
27990 __Pyx_XDECREF(__pyx_t_9);
27991 __Pyx_XDECREF(__pyx_t_10);
27993 if (__pyx_mstate->__pyx_d && stringtab_initialized) {
27994 __Pyx_AddTraceback(
"init superluWrappers", __pyx_clineno, __pyx_lineno, __pyx_filename);
27996 #if !CYTHON_USE_MODULE_STATE
27999 Py_DECREF(__pyx_m);
28000 if (pystate_addmodule_run) {
28001 PyObject *tp, *value, *tb;
28002 __Pyx_PyErr_FetchException(&tp, &value, &tb);
28003 __Pyx_State_RemoveModule(&__pyx_moduledef);
28004 __Pyx_PyErr_RestoreException(tp, value, tb);
28007 }
else if (!PyErr_Occurred()) {
28008 PyErr_SetString(PyExc_ImportError,
"init superluWrappers");
28011 __Pyx_RefNannyFinishContext();
28012 #if CYTHON_PEP489_MULTI_PHASE_INIT
28013 return (__pyx_m != NULL) ? 0 : -1;
28021static int __Pyx_InitCachedBuiltins(__pyx_mstatetype *__pyx_mstate) {
28022 int __pyx_lineno = 0;
28023 const char *__pyx_filename = NULL;
28024 int __pyx_clineno = 0;
28025 CYTHON_UNUSED_VAR(__pyx_mstate);
28026 __pyx_builtin_object = __Pyx_GetBuiltinName(__pyx_mstate->__pyx_n_u_object);
if (!__pyx_builtin_object) __PYX_ERR(0, 13, __pyx_L1_error)
28027 __pyx_builtin_open = __Pyx_GetBuiltinName(__pyx_mstate->__pyx_n_u_open);
if (!__pyx_builtin_open) __PYX_ERR(0, 56, __pyx_L1_error)
28028 __pyx_builtin___import__ = __Pyx_GetBuiltinName(__pyx_mstate->__pyx_n_u_import);
if (!__pyx_builtin___import__) __PYX_ERR(1, 119, __pyx_L1_error)
28029 __pyx_builtin_enumerate = __Pyx_GetBuiltinName(__pyx_mstate->__pyx_n_u_enumerate);
if (!__pyx_builtin_enumerate) __PYX_ERR(1, 175, __pyx_L1_error)
28030 __pyx_builtin_Ellipsis = __Pyx_GetBuiltinName(__pyx_mstate->__pyx_n_u_Ellipsis);
if (!__pyx_builtin_Ellipsis) __PYX_ERR(1, 436, __pyx_L1_error)
28031 __pyx_builtin_id = __Pyx_GetBuiltinName(__pyx_mstate->__pyx_n_u_id);
if (!__pyx_builtin_id) __PYX_ERR(1, 662, __pyx_L1_error)
28034 __pyx_mstate->__pyx_umethod_PyDict_Type_items.type = (PyObject*)&PyDict_Type;
28035 __pyx_mstate->__pyx_umethod_PyDict_Type_items.method_name = &__pyx_mstate->__pyx_n_u_items;
28036 __pyx_mstate->__pyx_umethod_PyDict_Type_pop.type = (PyObject*)&PyDict_Type;
28037 __pyx_mstate->__pyx_umethod_PyDict_Type_pop.method_name = &__pyx_mstate->__pyx_n_u_pop;
28038 __pyx_mstate->__pyx_umethod_PyDict_Type_values.type = (PyObject*)&PyDict_Type;
28039 __pyx_mstate->__pyx_umethod_PyDict_Type_values.method_name = &__pyx_mstate->__pyx_n_u_values;
28046static int __Pyx_InitCachedConstants(__pyx_mstatetype *__pyx_mstate) {
28047 __Pyx_RefNannyDeclarations
28048 int __pyx_lineno = 0;
28049 const char *__pyx_filename = NULL;
28050 int __pyx_clineno = 0;
28051 CYTHON_UNUSED_VAR(__pyx_mstate);
28052 __Pyx_RefNannySetupContext(
"__Pyx_InitCachedConstants", 0);
28061 __pyx_mstate_global->__pyx_tuple[0] = PyTuple_New(1);
if (unlikely(!__pyx_mstate_global->__pyx_tuple[0])) __PYX_ERR(1, 625, __pyx_L1_error)
28062 __Pyx_GOTREF(__pyx_mstate_global->__pyx_tuple[0]);
28063 __Pyx_INCREF(__pyx_mstate_global->__pyx_int_neg_1);
28064 __Pyx_GIVEREF(__pyx_mstate_global->__pyx_int_neg_1);
28065 if (__Pyx_PyTuple_SET_ITEM(__pyx_mstate_global->__pyx_tuple[0], 0, __pyx_mstate_global->__pyx_int_neg_1) != (0)) __PYX_ERR(1, 625, __pyx_L1_error);
28066 __Pyx_GIVEREF(__pyx_mstate_global->__pyx_tuple[0]);
28075 __pyx_mstate_global->__pyx_slice[0] = PySlice_New(Py_None, Py_None, Py_None);
if (unlikely(!__pyx_mstate_global->__pyx_slice[0])) __PYX_ERR(1, 745, __pyx_L1_error)
28076 __Pyx_GOTREF(__pyx_mstate_global->__pyx_slice[0]);
28077 __Pyx_GIVEREF(__pyx_mstate_global->__pyx_slice[0]);
28086 __pyx_mstate_global->__pyx_tuple[1] = PyTuple_New(1);
if (unlikely(!__pyx_mstate_global->__pyx_tuple[1])) __PYX_ERR(1, 763, __pyx_L1_error)
28087 __Pyx_GOTREF(__pyx_mstate_global->__pyx_tuple[1]);
28088 __Pyx_INCREF(__pyx_mstate_global->__pyx_slice[0]);
28089 __Pyx_GIVEREF(__pyx_mstate_global->__pyx_slice[0]);
28090 if (__Pyx_PyTuple_SET_ITEM(__pyx_mstate_global->__pyx_tuple[1], 0, __pyx_mstate_global->__pyx_slice[0]) != (0)) __PYX_ERR(1, 763, __pyx_L1_error);
28091 __Pyx_GIVEREF(__pyx_mstate_global->__pyx_tuple[1]);
28101 PyObject* __pyx_temp[3] = {Py_None, Py_None, Py_None};
28102 __pyx_mstate_global->__pyx_tuple[2] = __Pyx_PyTuple_FromArray(__pyx_temp, 3);
if (unlikely(!__pyx_mstate_global->__pyx_tuple[2])) __PYX_ERR(0, 56, __pyx_L1_error)
28103 __Pyx_GOTREF(__pyx_mstate_global->__pyx_tuple[2]);
28105 __Pyx_GIVEREF(__pyx_mstate_global->__pyx_tuple[2]);
28115 PyObject* __pyx_temp[1] = {__pyx_builtin_object};
28116 __pyx_mstate_global->__pyx_tuple[3] = __Pyx_PyTuple_FromArray(__pyx_temp, 1);
if (unlikely(!__pyx_mstate_global->__pyx_tuple[3])) __PYX_ERR(0, 13, __pyx_L1_error)
28117 __Pyx_GOTREF(__pyx_mstate_global->__pyx_tuple[3]);
28119 __Pyx_GIVEREF(__pyx_mstate_global->__pyx_tuple[3]);
28121 PyObject* __pyx_temp[1] = {__pyx_builtin_object};
28122 __pyx_mstate_global->__pyx_tuple[4] = __Pyx_PyTuple_FromArray(__pyx_temp, 1);
if (unlikely(!__pyx_mstate_global->__pyx_tuple[4])) __PYX_ERR(0, 13, __pyx_L1_error)
28123 __Pyx_GOTREF(__pyx_mstate_global->__pyx_tuple[4]);
28125 __Pyx_GIVEREF(__pyx_mstate_global->__pyx_tuple[4]);
28126 #if CYTHON_IMMORTAL_CONSTANTS
28128 PyObject **table = __pyx_mstate->__pyx_tuple;
28129 for (Py_ssize_t i=0; i<5; ++i) {
28130 #if PY_VERSION_HEX >= 0x030F0000
28131 PyUnstable_SetImmortal(table[i]);
28132 #elif CYTHON_COMPILING_IN_CPYTHON_FREETHREADING
28133 if ((PY_SSIZE_T_MAX <= _Py_IMMORTAL_REFCNT_LOCAL))
break;
28134 #if PY_VERSION_HEX < 0x030E0000
28135 if (_Py_IsOwnedByCurrentThread(table[i]) && Py_REFCNT(table[i]) == 1)
28137 if (PyUnstable_Object_IsUniquelyReferenced(table[i]))
28140 Py_SET_REFCNT(table[i], ((Py_ssize_t)_Py_IMMORTAL_REFCNT_LOCAL + 1));
28143 if ((PY_SSIZE_T_MAX < _Py_IMMORTAL_INITIAL_REFCNT))
break;
28144 Py_SET_REFCNT(table[i], _Py_IMMORTAL_INITIAL_REFCNT);
28149 #if CYTHON_IMMORTAL_CONSTANTS
28151 PyObject **table = __pyx_mstate->__pyx_slice;
28152 for (Py_ssize_t i=0; i<1; ++i) {
28153 #if PY_VERSION_HEX >= 0x030F0000
28154 PyUnstable_SetImmortal(table[i]);
28155 #elif CYTHON_COMPILING_IN_CPYTHON_FREETHREADING
28156 if ((PY_SSIZE_T_MAX <= _Py_IMMORTAL_REFCNT_LOCAL))
break;
28157 #if PY_VERSION_HEX < 0x030E0000
28158 if (_Py_IsOwnedByCurrentThread(table[i]) && Py_REFCNT(table[i]) == 1)
28160 if (PyUnstable_Object_IsUniquelyReferenced(table[i]))
28163 Py_SET_REFCNT(table[i], ((Py_ssize_t)_Py_IMMORTAL_REFCNT_LOCAL + 1));
28166 if ((PY_SSIZE_T_MAX < _Py_IMMORTAL_INITIAL_REFCNT))
break;
28167 Py_SET_REFCNT(table[i], _Py_IMMORTAL_INITIAL_REFCNT);
28172 __Pyx_RefNannyFinishContext();
28175 __Pyx_RefNannyFinishContext();
28180static int __Pyx_InitConstants(__pyx_mstatetype *__pyx_mstate) {
28181 int __pyx_lineno = 0;
28182 const char *__pyx_filename = NULL;
28183 int __pyx_clineno = 0;
28184 CYTHON_UNUSED_VAR(__pyx_mstate);
28186 const struct {
const unsigned int length: 8; } str_length_index[] = {{6},{8},{13},{10},{15},{1},{2},{15},{23},{25},{32},{20},{22},{1},{1},{37},{45},{22},{179},{8},{15},{7},{6},{2},{9},{50},{39},{34},{27},{146},{30},{37},{5},{8},{8},{12},{30},{32},{12},{21},{19},{33},{39},{19},{15},{20},{12},{9},{17},{8},{7},{9},{8},{8},{12},{10},{8},{8},{13},{10},{15},{8},{7},{11},{14},{11},{10},{19},{14},{12},{10},{17},{13},{12},{12},{19},{8},{14},{13},{5},{3},{15},{18},{4},{1},{13},{31},{33},{18},{6},{5},{3},{15},{6},{9},{5},{8},{5},{6},{7},{6},{20},{26},{1},{2},{5},{5},{8},{1},{6},{7},{4},{4},{2},{4},{3},{2},{2},{5},{5},{6},{3},{6},{4},{11},{4},{3},{9},{11},{8},{6},{4},{10},{5},{4},{12},{19},{17},{13},{5},{4},{4},{6},{15},{6},{6},{6},{1},{5},{1},{1}};
28187 const struct {
const unsigned int length: 8; } bytes_length_index[] = {{1},{9},{14},{16},{93},{19},{18},{131},{165}};
28188 #ifndef CYTHON_COMPRESS_STRINGS
28189 #define CYTHON_COMPRESS_STRINGS 90
28191 #if (CYTHON_COMPRESS_STRINGS) == 1
28192static const char cstring[] =
"x\332\205UAO\033G\024\006\211H\200h\n)m\324\252J\206*\304i\003n\254\320\022UQ*\213@J\325\244\030\223\022)RW\343\331g3ewf\231\23156j\245\0349\356q\217>\372\350\243\217>r\364\321\307\374\204\374\204\276\331\301\304\2304\265\326;o\337\274\231\367\275\367\276yC\250!\017\032DV\376\002f\236,\373\304>\205\207\371G0\273\314\211{f\357\031\005@\252\212\326B\020\346\333\374O\344\361s\010\245j\376\301\341\230\310*y\314\2440\274\026\313X\023*|\342se\267\033Ws1\234\320Fq\037\374\021c\"\325G\347/\353.,\237\374\274A\205\220\206P\255yM\020#\211\002\352\257J\0214I\230\201\254#\310mQ\247\001\367I(}X!\320\210p-n\225c9\3537W\225\312(*r+\244\206[\r\215\365\001\215\000]\021\332\340\232\274\220\006\2109\300|m4\315\201\024\004u>\004\274\002\212\032@o\026\037\356\252\254\221 ;\233;\253k\217\3262\264\nlv5\321q\205\005\010\024\264MZ%\346\201\301\335M3\002\235\047\333U\322\2241\021\200\2700\212\010\355F\027\230\003\020D\203\261\002\311e1S\303\245\360p9\027\265\334y\232x\035\354\352-\032h\310S\337\367\320\016\230\014\002;\047\205\316\323\n\363\271\246\225\000@\330w\215q\355$_H\014\250J\343\300\020\317S\340\307\014<\217\370q\266\243\220b\025\003\254s\032\340,\343\202\033\317\023q\0305\363\036\223\n\362!\256\343T)\332$U\312\003\027\005\017#L\355\250Y\034Rsp\305\"R\0103\326\337\3538\002\025\304\373\212F(\350|\324lh\010\252\371\342\212\0336\334\370\233\033^\272\341\225\033\300\262\324\211\2706\364\330\210\254\234\254\rB(\216\310\257\010s\364\251\000A\262\326A\031\007\213\222\035Wew2\0102\204D\234\035\006\230\3538KWf\025\004\222a\365\211\213\333\247\206\346?0\353\210d\231\3408\254\363\305\362\306\366\366f\020\360Hs]\206\243\030\004\203rD\225\206-\312\020\331\250\234\277\250\006\3130y\336\330,\322B#\033\306\347\237S\364\326\030\225\321\326\025\356\222\262z\254\270\201K\252\032\230\215\362\256\202H\001\262\3031m\334\240\034W\360\343\343fX\354:0\333&\362\357;\206\347\3554\033\370\177\212\307\305{\001\r\263\013U\317;\2474R\016\351eI\377^@g\0100\264\n\337\256\261\243dv@\247\2402\241\3013}5\026\331Dm\230""\022\3749\212e\222pV!\345\"\033\301\320\013_\330\033\342 [\020*iwV\034\262\tA\303L-,t\317\303`1\304L\203\364\364\330\001\260C\035\207\356\353\334\251\025\355\271vR,2\352\200\267)\206vucYb\3678\212i0\3640<tW\n~\241\200\206\375\300\202_\240\322#\221^!\202\347\031\3206d6Z\026\217k{\030e\214\355\007<%\217\261\037\260![\275J\\\255bO\323M\301\270\314_\330\351\n\325\300.\355\303\306\2705\006z|\372\n:\026X\377X\nl\276\014*\224\035b\247\302\326\316d,\214\317C?K!\202u\207\020\317\010\266o\300\034f-\027\224\222\252\212}\304f\242\032\320\232\306C\212\204;o\346\216\325\037\"\362\177s\227s\037\335[.A\250\335\353\004\016\035\211\3612\2617\211\275A\254C\301\360\n\n\2058\021\221PY\203\023\047xmd/\215x\035d\031\201\300\364E\261\361,\322\010C\214d\204\350jXJ\341;\001\223\202\210\241\306\265\2611\035GF\331\016\205\351:o\307Y\377\260P\364\310\271\037\225w\034%GUe\031\324\317\025Hw[\201\314\r\272\210\260\363\341_\305x%]n\267\310S\004\030G\330\307\000\303\210A\037gIl4\177\17739\230\232=\275\237\224\336L\276[\234\270\266\334*\266J\203\345\273\356+\327\242\255\177:\305A\356\336\233\342\273\353\0233\237\234n%\313\211I\177l-\014\246\347N\237%\005;l\047\245\304O\227S\323\312>\177M\350\225\241?w+\r\333\205vq\260\262\232=\017:\223\357_\270\371\374\304\314B2\225l\247{\255/\333w\332\024U7&f\276N\013\351\323>)t>\353\024Q\2638q\375F\262\220|\227\376\322*\016\346n&\365\264\224\212\366F\333t~\350Nu7{\213\275\375\263\342\331^\277\264;\230\233O\256%/\323\245t-=\032\314/&\233\351\347)E\204\353\355\245\366\032.X\357.u\013\335b\2674X\274\235\326[\245\376\335\365\216\316t[\275;\275\332Y\351\254\322\337)\365K\373\375\375\327\375\327\225~\205\365\231\217\020nM\314\314\237\376\235>L\375V\256\375U\347a\307\357.\r\246?==Io\244\030\375|2\233~\223\026\255\246\236\224\323\251\264\370v\372\372\251\237\344\322\205\364~k\267e\332\353\235\245N\341\355\364B\262\230\354\247\305\364\317\366\343\216\352~\321U=\314\350P\271\327\272\331\236l\337\306\230\236\365\n\275\347\375R\271_\336\373\237\351\267\350\262\2214\322\243""\177\001\232]\350\344";
28193 PyObject *data = __Pyx_DecompressString(cstring, 1390, 1);
28194 #define __Pyx_DecompressString_LZSS_UNUSED
28195 if (unlikely(!data)) __PYX_ERR(0, 1, __pyx_L1_error)
28196 const char*
const bytes = __Pyx_PyBytes_AsString(data);
28197 #if !CYTHON_ASSUME_SAFE_MACROS
28198 if (likely(bytes));
else { Py_DECREF(data); __PYX_ERR(0, 1, __pyx_L1_error) }
28200 #elif (CYTHON_COMPRESS_STRINGS) > 0 && (CYTHON_COMPRESS_STRINGS) <= 90
28201static const char cstring[] =
"\377 at 0x o\377bject>%d\375 \000\000%13.8e\317\n%i \000\000\003\000\n(\377tree fra\377gment).:\377 <Memory\377View of \377<contigu\377ous and gdirK\001\007\rin\021\005\177strided\"\010o or \004\031><(\t\376A\006>?Canno\377t assign\377 to read\177-only m\240\002\375v\242\000Invali\377d mode, \347exp\353\000|\000\047c\047\376t\001\047fortra\237n\047, gH\000%\005s\357hape\222\000 ax\377is Note \373th\255 Cytho\373n \021\000delib\237eratek\000\320\001c\367ter!\001n PE\337P-484\212\"re\376\332!s subcl\366\246\000es\261!buil\373ti\260\000ypes.\377 If you \223ne\224 \303\000p\316\000%\tt\177hen set\200\000\367e \047\357\002atio\377n_typing\355\047\355$iv\242\000o F\377alse.add}_\231 ecoll\334@\376+\000s.abcdi\177sableen\002\001\357gcis\004\003dno\377 default\377 __reduc\277e__ duM\002n\367on-\262@vial\376\033\000cinit__\377numpy._c\337ore.m5\000ia\377rray fai\235l\300\003imp\330 \033\tuomath\021\016pr\333 \377us/super\277luWrap\006\000s\377.pyxselfW.A,\001\003C\002\003L\t\003\025U\020\003X\027\003e\242\204\001\"\003B\000\327m_c\001\010r:\003st\272\247\000A\001\010X c\271cb\377e conver\235t\371#a P\340C\224\205\003 ~\237` pickl\351 \371u\264\"\347aalloc\372\373@ \362\003data.\360\013\020\303c\225\205\001\362\204\003s.AS\377CIIEllip\377sisSeque\377nceSparsOeFac\243\000\000\t.\205F\315c\365b__\017\014\224`st\357ate_\022\013Mat\007rixP\003\006\003G\000\263C\010\n\277fwrite\033\ng\377etCSRrep\313re\233`t\345b\021\rSuqb_\000\t\033\352@vec\243\207\001}.\250\207\007__Pyx\001\000\377Dict_Nex?tRef__\314\204\004\360`\033__\241\205\002__\001\005\213\000\236\000\345m\r\001d0\001\027\000doc\276\034\001enter\004\002x>\214\204\001__fun\024\002\276\000\340\215#C\000\377cK\001\260\204\003__m\367ain[\001meta\276c\006modulz\002m\377ro_entri\273es\201\001nam\221\002nCew\220\001\221 \246@\243\002p\305\000\177checksu\233\000\370\n\001n\004\025\001type_\355_\037\001un\266be_E\315n \005vt\377\205\001\337\001qu\303alZ\005\355\205\005\340N\207\206\006ex\036\223!set_\216\005\364F\255 ~\370N__test""\305!\356\373I_is\260\206\001out\377ine_rows\367abc\304\204\005_buf\377ferasync\277io.cor\"\003s\277basecc\303ic`\315l\255\207\004\236\204\005\017\r\226\204\016cl|\001\376\210@traceba\377ckcolind\377countdim\361d\276\"\252\000\231\214\003enco\277deenum\356\211\002e\377rrorfile\376\234Aflagsfo\217rmat\306\212\004\320\204\003\265\204\021g\373et\245\204\024iidin\273de\311`ems\357as\357izek\277\204\003mem\270\306\213\001\276\213\001\215ancn\237\000n\277nznpnr\203\211\002n\363zv\307@\001\001sobj\336\314\215\003open\344 pu\353t_\246\001p\340\000pop_range\337`d\003\003\377startreg\367ist\320\001wptr\216\361\210\001set\210\212\004\204\214\002\207\001s\234\227\207\010\000\tPre\217\204\001\023\tSoolve*\003_m\204\207\002\274b\002`\000psto\001\000r\267uct\340\211\014un\235\001u\377pdateval\357uesw\226\207\002xyO\377\200\001\330\004\n\210+\220\377Q\200\001\360\024\000\005%\177\240A\240Q\330%&\010\003\377\047\240a\240}\260A\330\377\047(\200A\360\016\000\t\377\r\210F\220%\220t\230\3776\240\021\330\010\014\210G\373\2201\003\001I\220Q\220d\337\230%\230t\240\n\002J\220\361a\031\001\000\004\010\003\320\014\036\230\377m\2501\250A\330,->\000\000\330,0\260\001\000\002\005\002\376Z\000\020\000\t\021\220\004\220\377I\230T\240\031\250$\250\375am\000\022\000\t\034\2301\377\230D\320 1\260\023\260\375A\177\000\024\000\016\022\220\021\377\220*\230H\240A\330\014\377\027\220v\230Q\230n\250\377C\250t\2605\270\004\270\377E\300\024\300W\310A\310\377T\320QR\330\014\020\220\377\005\220U\230!\2304\230\377q\330\020\024\220E\230\025\373\230a\237\0007\250!\2504\376.\0007\270!\2701\270A\377\270Q\330\024\037\230v\240\277Q\320&7\260s\017\002F\377\300$\300g\310Q\310b\377\320PQ\320QW\320W\377[\320[b\320bc\320\373cd\202 \036\000\t\020\210\377|\2303\230d\240\047\250\377\032\2603\260d\270!\330\177\010\017\210z\230\022\230\212 \177\020\220\n\230\"\230A\016\001\377v\220S\230\004\230A\340\377\010\016\210d\220\047\230\021\377\230+\240R\240t\2507\377\260!\2601\340\010\021\220\377\024\220W\230A\230^\250\377<\260r\270""\026\270r\300\374\317 \r\005T\240\027\250\001\250\375\037\321\000G\3001\300M\320\177QS\320ST\330\010\002\032}\340\202\000x\220x\230q";
28202 PyObject *data = __Pyx_DecompressString_LZSS(cstring, 1844, 2553);
28203 #define __Pyx_DecompressString_UNUSED
28204 if (unlikely(!data)) __PYX_ERR(0, 1, __pyx_L1_error)
28205 const char*
const bytes = __Pyx_PyBytes_AsString(data);
28206 #if !CYTHON_ASSUME_SAFE_MACROS
28207 if (likely(bytes));
else { Py_DECREF(data); __PYX_ERR(0, 1, __pyx_L1_error) }
28210static const char bytes[] =
" at 0x object>%d %d %13.8e\n%i %i %i \n(tree fragment).: <MemoryView of <contiguous and direct><contiguous and indirect><strided and direct or indirect><strided and direct><strided and indirect>>?Cannot assign to read-only memoryviewInvalid mode, expected \047c\047 or \047fortran\047, got Invalid shape in axis Note that Cython is deliberately stricter than PEP-484 and rejects subclasses of builtin types. If you need to pass subclasses then set the \047annotation_typing\047 directive to False.add_notecollections.abcdisableenablegcisenabledno default __reduce__ due to non-trivial __cinit__numpy._core.multiarray failed to importnumpy._core.umath failed to importproteus/superluWrappers.pyxself.A,self.AC,self.L,self.U,self.X,self.etree,self.perm_c,self.perm_r,self.storeA,self.storeX cannot be converted to a Python object for picklingunable to allocate array data.unable to allocate shape and strides.ASCIIEllipsisSequenceSparseFactorSparseFactor.__reduce_cython__SparseFactor.__setstate_cython__SparseMatrixSparseMatrix.__init__SparseMatrix.fwriteSparseMatrix.getCSRrepresentationSparseMatrix.getSubMatCSRrepresentationSparseMatrix.matvecView.MemoryView__Pyx_PyDict_NextRef__annotate____class____class_getitem____dict____doc____enter____exit____func____getstate____import____init____main____metaclass____module____mro_entries____name____new____prepare____pyx_checksum__pyx_state__pyx_type__pyx_unpickle_Enum__pyx_vtable____qualname____reduce____reduce_cython____reduce_ex____set_name____setstate____setstate_cython____test___cSparseMatrix_is_coroutine_rowsabcallocate_bufferasyncio.coroutinesbaseccSparseMatrixcSparseMatrix.__reduce_cython__cSparseMatrix.__setstate_cython__cline_in_tracebackcolindcountdimdtype_is_objectencodeenumerateerrorfilenameflagsformatfortranfwritegetCSRrepresentationgetSubMatCSRrepresentationiidindexitemsitemsizekmatvecmemviewmodenamencndimnnznpnrnumpynzvalnzvalsobjobjectopenoutput_filepackpoprange_endrange_startregisterrowptrselfsetdefaultshapesizesparseFactorsp""arseFactorPreparesparseFactorSolvesparse_matrixstartstepstopstructsuperluWrappersunpackupdatevalueswwritexyO\200\001\330\004\n\210+\220Q\200\001\360\024\000\005%\240A\240Q\330%&\200\001\360\024\000\005\047\240a\240}\260A\330\047(\200A\360\016\000\t\r\210F\220%\220t\2306\240\021\330\010\014\210G\2201\330\010\014\210I\220Q\220d\230%\230t\2401\330\010\014\210J\220a\330\010\014\210J\220a\330\010\014\210J\220a\330\010\014\320\014\036\230m\2501\250A\330,-\330,-\330,0\260\001\330,0\260\001\330,0\260\001\200A\360\020\000\t\021\220\004\220I\230T\240\031\250$\250a\200A\360\022\000\t\034\2301\230D\320 1\260\023\260A\200A\360\024\000\016\022\220\021\220*\230H\240A\330\014\027\220v\230Q\230n\250C\250t\2605\270\004\270E\300\024\300W\310A\310T\320QR\330\014\020\220\005\220U\230!\2304\230q\330\020\024\220E\230\025\230a\230t\2407\250!\2504\250t\2607\270!\2701\270A\270Q\330\024\037\230v\240Q\320&7\260s\270!\2701\270F\300$\300g\310Q\310b\320PQ\320QW\320W[\320[b\320bc\320cd\200A\360\036\000\t\020\210|\2303\230d\240\047\250\032\2603\260d\270!\330\010\017\210z\230\022\2301\330\010\020\220\n\230\"\230A\330\010\017\210v\220S\230\004\230A\340\010\016\210d\220\047\230\021\230+\240R\240t\2507\260!\2601\340\010\021\220\024\220W\230A\230^\250<\260r\270\026\270r\300\021\330\010\021\220\024\220W\230A\230T\240\027\250\001\250\037\270\004\270G\3001\300M\320QS\320ST\330\010\021\220\024\220W\230A\230T\240\027\250\001\250\037\270\004\270G\3001\300M\320QS\320ST\340\010\017\210x\220x\230q";
28211 PyObject *data = NULL;
28212 #define __Pyx_DecompressString_UNUSED
28213 #define __Pyx_DecompressString_LZSS_UNUSED
28215 PyObject **stringtab = __pyx_mstate->__pyx_string_tab;
28216 Py_ssize_t pos = 0;
28217 for (
int i = 0; i < 151; i++) {
28218 Py_ssize_t bytes_length = str_length_index[i].length;
28219 PyObject *
string = PyUnicode_DecodeUTF8(bytes + pos, bytes_length, NULL);
28220 if (likely(
string) && i >= 32) PyUnicode_InternInPlace(&
string);
28221 if (unlikely(!
string)) {
28223 __PYX_ERR(0, 1, __pyx_L1_error)
28225 stringtab[i] = string;
28226 pos += bytes_length;
28228 for (
int i = 151; i < 160; i++) {
28229 Py_ssize_t bytes_length = bytes_length_index[i-151].length;
28230 PyObject *
string = PyBytes_FromStringAndSize(bytes + pos, bytes_length);
28231 stringtab[i] = string;
28232 pos += bytes_length;
28233 if (unlikely(!
string)) {
28235 __PYX_ERR(0, 1, __pyx_L1_error)
28239 for (Py_ssize_t i = 0; i < 160; i++) {
28240 if (unlikely(PyObject_Hash(stringtab[i]) == -1)) {
28241 __PYX_ERR(0, 1, __pyx_L1_error)
28244 #if CYTHON_IMMORTAL_CONSTANTS
28246 PyObject **table = stringtab + 151;
28247 for (Py_ssize_t i=0; i<9; ++i) {
28248 #if PY_VERSION_HEX >= 0x030F0000
28249 PyUnstable_SetImmortal(table[i]);
28250 #elif CYTHON_COMPILING_IN_CPYTHON_FREETHREADING
28251 if ((PY_SSIZE_T_MAX <= _Py_IMMORTAL_REFCNT_LOCAL))
break;
28252 #if PY_VERSION_HEX < 0x030E0000
28253 if (_Py_IsOwnedByCurrentThread(table[i]) && Py_REFCNT(table[i]) == 1)
28255 if (PyUnstable_Object_IsUniquelyReferenced(table[i]))
28258 Py_SET_REFCNT(table[i], ((Py_ssize_t)_Py_IMMORTAL_REFCNT_LOCAL + 1));
28261 if ((PY_SSIZE_T_MAX < _Py_IMMORTAL_INITIAL_REFCNT))
break;
28262 Py_SET_REFCNT(table[i], _Py_IMMORTAL_INITIAL_REFCNT);
28269 PyObject **numbertab = __pyx_mstate->__pyx_number_tab + 0;
28270 int8_t
const cint_constants_1[] = {0,-1,1};
28271 int32_t
const cint_constants_4[] = {136983863L};
28272 for (
int i = 0; i < 4; i++) {
28273 numbertab[i] = PyLong_FromLong((i < 3 ? cint_constants_1[i - 0] : cint_constants_4[i - 3]));
28274 if (unlikely(!numbertab[i])) __PYX_ERR(0, 1, __pyx_L1_error)
28277 #if CYTHON_IMMORTAL_CONSTANTS
28279 PyObject **table = __pyx_mstate->__pyx_number_tab;
28280 for (Py_ssize_t i=0; i<4; ++i) {
28281 #if PY_VERSION_HEX >= 0x030F0000
28282 PyUnstable_SetImmortal(table[i]);
28283 #elif CYTHON_COMPILING_IN_CPYTHON_FREETHREADING
28284 if ((PY_SSIZE_T_MAX <= _Py_IMMORTAL_REFCNT_LOCAL))
break;
28285 #if PY_VERSION_HEX < 0x030E0000
28286 if (_Py_IsOwnedByCurrentThread(table[i]) && Py_REFCNT(table[i]) == 1)
28288 if (PyUnstable_Object_IsUniquelyReferenced(table[i]))
28291 Py_SET_REFCNT(table[i], ((Py_ssize_t)_Py_IMMORTAL_REFCNT_LOCAL + 1));
28294 if ((PY_SSIZE_T_MAX < _Py_IMMORTAL_INITIAL_REFCNT))
break;
28295 Py_SET_REFCNT(table[i], _Py_IMMORTAL_INITIAL_REFCNT);
28309 unsigned int argcount : 3;
28310 unsigned int num_posonly_args : 1;
28311 unsigned int num_kwonly_args : 1;
28312 unsigned int nlocals : 4;
28313 unsigned int flags : 10;
28314 unsigned int first_line : 9;
28315} __Pyx_PyCode_New_function_description;
28320static PyObject* __Pyx_PyCode_New(
28321 const __Pyx_PyCode_New_function_description descr,
28322 PyObject *
const *varnames,
28323 PyObject *filename,
28324 PyObject *funcname,
28325 PyObject *line_table,
28326 PyObject *tuple_dedup_map
28330static int __Pyx_CreateCodeObjects(__pyx_mstatetype *__pyx_mstate) {
28331 PyObject* tuple_dedup_map = PyDict_New();
28332 if (unlikely(!tuple_dedup_map))
return -1;
28334 const __Pyx_PyCode_New_function_description descr = {7, 0, 0, 7, (
unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 15};
28335 PyObject*
const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_nr, __pyx_mstate->__pyx_n_u_nc, __pyx_mstate->__pyx_n_u_nnz, __pyx_mstate->__pyx_n_u_nzvals, __pyx_mstate->__pyx_n_u_colind, __pyx_mstate->__pyx_n_u_rowptr};
28336 __pyx_mstate_global->__pyx_codeobj_tab[0] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_proteus_superluWrappers_pyx, __pyx_mstate->__pyx_n_u_init, __pyx_mstate->__pyx_kp_b_iso88591_A_F_t6_G1_IQd_t1_Ja_Ja_Ja_m1A_0, tuple_dedup_map);
if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[0]))
goto bad;
28339 const __Pyx_PyCode_New_function_description descr = {3, 0, 0, 3, (
unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 35};
28340 PyObject*
const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_x, __pyx_mstate->__pyx_n_u_y};
28341 __pyx_mstate_global->__pyx_codeobj_tab[1] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_proteus_superluWrappers_pyx, __pyx_mstate->__pyx_n_u_matvec, __pyx_mstate->__pyx_kp_b_iso88591_A_1D_1_A, tuple_dedup_map);
if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1]))
goto bad;
28344 const __Pyx_PyCode_New_function_description descr = {3, 0, 0, 6, (
unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 46};
28345 PyObject*
const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_filename, __pyx_mstate->__pyx_n_u_base, __pyx_mstate->__pyx_n_u_output_file, __pyx_mstate->__pyx_n_u_i, __pyx_mstate->__pyx_n_u_k};
28346 __pyx_mstate_global->__pyx_codeobj_tab[2] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_proteus_superluWrappers_pyx, __pyx_mstate->__pyx_n_u_fwrite, __pyx_mstate->__pyx_kp_b_iso88591_A_HA_vQnCt5_E_WATQR_U_4q_E_at7_4, tuple_dedup_map);
if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[2]))
goto bad;
28349 const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 1, (
unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 62};
28350 PyObject*
const varnames[] = {__pyx_mstate->__pyx_n_u_self};
28351 __pyx_mstate_global->__pyx_codeobj_tab[3] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_proteus_superluWrappers_pyx, __pyx_mstate->__pyx_n_u_getCSRrepresentation, __pyx_mstate->__pyx_kp_b_iso88591_A_IT_a, tuple_dedup_map);
if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[3]))
goto bad;
28354 const __Pyx_PyCode_New_function_description descr = {3, 0, 0, 8, (
unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 72};
28355 PyObject*
const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_range_start, __pyx_mstate->__pyx_n_u_range_end, __pyx_mstate->__pyx_n_u_rows, __pyx_mstate->__pyx_n_u_nnz, __pyx_mstate->__pyx_n_u_rowptr, __pyx_mstate->__pyx_n_u_colind, __pyx_mstate->__pyx_n_u_nzvals};
28356 __pyx_mstate_global->__pyx_codeobj_tab[4] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_proteus_superluWrappers_pyx, __pyx_mstate->__pyx_n_u_getSubMatCSRrepresentation, __pyx_mstate->__pyx_kp_b_iso88591_A_3d_3d_z_1_A_vS_A_d_Rt7_1_WA_r, tuple_dedup_map);
if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[4]))
goto bad;
28359 const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 1, (
unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1};
28360 PyObject*
const varnames[] = {__pyx_mstate->__pyx_n_u_self};
28361 __pyx_mstate_global->__pyx_codeobj_tab[5] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_tree_fragment, __pyx_mstate->__pyx_n_u_reduce_cython, __pyx_mstate->__pyx_kp_b_iso88591_Q, tuple_dedup_map);
if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[5]))
goto bad;
28364 const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 2, (
unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 3};
28365 PyObject*
const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_pyx_state};
28366 __pyx_mstate_global->__pyx_codeobj_tab[6] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_tree_fragment, __pyx_mstate->__pyx_n_u_setstate_cython, __pyx_mstate->__pyx_kp_b_iso88591_Q, tuple_dedup_map);
if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[6]))
goto bad;
28369 const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 1, (
unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1};
28370 PyObject*
const varnames[] = {__pyx_mstate->__pyx_n_u_self};
28371 __pyx_mstate_global->__pyx_codeobj_tab[7] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_tree_fragment, __pyx_mstate->__pyx_n_u_reduce_cython, __pyx_mstate->__pyx_kp_b_iso88591_Q, tuple_dedup_map);
if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[7]))
goto bad;
28374 const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 2, (
unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 3};
28375 PyObject*
const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_pyx_state};
28376 __pyx_mstate_global->__pyx_codeobj_tab[8] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_tree_fragment, __pyx_mstate->__pyx_n_u_setstate_cython, __pyx_mstate->__pyx_kp_b_iso88591_Q, tuple_dedup_map);
if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[8]))
goto bad;
28379 const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 2, (
unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 222};
28380 PyObject*
const varnames[] = {__pyx_mstate->__pyx_n_u_sparse_matrix, __pyx_mstate->__pyx_n_u_sparseFactor};
28381 __pyx_mstate_global->__pyx_codeobj_tab[9] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_proteus_superluWrappers_pyx, __pyx_mstate->__pyx_n_u_sparseFactorPrepare, __pyx_mstate->__pyx_kp_b_iso88591_a_A, tuple_dedup_map);
if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[9]))
goto bad;
28384 const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 2, (
unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 289};
28385 PyObject*
const varnames[] = {__pyx_mstate->__pyx_n_u_sparseFactor, __pyx_mstate->__pyx_n_u_x};
28386 __pyx_mstate_global->__pyx_codeobj_tab[10] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_proteus_superluWrappers_pyx, __pyx_mstate->__pyx_n_u_sparseFactorSolve, __pyx_mstate->__pyx_kp_b_iso88591_AQ, tuple_dedup_map);
if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[10]))
goto bad;
28388 Py_DECREF(tuple_dedup_map);
28391 Py_DECREF(tuple_dedup_map);
28396static int __Pyx_InitGlobals(
void) {
28397 int __pyx_lineno = 0;
28398 const char *__pyx_filename = NULL;
28399 int __pyx_clineno = 0;
28401 if (likely(__Pyx_init_co_variables() == 0 && __Pyx_init_tpflags_variables() == 0));
else
28403 if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1, __pyx_L1_error)
28406 #if CYTHON_COMPILING_IN_LIMITED_API
28408 PyObject *builtins = PyEval_GetBuiltins();
28409 if (likely(builtins)) {
28410 PyObject *type_name = PyUnicode_FromStringAndSize(
"frozendict",
sizeof(
"frozendict")-1);
28411 if (likely(type_name)) {
28412 PyObject *frozendict_type = PyObject_GetItem(builtins, type_name);
28413 Py_DECREF(type_name);
28414 if (!frozendict_type && PyErr_ExceptionMatches(PyExc_KeyError)) {
28416 frozendict_type = (PyObject*) &PyDict_Type;
28417 Py_INCREF(frozendict_type);
28419 __pyx_mstate_global->__Pyx_PyFrozenDictType = frozendict_type;
28425 if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1, __pyx_L1_error)
28428 if (likely(__Pyx_init_assertions_enabled() == 0));
else
28430 if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1, __pyx_L1_error)
28439 #ifdef NPY_FEATURE_VERSION
28440 #ifndef NO_IMPORT_ARRAY
28441 if (unlikely(_import_array() == -1)) {
28442 PyErr_SetString(PyExc_ImportError,
"numpy.core.multiarray failed to import "
28443 "(auto-generated because you didn't call 'numpy.import_array()' after cimporting numpy; "
28444 "use '<void>numpy._import_array' to disable if you are certain you don't need it).");
28449 if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1, __pyx_L1_error)
28452 if (likely(__pyx_CommonTypesMetaclass_init(__pyx_m) == 0));
else
28454 if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1, __pyx_L1_error)
28457 #if CYTHON_COMPILING_IN_LIMITED_API
28459 PyObject *typesModule=NULL;
28460 typesModule = PyImport_ImportModule(
"types");
28462 __pyx_mstate_global->__Pyx_CachedMethodType = PyObject_GetAttrString(typesModule,
"MethodType");
28463 Py_DECREF(typesModule);
28468 if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1, __pyx_L1_error)
28476static int __Pyx_InitAfterSharedUtility(
void) {
28477 int __pyx_lineno = 0;
28478 const char *__pyx_filename = NULL;
28479 int __pyx_clineno = 0;
28481 if (likely(__pyx_CyFunction_init(__pyx_m) == 0));
else
28483 if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1, __pyx_L1_error)
28494#pragma warning( push )
28499#pragma warning( disable : 4127 )
28509static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(
const char *modname) {
28510 PyObject *m = NULL, *p = NULL;
28512 m = PyImport_ImportModule(modname);
28514 p = PyObject_GetAttrString(m,
"RefNannyAPI");
28516 r = PyLong_AsVoidPtr(p);
28520 return (__Pyx_RefNannyAPIStruct *)
r;
28525#if CYTHON_COMPILING_IN_CPYTHON
28526static int __Pyx_InBases(PyTypeObject *a, PyTypeObject *b) {
28528 a = __Pyx_PyType_GetSlot(a, tp_base, PyTypeObject*);
28532 return b == &PyBaseObject_Type;
28534static CYTHON_INLINE
int __Pyx_IsSubtype(PyTypeObject *a, PyTypeObject *b) {
28536 if (a == b)
return 1;
28540 n = PyTuple_GET_SIZE(mro);
28541 for (i = 0; i <
n; i++) {
28542 if (PyTuple_GET_ITEM(mro, i) == (PyObject *)b)
28547 return __Pyx_InBases(a, b);
28549static CYTHON_INLINE
int __Pyx_IsAnySubtype2(PyTypeObject *cls, PyTypeObject *a, PyTypeObject *b) {
28551 if (cls == a || cls == b)
return 1;
28555 n = PyTuple_GET_SIZE(mro);
28556 for (i = 0; i <
n; i++) {
28557 PyObject *base = PyTuple_GET_ITEM(mro, i);
28558 if (base == (PyObject *)a || base == (PyObject *)b)
28563 return __Pyx_InBases(cls, a) || __Pyx_InBases(cls, b);
28568#if CYTHON_FAST_THREAD_STATE
28569static CYTHON_INLINE
void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb) {
28570#if PY_VERSION_HEX >= 0x030C00A6
28571 PyObject *tmp_value;
28572 assert(type == NULL || (value != NULL && type == (PyObject*) Py_TYPE(value)));
28574 #if CYTHON_COMPILING_IN_CPYTHON
28575 if (unlikely(((PyBaseExceptionObject*) value)->traceback != tb))
28577 PyException_SetTraceback(value, tb);
28579 tmp_value = tstate->current_exception;
28580 tstate->current_exception = value;
28581 Py_XDECREF(tmp_value);
28585 PyObject *tmp_type, *tmp_value, *tmp_tb;
28586 tmp_type = tstate->curexc_type;
28587 tmp_value = tstate->curexc_value;
28588 tmp_tb = tstate->curexc_traceback;
28589 tstate->curexc_type = type;
28590 tstate->curexc_value = value;
28591 tstate->curexc_traceback = tb;
28592 Py_XDECREF(tmp_type);
28593 Py_XDECREF(tmp_value);
28594 Py_XDECREF(tmp_tb);
28597static CYTHON_INLINE
void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) {
28598#if PY_VERSION_HEX >= 0x030C00A6
28599 PyObject* exc_value;
28600 exc_value = tstate->current_exception;
28601 tstate->current_exception = 0;
28602 *value = exc_value;
28606 *type = (PyObject*) Py_TYPE(exc_value);
28608 #if CYTHON_COMPILING_IN_CPYTHON
28609 *tb = ((PyBaseExceptionObject*) exc_value)->traceback;
28612 *tb = PyException_GetTraceback(exc_value);
28616 *type = tstate->curexc_type;
28617 *value = tstate->curexc_value;
28618 *tb = tstate->curexc_traceback;
28619 tstate->curexc_type = 0;
28620 tstate->curexc_value = 0;
28621 tstate->curexc_traceback = 0;
28627#if CYTHON_COMPILING_IN_CPYTHON
28628static CYTHON_INLINE
int __Pyx_inner_PyErr_GivenExceptionMatches2(PyObject *err, PyObject* exc_type1, PyObject *exc_type2) {
28630 return __Pyx_IsAnySubtype2((PyTypeObject*)err, (PyTypeObject*)exc_type1, (PyTypeObject*)exc_type2);
28632 return __Pyx_IsSubtype((PyTypeObject*)err, (PyTypeObject*)exc_type2);
28635static int __Pyx_PyErr_GivenExceptionMatchesTuple(PyObject *exc_type, PyObject *tuple) {
28637 assert(PyExceptionClass_Check(exc_type));
28638 n = PyTuple_GET_SIZE(tuple);
28639 for (i=0; i<
n; i++) {
28640 if (exc_type == PyTuple_GET_ITEM(tuple, i))
return 1;
28642 for (i=0; i<
n; i++) {
28643 PyObject *t = PyTuple_GET_ITEM(tuple, i);
28644 if (likely(PyExceptionClass_Check(t))) {
28645 if (__Pyx_inner_PyErr_GivenExceptionMatches2(exc_type, NULL, t))
return 1;
28651static CYTHON_INLINE
int __Pyx_PyErr_GivenExceptionMatches(PyObject *err, PyObject* exc_type) {
28652 if (likely(err == exc_type))
return 1;
28653 if (likely(PyExceptionClass_Check(err))) {
28654 if (likely(PyExceptionClass_Check(exc_type))) {
28655 return __Pyx_inner_PyErr_GivenExceptionMatches2(err, NULL, exc_type);
28656 }
else if (likely(PyTuple_Check(exc_type))) {
28657 return __Pyx_PyErr_GivenExceptionMatchesTuple(err, exc_type);
28661 return PyErr_GivenExceptionMatches(err, exc_type);
28663static CYTHON_INLINE
int __Pyx_PyErr_GivenExceptionMatches2(PyObject *err, PyObject *exc_type1, PyObject *exc_type2) {
28664 assert(PyExceptionClass_Check(exc_type1));
28665 assert(PyExceptionClass_Check(exc_type2));
28666 if (likely(err == exc_type1 || err == exc_type2))
return 1;
28667 if (likely(PyExceptionClass_Check(err))) {
28668 return __Pyx_inner_PyErr_GivenExceptionMatches2(err, exc_type1, exc_type2);
28670 return (PyErr_GivenExceptionMatches(err, exc_type1) || PyErr_GivenExceptionMatches(err, exc_type2));
28675#if CYTHON_FAST_THREAD_STATE
28676static int __Pyx_PyErr_ExceptionMatchesTuple(PyObject *exc_type, PyObject *tuple) {
28678 n = PyTuple_GET_SIZE(tuple);
28679 for (i=0; i<
n; i++) {
28680 if (exc_type == PyTuple_GET_ITEM(tuple, i))
return 1;
28682 for (i=0; i<
n; i++) {
28683 if (__Pyx_PyErr_GivenExceptionMatches(exc_type, PyTuple_GET_ITEM(tuple, i)))
return 1;
28687static CYTHON_INLINE
int __Pyx_PyErr_ExceptionMatchesInState(PyThreadState* tstate, PyObject* err) {
28689 PyObject *exc_type;
28690#if PY_VERSION_HEX >= 0x030C00A6
28691 PyObject *current_exception = tstate->current_exception;
28692 if (unlikely(!current_exception))
return 0;
28693 exc_type = (PyObject*) Py_TYPE(current_exception);
28694 if (exc_type == err)
return 1;
28696 exc_type = tstate->curexc_type;
28697 if (exc_type == err)
return 1;
28698 if (unlikely(!exc_type))
return 0;
28700 #if CYTHON_AVOID_BORROWED_REFS
28701 Py_INCREF(exc_type);
28703 if (unlikely(PyTuple_Check(err))) {
28704 result = __Pyx_PyErr_ExceptionMatchesTuple(exc_type, err);
28706 result = __Pyx_PyErr_GivenExceptionMatches(exc_type, err);
28708 #if CYTHON_AVOID_BORROWED_REFS
28709 Py_DECREF(exc_type);
28716#if CYTHON_USE_TYPE_SLOTS
28717static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name) {
28718 PyTypeObject* tp = Py_TYPE(obj);
28719 if (likely(tp->tp_getattro))
28720 return tp->tp_getattro(obj, attr_name);
28721 return PyObject_GetAttr(obj, attr_name);
28726#if __PYX_LIMITED_VERSION_HEX < 0x030d0000
28727static void __Pyx_PyObject_GetAttrStr_ClearAttributeError(
void) {
28728 __Pyx_PyThreadState_declare
28729 __Pyx_PyThreadState_assign
28730 if (likely(__Pyx_PyErr_ExceptionMatches(PyExc_AttributeError)))
28731 __Pyx_PyErr_Clear();
28734static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStrNoError(PyObject* obj, PyObject* attr_name) {
28736#if __PYX_LIMITED_VERSION_HEX >= 0x030d0000
28737 (void) PyObject_GetOptionalAttr(obj, attr_name, &result);
28740#if CYTHON_COMPILING_IN_CPYTHON && CYTHON_USE_TYPE_SLOTS
28741 PyTypeObject* tp = Py_TYPE(obj);
28742 if (likely(tp->tp_getattro == PyObject_GenericGetAttr)) {
28743 return _PyObject_GenericGetAttrWithDict(obj, attr_name, NULL, 1);
28746 result = __Pyx_PyObject_GetAttrStr(obj, attr_name);
28747 if (unlikely(!result)) {
28748 __Pyx_PyObject_GetAttrStr_ClearAttributeError();
28755static PyObject *__Pyx_GetBuiltinName(PyObject *name) {
28756 PyObject* result = __Pyx_PyObject_GetAttrStrNoError(__pyx_mstate_global->__pyx_b, name);
28757 if (unlikely(!result) && !PyErr_Occurred()) {
28758 PyErr_Format(PyExc_NameError,
28759 "name '%U' is not defined", name);
28765#if CYTHON_COMPILING_IN_CPYTHON
28766static CYTHON_INLINE
void __Pyx_copy_object_array(PyObject *
const *CYTHON_RESTRICT src, PyObject** CYTHON_RESTRICT dest, Py_ssize_t length) {
28769 for (i = 0; i < length; i++) {
28770 v = dest[i] = src[i];
28777#if !(PY_VERSION_HEX >= 0x030F0000 && !CYTHON_COMPILING_IN_LIMITED_API)
28778CYTHON_UNUSED
static PyObject *
28779__Pyx_PyTuple_FromArray(PyObject *
const *src, Py_ssize_t
n) {
28781 return __Pyx_NewRef(__pyx_mstate_global->__pyx_empty_tuple);
28783 PyObject *res = PyTuple_New(
n);
28784 if (unlikely(res == NULL))
return NULL;
28785 #if CYTHON_COMPILING_IN_CPYTHON
28786 __Pyx_copy_object_array(src, ((PyTupleObject*)res)->ob_item,
n);
28789 for (i = 0; i <
n; i++) {
28791 if (unlikely(__Pyx_PyTuple_SET_ITEM(res, i, src[i]) < (0))) {
28802#ifndef __Pyx_DEFINED_PyObject_CompareStrStrBoolEq
28803#define __Pyx_DEFINED_PyObject_CompareStrStrBoolEq
28804static CYTHON_INLINE
int __Pyx_PyObject_CompareStrStrBoolEq(PyObject* s1, PyObject* s2) {
28805 #if __PYX_LIMITED_VERSION_HEX >= 0x030e0000
28806 int result = PyUnicode_Equal(s1, s2);
28807 #if !CYTHON_COMPILING_IN_CPYTHON
28808 if (unlikely(result == -1))
return -1;
28810 if (result == 0)
goto __pyx_return_false;
else goto __pyx_return_true;
28812 int result = PyUnicode_Compare(s1, s2);
28813 if (unlikely((result == -1) && PyErr_Occurred()))
return -1;
28814 if (result == 0)
goto __pyx_return_true;
else goto __pyx_return_false;
28822static CYTHON_INLINE
int __Pyx_PyObject_CompareBoolEq_str_str(PyObject *op1, PyObject *op2,
int pyop) {
28823 CYTHON_UNUSED_VAR(pyop);
28824 if (unlikely(op1 == Py_None)) {
28825 if (op2 == Py_None)
goto __pyx_return_true;
else goto __pyx_return_false;
28827 if (unlikely(op2 == Py_None)) {
28828 if (op1 == Py_None)
goto __pyx_return_true;
else goto __pyx_return_false;
28831 if (likely(op1 != Py_None)) {
28832 if (op1 == op2)
goto __pyx_return_true;
28833 if (likely(op2 != Py_None)) {
28834 return __Pyx_PyObject_CompareStrStrBoolEq(op1, op2);
28836 goto __pyx_richcmp;
28839 if ((0))
goto __pyx_richcmp;
28840 if ((0))
goto __pyx_return_true;
28841 if ((0))
goto __pyx_return_false;
28843 return __Pyx_PyObject_RichCompareBool(op1, op2, Py_EQ);
28851#if CYTHON_VECTORCALL
28852static CYTHON_INLINE PyObject * __Pyx_GetKwValue_FASTCALL(PyObject *kwnames, PyObject *
const *kwvalues, PyObject *
s)
28854 Py_ssize_t i,
n = __Pyx_PyTuple_GET_SIZE(kwnames);
28855 #if !CYTHON_ASSUME_SAFE_SIZE
28856 if (unlikely(
n == -1))
return NULL;
28858 for (i = 0; i <
n; i++)
28860 PyObject *namei = __Pyx_PyTuple_GET_ITEM(kwnames, i);
28861 #if !CYTHON_ASSUME_SAFE_MACROS
28862 if (unlikely(!namei))
return NULL;
28864 if (
s == namei)
return kwvalues[i];
28866 for (i = 0; i <
n; i++)
28868 PyObject *namei = __Pyx_PyTuple_GET_ITEM(kwnames, i);
28869 #if !CYTHON_ASSUME_SAFE_MACROS
28870 if (unlikely(!namei))
return NULL;
28872 int eq = __Pyx_PyUnicode_Equals(
s, namei);
28873 if (unlikely(eq != 0)) {
28874 if (unlikely(eq < 0))
return NULL;
28875 return kwvalues[i];
28880#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030d0000 || CYTHON_COMPILING_IN_LIMITED_API || CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_GRAAL
28881CYTHON_UNUSED
static PyObject *__Pyx_KwargsAsDict_FASTCALL(PyObject *kwnames, PyObject *
const *kwvalues) {
28882 Py_ssize_t i, nkwargs;
28884#if !CYTHON_ASSUME_SAFE_SIZE
28885 nkwargs = PyTuple_Size(kwnames);
28886 if (unlikely(nkwargs < 0))
return NULL;
28888 nkwargs = PyTuple_GET_SIZE(kwnames);
28890 dict = PyDict_New();
28891 if (unlikely(!dict))
28893 for (i=0; i<nkwargs; i++) {
28894#if !CYTHON_ASSUME_SAFE_MACROS
28895 PyObject *key = PyTuple_GetItem(kwnames, i);
28896 if (!key)
goto bad;
28898 PyObject *key = PyTuple_GET_ITEM(kwnames, i);
28900 if (unlikely(PyDict_SetItem(dict, key, kwvalues[i]) < 0))
28912#if CYTHON_COMPILING_IN_CPYTHON
28913static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw) {
28915 ternaryfunc call = Py_TYPE(func)->tp_call;
28916 if (unlikely(!call))
28917 return PyObject_Call(func, arg, kw);
28918 if (unlikely(Py_EnterRecursiveCall(
" while calling a Python object")))
28920 result = (*call)(func, arg, kw);
28921 Py_LeaveRecursiveCall();
28922 if (unlikely(!result) && unlikely(!PyErr_Occurred())) {
28925 "NULL result without error in PyObject_Call");
28932#if CYTHON_COMPILING_IN_CPYTHON
28933static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg) {
28934 PyObject *self, *result;
28936 cfunc = __Pyx_CyOrPyCFunction_GET_FUNCTION(func);
28937 self = __Pyx_CyOrPyCFunction_GET_SELF(func);
28938 if (unlikely(Py_EnterRecursiveCall(
" while calling a Python object")))
28940 result = cfunc(self, arg);
28941 Py_LeaveRecursiveCall();
28942 if (unlikely(!result) && unlikely(!PyErr_Occurred())) {
28945 "NULL result without error in PyObject_Call");
28952#if CYTHON_COMPILING_IN_LIMITED_API
28953static PyObject* __Pyx_PyObject_FastCall_fallback(PyObject *func, PyObject *
const*args,
size_t nargs, PyObject *kwargs) {
28954 PyObject *argstuple;
28955 PyObject *result = 0;
28957 argstuple = PyTuple_New((Py_ssize_t)nargs);
28958 if (unlikely(!argstuple))
return NULL;
28959 for (i = 0; i < nargs; i++) {
28960 Py_INCREF(args[i]);
28961 if (__Pyx_PyTuple_SET_ITEM(argstuple, (Py_ssize_t)i, args[i]) != (0))
goto bad;
28963 result = __Pyx_PyObject_Call(func, argstuple, kwargs);
28965 Py_DECREF(argstuple);
28969#if CYTHON_VECTORCALL && !(CYTHON_COMPILING_IN_LIMITED_API || CYTHON_COMPILING_IN_PYPY)
28970 #if CYTHON_COMPILING_IN_CPYTHON
28971static CYTHON_INLINE vectorcallfunc __Pyx_PyVectorcall_Function(PyObject *callable) {
28972 PyTypeObject *tp = Py_TYPE(callable);
28973 #if defined(__Pyx_CyFunction_USED)
28974 if (__Pyx_CyFunction_CheckExact(callable)) {
28975 return __Pyx_CyFunction_func_vectorcall(callable);
28978 if (!PyType_HasFeature(tp, Py_TPFLAGS_HAVE_VECTORCALL)) {
28981 assert(PyCallable_Check(callable));
28982 Py_ssize_t offset = tp->tp_vectorcall_offset;
28983 assert(offset > 0);
28984 vectorcallfunc ptr;
28985 memcpy(&ptr, (
char *) callable + offset,
sizeof(ptr));
28989 #define __Pyx_PyVectorcall_Function(callable) PyVectorcall_Function(callable)
28992static CYTHON_INLINE PyObject* __Pyx_PyObject_FastCallDict(PyObject *func, PyObject *
const *args,
size_t nargsf, PyObject *kwargs) {
28993 Py_ssize_t nargs = __Pyx_PyVectorcall_NARGS(nargsf);
28994#if CYTHON_COMPILING_IN_CPYTHON
28995 if (nargs == 0 && kwargs == NULL) {
28996 if (__Pyx_CyOrPyCFunction_Check(func) && likely( __Pyx_CyOrPyCFunction_GET_FLAGS(func) & METH_NOARGS))
28997 return __Pyx_PyObject_CallMethO(func, NULL);
28999 else if (nargs == 1 && kwargs == NULL) {
29000 if (__Pyx_CyOrPyCFunction_Check(func) && likely( __Pyx_CyOrPyCFunction_GET_FLAGS(func) & METH_O))
29001 return __Pyx_PyObject_CallMethO(func, args[0]);
29004 if (kwargs == NULL) {
29005 #if CYTHON_VECTORCALL
29006 #if CYTHON_COMPILING_IN_LIMITED_API || CYTHON_COMPILING_IN_PYPY
29007 return PyObject_Vectorcall(func, args, nargsf, NULL);
29009 vectorcallfunc
f = __Pyx_PyVectorcall_Function(func);
29011 return f(func, args, nargsf, NULL);
29017 return __Pyx_PyObject_Call(func, __pyx_mstate_global->__pyx_empty_tuple, kwargs);
29019 #if CYTHON_COMPILING_IN_LIMITED_API
29020 return __Pyx_PyObject_FastCall_fallback(func, args, (
size_t)nargs, kwargs);
29021 #elif CYTHON_COMPILING_IN_PYPY
29022 return PyObject_VectorcallDict(func, args, (
size_t) nargs, kwargs);
29024 return PyObject_VectorcallDict(func, args, nargsf, kwargs);
29029static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg) {
29030 PyObject *args[2] = {NULL, arg};
29031 return __Pyx_PyObject_FastCall(func, args+1, 1 | __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET);
29035static CYTHON_INLINE
int __Pyx_IgnoreGivenException(PyObject *given_exception, PyObject *ignorable_exception) {
29036 if (PyErr_GivenExceptionMatches(given_exception ? given_exception : PyErr_Occurred(), ignorable_exception)) {
29044#if CYTHON_COMPILING_IN_LIMITED_API && __PYX_LIMITED_VERSION_HEX < 0x030C0000
29045static PyObject *__Pyx_SelflessCall(PyObject *method, PyObject *args, PyObject *kwargs) {
29047 PyObject *selfless_args = PyTuple_GetSlice(args, 1, PyTuple_Size(args));
29048 if (unlikely(!selfless_args))
return NULL;
29049 result = PyObject_Call(method, selfless_args, kwargs);
29050 Py_DECREF(selfless_args);
29054static PyObject *__Pyx_SelflessCall(PyObject *method, PyObject *
const *args, Py_ssize_t nargs, PyObject *kwnames) {
29055 return PyObject_Vectorcall(method, args ? args+1 : NULL, nargs ? (
size_t) nargs-1 : 0, kwnames);
29058static PyMethodDef __Pyx_UnboundCMethod_Def = {
29059 "CythonUnboundCMethod",
29060 __PYX_REINTERPRET_FUNCION(PyCFunction, __Pyx_SelflessCall),
29061#if CYTHON_COMPILING_IN_LIMITED_API && __PYX_LIMITED_VERSION_HEX < 0x030C0000
29062 METH_VARARGS | METH_KEYWORDS,
29064 METH_FASTCALL | METH_KEYWORDS,
29068static int __Pyx_TryUnpackUnboundCMethod(__Pyx_CachedCFunction* target) {
29069 PyObject *method, *result=NULL;
29070 method = __Pyx_PyObject_GetAttrStr(target->type, *target->method_name);
29071 if (unlikely(!method))
29074#if CYTHON_COMPILING_IN_CPYTHON
29075 if (likely(__Pyx_TypeCheck(method, &PyMethodDescr_Type)))
29077 PyMethodDescrObject *descr = (PyMethodDescrObject*) method;
29078 target->func = descr->d_method->ml_meth;
29079 target->flag = descr->d_method->ml_flags & ~(METH_CLASS | METH_STATIC | METH_COEXIST);
29082#if CYTHON_COMPILING_IN_PYPY
29084 if (PyCFunction_Check(method))
29089#if CYTHON_COMPILING_IN_LIMITED_API || CYTHON_COMPILING_IN_PYPY
29090 self = PyObject_GetAttrString(method,
"__self__");
29091 if (!self && !__Pyx_IgnoreException(PyExc_AttributeError)) {
29095 self = PyCFunction_GET_SELF(method);
29097 self_found = (self && self != Py_None);
29098#if CYTHON_COMPILING_IN_LIMITED_API || CYTHON_COMPILING_IN_PYPY
29102 PyObject *unbound_method = PyCFunction_New(&__Pyx_UnboundCMethod_Def, method);
29103 if (unlikely(!unbound_method))
return -1;
29105 result = unbound_method;
29108#if !CYTHON_COMPILING_IN_CPYTHON_FREETHREADING
29109 if (unlikely(target->method)) {
29113 target->method = result;
29118#if CYTHON_COMPILING_IN_CPYTHON
29119static CYTHON_INLINE PyObject* __Pyx_CallUnboundCMethod0(__Pyx_CachedCFunction* cfunc, PyObject* self) {
29120 int was_initialized = __Pyx_CachedCFunction_GetAndSetInitializing(cfunc);
29121 if (likely(was_initialized == 2 && cfunc->func)) {
29122 if (likely(cfunc->flag == METH_NOARGS))
29123 return __Pyx_CallCFunction(cfunc, self, NULL);
29124 if (likely(cfunc->flag == METH_FASTCALL))
29125 return __Pyx_CallCFunctionFast(cfunc, self, NULL, 0);
29126 if (cfunc->flag == (METH_FASTCALL | METH_KEYWORDS))
29127 return __Pyx_CallCFunctionFastWithKeywords(cfunc, self, NULL, 0, NULL);
29128 if (likely(cfunc->flag == (METH_VARARGS | METH_KEYWORDS)))
29129 return __Pyx_CallCFunctionWithKeywords(cfunc, self, __pyx_mstate_global->__pyx_empty_tuple, NULL);
29130 if (cfunc->flag == METH_VARARGS)
29131 return __Pyx_CallCFunction(cfunc, self, __pyx_mstate_global->__pyx_empty_tuple);
29132 return __Pyx__CallUnboundCMethod0(cfunc, self);
29134#if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING
29135 else if (unlikely(was_initialized == 1)) {
29136 __Pyx_CachedCFunction tmp_cfunc = {
29141 tmp_cfunc.type = cfunc->type;
29142 tmp_cfunc.method_name = cfunc->method_name;
29143 return __Pyx__CallUnboundCMethod0(&tmp_cfunc, self);
29146 PyObject *result = __Pyx__CallUnboundCMethod0(cfunc, self);
29147 __Pyx_CachedCFunction_SetFinishedInitializing(cfunc);
29151static PyObject* __Pyx__CallUnboundCMethod0(__Pyx_CachedCFunction* cfunc, PyObject* self) {
29153 if (unlikely(!cfunc->method) && unlikely(__Pyx_TryUnpackUnboundCMethod(cfunc) < 0))
return NULL;
29154 result = __Pyx_PyObject_CallOneArg(cfunc->method, self);
29159static CYTHON_INLINE PyObject* __Pyx_PyDict_Items(PyObject* d) {
29160 return __Pyx_CallUnboundCMethod0(&__pyx_mstate_global->__pyx_umethod_PyDict_Type_items, d);
29164static CYTHON_INLINE PyObject* __Pyx_PyDict_Values(PyObject* d) {
29165 return __Pyx_CallUnboundCMethod0(&__pyx_mstate_global->__pyx_umethod_PyDict_Type_values, d);
29169#if CYTHON_AVOID_BORROWED_REFS
29170static int __Pyx_PyDict_NextRef(PyObject *p, PyObject **ppos, PyObject **pkey, PyObject **pvalue) {
29171 PyObject *next = NULL;
29174 PyObject *dictview = pkey ? __Pyx_PyDict_Items(p) : __Pyx_PyDict_Values(p);
29175 if (unlikely(!dictview))
goto bad;
29176 *ppos = PyObject_GetIter(dictview);
29177 Py_DECREF(dictview);
29179 *ppos = PyObject_GetIter(p);
29181 if (unlikely(!*ppos))
goto bad;
29183 next = PyIter_Next(*ppos);
29185 if (PyErr_Occurred())
goto bad;
29188 if (pkey && pvalue) {
29189 *pkey = __Pyx_PySequence_ITEM(next, 0);
29190 if (unlikely(*pkey))
goto bad;
29191 *pvalue = __Pyx_PySequence_ITEM(next, 1);
29192 if (unlikely(*pvalue))
goto bad;
29203#if !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX >= 0x030d0000
29204 PyErr_FormatUnraisable(
"Exception ignored in __Pyx_PyDict_NextRef");
29206 PyErr_WriteUnraisable(__pyx_mstate_global->__pyx_n_u_Pyx_PyDict_NextRef);
29208 if (pkey) *pkey = NULL;
29209 if (pvalue) *pvalue = NULL;
29213static int __Pyx_PyDict_NextRef(PyObject *p, Py_ssize_t *ppos, PyObject **pkey, PyObject **pvalue) {
29214 int result = PyDict_Next(p, ppos, pkey, pvalue);
29215 if (likely(result == 1)) {
29216 if (pkey) Py_INCREF(*pkey);
29217 if (pvalue) Py_INCREF(*pvalue);
29224static void __Pyx_RaiseDoubleKeywordsError(
29225 const char* func_name,
29228 PyErr_Format(PyExc_TypeError,
29229 "%s() got multiple values for keyword argument '%U'", func_name, kw_name);
29233#if CYTHON_COMPILING_IN_CPYTHON
29234static CYTHON_INLINE PyObject *__Pyx_CallUnboundCMethod2(__Pyx_CachedCFunction *cfunc, PyObject *self, PyObject *arg1, PyObject *arg2) {
29235 int was_initialized = __Pyx_CachedCFunction_GetAndSetInitializing(cfunc);
29236 if (likely(was_initialized == 2 && cfunc->func)) {
29237 PyObject *args[2] = {arg1, arg2};
29238 if (cfunc->flag == METH_FASTCALL) {
29239 return __Pyx_CallCFunctionFast(cfunc, self, args, 2);
29241 if (cfunc->flag == (METH_FASTCALL | METH_KEYWORDS))
29242 return __Pyx_CallCFunctionFastWithKeywords(cfunc, self, args, 2, NULL);
29244#if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING
29245 else if (unlikely(was_initialized == 1)) {
29246 __Pyx_CachedCFunction tmp_cfunc = {
29251 tmp_cfunc.type = cfunc->type;
29252 tmp_cfunc.method_name = cfunc->method_name;
29253 return __Pyx__CallUnboundCMethod2(&tmp_cfunc, self, arg1, arg2);
29256 PyObject *result = __Pyx__CallUnboundCMethod2(cfunc, self, arg1, arg2);
29257 __Pyx_CachedCFunction_SetFinishedInitializing(cfunc);
29261static PyObject* __Pyx__CallUnboundCMethod2(__Pyx_CachedCFunction* cfunc, PyObject* self, PyObject* arg1, PyObject* arg2){
29262 if (unlikely(!cfunc->func && !cfunc->method) && unlikely(__Pyx_TryUnpackUnboundCMethod(cfunc) < 0))
return NULL;
29263#if CYTHON_COMPILING_IN_CPYTHON
29264 if (cfunc->func && (cfunc->flag & METH_VARARGS)) {
29265 PyObject *result = NULL;
29266 PyObject *args = PyTuple_New(2);
29267 if (unlikely(!args))
return NULL;
29269 PyTuple_SET_ITEM(args, 0, arg1);
29271 PyTuple_SET_ITEM(args, 1, arg2);
29272 if (cfunc->flag & METH_KEYWORDS)
29273 result = __Pyx_CallCFunctionWithKeywords(cfunc, self, args, NULL);
29275 result = __Pyx_CallCFunction(cfunc, self, args);
29281 PyObject *args[4] = {NULL, self, arg1, arg2};
29282 return __Pyx_PyObject_FastCall(cfunc->method, args+1, 3 | __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET);
29287static int __Pyx_ValidateDuplicatePosArgs(
29289 PyObject **
const argnames[],
29290 PyObject **
const *first_kw_arg,
29291 const char* function_name)
29293 PyObject **
const *name = argnames;
29294 while (name != first_kw_arg) {
29295 PyObject *key = **name;
29296 int found = PyDict_Contains(kwds, key);
29297 if (unlikely(found)) {
29298 if (found == 1) __Pyx_RaiseDoubleKeywordsError(function_name, key);
29307#if CYTHON_USE_UNICODE_INTERNALS
29308static CYTHON_INLINE
int __Pyx_UnicodeKeywordsEqual(PyObject *s1, PyObject *s2) {
29310 Py_ssize_t len = PyUnicode_GET_LENGTH(s1);
29311 if (len != PyUnicode_GET_LENGTH(s2))
return 0;
29312 kind = PyUnicode_KIND(s1);
29313 if (kind != PyUnicode_KIND(s2))
return 0;
29314 const void *data1 = PyUnicode_DATA(s1);
29315 const void *data2 = PyUnicode_DATA(s2);
29316 return (memcmp(data1, data2, (
size_t) len * (
size_t) kind) == 0);
29319static int __Pyx_MatchKeywordArg_str(
29321 PyObject **
const argnames[],
29322 PyObject **
const *first_kw_arg,
29323 size_t *index_found,
29324 const char *function_name)
29326 PyObject **
const *name;
29327 #if CYTHON_USE_UNICODE_INTERNALS
29328 Py_hash_t key_hash = ((PyASCIIObject*)key)->hash;
29329 if (unlikely(key_hash == -1)) {
29330 key_hash = PyObject_Hash(key);
29331 if (unlikely(key_hash == -1))
29335 name = first_kw_arg;
29337 PyObject *name_str = **name;
29338 #if CYTHON_USE_UNICODE_INTERNALS
29339 if (key_hash == ((PyASCIIObject*)name_str)->hash && __Pyx_UnicodeKeywordsEqual(name_str, key)) {
29340 *index_found = (size_t) (name - argnames);
29344 #if CYTHON_ASSUME_SAFE_SIZE
29345 if (PyUnicode_GET_LENGTH(name_str) == PyUnicode_GET_LENGTH(key))
29348 int cmp = PyUnicode_Compare(name_str, key);
29349 if (cmp < 0 && unlikely(PyErr_Occurred()))
goto bad;
29351 *index_found = (size_t) (name - argnames);
29359 while (name != first_kw_arg) {
29360 PyObject *name_str = **name;
29361 #if CYTHON_USE_UNICODE_INTERNALS
29362 if (unlikely(key_hash == ((PyASCIIObject*)name_str)->hash)) {
29363 if (__Pyx_UnicodeKeywordsEqual(name_str, key))
29364 goto arg_passed_twice;
29367 #if CYTHON_ASSUME_SAFE_SIZE
29368 if (PyUnicode_GET_LENGTH(name_str) == PyUnicode_GET_LENGTH(key))
29371 if (unlikely(name_str == key))
goto arg_passed_twice;
29372 int cmp = PyUnicode_Compare(name_str, key);
29373 if (cmp < 0 && unlikely(PyErr_Occurred()))
goto bad;
29374 if (cmp == 0)
goto arg_passed_twice;
29381 __Pyx_RaiseDoubleKeywordsError(function_name, key);
29386static int __Pyx_MatchKeywordArg_nostr(
29388 PyObject **
const argnames[],
29389 PyObject **
const *first_kw_arg,
29390 size_t *index_found,
29391 const char *function_name)
29393 PyObject **
const *name;
29394 if (unlikely(!PyUnicode_Check(key)))
goto invalid_keyword_type;
29395 name = first_kw_arg;
29397 int cmp = PyObject_RichCompareBool(**name, key, Py_EQ);
29399 *index_found = (size_t) (name - argnames);
29402 if (unlikely(cmp == -1))
goto bad;
29406 while (name != first_kw_arg) {
29407 int cmp = PyObject_RichCompareBool(**name, key, Py_EQ);
29408 if (unlikely(cmp != 0)) {
29409 if (cmp == 1)
goto arg_passed_twice;
29416 __Pyx_RaiseDoubleKeywordsError(function_name, key);
29418invalid_keyword_type:
29419 PyErr_Format(PyExc_TypeError,
29420 "%.200s() keywords must be strings", function_name);
29425static CYTHON_INLINE
int __Pyx_MatchKeywordArg(
29427 PyObject **
const argnames[],
29428 PyObject **
const *first_kw_arg,
29429 size_t *index_found,
29430 const char *function_name)
29432 return likely(PyUnicode_CheckExact(key)) ?
29433 __Pyx_MatchKeywordArg_str(key, argnames, first_kw_arg, index_found, function_name) :
29434 __Pyx_MatchKeywordArg_nostr(key, argnames, first_kw_arg, index_found, function_name);
29436static void __Pyx_RejectUnknownKeyword(
29438 PyObject **
const argnames[],
29439 PyObject **
const *first_kw_arg,
29440 const char *function_name)
29442 #if CYTHON_AVOID_BORROWED_REFS
29443 PyObject *pos = NULL;
29445 Py_ssize_t pos = 0;
29447 PyObject *key = NULL;
29448 __Pyx_BEGIN_CRITICAL_SECTION(kwds);
29449 #if CYTHON_AVOID_BORROWED_REFS
29450 while (__Pyx_PyDict_NextRef(kwds, &pos, &key, NULL))
29452 (void) __Pyx_PyDict_NextRef;
29453 while (PyDict_Next(kwds, &pos, &key, NULL))
29456 PyObject**
const *name = first_kw_arg;
29457 while (*name && (**name != key)) name++;
29459 size_t index_found = 0;
29460 int cmp = __Pyx_MatchKeywordArg(key, argnames, first_kw_arg, &index_found, function_name);
29463 PyErr_Format(PyExc_TypeError,
29464 "%s() got an unexpected keyword argument '%U'",
29465 function_name, key);
29467 #if CYTHON_AVOID_BORROWED_REFS
29473 #if CYTHON_AVOID_BORROWED_REFS
29477 __Pyx_END_CRITICAL_SECTION();
29478 #if CYTHON_AVOID_BORROWED_REFS
29481 assert(PyErr_Occurred());
29483static int __Pyx_ParseKeywordDict(
29485 PyObject **
const argnames[],
29486 PyObject *values[],
29487 Py_ssize_t num_pos_args,
29488 Py_ssize_t num_kwargs,
29489 const char* function_name,
29490 int ignore_unknown_kwargs)
29492 PyObject**
const *name;
29493 PyObject**
const *first_kw_arg = argnames + num_pos_args;
29494 Py_ssize_t extracted = 0;
29495#if !CYTHON_COMPILING_IN_PYPY || defined(PyArg_ValidateKeywordArguments)
29496 if (unlikely(!PyArg_ValidateKeywordArguments(kwds)))
return -1;
29498 name = first_kw_arg;
29499 while (*name && num_kwargs > extracted) {
29500 PyObject * key = **name;
29503 #if __PYX_LIMITED_VERSION_HEX >= 0x030d0000
29504 found = PyDict_GetItemRef(kwds, key, &value);
29506 value = PyDict_GetItemWithError(kwds, key);
29511 if (unlikely(PyErr_Occurred()))
goto bad;
29515 if (unlikely(found < 0))
goto bad;
29516 values[name-argnames] = value;
29521 if (num_kwargs > extracted) {
29522 if (ignore_unknown_kwargs) {
29523 if (unlikely(__Pyx_ValidateDuplicatePosArgs(kwds, argnames, first_kw_arg, function_name) == -1))
29526 __Pyx_RejectUnknownKeyword(kwds, argnames, first_kw_arg, function_name);
29534static int __Pyx_ParseKeywordDictToDict(
29536 PyObject **
const argnames[],
29538 PyObject *values[],
29539 Py_ssize_t num_pos_args,
29540 const char* function_name)
29542 PyObject**
const *name;
29543 PyObject**
const *first_kw_arg = argnames + num_pos_args;
29545#if !CYTHON_COMPILING_IN_PYPY || defined(PyArg_ValidateKeywordArguments)
29546 if (unlikely(!PyArg_ValidateKeywordArguments(kwds)))
return -1;
29548 if (PyDict_Update(kwds2, kwds) < 0)
goto bad;
29549 name = first_kw_arg;
29551 PyObject *key = **name;
29553#if !CYTHON_COMPILING_IN_LIMITED_API && (PY_VERSION_HEX >= 0x030d00A2 || defined(PyDict_Pop))
29554 int found = PyDict_Pop(kwds2, key, &value);
29556 if (unlikely(found < 0))
goto bad;
29557 values[name-argnames] = value;
29559#elif __PYX_LIMITED_VERSION_HEX >= 0x030d0000
29560 int found = PyDict_GetItemRef(kwds2, key, &value);
29562 if (unlikely(found < 0))
goto bad;
29563 values[name-argnames] = value;
29564 if (unlikely(PyDict_DelItem(kwds2, key) < 0))
goto bad;
29567 #if CYTHON_COMPILING_IN_CPYTHON
29568 value = _PyDict_Pop(kwds2, key, kwds2);
29570 value = __Pyx_CallUnboundCMethod2(&__pyx_mstate_global->__pyx_umethod_PyDict_Type_pop, kwds2, key, kwds2);
29572 if (value == kwds2) {
29575 if (unlikely(!value))
goto bad;
29576 values[name-argnames] = value;
29581 len = PyDict_Size(kwds2);
29583 return __Pyx_ValidateDuplicatePosArgs(kwds, argnames, first_kw_arg, function_name);
29584 }
else if (unlikely(len == -1)) {
29591static int __Pyx_ParseKeywordsTuple(
29593 PyObject *
const *kwvalues,
29594 PyObject **
const argnames[],
29596 PyObject *values[],
29597 Py_ssize_t num_pos_args,
29598 Py_ssize_t num_kwargs,
29599 const char* function_name,
29600 int ignore_unknown_kwargs)
29602 PyObject *key = NULL;
29603 PyObject**
const * name;
29604 PyObject**
const *first_kw_arg = argnames + num_pos_args;
29605 for (Py_ssize_t pos = 0; pos < num_kwargs; pos++) {
29606#if CYTHON_AVOID_BORROWED_REFS
29607 key = __Pyx_PySequence_ITEM(kwds, pos);
29609 key = __Pyx_PyTuple_GET_ITEM(kwds, pos);
29611#if !CYTHON_ASSUME_SAFE_MACROS
29612 if (unlikely(!key))
goto bad;
29614 name = first_kw_arg;
29615 while (*name && (**name != key)) name++;
29617 PyObject *value = kwvalues[pos];
29618 values[name-argnames] = __Pyx_NewRef(value);
29620 size_t index_found = 0;
29621 int cmp = __Pyx_MatchKeywordArg(key, argnames, first_kw_arg, &index_found, function_name);
29623 PyObject *value = kwvalues[pos];
29624 values[index_found] = __Pyx_NewRef(value);
29626 if (unlikely(cmp == -1))
goto bad;
29628 PyObject *value = kwvalues[pos];
29629 if (unlikely(PyDict_SetItem(kwds2, key, value)))
goto bad;
29630 }
else if (!ignore_unknown_kwargs) {
29631 goto invalid_keyword;
29635 #if CYTHON_AVOID_BORROWED_REFS
29642 PyErr_Format(PyExc_TypeError,
29643 "%s() got an unexpected keyword argument '%U'",
29644 function_name, key);
29647 #if CYTHON_AVOID_BORROWED_REFS
29654static int __Pyx_ParseKeywords(
29656 PyObject *
const *kwvalues,
29657 PyObject **
const argnames[],
29659 PyObject *values[],
29660 Py_ssize_t num_pos_args,
29661 Py_ssize_t num_kwargs,
29662 const char* function_name,
29663 int ignore_unknown_kwargs)
29665 if (CYTHON_VECTORCALL && likely(PyTuple_Check(kwds)))
29666 return __Pyx_ParseKeywordsTuple(kwds, kwvalues, argnames, kwds2, values, num_pos_args, num_kwargs, function_name, ignore_unknown_kwargs);
29668 return __Pyx_ParseKeywordDictToDict(kwds, argnames, kwds2, values, num_pos_args, function_name);
29670 return __Pyx_ParseKeywordDict(kwds, argnames, values, num_pos_args, num_kwargs, function_name, ignore_unknown_kwargs);
29674static void __Pyx_RaiseArgtupleInvalid(
29675 const char* func_name,
29677 Py_ssize_t num_min,
29678 Py_ssize_t num_max,
29679 Py_ssize_t num_found)
29681 Py_ssize_t num_expected;
29682 const char *more_or_less;
29683 if (num_found < num_min) {
29684 num_expected = num_min;
29685 more_or_less =
"at least";
29687 num_expected = num_max;
29688 more_or_less =
"at most";
29691 more_or_less =
"exactly";
29693 PyErr_Format(PyExc_TypeError,
29694 "%.200s() takes %.8s %" CYTHON_FORMAT_SSIZE_T
"d positional argument%.1s (%" CYTHON_FORMAT_SSIZE_T
"d given)",
29695 func_name, more_or_less, num_expected,
29696 (num_expected == 1) ?
"" :
"s", num_found);
29700static void __Pyx_ArgTypeError(PyObject *obj, PyTypeObject *type,
const char *name,
int exact)
29702 __Pyx_TypeName type_name;
29703 __Pyx_TypeName obj_type_name;
29704 PyObject *extra_info = __pyx_mstate_global->__pyx_empty_unicode;
29705 int from_annotation_subclass = 0;
29706 if (unlikely(!type)) {
29707 PyErr_SetString(PyExc_SystemError,
"Missing type object");
29709 }
else if (exact == 2) {
29710 if (__Pyx_TypeCheck(obj, type)) {
29711 from_annotation_subclass = 1;
29712 extra_info = __pyx_mstate_global->__pyx_kp_u_Note_that_Cython_is_deliberately;
29715 type_name = __Pyx_PyType_GetFullyQualifiedName(type);
29716 #if CYTHON_COMPILING_IN_LIMITED_API && __PYX_LIMITED_VERSION_HEX < 0x030d0000
29717 if (unlikely(!type_name))
return;
29719 obj_type_name = __Pyx_PyType_GetFullyQualifiedName(Py_TYPE(obj));
29720 #if CYTHON_COMPILING_IN_LIMITED_API && __PYX_LIMITED_VERSION_HEX < 0x030d0000
29721 if (unlikely(!obj_type_name))
goto obj_type_name_failed;
29723 PyErr_Format(PyExc_TypeError,
29724 "Argument '%.200s' has incorrect type (expected " __Pyx_FMT_TYPENAME
", got " __Pyx_FMT_TYPENAME
")"
29725#
if __PYX_LIMITED_VERSION_HEX < 0x030C0000
29728 , name, type_name, obj_type_name
29729#
if __PYX_LIMITED_VERSION_HEX < 0x030C0000
29730 , (from_annotation_subclass ?
". " :
""), extra_info
29733#if __PYX_LIMITED_VERSION_HEX >= 0x030C0000
29734 if (exact == 2 && from_annotation_subclass) {
29736 PyObject *vargs[2];
29737 vargs[0] = PyErr_GetRaisedException();
29738 vargs[1] = extra_info;
29739 res = PyObject_VectorcallMethod(__pyx_mstate_global->__pyx_kp_u_add_note, vargs, 2, NULL);
29741 PyErr_SetRaisedException(vargs[0]);
29744 __Pyx_DECREF_TypeName(obj_type_name);
29745#if CYTHON_COMPILING_IN_LIMITED_API && __PYX_LIMITED_VERSION_HEX < 0x030d0000
29746obj_type_name_failed:
29748 __Pyx_DECREF_TypeName(type_name);
29753static CYTHON_INLINE
int __Pyx_ArgTypeTest(PyObject *obj, PyTypeObject *type,
int none_allowed,
const char *name,
int exact) {
29754 if (likely(Py_IS_TYPE(obj, type) | (none_allowed && (obj == Py_None))))
29756 if (!exact && likely(type) && likely(__Pyx_TypeCheck(obj, type)))
29758 __Pyx_ArgTypeError(obj, type, name, exact);
29763#if !CYTHON_VECTORCALL
29764static PyObject *__Pyx_PyObject_FastCallMethod(PyObject *name, PyObject *
const *args,
size_t nargsf) {
29766 switch (__Pyx_PyVectorcall_NARGS(nargsf)) {
29768 return PyObject_CallMethodObjArgs(args[0], name, NULL);
29770 return PyObject_CallMethodObjArgs(args[0], name, args[1], NULL);
29772 return PyObject_CallMethodObjArgs(args[0], name, args[1], args[2], NULL);
29774 return PyObject_CallMethodObjArgs(args[0], name, args[1], args[2], args[3], NULL);
29776 return PyObject_CallMethodObjArgs(args[0], name, args[1], args[2], args[3], args[4], NULL);
29778 PyObject *attr = PyObject_GetAttr(args[0], name);
29779 if (unlikely(!attr))
29781 result = __Pyx_PyObject_FastCall(attr, args+1, nargsf - 1);
29788#if CYTHON_COMPILING_IN_LIMITED_API && __PYX_LIMITED_VERSION_HEX < 0x030d0000
29789static __Pyx_TypeName
29790__Pyx_PyType_GetFullyQualifiedName(PyTypeObject* tp)
29792 PyObject *module = NULL, *name = NULL, *result = NULL;
29793 #if __PYX_LIMITED_VERSION_HEX < 0x030b0000
29794 name = __Pyx_PyObject_GetAttrStr((PyObject *)tp,
29795 __pyx_mstate_global->__pyx_n_u_qualname);
29797 name = PyType_GetQualName(tp);
29799 if (unlikely(name == NULL) || unlikely(!PyUnicode_Check(name)))
goto bad;
29800 module = __Pyx_PyObject_GetAttrStr((PyObject *)tp,
29801 __pyx_mstate_global->__pyx_n_u_module);
29802 if (unlikely(module == NULL) || unlikely(!PyUnicode_Check(module)))
goto bad;
29803 if (PyUnicode_CompareWithASCIIString(module,
"builtins") == 0) {
29808 result = PyUnicode_FromFormat(
"%U.%U", module, name);
29809 if (unlikely(result == NULL))
goto bad;
29812 Py_XDECREF(module);
29820 result = __Pyx_NewRef(__pyx_mstate_global->__pyx_kp_u_);
29827static void __Pyx_RaiseErrorWithType1(PyObject* exc_type,
const char* message,
const char *arg, PyTypeObject *type_obj) {
29828 __Pyx_TypeName type_name = __Pyx_PyType_GetFullyQualifiedName(type_obj);
29829 #if CYTHON_COMPILING_IN_LIMITED_API && __PYX_LIMITED_VERSION_HEX < 0x030d0000
29830 if (unlikely(!type_name))
return;
29832 PyErr_Format(exc_type, message, arg, type_name);
29833 __Pyx_DECREF_TypeName(type_name);
29837static int __Pyx_RaiseUnexpectedTypeError(
const char *expected, PyObject *obj) {
29838 __Pyx_RaiseTypeErrorWithObjectType1(
29839 "Expected %.42s, got " __Pyx_FMT_TYPENAME,
29845static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause) {
29846 PyObject* owned_instance = NULL;
29847 if (tb == Py_None) {
29849 }
else if (tb && !PyTraceBack_Check(tb)) {
29850 PyErr_SetString(PyExc_TypeError,
29851 "raise: arg 3 must be a traceback or None");
29854 if (value == Py_None)
29856 if (PyExceptionInstance_Check(type)) {
29858 PyErr_SetString(PyExc_TypeError,
29859 "instance exception may not have a separate value");
29863 type = (PyObject*) Py_TYPE(value);
29864 }
else if (PyExceptionClass_Check(type)) {
29865 PyObject *instance_class = NULL;
29866 if (value && PyExceptionInstance_Check(value)) {
29867 instance_class = (PyObject*) Py_TYPE(value);
29868 if (instance_class != type) {
29869 int is_subclass = PyObject_IsSubclass(instance_class, type);
29870 if (!is_subclass) {
29871 instance_class = NULL;
29872 }
else if (unlikely(is_subclass == -1)) {
29875 type = instance_class;
29879 if (!instance_class) {
29882 args = PyTuple_New(0);
29883 else if (PyTuple_Check(value)) {
29887 args = PyTuple_Pack(1, value);
29890 owned_instance = PyObject_Call(type, args, NULL);
29892 if (!owned_instance)
29894 value = owned_instance;
29895 if (!PyExceptionInstance_Check(value)) {
29896 PyErr_Format(PyExc_TypeError,
29897 "calling %R should have returned an instance of "
29898 "BaseException, not %R",
29899 type, Py_TYPE(value));
29904 PyErr_SetString(PyExc_TypeError,
29905 "raise: exception class must be a subclass of BaseException");
29909 PyObject *fixed_cause;
29910 if (cause == Py_None) {
29911 fixed_cause = NULL;
29912 }
else if (PyExceptionClass_Check(cause)) {
29913 fixed_cause = PyObject_CallObject(cause, NULL);
29914 if (fixed_cause == NULL)
29916 }
else if (PyExceptionInstance_Check(cause)) {
29917 fixed_cause = cause;
29918 Py_INCREF(fixed_cause);
29920 PyErr_SetString(PyExc_TypeError,
29921 "exception causes must derive from "
29925 PyException_SetCause(value, fixed_cause);
29927 PyErr_SetObject(type, value);
29929#if PY_VERSION_HEX >= 0x030C00A6
29930 PyException_SetTraceback(value, tb);
29931#elif CYTHON_FAST_THREAD_STATE
29932 PyThreadState *tstate = __Pyx_PyThreadState_Current;
29933 PyObject* tmp_tb = tstate->curexc_traceback;
29934 if (tb != tmp_tb) {
29936 tstate->curexc_traceback = tb;
29937 Py_XDECREF(tmp_tb);
29940 PyObject *tmp_type, *tmp_value, *tmp_tb;
29941 PyErr_Fetch(&tmp_type, &tmp_value, &tmp_tb);
29943 PyErr_Restore(tmp_type, tmp_value, tb);
29944 Py_XDECREF(tmp_tb);
29948 Py_XDECREF(owned_instance);
29953static const char DIGIT_PAIRS_10[2*10*10+1] = {
29954 "00010203040506070809"
29955 "10111213141516171819"
29956 "20212223242526272829"
29957 "30313233343536373839"
29958 "40414243444546474849"
29959 "50515253545556575859"
29960 "60616263646566676869"
29961 "70717273747576777879"
29962 "80818283848586878889"
29963 "90919293949596979899"
29965static const char DIGIT_PAIRS_8[2*8*8+1] = {
29975static const char DIGITS_HEX[2*16+1] = {
29981static PyObject* __Pyx_PyUnicode_BuildFromAscii(Py_ssize_t ulength,
const char* chars,
int clength,
29982 int prepend_sign,
char padding_char) {
29984 Py_ssize_t uoffset = ulength - clength;
29985#if CYTHON_USE_UNICODE_INTERNALS
29988 uval = PyUnicode_New(ulength, 127);
29989 if (unlikely(!uval))
return NULL;
29990 udata = PyUnicode_DATA(uval);
29993 if (prepend_sign) {
29994 __Pyx_PyUnicode_WRITE(PyUnicode_1BYTE_KIND, udata, 0,
'-');
29997 for (; i < uoffset; i++) {
29998 __Pyx_PyUnicode_WRITE(PyUnicode_1BYTE_KIND, udata, i, padding_char);
30001 for (i=0; i < clength; i++) {
30002 __Pyx_PyUnicode_WRITE(PyUnicode_1BYTE_KIND, udata, uoffset+i, chars[i]);
30006 PyObject *
sign = NULL, *padding = NULL;
30009 prepend_sign = !!prepend_sign;
30010 if (uoffset > prepend_sign) {
30011 padding = PyUnicode_FromOrdinal(padding_char);
30012 if (likely(padding) && uoffset > prepend_sign + 1) {
30013 PyObject *tmp = PySequence_Repeat(padding, uoffset - prepend_sign);
30014 Py_DECREF(padding);
30017 if (unlikely(!padding))
goto done_or_error;
30019 if (prepend_sign) {
30020 sign = PyUnicode_FromOrdinal(
'-');
30021 if (unlikely(!
sign))
goto done_or_error;
30024 uval = PyUnicode_DecodeASCII(chars, clength, NULL);
30025 if (likely(uval) && padding) {
30026 PyObject *tmp = PyUnicode_Concat(padding, uval);
30030 if (likely(uval) &&
sign) {
30031 PyObject *tmp = PyUnicode_Concat(
sign, uval);
30036 Py_XDECREF(padding);
30044static CYTHON_INLINE
int __Pyx_CheckUnicodeValue(
int value) {
30045 return value <= 1114111;
30047static PyObject* __Pyx_PyUnicode_FromOrdinal_Padded(
int value, Py_ssize_t ulength,
char padding_char) {
30048 Py_ssize_t padding_length = ulength - 1;
30049 if (likely((padding_length <= 250) && (value < 0xD800 || value > 0xDFFF))) {
30051 if (value <= 255) {
30052 memset(chars, padding_char, (
size_t) padding_length);
30053 chars[ulength-1] = (char) value;
30054 return PyUnicode_DecodeLatin1(chars, ulength, NULL);
30056 char *cpos = chars +
sizeof(chars);
30057 if (value < 0x800) {
30058 *--cpos = (char) (0x80 | (value & 0x3f));
30060 *--cpos = (char) (0xc0 | (value & 0x1f));
30061 }
else if (value < 0x10000) {
30062 *--cpos = (char) (0x80 | (value & 0x3f));
30064 *--cpos = (char) (0x80 | (value & 0x3f));
30066 *--cpos = (char) (0xe0 | (value & 0x0f));
30068 *--cpos = (char) (0x80 | (value & 0x3f));
30070 *--cpos = (char) (0x80 | (value & 0x3f));
30072 *--cpos = (char) (0x80 | (value & 0x3f));
30074 *--cpos = (char) (0xf0 | (value & 0x07));
30076 cpos -= padding_length;
30077 memset(cpos, padding_char, (
size_t) padding_length);
30078 return PyUnicode_DecodeUTF8(cpos, chars +
sizeof(chars) - cpos, NULL);
30080 if (value <= 127 && CYTHON_USE_UNICODE_INTERNALS) {
30081 const char chars[1] = {(char) value};
30082 return __Pyx_PyUnicode_BuildFromAscii(ulength, chars, 1, 0, padding_char);
30085 PyObject *uchar, *padding_uchar, *padding, *result;
30086 padding_uchar = PyUnicode_FromOrdinal(padding_char);
30087 if (unlikely(!padding_uchar))
return NULL;
30088 padding = PySequence_Repeat(padding_uchar, padding_length);
30089 Py_DECREF(padding_uchar);
30090 if (unlikely(!padding))
return NULL;
30091 uchar = PyUnicode_FromOrdinal(value);
30092 if (unlikely(!uchar)) {
30093 Py_DECREF(padding);
30096 result = PyUnicode_Concat(padding, uchar);
30097 Py_DECREF(padding);
30104static CYTHON_INLINE PyObject* __Pyx_uchar___Pyx_PyUnicode_From_int(
int value, Py_ssize_t width,
char padding_char) {
30105#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
30106#pragma GCC diagnostic push
30107#pragma GCC diagnostic ignored "-Wconversion"
30109 const int neg_one = (int) -1, const_zero = (
int) 0;
30110#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
30111#pragma GCC diagnostic pop
30113 const int is_unsigned = neg_one > const_zero;
30114 if (unlikely(!(is_unsigned || value == 0 || value > 0) ||
30115 !(
sizeof(value) <= 2 || value & ~ (
int) 0x01fffff || __Pyx_CheckUnicodeValue((
int) value)))) {
30116 PyErr_SetString(PyExc_OverflowError,
"%c arg not in range(0x110000)");
30120 return PyUnicode_FromOrdinal((
int) value);
30122 return __Pyx_PyUnicode_FromOrdinal_Padded((
int) value, width, padding_char);
30124static CYTHON_INLINE PyObject* __Pyx____Pyx_PyUnicode_From_int(
int value, Py_ssize_t width,
char padding_char,
char format_char) {
30125 char digits[
sizeof(int)*3+2];
30126 char *dpos, *end = digits +
sizeof(int)*3+2;
30127 const char *hex_digits = DIGITS_HEX;
30128 Py_ssize_t length, ulength;
30129 int prepend_sign, last_one_off;
30131#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
30132#pragma GCC diagnostic push
30133#pragma GCC diagnostic ignored "-Wconversion"
30135 const int neg_one = (int) -1, const_zero = (
int) 0;
30136#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
30137#pragma GCC diagnostic pop
30139 const int is_unsigned = neg_one > const_zero;
30140 if (format_char ==
'X') {
30149 switch (format_char) {
30151 digit_pos = abs((
int)(remaining % (8*8)));
30152 remaining = (int) (remaining / (8*8));
30154 memcpy(dpos, DIGIT_PAIRS_8 + digit_pos * 2, 2);
30155 last_one_off = (digit_pos < 8);
30158 digit_pos = abs((
int)(remaining % (10*10)));
30159 remaining = (int) (remaining / (10*10));
30161 memcpy(dpos, DIGIT_PAIRS_10 + digit_pos * 2, 2);
30162 last_one_off = (digit_pos < 10);
30165 *(--dpos) = hex_digits[abs((
int)(remaining % 16))];
30166 remaining = (int) (remaining / 16);
30172 }
while (unlikely(remaining != 0));
30173 assert(!last_one_off || *dpos ==
'0');
30174 dpos += last_one_off;
30175 length = end - dpos;
30178 if (!is_unsigned && value <= neg_one) {
30179 if (padding_char ==
' ' || width <= length + 1) {
30187 if (width > ulength) {
30190 if (ulength == 1) {
30191 return PyUnicode_FromOrdinal(*dpos);
30193 return __Pyx_PyUnicode_BuildFromAscii(ulength, dpos, (
int) length, prepend_sign, padding_char);
30197static CYTHON_INLINE PyObject* __Pyx_uchar___Pyx_PyUnicode_From_Py_ssize_t(Py_ssize_t value, Py_ssize_t width,
char padding_char) {
30198#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
30199#pragma GCC diagnostic push
30200#pragma GCC diagnostic ignored "-Wconversion"
30202 const Py_ssize_t neg_one = (Py_ssize_t) -1, const_zero = (Py_ssize_t) 0;
30203#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
30204#pragma GCC diagnostic pop
30206 const int is_unsigned = neg_one > const_zero;
30207 if (unlikely(!(is_unsigned || value == 0 || value > 0) ||
30208 !(
sizeof(value) <= 2 || value & ~ (Py_ssize_t) 0x01fffff || __Pyx_CheckUnicodeValue((
int) value)))) {
30209 PyErr_SetString(PyExc_OverflowError,
"%c arg not in range(0x110000)");
30213 return PyUnicode_FromOrdinal((
int) value);
30215 return __Pyx_PyUnicode_FromOrdinal_Padded((
int) value, width, padding_char);
30217static CYTHON_INLINE PyObject* __Pyx____Pyx_PyUnicode_From_Py_ssize_t(Py_ssize_t value, Py_ssize_t width,
char padding_char,
char format_char) {
30218 char digits[
sizeof(Py_ssize_t)*3+2];
30219 char *dpos, *end = digits +
sizeof(Py_ssize_t)*3+2;
30220 const char *hex_digits = DIGITS_HEX;
30221 Py_ssize_t length, ulength;
30222 int prepend_sign, last_one_off;
30223 Py_ssize_t remaining;
30224#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
30225#pragma GCC diagnostic push
30226#pragma GCC diagnostic ignored "-Wconversion"
30228 const Py_ssize_t neg_one = (Py_ssize_t) -1, const_zero = (Py_ssize_t) 0;
30229#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
30230#pragma GCC diagnostic pop
30232 const int is_unsigned = neg_one > const_zero;
30233 if (format_char ==
'X') {
30242 switch (format_char) {
30244 digit_pos = abs((
int)(remaining % (8*8)));
30245 remaining = (Py_ssize_t) (remaining / (8*8));
30247 memcpy(dpos, DIGIT_PAIRS_8 + digit_pos * 2, 2);
30248 last_one_off = (digit_pos < 8);
30251 digit_pos = abs((
int)(remaining % (10*10)));
30252 remaining = (Py_ssize_t) (remaining / (10*10));
30254 memcpy(dpos, DIGIT_PAIRS_10 + digit_pos * 2, 2);
30255 last_one_off = (digit_pos < 10);
30258 *(--dpos) = hex_digits[abs((
int)(remaining % 16))];
30259 remaining = (Py_ssize_t) (remaining / 16);
30265 }
while (unlikely(remaining != 0));
30266 assert(!last_one_off || *dpos ==
'0');
30267 dpos += last_one_off;
30268 length = end - dpos;
30271 if (!is_unsigned && value <= neg_one) {
30272 if (padding_char ==
' ' || width <= length + 1) {
30280 if (width > ulength) {
30283 if (ulength == 1) {
30284 return PyUnicode_FromOrdinal(*dpos);
30286 return __Pyx_PyUnicode_BuildFromAscii(ulength, dpos, (
int) length, prepend_sign, padding_char);
30290static PyObject* __Pyx_PyUnicode_Join(PyObject** values, Py_ssize_t value_count, Py_ssize_t result_ulength,
int kind) {
30291#if __Pyx_PyUnicode_Join_CAN_USE_KIND_AND_LENGTH && CYTHON_USE_UNICODE_INTERNALS
30292 PyObject *result_uval;
30293 int result_ukind, kind_shift;
30294 Py_ssize_t i, char_pos;
30295 void *result_udata;
30296 static const Py_UCS4 max_char[5] = {0x7fU, 0xffU, 0xffffU, 0xffffU, 0x10ffffU};
30297 assert (kind >= 0);
30298 if (kind > PyUnicode_4BYTE_KIND) kind = PyUnicode_4BYTE_KIND;
30299 result_uval = PyUnicode_New(result_ulength, max_char[kind]);
30300 if (unlikely(!result_uval))
return NULL;
30301 kind_shift = kind >> 1;
30302 result_ukind = 1 << kind_shift;
30303 result_udata = PyUnicode_DATA(result_uval);
30304 assert(kind_shift == 2 || kind_shift == 1 || kind_shift == 0);
30305 if (unlikely((PY_SSIZE_T_MAX >> kind_shift) - result_ulength < 0))
30308 for (i=0; i < value_count; i++) {
30310 Py_ssize_t ulength;
30312 PyObject *uval = values[i];
30313 if (__Pyx_PyUnicode_READY(uval) == (-1))
30315 ulength = __Pyx_PyUnicode_GET_LENGTH(uval);
30316 #if !CYTHON_ASSUME_SAFE_SIZE
30317 if (unlikely(ulength < 0))
goto bad;
30319 if (unlikely(!ulength))
30321 if (unlikely((PY_SSIZE_T_MAX >> kind_shift) - ulength < char_pos))
30323 ukind = __Pyx_PyUnicode_KIND(uval);
30324 udata = __Pyx_PyUnicode_DATA(uval);
30325 if (ukind == result_ukind) {
30326 memcpy((
char *)result_udata + (char_pos << kind_shift), udata, (
size_t) (ulength << kind_shift));
30328 #if PY_VERSION_HEX >= 0x030d0000
30329 if (unlikely(PyUnicode_CopyCharacters(result_uval, char_pos, uval, 0, ulength) < 0))
goto bad;
30330 #elif CYTHON_COMPILING_IN_CPYTHON || defined(_PyUnicode_FastCopyCharacters)
30331 _PyUnicode_FastCopyCharacters(result_uval, char_pos, uval, 0, ulength);
30334 for (j=0; j < ulength; j++) {
30335 Py_UCS4 uchar = __Pyx_PyUnicode_READ(ukind, udata, j);
30336 __Pyx_PyUnicode_WRITE(result_ukind, result_udata, char_pos+j, uchar);
30340 char_pos += ulength;
30342 return result_uval;
30344 PyErr_SetString(PyExc_OverflowError,
"join() result is too long for a Python string");
30346 Py_DECREF(result_uval);
30350 PyObject *result = NULL;
30351 PyObject *value_tuple = PyTuple_New(value_count);
30352 if (unlikely(!value_tuple))
return NULL;
30353 CYTHON_UNUSED_VAR(kind);
30354 CYTHON_UNUSED_VAR(result_ulength);
30355 for (i=0; i<value_count; i++) {
30356 Py_INCREF(values[i]);
30357 if (__Pyx_PyTuple_SET_ITEM(value_tuple, i, values[i]) != (0))
goto bad;
30359 result = PyUnicode_Join(__pyx_mstate_global->__pyx_empty_unicode, value_tuple);
30361 Py_DECREF(value_tuple);
30367#if !(CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API || CYTHON_COMPILING_IN_GRAAL)
30368static CYTHON_INLINE
int __Pyx__PyUnicode_EqualsUCS4(PyObject* s1, Py_UCS4 ch2,
int equals) {
30372 if (unlikely(__Pyx_PyUnicode_READY(s1) < 0))
goto bad;
30373 length = __Pyx_PyUnicode_GET_LENGTH(s1);
30374 #if !CYTHON_ASSUME_SAFE_SIZE
30375 if (unlikely(length < 0))
goto bad;
30377 if (length != 1)
goto return_ne;
30378 kind = PyUnicode_KIND(s1);
30380 if (likely(kind == PyUnicode_1BYTE_KIND)) {
30381 ch1 = PyUnicode_1BYTE_DATA(s1)[0];
30382 }
else if (kind == PyUnicode_2BYTE_KIND) {
30383 ch1 = PyUnicode_2BYTE_DATA(s1)[0];
30385 ch1 = PyUnicode_4BYTE_DATA(s1)[0];
30387 }
else if (ch2 < 65536) {
30388 if (kind == PyUnicode_2BYTE_KIND) {
30389 ch1 = PyUnicode_2BYTE_DATA(s1)[0];
30390 }
else if (kind == PyUnicode_4BYTE_KIND) {
30391 ch1 = PyUnicode_4BYTE_DATA(s1)[0];
30396 if (kind == PyUnicode_4BYTE_KIND){
30397 ch1 = PyUnicode_4BYTE_DATA(s1)[0];
30408 return (equals == Py_EQ);
30410 return (equals == Py_NE);
30417#ifndef __Pyx_DEFINED_PyObject_CompareStrStrBoolEq
30418#define __Pyx_DEFINED_PyObject_CompareStrStrBoolEq
30419static CYTHON_INLINE
int __Pyx_PyObject_CompareStrStrBoolEq(PyObject* s1, PyObject* s2) {
30420 #if __PYX_LIMITED_VERSION_HEX >= 0x030e0000
30421 int result = PyUnicode_Equal(s1, s2);
30422 #if !CYTHON_COMPILING_IN_CPYTHON
30423 if (unlikely(result == -1))
return -1;
30425 if (result == 0)
goto __pyx_return_false;
else goto __pyx_return_true;
30427 int result = PyUnicode_Compare(s1, s2);
30428 if (unlikely((result == -1) && PyErr_Occurred()))
return -1;
30429 if (result == 0)
goto __pyx_return_true;
else goto __pyx_return_false;
30437static CYTHON_INLINE
int __Pyx_PyObject_CompareBoolEq_object_str(PyObject *op1, PyObject *op2,
int pyop) {
30438 CYTHON_UNUSED_VAR(pyop);
30439 if (unlikely(op2 == Py_None)) {
30440 if (op1 == Py_None)
goto __pyx_return_true;
else goto __pyx_richcmp;
30442 if (PyFloat_CheckExact(op1)) {
30443 goto __pyx_richcmp;
30445 if (PyLong_CheckExact(op1)) {
30446 if (op1 == op2)
goto __pyx_return_true;
30447 goto __pyx_richcmp;
30450 if (likely(PyUnicode_CheckExact(op1))) {
30451 if (op1 == op2)
goto __pyx_return_true;
30452 if (likely(op2 != Py_None)) {
30453 return __Pyx_PyObject_CompareStrStrBoolEq(op1, op2);
30455 goto __pyx_richcmp;
30458 if ((0))
goto __pyx_richcmp;
30459 if ((0))
goto __pyx_return_true;
30460 if ((0))
goto __pyx_return_false;
30462 return __Pyx_PyObject_RichCompareBool(op1, op2, Py_EQ);
30470#if !(CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_GRAAL)
30471#ifndef __Pyx_DEFINED_PyObject_ComparePyBytesPyBytesEq
30472#define __Pyx_DEFINED_PyObject_ComparePyBytesPyBytesEq
30473static CYTHON_INLINE PyObject* __Pyx_PyObject_ComparePyBytesPyBytesEq(PyObject* s1, PyObject* s2) {
30474 #if CYTHON_ASSUME_SAFE_SIZE && CYTHON_ASSUME_SAFE_MACROS
30475 const char *ps1, *ps2;
30476 Py_ssize_t length = PyBytes_GET_SIZE(s1);
30477 if (length != PyBytes_GET_SIZE(s2))
goto __pyx_return_false;
30478 ps1 = PyBytes_AS_STRING(s1);
30479 ps2 = PyBytes_AS_STRING(s2);
30482 Py_ssize_t length, length2;
30483 if (unlikely(PyBytes_AsStringAndSize(s1, &ps1, &length) == -1))
return NULL;
30484 if (unlikely(PyBytes_AsStringAndSize(s2, &ps2, &length2) == -1))
return NULL;
30485 if (length != length2)
goto __pyx_return_false;
30487 if (ps1[0] != ps2[0])
goto __pyx_return_false;
30488 if (length == 1)
goto __pyx_return_true;
30491#if CYTHON_USE_UNICODE_INTERNALS && (PY_VERSION_HEX < 0x030B0000)
30492 Py_hash_t hash1 = ((PyBytesObject*)s1)->ob_shash;
30493 Py_hash_t hash2 = ((PyBytesObject*)s2)->ob_shash;
30494 if (hash1 != hash2 && hash1 != -1 && hash2 != -1)
goto __pyx_return_false;
30496 cmp = memcmp(ps1, ps2, (
size_t)length);
30497 if (cmp == 0)
goto __pyx_return_true;
else goto __pyx_return_false;
30506#if !(CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_GRAAL)
30507#ifndef __Pyx_DEFINED_PyObject_ComparePyByteArrayPyBytesEq
30508#define __Pyx_DEFINED_PyObject_ComparePyByteArrayPyBytesEq
30509static CYTHON_INLINE PyObject* __Pyx_PyObject_ComparePyByteArrayPyBytesEq(PyObject* s1, PyObject* s2) {
30510 #if CYTHON_ASSUME_SAFE_SIZE && CYTHON_ASSUME_SAFE_MACROS
30511 const char *ps1, *ps2;
30512 Py_ssize_t length = PyByteArray_GET_SIZE(s1);
30513 if (length != PyBytes_GET_SIZE(s2))
goto __pyx_return_false;
30514 ps1 = PyByteArray_AS_STRING(s1);
30515 ps2 = PyBytes_AS_STRING(s2);
30518 Py_ssize_t length, length2;
30519 ps1 = __Pyx_PyByteArray_AsString(s1);
if (unlikely(!ps1))
return NULL;
30520 length = __Pyx_PyByteArray_GET_SIZE(s1);
if (unlikely(length == -1))
return NULL;
30521 if (unlikely(PyBytes_AsStringAndSize(s2, &ps2, &length2) == -1))
return NULL;
30522 if (length != length2)
goto __pyx_return_false;
30524 if (length == 0)
goto __pyx_return_true;
30525 if (ps1[0] != ps2[0])
goto __pyx_return_false;
30526 if (length == 1)
goto __pyx_return_true;
30529 cmp = memcmp(ps1, ps2, (
size_t)length);
30530 if (cmp == 0)
goto __pyx_return_true;
else goto __pyx_return_false;
30539static CYTHON_INLINE PyObject* __Pyx_PyObject_CompareEq_object_bytes(PyObject *op1, PyObject *op2,
int pyop) {
30540 CYTHON_UNUSED_VAR(pyop);
30541 if (unlikely(op2 == Py_None)) {
30542 if (op1 == Py_None)
goto __pyx_return_true;
else goto __pyx_richcmp;
30544 if (PyFloat_CheckExact(op1)) {
30545 goto __pyx_richcmp;
30547 if (PyLong_CheckExact(op1)) {
30548 if (op1 == op2)
goto __pyx_return_true;
30549 goto __pyx_richcmp;
30551 #if !(CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_GRAAL)
30552 if (likely(PyBytes_CheckExact(op1))) {
30553 if (op1 == op2)
goto __pyx_return_true;
30554 if (likely(op2 != Py_None)) {
30555 return __Pyx_PyObject_ComparePyBytesPyBytesEq(op1, op2);
30557 goto __pyx_richcmp;
30560 if ((0))
goto __pyx_richcmp;
30561 if ((0))
goto __pyx_return_true;
30562 if ((0))
goto __pyx_return_false;
30564 return PyObject_RichCompare(op1, op2, Py_EQ);
30572static CYTHON_INLINE PyObject *__Pyx_GetAttr(PyObject *o, PyObject *
n) {
30573#if CYTHON_USE_TYPE_SLOTS
30574 if (likely(PyUnicode_Check(
n)))
30575 return __Pyx_PyObject_GetAttrStr(o,
n);
30577 return PyObject_GetAttr(o,
n);
30581#if CYTHON_COMPILING_IN_LIMITED_API
30582static CYTHON_INLINE PyObject* __Pyx__PyFrozenDict_New(PyObject* frozendict_type, PyObject* it) {
30583 return PyObject_CallFunctionObjArgs(frozendict_type, it, NULL);
30588#if CYTHON_USE_TYPE_SLOTS && !CYTHON_COMPILING_IN_PYPY
30589static int __Pyx_GetItemInt_wraparound(PyObject *o, PySequenceMethods *sm, Py_ssize_t *i) {
30591 if (likely(sm->sq_length)) {
30592 Py_ssize_t l = sm->sq_length(o);
30593 if (likely(l >= 0)) {
30596 if (!PyErr_ExceptionMatches(PyExc_OverflowError))
30606static PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j) {
30608 if (unlikely(!j))
return NULL;
30609 r = PyObject_GetItem(o, j);
30613static PyObject *__Pyx_GetItemInt_Generic_size(PyObject *o, Py_ssize_t i) {
30614 return __Pyx_GetItemInt_Generic(o, PyLong_FromSsize_t(i));
30616static CYTHON_INLINE PyObject *__Pyx_GetItemInt_List_Fast(PyObject *o, Py_ssize_t i,
30617 int wraparound,
int boundscheck,
int unsafe_shared) {
30618 CYTHON_MAYBE_UNUSED_VAR(unsafe_shared);
30619#if CYTHON_AVOID_BORROWED_REFS
30620 CYTHON_UNUSED_VAR(boundscheck);
30621 Py_ssize_t wrapped_i = i;
30622 if (wraparound & unlikely(i < 0)) {
30623 Py_ssize_t size = __Pyx_PyList_GET_SIZE(o);
30624 #if !CYTHON_ASSUME_SAFE_SIZE
30625 if (unlikely(size < 0))
return NULL;
30629 return __Pyx_PyList_GetItemRef(o, wrapped_i);
30630#elif CYTHON_ASSUME_SAFE_SIZE && CYTHON_ASSUME_SAFE_MACROS
30631 Py_ssize_t wrapped_i = i;
30632 Py_ssize_t size = (wraparound | boundscheck) ? PyList_GET_SIZE(o) : -1;
30633 if (wraparound & unlikely(i < 0)) {
30636 if ((!boundscheck) || likely(__Pyx_is_valid_index(wrapped_i, size))) {
30637 return __Pyx_PyList_GET_ITEM_REF(o, wrapped_i, unsafe_shared);
30639 return __Pyx_GetItemInt_Generic_size(o, i);
30643 return PySequence_GetItem(o, i);
30646static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize_t i,
30647 int wraparound,
int boundscheck,
int unsafe_shared) {
30648 CYTHON_MAYBE_UNUSED_VAR(unsafe_shared);
30649#if CYTHON_AVOID_BORROWED_REFS
30650 CYTHON_UNUSED_VAR(boundscheck);
30651 Py_ssize_t wrapped_i = i;
30652 if (wraparound & unlikely(i < 0)) {
30653 Py_ssize_t size = __Pyx_PyTuple_GET_SIZE(o);
30654 #if !CYTHON_ASSUME_SAFE_SIZE
30655 if (unlikely(size < 0))
return NULL;
30659 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_COMPILING_IN_LIMITED_API
30660 return PySequence_ITEM(o, wrapped_i);
30662 if (unlikely(wrapped_i < 0)) {
30663 PyErr_SetString(PyExc_IndexError,
"tuple index out of range");
30666 return PySequence_GetItem(o, wrapped_i);
30668#elif CYTHON_ASSUME_SAFE_SIZE && CYTHON_ASSUME_SAFE_MACROS
30669 Py_ssize_t wrapped_i = i;
30670 Py_ssize_t size = (wraparound | boundscheck) ? PyTuple_GET_SIZE(o) : -1;
30671 if (wraparound & unlikely(i < 0)) {
30674 if ((!boundscheck) || likely(__Pyx_is_valid_index(wrapped_i, size))) {
30675 return __Pyx_NewRef(__Pyx_PyTuple_GET_ITEM(o, wrapped_i));
30677 return __Pyx_GetItemInt_Generic_size(o, i);
30681 return PySequence_GetItem(o, i);
30684#if CYTHON_USE_TYPE_SLOTS && !CYTHON_COMPILING_IN_PYPY
30685static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast_mapping(PyObject *o, binaryfunc getitem, Py_ssize_t i) {
30686 PyObject *
r, *key = PyLong_FromSsize_t(i);
30687 if (unlikely(!key))
return NULL;
30688 r = getitem(o, key);
30693static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i,
30694 int wraparound,
int boundscheck,
int unsafe_shared) {
30695 CYTHON_MAYBE_UNUSED_VAR(unsafe_shared);
30696#if CYTHON_ASSUME_SAFE_SIZE
30697 if (PyList_CheckExact(o)) {
30698 return __Pyx_GetItemInt_List_Fast(o, i, wraparound, boundscheck, unsafe_shared);
30700 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
30701 if (PyTuple_CheckExact(o)) {
30702 return __Pyx_GetItemInt_Tuple_Fast(o, i, wraparound, boundscheck, unsafe_shared);
30706 if ((!wraparound || i >= 0) & PyList_CheckExact(o)) {
30707 return boundscheck ? __Pyx_PyList_GetItemRef(o, i) : __Pyx_PyList_GET_ITEM_REF(o, i, unsafe_shared);
30710#if CYTHON_USE_TYPE_SLOTS && !CYTHON_COMPILING_IN_PYPY
30711 if (PyDict_CheckExact(o)) {
30712 return __Pyx_GetItemInt_Fast_mapping(o, PyDict_Type.tp_as_mapping->mp_subscript, i);
30713 #if defined(PyFrozenDict_CheckExact)
30714 }
else if (PyFrozenDict_CheckExact(o)) {
30715 return __Pyx_GetItemInt_Fast_mapping(o, PyFrozenDict_Type.tp_as_mapping->mp_subscript, i);
30719 PyTypeObject *obj_type = Py_TYPE(o);
30720 int seq_or_mapping = __Pyx_PyType_GetFlags(obj_type) & (Py_TPFLAGS_SEQUENCE|Py_TPFLAGS_MAPPING);
30721 if (seq_or_mapping != Py_TPFLAGS_SEQUENCE) {
30722 PyMappingMethods *mm = obj_type->tp_as_mapping;
30723 if (mm && mm->mp_subscript)
30724 return __Pyx_GetItemInt_Fast_mapping(o, mm->mp_subscript, i);
30726 PySequenceMethods *sm = obj_type->tp_as_sequence;
30727 if (likely(sm && sm->sq_item)) {
30728 if (wraparound && (i < 0) && unlikely(__Pyx_GetItemInt_wraparound(o, sm, &i) == -1))
30730 return sm->sq_item(o, i);
30732 if (seq_or_mapping == Py_TPFLAGS_SEQUENCE) {
30733 PyMappingMethods *mm = obj_type->tp_as_mapping;
30734 if (likely(mm && mm->mp_subscript))
30735 return __Pyx_GetItemInt_Fast_mapping(o, mm->mp_subscript, i);
30739 if (!PyMapping_Check(o)) {
30740 return PySequence_GetItem(o, i);
30745 return __Pyx_GetItemInt_Generic_size(o, i);
30749static void __Pyx_RaiseErrorWithType(PyObject* exc_type,
const char* message, PyTypeObject *type_obj) {
30750 __Pyx_TypeName type_name = __Pyx_PyType_GetFullyQualifiedName(type_obj);
30751 #if CYTHON_COMPILING_IN_LIMITED_API && __PYX_LIMITED_VERSION_HEX < 0x030d0000
30752 if (unlikely(!type_name))
return;
30754 PyErr_Format(exc_type, message, type_name);
30755 __Pyx_DECREF_TypeName(type_name);
30759#if CYTHON_USE_TYPE_SLOTS
30760static PyObject *__Pyx_PyObject_GetIndex(PyObject *obj, PyObject *index) {
30761 PyObject *runerr = NULL;
30762 Py_ssize_t key_value;
30763 key_value = __Pyx_PyIndex_AsSsize_t(index);
30764 if (likely(key_value != -1 || !(runerr = PyErr_Occurred()))) {
30765 return __Pyx_GetItemInt_Fast(obj, key_value, 1, 1, 1);
30767 if (PyErr_GivenExceptionMatches(runerr, PyExc_OverflowError)) {
30769 __Pyx_RaiseErrorWithObjectType(
30771 "cannot fit '" __Pyx_FMT_TYPENAME
"' into an index-sized integer",
30776static PyObject *__Pyx_PyObject_GetItem_Slow(PyObject *obj, PyObject *key) {
30777 if (likely(PyType_Check(obj))) {
30778 if ((PyTypeObject*)obj == &PyType_Type) {
30779 return Py_GenericAlias(obj, key);
30781 PyObject *meth = __Pyx_PyObject_GetAttrStrNoError(obj, __pyx_mstate_global->__pyx_n_u_class_getitem);
30783 if (PyErr_Occurred()) {
30787 PyObject *result = __Pyx_PyObject_CallOneArg(meth, key);
30792 __Pyx_RaiseTypeErrorWithObjectType(
30793 "'" __Pyx_FMT_TYPENAME
"' object is not subscriptable", obj);
30796static PyObject *__Pyx_PyObject_GetItem(PyObject *obj, PyObject *key) {
30797 PyTypeObject *tp = Py_TYPE(obj);
30798 PyMappingMethods *mm = tp->tp_as_mapping;
30799 PySequenceMethods *sm = tp->tp_as_sequence;
30800 if (likely(mm && mm->mp_subscript)) {
30801 return mm->mp_subscript(obj, key);
30803 if (likely(sm && sm->sq_item)) {
30804 return __Pyx_PyObject_GetIndex(obj, key);
30806 return __Pyx_PyObject_GetItem_Slow(obj, key);
30811static void __Pyx_RejectKeywords(
const char* function_name, PyObject *kwds) {
30812 PyObject *key = NULL;
30813 if (CYTHON_VECTORCALL && likely(PyTuple_Check(kwds))) {
30814 key = __Pyx_PySequence_ITEM(kwds, 0);
30816#if CYTHON_AVOID_BORROWED_REFS
30817 PyObject *pos = NULL;
30819 Py_ssize_t pos = 0;
30821#if !CYTHON_COMPILING_IN_PYPY || defined(PyArg_ValidateKeywordArguments)
30822 if (unlikely(!PyArg_ValidateKeywordArguments(kwds)))
return;
30824 __Pyx_PyDict_NextRef(kwds, &pos, &key, NULL);
30825#if CYTHON_AVOID_BORROWED_REFS
30830 PyErr_Format(PyExc_TypeError,
30831 "%s() got an unexpected keyword argument '%U'",
30832 function_name, key);
30838static CYTHON_INLINE Py_ssize_t __Pyx_div_Py_ssize_t(Py_ssize_t a, Py_ssize_t b,
int b_is_constant) {
30839 Py_ssize_t
q = a / b;
30840 Py_ssize_t
r = a -
q*b;
30841 Py_ssize_t adapt_python = (b_is_constant ?
30842 ((
r != 0) & ((
r < 0) ^ (b < 0))) :
30843 ((
r != 0) & ((
r ^ b) < 0))
30845 return q - adapt_python;
30849#if __PYX_LIMITED_VERSION_HEX < 0x030d0000
30850static PyObject *__Pyx_GetAttr3Default(PyObject *d) {
30851 __Pyx_PyThreadState_declare
30852 __Pyx_PyThreadState_assign
30853 if (unlikely(!__Pyx_PyErr_ExceptionMatches(PyExc_AttributeError)))
30855 __Pyx_PyErr_Clear();
30860static CYTHON_INLINE PyObject *__Pyx_GetAttr3(PyObject *o, PyObject *
n, PyObject *d) {
30862#if __PYX_LIMITED_VERSION_HEX >= 0x030d0000
30863 int res = PyObject_GetOptionalAttr(o,
n, &
r);
30864 return (res != 0) ?
r : __Pyx_NewRef(d);
30866 #if CYTHON_USE_TYPE_SLOTS
30867 if (likely(PyUnicode_Check(
n))) {
30868 r = __Pyx_PyObject_GetAttrStrNoError(o,
n);
30869 if (unlikely(!
r) && likely(!PyErr_Occurred())) {
30870 r = __Pyx_NewRef(d);
30875 r = PyObject_GetAttr(o,
n);
30876 return (likely(
r)) ?
r : __Pyx_GetAttr3Default(d);
30881#if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_TYPE_SLOTS
30882static CYTHON_INLINE PY_UINT64_T __Pyx_get_tp_dict_version(PyObject *obj) {
30883 PyObject *dict = Py_TYPE(obj)->tp_dict;
30884 return likely(dict) ? __PYX_GET_DICT_VERSION(dict) : 0;
30886static CYTHON_INLINE PY_UINT64_T __Pyx_get_object_dict_version(PyObject *obj) {
30887 PyObject **dictptr = NULL;
30888 Py_ssize_t offset = Py_TYPE(obj)->tp_dictoffset;
30890#if CYTHON_COMPILING_IN_CPYTHON
30891 dictptr = (likely(offset > 0)) ? (PyObject **) ((
char *)obj + offset) : _PyObject_GetDictPtr(obj);
30893 dictptr = _PyObject_GetDictPtr(obj);
30896 return (dictptr && *dictptr) ? __PYX_GET_DICT_VERSION(*dictptr) : 0;
30898static CYTHON_INLINE
int __Pyx_object_dict_version_matches(PyObject* obj, PY_UINT64_T tp_dict_version, PY_UINT64_T obj_dict_version) {
30899 PyObject *dict = Py_TYPE(obj)->tp_dict;
30900 if (unlikely(!dict) || unlikely(tp_dict_version != __PYX_GET_DICT_VERSION(dict)))
30902 return obj_dict_version == __Pyx_get_object_dict_version(obj);
30907#if CYTHON_USE_DICT_VERSIONS
30908static PyObject *__Pyx__GetModuleGlobalName(PyObject *name, PY_UINT64_T *dict_version, PyObject **dict_cached_value)
30910static CYTHON_INLINE PyObject *__Pyx__GetModuleGlobalName(PyObject *name)
30914#if CYTHON_COMPILING_IN_LIMITED_API
30915 if (unlikely(!__pyx_m)) {
30916 if (!PyErr_Occurred())
30917 PyErr_SetNone(PyExc_NameError);
30920 result = PyObject_GetAttr(__pyx_m, name);
30921 if (likely(result)) {
30924 if (!__Pyx_IgnoreException(PyExc_Exception)) {
30927#elif CYTHON_AVOID_BORROWED_REFS || CYTHON_AVOID_THREAD_UNSAFE_BORROWED_REFS
30928 if (unlikely(__Pyx_PyDict_GetItemRef(__pyx_mstate_global->__pyx_d, name, &result) == -1)) {
30929 if (!__Pyx_IgnoreException(PyExc_Exception)) {
30933 __PYX_UPDATE_DICT_CACHE(__pyx_mstate_global->__pyx_d, result, *dict_cached_value, *dict_version)
30934 if (likely(result)) {
30938 result = _PyDict_GetItem_KnownHash(__pyx_mstate_global->__pyx_d, name, ((PyASCIIObject *) name)->hash);
30939 __PYX_UPDATE_DICT_CACHE(__pyx_mstate_global->__pyx_d, result, *dict_cached_value, *dict_version)
30940 if (likely(result)) {
30941 return __Pyx_NewRef(result);
30943 PyObject *exc = PyErr_Occurred();
30944 if (unlikely(exc) && !__Pyx_IgnoreGivenException(exc, PyExc_Exception)) {
30948 return __Pyx_GetBuiltinName(name);
30952static CYTHON_INLINE
void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected) {
30953 PyErr_Format(PyExc_ValueError,
30954 "too many values to unpack (expected %" CYTHON_FORMAT_SSIZE_T
"d)", expected);
30958static CYTHON_INLINE
void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index) {
30959 PyErr_Format(PyExc_ValueError,
30960 "need more than %" CYTHON_FORMAT_SSIZE_T
"d value%.1s to unpack",
30961 index, (index == 1) ?
"" :
"s");
30965static CYTHON_INLINE
void __Pyx_RaiseNoneNotIterableError(
void) {
30966 PyErr_SetString(PyExc_TypeError,
"'NoneType' object is not iterable");
30970#if CYTHON_USE_EXC_INFO_STACK && CYTHON_FAST_THREAD_STATE
30971static _PyErr_StackItem *
30972__Pyx_PyErr_GetTopmostException(PyThreadState *tstate)
30974 _PyErr_StackItem *exc_info = tstate->exc_info;
30975 while ((exc_info->exc_value == NULL || exc_info->exc_value == Py_None) &&
30976 exc_info->previous_item != NULL)
30978 exc_info = exc_info->previous_item;
30985#if CYTHON_FAST_THREAD_STATE
30986static CYTHON_INLINE
void __Pyx__ExceptionSave(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) {
30987 #if CYTHON_USE_EXC_INFO_STACK && PY_VERSION_HEX >= 0x030B00a4
30988 _PyErr_StackItem *exc_info = __Pyx_PyErr_GetTopmostException(tstate);
30989 PyObject *exc_value = exc_info->exc_value;
30990 if (exc_value == NULL || exc_value == Py_None) {
30995 *value = exc_value;
30997 *type = (PyObject*) Py_TYPE(exc_value);
30999 *tb = PyException_GetTraceback(exc_value);
31001 #elif CYTHON_USE_EXC_INFO_STACK
31002 _PyErr_StackItem *exc_info = __Pyx_PyErr_GetTopmostException(tstate);
31003 *type = exc_info->exc_type;
31004 *value = exc_info->exc_value;
31005 *tb = exc_info->exc_traceback;
31007 Py_XINCREF(*value);
31010 *type = tstate->exc_type;
31011 *value = tstate->exc_value;
31012 *tb = tstate->exc_traceback;
31014 Py_XINCREF(*value);
31018static CYTHON_INLINE
void __Pyx__ExceptionReset(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb) {
31019 #if CYTHON_USE_EXC_INFO_STACK && PY_VERSION_HEX >= 0x030B00a4
31020 _PyErr_StackItem *exc_info = tstate->exc_info;
31021 PyObject *tmp_value = exc_info->exc_value;
31022 exc_info->exc_value = value;
31023 Py_XDECREF(tmp_value);
31027 PyObject *tmp_type, *tmp_value, *tmp_tb;
31028 #if CYTHON_USE_EXC_INFO_STACK
31029 _PyErr_StackItem *exc_info = tstate->exc_info;
31030 tmp_type = exc_info->exc_type;
31031 tmp_value = exc_info->exc_value;
31032 tmp_tb = exc_info->exc_traceback;
31033 exc_info->exc_type = type;
31034 exc_info->exc_value = value;
31035 exc_info->exc_traceback = tb;
31037 tmp_type = tstate->exc_type;
31038 tmp_value = tstate->exc_value;
31039 tmp_tb = tstate->exc_traceback;
31040 tstate->exc_type = type;
31041 tstate->exc_value = value;
31042 tstate->exc_traceback = tb;
31044 Py_XDECREF(tmp_type);
31045 Py_XDECREF(tmp_value);
31046 Py_XDECREF(tmp_tb);
31052static void __Pyx_RaiseErrorWithTypes1(PyObject* exc_type,
const char *message,
const char *arg, PyTypeObject *type_obj1, PyTypeObject *type_obj2) {
31053 __Pyx_TypeName type_name1 = __Pyx_PyType_GetFullyQualifiedName(type_obj1);
31054 #if CYTHON_COMPILING_IN_LIMITED_API && __PYX_LIMITED_VERSION_HEX < 0x030d0000
31055 if (unlikely(!type_name1))
return;
31057 __Pyx_TypeName type_name2 = __Pyx_PyType_GetFullyQualifiedName(type_obj2);
31058 #if CYTHON_COMPILING_IN_LIMITED_API && __PYX_LIMITED_VERSION_HEX < 0x030d0000
31059 if (unlikely(!type_name2))
goto type2_failed;
31061 PyErr_Format(exc_type, message, arg, type_name1, type_name2);
31062 __Pyx_DECREF_TypeName(type_name2);
31063#if CYTHON_COMPILING_IN_LIMITED_API && __PYX_LIMITED_VERSION_HEX < 0x030d0000
31066 __Pyx_DECREF_TypeName(type_name1);
31070static CYTHON_INLINE
int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type) {
31071 if (unlikely(!type)) {
31072 PyErr_SetString(PyExc_SystemError,
"Missing type object");
31075 if (likely(__Pyx_TypeCheck(obj, type)))
31077 __Pyx_RaiseTypeErrorWithTypes(
31078 "Cannot convert " __Pyx_FMT_TYPENAME
" to " __Pyx_FMT_TYPENAME,
31079 Py_TYPE(obj), type);
31084#if CYTHON_FAST_THREAD_STATE
31085static int __Pyx__GetException(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb)
31087static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb)
31090 PyObject *local_type = NULL, *local_value, *local_tb = NULL;
31091#if CYTHON_FAST_THREAD_STATE
31092 PyObject *tmp_type, *tmp_value, *tmp_tb;
31093 #if PY_VERSION_HEX >= 0x030C0000
31094 local_value = tstate->current_exception;
31095 tstate->current_exception = 0;
31097 local_type = tstate->curexc_type;
31098 local_value = tstate->curexc_value;
31099 local_tb = tstate->curexc_traceback;
31100 tstate->curexc_type = 0;
31101 tstate->curexc_value = 0;
31102 tstate->curexc_traceback = 0;
31104#elif __PYX_LIMITED_VERSION_HEX >= 0x030C0000
31105 local_value = PyErr_GetRaisedException();
31107 PyErr_Fetch(&local_type, &local_value, &local_tb);
31109#if __PYX_LIMITED_VERSION_HEX >= 0x030C0000
31110 if (likely(local_value)) {
31111 local_type = (PyObject*) Py_TYPE(local_value);
31112 Py_INCREF(local_type);
31113 local_tb = PyException_GetTraceback(local_value);
31116 PyErr_NormalizeException(&local_type, &local_value, &local_tb);
31117#if CYTHON_FAST_THREAD_STATE
31118 if (unlikely(tstate->curexc_type))
31120 if (unlikely(PyErr_Occurred()))
31124 if (unlikely(PyException_SetTraceback(local_value, local_tb) < 0))
31128 Py_XINCREF(local_tb);
31129 Py_XINCREF(local_type);
31130 Py_XINCREF(local_value);
31131 *type = local_type;
31132 *value = local_value;
31134#if CYTHON_FAST_THREAD_STATE
31135 #if CYTHON_USE_EXC_INFO_STACK
31137 _PyErr_StackItem *exc_info = tstate->exc_info;
31138 #if PY_VERSION_HEX >= 0x030B00a4
31139 tmp_value = exc_info->exc_value;
31140 exc_info->exc_value = local_value;
31143 Py_XDECREF(local_type);
31144 Py_XDECREF(local_tb);
31146 tmp_type = exc_info->exc_type;
31147 tmp_value = exc_info->exc_value;
31148 tmp_tb = exc_info->exc_traceback;
31149 exc_info->exc_type = local_type;
31150 exc_info->exc_value = local_value;
31151 exc_info->exc_traceback = local_tb;
31155 tmp_type = tstate->exc_type;
31156 tmp_value = tstate->exc_value;
31157 tmp_tb = tstate->exc_traceback;
31158 tstate->exc_type = local_type;
31159 tstate->exc_value = local_value;
31160 tstate->exc_traceback = local_tb;
31162 Py_XDECREF(tmp_type);
31163 Py_XDECREF(tmp_value);
31164 Py_XDECREF(tmp_tb);
31165#elif __PYX_LIMITED_VERSION_HEX >= 0x030b0000
31166 PyErr_SetHandledException(local_value);
31167 Py_XDECREF(local_value);
31168 Py_XDECREF(local_type);
31169 Py_XDECREF(local_tb);
31171 PyErr_SetExcInfo(local_type, local_value, local_tb);
31174#if __PYX_LIMITED_VERSION_HEX < 0x030C0000
31179 Py_XDECREF(local_type);
31180 Py_XDECREF(local_value);
31181 Py_XDECREF(local_tb);
31187#if CYTHON_FAST_THREAD_STATE
31188static CYTHON_INLINE
void __Pyx__ExceptionSwap(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) {
31189 PyObject *tmp_type, *tmp_value, *tmp_tb;
31190 #if CYTHON_USE_EXC_INFO_STACK && PY_VERSION_HEX >= 0x030B00a4
31191 _PyErr_StackItem *exc_info = tstate->exc_info;
31192 tmp_value = exc_info->exc_value;
31193 exc_info->exc_value = *value;
31194 if (tmp_value == NULL || tmp_value == Py_None) {
31195 Py_XDECREF(tmp_value);
31200 tmp_type = (PyObject*) Py_TYPE(tmp_value);
31201 Py_INCREF(tmp_type);
31202 #if CYTHON_COMPILING_IN_CPYTHON
31203 tmp_tb = ((PyBaseExceptionObject*) tmp_value)->traceback;
31204 Py_XINCREF(tmp_tb);
31206 tmp_tb = PyException_GetTraceback(tmp_value);
31209 #elif CYTHON_USE_EXC_INFO_STACK
31210 _PyErr_StackItem *exc_info = tstate->exc_info;
31211 tmp_type = exc_info->exc_type;
31212 tmp_value = exc_info->exc_value;
31213 tmp_tb = exc_info->exc_traceback;
31214 exc_info->exc_type = *type;
31215 exc_info->exc_value = *value;
31216 exc_info->exc_traceback = *tb;
31218 tmp_type = tstate->exc_type;
31219 tmp_value = tstate->exc_value;
31220 tmp_tb = tstate->exc_traceback;
31221 tstate->exc_type = *type;
31222 tstate->exc_value = *value;
31223 tstate->exc_traceback = *tb;
31226 *value = tmp_value;
31230static CYTHON_INLINE
void __Pyx_ExceptionSwap(PyObject **type, PyObject **value, PyObject **tb) {
31231 PyObject *tmp_type, *tmp_value, *tmp_tb;
31232 PyErr_GetExcInfo(&tmp_type, &tmp_value, &tmp_tb);
31233 PyErr_SetExcInfo(*type, *value, *tb);
31235 *value = tmp_value;
31241#if __PYX_LIMITED_VERSION_HEX < 0x030d0000
31242static CYTHON_INLINE
int __Pyx_HasAttr(PyObject *o, PyObject *
n) {
31244 if (unlikely(!PyUnicode_Check(
n))) {
31245 PyErr_SetString(PyExc_TypeError,
31246 "hasattr(): attribute name must be string");
31249 r = __Pyx_PyObject_GetAttrStrNoError(o,
n);
31251 return (unlikely(PyErr_Occurred())) ? -1 : 0;
31260CYTHON_UNUSED
static PyObject *
31261__Pyx_PyList_FromArray(PyObject *
const *src, Py_ssize_t
n) {
31262 PyObject *res = PyList_New(
n);
31263 if (unlikely(res == NULL))
return NULL;
31264 #if CYTHON_COMPILING_IN_CPYTHON
31265 __Pyx_copy_object_array(src, ((PyListObject*)res)->ob_item,
n);
31268 for (i = 0; i <
n; i++) {
31270 if (unlikely(__Pyx_PyList_SET_ITEM(res, i, src[i]) < (0))) {
31280static int __Pyx__Import_GetModule(PyObject *qualname, PyObject **module) {
31281 PyObject *imported_module = PyImport_GetModule(qualname);
31282 if (unlikely(!imported_module)) {
31284 if (PyErr_Occurred()) {
31289 *
module = imported_module;
31292static int __Pyx__Import_Lookup(PyObject *qualname, PyObject *
const *imported_names, Py_ssize_t len_imported_names, PyObject **module) {
31293 PyObject *imported_module;
31294 PyObject *top_level_package_name;
31296 int status, module_found;
31297 Py_ssize_t dot_index;
31298 module_found = __Pyx__Import_GetModule(qualname, &imported_module);
31299 if (unlikely(!module_found || module_found == -1)) {
31301 return module_found;
31303 if (imported_names) {
31304 for (i = 0; i < len_imported_names; i++) {
31305 PyObject *imported_name = imported_names[i];
31306#if __PYX_LIMITED_VERSION_HEX < 0x030d0000
31307 int has_imported_attribute = PyObject_HasAttr(imported_module, imported_name);
31309 int has_imported_attribute = PyObject_HasAttrWithError(imported_module, imported_name);
31310 if (unlikely(has_imported_attribute == -1))
goto error;
31312 if (!has_imported_attribute) {
31316 *
module = imported_module;
31319 dot_index = PyUnicode_FindChar(qualname,
'.', 0, PY_SSIZE_T_MAX, 1);
31320 if (dot_index == -1) {
31321 *
module = imported_module;
31324 if (unlikely(dot_index == -2))
goto error;
31325 top_level_package_name = PyUnicode_Substring(qualname, 0, dot_index);
31326 if (unlikely(!top_level_package_name))
goto error;
31327 Py_DECREF(imported_module);
31328 status = __Pyx__Import_GetModule(top_level_package_name, module);
31329 Py_DECREF(top_level_package_name);
31332 Py_DECREF(imported_module);
31336 Py_DECREF(imported_module);
31340static PyObject *__Pyx__Import(PyObject *name, PyObject *
const *imported_names, Py_ssize_t len_imported_names, PyObject *qualname, PyObject *moddict,
int level) {
31341 PyObject *module = 0;
31342 PyObject *empty_dict = 0;
31343 PyObject *from_list = 0;
31348 module_found = __Pyx__Import_Lookup(qualname, imported_names, len_imported_names, &module);
31349 if (likely(module_found == 1)) {
31351 }
else if (unlikely(module_found == -1)) {
31354 #if !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX >= 0x030f00a6
31355 empty_dict = PyFrozenDict_New(NULL);
31357 empty_dict = PyDict_New();
31359 if (unlikely(!empty_dict))
31361 if (imported_names) {
31362 from_list = __Pyx_PyList_FromArray(imported_names, len_imported_names);
31363 if (unlikely(!from_list))
31367 const char* package_sep = strchr(__Pyx_MODULE_NAME,
'.');
31368 if (package_sep != (0)) {
31369 module = PyImport_ImportModuleLevelObject(
31370 name, moddict, empty_dict, from_list, 1);
31371 if (unlikely(!module)) {
31372 if (unlikely(!PyErr_ExceptionMatches(PyExc_ImportError)))
31380 module = PyImport_ImportModuleLevelObject(
31381 name, moddict, empty_dict, from_list, level);
31384 Py_XDECREF(from_list);
31385 Py_XDECREF(empty_dict);
31390static PyObject *__Pyx_Import(PyObject *name, PyObject *
const *imported_names, Py_ssize_t len_imported_names, PyObject *qualname,
int level) {
31391 return __Pyx__Import(name, imported_names, len_imported_names, qualname, __pyx_mstate_global->__pyx_d, level);
31395#if CYTHON_USE_PYLIST_INTERNALS && CYTHON_ASSUME_SAFE_MACROS && CYTHON_ASSUME_SAFE_SIZE
31396static CYTHON_INLINE
void __Pyx__ListComp_AppendAndDecref(PyObject* list, Py_ssize_t len, PyObject* x) {
31397 PyList_SET_ITEM(list, len, x);
31398 Py_SET_SIZE(list, len + 1);
31403#if CYTHON_USE_PYLIST_INTERNALS && CYTHON_ASSUME_SAFE_MACROS && CYTHON_ASSUME_SAFE_SIZE
31404static CYTHON_INLINE
int __Pyx_ListComp_AppendAndDecref(PyObject* list, PyObject* x) {
31405 PyListObject*
L = (PyListObject*) list;
31406 Py_ssize_t len = Py_SIZE(list);
31407 if (likely(
L->allocated > len)) {
31408 __Pyx__ListComp_AppendAndDecref(list, len, x);
31411 int result = PyList_Append(list, x);
31416static CYTHON_INLINE
int __Pyx_ListComp_AppendAndDecref(PyObject* list, PyObject* x) {
31417 int result = PyList_Append(list, x);
31424#if CYTHON_USE_TYPE_SLOTS
31425static PyObject* __Pyx_PySequence_Multiply_Generic(PyObject *seq, Py_ssize_t mul) {
31426 PyObject *result, *pymul = PyLong_FromSsize_t(mul);
31427 if (unlikely(!pymul))
31429 result = PyNumber_Multiply(seq, pymul);
31433static CYTHON_INLINE PyObject* __Pyx_PySequence_Multiply(PyObject *seq, Py_ssize_t mul) {
31434 PyTypeObject *type = Py_TYPE(seq);
31435 if (likely(type->tp_as_sequence && type->tp_as_sequence->sq_repeat)) {
31436 return type->tp_as_sequence->sq_repeat(seq, mul);
31438 return __Pyx_PySequence_Multiply_Generic(seq, mul);
31444#if !(CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_GRAAL || CYTHON_COMPILING_IN_LIMITED_API)
31445#if CYTHON_USE_TYPE_SLOTS || __PYX_LIMITED_VERSION_HEX >= 0x030A0000
31446#ifndef __Pyx_DEFINED_BinopTypeError
31447#define __Pyx_DEFINED_BinopTypeError
31448static void __Pyx_BinopTypeError(PyObject *op1, PyObject *op2,
const char* op,
int inplace) {
31449 char opname[4] = {op[0], op[1], 0, 0};
31451 opname[op[1] ? 2 : 1] =
'=';
31453 __Pyx_RaiseErrorWithObjectTypes1(
31455 "unsupported operand type(s) for %.3s: '" __Pyx_FMT_TYPENAME
"' and '" __Pyx_FMT_TYPENAME
"'",
31460#ifndef __Pyx_DEFINED_PyNumber_Multiply_xfloat_int
31461#define __Pyx_DEFINED_PyNumber_Multiply_xfloat_int
31462static PyObject* __Pyx_PyNumber_Multiply_xfloat_int(PyObject *op1, PyObject *op2,
int inplace) {
31463 if (likely(op2 != Py_None)) {
31465 #if CYTHON_USE_PYLONG_INTERNALS
31466 if (__Pyx_PyLong_IsCompact(op2)) {
31467 Py_ssize_t compact_op2 = __Pyx_PyLong_CompactValue(op2);
31468 int_op2 = (double) compact_op2;
31472 int_op2 = PyLong_AsDouble(op2);
31473 if (unlikely((int_op2 == -1.) && PyErr_Occurred()))
return NULL;
31475 double float_op1 = __Pyx_PyFloat_AS_DOUBLE(op1);
31476 #if !CYTHON_ASSUME_SAFE_MACROS
31477 if (unlikely((float_op1 == -1.) && PyErr_Occurred()))
return NULL;
31479 if (float_op1 == 0.)
return __Pyx_NewRef(op1);
31480 return PyFloat_FromDouble(float_op1 * int_op2);
31482 #if CYTHON_USE_TYPE_SLOTS || __PYX_LIMITED_VERSION_HEX >= 0x030A0000
31484 PyTypeObject *type_op2 = Py_TYPE(op2);
31485 binaryfunc slot_func = __Pyx_PyType_GetSubSlot(type_op2, tp_as_number, nb_multiply, binaryfunc);
31486 if (likely(slot_func)) {
31487 PyObject *result = slot_func(op1, op2);
31488 if (likely(result != Py_NotImplemented)) {
31493 __Pyx_BinopTypeError(op1, op2,
"*", inplace);
31497 return (inplace) ? PyNumber_InPlaceMultiply(op1, op2) : PyNumber_Multiply(op1, op2);
31501#ifndef __Pyx_DEFINED_PyNumber_Multiply_xint_int
31502#define __Pyx_DEFINED_PyNumber_Multiply_xint_int
31503static PyObject* __Pyx_PyNumber_Multiply_xint_int(PyObject *op1, PyObject *op2,
int inplace) {
31504 #if CYTHON_USE_TYPE_SLOTS || __PYX_LIMITED_VERSION_HEX >= 0x030A0000
31506 PyTypeObject *type_op2 = Py_TYPE(op2);
31507 binaryfunc slot_func = __Pyx_PyType_GetSubSlot(type_op2, tp_as_number, nb_multiply, binaryfunc);
31508 if (likely(slot_func)) {
31509 PyObject *result = slot_func(op1, op2);
31510 if (likely(result != Py_NotImplemented)) {
31515 ssizeargfunc repeat_func = __Pyx_PyType_GetSubSlot(type_op2, tp_as_sequence, sq_repeat, ssizeargfunc);
31516 if (likely(repeat_func)) {
31518 #if CYTHON_USE_PYLONG_INTERNALS
31519 if (__Pyx_PyLong_IsCompact(op1)) {
31520 count = __Pyx_PyLong_CompactValue(op1);
31524 count = PyLong_AsSsize_t(op1);
31525 if (unlikely((count == -1) && PyErr_Occurred()))
return NULL;
31527 return repeat_func(op2, count);
31529 __Pyx_BinopTypeError(op1, op2,
"*", inplace);
31533 return (inplace) ? PyNumber_InPlaceMultiply(op1, op2) : PyNumber_Multiply(op1, op2);
31537static CYTHON_INLINE PyObject* __Pyx__PyNumber_Multiply_object_int(PyObject *op1, PyObject *op2,
int inplace) {
31538 if (PyFloat_CheckExact(op1)) {
31539 return __Pyx_PyNumber_Multiply_xfloat_int(op1, op2, inplace);
31541 if (likely(PyLong_CheckExact(op1))) {
31542 if (likely(op2 != Py_None)) {
31543 #if CYTHON_USE_PYLONG_INTERNALS
31544 if (__Pyx_PyLong_IsCompact(op1)) {
31545 long long int_op1 = (
long long) __Pyx_PyLong_CompactValue(op1);
31546 if (int_op1 == 0)
return __Pyx_NewRef(op1);
31547 if (__Pyx_PyLong_IsCompact(op2)) {
31548 long long int_op2 = (
long long) __Pyx_PyLong_CompactValue(op2);
31549 if (int_op2 == 0)
return __Pyx_NewRef(op2);
31550 return PyLong_FromLongLong(int_op1 * int_op2);
31553 else if (__Pyx_PyLong_IsZero(op2))
return __Pyx_NewRef(op2);
31555 binaryfunc slot_func = __Pyx_PyType_GetSubSlot(&PyLong_Type, tp_as_number, nb_multiply, binaryfunc);
31556 if (likely(slot_func)) {
31557 return slot_func(op1, op2);
31560 return __Pyx_PyNumber_Multiply_xint_int(op1, op2, inplace);
31562 return (inplace) ? PyNumber_InPlaceMultiply(op1, op2) : PyNumber_Multiply(op1, op2);
31567static CYTHON_INLINE PyObject* __Pyx_PyObject_FormatSimpleAndDecref(PyObject*
s, PyObject*
f) {
31568 if (unlikely(!
s))
return NULL;
31569 if (likely(PyUnicode_CheckExact(
s)))
return s;
31570 return __Pyx_PyObject_FormatAndDecref(
s,
f);
31572static CYTHON_INLINE PyObject* __Pyx_PyObject_FormatAndDecref(PyObject*
s, PyObject*
f) {
31574 if (unlikely(!
s))
return NULL;
31575 result = PyObject_Format(
s,
f);
31581#if CYTHON_USE_UNICODE_WRITER
31582static PyObject* __Pyx_PyObject_Format(PyObject* obj, PyObject* format_spec) {
31584 _PyUnicodeWriter writer;
31585 if (likely(PyFloat_CheckExact(obj))) {
31586 _PyUnicodeWriter_Init(&writer);
31587 ret = _PyFloat_FormatAdvancedWriter(
31590 format_spec, 0, PyUnicode_GET_LENGTH(format_spec));
31591 }
else if (likely(PyLong_CheckExact(obj))) {
31592 _PyUnicodeWriter_Init(&writer);
31593 ret = _PyLong_FormatAdvancedWriter(
31596 format_spec, 0, PyUnicode_GET_LENGTH(format_spec));
31598 return PyObject_Format(obj, format_spec);
31600 if (unlikely(ret == -1)) {
31601 _PyUnicodeWriter_Dealloc(&writer);
31604 return _PyUnicodeWriter_Finish(&writer);
31609static int __Pyx_SetItemInt_Generic(PyObject *o, PyObject *j, PyObject *
v) {
31611 if (unlikely(!j))
return -1;
31612 r = PyObject_SetItem(o, j,
v);
31616#if CYTHON_USE_TYPE_SLOTS && !CYTHON_COMPILING_IN_PYPY
31617static CYTHON_INLINE
int __Pyx_SetItemInt_Fast_mapping(PyObject *o, objobjargproc setitem, Py_ssize_t i, PyObject *value) {
31618 PyObject *key = PyLong_FromSsize_t(i);
31619 if (unlikely(!key))
return -1;
31620 int r = setitem(o, key, value);
31625static CYTHON_INLINE
int __Pyx_SetItemInt_Fast(PyObject *o, Py_ssize_t i, PyObject *
v,
31626 int wraparound,
int boundscheck,
int unsafe_shared) {
31627 CYTHON_MAYBE_UNUSED_VAR(unsafe_shared);
31628#if CYTHON_ASSUME_SAFE_MACROS && CYTHON_ASSUME_SAFE_SIZE && !CYTHON_AVOID_BORROWED_REFS
31629 if (PyList_CheckExact(o)) {
31630 Py_ssize_t
n = (!wraparound) ? i : ((likely(i >= 0)) ? i : i + PyList_GET_SIZE(o));
31631 if ((CYTHON_AVOID_THREAD_UNSAFE_BORROWED_REFS && !__Pyx_IS_UNIQUELY_REFERENCED(o, unsafe_shared))) {
31633 return PyList_SetItem(o,
n,
v);
31634 }
else if ((!boundscheck) || likely(__Pyx_is_valid_index(
n, PyList_GET_SIZE(o)))) {
31637 old = PyList_GET_ITEM(o,
n);
31638 PyList_SET_ITEM(o,
n,
v);
31644#if CYTHON_USE_TYPE_SLOTS && !CYTHON_COMPILING_IN_PYPY
31645 if (PyDict_CheckExact(o)) {
31646 return __Pyx_SetItemInt_Fast_mapping(o, PyDict_Type.tp_as_mapping->mp_ass_subscript, i,
v);
31649 PyTypeObject *obj_type = Py_TYPE(o);
31650 int seq_or_mapping = __Pyx_PyType_GetFlags(obj_type) & (Py_TPFLAGS_SEQUENCE|Py_TPFLAGS_MAPPING);
31651 if (seq_or_mapping != Py_TPFLAGS_SEQUENCE) {
31652 PyMappingMethods *mm = obj_type->tp_as_mapping;
31653 if (mm && mm->mp_ass_subscript)
31654 return __Pyx_SetItemInt_Fast_mapping(o, mm->mp_ass_subscript, i,
v);
31656 PySequenceMethods *sm = obj_type->tp_as_sequence;
31657 if (likely(sm && sm->sq_ass_item)) {
31658 if (wraparound && (i < 0) && unlikely(__Pyx_GetItemInt_wraparound(o, sm, &i) == -1))
31660 return sm->sq_ass_item(o, i,
v);
31662 if (seq_or_mapping == Py_TPFLAGS_SEQUENCE) {
31663 PyMappingMethods *mm = obj_type->tp_as_mapping;
31664 if (likely(mm && mm->mp_ass_subscript))
31665 return __Pyx_SetItemInt_Fast_mapping(o, mm->mp_ass_subscript, i,
v);
31669 if (!PyMapping_Check(o)) {
31670 return PySequence_SetItem(o, i,
v);
31675 return __Pyx_SetItemInt_Generic(o, PyLong_FromSsize_t(i),
v);
31679static void __Pyx_RaiseUnboundLocalError(
const char *varname) {
31680 PyErr_Format(PyExc_UnboundLocalError,
"local variable '%s' referenced before assignment", varname);
31684static CYTHON_INLINE
long __Pyx_div_long(
long a,
long b,
int b_is_constant) {
31687 long adapt_python = (b_is_constant ?
31688 ((
r != 0) & ((
r < 0) ^ (b < 0))) :
31689 ((
r != 0) & ((
r ^ b) < 0))
31691 return q - adapt_python;
31695#if CYTHON_USE_TYPE_SLOTS
31696static CYTHON_INLINE
int __Pyx_PyObject_SetAttrStr(PyObject* obj, PyObject* attr_name, PyObject* value) {
31697 PyTypeObject* tp = Py_TYPE(obj);
31698 if (likely(tp->tp_setattro))
31699 return tp->tp_setattro(obj, attr_name, value);
31700 return PyObject_SetAttr(obj, attr_name, value);
31705#if CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
31706static CYTHON_INLINE PyObject* __Pyx__PyObject_LookupSpecial(PyObject* obj, PyObject* attr_name,
int with_error) {
31708 PyTypeObject *tp = Py_TYPE(obj);
31709 res = _PyType_Lookup(tp, attr_name);
31711 descrgetfunc
f = Py_TYPE(res)->tp_descr_get;
31715 res =
f(res, obj, (PyObject *)tp);
31717 }
else if (with_error) {
31718 PyErr_SetObject(PyExc_AttributeError, attr_name);
31725#if !CYTHON_COMPILING_IN_PYPY
31726static PyObject* __Pyx_Fallback___Pyx_PyLong_AddObjC(PyObject *op1, PyObject *op2,
int inplace) {
31727 return (inplace ? PyNumber_InPlaceAdd : PyNumber_Add)(op1, op2);
31729#if CYTHON_USE_PYLONG_INTERNALS
31730static PyObject* __Pyx_Unpacked___Pyx_PyLong_AddObjC(PyObject *op1, PyObject *op2,
long intval,
int inplace,
int zerodivision_check) {
31731 CYTHON_MAYBE_UNUSED_VAR(inplace);
31732 CYTHON_UNUSED_VAR(zerodivision_check);
31733 const long b = intval;
31735 const PY_LONG_LONG llb = intval;
31737 if (unlikely(__Pyx_PyLong_IsZero(op1))) {
31738 return __Pyx_NewRef(op2);
31740 const int is_positive = __Pyx_PyLong_IsPos(op1);
31741 const digit* digits = __Pyx_PyLong_Digits(op1);
31742 const Py_ssize_t size = __Pyx_PyLong_DigitCount(op1);
31743 if (likely(size == 1)) {
31744 a = (long) digits[0];
31745 if (!is_positive) a *= -1;
31747 if (size == 2 && 8 *
sizeof(
long) - 1 > 2 * PyLong_SHIFT) {
31748 a = (long) (((((
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0]));
31749 if (!is_positive) a *= -1;
31750 goto calculate_long;
31751 }
else if (size == 2 && 8 *
sizeof(PY_LONG_LONG) - 1 > 2 * PyLong_SHIFT) {
31752 lla = (PY_LONG_LONG) (((((
unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (
unsigned PY_LONG_LONG)digits[0]));
31753 if (!is_positive) lla *= -1;
31754 goto calculate_long_long;
31756 if (size == 3 && 8 *
sizeof(
long) - 1 > 3 * PyLong_SHIFT) {
31757 a = (long) (((((((
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0]));
31758 if (!is_positive) a *= -1;
31759 goto calculate_long;
31760 }
else if (size == 3 && 8 *
sizeof(PY_LONG_LONG) - 1 > 3 * PyLong_SHIFT) {
31761 lla = (PY_LONG_LONG) (((((((
unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (
unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (
unsigned PY_LONG_LONG)digits[0]));
31762 if (!is_positive) lla *= -1;
31763 goto calculate_long_long;
31765 if (size == 4 && 8 *
sizeof(
long) - 1 > 4 * PyLong_SHIFT) {
31766 a = (long) (((((((((
unsigned long)digits[3]) << PyLong_SHIFT) | (
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0]));
31767 if (!is_positive) a *= -1;
31768 goto calculate_long;
31769 }
else if (size == 4 && 8 *
sizeof(PY_LONG_LONG) - 1 > 4 * PyLong_SHIFT) {
31770 lla = (PY_LONG_LONG) (((((((((
unsigned PY_LONG_LONG)digits[3]) << PyLong_SHIFT) | (
unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (
unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (
unsigned PY_LONG_LONG)digits[0]));
31771 if (!is_positive) lla *= -1;
31772 goto calculate_long_long;
31775 return PyLong_Type.tp_as_number->nb_add(op1, op2);
31781 return PyLong_FromLong(x);
31783 calculate_long_long:
31787 return PyLong_FromLongLong(llx);
31792static PyObject* __Pyx_Float___Pyx_PyLong_AddObjC(PyObject *float_val,
long intval,
int zerodivision_check) {
31793 CYTHON_UNUSED_VAR(zerodivision_check);
31794 const long b = intval;
31795 double a = __Pyx_PyFloat_AS_DOUBLE(float_val);
31798 result = ((double)a) + (
double)b;
31799 return PyFloat_FromDouble(result);
31801static CYTHON_INLINE PyObject* __Pyx_PyLong_AddObjC(PyObject *op1, PyObject *op2,
long intval,
int inplace,
int zerodivision_check) {
31802 CYTHON_MAYBE_UNUSED_VAR(intval);
31803 CYTHON_UNUSED_VAR(zerodivision_check);
31804 #if CYTHON_USE_PYLONG_INTERNALS
31805 if (likely(PyLong_CheckExact(op1))) {
31806 return __Pyx_Unpacked___Pyx_PyLong_AddObjC(op1, op2, intval, inplace, zerodivision_check);
31809 if (PyFloat_CheckExact(op1)) {
31810 return __Pyx_Float___Pyx_PyLong_AddObjC(op1, intval, zerodivision_check);
31812 return __Pyx_Fallback___Pyx_PyLong_AddObjC(op1, op2, inplace);
31817#if !(CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_GRAAL || CYTHON_COMPILING_IN_LIMITED_API)
31818#if CYTHON_USE_TYPE_SLOTS || __PYX_LIMITED_VERSION_HEX >= 0x030A0000
31819#ifndef __Pyx_DEFINED_BinopTypeError
31820#define __Pyx_DEFINED_BinopTypeError
31821static void __Pyx_BinopTypeError(PyObject *op1, PyObject *op2,
const char* op,
int inplace) {
31822 char opname[4] = {op[0], op[1], 0, 0};
31824 opname[op[1] ? 2 : 1] =
'=';
31826 __Pyx_RaiseErrorWithObjectTypes1(
31828 "unsupported operand type(s) for %.3s: '" __Pyx_FMT_TYPENAME
"' and '" __Pyx_FMT_TYPENAME
"'",
31833#ifndef __Pyx_DEFINED_PyNumber_Add_xfloat_object
31834#define __Pyx_DEFINED_PyNumber_Add_xfloat_object
31835static PyObject* __Pyx_PyNumber_Add_xfloat_object(PyObject *op1, PyObject *op2,
int inplace) {
31836 if (PyLong_CheckExact(op2)) {
31838 #if CYTHON_USE_PYLONG_INTERNALS
31839 if (__Pyx_PyLong_IsCompact(op2)) {
31840 Py_ssize_t compact_op2 = __Pyx_PyLong_CompactValue(op2);
31841 if (compact_op2 == 0)
return __Pyx_NewRef(op1);
31842 int_op2 = (double) compact_op2;
31846 int_op2 = PyLong_AsDouble(op2);
31847 if (unlikely((int_op2 == -1.) && PyErr_Occurred()))
return NULL;
31848 #if !CYTHON_USE_PYLONG_INTERNALS
31849 if (int_op2 == 0.)
return __Pyx_NewRef(op1);
31852 double float_op1 = __Pyx_PyFloat_AS_DOUBLE(op1);
31853 #if !CYTHON_ASSUME_SAFE_MACROS
31854 if (unlikely((float_op1 == -1.) && PyErr_Occurred()))
return NULL;
31856 return PyFloat_FromDouble(float_op1 + int_op2);
31858 if (PyLong_Check(op2)) {
31859 binaryfunc slot_func = __Pyx_PyType_GetSubSlot(&PyFloat_Type, tp_as_number, nb_add, binaryfunc);
31860 if (likely(slot_func)) {
31861 return slot_func(op1, op2);
31864 #if CYTHON_USE_TYPE_SLOTS || __PYX_LIMITED_VERSION_HEX >= 0x030A0000
31866 PyTypeObject *type_op2 = Py_TYPE(op2);
31867 binaryfunc slot_func = __Pyx_PyType_GetSubSlot(type_op2, tp_as_number, nb_add, binaryfunc);
31868 if (likely(slot_func)) {
31869 PyObject *result = slot_func(op1, op2);
31870 if (likely(result != Py_NotImplemented)) {
31875 __Pyx_BinopTypeError(op1, op2,
"+", inplace);
31879 return (inplace) ? PyNumber_InPlaceAdd(op1, op2) : PyNumber_Add(op1, op2);
31883#ifndef __Pyx_DEFINED_PyNumber_Add_xint_object
31884#define __Pyx_DEFINED_PyNumber_Add_xint_object
31885static PyObject* __Pyx_PyNumber_Add_xint_object(PyObject *op1, PyObject *op2,
int inplace) {
31886 if (PyFloat_CheckExact(op2)) {
31888 #if CYTHON_USE_PYLONG_INTERNALS
31889 if (__Pyx_PyLong_IsCompact(op1)) {
31890 Py_ssize_t compact_op1 = __Pyx_PyLong_CompactValue(op1);
31891 if (compact_op1 == 0)
return __Pyx_NewRef(op2);
31892 int_op1 = (double) compact_op1;
31896 int_op1 = PyLong_AsDouble(op1);
31897 if (unlikely((int_op1 == -1.) && PyErr_Occurred()))
return NULL;
31898 #if !CYTHON_USE_PYLONG_INTERNALS
31899 if (int_op1 == 0.)
return __Pyx_NewRef(op2);
31902 double float_op2 = __Pyx_PyFloat_AS_DOUBLE(op2);
31903 #if !CYTHON_ASSUME_SAFE_MACROS
31904 if (unlikely((float_op2 == -1.) && PyErr_Occurred()))
return NULL;
31906 return PyFloat_FromDouble(int_op1 + float_op2);
31908 #if CYTHON_USE_TYPE_SLOTS || __PYX_LIMITED_VERSION_HEX >= 0x030A0000
31910 PyTypeObject *type_op2 = Py_TYPE(op2);
31911 binaryfunc slot_func = __Pyx_PyType_GetSubSlot(type_op2, tp_as_number, nb_add, binaryfunc);
31912 if (likely(slot_func)) {
31913 PyObject *result = slot_func(op1, op2);
31914 if (likely(result != Py_NotImplemented)) {
31919 __Pyx_BinopTypeError(op1, op2,
"+", inplace);
31923 return (inplace) ? PyNumber_InPlaceAdd(op1, op2) : PyNumber_Add(op1, op2);
31927static CYTHON_INLINE PyObject* __Pyx__PyNumber_Add_object_object(PyObject *op1, PyObject *op2,
int inplace) {
31928 if (PyFloat_CheckExact(op1)) {
31929 if (PyFloat_CheckExact(op2)) {
31930 double float_op2 = __Pyx_PyFloat_AS_DOUBLE(op2);
31931 #if !CYTHON_ASSUME_SAFE_MACROS
31932 if (unlikely((float_op2 == -1.) && PyErr_Occurred()))
return NULL;
31934 double float_op1 = __Pyx_PyFloat_AS_DOUBLE(op1);
31935 #if !CYTHON_ASSUME_SAFE_MACROS
31936 if (unlikely((float_op1 == -1.) && PyErr_Occurred()))
return NULL;
31938 return PyFloat_FromDouble(float_op1 + float_op2);
31940 return __Pyx_PyNumber_Add_xfloat_object(op1, op2, inplace);
31942 if (PyLong_CheckExact(op1)) {
31943 if (PyLong_CheckExact(op2)) {
31944 #if CYTHON_USE_PYLONG_INTERNALS
31945 if (__Pyx_PyLong_IsCompact(op1)) {
31946 Py_ssize_t int_op1 = __Pyx_PyLong_CompactValue(op1);
31947 if (int_op1 == 0)
return __Pyx_NewRef(op2);
31948 if (__Pyx_PyLong_IsCompact(op2)) {
31949 Py_ssize_t int_op2 = __Pyx_PyLong_CompactValue(op2);
31950 if (int_op2 == 0)
return __Pyx_NewRef(op1);
31951 return PyLong_FromSsize_t(int_op1 + int_op2);
31954 else if (__Pyx_PyLong_IsZero(op2))
return __Pyx_NewRef(op1);
31956 binaryfunc slot_func = __Pyx_PyType_GetSubSlot(&PyLong_Type, tp_as_number, nb_add, binaryfunc);
31957 if (likely(slot_func)) {
31958 return slot_func(op1, op2);
31961 return __Pyx_PyNumber_Add_xint_object(op1, op2, inplace);
31963 return (inplace) ? PyNumber_InPlaceAdd(op1, op2) : PyNumber_Add(op1, op2);
31968#ifndef __Pyx_DEFINED_PyObject_CompareFloatIntBoolGe
31969#define __Pyx_DEFINED_PyObject_CompareFloatIntBoolGe
31970static int __Pyx_PyObject_CompareFloatIntBoolGe(PyObject *op1, PyObject *op2) {
31971 double float_op1 = __Pyx_PyFloat_AS_DOUBLE(op1);
31972 #if !CYTHON_ASSUME_SAFE_MACROS
31973 if (unlikely(float_op1 == -1. && PyErr_Occurred()))
return -1;
31975 #if CYTHON_USE_PYLONG_INTERNALS
31976 if (__Pyx_PyLong_IsCompact(op2)) {
31977 Py_ssize_t iop2 = __Pyx_PyLong_CompactValue(op2);
31978 if (float_op1 >= ((
double)iop2))
goto __pyx_return_true;
else goto __pyx_return_false;
31980 if (unlikely(!isfinite(float_op1))) {
31981 if (float_op1 >= 0.0)
goto __pyx_return_true;
else goto __pyx_return_false;
31983 int sign2 = __Pyx_PyLong_Sign(op2);
31984 if (float_op1 >= 0.) {
31985 if (sign2 < 0)
goto __pyx_return_true;
31986 if (float_op1 < (
double) (1L << PyLong_SHIFT))
goto __pyx_return_false;
31988 if (sign2 > 0)
goto __pyx_return_false;
31989 if (float_op1 > -(
double) (1L << PyLong_SHIFT))
goto __pyx_return_true;
31993 if (unlikely(!isfinite(float_op1))) {
31994 if (float_op1 >= 0.0)
goto __pyx_return_true;
else goto __pyx_return_false;
31997 long iop2 = PyLong_AsLongAndOverflow(op2, &overflow2);
31998 if (likely(!overflow2)) {
31999 if ((
long long) iop2 >= (1LL << 53)) {
32001 }
else if ((
long long) iop2 <= - (1LL << 53)) {
32004 if (float_op1 >= ((
double) iop2))
goto __pyx_return_true;
else goto __pyx_return_false;
32007 if (overflow2 > 0) {
32008 if (float_op1 < ((
double) (1LL << 53)))
goto __pyx_return_false;
32010 if (float_op1 > - ((
double) (1LL << 53)))
goto __pyx_return_true;
32014 return __Pyx_PyObject_RichCompareBool(op1, op2, Py_GE);
32021#ifndef __Pyx_DEFINED_PyObject_CompareIntIntBoolGe
32022#define __Pyx_DEFINED_PyObject_CompareIntIntBoolGe
32023static int __Pyx_PyObject_CompareIntIntBoolGe(PyObject *op1, PyObject *op2) {
32024#if CYTHON_USE_PYLONG_INTERNALS
32025 Py_ssize_t cmp = __Pyx_PyLong_CompareSignAndSize(op1, op2);
32027 Py_ssize_t size = __Pyx_PyLong_DigitCount(op1);
32029 const digit* digits1 = __Pyx_PyLong_Digits(op1);
32030 const digit* digits2 = __Pyx_PyLong_Digits(op2);
32032 cmp = (Py_ssize_t) digits1[0] - (Py_ssize_t) digits2[0];
32033 }
else if ((size == 2) && (8 *
sizeof(Py_ssize_t) >= 2 * PyLong_SHIFT)) {
32034 cmp = (Py_ssize_t) (((((
size_t)digits1[1]) << PyLong_SHIFT) | (
size_t)digits1[0])) - (Py_ssize_t) (((((
size_t)digits2[1]) << PyLong_SHIFT) | (
size_t)digits2[0]));
32036 for (Py_ssize_t i=size-1; i >= 0 && !cmp; --i) {
32037 cmp = (Py_ssize_t) digits1[i] - (Py_ssize_t) digits2[i];
32041 if (cmp == 0)
goto __pyx_return_true;
32042 if (__Pyx_PyLong_IsNeg(op1)) cmp = -cmp;
32044 if (cmp < 0)
goto __pyx_return_false;
else goto __pyx_return_true;
32046 int overflow1, overflow2;
32047 long long iop1 = PyLong_AsLongLongAndOverflow(op1, &overflow1);
32048 long long iop2 = PyLong_AsLongLongAndOverflow(op2, &overflow2);
32049 if (likely(!(overflow1 | overflow2))) {
32050 if (iop1 >= iop2)
goto __pyx_return_true;
else goto __pyx_return_false;
32051 }
else if (overflow1 != overflow2) {
32052 if (overflow1 >= overflow2)
goto __pyx_return_true;
else goto __pyx_return_false;
32054 return __Pyx_PyObject_RichCompareBool(op1, op2, Py_GE);
32063static CYTHON_INLINE
int __Pyx_PyObject_CompareBoolGe_object_int(PyObject *op1, PyObject *op2,
int pyop) {
32064 CYTHON_UNUSED_VAR(pyop);
32065 if (unlikely(op2 == Py_None)) {
32066 goto __pyx_richcmp;
32068 if (op1 == op2)
goto __pyx_return_true;
32069 if (PyFloat_CheckExact(op1)) {
32070 if (likely(op2 != Py_None)) {
32071 return __Pyx_PyObject_CompareFloatIntBoolGe(op1, op2);
32073 goto __pyx_richcmp;
32075 if (likely(PyLong_CheckExact(op1))) {
32076 if (op1 == op2)
goto __pyx_return_true;
32077 if (likely(op2 != Py_None)) {
32078 return __Pyx_PyObject_CompareIntIntBoolGe(op1, op2);
32080 goto __pyx_richcmp;
32082 if ((0))
goto __pyx_richcmp;
32083 if ((0))
goto __pyx_return_true;
32084 if ((0))
goto __pyx_return_false;
32086 return __Pyx_PyObject_RichCompareBool(op1, op2, Py_GE);
32094#ifndef __Pyx_DEFINED_PyObject_CompareStrStrBoolLe
32095#define __Pyx_DEFINED_PyObject_CompareStrStrBoolLe
32096static CYTHON_INLINE
int __Pyx_PyObject_CompareStrStrBoolLe(PyObject* s1, PyObject* s2) {
32097 int result = PyUnicode_Compare(s1, s2);
32098 if (unlikely((result == -1) && PyErr_Occurred()))
return -1;
32099 if (result <= 0)
goto __pyx_return_true;
else goto __pyx_return_false;
32106#if !(CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_GRAAL)
32107#ifndef __Pyx_DEFINED_PyObject_ComparePyBytesPyBytesBoolLe
32108#define __Pyx_DEFINED_PyObject_ComparePyBytesPyBytesBoolLe
32109static CYTHON_INLINE
int __Pyx_PyObject_ComparePyBytesPyBytesBoolLe(PyObject* s1, PyObject* s2) {
32111 Py_ssize_t length1, length2, short_length;
32112 #if CYTHON_ASSUME_SAFE_SIZE && CYTHON_ASSUME_SAFE_MACROS
32113 const char *ps1, *ps2;
32114 length1 = __Pyx_PyBytes_GET_SIZE(s1);
32115 length2 = __Pyx_PyBytes_GET_SIZE(s2);
32116 short_length = (length1 < length2) ? length1 : length2;
32117 if (short_length == 0) {
32118 if (length1 == 0)
goto __pyx_return_true;
else goto __pyx_return_false;
32120 ps1 = PyBytes_AS_STRING(s1);
32121 ps2 = PyBytes_AS_STRING(s2);
32124 if (unlikely(PyBytes_AsStringAndSize(s1, &ps1, &length1) == -1))
return -1;
32125 if (unlikely(PyBytes_AsStringAndSize(s2, &ps2, &length2) == -1))
return -1;
32126 short_length = (length1 < length2) ? length1 : length2;
32127 if (short_length == 0) {
32128 if (length1 == 0)
goto __pyx_return_true;
else goto __pyx_return_false;
32131 cmp = (Py_ssize_t) ((
const unsigned char*) ps1)[0] - (Py_ssize_t) ((
const unsigned char*) ps2)[0];
32132 if (cmp == 0 && short_length > 1) {
32133 cmp = memcmp(ps1, ps2, (
size_t)short_length);
32135 if (cmp == 0) cmp = (length1 - length2);
32136 if (cmp <= 0)
goto __pyx_return_true;
else goto __pyx_return_false;
32144#if !(CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_GRAAL)
32145#ifndef __Pyx_DEFINED_PyObject_ComparePyBytesPyByteArrayBoolLe
32146#define __Pyx_DEFINED_PyObject_ComparePyBytesPyByteArrayBoolLe
32147static CYTHON_INLINE
int __Pyx_PyObject_ComparePyBytesPyByteArrayBoolLe(PyObject* s1, PyObject* s2) {
32149 Py_ssize_t length1, length2, short_length;
32150 #if CYTHON_ASSUME_SAFE_SIZE && CYTHON_ASSUME_SAFE_MACROS
32151 const char *ps1, *ps2;
32152 length1 = __Pyx_PyBytes_GET_SIZE(s1);
32153 length2 = __Pyx_PyByteArray_GET_SIZE(s2);
32154 short_length = (length1 < length2) ? length1 : length2;
32155 if (short_length == 0) {
32156 if (length1 == 0)
goto __pyx_return_true;
else goto __pyx_return_false;
32158 ps1 = PyBytes_AS_STRING(s1);
32159 ps2 = PyByteArray_AS_STRING(s2);
32162 if (unlikely(PyBytes_AsStringAndSize(s1, &ps1, &length1) == -1))
return -1;
32163 ps2 = __Pyx_PyByteArray_AsString(s2);
if (unlikely(!ps2))
return -1;
32164 length2 = __Pyx_PyByteArray_GET_SIZE(s2);
if (unlikely(length2 == -1))
return -1;
32165 short_length = (length1 < length2) ? length1 : length2;
32166 if (short_length == 0) {
32167 if (length1 == 0)
goto __pyx_return_true;
else goto __pyx_return_false;
32170 cmp = (Py_ssize_t) ((
const unsigned char*) ps1)[0] - (Py_ssize_t) ((
const unsigned char*) ps2)[0];
32171 if (cmp == 0 && short_length > 1) {
32172 cmp = memcmp(ps1, ps2, (
size_t)short_length);
32174 if (cmp == 0) cmp = (length1 - length2);
32175 if (cmp <= 0)
goto __pyx_return_true;
else goto __pyx_return_false;
32183#if !(CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_GRAAL)
32184#ifndef __Pyx_DEFINED_PyObject_ComparePyByteArrayPyBytesBoolLe
32185#define __Pyx_DEFINED_PyObject_ComparePyByteArrayPyBytesBoolLe
32186static CYTHON_INLINE
int __Pyx_PyObject_ComparePyByteArrayPyBytesBoolLe(PyObject* s1, PyObject* s2) {
32188 Py_ssize_t length1, length2, short_length;
32189 #if CYTHON_ASSUME_SAFE_SIZE && CYTHON_ASSUME_SAFE_MACROS
32190 const char *ps1, *ps2;
32191 length1 = __Pyx_PyByteArray_GET_SIZE(s1);
32192 length2 = __Pyx_PyBytes_GET_SIZE(s2);
32193 short_length = (length1 < length2) ? length1 : length2;
32194 if (short_length == 0) {
32195 if (length1 == 0)
goto __pyx_return_true;
else goto __pyx_return_false;
32197 ps1 = PyByteArray_AS_STRING(s1);
32198 ps2 = PyBytes_AS_STRING(s2);
32201 ps1 = __Pyx_PyByteArray_AsString(s1);
if (unlikely(!ps1))
return -1;
32202 length1 = __Pyx_PyByteArray_GET_SIZE(s1);
if (unlikely(length1 == -1))
return -1;
32203 if (unlikely(PyBytes_AsStringAndSize(s2, &ps2, &length2) == -1))
return -1;
32204 short_length = (length1 < length2) ? length1 : length2;
32205 if (short_length == 0) {
32206 if (length1 == 0)
goto __pyx_return_true;
else goto __pyx_return_false;
32209 cmp = (Py_ssize_t) ((
const unsigned char*) ps1)[0] - (Py_ssize_t) ((
const unsigned char*) ps2)[0];
32210 if (cmp == 0 && short_length > 1) {
32211 cmp = memcmp(ps1, ps2, (
size_t)short_length);
32213 if (cmp == 0) cmp = (length1 - length2);
32214 if (cmp <= 0)
goto __pyx_return_true;
else goto __pyx_return_false;
32222#if !(CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_GRAAL)
32223#ifndef __Pyx_DEFINED_PyObject_ComparePyByteArrayPyByteArrayBoolLe
32224#define __Pyx_DEFINED_PyObject_ComparePyByteArrayPyByteArrayBoolLe
32225static CYTHON_INLINE
int __Pyx_PyObject_ComparePyByteArrayPyByteArrayBoolLe(PyObject* s1, PyObject* s2) {
32227 Py_ssize_t length1, length2, short_length;
32228 #if CYTHON_ASSUME_SAFE_SIZE && CYTHON_ASSUME_SAFE_MACROS
32229 const char *ps1, *ps2;
32230 length1 = __Pyx_PyByteArray_GET_SIZE(s1);
32231 length2 = __Pyx_PyByteArray_GET_SIZE(s2);
32232 short_length = (length1 < length2) ? length1 : length2;
32233 if (short_length == 0) {
32234 if (length1 == 0)
goto __pyx_return_true;
else goto __pyx_return_false;
32236 ps1 = PyByteArray_AS_STRING(s1);
32237 ps2 = PyByteArray_AS_STRING(s2);
32240 ps1 = __Pyx_PyByteArray_AsString(s1);
if (unlikely(!ps1))
return -1;
32241 length1 = __Pyx_PyByteArray_GET_SIZE(s1);
if (unlikely(length1 == -1))
return -1;
32242 ps2 = __Pyx_PyByteArray_AsString(s2);
if (unlikely(!ps2))
return -1;
32243 length2 = __Pyx_PyByteArray_GET_SIZE(s2);
if (unlikely(length2 == -1))
return -1;
32244 short_length = (length1 < length2) ? length1 : length2;
32245 if (short_length == 0) {
32246 if (length1 == 0)
goto __pyx_return_true;
else goto __pyx_return_false;
32249 cmp = (Py_ssize_t) ((
const unsigned char*) ps1)[0] - (Py_ssize_t) ((
const unsigned char*) ps2)[0];
32250 if (cmp == 0 && short_length > 1) {
32251 cmp = memcmp(ps1, ps2, (
size_t)short_length);
32253 if (cmp == 0) cmp = (length1 - length2);
32254 if (cmp <= 0)
goto __pyx_return_true;
else goto __pyx_return_false;
32262#ifndef __Pyx_DEFINED_PyObject_CompareFloatIntBoolLe
32263#define __Pyx_DEFINED_PyObject_CompareFloatIntBoolLe
32264static int __Pyx_PyObject_CompareFloatIntBoolLe(PyObject *op1, PyObject *op2) {
32265 double float_op1 = __Pyx_PyFloat_AS_DOUBLE(op1);
32266 #if !CYTHON_ASSUME_SAFE_MACROS
32267 if (unlikely(float_op1 == -1. && PyErr_Occurred()))
return -1;
32269 #if CYTHON_USE_PYLONG_INTERNALS
32270 if (__Pyx_PyLong_IsCompact(op2)) {
32271 Py_ssize_t iop2 = __Pyx_PyLong_CompactValue(op2);
32272 if (float_op1 <= ((
double)iop2))
goto __pyx_return_true;
else goto __pyx_return_false;
32274 if (unlikely(!isfinite(float_op1))) {
32275 if (float_op1 <= 0.0)
goto __pyx_return_true;
else goto __pyx_return_false;
32277 int sign2 = __Pyx_PyLong_Sign(op2);
32278 if (float_op1 >= 0.) {
32279 if (sign2 < 0)
goto __pyx_return_false;
32280 if (float_op1 < (
double) (1L << PyLong_SHIFT))
goto __pyx_return_true;
32282 if (sign2 > 0)
goto __pyx_return_true;
32283 if (float_op1 > -(
double) (1L << PyLong_SHIFT))
goto __pyx_return_false;
32287 if (unlikely(!isfinite(float_op1))) {
32288 if (float_op1 <= 0.0)
goto __pyx_return_true;
else goto __pyx_return_false;
32291 long iop2 = PyLong_AsLongAndOverflow(op2, &overflow2);
32292 if (likely(!overflow2)) {
32293 if ((
long long) iop2 >= (1LL << 53)) {
32295 }
else if ((
long long) iop2 <= - (1LL << 53)) {
32298 if (float_op1 <= ((
double) iop2))
goto __pyx_return_true;
else goto __pyx_return_false;
32301 if (overflow2 > 0) {
32302 if (float_op1 < ((
double) (1LL << 53)))
goto __pyx_return_true;
32304 if (float_op1 > - ((
double) (1LL << 53)))
goto __pyx_return_false;
32308 return __Pyx_PyObject_RichCompareBool(op1, op2, Py_LE);
32315#ifndef __Pyx_DEFINED_PyObject_CompareIntFloatBoolLe
32316#define __Pyx_DEFINED_PyObject_CompareIntFloatBoolLe
32317static int __Pyx_PyObject_CompareIntFloatBoolLe(PyObject *op1, PyObject *op2) {
32318 double float_op2 = __Pyx_PyFloat_AS_DOUBLE(op2);
32319 #if !CYTHON_ASSUME_SAFE_MACROS
32320 if (unlikely(float_op2 == -1. && PyErr_Occurred()))
return -1;
32322 #if CYTHON_USE_PYLONG_INTERNALS
32323 if (__Pyx_PyLong_IsCompact(op1)) {
32324 Py_ssize_t iop1 = __Pyx_PyLong_CompactValue(op1);
32325 if (((
double)iop1) <= float_op2)
goto __pyx_return_true;
else goto __pyx_return_false;
32327 if (unlikely(!isfinite(float_op2))) {
32328 if (0.0 <= float_op2)
goto __pyx_return_true;
else goto __pyx_return_false;
32330 int sign1 = __Pyx_PyLong_Sign(op1);
32331 if (float_op2 >= 0.) {
32332 if (sign1 < 0)
goto __pyx_return_true;
32333 if (float_op2 < (
double) (1L << PyLong_SHIFT))
goto __pyx_return_false;
32335 if (sign1 > 0)
goto __pyx_return_false;
32336 if (float_op2 > -(
double) (1L << PyLong_SHIFT))
goto __pyx_return_true;
32340 if (unlikely(!isfinite(float_op2))) {
32341 if (0.0 <= float_op2)
goto __pyx_return_true;
else goto __pyx_return_false;
32344 long iop1 = PyLong_AsLongAndOverflow(op1, &overflow1);
32345 if (likely(!overflow1)) {
32346 if ((
long long) iop1 >= (1LL << 53)) {
32348 }
else if ((
long long) iop1 <= - (1LL << 53)) {
32351 if (((
double) iop1) <= float_op2)
goto __pyx_return_true;
else goto __pyx_return_false;
32354 if (overflow1 < 0) {
32355 if (float_op2 > ((
double) (1LL << 53)))
goto __pyx_return_true;
32357 if (float_op2 < - ((
double) (1LL << 53)))
goto __pyx_return_false;
32361 return __Pyx_PyObject_RichCompareBool(op1, op2, Py_LE);
32368#ifndef __Pyx_DEFINED_PyObject_CompareIntIntBoolLe
32369#define __Pyx_DEFINED_PyObject_CompareIntIntBoolLe
32370static int __Pyx_PyObject_CompareIntIntBoolLe(PyObject *op1, PyObject *op2) {
32371#if CYTHON_USE_PYLONG_INTERNALS
32372 Py_ssize_t cmp = __Pyx_PyLong_CompareSignAndSize(op1, op2);
32374 Py_ssize_t size = __Pyx_PyLong_DigitCount(op1);
32376 const digit* digits1 = __Pyx_PyLong_Digits(op1);
32377 const digit* digits2 = __Pyx_PyLong_Digits(op2);
32379 cmp = (Py_ssize_t) digits1[0] - (Py_ssize_t) digits2[0];
32380 }
else if ((size == 2) && (8 *
sizeof(Py_ssize_t) >= 2 * PyLong_SHIFT)) {
32381 cmp = (Py_ssize_t) (((((
size_t)digits1[1]) << PyLong_SHIFT) | (
size_t)digits1[0])) - (Py_ssize_t) (((((
size_t)digits2[1]) << PyLong_SHIFT) | (
size_t)digits2[0]));
32383 for (Py_ssize_t i=size-1; i >= 0 && !cmp; --i) {
32384 cmp = (Py_ssize_t) digits1[i] - (Py_ssize_t) digits2[i];
32388 if (cmp == 0)
goto __pyx_return_true;
32389 if (__Pyx_PyLong_IsNeg(op1)) cmp = -cmp;
32391 if (cmp < 0)
goto __pyx_return_true;
else goto __pyx_return_false;
32393 int overflow1, overflow2;
32394 long long iop1 = PyLong_AsLongLongAndOverflow(op1, &overflow1);
32395 long long iop2 = PyLong_AsLongLongAndOverflow(op2, &overflow2);
32396 if (likely(!(overflow1 | overflow2))) {
32397 if (iop1 <= iop2)
goto __pyx_return_true;
else goto __pyx_return_false;
32398 }
else if (overflow1 != overflow2) {
32399 if (overflow1 <= overflow2)
goto __pyx_return_true;
else goto __pyx_return_false;
32401 return __Pyx_PyObject_RichCompareBool(op1, op2, Py_LE);
32410static CYTHON_INLINE
int __Pyx_PyObject_CompareBoolLe_object_object(PyObject *op1, PyObject *op2,
int pyop) {
32411 CYTHON_UNUSED_VAR(pyop);
32412 if (PyFloat_CheckExact(op1)) {
32413 if (PyFloat_CheckExact(op2)) {
32414 double float_op1 = __Pyx_PyFloat_AS_DOUBLE(op1);
32415 #if !CYTHON_ASSUME_SAFE_MACROS
32416 if (unlikely(float_op1 == -1. && PyErr_Occurred()))
return -1;
32418 double float_op2 = __Pyx_PyFloat_AS_DOUBLE(op2);
32419 #if !CYTHON_ASSUME_SAFE_MACROS
32420 if (unlikely(float_op2 == -1. && PyErr_Occurred()))
return -1;
32422 if (float_op1 <= float_op2)
goto __pyx_return_true;
else goto __pyx_return_false;
32424 if (PyLong_CheckExact(op2)) {
32425 return __Pyx_PyObject_CompareFloatIntBoolLe(op1, op2);
32427 goto __pyx_richcmp;
32429 if (PyLong_CheckExact(op1)) {
32430 if (op1 == op2)
goto __pyx_return_true;
32431 if (PyLong_CheckExact(op2)) {
32432 return __Pyx_PyObject_CompareIntIntBoolLe(op1, op2);
32434 if (PyFloat_CheckExact(op2)) {
32435 return __Pyx_PyObject_CompareIntFloatBoolLe(op1, op2);
32437 goto __pyx_richcmp;
32440 if (PyUnicode_CheckExact(op1)) {
32441 if (op1 == op2)
goto __pyx_return_true;
32442 if (PyUnicode_CheckExact(op2)) {
32443 return __Pyx_PyObject_CompareStrStrBoolLe(op1, op2);
32445 goto __pyx_richcmp;
32448 #if !(CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_GRAAL)
32449 if (PyBytes_CheckExact(op1)) {
32450 if (op1 == op2)
goto __pyx_return_true;
32451 if (PyBytes_CheckExact(op2)) {
32452 return __Pyx_PyObject_ComparePyBytesPyBytesBoolLe(op1, op2);
32454 if (PyByteArray_CheckExact(op2)) {
32455 return __Pyx_PyObject_ComparePyBytesPyByteArrayBoolLe(op1, op2);
32457 goto __pyx_richcmp;
32460 #if !(CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_GRAAL)
32461 if (PyByteArray_CheckExact(op1)) {
32462 if (op1 == op2)
goto __pyx_return_true;
32463 if (PyByteArray_CheckExact(op2)) {
32464 return __Pyx_PyObject_ComparePyByteArrayPyByteArrayBoolLe(op1, op2);
32466 if (PyBytes_CheckExact(op2)) {
32467 return __Pyx_PyObject_ComparePyByteArrayPyBytesBoolLe(op1, op2);
32469 goto __pyx_richcmp;
32472 if ((0))
goto __pyx_richcmp;
32473 if ((0))
goto __pyx_return_true;
32474 if ((0))
goto __pyx_return_false;
32476 return __Pyx_PyObject_RichCompareBool(op1, op2, Py_LE);
32484#ifndef __Pyx_DEFINED_PyObject_CompareStrStrBoolGt
32485#define __Pyx_DEFINED_PyObject_CompareStrStrBoolGt
32486static CYTHON_INLINE
int __Pyx_PyObject_CompareStrStrBoolGt(PyObject* s1, PyObject* s2) {
32487 int result = PyUnicode_Compare(s1, s2);
32488 if (unlikely((result == -1) && PyErr_Occurred()))
return -1;
32489 if (result > 0)
goto __pyx_return_true;
else goto __pyx_return_false;
32496#if !(CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_GRAAL)
32497#ifndef __Pyx_DEFINED_PyObject_ComparePyBytesPyBytesBoolGt
32498#define __Pyx_DEFINED_PyObject_ComparePyBytesPyBytesBoolGt
32499static CYTHON_INLINE
int __Pyx_PyObject_ComparePyBytesPyBytesBoolGt(PyObject* s1, PyObject* s2) {
32501 Py_ssize_t length1, length2, short_length;
32502 #if CYTHON_ASSUME_SAFE_SIZE && CYTHON_ASSUME_SAFE_MACROS
32503 const char *ps1, *ps2;
32504 length1 = __Pyx_PyBytes_GET_SIZE(s1);
32505 length2 = __Pyx_PyBytes_GET_SIZE(s2);
32506 short_length = (length1 < length2) ? length1 : length2;
32507 if (short_length == 0) {
32508 if (length1 == 0)
goto __pyx_return_false;
else goto __pyx_return_true;
32510 ps1 = PyBytes_AS_STRING(s1);
32511 ps2 = PyBytes_AS_STRING(s2);
32514 if (unlikely(PyBytes_AsStringAndSize(s1, &ps1, &length1) == -1))
return -1;
32515 if (unlikely(PyBytes_AsStringAndSize(s2, &ps2, &length2) == -1))
return -1;
32516 short_length = (length1 < length2) ? length1 : length2;
32517 if (short_length == 0) {
32518 if (length1 == 0)
goto __pyx_return_false;
else goto __pyx_return_true;
32521 cmp = (Py_ssize_t) ((
const unsigned char*) ps1)[0] - (Py_ssize_t) ((
const unsigned char*) ps2)[0];
32522 if (cmp == 0 && short_length > 1) {
32523 cmp = memcmp(ps1, ps2, (
size_t)short_length);
32525 if (cmp == 0) cmp = (length1 - length2);
32526 if (cmp > 0)
goto __pyx_return_true;
else goto __pyx_return_false;
32534#if !(CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_GRAAL)
32535#ifndef __Pyx_DEFINED_PyObject_ComparePyBytesPyByteArrayBoolGt
32536#define __Pyx_DEFINED_PyObject_ComparePyBytesPyByteArrayBoolGt
32537static CYTHON_INLINE
int __Pyx_PyObject_ComparePyBytesPyByteArrayBoolGt(PyObject* s1, PyObject* s2) {
32539 Py_ssize_t length1, length2, short_length;
32540 #if CYTHON_ASSUME_SAFE_SIZE && CYTHON_ASSUME_SAFE_MACROS
32541 const char *ps1, *ps2;
32542 length1 = __Pyx_PyBytes_GET_SIZE(s1);
32543 length2 = __Pyx_PyByteArray_GET_SIZE(s2);
32544 short_length = (length1 < length2) ? length1 : length2;
32545 if (short_length == 0) {
32546 if (length1 == 0)
goto __pyx_return_false;
else goto __pyx_return_true;
32548 ps1 = PyBytes_AS_STRING(s1);
32549 ps2 = PyByteArray_AS_STRING(s2);
32552 if (unlikely(PyBytes_AsStringAndSize(s1, &ps1, &length1) == -1))
return -1;
32553 ps2 = __Pyx_PyByteArray_AsString(s2);
if (unlikely(!ps2))
return -1;
32554 length2 = __Pyx_PyByteArray_GET_SIZE(s2);
if (unlikely(length2 == -1))
return -1;
32555 short_length = (length1 < length2) ? length1 : length2;
32556 if (short_length == 0) {
32557 if (length1 == 0)
goto __pyx_return_false;
else goto __pyx_return_true;
32560 cmp = (Py_ssize_t) ((
const unsigned char*) ps1)[0] - (Py_ssize_t) ((
const unsigned char*) ps2)[0];
32561 if (cmp == 0 && short_length > 1) {
32562 cmp = memcmp(ps1, ps2, (
size_t)short_length);
32564 if (cmp == 0) cmp = (length1 - length2);
32565 if (cmp > 0)
goto __pyx_return_true;
else goto __pyx_return_false;
32573#if !(CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_GRAAL)
32574#ifndef __Pyx_DEFINED_PyObject_ComparePyByteArrayPyBytesBoolGt
32575#define __Pyx_DEFINED_PyObject_ComparePyByteArrayPyBytesBoolGt
32576static CYTHON_INLINE
int __Pyx_PyObject_ComparePyByteArrayPyBytesBoolGt(PyObject* s1, PyObject* s2) {
32578 Py_ssize_t length1, length2, short_length;
32579 #if CYTHON_ASSUME_SAFE_SIZE && CYTHON_ASSUME_SAFE_MACROS
32580 const char *ps1, *ps2;
32581 length1 = __Pyx_PyByteArray_GET_SIZE(s1);
32582 length2 = __Pyx_PyBytes_GET_SIZE(s2);
32583 short_length = (length1 < length2) ? length1 : length2;
32584 if (short_length == 0) {
32585 if (length1 == 0)
goto __pyx_return_false;
else goto __pyx_return_true;
32587 ps1 = PyByteArray_AS_STRING(s1);
32588 ps2 = PyBytes_AS_STRING(s2);
32591 ps1 = __Pyx_PyByteArray_AsString(s1);
if (unlikely(!ps1))
return -1;
32592 length1 = __Pyx_PyByteArray_GET_SIZE(s1);
if (unlikely(length1 == -1))
return -1;
32593 if (unlikely(PyBytes_AsStringAndSize(s2, &ps2, &length2) == -1))
return -1;
32594 short_length = (length1 < length2) ? length1 : length2;
32595 if (short_length == 0) {
32596 if (length1 == 0)
goto __pyx_return_false;
else goto __pyx_return_true;
32599 cmp = (Py_ssize_t) ((
const unsigned char*) ps1)[0] - (Py_ssize_t) ((
const unsigned char*) ps2)[0];
32600 if (cmp == 0 && short_length > 1) {
32601 cmp = memcmp(ps1, ps2, (
size_t)short_length);
32603 if (cmp == 0) cmp = (length1 - length2);
32604 if (cmp > 0)
goto __pyx_return_true;
else goto __pyx_return_false;
32612#if !(CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_GRAAL)
32613#ifndef __Pyx_DEFINED_PyObject_ComparePyByteArrayPyByteArrayBoolGt
32614#define __Pyx_DEFINED_PyObject_ComparePyByteArrayPyByteArrayBoolGt
32615static CYTHON_INLINE
int __Pyx_PyObject_ComparePyByteArrayPyByteArrayBoolGt(PyObject* s1, PyObject* s2) {
32617 Py_ssize_t length1, length2, short_length;
32618 #if CYTHON_ASSUME_SAFE_SIZE && CYTHON_ASSUME_SAFE_MACROS
32619 const char *ps1, *ps2;
32620 length1 = __Pyx_PyByteArray_GET_SIZE(s1);
32621 length2 = __Pyx_PyByteArray_GET_SIZE(s2);
32622 short_length = (length1 < length2) ? length1 : length2;
32623 if (short_length == 0) {
32624 if (length1 == 0)
goto __pyx_return_false;
else goto __pyx_return_true;
32626 ps1 = PyByteArray_AS_STRING(s1);
32627 ps2 = PyByteArray_AS_STRING(s2);
32630 ps1 = __Pyx_PyByteArray_AsString(s1);
if (unlikely(!ps1))
return -1;
32631 length1 = __Pyx_PyByteArray_GET_SIZE(s1);
if (unlikely(length1 == -1))
return -1;
32632 ps2 = __Pyx_PyByteArray_AsString(s2);
if (unlikely(!ps2))
return -1;
32633 length2 = __Pyx_PyByteArray_GET_SIZE(s2);
if (unlikely(length2 == -1))
return -1;
32634 short_length = (length1 < length2) ? length1 : length2;
32635 if (short_length == 0) {
32636 if (length1 == 0)
goto __pyx_return_false;
else goto __pyx_return_true;
32639 cmp = (Py_ssize_t) ((
const unsigned char*) ps1)[0] - (Py_ssize_t) ((
const unsigned char*) ps2)[0];
32640 if (cmp == 0 && short_length > 1) {
32641 cmp = memcmp(ps1, ps2, (
size_t)short_length);
32643 if (cmp == 0) cmp = (length1 - length2);
32644 if (cmp > 0)
goto __pyx_return_true;
else goto __pyx_return_false;
32652#ifndef __Pyx_DEFINED_PyObject_CompareFloatIntBoolGt
32653#define __Pyx_DEFINED_PyObject_CompareFloatIntBoolGt
32654static int __Pyx_PyObject_CompareFloatIntBoolGt(PyObject *op1, PyObject *op2) {
32655 double float_op1 = __Pyx_PyFloat_AS_DOUBLE(op1);
32656 #if !CYTHON_ASSUME_SAFE_MACROS
32657 if (unlikely(float_op1 == -1. && PyErr_Occurred()))
return -1;
32659 #if CYTHON_USE_PYLONG_INTERNALS
32660 if (__Pyx_PyLong_IsCompact(op2)) {
32661 Py_ssize_t iop2 = __Pyx_PyLong_CompactValue(op2);
32662 if (float_op1 > ((
double)iop2))
goto __pyx_return_true;
else goto __pyx_return_false;
32664 if (unlikely(!isfinite(float_op1))) {
32665 if (float_op1 > 0.0)
goto __pyx_return_true;
else goto __pyx_return_false;
32667 int sign2 = __Pyx_PyLong_Sign(op2);
32668 if (float_op1 >= 0.) {
32669 if (sign2 < 0)
goto __pyx_return_true;
32670 if (float_op1 < (
double) (1L << PyLong_SHIFT))
goto __pyx_return_false;
32672 if (sign2 > 0)
goto __pyx_return_false;
32673 if (float_op1 > -(
double) (1L << PyLong_SHIFT))
goto __pyx_return_true;
32677 if (unlikely(!isfinite(float_op1))) {
32678 if (float_op1 > 0.0)
goto __pyx_return_true;
else goto __pyx_return_false;
32681 long iop2 = PyLong_AsLongAndOverflow(op2, &overflow2);
32682 if (likely(!overflow2)) {
32683 if ((
long long) iop2 >= (1LL << 53)) {
32685 }
else if ((
long long) iop2 <= - (1LL << 53)) {
32688 if (float_op1 > ((
double) iop2))
goto __pyx_return_true;
else goto __pyx_return_false;
32691 if (overflow2 > 0) {
32692 if (float_op1 < ((
double) (1LL << 53)))
goto __pyx_return_false;
32694 if (float_op1 > - ((
double) (1LL << 53)))
goto __pyx_return_true;
32698 return __Pyx_PyObject_RichCompareBool(op1, op2, Py_GT);
32705#ifndef __Pyx_DEFINED_PyObject_CompareIntFloatBoolGt
32706#define __Pyx_DEFINED_PyObject_CompareIntFloatBoolGt
32707static int __Pyx_PyObject_CompareIntFloatBoolGt(PyObject *op1, PyObject *op2) {
32708 double float_op2 = __Pyx_PyFloat_AS_DOUBLE(op2);
32709 #if !CYTHON_ASSUME_SAFE_MACROS
32710 if (unlikely(float_op2 == -1. && PyErr_Occurred()))
return -1;
32712 #if CYTHON_USE_PYLONG_INTERNALS
32713 if (__Pyx_PyLong_IsCompact(op1)) {
32714 Py_ssize_t iop1 = __Pyx_PyLong_CompactValue(op1);
32715 if (((
double)iop1) > float_op2)
goto __pyx_return_true;
else goto __pyx_return_false;
32717 if (unlikely(!isfinite(float_op2))) {
32718 if (0.0 > float_op2)
goto __pyx_return_true;
else goto __pyx_return_false;
32720 int sign1 = __Pyx_PyLong_Sign(op1);
32721 if (float_op2 >= 0.) {
32722 if (sign1 < 0)
goto __pyx_return_false;
32723 if (float_op2 < (
double) (1L << PyLong_SHIFT))
goto __pyx_return_true;
32725 if (sign1 > 0)
goto __pyx_return_true;
32726 if (float_op2 > -(
double) (1L << PyLong_SHIFT))
goto __pyx_return_false;
32730 if (unlikely(!isfinite(float_op2))) {
32731 if (0.0 > float_op2)
goto __pyx_return_true;
else goto __pyx_return_false;
32734 long iop1 = PyLong_AsLongAndOverflow(op1, &overflow1);
32735 if (likely(!overflow1)) {
32736 if ((
long long) iop1 >= (1LL << 53)) {
32738 }
else if ((
long long) iop1 <= - (1LL << 53)) {
32741 if (((
double) iop1) > float_op2)
goto __pyx_return_true;
else goto __pyx_return_false;
32744 if (overflow1 < 0) {
32745 if (float_op2 > ((
double) (1LL << 53)))
goto __pyx_return_false;
32747 if (float_op2 < - ((
double) (1LL << 53)))
goto __pyx_return_true;
32751 return __Pyx_PyObject_RichCompareBool(op1, op2, Py_GT);
32758#ifndef __Pyx_DEFINED_PyObject_CompareIntIntBoolGt
32759#define __Pyx_DEFINED_PyObject_CompareIntIntBoolGt
32760static int __Pyx_PyObject_CompareIntIntBoolGt(PyObject *op1, PyObject *op2) {
32761#if CYTHON_USE_PYLONG_INTERNALS
32762 Py_ssize_t cmp = __Pyx_PyLong_CompareSignAndSize(op1, op2);
32764 Py_ssize_t size = __Pyx_PyLong_DigitCount(op1);
32766 const digit* digits1 = __Pyx_PyLong_Digits(op1);
32767 const digit* digits2 = __Pyx_PyLong_Digits(op2);
32769 cmp = (Py_ssize_t) digits1[0] - (Py_ssize_t) digits2[0];
32770 }
else if ((size == 2) && (8 *
sizeof(Py_ssize_t) >= 2 * PyLong_SHIFT)) {
32771 cmp = (Py_ssize_t) (((((
size_t)digits1[1]) << PyLong_SHIFT) | (
size_t)digits1[0])) - (Py_ssize_t) (((((
size_t)digits2[1]) << PyLong_SHIFT) | (
size_t)digits2[0]));
32773 for (Py_ssize_t i=size-1; i >= 0 && !cmp; --i) {
32774 cmp = (Py_ssize_t) digits1[i] - (Py_ssize_t) digits2[i];
32778 if (cmp == 0)
goto __pyx_return_false;
32779 if (__Pyx_PyLong_IsNeg(op1)) cmp = -cmp;
32781 if (cmp < 0)
goto __pyx_return_false;
else goto __pyx_return_true;
32783 int overflow1, overflow2;
32784 long long iop1 = PyLong_AsLongLongAndOverflow(op1, &overflow1);
32785 long long iop2 = PyLong_AsLongLongAndOverflow(op2, &overflow2);
32786 if (likely(!(overflow1 | overflow2))) {
32787 if (iop1 > iop2)
goto __pyx_return_true;
else goto __pyx_return_false;
32788 }
else if (overflow1 != overflow2) {
32789 if (overflow1 > overflow2)
goto __pyx_return_true;
else goto __pyx_return_false;
32791 return __Pyx_PyObject_RichCompareBool(op1, op2, Py_GT);
32800static CYTHON_INLINE
int __Pyx_PyObject_CompareBoolGt_object_object(PyObject *op1, PyObject *op2,
int pyop) {
32801 CYTHON_UNUSED_VAR(pyop);
32802 if (PyFloat_CheckExact(op1)) {
32803 if (PyFloat_CheckExact(op2)) {
32804 double float_op1 = __Pyx_PyFloat_AS_DOUBLE(op1);
32805 #if !CYTHON_ASSUME_SAFE_MACROS
32806 if (unlikely(float_op1 == -1. && PyErr_Occurred()))
return -1;
32808 double float_op2 = __Pyx_PyFloat_AS_DOUBLE(op2);
32809 #if !CYTHON_ASSUME_SAFE_MACROS
32810 if (unlikely(float_op2 == -1. && PyErr_Occurred()))
return -1;
32812 if (float_op1 > float_op2)
goto __pyx_return_true;
else goto __pyx_return_false;
32814 if (PyLong_CheckExact(op2)) {
32815 return __Pyx_PyObject_CompareFloatIntBoolGt(op1, op2);
32817 goto __pyx_richcmp;
32819 if (PyLong_CheckExact(op1)) {
32820 if (op1 == op2)
goto __pyx_return_false;
32821 if (PyLong_CheckExact(op2)) {
32822 return __Pyx_PyObject_CompareIntIntBoolGt(op1, op2);
32824 if (PyFloat_CheckExact(op2)) {
32825 return __Pyx_PyObject_CompareIntFloatBoolGt(op1, op2);
32827 goto __pyx_richcmp;
32830 if (PyUnicode_CheckExact(op1)) {
32831 if (op1 == op2)
goto __pyx_return_false;
32832 if (PyUnicode_CheckExact(op2)) {
32833 return __Pyx_PyObject_CompareStrStrBoolGt(op1, op2);
32835 goto __pyx_richcmp;
32838 #if !(CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_GRAAL)
32839 if (PyBytes_CheckExact(op1)) {
32840 if (op1 == op2)
goto __pyx_return_false;
32841 if (PyBytes_CheckExact(op2)) {
32842 return __Pyx_PyObject_ComparePyBytesPyBytesBoolGt(op1, op2);
32844 if (PyByteArray_CheckExact(op2)) {
32845 return __Pyx_PyObject_ComparePyBytesPyByteArrayBoolGt(op1, op2);
32847 goto __pyx_richcmp;
32850 #if !(CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_GRAAL)
32851 if (PyByteArray_CheckExact(op1)) {
32852 if (op1 == op2)
goto __pyx_return_false;
32853 if (PyByteArray_CheckExact(op2)) {
32854 return __Pyx_PyObject_ComparePyByteArrayPyByteArrayBoolGt(op1, op2);
32856 if (PyBytes_CheckExact(op2)) {
32857 return __Pyx_PyObject_ComparePyByteArrayPyBytesBoolGt(op1, op2);
32859 goto __pyx_richcmp;
32862 if ((0))
goto __pyx_richcmp;
32863 if ((0))
goto __pyx_return_true;
32864 if ((0))
goto __pyx_return_false;
32866 return __Pyx_PyObject_RichCompareBool(op1, op2, Py_GT);
32874#if !(CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_GRAAL || CYTHON_COMPILING_IN_LIMITED_API)
32875#if CYTHON_USE_TYPE_SLOTS || __PYX_LIMITED_VERSION_HEX >= 0x030A0000
32876#ifndef __Pyx_DEFINED_BinopTypeError
32877#define __Pyx_DEFINED_BinopTypeError
32878static void __Pyx_BinopTypeError(PyObject *op1, PyObject *op2,
const char* op,
int inplace) {
32879 char opname[4] = {op[0], op[1], 0, 0};
32881 opname[op[1] ? 2 : 1] =
'=';
32883 __Pyx_RaiseErrorWithObjectTypes1(
32885 "unsupported operand type(s) for %.3s: '" __Pyx_FMT_TYPENAME
"' and '" __Pyx_FMT_TYPENAME
"'",
32890#ifndef __Pyx_DEFINED_PyNumber_Subtract_xfloat_object
32891#define __Pyx_DEFINED_PyNumber_Subtract_xfloat_object
32892static PyObject* __Pyx_PyNumber_Subtract_xfloat_object(PyObject *op1, PyObject *op2,
int inplace) {
32893 if (PyLong_CheckExact(op2)) {
32895 #if CYTHON_USE_PYLONG_INTERNALS
32896 if (__Pyx_PyLong_IsCompact(op2)) {
32897 Py_ssize_t compact_op2 = __Pyx_PyLong_CompactValue(op2);
32898 if (compact_op2 == 0)
return __Pyx_NewRef(op1);
32899 int_op2 = (double) compact_op2;
32903 int_op2 = PyLong_AsDouble(op2);
32904 if (unlikely((int_op2 == -1.) && PyErr_Occurred()))
return NULL;
32905 #if !CYTHON_USE_PYLONG_INTERNALS
32906 if (int_op2 == 0.)
return __Pyx_NewRef(op1);
32909 double float_op1 = __Pyx_PyFloat_AS_DOUBLE(op1);
32910 #if !CYTHON_ASSUME_SAFE_MACROS
32911 if (unlikely((float_op1 == -1.) && PyErr_Occurred()))
return NULL;
32913 return PyFloat_FromDouble(float_op1 - int_op2);
32915 if (PyLong_Check(op2)) {
32916 binaryfunc slot_func = __Pyx_PyType_GetSubSlot(&PyFloat_Type, tp_as_number, nb_subtract, binaryfunc);
32917 if (likely(slot_func)) {
32918 return slot_func(op1, op2);
32921 #if CYTHON_USE_TYPE_SLOTS || __PYX_LIMITED_VERSION_HEX >= 0x030A0000
32923 PyTypeObject *type_op2 = Py_TYPE(op2);
32924 binaryfunc slot_func = __Pyx_PyType_GetSubSlot(type_op2, tp_as_number, nb_subtract, binaryfunc);
32925 if (likely(slot_func)) {
32926 PyObject *result = slot_func(op1, op2);
32927 if (likely(result != Py_NotImplemented)) {
32932 __Pyx_BinopTypeError(op1, op2,
"-", inplace);
32936 return (inplace) ? PyNumber_InPlaceSubtract(op1, op2) : PyNumber_Subtract(op1, op2);
32940#ifndef __Pyx_DEFINED_PyNumber_Subtract_xint_object
32941#define __Pyx_DEFINED_PyNumber_Subtract_xint_object
32942static PyObject* __Pyx_PyNumber_Subtract_xint_object(PyObject *op1, PyObject *op2,
int inplace) {
32943 if (PyFloat_CheckExact(op2)) {
32945 #if CYTHON_USE_PYLONG_INTERNALS
32946 if (__Pyx_PyLong_IsCompact(op1)) {
32947 Py_ssize_t compact_op1 = __Pyx_PyLong_CompactValue(op1);
32948 int_op1 = (double) compact_op1;
32952 int_op1 = PyLong_AsDouble(op1);
32953 if (unlikely((int_op1 == -1.) && PyErr_Occurred()))
return NULL;
32955 double float_op2 = __Pyx_PyFloat_AS_DOUBLE(op2);
32956 #if !CYTHON_ASSUME_SAFE_MACROS
32957 if (unlikely((float_op2 == -1.) && PyErr_Occurred()))
return NULL;
32959 return PyFloat_FromDouble(int_op1 - float_op2);
32961 #if CYTHON_USE_TYPE_SLOTS || __PYX_LIMITED_VERSION_HEX >= 0x030A0000
32963 PyTypeObject *type_op2 = Py_TYPE(op2);
32964 binaryfunc slot_func = __Pyx_PyType_GetSubSlot(type_op2, tp_as_number, nb_subtract, binaryfunc);
32965 if (likely(slot_func)) {
32966 PyObject *result = slot_func(op1, op2);
32967 if (likely(result != Py_NotImplemented)) {
32972 __Pyx_BinopTypeError(op1, op2,
"-", inplace);
32976 return (inplace) ? PyNumber_InPlaceSubtract(op1, op2) : PyNumber_Subtract(op1, op2);
32980static CYTHON_INLINE PyObject* __Pyx__PyNumber_Subtract_object_object(PyObject *op1, PyObject *op2,
int inplace) {
32981 if (PyFloat_CheckExact(op1)) {
32982 if (PyFloat_CheckExact(op2)) {
32983 double float_op2 = __Pyx_PyFloat_AS_DOUBLE(op2);
32984 #if !CYTHON_ASSUME_SAFE_MACROS
32985 if (unlikely((float_op2 == -1.) && PyErr_Occurred()))
return NULL;
32987 double float_op1 = __Pyx_PyFloat_AS_DOUBLE(op1);
32988 #if !CYTHON_ASSUME_SAFE_MACROS
32989 if (unlikely((float_op1 == -1.) && PyErr_Occurred()))
return NULL;
32991 return PyFloat_FromDouble(float_op1 - float_op2);
32993 return __Pyx_PyNumber_Subtract_xfloat_object(op1, op2, inplace);
32995 if (PyLong_CheckExact(op1)) {
32996 if (PyLong_CheckExact(op2)) {
32997 #if CYTHON_USE_PYLONG_INTERNALS
32998 if (__Pyx_PyLong_IsCompact(op1)) {
32999 Py_ssize_t int_op1 = __Pyx_PyLong_CompactValue(op1);
33000 if (__Pyx_PyLong_IsCompact(op2)) {
33001 Py_ssize_t int_op2 = __Pyx_PyLong_CompactValue(op2);
33002 if (int_op2 == 0)
return __Pyx_NewRef(op1);
33003 return PyLong_FromSsize_t(int_op1 - int_op2);
33006 else if (__Pyx_PyLong_IsZero(op2))
return __Pyx_NewRef(op1);
33008 binaryfunc slot_func = __Pyx_PyType_GetSubSlot(&PyLong_Type, tp_as_number, nb_subtract, binaryfunc);
33009 if (likely(slot_func)) {
33010 return slot_func(op1, op2);
33013 return __Pyx_PyNumber_Subtract_xint_object(op1, op2, inplace);
33015 return (inplace) ? PyNumber_InPlaceSubtract(op1, op2) : PyNumber_Subtract(op1, op2);
33020static CYTHON_INLINE PyObject* __Pyx_PyObject_GetSlice(PyObject* obj,
33021 Py_ssize_t cstart, Py_ssize_t cstop,
33022 PyObject** _py_start, PyObject** _py_stop, PyObject** _py_slice,
33023 int has_cstart,
int has_cstop, CYTHON_UNUSED
int wraparound) {
33024#if CYTHON_USE_TYPE_SLOTS
33025 PyMappingMethods* mp = Py_TYPE(obj)->tp_as_mapping;
33026 if (likely(mp && mp->mp_subscript))
33032 PyObject *py_slice, *py_start, *py_stop;
33034 py_slice = *_py_slice;
33036 PyObject* owned_start = NULL;
33037 PyObject* owned_stop = NULL;
33039 py_start = *_py_start;
33042 owned_start = py_start = PyLong_FromSsize_t(cstart);
33043 if (unlikely(!py_start))
goto bad;
33045 py_start = Py_None;
33048 py_stop = *_py_stop;
33051 owned_stop = py_stop = PyLong_FromSsize_t(cstop);
33052 if (unlikely(!py_stop)) {
33053 Py_XDECREF(owned_start);
33059 py_slice = PySlice_New(py_start, py_stop, Py_None);
33060 Py_XDECREF(owned_start);
33061 Py_XDECREF(owned_stop);
33062 if (unlikely(!py_slice))
goto bad;
33064#if CYTHON_USE_TYPE_SLOTS
33065 result = mp->mp_subscript(obj, py_slice);
33067 result = PyObject_GetItem(obj, py_slice);
33070 Py_DECREF(py_slice);
33074 __Pyx_RaiseTypeErrorWithObjectType(
33075 "'" __Pyx_FMT_TYPENAME
"' object is unsliceable", obj);
33082static void __Pyx_PyBuiltin_Invalid(PyObject *obj,
const char *builtin_type_name,
const char *argname) {
33083 __Pyx_TypeName obj_type_name = __Pyx_PyType_GetFullyQualifiedName(Py_TYPE(obj));
33084 #if CYTHON_COMPILING_IN_LIMITED_API && __PYX_LIMITED_VERSION_HEX < 0x030d0000
33085 if (unlikely(!obj_type_name))
return;
33088 PyErr_Format(PyExc_TypeError,
33089 "Argument '%.200s' has incorrect type (expected %.5s, got " __Pyx_FMT_TYPENAME
")",
33090 argname, builtin_type_name, obj_type_name
33093 PyErr_Format(PyExc_TypeError,
33094 "Expected %.5s, got " __Pyx_FMT_TYPENAME,
33095 builtin_type_name, obj_type_name
33098 __Pyx_DECREF_TypeName(obj_type_name);
33102static int __Pyx__PyInt_FromNumber(PyObject **number_var,
const char *argname);
33103static CYTHON_INLINE
int __Pyx_PyInt_FromNumber(PyObject **number_var,
const char *argname,
int accept_none) {
33104 PyObject *
number = *number_var;
33105 if (likely((accept_none &&
number == Py_None) || PyLong_CheckExact(
number))) {
33108 return __Pyx__PyInt_FromNumber(number_var, argname);
33110static int __Pyx__PyInt_FromNumber(PyObject **number_var,
const char *argname) {
33111 PyObject *
number = *number_var;
33112 PyObject *int_object;
33113 if (likely(PyNumber_Check(
number))) {
33114 int_object = PyNumber_Long(
number);
33115 if (unlikely(!int_object))
goto bad;
33117 __Pyx_PyBuiltin_Invalid(
number,
"int", argname);
33120 *number_var = int_object;
33124 *number_var = NULL;
33130static PyObject *__Pyx_AllocateExtensionType(PyTypeObject *t,
int is_final) {
33131 if (is_final || likely(!__Pyx_PyType_HasFeature(t, Py_TPFLAGS_IS_ABSTRACT))) {
33132 allocfunc alloc_func = __Pyx_PyType_GetSlot(t, tp_alloc, allocfunc);
33133 return alloc_func(t, 0);
33135 newfunc tp_new = __Pyx_PyType_TryGetSlot(&PyBaseObject_Type, tp_new, newfunc);
33136 #if CYTHON_COMPILING_IN_LIMITED_API && __PYX_LIMITED_VERSION_HEX < 0x030A0000
33138 PyObject *new_str = PyUnicode_FromString(
"__new__");
33139 if (likely(new_str)) {
33140 PyObject *o = PyObject_CallMethodObjArgs((PyObject *)&PyBaseObject_Type, new_str, t, NULL);
33141 Py_DECREF(new_str);
33147 return tp_new(t, __pyx_mstate_global->__pyx_empty_tuple, 0);
33152static CYTHON_INLINE
int __Pyx_CallSlotAsVectorcallUnpackDict(Py_ssize_t args_size, PyObject *keys_dict, PyObject **args, PyObject *kwnames) {
33153 Py_ssize_t pos = 0, i = 0;
33154 PyObject *key, *value;
33155 while (PyDict_Next(keys_dict, &pos, &key, &value)) {
33157 args[args_size+i] = value;
33159 if (unlikely(__Pyx_PyTuple_SET_ITEM(kwnames, i, key) == -1)) {
33168#if CYTHON_VECTORCALL_TPNEW
33169static PyObject * __Pyx_CallTpnewAsVectorcall(__Pyx_tpnewvectorcallfunc
f, PyTypeObject* o, PyObject *a, PyObject *k) {
33170 Py_ssize_t k_size = k ? __Pyx_PyDict_GET_SIZE(k) : 0;
33171#if !CYTHON_ASSUME_SAFE_SIZE
33172 if (unlikely(k_size < 0))
return NULL;
33174 Py_ssize_t a_size = __Pyx_PyTuple_GET_SIZE(a);
33175#if !CYTHON_ASSUME_SAFE_SIZE
33176 if (unlikely(a_size < 0))
return NULL;
33178#if CYTHON_ASSUME_SAFE_MACROS
33180 return f(o, &PyTuple_GET_ITEM(a, 0), a_size, NULL);
33183 if (k_size == 0 && a_size == 0) {
33184 return f(o, NULL, 0, NULL);
33187 PyObject *stack_args[5];
33188 PyObject **args = stack_args;
33189 Py_ssize_t maxnargs = PY_SSIZE_T_MAX /
sizeof(PyObject*) - 1;
33190 if (a_size > maxnargs - k_size) {
33194 Py_ssize_t total_size = a_size + k_size;
33195 if (total_size > 5) {
33196 args = (PyObject**)PyMem_Malloc(((
size_t)total_size)*
sizeof(PyObject*));
33197 if (unlikely(!args)) {
33202 PyObject * result = NULL;
33203 PyObject *kwnames = NULL;
33204 int unpack_dict_result;
33206 for (; i < a_size; ++i) {
33207 args[i] = __Pyx_PyTuple_GET_ITEM(a, i);
33208#if !CYTHON_ASSUME_SAFE_MACROS
33209 if (unlikely(!args[i]))
goto cleanup;
33212#if !CYTHON_ASSUME_SAFE_MACROS
33216 kwnames = PyTuple_New(k_size);
33217 if (unlikely(!kwnames))
goto cleanup;
33218 __Pyx_BEGIN_CRITICAL_SECTION(k);
33219 unpack_dict_result = __Pyx_CallSlotAsVectorcallUnpackDict(a_size, k, args, kwnames);
33220 __Pyx_END_CRITICAL_SECTION();
33221 if (unlikely(unpack_dict_result == -1))
goto cleanup;
33223 result =
f(o, args, a_size, kwnames);
33225 Py_XDECREF(kwnames);
33226 for (i=a_size; i<total_size; ++i) {
33227 Py_XDECREF(args[i]);
33229 if (args != stack_args) {
33237#if CYTHON_VECTORCALL_TPNEW
33238static PyObject *__Pyx_CallNewInitFromVectorcall(PyTypeObject *t, PyObject *
const *args,
size_t nargsf, PyObject *kwnames) {
33239 newfunc tp_new = __Pyx_PyType_GetSlot(t, tp_new, newfunc);
33240 if (unlikely(!tp_new)) {
33241 __Pyx_RaiseErrorWithType(PyExc_TypeError,
"cannot create " __Pyx_FMT_TYPENAME
" instances", t);
33244 Py_ssize_t nargs = __Pyx_PyVectorcall_NARGS(nargsf);
33245 PyObject *result = NULL, *args_tuple = NULL, *kwds_dict = NULL;
33246 Py_ssize_t kw_size = kwnames ? __Pyx_PyTuple_GET_SIZE(kwnames) : 0;
33247#if !CYTHON_ASSUME_SAFE_SIZE
33248 if (unlikely(kw_size == -1)) {
33253 kwds_dict = __Pyx_PyDict_NewPresized(kw_size);
33254 if (unlikely(!kwds_dict)) {
33257 for (Py_ssize_t i=0; i<kw_size; ++i) {
33258 PyObject *
v = args[nargs + i];
33259 PyObject *k = __Pyx_PyTuple_GET_ITEM(kwnames, i);
33260#if !CYTHON_ASSUME_SAFE_MACROS
33261 if (unlikely(!k)) {
33265 if (unlikely(PyDict_SetItem(kwds_dict, k,
v) < 0)) {
33271 args_tuple = __Pyx_PyTuple_FromArray(args, nargs);
33272 if (unlikely(!args_tuple)) {
33276 args_tuple = __Pyx_NewRef(__pyx_mstate_global->__pyx_empty_tuple);
33278 result = tp_new(t, args_tuple, kwds_dict);
33279 if (unlikely(!result)) {
33282 if (PyObject_TypeCheck(result, t)) {
33283 initproc tp_init = __Pyx_PyObject_GetSlot(result, tp_init, initproc);
33284 if (tp_init && unlikely(tp_init(result, args_tuple, kwds_dict) < 0)) {
33289 Py_XDECREF(args_tuple);
33290 Py_XDECREF(kwds_dict);
33296#if CYTHON_VECTORCALL_TPNEW
33297static int __Pyx_CallTpinitAsVectorcall(__Pyx_tpinitvectorcallfunc
f, PyObject* o, PyObject *a, PyObject *k) {
33298 Py_ssize_t k_size = k ? __Pyx_PyDict_GET_SIZE(k) : 0;
33299#if !CYTHON_ASSUME_SAFE_SIZE
33300 if (unlikely(k_size < 0))
return -1;
33302 Py_ssize_t a_size = __Pyx_PyTuple_GET_SIZE(a);
33303#if !CYTHON_ASSUME_SAFE_SIZE
33304 if (unlikely(a_size < 0))
return -1;
33306#if CYTHON_ASSUME_SAFE_MACROS
33308 return f(o, &PyTuple_GET_ITEM(a, 0), a_size, NULL);
33311 if (k_size == 0 && a_size == 0) {
33312 return f(o, NULL, 0, NULL);
33315 PyObject *stack_args[5];
33316 PyObject **args = stack_args;
33317 Py_ssize_t maxnargs = PY_SSIZE_T_MAX /
sizeof(PyObject*) - 1;
33318 if (a_size > maxnargs - k_size) {
33322 Py_ssize_t total_size = a_size + k_size;
33323 if (total_size > 5) {
33324 args = (PyObject**)PyMem_Malloc(((
size_t)total_size)*
sizeof(PyObject*));
33325 if (unlikely(!args)) {
33331 PyObject *kwnames = NULL;
33332 int unpack_dict_result;
33334 for (; i < a_size; ++i) {
33335 args[i] = __Pyx_PyTuple_GET_ITEM(a, i);
33336#if !CYTHON_ASSUME_SAFE_MACROS
33337 if (unlikely(!args[i]))
goto cleanup;
33340#if !CYTHON_ASSUME_SAFE_MACROS
33344 kwnames = PyTuple_New(k_size);
33345 if (unlikely(!kwnames))
goto cleanup;
33346 __Pyx_BEGIN_CRITICAL_SECTION(k);
33347 unpack_dict_result = __Pyx_CallSlotAsVectorcallUnpackDict(a_size, k, args, kwnames);
33348 __Pyx_END_CRITICAL_SECTION();
33349 if (unlikely(unpack_dict_result == -1))
goto cleanup;
33351 result =
f(o, args, a_size, kwnames);
33353 Py_XDECREF(kwnames);
33354 for (i=a_size; i<total_size; ++i) {
33355 Py_XDECREF(args[i]);
33357 if (args != stack_args) {
33365#if !CYTHON_USE_TYPE_SPECS
33367static int __Pyx_call_type_traverse(PyObject *o,
int always_call, visitproc visit,
void *arg) {
33368 if (!always_call) {
33369 PyTypeObject *base = __Pyx_PyObject_GetSlot(o, tp_base, PyTypeObject*);
33370 unsigned long flags = PyType_GetFlags(base);
33371 if (flags & Py_TPFLAGS_HEAPTYPE) {
33375 Py_VISIT((PyObject*)Py_TYPE(o));
33381static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethod0(PyObject* obj, PyObject* method_name) {
33382#if CYTHON_VECTORCALL && (__PYX_LIMITED_VERSION_HEX >= 0x030C0000 || !CYTHON_COMPILING_IN_LIMITED_API)
33383 return PyObject_VectorcallMethod(method_name, &obj, 1 | PY_VECTORCALL_ARGUMENTS_OFFSET, NULL);
33384#elif CYTHON_COMPILING_IN_LIMITED_API
33385 return PyObject_CallMethodObjArgs(obj, method_name, NULL);
33387 return PyObject_CallMethodNoArgs(obj, method_name);
33392#if !CYTHON_USE_TYPE_SLOTS
33393CYTHON_UNUSED
static Py_ssize_t __Pyx_GetTypeDictOffset(PyObject *tp,
int require_cython_valid_result) {
33394 PyObject *tp_dictoffset_o;
33395 Py_ssize_t tp_dictoffset;
33396 tp_dictoffset_o = PyObject_GetAttrString(tp,
"__dictoffset__");
33397 if (unlikely(!tp_dictoffset_o))
return -1;
33398 tp_dictoffset = PyLong_AsSsize_t(tp_dictoffset_o);
33399 Py_DECREF(tp_dictoffset_o);
33400 if (unlikely(require_cython_valid_result && tp_dictoffset == 0)) {
33403 "'type' doesn't have a dictoffset");
33405 }
else if (unlikely(require_cython_valid_result && tp_dictoffset < 0)) {
33408 "'type' has an unexpected negative dictoffset. "
33409 "Please report this as Cython bug");
33412 return tp_dictoffset;
33417#if CYTHON_COMPILING_IN_CPYTHON || CYTHON_COMPILING_IN_LIMITED_API || CYTHON_USE_TYPE_SPECS
33418static int __Pyx_validate_bases_tuple(
const char *type_name,
int has_dictoffset, PyObject *bases) {
33420#if CYTHON_ASSUME_SAFE_SIZE
33421 n = PyTuple_GET_SIZE(bases);
33423 n = PyTuple_Size(bases);
33424 if (unlikely(
n < 0))
return -1;
33426 if (!has_dictoffset) {
33428#if CYTHON_AVOID_BORROWED_REFS
33429 b = PySequence_GetItem(bases, 0);
33431#elif CYTHON_ASSUME_SAFE_MACROS
33432 b = PyTuple_GET_ITEM(bases, 0);
33434 b = PyTuple_GetItem(bases, 0);
33437#if CYTHON_USE_TYPE_SLOTS
33438 has_dictoffset = ((PyTypeObject*)b)->tp_dictoffset != 0;
33440 Py_ssize_t dictoffset = __Pyx_GetTypeDictOffset(b, 0);
33441 has_dictoffset = dictoffset != 0;
33443#if CYTHON_AVOID_BORROWED_REFS
33446#if !CYTHON_USE_TYPE_SLOTS
33447 if (dictoffset == -1 && PyErr_Occurred())
return -1;
33450 for (i = 1; i <
n; i++)
33453#if CYTHON_AVOID_BORROWED_REFS
33454 PyObject *b0 = PySequence_GetItem(bases, i);
33455 if (!b0)
return -1;
33456#elif CYTHON_ASSUME_SAFE_MACROS
33457 PyObject *b0 = PyTuple_GET_ITEM(bases, i);
33459 PyObject *b0 = PyTuple_GetItem(bases, i);
33460 if (!b0)
return -1;
33462 b = (PyTypeObject*) b0;
33463 if (!__Pyx_PyType_HasFeature(b, Py_TPFLAGS_HEAPTYPE))
33465 __Pyx_RaiseErrorWithType(
33466 PyExc_TypeError,
"base class '" __Pyx_FMT_TYPENAME
"' is not a heap type", b);
33467#if CYTHON_AVOID_BORROWED_REFS
33472 if (!has_dictoffset)
33474 Py_ssize_t b_dictoffset = 0;
33475#if CYTHON_USE_TYPE_SLOTS
33476 b_dictoffset = b->tp_dictoffset;
33478 b_dictoffset = __Pyx_GetTypeDictOffset((PyObject*)b, 0);
33479 if (b_dictoffset == -1 && PyErr_Occurred())
goto dictoffset_return;
33481 if (b_dictoffset) {
33482 __Pyx_RaiseErrorWithType1(
33484 "extension type '%.200s' has no __dict__ slot, "
33485 "but base type '" __Pyx_FMT_TYPENAME
"' has: "
33486 "either add 'cdef dict __dict__' to the extension type "
33487 "or add '__slots__ = [...]' to the base type",
33489#if !CYTHON_USE_TYPE_SLOTS
33492#if CYTHON_AVOID_BORROWED_REFS
33498#if CYTHON_AVOID_BORROWED_REFS
33507CYTHON_UNUSED
static int __Pyx_PyType_HasMultipleInheritance(PyTypeObject *t) {
33509 PyObject *bases = __Pyx_PyType_GetSlot(t, tp_bases, PyObject*);
33513 t = __Pyx_PyType_GetSlot(t, tp_base, PyTypeObject*);
33517static int __Pyx_PyType_Ready(PyTypeObject *t) {
33518#if CYTHON_USE_TYPE_SPECS || !CYTHON_COMPILING_IN_CPYTHON
33519 (void)__Pyx_PyObject_CallMethod0;
33520#if CYTHON_USE_TYPE_SPECS
33521 (void)__Pyx_validate_bases_tuple;
33523 return PyType_Ready(t);
33526 if (!__Pyx_PyType_HasMultipleInheritance(t)) {
33527 return PyType_Ready(t);
33529 PyObject *bases = __Pyx_PyType_GetSlot(t, tp_bases, PyObject*);
33530 if (bases && unlikely(__Pyx_validate_bases_tuple(t->tp_name, t->tp_dictoffset != 0, bases) == -1))
33533 int gc_was_enabled;
33534 #if PY_VERSION_HEX >= 0x030A00b1
33535 gc_was_enabled = PyGC_Disable();
33536 (void)__Pyx_PyObject_CallMethod0;
33538 PyObject *ret, *py_status;
33539 PyObject *gc = NULL;
33540 #if (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM+0 >= 0x07030400) &&\
33541 !CYTHON_COMPILING_IN_GRAAL
33542 gc = PyImport_GetModule(__pyx_mstate_global->__pyx_kp_u_gc);
33544 if (unlikely(!gc)) gc = PyImport_Import(__pyx_mstate_global->__pyx_kp_u_gc);
33545 if (unlikely(!gc))
return -1;
33546 py_status = __Pyx_PyObject_CallMethod0(gc, __pyx_mstate_global->__pyx_kp_u_isenabled);
33547 if (unlikely(!py_status)) {
33551 gc_was_enabled = __Pyx_PyObject_IsTrue(py_status);
33552 Py_DECREF(py_status);
33553 if (gc_was_enabled > 0) {
33554 ret = __Pyx_PyObject_CallMethod0(gc, __pyx_mstate_global->__pyx_kp_u_disable);
33555 if (unlikely(!ret)) {
33560 }
else if (unlikely(gc_was_enabled == -1)) {
33565 t->tp_flags |= Py_TPFLAGS_HEAPTYPE;
33566#if PY_VERSION_HEX >= 0x030A0000
33567 t->tp_flags |= Py_TPFLAGS_IMMUTABLETYPE;
33569 r = PyType_Ready(t);
33570 t->tp_flags &= ~Py_TPFLAGS_HEAPTYPE;
33571 #if PY_VERSION_HEX >= 0x030A00b1
33572 if (gc_was_enabled)
33575 if (gc_was_enabled) {
33576 PyObject *tp, *
v, *tb;
33577 PyErr_Fetch(&tp, &
v, &tb);
33578 ret = __Pyx_PyObject_CallMethod0(gc, __pyx_mstate_global->__pyx_kp_u_enable);
33579 if (likely(ret ||
r == -1)) {
33581 PyErr_Restore(tp,
v, tb);
33597#if CYTHON_COMPILING_IN_LIMITED_API
33598static PyObject *__Pyx_GetTypeTypeDict(PyTypeObject *tp) {
33599 static Py_ssize_t tp_dictoffset = 0;
33600 if (unlikely(tp_dictoffset == 0)) {
33601 tp_dictoffset = __Pyx_GetTypeDictOffset((PyObject*)(&PyType_Type), 1);
33602 if (unlikely(tp_dictoffset == -1 && PyErr_Occurred())) {
33607 return *(PyObject**)((
char*)tp + tp_dictoffset);
33612static int __Pyx__DelItemOnTypeDict(PyTypeObject *tp, PyObject *k) {
33615#if CYTHON_COMPILING_IN_LIMITED_API
33616 tp_dict = __Pyx_GetTypeTypeDict(tp);
33617 if (unlikely(!tp_dict))
return -1;
33619 tp_dict = tp->tp_dict;
33621 result = PyDict_DelItem(tp_dict, k);
33622 if (likely(!result)) PyType_Modified(tp);
33627static int __Pyx__SetItemOnTypeDict(PyTypeObject *tp, PyObject *k, PyObject *
v) {
33630#if CYTHON_COMPILING_IN_LIMITED_API
33631 tp_dict = __Pyx_GetTypeTypeDict(tp);
33632 if (unlikely(!tp_dict))
return -1;
33634 tp_dict = tp->tp_dict;
33636 result = PyDict_SetItem(tp_dict, k,
v);
33637 if (likely(!result)) {
33638 PyType_Modified(tp);
33639 if (unlikely(PyObject_HasAttr(
v, __pyx_mstate_global->__pyx_n_u_set_name))) {
33640 PyObject *setNameResult = PyObject_CallMethodObjArgs(
v, __pyx_mstate_global->__pyx_n_u_set_name, (PyObject *) tp, k, NULL);
33641 if (!setNameResult)
return -1;
33642 Py_DECREF(setNameResult);
33649static int __Pyx_setup_reduce_is_named(PyObject* meth, PyObject* name) {
33651 PyObject *name_attr;
33652 name_attr = __Pyx_PyObject_GetAttrStrNoError(meth, __pyx_mstate_global->__pyx_n_u_name_2);
33653 if (likely(name_attr)) {
33654 ret = PyObject_RichCompareBool(name_attr, name, Py_EQ);
33658 if (unlikely(ret < 0) && __Pyx_IgnoreException(PyExc_Exception)) {
33661 Py_XDECREF(name_attr);
33664static PyObject *__Pyx_setup_reduce_get_reduce_attribute(PyObject *type_obj, PyObject *name,
int allow_not_present) {
33665#if CYTHON_USE_PYTYPE_LOOKUP
33666 CYTHON_UNUSED_VAR(allow_not_present);
33667 return _PyType_Lookup((PyTypeObject*)type_obj, name);
33669 if (allow_not_present) {
33670 return __Pyx_PyObject_GetAttrStrNoError(type_obj, name);
33672 return __Pyx_PyObject_GetAttrStr(type_obj, name);
33676static int __Pyx_setup_reduce(PyObject* type_obj) {
33678 PyObject *object_reduce = NULL;
33679 PyObject *object_getstate = NULL;
33680 PyObject *object_reduce_ex = NULL;
33681 PyObject *reduce = NULL;
33682 PyObject *reduce_ex = NULL;
33683 PyObject *reduce_cython = NULL;
33684 PyObject *setstate = NULL;
33685 PyObject *setstate_cython = NULL;
33686 PyObject *getstate = NULL;
33687 getstate = __Pyx_setup_reduce_get_reduce_attribute(type_obj, __pyx_mstate_global->__pyx_n_u_getstate, 1);
33688 if (!getstate && PyErr_Occurred()) {
33692 object_getstate = __Pyx_setup_reduce_get_reduce_attribute((PyObject*)&PyBaseObject_Type, __pyx_mstate_global->__pyx_n_u_getstate, 1);
33693 if (!object_getstate && PyErr_Occurred()) {
33696 if (object_getstate != getstate) {
33700 object_reduce_ex = __Pyx_setup_reduce_get_reduce_attribute((PyObject*)&PyBaseObject_Type, __pyx_mstate_global->__pyx_n_u_reduce_ex, 0);
33701 if (unlikely(!object_reduce_ex))
goto __PYX_BAD;
33702 reduce_ex = __Pyx_PyObject_GetAttrStr(type_obj, __pyx_mstate_global->__pyx_n_u_reduce_ex);
if (unlikely(!reduce_ex))
goto __PYX_BAD;
33703 if (reduce_ex == object_reduce_ex) {
33704 object_reduce = __Pyx_setup_reduce_get_reduce_attribute((PyObject*)&PyBaseObject_Type, __pyx_mstate_global->__pyx_n_u_reduce, 0);
33705 if (!object_reduce)
goto __PYX_BAD;
33706 reduce = __Pyx_PyObject_GetAttrStr(type_obj, __pyx_mstate_global->__pyx_n_u_reduce);
if (unlikely(!reduce))
goto __PYX_BAD;
33707 int try_to_replace_reduce = (reduce == object_reduce);
33708 if (!try_to_replace_reduce) {
33709 try_to_replace_reduce = __Pyx_setup_reduce_is_named(reduce, __pyx_mstate_global->__pyx_n_u_reduce_cython);
33710 if (unlikely(try_to_replace_reduce < 0)) {
33714 if (try_to_replace_reduce) {
33715 reduce_cython = __Pyx_PyObject_GetAttrStrNoError(type_obj, __pyx_mstate_global->__pyx_n_u_reduce_cython);
33716 if (likely(reduce_cython)) {
33717 ret = __Pyx_SetItemOnTypeDict((PyTypeObject*)type_obj, __pyx_mstate_global->__pyx_n_u_reduce, reduce_cython);
if (unlikely(ret < 0))
goto __PYX_BAD;
33718 ret = __Pyx_DelItemOnTypeDict((PyTypeObject*)type_obj, __pyx_mstate_global->__pyx_n_u_reduce_cython);
if (unlikely(ret < 0))
goto __PYX_BAD;
33719 }
else if (reduce == object_reduce || PyErr_Occurred()) {
33722 setstate = __Pyx_PyObject_GetAttrStrNoError(type_obj, __pyx_mstate_global->__pyx_n_u_setstate);
33723 int try_to_replace_setstate;
33725 PyObject *exc = PyErr_Occurred();
33726 if (exc && !__Pyx_IgnoreGivenException(exc, PyExc_Exception)) {
33729 try_to_replace_setstate = 1;
33731 try_to_replace_setstate = __Pyx_setup_reduce_is_named(setstate, __pyx_mstate_global->__pyx_n_u_setstate_cython);
33732 if (unlikely(try_to_replace_setstate < 0)) {
33736 if (try_to_replace_setstate) {
33737 setstate_cython = __Pyx_PyObject_GetAttrStrNoError(type_obj, __pyx_mstate_global->__pyx_n_u_setstate_cython);
33738 if (likely(setstate_cython)) {
33739 ret = __Pyx_SetItemOnTypeDict((PyTypeObject*)type_obj, __pyx_mstate_global->__pyx_n_u_setstate, setstate_cython);
if (unlikely(ret < 0))
goto __PYX_BAD;
33740 ret = __Pyx_DelItemOnTypeDict((PyTypeObject*)type_obj, __pyx_mstate_global->__pyx_n_u_setstate_cython);
if (unlikely(ret < 0))
goto __PYX_BAD;
33741 }
else if (!setstate || PyErr_Occurred()) {
33745 PyType_Modified((PyTypeObject*)type_obj);
33750 if (!PyErr_Occurred()) {
33751 __Pyx_RaiseErrorWithType(
33752 PyExc_RuntimeError,
33753 "Unable to initialize pickling for " __Pyx_FMT_TYPENAME,
33754 (PyTypeObject*)type_obj);
33758#if !CYTHON_USE_PYTYPE_LOOKUP
33759 Py_XDECREF(object_reduce);
33760 Py_XDECREF(object_reduce_ex);
33761 Py_XDECREF(object_getstate);
33762 Py_XDECREF(getstate);
33764 Py_XDECREF(reduce);
33765 Py_XDECREF(reduce_ex);
33766 Py_XDECREF(reduce_cython);
33767 Py_XDECREF(setstate);
33768 Py_XDECREF(setstate_cython);
33773static int __Pyx_GetVtable(PyTypeObject *type,
void** table) {
33776#if CYTHON_COMPILING_IN_LIMITED_API
33777 PyObject *ob = PyObject_GetAttr((PyObject *)type, __pyx_mstate_global->__pyx_n_u_pyx_vtable);
33779 PyObject *ob = PyObject_GetItem(type->tp_dict, __pyx_mstate_global->__pyx_n_u_pyx_vtable);
33783 ptr = PyCapsule_GetPointer(ob, 0);
33784 if (!ptr && !PyErr_Occurred())
33785 PyErr_SetString(PyExc_RuntimeError,
"invalid vtable found for imported type");
33790 if (PyErr_ExceptionMatches(CYTHON_COMPILING_IN_LIMITED_API ? PyExc_AttributeError : PyExc_KeyError)) {
33798static int __Pyx_MergeVtables(PyTypeObject *type) {
33801 void** base_vtables;
33802 void* unknown = (
void*)-1;
33803 PyObject* bases = __Pyx_PyType_GetSlot(type, tp_bases, PyObject*);
33804 int base_depth = 0;
33806 PyTypeObject* base = __Pyx_PyType_GetSlot(type, tp_base, PyTypeObject*);
33809 base = __Pyx_PyType_TryGetSlot(base, tp_base, PyTypeObject*);
33812 base_vtables = (
void**) PyMem_Malloc(
sizeof(
void*) * (
size_t)(base_depth + 1));
33813 if (unlikely(!base_vtables)) {
33817 base_vtables[0] = unknown;
33818#if CYTHON_COMPILING_IN_LIMITED_API
33819 size = PyTuple_Size(bases);
33820 if (size < 0)
goto other_failure;
33822 size = PyTuple_GET_SIZE(bases);
33824 for (i = 1; i < size; i++) {
33827#if CYTHON_AVOID_BORROWED_REFS
33828 basei = PySequence_GetItem(bases, i);
33829 if (unlikely(!basei))
goto other_failure;
33830#elif !CYTHON_ASSUME_SAFE_MACROS
33831 basei = PyTuple_GetItem(bases, i);
33832 if (unlikely(!basei))
goto other_failure;
33834 basei = PyTuple_GET_ITEM(bases, i);
33836 int get_vtable_result = __Pyx_GetVtable((PyTypeObject*)basei, &base_vtable);
33837#if CYTHON_AVOID_BORROWED_REFS
33840 if (get_vtable_result != 1) {
33841 if (get_vtable_result == -1) {
33842 goto other_failure;
33846 assert(base_vtable != NULL);
33848 PyTypeObject* base = __Pyx_PyType_TryGetSlot(type, tp_base, PyTypeObject*);
33849#if CYTHON_COMPILING_IN_LIMITED_API && __PYX_LIMITED_VERSION_HEX < 0x030A0000
33850 if (!base)
goto bad;
33852 for (j = 0; j < base_depth; j++) {
33853 if (base_vtables[j] == unknown) {
33854 switch (__Pyx_GetVtable(base, &base_vtables[j])) {
33856 assert(base_vtables[j] == NULL);
33862 goto other_failure;
33864 base_vtables[j + 1] = unknown;
33866 if (base_vtables[j] == base_vtable) {
33869 base = __Pyx_PyType_TryGetSlot(base, tp_base, PyTypeObject*);
33870#if CYTHON_COMPILING_IN_LIMITED_API && __PYX_LIMITED_VERSION_HEX < 0x030A0000
33871 if (!base)
goto bad;
33876 PyMem_Free(base_vtables);
33880 PyTypeObject* tp_base = __Pyx_PyType_GetSlot(type, tp_base, PyTypeObject*);
33881 PyTypeObject* basei;
33882#if CYTHON_AVOID_BORROWED_REFS
33883 basei = (PyTypeObject*)PySequence_GetItem(bases, i);
33884 if (unlikely(!basei))
goto other_failure;
33885#elif !CYTHON_ASSUME_SAFE_MACROS
33886 basei = (PyTypeObject*)PyTuple_GetItem(bases, i);
33887 if (unlikely(!basei))
goto other_failure;
33889 basei = (PyTypeObject*)PyTuple_GET_ITEM(bases, i);
33891 __Pyx_RaiseTypeErrorWithTypes(
33892 "multiple bases have vtable conflict: '" __Pyx_FMT_TYPENAME
"' and '" __Pyx_FMT_TYPENAME
"'", tp_base, basei);
33893#if CYTHON_AVOID_BORROWED_REFS
33898 PyMem_Free(base_vtables);
33903static int __Pyx_SetVtable(PyTypeObject *type,
void *vtable) {
33904 PyObject *ob = PyCapsule_New(vtable, 0, 0);
33907#if CYTHON_COMPILING_IN_LIMITED_API
33908 if (unlikely(PyObject_SetAttr((PyObject *) type, __pyx_mstate_global->__pyx_n_u_pyx_vtable, ob) < 0))
33910 if (unlikely(PyDict_SetItem(type->tp_dict, __pyx_mstate_global->__pyx_n_u_pyx_vtable, ob) < 0))
33914 return __Pyx_MergeVtables(type);
33921#if CYTHON_COMPILING_IN_LIMITED_API || (CYTHON_COMPILING_IN_PYPY && CYTHON_USE_TYPE_SPECS)
33922int __Pyx_ApplySequenceOrMappingFlag(PyTypeObject *tp,
int is_sequence) {
33924 PyObject *collections_abc = PyImport_ImportModule(
"collections.abc");
33925 if (unlikely(!collections_abc))
return -1;
33926 abc = PyObject_GetAttrString(collections_abc, is_sequence ?
"Sequence":
"Mapping");
33927 Py_DECREF(collections_abc);
33928 if (unlikely(!abc))
return -1;
33929 PyObject *register_result = PyObject_CallMethod(abc,
"register",
"O", (PyObject*)tp);
33931 if (unlikely(!register_result))
return -1;
33932 Py_DECREF(register_result);
33935#elif CYTHON_COMPILING_IN_PYPY
33936int __Pyx_ApplySequenceOrMappingFlag(PyTypeObject *tp,
int is_sequence) {
33937 CYTHON_UNUSED_VAR(tp);
33938 CYTHON_UNUSED_VAR(is_sequence);
33939 return PyErr_WarnEx(
33940 PyExc_RuntimeWarning,
33941 "cython.collection_type only works on PyPy with the C flag CYTHON_USE_TYPE_SPECS=1",
33948#ifndef __PYX_HAVE_RT_ImportType_3_3_0
33949#define __PYX_HAVE_RT_ImportType_3_3_0
33950static PyTypeObject *__Pyx_ImportType_3_3_0(PyObject *module,
const char *module_name,
const char *class_name,
33951 size_t size,
size_t alignment,
enum __Pyx_ImportType_CheckSize_3_3_0 check_size)
33953 PyObject *result = 0;
33954 Py_ssize_t basicsize;
33955 Py_ssize_t itemsize;
33956#if defined(Py_LIMITED_API) || (defined(CYTHON_COMPILING_IN_LIMITED_API) && CYTHON_COMPILING_IN_LIMITED_API)
33957 PyObject *py_basicsize;
33958 PyObject *py_itemsize;
33960 result = PyObject_GetAttrString(module, class_name);
33963 if (!PyType_Check(result)) {
33964 PyErr_Format(PyExc_TypeError,
33965 "%.200s.%.200s is not a type object",
33966 module_name, class_name);
33969#if !( defined(Py_LIMITED_API) || (defined(CYTHON_COMPILING_IN_LIMITED_API) && CYTHON_COMPILING_IN_LIMITED_API) )
33970 basicsize = ((PyTypeObject *)result)->tp_basicsize;
33971 itemsize = ((PyTypeObject *)result)->tp_itemsize;
33974 return (PyTypeObject *)result;
33976 py_basicsize = PyObject_GetAttrString(result,
"__basicsize__");
33979 basicsize = PyLong_AsSsize_t(py_basicsize);
33980 Py_DECREF(py_basicsize);
33982 if (basicsize == (Py_ssize_t)-1 && PyErr_Occurred())
33984 py_itemsize = PyObject_GetAttrString(result,
"__itemsize__");
33987 itemsize = PyLong_AsSsize_t(py_itemsize);
33988 Py_DECREF(py_itemsize);
33990 if (itemsize == (Py_ssize_t)-1 && PyErr_Occurred())
33994 if (size % alignment) {
33995 alignment = size % alignment;
33997 if (itemsize < (Py_ssize_t)alignment)
33998 itemsize = (Py_ssize_t)alignment;
34000 if ((
size_t)(basicsize + itemsize) < size) {
34001 PyErr_Format(PyExc_ValueError,
34002 "%.200s.%.200s size changed, may indicate binary incompatibility. "
34003 "Expected %zd from C header, got %zd from PyObject",
34004 module_name, class_name, size, basicsize+itemsize);
34007 if (check_size == __Pyx_ImportType_CheckSize_Error_3_3_0 &&
34008 ((
size_t)basicsize > size || (
size_t)(basicsize + itemsize) < size)) {
34009 PyErr_Format(PyExc_ValueError,
34010 "%.200s.%.200s size changed, may indicate binary incompatibility. "
34011 "Expected %zd from C header, got %zd-%zd from PyObject",
34012 module_name, class_name, size, basicsize, basicsize+itemsize);
34015 else if (check_size == __Pyx_ImportType_CheckSize_Warn_3_3_0 && (
size_t)basicsize > size) {
34016 if (PyErr_WarnFormat(NULL, 0,
34017 "%.200s.%.200s size changed, may indicate binary incompatibility. "
34018 "Expected %zd from C header, got %zd from PyObject",
34019 module_name, class_name, size, basicsize) < 0) {
34023 return (PyTypeObject *)result;
34025 Py_XDECREF(result);
34032__Pyx_PEP560_update_bases(PyObject *bases)
34034 Py_ssize_t i, j, size_bases;
34035 PyObject *base = NULL, *meth, *new_base, *result, *new_bases = NULL;
34036#if CYTHON_ASSUME_SAFE_SIZE
34037 size_bases = PyTuple_GET_SIZE(bases);
34039 size_bases = PyTuple_Size(bases);
34040 if (size_bases < 0)
return NULL;
34042 for (i = 0; i < size_bases; i++) {
34043#if CYTHON_AVOID_BORROWED_REFS
34046#if CYTHON_ASSUME_SAFE_MACROS
34047 base = PyTuple_GET_ITEM(bases, i);
34049 base = PyTuple_GetItem(bases, i);
34050 if (!base)
goto error;
34052#if CYTHON_AVOID_BORROWED_REFS
34055 if (PyType_Check(base)) {
34057 if (PyList_Append(new_bases, base) < 0) {
34063 meth = __Pyx_PyObject_GetAttrStrNoError(base, __pyx_mstate_global->__pyx_n_u_mro_entries);
34064 if (!meth && PyErr_Occurred()) {
34069 if (PyList_Append(new_bases, base) < 0) {
34075 new_base = __Pyx_PyObject_CallOneArg(meth, bases);
34080 if (!PyTuple_Check(new_base)) {
34081 PyErr_SetString(PyExc_TypeError,
34082 "__mro_entries__ must return a tuple");
34083 Py_DECREF(new_base);
34087 if (!(new_bases = PyList_New(i))) {
34090 for (j = 0; j < i; j++) {
34091 PyObject *base_from_list;
34092#if CYTHON_ASSUME_SAFE_MACROS
34093 base_from_list = PyTuple_GET_ITEM(bases, j);
34094 PyList_SET_ITEM(new_bases, j, base_from_list);
34095 Py_INCREF(base_from_list);
34097 base_from_list = PyTuple_GetItem(bases, j);
34098 if (!base_from_list)
goto error;
34099 Py_INCREF(base_from_list);
34100 if (PyList_SetItem(new_bases, j, base_from_list) < 0)
goto error;
34104#if CYTHON_ASSUME_SAFE_SIZE
34105 j = PyList_GET_SIZE(new_bases);
34107 j = PyList_Size(new_bases);
34108 if (j < 0)
goto error;
34110 if (PyList_SetSlice(new_bases, j, j, new_base) < 0) {
34113 Py_DECREF(new_base);
34119 result = PyList_AsTuple(new_bases);
34120 Py_DECREF(new_bases);
34121#if CYTHON_AVOID_BORROWED_REFS
34126 Py_XDECREF(new_bases);
34127#if CYTHON_AVOID_BORROWED_REFS
34134static PyObject *__Pyx_CalculateMetaclass(PyTypeObject *metaclass, PyObject *bases) {
34135 Py_ssize_t i, nbases;
34136#if CYTHON_ASSUME_SAFE_SIZE
34137 nbases = PyTuple_GET_SIZE(bases);
34139 nbases = PyTuple_Size(bases);
34140 if (nbases < 0)
return NULL;
34142 for (i=0; i < nbases; i++) {
34143 PyTypeObject *tmptype;
34144#if CYTHON_ASSUME_SAFE_MACROS
34145 PyObject *tmp = PyTuple_GET_ITEM(bases, i);
34147 PyObject *tmp = PyTuple_GetItem(bases, i);
34148 if (!tmp)
return NULL;
34150 tmptype = Py_TYPE(tmp);
34152 metaclass = tmptype;
34155 if (PyType_IsSubtype(metaclass, tmptype))
34157 if (PyType_IsSubtype(tmptype, metaclass)) {
34158 metaclass = tmptype;
34161 PyErr_SetString(PyExc_TypeError,
34162 "metaclass conflict: "
34163 "the metaclass of a derived class "
34164 "must be a (non-strict) subclass "
34165 "of the metaclasses of all its bases");
34169 metaclass = &PyType_Type;
34171 Py_INCREF((PyObject*) metaclass);
34172 return (PyObject*) metaclass;
34176static CYTHON_INLINE PyObject *__Pyx_PyDict_SetDefault(PyObject *d, PyObject *key, PyObject *default_value) {
34178#if __PYX_LIMITED_VERSION_HEX >= 0x030F0000 || (!CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX >= 0x030d00A4)
34179 PyDict_SetDefaultRef(d, key, default_value, &value);
34180#elif CYTHON_COMPILING_IN_LIMITED_API && __PYX_LIMITED_VERSION_HEX >= 0x030C0000
34181 PyObject *args[] = {d, key, default_value};
34182 value = PyObject_VectorcallMethod(__pyx_mstate_global->__pyx_n_u_setdefault, args, 3 | PY_VECTORCALL_ARGUMENTS_OFFSET, NULL);
34183#elif CYTHON_COMPILING_IN_LIMITED_API
34184 value = PyObject_CallMethodObjArgs(d, __pyx_mstate_global->__pyx_n_u_setdefault, key, default_value, NULL);
34186 value = PyDict_SetDefault(d, key, default_value);
34187 if (unlikely(!value))
return NULL;
34194#if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING && PY_VERSION_HEX < 0x030F00a3
34195 static PyObject *__Pyx_PyImport_AddModuleObjectRef(PyObject *name) {
34196 PyObject *module_dict = PyImport_GetModuleDict();
34198 if (PyMapping_GetOptionalItem(module_dict, name, &m) < 0) {
34201 if (m != NULL && PyModule_Check(m)) {
34205 m = PyModule_NewObject(name);
34208 if (PyDict_CheckExact(module_dict)) {
34210 (void)PyDict_SetDefaultRef(module_dict, name, m, &new_m);
34214 if (PyObject_SetItem(module_dict, name, m) != 0) {
34221 static PyObject *__Pyx_PyImport_AddModuleRef(
const char *name) {
34222 if ((PY_VERSION_HEX >= 0x030E0000) && Py_Version >= 0x030E0100) {
34223 return PyImport_AddModuleRef(name);
34225 PyObject *py_name = PyUnicode_FromString(name);
34226 if (!py_name)
return NULL;
34227 PyObject *module = __Pyx_PyImport_AddModuleObjectRef(py_name);
34228 Py_DECREF(py_name);
34231#elif __PYX_LIMITED_VERSION_HEX < 0x030d0000
34232 static PyObject *__Pyx_PyImport_AddModuleRef(
const char *name) {
34233 PyObject *module = PyImport_AddModule(name);
34234 Py_XINCREF(module);
34240static PyObject *__Pyx_FetchSharedCythonABIModule(
void) {
34241 return __Pyx_PyImport_AddModuleRef(__PYX_ABI_MODULE_NAME);
34245static int __Pyx_VerifyCachedType(PyObject *cached_type,
34247 Py_ssize_t expected_basicsize) {
34248 Py_ssize_t basicsize;
34249 if (!PyType_Check(cached_type)) {
34250 PyErr_Format(PyExc_TypeError,
34251 "Shared Cython type %.200s is not a type object", name);
34254 if (expected_basicsize == 0) {
34257#if CYTHON_COMPILING_IN_LIMITED_API && CYTHON_OPAQUE_OBJECTS
34258 if (expected_basicsize < 0) {
34259 basicsize = PyType_GetTypeDataSize((PyTypeObject*)cached_type);
34263 #if CYTHON_COMPILING_IN_LIMITED_API
34264 PyObject *py_basicsize;
34265 py_basicsize = PyObject_GetAttrString(cached_type,
"__basicsize__");
34266 if (unlikely(!py_basicsize))
return -1;
34267 basicsize = PyLong_AsSsize_t(py_basicsize);
34268 Py_DECREF(py_basicsize);
34269 py_basicsize = NULL;
34270 if (unlikely(basicsize == (Py_ssize_t)-1) && PyErr_Occurred())
return -1;
34272 basicsize = ((PyTypeObject*) cached_type)->tp_basicsize;
34275 if ((expected_basicsize >= 0) ?
34276 (basicsize != expected_basicsize) :
34277 (basicsize < -expected_basicsize)) {
34278 PyErr_Format(PyExc_TypeError,
34279 "Shared Cython type %.200s has the wrong size, try recompiling",
34287#if __PYX_LIMITED_VERSION_HEX < 0x030C0000
34288static PyObject* __Pyx_PyType_FromMetaclass(PyTypeObject *metaclass, PyObject *module, PyType_Spec *spec, PyObject *bases) {
34289 PyObject *result = __Pyx_PyType_FromModuleAndSpec(module, spec, bases);
34290 if (result && metaclass) {
34291 PyObject *old_tp = (PyObject*)Py_TYPE(result);
34292 Py_INCREF((PyObject*)metaclass);
34293 Py_SET_TYPE(result, metaclass);
34295 PyType_Modified((PyTypeObject*)result);
34300#define __Pyx_PyType_FromMetaclass(me, mo, s, b) PyType_FromMetaclass(me, mo, s, b)
34302static PyTypeObject *__Pyx_FetchCommonTypeFromSpec(PyTypeObject *metaclass, PyObject *module, PyType_Spec *spec, PyObject *bases) {
34303 PyObject *abi_module = NULL, *cached_type = NULL, *abi_module_dict, *new_cached_type, *py_object_name;
34304 int get_item_ref_result;
34305 const char* object_name = strrchr(spec->name,
'.');
34306 object_name = object_name ? object_name+1 : spec->name;
34307 py_object_name = PyUnicode_FromString(object_name);
34308 if (!py_object_name)
return NULL;
34309 abi_module = __Pyx_FetchSharedCythonABIModule();
34310 if (!abi_module)
goto done;
34311 abi_module_dict = PyModule_GetDict(abi_module);
34312 if (!abi_module_dict)
goto done;
34313 get_item_ref_result = __Pyx_PyDict_GetItemRef(abi_module_dict, py_object_name, &cached_type);
34314 if (get_item_ref_result == 1) {
34315 if (__Pyx_VerifyCachedType(
34318 spec->basicsize) < 0) {
34322 }
else if (unlikely(get_item_ref_result == -1)) {
34325 cached_type = __Pyx_PyType_FromMetaclass(
34327 CYTHON_USE_MODULE_STATE ? module : abi_module,
34329 if (unlikely(!cached_type))
goto bad;
34330 new_cached_type = __Pyx_PyDict_SetDefault(abi_module_dict, py_object_name, cached_type);
34331 if (unlikely(new_cached_type != cached_type)) {
34332 if (unlikely(!new_cached_type))
goto bad;
34333 Py_DECREF(cached_type);
34334 cached_type = new_cached_type;
34335 if (__Pyx_VerifyCachedType(
34338 spec->basicsize) < 0) {
34343 Py_DECREF(new_cached_type);
34346 Py_XDECREF(abi_module);
34347 Py_DECREF(py_object_name);
34348 assert(cached_type == NULL || PyType_Check(cached_type));
34349 return (PyTypeObject *) cached_type;
34351 Py_XDECREF(cached_type);
34352 cached_type = NULL;
34357static PyObject* __pyx_CommonTypesMetaclass_get_module(CYTHON_UNUSED PyObject *self, CYTHON_UNUSED
void* context) {
34358 return PyUnicode_FromString(__PYX_ABI_MODULE_NAME);
34360#if __PYX_LIMITED_VERSION_HEX < 0x030A0000
34361static PyObject* __pyx_CommonTypesMetaclass_call(CYTHON_UNUSED PyObject *self, CYTHON_UNUSED PyObject *args, CYTHON_UNUSED PyObject *kwds) {
34362 PyErr_SetString(PyExc_TypeError,
"Cannot instantiate Cython internal types");
34365static int __pyx_CommonTypesMetaclass_setattr(CYTHON_UNUSED PyObject *self, CYTHON_UNUSED PyObject *attr, CYTHON_UNUSED PyObject *value) {
34366 PyErr_SetString(PyExc_TypeError,
"Cython internal types are immutable");
34370static PyGetSetDef __pyx_CommonTypesMetaclass_getset[] = {
34371 {
"__module__", __pyx_CommonTypesMetaclass_get_module, NULL, NULL, NULL},
34374static PyType_Slot __pyx_CommonTypesMetaclass_slots[] = {
34375 {Py_tp_getset, (
void *)__pyx_CommonTypesMetaclass_getset},
34376 #if __PYX_LIMITED_VERSION_HEX < 0x030A0000
34377 {Py_tp_call, (
void*)__pyx_CommonTypesMetaclass_call},
34378 {Py_tp_new, (
void*)__pyx_CommonTypesMetaclass_call},
34379 {Py_tp_setattro, (
void*)__pyx_CommonTypesMetaclass_setattr},
34383static PyType_Spec __pyx_CommonTypesMetaclass_spec = {
34384 __PYX_TYPE_MODULE_PREFIX
"_common_types_metatype",
34387 Py_TPFLAGS_IMMUTABLETYPE |
34388 Py_TPFLAGS_DISALLOW_INSTANTIATION |
34389 Py_TPFLAGS_DEFAULT,
34390 __pyx_CommonTypesMetaclass_slots
34392static int __pyx_CommonTypesMetaclass_init(PyObject *module) {
34393 __pyx_mstatetype *mstate = __Pyx_PyModule_GetState(module);
34394 PyObject *bases = PyTuple_Pack(1, &PyType_Type);
34395 if (unlikely(!bases)) {
34398 mstate->__pyx_CommonTypesMetaclassType = __Pyx_FetchCommonTypeFromSpec(NULL, module, &__pyx_CommonTypesMetaclass_spec, bases);
34400 if (unlikely(mstate->__pyx_CommonTypesMetaclassType == NULL)) {
34407#if CYTHON_COMPILING_IN_LIMITED_API
34408static CYTHON_INLINE
int __Pyx__IsSameCyOrCFunctionNoMethod(PyObject *func,
void (*cfunc)(
void)) {
34409 if (__Pyx_CyFunction_Check(func)) {
34410 return __Pyx_as_CyFunctionObject(func)->func_methoddef->ml_meth == (PyCFunction) cfunc;
34411 }
else if (PyCFunction_Check(func)) {
34412 return PyCFunction_GetFunction(func) == (PyCFunction) cfunc;
34416static CYTHON_INLINE
int __Pyx__IsSameCyOrCFunction(PyObject *func,
void (*cfunc)(
void)) {
34417 if ((PyObject*)Py_TYPE(func) == __pyx_mstate_global->__Pyx_CachedMethodType) {
34419 PyObject *newFunc = PyObject_GetAttr(func, __pyx_mstate_global->__pyx_n_u_func);
34420 if (unlikely(!newFunc)) {
34424 result = __Pyx__IsSameCyOrCFunctionNoMethod(newFunc, cfunc);
34425 Py_DECREF(newFunc);
34428 return __Pyx__IsSameCyOrCFunctionNoMethod(func, cfunc);
34431static CYTHON_INLINE
int __Pyx__IsSameCyOrCFunction(PyObject *func,
void (*cfunc)(
void)) {
34432 if (PyMethod_Check(func)) {
34433 func = PyMethod_GET_FUNCTION(func);
34435 return __Pyx_CyOrPyCFunction_Check(func) && __Pyx_CyOrPyCFunction_GET_FUNCTION(func) == (PyCFunction) cfunc;
34438static CYTHON_INLINE
void __Pyx__CyFunction_SetClassObj(__pyx_CyFunctionObject*
f, PyObject* classobj) {
34439#if CYTHON_COMPILING_IN_LIMITED_API
34440 __Pyx_Py_XDECREF_SET(
34441 __Pyx__CyFunction_GetClassObj(
f),
34442 ((classobj) ? __Pyx_NewRef(classobj) : NULL));
34444 __Pyx_Py_XDECREF_SET(
34445 ((PyCMethodObject *) (
f))->mm_class,
34446 (PyTypeObject*)((classobj) ? __Pyx_NewRef(classobj) : NULL));
34449static CYTHON_INLINE PyObject *__Pyx_CyFunction_InitDefaults(PyObject *func, PyTypeObject *defaults_type) {
34450 __pyx_CyFunctionObject *m = __Pyx_as_CyFunctionObject(func);
34451 m->defaults = PyObject_CallObject((PyObject*)defaults_type, NULL);
34452 if (unlikely(!m->defaults))
34454 return m->defaults;
34456static CYTHON_INLINE
void __Pyx_CyFunction_SetDefaultsTuple(PyObject *func, PyObject *tuple) {
34457 __pyx_CyFunctionObject *m = __Pyx_as_CyFunctionObject(func);
34458 m->defaults_tuple = tuple;
34461static CYTHON_INLINE
void __Pyx_CyFunction_SetDefaultsKwDict(PyObject *func, PyObject *dict) {
34462 __pyx_CyFunctionObject *m = __Pyx_as_CyFunctionObject(func);
34463 m->defaults_kwdict = dict;
34466static CYTHON_INLINE
void __Pyx_CyFunction_SetAnnotationsDict(PyObject *func, PyObject *dict) {
34467 __pyx_CyFunctionObject *m = __Pyx_as_CyFunctionObject(func);
34468 m->func_annotations = dict;
34473#if CYTHON_COMPILING_IN_LIMITED_API
34474static PyObject *__Pyx_PyMethod_New(PyObject *func, PyObject *self, PyObject *typ) {
34476 CYTHON_UNUSED_VAR(typ);
34478 return __Pyx_NewRef(func);
34479 #if __PYX_LIMITED_VERSION_HEX >= 0x030C0000
34481 PyObject *args[] = {func, self};
34482 result = PyObject_Vectorcall(__pyx_mstate_global->__Pyx_CachedMethodType, args, 2, NULL);
34485 result = PyObject_CallFunctionObjArgs(__pyx_mstate_global->__Pyx_CachedMethodType, func, self, NULL);
34490static PyObject *__Pyx_PyMethod_New(PyObject *func, PyObject *self, PyObject *typ) {
34491 CYTHON_UNUSED_VAR(typ);
34493 return __Pyx_NewRef(func);
34494 return PyMethod_New(func, self);
34499#if CYTHON_VECTORCALL
34500static PyObject *__Pyx_PyVectorcall_FastCallDict_kw(PyObject *func, __pyx_vectorcallfunc vc, PyObject *
const *args,
size_t nargs, PyObject *kw)
34502 PyObject *res = NULL;
34504 PyObject **newargs;
34505 PyObject **kwvalues;
34507 #if CYTHON_AVOID_BORROWED_REFS
34513 PyObject *key, *value;
34514 unsigned long keys_are_strings;
34515 #if !CYTHON_ASSUME_SAFE_SIZE
34516 Py_ssize_t nkw = PyDict_Size(kw);
34517 if (unlikely(nkw == -1))
return NULL;
34519 Py_ssize_t nkw = PyDict_GET_SIZE(kw);
34521 newargs = (PyObject **)PyMem_Malloc((nargs + (
size_t)nkw) *
sizeof(args[0]));
34522 if (unlikely(newargs == NULL)) {
34526 for (j = 0; j < nargs; j++) newargs[j] = args[j];
34527 kwnames = PyTuple_New(nkw);
34528 if (unlikely(kwnames == NULL)) {
34529 PyMem_Free(newargs);
34532 kwvalues = newargs + nargs;
34535 keys_are_strings = Py_TPFLAGS_UNICODE_SUBCLASS;
34536 while (__Pyx_PyDict_NextRef(kw, &pos, &key, &value)) {
34537 keys_are_strings &=
34538 #if CYTHON_COMPILING_IN_LIMITED_API
34539 PyType_GetFlags(Py_TYPE(key));
34541 Py_TYPE(key)->tp_flags;
34543 #if !CYTHON_ASSUME_SAFE_MACROS
34544 if (unlikely(PyTuple_SetItem(kwnames, i, key) < 0))
goto cleanup;
34546 PyTuple_SET_ITEM(kwnames, i, key);
34548 kwvalues[i] = value;
34551 if (unlikely(!keys_are_strings)) {
34552 PyErr_SetString(PyExc_TypeError,
"keywords must be strings");
34555 res = vc(func, newargs, nargs, kwnames);
34557 #if CYTHON_AVOID_BORROWED_REFS
34560 Py_DECREF(kwnames);
34561 for (i = 0; i < nkw; i++)
34562 Py_DECREF(kwvalues[i]);
34563 PyMem_Free(newargs);
34566static CYTHON_INLINE PyObject *__Pyx_PyVectorcall_FastCallDict(PyObject *func, __pyx_vectorcallfunc vc, PyObject *
const *args,
size_t nargs, PyObject *kw)
34568 Py_ssize_t kw_size =
34569 likely(kw == NULL) ?
34571#if !CYTHON_ASSUME_SAFE_SIZE
34574 PyDict_GET_SIZE(kw);
34576 if (kw_size == 0) {
34577 return vc(func, args, nargs, NULL);
34579#if !CYTHON_ASSUME_SAFE_SIZE
34580 else if (unlikely(kw_size == -1)) {
34584 return __Pyx_PyVectorcall_FastCallDict_kw(func, vc, args, nargs, kw);
34590__Pyx_CyFunction_get_doc_locked(__pyx_CyFunctionObject *op)
34592 if (unlikely(op->func_doc == NULL)) {
34593#if CYTHON_COMPILING_IN_LIMITED_API
34594 const char *doc = op->func_methoddef->ml_doc;
34596 const char *doc = ((PyCFunctionObject*)op)->m_ml->ml_doc;
34599 op->func_doc = PyUnicode_FromString(doc);
34600 if (unlikely(op->func_doc == NULL))
34603 Py_INCREF(Py_None);
34607 Py_INCREF(op->func_doc);
34608 return op->func_doc;
34611__Pyx_CyFunction_get_doc(PyObject *op_in,
void *closure) {
34613 __pyx_CyFunctionObject *op = __Pyx_as_CyFunctionObject(op_in);
34614 CYTHON_UNUSED_VAR(closure);
34615 __Pyx_BEGIN_CRITICAL_SECTION(op_in);
34616 result = __Pyx_CyFunction_get_doc_locked(op);
34617 __Pyx_END_CRITICAL_SECTION();
34621__Pyx_CyFunction_set_doc(PyObject *op_in, PyObject *value,
void *context)
34623 __pyx_CyFunctionObject *op = __Pyx_as_CyFunctionObject(op_in);
34624 CYTHON_UNUSED_VAR(context);
34625 if (value == NULL) {
34629 __Pyx_BEGIN_CRITICAL_SECTION(op_in);
34630 __Pyx_Py_XDECREF_SET(op->func_doc, value);
34631 __Pyx_END_CRITICAL_SECTION();
34635__Pyx_CyFunction_get_name_locked(__pyx_CyFunctionObject *op)
34637 if (unlikely(op->func_name == NULL)) {
34638#if CYTHON_COMPILING_IN_LIMITED_API
34639 const char *name = op->func_methoddef->ml_name;
34641 const char *name = ((PyCFunctionObject*)op)->m_ml->ml_name;
34643 op->func_name = PyUnicode_InternFromString(name);
34644 if (unlikely(op->func_name == NULL))
34647 Py_INCREF(op->func_name);
34648 return op->func_name;
34651__Pyx_CyFunction_get_name(PyObject *op,
void *context)
34653 PyObject *result = NULL;
34654 CYTHON_UNUSED_VAR(context);
34655 __Pyx_BEGIN_CRITICAL_SECTION(op);
34656 result = __Pyx_CyFunction_get_name_locked(__Pyx_as_CyFunctionObject(op));
34657 __Pyx_END_CRITICAL_SECTION();
34661__Pyx_CyFunction_set_name(PyObject *op_in, PyObject *value,
void *context)
34663 CYTHON_UNUSED_VAR(context);
34664 if (unlikely(value == NULL || !PyUnicode_Check(value))) {
34665 PyErr_SetString(PyExc_TypeError,
34666 "__name__ must be set to a string object");
34669 __pyx_CyFunctionObject *op = __Pyx_as_CyFunctionObject(op_in);
34671 __Pyx_BEGIN_CRITICAL_SECTION(op_in);
34672 __Pyx_Py_XDECREF_SET(op->func_name, value);
34673 __Pyx_END_CRITICAL_SECTION();
34677__Pyx_CyFunction_get_qualname(PyObject *op_in,
void *context)
34679 CYTHON_UNUSED_VAR(context);
34680 __pyx_CyFunctionObject *op = __Pyx_as_CyFunctionObject(op_in);
34682 __Pyx_BEGIN_CRITICAL_SECTION(op_in);
34683 Py_INCREF(op->func_qualname);
34684 result = op->func_qualname;
34685 __Pyx_END_CRITICAL_SECTION();
34689__Pyx_CyFunction_set_qualname(PyObject *op_in, PyObject *value,
void *context)
34691 CYTHON_UNUSED_VAR(context);
34692 if (unlikely(value == NULL || !PyUnicode_Check(value))) {
34693 PyErr_SetString(PyExc_TypeError,
34694 "__qualname__ must be set to a string object");
34697 __pyx_CyFunctionObject *op = __Pyx_as_CyFunctionObject(op_in);
34699 __Pyx_BEGIN_CRITICAL_SECTION(op_in);
34700 __Pyx_Py_XDECREF_SET(op->func_qualname, value);
34701 __Pyx_END_CRITICAL_SECTION();
34704#if CYTHON_COMPILING_IN_LIMITED_API && __PYX_LIMITED_VERSION_HEX < 0x030A0000
34706__Pyx_CyFunction_get_dict(__pyx_CyFunctionObject *op,
void *context)
34708 CYTHON_UNUSED_VAR(context);
34709 if (unlikely(op->func_dict == NULL)) {
34710 op->func_dict = PyDict_New();
34711 if (unlikely(op->func_dict == NULL))
34714 Py_INCREF(op->func_dict);
34715 return op->func_dict;
34719__Pyx_CyFunction_get_globals(PyObject *op_in,
void *context)
34721 CYTHON_UNUSED_VAR(context);
34722 __pyx_CyFunctionObject *op = __Pyx_as_CyFunctionObject(op_in);
34723 Py_INCREF(op->func_globals);
34724 return op->func_globals;
34727__Pyx_CyFunction_get_closure(PyObject *op,
void *context)
34729 CYTHON_UNUSED_VAR(op);
34730 CYTHON_UNUSED_VAR(context);
34731 Py_INCREF(Py_None);
34735__Pyx_CyFunction_get_code(PyObject *op_in,
void *context)
34737 __pyx_CyFunctionObject *op = __Pyx_as_CyFunctionObject(op_in);
34738 PyObject* result = (op->func_code) ? op->func_code : Py_None;
34739 CYTHON_UNUSED_VAR(context);
34744__Pyx_CyFunction_init_defaults(__pyx_CyFunctionObject *op, PyObject *op_obj) {
34746 PyObject *res = op->defaults_getter(op_obj);
34747 if (unlikely(!res))
34749 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
34750 op->defaults_tuple = PyTuple_GET_ITEM(res, 0);
34751 Py_INCREF(op->defaults_tuple);
34752 op->defaults_kwdict = PyTuple_GET_ITEM(res, 1);
34753 Py_INCREF(op->defaults_kwdict);
34755 op->defaults_tuple = __Pyx_PySequence_ITEM(res, 0);
34756 if (unlikely(!op->defaults_tuple)) result = -1;
34758 op->defaults_kwdict = __Pyx_PySequence_ITEM(res, 1);
34759 if (unlikely(!op->defaults_kwdict)) result = -1;
34766__Pyx_CyFunction_set_defaults(PyObject *op_in, PyObject* value,
void *context) {
34767 __pyx_CyFunctionObject *op = __Pyx_as_CyFunctionObject(op_in);
34768 CYTHON_UNUSED_VAR(context);
34771 }
else if (unlikely(value != Py_None && !PyTuple_Check(value))) {
34772 PyErr_SetString(PyExc_TypeError,
34773 "__defaults__ must be set to a tuple object");
34776 PyErr_WarnEx(PyExc_RuntimeWarning,
"changes to cyfunction.__defaults__ will not "
34777 "currently affect the values used in function calls", 1);
34779 __Pyx_BEGIN_CRITICAL_SECTION(op_in);
34780 __Pyx_Py_XDECREF_SET(op->defaults_tuple, value);
34781 __Pyx_END_CRITICAL_SECTION();
34785__Pyx_CyFunction_get_defaults_locked(PyObject *op_in) {
34786 __pyx_CyFunctionObject *op = __Pyx_as_CyFunctionObject(op_in);
34787 PyObject* result = op->defaults_tuple;
34788 if (unlikely(!result)) {
34789 if (op->defaults_getter) {
34790 if (unlikely(__Pyx_CyFunction_init_defaults(op, op_in) < 0))
return NULL;
34791 result = op->defaults_tuple;
34800__Pyx_CyFunction_get_defaults(PyObject *op,
void *context) {
34801 PyObject* result = NULL;
34802 CYTHON_UNUSED_VAR(context);
34803 __Pyx_BEGIN_CRITICAL_SECTION(op);
34804 result = __Pyx_CyFunction_get_defaults_locked(op);
34805 __Pyx_END_CRITICAL_SECTION();
34809__Pyx_CyFunction_set_kwdefaults(PyObject *op_in, PyObject* value,
void *context) {
34810 __pyx_CyFunctionObject *op = __Pyx_as_CyFunctionObject(op_in);
34811 CYTHON_UNUSED_VAR(context);
34814 }
else if (unlikely(value != Py_None && !PyDict_Check(value))) {
34815 PyErr_SetString(PyExc_TypeError,
34816 "__kwdefaults__ must be set to a dict object");
34819 PyErr_WarnEx(PyExc_RuntimeWarning,
"changes to cyfunction.__kwdefaults__ will not "
34820 "currently affect the values used in function calls", 1);
34822 __Pyx_BEGIN_CRITICAL_SECTION(op_in);
34823 __Pyx_Py_XDECREF_SET(op->defaults_kwdict, value);
34824 __Pyx_END_CRITICAL_SECTION();
34828__Pyx_CyFunction_get_kwdefaults_locked(PyObject *op_in) {
34829 __pyx_CyFunctionObject *op = __Pyx_as_CyFunctionObject(op_in);
34830 PyObject* result = op->defaults_kwdict;
34831 if (unlikely(!result)) {
34832 if (op->defaults_getter) {
34833 if (unlikely(__Pyx_CyFunction_init_defaults(op, op_in) < 0))
return NULL;
34834 result = op->defaults_kwdict;
34843__Pyx_CyFunction_get_kwdefaults(PyObject *op,
void *context) {
34845 CYTHON_UNUSED_VAR(context);
34846 __Pyx_BEGIN_CRITICAL_SECTION(op);
34847 result = __Pyx_CyFunction_get_kwdefaults_locked(op);
34848 __Pyx_END_CRITICAL_SECTION();
34851static int __Pyx_CyFunction_set_annotate_in_dict_if_exists(PyObject *op_in, PyObject *value);
34853__Pyx_CyFunction_set_annotations(PyObject *op_in, PyObject* value,
void *context) {
34854 CYTHON_UNUSED_VAR(context);
34855 if (!value || value == Py_None) {
34857 }
else if (unlikely(!PyDict_Check(value))) {
34858 PyErr_SetString(PyExc_TypeError,
34859 "__annotations__ must be set to a dict object");
34862 __pyx_CyFunctionObject *op = __Pyx_as_CyFunctionObject(op_in);
34864 __Pyx_BEGIN_CRITICAL_SECTION(op_in);
34865 __Pyx_Py_XDECREF_SET(op->func_annotations, value);
34866 __Pyx_END_CRITICAL_SECTION();
34867 if (unlikely(__Pyx_CyFunction_set_annotate_in_dict_if_exists(op_in, Py_None) < 0))
return -1;
34871__Pyx_CyFunction_get_dict_if_exists(PyObject *op_in, PyObject **dict) {
34874#if CYTHON_COMPILING_IN_PYPY
34875 *dict = PyObject_GenericGetDict(op_in, NULL);
34876#elif CYTHON_COMPILING_IN_LIMITED_API || PY_VERSION_HEX < 0x030C0000
34877 *dict = __Pyx_as_CyFunctionObject(op_in)->func_dict;
34879 PyObject **dictptr = _PyObject_GetDictPtr(op_in);
34880 *dict = likely(dictptr) ? *dictptr : NULL;
34882 return *dict ? 1 : 0;
34885__Pyx_CyFunction_get_annotate_from_dict_if_exists(PyObject *op_in, PyObject **annotate) {
34889 dict_found = __Pyx_CyFunction_get_dict_if_exists(op_in, &dict);
34890 if (!dict_found)
return 0;
34891 return __Pyx_PyDict_GetItemRef(dict, __pyx_mstate_global->__pyx_n_u_annotate, annotate);
34894__Pyx_CyFunction_set_annotate_in_dict_if_exists(PyObject *op_in, PyObject *value) {
34897 dict_found = __Pyx_CyFunction_get_dict_if_exists(op_in, &dict);
34898 if (!dict_found)
return 0;
34900 return PyDict_SetItem(dict, __pyx_mstate_global->__pyx_n_u_annotate, value);
34902#if !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX >= 0x030d0000
34903 return PyDict_Pop(dict, __pyx_mstate_global->__pyx_n_u_annotate, NULL);
34905 int result = PyDict_Contains(dict, __pyx_mstate_global->__pyx_n_u_annotate);
34907 result = PyDict_DelItem(dict, __pyx_mstate_global->__pyx_n_u_annotate);
34914__Pyx_CyFunction_set_annotate_in_dict(PyObject *op_in, PyObject *value) {
34917#if CYTHON_COMPILING_IN_LIMITED_API && __PYX_LIMITED_VERSION_HEX < 0x030A0000
34918 dict = __Pyx_CyFunction_get_dict(__Pyx_as_CyFunctionObject(op_in), NULL);
34920 dict = PyObject_GenericGetDict(op_in, NULL);
34922 if (unlikely(!dict))
return -1;
34923 result = PyDict_SetItem(dict, __pyx_mstate_global->__pyx_n_u_annotate, value);
34928__Pyx_CyFunction_get_annotations_locked(__pyx_CyFunctionObject *op) {
34929 PyObject* result = op->func_annotations;
34930 if (unlikely(!result)) {
34931 result = PyDict_New();
34932 if (unlikely(!result))
return NULL;
34933 op->func_annotations = result;
34939__Pyx_CyFunction_get_annotations(PyObject *op_in,
void *context) {
34940 PyObject *annotate = NULL;
34941 PyObject *result = NULL;
34942 __pyx_CyFunctionObject *op = __Pyx_as_CyFunctionObject(op_in);
34943 CYTHON_UNUSED_VAR(context);
34944 __Pyx_BEGIN_CRITICAL_SECTION(op_in);
34945 result = __Pyx_XNewRef(op->func_annotations);
34946 __Pyx_END_CRITICAL_SECTION();
34947 if (result)
return result;
34948 if (unlikely(__Pyx_CyFunction_get_annotate_from_dict_if_exists(op_in, &annotate) < 0))
return NULL;
34949 if (!annotate || annotate == Py_None) {
34950 Py_XDECREF(annotate);
34951 __Pyx_BEGIN_CRITICAL_SECTION(op_in);
34952 result = __Pyx_CyFunction_get_annotations_locked(op);
34953 __Pyx_END_CRITICAL_SECTION();
34956 PyObject *format = PyLong_FromLong(1L);
34957 if (likely(format)) {
34958 if (!Py_EnterRecursiveCall(
" cyfunction __annotations__.__get__")) {
34959 result = __Pyx_PyObject_CallOneArg(annotate, format);
34960 Py_LeaveRecursiveCall();
34964 Py_DECREF(annotate);
34965 if (unlikely(!result))
return NULL;
34966 if (unlikely(!PyDict_Check(result))) {
34967 PyErr_SetString(PyExc_TypeError,
"__annotate__ must return a dict");
34971 __Pyx_BEGIN_CRITICAL_SECTION(op_in);
34972 __Pyx_Py_XDECREF_SET(op->func_annotations, __Pyx_NewRef(result));
34973 __Pyx_END_CRITICAL_SECTION();
34976static PyObject *__Pyx_CyFunction_annotate_impl(PyObject *self, PyObject *arg) {
34977 CYTHON_UNUSED_VAR(arg);
34978 if (unlikely(!self)) {
34979 PyErr_SetString(PyExc_SystemError,
"cython __annotate__ called without 'self' argument");
34983 if (Py_EnterRecursiveCall(
" in cyfunction annotate")) {
34986 result = __Pyx_CyFunction_get_annotations(self, NULL);
34987 Py_LeaveRecursiveCall();
34991__Pyx_CyFunction_get_annotate(PyObject *op_in,
void *context);
34993__Pyx_CyFunction_set_annotate(PyObject *op_in, PyObject* value,
void *context) {
34994 CYTHON_UNUSED_VAR(context);
34995 if (value == NULL) {
34996 PyErr_SetString(PyExc_TypeError,
"__annotate__ cannot be deleted");
34999 if (unlikely(value != Py_None && !PyCallable_Check(value))) {
35000 PyErr_SetString(PyExc_TypeError,
"__annotate__ must be callable or None");
35003 if (unlikely(__Pyx_TypeCheck(value, &PyCFunction_Type))) {
35004#if !CYTHON_ASSUME_SAFE_MACROS && !CYTHON_COMPILING_IN_PYPY
35005 PyCFunction cfunction = PyCFunction_GetFunction(value);
35006 if (unlikely(!cfunction))
return -1;
35007 PyObject *value_self = PyCFunction_GetSelf(value);
35008 if (unlikely(!value_self && PyErr_Occurred()))
return -1;
35010 PyCFunction cfunction = PyCFunction_GET_FUNCTION(value);
35011 PyObject *value_self = PyCFunction_GET_SELF(value);
35013 if (cfunction == __Pyx_CyFunction_annotate_impl && value_self == op_in) {
35014 return __Pyx_CyFunction_set_annotate_in_dict_if_exists(op_in, NULL);
35017 if (value != Py_None) {
35018 __pyx_CyFunctionObject *op = __Pyx_as_CyFunctionObject(op_in);
35019 __Pyx_BEGIN_CRITICAL_SECTION(op_in);
35020 Py_CLEAR(op->func_annotations);
35021 __Pyx_END_CRITICAL_SECTION();
35023 return __Pyx_CyFunction_set_annotate_in_dict(op_in, value);
35025#if __PYX_LIMITED_VERSION_HEX < 0x030B0000
35027__Pyx_CyFunction_get_is_coroutine_value(__pyx_CyFunctionObject *op) {
35028 int is_coroutine = op->flags & __Pyx_CYFUNCTION_COROUTINE;
35029 if (is_coroutine) {
35030 PyObject *is_coroutine_value, *module, *fromlist, *marker = __pyx_mstate_global->__pyx_n_u_is_coroutine;
35031 fromlist = PyList_New(1);
35032 if (unlikely(!fromlist))
return NULL;
35034#if CYTHON_ASSUME_SAFE_MACROS
35035 PyList_SET_ITEM(fromlist, 0, marker);
35037 if (unlikely(PyList_SetItem(fromlist, 0, marker) < 0)) {
35038 Py_DECREF(fromlist);
35042 module = PyImport_ImportModuleLevelObject(__pyx_mstate_global->__pyx_n_u_asyncio_coroutines, NULL, NULL, fromlist, 0);
35043 Py_DECREF(fromlist);
35044 if (unlikely(!module)) {
35045 goto ignore_or_error;
35047 is_coroutine_value = __Pyx_PyObject_GetAttrStr(module, marker);
35049 if (likely(is_coroutine_value)) {
35050 return is_coroutine_value;
35053 if (!__Pyx_IgnoreException(PyExc_Exception)) {
35057 return __Pyx_PyBool_FromLong(is_coroutine);
35060__Pyx_CyFunction_get_is_coroutine(PyObject *op_in,
void *context) {
35061 __pyx_CyFunctionObject *op = __Pyx_as_CyFunctionObject(op_in);
35063 CYTHON_UNUSED_VAR(context);
35064 if (op->func_is_coroutine) {
35065 return __Pyx_NewRef(op->func_is_coroutine);
35067 result = __Pyx_CyFunction_get_is_coroutine_value(op);
35068 if (unlikely(!result))
35070 __Pyx_BEGIN_CRITICAL_SECTION(op_in);
35071 if (op->func_is_coroutine) {
35073 result = __Pyx_NewRef(op->func_is_coroutine);
35075 op->func_is_coroutine = __Pyx_NewRef(result);
35077 __Pyx_END_CRITICAL_SECTION();
35081static void __Pyx_CyFunction_raise_argument_count_error(PyObject *func,
const char* message, Py_ssize_t size) {
35082#if CYTHON_COMPILING_IN_LIMITED_API
35083 PyObject *py_name = __Pyx_CyFunction_get_name(func, NULL);
35084 if (!py_name)
return;
35085 PyErr_Format(PyExc_TypeError,
35086 "%.200S() %s (%" CYTHON_FORMAT_SSIZE_T
"d given)",
35087 py_name, message, size);
35088 Py_DECREF(py_name);
35090 const char* name = ((PyCFunctionObject*)func)->m_ml->ml_name;
35091 PyErr_Format(PyExc_TypeError,
35092 "%.200s() %s (%" CYTHON_FORMAT_SSIZE_T
"d given)",
35093 name, message, size);
35096static void __Pyx_CyFunction_raise_type_error(PyObject *func,
const char* message) {
35097#if CYTHON_COMPILING_IN_LIMITED_API
35098 PyObject *py_name = __Pyx_CyFunction_get_name(func, NULL);
35099 if (!py_name)
return;
35100 PyErr_Format(PyExc_TypeError,
35103 Py_DECREF(py_name);
35105 const char* name = ((PyCFunctionObject*)func)->m_ml->ml_name;
35106 PyErr_Format(PyExc_TypeError,
35111#if CYTHON_COMPILING_IN_LIMITED_API
35113__Pyx_CyFunction_get_module(PyObject *op_in,
void *context) {
35114 CYTHON_UNUSED_VAR(context);
35115 __pyx_CyFunctionObject *op = __Pyx_as_CyFunctionObject(op_in);
35116 Py_INCREF(op->func_module);
35117 return op->func_module;
35120__Pyx_CyFunction_set_module(PyObject *op_in, PyObject* value,
void *context) {
35121 CYTHON_UNUSED_VAR(context);
35122 __pyx_CyFunctionObject *op = __Pyx_as_CyFunctionObject(op_in);
35123 if (value == NULL) {
35127 PyObject *old = op->func_module;
35128 op->func_module = value;
35133static PyGetSetDef __pyx_CyFunction_getsets[] = {
35134 {
"func_doc", (getter)__Pyx_CyFunction_get_doc, (setter)__Pyx_CyFunction_set_doc, 0, 0},
35135 {
"__doc__", (getter)__Pyx_CyFunction_get_doc, (setter)__Pyx_CyFunction_set_doc, 0, 0},
35136 {
"func_name", (getter)__Pyx_CyFunction_get_name, (setter)__Pyx_CyFunction_set_name, 0, 0},
35137 {
"__name__", (getter)__Pyx_CyFunction_get_name, (setter)__Pyx_CyFunction_set_name, 0, 0},
35138 {
"__qualname__", (getter)__Pyx_CyFunction_get_qualname, (setter)__Pyx_CyFunction_set_qualname, 0, 0},
35139#if CYTHON_COMPILING_IN_LIMITED_API && __PYX_LIMITED_VERSION_HEX < 0x030A0000
35140 {
"func_dict", (getter)__Pyx_CyFunction_get_dict, (setter)PyObject_GenericSetDict, 0, 0},
35141 {
"__dict__", (getter)__Pyx_CyFunction_get_dict, (setter)PyObject_GenericSetDict, 0, 0},
35143 {
"func_dict", (getter)PyObject_GenericGetDict, (setter)PyObject_GenericSetDict, 0, 0},
35144 {
"__dict__", (getter)PyObject_GenericGetDict, (setter)PyObject_GenericSetDict, 0, 0},
35146 {
"func_globals", (getter)__Pyx_CyFunction_get_globals, 0, 0, 0},
35147 {
"__globals__", (getter)__Pyx_CyFunction_get_globals, 0, 0, 0},
35148 {
"func_closure", (getter)__Pyx_CyFunction_get_closure, 0, 0, 0},
35149 {
"__closure__", (getter)__Pyx_CyFunction_get_closure, 0, 0, 0},
35150 {
"func_code", (getter)__Pyx_CyFunction_get_code, 0, 0, 0},
35151 {
"__code__", (getter)__Pyx_CyFunction_get_code, 0, 0, 0},
35152 {
"func_defaults", (getter)__Pyx_CyFunction_get_defaults, (setter)__Pyx_CyFunction_set_defaults, 0, 0},
35153 {
"__defaults__", (getter)__Pyx_CyFunction_get_defaults, (setter)__Pyx_CyFunction_set_defaults, 0, 0},
35154 {
"__kwdefaults__", (getter)__Pyx_CyFunction_get_kwdefaults, (setter)__Pyx_CyFunction_set_kwdefaults, 0, 0},
35155 {
"__annotations__", (getter)__Pyx_CyFunction_get_annotations, (setter)__Pyx_CyFunction_set_annotations, 0, 0},
35156 {
"__annotate__", (getter)__Pyx_CyFunction_get_annotate, (setter)__Pyx_CyFunction_set_annotate, 0, 0},
35157#if __PYX_LIMITED_VERSION_HEX < 0x030B0000
35158 {
"_is_coroutine", (getter)__Pyx_CyFunction_get_is_coroutine, 0, 0, 0},
35160#if CYTHON_COMPILING_IN_LIMITED_API
35161 {
"__module__", (getter)__Pyx_CyFunction_get_module, (setter)__Pyx_CyFunction_set_module, 0, 0},
35165static PyMemberDef __pyx_CyFunction_members[] = {
35166#if !CYTHON_COMPILING_IN_LIMITED_API
35167 {
"__module__", T_OBJECT, offsetof(PyCFunctionObject, m_module), 0, 0},
35169#if PY_VERSION_HEX < 0x030C0000 || CYTHON_COMPILING_IN_LIMITED_API
35170 {
"__dictoffset__", T_PYSSIZET, offsetof(__pyx_CyFunctionObject, func_dict),
35171 __PYX_SHARED_RELATIVE_OFFSET | READONLY, 0},
35173#if CYTHON_VECTORCALL
35174#if CYTHON_COMPILING_IN_LIMITED_API || CYTHON_COMPILING_IN_PYPY
35175 {
"__vectorcalloffset__", T_PYSSIZET, offsetof(__pyx_CyFunctionObject, func_vectorcall),
35176 __PYX_SHARED_RELATIVE_OFFSET | READONLY, 0},
35178 {
"__vectorcalloffset__", T_PYSSIZET, offsetof(PyCFunctionObject, vectorcall), READONLY, 0},
35180#if CYTHON_COMPILING_IN_LIMITED_API
35181 {
"__weaklistoffset__", T_PYSSIZET, offsetof(__pyx_CyFunctionObject, func_weakreflist),
35182 __PYX_SHARED_RELATIVE_OFFSET | READONLY, 0},
35184 {
"__weaklistoffset__", T_PYSSIZET, offsetof(PyCFunctionObject, m_weakreflist), READONLY, 0},
35190__Pyx_CyFunction_reduce(PyObject *m_in, PyObject *args)
35192 PyObject *result = NULL;
35193 __pyx_CyFunctionObject *m = __Pyx_as_CyFunctionObject(m_in);
35194 CYTHON_UNUSED_VAR(args);
35195 __Pyx_BEGIN_CRITICAL_SECTION(m_in);
35196 Py_INCREF(m->func_qualname);
35197 result = m->func_qualname;
35198 __Pyx_END_CRITICAL_SECTION();
35201static PyMethodDef __pyx_CyFunction_methods[] = {
35202 {
"__annotate_cython__", __Pyx_CyFunction_annotate_impl, METH_O,
35203 "Placeholder __annotate__ function to allow 'functools.wraps' to work "
35204 "on Cython functions."},
35205 {
"__reduce__", (PyCFunction)__Pyx_CyFunction_reduce, METH_NOARGS, 0},
35209__Pyx_CyFunction_get_annotate(PyObject *op_in,
void *context) {
35210 PyObject *annotate = NULL;
35211 CYTHON_UNUSED_VAR(context);
35212 if (unlikely(__Pyx_CyFunction_get_annotate_from_dict_if_exists(op_in, &annotate) < 0))
return NULL;
35213 if (annotate)
return annotate;
35214 PyObject *method = PyCFunction_New(
35215 &__pyx_CyFunction_methods[0],
35219#if CYTHON_COMPILING_IN_LIMITED_API
35220#define __Pyx_CyFunction_weakreflist(cyfunc) ((cyfunc)->func_weakreflist)
35222#define __Pyx_CyFunction_weakreflist(cyfunc) (((PyCFunctionObject*)cyfunc)->m_weakreflist)
35224static PyObject *__Pyx_CyFunction_Init(PyObject *op_in,
35225 PyMethodDef *ml,
int flags, PyObject* qualname,
35226 PyObject *closure, PyObject *module, PyObject* globals, PyObject* code) {
35227 __pyx_CyFunctionObject* op = __Pyx_as_CyFunctionObject(op_in);
35228#if !CYTHON_COMPILING_IN_LIMITED_API
35229 PyCFunctionObject *cf = (PyCFunctionObject*) op;
35231 if (unlikely(op == NULL))
35233#if CYTHON_COMPILING_IN_LIMITED_API
35234 op->func_methoddef = ml;
35236 op->func_module =
module;
35239 __Pyx_CyFunction_weakreflist(op) = NULL;
35240#if !CYTHON_COMPILING_IN_LIMITED_API
35242 cf->m_self = (PyObject *) op;
35244 Py_XINCREF(closure);
35245 op->func_closure = closure;
35246#if !CYTHON_COMPILING_IN_LIMITED_API
35247 Py_XINCREF(module);
35248 cf->m_module =
module;
35250#if PY_VERSION_HEX < 0x030C0000 || CYTHON_COMPILING_IN_LIMITED_API
35251 op->func_dict = NULL;
35253 op->func_name = NULL;
35254 Py_INCREF(qualname);
35255 op->func_qualname = qualname;
35256 op->func_doc = NULL;
35257#if CYTHON_COMPILING_IN_LIMITED_API
35258 op->func_classobj = NULL;
35260 ((PyCMethodObject*)op)->mm_class = NULL;
35262 op->func_globals = globals;
35263 Py_INCREF(op->func_globals);
35265 op->func_code = code;
35266 op->defaults = NULL;
35267 op->defaults_tuple = NULL;
35268 op->defaults_kwdict = NULL;
35269 op->defaults_getter = NULL;
35270 op->func_annotations = NULL;
35271#if __PYX_LIMITED_VERSION_HEX < 0x030B0000
35272 op->func_is_coroutine = NULL;
35274#if CYTHON_VECTORCALL
35275 switch (ml->ml_flags & (METH_VARARGS | METH_FASTCALL | METH_NOARGS | METH_O | METH_KEYWORDS | METH_METHOD)) {
35277 __Pyx_CyFunction_func_vectorcall(op) = __Pyx_CyFunction_Vectorcall_NOARGS;
35280 __Pyx_CyFunction_func_vectorcall(op) = __Pyx_CyFunction_Vectorcall_O;
35282 case METH_METHOD | METH_FASTCALL | METH_KEYWORDS:
35283 __Pyx_CyFunction_func_vectorcall(op) = __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS_METHOD;
35285 case METH_FASTCALL | METH_KEYWORDS:
35286 __Pyx_CyFunction_func_vectorcall(op) = __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS;
35288 case METH_VARARGS | METH_KEYWORDS:
35289 __Pyx_CyFunction_func_vectorcall(op) = NULL;
35292 PyErr_SetString(PyExc_SystemError,
"Bad call flags for CyFunction");
35299static int __Pyx__CyFunction_clear(__pyx_CyFunctionObject *m)
35301 Py_CLEAR(m->func_closure);
35302#if CYTHON_COMPILING_IN_LIMITED_API
35303 Py_CLEAR(m->func_module);
35305 Py_CLEAR(((PyCFunctionObject*)m)->m_module);
35307#if PY_VERSION_HEX < 0x030C0000 || CYTHON_COMPILING_IN_LIMITED_API
35308 Py_CLEAR(m->func_dict);
35309#elif PY_VERSION_HEX < 0x030d0000
35310 _PyObject_ClearManagedDict((PyObject*)m);
35312 PyObject_ClearManagedDict((PyObject*)m);
35314 Py_CLEAR(m->func_name);
35315 Py_CLEAR(m->func_qualname);
35316 Py_CLEAR(m->func_doc);
35317 Py_CLEAR(m->func_globals);
35318 Py_CLEAR(m->func_code);
35319#if CYTHON_COMPILING_IN_LIMITED_API
35320 Py_CLEAR(m->func_classobj);
35323 PyObject *cls = (PyObject*) ((PyCMethodObject *) (m))->mm_class;
35324 ((PyCMethodObject *) (m))->mm_class = NULL;
35328 Py_CLEAR(m->defaults_tuple);
35329 Py_CLEAR(m->defaults_kwdict);
35330 Py_CLEAR(m->func_annotations);
35331#if __PYX_LIMITED_VERSION_HEX < 0x030B0000
35332 Py_CLEAR(m->func_is_coroutine);
35334 Py_CLEAR(m->defaults);
35338__Pyx_CyFunction_clear(PyObject *m)
35340 return __Pyx__CyFunction_clear(__Pyx_as_CyFunctionObject(m));
35342static void __Pyx__CyFunction_dealloc(PyObject *m)
35344 __pyx_CyFunctionObject *cyfunc = __Pyx_as_CyFunctionObject(m);
35345 if (__Pyx_CyFunction_weakreflist(cyfunc) != NULL)
35346 PyObject_ClearWeakRefs(m);
35347 __Pyx__CyFunction_clear(cyfunc);
35348 __Pyx_PyHeapTypeObject_GC_Del(m);
35350static void __Pyx_CyFunction_dealloc(PyObject *m)
35352 PyObject_GC_UnTrack(m);
35353 __Pyx__CyFunction_dealloc(m);
35355static int __Pyx_CyFunction_traverse(PyObject *m_in, visitproc visit,
void *arg)
35357 __pyx_CyFunctionObject *m = __Pyx_as_CyFunctionObject(m_in);
35359 int e = __Pyx_call_type_traverse(m_in, 1, visit, arg);
35362 Py_VISIT(m->func_closure);
35363#if CYTHON_COMPILING_IN_LIMITED_API
35364 Py_VISIT(m->func_module);
35366 Py_VISIT(((PyCFunctionObject*)m)->m_module);
35368#if PY_VERSION_HEX < 0x030C0000 || CYTHON_COMPILING_IN_LIMITED_API
35369 Py_VISIT(m->func_dict);
35373#if PY_VERSION_HEX < 0x030d0000
35374 _PyObject_VisitManagedDict
35376 PyObject_VisitManagedDict
35378 ((PyObject*)m, visit, arg);
35379 if (e != 0)
return e;
35382 __Pyx_VISIT_CONST(m->func_name);
35383 __Pyx_VISIT_CONST(m->func_qualname);
35384 Py_VISIT(m->func_doc);
35385 Py_VISIT(m->func_globals);
35386 __Pyx_VISIT_CONST(m->func_code);
35387 Py_VISIT(__Pyx__CyFunction_GetClassObj(m));
35388 Py_VISIT(m->defaults_tuple);
35389 Py_VISIT(m->defaults_kwdict);
35390 Py_VISIT(m->func_annotations);
35391#if __PYX_LIMITED_VERSION_HEX < 0x030B0000
35392 Py_VISIT(m->func_is_coroutine);
35394 Py_VISIT(m->defaults);
35398__Pyx_CyFunction_repr(PyObject *op_in)
35400 __pyx_CyFunctionObject *op = __Pyx_as_CyFunctionObject(op_in);
35402 __Pyx_BEGIN_CRITICAL_SECTION(op_in);
35403 repr = PyUnicode_FromFormat(
"<cyfunction %U at %p>",
35404 op->func_qualname, (
void *)op);
35405 __Pyx_END_CRITICAL_SECTION();
35408static PyObject * __Pyx_CyFunction_CallMethod(PyObject *func, PyObject *self, PyObject *arg, PyObject *kw) {
35409#if CYTHON_COMPILING_IN_LIMITED_API
35410 __pyx_CyFunctionObject *cyfunc = __Pyx_as_CyFunctionObject(func);
35411 PyCFunction meth = cyfunc->func_methoddef->ml_meth;
35412 int flags = cyfunc->func_methoddef->ml_flags;
35414 PyCFunctionObject*
f = (PyCFunctionObject*)func;
35415 PyCFunction meth =
f->m_ml->ml_meth;
35416 int flags =
f->m_ml->ml_flags;
35419 switch (flags & (METH_VARARGS | METH_KEYWORDS | METH_NOARGS | METH_O)) {
35421 if (likely(kw == NULL || PyDict_Size(kw) == 0))
35422 return (*meth)(self, arg);
35424 case METH_VARARGS | METH_KEYWORDS:
35425 return (*(PyCFunctionWithKeywords)(
void(*)(
void))meth)(self, arg, kw);
35427 if (likely(kw == NULL || PyDict_Size(kw) == 0)) {
35428#if CYTHON_ASSUME_SAFE_SIZE
35429 size = PyTuple_GET_SIZE(arg);
35431 size = PyTuple_Size(arg);
35432 if (unlikely(size < 0))
return NULL;
35434 if (likely(size == 0))
35435 return (*meth)(self, NULL);
35436 __Pyx_CyFunction_raise_argument_count_error(
35438 "takes no arguments", size);
35443 if (likely(kw == NULL || PyDict_Size(kw) == 0)) {
35444#if CYTHON_ASSUME_SAFE_SIZE
35445 size = PyTuple_GET_SIZE(arg);
35447 size = PyTuple_Size(arg);
35448 if (unlikely(size < 0))
return NULL;
35450 if (likely(size == 1)) {
35451 PyObject *result, *arg0;
35452 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
35453 arg0 = PyTuple_GET_ITEM(arg, 0);
35455 arg0 = __Pyx_PySequence_ITEM(arg, 0);
if (unlikely(!arg0))
return NULL;
35457 result = (*meth)(self, arg0);
35458 #if !(CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS)
35463 __Pyx_CyFunction_raise_argument_count_error(
35465 "takes exactly one argument", size);
35470 PyErr_SetString(PyExc_SystemError,
"Bad call flags for CyFunction");
35473 __Pyx_CyFunction_raise_type_error(
35474 func,
"takes no keyword arguments");
35477static CYTHON_INLINE PyObject *__Pyx_CyFunction_Call(PyObject *func, PyObject *arg, PyObject *kw) {
35479 result = __Pyx_CyFunction_CallMethod(func, func, arg, kw);
35482static PyObject *__Pyx_CyFunction_CallAsMethod(PyObject *func, PyObject *args, PyObject *kw) {
35484 __pyx_CyFunctionObject *cyfunc = __Pyx_as_CyFunctionObject(func);
35485#if CYTHON_VECTORCALL
35486 __pyx_vectorcallfunc vc = __Pyx_CyFunction_func_vectorcall(cyfunc);
35488#if CYTHON_ASSUME_SAFE_MACROS && CYTHON_ASSUME_SAFE_SIZE
35489 return __Pyx_PyVectorcall_FastCallDict(func, vc, &PyTuple_GET_ITEM(args, 0), (
size_t)PyTuple_GET_SIZE(args), kw);
35491 (void) &__Pyx_PyVectorcall_FastCallDict;
35492 return PyVectorcall_Call(func, args, kw);
35496 if ((cyfunc->flags & __Pyx_CYFUNCTION_CCLASS) && !(cyfunc->flags & __Pyx_CYFUNCTION_STATICMETHOD)) {
35498 PyObject *new_args;
35500#if CYTHON_ASSUME_SAFE_SIZE
35501 argc = PyTuple_GET_SIZE(args);
35503 argc = PyTuple_Size(args);
35504 if (unlikely(argc < 0))
return NULL;
35506 new_args = PyTuple_GetSlice(args, 1, argc);
35507 if (unlikely(!new_args))
35509 self = PyTuple_GetItem(args, 0);
35510 if (unlikely(!self)) {
35511 Py_DECREF(new_args);
35512 PyErr_Format(PyExc_TypeError,
35513 "unbound method %.200S() needs an argument",
35514 cyfunc->func_qualname);
35517 result = __Pyx_CyFunction_CallMethod(func, self, new_args, kw);
35518 Py_DECREF(new_args);
35520 result = __Pyx_CyFunction_Call(func, args, kw);
35524#if CYTHON_VECTORCALL
35525static CYTHON_INLINE
int __Pyx_CyFunction_Vectorcall_CheckArgs(PyObject *func, __pyx_CyFunctionObject *cyfunc, Py_ssize_t nargs, PyObject *kwnames)
35528 if ((cyfunc->flags & __Pyx_CYFUNCTION_CCLASS) && !(cyfunc->flags & __Pyx_CYFUNCTION_STATICMETHOD)) {
35529 if (unlikely(nargs < 1)) {
35530 __Pyx_CyFunction_raise_type_error(
35531 func,
"needs an argument");
35536 if (unlikely(kwnames) && unlikely(__Pyx_PyTuple_GET_SIZE(kwnames))) {
35537 __Pyx_CyFunction_raise_type_error(
35538 func,
"takes no keyword arguments");
35543static PyObject * __Pyx_CyFunction_Vectorcall_NOARGS(PyObject *func, PyObject *
const *args,
size_t nargsf, PyObject *kwnames)
35545 __pyx_CyFunctionObject *cyfunc = __Pyx_as_CyFunctionObject(func);
35546 Py_ssize_t nargs = PyVectorcall_NARGS(nargsf);
35548#if CYTHON_COMPILING_IN_LIMITED_API
35549 PyCFunction meth = cyfunc->func_methoddef->ml_meth;
35550 if (unlikely(!meth))
return NULL;
35552 PyCFunction meth = ((PyCFunctionObject*)cyfunc)->m_ml->ml_meth;
35554 switch (__Pyx_CyFunction_Vectorcall_CheckArgs(func, cyfunc, nargs, kwnames)) {
35566 if (unlikely(nargs != 0)) {
35567 __Pyx_CyFunction_raise_argument_count_error(
35568 func,
"takes no arguments", nargs);
35571 return meth(self, NULL);
35573static PyObject * __Pyx_CyFunction_Vectorcall_O(PyObject *func, PyObject *
const *args,
size_t nargsf, PyObject *kwnames)
35575 __pyx_CyFunctionObject *cyfunc = __Pyx_as_CyFunctionObject(func);
35576 Py_ssize_t nargs = PyVectorcall_NARGS(nargsf);
35578#if CYTHON_COMPILING_IN_LIMITED_API
35579 PyCFunction meth = cyfunc->func_methoddef->ml_meth;
35580 if (unlikely(!meth))
return NULL;
35582 PyCFunction meth = ((PyCFunctionObject*)cyfunc)->m_ml->ml_meth;
35584 switch (__Pyx_CyFunction_Vectorcall_CheckArgs(func, cyfunc, nargs, kwnames)) {
35596 if (unlikely(nargs != 1)) {
35597 __Pyx_CyFunction_raise_argument_count_error(
35598 func,
"takes exactly one argument", nargs);
35601 return meth(self, args[0]);
35603static PyObject * __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS(PyObject *func, PyObject *
const *args,
size_t nargsf, PyObject *kwnames)
35605 __pyx_CyFunctionObject *cyfunc = __Pyx_as_CyFunctionObject(func);
35606 Py_ssize_t nargs = PyVectorcall_NARGS(nargsf);
35608#if CYTHON_COMPILING_IN_LIMITED_API
35609 PyCFunction meth = cyfunc->func_methoddef->ml_meth;
35610 if (unlikely(!meth))
return NULL;
35612 PyCFunction meth = ((PyCFunctionObject*)cyfunc)->m_ml->ml_meth;
35614 switch (__Pyx_CyFunction_Vectorcall_CheckArgs(func, cyfunc, nargs, NULL)) {
35626 return ((__Pyx_PyCFunctionFastWithKeywords)(
void(*)(
void))meth)(self, args, nargs, kwnames);
35628static PyObject * __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS_METHOD(PyObject *func, PyObject *
const *args,
size_t nargsf, PyObject *kwnames)
35630 __pyx_CyFunctionObject *cyfunc = __Pyx_as_CyFunctionObject(func);
35631 PyTypeObject *cls = (PyTypeObject *) __Pyx__CyFunction_GetClassObj(cyfunc);
35632 Py_ssize_t nargs = PyVectorcall_NARGS(nargsf);
35634#if CYTHON_COMPILING_IN_LIMITED_API
35635 PyCFunction meth = cyfunc->func_methoddef->ml_meth;
35636 if (unlikely(!meth))
return NULL;
35638 PyCFunction meth = ((PyCFunctionObject*)cyfunc)->m_ml->ml_meth;
35640 switch (__Pyx_CyFunction_Vectorcall_CheckArgs(func, cyfunc, nargs, NULL)) {
35652 #if PY_VERSION_HEX < 0x030e00A6
35653 size_t nargs_value = (size_t) nargs;
35655 Py_ssize_t nargs_value = nargs;
35657 return ((__Pyx_PyCMethod)(
void(*)(
void))meth)(self, cls, args, nargs_value, kwnames);
35660static PyType_Slot __pyx_CyFunctionType_slots[] = {
35661 {Py_tp_dealloc, (
void *)__Pyx_CyFunction_dealloc},
35662 {Py_tp_repr, (
void *)__Pyx_CyFunction_repr},
35663 {Py_tp_call, (
void *)__Pyx_CyFunction_CallAsMethod},
35664 {Py_tp_traverse, (
void *)__Pyx_CyFunction_traverse},
35665 {Py_tp_clear, (
void *)__Pyx_CyFunction_clear},
35666 {Py_tp_methods, (
void *)__pyx_CyFunction_methods},
35667 {Py_tp_members, (
void *)__pyx_CyFunction_members},
35668 {Py_tp_getset, (
void *)__pyx_CyFunction_getsets},
35669 {Py_tp_descr_get, (
void *)__Pyx_PyMethod_New},
35672static PyType_Spec __pyx_CyFunctionType_spec = {
35673 __PYX_TYPE_MODULE_PREFIX
"cython_function_or_method",
35674 __PYX_SHARED_SIZEOF(__pyx_CyFunctionObject),
35676#ifdef Py_TPFLAGS_METHOD_DESCRIPTOR
35677 Py_TPFLAGS_METHOD_DESCRIPTOR |
35679#if CYTHON_VECTORCALL
35680#if defined(Py_TPFLAGS_HAVE_VECTORCALL)
35681 Py_TPFLAGS_HAVE_VECTORCALL |
35682#elif defined(_Py_TPFLAGS_HAVE_VECTORCALL)
35683 _Py_TPFLAGS_HAVE_VECTORCALL |
35686#if PY_VERSION_HEX >= 0x030C0000 && !CYTHON_COMPILING_IN_LIMITED_API
35687 Py_TPFLAGS_MANAGED_DICT |
35689 Py_TPFLAGS_IMMUTABLETYPE | Py_TPFLAGS_DISALLOW_INSTANTIATION |
35690 Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC | Py_TPFLAGS_BASETYPE,
35691 __pyx_CyFunctionType_slots
35693static int __pyx_CyFunction_init(PyObject *module) {
35694 __pyx_mstatetype *mstate = __Pyx_PyModule_GetState(module);
35695 mstate->__pyx_CyFunctionType = __Pyx_FetchCommonTypeFromSpec(
35696 mstate->__pyx_CommonTypesMetaclassType, module, &__pyx_CyFunctionType_spec, NULL);
35697 if (unlikely(mstate->__pyx_CyFunctionType == NULL)) {
35704static PyObject *__Pyx_CyFunction_New(PyMethodDef *ml,
int flags, PyObject* qualname,
35705 PyObject *closure, PyObject *module, PyObject* globals, PyObject* code) {
35706 (void)&__Pyx_Get_CyFunction_Type;
35707 PyObject *op = __Pyx_CyFunction_Init(
35708 PyObject_GC_New(PyObject, __pyx_mstate_global->__pyx_CyFunctionType),
35709 ml, flags, qualname, closure, module, globals, code
35712 PyObject_GC_Track(op);
35716static PyTypeObject *__Pyx_Get_CyFunction_Type(
void) {
35717 PyTypeObject *tp = __pyx_mstate_global->__pyx_CyFunctionType;
35718 Py_INCREF((PyObject*)tp);
35723static CYTHON_INLINE PyObject* __Pyx_PyObject_Call2Args(PyObject* function, PyObject* arg1, PyObject* arg2) {
35724 PyObject *args[3] = {NULL, arg1, arg2};
35725 return __Pyx_PyObject_FastCall(function, args+1, 2 | __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET);
35729static PyObject *__Pyx_Py3MetaclassPrepare(PyObject *metaclass, PyObject *bases, PyObject *name,
35730 PyObject *qualname, PyObject *mkw, PyObject *modname, PyObject *doc) {
35733 PyObject *prep = __Pyx_PyObject_GetAttrStrNoError(metaclass, __pyx_mstate_global->__pyx_n_u_prepare);
35735 PyObject *pargs[3] = {NULL, name, bases};
35736 ns = __Pyx_PyObject_FastCallDict(prep, pargs+1, 2 | __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET, mkw);
35739 if (unlikely(PyErr_Occurred()))
35748 if (unlikely(PyObject_SetItem(
ns, __pyx_mstate_global->__pyx_n_u_module, modname) < 0))
goto bad;
35749 if (unlikely(PyObject_SetItem(
ns, __pyx_mstate_global->__pyx_n_u_qualname, qualname) < 0))
goto bad;
35750 if (unlikely(doc && PyObject_SetItem(
ns, __pyx_mstate_global->__pyx_n_u_doc, doc) < 0))
goto bad;
35756static PyObject *__Pyx_Py3ClassCreate(PyObject *metaclass, PyObject *name, PyObject *bases,
35757 PyObject *dict, PyObject *mkw,
35758 int calculate_metaclass,
int allow_py2_metaclass) {
35760 PyObject *owned_metaclass = NULL;
35761 PyObject *margs[4] = {NULL, name, bases, dict};
35762 if (allow_py2_metaclass) {
35763 owned_metaclass = PyObject_GetItem(dict, __pyx_mstate_global->__pyx_n_u_metaclass);
35764 if (owned_metaclass) {
35765 metaclass = owned_metaclass;
35766 }
else if (likely(PyErr_ExceptionMatches(PyExc_KeyError))) {
35772 if (calculate_metaclass && (!metaclass || PyType_Check(metaclass))) {
35773 metaclass = __Pyx_CalculateMetaclass((PyTypeObject*) metaclass, bases);
35774 Py_XDECREF(owned_metaclass);
35775 if (unlikely(!metaclass))
35777 owned_metaclass = metaclass;
35779 result = __Pyx_PyObject_FastCallDict(metaclass, margs+1, 3 | __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET, mkw);
35780 Py_XDECREF(owned_metaclass);
35785#if CYTHON_CLINE_IN_TRACEBACK && CYTHON_CLINE_IN_TRACEBACK_RUNTIME
35786#if CYTHON_COMPILING_IN_LIMITED_API && __PYX_LIMITED_VERSION_HEX < 0x030A0000
35787#define __Pyx_PyProbablyModule_GetDict(o) __Pyx_XNewRef(PyModule_GetDict(o))
35788#elif !CYTHON_COMPILING_IN_CPYTHON || CYTHON_COMPILING_IN_CPYTHON_FREETHREADING
35789#define __Pyx_PyProbablyModule_GetDict(o) PyObject_GenericGetDict(o, NULL);
35791PyObject* __Pyx_PyProbablyModule_GetDict(PyObject *o) {
35792 PyObject **dict_ptr = _PyObject_GetDictPtr(o);
35793 return dict_ptr ? __Pyx_XNewRef(*dict_ptr) : NULL;
35796static int __Pyx_CLineForTraceback(PyThreadState *tstate,
int c_line) {
35797 PyObject *use_cline = NULL;
35798 PyObject *ptype, *pvalue, *ptraceback;
35799 PyObject *cython_runtime_dict;
35800 CYTHON_MAYBE_UNUSED_VAR(tstate);
35801 if (unlikely(!__pyx_mstate_global->__pyx_cython_runtime)) {
35804 __Pyx_ErrFetchInState(tstate, &ptype, &pvalue, &ptraceback);
35805 cython_runtime_dict = __Pyx_PyProbablyModule_GetDict(__pyx_mstate_global->__pyx_cython_runtime);
35806 if (likely(cython_runtime_dict)) {
35807 __PYX_PY_DICT_LOOKUP_IF_MODIFIED(
35808 use_cline, cython_runtime_dict,
35809 __Pyx_PyDict_SetDefault(cython_runtime_dict, __pyx_mstate_global->__pyx_n_u_cline_in_traceback, Py_False))
35811 if (use_cline == NULL || use_cline == Py_False || (use_cline != Py_True && PyObject_Not(use_cline) != 0)) {
35814 Py_XDECREF(use_cline);
35815 Py_XDECREF(cython_runtime_dict);
35816 __Pyx_ErrRestoreInState(tstate, ptype, pvalue, ptraceback);
35822static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries,
int count,
int code_line) {
35823 int start = 0, mid = 0, end = count - 1;
35824 if (end >= 0 && code_line > entries[end].code_line) {
35827 while (start < end) {
35828 mid = start + (end - start) / 2;
35829 if (code_line < entries[mid].code_line) {
35831 }
else if (code_line > entries[mid].code_line) {
35837 if (code_line <= entries[mid].code_line) {
35843static __Pyx_CachedCodeObjectType *__pyx__find_code_object(
struct __Pyx_CodeObjectCache *code_cache,
int code_line) {
35844 __Pyx_CachedCodeObjectType* code_object;
35846 if (unlikely(!code_line) || unlikely(!code_cache->entries)) {
35849 pos = __pyx_bisect_code_objects(code_cache->entries, code_cache->count, code_line);
35850 if (unlikely(pos >= code_cache->count) || unlikely(code_cache->entries[pos].code_line != code_line)) {
35853 code_object = code_cache->entries[pos].code_object;
35854 Py_INCREF(code_object);
35855 return code_object;
35857static __Pyx_CachedCodeObjectType *__pyx_find_code_object(
int code_line) {
35858#if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING && !CYTHON_ATOMICS
35859 (void)__pyx__find_code_object;
35862 struct __Pyx_CodeObjectCache *code_cache = &__pyx_mstate_global->__pyx_code_cache;
35863#if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING
35864 __pyx_nonatomic_int_type old_count = __pyx_atomic_incr_acq_rel(&code_cache->accessor_count);
35865 if (old_count < 0) {
35866 __pyx_atomic_decr_acq_rel(&code_cache->accessor_count);
35870 __Pyx_CachedCodeObjectType *result = __pyx__find_code_object(code_cache, code_line);
35871#if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING
35872 __pyx_atomic_decr_acq_rel(&code_cache->accessor_count);
35877static void __pyx__insert_code_object(
struct __Pyx_CodeObjectCache *code_cache,
int code_line, __Pyx_CachedCodeObjectType* code_object)
35880 __Pyx_CodeObjectCacheEntry* entries = code_cache->entries;
35881 if (unlikely(!code_line)) {
35884 if (unlikely(!entries)) {
35885 entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Malloc(64*
sizeof(__Pyx_CodeObjectCacheEntry));
35886 if (likely(entries)) {
35887 code_cache->entries = entries;
35888 code_cache->max_count = 64;
35889 code_cache->count = 1;
35890 entries[0].code_line = code_line;
35891 entries[0].code_object = code_object;
35892 Py_INCREF(code_object);
35896 pos = __pyx_bisect_code_objects(code_cache->entries, code_cache->count, code_line);
35897 if ((pos < code_cache->count) && unlikely(code_cache->entries[pos].code_line == code_line)) {
35898 __Pyx_CachedCodeObjectType* tmp = entries[pos].code_object;
35899 entries[pos].code_object = code_object;
35900 Py_INCREF(code_object);
35904 if (code_cache->count == code_cache->max_count) {
35905 int new_max = code_cache->max_count + 64;
35906 entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Realloc(
35907 code_cache->entries, ((
size_t)new_max) *
sizeof(__Pyx_CodeObjectCacheEntry));
35908 if (unlikely(!entries)) {
35911 code_cache->entries = entries;
35912 code_cache->max_count = new_max;
35914 for (i=code_cache->count; i>pos; i--) {
35915 entries[i] = entries[i-1];
35917 entries[pos].code_line = code_line;
35918 entries[pos].code_object = code_object;
35919 code_cache->count++;
35920 Py_INCREF(code_object);
35922static void __pyx_insert_code_object(
int code_line, __Pyx_CachedCodeObjectType* code_object) {
35923#if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING && !CYTHON_ATOMICS
35924 (void)__pyx__insert_code_object;
35927 struct __Pyx_CodeObjectCache *code_cache = &__pyx_mstate_global->__pyx_code_cache;
35928#if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING
35929 __pyx_nonatomic_int_type expected = 0;
35930 if (!__pyx_atomic_int_cmp_exchange(&code_cache->accessor_count, &expected, INT_MIN)) {
35934 __pyx__insert_code_object(code_cache, code_line, code_object);
35935#if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING
35936 __pyx_atomic_sub(&code_cache->accessor_count, INT_MIN);
35942#include "compile.h"
35943#include "frameobject.h"
35944#include "traceback.h"
35945#if PY_VERSION_HEX >= 0x030b00a6 && !CYTHON_COMPILING_IN_LIMITED_API && !defined(PYPY_VERSION)
35946 #ifndef Py_BUILD_CORE
35947 #define Py_BUILD_CORE 1
35949 #include "internal/pycore_frame.h"
35951#if CYTHON_COMPILING_IN_LIMITED_API
35952static PyObject *__Pyx_PyCode_Replace_For_AddTraceback(PyObject *code, PyObject *scratch_dict,
35953 PyObject *firstlineno, PyObject *name) {
35954 PyObject *replace = NULL;
35955 if (unlikely(PyDict_SetItemString(scratch_dict,
"co_firstlineno", firstlineno)))
return NULL;
35956 if (unlikely(PyDict_SetItemString(scratch_dict,
"co_name", name)))
return NULL;
35957 replace = PyObject_GetAttrString(code,
"replace");
35958 if (likely(replace)) {
35959 PyObject *result = PyObject_Call(replace, __pyx_mstate_global->__pyx_empty_tuple, scratch_dict);
35960 Py_DECREF(replace);
35965static void __Pyx_AddTraceback(
const char *funcname,
int c_line,
35966 int py_line,
const char *filename) {
35967 PyObject *code_object = NULL, *py_py_line = NULL, *py_funcname = NULL, *dict = NULL;
35968 PyObject *replace = NULL, *getframe = NULL, *frame = NULL;
35969 PyObject *exc_type, *exc_value, *exc_traceback;
35972 c_line = __Pyx_CLineForTraceback(__Pyx_PyThreadState_Current, c_line);
35974 __Pyx_PyErr_FetchException(&exc_type, &exc_value, &exc_traceback);
35975 code_object = __pyx_find_code_object(c_line ? -c_line : py_line);
35976 if (!code_object) {
35977 code_object = Py_CompileString(
"_getframe()", filename, Py_eval_input);
35978 if (unlikely(!code_object))
goto bad;
35979 py_py_line = PyLong_FromLong(py_line);
35980 if (unlikely(!py_py_line))
goto bad;
35982 py_funcname = PyUnicode_FromFormat(
"%s (%s:%d)", funcname, __pyx_cfilenm, c_line);
35984 py_funcname = PyUnicode_FromString(funcname);
35986 if (unlikely(!py_funcname))
goto bad;
35987 dict = PyDict_New();
35988 if (unlikely(!dict))
goto bad;
35990 PyObject *old_code_object = code_object;
35991 code_object = __Pyx_PyCode_Replace_For_AddTraceback(code_object, dict, py_py_line, py_funcname);
35992 Py_DECREF(old_code_object);
35994 if (unlikely(!code_object))
goto bad;
35995 __pyx_insert_code_object(c_line ? -c_line : py_line, code_object);
35997 dict = PyDict_New();
35999 getframe = PySys_GetObject(
"_getframe");
36000 if (unlikely(!getframe))
goto bad;
36001 if (unlikely(PyDict_SetItemString(dict,
"_getframe", getframe)))
goto bad;
36002 frame = PyEval_EvalCode(code_object, dict, dict);
36003 if (unlikely(!frame) || frame == Py_None)
goto bad;
36006 __Pyx_PyErr_RestoreException(exc_type, exc_value, exc_traceback);
36007 Py_XDECREF(code_object);
36008 Py_XDECREF(py_py_line);
36009 Py_XDECREF(py_funcname);
36011 Py_XDECREF(replace);
36014 (
struct _frame*)frame);
36019static PyCodeObject* __Pyx_CreateCodeObjectForTraceback(
36020 const char *funcname,
int c_line,
36021 int py_line,
const char *filename) {
36022 PyCodeObject *py_code = NULL;
36023 PyObject *py_funcname = NULL;
36025 py_funcname = PyUnicode_FromFormat(
"%s (%s:%d)", funcname, __pyx_cfilenm, c_line);
36026 if (!py_funcname)
goto bad;
36027 funcname = PyUnicode_AsUTF8(py_funcname);
36028 if (!funcname)
goto bad;
36030 py_code = PyCode_NewEmpty(filename, funcname, py_line);
36031 Py_XDECREF(py_funcname);
36034 Py_XDECREF(py_funcname);
36037static void __Pyx_AddTraceback(
const char *funcname,
int c_line,
36038 int py_line,
const char *filename) {
36039 PyCodeObject *py_code = 0;
36040 PyFrameObject *py_frame = 0;
36041 PyThreadState *tstate = __Pyx_PyThreadState_Current;
36042 PyObject *ptype, *pvalue, *ptraceback;
36044 c_line = __Pyx_CLineForTraceback(tstate, c_line);
36046 py_code = __pyx_find_code_object(c_line ? -c_line : py_line);
36048 __Pyx_ErrFetchInState(tstate, &ptype, &pvalue, &ptraceback);
36049 py_code = __Pyx_CreateCodeObjectForTraceback(
36050 funcname, c_line, py_line, filename);
36055 Py_XDECREF(pvalue);
36056 Py_XDECREF(ptraceback);
36059 __Pyx_ErrRestoreInState(tstate, ptype, pvalue, ptraceback);
36060 __pyx_insert_code_object(c_line ? -c_line : py_line, py_code);
36062 py_frame = PyFrame_New(
36065 __pyx_mstate_global->__pyx_d,
36068 if (!py_frame)
goto bad;
36069 __Pyx_PyFrame_SetLineNumber(py_frame, py_line);
36070 PyTraceBack_Here(py_frame);
36072 Py_XDECREF(py_code);
36073 Py_XDECREF(py_frame);
36079#ifndef _Py_NO_RETURN
36080#define _Py_NO_RETURN
36083static void __pyx_fatalerror(
const char *fmt, ...) {
36086#if PY_VERSION_HEX >= 0x030A0000 || defined(HAVE_STDARG_PROTOTYPES)
36087 va_start(vargs, fmt);
36091 vsnprintf(msg, 200, fmt, vargs);
36093 Py_FatalError(msg);
36095static CYTHON_INLINE
int
36096__pyx_add_acquisition_count_locked(__pyx_atomic_int_type *acquisition_count,
36097 PyThread_type_lock lock)
36100 PyThread_acquire_lock(lock, 1);
36101 result = (*acquisition_count)++;
36102 PyThread_release_lock(lock);
36105static CYTHON_INLINE
int
36106__pyx_sub_acquisition_count_locked(__pyx_atomic_int_type *acquisition_count,
36107 PyThread_type_lock lock)
36110 PyThread_acquire_lock(lock, 1);
36111 result = (*acquisition_count)--;
36112 PyThread_release_lock(lock);
36115static CYTHON_INLINE
void
36116__Pyx_INC_MEMVIEW(__Pyx_memviewslice *memslice,
int have_gil,
int lineno)
36118 __pyx_nonatomic_int_type old_acquisition_count;
36119 struct __pyx_memoryview_obj *memview = memslice->memview;
36120 if (unlikely(!memview || (PyObject *) memview == Py_None)) {
36123 old_acquisition_count = __pyx_add_acquisition_count(memview);
36124 if (unlikely(old_acquisition_count <= 0)) {
36125 if (likely(old_acquisition_count == 0)) {
36127 Py_INCREF((PyObject *) memview);
36129 PyGILState_STATE _gilstate = PyGILState_Ensure();
36130 Py_INCREF((PyObject *) memview);
36131 PyGILState_Release(_gilstate);
36134 __pyx_fatalerror(
"Acquisition count is %d (line %d)",
36135 old_acquisition_count+1, lineno);
36139static CYTHON_INLINE
void __Pyx_XCLEAR_MEMVIEW(__Pyx_memviewslice *memslice,
36140 int have_gil,
int lineno) {
36141 __pyx_nonatomic_int_type old_acquisition_count;
36142 struct __pyx_memoryview_obj *memview = memslice->memview;
36143 if (unlikely(!memview || (PyObject *) memview == Py_None)) {
36144 memslice->memview = NULL;
36147 old_acquisition_count = __pyx_sub_acquisition_count(memview);
36148 memslice->data = NULL;
36149 if (likely(old_acquisition_count > 1)) {
36150 memslice->memview = NULL;
36151 }
else if (likely(old_acquisition_count == 1)) {
36153 Py_CLEAR(memslice->memview);
36155 PyGILState_STATE _gilstate = PyGILState_Ensure();
36156 Py_CLEAR(memslice->memview);
36157 PyGILState_Release(_gilstate);
36160 __pyx_fatalerror(
"Acquisition count is %d (line %d)",
36161 old_acquisition_count-1, lineno);
36167__pyx_memviewslice_is_contig(
const __Pyx_memviewslice mvs,
char order,
int ndim)
36169 int i, index, step, start;
36170 Py_ssize_t itemsize = mvs.memview->view.itemsize;
36171 if (order ==
'F') {
36178 for (i = 0; i < ndim; i++) {
36179 index = start + step * i;
36180 if (mvs.suboffsets[index] >= 0 || mvs.strides[index] != itemsize)
36182 itemsize *= mvs.shape[index];
36189__pyx_get_array_memory_extents(__Pyx_memviewslice *slice,
36190 void **out_start,
void **out_end,
36191 int ndim,
size_t itemsize)
36195 start = end = slice->data;
36196 for (i = 0; i < ndim; i++) {
36197 Py_ssize_t stride = slice->strides[i];
36198 Py_ssize_t extent = slice->shape[i];
36200 *out_start = *out_end = start;
36204 end += stride * (extent - 1);
36206 start += stride * (extent - 1);
36209 *out_start = start;
36210 *out_end = end + itemsize;
36213__pyx_slices_overlap(__Pyx_memviewslice *slice1,
36214 __Pyx_memviewslice *slice2,
36215 int ndim,
size_t itemsize)
36217 void *start1, *end1, *start2, *end2;
36218 __pyx_get_array_memory_extents(slice1, &start1, &end1, ndim, itemsize);
36219 __pyx_get_array_memory_extents(slice2, &start2, &end2, ndim, itemsize);
36220 return (start1 < end2) && (start2 < end1);
36225__Pyx_init_memviewslice(
struct __pyx_memoryview_obj *memview,
36227 __Pyx_memviewslice *memviewslice,
36228 int memview_is_new_reference)
36230 __Pyx_RefNannyDeclarations
36232 Py_buffer *buf = &memview->view;
36233 __Pyx_RefNannySetupContext(
"init_memviewslice", 0);
36234 if (unlikely(memviewslice->memview || memviewslice->data)) {
36235 PyErr_SetString(PyExc_ValueError,
36236 "memviewslice is already initialized!");
36239 if (buf->strides) {
36240 for (i = 0; i < ndim; i++) {
36241 memviewslice->strides[i] = buf->strides[i];
36244 Py_ssize_t stride = buf->itemsize;
36245 for (i = ndim - 1; i >= 0; i--) {
36246 memviewslice->strides[i] = stride;
36247 stride *= buf->shape[i];
36250 for (i = 0; i < ndim; i++) {
36251 memviewslice->shape[i] = buf->shape[i];
36252 if (buf->suboffsets) {
36253 memviewslice->suboffsets[i] = buf->suboffsets[i];
36255 memviewslice->suboffsets[i] = -1;
36258 memviewslice->memview = memview;
36259 memviewslice->data = (
char *)buf->buf;
36260 if (__pyx_add_acquisition_count(memview) == 0 && !memview_is_new_reference) {
36261 Py_INCREF((PyObject*)memview);
36266 memviewslice->memview = 0;
36267 memviewslice->data = 0;
36270 __Pyx_RefNannyFinishContext();
36275static void __pyx_memoryview_slice_memviewslice_err_dim(PyObject *error,
const char* msg,
int dim) {
36276 PyGILState_STATE gilstate = PyGILState_Ensure();
36277 PyErr_Format(error, msg, dim);
36278 PyGILState_Release(gilstate);
36280static CYTHON_INLINE
int __pyx_memoryview_slice_memviewslice(
36281 __Pyx_memviewslice *dst,
36282 Py_ssize_t shape, Py_ssize_t stride, Py_ssize_t suboffset,
36283 int dim,
int new_ndim,
int *suboffset_dim,
36284 Py_ssize_t start, Py_ssize_t stop, Py_ssize_t step,
36285 int have_start,
int have_stop,
int have_step,
36291 if (unlikely(!(0 <= start && start < shape))) {
36292 __pyx_memoryview_slice_memviewslice_err_dim(PyExc_IndexError,
"Index out of bounds (axis %d)", dim);
36298 negative_step = step < 0;
36299 if (unlikely(step == 0)) {
36300 __pyx_memoryview_slice_memviewslice_err_dim(PyExc_ValueError,
"Step may not be zero (axis %d)", dim);
36313 }
else if (start >= shape) {
36314 start = negative_step ? (shape - 1) : shape;
36317 start = negative_step ? (shape - 1) : 0;
36325 }
else if (stop > shape) {
36329 stop = negative_step ? -1 : shape;
36331 Py_ssize_t new_shape = (stop - start) / step;
36332 if ((stop - start) - step * new_shape) {
36335 if (new_shape < 0) {
36338 dst->strides[new_ndim] = stride * step;
36339 dst->shape[new_ndim] = new_shape;
36340 dst->suboffsets[new_ndim] = suboffset;
36342 if (suboffset_dim[0] < 0) {
36343 dst->data += start * stride;
36345 dst->suboffsets[suboffset_dim[0]] += start * stride;
36347 if (suboffset >= 0) {
36349 if (likely(new_ndim == 0)) {
36350 dst->data = ((
char **)(dst->data))[0] + suboffset;
36352 __pyx_memoryview_slice_memviewslice_err_dim(
36354 "All dimensions preceding dimension %d must be indexed and not sliced",
36359 suboffset_dim[0] = new_ndim;
36366#define __PYX_VERIFY_RETURN_INT(target_type, func_type, func_value)\
36367 __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 0)
36368#define __PYX_VERIFY_RETURN_INT_EXC(target_type, func_type, func_value)\
36369 __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 1)
36370#define __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, exc)\
36372 func_type value = func_value;\
36373 if (sizeof(target_type) < sizeof(func_type)) {\
36374 if (unlikely(value != (func_type) (target_type) value)) {\
36375 func_type zero = 0;\
36376 if (exc && unlikely(value == (func_type)-1 && PyErr_Occurred()))\
36377 return (target_type) -1;\
36378 if (is_unsigned && unlikely(value < zero))\
36379 goto raise_neg_overflow;\
36381 goto raise_overflow;\
36384 return (target_type) value;\
36388static CYTHON_INLINE
int __Pyx_Is_Little_Endian(
void)
36394 S.u32 = 0x01020304;
36395 return S.u8[0] == 4;
36399static void __Pyx_BufFmt_Init(__Pyx_BufFmt_Context* ctx,
36400 __Pyx_BufFmt_StackElem* stack,
36401 const __Pyx_TypeInfo* type) {
36402 stack[0].field = &ctx->root;
36403 stack[0].parent_offset = 0;
36404 ctx->root.type = type;
36405 ctx->root.name =
"buffer dtype";
36406 ctx->root.offset = 0;
36408 ctx->head->field = &ctx->root;
36409 ctx->fmt_offset = 0;
36410 ctx->head->parent_offset = 0;
36411 ctx->new_packmode =
'@';
36412 ctx->enc_packmode =
'@';
36413 ctx->new_count = 1;
36414 ctx->enc_count = 0;
36416 ctx->is_complex = 0;
36417 ctx->is_valid_array = 0;
36418 ctx->struct_alignment = 0;
36419 while (type->typegroup ==
'S') {
36421 ctx->head->field = type->fields;
36422 ctx->head->parent_offset = 0;
36423 type = type->fields->type;
36426static int __Pyx_BufFmt_ParseNumber(
const char** ts) {
36428 const char* t = *ts;
36429 if (*t <
'0' || *t >
'9') {
36432 count = *t++ -
'0';
36433 while (*t >=
'0' && *t <=
'9') {
36435 count += *t++ -
'0';
36441static int __Pyx_BufFmt_ExpectNumber(
const char **ts) {
36442 int number = __Pyx_BufFmt_ParseNumber(ts);
36444 PyErr_Format(PyExc_ValueError,\
36445 "Does not understand character buffer dtype format string ('%c')", **ts);
36448static void __Pyx_BufFmt_RaiseUnexpectedChar(
char ch) {
36449 PyErr_Format(PyExc_ValueError,
36450 "Unexpected format string character: '%c'", ch);
36452static const char* __Pyx_BufFmt_DescribeTypeChar(
char ch,
int is_complex) {
36454 case '?':
return "'bool'";
36455 case 'c':
return "'char'";
36456 case 'b':
return "'signed char'";
36457 case 'B':
return "'unsigned char'";
36458 case 'h':
return "'short'";
36459 case 'H':
return "'unsigned short'";
36460 case 'i':
return "'int'";
36461 case 'I':
return "'unsigned int'";
36462 case 'l':
return "'long'";
36463 case 'L':
return "'unsigned long'";
36464 case 'q':
return "'long long'";
36465 case 'Q':
return "'unsigned long long'";
36466 case 'f':
return (is_complex ?
"'complex float'" :
"'float'");
36467 case 'd':
return (is_complex ?
"'complex double'" :
"'double'");
36468 case 'g':
return (is_complex ?
"'complex long double'" :
"'long double'");
36469 case 'T':
return "a struct";
36470 case 'O':
return "Python object";
36471 case 'P':
return "a pointer";
36472 case 's':
case 'p':
return "a string";
36473 case 0:
return "end";
36474 default:
return "unparsable format string";
36477static size_t __Pyx_BufFmt_TypeCharToStandardSize(
char ch,
int is_complex) {
36479 case '?':
case 'c':
case 'b':
case 'B':
case 's':
case 'p':
return 1;
36480 case 'h':
case 'H':
return 2;
36481 case 'i':
case 'I':
case 'l':
case 'L':
return 4;
36482 case 'q':
case 'Q':
return 8;
36483 case 'f':
return (is_complex ? 8 : 4);
36484 case 'd':
return (is_complex ? 16 : 8);
36486 PyErr_SetString(PyExc_ValueError,
"Python does not define a standard format string size for long double ('g')..");
36489 case 'O':
case 'P':
return sizeof(
void*);
36491 __Pyx_BufFmt_RaiseUnexpectedChar(ch);
36495static size_t __Pyx_BufFmt_TypeCharToNativeSize(
char ch,
int is_complex) {
36497 case '?':
case 'c':
case 'b':
case 'B':
case 's':
case 'p':
return 1;
36498 case 'h':
case 'H':
return sizeof(short);
36499 case 'i':
case 'I':
return sizeof(int);
36500 case 'l':
case 'L':
return sizeof(long);
36501 case 'q':
case 'Q':
return sizeof(PY_LONG_LONG);
36502 case 'f':
return sizeof(float) * (is_complex ? 2 : 1);
36503 case 'd':
return sizeof(double) * (is_complex ? 2 : 1);
36504 case 'g':
return sizeof(
long double) * (is_complex ? 2 : 1);
36505 case 'O':
case 'P':
return sizeof(
void*);
36507 __Pyx_BufFmt_RaiseUnexpectedChar(ch);
36512typedef struct {
char c;
short x; } __Pyx_st_short;
36513typedef struct {
char c;
int x; } __Pyx_st_int;
36514typedef struct {
char c;
long x; } __Pyx_st_long;
36515typedef struct {
char c;
float x; } __Pyx_st_float;
36516typedef struct {
char c;
double x; } __Pyx_st_double;
36517typedef struct {
char c;
long double x; } __Pyx_st_longdouble;
36518typedef struct {
char c;
void *x; } __Pyx_st_void_p;
36519typedef struct {
char c; PY_LONG_LONG x; } __Pyx_st_longlong;
36520static size_t __Pyx_BufFmt_TypeCharToAlignment(
char ch,
int is_complex) {
36521 CYTHON_UNUSED_VAR(is_complex);
36523 case '?':
case 'c':
case 'b':
case 'B':
case 's':
case 'p':
return 1;
36524 case 'h':
case 'H':
return sizeof(__Pyx_st_short) -
sizeof(
short);
36525 case 'i':
case 'I':
return sizeof(__Pyx_st_int) -
sizeof(
int);
36526 case 'l':
case 'L':
return sizeof(__Pyx_st_long) -
sizeof(
long);
36527 case 'q':
case 'Q':
return sizeof(__Pyx_st_longlong) -
sizeof(PY_LONG_LONG);
36528 case 'f':
return sizeof(__Pyx_st_float) -
sizeof(
float);
36529 case 'd':
return sizeof(__Pyx_st_double) -
sizeof(
double);
36530 case 'g':
return sizeof(__Pyx_st_longdouble) -
sizeof(
long double);
36531 case 'P':
case 'O':
return sizeof(__Pyx_st_void_p) -
sizeof(
void*);
36533 __Pyx_BufFmt_RaiseUnexpectedChar(ch);
36541typedef struct {
short x;
char c; } __Pyx_pad_short;
36542typedef struct {
int x;
char c; } __Pyx_pad_int;
36543typedef struct {
long x;
char c; } __Pyx_pad_long;
36544typedef struct {
float x;
char c; } __Pyx_pad_float;
36545typedef struct {
double x;
char c; } __Pyx_pad_double;
36546typedef struct {
long double x;
char c; } __Pyx_pad_longdouble;
36547typedef struct {
void *x;
char c; } __Pyx_pad_void_p;
36548typedef struct { PY_LONG_LONG x;
char c; } __Pyx_pad_longlong;
36549static size_t __Pyx_BufFmt_TypeCharToPadding(
char ch,
int is_complex) {
36550 CYTHON_UNUSED_VAR(is_complex);
36552 case '?':
case 'c':
case 'b':
case 'B':
case 's':
case 'p':
return 1;
36553 case 'h':
case 'H':
return sizeof(__Pyx_pad_short) -
sizeof(
short);
36554 case 'i':
case 'I':
return sizeof(__Pyx_pad_int) -
sizeof(
int);
36555 case 'l':
case 'L':
return sizeof(__Pyx_pad_long) -
sizeof(
long);
36556 case 'q':
case 'Q':
return sizeof(__Pyx_pad_longlong) -
sizeof(PY_LONG_LONG);
36557 case 'f':
return sizeof(__Pyx_pad_float) -
sizeof(
float);
36558 case 'd':
return sizeof(__Pyx_pad_double) -
sizeof(
double);
36559 case 'g':
return sizeof(__Pyx_pad_longdouble) -
sizeof(
long double);
36560 case 'P':
case 'O':
return sizeof(__Pyx_pad_void_p) -
sizeof(
void*);
36562 __Pyx_BufFmt_RaiseUnexpectedChar(ch);
36566static char __Pyx_BufFmt_TypeCharToGroup(
char ch,
int is_complex) {
36570 case 'b':
case 'h':
case 'i':
36571 case 'l':
case 'q':
case 's':
case 'p':
36573 case '?':
case 'B':
case 'H':
case 'I':
case 'L':
case 'Q':
36575 case 'f':
case 'd':
case 'g':
36576 return (is_complex ?
'C' :
'R');
36582 __Pyx_BufFmt_RaiseUnexpectedChar(ch);
36587static void __Pyx_BufFmt_RaiseExpected(__Pyx_BufFmt_Context* ctx) {
36588 if (ctx->head == NULL || ctx->head->field == &ctx->root) {
36589 const char* expected;
36591 if (ctx->head == NULL) {
36595 expected = ctx->head->field->type->name;
36598 PyErr_Format(PyExc_ValueError,
36599 "Buffer dtype mismatch, expected %s%s%s but got %s",
36600 quote, expected, quote,
36601 __Pyx_BufFmt_DescribeTypeChar(ctx->enc_type, ctx->is_complex));
36603 const __Pyx_StructField* field = ctx->head->field;
36604 const __Pyx_StructField* parent = (ctx->head - 1)->field;
36605 PyErr_Format(PyExc_ValueError,
36606 "Buffer dtype mismatch, expected '%s' but got %s in '%s.%s'",
36607 field->type->name, __Pyx_BufFmt_DescribeTypeChar(ctx->enc_type, ctx->is_complex),
36608 parent->type->name, field->name);
36611static int __Pyx_BufFmt_ProcessTypeChunk(__Pyx_BufFmt_Context* ctx) {
36613 size_t size, offset, arraysize = 1;
36614 if (ctx->enc_type == 0)
return 0;
36615 if (ctx->head->field->type->arraysize[0]) {
36617 if (ctx->enc_type ==
's' || ctx->enc_type ==
'p') {
36618 ctx->is_valid_array = ctx->head->field->type->ndim == 1;
36620 if (ctx->enc_count != ctx->head->field->type->arraysize[0]) {
36621 PyErr_Format(PyExc_ValueError,
36622 "Expected a dimension of size %zu, got %zu",
36623 ctx->head->field->type->arraysize[0], ctx->enc_count);
36627 if (!ctx->is_valid_array) {
36628 PyErr_Format(PyExc_ValueError,
"Expected %d dimensions, got %d",
36629 ctx->head->field->type->ndim, ndim);
36632 for (i = 0; i < ctx->head->field->type->ndim; i++) {
36633 arraysize *= ctx->head->field->type->arraysize[i];
36635 ctx->is_valid_array = 0;
36636 ctx->enc_count = 1;
36638 group = __Pyx_BufFmt_TypeCharToGroup(ctx->enc_type, ctx->is_complex);
36640 const __Pyx_StructField* field = ctx->head->field;
36641 const __Pyx_TypeInfo* type = field->type;
36642 if (ctx->enc_packmode ==
'@' || ctx->enc_packmode ==
'^') {
36643 size = __Pyx_BufFmt_TypeCharToNativeSize(ctx->enc_type, ctx->is_complex);
36645 size = __Pyx_BufFmt_TypeCharToStandardSize(ctx->enc_type, ctx->is_complex);
36647 if (ctx->enc_packmode ==
'@') {
36648 size_t align_at = __Pyx_BufFmt_TypeCharToAlignment(ctx->enc_type, ctx->is_complex);
36649 size_t align_mod_offset;
36650 if (align_at == 0)
return -1;
36651 align_mod_offset = ctx->fmt_offset % align_at;
36652 if (align_mod_offset > 0) ctx->fmt_offset += align_at - align_mod_offset;
36653 if (ctx->struct_alignment == 0)
36654 ctx->struct_alignment = __Pyx_BufFmt_TypeCharToPadding(ctx->enc_type,
36657 if (type->size != size || type->typegroup != group) {
36658 if (type->typegroup ==
'C' && type->fields != NULL) {
36659 size_t parent_offset = ctx->head->parent_offset + field->offset;
36661 ctx->head->field = type->fields;
36662 ctx->head->parent_offset = parent_offset;
36665 if ((type->typegroup ==
'H' || group ==
'H') && type->size == size) {
36667 __Pyx_BufFmt_RaiseExpected(ctx);
36671 offset = ctx->head->parent_offset + field->offset;
36672 if (ctx->fmt_offset != offset) {
36673 PyErr_Format(PyExc_ValueError,
36674 "Buffer dtype mismatch; next field is at offset %" CYTHON_FORMAT_SSIZE_T
"d but %" CYTHON_FORMAT_SSIZE_T
"d expected",
36675 (Py_ssize_t)ctx->fmt_offset, (Py_ssize_t)offset);
36678 ctx->fmt_offset += size;
36680 ctx->fmt_offset += (arraysize - 1) * size;
36683 if (field == &ctx->root) {
36685 if (ctx->enc_count != 0) {
36686 __Pyx_BufFmt_RaiseExpected(ctx);
36691 ctx->head->field = ++field;
36692 if (field->type == NULL) {
36694 field = ctx->head->field;
36696 }
else if (field->type->typegroup ==
'S') {
36697 size_t parent_offset = ctx->head->parent_offset + field->offset;
36698 if (field->type->fields->type == NULL)
continue;
36699 field = field->type->fields;
36701 ctx->head->field = field;
36702 ctx->head->parent_offset = parent_offset;
36708 }
while (ctx->enc_count);
36710 ctx->is_complex = 0;
36714__pyx_buffmt_parse_array(__Pyx_BufFmt_Context* ctx,
const char** tsp)
36716 const char *ts = *tsp;
36717 int i = 0,
number, ndim;
36719 if (ctx->new_count != 1) {
36720 PyErr_SetString(PyExc_ValueError,
36721 "Cannot handle repeated arrays in format string");
36724 if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1)
return -1;
36725 ndim = ctx->head->field->type->ndim;
36726 while (*ts && *ts !=
')') {
36728 case ' ':
case '\f':
case '\r':
case '\n':
case '\t':
case '\v':
continue;
36731 number = __Pyx_BufFmt_ExpectNumber(&ts);
36732 if (
number == -1)
return -1;
36733 if (i < ndim && (
size_t)
number != ctx->head->field->type->arraysize[i]) {
36734 PyErr_Format(PyExc_ValueError,
36735 "Expected a dimension of size %zu, got %d",
36736 ctx->head->field->type->arraysize[i],
number);
36739 if (*ts !=
',' && *ts !=
')') {
36740 PyErr_Format(PyExc_ValueError,
36741 "Expected a comma in format string, got '%c'", *ts);
36744 if (*ts ==
',') ts++;
36748 PyErr_Format(PyExc_ValueError,
"Expected %d dimension(s), got %d",
36749 ctx->head->field->type->ndim, i);
36753 PyErr_SetString(PyExc_ValueError,
36754 "Unexpected end of format string, expected ')'");
36757 ctx->is_valid_array = 1;
36758 ctx->new_count = 1;
36762static const char* __Pyx_BufFmt_CheckString(__Pyx_BufFmt_Context* ctx,
const char* ts) {
36767 if (ctx->enc_type != 0 && ctx->head == NULL) {
36768 __Pyx_BufFmt_RaiseExpected(ctx);
36771 if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1)
return NULL;
36772 if (ctx->head != NULL) {
36773 __Pyx_BufFmt_RaiseExpected(ctx);
36783 if (!__Pyx_Is_Little_Endian()) {
36784 PyErr_SetString(PyExc_ValueError,
"Little-endian buffer not supported on big-endian compiler");
36787 ctx->new_packmode =
'=';
36792 if (__Pyx_Is_Little_Endian()) {
36793 PyErr_SetString(PyExc_ValueError,
"Big-endian buffer not supported on little-endian compiler");
36796 ctx->new_packmode =
'=';
36802 ctx->new_packmode = *ts++;
36806 const char* ts_after_sub;
36807 size_t i, struct_count = ctx->new_count;
36808 size_t struct_alignment = ctx->struct_alignment;
36809 ctx->new_count = 1;
36811 if (*ts !=
'\x7B') {
36812 PyErr_SetString(PyExc_ValueError,
"Buffer acquisition: Expected '\x7B' after 'T'");
36815 if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1)
return NULL;
36817 ctx->enc_count = 0;
36818 ctx->struct_alignment = 0;
36821 for (i = 0; i != struct_count; ++i) {
36822 ts_after_sub = __Pyx_BufFmt_CheckString(ctx, ts);
36823 if (!ts_after_sub)
return NULL;
36826 if (struct_alignment) ctx->struct_alignment = struct_alignment;
36831 size_t alignment = ctx->struct_alignment;
36833 if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1)
return NULL;
36835 if (alignment && ctx->fmt_offset % alignment) {
36836 ctx->fmt_offset += alignment - (ctx->fmt_offset % alignment);
36841 if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1)
return NULL;
36842 ctx->fmt_offset += ctx->new_count;
36843 ctx->new_count = 1;
36844 ctx->enc_count = 0;
36846 ctx->enc_packmode = ctx->new_packmode;
36852 if (*ts !=
'f' && *ts !=
'd' && *ts !=
'g') {
36853 __Pyx_BufFmt_RaiseUnexpectedChar(
'Z');
36856 CYTHON_FALLTHROUGH;
36857 case '?':
case 'c':
case 'b':
case 'B':
case 'h':
case 'H':
case 'i':
case 'I':
36858 case 'l':
case 'L':
case 'q':
case 'Q':
36859 case 'f':
case 'd':
case 'g':
36860 case 'O':
case 'p':
36861 if ((ctx->enc_type == *ts) && (got_Z == ctx->is_complex) &&
36862 (ctx->enc_packmode == ctx->new_packmode) && (!ctx->is_valid_array)) {
36863 ctx->enc_count += ctx->new_count;
36864 ctx->new_count = 1;
36869 CYTHON_FALLTHROUGH;
36871 if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1)
return NULL;
36872 ctx->enc_count = ctx->new_count;
36873 ctx->enc_packmode = ctx->new_packmode;
36874 ctx->enc_type = *ts;
36875 ctx->is_complex = got_Z;
36877 ctx->new_count = 1;
36882 while(*ts !=
':') ++ts;
36886 if (__pyx_buffmt_parse_array(ctx, &ts) < 0)
return NULL;
36890 int number = __Pyx_BufFmt_ExpectNumber(&ts);
36891 if (
number == -1)
return NULL;
36892 ctx->new_count = (size_t)
number;
36900__pyx_typeinfo_cmp(
const __Pyx_TypeInfo *a,
const __Pyx_TypeInfo *b)
36907 if (a->size != b->size || a->typegroup != b->typegroup ||
36908 a->is_unsigned != b->is_unsigned || a->ndim != b->ndim) {
36909 if (a->typegroup ==
'H' || b->typegroup ==
'H') {
36910 return a->size == b->size;
36916 for (i = 0; i < a->ndim; i++)
36917 if (a->arraysize[i] != b->arraysize[i])
36920 if (a->typegroup ==
'S') {
36921 if (a->flags != b->flags)
36923 if (a->fields || b->fields) {
36924 if (!(a->fields && b->fields))
36926 for (i = 0; a->fields[i].type && b->fields[i].type; i++) {
36927 const __Pyx_StructField *field_a = a->fields + i;
36928 const __Pyx_StructField *field_b = b->fields + i;
36929 if (field_a->offset != field_b->offset ||
36930 !__pyx_typeinfo_cmp(field_a->type, field_b->type))
36933 return !a->fields[i].type && !b->fields[i].type;
36941__pyx_check_strides(Py_buffer *buf,
int dim,
int ndim,
int spec)
36943 if (buf->shape[dim] <= 1)
36945 if (buf->strides) {
36946 if (spec & __Pyx_MEMVIEW_CONTIG) {
36947 if (spec & (__Pyx_MEMVIEW_PTR|__Pyx_MEMVIEW_FULL)) {
36948 if (unlikely(buf->strides[dim] !=
sizeof(
void *))) {
36949 PyErr_Format(PyExc_ValueError,
36950 "Buffer is not indirectly contiguous "
36951 "in dimension %d.", dim);
36954 }
else if (unlikely(buf->strides[dim] != buf->itemsize)) {
36955 PyErr_SetString(PyExc_ValueError,
36956 "Buffer and memoryview are not contiguous "
36957 "in the same dimension.");
36961 if (spec & __Pyx_MEMVIEW_FOLLOW) {
36962 Py_ssize_t stride = buf->strides[dim];
36965 if (unlikely(stride < buf->itemsize)) {
36966 PyErr_SetString(PyExc_ValueError,
36967 "Buffer and memoryview are not contiguous "
36968 "in the same dimension.");
36973 if (unlikely(spec & __Pyx_MEMVIEW_CONTIG && dim != ndim - 1)) {
36974 PyErr_Format(PyExc_ValueError,
36975 "C-contiguous buffer is not contiguous in "
36976 "dimension %d", dim);
36978 }
else if (unlikely(spec & (__Pyx_MEMVIEW_PTR))) {
36979 PyErr_Format(PyExc_ValueError,
36980 "C-contiguous buffer is not indirect in "
36981 "dimension %d", dim);
36983 }
else if (unlikely(buf->suboffsets)) {
36984 PyErr_SetString(PyExc_ValueError,
36985 "Buffer exposes suboffsets but no strides");
36994__pyx_check_suboffsets(Py_buffer *buf,
int dim,
int ndim,
int spec)
36996 CYTHON_UNUSED_VAR(ndim);
36997 if (spec & __Pyx_MEMVIEW_DIRECT) {
36998 if (unlikely(buf->suboffsets && buf->suboffsets[dim] >= 0)) {
36999 PyErr_Format(PyExc_ValueError,
37000 "Buffer not compatible with direct access "
37001 "in dimension %d.", dim);
37005 if (spec & __Pyx_MEMVIEW_PTR) {
37006 if (unlikely(!buf->suboffsets || (buf->suboffsets[dim] < 0))) {
37007 PyErr_Format(PyExc_ValueError,
37008 "Buffer is not indirectly accessible "
37009 "in dimension %d.", dim);
37018__pyx_verify_contig(Py_buffer *buf,
int ndim,
int c_or_f_flag)
37021 if (c_or_f_flag & __Pyx_IS_F_CONTIG) {
37022 Py_ssize_t stride = 1;
37023 for (i = 0; i < ndim; i++) {
37024 if (unlikely(stride * buf->itemsize != buf->strides[i] && buf->shape[i] > 1)) {
37025 PyErr_SetString(PyExc_ValueError,
37026 "Buffer not fortran contiguous.");
37029 stride = stride * buf->shape[i];
37031 }
else if (c_or_f_flag & __Pyx_IS_C_CONTIG) {
37032 Py_ssize_t stride = 1;
37033 for (i = ndim - 1; i >- 1; i--) {
37034 if (unlikely(stride * buf->itemsize != buf->strides[i] && buf->shape[i] > 1)) {
37035 PyErr_SetString(PyExc_ValueError,
37036 "Buffer not C contiguous.");
37039 stride = stride * buf->shape[i];
37046static int __Pyx_ValidateAndInit_memviewslice(
37051 const __Pyx_TypeInfo *dtype,
37052 __Pyx_BufFmt_StackElem stack[],
37053 __Pyx_memviewslice *memviewslice,
37054 PyObject *original_obj)
37056 struct __pyx_memoryview_obj *memview, *new_memview;
37057 __Pyx_RefNannyDeclarations
37059 int i, spec = 0, retval = -1;
37060 __Pyx_BufFmt_Context ctx;
37061 int from_memoryview = __pyx_memoryview_check(original_obj);
37062 __Pyx_RefNannySetupContext(
"ValidateAndInit_memviewslice", 0);
37063 if (from_memoryview && __pyx_typeinfo_cmp(dtype, ((
struct __pyx_memoryview_obj *)
37064 original_obj)->typeinfo)) {
37065 memview = (
struct __pyx_memoryview_obj *) original_obj;
37066 new_memview = NULL;
37068 memview = (
struct __pyx_memoryview_obj *) __pyx_memoryview_new(
37069 original_obj, buf_flags, 0, dtype);
37070 new_memview = memview;
37071 if (unlikely(!memview))
37074 buf = &memview->view;
37075 if (unlikely(buf->ndim != ndim)) {
37076 PyErr_Format(PyExc_ValueError,
37077 "Buffer has wrong number of dimensions (expected %d, got %d)",
37082 __Pyx_BufFmt_Init(&ctx, stack, dtype);
37083 if (unlikely(!__Pyx_BufFmt_CheckString(&ctx, buf->format)))
goto fail;
37085 if (unlikely((
unsigned) buf->itemsize != dtype->size)) {
37086 PyErr_Format(PyExc_ValueError,
37087 "Item size of buffer (%" CYTHON_FORMAT_SSIZE_T
"u byte%s) "
37088 "does not match size of '%s' (%" CYTHON_FORMAT_SSIZE_T
"u byte%s)",
37090 (buf->itemsize > 1) ?
"s" :
"",
37093 (dtype->size > 1) ?
"s" :
"");
37096 if (buf->len > 0) {
37097 for (i = 0; i < ndim; i++) {
37098 spec = axes_specs[i];
37099 if (unlikely(!__pyx_check_strides(buf, i, ndim, spec)))
37101 if (unlikely(!__pyx_check_suboffsets(buf, i, ndim, spec)))
37104 if (unlikely(buf->strides && !__pyx_verify_contig(buf, ndim, c_or_f_flag)))
37107 if (unlikely(__Pyx_init_memviewslice(memview, ndim, memviewslice,
37108 new_memview != NULL) == -1)) {
37114 Py_XDECREF((PyObject*)new_memview);
37117 __Pyx_RefNannyFinishContext();
37122static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_float64_t(PyObject *obj,
int writable_flag) {
37123 __Pyx_memviewslice result = __Pyx_MEMSLICE_INIT;
37124 __Pyx_BufFmt_StackElem stack[1];
37125 int axes_specs[] = { (__Pyx_MEMVIEW_DIRECT | __Pyx_MEMVIEW_STRIDED) };
37127 if (obj == Py_None) {
37128 result.memview = (
struct __pyx_memoryview_obj *) Py_None;
37131 retcode = __Pyx_ValidateAndInit_memviewslice(axes_specs, 0,
37132 PyBUF_RECORDS_RO | writable_flag, 1,
37133 &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, stack,
37135 if (unlikely(retcode == -1))
37139 result.memview = NULL;
37140 result.data = NULL;
37145static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_int32_t(PyObject *obj,
int writable_flag) {
37146 __Pyx_memviewslice result = __Pyx_MEMSLICE_INIT;
37147 __Pyx_BufFmt_StackElem stack[1];
37148 int axes_specs[] = { (__Pyx_MEMVIEW_DIRECT | __Pyx_MEMVIEW_STRIDED) };
37150 if (obj == Py_None) {
37151 result.memview = (
struct __pyx_memoryview_obj *) Py_None;
37154 retcode = __Pyx_ValidateAndInit_memviewslice(axes_specs, 0,
37155 PyBUF_RECORDS_RO | writable_flag, 1,
37156 &__Pyx_TypeInfo_nn___pyx_t_5numpy_int32_t, stack,
37158 if (unlikely(retcode == -1))
37162 result.memview = NULL;
37163 result.data = NULL;
37168#if CYTHON_CCOMPLEX && (1) && (!0 || __cplusplus)
37170 static CYTHON_INLINE __pyx_t_float_complex __pyx_t_float_complex_from_parts(
float x,
float y) {
37171 return ::std::complex< float >(x, y);
37174 static CYTHON_INLINE __pyx_t_float_complex __pyx_t_float_complex_from_parts(
float x,
float y) {
37175 return x + y*(__pyx_t_float_complex)_Complex_I;
37179 static CYTHON_INLINE __pyx_t_float_complex __pyx_t_float_complex_from_parts(
float x,
float y) {
37180 __pyx_t_float_complex
z;
37188#if CYTHON_CCOMPLEX && (1) && (!0 || __cplusplus)
37190 static CYTHON_INLINE
int __Pyx_c_eq_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
37191 return (a.real == b.real) && (a.imag == b.imag);
37193 static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_sum_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
37194 __pyx_t_float_complex
z;
37195 z.real = a.real + b.real;
37196 z.imag = a.imag + b.imag;
37199 static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_diff_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
37200 __pyx_t_float_complex
z;
37201 z.real = a.real - b.real;
37202 z.imag = a.imag - b.imag;
37205 static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_prod_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
37206 __pyx_t_float_complex
z;
37207 z.real = a.real * b.real - a.imag * b.imag;
37208 z.imag = a.real * b.imag + a.imag * b.real;
37212 static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_quot_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
37214 return __pyx_t_float_complex_from_parts(a.real / b.real, a.imag / b.real);
37215 }
else if (fabsf(b.real) >= fabsf(b.imag)) {
37216 if (b.real == 0 && b.imag == 0) {
37217 return __pyx_t_float_complex_from_parts(a.real / b.real, a.imag / b.imag);
37219 float r = b.imag / b.real;
37220 float s = (float)(1.0) / (b.real + b.imag *
r);
37221 return __pyx_t_float_complex_from_parts(
37222 (a.real + a.imag *
r) *
s, (a.imag - a.real *
r) *
s);
37225 float r = b.real / b.imag;
37226 float s = (float)(1.0) / (b.imag + b.real *
r);
37227 return __pyx_t_float_complex_from_parts(
37228 (a.real *
r + a.imag) *
s, (a.imag *
r - a.real) *
s);
37232 static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_quot_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
37234 return __pyx_t_float_complex_from_parts(a.real / b.real, a.imag / b.real);
37236 float denom = b.real * b.real + b.imag * b.imag;
37237 return __pyx_t_float_complex_from_parts(
37238 (a.real * b.real + a.imag * b.imag) / denom,
37239 (a.imag * b.real - a.real * b.imag) / denom);
37243 static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_neg_float(__pyx_t_float_complex a) {
37244 __pyx_t_float_complex
z;
37249 static CYTHON_INLINE
int __Pyx_c_is_zero_float(__pyx_t_float_complex a) {
37250 return (a.real == 0) && (a.imag == 0);
37252 static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_conj_float(__pyx_t_float_complex a) {
37253 __pyx_t_float_complex
z;
37259 static CYTHON_INLINE
float __Pyx_c_abs_float(__pyx_t_float_complex
z) {
37260 #if !defined(HAVE_HYPOT) || defined(_MSC_VER)
37261 return sqrtf(
z.real*
z.real +
z.imag*
z.imag);
37263 return hypotf(
z.real,
z.imag);
37266 static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_pow_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
37267 __pyx_t_float_complex
z;
37268 float r, lnr, theta, z_r, z_theta;
37269 if (b.imag == 0 && b.real == (
int)b.real) {
37271 float denom = a.real * a.real + a.imag * a.imag;
37272 a.real = a.real / denom;
37273 a.imag = -a.imag / denom;
37276 switch ((
int)b.real) {
37284 return __Pyx_c_prod_float(a, a);
37286 z = __Pyx_c_prod_float(a, a);
37287 return __Pyx_c_prod_float(
z, a);
37289 z = __Pyx_c_prod_float(a, a);
37290 return __Pyx_c_prod_float(
z,
z);
37296 }
else if ((b.imag == 0) && (a.real >= 0)) {
37297 z.real = powf(a.real, b.real);
37300 }
else if (a.real > 0) {
37305 theta = atan2f(0.0, -1.0);
37308 r = __Pyx_c_abs_float(a);
37309 theta = atan2f(a.imag, a.real);
37312 z_r = expf(lnr * b.real - theta * b.imag);
37313 z_theta = theta * b.real + lnr * b.imag;
37314 z.real = z_r * cosf(z_theta);
37315 z.imag = z_r * sinf(z_theta);
37322#if CYTHON_CCOMPLEX && (1) && (!0 || __cplusplus)
37324 static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(
double x,
double y) {
37325 return ::std::complex< double >(x, y);
37328 static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(
double x,
double y) {
37329 return x + y*(__pyx_t_double_complex)_Complex_I;
37333 static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(
double x,
double y) {
37334 __pyx_t_double_complex
z;
37342#if CYTHON_CCOMPLEX && (1) && (!0 || __cplusplus)
37344 static CYTHON_INLINE
int __Pyx_c_eq_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
37345 return (a.real == b.real) && (a.imag == b.imag);
37347 static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_sum_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
37348 __pyx_t_double_complex
z;
37349 z.real = a.real + b.real;
37350 z.imag = a.imag + b.imag;
37353 static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_diff_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
37354 __pyx_t_double_complex
z;
37355 z.real = a.real - b.real;
37356 z.imag = a.imag - b.imag;
37359 static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_prod_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
37360 __pyx_t_double_complex
z;
37361 z.real = a.real * b.real - a.imag * b.imag;
37362 z.imag = a.real * b.imag + a.imag * b.real;
37366 static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_quot_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
37368 return __pyx_t_double_complex_from_parts(a.real / b.real, a.imag / b.real);
37369 }
else if (fabs(b.real) >= fabs(b.imag)) {
37370 if (b.real == 0 && b.imag == 0) {
37371 return __pyx_t_double_complex_from_parts(a.real / b.real, a.imag / b.imag);
37373 double r = b.imag / b.real;
37374 double s = (double)(1.0) / (b.real + b.imag *
r);
37375 return __pyx_t_double_complex_from_parts(
37376 (a.real + a.imag *
r) *
s, (a.imag - a.real *
r) *
s);
37379 double r = b.real / b.imag;
37380 double s = (double)(1.0) / (b.imag + b.real *
r);
37381 return __pyx_t_double_complex_from_parts(
37382 (a.real *
r + a.imag) *
s, (a.imag *
r - a.real) *
s);
37386 static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_quot_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
37388 return __pyx_t_double_complex_from_parts(a.real / b.real, a.imag / b.real);
37390 double denom = b.real * b.real + b.imag * b.imag;
37391 return __pyx_t_double_complex_from_parts(
37392 (a.real * b.real + a.imag * b.imag) / denom,
37393 (a.imag * b.real - a.real * b.imag) / denom);
37397 static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_neg_double(__pyx_t_double_complex a) {
37398 __pyx_t_double_complex
z;
37403 static CYTHON_INLINE
int __Pyx_c_is_zero_double(__pyx_t_double_complex a) {
37404 return (a.real == 0) && (a.imag == 0);
37406 static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_conj_double(__pyx_t_double_complex a) {
37407 __pyx_t_double_complex
z;
37413 static CYTHON_INLINE
double __Pyx_c_abs_double(__pyx_t_double_complex
z) {
37414 #if !defined(HAVE_HYPOT) || defined(_MSC_VER)
37415 return sqrt(
z.real*
z.real +
z.imag*
z.imag);
37417 return hypot(
z.real,
z.imag);
37420 static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_pow_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
37421 __pyx_t_double_complex
z;
37422 double r, lnr, theta, z_r, z_theta;
37423 if (b.imag == 0 && b.real == (
int)b.real) {
37425 double denom = a.real * a.real + a.imag * a.imag;
37426 a.real = a.real / denom;
37427 a.imag = -a.imag / denom;
37430 switch ((
int)b.real) {
37438 return __Pyx_c_prod_double(a, a);
37440 z = __Pyx_c_prod_double(a, a);
37441 return __Pyx_c_prod_double(
z, a);
37443 z = __Pyx_c_prod_double(a, a);
37444 return __Pyx_c_prod_double(
z,
z);
37450 }
else if ((b.imag == 0) && (a.real >= 0)) {
37451 z.real = pow(a.real, b.real);
37454 }
else if (a.real > 0) {
37459 theta = atan2(0.0, -1.0);
37462 r = __Pyx_c_abs_double(a);
37463 theta = atan2(a.imag, a.real);
37466 z_r = exp(lnr * b.real - theta * b.imag);
37467 z_theta = theta * b.real + lnr * b.imag;
37468 z.real = z_r * cos(z_theta);
37469 z.imag = z_r * sin(z_theta);
37476#if CYTHON_CCOMPLEX && (1) && (!0 || __cplusplus)
37478 static CYTHON_INLINE __pyx_t_long_double_complex __pyx_t_long_double_complex_from_parts(
long double x,
long double y) {
37479 return ::std::complex< long double >(x, y);
37482 static CYTHON_INLINE __pyx_t_long_double_complex __pyx_t_long_double_complex_from_parts(
long double x,
long double y) {
37483 return x + y*(__pyx_t_long_double_complex)_Complex_I;
37487 static CYTHON_INLINE __pyx_t_long_double_complex __pyx_t_long_double_complex_from_parts(
long double x,
long double y) {
37488 __pyx_t_long_double_complex
z;
37496#if CYTHON_CCOMPLEX && (1) && (!0 || __cplusplus)
37498 static CYTHON_INLINE
int __Pyx_c_eq_long__double(__pyx_t_long_double_complex a, __pyx_t_long_double_complex b) {
37499 return (a.real == b.real) && (a.imag == b.imag);
37501 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) {
37502 __pyx_t_long_double_complex
z;
37503 z.real = a.real + b.real;
37504 z.imag = a.imag + b.imag;
37507 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) {
37508 __pyx_t_long_double_complex
z;
37509 z.real = a.real - b.real;
37510 z.imag = a.imag - b.imag;
37513 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) {
37514 __pyx_t_long_double_complex
z;
37515 z.real = a.real * b.real - a.imag * b.imag;
37516 z.imag = a.real * b.imag + a.imag * b.real;
37520 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) {
37522 return __pyx_t_long_double_complex_from_parts(a.real / b.real, a.imag / b.real);
37523 }
else if (fabsl(b.real) >= fabsl(b.imag)) {
37524 if (b.real == 0 && b.imag == 0) {
37525 return __pyx_t_long_double_complex_from_parts(a.real / b.real, a.imag / b.imag);
37527 long double r = b.imag / b.real;
37528 long double s = (
long double)(1.0) / (b.real + b.imag *
r);
37529 return __pyx_t_long_double_complex_from_parts(
37530 (a.real + a.imag *
r) *
s, (a.imag - a.real *
r) *
s);
37533 long double r = b.real / b.imag;
37534 long double s = (
long double)(1.0) / (b.imag + b.real *
r);
37535 return __pyx_t_long_double_complex_from_parts(
37536 (a.real *
r + a.imag) *
s, (a.imag *
r - a.real) *
s);
37540 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) {
37542 return __pyx_t_long_double_complex_from_parts(a.real / b.real, a.imag / b.real);
37544 long double denom = b.real * b.real + b.imag * b.imag;
37545 return __pyx_t_long_double_complex_from_parts(
37546 (a.real * b.real + a.imag * b.imag) / denom,
37547 (a.imag * b.real - a.real * b.imag) / denom);
37551 static CYTHON_INLINE __pyx_t_long_double_complex __Pyx_c_neg_long__double(__pyx_t_long_double_complex a) {
37552 __pyx_t_long_double_complex
z;
37557 static CYTHON_INLINE
int __Pyx_c_is_zero_long__double(__pyx_t_long_double_complex a) {
37558 return (a.real == 0) && (a.imag == 0);
37560 static CYTHON_INLINE __pyx_t_long_double_complex __Pyx_c_conj_long__double(__pyx_t_long_double_complex a) {
37561 __pyx_t_long_double_complex
z;
37567 static CYTHON_INLINE
long double __Pyx_c_abs_long__double(__pyx_t_long_double_complex
z) {
37568 #if !defined(HAVE_HYPOT) || defined(_MSC_VER)
37569 return sqrtl(
z.real*
z.real +
z.imag*
z.imag);
37571 return hypotl(
z.real,
z.imag);
37574 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) {
37575 __pyx_t_long_double_complex
z;
37576 long double r, lnr, theta, z_r, z_theta;
37577 if (b.imag == 0 && b.real == (
int)b.real) {
37579 long double denom = a.real * a.real + a.imag * a.imag;
37580 a.real = a.real / denom;
37581 a.imag = -a.imag / denom;
37584 switch ((
int)b.real) {
37592 return __Pyx_c_prod_long__double(a, a);
37594 z = __Pyx_c_prod_long__double(a, a);
37595 return __Pyx_c_prod_long__double(
z, a);
37597 z = __Pyx_c_prod_long__double(a, a);
37598 return __Pyx_c_prod_long__double(
z,
z);
37604 }
else if ((b.imag == 0) && (a.real >= 0)) {
37605 z.real = powl(a.real, b.real);
37608 }
else if (a.real > 0) {
37613 theta = atan2l(0.0, -1.0);
37616 r = __Pyx_c_abs_long__double(a);
37617 theta = atan2l(a.imag, a.real);
37620 z_r = expl(lnr * b.real - theta * b.imag);
37621 z_theta = theta * b.real + lnr * b.imag;
37622 z.real = z_r * cosl(z_theta);
37623 z.imag = z_r * sinl(z_theta);
37630static __Pyx_memviewslice
37631__pyx_memoryview_copy_new_contig(
const __Pyx_memviewslice *from_mvs,
37632 const char *mode,
int ndim,
37633 Py_ssize_t sizeof_dtype,
int contig_flag,
37634 int dtype_is_object)
37636 __Pyx_RefNannyDeclarations
37638 __Pyx_memviewslice new_mvs = __Pyx_MEMSLICE_INIT;
37639 struct __pyx_memoryview_obj *from_memview = from_mvs->memview;
37640 Py_buffer *buf = &from_memview->view;
37641 PyObject *shape_tuple = NULL;
37642 struct __pyx_array_obj *array_obj = NULL;
37643 struct __pyx_memoryview_obj *memview_obj = NULL;
37644 __Pyx_RefNannySetupContext(
"__pyx_memoryview_copy_new_contig", 0);
37645 for (i = 0; i < ndim; i++) {
37646 if (unlikely(from_mvs->suboffsets[i] >= 0)) {
37647 PyErr_Format(PyExc_ValueError,
"Cannot copy memoryview slice with "
37648 "indirect dimensions (axis %d)", i);
37652 shape_tuple = PyTuple_New(ndim);
37653 if (unlikely(!shape_tuple)) {
37656 __Pyx_GOTREF(shape_tuple);
37657 for(i = 0; i < ndim; i++) {
37658 PyObject *temp_int = PyLong_FromSsize_t(from_mvs->shape[i]);
37659 if(unlikely(!temp_int)) {
37662#if CYTHON_ASSUME_SAFE_MACROS
37663 PyTuple_SET_ITEM(shape_tuple, i, temp_int);
37665 if (PyTuple_SetItem(shape_tuple, i, temp_int) < 0) {
37671 array_obj = __pyx_array_new(shape_tuple, sizeof_dtype, buf->format, mode, NULL);
37672 if (unlikely(!array_obj)) {
37675 __Pyx_GOTREF(array_obj);
37676 memview_obj = (
struct __pyx_memoryview_obj *) __pyx_memoryview_new(
37677 (PyObject *) array_obj, contig_flag,
37679 from_mvs->memview->typeinfo);
37680 if (unlikely(!memview_obj))
37682 if (unlikely(__Pyx_init_memviewslice(memview_obj, ndim, &new_mvs, 1) < 0))
37684 if (unlikely(__pyx_memoryview_copy_contents(*from_mvs, new_mvs, ndim, ndim,
37685 dtype_is_object) < 0))
37689 __Pyx_XDECREF((PyObject *) new_mvs.memview);
37690 new_mvs.memview = NULL;
37691 new_mvs.data = NULL;
37693 __Pyx_XDECREF(shape_tuple);
37694 __Pyx_XDECREF((PyObject *) array_obj);
37695 __Pyx_RefNannyFinishContext();
37700static int __Pyx_LargePyLong___Pyx_PyLong_As_int(PyObject *x);
37701static int __Pyx_raise_neg_overflow___Pyx_PyLong_As_int(
void) {
37702 const char* type_name =
"int";
37703 PyErr_Format(PyExc_OverflowError,
37704 "can't convert negative value to %.200s", type_name);
37707static int __Pyx_raise_overflow___Pyx_PyLong_As_int(
void) {
37708 const char* type_name =
"int";
37709 PyErr_Format(PyExc_OverflowError,
37710 "value too large to convert to %.200s", type_name);
37713static CYTHON_INLINE
int __Pyx_PyULong___Pyx_PyLong_As_int(PyObject *x) {
37714 const int is_unsigned = 1;
37715#if CYTHON_USE_PYLONG_INTERNALS
37717 const digit* digits = __Pyx_PyLong_Digits(x);
37718 const Py_ssize_t size = __Pyx_PyLong_DigitCount(x);
37719 if (size == 2 && (8 *
sizeof(
int) > 1 * PyLong_SHIFT)) {
37720 if ((8 *
sizeof(
unsigned long) > 2 * PyLong_SHIFT)) {
37721 __PYX_VERIFY_RETURN_INT(
int,
unsigned long, (((((
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
37722 }
else if ((8 *
sizeof(
int) >= 2 * PyLong_SHIFT)) {
37723 return (
int) (((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0]));
37726 if (size == 3 && (8 *
sizeof(
int) > 2 * PyLong_SHIFT)) {
37727 if ((8 *
sizeof(
unsigned long) > 3 * PyLong_SHIFT)) {
37728 __PYX_VERIFY_RETURN_INT(
int,
unsigned long, (((((((
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
37729 }
else if ((8 *
sizeof(
int) >= 3 * PyLong_SHIFT)) {
37730 return (
int) (((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]));
37733 if (size == 4 && (8 *
sizeof(
int) > 3 * PyLong_SHIFT)) {
37734 if ((8 *
sizeof(
unsigned long) > 4 * PyLong_SHIFT)) {
37735 __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])))
37736 }
else if ((8 *
sizeof(
int) >= 4 * PyLong_SHIFT)) {
37737 return (
int) (((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]));
37742#elif CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030C00A7
37743 if (unlikely(Py_SIZE(x) < 0)) {
37744 goto raise_neg_overflow;
37748 int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
37749 if (unlikely(result < 0))
37751 if (unlikely(result == 1))
37752 goto raise_neg_overflow;
37755 if ((
sizeof(
int) <=
sizeof(
unsigned long))) {
37756 __PYX_VERIFY_RETURN_INT_EXC(
int,
unsigned long, PyLong_AsUnsignedLong(x))
37757 }
else if ((
sizeof(
int) <=
sizeof(
unsigned PY_LONG_LONG))) {
37758 __PYX_VERIFY_RETURN_INT_EXC(
int,
unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
37760 return __Pyx_LargePyLong___Pyx_PyLong_As_int(x);
37762 return __Pyx_raise_neg_overflow___Pyx_PyLong_As_int();
37764 return __Pyx_raise_overflow___Pyx_PyLong_As_int();
37766static CYTHON_INLINE
int __Pyx_PySLong___Pyx_PyLong_As_int(PyObject *x) {
37767 const int is_unsigned = 0;
37768#if CYTHON_USE_PYLONG_INTERNALS
37769 if (__Pyx_PyLong_IsNeg(x)) {
37770 const Py_ssize_t size = __Pyx_PyLong_DigitCount(x);
37771 const digit* digits = __Pyx_PyLong_Digits(x);
37772 if (size == 2 && (8 *
sizeof(
int) > 1 * PyLong_SHIFT)) {
37773 if ((8 *
sizeof(
long) > 2 * PyLong_SHIFT)) {
37774 long ival = - (long) (((((
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0]));
37775 __PYX_VERIFY_RETURN_INT(
int,
long, ival)
37776 }
else if ((8 *
sizeof(
int) - 1 > 2 * PyLong_SHIFT)) {
37777 return (
int) (((int) -1) * (((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
37780 if (size == 3 && (8 *
sizeof(
int) > 2 * PyLong_SHIFT)) {
37781 if ((8 *
sizeof(
long) > 3 * PyLong_SHIFT)) {
37782 long ival = - (long) (((((((
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0]));
37783 __PYX_VERIFY_RETURN_INT(
int,
long, ival)
37784 }
else if ((8 *
sizeof(
int) - 1 > 3 * PyLong_SHIFT)) {
37785 return (
int) (((int) -1) * (((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
37788 if (size == 4 && (8 *
sizeof(
int) > 3 * PyLong_SHIFT)) {
37789 if ((8 *
sizeof(
long) > 4 * PyLong_SHIFT)) {
37790 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]));
37791 __PYX_VERIFY_RETURN_INT(
int,
long, ival)
37792 }
else if ((8 *
sizeof(
int) - 1 > 4 * PyLong_SHIFT)) {
37793 return (
int) (((int) -1) * (((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
37798 const Py_ssize_t size = __Pyx_PyLong_DigitCount(x);
37799 const digit* digits = __Pyx_PyLong_Digits(x);
37800 if (size == 2 && (8 *
sizeof(
int) > 1 * PyLong_SHIFT)) {
37801 if ((8 *
sizeof(
long) > 2 * PyLong_SHIFT)) {
37802 __PYX_VERIFY_RETURN_INT(
int,
unsigned long, (((((
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
37803 }
else if ((8 *
sizeof(
int) - 1 > 2 * PyLong_SHIFT)) {
37804 return (
int) (((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0]));
37807 if (size == 3 && (8 *
sizeof(
int) > 2 * PyLong_SHIFT)) {
37808 if ((8 *
sizeof(
long) > 3 * PyLong_SHIFT)) {
37809 __PYX_VERIFY_RETURN_INT(
int,
unsigned long, (((((((
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
37810 }
else if ((8 *
sizeof(
int) - 1 > 3 * PyLong_SHIFT)) {
37811 return (
int) (((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]));
37814 if (size == 4 && (8 *
sizeof(
int) > 3 * PyLong_SHIFT)) {
37815 if ((8 *
sizeof(
long) > 4 * PyLong_SHIFT)) {
37816 __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])))
37817 }
else if ((8 *
sizeof(
int) - 1 > 4 * PyLong_SHIFT)) {
37818 return (
int) (((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]));
37824 #if __PYX_LIMITED_VERSION_HEX >= 0x030d0000
37825 if ((
sizeof(
int) <=
sizeof(
int)) && (
sizeof(
int) <
sizeof(
long))) {
37826 __PYX_VERIFY_RETURN_INT_EXC(
int,
int, PyLong_AsInt(x))
37829 if ((
sizeof(
int) <=
sizeof(
long))) {
37830 __PYX_VERIFY_RETURN_INT_EXC(
int,
long, PyLong_AsLong(x))
37831 }
else if ((
sizeof(
int) <=
sizeof(PY_LONG_LONG))) {
37832 __PYX_VERIFY_RETURN_INT_EXC(
int, PY_LONG_LONG, PyLong_AsLongLong(x))
37834 return __Pyx_LargePyLong___Pyx_PyLong_As_int(x);
37836 return __Pyx_raise_neg_overflow___Pyx_PyLong_As_int();
37838 return __Pyx_raise_overflow___Pyx_PyLong_As_int();
37840static int __Pyx_LargePyLong___Pyx_PyLong_As_int(PyObject *x) {
37841#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
37842#pragma GCC diagnostic push
37843#pragma GCC diagnostic ignored "-Wconversion"
37845 const int neg_one = (int) -1, const_zero = (
int) 0;
37846#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
37847#pragma GCC diagnostic pop
37849 const int is_unsigned = neg_one > const_zero;
37852#if PY_VERSION_HEX >= 0x030d00A6 && !CYTHON_COMPILING_IN_LIMITED_API
37853 Py_ssize_t bytes_copied = PyLong_AsNativeBytes(
37854 x, &val,
sizeof(val), Py_ASNATIVEBYTES_NATIVE_ENDIAN | (is_unsigned ? Py_ASNATIVEBYTES_UNSIGNED_BUFFER | Py_ASNATIVEBYTES_REJECT_NEGATIVE : 0));
37855 if (unlikely(bytes_copied == -1)) {
37856 }
else if (unlikely(bytes_copied > (Py_ssize_t)
sizeof(val))) {
37857 goto raise_overflow;
37861#elif PY_VERSION_HEX < 0x030d0000 && !(CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API) || defined(_PyLong_AsByteArray)
37862 int one = 1;
int is_little = (int)*(
unsigned char *)&one;
37863 unsigned char *bytes = (
unsigned char *)&val;
37864 ret = _PyLong_AsByteArray((PyLongObject *)x,
37865 bytes,
sizeof(val),
37866 is_little, !is_unsigned);
37867 if ((0))
goto raise_overflow;
37870 PyObject *stepval = NULL, *mask = NULL, *shift = NULL;
37871 int bits, remaining_bits, is_negative = 0;
37872 int chunk_size = (
sizeof(long) < 8) ? 30 : 62;
37873 if (likely(PyLong_CheckExact(x))) {
37874 v = __Pyx_NewRef(x);
37876 v = PyNumber_Long(x);
37877 if (unlikely(!
v))
return (
int) -1;
37878 assert(PyLong_CheckExact(
v));
37881 int result = PyObject_RichCompareBool(
v, Py_False, Py_LT);
37882 if (unlikely(result < 0)) {
37886 is_negative = result == 1;
37888 if (is_unsigned && unlikely(is_negative)) {
37890 PyErr_SetString(PyExc_OverflowError,
37891 "can't convert negative value to int");
37893 }
else if (is_negative) {
37894 stepval = PyNumber_Invert(
v);
37896 if (unlikely(!stepval))
37903 mask = PyLong_FromLong((1L << chunk_size) - 1);
if (unlikely(!mask))
goto done;
37904 shift = PyLong_FromLong(chunk_size);
if (unlikely(!shift))
goto done;
37905 for (bits = 0; bits < (int)
sizeof(int) * 8 - chunk_size; bits += chunk_size) {
37906 PyObject *tmp, *digit;
37908 digit = PyNumber_And(stepval, mask);
37909 if (unlikely(!digit))
goto done;
37910 idigit = PyLong_AsLong(digit);
37912 if (unlikely(idigit < 0))
goto done;
37913 val |= ((int) idigit) << bits;
37914 tmp = PyNumber_Rshift(stepval, shift);
37915 if (unlikely(!tmp))
goto done;
37916 Py_DECREF(stepval); stepval = tmp;
37918 Py_DECREF(shift); shift = NULL;
37919 Py_DECREF(mask); mask = NULL;
37921 long idigit = PyLong_AsLong(stepval);
37922 if (unlikely(idigit < 0))
goto done;
37923 remaining_bits = ((int)
sizeof(int) * 8) - bits - (is_unsigned ? 0 : 1);
37924 if (unlikely(idigit >= (1L << remaining_bits)))
37925 goto raise_overflow;
37926 val |= ((int) idigit) << bits;
37928 if (!is_unsigned) {
37929 if (unlikely(val & (((
int) 1) << (
sizeof(
int) * 8 - 1))))
37930 goto raise_overflow;
37938 Py_XDECREF(stepval);
37944 return __Pyx_raise_overflow___Pyx_PyLong_As_int();
37946static CYTHON_INLINE
int __Pyx_PyLong___Pyx_PyLong_As_int(PyObject *x) {
37947#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
37948#pragma GCC diagnostic push
37949#pragma GCC diagnostic ignored "-Wconversion"
37951 const int neg_one = (int) -1, const_zero = (
int) 0;
37952#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
37953#pragma GCC diagnostic pop
37955 const int is_unsigned = neg_one > const_zero;
37957 #if CYTHON_USE_PYLONG_INTERNALS
37958 if (unlikely(__Pyx_PyLong_IsNeg(x))) {
37959 goto raise_neg_overflow;
37960 }
else if (__Pyx_PyLong_IsCompact(x)) {
37961 __PYX_VERIFY_RETURN_INT(
int, __Pyx_compact_upylong, __Pyx_PyLong_CompactValueUnsigned(x))
37965 return __Pyx_PyULong___Pyx_PyLong_As_int(x);
37968 #if CYTHON_USE_PYLONG_INTERNALS
37969 if (__Pyx_PyLong_IsCompact(x)) {
37970 __PYX_VERIFY_RETURN_INT(
int, __Pyx_compact_pylong, __Pyx_PyLong_CompactValue(x))
37974 return __Pyx_PySLong___Pyx_PyLong_As_int(x);
37977#if CYTHON_USE_PYLONG_INTERNALS
37979 return __Pyx_raise_neg_overflow___Pyx_PyLong_As_int();
37981 return __Pyx_raise_overflow___Pyx_PyLong_As_int();
37984static int __Pyx_NonPyLong___Pyx_PyLong_As_int(PyObject *x) {
37986 PyObject *tmp = __Pyx_PyNumber_Long(x);
37987 if (!tmp)
return (
int) -1;
37988 val = __Pyx_PyLong_As_int(tmp);
37992static CYTHON_INLINE
int __Pyx_PyLong_As_int(PyObject *x) {
37993 if (likely(PyLong_Check(x))) {
37994 return __Pyx_PyLong___Pyx_PyLong_As_int(x);
37996 return __Pyx_NonPyLong___Pyx_PyLong_As_int(x);
38001#if CYTHON_VECTORCALL
38002CYTHON_UNUSED
static int __Pyx_CheckVectorcallKwarg(PyObject *kwnames, Py_ssize_t i) {
38003 PyObject *key = __Pyx_PyTuple_GET_ITEM(kwnames, i);
38004#if !CYTHON_ASSUME_SAFE_MACROS
38005 if (unlikely(!key))
return -1;
38007 if (unlikely(!PyUnicode_Check(key))) {
38008 PyErr_SetString(PyExc_TypeError,
"keywords must be strings");
38014CYTHON_UNUSED
static PyObject *__Pyx_MakeKwargDict(PyObject **keys, PyObject **values, Py_ssize_t
n) {
38015 PyObject *out = PyDict_New();
38016 if (unlikely(!out))
return NULL;
38017 for (Py_ssize_t i=0; i<
n; ++i) {
38018 if (unlikely(PyDict_SetItem(out, keys[i], values[i]) < 0)) {
38025CYTHON_UNUSED
static int __Pyx_CheckVectorcallKwarg(PyObject **kwnames, Py_ssize_t i) {
38026 PyObject *key = kwnames[i];
38027 if (unlikely(!PyUnicode_Check(key))) {
38028 PyErr_SetString(PyExc_TypeError,
"keywords must be strings");
38036#if !CYTHON_VECTORCALL
38037static PyObject *__Pyx_Object_VectorcallMethodKwds(PyObject *name, PyObject *
const *args,
size_t nargsf, PyObject *kwnames) {
38039 PyObject *obj = PyObject_GetAttr(args[0], name);
38040 if (unlikely(!obj))
38042 result = __Pyx_Object_VectorcallKwds(obj, args+1, nargsf-1, kwnames);
38049static CYTHON_INLINE PyObject* __Pyx_PyLong_From_npy_int32(npy_int32 value) {
38050#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
38051#pragma GCC diagnostic push
38052#pragma GCC diagnostic ignored "-Wconversion"
38054 const npy_int32 neg_one = (npy_int32) -1, const_zero = (npy_int32) 0;
38055#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
38056#pragma GCC diagnostic pop
38058 const int is_unsigned = neg_one > const_zero;
38060 if (
sizeof(npy_int32) <
sizeof(
long)) {
38061 return PyLong_FromLong((
long) value);
38062 }
else if (
sizeof(npy_int32) <=
sizeof(
unsigned long)) {
38063 return PyLong_FromUnsignedLong((
unsigned long) value);
38064#if !CYTHON_COMPILING_IN_PYPY
38065 }
else if (
sizeof(npy_int32) <=
sizeof(
unsigned PY_LONG_LONG)) {
38066 return PyLong_FromUnsignedLongLong((
unsigned PY_LONG_LONG) value);
38070 if (
sizeof(npy_int32) <=
sizeof(
long)) {
38071 return PyLong_FromLong((
long) value);
38072 }
else if (
sizeof(npy_int32) <=
sizeof(PY_LONG_LONG)) {
38073 return PyLong_FromLongLong((PY_LONG_LONG) value);
38077 unsigned char *bytes = (
unsigned char *)&value;
38078#if !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX >= 0x030d00A4
38080 return PyLong_FromUnsignedNativeBytes(bytes,
sizeof(value), -1);
38082 return PyLong_FromNativeBytes(bytes,
sizeof(value), -1);
38084#elif !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030d0000
38085 int one = 1;
int little = (int)*(
unsigned char *)&one;
38086 return _PyLong_FromByteArray(bytes,
sizeof(npy_int32),
38087 little, !is_unsigned);
38089 int one = 1;
int little = (int)*(
unsigned char *)&one;
38090 PyObject *result = NULL, *kwds = NULL;
38091 PyObject *py_bytes = NULL, *order_str = NULL, *from_bytes_str = NULL;;
38092 py_bytes = PyBytes_FromStringAndSize((
char*)bytes,
sizeof(npy_int32));
38093 if (!py_bytes)
goto limited_bad;
38094 from_bytes_str = PyUnicode_FromStringAndSize(
"from_bytes", 10);
38095 if (!from_bytes_str)
goto limited_bad;
38096 order_str = PyUnicode_FromString(little ?
"little" :
"big");
38097 if (!order_str)
goto limited_bad;
38099 PyObject *args[] = { (PyObject*)&PyLong_Type, py_bytes, order_str, Py_True };
38100 if (!is_unsigned) {
38101 PyObject *signed_str = PyUnicode_FromStringAndSize(
"signed", 6);
38102 if (!signed_str)
goto limited_bad;
38103#if CYTHON_VECTORCALL
38104 kwds = PyTuple_Pack(1, signed_str);
38107 PyObject *keys[] = {signed_str};
38108 PyObject *values[] = {Py_True};
38109 kwds = __Pyx_MakeKwargDict(keys, values, 1);
38112 Py_DECREF(signed_str);
38113 if (unlikely(!kwds))
goto limited_bad;
38115 result = __Pyx_Object_VectorcallMethodKwds(from_bytes_str, args, 3 | __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET, kwds);
38119 Py_XDECREF(order_str);
38120 Py_XDECREF(py_bytes);
38121 Py_XDECREF(from_bytes_str);
38128static CYTHON_INLINE PyObject* __Pyx_PyLong_From_int(
int value) {
38129#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
38130#pragma GCC diagnostic push
38131#pragma GCC diagnostic ignored "-Wconversion"
38133 const int neg_one = (int) -1, const_zero = (
int) 0;
38134#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
38135#pragma GCC diagnostic pop
38137 const int is_unsigned = neg_one > const_zero;
38139 if (
sizeof(
int) <
sizeof(
long)) {
38140 return PyLong_FromLong((
long) value);
38141 }
else if (
sizeof(
int) <=
sizeof(
unsigned long)) {
38142 return PyLong_FromUnsignedLong((
unsigned long) value);
38143#if !CYTHON_COMPILING_IN_PYPY
38144 }
else if (
sizeof(
int) <=
sizeof(
unsigned PY_LONG_LONG)) {
38145 return PyLong_FromUnsignedLongLong((
unsigned PY_LONG_LONG) value);
38149 if (
sizeof(
int) <=
sizeof(
long)) {
38150 return PyLong_FromLong((
long) value);
38151 }
else if (
sizeof(
int) <=
sizeof(PY_LONG_LONG)) {
38152 return PyLong_FromLongLong((PY_LONG_LONG) value);
38156 unsigned char *bytes = (
unsigned char *)&value;
38157#if !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX >= 0x030d00A4
38159 return PyLong_FromUnsignedNativeBytes(bytes,
sizeof(value), -1);
38161 return PyLong_FromNativeBytes(bytes,
sizeof(value), -1);
38163#elif !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030d0000
38164 int one = 1;
int little = (int)*(
unsigned char *)&one;
38165 return _PyLong_FromByteArray(bytes,
sizeof(
int),
38166 little, !is_unsigned);
38168 int one = 1;
int little = (int)*(
unsigned char *)&one;
38169 PyObject *result = NULL, *kwds = NULL;
38170 PyObject *py_bytes = NULL, *order_str = NULL, *from_bytes_str = NULL;;
38171 py_bytes = PyBytes_FromStringAndSize((
char*)bytes,
sizeof(
int));
38172 if (!py_bytes)
goto limited_bad;
38173 from_bytes_str = PyUnicode_FromStringAndSize(
"from_bytes", 10);
38174 if (!from_bytes_str)
goto limited_bad;
38175 order_str = PyUnicode_FromString(little ?
"little" :
"big");
38176 if (!order_str)
goto limited_bad;
38178 PyObject *args[] = { (PyObject*)&PyLong_Type, py_bytes, order_str, Py_True };
38179 if (!is_unsigned) {
38180 PyObject *signed_str = PyUnicode_FromStringAndSize(
"signed", 6);
38181 if (!signed_str)
goto limited_bad;
38182#if CYTHON_VECTORCALL
38183 kwds = PyTuple_Pack(1, signed_str);
38186 PyObject *keys[] = {signed_str};
38187 PyObject *values[] = {Py_True};
38188 kwds = __Pyx_MakeKwargDict(keys, values, 1);
38191 Py_DECREF(signed_str);
38192 if (unlikely(!kwds))
goto limited_bad;
38194 result = __Pyx_Object_VectorcallMethodKwds(from_bytes_str, args, 3 | __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET, kwds);
38198 Py_XDECREF(order_str);
38199 Py_XDECREF(py_bytes);
38200 Py_XDECREF(from_bytes_str);
38207static npy_int32 __Pyx_LargePyLong___Pyx_PyLong_As_npy_int32(PyObject *x);
38208static npy_int32 __Pyx_raise_neg_overflow___Pyx_PyLong_As_npy_int32(
void) {
38209 const char* type_name =
"npy_int32";
38210 PyErr_Format(PyExc_OverflowError,
38211 "can't convert negative value to %.200s", type_name);
38212 return (npy_int32) -1;
38214static npy_int32 __Pyx_raise_overflow___Pyx_PyLong_As_npy_int32(
void) {
38215 const char* type_name =
"npy_int32";
38216 PyErr_Format(PyExc_OverflowError,
38217 "value too large to convert to %.200s", type_name);
38218 return (npy_int32) -1;
38220static CYTHON_INLINE npy_int32 __Pyx_PyULong___Pyx_PyLong_As_npy_int32(PyObject *x) {
38221 const int is_unsigned = 1;
38222#if CYTHON_USE_PYLONG_INTERNALS
38224 const digit* digits = __Pyx_PyLong_Digits(x);
38225 const Py_ssize_t size = __Pyx_PyLong_DigitCount(x);
38226 if (size == 2 && (8 *
sizeof(npy_int32) > 1 * PyLong_SHIFT)) {
38227 if ((8 *
sizeof(
unsigned long) > 2 * PyLong_SHIFT)) {
38228 __PYX_VERIFY_RETURN_INT(npy_int32,
unsigned long, (((((
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
38229 }
else if ((8 *
sizeof(npy_int32) >= 2 * PyLong_SHIFT)) {
38230 return (npy_int32) (((((npy_int32)digits[1]) << PyLong_SHIFT) | (npy_int32)digits[0]));
38233 if (size == 3 && (8 *
sizeof(npy_int32) > 2 * PyLong_SHIFT)) {
38234 if ((8 *
sizeof(
unsigned long) > 3 * PyLong_SHIFT)) {
38235 __PYX_VERIFY_RETURN_INT(npy_int32,
unsigned long, (((((((
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
38236 }
else if ((8 *
sizeof(npy_int32) >= 3 * PyLong_SHIFT)) {
38237 return (npy_int32) (((((((npy_int32)digits[2]) << PyLong_SHIFT) | (npy_int32)digits[1]) << PyLong_SHIFT) | (npy_int32)digits[0]));
38240 if (size == 4 && (8 *
sizeof(npy_int32) > 3 * PyLong_SHIFT)) {
38241 if ((8 *
sizeof(
unsigned long) > 4 * PyLong_SHIFT)) {
38242 __PYX_VERIFY_RETURN_INT(npy_int32,
unsigned long, (((((((((
unsigned long)digits[3]) << PyLong_SHIFT) | (
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
38243 }
else if ((8 *
sizeof(npy_int32) >= 4 * PyLong_SHIFT)) {
38244 return (npy_int32) (((((((((npy_int32)digits[3]) << PyLong_SHIFT) | (npy_int32)digits[2]) << PyLong_SHIFT) | (npy_int32)digits[1]) << PyLong_SHIFT) | (npy_int32)digits[0]));
38249#elif CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030C00A7
38250 if (unlikely(Py_SIZE(x) < 0)) {
38251 goto raise_neg_overflow;
38255 int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
38256 if (unlikely(result < 0))
38257 return (npy_int32) -1;
38258 if (unlikely(result == 1))
38259 goto raise_neg_overflow;
38262 if ((
sizeof(npy_int32) <=
sizeof(
unsigned long))) {
38263 __PYX_VERIFY_RETURN_INT_EXC(npy_int32,
unsigned long, PyLong_AsUnsignedLong(x))
38264 }
else if ((
sizeof(npy_int32) <=
sizeof(
unsigned PY_LONG_LONG))) {
38265 __PYX_VERIFY_RETURN_INT_EXC(npy_int32,
unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
38267 return __Pyx_LargePyLong___Pyx_PyLong_As_npy_int32(x);
38269 return __Pyx_raise_neg_overflow___Pyx_PyLong_As_npy_int32();
38271 return __Pyx_raise_overflow___Pyx_PyLong_As_npy_int32();
38273static CYTHON_INLINE npy_int32 __Pyx_PySLong___Pyx_PyLong_As_npy_int32(PyObject *x) {
38274 const int is_unsigned = 0;
38275#if CYTHON_USE_PYLONG_INTERNALS
38276 if (__Pyx_PyLong_IsNeg(x)) {
38277 const Py_ssize_t size = __Pyx_PyLong_DigitCount(x);
38278 const digit* digits = __Pyx_PyLong_Digits(x);
38279 if (size == 2 && (8 *
sizeof(npy_int32) > 1 * PyLong_SHIFT)) {
38280 if ((8 *
sizeof(
long) > 2 * PyLong_SHIFT)) {
38281 long ival = - (long) (((((
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0]));
38282 __PYX_VERIFY_RETURN_INT(npy_int32,
long, ival)
38283 }
else if ((8 *
sizeof(npy_int32) - 1 > 2 * PyLong_SHIFT)) {
38284 return (npy_int32) (((npy_int32) -1) * (((((npy_int32)digits[1]) << PyLong_SHIFT) | (npy_int32)digits[0])));
38287 if (size == 3 && (8 *
sizeof(npy_int32) > 2 * PyLong_SHIFT)) {
38288 if ((8 *
sizeof(
long) > 3 * PyLong_SHIFT)) {
38289 long ival = - (long) (((((((
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0]));
38290 __PYX_VERIFY_RETURN_INT(npy_int32,
long, ival)
38291 }
else if ((8 *
sizeof(npy_int32) - 1 > 3 * PyLong_SHIFT)) {
38292 return (npy_int32) (((npy_int32) -1) * (((((((npy_int32)digits[2]) << PyLong_SHIFT) | (npy_int32)digits[1]) << PyLong_SHIFT) | (npy_int32)digits[0])));
38295 if (size == 4 && (8 *
sizeof(npy_int32) > 3 * PyLong_SHIFT)) {
38296 if ((8 *
sizeof(
long) > 4 * PyLong_SHIFT)) {
38297 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]));
38298 __PYX_VERIFY_RETURN_INT(npy_int32,
long, ival)
38299 }
else if ((8 *
sizeof(npy_int32) - 1 > 4 * PyLong_SHIFT)) {
38300 return (npy_int32) (((npy_int32) -1) * (((((((((npy_int32)digits[3]) << PyLong_SHIFT) | (npy_int32)digits[2]) << PyLong_SHIFT) | (npy_int32)digits[1]) << PyLong_SHIFT) | (npy_int32)digits[0])));
38305 const Py_ssize_t size = __Pyx_PyLong_DigitCount(x);
38306 const digit* digits = __Pyx_PyLong_Digits(x);
38307 if (size == 2 && (8 *
sizeof(npy_int32) > 1 * PyLong_SHIFT)) {
38308 if ((8 *
sizeof(
long) > 2 * PyLong_SHIFT)) {
38309 __PYX_VERIFY_RETURN_INT(npy_int32,
unsigned long, (((((
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
38310 }
else if ((8 *
sizeof(npy_int32) - 1 > 2 * PyLong_SHIFT)) {
38311 return (npy_int32) (((((npy_int32)digits[1]) << PyLong_SHIFT) | (npy_int32)digits[0]));
38314 if (size == 3 && (8 *
sizeof(npy_int32) > 2 * PyLong_SHIFT)) {
38315 if ((8 *
sizeof(
long) > 3 * PyLong_SHIFT)) {
38316 __PYX_VERIFY_RETURN_INT(npy_int32,
unsigned long, (((((((
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
38317 }
else if ((8 *
sizeof(npy_int32) - 1 > 3 * PyLong_SHIFT)) {
38318 return (npy_int32) (((((((npy_int32)digits[2]) << PyLong_SHIFT) | (npy_int32)digits[1]) << PyLong_SHIFT) | (npy_int32)digits[0]));
38321 if (size == 4 && (8 *
sizeof(npy_int32) > 3 * PyLong_SHIFT)) {
38322 if ((8 *
sizeof(
long) > 4 * PyLong_SHIFT)) {
38323 __PYX_VERIFY_RETURN_INT(npy_int32,
unsigned long, (((((((((
unsigned long)digits[3]) << PyLong_SHIFT) | (
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
38324 }
else if ((8 *
sizeof(npy_int32) - 1 > 4 * PyLong_SHIFT)) {
38325 return (npy_int32) (((((((((npy_int32)digits[3]) << PyLong_SHIFT) | (npy_int32)digits[2]) << PyLong_SHIFT) | (npy_int32)digits[1]) << PyLong_SHIFT) | (npy_int32)digits[0]));
38331 #if __PYX_LIMITED_VERSION_HEX >= 0x030d0000
38332 if ((
sizeof(npy_int32) <=
sizeof(
int)) && (
sizeof(
int) <
sizeof(
long))) {
38333 __PYX_VERIFY_RETURN_INT_EXC(npy_int32,
int, PyLong_AsInt(x))
38336 if ((
sizeof(npy_int32) <=
sizeof(
long))) {
38337 __PYX_VERIFY_RETURN_INT_EXC(npy_int32,
long, PyLong_AsLong(x))
38338 }
else if ((
sizeof(npy_int32) <=
sizeof(PY_LONG_LONG))) {
38339 __PYX_VERIFY_RETURN_INT_EXC(npy_int32, PY_LONG_LONG, PyLong_AsLongLong(x))
38341 return __Pyx_LargePyLong___Pyx_PyLong_As_npy_int32(x);
38343 return __Pyx_raise_neg_overflow___Pyx_PyLong_As_npy_int32();
38345 return __Pyx_raise_overflow___Pyx_PyLong_As_npy_int32();
38347static npy_int32 __Pyx_LargePyLong___Pyx_PyLong_As_npy_int32(PyObject *x) {
38348#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
38349#pragma GCC diagnostic push
38350#pragma GCC diagnostic ignored "-Wconversion"
38352 const npy_int32 neg_one = (npy_int32) -1, const_zero = (npy_int32) 0;
38353#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
38354#pragma GCC diagnostic pop
38356 const int is_unsigned = neg_one > const_zero;
38359#if PY_VERSION_HEX >= 0x030d00A6 && !CYTHON_COMPILING_IN_LIMITED_API
38360 Py_ssize_t bytes_copied = PyLong_AsNativeBytes(
38361 x, &val,
sizeof(val), Py_ASNATIVEBYTES_NATIVE_ENDIAN | (is_unsigned ? Py_ASNATIVEBYTES_UNSIGNED_BUFFER | Py_ASNATIVEBYTES_REJECT_NEGATIVE : 0));
38362 if (unlikely(bytes_copied == -1)) {
38363 }
else if (unlikely(bytes_copied > (Py_ssize_t)
sizeof(val))) {
38364 goto raise_overflow;
38368#elif PY_VERSION_HEX < 0x030d0000 && !(CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API) || defined(_PyLong_AsByteArray)
38369 int one = 1;
int is_little = (int)*(
unsigned char *)&one;
38370 unsigned char *bytes = (
unsigned char *)&val;
38371 ret = _PyLong_AsByteArray((PyLongObject *)x,
38372 bytes,
sizeof(val),
38373 is_little, !is_unsigned);
38374 if ((0))
goto raise_overflow;
38377 PyObject *stepval = NULL, *mask = NULL, *shift = NULL;
38378 int bits, remaining_bits, is_negative = 0;
38379 int chunk_size = (
sizeof(long) < 8) ? 30 : 62;
38380 if (likely(PyLong_CheckExact(x))) {
38381 v = __Pyx_NewRef(x);
38383 v = PyNumber_Long(x);
38384 if (unlikely(!
v))
return (npy_int32) -1;
38385 assert(PyLong_CheckExact(
v));
38388 int result = PyObject_RichCompareBool(
v, Py_False, Py_LT);
38389 if (unlikely(result < 0)) {
38391 return (npy_int32) -1;
38393 is_negative = result == 1;
38395 if (is_unsigned && unlikely(is_negative)) {
38397 PyErr_SetString(PyExc_OverflowError,
38398 "can't convert negative value to npy_int32");
38399 return (npy_int32) -1;
38400 }
else if (is_negative) {
38401 stepval = PyNumber_Invert(
v);
38403 if (unlikely(!stepval))
38404 return (npy_int32) -1;
38409 val = (npy_int32) 0;
38410 mask = PyLong_FromLong((1L << chunk_size) - 1);
if (unlikely(!mask))
goto done;
38411 shift = PyLong_FromLong(chunk_size);
if (unlikely(!shift))
goto done;
38412 for (bits = 0; bits < (int)
sizeof(npy_int32) * 8 - chunk_size; bits += chunk_size) {
38413 PyObject *tmp, *digit;
38415 digit = PyNumber_And(stepval, mask);
38416 if (unlikely(!digit))
goto done;
38417 idigit = PyLong_AsLong(digit);
38419 if (unlikely(idigit < 0))
goto done;
38420 val |= ((npy_int32) idigit) << bits;
38421 tmp = PyNumber_Rshift(stepval, shift);
38422 if (unlikely(!tmp))
goto done;
38423 Py_DECREF(stepval); stepval = tmp;
38425 Py_DECREF(shift); shift = NULL;
38426 Py_DECREF(mask); mask = NULL;
38428 long idigit = PyLong_AsLong(stepval);
38429 if (unlikely(idigit < 0))
goto done;
38430 remaining_bits = ((int)
sizeof(npy_int32) * 8) - bits - (is_unsigned ? 0 : 1);
38431 if (unlikely(idigit >= (1L << remaining_bits)))
38432 goto raise_overflow;
38433 val |= ((npy_int32) idigit) << bits;
38435 if (!is_unsigned) {
38436 if (unlikely(val & (((npy_int32) 1) << (
sizeof(npy_int32) * 8 - 1))))
38437 goto raise_overflow;
38445 Py_XDECREF(stepval);
38448 return (npy_int32) -1;
38451 return __Pyx_raise_overflow___Pyx_PyLong_As_npy_int32();
38453static CYTHON_INLINE npy_int32 __Pyx_PyLong___Pyx_PyLong_As_npy_int32(PyObject *x) {
38454#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
38455#pragma GCC diagnostic push
38456#pragma GCC diagnostic ignored "-Wconversion"
38458 const npy_int32 neg_one = (npy_int32) -1, const_zero = (npy_int32) 0;
38459#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
38460#pragma GCC diagnostic pop
38462 const int is_unsigned = neg_one > const_zero;
38464 #if CYTHON_USE_PYLONG_INTERNALS
38465 if (unlikely(__Pyx_PyLong_IsNeg(x))) {
38466 goto raise_neg_overflow;
38467 }
else if (__Pyx_PyLong_IsCompact(x)) {
38468 __PYX_VERIFY_RETURN_INT(npy_int32, __Pyx_compact_upylong, __Pyx_PyLong_CompactValueUnsigned(x))
38472 return __Pyx_PyULong___Pyx_PyLong_As_npy_int32(x);
38475 #if CYTHON_USE_PYLONG_INTERNALS
38476 if (__Pyx_PyLong_IsCompact(x)) {
38477 __PYX_VERIFY_RETURN_INT(npy_int32, __Pyx_compact_pylong, __Pyx_PyLong_CompactValue(x))
38481 return __Pyx_PySLong___Pyx_PyLong_As_npy_int32(x);
38484#if CYTHON_USE_PYLONG_INTERNALS
38486 return __Pyx_raise_neg_overflow___Pyx_PyLong_As_npy_int32();
38488 return __Pyx_raise_overflow___Pyx_PyLong_As_npy_int32();
38491static npy_int32 __Pyx_NonPyLong___Pyx_PyLong_As_npy_int32(PyObject *x) {
38493 PyObject *tmp = __Pyx_PyNumber_Long(x);
38494 if (!tmp)
return (npy_int32) -1;
38495 val = __Pyx_PyLong_As_npy_int32(tmp);
38499static CYTHON_INLINE npy_int32 __Pyx_PyLong_As_npy_int32(PyObject *x) {
38500 if (likely(PyLong_Check(x))) {
38501 return __Pyx_PyLong___Pyx_PyLong_As_npy_int32(x);
38503 return __Pyx_NonPyLong___Pyx_PyLong_As_npy_int32(x);
38508static size_t __Pyx_LargePyLong___Pyx_PyLong_As_size_t(PyObject *x);
38509static size_t __Pyx_raise_neg_overflow___Pyx_PyLong_As_size_t(
void) {
38510 const char* type_name =
"size_t";
38511 PyErr_Format(PyExc_OverflowError,
38512 "can't convert negative value to %.200s", type_name);
38513 return (
size_t) -1;
38515static size_t __Pyx_raise_overflow___Pyx_PyLong_As_size_t(
void) {
38516 const char* type_name =
"size_t";
38517 PyErr_Format(PyExc_OverflowError,
38518 "value too large to convert to %.200s", type_name);
38519 return (
size_t) -1;
38521static CYTHON_INLINE
size_t __Pyx_PyULong___Pyx_PyLong_As_size_t(PyObject *x) {
38522 const int is_unsigned = 1;
38523#if CYTHON_USE_PYLONG_INTERNALS
38525 const digit* digits = __Pyx_PyLong_Digits(x);
38526 const Py_ssize_t size = __Pyx_PyLong_DigitCount(x);
38527 if (size == 2 && (8 *
sizeof(
size_t) > 1 * PyLong_SHIFT)) {
38528 if ((8 *
sizeof(
unsigned long) > 2 * PyLong_SHIFT)) {
38529 __PYX_VERIFY_RETURN_INT(
size_t,
unsigned long, (((((
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
38530 }
else if ((8 *
sizeof(
size_t) >= 2 * PyLong_SHIFT)) {
38531 return (
size_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
38534 if (size == 3 && (8 *
sizeof(
size_t) > 2 * PyLong_SHIFT)) {
38535 if ((8 *
sizeof(
unsigned long) > 3 * PyLong_SHIFT)) {
38536 __PYX_VERIFY_RETURN_INT(
size_t,
unsigned long, (((((((
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
38537 }
else if ((8 *
sizeof(
size_t) >= 3 * PyLong_SHIFT)) {
38538 return (
size_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
38541 if (size == 4 && (8 *
sizeof(
size_t) > 3 * PyLong_SHIFT)) {
38542 if ((8 *
sizeof(
unsigned long) > 4 * PyLong_SHIFT)) {
38543 __PYX_VERIFY_RETURN_INT(
size_t,
unsigned long, (((((((((
unsigned long)digits[3]) << PyLong_SHIFT) | (
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
38544 }
else if ((8 *
sizeof(
size_t) >= 4 * PyLong_SHIFT)) {
38545 return (
size_t) (((((((((size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
38550#elif CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030C00A7
38551 if (unlikely(Py_SIZE(x) < 0)) {
38552 goto raise_neg_overflow;
38556 int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
38557 if (unlikely(result < 0))
38558 return (
size_t) -1;
38559 if (unlikely(result == 1))
38560 goto raise_neg_overflow;
38563 if ((
sizeof(
size_t) <=
sizeof(
unsigned long))) {
38564 __PYX_VERIFY_RETURN_INT_EXC(
size_t,
unsigned long, PyLong_AsUnsignedLong(x))
38565 }
else if ((
sizeof(
size_t) <=
sizeof(
unsigned PY_LONG_LONG))) {
38566 __PYX_VERIFY_RETURN_INT_EXC(
size_t,
unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
38568 return __Pyx_LargePyLong___Pyx_PyLong_As_size_t(x);
38570 return __Pyx_raise_neg_overflow___Pyx_PyLong_As_size_t();
38572 return __Pyx_raise_overflow___Pyx_PyLong_As_size_t();
38574static CYTHON_INLINE
size_t __Pyx_PySLong___Pyx_PyLong_As_size_t(PyObject *x) {
38575 const int is_unsigned = 0;
38576#if CYTHON_USE_PYLONG_INTERNALS
38577 if (__Pyx_PyLong_IsNeg(x)) {
38578 const Py_ssize_t size = __Pyx_PyLong_DigitCount(x);
38579 const digit* digits = __Pyx_PyLong_Digits(x);
38580 if (size == 2 && (8 *
sizeof(
size_t) > 1 * PyLong_SHIFT)) {
38581 if ((8 *
sizeof(
long) > 2 * PyLong_SHIFT)) {
38582 long ival = - (long) (((((
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0]));
38583 __PYX_VERIFY_RETURN_INT(
size_t,
long, ival)
38584 }
else if ((8 *
sizeof(
size_t) - 1 > 2 * PyLong_SHIFT)) {
38585 return (
size_t) (((size_t) -1) * (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])));
38588 if (size == 3 && (8 *
sizeof(
size_t) > 2 * PyLong_SHIFT)) {
38589 if ((8 *
sizeof(
long) > 3 * PyLong_SHIFT)) {
38590 long ival = - (long) (((((((
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0]));
38591 __PYX_VERIFY_RETURN_INT(
size_t,
long, ival)
38592 }
else if ((8 *
sizeof(
size_t) - 1 > 3 * PyLong_SHIFT)) {
38593 return (
size_t) (((size_t) -1) * (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])));
38596 if (size == 4 && (8 *
sizeof(
size_t) > 3 * PyLong_SHIFT)) {
38597 if ((8 *
sizeof(
long) > 4 * PyLong_SHIFT)) {
38598 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]));
38599 __PYX_VERIFY_RETURN_INT(
size_t,
long, ival)
38600 }
else if ((8 *
sizeof(
size_t) - 1 > 4 * PyLong_SHIFT)) {
38601 return (
size_t) (((size_t) -1) * (((((((((size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])));
38606 const Py_ssize_t size = __Pyx_PyLong_DigitCount(x);
38607 const digit* digits = __Pyx_PyLong_Digits(x);
38608 if (size == 2 && (8 *
sizeof(
size_t) > 1 * PyLong_SHIFT)) {
38609 if ((8 *
sizeof(
long) > 2 * PyLong_SHIFT)) {
38610 __PYX_VERIFY_RETURN_INT(
size_t,
unsigned long, (((((
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
38611 }
else if ((8 *
sizeof(
size_t) - 1 > 2 * PyLong_SHIFT)) {
38612 return (
size_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
38615 if (size == 3 && (8 *
sizeof(
size_t) > 2 * PyLong_SHIFT)) {
38616 if ((8 *
sizeof(
long) > 3 * PyLong_SHIFT)) {
38617 __PYX_VERIFY_RETURN_INT(
size_t,
unsigned long, (((((((
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
38618 }
else if ((8 *
sizeof(
size_t) - 1 > 3 * PyLong_SHIFT)) {
38619 return (
size_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
38622 if (size == 4 && (8 *
sizeof(
size_t) > 3 * PyLong_SHIFT)) {
38623 if ((8 *
sizeof(
long) > 4 * PyLong_SHIFT)) {
38624 __PYX_VERIFY_RETURN_INT(
size_t,
unsigned long, (((((((((
unsigned long)digits[3]) << PyLong_SHIFT) | (
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
38625 }
else if ((8 *
sizeof(
size_t) - 1 > 4 * PyLong_SHIFT)) {
38626 return (
size_t) (((((((((size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
38632 #if __PYX_LIMITED_VERSION_HEX >= 0x030d0000
38633 if ((
sizeof(
size_t) <=
sizeof(
int)) && (
sizeof(
int) <
sizeof(
long))) {
38634 __PYX_VERIFY_RETURN_INT_EXC(
size_t,
int, PyLong_AsInt(x))
38637 if ((
sizeof(
size_t) <=
sizeof(
long))) {
38638 __PYX_VERIFY_RETURN_INT_EXC(
size_t,
long, PyLong_AsLong(x))
38639 }
else if ((
sizeof(
size_t) <=
sizeof(PY_LONG_LONG))) {
38640 __PYX_VERIFY_RETURN_INT_EXC(
size_t, PY_LONG_LONG, PyLong_AsLongLong(x))
38642 return __Pyx_LargePyLong___Pyx_PyLong_As_size_t(x);
38644 return __Pyx_raise_neg_overflow___Pyx_PyLong_As_size_t();
38646 return __Pyx_raise_overflow___Pyx_PyLong_As_size_t();
38648static size_t __Pyx_LargePyLong___Pyx_PyLong_As_size_t(PyObject *x) {
38649#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
38650#pragma GCC diagnostic push
38651#pragma GCC diagnostic ignored "-Wconversion"
38653 const size_t neg_one = (size_t) -1, const_zero = (
size_t) 0;
38654#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
38655#pragma GCC diagnostic pop
38657 const int is_unsigned = neg_one > const_zero;
38660#if PY_VERSION_HEX >= 0x030d00A6 && !CYTHON_COMPILING_IN_LIMITED_API
38661 Py_ssize_t bytes_copied = PyLong_AsNativeBytes(
38662 x, &val,
sizeof(val), Py_ASNATIVEBYTES_NATIVE_ENDIAN | (is_unsigned ? Py_ASNATIVEBYTES_UNSIGNED_BUFFER | Py_ASNATIVEBYTES_REJECT_NEGATIVE : 0));
38663 if (unlikely(bytes_copied == -1)) {
38664 }
else if (unlikely(bytes_copied > (Py_ssize_t)
sizeof(val))) {
38665 goto raise_overflow;
38669#elif PY_VERSION_HEX < 0x030d0000 && !(CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API) || defined(_PyLong_AsByteArray)
38670 int one = 1;
int is_little = (int)*(
unsigned char *)&one;
38671 unsigned char *bytes = (
unsigned char *)&val;
38672 ret = _PyLong_AsByteArray((PyLongObject *)x,
38673 bytes,
sizeof(val),
38674 is_little, !is_unsigned);
38675 if ((0))
goto raise_overflow;
38678 PyObject *stepval = NULL, *mask = NULL, *shift = NULL;
38679 int bits, remaining_bits, is_negative = 0;
38680 int chunk_size = (
sizeof(long) < 8) ? 30 : 62;
38681 if (likely(PyLong_CheckExact(x))) {
38682 v = __Pyx_NewRef(x);
38684 v = PyNumber_Long(x);
38685 if (unlikely(!
v))
return (
size_t) -1;
38686 assert(PyLong_CheckExact(
v));
38689 int result = PyObject_RichCompareBool(
v, Py_False, Py_LT);
38690 if (unlikely(result < 0)) {
38692 return (
size_t) -1;
38694 is_negative = result == 1;
38696 if (is_unsigned && unlikely(is_negative)) {
38698 PyErr_SetString(PyExc_OverflowError,
38699 "can't convert negative value to size_t");
38700 return (
size_t) -1;
38701 }
else if (is_negative) {
38702 stepval = PyNumber_Invert(
v);
38704 if (unlikely(!stepval))
38705 return (
size_t) -1;
38711 mask = PyLong_FromLong((1L << chunk_size) - 1);
if (unlikely(!mask))
goto done;
38712 shift = PyLong_FromLong(chunk_size);
if (unlikely(!shift))
goto done;
38713 for (bits = 0; bits < (int)
sizeof(size_t) * 8 - chunk_size; bits += chunk_size) {
38714 PyObject *tmp, *digit;
38716 digit = PyNumber_And(stepval, mask);
38717 if (unlikely(!digit))
goto done;
38718 idigit = PyLong_AsLong(digit);
38720 if (unlikely(idigit < 0))
goto done;
38721 val |= ((size_t) idigit) << bits;
38722 tmp = PyNumber_Rshift(stepval, shift);
38723 if (unlikely(!tmp))
goto done;
38724 Py_DECREF(stepval); stepval = tmp;
38726 Py_DECREF(shift); shift = NULL;
38727 Py_DECREF(mask); mask = NULL;
38729 long idigit = PyLong_AsLong(stepval);
38730 if (unlikely(idigit < 0))
goto done;
38731 remaining_bits = ((int)
sizeof(size_t) * 8) - bits - (is_unsigned ? 0 : 1);
38732 if (unlikely(idigit >= (1L << remaining_bits)))
38733 goto raise_overflow;
38734 val |= ((size_t) idigit) << bits;
38736 if (!is_unsigned) {
38737 if (unlikely(val & (((
size_t) 1) << (
sizeof(
size_t) * 8 - 1))))
38738 goto raise_overflow;
38746 Py_XDECREF(stepval);
38749 return (
size_t) -1;
38752 return __Pyx_raise_overflow___Pyx_PyLong_As_size_t();
38754static CYTHON_INLINE
size_t __Pyx_PyLong___Pyx_PyLong_As_size_t(PyObject *x) {
38755#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
38756#pragma GCC diagnostic push
38757#pragma GCC diagnostic ignored "-Wconversion"
38759 const size_t neg_one = (size_t) -1, const_zero = (
size_t) 0;
38760#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
38761#pragma GCC diagnostic pop
38763 const int is_unsigned = neg_one > const_zero;
38765 #if CYTHON_USE_PYLONG_INTERNALS
38766 if (unlikely(__Pyx_PyLong_IsNeg(x))) {
38767 goto raise_neg_overflow;
38768 }
else if (__Pyx_PyLong_IsCompact(x)) {
38769 __PYX_VERIFY_RETURN_INT(
size_t, __Pyx_compact_upylong, __Pyx_PyLong_CompactValueUnsigned(x))
38773 return __Pyx_PyULong___Pyx_PyLong_As_size_t(x);
38776 #if CYTHON_USE_PYLONG_INTERNALS
38777 if (__Pyx_PyLong_IsCompact(x)) {
38778 __PYX_VERIFY_RETURN_INT(
size_t, __Pyx_compact_pylong, __Pyx_PyLong_CompactValue(x))
38782 return __Pyx_PySLong___Pyx_PyLong_As_size_t(x);
38785#if CYTHON_USE_PYLONG_INTERNALS
38787 return __Pyx_raise_neg_overflow___Pyx_PyLong_As_size_t();
38789 return __Pyx_raise_overflow___Pyx_PyLong_As_size_t();
38792static size_t __Pyx_NonPyLong___Pyx_PyLong_As_size_t(PyObject *x) {
38794 PyObject *tmp = __Pyx_PyNumber_Long(x);
38795 if (!tmp)
return (
size_t) -1;
38796 val = __Pyx_PyLong_As_size_t(tmp);
38800static CYTHON_INLINE
size_t __Pyx_PyLong_As_size_t(PyObject *x) {
38801 if (likely(PyLong_Check(x))) {
38802 return __Pyx_PyLong___Pyx_PyLong_As_size_t(x);
38804 return __Pyx_NonPyLong___Pyx_PyLong_As_size_t(x);
38809static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethod1(PyObject* obj, PyObject* method_name, PyObject* arg) {
38810#if CYTHON_VECTORCALL && (__PYX_LIMITED_VERSION_HEX >= 0x030C0000 || !CYTHON_COMPILING_IN_LIMITED_API)
38811 PyObject *args[2] = {obj, arg};
38812 return PyObject_VectorcallMethod(method_name, args, 2 | PY_VECTORCALL_ARGUMENTS_OFFSET, NULL);
38813#elif CYTHON_COMPILING_IN_LIMITED_API
38814 return PyObject_CallMethodObjArgs(obj, method_name, arg, NULL);
38816 return PyObject_CallMethodOneArg(obj, method_name, arg);
38821static int __Pyx__UpdateUnpickledDict(PyObject *obj, PyObject *state, Py_ssize_t index) {
38822 PyObject *state_dict = __Pyx_PySequence_ITEM(state, index);
38823 if (unlikely(!state_dict)) {
38826 int non_empty = PyObject_IsTrue(state_dict);
38827 if (non_empty == 0) {
38828 Py_DECREF(state_dict);
38830 }
else if (unlikely(non_empty == -1)) {
38834 #if CYTHON_COMPILING_IN_LIMITED_API && __PYX_LIMITED_VERSION_HEX < 0x030A0000
38835 dict = PyObject_GetAttrString(obj,
"__dict__");
38837 dict = PyObject_GenericGetDict(obj, NULL);
38839 if (unlikely(!dict)) {
38840 Py_DECREF(state_dict);
38844 if (likely(PyDict_CheckExact(dict))) {
38845 result = PyDict_Update(dict, state_dict);
38847 PyObject *obj_result = __Pyx_PyObject_CallMethod1(dict, __pyx_mstate_global->__pyx_n_u_update, state_dict);
38848 if (likely(obj_result)) {
38849 Py_DECREF(obj_result);
38855 Py_DECREF(state_dict);
38859static int __Pyx_UpdateUnpickledDict(PyObject *obj, PyObject *state, Py_ssize_t index) {
38860 Py_ssize_t state_size = __Pyx_PyTuple_GET_SIZE(state);
38861 #if !CYTHON_ASSUME_SAFE_SIZE
38862 if (unlikely(state_size == -1))
return -1;
38864 if (state_size <= index) {
38867 return __Pyx__UpdateUnpickledDict(obj, state, index);
38871static void __Pyx_RaiseUnpickleChecksumError(
long checksum,
long checksum1,
long checksum2,
long checksum3,
const char *members) {
38872 PyObject *pickle_module = PyImport_ImportModule(
"pickle");
38873 if (unlikely(!pickle_module))
return;
38874 PyObject *pickle_error = PyObject_GetAttrString(pickle_module,
"PickleError");
38875 Py_DECREF(pickle_module);
38876 if (unlikely(!pickle_error))
return;
38877 if (checksum2 == checksum1) {
38878 PyErr_Format(pickle_error,
"Incompatible checksums (0x%x vs (0x%x) = (%s))",
38879 checksum, checksum1, members);
38880 }
else if (checksum3 == checksum2) {
38881 PyErr_Format(pickle_error,
"Incompatible checksums (0x%x vs (0x%x, 0x%x) = (%s))",
38882 checksum, checksum1, checksum2, members);
38884 PyErr_Format(pickle_error,
"Incompatible checksums (0x%x vs (0x%x, 0x%x, 0x%x) = (%s))",
38885 checksum, checksum1, checksum2, checksum3, members);
38887 Py_DECREF(pickle_error);
38891static int __Pyx_CheckUnpickleChecksum(
long checksum,
long checksum1,
long checksum2,
long checksum3,
const char *members) {
38893 found |= checksum1 == checksum;
38894 found |= checksum2 == checksum;
38895 found |= checksum3 == checksum;
38898 __Pyx_RaiseUnpickleChecksumError(checksum, checksum1, checksum2, checksum3, members);
38903static long __Pyx_LargePyLong___Pyx_PyLong_As_long(PyObject *x);
38904static long __Pyx_raise_neg_overflow___Pyx_PyLong_As_long(
void) {
38905 const char* type_name =
"long";
38906 PyErr_Format(PyExc_OverflowError,
38907 "can't convert negative value to %.200s", type_name);
38910static long __Pyx_raise_overflow___Pyx_PyLong_As_long(
void) {
38911 const char* type_name =
"long";
38912 PyErr_Format(PyExc_OverflowError,
38913 "value too large to convert to %.200s", type_name);
38916static CYTHON_INLINE
long __Pyx_PyULong___Pyx_PyLong_As_long(PyObject *x) {
38917 const int is_unsigned = 1;
38918#if CYTHON_USE_PYLONG_INTERNALS
38920 const digit* digits = __Pyx_PyLong_Digits(x);
38921 const Py_ssize_t size = __Pyx_PyLong_DigitCount(x);
38922 if (size == 2 && (8 *
sizeof(
long) > 1 * PyLong_SHIFT)) {
38923 if ((8 *
sizeof(
unsigned long) > 2 * PyLong_SHIFT)) {
38924 __PYX_VERIFY_RETURN_INT(
long,
unsigned long, (((((
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
38925 }
else if ((8 *
sizeof(
long) >= 2 * PyLong_SHIFT)) {
38926 return (
long) (((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0]));
38929 if (size == 3 && (8 *
sizeof(
long) > 2 * PyLong_SHIFT)) {
38930 if ((8 *
sizeof(
unsigned long) > 3 * PyLong_SHIFT)) {
38931 __PYX_VERIFY_RETURN_INT(
long,
unsigned long, (((((((
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
38932 }
else if ((8 *
sizeof(
long) >= 3 * PyLong_SHIFT)) {
38933 return (
long) (((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]));
38936 if (size == 4 && (8 *
sizeof(
long) > 3 * PyLong_SHIFT)) {
38937 if ((8 *
sizeof(
unsigned long) > 4 * PyLong_SHIFT)) {
38938 __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])))
38939 }
else if ((8 *
sizeof(
long) >= 4 * PyLong_SHIFT)) {
38940 return (
long) (((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]));
38945#elif CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030C00A7
38946 if (unlikely(Py_SIZE(x) < 0)) {
38947 goto raise_neg_overflow;
38951 int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
38952 if (unlikely(result < 0))
38954 if (unlikely(result == 1))
38955 goto raise_neg_overflow;
38958 if ((
sizeof(
long) <=
sizeof(
unsigned long))) {
38959 __PYX_VERIFY_RETURN_INT_EXC(
long,
unsigned long, PyLong_AsUnsignedLong(x))
38960 }
else if ((
sizeof(
long) <=
sizeof(
unsigned PY_LONG_LONG))) {
38961 __PYX_VERIFY_RETURN_INT_EXC(
long,
unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
38963 return __Pyx_LargePyLong___Pyx_PyLong_As_long(x);
38965 return __Pyx_raise_neg_overflow___Pyx_PyLong_As_long();
38967 return __Pyx_raise_overflow___Pyx_PyLong_As_long();
38969static CYTHON_INLINE
long __Pyx_PySLong___Pyx_PyLong_As_long(PyObject *x) {
38970 const int is_unsigned = 0;
38971#if CYTHON_USE_PYLONG_INTERNALS
38972 if (__Pyx_PyLong_IsNeg(x)) {
38973 const Py_ssize_t size = __Pyx_PyLong_DigitCount(x);
38974 const digit* digits = __Pyx_PyLong_Digits(x);
38975 if (size == 2 && (8 *
sizeof(
long) > 1 * PyLong_SHIFT)) {
38976 if ((8 *
sizeof(
long) > 2 * PyLong_SHIFT)) {
38977 long ival = - (long) (((((
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0]));
38978 __PYX_VERIFY_RETURN_INT(
long,
long, ival)
38979 }
else if ((8 *
sizeof(
long) - 1 > 2 * PyLong_SHIFT)) {
38980 return (
long) (((long) -1) * (((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
38983 if (size == 3 && (8 *
sizeof(
long) > 2 * PyLong_SHIFT)) {
38984 if ((8 *
sizeof(
long) > 3 * PyLong_SHIFT)) {
38985 long ival = - (long) (((((((
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0]));
38986 __PYX_VERIFY_RETURN_INT(
long,
long, ival)
38987 }
else if ((8 *
sizeof(
long) - 1 > 3 * PyLong_SHIFT)) {
38988 return (
long) (((long) -1) * (((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
38991 if (size == 4 && (8 *
sizeof(
long) > 3 * PyLong_SHIFT)) {
38992 if ((8 *
sizeof(
long) > 4 * PyLong_SHIFT)) {
38993 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]));
38994 __PYX_VERIFY_RETURN_INT(
long,
long, ival)
38995 }
else if ((8 *
sizeof(
long) - 1 > 4 * PyLong_SHIFT)) {
38996 return (
long) (((long) -1) * (((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
39001 const Py_ssize_t size = __Pyx_PyLong_DigitCount(x);
39002 const digit* digits = __Pyx_PyLong_Digits(x);
39003 if (size == 2 && (8 *
sizeof(
long) > 1 * PyLong_SHIFT)) {
39004 if ((8 *
sizeof(
long) > 2 * PyLong_SHIFT)) {
39005 __PYX_VERIFY_RETURN_INT(
long,
unsigned long, (((((
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
39006 }
else if ((8 *
sizeof(
long) - 1 > 2 * PyLong_SHIFT)) {
39007 return (
long) (((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0]));
39010 if (size == 3 && (8 *
sizeof(
long) > 2 * PyLong_SHIFT)) {
39011 if ((8 *
sizeof(
long) > 3 * PyLong_SHIFT)) {
39012 __PYX_VERIFY_RETURN_INT(
long,
unsigned long, (((((((
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
39013 }
else if ((8 *
sizeof(
long) - 1 > 3 * PyLong_SHIFT)) {
39014 return (
long) (((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]));
39017 if (size == 4 && (8 *
sizeof(
long) > 3 * PyLong_SHIFT)) {
39018 if ((8 *
sizeof(
long) > 4 * PyLong_SHIFT)) {
39019 __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])))
39020 }
else if ((8 *
sizeof(
long) - 1 > 4 * PyLong_SHIFT)) {
39021 return (
long) (((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]));
39027 #if __PYX_LIMITED_VERSION_HEX >= 0x030d0000
39028 if ((
sizeof(
long) <=
sizeof(
int)) && (
sizeof(
int) <
sizeof(
long))) {
39029 __PYX_VERIFY_RETURN_INT_EXC(
long,
int, PyLong_AsInt(x))
39032 if ((
sizeof(
long) <=
sizeof(
long))) {
39033 __PYX_VERIFY_RETURN_INT_EXC(
long,
long, PyLong_AsLong(x))
39034 }
else if ((
sizeof(
long) <=
sizeof(PY_LONG_LONG))) {
39035 __PYX_VERIFY_RETURN_INT_EXC(
long, PY_LONG_LONG, PyLong_AsLongLong(x))
39037 return __Pyx_LargePyLong___Pyx_PyLong_As_long(x);
39039 return __Pyx_raise_neg_overflow___Pyx_PyLong_As_long();
39041 return __Pyx_raise_overflow___Pyx_PyLong_As_long();
39043static long __Pyx_LargePyLong___Pyx_PyLong_As_long(PyObject *x) {
39044#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
39045#pragma GCC diagnostic push
39046#pragma GCC diagnostic ignored "-Wconversion"
39048 const long neg_one = (long) -1, const_zero = (
long) 0;
39049#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
39050#pragma GCC diagnostic pop
39052 const int is_unsigned = neg_one > const_zero;
39055#if PY_VERSION_HEX >= 0x030d00A6 && !CYTHON_COMPILING_IN_LIMITED_API
39056 Py_ssize_t bytes_copied = PyLong_AsNativeBytes(
39057 x, &val,
sizeof(val), Py_ASNATIVEBYTES_NATIVE_ENDIAN | (is_unsigned ? Py_ASNATIVEBYTES_UNSIGNED_BUFFER | Py_ASNATIVEBYTES_REJECT_NEGATIVE : 0));
39058 if (unlikely(bytes_copied == -1)) {
39059 }
else if (unlikely(bytes_copied > (Py_ssize_t)
sizeof(val))) {
39060 goto raise_overflow;
39064#elif PY_VERSION_HEX < 0x030d0000 && !(CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API) || defined(_PyLong_AsByteArray)
39065 int one = 1;
int is_little = (int)*(
unsigned char *)&one;
39066 unsigned char *bytes = (
unsigned char *)&val;
39067 ret = _PyLong_AsByteArray((PyLongObject *)x,
39068 bytes,
sizeof(val),
39069 is_little, !is_unsigned);
39070 if ((0))
goto raise_overflow;
39073 PyObject *stepval = NULL, *mask = NULL, *shift = NULL;
39074 int bits, remaining_bits, is_negative = 0;
39075 int chunk_size = (
sizeof(long) < 8) ? 30 : 62;
39076 if (likely(PyLong_CheckExact(x))) {
39077 v = __Pyx_NewRef(x);
39079 v = PyNumber_Long(x);
39080 if (unlikely(!
v))
return (
long) -1;
39081 assert(PyLong_CheckExact(
v));
39084 int result = PyObject_RichCompareBool(
v, Py_False, Py_LT);
39085 if (unlikely(result < 0)) {
39089 is_negative = result == 1;
39091 if (is_unsigned && unlikely(is_negative)) {
39093 PyErr_SetString(PyExc_OverflowError,
39094 "can't convert negative value to long");
39096 }
else if (is_negative) {
39097 stepval = PyNumber_Invert(
v);
39099 if (unlikely(!stepval))
39106 mask = PyLong_FromLong((1L << chunk_size) - 1);
if (unlikely(!mask))
goto done;
39107 shift = PyLong_FromLong(chunk_size);
if (unlikely(!shift))
goto done;
39108 for (bits = 0; bits < (int)
sizeof(long) * 8 - chunk_size; bits += chunk_size) {
39109 PyObject *tmp, *digit;
39111 digit = PyNumber_And(stepval, mask);
39112 if (unlikely(!digit))
goto done;
39113 idigit = PyLong_AsLong(digit);
39115 if (unlikely(idigit < 0))
goto done;
39116 val |= ((long) idigit) << bits;
39117 tmp = PyNumber_Rshift(stepval, shift);
39118 if (unlikely(!tmp))
goto done;
39119 Py_DECREF(stepval); stepval = tmp;
39121 Py_DECREF(shift); shift = NULL;
39122 Py_DECREF(mask); mask = NULL;
39124 long idigit = PyLong_AsLong(stepval);
39125 if (unlikely(idigit < 0))
goto done;
39126 remaining_bits = ((int)
sizeof(long) * 8) - bits - (is_unsigned ? 0 : 1);
39127 if (unlikely(idigit >= (1L << remaining_bits)))
39128 goto raise_overflow;
39129 val |= ((long) idigit) << bits;
39131 if (!is_unsigned) {
39132 if (unlikely(val & (((
long) 1) << (
sizeof(
long) * 8 - 1))))
39133 goto raise_overflow;
39141 Py_XDECREF(stepval);
39147 return __Pyx_raise_overflow___Pyx_PyLong_As_long();
39149static CYTHON_INLINE
long __Pyx_PyLong___Pyx_PyLong_As_long(PyObject *x) {
39150#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
39151#pragma GCC diagnostic push
39152#pragma GCC diagnostic ignored "-Wconversion"
39154 const long neg_one = (long) -1, const_zero = (
long) 0;
39155#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
39156#pragma GCC diagnostic pop
39158 const int is_unsigned = neg_one > const_zero;
39160 #if CYTHON_USE_PYLONG_INTERNALS
39161 if (unlikely(__Pyx_PyLong_IsNeg(x))) {
39162 goto raise_neg_overflow;
39163 }
else if (__Pyx_PyLong_IsCompact(x)) {
39164 __PYX_VERIFY_RETURN_INT(
long, __Pyx_compact_upylong, __Pyx_PyLong_CompactValueUnsigned(x))
39168 return __Pyx_PyULong___Pyx_PyLong_As_long(x);
39171 #if CYTHON_USE_PYLONG_INTERNALS
39172 if (__Pyx_PyLong_IsCompact(x)) {
39173 __PYX_VERIFY_RETURN_INT(
long, __Pyx_compact_pylong, __Pyx_PyLong_CompactValue(x))
39177 return __Pyx_PySLong___Pyx_PyLong_As_long(x);
39180#if CYTHON_USE_PYLONG_INTERNALS
39182 return __Pyx_raise_neg_overflow___Pyx_PyLong_As_long();
39184 return __Pyx_raise_overflow___Pyx_PyLong_As_long();
39187static long __Pyx_NonPyLong___Pyx_PyLong_As_long(PyObject *x) {
39189 PyObject *tmp = __Pyx_PyNumber_Long(x);
39190 if (!tmp)
return (
long) -1;
39191 val = __Pyx_PyLong_As_long(tmp);
39195static CYTHON_INLINE
long __Pyx_PyLong_As_long(PyObject *x) {
39196 if (likely(PyLong_Check(x))) {
39197 return __Pyx_PyLong___Pyx_PyLong_As_long(x);
39199 return __Pyx_NonPyLong___Pyx_PyLong_As_long(x);
39204static CYTHON_INLINE PyObject* __Pyx_PyLong_From_long(
long value) {
39205#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
39206#pragma GCC diagnostic push
39207#pragma GCC diagnostic ignored "-Wconversion"
39209 const long neg_one = (long) -1, const_zero = (
long) 0;
39210#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
39211#pragma GCC diagnostic pop
39213 const int is_unsigned = neg_one > const_zero;
39215 if (
sizeof(
long) <
sizeof(
long)) {
39216 return PyLong_FromLong((
long) value);
39217 }
else if (
sizeof(
long) <=
sizeof(
unsigned long)) {
39218 return PyLong_FromUnsignedLong((
unsigned long) value);
39219#if !CYTHON_COMPILING_IN_PYPY
39220 }
else if (
sizeof(
long) <=
sizeof(
unsigned PY_LONG_LONG)) {
39221 return PyLong_FromUnsignedLongLong((
unsigned PY_LONG_LONG) value);
39225 if (
sizeof(
long) <=
sizeof(
long)) {
39226 return PyLong_FromLong((
long) value);
39227 }
else if (
sizeof(
long) <=
sizeof(PY_LONG_LONG)) {
39228 return PyLong_FromLongLong((PY_LONG_LONG) value);
39232 unsigned char *bytes = (
unsigned char *)&value;
39233#if !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX >= 0x030d00A4
39235 return PyLong_FromUnsignedNativeBytes(bytes,
sizeof(value), -1);
39237 return PyLong_FromNativeBytes(bytes,
sizeof(value), -1);
39239#elif !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030d0000
39240 int one = 1;
int little = (int)*(
unsigned char *)&one;
39241 return _PyLong_FromByteArray(bytes,
sizeof(
long),
39242 little, !is_unsigned);
39244 int one = 1;
int little = (int)*(
unsigned char *)&one;
39245 PyObject *result = NULL, *kwds = NULL;
39246 PyObject *py_bytes = NULL, *order_str = NULL, *from_bytes_str = NULL;;
39247 py_bytes = PyBytes_FromStringAndSize((
char*)bytes,
sizeof(
long));
39248 if (!py_bytes)
goto limited_bad;
39249 from_bytes_str = PyUnicode_FromStringAndSize(
"from_bytes", 10);
39250 if (!from_bytes_str)
goto limited_bad;
39251 order_str = PyUnicode_FromString(little ?
"little" :
"big");
39252 if (!order_str)
goto limited_bad;
39254 PyObject *args[] = { (PyObject*)&PyLong_Type, py_bytes, order_str, Py_True };
39255 if (!is_unsigned) {
39256 PyObject *signed_str = PyUnicode_FromStringAndSize(
"signed", 6);
39257 if (!signed_str)
goto limited_bad;
39258#if CYTHON_VECTORCALL
39259 kwds = PyTuple_Pack(1, signed_str);
39262 PyObject *keys[] = {signed_str};
39263 PyObject *values[] = {Py_True};
39264 kwds = __Pyx_MakeKwargDict(keys, values, 1);
39267 Py_DECREF(signed_str);
39268 if (unlikely(!kwds))
goto limited_bad;
39270 result = __Pyx_Object_VectorcallMethodKwds(from_bytes_str, args, 3 | __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET, kwds);
39274 Py_XDECREF(order_str);
39275 Py_XDECREF(py_bytes);
39276 Py_XDECREF(from_bytes_str);
39283static char __Pyx_LargePyLong___Pyx_PyLong_As_char(PyObject *x);
39284static char __Pyx_raise_neg_overflow___Pyx_PyLong_As_char(
void) {
39285 const char* type_name =
"char";
39286 PyErr_Format(PyExc_OverflowError,
39287 "can't convert negative value to %.200s", type_name);
39290static char __Pyx_raise_overflow___Pyx_PyLong_As_char(
void) {
39291 const char* type_name =
"char";
39292 PyErr_Format(PyExc_OverflowError,
39293 "value too large to convert to %.200s", type_name);
39296static CYTHON_INLINE
char __Pyx_PyULong___Pyx_PyLong_As_char(PyObject *x) {
39297 const int is_unsigned = 1;
39298#if CYTHON_USE_PYLONG_INTERNALS
39300 const digit* digits = __Pyx_PyLong_Digits(x);
39301 const Py_ssize_t size = __Pyx_PyLong_DigitCount(x);
39302 if (size == 2 && (8 *
sizeof(
char) > 1 * PyLong_SHIFT)) {
39303 if ((8 *
sizeof(
unsigned long) > 2 * PyLong_SHIFT)) {
39304 __PYX_VERIFY_RETURN_INT(
char,
unsigned long, (((((
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
39305 }
else if ((8 *
sizeof(
char) >= 2 * PyLong_SHIFT)) {
39306 return (
char) (((((char)digits[1]) << PyLong_SHIFT) | (char)digits[0]));
39309 if (size == 3 && (8 *
sizeof(
char) > 2 * PyLong_SHIFT)) {
39310 if ((8 *
sizeof(
unsigned long) > 3 * PyLong_SHIFT)) {
39311 __PYX_VERIFY_RETURN_INT(
char,
unsigned long, (((((((
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
39312 }
else if ((8 *
sizeof(
char) >= 3 * PyLong_SHIFT)) {
39313 return (
char) (((((((char)digits[2]) << PyLong_SHIFT) | (char)digits[1]) << PyLong_SHIFT) | (char)digits[0]));
39316 if (size == 4 && (8 *
sizeof(
char) > 3 * PyLong_SHIFT)) {
39317 if ((8 *
sizeof(
unsigned long) > 4 * PyLong_SHIFT)) {
39318 __PYX_VERIFY_RETURN_INT(
char,
unsigned long, (((((((((
unsigned long)digits[3]) << PyLong_SHIFT) | (
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
39319 }
else if ((8 *
sizeof(
char) >= 4 * PyLong_SHIFT)) {
39320 return (
char) (((((((((char)digits[3]) << PyLong_SHIFT) | (char)digits[2]) << PyLong_SHIFT) | (char)digits[1]) << PyLong_SHIFT) | (char)digits[0]));
39325#elif CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030C00A7
39326 if (unlikely(Py_SIZE(x) < 0)) {
39327 goto raise_neg_overflow;
39331 int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
39332 if (unlikely(result < 0))
39334 if (unlikely(result == 1))
39335 goto raise_neg_overflow;
39338 if ((
sizeof(
char) <=
sizeof(
unsigned long))) {
39339 __PYX_VERIFY_RETURN_INT_EXC(
char,
unsigned long, PyLong_AsUnsignedLong(x))
39340 }
else if ((
sizeof(
char) <=
sizeof(
unsigned PY_LONG_LONG))) {
39341 __PYX_VERIFY_RETURN_INT_EXC(
char,
unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
39343 return __Pyx_LargePyLong___Pyx_PyLong_As_char(x);
39345 return __Pyx_raise_neg_overflow___Pyx_PyLong_As_char();
39347 return __Pyx_raise_overflow___Pyx_PyLong_As_char();
39349static CYTHON_INLINE
char __Pyx_PySLong___Pyx_PyLong_As_char(PyObject *x) {
39350 const int is_unsigned = 0;
39351#if CYTHON_USE_PYLONG_INTERNALS
39352 if (__Pyx_PyLong_IsNeg(x)) {
39353 const Py_ssize_t size = __Pyx_PyLong_DigitCount(x);
39354 const digit* digits = __Pyx_PyLong_Digits(x);
39355 if (size == 2 && (8 *
sizeof(
char) > 1 * PyLong_SHIFT)) {
39356 if ((8 *
sizeof(
long) > 2 * PyLong_SHIFT)) {
39357 long ival = - (long) (((((
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0]));
39358 __PYX_VERIFY_RETURN_INT(
char,
long, ival)
39359 }
else if ((8 *
sizeof(
char) - 1 > 2 * PyLong_SHIFT)) {
39360 return (
char) (((char) -1) * (((((char)digits[1]) << PyLong_SHIFT) | (char)digits[0])));
39363 if (size == 3 && (8 *
sizeof(
char) > 2 * PyLong_SHIFT)) {
39364 if ((8 *
sizeof(
long) > 3 * PyLong_SHIFT)) {
39365 long ival = - (long) (((((((
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0]));
39366 __PYX_VERIFY_RETURN_INT(
char,
long, ival)
39367 }
else if ((8 *
sizeof(
char) - 1 > 3 * PyLong_SHIFT)) {
39368 return (
char) (((char) -1) * (((((((char)digits[2]) << PyLong_SHIFT) | (char)digits[1]) << PyLong_SHIFT) | (char)digits[0])));
39371 if (size == 4 && (8 *
sizeof(
char) > 3 * PyLong_SHIFT)) {
39372 if ((8 *
sizeof(
long) > 4 * PyLong_SHIFT)) {
39373 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]));
39374 __PYX_VERIFY_RETURN_INT(
char,
long, ival)
39375 }
else if ((8 *
sizeof(
char) - 1 > 4 * PyLong_SHIFT)) {
39376 return (
char) (((char) -1) * (((((((((char)digits[3]) << PyLong_SHIFT) | (char)digits[2]) << PyLong_SHIFT) | (char)digits[1]) << PyLong_SHIFT) | (char)digits[0])));
39381 const Py_ssize_t size = __Pyx_PyLong_DigitCount(x);
39382 const digit* digits = __Pyx_PyLong_Digits(x);
39383 if (size == 2 && (8 *
sizeof(
char) > 1 * PyLong_SHIFT)) {
39384 if ((8 *
sizeof(
long) > 2 * PyLong_SHIFT)) {
39385 __PYX_VERIFY_RETURN_INT(
char,
unsigned long, (((((
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
39386 }
else if ((8 *
sizeof(
char) - 1 > 2 * PyLong_SHIFT)) {
39387 return (
char) (((((char)digits[1]) << PyLong_SHIFT) | (char)digits[0]));
39390 if (size == 3 && (8 *
sizeof(
char) > 2 * PyLong_SHIFT)) {
39391 if ((8 *
sizeof(
long) > 3 * PyLong_SHIFT)) {
39392 __PYX_VERIFY_RETURN_INT(
char,
unsigned long, (((((((
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
39393 }
else if ((8 *
sizeof(
char) - 1 > 3 * PyLong_SHIFT)) {
39394 return (
char) (((((((char)digits[2]) << PyLong_SHIFT) | (char)digits[1]) << PyLong_SHIFT) | (char)digits[0]));
39397 if (size == 4 && (8 *
sizeof(
char) > 3 * PyLong_SHIFT)) {
39398 if ((8 *
sizeof(
long) > 4 * PyLong_SHIFT)) {
39399 __PYX_VERIFY_RETURN_INT(
char,
unsigned long, (((((((((
unsigned long)digits[3]) << PyLong_SHIFT) | (
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
39400 }
else if ((8 *
sizeof(
char) - 1 > 4 * PyLong_SHIFT)) {
39401 return (
char) (((((((((char)digits[3]) << PyLong_SHIFT) | (char)digits[2]) << PyLong_SHIFT) | (char)digits[1]) << PyLong_SHIFT) | (char)digits[0]));
39407 #if __PYX_LIMITED_VERSION_HEX >= 0x030d0000
39408 if ((
sizeof(
char) <=
sizeof(
int)) && (
sizeof(
int) <
sizeof(
long))) {
39409 __PYX_VERIFY_RETURN_INT_EXC(
char,
int, PyLong_AsInt(x))
39412 if ((
sizeof(
char) <=
sizeof(
long))) {
39413 __PYX_VERIFY_RETURN_INT_EXC(
char,
long, PyLong_AsLong(x))
39414 }
else if ((
sizeof(
char) <=
sizeof(PY_LONG_LONG))) {
39415 __PYX_VERIFY_RETURN_INT_EXC(
char, PY_LONG_LONG, PyLong_AsLongLong(x))
39417 return __Pyx_LargePyLong___Pyx_PyLong_As_char(x);
39419 return __Pyx_raise_neg_overflow___Pyx_PyLong_As_char();
39421 return __Pyx_raise_overflow___Pyx_PyLong_As_char();
39423static char __Pyx_LargePyLong___Pyx_PyLong_As_char(PyObject *x) {
39424#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
39425#pragma GCC diagnostic push
39426#pragma GCC diagnostic ignored "-Wconversion"
39428 const char neg_one = (char) -1, const_zero = (
char) 0;
39429#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
39430#pragma GCC diagnostic pop
39432 const int is_unsigned = neg_one > const_zero;
39435#if PY_VERSION_HEX >= 0x030d00A6 && !CYTHON_COMPILING_IN_LIMITED_API
39436 Py_ssize_t bytes_copied = PyLong_AsNativeBytes(
39437 x, &val,
sizeof(val), Py_ASNATIVEBYTES_NATIVE_ENDIAN | (is_unsigned ? Py_ASNATIVEBYTES_UNSIGNED_BUFFER | Py_ASNATIVEBYTES_REJECT_NEGATIVE : 0));
39438 if (unlikely(bytes_copied == -1)) {
39439 }
else if (unlikely(bytes_copied > (Py_ssize_t)
sizeof(val))) {
39440 goto raise_overflow;
39444#elif PY_VERSION_HEX < 0x030d0000 && !(CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API) || defined(_PyLong_AsByteArray)
39445 int one = 1;
int is_little = (int)*(
unsigned char *)&one;
39446 unsigned char *bytes = (
unsigned char *)&val;
39447 ret = _PyLong_AsByteArray((PyLongObject *)x,
39448 bytes,
sizeof(val),
39449 is_little, !is_unsigned);
39450 if ((0))
goto raise_overflow;
39453 PyObject *stepval = NULL, *mask = NULL, *shift = NULL;
39454 int bits, remaining_bits, is_negative = 0;
39455 int chunk_size = (
sizeof(long) < 8) ? 30 : 62;
39456 if (likely(PyLong_CheckExact(x))) {
39457 v = __Pyx_NewRef(x);
39459 v = PyNumber_Long(x);
39460 if (unlikely(!
v))
return (
char) -1;
39461 assert(PyLong_CheckExact(
v));
39464 int result = PyObject_RichCompareBool(
v, Py_False, Py_LT);
39465 if (unlikely(result < 0)) {
39469 is_negative = result == 1;
39471 if (is_unsigned && unlikely(is_negative)) {
39473 PyErr_SetString(PyExc_OverflowError,
39474 "can't convert negative value to char");
39476 }
else if (is_negative) {
39477 stepval = PyNumber_Invert(
v);
39479 if (unlikely(!stepval))
39486 mask = PyLong_FromLong((1L << chunk_size) - 1);
if (unlikely(!mask))
goto done;
39487 shift = PyLong_FromLong(chunk_size);
if (unlikely(!shift))
goto done;
39488 for (bits = 0; bits < (int)
sizeof(char) * 8 - chunk_size; bits += chunk_size) {
39489 PyObject *tmp, *digit;
39491 digit = PyNumber_And(stepval, mask);
39492 if (unlikely(!digit))
goto done;
39493 idigit = PyLong_AsLong(digit);
39495 if (unlikely(idigit < 0))
goto done;
39496 val |= ((char) idigit) << bits;
39497 tmp = PyNumber_Rshift(stepval, shift);
39498 if (unlikely(!tmp))
goto done;
39499 Py_DECREF(stepval); stepval = tmp;
39501 Py_DECREF(shift); shift = NULL;
39502 Py_DECREF(mask); mask = NULL;
39504 long idigit = PyLong_AsLong(stepval);
39505 if (unlikely(idigit < 0))
goto done;
39506 remaining_bits = ((int)
sizeof(char) * 8) - bits - (is_unsigned ? 0 : 1);
39507 if (unlikely(idigit >= (1L << remaining_bits)))
39508 goto raise_overflow;
39509 val |= ((char) idigit) << bits;
39511 if (!is_unsigned) {
39512 if (unlikely(val & (((
char) 1) << (
sizeof(
char) * 8 - 1))))
39513 goto raise_overflow;
39521 Py_XDECREF(stepval);
39527 return __Pyx_raise_overflow___Pyx_PyLong_As_char();
39529static CYTHON_INLINE
char __Pyx_PyLong___Pyx_PyLong_As_char(PyObject *x) {
39530#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
39531#pragma GCC diagnostic push
39532#pragma GCC diagnostic ignored "-Wconversion"
39534 const char neg_one = (char) -1, const_zero = (
char) 0;
39535#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
39536#pragma GCC diagnostic pop
39538 const int is_unsigned = neg_one > const_zero;
39540 #if CYTHON_USE_PYLONG_INTERNALS
39541 if (unlikely(__Pyx_PyLong_IsNeg(x))) {
39542 goto raise_neg_overflow;
39543 }
else if (__Pyx_PyLong_IsCompact(x)) {
39544 __PYX_VERIFY_RETURN_INT(
char, __Pyx_compact_upylong, __Pyx_PyLong_CompactValueUnsigned(x))
39548 return __Pyx_PyULong___Pyx_PyLong_As_char(x);
39551 #if CYTHON_USE_PYLONG_INTERNALS
39552 if (__Pyx_PyLong_IsCompact(x)) {
39553 __PYX_VERIFY_RETURN_INT(
char, __Pyx_compact_pylong, __Pyx_PyLong_CompactValue(x))
39557 return __Pyx_PySLong___Pyx_PyLong_As_char(x);
39560#if CYTHON_USE_PYLONG_INTERNALS
39562 return __Pyx_raise_neg_overflow___Pyx_PyLong_As_char();
39564 return __Pyx_raise_overflow___Pyx_PyLong_As_char();
39567static char __Pyx_NonPyLong___Pyx_PyLong_As_char(PyObject *x) {
39569 PyObject *tmp = __Pyx_PyNumber_Long(x);
39570 if (!tmp)
return (
char) -1;
39571 val = __Pyx_PyLong_As_char(tmp);
39575static CYTHON_INLINE
char __Pyx_PyLong_As_char(PyObject *x) {
39576 if (likely(PyLong_Check(x))) {
39577 return __Pyx_PyLong___Pyx_PyLong_As_char(x);
39579 return __Pyx_NonPyLong___Pyx_PyLong_As_char(x);
39584#if __PYX_LIMITED_VERSION_HEX < 0x030b0000
39585void __Pyx_init_runtime_version(
void) {
39586 if (__Pyx_cached_runtime_version == 0) {
39587 const char* rt_version = Py_GetVersion();
39588 unsigned long version = 0;
39589 unsigned long factor = 0x01000000UL;
39590 unsigned int digit = 0;
39593 while (
'0' <= rt_version[i] && rt_version[i] <=
'9') {
39594 digit = digit * 10 + (
unsigned int) (rt_version[i] -
'0');
39597 version += factor * digit;
39598 if (rt_version[i] !=
'.')
39604 __Pyx_cached_runtime_version = version;
39608static unsigned long __Pyx_get_runtime_version(
void) {
39609#if __PYX_LIMITED_VERSION_HEX >= 0x030b0000
39610 return Py_Version & ~0xFFUL;
39612 return __Pyx_cached_runtime_version;
39617static int __Pyx_check_binary_version(
unsigned long ct_version,
unsigned long rt_version,
int allow_newer) {
39618 const unsigned long MAJOR_MINOR = 0xFFFF0000UL;
39619 if ((rt_version & MAJOR_MINOR) == (ct_version & MAJOR_MINOR))
39621 if (likely(allow_newer && (rt_version & MAJOR_MINOR) > (ct_version & MAJOR_MINOR)))
39625 PyOS_snprintf(message,
sizeof(message),
39626 "compile time Python version %d.%d "
39627 "of module '%.100s' "
39629 "runtime version %d.%d",
39630 (
int) (ct_version >> 24), (
int) ((ct_version >> 16) & 0xFF),
39632 (allow_newer) ?
"was newer than" :
"does not match",
39633 (
int) (rt_version >> 24), (
int) ((rt_version >> 16) & 0xFF)
39635 return PyErr_WarnEx(NULL, message, 1);
39640#if CYTHON_COMPILING_IN_LIMITED_API
39641 static PyObject* __Pyx__PyCode_New(
int a,
int p,
int k,
int l,
int s,
int f,
39642 PyObject *code, PyObject *
c, PyObject*
n, PyObject *
v,
39643 PyObject *fv, PyObject *cell, PyObject* fn,
39644 PyObject *name,
int fline, PyObject *lnos) {
39645 PyObject *exception_table = NULL;
39646 PyObject *types_module=NULL, *code_type=NULL, *result=NULL;
39647 #if __PYX_LIMITED_VERSION_HEX < 0x030b0000
39648 PyObject *version_info;
39649 PyObject *py_minor_version = NULL;
39651 long minor_version = 0;
39652 #if __PYX_LIMITED_VERSION_HEX >= 0x030b0000
39653 minor_version = 11;
39655 if (!(version_info = PySys_GetObject(
"version_info")))
goto end;
39656 if (!(py_minor_version = PySequence_GetItem(version_info, 1)))
goto end;
39657 minor_version = PyLong_AsLong(py_minor_version);
39658 Py_DECREF(py_minor_version);
39659 if (minor_version == -1 && PyErr_Occurred())
goto end;
39661 if (!(types_module = PyImport_ImportModule(
"types")))
goto end;
39662 if (!(code_type = PyObject_GetAttrString(types_module,
"CodeType")))
goto end;
39663 if (minor_version <= 10) {
39664 result = PyObject_CallFunction(code_type,
"iiiiiiOOOOOOiOOO", a,p, k, l,
s,
f, code,
39665 c,
n,
v, fn, name, fline, lnos, fv, cell);
39667 if (!(exception_table = PyBytes_FromStringAndSize(NULL, 0)))
goto end;
39668 result = PyObject_CallFunction(code_type,
"iiiiiiOOOOOOOiOOOO", a,p, k, l,
s,
f, code,
39669 c,
n,
v, fn, name, name, fline, lnos, exception_table, fv, cell);
39672 Py_XDECREF(code_type);
39673 Py_XDECREF(exception_table);
39674 Py_XDECREF(types_module);
39676 PyObject *exc_type, *exc_value, *exc_tb;
39677 PyErr_Fetch(&exc_type, &exc_value, &exc_tb);
39678 if (PyErr_WarnFormat(
39679 PyExc_RuntimeWarning, 1,
39680 "Code object creation failed in Cython module: %S\nTry recompiling with a more recent version of Cython.",
39681 exc_value ? exc_value : exc_type) == 0) {
39685 Py_DECREF(exc_type);
39686 Py_XDECREF(exc_value);
39687 Py_XDECREF(exc_tb);
39691#elif PY_VERSION_HEX >= 0x030B0000
39692 static PyCodeObject* __Pyx__PyCode_New(
int a,
int p,
int k,
int l,
int s,
int f,
39693 PyObject *code, PyObject *
c, PyObject*
n, PyObject *
v,
39694 PyObject *fv, PyObject *cell, PyObject* fn,
39695 PyObject *name,
int fline, PyObject *lnos) {
39696 PyCodeObject *result;
39698 #if PY_VERSION_HEX >= 0x030C0000
39699 PyUnstable_Code_NewWithPosOnlyArgs
39701 PyCode_NewWithPosOnlyArgs
39703 (a, p, k, l,
s,
f, code,
c,
n,
v, fv, cell, fn, name, name, fline, lnos, __pyx_mstate_global->__pyx_empty_bytes);
39704 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030c00A1
39705 if (likely(result))
39706 result->_co_firsttraceable = 0;
39710#elif !CYTHON_COMPILING_IN_PYPY
39711 #define __Pyx__PyCode_New(a, p, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\
39712 PyCode_NewWithPosOnlyArgs(a, p, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)
39714 #define __Pyx__PyCode_New(a, p, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\
39715 PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)
39717static PyObject* __Pyx_PyCode_New(
39718 const __Pyx_PyCode_New_function_description descr,
39719 PyObject *
const *varnames,
39720 PyObject *filename,
39721 PyObject *funcname,
39722 PyObject *line_table,
39723 PyObject *tuple_dedup_map
39725 PyObject *code_obj = NULL, *varnames_tuple_dedup = NULL, *code_bytes = NULL;
39726 Py_ssize_t var_count = (Py_ssize_t) descr.nlocals;
39727 PyObject *varnames_tuple = PyTuple_New(var_count);
39728 if (unlikely(!varnames_tuple))
return NULL;
39729 for (Py_ssize_t i=0; i < var_count; i++) {
39730 Py_INCREF(varnames[i]);
39731 if (__Pyx_PyTuple_SET_ITEM(varnames_tuple, i, varnames[i]) != (0))
goto done;
39733 #if CYTHON_COMPILING_IN_LIMITED_API
39734 varnames_tuple_dedup = PyDict_GetItem(tuple_dedup_map, varnames_tuple);
39735 if (!varnames_tuple_dedup) {
39736 if (unlikely(PyDict_SetItem(tuple_dedup_map, varnames_tuple, varnames_tuple) < 0))
goto done;
39737 varnames_tuple_dedup = varnames_tuple;
39740 varnames_tuple_dedup = PyDict_SetDefault(tuple_dedup_map, varnames_tuple, varnames_tuple);
39741 if (unlikely(!varnames_tuple_dedup))
goto done;
39743 #if CYTHON_AVOID_BORROWED_REFS
39744 Py_INCREF(varnames_tuple_dedup);
39746 if (__PYX_LIMITED_VERSION_HEX >= (0x030b0000) && line_table != NULL && !CYTHON_COMPILING_IN_GRAAL) {
39747 Py_ssize_t line_table_length = __Pyx_PyBytes_GET_SIZE(line_table);
39748 #if !CYTHON_ASSUME_SAFE_SIZE
39749 if (unlikely(line_table_length == -1))
goto done;
39751 Py_ssize_t code_len = (line_table_length * 2 + 4) & ~3LL;
39752 code_bytes = PyBytes_FromStringAndSize(NULL, code_len);
39753 if (unlikely(!code_bytes))
goto done;
39754 char* c_code_bytes = PyBytes_AsString(code_bytes);
39755 if (unlikely(!c_code_bytes))
goto done;
39756 memset(c_code_bytes, 0, (
size_t) code_len);
39758 code_obj = (PyObject*) __Pyx__PyCode_New(
39759 (
int) descr.argcount,
39760 (
int) descr.num_posonly_args,
39761 (
int) descr.num_kwonly_args,
39762 (
int) descr.nlocals,
39765 code_bytes ? code_bytes : __pyx_mstate_global->__pyx_empty_bytes,
39766 __pyx_mstate_global->__pyx_empty_tuple,
39767 __pyx_mstate_global->__pyx_empty_tuple,
39768 varnames_tuple_dedup,
39769 __pyx_mstate_global->__pyx_empty_tuple,
39770 __pyx_mstate_global->__pyx_empty_tuple,
39773 (
int) descr.first_line,
39774 (__PYX_LIMITED_VERSION_HEX >= (0x030b0000) && line_table) ? line_table : __pyx_mstate_global->__pyx_empty_bytes
39777 Py_XDECREF(code_bytes);
39778 #if CYTHON_AVOID_BORROWED_REFS
39779 Py_XDECREF(varnames_tuple_dedup);
39781 Py_DECREF(varnames_tuple);
39787static CYTHON_SMALL_CODE PyObject *__Pyx_DecompressString(
const char *
s, Py_ssize_t length,
int algo) {
39788#ifdef __Pyx_DecompressString_UNUSED
39789 CYTHON_UNUSED_VAR(
s);
39790 CYTHON_UNUSED_VAR(length);
39791 CYTHON_UNUSED_VAR(algo);
39794 PyObject *module = NULL, *decompress, *compressed_bytes, *decompressed;
39795 const char* module_name = algo == 3 ?
"compression.zstd" : algo == 2 ?
"bz2" :
"zlib";
39796 PyObject *methodname = PyUnicode_FromString(
"decompress");
39797 if (unlikely(!methodname))
return NULL;
39798 #if __PYX_LIMITED_VERSION_HEX >= 0x030e0000
39800 PyObject *fromlist = Py_BuildValue(
"[O]", methodname);
39801 if (unlikely(!fromlist))
goto bad;
39802 module = PyImport_ImportModuleLevel("compression.zstd", NULL, NULL, fromlist, 0);
39803 Py_DECREF(fromlist);
39806 module = PyImport_ImportModule(module_name);
39807 if (unlikely(!module))
goto import_failed;
39808 decompress = PyObject_GetAttr(module, methodname);
39809 if (unlikely(!decompress))
goto import_failed;
39812 char *memview_bytes =
const_cast<char*
>(
s);
39814 #if defined(__clang__)
39815 #pragma clang diagnostic push
39816 #pragma clang diagnostic ignored "-Wcast-qual"
39817 #elif !defined(__INTEL_COMPILER) && defined(__GNUC__)
39818 #pragma GCC diagnostic push
39819 #pragma GCC diagnostic ignored "-Wcast-qual"
39821 char *memview_bytes = (
char*)
s;
39822 #if defined(__clang__)
39823 #pragma clang diagnostic pop
39824 #elif !defined(__INTEL_COMPILER) && defined(__GNUC__)
39825 #pragma GCC diagnostic pop
39828 #if CYTHON_COMPILING_IN_LIMITED_API && !defined(PyBUF_READ)
39829 int memview_flags = 0x100;
39831 int memview_flags = PyBUF_READ;
39833 compressed_bytes = PyMemoryView_FromMemory(memview_bytes, length, memview_flags);
39835 if (unlikely(!compressed_bytes)) {
39836 Py_DECREF(decompress);
39839 decompressed = PyObject_CallFunctionObjArgs(decompress, compressed_bytes, NULL);
39840 Py_DECREF(compressed_bytes);
39841 Py_DECREF(decompress);
39843 Py_DECREF(methodname);
39844 return decompressed;
39846 PyErr_Format(PyExc_ImportError,
39847 "Failed to import '%.20s.decompress' - cannot initialise module strings. "
39848 "String compression was configured with the C macro 'CYTHON_COMPRESS_STRINGS=%d'.",
39849 module_name, algo);
39851 Py_XDECREF(module);
39852 Py_DECREF(methodname);
39858#ifndef __Pyx_DecompressString_LZSS_UNUSED
39860static CYTHON_SMALL_CODE
size_t __pyx_lzss_decompress(
const uint8_t* src, uint8_t* dst,
size_t dst_len) {
39861 size_t pos = 0, out_pos = 0;
39863 uint32_t flags = src[pos++] | 0xFF00;
39864 while (flags & 0x100) {
39866 dst[out_pos++] = src[pos++];
39868 uint32_t lo = src[pos++], hi = src[pos++];
39869 uint32_t end_offset_of_last_occurrence, match_length;
39870 if (!(lo & 0x80)) {
39871 end_offset_of_last_occurrence = lo;
39873 }
else if (!(hi & 0x80)) {
39874 end_offset_of_last_occurrence = 0x80 + (((hi << 2) & 0x180) | (lo & 0x7F));
39875 match_length = hi & 0x1F;
39877 end_offset_of_last_occurrence = 0x80 + ((hi & 0x7F) << 7 | (lo & 0x7F));
39878 match_length = src[pos++];
39881 size_t ref_pos = out_pos - end_offset_of_last_occurrence - match_length;
39882 memcpy(dst + out_pos, dst + ref_pos, match_length);
39883 out_pos += match_length;
39885 if (out_pos >= dst_len)
return pos;
39891static CYTHON_SMALL_CODE PyObject *__Pyx_DecompressString_LZSS(
const char *
s,
size_t compressed_length,
size_t uncompressed_length) {
39892#ifdef __Pyx_DecompressString_LZSS_UNUSED
39893 CYTHON_UNUSED_VAR(
s);
39894 CYTHON_UNUSED_VAR(compressed_length);
39895 CYTHON_UNUSED_VAR(uncompressed_length);
39899 unsigned char *result_data;
39901 result = PyBytes_FromStringAndSize(NULL, (Py_ssize_t) uncompressed_length);
39902 if (unlikely(!result))
return NULL;
39903 result_data = __Pyx_PyBytes_AsWritableUString(result);
39904 if (unlikely(!result_data))
goto bad;
39905 src_length = __pyx_lzss_decompress((
const uint8_t*)
s, result_data, uncompressed_length);
39906 if (unlikely(src_length != compressed_length))
goto decompression_failed;
39908decompression_failed:
39909 PyErr_SetString(PyExc_RuntimeError,
"LZSS string data decompression failed");
39917static CYTHON_INLINE Py_ssize_t __Pyx_ssize_strlen(
const char *
s) {
39918 size_t len = strlen(
s);
39919 if (unlikely(len > (
size_t) PY_SSIZE_T_MAX)) {
39920 PyErr_SetString(PyExc_OverflowError,
"byte string is too long");
39923 return (Py_ssize_t) len;
39925static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(
const char* c_str) {
39926 Py_ssize_t len = __Pyx_ssize_strlen(c_str);
39927 if (unlikely(len < 0))
return NULL;
39928 return __Pyx_PyUnicode_FromStringAndSize(c_str, len);
39930static CYTHON_INLINE PyObject* __Pyx_PyByteArray_FromString(
const char* c_str) {
39931 Py_ssize_t len = __Pyx_ssize_strlen(c_str);
39932 if (unlikely(len < 0))
return NULL;
39933 return PyByteArray_FromStringAndSize(c_str, len);
39935static CYTHON_INLINE
const char* __Pyx_PyObject_AsString(PyObject* o) {
39937 return __Pyx_PyObject_AsStringAndSize(o, &ignore);
39939#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_UTF8
39940static CYTHON_INLINE
const char* __Pyx_PyUnicode_AsStringAndSize(PyObject* o, Py_ssize_t *length) {
39941 if (unlikely(__Pyx_PyUnicode_READY(o) == -1))
return NULL;
39942#if CYTHON_COMPILING_IN_LIMITED_API
39944 const char* result;
39945 Py_ssize_t unicode_length;
39946 CYTHON_MAYBE_UNUSED_VAR(unicode_length);
39947 #if __PYX_LIMITED_VERSION_HEX < 0x030A0000
39948 if (unlikely(PyArg_Parse(o,
"s#", &result, length) < 0))
return NULL;
39950 result = PyUnicode_AsUTF8AndSize(o, length);
39952 #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
39953 unicode_length = PyUnicode_GetLength(o);
39954 if (unlikely(unicode_length < 0))
return NULL;
39955 if (unlikely(unicode_length != *length)) {
39956 PyUnicode_AsASCIIString(o);
39963#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
39964 if (likely(PyUnicode_IS_ASCII(o))) {
39965 *length = PyUnicode_GET_LENGTH(o);
39966 return PyUnicode_AsUTF8(o);
39968 PyUnicode_AsASCIIString(o);
39972 return PyUnicode_AsUTF8AndSize(o, length);
39977static CYTHON_INLINE
const char* __Pyx_PyObject_AsStringAndSize(PyObject* o, Py_ssize_t *length) {
39978#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_UTF8
39979 if (PyUnicode_Check(o)) {
39980 return __Pyx_PyUnicode_AsStringAndSize(o, length);
39983 if (PyByteArray_Check(o)) {
39984#if (CYTHON_ASSUME_SAFE_SIZE && CYTHON_ASSUME_SAFE_MACROS) || (CYTHON_COMPILING_IN_PYPY && (defined(PyByteArray_AS_STRING) && defined(PyByteArray_GET_SIZE)))
39985 *length = PyByteArray_GET_SIZE(o);
39986 return PyByteArray_AS_STRING(o);
39988 *length = PyByteArray_Size(o);
39989 if (*length == -1)
return NULL;
39990 return PyByteArray_AsString(o);
39995 int r = PyBytes_AsStringAndSize(o, &result, length);
39996 if (unlikely(
r < 0)) {
40003static CYTHON_INLINE
int __Pyx_PyObject_IsTrue(PyObject* x) {
40004 int is_true = x == Py_True;
40005 if (is_true | (x == Py_False) | (x == Py_None))
return is_true;
40006 else return PyObject_IsTrue(x);
40008static CYTHON_INLINE
int __Pyx_PyObject_IsTrueAndDecref(PyObject* x) {
40010 if (unlikely(!x))
return -1;
40011 retval = __Pyx_PyObject_IsTrue(x);
40015static PyObject* __Pyx_PyNumber_LongWrongResultType(PyObject* result) {
40016 __Pyx_TypeName result_type_name = __Pyx_PyType_GetFullyQualifiedName(Py_TYPE(result));
40017 #if CYTHON_COMPILING_IN_LIMITED_API && __PYX_LIMITED_VERSION_HEX < 0x030d0000
40018 if (unlikely(!result_type_name))
goto bad;
40020 if (PyLong_Check(result)) {
40021 if (PyErr_WarnFormat(PyExc_DeprecationWarning, 1,
40022 "__int__ returned non-int (type " __Pyx_FMT_TYPENAME
"). "
40023 "The ability to return an instance of a strict subclass of int is deprecated, "
40024 "and may be removed in a future version of Python.",
40025 result_type_name)) {
40026 __Pyx_DECREF_TypeName(result_type_name);
40029 __Pyx_DECREF_TypeName(result_type_name);
40032 PyErr_Format(PyExc_TypeError,
40033 "__int__ returned non-int (type " __Pyx_FMT_TYPENAME
")",
40035 __Pyx_DECREF_TypeName(result_type_name);
40040static CYTHON_INLINE PyObject* __Pyx_PyNumber_Long(PyObject* x) {
40041#if CYTHON_USE_TYPE_SLOTS
40042 PyNumberMethods *m;
40044 PyObject *res = NULL;
40045 if (likely(PyLong_Check(x)))
40046 return __Pyx_NewRef(x);
40047#if CYTHON_USE_TYPE_SLOTS
40048 m = Py_TYPE(x)->tp_as_number;
40049 if (likely(m && m->nb_int)) {
40050 res = m->nb_int(x);
40053 if (!PyBytes_CheckExact(x) && !PyUnicode_CheckExact(x)) {
40054 res = PyNumber_Long(x);
40058 if (unlikely(!PyLong_CheckExact(res))) {
40059 return __Pyx_PyNumber_LongWrongResultType(res);
40062 else if (!PyErr_Occurred()) {
40063 PyErr_SetString(PyExc_TypeError,
40064 "an integer is required");
40068static CYTHON_INLINE Py_ssize_t __Pyx_PyLong_AsSsize_t(PyObject* b) {
40069 #if CYTHON_USE_PYLONG_INTERNALS
40071 const Py_ssize_t size = __Pyx_PyLong_DigitCount(b);
40072 const int is_neg = __Pyx_PyLong_IsNeg(b);
40073 const digit* digits = __Pyx_PyLong_Digits(b);
40074 if (size == 0)
return 0;
40075 #if SIZEOF_SIZE_T * 8 > 1 * PyLong_SHIFT
40077 ival = (Py_ssize_t) (((
size_t)digits[0]));
40080 #if SIZEOF_SIZE_T * 8 > 2 * PyLong_SHIFT
40082 ival = (Py_ssize_t) (((((
size_t)digits[1]) << PyLong_SHIFT) | (
size_t)digits[0]));
40085 #if SIZEOF_SIZE_T * 8 > 3 * PyLong_SHIFT
40087 ival = (Py_ssize_t) (((((((
size_t)digits[2]) << PyLong_SHIFT) | (
size_t)digits[1]) << PyLong_SHIFT) | (
size_t)digits[0]));
40090 #if SIZEOF_SIZE_T * 8 > 4 * PyLong_SHIFT
40092 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]));
40095 return PyLong_AsSsize_t(b);
40096 return is_neg ? -ival : ival;
40098 return PyLong_AsSsize_t(b);
40101static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject* b) {
40102 if (likely(PyLong_Check(b))) {
40103 return __Pyx_PyLong_AsSsize_t(b);
40106 PyObject *x = PyNumber_Index(b);
40107 if (unlikely(!x))
return -1;
40108 ival = __Pyx_PyLong_AsSsize_t(x);
40113static CYTHON_INLINE Py_hash_t __Pyx_PyIndex_AsHash_t(PyObject* o) {
40114 if (
sizeof(Py_hash_t) ==
sizeof(Py_ssize_t)) {
40115 return (Py_hash_t) __Pyx_PyIndex_AsSsize_t(o);
40119 x = PyNumber_Index(o);
40121 ival = PyLong_AsLong(x);
40126static CYTHON_INLINE PyObject *__Pyx_Owned_Py_None(
int b) {
40127 CYTHON_UNUSED_VAR(b);
40128 return __Pyx_NewRef(Py_None);
40130static CYTHON_INLINE PyObject * __Pyx_PyBool_FromLong(
long b) {
40131 return __Pyx_NewRef(b ? Py_True: Py_False);
40133static CYTHON_INLINE PyObject * __Pyx_PyLong_FromSize_t(
size_t ival) {
40134 return PyLong_FromSize_t(ival);
40139#if CYTHON_PEP489_MULTI_PHASE_INIT && CYTHON_USE_MODULE_STATE
40140#ifndef CYTHON_MODULE_STATE_LOOKUP_THREAD_SAFE
40141#if (CYTHON_COMPILING_IN_LIMITED_API || PY_VERSION_HEX >= 0x030C0000)
40142 #define CYTHON_MODULE_STATE_LOOKUP_THREAD_SAFE 1
40144 #define CYTHON_MODULE_STATE_LOOKUP_THREAD_SAFE 0
40147#if CYTHON_MODULE_STATE_LOOKUP_THREAD_SAFE && !CYTHON_ATOMICS
40148#error "Module state with PEP489 requires atomics. Currently that's one of\
40149 C11, C++11, gcc atomic intrinsics or MSVC atomic intrinsics"
40151#if !CYTHON_MODULE_STATE_LOOKUP_THREAD_SAFE
40152#define __Pyx_ModuleStateLookup_Lock()
40153#define __Pyx_ModuleStateLookup_Unlock()
40154#elif !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX >= 0x030d0000
40155static PyMutex __Pyx_ModuleStateLookup_mutex = {0};
40156#define __Pyx_ModuleStateLookup_Lock() PyMutex_Lock(&__Pyx_ModuleStateLookup_mutex)
40157#define __Pyx_ModuleStateLookup_Unlock() PyMutex_Unlock(&__Pyx_ModuleStateLookup_mutex)
40158#elif defined(__cplusplus) && __cplusplus >= 201103L
40160static std::mutex __Pyx_ModuleStateLookup_mutex;
40161#define __Pyx_ModuleStateLookup_Lock() __Pyx_ModuleStateLookup_mutex.lock()
40162#define __Pyx_ModuleStateLookup_Unlock() __Pyx_ModuleStateLookup_mutex.unlock()
40163#elif defined(__STDC_VERSION__) && (__STDC_VERSION__ > 201112L) && !defined(__STDC_NO_THREADS__)
40164#include <threads.h>
40165static mtx_t __Pyx_ModuleStateLookup_mutex;
40166static once_flag __Pyx_ModuleStateLookup_mutex_once_flag = ONCE_FLAG_INIT;
40167static void __Pyx_ModuleStateLookup_initialize_mutex(
void) {
40168 mtx_init(&__Pyx_ModuleStateLookup_mutex, mtx_plain);
40170#define __Pyx_ModuleStateLookup_Lock()\
40171 call_once(&__Pyx_ModuleStateLookup_mutex_once_flag, __Pyx_ModuleStateLookup_initialize_mutex);\
40172 mtx_lock(&__Pyx_ModuleStateLookup_mutex)
40173#define __Pyx_ModuleStateLookup_Unlock() mtx_unlock(&__Pyx_ModuleStateLookup_mutex)
40174#elif defined(HAVE_PTHREAD_H)
40175#include <pthread.h>
40176static pthread_mutex_t __Pyx_ModuleStateLookup_mutex = PTHREAD_MUTEX_INITIALIZER;
40177#define __Pyx_ModuleStateLookup_Lock() pthread_mutex_lock(&__Pyx_ModuleStateLookup_mutex)
40178#define __Pyx_ModuleStateLookup_Unlock() pthread_mutex_unlock(&__Pyx_ModuleStateLookup_mutex)
40179#elif defined(_WIN32)
40180#include <Windows.h>
40181static SRWLOCK __Pyx_ModuleStateLookup_mutex = SRWLOCK_INIT;
40182#define __Pyx_ModuleStateLookup_Lock() AcquireSRWLockExclusive(&__Pyx_ModuleStateLookup_mutex)
40183#define __Pyx_ModuleStateLookup_Unlock() ReleaseSRWLockExclusive(&__Pyx_ModuleStateLookup_mutex)
40185#error "No suitable lock available for CYTHON_MODULE_STATE_LOOKUP_THREAD_SAFE.\
40186 Requires C standard >= C11, or C++ standard >= C++11,\
40187 or pthreads, or the Windows 32 API, or Python >= 3.13."
40192} __Pyx_InterpreterIdAndModule;
40194 char interpreter_id_as_index;
40196 Py_ssize_t allocated;
40197 __Pyx_InterpreterIdAndModule table[1];
40198} __Pyx_ModuleStateLookupData;
40199#define __PYX_MODULE_STATE_LOOKUP_SMALL_SIZE 32
40200#if CYTHON_MODULE_STATE_LOOKUP_THREAD_SAFE
40201static __pyx_atomic_int_type __Pyx_ModuleStateLookup_read_counter = 0;
40203#if CYTHON_MODULE_STATE_LOOKUP_THREAD_SAFE
40204static __pyx_atomic_ptr_type __Pyx_ModuleStateLookup_data = 0;
40206static __Pyx_ModuleStateLookupData* __Pyx_ModuleStateLookup_data = NULL;
40208static __Pyx_InterpreterIdAndModule* __Pyx_State_FindModuleStateLookupTableLowerBound(
40209 __Pyx_InterpreterIdAndModule* table,
40211 int64_t interpreterId) {
40212 __Pyx_InterpreterIdAndModule* begin = table;
40213 __Pyx_InterpreterIdAndModule* end = begin + count;
40214 if (begin->id == interpreterId) {
40217 while ((end - begin) > __PYX_MODULE_STATE_LOOKUP_SMALL_SIZE) {
40218 __Pyx_InterpreterIdAndModule* halfway = begin + (end - begin)/2;
40219 if (halfway->id == interpreterId) {
40222 if (halfway->id < interpreterId) {
40228 for (; begin < end; ++begin) {
40229 if (begin->id >= interpreterId)
return begin;
40233static PyObject *__Pyx_State_FindModule(CYTHON_UNUSED
void* dummy) {
40234 int64_t interpreter_id = PyInterpreterState_GetID(PyInterpreterState_Get());
40235 if (interpreter_id == -1)
return NULL;
40236#if CYTHON_MODULE_STATE_LOOKUP_THREAD_SAFE
40237 __Pyx_ModuleStateLookupData* data = (__Pyx_ModuleStateLookupData*)__pyx_atomic_pointer_load_relaxed(&__Pyx_ModuleStateLookup_data);
40239 __pyx_atomic_incr_acq_rel(&__Pyx_ModuleStateLookup_read_counter);
40240 if (likely(data)) {
40241 __Pyx_ModuleStateLookupData* new_data = (__Pyx_ModuleStateLookupData*)__pyx_atomic_pointer_load_acquire(&__Pyx_ModuleStateLookup_data);
40242 if (likely(data == new_data)) {
40243 goto read_finished;
40246 __pyx_atomic_decr_acq_rel(&__Pyx_ModuleStateLookup_read_counter);
40247 __Pyx_ModuleStateLookup_Lock();
40248 __pyx_atomic_incr_relaxed(&__Pyx_ModuleStateLookup_read_counter);
40249 data = (__Pyx_ModuleStateLookupData*)__pyx_atomic_pointer_load_relaxed(&__Pyx_ModuleStateLookup_data);
40250 __Pyx_ModuleStateLookup_Unlock();
40254 __Pyx_ModuleStateLookupData* data = __Pyx_ModuleStateLookup_data;
40256 __Pyx_InterpreterIdAndModule* found = NULL;
40257 if (unlikely(!data))
goto end;
40258 if (data->interpreter_id_as_index) {
40259 if (interpreter_id < data->count) {
40260 found = data->table+interpreter_id;
40263 found = __Pyx_State_FindModuleStateLookupTableLowerBound(
40264 data->table, data->count, interpreter_id);
40268 PyObject *result=NULL;
40269 if (found && found->id == interpreter_id) {
40270 result = found->module;
40272#if CYTHON_MODULE_STATE_LOOKUP_THREAD_SAFE
40273 __pyx_atomic_decr_acq_rel(&__Pyx_ModuleStateLookup_read_counter);
40278#if CYTHON_MODULE_STATE_LOOKUP_THREAD_SAFE
40279static void __Pyx_ModuleStateLookup_wait_until_no_readers(
void) {
40280 while (__pyx_atomic_load(&__Pyx_ModuleStateLookup_read_counter) != 0);
40283#define __Pyx_ModuleStateLookup_wait_until_no_readers()
40285static int __Pyx_State_AddModuleInterpIdAsIndex(__Pyx_ModuleStateLookupData **old_data, PyObject* module, int64_t interpreter_id) {
40286 Py_ssize_t to_allocate = (*old_data)->allocated;
40287 while (to_allocate <= interpreter_id) {
40288 if (to_allocate == 0) to_allocate = 1;
40289 else to_allocate *= 2;
40291 __Pyx_ModuleStateLookupData *new_data = *old_data;
40292 if (to_allocate != (*old_data)->allocated) {
40293 new_data = (__Pyx_ModuleStateLookupData *)realloc(
40295 sizeof(__Pyx_ModuleStateLookupData)+(to_allocate-1)*
sizeof(__Pyx_InterpreterIdAndModule));
40300 for (Py_ssize_t i = new_data->allocated; i < to_allocate; ++i) {
40301 new_data->table[i].id = i;
40302 new_data->table[i].module = NULL;
40304 new_data->allocated = to_allocate;
40306 new_data->table[interpreter_id].module =
module;
40307 if (new_data->count < interpreter_id+1) {
40308 new_data->count = interpreter_id+1;
40310 *old_data = new_data;
40313static void __Pyx_State_ConvertFromInterpIdAsIndex(__Pyx_ModuleStateLookupData *data) {
40314 __Pyx_InterpreterIdAndModule *read = data->table;
40315 __Pyx_InterpreterIdAndModule *write = data->table;
40316 __Pyx_InterpreterIdAndModule *end = read + data->count;
40317 for (; read<end; ++read) {
40318 if (read->module) {
40319 write->id = read->id;
40320 write->module = read->module;
40324 data->count = write - data->table;
40325 for (; write<end; ++write) {
40327 write->module = NULL;
40329 data->interpreter_id_as_index = 0;
40331static int __Pyx_State_AddModule(PyObject* module, CYTHON_UNUSED
void* dummy) {
40332 int64_t interpreter_id = PyInterpreterState_GetID(PyInterpreterState_Get());
40333 if (interpreter_id == -1)
return -1;
40335 __Pyx_ModuleStateLookup_Lock();
40336#if CYTHON_MODULE_STATE_LOOKUP_THREAD_SAFE
40337 __Pyx_ModuleStateLookupData *old_data = (__Pyx_ModuleStateLookupData *)
40338 __pyx_atomic_pointer_exchange(&__Pyx_ModuleStateLookup_data, 0);
40340 __Pyx_ModuleStateLookupData *old_data = __Pyx_ModuleStateLookup_data;
40342 __Pyx_ModuleStateLookupData *new_data = old_data;
40344 new_data = (__Pyx_ModuleStateLookupData *)calloc(1,
sizeof(__Pyx_ModuleStateLookupData));
40350 new_data->allocated = 1;
40351 new_data->interpreter_id_as_index = 1;
40353 __Pyx_ModuleStateLookup_wait_until_no_readers();
40354 if (new_data->interpreter_id_as_index) {
40355 if (interpreter_id < __PYX_MODULE_STATE_LOOKUP_SMALL_SIZE) {
40356 result = __Pyx_State_AddModuleInterpIdAsIndex(&new_data, module, interpreter_id);
40359 __Pyx_State_ConvertFromInterpIdAsIndex(new_data);
40362 Py_ssize_t insert_at = 0;
40364 __Pyx_InterpreterIdAndModule* lower_bound = __Pyx_State_FindModuleStateLookupTableLowerBound(
40365 new_data->table, new_data->count, interpreter_id);
40366 assert(lower_bound);
40367 insert_at = lower_bound - new_data->table;
40368 if (unlikely(insert_at < new_data->count && lower_bound->id == interpreter_id)) {
40369 lower_bound->module =
module;
40373 if (new_data->count+1 >= new_data->allocated) {
40374 Py_ssize_t to_allocate = (new_data->count+1)*2;
40376 (__Pyx_ModuleStateLookupData*)realloc(
40378 sizeof(__Pyx_ModuleStateLookupData) +
40379 (to_allocate-1)*
sizeof(__Pyx_InterpreterIdAndModule));
40382 new_data = old_data;
40386 new_data->allocated = to_allocate;
40389 int64_t last_id = interpreter_id;
40390 PyObject *last_module =
module;
40391 for (Py_ssize_t i=insert_at; i<new_data->count; ++i) {
40392 int64_t current_id = new_data->table[i].id;
40393 new_data->table[i].id = last_id;
40394 last_id = current_id;
40395 PyObject *current_module = new_data->table[i].module;
40396 new_data->table[i].module = last_module;
40397 last_module = current_module;
40401#if CYTHON_MODULE_STATE_LOOKUP_THREAD_SAFE
40402 __pyx_atomic_pointer_exchange(&__Pyx_ModuleStateLookup_data, new_data);
40404 __Pyx_ModuleStateLookup_data = new_data;
40406 __Pyx_ModuleStateLookup_Unlock();
40409static int __Pyx_State_RemoveModule(CYTHON_UNUSED
void* dummy) {
40410 int64_t interpreter_id = PyInterpreterState_GetID(PyInterpreterState_Get());
40411 if (interpreter_id == -1)
return -1;
40412 __Pyx_ModuleStateLookup_Lock();
40413#if CYTHON_MODULE_STATE_LOOKUP_THREAD_SAFE
40414 __Pyx_ModuleStateLookupData *data = (__Pyx_ModuleStateLookupData *)
40415 __pyx_atomic_pointer_exchange(&__Pyx_ModuleStateLookup_data, 0);
40417 __Pyx_ModuleStateLookupData *data = __Pyx_ModuleStateLookup_data;
40419 if (data->interpreter_id_as_index) {
40420 if (interpreter_id < data->count) {
40421 data->table[interpreter_id].module = NULL;
40426 __Pyx_ModuleStateLookup_wait_until_no_readers();
40427 __Pyx_InterpreterIdAndModule* lower_bound = __Pyx_State_FindModuleStateLookupTableLowerBound(
40428 data->table, data->count, interpreter_id);
40429 if (!lower_bound)
goto done;
40430 if (lower_bound->id != interpreter_id)
goto done;
40431 __Pyx_InterpreterIdAndModule *end = data->table+data->count;
40432 for (;lower_bound<end-1; ++lower_bound) {
40433 lower_bound->id = (lower_bound+1)->
id;
40434 lower_bound->module = (lower_bound+1)->module;
40438 if (data->count == 0) {
40443#if CYTHON_MODULE_STATE_LOOKUP_THREAD_SAFE
40444 __pyx_atomic_pointer_exchange(&__Pyx_ModuleStateLookup_data, data);
40446 __Pyx_ModuleStateLookup_data = data;
40448 __Pyx_ModuleStateLookup_Unlock();
40455#pragma warning( pop )